From feeb800d40c173f271593312657db4e8f2d90520 Mon Sep 17 00:00:00 2001 From: Jacob Sapoznikow Date: Fri, 10 Jan 2025 23:23:44 +0000 Subject: [PATCH] Reformat patches --- README.md | 2 +- client.patch | 323819 --------------- patch-index.json | 2129 + patch-reformatter.py | 52 + patches/Start.java.patch | 20 + .../prupe/mcpatcher/BlendMethod.java.patch | 112 + .../mcpatcher/Config$FileEntry.java.patch | 16 + .../mcpatcher/Config$ModEntry.java.patch | 15 + .../mcpatcher/Config$ProfileEntry.java.patch | 29 + .../mcpatcher/Config$VersionEntry.java.patch | 12 + patches/com/prupe/mcpatcher/Config.java.patch | 267 + .../prupe/mcpatcher/InputHandler.java.patch | 57 + .../com/prupe/mcpatcher/JsonUtils.java.patch | 137 + .../prupe/mcpatcher/MCLogger$1$1.java.patch | 34 + .../com/prupe/mcpatcher/MCLogger$1.java.patch | 28 + .../mcpatcher/MCLogger$ErrorLevel.java.patch | 12 + .../com/prupe/mcpatcher/MCLogger.java.patch | 159 + .../prupe/mcpatcher/MCPatcherUtils.java.patch | 413 + .../prupe/mcpatcher/ProfilerAPI.java.patch | 28 + .../mcpatcher/TessellatorUtils.java.patch | 207 + .../mcpatcher/TexturePackAPI$1.java.patch | 35 + .../mcpatcher/TexturePackAPI$2.java.patch | 13 + .../prupe/mcpatcher/TexturePackAPI.java.patch | 373 + .../TexturePackChangeHandler$1.java.patch | 12 + .../TexturePackChangeHandler.java.patch | 221 + .../prupe/mcpatcher/TileLoader$1.java.patch | 89 + .../com/prupe/mcpatcher/TileLoader.java.patch | 408 + .../mcpatcher/WeightedIndex$1.java.patch | 18 + .../mcpatcher/WeightedIndex$2.java.patch | 43 + .../prupe/mcpatcher/WeightedIndex.java.patch | 82 + .../prupe/mcpatcher/cc/BiomeHelper.java.patch | 91 + .../prupe/mcpatcher/cc/ColorMap.java.patch | 105 + .../mcpatcher/cc/ColorizeBlock.java.patch | 310 + .../mcpatcher/cc/ColorizeEntity.java.patch | 126 + .../mcpatcher/cc/ColorizeItem.java.patch | 122 + .../mcpatcher/cc/ColorizeWorld.java.patch | 208 + .../prupe/mcpatcher/cc/Colorizer$1.java.patch | 69 + .../prupe/mcpatcher/cc/Colorizer.java.patch | 169 + .../prupe/mcpatcher/cc/Lightmap.java.patch | 156 + .../prupe/mcpatcher/ctm/CTMUtils$1.java.patch | 92 + .../prupe/mcpatcher/ctm/CTMUtils$2.java.patch | 34 + .../prupe/mcpatcher/ctm/CTMUtils$3.java.patch | 24 + .../CTMUtils$TileOverrideIterator.java.patch | 114 + .../prupe/mcpatcher/ctm/CTMUtils.java.patch | 264 + .../ctm/GlassPaneRenderer.java.patch | 142 + .../mcpatcher/ctm/ITileOverride.java.patch | 27 + .../mcpatcher/ctm/RenderPass$1.java.patch | 51 + .../mcpatcher/ctm/RenderPass$2.java.patch | 37 + .../prupe/mcpatcher/ctm/RenderPass.java.patch | 149 + .../mcpatcher/ctm/RenderPassAPI.java.patch | 24 + .../mcpatcher/ctm/TileOverride.java.patch | 759 + .../TileOverrideImpl$BetterGrass.java.patch | 87 + .../ctm/TileOverrideImpl$CTM.java.patch | 48 + .../ctm/TileOverrideImpl$Fixed.java.patch | 33 + .../TileOverrideImpl$Horizontal.java.patch | 52 + ...OverrideImpl$HorizontalVertical.java.patch | 65 + .../ctm/TileOverrideImpl$Random1.java.patch | 54 + .../ctm/TileOverrideImpl$Repeat.java.patch | 109 + .../ctm/TileOverrideImpl$Top.java.patch | 40 + .../ctm/TileOverrideImpl$Vertical.java.patch | 52 + ...OverrideImpl$VerticalHorizontal.java.patch | 65 + .../mcpatcher/ctm/TileOverrideImpl.java.patch | 7 + .../prupe/mcpatcher/hd/AAHelper.java.patch | 156 + .../mcpatcher/hd/BorderedTexture.java.patch | 128 + .../mcpatcher/hd/CustomAnimation$1.java.patch | 51 + .../mcpatcher/hd/CustomAnimation.java.patch | 357 + .../mcpatcher/hd/FancyDial$Layer.java.patch | 38 + .../prupe/mcpatcher/hd/FancyDial.java.patch | 627 + .../prupe/mcpatcher/hd/FontUtils$1.java.patch | 27 + .../prupe/mcpatcher/hd/FontUtils.java.patch | 293 + .../mcpatcher/hd/MipmapHelper.java.patch | 491 + .../mcpatcher/mob/LineRenderer.java.patch | 177 + .../prupe/mcpatcher/mob/MobOverlay.java.patch | 135 + .../mcpatcher/mob/MobRandomizer$1.java.patch | 22 + .../mob/MobRandomizer$ExtraInfo.java.patch | 189 + .../mcpatcher/mob/MobRandomizer.java.patch | 61 + .../mob/MobRuleList$MobRuleEntry.java.patch | 115 + .../mcpatcher/mob/MobRuleList.java.patch | 156 + .../mcpatcher/sky/FireworksHelper.java.patch | 59 + .../mcpatcher/sky/SkyRenderer$1.java.patch | 30 + .../sky/SkyRenderer$Layer.java.patch | 267 + .../sky/SkyRenderer$WorldEntry.java.patch | 121 + .../mcpatcher/sky/SkyRenderer.java.patch | 113 + .../client/ClientBrandRetriever.java.patch | 10 + .../net/minecraft/client/main/Main.java.patch | 109 + .../server/MinecraftServer.java.patch | 1283 + patches/net/minecraft/src/AABBPool.java.patch | 106 + .../src/AbstractClientPlayer.java.patch | 159 + .../src/AbstractResourcePack.java.patch | 102 + .../minecraft/src/AbstractTexture.java.patch | 31 + .../net/minecraft/src/Achievement.java.patch | 187 + .../minecraft/src/AchievementList.java.patch | 109 + .../minecraft/src/AchievementMap.java.patch | 50 + .../minecraft/src/ActiveRenderInfo.java.patch | 143 + .../net/minecraft/src/AnimalChest.java.patch | 18 + .../minecraft/src/AnimationFrame.java.patch | 21 + .../src/AnimationMetadataSection.java.patch | 72 + ...mationMetadataSectionSerializer.java.patch | 123 + .../minecraft/src/AnvilChunkLoader.java.patch | 473 + .../src/AnvilChunkLoaderPending.java.patch | 14 + .../src/AnvilConverterData.java.patch | 14 + .../src/AnvilConverterException.java.patch | 12 + .../src/AnvilSaveConverter.java.patch | 263 + .../AnvilSaveConverterFileFilter.java.patch | 18 + .../minecraft/src/AnvilSaveHandler.java.patch | 51 + .../src/AttributeInstance.java.patch | 12 + .../src/AttributeModifier.java.patch | 105 + .../minecraft/src/AxisAlignedBB.java.patch | 626 + patches/net/minecraft/src/Backup.java.patch | 28 + .../net/minecraft/src/BackupList.java.patch | 39 + patches/net/minecraft/src/BanEntry.java.patch | 157 + patches/net/minecraft/src/BanList.java.patch | 155 + .../minecraft/src/BaseAttribute.java.patch | 46 + .../minecraft/src/BaseAttributeMap.java.patch | 75 + .../BaseMetadataSectionSerializer.java.patch | 179 + .../BehaviorDefaultDispenseItem.java.patch | 98 + .../src/BehaviorDispenseArmor.java.patch | 50 + .../BehaviorDispenseItemProvider.java.patch | 16 + .../src/BehaviorDispenseMinecart.java.patch | 68 + .../src/BehaviorProjectileDispense.java.patch | 46 + .../net/minecraft/src/BiomeCache.java.patch | 117 + .../minecraft/src/BiomeCacheBlock.java.patch | 56 + .../minecraft/src/BiomeDecorator.java.patch | 574 + .../src/BiomeEndDecorator.java.patch | 43 + .../net/minecraft/src/BiomeGenBase.java.patch | 402 + .../minecraft/src/BiomeGenBeach.java.patch | 15 + .../minecraft/src/BiomeGenDesert.java.patch | 37 + .../net/minecraft/src/BiomeGenEnd.java.patch | 33 + .../minecraft/src/BiomeGenForest.java.patch | 25 + .../net/minecraft/src/BiomeGenHell.java.patch | 26 + .../minecraft/src/BiomeGenHills.java.patch | 59 + .../minecraft/src/BiomeGenJungle.java.patch | 62 + .../src/BiomeGenMushroomIsland.java.patch | 26 + .../minecraft/src/BiomeGenOcean.java.patch | 14 + .../minecraft/src/BiomeGenPlains.java.patch | 15 + .../minecraft/src/BiomeGenRiver.java.patch | 14 + .../net/minecraft/src/BiomeGenSnow.java.patch | 12 + .../minecraft/src/BiomeGenSwamp.java.patch | 57 + .../minecraft/src/BiomeGenTaiga.java.patch | 25 + patches/net/minecraft/src/Block.java.patch | 1632 + .../net/minecraft/src/BlockAnvil.java.patch | 215 + .../src/BlockBasePressurePlate.java.patch | 327 + .../src/BlockBaseRailLogic.java.patch | 483 + .../net/minecraft/src/BlockBeacon.java.patch | 92 + patches/net/minecraft/src/BlockBed.java.patch | 389 + .../minecraft/src/BlockBookshelf.java.patch | 38 + .../minecraft/src/BlockBreakable.java.patch | 49 + .../src/BlockBrewingStand.java.patch | 236 + .../net/minecraft/src/BlockButton.java.patch | 478 + .../minecraft/src/BlockButtonStone.java.patch | 20 + .../minecraft/src/BlockButtonWood.java.patch | 20 + .../net/minecraft/src/BlockCactus.java.patch | 185 + .../net/minecraft/src/BlockCake.java.patch | 233 + .../net/minecraft/src/BlockCarpet.java.patch | 171 + .../net/minecraft/src/BlockCarrot.java.patch | 62 + .../minecraft/src/BlockCauldron.java.patch | 255 + .../net/minecraft/src/BlockChest.java.patch | 687 + .../net/minecraft/src/BlockClay.java.patch | 29 + .../net/minecraft/src/BlockCocoa.java.patch | 290 + .../net/minecraft/src/BlockColored.java.patch | 86 + .../src/BlockCommandBlock.java.patch | 137 + .../minecraft/src/BlockComparator.java.patch | 319 + .../minecraft/src/BlockContainer.java.patch | 52 + .../net/minecraft/src/BlockCrops.java.patch | 242 + .../src/BlockDaylightDetector.java.patch | 155 + .../minecraft/src/BlockDeadBush.java.patch | 51 + .../src/BlockDetectorRail.java.patch | 222 + .../minecraft/src/BlockDirectional.java.patch | 21 + .../net/minecraft/src/BlockDirt.java.patch | 13 + .../minecraft/src/BlockDispenser.java.patch | 347 + .../net/minecraft/src/BlockDoor.java.patch | 485 + .../minecraft/src/BlockDragonEgg.java.patch | 206 + .../net/minecraft/src/BlockDropper.java.patch | 100 + .../src/BlockEnchantmentTable.java.patch | 134 + .../minecraft/src/BlockEndPortal.java.patch | 153 + .../src/BlockEndPortalFrame.java.patch | 137 + .../minecraft/src/BlockEnderChest.java.patch | 180 + .../minecraft/src/BlockEventData.java.patch | 82 + .../minecraft/src/BlockFarmland.java.patch | 189 + .../net/minecraft/src/BlockFence.java.patch | 216 + .../minecraft/src/BlockFenceGate.java.patch | 197 + .../net/minecraft/src/BlockFire.java.patch | 527 + .../net/minecraft/src/BlockFlower.java.patch | 127 + .../minecraft/src/BlockFlowerPot.java.patch | 293 + .../net/minecraft/src/BlockFlowing.java.patch | 458 + .../net/minecraft/src/BlockFluid.java.patch | 782 + .../net/minecraft/src/BlockFurnace.java.patch | 374 + .../net/minecraft/src/BlockGlass.java.patch | 49 + .../minecraft/src/BlockGlowStone.java.patch | 43 + .../net/minecraft/src/BlockGrass.java.patch | 142 + .../net/minecraft/src/BlockGravel.java.patch | 27 + .../minecraft/src/BlockHalfSlab.java.patch | 174 + patches/net/minecraft/src/BlockHay.java.patch | 40 + .../net/minecraft/src/BlockHopper.java.patch | 344 + patches/net/minecraft/src/BlockIce.java.patch | 114 + .../net/minecraft/src/BlockJukeBox.java.patch | 161 + .../net/minecraft/src/BlockLadder.java.patch | 207 + .../net/minecraft/src/BlockLeaves.java.patch | 495 + .../minecraft/src/BlockLeavesBase.java.patch | 41 + .../net/minecraft/src/BlockLever.java.patch | 477 + .../net/minecraft/src/BlockLilyPad.java.patch | 107 + .../minecraft/src/BlockLockedChest.java.patch | 37 + patches/net/minecraft/src/BlockLog.java.patch | 148 + .../net/minecraft/src/BlockMelon.java.patch | 67 + .../minecraft/src/BlockMobSpawner.java.patch | 73 + .../minecraft/src/BlockMushroom.java.patch | 153 + .../minecraft/src/BlockMushroomCap.java.patch | 96 + .../minecraft/src/BlockMycelium.java.patch | 122 + .../minecraft/src/BlockNetherStalk.java.patch | 154 + .../minecraft/src/BlockNetherrack.java.patch | 13 + .../net/minecraft/src/BlockNote.java.patch | 124 + .../minecraft/src/BlockObsidian.java.patch | 28 + patches/net/minecraft/src/BlockOre.java.patch | 101 + .../minecraft/src/BlockOreStorage.java.patch | 13 + .../net/minecraft/src/BlockPane.java.patch | 255 + .../minecraft/src/BlockPistonBase.java.patch | 693 + .../src/BlockPistonExtension.java.patch | 364 + .../src/BlockPistonMoving.java.patch | 303 + .../net/minecraft/src/BlockPortal.java.patch | 333 + .../net/minecraft/src/BlockPotato.java.patch | 81 + .../minecraft/src/BlockPoweredOre.java.patch | 30 + .../src/BlockPressurePlate.java.patch | 87 + .../src/BlockPressurePlateWeighted.java.patch | 78 + .../net/minecraft/src/BlockPumpkin.java.patch | 180 + .../net/minecraft/src/BlockQuartz.java.patch | 170 + .../net/minecraft/src/BlockRail.java.patch | 49 + .../minecraft/src/BlockRailBase.java.patch | 292 + .../minecraft/src/BlockRailPowered.java.patch | 255 + .../src/BlockRedstoneLight.java.patch | 107 + .../src/BlockRedstoneLogic.java.patch | 466 + .../minecraft/src/BlockRedstoneOre.java.patch | 259 + .../src/BlockRedstoneRepeater.java.patch | 191 + .../src/BlockRedstoneTorch.java.patch | 315 + .../src/BlockRedstoneWire.java.patch | 685 + .../net/minecraft/src/BlockReed.java.patch | 152 + .../src/BlockRotatedPillar.java.patch | 114 + .../net/minecraft/src/BlockSand.java.patch | 145 + .../minecraft/src/BlockSandStone.java.patch | 94 + .../net/minecraft/src/BlockSapling.java.patch | 215 + .../net/minecraft/src/BlockSign.java.patch | 227 + .../minecraft/src/BlockSilverfish.java.patch | 134 + .../net/minecraft/src/BlockSkull.java.patch | 402 + .../net/minecraft/src/BlockSnow.java.patch | 187 + .../minecraft/src/BlockSnowBlock.java.patch | 45 + .../minecraft/src/BlockSoulSand.java.patch | 36 + .../minecraft/src/BlockSourceImpl.java.patch | 19 + .../net/minecraft/src/BlockSponge.java.patch | 13 + .../net/minecraft/src/BlockStairs.java.patch | 713 + .../minecraft/src/BlockStationary.java.patch | 142 + .../net/minecraft/src/BlockStem.java.patch | 352 + .../net/minecraft/src/BlockStep.java.patch | 105 + .../net/minecraft/src/BlockStone.java.patch | 21 + .../minecraft/src/BlockStoneBrick.java.patch | 91 + patches/net/minecraft/src/BlockTNT.java.patch | 180 + .../minecraft/src/BlockTallGrass.java.patch | 153 + .../net/minecraft/src/BlockTorch.java.patch | 339 + .../minecraft/src/BlockTrapDoor.java.patch | 349 + .../minecraft/src/BlockTripWire.java.patch | 341 + .../src/BlockTripWireSource.java.patch | 500 + .../net/minecraft/src/BlockVine.java.patch | 520 + .../net/minecraft/src/BlockWall.java.patch | 197 + patches/net/minecraft/src/BlockWeb.java.patch | 67 + .../net/minecraft/src/BlockWood.java.patch | 85 + .../minecraft/src/BlockWoodSlab.java.patch | 85 + .../minecraft/src/BlockWorkbench.java.patch | 54 + .../net/minecraft/src/BossStatus.java.patch | 21 + .../src/CallableBlockDataValue.java.patch | 24 + .../src/CallableBlockLocation.java.patch | 22 + .../src/CallableBlockType.java.patch | 19 + .../src/CallableChunkPosHash.java.patch | 22 + .../src/CallableClientMemoryStats.java.patch | 13 + .../src/CallableClientProfiler.java.patch | 13 + .../src/CallableConnectionName.java.patch | 18 + .../src/CallableCrashMemoryReport.java.patch | 18 + .../src/CallableEntityName.java.patch | 13 + .../src/CallableEntityTracker.java.patch | 25 + .../src/CallableEntityType.java.patch | 13 + .../minecraft/src/CallableGLInfo.java.patch | 17 + .../minecraft/src/CallableIntCache.java.patch | 13 + .../src/CallableIsFeatureChunk.java.patch | 22 + .../minecraft/src/CallableIsModded.java.patch | 27 + .../src/CallableIsServerModded.java.patch | 24 + .../minecraft/src/CallableItemName.java.patch | 18 + .../minecraft/src/CallableJVMFlags.java.patch | 46 + .../minecraft/src/CallableJavaInfo.java.patch | 22 + .../src/CallableJavaInfo2.java.patch | 22 + .../src/CallableLWJGLVersion.java.patch | 17 + .../src/CallableLaunchedVersion.java.patch | 17 + .../src/CallableLevelDimension.java.patch | 13 + .../src/CallableLevelGamemode.java.patch | 18 + .../src/CallableLevelGenerator.java.patch | 18 + .../CallableLevelGeneratorOptions.java.patch | 13 + .../src/CallableLevelSeed.java.patch | 13 + .../src/CallableLevelSpawnLocation.java.patch | 13 + .../CallableLevelStorageVersion.java.patch | 39 + .../src/CallableLevelTime.java.patch | 18 + .../src/CallableLevelWeather.java.patch | 18 + .../net/minecraft/src/CallableLvl1.java.patch | 25 + .../net/minecraft/src/CallableLvl2.java.patch | 25 + .../net/minecraft/src/CallableLvl3.java.patch | 22 + .../net/minecraft/src/CallableMPL1.java.patch | 22 + .../net/minecraft/src/CallableMPL2.java.patch | 22 + .../src/CallableMemoryInfo.java.patch | 23 + .../src/CallableMinecraftVersion.java.patch | 22 + .../minecraft/src/CallableModded.java.patch | 22 + .../src/CallableMouseLocation.java.patch | 27 + .../minecraft/src/CallableOSInfo.java.patch | 17 + .../src/CallablePacketClass.java.patch | 18 + .../minecraft/src/CallablePacketID.java.patch | 18 + .../CallableParticlePositionInfo.java.patch | 26 + .../src/CallableParticleScreenName.java.patch | 13 + .../src/CallableScreenName.java.patch | 13 + .../src/CallableScreenSize.java.patch | 23 + .../src/CallableServerMemoryStats.java.patch | 24 + .../src/CallableServerProfiler.java.patch | 28 + .../src/CallableServerType.java.patch | 13 + .../src/CallableStructureType.java.patch | 13 + .../src/CallableSuspiciousClasses.java.patch | 206 + .../src/CallableTagCompound1.java.patch | 25 + .../src/CallableTagCompound2.java.patch | 23 + .../src/CallableTexturePack.java.patch | 18 + .../src/CallableTileEntityData.java.patch | 26 + .../src/CallableTileEntityID.java.patch | 21 + .../src/CallableTileEntityName.java.patch | 13 + .../net/minecraft/src/CallableType.java.patch | 17 + .../minecraft/src/CallableType2.java.patch | 13 + .../minecraft/src/CallableType3.java.patch | 17 + .../src/CallableUpdatingScreenName.java.patch | 13 + .../src/ChatAllowedCharacters.java.patch | 78 + .../minecraft/src/ChatClickData.java.patch | 86 + patches/net/minecraft/src/ChatLine.java.patch | 33 + .../src/ChatMessageComponent.java.patch | 455 + .../src/ChestItemRenderHelper.java.patch | 34 + patches/net/minecraft/src/Chunk.java.patch | 1654 + .../net/minecraft/src/ChunkCache.java.patch | 510 + .../src/ChunkCoordIntPair.java.patch | 53 + .../minecraft/src/ChunkCoordinates.java.patch | 109 + .../net/minecraft/src/ChunkLoader.java.patch | 162 + .../minecraft/src/ChunkPosition.java.patch | 47 + .../src/ChunkProviderClient.java.patch | 186 + .../minecraft/src/ChunkProviderEnd.java.patch | 432 + .../src/ChunkProviderFlat.java.patch | 359 + .../src/ChunkProviderGenerate.java.patch | 684 + .../src/ChunkProviderHell.java.patch | 667 + .../src/ChunkProviderServer.java.patch | 390 + .../minecraft/src/ClippingHelper.java.patch | 18 + .../src/ClippingHelperImpl.java.patch | 74 + .../minecraft/src/ColorizerFoliage.java.patch | 66 + .../minecraft/src/ColorizerGrass.java.patch | 34 + .../net/minecraft/src/CombatEntry.java.patch | 41 + .../minecraft/src/CombatTracker.java.patch | 228 + .../net/minecraft/src/CommandBase.java.patch | 445 + .../src/CommandClearInventory.java.patch | 69 + .../net/minecraft/src/CommandDebug.java.patch | 171 + .../src/CommandDefaultGameMode.java.patch | 44 + .../src/CommandDifficulty.java.patch | 57 + .../minecraft/src/CommandEffect.java.patch | 117 + .../minecraft/src/CommandEnchant.java.patch | 105 + .../minecraft/src/CommandException.java.patch | 22 + .../minecraft/src/CommandGameMode.java.patch | 82 + .../minecraft/src/CommandGameRule.java.patch | 81 + .../net/minecraft/src/CommandGive.java.patch | 79 + .../minecraft/src/CommandHandler.java.patch | 242 + .../net/minecraft/src/CommandHelp.java.patch | 83 + .../net/minecraft/src/CommandKill.java.patch | 27 + .../src/CommandNotFoundException.java.patch | 12 + .../minecraft/src/CommandPlaySound.java.patch | 132 + .../minecraft/src/CommandServerBan.java.patch | 68 + .../src/CommandServerBanIp.java.patch | 121 + .../src/CommandServerBanlist.java.patch | 53 + .../src/CommandServerDeop.java.patch | 40 + .../src/CommandServerEmote.java.patch | 40 + .../src/CommandServerKick.java.patch | 65 + .../src/CommandServerList.java.patch | 26 + .../src/CommandServerMessage.java.patch | 70 + .../minecraft/src/CommandServerOp.java.patch | 53 + .../src/CommandServerPardon.java.patch | 49 + .../src/CommandServerPardonIp.java.patch | 56 + .../src/CommandServerPublishLocal.java.patch | 33 + .../src/CommandServerSaveAll.java.patch | 82 + .../src/CommandServerSaveOff.java.patch | 45 + .../src/CommandServerSaveOn.java.patch | 45 + .../minecraft/src/CommandServerSay.java.patch | 40 + .../src/CommandServerStop.java.patch | 25 + .../minecraft/src/CommandServerTp.java.patch | 101 + .../src/CommandServerWhitelist.java.patch | 129 + .../src/CommandSetPlayerTimeout.java.patch | 30 + .../src/CommandSetSpawnpoint.java.patch | 77 + .../minecraft/src/CommandShowSeed.java.patch | 40 + .../src/CommandSpreadPlayers.java.patch | 289 + .../CommandSpreadPlayersPosition.java.patch | 119 + .../net/minecraft/src/CommandTime.java.patch | 95 + .../src/CommandToggleDownfall.java.patch | 34 + .../minecraft/src/CommandWeather.java.patch | 73 + .../net/minecraft/src/CommandXP.java.patch | 101 + .../src/ComparatorClassSorter.java.patch | 27 + .../src/ComponentMineshaftCorridor.java.patch | 432 + .../src/ComponentMineshaftCross.java.patch | 248 + .../src/ComponentMineshaftRoom.java.patch | 216 + .../src/ComponentMineshaftStairs.java.patch | 142 + .../ComponentNetherBridgeCorridor.java.patch | 122 + .../ComponentNetherBridgeCorridor2.java.patch | 122 + .../ComponentNetherBridgeCorridor3.java.patch | 101 + .../ComponentNetherBridgeCorridor4.java.patch | 111 + .../ComponentNetherBridgeCorridor5.java.patch | 82 + .../ComponentNetherBridgeCrossing.java.patch | 104 + .../ComponentNetherBridgeCrossing2.java.patch | 82 + .../ComponentNetherBridgeCrossing3.java.patch | 151 + .../src/ComponentNetherBridgeEnd.java.patch | 101 + .../ComponentNetherBridgeEntrance.java.patch | 196 + ...nentNetherBridgeNetherStalkRoom.java.patch | 254 + .../src/ComponentNetherBridgePiece.java.patch | 262 + .../ComponentNetherBridgeStairs.java.patch | 102 + ...ComponentNetherBridgeStartPiece.java.patch | 81 + .../ComponentNetherBridgeStraight.java.patch | 101 + .../ComponentNetherBridgeThrone.java.patch | 131 + .../src/ComponentScatteredFeature.java.patch | 114 + ...ntScatteredFeatureDesertPyramid.java.patch | 425 + ...ntScatteredFeatureJunglePyramid.java.patch | 410 + ...mponentScatteredFeatureSwampHut.java.patch | 138 + .../src/ComponentStronghold.java.patch | 289 + ...omponentStrongholdChestCorridor.java.patch | 121 + .../ComponentStrongholdCorridor.java.patch | 125 + .../ComponentStrongholdCrossing.java.patch | 207 + .../ComponentStrongholdLeftTurn.java.patch | 78 + .../src/ComponentStrongholdLibrary.java.patch | 244 + .../ComponentStrongholdPortalRoom.java.patch | 224 + .../src/ComponentStrongholdPrison.java.patch | 89 + .../ComponentStrongholdRightTurn.java.patch | 51 + ...ComponentStrongholdRoomCrossing.java.patch | 262 + .../src/ComponentStrongholdStairs.java.patch | 155 + .../src/ComponentStrongholdStairs2.java.patch | 22 + ...mponentStrongholdStairsStraight.java.patch | 84 + .../ComponentStrongholdStraight.java.patch | 128 + .../minecraft/src/ComponentVillage.java.patch | 347 + .../src/ComponentVillageChurch.java.patch | 195 + .../src/ComponentVillageField.java.patch | 185 + .../src/ComponentVillageField2.java.patch | 151 + .../src/ComponentVillageHall.java.patch | 209 + .../src/ComponentVillageHouse1.java.patch | 205 + .../src/ComponentVillageHouse2.java.patch | 207 + .../src/ComponentVillageHouse3.java.patch | 262 + .../ComponentVillageHouse4_Garden.java.patch | 210 + .../src/ComponentVillagePathGen.java.patch | 197 + .../src/ComponentVillageRoadPiece.java.patch | 16 + .../src/ComponentVillageStartPiece.java.patch | 46 + .../src/ComponentVillageTorch.java.patch | 73 + .../src/ComponentVillageWell.java.patch | 117 + .../src/ComponentVillageWoodHut.java.patch | 180 + .../src/CompressedStreamTools.java.patch | 161 + .../net/minecraft/src/Container.java.patch | 961 + .../minecraft/src/ContainerBeacon.java.patch | 177 + .../src/ContainerBrewingStand.java.patch | 179 + .../minecraft/src/ContainerChest.java.patch | 124 + .../src/ContainerCreative.java.patch | 129 + .../src/ContainerDispenser.java.patch | 105 + .../src/ContainerEnchantment.java.patch | 330 + .../minecraft/src/ContainerFurnace.java.patch | 199 + .../minecraft/src/ContainerHopper.java.patch | 93 + .../src/ContainerHorseInventory.java.patch | 124 + ...ontainerHorseInventorySlotArmor.java.patch | 29 + ...ntainerHorseInventorySlotSaddle.java.patch | 23 + .../src/ContainerMerchant.java.patch | 194 + .../minecraft/src/ContainerPlayer.java.patch | 199 + .../minecraft/src/ContainerRepair.java.patch | 516 + .../src/ContainerRepairINNER1.java.patch | 30 + .../src/ContainerRepairINNER2.java.patch | 95 + .../minecraft/src/ContainerSheep.java.patch | 17 + .../src/ContainerWorkbench.java.patch | 170 + .../src/ConvertingProgressUpdate.java.patch | 54 + .../minecraft/src/CraftingManager.java.patch | 439 + .../net/minecraft/src/CrashReport.java.patch | 297 + .../src/CrashReportCategory.java.patch | 237 + .../src/CrashReportCategoryEntry.java.patch | 44 + .../minecraft/src/CreativeCrafting.java.patch | 40 + .../minecraft/src/CreativeTabBlock.java.patch | 18 + .../src/CreativeTabBrewing.java.patch | 18 + .../src/CreativeTabCombat.java.patch | 18 + .../minecraft/src/CreativeTabDeco.java.patch | 18 + .../minecraft/src/CreativeTabFood.java.patch | 18 + .../src/CreativeTabInventory.java.patch | 18 + .../src/CreativeTabMaterial.java.patch | 18 + .../minecraft/src/CreativeTabMisc.java.patch | 18 + .../src/CreativeTabRedstone.java.patch | 18 + .../src/CreativeTabSearch.java.patch | 18 + .../minecraft/src/CreativeTabTools.java.patch | 18 + .../src/CreativeTabTransport.java.patch | 18 + .../net/minecraft/src/CreativeTabs.java.patch | 205 + .../net/minecraft/src/CryptManager.java.patch | 165 + .../net/minecraft/src/DamageSource.java.patch | 207 + .../net/minecraft/src/DataWatcher.java.patch | 471 + .../src/DedicatedPlayerList.java.patch | 210 + .../minecraft/src/DedicatedServer.java.patch | 398 + .../DedicatedServerCommandThread.java.patch | 32 + .../DedicatedServerListenThread.java.patch | 48 + .../src/DedicatedServerSleepThread.java.patch | 31 + .../src/DefaultResourcePack.java.patch | 97 + .../minecraft/src/DemoWorldManager.java.patch | 157 + .../minecraft/src/DemoWorldServer.java.patch | 12 + .../minecraft/src/DerivedWorldInfo.java.patch | 284 + .../src/DestroyBlockProgress.java.patch | 78 + .../net/minecraft/src/Direction.java.patch | 45 + .../src/DispenserBehaviorArrow.java.patch | 17 + .../src/DispenserBehaviorBoat.java.patch | 60 + .../src/DispenserBehaviorDye.java.patch | 58 + .../src/DispenserBehaviorEgg.java.patch | 16 + .../DispenserBehaviorEmptyBucket.java.patch | 56 + .../DispenserBehaviorExperience.java.patch | 17 + .../DispenserBehaviorFilledBucket.java.patch | 36 + .../src/DispenserBehaviorFire.java.patch | 59 + .../src/DispenserBehaviorFireball.java.patch | 42 + .../src/DispenserBehaviorFireworks.java.patch | 39 + .../src/DispenserBehaviorMobEgg.java.patch | 35 + .../src/DispenserBehaviorPotion.java.patch | 15 + ...spenserBehaviorPotionProjectile.java.patch | 27 + .../src/DispenserBehaviorSnowball.java.patch | 16 + .../src/DispenserBehaviorTNT.java.patch | 30 + .../minecraft/src/DynamicTexture.java.patch | 40 + .../minecraft/src/EffectRenderer.java.patch | 372 + .../net/minecraft/src/EmptyChunk.java.patch | 264 + .../net/minecraft/src/Enchantment.java.patch | 229 + .../src/EnchantmentArrowDamage.java.patch | 41 + .../src/EnchantmentArrowFire.java.patch | 35 + .../src/EnchantmentArrowInfinite.java.patch | 35 + .../src/EnchantmentArrowKnockback.java.patch | 41 + .../src/EnchantmentDamage.java.patch | 109 + .../minecraft/src/EnchantmentData.java.patch | 29 + .../src/EnchantmentDigging.java.patch | 48 + .../src/EnchantmentDurability.java.patch | 59 + .../src/EnchantmentFireAspect.java.patch | 41 + .../src/EnchantmentHelper.java.patch | 524 + .../src/EnchantmentKnockback.java.patch | 41 + .../src/EnchantmentLootBonus.java.patch | 59 + .../src/EnchantmentModifierDamage.java.patch | 39 + .../src/EnchantmentModifierLiving.java.patch | 38 + .../src/EnchantmentNameParts.java.patch | 50 + .../src/EnchantmentOxygen.java.patch | 41 + .../src/EnchantmentProtection.java.patch | 162 + .../src/EnchantmentThorns.java.patch | 93 + .../src/EnchantmentUntouching.java.patch | 52 + .../src/EnchantmentWaterWorker.java.patch | 36 + patches/net/minecraft/src/Entity.java.patch | 2654 + .../src/EntityAIArrowAttack.java.patch | 149 + .../src/EntityAIAttackOnCollide.java.patch | 121 + .../src/EntityAIAvoidEntity.java.patch | 125 + .../EntityAIAvoidEntitySelector.java.patch | 21 + .../net/minecraft/src/EntityAIBase.java.patch | 76 + .../net/minecraft/src/EntityAIBeg.java.patch | 66 + .../src/EntityAIBreakDoor.java.patch | 72 + .../src/EntityAIControlledByPlayer.java.patch | 200 + .../src/EntityAICreeperSwell.java.patch | 62 + .../src/EntityAIDefendVillage.java.patch | 50 + .../src/EntityAIDoorInteract.java.patch | 94 + .../minecraft/src/EntityAIEatGrass.java.patch | 84 + .../minecraft/src/EntityAIFleeSun.java.patch | 72 + .../src/EntityAIFollowGolem.java.patch | 89 + .../src/EntityAIFollowOwner.java.patch | 109 + .../src/EntityAIFollowParent.java.patch | 98 + .../src/EntityAIHurtByTarget.java.patch | 45 + .../src/EntityAILeapAtTarget.java.patch | 61 + .../src/EntityAILookAtTradePlayer.java.patch | 23 + .../src/EntityAILookAtVillager.java.patch | 58 + .../minecraft/src/EntityAILookIdle.java.patch | 59 + .../net/minecraft/src/EntityAIMate.java.patch | 113 + .../src/EntityAIMoveIndoors.java.patch | 70 + .../src/EntityAIMoveThroughVillage.java.patch | 150 + .../EntityAIMoveTowardsRestriction.java.patch | 48 + .../src/EntityAIMoveTowardsTarget.java.patch | 67 + ...EntityAINearestAttackableTarget.java.patch | 78 + ...NearestAttackableTargetSelector.java.patch | 26 + ...AINearestAttackableTargetSorter.java.patch | 27 + .../src/EntityAIOcelotAttack.java.patch | 72 + .../src/EntityAIOcelotSit.java.patch | 144 + .../minecraft/src/EntityAIOpenDoor.java.patch | 48 + .../src/EntityAIOwnerHurtByTarget.java.patch | 46 + .../src/EntityAIOwnerHurtTarget.java.patch | 46 + .../minecraft/src/EntityAIPanic.java.patch | 47 + .../net/minecraft/src/EntityAIPlay.java.patch | 112 + .../src/EntityAIRestrictOpenDoor.java.patch | 61 + .../src/EntityAIRestrictSun.java.patch | 32 + .../src/EntityAIRunAroundLikeCrazy.java.patch | 69 + .../net/minecraft/src/EntityAISit.java.patch | 62 + .../minecraft/src/EntityAISwimming.java.patch | 33 + .../minecraft/src/EntityAITarget.java.patch | 192 + .../src/EntityAITargetNonTamed.java.patch | 20 + .../src/EntityAITaskEntry.java.patch | 26 + .../minecraft/src/EntityAITasks.java.patch | 205 + .../minecraft/src/EntityAITempt.java.patch | 141 + .../src/EntityAITradePlayer.java.patch | 51 + .../src/EntityAIVillagerMate.java.patch | 98 + .../minecraft/src/EntityAIWander.java.patch | 50 + .../src/EntityAIWatchClosest.java.patch | 94 + .../src/EntityAIWatchClosest2.java.patch | 13 + .../minecraft/src/EntityAgeable.java.patch | 188 + .../src/EntityAmbientCreature.java.patch | 24 + .../net/minecraft/src/EntityAnimal.java.patch | 420 + .../net/minecraft/src/EntityArrow.java.patch | 622 + .../net/minecraft/src/EntityAuraFX.java.patch | 65 + .../net/minecraft/src/EntityBat.java.patch | 293 + .../net/minecraft/src/EntityBlaze.java.patch | 239 + .../net/minecraft/src/EntityBoat.java.patch | 536 + .../minecraft/src/EntityBodyHelper.java.patch | 73 + .../minecraft/src/EntityBreakingFX.java.patch | 114 + .../minecraft/src/EntityBubbleFX.java.patch | 74 + .../minecraft/src/EntityCaveSpider.java.patch | 53 + .../minecraft/src/EntityChicken.java.patch | 172 + .../src/EntityClientPlayerMP.java.patch | 311 + .../minecraft/src/EntityCloudFX.java.patch | 94 + .../net/minecraft/src/EntityCow.java.patch | 146 + .../minecraft/src/EntityCreature.java.patch | 381 + .../minecraft/src/EntityCreeper.java.patch | 247 + .../minecraft/src/EntityCrit2FX.java.patch | 69 + .../net/minecraft/src/EntityCritFX.java.patch | 98 + .../src/EntityDamageSource.java.patch | 37 + .../src/EntityDamageSourceIndirect.java.patch | 33 + .../minecraft/src/EntityDiggingFX.java.patch | 122 + .../net/minecraft/src/EntityDragon.java.patch | 715 + .../minecraft/src/EntityDragonPart.java.patch | 75 + .../src/EntityDropParticleFX.java.patch | 157 + .../net/minecraft/src/EntityEgg.java.patch | 71 + .../minecraft/src/EntityEggInfo.java.patch | 26 + ...ntityEnchantmentTableParticleFX.java.patch | 83 + .../src/EntityEnderCrystal.java.patch | 114 + .../minecraft/src/EntityEnderEye.java.patch | 243 + .../minecraft/src/EntityEnderPearl.java.patch | 71 + .../minecraft/src/EntityEnderman.java.patch | 507 + .../minecraft/src/EntityExpBottle.java.patch | 63 + .../minecraft/src/EntityExplodeFX.java.patch | 57 + patches/net/minecraft/src/EntityFX.java.patch | 302 + .../src/EntityFallingSand.java.patch | 344 + .../minecraft/src/EntityFireball.java.patch | 345 + .../src/EntityFireworkOverlayFX.java.patch | 42 + .../src/EntityFireworkRocket.java.patch | 244 + .../src/EntityFireworkSparkFX.java.patch | 160 + .../src/EntityFireworkStarterFX.java.patch | 288 + .../minecraft/src/EntityFishHook.java.patch | 515 + .../minecraft/src/EntityFlameFX.java.patch | 125 + .../net/minecraft/src/EntityFlying.java.patch | 106 + .../minecraft/src/EntityFootStepFX.java.patch | 71 + .../net/minecraft/src/EntityGhast.java.patch | 308 + .../src/EntityGiantZombie.java.patch | 27 + .../net/minecraft/src/EntityGolem.java.patch | 56 + .../minecraft/src/EntityHanging.java.patch | 380 + .../minecraft/src/EntityHeartFX.java.patch | 91 + .../net/minecraft/src/EntityHorse.java.patch | 1672 + .../src/EntityHorseBredSelector.java.patch | 16 + .../src/EntityHorseGroupData.java.patch | 14 + .../src/EntityHugeExplodeFX.java.patch | 48 + .../minecraft/src/EntityIronGolem.java.patch | 276 + .../net/minecraft/src/EntityItem.java.patch | 432 + .../minecraft/src/EntityItemFrame.java.patch | 190 + .../minecraft/src/EntityJumpHelper.java.patch | 22 + .../src/EntityLargeExplodeFX.java.patch | 95 + .../src/EntityLargeFireball.java.patch | 80 + .../net/minecraft/src/EntityLavaFX.java.patch | 105 + .../minecraft/src/EntityLeashKnot.java.patch | 177 + .../src/EntityLightningBolt.java.patch | 160 + .../net/minecraft/src/EntityList.java.patch | 237 + .../net/minecraft/src/EntityLiving.java.patch | 1306 + .../minecraft/src/EntityLivingBase.java.patch | 2491 + .../minecraft/src/EntityLookHelper.java.patch | 144 + .../minecraft/src/EntityMagmaCube.java.patch | 170 + .../minecraft/src/EntityMinecart.java.patch | 1218 + .../src/EntityMinecartChest.java.patch | 35 + .../src/EntityMinecartContainer.java.patch | 330 + .../src/EntityMinecartEmpty.java.patch | 41 + .../src/EntityMinecartFurnace.java.patch | 183 + .../src/EntityMinecartHopper.java.patch | 198 + .../src/EntityMinecartMobSpawner.java.patch | 67 + .../EntityMinecartMobSpawnerLogic.java.patch | 23 + .../src/EntityMinecartTNT.java.patch | 202 + .../net/minecraft/src/EntityMob.java.patch | 180 + .../minecraft/src/EntityMooshroom.java.patch | 84 + .../minecraft/src/EntityMoveHelper.java.patch | 106 + .../net/minecraft/src/EntityNoteFX.java.patch | 97 + .../net/minecraft/src/EntityOcelot.java.patch | 338 + .../src/EntityOtherPlayerMP.java.patch | 183 + .../minecraft/src/EntityPainting.java.patch | 129 + .../minecraft/src/EntityPickupFX.java.patch | 70 + .../net/minecraft/src/EntityPig.java.patch | 232 + .../minecraft/src/EntityPigZombie.java.patch | 233 + .../net/minecraft/src/EntityPlayer.java.patch | 2396 + .../minecraft/src/EntityPlayerMP.java.patch | 1167 + .../minecraft/src/EntityPlayerSP.java.patch | 857 + .../minecraft/src/EntityPortalFX.java.patch | 111 + .../net/minecraft/src/EntityPotion.java.patch | 209 + .../net/minecraft/src/EntityRainFX.java.patch | 90 + .../minecraft/src/EntityReddustFX.java.patch | 121 + .../minecraft/src/EntityRenderer.java.patch | 2125 + .../src/EntitySelectorAlive.java.patch | 16 + .../src/EntitySelectorArmoredMob.java.patch | 31 + .../src/EntitySelectorInventory.java.patch | 16 + .../net/minecraft/src/EntitySenses.java.patch | 59 + .../net/minecraft/src/EntitySheep.java.patch | 343 + .../minecraft/src/EntitySilverfish.java.patch | 242 + .../minecraft/src/EntitySkeleton.java.patch | 391 + .../net/minecraft/src/EntitySlime.java.patch | 330 + .../src/EntitySmallFireball.java.patch | 127 + .../minecraft/src/EntitySmokeFX.java.patch | 101 + .../src/EntitySnowShovelFX.java.patch | 94 + .../minecraft/src/EntitySnowball.java.patch | 60 + .../minecraft/src/EntitySnowman.java.patch | 103 + .../net/minecraft/src/EntitySorter.java.patch | 52 + .../src/EntitySpellParticleFX.java.patch | 99 + .../net/minecraft/src/EntitySpider.java.patch | 233 + .../minecraft/src/EntitySplashFX.java.patch | 38 + .../net/minecraft/src/EntitySquid.java.patch | 211 + .../minecraft/src/EntitySuspendFX.java.patch | 63 + .../minecraft/src/EntityTNTPrimed.java.patch | 138 + .../minecraft/src/EntityTameable.java.patch | 192 + .../minecraft/src/EntityThrowable.java.patch | 383 + .../minecraft/src/EntityTracker.java.patch | 346 + .../src/EntityTrackerEntry.java.patch | 742 + .../minecraft/src/EntityVillager.java.patch | 918 + .../minecraft/src/EntityWaterMob.java.patch | 69 + .../src/EntityWeatherEffect.java.patch | 12 + .../net/minecraft/src/EntityWitch.java.patch | 273 + .../net/minecraft/src/EntityWither.java.patch | 635 + .../src/EntityWitherAttackFilter.java.patch | 16 + .../src/EntityWitherSkull.java.patch | 149 + .../net/minecraft/src/EntityWolf.java.patch | 587 + .../net/minecraft/src/EntityXPOrb.java.patch | 331 + .../net/minecraft/src/EntityZombie.java.patch | 595 + .../src/EntityZombieGroupData.java.patch | 27 + .../src/EnumArmorMaterial.java.patch | 70 + patches/net/minecraft/src/EnumArt.java.patch | 31 + .../src/EnumChatFormatting.java.patch | 103 + .../minecraft/src/EnumCreatureType.java.patch | 58 + .../minecraft/src/EnumDoorHelper.java.patch | 29 + .../src/EnumEnchantmentType.java.patch | 30 + .../minecraft/src/EnumEntitySize.java.patch | 127 + .../src/EnumEntitySizeHelper.java.patch | 41 + .../net/minecraft/src/EnumFacing.java.patch | 70 + .../net/minecraft/src/EnumGameType.java.patch | 121 + .../net/minecraft/src/EnumOptions.java.patch | 49 + .../src/EnumOptionsHelper.java.patch | 89 + .../net/minecraft/src/EnumRarity.java.patch | 25 + .../net/minecraft/src/EnumSkyBlock.java.patch | 15 + .../minecraft/src/EnumToolMaterial.java.patch | 83 + .../minecraft/src/ExceptionMcoHttp.java.patch | 12 + .../src/ExceptionMcoService.java.patch | 27 + .../src/ExceptionRetryCall.java.patch | 13 + .../net/minecraft/src/Explosion.java.patch | 248 + .../src/ExtendedBlockStorage.java.patch | 354 + patches/net/minecraft/src/Facing.java.patch | 33 + .../src/FallbackResourceManager.java.patch | 96 + .../minecraft/src/FileResourcePack.java.patch | 109 + .../net/minecraft/src/FilterIMob.java.patch | 16 + .../src/FlatGeneratorInfo.java.patch | 301 + .../minecraft/src/FlatLayerInfo.java.patch | 88 + .../src/FolderResourcePack.java.patch | 49 + .../src/FoliageColorReloadListener.java.patch | 17 + .../src/FontMetadataSection.java.patch | 16 + .../FontMetadataSectionSerializer.java.patch | 83 + .../net/minecraft/src/FontRenderer.java.patch | 1124 + .../net/minecraft/src/FoodStats.java.patch | 180 + patches/net/minecraft/src/Frustrum.java.patch | 38 + .../minecraft/src/FurnaceRecipes.java.patch | 55 + .../net/minecraft/src/GLAllocation.java.patch | 89 + .../minecraft/src/GameRuleValue.java.patch | 58 + .../net/minecraft/src/GameRules.java.patch | 116 + .../net/minecraft/src/GameSettings.java.patch | 999 + .../src/GameWindowListener.java.patch | 23 + patches/net/minecraft/src/GenLayer.java.patch | 171 + .../src/GenLayerAddIsland.java.patch | 112 + .../src/GenLayerAddMushroomIsland.java.patch | 54 + .../minecraft/src/GenLayerAddSnow.java.patch | 59 + .../minecraft/src/GenLayerBiome.java.patch | 74 + .../src/GenLayerFuzzyZoom.java.patch | 81 + .../minecraft/src/GenLayerHills.java.patch | 88 + .../minecraft/src/GenLayerIsland.java.patch | 39 + .../minecraft/src/GenLayerRiver.java.patch | 52 + .../src/GenLayerRiverInit.java.patch | 36 + .../minecraft/src/GenLayerRiverMix.java.patch | 63 + .../minecraft/src/GenLayerShore.java.patch | 106 + .../minecraft/src/GenLayerSmooth.java.patch | 70 + .../src/GenLayerSwampRivers.java.patch | 45 + .../src/GenLayerVoronoiZoom.java.patch | 91 + .../net/minecraft/src/GenLayerZoom.java.patch | 162 + .../src/GrassColorReloadListener.java.patch | 17 + patches/net/minecraft/src/Gui.java.patch | 205 + .../minecraft/src/GuiAchievement.java.patch | 187 + .../minecraft/src/GuiAchievements.java.patch | 457 + .../net/minecraft/src/GuiBeacon.java.patch | 181 + .../minecraft/src/GuiBeaconButton.java.patch | 70 + .../src/GuiBeaconButtonCancel.java.patch | 24 + .../src/GuiBeaconButtonConfirm.java.patch | 24 + .../src/GuiBeaconButtonPower.java.patch | 35 + .../minecraft/src/GuiBrewingStand.java.patch | 105 + .../net/minecraft/src/GuiButton.java.patch | 145 + .../src/GuiButtonLanguage.java.patch | 31 + .../minecraft/src/GuiButtonLink.java.patch | 27 + .../src/GuiButtonMerchant.java.patch | 48 + .../src/GuiButtonNextPage.java.patch | 45 + patches/net/minecraft/src/GuiChat.java.patch | 410 + patches/net/minecraft/src/GuiChest.java.patch | 45 + .../minecraft/src/GuiCommandBlock.java.patch | 129 + .../src/GuiConfirmOpenLink.java.patch | 113 + .../minecraft/src/GuiConnecting.java.patch | 215 + .../net/minecraft/src/GuiContainer.java.patch | 1237 + .../src/GuiContainerCreative.java.patch | 1053 + .../net/minecraft/src/GuiControls.java.patch | 193 + .../net/minecraft/src/GuiCrafting.java.patch | 29 + .../src/GuiCreateFlatWorld.java.patch | 123 + .../src/GuiCreateFlatWorldListSlot.java.patch | 124 + .../minecraft/src/GuiCreateWorld.java.patch | 548 + .../minecraft/src/GuiDisconnected.java.patch | 119 + .../net/minecraft/src/GuiDispenser.java.patch | 32 + .../src/GuiDownloadTerrain.java.patch | 66 + .../net/minecraft/src/GuiEditSign.java.patch | 291 + .../minecraft/src/GuiEnchantment.java.patch | 238 + .../minecraft/src/GuiErrorScreen.java.patch | 69 + .../minecraft/src/GuiFlatPresets.java.patch | 231 + .../src/GuiFlatPresetsItem.java.patch | 29 + .../src/GuiFlatPresetsListSlot.java.patch | 103 + .../net/minecraft/src/GuiFurnace.java.patch | 41 + .../net/minecraft/src/GuiGameOver.java.patch | 145 + .../net/minecraft/src/GuiHopper.java.patch | 35 + .../net/minecraft/src/GuiIngame.java.patch | 1314 + .../minecraft/src/GuiIngameMenu.java.patch | 158 + .../net/minecraft/src/GuiInventory.java.patch | 159 + .../net/minecraft/src/GuiLanguage.java.patch | 113 + .../net/minecraft/src/GuiMainMenu.java.patch | 579 + .../src/GuiMemoryErrorScreen.java.patch | 64 + .../net/minecraft/src/GuiMerchant.java.patch | 180 + .../minecraft/src/GuiMultiplayer.java.patch | 596 + .../net/minecraft/src/GuiNewChat.java.patch | 411 + .../net/minecraft/src/GuiOptions.java.patch | 158 + .../net/minecraft/src/GuiParticle.java.patch | 45 + .../minecraft/src/GuiPlayerInfo.java.patch | 26 + .../minecraft/src/GuiRenameWorld.java.patch | 122 + .../net/minecraft/src/GuiRepair.java.patch | 222 + .../net/minecraft/src/GuiScreen.java.patch | 1109 + .../src/GuiScreenAddServer.java.patch | 148 + .../minecraft/src/GuiScreenBackup.java.patch | 202 + .../GuiScreenBackupDownloadThread.java.patch | 24 + .../src/GuiScreenBackupRestoreTask.java.patch | 44 + .../GuiScreenBackupSelectionList.java.patch | 107 + .../minecraft/src/GuiScreenBook.java.patch | 460 + .../src/GuiScreenClientOutdated.java.patch | 68 + .../src/GuiScreenConfigureWorld.java.patch | 339 + .../src/GuiScreenConfirmation.java.patch | 74 + .../src/GuiScreenConfirmationType.java.patch | 19 + .../src/GuiScreenCreateOnlineWorld.java.patch | 252 + .../minecraft/src/GuiScreenDemo.java.patch | 100 + .../GuiScreenDisconnectedOnline.java.patch | 93 + .../src/GuiScreenEditOnlineWorld.java.patch | 140 + .../src/GuiScreenHorseInventory.java.patch | 65 + .../minecraft/src/GuiScreenInvite.java.patch | 163 + .../src/GuiScreenLongRunningTask.java.patch | 143 + .../src/GuiScreenMcoWorldTemplate.java.patch | 195 + ...nMcoWorldTemplateDownloadThread.java.patch | 24 + ...enMcoWorldTemplateSelectionList.java.patch | 74 + .../src/GuiScreenOnlineServers.java.patch | 857 + ...GuiScreenOnlineServersSubscreen.java.patch | 92 + .../src/GuiScreenPendingInvitation.java.patch | 227 + ...uiScreenPendingInvitationINNER1.java.patch | 24 + ...uiScreenPendingInvitationINNER2.java.patch | 24 + ...uiScreenPendingInvitationINNER3.java.patch | 24 + .../GuiScreenPendingInvitationList.java.patch | 71 + .../src/GuiScreenResetWorld.java.patch | 185 + .../src/GuiScreenSelectLocation.java.patch | 342 + .../src/GuiScreenServerList.java.patch | 128 + .../src/GuiScreenSubscription.java.patch | 124 + ...reenTemporaryResourcePackSelect.java.patch | 219 + ...ResourcePackSelectSelectionList.java.patch | 158 + .../minecraft/src/GuiSelectWorld.java.patch | 392 + .../minecraft/src/GuiShareToLan.java.patch | 123 + .../net/minecraft/src/GuiSleepMP.java.patch | 63 + .../net/minecraft/src/GuiSlider.java.patch | 107 + patches/net/minecraft/src/GuiSlot.java.patch | 523 + .../minecraft/src/GuiSlotLanguage.java.patch | 90 + .../src/GuiSlotOnlineServerList.java.patch | 141 + .../minecraft/src/GuiSlotServer.java.patch | 279 + .../net/minecraft/src/GuiSlotStats.java.patch | 272 + .../src/GuiSlotStatsBlock.java.patch | 124 + .../src/GuiSlotStatsGeneral.java.patch | 62 + .../minecraft/src/GuiSlotStatsItem.java.patch | 124 + .../minecraft/src/GuiSmallButton.java.patch | 28 + .../net/minecraft/src/GuiSnooper.java.patch | 156 + .../minecraft/src/GuiSnooperList.java.patch | 49 + patches/net/minecraft/src/GuiStats.java.patch | 367 + .../net/minecraft/src/GuiTextField.java.patch | 881 + .../minecraft/src/GuiVideoSettings.java.patch | 133 + .../net/minecraft/src/GuiWinGame.java.patch | 234 + .../net/minecraft/src/GuiWorldSlot.java.patch | 107 + patches/net/minecraft/src/GuiYesNo.java.patch | 104 + patches/net/minecraft/src/Hopper.java.patch | 27 + patches/net/minecraft/src/HttpUtil.java.patch | 130 + patches/net/minecraft/src/I18n.java.patch | 28 + .../minecraft/src/IAdminCommand.java.patch | 14 + .../src/IBehaviorDispenseItem.java.patch | 11 + .../net/minecraft/src/IBlockAccess.java.patch | 93 + .../minecraft/src/IBossDisplayData.java.patch | 11 + patches/net/minecraft/src/ICamera.java.patch | 13 + .../net/minecraft/src/IChunkLoader.java.patch | 32 + .../minecraft/src/IChunkProvider.java.patch | 69 + patches/net/minecraft/src/ICommand.java.patch | 21 + .../minecraft/src/ICommandManager.java.patch | 21 + .../minecraft/src/ICommandSender.java.patch | 27 + .../net/minecraft/src/ICrafting.java.patch | 22 + .../src/IEnchantmentModifier.java.patch | 12 + .../minecraft/src/IEntitySelector.java.patch | 11 + .../net/minecraft/src/IInvBasic.java.patch | 12 + .../net/minecraft/src/IInventory.java.patch | 70 + .../net/minecraft/src/ILogAgent.java.patch | 11 + patches/net/minecraft/src/IMob.java.patch | 10 + .../minecraft/src/INetworkManager.java.patch | 53 + .../minecraft/src/IPlayerFileData.java.patch | 22 + .../net/minecraft/src/IPlayerUsage.java.patch | 12 + .../minecraft/src/IProgressUpdate.java.patch | 26 + .../net/minecraft/src/IProjectile.java.patch | 12 + .../minecraft/src/IRangedAttackMob.java.patch | 12 + patches/net/minecraft/src/IRecipe.java.patch | 23 + .../net/minecraft/src/IRegistry.java.patch | 11 + .../net/minecraft/src/ISaveFormat.java.patch | 49 + .../net/minecraft/src/ISaveHandler.java.patch | 53 + patches/net/minecraft/src/IServer.java.patch | 103 + .../minecraft/src/ISidedInventory.java.patch | 25 + .../src/IStatStringFormat.java.patch | 12 + .../net/minecraft/src/IStatType.java.patch | 12 + .../minecraft/src/IThreadedFileIO.java.patch | 12 + .../src/ITileEntityProvider.java.patch | 12 + .../src/IUpdatePlayerListBox.java.patch | 12 + .../net/minecraft/src/IWorldAccess.java.patch | 72 + patches/net/minecraft/src/Icon.java.patch | 48 + .../net/minecraft/src/IconFlipped.java.patch | 79 + .../src/ImageBufferDownload.java.patch | 76 + patches/net/minecraft/src/IntCache.java.patch | 115 + .../net/minecraft/src/IntHashMap.java.patch | 271 + .../minecraft/src/IntHashMapEntry.java.patch | 68 + .../src/IntegratedPlayerList.java.patch | 61 + .../minecraft/src/IntegratedServer.java.patch | 283 + .../IntegratedServerListenThread.java.patch | 95 + .../minecraft/src/InventoryBasic.java.patch | 206 + .../src/InventoryCraftResult.java.patch | 120 + .../src/InventoryCrafting.java.patch | 177 + .../src/InventoryEffectRenderer.java.patch | 105 + .../src/InventoryEnderChest.java.patch | 87 + .../src/InventoryLargeChest.java.patch | 165 + .../src/InventoryMerchant.java.patch | 230 + .../minecraft/src/InventoryPlayer.java.patch | 858 + patches/net/minecraft/src/Item.java.patch | 703 + .../minecraft/src/ItemAnvilBlock.java.patch | 21 + .../minecraft/src/ItemAppleGold.java.patch | 69 + .../net/minecraft/src/ItemArmor.java.patch | 287 + patches/net/minecraft/src/ItemAxe.java.patch | 28 + patches/net/minecraft/src/ItemBed.java.patch | 72 + .../net/minecraft/src/ItemBlock.java.patch | 269 + .../src/ItemBlockWithMetadata.java.patch | 34 + patches/net/minecraft/src/ItemBoat.java.patch | 126 + patches/net/minecraft/src/ItemBook.java.patch | 31 + patches/net/minecraft/src/ItemBow.java.patch | 167 + .../net/minecraft/src/ItemBucket.java.patch | 198 + .../minecraft/src/ItemBucketMilk.java.patch | 63 + .../src/ItemCarrotOnAStick.java.patch | 59 + .../net/minecraft/src/ItemCloth.java.patch | 46 + patches/net/minecraft/src/ItemCoal.java.patch | 59 + .../net/minecraft/src/ItemColored.java.patch | 86 + patches/net/minecraft/src/ItemDoor.java.patch | 109 + patches/net/minecraft/src/ItemDye.java.patch | 390 + .../minecraft/src/ItemEditableBook.java.patch | 94 + patches/net/minecraft/src/ItemEgg.java.patch | 42 + .../net/minecraft/src/ItemEmptyMap.java.patch | 51 + .../src/ItemEnchantedBook.java.patch | 160 + .../net/minecraft/src/ItemEnderEye.java.patch | 213 + .../minecraft/src/ItemEnderPearl.java.patch | 40 + .../minecraft/src/ItemExpBottle.java.patch | 46 + .../net/minecraft/src/ItemFireball.java.patch | 93 + .../net/minecraft/src/ItemFirework.java.patch | 80 + .../src/ItemFireworkCharge.java.patch | 235 + .../minecraft/src/ItemFishingRod.java.patch | 69 + .../src/ItemFlintAndSteel.java.patch | 89 + patches/net/minecraft/src/ItemFood.java.patch | 156 + .../minecraft/src/ItemGlassBottle.java.patch | 83 + .../src/ItemHangingEntity.java.patch | 66 + patches/net/minecraft/src/ItemHoe.java.patch | 68 + .../src/ItemInWorldManager.java.patch | 432 + .../net/minecraft/src/ItemLeash.java.patch | 63 + .../net/minecraft/src/ItemLeaves.java.patch | 61 + .../net/minecraft/src/ItemLilyPad.java.patch | 71 + patches/net/minecraft/src/ItemMap.java.patch | 377 + .../net/minecraft/src/ItemMapBase.java.patch | 27 + .../net/minecraft/src/ItemMinecart.java.patch | 48 + .../src/ItemMonsterPlacer.java.patch | 231 + .../src/ItemMultiTextureTile.java.patch | 61 + .../net/minecraft/src/ItemNameTag.java.patch | 37 + .../net/minecraft/src/ItemPickaxe.java.patch | 41 + .../net/minecraft/src/ItemPiston.java.patch | 20 + .../net/minecraft/src/ItemPotion.java.patch | 479 + .../net/minecraft/src/ItemRecord.java.patch | 95 + .../net/minecraft/src/ItemRedstone.java.patch | 88 + patches/net/minecraft/src/ItemReed.java.patch | 110 + .../net/minecraft/src/ItemRenderer.java.patch | 848 + .../net/minecraft/src/ItemSaddle.java.patch | 47 + .../net/minecraft/src/ItemSeedFood.java.patch | 46 + .../net/minecraft/src/ItemSeeds.java.patch | 49 + .../net/minecraft/src/ItemShears.java.patch | 47 + patches/net/minecraft/src/ItemSign.java.patch | 102 + .../minecraft/src/ItemSimpleFoiled.java.patch | 17 + .../net/minecraft/src/ItemSkull.java.patch | 206 + patches/net/minecraft/src/ItemSlab.java.patch | 251 + patches/net/minecraft/src/ItemSnow.java.patch | 50 + .../net/minecraft/src/ItemSnowball.java.patch | 42 + patches/net/minecraft/src/ItemSoup.java.patch | 20 + .../net/minecraft/src/ItemSpade.java.patch | 27 + .../net/minecraft/src/ItemStack.java.patch | 955 + .../net/minecraft/src/ItemSword.java.patch | 142 + patches/net/minecraft/src/ItemTool.java.patch | 114 + .../minecraft/src/ItemWritableBook.java.patch | 57 + .../net/minecraft/src/KeyBinding.java.patch | 109 + .../net/minecraft/src/LanServer.java.patch | 39 + .../minecraft/src/LanServerList.java.patch | 56 + patches/net/minecraft/src/Language.java.patch | 67 + .../minecraft/src/LanguageManager.java.patch | 95 + .../src/LanguageMetadataSection.java.patch | 20 + ...nguageMetadataSectionSerializer.java.patch | 66 + .../minecraft/src/LayeredTexture.java.patch | 38 + .../src/LoadingScreenRenderer.java.patch | 154 + patches/net/minecraft/src/Locale.java.patch | 160 + patches/net/minecraft/src/LogAgent.java.patch | 128 + .../net/minecraft/src/LogFormatter.java.patch | 53 + .../net/minecraft/src/LongHashMap.java.patch | 257 + .../minecraft/src/LongHashMapEntry.java.patch | 62 + .../minecraft/src/LowerStringMap.java.patch | 104 + .../net/minecraft/src/MD5String.java.patch | 29 + .../src/MainProxyAuthenticator.java.patch | 26 + patches/net/minecraft/src/MapColor.java.patch | 79 + patches/net/minecraft/src/MapCoord.java.patch | 23 + patches/net/minecraft/src/MapData.java.patch | 338 + .../net/minecraft/src/MapGenBase.java.patch | 53 + .../net/minecraft/src/MapGenCaves.java.patch | 301 + .../minecraft/src/MapGenCavesHell.java.patch | 276 + .../minecraft/src/MapGenMineshaft.java.patch | 47 + .../src/MapGenNetherBridge.java.patch | 53 + .../net/minecraft/src/MapGenRavine.java.patch | 257 + .../src/MapGenScatteredFeature.java.patch | 131 + .../minecraft/src/MapGenStronghold.java.patch | 140 + .../minecraft/src/MapGenStructure.java.patch | 301 + .../src/MapGenStructureData.java.patch | 55 + .../src/MapGenStructureIO.java.patch | 110 + .../minecraft/src/MapGenVillage.java.patch | 97 + patches/net/minecraft/src/MapInfo.java.patch | 120 + .../minecraft/src/MapItemRenderer.java.patch | 84 + .../net/minecraft/src/MapStorage.java.patch | 239 + patches/net/minecraft/src/Material.java.patch | 192 + .../minecraft/src/MaterialLiquid.java.patch | 27 + .../minecraft/src/MaterialLogic.java.patch | 30 + .../minecraft/src/MaterialPortal.java.patch | 29 + .../src/MaterialTransparent.java.patch | 30 + .../net/minecraft/src/MaterialWeb.java.patch | 18 + .../net/minecraft/src/MathHelper.java.patch | 397 + .../net/minecraft/src/McoClient.java.patch | 315 + .../net/minecraft/src/McoServer.java.patch | 199 + .../minecraft/src/McoServerAddress.java.patch | 25 + .../minecraft/src/McoServerList.java.patch | 141 + .../src/McoServerListUpdateTask.java.patch | 88 + ...oServerListUpdateTaskComparator.java.patch | 62 + .../minecraft/src/MemoryConnection.java.patch | 175 + .../minecraft/src/MerchantRecipe.java.patch | 163 + .../src/MerchantRecipeList.java.patch | 152 + .../src/MessageComponentSerializer.java.patch | 213 + .../src/MetadataSectionSerializer.java.patch | 12 + .../src/MetadataSerializer.java.patch | 73 + .../MetadataSerializerRegistration.java.patch | 27 + .../net/minecraft/src/Minecraft.java.patch | 2764 + .../src/MinecraftException.java.patch | 12 + .../minecraft/src/MinecraftINNER13.java.patch | 13 + .../src/MobSpawnerBaseLogic.java.patch | 414 + .../net/minecraft/src/ModelBase.java.patch | 69 + patches/net/minecraft/src/ModelBat.java.patch | 93 + .../net/minecraft/src/ModelBiped.java.patch | 281 + .../net/minecraft/src/ModelBlaze.java.patch | 93 + .../net/minecraft/src/ModelBoat.java.patch | 28 + .../net/minecraft/src/ModelBook.java.patch | 82 + patches/net/minecraft/src/ModelBox.java.patch | 144 + .../net/minecraft/src/ModelChest.java.patch | 34 + .../net/minecraft/src/ModelChicken.java.patch | 90 + .../net/minecraft/src/ModelCreeper.java.patch | 81 + .../net/minecraft/src/ModelDragon.java.patch | 190 + .../src/ModelEnderCrystal.java.patch | 74 + .../minecraft/src/ModelEnderman.java.patch | 93 + .../net/minecraft/src/ModelGhast.java.patch | 55 + .../net/minecraft/src/ModelHorse.java.patch | 375 + .../minecraft/src/ModelIronGolem.java.patch | 157 + .../minecraft/src/ModelLeashKnot.java.patch | 44 + .../minecraft/src/ModelMagmaCube.java.patch | 65 + .../minecraft/src/ModelMinecart.java.patch | 33 + .../net/minecraft/src/ModelOcelot.java.patch | 213 + patches/net/minecraft/src/ModelPig.java.patch | 15 + .../minecraft/src/ModelQuadruped.java.patch | 113 + .../minecraft/src/ModelRenderer.java.patch | 367 + .../net/minecraft/src/ModelSheep1.java.patch | 32 + .../net/minecraft/src/ModelSheep2.java.patch | 32 + .../net/minecraft/src/ModelSign.java.patch | 28 + .../minecraft/src/ModelSilverfish.java.patch | 84 + .../minecraft/src/ModelSkeleton.java.patch | 53 + .../src/ModelSkeletonHead.java.patch | 44 + .../net/minecraft/src/ModelSlime.java.patch | 61 + .../net/minecraft/src/ModelSnowMan.java.patch | 47 + .../net/minecraft/src/ModelSpider.java.patch | 124 + .../net/minecraft/src/ModelSquid.java.patch | 71 + .../minecraft/src/ModelVillager.java.patch | 122 + .../net/minecraft/src/ModelWitch.java.patch | 45 + .../net/minecraft/src/ModelWither.java.patch | 75 + .../net/minecraft/src/ModelWolf.java.patch | 182 + .../net/minecraft/src/ModelZombie.java.patch | 53 + .../src/ModelZombieVillager.java.patch | 65 + .../ModifiableAttributeInstance.java.patch | 183 + .../net/minecraft/src/MouseFilter.java.patch | 30 + .../net/minecraft/src/MouseHelper.java.patch | 28 + .../minecraft/src/MovementInput.java.patch | 29 + .../src/MovementInputFromOptions.java.patch | 86 + .../src/MovingObjectPosition.java.patch | 55 + patches/net/minecraft/src/NBTBase.java.patch | 301 + .../net/minecraft/src/NBTTagByte.java.patch | 76 + .../minecraft/src/NBTTagByteArray.java.patch | 79 + .../minecraft/src/NBTTagCompound.java.patch | 557 + .../net/minecraft/src/NBTTagDouble.java.patch | 76 + .../net/minecraft/src/NBTTagEnd.java.patch | 38 + .../net/minecraft/src/NBTTagFloat.java.patch | 76 + .../net/minecraft/src/NBTTagInt.java.patch | 76 + .../minecraft/src/NBTTagIntArray.java.patch | 92 + .../net/minecraft/src/NBTTagList.java.patch | 182 + .../net/minecraft/src/NBTTagLong.java.patch | 76 + .../net/minecraft/src/NBTTagShort.java.patch | 76 + .../net/minecraft/src/NBTTagString.java.patch | 91 + .../minecraft/src/NetClientHandler.java.patch | 2163 + .../net/minecraft/src/NetHandler.java.patch | 709 + .../minecraft/src/NetLoginHandler.java.patch | 348 + .../minecraft/src/NetServerHandler.java.patch | 1268 + .../src/NetworkListenThread.java.patch | 86 + .../src/NextTickListEntry.java.patch | 97 + .../net/minecraft/src/NibbleArray.java.patch | 79 + .../src/NibbleArrayReader.java.patch | 23 + .../src/NoiseGeneratorOctaves.java.patch | 81 + .../src/NoiseGeneratorPerlin.java.patch | 202 + .../net/minecraft/src/NpcMerchant.java.patch | 54 + .../src/NumberInvalidException.java.patch | 12 + .../src/OpenGlCapsChecker.java.patch | 13 + .../net/minecraft/src/OpenGlHelper.java.patch | 107 + .../src/PackMetadataSection.java.patch | 24 + .../PackMetadataSectionSerializer.java.patch | 44 + patches/net/minecraft/src/Packet.java.patch | 399 + .../minecraft/src/Packet0KeepAlive.java.patch | 82 + .../src/Packet100OpenWindow.java.patch | 121 + .../src/Packet101CloseWindow.java.patch | 58 + .../src/Packet102WindowClick.java.patch | 105 + .../minecraft/src/Packet103SetSlot.java.patch | 80 + .../src/Packet104WindowItems.java.patch | 98 + .../src/Packet105UpdateProgressbar.java.patch | 86 + .../src/Packet106Transaction.java.patch | 76 + .../src/Packet107CreativeSetSlot.java.patch | 64 + .../src/Packet108EnchantItem.java.patch | 70 + .../minecraft/src/Packet10Flying.java.patch | 103 + .../src/Packet11PlayerPosition.java.patch | 65 + .../src/Packet12PlayerLook.java.patch | 53 + .../src/Packet130UpdateSign.java.patch | 102 + .../minecraft/src/Packet131MapData.java.patch | 85 + .../src/Packet132TileEntityData.java.patch | 100 + .../src/Packet133TileEditorOpen.java.patch | 76 + .../src/Packet13PlayerLookMove.java.patch | 78 + .../minecraft/src/Packet14BlockDig.java.patch | 98 + .../minecraft/src/Packet15Place.java.patch | 138 + .../src/Packet16BlockItemSwitch.java.patch | 79 + .../minecraft/src/Packet17Sleep.java.patch | 82 + .../src/Packet18Animation.java.patch | 92 + .../src/Packet19EntityAction.java.patch | 89 + .../net/minecraft/src/Packet1Login.java.patch | 141 + .../src/Packet200Statistic.java.patch | 72 + .../src/Packet201PlayerInfo.java.patch | 81 + .../src/Packet202PlayerAbilities.java.patch | 205 + .../src/Packet203AutoComplete.java.patch | 90 + .../src/Packet204ClientInfo.java.patch | 121 + .../src/Packet205ClientCommand.java.patch | 64 + .../src/Packet206SetObjective.java.patch | 82 + .../src/Packet207SetScore.java.patch | 119 + .../Packet208SetDisplayObjective.java.patch | 83 + .../src/Packet209SetPlayerTeam.java.patch | 191 + .../src/Packet20NamedEntitySpawn.java.patch | 149 + .../minecraft/src/Packet22Collect.java.patch | 71 + .../src/Packet23VehicleSpawn.java.patch | 218 + .../minecraft/src/Packet24MobSpawn.java.patch | 205 + .../src/Packet250CustomPayload.java.patch | 104 + .../src/Packet252SharedKey.java.patch | 100 + .../src/Packet253ServerAuthData.java.patch | 89 + .../src/Packet254ServerPing.java.patch | 113 + .../src/Packet255KickDisconnect.java.patch | 82 + .../src/Packet25EntityPainting.java.patch | 92 + .../src/Packet26EntityExpOrb.java.patch | 92 + .../src/Packet27PlayerInput.java.patch | 76 + .../src/Packet28EntityVelocity.java.patch | 153 + .../src/Packet29DestroyEntity.java.patch | 80 + .../src/Packet2ClientProtocol.java.patch | 99 + .../minecraft/src/Packet30Entity.java.patch | 102 + .../src/Packet31RelEntityMove.java.patch | 65 + .../src/Packet32EntityLook.java.patch | 53 + .../src/Packet33RelEntityMoveLook.java.patch | 71 + .../src/Packet34EntityTeleport.java.patch | 144 + .../src/Packet35EntityHeadRotation.java.patch | 90 + .../src/Packet38EntityStatus.java.patch | 68 + .../src/Packet39AttachEntity.java.patch | 95 + .../net/minecraft/src/Packet3Chat.java.patch | 105 + .../src/Packet40EntityMetadata.java.patch | 82 + .../src/Packet41EntityEffect.java.patch | 118 + .../src/Packet42RemoveEntityEffect.java.patch | 71 + .../src/Packet43Experience.java.patch | 97 + .../src/Packet44UpdateAttributes.java.patch | 135 + ...acket44UpdateAttributesSnapshot.java.patch | 40 + .../src/Packet4UpdateTime.java.patch | 106 + .../minecraft/src/Packet51MapChunk.java.patch | 262 + .../src/Packet52MultiBlockChange.java.patch | 146 + .../src/Packet53BlockChange.java.patch | 98 + .../src/Packet54PlayNoteBlock.java.patch | 100 + .../src/Packet55BlockDestroy.java.patch | 152 + .../src/Packet56MapChunks.java.patch | 194 + .../src/Packet5PlayerInventory.java.patch | 106 + .../src/Packet60Explosion.java.patch | 173 + .../src/Packet61DoorChange.java.patch | 88 + .../src/Packet62LevelSound.java.patch | 132 + .../src/Packet63WorldParticles.java.patch | 169 + .../src/Packet6SpawnPosition.java.patch | 104 + .../src/Packet70GameEvent.java.patch | 79 + .../minecraft/src/Packet71Weather.java.patch | 86 + .../minecraft/src/Packet7UseEntity.java.patch | 82 + .../src/Packet8UpdateHealth.java.patch | 97 + .../minecraft/src/Packet9Respawn.java.patch | 100 + .../net/minecraft/src/PacketCount.java.patch | 48 + patches/net/minecraft/src/Particle.java.patch | 62 + patches/net/minecraft/src/Path.java.patch | 191 + .../net/minecraft/src/PathEntity.java.patch | 137 + .../net/minecraft/src/PathFinder.java.patch | 433 + .../net/minecraft/src/PathNavigate.java.patch | 533 + .../net/minecraft/src/PathPoint.java.patch | 105 + .../minecraft/src/PendingInvite.java.patch | 29 + .../src/PendingInvitesList.java.patch | 35 + .../src/PlayerCapabilities.java.patch | 84 + .../src/PlayerControllerMP.java.patch | 562 + .../minecraft/src/PlayerInstance.java.patch | 270 + .../minecraft/src/PlayerManager.java.patch | 404 + .../src/PlayerNotFoundException.java.patch | 12 + .../src/PlayerPositionComparator.java.patch | 30 + .../minecraft/src/PlayerSelector.java.patch | 342 + .../src/PlayerUsageSnooper.java.patch | 170 + .../src/PlayerUsageSnooperThread.java.patch | 37 + .../minecraft/src/PortalPosition.java.patch | 23 + .../net/minecraft/src/PositionImpl.java.patch | 17 + .../src/PositionTextureVertex.java.patch | 44 + patches/net/minecraft/src/Potion.java.patch | 380 + .../minecraft/src/PotionAbsoption.java.patch | 32 + .../src/PotionAttackDamage.java.patch | 18 + .../net/minecraft/src/PotionEffect.java.patch | 223 + .../net/minecraft/src/PotionHealth.java.patch | 28 + .../src/PotionHealthBoost.java.patch | 25 + .../net/minecraft/src/PotionHelper.java.patch | 680 + patches/net/minecraft/src/Profiler.java.patch | 212 + .../minecraft/src/ProfilerResult.java.patch | 36 + .../minecraft/src/PropertyManager.java.patch | 173 + .../src/RConConsoleSource.java.patch | 63 + .../minecraft/src/RConOutputStream.java.patch | 88 + .../minecraft/src/RConThreadBase.java.patch | 245 + .../minecraft/src/RConThreadClient.java.patch | 234 + .../minecraft/src/RConThreadMain.java.patch | 152 + .../minecraft/src/RConThreadQuery.java.patch | 437 + .../src/RConThreadQueryAuth.java.patch | 78 + .../net/minecraft/src/RConUtils.java.patch | 78 + .../src/RandomPositionGenerator.java.patch | 123 + .../minecraft/src/RangedAttribute.java.patch | 65 + .../minecraft/src/RecipeFireworks.java.patch | 202 + .../net/minecraft/src/RecipeSorter.java.patch | 28 + .../net/minecraft/src/RecipesArmor.java.patch | 38 + .../minecraft/src/RecipesArmorDyes.java.patch | 131 + .../minecraft/src/RecipesCrafting.java.patch | 46 + .../net/minecraft/src/RecipesDyes.java.patch | 65 + .../net/minecraft/src/RecipesFood.java.patch | 32 + .../minecraft/src/RecipesIngots.java.patch | 37 + .../src/RecipesMapCloning.java.patch | 92 + .../src/RecipesMapExtending.java.patch | 69 + .../net/minecraft/src/RecipesTools.java.patch | 40 + .../minecraft/src/RecipesWeapons.java.patch | 42 + .../src/RedstoneUpdateInfo.java.patch | 18 + .../net/minecraft/src/RegionFile.java.patch | 378 + .../minecraft/src/RegionFileCache.java.patch | 93 + .../src/RegionFileChunkBuffer.java.patch | 21 + .../src/RegistryDefaulted.java.patch | 28 + .../minecraft/src/RegistrySimple.java.patch | 30 + patches/net/minecraft/src/Render.java.patch | 390 + .../net/minecraft/src/RenderArrow.java.patch | 71 + .../net/minecraft/src/RenderBat.java.patch | 135 + .../net/minecraft/src/RenderBiped.java.patch | 378 + .../net/minecraft/src/RenderBlaze.java.patch | 72 + .../net/minecraft/src/RenderBlocks.java.patch | 11409 + .../net/minecraft/src/RenderBoat.java.patch | 79 + .../minecraft/src/RenderCaveSpider.java.patch | 45 + .../minecraft/src/RenderChicken.java.patch | 86 + .../net/minecraft/src/RenderCow.java.patch | 26 + .../minecraft/src/RenderCreeper.java.patch | 160 + .../net/minecraft/src/RenderDragon.java.patch | 291 + .../src/RenderEnchantmentTable.java.patch | 78 + .../minecraft/src/RenderEndPortal.java.patch | 116 + .../src/RenderEnderCrystal.java.patch | 50 + .../minecraft/src/RenderEnderman.java.patch | 191 + .../net/minecraft/src/RenderEntity.java.patch | 29 + .../src/RenderFallingSand.java.patch | 97 + .../minecraft/src/RenderFireball.java.patch | 52 + .../net/minecraft/src/RenderFish.java.patch | 115 + .../net/minecraft/src/RenderGhast.java.patch | 48 + .../src/RenderGiantZombie.java.patch | 50 + .../net/minecraft/src/RenderGlobal.java.patch | 2865 + .../net/minecraft/src/RenderHelper.java.patch | 70 + .../net/minecraft/src/RenderHorse.java.patch | 144 + .../minecraft/src/RenderIronGolem.java.patch | 134 + .../net/minecraft/src/RenderItem.java.patch | 855 + .../minecraft/src/RenderItemFrame.java.patch | 208 + .../minecraft/src/RenderLeashKnot.java.patch | 50 + .../src/RenderLightningBolt.java.patch | 149 + .../net/minecraft/src/RenderList.java.patch | 74 + .../net/minecraft/src/RenderLiving.java.patch | 207 + .../minecraft/src/RenderMagmaCube.java.patch | 41 + .../minecraft/src/RenderManager.java.patch | 464 + .../minecraft/src/RenderMinecart.java.patch | 166 + .../src/RenderMinecartMobSpawner.java.patch | 28 + .../minecraft/src/RenderMooshroom.java.patch | 138 + .../net/minecraft/src/RenderOcelot.java.patch | 118 + .../minecraft/src/RenderPainting.java.patch | 153 + .../net/minecraft/src/RenderPig.java.patch | 62 + .../net/minecraft/src/RenderPlayer.java.patch | 651 + .../net/minecraft/src/RenderSheep.java.patch | 69 + .../minecraft/src/RenderSilverfish.java.patch | 94 + .../minecraft/src/RenderSkeleton.java.patch | 59 + .../net/minecraft/src/RenderSlime.java.patch | 89 + .../minecraft/src/RenderSnowMan.java.patch | 81 + .../minecraft/src/RenderSnowball.java.patch | 95 + .../net/minecraft/src/RenderSorter.java.patch | 40 + .../net/minecraft/src/RenderSpider.java.patch | 98 + .../net/minecraft/src/RenderSquid.java.patch | 113 + .../minecraft/src/RenderTNTPrimed.java.patch | 74 + .../src/RenderTntMinecart.java.patch | 60 + .../minecraft/src/RenderVillager.java.patch | 156 + .../net/minecraft/src/RenderWitch.java.patch | 189 + .../net/minecraft/src/RenderWither.java.patch | 159 + .../src/RenderWitherSkull.java.patch | 81 + .../net/minecraft/src/RenderWolf.java.patch | 103 + .../net/minecraft/src/RenderXPOrb.java.patch | 94 + .../net/minecraft/src/RenderZombie.java.patch | 181 + .../src/RendererLivingEntity.java.patch | 741 + .../src/ReportedException.java.patch | 22 + patches/net/minecraft/src/Request.java.patch | 194 + .../minecraft/src/RequestDelete.java.patch | 27 + .../net/minecraft/src/RequestGet.java.patch | 29 + .../net/minecraft/src/RequestPost.java.patch | 35 + .../net/minecraft/src/RequestPut.java.patch | 33 + .../minecraft/src/ResourceLocation.java.patch | 92 + ...sourcePackFileNotFoundException.java.patch | 12 + .../src/ResourcePackRepository.java.patch | 131 + .../ResourcePackRepositoryEntry.java.patch | 91 + .../ResourcePackRepositoryFilter.java.patch | 15 + .../src/RunnableTitleScreen.java.patch | 42 + .../src/SaveFormatComparator.java.patch | 93 + .../minecraft/src/SaveFormatOld.java.patch | 223 + .../net/minecraft/src/SaveHandler.java.patch | 347 + .../minecraft/src/SaveHandlerMP.java.patch | 85 + .../minecraft/src/ScaledResolution.java.patch | 26 + .../minecraft/src/ScheduledSound.java.patch | 33 + patches/net/minecraft/src/Score.java.patch | 88 + .../minecraft/src/ScoreComparator.java.patch | 18 + .../src/ScoreDummyCriteria.java.patch | 27 + .../src/ScoreHealthCriteria.java.patch | 30 + .../minecraft/src/ScoreObjective.java.patch | 51 + .../src/ScoreObjectiveCriteria.java.patch | 11 + .../minecraft/src/ScorePlayerTeam.java.patch | 159 + .../net/minecraft/src/Scoreboard.java.patch | 424 + .../src/ScoreboardSaveData.java.patch | 225 + .../src/ScreenChatOptions.java.patch | 130 + .../minecraft/src/ScreenShotHelper.java.patch | 223 + .../src/SelectionListBase.java.patch | 209 + .../src/SelectionListInvited.java.patch | 60 + .../minecraft/src/ServerAddress.java.patch | 112 + .../src/ServerBlockEventList.java.patch | 15 + .../minecraft/src/ServerCommand.java.patch | 20 + .../src/ServerCommandManager.java.patch | 64 + .../src/ServerCommandScoreboard.java.patch | 975 + .../src/ServerCommandTestFor.java.patch | 41 + .../src/ServerConfigurationManager.java.patch | 1212 + .../net/minecraft/src/ServerData.java.patch | 99 + .../net/minecraft/src/ServerList.java.patch | 134 + .../src/ServerListenThread.java.patch | 125 + .../minecraft/src/ServerScoreboard.java.patch | 304 + .../src/ServersideAttributeMap.java.patch | 98 + patches/net/minecraft/src/Session.java.patch | 29 + .../minecraft/src/ShapedRecipes.java.patch | 148 + .../minecraft/src/ShapelessRecipes.java.patch | 85 + .../src/SharedMonsterAttributes.java.patch | 129 + ...SimpleReloadableResourceManager.java.patch | 133 + ...ReloadableResourceManagerINNER1.java.patch | 28 + .../minecraft/src/SimpleResource.java.patch | 92 + .../minecraft/src/SimpleTexture.java.patch | 57 + patches/net/minecraft/src/Slot.java.patch | 169 + .../net/minecraft/src/SlotArmor.java.patch | 50 + .../net/minecraft/src/SlotBeacon.java.patch | 38 + .../src/SlotBrewingStandIngredient.java.patch | 38 + .../src/SlotBrewingStandPotion.java.patch | 59 + .../net/minecraft/src/SlotCrafting.java.patch | 141 + .../src/SlotCreativeInventory.java.patch | 113 + .../minecraft/src/SlotEnchantment.java.patch | 26 + .../src/SlotEnchantmentTable.java.patch | 42 + .../net/minecraft/src/SlotFurnace.java.patch | 120 + .../src/SlotMerchantResult.java.patch | 135 + .../minecraft/src/SorterStatsBlock.java.patch | 70 + .../minecraft/src/SorterStatsItem.java.patch | 70 + .../net/minecraft/src/SoundManager.java.patch | 911 + .../src/SoundManagerINNER1.java.patch | 13 + .../net/minecraft/src/SoundPool.java.patch | 151 + .../minecraft/src/SoundPoolEntry.java.patch | 31 + .../src/SoundPoolProtocolHandler.java.patch | 18 + .../src/SoundPoolURLConnection.java.patch | 38 + .../src/SoundUpdaterMinecart.java.patch | 142 + .../minecraft/src/SpawnListEntry.java.patch | 30 + .../minecraft/src/SpawnerAnimals.java.patch | 350 + .../src/SpiderEffectsGroupData.java.patch | 27 + patches/net/minecraft/src/StatBase.java.patch | 109 + .../net/minecraft/src/StatBasic.java.patch | 32 + .../minecraft/src/StatCollector.java.patch | 34 + .../net/minecraft/src/StatCrafting.java.patch | 15 + .../minecraft/src/StatFileWriter.java.patch | 273 + patches/net/minecraft/src/StatList.java.patch | 309 + .../minecraft/src/StatPlaceholder.java.patch | 12 + .../src/StatStringFormatKeyInv.java.patch | 27 + .../minecraft/src/StatTypeDistance.java.patch | 19 + .../minecraft/src/StatTypeFloat.java.patch | 16 + .../minecraft/src/StatTypeSimple.java.patch | 16 + .../net/minecraft/src/StatTypeTime.java.patch | 17 + .../net/minecraft/src/StatsSyncher.java.patch | 370 + .../net/minecraft/src/StepSound.java.patch | 48 + .../minecraft/src/StepSoundAnvil.java.patch | 25 + .../minecraft/src/StepSoundSand.java.patch | 18 + .../minecraft/src/StepSoundStone.java.patch | 25 + .../net/minecraft/src/StitchHolder.java.patch | 77 + .../net/minecraft/src/StitchSlot.java.patch | 133 + patches/net/minecraft/src/Stitcher.java.patch | 249 + .../src/StitcherException.java.patch | 14 + .../minecraft/src/StringTranslate.java.patch | 131 + .../net/minecraft/src/StringUtils.java.patch | 27 + .../src/StructureBoundingBox.java.patch | 245 + .../src/StructureComponent.java.patch | 1133 + .../src/StructureMineshaftPieces.java.patch | 87 + .../src/StructureMineshaftStart.java.patch | 25 + ...tructureNetherBridgePieceWeight.java.patch | 42 + .../StructureNetherBridgePieces.java.patch | 87 + .../src/StructureNetherBridgeStart.java.patch | 39 + .../StructurePieceBlockSelector.java.patch | 12 + .../StructureScatteredFeatureStart.java.patch | 40 + ...StructureScatteredFeatureStones.java.patch | 29 + .../minecraft/src/StructureStart.java.patch | 199 + .../StructureStrongholdPieceWeight.java.patch | 34 + ...StructureStrongholdPieceWeight2.java.patch | 18 + ...StructureStrongholdPieceWeight3.java.patch | 18 + .../src/StructureStrongholdPieces.java.patch | 227 + .../src/StructureStrongholdStart.java.patch | 38 + .../src/StructureStrongholdStones.java.patch | 44 + .../StructureVillagePieceWeight.java.patch | 29 + .../src/StructureVillagePieces.java.patch | 256 + .../src/StructureVillageStart.java.patch | 88 + .../src/SyntaxErrorException.java.patch | 12 + .../minecraft/src/TaskLongRunning.java.patch | 54 + .../src/TaskOnlineConnect.java.patch | 99 + .../minecraft/src/TaskResetWorld.java.patch | 46 + .../src/TaskWorldCreation.java.patch | 52 + .../minecraft/src/TcpConnection.java.patch | 654 + .../minecraft/src/TcpMasterThread.java.patch | 40 + .../minecraft/src/TcpMonitorThread.java.patch | 27 + .../minecraft/src/TcpReaderThread.java.patch | 40 + .../minecraft/src/TcpWriterThread.java.patch | 53 + patches/net/minecraft/src/Team.java.patch | 17 + .../net/minecraft/src/Teleporter.java.patch | 498 + .../net/minecraft/src/Tessellator.java.patch | 691 + .../src/TextureAtlasSprite.java.patch | 328 + .../net/minecraft/src/TextureClock.java.patch | 86 + .../minecraft/src/TextureCompass.java.patch | 111 + .../minecraft/src/TextureManager.java.patch | 210 + .../src/TextureManagerINNER1.java.patch | 18 + .../net/minecraft/src/TextureMap.java.patch | 237 + .../src/TextureMetadataSection.java.patch | 15 + ...extureMetadataSectionSerializer.java.patch | 28 + .../minecraft/src/TextureOffset.java.patch | 21 + .../net/minecraft/src/TextureUtil.java.patch | 249 + .../net/minecraft/src/TexturedQuad.java.patch | 71 + .../src/ThreadClientSleep.java.patch | 30 + .../ThreadConnectToOnlineServer.java.patch | 115 + .../src/ThreadConnectToServer.java.patch | 90 + .../src/ThreadDownloadImage.java.patch | 76 + .../src/ThreadDownloadImageData.java.patch | 99 + .../ThreadDownloadImageDataINNER1.java.patch | 50 + .../src/ThreadLanServerFind.java.patch | 62 + .../src/ThreadLanServerPing.java.patch | 110 + .../src/ThreadLoginVerifier.java.patch | 38 + .../src/ThreadMinecraftServer.java.patch | 25 + .../src/ThreadOnlineConnect.java.patch | 65 + .../src/ThreadOnlineScreen.java.patch | 28 + .../src/ThreadPollServers.java.patch | 131 + .../src/ThreadStatSyncherReceive.java.patch | 29 + .../src/ThreadStatSyncherSend.java.patch | 31 + .../src/ThreadedFileIOBase.java.patch | 77 + .../net/minecraft/src/TileEntity.java.patch | 273 + .../minecraft/src/TileEntityBeacon.java.patch | 417 + .../src/TileEntityBeaconRenderer.java.patch | 137 + .../src/TileEntityBrewingStand.java.patch | 408 + .../minecraft/src/TileEntityChest.java.patch | 579 + .../src/TileEntityChestRenderer.java.patch | 191 + .../src/TileEntityCommandBlock.java.patch | 162 + .../src/TileEntityComparator.java.patch | 38 + .../src/TileEntityDaylightDetector.java.patch | 24 + .../src/TileEntityDispenser.java.patch | 255 + .../src/TileEntityDropper.java.patch | 15 + .../src/TileEntityEnchantmentTable.java.patch | 191 + .../src/TileEntityEnderChest.java.patch | 109 + .../TileEntityEnderChestRenderer.java.patch | 70 + .../src/TileEntityFurnace.java.patch | 468 + .../minecraft/src/TileEntityHopper.java.patch | 607 + .../src/TileEntityMobSpawner.java.patch | 66 + .../src/TileEntityMobSpawnerLogic.java.patch | 39 + .../TileEntityMobSpawnerRenderer.java.patch | 47 + .../minecraft/src/TileEntityNote.java.patch | 90 + .../minecraft/src/TileEntityPiston.java.patch | 243 + .../src/TileEntityRecordPlayer.java.patch | 59 + .../src/TileEntityRenderer.java.patch | 221 + .../src/TileEntityRendererPiston.java.patch | 82 + .../minecraft/src/TileEntitySign.java.patch | 125 + .../src/TileEntitySignRenderer.java.patch | 142 + .../minecraft/src/TileEntitySkull.java.patch | 100 + .../src/TileEntitySkullRenderer.java.patch | 143 + .../src/TileEntitySpecialRenderer.java.patch | 49 + patches/net/minecraft/src/Timer.java.patch | 112 + patches/net/minecraft/src/Tuple.java.patch | 40 + .../net/minecraft/src/ValueObject.java.patch | 29 + .../minecraft/src/ValueObjectList.java.patch | 39 + .../src/ValueObjectSubscription.java.patch | 24 + patches/net/minecraft/src/Vec3.java.patch | 313 + patches/net/minecraft/src/Vec3Pool.java.patch | 93 + patches/net/minecraft/src/Village.java.patch | 649 + .../minecraft/src/VillageAgressor.java.patch | 19 + .../src/VillageCollection.java.patch | 405 + .../minecraft/src/VillageDoorInfo.java.patch | 64 + .../net/minecraft/src/VillageSiege.java.patch | 237 + .../minecraft/src/WatchableObject.java.patch | 59 + .../minecraft/src/WeightedRandom.java.patch | 123 + .../src/WeightedRandomChestContent.java.patch | 148 + .../src/WeightedRandomItem.java.patch | 18 + .../src/WeightedRandomMinecart.java.patch | 108 + patches/net/minecraft/src/World.java.patch | 5172 + .../src/WorldChunkManager.java.patch | 315 + .../src/WorldChunkManagerHell.java.patch | 156 + .../net/minecraft/src/WorldClient.java.patch | 558 + .../src/WorldClientINNER3.java.patch | 13 + .../src/WorldClientINNER4.java.patch | 13 + .../src/WorldGenBigMushroom.java.patch | 221 + .../minecraft/src/WorldGenBigTree.java.patch | 561 + .../minecraft/src/WorldGenCactus.java.patch | 32 + .../net/minecraft/src/WorldGenClay.java.patch | 54 + .../minecraft/src/WorldGenDeadBush.java.patch | 54 + .../src/WorldGenDesertWells.java.patch | 117 + .../minecraft/src/WorldGenDungeons.java.patch | 209 + .../net/minecraft/src/WorldGenFire.java.patch | 24 + .../minecraft/src/WorldGenFlowers.java.patch | 34 + .../minecraft/src/WorldGenForest.java.patch | 114 + .../src/WorldGenGlowStone1.java.patch | 97 + .../src/WorldGenGlowStone2.java.patch | 97 + .../minecraft/src/WorldGenHellLava.java.patch | 122 + .../src/WorldGenHugeTrees.java.patch | 274 + .../minecraft/src/WorldGenLakes.java.patch | 187 + .../minecraft/src/WorldGenLiquids.java.patch | 108 + .../minecraft/src/WorldGenMinable.java.patch | 91 + .../minecraft/src/WorldGenPumpkin.java.patch | 24 + .../net/minecraft/src/WorldGenReed.java.patch | 32 + .../net/minecraft/src/WorldGenSand.java.patch | 54 + .../minecraft/src/WorldGenShrub.java.patch | 76 + .../minecraft/src/WorldGenSpikes.java.patch | 79 + .../minecraft/src/WorldGenSwamp.java.patch | 184 + .../minecraft/src/WorldGenTaiga1.java.patch | 109 + .../minecraft/src/WorldGenTaiga2.java.patch | 134 + .../src/WorldGenTallGrass.java.patch | 57 + .../minecraft/src/WorldGenTrees.java.patch | 274 + .../minecraft/src/WorldGenVines.java.patch | 32 + .../src/WorldGenWaterlily.java.patch | 24 + .../minecraft/src/WorldGenerator.java.patch | 60 + .../src/WorldGeneratorBonusChest.java.patch | 118 + .../net/minecraft/src/WorldInfo.java.patch | 824 + .../net/minecraft/src/WorldManager.java.patch | 173 + .../minecraft/src/WorldProvider.java.patch | 265 + .../minecraft/src/WorldProviderEnd.java.patch | 136 + .../src/WorldProviderHell.java.patch | 108 + .../src/WorldProviderSurface.java.patch | 13 + .../minecraft/src/WorldRenderer.java.patch | 535 + .../minecraft/src/WorldSavedData.java.patch | 52 + .../net/minecraft/src/WorldServer.java.patch | 1071 + .../minecraft/src/WorldServerMulti.java.patch | 25 + .../minecraft/src/WorldSettings.java.patch | 139 + .../minecraft/src/WorldTemplate.java.patch | 33 + .../src/WorldTemplateList.java.patch | 39 + .../net/minecraft/src/WorldType.java.patch | 126 + .../src/WrongUsageException.java.patch | 12 + patches/org/bukkit/ChatColor.java.patch | 255 + patches/org/bukkit/util/FileUtil.java.patch | 58 + .../org/bukkit/util/Java15Compat.java.patch | 24 + .../util/config/Configuration.java.patch | 140 + .../config/ConfigurationException.java.patch | 19 + .../util/config/ConfigurationNode.java.patch | 589 + .../org/spoutcraft/api/Achievement.java.patch | 85 + .../api/AnimatableLocation.java.patch | 51 + patches/org/spoutcraft/api/Art.java.patch | 118 + .../api/BlockChangeDelegate.java.patch | 69 + .../org/spoutcraft/api/ChatColor.java.patch | 95 + patches/org/spoutcraft/api/Client.java.patch | 82 + patches/org/spoutcraft/api/Effect.java.patch | 47 + .../org/spoutcraft/api/GameMode.java.patch | 73 + .../org/spoutcraft/api/Instrument.java.patch | 55 + patches/org/spoutcraft/api/MPOnly.java.patch | 37 + .../spoutcraft/api/NotImplemented.java.patch | 37 + patches/org/spoutcraft/api/Note.java.patch | 222 + patches/org/spoutcraft/api/SPOnly.java.patch | 37 + .../org/spoutcraft/api/Spoutcraft.java.patch | 196 + .../org/spoutcraft/api/Statistic.java.patch | 79 + .../org/spoutcraft/api/TreeType.java.patch | 34 + .../org/spoutcraft/api/UnsafeClass.java.patch | 37 + .../api/UnsafeConstructor.java.patch | 37 + .../spoutcraft/api/UnsafeMethod.java.patch | 37 + .../api/animation/Animatable.java.patch | 27 + .../api/animation/Animation.java.patch | 256 + .../animation/AnimationProgress.java.patch | 27 + .../ExponentialAnimationProgress.java.patch | 39 + .../InQuadAnimationProgress.java.patch | 39 + .../LinearAnimationProgress.java.patch | 29 + .../LogarithmicAnimationProgress.java.patch | 41 + .../OutQuadAnimationProgress.java.patch | 39 + .../animation/PropertyAnimation.java.patch | 66 + .../api/animation/PropertyDelegate.java.patch | 42 + .../api/animation/ValueSetDelegate.java.patch | 42 + .../api/block/design/BlockDesign.java.patch | 242 + .../design/GenericBlockDesign.java.patch | 466 + .../design/GenericCubeBlockDesign.java.patch | 118 + .../api/block/design/Quad.java.patch | 105 + .../api/block/design/SubTexture.java.patch | 83 + .../api/block/design/Texture.java.patch | 80 + .../api/block/design/Vertex.java.patch | 120 + .../api/entity/EntitySkinType.java.patch | 53 + .../api/gui/AbstractListModel.java.patch | 55 + .../spoutcraft/api/gui/ArmorBar.java.patch | 155 + .../spoutcraft/api/gui/BasicLabel.java.patch | 48 + .../org/spoutcraft/api/gui/Bitmap.java.patch | 57 + .../spoutcraft/api/gui/BubbleBar.java.patch | 132 + .../org/spoutcraft/api/gui/Button.java.patch | 71 + .../org/spoutcraft/api/gui/ChatBar.java.patch | 133 + .../spoutcraft/api/gui/ChatTextBox.java.patch | 275 + .../spoutcraft/api/gui/CheckBox.java.patch | 41 + .../org/spoutcraft/api/gui/Color.java.patch | 176 + .../spoutcraft/api/gui/ComboBox.java.patch | 47 + .../spoutcraft/api/gui/Container.java.patch | 131 + .../api/gui/ContainerType.java.patch | 29 + .../org/spoutcraft/api/gui/Control.java.patch | 91 + .../api/gui/DirtBackground.java.patch | 55 + .../api/gui/EntityWidget.java.patch | 41 + .../org/spoutcraft/api/gui/ExpBar.java.patch | 69 + .../api/gui/GenericBitmap.java.patch | 69 + .../api/gui/GenericButton.java.patch | 170 + .../api/gui/GenericCheckBox.java.patch | 74 + .../api/gui/GenericComboBox.java.patch | 382 + .../api/gui/GenericContainer.java.patch | 464 + .../api/gui/GenericControl.java.patch | 113 + .../api/gui/GenericEntityWidget.java.patch | 76 + .../api/gui/GenericGradient.java.patch | 99 + .../api/gui/GenericItemWidget.java.patch | 118 + .../api/gui/GenericLabel.java.patch | 216 + .../api/gui/GenericListView.java.patch | 131 + .../api/gui/GenericListWidget.java.patch | 221 + .../api/gui/GenericListWidgetItem.java.patch | 132 + .../api/gui/GenericOverlayScreen.java.patch | 46 + .../api/gui/GenericPolygon.java.patch | 107 + .../api/gui/GenericPopup.java.patch | 88 + .../api/gui/GenericRadioButton.java.patch | 105 + .../api/gui/GenericRectangle.java.patch | 51 + .../api/gui/GenericScreen.java.patch | 273 + .../api/gui/GenericScrollArea.java.patch | 251 + .../api/gui/GenericScrollable.java.patch | 244 + .../api/gui/GenericSlider.java.patch | 165 + .../spoutcraft/api/gui/GenericSlot.java.patch | 154 + .../api/gui/GenericTextField.java.patch | 230 + .../api/gui/GenericTextProcessor.java.patch | 446 + .../api/gui/GenericTexture.java.patch | 163 + .../api/gui/GenericWidget.java.patch | 661 + .../spoutcraft/api/gui/Gradient.java.patch | 73 + .../spoutcraft/api/gui/HealthBar.java.patch | 160 + .../spoutcraft/api/gui/HungerBar.java.patch | 143 + .../spoutcraft/api/gui/InGameHUD.java.patch | 119 + .../spoutcraft/api/gui/ItemWidget.java.patch | 77 + .../spoutcraft/api/gui/KeyManager.java.patch | 31 + .../spoutcraft/api/gui/Keyboard.java.patch | 209 + .../org/spoutcraft/api/gui/Label.java.patch | 103 + .../spoutcraft/api/gui/ListWidget.java.patch | 117 + .../api/gui/ListWidgetItem.java.patch | 62 + .../api/gui/MinecraftFont.java.patch | 80 + .../api/gui/MinecraftTessellator.java.patch | 57 + .../spoutcraft/api/gui/Orientation.java.patch | 70 + .../api/gui/OverlayScreen.java.patch | 35 + .../api/gui/PasswordTextProcessor.java.patch | 208 + .../org/spoutcraft/api/gui/Point.java.patch | 77 + .../org/spoutcraft/api/gui/Polygon.java.patch | 77 + .../spoutcraft/api/gui/PopupScreen.java.patch | 54 + .../api/gui/PositionOrientation.java.patch | 34 + .../spoutcraft/api/gui/RadioButton.java.patch | 54 + .../spoutcraft/api/gui/Rectangle.java.patch | 212 + .../api/gui/RenderDelegate.java.patch | 85 + .../api/gui/RenderPriority.java.patch | 65 + .../spoutcraft/api/gui/RenderUtil.java.patch | 131 + .../org/spoutcraft/api/gui/Screen.java.patch | 187 + .../spoutcraft/api/gui/ScreenType.java.patch | 82 + .../spoutcraft/api/gui/ScrollArea.java.patch | 31 + .../api/gui/ScrollBarPolicy.java.patch | 61 + .../spoutcraft/api/gui/Scrollable.java.patch | 117 + .../api/gui/ServerPlayerList.java.patch | 34 + .../org/spoutcraft/api/gui/Slider.java.patch | 57 + .../org/spoutcraft/api/gui/Slot.java.patch | 89 + .../api/gui/SolidBackground.java.patch | 38 + .../spoutcraft/api/gui/TextField.java.patch | 191 + .../api/gui/TextProcessor.java.patch | 129 + .../org/spoutcraft/api/gui/Texture.java.patch | 123 + .../org/spoutcraft/api/gui/Widget.java.patch | 557 + .../api/gui/WidgetAnchor.java.patch | 77 + .../spoutcraft/api/gui/WidgetAnim.java.patch | 92 + .../api/gui/WidgetManager.java.patch | 29 + .../spoutcraft/api/gui/WidgetType.java.patch | 128 + .../api/inventory/Inventory.java.patch | 240 + .../api/inventory/InventoryBuilder.java.patch | 33 + .../api/inventory/ItemStack.java.patch | 358 + .../api/inventory/MaterialManager.java.patch | 51 + .../api/inventory/PlayerInventory.java.patch | 123 + .../api/inventory/Recipe.java.patch | 34 + .../api/inventory/ShapedRecipe.java.patch | 124 + .../api/inventory/ShapelessRecipe.java.patch | 95 + .../api/io/SpoutInputStream.java.patch | 152 + .../api/io/SpoutOutputStream.java.patch | 177 + .../api/keyboard/AbstractBinding.java.patch | 135 + .../BindingExecutionDelegate.java.patch | 48 + .../api/keyboard/KeyBinding.java.patch | 134 + .../api/keyboard/KeyBindingManager.java.patch | 37 + .../api/keyboard/KeyBindingPress.java.patch | 50 + .../spoutcraft/api/material/Armor.java.patch | 26 + .../spoutcraft/api/material/Block.java.patch | 47 + .../api/material/CustomBlock.java.patch | 41 + .../api/material/CustomItem.java.patch | 35 + .../spoutcraft/api/material/Food.java.patch | 27 + .../spoutcraft/api/material/Item.java.patch | 26 + .../spoutcraft/api/material/Liquid.java.patch | 27 + .../api/material/Material.java.patch | 37 + .../api/material/MaterialData.java.patch | 895 + .../spoutcraft/api/material/Plant.java.patch | 31 + .../api/material/SolidBlock.java.patch | 27 + .../spoutcraft/api/material/Tool.java.patch | 35 + .../spoutcraft/api/material/Weapon.java.patch | 26 + .../api/material/block/Air.java.patch | 71 + .../api/material/block/DoubleSlabs.java.patch | 35 + .../material/block/GenericBlock.java.patch | 123 + .../block/GenericCubeCustomBlock.java.patch | 64 + .../block/GenericCustomBlock.java.patch | 239 + .../material/block/GenericLiquid.java.patch | 37 + .../api/material/block/Grass.java.patch | 43 + .../api/material/block/LongGrass.java.patch | 43 + .../api/material/block/Sapling.java.patch | 43 + .../api/material/block/Slab.java.patch | 35 + .../api/material/block/Solid.java.patch | 52 + .../api/material/block/StoneBricks.java.patch | 29 + .../api/material/block/Tree.java.patch | 43 + .../api/material/block/Wool.java.patch | 35 + .../api/material/item/Coal.java.patch | 29 + .../api/material/item/Dye.java.patch | 30 + .../api/material/item/GenericArmor.java.patch | 31 + .../item/GenericCustomFood.java.patch | 56 + .../item/GenericCustomItem.java.patch | 129 + .../item/GenericCustomTool.java.patch | 113 + .../api/material/item/GenericFood.java.patch | 37 + .../api/material/item/GenericItem.java.patch | 75 + .../api/material/item/GenericTool.java.patch | 57 + .../material/item/GenericWeapon.java.patch | 31 + .../api/material/item/Potion.java.patch | 29 + .../api/material/item/SpawnEgg.java.patch | 29 + .../api/packet/PacketUtil.java.patch | 133 + .../api/player/BiomeManager.java.patch | 39 + .../api/player/ChatManager.java.patch | 37 + .../api/player/ChatMessage.java.patch | 221 + .../api/player/RenderDistance.java.patch | 53 + .../api/player/SkyManager.java.patch | 81 + .../api/property/Property.java.patch | 40 + .../api/property/PropertyInterface.java.patch | 31 + .../api/property/PropertyObject.java.patch | 50 + .../org/spoutcraft/api/sound/Music.java.patch | 90 + .../api/sound/SoundEffect.java.patch | 657 + .../api/util/FastLocation.java.patch | 62 + .../spoutcraft/api/util/FastVector.java.patch | 109 + .../api/util/FixedLocation.java.patch | 52 + .../api/util/FixedVector.java.patch | 129 + .../spoutcraft/api/util/Location.java.patch | 41 + .../api/util/MutableIntegerVector.java.patch | 71 + .../api/util/MutableLocation.java.patch | 117 + .../api/util/MutableVector.java.patch | 620 + .../api/util/UniqueItemStringMap.java.patch | 158 + .../org/spoutcraft/api/util/Vector.java.patch | 139 + .../util/map/TIntPairFloatHashMap.java.patch | 104 + .../util/map/TIntPairIntHashMap.java.patch | 104 + .../util/map/TIntPairObjectHashMap.java.patch | 104 + .../client/ChunkComparator.java.patch | 44 + .../client/ClipboardThread.java.patch | 68 + .../client/DataMiningThread.java.patch | 125 + .../client/HDImageBufferDownload.java.patch | 97 + .../client/MCItemStackComparator.java.patch | 72 + .../PacketDecompressionThread.java.patch | 105 + .../client/ReconnectManager.java.patch | 71 + .../ScheduledTextFieldUpdate.java.patch | 70 + .../spoutcraft/client/SpoutClient.java.patch | 605 + .../spoutcraft/client/SpoutVersion.java.patch | 52 + .../client/SpoutcraftWorld.java.patch | 264 + .../client/TileEntityComparator.java.patch | 47 + .../spoutcraft/client/VersionFile.java.patch | 51 + .../client/block/SpoutcraftChunk.java.patch | 159 + .../client/chunkcache/HeightMap.java.patch | 442 + .../chunkcache/HeightMapAgent.java.patch | 75 + .../chunkcache/HeightMapSaveThread.java.patch | 51 + .../chunkcache/PartitionChunk.java.patch | 110 + .../chunkcache/SimpleFileCache.java.patch | 509 + .../client/config/Configuration.java.patch | 822 + .../client/config/MipMapUtils.java.patch | 235 + .../client/config/SettingsHandler.java.patch | 525 + .../controls/GuiAmbigousInput.java.patch | 180 + .../client/controls/Shortcut.java.patch | 115 + .../SimpleKeyBindingManager.java.patch | 343 + .../entity/AbstractProjectile.java.patch | 40 + .../entity/CraftCameraEntity.java.patch | 63 + .../client/entity/CraftEntity.java.patch | 176 + .../entity/CraftEntityFactory.java.patch | 40 + .../client/entity/CraftHumanEntity.java.patch | 64 + .../entity/CraftLivingEntity.java.patch | 158 + .../client/entity/CraftTextEntity.java.patch | 66 + .../client/entity/EntityCamera.java.patch | 63 + .../client/entity/EntityData.java.patch | 87 + .../client/entity/EntityText.java.patch | 121 + .../client/entity/EntityTexture.java.patch | 93 + .../client/entity/RenderText.java.patch | 52 + .../client/entity/RenderTexture.java.patch | 65 + .../client/gui/ButtonUpdater.java.patch | 27 + .../client/gui/ClientTexture.java.patch | 60 + .../client/gui/CustomScreen.java.patch | 65 + .../client/gui/FilterItem.java.patch | 27 + .../client/gui/FilterModel.java.patch | 76 + .../client/gui/GuiSpoutScreen.java.patch | 78 + .../client/gui/GuiTextDialog.java.patch | 108 + .../client/gui/InGameScreen.java.patch | 254 + .../client/gui/LinkButton.java.patch | 48 + .../client/gui/MCRenderDelegate.java.patch | 976 + .../gui/MinecraftFontWrapper.java.patch | 59 + .../MinecraftTessellatorWrapper.java.patch | 94 + .../client/gui/RenderItemCustom.java.patch | 67 + .../client/gui/SafeButton.java.patch | 88 + .../client/gui/ScreenUtil.java.patch | 173 + .../client/gui/SimpleKeyManager.java.patch | 40 + .../client/gui/SimpleWidgetManager.java.patch | 45 + .../client/gui/UpdatingComboBox.java.patch | 42 + .../client/gui/about/GuiAbout.java.patch | 438 + .../client/gui/about/GuiNewAbout.java.patch | 212 + .../client/gui/about/ImageSection.java.patch | 139 + .../client/gui/about/Section.java.patch | 113 + .../client/gui/about/TableSection.java.patch | 120 + .../client/gui/about/TextSection.java.patch | 87 + .../gui/controls/ControlsBasicItem.java.patch | 86 + .../gui/controls/ControlsCheckBox.java.patch | 40 + .../gui/controls/ControlsModel.java.patch | 151 + .../gui/controls/ControlsSearch.java.patch | 41 + .../controls/DeleteControlButton.java.patch | 43 + .../gui/controls/GuiCommandsSlot.java.patch | 90 + .../gui/controls/GuiControls.java.patch | 256 + .../gui/controls/GuiEditShortcut.java.patch | 259 + .../gui/controls/KeyBindingItem.java.patch | 99 + .../controls/ShortcutBindingItem.java.patch | 98 + .../controls/SpoutcraftBindingItem.java.patch | 109 + .../controls/VanillaBindingItem.java.patch | 110 + .../gui/database/AbstractAPIModel.java.patch | 242 + .../gui/database/FilterButton.java.patch | 62 + .../gui/database/GuiAPIDisplay.java.patch | 29 + .../gui/database/RandomButton.java.patch | 46 + .../gui/database/SearchField.java.patch | 54 + .../client/gui/database/SortButton.java.patch | 126 + .../client/gui/database/UrlElement.java.patch | 43 + .../gui/error/GuiConnectionLost.java.patch | 146 + .../gui/error/GuiUnexpectedError.java.patch | 217 + .../client/gui/error/PasteBinAPI.java.patch | 114 + .../inventory/CreativeTabCustom.java.patch | 64 + .../client/gui/mainmenu/MainMenu.java.patch | 439 + .../gui/minimap/BackgroundCheckBox.java.patch | 38 + .../client/gui/minimap/BlockColor.java.patch | 493 + .../minimap/ColorToggleCheckBox.java.patch | 38 + .../minimap/CoordsToggleCheckBox.java.patch | 48 + .../minimap/DeathpointsCheckBox.java.patch | 38 + .../DirectionsToggleCheckBox.java.patch | 38 + .../EntityVisibilityCheckbox.java.patch | 51 + .../gui/minimap/GuiAddWaypoint.java.patch | 154 + .../GuiAdvancedEntitySettings.java.patch | 111 + .../gui/minimap/GuiMinimapMenu.java.patch | 249 + .../gui/minimap/GuiMoveMinimap.java.patch | 143 + .../gui/minimap/GuiOverviewMap.java.patch | 326 + .../gui/minimap/HeightMapCheckBox.java.patch | 38 + .../gui/minimap/ImageManager.java.patch | 85 + .../client/gui/minimap/Map.java.patch | 211 + .../gui/minimap/MapCalculator.java.patch | 472 + .../client/gui/minimap/MapRenderer.java.patch | 580 + .../client/gui/minimap/MapWidget.java.patch | 481 + .../gui/minimap/MapWidgetRenderer.java.patch | 57 + .../gui/minimap/MinimapConfig.java.patch | 441 + .../gui/minimap/MinimapModeButton.java.patch | 71 + .../minimap/MinimapToggleCheckBox.java.patch | 38 + .../gui/minimap/MinimapUtils.java.patch | 43 + .../client/gui/minimap/ResetButton.java.patch | 44 + .../minimap/ScaleToggleCheckBox.java.patch | 38 + .../gui/minimap/ScanRadiusSlider.java.patch | 65 + .../minimap/ShowEntitiesCheckbox.java.patch | 40 + .../minimap/SquareToggleCheckBox.java.patch | 40 + .../gui/minimap/TextureManager.java.patch | 102 + .../client/gui/minimap/TintType.java.patch | 45 + .../gui/minimap/WatchedEntity.java.patch | 101 + .../client/gui/minimap/Waypoint.java.patch | 48 + .../client/gui/minimap/ZanMinimap.java.patch | 106 + .../gui/minimap/ZoomModeButton.java.patch | 45 + .../gui/precache/GuiPrecache.java.patch | 105 + .../gui/server/AccessTypeFilter.java.patch | 68 + .../gui/server/CountryButton.java.patch | 63 + .../server/DeleteFavoriteButton.java.patch | 39 + .../gui/server/FavoritesModel.java.patch | 243 + .../gui/server/GuiAddFavorite.java.patch | 197 + .../client/gui/server/GuiFavorites.java.patch | 319 + .../gui/server/GuiServerInfo.java.patch | 538 + .../gui/server/GuiServerList.java.patch | 317 + .../gui/server/GuiStaticServerList.java.patch | 304 + .../client/gui/server/LANModel.java.patch | 59 + .../MinecraftServiceListener.java.patch | 68 + .../client/gui/server/PollResult.java.patch | 278 + .../gui/server/ServerDataBaseEntry.java.patch | 31 + .../client/gui/server/ServerItem.java.patch | 433 + .../gui/server/ServerListInfo.java.patch | 39 + .../gui/server/ServerListModel.java.patch | 158 + .../gui/server/ServerManager.java.patch | 104 + .../client/gui/server/ServerModel.java.patch | 89 + .../client/gui/server/ServerSlot.java.patch | 60 + .../client/gui/server/ServerTab.java.patch | 39 + .../gui/server/SpoutServerData.java.patch | 76 + .../gui/server/StaticServerModel.java.patch | 193 + .../settings/GuiAdvancedOptions.java.patch | 658 + .../gui/settings/GuiSimpleOptions.java.patch | 243 + .../controls/AdvancedOpenGLButton.java.patch | 54 + .../AmbientOcclusionButton.java.patch | 46 + .../controls/Anaglyph3DButton.java.patch | 43 + .../controls/AntiAliasingButton.java.patch | 44 + .../controls/AutomatedButton.java.patch | 41 + .../controls/AutomatedCheckBox.java.patch | 41 + .../controls/AutosaveButton.java.patch | 71 + .../controls/BetterGrassButton.java.patch | 65 + .../controls/BiomeColorsButton.java.patch | 50 + .../controls/BrightnessSlider.java.patch | 53 + .../settings/controls/ChatButton.java.patch | 44 + .../controls/ChatColorAssistButton.java.patch | 40 + .../controls/ChunkRenderSpeed.java.patch | 53 + .../ClearWaterToggleButton.java.patch | 59 + .../ConnectedTexturesButton.java.patch | 53 + .../controls/ControlsButton.java.patch | 43 + .../DelayedTooltipCheckbox.java.patch | 40 + .../controls/DifficultyButton.java.patch | 87 + .../DisplayAnimalHeatinColorButton.java.patch | 41 + .../DisplayCustomParticlesButton.java.patch | 41 + ...DisplayEntityNamesinRangeButton.java.patch | 41 + ...splayPlayerNames3rdPersonButton.java.patch | 41 + .../controls/FancyCloudsButton.java.patch | 44 + .../controls/FancyFogButton.java.patch | 44 + .../controls/FancyGraphicsButton.java.patch | 69 + .../controls/FancyGrassButton.java.patch | 50 + .../controls/FancyItemsButton.java.patch | 44 + .../controls/FancyLightingButton.java.patch | 50 + .../controls/FancyParticlesButton.java.patch | 44 + .../controls/FancyTreesButton.java.patch | 50 + .../controls/FancyWaterButton.java.patch | 44 + .../controls/FancyWeatherButton.java.patch | 44 + .../controls/FarViewButton.java.patch | 45 + .../controls/FastDebugInfoButton.java.patch | 51 + .../controls/FavorAppearanceButton.java.patch | 44 + .../FavorPerformanceButton.java.patch | 44 + .../controls/FieldOfViewSlider.java.patch | 52 + .../controls/FlightSpeedSlider.java.patch | 52 + .../controls/GuiScaleButton.java.patch | 66 + .../controls/HotbarQuickKeysButton.java.patch | 40 + .../controls/HotbarTextButton.java.patch | 40 + .../controls/InvertMouseButton.java.patch | 41 + .../controls/LanguagesButton.java.patch | 44 + .../controls/ManualSelectionButton.java.patch | 53 + .../controls/MinimapButton.java.patch | 43 + .../settings/controls/MipMapSlider.java.patch | 50 + .../settings/controls/MusicSlider.java.patch | 46 + .../controls/OptimalGameplayButton.java.patch | 44 + .../OptimizedLightingUpdatesButton.java.patch | 41 + .../controls/PerformanceButton.java.patch | 55 + .../RandomMobTextureButton.java.patch | 48 + .../controls/RenderDistanceButton.java.patch | 58 + .../controls/ReplaceBlocksButton.java.patch | 40 + .../controls/ReplaceToolsButton.java.patch | 40 + .../settings/controls/ResetButton.java.patch | 48 + .../controls/SensitivitySlider.java.patch | 45 + .../controls/ServerLightButton.java.patch | 49 + .../controls/ServerTexturesButton.java.patch | 40 + .../controls/SignDistanceButton.java.patch | 48 + .../controls/SkyToggleButton.java.patch | 42 + .../controls/SmoothFPSButton.java.patch | 39 + .../controls/SmoothLightingSlider.java.patch | 50 + .../controls/SnooperButton.java.patch | 44 + .../controls/SoundEffectsSlider.java.patch | 46 + .../controls/StarsToggleButton.java.patch | 42 + .../controls/TexturesButton.java.patch | 45 + .../settings/controls/TimeButton.java.patch | 61 + .../controls/ViewBobbingButton.java.patch | 43 + .../controls/VoidFogButton.java.patch | 51 + .../WaterBiomeColorsButton.java.patch | 46 + .../controls/WeatherToggleButton.java.patch | 50 + .../inventory/CraftInventory.java.patch | 379 + .../inventory/CraftInventoryPlayer.java.patch | 111 + .../inventory/CraftItemStack.java.patch | 148 + .../client/inventory/InventoryUtil.java.patch | 79 + .../client/inventory/ItemData.java.patch | 72 + .../SimpleMaterialManager.java.patch | 306 + .../inventory/SimpleShapedRecipe.java.patch | 78 + .../SimpleShapelessRecipe.java.patch | 64 + .../inventory/SpoutcraftRecipe.java.patch | 29 + .../client/io/CRCManager.java.patch | 45 + .../client/io/CustomTextureManager.java.patch | 258 + .../spoutcraft/client/io/Download.java.patch | 88 + .../client/io/DownloadAssets.java.patch | 161 + .../client/io/FileDownloadThread.java.patch | 172 + .../spoutcraft/client/io/FileMap.java.patch | 226 + .../spoutcraft/client/io/FileUtil.java.patch | 290 + .../client/item/SpoutItem.java.patch | 152 + .../packet/CompressablePacket.java.patch | 31 + .../client/packet/CustomPacket.java.patch | 169 + .../client/packet/PacketAirTime.java.patch | 68 + .../client/packet/PacketAlert.java.patch | 71 + .../packet/PacketAllowVisualCheats.java.patch | 135 + .../packet/PacketBiomeWeather.java.patch | 112 + .../client/packet/PacketBlockData.java.patch | 139 + .../packet/PacketCacheDeleteFile.java.patch | 69 + .../client/packet/PacketCacheFile.java.patch | 163 + .../packet/PacketChunkRefresh.java.patch | 69 + .../packet/PacketClipboardText.java.patch | 63 + .../client/packet/PacketComboBox.java.patch | 86 + .../packet/PacketControlAction.java.patch | 88 + .../PacketCustomBlockChunkOverride.java.patch | 213 + .../packet/PacketCustomBlockDesign.java.patch | 72 + .../PacketCustomBlockOverride.java.patch | 105 + .../PacketCustomMultiBlockOverride.java.patch | 140 + .../packet/PacketDownloadMusic.java.patch | 106 + .../packet/PacketEntityInformation.java.patch | 158 + .../client/packet/PacketEntitySkin.java.patch | 70 + .../packet/PacketEntityTitle.java.patch | 91 + .../packet/PacketFocusUpdate.java.patch | 80 + .../packet/PacketFullVersion.java.patch | 60 + .../packet/PacketGenericBlock.java.patch | 58 + .../packet/PacketGenericFood.java.patch | 55 + .../packet/PacketGenericItem.java.patch | 55 + .../packet/PacketGenericTool.java.patch | 55 + .../client/packet/PacketItemName.java.patch | 86 + .../client/packet/PacketKeyBinding.java.patch | 80 + .../client/packet/PacketKeyPress.java.patch | 107 + .../client/packet/PacketManager.java.patch | 82 + .../packet/PacketMovementModifiers.java.patch | 84 + .../packet/PacketMusicChange.java.patch | 78 + .../packet/PacketNotification.java.patch | 66 + .../client/packet/PacketOpenScreen.java.patch | 59 + .../packet/PacketOpenSignGUI.java.patch | 75 + .../client/packet/PacketParticle.java.patch | 107 + .../packet/PacketPermissionUpdate.java.patch | 83 + .../client/packet/PacketPlaySound.java.patch | 106 + .../packet/PacketPreCacheCompleted.java.patch | 78 + .../packet/PacketPreCacheFile.java.patch | 128 + .../packet/PacketRenderDistance.java.patch | 94 + .../packet/PacketRequestPrecache.java.patch | 72 + .../packet/PacketScreenAction.java.patch | 82 + .../client/packet/PacketScreenshot.java.patch | 104 + .../client/packet/PacketSendLink.java.patch | 80 + .../packet/PacketSendPrecache.java.patch | 154 + .../packet/PacketSetVelocity.java.patch | 86 + .../client/packet/PacketSkinURL.java.patch | 117 + .../client/packet/PacketSky.java.patch | 143 + .../client/packet/PacketSlotClick.java.patch | 81 + .../packet/PacketSpawnTextEntity.java.patch | 95 + .../client/packet/PacketStopMusic.java.patch | 77 + .../client/packet/PacketType.java.patch | 121 + .../packet/PacketValidatePrecache.java.patch | 84 + .../client/packet/PacketWaypoint.java.patch | 77 + .../client/packet/PacketWidget.java.patch | 204 + .../packet/PacketWidgetRemove.java.patch | 83 + .../client/packet/ScreenAction.java.patch | 48 + .../client/packet/SpoutPacket.java.patch | 74 + .../client/player/ClientPlayer.java.patch | 257 + .../player/SimpleBiomeManager.java.patch | 101 + .../client/player/SimpleSkyManager.java.patch | 191 + .../client/player/SpoutPlayer.java.patch | 55 + .../player/accessories/Accessory.java.patch | 47 + .../accessories/AccessoryHandler.java.patch | 199 + .../accessories/AccessoryType.java.patch | 57 + .../player/accessories/Bracelet.java.patch | 77 + .../client/player/accessories/Ears.java.patch | 51 + .../player/accessories/NotchHat.java.patch | 59 + .../accessories/PacketAccessory.java.patch | 88 + .../player/accessories/Sunglasses.java.patch | 85 + .../client/player/accessories/Tail.java.patch | 81 + .../player/accessories/TopHat.java.patch | 59 + .../player/accessories/Wings.java.patch | 193 + .../pluginloader/ClassLoader.java.patch | 44 + .../precache/PrecacheManager.java.patch | 308 + .../client/precache/PrecacheTuple.java.patch | 65 + .../client/sound/QueuedSound.java.patch | 74 + .../special/BaseYAMLResource.java.patch | 50 + .../client/special/Holiday.java.patch | 65 + .../client/special/Resources.java.patch | 125 + .../spoutcraft/client/special/VIP.java.patch | 98 + .../client/special/YAMLResource.java.patch | 30 + .../client/spoutworth/SpoutWorth.java.patch | 381 + .../client/util/CacheMap.java.patch | 99 + .../client/util/MapEntry.java.patch | 49 + .../client/util/NetworkUtils.java.patch | 166 + .../client/util/PersistentMap.java.patch | 121 + .../util/UniqueItemStringMap.java.patch | 160 + 2131 files changed, 326001 insertions(+), 323820 deletions(-) delete mode 100644 client.patch create mode 100644 patch-index.json create mode 100644 patch-reformatter.py create mode 100644 patches/Start.java.patch create mode 100644 patches/com/prupe/mcpatcher/BlendMethod.java.patch create mode 100644 patches/com/prupe/mcpatcher/Config$FileEntry.java.patch create mode 100644 patches/com/prupe/mcpatcher/Config$ModEntry.java.patch create mode 100644 patches/com/prupe/mcpatcher/Config$ProfileEntry.java.patch create mode 100644 patches/com/prupe/mcpatcher/Config$VersionEntry.java.patch create mode 100644 patches/com/prupe/mcpatcher/Config.java.patch create mode 100644 patches/com/prupe/mcpatcher/InputHandler.java.patch create mode 100644 patches/com/prupe/mcpatcher/JsonUtils.java.patch create mode 100644 patches/com/prupe/mcpatcher/MCLogger$1$1.java.patch create mode 100644 patches/com/prupe/mcpatcher/MCLogger$1.java.patch create mode 100644 patches/com/prupe/mcpatcher/MCLogger$ErrorLevel.java.patch create mode 100644 patches/com/prupe/mcpatcher/MCLogger.java.patch create mode 100644 patches/com/prupe/mcpatcher/MCPatcherUtils.java.patch create mode 100644 patches/com/prupe/mcpatcher/ProfilerAPI.java.patch create mode 100644 patches/com/prupe/mcpatcher/TessellatorUtils.java.patch create mode 100644 patches/com/prupe/mcpatcher/TexturePackAPI$1.java.patch create mode 100644 patches/com/prupe/mcpatcher/TexturePackAPI$2.java.patch create mode 100644 patches/com/prupe/mcpatcher/TexturePackAPI.java.patch create mode 100644 patches/com/prupe/mcpatcher/TexturePackChangeHandler$1.java.patch create mode 100644 patches/com/prupe/mcpatcher/TexturePackChangeHandler.java.patch create mode 100644 patches/com/prupe/mcpatcher/TileLoader$1.java.patch create mode 100644 patches/com/prupe/mcpatcher/TileLoader.java.patch create mode 100644 patches/com/prupe/mcpatcher/WeightedIndex$1.java.patch create mode 100644 patches/com/prupe/mcpatcher/WeightedIndex$2.java.patch create mode 100644 patches/com/prupe/mcpatcher/WeightedIndex.java.patch create mode 100644 patches/com/prupe/mcpatcher/cc/BiomeHelper.java.patch create mode 100644 patches/com/prupe/mcpatcher/cc/ColorMap.java.patch create mode 100644 patches/com/prupe/mcpatcher/cc/ColorizeBlock.java.patch create mode 100644 patches/com/prupe/mcpatcher/cc/ColorizeEntity.java.patch create mode 100644 patches/com/prupe/mcpatcher/cc/ColorizeItem.java.patch create mode 100644 patches/com/prupe/mcpatcher/cc/ColorizeWorld.java.patch create mode 100644 patches/com/prupe/mcpatcher/cc/Colorizer$1.java.patch create mode 100644 patches/com/prupe/mcpatcher/cc/Colorizer.java.patch create mode 100644 patches/com/prupe/mcpatcher/cc/Lightmap.java.patch create mode 100644 patches/com/prupe/mcpatcher/ctm/CTMUtils$1.java.patch create mode 100644 patches/com/prupe/mcpatcher/ctm/CTMUtils$2.java.patch create mode 100644 patches/com/prupe/mcpatcher/ctm/CTMUtils$3.java.patch create mode 100644 patches/com/prupe/mcpatcher/ctm/CTMUtils$TileOverrideIterator.java.patch create mode 100644 patches/com/prupe/mcpatcher/ctm/CTMUtils.java.patch create mode 100644 patches/com/prupe/mcpatcher/ctm/GlassPaneRenderer.java.patch create mode 100644 patches/com/prupe/mcpatcher/ctm/ITileOverride.java.patch create mode 100644 patches/com/prupe/mcpatcher/ctm/RenderPass$1.java.patch create mode 100644 patches/com/prupe/mcpatcher/ctm/RenderPass$2.java.patch create mode 100644 patches/com/prupe/mcpatcher/ctm/RenderPass.java.patch create mode 100644 patches/com/prupe/mcpatcher/ctm/RenderPassAPI.java.patch create mode 100644 patches/com/prupe/mcpatcher/ctm/TileOverride.java.patch create mode 100644 patches/com/prupe/mcpatcher/ctm/TileOverrideImpl$BetterGrass.java.patch create mode 100644 patches/com/prupe/mcpatcher/ctm/TileOverrideImpl$CTM.java.patch create mode 100644 patches/com/prupe/mcpatcher/ctm/TileOverrideImpl$Fixed.java.patch create mode 100644 patches/com/prupe/mcpatcher/ctm/TileOverrideImpl$Horizontal.java.patch create mode 100644 patches/com/prupe/mcpatcher/ctm/TileOverrideImpl$HorizontalVertical.java.patch create mode 100644 patches/com/prupe/mcpatcher/ctm/TileOverrideImpl$Random1.java.patch create mode 100644 patches/com/prupe/mcpatcher/ctm/TileOverrideImpl$Repeat.java.patch create mode 100644 patches/com/prupe/mcpatcher/ctm/TileOverrideImpl$Top.java.patch create mode 100644 patches/com/prupe/mcpatcher/ctm/TileOverrideImpl$Vertical.java.patch create mode 100644 patches/com/prupe/mcpatcher/ctm/TileOverrideImpl$VerticalHorizontal.java.patch create mode 100644 patches/com/prupe/mcpatcher/ctm/TileOverrideImpl.java.patch create mode 100644 patches/com/prupe/mcpatcher/hd/AAHelper.java.patch create mode 100644 patches/com/prupe/mcpatcher/hd/BorderedTexture.java.patch create mode 100644 patches/com/prupe/mcpatcher/hd/CustomAnimation$1.java.patch create mode 100644 patches/com/prupe/mcpatcher/hd/CustomAnimation.java.patch create mode 100644 patches/com/prupe/mcpatcher/hd/FancyDial$Layer.java.patch create mode 100644 patches/com/prupe/mcpatcher/hd/FancyDial.java.patch create mode 100644 patches/com/prupe/mcpatcher/hd/FontUtils$1.java.patch create mode 100644 patches/com/prupe/mcpatcher/hd/FontUtils.java.patch create mode 100644 patches/com/prupe/mcpatcher/hd/MipmapHelper.java.patch create mode 100644 patches/com/prupe/mcpatcher/mob/LineRenderer.java.patch create mode 100644 patches/com/prupe/mcpatcher/mob/MobOverlay.java.patch create mode 100644 patches/com/prupe/mcpatcher/mob/MobRandomizer$1.java.patch create mode 100644 patches/com/prupe/mcpatcher/mob/MobRandomizer$ExtraInfo.java.patch create mode 100644 patches/com/prupe/mcpatcher/mob/MobRandomizer.java.patch create mode 100644 patches/com/prupe/mcpatcher/mob/MobRuleList$MobRuleEntry.java.patch create mode 100644 patches/com/prupe/mcpatcher/mob/MobRuleList.java.patch create mode 100644 patches/com/prupe/mcpatcher/sky/FireworksHelper.java.patch create mode 100644 patches/com/prupe/mcpatcher/sky/SkyRenderer$1.java.patch create mode 100644 patches/com/prupe/mcpatcher/sky/SkyRenderer$Layer.java.patch create mode 100644 patches/com/prupe/mcpatcher/sky/SkyRenderer$WorldEntry.java.patch create mode 100644 patches/com/prupe/mcpatcher/sky/SkyRenderer.java.patch create mode 100644 patches/net/minecraft/client/ClientBrandRetriever.java.patch create mode 100644 patches/net/minecraft/client/main/Main.java.patch create mode 100644 patches/net/minecraft/server/MinecraftServer.java.patch create mode 100644 patches/net/minecraft/src/AABBPool.java.patch create mode 100644 patches/net/minecraft/src/AbstractClientPlayer.java.patch create mode 100644 patches/net/minecraft/src/AbstractResourcePack.java.patch create mode 100644 patches/net/minecraft/src/AbstractTexture.java.patch create mode 100644 patches/net/minecraft/src/Achievement.java.patch create mode 100644 patches/net/minecraft/src/AchievementList.java.patch create mode 100644 patches/net/minecraft/src/AchievementMap.java.patch create mode 100644 patches/net/minecraft/src/ActiveRenderInfo.java.patch create mode 100644 patches/net/minecraft/src/AnimalChest.java.patch create mode 100644 patches/net/minecraft/src/AnimationFrame.java.patch create mode 100644 patches/net/minecraft/src/AnimationMetadataSection.java.patch create mode 100644 patches/net/minecraft/src/AnimationMetadataSectionSerializer.java.patch create mode 100644 patches/net/minecraft/src/AnvilChunkLoader.java.patch create mode 100644 patches/net/minecraft/src/AnvilChunkLoaderPending.java.patch create mode 100644 patches/net/minecraft/src/AnvilConverterData.java.patch create mode 100644 patches/net/minecraft/src/AnvilConverterException.java.patch create mode 100644 patches/net/minecraft/src/AnvilSaveConverter.java.patch create mode 100644 patches/net/minecraft/src/AnvilSaveConverterFileFilter.java.patch create mode 100644 patches/net/minecraft/src/AnvilSaveHandler.java.patch create mode 100644 patches/net/minecraft/src/AttributeInstance.java.patch create mode 100644 patches/net/minecraft/src/AttributeModifier.java.patch create mode 100644 patches/net/minecraft/src/AxisAlignedBB.java.patch create mode 100644 patches/net/minecraft/src/Backup.java.patch create mode 100644 patches/net/minecraft/src/BackupList.java.patch create mode 100644 patches/net/minecraft/src/BanEntry.java.patch create mode 100644 patches/net/minecraft/src/BanList.java.patch create mode 100644 patches/net/minecraft/src/BaseAttribute.java.patch create mode 100644 patches/net/minecraft/src/BaseAttributeMap.java.patch create mode 100644 patches/net/minecraft/src/BaseMetadataSectionSerializer.java.patch create mode 100644 patches/net/minecraft/src/BehaviorDefaultDispenseItem.java.patch create mode 100644 patches/net/minecraft/src/BehaviorDispenseArmor.java.patch create mode 100644 patches/net/minecraft/src/BehaviorDispenseItemProvider.java.patch create mode 100644 patches/net/minecraft/src/BehaviorDispenseMinecart.java.patch create mode 100644 patches/net/minecraft/src/BehaviorProjectileDispense.java.patch create mode 100644 patches/net/minecraft/src/BiomeCache.java.patch create mode 100644 patches/net/minecraft/src/BiomeCacheBlock.java.patch create mode 100644 patches/net/minecraft/src/BiomeDecorator.java.patch create mode 100644 patches/net/minecraft/src/BiomeEndDecorator.java.patch create mode 100644 patches/net/minecraft/src/BiomeGenBase.java.patch create mode 100644 patches/net/minecraft/src/BiomeGenBeach.java.patch create mode 100644 patches/net/minecraft/src/BiomeGenDesert.java.patch create mode 100644 patches/net/minecraft/src/BiomeGenEnd.java.patch create mode 100644 patches/net/minecraft/src/BiomeGenForest.java.patch create mode 100644 patches/net/minecraft/src/BiomeGenHell.java.patch create mode 100644 patches/net/minecraft/src/BiomeGenHills.java.patch create mode 100644 patches/net/minecraft/src/BiomeGenJungle.java.patch create mode 100644 patches/net/minecraft/src/BiomeGenMushroomIsland.java.patch create mode 100644 patches/net/minecraft/src/BiomeGenOcean.java.patch create mode 100644 patches/net/minecraft/src/BiomeGenPlains.java.patch create mode 100644 patches/net/minecraft/src/BiomeGenRiver.java.patch create mode 100644 patches/net/minecraft/src/BiomeGenSnow.java.patch create mode 100644 patches/net/minecraft/src/BiomeGenSwamp.java.patch create mode 100644 patches/net/minecraft/src/BiomeGenTaiga.java.patch create mode 100644 patches/net/minecraft/src/Block.java.patch create mode 100644 patches/net/minecraft/src/BlockAnvil.java.patch create mode 100644 patches/net/minecraft/src/BlockBasePressurePlate.java.patch create mode 100644 patches/net/minecraft/src/BlockBaseRailLogic.java.patch create mode 100644 patches/net/minecraft/src/BlockBeacon.java.patch create mode 100644 patches/net/minecraft/src/BlockBed.java.patch create mode 100644 patches/net/minecraft/src/BlockBookshelf.java.patch create mode 100644 patches/net/minecraft/src/BlockBreakable.java.patch create mode 100644 patches/net/minecraft/src/BlockBrewingStand.java.patch create mode 100644 patches/net/minecraft/src/BlockButton.java.patch create mode 100644 patches/net/minecraft/src/BlockButtonStone.java.patch create mode 100644 patches/net/minecraft/src/BlockButtonWood.java.patch create mode 100644 patches/net/minecraft/src/BlockCactus.java.patch create mode 100644 patches/net/minecraft/src/BlockCake.java.patch create mode 100644 patches/net/minecraft/src/BlockCarpet.java.patch create mode 100644 patches/net/minecraft/src/BlockCarrot.java.patch create mode 100644 patches/net/minecraft/src/BlockCauldron.java.patch create mode 100644 patches/net/minecraft/src/BlockChest.java.patch create mode 100644 patches/net/minecraft/src/BlockClay.java.patch create mode 100644 patches/net/minecraft/src/BlockCocoa.java.patch create mode 100644 patches/net/minecraft/src/BlockColored.java.patch create mode 100644 patches/net/minecraft/src/BlockCommandBlock.java.patch create mode 100644 patches/net/minecraft/src/BlockComparator.java.patch create mode 100644 patches/net/minecraft/src/BlockContainer.java.patch create mode 100644 patches/net/minecraft/src/BlockCrops.java.patch create mode 100644 patches/net/minecraft/src/BlockDaylightDetector.java.patch create mode 100644 patches/net/minecraft/src/BlockDeadBush.java.patch create mode 100644 patches/net/minecraft/src/BlockDetectorRail.java.patch create mode 100644 patches/net/minecraft/src/BlockDirectional.java.patch create mode 100644 patches/net/minecraft/src/BlockDirt.java.patch create mode 100644 patches/net/minecraft/src/BlockDispenser.java.patch create mode 100644 patches/net/minecraft/src/BlockDoor.java.patch create mode 100644 patches/net/minecraft/src/BlockDragonEgg.java.patch create mode 100644 patches/net/minecraft/src/BlockDropper.java.patch create mode 100644 patches/net/minecraft/src/BlockEnchantmentTable.java.patch create mode 100644 patches/net/minecraft/src/BlockEndPortal.java.patch create mode 100644 patches/net/minecraft/src/BlockEndPortalFrame.java.patch create mode 100644 patches/net/minecraft/src/BlockEnderChest.java.patch create mode 100644 patches/net/minecraft/src/BlockEventData.java.patch create mode 100644 patches/net/minecraft/src/BlockFarmland.java.patch create mode 100644 patches/net/minecraft/src/BlockFence.java.patch create mode 100644 patches/net/minecraft/src/BlockFenceGate.java.patch create mode 100644 patches/net/minecraft/src/BlockFire.java.patch create mode 100644 patches/net/minecraft/src/BlockFlower.java.patch create mode 100644 patches/net/minecraft/src/BlockFlowerPot.java.patch create mode 100644 patches/net/minecraft/src/BlockFlowing.java.patch create mode 100644 patches/net/minecraft/src/BlockFluid.java.patch create mode 100644 patches/net/minecraft/src/BlockFurnace.java.patch create mode 100644 patches/net/minecraft/src/BlockGlass.java.patch create mode 100644 patches/net/minecraft/src/BlockGlowStone.java.patch create mode 100644 patches/net/minecraft/src/BlockGrass.java.patch create mode 100644 patches/net/minecraft/src/BlockGravel.java.patch create mode 100644 patches/net/minecraft/src/BlockHalfSlab.java.patch create mode 100644 patches/net/minecraft/src/BlockHay.java.patch create mode 100644 patches/net/minecraft/src/BlockHopper.java.patch create mode 100644 patches/net/minecraft/src/BlockIce.java.patch create mode 100644 patches/net/minecraft/src/BlockJukeBox.java.patch create mode 100644 patches/net/minecraft/src/BlockLadder.java.patch create mode 100644 patches/net/minecraft/src/BlockLeaves.java.patch create mode 100644 patches/net/minecraft/src/BlockLeavesBase.java.patch create mode 100644 patches/net/minecraft/src/BlockLever.java.patch create mode 100644 patches/net/minecraft/src/BlockLilyPad.java.patch create mode 100644 patches/net/minecraft/src/BlockLockedChest.java.patch create mode 100644 patches/net/minecraft/src/BlockLog.java.patch create mode 100644 patches/net/minecraft/src/BlockMelon.java.patch create mode 100644 patches/net/minecraft/src/BlockMobSpawner.java.patch create mode 100644 patches/net/minecraft/src/BlockMushroom.java.patch create mode 100644 patches/net/minecraft/src/BlockMushroomCap.java.patch create mode 100644 patches/net/minecraft/src/BlockMycelium.java.patch create mode 100644 patches/net/minecraft/src/BlockNetherStalk.java.patch create mode 100644 patches/net/minecraft/src/BlockNetherrack.java.patch create mode 100644 patches/net/minecraft/src/BlockNote.java.patch create mode 100644 patches/net/minecraft/src/BlockObsidian.java.patch create mode 100644 patches/net/minecraft/src/BlockOre.java.patch create mode 100644 patches/net/minecraft/src/BlockOreStorage.java.patch create mode 100644 patches/net/minecraft/src/BlockPane.java.patch create mode 100644 patches/net/minecraft/src/BlockPistonBase.java.patch create mode 100644 patches/net/minecraft/src/BlockPistonExtension.java.patch create mode 100644 patches/net/minecraft/src/BlockPistonMoving.java.patch create mode 100644 patches/net/minecraft/src/BlockPortal.java.patch create mode 100644 patches/net/minecraft/src/BlockPotato.java.patch create mode 100644 patches/net/minecraft/src/BlockPoweredOre.java.patch create mode 100644 patches/net/minecraft/src/BlockPressurePlate.java.patch create mode 100644 patches/net/minecraft/src/BlockPressurePlateWeighted.java.patch create mode 100644 patches/net/minecraft/src/BlockPumpkin.java.patch create mode 100644 patches/net/minecraft/src/BlockQuartz.java.patch create mode 100644 patches/net/minecraft/src/BlockRail.java.patch create mode 100644 patches/net/minecraft/src/BlockRailBase.java.patch create mode 100644 patches/net/minecraft/src/BlockRailPowered.java.patch create mode 100644 patches/net/minecraft/src/BlockRedstoneLight.java.patch create mode 100644 patches/net/minecraft/src/BlockRedstoneLogic.java.patch create mode 100644 patches/net/minecraft/src/BlockRedstoneOre.java.patch create mode 100644 patches/net/minecraft/src/BlockRedstoneRepeater.java.patch create mode 100644 patches/net/minecraft/src/BlockRedstoneTorch.java.patch create mode 100644 patches/net/minecraft/src/BlockRedstoneWire.java.patch create mode 100644 patches/net/minecraft/src/BlockReed.java.patch create mode 100644 patches/net/minecraft/src/BlockRotatedPillar.java.patch create mode 100644 patches/net/minecraft/src/BlockSand.java.patch create mode 100644 patches/net/minecraft/src/BlockSandStone.java.patch create mode 100644 patches/net/minecraft/src/BlockSapling.java.patch create mode 100644 patches/net/minecraft/src/BlockSign.java.patch create mode 100644 patches/net/minecraft/src/BlockSilverfish.java.patch create mode 100644 patches/net/minecraft/src/BlockSkull.java.patch create mode 100644 patches/net/minecraft/src/BlockSnow.java.patch create mode 100644 patches/net/minecraft/src/BlockSnowBlock.java.patch create mode 100644 patches/net/minecraft/src/BlockSoulSand.java.patch create mode 100644 patches/net/minecraft/src/BlockSourceImpl.java.patch create mode 100644 patches/net/minecraft/src/BlockSponge.java.patch create mode 100644 patches/net/minecraft/src/BlockStairs.java.patch create mode 100644 patches/net/minecraft/src/BlockStationary.java.patch create mode 100644 patches/net/minecraft/src/BlockStem.java.patch create mode 100644 patches/net/minecraft/src/BlockStep.java.patch create mode 100644 patches/net/minecraft/src/BlockStone.java.patch create mode 100644 patches/net/minecraft/src/BlockStoneBrick.java.patch create mode 100644 patches/net/minecraft/src/BlockTNT.java.patch create mode 100644 patches/net/minecraft/src/BlockTallGrass.java.patch create mode 100644 patches/net/minecraft/src/BlockTorch.java.patch create mode 100644 patches/net/minecraft/src/BlockTrapDoor.java.patch create mode 100644 patches/net/minecraft/src/BlockTripWire.java.patch create mode 100644 patches/net/minecraft/src/BlockTripWireSource.java.patch create mode 100644 patches/net/minecraft/src/BlockVine.java.patch create mode 100644 patches/net/minecraft/src/BlockWall.java.patch create mode 100644 patches/net/minecraft/src/BlockWeb.java.patch create mode 100644 patches/net/minecraft/src/BlockWood.java.patch create mode 100644 patches/net/minecraft/src/BlockWoodSlab.java.patch create mode 100644 patches/net/minecraft/src/BlockWorkbench.java.patch create mode 100644 patches/net/minecraft/src/BossStatus.java.patch create mode 100644 patches/net/minecraft/src/CallableBlockDataValue.java.patch create mode 100644 patches/net/minecraft/src/CallableBlockLocation.java.patch create mode 100644 patches/net/minecraft/src/CallableBlockType.java.patch create mode 100644 patches/net/minecraft/src/CallableChunkPosHash.java.patch create mode 100644 patches/net/minecraft/src/CallableClientMemoryStats.java.patch create mode 100644 patches/net/minecraft/src/CallableClientProfiler.java.patch create mode 100644 patches/net/minecraft/src/CallableConnectionName.java.patch create mode 100644 patches/net/minecraft/src/CallableCrashMemoryReport.java.patch create mode 100644 patches/net/minecraft/src/CallableEntityName.java.patch create mode 100644 patches/net/minecraft/src/CallableEntityTracker.java.patch create mode 100644 patches/net/minecraft/src/CallableEntityType.java.patch create mode 100644 patches/net/minecraft/src/CallableGLInfo.java.patch create mode 100644 patches/net/minecraft/src/CallableIntCache.java.patch create mode 100644 patches/net/minecraft/src/CallableIsFeatureChunk.java.patch create mode 100644 patches/net/minecraft/src/CallableIsModded.java.patch create mode 100644 patches/net/minecraft/src/CallableIsServerModded.java.patch create mode 100644 patches/net/minecraft/src/CallableItemName.java.patch create mode 100644 patches/net/minecraft/src/CallableJVMFlags.java.patch create mode 100644 patches/net/minecraft/src/CallableJavaInfo.java.patch create mode 100644 patches/net/minecraft/src/CallableJavaInfo2.java.patch create mode 100644 patches/net/minecraft/src/CallableLWJGLVersion.java.patch create mode 100644 patches/net/minecraft/src/CallableLaunchedVersion.java.patch create mode 100644 patches/net/minecraft/src/CallableLevelDimension.java.patch create mode 100644 patches/net/minecraft/src/CallableLevelGamemode.java.patch create mode 100644 patches/net/minecraft/src/CallableLevelGenerator.java.patch create mode 100644 patches/net/minecraft/src/CallableLevelGeneratorOptions.java.patch create mode 100644 patches/net/minecraft/src/CallableLevelSeed.java.patch create mode 100644 patches/net/minecraft/src/CallableLevelSpawnLocation.java.patch create mode 100644 patches/net/minecraft/src/CallableLevelStorageVersion.java.patch create mode 100644 patches/net/minecraft/src/CallableLevelTime.java.patch create mode 100644 patches/net/minecraft/src/CallableLevelWeather.java.patch create mode 100644 patches/net/minecraft/src/CallableLvl1.java.patch create mode 100644 patches/net/minecraft/src/CallableLvl2.java.patch create mode 100644 patches/net/minecraft/src/CallableLvl3.java.patch create mode 100644 patches/net/minecraft/src/CallableMPL1.java.patch create mode 100644 patches/net/minecraft/src/CallableMPL2.java.patch create mode 100644 patches/net/minecraft/src/CallableMemoryInfo.java.patch create mode 100644 patches/net/minecraft/src/CallableMinecraftVersion.java.patch create mode 100644 patches/net/minecraft/src/CallableModded.java.patch create mode 100644 patches/net/minecraft/src/CallableMouseLocation.java.patch create mode 100644 patches/net/minecraft/src/CallableOSInfo.java.patch create mode 100644 patches/net/minecraft/src/CallablePacketClass.java.patch create mode 100644 patches/net/minecraft/src/CallablePacketID.java.patch create mode 100644 patches/net/minecraft/src/CallableParticlePositionInfo.java.patch create mode 100644 patches/net/minecraft/src/CallableParticleScreenName.java.patch create mode 100644 patches/net/minecraft/src/CallableScreenName.java.patch create mode 100644 patches/net/minecraft/src/CallableScreenSize.java.patch create mode 100644 patches/net/minecraft/src/CallableServerMemoryStats.java.patch create mode 100644 patches/net/minecraft/src/CallableServerProfiler.java.patch create mode 100644 patches/net/minecraft/src/CallableServerType.java.patch create mode 100644 patches/net/minecraft/src/CallableStructureType.java.patch create mode 100644 patches/net/minecraft/src/CallableSuspiciousClasses.java.patch create mode 100644 patches/net/minecraft/src/CallableTagCompound1.java.patch create mode 100644 patches/net/minecraft/src/CallableTagCompound2.java.patch create mode 100644 patches/net/minecraft/src/CallableTexturePack.java.patch create mode 100644 patches/net/minecraft/src/CallableTileEntityData.java.patch create mode 100644 patches/net/minecraft/src/CallableTileEntityID.java.patch create mode 100644 patches/net/minecraft/src/CallableTileEntityName.java.patch create mode 100644 patches/net/minecraft/src/CallableType.java.patch create mode 100644 patches/net/minecraft/src/CallableType2.java.patch create mode 100644 patches/net/minecraft/src/CallableType3.java.patch create mode 100644 patches/net/minecraft/src/CallableUpdatingScreenName.java.patch create mode 100644 patches/net/minecraft/src/ChatAllowedCharacters.java.patch create mode 100644 patches/net/minecraft/src/ChatClickData.java.patch create mode 100644 patches/net/minecraft/src/ChatLine.java.patch create mode 100644 patches/net/minecraft/src/ChatMessageComponent.java.patch create mode 100644 patches/net/minecraft/src/ChestItemRenderHelper.java.patch create mode 100644 patches/net/minecraft/src/Chunk.java.patch create mode 100644 patches/net/minecraft/src/ChunkCache.java.patch create mode 100644 patches/net/minecraft/src/ChunkCoordIntPair.java.patch create mode 100644 patches/net/minecraft/src/ChunkCoordinates.java.patch create mode 100644 patches/net/minecraft/src/ChunkLoader.java.patch create mode 100644 patches/net/minecraft/src/ChunkPosition.java.patch create mode 100644 patches/net/minecraft/src/ChunkProviderClient.java.patch create mode 100644 patches/net/minecraft/src/ChunkProviderEnd.java.patch create mode 100644 patches/net/minecraft/src/ChunkProviderFlat.java.patch create mode 100644 patches/net/minecraft/src/ChunkProviderGenerate.java.patch create mode 100644 patches/net/minecraft/src/ChunkProviderHell.java.patch create mode 100644 patches/net/minecraft/src/ChunkProviderServer.java.patch create mode 100644 patches/net/minecraft/src/ClippingHelper.java.patch create mode 100644 patches/net/minecraft/src/ClippingHelperImpl.java.patch create mode 100644 patches/net/minecraft/src/ColorizerFoliage.java.patch create mode 100644 patches/net/minecraft/src/ColorizerGrass.java.patch create mode 100644 patches/net/minecraft/src/CombatEntry.java.patch create mode 100644 patches/net/minecraft/src/CombatTracker.java.patch create mode 100644 patches/net/minecraft/src/CommandBase.java.patch create mode 100644 patches/net/minecraft/src/CommandClearInventory.java.patch create mode 100644 patches/net/minecraft/src/CommandDebug.java.patch create mode 100644 patches/net/minecraft/src/CommandDefaultGameMode.java.patch create mode 100644 patches/net/minecraft/src/CommandDifficulty.java.patch create mode 100644 patches/net/minecraft/src/CommandEffect.java.patch create mode 100644 patches/net/minecraft/src/CommandEnchant.java.patch create mode 100644 patches/net/minecraft/src/CommandException.java.patch create mode 100644 patches/net/minecraft/src/CommandGameMode.java.patch create mode 100644 patches/net/minecraft/src/CommandGameRule.java.patch create mode 100644 patches/net/minecraft/src/CommandGive.java.patch create mode 100644 patches/net/minecraft/src/CommandHandler.java.patch create mode 100644 patches/net/minecraft/src/CommandHelp.java.patch create mode 100644 patches/net/minecraft/src/CommandKill.java.patch create mode 100644 patches/net/minecraft/src/CommandNotFoundException.java.patch create mode 100644 patches/net/minecraft/src/CommandPlaySound.java.patch create mode 100644 patches/net/minecraft/src/CommandServerBan.java.patch create mode 100644 patches/net/minecraft/src/CommandServerBanIp.java.patch create mode 100644 patches/net/minecraft/src/CommandServerBanlist.java.patch create mode 100644 patches/net/minecraft/src/CommandServerDeop.java.patch create mode 100644 patches/net/minecraft/src/CommandServerEmote.java.patch create mode 100644 patches/net/minecraft/src/CommandServerKick.java.patch create mode 100644 patches/net/minecraft/src/CommandServerList.java.patch create mode 100644 patches/net/minecraft/src/CommandServerMessage.java.patch create mode 100644 patches/net/minecraft/src/CommandServerOp.java.patch create mode 100644 patches/net/minecraft/src/CommandServerPardon.java.patch create mode 100644 patches/net/minecraft/src/CommandServerPardonIp.java.patch create mode 100644 patches/net/minecraft/src/CommandServerPublishLocal.java.patch create mode 100644 patches/net/minecraft/src/CommandServerSaveAll.java.patch create mode 100644 patches/net/minecraft/src/CommandServerSaveOff.java.patch create mode 100644 patches/net/minecraft/src/CommandServerSaveOn.java.patch create mode 100644 patches/net/minecraft/src/CommandServerSay.java.patch create mode 100644 patches/net/minecraft/src/CommandServerStop.java.patch create mode 100644 patches/net/minecraft/src/CommandServerTp.java.patch create mode 100644 patches/net/minecraft/src/CommandServerWhitelist.java.patch create mode 100644 patches/net/minecraft/src/CommandSetPlayerTimeout.java.patch create mode 100644 patches/net/minecraft/src/CommandSetSpawnpoint.java.patch create mode 100644 patches/net/minecraft/src/CommandShowSeed.java.patch create mode 100644 patches/net/minecraft/src/CommandSpreadPlayers.java.patch create mode 100644 patches/net/minecraft/src/CommandSpreadPlayersPosition.java.patch create mode 100644 patches/net/minecraft/src/CommandTime.java.patch create mode 100644 patches/net/minecraft/src/CommandToggleDownfall.java.patch create mode 100644 patches/net/minecraft/src/CommandWeather.java.patch create mode 100644 patches/net/minecraft/src/CommandXP.java.patch create mode 100644 patches/net/minecraft/src/ComparatorClassSorter.java.patch create mode 100644 patches/net/minecraft/src/ComponentMineshaftCorridor.java.patch create mode 100644 patches/net/minecraft/src/ComponentMineshaftCross.java.patch create mode 100644 patches/net/minecraft/src/ComponentMineshaftRoom.java.patch create mode 100644 patches/net/minecraft/src/ComponentMineshaftStairs.java.patch create mode 100644 patches/net/minecraft/src/ComponentNetherBridgeCorridor.java.patch create mode 100644 patches/net/minecraft/src/ComponentNetherBridgeCorridor2.java.patch create mode 100644 patches/net/minecraft/src/ComponentNetherBridgeCorridor3.java.patch create mode 100644 patches/net/minecraft/src/ComponentNetherBridgeCorridor4.java.patch create mode 100644 patches/net/minecraft/src/ComponentNetherBridgeCorridor5.java.patch create mode 100644 patches/net/minecraft/src/ComponentNetherBridgeCrossing.java.patch create mode 100644 patches/net/minecraft/src/ComponentNetherBridgeCrossing2.java.patch create mode 100644 patches/net/minecraft/src/ComponentNetherBridgeCrossing3.java.patch create mode 100644 patches/net/minecraft/src/ComponentNetherBridgeEnd.java.patch create mode 100644 patches/net/minecraft/src/ComponentNetherBridgeEntrance.java.patch create mode 100644 patches/net/minecraft/src/ComponentNetherBridgeNetherStalkRoom.java.patch create mode 100644 patches/net/minecraft/src/ComponentNetherBridgePiece.java.patch create mode 100644 patches/net/minecraft/src/ComponentNetherBridgeStairs.java.patch create mode 100644 patches/net/minecraft/src/ComponentNetherBridgeStartPiece.java.patch create mode 100644 patches/net/minecraft/src/ComponentNetherBridgeStraight.java.patch create mode 100644 patches/net/minecraft/src/ComponentNetherBridgeThrone.java.patch create mode 100644 patches/net/minecraft/src/ComponentScatteredFeature.java.patch create mode 100644 patches/net/minecraft/src/ComponentScatteredFeatureDesertPyramid.java.patch create mode 100644 patches/net/minecraft/src/ComponentScatteredFeatureJunglePyramid.java.patch create mode 100644 patches/net/minecraft/src/ComponentScatteredFeatureSwampHut.java.patch create mode 100644 patches/net/minecraft/src/ComponentStronghold.java.patch create mode 100644 patches/net/minecraft/src/ComponentStrongholdChestCorridor.java.patch create mode 100644 patches/net/minecraft/src/ComponentStrongholdCorridor.java.patch create mode 100644 patches/net/minecraft/src/ComponentStrongholdCrossing.java.patch create mode 100644 patches/net/minecraft/src/ComponentStrongholdLeftTurn.java.patch create mode 100644 patches/net/minecraft/src/ComponentStrongholdLibrary.java.patch create mode 100644 patches/net/minecraft/src/ComponentStrongholdPortalRoom.java.patch create mode 100644 patches/net/minecraft/src/ComponentStrongholdPrison.java.patch create mode 100644 patches/net/minecraft/src/ComponentStrongholdRightTurn.java.patch create mode 100644 patches/net/minecraft/src/ComponentStrongholdRoomCrossing.java.patch create mode 100644 patches/net/minecraft/src/ComponentStrongholdStairs.java.patch create mode 100644 patches/net/minecraft/src/ComponentStrongholdStairs2.java.patch create mode 100644 patches/net/minecraft/src/ComponentStrongholdStairsStraight.java.patch create mode 100644 patches/net/minecraft/src/ComponentStrongholdStraight.java.patch create mode 100644 patches/net/minecraft/src/ComponentVillage.java.patch create mode 100644 patches/net/minecraft/src/ComponentVillageChurch.java.patch create mode 100644 patches/net/minecraft/src/ComponentVillageField.java.patch create mode 100644 patches/net/minecraft/src/ComponentVillageField2.java.patch create mode 100644 patches/net/minecraft/src/ComponentVillageHall.java.patch create mode 100644 patches/net/minecraft/src/ComponentVillageHouse1.java.patch create mode 100644 patches/net/minecraft/src/ComponentVillageHouse2.java.patch create mode 100644 patches/net/minecraft/src/ComponentVillageHouse3.java.patch create mode 100644 patches/net/minecraft/src/ComponentVillageHouse4_Garden.java.patch create mode 100644 patches/net/minecraft/src/ComponentVillagePathGen.java.patch create mode 100644 patches/net/minecraft/src/ComponentVillageRoadPiece.java.patch create mode 100644 patches/net/minecraft/src/ComponentVillageStartPiece.java.patch create mode 100644 patches/net/minecraft/src/ComponentVillageTorch.java.patch create mode 100644 patches/net/minecraft/src/ComponentVillageWell.java.patch create mode 100644 patches/net/minecraft/src/ComponentVillageWoodHut.java.patch create mode 100644 patches/net/minecraft/src/CompressedStreamTools.java.patch create mode 100644 patches/net/minecraft/src/Container.java.patch create mode 100644 patches/net/minecraft/src/ContainerBeacon.java.patch create mode 100644 patches/net/minecraft/src/ContainerBrewingStand.java.patch create mode 100644 patches/net/minecraft/src/ContainerChest.java.patch create mode 100644 patches/net/minecraft/src/ContainerCreative.java.patch create mode 100644 patches/net/minecraft/src/ContainerDispenser.java.patch create mode 100644 patches/net/minecraft/src/ContainerEnchantment.java.patch create mode 100644 patches/net/minecraft/src/ContainerFurnace.java.patch create mode 100644 patches/net/minecraft/src/ContainerHopper.java.patch create mode 100644 patches/net/minecraft/src/ContainerHorseInventory.java.patch create mode 100644 patches/net/minecraft/src/ContainerHorseInventorySlotArmor.java.patch create mode 100644 patches/net/minecraft/src/ContainerHorseInventorySlotSaddle.java.patch create mode 100644 patches/net/minecraft/src/ContainerMerchant.java.patch create mode 100644 patches/net/minecraft/src/ContainerPlayer.java.patch create mode 100644 patches/net/minecraft/src/ContainerRepair.java.patch create mode 100644 patches/net/minecraft/src/ContainerRepairINNER1.java.patch create mode 100644 patches/net/minecraft/src/ContainerRepairINNER2.java.patch create mode 100644 patches/net/minecraft/src/ContainerSheep.java.patch create mode 100644 patches/net/minecraft/src/ContainerWorkbench.java.patch create mode 100644 patches/net/minecraft/src/ConvertingProgressUpdate.java.patch create mode 100644 patches/net/minecraft/src/CraftingManager.java.patch create mode 100644 patches/net/minecraft/src/CrashReport.java.patch create mode 100644 patches/net/minecraft/src/CrashReportCategory.java.patch create mode 100644 patches/net/minecraft/src/CrashReportCategoryEntry.java.patch create mode 100644 patches/net/minecraft/src/CreativeCrafting.java.patch create mode 100644 patches/net/minecraft/src/CreativeTabBlock.java.patch create mode 100644 patches/net/minecraft/src/CreativeTabBrewing.java.patch create mode 100644 patches/net/minecraft/src/CreativeTabCombat.java.patch create mode 100644 patches/net/minecraft/src/CreativeTabDeco.java.patch create mode 100644 patches/net/minecraft/src/CreativeTabFood.java.patch create mode 100644 patches/net/minecraft/src/CreativeTabInventory.java.patch create mode 100644 patches/net/minecraft/src/CreativeTabMaterial.java.patch create mode 100644 patches/net/minecraft/src/CreativeTabMisc.java.patch create mode 100644 patches/net/minecraft/src/CreativeTabRedstone.java.patch create mode 100644 patches/net/minecraft/src/CreativeTabSearch.java.patch create mode 100644 patches/net/minecraft/src/CreativeTabTools.java.patch create mode 100644 patches/net/minecraft/src/CreativeTabTransport.java.patch create mode 100644 patches/net/minecraft/src/CreativeTabs.java.patch create mode 100644 patches/net/minecraft/src/CryptManager.java.patch create mode 100644 patches/net/minecraft/src/DamageSource.java.patch create mode 100644 patches/net/minecraft/src/DataWatcher.java.patch create mode 100644 patches/net/minecraft/src/DedicatedPlayerList.java.patch create mode 100644 patches/net/minecraft/src/DedicatedServer.java.patch create mode 100644 patches/net/minecraft/src/DedicatedServerCommandThread.java.patch create mode 100644 patches/net/minecraft/src/DedicatedServerListenThread.java.patch create mode 100644 patches/net/minecraft/src/DedicatedServerSleepThread.java.patch create mode 100644 patches/net/minecraft/src/DefaultResourcePack.java.patch create mode 100644 patches/net/minecraft/src/DemoWorldManager.java.patch create mode 100644 patches/net/minecraft/src/DemoWorldServer.java.patch create mode 100644 patches/net/minecraft/src/DerivedWorldInfo.java.patch create mode 100644 patches/net/minecraft/src/DestroyBlockProgress.java.patch create mode 100644 patches/net/minecraft/src/Direction.java.patch create mode 100644 patches/net/minecraft/src/DispenserBehaviorArrow.java.patch create mode 100644 patches/net/minecraft/src/DispenserBehaviorBoat.java.patch create mode 100644 patches/net/minecraft/src/DispenserBehaviorDye.java.patch create mode 100644 patches/net/minecraft/src/DispenserBehaviorEgg.java.patch create mode 100644 patches/net/minecraft/src/DispenserBehaviorEmptyBucket.java.patch create mode 100644 patches/net/minecraft/src/DispenserBehaviorExperience.java.patch create mode 100644 patches/net/minecraft/src/DispenserBehaviorFilledBucket.java.patch create mode 100644 patches/net/minecraft/src/DispenserBehaviorFire.java.patch create mode 100644 patches/net/minecraft/src/DispenserBehaviorFireball.java.patch create mode 100644 patches/net/minecraft/src/DispenserBehaviorFireworks.java.patch create mode 100644 patches/net/minecraft/src/DispenserBehaviorMobEgg.java.patch create mode 100644 patches/net/minecraft/src/DispenserBehaviorPotion.java.patch create mode 100644 patches/net/minecraft/src/DispenserBehaviorPotionProjectile.java.patch create mode 100644 patches/net/minecraft/src/DispenserBehaviorSnowball.java.patch create mode 100644 patches/net/minecraft/src/DispenserBehaviorTNT.java.patch create mode 100644 patches/net/minecraft/src/DynamicTexture.java.patch create mode 100644 patches/net/minecraft/src/EffectRenderer.java.patch create mode 100644 patches/net/minecraft/src/EmptyChunk.java.patch create mode 100644 patches/net/minecraft/src/Enchantment.java.patch create mode 100644 patches/net/minecraft/src/EnchantmentArrowDamage.java.patch create mode 100644 patches/net/minecraft/src/EnchantmentArrowFire.java.patch create mode 100644 patches/net/minecraft/src/EnchantmentArrowInfinite.java.patch create mode 100644 patches/net/minecraft/src/EnchantmentArrowKnockback.java.patch create mode 100644 patches/net/minecraft/src/EnchantmentDamage.java.patch create mode 100644 patches/net/minecraft/src/EnchantmentData.java.patch create mode 100644 patches/net/minecraft/src/EnchantmentDigging.java.patch create mode 100644 patches/net/minecraft/src/EnchantmentDurability.java.patch create mode 100644 patches/net/minecraft/src/EnchantmentFireAspect.java.patch create mode 100644 patches/net/minecraft/src/EnchantmentHelper.java.patch create mode 100644 patches/net/minecraft/src/EnchantmentKnockback.java.patch create mode 100644 patches/net/minecraft/src/EnchantmentLootBonus.java.patch create mode 100644 patches/net/minecraft/src/EnchantmentModifierDamage.java.patch create mode 100644 patches/net/minecraft/src/EnchantmentModifierLiving.java.patch create mode 100644 patches/net/minecraft/src/EnchantmentNameParts.java.patch create mode 100644 patches/net/minecraft/src/EnchantmentOxygen.java.patch create mode 100644 patches/net/minecraft/src/EnchantmentProtection.java.patch create mode 100644 patches/net/minecraft/src/EnchantmentThorns.java.patch create mode 100644 patches/net/minecraft/src/EnchantmentUntouching.java.patch create mode 100644 patches/net/minecraft/src/EnchantmentWaterWorker.java.patch create mode 100644 patches/net/minecraft/src/Entity.java.patch create mode 100644 patches/net/minecraft/src/EntityAIArrowAttack.java.patch create mode 100644 patches/net/minecraft/src/EntityAIAttackOnCollide.java.patch create mode 100644 patches/net/minecraft/src/EntityAIAvoidEntity.java.patch create mode 100644 patches/net/minecraft/src/EntityAIAvoidEntitySelector.java.patch create mode 100644 patches/net/minecraft/src/EntityAIBase.java.patch create mode 100644 patches/net/minecraft/src/EntityAIBeg.java.patch create mode 100644 patches/net/minecraft/src/EntityAIBreakDoor.java.patch create mode 100644 patches/net/minecraft/src/EntityAIControlledByPlayer.java.patch create mode 100644 patches/net/minecraft/src/EntityAICreeperSwell.java.patch create mode 100644 patches/net/minecraft/src/EntityAIDefendVillage.java.patch create mode 100644 patches/net/minecraft/src/EntityAIDoorInteract.java.patch create mode 100644 patches/net/minecraft/src/EntityAIEatGrass.java.patch create mode 100644 patches/net/minecraft/src/EntityAIFleeSun.java.patch create mode 100644 patches/net/minecraft/src/EntityAIFollowGolem.java.patch create mode 100644 patches/net/minecraft/src/EntityAIFollowOwner.java.patch create mode 100644 patches/net/minecraft/src/EntityAIFollowParent.java.patch create mode 100644 patches/net/minecraft/src/EntityAIHurtByTarget.java.patch create mode 100644 patches/net/minecraft/src/EntityAILeapAtTarget.java.patch create mode 100644 patches/net/minecraft/src/EntityAILookAtTradePlayer.java.patch create mode 100644 patches/net/minecraft/src/EntityAILookAtVillager.java.patch create mode 100644 patches/net/minecraft/src/EntityAILookIdle.java.patch create mode 100644 patches/net/minecraft/src/EntityAIMate.java.patch create mode 100644 patches/net/minecraft/src/EntityAIMoveIndoors.java.patch create mode 100644 patches/net/minecraft/src/EntityAIMoveThroughVillage.java.patch create mode 100644 patches/net/minecraft/src/EntityAIMoveTowardsRestriction.java.patch create mode 100644 patches/net/minecraft/src/EntityAIMoveTowardsTarget.java.patch create mode 100644 patches/net/minecraft/src/EntityAINearestAttackableTarget.java.patch create mode 100644 patches/net/minecraft/src/EntityAINearestAttackableTargetSelector.java.patch create mode 100644 patches/net/minecraft/src/EntityAINearestAttackableTargetSorter.java.patch create mode 100644 patches/net/minecraft/src/EntityAIOcelotAttack.java.patch create mode 100644 patches/net/minecraft/src/EntityAIOcelotSit.java.patch create mode 100644 patches/net/minecraft/src/EntityAIOpenDoor.java.patch create mode 100644 patches/net/minecraft/src/EntityAIOwnerHurtByTarget.java.patch create mode 100644 patches/net/minecraft/src/EntityAIOwnerHurtTarget.java.patch create mode 100644 patches/net/minecraft/src/EntityAIPanic.java.patch create mode 100644 patches/net/minecraft/src/EntityAIPlay.java.patch create mode 100644 patches/net/minecraft/src/EntityAIRestrictOpenDoor.java.patch create mode 100644 patches/net/minecraft/src/EntityAIRestrictSun.java.patch create mode 100644 patches/net/minecraft/src/EntityAIRunAroundLikeCrazy.java.patch create mode 100644 patches/net/minecraft/src/EntityAISit.java.patch create mode 100644 patches/net/minecraft/src/EntityAISwimming.java.patch create mode 100644 patches/net/minecraft/src/EntityAITarget.java.patch create mode 100644 patches/net/minecraft/src/EntityAITargetNonTamed.java.patch create mode 100644 patches/net/minecraft/src/EntityAITaskEntry.java.patch create mode 100644 patches/net/minecraft/src/EntityAITasks.java.patch create mode 100644 patches/net/minecraft/src/EntityAITempt.java.patch create mode 100644 patches/net/minecraft/src/EntityAITradePlayer.java.patch create mode 100644 patches/net/minecraft/src/EntityAIVillagerMate.java.patch create mode 100644 patches/net/minecraft/src/EntityAIWander.java.patch create mode 100644 patches/net/minecraft/src/EntityAIWatchClosest.java.patch create mode 100644 patches/net/minecraft/src/EntityAIWatchClosest2.java.patch create mode 100644 patches/net/minecraft/src/EntityAgeable.java.patch create mode 100644 patches/net/minecraft/src/EntityAmbientCreature.java.patch create mode 100644 patches/net/minecraft/src/EntityAnimal.java.patch create mode 100644 patches/net/minecraft/src/EntityArrow.java.patch create mode 100644 patches/net/minecraft/src/EntityAuraFX.java.patch create mode 100644 patches/net/minecraft/src/EntityBat.java.patch create mode 100644 patches/net/minecraft/src/EntityBlaze.java.patch create mode 100644 patches/net/minecraft/src/EntityBoat.java.patch create mode 100644 patches/net/minecraft/src/EntityBodyHelper.java.patch create mode 100644 patches/net/minecraft/src/EntityBreakingFX.java.patch create mode 100644 patches/net/minecraft/src/EntityBubbleFX.java.patch create mode 100644 patches/net/minecraft/src/EntityCaveSpider.java.patch create mode 100644 patches/net/minecraft/src/EntityChicken.java.patch create mode 100644 patches/net/minecraft/src/EntityClientPlayerMP.java.patch create mode 100644 patches/net/minecraft/src/EntityCloudFX.java.patch create mode 100644 patches/net/minecraft/src/EntityCow.java.patch create mode 100644 patches/net/minecraft/src/EntityCreature.java.patch create mode 100644 patches/net/minecraft/src/EntityCreeper.java.patch create mode 100644 patches/net/minecraft/src/EntityCrit2FX.java.patch create mode 100644 patches/net/minecraft/src/EntityCritFX.java.patch create mode 100644 patches/net/minecraft/src/EntityDamageSource.java.patch create mode 100644 patches/net/minecraft/src/EntityDamageSourceIndirect.java.patch create mode 100644 patches/net/minecraft/src/EntityDiggingFX.java.patch create mode 100644 patches/net/minecraft/src/EntityDragon.java.patch create mode 100644 patches/net/minecraft/src/EntityDragonPart.java.patch create mode 100644 patches/net/minecraft/src/EntityDropParticleFX.java.patch create mode 100644 patches/net/minecraft/src/EntityEgg.java.patch create mode 100644 patches/net/minecraft/src/EntityEggInfo.java.patch create mode 100644 patches/net/minecraft/src/EntityEnchantmentTableParticleFX.java.patch create mode 100644 patches/net/minecraft/src/EntityEnderCrystal.java.patch create mode 100644 patches/net/minecraft/src/EntityEnderEye.java.patch create mode 100644 patches/net/minecraft/src/EntityEnderPearl.java.patch create mode 100644 patches/net/minecraft/src/EntityEnderman.java.patch create mode 100644 patches/net/minecraft/src/EntityExpBottle.java.patch create mode 100644 patches/net/minecraft/src/EntityExplodeFX.java.patch create mode 100644 patches/net/minecraft/src/EntityFX.java.patch create mode 100644 patches/net/minecraft/src/EntityFallingSand.java.patch create mode 100644 patches/net/minecraft/src/EntityFireball.java.patch create mode 100644 patches/net/minecraft/src/EntityFireworkOverlayFX.java.patch create mode 100644 patches/net/minecraft/src/EntityFireworkRocket.java.patch create mode 100644 patches/net/minecraft/src/EntityFireworkSparkFX.java.patch create mode 100644 patches/net/minecraft/src/EntityFireworkStarterFX.java.patch create mode 100644 patches/net/minecraft/src/EntityFishHook.java.patch create mode 100644 patches/net/minecraft/src/EntityFlameFX.java.patch create mode 100644 patches/net/minecraft/src/EntityFlying.java.patch create mode 100644 patches/net/minecraft/src/EntityFootStepFX.java.patch create mode 100644 patches/net/minecraft/src/EntityGhast.java.patch create mode 100644 patches/net/minecraft/src/EntityGiantZombie.java.patch create mode 100644 patches/net/minecraft/src/EntityGolem.java.patch create mode 100644 patches/net/minecraft/src/EntityHanging.java.patch create mode 100644 patches/net/minecraft/src/EntityHeartFX.java.patch create mode 100644 patches/net/minecraft/src/EntityHorse.java.patch create mode 100644 patches/net/minecraft/src/EntityHorseBredSelector.java.patch create mode 100644 patches/net/minecraft/src/EntityHorseGroupData.java.patch create mode 100644 patches/net/minecraft/src/EntityHugeExplodeFX.java.patch create mode 100644 patches/net/minecraft/src/EntityIronGolem.java.patch create mode 100644 patches/net/minecraft/src/EntityItem.java.patch create mode 100644 patches/net/minecraft/src/EntityItemFrame.java.patch create mode 100644 patches/net/minecraft/src/EntityJumpHelper.java.patch create mode 100644 patches/net/minecraft/src/EntityLargeExplodeFX.java.patch create mode 100644 patches/net/minecraft/src/EntityLargeFireball.java.patch create mode 100644 patches/net/minecraft/src/EntityLavaFX.java.patch create mode 100644 patches/net/minecraft/src/EntityLeashKnot.java.patch create mode 100644 patches/net/minecraft/src/EntityLightningBolt.java.patch create mode 100644 patches/net/minecraft/src/EntityList.java.patch create mode 100644 patches/net/minecraft/src/EntityLiving.java.patch create mode 100644 patches/net/minecraft/src/EntityLivingBase.java.patch create mode 100644 patches/net/minecraft/src/EntityLookHelper.java.patch create mode 100644 patches/net/minecraft/src/EntityMagmaCube.java.patch create mode 100644 patches/net/minecraft/src/EntityMinecart.java.patch create mode 100644 patches/net/minecraft/src/EntityMinecartChest.java.patch create mode 100644 patches/net/minecraft/src/EntityMinecartContainer.java.patch create mode 100644 patches/net/minecraft/src/EntityMinecartEmpty.java.patch create mode 100644 patches/net/minecraft/src/EntityMinecartFurnace.java.patch create mode 100644 patches/net/minecraft/src/EntityMinecartHopper.java.patch create mode 100644 patches/net/minecraft/src/EntityMinecartMobSpawner.java.patch create mode 100644 patches/net/minecraft/src/EntityMinecartMobSpawnerLogic.java.patch create mode 100644 patches/net/minecraft/src/EntityMinecartTNT.java.patch create mode 100644 patches/net/minecraft/src/EntityMob.java.patch create mode 100644 patches/net/minecraft/src/EntityMooshroom.java.patch create mode 100644 patches/net/minecraft/src/EntityMoveHelper.java.patch create mode 100644 patches/net/minecraft/src/EntityNoteFX.java.patch create mode 100644 patches/net/minecraft/src/EntityOcelot.java.patch create mode 100644 patches/net/minecraft/src/EntityOtherPlayerMP.java.patch create mode 100644 patches/net/minecraft/src/EntityPainting.java.patch create mode 100644 patches/net/minecraft/src/EntityPickupFX.java.patch create mode 100644 patches/net/minecraft/src/EntityPig.java.patch create mode 100644 patches/net/minecraft/src/EntityPigZombie.java.patch create mode 100644 patches/net/minecraft/src/EntityPlayer.java.patch create mode 100644 patches/net/minecraft/src/EntityPlayerMP.java.patch create mode 100644 patches/net/minecraft/src/EntityPlayerSP.java.patch create mode 100644 patches/net/minecraft/src/EntityPortalFX.java.patch create mode 100644 patches/net/minecraft/src/EntityPotion.java.patch create mode 100644 patches/net/minecraft/src/EntityRainFX.java.patch create mode 100644 patches/net/minecraft/src/EntityReddustFX.java.patch create mode 100644 patches/net/minecraft/src/EntityRenderer.java.patch create mode 100644 patches/net/minecraft/src/EntitySelectorAlive.java.patch create mode 100644 patches/net/minecraft/src/EntitySelectorArmoredMob.java.patch create mode 100644 patches/net/minecraft/src/EntitySelectorInventory.java.patch create mode 100644 patches/net/minecraft/src/EntitySenses.java.patch create mode 100644 patches/net/minecraft/src/EntitySheep.java.patch create mode 100644 patches/net/minecraft/src/EntitySilverfish.java.patch create mode 100644 patches/net/minecraft/src/EntitySkeleton.java.patch create mode 100644 patches/net/minecraft/src/EntitySlime.java.patch create mode 100644 patches/net/minecraft/src/EntitySmallFireball.java.patch create mode 100644 patches/net/minecraft/src/EntitySmokeFX.java.patch create mode 100644 patches/net/minecraft/src/EntitySnowShovelFX.java.patch create mode 100644 patches/net/minecraft/src/EntitySnowball.java.patch create mode 100644 patches/net/minecraft/src/EntitySnowman.java.patch create mode 100644 patches/net/minecraft/src/EntitySorter.java.patch create mode 100644 patches/net/minecraft/src/EntitySpellParticleFX.java.patch create mode 100644 patches/net/minecraft/src/EntitySpider.java.patch create mode 100644 patches/net/minecraft/src/EntitySplashFX.java.patch create mode 100644 patches/net/minecraft/src/EntitySquid.java.patch create mode 100644 patches/net/minecraft/src/EntitySuspendFX.java.patch create mode 100644 patches/net/minecraft/src/EntityTNTPrimed.java.patch create mode 100644 patches/net/minecraft/src/EntityTameable.java.patch create mode 100644 patches/net/minecraft/src/EntityThrowable.java.patch create mode 100644 patches/net/minecraft/src/EntityTracker.java.patch create mode 100644 patches/net/minecraft/src/EntityTrackerEntry.java.patch create mode 100644 patches/net/minecraft/src/EntityVillager.java.patch create mode 100644 patches/net/minecraft/src/EntityWaterMob.java.patch create mode 100644 patches/net/minecraft/src/EntityWeatherEffect.java.patch create mode 100644 patches/net/minecraft/src/EntityWitch.java.patch create mode 100644 patches/net/minecraft/src/EntityWither.java.patch create mode 100644 patches/net/minecraft/src/EntityWitherAttackFilter.java.patch create mode 100644 patches/net/minecraft/src/EntityWitherSkull.java.patch create mode 100644 patches/net/minecraft/src/EntityWolf.java.patch create mode 100644 patches/net/minecraft/src/EntityXPOrb.java.patch create mode 100644 patches/net/minecraft/src/EntityZombie.java.patch create mode 100644 patches/net/minecraft/src/EntityZombieGroupData.java.patch create mode 100644 patches/net/minecraft/src/EnumArmorMaterial.java.patch create mode 100644 patches/net/minecraft/src/EnumArt.java.patch create mode 100644 patches/net/minecraft/src/EnumChatFormatting.java.patch create mode 100644 patches/net/minecraft/src/EnumCreatureType.java.patch create mode 100644 patches/net/minecraft/src/EnumDoorHelper.java.patch create mode 100644 patches/net/minecraft/src/EnumEnchantmentType.java.patch create mode 100644 patches/net/minecraft/src/EnumEntitySize.java.patch create mode 100644 patches/net/minecraft/src/EnumEntitySizeHelper.java.patch create mode 100644 patches/net/minecraft/src/EnumFacing.java.patch create mode 100644 patches/net/minecraft/src/EnumGameType.java.patch create mode 100644 patches/net/minecraft/src/EnumOptions.java.patch create mode 100644 patches/net/minecraft/src/EnumOptionsHelper.java.patch create mode 100644 patches/net/minecraft/src/EnumRarity.java.patch create mode 100644 patches/net/minecraft/src/EnumSkyBlock.java.patch create mode 100644 patches/net/minecraft/src/EnumToolMaterial.java.patch create mode 100644 patches/net/minecraft/src/ExceptionMcoHttp.java.patch create mode 100644 patches/net/minecraft/src/ExceptionMcoService.java.patch create mode 100644 patches/net/minecraft/src/ExceptionRetryCall.java.patch create mode 100644 patches/net/minecraft/src/Explosion.java.patch create mode 100644 patches/net/minecraft/src/ExtendedBlockStorage.java.patch create mode 100644 patches/net/minecraft/src/Facing.java.patch create mode 100644 patches/net/minecraft/src/FallbackResourceManager.java.patch create mode 100644 patches/net/minecraft/src/FileResourcePack.java.patch create mode 100644 patches/net/minecraft/src/FilterIMob.java.patch create mode 100644 patches/net/minecraft/src/FlatGeneratorInfo.java.patch create mode 100644 patches/net/minecraft/src/FlatLayerInfo.java.patch create mode 100644 patches/net/minecraft/src/FolderResourcePack.java.patch create mode 100644 patches/net/minecraft/src/FoliageColorReloadListener.java.patch create mode 100644 patches/net/minecraft/src/FontMetadataSection.java.patch create mode 100644 patches/net/minecraft/src/FontMetadataSectionSerializer.java.patch create mode 100644 patches/net/minecraft/src/FontRenderer.java.patch create mode 100644 patches/net/minecraft/src/FoodStats.java.patch create mode 100644 patches/net/minecraft/src/Frustrum.java.patch create mode 100644 patches/net/minecraft/src/FurnaceRecipes.java.patch create mode 100644 patches/net/minecraft/src/GLAllocation.java.patch create mode 100644 patches/net/minecraft/src/GameRuleValue.java.patch create mode 100644 patches/net/minecraft/src/GameRules.java.patch create mode 100644 patches/net/minecraft/src/GameSettings.java.patch create mode 100644 patches/net/minecraft/src/GameWindowListener.java.patch create mode 100644 patches/net/minecraft/src/GenLayer.java.patch create mode 100644 patches/net/minecraft/src/GenLayerAddIsland.java.patch create mode 100644 patches/net/minecraft/src/GenLayerAddMushroomIsland.java.patch create mode 100644 patches/net/minecraft/src/GenLayerAddSnow.java.patch create mode 100644 patches/net/minecraft/src/GenLayerBiome.java.patch create mode 100644 patches/net/minecraft/src/GenLayerFuzzyZoom.java.patch create mode 100644 patches/net/minecraft/src/GenLayerHills.java.patch create mode 100644 patches/net/minecraft/src/GenLayerIsland.java.patch create mode 100644 patches/net/minecraft/src/GenLayerRiver.java.patch create mode 100644 patches/net/minecraft/src/GenLayerRiverInit.java.patch create mode 100644 patches/net/minecraft/src/GenLayerRiverMix.java.patch create mode 100644 patches/net/minecraft/src/GenLayerShore.java.patch create mode 100644 patches/net/minecraft/src/GenLayerSmooth.java.patch create mode 100644 patches/net/minecraft/src/GenLayerSwampRivers.java.patch create mode 100644 patches/net/minecraft/src/GenLayerVoronoiZoom.java.patch create mode 100644 patches/net/minecraft/src/GenLayerZoom.java.patch create mode 100644 patches/net/minecraft/src/GrassColorReloadListener.java.patch create mode 100644 patches/net/minecraft/src/Gui.java.patch create mode 100644 patches/net/minecraft/src/GuiAchievement.java.patch create mode 100644 patches/net/minecraft/src/GuiAchievements.java.patch create mode 100644 patches/net/minecraft/src/GuiBeacon.java.patch create mode 100644 patches/net/minecraft/src/GuiBeaconButton.java.patch create mode 100644 patches/net/minecraft/src/GuiBeaconButtonCancel.java.patch create mode 100644 patches/net/minecraft/src/GuiBeaconButtonConfirm.java.patch create mode 100644 patches/net/minecraft/src/GuiBeaconButtonPower.java.patch create mode 100644 patches/net/minecraft/src/GuiBrewingStand.java.patch create mode 100644 patches/net/minecraft/src/GuiButton.java.patch create mode 100644 patches/net/minecraft/src/GuiButtonLanguage.java.patch create mode 100644 patches/net/minecraft/src/GuiButtonLink.java.patch create mode 100644 patches/net/minecraft/src/GuiButtonMerchant.java.patch create mode 100644 patches/net/minecraft/src/GuiButtonNextPage.java.patch create mode 100644 patches/net/minecraft/src/GuiChat.java.patch create mode 100644 patches/net/minecraft/src/GuiChest.java.patch create mode 100644 patches/net/minecraft/src/GuiCommandBlock.java.patch create mode 100644 patches/net/minecraft/src/GuiConfirmOpenLink.java.patch create mode 100644 patches/net/minecraft/src/GuiConnecting.java.patch create mode 100644 patches/net/minecraft/src/GuiContainer.java.patch create mode 100644 patches/net/minecraft/src/GuiContainerCreative.java.patch create mode 100644 patches/net/minecraft/src/GuiControls.java.patch create mode 100644 patches/net/minecraft/src/GuiCrafting.java.patch create mode 100644 patches/net/minecraft/src/GuiCreateFlatWorld.java.patch create mode 100644 patches/net/minecraft/src/GuiCreateFlatWorldListSlot.java.patch create mode 100644 patches/net/minecraft/src/GuiCreateWorld.java.patch create mode 100644 patches/net/minecraft/src/GuiDisconnected.java.patch create mode 100644 patches/net/minecraft/src/GuiDispenser.java.patch create mode 100644 patches/net/minecraft/src/GuiDownloadTerrain.java.patch create mode 100644 patches/net/minecraft/src/GuiEditSign.java.patch create mode 100644 patches/net/minecraft/src/GuiEnchantment.java.patch create mode 100644 patches/net/minecraft/src/GuiErrorScreen.java.patch create mode 100644 patches/net/minecraft/src/GuiFlatPresets.java.patch create mode 100644 patches/net/minecraft/src/GuiFlatPresetsItem.java.patch create mode 100644 patches/net/minecraft/src/GuiFlatPresetsListSlot.java.patch create mode 100644 patches/net/minecraft/src/GuiFurnace.java.patch create mode 100644 patches/net/minecraft/src/GuiGameOver.java.patch create mode 100644 patches/net/minecraft/src/GuiHopper.java.patch create mode 100644 patches/net/minecraft/src/GuiIngame.java.patch create mode 100644 patches/net/minecraft/src/GuiIngameMenu.java.patch create mode 100644 patches/net/minecraft/src/GuiInventory.java.patch create mode 100644 patches/net/minecraft/src/GuiLanguage.java.patch create mode 100644 patches/net/minecraft/src/GuiMainMenu.java.patch create mode 100644 patches/net/minecraft/src/GuiMemoryErrorScreen.java.patch create mode 100644 patches/net/minecraft/src/GuiMerchant.java.patch create mode 100644 patches/net/minecraft/src/GuiMultiplayer.java.patch create mode 100644 patches/net/minecraft/src/GuiNewChat.java.patch create mode 100644 patches/net/minecraft/src/GuiOptions.java.patch create mode 100644 patches/net/minecraft/src/GuiParticle.java.patch create mode 100644 patches/net/minecraft/src/GuiPlayerInfo.java.patch create mode 100644 patches/net/minecraft/src/GuiRenameWorld.java.patch create mode 100644 patches/net/minecraft/src/GuiRepair.java.patch create mode 100644 patches/net/minecraft/src/GuiScreen.java.patch create mode 100644 patches/net/minecraft/src/GuiScreenAddServer.java.patch create mode 100644 patches/net/minecraft/src/GuiScreenBackup.java.patch create mode 100644 patches/net/minecraft/src/GuiScreenBackupDownloadThread.java.patch create mode 100644 patches/net/minecraft/src/GuiScreenBackupRestoreTask.java.patch create mode 100644 patches/net/minecraft/src/GuiScreenBackupSelectionList.java.patch create mode 100644 patches/net/minecraft/src/GuiScreenBook.java.patch create mode 100644 patches/net/minecraft/src/GuiScreenClientOutdated.java.patch create mode 100644 patches/net/minecraft/src/GuiScreenConfigureWorld.java.patch create mode 100644 patches/net/minecraft/src/GuiScreenConfirmation.java.patch create mode 100644 patches/net/minecraft/src/GuiScreenConfirmationType.java.patch create mode 100644 patches/net/minecraft/src/GuiScreenCreateOnlineWorld.java.patch create mode 100644 patches/net/minecraft/src/GuiScreenDemo.java.patch create mode 100644 patches/net/minecraft/src/GuiScreenDisconnectedOnline.java.patch create mode 100644 patches/net/minecraft/src/GuiScreenEditOnlineWorld.java.patch create mode 100644 patches/net/minecraft/src/GuiScreenHorseInventory.java.patch create mode 100644 patches/net/minecraft/src/GuiScreenInvite.java.patch create mode 100644 patches/net/minecraft/src/GuiScreenLongRunningTask.java.patch create mode 100644 patches/net/minecraft/src/GuiScreenMcoWorldTemplate.java.patch create mode 100644 patches/net/minecraft/src/GuiScreenMcoWorldTemplateDownloadThread.java.patch create mode 100644 patches/net/minecraft/src/GuiScreenMcoWorldTemplateSelectionList.java.patch create mode 100644 patches/net/minecraft/src/GuiScreenOnlineServers.java.patch create mode 100644 patches/net/minecraft/src/GuiScreenOnlineServersSubscreen.java.patch create mode 100644 patches/net/minecraft/src/GuiScreenPendingInvitation.java.patch create mode 100644 patches/net/minecraft/src/GuiScreenPendingInvitationINNER1.java.patch create mode 100644 patches/net/minecraft/src/GuiScreenPendingInvitationINNER2.java.patch create mode 100644 patches/net/minecraft/src/GuiScreenPendingInvitationINNER3.java.patch create mode 100644 patches/net/minecraft/src/GuiScreenPendingInvitationList.java.patch create mode 100644 patches/net/minecraft/src/GuiScreenResetWorld.java.patch create mode 100644 patches/net/minecraft/src/GuiScreenSelectLocation.java.patch create mode 100644 patches/net/minecraft/src/GuiScreenServerList.java.patch create mode 100644 patches/net/minecraft/src/GuiScreenSubscription.java.patch create mode 100644 patches/net/minecraft/src/GuiScreenTemporaryResourcePackSelect.java.patch create mode 100644 patches/net/minecraft/src/GuiScreenTemporaryResourcePackSelectSelectionList.java.patch create mode 100644 patches/net/minecraft/src/GuiSelectWorld.java.patch create mode 100644 patches/net/minecraft/src/GuiShareToLan.java.patch create mode 100644 patches/net/minecraft/src/GuiSleepMP.java.patch create mode 100644 patches/net/minecraft/src/GuiSlider.java.patch create mode 100644 patches/net/minecraft/src/GuiSlot.java.patch create mode 100644 patches/net/minecraft/src/GuiSlotLanguage.java.patch create mode 100644 patches/net/minecraft/src/GuiSlotOnlineServerList.java.patch create mode 100644 patches/net/minecraft/src/GuiSlotServer.java.patch create mode 100644 patches/net/minecraft/src/GuiSlotStats.java.patch create mode 100644 patches/net/minecraft/src/GuiSlotStatsBlock.java.patch create mode 100644 patches/net/minecraft/src/GuiSlotStatsGeneral.java.patch create mode 100644 patches/net/minecraft/src/GuiSlotStatsItem.java.patch create mode 100644 patches/net/minecraft/src/GuiSmallButton.java.patch create mode 100644 patches/net/minecraft/src/GuiSnooper.java.patch create mode 100644 patches/net/minecraft/src/GuiSnooperList.java.patch create mode 100644 patches/net/minecraft/src/GuiStats.java.patch create mode 100644 patches/net/minecraft/src/GuiTextField.java.patch create mode 100644 patches/net/minecraft/src/GuiVideoSettings.java.patch create mode 100644 patches/net/minecraft/src/GuiWinGame.java.patch create mode 100644 patches/net/minecraft/src/GuiWorldSlot.java.patch create mode 100644 patches/net/minecraft/src/GuiYesNo.java.patch create mode 100644 patches/net/minecraft/src/Hopper.java.patch create mode 100644 patches/net/minecraft/src/HttpUtil.java.patch create mode 100644 patches/net/minecraft/src/I18n.java.patch create mode 100644 patches/net/minecraft/src/IAdminCommand.java.patch create mode 100644 patches/net/minecraft/src/IBehaviorDispenseItem.java.patch create mode 100644 patches/net/minecraft/src/IBlockAccess.java.patch create mode 100644 patches/net/minecraft/src/IBossDisplayData.java.patch create mode 100644 patches/net/minecraft/src/ICamera.java.patch create mode 100644 patches/net/minecraft/src/IChunkLoader.java.patch create mode 100644 patches/net/minecraft/src/IChunkProvider.java.patch create mode 100644 patches/net/minecraft/src/ICommand.java.patch create mode 100644 patches/net/minecraft/src/ICommandManager.java.patch create mode 100644 patches/net/minecraft/src/ICommandSender.java.patch create mode 100644 patches/net/minecraft/src/ICrafting.java.patch create mode 100644 patches/net/minecraft/src/IEnchantmentModifier.java.patch create mode 100644 patches/net/minecraft/src/IEntitySelector.java.patch create mode 100644 patches/net/minecraft/src/IInvBasic.java.patch create mode 100644 patches/net/minecraft/src/IInventory.java.patch create mode 100644 patches/net/minecraft/src/ILogAgent.java.patch create mode 100644 patches/net/minecraft/src/IMob.java.patch create mode 100644 patches/net/minecraft/src/INetworkManager.java.patch create mode 100644 patches/net/minecraft/src/IPlayerFileData.java.patch create mode 100644 patches/net/minecraft/src/IPlayerUsage.java.patch create mode 100644 patches/net/minecraft/src/IProgressUpdate.java.patch create mode 100644 patches/net/minecraft/src/IProjectile.java.patch create mode 100644 patches/net/minecraft/src/IRangedAttackMob.java.patch create mode 100644 patches/net/minecraft/src/IRecipe.java.patch create mode 100644 patches/net/minecraft/src/IRegistry.java.patch create mode 100644 patches/net/minecraft/src/ISaveFormat.java.patch create mode 100644 patches/net/minecraft/src/ISaveHandler.java.patch create mode 100644 patches/net/minecraft/src/IServer.java.patch create mode 100644 patches/net/minecraft/src/ISidedInventory.java.patch create mode 100644 patches/net/minecraft/src/IStatStringFormat.java.patch create mode 100644 patches/net/minecraft/src/IStatType.java.patch create mode 100644 patches/net/minecraft/src/IThreadedFileIO.java.patch create mode 100644 patches/net/minecraft/src/ITileEntityProvider.java.patch create mode 100644 patches/net/minecraft/src/IUpdatePlayerListBox.java.patch create mode 100644 patches/net/minecraft/src/IWorldAccess.java.patch create mode 100644 patches/net/minecraft/src/Icon.java.patch create mode 100644 patches/net/minecraft/src/IconFlipped.java.patch create mode 100644 patches/net/minecraft/src/ImageBufferDownload.java.patch create mode 100644 patches/net/minecraft/src/IntCache.java.patch create mode 100644 patches/net/minecraft/src/IntHashMap.java.patch create mode 100644 patches/net/minecraft/src/IntHashMapEntry.java.patch create mode 100644 patches/net/minecraft/src/IntegratedPlayerList.java.patch create mode 100644 patches/net/minecraft/src/IntegratedServer.java.patch create mode 100644 patches/net/minecraft/src/IntegratedServerListenThread.java.patch create mode 100644 patches/net/minecraft/src/InventoryBasic.java.patch create mode 100644 patches/net/minecraft/src/InventoryCraftResult.java.patch create mode 100644 patches/net/minecraft/src/InventoryCrafting.java.patch create mode 100644 patches/net/minecraft/src/InventoryEffectRenderer.java.patch create mode 100644 patches/net/minecraft/src/InventoryEnderChest.java.patch create mode 100644 patches/net/minecraft/src/InventoryLargeChest.java.patch create mode 100644 patches/net/minecraft/src/InventoryMerchant.java.patch create mode 100644 patches/net/minecraft/src/InventoryPlayer.java.patch create mode 100644 patches/net/minecraft/src/Item.java.patch create mode 100644 patches/net/minecraft/src/ItemAnvilBlock.java.patch create mode 100644 patches/net/minecraft/src/ItemAppleGold.java.patch create mode 100644 patches/net/minecraft/src/ItemArmor.java.patch create mode 100644 patches/net/minecraft/src/ItemAxe.java.patch create mode 100644 patches/net/minecraft/src/ItemBed.java.patch create mode 100644 patches/net/minecraft/src/ItemBlock.java.patch create mode 100644 patches/net/minecraft/src/ItemBlockWithMetadata.java.patch create mode 100644 patches/net/minecraft/src/ItemBoat.java.patch create mode 100644 patches/net/minecraft/src/ItemBook.java.patch create mode 100644 patches/net/minecraft/src/ItemBow.java.patch create mode 100644 patches/net/minecraft/src/ItemBucket.java.patch create mode 100644 patches/net/minecraft/src/ItemBucketMilk.java.patch create mode 100644 patches/net/minecraft/src/ItemCarrotOnAStick.java.patch create mode 100644 patches/net/minecraft/src/ItemCloth.java.patch create mode 100644 patches/net/minecraft/src/ItemCoal.java.patch create mode 100644 patches/net/minecraft/src/ItemColored.java.patch create mode 100644 patches/net/minecraft/src/ItemDoor.java.patch create mode 100644 patches/net/minecraft/src/ItemDye.java.patch create mode 100644 patches/net/minecraft/src/ItemEditableBook.java.patch create mode 100644 patches/net/minecraft/src/ItemEgg.java.patch create mode 100644 patches/net/minecraft/src/ItemEmptyMap.java.patch create mode 100644 patches/net/minecraft/src/ItemEnchantedBook.java.patch create mode 100644 patches/net/minecraft/src/ItemEnderEye.java.patch create mode 100644 patches/net/minecraft/src/ItemEnderPearl.java.patch create mode 100644 patches/net/minecraft/src/ItemExpBottle.java.patch create mode 100644 patches/net/minecraft/src/ItemFireball.java.patch create mode 100644 patches/net/minecraft/src/ItemFirework.java.patch create mode 100644 patches/net/minecraft/src/ItemFireworkCharge.java.patch create mode 100644 patches/net/minecraft/src/ItemFishingRod.java.patch create mode 100644 patches/net/minecraft/src/ItemFlintAndSteel.java.patch create mode 100644 patches/net/minecraft/src/ItemFood.java.patch create mode 100644 patches/net/minecraft/src/ItemGlassBottle.java.patch create mode 100644 patches/net/minecraft/src/ItemHangingEntity.java.patch create mode 100644 patches/net/minecraft/src/ItemHoe.java.patch create mode 100644 patches/net/minecraft/src/ItemInWorldManager.java.patch create mode 100644 patches/net/minecraft/src/ItemLeash.java.patch create mode 100644 patches/net/minecraft/src/ItemLeaves.java.patch create mode 100644 patches/net/minecraft/src/ItemLilyPad.java.patch create mode 100644 patches/net/minecraft/src/ItemMap.java.patch create mode 100644 patches/net/minecraft/src/ItemMapBase.java.patch create mode 100644 patches/net/minecraft/src/ItemMinecart.java.patch create mode 100644 patches/net/minecraft/src/ItemMonsterPlacer.java.patch create mode 100644 patches/net/minecraft/src/ItemMultiTextureTile.java.patch create mode 100644 patches/net/minecraft/src/ItemNameTag.java.patch create mode 100644 patches/net/minecraft/src/ItemPickaxe.java.patch create mode 100644 patches/net/minecraft/src/ItemPiston.java.patch create mode 100644 patches/net/minecraft/src/ItemPotion.java.patch create mode 100644 patches/net/minecraft/src/ItemRecord.java.patch create mode 100644 patches/net/minecraft/src/ItemRedstone.java.patch create mode 100644 patches/net/minecraft/src/ItemReed.java.patch create mode 100644 patches/net/minecraft/src/ItemRenderer.java.patch create mode 100644 patches/net/minecraft/src/ItemSaddle.java.patch create mode 100644 patches/net/minecraft/src/ItemSeedFood.java.patch create mode 100644 patches/net/minecraft/src/ItemSeeds.java.patch create mode 100644 patches/net/minecraft/src/ItemShears.java.patch create mode 100644 patches/net/minecraft/src/ItemSign.java.patch create mode 100644 patches/net/minecraft/src/ItemSimpleFoiled.java.patch create mode 100644 patches/net/minecraft/src/ItemSkull.java.patch create mode 100644 patches/net/minecraft/src/ItemSlab.java.patch create mode 100644 patches/net/minecraft/src/ItemSnow.java.patch create mode 100644 patches/net/minecraft/src/ItemSnowball.java.patch create mode 100644 patches/net/minecraft/src/ItemSoup.java.patch create mode 100644 patches/net/minecraft/src/ItemSpade.java.patch create mode 100644 patches/net/minecraft/src/ItemStack.java.patch create mode 100644 patches/net/minecraft/src/ItemSword.java.patch create mode 100644 patches/net/minecraft/src/ItemTool.java.patch create mode 100644 patches/net/minecraft/src/ItemWritableBook.java.patch create mode 100644 patches/net/minecraft/src/KeyBinding.java.patch create mode 100644 patches/net/minecraft/src/LanServer.java.patch create mode 100644 patches/net/minecraft/src/LanServerList.java.patch create mode 100644 patches/net/minecraft/src/Language.java.patch create mode 100644 patches/net/minecraft/src/LanguageManager.java.patch create mode 100644 patches/net/minecraft/src/LanguageMetadataSection.java.patch create mode 100644 patches/net/minecraft/src/LanguageMetadataSectionSerializer.java.patch create mode 100644 patches/net/minecraft/src/LayeredTexture.java.patch create mode 100644 patches/net/minecraft/src/LoadingScreenRenderer.java.patch create mode 100644 patches/net/minecraft/src/Locale.java.patch create mode 100644 patches/net/minecraft/src/LogAgent.java.patch create mode 100644 patches/net/minecraft/src/LogFormatter.java.patch create mode 100644 patches/net/minecraft/src/LongHashMap.java.patch create mode 100644 patches/net/minecraft/src/LongHashMapEntry.java.patch create mode 100644 patches/net/minecraft/src/LowerStringMap.java.patch create mode 100644 patches/net/minecraft/src/MD5String.java.patch create mode 100644 patches/net/minecraft/src/MainProxyAuthenticator.java.patch create mode 100644 patches/net/minecraft/src/MapColor.java.patch create mode 100644 patches/net/minecraft/src/MapCoord.java.patch create mode 100644 patches/net/minecraft/src/MapData.java.patch create mode 100644 patches/net/minecraft/src/MapGenBase.java.patch create mode 100644 patches/net/minecraft/src/MapGenCaves.java.patch create mode 100644 patches/net/minecraft/src/MapGenCavesHell.java.patch create mode 100644 patches/net/minecraft/src/MapGenMineshaft.java.patch create mode 100644 patches/net/minecraft/src/MapGenNetherBridge.java.patch create mode 100644 patches/net/minecraft/src/MapGenRavine.java.patch create mode 100644 patches/net/minecraft/src/MapGenScatteredFeature.java.patch create mode 100644 patches/net/minecraft/src/MapGenStronghold.java.patch create mode 100644 patches/net/minecraft/src/MapGenStructure.java.patch create mode 100644 patches/net/minecraft/src/MapGenStructureData.java.patch create mode 100644 patches/net/minecraft/src/MapGenStructureIO.java.patch create mode 100644 patches/net/minecraft/src/MapGenVillage.java.patch create mode 100644 patches/net/minecraft/src/MapInfo.java.patch create mode 100644 patches/net/minecraft/src/MapItemRenderer.java.patch create mode 100644 patches/net/minecraft/src/MapStorage.java.patch create mode 100644 patches/net/minecraft/src/Material.java.patch create mode 100644 patches/net/minecraft/src/MaterialLiquid.java.patch create mode 100644 patches/net/minecraft/src/MaterialLogic.java.patch create mode 100644 patches/net/minecraft/src/MaterialPortal.java.patch create mode 100644 patches/net/minecraft/src/MaterialTransparent.java.patch create mode 100644 patches/net/minecraft/src/MaterialWeb.java.patch create mode 100644 patches/net/minecraft/src/MathHelper.java.patch create mode 100644 patches/net/minecraft/src/McoClient.java.patch create mode 100644 patches/net/minecraft/src/McoServer.java.patch create mode 100644 patches/net/minecraft/src/McoServerAddress.java.patch create mode 100644 patches/net/minecraft/src/McoServerList.java.patch create mode 100644 patches/net/minecraft/src/McoServerListUpdateTask.java.patch create mode 100644 patches/net/minecraft/src/McoServerListUpdateTaskComparator.java.patch create mode 100644 patches/net/minecraft/src/MemoryConnection.java.patch create mode 100644 patches/net/minecraft/src/MerchantRecipe.java.patch create mode 100644 patches/net/minecraft/src/MerchantRecipeList.java.patch create mode 100644 patches/net/minecraft/src/MessageComponentSerializer.java.patch create mode 100644 patches/net/minecraft/src/MetadataSectionSerializer.java.patch create mode 100644 patches/net/minecraft/src/MetadataSerializer.java.patch create mode 100644 patches/net/minecraft/src/MetadataSerializerRegistration.java.patch create mode 100644 patches/net/minecraft/src/Minecraft.java.patch create mode 100644 patches/net/minecraft/src/MinecraftException.java.patch create mode 100644 patches/net/minecraft/src/MinecraftINNER13.java.patch create mode 100644 patches/net/minecraft/src/MobSpawnerBaseLogic.java.patch create mode 100644 patches/net/minecraft/src/ModelBase.java.patch create mode 100644 patches/net/minecraft/src/ModelBat.java.patch create mode 100644 patches/net/minecraft/src/ModelBiped.java.patch create mode 100644 patches/net/minecraft/src/ModelBlaze.java.patch create mode 100644 patches/net/minecraft/src/ModelBoat.java.patch create mode 100644 patches/net/minecraft/src/ModelBook.java.patch create mode 100644 patches/net/minecraft/src/ModelBox.java.patch create mode 100644 patches/net/minecraft/src/ModelChest.java.patch create mode 100644 patches/net/minecraft/src/ModelChicken.java.patch create mode 100644 patches/net/minecraft/src/ModelCreeper.java.patch create mode 100644 patches/net/minecraft/src/ModelDragon.java.patch create mode 100644 patches/net/minecraft/src/ModelEnderCrystal.java.patch create mode 100644 patches/net/minecraft/src/ModelEnderman.java.patch create mode 100644 patches/net/minecraft/src/ModelGhast.java.patch create mode 100644 patches/net/minecraft/src/ModelHorse.java.patch create mode 100644 patches/net/minecraft/src/ModelIronGolem.java.patch create mode 100644 patches/net/minecraft/src/ModelLeashKnot.java.patch create mode 100644 patches/net/minecraft/src/ModelMagmaCube.java.patch create mode 100644 patches/net/minecraft/src/ModelMinecart.java.patch create mode 100644 patches/net/minecraft/src/ModelOcelot.java.patch create mode 100644 patches/net/minecraft/src/ModelPig.java.patch create mode 100644 patches/net/minecraft/src/ModelQuadruped.java.patch create mode 100644 patches/net/minecraft/src/ModelRenderer.java.patch create mode 100644 patches/net/minecraft/src/ModelSheep1.java.patch create mode 100644 patches/net/minecraft/src/ModelSheep2.java.patch create mode 100644 patches/net/minecraft/src/ModelSign.java.patch create mode 100644 patches/net/minecraft/src/ModelSilverfish.java.patch create mode 100644 patches/net/minecraft/src/ModelSkeleton.java.patch create mode 100644 patches/net/minecraft/src/ModelSkeletonHead.java.patch create mode 100644 patches/net/minecraft/src/ModelSlime.java.patch create mode 100644 patches/net/minecraft/src/ModelSnowMan.java.patch create mode 100644 patches/net/minecraft/src/ModelSpider.java.patch create mode 100644 patches/net/minecraft/src/ModelSquid.java.patch create mode 100644 patches/net/minecraft/src/ModelVillager.java.patch create mode 100644 patches/net/minecraft/src/ModelWitch.java.patch create mode 100644 patches/net/minecraft/src/ModelWither.java.patch create mode 100644 patches/net/minecraft/src/ModelWolf.java.patch create mode 100644 patches/net/minecraft/src/ModelZombie.java.patch create mode 100644 patches/net/minecraft/src/ModelZombieVillager.java.patch create mode 100644 patches/net/minecraft/src/ModifiableAttributeInstance.java.patch create mode 100644 patches/net/minecraft/src/MouseFilter.java.patch create mode 100644 patches/net/minecraft/src/MouseHelper.java.patch create mode 100644 patches/net/minecraft/src/MovementInput.java.patch create mode 100644 patches/net/minecraft/src/MovementInputFromOptions.java.patch create mode 100644 patches/net/minecraft/src/MovingObjectPosition.java.patch create mode 100644 patches/net/minecraft/src/NBTBase.java.patch create mode 100644 patches/net/minecraft/src/NBTTagByte.java.patch create mode 100644 patches/net/minecraft/src/NBTTagByteArray.java.patch create mode 100644 patches/net/minecraft/src/NBTTagCompound.java.patch create mode 100644 patches/net/minecraft/src/NBTTagDouble.java.patch create mode 100644 patches/net/minecraft/src/NBTTagEnd.java.patch create mode 100644 patches/net/minecraft/src/NBTTagFloat.java.patch create mode 100644 patches/net/minecraft/src/NBTTagInt.java.patch create mode 100644 patches/net/minecraft/src/NBTTagIntArray.java.patch create mode 100644 patches/net/minecraft/src/NBTTagList.java.patch create mode 100644 patches/net/minecraft/src/NBTTagLong.java.patch create mode 100644 patches/net/minecraft/src/NBTTagShort.java.patch create mode 100644 patches/net/minecraft/src/NBTTagString.java.patch create mode 100644 patches/net/minecraft/src/NetClientHandler.java.patch create mode 100644 patches/net/minecraft/src/NetHandler.java.patch create mode 100644 patches/net/minecraft/src/NetLoginHandler.java.patch create mode 100644 patches/net/minecraft/src/NetServerHandler.java.patch create mode 100644 patches/net/minecraft/src/NetworkListenThread.java.patch create mode 100644 patches/net/minecraft/src/NextTickListEntry.java.patch create mode 100644 patches/net/minecraft/src/NibbleArray.java.patch create mode 100644 patches/net/minecraft/src/NibbleArrayReader.java.patch create mode 100644 patches/net/minecraft/src/NoiseGeneratorOctaves.java.patch create mode 100644 patches/net/minecraft/src/NoiseGeneratorPerlin.java.patch create mode 100644 patches/net/minecraft/src/NpcMerchant.java.patch create mode 100644 patches/net/minecraft/src/NumberInvalidException.java.patch create mode 100644 patches/net/minecraft/src/OpenGlCapsChecker.java.patch create mode 100644 patches/net/minecraft/src/OpenGlHelper.java.patch create mode 100644 patches/net/minecraft/src/PackMetadataSection.java.patch create mode 100644 patches/net/minecraft/src/PackMetadataSectionSerializer.java.patch create mode 100644 patches/net/minecraft/src/Packet.java.patch create mode 100644 patches/net/minecraft/src/Packet0KeepAlive.java.patch create mode 100644 patches/net/minecraft/src/Packet100OpenWindow.java.patch create mode 100644 patches/net/minecraft/src/Packet101CloseWindow.java.patch create mode 100644 patches/net/minecraft/src/Packet102WindowClick.java.patch create mode 100644 patches/net/minecraft/src/Packet103SetSlot.java.patch create mode 100644 patches/net/minecraft/src/Packet104WindowItems.java.patch create mode 100644 patches/net/minecraft/src/Packet105UpdateProgressbar.java.patch create mode 100644 patches/net/minecraft/src/Packet106Transaction.java.patch create mode 100644 patches/net/minecraft/src/Packet107CreativeSetSlot.java.patch create mode 100644 patches/net/minecraft/src/Packet108EnchantItem.java.patch create mode 100644 patches/net/minecraft/src/Packet10Flying.java.patch create mode 100644 patches/net/minecraft/src/Packet11PlayerPosition.java.patch create mode 100644 patches/net/minecraft/src/Packet12PlayerLook.java.patch create mode 100644 patches/net/minecraft/src/Packet130UpdateSign.java.patch create mode 100644 patches/net/minecraft/src/Packet131MapData.java.patch create mode 100644 patches/net/minecraft/src/Packet132TileEntityData.java.patch create mode 100644 patches/net/minecraft/src/Packet133TileEditorOpen.java.patch create mode 100644 patches/net/minecraft/src/Packet13PlayerLookMove.java.patch create mode 100644 patches/net/minecraft/src/Packet14BlockDig.java.patch create mode 100644 patches/net/minecraft/src/Packet15Place.java.patch create mode 100644 patches/net/minecraft/src/Packet16BlockItemSwitch.java.patch create mode 100644 patches/net/minecraft/src/Packet17Sleep.java.patch create mode 100644 patches/net/minecraft/src/Packet18Animation.java.patch create mode 100644 patches/net/minecraft/src/Packet19EntityAction.java.patch create mode 100644 patches/net/minecraft/src/Packet1Login.java.patch create mode 100644 patches/net/minecraft/src/Packet200Statistic.java.patch create mode 100644 patches/net/minecraft/src/Packet201PlayerInfo.java.patch create mode 100644 patches/net/minecraft/src/Packet202PlayerAbilities.java.patch create mode 100644 patches/net/minecraft/src/Packet203AutoComplete.java.patch create mode 100644 patches/net/minecraft/src/Packet204ClientInfo.java.patch create mode 100644 patches/net/minecraft/src/Packet205ClientCommand.java.patch create mode 100644 patches/net/minecraft/src/Packet206SetObjective.java.patch create mode 100644 patches/net/minecraft/src/Packet207SetScore.java.patch create mode 100644 patches/net/minecraft/src/Packet208SetDisplayObjective.java.patch create mode 100644 patches/net/minecraft/src/Packet209SetPlayerTeam.java.patch create mode 100644 patches/net/minecraft/src/Packet20NamedEntitySpawn.java.patch create mode 100644 patches/net/minecraft/src/Packet22Collect.java.patch create mode 100644 patches/net/minecraft/src/Packet23VehicleSpawn.java.patch create mode 100644 patches/net/minecraft/src/Packet24MobSpawn.java.patch create mode 100644 patches/net/minecraft/src/Packet250CustomPayload.java.patch create mode 100644 patches/net/minecraft/src/Packet252SharedKey.java.patch create mode 100644 patches/net/minecraft/src/Packet253ServerAuthData.java.patch create mode 100644 patches/net/minecraft/src/Packet254ServerPing.java.patch create mode 100644 patches/net/minecraft/src/Packet255KickDisconnect.java.patch create mode 100644 patches/net/minecraft/src/Packet25EntityPainting.java.patch create mode 100644 patches/net/minecraft/src/Packet26EntityExpOrb.java.patch create mode 100644 patches/net/minecraft/src/Packet27PlayerInput.java.patch create mode 100644 patches/net/minecraft/src/Packet28EntityVelocity.java.patch create mode 100644 patches/net/minecraft/src/Packet29DestroyEntity.java.patch create mode 100644 patches/net/minecraft/src/Packet2ClientProtocol.java.patch create mode 100644 patches/net/minecraft/src/Packet30Entity.java.patch create mode 100644 patches/net/minecraft/src/Packet31RelEntityMove.java.patch create mode 100644 patches/net/minecraft/src/Packet32EntityLook.java.patch create mode 100644 patches/net/minecraft/src/Packet33RelEntityMoveLook.java.patch create mode 100644 patches/net/minecraft/src/Packet34EntityTeleport.java.patch create mode 100644 patches/net/minecraft/src/Packet35EntityHeadRotation.java.patch create mode 100644 patches/net/minecraft/src/Packet38EntityStatus.java.patch create mode 100644 patches/net/minecraft/src/Packet39AttachEntity.java.patch create mode 100644 patches/net/minecraft/src/Packet3Chat.java.patch create mode 100644 patches/net/minecraft/src/Packet40EntityMetadata.java.patch create mode 100644 patches/net/minecraft/src/Packet41EntityEffect.java.patch create mode 100644 patches/net/minecraft/src/Packet42RemoveEntityEffect.java.patch create mode 100644 patches/net/minecraft/src/Packet43Experience.java.patch create mode 100644 patches/net/minecraft/src/Packet44UpdateAttributes.java.patch create mode 100644 patches/net/minecraft/src/Packet44UpdateAttributesSnapshot.java.patch create mode 100644 patches/net/minecraft/src/Packet4UpdateTime.java.patch create mode 100644 patches/net/minecraft/src/Packet51MapChunk.java.patch create mode 100644 patches/net/minecraft/src/Packet52MultiBlockChange.java.patch create mode 100644 patches/net/minecraft/src/Packet53BlockChange.java.patch create mode 100644 patches/net/minecraft/src/Packet54PlayNoteBlock.java.patch create mode 100644 patches/net/minecraft/src/Packet55BlockDestroy.java.patch create mode 100644 patches/net/minecraft/src/Packet56MapChunks.java.patch create mode 100644 patches/net/minecraft/src/Packet5PlayerInventory.java.patch create mode 100644 patches/net/minecraft/src/Packet60Explosion.java.patch create mode 100644 patches/net/minecraft/src/Packet61DoorChange.java.patch create mode 100644 patches/net/minecraft/src/Packet62LevelSound.java.patch create mode 100644 patches/net/minecraft/src/Packet63WorldParticles.java.patch create mode 100644 patches/net/minecraft/src/Packet6SpawnPosition.java.patch create mode 100644 patches/net/minecraft/src/Packet70GameEvent.java.patch create mode 100644 patches/net/minecraft/src/Packet71Weather.java.patch create mode 100644 patches/net/minecraft/src/Packet7UseEntity.java.patch create mode 100644 patches/net/minecraft/src/Packet8UpdateHealth.java.patch create mode 100644 patches/net/minecraft/src/Packet9Respawn.java.patch create mode 100644 patches/net/minecraft/src/PacketCount.java.patch create mode 100644 patches/net/minecraft/src/Particle.java.patch create mode 100644 patches/net/minecraft/src/Path.java.patch create mode 100644 patches/net/minecraft/src/PathEntity.java.patch create mode 100644 patches/net/minecraft/src/PathFinder.java.patch create mode 100644 patches/net/minecraft/src/PathNavigate.java.patch create mode 100644 patches/net/minecraft/src/PathPoint.java.patch create mode 100644 patches/net/minecraft/src/PendingInvite.java.patch create mode 100644 patches/net/minecraft/src/PendingInvitesList.java.patch create mode 100644 patches/net/minecraft/src/PlayerCapabilities.java.patch create mode 100644 patches/net/minecraft/src/PlayerControllerMP.java.patch create mode 100644 patches/net/minecraft/src/PlayerInstance.java.patch create mode 100644 patches/net/minecraft/src/PlayerManager.java.patch create mode 100644 patches/net/minecraft/src/PlayerNotFoundException.java.patch create mode 100644 patches/net/minecraft/src/PlayerPositionComparator.java.patch create mode 100644 patches/net/minecraft/src/PlayerSelector.java.patch create mode 100644 patches/net/minecraft/src/PlayerUsageSnooper.java.patch create mode 100644 patches/net/minecraft/src/PlayerUsageSnooperThread.java.patch create mode 100644 patches/net/minecraft/src/PortalPosition.java.patch create mode 100644 patches/net/minecraft/src/PositionImpl.java.patch create mode 100644 patches/net/minecraft/src/PositionTextureVertex.java.patch create mode 100644 patches/net/minecraft/src/Potion.java.patch create mode 100644 patches/net/minecraft/src/PotionAbsoption.java.patch create mode 100644 patches/net/minecraft/src/PotionAttackDamage.java.patch create mode 100644 patches/net/minecraft/src/PotionEffect.java.patch create mode 100644 patches/net/minecraft/src/PotionHealth.java.patch create mode 100644 patches/net/minecraft/src/PotionHealthBoost.java.patch create mode 100644 patches/net/minecraft/src/PotionHelper.java.patch create mode 100644 patches/net/minecraft/src/Profiler.java.patch create mode 100644 patches/net/minecraft/src/ProfilerResult.java.patch create mode 100644 patches/net/minecraft/src/PropertyManager.java.patch create mode 100644 patches/net/minecraft/src/RConConsoleSource.java.patch create mode 100644 patches/net/minecraft/src/RConOutputStream.java.patch create mode 100644 patches/net/minecraft/src/RConThreadBase.java.patch create mode 100644 patches/net/minecraft/src/RConThreadClient.java.patch create mode 100644 patches/net/minecraft/src/RConThreadMain.java.patch create mode 100644 patches/net/minecraft/src/RConThreadQuery.java.patch create mode 100644 patches/net/minecraft/src/RConThreadQueryAuth.java.patch create mode 100644 patches/net/minecraft/src/RConUtils.java.patch create mode 100644 patches/net/minecraft/src/RandomPositionGenerator.java.patch create mode 100644 patches/net/minecraft/src/RangedAttribute.java.patch create mode 100644 patches/net/minecraft/src/RecipeFireworks.java.patch create mode 100644 patches/net/minecraft/src/RecipeSorter.java.patch create mode 100644 patches/net/minecraft/src/RecipesArmor.java.patch create mode 100644 patches/net/minecraft/src/RecipesArmorDyes.java.patch create mode 100644 patches/net/minecraft/src/RecipesCrafting.java.patch create mode 100644 patches/net/minecraft/src/RecipesDyes.java.patch create mode 100644 patches/net/minecraft/src/RecipesFood.java.patch create mode 100644 patches/net/minecraft/src/RecipesIngots.java.patch create mode 100644 patches/net/minecraft/src/RecipesMapCloning.java.patch create mode 100644 patches/net/minecraft/src/RecipesMapExtending.java.patch create mode 100644 patches/net/minecraft/src/RecipesTools.java.patch create mode 100644 patches/net/minecraft/src/RecipesWeapons.java.patch create mode 100644 patches/net/minecraft/src/RedstoneUpdateInfo.java.patch create mode 100644 patches/net/minecraft/src/RegionFile.java.patch create mode 100644 patches/net/minecraft/src/RegionFileCache.java.patch create mode 100644 patches/net/minecraft/src/RegionFileChunkBuffer.java.patch create mode 100644 patches/net/minecraft/src/RegistryDefaulted.java.patch create mode 100644 patches/net/minecraft/src/RegistrySimple.java.patch create mode 100644 patches/net/minecraft/src/Render.java.patch create mode 100644 patches/net/minecraft/src/RenderArrow.java.patch create mode 100644 patches/net/minecraft/src/RenderBat.java.patch create mode 100644 patches/net/minecraft/src/RenderBiped.java.patch create mode 100644 patches/net/minecraft/src/RenderBlaze.java.patch create mode 100644 patches/net/minecraft/src/RenderBlocks.java.patch create mode 100644 patches/net/minecraft/src/RenderBoat.java.patch create mode 100644 patches/net/minecraft/src/RenderCaveSpider.java.patch create mode 100644 patches/net/minecraft/src/RenderChicken.java.patch create mode 100644 patches/net/minecraft/src/RenderCow.java.patch create mode 100644 patches/net/minecraft/src/RenderCreeper.java.patch create mode 100644 patches/net/minecraft/src/RenderDragon.java.patch create mode 100644 patches/net/minecraft/src/RenderEnchantmentTable.java.patch create mode 100644 patches/net/minecraft/src/RenderEndPortal.java.patch create mode 100644 patches/net/minecraft/src/RenderEnderCrystal.java.patch create mode 100644 patches/net/minecraft/src/RenderEnderman.java.patch create mode 100644 patches/net/minecraft/src/RenderEntity.java.patch create mode 100644 patches/net/minecraft/src/RenderFallingSand.java.patch create mode 100644 patches/net/minecraft/src/RenderFireball.java.patch create mode 100644 patches/net/minecraft/src/RenderFish.java.patch create mode 100644 patches/net/minecraft/src/RenderGhast.java.patch create mode 100644 patches/net/minecraft/src/RenderGiantZombie.java.patch create mode 100644 patches/net/minecraft/src/RenderGlobal.java.patch create mode 100644 patches/net/minecraft/src/RenderHelper.java.patch create mode 100644 patches/net/minecraft/src/RenderHorse.java.patch create mode 100644 patches/net/minecraft/src/RenderIronGolem.java.patch create mode 100644 patches/net/minecraft/src/RenderItem.java.patch create mode 100644 patches/net/minecraft/src/RenderItemFrame.java.patch create mode 100644 patches/net/minecraft/src/RenderLeashKnot.java.patch create mode 100644 patches/net/minecraft/src/RenderLightningBolt.java.patch create mode 100644 patches/net/minecraft/src/RenderList.java.patch create mode 100644 patches/net/minecraft/src/RenderLiving.java.patch create mode 100644 patches/net/minecraft/src/RenderMagmaCube.java.patch create mode 100644 patches/net/minecraft/src/RenderManager.java.patch create mode 100644 patches/net/minecraft/src/RenderMinecart.java.patch create mode 100644 patches/net/minecraft/src/RenderMinecartMobSpawner.java.patch create mode 100644 patches/net/minecraft/src/RenderMooshroom.java.patch create mode 100644 patches/net/minecraft/src/RenderOcelot.java.patch create mode 100644 patches/net/minecraft/src/RenderPainting.java.patch create mode 100644 patches/net/minecraft/src/RenderPig.java.patch create mode 100644 patches/net/minecraft/src/RenderPlayer.java.patch create mode 100644 patches/net/minecraft/src/RenderSheep.java.patch create mode 100644 patches/net/minecraft/src/RenderSilverfish.java.patch create mode 100644 patches/net/minecraft/src/RenderSkeleton.java.patch create mode 100644 patches/net/minecraft/src/RenderSlime.java.patch create mode 100644 patches/net/minecraft/src/RenderSnowMan.java.patch create mode 100644 patches/net/minecraft/src/RenderSnowball.java.patch create mode 100644 patches/net/minecraft/src/RenderSorter.java.patch create mode 100644 patches/net/minecraft/src/RenderSpider.java.patch create mode 100644 patches/net/minecraft/src/RenderSquid.java.patch create mode 100644 patches/net/minecraft/src/RenderTNTPrimed.java.patch create mode 100644 patches/net/minecraft/src/RenderTntMinecart.java.patch create mode 100644 patches/net/minecraft/src/RenderVillager.java.patch create mode 100644 patches/net/minecraft/src/RenderWitch.java.patch create mode 100644 patches/net/minecraft/src/RenderWither.java.patch create mode 100644 patches/net/minecraft/src/RenderWitherSkull.java.patch create mode 100644 patches/net/minecraft/src/RenderWolf.java.patch create mode 100644 patches/net/minecraft/src/RenderXPOrb.java.patch create mode 100644 patches/net/minecraft/src/RenderZombie.java.patch create mode 100644 patches/net/minecraft/src/RendererLivingEntity.java.patch create mode 100644 patches/net/minecraft/src/ReportedException.java.patch create mode 100644 patches/net/minecraft/src/Request.java.patch create mode 100644 patches/net/minecraft/src/RequestDelete.java.patch create mode 100644 patches/net/minecraft/src/RequestGet.java.patch create mode 100644 patches/net/minecraft/src/RequestPost.java.patch create mode 100644 patches/net/minecraft/src/RequestPut.java.patch create mode 100644 patches/net/minecraft/src/ResourceLocation.java.patch create mode 100644 patches/net/minecraft/src/ResourcePackFileNotFoundException.java.patch create mode 100644 patches/net/minecraft/src/ResourcePackRepository.java.patch create mode 100644 patches/net/minecraft/src/ResourcePackRepositoryEntry.java.patch create mode 100644 patches/net/minecraft/src/ResourcePackRepositoryFilter.java.patch create mode 100644 patches/net/minecraft/src/RunnableTitleScreen.java.patch create mode 100644 patches/net/minecraft/src/SaveFormatComparator.java.patch create mode 100644 patches/net/minecraft/src/SaveFormatOld.java.patch create mode 100644 patches/net/minecraft/src/SaveHandler.java.patch create mode 100644 patches/net/minecraft/src/SaveHandlerMP.java.patch create mode 100644 patches/net/minecraft/src/ScaledResolution.java.patch create mode 100644 patches/net/minecraft/src/ScheduledSound.java.patch create mode 100644 patches/net/minecraft/src/Score.java.patch create mode 100644 patches/net/minecraft/src/ScoreComparator.java.patch create mode 100644 patches/net/minecraft/src/ScoreDummyCriteria.java.patch create mode 100644 patches/net/minecraft/src/ScoreHealthCriteria.java.patch create mode 100644 patches/net/minecraft/src/ScoreObjective.java.patch create mode 100644 patches/net/minecraft/src/ScoreObjectiveCriteria.java.patch create mode 100644 patches/net/minecraft/src/ScorePlayerTeam.java.patch create mode 100644 patches/net/minecraft/src/Scoreboard.java.patch create mode 100644 patches/net/minecraft/src/ScoreboardSaveData.java.patch create mode 100644 patches/net/minecraft/src/ScreenChatOptions.java.patch create mode 100644 patches/net/minecraft/src/ScreenShotHelper.java.patch create mode 100644 patches/net/minecraft/src/SelectionListBase.java.patch create mode 100644 patches/net/minecraft/src/SelectionListInvited.java.patch create mode 100644 patches/net/minecraft/src/ServerAddress.java.patch create mode 100644 patches/net/minecraft/src/ServerBlockEventList.java.patch create mode 100644 patches/net/minecraft/src/ServerCommand.java.patch create mode 100644 patches/net/minecraft/src/ServerCommandManager.java.patch create mode 100644 patches/net/minecraft/src/ServerCommandScoreboard.java.patch create mode 100644 patches/net/minecraft/src/ServerCommandTestFor.java.patch create mode 100644 patches/net/minecraft/src/ServerConfigurationManager.java.patch create mode 100644 patches/net/minecraft/src/ServerData.java.patch create mode 100644 patches/net/minecraft/src/ServerList.java.patch create mode 100644 patches/net/minecraft/src/ServerListenThread.java.patch create mode 100644 patches/net/minecraft/src/ServerScoreboard.java.patch create mode 100644 patches/net/minecraft/src/ServersideAttributeMap.java.patch create mode 100644 patches/net/minecraft/src/Session.java.patch create mode 100644 patches/net/minecraft/src/ShapedRecipes.java.patch create mode 100644 patches/net/minecraft/src/ShapelessRecipes.java.patch create mode 100644 patches/net/minecraft/src/SharedMonsterAttributes.java.patch create mode 100644 patches/net/minecraft/src/SimpleReloadableResourceManager.java.patch create mode 100644 patches/net/minecraft/src/SimpleReloadableResourceManagerINNER1.java.patch create mode 100644 patches/net/minecraft/src/SimpleResource.java.patch create mode 100644 patches/net/minecraft/src/SimpleTexture.java.patch create mode 100644 patches/net/minecraft/src/Slot.java.patch create mode 100644 patches/net/minecraft/src/SlotArmor.java.patch create mode 100644 patches/net/minecraft/src/SlotBeacon.java.patch create mode 100644 patches/net/minecraft/src/SlotBrewingStandIngredient.java.patch create mode 100644 patches/net/minecraft/src/SlotBrewingStandPotion.java.patch create mode 100644 patches/net/minecraft/src/SlotCrafting.java.patch create mode 100644 patches/net/minecraft/src/SlotCreativeInventory.java.patch create mode 100644 patches/net/minecraft/src/SlotEnchantment.java.patch create mode 100644 patches/net/minecraft/src/SlotEnchantmentTable.java.patch create mode 100644 patches/net/minecraft/src/SlotFurnace.java.patch create mode 100644 patches/net/minecraft/src/SlotMerchantResult.java.patch create mode 100644 patches/net/minecraft/src/SorterStatsBlock.java.patch create mode 100644 patches/net/minecraft/src/SorterStatsItem.java.patch create mode 100644 patches/net/minecraft/src/SoundManager.java.patch create mode 100644 patches/net/minecraft/src/SoundManagerINNER1.java.patch create mode 100644 patches/net/minecraft/src/SoundPool.java.patch create mode 100644 patches/net/minecraft/src/SoundPoolEntry.java.patch create mode 100644 patches/net/minecraft/src/SoundPoolProtocolHandler.java.patch create mode 100644 patches/net/minecraft/src/SoundPoolURLConnection.java.patch create mode 100644 patches/net/minecraft/src/SoundUpdaterMinecart.java.patch create mode 100644 patches/net/minecraft/src/SpawnListEntry.java.patch create mode 100644 patches/net/minecraft/src/SpawnerAnimals.java.patch create mode 100644 patches/net/minecraft/src/SpiderEffectsGroupData.java.patch create mode 100644 patches/net/minecraft/src/StatBase.java.patch create mode 100644 patches/net/minecraft/src/StatBasic.java.patch create mode 100644 patches/net/minecraft/src/StatCollector.java.patch create mode 100644 patches/net/minecraft/src/StatCrafting.java.patch create mode 100644 patches/net/minecraft/src/StatFileWriter.java.patch create mode 100644 patches/net/minecraft/src/StatList.java.patch create mode 100644 patches/net/minecraft/src/StatPlaceholder.java.patch create mode 100644 patches/net/minecraft/src/StatStringFormatKeyInv.java.patch create mode 100644 patches/net/minecraft/src/StatTypeDistance.java.patch create mode 100644 patches/net/minecraft/src/StatTypeFloat.java.patch create mode 100644 patches/net/minecraft/src/StatTypeSimple.java.patch create mode 100644 patches/net/minecraft/src/StatTypeTime.java.patch create mode 100644 patches/net/minecraft/src/StatsSyncher.java.patch create mode 100644 patches/net/minecraft/src/StepSound.java.patch create mode 100644 patches/net/minecraft/src/StepSoundAnvil.java.patch create mode 100644 patches/net/minecraft/src/StepSoundSand.java.patch create mode 100644 patches/net/minecraft/src/StepSoundStone.java.patch create mode 100644 patches/net/minecraft/src/StitchHolder.java.patch create mode 100644 patches/net/minecraft/src/StitchSlot.java.patch create mode 100644 patches/net/minecraft/src/Stitcher.java.patch create mode 100644 patches/net/minecraft/src/StitcherException.java.patch create mode 100644 patches/net/minecraft/src/StringTranslate.java.patch create mode 100644 patches/net/minecraft/src/StringUtils.java.patch create mode 100644 patches/net/minecraft/src/StructureBoundingBox.java.patch create mode 100644 patches/net/minecraft/src/StructureComponent.java.patch create mode 100644 patches/net/minecraft/src/StructureMineshaftPieces.java.patch create mode 100644 patches/net/minecraft/src/StructureMineshaftStart.java.patch create mode 100644 patches/net/minecraft/src/StructureNetherBridgePieceWeight.java.patch create mode 100644 patches/net/minecraft/src/StructureNetherBridgePieces.java.patch create mode 100644 patches/net/minecraft/src/StructureNetherBridgeStart.java.patch create mode 100644 patches/net/minecraft/src/StructurePieceBlockSelector.java.patch create mode 100644 patches/net/minecraft/src/StructureScatteredFeatureStart.java.patch create mode 100644 patches/net/minecraft/src/StructureScatteredFeatureStones.java.patch create mode 100644 patches/net/minecraft/src/StructureStart.java.patch create mode 100644 patches/net/minecraft/src/StructureStrongholdPieceWeight.java.patch create mode 100644 patches/net/minecraft/src/StructureStrongholdPieceWeight2.java.patch create mode 100644 patches/net/minecraft/src/StructureStrongholdPieceWeight3.java.patch create mode 100644 patches/net/minecraft/src/StructureStrongholdPieces.java.patch create mode 100644 patches/net/minecraft/src/StructureStrongholdStart.java.patch create mode 100644 patches/net/minecraft/src/StructureStrongholdStones.java.patch create mode 100644 patches/net/minecraft/src/StructureVillagePieceWeight.java.patch create mode 100644 patches/net/minecraft/src/StructureVillagePieces.java.patch create mode 100644 patches/net/minecraft/src/StructureVillageStart.java.patch create mode 100644 patches/net/minecraft/src/SyntaxErrorException.java.patch create mode 100644 patches/net/minecraft/src/TaskLongRunning.java.patch create mode 100644 patches/net/minecraft/src/TaskOnlineConnect.java.patch create mode 100644 patches/net/minecraft/src/TaskResetWorld.java.patch create mode 100644 patches/net/minecraft/src/TaskWorldCreation.java.patch create mode 100644 patches/net/minecraft/src/TcpConnection.java.patch create mode 100644 patches/net/minecraft/src/TcpMasterThread.java.patch create mode 100644 patches/net/minecraft/src/TcpMonitorThread.java.patch create mode 100644 patches/net/minecraft/src/TcpReaderThread.java.patch create mode 100644 patches/net/minecraft/src/TcpWriterThread.java.patch create mode 100644 patches/net/minecraft/src/Team.java.patch create mode 100644 patches/net/minecraft/src/Teleporter.java.patch create mode 100644 patches/net/minecraft/src/Tessellator.java.patch create mode 100644 patches/net/minecraft/src/TextureAtlasSprite.java.patch create mode 100644 patches/net/minecraft/src/TextureClock.java.patch create mode 100644 patches/net/minecraft/src/TextureCompass.java.patch create mode 100644 patches/net/minecraft/src/TextureManager.java.patch create mode 100644 patches/net/minecraft/src/TextureManagerINNER1.java.patch create mode 100644 patches/net/minecraft/src/TextureMap.java.patch create mode 100644 patches/net/minecraft/src/TextureMetadataSection.java.patch create mode 100644 patches/net/minecraft/src/TextureMetadataSectionSerializer.java.patch create mode 100644 patches/net/minecraft/src/TextureOffset.java.patch create mode 100644 patches/net/minecraft/src/TextureUtil.java.patch create mode 100644 patches/net/minecraft/src/TexturedQuad.java.patch create mode 100644 patches/net/minecraft/src/ThreadClientSleep.java.patch create mode 100644 patches/net/minecraft/src/ThreadConnectToOnlineServer.java.patch create mode 100644 patches/net/minecraft/src/ThreadConnectToServer.java.patch create mode 100644 patches/net/minecraft/src/ThreadDownloadImage.java.patch create mode 100644 patches/net/minecraft/src/ThreadDownloadImageData.java.patch create mode 100644 patches/net/minecraft/src/ThreadDownloadImageDataINNER1.java.patch create mode 100644 patches/net/minecraft/src/ThreadLanServerFind.java.patch create mode 100644 patches/net/minecraft/src/ThreadLanServerPing.java.patch create mode 100644 patches/net/minecraft/src/ThreadLoginVerifier.java.patch create mode 100644 patches/net/minecraft/src/ThreadMinecraftServer.java.patch create mode 100644 patches/net/minecraft/src/ThreadOnlineConnect.java.patch create mode 100644 patches/net/minecraft/src/ThreadOnlineScreen.java.patch create mode 100644 patches/net/minecraft/src/ThreadPollServers.java.patch create mode 100644 patches/net/minecraft/src/ThreadStatSyncherReceive.java.patch create mode 100644 patches/net/minecraft/src/ThreadStatSyncherSend.java.patch create mode 100644 patches/net/minecraft/src/ThreadedFileIOBase.java.patch create mode 100644 patches/net/minecraft/src/TileEntity.java.patch create mode 100644 patches/net/minecraft/src/TileEntityBeacon.java.patch create mode 100644 patches/net/minecraft/src/TileEntityBeaconRenderer.java.patch create mode 100644 patches/net/minecraft/src/TileEntityBrewingStand.java.patch create mode 100644 patches/net/minecraft/src/TileEntityChest.java.patch create mode 100644 patches/net/minecraft/src/TileEntityChestRenderer.java.patch create mode 100644 patches/net/minecraft/src/TileEntityCommandBlock.java.patch create mode 100644 patches/net/minecraft/src/TileEntityComparator.java.patch create mode 100644 patches/net/minecraft/src/TileEntityDaylightDetector.java.patch create mode 100644 patches/net/minecraft/src/TileEntityDispenser.java.patch create mode 100644 patches/net/minecraft/src/TileEntityDropper.java.patch create mode 100644 patches/net/minecraft/src/TileEntityEnchantmentTable.java.patch create mode 100644 patches/net/minecraft/src/TileEntityEnderChest.java.patch create mode 100644 patches/net/minecraft/src/TileEntityEnderChestRenderer.java.patch create mode 100644 patches/net/minecraft/src/TileEntityFurnace.java.patch create mode 100644 patches/net/minecraft/src/TileEntityHopper.java.patch create mode 100644 patches/net/minecraft/src/TileEntityMobSpawner.java.patch create mode 100644 patches/net/minecraft/src/TileEntityMobSpawnerLogic.java.patch create mode 100644 patches/net/minecraft/src/TileEntityMobSpawnerRenderer.java.patch create mode 100644 patches/net/minecraft/src/TileEntityNote.java.patch create mode 100644 patches/net/minecraft/src/TileEntityPiston.java.patch create mode 100644 patches/net/minecraft/src/TileEntityRecordPlayer.java.patch create mode 100644 patches/net/minecraft/src/TileEntityRenderer.java.patch create mode 100644 patches/net/minecraft/src/TileEntityRendererPiston.java.patch create mode 100644 patches/net/minecraft/src/TileEntitySign.java.patch create mode 100644 patches/net/minecraft/src/TileEntitySignRenderer.java.patch create mode 100644 patches/net/minecraft/src/TileEntitySkull.java.patch create mode 100644 patches/net/minecraft/src/TileEntitySkullRenderer.java.patch create mode 100644 patches/net/minecraft/src/TileEntitySpecialRenderer.java.patch create mode 100644 patches/net/minecraft/src/Timer.java.patch create mode 100644 patches/net/minecraft/src/Tuple.java.patch create mode 100644 patches/net/minecraft/src/ValueObject.java.patch create mode 100644 patches/net/minecraft/src/ValueObjectList.java.patch create mode 100644 patches/net/minecraft/src/ValueObjectSubscription.java.patch create mode 100644 patches/net/minecraft/src/Vec3.java.patch create mode 100644 patches/net/minecraft/src/Vec3Pool.java.patch create mode 100644 patches/net/minecraft/src/Village.java.patch create mode 100644 patches/net/minecraft/src/VillageAgressor.java.patch create mode 100644 patches/net/minecraft/src/VillageCollection.java.patch create mode 100644 patches/net/minecraft/src/VillageDoorInfo.java.patch create mode 100644 patches/net/minecraft/src/VillageSiege.java.patch create mode 100644 patches/net/minecraft/src/WatchableObject.java.patch create mode 100644 patches/net/minecraft/src/WeightedRandom.java.patch create mode 100644 patches/net/minecraft/src/WeightedRandomChestContent.java.patch create mode 100644 patches/net/minecraft/src/WeightedRandomItem.java.patch create mode 100644 patches/net/minecraft/src/WeightedRandomMinecart.java.patch create mode 100644 patches/net/minecraft/src/World.java.patch create mode 100644 patches/net/minecraft/src/WorldChunkManager.java.patch create mode 100644 patches/net/minecraft/src/WorldChunkManagerHell.java.patch create mode 100644 patches/net/minecraft/src/WorldClient.java.patch create mode 100644 patches/net/minecraft/src/WorldClientINNER3.java.patch create mode 100644 patches/net/minecraft/src/WorldClientINNER4.java.patch create mode 100644 patches/net/minecraft/src/WorldGenBigMushroom.java.patch create mode 100644 patches/net/minecraft/src/WorldGenBigTree.java.patch create mode 100644 patches/net/minecraft/src/WorldGenCactus.java.patch create mode 100644 patches/net/minecraft/src/WorldGenClay.java.patch create mode 100644 patches/net/minecraft/src/WorldGenDeadBush.java.patch create mode 100644 patches/net/minecraft/src/WorldGenDesertWells.java.patch create mode 100644 patches/net/minecraft/src/WorldGenDungeons.java.patch create mode 100644 patches/net/minecraft/src/WorldGenFire.java.patch create mode 100644 patches/net/minecraft/src/WorldGenFlowers.java.patch create mode 100644 patches/net/minecraft/src/WorldGenForest.java.patch create mode 100644 patches/net/minecraft/src/WorldGenGlowStone1.java.patch create mode 100644 patches/net/minecraft/src/WorldGenGlowStone2.java.patch create mode 100644 patches/net/minecraft/src/WorldGenHellLava.java.patch create mode 100644 patches/net/minecraft/src/WorldGenHugeTrees.java.patch create mode 100644 patches/net/minecraft/src/WorldGenLakes.java.patch create mode 100644 patches/net/minecraft/src/WorldGenLiquids.java.patch create mode 100644 patches/net/minecraft/src/WorldGenMinable.java.patch create mode 100644 patches/net/minecraft/src/WorldGenPumpkin.java.patch create mode 100644 patches/net/minecraft/src/WorldGenReed.java.patch create mode 100644 patches/net/minecraft/src/WorldGenSand.java.patch create mode 100644 patches/net/minecraft/src/WorldGenShrub.java.patch create mode 100644 patches/net/minecraft/src/WorldGenSpikes.java.patch create mode 100644 patches/net/minecraft/src/WorldGenSwamp.java.patch create mode 100644 patches/net/minecraft/src/WorldGenTaiga1.java.patch create mode 100644 patches/net/minecraft/src/WorldGenTaiga2.java.patch create mode 100644 patches/net/minecraft/src/WorldGenTallGrass.java.patch create mode 100644 patches/net/minecraft/src/WorldGenTrees.java.patch create mode 100644 patches/net/minecraft/src/WorldGenVines.java.patch create mode 100644 patches/net/minecraft/src/WorldGenWaterlily.java.patch create mode 100644 patches/net/minecraft/src/WorldGenerator.java.patch create mode 100644 patches/net/minecraft/src/WorldGeneratorBonusChest.java.patch create mode 100644 patches/net/minecraft/src/WorldInfo.java.patch create mode 100644 patches/net/minecraft/src/WorldManager.java.patch create mode 100644 patches/net/minecraft/src/WorldProvider.java.patch create mode 100644 patches/net/minecraft/src/WorldProviderEnd.java.patch create mode 100644 patches/net/minecraft/src/WorldProviderHell.java.patch create mode 100644 patches/net/minecraft/src/WorldProviderSurface.java.patch create mode 100644 patches/net/minecraft/src/WorldRenderer.java.patch create mode 100644 patches/net/minecraft/src/WorldSavedData.java.patch create mode 100644 patches/net/minecraft/src/WorldServer.java.patch create mode 100644 patches/net/minecraft/src/WorldServerMulti.java.patch create mode 100644 patches/net/minecraft/src/WorldSettings.java.patch create mode 100644 patches/net/minecraft/src/WorldTemplate.java.patch create mode 100644 patches/net/minecraft/src/WorldTemplateList.java.patch create mode 100644 patches/net/minecraft/src/WorldType.java.patch create mode 100644 patches/net/minecraft/src/WrongUsageException.java.patch create mode 100644 patches/org/bukkit/ChatColor.java.patch create mode 100644 patches/org/bukkit/util/FileUtil.java.patch create mode 100644 patches/org/bukkit/util/Java15Compat.java.patch create mode 100644 patches/org/bukkit/util/config/Configuration.java.patch create mode 100644 patches/org/bukkit/util/config/ConfigurationException.java.patch create mode 100644 patches/org/bukkit/util/config/ConfigurationNode.java.patch create mode 100644 patches/org/spoutcraft/api/Achievement.java.patch create mode 100644 patches/org/spoutcraft/api/AnimatableLocation.java.patch create mode 100644 patches/org/spoutcraft/api/Art.java.patch create mode 100644 patches/org/spoutcraft/api/BlockChangeDelegate.java.patch create mode 100644 patches/org/spoutcraft/api/ChatColor.java.patch create mode 100644 patches/org/spoutcraft/api/Client.java.patch create mode 100644 patches/org/spoutcraft/api/Effect.java.patch create mode 100644 patches/org/spoutcraft/api/GameMode.java.patch create mode 100644 patches/org/spoutcraft/api/Instrument.java.patch create mode 100644 patches/org/spoutcraft/api/MPOnly.java.patch create mode 100644 patches/org/spoutcraft/api/NotImplemented.java.patch create mode 100644 patches/org/spoutcraft/api/Note.java.patch create mode 100644 patches/org/spoutcraft/api/SPOnly.java.patch create mode 100644 patches/org/spoutcraft/api/Spoutcraft.java.patch create mode 100644 patches/org/spoutcraft/api/Statistic.java.patch create mode 100644 patches/org/spoutcraft/api/TreeType.java.patch create mode 100644 patches/org/spoutcraft/api/UnsafeClass.java.patch create mode 100644 patches/org/spoutcraft/api/UnsafeConstructor.java.patch create mode 100644 patches/org/spoutcraft/api/UnsafeMethod.java.patch create mode 100644 patches/org/spoutcraft/api/animation/Animatable.java.patch create mode 100644 patches/org/spoutcraft/api/animation/Animation.java.patch create mode 100644 patches/org/spoutcraft/api/animation/AnimationProgress.java.patch create mode 100644 patches/org/spoutcraft/api/animation/ExponentialAnimationProgress.java.patch create mode 100644 patches/org/spoutcraft/api/animation/InQuadAnimationProgress.java.patch create mode 100644 patches/org/spoutcraft/api/animation/LinearAnimationProgress.java.patch create mode 100644 patches/org/spoutcraft/api/animation/LogarithmicAnimationProgress.java.patch create mode 100644 patches/org/spoutcraft/api/animation/OutQuadAnimationProgress.java.patch create mode 100644 patches/org/spoutcraft/api/animation/PropertyAnimation.java.patch create mode 100644 patches/org/spoutcraft/api/animation/PropertyDelegate.java.patch create mode 100644 patches/org/spoutcraft/api/animation/ValueSetDelegate.java.patch create mode 100644 patches/org/spoutcraft/api/block/design/BlockDesign.java.patch create mode 100644 patches/org/spoutcraft/api/block/design/GenericBlockDesign.java.patch create mode 100644 patches/org/spoutcraft/api/block/design/GenericCubeBlockDesign.java.patch create mode 100644 patches/org/spoutcraft/api/block/design/Quad.java.patch create mode 100644 patches/org/spoutcraft/api/block/design/SubTexture.java.patch create mode 100644 patches/org/spoutcraft/api/block/design/Texture.java.patch create mode 100644 patches/org/spoutcraft/api/block/design/Vertex.java.patch create mode 100644 patches/org/spoutcraft/api/entity/EntitySkinType.java.patch create mode 100644 patches/org/spoutcraft/api/gui/AbstractListModel.java.patch create mode 100644 patches/org/spoutcraft/api/gui/ArmorBar.java.patch create mode 100644 patches/org/spoutcraft/api/gui/BasicLabel.java.patch create mode 100644 patches/org/spoutcraft/api/gui/Bitmap.java.patch create mode 100644 patches/org/spoutcraft/api/gui/BubbleBar.java.patch create mode 100644 patches/org/spoutcraft/api/gui/Button.java.patch create mode 100644 patches/org/spoutcraft/api/gui/ChatBar.java.patch create mode 100644 patches/org/spoutcraft/api/gui/ChatTextBox.java.patch create mode 100644 patches/org/spoutcraft/api/gui/CheckBox.java.patch create mode 100644 patches/org/spoutcraft/api/gui/Color.java.patch create mode 100644 patches/org/spoutcraft/api/gui/ComboBox.java.patch create mode 100644 patches/org/spoutcraft/api/gui/Container.java.patch create mode 100644 patches/org/spoutcraft/api/gui/ContainerType.java.patch create mode 100644 patches/org/spoutcraft/api/gui/Control.java.patch create mode 100644 patches/org/spoutcraft/api/gui/DirtBackground.java.patch create mode 100644 patches/org/spoutcraft/api/gui/EntityWidget.java.patch create mode 100644 patches/org/spoutcraft/api/gui/ExpBar.java.patch create mode 100644 patches/org/spoutcraft/api/gui/GenericBitmap.java.patch create mode 100644 patches/org/spoutcraft/api/gui/GenericButton.java.patch create mode 100644 patches/org/spoutcraft/api/gui/GenericCheckBox.java.patch create mode 100644 patches/org/spoutcraft/api/gui/GenericComboBox.java.patch create mode 100644 patches/org/spoutcraft/api/gui/GenericContainer.java.patch create mode 100644 patches/org/spoutcraft/api/gui/GenericControl.java.patch create mode 100644 patches/org/spoutcraft/api/gui/GenericEntityWidget.java.patch create mode 100644 patches/org/spoutcraft/api/gui/GenericGradient.java.patch create mode 100644 patches/org/spoutcraft/api/gui/GenericItemWidget.java.patch create mode 100644 patches/org/spoutcraft/api/gui/GenericLabel.java.patch create mode 100644 patches/org/spoutcraft/api/gui/GenericListView.java.patch create mode 100644 patches/org/spoutcraft/api/gui/GenericListWidget.java.patch create mode 100644 patches/org/spoutcraft/api/gui/GenericListWidgetItem.java.patch create mode 100644 patches/org/spoutcraft/api/gui/GenericOverlayScreen.java.patch create mode 100644 patches/org/spoutcraft/api/gui/GenericPolygon.java.patch create mode 100644 patches/org/spoutcraft/api/gui/GenericPopup.java.patch create mode 100644 patches/org/spoutcraft/api/gui/GenericRadioButton.java.patch create mode 100644 patches/org/spoutcraft/api/gui/GenericRectangle.java.patch create mode 100644 patches/org/spoutcraft/api/gui/GenericScreen.java.patch create mode 100644 patches/org/spoutcraft/api/gui/GenericScrollArea.java.patch create mode 100644 patches/org/spoutcraft/api/gui/GenericScrollable.java.patch create mode 100644 patches/org/spoutcraft/api/gui/GenericSlider.java.patch create mode 100644 patches/org/spoutcraft/api/gui/GenericSlot.java.patch create mode 100644 patches/org/spoutcraft/api/gui/GenericTextField.java.patch create mode 100644 patches/org/spoutcraft/api/gui/GenericTextProcessor.java.patch create mode 100644 patches/org/spoutcraft/api/gui/GenericTexture.java.patch create mode 100644 patches/org/spoutcraft/api/gui/GenericWidget.java.patch create mode 100644 patches/org/spoutcraft/api/gui/Gradient.java.patch create mode 100644 patches/org/spoutcraft/api/gui/HealthBar.java.patch create mode 100644 patches/org/spoutcraft/api/gui/HungerBar.java.patch create mode 100644 patches/org/spoutcraft/api/gui/InGameHUD.java.patch create mode 100644 patches/org/spoutcraft/api/gui/ItemWidget.java.patch create mode 100644 patches/org/spoutcraft/api/gui/KeyManager.java.patch create mode 100644 patches/org/spoutcraft/api/gui/Keyboard.java.patch create mode 100644 patches/org/spoutcraft/api/gui/Label.java.patch create mode 100644 patches/org/spoutcraft/api/gui/ListWidget.java.patch create mode 100644 patches/org/spoutcraft/api/gui/ListWidgetItem.java.patch create mode 100644 patches/org/spoutcraft/api/gui/MinecraftFont.java.patch create mode 100644 patches/org/spoutcraft/api/gui/MinecraftTessellator.java.patch create mode 100644 patches/org/spoutcraft/api/gui/Orientation.java.patch create mode 100644 patches/org/spoutcraft/api/gui/OverlayScreen.java.patch create mode 100644 patches/org/spoutcraft/api/gui/PasswordTextProcessor.java.patch create mode 100644 patches/org/spoutcraft/api/gui/Point.java.patch create mode 100644 patches/org/spoutcraft/api/gui/Polygon.java.patch create mode 100644 patches/org/spoutcraft/api/gui/PopupScreen.java.patch create mode 100644 patches/org/spoutcraft/api/gui/PositionOrientation.java.patch create mode 100644 patches/org/spoutcraft/api/gui/RadioButton.java.patch create mode 100644 patches/org/spoutcraft/api/gui/Rectangle.java.patch create mode 100644 patches/org/spoutcraft/api/gui/RenderDelegate.java.patch create mode 100644 patches/org/spoutcraft/api/gui/RenderPriority.java.patch create mode 100644 patches/org/spoutcraft/api/gui/RenderUtil.java.patch create mode 100644 patches/org/spoutcraft/api/gui/Screen.java.patch create mode 100644 patches/org/spoutcraft/api/gui/ScreenType.java.patch create mode 100644 patches/org/spoutcraft/api/gui/ScrollArea.java.patch create mode 100644 patches/org/spoutcraft/api/gui/ScrollBarPolicy.java.patch create mode 100644 patches/org/spoutcraft/api/gui/Scrollable.java.patch create mode 100644 patches/org/spoutcraft/api/gui/ServerPlayerList.java.patch create mode 100644 patches/org/spoutcraft/api/gui/Slider.java.patch create mode 100644 patches/org/spoutcraft/api/gui/Slot.java.patch create mode 100644 patches/org/spoutcraft/api/gui/SolidBackground.java.patch create mode 100644 patches/org/spoutcraft/api/gui/TextField.java.patch create mode 100644 patches/org/spoutcraft/api/gui/TextProcessor.java.patch create mode 100644 patches/org/spoutcraft/api/gui/Texture.java.patch create mode 100644 patches/org/spoutcraft/api/gui/Widget.java.patch create mode 100644 patches/org/spoutcraft/api/gui/WidgetAnchor.java.patch create mode 100644 patches/org/spoutcraft/api/gui/WidgetAnim.java.patch create mode 100644 patches/org/spoutcraft/api/gui/WidgetManager.java.patch create mode 100644 patches/org/spoutcraft/api/gui/WidgetType.java.patch create mode 100644 patches/org/spoutcraft/api/inventory/Inventory.java.patch create mode 100644 patches/org/spoutcraft/api/inventory/InventoryBuilder.java.patch create mode 100644 patches/org/spoutcraft/api/inventory/ItemStack.java.patch create mode 100644 patches/org/spoutcraft/api/inventory/MaterialManager.java.patch create mode 100644 patches/org/spoutcraft/api/inventory/PlayerInventory.java.patch create mode 100644 patches/org/spoutcraft/api/inventory/Recipe.java.patch create mode 100644 patches/org/spoutcraft/api/inventory/ShapedRecipe.java.patch create mode 100644 patches/org/spoutcraft/api/inventory/ShapelessRecipe.java.patch create mode 100644 patches/org/spoutcraft/api/io/SpoutInputStream.java.patch create mode 100644 patches/org/spoutcraft/api/io/SpoutOutputStream.java.patch create mode 100644 patches/org/spoutcraft/api/keyboard/AbstractBinding.java.patch create mode 100644 patches/org/spoutcraft/api/keyboard/BindingExecutionDelegate.java.patch create mode 100644 patches/org/spoutcraft/api/keyboard/KeyBinding.java.patch create mode 100644 patches/org/spoutcraft/api/keyboard/KeyBindingManager.java.patch create mode 100644 patches/org/spoutcraft/api/keyboard/KeyBindingPress.java.patch create mode 100644 patches/org/spoutcraft/api/material/Armor.java.patch create mode 100644 patches/org/spoutcraft/api/material/Block.java.patch create mode 100644 patches/org/spoutcraft/api/material/CustomBlock.java.patch create mode 100644 patches/org/spoutcraft/api/material/CustomItem.java.patch create mode 100644 patches/org/spoutcraft/api/material/Food.java.patch create mode 100644 patches/org/spoutcraft/api/material/Item.java.patch create mode 100644 patches/org/spoutcraft/api/material/Liquid.java.patch create mode 100644 patches/org/spoutcraft/api/material/Material.java.patch create mode 100644 patches/org/spoutcraft/api/material/MaterialData.java.patch create mode 100644 patches/org/spoutcraft/api/material/Plant.java.patch create mode 100644 patches/org/spoutcraft/api/material/SolidBlock.java.patch create mode 100644 patches/org/spoutcraft/api/material/Tool.java.patch create mode 100644 patches/org/spoutcraft/api/material/Weapon.java.patch create mode 100644 patches/org/spoutcraft/api/material/block/Air.java.patch create mode 100644 patches/org/spoutcraft/api/material/block/DoubleSlabs.java.patch create mode 100644 patches/org/spoutcraft/api/material/block/GenericBlock.java.patch create mode 100644 patches/org/spoutcraft/api/material/block/GenericCubeCustomBlock.java.patch create mode 100644 patches/org/spoutcraft/api/material/block/GenericCustomBlock.java.patch create mode 100644 patches/org/spoutcraft/api/material/block/GenericLiquid.java.patch create mode 100644 patches/org/spoutcraft/api/material/block/Grass.java.patch create mode 100644 patches/org/spoutcraft/api/material/block/LongGrass.java.patch create mode 100644 patches/org/spoutcraft/api/material/block/Sapling.java.patch create mode 100644 patches/org/spoutcraft/api/material/block/Slab.java.patch create mode 100644 patches/org/spoutcraft/api/material/block/Solid.java.patch create mode 100644 patches/org/spoutcraft/api/material/block/StoneBricks.java.patch create mode 100644 patches/org/spoutcraft/api/material/block/Tree.java.patch create mode 100644 patches/org/spoutcraft/api/material/block/Wool.java.patch create mode 100644 patches/org/spoutcraft/api/material/item/Coal.java.patch create mode 100644 patches/org/spoutcraft/api/material/item/Dye.java.patch create mode 100644 patches/org/spoutcraft/api/material/item/GenericArmor.java.patch create mode 100644 patches/org/spoutcraft/api/material/item/GenericCustomFood.java.patch create mode 100644 patches/org/spoutcraft/api/material/item/GenericCustomItem.java.patch create mode 100644 patches/org/spoutcraft/api/material/item/GenericCustomTool.java.patch create mode 100644 patches/org/spoutcraft/api/material/item/GenericFood.java.patch create mode 100644 patches/org/spoutcraft/api/material/item/GenericItem.java.patch create mode 100644 patches/org/spoutcraft/api/material/item/GenericTool.java.patch create mode 100644 patches/org/spoutcraft/api/material/item/GenericWeapon.java.patch create mode 100644 patches/org/spoutcraft/api/material/item/Potion.java.patch create mode 100644 patches/org/spoutcraft/api/material/item/SpawnEgg.java.patch create mode 100644 patches/org/spoutcraft/api/packet/PacketUtil.java.patch create mode 100644 patches/org/spoutcraft/api/player/BiomeManager.java.patch create mode 100644 patches/org/spoutcraft/api/player/ChatManager.java.patch create mode 100644 patches/org/spoutcraft/api/player/ChatMessage.java.patch create mode 100644 patches/org/spoutcraft/api/player/RenderDistance.java.patch create mode 100644 patches/org/spoutcraft/api/player/SkyManager.java.patch create mode 100644 patches/org/spoutcraft/api/property/Property.java.patch create mode 100644 patches/org/spoutcraft/api/property/PropertyInterface.java.patch create mode 100644 patches/org/spoutcraft/api/property/PropertyObject.java.patch create mode 100644 patches/org/spoutcraft/api/sound/Music.java.patch create mode 100644 patches/org/spoutcraft/api/sound/SoundEffect.java.patch create mode 100644 patches/org/spoutcraft/api/util/FastLocation.java.patch create mode 100644 patches/org/spoutcraft/api/util/FastVector.java.patch create mode 100644 patches/org/spoutcraft/api/util/FixedLocation.java.patch create mode 100644 patches/org/spoutcraft/api/util/FixedVector.java.patch create mode 100644 patches/org/spoutcraft/api/util/Location.java.patch create mode 100644 patches/org/spoutcraft/api/util/MutableIntegerVector.java.patch create mode 100644 patches/org/spoutcraft/api/util/MutableLocation.java.patch create mode 100644 patches/org/spoutcraft/api/util/MutableVector.java.patch create mode 100644 patches/org/spoutcraft/api/util/UniqueItemStringMap.java.patch create mode 100644 patches/org/spoutcraft/api/util/Vector.java.patch create mode 100644 patches/org/spoutcraft/api/util/map/TIntPairFloatHashMap.java.patch create mode 100644 patches/org/spoutcraft/api/util/map/TIntPairIntHashMap.java.patch create mode 100644 patches/org/spoutcraft/api/util/map/TIntPairObjectHashMap.java.patch create mode 100644 patches/org/spoutcraft/client/ChunkComparator.java.patch create mode 100644 patches/org/spoutcraft/client/ClipboardThread.java.patch create mode 100644 patches/org/spoutcraft/client/DataMiningThread.java.patch create mode 100644 patches/org/spoutcraft/client/HDImageBufferDownload.java.patch create mode 100644 patches/org/spoutcraft/client/MCItemStackComparator.java.patch create mode 100644 patches/org/spoutcraft/client/PacketDecompressionThread.java.patch create mode 100644 patches/org/spoutcraft/client/ReconnectManager.java.patch create mode 100644 patches/org/spoutcraft/client/ScheduledTextFieldUpdate.java.patch create mode 100644 patches/org/spoutcraft/client/SpoutClient.java.patch create mode 100644 patches/org/spoutcraft/client/SpoutVersion.java.patch create mode 100644 patches/org/spoutcraft/client/SpoutcraftWorld.java.patch create mode 100644 patches/org/spoutcraft/client/TileEntityComparator.java.patch create mode 100644 patches/org/spoutcraft/client/VersionFile.java.patch create mode 100644 patches/org/spoutcraft/client/block/SpoutcraftChunk.java.patch create mode 100644 patches/org/spoutcraft/client/chunkcache/HeightMap.java.patch create mode 100644 patches/org/spoutcraft/client/chunkcache/HeightMapAgent.java.patch create mode 100644 patches/org/spoutcraft/client/chunkcache/HeightMapSaveThread.java.patch create mode 100644 patches/org/spoutcraft/client/chunkcache/PartitionChunk.java.patch create mode 100644 patches/org/spoutcraft/client/chunkcache/SimpleFileCache.java.patch create mode 100644 patches/org/spoutcraft/client/config/Configuration.java.patch create mode 100644 patches/org/spoutcraft/client/config/MipMapUtils.java.patch create mode 100644 patches/org/spoutcraft/client/config/SettingsHandler.java.patch create mode 100644 patches/org/spoutcraft/client/controls/GuiAmbigousInput.java.patch create mode 100644 patches/org/spoutcraft/client/controls/Shortcut.java.patch create mode 100644 patches/org/spoutcraft/client/controls/SimpleKeyBindingManager.java.patch create mode 100644 patches/org/spoutcraft/client/entity/AbstractProjectile.java.patch create mode 100644 patches/org/spoutcraft/client/entity/CraftCameraEntity.java.patch create mode 100644 patches/org/spoutcraft/client/entity/CraftEntity.java.patch create mode 100644 patches/org/spoutcraft/client/entity/CraftEntityFactory.java.patch create mode 100644 patches/org/spoutcraft/client/entity/CraftHumanEntity.java.patch create mode 100644 patches/org/spoutcraft/client/entity/CraftLivingEntity.java.patch create mode 100644 patches/org/spoutcraft/client/entity/CraftTextEntity.java.patch create mode 100644 patches/org/spoutcraft/client/entity/EntityCamera.java.patch create mode 100644 patches/org/spoutcraft/client/entity/EntityData.java.patch create mode 100644 patches/org/spoutcraft/client/entity/EntityText.java.patch create mode 100644 patches/org/spoutcraft/client/entity/EntityTexture.java.patch create mode 100644 patches/org/spoutcraft/client/entity/RenderText.java.patch create mode 100644 patches/org/spoutcraft/client/entity/RenderTexture.java.patch create mode 100644 patches/org/spoutcraft/client/gui/ButtonUpdater.java.patch create mode 100644 patches/org/spoutcraft/client/gui/ClientTexture.java.patch create mode 100644 patches/org/spoutcraft/client/gui/CustomScreen.java.patch create mode 100644 patches/org/spoutcraft/client/gui/FilterItem.java.patch create mode 100644 patches/org/spoutcraft/client/gui/FilterModel.java.patch create mode 100644 patches/org/spoutcraft/client/gui/GuiSpoutScreen.java.patch create mode 100644 patches/org/spoutcraft/client/gui/GuiTextDialog.java.patch create mode 100644 patches/org/spoutcraft/client/gui/InGameScreen.java.patch create mode 100644 patches/org/spoutcraft/client/gui/LinkButton.java.patch create mode 100644 patches/org/spoutcraft/client/gui/MCRenderDelegate.java.patch create mode 100644 patches/org/spoutcraft/client/gui/MinecraftFontWrapper.java.patch create mode 100644 patches/org/spoutcraft/client/gui/MinecraftTessellatorWrapper.java.patch create mode 100644 patches/org/spoutcraft/client/gui/RenderItemCustom.java.patch create mode 100644 patches/org/spoutcraft/client/gui/SafeButton.java.patch create mode 100644 patches/org/spoutcraft/client/gui/ScreenUtil.java.patch create mode 100644 patches/org/spoutcraft/client/gui/SimpleKeyManager.java.patch create mode 100644 patches/org/spoutcraft/client/gui/SimpleWidgetManager.java.patch create mode 100644 patches/org/spoutcraft/client/gui/UpdatingComboBox.java.patch create mode 100644 patches/org/spoutcraft/client/gui/about/GuiAbout.java.patch create mode 100644 patches/org/spoutcraft/client/gui/about/GuiNewAbout.java.patch create mode 100644 patches/org/spoutcraft/client/gui/about/ImageSection.java.patch create mode 100644 patches/org/spoutcraft/client/gui/about/Section.java.patch create mode 100644 patches/org/spoutcraft/client/gui/about/TableSection.java.patch create mode 100644 patches/org/spoutcraft/client/gui/about/TextSection.java.patch create mode 100644 patches/org/spoutcraft/client/gui/controls/ControlsBasicItem.java.patch create mode 100644 patches/org/spoutcraft/client/gui/controls/ControlsCheckBox.java.patch create mode 100644 patches/org/spoutcraft/client/gui/controls/ControlsModel.java.patch create mode 100644 patches/org/spoutcraft/client/gui/controls/ControlsSearch.java.patch create mode 100644 patches/org/spoutcraft/client/gui/controls/DeleteControlButton.java.patch create mode 100644 patches/org/spoutcraft/client/gui/controls/GuiCommandsSlot.java.patch create mode 100644 patches/org/spoutcraft/client/gui/controls/GuiControls.java.patch create mode 100644 patches/org/spoutcraft/client/gui/controls/GuiEditShortcut.java.patch create mode 100644 patches/org/spoutcraft/client/gui/controls/KeyBindingItem.java.patch create mode 100644 patches/org/spoutcraft/client/gui/controls/ShortcutBindingItem.java.patch create mode 100644 patches/org/spoutcraft/client/gui/controls/SpoutcraftBindingItem.java.patch create mode 100644 patches/org/spoutcraft/client/gui/controls/VanillaBindingItem.java.patch create mode 100644 patches/org/spoutcraft/client/gui/database/AbstractAPIModel.java.patch create mode 100644 patches/org/spoutcraft/client/gui/database/FilterButton.java.patch create mode 100644 patches/org/spoutcraft/client/gui/database/GuiAPIDisplay.java.patch create mode 100644 patches/org/spoutcraft/client/gui/database/RandomButton.java.patch create mode 100644 patches/org/spoutcraft/client/gui/database/SearchField.java.patch create mode 100644 patches/org/spoutcraft/client/gui/database/SortButton.java.patch create mode 100644 patches/org/spoutcraft/client/gui/database/UrlElement.java.patch create mode 100644 patches/org/spoutcraft/client/gui/error/GuiConnectionLost.java.patch create mode 100644 patches/org/spoutcraft/client/gui/error/GuiUnexpectedError.java.patch create mode 100644 patches/org/spoutcraft/client/gui/error/PasteBinAPI.java.patch create mode 100644 patches/org/spoutcraft/client/gui/inventory/CreativeTabCustom.java.patch create mode 100644 patches/org/spoutcraft/client/gui/mainmenu/MainMenu.java.patch create mode 100644 patches/org/spoutcraft/client/gui/minimap/BackgroundCheckBox.java.patch create mode 100644 patches/org/spoutcraft/client/gui/minimap/BlockColor.java.patch create mode 100644 patches/org/spoutcraft/client/gui/minimap/ColorToggleCheckBox.java.patch create mode 100644 patches/org/spoutcraft/client/gui/minimap/CoordsToggleCheckBox.java.patch create mode 100644 patches/org/spoutcraft/client/gui/minimap/DeathpointsCheckBox.java.patch create mode 100644 patches/org/spoutcraft/client/gui/minimap/DirectionsToggleCheckBox.java.patch create mode 100644 patches/org/spoutcraft/client/gui/minimap/EntityVisibilityCheckbox.java.patch create mode 100644 patches/org/spoutcraft/client/gui/minimap/GuiAddWaypoint.java.patch create mode 100644 patches/org/spoutcraft/client/gui/minimap/GuiAdvancedEntitySettings.java.patch create mode 100644 patches/org/spoutcraft/client/gui/minimap/GuiMinimapMenu.java.patch create mode 100644 patches/org/spoutcraft/client/gui/minimap/GuiMoveMinimap.java.patch create mode 100644 patches/org/spoutcraft/client/gui/minimap/GuiOverviewMap.java.patch create mode 100644 patches/org/spoutcraft/client/gui/minimap/HeightMapCheckBox.java.patch create mode 100644 patches/org/spoutcraft/client/gui/minimap/ImageManager.java.patch create mode 100644 patches/org/spoutcraft/client/gui/minimap/Map.java.patch create mode 100644 patches/org/spoutcraft/client/gui/minimap/MapCalculator.java.patch create mode 100644 patches/org/spoutcraft/client/gui/minimap/MapRenderer.java.patch create mode 100644 patches/org/spoutcraft/client/gui/minimap/MapWidget.java.patch create mode 100644 patches/org/spoutcraft/client/gui/minimap/MapWidgetRenderer.java.patch create mode 100644 patches/org/spoutcraft/client/gui/minimap/MinimapConfig.java.patch create mode 100644 patches/org/spoutcraft/client/gui/minimap/MinimapModeButton.java.patch create mode 100644 patches/org/spoutcraft/client/gui/minimap/MinimapToggleCheckBox.java.patch create mode 100644 patches/org/spoutcraft/client/gui/minimap/MinimapUtils.java.patch create mode 100644 patches/org/spoutcraft/client/gui/minimap/ResetButton.java.patch create mode 100644 patches/org/spoutcraft/client/gui/minimap/ScaleToggleCheckBox.java.patch create mode 100644 patches/org/spoutcraft/client/gui/minimap/ScanRadiusSlider.java.patch create mode 100644 patches/org/spoutcraft/client/gui/minimap/ShowEntitiesCheckbox.java.patch create mode 100644 patches/org/spoutcraft/client/gui/minimap/SquareToggleCheckBox.java.patch create mode 100644 patches/org/spoutcraft/client/gui/minimap/TextureManager.java.patch create mode 100644 patches/org/spoutcraft/client/gui/minimap/TintType.java.patch create mode 100644 patches/org/spoutcraft/client/gui/minimap/WatchedEntity.java.patch create mode 100644 patches/org/spoutcraft/client/gui/minimap/Waypoint.java.patch create mode 100644 patches/org/spoutcraft/client/gui/minimap/ZanMinimap.java.patch create mode 100644 patches/org/spoutcraft/client/gui/minimap/ZoomModeButton.java.patch create mode 100644 patches/org/spoutcraft/client/gui/precache/GuiPrecache.java.patch create mode 100644 patches/org/spoutcraft/client/gui/server/AccessTypeFilter.java.patch create mode 100644 patches/org/spoutcraft/client/gui/server/CountryButton.java.patch create mode 100644 patches/org/spoutcraft/client/gui/server/DeleteFavoriteButton.java.patch create mode 100644 patches/org/spoutcraft/client/gui/server/FavoritesModel.java.patch create mode 100644 patches/org/spoutcraft/client/gui/server/GuiAddFavorite.java.patch create mode 100644 patches/org/spoutcraft/client/gui/server/GuiFavorites.java.patch create mode 100644 patches/org/spoutcraft/client/gui/server/GuiServerInfo.java.patch create mode 100644 patches/org/spoutcraft/client/gui/server/GuiServerList.java.patch create mode 100644 patches/org/spoutcraft/client/gui/server/GuiStaticServerList.java.patch create mode 100644 patches/org/spoutcraft/client/gui/server/LANModel.java.patch create mode 100644 patches/org/spoutcraft/client/gui/server/MinecraftServiceListener.java.patch create mode 100644 patches/org/spoutcraft/client/gui/server/PollResult.java.patch create mode 100644 patches/org/spoutcraft/client/gui/server/ServerDataBaseEntry.java.patch create mode 100644 patches/org/spoutcraft/client/gui/server/ServerItem.java.patch create mode 100644 patches/org/spoutcraft/client/gui/server/ServerListInfo.java.patch create mode 100644 patches/org/spoutcraft/client/gui/server/ServerListModel.java.patch create mode 100644 patches/org/spoutcraft/client/gui/server/ServerManager.java.patch create mode 100644 patches/org/spoutcraft/client/gui/server/ServerModel.java.patch create mode 100644 patches/org/spoutcraft/client/gui/server/ServerSlot.java.patch create mode 100644 patches/org/spoutcraft/client/gui/server/ServerTab.java.patch create mode 100644 patches/org/spoutcraft/client/gui/server/SpoutServerData.java.patch create mode 100644 patches/org/spoutcraft/client/gui/server/StaticServerModel.java.patch create mode 100644 patches/org/spoutcraft/client/gui/settings/GuiAdvancedOptions.java.patch create mode 100644 patches/org/spoutcraft/client/gui/settings/GuiSimpleOptions.java.patch create mode 100644 patches/org/spoutcraft/client/gui/settings/controls/AdvancedOpenGLButton.java.patch create mode 100644 patches/org/spoutcraft/client/gui/settings/controls/AmbientOcclusionButton.java.patch create mode 100644 patches/org/spoutcraft/client/gui/settings/controls/Anaglyph3DButton.java.patch create mode 100644 patches/org/spoutcraft/client/gui/settings/controls/AntiAliasingButton.java.patch create mode 100644 patches/org/spoutcraft/client/gui/settings/controls/AutomatedButton.java.patch create mode 100644 patches/org/spoutcraft/client/gui/settings/controls/AutomatedCheckBox.java.patch create mode 100644 patches/org/spoutcraft/client/gui/settings/controls/AutosaveButton.java.patch create mode 100644 patches/org/spoutcraft/client/gui/settings/controls/BetterGrassButton.java.patch create mode 100644 patches/org/spoutcraft/client/gui/settings/controls/BiomeColorsButton.java.patch create mode 100644 patches/org/spoutcraft/client/gui/settings/controls/BrightnessSlider.java.patch create mode 100644 patches/org/spoutcraft/client/gui/settings/controls/ChatButton.java.patch create mode 100644 patches/org/spoutcraft/client/gui/settings/controls/ChatColorAssistButton.java.patch create mode 100644 patches/org/spoutcraft/client/gui/settings/controls/ChunkRenderSpeed.java.patch create mode 100644 patches/org/spoutcraft/client/gui/settings/controls/ClearWaterToggleButton.java.patch create mode 100644 patches/org/spoutcraft/client/gui/settings/controls/ConnectedTexturesButton.java.patch create mode 100644 patches/org/spoutcraft/client/gui/settings/controls/ControlsButton.java.patch create mode 100644 patches/org/spoutcraft/client/gui/settings/controls/DelayedTooltipCheckbox.java.patch create mode 100644 patches/org/spoutcraft/client/gui/settings/controls/DifficultyButton.java.patch create mode 100644 patches/org/spoutcraft/client/gui/settings/controls/DisplayAnimalHeatinColorButton.java.patch create mode 100644 patches/org/spoutcraft/client/gui/settings/controls/DisplayCustomParticlesButton.java.patch create mode 100644 patches/org/spoutcraft/client/gui/settings/controls/DisplayEntityNamesinRangeButton.java.patch create mode 100644 patches/org/spoutcraft/client/gui/settings/controls/DisplayPlayerNames3rdPersonButton.java.patch create mode 100644 patches/org/spoutcraft/client/gui/settings/controls/FancyCloudsButton.java.patch create mode 100644 patches/org/spoutcraft/client/gui/settings/controls/FancyFogButton.java.patch create mode 100644 patches/org/spoutcraft/client/gui/settings/controls/FancyGraphicsButton.java.patch create mode 100644 patches/org/spoutcraft/client/gui/settings/controls/FancyGrassButton.java.patch create mode 100644 patches/org/spoutcraft/client/gui/settings/controls/FancyItemsButton.java.patch create mode 100644 patches/org/spoutcraft/client/gui/settings/controls/FancyLightingButton.java.patch create mode 100644 patches/org/spoutcraft/client/gui/settings/controls/FancyParticlesButton.java.patch create mode 100644 patches/org/spoutcraft/client/gui/settings/controls/FancyTreesButton.java.patch create mode 100644 patches/org/spoutcraft/client/gui/settings/controls/FancyWaterButton.java.patch create mode 100644 patches/org/spoutcraft/client/gui/settings/controls/FancyWeatherButton.java.patch create mode 100644 patches/org/spoutcraft/client/gui/settings/controls/FarViewButton.java.patch create mode 100644 patches/org/spoutcraft/client/gui/settings/controls/FastDebugInfoButton.java.patch create mode 100644 patches/org/spoutcraft/client/gui/settings/controls/FavorAppearanceButton.java.patch create mode 100644 patches/org/spoutcraft/client/gui/settings/controls/FavorPerformanceButton.java.patch create mode 100644 patches/org/spoutcraft/client/gui/settings/controls/FieldOfViewSlider.java.patch create mode 100644 patches/org/spoutcraft/client/gui/settings/controls/FlightSpeedSlider.java.patch create mode 100644 patches/org/spoutcraft/client/gui/settings/controls/GuiScaleButton.java.patch create mode 100644 patches/org/spoutcraft/client/gui/settings/controls/HotbarQuickKeysButton.java.patch create mode 100644 patches/org/spoutcraft/client/gui/settings/controls/HotbarTextButton.java.patch create mode 100644 patches/org/spoutcraft/client/gui/settings/controls/InvertMouseButton.java.patch create mode 100644 patches/org/spoutcraft/client/gui/settings/controls/LanguagesButton.java.patch create mode 100644 patches/org/spoutcraft/client/gui/settings/controls/ManualSelectionButton.java.patch create mode 100644 patches/org/spoutcraft/client/gui/settings/controls/MinimapButton.java.patch create mode 100644 patches/org/spoutcraft/client/gui/settings/controls/MipMapSlider.java.patch create mode 100644 patches/org/spoutcraft/client/gui/settings/controls/MusicSlider.java.patch create mode 100644 patches/org/spoutcraft/client/gui/settings/controls/OptimalGameplayButton.java.patch create mode 100644 patches/org/spoutcraft/client/gui/settings/controls/OptimizedLightingUpdatesButton.java.patch create mode 100644 patches/org/spoutcraft/client/gui/settings/controls/PerformanceButton.java.patch create mode 100644 patches/org/spoutcraft/client/gui/settings/controls/RandomMobTextureButton.java.patch create mode 100644 patches/org/spoutcraft/client/gui/settings/controls/RenderDistanceButton.java.patch create mode 100644 patches/org/spoutcraft/client/gui/settings/controls/ReplaceBlocksButton.java.patch create mode 100644 patches/org/spoutcraft/client/gui/settings/controls/ReplaceToolsButton.java.patch create mode 100644 patches/org/spoutcraft/client/gui/settings/controls/ResetButton.java.patch create mode 100644 patches/org/spoutcraft/client/gui/settings/controls/SensitivitySlider.java.patch create mode 100644 patches/org/spoutcraft/client/gui/settings/controls/ServerLightButton.java.patch create mode 100644 patches/org/spoutcraft/client/gui/settings/controls/ServerTexturesButton.java.patch create mode 100644 patches/org/spoutcraft/client/gui/settings/controls/SignDistanceButton.java.patch create mode 100644 patches/org/spoutcraft/client/gui/settings/controls/SkyToggleButton.java.patch create mode 100644 patches/org/spoutcraft/client/gui/settings/controls/SmoothFPSButton.java.patch create mode 100644 patches/org/spoutcraft/client/gui/settings/controls/SmoothLightingSlider.java.patch create mode 100644 patches/org/spoutcraft/client/gui/settings/controls/SnooperButton.java.patch create mode 100644 patches/org/spoutcraft/client/gui/settings/controls/SoundEffectsSlider.java.patch create mode 100644 patches/org/spoutcraft/client/gui/settings/controls/StarsToggleButton.java.patch create mode 100644 patches/org/spoutcraft/client/gui/settings/controls/TexturesButton.java.patch create mode 100644 patches/org/spoutcraft/client/gui/settings/controls/TimeButton.java.patch create mode 100644 patches/org/spoutcraft/client/gui/settings/controls/ViewBobbingButton.java.patch create mode 100644 patches/org/spoutcraft/client/gui/settings/controls/VoidFogButton.java.patch create mode 100644 patches/org/spoutcraft/client/gui/settings/controls/WaterBiomeColorsButton.java.patch create mode 100644 patches/org/spoutcraft/client/gui/settings/controls/WeatherToggleButton.java.patch create mode 100644 patches/org/spoutcraft/client/inventory/CraftInventory.java.patch create mode 100644 patches/org/spoutcraft/client/inventory/CraftInventoryPlayer.java.patch create mode 100644 patches/org/spoutcraft/client/inventory/CraftItemStack.java.patch create mode 100644 patches/org/spoutcraft/client/inventory/InventoryUtil.java.patch create mode 100644 patches/org/spoutcraft/client/inventory/ItemData.java.patch create mode 100644 patches/org/spoutcraft/client/inventory/SimpleMaterialManager.java.patch create mode 100644 patches/org/spoutcraft/client/inventory/SimpleShapedRecipe.java.patch create mode 100644 patches/org/spoutcraft/client/inventory/SimpleShapelessRecipe.java.patch create mode 100644 patches/org/spoutcraft/client/inventory/SpoutcraftRecipe.java.patch create mode 100644 patches/org/spoutcraft/client/io/CRCManager.java.patch create mode 100644 patches/org/spoutcraft/client/io/CustomTextureManager.java.patch create mode 100644 patches/org/spoutcraft/client/io/Download.java.patch create mode 100644 patches/org/spoutcraft/client/io/DownloadAssets.java.patch create mode 100644 patches/org/spoutcraft/client/io/FileDownloadThread.java.patch create mode 100644 patches/org/spoutcraft/client/io/FileMap.java.patch create mode 100644 patches/org/spoutcraft/client/io/FileUtil.java.patch create mode 100644 patches/org/spoutcraft/client/item/SpoutItem.java.patch create mode 100644 patches/org/spoutcraft/client/packet/CompressablePacket.java.patch create mode 100644 patches/org/spoutcraft/client/packet/CustomPacket.java.patch create mode 100644 patches/org/spoutcraft/client/packet/PacketAirTime.java.patch create mode 100644 patches/org/spoutcraft/client/packet/PacketAlert.java.patch create mode 100644 patches/org/spoutcraft/client/packet/PacketAllowVisualCheats.java.patch create mode 100644 patches/org/spoutcraft/client/packet/PacketBiomeWeather.java.patch create mode 100644 patches/org/spoutcraft/client/packet/PacketBlockData.java.patch create mode 100644 patches/org/spoutcraft/client/packet/PacketCacheDeleteFile.java.patch create mode 100644 patches/org/spoutcraft/client/packet/PacketCacheFile.java.patch create mode 100644 patches/org/spoutcraft/client/packet/PacketChunkRefresh.java.patch create mode 100644 patches/org/spoutcraft/client/packet/PacketClipboardText.java.patch create mode 100644 patches/org/spoutcraft/client/packet/PacketComboBox.java.patch create mode 100644 patches/org/spoutcraft/client/packet/PacketControlAction.java.patch create mode 100644 patches/org/spoutcraft/client/packet/PacketCustomBlockChunkOverride.java.patch create mode 100644 patches/org/spoutcraft/client/packet/PacketCustomBlockDesign.java.patch create mode 100644 patches/org/spoutcraft/client/packet/PacketCustomBlockOverride.java.patch create mode 100644 patches/org/spoutcraft/client/packet/PacketCustomMultiBlockOverride.java.patch create mode 100644 patches/org/spoutcraft/client/packet/PacketDownloadMusic.java.patch create mode 100644 patches/org/spoutcraft/client/packet/PacketEntityInformation.java.patch create mode 100644 patches/org/spoutcraft/client/packet/PacketEntitySkin.java.patch create mode 100644 patches/org/spoutcraft/client/packet/PacketEntityTitle.java.patch create mode 100644 patches/org/spoutcraft/client/packet/PacketFocusUpdate.java.patch create mode 100644 patches/org/spoutcraft/client/packet/PacketFullVersion.java.patch create mode 100644 patches/org/spoutcraft/client/packet/PacketGenericBlock.java.patch create mode 100644 patches/org/spoutcraft/client/packet/PacketGenericFood.java.patch create mode 100644 patches/org/spoutcraft/client/packet/PacketGenericItem.java.patch create mode 100644 patches/org/spoutcraft/client/packet/PacketGenericTool.java.patch create mode 100644 patches/org/spoutcraft/client/packet/PacketItemName.java.patch create mode 100644 patches/org/spoutcraft/client/packet/PacketKeyBinding.java.patch create mode 100644 patches/org/spoutcraft/client/packet/PacketKeyPress.java.patch create mode 100644 patches/org/spoutcraft/client/packet/PacketManager.java.patch create mode 100644 patches/org/spoutcraft/client/packet/PacketMovementModifiers.java.patch create mode 100644 patches/org/spoutcraft/client/packet/PacketMusicChange.java.patch create mode 100644 patches/org/spoutcraft/client/packet/PacketNotification.java.patch create mode 100644 patches/org/spoutcraft/client/packet/PacketOpenScreen.java.patch create mode 100644 patches/org/spoutcraft/client/packet/PacketOpenSignGUI.java.patch create mode 100644 patches/org/spoutcraft/client/packet/PacketParticle.java.patch create mode 100644 patches/org/spoutcraft/client/packet/PacketPermissionUpdate.java.patch create mode 100644 patches/org/spoutcraft/client/packet/PacketPlaySound.java.patch create mode 100644 patches/org/spoutcraft/client/packet/PacketPreCacheCompleted.java.patch create mode 100644 patches/org/spoutcraft/client/packet/PacketPreCacheFile.java.patch create mode 100644 patches/org/spoutcraft/client/packet/PacketRenderDistance.java.patch create mode 100644 patches/org/spoutcraft/client/packet/PacketRequestPrecache.java.patch create mode 100644 patches/org/spoutcraft/client/packet/PacketScreenAction.java.patch create mode 100644 patches/org/spoutcraft/client/packet/PacketScreenshot.java.patch create mode 100644 patches/org/spoutcraft/client/packet/PacketSendLink.java.patch create mode 100644 patches/org/spoutcraft/client/packet/PacketSendPrecache.java.patch create mode 100644 patches/org/spoutcraft/client/packet/PacketSetVelocity.java.patch create mode 100644 patches/org/spoutcraft/client/packet/PacketSkinURL.java.patch create mode 100644 patches/org/spoutcraft/client/packet/PacketSky.java.patch create mode 100644 patches/org/spoutcraft/client/packet/PacketSlotClick.java.patch create mode 100644 patches/org/spoutcraft/client/packet/PacketSpawnTextEntity.java.patch create mode 100644 patches/org/spoutcraft/client/packet/PacketStopMusic.java.patch create mode 100644 patches/org/spoutcraft/client/packet/PacketType.java.patch create mode 100644 patches/org/spoutcraft/client/packet/PacketValidatePrecache.java.patch create mode 100644 patches/org/spoutcraft/client/packet/PacketWaypoint.java.patch create mode 100644 patches/org/spoutcraft/client/packet/PacketWidget.java.patch create mode 100644 patches/org/spoutcraft/client/packet/PacketWidgetRemove.java.patch create mode 100644 patches/org/spoutcraft/client/packet/ScreenAction.java.patch create mode 100644 patches/org/spoutcraft/client/packet/SpoutPacket.java.patch create mode 100644 patches/org/spoutcraft/client/player/ClientPlayer.java.patch create mode 100644 patches/org/spoutcraft/client/player/SimpleBiomeManager.java.patch create mode 100644 patches/org/spoutcraft/client/player/SimpleSkyManager.java.patch create mode 100644 patches/org/spoutcraft/client/player/SpoutPlayer.java.patch create mode 100644 patches/org/spoutcraft/client/player/accessories/Accessory.java.patch create mode 100644 patches/org/spoutcraft/client/player/accessories/AccessoryHandler.java.patch create mode 100644 patches/org/spoutcraft/client/player/accessories/AccessoryType.java.patch create mode 100644 patches/org/spoutcraft/client/player/accessories/Bracelet.java.patch create mode 100644 patches/org/spoutcraft/client/player/accessories/Ears.java.patch create mode 100644 patches/org/spoutcraft/client/player/accessories/NotchHat.java.patch create mode 100644 patches/org/spoutcraft/client/player/accessories/PacketAccessory.java.patch create mode 100644 patches/org/spoutcraft/client/player/accessories/Sunglasses.java.patch create mode 100644 patches/org/spoutcraft/client/player/accessories/Tail.java.patch create mode 100644 patches/org/spoutcraft/client/player/accessories/TopHat.java.patch create mode 100644 patches/org/spoutcraft/client/player/accessories/Wings.java.patch create mode 100644 patches/org/spoutcraft/client/pluginloader/ClassLoader.java.patch create mode 100644 patches/org/spoutcraft/client/precache/PrecacheManager.java.patch create mode 100644 patches/org/spoutcraft/client/precache/PrecacheTuple.java.patch create mode 100644 patches/org/spoutcraft/client/sound/QueuedSound.java.patch create mode 100644 patches/org/spoutcraft/client/special/BaseYAMLResource.java.patch create mode 100644 patches/org/spoutcraft/client/special/Holiday.java.patch create mode 100644 patches/org/spoutcraft/client/special/Resources.java.patch create mode 100644 patches/org/spoutcraft/client/special/VIP.java.patch create mode 100644 patches/org/spoutcraft/client/special/YAMLResource.java.patch create mode 100644 patches/org/spoutcraft/client/spoutworth/SpoutWorth.java.patch create mode 100644 patches/org/spoutcraft/client/util/CacheMap.java.patch create mode 100644 patches/org/spoutcraft/client/util/MapEntry.java.patch create mode 100644 patches/org/spoutcraft/client/util/NetworkUtils.java.patch create mode 100644 patches/org/spoutcraft/client/util/PersistentMap.java.patch create mode 100644 patches/org/spoutcraft/client/util/UniqueItemStringMap.java.patch diff --git a/README.md b/README.md index b06a014..dcf64fd 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,3 @@ # Re:Spouted Grease -Re:Spouted Grease is a Patch used to modify Minecraft to work with [Re:Spouted](https://github.com/ReSpouted) servers using [RetroMCP](https://github.com/ReSpouted/RetroMCP-Java) and based on [SpoutCraft](https://github.com/spoutcraft/Spoutcraft) +Re:Spouted Grease is a set of patches used to modify Minecraft to work with [Re:Spouted](https://github.com/ReSpouted) servers using [RetroMCP](https://github.com/ReSpouted/RetroMCP-Java) and based on [SpoutCraft](https://github.com/spoutcraft/Spoutcraft). diff --git a/client.patch b/client.patch deleted file mode 100644 index b716a13..0000000 --- a/client.patch +++ /dev/null @@ -1,323819 +0,0 @@ ---- net/minecraft/src/CallableIntCache.java -+++ net/minecraft/src/CallableIntCache.java -@@ -5,8 +5,8 @@ - class CallableIntCache implements Callable { - final CrashReport theCrashReport; - -- CallableIntCache(CrashReport var1) { -- this.theCrashReport = var1; -+ CallableIntCache(CrashReport par1CrashReport) { -+ this.theCrashReport = par1CrashReport; - } - - public String func_85083_a() { ---- /dev/null -+++ org/spoutcraft/api/gui/ServerPlayerList.java -@@ -1,0 +1,31 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.api.gui; -+ -+public final class ServerPlayerList extends GenericWidget { -+ public WidgetType getType() { -+ // TODO Auto-generated method stub -+ return null; -+ } -+ -+ public void render() { -+ // TODO Auto-generated method stub -+ } -+} ---- net/minecraft/src/Facing.java -+++ net/minecraft/src/Facing.java -@@ -1,9 +1,25 @@ - package net.minecraft.src; - - public class Facing { -- public static final int[] oppositeSide = new int[]{1, 0, 3, 2, 5, 4}; -- public static final int[] offsetsXForSide = new int[]{0, 0, 0, 0, -1, 1}; -- public static final int[] offsetsYForSide = new int[]{-1, 1, 0, 0, 0, 0}; -- public static final int[] offsetsZForSide = new int[]{0, 0, -1, 1, 0, 0}; -- public static final String[] e = new String[]{"DOWN", "UP", "NORTH", "SOUTH", "WEST", "EAST"}; -+ -+ /** -+ * Converts a side to the opposite side. This is the same as XOR'ing it with 1. -+ */ -+ public static final int[] oppositeSide = new int[] {1, 0, 3, 2, 5, 4}; -+ -+ /** -+ * gives the offset required for this axis to get the block at that side. -+ */ -+ public static final int[] offsetsXForSide = new int[] {0, 0, 0, 0, -1, 1}; -+ -+ /** -+ * gives the offset required for this axis to get the block at that side. -+ */ -+ public static final int[] offsetsYForSide = new int[] { -1, 1, 0, 0, 0, 0}; -+ -+ /** -+ * gives the offset required for this axis to get the block at that side. -+ */ -+ public static final int[] offsetsZForSide = new int[] {0, 0, -1, 1, 0, 0}; -+ public static final String[] facings = new String[] {"DOWN", "UP", "NORTH", "SOUTH", "WEST", "EAST"}; - } ---- net/minecraft/src/ComponentMineshaftStairs.java -+++ net/minecraft/src/ComponentMineshaftStairs.java -@@ -4,71 +4,85 @@ - import java.util.Random; - - public class ComponentMineshaftStairs extends StructureComponent { -- public ComponentMineshaftStairs() { -- } -- -- public ComponentMineshaftStairs(int var1, Random var2, StructureBoundingBox var3, int var4) { -- super(var1); -- this.coordBaseMode = var4; -- this.boundingBox = var3; -- } -- -- protected void func_143012_a(NBTTagCompound var1) { -- } -- -- protected void func_143011_b(NBTTagCompound var1) { -- } -- -- public static StructureBoundingBox findValidPlacement(List var0, Random var1, int var2, int var3, int var4, int var5) { -- StructureBoundingBox var6 = new StructureBoundingBox(var2, var3 - 5, var4, var2, var3 + 2, var4); -- switch(var5) { -- case 0: -- var6.maxX = var2 + 2; -- var6.maxZ = var4 + 8; -- break; -- case 1: -- var6.minX = var2 - 8; -- var6.maxZ = var4 + 2; -- break; -- case 2: -- var6.maxX = var2 + 2; -- var6.minZ = var4 - 8; -- break; -- case 3: -- var6.maxX = var2 + 8; -- var6.maxZ = var4 + 2; -+ public ComponentMineshaftStairs() {} -+ -+ public ComponentMineshaftStairs(int par1, Random par2Random, StructureBoundingBox par3StructureBoundingBox, int par4) { -+ super(par1); -+ this.coordBaseMode = par4; -+ this.boundingBox = par3StructureBoundingBox; -+ } -+ -+ protected void func_143012_a(NBTTagCompound par1NBTTagCompound) {} -+ -+ protected void func_143011_b(NBTTagCompound par1NBTTagCompound) {} -+ -+ /** -+ * Trys to find a valid place to put this component. -+ */ -+ public static StructureBoundingBox findValidPlacement(List par0List, Random par1Random, int par2, int par3, int par4, int par5) { -+ StructureBoundingBox var6 = new StructureBoundingBox(par2, par3 - 5, par4, par2, par3 + 2, par4); -+ -+ switch (par5) { -+ case 0: -+ var6.maxX = par2 + 2; -+ var6.maxZ = par4 + 8; -+ break; -+ -+ case 1: -+ var6.minX = par2 - 8; -+ var6.maxZ = par4 + 2; -+ break; -+ -+ case 2: -+ var6.maxX = par2 + 2; -+ var6.minZ = par4 - 8; -+ break; -+ -+ case 3: -+ var6.maxX = par2 + 8; -+ var6.maxZ = par4 + 2; - } - -- return StructureComponent.findIntersecting(var0, var6) != null ? null : var6; -+ return StructureComponent.findIntersecting(par0List, var6) != null ? null : var6; - } - -- public void buildComponent(StructureComponent var1, List var2, Random var3) { -+ /** -+ * Initiates construction of the Structure Component picked, at the current Location of StructGen -+ */ -+ public void buildComponent(StructureComponent par1StructureComponent, List par2List, Random par3Random) { - int var4 = this.getComponentType(); -- switch(this.coordBaseMode) { -- case 0: -- StructureMineshaftPieces.getNextComponent(var1, var2, var3, this.boundingBox.minX, this.boundingBox.minY, this.boundingBox.maxZ + 1, 0, var4); -- break; -- case 1: -- StructureMineshaftPieces.getNextComponent(var1, var2, var3, this.boundingBox.minX - 1, this.boundingBox.minY, this.boundingBox.minZ, 1, var4); -- break; -- case 2: -- StructureMineshaftPieces.getNextComponent(var1, var2, var3, this.boundingBox.minX, this.boundingBox.minY, this.boundingBox.minZ - 1, 2, var4); -- break; -- case 3: -- StructureMineshaftPieces.getNextComponent(var1, var2, var3, this.boundingBox.maxX + 1, this.boundingBox.minY, this.boundingBox.minZ, 3, var4); -+ -+ switch (this.coordBaseMode) { -+ case 0: -+ StructureMineshaftPieces.getNextComponent(par1StructureComponent, par2List, par3Random, this.boundingBox.minX, this.boundingBox.minY, this.boundingBox.maxZ + 1, 0, var4); -+ break; -+ -+ case 1: -+ StructureMineshaftPieces.getNextComponent(par1StructureComponent, par2List, par3Random, this.boundingBox.minX - 1, this.boundingBox.minY, this.boundingBox.minZ, 1, var4); -+ break; -+ -+ case 2: -+ StructureMineshaftPieces.getNextComponent(par1StructureComponent, par2List, par3Random, this.boundingBox.minX, this.boundingBox.minY, this.boundingBox.minZ - 1, 2, var4); -+ break; -+ -+ case 3: -+ StructureMineshaftPieces.getNextComponent(par1StructureComponent, par2List, par3Random, this.boundingBox.maxX + 1, this.boundingBox.minY, this.boundingBox.minZ, 3, var4); - } -- - } - -- public boolean addComponentParts(World var1, Random var2, StructureBoundingBox var3) { -- if(this.isLiquidInStructureBoundingBox(var1, var3)) { -+ /** -+ * second Part of Structure generating, this for example places Spiderwebs, Mob Spawners, it closes Mineshafts at the -+ * end, it adds Fences... -+ */ -+ public boolean addComponentParts(World par1World, Random par2Random, StructureBoundingBox par3StructureBoundingBox) { -+ if (this.isLiquidInStructureBoundingBox(par1World, par3StructureBoundingBox)) { - return false; - } else { -- this.fillWithBlocks(var1, var3, 0, 5, 0, 2, 7, 1, 0, 0, false); -- this.fillWithBlocks(var1, var3, 0, 0, 7, 2, 2, 8, 0, 0, false); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 0, 5, 0, 2, 7, 1, 0, 0, false); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 0, 0, 7, 2, 2, 8, 0, 0, false); - -- for(int var4 = 0; var4 < 5; ++var4) { -- this.fillWithBlocks(var1, var3, 0, 5 - var4 - (var4 < 4 ? 1 : 0), 2 + var4, 2, 7 - var4, 2 + var4, 0, 0, false); -+ for (int var4 = 0; var4 < 5; ++var4) { -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 0, 5 - var4 - (var4 < 4 ? 1 : 0), 2 + var4, 2, 7 - var4, 2 + var4, 0, 0, false); - } - - return true; ---- /dev/null -+++ org/spoutcraft/client/gui/controls/SpoutcraftBindingItem.java -@@ -1,0 +1,106 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.client.gui.controls; -+ -+import net.minecraft.src.FontRenderer; -+import net.minecraft.src.GameSettings; -+import net.minecraft.src.KeyBinding; -+ -+import org.spoutcraft.client.SpoutClient; -+ -+public class SpoutcraftBindingItem extends ControlsBasicItem { -+ protected KeyBinding binding; -+ private ControlsModel parent; -+ public SpoutcraftBindingItem(KeyBinding binding, ControlsModel model) { -+ super(model); -+ this.binding = binding; -+ this.parent = model; -+ } -+ -+ public int getHeight() { -+ return 11; -+ } -+ -+ public void render(int x, int y, int width, int height) { -+ FontRenderer font = SpoutClient.getHandle().fontRenderer; -+ font.drawStringWithShadow("S", x + 2, y + 2, 0xffff0000); -+ int w = font.getStringWidth("S"); -+ font.drawStringWithShadow(getName(), x + w + 4, y + 2, !isConflicting() ? 0xffffffff:0xffff0000); -+ String keyString = parent.getEditingItem() == this ? "> <" : getDisplayKey(); -+ w = font.getStringWidth(keyString); -+ font.drawStringWithShadow(keyString, width - w, y + 2, 0xffcccccc); -+ } -+ -+ public String getDisplayKey() { -+ if (binding.keyCode == -128) { -+ return "Unbound"; -+ } -+ return GameSettings.getKeyDisplayString(getKey()); -+ } -+ -+ @Override -+ public void setKey(int id) { -+ binding.keyCode = id; -+ SpoutClient.getHandle().gameSettings.saveOptions(); -+ KeyBinding.resetKeyBindingArrayAndHash(); -+ } -+ -+ @Override -+ public int getKey() { -+ return binding.keyCode; -+ } -+ -+ public boolean useModifiers() { -+ return false; -+ } -+ -+ public boolean useMouseButtons() { -+ return true; -+ } -+ -+ public String getName() { -+ return binding.keyDescription; -+ } -+ -+ @Override -+ public boolean conflicts(ControlsBasicItem other) { -+ if (other instanceof VanillaBindingItem) { -+ GameSettings settings = SpoutClient.getHandle().gameSettings; -+ VanillaBindingItem item = (VanillaBindingItem)other; -+ boolean flightKey = binding == settings.keyFlyBack || -+ binding == settings.keyFlyLeft || -+ binding == settings.keyFlyForward || -+ binding == settings.keyFlyRight || -+ binding == settings.keyFlyUp || -+ binding == settings.keyFlyDown; -+ boolean movementKey = item.binding == settings.keyBindBack || -+ item.binding == settings.keyBindLeft || -+ item.binding == settings.keyBindForward || -+ item.binding == settings.keyBindRight || -+ item.binding == settings.keyBindJump || -+ item.binding == settings.keyBindSneak; -+ // Allow overlaps -+ if (flightKey && movementKey) { -+ return false; -+ } -+ } -+ return super.conflicts(other); -+ } -+} ---- net/minecraft/src/ItemBlock.java -+++ net/minecraft/src/ItemBlock.java -@@ -1,76 +1,99 @@ - package net.minecraft.src; - -+//Spout Start -+ - import java.util.List; - -+import com.prupe.mcpatcher.cc.ColorizeBlock; -+ -+//Spout end -+ - public class ItemBlock extends Item { -+ /** The block ID of the Block associated with this ItemBlock */ - private int blockID; - private Icon field_94588_b; - -- public ItemBlock(int var1) { -- super(var1); -- this.blockID = var1 + 256; -+ public ItemBlock(int par1) { -+ super(par1); -+ this.blockID = par1 + 256; - } - -+ /** -+ * Returns the blockID for this Item -+ */ - public int getBlockID() { - return this.blockID; - } - -+ /** -+ * Returns 0 for /terrain.png, 1 for /gui/items.png -+ */ - public int getSpriteNumber() { - return Block.blocksList[this.blockID].getItemIconName() != null ? 1 : 0; - } - -- public Icon getIconFromDamage(int var1) { -+ /** -+ * Gets an icon index based on an item's damage value -+ */ -+ public Icon getIconFromDamage(int par1) { - return this.field_94588_b != null ? this.field_94588_b : Block.blocksList[this.blockID].getBlockTextureFromSide(1); - } - -- public boolean onItemUse(ItemStack var1, EntityPlayer var2, World var3, int var4, int var5, int var6, int var7, float var8, float var9, float var10) { -- int var11 = var3.getBlockId(var4, var5, var6); -- if(var11 == Block.snow.blockID && (var3.getBlockMetadata(var4, var5, var6) & 7) < 1) { -- var7 = 1; -- } else if(var11 != Block.vine.blockID && var11 != Block.tallGrass.blockID && var11 != Block.deadBush.blockID) { -- if(var7 == 0) { -- --var5; -- } -- -- if(var7 == 1) { -- ++var5; -- } -- -- if(var7 == 2) { -- --var6; -- } -- -- if(var7 == 3) { -- ++var6; -- } -- -- if(var7 == 4) { -- --var4; -- } -- -- if(var7 == 5) { -- ++var4; -+ /** -+ * Callback for item usage. If the item does something special on right -+ * clicking, he will have one of those. Return True if something happen and -+ * false if it don't. This is for ITEMS, not BLOCKS -+ */ -+ public boolean onItemUse(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, World par3World, int par4, int par5, int par6, int par7, float par8, float par9, float par10) { -+ int var11 = par3World.getBlockId(par4, par5, par6); -+ -+ if (var11 == Block.snow.blockID && (par3World.getBlockMetadata(par4, par5, par6) & 7) < 1) { -+ par7 = 1; -+ } else if (var11 != Block.vine.blockID && var11 != Block.tallGrass.blockID && var11 != Block.deadBush.blockID) { -+ if (par7 == 0) { -+ --par5; -+ } -+ -+ if (par7 == 1) { -+ ++par5; -+ } -+ -+ if (par7 == 2) { -+ --par6; -+ } -+ -+ if (par7 == 3) { -+ ++par6; -+ } -+ -+ if (par7 == 4) { -+ --par4; -+ } -+ -+ if (par7 == 5) { -+ ++par4; - } - } - -- if(var1.stackSize == 0) { -- return false; -- } else if(!var2.canPlayerEdit(var4, var5, var6, var7, var1)) { -- return false; -- } else if(var5 == 255 && Block.blocksList[this.blockID].blockMaterial.isSolid()) { -- return false; -- } else if(var3.canPlaceEntityOnSide(this.blockID, var4, var5, var6, false, var7, var2, var1)) { -+ if (par1ItemStack.stackSize == 0) { -+ return false; -+ } else if (!par2EntityPlayer.canPlayerEdit(par4, par5, par6, par7, par1ItemStack)) { -+ return false; -+ } else if (par5 == 255 && Block.blocksList[this.blockID].blockMaterial.isSolid()) { -+ return false; -+ } else if (par3World.canPlaceEntityOnSide(this.blockID, par4, par5, par6, false, par7, par2EntityPlayer, par1ItemStack)) { - Block var12 = Block.blocksList[this.blockID]; -- int var13 = this.getMetadata(var1.getItemDamage()); -- int var14 = Block.blocksList[this.blockID].onBlockPlaced(var3, var4, var5, var6, var7, var8, var9, var10, var13); -- if(var3.setBlock(var4, var5, var6, this.blockID, var14, 3)) { -- if(var3.getBlockId(var4, var5, var6) == this.blockID) { -- Block.blocksList[this.blockID].onBlockPlacedBy(var3, var4, var5, var6, var2, var1); -- Block.blocksList[this.blockID].onPostBlockPlaced(var3, var4, var5, var6, var14); -+ int var13 = this.getMetadata(par1ItemStack.getItemDamage()); -+ int var14 = Block.blocksList[this.blockID].onBlockPlaced(par3World, par4, par5, par6, par7, par8, par9, par10, var13); -+ -+ if (par3World.setBlock(par4, par5, par6, this.blockID, var14, 3)) { -+ if (par3World.getBlockId(par4, par5, par6) == this.blockID) { -+ Block.blocksList[this.blockID].onBlockPlacedBy(par3World, par4, par5, par6, par2EntityPlayer, par1ItemStack); -+ Block.blocksList[this.blockID].onPostBlockPlaced(par3World, par4, par5, par6, var14); - } - -- var3.playSoundEffect((double)((float)var4 + 0.5F), (double)((float)var5 + 0.5F), (double)((float)var6 + 0.5F), var12.stepSound.getPlaceSound(), (var12.stepSound.getVolume() + 1.0F) / 2.0F, var12.stepSound.getPitch() * 0.8F); -- --var1.stackSize; -+ par3World.playSoundEffect((double) ((float) par4 + 0.5F), (double) ((float) par5 + 0.5F), (double) ((float) par6 + 0.5F), var12.stepSound.getPlaceSound(), (var12.stepSound.getVolume() + 1.0F) / 2.0F, var12.stepSound.getPitch() * 0.8F); -+ --par1ItemStack.stackSize; - } - - return true; -@@ -79,60 +102,86 @@ - } - } - -- public boolean canPlaceItemBlockOnSide(World var1, int var2, int var3, int var4, int var5, EntityPlayer var6, ItemStack var7) { -- int var8 = var1.getBlockId(var2, var3, var4); -- if(var8 == Block.snow.blockID) { -- var5 = 1; -- } else if(var8 != Block.vine.blockID && var8 != Block.tallGrass.blockID && var8 != Block.deadBush.blockID) { -- if(var5 == 0) { -- --var3; -- } -- -- if(var5 == 1) { -- ++var3; -- } -- -- if(var5 == 2) { -- --var4; -- } -- -- if(var5 == 3) { -- ++var4; -- } -- -- if(var5 == 4) { -- --var2; -- } -- -- if(var5 == 5) { -- ++var2; -+ /** -+ * Returns true if the given ItemBlock can be placed on the given side of -+ * the given block position. -+ */ -+ public boolean canPlaceItemBlockOnSide(World par1World, int par2, int par3, int par4, int par5, EntityPlayer par6EntityPlayer, ItemStack par7ItemStack) { -+ int var8 = par1World.getBlockId(par2, par3, par4); -+ -+ if (var8 == Block.snow.blockID) { -+ par5 = 1; -+ } else if (var8 != Block.vine.blockID && var8 != Block.tallGrass.blockID && var8 != Block.deadBush.blockID) { -+ if (par5 == 0) { -+ --par3; -+ } -+ -+ if (par5 == 1) { -+ ++par3; -+ } -+ -+ if (par5 == 2) { -+ --par4; -+ } -+ -+ if (par5 == 3) { -+ ++par4; -+ } -+ -+ if (par5 == 4) { -+ --par2; -+ } -+ -+ if (par5 == 5) { -+ ++par2; - } - } - -- return var1.canPlaceEntityOnSide(this.getBlockID(), var2, var3, var4, false, var5, (Entity)null, var7); -+ return par1World.canPlaceEntityOnSide(this.getBlockID(), par2, par3, par4, false, par5, (Entity) null, par7ItemStack); - } - -- public String getUnlocalizedName(ItemStack var1) { -+ /** -+ * Returns the unlocalized name of this item. This version accepts an -+ * ItemStack so different stacks can have different names based on their -+ * damage or NBT. -+ */ -+ public String getUnlocalizedName(ItemStack par1ItemStack) { - return Block.blocksList[this.blockID].getUnlocalizedName(); - } - -+ /** -+ * Returns the unlocalized name of this item. -+ */ - public String getUnlocalizedName() { - return Block.blocksList[this.blockID].getUnlocalizedName(); - } - -+ /** -+ * gets the CreativeTab this item is displayed on -+ */ - public CreativeTabs getCreativeTab() { - return Block.blocksList[this.blockID].getCreativeTabToDisplayOn(); - } - -- public void getSubItems(int var1, CreativeTabs var2, List var3) { -- Block.blocksList[this.blockID].getSubBlocks(var1, var2, var3); -+ /** -+ * returns a list of items with the same ID, but different meta (eg: dye -+ * returns 16 items) -+ */ -+ public void getSubItems(int par1, CreativeTabs par2CreativeTabs, List par3List) { -+ Block.blocksList[this.blockID].getSubBlocks(par1, par2CreativeTabs, par3List); - } - -- public void registerIcons(IconRegister var1) { -+ public void registerIcons(IconRegister par1IconRegister) { - String var2 = Block.blocksList[this.blockID].getItemIconName(); -- if(var2 != null) { -- this.field_94588_b = var1.registerIcon(var2); -+ -+ if (var2 != null) { -+ this.field_94588_b = par1IconRegister.registerIcon(var2); - } -+ } - -+ //Spout MCPatcher start -+ public int getColorFromItemStack(ItemStack var1, int var2) { -+ return ColorizeBlock.getItemColorFromDamage(super.getColorFromItemStack(var1, var2), this.blockID, var2); - } -+ //Spout MCPatcher end - } ---- net/minecraft/src/EntityAIFollowOwner.java -+++ net/minecraft/src/EntityAIFollowOwner.java -@@ -11,23 +11,27 @@ - float minDist; - private boolean field_75344_i; - -- public EntityAIFollowOwner(EntityTameable var1, double var2, float var4, float var5) { -- this.thePet = var1; -- this.theWorld = var1.worldObj; -- this.field_75336_f = var2; -- this.petPathfinder = var1.getNavigator(); -- this.minDist = var4; -- this.maxDist = var5; -+ public EntityAIFollowOwner(EntityTameable par1EntityTameable, double par2, float par4, float par5) { -+ this.thePet = par1EntityTameable; -+ this.theWorld = par1EntityTameable.worldObj; -+ this.field_75336_f = par2; -+ this.petPathfinder = par1EntityTameable.getNavigator(); -+ this.minDist = par4; -+ this.maxDist = par5; - this.setMutexBits(3); - } - -+ /** -+ * Returns whether the EntityAIBase should begin execution. -+ */ - public boolean shouldExecute() { - EntityLivingBase var1 = this.thePet.func_130012_q(); -- if(var1 == null) { -- return false; -- } else if(this.thePet.isSitting()) { -- return false; -- } else if(this.thePet.getDistanceSqToEntity(var1) < (double)(this.minDist * this.minDist)) { -+ -+ if (var1 == null) { -+ return false; -+ } else if (this.thePet.isSitting()) { -+ return false; -+ } else if (this.thePet.getDistanceSqToEntity(var1) < (double)(this.minDist * this.minDist)) { - return false; - } else { - this.theOwner = var1; -@@ -35,44 +39,57 @@ - } - } - -+ /** -+ * Returns whether an in-progress EntityAIBase should continue executing -+ */ - public boolean continueExecuting() { - return !this.petPathfinder.noPath() && this.thePet.getDistanceSqToEntity(this.theOwner) > (double)(this.maxDist * this.maxDist) && !this.thePet.isSitting(); - } - -+ /** -+ * Execute a one shot task or start executing a continuous task -+ */ - public void startExecuting() { - this.field_75343_h = 0; - this.field_75344_i = this.thePet.getNavigator().getAvoidsWater(); - this.thePet.getNavigator().setAvoidsWater(false); - } - -+ /** -+ * Resets the task -+ */ - public void resetTask() { - this.theOwner = null; - this.petPathfinder.clearPathEntity(); - this.thePet.getNavigator().setAvoidsWater(this.field_75344_i); - } - -+ /** -+ * Updates the task -+ */ - public void updateTask() { - this.thePet.getLookHelper().setLookPositionWithEntity(this.theOwner, 10.0F, (float)this.thePet.getVerticalFaceSpeed()); -- if(!this.thePet.isSitting()) { -- if(--this.field_75343_h <= 0) { -+ -+ if (!this.thePet.isSitting()) { -+ if (--this.field_75343_h <= 0) { - this.field_75343_h = 10; -- if(!this.petPathfinder.tryMoveToEntityLiving(this.theOwner, this.field_75336_f)) { -- if(!this.thePet.getLeashed()) { -- if(this.thePet.getDistanceSqToEntity(this.theOwner) >= 144.0D) { -+ -+ if (!this.petPathfinder.tryMoveToEntityLiving(this.theOwner, this.field_75336_f)) { -+ if (!this.thePet.getLeashed()) { -+ if (this.thePet.getDistanceSqToEntity(this.theOwner) >= 144.0D) { - int var1 = MathHelper.floor_double(this.theOwner.posX) - 2; - int var2 = MathHelper.floor_double(this.theOwner.posZ) - 2; - int var3 = MathHelper.floor_double(this.theOwner.boundingBox.minY); - -- for(int var4 = 0; var4 <= 4; ++var4) { -- for(int var5 = 0; var5 <= 4; ++var5) { -- if((var4 < 1 || var5 < 1 || var4 > 3 || var5 > 3) && this.theWorld.doesBlockHaveSolidTopSurface(var1 + var4, var3 - 1, var2 + var5) && !this.theWorld.isBlockNormalCube(var1 + var4, var3, var2 + var5) && !this.theWorld.isBlockNormalCube(var1 + var4, var3 + 1, var2 + var5)) { -+ for (int var4 = 0; var4 <= 4; ++var4) { -+ for (int var5 = 0; var5 <= 4; ++var5) { -+ if ((var4 < 1 || var5 < 1 || var4 > 3 || var5 > 3) && this.theWorld.doesBlockHaveSolidTopSurface(var1 + var4, var3 - 1, var2 + var5) && !this.theWorld.isBlockNormalCube(var1 + var4, var3, var2 + var5) && !this.theWorld.isBlockNormalCube(var1 + var4, var3 + 1, var2 + var5)) { - this.thePet.setLocationAndAngles((double)((float)(var1 + var4) + 0.5F), (double)var3, (double)((float)(var2 + var5) + 0.5F), this.thePet.rotationYaw, this.thePet.rotationPitch); - this.petPathfinder.clearPathEntity(); - return; - } - } - } -- - } - } - } ---- net/minecraft/src/EntityAIVillagerMate.java -+++ net/minecraft/src/EntityAIVillagerMate.java -@@ -7,26 +7,31 @@ - private int matingTimeout; - Village villageObj; - -- public EntityAIVillagerMate(EntityVillager var1) { -- this.villagerObj = var1; -- this.worldObj = var1.worldObj; -+ public EntityAIVillagerMate(EntityVillager par1EntityVillager) { -+ this.villagerObj = par1EntityVillager; -+ this.worldObj = par1EntityVillager.worldObj; - this.setMutexBits(3); - } - -+ /** -+ * Returns whether the EntityAIBase should begin execution. -+ */ - public boolean shouldExecute() { -- if(this.villagerObj.getGrowingAge() != 0) { -+ if (this.villagerObj.getGrowingAge() != 0) { - return false; -- } else if(this.villagerObj.getRNG().nextInt(500) != 0) { -+ } else if (this.villagerObj.getRNG().nextInt(500) != 0) { - return false; - } else { - this.villageObj = this.worldObj.villageCollectionObj.findNearestVillage(MathHelper.floor_double(this.villagerObj.posX), MathHelper.floor_double(this.villagerObj.posY), MathHelper.floor_double(this.villagerObj.posZ), 0); -- if(this.villageObj == null) { -+ -+ if (this.villageObj == null) { - return false; -- } else if(!this.checkSufficientDoorsPresentForNewVillager()) { -+ } else if (!this.checkSufficientDoorsPresentForNewVillager()) { - return false; - } else { - Entity var1 = this.worldObj.findNearestEntityWithinAABB(EntityVillager.class, this.villagerObj.boundingBox.expand(8.0D, 3.0D, 8.0D), this.villagerObj); -- if(var1 == null) { -+ -+ if (var1 == null) { - return false; - } else { - this.mate = (EntityVillager)var1; -@@ -36,38 +41,50 @@ - } - } - -+ /** -+ * Execute a one shot task or start executing a continuous task -+ */ - public void startExecuting() { - this.matingTimeout = 300; - this.villagerObj.setMating(true); - } - -+ /** -+ * Resets the task -+ */ - public void resetTask() { - this.villageObj = null; - this.mate = null; - this.villagerObj.setMating(false); - } - -+ /** -+ * Returns whether an in-progress EntityAIBase should continue executing -+ */ - public boolean continueExecuting() { - return this.matingTimeout >= 0 && this.checkSufficientDoorsPresentForNewVillager() && this.villagerObj.getGrowingAge() == 0; - } - -+ /** -+ * Updates the task -+ */ - public void updateTask() { - --this.matingTimeout; - this.villagerObj.getLookHelper().setLookPositionWithEntity(this.mate, 10.0F, 30.0F); -- if(this.villagerObj.getDistanceSqToEntity(this.mate) > 2.25D) { -+ -+ if (this.villagerObj.getDistanceSqToEntity(this.mate) > 2.25D) { - this.villagerObj.getNavigator().tryMoveToEntityLiving(this.mate, 0.25D); -- } else if(this.matingTimeout == 0 && this.mate.isMating()) { -+ } else if (this.matingTimeout == 0 && this.mate.isMating()) { - this.giveBirth(); - } - -- if(this.villagerObj.getRNG().nextInt(35) == 0) { -+ if (this.villagerObj.getRNG().nextInt(35) == 0) { - this.worldObj.setEntityState(this.villagerObj, (byte)12); - } -- - } - - private boolean checkSufficientDoorsPresentForNewVillager() { -- if(!this.villageObj.isMatingSeason()) { -+ if (!this.villageObj.isMatingSeason()) { - return false; - } else { - int var1 = (int)((double)((float)this.villageObj.getNumVillageDoors()) * 0.35D); ---- net/minecraft/src/EntityDamageSource.java -+++ net/minecraft/src/EntityDamageSource.java -@@ -3,22 +3,28 @@ - public class EntityDamageSource extends DamageSource { - protected Entity damageSourceEntity; - -- public EntityDamageSource(String var1, Entity var2) { -- super(var1); -- this.damageSourceEntity = var2; -+ public EntityDamageSource(String par1Str, Entity par2Entity) { -+ super(par1Str); -+ this.damageSourceEntity = par2Entity; - } - - public Entity getEntity() { - return this.damageSourceEntity; - } - -- public ChatMessageComponent getDeathMessage(EntityLivingBase var1) { -+ /** -+ * Returns the message to be displayed on player death. -+ */ -+ public ChatMessageComponent getDeathMessage(EntityLivingBase par1EntityLivingBase) { - ItemStack var2 = this.damageSourceEntity instanceof EntityLivingBase ? ((EntityLivingBase)this.damageSourceEntity).getHeldItem() : null; -- String var3 = "death.attack." + this.o; -+ String var3 = "death.attack." + this.damageType; - String var4 = var3 + ".item"; -- return var2 != null && var2.hasDisplayName() && StatCollector.func_94522_b(var4) ? ChatMessageComponent.createFromTranslationWithSubstitutions(var4, new Object[]{var1.getTranslatedEntityName(), this.damageSourceEntity.getTranslatedEntityName(), var2.getDisplayName()}) : ChatMessageComponent.createFromTranslationWithSubstitutions(var3, new Object[]{var1.getTranslatedEntityName(), this.damageSourceEntity.getTranslatedEntityName()}); -+ return var2 != null && var2.hasDisplayName() && StatCollector.func_94522_b(var4) ? ChatMessageComponent.createFromTranslationWithSubstitutions(var4, new Object[] {par1EntityLivingBase.getTranslatedEntityName(), this.damageSourceEntity.getTranslatedEntityName(), var2.getDisplayName()}): ChatMessageComponent.createFromTranslationWithSubstitutions(var3, new Object[] {par1EntityLivingBase.getTranslatedEntityName(), this.damageSourceEntity.getTranslatedEntityName()}); - } - -+ /** -+ * Return whether this damage source will have its damage amount scaled based on the current difficulty. -+ */ - public boolean isDifficultyScaled() { - return this.damageSourceEntity != null && this.damageSourceEntity instanceof EntityLivingBase && !(this.damageSourceEntity instanceof EntityPlayer); - } ---- net/minecraft/src/LanguageMetadataSectionSerializer.java -+++ net/minecraft/src/LanguageMetadataSectionSerializer.java -@@ -11,24 +11,25 @@ - import java.util.Map.Entry; - - public class LanguageMetadataSectionSerializer extends BaseMetadataSectionSerializer { -- public LanguageMetadataSection func_135020_a(JsonElement var1, Type var2, JsonDeserializationContext var3) { -- JsonObject var4 = var1.getAsJsonObject(); -+ public LanguageMetadataSection func_135020_a(JsonElement par1JsonElement, Type par2Type, JsonDeserializationContext par3JsonDeserializationContext) { -+ JsonObject var4 = par1JsonElement.getAsJsonObject(); - HashSet var5 = Sets.newHashSet(); - Iterator var6 = var4.entrySet().iterator(); -- - String var8; - String var11; - String var12; - boolean var13; -+ - do { -- if(!var6.hasNext()) { -+ if (!var6.hasNext()) { - return new LanguageMetadataSection(var5); - } - - Entry var7 = (Entry)var6.next(); - var8 = (String)var7.getKey(); - JsonElement var9 = (JsonElement)var7.getValue(); -- if(!var9.isJsonObject()) { -+ -+ if (!var9.isJsonObject()) { - throw new JsonParseException("Invalid language->\'" + var8 + "\': expected object, was " + var9); - } - -@@ -36,23 +37,27 @@ - var11 = this.func_110486_a(var10.get("region"), "region", "", 0, Integer.MAX_VALUE); - var12 = this.func_110486_a(var10.get("name"), "name", "", 0, Integer.MAX_VALUE); - var13 = this.func_110484_a(var10.get("bidirectional"), "bidirectional", Boolean.valueOf(false)); -- if(var11.isEmpty()) { -+ -+ if (var11.isEmpty()) { - throw new JsonParseException("Invalid language->\'" + var8 + "\'->region: empty value"); - } - -- if(var12.isEmpty()) { -+ if (var12.isEmpty()) { - throw new JsonParseException("Invalid language->\'" + var8 + "\'->name: empty value"); - } -- } while(var5.add(new Language(var8, var11, var12, var13))); -+ } while (var5.add(new Language(var8, var11, var12, var13))); - - throw new JsonParseException("Duplicate language->\'" + var8 + "\' defined"); - } - -+ /** -+ * The name of this section type as it appears in JSON. -+ */ - public String getSectionName() { - return "language"; - } - -- public Object deserialize(JsonElement var1, Type var2, JsonDeserializationContext var3) { -- return this.func_135020_a(var1, var2, var3); -+ public Object deserialize(JsonElement par1JsonElement, Type par2Type, JsonDeserializationContext par3JsonDeserializationContext) { -+ return this.func_135020_a(par1JsonElement, par2Type, par3JsonDeserializationContext); - } - } ---- net/minecraft/src/GuiScreenOnlineServersSubscreen.java -+++ net/minecraft/src/GuiScreenOnlineServersSubscreen.java -@@ -8,60 +8,59 @@ - private final int field_104081_h; - private final int field_104082_i; - private final int field_104080_j; -- List a = new ArrayList(); -- String[] b; -- String[] c; -- String[][] d; -+ List field_104079_a = new ArrayList(); -+ String[] field_104077_b; -+ String[] field_104078_c; -+ String[][] field_104075_d; - int field_104076_e; - int field_104073_f; - -- public GuiScreenOnlineServersSubscreen(int var1, int var2, int var3, int var4, int var5, int var6) { -- this.field_104074_g = var1; -- this.field_104081_h = var2; -- this.field_104082_i = var3; -- this.field_104080_j = var4; -- this.field_104076_e = var5; -- this.field_104073_f = var6; -+ public GuiScreenOnlineServersSubscreen(int par1, int par2, int par3, int par4, int par5, int par6) { -+ this.field_104074_g = par1; -+ this.field_104081_h = par2; -+ this.field_104082_i = par3; -+ this.field_104080_j = par4; -+ this.field_104076_e = par5; -+ this.field_104073_f = par6; - this.func_104068_a(); - } - - private void func_104068_a() { - this.func_104070_b(); -- this.a.add(new GuiButton(5005, this.field_104082_i, this.field_104080_j + 1, 212, 20, this.func_104072_c())); -- this.a.add(new GuiButton(5006, this.field_104082_i, this.field_104080_j + 25, 212, 20, this.func_104067_d())); -+ this.field_104079_a.add(new GuiButton(5005, this.field_104082_i, this.field_104080_j + 1, 212, 20, this.func_104072_c())); -+ this.field_104079_a.add(new GuiButton(5006, this.field_104082_i, this.field_104080_j + 25, 212, 20, this.func_104067_d())); - } - - private void func_104070_b() { -- this.b = new String[]{I18n.getString("options.difficulty.peaceful"), I18n.getString("options.difficulty.easy"), I18n.getString("options.difficulty.normal"), I18n.getString("options.difficulty.hard")}; -- this.c = new String[]{I18n.getString("selectWorld.gameMode.survival"), I18n.getString("selectWorld.gameMode.creative"), I18n.getString("selectWorld.gameMode.adventure")}; -- this.d = new String[][]{{I18n.getString("selectWorld.gameMode.survival.line1"), I18n.getString("selectWorld.gameMode.survival.line2")}, {I18n.getString("selectWorld.gameMode.creative.line1"), I18n.getString("selectWorld.gameMode.creative.line2")}, {I18n.getString("selectWorld.gameMode.adventure.line1"), I18n.getString("selectWorld.gameMode.adventure.line2")}}; -+ this.field_104077_b = new String[] {I18n.getString("options.difficulty.peaceful"), I18n.getString("options.difficulty.easy"), I18n.getString("options.difficulty.normal"), I18n.getString("options.difficulty.hard")}; -+ this.field_104078_c = new String[] {I18n.getString("selectWorld.gameMode.survival"), I18n.getString("selectWorld.gameMode.creative"), I18n.getString("selectWorld.gameMode.adventure")}; -+ this.field_104075_d = new String[][] {{I18n.getString("selectWorld.gameMode.survival.line1"), I18n.getString("selectWorld.gameMode.survival.line2")}, {I18n.getString("selectWorld.gameMode.creative.line1"), I18n.getString("selectWorld.gameMode.creative.line2")}, {I18n.getString("selectWorld.gameMode.adventure.line1"), I18n.getString("selectWorld.gameMode.adventure.line2")}}; - } - - private String func_104072_c() { - String var1 = I18n.getString("options.difficulty"); -- return var1 + ": " + this.b[this.field_104076_e]; -+ return var1 + ": " + this.field_104077_b[this.field_104076_e]; - } - - private String func_104067_d() { - String var1 = I18n.getString("selectWorld.gameMode"); -- return var1 + ": " + this.c[this.field_104073_f]; -+ return var1 + ": " + this.field_104078_c[this.field_104073_f]; - } - -- void func_104069_a(GuiButton var1) { -- if(var1.enabled) { -- if(var1.id == 5005) { -- this.field_104076_e = (this.field_104076_e + 1) % this.b.length; -- var1.f = this.func_104072_c(); -- } else if(var1.id == 5006) { -- this.field_104073_f = (this.field_104073_f + 1) % this.c.length; -- var1.f = this.func_104067_d(); -+ void func_104069_a(GuiButton par1GuiButton) { -+ if (par1GuiButton.enabled) { -+ if (par1GuiButton.id == 5005) { -+ this.field_104076_e = (this.field_104076_e + 1) % this.field_104077_b.length; -+ par1GuiButton.displayString = this.func_104072_c(); -+ } else if (par1GuiButton.id == 5006) { -+ this.field_104073_f = (this.field_104073_f + 1) % this.field_104078_c.length; -+ par1GuiButton.displayString = this.func_104067_d(); - } -- - } - } - -- public void func_104071_a(GuiScreen var1, FontRenderer var2) { -- var1.drawString(var2, this.d[this.field_104073_f][0], this.field_104082_i, this.field_104080_j + 50, 10526880); -- var1.drawString(var2, this.d[this.field_104073_f][1], this.field_104082_i, this.field_104080_j + 60, 10526880); -+ public void func_104071_a(GuiScreen par1GuiScreen, FontRenderer par2FontRenderer) { -+ par1GuiScreen.drawString(par2FontRenderer, this.field_104075_d[this.field_104073_f][0], this.field_104082_i, this.field_104080_j + 50, 10526880); -+ par1GuiScreen.drawString(par2FontRenderer, this.field_104075_d[this.field_104073_f][1], this.field_104082_i, this.field_104080_j + 60, 10526880); - } - } ---- net/minecraft/src/ChunkProviderServer.java -+++ net/minecraft/src/ChunkProviderServer.java -@@ -8,101 +8,134 @@ - import java.util.Set; - - public class ChunkProviderServer implements IChunkProvider { -- private Set b = new HashSet(); -- private Chunk dummyChunk; -- private IChunkProvider serverChunkGenerator; -- private IChunkLoader chunkLoader; -- public boolean chunkLoadOverride = true; -- private LongHashMap id2ChunkMap = new LongHashMap(); -- private List g = new ArrayList(); -+ -+ /** -+ * used by unload100OldestChunks to iterate the loadedChunkHashMap for unload (underlying assumption, first in, first -+ * out) -+ */ -+ private Set chunksToUnload = new HashSet(); -+ private Chunk defaultEmptyChunk; -+ private IChunkProvider currentChunkProvider; -+ private IChunkLoader currentChunkLoader; -+ -+ /** -+ * if this is false, the defaultEmptyChunk will be returned by the provider -+ */ -+ public boolean loadChunkOnProvideRequest = true; -+ private LongHashMap loadedChunkHashMap = new LongHashMap(); -+ private List loadedChunks = new ArrayList(); - private WorldServer worldObj; - -- public ChunkProviderServer(WorldServer var1, IChunkLoader var2, IChunkProvider var3) { -- this.dummyChunk = new EmptyChunk(var1, 0, 0); -- this.worldObj = var1; -- this.chunkLoader = var2; -- this.serverChunkGenerator = var3; -- } -- -- public boolean chunkExists(int var1, int var2) { -- return this.id2ChunkMap.containsItem(ChunkCoordIntPair.chunkXZ2Int(var1, var2)); -- } -- -- public void dropChunk(int var1, int var2) { -- if(this.worldObj.provider.canRespawnHere()) { -+ public ChunkProviderServer(WorldServer par1WorldServer, IChunkLoader par2IChunkLoader, IChunkProvider par3IChunkProvider) { -+ this.defaultEmptyChunk = new EmptyChunk(par1WorldServer, 0, 0); -+ this.worldObj = par1WorldServer; -+ this.currentChunkLoader = par2IChunkLoader; -+ this.currentChunkProvider = par3IChunkProvider; -+ } -+ -+ /** -+ * Checks to see if a chunk exists at x, y -+ */ -+ public boolean chunkExists(int par1, int par2) { -+ return this.loadedChunkHashMap.containsItem(ChunkCoordIntPair.chunkXZ2Int(par1, par2)); -+ } -+ -+ /** -+ * marks chunk for unload by "unload100OldestChunks" if there is no spawn point, or if the center of the chunk is -+ * outside 200 blocks (x or z) of the spawn -+ */ -+ public void unloadChunksIfNotNearSpawn(int par1, int par2) { -+ if (this.worldObj.provider.canRespawnHere()) { - ChunkCoordinates var3 = this.worldObj.getSpawnPoint(); -- int var4 = var1 * 16 + 8 - var3.posX; -- int var5 = var2 * 16 + 8 - var3.posZ; -+ int var4 = par1 * 16 + 8 - var3.posX; -+ int var5 = par2 * 16 + 8 - var3.posZ; - short var6 = 128; -- if(var4 < -var6 || var4 > var6 || var5 < -var6 || var5 > var6) { -- this.b.add(Long.valueOf(ChunkCoordIntPair.chunkXZ2Int(var1, var2))); -+ -+ if (var4 < -var6 || var4 > var6 || var5 < -var6 || var5 > var6) { -+ this.chunksToUnload.add(Long.valueOf(ChunkCoordIntPair.chunkXZ2Int(par1, par2))); - } - } else { -- this.b.add(Long.valueOf(ChunkCoordIntPair.chunkXZ2Int(var1, var2))); -+ this.chunksToUnload.add(Long.valueOf(ChunkCoordIntPair.chunkXZ2Int(par1, par2))); - } -- - } - -+ /** -+ * marks all chunks for unload, ignoring those near the spawn -+ */ - public void unloadAllChunks() { -- Iterator var1 = this.g.iterator(); -+ Iterator var1 = this.loadedChunks.iterator(); - -- while(var1.hasNext()) { -+ while (var1.hasNext()) { - Chunk var2 = (Chunk)var1.next(); -- this.dropChunk(var2.xPosition, var2.zPosition); -+ this.unloadChunksIfNotNearSpawn(var2.xPosition, var2.zPosition); - } -- - } - -- public Chunk loadChunk(int var1, int var2) { -- long var3 = ChunkCoordIntPair.chunkXZ2Int(var1, var2); -- this.b.remove(Long.valueOf(var3)); -- Chunk var5 = (Chunk)this.id2ChunkMap.getValueByKey(var3); -- if(var5 == null) { -- var5 = this.loadChunkFromFile(var1, var2); -- if(var5 == null) { -- if(this.serverChunkGenerator == null) { -- var5 = this.dummyChunk; -+ /** -+ * loads or generates the chunk at the chunk location specified -+ */ -+ public Chunk loadChunk(int par1, int par2) { -+ long var3 = ChunkCoordIntPair.chunkXZ2Int(par1, par2); -+ this.chunksToUnload.remove(Long.valueOf(var3)); -+ Chunk var5 = (Chunk)this.loadedChunkHashMap.getValueByKey(var3); -+ -+ if (var5 == null) { -+ var5 = this.safeLoadChunk(par1, par2); -+ -+ if (var5 == null) { -+ if (this.currentChunkProvider == null) { -+ var5 = this.defaultEmptyChunk; - } else { - try { -- var5 = this.serverChunkGenerator.provideChunk(var1, var2); -+ var5 = this.currentChunkProvider.provideChunk(par1, par2); - } catch (Throwable var9) { - CrashReport var7 = CrashReport.makeCrashReport(var9, "Exception generating new chunk"); - CrashReportCategory var8 = var7.makeCategory("Chunk to be generated"); -- var8.addCrashSection("Location", String.format("%d,%d", new Object[]{Integer.valueOf(var1), Integer.valueOf(var2)})); -+ var8.addCrashSection("Location", String.format("%d,%d", new Object[] {Integer.valueOf(par1), Integer.valueOf(par2)})); - var8.addCrashSection("Position hash", Long.valueOf(var3)); -- var8.addCrashSection("Generator", this.serverChunkGenerator.makeString()); -+ var8.addCrashSection("Generator", this.currentChunkProvider.makeString()); - throw new ReportedException(var7); - } - } - } - -- this.id2ChunkMap.add(var3, var5); -- this.g.add(var5); -- if(var5 != null) { -+ this.loadedChunkHashMap.add(var3, var5); -+ this.loadedChunks.add(var5); -+ -+ if (var5 != null) { - var5.onChunkLoad(); - } - -- var5.populateChunk(this, this, var1, var2); -+ var5.populateChunk(this, this, par1, par2); - } - - return var5; - } - -- public Chunk provideChunk(int var1, int var2) { -- Chunk var3 = (Chunk)this.id2ChunkMap.getValueByKey(ChunkCoordIntPair.chunkXZ2Int(var1, var2)); -- return var3 == null ? (!this.worldObj.findingSpawnPoint && !this.chunkLoadOverride ? this.dummyChunk : this.loadChunk(var1, var2)) : var3; -+ /** -+ * Will return back a chunk, if it doesn't exist and its not a MP client it will generates all the blocks for the -+ * specified chunk from the map seed and chunk seed -+ */ -+ public Chunk provideChunk(int par1, int par2) { -+ Chunk var3 = (Chunk)this.loadedChunkHashMap.getValueByKey(ChunkCoordIntPair.chunkXZ2Int(par1, par2)); -+ return var3 == null ? (!this.worldObj.findingSpawnPoint && !this.loadChunkOnProvideRequest ? this.defaultEmptyChunk : this.loadChunk(par1, par2)) : var3; - } - -- private Chunk loadChunkFromFile(int var1, int var2) { -- if(this.chunkLoader == null) { -+ /** -+ * used by loadChunk, but catches any exceptions if the load fails. -+ */ -+ private Chunk safeLoadChunk(int par1, int par2) { -+ if (this.currentChunkLoader == null) { - return null; - } else { - try { -- Chunk var3 = this.chunkLoader.loadChunk(this.worldObj, var1, var2); -- if(var3 != null) { -+ Chunk var3 = this.currentChunkLoader.loadChunk(this.worldObj, par1, par2); -+ -+ if (var3 != null) { - var3.lastSaveTime = this.worldObj.getTotalWorldTime(); -- if(this.serverChunkGenerator != null) { -- this.serverChunkGenerator.recreateStructures(var1, var2); -+ -+ if (this.currentChunkProvider != null) { -+ this.currentChunkProvider.recreateStructures(par1, par2); - } - } - -@@ -114,57 +147,71 @@ - } - } - -- private void saveChunkExtraData(Chunk var1) { -- if(this.chunkLoader != null) { -+ /** -+ * used by saveChunks, but catches any exceptions if the save fails. -+ */ -+ private void safeSaveExtraChunkData(Chunk par1Chunk) { -+ if (this.currentChunkLoader != null) { - try { -- this.chunkLoader.saveExtraChunkData(this.worldObj, var1); -+ this.currentChunkLoader.saveExtraChunkData(this.worldObj, par1Chunk); - } catch (Exception var3) { - var3.printStackTrace(); - } -- - } - } - -- private void saveChunkData(Chunk var1) { -- if(this.chunkLoader != null) { -+ /** -+ * used by saveChunks, but catches any exceptions if the save fails. -+ */ -+ private void safeSaveChunk(Chunk par1Chunk) { -+ if (this.currentChunkLoader != null) { - try { -- var1.lastSaveTime = this.worldObj.getTotalWorldTime(); -- this.chunkLoader.saveChunk(this.worldObj, var1); -+ par1Chunk.lastSaveTime = this.worldObj.getTotalWorldTime(); -+ this.currentChunkLoader.saveChunk(this.worldObj, par1Chunk); - } catch (IOException var3) { - var3.printStackTrace(); - } catch (MinecraftException var4) { - var4.printStackTrace(); - } -- - } - } - -- public void populate(IChunkProvider var1, int var2, int var3) { -- Chunk var4 = this.provideChunk(var2, var3); -- if(!var4.isTerrainPopulated) { -+ /** -+ * Populates chunk with ores etc etc -+ */ -+ public void populate(IChunkProvider par1IChunkProvider, int par2, int par3) { -+ Chunk var4 = this.provideChunk(par2, par3); -+ -+ if (!var4.isTerrainPopulated) { - var4.isTerrainPopulated = true; -- if(this.serverChunkGenerator != null) { -- this.serverChunkGenerator.populate(var1, var2, var3); -+ -+ if (this.currentChunkProvider != null) { -+ this.currentChunkProvider.populate(par1IChunkProvider, par2, par3); - var4.setChunkModified(); - } - } -- - } - -- public boolean saveChunks(boolean var1, IProgressUpdate var2) { -+ /** -+ * Two modes of operation: if passed true, save all Chunks in one go. If passed false, save up to two chunks. Return -+ * true if all chunks have been saved. -+ */ -+ public boolean saveChunks(boolean par1, IProgressUpdate par2IProgressUpdate) { - int var3 = 0; - -- for(int var4 = 0; var4 < this.g.size(); ++var4) { -- Chunk var5 = (Chunk)this.g.get(var4); -- if(var1) { -- this.saveChunkExtraData(var5); -+ for (int var4 = 0; var4 < this.loadedChunks.size(); ++var4) { -+ Chunk var5 = (Chunk)this.loadedChunks.get(var4); -+ -+ if (par1) { -+ this.safeSaveExtraChunkData(var5); - } - -- if(var5.needsSaving(var1)) { -- this.saveChunkData(var5); -+ if (var5.needsSaving(par1)) { -+ this.safeSaveChunk(var5); - var5.isModified = false; - ++var3; -- if(var3 == 24 && !var1) { -+ -+ if (var3 == 24 && !par1) { - return false; - } - } -@@ -173,56 +220,73 @@ - return true; - } - -+ /** -+ * Save extra data not associated with any Chunk. Not saved during autosave, only during world unload. Currently -+ * unimplemented. -+ */ - public void saveExtraData() { -- if(this.chunkLoader != null) { -- this.chunkLoader.saveExtraData(); -+ if (this.currentChunkLoader != null) { -+ this.currentChunkLoader.saveExtraData(); - } -- - } - -+ /** -+ * Unloads chunks that are marked to be unloaded. This is not guaranteed to unload every such chunk. -+ */ - public boolean unloadQueuedChunks() { -- if(!this.worldObj.levelSaving) { -- for(int var1 = 0; var1 < 100; ++var1) { -- if(!this.b.isEmpty()) { -- Long var2 = (Long)this.b.iterator().next(); -- Chunk var3 = (Chunk)this.id2ChunkMap.getValueByKey(var2.longValue()); -+ if (!this.worldObj.canNotSave) { -+ for (int var1 = 0; var1 < 100; ++var1) { -+ if (!this.chunksToUnload.isEmpty()) { -+ Long var2 = (Long)this.chunksToUnload.iterator().next(); -+ Chunk var3 = (Chunk)this.loadedChunkHashMap.getValueByKey(var2.longValue()); - var3.onChunkUnload(); -- this.saveChunkData(var3); -- this.saveChunkExtraData(var3); -- this.b.remove(var2); -- this.id2ChunkMap.remove(var2.longValue()); -- this.g.remove(var3); -+ this.safeSaveChunk(var3); -+ this.safeSaveExtraChunkData(var3); -+ this.chunksToUnload.remove(var2); -+ this.loadedChunkHashMap.remove(var2.longValue()); -+ this.loadedChunks.remove(var3); - } - } - -- if(this.chunkLoader != null) { -- this.chunkLoader.chunkTick(); -+ if (this.currentChunkLoader != null) { -+ this.currentChunkLoader.chunkTick(); - } - } - -- return this.serverChunkGenerator.unloadQueuedChunks(); -+ return this.currentChunkProvider.unloadQueuedChunks(); - } - -+ /** -+ * Returns if the IChunkProvider supports saving. -+ */ - public boolean canSave() { -- return !this.worldObj.levelSaving; -+ return !this.worldObj.canNotSave; - } - -+ /** -+ * Converts the instance data to a readable string. -+ */ - public String makeString() { -- return "ServerChunkCache: " + this.id2ChunkMap.getNumHashElements() + " Drop: " + this.b.size(); -- } -- -- public List getPossibleCreatures(EnumCreatureType var1, int var2, int var3, int var4) { -- return this.serverChunkGenerator.getPossibleCreatures(var1, var2, var3, var4); -- } -- -- public ChunkPosition findClosestStructure(World var1, String var2, int var3, int var4, int var5) { -- return this.serverChunkGenerator.findClosestStructure(var1, var2, var3, var4, var5); -+ return "ServerChunkCache: " + this.loadedChunkHashMap.getNumHashElements() + " Drop: " + this.chunksToUnload.size(); -+ } -+ -+ /** -+ * Returns a list of creatures of the specified type that can spawn at the given location. -+ */ -+ public List getPossibleCreatures(EnumCreatureType par1EnumCreatureType, int par2, int par3, int par4) { -+ return this.currentChunkProvider.getPossibleCreatures(par1EnumCreatureType, par2, par3, par4); -+ } -+ -+ /** -+ * Returns the location of the closest structure of the specified type. If not found returns null. -+ */ -+ public ChunkPosition findClosestStructure(World par1World, String par2Str, int par3, int par4, int par5) { -+ return this.currentChunkProvider.findClosestStructure(par1World, par2Str, par3, par4, par5); - } - - public int getLoadedChunkCount() { -- return this.id2ChunkMap.getNumHashElements(); -+ return this.loadedChunkHashMap.getNumHashElements(); - } - -- public void recreateStructures(int var1, int var2) { -- } -+ public void recreateStructures(int par1, int par2) {} - } ---- /dev/null -+++ org/spoutcraft/client/gui/about/GuiNewAbout.java -@@ -1,0 +1,209 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.client.gui.about; -+ -+import java.io.File; -+import java.io.FileReader; -+import java.net.URL; -+import java.util.HashMap; -+import java.util.Iterator; -+import java.util.LinkedHashMap; -+import java.util.LinkedList; -+import java.util.List; -+import java.util.Set; -+import java.util.logging.Level; -+import java.util.logging.Logger; -+ -+import org.yaml.snakeyaml.Yaml; -+ -+import net.minecraft.src.GuiScreen; -+ -+import org.spoutcraft.api.gui.Button; -+import org.spoutcraft.api.gui.GenericButton; -+import org.spoutcraft.api.gui.GenericLabel; -+import org.spoutcraft.api.gui.GenericScrollArea; -+import org.spoutcraft.api.gui.Widget; -+import org.spoutcraft.api.gui.WidgetAnchor; -+import org.spoutcraft.client.SpoutClient; -+import org.spoutcraft.client.gui.ClientTexture; -+import org.spoutcraft.client.gui.GuiSpoutScreen; -+import org.spoutcraft.client.gui.mainmenu.MainMenu; -+import org.spoutcraft.client.io.FileUtil; -+import org.spoutcraft.client.io.DownloadAssets; -+import org.spoutcraft.client.io.CustomTextureManager; -+ -+public class GuiNewAbout extends GuiSpoutScreen { -+ private GuiScreen parent; -+ private GenericButton buttonDone; -+ private GenericLabel title, labelSpoutcraftVersion, labelMinecraftVersion; -+ private GenericScrollArea scroll; -+ private List> columns = new LinkedList>(); -+ private int sectionMargin = 20, columnMargin = 20; -+ private ClientTexture textureSpoutcraft, textureMinecraft; -+ private static HashMap root; -+ -+ static { -+ updateRoot(); -+ } -+ -+ private static void updateRoot() { -+ // DownloadAssets.downloadFile(FileUtil.getConfigDir(), "about.yml", "http://solder.inspirenxe.org/resources/spoutcraft/about.yml", true); -+ File myFile = new File(FileUtil.getConfigDir(), "about.yml"); -+ -+ try { -+ root = (HashMap) (new Yaml()).load((new FileReader(myFile))); -+ } catch (Exception ex) { -+ Logger.getLogger(GuiNewAbout.class.getName()).log(Level.SEVERE, null, ex); -+ } -+ } -+ -+ public GuiNewAbout(GuiScreen parent) { -+ this.parent = parent; -+ } -+ -+ @Override -+ protected void createInstances() { -+ title = new GenericLabel("About"); -+ buttonDone = new GenericButton("Main Menu"); -+ scroll = new GenericScrollArea(); -+ -+ labelSpoutcraftVersion = new GenericLabel(SpoutClient.getSpoutcraftVersion() + SpoutClient.getSpoutcraftBuild() + "\nLicensed under LGPLv3"); -+ labelMinecraftVersion = new GenericLabel("Copyright Mojang AB"); -+ labelSpoutcraftVersion.setAlign(WidgetAnchor.TOP_RIGHT); -+ textureSpoutcraft = new ClientTexture(FileUtil.getAssetsDir().getPath()+"/logo/spoutcraft.png"); -+ textureMinecraft = new ClientTexture(FileUtil.getAssetsDir().getPath()+"/logo/minecraft.png"); -+ -+ getScreen().attachWidgets("Spoutcraft", title, buttonDone, scroll, labelMinecraftVersion, labelSpoutcraftVersion, textureMinecraft, textureSpoutcraft); -+ -+ load(); -+ } -+ -+ @SuppressWarnings("unchecked") -+ public void load() { -+ scroll.removeWidgets("Spoutcraft"); -+ try { -+ if (root.containsKey("options")) { -+ HashMap options = (HashMap) root -+ .get("options"); -+ if (options.containsKey("section-margin")) { -+ sectionMargin = (Integer) options.get("section-margin"); -+ } -+ if (options.containsKey("column-margin")) { -+ columnMargin = (Integer) options.get("column-margin"); -+ } -+ } -+ if (root.containsKey("columns")) { -+ LinkedHashMap columns = (LinkedHashMap) root -+ .get("columns"); -+ for (Object col : columns.values()) { -+ List
sections = new LinkedList
(); -+ LinkedHashMap secs = (LinkedHashMap) col; -+ for (Object sec : secs.values()) { -+ LinkedHashMap section = (LinkedHashMap) sec; -+ String title = "Untitled"; -+ if (section.containsKey("title")) { -+ title = (String) section.get("title"); -+ } -+ Set keys = section.keySet(); -+ if (keys.size() > 2) { -+ continue; -+ } -+ String sectionType = ""; -+ for (String key : keys) { -+ if (!key.equals("title")) { -+ sectionType = key; -+ } -+ } -+ Section sectionObject = Section.getSection(sectionType); -+ if (sectionObject == null) { -+ continue; -+ } -+ sectionObject.init(this, title, section.get(sectionType)); -+ scroll.attachWidgets("Spoutcraft", sectionObject -+ .getWidgets().toArray(new Widget[0])); -+ sections.add(sectionObject); -+ } -+ this.columns.add(sections); -+ } -+ } -+ } catch (Exception e) { -+ e.printStackTrace(); -+ } finally { -+ layoutWidgets(); -+ } -+ } -+ -+ @Override -+ protected void layoutWidgets() { -+ int top = 10; -+ -+ int swidth = mc.fontRenderer.getStringWidth(title.getText()); -+ title.setY(top).setX(width / 2 - swidth / 2).setHeight(11) -+ .setWidth(swidth); -+ -+ int viewheight = height - title.getY() - 16 - 53; -+ -+ scroll.setGeometry(5, title.getY() + 16, width - 10, viewheight); -+ -+ textureSpoutcraft.setGeometry(width - 133, height - 48, 128, 32); -+ textureMinecraft.setGeometry(5, height - 46, 128, 20); -+ -+ labelMinecraftVersion.setGeometry(5, height - 25, width - (width / 2 - 50) - 5, 21); -+ labelSpoutcraftVersion.setGeometry(width - 5, height - 25, width - (width / 2 + 55), 21); -+ buttonDone.setGeometry(width / 2 - 50, height - 25, 100, 20); -+ -+ int columnCount = columns.size(); -+ if (columnCount > 0) { -+ int columnWidth = (width - 10 - 16 - (columnCount + 1) -+ * columnMargin) -+ / (columnCount); -+ int columnX = columnMargin; -+ Iterator> iter = columns.iterator(); -+ while (iter.hasNext()) { -+ List
column = iter.next(); -+ int sectionY = columnMargin; -+ for (Section section : column) { -+ section.setX(columnX); -+ section.setY(sectionY); -+ section.setWidth(columnWidth); -+ sectionY += section.getHeight() + sectionMargin; -+ } -+ columnX += columnWidth + columnMargin; -+ } -+ scroll.updateInnerSize(); -+ } -+ } -+ -+ @Override -+ public void onGuiClosed() { -+ super.onGuiClosed(); -+ } -+ -+ @Override -+ protected void buttonClicked(Button btn) { -+ if (btn == buttonDone) { -+ mc.displayGuiScreen(parent); -+ } -+ } -+ -+ public void update() { -+ layoutWidgets(); -+ } -+} ---- /dev/null -+++ org/spoutcraft/api/util/MutableLocation.java -@@ -1,0 +1,114 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.api.util; -+ -+import org.apache.commons.lang3.builder.EqualsBuilder; -+import org.apache.commons.lang3.builder.HashCodeBuilder; -+ -+public class MutableLocation extends MutableVector implements Location { -+ private double pitch; -+ private double yaw; -+ -+ public MutableLocation() { -+ pitch = yaw = 0D; -+ } -+ -+ /** -+ * Constructs a new Location with the given coordinates -+ * -+ * @param world The world in which this location resides -+ * @param x The x-coordinate of this new location -+ * @param y The y-coordinate of this new location -+ * @param z The z-coordinate of this new location -+ */ -+ public MutableLocation(final double x, final double y, final double z) { -+ this(x, y, z, 0, 0); -+ } -+ -+ /** -+ * Constructs a new Location with the given coordinates and direction -+ * -+ * @param world The world in which this location resides -+ * @param x The x-coordinate of this new location -+ * @param y The y-coordinate of this new location -+ * @param z The z-coordinate of this new location -+ * @param yaw The absolute rotation on the x-plane, in degrees -+ * @param pitch The absolute rotation on the y-plane, in degrees -+ */ -+ public MutableLocation(final double x, final double y, final double z, final double yaw, final double pitch) { -+ this.x = x; -+ this.y = y; -+ this.z = z; -+ this.pitch = pitch; -+ this.yaw = yaw; -+ } -+ -+ public double getYaw() { -+ return yaw; -+ } -+ -+ public double getPitch() { -+ return pitch; -+ } -+ -+ public Location setYaw(double yaw) { -+ this.yaw = yaw; -+ return this; -+ } -+ -+ public Location setPitch(double pitch) { -+ this.pitch = pitch; -+ return this; -+ } -+ -+ public Vector getDirection() { -+ Vector vector = new MutableVector(); -+ -+ double rotX = this.getYaw(); -+ double rotY = this.getPitch(); -+ -+ vector.setY(-Math.sin(Math.toRadians(rotY))); -+ -+ double h = Math.cos(Math.toRadians(rotY)); -+ -+ vector.setX(-h * Math.sin(Math.toRadians(rotX))); -+ vector.setZ(h * Math.cos(Math.toRadians(rotX))); -+ -+ return vector; -+ } -+ -+ @Override -+ public boolean equals(Object obj) { -+ if (obj instanceof Location) { -+ Location other = (Location) obj; -+ return (new EqualsBuilder()).append(getX(), other.getX()).append(getY(), other.getY()).append(getZ(), other.getZ()).append(getYaw(), other.getYaw()).append(getPitch(), other.getPitch()).isEquals(); -+ } -+ return false; -+ } -+ -+ @Override -+ public int hashCode() { -+ return (new HashCodeBuilder()).append(getX()).append(getY()).append(getZ()).append(getYaw()).append(getPitch()).toHashCode(); -+ } -+ -+ public Vector toVector() { -+ return new MutableVector(x, y, z); -+ } -+} ---- net/minecraft/src/BlockPane.java -+++ net/minecraft/src/BlockPane.java -@@ -4,90 +4,127 @@ - import java.util.Random; - - public class BlockPane extends Block { -- private final String a; -+ -+ /** -+ * Holds the texture index of the side of the pane (the thin lateral side) -+ */ -+ private final String sideTextureIndex; -+ -+ /** -+ * If this field is true, the pane block drops itself when destroyed (like the iron fences), otherwise, it's just -+ * destroyed (like glass panes) -+ */ - private final boolean canDropItself; -- private final String c; -+ private final String field_94402_c; - private Icon theIcon; - -- protected BlockPane(int var1, String var2, String var3, Material var4, boolean var5) { -- super(var1, var4); -- this.a = var3; -- this.canDropItself = var5; -- this.c = var2; -+ protected BlockPane(int par1, String par2Str, String par3Str, Material par4Material, boolean par5) { -+ super(par1, par4Material); -+ this.sideTextureIndex = par3Str; -+ this.canDropItself = par5; -+ this.field_94402_c = par2Str; - this.setCreativeTab(CreativeTabs.tabDecorations); - } - -- public int idDropped(int var1, Random var2, int var3) { -- return !this.canDropItself ? 0 : super.idDropped(var1, var2, var3); -+ /** -+ * Returns the ID of the items to drop on destruction. -+ */ -+ public int idDropped(int par1, Random par2Random, int par3) { -+ return !this.canDropItself ? 0 : super.idDropped(par1, par2Random, par3); - } - -+ /** -+ * Is this block (a) opaque and (b) a full 1m cube? This determines whether or not to render the shared face of two -+ * adjacent blocks and also whether the player can attach torches, redstone wire, etc to this block. -+ */ - public boolean isOpaqueCube() { - return false; - } - -+ /** -+ * If this block doesn't render as an ordinary block it will return False (examples: signs, buttons, stairs, etc) -+ */ - public boolean renderAsNormalBlock() { - return false; - } - -+ /** -+ * The type of render function that is called for this block -+ */ - public int getRenderType() { - return 18; - } - -- public boolean shouldSideBeRendered(IBlockAccess var1, int var2, int var3, int var4, int var5) { -- int var6 = var1.getBlockId(var2, var3, var4); -- return var6 == this.blockID ? false : super.shouldSideBeRendered(var1, var2, var3, var4, var5); -- } -- -- public void addCollisionBoxesToList(World var1, int var2, int var3, int var4, AxisAlignedBB var5, List var6, Entity var7) { -- boolean var8 = this.canThisPaneConnectToThisBlockID(var1.getBlockId(var2, var3, var4 - 1)); -- boolean var9 = this.canThisPaneConnectToThisBlockID(var1.getBlockId(var2, var3, var4 + 1)); -- boolean var10 = this.canThisPaneConnectToThisBlockID(var1.getBlockId(var2 - 1, var3, var4)); -- boolean var11 = this.canThisPaneConnectToThisBlockID(var1.getBlockId(var2 + 1, var3, var4)); -- if((!var10 || !var11) && (var10 || var11 || var8 || var9)) { -- if(var10 && !var11) { -- this.setBlockBounds(0.0F, 0.0F, 7.0F / 16.0F, 0.5F, 1.0F, 9.0F / 16.0F); -- super.addCollisionBoxesToList(var1, var2, var3, var4, var5, var6, var7); -- } else if(!var10 && var11) { -- this.setBlockBounds(0.5F, 0.0F, 7.0F / 16.0F, 1.0F, 1.0F, 9.0F / 16.0F); -- super.addCollisionBoxesToList(var1, var2, var3, var4, var5, var6, var7); -- } -- } else { -- this.setBlockBounds(0.0F, 0.0F, 7.0F / 16.0F, 1.0F, 1.0F, 9.0F / 16.0F); -- super.addCollisionBoxesToList(var1, var2, var3, var4, var5, var6, var7); -- } -- -- if((!var8 || !var9) && (var10 || var11 || var8 || var9)) { -- if(var8 && !var9) { -- this.setBlockBounds(7.0F / 16.0F, 0.0F, 0.0F, 9.0F / 16.0F, 1.0F, 0.5F); -- super.addCollisionBoxesToList(var1, var2, var3, var4, var5, var6, var7); -- } else if(!var8 && var9) { -- this.setBlockBounds(7.0F / 16.0F, 0.0F, 0.5F, 9.0F / 16.0F, 1.0F, 1.0F); -- super.addCollisionBoxesToList(var1, var2, var3, var4, var5, var6, var7); -- } -- } else { -- this.setBlockBounds(7.0F / 16.0F, 0.0F, 0.0F, 9.0F / 16.0F, 1.0F, 1.0F); -- super.addCollisionBoxesToList(var1, var2, var3, var4, var5, var6, var7); -- } -- -- } -- -+ /** -+ * Returns true if the given side of this block type should be rendered, if the adjacent block is at the given -+ * coordinates. Args: blockAccess, x, y, z, side -+ */ -+ public boolean shouldSideBeRendered(IBlockAccess par1IBlockAccess, int par2, int par3, int par4, int par5) { -+ int var6 = par1IBlockAccess.getBlockId(par2, par3, par4); -+ return var6 == this.blockID ? false : super.shouldSideBeRendered(par1IBlockAccess, par2, par3, par4, par5); -+ } -+ -+ /** -+ * Adds all intersecting collision boxes to a list. (Be sure to only add boxes to the list if they intersect the mask.) -+ * Parameters: World, X, Y, Z, mask, list, colliding entity -+ */ -+ public void addCollisionBoxesToList(World par1World, int par2, int par3, int par4, AxisAlignedBB par5AxisAlignedBB, List par6List, Entity par7Entity) { -+ boolean var8 = this.canThisPaneConnectToThisBlockID(par1World.getBlockId(par2, par3, par4 - 1)); -+ boolean var9 = this.canThisPaneConnectToThisBlockID(par1World.getBlockId(par2, par3, par4 + 1)); -+ boolean var10 = this.canThisPaneConnectToThisBlockID(par1World.getBlockId(par2 - 1, par3, par4)); -+ boolean var11 = this.canThisPaneConnectToThisBlockID(par1World.getBlockId(par2 + 1, par3, par4)); -+ -+ if ((!var10 || !var11) && (var10 || var11 || var8 || var9)) { -+ if (var10 && !var11) { -+ this.setBlockBounds(0.0F, 0.0F, 0.4375F, 0.5F, 1.0F, 0.5625F); -+ super.addCollisionBoxesToList(par1World, par2, par3, par4, par5AxisAlignedBB, par6List, par7Entity); -+ } else if (!var10 && var11) { -+ this.setBlockBounds(0.5F, 0.0F, 0.4375F, 1.0F, 1.0F, 0.5625F); -+ super.addCollisionBoxesToList(par1World, par2, par3, par4, par5AxisAlignedBB, par6List, par7Entity); -+ } -+ } else { -+ this.setBlockBounds(0.0F, 0.0F, 0.4375F, 1.0F, 1.0F, 0.5625F); -+ super.addCollisionBoxesToList(par1World, par2, par3, par4, par5AxisAlignedBB, par6List, par7Entity); -+ } -+ -+ if ((!var8 || !var9) && (var10 || var11 || var8 || var9)) { -+ if (var8 && !var9) { -+ this.setBlockBounds(0.4375F, 0.0F, 0.0F, 0.5625F, 1.0F, 0.5F); -+ super.addCollisionBoxesToList(par1World, par2, par3, par4, par5AxisAlignedBB, par6List, par7Entity); -+ } else if (!var8 && var9) { -+ this.setBlockBounds(0.4375F, 0.0F, 0.5F, 0.5625F, 1.0F, 1.0F); -+ super.addCollisionBoxesToList(par1World, par2, par3, par4, par5AxisAlignedBB, par6List, par7Entity); -+ } -+ } else { -+ this.setBlockBounds(0.4375F, 0.0F, 0.0F, 0.5625F, 1.0F, 1.0F); -+ super.addCollisionBoxesToList(par1World, par2, par3, par4, par5AxisAlignedBB, par6List, par7Entity); -+ } -+ } -+ -+ /** -+ * Sets the block's bounds for rendering it as an item -+ */ - public void setBlockBoundsForItemRender() { - this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F); - } - -- public void setBlockBoundsBasedOnState(IBlockAccess var1, int var2, int var3, int var4) { -- float var5 = 7.0F / 16.0F; -- float var6 = 9.0F / 16.0F; -- float var7 = 7.0F / 16.0F; -- float var8 = 9.0F / 16.0F; -- boolean var9 = this.canThisPaneConnectToThisBlockID(var1.getBlockId(var2, var3, var4 - 1)); -- boolean var10 = this.canThisPaneConnectToThisBlockID(var1.getBlockId(var2, var3, var4 + 1)); -- boolean var11 = this.canThisPaneConnectToThisBlockID(var1.getBlockId(var2 - 1, var3, var4)); -- boolean var12 = this.canThisPaneConnectToThisBlockID(var1.getBlockId(var2 + 1, var3, var4)); -- if((!var11 || !var12) && (var11 || var12 || var9 || var10)) { -- if(var11 && !var12) { -+ /** -+ * Updates the blocks bounds based on its current state. Args: world, x, y, z -+ */ -+ public void setBlockBoundsBasedOnState(IBlockAccess par1IBlockAccess, int par2, int par3, int par4) { -+ float var5 = 0.4375F; -+ float var6 = 0.5625F; -+ float var7 = 0.4375F; -+ float var8 = 0.5625F; -+ boolean var9 = this.canThisPaneConnectToThisBlockID(par1IBlockAccess.getBlockId(par2, par3, par4 - 1)); -+ boolean var10 = this.canThisPaneConnectToThisBlockID(par1IBlockAccess.getBlockId(par2, par3, par4 + 1)); -+ boolean var11 = this.canThisPaneConnectToThisBlockID(par1IBlockAccess.getBlockId(par2 - 1, par3, par4)); -+ boolean var12 = this.canThisPaneConnectToThisBlockID(par1IBlockAccess.getBlockId(par2 + 1, par3, par4)); -+ -+ if ((!var11 || !var12) && (var11 || var12 || var9 || var10)) { -+ if (var11 && !var12) { - var5 = 0.0F; -- } else if(!var11 && var12) { -+ } else if (!var11 && var12) { - var6 = 1.0F; - } - } else { -@@ -95,10 +132,10 @@ - var6 = 1.0F; - } - -- if((!var9 || !var10) && (var11 || var12 || var9 || var10)) { -- if(var9 && !var10) { -+ if ((!var9 || !var10) && (var11 || var12 || var9 || var10)) { -+ if (var9 && !var10) { - var7 = 0.0F; -- } else if(!var9 && var10) { -+ } else if (!var9 && var10) { - var8 = 1.0F; - } - } else { -@@ -109,24 +146,44 @@ - this.setBlockBounds(var5, 0.0F, var7, var6, 1.0F, var8); - } - -+ /** -+ * Returns the texture index of the thin side of the pane. -+ */ - public Icon getSideTextureIndex() { - return this.theIcon; - } - -- public final boolean canThisPaneConnectToThisBlockID(int var1) { -- return Block.opaqueCubeLookup[var1] || var1 == this.blockID || var1 == Block.glass.blockID; -+ /** -+ * Gets passed in the blockID of the block adjacent and supposed to return true if its allowed to connect to the type -+ * of blockID passed in. Args: blockID -+ */ -+ public final boolean canThisPaneConnectToThisBlockID(int par1) { -+ // Spout Start - Add cloth and stoneBrick IDs -+ return Block.opaqueCubeLookup[par1] || par1 == this.blockID || par1 == Block.glass.blockID || par1 == Block.cloth.blockID || par1 == Block.stoneBrick.blockID; -+ // Spout End - } - -+ /** -+ * Return true if a player with Silk Touch can harvest this block directly, and not its normal drops. -+ */ - protected boolean canSilkHarvest() { - return true; - } - -- protected ItemStack createStackedBlock(int var1) { -- return new ItemStack(this.blockID, 1, var1); -+ /** -+ * Returns an item stack containing a single instance of the current block type. 'i' is the block's subtype/damage and -+ * is ignored for blocks which do not support subtypes. Blocks which cannot be harvested should return null. -+ */ -+ protected ItemStack createStackedBlock(int par1) { -+ return new ItemStack(this.blockID, 1, par1); - } - -- public void registerIcons(IconRegister var1) { -- this.blockIcon = var1.registerIcon(this.c); -- this.theIcon = var1.registerIcon(this.a); -+ /** -+ * When this method is called, your block should register all the icons it needs with the given IconRegister. This is -+ * the only chance you get to register icons. -+ */ -+ public void registerIcons(IconRegister par1IconRegister) { -+ this.blockIcon = par1IconRegister.registerIcon(this.field_94402_c); -+ this.theIcon = par1IconRegister.registerIcon(this.sideTextureIndex); - } - } ---- net/minecraft/src/CommandServerSaveOff.java -+++ net/minecraft/src/CommandServerSaveOff.java -@@ -7,30 +7,34 @@ - return "save-off"; - } - -+ /** -+ * Return the required permission level for this command. -+ */ - public int getRequiredPermissionLevel() { - return 4; - } - -- public String getCommandUsage(ICommandSender var1) { -+ public String getCommandUsage(ICommandSender par1ICommandSender) { - return "commands.save-off.usage"; - } - -- public void processCommand(ICommandSender var1, String[] var2) { -+ public void processCommand(ICommandSender par1ICommandSender, String[] par2ArrayOfStr) { - MinecraftServer var3 = MinecraftServer.getServer(); - boolean var4 = false; - -- for(int var5 = 0; var5 < var3.worldServers.length; ++var5) { -- if(var3.worldServers[var5] != null) { -+ for (int var5 = 0; var5 < var3.worldServers.length; ++var5) { -+ if (var3.worldServers[var5] != null) { - WorldServer var6 = var3.worldServers[var5]; -- if(!var6.levelSaving) { -- var6.levelSaving = true; -+ -+ if (!var6.canNotSave) { -+ var6.canNotSave = true; - var4 = true; - } - } - } - -- if(var4) { -- notifyAdmins(var1, "commands.save.disabled", new Object[0]); -+ if (var4) { -+ notifyAdmins(par1ICommandSender, "commands.save.disabled", new Object[0]); - } else { - throw new CommandException("commands.save-off.alreadyOff", new Object[0]); - } ---- net/minecraft/src/AABBPool.java -+++ net/minecraft/src/AABBPool.java -@@ -4,42 +4,69 @@ - import java.util.List; - - public class AABBPool { -+ -+ /** -+ * Maximum number of times the pool can be "cleaned" before the list is shrunk -+ */ - private final int maxNumCleans; -+ -+ /** -+ * Number of Pool entries to remove when cleanPool is called maxNumCleans times. -+ */ - private final int numEntriesToRemove; -- private final List c = new ArrayList(); -+ -+ /** List of AABB stored in this Pool */ -+ private final List listAABB = new ArrayList(); -+ -+ /** Next index to use when adding a Pool Entry. */ - private int nextPoolIndex; -+ -+ /** -+ * Largest index reached by this Pool (can be reset to 0 upon calling cleanPool) -+ */ - private int maxPoolIndex; -+ -+ /** Number of times this Pool has been cleaned */ - private int numCleans; - -- public AABBPool(int var1, int var2) { -- this.maxNumCleans = var1; -- this.numEntriesToRemove = var2; -+ public AABBPool(int par1, int par2) { -+ this.maxNumCleans = par1; -+ this.numEntriesToRemove = par2; - } - -- public AxisAlignedBB getAABB(double var1, double var3, double var5, double var7, double var9, double var11) { -+ /** -+ * Creates a new AABB, or reuses one that's no longer in use. Parameters: minX, minY, minZ, maxX, maxY, maxZ. AABBs -+ * returned from this function should only be used for one frame or tick, as after that they will be reused. -+ */ -+ public AxisAlignedBB getAABB(double par1, double par3, double par5, double par7, double par9, double par11) { - AxisAlignedBB var13; -- if(this.nextPoolIndex >= this.c.size()) { -- var13 = new AxisAlignedBB(var1, var3, var5, var7, var9, var11); -- this.c.add(var13); -+ -+ if (this.nextPoolIndex >= this.listAABB.size()) { -+ var13 = new AxisAlignedBB(par1, par3, par5, par7, par9, par11); -+ this.listAABB.add(var13); - } else { -- var13 = (AxisAlignedBB)this.c.get(this.nextPoolIndex); -- var13.setBounds(var1, var3, var5, var7, var9, var11); -+ var13 = (AxisAlignedBB)this.listAABB.get(this.nextPoolIndex); -+ var13.setBounds(par1, par3, par5, par7, par9, par11); - } - - ++this.nextPoolIndex; - return var13; - } - -+ /** -+ * Marks the pool as "empty", starting over when adding new entries. If this is called maxNumCleans times, the list -+ * size is reduced -+ */ - public void cleanPool() { -- if(this.nextPoolIndex > this.maxPoolIndex) { -+ if (this.nextPoolIndex > this.maxPoolIndex) { - this.maxPoolIndex = this.nextPoolIndex; - } - -- if(this.numCleans++ == this.maxNumCleans) { -- int var1 = Math.max(this.maxPoolIndex, this.c.size() - this.numEntriesToRemove); -+ if (this.numCleans++ == this.maxNumCleans) { -+ int var1 = Math.max(this.maxPoolIndex, this.listAABB.size() - this.numEntriesToRemove); - -- while(this.c.size() > var1) { -- this.c.remove(var1); -+ while (this.listAABB.size() > var1) { -+ this.listAABB.remove(var1); - } - - this.maxPoolIndex = 0; -@@ -49,13 +76,16 @@ - this.nextPoolIndex = 0; - } - -+ /** -+ * Clears the AABBPool -+ */ - public void clearPool() { - this.nextPoolIndex = 0; -- this.c.clear(); -+ this.listAABB.clear(); - } - - public int getlistAABBsize() { -- return this.c.size(); -+ return this.listAABB.size(); - } - - public int getnextPoolIndex() { ---- /dev/null -+++ org/spoutcraft/api/material/item/GenericFood.java -@@ -1,0 +1,34 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.api.material.item; -+ -+import org.spoutcraft.api.material.Food; -+ -+public class GenericFood extends GenericItem implements Food { -+ private final int hunger; -+ public GenericFood(String name, int id, int hunger) { -+ super(name, id); -+ this.hunger = hunger; -+ } -+ -+ public int getHungerRestored() { -+ return hunger; -+ } -+} ---- net/minecraft/src/GenLayerShore.java -+++ net/minecraft/src/GenLayerShore.java -@@ -1,55 +1,63 @@ - package net.minecraft.src; - - public class GenLayerShore extends GenLayer { -- public GenLayerShore(long var1, GenLayer var3) { -- super(var1); -- this.parent = var3; -+ public GenLayerShore(long par1, GenLayer par3GenLayer) { -+ super(par1); -+ this.parent = par3GenLayer; - } - -- public int[] getInts(int var1, int var2, int var3, int var4) { -- int[] var5 = this.parent.getInts(var1 - 1, var2 - 1, var3 + 2, var4 + 2); -- int[] var6 = IntCache.getIntCache(var3 * var4); -+ /** -+ * Returns a list of integer values generated by this layer. These may be interpreted as temperatures, rainfall -+ * amounts, or biomeList[] indices based on the particular GenLayer subclass. -+ */ -+ public int[] getInts(int par1, int par2, int par3, int par4) { -+ int[] var5 = this.parent.getInts(par1 - 1, par2 - 1, par3 + 2, par4 + 2); -+ int[] var6 = IntCache.getIntCache(par3 * par4); - -- for(int var7 = 0; var7 < var4; ++var7) { -- for(int var8 = 0; var8 < var3; ++var8) { -- this.initChunkSeed((long)(var8 + var1), (long)(var7 + var2)); -- int var9 = var5[var8 + 1 + (var7 + 1) * (var3 + 2)]; -+ for (int var7 = 0; var7 < par4; ++var7) { -+ for (int var8 = 0; var8 < par3; ++var8) { -+ this.initChunkSeed((long)(var8 + par1), (long)(var7 + par2)); -+ int var9 = var5[var8 + 1 + (var7 + 1) * (par3 + 2)]; - int var10; - int var11; - int var12; - int var13; -- if(var9 == BiomeGenBase.mushroomIsland.biomeID) { -- var10 = var5[var8 + 1 + (var7 + 1 - 1) * (var3 + 2)]; -- var11 = var5[var8 + 1 + 1 + (var7 + 1) * (var3 + 2)]; -- var12 = var5[var8 + 1 - 1 + (var7 + 1) * (var3 + 2)]; -- var13 = var5[var8 + 1 + (var7 + 1 + 1) * (var3 + 2)]; -- if(var10 != BiomeGenBase.ocean.biomeID && var11 != BiomeGenBase.ocean.biomeID && var12 != BiomeGenBase.ocean.biomeID && var13 != BiomeGenBase.ocean.biomeID) { -- var6[var8 + var7 * var3] = var9; -- } else { -- var6[var8 + var7 * var3] = BiomeGenBase.mushroomIslandShore.biomeID; -- } -- } else if(var9 != BiomeGenBase.ocean.biomeID && var9 != BiomeGenBase.river.biomeID && var9 != BiomeGenBase.swampland.biomeID && var9 != BiomeGenBase.extremeHills.biomeID) { -- var10 = var5[var8 + 1 + (var7 + 1 - 1) * (var3 + 2)]; -- var11 = var5[var8 + 1 + 1 + (var7 + 1) * (var3 + 2)]; -- var12 = var5[var8 + 1 - 1 + (var7 + 1) * (var3 + 2)]; -- var13 = var5[var8 + 1 + (var7 + 1 + 1) * (var3 + 2)]; -- if(var10 != BiomeGenBase.ocean.biomeID && var11 != BiomeGenBase.ocean.biomeID && var12 != BiomeGenBase.ocean.biomeID && var13 != BiomeGenBase.ocean.biomeID) { -- var6[var8 + var7 * var3] = var9; -- } else { -- var6[var8 + var7 * var3] = BiomeGenBase.beach.biomeID; -- } -- } else if(var9 == BiomeGenBase.extremeHills.biomeID) { -- var10 = var5[var8 + 1 + (var7 + 1 - 1) * (var3 + 2)]; -- var11 = var5[var8 + 1 + 1 + (var7 + 1) * (var3 + 2)]; -- var12 = var5[var8 + 1 - 1 + (var7 + 1) * (var3 + 2)]; -- var13 = var5[var8 + 1 + (var7 + 1 + 1) * (var3 + 2)]; -- if(var10 == BiomeGenBase.extremeHills.biomeID && var11 == BiomeGenBase.extremeHills.biomeID && var12 == BiomeGenBase.extremeHills.biomeID && var13 == BiomeGenBase.extremeHills.biomeID) { -- var6[var8 + var7 * var3] = var9; -- } else { -- var6[var8 + var7 * var3] = BiomeGenBase.extremeHillsEdge.biomeID; -+ -+ if (var9 == BiomeGenBase.mushroomIsland.biomeID) { -+ var10 = var5[var8 + 1 + (var7 + 1 - 1) * (par3 + 2)]; -+ var11 = var5[var8 + 1 + 1 + (var7 + 1) * (par3 + 2)]; -+ var12 = var5[var8 + 1 - 1 + (var7 + 1) * (par3 + 2)]; -+ var13 = var5[var8 + 1 + (var7 + 1 + 1) * (par3 + 2)]; -+ -+ if (var10 != BiomeGenBase.ocean.biomeID && var11 != BiomeGenBase.ocean.biomeID && var12 != BiomeGenBase.ocean.biomeID && var13 != BiomeGenBase.ocean.biomeID) { -+ var6[var8 + var7 * par3] = var9; -+ } else { -+ var6[var8 + var7 * par3] = BiomeGenBase.mushroomIslandShore.biomeID; -+ } -+ } else if (var9 != BiomeGenBase.ocean.biomeID && var9 != BiomeGenBase.river.biomeID && var9 != BiomeGenBase.swampland.biomeID && var9 != BiomeGenBase.extremeHills.biomeID) { -+ var10 = var5[var8 + 1 + (var7 + 1 - 1) * (par3 + 2)]; -+ var11 = var5[var8 + 1 + 1 + (var7 + 1) * (par3 + 2)]; -+ var12 = var5[var8 + 1 - 1 + (var7 + 1) * (par3 + 2)]; -+ var13 = var5[var8 + 1 + (var7 + 1 + 1) * (par3 + 2)]; -+ -+ if (var10 != BiomeGenBase.ocean.biomeID && var11 != BiomeGenBase.ocean.biomeID && var12 != BiomeGenBase.ocean.biomeID && var13 != BiomeGenBase.ocean.biomeID) { -+ var6[var8 + var7 * par3] = var9; -+ } else { -+ var6[var8 + var7 * par3] = BiomeGenBase.beach.biomeID; -+ } -+ } else if (var9 == BiomeGenBase.extremeHills.biomeID) { -+ var10 = var5[var8 + 1 + (var7 + 1 - 1) * (par3 + 2)]; -+ var11 = var5[var8 + 1 + 1 + (var7 + 1) * (par3 + 2)]; -+ var12 = var5[var8 + 1 - 1 + (var7 + 1) * (par3 + 2)]; -+ var13 = var5[var8 + 1 + (var7 + 1 + 1) * (par3 + 2)]; -+ -+ if (var10 == BiomeGenBase.extremeHills.biomeID && var11 == BiomeGenBase.extremeHills.biomeID && var12 == BiomeGenBase.extremeHills.biomeID && var13 == BiomeGenBase.extremeHills.biomeID) { -+ var6[var8 + var7 * par3] = var9; -+ } else { -+ var6[var8 + var7 * par3] = BiomeGenBase.extremeHillsEdge.biomeID; - } - } else { -- var6[var8 + var7 * var3] = var9; -+ var6[var8 + var7 * par3] = var9; - } - } - } ---- net/minecraft/src/StructureStrongholdPieceWeight.java -+++ net/minecraft/src/StructureStrongholdPieceWeight.java -@@ -1,18 +1,25 @@ - package net.minecraft.src; - - class StructureStrongholdPieceWeight { -- public Class a; -+ public Class pieceClass; -+ -+ /** -+ * This basically keeps track of the 'epicness' of a structure. Epic structure components have a higher 'weight', and -+ * Structures may only grow up to a certain 'weight' before generation is stopped -+ */ - public final int pieceWeight; - public int instancesSpawned; -+ -+ /** How many Structure Pieces of this type may spawn in a structure */ - public int instancesLimit; - -- public StructureStrongholdPieceWeight(Class var1, int var2, int var3) { -- this.a = var1; -- this.pieceWeight = var2; -- this.instancesLimit = var3; -+ public StructureStrongholdPieceWeight(Class par1Class, int par2, int par3) { -+ this.pieceClass = par1Class; -+ this.pieceWeight = par2; -+ this.instancesLimit = par3; - } - -- public boolean canSpawnMoreStructuresOfType(int var1) { -+ public boolean canSpawnMoreStructuresOfType(int par1) { - return this.instancesLimit == 0 || this.instancesSpawned < this.instancesLimit; - } - ---- net/minecraft/src/EntityMoveHelper.java -+++ net/minecraft/src/EntityMoveHelper.java -@@ -1,18 +1,22 @@ - package net.minecraft.src; - - public class EntityMoveHelper { -+ -+ /** The EntityLiving that is being moved */ - private EntityLiving entity; - private double posX; - private double posY; - private double posZ; -+ -+ /** The speed at which the entity should move */ - private double speed; - private boolean update; - -- public EntityMoveHelper(EntityLiving var1) { -- this.entity = var1; -- this.posX = var1.posX; -- this.posY = var1.posY; -- this.posZ = var1.posZ; -+ public EntityMoveHelper(EntityLiving par1EntityLiving) { -+ this.entity = par1EntityLiving; -+ this.posX = par1EntityLiving.posX; -+ this.posY = par1EntityLiving.posY; -+ this.posZ = par1EntityLiving.posZ; - } - - public boolean isUpdating() { -@@ -23,45 +27,54 @@ - return this.speed; - } - -- public void setMoveTo(double var1, double var3, double var5, double var7) { -- this.posX = var1; -- this.posY = var3; -- this.posZ = var5; -- this.speed = var7; -+ /** -+ * Sets the speed and location to move to -+ */ -+ public void setMoveTo(double par1, double par3, double par5, double par7) { -+ this.posX = par1; -+ this.posY = par3; -+ this.posZ = par5; -+ this.speed = par7; - this.update = true; - } - - public void onUpdateMoveHelper() { - this.entity.setMoveForward(0.0F); -- if(this.update) { -+ -+ if (this.update) { - this.update = false; - int var1 = MathHelper.floor_double(this.entity.boundingBox.minY + 0.5D); - double var2 = this.posX - this.entity.posX; - double var4 = this.posZ - this.entity.posZ; - double var6 = this.posY - (double)var1; - double var8 = var2 * var2 + var6 * var6 + var4 * var4; -- if(var8 >= (double)2.5000003E-7F) { -- float var10 = (float)(Math.atan2(var4, var2) * 180.0D / (double)((float)Math.PI)) - 90.0F; -+ -+ if (var8 >= 2.500000277905201E-7D) { -+ float var10 = (float)(Math.atan2(var4, var2) * 180.0D / Math.PI) - 90.0F; - this.entity.rotationYaw = this.limitAngle(this.entity.rotationYaw, var10, 30.0F); - this.entity.setAIMoveSpeed((float)(this.speed * this.entity.getEntityAttribute(SharedMonsterAttributes.movementSpeed).getAttributeValue())); -- if(var6 > 0.0D && var2 * var2 + var4 * var4 < 1.0D) { -+ -+ if (var6 > 0.0D && var2 * var2 + var4 * var4 < 1.0D) { - this.entity.getJumpHelper().setJumping(); - } -- - } - } - } - -- private float limitAngle(float var1, float var2, float var3) { -- float var4 = MathHelper.wrapAngleTo180_float(var2 - var1); -- if(var4 > var3) { -- var4 = var3; -- } -- -- if(var4 < -var3) { -- var4 = -var3; -- } -- -- return var1 + var4; -+ /** -+ * Limits the given angle to a upper and lower limit. -+ */ -+ private float limitAngle(float par1, float par2, float par3) { -+ float var4 = MathHelper.wrapAngleTo180_float(par2 - par1); -+ -+ if (var4 > par3) { -+ var4 = par3; -+ } -+ -+ if (var4 < -par3) { -+ var4 = -par3; -+ } -+ -+ return par1 + var4; - } - } ---- /dev/null -+++ com/prupe/mcpatcher/mob/MobRandomizer.java -@@ -1,0 +1,58 @@ -+package com.prupe.mcpatcher.mob; -+ -+import com.prupe.mcpatcher.MCLogger; -+import com.prupe.mcpatcher.TexturePackChangeHandler; -+import com.prupe.mcpatcher.mob.MobRandomizer$1; -+import com.prupe.mcpatcher.mob.MobRandomizer$ExtraInfo; -+import java.util.LinkedHashMap; -+import net.minecraft.src.Entity; -+import net.minecraft.src.EntityLivingBase; -+import net.minecraft.src.ResourceLocation; -+ -+public class MobRandomizer { -+ private static final MCLogger logger = MCLogger.getLogger("Random Mobs"); -+ private static final LinkedHashMap cache = new LinkedHashMap(); -+ -+ static void init() {} -+ -+ public static ResourceLocation randomTexture(EntityLivingBase entity, ResourceLocation texture) { -+ if (texture != null && texture.getResourcePath().endsWith(".png")) { -+ String key = texture.toString() + ":" + entity.entityId; -+ ResourceLocation newTexture = (ResourceLocation)cache.get(key); -+ -+ if (newTexture == null) { -+ MobRandomizer$ExtraInfo info = MobRandomizer$ExtraInfo.getInfo(entity); -+ MobRuleList list = MobRuleList.get(texture); -+ newTexture = list.getSkin(MobRandomizer$ExtraInfo.access$100(info), MobRandomizer$ExtraInfo.access$200(info), MobRandomizer$ExtraInfo.access$300(info), MobRandomizer$ExtraInfo.access$400(info), MobRandomizer$ExtraInfo.access$500(info)); -+ cache.put(key, newTexture); -+ logger.finer("entity %s using %s (cache: %d)", new Object[] {entity, newTexture, Integer.valueOf(cache.size())}); -+ -+ if (cache.size() > 250) { -+ while (cache.size() > 200) { -+ cache.remove(cache.keySet().iterator().next()); -+ } -+ } -+ } -+ -+ return newTexture; -+ } else { -+ return texture; -+ } -+ } -+ -+ public static ResourceLocation randomTexture(Entity entity, ResourceLocation texture) { -+ return entity instanceof EntityLivingBase ? randomTexture((EntityLivingBase)entity, texture) : texture; -+ } -+ -+ static LinkedHashMap access$000() { -+ return cache; -+ } -+ -+ static MCLogger access$600() { -+ return logger; -+ } -+ -+ static { -+ TexturePackChangeHandler.register(new MobRandomizer$1("Random Mobs", 2)); -+ } -+} ---- net/minecraft/src/CommandGive.java -+++ net/minecraft/src/CommandGive.java -@@ -8,50 +8,60 @@ - return "give"; - } - -+ /** -+ * Return the required permission level for this command. -+ */ - public int getRequiredPermissionLevel() { - return 2; - } - -- public String getCommandUsage(ICommandSender var1) { -+ public String getCommandUsage(ICommandSender par1ICommandSender) { - return "commands.give.usage"; - } - -- public void processCommand(ICommandSender var1, String[] var2) { -- if(var2.length >= 2) { -- EntityPlayerMP var3 = getPlayer(var1, var2[0]); -- int var4 = parseIntWithMin(var1, var2[1], 1); -+ public void processCommand(ICommandSender par1ICommandSender, String[] par2ArrayOfStr) { -+ if (par2ArrayOfStr.length >= 2) { -+ EntityPlayerMP var3 = getPlayer(par1ICommandSender, par2ArrayOfStr[0]); -+ int var4 = parseIntWithMin(par1ICommandSender, par2ArrayOfStr[1], 1); - int var5 = 1; - int var6 = 0; -- if(Item.itemsList[var4] == null) { -- throw new NumberInvalidException("commands.give.notFound", new Object[]{Integer.valueOf(var4)}); -+ -+ if (Item.itemsList[var4] == null) { -+ throw new NumberInvalidException("commands.give.notFound", new Object[] {Integer.valueOf(var4)}); - } else { -- if(var2.length >= 3) { -- var5 = parseIntBounded(var1, var2[2], 1, 64); -+ if (par2ArrayOfStr.length >= 3) { -+ var5 = parseIntBounded(par1ICommandSender, par2ArrayOfStr[2], 1, 64); - } - -- if(var2.length >= 4) { -- var6 = parseInt(var1, var2[3]); -+ if (par2ArrayOfStr.length >= 4) { -+ var6 = parseInt(par1ICommandSender, par2ArrayOfStr[3]); - } - - ItemStack var7 = new ItemStack(var4, var5, var6); - EntityItem var8 = var3.dropPlayerItem(var7); - var8.delayBeforeCanPickup = 0; -- notifyAdmins(var1, "commands.give.success", new Object[]{Item.itemsList[var4].getItemStackDisplayName(var7), Integer.valueOf(var4), Integer.valueOf(var5), var3.getEntityName()}); -+ notifyAdmins(par1ICommandSender, "commands.give.success", new Object[] {Item.itemsList[var4].getItemStackDisplayName(var7), Integer.valueOf(var4), Integer.valueOf(var5), var3.getEntityName()}); - } - } else { - throw new WrongUsageException("commands.give.usage", new Object[0]); - } - } - -- public List addTabCompletionOptions(ICommandSender var1, String[] var2) { -- return var2.length == 1 ? getListOfStringsMatchingLastWord(var2, this.getPlayers()) : null; -+ /** -+ * Adds the strings available in this command to the given list of tab completion options. -+ */ -+ public List addTabCompletionOptions(ICommandSender par1ICommandSender, String[] par2ArrayOfStr) { -+ return par2ArrayOfStr.length == 1 ? getListOfStringsMatchingLastWord(par2ArrayOfStr, this.getPlayers()) : null; - } - - protected String[] getPlayers() { - return MinecraftServer.getServer().getAllUsernames(); - } - -- public boolean isUsernameIndex(String[] var1, int var2) { -- return var2 == 0; -+ /** -+ * Return whether the specified command parameter index is a username parameter. -+ */ -+ public boolean isUsernameIndex(String[] par1ArrayOfStr, int par2) { -+ return par2 == 0; - } - } ---- net/minecraft/src/EnchantmentArrowInfinite.java -+++ net/minecraft/src/EnchantmentArrowInfinite.java -@@ -1,19 +1,28 @@ - package net.minecraft.src; - - public class EnchantmentArrowInfinite extends Enchantment { -- public EnchantmentArrowInfinite(int var1, int var2) { -- super(var1, var2, EnumEnchantmentType.bow); -+ public EnchantmentArrowInfinite(int par1, int par2) { -+ super(par1, par2, EnumEnchantmentType.bow); - this.setName("arrowInfinite"); - } - -- public int getMinEnchantability(int var1) { -+ /** -+ * Returns the minimal value of enchantability needed on the enchantment level passed. -+ */ -+ public int getMinEnchantability(int par1) { - return 20; - } - -- public int getMaxEnchantability(int var1) { -+ /** -+ * Returns the maximum value of enchantability nedded on the enchantment level passed. -+ */ -+ public int getMaxEnchantability(int par1) { - return 50; - } - -+ /** -+ * Returns the maximum level that the enchantment can have. -+ */ - public int getMaxLevel() { - return 1; - } ---- net/minecraft/src/MapItemRenderer.java -+++ net/minecraft/src/MapItemRenderer.java -@@ -10,32 +10,33 @@ - private GameSettings gameSettings; - private final ResourceLocation field_111276_e; - -- public MapItemRenderer(GameSettings var1, TextureManager var2) { -- this.gameSettings = var1; -+ public MapItemRenderer(GameSettings par1GameSettings, TextureManager par2TextureManager) { -+ this.gameSettings = par1GameSettings; - this.bufferedImage = new DynamicTexture(128, 128); -- this.field_111276_e = var2.getDynamicTextureLocation("map", this.bufferedImage); -+ this.field_111276_e = par2TextureManager.getDynamicTextureLocation("map", this.bufferedImage); - this.intArray = this.bufferedImage.getTextureData(); - -- for(int var4 = 0; var4 < this.intArray.length; ++var4) { -+ for (int var4 = 0; var4 < this.intArray.length; ++var4) { - this.intArray[var4] = 0; - } -- - } - -- public void renderMap(EntityPlayer var1, TextureManager var2, MapData var3) { -- for(int var4 = 0; var4 < 16384; ++var4) { -- byte var5 = var3.colors[var4]; -- if(var5 / 4 == 0) { -+ public void renderMap(EntityPlayer par1EntityPlayer, TextureManager par2TextureManager, MapData par3MapData) { -+ for (int var4 = 0; var4 < 16384; ++var4) { -+ byte var5 = par3MapData.colors[var4]; -+ -+ if (var5 / 4 == 0) { - this.intArray[var4] = (var4 + var4 / 128 & 1) * 8 + 16 << 24; - } else { - int var6 = MapColor.mapColorArray[var5 / 4].colorValue; - int var7 = var5 & 3; - short var8 = 220; -- if(var7 == 2) { -+ -+ if (var7 == 2) { - var8 = 255; - } - -- if(var7 == 0) { -+ if (var7 == 0) { - var8 = 180; - } - -@@ -51,28 +52,28 @@ - byte var16 = 0; - Tessellator var17 = Tessellator.instance; - float var18 = 0.0F; -- var2.bindTexture(this.field_111276_e); -+ par2TextureManager.bindTexture(this.field_111276_e); - GL11.glEnable(GL11.GL_BLEND); - GL11.glBlendFunc(GL11.GL_ONE, GL11.GL_ONE_MINUS_SRC_ALPHA); - GL11.glDisable(GL11.GL_ALPHA_TEST); - var17.startDrawingQuads(); -- var17.addVertexWithUV((double)((float)(var15 + 0) + var18), (double)((float)(var16 + 128) - var18), (double)-0.01F, 0.0D, 1.0D); -- var17.addVertexWithUV((double)((float)(var15 + 128) - var18), (double)((float)(var16 + 128) - var18), (double)-0.01F, 1.0D, 1.0D); -- var17.addVertexWithUV((double)((float)(var15 + 128) - var18), (double)((float)(var16 + 0) + var18), (double)-0.01F, 1.0D, 0.0D); -- var17.addVertexWithUV((double)((float)(var15 + 0) + var18), (double)((float)(var16 + 0) + var18), (double)-0.01F, 0.0D, 0.0D); -+ var17.addVertexWithUV((double)((float)(var15 + 0) + var18), (double)((float)(var16 + 128) - var18), -0.009999999776482582D, 0.0D, 1.0D); -+ var17.addVertexWithUV((double)((float)(var15 + 128) - var18), (double)((float)(var16 + 128) - var18), -0.009999999776482582D, 1.0D, 1.0D); -+ var17.addVertexWithUV((double)((float)(var15 + 128) - var18), (double)((float)(var16 + 0) + var18), -0.009999999776482582D, 1.0D, 0.0D); -+ var17.addVertexWithUV((double)((float)(var15 + 0) + var18), (double)((float)(var16 + 0) + var18), -0.009999999776482582D, 0.0D, 0.0D); - var17.draw(); - GL11.glEnable(GL11.GL_ALPHA_TEST); - GL11.glDisable(GL11.GL_BLEND); -- var2.bindTexture(field_111277_a); -+ par2TextureManager.bindTexture(field_111277_a); - int var19 = 0; - -- for(Iterator var20 = var3.g.values().iterator(); var20.hasNext(); ++var19) { -+ for (Iterator var20 = par3MapData.playersVisibleOnMap.values().iterator(); var20.hasNext(); ++var19) { - MapCoord var21 = (MapCoord)var20.next(); - GL11.glPushMatrix(); - GL11.glTranslatef((float)var15 + (float)var21.centerX / 2.0F + 64.0F, (float)var16 + (float)var21.centerZ / 2.0F + 64.0F, -0.02F); - GL11.glRotatef((float)(var21.iconRotation * 360) / 16.0F, 0.0F, 0.0F, 1.0F); - GL11.glScalef(4.0F, 4.0F, 3.0F); -- GL11.glTranslatef(-(2.0F / 16.0F), 2.0F / 16.0F, 0.0F); -+ GL11.glTranslatef(-0.125F, 0.125F, 0.0F); - float var22 = (float)(var21.iconSize % 4 + 0) / 4.0F; - float var12 = (float)(var21.iconSize / 4 + 0) / 4.0F; - float var13 = (float)(var21.iconSize % 4 + 1) / 4.0F; ---- /dev/null -+++ org/spoutcraft/client/pluginloader/ClassLoader.java -@@ -1,0 +1,41 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.client.pluginloader; -+ -+import java.net.URL; -+import java.net.URLClassLoader; -+ -+public class ClassLoader extends URLClassLoader { -+ public ClassLoader(final URL[] urls, final ClassLoader parent) { -+ super(urls, parent); -+ } -+ -+ @Override -+ protected Class findClass(String name) throws ClassNotFoundException { -+ if (!whitelisted(name)) { -+ throw new SecurityException("Plugin attempted to access non-whitelisted class: " + name); -+ } -+ return super.findClass(name); -+ } -+ -+ private boolean whitelisted(String classname) { -+ return true; -+ } -+} ---- /dev/null -+++ org/spoutcraft/client/gui/GuiSpoutScreen.java -@@ -1,0 +1,75 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.client.gui; -+ -+import net.minecraft.src.Minecraft; -+import net.minecraft.src.GuiParticle; -+import net.minecraft.src.GuiScreen; -+ -+import org.spoutcraft.api.gui.GenericGradient; -+ -+public abstract class GuiSpoutScreen extends GuiScreen { -+ protected boolean instancesCreated = false; -+ -+ /** -+ * Init the widgets in this method. -+ * You should create new Instances of the widgets here, -+ * and also set unique properties that will not change when you resize the screen. -+ * Also attach the widgets to their screen. -+ */ -+ protected abstract void createInstances(); -+ -+ /** -+ * Set the width, height and the position of the widgets here. -+ */ -+ protected abstract void layoutWidgets(); -+ -+ @Override -+ public void initGui() { -+ if (!instancesCreated) { -+ createInstances(); -+ } -+ layoutWidgets(); -+ instancesCreated = true; -+ } -+ -+ @Override -+ public void drawScreen(int var1, int var2, float var3) { -+ drawDefaultBackground(); -+ } -+ -+ @Override -+ public void setWorldAndResolution(Minecraft var1, int var2, int var3) { -+ //ToDo: broken -+ //this.guiParticles = new GuiParticle(var1); -+ this.mc = var1; -+ this.fontRenderer = var1.fontRenderer; -+ this.width = var2; -+ this.height = var3; -+ -+ if (!instancesCreated) { -+ createInstances(); -+ } -+ layoutWidgets(); -+ instancesCreated = true; -+ -+ bg = (GenericGradient) new GenericGradient().setHeight(this.height).setWidth(this.width); -+ } -+} ---- net/minecraft/src/Packet13PlayerLookMove.java -+++ net/minecraft/src/Packet13PlayerLookMove.java -@@ -10,38 +10,47 @@ - this.moving = true; - } - -- public Packet13PlayerLookMove(double var1, double var3, double var5, double var7, float var9, float var10, boolean var11) { -- this.xPosition = var1; -- this.yPosition = var3; -- this.stance = var5; -- this.zPosition = var7; -- this.yaw = var9; -- this.pitch = var10; -- this.onGround = var11; -+ public Packet13PlayerLookMove(double par1, double par3, double par5, double par7, float par9, float par10, boolean par11) { -+ this.xPosition = par1; -+ this.yPosition = par3; -+ this.stance = par5; -+ this.zPosition = par7; -+ this.yaw = par9; -+ this.pitch = par10; -+ this.onGround = par11; - this.rotating = true; - this.moving = true; - } - -- public void readPacketData(DataInput var1) throws IOException { -- this.xPosition = var1.readDouble(); -- this.yPosition = var1.readDouble(); -- this.stance = var1.readDouble(); -- this.zPosition = var1.readDouble(); -- this.yaw = var1.readFloat(); -- this.pitch = var1.readFloat(); -- super.readPacketData(var1); -- } -- -- public void writePacketData(DataOutput var1) throws IOException { -- var1.writeDouble(this.xPosition); -- var1.writeDouble(this.yPosition); -- var1.writeDouble(this.stance); -- var1.writeDouble(this.zPosition); -- var1.writeFloat(this.yaw); -- var1.writeFloat(this.pitch); -- super.writePacketData(var1); -- } -- -+ /** -+ * Abstract. Reads the raw packet data from the data stream. -+ */ -+ public void readPacketData(DataInput par1DataInput) throws IOException { -+ this.xPosition = par1DataInput.readDouble(); -+ this.yPosition = par1DataInput.readDouble(); -+ this.stance = par1DataInput.readDouble(); -+ this.zPosition = par1DataInput.readDouble(); -+ this.yaw = par1DataInput.readFloat(); -+ this.pitch = par1DataInput.readFloat(); -+ super.readPacketData(par1DataInput); -+ } -+ -+ /** -+ * Abstract. Writes the raw packet data to the data stream. -+ */ -+ public void writePacketData(DataOutput par1DataOutput) throws IOException { -+ par1DataOutput.writeDouble(this.xPosition); -+ par1DataOutput.writeDouble(this.yPosition); -+ par1DataOutput.writeDouble(this.stance); -+ par1DataOutput.writeDouble(this.zPosition); -+ par1DataOutput.writeFloat(this.yaw); -+ par1DataOutput.writeFloat(this.pitch); -+ super.writePacketData(par1DataOutput); -+ } -+ -+ /** -+ * Abstract. Return the size of the packet (not counting the header). -+ */ - public int getPacketSize() { - return 41; - } ---- net/minecraft/src/EntityEgg.java -+++ net/minecraft/src/EntityEgg.java -@@ -1,30 +1,34 @@ - package net.minecraft.src; - - public class EntityEgg extends EntityThrowable { -- public EntityEgg(World var1) { -- super(var1); -- } -- -- public EntityEgg(World var1, EntityLivingBase var2) { -- super(var1, var2); -- } -- -- public EntityEgg(World var1, double var2, double var4, double var6) { -- super(var1, var2, var4, var6); -- } -- -- protected void onImpact(MovingObjectPosition var1) { -- if(var1.entityHit != null) { -- var1.entityHit.attackEntityFrom(DamageSource.causeThrownDamage(this, this.getThrower()), 0.0F); -+ public EntityEgg(World par1World) { -+ super(par1World); -+ } -+ -+ public EntityEgg(World par1World, EntityLivingBase par2EntityLivingBase) { -+ super(par1World, par2EntityLivingBase); -+ } -+ -+ public EntityEgg(World par1World, double par2, double par4, double par6) { -+ super(par1World, par2, par4, par6); -+ } -+ -+ /** -+ * Called when this EntityThrowable hits a block or entity. -+ */ -+ protected void onImpact(MovingObjectPosition par1MovingObjectPosition) { -+ if (par1MovingObjectPosition.entityHit != null) { -+ par1MovingObjectPosition.entityHit.attackEntityFrom(DamageSource.causeThrownDamage(this, this.getThrower()), 0.0F); - } - -- if(!this.worldObj.isRemote && this.ab.nextInt(8) == 0) { -+ if (!this.worldObj.isRemote && this.rand.nextInt(8) == 0) { - byte var2 = 1; -- if(this.ab.nextInt(32) == 0) { -+ -+ if (this.rand.nextInt(32) == 0) { - var2 = 4; - } - -- for(int var3 = 0; var3 < var2; ++var3) { -+ for (int var3 = 0; var3 < var2; ++var3) { - EntityChicken var4 = new EntityChicken(this.worldObj); - var4.setGrowingAge(-24000); - var4.setLocationAndAngles(this.posX, this.posY, this.posZ, this.rotationYaw, 0.0F); -@@ -32,13 +36,12 @@ - } - } - -- for(int var5 = 0; var5 < 8; ++var5) { -+ for (int var5 = 0; var5 < 8; ++var5) { - this.worldObj.spawnParticle("snowballpoof", this.posX, this.posY, this.posZ, 0.0D, 0.0D, 0.0D); - } - -- if(!this.worldObj.isRemote) { -+ if (!this.worldObj.isRemote) { - this.setDead(); - } -- - } - } ---- /dev/null -+++ org/spoutcraft/client/gui/settings/controls/BetterGrassButton.java -@@ -1,0 +1,62 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.client.gui.settings.controls; -+ -+import com.prupe.mcpatcher.TexturePackChangeHandler; -+ -+import net.minecraft.src.Minecraft; -+ -+import org.spoutcraft.client.SpoutClient; -+import org.spoutcraft.client.config.Configuration; -+ -+public class BetterGrassButton extends AutomatedButton { -+ public BetterGrassButton() { -+ setTooltip("Better Grass / Snow\nOFF - default side grass texture, fastest\nFast - full side grass texture, slower\nFancy - dynamic side grass texture, slowest"); -+ } -+ -+ @Override -+ public String getText() { -+ switch(Configuration.getBetterGrass()) { -+ case 0: return "Better Grass / Snow: OFF"; -+ case 1: return "Better Grass / Snow: Fast"; -+ case 2: return "Better Grass / Snow: Fancy"; -+ } -+ return "Unknown State: " + Configuration.getBetterGrass(); -+ } -+ -+ @Override -+ public void onButtonClick() { -+ Configuration.setBetterGrass(Configuration.getBetterGrass() + 1); -+ if (Configuration.getBetterGrass() > 2) { -+ Configuration.setBetterGrass(0); -+ } -+ Configuration.write(); -+ -+ Minecraft game = SpoutClient.getHandle(); -+ TexturePackChangeHandler.earlyInitialize("com.prupe.mcpatcher.mob.CTMUtils", "reset"); -+ TexturePackChangeHandler.beforeChange1(true); -+ game.refreshResources(); -+ TexturePackChangeHandler.afterChange1(true); -+ -+ if (game.getMinecraft().theWorld != null) { -+ game.renderGlobal.updateAllRenderers(); -+ } -+ } -+} ---- net/minecraft/src/ItemEmptyMap.java -+++ net/minecraft/src/ItemEmptyMap.java -@@ -1,31 +1,35 @@ - package net.minecraft.src; - - public class ItemEmptyMap extends ItemMapBase { -- protected ItemEmptyMap(int var1) { -- super(var1); -+ protected ItemEmptyMap(int par1) { -+ super(par1); - this.setCreativeTab(CreativeTabs.tabMisc); - } - -- public ItemStack onItemRightClick(ItemStack var1, World var2, EntityPlayer var3) { -- ItemStack var4 = new ItemStack(Item.map, 1, var2.getUniqueDataId("map")); -+ /** -+ * Called whenever this item is equipped and the right mouse button is pressed. Args: itemStack, world, entityPlayer -+ */ -+ public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) { -+ ItemStack var4 = new ItemStack(Item.map, 1, par2World.getUniqueDataId("map")); - String var5 = "map_" + var4.getItemDamage(); - MapData var6 = new MapData(var5); -- var2.setItemData(var5, var6); -+ par2World.setItemData(var5, var6); - var6.scale = 0; - int var7 = 128 * (1 << var6.scale); -- var6.xCenter = (int)(Math.round(var3.posX / (double)var7) * (long)var7); -- var6.zCenter = (int)(Math.round(var3.posZ / (double)var7) * (long)var7); -- var6.dimension = (byte)var2.provider.dimensionId; -+ var6.xCenter = (int)(Math.round(par3EntityPlayer.posX / (double)var7) * (long)var7); -+ var6.zCenter = (int)(Math.round(par3EntityPlayer.posZ / (double)var7) * (long)var7); -+ var6.dimension = (byte)par2World.provider.dimensionId; - var6.markDirty(); -- --var1.stackSize; -- if(var1.stackSize <= 0) { -+ --par1ItemStack.stackSize; -+ -+ if (par1ItemStack.stackSize <= 0) { - return var4; - } else { -- if(!var3.inventory.addItemStackToInventory(var4.copy())) { -- var3.dropPlayerItem(var4); -+ if (!par3EntityPlayer.inventory.addItemStackToInventory(var4.copy())) { -+ par3EntityPlayer.dropPlayerItem(var4); - } - -- return var1; -+ return par1ItemStack; - } - } - } ---- /dev/null -+++ org/spoutcraft/api/gui/Button.java -@@ -1,0 +1,68 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.api.gui; -+ -+import org.spoutcraft.api.UnsafeClass; -+ -+@UnsafeClass -+public interface Button extends Control, Label { -+ /** -+ * Gets the text that is displayed when the control is disabled -+ * -+ * @return disabled text -+ */ -+ public String getDisabledText(); -+ -+ /** -+ * Sets the text that is displayed when the control is disabled -+ * -+ * @param text to display -+ * @return Button -+ */ -+ public Button setDisabledText(String text); -+ -+ /** -+ * Gets the color of the control while the mouse is hovering over it -+ * -+ * @return color -+ */ -+ public Color getHoverColor(); -+ -+ /** -+ * Sets the color of the control while the mouse is hovering over it -+ * -+ * @param color -+ * @return Button -+ */ -+ public Button setHoverColor(Color color); -+ -+ public Button setText(String text); -+ -+ public Button setTextColor(Color color); -+ -+ public Button setAuto(boolean auto); -+ -+ public Button setAlign(WidgetAnchor align); -+ -+ /** -+ * Fires when this button is clicked on the screen. -+ */ -+ public void onButtonClick(); -+} ---- /dev/null -+++ org/spoutcraft/client/gui/minimap/MapCalculator.java -@@ -1,0 +1,469 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.client.gui.minimap; -+ -+import java.util.Random; -+ -+import net.minecraft.src.Minecraft; -+import net.minecraft.src.AxisAlignedBB; -+import net.minecraft.src.Chunk; -+import net.minecraft.src.EntityLiving; -+import net.minecraft.src.Material; -+import net.minecraft.src.World; -+ -+import org.spoutcraft.api.Spoutcraft; -+import org.spoutcraft.client.SpoutClient; -+import org.spoutcraft.client.chunkcache.HeightMap; -+ -+public class MapCalculator implements Runnable { -+ /** -+ * Multiply two colors by each other. Treats 0xff as 1.0. -+ * -+ * Yourself came up with the algorithm, I'm sure it makes sense to someone -+ * -+ * @param x -+ * Color to multiply -+ * @param y -+ * Other color to multiply -+ * @return multiplied color -+ */ -+ public int colorMult(int x, int y) { -+ int res = 0; -+ for (int octet = 0; octet < 3; ++octet) { -+ res |= (((x & 0xff) * (y & 0xff)) / 0xff) << (octet << 3); -+ x >>= 8; -+ y >>= 8; -+ } -+ return res; -+ } -+ -+ private final float distance(int x1, int y1, int x2, int y2) { -+ return (float) Math.sqrt(Math.pow(x2 - x1, 2) + Math.pow(y2 - y1, 2)); -+ } -+ -+ private final boolean blockIsSolid(Chunk chunk, int x, int y, int z) { -+ if (y > 255) -+ return false; -+ if (y < 0) -+ return true; -+ try { -+ int id = chunk.getBlockID(x, y, z); -+ int meta = chunk.getBlockMetadata(x, y, z); -+ return BlockColor.getBlockColor(id, meta).alpha > 0; -+ } catch (Exception e) { -+ return false; -+ } -+ } -+ -+ private final int getBlockHeight(World world, int x, int z) { -+ if (MinimapConfig.getInstance().isCavemap()) { -+ Chunk chunk = world.getChunkFromBlockCoords(x, z); -+ cmdist.setSeed((x & 0xffff) | ((z & 0xffff) << 16)); -+ float dist = distance((int) Minecraft.getMinecraft().thePlayer.posX, (int) Minecraft.getMinecraft().thePlayer.posZ, x, z); -+ int y = (int) Minecraft.getMinecraft().thePlayer.posY; -+ if (dist > 5) -+ y -= (cmdist.nextInt((int) (dist)) - ((int) dist / 2)); -+ x &= 0xf; -+ z &= 0xf; -+ -+ if (y < 0) { -+ y = 0; -+ } else if (y > 255) { -+ y = 255; -+ } -+ -+ if (blockIsSolid(chunk, x, y, z)) { -+ int itery = y; -+ while (true) { -+ itery++; -+ if (itery > y + 10) -+ return y + 10; -+ if (!blockIsSolid(chunk, x, itery, z)) { -+ return itery - 1; -+ } -+ } -+ } -+ while (y > -1) { -+ y--; -+ if (blockIsSolid(chunk, x, y, z)) { -+ return y; -+ } -+ } -+ return -1; -+ } -+ -+ return world.getHeightValue(x, z) - 1; -+ -+ // return world.b(x, z).b(x & 0xf, z & 0xf); -+ /* -+ * li chunk = world.b(x, z); int y = (int)(game.h.aM); // starty; x &= -+ * 0xf; z &= 0xf; -+ * -+ * //while (y > 0) // { -+ * -+ * -+ * if (getBlockColor(id, meta).alpha == 0) return -1; // y--; else return -+ * y + 1; // what //} -+ */ -+ // return -1; -+ } -+ -+ private int getBlockColor(World world, int x, int y, int z) { -+ int color24 = 0; -+ -+ try { -+ if (MinimapConfig.getInstance().isColor() && !MinimapConfig.getInstance().isCavemap()) { -+ if (x == (int) map.getPlayerX() && z == (int) map.getPlayerZ()) -+ return 0xff0000; -+ if ((world.getBlockMaterial(x, y + 1, z) == Material.ice) || (world.getBlockMaterial(x, y + 1, z) == Material.snow)) { -+ color24 = 0xffffff; -+ } else { -+ BlockColor col = BlockColor.getBlockColor(world.getBlockId(x, y, z), world.getBlockMetadata(x, y, z)); -+ color24 = col.color; -+ } -+ } -+ } catch (Exception e) { -+ return 0; -+ } -+ -+ return color24; -+ } -+ -+ private int getBlockHeightMap(World world, int x, int y, int z) { -+ int height = y - 128; -+ double sc = Math.log10(Math.abs(height) / 8.0D + 1.0D) / 1.3D; -+ int result = 0x80; -+ -+ if (height >= 0) { -+ result = (int) (sc * (0xff - result)) + result; -+ } else { -+ height = Math.abs(height); -+ result = result - (int) (sc * result); -+ } -+ return result; -+ } -+ -+ private int getBlockLight(World world, int x, int y, int z) { -+ int light = world.getBlockLightValue_do(x, y + 1, z, false) * 17; -+ int min = 32; -+ if (light < min) { -+ light = min; -+ } -+ if (MinimapConfig.getInstance().isLightmap()) { -+ light *= 1.3f; -+ } else if (MinimapConfig.getInstance().isCavemap()) { -+ light *= 0.5; -+ light += 64; -+ } -+ -+ if (light > 255) { -+ light = 255; -+ } else if (light < 0) { -+ light = 0; -+ } -+ -+ return light; -+ } -+ -+ private void mapCalc() { -+ if (Minecraft.getMinecraft().thePlayer == null || Minecraft.getMinecraft().theWorld == null) -+ return; -+ try { -+ final boolean square = MinimapConfig.getInstance().isSquare(); -+ final World data = Minecraft.getMinecraft().theWorld; -+ int renderSize; -+ int startX; -+ int startZ; -+ synchronized (map) { -+ if (map.zoom != MinimapConfig.getInstance().getZoom()) { -+ map.zoom = MinimapConfig.getInstance().getZoom(); -+ switch (map.zoom) { -+ case 0: -+ map.renderSize = Map.ZOOM_0; -+ break; -+ case 1: -+ map.renderSize = Map.ZOOM_1; -+ break; -+ case 2: -+ map.renderSize = Map.ZOOM_2; -+ break; -+ default: -+ map.renderSize = Map.ZOOM_2; -+ break; -+ } -+ map.renderOff = map.renderSize / 2; -+ map.clear(); -+ } -+ map.square = square; -+ -+ map.update(Minecraft.getMinecraft().thePlayer.posX, Minecraft.getMinecraft().thePlayer.posZ); -+ renderSize = map.renderSize; -+ startX = (int) (map.getPlayerX() - map.renderOff); -+ startZ = (int) (map.getPlayerZ() - map.renderOff); -+ } -+ -+ for (int worldX = startX; worldX < startX + renderSize; worldX++) { -+ for (int worldZ = startZ; worldZ < startZ + renderSize; worldZ++) { -+ int worldY = getBlockHeight(data, worldX, worldZ); -+ -+ int pixelX = worldX - startX; -+ if (pixelX >= renderSize) { -+ pixelX -= renderSize; -+ } -+ -+ int pixelZ = worldZ - startZ; -+ pixelZ = renderSize - pixelZ; -+ if (pixelZ >= renderSize) { -+ pixelZ -= renderSize; -+ } -+ -+ if (square || MinimapUtils.insideCircle(startX + renderSize / 2, startZ + renderSize / 2, renderSize / 2, worldX, worldZ)) { -+ int color = getBlockColor(data, worldX, worldY, worldZ); -+ if (color == 0) { -+ map.clearColorPixel(pixelX, pixelZ); -+ } else { -+ map.setColorPixel(pixelX, pixelZ, color); -+ } -+ -+ short height = (short) data.getHeightValue(worldX, worldZ); -+ short reference = (short) data.getHeightValue(worldX + 1, worldZ + 1); -+ map.heightimg.setARGB(pixelZ, pixelX, getHeightColor(height, reference)); -+ map.setLightPixel(pixelX, pixelZ, getBlockLight(data, worldX, worldY, worldZ)); -+ -+ } else { -+ map.clearColorPixel(pixelX, pixelZ); -+ map.heightimg.setARGB(pixelX, pixelZ, 0); -+ map.setLightPixel(pixelX, pixelZ, 255); -+ } -+ } -+ } -+ -+ synchronized (map) { -+ for (Waypoint pt : MinimapConfig.getInstance().getWaypoints(MinimapUtils.getWorldName())) { -+ if (pt.enabled) { -+ boolean render = false; -+ if (square) { -+ render = Math.abs(map.getPlayerX() - pt.x) < map.renderSize && Math.abs(map.getPlayerZ() - pt.z) < map.renderSize; -+ } else { -+ render = MinimapUtils.insideCircle(startX + map.renderSize / 2, startZ + map.renderSize / 2, map.renderSize / 2, pt.x, pt.z); -+ } -+ if (pt.deathpoint && !MinimapConfig.getInstance().isDeathpoints()) { -+ render = false; -+ } -+ if (render) { -+ int pixelX = pt.x - startX; -+ -+ int pixelZ = pt.z - startZ; -+ pixelZ = map.renderSize - pixelZ; -+ -+ int scale = map.zoom + 2; -+ if (map.zoom > 2) { -+ scale += 2; -+ } -+ if (map.zoom > 1) { -+ scale += 1; -+ } -+ -+ int color = 0xEE2C2C; -+ if (pt == MinimapConfig.getInstance().getFocussedWaypoint()) { -+ color = 0xff00ffff; -+ } -+ drawCircle(pixelX, pixelZ, scale + map.zoom + 1, pt.deathpoint ? color : 0); -+ drawCircle(pixelX, pixelZ, scale, pt.deathpoint ? 0 : color); -+ } -+ } -+ } -+ for (Waypoint pt : MinimapConfig.getInstance().getServerWaypoints()) { -+ boolean render = false; -+ if (square) { -+ render = Math.abs(map.getPlayerX() - pt.x) < map.renderSize && Math.abs(map.getPlayerZ() - pt.z) < map.renderSize; -+ } else { -+ render = MinimapUtils.insideCircle(startX + map.renderSize / 2, startZ + map.renderSize / 2, map.renderSize / 2, pt.x, pt.z); -+ } -+ if (render) { -+ int pixelX = pt.x - startX; -+ -+ int pixelZ = pt.z - startZ; -+ pixelZ = map.renderSize - pixelZ; -+ -+ int scale = map.zoom + 2; -+ if (map.zoom > 2) { -+ scale += 2; -+ } -+ if (map.zoom > 1) { -+ scale += 1; -+ } -+ -+ int color = 0x3366CC; -+ if (pt == MinimapConfig.getInstance().getFocussedWaypoint()) { -+ color = 0xff00ffff; -+ } -+ drawCircle(pixelX, pixelZ, scale + map.zoom + 1, 0); -+ drawCircle(pixelX, pixelZ, scale, color); -+ } -+ } -+ } -+ } catch (Throwable whatever) { } -+ } -+ -+ private void drawCircle(int x, int y, int radius, int color) { -+ try { -+ for (int dx = -radius; dx <= radius; dx++) { -+ for (int dy = -radius; dy <= radius; dy++) { -+ if (x + dx < map.renderSize && x + dx > 0 && y + dy < map.renderSize && y + dy > 0) { -+ if (MinimapUtils.insideCircle(x, y, radius, x + dx, y + dy)) { -+ map.setColorPixel(x + dx, y + dy, color); -+ } -+ } -+ } -+ } -+ } catch (ArrayIndexOutOfBoundsException ignore) { -+ } // happens with fast movement -+ } -+ -+ /** -+ * Check if a render is necessary, and if so, do one. -+ */ -+ private void tryARender() { -+ if (Minecraft.getMinecraft().thePlayer == null || Minecraft.getMinecraft().theWorld == null) -+ return; -+ try { -+ double x = Minecraft.getMinecraft().thePlayer.posX; -+ double z = Minecraft.getMinecraft().thePlayer.posZ; -+ if (MinimapConfig.getInstance().isEnabled() && map.isDirty(x, z)) { -+// long start = System.currentTimeMillis(); -+ if (MinimapConfig.getInstance().getScanRadius() > 0) { -+ int radius = MinimapConfig.getInstance().getScanRadius() << 4; -+ for (int cx = (int) (x - radius); cx <= (int) (x + radius); cx += 16) { -+ for (int cz = (int) (z - radius); cz <= (int) (z + radius); cz += 16) { -+ Chunk chunk = Minecraft.getMinecraft().theWorld.getChunkFromBlockCoords((int) cx, (int) cz); -+ org.spoutcraft.client.chunkcache.HeightMapAgent.scanChunk(chunk); -+ } -+ } -+ } -+ //long dur = System.currentTimeMillis() - start; -+ //int chunks = (int) Math.pow(MinimapConfig.getInstance().getScanRadius() * 2, 2); -+ //System.out.println("Took " + dur + "ms to scan " + chunks + " chunks.\nThat is " + (float) (dur/(float)chunks) + " per chunk!"); -+ mapCalc(); -+ -+ entityCalc(); -+ map.timer = 1; -+ } -+ } catch (RuntimeException e) { -+ throw e; -+ } finally { -+ map.timer++; -+ } -+ } -+ -+ private void entityCalc() { -+ synchronized(map.watchedEntities) { -+ map.watchedEntities.clear(); -+ if (!Spoutcraft.hasPermission("spout.plugin.minimap.showentities")) { -+ return; -+ } -+ if (!MinimapConfig.getInstance().isShowingEntities()) { -+ return; -+ } -+ int radius = map.renderSize / 2; -+ double playerX = map.getPlayerX(); -+ double playerZ = map.getPlayerZ(); -+ for (Object ob:SpoutClient.getHandle().theWorld.getEntitiesWithinAABB(EntityLiving.class, AxisAlignedBB.getBoundingBox(playerX - radius, 0, playerZ - radius, playerX + radius, 256, playerZ + radius))) { -+ net.minecraft.src.Entity e = (net.minecraft.src.Entity) ob; -+ if (!MinimapConfig.getInstance().isEntityVisible(e.getClass())) { -+ continue; -+ } -+ WatchedEntity w = new WatchedEntity(e); -+ if (w.getTexture() != null) { -+ map.watchedEntities.add(w); -+ } -+ } -+ } -+ } -+ -+ /** -+ * the run() to implement runnable - the main function of the other thread. -+ * this simply idles and the actual work is done in onRenderTick(). -+ */ -+ public void run() { -+ } -+ -+ /** -+ * Called each tick of the render. -+ */ -+ void onRenderTick() { -+ if (Minecraft.getMinecraft() != null && Minecraft.getMinecraft().theWorld != null) { -+ tryARender(); -+ } -+ } -+ -+ /** -+ * Random used to distort cave map -+ */ -+ public Random cmdist = new Random(); -+ -+ private Map map; -+ -+ /** -+ * This constructor inits state, but does not start the thread. -+ * -+ * @param minimap -+ * Minimap instance to initialize off -+ */ -+ public MapCalculator(ZanMinimap minimap) { -+ map = minimap.map; -+ } -+ -+ /** -+ * Start up the other thread. The thread may return early at this point, as -+ * there might not be a Minecraft instance available yet. if that occurs, -+ * the thread will be restarted by the keep-alive in onRenderTick(). -+ */ -+ public void start() { -+ } -+ -+ public static int getHeightColor(short height, short reference) { -+ int hdiff = height - reference; -+ int color = 0x00000000; -+ if (hdiff != 0 && reference != -1) { -+ boolean ascending = hdiff < 0; -+ hdiff *= 2; -+ hdiff += 256; -+ if (hdiff > 255) { -+ hdiff = 255; -+ } -+ if (hdiff < 0) { -+ hdiff = 0; -+ } -+ if (!ascending) { -+ hdiff = 255 - hdiff; -+ } -+ color = 0x55000000 | ((hdiff << 16) + (hdiff << 8) + hdiff); -+ } -+ return color; -+ } -+ -+ public static int getHeightColor(int x, int z, HeightMap heightMap) { -+ short height = heightMap.getHeight(x, z); -+ short reference = heightMap.getHeight(x + 1, z + 1); -+ -+ return getHeightColor(height, reference); -+ } -+} ---- /dev/null -+++ org/spoutcraft/api/material/block/GenericCubeCustomBlock.java -@@ -1,0 +1,61 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.api.material.block; -+ -+import org.spoutcraft.api.block.design.GenericCubeBlockDesign; -+ -+public abstract class GenericCubeCustomBlock extends GenericCustomBlock { -+ /** -+ * Creates a new cube block material -+ * -+ * @param plugin making the block -+ * @param name of the block -+ * @param isOpaque true if you want the block solid -+ * @param design to use for the block -+ */ -+ public GenericCubeCustomBlock(String addon, String name, boolean isOpaque, GenericCubeBlockDesign design) { -+ super(addon, name, isOpaque, design); -+ } -+ -+ /** -+ * Creates a new opaque/solid cube block material -+ * -+ * @param plugin making the block -+ * @param name of the block -+ * @param design to use for the block -+ */ -+ public GenericCubeCustomBlock(String addon, String name, GenericCubeBlockDesign design) { -+ super(addon, name); -+ this.setBlockDesign(design); -+ } -+ -+ /** -+ * Creates a new basic opaque/solid cube block material -+ * -+ * @param plugin making the block -+ * @param name of the block -+ * @param texture url to use for the block - must be a square PNG -+ * @param textureSize width and height of the texture in pixels -+ */ -+ public GenericCubeCustomBlock(String addon, String name, String texture, int textureSize) { -+ super(addon, name); -+ this.setBlockDesign(new GenericCubeBlockDesign(addon, texture, textureSize)); -+ } -+} ---- net/minecraft/src/StructureStrongholdPieces.java -+++ net/minecraft/src/StructureStrongholdPieces.java -@@ -6,9 +6,9 @@ - import java.util.Random; - - public class StructureStrongholdPieces { -- private static final StructureStrongholdPieceWeight[] pieceWeightArray = new StructureStrongholdPieceWeight[]{new StructureStrongholdPieceWeight(ComponentStrongholdStraight.class, 40, 0), new StructureStrongholdPieceWeight(ComponentStrongholdPrison.class, 5, 5), new StructureStrongholdPieceWeight(ComponentStrongholdLeftTurn.class, 20, 0), new StructureStrongholdPieceWeight(ComponentStrongholdRightTurn.class, 20, 0), new StructureStrongholdPieceWeight(ComponentStrongholdRoomCrossing.class, 10, 6), new StructureStrongholdPieceWeight(ComponentStrongholdStairsStraight.class, 5, 5), new StructureStrongholdPieceWeight(ComponentStrongholdStairs.class, 5, 5), new StructureStrongholdPieceWeight(ComponentStrongholdCrossing.class, 5, 4), new StructureStrongholdPieceWeight(ComponentStrongholdChestCorridor.class, 5, 4), new StructureStrongholdPieceWeight2(ComponentStrongholdLibrary.class, 10, 2), new StructureStrongholdPieceWeight3(ComponentStrongholdPortalRoom.class, 20, 1)}; -- private static List c; -- private static Class d; -+ private static final StructureStrongholdPieceWeight[] pieceWeightArray = new StructureStrongholdPieceWeight[] {new StructureStrongholdPieceWeight(ComponentStrongholdStraight.class, 40, 0), new StructureStrongholdPieceWeight(ComponentStrongholdPrison.class, 5, 5), new StructureStrongholdPieceWeight(ComponentStrongholdLeftTurn.class, 20, 0), new StructureStrongholdPieceWeight(ComponentStrongholdRightTurn.class, 20, 0), new StructureStrongholdPieceWeight(ComponentStrongholdRoomCrossing.class, 10, 6), new StructureStrongholdPieceWeight(ComponentStrongholdStairsStraight.class, 5, 5), new StructureStrongholdPieceWeight(ComponentStrongholdStairs.class, 5, 5), new StructureStrongholdPieceWeight(ComponentStrongholdCrossing.class, 5, 4), new StructureStrongholdPieceWeight(ComponentStrongholdChestCorridor.class, 5, 4), new StructureStrongholdPieceWeight2(ComponentStrongholdLibrary.class, 10, 2), new StructureStrongholdPieceWeight3(ComponentStrongholdPortalRoom.class, 20, 1)}; -+ private static List structurePieceList; -+ private static Class strongComponentType; - static int totalWeight; - private static final StructureStrongholdStones strongholdStones = new StructureStrongholdStones((StructureStrongholdPieceWeight2)null); - -@@ -28,28 +28,32 @@ - MapGenStructureIO.func_143031_a(ComponentStrongholdStairsStraight.class, "SHSSD"); - } - -+ /** -+ * sets up Arrays with the Structure pieces and their weights -+ */ - public static void prepareStructurePieces() { -- c = new ArrayList(); -+ structurePieceList = new ArrayList(); - StructureStrongholdPieceWeight[] var0 = pieceWeightArray; - int var1 = var0.length; - -- for(int var2 = 0; var2 < var1; ++var2) { -+ for (int var2 = 0; var2 < var1; ++var2) { - StructureStrongholdPieceWeight var3 = var0[var2]; - var3.instancesSpawned = 0; -- c.add(var3); -+ structurePieceList.add(var3); - } - -- d = null; -+ strongComponentType = null; - } - - private static boolean canAddStructurePieces() { - boolean var0 = false; - totalWeight = 0; -- - StructureStrongholdPieceWeight var2; -- for(Iterator var1 = c.iterator(); var1.hasNext(); totalWeight += var2.pieceWeight) { -+ -+ for (Iterator var1 = structurePieceList.iterator(); var1.hasNext(); totalWeight += var2.pieceWeight) { - var2 = (StructureStrongholdPieceWeight)var1.next(); -- if(var2.instancesLimit > 0 && var2.instancesSpawned < var2.instancesLimit) { -+ -+ if (var2.instancesLimit > 0 && var2.instancesSpawned < var2.instancesLimit) { - var0 = true; - } - } -@@ -57,68 +61,76 @@ - return var0; - } - -- private static ComponentStronghold getStrongholdComponentFromWeightedPiece(Class var0, List var1, Random var2, int var3, int var4, int var5, int var6, int var7) { -+ /** -+ * translates the PieceWeight class to the Component class -+ */ -+ private static ComponentStronghold getStrongholdComponentFromWeightedPiece(Class par0Class, List par1List, Random par2Random, int par3, int par4, int par5, int par6, int par7) { - Object var8 = null; -- if(var0 == ComponentStrongholdStraight.class) { -- var8 = ComponentStrongholdStraight.findValidPlacement(var1, var2, var3, var4, var5, var6, var7); -- } else if(var0 == ComponentStrongholdPrison.class) { -- var8 = ComponentStrongholdPrison.findValidPlacement(var1, var2, var3, var4, var5, var6, var7); -- } else if(var0 == ComponentStrongholdLeftTurn.class) { -- var8 = ComponentStrongholdLeftTurn.findValidPlacement(var1, var2, var3, var4, var5, var6, var7); -- } else if(var0 == ComponentStrongholdRightTurn.class) { -- var8 = ComponentStrongholdRightTurn.findValidPlacement(var1, var2, var3, var4, var5, var6, var7); -- } else if(var0 == ComponentStrongholdRoomCrossing.class) { -- var8 = ComponentStrongholdRoomCrossing.findValidPlacement(var1, var2, var3, var4, var5, var6, var7); -- } else if(var0 == ComponentStrongholdStairsStraight.class) { -- var8 = ComponentStrongholdStairsStraight.findValidPlacement(var1, var2, var3, var4, var5, var6, var7); -- } else if(var0 == ComponentStrongholdStairs.class) { -- var8 = ComponentStrongholdStairs.getStrongholdStairsComponent(var1, var2, var3, var4, var5, var6, var7); -- } else if(var0 == ComponentStrongholdCrossing.class) { -- var8 = ComponentStrongholdCrossing.findValidPlacement(var1, var2, var3, var4, var5, var6, var7); -- } else if(var0 == ComponentStrongholdChestCorridor.class) { -- var8 = ComponentStrongholdChestCorridor.findValidPlacement(var1, var2, var3, var4, var5, var6, var7); -- } else if(var0 == ComponentStrongholdLibrary.class) { -- var8 = ComponentStrongholdLibrary.findValidPlacement(var1, var2, var3, var4, var5, var6, var7); -- } else if(var0 == ComponentStrongholdPortalRoom.class) { -- var8 = ComponentStrongholdPortalRoom.findValidPlacement(var1, var2, var3, var4, var5, var6, var7); -+ -+ if (par0Class == ComponentStrongholdStraight.class) { -+ var8 = ComponentStrongholdStraight.findValidPlacement(par1List, par2Random, par3, par4, par5, par6, par7); -+ } else if (par0Class == ComponentStrongholdPrison.class) { -+ var8 = ComponentStrongholdPrison.findValidPlacement(par1List, par2Random, par3, par4, par5, par6, par7); -+ } else if (par0Class == ComponentStrongholdLeftTurn.class) { -+ var8 = ComponentStrongholdLeftTurn.findValidPlacement(par1List, par2Random, par3, par4, par5, par6, par7); -+ } else if (par0Class == ComponentStrongholdRightTurn.class) { -+ var8 = ComponentStrongholdRightTurn.findValidPlacement(par1List, par2Random, par3, par4, par5, par6, par7); -+ } else if (par0Class == ComponentStrongholdRoomCrossing.class) { -+ var8 = ComponentStrongholdRoomCrossing.findValidPlacement(par1List, par2Random, par3, par4, par5, par6, par7); -+ } else if (par0Class == ComponentStrongholdStairsStraight.class) { -+ var8 = ComponentStrongholdStairsStraight.findValidPlacement(par1List, par2Random, par3, par4, par5, par6, par7); -+ } else if (par0Class == ComponentStrongholdStairs.class) { -+ var8 = ComponentStrongholdStairs.getStrongholdStairsComponent(par1List, par2Random, par3, par4, par5, par6, par7); -+ } else if (par0Class == ComponentStrongholdCrossing.class) { -+ var8 = ComponentStrongholdCrossing.findValidPlacement(par1List, par2Random, par3, par4, par5, par6, par7); -+ } else if (par0Class == ComponentStrongholdChestCorridor.class) { -+ var8 = ComponentStrongholdChestCorridor.findValidPlacement(par1List, par2Random, par3, par4, par5, par6, par7); -+ } else if (par0Class == ComponentStrongholdLibrary.class) { -+ var8 = ComponentStrongholdLibrary.findValidPlacement(par1List, par2Random, par3, par4, par5, par6, par7); -+ } else if (par0Class == ComponentStrongholdPortalRoom.class) { -+ var8 = ComponentStrongholdPortalRoom.findValidPlacement(par1List, par2Random, par3, par4, par5, par6, par7); - } - - return (ComponentStronghold)var8; - } - -- private static ComponentStronghold getNextComponent(ComponentStrongholdStairs2 var0, List var1, Random var2, int var3, int var4, int var5, int var6, int var7) { -- if(!canAddStructurePieces()) { -+ private static ComponentStronghold getNextComponent(ComponentStrongholdStairs2 par0ComponentStrongholdStairs2, List par1List, Random par2Random, int par3, int par4, int par5, int par6, int par7) { -+ if (!canAddStructurePieces()) { - return null; - } else { -- if(d != null) { -- ComponentStronghold var8 = getStrongholdComponentFromWeightedPiece(d, var1, var2, var3, var4, var5, var6, var7); -- d = null; -- if(var8 != null) { -+ if (strongComponentType != null) { -+ ComponentStronghold var8 = getStrongholdComponentFromWeightedPiece(strongComponentType, par1List, par2Random, par3, par4, par5, par6, par7); -+ strongComponentType = null; -+ -+ if (var8 != null) { - return var8; - } - } - - int var13 = 0; - -- while(var13 < 5) { -+ while (var13 < 5) { - ++var13; -- int var9 = var2.nextInt(totalWeight); -- Iterator var10 = c.iterator(); -+ int var9 = par2Random.nextInt(totalWeight); -+ Iterator var10 = structurePieceList.iterator(); - -- while(var10.hasNext()) { -+ while (var10.hasNext()) { - StructureStrongholdPieceWeight var11 = (StructureStrongholdPieceWeight)var10.next(); - var9 -= var11.pieceWeight; -- if(var9 < 0) { -- if(!var11.canSpawnMoreStructuresOfType(var7) || var11 == var0.strongholdPieceWeight) { -+ -+ if (var9 < 0) { -+ if (!var11.canSpawnMoreStructuresOfType(par7) || var11 == par0ComponentStrongholdStairs2.strongholdPieceWeight) { - break; - } - -- ComponentStronghold var12 = getStrongholdComponentFromWeightedPiece(var11.a, var1, var2, var3, var4, var5, var6, var7); -- if(var12 != null) { -+ ComponentStronghold var12 = getStrongholdComponentFromWeightedPiece(var11.pieceClass, par1List, par2Random, par3, par4, par5, par6, par7); -+ -+ if (var12 != null) { - ++var11.instancesSpawned; -- var0.strongholdPieceWeight = var11; -- if(!var11.canSpawnMoreStructures()) { -- c.remove(var11); -+ par0ComponentStrongholdStairs2.strongholdPieceWeight = var11; -+ -+ if (!var11.canSpawnMoreStructures()) { -+ structurePieceList.remove(var11); - } - - return var12; -@@ -127,23 +139,25 @@ - } - } - -- StructureBoundingBox var14 = ComponentStrongholdCorridor.func_74992_a(var1, var2, var3, var4, var5, var6); -- if(var14 != null && var14.minY > 1) { -- return new ComponentStrongholdCorridor(var7, var2, var14, var6); -+ StructureBoundingBox var14 = ComponentStrongholdCorridor.func_74992_a(par1List, par2Random, par3, par4, par5, par6); -+ -+ if (var14 != null && var14.minY > 1) { -+ return new ComponentStrongholdCorridor(par7, par2Random, var14, par6); - } else { - return null; - } - } - } - -- private static StructureComponent getNextValidComponent(ComponentStrongholdStairs2 var0, List var1, Random var2, int var3, int var4, int var5, int var6, int var7) { -- if(var7 > 50) { -+ private static StructureComponent getNextValidComponent(ComponentStrongholdStairs2 par0ComponentStrongholdStairs2, List par1List, Random par2Random, int par3, int par4, int par5, int par6, int par7) { -+ if (par7 > 50) { - return null; -- } else if(Math.abs(var3 - var0.getBoundingBox().minX) <= 112 && Math.abs(var5 - var0.getBoundingBox().minZ) <= 112) { -- ComponentStronghold var8 = getNextComponent(var0, var1, var2, var3, var4, var5, var6, var7 + 1); -- if(var8 != null) { -- var1.add(var8); -- var0.c.add(var8); -+ } else if (Math.abs(par3 - par0ComponentStrongholdStairs2.getBoundingBox().minX) <= 112 && Math.abs(par5 - par0ComponentStrongholdStairs2.getBoundingBox().minZ) <= 112) { -+ ComponentStronghold var8 = getNextComponent(par0ComponentStrongholdStairs2, par1List, par2Random, par3, par4, par5, par6, par7 + 1); -+ -+ if (var8 != null) { -+ par1List.add(var8); -+ par0ComponentStrongholdStairs2.field_75026_c.add(var8); - } - - return var8; -@@ -152,13 +166,13 @@ - } - } - -- static StructureComponent getNextValidComponentAccess(ComponentStrongholdStairs2 var0, List var1, Random var2, int var3, int var4, int var5, int var6, int var7) { -- return getNextValidComponent(var0, var1, var2, var3, var4, var5, var6, var7); -+ static StructureComponent getNextValidComponentAccess(ComponentStrongholdStairs2 par0ComponentStrongholdStairs2, List par1List, Random par2Random, int par3, int par4, int par5, int par6, int par7) { -+ return getNextValidComponent(par0ComponentStrongholdStairs2, par1List, par2Random, par3, par4, par5, par6, par7); - } - -- static Class setComponentType(Class var0) { -- d = var0; -- return var0; -+ static Class setComponentType(Class par0Class) { -+ strongComponentType = par0Class; -+ return par0Class; - } - - static StructureStrongholdStones getStrongholdStones() { ---- net/minecraft/src/Packet200Statistic.java -+++ net/minecraft/src/Packet200Statistic.java -@@ -8,32 +8,47 @@ - public int statisticId; - public int amount; - -- public Packet200Statistic() { -- } -- -- public Packet200Statistic(int var1, int var2) { -- this.statisticId = var1; -- this.amount = var2; -- } -- -- public void processPacket(NetHandler var1) { -- var1.handleStatistic(this); -- } -- -- public void readPacketData(DataInput var1) throws IOException { -- this.statisticId = var1.readInt(); -- this.amount = var1.readInt(); -- } -- -- public void writePacketData(DataOutput var1) throws IOException { -- var1.writeInt(this.statisticId); -- var1.writeInt(this.amount); -- } -- -+ public Packet200Statistic() {} -+ -+ public Packet200Statistic(int par1, int par2) { -+ this.statisticId = par1; -+ this.amount = par2; -+ } -+ -+ /** -+ * Passes this Packet on to the NetHandler for processing. -+ */ -+ public void processPacket(NetHandler par1NetHandler) { -+ par1NetHandler.handleStatistic(this); -+ } -+ -+ /** -+ * Abstract. Reads the raw packet data from the data stream. -+ */ -+ public void readPacketData(DataInput par1DataInput) throws IOException { -+ this.statisticId = par1DataInput.readInt(); -+ this.amount = par1DataInput.readInt(); -+ } -+ -+ /** -+ * Abstract. Writes the raw packet data to the data stream. -+ */ -+ public void writePacketData(DataOutput par1DataOutput) throws IOException { -+ par1DataOutput.writeInt(this.statisticId); -+ par1DataOutput.writeInt(this.amount); -+ } -+ -+ /** -+ * Abstract. Return the size of the packet (not counting the header). -+ */ - public int getPacketSize() { - return 6; - } - -+ /** -+ * If this returns true, the packet may be processed on any thread; otherwise it is queued for the main thread to -+ * handle. -+ */ - public boolean canProcessAsync() { - return true; - } ---- net/minecraft/src/RenderSnowball.java -+++ net/minecraft/src/RenderSnowball.java -@@ -7,26 +7,34 @@ - private Item field_94151_a; - private int field_94150_f; - -- public RenderSnowball(Item var1, int var2) { -- this.field_94151_a = var1; -- this.field_94150_f = var2; -- } -- -- public RenderSnowball(Item var1) { -- this(var1, 0); -- } -- -- public void doRender(Entity var1, double var2, double var4, double var6, float var8, float var9) { -+ public RenderSnowball(Item par1Item, int par2) { -+ this.field_94151_a = par1Item; -+ this.field_94150_f = par2; -+ } -+ -+ public RenderSnowball(Item par1Item) { -+ this(par1Item, 0); -+ } -+ -+ /** -+ * Actually renders the given argument. This is a synthetic bridge method, always casting down its argument and then -+ * handing it off to a worker function which does the actual work. In all probabilty, the class Render is generic -+ * (Render> 16 & 255) / 255.0F; - float var14 = (float)(var12 >> 8 & 255) / 255.0F; - float var15 = (float)(var12 & 255) / 255.0F; -@@ -43,26 +51,29 @@ - } - } - -- protected ResourceLocation getEntityTexture(Entity var1) { -+ /** -+ * Returns the location of an entity's texture. Doesn't seem to be called unless you call Render.bindEntityTexture. -+ */ -+ protected ResourceLocation getEntityTexture(Entity par1Entity) { - return TextureMap.locationItemsTexture; - } - -- private void func_77026_a(Tessellator var1, Icon var2) { -- float var3 = var2.getMinU(); -- float var4 = var2.getMaxU(); -- float var5 = var2.getMinV(); -- float var6 = var2.getMaxV(); -+ private void func_77026_a(Tessellator par1Tessellator, Icon par2Icon) { -+ float var3 = par2Icon.getMinU(); -+ float var4 = par2Icon.getMaxU(); -+ float var5 = par2Icon.getMinV(); -+ float var6 = par2Icon.getMaxV(); - float var7 = 1.0F; - float var8 = 0.5F; - float var9 = 0.25F; - GL11.glRotatef(180.0F - this.renderManager.playerViewY, 0.0F, 1.0F, 0.0F); - GL11.glRotatef(-this.renderManager.playerViewX, 1.0F, 0.0F, 0.0F); -- var1.startDrawingQuads(); -- var1.setNormal(0.0F, 1.0F, 0.0F); -- var1.addVertexWithUV((double)(0.0F - var8), (double)(0.0F - var9), 0.0D, (double)var3, (double)var6); -- var1.addVertexWithUV((double)(var7 - var8), (double)(0.0F - var9), 0.0D, (double)var4, (double)var6); -- var1.addVertexWithUV((double)(var7 - var8), (double)(var7 - var9), 0.0D, (double)var4, (double)var5); -- var1.addVertexWithUV((double)(0.0F - var8), (double)(var7 - var9), 0.0D, (double)var3, (double)var5); -- var1.draw(); -+ par1Tessellator.startDrawingQuads(); -+ par1Tessellator.setNormal(0.0F, 1.0F, 0.0F); -+ par1Tessellator.addVertexWithUV((double)(0.0F - var8), (double)(0.0F - var9), 0.0D, (double)var3, (double)var6); -+ par1Tessellator.addVertexWithUV((double)(var7 - var8), (double)(0.0F - var9), 0.0D, (double)var4, (double)var6); -+ par1Tessellator.addVertexWithUV((double)(var7 - var8), (double)(var7 - var9), 0.0D, (double)var4, (double)var5); -+ par1Tessellator.addVertexWithUV((double)(0.0F - var8), (double)(var7 - var9), 0.0D, (double)var3, (double)var5); -+ par1Tessellator.draw(); - } - } ---- /dev/null -+++ org/spoutcraft/client/gui/settings/controls/ChatColorAssistButton.java -@@ -1,0 +1,37 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.client.gui.settings.controls; -+ -+import org.spoutcraft.api.gui.GenericCheckBox; -+import org.spoutcraft.client.config.Configuration; -+ -+public class ChatColorAssistButton extends GenericCheckBox { -+ public ChatColorAssistButton() { -+ super("Chat Colors Assistant"); -+ setChecked(Configuration.isShowingChatColorAssist()); -+ setTooltip("Displays helpful guide for Chat formatting codes."); -+ } -+ -+ @Override -+ public void onButtonClick() { -+ Configuration.setChatColorAssist(!Configuration.isShowingChatColorAssist()); -+ Configuration.write(); -+ } -+} ---- net/minecraft/src/CallableJVMFlags.java -+++ net/minecraft/src/CallableJVMFlags.java -@@ -7,12 +7,17 @@ - import java.util.concurrent.Callable; - - class CallableJVMFlags implements Callable { -+ -+ /** Reference to the CrashReport object. */ - final CrashReport theCrashReport; - -- CallableJVMFlags(CrashReport var1) { -- this.theCrashReport = var1; -+ CallableJVMFlags(CrashReport par1CrashReport) { -+ this.theCrashReport = par1CrashReport; - } - -+ /** -+ * Returns the number of JVM Flags along with the passed JVM Flags. -+ */ - public String getJVMFlagsAsString() { - RuntimeMXBean var1 = ManagementFactory.getRuntimeMXBean(); - List var2 = var1.getInputArguments(); -@@ -20,10 +25,11 @@ - StringBuilder var4 = new StringBuilder(); - Iterator var5 = var2.iterator(); - -- while(var5.hasNext()) { -+ while (var5.hasNext()) { - String var6 = (String)var5.next(); -- if(var6.startsWith("-X")) { -- if(var3++ > 0) { -+ -+ if (var6.startsWith("-X")) { -+ if (var3++ > 0) { - var4.append(" "); - } - -@@ -31,7 +37,7 @@ - } - } - -- return String.format("%d total; %s", new Object[]{Integer.valueOf(var3), var4.toString()}); -+ return String.format("%d total; %s", new Object[] {Integer.valueOf(var3), var4.toString()}); - } - - public Object call() { ---- net/minecraft/src/NibbleArrayReader.java -+++ net/minecraft/src/NibbleArrayReader.java -@@ -5,14 +5,14 @@ - private final int depthBits; - private final int depthBitsPlusFour; - -- public NibbleArrayReader(byte[] var1, int var2) { -- this.data = var1; -- this.depthBits = var2; -- this.depthBitsPlusFour = var2 + 4; -+ public NibbleArrayReader(byte[] par1ArrayOfByte, int par2) { -+ this.data = par1ArrayOfByte; -+ this.depthBits = par2; -+ this.depthBitsPlusFour = par2 + 4; - } - -- public int get(int var1, int var2, int var3) { -- int var4 = var1 << this.depthBitsPlusFour | var3 << this.depthBits | var2; -+ public int get(int par1, int par2, int par3) { -+ int var4 = par1 << this.depthBitsPlusFour | par3 << this.depthBits | par2; - int var5 = var4 >> 1; - int var6 = var4 & 1; - return var6 == 0 ? this.data[var5] & 15 : this.data[var5] >> 4 & 15; ---- net/minecraft/src/CommandException.java -+++ net/minecraft/src/CommandException.java -@@ -1,14 +1,14 @@ - package net.minecraft.src; - - public class CommandException extends RuntimeException { -- private Object[] a; -+ private Object[] errorObjects; - -- public CommandException(String var1, Object... var2) { -- super(var1); -- this.a = var2; -+ public CommandException(String par1Str, Object ... par2ArrayOfObj) { -+ super(par1Str); -+ this.errorObjects = par2ArrayOfObj; - } - - public Object[] getErrorOjbects() { -- return this.a; -+ return this.errorObjects; - } - } ---- net/minecraft/src/ContainerDispenser.java -+++ net/minecraft/src/ContainerDispenser.java -@@ -3,58 +3,68 @@ - public class ContainerDispenser extends Container { - private TileEntityDispenser tileEntityDispenser; - -- public ContainerDispenser(IInventory var1, TileEntityDispenser var2) { -- this.tileEntityDispenser = var2; -- -+ public ContainerDispenser(IInventory par1IInventory, TileEntityDispenser par2TileEntityDispenser) { -+ this.tileEntityDispenser = par2TileEntityDispenser; - int var3; - int var4; -- for(var3 = 0; var3 < 3; ++var3) { -- for(var4 = 0; var4 < 3; ++var4) { -- this.addSlotToContainer(new Slot(var2, var4 + var3 * 3, 62 + var4 * 18, 17 + var3 * 18)); -- } -- } -- -- for(var3 = 0; var3 < 3; ++var3) { -- for(var4 = 0; var4 < 9; ++var4) { -- this.addSlotToContainer(new Slot(var1, var4 + var3 * 9 + 9, 8 + var4 * 18, 84 + var3 * 18)); -- } -- } -- -- for(var3 = 0; var3 < 9; ++var3) { -- this.addSlotToContainer(new Slot(var1, var3, 8 + var3 * 18, 142)); -- } -- -- } -- -- public boolean canInteractWith(EntityPlayer var1) { -- return this.tileEntityDispenser.isUseableByPlayer(var1); -- } -- -- public ItemStack transferStackInSlot(EntityPlayer var1, int var2) { -+ -+ for (var3 = 0; var3 < 3; ++var3) { -+ for (var4 = 0; var4 < 3; ++var4) { -+ this.addSlotToContainer(new Slot(par2TileEntityDispenser, var4 + var3 * 3, 62 + var4 * 18, 17 + var3 * 18)); -+ } -+ } -+ -+ for (var3 = 0; var3 < 3; ++var3) { -+ for (var4 = 0; var4 < 9; ++var4) { -+ this.addSlotToContainer(new Slot(par1IInventory, var4 + var3 * 9 + 9, 8 + var4 * 18, 84 + var3 * 18)); -+ } -+ } -+ -+ for (var3 = 0; var3 < 9; ++var3) { -+ this.addSlotToContainer(new Slot(par1IInventory, var3, 8 + var3 * 18, 142)); -+ } -+ } -+ -+ // Spout Start -+ public IInventory getIInventory() { -+ return tileEntityDispenser; -+ } -+ // Spout End -+ -+ public boolean canInteractWith(EntityPlayer par1EntityPlayer) { -+ return this.tileEntityDispenser.isUseableByPlayer(par1EntityPlayer); -+ } -+ -+ /** -+ * Called when a player shift-clicks on a slot. You must override this or you will crash when someone does that. -+ */ -+ public ItemStack transferStackInSlot(EntityPlayer par1EntityPlayer, int par2) { - ItemStack var3 = null; -- Slot var4 = (Slot)this.c.get(var2); -- if(var4 != null && var4.getHasStack()) { -+ Slot var4 = (Slot)this.inventorySlots.get(par2); -+ -+ if (var4 != null && var4.getHasStack()) { - ItemStack var5 = var4.getStack(); - var3 = var5.copy(); -- if(var2 < 9) { -- if(!this.mergeItemStack(var5, 9, 45, true)) { -+ -+ if (par2 < 9) { -+ if (!this.mergeItemStack(var5, 9, 45, true)) { - return null; - } -- } else if(!this.mergeItemStack(var5, 0, 9, false)) { -+ } else if (!this.mergeItemStack(var5, 0, 9, false)) { - return null; - } - -- if(var5.stackSize == 0) { -+ if (var5.stackSize == 0) { - var4.putStack((ItemStack)null); - } else { - var4.onSlotChanged(); - } - -- if(var5.stackSize == var3.stackSize) { -+ if (var5.stackSize == var3.stackSize) { - return null; - } - -- var4.onPickupFromSlot(var1, var5); -+ var4.onPickupFromSlot(par1EntityPlayer, var5); - } - - return var3; ---- net/minecraft/src/BlockOre.java -+++ net/minecraft/src/BlockOre.java -@@ -3,54 +3,71 @@ - import java.util.Random; - - public class BlockOre extends Block { -- public BlockOre(int var1) { -- super(var1, Material.rock); -+ public BlockOre(int par1) { -+ super(par1, Material.rock); - this.setCreativeTab(CreativeTabs.tabBlock); - } - -- public int idDropped(int var1, Random var2, int var3) { -+ /** -+ * Returns the ID of the items to drop on destruction. -+ */ -+ public int idDropped(int par1, Random par2Random, int par3) { - return this.blockID == Block.oreCoal.blockID ? Item.coal.itemID : (this.blockID == Block.oreDiamond.blockID ? Item.diamond.itemID : (this.blockID == Block.oreLapis.blockID ? Item.dyePowder.itemID : (this.blockID == Block.oreEmerald.blockID ? Item.emerald.itemID : (this.blockID == Block.oreNetherQuartz.blockID ? Item.netherQuartz.itemID : this.blockID)))); - } - -- public int quantityDropped(Random var1) { -- return this.blockID == Block.oreLapis.blockID ? 4 + var1.nextInt(5) : 1; -+ /** -+ * Returns the quantity of items to drop on block destruction. -+ */ -+ public int quantityDropped(Random par1Random) { -+ return this.blockID == Block.oreLapis.blockID ? 4 + par1Random.nextInt(5) : 1; - } - -- public int quantityDroppedWithBonus(int var1, Random var2) { -- if(var1 > 0 && this.blockID != this.idDropped(0, var2, var1)) { -- int var3 = var2.nextInt(var1 + 2) - 1; -- if(var3 < 0) { -+ /** -+ * Returns the usual quantity dropped by the block plus a bonus of 1 to 'i' (inclusive). -+ */ -+ public int quantityDroppedWithBonus(int par1, Random par2Random) { -+ if (par1 > 0 && this.blockID != this.idDropped(0, par2Random, par1)) { -+ int var3 = par2Random.nextInt(par1 + 2) - 1; -+ -+ if (var3 < 0) { - var3 = 0; - } - -- return this.quantityDropped(var2) * (var3 + 1); -+ return this.quantityDropped(par2Random) * (var3 + 1); - } else { -- return this.quantityDropped(var2); -+ return this.quantityDropped(par2Random); - } - } - -- public void dropBlockAsItemWithChance(World var1, int var2, int var3, int var4, int var5, float var6, int var7) { -- super.dropBlockAsItemWithChance(var1, var2, var3, var4, var5, var6, var7); -- if(this.idDropped(var5, var1.s, var7) != this.blockID) { -+ /** -+ * Drops the block items with a specified chance of dropping the specified items -+ */ -+ public void dropBlockAsItemWithChance(World par1World, int par2, int par3, int par4, int par5, float par6, int par7) { -+ super.dropBlockAsItemWithChance(par1World, par2, par3, par4, par5, par6, par7); -+ -+ if (this.idDropped(par5, par1World.rand, par7) != this.blockID) { - int var8 = 0; -- if(this.blockID == Block.oreCoal.blockID) { -- var8 = MathHelper.getRandomIntegerInRange(var1.s, 0, 2); -- } else if(this.blockID == Block.oreDiamond.blockID) { -- var8 = MathHelper.getRandomIntegerInRange(var1.s, 3, 7); -- } else if(this.blockID == Block.oreEmerald.blockID) { -- var8 = MathHelper.getRandomIntegerInRange(var1.s, 3, 7); -- } else if(this.blockID == Block.oreLapis.blockID) { -- var8 = MathHelper.getRandomIntegerInRange(var1.s, 2, 5); -- } else if(this.blockID == Block.oreNetherQuartz.blockID) { -- var8 = MathHelper.getRandomIntegerInRange(var1.s, 2, 5); -+ -+ if (this.blockID == Block.oreCoal.blockID) { -+ var8 = MathHelper.getRandomIntegerInRange(par1World.rand, 0, 2); -+ } else if (this.blockID == Block.oreDiamond.blockID) { -+ var8 = MathHelper.getRandomIntegerInRange(par1World.rand, 3, 7); -+ } else if (this.blockID == Block.oreEmerald.blockID) { -+ var8 = MathHelper.getRandomIntegerInRange(par1World.rand, 3, 7); -+ } else if (this.blockID == Block.oreLapis.blockID) { -+ var8 = MathHelper.getRandomIntegerInRange(par1World.rand, 2, 5); -+ } else if (this.blockID == Block.oreNetherQuartz.blockID) { -+ var8 = MathHelper.getRandomIntegerInRange(par1World.rand, 2, 5); - } - -- this.dropXpOnBlockBreak(var1, var2, var3, var4, var8); -+ this.dropXpOnBlockBreak(par1World, par2, par3, par4, var8); - } -- - } - -- public int damageDropped(int var1) { -+ /** -+ * Determines the damage on the item the block drops. Used in cloth and wood. -+ */ -+ public int damageDropped(int par1) { - return this.blockID == Block.oreLapis.blockID ? 4 : 0; - } - } ---- net/minecraft/src/GuiScreenBackup.java -+++ net/minecraft/src/GuiScreenBackup.java -@@ -7,120 +7,129 @@ - public class GuiScreenBackup extends GuiScreen { - private final GuiScreenConfigureWorld field_110380_a; - private final long field_110377_b; -- private List c = Collections.emptyList(); -+ private List field_110378_c = Collections.emptyList(); - private GuiScreenBackupSelectionList field_110375_d; - private int field_110376_e = -1; - private GuiButton field_110379_p; - -- public GuiScreenBackup(GuiScreenConfigureWorld var1, long var2) { -- this.field_110380_a = var1; -- this.field_110377_b = var2; -+ public GuiScreenBackup(GuiScreenConfigureWorld par1GuiScreenConfigureWorld, long par2) { -+ this.field_110380_a = par1GuiScreenConfigureWorld; -+ this.field_110377_b = par2; - } - -+ /** -+ * Adds the buttons (and other controls) to the screen in question. -+ */ - public void initGui() { - Keyboard.enableRepeatEvents(true); -- this.i.clear(); -+ this.buttonList.clear(); - this.field_110375_d = new GuiScreenBackupSelectionList(this); - (new GuiScreenBackupDownloadThread(this)).start(); - this.func_110369_g(); - } - - private void func_110369_g() { -- this.i.add(new GuiButton(0, this.width / 2 + 6, this.height - 52, 153, 20, I18n.getString("gui.back"))); -- this.i.add(this.field_110379_p = new GuiButton(1, this.width / 2 - 154, this.height - 52, 153, 20, I18n.getString("mco.backup.button.restore"))); -+ this.buttonList.add(new GuiButton(0, this.width / 2 + 6, this.height - 52, 153, 20, I18n.getString("gui.back"))); -+ this.buttonList.add(this.field_110379_p = new GuiButton(1, this.width / 2 - 154, this.height - 52, 153, 20, I18n.getString("mco.backup.button.restore"))); - } - -+ /** -+ * Called from the main game loop to update the screen. -+ */ - public void updateScreen() { - super.updateScreen(); - } - -- protected void actionPerformed(GuiButton var1) { -- if(var1.enabled) { -- if(var1.id == 1) { -+ /** -+ * Fired when a control is clicked. This is the equivalent of ActionListener.actionPerformed(ActionEvent e). -+ */ -+ protected void actionPerformed(GuiButton par1GuiButton) { -+ if (par1GuiButton.enabled) { -+ if (par1GuiButton.id == 1) { - String var2 = I18n.getString("mco.configure.world.restore.question.line1"); - String var3 = I18n.getString("mco.configure.world.restore.question.line2"); - this.mc.displayGuiScreen(new GuiScreenConfirmation(this, GuiScreenConfirmationType.Warning, var2, var3, 1)); -- } else if(var1.id == 0) { -+ } else if (par1GuiButton.id == 0) { - this.mc.displayGuiScreen(this.field_110380_a); - } else { -- this.field_110375_d.actionPerformed(var1); -+ this.field_110375_d.actionPerformed(par1GuiButton); - } -- - } - } - -- public void confirmClicked(boolean var1, int var2) { -- if(var1 && var2 == 1) { -+ public void confirmClicked(boolean par1, int par2) { -+ if (par1 && par2 == 1) { - this.func_110374_h(); - } else { - this.mc.displayGuiScreen(this); - } -- - } - - private void func_110374_h() { -- if(this.field_110376_e >= 0 && this.field_110376_e < this.c.size()) { -- Backup var1 = (Backup)this.c.get(this.field_110376_e); -+ if (this.field_110376_e >= 0 && this.field_110376_e < this.field_110378_c.size()) { -+ Backup var1 = (Backup)this.field_110378_c.get(this.field_110376_e); - GuiScreenBackupRestoreTask var2 = new GuiScreenBackupRestoreTask(this, var1, (GuiScreenBackupDownloadThread)null); - GuiScreenLongRunningTask var3 = new GuiScreenLongRunningTask(this.mc, this.field_110380_a, var2); - var3.func_98117_g(); - this.mc.displayGuiScreen(var3); - } -- - } - -- public void drawScreen(int var1, int var2, float var3) { -+ /** -+ * Draws the screen and all the components in it. -+ */ -+ public void drawScreen(int par1, int par2, float par3) { - this.drawDefaultBackground(); -- this.field_110375_d.drawScreen(var1, var2, var3); -+ this.field_110375_d.drawScreen(par1, par2, par3); - this.drawCenteredString(this.fontRenderer, I18n.getString("mco.backup.title"), this.width / 2, 20, 16777215); -- super.drawScreen(var1, var2, var3); -- } -- -- static Minecraft func_110366_a(GuiScreenBackup var0) { -- return var0.mc; -- } -- -- static List func_110373_a(GuiScreenBackup var0, List var1) { -- return var0.c = var1; -- } -- -- static long func_110367_b(GuiScreenBackup var0) { -- return var0.field_110377_b; -- } -- -- static Minecraft func_130030_c(GuiScreenBackup var0) { -- return var0.mc; -- } -- -- static GuiScreenConfigureWorld func_130031_d(GuiScreenBackup var0) { -- return var0.field_110380_a; -- } -- -- static Minecraft func_130035_e(GuiScreenBackup var0) { -- return var0.mc; -- } -- -- static Minecraft func_130036_f(GuiScreenBackup var0) { -- return var0.mc; -- } -- -- static List func_110370_e(GuiScreenBackup var0) { -- return var0.c; -- } -- -- static int func_130029_a(GuiScreenBackup var0, int var1) { -- return var0.field_110376_e = var1; -- } -- -- static int func_130034_h(GuiScreenBackup var0) { -- return var0.field_110376_e; -- } -- -- static FontRenderer func_130032_i(GuiScreenBackup var0) { -- return var0.fontRenderer; -- } -- -- static FontRenderer func_130033_j(GuiScreenBackup var0) { -- return var0.fontRenderer; -+ super.drawScreen(par1, par2, par3); -+ } -+ -+ static Minecraft func_110366_a(GuiScreenBackup par0GuiScreenBackup) { -+ return par0GuiScreenBackup.mc; -+ } -+ -+ static List func_110373_a(GuiScreenBackup par0GuiScreenBackup, List par1List) { -+ return par0GuiScreenBackup.field_110378_c = par1List; -+ } -+ -+ static long func_110367_b(GuiScreenBackup par0GuiScreenBackup) { -+ return par0GuiScreenBackup.field_110377_b; -+ } -+ -+ static Minecraft func_130030_c(GuiScreenBackup par0GuiScreenBackup) { -+ return par0GuiScreenBackup.mc; -+ } -+ -+ static GuiScreenConfigureWorld func_130031_d(GuiScreenBackup par0GuiScreenBackup) { -+ return par0GuiScreenBackup.field_110380_a; -+ } -+ -+ static Minecraft func_130035_e(GuiScreenBackup par0GuiScreenBackup) { -+ return par0GuiScreenBackup.mc; -+ } -+ -+ static Minecraft func_130036_f(GuiScreenBackup par0GuiScreenBackup) { -+ return par0GuiScreenBackup.mc; -+ } -+ -+ static List func_110370_e(GuiScreenBackup par0GuiScreenBackup) { -+ return par0GuiScreenBackup.field_110378_c; -+ } -+ -+ static int func_130029_a(GuiScreenBackup par0GuiScreenBackup, int par1) { -+ return par0GuiScreenBackup.field_110376_e = par1; -+ } -+ -+ static int func_130034_h(GuiScreenBackup par0GuiScreenBackup) { -+ return par0GuiScreenBackup.field_110376_e; -+ } -+ -+ static FontRenderer func_130032_i(GuiScreenBackup par0GuiScreenBackup) { -+ return par0GuiScreenBackup.fontRenderer; -+ } -+ -+ static FontRenderer func_130033_j(GuiScreenBackup par0GuiScreenBackup) { -+ return par0GuiScreenBackup.fontRenderer; - } - } ---- /dev/null -+++ org/spoutcraft/client/block/SpoutcraftChunk.java -@@ -1,0 +1,156 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.client.block; -+ -+import java.lang.ref.WeakReference; -+import java.util.HashSet; -+import java.util.Set; -+ -+import org.apache.commons.lang3.builder.HashCodeBuilder; -+ -+import net.minecraft.src.Minecraft; -+ -+import org.spoutcraft.api.material.CustomBlock; -+import org.spoutcraft.api.material.MaterialData; -+ -+public class SpoutcraftChunk{ -+ public static final Set loadedChunks = new HashSet(); -+ -+ private WeakReference weakChunk; -+ private net.minecraft.src.World world; -+ private int x; -+ private int z; -+ private short[] customBlockData = null; -+ private byte[] customBlockRotations = null; -+ public SpoutcraftChunk(net.minecraft.src.Chunk chunk) { -+ this.weakChunk = new WeakReference(chunk); -+ world = chunk.worldObj; -+ x = chunk.xPosition; -+ z = chunk.zPosition; -+ } -+ -+ public net.minecraft.src.Chunk getHandle() { -+ net.minecraft.src.Chunk c = weakChunk.get(); -+ if (c == null) { -+ c = world.getChunkFromChunkCoords(x, z); -+ weakChunk = new WeakReference(c); -+ } -+ return c; -+ } -+ -+ public int getX() { -+ return x; -+ } -+ -+ public int getZ() { -+ return z; -+ } -+ -+ public short getCustomBlockId(int x, int y, int z) { -+ if (customBlockData != null) { -+ int key = ((x & 0xF) << 12) | ((z & 0xF) << 8) | (y & 0xFF); -+ return customBlockData[key]; -+ } -+ return 0; -+ } -+ -+ public short setCustomBlockId(int x, int y, int z, short id) { -+ if (customBlockData == null) { -+ customBlockData = new short[16*16*256]; -+ } -+ if (id < 0) id = 0; -+ int key = ((x & 0xF) << 12) | ((z & 0xF) << 8) | (y & 0xFF); -+ short old = customBlockData[key]; -+ customBlockData[key] = id; -+ Minecraft.getMinecraft().theWorld.markBlockForRenderUpdate(x, y, z); -+ return old; -+ } -+ -+ public short[] getCustomBlockIds() { -+ return customBlockData; -+ } -+ -+ public void setCustomBlockIds(short[] ids) { -+ customBlockData = ids; -+ Minecraft.getMinecraft().theWorld.markBlockRangeForRenderUpdate(x * 16, 0, z * 16, x * 16 + 15, 255, z * 16 + 15); -+ } -+ -+ public CustomBlock setCustomBlockId(int x, int y, int z, CustomBlock block) { -+ if (block == null) { -+ throw new NullPointerException("Custom Block can not be null!"); -+ } -+ short old = setCustomBlockId(x, y, z, (short) block.getCustomId()); -+ return MaterialData.getCustomBlock(old); -+ } -+ -+ public byte getCustomBlockData(int x, int y, int z) { -+ if (customBlockRotations != null) { -+ int key = ((x & 0xF) << 12) | ((z & 0xF) << 8) | (y & 0xFF); -+ return customBlockRotations[key]; -+ } -+ return 0; -+ } -+ -+ public byte setCustomBlockData(int x, int y, int z, byte rot) { -+ if (customBlockRotations == null) { -+ customBlockRotations = new byte[16*16*256]; -+ } -+ if (rot < 0) rot = 0; -+ int key = ((x & 0xF) << 12) | ((z & 0xF) << 8) | (y & 0xFF); -+ byte old = customBlockRotations[key]; -+ customBlockRotations[key] = rot; -+ Minecraft.getMinecraft().theWorld.markBlockForRenderUpdate(x, y, z); -+ return old; -+ } -+ -+ public byte[] getCustomBlockData() { -+ return customBlockRotations; -+ } -+ -+ public void setCustomBlockData(byte[] data) { -+ customBlockRotations = data; -+ Minecraft.getMinecraft().theWorld.markBlockRangeForRenderUpdate(x * 16, 0, z * 16, x * 16 + 15, 255, z * 16 + 15); -+ } -+ -+ public CustomBlock setCustomBlockId(int x, int y, int z, CustomBlock block, byte data) { -+ if (block == null) { -+ throw new NullPointerException("Custom Block can not be null!"); -+ } -+ short old = setCustomBlockId(x, y, z, (short) block.getCustomId()); -+ setCustomBlockData(x, y, z, data); -+ return MaterialData.getCustomBlock(old); -+ } -+ -+ public int hashCode() { -+ return new HashCodeBuilder().append(x).append(z).hashCode(); -+ } -+ -+ public boolean equals(Object obj) { -+ if (obj instanceof SpoutcraftChunk) { -+ SpoutcraftChunk other = (SpoutcraftChunk)obj; -+ return x == other.x && z == other.z; -+ } -+ return false; -+ } -+ -+ public String toString() { -+ return "SpoutcraftChunk (" + x + ", " + z + ") "; -+ } -+} ---- net/minecraft/src/WorldGenTallGrass.java -+++ net/minecraft/src/WorldGenTallGrass.java -@@ -3,33 +3,33 @@ - import java.util.Random; - - public class WorldGenTallGrass extends WorldGenerator { -+ -+ /** Stores ID for WorldGenTallGrass */ - private int tallGrassID; - private int tallGrassMetadata; - -- public WorldGenTallGrass(int var1, int var2) { -- this.tallGrassID = var1; -- this.tallGrassMetadata = var2; -+ public WorldGenTallGrass(int par1, int par2) { -+ this.tallGrassID = par1; -+ this.tallGrassMetadata = par2; - } - -- public boolean generate(World var1, Random var2, int var3, int var4, int var5) { -- boolean var6 = false; -- -- while(true) { -- int var11 = var1.getBlockId(var3, var4, var5); -- if(var11 != 0 && var11 != Block.leaves.blockID || var4 <= 0) { -- for(int var7 = 0; var7 < 128; ++var7) { -- int var8 = var3 + var2.nextInt(8) - var2.nextInt(8); -- int var9 = var4 + var2.nextInt(4) - var2.nextInt(4); -- int var10 = var5 + var2.nextInt(8) - var2.nextInt(8); -- if(var1.isAirBlock(var8, var9, var10) && Block.blocksList[this.tallGrassID].canBlockStay(var1, var8, var9, var10)) { -- var1.setBlock(var8, var9, var10, this.tallGrassID, this.tallGrassMetadata, 2); -- } -- } -- -- return true; -+ public boolean generate(World par1World, Random par2Random, int par3, int par4, int par5) { -+ int var11; -+ -+ for (boolean var6 = false; ((var11 = par1World.getBlockId(par3, par4, par5)) == 0 || var11 == Block.leaves.blockID) && par4 > 0; --par4) { -+ ; -+ } -+ -+ for (int var7 = 0; var7 < 128; ++var7) { -+ int var8 = par3 + par2Random.nextInt(8) - par2Random.nextInt(8); -+ int var9 = par4 + par2Random.nextInt(4) - par2Random.nextInt(4); -+ int var10 = par5 + par2Random.nextInt(8) - par2Random.nextInt(8); -+ -+ if (par1World.isAirBlock(var8, var9, var10) && Block.blocksList[this.tallGrassID].canBlockStay(par1World, var8, var9, var10)) { -+ par1World.setBlock(var8, var9, var10, this.tallGrassID, this.tallGrassMetadata, 2); - } -- -- --var4; - } -+ -+ return true; - } - } ---- net/minecraft/src/Packet204ClientInfo.java -+++ net/minecraft/src/Packet204ClientInfo.java -@@ -5,53 +5,64 @@ - import java.io.IOException; - - public class Packet204ClientInfo extends Packet { -- private String a; -+ private String language; - private int renderDistance; - private int chatVisisble; - private boolean chatColours; - private int gameDifficulty; - private boolean showCape; - -- public Packet204ClientInfo() { -- } -- -- public Packet204ClientInfo(String var1, int var2, int var3, boolean var4, int var5, boolean var6) { -- this.a = var1; -- this.renderDistance = var2; -- this.chatVisisble = var3; -- this.chatColours = var4; -- this.gameDifficulty = var5; -- this.showCape = var6; -- } -- -- public void readPacketData(DataInput var1) throws IOException { -- this.a = readString(var1, 7); -- this.renderDistance = var1.readByte(); -- byte var2 = var1.readByte(); -+ public Packet204ClientInfo() {} -+ -+ public Packet204ClientInfo(String par1Str, int par2, int par3, boolean par4, int par5, boolean par6) { -+ this.language = par1Str; -+ this.renderDistance = par2; -+ this.chatVisisble = par3; -+ this.chatColours = par4; -+ this.gameDifficulty = par5; -+ this.showCape = par6; -+ } -+ -+ /** -+ * Abstract. Reads the raw packet data from the data stream. -+ */ -+ public void readPacketData(DataInput par1DataInput) throws IOException { -+ this.language = readString(par1DataInput, 7); -+ this.renderDistance = par1DataInput.readByte(); -+ byte var2 = par1DataInput.readByte(); - this.chatVisisble = var2 & 7; - this.chatColours = (var2 & 8) == 8; -- this.gameDifficulty = var1.readByte(); -- this.showCape = var1.readBoolean(); -- } -- -- public void writePacketData(DataOutput var1) throws IOException { -- writeString(this.a, var1); -- var1.writeByte(this.renderDistance); -- var1.writeByte(this.chatVisisble | (this.chatColours ? 1 : 0) << 3); -- var1.writeByte(this.gameDifficulty); -- var1.writeBoolean(this.showCape); -- } -- -- public void processPacket(NetHandler var1) { -- var1.handleClientInfo(this); -- } -- -+ this.gameDifficulty = par1DataInput.readByte(); -+ this.showCape = par1DataInput.readBoolean(); -+ } -+ -+ /** -+ * Abstract. Writes the raw packet data to the data stream. -+ */ -+ public void writePacketData(DataOutput par1DataOutput) throws IOException { -+ writeString(this.language, par1DataOutput); -+ par1DataOutput.writeByte(this.renderDistance); -+ par1DataOutput.writeByte(this.chatVisisble | (this.chatColours ? 1 : 0) << 3); -+ par1DataOutput.writeByte(this.gameDifficulty); -+ par1DataOutput.writeBoolean(this.showCape); -+ } -+ -+ /** -+ * Passes this Packet on to the NetHandler for processing. -+ */ -+ public void processPacket(NetHandler par1NetHandler) { -+ par1NetHandler.handleClientInfo(this); -+ } -+ -+ /** -+ * Abstract. Return the size of the packet (not counting the header). -+ */ - public int getPacketSize() { - return 7; - } - - public String getLanguage() { -- return this.a; -+ return this.language; - } - - public int getRenderDistance() { -@@ -74,11 +85,18 @@ - return this.showCape; - } - -+ /** -+ * only false for the abstract Packet class, all real packets return true -+ */ - public boolean isRealPacket() { - return true; - } - -- public boolean containsSameEntityIDAs(Packet var1) { -+ /** -+ * eg return packet30entity.entityId == entityId; WARNING : will throw if you compare a packet to a different packet -+ * class -+ */ -+ public boolean containsSameEntityIDAs(Packet par1Packet) { - return true; - } - } ---- /dev/null -+++ org/spoutcraft/client/packet/PacketSpawnTextEntity.java -@@ -1,0 +1,92 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.client.packet; -+ -+import java.io.IOException; -+ -+import net.minecraft.src.Minecraft; -+ -+import org.spoutcraft.api.io.SpoutInputStream; -+import org.spoutcraft.api.io.SpoutOutputStream; -+import org.spoutcraft.client.entity.EntityText; -+ -+public class PacketSpawnTextEntity implements SpoutPacket { -+ private String text; -+ private double posX, posY, posZ, moveX, moveY, moveZ; -+ private int duration; -+ private float scale; -+ -+ public PacketSpawnTextEntity() { -+ } -+ -+ @Override -+ public void readData(SpoutInputStream input) throws IOException { -+ text = input.readString(); -+ posX = input.readDouble(); -+ posY = input.readDouble(); -+ posZ = input.readDouble(); -+ scale = input.readFloat(); -+ duration = input.readInt(); -+ moveX = input.readDouble(); -+ moveY = input.readDouble(); -+ moveZ = input.readDouble(); -+ } -+ -+ @Override -+ public void writeData(SpoutOutputStream output) throws IOException { -+ output.writeString(text); -+ output.writeDouble(posX); -+ output.writeDouble(posY); -+ output.writeDouble(posZ); -+ output.writeFloat(scale); -+ output.writeInt(duration); -+ output.writeDouble(moveX); -+ output.writeDouble(moveY); -+ output.writeDouble(moveZ); -+ } -+ -+ @Override -+ public void run(int playerId) { -+ EntityText entity = new EntityText(Minecraft.getMinecraft().theWorld); -+ entity.setPosition(posX, posY, posZ); -+ entity.setScale(scale); -+ entity.setText(text); -+ entity.setRotateWithPlayer(true); -+ entity.motionX = moveX; -+ entity.motionY = moveY; -+ entity.motionZ = moveZ; -+ entity.setDuration(duration); -+ Minecraft.getMinecraft().theWorld.spawnEntityInWorld(entity); -+ } -+ -+ @Override -+ public void failure(int playerId) { -+ } -+ -+ @Override -+ public PacketType getPacketType() { -+ return PacketType.PacketSpawnTextEntity; -+ } -+ -+ @Override -+ public int getVersion() { -+ return 0; -+ } -+} ---- /dev/null -+++ org/spoutcraft/api/gui/GenericTextField.java -@@ -1,0 +1,227 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.api.gui; -+ -+import java.io.IOException; -+ -+import org.spoutcraft.api.Spoutcraft; -+import org.spoutcraft.api.UnsafeClass; -+import org.spoutcraft.api.io.SpoutInputStream; -+import org.spoutcraft.api.io.SpoutOutputStream; -+ -+@UnsafeClass -+public class GenericTextField extends GenericControl implements TextField { -+ public static final int PADDING = 4; -+ public static final int LINE_HEIGHT = 10; -+ public static final int LINE_SPACING = 2; -+ private static final char MASK_MAXLINES = 0x7F; // bits 1-7 -+ private static final char MASK_TABINDEX = 0x3F80; // bits 8-4 -+ private static final char FLAG_PASSWORD = 0x4000; // bit 15 -+ //private static final char FLAG_FOCUS = 0x8000; // bit 16 focus is already set in Control. -+ protected boolean password = false; -+ protected TextProcessor textProcessor; -+ protected int tabIndex = 0; -+ protected Color fieldColor = new Color(0, 0, 0); -+ protected Color borderColor = new Color(0.625F, 0.625F, 0.625F); -+ protected String placeholder = ""; -+ -+ public GenericTextField() { -+ this.textProcessor = new GenericTextProcessor(); -+ } -+ -+ @Override -+ public int getVersion() { -+ return super.getVersion() + 3; -+ } -+ -+ public String getActualText() { -+ return textProcessor.getText().length() == 0 ? getPlaceholder() : textProcessor.getText(); -+ } -+ -+ @Override -+ public void readData(SpoutInputStream input) throws IOException { -+ super.readData(input); -+ setFieldColor(input.readColor()); -+ setBorderColor(input.readColor()); -+ char c = input.readChar(); -+ setPasswordField((c & FLAG_PASSWORD) > 0); -+ setMaximumLines(c & MASK_MAXLINES); -+ setTabIndex((c & MASK_TABINDEX) >>> 7); -+ setCursorPosition(input.readChar()); -+ setMaximumCharacters(input.readChar()); -+ setText(input.readString()); -+ setPlaceholder(input.readString()); -+ } -+ -+ @Override -+ public void writeData(SpoutOutputStream output) throws IOException { -+ super.writeData(output); -+ output.writeColor(getFieldColor()); -+ output.writeColor( getBorderColor()); -+ output.writeChar((char) (getMaximumLines() & MASK_MAXLINES | (getTabIndex() << 7) & MASK_TABINDEX | (isPasswordField() ? FLAG_PASSWORD : 0))); -+ output.writeChar((char) getCursorPosition()); -+ output.writeChar((char) getMaximumCharacters()); -+ output.writeString(getText()); -+ output.writeString(getPlaceholder()); -+ } -+ -+ public int getCursorPosition() { -+ return textProcessor.getCursor(); -+ } -+ -+ public TextField setCursorPosition(int position) { -+ textProcessor.setCursor(position); -+ return this; -+ } -+ -+ public String getText() { -+ return textProcessor.getText(); -+ } -+ -+ public TextField setText(String text) { -+ textProcessor.setText(text); -+ return this; -+ } -+ -+ public int getMaximumCharacters() { -+ return textProcessor.getMaximumCharacters(); -+ } -+ -+ public TextField setMaximumCharacters(int max) { -+ textProcessor.setMaximumCharacters(Math.max(0, max)); -+ return this; -+ } -+ -+ public Color getFieldColor() { -+ return fieldColor; -+ } -+ -+ public TextField setFieldColor(Color color) { -+ this.fieldColor = color; -+ return this; -+ } -+ -+ public Color getBorderColor() { -+ return borderColor; -+ } -+ -+ public TextField setBorderColor(Color color) { -+ this.borderColor = color; -+ return this; -+ } -+ -+ public WidgetType getType() { -+ return WidgetType.TextField; -+ } -+ -+ public void render() { -+ Spoutcraft.getClient().getRenderDelegate().render(this); -+ } -+ -+ public TextProcessor getTextProcessor() { -+ return textProcessor; -+ } -+ -+ public TextField setTextProcessor(TextProcessor processor) { -+ processor.setWidth(getTextProcessor().getWidth()); -+ processor.setText(getTextProcessor().getText()); -+ this.textProcessor = processor; -+ return this; -+ } -+ -+ public int getMaximumLines() { -+ return textProcessor.getMaximumLines(); -+ } -+ -+ public TextField setMaximumLines(int max) { -+ // if max equals 0 calculate how many lines this text field can hold -+ textProcessor.setMaximumLines((max > 0) ? max : (int) Math.floor((getHeight() - (PADDING << 1) + LINE_SPACING) / (LINE_HEIGHT + LINE_SPACING))); -+ return this; -+ } -+ -+ public int getTabIndex() { -+ return tabIndex; -+ } -+ -+ public TextField setTabIndex(int index) { -+ this.tabIndex = index; -+ return this; -+ } -+ -+ public boolean isPasswordField() { -+ return password; -+ } -+ -+ public TextField setPasswordField(boolean password) { -+ if (this.password != password) { -+ setTextProcessor((password) ? new PasswordTextProcessor() : new GenericTextProcessor()); -+ } -+ this.password = password; -+ return this; -+ } -+ -+ @Override -+ public Widget setWidth(int width) { -+ textProcessor.setWidth(Math.max(0, width - (PADDING << 1))); -+ return super.setWidth(width); -+ } -+ -+ @Override -+ public Control setFocus(boolean focus) { -+ if (focus) { -+ Keyboard.setRepeatingEvents(true); -+ } -+ return super.setFocus(focus); -+ } -+ -+ @Override -+ public TextField copy() { -+ // ignore focus parameter which would lead to strange behaviour! -+ return ((TextField) super.copy()).setText(getText()).setCursorPosition(getCursorPosition()).setMaximumCharacters(getMaximumCharacters()).setFieldColor(getFieldColor()).setBorderColor(getBorderColor()).setMaximumLines(getMaximumLines()).setTabIndex(getTabIndex()).setPasswordField(isPasswordField()).setPlaceholder(getPlaceholder()); -+ } -+ -+ public void onTypingFinished() { -+ } -+ -+ public TextField setPlaceholder(String text) { -+ placeholder = text; -+ return this; -+ } -+ -+ public String getPlaceholder() { -+ return placeholder; -+ } -+ -+ @Override -+ public Widget setGeometry(Rectangle geometry) { -+ textProcessor.setWidth(geometry.getWidth()); -+ return super.setGeometry(geometry); -+ } -+ -+ @Override -+ public Widget setGeometry(int x, int y, int width, int height) { -+ textProcessor.setWidth(width); -+ return super.setGeometry(x, y, width, height); -+ } -+ -+ @Override -+ public void onTextFieldChange() { -+ } -+} ---- net/minecraft/src/CallableMPL1.java -+++ net/minecraft/src/CallableMPL1.java -@@ -3,12 +3,17 @@ - import java.util.concurrent.Callable; - - class CallableMPL1 implements Callable { -+ -+ /** Reference to the WorldClient object. */ - final WorldClient theWorldClient; - -- CallableMPL1(WorldClient var1) { -- this.theWorldClient = var1; -+ CallableMPL1(WorldClient par1WorldClient) { -+ this.theWorldClient = par1WorldClient; - } - -+ /** -+ * Returns the size and contents of the entity list. -+ */ - public String getEntityCountAndList() { - return WorldClient.getEntityList(this.theWorldClient).size() + " total; " + WorldClient.getEntityList(this.theWorldClient).toString(); - } ---- net/minecraft/src/ClippingHelperImpl.java -+++ net/minecraft/src/ClippingHelperImpl.java -@@ -1,37 +1,52 @@ - package net.minecraft.src; - - import java.nio.FloatBuffer; --import org.lwjgl.opengl.GL11; -+// Spout Start - Unused import -+//import org.lwjgl.opengl.GL11; -+// Spout End - - public class ClippingHelperImpl extends ClippingHelper { - private static ClippingHelperImpl instance = new ClippingHelperImpl(); -- private FloatBuffer f = GLAllocation.createDirectFloatBuffer(16); -- private FloatBuffer g = GLAllocation.createDirectFloatBuffer(16); -- private FloatBuffer h = GLAllocation.createDirectFloatBuffer(16); -+ private FloatBuffer projectionMatrixBuffer = GLAllocation.createDirectFloatBuffer(16); -+ private FloatBuffer modelviewMatrixBuffer = GLAllocation.createDirectFloatBuffer(16); -+ private FloatBuffer field_78564_h = GLAllocation.createDirectFloatBuffer(16); - -+ /** -+ * Initialises the ClippingHelper object then returns an instance of it. -+ */ - public static ClippingHelper getInstance() { - instance.init(); - return instance; - } - -- private void normalize(float[][] var1, int var2) { -- float var3 = MathHelper.sqrt_float(var1[var2][0] * var1[var2][0] + var1[var2][1] * var1[var2][1] + var1[var2][2] * var1[var2][2]); -- var1[var2][0] /= var3; -- var1[var2][1] /= var3; -- var1[var2][2] /= var3; -- var1[var2][3] /= var3; -+ /** -+ * Normalize the frustum. -+ */ -+ private void normalize(float[][] par1ArrayOfFloat, int par2) { -+ float var3 = MathHelper.sqrt_float(par1ArrayOfFloat[par2][0] * par1ArrayOfFloat[par2][0] + par1ArrayOfFloat[par2][1] * par1ArrayOfFloat[par2][1] + par1ArrayOfFloat[par2][2] * par1ArrayOfFloat[par2][2]); -+ par1ArrayOfFloat[par2][0] /= var3; -+ par1ArrayOfFloat[par2][1] /= var3; -+ par1ArrayOfFloat[par2][2] /= var3; -+ par1ArrayOfFloat[par2][3] /= var3; - } - - private void init() { -- this.f.clear(); -- this.g.clear(); -- this.h.clear(); -- GL11.glGetFloat(GL11.GL_PROJECTION_MATRIX, this.f); -- GL11.glGetFloat(GL11.GL_MODELVIEW_MATRIX, this.g); -- this.f.flip().limit(16); -- this.f.get(this.projectionMatrix); -- this.g.flip().limit(16); -- this.g.get(this.modelviewMatrix); -+ // Spout Start -+ /* -+ this.projectionMatrixBuffer.clear(); -+ this.modelviewMatrixBuffer.clear(); -+ this.field_78564_h.clear(); -+ GL11.glGetFloat(GL11.GL_PROJECTION_MATRIX, this.projectionMatrixBuffer); -+ GL11.glGetFloat(GL11.GL_MODELVIEW_MATRIX, this.modelviewMatrixBuffer); -+ */ -+ modelviewMatrixBuffer = ActiveRenderInfo.modelMatrix.duplicate(); -+ projectionMatrixBuffer = ActiveRenderInfo.projectionMatrix.duplicate(); -+ // Spout End -+ -+ this.projectionMatrixBuffer.flip().limit(16); -+ this.projectionMatrixBuffer.get(this.projectionMatrix); -+ this.modelviewMatrixBuffer.flip().limit(16); -+ this.modelviewMatrixBuffer.get(this.modelviewMatrix); - this.clippingMatrix[0] = this.modelviewMatrix[0] * this.projectionMatrix[0] + this.modelviewMatrix[1] * this.projectionMatrix[4] + this.modelviewMatrix[2] * this.projectionMatrix[8] + this.modelviewMatrix[3] * this.projectionMatrix[12]; - this.clippingMatrix[1] = this.modelviewMatrix[0] * this.projectionMatrix[1] + this.modelviewMatrix[1] * this.projectionMatrix[5] + this.modelviewMatrix[2] * this.projectionMatrix[9] + this.modelviewMatrix[3] * this.projectionMatrix[13]; - this.clippingMatrix[2] = this.modelviewMatrix[0] * this.projectionMatrix[2] + this.modelviewMatrix[1] * this.projectionMatrix[6] + this.modelviewMatrix[2] * this.projectionMatrix[10] + this.modelviewMatrix[3] * this.projectionMatrix[14]; ---- net/minecraft/src/ModelSheep2.java -+++ net/minecraft/src/ModelSheep2.java -@@ -13,14 +13,23 @@ - this.body.setRotationPoint(0.0F, 5.0F, 2.0F); - } - -- public void setLivingAnimations(EntityLivingBase var1, float var2, float var3, float var4) { -- super.setLivingAnimations(var1, var2, var3, var4); -- this.head.rotationPointY = 6.0F + ((EntitySheep)var1).func_70894_j(var4) * 9.0F; -- this.field_78153_i = ((EntitySheep)var1).func_70890_k(var4); -+ /** -+ * Used for easily adding entity-dependent animations. The second and third float params here are the same second and -+ * third as in the setRotationAngles method. -+ */ -+ public void setLivingAnimations(EntityLivingBase par1EntityLivingBase, float par2, float par3, float par4) { -+ super.setLivingAnimations(par1EntityLivingBase, par2, par3, par4); -+ this.head.rotationPointY = 6.0F + ((EntitySheep)par1EntityLivingBase).func_70894_j(par4) * 9.0F; -+ this.field_78153_i = ((EntitySheep)par1EntityLivingBase).func_70890_k(par4); - } - -- public void setRotationAngles(float var1, float var2, float var3, float var4, float var5, float var6, Entity var7) { -- super.setRotationAngles(var1, var2, var3, var4, var5, var6, var7); -+ /** -+ * Sets the model's various rotation angles. For bipeds, par1 and par2 are used for animating the movement of arms and -+ * legs, where par1 represents the time(so that arms and legs swing back and forth) and par2 represents how "far" arms -+ * and legs can swing at most. -+ */ -+ public void setRotationAngles(float par1, float par2, float par3, float par4, float par5, float par6, Entity par7Entity) { -+ super.setRotationAngles(par1, par2, par3, par4, par5, par6, par7Entity); - this.head.rotateAngleX = this.field_78153_i; - } - } ---- /dev/null -+++ org/spoutcraft/client/gui/settings/controls/SnooperButton.java -@@ -1,0 +1,41 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.client.gui.settings.controls; -+ -+import net.minecraft.src.GuiScreen; -+import net.minecraft.src.GuiSnooper; -+ -+import org.spoutcraft.api.gui.GenericButton; -+import org.spoutcraft.client.SpoutClient; -+ -+public class SnooperButton extends GenericButton { -+ GuiScreen parent; -+ -+ public SnooperButton(GuiScreen parent) { -+ super("Snooper Settings"); -+ this.parent = parent; -+ } -+ -+ @Override -+ public void onButtonClick() { -+ GuiSnooper snooperSettings = new GuiSnooper(parent, SpoutClient.getHandle().gameSettings); -+ SpoutClient.getHandle().displayGuiScreen(snooperSettings); -+ } -+} ---- net/minecraft/src/BlockCauldron.java -+++ net/minecraft/src/BlockCauldron.java -@@ -8,100 +8,131 @@ - private Icon cauldronTopIcon; - private Icon cauldronBottomIcon; - -- public BlockCauldron(int var1) { -- super(var1, Material.iron); -- } -- -- public Icon getIcon(int var1, int var2) { -- return var1 == 1 ? this.cauldronTopIcon : (var1 == 0 ? this.cauldronBottomIcon : this.blockIcon); -- } -- -- public void registerIcons(IconRegister var1) { -- this.field_94378_a = var1.registerIcon(this.getTextureName() + "_" + "inner"); -- this.cauldronTopIcon = var1.registerIcon(this.getTextureName() + "_top"); -- this.cauldronBottomIcon = var1.registerIcon(this.getTextureName() + "_" + "bottom"); -- this.blockIcon = var1.registerIcon(this.getTextureName() + "_side"); -- } -- -- public static Icon getCauldronIcon(String var0) { -- return var0.equals("inner") ? Block.cauldron.field_94378_a : (var0.equals("bottom") ? Block.cauldron.cauldronBottomIcon : null); -- } -- -- public void addCollisionBoxesToList(World var1, int var2, int var3, int var4, AxisAlignedBB var5, List var6, Entity var7) { -- this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 5.0F / 16.0F, 1.0F); -- super.addCollisionBoxesToList(var1, var2, var3, var4, var5, var6, var7); -- float var8 = 2.0F / 16.0F; -+ public BlockCauldron(int par1) { -+ super(par1, Material.iron); -+ } -+ -+ /** -+ * From the specified side and block metadata retrieves the blocks texture. Args: side, metadata -+ */ -+ public Icon getIcon(int par1, int par2) { -+ return par1 == 1 ? this.cauldronTopIcon : (par1 == 0 ? this.cauldronBottomIcon : this.blockIcon); -+ } -+ -+ /** -+ * When this method is called, your block should register all the icons it needs with the given IconRegister. This is -+ * the only chance you get to register icons. -+ */ -+ public void registerIcons(IconRegister par1IconRegister) { -+ this.field_94378_a = par1IconRegister.registerIcon(this.getTextureName() + "_" + "inner"); -+ this.cauldronTopIcon = par1IconRegister.registerIcon(this.getTextureName() + "_top"); -+ this.cauldronBottomIcon = par1IconRegister.registerIcon(this.getTextureName() + "_" + "bottom"); -+ this.blockIcon = par1IconRegister.registerIcon(this.getTextureName() + "_side"); -+ } -+ -+ public static Icon getCauldronIcon(String par0Str) { -+ return par0Str.equals("inner") ? Block.cauldron.field_94378_a : (par0Str.equals("bottom") ? Block.cauldron.cauldronBottomIcon : null); -+ } -+ -+ /** -+ * Adds all intersecting collision boxes to a list. (Be sure to only add boxes to the list if they intersect the mask.) -+ * Parameters: World, X, Y, Z, mask, list, colliding entity -+ */ -+ public void addCollisionBoxesToList(World par1World, int par2, int par3, int par4, AxisAlignedBB par5AxisAlignedBB, List par6List, Entity par7Entity) { -+ this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.3125F, 1.0F); -+ super.addCollisionBoxesToList(par1World, par2, par3, par4, par5AxisAlignedBB, par6List, par7Entity); -+ float var8 = 0.125F; - this.setBlockBounds(0.0F, 0.0F, 0.0F, var8, 1.0F, 1.0F); -- super.addCollisionBoxesToList(var1, var2, var3, var4, var5, var6, var7); -+ super.addCollisionBoxesToList(par1World, par2, par3, par4, par5AxisAlignedBB, par6List, par7Entity); - this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, var8); -- super.addCollisionBoxesToList(var1, var2, var3, var4, var5, var6, var7); -+ super.addCollisionBoxesToList(par1World, par2, par3, par4, par5AxisAlignedBB, par6List, par7Entity); - this.setBlockBounds(1.0F - var8, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F); -- super.addCollisionBoxesToList(var1, var2, var3, var4, var5, var6, var7); -+ super.addCollisionBoxesToList(par1World, par2, par3, par4, par5AxisAlignedBB, par6List, par7Entity); - this.setBlockBounds(0.0F, 0.0F, 1.0F - var8, 1.0F, 1.0F, 1.0F); -- super.addCollisionBoxesToList(var1, var2, var3, var4, var5, var6, var7); -+ super.addCollisionBoxesToList(par1World, par2, par3, par4, par5AxisAlignedBB, par6List, par7Entity); - this.setBlockBoundsForItemRender(); - } - -+ /** -+ * Sets the block's bounds for rendering it as an item -+ */ - public void setBlockBoundsForItemRender() { - this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F); - } - -+ /** -+ * Is this block (a) opaque and (b) a full 1m cube? This determines whether or not to render the shared face of two -+ * adjacent blocks and also whether the player can attach torches, redstone wire, etc to this block. -+ */ - public boolean isOpaqueCube() { - return false; - } - -+ /** -+ * The type of render function that is called for this block -+ */ - public int getRenderType() { - return 24; - } - -+ /** -+ * If this block doesn't render as an ordinary block it will return False (examples: signs, buttons, stairs, etc) -+ */ - public boolean renderAsNormalBlock() { - return false; - } - -- public boolean onBlockActivated(World var1, int var2, int var3, int var4, EntityPlayer var5, int var6, float var7, float var8, float var9) { -- if(var1.isRemote) { -+ /** -+ * Called upon block activation (right click on the block.) -+ */ -+ public boolean onBlockActivated(World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer, int par6, float par7, float par8, float par9) { -+ if (par1World.isRemote) { - return true; - } else { -- ItemStack var10 = var5.inventory.getCurrentItem(); -- if(var10 == null) { -+ ItemStack var10 = par5EntityPlayer.inventory.getCurrentItem(); -+ -+ if (var10 == null) { - return true; - } else { -- int var11 = var1.getBlockMetadata(var2, var3, var4); -+ int var11 = par1World.getBlockMetadata(par2, par3, par4); - int var12 = func_111045_h_(var11); -- if(var10.itemID == Item.bucketWater.itemID) { -- if(var12 < 3) { -- if(!var5.capabilities.isCreativeMode) { -- var5.inventory.setInventorySlotContents(var5.inventory.currentItem, new ItemStack(Item.bucketEmpty)); -+ -+ if (var10.itemID == Item.bucketWater.itemID) { -+ if (var12 < 3) { -+ if (!par5EntityPlayer.capabilities.isCreativeMode) { -+ par5EntityPlayer.inventory.setInventorySlotContents(par5EntityPlayer.inventory.currentItem, new ItemStack(Item.bucketEmpty)); - } - -- var1.setBlockMetadata(var2, var3, var4, 3, 2); -- var1.func_96440_m(var2, var3, var4, this.blockID); -+ par1World.setBlockMetadataWithNotify(par2, par3, par4, 3, 2); -+ par1World.func_96440_m(par2, par3, par4, this.blockID); - } - - return true; - } else { -- if(var10.itemID == Item.glassBottle.itemID) { -- if(var12 > 0) { -+ if (var10.itemID == Item.glassBottle.itemID) { -+ if (var12 > 0) { - ItemStack var13 = new ItemStack(Item.potion, 1, 0); -- if(!var5.inventory.addItemStackToInventory(var13)) { -- var1.spawnEntityInWorld(new EntityItem(var1, (double)var2 + 0.5D, (double)var3 + 1.5D, (double)var4 + 0.5D, var13)); -- } else if(var5 instanceof EntityPlayerMP) { -- ((EntityPlayerMP)var5).sendContainerToPlayer(var5.inventoryContainer); -+ -+ if (!par5EntityPlayer.inventory.addItemStackToInventory(var13)) { -+ par1World.spawnEntityInWorld(new EntityItem(par1World, (double)par2 + 0.5D, (double)par3 + 1.5D, (double)par4 + 0.5D, var13)); -+ } else if (par5EntityPlayer instanceof EntityPlayerMP) { -+ ((EntityPlayerMP)par5EntityPlayer).sendContainerToPlayer(par5EntityPlayer.inventoryContainer); - } - - --var10.stackSize; -- if(var10.stackSize <= 0) { -- var5.inventory.setInventorySlotContents(var5.inventory.currentItem, (ItemStack)null); -+ -+ if (var10.stackSize <= 0) { -+ par5EntityPlayer.inventory.setInventorySlotContents(par5EntityPlayer.inventory.currentItem, (ItemStack)null); - } - -- var1.setBlockMetadata(var2, var3, var4, var12 - 1, 2); -- var1.func_96440_m(var2, var3, var4, this.blockID); -+ par1World.setBlockMetadataWithNotify(par2, par3, par4, var12 - 1, 2); -+ par1World.func_96440_m(par2, par3, par4, this.blockID); - } -- } else if(var12 > 0 && var10.getItem() instanceof ItemArmor && ((ItemArmor)var10.getItem()).getArmorMaterial() == EnumArmorMaterial.CLOTH) { -+ } else if (var12 > 0 && var10.getItem() instanceof ItemArmor && ((ItemArmor)var10.getItem()).getArmorMaterial() == EnumArmorMaterial.CLOTH) { - ItemArmor var14 = (ItemArmor)var10.getItem(); - var14.removeColor(var10); -- var1.setBlockMetadata(var2, var3, var4, var12 - 1, 2); -- var1.func_96440_m(var2, var3, var4, this.blockID); -+ par1World.setBlockMetadataWithNotify(par2, par3, par4, var12 - 1, 2); -+ par1World.func_96440_m(par2, par3, par4, this.blockID); - return true; - } - -@@ -111,34 +142,51 @@ - } - } - -- public void fillWithRain(World var1, int var2, int var3, int var4) { -- if(var1.s.nextInt(20) == 1) { -- int var5 = var1.getBlockMetadata(var2, var3, var4); -- if(var5 < 3) { -- var1.setBlockMetadata(var2, var3, var4, var5 + 1, 2); -+ /** -+ * currently only used by BlockCauldron to incrament meta-data during rain -+ */ -+ public void fillWithRain(World par1World, int par2, int par3, int par4) { -+ if (par1World.rand.nextInt(20) == 1) { -+ int var5 = par1World.getBlockMetadata(par2, par3, par4); -+ -+ if (var5 < 3) { -+ par1World.setBlockMetadataWithNotify(par2, par3, par4, var5 + 1, 2); - } -- - } - } - -- public int idDropped(int var1, Random var2, int var3) { -- return Item.cauldron.itemID; -- } -- -- public int idPicked(World var1, int var2, int var3, int var4) { -- return Item.cauldron.itemID; -- } -- -+ /** -+ * Returns the ID of the items to drop on destruction. -+ */ -+ public int idDropped(int par1, Random par2Random, int par3) { -+ return Item.cauldron.itemID; -+ } -+ -+ /** -+ * only called by clickMiddleMouseButton , and passed to inventory.setCurrentItem (along with isCreative) -+ */ -+ public int idPicked(World par1World, int par2, int par3, int par4) { -+ return Item.cauldron.itemID; -+ } -+ -+ /** -+ * If this returns true, then comparators facing away from this block will use the value from -+ * getComparatorInputOverride instead of the actual redstone signal strength. -+ */ - public boolean hasComparatorInputOverride() { - return true; - } - -- public int getComparatorInputOverride(World var1, int var2, int var3, int var4, int var5) { -- int var6 = var1.getBlockMetadata(var2, var3, var4); -+ /** -+ * If hasComparatorInputOverride returns true, the return value from this is used instead of the redstone signal -+ * strength when this block inputs to a comparator. -+ */ -+ public int getComparatorInputOverride(World par1World, int par2, int par3, int par4, int par5) { -+ int var6 = par1World.getBlockMetadata(par2, par3, par4); - return func_111045_h_(var6); - } - -- public static int func_111045_h_(int var0) { -- return var0; -+ public static int func_111045_h_(int par0) { -+ return par0; - } - } ---- net/minecraft/src/ChunkProviderFlat.java -+++ net/minecraft/src/ChunkProviderFlat.java -@@ -8,84 +8,95 @@ - - public class ChunkProviderFlat implements IChunkProvider { - private World worldObj; -- private Random b; -+ private Random random; - private final byte[] cachedBlockIDs = new byte[256]; - private final byte[] cachedBlockMetadata = new byte[256]; - private final FlatGeneratorInfo flatWorldGenInfo; -- private final List f = new ArrayList(); -+ private final List structureGenerators = new ArrayList(); - private final boolean hasDecoration; - private final boolean hasDungeons; - private WorldGenLakes waterLakeGenerator; - private WorldGenLakes lavaLakeGenerator; - -- public ChunkProviderFlat(World var1, long var2, boolean var4, String var5) { -- this.worldObj = var1; -- this.b = new Random(var2); -- this.flatWorldGenInfo = FlatGeneratorInfo.createFlatGeneratorFromString(var5); -- if(var4) { -+ public ChunkProviderFlat(World par1World, long par2, boolean par4, String par5Str) { -+ this.worldObj = par1World; -+ this.random = new Random(par2); -+ this.flatWorldGenInfo = FlatGeneratorInfo.createFlatGeneratorFromString(par5Str); -+ -+ if (par4) { - Map var6 = this.flatWorldGenInfo.getWorldFeatures(); -- if(var6.containsKey("village")) { -+ -+ if (var6.containsKey("village")) { - Map var7 = (Map)var6.get("village"); -- if(!var7.containsKey("size")) { -+ -+ if (!var7.containsKey("size")) { - var7.put("size", "1"); - } - -- this.f.add(new MapGenVillage(var7)); -- } -- -- if(var6.containsKey("biome_1")) { -- this.f.add(new MapGenScatteredFeature((Map)var6.get("biome_1"))); -- } -- -- if(var6.containsKey("mineshaft")) { -- this.f.add(new MapGenMineshaft((Map)var6.get("mineshaft"))); -- } -- -- if(var6.containsKey("stronghold")) { -- this.f.add(new MapGenStronghold((Map)var6.get("stronghold"))); -+ this.structureGenerators.add(new MapGenVillage(var7)); -+ } -+ -+ if (var6.containsKey("biome_1")) { -+ this.structureGenerators.add(new MapGenScatteredFeature((Map)var6.get("biome_1"))); -+ } -+ -+ if (var6.containsKey("mineshaft")) { -+ this.structureGenerators.add(new MapGenMineshaft((Map)var6.get("mineshaft"))); -+ } -+ -+ if (var6.containsKey("stronghold")) { -+ this.structureGenerators.add(new MapGenStronghold((Map)var6.get("stronghold"))); - } - } - - this.hasDecoration = this.flatWorldGenInfo.getWorldFeatures().containsKey("decoration"); -- if(this.flatWorldGenInfo.getWorldFeatures().containsKey("lake")) { -+ -+ if (this.flatWorldGenInfo.getWorldFeatures().containsKey("lake")) { - this.waterLakeGenerator = new WorldGenLakes(Block.waterStill.blockID); - } - -- if(this.flatWorldGenInfo.getWorldFeatures().containsKey("lava_lake")) { -+ if (this.flatWorldGenInfo.getWorldFeatures().containsKey("lava_lake")) { - this.lavaLakeGenerator = new WorldGenLakes(Block.lavaStill.blockID); - } - - this.hasDungeons = this.flatWorldGenInfo.getWorldFeatures().containsKey("dungeon"); - Iterator var9 = this.flatWorldGenInfo.getFlatLayers().iterator(); - -- while(var9.hasNext()) { -+ while (var9.hasNext()) { - FlatLayerInfo var10 = (FlatLayerInfo)var9.next(); - -- for(int var8 = var10.getMinY(); var8 < var10.getMinY() + var10.getLayerCount(); ++var8) { -+ for (int var8 = var10.getMinY(); var8 < var10.getMinY() + var10.getLayerCount(); ++var8) { - this.cachedBlockIDs[var8] = (byte)(var10.getFillBlock() & 255); - this.cachedBlockMetadata[var8] = (byte)var10.getFillBlockMeta(); - } - } -- -- } -- -- public Chunk loadChunk(int var1, int var2) { -- return this.provideChunk(var1, var2); -- } -- -- public Chunk provideChunk(int var1, int var2) { -- Chunk var3 = new Chunk(this.worldObj, var1, var2); -- -- for(int var4 = 0; var4 < this.cachedBlockIDs.length; ++var4) { -+ } -+ -+ /** -+ * loads or generates the chunk at the chunk location specified -+ */ -+ public Chunk loadChunk(int par1, int par2) { -+ return this.provideChunk(par1, par2); -+ } -+ -+ /** -+ * Will return back a chunk, if it doesn't exist and its not a MP client it will generates all the blocks for the -+ * specified chunk from the map seed and chunk seed -+ */ -+ public Chunk provideChunk(int par1, int par2) { -+ Chunk var3 = new Chunk(this.worldObj, par1, par2); -+ -+ for (int var4 = 0; var4 < this.cachedBlockIDs.length; ++var4) { - int var5 = var4 >> 4; - ExtendedBlockStorage var6 = var3.getBlockStorageArray()[var5]; -- if(var6 == null) { -+ -+ if (var6 == null) { - var6 = new ExtendedBlockStorage(var4, !this.worldObj.provider.hasNoSky); - var3.getBlockStorageArray()[var5] = var6; - } - -- for(int var7 = 0; var7 < 16; ++var7) { -- for(int var8 = 0; var8 < 16; ++var8) { -+ for (int var7 = 0; var7 < 16; ++var7) { -+ for (int var8 = 0; var8 < 16; ++var8) { - var6.setExtBlockID(var7, var4 & 15, var8, this.cachedBlockIDs[var4] & 255); - var6.setExtBlockMetadata(var7, var4 & 15, var8, this.cachedBlockMetadata[var4]); - } -@@ -93,43 +104,50 @@ - } - - var3.generateSkylightMap(); -- BiomeGenBase[] var9 = this.worldObj.getWorldChunkManager().loadBlockGeneratorData((BiomeGenBase[])null, var1 * 16, var2 * 16, 16, 16); -+ BiomeGenBase[] var9 = this.worldObj.getWorldChunkManager().loadBlockGeneratorData((BiomeGenBase[])null, par1 * 16, par2 * 16, 16, 16); - byte[] var10 = var3.getBiomeArray(); - -- for(int var11 = 0; var11 < var10.length; ++var11) { -+ for (int var11 = 0; var11 < var10.length; ++var11) { - var10[var11] = (byte)var9[var11].biomeID; - } - -- Iterator var12 = this.f.iterator(); -+ Iterator var12 = this.structureGenerators.iterator(); - -- while(var12.hasNext()) { -+ while (var12.hasNext()) { - MapGenStructure var13 = (MapGenStructure)var12.next(); -- var13.generate(this, this.worldObj, var1, var2, (byte[])null); -+ var13.generate(this, this.worldObj, par1, par2, (byte[])null); - } - - var3.generateSkylightMap(); - return var3; - } - -- public boolean chunkExists(int var1, int var2) { -+ /** -+ * Checks to see if a chunk exists at x, y -+ */ -+ public boolean chunkExists(int par1, int par2) { - return true; - } - -- public void populate(IChunkProvider var1, int var2, int var3) { -- int var4 = var2 * 16; -- int var5 = var3 * 16; -+ /** -+ * Populates chunk with ores etc etc -+ */ -+ public void populate(IChunkProvider par1IChunkProvider, int par2, int par3) { -+ int var4 = par2 * 16; -+ int var5 = par3 * 16; - BiomeGenBase var6 = this.worldObj.getBiomeGenForCoords(var4 + 16, var5 + 16); - boolean var7 = false; -- this.b.setSeed(this.worldObj.getSeed()); -- long var8 = this.b.nextLong() / 2L * 2L + 1L; -- long var10 = this.b.nextLong() / 2L * 2L + 1L; -- this.b.setSeed((long)var2 * var8 + (long)var3 * var10 ^ this.worldObj.getSeed()); -- Iterator var12 = this.f.iterator(); -+ this.random.setSeed(this.worldObj.getSeed()); -+ long var8 = this.random.nextLong() / 2L * 2L + 1L; -+ long var10 = this.random.nextLong() / 2L * 2L + 1L; -+ this.random.setSeed((long)par2 * var8 + (long)par3 * var10 ^ this.worldObj.getSeed()); -+ Iterator var12 = this.structureGenerators.iterator(); - -- while(var12.hasNext()) { -+ while (var12.hasNext()) { - MapGenStructure var13 = (MapGenStructure)var12.next(); -- boolean var14 = var13.generateStructuresInChunk(this.worldObj, this.b, var2, var3); -- if(var13 instanceof MapGenVillage) { -+ boolean var14 = var13.generateStructuresInChunk(this.worldObj, this.random, par2, par3); -+ -+ if (var13 instanceof MapGenVillage) { - var7 |= var14; - } - } -@@ -137,69 +155,93 @@ - int var16; - int var17; - int var18; -- if(this.waterLakeGenerator != null && !var7 && this.b.nextInt(4) == 0) { -- var16 = var4 + this.b.nextInt(16) + 8; -- var17 = this.b.nextInt(128); -- var18 = var5 + this.b.nextInt(16) + 8; -- this.waterLakeGenerator.generate(this.worldObj, this.b, var16, var17, var18); -- } -- -- if(this.lavaLakeGenerator != null && !var7 && this.b.nextInt(8) == 0) { -- var16 = var4 + this.b.nextInt(16) + 8; -- var17 = this.b.nextInt(this.b.nextInt(120) + 8); -- var18 = var5 + this.b.nextInt(16) + 8; -- if(var17 < 63 || this.b.nextInt(10) == 0) { -- this.lavaLakeGenerator.generate(this.worldObj, this.b, var16, var17, var18); -- } -- } -- -- if(this.hasDungeons) { -- for(var16 = 0; var16 < 8; ++var16) { -- var17 = var4 + this.b.nextInt(16) + 8; -- var18 = this.b.nextInt(128); -- int var15 = var5 + this.b.nextInt(16) + 8; -- (new WorldGenDungeons()).generate(this.worldObj, this.b, var17, var18, var15); -- } -- } -- -- if(this.hasDecoration) { -- var6.decorate(this.worldObj, this.b, var4, var5); -- } -- -+ -+ if (this.waterLakeGenerator != null && !var7 && this.random.nextInt(4) == 0) { -+ var16 = var4 + this.random.nextInt(16) + 8; -+ var17 = this.random.nextInt(128); -+ var18 = var5 + this.random.nextInt(16) + 8; -+ this.waterLakeGenerator.generate(this.worldObj, this.random, var16, var17, var18); -+ } -+ -+ if (this.lavaLakeGenerator != null && !var7 && this.random.nextInt(8) == 0) { -+ var16 = var4 + this.random.nextInt(16) + 8; -+ var17 = this.random.nextInt(this.random.nextInt(120) + 8); -+ var18 = var5 + this.random.nextInt(16) + 8; -+ -+ if (var17 < 63 || this.random.nextInt(10) == 0) { -+ this.lavaLakeGenerator.generate(this.worldObj, this.random, var16, var17, var18); -+ } -+ } -+ -+ if (this.hasDungeons) { -+ for (var16 = 0; var16 < 8; ++var16) { -+ var17 = var4 + this.random.nextInt(16) + 8; -+ var18 = this.random.nextInt(128); -+ int var15 = var5 + this.random.nextInt(16) + 8; -+ (new WorldGenDungeons()).generate(this.worldObj, this.random, var17, var18, var15); -+ } -+ } -+ -+ if (this.hasDecoration) { -+ var6.decorate(this.worldObj, this.random, var4, var5); -+ } - } - -- public boolean saveChunks(boolean var1, IProgressUpdate var2) { -+ /** -+ * Two modes of operation: if passed true, save all Chunks in one go. If passed false, save up to two chunks. Return -+ * true if all chunks have been saved. -+ */ -+ public boolean saveChunks(boolean par1, IProgressUpdate par2IProgressUpdate) { - return true; - } - -- public void saveExtraData() { -- } -+ /** -+ * Save extra data not associated with any Chunk. Not saved during autosave, only during world unload. Currently -+ * unimplemented. -+ */ -+ public void saveExtraData() {} - -+ /** -+ * Unloads chunks that are marked to be unloaded. This is not guaranteed to unload every such chunk. -+ */ - public boolean unloadQueuedChunks() { - return false; - } - -+ /** -+ * Returns if the IChunkProvider supports saving. -+ */ - public boolean canSave() { - return true; - } - -+ /** -+ * Converts the instance data to a readable string. -+ */ - public String makeString() { - return "FlatLevelSource"; - } - -- public List getPossibleCreatures(EnumCreatureType var1, int var2, int var3, int var4) { -- BiomeGenBase var5 = this.worldObj.getBiomeGenForCoords(var2, var4); -- return var5 == null ? null : var5.getSpawnableList(var1); -+ /** -+ * Returns a list of creatures of the specified type that can spawn at the given location. -+ */ -+ public List getPossibleCreatures(EnumCreatureType par1EnumCreatureType, int par2, int par3, int par4) { -+ BiomeGenBase var5 = this.worldObj.getBiomeGenForCoords(par2, par4); -+ return var5 == null ? null : var5.getSpawnableList(par1EnumCreatureType); - } - -- public ChunkPosition findClosestStructure(World var1, String var2, int var3, int var4, int var5) { -- if("Stronghold".equals(var2)) { -- Iterator var6 = this.f.iterator(); -+ /** -+ * Returns the location of the closest structure of the specified type. If not found returns null. -+ */ -+ public ChunkPosition findClosestStructure(World par1World, String par2Str, int par3, int par4, int par5) { -+ if ("Stronghold".equals(par2Str)) { -+ Iterator var6 = this.structureGenerators.iterator(); - -- while(var6.hasNext()) { -+ while (var6.hasNext()) { - MapGenStructure var7 = (MapGenStructure)var6.next(); -- if(var7 instanceof MapGenStronghold) { -- return var7.getNearestInstance(var1, var3, var4, var5); -+ -+ if (var7 instanceof MapGenStronghold) { -+ return var7.getNearestInstance(par1World, par3, par4, par5); - } - } - } -@@ -211,13 +253,12 @@ - return 0; - } - -- public void recreateStructures(int var1, int var2) { -- Iterator var3 = this.f.iterator(); -+ public void recreateStructures(int par1, int par2) { -+ Iterator var3 = this.structureGenerators.iterator(); - -- while(var3.hasNext()) { -+ while (var3.hasNext()) { - MapGenStructure var4 = (MapGenStructure)var3.next(); -- var4.generate(this, this.worldObj, var1, var2, (byte[])null); -+ var4.generate(this, this.worldObj, par1, par2, (byte[])null); - } -- - } - } ---- net/minecraft/src/TextureManager.java -+++ net/minecraft/src/TextureManager.java -@@ -2,112 +2,152 @@ - - import com.google.common.collect.Lists; - import com.google.common.collect.Maps; -+import com.prupe.mcpatcher.hd.CustomAnimation; - import java.io.IOException; - import java.util.Iterator; - import java.util.List; - import java.util.Map; - import java.util.Map.Entry; -+import org.lwjgl.opengl.GL11; -+import org.lwjgl.opengl.GL12; - - public class TextureManager implements Tickable, ResourceManagerReloadListener { -- private final Map a = Maps.newHashMap(); -- private final Map b = Maps.newHashMap(); -- private final List c = Lists.newArrayList(); -- private final Map d = Maps.newHashMap(); -+ public final Map mapTextureObjects = Maps.newHashMap(); -+ private final Map mapResourceLocations = Maps.newHashMap(); -+ private final List listTickables = Lists.newArrayList(); -+ private final Map mapTextureCounters = Maps.newHashMap(); - private ResourceManager theResourceManager; -+ // Spout Start -+ public int boundTexture; -+ // Spout End - -- public TextureManager(ResourceManager var1) { -- this.theResourceManager = var1; -+ public TextureManager(ResourceManager par1ResourceManager) { -+ this.theResourceManager = par1ResourceManager; - } - -- public void bindTexture(ResourceLocation var1) { -- Object var2 = (TextureObject)this.a.get(var1); -- if(var2 == null) { -- var2 = new SimpleTexture(var1); -- this.loadTexture(var1, (TextureObject)var2); -+ public void bindTexture(ResourceLocation par1ResourceLocation) { -+ Object var2 = (TextureObject)this.mapTextureObjects.get(par1ResourceLocation); -+ -+ if (var2 == null) { -+ var2 = new SimpleTexture(par1ResourceLocation); -+ this.loadTexture(par1ResourceLocation, (TextureObject)var2); - } - - TextureUtil.bindTexture(((TextureObject)var2).getGlTextureId()); - } - -- public ResourceLocation getResourceLocation(int var1) { -- return (ResourceLocation)this.b.get(Integer.valueOf(var1)); -- } -- -- public boolean loadTextureMap(ResourceLocation var1, TextureMap var2) { -- if(this.loadTickableTexture(var1, var2)) { -- this.b.put(Integer.valueOf(var2.getTextureType()), var1); -- return true; -- } else { -- return false; -- } -- } -- -- public boolean loadTickableTexture(ResourceLocation var1, TickableTextureObject var2) { -- if(this.loadTexture(var1, var2)) { -- this.c.add(var2); -- return true; -- } else { -- return false; -- } -- } -- -- public boolean loadTexture(ResourceLocation var1, TextureObject var2) { -+ public ResourceLocation getResourceLocation(int par1) { -+ return (ResourceLocation)this.mapResourceLocations.get(Integer.valueOf(par1)); -+ } -+ -+ public boolean loadTextureMap(ResourceLocation par1ResourceLocation, TextureMap par2TextureMap) { -+ if (this.loadTickableTexture(par1ResourceLocation, par2TextureMap)) { -+ this.mapResourceLocations.put(Integer.valueOf(par2TextureMap.getTextureType()), par1ResourceLocation); -+ return true; -+ } else { -+ return false; -+ } -+ } -+ -+ public boolean loadTickableTexture(ResourceLocation par1ResourceLocation, TickableTextureObject par2TickableTextureObject) { -+ if (this.loadTexture(par1ResourceLocation, par2TickableTextureObject)) { -+ this.listTickables.add(par2TickableTextureObject); -+ return true; -+ } else { -+ return false; -+ } -+ } -+ -+ public boolean loadTexture(ResourceLocation par1ResourceLocation, TextureObject par2TextureObject) { - boolean var3 = true; - - try { -- ((TextureObject)var2).loadTexture(this.theResourceManager); -+ ((TextureObject)par2TextureObject).loadTexture(this.theResourceManager); - } catch (IOException var8) { -- Minecraft.getMinecraft().getLogAgent().logWarningException("Failed to load texture: " + var1, var8); -- var2 = TextureUtil.missingTexture; -- this.a.put(var1, var2); -+ Minecraft.getMinecraft().getLogAgent().logWarningException("Failed to load texture: " + par1ResourceLocation, var8); -+ par2TextureObject = TextureUtil.missingTexture; -+ this.mapTextureObjects.put(par1ResourceLocation, par2TextureObject); - var3 = false; - } catch (Throwable var9) { - CrashReport var5 = CrashReport.makeCrashReport(var9, "Registering texture"); - CrashReportCategory var6 = var5.makeCategory("Resource location being registered"); -- var6.addCrashSection("Resource location", var1); -- var6.addCrashSectionCallable("Texture object class", new TextureManagerINNER1(this, (TextureObject)var2)); -+ var6.addCrashSection("Resource location", par1ResourceLocation); -+ var6.addCrashSectionCallable("Texture object class", new TextureManagerINNER1(this, (TextureObject)par2TextureObject)); - throw new ReportedException(var5); - } - -- this.a.put(var1, var2); -+ this.mapTextureObjects.put(par1ResourceLocation, par2TextureObject); - return var3; - } - -- public TextureObject getTexture(ResourceLocation var1) { -- return (TextureObject)this.a.get(var1); -+ public TextureObject getTexture(ResourceLocation par1ResourceLocation) { -+ return (TextureObject)this.mapTextureObjects.get(par1ResourceLocation); - } - -- public ResourceLocation getDynamicTextureLocation(String var1, DynamicTexture var2) { -- Integer var3 = (Integer)this.d.get(var1); -- if(var3 == null) { -+ public ResourceLocation getDynamicTextureLocation(String par1Str, DynamicTexture par2DynamicTexture) { -+ Integer var3 = (Integer)this.mapTextureCounters.get(par1Str); -+ -+ if (var3 == null) { - var3 = Integer.valueOf(1); - } else { - var3 = Integer.valueOf(var3.intValue() + 1); - } - -- this.d.put(var1, var3); -- ResourceLocation var4 = new ResourceLocation(String.format("dynamic/%s_%d", new Object[]{var1, var3})); -- this.loadTexture(var4, var2); -+ this.mapTextureCounters.put(par1Str, var3); -+ ResourceLocation var4 = new ResourceLocation(String.format("dynamic/%s_%d", new Object[] {par1Str, var3})); -+ this.loadTexture(var4, par2DynamicTexture); - return var4; - } - - public void tick() { -- Iterator var1 = this.c.iterator(); -+ Iterator var1 = this.listTickables.iterator(); - -- while(var1.hasNext()) { -+ while (var1.hasNext()) { - Tickable var2 = (Tickable)var1.next(); - var2.tick(); - } - -+ CustomAnimation.updateAll(); - } - -- public void onResourceManagerReload(ResourceManager var1) { -- Iterator var2 = this.a.entrySet().iterator(); -+ public void onResourceManagerReload(ResourceManager par1ResourceManager) { -+ Iterator var2 = this.mapTextureObjects.entrySet().iterator(); - -- while(var2.hasNext()) { -+ while (var2.hasNext()) { - Entry var3 = (Entry)var2.next(); - this.loadTexture((ResourceLocation)var3.getKey(), (TextureObject)var3.getValue()); - } -- -+ } -+ -+ // Spout Start -+ public void bindTexture(int texture) { -+ if (texture != this.boundTexture) { -+ GL11.glBindTexture(GL11.GL_TEXTURE_2D, texture); -+ this.boundTexture = texture; -+ } -+ } -+ -+ /** -+ * Deletes a single GL texture -+ */ -+ public void deleteTexture(int par1) { -+ this.mapTextureObjects.remove(par1); -+ GL11.glDeleteTextures(par1); -+ } -+ -+ public void resetBoundTexture() { -+ this.boundTexture = -1; -+ } -+ // Spout End -+ -+ public int getTextureId(ResourceLocation par1ResourceLocation) { -+ Object var2 = (TextureObject)this.mapTextureObjects.get(par1ResourceLocation); -+ -+ if (var2 == null) { -+ var2 = new SimpleTexture(par1ResourceLocation); -+ this.loadTexture(par1ResourceLocation, (TextureObject)var2); -+ } -+ -+ return ((TextureObject)var2).getGlTextureId(); - } - } ---- net/minecraft/src/GLAllocation.java -+++ net/minecraft/src/GLAllocation.java -@@ -13,48 +13,63 @@ - import org.lwjgl.opengl.GL11; - - public class GLAllocation { -- private static final Map a = new HashMap(); -- private static final List b = new ArrayList(); -+ private static final Map field_74531_a = new HashMap(); -+ private static final List field_74530_b = new ArrayList(); - -- public static synchronized int generateDisplayLists(int var0) { -- int var1 = GL11.glGenLists(var0); -- a.put(Integer.valueOf(var1), Integer.valueOf(var0)); -+ /** -+ * Generates the specified number of display lists and returns the first index. -+ */ -+ public static synchronized int generateDisplayLists(int par0) { -+ int var1 = GL11.glGenLists(par0); -+ field_74531_a.put(Integer.valueOf(var1), Integer.valueOf(par0)); - return var1; - } - -- public static synchronized void deleteDisplayLists(int var0) { -- GL11.glDeleteLists(var0, ((Integer)a.remove(Integer.valueOf(var0))).intValue()); -+ public static synchronized void deleteDisplayLists(int par0) { -+ GL11.glDeleteLists(par0, ((Integer)field_74531_a.remove(Integer.valueOf(par0))).intValue()); - } - - public static synchronized void func_98302_b() { -- for(int var0 = 0; var0 < b.size(); ++var0) { -- GL11.glDeleteTextures(((Integer)b.get(var0)).intValue()); -+ for (int var0 = 0; var0 < field_74530_b.size(); ++var0) { -+ GL11.glDeleteTextures(((Integer)field_74530_b.get(var0)).intValue()); - } - -- b.clear(); -+ field_74530_b.clear(); - } - -+ /** -+ * Deletes all textures and display lists. Called when Minecraft is shutdown to free up resources. -+ */ - public static synchronized void deleteTexturesAndDisplayLists() { -- Iterator var0 = a.entrySet().iterator(); -+ Iterator var0 = field_74531_a.entrySet().iterator(); - -- while(var0.hasNext()) { -+ while (var0.hasNext()) { - Entry var1 = (Entry)var0.next(); - GL11.glDeleteLists(((Integer)var1.getKey()).intValue(), ((Integer)var1.getValue()).intValue()); - } - -- a.clear(); -+ field_74531_a.clear(); - func_98302_b(); - } - -- public static synchronized ByteBuffer createDirectByteBuffer(int var0) { -- return ByteBuffer.allocateDirect(var0).order(ByteOrder.nativeOrder()); -- } -- -- public static IntBuffer createDirectIntBuffer(int var0) { -- return createDirectByteBuffer(var0 << 2).asIntBuffer(); -- } -- -- public static FloatBuffer createDirectFloatBuffer(int var0) { -- return createDirectByteBuffer(var0 << 2).asFloatBuffer(); -+ /** -+ * Creates and returns a direct byte buffer with the specified capacity. Applies native ordering to speed up access. -+ */ -+ public static synchronized ByteBuffer createDirectByteBuffer(int par0) { -+ return ByteBuffer.allocateDirect(par0).order(ByteOrder.nativeOrder()); -+ } -+ -+ /** -+ * Creates and returns a direct int buffer with the specified capacity. Applies native ordering to speed up access. -+ */ -+ public static IntBuffer createDirectIntBuffer(int par0) { -+ return createDirectByteBuffer(par0 << 2).asIntBuffer(); -+ } -+ -+ /** -+ * Creates and returns a direct float buffer with the specified capacity. Applies native ordering to speed up access. -+ */ -+ public static FloatBuffer createDirectFloatBuffer(int par0) { -+ return createDirectByteBuffer(par0 << 2).asFloatBuffer(); - } - } ---- net/minecraft/src/DispenserBehaviorFilledBucket.java -+++ net/minecraft/src/DispenserBehaviorFilledBucket.java -@@ -3,18 +3,22 @@ - final class DispenserBehaviorFilledBucket extends BehaviorDefaultDispenseItem { - private final BehaviorDefaultDispenseItem defaultDispenserItemBehavior = new BehaviorDefaultDispenseItem(); - -- public ItemStack dispenseStack(IBlockSource var1, ItemStack var2) { -- ItemBucket var3 = (ItemBucket)var2.getItem(); -- int var4 = var1.getXInt(); -- int var5 = var1.getYInt(); -- int var6 = var1.getZInt(); -- EnumFacing var7 = BlockDispenser.getFacing(var1.getBlockMetadata()); -- if(var3.tryPlaceContainedLiquid(var1.getWorld(), var4 + var7.getFrontOffsetX(), var5 + var7.getFrontOffsetY(), var6 + var7.getFrontOffsetZ())) { -- var2.itemID = Item.bucketEmpty.itemID; -- var2.stackSize = 1; -- return var2; -+ /** -+ * Dispense the specified stack, play the dispense sound and spawn particles. -+ */ -+ public ItemStack dispenseStack(IBlockSource par1IBlockSource, ItemStack par2ItemStack) { -+ ItemBucket var3 = (ItemBucket)par2ItemStack.getItem(); -+ int var4 = par1IBlockSource.getXInt(); -+ int var5 = par1IBlockSource.getYInt(); -+ int var6 = par1IBlockSource.getZInt(); -+ EnumFacing var7 = BlockDispenser.getFacing(par1IBlockSource.getBlockMetadata()); -+ -+ if (var3.tryPlaceContainedLiquid(par1IBlockSource.getWorld(), var4 + var7.getFrontOffsetX(), var5 + var7.getFrontOffsetY(), var6 + var7.getFrontOffsetZ())) { -+ par2ItemStack.itemID = Item.bucketEmpty.itemID; -+ par2ItemStack.stackSize = 1; -+ return par2ItemStack; - } else { -- return this.defaultDispenserItemBehavior.dispense(var1, var2); -+ return this.defaultDispenserItemBehavior.dispense(par1IBlockSource, par2ItemStack); - } - } - } ---- net/minecraft/src/CommandNotFoundException.java -+++ net/minecraft/src/CommandNotFoundException.java -@@ -5,7 +5,7 @@ - this("commands.generic.notFound", new Object[0]); - } - -- public CommandNotFoundException(String var1, Object... var2) { -- super(var1, var2); -+ public CommandNotFoundException(String par1Str, Object ... par2ArrayOfObj) { -+ super(par1Str, par2ArrayOfObj); - } - } ---- net/minecraft/src/RequestGet.java -+++ net/minecraft/src/RequestGet.java -@@ -1,19 +1,19 @@ - package net.minecraft.src; - - public class RequestGet extends Request { -- public RequestGet(String var1, int var2, int var3) { -- super(var1, var2, var3); -+ public RequestGet(String par1Str, int par2, int par3) { -+ super(par1Str, par2, par3); - } - - public RequestGet func_96371_f() { - try { -- this.a.setDoInput(true); -- this.a.setDoOutput(true); -- this.a.setUseCaches(false); -- this.a.setRequestMethod("GET"); -+ this.field_96367_a.setDoInput(true); -+ this.field_96367_a.setDoOutput(true); -+ this.field_96367_a.setUseCaches(false); -+ this.field_96367_a.setRequestMethod("GET"); - return this; - } catch (Exception var2) { -- throw new ExceptionMcoHttp("Failed URL: " + this.b, var2); -+ throw new ExceptionMcoHttp("Failed URL: " + this.field_96365_b, var2); - } - } - ---- /dev/null -+++ org/spoutcraft/client/gui/settings/controls/ControlsButton.java -@@ -1,0 +1,40 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.client.gui.settings.controls; -+ -+import net.minecraft.src.Minecraft; -+import net.minecraft.src.GuiScreen; -+ -+import org.spoutcraft.api.gui.GenericButton; -+import org.spoutcraft.client.gui.controls.GuiControls; -+ -+public class ControlsButton extends GenericButton { -+ GuiScreen parent; -+ public ControlsButton(GuiScreen parent) { -+ super("Controls"); -+ setTooltip("Controls\nAdd, modify, or remove keybindings"); -+ this.parent = parent; -+ } -+ -+ @Override -+ public void onButtonClick() { -+ Minecraft.getMinecraft().displayGuiScreen(new GuiControls(parent), false); -+ } -+} ---- net/minecraft/src/IServer.java -+++ net/minecraft/src/IServer.java -@@ -1,43 +1,98 @@ - package net.minecraft.src; - - public interface IServer { -+ -+ /** -+ * Gets an integer property. If it does not exist, set it to the specified value. -+ */ - int getIntProperty(String var1, int var2); - -+ /** -+ * Gets a string property. If it does not exist, set it to the specified value. -+ */ - String getStringProperty(String var1, String var2); - -+ /** -+ * Saves an Object with the given property name. -+ */ - void setProperty(String var1, Object var2); - -+ /** -+ * Saves all of the server properties to the properties file. -+ */ - void saveProperties(); - -+ /** -+ * Returns the filename where server properties are stored -+ */ - String getSettingsFilename(); - -+ /** -+ * Returns the server's hostname. -+ */ - String getHostname(); - -+ /** -+ * Never used, but "getServerPort" is already taken. -+ */ - int getPort(); - -- String getMotd(); -+ /** -+ * Returns the server message of the day -+ */ -+ String getServerMOTD(); - -+ /** -+ * Returns the server's Minecraft version as string. -+ */ - String getMinecraftVersion(); - -+ /** -+ * Returns the number of players currently on the server. -+ */ - int getCurrentPlayerCount(); - -+ /** -+ * Returns the maximum number of players allowed on the server. -+ */ - int getMaxPlayers(); - -+ /** -+ * Returns an array of the usernames of all the connected players. -+ */ - String[] getAllUsernames(); - - String getFolderName(); - -+ /** -+ * Used by RCon's Query in the form of "MajorServerMod 1.2.3: MyPlugin 1.3; AnotherPlugin 2.1; AndSoForth 1.0". -+ */ - String getPlugins(); - -- String handleRConCommand(String var1); -+ String executeCommand(String var1); - -+ /** -+ * Returns true if debugging is enabled, false otherwise. -+ */ - boolean isDebuggingEnabled(); - -+ /** -+ * Logs the message with a level of INFO. -+ */ - void logInfo(String var1); - -+ /** -+ * Logs the message with a level of WARN. -+ */ - void logWarning(String var1); - -+ /** -+ * Logs the error message with a level of SEVERE. -+ */ - void logSevere(String var1); - -+ /** -+ * If isDebuggingEnabled(), logs the message with a level of INFO. -+ */ - void logDebug(String var1); - } ---- net/minecraft/src/Request.java -+++ net/minecraft/src/Request.java -@@ -6,42 +6,42 @@ - import java.net.URL; - - public abstract class Request { -- protected HttpURLConnection a; -+ protected HttpURLConnection field_96367_a; - private boolean field_96366_c; -- protected String b; -+ protected String field_96365_b; - -- public Request(String var1, int var2, int var3) { -+ public Request(String par1Str, int par2, int par3) { - try { -- this.b = var1; -- this.a = (HttpURLConnection)(new URL(var1)).openConnection(Minecraft.getMinecraft().getProxy()); -- this.a.setConnectTimeout(var2); -- this.a.setReadTimeout(var3); -+ this.field_96365_b = par1Str; -+ this.field_96367_a = (HttpURLConnection)(new URL(par1Str)).openConnection(Minecraft.getMinecraft().getProxy()); -+ this.field_96367_a.setConnectTimeout(par2); -+ this.field_96367_a.setReadTimeout(par3); - } catch (Exception var5) { -- throw new ExceptionMcoHttp("Failed URL: " + var1, var5); -+ throw new ExceptionMcoHttp("Failed URL: " + par1Str, var5); - } - } - -- public void func_100006_a(String var1, String var2) { -- String var3 = this.a.getRequestProperty("Cookie"); -- if(var3 == null) { -- this.a.setRequestProperty("Cookie", var1 + "=" + var2); -+ public void func_100006_a(String par1Str, String par2Str) { -+ String var3 = this.field_96367_a.getRequestProperty("Cookie"); -+ -+ if (var3 == null) { -+ this.field_96367_a.setRequestProperty("Cookie", par1Str + "=" + par2Str); - } else { -- this.a.setRequestProperty("Cookie", var3 + ";" + var1 + "=" + var2); -+ this.field_96367_a.setRequestProperty("Cookie", var3 + ";" + par1Str + "=" + par2Str); - } -- - } - - public int func_96362_a() { - try { - this.func_96354_d(); -- return this.a.getResponseCode(); -+ return this.field_96367_a.getResponseCode(); - } catch (Exception var2) { -- throw new ExceptionMcoHttp("Failed URL: " + this.b, var2); -+ throw new ExceptionMcoHttp("Failed URL: " + this.field_96365_b, var2); - } - } - - public int func_111221_b() { -- String var1 = this.a.getHeaderField("Retry-After"); -+ String var1 = this.field_96367_a.getHeaderField("Retry-After"); - - try { - return Integer.valueOf(var1).intValue(); -@@ -53,21 +53,21 @@ - public String func_96364_c() { - try { - this.func_96354_d(); -- String var1 = this.func_96362_a() >= 400 ? this.func_96352_a(this.a.getErrorStream()) : this.func_96352_a(this.a.getInputStream()); -+ String var1 = this.func_96362_a() >= 400 ? this.func_96352_a(this.field_96367_a.getErrorStream()) : this.func_96352_a(this.field_96367_a.getInputStream()); - this.func_96360_f(); - return var1; - } catch (IOException var2) { -- throw new ExceptionMcoHttp("Failed URL: " + this.b, var2); -+ throw new ExceptionMcoHttp("Failed URL: " + this.field_96365_b, var2); - } - } - -- private String func_96352_a(InputStream var1) throws IOException { -- if(var1 == null) { -+ private String func_96352_a(InputStream par1InputStream) throws IOException { -+ if (par1InputStream == null) { - throw new IOException("No response (null)"); - } else { - StringBuilder var2 = new StringBuilder(); - -- for(int var3 = var1.read(); var3 != -1; var3 = var1.read()) { -+ for (int var3 = par1InputStream.read(); var3 != -1; var3 = par1InputStream.read()) { - var2.append((char)var3); - } - -@@ -77,39 +77,37 @@ - - private void func_96360_f() { - byte[] var1 = new byte[1024]; -- - InputStream var3; -+ - try { - boolean var2 = false; -- var3 = this.a.getInputStream(); -+ var3 = this.field_96367_a.getInputStream(); - -- while(true) { -- int var7 = var3.read(var1); -- if(var7 <= 0) { -+ while (true) { -+ if (var3.read(var1) <= 0) { - var3.close(); - break; - } - } - } catch (Exception var6) { - try { -- var3 = this.a.getErrorStream(); -+ var3 = this.field_96367_a.getErrorStream(); - boolean var4 = false; - -- while(true) { -- int var8 = var3.read(var1); -- if(var8 <= 0) { -+ while (true) { -+ if (var3.read(var1) <= 0) { - var3.close(); - break; - } - } - } catch (IOException var5) { -+ ; - } - } -- - } - - protected Request func_96354_d() { -- if(!this.field_96366_c) { -+ if (!this.field_96366_c) { - Request var1 = this.func_96359_e(); - this.field_96366_c = true; - return var1; -@@ -120,32 +118,32 @@ - - protected abstract Request func_96359_e(); - -- public static Request func_96358_a(String var0) { -- return new RequestGet(var0, 5000, 10000); -- } -- -- public static Request func_96361_b(String var0, String var1) { -- return new RequestPost(var0, var1.getBytes(), 5000, 10000); -- } -- -- public static Request func_104064_a(String var0, String var1, int var2, int var3) { -- return new RequestPost(var0, var1.getBytes(), var2, var3); -- } -- -- public static Request func_96355_b(String var0) { -- return new RequestDelete(var0, 5000, 10000); -- } -- -- public static Request func_96363_c(String var0, String var1) { -- return new RequestPut(var0, var1.getBytes(), 5000, 10000); -- } -- -- public static Request func_96353_a(String var0, String var1, int var2, int var3) { -- return new RequestPut(var0, var1.getBytes(), var2, var3); -+ public static Request func_96358_a(String par0Str) { -+ return new RequestGet(par0Str, 5000, 10000); -+ } -+ -+ public static Request func_96361_b(String par0Str, String par1Str) { -+ return new RequestPost(par0Str, par1Str.getBytes(), 5000, 10000); -+ } -+ -+ public static Request func_104064_a(String par0Str, String par1Str, int par2, int par3) { -+ return new RequestPost(par0Str, par1Str.getBytes(), par2, par3); -+ } -+ -+ public static Request func_96355_b(String par0Str) { -+ return new RequestDelete(par0Str, 5000, 10000); -+ } -+ -+ public static Request func_96363_c(String par0Str, String par1Str) { -+ return new RequestPut(par0Str, par1Str.getBytes(), 5000, 10000); -+ } -+ -+ public static Request func_96353_a(String par0Str, String par1Str, int par2, int par3) { -+ return new RequestPut(par0Str, par1Str.getBytes(), par2, par3); - } - - public int func_130110_g() { -- String var1 = this.a.getHeaderField("Error-Code"); -+ String var1 = this.field_96367_a.getHeaderField("Error-Code"); - - try { - return Integer.valueOf(var1).intValue(); ---- /dev/null -+++ org/spoutcraft/api/gui/WidgetManager.java -@@ -1,0 +1,26 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.api.gui; -+ -+public interface WidgetManager { -+ public void sendWidgetUpdate(Widget widget); -+ -+ public void sendFocusUpdate(Control control, boolean focus); -+} ---- net/minecraft/src/ItemEnderEye.java -+++ net/minecraft/src/ItemEnderEye.java -@@ -1,31 +1,36 @@ - package net.minecraft.src; - - public class ItemEnderEye extends Item { -- public ItemEnderEye(int var1) { -- super(var1); -+ public ItemEnderEye(int par1) { -+ super(par1); - this.setCreativeTab(CreativeTabs.tabMisc); - } - -- public boolean onItemUse(ItemStack var1, EntityPlayer var2, World var3, int var4, int var5, int var6, int var7, float var8, float var9, float var10) { -- int var11 = var3.getBlockId(var4, var5, var6); -- int var12 = var3.getBlockMetadata(var4, var5, var6); -- if(var2.canPlayerEdit(var4, var5, var6, var7, var1) && var11 == Block.endPortalFrame.blockID && !BlockEndPortalFrame.isEnderEyeInserted(var12)) { -- if(var3.isRemote) { -+ /** -+ * Callback for item usage. If the item does something special on right clicking, he will have one of those. Return -+ * True if something happen and false if it don't. This is for ITEMS, not BLOCKS -+ */ -+ public boolean onItemUse(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, World par3World, int par4, int par5, int par6, int par7, float par8, float par9, float par10) { -+ int var11 = par3World.getBlockId(par4, par5, par6); -+ int var12 = par3World.getBlockMetadata(par4, par5, par6); -+ -+ if (par2EntityPlayer.canPlayerEdit(par4, par5, par6, par7, par1ItemStack) && var11 == Block.endPortalFrame.blockID && !BlockEndPortalFrame.isEnderEyeInserted(var12)) { -+ if (par3World.isRemote) { - return true; - } else { -- var3.setBlockMetadata(var4, var5, var6, var12 + 4, 2); -- var3.func_96440_m(var4, var5, var6, Block.endPortalFrame.blockID); -- --var1.stackSize; -- -+ par3World.setBlockMetadataWithNotify(par4, par5, par6, var12 + 4, 2); -+ par3World.func_96440_m(par4, par5, par6, Block.endPortalFrame.blockID); -+ --par1ItemStack.stackSize; - int var13; -- for(var13 = 0; var13 < 16; ++var13) { -- double var14 = (double)((float)var4 + (5.0F + f.nextFloat() * 6.0F) / 16.0F); -- double var16 = (double)((float)var5 + 13.0F / 16.0F); -- double var18 = (double)((float)var6 + (5.0F + f.nextFloat() * 6.0F) / 16.0F); -+ -+ for (var13 = 0; var13 < 16; ++var13) { -+ double var14 = (double)((float)par4 + (5.0F + itemRand.nextFloat() * 6.0F) / 16.0F); -+ double var16 = (double)((float)par5 + 0.8125F); -+ double var18 = (double)((float)par6 + (5.0F + itemRand.nextFloat() * 6.0F) / 16.0F); - double var20 = 0.0D; - double var22 = 0.0D; - double var24 = 0.0D; -- var3.spawnParticle("smoke", var14, var16, var18, var20, var22, var24); -+ par3World.spawnParticle("smoke", var14, var16, var18, var20, var22, var24); - } - - var13 = var12 & 3; -@@ -33,69 +38,74 @@ - int var15 = 0; - boolean var27 = false; - boolean var17 = true; -- int var28 = Direction.enderEyeMetaToDirection[var13]; -- -+ int var28 = Direction.rotateRight[var13]; - int var19; - int var21; - int var23; - int var29; - int var30; -- for(var19 = -2; var19 <= 2; ++var19) { -- var29 = var4 + Direction.offsetX[var28] * var19; -- var21 = var6 + Direction.offsetZ[var28] * var19; -- var30 = var3.getBlockId(var29, var5, var21); -- if(var30 == Block.endPortalFrame.blockID) { -- var23 = var3.getBlockMetadata(var29, var5, var21); -- if(!BlockEndPortalFrame.isEnderEyeInserted(var23)) { -+ -+ for (var19 = -2; var19 <= 2; ++var19) { -+ var29 = par4 + Direction.offsetX[var28] * var19; -+ var21 = par6 + Direction.offsetZ[var28] * var19; -+ var30 = par3World.getBlockId(var29, par5, var21); -+ -+ if (var30 == Block.endPortalFrame.blockID) { -+ var23 = par3World.getBlockMetadata(var29, par5, var21); -+ -+ if (!BlockEndPortalFrame.isEnderEyeInserted(var23)) { - var17 = false; - break; - } - - var15 = var19; -- if(!var27) { -+ -+ if (!var27) { - var26 = var19; - var27 = true; - } - } - } - -- if(var17 && var15 == var26 + 2) { -- for(var19 = var26; var19 <= var15; ++var19) { -- var29 = var4 + Direction.offsetX[var28] * var19; -- var21 = var6 + Direction.offsetZ[var28] * var19; -+ if (var17 && var15 == var26 + 2) { -+ for (var19 = var26; var19 <= var15; ++var19) { -+ var29 = par4 + Direction.offsetX[var28] * var19; -+ var21 = par6 + Direction.offsetZ[var28] * var19; - var29 += Direction.offsetX[var13] * 4; - var21 += Direction.offsetZ[var13] * 4; -- var30 = var3.getBlockId(var29, var5, var21); -- var23 = var3.getBlockMetadata(var29, var5, var21); -- if(var30 != Block.endPortalFrame.blockID || !BlockEndPortalFrame.isEnderEyeInserted(var23)) { -+ var30 = par3World.getBlockId(var29, par5, var21); -+ var23 = par3World.getBlockMetadata(var29, par5, var21); -+ -+ if (var30 != Block.endPortalFrame.blockID || !BlockEndPortalFrame.isEnderEyeInserted(var23)) { - var17 = false; - break; - } - } - -- for(var19 = var26 - 1; var19 <= var15 + 1; var19 += 4) { -- for(var29 = 1; var29 <= 3; ++var29) { -- var21 = var4 + Direction.offsetX[var28] * var19; -- var30 = var6 + Direction.offsetZ[var28] * var19; -+ for (var19 = var26 - 1; var19 <= var15 + 1; var19 += 4) { -+ for (var29 = 1; var29 <= 3; ++var29) { -+ var21 = par4 + Direction.offsetX[var28] * var19; -+ var30 = par6 + Direction.offsetZ[var28] * var19; - var21 += Direction.offsetX[var13] * var29; - var30 += Direction.offsetZ[var13] * var29; -- var23 = var3.getBlockId(var21, var5, var30); -- int var31 = var3.getBlockMetadata(var21, var5, var30); -- if(var23 != Block.endPortalFrame.blockID || !BlockEndPortalFrame.isEnderEyeInserted(var31)) { -+ var23 = par3World.getBlockId(var21, par5, var30); -+ int var31 = par3World.getBlockMetadata(var21, par5, var30); -+ -+ if (var23 != Block.endPortalFrame.blockID || !BlockEndPortalFrame.isEnderEyeInserted(var31)) { - var17 = false; - break; - } - } - } - -- if(var17) { -- for(var19 = var26; var19 <= var15; ++var19) { -- for(var29 = 1; var29 <= 3; ++var29) { -- var21 = var4 + Direction.offsetX[var28] * var19; -- var30 = var6 + Direction.offsetZ[var28] * var19; -+ if (var17) { -+ for (var19 = var26; var19 <= var15; ++var19) { -+ for (var29 = 1; var29 <= 3; ++var29) { -+ var21 = par4 + Direction.offsetX[var28] * var19; -+ var30 = par6 + Direction.offsetZ[var28] * var19; - var21 += Direction.offsetX[var13] * var29; - var30 += Direction.offsetZ[var13] * var29; -- var3.setBlock(var21, var5, var30, Block.endPortal.blockID, 0, 2); -+ par3World.setBlock(var21, par5, var30, Block.endPortal.blockID, 0, 2); - } - } - } -@@ -108,29 +118,36 @@ - } - } - -- public ItemStack onItemRightClick(ItemStack var1, World var2, EntityPlayer var3) { -- MovingObjectPosition var4 = this.getMovingObjectPositionFromPlayer(var2, var3, false); -- if(var4 != null && var4.typeOfHit == EnumMovingObjectType.TILE) { -- int var5 = var2.getBlockId(var4.blockX, var4.blockY, var4.blockZ); -- if(var5 == Block.endPortalFrame.blockID) { -- return var1; -+ /** -+ * Called whenever this item is equipped and the right mouse button is pressed. Args: itemStack, world, entityPlayer -+ */ -+ public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) { -+ MovingObjectPosition var4 = this.getMovingObjectPositionFromPlayer(par2World, par3EntityPlayer, false); -+ -+ if (var4 != null && var4.typeOfHit == EnumMovingObjectType.TILE) { -+ int var5 = par2World.getBlockId(var4.blockX, var4.blockY, var4.blockZ); -+ -+ if (var5 == Block.endPortalFrame.blockID) { -+ return par1ItemStack; - } - } - -- if(!var2.isRemote) { -- ChunkPosition var7 = var2.findClosestStructure("Stronghold", (int)var3.posX, (int)var3.posY, (int)var3.posZ); -- if(var7 != null) { -- EntityEnderEye var6 = new EntityEnderEye(var2, var3.posX, var3.posY + 1.62D - (double)var3.yOffset, var3.posZ); -+ if (!par2World.isRemote) { -+ ChunkPosition var7 = par2World.findClosestStructure("Stronghold", (int)par3EntityPlayer.posX, (int)par3EntityPlayer.posY, (int)par3EntityPlayer.posZ); -+ -+ if (var7 != null) { -+ EntityEnderEye var6 = new EntityEnderEye(par2World, par3EntityPlayer.posX, par3EntityPlayer.posY + 1.62D - (double)par3EntityPlayer.yOffset, par3EntityPlayer.posZ); - var6.moveTowards((double)var7.x, var7.y, (double)var7.z); -- var2.spawnEntityInWorld(var6); -- var2.playSoundAtEntity(var3, "random.bow", 0.5F, 0.4F / (f.nextFloat() * 0.4F + 0.8F)); -- var2.playAuxSFXAtEntity((EntityPlayer)null, 1002, (int)var3.posX, (int)var3.posY, (int)var3.posZ, 0); -- if(!var3.capabilities.isCreativeMode) { -- --var1.stackSize; -+ par2World.spawnEntityInWorld(var6); -+ par2World.playSoundAtEntity(par3EntityPlayer, "random.bow", 0.5F, 0.4F / (itemRand.nextFloat() * 0.4F + 0.8F)); -+ par2World.playAuxSFXAtEntity((EntityPlayer)null, 1002, (int)par3EntityPlayer.posX, (int)par3EntityPlayer.posY, (int)par3EntityPlayer.posZ, 0); -+ -+ if (!par3EntityPlayer.capabilities.isCreativeMode) { -+ --par1ItemStack.stackSize; - } - } - } - -- return var1; -+ return par1ItemStack; - } - } ---- net/minecraft/src/IWorldAccess.java -+++ net/minecraft/src/IWorldAccess.java -@@ -1,27 +1,68 @@ - package net.minecraft.src; - -+import org.newdawn.slick.opengl.Texture; -+ - public interface IWorldAccess { -+ -+ /** -+ * On the client, re-renders the block. On the server, sends the block to the client (which will re-render it), -+ * including the tile entity description packet if applicable. Args: x, y, z -+ */ - void markBlockForUpdate(int var1, int var2, int var3); - -+ /** -+ * On the client, re-renders this block. On the server, does nothing. Used for lighting updates. -+ */ - void markBlockForRenderUpdate(int var1, int var2, int var3); - -+ /** -+ * On the client, re-renders all blocks in this range, inclusive. On the server, does nothing. Args: min x, min y, min -+ * z, max x, max y, max z -+ */ - void markBlockRangeForRenderUpdate(int var1, int var2, int var3, int var4, int var5, int var6); - -+ /** -+ * Plays the specified sound. Arg: soundName, x, y, z, volume, pitch -+ */ - void playSound(String var1, double var2, double var4, double var6, float var8, float var9); - -+ /** -+ * Plays sound to all near players except the player reference given -+ */ - void playSoundToNearExcept(EntityPlayer var1, String var2, double var3, double var5, double var7, float var9, float var10); - -- void spawnParticle(String var1, double var2, double var4, double var6, double var8, double var10, double var12); -+ /** -+ * Spawns a particle. Arg: particleType, x, y, z, velX, velY, velZ -+ */ -+ void spawnParticle(String var1, double var2, double var4, double var6, double var8, double var10, double var12, Texture texture); - -+ /** -+ * Called on all IWorldAccesses when an entity is created or loaded. On client worlds, starts downloading any necessary -+ * textures. On server worlds, adds the entity to the entity tracker. -+ */ - void onEntityCreate(Entity var1); - -+ /** -+ * Called on all IWorldAccesses when an entity is unloaded or destroyed. On client worlds, releases any downloaded -+ * textures. On server worlds, removes the entity from the entity tracker. -+ */ - void onEntityDestroy(Entity var1); - -+ /** -+ * Plays the specified record. Arg: recordName, x, y, z -+ */ - void playRecord(String var1, int var2, int var3, int var4); - - void broadcastSound(int var1, int var2, int var3, int var4, int var5); - -+ /** -+ * Plays a pre-canned sound effect along with potentially auxiliary data-driven one-shot behaviour (particles, etc). -+ */ - void playAuxSFX(EntityPlayer var1, int var2, int var3, int var4, int var5, int var6); - -+ /** -+ * Starts (or continues) destroying a block with given ID at the given coordinates for the given partially destroyed -+ * value -+ */ - void destroyBlockPartially(int var1, int var2, int var3, int var4, int var5); - } ---- net/minecraft/src/MapGenVillage.java -+++ net/minecraft/src/MapGenVillage.java -@@ -8,7 +8,11 @@ - import java.util.Map.Entry; - - public class MapGenVillage extends MapGenStructure { -- public static final List e = Arrays.asList(new BiomeGenBase[]{BiomeGenBase.plains, BiomeGenBase.desert}); -+ -+ /** A list of all the biomes villages can spawn in. */ -+ public static final List villageSpawnBiomes = Arrays.asList(new BiomeGenBase[] {BiomeGenBase.plains, BiomeGenBase.desert}); -+ -+ /** World terrain type, 0 for normal, 1 for flat map */ - private int terrainType; - private int field_82665_g; - private int field_82666_h; -@@ -18,46 +22,49 @@ - this.field_82666_h = 8; - } - -- public MapGenVillage(Map var1) { -+ public MapGenVillage(Map par1Map) { - this(); -- Iterator var2 = var1.entrySet().iterator(); -+ Iterator var2 = par1Map.entrySet().iterator(); - -- while(var2.hasNext()) { -+ while (var2.hasNext()) { - Entry var3 = (Entry)var2.next(); -- if(((String)var3.getKey()).equals("size")) { -+ -+ if (((String)var3.getKey()).equals("size")) { - this.terrainType = MathHelper.parseIntWithDefaultAndMax((String)var3.getValue(), this.terrainType, 0); -- } else if(((String)var3.getKey()).equals("distance")) { -+ } else if (((String)var3.getKey()).equals("distance")) { - this.field_82665_g = MathHelper.parseIntWithDefaultAndMax((String)var3.getValue(), this.field_82665_g, this.field_82666_h + 1); - } - } -- - } - - public String func_143025_a() { - return "Village"; - } - -- protected boolean canSpawnStructureAtCoords(int var1, int var2) { -- int var3 = var1; -- int var4 = var2; -- if(var1 < 0) { -- var1 -= this.field_82665_g - 1; -- } -- -- if(var2 < 0) { -- var2 -= this.field_82665_g - 1; -- } -- -- int var5 = var1 / this.field_82665_g; -- int var6 = var2 / this.field_82665_g; -+ protected boolean canSpawnStructureAtCoords(int par1, int par2) { -+ int var3 = par1; -+ int var4 = par2; -+ -+ if (par1 < 0) { -+ par1 -= this.field_82665_g - 1; -+ } -+ -+ if (par2 < 0) { -+ par2 -= this.field_82665_g - 1; -+ } -+ -+ int var5 = par1 / this.field_82665_g; -+ int var6 = par2 / this.field_82665_g; - Random var7 = this.worldObj.setRandomSeed(var5, var6, 10387312); - var5 *= this.field_82665_g; - var6 *= this.field_82665_g; - var5 += var7.nextInt(this.field_82665_g - this.field_82666_h); - var6 += var7.nextInt(this.field_82665_g - this.field_82666_h); -- if(var3 == var5 && var4 == var6) { -- boolean var8 = this.worldObj.getWorldChunkManager().areBiomesViable(var3 * 16 + 8, var4 * 16 + 8, 0, e); -- if(var8) { -+ -+ if (var3 == var5 && var4 == var6) { -+ boolean var8 = this.worldObj.getWorldChunkManager().areBiomesViable(var3 * 16 + 8, var4 * 16 + 8, 0, villageSpawnBiomes); -+ -+ if (var8) { - return true; - } - } -@@ -65,7 +72,7 @@ - return false; - } - -- protected StructureStart getStructureStart(int var1, int var2) { -- return new StructureVillageStart(this.worldObj, this.b, var1, var2, this.terrainType); -+ protected StructureStart getStructureStart(int par1, int par2) { -+ return new StructureVillageStart(this.worldObj, this.rand, par1, par2, this.terrainType); - } - } ---- net/minecraft/src/RenderManager.java -+++ net/minecraft/src/RenderManager.java -@@ -3,22 +3,42 @@ - import java.util.HashMap; - import java.util.Iterator; - import java.util.Map; -+ - import org.lwjgl.opengl.GL11; - -+import org.spoutcraft.client.entity.EntityText; -+import org.spoutcraft.client.entity.EntityTexture; -+import org.spoutcraft.client.entity.RenderText; -+import org.spoutcraft.client.entity.RenderTexture; -+ - public class RenderManager { -- private Map q = new HashMap(); -+ -+ /** A map of entity classes and the associated renderer. */ -+ // Spout Start - private to public -+ public Map entityRenderMap = new HashMap(); -+ // Spout End -+ -+ /** The static instance of RenderManager. */ - public static RenderManager instance = new RenderManager(); -+ -+ /** Renders fonts */ - private FontRenderer fontRenderer; - public static double renderPosX; - public static double renderPosY; - public static double renderPosZ; - public TextureManager renderEngine; - public ItemRenderer itemRenderer; -+ -+ /** Reference to the World object. */ - public World worldObj; -+ -+ /** Rendermanager's variable for the player */ - public EntityLivingBase livingPlayer; - public EntityLivingBase field_96451_i; - public float playerViewY; - public float playerViewX; -+ -+ /** Reference to the GameSettings object. */ - public GameSettings options; - public double viewerPosX; - public double viewerPosY; -@@ -26,126 +46,140 @@ - public static boolean field_85095_o; - - private RenderManager() { -- this.q.put(EntityCaveSpider.class, new RenderCaveSpider()); -- this.q.put(EntitySpider.class, new RenderSpider()); -- this.q.put(EntityPig.class, new RenderPig(new ModelPig(), new ModelPig(0.5F), 0.7F)); -- this.q.put(EntitySheep.class, new RenderSheep(new ModelSheep2(), new ModelSheep1(), 0.7F)); -- this.q.put(EntityCow.class, new RenderCow(new ModelCow(), 0.7F)); -- this.q.put(EntityMooshroom.class, new RenderMooshroom(new ModelCow(), 0.7F)); -- this.q.put(EntityWolf.class, new RenderWolf(new ModelWolf(), new ModelWolf(), 0.5F)); -- this.q.put(EntityChicken.class, new RenderChicken(new ModelChicken(), 0.3F)); -- this.q.put(EntityOcelot.class, new RenderOcelot(new ModelOcelot(), 0.4F)); -- this.q.put(EntitySilverfish.class, new RenderSilverfish()); -- this.q.put(EntityCreeper.class, new RenderCreeper()); -- this.q.put(EntityEnderman.class, new RenderEnderman()); -- this.q.put(EntitySnowman.class, new RenderSnowMan()); -- this.q.put(EntitySkeleton.class, new RenderSkeleton()); -- this.q.put(EntityWitch.class, new RenderWitch()); -- this.q.put(EntityBlaze.class, new RenderBlaze()); -- this.q.put(EntityZombie.class, new RenderZombie()); -- this.q.put(EntitySlime.class, new RenderSlime(new ModelSlime(16), new ModelSlime(0), 0.25F)); -- this.q.put(EntityMagmaCube.class, new RenderMagmaCube()); -- this.q.put(EntityPlayer.class, new RenderPlayer()); -- this.q.put(EntityGiantZombie.class, new RenderGiantZombie(new ModelZombie(), 0.5F, 6.0F)); -- this.q.put(EntityGhast.class, new RenderGhast()); -- this.q.put(EntitySquid.class, new RenderSquid(new ModelSquid(), 0.7F)); -- this.q.put(EntityVillager.class, new RenderVillager()); -- this.q.put(EntityIronGolem.class, new RenderIronGolem()); -- this.q.put(EntityBat.class, new RenderBat()); -- this.q.put(EntityDragon.class, new RenderDragon()); -- this.q.put(EntityEnderCrystal.class, new RenderEnderCrystal()); -- this.q.put(EntityWither.class, new RenderWither()); -- this.q.put(Entity.class, new RenderEntity()); -- this.q.put(EntityPainting.class, new RenderPainting()); -- this.q.put(EntityItemFrame.class, new RenderItemFrame()); -- this.q.put(EntityLeashKnot.class, new RenderLeashKnot()); -- this.q.put(EntityArrow.class, new RenderArrow()); -- this.q.put(EntitySnowball.class, new RenderSnowball(Item.snowball)); -- this.q.put(EntityEnderPearl.class, new RenderSnowball(Item.enderPearl)); -- this.q.put(EntityEnderEye.class, new RenderSnowball(Item.eyeOfEnder)); -- this.q.put(EntityEgg.class, new RenderSnowball(Item.egg)); -- this.q.put(EntityPotion.class, new RenderSnowball(Item.potion, 16384)); -- this.q.put(EntityExpBottle.class, new RenderSnowball(Item.expBottle)); -- this.q.put(EntityFireworkRocket.class, new RenderSnowball(Item.firework)); -- this.q.put(EntityLargeFireball.class, new RenderFireball(2.0F)); -- this.q.put(EntitySmallFireball.class, new RenderFireball(0.5F)); -- this.q.put(EntityWitherSkull.class, new RenderWitherSkull()); -- this.q.put(EntityItem.class, new RenderItem()); -- this.q.put(EntityXPOrb.class, new RenderXPOrb()); -- this.q.put(EntityTNTPrimed.class, new RenderTNTPrimed()); -- this.q.put(EntityFallingSand.class, new RenderFallingSand()); -- this.q.put(EntityMinecartTNT.class, new RenderTntMinecart()); -- this.q.put(EntityMinecartMobSpawner.class, new RenderMinecartMobSpawner()); -- this.q.put(EntityMinecart.class, new RenderMinecart()); -- this.q.put(EntityBoat.class, new RenderBoat()); -- this.q.put(EntityFishHook.class, new RenderFish()); -- this.q.put(EntityHorse.class, new RenderHorse(new ModelHorse(), 12.0F / 16.0F)); -- this.q.put(EntityLightningBolt.class, new RenderLightningBolt()); -- Iterator var1 = this.q.values().iterator(); -+ this.entityRenderMap.put(EntityCaveSpider.class, new RenderCaveSpider()); -+ this.entityRenderMap.put(EntitySpider.class, new RenderSpider()); -+ this.entityRenderMap.put(EntityPig.class, new RenderPig(new ModelPig(), new ModelPig(0.5F), 0.7F)); -+ this.entityRenderMap.put(EntitySheep.class, new RenderSheep(new ModelSheep2(), new ModelSheep1(), 0.7F)); -+ this.entityRenderMap.put(EntityCow.class, new RenderCow(new ModelCow(), 0.7F)); -+ this.entityRenderMap.put(EntityMooshroom.class, new RenderMooshroom(new ModelCow(), 0.7F)); -+ this.entityRenderMap.put(EntityWolf.class, new RenderWolf(new ModelWolf(), new ModelWolf(), 0.5F)); -+ this.entityRenderMap.put(EntityChicken.class, new RenderChicken(new ModelChicken(), 0.3F)); -+ this.entityRenderMap.put(EntityOcelot.class, new RenderOcelot(new ModelOcelot(), 0.4F)); -+ this.entityRenderMap.put(EntitySilverfish.class, new RenderSilverfish()); -+ this.entityRenderMap.put(EntityCreeper.class, new RenderCreeper()); -+ this.entityRenderMap.put(EntityEnderman.class, new RenderEnderman()); -+ this.entityRenderMap.put(EntitySnowman.class, new RenderSnowMan()); -+ this.entityRenderMap.put(EntitySkeleton.class, new RenderSkeleton()); -+ this.entityRenderMap.put(EntityWitch.class, new RenderWitch()); -+ this.entityRenderMap.put(EntityBlaze.class, new RenderBlaze()); -+ this.entityRenderMap.put(EntityZombie.class, new RenderZombie()); -+ this.entityRenderMap.put(EntitySlime.class, new RenderSlime(new ModelSlime(16), new ModelSlime(0), 0.25F)); -+ this.entityRenderMap.put(EntityMagmaCube.class, new RenderMagmaCube()); -+ this.entityRenderMap.put(EntityPlayer.class, new RenderPlayer()); -+ this.entityRenderMap.put(EntityGiantZombie.class, new RenderGiantZombie(new ModelZombie(), 0.5F, 6.0F)); -+ this.entityRenderMap.put(EntityGhast.class, new RenderGhast()); -+ this.entityRenderMap.put(EntitySquid.class, new RenderSquid(new ModelSquid(), 0.7F)); -+ this.entityRenderMap.put(EntityVillager.class, new RenderVillager()); -+ this.entityRenderMap.put(EntityIronGolem.class, new RenderIronGolem()); -+ this.entityRenderMap.put(EntityBat.class, new RenderBat()); -+ this.entityRenderMap.put(EntityDragon.class, new RenderDragon()); -+ this.entityRenderMap.put(EntityEnderCrystal.class, new RenderEnderCrystal()); -+ this.entityRenderMap.put(EntityWither.class, new RenderWither()); -+ this.entityRenderMap.put(Entity.class, new RenderEntity()); -+ this.entityRenderMap.put(EntityPainting.class, new RenderPainting()); -+ this.entityRenderMap.put(EntityItemFrame.class, new RenderItemFrame()); -+ this.entityRenderMap.put(EntityLeashKnot.class, new RenderLeashKnot()); -+ this.entityRenderMap.put(EntityArrow.class, new RenderArrow()); -+ this.entityRenderMap.put(EntitySnowball.class, new RenderSnowball(Item.snowball)); -+ this.entityRenderMap.put(EntityEnderPearl.class, new RenderSnowball(Item.enderPearl)); -+ this.entityRenderMap.put(EntityEnderEye.class, new RenderSnowball(Item.eyeOfEnder)); -+ this.entityRenderMap.put(EntityEgg.class, new RenderSnowball(Item.egg)); -+ this.entityRenderMap.put(EntityPotion.class, new RenderSnowball(Item.potion, 16384)); -+ this.entityRenderMap.put(EntityExpBottle.class, new RenderSnowball(Item.expBottle)); -+ this.entityRenderMap.put(EntityFireworkRocket.class, new RenderSnowball(Item.firework)); -+ this.entityRenderMap.put(EntityLargeFireball.class, new RenderFireball(2.0F)); -+ this.entityRenderMap.put(EntitySmallFireball.class, new RenderFireball(0.5F)); -+ this.entityRenderMap.put(EntityWitherSkull.class, new RenderWitherSkull()); -+ this.entityRenderMap.put(EntityItem.class, new RenderItem()); -+ this.entityRenderMap.put(EntityXPOrb.class, new RenderXPOrb()); -+ this.entityRenderMap.put(EntityTNTPrimed.class, new RenderTNTPrimed()); -+ this.entityRenderMap.put(EntityFallingSand.class, new RenderFallingSand()); -+ this.entityRenderMap.put(EntityMinecartTNT.class, new RenderTntMinecart()); -+ this.entityRenderMap.put(EntityMinecartMobSpawner.class, new RenderMinecartMobSpawner()); -+ this.entityRenderMap.put(EntityMinecart.class, new RenderMinecart()); -+ this.entityRenderMap.put(EntityBoat.class, new RenderBoat()); -+ this.entityRenderMap.put(EntityFishHook.class, new RenderFish()); -+ this.entityRenderMap.put(EntityHorse.class, new RenderHorse(new ModelHorse(), 0.75F)); -+ this.entityRenderMap.put(EntityLightningBolt.class, new RenderLightningBolt()); -+ // Spout Start -+ this.entityRenderMap.put(EntityText.class, new RenderText()); -+ this.entityRenderMap.put(EntityTexture.class, new RenderTexture()); -+ // Spout End -+ Iterator var1 = this.entityRenderMap.values().iterator(); - -- while(var1.hasNext()) { -+ while (var1.hasNext()) { - Render var2 = (Render)var1.next(); - var2.setRenderManager(this); - } -- - } - -- public Render getEntityClassRenderObject(Class var1) { -- Render var2 = (Render)this.q.get(var1); -- if(var2 == null && var1 != Entity.class) { -- var2 = this.getEntityClassRenderObject(var1.getSuperclass()); -- this.q.put(var1, var2); -+ public Render getEntityClassRenderObject(Class par1Class) { -+ Render var2 = (Render)this.entityRenderMap.get(par1Class); -+ -+ if (var2 == null && par1Class != Entity.class) { -+ var2 = this.getEntityClassRenderObject(par1Class.getSuperclass()); -+ this.entityRenderMap.put(par1Class, var2); - } - - return var2; - } - -- public Render getEntityRenderObject(Entity var1) { -- return this.getEntityClassRenderObject(var1.getClass()); -+ public Render getEntityRenderObject(Entity par1Entity) { -+ return this.getEntityClassRenderObject(par1Entity.getClass()); - } - -- public void cacheActiveRenderInfo(World var1, TextureManager var2, FontRenderer var3, EntityLivingBase var4, EntityLivingBase var5, GameSettings var6, float var7) { -- this.worldObj = var1; -- this.renderEngine = var2; -- this.options = var6; -- this.livingPlayer = var4; -- this.field_96451_i = var5; -- this.fontRenderer = var3; -- if(var4.isPlayerSleeping()) { -- int var8 = var1.getBlockId(MathHelper.floor_double(var4.posX), MathHelper.floor_double(var4.posY), MathHelper.floor_double(var4.posZ)); -- if(var8 == Block.bed.blockID) { -- int var9 = var1.getBlockMetadata(MathHelper.floor_double(var4.posX), MathHelper.floor_double(var4.posY), MathHelper.floor_double(var4.posZ)); -+ /** -+ * Caches the current frame's active render info, including the current World, RenderEngine, GameSettings and -+ * FontRenderer settings, as well as interpolated player position, pitch and yaw. -+ */ -+ public void cacheActiveRenderInfo(World par1World, TextureManager par2TextureManager, FontRenderer par3FontRenderer, EntityLivingBase par4EntityLivingBase, EntityLivingBase par5EntityLivingBase, GameSettings par6GameSettings, float par7) { -+ this.worldObj = par1World; -+ this.renderEngine = par2TextureManager; -+ this.options = par6GameSettings; -+ this.livingPlayer = par4EntityLivingBase; -+ this.field_96451_i = par5EntityLivingBase; -+ this.fontRenderer = par3FontRenderer; -+ -+ if (par4EntityLivingBase.isPlayerSleeping()) { -+ int var8 = par1World.getBlockId(MathHelper.floor_double(par4EntityLivingBase.posX), MathHelper.floor_double(par4EntityLivingBase.posY), MathHelper.floor_double(par4EntityLivingBase.posZ)); -+ -+ if (var8 == Block.bed.blockID) { -+ int var9 = par1World.getBlockMetadata(MathHelper.floor_double(par4EntityLivingBase.posX), MathHelper.floor_double(par4EntityLivingBase.posY), MathHelper.floor_double(par4EntityLivingBase.posZ)); - int var10 = var9 & 3; - this.playerViewY = (float)(var10 * 90 + 180); - this.playerViewX = 0.0F; - } - } else { -- this.playerViewY = var4.prevRotationYaw + (var4.rotationYaw - var4.prevRotationYaw) * var7; -- this.playerViewX = var4.prevRotationPitch + (var4.rotationPitch - var4.prevRotationPitch) * var7; -+ this.playerViewY = par4EntityLivingBase.prevRotationYaw + (par4EntityLivingBase.rotationYaw - par4EntityLivingBase.prevRotationYaw) * par7; -+ this.playerViewX = par4EntityLivingBase.prevRotationPitch + (par4EntityLivingBase.rotationPitch - par4EntityLivingBase.prevRotationPitch) * par7; - } - -- if(var6.thirdPersonView == 2) { -+ if (par6GameSettings.thirdPersonView == 2) { - this.playerViewY += 180.0F; - } - -- this.viewerPosX = var4.lastTickPosX + (var4.posX - var4.lastTickPosX) * (double)var7; -- this.viewerPosY = var4.lastTickPosY + (var4.posY - var4.lastTickPosY) * (double)var7; -- this.viewerPosZ = var4.lastTickPosZ + (var4.posZ - var4.lastTickPosZ) * (double)var7; -+ this.viewerPosX = par4EntityLivingBase.lastTickPosX + (par4EntityLivingBase.posX - par4EntityLivingBase.lastTickPosX) * (double)par7; -+ this.viewerPosY = par4EntityLivingBase.lastTickPosY + (par4EntityLivingBase.posY - par4EntityLivingBase.lastTickPosY) * (double)par7; -+ this.viewerPosZ = par4EntityLivingBase.lastTickPosZ + (par4EntityLivingBase.posZ - par4EntityLivingBase.lastTickPosZ) * (double)par7; - } - -- public void renderEntity(Entity var1, float var2) { -- if(var1.ticksExisted == 0) { -- var1.lastTickPosX = var1.posX; -- var1.lastTickPosY = var1.posY; -- var1.lastTickPosZ = var1.posZ; -+ /** -+ * Will render the specified entity at the specified partial tick time. Args: entity, partialTickTime -+ */ -+ public void renderEntity(Entity par1Entity, float par2) { -+ if (par1Entity.ticksExisted == 0) { -+ par1Entity.lastTickPosX = par1Entity.posX; -+ par1Entity.lastTickPosY = par1Entity.posY; -+ par1Entity.lastTickPosZ = par1Entity.posZ; - } - -- double var3 = var1.lastTickPosX + (var1.posX - var1.lastTickPosX) * (double)var2; -- double var5 = var1.lastTickPosY + (var1.posY - var1.lastTickPosY) * (double)var2; -- double var7 = var1.lastTickPosZ + (var1.posZ - var1.lastTickPosZ) * (double)var2; -- float var9 = var1.prevRotationYaw + (var1.rotationYaw - var1.prevRotationYaw) * var2; -- int var10 = var1.getBrightnessForRender(var2); -- if(var1.isBurning()) { -+ double var3 = par1Entity.lastTickPosX + (par1Entity.posX - par1Entity.lastTickPosX) * (double)par2; -+ double var5 = par1Entity.lastTickPosY + (par1Entity.posY - par1Entity.lastTickPosY) * (double)par2; -+ double var7 = par1Entity.lastTickPosZ + (par1Entity.posZ - par1Entity.lastTickPosZ) * (double)par2; -+ float var9 = par1Entity.prevRotationYaw + (par1Entity.rotationYaw - par1Entity.prevRotationYaw) * par2; -+ int var10 = par1Entity.getBrightnessForRender(par2); -+ -+ if (par1Entity.isBurning()) { - var10 = 15728880; - } - -@@ -153,50 +187,67 @@ - int var12 = var10 / 65536; - OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, (float)var11 / 1.0F, (float)var12 / 1.0F); - GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); -- this.renderEntityWithPosYaw(var1, var3 - renderPosX, var5 - renderPosY, var7 - renderPosZ, var9, var2); -+ this.renderEntityWithPosYaw(par1Entity, var3 - renderPosX, var5 - renderPosY, var7 - renderPosZ, var9, par2); - } - -- public void renderEntityWithPosYaw(Entity var1, double var2, double var4, double var6, float var8, float var9) { -+ /** -+ * Renders the specified entity with the passed in position, yaw, and partialTickTime. Args: entity, x, y, z, yaw, -+ * partialTickTime -+ */ -+ public void renderEntityWithPosYaw(Entity par1Entity, double par2, double par4, double par6, float par8, float par9) { - Render var10 = null; - - try { -- var10 = this.getEntityRenderObject(var1); -- if(var10 != null && this.renderEngine != null) { -- if(field_85095_o && !var1.isInvisible()) { -+ var10 = this.getEntityRenderObject(par1Entity); -+ -+ if (var10 != null && this.renderEngine != null) { -+ if (field_85095_o && !par1Entity.isInvisible()) { - try { -- this.func_85094_b(var1, var2, var4, var6, var8, var9); -+ this.func_85094_b(par1Entity, par2, par4, par6, par8, par9); - } catch (Throwable var17) { - throw new ReportedException(CrashReport.makeCrashReport(var17, "Rendering entity hitbox in world")); - } - } - -+ // Spout Start -+ var10.setRenderManager(this); -+ // Spout End -+ - try { -- var10.doRender(var1, var2, var4, var6, var8, var9); -+ var10.doRender(par1Entity, par2, par4, par6, par8, par9); -+ // Spout Start - Ignore NullPointerExceptions, the old way -+ } catch(NullPointerException ignore) { -+ // Spout End - } catch (Throwable var16) { - throw new ReportedException(CrashReport.makeCrashReport(var16, "Rendering entity in world")); - } - - try { -- var10.doRenderShadowAndFire(var1, var2, var4, var6, var8, var9); -+ var10.doRenderShadowAndFire(par1Entity, par2, par4, par6, par8, par9); -+ // Spout Start - Ignore NullPointerExceptions, the old way -+ } catch(NullPointerException ignore) { -+ // Spout End - } catch (Throwable var15) { - throw new ReportedException(CrashReport.makeCrashReport(var15, "Post-rendering entity in world")); - } - } -- -+ // Spout Start - Ignore NullPointerExceptions, the old way -+ } catch(NullPointerException ignore) { -+ // Spout End - } catch (Throwable var18) { - CrashReport var12 = CrashReport.makeCrashReport(var18, "Rendering entity in world"); - CrashReportCategory var13 = var12.makeCategory("Entity being rendered"); -- var1.addEntityCrashInfo(var13); -+ par1Entity.addEntityCrashInfo(var13); - CrashReportCategory var14 = var12.makeCategory("Renderer details"); - var14.addCrashSection("Assigned renderer", var10); -- var14.addCrashSection("Location", CrashReportCategory.func_85074_a(var2, var4, var6)); -- var14.addCrashSection("Rotation", Float.valueOf(var8)); -- var14.addCrashSection("Delta", Float.valueOf(var9)); -+ var14.addCrashSection("Location", CrashReportCategory.func_85074_a(par2, par4, par6)); -+ var14.addCrashSection("Rotation", Float.valueOf(par8)); -+ var14.addCrashSection("Delta", Float.valueOf(par9)); - throw new ReportedException(var12); - } - } - -- private void func_85094_b(Entity var1, double var2, double var4, double var6, float var8, float var9) { -+ private void func_85094_b(Entity par1Entity, double par2, double par4, double par6, float par8, float par9) { - GL11.glDepthMask(false); - GL11.glDisable(GL11.GL_TEXTURE_2D); - GL11.glDisable(GL11.GL_LIGHTING); -@@ -206,31 +257,31 @@ - Tessellator var10 = Tessellator.instance; - var10.startDrawingQuads(); - var10.setColorRGBA(255, 255, 255, 32); -- double var11 = (double)(-var1.width / 2.0F); -- double var13 = (double)(-var1.width / 2.0F); -- double var15 = (double)(var1.width / 2.0F); -- double var17 = (double)(-var1.width / 2.0F); -- double var19 = (double)(-var1.width / 2.0F); -- double var21 = (double)(var1.width / 2.0F); -- double var23 = (double)(var1.width / 2.0F); -- double var25 = (double)(var1.width / 2.0F); -- double var27 = (double)var1.height; -- var10.addVertex(var2 + var11, var4 + var27, var6 + var13); -- var10.addVertex(var2 + var11, var4, var6 + var13); -- var10.addVertex(var2 + var15, var4, var6 + var17); -- var10.addVertex(var2 + var15, var4 + var27, var6 + var17); -- var10.addVertex(var2 + var23, var4 + var27, var6 + var25); -- var10.addVertex(var2 + var23, var4, var6 + var25); -- var10.addVertex(var2 + var19, var4, var6 + var21); -- var10.addVertex(var2 + var19, var4 + var27, var6 + var21); -- var10.addVertex(var2 + var15, var4 + var27, var6 + var17); -- var10.addVertex(var2 + var15, var4, var6 + var17); -- var10.addVertex(var2 + var23, var4, var6 + var25); -- var10.addVertex(var2 + var23, var4 + var27, var6 + var25); -- var10.addVertex(var2 + var19, var4 + var27, var6 + var21); -- var10.addVertex(var2 + var19, var4, var6 + var21); -- var10.addVertex(var2 + var11, var4, var6 + var13); -- var10.addVertex(var2 + var11, var4 + var27, var6 + var13); -+ double var11 = (double)(-par1Entity.width / 2.0F); -+ double var13 = (double)(-par1Entity.width / 2.0F); -+ double var15 = (double)(par1Entity.width / 2.0F); -+ double var17 = (double)(-par1Entity.width / 2.0F); -+ double var19 = (double)(-par1Entity.width / 2.0F); -+ double var21 = (double)(par1Entity.width / 2.0F); -+ double var23 = (double)(par1Entity.width / 2.0F); -+ double var25 = (double)(par1Entity.width / 2.0F); -+ double var27 = (double)par1Entity.height; -+ var10.addVertex(par2 + var11, par4 + var27, par6 + var13); -+ var10.addVertex(par2 + var11, par4, par6 + var13); -+ var10.addVertex(par2 + var15, par4, par6 + var17); -+ var10.addVertex(par2 + var15, par4 + var27, par6 + var17); -+ var10.addVertex(par2 + var23, par4 + var27, par6 + var25); -+ var10.addVertex(par2 + var23, par4, par6 + var25); -+ var10.addVertex(par2 + var19, par4, par6 + var21); -+ var10.addVertex(par2 + var19, par4 + var27, par6 + var21); -+ var10.addVertex(par2 + var15, par4 + var27, par6 + var17); -+ var10.addVertex(par2 + var15, par4, par6 + var17); -+ var10.addVertex(par2 + var23, par4, par6 + var25); -+ var10.addVertex(par2 + var23, par4 + var27, par6 + var25); -+ var10.addVertex(par2 + var19, par4 + var27, par6 + var21); -+ var10.addVertex(par2 + var19, par4, par6 + var21); -+ var10.addVertex(par2 + var11, par4, par6 + var13); -+ var10.addVertex(par2 + var11, par4 + var27, par6 + var13); - var10.draw(); - GL11.glPopMatrix(); - GL11.glEnable(GL11.GL_TEXTURE_2D); -@@ -240,28 +291,33 @@ - GL11.glDepthMask(true); - } - -- public void set(World var1) { -- this.worldObj = var1; -+ /** -+ * World sets this RenderManager's worldObj to the world provided -+ */ -+ public void set(World par1World) { -+ this.worldObj = par1World; - } - -- public double getDistanceToCamera(double var1, double var3, double var5) { -- double var7 = var1 - this.viewerPosX; -- double var9 = var3 - this.viewerPosY; -- double var11 = var5 - this.viewerPosZ; -+ public double getDistanceToCamera(double par1, double par3, double par5) { -+ double var7 = par1 - this.viewerPosX; -+ double var9 = par3 - this.viewerPosY; -+ double var11 = par5 - this.viewerPosZ; - return var7 * var7 + var9 * var9 + var11 * var11; - } - -+ /** -+ * Returns the font renderer -+ */ - public FontRenderer getFontRenderer() { - return this.fontRenderer; - } - -- public void updateIcons(IconRegister var1) { -- Iterator var2 = this.q.values().iterator(); -+ public void updateIcons(IconRegister par1IconRegister) { -+ Iterator var2 = this.entityRenderMap.values().iterator(); - -- while(var2.hasNext()) { -+ while (var2.hasNext()) { - Render var3 = (Render)var2.next(); -- var3.updateIcons(var1); -+ var3.updateIcons(par1IconRegister); - } -- - } - } ---- /dev/null -+++ org/spoutcraft/client/gui/controls/GuiCommandsSlot.java -@@ -1,0 +1,87 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.client.gui.controls; -+ -+import net.minecraft.src.FontRenderer; -+ -+import org.spoutcraft.api.gui.GenericListWidget; -+import org.spoutcraft.api.gui.ListWidget; -+import org.spoutcraft.api.gui.ListWidgetItem; -+import org.spoutcraft.client.SpoutClient; -+import org.spoutcraft.client.controls.Shortcut; -+ -+public class GuiCommandsSlot extends GenericListWidget { -+ GuiEditShortcut parent; -+ Shortcut shortcut; -+ -+ public GuiCommandsSlot(GuiEditShortcut parent) { -+ this.parent = parent; -+ this.shortcut = parent.getShortcut(); -+ updateItems(); -+ } -+ -+ public void updateItems() { -+ clear(); -+ for (String cmd:shortcut.getCommands()) { -+ addItem(new CommandLWI(cmd)); -+ } -+ } -+ -+ @Override -+ public void onSelected(int item, boolean doubleClick) { -+ if (doubleClick) { -+ parent.editCommand(item); -+ } -+ parent.updateButtons(); -+ } -+ -+ private class CommandLWI implements ListWidgetItem { -+ ListWidget widget; -+ String cmd; -+ public CommandLWI(String cmd) { -+ this.cmd = cmd; -+ } -+ -+ public void setListWidget(ListWidget widget) { -+ this.widget = widget; -+ } -+ -+ public ListWidget getListWidget() { -+ return widget; -+ } -+ -+ public int getHeight() { -+ return 23; -+ } -+ -+ public void render(int x, int y, int width, int height) { -+ FontRenderer font = SpoutClient.getHandle().fontRenderer; -+ parent.drawString(font, cmd, x + 2, y + 2, 0xffffff); -+ if (cmd.startsWith("/")) { -+ parent.drawString(font, "Command", x + 2, y + 13, 0xaaaaaa); -+ } else { -+ parent.drawString(font, "Chat Message", x + 2, y + 13, 0xaaaaaa); -+ } -+ } -+ -+ public void onClick(int x, int y, boolean d) { -+ } -+ } -+} ---- /dev/null -+++ org/spoutcraft/client/packet/PacketBlockData.java -@@ -1,0 +1,136 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.client.packet; -+ -+import java.io.IOException; -+import java.nio.ByteBuffer; -+import java.util.zip.DataFormatException; -+import java.util.zip.Deflater; -+import java.util.zip.Inflater; -+ -+import org.apache.commons.io.output.ByteArrayOutputStream; -+ -+import org.spoutcraft.api.io.SpoutInputStream; -+import org.spoutcraft.api.io.SpoutOutputStream; -+import org.spoutcraft.api.material.Block; -+import org.spoutcraft.api.material.MaterialData; -+ -+public class PacketBlockData implements CompressablePacket { -+ byte[] data; -+ boolean compressed = false; -+ public PacketBlockData() { -+ } -+ -+ public void compress() { -+ if (!compressed) { -+ Deflater deflater = new Deflater(); -+ deflater.setInput(data); -+ deflater.setLevel(Deflater.BEST_COMPRESSION); -+ deflater.finish(); -+ ByteArrayOutputStream bos = new ByteArrayOutputStream(data.length); -+ byte[] buffer = new byte[1024]; -+ while (!deflater.finished()) { -+ int bytesCompressed = deflater.deflate(buffer); -+ bos.write(buffer, 0, bytesCompressed); -+ } -+ try { -+ bos.close(); -+ } catch (IOException e) { -+ e.printStackTrace(); -+ } -+ data = bos.toByteArray(); -+ compressed = true; -+ } -+ } -+ -+ public void decompress() { -+ if (compressed) { -+ Inflater decompressor = new Inflater(); -+ decompressor.setInput(data); -+ -+ ByteArrayOutputStream bos = new ByteArrayOutputStream(data.length); -+ -+ byte[] buf = new byte[1024]; -+ while (!decompressor.finished()) { -+ try { -+ int count = decompressor.inflate(buf); -+ bos.write(buf, 0, count); -+ } catch (DataFormatException e) { -+ } -+ } -+ try { -+ bos.close(); -+ } catch (IOException e) { -+ } -+ -+ data = bos.toByteArray(); -+ } -+ } -+ -+ public boolean isCompressed() { -+ return compressed; -+ } -+ -+ public void readData(SpoutInputStream input) throws IOException { -+ int size = input.readInt(); -+ compressed = input.readBoolean(); -+ if (size > 0) { -+ data = new byte[size]; -+ input.read(data); -+ } -+ } -+ -+ public void writeData(SpoutOutputStream output) throws IOException { -+ output.writeInt(data == null ? 0 : data.length); -+ output.writeBoolean(compressed); -+ if (data != null) { -+ output.write(data); -+ } -+ } -+ -+ public void run(int playerId) { -+ if (data != null) { -+ ByteBuffer result = ByteBuffer.allocate(data.length).put(data); -+ for (int i = 0; i < data.length / 15; i++) { -+ int index = i * 15; -+ int id = result.get(index); -+ short rawData = result.get(index+1); -+ Block block = MaterialData.getBlock(id, rawData); -+ if (block != null) { -+ block.setHardness(result.getFloat(index+2)); -+ block.setLightLevel(result.getInt(index+6)); -+ block.setFriction(result.getFloat(index+10)); -+ block.setOpaque(result.get(index+14) != 0); -+ } -+ } -+ } -+ } -+ -+ public void failure(int playerId) { -+ } -+ -+ public PacketType getPacketType() { -+ return PacketType.PacketBlockData; -+ } -+ -+ public int getVersion() { -+ return 0; -+ } -+} ---- net/minecraft/src/Packet103SetSlot.java -+++ net/minecraft/src/Packet103SetSlot.java -@@ -5,35 +5,52 @@ - import java.io.IOException; - - public class Packet103SetSlot extends Packet { -+ -+ /** The window which is being updated. 0 for player inventory */ - public int windowId; -+ -+ /** Slot that should be updated */ - public int itemSlot; -+ -+ /** Item stack */ - public ItemStack myItemStack; - -- public Packet103SetSlot() { -- } -- -- public Packet103SetSlot(int var1, int var2, ItemStack var3) { -- this.windowId = var1; -- this.itemSlot = var2; -- this.myItemStack = var3 == null ? var3 : var3.copy(); -- } -- -- public void processPacket(NetHandler var1) { -- var1.handleSetSlot(this); -- } -- -- public void readPacketData(DataInput var1) throws IOException { -- this.windowId = var1.readByte(); -- this.itemSlot = var1.readShort(); -- this.myItemStack = readItemStack(var1); -- } -- -- public void writePacketData(DataOutput var1) throws IOException { -- var1.writeByte(this.windowId); -- var1.writeShort(this.itemSlot); -- writeItemStack(this.myItemStack, var1); -- } -- -+ public Packet103SetSlot() {} -+ -+ public Packet103SetSlot(int par1, int par2, ItemStack par3ItemStack) { -+ this.windowId = par1; -+ this.itemSlot = par2; -+ this.myItemStack = par3ItemStack == null ? par3ItemStack : par3ItemStack.copy(); -+ } -+ -+ /** -+ * Passes this Packet on to the NetHandler for processing. -+ */ -+ public void processPacket(NetHandler par1NetHandler) { -+ par1NetHandler.handleSetSlot(this); -+ } -+ -+ /** -+ * Abstract. Reads the raw packet data from the data stream. -+ */ -+ public void readPacketData(DataInput par1DataInput) throws IOException { -+ this.windowId = par1DataInput.readByte(); -+ this.itemSlot = par1DataInput.readShort(); -+ this.myItemStack = readItemStack(par1DataInput); -+ } -+ -+ /** -+ * Abstract. Writes the raw packet data to the data stream. -+ */ -+ public void writePacketData(DataOutput par1DataOutput) throws IOException { -+ par1DataOutput.writeByte(this.windowId); -+ par1DataOutput.writeShort(this.itemSlot); -+ writeItemStack(this.myItemStack, par1DataOutput); -+ } -+ -+ /** -+ * Abstract. Return the size of the packet (not counting the header). -+ */ - public int getPacketSize() { - return 8; - } ---- net/minecraft/src/BlockEndPortalFrame.java -+++ net/minecraft/src/BlockEndPortalFrame.java -@@ -7,67 +7,106 @@ - private Icon field_94400_a; - private Icon field_94399_b; - -- public BlockEndPortalFrame(int var1) { -- super(var1, Material.rock); -- } -- -- public Icon getIcon(int var1, int var2) { -- return var1 == 1 ? this.field_94400_a : (var1 == 0 ? Block.whiteStone.getBlockTextureFromSide(var1) : this.blockIcon); -- } -- -- public void registerIcons(IconRegister var1) { -- this.blockIcon = var1.registerIcon(this.getTextureName() + "_side"); -- this.field_94400_a = var1.registerIcon(this.getTextureName() + "_top"); -- this.field_94399_b = var1.registerIcon(this.getTextureName() + "_eye"); -+ public BlockEndPortalFrame(int par1) { -+ super(par1, Material.rock); -+ } -+ -+ /** -+ * From the specified side and block metadata retrieves the blocks texture. Args: side, metadata -+ */ -+ public Icon getIcon(int par1, int par2) { -+ return par1 == 1 ? this.field_94400_a : (par1 == 0 ? Block.whiteStone.getBlockTextureFromSide(par1) : this.blockIcon); -+ } -+ -+ /** -+ * When this method is called, your block should register all the icons it needs with the given IconRegister. This is -+ * the only chance you get to register icons. -+ */ -+ public void registerIcons(IconRegister par1IconRegister) { -+ this.blockIcon = par1IconRegister.registerIcon(this.getTextureName() + "_side"); -+ this.field_94400_a = par1IconRegister.registerIcon(this.getTextureName() + "_top"); -+ this.field_94399_b = par1IconRegister.registerIcon(this.getTextureName() + "_eye"); - } - - public Icon func_94398_p() { - return this.field_94399_b; - } - -+ /** -+ * Is this block (a) opaque and (b) a full 1m cube? This determines whether or not to render the shared face of two -+ * adjacent blocks and also whether the player can attach torches, redstone wire, etc to this block. -+ */ - public boolean isOpaqueCube() { - return false; - } - -+ /** -+ * The type of render function that is called for this block -+ */ - public int getRenderType() { - return 26; - } - -+ /** -+ * Sets the block's bounds for rendering it as an item -+ */ - public void setBlockBoundsForItemRender() { -- this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 13.0F / 16.0F, 1.0F); -+ this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.8125F, 1.0F); - } - -- public void addCollisionBoxesToList(World var1, int var2, int var3, int var4, AxisAlignedBB var5, List var6, Entity var7) { -- this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 13.0F / 16.0F, 1.0F); -- super.addCollisionBoxesToList(var1, var2, var3, var4, var5, var6, var7); -- int var8 = var1.getBlockMetadata(var2, var3, var4); -- if(isEnderEyeInserted(var8)) { -- this.setBlockBounds(5.0F / 16.0F, 13.0F / 16.0F, 5.0F / 16.0F, 11.0F / 16.0F, 1.0F, 11.0F / 16.0F); -- super.addCollisionBoxesToList(var1, var2, var3, var4, var5, var6, var7); -+ /** -+ * Adds all intersecting collision boxes to a list. (Be sure to only add boxes to the list if they intersect the mask.) -+ * Parameters: World, X, Y, Z, mask, list, colliding entity -+ */ -+ public void addCollisionBoxesToList(World par1World, int par2, int par3, int par4, AxisAlignedBB par5AxisAlignedBB, List par6List, Entity par7Entity) { -+ this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.8125F, 1.0F); -+ super.addCollisionBoxesToList(par1World, par2, par3, par4, par5AxisAlignedBB, par6List, par7Entity); -+ int var8 = par1World.getBlockMetadata(par2, par3, par4); -+ -+ if (isEnderEyeInserted(var8)) { -+ this.setBlockBounds(0.3125F, 0.8125F, 0.3125F, 0.6875F, 1.0F, 0.6875F); -+ super.addCollisionBoxesToList(par1World, par2, par3, par4, par5AxisAlignedBB, par6List, par7Entity); - } - - this.setBlockBoundsForItemRender(); - } - -- public static boolean isEnderEyeInserted(int var0) { -- return (var0 & 4) != 0; -+ /** -+ * checks if an ender eye has been inserted into the frame block. parameters: metadata -+ */ -+ public static boolean isEnderEyeInserted(int par0) { -+ return (par0 & 4) != 0; - } - -- public int idDropped(int var1, Random var2, int var3) { -+ /** -+ * Returns the ID of the items to drop on destruction. -+ */ -+ public int idDropped(int par1, Random par2Random, int par3) { - return 0; - } - -- public void onBlockPlacedBy(World var1, int var2, int var3, int var4, EntityLivingBase var5, ItemStack var6) { -- int var7 = ((MathHelper.floor_double((double)(var5.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3) + 2) % 4; -- var1.setBlockMetadata(var2, var3, var4, var7, 2); -+ /** -+ * Called when the block is placed in the world. -+ */ -+ public void onBlockPlacedBy(World par1World, int par2, int par3, int par4, EntityLivingBase par5EntityLivingBase, ItemStack par6ItemStack) { -+ int var7 = ((MathHelper.floor_double((double)(par5EntityLivingBase.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3) + 2) % 4; -+ par1World.setBlockMetadataWithNotify(par2, par3, par4, var7, 2); - } - -+ /** -+ * If this returns true, then comparators facing away from this block will use the value from -+ * getComparatorInputOverride instead of the actual redstone signal strength. -+ */ - public boolean hasComparatorInputOverride() { - return true; - } - -- public int getComparatorInputOverride(World var1, int var2, int var3, int var4, int var5) { -- int var6 = var1.getBlockMetadata(var2, var3, var4); -+ /** -+ * If hasComparatorInputOverride returns true, the return value from this is used instead of the redstone signal -+ * strength when this block inputs to a comparator. -+ */ -+ public int getComparatorInputOverride(World par1World, int par2, int par3, int par4, int par5) { -+ int var6 = par1World.getBlockMetadata(par2, par3, par4); - return isEnderEyeInserted(var6) ? 15 : 0; - } - } ---- net/minecraft/src/EntityAICreeperSwell.java -+++ net/minecraft/src/EntityAICreeperSwell.java -@@ -1,34 +1,52 @@ - package net.minecraft.src; - - public class EntityAICreeperSwell extends EntityAIBase { -+ -+ /** The creeper that is swelling. */ - EntityCreeper swellingCreeper; -+ -+ /** -+ * The creeper's attack target. This is used for the changing of the creeper's state. -+ */ - EntityLivingBase creeperAttackTarget; - -- public EntityAICreeperSwell(EntityCreeper var1) { -- this.swellingCreeper = var1; -+ public EntityAICreeperSwell(EntityCreeper par1EntityCreeper) { -+ this.swellingCreeper = par1EntityCreeper; - this.setMutexBits(1); - } - -+ /** -+ * Returns whether the EntityAIBase should begin execution. -+ */ - public boolean shouldExecute() { - EntityLivingBase var1 = this.swellingCreeper.getAttackTarget(); - return this.swellingCreeper.getCreeperState() > 0 || var1 != null && this.swellingCreeper.getDistanceSqToEntity(var1) < 9.0D; - } - -+ /** -+ * Execute a one shot task or start executing a continuous task -+ */ - public void startExecuting() { - this.swellingCreeper.getNavigator().clearPathEntity(); - this.creeperAttackTarget = this.swellingCreeper.getAttackTarget(); - } - -+ /** -+ * Resets the task -+ */ - public void resetTask() { - this.creeperAttackTarget = null; - } - -+ /** -+ * Updates the task -+ */ - public void updateTask() { -- if(this.creeperAttackTarget == null) { -- this.swellingCreeper.setCreeperState(-1); -- } else if(this.swellingCreeper.getDistanceSqToEntity(this.creeperAttackTarget) > 49.0D) { -- this.swellingCreeper.setCreeperState(-1); -- } else if(!this.swellingCreeper.getEntitySenses().canSee(this.creeperAttackTarget)) { -+ if (this.creeperAttackTarget == null) { -+ this.swellingCreeper.setCreeperState(-1); -+ } else if (this.swellingCreeper.getDistanceSqToEntity(this.creeperAttackTarget) > 49.0D) { -+ this.swellingCreeper.setCreeperState(-1); -+ } else if (!this.swellingCreeper.getEntitySenses().canSee(this.creeperAttackTarget)) { - this.swellingCreeper.setCreeperState(-1); - } else { - this.swellingCreeper.setCreeperState(1); ---- net/minecraft/src/VillageCollection.java -+++ net/minecraft/src/VillageCollection.java -@@ -6,46 +6,56 @@ - - public class VillageCollection extends WorldSavedData { - private World worldObj; -- private final List b = new ArrayList(); -- private final List c = new ArrayList(); -- private final List d = new ArrayList(); -+ -+ /** -+ * This is a black hole. You can add data to this list through a public interface, but you can't query that information -+ * in any way and it's not used internally either. -+ */ -+ private final List villagerPositionsList = new ArrayList(); -+ private final List newDoors = new ArrayList(); -+ private final List villageList = new ArrayList(); - private int tickCounter; - -- public VillageCollection(String var1) { -- super(var1); -+ public VillageCollection(String par1Str) { -+ super(par1Str); - } - -- public VillageCollection(World var1) { -+ public VillageCollection(World par1World) { - super("villages"); -- this.worldObj = var1; -+ this.worldObj = par1World; - this.markDirty(); - } - -- public void func_82566_a(World var1) { -- this.worldObj = var1; -- Iterator var2 = this.d.iterator(); -+ public void func_82566_a(World par1World) { -+ this.worldObj = par1World; -+ Iterator var2 = this.villageList.iterator(); - -- while(var2.hasNext()) { -+ while (var2.hasNext()) { - Village var3 = (Village)var2.next(); -- var3.func_82691_a(var1); -+ var3.func_82691_a(par1World); - } -- - } - -- public void addVillagerPosition(int var1, int var2, int var3) { -- if(this.b.size() <= 64) { -- if(!this.isVillagerPositionPresent(var1, var2, var3)) { -- this.b.add(new ChunkCoordinates(var1, var2, var3)); -+ /** -+ * This is a black hole. You can add data to this list through a public interface, but you can't query that information -+ * in any way and it's not used internally either. -+ */ -+ public void addVillagerPosition(int par1, int par2, int par3) { -+ if (this.villagerPositionsList.size() <= 64) { -+ if (!this.isVillagerPositionPresent(par1, par2, par3)) { -+ this.villagerPositionsList.add(new ChunkCoordinates(par1, par2, par3)); - } -- - } - } - -+ /** -+ * Runs a single tick for the village collection -+ */ - public void tick() { - ++this.tickCounter; -- Iterator var1 = this.d.iterator(); -+ Iterator var1 = this.villageList.iterator(); - -- while(var1.hasNext()) { -+ while (var1.hasNext()) { - Village var2 = (Village)var1.next(); - var2.tick(this.tickCounter); - } -@@ -53,40 +63,48 @@ - this.removeAnnihilatedVillages(); - this.dropOldestVillagerPosition(); - this.addNewDoorsToVillageOrCreateVillage(); -- if(this.tickCounter % 400 == 0) { -+ -+ if (this.tickCounter % 400 == 0) { - this.markDirty(); - } -- - } - - private void removeAnnihilatedVillages() { -- Iterator var1 = this.d.iterator(); -+ Iterator var1 = this.villageList.iterator(); - -- while(var1.hasNext()) { -+ while (var1.hasNext()) { - Village var2 = (Village)var1.next(); -- if(var2.isAnnihilated()) { -+ -+ if (var2.isAnnihilated()) { - var1.remove(); - this.markDirty(); - } - } -- - } - -+ /** -+ * Get a list of villages. -+ */ - public List getVillageList() { -- return this.d; -+ return this.villageList; - } - -- public Village findNearestVillage(int var1, int var2, int var3, int var4) { -+ /** -+ * Finds the nearest village, but only the given coordinates are withing it's bounding box plus the given the distance. -+ */ -+ public Village findNearestVillage(int par1, int par2, int par3, int par4) { - Village var5 = null; - float var6 = Float.MAX_VALUE; -- Iterator var7 = this.d.iterator(); -+ Iterator var7 = this.villageList.iterator(); - -- while(var7.hasNext()) { -+ while (var7.hasNext()) { - Village var8 = (Village)var7.next(); -- float var9 = var8.getCenter().getDistanceSquared(var1, var2, var3); -- if(var9 < var6) { -- float var10 = (float)(var4 + var8.getVillageRadius()); -- if(var9 <= var10 * var10) { -+ float var9 = var8.getCenter().getDistanceSquared(par1, par2, par3); -+ -+ if (var9 < var6) { -+ float var10 = (float)(par4 + var8.getVillageRadius()); -+ -+ if (var9 <= var10 * var10) { - var5 = var8; - var6 = var9; - } -@@ -97,50 +115,60 @@ - } - - private void dropOldestVillagerPosition() { -- if(!this.b.isEmpty()) { -- this.addUnassignedWoodenDoorsAroundToNewDoorsList((ChunkCoordinates)this.b.remove(0)); -+ if (!this.villagerPositionsList.isEmpty()) { -+ this.addUnassignedWoodenDoorsAroundToNewDoorsList((ChunkCoordinates)this.villagerPositionsList.remove(0)); - } - } - - private void addNewDoorsToVillageOrCreateVillage() { -- for(int var1 = 0; var1 < this.c.size(); ++var1) { -- VillageDoorInfo var2 = (VillageDoorInfo)this.c.get(var1); -+ int var1 = 0; -+ -+ while (var1 < this.newDoors.size()) { -+ VillageDoorInfo var2 = (VillageDoorInfo)this.newDoors.get(var1); - boolean var3 = false; -- Iterator var4 = this.d.iterator(); -- -- while(var4.hasNext()) { -- Village var5 = (Village)var4.next(); -- int var6 = (int)var5.getCenter().getDistanceSquared(var2.posX, var2.posY, var2.posZ); -- int var7 = 32 + var5.getVillageRadius(); -- if(var6 <= var7 * var7) { -+ Iterator var4 = this.villageList.iterator(); -+ -+ while (true) { -+ if (var4.hasNext()) { -+ Village var5 = (Village)var4.next(); -+ int var6 = (int)var5.getCenter().getDistanceSquared(var2.posX, var2.posY, var2.posZ); -+ int var7 = 32 + var5.getVillageRadius(); -+ -+ if (var6 > var7 * var7) { -+ continue; -+ } -+ - var5.addVillageDoorInfo(var2); - var3 = true; -- break; -- } -- } -- -- if(!var3) { -- Village var8 = new Village(this.worldObj); -- var8.addVillageDoorInfo(var2); -- this.d.add(var8); -- this.markDirty(); -+ } -+ -+ if (!var3) { -+ Village var8 = new Village(this.worldObj); -+ var8.addVillageDoorInfo(var2); -+ this.villageList.add(var8); -+ this.markDirty(); -+ } -+ -+ ++var1; -+ break; - } - } - -- this.c.clear(); -+ this.newDoors.clear(); - } - -- private void addUnassignedWoodenDoorsAroundToNewDoorsList(ChunkCoordinates var1) { -+ private void addUnassignedWoodenDoorsAroundToNewDoorsList(ChunkCoordinates par1ChunkCoordinates) { - byte var2 = 16; - byte var3 = 4; - byte var4 = 16; - -- for(int var5 = var1.posX - var2; var5 < var1.posX + var2; ++var5) { -- for(int var6 = var1.posY - var3; var6 < var1.posY + var3; ++var6) { -- for(int var7 = var1.posZ - var4; var7 < var1.posZ + var4; ++var7) { -- if(this.isWoodenDoorAt(var5, var6, var7)) { -+ for (int var5 = par1ChunkCoordinates.posX - var2; var5 < par1ChunkCoordinates.posX + var2; ++var5) { -+ for (int var6 = par1ChunkCoordinates.posY - var3; var6 < par1ChunkCoordinates.posY + var3; ++var6) { -+ for (int var7 = par1ChunkCoordinates.posZ - var4; var7 < par1ChunkCoordinates.posZ + var4; ++var7) { -+ if (this.isWoodenDoorAt(var5, var6, var7)) { - VillageDoorInfo var8 = this.getVillageDoorAt(var5, var6, var7); -- if(var8 == null) { -+ -+ if (var8 == null) { - this.addDoorToNewListIfAppropriate(var5, var6, var7); - } else { - var8.lastActivityTimestamp = this.tickCounter; -@@ -149,125 +177,129 @@ - } - } - } -- - } - -- private VillageDoorInfo getVillageDoorAt(int var1, int var2, int var3) { -- Iterator var4 = this.c.iterator(); -- -+ private VillageDoorInfo getVillageDoorAt(int par1, int par2, int par3) { -+ Iterator var4 = this.newDoors.iterator(); - VillageDoorInfo var5; -- do { -- if(!var4.hasNext()) { -- var4 = this.d.iterator(); - -+ do { -+ if (!var4.hasNext()) { -+ var4 = this.villageList.iterator(); - VillageDoorInfo var6; -+ - do { -- if(!var4.hasNext()) { -+ if (!var4.hasNext()) { - return null; - } - - Village var7 = (Village)var4.next(); -- var6 = var7.getVillageDoorAt(var1, var2, var3); -- } while(var6 == null); -+ var6 = var7.getVillageDoorAt(par1, par2, par3); -+ } while (var6 == null); - - return var6; - } - - var5 = (VillageDoorInfo)var4.next(); -- } while(var5.posX != var1 || var5.posZ != var3 || Math.abs(var5.posY - var2) > 1); -+ } while (var5.posX != par1 || var5.posZ != par3 || Math.abs(var5.posY - par2) > 1); - - return var5; - } - -- private void addDoorToNewListIfAppropriate(int var1, int var2, int var3) { -- int var4 = ((BlockDoor)Block.doorWood).getDoorOrientation(this.worldObj, var1, var2, var3); -+ private void addDoorToNewListIfAppropriate(int par1, int par2, int par3) { -+ int var4 = ((BlockDoor)Block.doorWood).getDoorOrientation(this.worldObj, par1, par2, par3); - int var5; - int var6; -- if(var4 != 0 && var4 != 2) { -+ -+ if (var4 != 0 && var4 != 2) { - var5 = 0; - -- for(var6 = -5; var6 < 0; ++var6) { -- if(this.worldObj.canBlockSeeTheSky(var1, var2, var3 + var6)) { -+ for (var6 = -5; var6 < 0; ++var6) { -+ if (this.worldObj.canBlockSeeTheSky(par1, par2, par3 + var6)) { - --var5; - } - } - -- for(var6 = 1; var6 <= 5; ++var6) { -- if(this.worldObj.canBlockSeeTheSky(var1, var2, var3 + var6)) { -+ for (var6 = 1; var6 <= 5; ++var6) { -+ if (this.worldObj.canBlockSeeTheSky(par1, par2, par3 + var6)) { - ++var5; - } - } - -- if(var5 != 0) { -- this.c.add(new VillageDoorInfo(var1, var2, var3, 0, var5 > 0 ? -2 : 2, this.tickCounter)); -+ if (var5 != 0) { -+ this.newDoors.add(new VillageDoorInfo(par1, par2, par3, 0, var5 > 0 ? -2 : 2, this.tickCounter)); - } - } else { - var5 = 0; - -- for(var6 = -5; var6 < 0; ++var6) { -- if(this.worldObj.canBlockSeeTheSky(var1 + var6, var2, var3)) { -+ for (var6 = -5; var6 < 0; ++var6) { -+ if (this.worldObj.canBlockSeeTheSky(par1 + var6, par2, par3)) { - --var5; - } - } - -- for(var6 = 1; var6 <= 5; ++var6) { -- if(this.worldObj.canBlockSeeTheSky(var1 + var6, var2, var3)) { -+ for (var6 = 1; var6 <= 5; ++var6) { -+ if (this.worldObj.canBlockSeeTheSky(par1 + var6, par2, par3)) { - ++var5; - } - } - -- if(var5 != 0) { -- this.c.add(new VillageDoorInfo(var1, var2, var3, var5 > 0 ? -2 : 2, 0, this.tickCounter)); -+ if (var5 != 0) { -+ this.newDoors.add(new VillageDoorInfo(par1, par2, par3, var5 > 0 ? -2 : 2, 0, this.tickCounter)); - } - } -- - } - -- private boolean isVillagerPositionPresent(int var1, int var2, int var3) { -- Iterator var4 = this.b.iterator(); -- -+ private boolean isVillagerPositionPresent(int par1, int par2, int par3) { -+ Iterator var4 = this.villagerPositionsList.iterator(); - ChunkCoordinates var5; -+ - do { -- if(!var4.hasNext()) { -+ if (!var4.hasNext()) { - return false; - } - - var5 = (ChunkCoordinates)var4.next(); -- } while(var5.posX != var1 || var5.posY != var2 || var5.posZ != var3); -+ } while (var5.posX != par1 || var5.posY != par2 || var5.posZ != par3); - - return true; - } - -- private boolean isWoodenDoorAt(int var1, int var2, int var3) { -- int var4 = this.worldObj.getBlockId(var1, var2, var3); -+ private boolean isWoodenDoorAt(int par1, int par2, int par3) { -+ int var4 = this.worldObj.getBlockId(par1, par2, par3); - return var4 == Block.doorWood.blockID; - } - -- public void readFromNBT(NBTTagCompound var1) { -- this.tickCounter = var1.getInteger("Tick"); -- NBTTagList var2 = var1.getTagList("Villages"); -+ /** -+ * reads in data from the NBTTagCompound into this MapDataBase -+ */ -+ public void readFromNBT(NBTTagCompound par1NBTTagCompound) { -+ this.tickCounter = par1NBTTagCompound.getInteger("Tick"); -+ NBTTagList var2 = par1NBTTagCompound.getTagList("Villages"); - -- for(int var3 = 0; var3 < var2.tagCount(); ++var3) { -+ for (int var3 = 0; var3 < var2.tagCount(); ++var3) { - NBTTagCompound var4 = (NBTTagCompound)var2.tagAt(var3); - Village var5 = new Village(); - var5.readVillageDataFromNBT(var4); -- this.d.add(var5); -+ this.villageList.add(var5); - } -- - } - -- public void writeToNBT(NBTTagCompound var1) { -- var1.setInteger("Tick", this.tickCounter); -+ /** -+ * write data to NBTTagCompound from this MapDataBase, similar to Entities and TileEntities -+ */ -+ public void writeToNBT(NBTTagCompound par1NBTTagCompound) { -+ par1NBTTagCompound.setInteger("Tick", this.tickCounter); - NBTTagList var2 = new NBTTagList("Villages"); -- Iterator var3 = this.d.iterator(); -+ Iterator var3 = this.villageList.iterator(); - -- while(var3.hasNext()) { -+ while (var3.hasNext()) { - Village var4 = (Village)var3.next(); - NBTTagCompound var5 = new NBTTagCompound("Village"); - var4.writeVillageDataToNBT(var5); - var2.appendTag(var5); - } - -- var1.setTag("Villages", var2); -+ par1NBTTagCompound.setTag("Villages", var2); - } - } ---- net/minecraft/src/WorldGenHugeTrees.java -+++ net/minecraft/src/WorldGenHugeTrees.java -@@ -3,40 +3,50 @@ - import java.util.Random; - - public class WorldGenHugeTrees extends WorldGenerator { -+ -+ /** The base height of the tree */ - private final int baseHeight; -+ -+ /** Sets the metadata for the wood blocks used */ - private final int woodMetadata; -+ -+ /** Sets the metadata for the leaves used in huge trees */ - private final int leavesMetadata; - -- public WorldGenHugeTrees(boolean var1, int var2, int var3, int var4) { -- super(var1); -- this.baseHeight = var2; -- this.woodMetadata = var3; -- this.leavesMetadata = var4; -+ public WorldGenHugeTrees(boolean par1, int par2, int par3, int par4) { -+ super(par1); -+ this.baseHeight = par2; -+ this.woodMetadata = par3; -+ this.leavesMetadata = par4; - } - -- public boolean generate(World var1, Random var2, int var3, int var4, int var5) { -- int var6 = var2.nextInt(3) + this.baseHeight; -+ public boolean generate(World par1World, Random par2Random, int par3, int par4, int par5) { -+ int var6 = par2Random.nextInt(3) + this.baseHeight; - boolean var7 = true; -- if(var4 >= 1 && var4 + var6 + 1 <= 256) { -+ -+ if (par4 >= 1 && par4 + var6 + 1 <= 256) { - int var8; - int var10; - int var11; - int var12; -- for(var8 = var4; var8 <= var4 + 1 + var6; ++var8) { -+ -+ for (var8 = par4; var8 <= par4 + 1 + var6; ++var8) { - byte var9 = 2; -- if(var8 == var4) { -+ -+ if (var8 == par4) { - var9 = 1; - } - -- if(var8 >= var4 + 1 + var6 - 2) { -+ if (var8 >= par4 + 1 + var6 - 2) { - var9 = 2; - } - -- for(var10 = var3 - var9; var10 <= var3 + var9 && var7; ++var10) { -- for(var11 = var5 - var9; var11 <= var5 + var9 && var7; ++var11) { -- if(var8 >= 0 && var8 < 256) { -- var12 = var1.getBlockId(var10, var8, var11); -- if(var12 != 0 && var12 != Block.leaves.blockID && var12 != Block.grass.blockID && var12 != Block.dirt.blockID && var12 != Block.wood.blockID && var12 != Block.sapling.blockID) { -+ for (var10 = par3 - var9; var10 <= par3 + var9 && var7; ++var10) { -+ for (var11 = par5 - var9; var11 <= par5 + var9 && var7; ++var11) { -+ if (var8 >= 0 && var8 < 256) { -+ var12 = par1World.getBlockId(var10, var8, var11); -+ -+ if (var12 != 0 && var12 != Block.leaves.blockID && var12 != Block.grass.blockID && var12 != Block.dirt.blockID && var12 != Block.wood.blockID && var12 != Block.sapling.blockID) { - var7 = false; - } - } else { -@@ -46,84 +56,93 @@ - } - } - -- if(!var7) { -+ if (!var7) { - return false; - } else { -- var8 = var1.getBlockId(var3, var4 - 1, var5); -- if((var8 == Block.grass.blockID || var8 == Block.dirt.blockID) && var4 < 256 - var6 - 1) { -- var1.setBlock(var3, var4 - 1, var5, Block.dirt.blockID, 0, 2); -- var1.setBlock(var3 + 1, var4 - 1, var5, Block.dirt.blockID, 0, 2); -- var1.setBlock(var3, var4 - 1, var5 + 1, Block.dirt.blockID, 0, 2); -- var1.setBlock(var3 + 1, var4 - 1, var5 + 1, Block.dirt.blockID, 0, 2); -- this.growLeaves(var1, var3, var5, var4 + var6, 2, var2); -- -- for(int var14 = var4 + var6 - 2 - var2.nextInt(4); var14 > var4 + var6 / 2; var14 -= 2 + var2.nextInt(4)) { -- float var15 = var2.nextFloat() * (float)Math.PI * 2.0F; -- var11 = var3 + (int)(0.5F + MathHelper.cos(var15) * 4.0F); -- var12 = var5 + (int)(0.5F + MathHelper.sin(var15) * 4.0F); -- this.growLeaves(var1, var11, var12, var14, 0, var2); -- -- for(int var13 = 0; var13 < 5; ++var13) { -- var11 = var3 + (int)(1.5F + MathHelper.cos(var15) * (float)var13); -- var12 = var5 + (int)(1.5F + MathHelper.sin(var15) * (float)var13); -- this.setBlockAndMetadata(var1, var11, var14 - 3 + var13 / 2, var12, Block.wood.blockID, this.woodMetadata); -+ var8 = par1World.getBlockId(par3, par4 - 1, par5); -+ -+ if ((var8 == Block.grass.blockID || var8 == Block.dirt.blockID) && par4 < 256 - var6 - 1) { -+ par1World.setBlock(par3, par4 - 1, par5, Block.dirt.blockID, 0, 2); -+ par1World.setBlock(par3 + 1, par4 - 1, par5, Block.dirt.blockID, 0, 2); -+ par1World.setBlock(par3, par4 - 1, par5 + 1, Block.dirt.blockID, 0, 2); -+ par1World.setBlock(par3 + 1, par4 - 1, par5 + 1, Block.dirt.blockID, 0, 2); -+ this.growLeaves(par1World, par3, par5, par4 + var6, 2, par2Random); -+ -+ for (int var14 = par4 + var6 - 2 - par2Random.nextInt(4); var14 > par4 + var6 / 2; var14 -= 2 + par2Random.nextInt(4)) { -+ float var15 = par2Random.nextFloat() * (float)Math.PI * 2.0F; -+ var11 = par3 + (int)(0.5F + MathHelper.cos(var15) * 4.0F); -+ var12 = par5 + (int)(0.5F + MathHelper.sin(var15) * 4.0F); -+ this.growLeaves(par1World, var11, var12, var14, 0, par2Random); -+ -+ for (int var13 = 0; var13 < 5; ++var13) { -+ var11 = par3 + (int)(1.5F + MathHelper.cos(var15) * (float)var13); -+ var12 = par5 + (int)(1.5F + MathHelper.sin(var15) * (float)var13); -+ this.setBlockAndMetadata(par1World, var11, var14 - 3 + var13 / 2, var12, Block.wood.blockID, this.woodMetadata); - } - } - -- for(var10 = 0; var10 < var6; ++var10) { -- var11 = var1.getBlockId(var3, var4 + var10, var5); -- if(var11 == 0 || var11 == Block.leaves.blockID) { -- this.setBlockAndMetadata(var1, var3, var4 + var10, var5, Block.wood.blockID, this.woodMetadata); -- if(var10 > 0) { -- if(var2.nextInt(3) > 0 && var1.isAirBlock(var3 - 1, var4 + var10, var5)) { -- this.setBlockAndMetadata(var1, var3 - 1, var4 + var10, var5, Block.vine.blockID, 8); -+ for (var10 = 0; var10 < var6; ++var10) { -+ var11 = par1World.getBlockId(par3, par4 + var10, par5); -+ -+ if (var11 == 0 || var11 == Block.leaves.blockID) { -+ this.setBlockAndMetadata(par1World, par3, par4 + var10, par5, Block.wood.blockID, this.woodMetadata); -+ -+ if (var10 > 0) { -+ if (par2Random.nextInt(3) > 0 && par1World.isAirBlock(par3 - 1, par4 + var10, par5)) { -+ this.setBlockAndMetadata(par1World, par3 - 1, par4 + var10, par5, Block.vine.blockID, 8); - } - -- if(var2.nextInt(3) > 0 && var1.isAirBlock(var3, var4 + var10, var5 - 1)) { -- this.setBlockAndMetadata(var1, var3, var4 + var10, var5 - 1, Block.vine.blockID, 1); -+ if (par2Random.nextInt(3) > 0 && par1World.isAirBlock(par3, par4 + var10, par5 - 1)) { -+ this.setBlockAndMetadata(par1World, par3, par4 + var10, par5 - 1, Block.vine.blockID, 1); - } - } - } - -- if(var10 < var6 - 1) { -- var11 = var1.getBlockId(var3 + 1, var4 + var10, var5); -- if(var11 == 0 || var11 == Block.leaves.blockID) { -- this.setBlockAndMetadata(var1, var3 + 1, var4 + var10, var5, Block.wood.blockID, this.woodMetadata); -- if(var10 > 0) { -- if(var2.nextInt(3) > 0 && var1.isAirBlock(var3 + 2, var4 + var10, var5)) { -- this.setBlockAndMetadata(var1, var3 + 2, var4 + var10, var5, Block.vine.blockID, 2); -- } -- -- if(var2.nextInt(3) > 0 && var1.isAirBlock(var3 + 1, var4 + var10, var5 - 1)) { -- this.setBlockAndMetadata(var1, var3 + 1, var4 + var10, var5 - 1, Block.vine.blockID, 1); -- } -- } -- } -- -- var11 = var1.getBlockId(var3 + 1, var4 + var10, var5 + 1); -- if(var11 == 0 || var11 == Block.leaves.blockID) { -- this.setBlockAndMetadata(var1, var3 + 1, var4 + var10, var5 + 1, Block.wood.blockID, this.woodMetadata); -- if(var10 > 0) { -- if(var2.nextInt(3) > 0 && var1.isAirBlock(var3 + 2, var4 + var10, var5 + 1)) { -- this.setBlockAndMetadata(var1, var3 + 2, var4 + var10, var5 + 1, Block.vine.blockID, 2); -- } -- -- if(var2.nextInt(3) > 0 && var1.isAirBlock(var3 + 1, var4 + var10, var5 + 2)) { -- this.setBlockAndMetadata(var1, var3 + 1, var4 + var10, var5 + 2, Block.vine.blockID, 4); -- } -- } -- } -- -- var11 = var1.getBlockId(var3, var4 + var10, var5 + 1); -- if(var11 == 0 || var11 == Block.leaves.blockID) { -- this.setBlockAndMetadata(var1, var3, var4 + var10, var5 + 1, Block.wood.blockID, this.woodMetadata); -- if(var10 > 0) { -- if(var2.nextInt(3) > 0 && var1.isAirBlock(var3 - 1, var4 + var10, var5 + 1)) { -- this.setBlockAndMetadata(var1, var3 - 1, var4 + var10, var5 + 1, Block.vine.blockID, 8); -- } -- -- if(var2.nextInt(3) > 0 && var1.isAirBlock(var3, var4 + var10, var5 + 2)) { -- this.setBlockAndMetadata(var1, var3, var4 + var10, var5 + 2, Block.vine.blockID, 4); -+ if (var10 < var6 - 1) { -+ var11 = par1World.getBlockId(par3 + 1, par4 + var10, par5); -+ -+ if (var11 == 0 || var11 == Block.leaves.blockID) { -+ this.setBlockAndMetadata(par1World, par3 + 1, par4 + var10, par5, Block.wood.blockID, this.woodMetadata); -+ -+ if (var10 > 0) { -+ if (par2Random.nextInt(3) > 0 && par1World.isAirBlock(par3 + 2, par4 + var10, par5)) { -+ this.setBlockAndMetadata(par1World, par3 + 2, par4 + var10, par5, Block.vine.blockID, 2); -+ } -+ -+ if (par2Random.nextInt(3) > 0 && par1World.isAirBlock(par3 + 1, par4 + var10, par5 - 1)) { -+ this.setBlockAndMetadata(par1World, par3 + 1, par4 + var10, par5 - 1, Block.vine.blockID, 1); -+ } -+ } -+ } -+ -+ var11 = par1World.getBlockId(par3 + 1, par4 + var10, par5 + 1); -+ -+ if (var11 == 0 || var11 == Block.leaves.blockID) { -+ this.setBlockAndMetadata(par1World, par3 + 1, par4 + var10, par5 + 1, Block.wood.blockID, this.woodMetadata); -+ -+ if (var10 > 0) { -+ if (par2Random.nextInt(3) > 0 && par1World.isAirBlock(par3 + 2, par4 + var10, par5 + 1)) { -+ this.setBlockAndMetadata(par1World, par3 + 2, par4 + var10, par5 + 1, Block.vine.blockID, 2); -+ } -+ -+ if (par2Random.nextInt(3) > 0 && par1World.isAirBlock(par3 + 1, par4 + var10, par5 + 2)) { -+ this.setBlockAndMetadata(par1World, par3 + 1, par4 + var10, par5 + 2, Block.vine.blockID, 4); -+ } -+ } -+ } -+ -+ var11 = par1World.getBlockId(par3, par4 + var10, par5 + 1); -+ -+ if (var11 == 0 || var11 == Block.leaves.blockID) { -+ this.setBlockAndMetadata(par1World, par3, par4 + var10, par5 + 1, Block.wood.blockID, this.woodMetadata); -+ -+ if (var10 > 0) { -+ if (par2Random.nextInt(3) > 0 && par1World.isAirBlock(par3 - 1, par4 + var10, par5 + 1)) { -+ this.setBlockAndMetadata(par1World, par3 - 1, par4 + var10, par5 + 1, Block.vine.blockID, 8); -+ } -+ -+ if (par2Random.nextInt(3) > 0 && par1World.isAirBlock(par3, par4 + var10, par5 + 2)) { -+ this.setBlockAndMetadata(par1World, par3, par4 + var10, par5 + 2, Block.vine.blockID, 4); - } - } - } -@@ -140,27 +159,28 @@ - } - } - -- private void growLeaves(World var1, int var2, int var3, int var4, int var5, Random var6) { -+ private void growLeaves(World par1World, int par2, int par3, int par4, int par5, Random par6Random) { - byte var7 = 2; - -- for(int var8 = var4 - var7; var8 <= var4; ++var8) { -- int var9 = var8 - var4; -- int var10 = var5 + 1 - var9; -- -- for(int var11 = var2 - var10; var11 <= var2 + var10 + 1; ++var11) { -- int var12 = var11 - var2; -- -- for(int var13 = var3 - var10; var13 <= var3 + var10 + 1; ++var13) { -- int var14 = var13 - var3; -- if((var12 >= 0 || var14 >= 0 || var12 * var12 + var14 * var14 <= var10 * var10) && (var12 <= 0 && var14 <= 0 || var12 * var12 + var14 * var14 <= (var10 + 1) * (var10 + 1)) && (var6.nextInt(4) != 0 || var12 * var12 + var14 * var14 <= (var10 - 1) * (var10 - 1))) { -- int var15 = var1.getBlockId(var11, var8, var13); -- if(var15 == 0 || var15 == Block.leaves.blockID) { -- this.setBlockAndMetadata(var1, var11, var8, var13, Block.leaves.blockID, this.leavesMetadata); -+ for (int var8 = par4 - var7; var8 <= par4; ++var8) { -+ int var9 = var8 - par4; -+ int var10 = par5 + 1 - var9; -+ -+ for (int var11 = par2 - var10; var11 <= par2 + var10 + 1; ++var11) { -+ int var12 = var11 - par2; -+ -+ for (int var13 = par3 - var10; var13 <= par3 + var10 + 1; ++var13) { -+ int var14 = var13 - par3; -+ -+ if ((var12 >= 0 || var14 >= 0 || var12 * var12 + var14 * var14 <= var10 * var10) && (var12 <= 0 && var14 <= 0 || var12 * var12 + var14 * var14 <= (var10 + 1) * (var10 + 1)) && (par6Random.nextInt(4) != 0 || var12 * var12 + var14 * var14 <= (var10 - 1) * (var10 - 1))) { -+ int var15 = par1World.getBlockId(var11, var8, var13); -+ -+ if (var15 == 0 || var15 == Block.leaves.blockID) { -+ this.setBlockAndMetadata(par1World, var11, var8, var13, Block.leaves.blockID, this.leavesMetadata); - } - } - } - } - } -- - } - } ---- net/minecraft/src/TextureOffset.java -+++ net/minecraft/src/TextureOffset.java -@@ -1,11 +1,15 @@ - package net.minecraft.src; - - public class TextureOffset { -+ -+ /** The x coordinate offset of the texture */ - public final int textureOffsetX; -+ -+ /** The y coordinate offset of the texture */ - public final int textureOffsetY; - -- public TextureOffset(int var1, int var2) { -- this.textureOffsetX = var1; -- this.textureOffsetY = var2; -+ public TextureOffset(int par1, int par2) { -+ this.textureOffsetX = par1; -+ this.textureOffsetY = par2; - } - } ---- net/minecraft/src/CommandEffect.java -+++ net/minecraft/src/CommandEffect.java -@@ -8,76 +8,87 @@ - return "effect"; - } - -+ /** -+ * Return the required permission level for this command. -+ */ - public int getRequiredPermissionLevel() { - return 2; - } - -- public String getCommandUsage(ICommandSender var1) { -+ public String getCommandUsage(ICommandSender par1ICommandSender) { - return "commands.effect.usage"; - } - -- public void processCommand(ICommandSender var1, String[] var2) { -- if(var2.length < 2) { -+ public void processCommand(ICommandSender par1ICommandSender, String[] par2ArrayOfStr) { -+ if (par2ArrayOfStr.length < 2) { - throw new WrongUsageException("commands.effect.usage", new Object[0]); - } else { -- EntityPlayerMP var3 = getPlayer(var1, var2[0]); -- if(var2[1].equals("clear")) { -- if(var3.getActivePotionEffects().isEmpty()) { -- throw new CommandException("commands.effect.failure.notActive.all", new Object[]{var3.getEntityName()}); -+ EntityPlayerMP var3 = getPlayer(par1ICommandSender, par2ArrayOfStr[0]); -+ -+ if (par2ArrayOfStr[1].equals("clear")) { -+ if (var3.getActivePotionEffects().isEmpty()) { -+ throw new CommandException("commands.effect.failure.notActive.all", new Object[] {var3.getEntityName()}); - } - - var3.clearActivePotions(); -- notifyAdmins(var1, "commands.effect.success.removed.all", new Object[]{var3.getEntityName()}); -+ notifyAdmins(par1ICommandSender, "commands.effect.success.removed.all", new Object[] {var3.getEntityName()}); - } else { -- int var4 = parseIntWithMin(var1, var2[1], 1); -+ int var4 = parseIntWithMin(par1ICommandSender, par2ArrayOfStr[1], 1); - int var5 = 600; - int var6 = 30; - int var7 = 0; -- if(var4 < 0 || var4 >= Potion.potionTypes.length || Potion.potionTypes[var4] == null) { -- throw new NumberInvalidException("commands.effect.notFound", new Object[]{Integer.valueOf(var4)}); -+ -+ if (var4 < 0 || var4 >= Potion.potionTypes.length || Potion.potionTypes[var4] == null) { -+ throw new NumberInvalidException("commands.effect.notFound", new Object[] {Integer.valueOf(var4)}); - } - -- if(var2.length >= 3) { -- var6 = parseIntBounded(var1, var2[2], 0, 1000000); -- if(Potion.potionTypes[var4].isInstant()) { -+ if (par2ArrayOfStr.length >= 3) { -+ var6 = parseIntBounded(par1ICommandSender, par2ArrayOfStr[2], 0, 1000000); -+ -+ if (Potion.potionTypes[var4].isInstant()) { - var5 = var6; - } else { - var5 = var6 * 20; - } -- } else if(Potion.potionTypes[var4].isInstant()) { -+ } else if (Potion.potionTypes[var4].isInstant()) { - var5 = 1; - } - -- if(var2.length >= 4) { -- var7 = parseIntBounded(var1, var2[3], 0, 255); -+ if (par2ArrayOfStr.length >= 4) { -+ var7 = parseIntBounded(par1ICommandSender, par2ArrayOfStr[3], 0, 255); - } - -- if(var6 == 0) { -- if(!var3.isPotionActive(var4)) { -- throw new CommandException("commands.effect.failure.notActive", new Object[]{ChatMessageComponent.createFromTranslationKey(Potion.potionTypes[var4].getName()), var3.getEntityName()}); -+ if (var6 == 0) { -+ if (!var3.isPotionActive(var4)) { -+ throw new CommandException("commands.effect.failure.notActive", new Object[] {ChatMessageComponent.createFromTranslationKey(Potion.potionTypes[var4].getName()), var3.getEntityName()}); - } - - var3.removePotionEffect(var4); -- notifyAdmins(var1, "commands.effect.success.removed", new Object[]{ChatMessageComponent.createFromTranslationKey(Potion.potionTypes[var4].getName()), var3.getEntityName()}); -+ notifyAdmins(par1ICommandSender, "commands.effect.success.removed", new Object[] {ChatMessageComponent.createFromTranslationKey(Potion.potionTypes[var4].getName()), var3.getEntityName()}); - } else { - PotionEffect var8 = new PotionEffect(var4, var5, var7); - var3.addPotionEffect(var8); -- notifyAdmins(var1, "commands.effect.success", new Object[]{ChatMessageComponent.createFromTranslationKey(var8.getEffectName()), Integer.valueOf(var4), Integer.valueOf(var7), var3.getEntityName(), Integer.valueOf(var6)}); -+ notifyAdmins(par1ICommandSender, "commands.effect.success", new Object[] {ChatMessageComponent.createFromTranslationKey(var8.getEffectName()), Integer.valueOf(var4), Integer.valueOf(var7), var3.getEntityName(), Integer.valueOf(var6)}); - } - } -- - } - } - -- public List addTabCompletionOptions(ICommandSender var1, String[] var2) { -- return var2.length == 1 ? getListOfStringsMatchingLastWord(var2, this.getAllUsernames()) : null; -+ /** -+ * Adds the strings available in this command to the given list of tab completion options. -+ */ -+ public List addTabCompletionOptions(ICommandSender par1ICommandSender, String[] par2ArrayOfStr) { -+ return par2ArrayOfStr.length == 1 ? getListOfStringsMatchingLastWord(par2ArrayOfStr, this.getAllUsernames()) : null; - } - - protected String[] getAllUsernames() { - return MinecraftServer.getServer().getAllUsernames(); - } - -- public boolean isUsernameIndex(String[] var1, int var2) { -- return var2 == 0; -+ /** -+ * Return whether the specified command parameter index is a username parameter. -+ */ -+ public boolean isUsernameIndex(String[] par1ArrayOfStr, int par2) { -+ return par2 == 0; - } - } ---- net/minecraft/src/EntityFireworkOverlayFX.java -+++ net/minecraft/src/EntityFireworkOverlayFX.java -@@ -1,25 +1,25 @@ - package net.minecraft.src; - - public class EntityFireworkOverlayFX extends EntityFX { -- protected EntityFireworkOverlayFX(World var1, double var2, double var4, double var6) { -- super(var1, var2, var4, var6); -+ protected EntityFireworkOverlayFX(World par1World, double par2, double par4, double par6) { -+ super(par1World, par2, par4, par6); - this.particleMaxAge = 4; - } - -- public void renderParticle(Tessellator var1, float var2, float var3, float var4, float var5, float var6, float var7) { -+ public void renderParticle(Tessellator par1Tessellator, float par2, float par3, float par4, float par5, float par6, float par7) { - float var8 = 0.25F; - float var9 = var8 + 0.25F; -- float var10 = 2.0F / 16.0F; -+ float var10 = 0.125F; - float var11 = var10 + 0.25F; -- float var12 = 7.1F * MathHelper.sin(((float)this.particleAge + var2 - 1.0F) * 0.25F * (float)Math.PI); -- this.particleAlpha = 0.6F - ((float)this.particleAge + var2 - 1.0F) * 0.25F * 0.5F; -- float var13 = (float)(this.prevPosX + (this.posX - this.prevPosX) * (double)var2 - interpPosX); -- float var14 = (float)(this.prevPosY + (this.posY - this.prevPosY) * (double)var2 - interpPosY); -- float var15 = (float)(this.prevPosZ + (this.posZ - this.prevPosZ) * (double)var2 - interpPosZ); -- var1.setColorRGBA_F(this.particleRed, this.particleGreen, this.particleBlue, this.particleAlpha); -- var1.addVertexWithUV((double)(var13 - var3 * var12 - var6 * var12), (double)(var14 - var4 * var12), (double)(var15 - var5 * var12 - var7 * var12), (double)var9, (double)var11); -- var1.addVertexWithUV((double)(var13 - var3 * var12 + var6 * var12), (double)(var14 + var4 * var12), (double)(var15 - var5 * var12 + var7 * var12), (double)var9, (double)var10); -- var1.addVertexWithUV((double)(var13 + var3 * var12 + var6 * var12), (double)(var14 + var4 * var12), (double)(var15 + var5 * var12 + var7 * var12), (double)var8, (double)var10); -- var1.addVertexWithUV((double)(var13 + var3 * var12 - var6 * var12), (double)(var14 - var4 * var12), (double)(var15 + var5 * var12 - var7 * var12), (double)var8, (double)var11); -+ float var12 = 7.1F * MathHelper.sin(((float)this.particleAge + par2 - 1.0F) * 0.25F * (float)Math.PI); -+ this.particleAlpha = 0.6F - ((float)this.particleAge + par2 - 1.0F) * 0.25F * 0.5F; -+ float var13 = (float)(this.prevPosX + (this.posX - this.prevPosX) * (double)par2 - interpPosX); -+ float var14 = (float)(this.prevPosY + (this.posY - this.prevPosY) * (double)par2 - interpPosY); -+ float var15 = (float)(this.prevPosZ + (this.posZ - this.prevPosZ) * (double)par2 - interpPosZ); -+ par1Tessellator.setColorRGBA_F(this.particleRed, this.particleGreen, this.particleBlue, this.particleAlpha); -+ par1Tessellator.addVertexWithUV((double)(var13 - par3 * var12 - par6 * var12), (double)(var14 - par4 * var12), (double)(var15 - par5 * var12 - par7 * var12), (double)var9, (double)var11); -+ par1Tessellator.addVertexWithUV((double)(var13 - par3 * var12 + par6 * var12), (double)(var14 + par4 * var12), (double)(var15 - par5 * var12 + par7 * var12), (double)var9, (double)var10); -+ par1Tessellator.addVertexWithUV((double)(var13 + par3 * var12 + par6 * var12), (double)(var14 + par4 * var12), (double)(var15 + par5 * var12 + par7 * var12), (double)var8, (double)var10); -+ par1Tessellator.addVertexWithUV((double)(var13 + par3 * var12 - par6 * var12), (double)(var14 - par4 * var12), (double)(var15 + par5 * var12 - par7 * var12), (double)var8, (double)var11); - } - } ---- net/minecraft/src/EnchantmentKnockback.java -+++ net/minecraft/src/EnchantmentKnockback.java -@@ -1,19 +1,28 @@ - package net.minecraft.src; - - public class EnchantmentKnockback extends Enchantment { -- protected EnchantmentKnockback(int var1, int var2) { -- super(var1, var2, EnumEnchantmentType.weapon); -+ protected EnchantmentKnockback(int par1, int par2) { -+ super(par1, par2, EnumEnchantmentType.weapon); - this.setName("knockback"); - } - -- public int getMinEnchantability(int var1) { -- return 5 + 20 * (var1 - 1); -- } -- -- public int getMaxEnchantability(int var1) { -- return super.getMinEnchantability(var1) + 50; -- } -- -+ /** -+ * Returns the minimal value of enchantability needed on the enchantment level passed. -+ */ -+ public int getMinEnchantability(int par1) { -+ return 5 + 20 * (par1 - 1); -+ } -+ -+ /** -+ * Returns the maximum value of enchantability nedded on the enchantment level passed. -+ */ -+ public int getMaxEnchantability(int par1) { -+ return super.getMinEnchantability(par1) + 50; -+ } -+ -+ /** -+ * Returns the maximum level that the enchantment can have. -+ */ - public int getMaxLevel() { - return 2; - } ---- net/minecraft/src/TextureCompass.java -+++ net/minecraft/src/TextureCompass.java -@@ -1,53 +1,64 @@ - package net.minecraft.src; - - public class TextureCompass extends TextureAtlasSprite { -+ -+ /** Current compass heading in radians */ - public double currentAngle; -+ -+ /** Speed and direction of compass rotation */ - public double angleDelta; - -- public TextureCompass(String var1) { -- super(var1); -+ public TextureCompass(String par1Str) { -+ super(par1Str); - } - - public void updateAnimation() { - Minecraft var1 = Minecraft.getMinecraft(); -- if(var1.theWorld != null && var1.thePlayer != null) { -+ -+ if (var1.theWorld != null && var1.thePlayer != null) { - this.updateCompass(var1.theWorld, var1.thePlayer.posX, var1.thePlayer.posZ, (double)var1.thePlayer.rotationYaw, false, false); - } else { - this.updateCompass((World)null, 0.0D, 0.0D, 0.0D, true, false); - } -- - } - -- public void updateCompass(World var1, double var2, double var4, double var6, boolean var8, boolean var9) { -- if(!this.a.isEmpty()) { -+ /** -+ * Updates the compass based on the given x,z coords and camera direction -+ */ -+ public void updateCompass(World par1World, double par2, double par4, double par6, boolean par8, boolean par9) { -+ if (!this.framesTextureData.isEmpty()) { - double var10 = 0.0D; -- if(var1 != null && !var8) { -- ChunkCoordinates var12 = var1.getSpawnPoint(); -- double var13 = (double)var12.posX - var2; -- double var15 = (double)var12.posZ - var4; -- var6 %= 360.0D; -- var10 = -((var6 - 90.0D) * Math.PI / 180.0D - Math.atan2(var15, var13)); -- if(!var1.provider.isSurfaceWorld()) { -- var10 = Math.random() * (double)((float)Math.PI) * 2.0D; -+ -+ if (par1World != null && !par8) { -+ ChunkCoordinates var12 = par1World.getSpawnPoint(); -+ double var13 = (double)var12.posX - par2; -+ double var15 = (double)var12.posZ - par4; -+ par6 %= 360.0D; -+ var10 = -((par6 - 90.0D) * Math.PI / 180.0D - Math.atan2(var15, var13)); -+ -+ if (!par1World.provider.isSurfaceWorld()) { -+ var10 = Math.random() * Math.PI * 2.0D; - } - } - -- if(var9) { -+ if (par9) { - this.currentAngle = var10; - } else { - double var17; -- for(var17 = var10 - this.currentAngle; var17 < -Math.PI; var17 += Math.PI * 2.0D) { -- } -- -- while(var17 >= Math.PI) { -- var17 -= Math.PI * 2.0D; -- } -- -- if(var17 < -1.0D) { -+ -+ for (var17 = var10 - this.currentAngle; var17 < -Math.PI; var17 += (Math.PI * 2D)) { -+ ; -+ } -+ -+ while (var17 >= Math.PI) { -+ var17 -= (Math.PI * 2D); -+ } -+ -+ if (var17 < -1.0D) { - var17 = -1.0D; - } - -- if(var17 > 1.0D) { -+ if (var17 > 1.0D) { - var17 = 1.0D; - } - -@@ -57,14 +68,15 @@ - } - - int var18; -- for(var18 = (int)((this.currentAngle / (Math.PI * 2.0D) + 1.0D) * (double)this.a.size()) % this.a.size(); var18 < 0; var18 = (var18 + this.a.size()) % this.a.size()) { -+ -+ for (var18 = (int)((this.currentAngle / (Math.PI * 2D) + 1.0D) * (double)this.framesTextureData.size()) % this.framesTextureData.size(); var18 < 0; var18 = (var18 + this.framesTextureData.size()) % this.framesTextureData.size()) { -+ ; - } - -- if(var18 != this.frameCounter) { -+ if (var18 != this.frameCounter) { - this.frameCounter = var18; -- TextureUtil.uploadTextureSub((int[])this.a.get(this.frameCounter), this.width, this.height, this.originX, this.originY, false, false); -+ TextureUtil.uploadTextureSub((int[])this.framesTextureData.get(this.frameCounter), this.width, this.height, this.originX, this.originY, false, false); - } -- - } - } - } ---- net/minecraft/src/Teleporter.java -+++ net/minecraft/src/Teleporter.java -@@ -7,31 +7,43 @@ - - public class Teleporter { - private final WorldServer worldServerInstance; -- private final Random b; -+ -+ /** A private Random() function in Teleporter */ -+ private final Random random; -+ -+ /** Stores successful portal placement locations for rapid lookup. */ - private final LongHashMap destinationCoordinateCache = new LongHashMap(); -- private final List d = new ArrayList(); -- -- public Teleporter(WorldServer var1) { -- this.worldServerInstance = var1; -- this.b = new Random(var1.getSeed()); -+ -+ /** -+ * A list of valid keys for the destinationCoordainteCache. These are based on the X & Z of the players initial -+ * location. -+ */ -+ private final List destinationCoordinateKeys = new ArrayList(); -+ -+ public Teleporter(WorldServer par1WorldServer) { -+ this.worldServerInstance = par1WorldServer; -+ this.random = new Random(par1WorldServer.getSeed()); - } - -- public void placeInPortal(Entity var1, double var2, double var4, double var6, float var8) { -- if(this.worldServerInstance.provider.dimensionId != 1) { -- if(!this.placeInExistingPortal(var1, var2, var4, var6, var8)) { -- this.makePortal(var1); -- this.placeInExistingPortal(var1, var2, var4, var6, var8); -+ /** -+ * Place an entity in a nearby portal, creating one if necessary. -+ */ -+ public void placeInPortal(Entity par1Entity, double par2, double par4, double par6, float par8) { -+ if (this.worldServerInstance.provider.dimensionId != 1) { -+ if (!this.placeInExistingPortal(par1Entity, par2, par4, par6, par8)) { -+ this.makePortal(par1Entity); -+ this.placeInExistingPortal(par1Entity, par2, par4, par6, par8); - } - } else { -- int var9 = MathHelper.floor_double(var1.posX); -- int var10 = MathHelper.floor_double(var1.posY) - 1; -- int var11 = MathHelper.floor_double(var1.posZ); -+ int var9 = MathHelper.floor_double(par1Entity.posX); -+ int var10 = MathHelper.floor_double(par1Entity.posY) - 1; -+ int var11 = MathHelper.floor_double(par1Entity.posZ); - byte var12 = 1; - byte var13 = 0; - -- for(int var14 = -2; var14 <= 2; ++var14) { -- for(int var15 = -2; var15 <= 2; ++var15) { -- for(int var16 = -1; var16 < 3; ++var16) { -+ for (int var14 = -2; var14 <= 2; ++var14) { -+ for (int var15 = -2; var15 <= 2; ++var15) { -+ for (int var16 = -1; var16 < 3; ++var16) { - int var17 = var9 + var15 * var12 + var14 * var13; - int var18 = var10 + var16; - int var19 = var11 + var15 * var13 - var14 * var12; -@@ -41,24 +53,28 @@ - } - } - -- var1.setLocationAndAngles((double)var9, (double)var10, (double)var11, var1.rotationYaw, 0.0F); -- var1.motionX = var1.motionY = var1.motionZ = 0.0D; -+ par1Entity.setLocationAndAngles((double)var9, (double)var10, (double)var11, par1Entity.rotationYaw, 0.0F); -+ par1Entity.motionX = par1Entity.motionY = par1Entity.motionZ = 0.0D; - } - } - -- public boolean placeInExistingPortal(Entity var1, double var2, double var4, double var6, float var8) { -+ /** -+ * Place an entity in a nearby portal which already exists. -+ */ -+ public boolean placeInExistingPortal(Entity par1Entity, double par2, double par4, double par6, float par8) { - short var9 = 128; - double var10 = -1.0D; - int var12 = 0; - int var13 = 0; - int var14 = 0; -- int var15 = MathHelper.floor_double(var1.posX); -- int var16 = MathHelper.floor_double(var1.posZ); -+ int var15 = MathHelper.floor_double(par1Entity.posX); -+ int var16 = MathHelper.floor_double(par1Entity.posZ); - long var17 = ChunkCoordIntPair.chunkXZ2Int(var15, var16); - boolean var19 = true; - double var27; - int var48; -- if(this.destinationCoordinateCache.containsItem(var17)) { -+ -+ if (this.destinationCoordinateCache.containsItem(var17)) { - PortalPosition var20 = (PortalPosition)this.destinationCoordinateCache.getValueByKey(var17); - var10 = 0.0D; - var12 = var20.posX; -@@ -67,21 +83,22 @@ - var20.lastUpdateTime = this.worldServerInstance.getTotalWorldTime(); - var19 = false; - } else { -- for(var48 = var15 - var9; var48 <= var15 + var9; ++var48) { -- double var21 = (double)var48 + 0.5D - var1.posX; -- -- for(int var23 = var16 - var9; var23 <= var16 + var9; ++var23) { -- double var24 = (double)var23 + 0.5D - var1.posZ; -- -- for(int var26 = this.worldServerInstance.getActualHeight() - 1; var26 >= 0; --var26) { -- if(this.worldServerInstance.getBlockId(var48, var26, var23) == Block.portal.blockID) { -- while(this.worldServerInstance.getBlockId(var48, var26 - 1, var23) == Block.portal.blockID) { -+ for (var48 = var15 - var9; var48 <= var15 + var9; ++var48) { -+ double var21 = (double)var48 + 0.5D - par1Entity.posX; -+ -+ for (int var23 = var16 - var9; var23 <= var16 + var9; ++var23) { -+ double var24 = (double)var23 + 0.5D - par1Entity.posZ; -+ -+ for (int var26 = this.worldServerInstance.getActualHeight() - 1; var26 >= 0; --var26) { -+ if (this.worldServerInstance.getBlockId(var48, var26, var23) == Block.portal.blockID) { -+ while (this.worldServerInstance.getBlockId(var48, var26 - 1, var23) == Block.portal.blockID) { - --var26; - } - -- var27 = (double)var26 + 0.5D - var1.posY; -+ var27 = (double)var26 + 0.5D - par1Entity.posY; - double var29 = var21 * var21 + var27 * var27 + var24 * var24; -- if(var10 < 0.0D || var29 < var10) { -+ -+ if (var10 < 0.0D || var29 < var10) { - var10 = var29; - var12 = var48; - var13 = var26; -@@ -93,34 +110,36 @@ - } - } - -- if(var10 >= 0.0D) { -- if(var19) { -+ if (var10 >= 0.0D) { -+ if (var19) { - this.destinationCoordinateCache.add(var17, new PortalPosition(this, var12, var13, var14, this.worldServerInstance.getTotalWorldTime())); -- this.d.add(Long.valueOf(var17)); -+ this.destinationCoordinateKeys.add(Long.valueOf(var17)); - } - - double var49 = (double)var12 + 0.5D; - double var25 = (double)var13 + 0.5D; - var27 = (double)var14 + 0.5D; - int var50 = -1; -- if(this.worldServerInstance.getBlockId(var12 - 1, var13, var14) == Block.portal.blockID) { -+ -+ if (this.worldServerInstance.getBlockId(var12 - 1, var13, var14) == Block.portal.blockID) { - var50 = 2; - } - -- if(this.worldServerInstance.getBlockId(var12 + 1, var13, var14) == Block.portal.blockID) { -+ if (this.worldServerInstance.getBlockId(var12 + 1, var13, var14) == Block.portal.blockID) { - var50 = 0; - } - -- if(this.worldServerInstance.getBlockId(var12, var13, var14 - 1) == Block.portal.blockID) { -+ if (this.worldServerInstance.getBlockId(var12, var13, var14 - 1) == Block.portal.blockID) { - var50 = 3; - } - -- if(this.worldServerInstance.getBlockId(var12, var13, var14 + 1) == Block.portal.blockID) { -+ if (this.worldServerInstance.getBlockId(var12, var13, var14 + 1) == Block.portal.blockID) { - var50 = 1; - } - -- int var30 = var1.getTeleportDirection(); -- if(var50 > -1) { -+ int var30 = par1Entity.getTeleportDirection(); -+ -+ if (var50 > -1) { - int var31 = Direction.rotateLeft[var50]; - int var32 = Direction.offsetX[var50]; - int var33 = Direction.offsetZ[var50]; -@@ -128,7 +147,8 @@ - int var35 = Direction.offsetZ[var31]; - boolean var36 = !this.worldServerInstance.isAirBlock(var12 + var32 + var34, var13, var14 + var33 + var35) || !this.worldServerInstance.isAirBlock(var12 + var32 + var34, var13 + 1, var14 + var33 + var35); - boolean var37 = !this.worldServerInstance.isAirBlock(var12 + var32, var13, var14 + var33) || !this.worldServerInstance.isAirBlock(var12 + var32, var13 + 1, var14 + var33); -- if(var36 && var37) { -+ -+ if (var36 && var37) { - var50 = Direction.rotateOpposite[var50]; - var31 = Direction.rotateOpposite[var31]; - var32 = Direction.offsetX[var50]; -@@ -145,11 +165,12 @@ - - float var38 = 0.5F; - float var39 = 0.5F; -- if(!var36 && var37) { -+ -+ if (!var36 && var37) { - var38 = 1.0F; -- } else if(var36 && !var37) { -+ } else if (var36 && !var37) { - var38 = 0.0F; -- } else if(var36 && var37) { -+ } else if (var36 && var37) { - var39 = 0.0F; - } - -@@ -159,13 +180,14 @@ - float var41 = 0.0F; - float var42 = 0.0F; - float var43 = 0.0F; -- if(var50 == var30) { -+ -+ if (var50 == var30) { - var40 = 1.0F; - var41 = 1.0F; -- } else if(var50 == Direction.rotateOpposite[var30]) { -+ } else if (var50 == Direction.rotateOpposite[var30]) { - var40 = -1.0F; - var41 = -1.0F; -- } else if(var50 == Direction.enderEyeMetaToDirection[var30]) { -+ } else if (var50 == Direction.rotateRight[var30]) { - var42 = 1.0F; - var43 = -1.0F; - } else { -@@ -173,34 +195,33 @@ - var43 = 1.0F; - } - -- double var44 = var1.motionX; -- double var46 = var1.motionZ; -- var1.motionX = var44 * (double)var40 + var46 * (double)var43; -- var1.motionZ = var44 * (double)var42 + var46 * (double)var41; -- var1.rotationYaw = var8 - (float)(var30 * 90) + (float)(var50 * 90); -+ double var44 = par1Entity.motionX; -+ double var46 = par1Entity.motionZ; -+ par1Entity.motionX = var44 * (double)var40 + var46 * (double)var43; -+ par1Entity.motionZ = var44 * (double)var42 + var46 * (double)var41; -+ par1Entity.rotationYaw = par8 - (float)(var30 * 90) + (float)(var50 * 90); - } else { -- var1.motionX = var1.motionY = var1.motionZ = 0.0D; -+ par1Entity.motionX = par1Entity.motionY = par1Entity.motionZ = 0.0D; - } - -- var1.setLocationAndAngles(var49, var25, var27, var1.rotationYaw, var1.rotationPitch); -+ par1Entity.setLocationAndAngles(var49, var25, var27, par1Entity.rotationYaw, par1Entity.rotationPitch); - return true; - } else { - return false; - } - } - -- public boolean makePortal(Entity var1) { -+ public boolean makePortal(Entity par1Entity) { - byte var2 = 16; - double var3 = -1.0D; -- int var5 = MathHelper.floor_double(var1.posX); -- int var6 = MathHelper.floor_double(var1.posY); -- int var7 = MathHelper.floor_double(var1.posZ); -+ int var5 = MathHelper.floor_double(par1Entity.posX); -+ int var6 = MathHelper.floor_double(par1Entity.posY); -+ int var7 = MathHelper.floor_double(par1Entity.posZ); - int var8 = var5; - int var9 = var6; - int var10 = var7; - int var11 = 0; -- int var12 = this.b.nextInt(4); -- -+ int var12 = this.random.nextInt(4); - int var13; - double var14; - int var16; -@@ -216,43 +237,47 @@ - int var27; - double var31; - double var32; -- for(var13 = var5 - var2; var13 <= var5 + var2; ++var13) { -- var14 = (double)var13 + 0.5D - var1.posX; -- -- for(var16 = var7 - var2; var16 <= var7 + var2; ++var16) { -- var17 = (double)var16 + 0.5D - var1.posZ; -- -- label296: -- for(var19 = this.worldServerInstance.getActualHeight() - 1; var19 >= 0; --var19) { -- if(this.worldServerInstance.isAirBlock(var13, var19, var16)) { -- while(var19 > 0 && this.worldServerInstance.isAirBlock(var13, var19 - 1, var16)) { -+ -+ for (var13 = var5 - var2; var13 <= var5 + var2; ++var13) { -+ var14 = (double)var13 + 0.5D - par1Entity.posX; -+ -+ for (var16 = var7 - var2; var16 <= var7 + var2; ++var16) { -+ var17 = (double)var16 + 0.5D - par1Entity.posZ; -+ label274: -+ -+ for (var19 = this.worldServerInstance.getActualHeight() - 1; var19 >= 0; --var19) { -+ if (this.worldServerInstance.isAirBlock(var13, var19, var16)) { -+ while (var19 > 0 && this.worldServerInstance.isAirBlock(var13, var19 - 1, var16)) { - --var19; - } - -- for(var20 = var12; var20 < var12 + 4; ++var20) { -+ for (var20 = var12; var20 < var12 + 4; ++var20) { - var21 = var20 % 2; - var22 = 1 - var21; -- if(var20 % 4 >= 2) { -+ -+ if (var20 % 4 >= 2) { - var21 = -var21; - var22 = -var22; - } - -- for(var23 = 0; var23 < 3; ++var23) { -- for(var24 = 0; var24 < 4; ++var24) { -- for(var25 = -1; var25 < 4; ++var25) { -+ for (var23 = 0; var23 < 3; ++var23) { -+ for (var24 = 0; var24 < 4; ++var24) { -+ for (var25 = -1; var25 < 4; ++var25) { - var26 = var13 + (var24 - 1) * var21 + var23 * var22; - var27 = var19 + var25; - int var28 = var16 + (var24 - 1) * var22 - var23 * var21; -- if(var25 < 0 && !this.worldServerInstance.getBlockMaterial(var26, var27, var28).isSolid() || var25 >= 0 && !this.worldServerInstance.isAirBlock(var26, var27, var28)) { -- continue label296; -+ -+ if (var25 < 0 && !this.worldServerInstance.getBlockMaterial(var26, var27, var28).isSolid() || var25 >= 0 && !this.worldServerInstance.isAirBlock(var26, var27, var28)) { -+ continue label274; - } - } - } - } - -- var31 = (double)var19 + 0.5D - var1.posY; -+ var31 = (double)var19 + 0.5D - par1Entity.posY; - var32 = var14 * var14 + var31 * var31 + var17 * var17; -- if(var3 < 0.0D || var32 < var3) { -+ -+ if (var3 < 0.0D || var32 < var3) { - var3 = var32; - var8 = var13; - var9 = var19; -@@ -265,38 +290,40 @@ - } - } - -- if(var3 < 0.0D) { -- for(var13 = var5 - var2; var13 <= var5 + var2; ++var13) { -- var14 = (double)var13 + 0.5D - var1.posX; -- -- for(var16 = var7 - var2; var16 <= var7 + var2; ++var16) { -- var17 = (double)var16 + 0.5D - var1.posZ; -- -- label234: -- for(var19 = this.worldServerInstance.getActualHeight() - 1; var19 >= 0; --var19) { -- if(this.worldServerInstance.isAirBlock(var13, var19, var16)) { -- while(var19 > 0 && this.worldServerInstance.isAirBlock(var13, var19 - 1, var16)) { -+ if (var3 < 0.0D) { -+ for (var13 = var5 - var2; var13 <= var5 + var2; ++var13) { -+ var14 = (double)var13 + 0.5D - par1Entity.posX; -+ -+ for (var16 = var7 - var2; var16 <= var7 + var2; ++var16) { -+ var17 = (double)var16 + 0.5D - par1Entity.posZ; -+ label222: -+ -+ for (var19 = this.worldServerInstance.getActualHeight() - 1; var19 >= 0; --var19) { -+ if (this.worldServerInstance.isAirBlock(var13, var19, var16)) { -+ while (var19 > 0 && this.worldServerInstance.isAirBlock(var13, var19 - 1, var16)) { - --var19; - } - -- for(var20 = var12; var20 < var12 + 2; ++var20) { -+ for (var20 = var12; var20 < var12 + 2; ++var20) { - var21 = var20 % 2; - var22 = 1 - var21; - -- for(var23 = 0; var23 < 4; ++var23) { -- for(var24 = -1; var24 < 4; ++var24) { -+ for (var23 = 0; var23 < 4; ++var23) { -+ for (var24 = -1; var24 < 4; ++var24) { - var25 = var13 + (var23 - 1) * var21; - var26 = var19 + var24; - var27 = var16 + (var23 - 1) * var22; -- if(var24 < 0 && !this.worldServerInstance.getBlockMaterial(var25, var26, var27).isSolid() || var24 >= 0 && !this.worldServerInstance.isAirBlock(var25, var26, var27)) { -- continue label234; -+ -+ if (var24 < 0 && !this.worldServerInstance.getBlockMaterial(var25, var26, var27).isSolid() || var24 >= 0 && !this.worldServerInstance.isAirBlock(var25, var26, var27)) { -+ continue label222; - } - } - } - -- var31 = (double)var19 + 0.5D - var1.posY; -+ var31 = (double)var19 + 0.5D - par1Entity.posY; - var32 = var14 * var14 + var31 * var31 + var17 * var17; -- if(var3 < 0.0D || var32 < var3) { -+ -+ if (var3 < 0.0D || var32 < var3) { - var3 = var32; - var8 = var13; - var9 = var19; -@@ -315,26 +342,28 @@ - var16 = var10; - int var30 = var11 % 2; - int var18 = 1 - var30; -- if(var11 % 4 >= 2) { -+ -+ if (var11 % 4 >= 2) { - var30 = -var30; - var18 = -var18; - } - - boolean var33; -- if(var3 < 0.0D) { -- if(var9 < 70) { -+ -+ if (var3 < 0.0D) { -+ if (var9 < 70) { - var9 = 70; - } - -- if(var9 > this.worldServerInstance.getActualHeight() - 10) { -+ if (var9 > this.worldServerInstance.getActualHeight() - 10) { - var9 = this.worldServerInstance.getActualHeight() - 10; - } - - var15 = var9; - -- for(var19 = -1; var19 <= 1; ++var19) { -- for(var20 = 1; var20 < 3; ++var20) { -- for(var21 = -1; var21 < 3; ++var21) { -+ for (var19 = -1; var19 <= 1; ++var19) { -+ for (var20 = 1; var20 < 3; ++var20) { -+ for (var21 = -1; var21 < 3; ++var21) { - var22 = var29 + (var20 - 1) * var30 + var19 * var18; - var23 = var15 + var21; - var24 = var16 + (var20 - 1) * var18 - var19 * var30; -@@ -345,9 +374,9 @@ - } - } - -- for(var19 = 0; var19 < 4; ++var19) { -- for(var20 = 0; var20 < 4; ++var20) { -- for(var21 = -1; var21 < 4; ++var21) { -+ for (var19 = 0; var19 < 4; ++var19) { -+ for (var20 = 0; var20 < 4; ++var20) { -+ for (var21 = -1; var21 < 4; ++var21) { - var22 = var29 + (var20 - 1) * var30; - var23 = var15 + var21; - var24 = var16 + (var20 - 1) * var18; -@@ -356,8 +385,8 @@ - } - } - -- for(var20 = 0; var20 < 4; ++var20) { -- for(var21 = -1; var21 < 4; ++var21) { -+ for (var20 = 0; var20 < 4; ++var20) { -+ for (var21 = -1; var21 < 4; ++var21) { - var22 = var29 + (var20 - 1) * var30; - var23 = var15 + var21; - var24 = var16 + (var20 - 1) * var18; -@@ -369,25 +398,23 @@ - return true; - } - -- public void removeStalePortalLocations(long var1) { -- if(var1 % 100L == 0L) { -- Iterator var3 = this.d.iterator(); -- long var4 = var1 - 600L; -- -- while(true) { -- Long var6; -- PortalPosition var7; -- do { -- if(!var3.hasNext()) { -- return; -- } -- -- var6 = (Long)var3.next(); -- var7 = (PortalPosition)this.destinationCoordinateCache.getValueByKey(var6.longValue()); -- } while(var7 != null && var7.lastUpdateTime >= var4); -- -- var3.remove(); -- this.destinationCoordinateCache.remove(var6.longValue()); -+ /** -+ * called periodically to remove out-of-date portal locations from the cache list. Argument par1 is a -+ * WorldServer.getTotalWorldTime() value. -+ */ -+ public void removeStalePortalLocations(long par1) { -+ if (par1 % 100L == 0L) { -+ Iterator var3 = this.destinationCoordinateKeys.iterator(); -+ long var4 = par1 - 600L; -+ -+ while (var3.hasNext()) { -+ Long var6 = (Long)var3.next(); -+ PortalPosition var7 = (PortalPosition)this.destinationCoordinateCache.getValueByKey(var6.longValue()); -+ -+ if (var7 == null || var7.lastUpdateTime < var4) { -+ var3.remove(); -+ this.destinationCoordinateCache.remove(var6.longValue()); -+ } - } - } - } ---- net/minecraft/src/BlockTorch.java -+++ net/minecraft/src/BlockTorch.java -@@ -3,123 +3,158 @@ - import java.util.Random; - - public class BlockTorch extends Block { -- protected BlockTorch(int var1) { -- super(var1, Material.circuits); -+ protected BlockTorch(int par1) { -+ super(par1, Material.circuits); - this.setTickRandomly(true); - this.setCreativeTab(CreativeTabs.tabDecorations); - } - -- public AxisAlignedBB getCollisionBoundingBoxFromPool(World var1, int var2, int var3, int var4) { -+ /** -+ * Returns a bounding box from the pool of bounding boxes (this means this box can change after the pool has been -+ * cleared to be reused) -+ */ -+ public AxisAlignedBB getCollisionBoundingBoxFromPool(World par1World, int par2, int par3, int par4) { - return null; - } - -+ /** -+ * Is this block (a) opaque and (b) a full 1m cube? This determines whether or not to render the shared face of two -+ * adjacent blocks and also whether the player can attach torches, redstone wire, etc to this block. -+ */ - public boolean isOpaqueCube() { - return false; - } - -+ /** -+ * If this block doesn't render as an ordinary block it will return False (examples: signs, buttons, stairs, etc) -+ */ - public boolean renderAsNormalBlock() { - return false; - } - -+ /** -+ * The type of render function that is called for this block -+ */ - public int getRenderType() { - return 2; - } - -- private boolean canPlaceTorchOn(World var1, int var2, int var3, int var4) { -- if(var1.doesBlockHaveSolidTopSurface(var2, var3, var4)) { -+ /** -+ * Gets if we can place a torch on a block. -+ */ -+ private boolean canPlaceTorchOn(World par1World, int par2, int par3, int par4) { -+ if (par1World.doesBlockHaveSolidTopSurface(par2, par3, par4)) { - return true; - } else { -- int var5 = var1.getBlockId(var2, var3, var4); -+ int var5 = par1World.getBlockId(par2, par3, par4); - return var5 == Block.fence.blockID || var5 == Block.netherFence.blockID || var5 == Block.glass.blockID || var5 == Block.cobblestoneWall.blockID; - } - } - -- public boolean canPlaceBlockAt(World var1, int var2, int var3, int var4) { -- return var1.isBlockNormalCubeDefault(var2 - 1, var3, var4, true) ? true : (var1.isBlockNormalCubeDefault(var2 + 1, var3, var4, true) ? true : (var1.isBlockNormalCubeDefault(var2, var3, var4 - 1, true) ? true : (var1.isBlockNormalCubeDefault(var2, var3, var4 + 1, true) ? true : this.canPlaceTorchOn(var1, var2, var3 - 1, var4)))); -+ /** -+ * Checks to see if its valid to put this block at the specified coordinates. Args: world, x, y, z -+ */ -+ public boolean canPlaceBlockAt(World par1World, int par2, int par3, int par4) { -+ return par1World.isBlockNormalCubeDefault(par2 - 1, par3, par4, true) ? true : (par1World.isBlockNormalCubeDefault(par2 + 1, par3, par4, true) ? true : (par1World.isBlockNormalCubeDefault(par2, par3, par4 - 1, true) ? true : (par1World.isBlockNormalCubeDefault(par2, par3, par4 + 1, true) ? true : this.canPlaceTorchOn(par1World, par2, par3 - 1, par4)))); - } - -- public int onBlockPlaced(World var1, int var2, int var3, int var4, int var5, float var6, float var7, float var8, int var9) { -- int var10 = var9; -- if(var5 == 1 && this.canPlaceTorchOn(var1, var2, var3 - 1, var4)) { -+ /** -+ * Called when a block is placed using its ItemBlock. Args: World, X, Y, Z, side, hitX, hitY, hitZ, block metadata -+ */ -+ public int onBlockPlaced(World par1World, int par2, int par3, int par4, int par5, float par6, float par7, float par8, int par9) { -+ int var10 = par9; -+ -+ if (par5 == 1 && this.canPlaceTorchOn(par1World, par2, par3 - 1, par4)) { - var10 = 5; - } - -- if(var5 == 2 && var1.isBlockNormalCubeDefault(var2, var3, var4 + 1, true)) { -+ if (par5 == 2 && par1World.isBlockNormalCubeDefault(par2, par3, par4 + 1, true)) { - var10 = 4; - } - -- if(var5 == 3 && var1.isBlockNormalCubeDefault(var2, var3, var4 - 1, true)) { -+ if (par5 == 3 && par1World.isBlockNormalCubeDefault(par2, par3, par4 - 1, true)) { - var10 = 3; - } - -- if(var5 == 4 && var1.isBlockNormalCubeDefault(var2 + 1, var3, var4, true)) { -+ if (par5 == 4 && par1World.isBlockNormalCubeDefault(par2 + 1, par3, par4, true)) { - var10 = 2; - } - -- if(var5 == 5 && var1.isBlockNormalCubeDefault(var2 - 1, var3, var4, true)) { -+ if (par5 == 5 && par1World.isBlockNormalCubeDefault(par2 - 1, par3, par4, true)) { - var10 = 1; - } - - return var10; - } - -- public void updateTick(World var1, int var2, int var3, int var4, Random var5) { -- super.updateTick(var1, var2, var3, var4, var5); -- if(var1.getBlockMetadata(var2, var3, var4) == 0) { -- this.onBlockAdded(var1, var2, var3, var4); -+ /** -+ * Ticks the block if it's been scheduled -+ */ -+ public void updateTick(World par1World, int par2, int par3, int par4, Random par5Random) { -+ super.updateTick(par1World, par2, par3, par4, par5Random); -+ -+ if (par1World.getBlockMetadata(par2, par3, par4) == 0) { -+ this.onBlockAdded(par1World, par2, par3, par4); - } -- - } - -- public void onBlockAdded(World var1, int var2, int var3, int var4) { -- if(var1.getBlockMetadata(var2, var3, var4) == 0) { -- if(var1.isBlockNormalCubeDefault(var2 - 1, var3, var4, true)) { -- var1.setBlockMetadata(var2, var3, var4, 1, 2); -- } else if(var1.isBlockNormalCubeDefault(var2 + 1, var3, var4, true)) { -- var1.setBlockMetadata(var2, var3, var4, 2, 2); -- } else if(var1.isBlockNormalCubeDefault(var2, var3, var4 - 1, true)) { -- var1.setBlockMetadata(var2, var3, var4, 3, 2); -- } else if(var1.isBlockNormalCubeDefault(var2, var3, var4 + 1, true)) { -- var1.setBlockMetadata(var2, var3, var4, 4, 2); -- } else if(this.canPlaceTorchOn(var1, var2, var3 - 1, var4)) { -- var1.setBlockMetadata(var2, var3, var4, 5, 2); -+ /** -+ * Called whenever the block is added into the world. Args: world, x, y, z -+ */ -+ public void onBlockAdded(World par1World, int par2, int par3, int par4) { -+ if (par1World.getBlockMetadata(par2, par3, par4) == 0) { -+ if (par1World.isBlockNormalCubeDefault(par2 - 1, par3, par4, true)) { -+ par1World.setBlockMetadataWithNotify(par2, par3, par4, 1, 2); -+ } else if (par1World.isBlockNormalCubeDefault(par2 + 1, par3, par4, true)) { -+ par1World.setBlockMetadataWithNotify(par2, par3, par4, 2, 2); -+ } else if (par1World.isBlockNormalCubeDefault(par2, par3, par4 - 1, true)) { -+ par1World.setBlockMetadataWithNotify(par2, par3, par4, 3, 2); -+ } else if (par1World.isBlockNormalCubeDefault(par2, par3, par4 + 1, true)) { -+ par1World.setBlockMetadataWithNotify(par2, par3, par4, 4, 2); -+ } else if (this.canPlaceTorchOn(par1World, par2, par3 - 1, par4)) { -+ par1World.setBlockMetadataWithNotify(par2, par3, par4, 5, 2); - } - } - -- this.dropTorchIfCantStay(var1, var2, var3, var4); -- } -- -- public void onNeighborBlockChange(World var1, int var2, int var3, int var4, int var5) { -- this.func_94397_d(var1, var2, var3, var4, var5); -- } -- -- protected boolean func_94397_d(World var1, int var2, int var3, int var4, int var5) { -- if(this.dropTorchIfCantStay(var1, var2, var3, var4)) { -- int var6 = var1.getBlockMetadata(var2, var3, var4); -+ this.dropTorchIfCantStay(par1World, par2, par3, par4); -+ } -+ -+ /** -+ * Lets the block know when one of its neighbor changes. Doesn't know which neighbor changed (coordinates passed are -+ * their own) Args: x, y, z, neighbor blockID -+ */ -+ public void onNeighborBlockChange(World par1World, int par2, int par3, int par4, int par5) { -+ this.func_94397_d(par1World, par2, par3, par4, par5); -+ } -+ -+ protected boolean func_94397_d(World par1World, int par2, int par3, int par4, int par5) { -+ if (this.dropTorchIfCantStay(par1World, par2, par3, par4)) { -+ int var6 = par1World.getBlockMetadata(par2, par3, par4); - boolean var7 = false; -- if(!var1.isBlockNormalCubeDefault(var2 - 1, var3, var4, true) && var6 == 1) { -- var7 = true; -- } -- -- if(!var1.isBlockNormalCubeDefault(var2 + 1, var3, var4, true) && var6 == 2) { -- var7 = true; -- } -- -- if(!var1.isBlockNormalCubeDefault(var2, var3, var4 - 1, true) && var6 == 3) { -- var7 = true; -- } -- -- if(!var1.isBlockNormalCubeDefault(var2, var3, var4 + 1, true) && var6 == 4) { -- var7 = true; -- } -- -- if(!this.canPlaceTorchOn(var1, var2, var3 - 1, var4) && var6 == 5) { -- var7 = true; -- } -- -- if(var7) { -- this.dropBlockAsItem(var1, var2, var3, var4, var1.getBlockMetadata(var2, var3, var4), 0); -- var1.setBlockToAir(var2, var3, var4); -+ -+ if (!par1World.isBlockNormalCubeDefault(par2 - 1, par3, par4, true) && var6 == 1) { -+ var7 = true; -+ } -+ -+ if (!par1World.isBlockNormalCubeDefault(par2 + 1, par3, par4, true) && var6 == 2) { -+ var7 = true; -+ } -+ -+ if (!par1World.isBlockNormalCubeDefault(par2, par3, par4 - 1, true) && var6 == 3) { -+ var7 = true; -+ } -+ -+ if (!par1World.isBlockNormalCubeDefault(par2, par3, par4 + 1, true) && var6 == 4) { -+ var7 = true; -+ } -+ -+ if (!this.canPlaceTorchOn(par1World, par2, par3 - 1, par4) && var6 == 5) { -+ var7 = true; -+ } -+ -+ if (var7) { -+ this.dropBlockAsItem(par1World, par2, par3, par4, par1World.getBlockMetadata(par2, par3, par4), 0); -+ par1World.setBlockToAir(par2, par3, par4); - return true; - } else { - return false; -@@ -129,11 +164,15 @@ - } - } - -- protected boolean dropTorchIfCantStay(World var1, int var2, int var3, int var4) { -- if(!this.canPlaceBlockAt(var1, var2, var3, var4)) { -- if(var1.getBlockId(var2, var3, var4) == this.blockID) { -- this.dropBlockAsItem(var1, var2, var3, var4, var1.getBlockMetadata(var2, var3, var4), 0); -- var1.setBlockToAir(var2, var3, var4); -+ /** -+ * Tests if the block can remain at its current location and will drop as an item if it is unable to stay. Returns True -+ * if it can stay and False if it drops. Args: world, x, y, z -+ */ -+ protected boolean dropTorchIfCantStay(World par1World, int par2, int par3, int par4) { -+ if (!this.canPlaceBlockAt(par1World, par2, par3, par4)) { -+ if (par1World.getBlockId(par2, par3, par4) == this.blockID) { -+ this.dropBlockAsItem(par1World, par2, par3, par4, par1World.getBlockMetadata(par2, par3, par4), 0); -+ par1World.setBlockToAir(par2, par3, par4); - } - - return false; -@@ -142,48 +181,62 @@ - } - } - -- public MovingObjectPosition collisionRayTrace(World var1, int var2, int var3, int var4, Vec3 var5, Vec3 var6) { -- int var7 = var1.getBlockMetadata(var2, var3, var4) & 7; -+ /** -+ * Ray traces through the blocks collision from start vector to end vector returning a ray trace hit. Args: world, x, -+ * y, z, startVec, endVec -+ */ -+ public MovingObjectPosition collisionRayTrace(World par1World, int par2, int par3, int par4, Vec3 par5Vec3, Vec3 par6Vec3) { -+ int var7 = par1World.getBlockMetadata(par2, par3, par4) & 7; - float var8 = 0.15F; -- if(var7 == 1) { -+ -+ if (var7 == 1) { - this.setBlockBounds(0.0F, 0.2F, 0.5F - var8, var8 * 2.0F, 0.8F, 0.5F + var8); -- } else if(var7 == 2) { -+ } else if (var7 == 2) { - this.setBlockBounds(1.0F - var8 * 2.0F, 0.2F, 0.5F - var8, 1.0F, 0.8F, 0.5F + var8); -- } else if(var7 == 3) { -+ } else if (var7 == 3) { - this.setBlockBounds(0.5F - var8, 0.2F, 0.0F, 0.5F + var8, 0.8F, var8 * 2.0F); -- } else if(var7 == 4) { -+ } else if (var7 == 4) { - this.setBlockBounds(0.5F - var8, 0.2F, 1.0F - var8 * 2.0F, 0.5F + var8, 0.8F, 1.0F); - } else { - var8 = 0.1F; - this.setBlockBounds(0.5F - var8, 0.0F, 0.5F - var8, 0.5F + var8, 0.6F, 0.5F + var8); - } - -- return super.collisionRayTrace(var1, var2, var3, var4, var5, var6); -+ return super.collisionRayTrace(par1World, par2, par3, par4, par5Vec3, par6Vec3); - } - -- public void randomDisplayTick(World var1, int var2, int var3, int var4, Random var5) { -- int var6 = var1.getBlockMetadata(var2, var3, var4); -- double var7 = (double)((float)var2 + 0.5F); -- double var9 = (double)((float)var3 + 0.7F); -- double var11 = (double)((float)var4 + 0.5F); -- double var13 = (double)0.22F; -- double var15 = (double)0.27F; -- if(var6 == 1) { -- var1.spawnParticle("smoke", var7 - var15, var9 + var13, var11, 0.0D, 0.0D, 0.0D); -- var1.spawnParticle("flame", var7 - var15, var9 + var13, var11, 0.0D, 0.0D, 0.0D); -- } else if(var6 == 2) { -- var1.spawnParticle("smoke", var7 + var15, var9 + var13, var11, 0.0D, 0.0D, 0.0D); -- var1.spawnParticle("flame", var7 + var15, var9 + var13, var11, 0.0D, 0.0D, 0.0D); -- } else if(var6 == 3) { -- var1.spawnParticle("smoke", var7, var9 + var13, var11 - var15, 0.0D, 0.0D, 0.0D); -- var1.spawnParticle("flame", var7, var9 + var13, var11 - var15, 0.0D, 0.0D, 0.0D); -- } else if(var6 == 4) { -- var1.spawnParticle("smoke", var7, var9 + var13, var11 + var15, 0.0D, 0.0D, 0.0D); -- var1.spawnParticle("flame", var7, var9 + var13, var11 + var15, 0.0D, 0.0D, 0.0D); -+ /** -+ * A randomly called display update to be able to add particles or other items for display -+ */ -+ public void randomDisplayTick(World par1World, int par2, int par3, int par4, Random par5Random) { -+ // Spout Start - Custom blocks -+ Chunk c = par1World.getChunkFromBlockCoords(par2, par4); -+ if (c.spoutChunk.getCustomBlockId(par2, par3, par4) > 0) { -+ return; -+ } -+ // Spout End -+ int var6 = par1World.getBlockMetadata(par2, par3, par4); -+ double var7 = (double)((float)par2 + 0.5F); -+ double var9 = (double)((float)par3 + 0.7F); -+ double var11 = (double)((float)par4 + 0.5F); -+ double var13 = 0.2199999988079071D; -+ double var15 = 0.27000001072883606D; -+ -+ if (var6 == 1) { -+ par1World.spawnParticle("smoke", var7 - var15, var9 + var13, var11, 0.0D, 0.0D, 0.0D); -+ par1World.spawnParticle("flame", var7 - var15, var9 + var13, var11, 0.0D, 0.0D, 0.0D); -+ } else if (var6 == 2) { -+ par1World.spawnParticle("smoke", var7 + var15, var9 + var13, var11, 0.0D, 0.0D, 0.0D); -+ par1World.spawnParticle("flame", var7 + var15, var9 + var13, var11, 0.0D, 0.0D, 0.0D); -+ } else if (var6 == 3) { -+ par1World.spawnParticle("smoke", var7, var9 + var13, var11 - var15, 0.0D, 0.0D, 0.0D); -+ par1World.spawnParticle("flame", var7, var9 + var13, var11 - var15, 0.0D, 0.0D, 0.0D); -+ } else if (var6 == 4) { -+ par1World.spawnParticle("smoke", var7, var9 + var13, var11 + var15, 0.0D, 0.0D, 0.0D); -+ par1World.spawnParticle("flame", var7, var9 + var13, var11 + var15, 0.0D, 0.0D, 0.0D); - } else { -- var1.spawnParticle("smoke", var7, var9, var11, 0.0D, 0.0D, 0.0D); -- var1.spawnParticle("flame", var7, var9, var11, 0.0D, 0.0D, 0.0D); -+ par1World.spawnParticle("smoke", var7, var9, var11, 0.0D, 0.0D, 0.0D); -+ par1World.spawnParticle("flame", var7, var9, var11, 0.0D, 0.0D, 0.0D); - } -- - } - } ---- net/minecraft/src/ProfilerResult.java -+++ net/minecraft/src/ProfilerResult.java -@@ -3,23 +3,23 @@ - public final class ProfilerResult implements Comparable { - public double field_76332_a; - public double field_76330_b; -- public String c; -+ public String field_76331_c; - -- public ProfilerResult(String var1, double var2, double var4) { -- this.c = var1; -- this.field_76332_a = var2; -- this.field_76330_b = var4; -+ public ProfilerResult(String par1Str, double par2, double par4) { -+ this.field_76331_c = par1Str; -+ this.field_76332_a = par2; -+ this.field_76330_b = par4; - } - -- public int func_76328_a(ProfilerResult var1) { -- return var1.field_76332_a < this.field_76332_a ? -1 : (var1.field_76332_a > this.field_76332_a ? 1 : var1.c.compareTo(this.c)); -+ public int func_76328_a(ProfilerResult par1ProfilerResult) { -+ return par1ProfilerResult.field_76332_a < this.field_76332_a ? -1 : (par1ProfilerResult.field_76332_a > this.field_76332_a ? 1 : par1ProfilerResult.field_76331_c.compareTo(this.field_76331_c)); - } - - public int func_76329_a() { -- return (this.c.hashCode() & 11184810) + 4473924; -+ return (this.field_76331_c.hashCode() & 11184810) + 4473924; - } - -- public int compareTo(Object var1) { -- return this.func_76328_a((ProfilerResult)var1); -+ public int compareTo(Object par1Obj) { -+ return this.func_76328_a((ProfilerResult)par1Obj); - } - } ---- net/minecraft/src/StructureNetherBridgePieceWeight.java -+++ net/minecraft/src/StructureNetherBridgePieceWeight.java -@@ -1,24 +1,26 @@ - package net.minecraft.src; - - class StructureNetherBridgePieceWeight { -- public Class a; -+ -+ /** The class of the StructureComponent to which this weight corresponds. */ -+ public Class weightClass; - public final int field_78826_b; - public int field_78827_c; - public int field_78824_d; - public boolean field_78825_e; - -- public StructureNetherBridgePieceWeight(Class var1, int var2, int var3, boolean var4) { -- this.a = var1; -- this.field_78826_b = var2; -- this.field_78824_d = var3; -- this.field_78825_e = var4; -- } -- -- public StructureNetherBridgePieceWeight(Class var1, int var2, int var3) { -- this(var1, var2, var3, false); -- } -- -- public boolean func_78822_a(int var1) { -+ public StructureNetherBridgePieceWeight(Class par1Class, int par2, int par3, boolean par4) { -+ this.weightClass = par1Class; -+ this.field_78826_b = par2; -+ this.field_78824_d = par3; -+ this.field_78825_e = par4; -+ } -+ -+ public StructureNetherBridgePieceWeight(Class par1Class, int par2, int par3) { -+ this(par1Class, par2, par3, false); -+ } -+ -+ public boolean func_78822_a(int par1) { - return this.field_78824_d == 0 || this.field_78827_c < this.field_78824_d; - } - ---- net/minecraft/src/StructureStrongholdPieceWeight3.java -+++ net/minecraft/src/StructureStrongholdPieceWeight3.java -@@ -1,11 +1,11 @@ - package net.minecraft.src; - - final class StructureStrongholdPieceWeight3 extends StructureStrongholdPieceWeight { -- StructureStrongholdPieceWeight3(Class var1, int var2, int var3) { -- super(var1, var2, var3); -+ StructureStrongholdPieceWeight3(Class par1Class, int par2, int par3) { -+ super(par1Class, par2, par3); - } - -- public boolean canSpawnMoreStructuresOfType(int var1) { -- return super.canSpawnMoreStructuresOfType(var1) && var1 > 5; -+ public boolean canSpawnMoreStructuresOfType(int par1) { -+ return super.canSpawnMoreStructuresOfType(par1) && par1 > 5; - } - } ---- net/minecraft/src/ScoreDummyCriteria.java -+++ net/minecraft/src/ScoreDummyCriteria.java -@@ -3,18 +3,18 @@ - import java.util.List; - - public class ScoreDummyCriteria implements ScoreObjectiveCriteria { -- private final String g; -+ private final String field_96644_g; - -- public ScoreDummyCriteria(String var1) { -- this.g = var1; -- ScoreObjectiveCriteria.a.put(var1, this); -+ public ScoreDummyCriteria(String par1Str) { -+ this.field_96644_g = par1Str; -+ ScoreObjectiveCriteria.field_96643_a.put(par1Str, this); - } - - public String func_96636_a() { -- return this.g; -+ return this.field_96644_g; - } - -- public int func_96635_a(List var1) { -+ public int func_96635_a(List par1List) { - return 0; - } - ---- net/minecraft/src/RenderEnderman.java -+++ net/minecraft/src/RenderEnderman.java -@@ -1,78 +1,103 @@ - package net.minecraft.src; - - import java.util.Random; -+ - import org.lwjgl.opengl.GL11; - import org.lwjgl.opengl.GL12; - -+import com.prupe.mcpatcher.mob.MobRandomizer; -+ -+import org.spoutcraft.client.config.Configuration; - public class RenderEnderman extends RenderLiving { - private static final ResourceLocation endermanEyesTexture = new ResourceLocation("textures/entity/enderman/enderman_eyes.png"); - private static final ResourceLocation endermanTextures = new ResourceLocation("textures/entity/enderman/enderman.png"); -- private ModelEnderman endermanModel = (ModelEnderman)this.mainModel; -- private Random h = new Random(); -+ -+ /** The model of the enderman */ -+ private ModelEnderman endermanModel; -+ private Random rnd = new Random(); - - public RenderEnderman() { - super(new ModelEnderman(), 0.5F); -+ this.endermanModel = (ModelEnderman)super.mainModel; - this.setRenderPassModel(this.endermanModel); - } - -- public void renderEnderman(EntityEnderman var1, double var2, double var4, double var6, float var8, float var9) { -- this.endermanModel.isCarrying = var1.getCarried() > 0; -- this.endermanModel.isAttacking = var1.isScreaming(); -- if(var1.isScreaming()) { -+ /** -+ * Renders the enderman -+ */ -+ public void renderEnderman(EntityEnderman par1EntityEnderman, double par2, double par4, double par6, float par8, float par9) { -+ this.endermanModel.isCarrying = par1EntityEnderman.getCarried() > 0; -+ this.endermanModel.isAttacking = par1EntityEnderman.isScreaming(); -+ -+ if (par1EntityEnderman.isScreaming()) { - double var10 = 0.02D; -- var2 += this.h.nextGaussian() * var10; -- var6 += this.h.nextGaussian() * var10; -+ par2 += this.rnd.nextGaussian() * var10; -+ par6 += this.rnd.nextGaussian() * var10; - } - -- super.doRenderLiving(var1, var2, var4, var6, var8, var9); -+ super.doRenderLiving(par1EntityEnderman, par2, par4, par6, par8, par9); - } -- -- protected ResourceLocation getEndermanTextures(EntityEnderman var1) { -+ -+ protected ResourceLocation getEndermanTextures(EntityEnderman par1EntityEnderman) { - return endermanTextures; - } - -- protected void renderCarrying(EntityEnderman var1, float var2) { -- super.renderEquippedItems(var1, var2); -- if(var1.getCarried() > 0) { -+ /** -+ * Render the block an enderman is carrying -+ */ -+ protected void renderCarrying(EntityEnderman par1EntityEnderman, float par2) { -+ super.renderEquippedItems(par1EntityEnderman, par2); -+ -+ if (par1EntityEnderman.getCarried() > 0) { - GL11.glEnable(GL12.GL_RESCALE_NORMAL); - GL11.glPushMatrix(); - float var3 = 0.5F; -- GL11.glTranslatef(0.0F, 11.0F / 16.0F, -(12.0F / 16.0F)); -+ GL11.glTranslatef(0.0F, 0.6875F, -0.75F); - var3 *= 1.0F; - GL11.glRotatef(20.0F, 1.0F, 0.0F, 0.0F); - GL11.glRotatef(45.0F, 0.0F, 1.0F, 0.0F); - GL11.glScalef(-var3, -var3, var3); -- int var4 = var1.getBrightnessForRender(var2); -+ int var4 = par1EntityEnderman.getBrightnessForRender(par2); - int var5 = var4 % 65536; - int var6 = var4 / 65536; - OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, (float)var5 / 1.0F, (float)var6 / 1.0F); - GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - this.bindTexture(TextureMap.locationBlocksTexture); -- this.renderBlocks.renderBlockAsItem(Block.blocksList[var1.getCarried()], var1.getCarryingData(), 1.0F); -+ this.renderBlocks.renderBlockAsItem(Block.blocksList[par1EntityEnderman.getCarried()], par1EntityEnderman.getCarryingData(), 1.0F); - GL11.glPopMatrix(); - GL11.glDisable(GL12.GL_RESCALE_NORMAL); - } -- - } - -- protected int renderEyes(EntityEnderman var1, int var2, float var3) { -- if(var2 != 0) { -+ /** -+ * Render the endermans eyes -+ */ -+ protected int renderEyes(EntityEnderman par1EntityEnderman, int par2, float par3) { -+ if (par2 != 0) { - return -1; - } else { -- this.bindTexture(endermanEyesTexture); -+ // Spout Start -+ if (Configuration.isRandomMobTextures()) { -+ this.bindTexture(MobRandomizer.randomTexture((EntityLivingBase)par1EntityEnderman, endermanEyesTexture)); -+ } else { -+ // ToDO: Fix this. -+ //loadTexture(par1EntityEnderman.getCustomTexture(org.spoutcraft.api.entity.EntitySkinType.ENDERMAN_EYES, "/mob/enderman_eyes.png")); -+ } -+ // Spout End - float var4 = 1.0F; - GL11.glEnable(GL11.GL_BLEND); - GL11.glDisable(GL11.GL_ALPHA_TEST); - GL11.glBlendFunc(GL11.GL_ONE, GL11.GL_ONE); - GL11.glDisable(GL11.GL_LIGHTING); -- if(var1.isInvisible()) { -+ -+ if (par1EntityEnderman.isInvisible()) { - GL11.glDepthMask(false); - } else { - GL11.glDepthMask(true); - } - -- char var5 = '\uf0f0'; -+ char var5 = 61680; - int var6 = var5 % 65536; - int var7 = var5 / 65536; - OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, (float)var6 / 1.0F, (float)var7 / 1.0F); -@@ -83,27 +108,39 @@ - } - } - -- public void doRenderLiving(EntityLiving var1, double var2, double var4, double var6, float var8, float var9) { -- this.renderEnderman((EntityEnderman)var1, var2, var4, var6, var8, var9); -- } -- -- protected int shouldRenderPass(EntityLivingBase var1, int var2, float var3) { -- return this.renderEyes((EntityEnderman)var1, var2, var3); -- } -- -- protected void renderEquippedItems(EntityLivingBase var1, float var2) { -- this.renderCarrying((EntityEnderman)var1, var2); -- } -- -- public void renderPlayer(EntityLivingBase var1, double var2, double var4, double var6, float var8, float var9) { -- this.renderEnderman((EntityEnderman)var1, var2, var4, var6, var8, var9); -- } -- -- protected ResourceLocation getEntityTexture(Entity var1) { -- return this.getEndermanTextures((EntityEnderman)var1); -- } -- -- public void doRender(Entity var1, double var2, double var4, double var6, float var8, float var9) { -- this.renderEnderman((EntityEnderman)var1, var2, var4, var6, var8, var9); -+ public void doRenderLiving(EntityLiving par1EntityLiving, double par2, double par4, double par6, float par8, float par9) { -+ this.renderEnderman((EntityEnderman)par1EntityLiving, par2, par4, par6, par8, par9); -+ } -+ -+ /** -+ * Queries whether should render the specified pass or not. -+ */ -+ protected int shouldRenderPass(EntityLivingBase par1EntityLivingBase, int par2, float par3) { -+ return this.renderEyes((EntityEnderman)par1EntityLivingBase, par2, par3); -+ } -+ -+ protected void renderEquippedItems(EntityLivingBase par1EntityLivingBase, float par2) { -+ this.renderCarrying((EntityEnderman)par1EntityLivingBase, par2); -+ } -+ -+ public void renderPlayer(EntityLivingBase par1EntityLivingBase, double par2, double par4, double par6, float par8, float par9) { -+ this.renderEnderman((EntityEnderman)par1EntityLivingBase, par2, par4, par6, par8, par9); -+ } -+ -+ /** -+ * Returns the location of an entity's texture. Doesn't seem to be called unless you call Render.bindEntityTexture. -+ */ -+ protected ResourceLocation getEntityTexture(Entity par1Entity) { -+ return this.getEndermanTextures((EntityEnderman)par1Entity); -+ } -+ -+ /** -+ * Actually renders the given argument. This is a synthetic bridge method, always casting down its argument and then -+ * handing it off to a worker function which does the actual work. In all probabilty, the class Render is generic -+ * (Render= 0) { -+ public BlockDragonEgg(int par1) { -+ super(par1, Material.dragonEgg); -+ this.setBlockBounds(0.0625F, 0.0F, 0.0625F, 0.9375F, 1.0F, 0.9375F); -+ } -+ -+ /** -+ * Called whenever the block is added into the world. Args: world, x, y, z -+ */ -+ public void onBlockAdded(World par1World, int par2, int par3, int par4) { -+ par1World.scheduleBlockUpdate(par2, par3, par4, this.blockID, this.tickRate(par1World)); -+ } -+ -+ /** -+ * Lets the block know when one of its neighbor changes. Doesn't know which neighbor changed (coordinates passed are -+ * their own) Args: x, y, z, neighbor blockID -+ */ -+ public void onNeighborBlockChange(World par1World, int par2, int par3, int par4, int par5) { -+ par1World.scheduleBlockUpdate(par2, par3, par4, this.blockID, this.tickRate(par1World)); -+ } -+ -+ /** -+ * Ticks the block if it's been scheduled -+ */ -+ public void updateTick(World par1World, int par2, int par3, int par4, Random par5Random) { -+ this.fallIfPossible(par1World, par2, par3, par4); -+ } -+ -+ /** -+ * Checks if the dragon egg can fall down, and if so, makes it fall. -+ */ -+ private void fallIfPossible(World par1World, int par2, int par3, int par4) { -+ if (BlockSand.canFallBelow(par1World, par2, par3 - 1, par4) && par3 >= 0) { - byte var5 = 32; -- if(!BlockSand.fallInstantly && var1.checkChunksExist(var2 - var5, var3 - var5, var4 - var5, var2 + var5, var3 + var5, var4 + var5)) { -- EntityFallingSand var6 = new EntityFallingSand(var1, (double)((float)var2 + 0.5F), (double)((float)var3 + 0.5F), (double)((float)var4 + 0.5F), this.blockID); -- var1.spawnEntityInWorld(var6); -+ -+ if (!BlockSand.fallInstantly && par1World.checkChunksExist(par2 - var5, par3 - var5, par4 - var5, par2 + var5, par3 + var5, par4 + var5)) { -+ EntityFallingSand var6 = new EntityFallingSand(par1World, (double)((float)par2 + 0.5F), (double)((float)par3 + 0.5F), (double)((float)par4 + 0.5F), this.blockID); -+ par1World.spawnEntityInWorld(var6); - } else { -- var1.setBlockToAir(var2, var3, var4); -+ par1World.setBlockToAir(par2, par3, par4); - -- while(BlockSand.canFallBelow(var1, var2, var3 - 1, var4) && var3 > 0) { -- --var3; -+ while (BlockSand.canFallBelow(par1World, par2, par3 - 1, par4) && par3 > 0) { -+ --par3; - } - -- if(var3 > 0) { -- var1.setBlock(var2, var3, var4, this.blockID, 0, 2); -+ if (par3 > 0) { -+ par1World.setBlock(par2, par3, par4, this.blockID, 0, 2); - } - } - } -- - } - -- public boolean onBlockActivated(World var1, int var2, int var3, int var4, EntityPlayer var5, int var6, float var7, float var8, float var9) { -- this.teleportNearby(var1, var2, var3, var4); -+ /** -+ * Called upon block activation (right click on the block.) -+ */ -+ public boolean onBlockActivated(World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer, int par6, float par7, float par8, float par9) { -+ this.teleportNearby(par1World, par2, par3, par4); - return true; - } - -- public void onBlockClicked(World var1, int var2, int var3, int var4, EntityPlayer var5) { -- this.teleportNearby(var1, var2, var3, var4); -+ /** -+ * Called when the block is clicked by a player. Args: x, y, z, entityPlayer -+ */ -+ public void onBlockClicked(World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer) { -+ this.teleportNearby(par1World, par2, par3, par4); - } - -- private void teleportNearby(World var1, int var2, int var3, int var4) { -- if(var1.getBlockId(var2, var3, var4) == this.blockID) { -- for(int var5 = 0; var5 < 1000; ++var5) { -- int var6 = var2 + var1.s.nextInt(16) - var1.s.nextInt(16); -- int var7 = var3 + var1.s.nextInt(8) - var1.s.nextInt(8); -- int var8 = var4 + var1.s.nextInt(16) - var1.s.nextInt(16); -- if(var1.getBlockId(var6, var7, var8) == 0) { -- if(!var1.isRemote) { -- var1.setBlock(var6, var7, var8, this.blockID, var1.getBlockMetadata(var2, var3, var4), 2); -- var1.setBlockToAir(var2, var3, var4); -+ /** -+ * Teleports the dragon egg somewhere else in a 31x19x31 area centered on the egg. -+ */ -+ private void teleportNearby(World par1World, int par2, int par3, int par4) { -+ if (par1World.getBlockId(par2, par3, par4) == this.blockID) { -+ for (int var5 = 0; var5 < 1000; ++var5) { -+ int var6 = par2 + par1World.rand.nextInt(16) - par1World.rand.nextInt(16); -+ int var7 = par3 + par1World.rand.nextInt(8) - par1World.rand.nextInt(8); -+ int var8 = par4 + par1World.rand.nextInt(16) - par1World.rand.nextInt(16); -+ -+ if (par1World.getBlockId(var6, var7, var8) == 0) { -+ if (!par1World.isRemote) { -+ par1World.setBlock(var6, var7, var8, this.blockID, par1World.getBlockMetadata(par2, par3, par4), 2); -+ par1World.setBlockToAir(par2, par3, par4); - } else { - short var9 = 128; - -- for(int var10 = 0; var10 < var9; ++var10) { -- double var11 = var1.s.nextDouble(); -- float var13 = (var1.s.nextFloat() - 0.5F) * 0.2F; -- float var14 = (var1.s.nextFloat() - 0.5F) * 0.2F; -- float var15 = (var1.s.nextFloat() - 0.5F) * 0.2F; -- double var16 = (double)var6 + (double)(var2 - var6) * var11 + (var1.s.nextDouble() - 0.5D) * 1.0D + 0.5D; -- double var18 = (double)var7 + (double)(var3 - var7) * var11 + var1.s.nextDouble() * 1.0D - 0.5D; -- double var20 = (double)var8 + (double)(var4 - var8) * var11 + (var1.s.nextDouble() - 0.5D) * 1.0D + 0.5D; -- var1.spawnParticle("portal", var16, var18, var20, (double)var13, (double)var14, (double)var15); -+ for (int var10 = 0; var10 < var9; ++var10) { -+ double var11 = par1World.rand.nextDouble(); -+ float var13 = (par1World.rand.nextFloat() - 0.5F) * 0.2F; -+ float var14 = (par1World.rand.nextFloat() - 0.5F) * 0.2F; -+ float var15 = (par1World.rand.nextFloat() - 0.5F) * 0.2F; -+ double var16 = (double)var6 + (double)(par2 - var6) * var11 + (par1World.rand.nextDouble() - 0.5D) * 1.0D + 0.5D; -+ double var18 = (double)var7 + (double)(par3 - var7) * var11 + par1World.rand.nextDouble() * 1.0D - 0.5D; -+ double var20 = (double)var8 + (double)(par4 - var8) * var11 + (par1World.rand.nextDouble() - 0.5D) * 1.0D + 0.5D; -+ par1World.spawnParticle("portal", var16, var18, var20, (double)var13, (double)var14, (double)var15); - } - } - - return; - } - } -- - } - } - -- public int tickRate(World var1) { -+ /** -+ * How many world ticks before ticking -+ */ -+ public int tickRate(World par1World) { - return 5; - } - -+ /** -+ * Is this block (a) opaque and (b) a full 1m cube? This determines whether or not to render the shared face of two -+ * adjacent blocks and also whether the player can attach torches, redstone wire, etc to this block. -+ */ - public boolean isOpaqueCube() { - return false; - } - -+ /** -+ * If this block doesn't render as an ordinary block it will return False (examples: signs, buttons, stairs, etc) -+ */ - public boolean renderAsNormalBlock() { - return false; - } - -- public boolean shouldSideBeRendered(IBlockAccess var1, int var2, int var3, int var4, int var5) { -+ /** -+ * Returns true if the given side of this block type should be rendered, if the adjacent block is at the given -+ * coordinates. Args: blockAccess, x, y, z, side -+ */ -+ public boolean shouldSideBeRendered(IBlockAccess par1IBlockAccess, int par2, int par3, int par4, int par5) { - return true; - } - -+ /** -+ * The type of render function that is called for this block -+ */ - public int getRenderType() { - return 27; - } - -- public int idPicked(World var1, int var2, int var3, int var4) { -+ /** -+ * only called by clickMiddleMouseButton , and passed to inventory.setCurrentItem (along with isCreative) -+ */ -+ public int idPicked(World par1World, int par2, int par3, int par4) { - return 0; - } - } ---- /dev/null -+++ com/prupe/mcpatcher/Config$VersionEntry.java -@@ -1,0 +1,9 @@ -+package com.prupe.mcpatcher; -+ -+import com.prupe.mcpatcher.Config$ModEntry; -+import java.util.LinkedHashMap; -+ -+class Config$VersionEntry { -+ String original; -+ LinkedHashMap mods = new LinkedHashMap(); -+} ---- net/minecraft/src/BiomeGenDesert.java -+++ net/minecraft/src/BiomeGenDesert.java -@@ -3,9 +3,9 @@ - import java.util.Random; - - public class BiomeGenDesert extends BiomeGenBase { -- public BiomeGenDesert(int var1) { -- super(var1); -- this.K.clear(); -+ public BiomeGenDesert(int par1) { -+ super(par1); -+ this.spawnableCreatureList.clear(); - this.topBlock = (byte)Block.sand.blockID; - this.fillerBlock = (byte)Block.sand.blockID; - this.theBiomeDecorator.treesPerChunk = -999; -@@ -14,14 +14,14 @@ - this.theBiomeDecorator.cactiPerChunk = 10; - } - -- public void decorate(World var1, Random var2, int var3, int var4) { -- super.decorate(var1, var2, var3, var4); -- if(var2.nextInt(1000) == 0) { -- int var5 = var3 + var2.nextInt(16) + 8; -- int var6 = var4 + var2.nextInt(16) + 8; -+ public void decorate(World par1World, Random par2Random, int par3, int par4) { -+ super.decorate(par1World, par2Random, par3, par4); -+ -+ if (par2Random.nextInt(1000) == 0) { -+ int var5 = par3 + par2Random.nextInt(16) + 8; -+ int var6 = par4 + par2Random.nextInt(16) + 8; - WorldGenDesertWells var7 = new WorldGenDesertWells(); -- var7.generate(var1, var2, var5, var1.getHeightValue(var5, var6) + 1, var6); -+ var7.generate(par1World, par2Random, var5, par1World.getHeightValue(var5, var6) + 1, var6); - } -- - } - } ---- net/minecraft/src/ModelEnderCrystal.java -+++ net/minecraft/src/ModelEnderCrystal.java -@@ -3,42 +3,52 @@ - import org.lwjgl.opengl.GL11; - - public class ModelEnderCrystal extends ModelBase { -+ -+ /** The cube model for the Ender Crystal. */ - private ModelRenderer cube; -+ -+ /** The glass model for the Ender Crystal. */ - private ModelRenderer glass = new ModelRenderer(this, "glass"); -+ -+ /** The base model for the Ender Crystal. */ - private ModelRenderer base; - -- public ModelEnderCrystal(float var1, boolean var2) { -+ public ModelEnderCrystal(float par1, boolean par2) { - this.glass.setTextureOffset(0, 0).addBox(-4.0F, -4.0F, -4.0F, 8, 8, 8); - this.cube = new ModelRenderer(this, "cube"); - this.cube.setTextureOffset(32, 0).addBox(-4.0F, -4.0F, -4.0F, 8, 8, 8); -- if(var2) { -+ -+ if (par2) { - this.base = new ModelRenderer(this, "base"); - this.base.setTextureOffset(0, 16).addBox(-6.0F, 0.0F, -6.0F, 12, 4, 12); - } -- - } - -- public void render(Entity var1, float var2, float var3, float var4, float var5, float var6, float var7) { -+ /** -+ * Sets the models various rotation angles then renders the model. -+ */ -+ public void render(Entity par1Entity, float par2, float par3, float par4, float par5, float par6, float par7) { - GL11.glPushMatrix(); - GL11.glScalef(2.0F, 2.0F, 2.0F); - GL11.glTranslatef(0.0F, -0.5F, 0.0F); -- if(this.base != null) { -- this.base.render(var7); -+ -+ if (this.base != null) { -+ this.base.render(par7); - } - -- GL11.glRotatef(var3, 0.0F, 1.0F, 0.0F); -- GL11.glTranslatef(0.0F, 0.8F + var4, 0.0F); -- GL11.glRotatef(60.0F, 0.7071F, 0.0F, 0.7071F); -- this.glass.render(var7); -- float var8 = 14.0F / 16.0F; -- GL11.glScalef(var8, var8, var8); -- GL11.glRotatef(60.0F, 0.7071F, 0.0F, 0.7071F); -- GL11.glRotatef(var3, 0.0F, 1.0F, 0.0F); -- this.glass.render(var7); -- GL11.glScalef(var8, var8, var8); -- GL11.glRotatef(60.0F, 0.7071F, 0.0F, 0.7071F); -- GL11.glRotatef(var3, 0.0F, 1.0F, 0.0F); -- this.cube.render(var7); -+ GL11.glRotatef(par3, 0.0F, 1.0F, 0.0F); -+ GL11.glTranslatef(0.0F, 0.8F + par4, 0.0F); -+ GL11.glRotatef(60.0F, 0.7071F, 0.0F, 0.7071F); -+ this.glass.render(par7); -+ float var8 = 0.875F; -+ GL11.glScalef(var8, var8, var8); -+ GL11.glRotatef(60.0F, 0.7071F, 0.0F, 0.7071F); -+ GL11.glRotatef(par3, 0.0F, 1.0F, 0.0F); -+ this.glass.render(par7); -+ GL11.glScalef(var8, var8, var8); -+ GL11.glRotatef(60.0F, 0.7071F, 0.0F, 0.7071F); -+ GL11.glRotatef(par3, 0.0F, 1.0F, 0.0F); -+ this.cube.render(par7); - GL11.glPopMatrix(); - } - } ---- /dev/null -+++ org/spoutcraft/client/gui/minimap/ScaleToggleCheckBox.java -@@ -1,0 +1,35 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.client.gui.minimap; -+ -+import org.spoutcraft.api.gui.GenericCheckBox; -+ -+public class ScaleToggleCheckBox extends GenericCheckBox { -+ public ScaleToggleCheckBox() { -+ super("Scale Minimap"); -+ setChecked(MinimapConfig.getInstance().isScale()); -+ setTooltip("Scale Minimap\nThe minimap will resize itself based on the \ndimensions of your screen."); -+ } -+ -+ @Override -+ public void onButtonClick() { -+ MinimapConfig.getInstance().setScale(isChecked()); -+ } -+} ---- net/minecraft/src/RenderPlayer.java -+++ net/minecraft/src/RenderPlayer.java -@@ -2,43 +2,64 @@ - - import org.lwjgl.opengl.GL11; - --public class RenderPlayer extends RendererLivingEntity { -+import org.bukkit.ChatColor; -+import org.spoutcraft.client.SpoutClient; -+import org.spoutcraft.client.player.accessories.AccessoryHandler; -+import org.spoutcraft.client.player.accessories.AccessoryType; -+import org.spoutcraft.client.special.VIP; -+import org.spoutcraft.client.special.Resources; -+ -+public class RenderPlayer extends RenderLiving { - private static final ResourceLocation steveTextures = new ResourceLocation("textures/entity/steve.png"); -- private ModelBiped modelBipedMain = (ModelBiped)this.mainModel; -- private ModelBiped modelArmorChestplate = new ModelBiped(1.0F); -- private ModelBiped modelArmor = new ModelBiped(0.5F); -+ -+ // Spout Start - private to public -+ public ModelBiped modelBipedMain; -+ // Spout End -+ private ModelBiped modelArmorChestplate; -+ private ModelBiped modelArmor; - - public RenderPlayer() { - super(new ModelBiped(0.0F), 0.5F); -+ this.modelBipedMain = (ModelBiped)this.mainModel; -+ this.modelArmorChestplate = new ModelBiped(1.0F); -+ this.modelArmor = new ModelBiped(0.5F); - } - -- protected int setArmorModel(AbstractClientPlayer var1, int var2, float var3) { -- ItemStack var4 = var1.inventory.armorItemInSlot(3 - var2); -- if(var4 != null) { -+ /** -+ * Set the specified armor model as the player model. Args: player, armorSlot, partialTick -+ */ -+ -+ protected int setArmorModel(AbstractClientPlayer par1AbstractClientPlayer, int par2, float par3) { -+ ItemStack var4 = par1AbstractClientPlayer.inventory.armorItemInSlot(3 - par2); -+ -+ if (var4 != null) { - Item var5 = var4.getItem(); -- if(var5 instanceof ItemArmor) { -+ -+ if (var5 instanceof ItemArmor) { - ItemArmor var6 = (ItemArmor)var5; -- this.bindTexture(RenderBiped.func_110857_a(var6, var2)); -- ModelBiped var7 = var2 == 2 ? this.modelArmor : this.modelArmorChestplate; -- var7.bipedHead.showModel = var2 == 0; -- var7.bipedHeadwear.showModel = var2 == 0; -- var7.bipedBody.showModel = var2 == 1 || var2 == 2; -- var7.bipedRightArm.showModel = var2 == 1; -- var7.bipedLeftArm.showModel = var2 == 1; -- var7.bipedRightLeg.showModel = var2 == 2 || var2 == 3; -- var7.bipedLeftLeg.showModel = var2 == 2 || var2 == 3; -+ this.bindTexture(RenderBiped.func_110857_a(var6, par2)); -+ ModelBiped var7 = par2 == 2 ? this.modelArmor : this.modelArmorChestplate; -+ var7.bipedHead.showModel = par2 == 0; -+ var7.bipedHeadwear.showModel = par2 == 0; -+ var7.bipedBody.showModel = par2 == 1 || par2 == 2; -+ var7.bipedRightArm.showModel = par2 == 1; -+ var7.bipedLeftArm.showModel = par2 == 1; -+ var7.bipedRightLeg.showModel = par2 == 2 || par2 == 3; -+ var7.bipedLeftLeg.showModel = par2 == 2 || par2 == 3; - this.setRenderPassModel(var7); - var7.onGround = this.mainModel.onGround; - var7.isRiding = this.mainModel.isRiding; - var7.isChild = this.mainModel.isChild; - float var8 = 1.0F; -- if(var6.getArmorMaterial() == EnumArmorMaterial.CLOTH) { -+ -+ if (var6.getArmorMaterial() == EnumArmorMaterial.CLOTH) { - int var9 = var6.getColor(var4); - float var10 = (float)(var9 >> 16 & 255) / 255.0F; - float var11 = (float)(var9 >> 8 & 255) / 255.0F; - float var12 = (float)(var9 & 255) / 255.0F; - GL11.glColor3f(var8 * var10, var8 * var11, var8 * var12); -- if(var4.isItemEnchanted()) { -+ -+ if (var4.isItemEnchanted()) { - return 31; - } - -@@ -46,7 +67,8 @@ - } - - GL11.glColor3f(var8, var8, var8); -- if(var4.isItemEnchanted()) { -+ -+ if (var4.isItemEnchanted()) { - return 15; - } - -@@ -57,73 +79,90 @@ - return -1; - } - -- protected void func_130220_b(AbstractClientPlayer var1, int var2, float var3) { -- ItemStack var4 = var1.inventory.armorItemInSlot(3 - var2); -- if(var4 != null) { -+ protected void func_130220_b(AbstractClientPlayer par1AbstractClientPlayer, int par2, float par3) { -+ ItemStack var4 = par1AbstractClientPlayer.inventory.armorItemInSlot(3 - par2); -+ -+ if (var4 != null) { - Item var5 = var4.getItem(); -- if(var5 instanceof ItemArmor) { -- this.bindTexture(RenderBiped.func_110858_a((ItemArmor)var5, var2, "overlay")); -+ -+ if (var5 instanceof ItemArmor) { -+ this.bindTexture(RenderBiped.func_110858_a((ItemArmor)var5, par2, "overlay")); - float var6 = 1.0F; - GL11.glColor3f(var6, var6, var6); - } - } -- - } - -- public void func_130009_a(AbstractClientPlayer var1, double var2, double var4, double var6, float var8, float var9) { -+ //ToDo: Missing from this method (renderPlayer) is the Accessorize Code -+ public void func_130009_a(AbstractClientPlayer par1AbstractClientPlayer, double par2, double par4, double par6, float par8, float par9) { - float var10 = 1.0F; - GL11.glColor3f(var10, var10, var10); -- ItemStack var11 = var1.inventory.getCurrentItem(); -+ ItemStack var11 = par1AbstractClientPlayer.inventory.getCurrentItem(); - this.modelArmorChestplate.heldItemRight = this.modelArmor.heldItemRight = this.modelBipedMain.heldItemRight = var11 != null ? 1 : 0; -- if(var11 != null && var1.getItemInUseCount() > 0) { -+ -+ if (var11 != null && par1AbstractClientPlayer.getItemInUseCount() > 0) { - EnumAction var12 = var11.getItemUseAction(); -- if(var12 == EnumAction.block) { -+ -+ if (var12 == EnumAction.block) { - this.modelArmorChestplate.heldItemRight = this.modelArmor.heldItemRight = this.modelBipedMain.heldItemRight = 3; -- } else if(var12 == EnumAction.bow) { -+ } else if (var12 == EnumAction.bow) { - this.modelArmorChestplate.aimedBow = this.modelArmor.aimedBow = this.modelBipedMain.aimedBow = true; - } - } - -- this.modelArmorChestplate.isSneak = this.modelArmor.isSneak = this.modelBipedMain.isSneak = var1.isSneaking(); -- double var14 = var4 - (double)var1.yOffset; -- if(var1.isSneaking() && !(var1 instanceof EntityPlayerSP)) { -+ this.modelArmorChestplate.isSneak = this.modelArmor.isSneak = this.modelBipedMain.isSneak = par1AbstractClientPlayer.isSneaking(); -+ double var14 = par4 - (double)par1AbstractClientPlayer.yOffset; -+ -+ if (par1AbstractClientPlayer.isSneaking() && !(par1AbstractClientPlayer instanceof EntityPlayerSP)) { - var14 -= 0.125D; - } -- -- super.doRenderLiving(var1, var2, var14, var6, var8, var9); -+ -+ // Spout Start - VIP -+ if (!AccessoryHandler.isHandled(par1AbstractClientPlayer.username)) { -+ AccessoryHandler.addVIPAccessoriesFor(par1AbstractClientPlayer); -+ } -+ // Spout End - VIP -+ super.doRenderLiving(par1AbstractClientPlayer, par2, var14, par6, par8, par9); - this.modelArmorChestplate.aimedBow = this.modelArmor.aimedBow = this.modelBipedMain.aimedBow = false; - this.modelArmorChestplate.isSneak = this.modelArmor.isSneak = this.modelBipedMain.isSneak = false; - this.modelArmorChestplate.heldItemRight = this.modelArmor.heldItemRight = this.modelBipedMain.heldItemRight = 0; - } - -- protected ResourceLocation func_110817_a(AbstractClientPlayer var1) { -- return var1.getLocationSkin(); -+ protected ResourceLocation func_110817_a(AbstractClientPlayer par1AbstractClientPlayer) { -+ return par1AbstractClientPlayer.getLocationSkin(); - } -- -- protected void renderSpecials(AbstractClientPlayer var1, float var2) { -+ -+ /** -+ * Method for adding special render rules -+ */ -+ -+ protected void renderSpecials(AbstractClientPlayer par1AbstractClientPlayer, float par2) { - float var3 = 1.0F; - GL11.glColor3f(var3, var3, var3); -- super.renderEquippedItems(var1, var2); -- super.renderArrowsStuckInEntity(var1, var2); -- ItemStack var4 = var1.inventory.armorItemInSlot(3); -- if(var4 != null) { -+ super.renderEquippedItems(par1AbstractClientPlayer, par2); -+ super.renderArrowsStuckInEntity(par1AbstractClientPlayer, par2); -+ ItemStack var4 = par1AbstractClientPlayer.inventory.armorItemInSlot(3); -+ -+ if (var4 != null) { - GL11.glPushMatrix(); -- this.modelBipedMain.bipedHead.postRender(1.0F / 16.0F); -+ this.modelBipedMain.bipedHead.postRender(0.0625F); - float var5; -- if(var4.getItem().itemID < 256) { -- if(RenderBlocks.renderItemIn3d(Block.blocksList[var4.itemID].getRenderType())) { -- var5 = 10.0F / 16.0F; -+ -+ if (var4.getItem().itemID < 256) { -+ if (RenderBlocks.renderItemIn3d(Block.blocksList[var4.itemID].getRenderType())) { -+ var5 = 0.625F; - GL11.glTranslatef(0.0F, -0.25F, 0.0F); - GL11.glRotatef(90.0F, 0.0F, 1.0F, 0.0F); - GL11.glScalef(var5, -var5, -var5); - } - -- this.renderManager.itemRenderer.renderItem(var1, var4, 0); -- } else if(var4.getItem().itemID == Item.skull.itemID) { -+ this.renderManager.itemRenderer.renderItem(par1AbstractClientPlayer, var4, 0); -+ } else if (var4.getItem().itemID == Item.skull.itemID) { - var5 = 1.0625F; - GL11.glScalef(var5, -var5, -var5); - String var6 = ""; -- if(var4.hasTagCompound() && var4.getTagCompound().hasKey("SkullOwner")) { -+ -+ if (var4.hasTagCompound() && var4.getTagCompound().hasKey("SkullOwner")) { - var6 = var4.getTagCompound().getString("SkullOwner"); - } - -@@ -132,59 +171,69 @@ - - GL11.glPopMatrix(); - } -- -- if(var1.getCommandSenderName().equals("deadmau5") && var1.getTextureSkin().isTextureUploaded()) { -- this.bindTexture(var1.getLocationSkin()); -- -- for(int var23 = 0; var23 < 2; ++var23) { -- float var25 = var1.prevRotationYaw + (var1.rotationYaw - var1.prevRotationYaw) * var2 - (var1.prevRenderYawOffset + (var1.renderYawOffset - var1.prevRenderYawOffset) * var2); -- float var7 = var1.prevRotationPitch + (var1.rotationPitch - var1.prevRotationPitch) * var2; -+ -+ // Spout Start -+ if (!par1AbstractClientPlayer.isInvisible()){ -+ AccessoryHandler.renderAllAccessories(par1AbstractClientPlayer, 0.0625F, par2); -+ } -+ // Spout End -+ -+ if (par1AbstractClientPlayer.getCommandSenderName().equals("deadmau5") && par1AbstractClientPlayer.getTextureSkin().isTextureUploaded()) { -+ this.bindTexture(par1AbstractClientPlayer.getLocationSkin()); -+ -+ for (int var23 = 0; var23 < 2; ++var23) { -+ float var27 = par1AbstractClientPlayer.prevRotationYaw + (par1AbstractClientPlayer.rotationYaw - par1AbstractClientPlayer.prevRotationYaw) * par2 - (par1AbstractClientPlayer.prevRenderYawOffset + (par1AbstractClientPlayer.renderYawOffset - par1AbstractClientPlayer.prevRenderYawOffset) * par2); -+ float var7 = par1AbstractClientPlayer.prevRotationPitch + (par1AbstractClientPlayer.rotationPitch - par1AbstractClientPlayer.prevRotationPitch) * par2; - GL11.glPushMatrix(); -- GL11.glRotatef(var25, 0.0F, 1.0F, 0.0F); -+ GL11.glRotatef(var27, 0.0F, 1.0F, 0.0F); - GL11.glRotatef(var7, 1.0F, 0.0F, 0.0F); -- GL11.glTranslatef(6.0F / 16.0F * (float)(var23 * 2 - 1), 0.0F, 0.0F); -- GL11.glTranslatef(0.0F, -(6.0F / 16.0F), 0.0F); -+ GL11.glTranslatef(0.375F * (float)(var23 * 2 - 1), 0.0F, 0.0F); -+ GL11.glTranslatef(0.0F, -0.375F, 0.0F); - GL11.glRotatef(-var7, 1.0F, 0.0F, 0.0F); -- GL11.glRotatef(-var25, 0.0F, 1.0F, 0.0F); -- float var8 = 4.0F / 3.0F; -+ GL11.glRotatef(-var27, 0.0F, 1.0F, 0.0F); -+ float var8 = 1.3333334F; - GL11.glScalef(var8, var8, var8); -- this.modelBipedMain.renderEars(1.0F / 16.0F); -+ this.modelBipedMain.renderEars(0.0625F); - GL11.glPopMatrix(); - } - } - -- boolean var24 = var1.getTextureCape().isTextureUploaded(); -- boolean var26 = !var1.isInvisible(); -- boolean var27 = !var1.getHideCape(); -+ boolean var24 = par1AbstractClientPlayer.getTextureCape().isTextureUploaded(); -+ boolean var25 = !par1AbstractClientPlayer.isInvisible(); -+ boolean var26 = !par1AbstractClientPlayer.getHideCape(); - float var14; -- if(var24 && var26 && var27) { -- this.bindTexture(var1.getLocationCape()); -+ -+ if (var24 && var25 && var26) { -+ this.bindTexture(par1AbstractClientPlayer.getLocationCape()); - GL11.glPushMatrix(); -- GL11.glTranslatef(0.0F, 0.0F, 2.0F / 16.0F); -- double var28 = var1.field_71091_bM + (var1.field_71094_bP - var1.field_71091_bM) * (double)var2 - (var1.prevPosX + (var1.posX - var1.prevPosX) * (double)var2); -- double var10 = var1.field_71096_bN + (var1.field_71095_bQ - var1.field_71096_bN) * (double)var2 - (var1.prevPosY + (var1.posY - var1.prevPosY) * (double)var2); -- double var12 = var1.field_71097_bO + (var1.field_71085_bR - var1.field_71097_bO) * (double)var2 - (var1.prevPosZ + (var1.posZ - var1.prevPosZ) * (double)var2); -- var14 = var1.prevRenderYawOffset + (var1.renderYawOffset - var1.prevRenderYawOffset) * var2; -+ GL11.glTranslatef(0.0F, 0.0F, 0.125F); -+ double var29 = par1AbstractClientPlayer.field_71091_bM + (par1AbstractClientPlayer.field_71094_bP - par1AbstractClientPlayer.field_71091_bM) * (double)par2 - (par1AbstractClientPlayer.prevPosX + (par1AbstractClientPlayer.posX - par1AbstractClientPlayer.prevPosX) * (double)par2); -+ double var10 = par1AbstractClientPlayer.field_71096_bN + (par1AbstractClientPlayer.field_71095_bQ - par1AbstractClientPlayer.field_71096_bN) * (double)par2 - (par1AbstractClientPlayer.prevPosY + (par1AbstractClientPlayer.posY - par1AbstractClientPlayer.prevPosY) * (double)par2); -+ double var12 = par1AbstractClientPlayer.field_71097_bO + (par1AbstractClientPlayer.field_71085_bR - par1AbstractClientPlayer.field_71097_bO) * (double)par2 - (par1AbstractClientPlayer.prevPosZ + (par1AbstractClientPlayer.posZ - par1AbstractClientPlayer.prevPosZ) * (double)par2); -+ var14 = par1AbstractClientPlayer.prevRenderYawOffset + (par1AbstractClientPlayer.renderYawOffset - par1AbstractClientPlayer.prevRenderYawOffset) * par2; - double var15 = (double)MathHelper.sin(var14 * (float)Math.PI / 180.0F); - double var17 = (double)(-MathHelper.cos(var14 * (float)Math.PI / 180.0F)); - float var19 = (float)var10 * 10.0F; -- if(var19 < -6.0F) { -+ -+ if (var19 < -6.0F) { - var19 = -6.0F; - } - -- if(var19 > 32.0F) { -+ if (var19 > 32.0F) { - var19 = 32.0F; - } - -- float var20 = (float)(var28 * var15 + var12 * var17) * 100.0F; -- float var21 = (float)(var28 * var17 - var12 * var15) * 100.0F; -- if(var20 < 0.0F) { -+ float var20 = (float)(var29 * var15 + var12 * var17) * 100.0F; -+ float var21 = (float)(var29 * var17 - var12 * var15) * 100.0F; -+ -+ if (var20 < 0.0F) { - var20 = 0.0F; - } - -- float var22 = var1.prevCameraYaw + (var1.cameraYaw - var1.prevCameraYaw) * var2; -- var19 += MathHelper.sin((var1.prevDistanceWalkedModified + (var1.distanceWalkedModified - var1.prevDistanceWalkedModified) * var2) * 6.0F) * 32.0F * var22; -- if(var1.isSneaking()) { -+ float var22 = par1AbstractClientPlayer.prevCameraYaw + (par1AbstractClientPlayer.cameraYaw - par1AbstractClientPlayer.prevCameraYaw) * par2; -+ var19 += MathHelper.sin((par1AbstractClientPlayer.prevDistanceWalkedModified + (par1AbstractClientPlayer.distanceWalkedModified - par1AbstractClientPlayer.prevDistanceWalkedModified) * par2) * 6.0F) * 32.0F * var22; -+ -+ if (par1AbstractClientPlayer.isSneaking()) { - var19 += 25.0F; - } - -@@ -192,181 +241,219 @@ - GL11.glRotatef(var21 / 2.0F, 0.0F, 0.0F, 1.0F); - GL11.glRotatef(-var21 / 2.0F, 0.0F, 1.0F, 0.0F); - GL11.glRotatef(180.0F, 0.0F, 1.0F, 0.0F); -- this.modelBipedMain.renderCloak(1.0F / 16.0F); -+ this.modelBipedMain.renderCloak(0.0625F); - GL11.glPopMatrix(); - } - -- ItemStack var29 = var1.inventory.getCurrentItem(); -- if(var29 != null) { -+ ItemStack var28 = par1AbstractClientPlayer.inventory.getCurrentItem(); -+ -+ if (var28 != null) { - GL11.glPushMatrix(); -- this.modelBipedMain.bipedRightArm.postRender(1.0F / 16.0F); -- GL11.glTranslatef(-(1.0F / 16.0F), 7.0F / 16.0F, 1.0F / 16.0F); -- if(var1.fishEntity != null) { -- var29 = new ItemStack(Item.stick); -+ this.modelBipedMain.bipedRightArm.postRender(0.0625F); -+ GL11.glTranslatef(-0.0625F, 0.4375F, 0.0625F); -+ -+ if (par1AbstractClientPlayer.fishEntity != null) { -+ var28 = new ItemStack(Item.stick); - } - - EnumAction var9 = null; -- if(var1.getItemInUseCount() > 0) { -- var9 = var29.getItemUseAction(); -+ -+ if (par1AbstractClientPlayer.getItemInUseCount() > 0) { -+ var9 = var28.getItemUseAction(); - } - -- float var30; -- if(var29.itemID < 256 && RenderBlocks.renderItemIn3d(Block.blocksList[var29.itemID].getRenderType())) { -- var30 = 0.5F; -- GL11.glTranslatef(0.0F, 3.0F / 16.0F, -(5.0F / 16.0F)); -- var30 *= 12.0F / 16.0F; -+ float var31; -+ -+ if (var28.itemID < 256 && RenderBlocks.renderItemIn3d(Block.blocksList[var28.itemID].getRenderType())) { -+ var31 = 0.5F; -+ GL11.glTranslatef(0.0F, 0.1875F, -0.3125F); -+ var31 *= 0.75F; - GL11.glRotatef(20.0F, 1.0F, 0.0F, 0.0F); - GL11.glRotatef(45.0F, 0.0F, 1.0F, 0.0F); -- GL11.glScalef(-var30, -var30, var30); -- } else if(var29.itemID == Item.bow.itemID) { -- var30 = 10.0F / 16.0F; -- GL11.glTranslatef(0.0F, 2.0F / 16.0F, 5.0F / 16.0F); -+ GL11.glScalef(-var31, -var31, var31); -+ } else if (var28.itemID == Item.bow.itemID) { -+ var31 = 0.625F; -+ GL11.glTranslatef(0.0F, 0.125F, 0.3125F); - GL11.glRotatef(-20.0F, 0.0F, 1.0F, 0.0F); -- GL11.glScalef(var30, -var30, var30); -+ GL11.glScalef(var31, -var31, var31); - GL11.glRotatef(-100.0F, 1.0F, 0.0F, 0.0F); - GL11.glRotatef(45.0F, 0.0F, 1.0F, 0.0F); -- } else if(Item.itemsList[var29.itemID].isFull3D()) { -- var30 = 10.0F / 16.0F; -- if(Item.itemsList[var29.itemID].shouldRotateAroundWhenRendering()) { -+ } else if (Item.itemsList[var28.itemID].isFull3D()) { -+ var31 = 0.625F; -+ -+ if (Item.itemsList[var28.itemID].shouldRotateAroundWhenRendering()) { - GL11.glRotatef(180.0F, 0.0F, 0.0F, 1.0F); -- GL11.glTranslatef(0.0F, -(2.0F / 16.0F), 0.0F); -+ GL11.glTranslatef(0.0F, -0.125F, 0.0F); - } - -- if(var1.getItemInUseCount() > 0 && var9 == EnumAction.block) { -+ if (par1AbstractClientPlayer.getItemInUseCount() > 0 && var9 == EnumAction.block) { - GL11.glTranslatef(0.05F, 0.0F, -0.1F); - GL11.glRotatef(-50.0F, 0.0F, 1.0F, 0.0F); - GL11.glRotatef(-10.0F, 1.0F, 0.0F, 0.0F); - GL11.glRotatef(-60.0F, 0.0F, 0.0F, 1.0F); - } - -- GL11.glTranslatef(0.0F, 3.0F / 16.0F, 0.0F); -- GL11.glScalef(var30, -var30, var30); -+ GL11.glTranslatef(0.0F, 0.1875F, 0.0F); -+ GL11.glScalef(var31, -var31, var31); - GL11.glRotatef(-100.0F, 1.0F, 0.0F, 0.0F); - GL11.glRotatef(45.0F, 0.0F, 1.0F, 0.0F); - } else { -- var30 = 6.0F / 16.0F; -- GL11.glTranslatef(0.25F, 3.0F / 16.0F, -(3.0F / 16.0F)); -- GL11.glScalef(var30, var30, var30); -+ var31 = 0.375F; -+ GL11.glTranslatef(0.25F, 0.1875F, -0.1875F); -+ GL11.glScalef(var31, var31, var31); - GL11.glRotatef(60.0F, 0.0F, 0.0F, 1.0F); - GL11.glRotatef(-90.0F, 1.0F, 0.0F, 0.0F); - GL11.glRotatef(20.0F, 0.0F, 0.0F, 1.0F); - } - - float var13; -- int var32; -- float var33; -- if(var29.getItem().requiresMultipleRenderPasses()) { -- for(var32 = 0; var32 <= 1; ++var32) { -- int var31 = var29.getItem().getColorFromItemStack(var29, var32); -- var33 = (float)(var31 >> 16 & 255) / 255.0F; -- var13 = (float)(var31 >> 8 & 255) / 255.0F; -- var14 = (float)(var31 & 255) / 255.0F; -- GL11.glColor4f(var33, var13, var14, 1.0F); -- this.renderManager.itemRenderer.renderItem(var1, var29, var32); -+ float var32; -+ int var33; -+ -+ if (var28.getItem().requiresMultipleRenderPasses()) { -+ for (var33 = 0; var33 <= 1; ++var33) { -+ int var11 = var28.getItem().getColorFromItemStack(var28, var33); -+ var32 = (float)(var11 >> 16 & 255) / 255.0F; -+ var13 = (float)(var11 >> 8 & 255) / 255.0F; -+ var14 = (float)(var11 & 255) / 255.0F; -+ GL11.glColor4f(var32, var13, var14, 1.0F); -+ this.renderManager.itemRenderer.renderItem(par1AbstractClientPlayer, var28, var33); - } - } else { -- var32 = var29.getItem().getColorFromItemStack(var29, 0); -- float var11 = (float)(var32 >> 16 & 255) / 255.0F; -- var33 = (float)(var32 >> 8 & 255) / 255.0F; -- var13 = (float)(var32 & 255) / 255.0F; -- GL11.glColor4f(var11, var33, var13, 1.0F); -- this.renderManager.itemRenderer.renderItem(var1, var29, 0); -+ var33 = var28.getItem().getColorFromItemStack(var28, 0); -+ float var30 = (float)(var33 >> 16 & 255) / 255.0F; -+ var32 = (float)(var33 >> 8 & 255) / 255.0F; -+ var13 = (float)(var33 & 255) / 255.0F; -+ GL11.glColor4f(var30, var32, var13, 1.0F); -+ this.renderManager.itemRenderer.renderItem(par1AbstractClientPlayer, var28, 0); - } - - GL11.glPopMatrix(); - } -- - } - -- protected void renderPlayerScale(AbstractClientPlayer var1, float var2) { -- float var3 = 15.0F / 16.0F; -+ protected void renderPlayerScale(AbstractClientPlayer par1AbstractClientPlayer, float par2) { -+ float var3 = 0.9375F; -+ // Spout Start -+ String cleanUserName = ChatColor.stripColor(par1AbstractClientPlayer.getEntityName()); -+ VIP vip = Resources.getVIP(cleanUserName); -+ -+ if (vip != null) { -+ var3 = vip.getScale(); -+ } -+ // Spout End - GL11.glScalef(var3, var3, var3); - } - -- protected void func_96450_a(AbstractClientPlayer var1, double var2, double var4, double var6, String var8, float var9, double var10) { -- if(var10 < 100.0D) { -- Scoreboard var12 = var1.getWorldScoreboard(); -+ protected void func_96450_a(AbstractClientPlayer par1AbstractClientPlayer, double par2, double par4, double par6, String par8Str, float par9, double par10) { -+ if (par10 < 100.0D) { -+ Scoreboard var12 = par1AbstractClientPlayer.getWorldScoreboard(); - ScoreObjective var13 = var12.func_96539_a(2); -- if(var13 != null) { -- Score var14 = var12.func_96529_a(var1.getEntityName(), var13); -- if(var1.isPlayerSleeping()) { -- this.renderLivingLabel(var1, var14.getScorePoints() + " " + var13.getDisplayName(), var2, var4 - 1.5D, var6, 64); -+ -+ if (var13 != null) { -+ Score var14 = var12.func_96529_a(par1AbstractClientPlayer.getEntityName(), var13); -+ -+ if (par1AbstractClientPlayer.isPlayerSleeping()) { -+ this.renderLivingLabel(par1AbstractClientPlayer, var14.getScorePoints() + " " + var13.getDisplayName(), par2, par4 - 1.5D, par6, 64); - } else { -- this.renderLivingLabel(var1, var14.getScorePoints() + " " + var13.getDisplayName(), var2, var4, var6, 64); -+ this.renderLivingLabel(par1AbstractClientPlayer, var14.getScorePoints() + " " + var13.getDisplayName(), par2, par4, par6, 64); - } - -- var4 += (double)((float)this.getFontRendererFromRenderManager().FONT_HEIGHT * 1.15F * var9); -+ par4 += (double)((float)this.getFontRendererFromRenderManager().FONT_HEIGHT * 1.15F * par9); - } - } - -- super.func_96449_a(var1, var2, var4, var6, var8, var9, var10); -+ super.func_96449_a(par1AbstractClientPlayer, par2, par4, par6, par8Str, par9, par10); - } - -- public void renderFirstPersonArm(EntityPlayer var1) { -+ public void renderFirstPersonArm(EntityPlayer par1EntityPlayer) { - float var2 = 1.0F; - GL11.glColor3f(var2, var2, var2); - this.modelBipedMain.onGround = 0.0F; -- this.modelBipedMain.setRotationAngles(0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 1.0F / 16.0F, var1); -- this.modelBipedMain.bipedRightArm.render(1.0F / 16.0F); -+ this.modelBipedMain.setRotationAngles(0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0625F, par1EntityPlayer); -+ this.modelBipedMain.bipedRightArm.render(0.0625F); - } - -- protected void renderPlayerSleep(AbstractClientPlayer var1, double var2, double var4, double var6) { -- if(var1.isEntityAlive() && var1.isPlayerSleeping()) { -- super.renderLivingAt(var1, var2 + (double)var1.field_71079_bU, var4 + (double)var1.field_71082_cx, var6 + (double)var1.field_71089_bV); -+ /** -+ * Renders player with sleeping offset if sleeping -+ */ -+ protected void renderPlayerSleep(AbstractClientPlayer par1AbstractClientPlayer, double par2, double par4, double par6) { -+ if (par1AbstractClientPlayer.isEntityAlive() && par1AbstractClientPlayer.isPlayerSleeping()) { -+ super.renderLivingAt(par1AbstractClientPlayer, par2 + (double)par1AbstractClientPlayer.field_71079_bU, par4 + (double)par1AbstractClientPlayer.field_71082_cx, par6 + (double)par1AbstractClientPlayer.field_71089_bV); - } else { -- super.renderLivingAt(var1, var2, var4, var6); -+ super.renderLivingAt(par1AbstractClientPlayer, par2, par4, par6); - } -- - } - -- protected void rotatePlayer(AbstractClientPlayer var1, float var2, float var3, float var4) { -- if(var1.isEntityAlive() && var1.isPlayerSleeping()) { -- GL11.glRotatef(var1.getBedOrientationInDegrees(), 0.0F, 1.0F, 0.0F); -- GL11.glRotatef(this.getDeathMaxRotation(var1), 0.0F, 0.0F, 1.0F); -+ /** -+ * Rotates the player if the player is sleeping. This method is called in rotateCorpse. -+ */ -+ protected void rotatePlayer(AbstractClientPlayer par1AbstractClientPlayer, float par2, float par3, float par4) { -+ if (par1AbstractClientPlayer.isEntityAlive() && par1AbstractClientPlayer.isPlayerSleeping()) { -+ GL11.glRotatef(par1AbstractClientPlayer.getBedOrientationInDegrees(), 0.0F, 1.0F, 0.0F); -+ GL11.glRotatef(this.getDeathMaxRotation(par1AbstractClientPlayer), 0.0F, 0.0F, 1.0F); - GL11.glRotatef(270.0F, 0.0F, 1.0F, 0.0F); - } else { -- super.rotateCorpse(var1, var2, var3, var4); -+ super.rotateCorpse(par1AbstractClientPlayer, par2, par3, par4); - } -- -- } -- -- protected void func_96449_a(EntityLivingBase var1, double var2, double var4, double var6, String var8, float var9, double var10) { -- this.func_96450_a((AbstractClientPlayer)var1, var2, var4, var6, var8, var9, var10); -- } -- -- protected void preRenderCallback(EntityLivingBase var1, float var2) { -- this.renderPlayerScale((AbstractClientPlayer)var1, var2); -- } -- -- protected void func_82408_c(EntityLivingBase var1, int var2, float var3) { -- this.func_130220_b((AbstractClientPlayer)var1, var2, var3); -- } -- -- protected int shouldRenderPass(EntityLivingBase var1, int var2, float var3) { -- return this.setArmorModel((AbstractClientPlayer)var1, var2, var3); -- } -- -- protected void renderEquippedItems(EntityLivingBase var1, float var2) { -- this.renderSpecials((AbstractClientPlayer)var1, var2); -- } -- -- protected void rotateCorpse(EntityLivingBase var1, float var2, float var3, float var4) { -- this.rotatePlayer((AbstractClientPlayer)var1, var2, var3, var4); -- } -- -- protected void renderLivingAt(EntityLivingBase var1, double var2, double var4, double var6) { -- this.renderPlayerSleep((AbstractClientPlayer)var1, var2, var4, var6); -- } -- -- public void doRenderLiving(EntityLivingBase var1, double var2, double var4, double var6, float var8, float var9) { -- this.func_130009_a((AbstractClientPlayer)var1, var2, var4, var6, var8, var9); -- } -- -- protected ResourceLocation getEntityTexture(Entity var1) { -- return this.func_110817_a((AbstractClientPlayer)var1); -- } -- -- public void doRender(Entity var1, double var2, double var4, double var6, float var8, float var9) { -- this.func_130009_a((AbstractClientPlayer)var1, var2, var4, var6, var8, var9); -+ } -+ -+ protected void func_96449_a(EntityLivingBase par1EntityLivingBase, double par2, double par4, double par6, String par8Str, float par9, double par10) { -+ this.func_96450_a((AbstractClientPlayer)par1EntityLivingBase, par2, par4, par6, par8Str, par9, par10); -+ } -+ -+ /** -+ * Allows the render to do any OpenGL state modifications necessary before the model is rendered. Args: entityLiving, -+ * partialTickTime -+ */ -+ protected void preRenderCallback(EntityLivingBase par1EntityLivingBase, float par2) { -+ this.renderPlayerScale((AbstractClientPlayer)par1EntityLivingBase, par2); -+ } -+ -+ protected void func_82408_c(EntityLivingBase par1EntityLivingBase, int par2, float par3) { -+ this.func_130220_b((AbstractClientPlayer)par1EntityLivingBase, par2, par3); -+ } -+ -+ /** -+ * Queries whether should render the specified pass or not. -+ */ -+ protected int shouldRenderPass(EntityLivingBase par1EntityLivingBase, int par2, float par3) { -+ return this.setArmorModel((AbstractClientPlayer)par1EntityLivingBase, par2, par3); -+ } -+ -+ protected void renderEquippedItems(EntityLivingBase par1EntityLivingBase, float par2) { -+ this.renderSpecials((AbstractClientPlayer)par1EntityLivingBase, par2); -+ } -+ -+ protected void rotateCorpse(EntityLivingBase par1EntityLivingBase, float par2, float par3, float par4) { -+ this.rotatePlayer((AbstractClientPlayer)par1EntityLivingBase, par2, par3, par4); -+ } -+ -+ /** -+ * Sets a simple glTranslate on a LivingEntity. -+ */ -+ protected void renderLivingAt(EntityLivingBase par1EntityLivingBase, double par2, double par4, double par6) { -+ this.renderPlayerSleep((AbstractClientPlayer)par1EntityLivingBase, par2, par4, par6); -+ } -+ -+ public void doRenderLiving(EntityLivingBase par1EntityLivingBase, double par2, double par4, double par6, float par8, float par9) { -+ this.func_130009_a((AbstractClientPlayer)par1EntityLivingBase, par2, par4, par6, par8, par9); -+ } -+ -+ /** -+ * Returns the location of an entity's texture. Doesn't seem to be called unless you call Render.bindEntityTexture. -+ */ -+ protected ResourceLocation getEntityTexture(Entity par1Entity) { -+ return this.func_110817_a((AbstractClientPlayer)par1Entity); -+ } -+ -+ /** -+ * Actually renders the given argument. This is a synthetic bridge method, always casting down its argument and then -+ * handing it off to a worker function which does the actual work. In all probabilty, the class Render is generic -+ * (Render -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.client.packet; -+ -+import java.io.IOException; -+ -+import net.minecraft.src.GuiYesNo; -+ -+import org.spoutcraft.api.io.SpoutInputStream; -+import org.spoutcraft.api.io.SpoutOutputStream; -+import org.spoutcraft.client.SpoutClient; -+import org.spoutcraft.client.gui.CustomScreen; -+import org.spoutcraft.client.gui.precache.GuiPrecache; -+import org.spoutcraft.client.io.FileDownloadThread; -+ -+public class PacketPreCacheCompleted implements SpoutPacket { -+ public PacketPreCacheCompleted() { -+ System.out.println("[Spoutcraft Cache Manager] Completed: " + System.currentTimeMillis()); -+ } -+ -+ public int getNumBytes() { -+ return 0; -+ } -+ -+ public void readData(SpoutInputStream input) throws IOException { -+ } -+ -+ public void writeData(SpoutOutputStream output) throws IOException { -+ } -+ -+ public void run(int playerId) { -+ FileDownloadThread.preCacheCompleted.set(System.currentTimeMillis()); -+ SpoutClient.getInstance().getPacketManager().sendSpoutPacket(this); -+ if (!(SpoutClient.getHandle().currentScreen instanceof CustomScreen) && !(SpoutClient.getHandle().currentScreen instanceof GuiYesNo)) { -+ // Closes downloading terrain -+ SpoutClient.getHandle().displayGuiScreen(null, false); -+ // Prevent closing a plugin created menu from opening the downloading terrain -+ SpoutClient.getHandle().clearPreviousScreen(); -+ } -+ if (SpoutClient.getHandle().currentScreen instanceof GuiPrecache) { -+ // Closes downloading terrain -+ SpoutClient.getHandle().displayGuiScreen(null, false); -+ // Prevent closing a plugin created menu from opening the downloading terrain -+ SpoutClient.getHandle().clearPreviousScreen(); -+ } -+ } -+ -+ public void failure(int playerId) { -+ } -+ -+ public PacketType getPacketType() { -+ return PacketType.PacketPreCacheCompleted; -+ } -+ -+ public int getVersion() { -+ return 0; -+ } -+} ---- /dev/null -+++ org/spoutcraft/api/gui/GenericItemWidget.java -@@ -1,0 +1,115 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.api.gui; -+ -+import java.io.IOException; -+ -+import org.spoutcraft.api.Spoutcraft; -+import org.spoutcraft.api.UnsafeClass; -+import org.spoutcraft.api.inventory.ItemStack; -+import org.spoutcraft.api.io.SpoutInputStream; -+import org.spoutcraft.api.io.SpoutOutputStream; -+ -+@UnsafeClass -+public class GenericItemWidget extends GenericWidget implements ItemWidget { -+ protected int material = -1; -+ protected short data = -1; -+ protected int depth = 8; -+ protected ItemStack toRender = null; -+ -+ public GenericItemWidget() { -+ this(new ItemStack(0)); -+ } -+ -+ public GenericItemWidget(ItemStack item) { -+ this.material = item.getTypeId(); -+ this.data = item.getDurability(); -+ } -+ -+ public int getVersion() { -+ return super.getVersion() + 0; -+ } -+ -+ @Override -+ public void readData(SpoutInputStream input) throws IOException { -+ super.readData(input); -+ this.setTypeId(input.readInt()); -+ this.setData(input.readShort()); -+ this.setDepth(input.readInt()); -+ } -+ -+ @Override -+ public void writeData(SpoutOutputStream output) throws IOException { -+ super.writeData(output); -+ output.writeInt(getTypeId()); -+ output.writeShort(getData()); -+ output.writeInt(getDepth()); -+ } -+ -+ public ItemWidget setTypeId(int id) { -+ this.material = id; -+ return this; -+ } -+ -+ public int getTypeId() { -+ return material; -+ } -+ -+ public ItemWidget setData(short data) { -+ this.data = data; -+ return this; -+ } -+ -+ public short getData() { -+ return data; -+ } -+ -+ public ItemWidget setDepth(int depth) { -+ this.depth = depth; -+ return this; -+ } -+ -+ public int getDepth() { -+ return depth; -+ } -+ -+ public ItemWidget setHeight(int height) { -+ super.setHeight(height); -+ return this; -+ } -+ -+ public ItemWidget setWidth(int width) { -+ super.setWidth(width); -+ return this; -+ } -+ -+ public WidgetType getType() { -+ return WidgetType.ItemWidget; -+ } -+ -+ @Override -+ public ItemWidget copy() { -+ return ((ItemWidget)super.copy()).setTypeId(getTypeId()).setData(getData()).setDepth(getDepth()); -+ } -+ -+ public void render() { -+ Spoutcraft.getClient().getRenderDelegate().render(this); -+ } -+} ---- net/minecraft/src/SaveHandler.java -+++ net/minecraft/src/SaveHandler.java -@@ -9,29 +9,43 @@ - import net.minecraft.server.MinecraftServer; - - public class SaveHandler implements ISaveHandler, IPlayerFileData { -- private final File a; -- private final File b; -- private final File c; -- private final long initializationTime = MinecraftServer.getCurrentTimeMillis(); -- private final String e; -- -- public SaveHandler(File var1, String var2, boolean var3) { -- this.a = new File(var1, var2); -- this.a.mkdirs(); -- this.b = new File(this.a, "players"); -- this.c = new File(this.a, "data"); -- this.c.mkdirs(); -- this.e = var2; -- if(var3) { -- this.b.mkdirs(); -+ -+ /** The directory in which to save world data. */ -+ private final File worldDirectory; -+ -+ /** The directory in which to save player data. */ -+ private final File playersDirectory; -+ private final File mapDataDir; -+ -+ /** -+ * The time in milliseconds when this field was initialized. Stored in the session lock file. -+ */ -+ private final long initializationTime = MinecraftServer.getSystemTimeMillis(); -+ -+ /** The directory name of the world */ -+ private final String saveDirectoryName; -+ -+ public SaveHandler(File par1File, String par2Str, boolean par3) { -+ this.worldDirectory = new File(par1File, par2Str); -+ this.worldDirectory.mkdirs(); -+ this.playersDirectory = new File(this.worldDirectory, "players"); -+ this.mapDataDir = new File(this.worldDirectory, "data"); -+ this.mapDataDir.mkdirs(); -+ this.saveDirectoryName = par2Str; -+ -+ if (par3) { -+ this.playersDirectory.mkdirs(); - } - - this.setSessionLock(); - } - -+ /** -+ * Creates a session lock file for this process -+ */ - private void setSessionLock() { - try { -- File var1 = new File(this.a, "session.lock"); -+ File var1 = new File(this.worldDirectory, "session.lock"); - DataOutputStream var2 = new DataOutputStream(new FileOutputStream(var1)); - - try { -@@ -39,44 +53,55 @@ - } finally { - var2.close(); - } -- - } catch (IOException var7) { - var7.printStackTrace(); - throw new RuntimeException("Failed to check session lock, aborting"); - } - } - -+ /** -+ * Gets the File object corresponding to the base directory of this world. -+ */ - protected File getWorldDirectory() { -- return this.a; -+ return this.worldDirectory; - } - -+ /** -+ * Checks the session lock to prevent save collisions -+ */ - public void checkSessionLock() throws MinecraftException { - try { -- File var1 = new File(this.a, "session.lock"); -+ File var1 = new File(this.worldDirectory, "session.lock"); - DataInputStream var2 = new DataInputStream(new FileInputStream(var1)); - - try { -- if(var2.readLong() != this.initializationTime) { -+ if (var2.readLong() != this.initializationTime) { - throw new MinecraftException("The save is being accessed from another location, aborting"); - } - } finally { - var2.close(); - } -- - } catch (IOException var7) { - throw new MinecraftException("Failed to check session lock, aborting"); - } - } - -- public IChunkLoader getChunkLoader(WorldProvider var1) { -+ /** -+ * Returns the chunk loader with the provided world provider -+ */ -+ public IChunkLoader getChunkLoader(WorldProvider par1WorldProvider) { - throw new RuntimeException("Old Chunk Storage is no longer supported."); - } - -+ /** -+ * Loads and returns the world info -+ */ - public WorldInfo loadWorldInfo() { -- File var1 = new File(this.a, "level.dat"); -+ File var1 = new File(this.worldDirectory, "level.dat"); - NBTTagCompound var2; - NBTTagCompound var3; -- if(var1.exists()) { -+ -+ if (var1.exists()) { - try { - var2 = CompressedStreamTools.readCompressed(new FileInputStream(var1)); - var3 = var2.getCompoundTag("Data"); -@@ -86,8 +111,9 @@ - } - } - -- var1 = new File(this.a, "level.dat_old"); -- if(var1.exists()) { -+ var1 = new File(this.worldDirectory, "level.dat_old"); -+ -+ if (var1.exists()) { - try { - var2 = CompressedStreamTools.readCompressed(new FileInputStream(var1)); - var3 = var2.getCompoundTag("Data"); -@@ -100,113 +126,140 @@ - return null; - } - -- public void saveWorldInfoWithPlayer(WorldInfo var1, NBTTagCompound var2) { -- NBTTagCompound var3 = var1.cloneNBTCompound(var2); -+ /** -+ * Saves the given World Info with the given NBTTagCompound as the Player. -+ */ -+ public void saveWorldInfoWithPlayer(WorldInfo par1WorldInfo, NBTTagCompound par2NBTTagCompound) { -+ NBTTagCompound var3 = par1WorldInfo.cloneNBTCompound(par2NBTTagCompound); - NBTTagCompound var4 = new NBTTagCompound(); - var4.setTag("Data", var3); - - try { -- File var5 = new File(this.a, "level.dat_new"); -- File var6 = new File(this.a, "level.dat_old"); -- File var7 = new File(this.a, "level.dat"); -+ File var5 = new File(this.worldDirectory, "level.dat_new"); -+ File var6 = new File(this.worldDirectory, "level.dat_old"); -+ File var7 = new File(this.worldDirectory, "level.dat"); - CompressedStreamTools.writeCompressed(var4, new FileOutputStream(var5)); -- if(var6.exists()) { -+ -+ if (var6.exists()) { - var6.delete(); - } - - var7.renameTo(var6); -- if(var7.exists()) { -+ -+ if (var7.exists()) { - var7.delete(); - } - - var5.renameTo(var7); -- if(var5.exists()) { -+ -+ if (var5.exists()) { - var5.delete(); - } - } catch (Exception var8) { - var8.printStackTrace(); - } -- - } - -- public void saveWorldInfo(WorldInfo var1) { -- NBTTagCompound var2 = var1.getNBTTagCompound(); -+ /** -+ * Saves the passed in world info. -+ */ -+ public void saveWorldInfo(WorldInfo par1WorldInfo) { -+ NBTTagCompound var2 = par1WorldInfo.getNBTTagCompound(); - NBTTagCompound var3 = new NBTTagCompound(); - var3.setTag("Data", var2); - - try { -- File var4 = new File(this.a, "level.dat_new"); -- File var5 = new File(this.a, "level.dat_old"); -- File var6 = new File(this.a, "level.dat"); -+ File var4 = new File(this.worldDirectory, "level.dat_new"); -+ File var5 = new File(this.worldDirectory, "level.dat_old"); -+ File var6 = new File(this.worldDirectory, "level.dat"); - CompressedStreamTools.writeCompressed(var3, new FileOutputStream(var4)); -- if(var5.exists()) { -+ -+ if (var5.exists()) { - var5.delete(); - } - - var6.renameTo(var5); -- if(var6.exists()) { -+ -+ if (var6.exists()) { - var6.delete(); - } - - var4.renameTo(var6); -- if(var4.exists()) { -+ -+ if (var4.exists()) { - var4.delete(); - } - } catch (Exception var7) { - var7.printStackTrace(); - } -- - } - -- public void writePlayerData(EntityPlayer var1) { -+ /** -+ * Writes the player data to disk from the specified PlayerEntityMP. -+ */ -+ public void writePlayerData(EntityPlayer par1EntityPlayer) { - try { - NBTTagCompound var2 = new NBTTagCompound(); -- var1.writeToNBT(var2); -- File var3 = new File(this.b, var1.getCommandSenderName() + ".dat.tmp"); -- File var4 = new File(this.b, var1.getCommandSenderName() + ".dat"); -+ par1EntityPlayer.writeToNBT(var2); -+ File var3 = new File(this.playersDirectory, par1EntityPlayer.getCommandSenderName() + ".dat.tmp"); -+ File var4 = new File(this.playersDirectory, par1EntityPlayer.getCommandSenderName() + ".dat"); - CompressedStreamTools.writeCompressed(var2, new FileOutputStream(var3)); -- if(var4.exists()) { -+ -+ if (var4.exists()) { - var4.delete(); - } - - var3.renameTo(var4); - } catch (Exception var5) { -- MinecraftServer.getServer().getLogAgent().logWarning("Failed to save player data for " + var1.getCommandSenderName()); -+ MinecraftServer.getServer().getLogAgent().logWarning("Failed to save player data for " + par1EntityPlayer.getCommandSenderName()); - } -- - } - -- public NBTTagCompound readPlayerData(EntityPlayer var1) { -- NBTTagCompound var2 = this.getPlayerData(var1.getCommandSenderName()); -- if(var2 != null) { -- var1.readFromNBT(var2); -+ /** -+ * Reads the player data from disk into the specified PlayerEntityMP. -+ */ -+ public NBTTagCompound readPlayerData(EntityPlayer par1EntityPlayer) { -+ NBTTagCompound var2 = this.getPlayerData(par1EntityPlayer.getCommandSenderName()); -+ -+ if (var2 != null) { -+ par1EntityPlayer.readFromNBT(var2); - } - - return var2; - } - -- public NBTTagCompound getPlayerData(String var1) { -+ /** -+ * Gets the player data for the given playername as a NBTTagCompound. -+ */ -+ public NBTTagCompound getPlayerData(String par1Str) { - try { -- File var2 = new File(this.b, var1 + ".dat"); -- if(var2.exists()) { -+ File var2 = new File(this.playersDirectory, par1Str + ".dat"); -+ -+ if (var2.exists()) { - return CompressedStreamTools.readCompressed(new FileInputStream(var2)); - } - } catch (Exception var3) { -- MinecraftServer.getServer().getLogAgent().logWarning("Failed to load player data for " + var1); -+ MinecraftServer.getServer().getLogAgent().logWarning("Failed to load player data for " + par1Str); - } - - return null; - } - -- public IPlayerFileData getPlayerNBTManager() { -+ /** -+ * returns null if no saveHandler is relevent (eg. SMP) -+ */ -+ public IPlayerFileData getSaveHandler() { - return this; - } - -+ /** -+ * Returns an array of usernames for which player.dat exists for. -+ */ - public String[] getAvailablePlayerDat() { -- String[] var1 = this.b.list(); -+ String[] var1 = this.playersDirectory.list(); - -- for(int var2 = 0; var2 < var1.length; ++var2) { -- if(var1[var2].endsWith(".dat")) { -+ for (int var2 = 0; var2 < var1.length; ++var2) { -+ if (var1[var2].endsWith(".dat")) { - var1[var2] = var1[var2].substring(0, var1[var2].length() - 4); - } - } -@@ -214,14 +267,22 @@ - return var1; - } - -- public void flush() { -- } -- -- public File getMapFileFromName(String var1) { -- return new File(this.c, var1 + ".dat"); -- } -- -+ /** -+ * Called to flush all changes to disk, waiting for them to complete. -+ */ -+ public void flush() {} -+ -+ /** -+ * Gets the file location of the given map -+ */ -+ public File getMapFileFromName(String par1Str) { -+ return new File(this.mapDataDir, par1Str + ".dat"); -+ } -+ -+ /** -+ * Returns the name of the directory where world information is saved. -+ */ - public String getWorldDirectoryName() { -- return this.e; -+ return this.saveDirectoryName; - } - } ---- /dev/null -+++ org/spoutcraft/client/gui/server/MinecraftServiceListener.java -@@ -1,0 +1,65 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.client.gui.server; -+ -+import java.net.InetAddress; -+import java.util.Timer; -+import java.util.TimerTask; -+ -+import javax.jmdns.ServiceEvent; -+import javax.jmdns.ServiceListener; -+ -+public class MinecraftServiceListener implements ServiceListener { -+ private LANModel model; -+ private Timer timer; -+ -+ public MinecraftServiceListener(LANModel lanModel) { -+ this.model = lanModel; -+ this.timer = new Timer(); -+ } -+ -+ @Override -+ public void serviceAdded(final ServiceEvent arg0) { -+ //System.out.println("Service Added " + arg0); -+ timer.schedule(new TimerTask() { -+ @Override -+ public void run() { -+ model.dns.requestServiceInfo(arg0.getType(), arg0.getName(), 5000); -+ } -+ }, 200); -+ } -+ -+ @Override -+ public void serviceRemoved(ServiceEvent arg0) { -+ //System.out.println("Service Removed " + arg0); -+ model.removeItem(arg0.getName()); -+ } -+ -+ @Override -+ public void serviceResolved(ServiceEvent arg0) { -+ //System.out.println("Service Resolved " + arg0); -+ InetAddress[] addresses = arg0.getInfo().getInetAddresses(); -+ if (addresses.length > 0) { -+ InetAddress address = addresses[0]; -+ ServerItem item = new ServerItem(arg0.getName(), address.getHostAddress(), arg0.getInfo().getPort(), -1); -+ model.addItem(item); -+ } -+ } -+} ---- /dev/null -+++ com/prupe/mcpatcher/ctm/TileOverrideImpl.java -@@ -1,0 +1,4 @@ -+package com.prupe.mcpatcher.ctm; -+ -+class TileOverrideImpl { -+} ---- /dev/null -+++ org/spoutcraft/api/gui/ArmorBar.java -@@ -1,0 +1,152 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.api.gui; -+ -+import java.io.IOException; -+import java.util.UUID; -+ -+import org.spoutcraft.api.Spoutcraft; -+import org.spoutcraft.api.UnsafeClass; -+import org.spoutcraft.api.io.SpoutInputStream; -+import org.spoutcraft.api.io.SpoutOutputStream; -+ -+@UnsafeClass -+public class ArmorBar extends GenericWidget { -+ private int icons = 10; -+ private boolean alwaysVisible = false; -+ private int iconOffset = 8; -+ -+ public ArmorBar() { -+ super(); -+ setX(427 / 2 - 91); // 122 -+ setY(191); -+ setAnchor(WidgetAnchor.BOTTOM_CENTER); -+ } -+ -+ @Override -+ public void readData(SpoutInputStream input) throws IOException { -+ super.readData(input); -+ setMaxNumShields(input.readInt()); -+ setAlwaysVisible(input.readBoolean()); -+ setIconOffset(input.readInt()); -+ } -+ -+ @Override -+ public void writeData(SpoutOutputStream output) throws IOException { -+ super.writeData(output); -+ output.writeInt(getMaxNumShields()); -+ output.writeBoolean(isAlwaysVisible()); -+ output.writeInt(getIconOffset()); -+ } -+ -+ public WidgetType getType() { -+ return WidgetType.ArmorBar; -+ } -+ -+ @Override -+ public double getScreenX() { -+ double mid = getScreen() != null ? getScreen().getWidth() / 2 : 427 / 2D; -+ double diff = super.getScreenX() - mid - 31; -+ return getScreen() != null ? getScreen().getWidth() / 2D - diff : this.getX(); -+ } -+ -+ @Override -+ public double getScreenY() { -+ int diff = (int) (240 - this.getY()); -+ return getScreen() != null ? getScreen().getHeight() - diff : this.getY(); -+ } -+ -+ public UUID getId() { -+ return new UUID(0, 0); -+ } -+ -+ /** -+ * Gets the maximum number of shields displayed on the HUD. -+ * -+ * Armor is scaled to fit the number of shields appropriately. -+ * -+ * @return shields displayed -+ */ -+ public int getMaxNumShields() { -+ return icons; -+ } -+ -+ /** -+ * Sets the maximum number of shields displayed on the HUD. -+ * -+ * Armor is scaled to fit the number of shields appropriately. -+ * -+ * @param shields to display -+ * @return this -+ */ -+ public ArmorBar setMaxNumShields(int icons) { -+ this.icons = icons; -+ return this; -+ } -+ -+ /** -+ * True if the armor bar will appear even when the player has no armor equipped. -+ * -+ * @return always visible -+ */ -+ public boolean isAlwaysVisible() { -+ return alwaysVisible; -+ } -+ -+ /** -+ * Forces the armor bar to appear, even when the player has no armor equipped. -+ * -+ * @param visible -+ * @return this -+ */ -+ public ArmorBar setAlwaysVisible(boolean visible) { -+ alwaysVisible = visible; -+ return this; -+ } -+ -+ /** -+ * Gets the number of pixels each shield is offset when drawing the next shield. -+ * -+ * @return pixel offset -+ */ -+ public int getIconOffset() { -+ return iconOffset; -+ } -+ -+ /** -+ * Sets the number of pixels each shield is offset when drawing the next shield. -+ * -+ * @param offset when drawing shields -+ * @return this -+ */ -+ public ArmorBar setIconOffset(int offset) { -+ iconOffset = offset; -+ return this; -+ } -+ -+ public void render() { -+ Spoutcraft.getClient().getRenderDelegate().render(this); -+ } -+ -+ @Override -+ public int getVersion() { -+ return super.getVersion() + 1; -+ } -+} ---- net/minecraft/src/RenderSkeleton.java -+++ net/minecraft/src/RenderSkeleton.java -@@ -10,30 +10,36 @@ - super(new ModelSkeleton(), 0.5F); - } - -- protected void scaleSkeleton(EntitySkeleton var1, float var2) { -- if(var1.getSkeletonType() == 1) { -+ protected void scaleSkeleton(EntitySkeleton par1EntitySkeleton, float par2) { -+ if (par1EntitySkeleton.getSkeletonType() == 1) { - GL11.glScalef(1.2F, 1.2F, 1.2F); - } -- - } - - protected void func_82422_c() { -- GL11.glTranslatef(0.09375F, 3.0F / 16.0F, 0.0F); -- } -- -- protected ResourceLocation func_110860_a(EntitySkeleton var1) { -- return var1.getSkeletonType() == 1 ? witherSkeletonTextures : skeletonTextures; -- } -- -- protected ResourceLocation func_110856_a(EntityLiving var1) { -- return this.func_110860_a((EntitySkeleton)var1); -- } -- -- protected void preRenderCallback(EntityLivingBase var1, float var2) { -- this.scaleSkeleton((EntitySkeleton)var1, var2); -- } -- -- protected ResourceLocation getEntityTexture(Entity var1) { -- return this.func_110860_a((EntitySkeleton)var1); -+ GL11.glTranslatef(0.09375F, 0.1875F, 0.0F); -+ } -+ -+ protected ResourceLocation func_110860_a(EntitySkeleton par1EntitySkeleton) { -+ return par1EntitySkeleton.getSkeletonType() == 1 ? witherSkeletonTextures : skeletonTextures; -+ } -+ -+ protected ResourceLocation func_110856_a(EntityLiving par1EntityLiving) { -+ return this.func_110860_a((EntitySkeleton)par1EntityLiving); -+ } -+ -+ /** -+ * Allows the render to do any OpenGL state modifications necessary before the model is rendered. Args: entityLiving, -+ * partialTickTime -+ */ -+ protected void preRenderCallback(EntityLivingBase par1EntityLivingBase, float par2) { -+ this.scaleSkeleton((EntitySkeleton)par1EntityLivingBase, par2); -+ } -+ -+ /** -+ * Returns the location of an entity's texture. Doesn't seem to be called unless you call Render.bindEntityTexture. -+ */ -+ protected ResourceLocation getEntityTexture(Entity par1Entity) { -+ return this.func_110860_a((EntitySkeleton)par1Entity); - } - } ---- /dev/null -+++ org/spoutcraft/client/inventory/CraftInventory.java -@@ -1,0 +1,376 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.client.inventory; -+ -+import java.util.HashMap; -+ -+import net.minecraft.src.IInventory; -+ -+import org.spoutcraft.api.inventory.Inventory; -+import org.spoutcraft.api.inventory.ItemStack; -+import org.spoutcraft.api.material.Material; -+ -+public class CraftInventory implements Inventory { -+ protected IInventory inventory; -+ -+ private static net.minecraft.src.ItemStack[] getContents(IInventory inventory) { -+ net.minecraft.src.ItemStack[] contents = new net.minecraft.src.ItemStack[inventory.getSizeInventory()]; -+ for (int i = 0; i < inventory.getSizeInventory(); i++) { -+ contents[i] = inventory.getStackInSlot(i); -+ } -+ return contents; -+ } -+ -+ public CraftInventory(IInventory inventory) { -+ this.inventory = inventory; -+ } -+ -+ public IInventory getInventory() { -+ return inventory; -+ } -+ -+ public int getSize() { -+ return getInventory().getSizeInventory(); -+ } -+ -+ public String getName() { -+ return getInventory().getInvName(); -+ } -+ -+ public ItemStack getItem(int index) { -+ return new CraftItemStack(getInventory().getStackInSlot(index)); -+ } -+ -+ public ItemStack[] getContents() { -+ ItemStack[] items = new ItemStack[getSize()]; -+ net.minecraft.src.ItemStack[] mcItems = getContents(getInventory()); -+ -+ for (int i = 0; i < mcItems.length; i++) { -+ items[i] = mcItems[i] == null ? null : new CraftItemStack(mcItems[i]); -+ } -+ -+ return items; -+ } -+ -+ public void setContents(ItemStack[] items) { -+ net.minecraft.src.ItemStack[] mcItems = getContents(getInventory()); -+ if (mcItems.length != items.length) { -+ throw new IllegalArgumentException("Invalid inventory size; expected " + mcItems.length); -+ } -+ -+ for (int i = 0; i < items.length; i++) { -+ ItemStack item = items[i]; -+ if (item == null || item.getTypeId() <= 0) { -+ getInventory().setInventorySlotContents(i, null); -+ } else { -+ getInventory().setInventorySlotContents(i, new net.minecraft.src.ItemStack(item.getTypeId(), item.getAmount(), item.getDurability())); -+ } -+ } -+ } -+ -+ public void setItem(int index, ItemStack item) { -+ getInventory().setInventorySlotContents(index, (item == null ? null : new net.minecraft.src.ItemStack(item.getTypeId(), item.getAmount(), item.getDurability()))); -+ } -+ -+ public boolean contains(int materialId) { -+ for (ItemStack item: getContents()) { -+ if (item != null && item.getTypeId() == materialId) { -+ return true; -+ } -+ } -+ return false; -+ } -+ -+ public boolean contains(Material material) { -+ return contains(material.getRawId()); -+ } -+ -+ public boolean contains(ItemStack item) { -+ if (item == null) { -+ return false; -+ } -+ for (ItemStack i: getContents()) { -+ if (item.equals(i)) { -+ return true; -+ } -+ } -+ return false; -+ } -+ -+ public boolean contains(int materialId, int amount) { -+ int amt = 0; -+ for (ItemStack item: getContents()) { -+ if (item != null && item.getTypeId() == materialId) { -+ amt += item.getAmount(); -+ } -+ } -+ return amt >= amount; -+ } -+ -+ public boolean contains(Material material, int amount) { -+ return contains(material.getRawId(), amount); -+ } -+ -+ public boolean contains(ItemStack item, int amount) { -+ if (item == null) { -+ return false; -+ } -+ int amt = 0; -+ for (ItemStack i: getContents()) { -+ if (item.equals(i)) { -+ amt += item.getAmount(); -+ } -+ } -+ return amt >= amount; -+ } -+ -+ public HashMap all(int materialId) { -+ HashMap slots = new HashMap(); -+ -+ ItemStack[] inventory = getContents(); -+ for (int i = 0; i < inventory.length; i++) { -+ ItemStack item = inventory[i]; -+ if (item != null && item.getTypeId() == materialId) { -+ slots.put(i, item); -+ } -+ } -+ return slots; -+ } -+ -+ public HashMap all(Material material) { -+ return all(material.getRawId()); -+ } -+ -+ public HashMap all(ItemStack item) { -+ HashMap slots = new HashMap(); -+ if (item != null) { -+ ItemStack[] inventory = getContents(); -+ for (int i = 0; i < inventory.length; i++) { -+ if (item.equals(inventory[i])) { -+ slots.put(i, inventory[i]); -+ } -+ } -+ } -+ return slots; -+ } -+ -+ public int first(int materialId) { -+ ItemStack[] inventory = getContents(); -+ for (int i = 0; i < inventory.length; i++) { -+ ItemStack item = inventory[i]; -+ if (item != null && item.getTypeId() == materialId) { -+ return i; -+ } -+ } -+ return -1; -+ } -+ -+ public int first(Material material) { -+ return first(material.getRawId()); -+ } -+ -+ public int first(ItemStack item) { -+ if (item == null) { -+ return -1; -+ } -+ ItemStack[] inventory = getContents(); -+ for (int i = 0; i < inventory.length; i++) { -+ if (item.equals(inventory[i])) { -+ return i; -+ } -+ } -+ return -1; -+ } -+ -+ public int firstEmpty() { -+ ItemStack[] inventory = getContents(); -+ for (int i = 0; i < inventory.length; i++) { -+ if (inventory[i] == null) { -+ return i; -+ } -+ } -+ return -1; -+ } -+ -+ public int firstPartial(int materialId) { -+ ItemStack[] inventory = getContents(); -+ for (int i = 0; i < inventory.length; i++) { -+ ItemStack item = inventory[i]; -+ if (item != null && item.getTypeId() == materialId && item.getAmount() < item.getMaxStackSize()) { -+ return i; -+ } -+ } -+ return -1; -+ } -+ -+ public int firstPartial(Material material) { -+ return firstPartial(material.getRawId()); -+ } -+ -+ public int firstPartial(ItemStack item) { -+ ItemStack[] inventory = getContents(); -+ if (item == null) { -+ return -1; -+ } -+ for (int i = 0; i < inventory.length; i++) { -+ ItemStack cItem = inventory[i]; -+ if (cItem != null && cItem.getTypeId() == item.getTypeId() && cItem.getAmount() < cItem.getMaxStackSize() && cItem.getDurability() == item.getDurability()) { -+ return i; -+ } -+ } -+ return -1; -+ } -+ -+ public HashMap addItem(ItemStack... items) { -+ HashMap leftover = new HashMap(); -+ -+ /* TODO some optimization -+ * - Create a 'firstPartial' with a 'fromIndex' -+ * - Record the lastPartial per Material -+ * - Cache firstEmpty result -+ */ -+ -+ for (int i = 0; i < items.length; i++) { -+ ItemStack item = items[i]; -+ while (true) { -+ // Do we already have a stack of it? -+ int firstPartial = firstPartial(item); -+ -+ // Drat! no partial stack -+ if (firstPartial == -1) { -+ // Find a free spot! -+ int firstFree = firstEmpty(); -+ -+ if (firstFree == -1) { -+ // No space at all! -+ leftover.put(i, item); -+ break; -+ } else { -+ // More than a single stack! -+ if (item.getAmount() > getMaxItemStack()) { -+ setItem(firstFree, new CraftItemStack(item.getTypeId(), getMaxItemStack(), item.getDurability())); -+ item.setAmount(item.getAmount() - getMaxItemStack()); -+ } else { -+ // Just store it -+ setItem(firstFree, item); -+ break; -+ } -+ } -+ } else { -+ // So, apparently it might only partially fit, well lets do just that -+ ItemStack partialItem = getItem(firstPartial); -+ -+ int amount = item.getAmount(); -+ int partialAmount = partialItem.getAmount(); -+ int maxAmount = partialItem.getMaxStackSize(); -+ -+ // Check if it fully fits -+ if (amount + partialAmount <= maxAmount) { -+ partialItem.setAmount(amount + partialAmount); -+ break; -+ } -+ -+ // It fits partially -+ partialItem.setAmount(maxAmount); -+ item.setAmount(amount + partialAmount - maxAmount); -+ } -+ } -+ } -+ return leftover; -+ } -+ -+ public HashMap removeItem(ItemStack... items) { -+ HashMap leftover = new HashMap(); -+ -+ // TODO Optimization -+ -+ for (int i = 0; i < items.length; i++) { -+ ItemStack item = items[i]; -+ int toDelete = item.getAmount(); -+ -+ while (true) { -+ int first = first(item.getType()); -+ -+ // Drat! we don't have this type in the inventory -+ if (first == -1) { -+ item.setAmount(toDelete); -+ leftover.put(i, item); -+ break; -+ } else { -+ ItemStack itemStack = getItem(first); -+ int amount = itemStack.getAmount(); -+ -+ if (amount <= toDelete) { -+ toDelete -= amount; -+ // clear the slot, all used up -+ clear(first); -+ } else { -+ // split the stack and store -+ itemStack.setAmount(amount - toDelete); -+ setItem(first, itemStack); -+ toDelete = 0; -+ } -+ } -+ -+ // Bail when done -+ if (toDelete <= 0) { -+ break; -+ } -+ } -+ } -+ return leftover; -+ } -+ -+ private int getMaxItemStack() { -+ return getInventory().getInventoryStackLimit(); -+ } -+ -+ public void remove(int materialId) { -+ ItemStack[] items = getContents(); -+ for (int i = 0; i < items.length; i++) { -+ if (items[i] != null && items[i].getTypeId() == materialId) { -+ clear(i); -+ } -+ } -+ } -+ -+ public void remove(Material material) { -+ remove(material.getRawId()); -+ } -+ -+ public void remove(ItemStack item) { -+ ItemStack[] items = getContents(); -+ for (int i = 0; i < items.length; i++) { -+ if (items[i] != null && items[i].equals(item)) { -+ clear(i); -+ } -+ } -+ } -+ -+ public void clear(int index) { -+ setItem(index, null); -+ } -+ -+ public void clear() { -+ for (int i = 0; i < getSize(); i++) { -+ clear(i); -+ } -+ } -+} ---- /dev/null -+++ org/spoutcraft/api/inventory/ShapelessRecipe.java -@@ -1,0 +1,92 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.api.inventory; -+ -+import java.util.ArrayList; -+ -+import org.spoutcraft.api.material.Material; -+ -+public class ShapelessRecipe implements Recipe { -+ private ItemStack output; -+ private ArrayList ingredients = new ArrayList(); -+ -+ /** -+ * Create a shapeless recipe to craft the specified ItemStack. The constructor merely determines the -+ * result and type; to set the actual recipe, you'll need to call the appropriate methods. -+ * @param result The item you want the recipe to create. -+ * @see ShapelessRecipe#addIngredient(Material) -+ * @see ShapelessRecipe#addIngredient(MaterialData) -+ */ -+ public ShapelessRecipe(ItemStack result) { -+ this.output = result; -+ } -+ -+ /** -+ * Adds the specified ingredient. -+ * @param ingredient The ingredient to add. -+ * @return The changed recipe, so you can chain calls. -+ */ -+ public ShapelessRecipe addIngredient(Material ingredient) { -+ return addIngredient(1, ingredient); -+ } -+ -+ /** -+ * Adds multiples of the specified ingredient. -+ * @param count How many to add (can't be more than 9!) -+ * @param ingredient The ingredient to add. -+ * @return The changed recipe, so you can chain calls. -+ */ -+ public ShapelessRecipe addIngredient(int count, Material ingredient) { -+ if (ingredients.size() + count > 9) { -+ throw new IllegalArgumentException("Shapeless recipes cannot have more than 9 ingredients"); -+ } -+ while (count-- > 0) { -+ ingredients.add(ingredient); -+ } -+ return this; -+ } -+ -+ /** -+ * Removes an ingredient from the list. If the ingredient occurs multiple times, -+ * only one instance of it is removed. -+ * @param ingredient The ingredient to remove -+ * @return The changed recipe. -+ */ -+ public ShapelessRecipe removeIngredient(Material ingredient) { -+ this.ingredients.remove(ingredient); -+ return this; -+ } -+ -+ /** -+ * Get the result of this recipe. -+ * @return The result stack. -+ */ -+ public ItemStack getResult() { -+ return output; -+ } -+ -+ /** -+ * Get the list of ingredients used for this recipe. -+ * @return The input list -+ */ -+ public ArrayList getIngredientList() { -+ return ingredients; -+ } -+} ---- net/minecraft/src/GuiScreenCreateOnlineWorld.java -+++ net/minecraft/src/GuiScreenCreateOnlineWorld.java -@@ -8,79 +8,90 @@ - private GuiScreen field_96260_a; - private GuiTextField field_96257_c; - private GuiTextField field_96255_b; -- private String d; -- private String e; -+ private String field_98108_c; -+ private String field_98109_n; - private static int field_96253_d; - private static int field_96261_n = 1; - private static int field_110357_r = 2; - private boolean field_96256_r; -- private String t = "You must enter a name!"; -+ private String field_96254_s = "You must enter a name!"; - private WorldTemplate field_110356_u; - -- public GuiScreenCreateOnlineWorld(GuiScreen var1) { -- super.i = Collections.synchronizedList(new ArrayList()); -- this.field_96260_a = var1; -+ public GuiScreenCreateOnlineWorld(GuiScreen par1GuiScreen) { -+ super.buttonList = Collections.synchronizedList(new ArrayList()); -+ this.field_96260_a = par1GuiScreen; - } - -+ /** -+ * Called from the main game loop to update the screen. -+ */ - public void updateScreen() { - this.field_96257_c.updateCursorCounter(); -- this.d = this.field_96257_c.getText(); -+ this.field_98108_c = this.field_96257_c.getText(); - this.field_96255_b.updateCursorCounter(); -- this.e = this.field_96255_b.getText(); -+ this.field_98109_n = this.field_96255_b.getText(); - } - -+ /** -+ * Adds the buttons (and other controls) to the screen in question. -+ */ - public void initGui() { - Keyboard.enableRepeatEvents(true); -- this.i.clear(); -- this.i.add(new GuiButton(field_96253_d, this.width / 2 - 100, this.height / 4 + 120 + 17, 97, 20, I18n.getString("mco.create.world"))); -- this.i.add(new GuiButton(field_96261_n, this.width / 2 + 5, this.height / 4 + 120 + 17, 95, 20, I18n.getString("gui.cancel"))); -+ this.buttonList.clear(); -+ this.buttonList.add(new GuiButton(field_96253_d, this.width / 2 - 100, this.height / 4 + 120 + 17, 97, 20, I18n.getString("mco.create.world"))); -+ this.buttonList.add(new GuiButton(field_96261_n, this.width / 2 + 5, this.height / 4 + 120 + 17, 95, 20, I18n.getString("gui.cancel"))); - this.field_96257_c = new GuiTextField(this.fontRenderer, this.width / 2 - 100, 65, 200, 20); - this.field_96257_c.setFocused(true); -- if(this.d != null) { -- this.field_96257_c.setText(this.d); -+ -+ if (this.field_98108_c != null) { -+ this.field_96257_c.setText(this.field_98108_c); - } - - this.field_96255_b = new GuiTextField(this.fontRenderer, this.width / 2 - 100, 111, 200, 20); -- if(this.e != null) { -- this.field_96255_b.setText(this.e); -+ -+ if (this.field_98109_n != null) { -+ this.field_96255_b.setText(this.field_98109_n); - } - -- if(this.field_110356_u == null) { -- this.i.add(new GuiButton(field_110357_r, this.width / 2 - 100, 147, 200, 20, I18n.getString("mco.template.default.name"))); -+ if (this.field_110356_u == null) { -+ this.buttonList.add(new GuiButton(field_110357_r, this.width / 2 - 100, 147, 200, 20, I18n.getString("mco.template.default.name"))); - } else { - this.field_96255_b.setText(""); - this.field_96255_b.setEnabled(false); - this.field_96255_b.setFocused(false); -- this.i.add(new GuiButton(field_110357_r, this.width / 2 - 100, 147, 200, 20, I18n.getString("mco.template.name") + ": " + this.field_110356_u.b)); -+ this.buttonList.add(new GuiButton(field_110357_r, this.width / 2 - 100, 147, 200, 20, I18n.getString("mco.template.name") + ": " + this.field_110356_u.field_110732_b)); - } -- - } - -+ /** -+ * Called when the screen is unloaded. Used to disable keyboard repeat events -+ */ - public void onGuiClosed() { - Keyboard.enableRepeatEvents(false); - } - -- protected void actionPerformed(GuiButton var1) { -- if(var1.enabled) { -- if(var1.id == field_96261_n) { -+ /** -+ * Fired when a control is clicked. This is the equivalent of ActionListener.actionPerformed(ActionEvent e). -+ */ -+ protected void actionPerformed(GuiButton par1GuiButton) { -+ if (par1GuiButton.enabled) { -+ if (par1GuiButton.id == field_96261_n) { - this.mc.displayGuiScreen(this.field_96260_a); -- } else if(var1.id == field_96253_d) { -+ } else if (par1GuiButton.id == field_96253_d) { - this.func_96252_h(); -- } else if(var1.id == field_110357_r) { -+ } else if (par1GuiButton.id == field_110357_r) { - this.mc.displayGuiScreen(new GuiScreenMcoWorldTemplate(this, this.field_110356_u)); - } -- - } - } - - private void func_96252_h() { -- if(this.func_96249_i()) { -- TaskWorldCreation var1 = new TaskWorldCreation(this, this.field_96257_c.getText(), "Minecraft Realms Server", this.e, this.field_110356_u); -+ if (this.func_96249_i()) { -+ TaskWorldCreation var1 = new TaskWorldCreation(this, this.field_96257_c.getText(), "Minecraft Realms Server", this.field_98109_n, this.field_110356_u); - GuiScreenLongRunningTask var2 = new GuiScreenLongRunningTask(this.mc, this.field_96260_a, var1); - var2.func_98117_g(); - this.mc.displayGuiScreen(var2); - } -- - } - - private boolean func_96249_i() { -@@ -88,69 +99,79 @@ - return !this.field_96256_r; - } - -- protected void keyTyped(char var1, int var2) { -- this.field_96257_c.textboxKeyTyped(var1, var2); -- this.field_96255_b.textboxKeyTyped(var1, var2); -- if(var2 == 15) { -+ /** -+ * Fired when a key is typed. This is the equivalent of KeyListener.keyTyped(KeyEvent e). -+ */ -+ protected void keyTyped(char par1, int par2) { -+ this.field_96257_c.textboxKeyTyped(par1, par2); -+ this.field_96255_b.textboxKeyTyped(par1, par2); -+ -+ if (par2 == 15) { - this.field_96257_c.setFocused(!this.field_96257_c.isFocused()); - this.field_96255_b.setFocused(!this.field_96255_b.isFocused()); - } - -- if(var2 == 28 || var2 == 156) { -- this.actionPerformed((GuiButton)this.i.get(0)); -+ if (par2 == 28 || par2 == 156) { -+ this.actionPerformed((GuiButton)this.buttonList.get(0)); - } -- -- } -- -- protected void mouseClicked(int var1, int var2, int var3) { -- super.mouseClicked(var1, var2, var3); -- this.field_96257_c.mouseClicked(var1, var2, var3); -- this.field_96255_b.mouseClicked(var1, var2, var3); -- } -- -- public void drawScreen(int var1, int var2, float var3) { -+ } -+ -+ /** -+ * Called when the mouse is clicked. -+ */ -+ protected void mouseClicked(int par1, int par2, int par3) { -+ super.mouseClicked(par1, par2, par3); -+ this.field_96257_c.mouseClicked(par1, par2, par3); -+ this.field_96255_b.mouseClicked(par1, par2, par3); -+ } -+ -+ /** -+ * Draws the screen and all the components in it. -+ */ -+ public void drawScreen(int par1, int par2, float par3) { - this.drawDefaultBackground(); - this.drawCenteredString(this.fontRenderer, I18n.getString("mco.selectServer.create"), this.width / 2, 11, 16777215); - this.drawString(this.fontRenderer, I18n.getString("mco.configure.world.name"), this.width / 2 - 100, 52, 10526880); - this.drawString(this.fontRenderer, I18n.getString("mco.create.world.seed"), this.width / 2 - 100, 98, 10526880); -- if(this.field_96256_r) { -- this.drawCenteredString(this.fontRenderer, this.t, this.width / 2, 167, 16711680); -+ -+ if (this.field_96256_r) { -+ this.drawCenteredString(this.fontRenderer, this.field_96254_s, this.width / 2, 167, 16711680); - } - - this.field_96257_c.drawTextBox(); - this.field_96255_b.drawTextBox(); -- super.drawScreen(var1, var2, var3); -- } -- -- public void func_110355_a(WorldTemplate var1) { -- this.field_110356_u = var1; -- } -- -- public void func_110354_a(Object var1) { -- this.func_110355_a((WorldTemplate)var1); -- } -- -- static Minecraft func_96248_a(GuiScreenCreateOnlineWorld var0) { -- return var0.mc; -- } -- -- static GuiScreen func_96247_b(GuiScreenCreateOnlineWorld var0) { -- return var0.field_96260_a; -- } -- -- static Minecraft func_96246_c(GuiScreenCreateOnlineWorld var0) { -- return var0.mc; -- } -- -- static Minecraft func_130026_d(GuiScreenCreateOnlineWorld var0) { -- return var0.mc; -- } -- -- static Minecraft func_130027_e(GuiScreenCreateOnlineWorld var0) { -- return var0.mc; -- } -- -- static Minecraft func_130028_f(GuiScreenCreateOnlineWorld var0) { -- return var0.mc; -+ super.drawScreen(par1, par2, par3); -+ } -+ -+ public void func_110355_a(WorldTemplate par1WorldTemplate) { -+ this.field_110356_u = par1WorldTemplate; -+ } -+ -+ public void func_110354_a(Object par1Obj) { -+ this.func_110355_a((WorldTemplate)par1Obj); -+ } -+ -+ static Minecraft func_96248_a(GuiScreenCreateOnlineWorld par0GuiScreenCreateOnlineWorld) { -+ return par0GuiScreenCreateOnlineWorld.mc; -+ } -+ -+ static GuiScreen func_96247_b(GuiScreenCreateOnlineWorld par0GuiScreenCreateOnlineWorld) { -+ return par0GuiScreenCreateOnlineWorld.field_96260_a; -+ } -+ -+ static Minecraft func_96246_c(GuiScreenCreateOnlineWorld par0GuiScreenCreateOnlineWorld) { -+ return par0GuiScreenCreateOnlineWorld.mc; -+ } -+ -+ static Minecraft func_130026_d(GuiScreenCreateOnlineWorld par0GuiScreenCreateOnlineWorld) { -+ return par0GuiScreenCreateOnlineWorld.mc; -+ } -+ -+ static Minecraft func_130027_e(GuiScreenCreateOnlineWorld par0GuiScreenCreateOnlineWorld) { -+ return par0GuiScreenCreateOnlineWorld.mc; -+ } -+ -+ static Minecraft func_130028_f(GuiScreenCreateOnlineWorld par0GuiScreenCreateOnlineWorld) { -+ return par0GuiScreenCreateOnlineWorld.mc; - } - } ---- net/minecraft/src/GuiScreenEditOnlineWorld.java -+++ net/minecraft/src/GuiScreenEditOnlineWorld.java -@@ -15,25 +15,31 @@ - private int field_104052_r; - private GuiScreenOnlineServersSubscreen field_104051_s; - -- public GuiScreenEditOnlineWorld(GuiScreen var1, GuiScreen var2, McoServer var3) { -- this.field_96204_a = var1; -- this.field_96202_b = var2; -- this.field_96205_n = var3; -+ public GuiScreenEditOnlineWorld(GuiScreen par1GuiScreen, GuiScreen par2GuiScreen, McoServer par3McoServer) { -+ this.field_96204_a = par1GuiScreen; -+ this.field_96202_b = par2GuiScreen; -+ this.field_96205_n = par3McoServer; - } - -+ /** -+ * Called from the main game loop to update the screen. -+ */ - public void updateScreen() { - this.field_96201_d.updateCursorCounter(); - this.field_96203_c.updateCursorCounter(); - } - -+ /** -+ * Adds the buttons (and other controls) to the screen in question. -+ */ - public void initGui() { - this.field_104054_p = this.width / 4; - this.field_104053_q = this.width / 4 - 2; - this.field_104052_r = this.width / 2 + 4; - Keyboard.enableRepeatEvents(true); -- this.i.clear(); -- this.i.add(this.field_96206_o = new GuiButton(0, this.field_104054_p, this.height / 4 + 120 + 22, this.field_104053_q, 20, I18n.getString("mco.configure.world.buttons.done"))); -- this.i.add(new GuiButton(1, this.field_104052_r, this.height / 4 + 120 + 22, this.field_104053_q, 20, I18n.getString("gui.cancel"))); -+ this.buttonList.clear(); -+ this.buttonList.add(this.field_96206_o = new GuiButton(0, this.field_104054_p, this.height / 4 + 120 + 22, this.field_104053_q, 20, I18n.getString("mco.configure.world.buttons.done"))); -+ this.buttonList.add(new GuiButton(1, this.field_104052_r, this.height / 4 + 120 + 22, this.field_104053_q, 20, I18n.getString("gui.cancel"))); - this.field_96201_d = new GuiTextField(this.fontRenderer, this.field_104054_p, 56, 212, 20); - this.field_96201_d.setFocused(true); - this.field_96201_d.setMaxStringLength(32); -@@ -42,25 +48,30 @@ - this.field_96203_c.setMaxStringLength(32); - this.field_96203_c.setText(this.field_96205_n.func_96397_a()); - this.field_104051_s = new GuiScreenOnlineServersSubscreen(this.width, this.height, this.field_104054_p, 122, this.field_96205_n.field_110729_i, this.field_96205_n.field_110728_j); -- this.i.addAll(this.field_104051_s.a); -+ this.buttonList.addAll(this.field_104051_s.field_104079_a); - } - -+ /** -+ * Called when the screen is unloaded. Used to disable keyboard repeat events -+ */ - public void onGuiClosed() { - Keyboard.enableRepeatEvents(false); - } - -- protected void actionPerformed(GuiButton var1) { -- if(var1.enabled) { -- if(var1.id == 1) { -+ /** -+ * Fired when a control is clicked. This is the equivalent of ActionListener.actionPerformed(ActionEvent e). -+ */ -+ protected void actionPerformed(GuiButton par1GuiButton) { -+ if (par1GuiButton.enabled) { -+ if (par1GuiButton.id == 1) { - this.mc.displayGuiScreen(this.field_96204_a); -- } else if(var1.id == 0) { -+ } else if (par1GuiButton.id == 0) { - this.func_96200_g(); -- } else if(var1.id == 2) { -+ } else if (par1GuiButton.id == 2) { - this.mc.displayGuiScreen(new GuiScreenResetWorld(this, this.field_96205_n)); - } else { -- this.field_104051_s.func_104069_a(var1); -+ this.field_104051_s.func_104069_a(par1GuiButton); - } -- - } - } - -@@ -80,31 +91,40 @@ - } catch (UnsupportedEncodingException var4) { - this.mc.getLogAgent().logWarning("Realms: " + var4.getLocalizedMessage()); - } -- - } - -- protected void keyTyped(char var1, int var2) { -- this.field_96201_d.textboxKeyTyped(var1, var2); -- this.field_96203_c.textboxKeyTyped(var1, var2); -- if(var2 == 15) { -+ /** -+ * Fired when a key is typed. This is the equivalent of KeyListener.keyTyped(KeyEvent e). -+ */ -+ protected void keyTyped(char par1, int par2) { -+ this.field_96201_d.textboxKeyTyped(par1, par2); -+ this.field_96203_c.textboxKeyTyped(par1, par2); -+ -+ if (par2 == 15) { - this.field_96201_d.setFocused(!this.field_96201_d.isFocused()); - this.field_96203_c.setFocused(!this.field_96203_c.isFocused()); - } - -- if(var2 == 28 || var2 == 156) { -+ if (par2 == 28 || par2 == 156) { - this.func_96200_g(); - } - - this.field_96206_o.enabled = this.field_96201_d.getText() != null && !this.field_96201_d.getText().trim().equals(""); - } - -- protected void mouseClicked(int var1, int var2, int var3) { -- super.mouseClicked(var1, var2, var3); -- this.field_96203_c.mouseClicked(var1, var2, var3); -- this.field_96201_d.mouseClicked(var1, var2, var3); -+ /** -+ * Called when the mouse is clicked. -+ */ -+ protected void mouseClicked(int par1, int par2, int par3) { -+ super.mouseClicked(par1, par2, par3); -+ this.field_96203_c.mouseClicked(par1, par2, par3); -+ this.field_96201_d.mouseClicked(par1, par2, par3); - } - -- public void drawScreen(int var1, int var2, float var3) { -+ /** -+ * Draws the screen and all the components in it. -+ */ -+ public void drawScreen(int par1, int par2, float par3) { - this.drawDefaultBackground(); - this.drawCenteredString(this.fontRenderer, I18n.getString("mco.configure.world.edit.title"), this.width / 2, 17, 16777215); - this.drawString(this.fontRenderer, I18n.getString("mco.configure.world.name"), this.field_104054_p, 43, 10526880); -@@ -112,6 +132,6 @@ - this.field_96201_d.drawTextBox(); - this.field_96203_c.drawTextBox(); - this.field_104051_s.func_104071_a(this, this.fontRenderer); -- super.drawScreen(var1, var2, var3); -+ super.drawScreen(par1, par2, par3); - } - } ---- net/minecraft/src/WorldGenTrees.java -+++ net/minecraft/src/WorldGenTrees.java -@@ -3,46 +3,58 @@ - import java.util.Random; - - public class WorldGenTrees extends WorldGenerator { -+ -+ /** The minimum height of a generated tree. */ - private final int minTreeHeight; -+ -+ /** True if this tree should grow Vines. */ - private final boolean vinesGrow; -+ -+ /** The metadata value of the wood to use in tree generation. */ - private final int metaWood; -+ -+ /** The metadata value of the leaves to use in tree generation. */ - private final int metaLeaves; - -- public WorldGenTrees(boolean var1) { -- this(var1, 4, 0, 0, false); -- } -- -- public WorldGenTrees(boolean var1, int var2, int var3, int var4, boolean var5) { -- super(var1); -- this.minTreeHeight = var2; -- this.metaWood = var3; -- this.metaLeaves = var4; -- this.vinesGrow = var5; -- } -- -- public boolean generate(World var1, Random var2, int var3, int var4, int var5) { -- int var6 = var2.nextInt(3) + this.minTreeHeight; -+ public WorldGenTrees(boolean par1) { -+ this(par1, 4, 0, 0, false); -+ } -+ -+ public WorldGenTrees(boolean par1, int par2, int par3, int par4, boolean par5) { -+ super(par1); -+ this.minTreeHeight = par2; -+ this.metaWood = par3; -+ this.metaLeaves = par4; -+ this.vinesGrow = par5; -+ } -+ -+ public boolean generate(World par1World, Random par2Random, int par3, int par4, int par5) { -+ int var6 = par2Random.nextInt(3) + this.minTreeHeight; - boolean var7 = true; -- if(var4 >= 1 && var4 + var6 + 1 <= 256) { -+ -+ if (par4 >= 1 && par4 + var6 + 1 <= 256) { - int var8; - byte var9; - int var11; - int var12; -- for(var8 = var4; var8 <= var4 + 1 + var6; ++var8) { -+ -+ for (var8 = par4; var8 <= par4 + 1 + var6; ++var8) { - var9 = 1; -- if(var8 == var4) { -+ -+ if (var8 == par4) { - var9 = 0; - } - -- if(var8 >= var4 + 1 + var6 - 2) { -+ if (var8 >= par4 + 1 + var6 - 2) { - var9 = 2; - } - -- for(int var10 = var3 - var9; var10 <= var3 + var9 && var7; ++var10) { -- for(var11 = var5 - var9; var11 <= var5 + var9 && var7; ++var11) { -- if(var8 >= 0 && var8 < 256) { -- var12 = var1.getBlockId(var10, var8, var11); -- if(var12 != 0 && var12 != Block.leaves.blockID && var12 != Block.grass.blockID && var12 != Block.dirt.blockID && var12 != Block.wood.blockID) { -+ for (int var10 = par3 - var9; var10 <= par3 + var9 && var7; ++var10) { -+ for (var11 = par5 - var9; var11 <= par5 + var9 && var7; ++var11) { -+ if (var8 >= 0 && var8 < 256) { -+ var12 = par1World.getBlockId(var10, var8, var11); -+ -+ if (var12 != 0 && var12 != Block.leaves.blockID && var12 != Block.grass.blockID && var12 != Block.dirt.blockID && var12 != Block.wood.blockID) { - var7 = false; - } - } else { -@@ -52,95 +64,100 @@ - } - } - -- if(!var7) { -+ if (!var7) { - return false; - } else { -- var8 = var1.getBlockId(var3, var4 - 1, var5); -- if((var8 == Block.grass.blockID || var8 == Block.dirt.blockID) && var4 < 256 - var6 - 1) { -- this.setBlock(var1, var3, var4 - 1, var5, Block.dirt.blockID); -+ var8 = par1World.getBlockId(par3, par4 - 1, par5); -+ -+ if ((var8 == Block.grass.blockID || var8 == Block.dirt.blockID) && par4 < 256 - var6 - 1) { -+ this.setBlock(par1World, par3, par4 - 1, par5, Block.dirt.blockID); - var9 = 3; - byte var19 = 0; -- - int var13; - int var14; - int var15; -- for(var11 = var4 - var9 + var6; var11 <= var4 + var6; ++var11) { -- var12 = var11 - (var4 + var6); -+ -+ for (var11 = par4 - var9 + var6; var11 <= par4 + var6; ++var11) { -+ var12 = var11 - (par4 + var6); - var13 = var19 + 1 - var12 / 2; - -- for(var14 = var3 - var13; var14 <= var3 + var13; ++var14) { -- var15 = var14 - var3; -- -- for(int var16 = var5 - var13; var16 <= var5 + var13; ++var16) { -- int var17 = var16 - var5; -- if(Math.abs(var15) != var13 || Math.abs(var17) != var13 || var2.nextInt(2) != 0 && var12 != 0) { -- int var18 = var1.getBlockId(var14, var11, var16); -- if(var18 == 0 || var18 == Block.leaves.blockID) { -- this.setBlockAndMetadata(var1, var14, var11, var16, Block.leaves.blockID, this.metaLeaves); -+ for (var14 = par3 - var13; var14 <= par3 + var13; ++var14) { -+ var15 = var14 - par3; -+ -+ for (int var16 = par5 - var13; var16 <= par5 + var13; ++var16) { -+ int var17 = var16 - par5; -+ -+ if (Math.abs(var15) != var13 || Math.abs(var17) != var13 || par2Random.nextInt(2) != 0 && var12 != 0) { -+ int var18 = par1World.getBlockId(var14, var11, var16); -+ -+ if (var18 == 0 || var18 == Block.leaves.blockID) { -+ this.setBlockAndMetadata(par1World, var14, var11, var16, Block.leaves.blockID, this.metaLeaves); - } - } - } - } - } - -- for(var11 = 0; var11 < var6; ++var11) { -- var12 = var1.getBlockId(var3, var4 + var11, var5); -- if(var12 == 0 || var12 == Block.leaves.blockID) { -- this.setBlockAndMetadata(var1, var3, var4 + var11, var5, Block.wood.blockID, this.metaWood); -- if(this.vinesGrow && var11 > 0) { -- if(var2.nextInt(3) > 0 && var1.isAirBlock(var3 - 1, var4 + var11, var5)) { -- this.setBlockAndMetadata(var1, var3 - 1, var4 + var11, var5, Block.vine.blockID, 8); -- } -- -- if(var2.nextInt(3) > 0 && var1.isAirBlock(var3 + 1, var4 + var11, var5)) { -- this.setBlockAndMetadata(var1, var3 + 1, var4 + var11, var5, Block.vine.blockID, 2); -- } -- -- if(var2.nextInt(3) > 0 && var1.isAirBlock(var3, var4 + var11, var5 - 1)) { -- this.setBlockAndMetadata(var1, var3, var4 + var11, var5 - 1, Block.vine.blockID, 1); -- } -- -- if(var2.nextInt(3) > 0 && var1.isAirBlock(var3, var4 + var11, var5 + 1)) { -- this.setBlockAndMetadata(var1, var3, var4 + var11, var5 + 1, Block.vine.blockID, 4); -+ for (var11 = 0; var11 < var6; ++var11) { -+ var12 = par1World.getBlockId(par3, par4 + var11, par5); -+ -+ if (var12 == 0 || var12 == Block.leaves.blockID) { -+ this.setBlockAndMetadata(par1World, par3, par4 + var11, par5, Block.wood.blockID, this.metaWood); -+ -+ if (this.vinesGrow && var11 > 0) { -+ if (par2Random.nextInt(3) > 0 && par1World.isAirBlock(par3 - 1, par4 + var11, par5)) { -+ this.setBlockAndMetadata(par1World, par3 - 1, par4 + var11, par5, Block.vine.blockID, 8); -+ } -+ -+ if (par2Random.nextInt(3) > 0 && par1World.isAirBlock(par3 + 1, par4 + var11, par5)) { -+ this.setBlockAndMetadata(par1World, par3 + 1, par4 + var11, par5, Block.vine.blockID, 2); -+ } -+ -+ if (par2Random.nextInt(3) > 0 && par1World.isAirBlock(par3, par4 + var11, par5 - 1)) { -+ this.setBlockAndMetadata(par1World, par3, par4 + var11, par5 - 1, Block.vine.blockID, 1); -+ } -+ -+ if (par2Random.nextInt(3) > 0 && par1World.isAirBlock(par3, par4 + var11, par5 + 1)) { -+ this.setBlockAndMetadata(par1World, par3, par4 + var11, par5 + 1, Block.vine.blockID, 4); - } - } - } - } - -- if(this.vinesGrow) { -- for(var11 = var4 - 3 + var6; var11 <= var4 + var6; ++var11) { -- var12 = var11 - (var4 + var6); -+ if (this.vinesGrow) { -+ for (var11 = par4 - 3 + var6; var11 <= par4 + var6; ++var11) { -+ var12 = var11 - (par4 + var6); - var13 = 2 - var12 / 2; - -- for(var14 = var3 - var13; var14 <= var3 + var13; ++var14) { -- for(var15 = var5 - var13; var15 <= var5 + var13; ++var15) { -- if(var1.getBlockId(var14, var11, var15) == Block.leaves.blockID) { -- if(var2.nextInt(4) == 0 && var1.getBlockId(var14 - 1, var11, var15) == 0) { -- this.growVines(var1, var14 - 1, var11, var15, 8); -- } -- -- if(var2.nextInt(4) == 0 && var1.getBlockId(var14 + 1, var11, var15) == 0) { -- this.growVines(var1, var14 + 1, var11, var15, 2); -- } -- -- if(var2.nextInt(4) == 0 && var1.getBlockId(var14, var11, var15 - 1) == 0) { -- this.growVines(var1, var14, var11, var15 - 1, 1); -- } -- -- if(var2.nextInt(4) == 0 && var1.getBlockId(var14, var11, var15 + 1) == 0) { -- this.growVines(var1, var14, var11, var15 + 1, 4); -+ for (var14 = par3 - var13; var14 <= par3 + var13; ++var14) { -+ for (var15 = par5 - var13; var15 <= par5 + var13; ++var15) { -+ if (par1World.getBlockId(var14, var11, var15) == Block.leaves.blockID) { -+ if (par2Random.nextInt(4) == 0 && par1World.getBlockId(var14 - 1, var11, var15) == 0) { -+ this.growVines(par1World, var14 - 1, var11, var15, 8); -+ } -+ -+ if (par2Random.nextInt(4) == 0 && par1World.getBlockId(var14 + 1, var11, var15) == 0) { -+ this.growVines(par1World, var14 + 1, var11, var15, 2); -+ } -+ -+ if (par2Random.nextInt(4) == 0 && par1World.getBlockId(var14, var11, var15 - 1) == 0) { -+ this.growVines(par1World, var14, var11, var15 - 1, 1); -+ } -+ -+ if (par2Random.nextInt(4) == 0 && par1World.getBlockId(var14, var11, var15 + 1) == 0) { -+ this.growVines(par1World, var14, var11, var15 + 1, 4); - } - } - } - } - } - -- if(var2.nextInt(5) == 0 && var6 > 5) { -- for(var11 = 0; var11 < 2; ++var11) { -- for(var12 = 0; var12 < 4; ++var12) { -- if(var2.nextInt(4 - var11) == 0) { -- var13 = var2.nextInt(3); -- this.setBlockAndMetadata(var1, var3 + Direction.offsetX[Direction.rotateOpposite[var12]], var4 + var6 - 5 + var11, var5 + Direction.offsetZ[Direction.rotateOpposite[var12]], Block.cocoaPlant.blockID, var13 << 2 | var12); -+ if (par2Random.nextInt(5) == 0 && var6 > 5) { -+ for (var11 = 0; var11 < 2; ++var11) { -+ for (var12 = 0; var12 < 4; ++var12) { -+ if (par2Random.nextInt(4 - var11) == 0) { -+ var13 = par2Random.nextInt(3); -+ this.setBlockAndMetadata(par1World, par3 + Direction.offsetX[Direction.rotateOpposite[var12]], par4 + var6 - 5 + var11, par5 + Direction.offsetZ[Direction.rotateOpposite[var12]], Block.cocoaPlant.blockID, var13 << 2 | var12); - } - } - } -@@ -157,17 +174,21 @@ - } - } - -- private void growVines(World var1, int var2, int var3, int var4, int var5) { -- this.setBlockAndMetadata(var1, var2, var3, var4, Block.vine.blockID, var5); -+ /** -+ * Grows vines downward from the given block for a given length. Args: World, x, starty, z, vine-length -+ */ -+ private void growVines(World par1World, int par2, int par3, int par4, int par5) { -+ this.setBlockAndMetadata(par1World, par2, par3, par4, Block.vine.blockID, par5); - int var6 = 4; - -- while(true) { -- --var3; -- if(var1.getBlockId(var2, var3, var4) != 0 || var6 <= 0) { -+ while (true) { -+ --par3; -+ -+ if (par1World.getBlockId(par2, par3, par4) != 0 || var6 <= 0) { - return; - } - -- this.setBlockAndMetadata(var1, var2, var3, var4, Block.vine.blockID, var5); -+ this.setBlockAndMetadata(par1World, par2, par3, par4, Block.vine.blockID, par5); - --var6; - } - } ---- net/minecraft/src/ChunkProviderHell.java -+++ net/minecraft/src/ChunkProviderHell.java -@@ -4,19 +4,37 @@ - import java.util.Random; - - public class ChunkProviderHell implements IChunkProvider { -- private Random i; -+ private Random hellRNG; -+ -+ /** A NoiseGeneratorOctaves used in generating nether terrain */ - private NoiseGeneratorOctaves netherNoiseGen1; - private NoiseGeneratorOctaves netherNoiseGen2; - private NoiseGeneratorOctaves netherNoiseGen3; -+ -+ /** Determines whether slowsand or gravel can be generated at a location */ - private NoiseGeneratorOctaves slowsandGravelNoiseGen; -+ -+ /** -+ * Determines whether something other than nettherack can be generated at a location -+ */ - private NoiseGeneratorOctaves netherrackExculsivityNoiseGen; - public NoiseGeneratorOctaves netherNoiseGen6; - public NoiseGeneratorOctaves netherNoiseGen7; -+ -+ /** Is the world that the nether is getting generated. */ - private World worldObj; - private double[] noiseField; - public MapGenNetherBridge genNetherBridge = new MapGenNetherBridge(); -+ -+ /** -+ * Holds the noise used to determine whether slowsand can be generated at a location -+ */ - private double[] slowsandNoise = new double[256]; - private double[] gravelNoise = new double[256]; -+ -+ /** -+ * Holds the noise used to determine whether something other than netherrack can be generated at a location -+ */ - private double[] netherrackExclusivityNoise = new double[256]; - private MapGenBase netherCaveGenerator = new MapGenCavesHell(); - double[] noiseData1; -@@ -25,29 +43,32 @@ - double[] noiseData4; - double[] noiseData5; - -- public ChunkProviderHell(World var1, long var2) { -- this.worldObj = var1; -- this.i = new Random(var2); -- this.netherNoiseGen1 = new NoiseGeneratorOctaves(this.i, 16); -- this.netherNoiseGen2 = new NoiseGeneratorOctaves(this.i, 16); -- this.netherNoiseGen3 = new NoiseGeneratorOctaves(this.i, 8); -- this.slowsandGravelNoiseGen = new NoiseGeneratorOctaves(this.i, 4); -- this.netherrackExculsivityNoiseGen = new NoiseGeneratorOctaves(this.i, 4); -- this.netherNoiseGen6 = new NoiseGeneratorOctaves(this.i, 10); -- this.netherNoiseGen7 = new NoiseGeneratorOctaves(this.i, 16); -+ public ChunkProviderHell(World par1World, long par2) { -+ this.worldObj = par1World; -+ this.hellRNG = new Random(par2); -+ this.netherNoiseGen1 = new NoiseGeneratorOctaves(this.hellRNG, 16); -+ this.netherNoiseGen2 = new NoiseGeneratorOctaves(this.hellRNG, 16); -+ this.netherNoiseGen3 = new NoiseGeneratorOctaves(this.hellRNG, 8); -+ this.slowsandGravelNoiseGen = new NoiseGeneratorOctaves(this.hellRNG, 4); -+ this.netherrackExculsivityNoiseGen = new NoiseGeneratorOctaves(this.hellRNG, 4); -+ this.netherNoiseGen6 = new NoiseGeneratorOctaves(this.hellRNG, 10); -+ this.netherNoiseGen7 = new NoiseGeneratorOctaves(this.hellRNG, 16); - } - -- public void generateNetherTerrain(int var1, int var2, byte[] var3) { -+ /** -+ * Generates the shape of the terrain in the nether. -+ */ -+ public void generateNetherTerrain(int par1, int par2, byte[] par3ArrayOfByte) { - byte var4 = 4; - byte var5 = 32; - int var6 = var4 + 1; - byte var7 = 17; - int var8 = var4 + 1; -- this.noiseField = this.initializeNoiseField(this.noiseField, var1 * var4, 0, var2 * var4, var6, var7, var8); -+ this.noiseField = this.initializeNoiseField(this.noiseField, par1 * var4, 0, par2 * var4, var6, var7, var8); - -- for(int var9 = 0; var9 < var4; ++var9) { -- for(int var10 = 0; var10 < var4; ++var10) { -- for(int var11 = 0; var11 < 16; ++var11) { -+ for (int var9 = 0; var9 < var4; ++var9) { -+ for (int var10 = 0; var10 < var4; ++var10) { -+ for (int var11 = 0; var11 < 16; ++var11) { - double var12 = 0.125D; - double var14 = this.noiseField[((var9 + 0) * var8 + var10 + 0) * var7 + var11 + 0]; - double var16 = this.noiseField[((var9 + 0) * var8 + var10 + 1) * var7 + var11 + 0]; -@@ -58,31 +79,32 @@ - double var26 = (this.noiseField[((var9 + 1) * var8 + var10 + 0) * var7 + var11 + 1] - var18) * var12; - double var28 = (this.noiseField[((var9 + 1) * var8 + var10 + 1) * var7 + var11 + 1] - var20) * var12; - -- for(int var30 = 0; var30 < 8; ++var30) { -+ for (int var30 = 0; var30 < 8; ++var30) { - double var31 = 0.25D; - double var33 = var14; - double var35 = var16; - double var37 = (var18 - var14) * var31; - double var39 = (var20 - var16) * var31; - -- for(int var41 = 0; var41 < 4; ++var41) { -+ for (int var41 = 0; var41 < 4; ++var41) { - int var42 = var41 + var9 * 4 << 11 | 0 + var10 * 4 << 7 | var11 * 8 + var30; - short var43 = 128; - double var44 = 0.25D; - double var46 = var33; - double var48 = (var35 - var33) * var44; - -- for(int var50 = 0; var50 < 4; ++var50) { -+ for (int var50 = 0; var50 < 4; ++var50) { - int var51 = 0; -- if(var11 * 8 + var30 < var5) { -+ -+ if (var11 * 8 + var30 < var5) { - var51 = Block.lavaStill.blockID; - } - -- if(var46 > 0.0D) { -+ if (var46 > 0.0D) { - var51 = Block.netherrack.blockID; - } - -- var3[var42] = (byte)var51; -+ par3ArrayOfByte[var42] = (byte)var51; - var42 += var43; - var46 += var48; - } -@@ -99,96 +121,108 @@ - } - } - } -- - } - -- public void replaceBlocksForBiome(int var1, int var2, byte[] var3) { -+ /** -+ * name based on ChunkProviderGenerate -+ */ -+ public void replaceBlocksForBiome(int par1, int par2, byte[] par3ArrayOfByte) { - byte var4 = 64; -- double var5 = 1.0D / 32.0D; -- this.slowsandNoise = this.slowsandGravelNoiseGen.generateNoiseOctaves(this.slowsandNoise, var1 * 16, var2 * 16, 0, 16, 16, 1, var5, var5, 1.0D); -- this.gravelNoise = this.slowsandGravelNoiseGen.generateNoiseOctaves(this.gravelNoise, var1 * 16, 109, var2 * 16, 16, 1, 16, var5, 1.0D, var5); -- this.netherrackExclusivityNoise = this.netherrackExculsivityNoiseGen.generateNoiseOctaves(this.netherrackExclusivityNoise, var1 * 16, var2 * 16, 0, 16, 16, 1, var5 * 2.0D, var5 * 2.0D, var5 * 2.0D); -+ double var5 = 0.03125D; -+ this.slowsandNoise = this.slowsandGravelNoiseGen.generateNoiseOctaves(this.slowsandNoise, par1 * 16, par2 * 16, 0, 16, 16, 1, var5, var5, 1.0D); -+ this.gravelNoise = this.slowsandGravelNoiseGen.generateNoiseOctaves(this.gravelNoise, par1 * 16, 109, par2 * 16, 16, 1, 16, var5, 1.0D, var5); -+ this.netherrackExclusivityNoise = this.netherrackExculsivityNoiseGen.generateNoiseOctaves(this.netherrackExclusivityNoise, par1 * 16, par2 * 16, 0, 16, 16, 1, var5 * 2.0D, var5 * 2.0D, var5 * 2.0D); - -- for(int var7 = 0; var7 < 16; ++var7) { -- for(int var8 = 0; var8 < 16; ++var8) { -- boolean var9 = this.slowsandNoise[var7 + var8 * 16] + this.i.nextDouble() * 0.2D > 0.0D; -- boolean var10 = this.gravelNoise[var7 + var8 * 16] + this.i.nextDouble() * 0.2D > 0.0D; -- int var11 = (int)(this.netherrackExclusivityNoise[var7 + var8 * 16] / 3.0D + 3.0D + this.i.nextDouble() * 0.25D); -+ for (int var7 = 0; var7 < 16; ++var7) { -+ for (int var8 = 0; var8 < 16; ++var8) { -+ boolean var9 = this.slowsandNoise[var7 + var8 * 16] + this.hellRNG.nextDouble() * 0.2D > 0.0D; -+ boolean var10 = this.gravelNoise[var7 + var8 * 16] + this.hellRNG.nextDouble() * 0.2D > 0.0D; -+ int var11 = (int)(this.netherrackExclusivityNoise[var7 + var8 * 16] / 3.0D + 3.0D + this.hellRNG.nextDouble() * 0.25D); - int var12 = -1; - byte var13 = (byte)Block.netherrack.blockID; - byte var14 = (byte)Block.netherrack.blockID; - -- for(int var15 = 127; var15 >= 0; --var15) { -+ for (int var15 = 127; var15 >= 0; --var15) { - int var16 = (var8 * 16 + var7) * 128 + var15; -- if(var15 < 127 - this.i.nextInt(5) && var15 > 0 + this.i.nextInt(5)) { -- byte var17 = var3[var16]; -- if(var17 == 0) { -+ -+ if (var15 < 127 - this.hellRNG.nextInt(5) && var15 > 0 + this.hellRNG.nextInt(5)) { -+ byte var17 = par3ArrayOfByte[var16]; -+ -+ if (var17 == 0) { - var12 = -1; -- } else if(var17 == Block.netherrack.blockID) { -- if(var12 == -1) { -- if(var11 <= 0) { -+ } else if (var17 == Block.netherrack.blockID) { -+ if (var12 == -1) { -+ if (var11 <= 0) { - var13 = 0; - var14 = (byte)Block.netherrack.blockID; -- } else if(var15 >= var4 - 4 && var15 <= var4 + 1) { -+ } else if (var15 >= var4 - 4 && var15 <= var4 + 1) { - var13 = (byte)Block.netherrack.blockID; - var14 = (byte)Block.netherrack.blockID; -- if(var10) { -+ -+ if (var10) { - var13 = (byte)Block.gravel.blockID; - } - -- if(var10) { -+ if (var10) { - var14 = (byte)Block.netherrack.blockID; - } - -- if(var9) { -+ if (var9) { - var13 = (byte)Block.slowSand.blockID; - } - -- if(var9) { -+ if (var9) { - var14 = (byte)Block.slowSand.blockID; - } - } - -- if(var15 < var4 && var13 == 0) { -+ if (var15 < var4 && var13 == 0) { - var13 = (byte)Block.lavaStill.blockID; - } - - var12 = var11; -- if(var15 >= var4 - 1) { -- var3[var16] = var13; -+ -+ if (var15 >= var4 - 1) { -+ par3ArrayOfByte[var16] = var13; - } else { -- var3[var16] = var14; -+ par3ArrayOfByte[var16] = var14; - } -- } else if(var12 > 0) { -+ } else if (var12 > 0) { - --var12; -- var3[var16] = var14; -+ par3ArrayOfByte[var16] = var14; - } - } - } else { -- var3[var16] = (byte)Block.bedrock.blockID; -+ par3ArrayOfByte[var16] = (byte)Block.bedrock.blockID; - } - } - } - } -- -- } -- -- public Chunk loadChunk(int var1, int var2) { -- return this.provideChunk(var1, var2); -- } -- -- public Chunk provideChunk(int var1, int var2) { -- this.i.setSeed((long)var1 * 341873128712L + (long)var2 * 132897987541L); -- byte[] var3 = new byte[-Short.MIN_VALUE]; -- this.generateNetherTerrain(var1, var2, var3); -- this.replaceBlocksForBiome(var1, var2, var3); -- this.netherCaveGenerator.generate(this, this.worldObj, var1, var2, var3); -- this.genNetherBridge.generate(this, this.worldObj, var1, var2, var3); -- Chunk var4 = new Chunk(this.worldObj, var3, var1, var2); -- BiomeGenBase[] var5 = this.worldObj.getWorldChunkManager().loadBlockGeneratorData((BiomeGenBase[])null, var1 * 16, var2 * 16, 16, 16); -+ } -+ -+ /** -+ * loads or generates the chunk at the chunk location specified -+ */ -+ public Chunk loadChunk(int par1, int par2) { -+ return this.provideChunk(par1, par2); -+ } -+ -+ /** -+ * Will return back a chunk, if it doesn't exist and its not a MP client it will generates all the blocks for the -+ * specified chunk from the map seed and chunk seed -+ */ -+ public Chunk provideChunk(int par1, int par2) { -+ this.hellRNG.setSeed((long)par1 * 341873128712L + (long)par2 * 132897987541L); -+ byte[] var3 = new byte[32768]; -+ this.generateNetherTerrain(par1, par2, var3); -+ this.replaceBlocksForBiome(par1, par2, var3); -+ this.netherCaveGenerator.generate(this, this.worldObj, par1, par2, var3); -+ this.genNetherBridge.generate(this, this.worldObj, par1, par2, var3); -+ Chunk var4 = new Chunk(this.worldObj, var3, par1, par2); -+ BiomeGenBase[] var5 = this.worldObj.getWorldChunkManager().loadBlockGeneratorData((BiomeGenBase[])null, par1 * 16, par2 * 16, 16, 16); - byte[] var6 = var4.getBiomeArray(); - -- for(int var7 = 0; var7 < var6.length; ++var7) { -+ for (int var7 = 0; var7 < var6.length; ++var7) { - var6[var7] = (byte)var5[var7].biomeID; - } - -@@ -196,53 +230,62 @@ - return var4; - } - -- private double[] initializeNoiseField(double[] var1, int var2, int var3, int var4, int var5, int var6, int var7) { -- if(var1 == null) { -- var1 = new double[var5 * var6 * var7]; -+ /** -+ * generates a subset of the level's terrain data. Takes 7 arguments: the [empty] noise array, the position, and the -+ * size. -+ */ -+ private double[] initializeNoiseField(double[] par1ArrayOfDouble, int par2, int par3, int par4, int par5, int par6, int par7) { -+ if (par1ArrayOfDouble == null) { -+ par1ArrayOfDouble = new double[par5 * par6 * par7]; - } - - double var8 = 684.412D; - double var10 = 2053.236D; -- this.noiseData4 = this.netherNoiseGen6.generateNoiseOctaves(this.noiseData4, var2, var3, var4, var5, 1, var7, 1.0D, 0.0D, 1.0D); -- this.noiseData5 = this.netherNoiseGen7.generateNoiseOctaves(this.noiseData5, var2, var3, var4, var5, 1, var7, 100.0D, 0.0D, 100.0D); -- this.noiseData1 = this.netherNoiseGen3.generateNoiseOctaves(this.noiseData1, var2, var3, var4, var5, var6, var7, var8 / 80.0D, var10 / 60.0D, var8 / 80.0D); -- this.noiseData2 = this.netherNoiseGen1.generateNoiseOctaves(this.noiseData2, var2, var3, var4, var5, var6, var7, var8, var10, var8); -- this.noiseData3 = this.netherNoiseGen2.generateNoiseOctaves(this.noiseData3, var2, var3, var4, var5, var6, var7, var8, var10, var8); -+ this.noiseData4 = this.netherNoiseGen6.generateNoiseOctaves(this.noiseData4, par2, par3, par4, par5, 1, par7, 1.0D, 0.0D, 1.0D); -+ this.noiseData5 = this.netherNoiseGen7.generateNoiseOctaves(this.noiseData5, par2, par3, par4, par5, 1, par7, 100.0D, 0.0D, 100.0D); -+ this.noiseData1 = this.netherNoiseGen3.generateNoiseOctaves(this.noiseData1, par2, par3, par4, par5, par6, par7, var8 / 80.0D, var10 / 60.0D, var8 / 80.0D); -+ this.noiseData2 = this.netherNoiseGen1.generateNoiseOctaves(this.noiseData2, par2, par3, par4, par5, par6, par7, var8, var10, var8); -+ this.noiseData3 = this.netherNoiseGen2.generateNoiseOctaves(this.noiseData3, par2, par3, par4, par5, par6, par7, var8, var10, var8); - int var12 = 0; - int var13 = 0; -- double[] var14 = new double[var6]; -- -+ double[] var14 = new double[par6]; - int var15; -- for(var15 = 0; var15 < var6; ++var15) { -- var14[var15] = Math.cos((double)var15 * Math.PI * 6.0D / (double)var6) * 2.0D; -+ -+ for (var15 = 0; var15 < par6; ++var15) { -+ var14[var15] = Math.cos((double)var15 * Math.PI * 6.0D / (double)par6) * 2.0D; - double var16 = (double)var15; -- if(var15 > var6 / 2) { -- var16 = (double)(var6 - 1 - var15); -+ -+ if (var15 > par6 / 2) { -+ var16 = (double)(par6 - 1 - var15); - } - -- if(var16 < 4.0D) { -+ if (var16 < 4.0D) { - var16 = 4.0D - var16; - var14[var15] -= var16 * var16 * var16 * 10.0D; - } - } - -- for(var15 = 0; var15 < var5; ++var15) { -- for(int var36 = 0; var36 < var7; ++var36) { -+ for (var15 = 0; var15 < par5; ++var15) { -+ for (int var36 = 0; var36 < par7; ++var36) { - double var17 = (this.noiseData4[var13] + 256.0D) / 512.0D; -- if(var17 > 1.0D) { -+ -+ if (var17 > 1.0D) { - var17 = 1.0D; - } - - double var19 = 0.0D; - double var21 = this.noiseData5[var13] / 8000.0D; -- if(var21 < 0.0D) { -+ -+ if (var21 < 0.0D) { - var21 = -var21; - } - - var21 = var21 * 3.0D - 3.0D; -- if(var21 < 0.0D) { -+ -+ if (var21 < 0.0D) { - var21 /= 2.0D; -- if(var21 < -1.0D) { -+ -+ if (var21 < -1.0D) { - var21 = -1.0D; - } - -@@ -250,7 +293,7 @@ - var21 /= 2.0D; - var17 = 0.0D; - } else { -- if(var21 > 1.0D) { -+ if (var21 > 1.0D) { - var21 = 1.0D; - } - -@@ -258,18 +301,19 @@ - } - - var17 += 0.5D; -- var21 = var21 * (double)var6 / 16.0D; -+ var21 = var21 * (double)par6 / 16.0D; - ++var13; - -- for(int var23 = 0; var23 < var6; ++var23) { -+ for (int var23 = 0; var23 < par6; ++var23) { - double var24 = 0.0D; - double var26 = var14[var23]; - double var28 = this.noiseData2[var12] / 512.0D; - double var30 = this.noiseData3[var12] / 512.0D; - double var32 = (this.noiseData1[var12] / 10.0D + 1.0D) / 2.0D; -- if(var32 < 0.0D) { -+ -+ if (var32 < 0.0D) { - var24 = var28; -- } else if(var32 > 1.0D) { -+ } else if (var32 > 1.0D) { - var24 = var30; - } else { - var24 = var28 + (var30 - var28) * var32; -@@ -277,149 +321,179 @@ - - var24 -= var26; - double var34; -- if(var23 > var6 - 4) { -- var34 = (double)((float)(var23 - (var6 - 4)) / 3.0F); -+ -+ if (var23 > par6 - 4) { -+ var34 = (double)((float)(var23 - (par6 - 4)) / 3.0F); - var24 = var24 * (1.0D - var34) + -10.0D * var34; - } - -- if((double)var23 < var19) { -+ if ((double)var23 < var19) { - var34 = (var19 - (double)var23) / 4.0D; -- if(var34 < 0.0D) { -+ -+ if (var34 < 0.0D) { - var34 = 0.0D; - } - -- if(var34 > 1.0D) { -+ if (var34 > 1.0D) { - var34 = 1.0D; - } - - var24 = var24 * (1.0D - var34) + -10.0D * var34; - } - -- var1[var12] = var24; -+ par1ArrayOfDouble[var12] = var24; - ++var12; - } - } - } - -- return var1; -+ return par1ArrayOfDouble; - } - -- public boolean chunkExists(int var1, int var2) { -+ /** -+ * Checks to see if a chunk exists at x, y -+ */ -+ public boolean chunkExists(int par1, int par2) { - return true; - } - -- public void populate(IChunkProvider var1, int var2, int var3) { -+ /** -+ * Populates chunk with ores etc etc -+ */ -+ public void populate(IChunkProvider par1IChunkProvider, int par2, int par3) { - BlockSand.fallInstantly = true; -- int var4 = var2 * 16; -- int var5 = var3 * 16; -- this.genNetherBridge.generateStructuresInChunk(this.worldObj, this.i, var2, var3); -- -+ int var4 = par2 * 16; -+ int var5 = par3 * 16; -+ this.genNetherBridge.generateStructuresInChunk(this.worldObj, this.hellRNG, par2, par3); - int var6; - int var7; - int var8; - int var9; -- for(var6 = 0; var6 < 8; ++var6) { -- var7 = var4 + this.i.nextInt(16) + 8; -- var8 = this.i.nextInt(120) + 4; -- var9 = var5 + this.i.nextInt(16) + 8; -- (new WorldGenHellLava(Block.lavaMoving.blockID, false)).generate(this.worldObj, this.i, var7, var8, var9); -+ -+ for (var6 = 0; var6 < 8; ++var6) { -+ var7 = var4 + this.hellRNG.nextInt(16) + 8; -+ var8 = this.hellRNG.nextInt(120) + 4; -+ var9 = var5 + this.hellRNG.nextInt(16) + 8; -+ (new WorldGenHellLava(Block.lavaMoving.blockID, false)).generate(this.worldObj, this.hellRNG, var7, var8, var9); - } - -- var6 = this.i.nextInt(this.i.nextInt(10) + 1) + 1; -- -+ var6 = this.hellRNG.nextInt(this.hellRNG.nextInt(10) + 1) + 1; - int var10; -- for(var7 = 0; var7 < var6; ++var7) { -- var8 = var4 + this.i.nextInt(16) + 8; -- var9 = this.i.nextInt(120) + 4; -- var10 = var5 + this.i.nextInt(16) + 8; -- (new WorldGenFire()).generate(this.worldObj, this.i, var8, var9, var10); -- } -- -- var6 = this.i.nextInt(this.i.nextInt(10) + 1); -- -- for(var7 = 0; var7 < var6; ++var7) { -- var8 = var4 + this.i.nextInt(16) + 8; -- var9 = this.i.nextInt(120) + 4; -- var10 = var5 + this.i.nextInt(16) + 8; -- (new WorldGenGlowStone1()).generate(this.worldObj, this.i, var8, var9, var10); -- } -- -- for(var7 = 0; var7 < 10; ++var7) { -- var8 = var4 + this.i.nextInt(16) + 8; -- var9 = this.i.nextInt(128); -- var10 = var5 + this.i.nextInt(16) + 8; -- (new WorldGenGlowStone2()).generate(this.worldObj, this.i, var8, var9, var10); -- } -- -- if(this.i.nextInt(1) == 0) { -- var7 = var4 + this.i.nextInt(16) + 8; -- var8 = this.i.nextInt(128); -- var9 = var5 + this.i.nextInt(16) + 8; -- (new WorldGenFlowers(Block.mushroomBrown.blockID)).generate(this.worldObj, this.i, var7, var8, var9); -- } -- -- if(this.i.nextInt(1) == 0) { -- var7 = var4 + this.i.nextInt(16) + 8; -- var8 = this.i.nextInt(128); -- var9 = var5 + this.i.nextInt(16) + 8; -- (new WorldGenFlowers(Block.mushroomRed.blockID)).generate(this.worldObj, this.i, var7, var8, var9); -+ -+ for (var7 = 0; var7 < var6; ++var7) { -+ var8 = var4 + this.hellRNG.nextInt(16) + 8; -+ var9 = this.hellRNG.nextInt(120) + 4; -+ var10 = var5 + this.hellRNG.nextInt(16) + 8; -+ (new WorldGenFire()).generate(this.worldObj, this.hellRNG, var8, var9, var10); -+ } -+ -+ var6 = this.hellRNG.nextInt(this.hellRNG.nextInt(10) + 1); -+ -+ for (var7 = 0; var7 < var6; ++var7) { -+ var8 = var4 + this.hellRNG.nextInt(16) + 8; -+ var9 = this.hellRNG.nextInt(120) + 4; -+ var10 = var5 + this.hellRNG.nextInt(16) + 8; -+ (new WorldGenGlowStone1()).generate(this.worldObj, this.hellRNG, var8, var9, var10); -+ } -+ -+ for (var7 = 0; var7 < 10; ++var7) { -+ var8 = var4 + this.hellRNG.nextInt(16) + 8; -+ var9 = this.hellRNG.nextInt(128); -+ var10 = var5 + this.hellRNG.nextInt(16) + 8; -+ (new WorldGenGlowStone2()).generate(this.worldObj, this.hellRNG, var8, var9, var10); -+ } -+ -+ if (this.hellRNG.nextInt(1) == 0) { -+ var7 = var4 + this.hellRNG.nextInt(16) + 8; -+ var8 = this.hellRNG.nextInt(128); -+ var9 = var5 + this.hellRNG.nextInt(16) + 8; -+ (new WorldGenFlowers(Block.mushroomBrown.blockID)).generate(this.worldObj, this.hellRNG, var7, var8, var9); -+ } -+ -+ if (this.hellRNG.nextInt(1) == 0) { -+ var7 = var4 + this.hellRNG.nextInt(16) + 8; -+ var8 = this.hellRNG.nextInt(128); -+ var9 = var5 + this.hellRNG.nextInt(16) + 8; -+ (new WorldGenFlowers(Block.mushroomRed.blockID)).generate(this.worldObj, this.hellRNG, var7, var8, var9); - } - - WorldGenMinable var12 = new WorldGenMinable(Block.oreNetherQuartz.blockID, 13, Block.netherrack.blockID); -- - int var11; -- for(var8 = 0; var8 < 16; ++var8) { -- var9 = var4 + this.i.nextInt(16); -- var10 = this.i.nextInt(108) + 10; -- var11 = var5 + this.i.nextInt(16); -- var12.generate(this.worldObj, this.i, var9, var10, var11); -+ -+ for (var8 = 0; var8 < 16; ++var8) { -+ var9 = var4 + this.hellRNG.nextInt(16); -+ var10 = this.hellRNG.nextInt(108) + 10; -+ var11 = var5 + this.hellRNG.nextInt(16); -+ var12.generate(this.worldObj, this.hellRNG, var9, var10, var11); - } - -- for(var8 = 0; var8 < 16; ++var8) { -- var9 = var4 + this.i.nextInt(16); -- var10 = this.i.nextInt(108) + 10; -- var11 = var5 + this.i.nextInt(16); -- (new WorldGenHellLava(Block.lavaMoving.blockID, true)).generate(this.worldObj, this.i, var9, var10, var11); -+ for (var8 = 0; var8 < 16; ++var8) { -+ var9 = var4 + this.hellRNG.nextInt(16); -+ var10 = this.hellRNG.nextInt(108) + 10; -+ var11 = var5 + this.hellRNG.nextInt(16); -+ (new WorldGenHellLava(Block.lavaMoving.blockID, true)).generate(this.worldObj, this.hellRNG, var9, var10, var11); - } - - BlockSand.fallInstantly = false; - } - -- public boolean saveChunks(boolean var1, IProgressUpdate var2) { -+ /** -+ * Two modes of operation: if passed true, save all Chunks in one go. If passed false, save up to two chunks. Return -+ * true if all chunks have been saved. -+ */ -+ public boolean saveChunks(boolean par1, IProgressUpdate par2IProgressUpdate) { - return true; - } - -- public void saveExtraData() { -- } -+ /** -+ * Save extra data not associated with any Chunk. Not saved during autosave, only during world unload. Currently -+ * unimplemented. -+ */ -+ public void saveExtraData() {} - -+ /** -+ * Unloads chunks that are marked to be unloaded. This is not guaranteed to unload every such chunk. -+ */ - public boolean unloadQueuedChunks() { - return false; - } - -+ /** -+ * Returns if the IChunkProvider supports saving. -+ */ - public boolean canSave() { - return true; - } - -+ /** -+ * Converts the instance data to a readable string. -+ */ - public String makeString() { - return "HellRandomLevelSource"; - } - -- public List getPossibleCreatures(EnumCreatureType var1, int var2, int var3, int var4) { -- if(var1 == EnumCreatureType.monster) { -- if(this.genNetherBridge.hasStructureAt(var2, var3, var4)) { -+ /** -+ * Returns a list of creatures of the specified type that can spawn at the given location. -+ */ -+ public List getPossibleCreatures(EnumCreatureType par1EnumCreatureType, int par2, int par3, int par4) { -+ if (par1EnumCreatureType == EnumCreatureType.monster) { -+ if (this.genNetherBridge.hasStructureAt(par2, par3, par4)) { - return this.genNetherBridge.getSpawnList(); - } - -- if(this.genNetherBridge.func_142038_b(var2, var3, var4) && this.worldObj.getBlockId(var2, var3 - 1, var4) == Block.netherBrick.blockID) { -+ if (this.genNetherBridge.func_142038_b(par2, par3, par4) && this.worldObj.getBlockId(par2, par3 - 1, par4) == Block.netherBrick.blockID) { - return this.genNetherBridge.getSpawnList(); - } - } - -- BiomeGenBase var5 = this.worldObj.getBiomeGenForCoords(var2, var4); -- return var5 == null ? null : var5.getSpawnableList(var1); -+ BiomeGenBase var5 = this.worldObj.getBiomeGenForCoords(par2, par4); -+ return var5 == null ? null : var5.getSpawnableList(par1EnumCreatureType); - } - -- public ChunkPosition findClosestStructure(World var1, String var2, int var3, int var4, int var5) { -+ /** -+ * Returns the location of the closest structure of the specified type. If not found returns null. -+ */ -+ public ChunkPosition findClosestStructure(World par1World, String par2Str, int par3, int par4, int par5) { - return null; - } - -@@ -427,7 +501,7 @@ - return 0; - } - -- public void recreateStructures(int var1, int var2) { -- this.genNetherBridge.generate(this, this.worldObj, var1, var2, (byte[])null); -+ public void recreateStructures(int par1, int par2) { -+ this.genNetherBridge.generate(this, this.worldObj, par1, par2, (byte[])null); - } - } ---- net/minecraft/src/Packet2ClientProtocol.java -+++ net/minecraft/src/Packet2ClientProtocol.java -@@ -6,47 +6,64 @@ - - public class Packet2ClientProtocol extends Packet { - private int protocolVersion; -- private String b; -- private String c; -+ private String username; -+ private String serverHost; - private int serverPort; - -- public Packet2ClientProtocol() { -- } -- -- public Packet2ClientProtocol(int var1, String var2, String var3, int var4) { -- this.protocolVersion = var1; -- this.b = var2; -- this.c = var3; -- this.serverPort = var4; -- } -- -- public void readPacketData(DataInput var1) throws IOException { -- this.protocolVersion = var1.readByte(); -- this.b = readString(var1, 16); -- this.c = readString(var1, 255); -- this.serverPort = var1.readInt(); -- } -- -- public void writePacketData(DataOutput var1) throws IOException { -- var1.writeByte(this.protocolVersion); -- writeString(this.b, var1); -- writeString(this.c, var1); -- var1.writeInt(this.serverPort); -- } -- -- public void processPacket(NetHandler var1) { -- var1.handleClientProtocol(this); -- } -- -+ public Packet2ClientProtocol() {} -+ -+ public Packet2ClientProtocol(int par1, String par2Str, String par3Str, int par4) { -+ this.protocolVersion = par1; -+ this.username = par2Str; -+ this.serverHost = par3Str; -+ this.serverPort = par4; -+ } -+ -+ /** -+ * Abstract. Reads the raw packet data from the data stream. -+ */ -+ public void readPacketData(DataInput par1DataInput) throws IOException { -+ this.protocolVersion = par1DataInput.readByte(); -+ this.username = readString(par1DataInput, 16); -+ this.serverHost = readString(par1DataInput, 255); -+ this.serverPort = par1DataInput.readInt(); -+ } -+ -+ /** -+ * Abstract. Writes the raw packet data to the data stream. -+ */ -+ public void writePacketData(DataOutput par1DataOutput) throws IOException { -+ par1DataOutput.writeByte(this.protocolVersion); -+ writeString(this.username, par1DataOutput); -+ writeString(this.serverHost, par1DataOutput); -+ par1DataOutput.writeInt(this.serverPort); -+ } -+ -+ /** -+ * Passes this Packet on to the NetHandler for processing. -+ */ -+ public void processPacket(NetHandler par1NetHandler) { -+ par1NetHandler.handleClientProtocol(this); -+ } -+ -+ /** -+ * Abstract. Return the size of the packet (not counting the header). -+ */ - public int getPacketSize() { -- return 3 + 2 * this.b.length(); -+ return 3 + 2 * this.username.length(); - } - -+ /** -+ * Returns the protocol version. -+ */ - public int getProtocolVersion() { - return this.protocolVersion; - } - -+ /** -+ * Returns the username. -+ */ - public String getUsername() { -- return this.b; -+ return this.username; - } - } ---- /dev/null -+++ org/spoutcraft/api/gui/SolidBackground.java -@@ -1,0 +1,35 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.api.gui; -+ -+import org.spoutcraft.api.UnsafeClass; -+ -+@UnsafeClass -+public interface SolidBackground { -+ /** -+ * Not implemented. -+ * -+ * @param red -+ * @param green -+ * @param blue -+ * @param alpha -+ */ -+ public void setColor(float red, float green, float blue, float alpha); -+} ---- net/minecraft/src/EmptyChunk.java -+++ net/minecraft/src/EmptyChunk.java -@@ -4,109 +4,176 @@ - import java.util.Random; - - public class EmptyChunk extends Chunk { -- public EmptyChunk(World var1, int var2, int var3) { -- super(var1, var2, var3); -- } -- -- public boolean isAtLocation(int var1, int var2) { -- return var1 == this.xPosition && var2 == this.zPosition; -- } -- -- public int getHeightValue(int var1, int var2) { -- return 0; -- } -- -- public void generateHeightMap() { -- } -- -- public void generateSkylightMap() { -- } -- -- public int getBlockID(int var1, int var2, int var3) { -- return 0; -- } -- -- public int getBlockLightOpacity(int var1, int var2, int var3) { -+ public EmptyChunk(World par1World, int par2, int par3) { -+ super(par1World, par2, par3); -+ } -+ -+ /** -+ * Checks whether the chunk is at the X/Z location specified -+ */ -+ public boolean isAtLocation(int par1, int par2) { -+ return par1 == this.xPosition && par2 == this.zPosition; -+ } -+ -+ /** -+ * Returns the value in the height map at this x, z coordinate in the chunk -+ */ -+ public int getHeightValue(int par1, int par2) { -+ return 0; -+ } -+ -+ /** -+ * Generates the height map for a chunk from scratch -+ */ -+ public void generateHeightMap() {} -+ -+ /** -+ * Generates the initial skylight map for the chunk upon generation or load. -+ */ -+ public void generateSkylightMap() {} -+ -+ /** -+ * Return the ID of a block in the chunk. -+ */ -+ public int getBlockID(int par1, int par2, int par3) { -+ return 0; -+ } -+ -+ public int getBlockLightOpacity(int par1, int par2, int par3) { - return 255; - } - -- public boolean setBlockIDWithMetadata(int var1, int var2, int var3, int var4, int var5) { -+ /** -+ * Sets a blockID of a position within a chunk with metadata. Args: x, y, z, blockID, metadata -+ */ -+ public boolean setBlockIDWithMetadata(int par1, int par2, int par3, int par4, int par5) { - return true; - } - -- public int getBlockMetadata(int var1, int var2, int var3) { -- return 0; -- } -- -- public boolean setBlockMetadata(int var1, int var2, int var3, int var4) { -- return false; -- } -- -- public int getSavedLightValue(EnumSkyBlock var1, int var2, int var3, int var4) { -- return 0; -- } -- -- public void setLightValue(EnumSkyBlock var1, int var2, int var3, int var4, int var5) { -- } -- -- public int getBlockLightValue(int var1, int var2, int var3, int var4) { -- return 0; -- } -- -- public void addEntity(Entity var1) { -- } -- -- public void removeEntity(Entity var1) { -- } -- -- public void removeEntityAtIndex(Entity var1, int var2) { -- } -- -- public boolean canBlockSeeTheSky(int var1, int var2, int var3) { -- return false; -- } -- -- public TileEntity getChunkBlockTileEntity(int var1, int var2, int var3) { -+ /** -+ * Return the metadata corresponding to the given coordinates inside a chunk. -+ */ -+ public int getBlockMetadata(int par1, int par2, int par3) { -+ return 0; -+ } -+ -+ /** -+ * Set the metadata of a block in the chunk -+ */ -+ public boolean setBlockMetadata(int par1, int par2, int par3, int par4) { -+ return false; -+ } -+ -+ /** -+ * Gets the amount of light saved in this block (doesn't adjust for daylight) -+ */ -+ public int getSavedLightValue(EnumSkyBlock par1EnumSkyBlock, int par2, int par3, int par4) { -+ return 0; -+ } -+ -+ /** -+ * Sets the light value at the coordinate. If enumskyblock is set to sky it sets it in the skylightmap and if its a -+ * block then into the blocklightmap. Args enumSkyBlock, x, y, z, lightValue -+ */ -+ public void setLightValue(EnumSkyBlock par1EnumSkyBlock, int par2, int par3, int par4, int par5) {} -+ -+ /** -+ * Gets the amount of light on a block taking into account sunlight -+ */ -+ public int getBlockLightValue(int par1, int par2, int par3, int par4) { -+ return 0; -+ } -+ -+ /** -+ * Adds an entity to the chunk. Args: entity -+ */ -+ public void addEntity(Entity par1Entity) {} -+ -+ /** -+ * removes entity using its y chunk coordinate as its index -+ */ -+ public void removeEntity(Entity par1Entity) {} -+ -+ /** -+ * Removes entity at the specified index from the entity array. -+ */ -+ public void removeEntityAtIndex(Entity par1Entity, int par2) {} -+ -+ /** -+ * Returns whether is not a block above this one blocking sight to the sky (done via checking against the heightmap) -+ */ -+ public boolean canBlockSeeTheSky(int par1, int par2, int par3) { -+ return false; -+ } -+ -+ /** -+ * Gets the TileEntity for a given block in this chunk -+ */ -+ public TileEntity getChunkBlockTileEntity(int par1, int par2, int par3) { - return null; - } - -- public void addTileEntity(TileEntity var1) { -- } -- -- public void setChunkBlockTileEntity(int var1, int var2, int var3, TileEntity var4) { -- } -- -- public void removeChunkBlockTileEntity(int var1, int var2, int var3) { -- } -- -- public void onChunkLoad() { -- } -- -- public void onChunkUnload() { -- } -- -- public void setChunkModified() { -- } -- -- public void getEntitiesWithinAABBForEntity(Entity var1, AxisAlignedBB var2, List var3, IEntitySelector var4) { -- } -- -- public void getEntitiesOfTypeWithinAAAB(Class var1, AxisAlignedBB var2, List var3, IEntitySelector var4) { -- } -- -- public boolean needsSaving(boolean var1) { -+ /** -+ * Adds a TileEntity to a chunk -+ */ -+ public void addTileEntity(TileEntity par1TileEntity) {} -+ -+ /** -+ * Sets the TileEntity for a given block in this chunk -+ */ -+ public void setChunkBlockTileEntity(int par1, int par2, int par3, TileEntity par4TileEntity) {} -+ -+ /** -+ * Removes the TileEntity for a given block in this chunk -+ */ -+ public void removeChunkBlockTileEntity(int par1, int par2, int par3) {} -+ -+ /** -+ * Called when this Chunk is loaded by the ChunkProvider -+ */ -+ public void onChunkLoad() {} -+ -+ /** -+ * Called when this Chunk is unloaded by the ChunkProvider -+ */ -+ public void onChunkUnload() {} -+ -+ /** -+ * Sets the isModified flag for this Chunk -+ */ -+ public void setChunkModified() {} -+ -+ /** -+ * Fills the given list of all entities that intersect within the given bounding box that aren't the passed entity -+ * Args: entity, aabb, listToFill -+ */ -+ public void getEntitiesWithinAABBForEntity(Entity par1Entity, AxisAlignedBB par2AxisAlignedBB, List par3List, IEntitySelector par4IEntitySelector) {} -+ -+ /** -+ * Gets all entities that can be assigned to the specified class. Args: entityClass, aabb, listToFill -+ */ -+ public void getEntitiesOfTypeWithinAAAB(Class par1Class, AxisAlignedBB par2AxisAlignedBB, List par3List, IEntitySelector par4IEntitySelector) {} -+ -+ /** -+ * Returns true if this Chunk needs to be saved -+ */ -+ public boolean needsSaving(boolean par1) { - return false; - } - -- public Random getRandomWithSeed(long var1) { -- 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) ^ var1); -+ public Random getRandomWithSeed(long par1) { -+ 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) ^ par1); - } - - public boolean isEmpty() { - return true; - } - -- public boolean getAreLevelsEmpty(int var1, int var2) { -+ /** -+ * Returns whether the ExtendedBlockStorages containing levels (in blocks) from arg 1 to arg 2 are fully empty (true) -+ * or not (false). -+ */ -+ public boolean getAreLevelsEmpty(int par1, int par2) { - return true; - } - } ---- net/minecraft/src/ServerBlockEventList.java -+++ net/minecraft/src/ServerBlockEventList.java -@@ -3,10 +3,9 @@ - import java.util.ArrayList; - - class ServerBlockEventList extends ArrayList { -- private ServerBlockEventList() { -- } -+ private ServerBlockEventList() {} - -- ServerBlockEventList(ServerBlockEvent var1) { -+ ServerBlockEventList(ServerBlockEvent par1ServerBlockEvent) { - this(); - } - } ---- net/minecraft/src/StatCollector.java -+++ net/minecraft/src/StatCollector.java -@@ -3,15 +3,21 @@ - public class StatCollector { - private static StringTranslate localizedName = StringTranslate.getInstance(); - -- public static String translateToLocal(String var0) { -- return localizedName.translateKey(var0); -- } -- -- public static String translateToLocalFormatted(String var0, Object... var1) { -- return localizedName.translateKeyFormat(var0, var1); -- } -- -- public static boolean func_94522_b(String var0) { -- return localizedName.isKeyTranslated(var0); -+ /** -+ * Translates a Stat name -+ */ -+ public static String translateToLocal(String par0Str) { -+ return localizedName.translateKey(par0Str); -+ } -+ -+ /** -+ * Translates a Stat name with format args -+ */ -+ public static String translateToLocalFormatted(String par0Str, Object ... par1ArrayOfObj) { -+ return localizedName.translateKeyFormat(par0Str, par1ArrayOfObj); -+ } -+ -+ public static boolean func_94522_b(String par0Str) { -+ return localizedName.containsTranslateKey(par0Str); - } - } ---- net/minecraft/src/ItemDoor.java -+++ net/minecraft/src/ItemDoor.java -@@ -3,32 +3,37 @@ - public class ItemDoor extends Item { - private Material doorMaterial; - -- public ItemDoor(int var1, Material var2) { -- super(var1); -- this.doorMaterial = var2; -+ public ItemDoor(int par1, Material par2Material) { -+ super(par1); -+ this.doorMaterial = par2Material; - this.maxStackSize = 1; - this.setCreativeTab(CreativeTabs.tabRedstone); - } - -- public boolean onItemUse(ItemStack var1, EntityPlayer var2, World var3, int var4, int var5, int var6, int var7, float var8, float var9, float var10) { -- if(var7 != 1) { -+ /** -+ * Callback for item usage. If the item does something special on right clicking, he will have one of those. Return -+ * True if something happen and false if it don't. This is for ITEMS, not BLOCKS -+ */ -+ public boolean onItemUse(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, World par3World, int par4, int par5, int par6, int par7, float par8, float par9, float par10) { -+ if (par7 != 1) { - return false; - } else { -- ++var5; -+ ++par5; - Block var11; -- if(this.doorMaterial == Material.wood) { -+ -+ if (this.doorMaterial == Material.wood) { - var11 = Block.doorWood; - } else { - var11 = Block.doorIron; - } - -- if(var2.canPlayerEdit(var4, var5, var6, var7, var1) && var2.canPlayerEdit(var4, var5 + 1, var6, var7, var1)) { -- if(!var11.canPlaceBlockAt(var3, var4, var5, var6)) { -+ if (par2EntityPlayer.canPlayerEdit(par4, par5, par6, par7, par1ItemStack) && par2EntityPlayer.canPlayerEdit(par4, par5 + 1, par6, par7, par1ItemStack)) { -+ if (!var11.canPlaceBlockAt(par3World, par4, par5, par6)) { - return false; - } else { -- int var12 = MathHelper.floor_double((double)((var2.rotationYaw + 180.0F) * 4.0F / 360.0F) - 0.5D) & 3; -- placeDoorBlock(var3, var4, var5, var6, var12, var11); -- --var1.stackSize; -+ int var12 = MathHelper.floor_double((double)((par2EntityPlayer.rotationYaw + 180.0F) * 4.0F / 360.0F) - 0.5D) & 3; -+ placeDoorBlock(par3World, par4, par5, par6, var12, var11); -+ --par1ItemStack.stackSize; - return true; - } - } else { -@@ -37,39 +42,41 @@ - } - } - -- public static void placeDoorBlock(World var0, int var1, int var2, int var3, int var4, Block var5) { -+ public static void placeDoorBlock(World par0World, int par1, int par2, int par3, int par4, Block par5Block) { - byte var6 = 0; - byte var7 = 0; -- if(var4 == 0) { -+ -+ if (par4 == 0) { - var7 = 1; - } - -- if(var4 == 1) { -+ if (par4 == 1) { - var6 = -1; - } - -- if(var4 == 2) { -+ if (par4 == 2) { - var7 = -1; - } - -- if(var4 == 3) { -+ if (par4 == 3) { - var6 = 1; - } - -- int var8 = (var0.isBlockNormalCube(var1 - var6, var2, var3 - var7) ? 1 : 0) + (var0.isBlockNormalCube(var1 - var6, var2 + 1, var3 - var7) ? 1 : 0); -- int var9 = (var0.isBlockNormalCube(var1 + var6, var2, var3 + var7) ? 1 : 0) + (var0.isBlockNormalCube(var1 + var6, var2 + 1, var3 + var7) ? 1 : 0); -- boolean var10 = var0.getBlockId(var1 - var6, var2, var3 - var7) == var5.blockID || var0.getBlockId(var1 - var6, var2 + 1, var3 - var7) == var5.blockID; -- boolean var11 = var0.getBlockId(var1 + var6, var2, var3 + var7) == var5.blockID || var0.getBlockId(var1 + var6, var2 + 1, var3 + var7) == var5.blockID; -+ int var8 = (par0World.isBlockNormalCube(par1 - var6, par2, par3 - var7) ? 1 : 0) + (par0World.isBlockNormalCube(par1 - var6, par2 + 1, par3 - var7) ? 1 : 0); -+ int var9 = (par0World.isBlockNormalCube(par1 + var6, par2, par3 + var7) ? 1 : 0) + (par0World.isBlockNormalCube(par1 + var6, par2 + 1, par3 + var7) ? 1 : 0); -+ boolean var10 = par0World.getBlockId(par1 - var6, par2, par3 - var7) == par5Block.blockID || par0World.getBlockId(par1 - var6, par2 + 1, par3 - var7) == par5Block.blockID; -+ boolean var11 = par0World.getBlockId(par1 + var6, par2, par3 + var7) == par5Block.blockID || par0World.getBlockId(par1 + var6, par2 + 1, par3 + var7) == par5Block.blockID; - boolean var12 = false; -- if(var10 && !var11) { -+ -+ if (var10 && !var11) { - var12 = true; -- } else if(var9 > var8) { -+ } else if (var9 > var8) { - var12 = true; - } - -- var0.setBlock(var1, var2, var3, var5.blockID, var4, 2); -- var0.setBlock(var1, var2 + 1, var3, var5.blockID, 8 | (var12 ? 1 : 0), 2); -- var0.notifyBlocksOfNeighborChange(var1, var2, var3, var5.blockID); -- var0.notifyBlocksOfNeighborChange(var1, var2 + 1, var3, var5.blockID); -+ par0World.setBlock(par1, par2, par3, par5Block.blockID, par4, 2); -+ par0World.setBlock(par1, par2 + 1, par3, par5Block.blockID, 8 | (var12 ? 1 : 0), 2); -+ par0World.notifyBlocksOfNeighborChange(par1, par2, par3, par5Block.blockID); -+ par0World.notifyBlocksOfNeighborChange(par1, par2 + 1, par3, par5Block.blockID); - } - } ---- net/minecraft/src/NibbleArray.java -+++ net/minecraft/src/NibbleArray.java -@@ -1,38 +1,56 @@ - package net.minecraft.src; - - public class NibbleArray { -+ -+ /** -+ * Byte array of data stored in this holder. Possibly a light map or some chunk data. Data is accessed in 4-bit pieces. -+ */ - public final byte[] data; -+ -+ /** -+ * Log base 2 of the chunk height (128); applied as a shift on Z coordinate -+ */ - private final int depthBits; -+ -+ /** -+ * Log base 2 of the chunk height (128) * width (16); applied as a shift on X coordinate -+ */ - private final int depthBitsPlusFour; - -- public NibbleArray(int var1, int var2) { -- this.data = new byte[var1 >> 1]; -- this.depthBits = var2; -- this.depthBitsPlusFour = var2 + 4; -- } -- -- public NibbleArray(byte[] var1, int var2) { -- this.data = var1; -- this.depthBits = var2; -- this.depthBitsPlusFour = var2 + 4; -- } -- -- public int get(int var1, int var2, int var3) { -- int var4 = var2 << this.depthBitsPlusFour | var3 << this.depthBits | var1; -+ public NibbleArray(int par1, int par2) { -+ this.data = new byte[par1 >> 1]; -+ this.depthBits = par2; -+ this.depthBitsPlusFour = par2 + 4; -+ } -+ -+ public NibbleArray(byte[] par1ArrayOfByte, int par2) { -+ this.data = par1ArrayOfByte; -+ this.depthBits = par2; -+ this.depthBitsPlusFour = par2 + 4; -+ } -+ -+ /** -+ * Returns the nibble of data corresponding to the passed in x, y, z. y is at most 6 bits, z is at most 4. -+ */ -+ public int get(int par1, int par2, int par3) { -+ int var4 = par2 << this.depthBitsPlusFour | par3 << this.depthBits | par1; - int var5 = var4 >> 1; - int var6 = var4 & 1; - return var6 == 0 ? this.data[var5] & 15 : this.data[var5] >> 4 & 15; - } - -- public void set(int var1, int var2, int var3, int var4) { -- int var5 = var2 << this.depthBitsPlusFour | var3 << this.depthBits | var1; -+ /** -+ * Arguments are x, y, z, val. Sets the nibble of data at x << 11 | z << 7 | y to val. -+ */ -+ public void set(int par1, int par2, int par3, int par4) { -+ int var5 = par2 << this.depthBitsPlusFour | par3 << this.depthBits | par1; - int var6 = var5 >> 1; - int var7 = var5 & 1; -- if(var7 == 0) { -- this.data[var6] = (byte)(this.data[var6] & 240 | var4 & 15); -+ -+ if (var7 == 0) { -+ this.data[var6] = (byte)(this.data[var6] & 240 | par4 & 15); - } else { -- this.data[var6] = (byte)(this.data[var6] & 15 | (var4 & 15) << 4); -+ this.data[var6] = (byte)(this.data[var6] & 15 | (par4 & 15) << 4); - } -- - } - } ---- net/minecraft/src/RenderMinecart.java -+++ net/minecraft/src/RenderMinecart.java -@@ -4,6 +4,8 @@ - - public class RenderMinecart extends Render { - private static final ResourceLocation minecartTextures = new ResourceLocation("textures/entity/minecart.png"); -+ -+ /** instance of ModelMinecart for rendering */ - protected ModelBase modelMinecart = new ModelMinecart(); - protected final RenderBlocks field_94145_f; - -@@ -12,92 +14,112 @@ - this.field_94145_f = new RenderBlocks(); - } - -- public void renderTheMinecart(EntityMinecart var1, double var2, double var4, double var6, float var8, float var9) { -+ /** -+ * Renders the Minecart. -+ */ -+ public void renderTheMinecart(EntityMinecart par1EntityMinecart, double par2, double par4, double par6, float par8, float par9) { - GL11.glPushMatrix(); -- this.bindEntityTexture(var1); -- long var10 = (long)var1.entityId * 493286711L; -+ this.bindEntityTexture(par1EntityMinecart); -+ long var10 = (long)par1EntityMinecart.entityId * 493286711L; - var10 = var10 * var10 * 4392167121L + var10 * 98761L; - float var12 = (((float)(var10 >> 16 & 7L) + 0.5F) / 8.0F - 0.5F) * 0.004F; - float var13 = (((float)(var10 >> 20 & 7L) + 0.5F) / 8.0F - 0.5F) * 0.004F; - float var14 = (((float)(var10 >> 24 & 7L) + 0.5F) / 8.0F - 0.5F) * 0.004F; - GL11.glTranslatef(var12, var13, var14); -- double var15 = var1.lastTickPosX + (var1.posX - var1.lastTickPosX) * (double)var9; -- double var17 = var1.lastTickPosY + (var1.posY - var1.lastTickPosY) * (double)var9; -- double var19 = var1.lastTickPosZ + (var1.posZ - var1.lastTickPosZ) * (double)var9; -- double var21 = (double)0.3F; -- Vec3 var23 = var1.func_70489_a(var15, var17, var19); -- float var24 = var1.prevRotationPitch + (var1.rotationPitch - var1.prevRotationPitch) * var9; -- if(var23 != null) { -- Vec3 var25 = var1.func_70495_a(var15, var17, var19, var21); -- Vec3 var26 = var1.func_70495_a(var15, var17, var19, -var21); -- if(var25 == null) { -+ double var15 = par1EntityMinecart.lastTickPosX + (par1EntityMinecart.posX - par1EntityMinecart.lastTickPosX) * (double)par9; -+ double var17 = par1EntityMinecart.lastTickPosY + (par1EntityMinecart.posY - par1EntityMinecart.lastTickPosY) * (double)par9; -+ double var19 = par1EntityMinecart.lastTickPosZ + (par1EntityMinecart.posZ - par1EntityMinecart.lastTickPosZ) * (double)par9; -+ double var21 = 0.30000001192092896D; -+ Vec3 var23 = par1EntityMinecart.func_70489_a(var15, var17, var19); -+ float var24 = par1EntityMinecart.prevRotationPitch + (par1EntityMinecart.rotationPitch - par1EntityMinecart.prevRotationPitch) * par9; -+ -+ if (var23 != null) { -+ Vec3 var25 = par1EntityMinecart.func_70495_a(var15, var17, var19, var21); -+ Vec3 var26 = par1EntityMinecart.func_70495_a(var15, var17, var19, -var21); -+ -+ if (var25 == null) { - var25 = var23; - } - -- if(var26 == null) { -+ if (var26 == null) { - var26 = var23; - } - -- var2 += var23.xCoord - var15; -- var4 += (var25.yCoord + var26.yCoord) / 2.0D - var17; -- var6 += var23.zCoord - var19; -+ par2 += var23.xCoord - var15; -+ par4 += (var25.yCoord + var26.yCoord) / 2.0D - var17; -+ par6 += var23.zCoord - var19; - Vec3 var27 = var26.addVector(-var25.xCoord, -var25.yCoord, -var25.zCoord); -- if(var27.lengthVector() != 0.0D) { -+ -+ if (var27.lengthVector() != 0.0D) { - var27 = var27.normalize(); -- var8 = (float)(Math.atan2(var27.zCoord, var27.xCoord) * 180.0D / Math.PI); -+ par8 = (float)(Math.atan2(var27.zCoord, var27.xCoord) * 180.0D / Math.PI); - var24 = (float)(Math.atan(var27.yCoord) * 73.0D); - } - } - -- GL11.glTranslatef((float)var2, (float)var4, (float)var6); -- GL11.glRotatef(180.0F - var8, 0.0F, 1.0F, 0.0F); -+ GL11.glTranslatef((float)par2, (float)par4, (float)par6); -+ GL11.glRotatef(180.0F - par8, 0.0F, 1.0F, 0.0F); - GL11.glRotatef(-var24, 0.0F, 0.0F, 1.0F); -- float var31 = (float)var1.getRollingAmplitude() - var9; -- float var32 = var1.getDamage() - var9; -- if(var32 < 0.0F) { -+ float var31 = (float)par1EntityMinecart.getRollingAmplitude() - par9; -+ float var32 = par1EntityMinecart.getDamage() - par9; -+ -+ if (var32 < 0.0F) { - var32 = 0.0F; - } - -- if(var31 > 0.0F) { -- GL11.glRotatef(MathHelper.sin(var31) * var31 * var32 / 10.0F * (float)var1.getRollingDirection(), 1.0F, 0.0F, 0.0F); -+ if (var31 > 0.0F) { -+ GL11.glRotatef(MathHelper.sin(var31) * var31 * var32 / 10.0F * (float)par1EntityMinecart.getRollingDirection(), 1.0F, 0.0F, 0.0F); - } - -- int var33 = var1.getDisplayTileOffset(); -- Block var28 = var1.getDisplayTile(); -- int var29 = var1.getDisplayTileData(); -- if(var28 != null) { -+ int var33 = par1EntityMinecart.getDisplayTileOffset(); -+ Block var28 = par1EntityMinecart.getDisplayTile(); -+ int var29 = par1EntityMinecart.getDisplayTileData(); -+ -+ if (var28 != null) { - GL11.glPushMatrix(); - this.bindTexture(TextureMap.locationBlocksTexture); -- float var30 = 12.0F / 16.0F; -+ float var30 = 0.75F; - GL11.glScalef(var30, var30, var30); - GL11.glTranslatef(0.0F, (float)var33 / 16.0F, 0.0F); -- this.renderBlockInMinecart(var1, var9, var28, var29); -+ this.renderBlockInMinecart(par1EntityMinecart, par9, var28, var29); - GL11.glPopMatrix(); - GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); -- this.bindEntityTexture(var1); -+ this.bindEntityTexture(par1EntityMinecart); - } - - GL11.glScalef(-1.0F, -1.0F, 1.0F); -- this.modelMinecart.render(var1, 0.0F, 0.0F, -0.1F, 0.0F, 0.0F, 1.0F / 16.0F); -+ this.modelMinecart.render(par1EntityMinecart, 0.0F, 0.0F, -0.1F, 0.0F, 0.0F, 0.0625F); - GL11.glPopMatrix(); - } - -- protected ResourceLocation getMinecartTextures(EntityMinecart var1) { -+ protected ResourceLocation getMinecartTextures(EntityMinecart par1EntityMinecart) { - return minecartTextures; - } - -- protected void renderBlockInMinecart(EntityMinecart var1, float var2, Block var3, int var4) { -- float var5 = var1.getBrightness(var2); -+ /** -+ * Renders the block that is inside the minecart. -+ */ -+ protected void renderBlockInMinecart(EntityMinecart par1EntityMinecart, float par2, Block par3Block, int par4) { -+ float var5 = par1EntityMinecart.getBrightness(par2); - GL11.glPushMatrix(); -- this.field_94145_f.renderBlockAsItem(var3, var4, var5); -+ this.field_94145_f.renderBlockAsItem(par3Block, par4, var5); - GL11.glPopMatrix(); - } - -- protected ResourceLocation getEntityTexture(Entity var1) { -- return this.getMinecartTextures((EntityMinecart)var1); -+ /** -+ * Returns the location of an entity's texture. Doesn't seem to be called unless you call Render.bindEntityTexture. -+ */ -+ protected ResourceLocation getEntityTexture(Entity par1Entity) { -+ return this.getMinecartTextures((EntityMinecart)par1Entity); - } - -- public void doRender(Entity var1, double var2, double var4, double var6, float var8, float var9) { -- this.renderTheMinecart((EntityMinecart)var1, var2, var4, var6, var8, var9); -+ /** -+ * Actually renders the given argument. This is a synthetic bridge method, always casting down its argument and then -+ * handing it off to a worker function which does the actual work. In all probabilty, the class Render is generic -+ * (Render -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.api.material.block; -+ -+import org.spoutcraft.api.material.Block; -+ -+public class Air extends GenericBlock implements Block { -+ public Air(String name) { -+ super(name, 0); -+ } -+ -+ @Override -+ public float getFriction() { -+ return 0; -+ } -+ -+ @Override -+ public Block setFriction(float slip) { -+ return this; -+ } -+ -+ @Override -+ public float getHardness() { -+ return 0; -+ } -+ -+ @Override -+ public Block setHardness(float hardness) { -+ return this; -+ } -+ -+ @Override -+ public boolean isOpaque() { -+ return false; -+ } -+ -+ @Override -+ public Block setOpaque(boolean opaque) { -+ return this; -+ } -+ -+ @Override -+ public int getLightLevel() { -+ return 0; -+ } -+ -+ @Override -+ public Block setLightLevel(int level) { -+ return this; -+ } -+} ---- net/minecraft/src/ModelChest.java -+++ net/minecraft/src/ModelChest.java -@@ -1,8 +1,14 @@ - package net.minecraft.src; - - public class ModelChest extends ModelBase { -+ -+ /** The chest lid in the chest's model. */ - public ModelRenderer chestLid = (new ModelRenderer(this, 0, 0)).setTextureSize(64, 64); -+ -+ /** The model of the bottom of the chest. */ - public ModelRenderer chestBelow; -+ -+ /** The chest's knob in the chest model. */ - public ModelRenderer chestKnob; - - public ModelChest() { -@@ -22,10 +28,13 @@ - this.chestBelow.rotationPointZ = 1.0F; - } - -+ /** -+ * This method renders out all parts of the chest model. -+ */ - public void renderAll() { - this.chestKnob.rotateAngleX = this.chestLid.rotateAngleX; -- this.chestLid.render(1.0F / 16.0F); -- this.chestKnob.render(1.0F / 16.0F); -- this.chestBelow.render(1.0F / 16.0F); -+ this.chestLid.render(0.0625F); -+ this.chestKnob.render(0.0625F); -+ this.chestBelow.render(0.0625F); - } - } ---- net/minecraft/src/RecipesArmorDyes.java -+++ net/minecraft/src/RecipesArmorDyes.java -@@ -2,23 +2,31 @@ - - import java.util.ArrayList; - -+import com.prupe.mcpatcher.cc.ColorizeEntity; -+ - public class RecipesArmorDyes implements IRecipe { -- public boolean matches(InventoryCrafting var1, World var2) { -+ -+ /** -+ * Used to check if a recipe matches current crafting inventory -+ */ -+ public boolean matches(InventoryCrafting par1InventoryCrafting, World par2World) { - ItemStack var3 = null; - ArrayList var4 = new ArrayList(); - -- for(int var5 = 0; var5 < var1.getSizeInventory(); ++var5) { -- ItemStack var6 = var1.getStackInSlot(var5); -- if(var6 != null) { -- if(var6.getItem() instanceof ItemArmor) { -+ for (int var5 = 0; var5 < par1InventoryCrafting.getSizeInventory(); ++var5) { -+ ItemStack var6 = par1InventoryCrafting.getStackInSlot(var5); -+ -+ if (var6 != null) { -+ if (var6.getItem() instanceof ItemArmor) { - ItemArmor var7 = (ItemArmor)var6.getItem(); -- if(var7.getArmorMaterial() != EnumArmorMaterial.CLOTH || var3 != null) { -+ -+ if (var7.getArmorMaterial() != EnumArmorMaterial.CLOTH || var3 != null) { - return false; - } - - var3 = var6; - } else { -- if(var6.itemID != Item.dyePowder.itemID) { -+ if (var6.itemID != Item.dyePowder.itemID) { - return false; - } - -@@ -30,30 +38,36 @@ - return var3 != null && !var4.isEmpty(); - } - -- public ItemStack getCraftingResult(InventoryCrafting var1) { -+ /** -+ * Returns an Item that is the result of this recipe -+ */ -+ public ItemStack getCraftingResult(InventoryCrafting par1InventoryCrafting) { - ItemStack var2 = null; - int[] var3 = new int[3]; - int var4 = 0; - int var5 = 0; - ItemArmor var6 = null; -- - int var7; - int var9; - float var10; - float var11; - int var17; -- for(var7 = 0; var7 < var1.getSizeInventory(); ++var7) { -- ItemStack var8 = var1.getStackInSlot(var7); -- if(var8 != null) { -- if(var8.getItem() instanceof ItemArmor) { -+ -+ for (var7 = 0; var7 < par1InventoryCrafting.getSizeInventory(); ++var7) { -+ ItemStack var8 = par1InventoryCrafting.getStackInSlot(var7); -+ -+ if (var8 != null) { -+ if (var8.getItem() instanceof ItemArmor) { - var6 = (ItemArmor)var8.getItem(); -- if(var6.getArmorMaterial() != EnumArmorMaterial.CLOTH || var2 != null) { -+ -+ if (var6.getArmorMaterial() != EnumArmorMaterial.CLOTH || var2 != null) { - return null; - } - - var2 = var8.copy(); - var2.stackSize = 1; -- if(var6.hasColor(var8)) { -+ -+ if (var6.hasColor(var8)) { - var9 = var6.getColor(var2); - var10 = (float)(var9 >> 16 & 255) / 255.0F; - var11 = (float)(var9 >> 8 & 255) / 255.0F; -@@ -65,24 +79,26 @@ - ++var5; - } - } else { -- if(var8.itemID != Item.dyePowder.itemID) { -+ if (var8.itemID != Item.dyePowder.itemID) { - return null; - } - -- float[] var14 = EntitySheep.fleeceColorTable[BlockColored.getBlockFromDye(var8.getItemDamage())]; -- int var15 = (int)(var14[0] * 255.0F); -- int var16 = (int)(var14[1] * 255.0F); -+ // MCPatcher Start -+ float[] var14 = ColorizeEntity.armorColors[BlockColored.getBlockFromDye(var8.getItemDamage())]; -+ // MCPatcher End -+ int var16 = (int)(var14[0] * 255.0F); -+ int var15 = (int)(var14[1] * 255.0F); - var17 = (int)(var14[2] * 255.0F); -- var4 += Math.max(var15, Math.max(var16, var17)); -- var3[0] += var15; -- var3[1] += var16; -+ var4 += Math.max(var16, Math.max(var15, var17)); -+ var3[0] += var16; -+ var3[1] += var15; - var3[2] += var17; - ++var5; - } - } - } - -- if(var6 == null) { -+ if (var6 == null) { - return null; - } else { - var7 = var3[0] / var5; -@@ -100,6 +116,9 @@ - } - } - -+ /** -+ * Returns the size of the recipe area -+ */ - public int getRecipeSize() { - return 10; - } ---- net/minecraft/src/EntityDragonPart.java -+++ net/minecraft/src/EntityDragonPart.java -@@ -1,34 +1,50 @@ - package net.minecraft.src; - - public class EntityDragonPart extends Entity { -+ -+ /** The dragon entity this dragon part belongs to */ - public final IEntityMultiPart entityDragonObj; -- public final String b; -- -- public EntityDragonPart(IEntityMultiPart var1, String var2, float var3, float var4) { -- super(var1.func_82194_d()); -- this.setSize(var3, var4); -- this.entityDragonObj = var1; -- this.b = var2; -- } -- -- protected void entityInit() { -- } -- -- protected void readEntityFromNBT(NBTTagCompound var1) { -- } -- -- protected void writeEntityToNBT(NBTTagCompound var1) { -- } -- -+ -+ /** The name of the Dragon Part */ -+ public final String name; -+ -+ public EntityDragonPart(IEntityMultiPart par1IEntityMultiPart, String par2Str, float par3, float par4) { -+ super(par1IEntityMultiPart.func_82194_d()); -+ this.setSize(par3, par4); -+ this.entityDragonObj = par1IEntityMultiPart; -+ this.name = par2Str; -+ } -+ -+ protected void entityInit() {} -+ -+ /** -+ * (abstract) Protected helper method to read subclass entity data from NBT. -+ */ -+ protected void readEntityFromNBT(NBTTagCompound par1NBTTagCompound) {} -+ -+ /** -+ * (abstract) Protected helper method to write subclass entity data to NBT. -+ */ -+ protected void writeEntityToNBT(NBTTagCompound par1NBTTagCompound) {} -+ -+ /** -+ * Returns true if other Entities should be prevented from moving through this Entity. -+ */ - public boolean canBeCollidedWith() { - return true; - } - -- public boolean attackEntityFrom(DamageSource var1, float var2) { -- return this.isEntityInvulnerable() ? false : this.entityDragonObj.attackEntityFromPart(this, var1, var2); -+ /** -+ * Called when the entity is attacked. -+ */ -+ public boolean attackEntityFrom(DamageSource par1DamageSource, float par2) { -+ return this.isEntityInvulnerable() ? false : this.entityDragonObj.attackEntityFromPart(this, par1DamageSource, par2); - } - -- public boolean isEntityEqual(Entity var1) { -- return this == var1 || this.entityDragonObj == var1; -+ /** -+ * Returns true if Entity argument is equal to this Entity -+ */ -+ public boolean isEntityEqual(Entity par1Entity) { -+ return this == par1Entity || this.entityDragonObj == par1Entity; - } - } ---- net/minecraft/src/GuiBeaconButtonConfirm.java -+++ net/minecraft/src/GuiBeaconButtonConfirm.java -@@ -1,14 +1,16 @@ - package net.minecraft.src; - - class GuiBeaconButtonConfirm extends GuiBeaconButton { -+ -+ /** Beacon GUI this button belongs to. */ - final GuiBeacon beaconGui; - -- public GuiBeaconButtonConfirm(GuiBeacon var1, int var2, int var3, int var4) { -- super(var2, var3, var4, GuiBeacon.getBeaconGuiTextures(), 90, 220); -- this.beaconGui = var1; -+ public GuiBeaconButtonConfirm(GuiBeacon par1GuiBeacon, int par2, int par3, int par4) { -+ super(par2, par3, par4, GuiBeacon.getBeaconGuiTextures(), 90, 220); -+ this.beaconGui = par1GuiBeacon; - } - -- public void func_82251_b(int var1, int var2) { -- this.beaconGui.drawCreativeTabHoveringText(I18n.getString("gui.done"), var1, var2); -+ public void func_82251_b(int par1, int par2) { -+ this.beaconGui.drawCreativeTabHoveringText(I18n.getString("gui.done"), par1, par2); - } - } ---- net/minecraft/src/Team.java -+++ net/minecraft/src/Team.java -@@ -1,8 +1,12 @@ - package net.minecraft.src; - - public abstract class Team { -- public boolean isSameTeam(Team var1) { -- return var1 == null ? false : this == var1; -+ -+ /** -+ * Same as == -+ */ -+ public boolean isSameTeam(Team par1Team) { -+ return par1Team == null ? false : this == par1Team; - } - - public abstract String func_96661_b(); ---- /dev/null -+++ org/spoutcraft/api/inventory/ShapedRecipe.java -@@ -1,0 +1,121 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.api.inventory; -+ -+import java.util.HashMap; -+ -+import org.spoutcraft.api.material.Material; -+ -+public class ShapedRecipe implements Recipe { -+ private ItemStack output; -+ private String[] rows; -+ private HashMap ingredients = new HashMap(); -+ -+ /** -+ * Create a shaped recipe to craft the specified ItemStack. The constructor merely determines the -+ * result and type; to set the actual recipe, you'll need to call the appropriate methods. -+ * @param result The item you want the recipe to create. -+ * @see ShapedRecipe#shape(String...) -+ * @see ShapedRecipe#setIngredient(char, Material) -+ * @see ShapedRecipe#setIngredient(char, Material, int) -+ * @see ShapedRecipe#setIngredient(char, MaterialData) -+ */ -+ public ShapedRecipe(ItemStack result) { -+ this.output = result; -+ } -+ -+ /** -+ * Set the shape of this recipe to the specified rows. Each character represents a different -+ * ingredient; exactly what each character represents is set separately. -+ * @param shape The rows of the recipe (up to 3 rows). -+ * @return The changed recipe, so you can chain calls. -+ */ -+ public ShapedRecipe shape(String... shape) { -+ if (shape == null || shape.length > 3 || shape.length < 1) { -+ throw new IllegalArgumentException("Crafting recipes should be 1, 2, or 3 rows."); -+ } -+ for (String row : shape) { -+ if (row == null || row.length() > 3 || row.length() < 1) { -+ throw new IllegalArgumentException("Crafting rows should be 1, 2, or 3 characters."); -+ } -+ } -+ this.rows = shape; -+ -+ // Remove character mappings for characters that no longer exist in the shape -+ HashMap ingredientsTemp = this.ingredients; -+ -+ this.ingredients = new HashMap(); -+ for (char key : ingredientsTemp.keySet()) { -+ try { -+ setIngredient(key, ingredientsTemp.get(key)); -+ } catch (IllegalArgumentException e) {} -+ } -+ return this; -+ } -+ -+ /** -+ * Sets the material that a character in the recipe shape refers to. -+ * @param key The character that represents the ingredient in the shape. -+ * @param ingredient The ingredient. -+ * @return The changed recipe, so you can chain calls. -+ */ -+ public ShapedRecipe setIngredient(char key, Material ingredient) { -+ if (!hasKey(key)) { -+ throw new IllegalArgumentException("Symbol " + key + " does not appear in the shape."); -+ } -+ ingredients.put(key, ingredient); -+ return this; -+ } -+ -+ private boolean hasKey(char c) { -+ String key = Character.toString(c); -+ -+ for (String row : rows) { -+ if (row.contains(key)) { -+ return true; -+ } -+ } -+ return false; -+ } -+ -+ /** -+ * Get the ingredients map. -+ * @return The mapping of character to ingredients. -+ */ -+ public HashMap getIngredientMap() { -+ return ingredients; -+ } -+ -+ /** -+ * Get the shape. -+ * @return The recipe's shape. -+ */ -+ public String[] getShape() { -+ return rows; -+ } -+ -+ /** -+ * Get the result. -+ * @return The result stack. -+ */ -+ public ItemStack getResult() { -+ return output; -+ } -+} ---- net/minecraft/src/RequestPost.java -+++ net/minecraft/src/RequestPost.java -@@ -5,23 +5,23 @@ - public class RequestPost extends Request { - private byte[] field_96373_c; - -- public RequestPost(String var1, byte[] var2, int var3, int var4) { -- super(var1, var3, var4); -- this.field_96373_c = var2; -+ public RequestPost(String par1Str, byte[] par2ArrayOfByte, int par3, int par4) { -+ super(par1Str, par3, par4); -+ this.field_96373_c = par2ArrayOfByte; - } - - public RequestPost func_96372_f() { - try { -- this.a.setDoInput(true); -- this.a.setDoOutput(true); -- this.a.setUseCaches(false); -- this.a.setRequestMethod("POST"); -- OutputStream var1 = this.a.getOutputStream(); -+ this.field_96367_a.setDoInput(true); -+ this.field_96367_a.setDoOutput(true); -+ this.field_96367_a.setUseCaches(false); -+ this.field_96367_a.setRequestMethod("POST"); -+ OutputStream var1 = this.field_96367_a.getOutputStream(); - var1.write(this.field_96373_c); - var1.flush(); - return this; - } catch (Exception var2) { -- throw new ExceptionMcoHttp("Failed URL: " + this.b, var2); -+ throw new ExceptionMcoHttp("Failed URL: " + this.field_96365_b, var2); - } - } - ---- net/minecraft/src/GuiDownloadTerrain.java -+++ net/minecraft/src/GuiDownloadTerrain.java -@@ -1,35 +1,50 @@ - package net.minecraft.src; - - public class GuiDownloadTerrain extends GuiScreen { -+ -+ /** Network object that downloads the terrain data. */ - private NetClientHandler netHandler; -+ -+ /** Counts the number of screen updates. */ - private int updateCounter; - -- public GuiDownloadTerrain(NetClientHandler var1) { -- this.netHandler = var1; -- } -- -- protected void keyTyped(char var1, int var2) { -- } -- -+ public GuiDownloadTerrain(NetClientHandler par1NetClientHandler) { -+ this.netHandler = par1NetClientHandler; -+ } -+ -+ /** -+ * Fired when a key is typed. This is the equivalent of KeyListener.keyTyped(KeyEvent e). -+ */ -+ protected void keyTyped(char par1, int par2) {} -+ -+ /** -+ * Adds the buttons (and other controls) to the screen in question. -+ */ - public void initGui() { -- this.i.clear(); -+ this.buttonList.clear(); - } - -+ /** -+ * Called from the main game loop to update the screen. -+ */ - public void updateScreen() { - ++this.updateCounter; -- if(this.updateCounter % 20 == 0) { -+ -+ if (this.updateCounter % 20 == 0) { - this.netHandler.addToSendQueue(new Packet0KeepAlive()); - } - -- if(this.netHandler != null) { -+ if (this.netHandler != null) { - this.netHandler.processReadPackets(); - } -- - } - -- public void drawScreen(int var1, int var2, float var3) { -+ /** -+ * Draws the screen and all the components in it. -+ */ -+ public void drawScreen(int par1, int par2, float par3) { - this.drawBackground(0); - this.drawCenteredString(this.fontRenderer, I18n.getString("multiplayer.downloadingTerrain"), this.width / 2, this.height / 2 - 50, 16777215); -- super.drawScreen(var1, var2, var3); -+ super.drawScreen(par1, par2, par3); - } - } ---- /dev/null -+++ org/spoutcraft/client/packet/PacketMusicChange.java -@@ -1,0 +1,75 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.client.packet; -+ -+import java.io.IOException; -+ -+import org.spoutcraft.api.io.SpoutInputStream; -+import org.spoutcraft.api.io.SpoutOutputStream; -+import org.spoutcraft.client.SpoutClient; -+ -+public class PacketMusicChange implements SpoutPacket { -+ protected int id; -+ protected int volumePercent; -+ boolean cancel = false; -+ -+ public PacketMusicChange() { -+ } -+ -+ public PacketMusicChange(int music, int volumePercent) { -+ this.id = music; -+ this.volumePercent = volumePercent; -+ } -+ -+ public boolean isCancelled() { -+ return cancel; -+ } -+ -+ public void readData(SpoutInputStream input) throws IOException { -+ id = input.readInt(); -+ volumePercent = input.readInt(); -+ cancel = input.readBoolean(); -+ } -+ -+ public void writeData(SpoutOutputStream output) throws IOException { -+ output.writeInt(id); -+ output.writeInt(volumePercent); -+ output.writeBoolean(cancel); -+ } -+ -+ public void run(int playerId) { -+ if (cancel) { -+ SpoutClient.getHandle().sndManager.cancelled = true; -+ } else { -+ SpoutClient.getHandle().sndManager.allowed = true; -+ } -+ } -+ -+ public PacketType getPacketType() { -+ return PacketType.PacketMusicChange; -+ } -+ -+ public int getVersion() { -+ return 0; -+ } -+ -+ public void failure(int playerId) { -+ } -+} ---- net/minecraft/src/BaseMetadataSectionSerializer.java -+++ net/minecraft/src/BaseMetadataSectionSerializer.java -@@ -4,92 +4,99 @@ - import com.google.gson.JsonParseException; - - public abstract class BaseMetadataSectionSerializer implements MetadataSectionSerializer { -- protected float func_110487_a(JsonElement var1, String var2, Float var3, float var4, float var5) { -- var2 = this.getSectionName() + "->" + var2; -- if(var1 == null) { -- if(var3 == null) { -- throw new JsonParseException("Missing " + var2 + ": expected float"); -- } else { -- return var3.floatValue(); -- } -- } else if(!var1.isJsonPrimitive()) { -- throw new JsonParseException("Invalid " + var2 + ": expected float, was " + var1); -- } else { -- try { -- float var6 = var1.getAsFloat(); -- if(var6 < var4) { -- throw new JsonParseException("Invalid " + var2 + ": expected float >= " + var4 + ", was " + var6); -- } else if(var6 > var5) { -- throw new JsonParseException("Invalid " + var2 + ": expected float <= " + var5 + ", was " + var6); -- } else { -- return var6; -- } -- } catch (NumberFormatException var7) { -- throw new JsonParseException("Invalid " + var2 + ": expected float, was " + var1, var7); -- } -- } -- } -- -- protected int func_110485_a(JsonElement var1, String var2, Integer var3, int var4, int var5) { -- var2 = this.getSectionName() + "->" + var2; -- if(var1 == null) { -- if(var3 == null) { -- throw new JsonParseException("Missing " + var2 + ": expected int"); -- } else { -- return var3.intValue(); -- } -- } else if(!var1.isJsonPrimitive()) { -- throw new JsonParseException("Invalid " + var2 + ": expected int, was " + var1); -- } else { -- try { -- int var6 = var1.getAsInt(); -- if(var6 < var4) { -- throw new JsonParseException("Invalid " + var2 + ": expected int >= " + var4 + ", was " + var6); -- } else if(var6 > var5) { -- throw new JsonParseException("Invalid " + var2 + ": expected int <= " + var5 + ", was " + var6); -- } else { -- return var6; -- } -- } catch (NumberFormatException var7) { -- throw new JsonParseException("Invalid " + var2 + ": expected int, was " + var1, var7); -- } -- } -- } -- -- protected String func_110486_a(JsonElement var1, String var2, String var3, int var4, int var5) { -- var2 = this.getSectionName() + "->" + var2; -- if(var1 == null) { -- if(var3 == null) { -- throw new JsonParseException("Missing " + var2 + ": expected string"); -- } else { -- return var3; -- } -- } else if(!var1.isJsonPrimitive()) { -- throw new JsonParseException("Invalid " + var2 + ": expected string, was " + var1); -- } else { -- String var6 = var1.getAsString(); -- if(var6.length() < var4) { -- throw new JsonParseException("Invalid " + var2 + ": expected string length >= " + var4 + ", was " + var6); -- } else if(var6.length() > var5) { -- throw new JsonParseException("Invalid " + var2 + ": expected string length <= " + var5 + ", was " + var6); -+ protected float func_110487_a(JsonElement par1JsonElement, String par2Str, Float par3, float par4, float par5) { -+ par2Str = this.getSectionName() + "->" + par2Str; -+ -+ if (par1JsonElement == null) { -+ if (par3 == null) { -+ throw new JsonParseException("Missing " + par2Str + ": expected float"); -+ } else { -+ return par3.floatValue(); -+ } -+ } else if (!par1JsonElement.isJsonPrimitive()) { -+ throw new JsonParseException("Invalid " + par2Str + ": expected float, was " + par1JsonElement); -+ } else { -+ try { -+ float var6 = par1JsonElement.getAsFloat(); -+ -+ if (var6 < par4) { -+ throw new JsonParseException("Invalid " + par2Str + ": expected float >= " + par4 + ", was " + var6); -+ } else if (var6 > par5) { -+ throw new JsonParseException("Invalid " + par2Str + ": expected float <= " + par5 + ", was " + var6); -+ } else { -+ return var6; -+ } -+ } catch (NumberFormatException var7) { -+ throw new JsonParseException("Invalid " + par2Str + ": expected float, was " + par1JsonElement, var7); -+ } -+ } -+ } -+ -+ protected int func_110485_a(JsonElement par1JsonElement, String par2Str, Integer par3, int par4, int par5) { -+ par2Str = this.getSectionName() + "->" + par2Str; -+ -+ if (par1JsonElement == null) { -+ if (par3 == null) { -+ throw new JsonParseException("Missing " + par2Str + ": expected int"); -+ } else { -+ return par3.intValue(); -+ } -+ } else if (!par1JsonElement.isJsonPrimitive()) { -+ throw new JsonParseException("Invalid " + par2Str + ": expected int, was " + par1JsonElement); -+ } else { -+ try { -+ int var6 = par1JsonElement.getAsInt(); -+ -+ if (var6 < par4) { -+ throw new JsonParseException("Invalid " + par2Str + ": expected int >= " + par4 + ", was " + var6); -+ } else if (var6 > par5) { -+ throw new JsonParseException("Invalid " + par2Str + ": expected int <= " + par5 + ", was " + var6); -+ } else { -+ return var6; -+ } -+ } catch (NumberFormatException var7) { -+ throw new JsonParseException("Invalid " + par2Str + ": expected int, was " + par1JsonElement, var7); -+ } -+ } -+ } -+ -+ protected String func_110486_a(JsonElement par1JsonElement, String par2Str, String par3Str, int par4, int par5) { -+ par2Str = this.getSectionName() + "->" + par2Str; -+ -+ if (par1JsonElement == null) { -+ if (par3Str == null) { -+ throw new JsonParseException("Missing " + par2Str + ": expected string"); -+ } else { -+ return par3Str; -+ } -+ } else if (!par1JsonElement.isJsonPrimitive()) { -+ throw new JsonParseException("Invalid " + par2Str + ": expected string, was " + par1JsonElement); -+ } else { -+ String var6 = par1JsonElement.getAsString(); -+ -+ if (var6.length() < par4) { -+ throw new JsonParseException("Invalid " + par2Str + ": expected string length >= " + par4 + ", was " + var6); -+ } else if (var6.length() > par5) { -+ throw new JsonParseException("Invalid " + par2Str + ": expected string length <= " + par5 + ", was " + var6); - } else { - return var6; - } - } - } - -- protected boolean func_110484_a(JsonElement var1, String var2, Boolean var3) { -- var2 = this.getSectionName() + "->" + var2; -- if(var1 == null) { -- if(var3 == null) { -- throw new JsonParseException("Missing " + var2 + ": expected boolean"); -+ protected boolean func_110484_a(JsonElement par1JsonElement, String par2Str, Boolean par3) { -+ par2Str = this.getSectionName() + "->" + par2Str; -+ -+ if (par1JsonElement == null) { -+ if (par3 == null) { -+ throw new JsonParseException("Missing " + par2Str + ": expected boolean"); - } else { -- return var3.booleanValue(); -+ return par3.booleanValue(); - } -- } else if(!var1.isJsonPrimitive()) { -- throw new JsonParseException("Invalid " + var2 + ": expected boolean, was " + var1); -+ } else if (!par1JsonElement.isJsonPrimitive()) { -+ throw new JsonParseException("Invalid " + par2Str + ": expected boolean, was " + par1JsonElement); - } else { -- boolean var4 = var1.getAsBoolean(); -+ boolean var4 = par1JsonElement.getAsBoolean(); - return var4; - } - } ---- /dev/null -+++ com/prupe/mcpatcher/Config.java -@@ -1,0 +1,264 @@ -+package com.prupe.mcpatcher; -+ -+import com.google.gson.JsonElement; -+import com.google.gson.JsonObject; -+import com.prupe.mcpatcher.Config$ModEntry; -+import com.prupe.mcpatcher.Config$ProfileEntry; -+import com.prupe.mcpatcher.Config$VersionEntry; -+import java.io.File; -+import java.util.Collection; -+import java.util.HashMap; -+import java.util.Iterator; -+import java.util.LinkedHashMap; -+import java.util.Map; -+import java.util.Map.Entry; -+import java.util.logging.Level; -+ -+public class Config { -+ private static Config instance = new Config(); -+ private static File jsonFile; -+ private static boolean readOnly; -+ public static final String MCPATCHER_PROPERTIES = "mcpatcher.properties"; -+ public static final String MCPATCHER_JSON = "mcpatcher.json"; -+ public static final String LAUNCHER_JSON = "launcher_profiles.json"; -+ public static final String VERSIONS_JSON = "versions.json"; -+ static final String TAG_MINECRAFT_VERSION = "minecraftVersion"; -+ static final String TAG_PATCHER_VERSION = "patcherVersion"; -+ static final String TAG_PRE_PATCH_STATE = "prePatchState"; -+ static final String TAG_MODIFIED_CLASSES = "modifiedClasses"; -+ static final String TAG_ADDED_CLASSES = "addedClasses"; -+ static final String VAL_BUILTIN = "builtIn"; -+ static final String VAL_EXTERNAL_ZIP = "externalZip"; -+ static final String VAL_EXTERNAL_JAR = "externalJar"; -+ private static final String TAG_SELECTED_PROFILE = "selectedProfile"; -+ public static final String MCPATCHER_PROFILE_NAME = "MCPatcher"; -+ private static final int VAL_FORMAT_CURRENT = 1; -+ private static final int VAL_FORMAT_MIN = 1; -+ private static final int VAL_FORMAT_MAX = 1; -+ transient String selectedProfile = "MCPatcher"; -+ int format = 1; -+ String patcherVersion; -+ boolean betaWarningShown; -+ boolean selectPatchedProfile = true; -+ boolean fetchRemoteVersionList = true; -+ boolean extraProfiling; -+ String lastModDirectory; -+ LinkedHashMap logging = new LinkedHashMap(); -+ LinkedHashMap profiles = new LinkedHashMap(); -+ -+ static boolean load(File minecraftDir, boolean isGame) { -+ jsonFile = new File(minecraftDir, "mcpatcher.json"); -+ instance = (Config)JsonUtils.parseJson(jsonFile, Config.class); -+ -+ if (instance != null && instance.format > 0) { -+ if (instance.format < 1) { -+ instance.format = 1; -+ save(); -+ } else if (instance.format > 1) { -+ setReadOnly(true); -+ } -+ } else { -+ instance = new Config(); -+ -+ if (isGame) { -+ // Spout Removed -+ //System.out.printf("WARNING: configuration file %s not found, using defaults\n", new Object[] {jsonFile}); -+ } -+ -+ save(); -+ } -+ // Spout Nullified because we don't use profiles. -+ //String profile = getSelectedLauncherProfile(minecraftDir); -+ String profile = null; -+ -+ if (MCPatcherUtils.isNullOrEmpty(profile)) { -+ if (isGame) { -+ // Spout Removed -+ //System.out.printf("WARNING: could not determine selected profile, defaulting to %s\n", new Object[] {"MCPatcher"}); -+ } -+ -+ profile = "MCPatcher"; -+ } else if (!instance.profiles.containsKey(profile) && isGame) { -+ // Spout Removed -+ //System.out.printf("WARNING: selected profile \'%s\' not found, using defaults\n", new Object[] {profile}); -+ } -+ -+ instance.selectedProfile = profile; -+ return true; -+ } -+ -+ static boolean save() { -+ boolean success = false; -+ -+ if (jsonFile != null && !readOnly) { -+ JsonUtils.writeJson((Object)instance, jsonFile); -+ } -+ -+ return success; -+ } -+ -+ private static String getSelectedLauncherProfile(File minecraftDir) { -+ File path = new File(minecraftDir, "launcher_profiles.json"); -+ JsonObject json = JsonUtils.parseJson(path); -+ -+ if (json != null) { -+ JsonElement element = json.get("selectedProfile"); -+ -+ if (element != null && element.isJsonPrimitive()) { -+ return element.getAsString(); -+ } -+ } -+ -+ return null; -+ } -+ -+ public static Config getInstance() { -+ return instance; -+ } -+ -+ public static void setReadOnly(boolean readOnly) { -+ readOnly = readOnly; -+ } -+ -+ static Level getLogLevel(String category) { -+ Level level = Level.INFO; -+ String value = (String)instance.logging.get(category); -+ -+ if (value != null) { -+ try { -+ level = Level.parse(value.trim().toUpperCase()); -+ } catch (Throwable var4) { -+ ; -+ } -+ } -+ -+ setLogLevel(category, level); -+ return level; -+ } -+ -+ static void setLogLevel(String category, Level level) { -+ instance.logging.put(category, level.toString().toUpperCase()); -+ } -+ -+ public static String getString(String mod, String tag, Object defaultValue) { -+ LinkedHashMap modConfig = instance.getModConfig(mod); -+ String value = (String)modConfig.get(tag); -+ -+ if (value == null) { -+ modConfig.put(tag, defaultValue.toString()); -+ return defaultValue.toString(); -+ } else { -+ return value; -+ } -+ } -+ -+ public static int getInt(String mod, String tag, int defaultValue) { -+ int value; -+ -+ try { -+ value = Integer.parseInt(getString(mod, tag, Integer.valueOf(defaultValue))); -+ } catch (NumberFormatException var5) { -+ value = defaultValue; -+ } -+ -+ return value; -+ } -+ -+ public static boolean getBoolean(String mod, String tag, boolean defaultValue) { -+ String value = getString(mod, tag, Boolean.valueOf(defaultValue)).toLowerCase(); -+ return value.equals("false") ? false : (value.equals("true") ? true : defaultValue); -+ } -+ -+ public static void set(String mod, String tag, Object value) { -+ if (value == null) { -+ remove(mod, tag); -+ } else { -+ instance.getModConfig(mod).put(tag, value.toString()); -+ } -+ } -+ -+ public static void remove(String mod, String tag) { -+ instance.getModConfig(mod).remove(tag); -+ } -+ -+ String getSelectedProfileName() { -+ if (MCPatcherUtils.isNullOrEmpty(this.selectedProfile)) { -+ this.selectedProfile = "MCPatcher"; -+ } -+ -+ return this.selectedProfile; -+ } -+ -+ Config$ProfileEntry getSelectedProfile() { -+ Config$ProfileEntry profile = (Config$ProfileEntry)this.profiles.get(this.getSelectedProfileName()); -+ -+ if (profile == null) { -+ profile = new Config$ProfileEntry(); -+ this.profiles.put(this.selectedProfile, profile); -+ } -+ -+ return profile; -+ } -+ -+ Config$VersionEntry getSelectedVersion() { -+ Config$ProfileEntry profile = this.getSelectedProfile(); -+ Config$VersionEntry version = (Config$VersionEntry)profile.versions.get(profile.version); -+ -+ if (version == null) { -+ version = new Config$VersionEntry(); -+ profile.versions.put(profile.version, version); -+ } -+ -+ return version; -+ } -+ -+ Config$ModEntry getModEntry(String mod) { -+ return (Config$ModEntry)this.getSelectedVersion().mods.get(mod); -+ } -+ -+ Collection getModEntries() { -+ return this.getSelectedVersion().mods.values(); -+ } -+ -+ private LinkedHashMap getModConfig(String mod) { -+ return Config$ProfileEntry.access$000(this.getSelectedProfile(), mod); -+ } -+ -+ void removeMod(String mod) { -+ this.getSelectedProfile().config.remove(mod); -+ this.getSelectedVersion().mods.remove(mod); -+ } -+ -+ void removeProfile(String name) { -+ if (!name.equals(this.selectedProfile)) { -+ this.profiles.remove(name); -+ } -+ } -+ -+ void removeVersion(String name) { -+ if (!name.equals(this.getSelectedProfile().version)) { -+ this.getSelectedProfile().versions.remove(name); -+ } -+ } -+ -+ Map getPatchedVersionMap() { -+ HashMap map = new HashMap(); -+ Iterator i$ = this.profiles.values().iterator(); -+ -+ while (i$.hasNext()) { -+ Config$ProfileEntry profile = (Config$ProfileEntry)i$.next(); -+ profile.versions.remove((Object)null); -+ profile.versions.remove(""); -+ Iterator i$1 = profile.versions.entrySet().iterator(); -+ -+ while (i$1.hasNext()) { -+ Entry entry = (Entry)i$1.next(); -+ String patchedVersion = (String)entry.getKey(); -+ String unpatchedVersion = ((Config$VersionEntry)entry.getValue()).original; -+ map.put(patchedVersion, unpatchedVersion); -+ } -+ } -+ -+ return map; -+ } -+} ---- /dev/null -+++ org/spoutcraft/client/packet/PacketEntityInformation.java -@@ -1,0 +1,155 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.client.packet; -+ -+import java.io.IOException; -+import java.nio.ByteBuffer; -+import java.util.List; -+import java.util.UUID; -+import java.util.zip.DataFormatException; -+import java.util.zip.Deflater; -+import java.util.zip.Inflater; -+ -+import org.apache.commons.io.output.ByteArrayOutputStream; -+ -+import net.minecraft.src.Minecraft; -+import net.minecraft.src.WorldClient; -+ -+import org.spoutcraft.api.io.SpoutInputStream; -+import org.spoutcraft.api.io.SpoutOutputStream; -+import org.spoutcraft.client.SpoutClient; -+import org.spoutcraft.client.entity.CraftEntity; -+ -+public class PacketEntityInformation implements CompressablePacket { -+ private boolean compressed = false; -+ private byte[] data = null; -+ -+ public PacketEntityInformation() { -+ } -+ -+ public PacketEntityInformation(List entities) { -+ ByteBuffer tempbuffer = ByteBuffer.allocate(entities.size() * 4); -+ for (CraftEntity e : entities) { -+ tempbuffer.putInt(e.getEntityId()); -+ } -+ data = tempbuffer.array(); -+ } -+ -+ public void readData(SpoutInputStream input) throws IOException { -+ int size = input.readInt(); -+ if (size > 0) { -+ data = new byte[size]; -+ input.read(data); -+ } -+ compressed = input.readBoolean(); -+ } -+ -+ public void writeData(SpoutOutputStream output) throws IOException { -+ if (data != null) { -+ output.writeInt(data.length); -+ output.write(data); -+ } else { -+ output.writeInt(0); -+ } -+ output.writeBoolean(compressed); -+ } -+ -+ public void run(int playerId) { -+ if (Minecraft.getMinecraft().theWorld instanceof WorldClient) { -+ ByteBuffer rawData = ByteBuffer.allocate(data.length); -+ rawData.put(data); -+ for (int i = 0; i < data.length / 20; i++) { -+ int index = i * 20; -+ long lsb = rawData.getLong(index); -+ long msb = rawData.getLong(index + 8); -+ int id = rawData.getInt(index + 16); -+ -+ net.minecraft.src.Entity e = SpoutClient.getInstance().getEntityFromId(id); -+ if (e != null) { -+ e.uniqueId = new UUID(msb, lsb); -+ } -+ } -+ } -+ } -+ -+ public void failure(int playerId) { -+ } -+ -+ public PacketType getPacketType() { -+ return PacketType.PacketEntityInformation; -+ } -+ -+ public int getVersion() { -+ return 0; -+ } -+ -+ public void compress() { -+ if (!compressed) { -+ if (data != null) { -+ Deflater deflater = new Deflater(); -+ deflater.setInput(data); -+ deflater.setLevel(Deflater.BEST_COMPRESSION); -+ deflater.finish(); -+ ByteArrayOutputStream bos = new ByteArrayOutputStream(data.length); -+ byte[] buffer = new byte[1024]; -+ while (!deflater.finished()) -+ { -+ int bytesCompressed = deflater.deflate(buffer); -+ bos.write(buffer, 0, bytesCompressed); -+ } -+ try { -+ bos.close(); -+ } catch (IOException e) { -+ e.printStackTrace(); -+ } -+ data = bos.toByteArray(); -+ } -+ compressed = true; -+ } -+ } -+ -+ public void decompress() { -+ if (compressed) { -+ Inflater decompressor = new Inflater(); -+ decompressor.setInput(data); -+ -+ ByteArrayOutputStream bos = new ByteArrayOutputStream(data.length); -+ -+ byte[] buf = new byte[1024]; -+ while (!decompressor.finished()) { -+ try { -+ int count = decompressor.inflate(buf); -+ bos.write(buf, 0, count); -+ } catch (DataFormatException e) { -+ } -+ } -+ try { -+ bos.close(); -+ } catch (IOException e) { -+ } -+ -+ data = bos.toByteArray(); -+ } -+ } -+ -+ public boolean isCompressed() { -+ return compressed; -+ } -+} ---- net/minecraft/src/BaseAttribute.java -+++ net/minecraft/src/BaseAttribute.java -@@ -1,20 +1,21 @@ - package net.minecraft.src; - - public abstract class BaseAttribute implements Attribute { -- private final String a; -+ private final String field_111115_a; - private final double defaultValue; - private boolean shouldWatch; - -- protected BaseAttribute(String var1, double var2) { -- this.a = var1; -- this.defaultValue = var2; -- if(var1 == null) { -+ protected BaseAttribute(String par1Str, double par2) { -+ this.field_111115_a = par1Str; -+ this.defaultValue = par2; -+ -+ if (par1Str == null) { - throw new IllegalArgumentException("Name cannot be null!"); - } - } - - public String getAttributeUnlocalizedName() { -- return this.a; -+ return this.field_111115_a; - } - - public double getDefaultValue() { -@@ -25,12 +26,12 @@ - return this.shouldWatch; - } - -- public BaseAttribute setShouldWatch(boolean var1) { -- this.shouldWatch = var1; -+ public BaseAttribute setShouldWatch(boolean par1) { -+ this.shouldWatch = par1; - return this; - } - - public int hashCode() { -- return this.a.hashCode(); -+ return this.field_111115_a.hashCode(); - } - } ---- net/minecraft/src/TileEntitySignRenderer.java -+++ net/minecraft/src/TileEntitySignRenderer.java -@@ -1,71 +1,105 @@ - package net.minecraft.src; - -+import net.minecraft.src.Minecraft; -+ - import org.lwjgl.opengl.GL11; -+import org.spoutcraft.client.config.Configuration; - - public class TileEntitySignRenderer extends TileEntitySpecialRenderer { -- private static final ResourceLocation field_110638_a = new ResourceLocation("textures/entity/sign.png"); -+ -+ /** The ModelSign instance used by the TileEntitySignRenderer */ - private final ModelSign modelSign = new ModelSign(); - -- public void renderTileEntitySignAt(TileEntitySign var1, double var2, double var4, double var6, float var8) { -- Block var9 = var1.getBlockType(); -+ public void renderTileEntitySignAt(TileEntitySign par1TileEntitySign, double par2, double par4, double par6, float par8) { -+ Block var9 = par1TileEntitySign.getBlockType(); - GL11.glPushMatrix(); -- float var10 = 2.0F / 3.0F; -+ float var10 = 0.6666667F; - float var12; -- if(var9 == Block.signPost) { -- GL11.glTranslatef((float)var2 + 0.5F, (float)var4 + 12.0F / 16.0F * var10, (float)var6 + 0.5F); -- float var11 = (float)(var1.getBlockMetadata() * 360) / 16.0F; -+ -+ if (var9 == Block.signPost) { -+ GL11.glTranslatef((float)par2 + 0.5F, (float)par4 + 0.75F * var10, (float)par6 + 0.5F); -+ float var11 = (float)(par1TileEntitySign.getBlockMetadata() * 360) / 16.0F; - GL11.glRotatef(-var11, 0.0F, 1.0F, 0.0F); - this.modelSign.signStick.showModel = true; - } else { -- int var16 = var1.getBlockMetadata(); -+ int var16 = par1TileEntitySign.getBlockMetadata(); - var12 = 0.0F; -- if(var16 == 2) { -+ -+ if (var16 == 2) { - var12 = 180.0F; - } - -- if(var16 == 4) { -+ if (var16 == 4) { - var12 = 90.0F; - } - -- if(var16 == 5) { -+ if (var16 == 5) { - var12 = -90.0F; - } - -- GL11.glTranslatef((float)var2 + 0.5F, (float)var4 + 12.0F / 16.0F * var10, (float)var6 + 0.5F); -+ GL11.glTranslatef((float)par2 + 0.5F, (float)par4 + 0.75F * var10, (float)par6 + 0.5F); - GL11.glRotatef(-var12, 0.0F, 1.0F, 0.0F); -- GL11.glTranslatef(0.0F, -(5.0F / 16.0F), -(7.0F / 16.0F)); -+ GL11.glTranslatef(0.0F, -0.3125F, -0.4375F); - this.modelSign.signStick.showModel = false; - } - -- this.bindTexture(field_110638_a); -+ Minecraft.getMinecraft().getTextureManager().bindTexture(new ResourceLocation("textures/entity/sign.png")); - GL11.glPushMatrix(); - GL11.glScalef(var10, -var10, -var10); - this.modelSign.renderSign(); - GL11.glPopMatrix(); -- FontRenderer var17 = this.getFontRenderer(); -- var12 = (float)(1.0D / 60.0D) * var10; -- GL11.glTranslatef(0.0F, 0.5F * var10, 0.07F * var10); -- GL11.glScalef(var12, -var12, var12); -- GL11.glNormal3f(0.0F, 0.0F, -1.0F * var12); -- GL11.glDepthMask(false); -- byte var13 = 0; -- -- for(int var14 = 0; var14 < var1.a.length; ++var14) { -- String var15 = var1.a[var14]; -- if(var14 == var1.lineBeingEdited) { -- var15 = "> " + var15 + " <"; -- var17.drawString(var15, -var17.getStringWidth(var15) / 2, var14 * 10 - var1.a.length * 5, var13); -- } else { -- var17.drawString(var15, -var17.getStringWidth(var15) / 2, var14 * 10 - var1.a.length * 5, var13); -+ // Spout Start -+ if (par1TileEntitySign.hasText()) { -+ EntityLivingBase viewer = Minecraft.getMinecraft().renderViewEntity; -+ if (viewer == null) { -+ viewer = Minecraft.getMinecraft().thePlayer; -+ } -+ if (Configuration.signDistance == Integer.MAX_VALUE || viewer != null && par1TileEntitySign.getDistanceFrom(viewer.posX, viewer.posY, viewer.posZ) < (Configuration.signDistance * Configuration.signDistance)) { -+ // Spout End -+ FontRenderer var17 = this.getFontRenderer(); -+ var12 = 0.016666668F * var10; -+ GL11.glTranslatef(0.0F, 0.5F * var10, 0.07F * var10); -+ GL11.glScalef(var12, -var12, var12); -+ GL11.glNormal3f(0.0F, 0.0F, -1.0F * var12); -+ GL11.glDepthMask(false); -+ // Spout Start -+ GL11.glEnable(GL11.GL_BLEND); -+ GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); -+ byte var13 = 0; -+ // Spout End -+ -+ for (int var14 = 0; var14 < par1TileEntitySign.signText.length; ++var14) { -+ String var15 = par1TileEntitySign.signText[var14]; -+ -+ if (var14 == par1TileEntitySign.lineBeingEdited) { -+ // Spout Start -+ int endColumnStart = Math.min(par1TileEntitySign.columnBeingEdited, var15.length()); -+ String before = ""; -+ if (endColumnStart > 0) { -+ before = var15.substring(0, endColumnStart); -+ } -+ String after = ""; -+ if (var15.length() - par1TileEntitySign.columnBeingEdited > 0) { -+ after = var15.substring(par1TileEntitySign.columnBeingEdited, var15.length()); -+ } -+ var15 = before + "_" + after; -+ // Spout End -+ var17.drawString(var15, -var17.getStringWidth(var15) / 2, var14 * 10 - par1TileEntitySign.signText.length * 5, var13); -+ } else { -+ var17.drawString(var15, -var17.getStringWidth(var15) / 2, var14 * 10 - par1TileEntitySign.signText.length * 5, var13); -+ } -+ } -+ -+ GL11.glDepthMask(true); -+ GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); -+ // Spout Start - } - } -- -- GL11.glDepthMask(true); -- GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); -+ // Spout End - GL11.glPopMatrix(); - } - -- public void renderTileEntityAt(TileEntity var1, double var2, double var4, double var6, float var8) { -- this.renderTileEntitySignAt((TileEntitySign)var1, var2, var4, var6, var8); -+ public void renderTileEntityAt(TileEntity par1TileEntity, double par2, double par4, double par6, float par8) { -+ this.renderTileEntitySignAt((TileEntitySign)par1TileEntity, par2, par4, par6, par8); - } - } ---- net/minecraft/src/CommandHandler.java -+++ net/minecraft/src/CommandHandler.java -@@ -10,122 +10,134 @@ - import java.util.Map.Entry; - - public class CommandHandler implements ICommandManager { -- private final Map a = new HashMap(); -- private final Set b = new HashSet(); -- -- public int executeCommand(ICommandSender var1, String var2) { -- var2 = var2.trim(); -- if(var2.startsWith("/")) { -- var2 = var2.substring(1); -+ -+ /** Map of Strings to the ICommand objects they represent */ -+ private final Map commandMap = new HashMap(); -+ -+ /** The set of ICommand objects currently loaded. */ -+ private final Set commandSet = new HashSet(); -+ -+ public int executeCommand(ICommandSender par1ICommandSender, String par2Str) { -+ par2Str = par2Str.trim(); -+ -+ if (par2Str.startsWith("/")) { -+ par2Str = par2Str.substring(1); - } - -- String[] var3 = var2.split(" "); -+ String[] var3 = par2Str.split(" "); - String var4 = var3[0]; - var3 = dropFirstString(var3); -- ICommand var5 = (ICommand)this.a.get(var4); -+ ICommand var5 = (ICommand)this.commandMap.get(var4); - int var6 = this.getUsernameIndex(var5, var3); - int var7 = 0; - - try { -- if(var5 == null) { -+ if (var5 == null) { - throw new CommandNotFoundException(); - } - -- if(var5.canCommandSenderUseCommand(var1)) { -- if(var6 > -1) { -- EntityPlayerMP[] var8 = PlayerSelector.matchPlayers(var1, var3[var6]); -+ if (var5.canCommandSenderUseCommand(par1ICommandSender)) { -+ if (var6 > -1) { -+ EntityPlayerMP[] var8 = PlayerSelector.matchPlayers(par1ICommandSender, var3[var6]); - String var9 = var3[var6]; - EntityPlayerMP[] var10 = var8; - int var11 = var8.length; - -- for(int var12 = 0; var12 < var11; ++var12) { -+ for (int var12 = 0; var12 < var11; ++var12) { - EntityPlayerMP var13 = var10[var12]; - var3[var6] = var13.getEntityName(); - - try { -- var5.processCommand(var1, var3); -+ var5.processCommand(par1ICommandSender, var3); - ++var7; - } catch (CommandException var15) { -- var1.sendChatToPlayer(ChatMessageComponent.createFromTranslationWithSubstitutions(var15.getMessage(), var15.getErrorOjbects()).setColor(EnumChatFormatting.RED)); -+ par1ICommandSender.sendChatToPlayer(ChatMessageComponent.createFromTranslationWithSubstitutions(var15.getMessage(), var15.getErrorOjbects()).setColor(EnumChatFormatting.RED)); - } - } - - var3[var6] = var9; - } else { -- var5.processCommand(var1, var3); -+ var5.processCommand(par1ICommandSender, var3); - ++var7; - } - } else { -- var1.sendChatToPlayer(ChatMessageComponent.createFromTranslationKey("commands.generic.permission").setColor(EnumChatFormatting.RED)); -+ par1ICommandSender.sendChatToPlayer(ChatMessageComponent.createFromTranslationKey("commands.generic.permission").setColor(EnumChatFormatting.RED)); - } - } catch (WrongUsageException var16) { -- var1.sendChatToPlayer(ChatMessageComponent.createFromTranslationWithSubstitutions("commands.generic.usage", new Object[]{ChatMessageComponent.createFromTranslationWithSubstitutions(var16.getMessage(), var16.getErrorOjbects())}).setColor(EnumChatFormatting.RED)); -+ par1ICommandSender.sendChatToPlayer(ChatMessageComponent.createFromTranslationWithSubstitutions("commands.generic.usage", new Object[] {ChatMessageComponent.createFromTranslationWithSubstitutions(var16.getMessage(), var16.getErrorOjbects())}).setColor(EnumChatFormatting.RED)); - } catch (CommandException var17) { -- var1.sendChatToPlayer(ChatMessageComponent.createFromTranslationWithSubstitutions(var17.getMessage(), var17.getErrorOjbects()).setColor(EnumChatFormatting.RED)); -+ par1ICommandSender.sendChatToPlayer(ChatMessageComponent.createFromTranslationWithSubstitutions(var17.getMessage(), var17.getErrorOjbects()).setColor(EnumChatFormatting.RED)); - } catch (Throwable var18) { -- var1.sendChatToPlayer(ChatMessageComponent.createFromTranslationKey("commands.generic.exception").setColor(EnumChatFormatting.RED)); -+ par1ICommandSender.sendChatToPlayer(ChatMessageComponent.createFromTranslationKey("commands.generic.exception").setColor(EnumChatFormatting.RED)); - var18.printStackTrace(); - } - - return var7; - } - -- public ICommand registerCommand(ICommand var1) { -- List var2 = var1.getCommandAliases(); -- this.a.put(var1.getCommandName(), var1); -- this.b.add(var1); -- if(var2 != null) { -+ /** -+ * adds the command and any aliases it has to the internal map of available commands -+ */ -+ public ICommand registerCommand(ICommand par1ICommand) { -+ List var2 = par1ICommand.getCommandAliases(); -+ this.commandMap.put(par1ICommand.getCommandName(), par1ICommand); -+ this.commandSet.add(par1ICommand); -+ -+ if (var2 != null) { - Iterator var3 = var2.iterator(); - -- while(true) { -- String var4; -- ICommand var5; -- do { -- if(!var3.hasNext()) { -- return var1; -- } -- -- var4 = (String)var3.next(); -- var5 = (ICommand)this.a.get(var4); -- } while(var5 != null && var5.getCommandName().equals(var4)); -- -- this.a.put(var4, var1); -+ while (var3.hasNext()) { -+ String var4 = (String)var3.next(); -+ ICommand var5 = (ICommand)this.commandMap.get(var4); -+ -+ if (var5 == null || !var5.getCommandName().equals(var4)) { -+ this.commandMap.put(var4, par1ICommand); -+ } - } -- } else { -- return var1; - } -+ -+ return par1ICommand; - } - -- private static String[] dropFirstString(String[] var0) { -- String[] var1 = new String[var0.length - 1]; -+ /** -+ * creates a new array and sets elements 0..n-2 to be 0..n-1 of the input (n elements) -+ */ -+ private static String[] dropFirstString(String[] par0ArrayOfStr) { -+ String[] var1 = new String[par0ArrayOfStr.length - 1]; - -- for(int var2 = 1; var2 < var0.length; ++var2) { -- var1[var2 - 1] = var0[var2]; -+ for (int var2 = 1; var2 < par0ArrayOfStr.length; ++var2) { -+ var1[var2 - 1] = par0ArrayOfStr[var2]; - } - - return var1; - } - -- public List getPossibleCommands(ICommandSender var1, String var2) { -- String[] var3 = var2.split(" ", -1); -+ /** -+ * Performs a "begins with" string match on each token in par2. Only returns commands that par1 can use. -+ */ -+ public List getPossibleCommands(ICommandSender par1ICommandSender, String par2Str) { -+ String[] var3 = par2Str.split(" ", -1); - String var4 = var3[0]; -- if(var3.length == 1) { -+ -+ if (var3.length == 1) { - ArrayList var8 = new ArrayList(); -- Iterator var6 = this.a.entrySet().iterator(); -+ Iterator var6 = this.commandMap.entrySet().iterator(); - -- while(var6.hasNext()) { -+ while (var6.hasNext()) { - Entry var7 = (Entry)var6.next(); -- if(CommandBase.doesStringStartWith(var4, (String)var7.getKey()) && ((ICommand)var7.getValue()).canCommandSenderUseCommand(var1)) { -+ -+ if (CommandBase.doesStringStartWith(var4, (String)var7.getKey()) && ((ICommand)var7.getValue()).canCommandSenderUseCommand(par1ICommandSender)) { - var8.add(var7.getKey()); - } - } - - return var8; - } else { -- if(var3.length > 1) { -- ICommand var5 = (ICommand)this.a.get(var4); -- if(var5 != null) { -- return var5.addTabCompletionOptions(var1, dropFirstString(var3)); -+ if (var3.length > 1) { -+ ICommand var5 = (ICommand)this.commandMap.get(var4); -+ -+ if (var5 != null) { -+ return var5.addTabCompletionOptions(par1ICommandSender, dropFirstString(var3)); - } - } - -@@ -133,13 +145,17 @@ - } - } - -- public List getPossibleCommands(ICommandSender var1) { -+ /** -+ * returns all commands that the commandSender can use -+ */ -+ public List getPossibleCommands(ICommandSender par1ICommandSender) { - ArrayList var2 = new ArrayList(); -- Iterator var3 = this.b.iterator(); -+ Iterator var3 = this.commandSet.iterator(); - -- while(var3.hasNext()) { -+ while (var3.hasNext()) { - ICommand var4 = (ICommand)var3.next(); -- if(var4.canCommandSenderUseCommand(var1)) { -+ -+ if (var4.canCommandSenderUseCommand(par1ICommandSender)) { - var2.add(var4); - } - } -@@ -147,16 +163,22 @@ - return var2; - } - -+ /** -+ * returns a map of string to commads. All commands are returned, not just ones which someone has permission to use. -+ */ - public Map getCommands() { -- return this.a; -+ return this.commandMap; - } - -- private int getUsernameIndex(ICommand var1, String[] var2) { -- if(var1 == null) { -+ /** -+ * Return a command's first parameter index containing a valid username. -+ */ -+ private int getUsernameIndex(ICommand par1ICommand, String[] par2ArrayOfStr) { -+ if (par1ICommand == null) { - return -1; - } else { -- for(int var3 = 0; var3 < var2.length; ++var3) { -- if(var1.isUsernameIndex(var2, var3) && PlayerSelector.matchesMultiplePlayers(var2[var3])) { -+ for (int var3 = 0; var3 < par2ArrayOfStr.length; ++var3) { -+ if (par1ICommand.isUsernameIndex(par2ArrayOfStr, var3) && PlayerSelector.matchesMultiplePlayers(par2ArrayOfStr[var3])) { - return var3; - } - } ---- /dev/null -+++ org/spoutcraft/api/gui/TextProcessor.java -@@ -1,0 +1,126 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.api.gui; -+ -+import java.util.Iterator; -+ -+import org.spoutcraft.api.UnsafeClass; -+ -+@UnsafeClass -+public interface TextProcessor extends Iterable { -+ /** -+ * Gets the text handled by this processor -+ * -+ * @return text -+ */ -+ public String getText(); -+ -+ /** -+ * Sets the text handled by this processor -+ * -+ * @param str new text -+ */ -+ public void setText(String str); -+ -+ /** -+ * Returns the text seperated in lines -+ * -+ * @return string iterator holding the lines -+ */ -+ public Iterator iterator(); -+ -+ /** -+ * Gets the position of the cursor. Position zero is the start of the text. -+ * -+ * @return position -+ */ -+ public int getCursor(); -+ -+ /** -+ * Sets the position of the cursor -+ * -+ * @param position to set to -+ * @return textfield -+ */ -+ public void setCursor(int cursor); -+ -+ /** -+ * Gets a two dimensional cursor [y, x] where y is the line number and x the position of the cursor in this line -+ * -+ * @return 2D cursor -+ */ -+ public int[] getCursor2D(); -+ -+ /** -+ * Gets the maximum characters -+ * -+ * @return maximum characters -+ */ -+ public int getMaximumCharacters(); -+ -+ /** -+ * Sets the maximum characters -+ * -+ * @param max maximum characters -+ */ -+ public void setMaximumCharacters(int max); -+ -+ /** -+ * Gets the maximum lines -+ * -+ * @return maximum lines -+ */ -+ public int getMaximumLines(); -+ -+ /** -+ * Sets the maximum lines -+ * -+ * @param max maximum lines -+ */ -+ public void setMaximumLines(int max); -+ -+ /** -+ * Gets the width -+ * -+ * @return width -+ */ -+ public int getWidth(); -+ -+ /** -+ * Sets the width -+ * -+ * @param width -+ */ -+ public void setWidth(int width); -+ -+ /** -+ * Clears the contents -+ */ -+ public void clear(); -+ -+ /** -+ * Handles the keyboard input -+ * -+ * @param key the key's char representation -+ * @param keyId the key's Id -+ * @return dirty (i.e. has the content changed / would a call of getText() return a different String than before?) -+ */ -+ public boolean handleInput(char key, int keyId); -+} ---- net/minecraft/src/CommandServerSay.java -+++ net/minecraft/src/CommandServerSay.java -@@ -8,24 +8,30 @@ - return "say"; - } - -+ /** -+ * Return the required permission level for this command. -+ */ - public int getRequiredPermissionLevel() { - return 1; - } - -- public String getCommandUsage(ICommandSender var1) { -+ public String getCommandUsage(ICommandSender par1ICommandSender) { - return "commands.say.usage"; - } - -- public void processCommand(ICommandSender var1, String[] var2) { -- if(var2.length > 0 && var2[0].length() > 0) { -- String var3 = func_82361_a(var1, var2, 0, true); -- MinecraftServer.getServer().getConfigurationManager().sendChatMsg(ChatMessageComponent.createFromTranslationWithSubstitutions("chat.type.announcement", new Object[]{var1.getCommandSenderName(), var3})); -+ public void processCommand(ICommandSender par1ICommandSender, String[] par2ArrayOfStr) { -+ if (par2ArrayOfStr.length > 0 && par2ArrayOfStr[0].length() > 0) { -+ String var3 = func_82361_a(par1ICommandSender, par2ArrayOfStr, 0, true); -+ MinecraftServer.getServer().getConfigurationManager().sendChatMsg(ChatMessageComponent.createFromTranslationWithSubstitutions("chat.type.announcement", new Object[] {par1ICommandSender.getCommandSenderName(), var3})); - } else { - throw new WrongUsageException("commands.say.usage", new Object[0]); - } - } - -- public List addTabCompletionOptions(ICommandSender var1, String[] var2) { -- return var2.length >= 1 ? getListOfStringsMatchingLastWord(var2, MinecraftServer.getServer().getAllUsernames()) : null; -+ /** -+ * Adds the strings available in this command to the given list of tab completion options. -+ */ -+ public List addTabCompletionOptions(ICommandSender par1ICommandSender, String[] par2ArrayOfStr) { -+ return par2ArrayOfStr.length >= 1 ? getListOfStringsMatchingLastWord(par2ArrayOfStr, MinecraftServer.getServer().getAllUsernames()) : null; - } - } ---- net/minecraft/src/EntityIronGolem.java -+++ net/minecraft/src/EntityIronGolem.java -@@ -1,13 +1,15 @@ - package net.minecraft.src; - - public class EntityIronGolem extends EntityGolem { -+ -+ /** deincrements, and a distance-to-home check is done at 0 */ - private int homeCheckTimer; - Village villageObj; - private int attackTimer; - private int holdRoseTick; - -- public EntityIronGolem(World var1) { -- super(var1); -+ public EntityIronGolem(World par1World) { -+ super(par1World); - this.setSize(1.4F, 2.9F); - this.getNavigator().setAvoidsWater(true); - this.tasks.addTask(1, new EntityAIAttackOnCollide(this, 1.0D, true)); -@@ -28,15 +30,22 @@ - this.dataWatcher.addObject(16, Byte.valueOf((byte)0)); - } - -+ /** -+ * Returns true if the newer Entity AI code should be run -+ */ - public boolean isAIEnabled() { - return true; - } - -+ /** -+ * main AI tick function, replaces updateEntityActionState -+ */ - protected void updateAITick() { -- if(--this.homeCheckTimer <= 0) { -- this.homeCheckTimer = 70 + this.ab.nextInt(50); -+ if (--this.homeCheckTimer <= 0) { -+ this.homeCheckTimer = 70 + this.rand.nextInt(50); - this.villageObj = this.worldObj.villageCollectionObj.findNearestVillage(MathHelper.floor_double(this.posX), MathHelper.floor_double(this.posY), MathHelper.floor_double(this.posZ), 32); -- if(this.villageObj == null) { -+ -+ if (this.villageObj == null) { - this.detachHome(); - } else { - ChunkCoordinates var1 = this.villageObj.getCenter(); -@@ -53,76 +62,93 @@ - this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setAttribute(0.25D); - } - -- protected int decreaseAirSupply(int var1) { -- return var1; -+ /** -+ * Decrements the entity's air supply when underwater -+ */ -+ protected int decreaseAirSupply(int par1) { -+ return par1; - } - -- protected void collideWithEntity(Entity var1) { -- if(var1 instanceof IMob && this.getRNG().nextInt(20) == 0) { -- this.setAttackTarget((EntityLivingBase)var1); -+ protected void collideWithEntity(Entity par1Entity) { -+ if (par1Entity instanceof IMob && this.getRNG().nextInt(20) == 0) { -+ this.setAttackTarget((EntityLivingBase)par1Entity); - } - -- super.collideWithEntity(var1); -+ super.collideWithEntity(par1Entity); - } - -+ /** -+ * Called frequently so the entity can update its state every tick as required. For example, zombies and skeletons use -+ * this to react to sunlight and start to burn. -+ */ - public void onLivingUpdate() { - super.onLivingUpdate(); -- if(this.attackTimer > 0) { -+ -+ if (this.attackTimer > 0) { - --this.attackTimer; - } - -- if(this.holdRoseTick > 0) { -+ if (this.holdRoseTick > 0) { - --this.holdRoseTick; - } - -- if(this.motionX * this.motionX + this.motionZ * this.motionZ > (double)2.5000003E-7F && this.ab.nextInt(5) == 0) { -+ if (this.motionX * this.motionX + this.motionZ * this.motionZ > 2.500000277905201E-7D && this.rand.nextInt(5) == 0) { - int var1 = MathHelper.floor_double(this.posX); -- int var2 = MathHelper.floor_double(this.posY - (double)0.2F - (double)this.yOffset); -+ int var2 = MathHelper.floor_double(this.posY - 0.20000000298023224D - (double)this.yOffset); - int var3 = MathHelper.floor_double(this.posZ); - int var4 = this.worldObj.getBlockId(var1, var2, var3); -- if(var4 > 0) { -- this.worldObj.spawnParticle("tilecrack_" + var4 + "_" + this.worldObj.getBlockMetadata(var1, var2, var3), this.posX + ((double)this.ab.nextFloat() - 0.5D) * (double)this.width, this.boundingBox.minY + 0.1D, this.posZ + ((double)this.ab.nextFloat() - 0.5D) * (double)this.width, 4.0D * ((double)this.ab.nextFloat() - 0.5D), 0.5D, ((double)this.ab.nextFloat() - 0.5D) * 4.0D); -+ -+ if (var4 > 0) { -+ this.worldObj.spawnParticle("tilecrack_" + var4 + "_" + this.worldObj.getBlockMetadata(var1, var2, var3), this.posX + ((double)this.rand.nextFloat() - 0.5D) * (double)this.width, this.boundingBox.minY + 0.1D, this.posZ + ((double)this.rand.nextFloat() - 0.5D) * (double)this.width, 4.0D * ((double)this.rand.nextFloat() - 0.5D), 0.5D, ((double)this.rand.nextFloat() - 0.5D) * 4.0D); - } - } -- -- } -- -- public boolean canAttackClass(Class var1) { -- return this.isPlayerCreated() && EntityPlayer.class.isAssignableFrom(var1) ? false : super.canAttackClass(var1); -- } -- -- public void writeEntityToNBT(NBTTagCompound var1) { -- super.writeEntityToNBT(var1); -- var1.setBoolean("PlayerCreated", this.isPlayerCreated()); -- } -- -- public void readEntityFromNBT(NBTTagCompound var1) { -- super.readEntityFromNBT(var1); -- this.setPlayerCreated(var1.getBoolean("PlayerCreated")); -- } -- -- public boolean attackEntityAsMob(Entity var1) { -+ } -+ -+ /** -+ * Returns true if this entity can attack entities of the specified class. -+ */ -+ public boolean canAttackClass(Class par1Class) { -+ return this.isPlayerCreated() && EntityPlayer.class.isAssignableFrom(par1Class) ? false : super.canAttackClass(par1Class); -+ } -+ -+ /** -+ * (abstract) Protected helper method to write subclass entity data to NBT. -+ */ -+ public void writeEntityToNBT(NBTTagCompound par1NBTTagCompound) { -+ super.writeEntityToNBT(par1NBTTagCompound); -+ par1NBTTagCompound.setBoolean("PlayerCreated", this.isPlayerCreated()); -+ } -+ -+ /** -+ * (abstract) Protected helper method to read subclass entity data from NBT. -+ */ -+ public void readEntityFromNBT(NBTTagCompound par1NBTTagCompound) { -+ super.readEntityFromNBT(par1NBTTagCompound); -+ this.setPlayerCreated(par1NBTTagCompound.getBoolean("PlayerCreated")); -+ } -+ -+ public boolean attackEntityAsMob(Entity par1Entity) { - this.attackTimer = 10; - this.worldObj.setEntityState(this, (byte)4); -- boolean var2 = var1.attackEntityFrom(DamageSource.causeMobDamage(this), (float)(7 + this.ab.nextInt(15))); -- if(var2) { -- var1.motionY += (double)0.4F; -+ boolean var2 = par1Entity.attackEntityFrom(DamageSource.causeMobDamage(this), (float)(7 + this.rand.nextInt(15))); -+ -+ if (var2) { -+ par1Entity.motionY += 0.4000000059604645D; - } - - this.playSound("mob.irongolem.throw", 1.0F, 1.0F); - return var2; - } - -- public void handleHealthUpdate(byte var1) { -- if(var1 == 4) { -+ public void handleHealthUpdate(byte par1) { -+ if (par1 == 4) { - this.attackTimer = 10; - this.playSound("mob.irongolem.throw", 1.0F, 1.0F); -- } else if(var1 == 11) { -+ } else if (par1 == 11) { - this.holdRoseTick = 400; - } else { -- super.handleHealthUpdate(var1); -+ super.handleHealthUpdate(par1); - } -- - } - - public Village getVillage() { -@@ -133,41 +159,56 @@ - return this.attackTimer; - } - -- public void setHoldingRose(boolean var1) { -- this.holdRoseTick = var1 ? 400 : 0; -+ public void setHoldingRose(boolean par1) { -+ this.holdRoseTick = par1 ? 400 : 0; - this.worldObj.setEntityState(this, (byte)11); - } - -+ /** -+ * Returns the sound this mob makes while it's alive. -+ */ - protected String getLivingSound() { - return "none"; - } - -+ /** -+ * Returns the sound this mob makes when it is hurt. -+ */ - protected String getHurtSound() { - return "mob.irongolem.hit"; - } - -+ /** -+ * Returns the sound this mob makes on death. -+ */ - protected String getDeathSound() { - return "mob.irongolem.death"; - } - -- protected void playStepSound(int var1, int var2, int var3, int var4) { -+ /** -+ * Plays step sound at given x, y, z for the entity -+ */ -+ protected void playStepSound(int par1, int par2, int par3, int par4) { - this.playSound("mob.irongolem.walk", 1.0F, 1.0F); - } - -- protected void dropFewItems(boolean var1, int var2) { -- int var3 = this.ab.nextInt(3); -- -+ /** -+ * Drop 0-2 items of this living's type. @param par1 - Whether this entity has recently been hit by a player. @param -+ * par2 - Level of Looting used to kill this mob. -+ */ -+ protected void dropFewItems(boolean par1, int par2) { -+ int var3 = this.rand.nextInt(3); - int var4; -- for(var4 = 0; var4 < var3; ++var4) { -+ -+ for (var4 = 0; var4 < var3; ++var4) { - this.dropItem(Block.plantRed.blockID, 1); - } - -- var4 = 3 + this.ab.nextInt(3); -+ var4 = 3 + this.rand.nextInt(3); - -- for(int var5 = 0; var5 < var4; ++var5) { -+ for (int var5 = 0; var5 < var4; ++var5) { - this.dropItem(Item.ingotIron.itemID, 1); - } -- - } - - public int getHoldRoseTick() { -@@ -178,21 +219,24 @@ - return (this.dataWatcher.getWatchableObjectByte(16) & 1) != 0; - } - -- public void setPlayerCreated(boolean var1) { -+ public void setPlayerCreated(boolean par1) { - byte var2 = this.dataWatcher.getWatchableObjectByte(16); -- if(var1) { -+ -+ if (par1) { - this.dataWatcher.updateObject(16, Byte.valueOf((byte)(var2 | 1))); - } else { - this.dataWatcher.updateObject(16, Byte.valueOf((byte)(var2 & -2))); - } -- - } - -- public void onDeath(DamageSource var1) { -- if(!this.isPlayerCreated() && this.attackingPlayer != null && this.villageObj != null) { -+ /** -+ * Called when the mob's health reaches 0. -+ */ -+ public void onDeath(DamageSource par1DamageSource) { -+ if (!this.isPlayerCreated() && this.attackingPlayer != null && this.villageObj != null) { - this.villageObj.setReputationForPlayer(this.attackingPlayer.getCommandSenderName(), -5); - } - -- super.onDeath(var1); -+ super.onDeath(par1DamageSource); - } - } ---- /dev/null -+++ org/spoutcraft/client/gui/about/TableSection.java -@@ -1,0 +1,117 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.client.gui.about; -+ -+import java.util.LinkedHashMap; -+import java.util.LinkedList; -+import java.util.List; -+import java.util.Map.Entry; -+ -+import org.spoutcraft.api.Spoutcraft; -+import org.spoutcraft.api.gui.Color; -+import org.spoutcraft.api.gui.GenericLabel; -+import org.spoutcraft.api.gui.Widget; -+ -+public class TableSection extends Section { -+ private int maxCaption = 0; -+ private int height = 0; -+ protected class Row { -+ public GenericLabel caption = new GenericLabel("aasdasd"); -+ public GenericLabel text = new GenericLabel("basdasd"); -+ public Row() { -+ caption.setTextColor(new Color(0xaaaaaa)); -+ caption.setWidth(20); -+ caption.setWrapLines(true); -+ text.setTextColor(new Color(0xaaaaaa)); -+ text.setWidth(20); -+ text.setWrapLines(true); -+ } -+ } -+ -+ private LinkedList rows = new LinkedList(); -+ -+ @Override -+ public void setX(int x) { -+ super.setX(x); -+ update(); -+ } -+ -+ @Override -+ public void setY(int y) { -+ super.setY(y); -+ update(); -+ } -+ -+ @Override -+ public int getHeight() { -+ return super.getHeight() + height + 5; -+ } -+ -+ @Override -+ public void update() { -+ super.update(); -+ int y = super.getHeight() + 5 + getY(); -+ int left = getX(); -+ int right = left + maxCaption + 5; -+ int textRightWidth = getWidth() - right + left; -+ int textLeftWidth = right - left; -+ if (right - left > getWidth() || right - left <= 30) { -+ textRightWidth = textLeftWidth = getWidth() / 2 - 5; -+ right = left + textLeftWidth + 5; -+ } -+ height = 0; -+ for (Row row:rows) { -+ row.caption.setX(left); -+ row.caption.setY(y); -+ row.caption.setWidth(textLeftWidth); -+ row.caption.recalculateLines(); -+ row.text.setX(right); -+ row.text.setY(y); -+ row.text.setWidth(textRightWidth); -+ row.text.recalculateLines(); -+ int h = (int) Math.max(row.text.getHeight(), row.caption.getHeight()) + 2; -+ y += h; -+ height += h; -+ } -+ } -+ -+ @Override -+ public List getWidgets() { -+ List ret = super.getWidgets(); -+ for (Row row:rows) { -+ ret.add(row.caption); -+ ret.add(row.text); -+ } -+ return ret; -+ } -+ -+ @Override -+ public void init(GuiNewAbout screen, String title, Object yaml) { -+ setTitle(title); -+ LinkedHashMap r = (LinkedHashMap) yaml; -+ for (Entry entry:r.entrySet()) { -+ Row row = new Row(); -+ row.caption.setText(entry.getKey()); -+ maxCaption = Math.max(maxCaption, Spoutcraft.getRenderDelegate().getMinecraftFont().getTextWidth(row.caption.getText())); -+ row.text.setText(entry.getValue()); -+ rows.add(row); -+ } -+ } -+} ---- net/minecraft/src/ModelLeashKnot.java -+++ net/minecraft/src/ModelLeashKnot.java -@@ -7,22 +7,30 @@ - this(0, 0, 32, 32); - } - -- public ModelLeashKnot(int var1, int var2, int var3, int var4) { -- this.textureWidth = var3; -- this.textureHeight = var4; -- this.field_110723_a = new ModelRenderer(this, var1, var2); -+ public ModelLeashKnot(int par1, int par2, int par3, int par4) { -+ this.textureWidth = par3; -+ this.textureHeight = par4; -+ this.field_110723_a = new ModelRenderer(this, par1, par2); - this.field_110723_a.addBox(-3.0F, -6.0F, -3.0F, 6, 8, 6, 0.0F); - this.field_110723_a.setRotationPoint(0.0F, 0.0F, 0.0F); - } - -- public void render(Entity var1, float var2, float var3, float var4, float var5, float var6, float var7) { -- this.setRotationAngles(var2, var3, var4, var5, var6, var7, var1); -- this.field_110723_a.render(var7); -+ /** -+ * Sets the models various rotation angles then renders the model. -+ */ -+ public void render(Entity par1Entity, float par2, float par3, float par4, float par5, float par6, float par7) { -+ this.setRotationAngles(par2, par3, par4, par5, par6, par7, par1Entity); -+ this.field_110723_a.render(par7); - } - -- public void setRotationAngles(float var1, float var2, float var3, float var4, float var5, float var6, Entity var7) { -- super.setRotationAngles(var1, var2, var3, var4, var5, var6, var7); -- this.field_110723_a.rotateAngleY = var4 / (180.0F / (float)Math.PI); -- this.field_110723_a.rotateAngleX = var5 / (180.0F / (float)Math.PI); -+ /** -+ * Sets the model's various rotation angles. For bipeds, par1 and par2 are used for animating the movement of arms and -+ * legs, where par1 represents the time(so that arms and legs swing back and forth) and par2 represents how "far" arms -+ * and legs can swing at most. -+ */ -+ public void setRotationAngles(float par1, float par2, float par3, float par4, float par5, float par6, Entity par7Entity) { -+ super.setRotationAngles(par1, par2, par3, par4, par5, par6, par7Entity); -+ this.field_110723_a.rotateAngleY = par4 / (180F / (float)Math.PI); -+ this.field_110723_a.rotateAngleX = par5 / (180F / (float)Math.PI); - } - } ---- net/minecraft/src/SlotFurnace.java -+++ net/minecraft/src/SlotFurnace.java -@@ -1,54 +1,72 @@ - package net.minecraft.src; - - public class SlotFurnace extends Slot { -+ -+ /** The player that is using the GUI where this slot resides. */ - private EntityPlayer thePlayer; - private int field_75228_b; - -- public SlotFurnace(EntityPlayer var1, IInventory var2, int var3, int var4, int var5) { -- super(var2, var3, var4, var5); -- this.thePlayer = var1; -+ public SlotFurnace(EntityPlayer par1EntityPlayer, IInventory par2IInventory, int par3, int par4, int par5) { -+ super(par2IInventory, par3, par4, par5); -+ this.thePlayer = par1EntityPlayer; - } - -- public boolean isItemValid(ItemStack var1) { -+ /** -+ * Check if the stack is a valid item for this slot. Always true beside for the armor slots. -+ */ -+ public boolean isItemValid(ItemStack par1ItemStack) { - return false; - } - -- public ItemStack decrStackSize(int var1) { -- if(this.getHasStack()) { -- this.field_75228_b += Math.min(var1, this.getStack().stackSize); -+ /** -+ * Decrease the size of the stack in slot (first int arg) by the amount of the second int arg. Returns the new stack. -+ */ -+ public ItemStack decrStackSize(int par1) { -+ if (this.getHasStack()) { -+ this.field_75228_b += Math.min(par1, this.getStack().stackSize); - } - -- return super.decrStackSize(var1); -- } -- -- public void onPickupFromSlot(EntityPlayer var1, ItemStack var2) { -- this.onCrafting(var2); -- super.onPickupFromSlot(var1, var2); -- } -- -- protected void onCrafting(ItemStack var1, int var2) { -- this.field_75228_b += var2; -- this.onCrafting(var1); -- } -- -- protected void onCrafting(ItemStack var1) { -- var1.onCrafting(this.thePlayer.worldObj, this.thePlayer, this.field_75228_b); -- if(!this.thePlayer.worldObj.isRemote) { -+ return super.decrStackSize(par1); -+ } -+ -+ public void onPickupFromSlot(EntityPlayer par1EntityPlayer, ItemStack par2ItemStack) { -+ this.onCrafting(par2ItemStack); -+ super.onPickupFromSlot(par1EntityPlayer, par2ItemStack); -+ } -+ -+ /** -+ * the itemStack passed in is the output - ie, iron ingots, and pickaxes, not ore and wood. Typically increases an -+ * internal count then calls onCrafting(item). -+ */ -+ protected void onCrafting(ItemStack par1ItemStack, int par2) { -+ this.field_75228_b += par2; -+ this.onCrafting(par1ItemStack); -+ } -+ -+ /** -+ * the itemStack passed in is the output - ie, iron ingots, and pickaxes, not ore and wood. -+ */ -+ protected void onCrafting(ItemStack par1ItemStack) { -+ par1ItemStack.onCrafting(this.thePlayer.worldObj, this.thePlayer, this.field_75228_b); -+ -+ if (!this.thePlayer.worldObj.isRemote) { - int var2 = this.field_75228_b; -- float var3 = FurnaceRecipes.smelting().getExperience(var1.itemID); -+ float var3 = FurnaceRecipes.smelting().getExperience(par1ItemStack.itemID); - int var4; -- if(var3 == 0.0F) { -+ -+ if (var3 == 0.0F) { - var2 = 0; -- } else if(var3 < 1.0F) { -+ } else if (var3 < 1.0F) { - var4 = MathHelper.floor_float((float)var2 * var3); -- if(var4 < MathHelper.ceiling_float_int((float)var2 * var3) && (float)Math.random() < (float)var2 * var3 - (float)var4) { -+ -+ if (var4 < MathHelper.ceiling_float_int((float)var2 * var3) && (float)Math.random() < (float)var2 * var3 - (float)var4) { - ++var4; - } - - var2 = var4; - } - -- while(var2 > 0) { -+ while (var2 > 0) { - var4 = EntityXPOrb.getXPSplit(var2); - var2 -= var4; - this.thePlayer.worldObj.spawnEntityInWorld(new EntityXPOrb(this.thePlayer.worldObj, this.thePlayer.posX, this.thePlayer.posY + 0.5D, this.thePlayer.posZ + 0.5D, var4)); -@@ -56,13 +74,13 @@ - } - - this.field_75228_b = 0; -- if(var1.itemID == Item.ingotIron.itemID) { -+ -+ if (par1ItemStack.itemID == Item.ingotIron.itemID) { - this.thePlayer.addStat(AchievementList.acquireIron, 1); - } - -- if(var1.itemID == Item.fishCooked.itemID) { -+ if (par1ItemStack.itemID == Item.fishCooked.itemID) { - this.thePlayer.addStat(AchievementList.cookFish, 1); - } -- - } - } ---- /dev/null -+++ org/spoutcraft/api/gui/GenericContainer.java -@@ -1,0 +1,461 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.api.gui; -+ -+import java.util.ArrayList; -+import java.util.Arrays; -+import java.util.Collections; -+import java.util.List; -+ -+import org.spoutcraft.api.UnsafeClass; -+ -+@UnsafeClass -+public class GenericContainer extends GenericWidget implements Container { -+ protected List children = new ArrayList(); -+ protected ContainerType type = ContainerType.VERTICAL; -+ protected WidgetAnchor align = WidgetAnchor.TOP_LEFT; -+ protected boolean reverse = false; -+ protected int minWidthCalc = 0, maxWidthCalc = 427, minHeightCalc = 0, maxHeightCalc = 240; -+ protected boolean auto = true; -+ protected boolean recalculating = false; -+ protected boolean needsLayout = true; -+ -+ public GenericContainer() { -+ } -+ -+ public GenericContainer(Widget... children) { -+ // Shortcuts because we don't have any of the insertChild values setup yet -+ this.children.addAll(Arrays.asList(children)); -+ for (Widget child : children) { -+ child.setContainer(this); -+ } -+ updateSize(); -+ } -+ -+ public Container addChild(Widget child) { -+ return insertChild(-1, child); -+ } -+ -+ public Container insertChild(int index, Widget child) { -+ if (index < 0 || index > this.children.size()) { -+ this.children.add(child); -+ } else { -+ this.children.add(index, child); -+ } -+ child.setContainer(this); -+ child.savePos(); -+ child.shiftXPos(super.getX()); -+ child.shiftYPos(super.getY()); -+ child.setAnchor(super.getAnchor()); -+ // Relay out if we are already using layout - otherwise this will return immediately -+ if (getScreen() != null) { -+ String addon = child.getAddon(); -+ getScreen().attachWidget(addon, child); -+ } -+ updateSize(); -+ deferLayout(); -+ return this; -+ } -+ -+ public Container addChildren(Widget... children) { -+ for (Widget child : children) { -+ this.insertChild(-1, child); -+ } -+ return this; -+ } -+ -+ public Widget[] getChildren() { -+ Widget[] list = new Widget[children.size()]; -+ children.toArray(list); -+ return list; -+ } -+ -+ @Override -+ public Container setVisible(boolean enable) { -+ super.setVisible(enable); -+ for (Widget widget : children) { -+ widget.setVisible(enable); -+ } -+ return this; -+ } -+ -+ @Override -+ public Container setPriority(RenderPriority priority) { -+ super.setPriority(priority); -+ for (Widget widget : children) { -+ widget.setPriority(priority); -+ } -+ return this; -+ } -+ -+ @Override -+ public Container setAnchor(WidgetAnchor anchor) { -+ super.setAnchor(anchor); -+ for (Widget widget : children) { -+ widget.setAnchor(anchor); -+ } -+ return this; -+ } -+ -+ public WidgetType getType() { -+ return WidgetType.Container; -+ } -+ -+ @Override -+ public Widget setX(int pos) { -+ int delta = pos - super.getX(); -+ super.setX(pos); -+ for (Widget widget : children) { -+ widget.shiftXPos(delta); -+ } -+ return this; -+ } -+ -+ @Override -+ public Widget setY(int pos) { -+ int delta = pos - super.getY(); -+ super.setY(pos); -+ for (Widget widget : children) { -+ widget.shiftYPos(delta); -+ } -+ return this; -+ } -+ -+ public Container removeChild(Widget child) { -+ children.remove(child); -+ child.setContainer(null); -+ child.restorePos(); -+ if (this.screen != null) { -+ this.screen.removeWidget(child); -+ } -+ updateSize(); -+ deferLayout(); -+ return this; -+ } -+ -+ @Override -+ public Container setScreen(Screen screen) { -+ for (Widget child : children) { -+ if (screen != null) { -+ screen.attachWidget(getAddon(), child); -+ } else if (this.screen != null) { -+ this.screen.removeWidget(child); -+ } -+ } -+ super.setScreen(screen); -+ return this; -+ } -+ -+ @Override -+ public Container setHeight(int height) { -+ if (super.getHeight() != height) { -+ super.setHeight(height); -+ this.deferLayout(); -+ } -+ return this; -+ } -+ -+ @Override -+ public Container setWidth(int width) { -+ if (super.getWidth() != width) { -+ super.setWidth(width); -+ this.deferLayout(); -+ } -+ return this; -+ } -+ -+ public Container setLayout(ContainerType type) { -+ if (this.type != type) { -+ this.type = type; -+ deferLayout(); -+ } -+ return this; -+ } -+ -+ public ContainerType getLayout() { -+ return type; -+ } -+ -+ public Container setAlign(WidgetAnchor align) { -+ if (this.align != align) { -+ this.align = align; -+ deferLayout(); -+ } -+ return this; -+ } -+ -+ public WidgetAnchor getAlign() { -+ return align; -+ } -+ -+ public Container setReverse(boolean reverse) { -+ if (this.reverse != reverse) { -+ this.reverse = reverse; -+ deferLayout(); -+ } -+ return this; -+ } -+ -+ public boolean getReverse() { -+ return reverse; -+ } -+ -+ public Container deferLayout() { -+ needsLayout = true; -+ return this; -+ } -+ -+ public Container updateLayout() { -+ if (!recalculating && super.getWidth() > 0 && super.getHeight() > 0 && !children.isEmpty()) { -+ recalculating = true; // Prevent us from getting into a loop -+ List visibleChildren = new ArrayList(); -+ int totalwidth = 0, totalheight = 0, newwidth, newheight, vcount = 0, hcount = 0; -+ int availableWidth = (int) (auto ? getWidth() : getMinWidth()), availableHeight = (int) (auto ? getHeight() : getMinHeight()); -+ // We only layout visible children, invisible ones have zero physical presence on screen -+ for (Widget widget : children) { -+ if (widget.isVisible()) { -+ visibleChildren.add(widget); -+ } -+ } -+ // Reverse drawing order if we need to -+ if (reverse) { -+ Collections.reverse(visibleChildren); -+ } -+ // First - get the total space by fixed widgets and borders -+ if (type == ContainerType.OVERLAY) { -+ newwidth = availableWidth; -+ newheight = availableHeight; -+ } else { -+ for (Widget widget : visibleChildren) { -+ int horiz = widget.getMarginLeft() + widget.getMarginRight(); -+ int vert = widget.getMarginTop() + widget.getMarginBottom(); -+ if (widget.isFixed()) { -+ horiz += widget.getWidth(); -+ vert += widget.getHeight(); -+ } -+ if (type == ContainerType.VERTICAL) { -+ totalheight += vert; -+ if (!widget.isFixed()) { -+ vcount++; -+ } -+ } else if (type == ContainerType.HORIZONTAL) { -+ totalwidth += horiz; -+ if (!widget.isFixed()) { -+ hcount++; -+ } -+ } -+ } -+ // Work out the width and height for children -+ newwidth = (availableWidth - totalwidth) / Math.max(1, hcount); -+ newheight = (availableHeight - totalheight) / Math.max(1, vcount); -+ // Deal with minWidth and minHeight - change newwidth/newheight if needed -+ for (Widget widget : visibleChildren) { -+ if (!widget.isFixed()) { -+ if (type == ContainerType.VERTICAL) { -+ if (widget.getMinHeight() > newheight) { -+ totalheight += widget.getMinHeight() - newheight; -+ newheight = (availableHeight - totalheight) / Math.max(1, vcount); -+ } else if (newheight >= widget.getMaxHeight()) { -+ totalheight += widget.getMaxHeight(); -+ vcount--; -+ newheight = (availableHeight - totalheight) / Math.max(1, vcount); -+ } -+ } else if (type == ContainerType.HORIZONTAL) { -+ if (widget.getMinWidth() > newwidth) { -+ totalwidth += widget.getMinWidth() - newwidth; -+ newwidth = (availableWidth - totalwidth) / Math.max(1, hcount); -+ } else if (newwidth >= widget.getMaxWidth()) { -+ totalwidth += widget.getMaxWidth(); -+ hcount--; -+ newwidth = (availableWidth - totalwidth) / Math.max(1, hcount); -+ } -+ } -+ } -+ } -+ newheight = Math.max(newheight, 0); -+ newwidth = Math.max(newwidth, 0); -+ } -+ totalheight = totalwidth = 0; -+ // Resize any non-fixed widgets -+ for (Widget widget : visibleChildren) { -+ if (!widget.isFixed()) { -+ int realheight, realwidth; -+ if (auto) { -+ realheight = Math.max(widget.getMinHeight(), Math.min(newheight - widget.getMarginTop() - widget.getMarginBottom(), widget.getMaxHeight())); -+ realwidth = Math.max(widget.getMinWidth(), Math.min(newwidth - widget.getMarginLeft() - widget.getMarginRight(), widget.getMaxWidth())); -+ } else { -+ realheight = widget.getMinHeight() == 0 ? newheight - widget.getMarginTop() - widget.getMarginBottom() : widget.getMinHeight(); -+ realwidth = widget.getMinWidth() == 0 ? newwidth - widget.getMarginLeft() - widget.getMarginRight() : widget.getMinWidth(); -+ } -+ if (widget.getHeight() != realheight || widget.getWidth() != realwidth) { -+ widget.setHeight(realheight).setWidth(realwidth); -+ } -+ } -+ if (type == ContainerType.VERTICAL) { -+ totalheight += widget.getHeight() + widget.getMarginTop() + widget.getMarginBottom(); -+ } else { -+ totalheight = (int) Math.max(totalheight, widget.getHeight() + widget.getMarginTop() + widget.getMarginBottom()); -+ } -+ if (type == ContainerType.HORIZONTAL) { -+ totalwidth += widget.getWidth() + widget.getMarginLeft() + widget.getMarginRight(); -+ } else { -+ totalwidth = (int) Math.max(totalwidth, widget.getWidth() + widget.getMarginLeft() + widget.getMarginRight()); -+ } -+ } -+ // Work out the new top-left position taking into account Align -+ int left = super.getX(); -+ int top = super.getY(); -+ if (align == WidgetAnchor.TOP_CENTER || align == WidgetAnchor.CENTER_CENTER || align == WidgetAnchor.BOTTOM_CENTER) { -+ left += (super.getWidth() - totalwidth) / 2; -+ } else if (align == WidgetAnchor.TOP_RIGHT || align == WidgetAnchor.CENTER_RIGHT || align == WidgetAnchor.BOTTOM_RIGHT) { -+ left += super.getWidth() - totalwidth; -+ } -+ if (align == WidgetAnchor.CENTER_LEFT || align == WidgetAnchor.CENTER_CENTER || align == WidgetAnchor.CENTER_RIGHT) { -+ top += (super.getHeight() - totalheight) / 2; -+ } else if (align == WidgetAnchor.BOTTOM_LEFT || align == WidgetAnchor.BOTTOM_CENTER || align == WidgetAnchor.BOTTOM_RIGHT) { -+ top += super.getHeight() - totalheight; -+ } -+ // Move all children into the correct position -+ for (Widget widget : visibleChildren) { -+ int realtop = top + widget.getMarginTop(); -+ int realleft = left + widget.getMarginLeft(); -+ if (widget.getY() != realtop || widget.getX() != realleft) { -+ widget.setY(realtop).setX(realleft); -+ } -+ if (type == ContainerType.VERTICAL) { -+ top += widget.getHeight() + widget.getMarginTop() + widget.getMarginBottom(); -+ } else if (type == ContainerType.HORIZONTAL) { -+ left += widget.getWidth() + widget.getMarginLeft() + widget.getMarginRight(); -+ } -+ } -+ recalculating = false; -+ } -+ needsLayout = false; -+ return this; -+ } -+ -+ @Override -+ public void onTick() { -+ if (needsLayout) { -+ updateLayout(); -+ } -+ } -+ -+ @Override -+ public int getMinWidth() { -+ return Math.max(super.getMinWidth(), minWidthCalc); -+ } -+ -+ @Override -+ public int getMaxWidth() { -+ return Math.min(super.getMaxWidth(), maxWidthCalc); -+ } -+ -+ @Override -+ public int getMinHeight() { -+ return Math.max(super.getMinHeight(), minHeightCalc); -+ } -+ -+ @Override -+ public int getMaxHeight() { -+ return Math.min(super.getMaxHeight(), maxHeightCalc); -+ } -+ -+ @Override -+ public Container updateSize() { -+ if (!recalculating && !isFixed()) { -+ recalculating = true; // Prevent us from getting into a loop due to both trickle down and push up -+ int minwidth = 0, maxwidth = 0, minheight = 0, maxheight = 0, minhoriz, maxhoriz, minvert, maxvert; -+ // Work out the minimum and maximum dimensions for the contents of this container -+ for (Widget widget : children) { -+ if (widget.isVisible()) { -+ if (widget instanceof Container) { // Trickle down to children -+ ((Container) widget).updateSize(); -+ } -+ minhoriz = maxhoriz = widget.getMarginLeft() + widget.getMarginRight(); -+ minvert = maxvert = widget.getMarginTop() + widget.getMarginBottom(); -+ if (widget.isFixed()) { -+ minhoriz += widget.getWidth(); -+ maxhoriz += widget.getWidth(); -+ minvert += widget.getHeight(); -+ maxvert += widget.getHeight(); -+ } else { -+ minhoriz += widget.getMinWidth(); -+ maxhoriz += widget.getMaxWidth(); -+ minvert += widget.getMinHeight(); -+ maxvert += widget.getMaxHeight(); -+ } -+ if (type == ContainerType.HORIZONTAL) { -+ minwidth += minhoriz; -+ maxwidth += maxhoriz; -+ } else { -+ minwidth = Math.max(minwidth, minhoriz); -+ if (type == ContainerType.OVERLAY) { -+ maxwidth = Math.max(maxwidth, maxhoriz); -+ } else { -+ maxwidth = Math.min(maxwidth, maxhoriz); -+ } -+ } -+ if (type == ContainerType.VERTICAL) { -+ minheight += minvert; -+ maxheight += maxvert; -+ } else { -+ minheight = Math.max(minheight, minvert); -+ if (type == ContainerType.OVERLAY) { -+ maxheight = Math.max(maxheight, maxvert); -+ } else { -+ maxheight = Math.min(maxheight, maxvert); -+ } -+ } -+ } -+ } -+ minwidth = Math.min(minwidth, 427); -+ maxwidth = Math.min(maxwidth == 0 ? 427 : maxwidth, 427); -+ minheight = Math.min(minheight, 240); -+ maxheight = Math.min(maxheight == 0 ? 240 : maxheight, 240); -+ // Check if the dimensions have changed -+ if (minwidth != minWidthCalc || maxwidth != maxWidthCalc || minheight != minHeightCalc || maxheight != maxHeightCalc) { -+ minWidthCalc = minwidth; -+ maxWidthCalc = maxwidth; -+ minHeightCalc = minheight; -+ maxHeightCalc = maxheight; -+ deferLayout(); -+ if (hasContainer()) { // Push up to parents -+ getContainer().updateSize(); -+ getContainer().deferLayout(); -+ } -+ } -+ recalculating = false; -+ } -+ return this; -+ } -+ -+ public Container setAuto(boolean auto) { -+ this.auto = auto; -+ return this; -+ } -+ -+ public boolean isAuto() { -+ return auto; -+ } -+ -+ public void render() { -+ } -+} ---- net/minecraft/src/WorldProvider.java -+++ net/minecraft/src/WorldProvider.java -@@ -1,62 +1,102 @@ - package net.minecraft.src; - -+// MCPatcher Start -+import com.prupe.mcpatcher.cc.ColorizeWorld; -+import com.prupe.mcpatcher.cc.Colorizer; -+// MCPatcher End -+ - public abstract class WorldProvider { -- public static final float[] moonPhaseFactors = new float[]{1.0F, 12.0F / 16.0F, 0.5F, 0.25F, 0.0F, 0.25F, 0.5F, 12.0F / 16.0F}; -+ public static final float[] moonPhaseFactors = new float[] {1.0F, 0.75F, 0.5F, 0.25F, 0.0F, 0.25F, 0.5F, 0.75F}; -+ -+ /** world object being used */ - public World worldObj; - public WorldType terrainType; -- public String d; -+ public String field_82913_c; -+ -+ /** World chunk manager being used to generate chunks */ - public WorldChunkManager worldChunkMgr; -+ -+ /** -+ * States whether the Hell world provider is used(true) or if the normal world provider is used(false) -+ */ - public boolean isHellWorld; -+ -+ /** -+ * A boolean that tells if a world does not have a sky. Used in calculating weather and skylight -+ */ - public boolean hasNoSky; -+ -+ /** Light to brightness conversion table */ - public float[] lightBrightnessTable = new float[16]; -+ -+ /** The id for the dimension (ex. -1: Nether, 0: Overworld, 1: The End) */ - public int dimensionId; -+ -+ /** Array for sunrise/sunset colors (RGBA) */ - private float[] colorsSunriseSunset = new float[4]; - -- public final void registerWorld(World var1) { -- this.worldObj = var1; -- this.terrainType = var1.getWorldInfo().getTerrainType(); -- this.d = var1.getWorldInfo().getGeneratorOptions(); -+ /** -+ * associate an existing world with a World provider, and setup its lightbrightness table -+ */ -+ public final void registerWorld(World par1World) { -+ this.worldObj = par1World; -+ this.terrainType = par1World.getWorldInfo().getTerrainType(); -+ this.field_82913_c = par1World.getWorldInfo().getGeneratorOptions(); - this.registerWorldChunkManager(); - this.generateLightBrightnessTable(); - } - -+ /** -+ * Creates the light to brightness table -+ */ - protected void generateLightBrightnessTable() { - float var1 = 0.0F; - -- for(int var2 = 0; var2 <= 15; ++var2) { -+ for (int var2 = 0; var2 <= 15; ++var2) { - float var3 = 1.0F - (float)var2 / 15.0F; - this.lightBrightnessTable[var2] = (1.0F - var3) / (var3 * 3.0F + 1.0F) * (1.0F - var1) + var1; - } -- - } - -+ /** -+ * creates a new world chunk manager for WorldProvider -+ */ - protected void registerWorldChunkManager() { -- if(this.worldObj.getWorldInfo().getTerrainType() == WorldType.FLAT) { -+ if (this.worldObj.getWorldInfo().getTerrainType() == WorldType.FLAT) { - FlatGeneratorInfo var1 = FlatGeneratorInfo.createFlatGeneratorFromString(this.worldObj.getWorldInfo().getGeneratorOptions()); - this.worldChunkMgr = new WorldChunkManagerHell(BiomeGenBase.biomeList[var1.getBiome()], 0.5F, 0.5F); - } else { - this.worldChunkMgr = new WorldChunkManager(this.worldObj); - } -- - } - -+ /** -+ * Returns a new chunk provider which generates chunks for this world -+ */ - public IChunkProvider createChunkGenerator() { -- return (IChunkProvider)(this.terrainType == WorldType.FLAT ? new ChunkProviderFlat(this.worldObj, this.worldObj.getSeed(), this.worldObj.getWorldInfo().isMapFeaturesEnabled(), this.d) : new ChunkProviderGenerate(this.worldObj, this.worldObj.getSeed(), this.worldObj.getWorldInfo().isMapFeaturesEnabled())); -+ return (IChunkProvider)(this.terrainType == WorldType.FLAT ? new ChunkProviderFlat(this.worldObj, this.worldObj.getSeed(), this.worldObj.getWorldInfo().isMapFeaturesEnabled(), this.field_82913_c) : new ChunkProviderGenerate(this.worldObj, this.worldObj.getSeed(), this.worldObj.getWorldInfo().isMapFeaturesEnabled())); - } - -- public boolean canCoordinateBeSpawn(int var1, int var2) { -- int var3 = this.worldObj.getFirstUncoveredBlock(var1, var2); -+ /** -+ * Will check if the x, z position specified is alright to be set as the map spawn point -+ */ -+ public boolean canCoordinateBeSpawn(int par1, int par2) { -+ int var3 = this.worldObj.getFirstUncoveredBlock(par1, par2); - return var3 == Block.grass.blockID; - } - -- public float calculateCelestialAngle(long var1, float var3) { -- int var4 = (int)(var1 % 24000L); -- float var5 = ((float)var4 + var3) / 24000.0F - 0.25F; -- if(var5 < 0.0F) { -+ /** -+ * Calculates the angle of sun and moon in the sky relative to a specified time (usually worldTime) -+ */ -+ public float calculateCelestialAngle(long par1, float par3) { -+ int var4 = (int)(par1 % 24000L); -+ float var5 = ((float)var4 + par3) / 24000.0F - 0.25F; -+ -+ if (var5 < 0.0F) { - ++var5; - } - -- if(var5 > 1.0F) { -+ if (var5 > 1.0F) { - --var5; - } - -@@ -66,19 +106,26 @@ - return var5; - } - -- public int getMoonPhase(long var1) { -- return (int)(var1 / 24000L) % 8; -+ public int getMoonPhase(long par1) { -+ return (int)(par1 / 24000L) % 8; - } - -+ /** -+ * Returns 'true' if in the "main surface world", but 'false' if in the Nether or End dimensions. -+ */ - public boolean isSurfaceWorld() { - return true; - } - -- public float[] calcSunriseSunsetColors(float var1, float var2) { -+ /** -+ * Returns array with sunrise/sunset colors -+ */ -+ public float[] calcSunriseSunsetColors(float par1, float par2) { - float var3 = 0.4F; -- float var4 = MathHelper.cos(var1 * (float)Math.PI * 2.0F) - 0.0F; -+ float var4 = MathHelper.cos(par1 * (float)Math.PI * 2.0F) - 0.0F; - float var5 = -0.0F; -- if(var4 >= var5 - var3 && var4 <= var5 + var3) { -+ -+ if (var4 >= var5 - var3 && var4 <= var5 + var3) { - float var6 = (var4 - var5) / var3 * 0.5F + 0.5F; - float var7 = 1.0F - (1.0F - MathHelper.sin(var6 * (float)Math.PI)) * 0.99F; - var7 *= var7; -@@ -92,33 +139,55 @@ - } - } - -- public Vec3 getFogColor(float var1, float var2) { -- float var3 = MathHelper.cos(var1 * (float)Math.PI * 2.0F) * 2.0F + 0.5F; -- if(var3 < 0.0F) { -+ /** -+ * Return Vec3D with biome specific fog color -+ */ -+ public Vec3 getFogColor(float par1, float par2) { -+ float var3 = MathHelper.cos(par1 * (float)Math.PI * 2.0F) * 2.0F + 0.5F; -+ -+ if (var3 < 0.0F) { - var3 = 0.0F; - } - -- if(var3 > 1.0F) { -+ if (var3 > 1.0F) { - var3 = 1.0F; - } - -- float var4 = 192.0F / 255.0F; -- float var5 = 216.0F / 255.0F; -- float var6 = 1.0F; -+ // MCPatcher Start -+ float var4; -+ float var5; -+ float var6; -+ -+ if (ColorizeWorld.computeFogColor(Colorizer.COLOR_MAP_FOG0)) { -+ var4 = Colorizer.setColor[0]; -+ var5 = Colorizer.setColor[1]; -+ var6 = Colorizer.setColor[2]; -+ } else { -+ var4 = 0.7529412F; -+ var5 = 0.84705883F; -+ var6 = 1.0F; -+ } -+ // MCPatcher End - var4 *= var3 * 0.94F + 0.06F; - var5 *= var3 * 0.94F + 0.06F; - var6 *= var3 * 0.91F + 0.09F; - return this.worldObj.getWorldVec3Pool().getVecFromPool((double)var4, (double)var5, (double)var6); - } - -+ /** -+ * True if the player can respawn in this dimension (true = overworld, false = nether). -+ */ - public boolean canRespawnHere() { - return true; - } - -- public static WorldProvider getProviderForDimension(int var0) { -- return (WorldProvider)(var0 == -1 ? new WorldProviderHell() : (var0 == 0 ? new WorldProviderSurface() : (var0 == 1 ? new WorldProviderEnd() : null))); -+ public static WorldProvider getProviderForDimension(int par0) { -+ return (WorldProvider)(par0 == -1 ? new WorldProviderHell() : (par0 == 0 ? new WorldProviderSurface() : (par0 == 1 ? new WorldProviderEnd() : null))); - } - -+ /** -+ * the y level at which clouds are rendered. -+ */ - public float getCloudHeight() { - return 128.0F; - } -@@ -127,6 +196,9 @@ - return true; - } - -+ /** -+ * Gets the hard-coded portal location to use when entering this dimension. -+ */ - public ChunkCoordinates getEntrancePortalLocation() { - return null; - } -@@ -135,17 +207,32 @@ - return this.terrainType == WorldType.FLAT ? 4 : 64; - } - -+ /** -+ * returns true if this dimension is supposed to display void particles and pull in the far plane based on the user's Y -+ * offset. -+ */ - public boolean getWorldHasVoidParticles() { - return this.terrainType != WorldType.FLAT && !this.hasNoSky; - } - -+ /** -+ * Returns a double value representing the Y value relative to the top of the map at which void fog is at its maximum. -+ * The default factor of 0.03125 relative to 256, for example, means the void fog will be at its maximum at -+ * (256*0.03125), or 8. -+ */ - public double getVoidFogYFactor() { -- return this.terrainType == WorldType.FLAT ? 1.0D : 1.0D / 32.0D; -+ return this.terrainType == WorldType.FLAT ? 1.0D : 0.03125D; - } - -- public boolean doesXZShowFog(int var1, int var2) { -+ /** -+ * Returns true if the given X,Z coordinate should show environmental fog. -+ */ -+ public boolean doesXZShowFog(int par1, int par2) { - return false; - } - -+ /** -+ * Returns the dimension's name, e.g. "The End", "Nether", or "Overworld". -+ */ - public abstract String getDimensionName(); - } ---- net/minecraft/src/AnimationMetadataSection.java -+++ net/minecraft/src/AnimationMetadataSection.java -@@ -7,16 +7,16 @@ - import java.util.Set; - - public class AnimationMetadataSection implements MetadataSection { -- private final List a; -+ private final List animationFrames; - private final int frameWidth; - private final int frameHeight; - private final int frameTime; - -- public AnimationMetadataSection(List var1, int var2, int var3, int var4) { -- this.a = var1; -- this.frameWidth = var2; -- this.frameHeight = var3; -- this.frameTime = var4; -+ public AnimationMetadataSection(List par1List, int par2, int par3, int par4) { -+ this.animationFrames = par1List; -+ this.frameWidth = par2; -+ this.frameHeight = par3; -+ this.frameTime = par4; - } - - public int getFrameHeight() { -@@ -28,35 +28,35 @@ - } - - public int getFrameCount() { -- return this.a.size(); -+ return this.animationFrames.size(); - } - - public int getFrameTime() { - return this.frameTime; - } - -- private AnimationFrame getAnimationFrame(int var1) { -- return (AnimationFrame)this.a.get(var1); -+ private AnimationFrame getAnimationFrame(int par1) { -+ return (AnimationFrame)this.animationFrames.get(par1); - } - -- public int getFrameTimeSingle(int var1) { -- AnimationFrame var2 = this.getAnimationFrame(var1); -+ public int getFrameTimeSingle(int par1) { -+ AnimationFrame var2 = this.getAnimationFrame(par1); - return var2.hasNoTime() ? this.frameTime : var2.getFrameTime(); - } - -- public boolean frameHasTime(int var1) { -- return !((AnimationFrame)this.a.get(var1)).hasNoTime(); -+ public boolean frameHasTime(int par1) { -+ return !((AnimationFrame)this.animationFrames.get(par1)).hasNoTime(); - } - -- public int getFrameIndex(int var1) { -- return ((AnimationFrame)this.a.get(var1)).getFrameIndex(); -+ public int getFrameIndex(int par1) { -+ return ((AnimationFrame)this.animationFrames.get(par1)).getFrameIndex(); - } - - public Set getFrameIndexSet() { - HashSet var1 = Sets.newHashSet(); -- Iterator var2 = this.a.iterator(); -+ Iterator var2 = this.animationFrames.iterator(); - -- while(var2.hasNext()) { -+ while (var2.hasNext()) { - AnimationFrame var3 = (AnimationFrame)var2.next(); - var1.add(Integer.valueOf(var3.getFrameIndex())); - } ---- net/minecraft/src/EntitySorter.java -+++ net/minecraft/src/EntitySorter.java -@@ -3,27 +3,36 @@ - import java.util.Comparator; - - public class EntitySorter implements Comparator { -+ -+ /** Entity position X */ - private double entityPosX; -+ -+ /** Entity position Y */ - private double entityPosY; -+ -+ /** Entity position Z */ - private double entityPosZ; - -- public EntitySorter(Entity var1) { -- this.entityPosX = -var1.posX; -- this.entityPosY = -var1.posY; -- this.entityPosZ = -var1.posZ; -+ public EntitySorter(Entity par1Entity) { -+ this.entityPosX = -par1Entity.posX; -+ this.entityPosY = -par1Entity.posY; -+ this.entityPosZ = -par1Entity.posZ; - } - -- public int sortByDistanceToEntity(WorldRenderer var1, WorldRenderer var2) { -- double var3 = (double)var1.posXPlus + this.entityPosX; -- double var5 = (double)var1.posYPlus + this.entityPosY; -- double var7 = (double)var1.posZPlus + this.entityPosZ; -- double var9 = (double)var2.posXPlus + this.entityPosX; -- double var11 = (double)var2.posYPlus + this.entityPosY; -- double var13 = (double)var2.posZPlus + this.entityPosZ; -+ /** -+ * Sorts the two world renderers according to their distance to a given entity. -+ */ -+ public int sortByDistanceToEntity(WorldRenderer par1WorldRenderer, WorldRenderer par2WorldRenderer) { -+ double var3 = (double)par1WorldRenderer.posXPlus + this.entityPosX; -+ double var5 = (double)par1WorldRenderer.posYPlus + this.entityPosY; -+ double var7 = (double)par1WorldRenderer.posZPlus + this.entityPosZ; -+ double var9 = (double)par2WorldRenderer.posXPlus + this.entityPosX; -+ double var11 = (double)par2WorldRenderer.posYPlus + this.entityPosY; -+ double var13 = (double)par2WorldRenderer.posZPlus + this.entityPosZ; - return (int)((var3 * var3 + var5 * var5 + var7 * var7 - (var9 * var9 + var11 * var11 + var13 * var13)) * 1024.0D); - } - -- public int compare(Object var1, Object var2) { -- return this.sortByDistanceToEntity((WorldRenderer)var1, (WorldRenderer)var2); -+ public int compare(Object par1Obj, Object par2Obj) { -+ return this.sortByDistanceToEntity((WorldRenderer)par1Obj, (WorldRenderer)par2Obj); - } - } ---- net/minecraft/src/PotionEffect.java -+++ net/minecraft/src/PotionEffect.java -@@ -1,50 +1,68 @@ - package net.minecraft.src; - - public class PotionEffect { -+ -+ /** ID value of the potion this effect matches. */ - private int potionID; -+ -+ /** The duration of the potion effect */ - private int duration; -+ -+ /** The amplifier of the potion effect */ - private int amplifier; -+ -+ /** Whether the potion is a splash potion */ - private boolean isSplashPotion; -+ -+ /** Whether the potion effect came from a beacon */ - private boolean isAmbient; -+ -+ /** True if potion effect duration is at maximum, false otherwise. */ - private boolean isPotionDurationMax; - -- public PotionEffect(int var1, int var2) { -- this(var1, var2, 0); -- } -- -- public PotionEffect(int var1, int var2, int var3) { -- this(var1, var2, var3, false); -- } -- -- public PotionEffect(int var1, int var2, int var3, boolean var4) { -- this.potionID = var1; -- this.duration = var2; -- this.amplifier = var3; -- this.isAmbient = var4; -- } -- -- public PotionEffect(PotionEffect var1) { -- this.potionID = var1.potionID; -- this.duration = var1.duration; -- this.amplifier = var1.amplifier; -- } -- -- public void combine(PotionEffect var1) { -- if(this.potionID != var1.potionID) { -+ public PotionEffect(int par1, int par2) { -+ this(par1, par2, 0); -+ } -+ -+ public PotionEffect(int par1, int par2, int par3) { -+ this(par1, par2, par3, false); -+ } -+ -+ public PotionEffect(int par1, int par2, int par3, boolean par4) { -+ this.potionID = par1; -+ this.duration = par2; -+ this.amplifier = par3; -+ this.isAmbient = par4; -+ } -+ -+ public PotionEffect(PotionEffect par1PotionEffect) { -+ this.potionID = par1PotionEffect.potionID; -+ this.duration = par1PotionEffect.duration; -+ this.amplifier = par1PotionEffect.amplifier; -+ } -+ -+ /** -+ * merges the input PotionEffect into this one if this.amplifier <= tomerge.amplifier. The duration in the supplied -+ * potion effect is assumed to be greater. -+ */ -+ public void combine(PotionEffect par1PotionEffect) { -+ if (this.potionID != par1PotionEffect.potionID) { - System.err.println("This method should only be called for matching effects!"); - } - -- if(var1.amplifier > this.amplifier) { -- this.amplifier = var1.amplifier; -- this.duration = var1.duration; -- } else if(var1.amplifier == this.amplifier && this.duration < var1.duration) { -- this.duration = var1.duration; -- } else if(!var1.isAmbient && this.isAmbient) { -- this.isAmbient = var1.isAmbient; -+ if (par1PotionEffect.amplifier > this.amplifier) { -+ this.amplifier = par1PotionEffect.amplifier; -+ this.duration = par1PotionEffect.duration; -+ } else if (par1PotionEffect.amplifier == this.amplifier && this.duration < par1PotionEffect.duration) { -+ this.duration = par1PotionEffect.duration; -+ } else if (!par1PotionEffect.isAmbient && this.isAmbient) { -+ this.isAmbient = par1PotionEffect.isAmbient; - } -- - } - -+ /** -+ * Retrieve the ID of the potion this effect matches. -+ */ - public int getPotionID() { - return this.potionID; - } -@@ -57,18 +75,24 @@ - return this.amplifier; - } - -- public void setSplashPotion(boolean var1) { -- this.isSplashPotion = var1; -+ /** -+ * Set whether this potion is a splash potion. -+ */ -+ public void setSplashPotion(boolean par1) { -+ this.isSplashPotion = par1; - } - -+ /** -+ * Gets whether this potion effect originated from a beacon -+ */ - public boolean getIsAmbient() { - return this.isAmbient; - } - -- public boolean onUpdate(EntityLivingBase var1) { -- if(this.duration > 0) { -- if(Potion.potionTypes[this.potionID].isReady(this.duration, this.amplifier)) { -- this.performEffect(var1); -+ public boolean onUpdate(EntityLivingBase par1EntityLivingBase) { -+ if (this.duration > 0) { -+ if (Potion.potionTypes[this.potionID].isReady(this.duration, this.amplifier)) { -+ this.performEffect(par1EntityLivingBase); - } - - this.deincrementDuration(); -@@ -81,11 +105,10 @@ - return --this.duration; - } - -- public void performEffect(EntityLivingBase var1) { -- if(this.duration > 0) { -- Potion.potionTypes[this.potionID].performEffect(var1, this.amplifier); -+ public void performEffect(EntityLivingBase par1EntityLivingBase) { -+ if (this.duration > 0) { -+ Potion.potionTypes[this.potionID].performEffect(par1EntityLivingBase, this.amplifier); - } -- - } - - public String getEffectName() { -@@ -98,46 +121,56 @@ - - public String toString() { - String var1 = ""; -- if(this.getAmplifier() > 0) { -+ -+ if (this.getAmplifier() > 0) { - var1 = this.getEffectName() + " x " + (this.getAmplifier() + 1) + ", Duration: " + this.getDuration(); - } else { - var1 = this.getEffectName() + ", Duration: " + this.getDuration(); - } - -- if(this.isSplashPotion) { -+ if (this.isSplashPotion) { - var1 = var1 + ", Splash: true"; - } - - return Potion.potionTypes[this.potionID].isUsable() ? "(" + var1 + ")" : var1; - } - -- public boolean equals(Object var1) { -- if(!(var1 instanceof PotionEffect)) { -+ public boolean equals(Object par1Obj) { -+ if (!(par1Obj instanceof PotionEffect)) { - return false; - } else { -- PotionEffect var2 = (PotionEffect)var1; -+ PotionEffect var2 = (PotionEffect)par1Obj; - return this.potionID == var2.potionID && this.amplifier == var2.amplifier && this.duration == var2.duration && this.isSplashPotion == var2.isSplashPotion && this.isAmbient == var2.isAmbient; - } - } - -- public NBTTagCompound writeCustomPotionEffectToNBT(NBTTagCompound var1) { -- var1.setByte("Id", (byte)this.getPotionID()); -- var1.setByte("Amplifier", (byte)this.getAmplifier()); -- var1.setInteger("Duration", this.getDuration()); -- var1.setBoolean("Ambient", this.getIsAmbient()); -- return var1; -+ /** -+ * Write a custom potion effect to a potion item's NBT data. -+ */ -+ public NBTTagCompound writeCustomPotionEffectToNBT(NBTTagCompound par1NBTTagCompound) { -+ par1NBTTagCompound.setByte("Id", (byte)this.getPotionID()); -+ par1NBTTagCompound.setByte("Amplifier", (byte)this.getAmplifier()); -+ par1NBTTagCompound.setInteger("Duration", this.getDuration()); -+ par1NBTTagCompound.setBoolean("Ambient", this.getIsAmbient()); -+ return par1NBTTagCompound; - } - -- public static PotionEffect readCustomPotionEffectFromNBT(NBTTagCompound var0) { -- byte var1 = var0.getByte("Id"); -- byte var2 = var0.getByte("Amplifier"); -- int var3 = var0.getInteger("Duration"); -- boolean var4 = var0.getBoolean("Ambient"); -+ /** -+ * Read a custom potion effect from a potion item's NBT data. -+ */ -+ public static PotionEffect readCustomPotionEffectFromNBT(NBTTagCompound par0NBTTagCompound) { -+ byte var1 = par0NBTTagCompound.getByte("Id"); -+ byte var2 = par0NBTTagCompound.getByte("Amplifier"); -+ int var3 = par0NBTTagCompound.getInteger("Duration"); -+ boolean var4 = par0NBTTagCompound.getBoolean("Ambient"); - return new PotionEffect(var1, var3, var2, var4); - } - -- public void setPotionDurationMax(boolean var1) { -- this.isPotionDurationMax = var1; -+ /** -+ * Toggle the isPotionDurationMax field. -+ */ -+ public void setPotionDurationMax(boolean par1) { -+ this.isPotionDurationMax = par1; - } - - public boolean getIsPotionDurationMax() { ---- net/minecraft/src/BlockPumpkin.java -+++ net/minecraft/src/BlockPumpkin.java -@@ -1,91 +1,112 @@ - package net.minecraft.src; - - public class BlockPumpkin extends BlockDirectional { -+ -+ /** Boolean used to seperate different states of blocks */ - private boolean blockType; - private Icon field_94474_b; - private Icon field_94475_c; - -- protected BlockPumpkin(int var1, boolean var2) { -- super(var1, Material.pumpkin); -+ protected BlockPumpkin(int par1, boolean par2) { -+ super(par1, Material.pumpkin); - this.setTickRandomly(true); -- this.blockType = var2; -+ this.blockType = par2; - this.setCreativeTab(CreativeTabs.tabBlock); - } - -- public Icon getIcon(int var1, int var2) { -- return var1 == 1 ? this.field_94474_b : (var1 == 0 ? this.field_94474_b : (var2 == 2 && var1 == 2 ? this.field_94475_c : (var2 == 3 && var1 == 5 ? this.field_94475_c : (var2 == 0 && var1 == 3 ? this.field_94475_c : (var2 == 1 && var1 == 4 ? this.field_94475_c : this.blockIcon))))); -+ /** -+ * From the specified side and block metadata retrieves the blocks texture. Args: side, metadata -+ */ -+ public Icon getIcon(int par1, int par2) { -+ return par1 == 1 ? this.field_94474_b : (par1 == 0 ? this.field_94474_b : (par2 == 2 && par1 == 2 ? this.field_94475_c : (par2 == 3 && par1 == 5 ? this.field_94475_c : (par2 == 0 && par1 == 3 ? this.field_94475_c : (par2 == 1 && par1 == 4 ? this.field_94475_c : this.blockIcon))))); - } - -- public void onBlockAdded(World var1, int var2, int var3, int var4) { -- super.onBlockAdded(var1, var2, var3, var4); -- if(var1.getBlockId(var2, var3 - 1, var4) == Block.blockSnow.blockID && var1.getBlockId(var2, var3 - 2, var4) == Block.blockSnow.blockID) { -- if(!var1.isRemote) { -- var1.setBlock(var2, var3, var4, 0, 0, 2); -- var1.setBlock(var2, var3 - 1, var4, 0, 0, 2); -- var1.setBlock(var2, var3 - 2, var4, 0, 0, 2); -- EntitySnowman var9 = new EntitySnowman(var1); -- var9.setLocationAndAngles((double)var2 + 0.5D, (double)var3 - 1.95D, (double)var4 + 0.5D, 0.0F, 0.0F); -- var1.spawnEntityInWorld(var9); -- var1.notifyBlockChange(var2, var3, var4, 0); -- var1.notifyBlockChange(var2, var3 - 1, var4, 0); -- var1.notifyBlockChange(var2, var3 - 2, var4, 0); -- } -- -- for(int var10 = 0; var10 < 120; ++var10) { -- var1.spawnParticle("snowshovel", (double)var2 + var1.s.nextDouble(), (double)(var3 - 2) + var1.s.nextDouble() * 2.5D, (double)var4 + var1.s.nextDouble(), 0.0D, 0.0D, 0.0D); -- } -- } else if(var1.getBlockId(var2, var3 - 1, var4) == Block.blockIron.blockID && var1.getBlockId(var2, var3 - 2, var4) == Block.blockIron.blockID) { -- boolean var5 = var1.getBlockId(var2 - 1, var3 - 1, var4) == Block.blockIron.blockID && var1.getBlockId(var2 + 1, var3 - 1, var4) == Block.blockIron.blockID; -- boolean var6 = var1.getBlockId(var2, var3 - 1, var4 - 1) == Block.blockIron.blockID && var1.getBlockId(var2, var3 - 1, var4 + 1) == Block.blockIron.blockID; -- if(var5 || var6) { -- var1.setBlock(var2, var3, var4, 0, 0, 2); -- var1.setBlock(var2, var3 - 1, var4, 0, 0, 2); -- var1.setBlock(var2, var3 - 2, var4, 0, 0, 2); -- if(var5) { -- var1.setBlock(var2 - 1, var3 - 1, var4, 0, 0, 2); -- var1.setBlock(var2 + 1, var3 - 1, var4, 0, 0, 2); -+ /** -+ * Called whenever the block is added into the world. Args: world, x, y, z -+ */ -+ public void onBlockAdded(World par1World, int par2, int par3, int par4) { -+ super.onBlockAdded(par1World, par2, par3, par4); -+ -+ if (par1World.getBlockId(par2, par3 - 1, par4) == Block.blockSnow.blockID && par1World.getBlockId(par2, par3 - 2, par4) == Block.blockSnow.blockID) { -+ if (!par1World.isRemote) { -+ par1World.setBlock(par2, par3, par4, 0, 0, 2); -+ par1World.setBlock(par2, par3 - 1, par4, 0, 0, 2); -+ par1World.setBlock(par2, par3 - 2, par4, 0, 0, 2); -+ EntitySnowman var9 = new EntitySnowman(par1World); -+ var9.setLocationAndAngles((double)par2 + 0.5D, (double)par3 - 1.95D, (double)par4 + 0.5D, 0.0F, 0.0F); -+ par1World.spawnEntityInWorld(var9); -+ par1World.notifyBlockChange(par2, par3, par4, 0); -+ par1World.notifyBlockChange(par2, par3 - 1, par4, 0); -+ par1World.notifyBlockChange(par2, par3 - 2, par4, 0); -+ } -+ -+ for (int var10 = 0; var10 < 120; ++var10) { -+ par1World.spawnParticle("snowshovel", (double)par2 + par1World.rand.nextDouble(), (double)(par3 - 2) + par1World.rand.nextDouble() * 2.5D, (double)par4 + par1World.rand.nextDouble(), 0.0D, 0.0D, 0.0D); -+ } -+ } else if (par1World.getBlockId(par2, par3 - 1, par4) == Block.blockIron.blockID && par1World.getBlockId(par2, par3 - 2, par4) == Block.blockIron.blockID) { -+ boolean var5 = par1World.getBlockId(par2 - 1, par3 - 1, par4) == Block.blockIron.blockID && par1World.getBlockId(par2 + 1, par3 - 1, par4) == Block.blockIron.blockID; -+ boolean var6 = par1World.getBlockId(par2, par3 - 1, par4 - 1) == Block.blockIron.blockID && par1World.getBlockId(par2, par3 - 1, par4 + 1) == Block.blockIron.blockID; -+ -+ if (var5 || var6) { -+ par1World.setBlock(par2, par3, par4, 0, 0, 2); -+ par1World.setBlock(par2, par3 - 1, par4, 0, 0, 2); -+ par1World.setBlock(par2, par3 - 2, par4, 0, 0, 2); -+ -+ if (var5) { -+ par1World.setBlock(par2 - 1, par3 - 1, par4, 0, 0, 2); -+ par1World.setBlock(par2 + 1, par3 - 1, par4, 0, 0, 2); - } else { -- var1.setBlock(var2, var3 - 1, var4 - 1, 0, 0, 2); -- var1.setBlock(var2, var3 - 1, var4 + 1, 0, 0, 2); -+ par1World.setBlock(par2, par3 - 1, par4 - 1, 0, 0, 2); -+ par1World.setBlock(par2, par3 - 1, par4 + 1, 0, 0, 2); - } - -- EntityIronGolem var7 = new EntityIronGolem(var1); -+ EntityIronGolem var7 = new EntityIronGolem(par1World); - var7.setPlayerCreated(true); -- var7.setLocationAndAngles((double)var2 + 0.5D, (double)var3 - 1.95D, (double)var4 + 0.5D, 0.0F, 0.0F); -- var1.spawnEntityInWorld(var7); -+ var7.setLocationAndAngles((double)par2 + 0.5D, (double)par3 - 1.95D, (double)par4 + 0.5D, 0.0F, 0.0F); -+ par1World.spawnEntityInWorld(var7); - -- for(int var8 = 0; var8 < 120; ++var8) { -- var1.spawnParticle("snowballpoof", (double)var2 + var1.s.nextDouble(), (double)(var3 - 2) + var1.s.nextDouble() * 3.9D, (double)var4 + var1.s.nextDouble(), 0.0D, 0.0D, 0.0D); -+ for (int var8 = 0; var8 < 120; ++var8) { -+ par1World.spawnParticle("snowballpoof", (double)par2 + par1World.rand.nextDouble(), (double)(par3 - 2) + par1World.rand.nextDouble() * 3.9D, (double)par4 + par1World.rand.nextDouble(), 0.0D, 0.0D, 0.0D); - } - -- var1.notifyBlockChange(var2, var3, var4, 0); -- var1.notifyBlockChange(var2, var3 - 1, var4, 0); -- var1.notifyBlockChange(var2, var3 - 2, var4, 0); -- if(var5) { -- var1.notifyBlockChange(var2 - 1, var3 - 1, var4, 0); -- var1.notifyBlockChange(var2 + 1, var3 - 1, var4, 0); -+ par1World.notifyBlockChange(par2, par3, par4, 0); -+ par1World.notifyBlockChange(par2, par3 - 1, par4, 0); -+ par1World.notifyBlockChange(par2, par3 - 2, par4, 0); -+ -+ if (var5) { -+ par1World.notifyBlockChange(par2 - 1, par3 - 1, par4, 0); -+ par1World.notifyBlockChange(par2 + 1, par3 - 1, par4, 0); - } else { -- var1.notifyBlockChange(var2, var3 - 1, var4 - 1, 0); -- var1.notifyBlockChange(var2, var3 - 1, var4 + 1, 0); -+ par1World.notifyBlockChange(par2, par3 - 1, par4 - 1, 0); -+ par1World.notifyBlockChange(par2, par3 - 1, par4 + 1, 0); - } - } - } -- -- } -- -- public boolean canPlaceBlockAt(World var1, int var2, int var3, int var4) { -- int var5 = var1.getBlockId(var2, var3, var4); -- return (var5 == 0 || Block.blocksList[var5].blockMaterial.isReplaceable()) && var1.doesBlockHaveSolidTopSurface(var2, var3 - 1, var4); -- } -- -- public void onBlockPlacedBy(World var1, int var2, int var3, int var4, EntityLivingBase var5, ItemStack var6) { -- int var7 = MathHelper.floor_double((double)(var5.rotationYaw * 4.0F / 360.0F) + 2.5D) & 3; -- var1.setBlockMetadata(var2, var3, var4, var7, 2); -- } -- -- public void registerIcons(IconRegister var1) { -- this.field_94475_c = var1.registerIcon(this.getTextureName() + "_face_" + (this.blockType ? "on" : "off")); -- this.field_94474_b = var1.registerIcon(this.getTextureName() + "_top"); -- this.blockIcon = var1.registerIcon(this.getTextureName() + "_side"); -+ } -+ -+ /** -+ * Checks to see if its valid to put this block at the specified coordinates. Args: world, x, y, z -+ */ -+ public boolean canPlaceBlockAt(World par1World, int par2, int par3, int par4) { -+ int var5 = par1World.getBlockId(par2, par3, par4); -+ return (var5 == 0 || Block.blocksList[var5].blockMaterial.isReplaceable()) && par1World.doesBlockHaveSolidTopSurface(par2, par3 - 1, par4); -+ } -+ -+ /** -+ * Called when the block is placed in the world. -+ */ -+ public void onBlockPlacedBy(World par1World, int par2, int par3, int par4, EntityLivingBase par5EntityLivingBase, ItemStack par6ItemStack) { -+ int var7 = MathHelper.floor_double((double)(par5EntityLivingBase.rotationYaw * 4.0F / 360.0F) + 2.5D) & 3; -+ par1World.setBlockMetadataWithNotify(par2, par3, par4, var7, 2); -+ } -+ -+ /** -+ * When this method is called, your block should register all the icons it needs with the given IconRegister. This is -+ * the only chance you get to register icons. -+ */ -+ public void registerIcons(IconRegister par1IconRegister) { -+ this.field_94475_c = par1IconRegister.registerIcon(this.getTextureName() + "_face_" + (this.blockType ? "on" : "off")); -+ this.field_94474_b = par1IconRegister.registerIcon(this.getTextureName() + "_top"); -+ this.blockIcon = par1IconRegister.registerIcon(this.getTextureName() + "_side"); - } - } ---- net/minecraft/src/Vec3.java -+++ net/minecraft/src/Vec3.java -@@ -1,120 +1,177 @@ - package net.minecraft.src; - - public class Vec3 { -+ -+ /** -+ * A global Vec3Pool that always creates new vectors instead of reusing them and is thread-safe. -+ */ - public static final Vec3Pool fakePool = new Vec3Pool(-1, -1); - public final Vec3Pool myVec3LocalPool; -+ -+ /** X coordinate of Vec3D */ - public double xCoord; -+ -+ /** Y coordinate of Vec3D */ - public double yCoord; -+ -+ /** Z coordinate of Vec3D */ - public double zCoord; - -- public static Vec3 createVectorHelper(double var0, double var2, double var4) { -- return new Vec3(fakePool, var0, var2, var4); -- } -- -- protected Vec3(Vec3Pool var1, double var2, double var4, double var6) { -- if(var2 == -0.0D) { -- var2 = 0.0D; -- } -- -- if(var4 == -0.0D) { -- var4 = 0.0D; -- } -- -- if(var6 == -0.0D) { -- var6 = 0.0D; -- } -- -- this.xCoord = var2; -- this.yCoord = var4; -- this.zCoord = var6; -- this.myVec3LocalPool = var1; -- } -- -- protected Vec3 setComponents(double var1, double var3, double var5) { -- this.xCoord = var1; -- this.yCoord = var3; -- this.zCoord = var5; -+ /** -+ * Static method for creating a new Vec3D given the three x,y,z values. This is only called from the other static -+ * method which creates and places it in the list. -+ */ -+ public static Vec3 createVectorHelper(double par0, double par2, double par4) { -+ return new Vec3(fakePool, par0, par2, par4); -+ } -+ -+ protected Vec3(Vec3Pool par1Vec3Pool, double par2, double par4, double par6) { -+ if (par2 == -0.0D) { -+ par2 = 0.0D; -+ } -+ -+ if (par4 == -0.0D) { -+ par4 = 0.0D; -+ } -+ -+ if (par6 == -0.0D) { -+ par6 = 0.0D; -+ } -+ -+ this.xCoord = par2; -+ this.yCoord = par4; -+ this.zCoord = par6; -+ this.myVec3LocalPool = par1Vec3Pool; -+ } -+ -+ /** -+ * Sets the x,y,z components of the vector as specified. -+ */ -+ protected Vec3 setComponents(double par1, double par3, double par5) { -+ this.xCoord = par1; -+ this.yCoord = par3; -+ this.zCoord = par5; - return this; - } - -- public Vec3 subtract(Vec3 var1) { -- return this.myVec3LocalPool.getVecFromPool(var1.xCoord - this.xCoord, var1.yCoord - this.yCoord, var1.zCoord - this.zCoord); -+ /** -+ * Returns a new vector with the result of the specified vector minus this. -+ */ -+ public Vec3 subtract(Vec3 par1Vec3) { -+ return this.myVec3LocalPool.getVecFromPool(par1Vec3.xCoord - this.xCoord, par1Vec3.yCoord - this.yCoord, par1Vec3.zCoord - this.zCoord); - } - -+ /** -+ * Normalizes the vector to a length of 1 (except if it is the zero vector) -+ */ - public Vec3 normalize() { - double var1 = (double)MathHelper.sqrt_double(this.xCoord * this.xCoord + this.yCoord * this.yCoord + this.zCoord * this.zCoord); - return var1 < 1.0E-4D ? this.myVec3LocalPool.getVecFromPool(0.0D, 0.0D, 0.0D) : this.myVec3LocalPool.getVecFromPool(this.xCoord / var1, this.yCoord / var1, this.zCoord / var1); - } - -- public double dotProduct(Vec3 var1) { -- return this.xCoord * var1.xCoord + this.yCoord * var1.yCoord + this.zCoord * var1.zCoord; -- } -- -- public Vec3 crossProduct(Vec3 var1) { -- return this.myVec3LocalPool.getVecFromPool(this.yCoord * var1.zCoord - this.zCoord * var1.yCoord, this.zCoord * var1.xCoord - this.xCoord * var1.zCoord, this.xCoord * var1.yCoord - this.yCoord * var1.xCoord); -- } -- -- public Vec3 addVector(double var1, double var3, double var5) { -- return this.myVec3LocalPool.getVecFromPool(this.xCoord + var1, this.yCoord + var3, this.zCoord + var5); -- } -- -- public double distanceTo(Vec3 var1) { -- double var2 = var1.xCoord - this.xCoord; -- double var4 = var1.yCoord - this.yCoord; -- double var6 = var1.zCoord - this.zCoord; -+ public double dotProduct(Vec3 par1Vec3) { -+ return this.xCoord * par1Vec3.xCoord + this.yCoord * par1Vec3.yCoord + this.zCoord * par1Vec3.zCoord; -+ } -+ -+ /** -+ * Returns a new vector with the result of this vector x the specified vector. -+ */ -+ public Vec3 crossProduct(Vec3 par1Vec3) { -+ return this.myVec3LocalPool.getVecFromPool(this.yCoord * par1Vec3.zCoord - this.zCoord * par1Vec3.yCoord, this.zCoord * par1Vec3.xCoord - this.xCoord * par1Vec3.zCoord, this.xCoord * par1Vec3.yCoord - this.yCoord * par1Vec3.xCoord); -+ } -+ -+ /** -+ * Adds the specified x,y,z vector components to this vector and returns the resulting vector. Does not change this -+ * vector. -+ */ -+ public Vec3 addVector(double par1, double par3, double par5) { -+ return this.myVec3LocalPool.getVecFromPool(this.xCoord + par1, this.yCoord + par3, this.zCoord + par5); -+ } -+ -+ /** -+ * Euclidean distance between this and the specified vector, returned as double. -+ */ -+ public double distanceTo(Vec3 par1Vec3) { -+ double var2 = par1Vec3.xCoord - this.xCoord; -+ double var4 = par1Vec3.yCoord - this.yCoord; -+ double var6 = par1Vec3.zCoord - this.zCoord; - return (double)MathHelper.sqrt_double(var2 * var2 + var4 * var4 + var6 * var6); - } - -- public double squareDistanceTo(Vec3 var1) { -- double var2 = var1.xCoord - this.xCoord; -- double var4 = var1.yCoord - this.yCoord; -- double var6 = var1.zCoord - this.zCoord; -+ /** -+ * The square of the Euclidean distance between this and the specified vector. -+ */ -+ public double squareDistanceTo(Vec3 par1Vec3) { -+ double var2 = par1Vec3.xCoord - this.xCoord; -+ double var4 = par1Vec3.yCoord - this.yCoord; -+ double var6 = par1Vec3.zCoord - this.zCoord; - return var2 * var2 + var4 * var4 + var6 * var6; - } - -- public double squareDistanceTo(double var1, double var3, double var5) { -- double var7 = var1 - this.xCoord; -- double var9 = var3 - this.yCoord; -- double var11 = var5 - this.zCoord; -+ /** -+ * The square of the Euclidean distance between this and the vector of x,y,z components passed in. -+ */ -+ public double squareDistanceTo(double par1, double par3, double par5) { -+ double var7 = par1 - this.xCoord; -+ double var9 = par3 - this.yCoord; -+ double var11 = par5 - this.zCoord; - return var7 * var7 + var9 * var9 + var11 * var11; - } - -+ /** -+ * Returns the length of the vector. -+ */ - public double lengthVector() { - return (double)MathHelper.sqrt_double(this.xCoord * this.xCoord + this.yCoord * this.yCoord + this.zCoord * this.zCoord); - } - -- public Vec3 getIntermediateWithXValue(Vec3 var1, double var2) { -- double var4 = var1.xCoord - this.xCoord; -- double var6 = var1.yCoord - this.yCoord; -- double var8 = var1.zCoord - this.zCoord; -- if(var4 * var4 < (double)1.0E-7F) { -- return null; -- } else { -- double var10 = (var2 - this.xCoord) / var4; -- return var10 >= 0.0D && var10 <= 1.0D ? this.myVec3LocalPool.getVecFromPool(this.xCoord + var4 * var10, this.yCoord + var6 * var10, this.zCoord + var8 * var10) : null; -- } -- } -- -- public Vec3 getIntermediateWithYValue(Vec3 var1, double var2) { -- double var4 = var1.xCoord - this.xCoord; -- double var6 = var1.yCoord - this.yCoord; -- double var8 = var1.zCoord - this.zCoord; -- if(var6 * var6 < (double)1.0E-7F) { -- return null; -- } else { -- double var10 = (var2 - this.yCoord) / var6; -- return var10 >= 0.0D && var10 <= 1.0D ? this.myVec3LocalPool.getVecFromPool(this.xCoord + var4 * var10, this.yCoord + var6 * var10, this.zCoord + var8 * var10) : null; -- } -- } -- -- public Vec3 getIntermediateWithZValue(Vec3 var1, double var2) { -- double var4 = var1.xCoord - this.xCoord; -- double var6 = var1.yCoord - this.yCoord; -- double var8 = var1.zCoord - this.zCoord; -- if(var8 * var8 < (double)1.0E-7F) { -- return null; -- } else { -- double var10 = (var2 - this.zCoord) / var8; -+ /** -+ * Returns a new vector with x value equal to the second parameter, along the line between this vector and the passed -+ * in vector, or null if not possible. -+ */ -+ public Vec3 getIntermediateWithXValue(Vec3 par1Vec3, double par2) { -+ double var4 = par1Vec3.xCoord - this.xCoord; -+ double var6 = par1Vec3.yCoord - this.yCoord; -+ double var8 = par1Vec3.zCoord - this.zCoord; -+ -+ if (var4 * var4 < 1.0000000116860974E-7D) { -+ return null; -+ } else { -+ double var10 = (par2 - this.xCoord) / var4; -+ return var10 >= 0.0D && var10 <= 1.0D ? this.myVec3LocalPool.getVecFromPool(this.xCoord + var4 * var10, this.yCoord + var6 * var10, this.zCoord + var8 * var10) : null; -+ } -+ } -+ -+ /** -+ * Returns a new vector with y value equal to the second parameter, along the line between this vector and the passed -+ * in vector, or null if not possible. -+ */ -+ public Vec3 getIntermediateWithYValue(Vec3 par1Vec3, double par2) { -+ double var4 = par1Vec3.xCoord - this.xCoord; -+ double var6 = par1Vec3.yCoord - this.yCoord; -+ double var8 = par1Vec3.zCoord - this.zCoord; -+ -+ if (var6 * var6 < 1.0000000116860974E-7D) { -+ return null; -+ } else { -+ double var10 = (par2 - this.yCoord) / var6; -+ return var10 >= 0.0D && var10 <= 1.0D ? this.myVec3LocalPool.getVecFromPool(this.xCoord + var4 * var10, this.yCoord + var6 * var10, this.zCoord + var8 * var10) : null; -+ } -+ } -+ -+ /** -+ * Returns a new vector with z value equal to the second parameter, along the line between this vector and the passed -+ * in vector, or null if not possible. -+ */ -+ public Vec3 getIntermediateWithZValue(Vec3 par1Vec3, double par2) { -+ double var4 = par1Vec3.xCoord - this.xCoord; -+ double var6 = par1Vec3.yCoord - this.yCoord; -+ double var8 = par1Vec3.zCoord - this.zCoord; -+ -+ if (var8 * var8 < 1.0000000116860974E-7D) { -+ return null; -+ } else { -+ double var10 = (par2 - this.zCoord) / var8; - return var10 >= 0.0D && var10 <= 1.0D ? this.myVec3LocalPool.getVecFromPool(this.xCoord + var4 * var10, this.yCoord + var6 * var10, this.zCoord + var8 * var10) : null; - } - } -@@ -123,9 +180,12 @@ - return "(" + this.xCoord + ", " + this.yCoord + ", " + this.zCoord + ")"; - } - -- public void rotateAroundX(float var1) { -- float var2 = MathHelper.cos(var1); -- float var3 = MathHelper.sin(var1); -+ /** -+ * Rotates the vector around the x axis by the specified angle. -+ */ -+ public void rotateAroundX(float par1) { -+ float var2 = MathHelper.cos(par1); -+ float var3 = MathHelper.sin(par1); - double var4 = this.xCoord; - double var6 = this.yCoord * (double)var2 + this.zCoord * (double)var3; - double var8 = this.zCoord * (double)var2 - this.yCoord * (double)var3; -@@ -134,9 +194,12 @@ - this.zCoord = var8; - } - -- public void rotateAroundY(float var1) { -- float var2 = MathHelper.cos(var1); -- float var3 = MathHelper.sin(var1); -+ /** -+ * Rotates the vector around the y axis by the specified angle. -+ */ -+ public void rotateAroundY(float par1) { -+ float var2 = MathHelper.cos(par1); -+ float var3 = MathHelper.sin(par1); - double var4 = this.xCoord * (double)var2 + this.zCoord * (double)var3; - double var6 = this.yCoord; - double var8 = this.zCoord * (double)var2 - this.xCoord * (double)var3; -@@ -145,9 +208,12 @@ - this.zCoord = var8; - } - -- public void rotateAroundZ(float var1) { -- float var2 = MathHelper.cos(var1); -- float var3 = MathHelper.sin(var1); -+ /** -+ * Rotates the vector around the z axis by the specified angle. -+ */ -+ public void rotateAroundZ(float par1) { -+ float var2 = MathHelper.cos(par1); -+ float var3 = MathHelper.sin(par1); - double var4 = this.xCoord * (double)var2 + this.yCoord * (double)var3; - double var6 = this.yCoord * (double)var2 - this.xCoord * (double)var3; - double var8 = this.zCoord; ---- /dev/null -+++ org/spoutcraft/api/block/design/Vertex.java -@@ -1,0 +1,117 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.api.block.design; -+ -+public class Vertex { -+ private SubTexture texture; -+ private int index; -+ private int quad; -+ private float x; -+ private float y; -+ private float z; -+ private int tx; -+ private int ty; -+ -+ private Vertex(int index, int quad, float x, float y, float z) { -+ if (index < 0 || index > 3) { -+ throw new IllegalArgumentException("Invalid vertex index: " + index); -+ } -+ this.index = index; -+ this.quad = quad; -+ this.x = x; -+ this.y = y; -+ this.z = z; -+ } -+ -+ public Vertex(int index, int quad, float x, float y, float z, SubTexture texture) { -+ this(index, quad, x, y, z); -+ -+ this.setSubTexture(texture); -+ } -+ -+ public Vertex(int index, int quad, float x, float y, float z, int tx, int ty) { -+ this(index, quad, x, y, z); -+ this.tx = tx; -+ this.ty = ty; -+ } -+ -+ public Vertex setSubTexture(SubTexture texture) { -+ this.texture = texture; -+ -+ switch (this.index) { -+ case 0: -+ this.tx = texture.getXLoc(); -+ this.ty = texture.getYLoc(); -+ break; -+ case 1: -+ this.tx = texture.getXLoc(); -+ this.ty = texture.getYTopLoc(); -+ break; -+ case 2: -+ this.tx = texture.getXTopLoc(); -+ this.ty = texture.getYTopLoc(); -+ break; -+ case 3: -+ this.tx = texture.getXTopLoc(); -+ this.ty = texture.getYLoc(); -+ } -+ -+ return this; -+ } -+ -+ public int getIndex() { -+ return index; -+ } -+ public SubTexture getSubTexture() { -+ return texture; -+ } -+ -+ public float getX() { -+ return x; -+ } -+ -+ public float getY() { -+ return y; -+ } -+ -+ public float getZ() { -+ return z; -+ } -+ -+ public int getTextureX() { -+ return tx; -+ } -+ -+ public int getTextureY() { -+ return ty; -+ } -+ -+ public int getTextureWidth() { -+ return texture.getParent().getWidth(); -+ } -+ -+ public int getTextureHeight() { -+ return texture.getParent().getHeight(); -+ } -+ -+ public int getQuadNum() { -+ return quad; -+ } -+} ---- /dev/null -+++ org/spoutcraft/api/material/Block.java -@@ -1,0 +1,44 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.api.material; -+ -+import org.spoutcraft.api.block.design.BlockDesign; -+ -+public interface Block extends Material{ -+ public float getFriction(); -+ -+ public Block setFriction(float slip); -+ -+ public float getHardness(); -+ -+ public Block setHardness(float hardness); -+ -+ public boolean isOpaque(); -+ -+ public Block setOpaque(boolean opaque); -+ -+ public int getLightLevel(); -+ -+ public Block setLightLevel(int level); -+ -+ public BlockDesign getBlockDesign(); -+ -+ public Block setBlockDesign(BlockDesign design); -+} ---- net/minecraft/src/EntityEnderPearl.java -+++ net/minecraft/src/EntityEnderPearl.java -@@ -1,32 +1,36 @@ - package net.minecraft.src; - - public class EntityEnderPearl extends EntityThrowable { -- public EntityEnderPearl(World var1) { -- super(var1); -- } -- -- public EntityEnderPearl(World var1, EntityLivingBase var2) { -- super(var1, var2); -- } -- -- public EntityEnderPearl(World var1, double var2, double var4, double var6) { -- super(var1, var2, var4, var6); -- } -- -- protected void onImpact(MovingObjectPosition var1) { -- if(var1.entityHit != null) { -- var1.entityHit.attackEntityFrom(DamageSource.causeThrownDamage(this, this.getThrower()), 0.0F); -- } -- -- for(int var2 = 0; var2 < 32; ++var2) { -- this.worldObj.spawnParticle("portal", this.posX, this.posY + this.ab.nextDouble() * 2.0D, this.posZ, this.ab.nextGaussian(), 0.0D, this.ab.nextGaussian()); -- } -- -- if(!this.worldObj.isRemote) { -- if(this.getThrower() != null && this.getThrower() instanceof EntityPlayerMP) { -+ public EntityEnderPearl(World par1World) { -+ super(par1World); -+ } -+ -+ public EntityEnderPearl(World par1World, EntityLivingBase par2EntityLivingBase) { -+ super(par1World, par2EntityLivingBase); -+ } -+ -+ public EntityEnderPearl(World par1World, double par2, double par4, double par6) { -+ super(par1World, par2, par4, par6); -+ } -+ -+ /** -+ * Called when this EntityThrowable hits a block or entity. -+ */ -+ protected void onImpact(MovingObjectPosition par1MovingObjectPosition) { -+ if (par1MovingObjectPosition.entityHit != null) { -+ par1MovingObjectPosition.entityHit.attackEntityFrom(DamageSource.causeThrownDamage(this, this.getThrower()), 0.0F); -+ } -+ -+ for (int var2 = 0; var2 < 32; ++var2) { -+ this.worldObj.spawnParticle("portal", this.posX, this.posY + this.rand.nextDouble() * 2.0D, this.posZ, this.rand.nextGaussian(), 0.0D, this.rand.nextGaussian()); -+ } -+ -+ if (!this.worldObj.isRemote) { -+ if (this.getThrower() != null && this.getThrower() instanceof EntityPlayerMP) { - EntityPlayerMP var3 = (EntityPlayerMP)this.getThrower(); -- if(!var3.playerNetServerHandler.connectionClosed && var3.worldObj == this.worldObj) { -- if(this.getThrower().isRiding()) { -+ -+ if (!var3.playerNetServerHandler.connectionClosed && var3.worldObj == this.worldObj) { -+ if (this.getThrower().isRiding()) { - this.getThrower().mountEntity((Entity)null); - } - -@@ -38,6 +42,5 @@ - - this.setDead(); - } -- - } - } ---- net/minecraft/src/RenderLeashKnot.java -+++ net/minecraft/src/RenderLeashKnot.java -@@ -7,28 +7,37 @@ - private static final ResourceLocation leashKnotTextures = new ResourceLocation("textures/entity/lead_knot.png"); - private ModelLeashKnot leashKnotModel = new ModelLeashKnot(); - -- public void func_110799_a(EntityLeashKnot var1, double var2, double var4, double var6, float var8, float var9) { -+ public void func_110799_a(EntityLeashKnot par1EntityLeashKnot, double par2, double par4, double par6, float par8, float par9) { - GL11.glPushMatrix(); - GL11.glDisable(GL11.GL_CULL_FACE); -- GL11.glTranslatef((float)var2, (float)var4, (float)var6); -- float var10 = 1.0F / 16.0F; -+ GL11.glTranslatef((float)par2, (float)par4, (float)par6); -+ float var10 = 0.0625F; - GL11.glEnable(GL12.GL_RESCALE_NORMAL); - GL11.glScalef(-1.0F, -1.0F, 1.0F); - GL11.glEnable(GL11.GL_ALPHA_TEST); -- this.bindEntityTexture(var1); -- this.leashKnotModel.render(var1, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, var10); -+ this.bindEntityTexture(par1EntityLeashKnot); -+ this.leashKnotModel.render(par1EntityLeashKnot, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, var10); - GL11.glPopMatrix(); - } - -- protected ResourceLocation getLeashKnotTextures(EntityLeashKnot var1) { -+ protected ResourceLocation getLeashKnotTextures(EntityLeashKnot par1EntityLeashKnot) { - return leashKnotTextures; - } - -- protected ResourceLocation getEntityTexture(Entity var1) { -- return this.getLeashKnotTextures((EntityLeashKnot)var1); -+ /** -+ * Returns the location of an entity's texture. Doesn't seem to be called unless you call Render.bindEntityTexture. -+ */ -+ protected ResourceLocation getEntityTexture(Entity par1Entity) { -+ return this.getLeashKnotTextures((EntityLeashKnot)par1Entity); - } - -- public void doRender(Entity var1, double var2, double var4, double var6, float var8, float var9) { -- this.func_110799_a((EntityLeashKnot)var1, var2, var4, var6, var8, var9); -+ /** -+ * Actually renders the given argument. This is a synthetic bridge method, always casting down its argument and then -+ * handing it off to a worker function which does the actual work. In all probabilty, the class Render is generic -+ * (Render 1.0F) { -+ if (var2 > 1.0F) { - var2 = 1.0F; - } - -- int var3 = super.getBrightnessForRender(var1); -+ int var3 = super.getBrightnessForRender(par1); - int var4 = var3 & 255; - int var5 = var3 >> 16 & 255; - var4 += (int)(var2 * 15.0F * 16.0F); -- if(var4 > 240) { -+ -+ if (var4 > 240) { - var4 = 240; - } - - return var4 | var5 << 16; - } - -- public float getBrightness(float var1) { -- float var2 = ((float)this.particleAge + var1) / (float)this.particleMaxAge; -- if(var2 < 0.0F) { -+ /** -+ * Gets how bright this entity is. -+ */ -+ public float getBrightness(float par1) { -+ float var2 = ((float)this.particleAge + par1) / (float)this.particleMaxAge; -+ -+ if (var2 < 0.0F) { - var2 = 0.0F; - } - -- if(var2 > 1.0F) { -+ if (var2 > 1.0F) { - var2 = 1.0F; - } - -- float var3 = super.getBrightness(var1); -+ float var3 = super.getBrightness(par1); - return var3 * var2 + (1.0F - var2); - } - -+ /** -+ * Called to update the entity's position/logic. -+ */ - public void onUpdate() { - this.prevPosX = this.posX; - this.prevPosY = this.posY; - this.prevPosZ = this.posZ; -- if(this.particleAge++ >= this.particleMaxAge) { -+ -+ if (this.particleAge++ >= this.particleMaxAge) { - this.setDead(); - } - - this.moveEntity(this.motionX, this.motionY, this.motionZ); -- this.motionX *= (double)0.96F; -- this.motionY *= (double)0.96F; -- this.motionZ *= (double)0.96F; -- if(this.onGround) { -- this.motionX *= (double)0.7F; -- this.motionZ *= (double)0.7F; -- } -+ this.motionX *= 0.9599999785423279D; -+ this.motionY *= 0.9599999785423279D; -+ this.motionZ *= 0.9599999785423279D; - -+ if (this.onGround) { -+ this.motionX *= 0.699999988079071D; -+ this.motionZ *= 0.699999988079071D; -+ } - } - } ---- /dev/null -+++ org/spoutcraft/client/gui/server/ServerSlot.java -@@ -1,0 +1,57 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.client.gui.server; -+ -+public class ServerSlot implements Comparable { -+ public int ID = 0; -+ public int uniqueid = 0; -+ public String ip = ""; -+ public String port = ""; -+ public String name = ""; -+ public int players = 0; -+ public int maxPlayers = 0; -+ public String country = ""; -+ public boolean pinging = false; -+ public long ping = -2L; -+ public String status = ""; -+ public String msg = ""; -+ public String description = ""; -+ public String site = ""; -+ public String forum = ""; -+ public int loaded = 0; -+ -+ public ServerSlot(int ID) { -+ this.ID = ID; -+ } -+ -+ public int compareTo(ServerSlot other) { -+ return other.players - this.players; -+ } -+ -+ public String getFullIp() { -+ return ip + (port.length() > 0 ? ":" : "") + port; -+ } -+ -+ // $FF: synthetic method -+ // $FF: bridge method -+ public int compareTo(Object other) { -+ return this.compareTo((ServerSlot)other); -+ } -+} ---- net/minecraft/src/GenLayer.java -+++ net/minecraft/src/GenLayer.java -@@ -1,12 +1,27 @@ - package net.minecraft.src; - - public abstract class GenLayer { -+ -+ /** seed from World#getWorldSeed that is used in the LCG prng */ - private long worldGenSeed; -+ -+ /** parent GenLayer that was provided via the constructor */ - protected GenLayer parent; -+ -+ /** -+ * final part of the LCG prng that uses the chunk X, Z coords along with the other two seeds to generate pseudorandom -+ * numbers -+ */ - private long chunkSeed; -+ -+ /** base seed to the LCG prng provided via the constructor */ - private long baseSeed; - -- public static GenLayer[] initializeAllBiomeGenerators(long var0, WorldType var2) { -+ /** -+ * the first array item is a linked list of the bioms, the second is the zoom function, the third is the same as the -+ * first. -+ */ -+ public static GenLayer[] initializeAllBiomeGenerators(long par0, WorldType par2WorldType) { - GenLayerIsland var3 = new GenLayerIsland(1L); - GenLayerFuzzyZoom var9 = new GenLayerFuzzyZoom(2000L, var3); - GenLayerAddIsland var10 = new GenLayerAddIsland(1L, var9); -@@ -19,7 +34,8 @@ - var10 = new GenLayerAddIsland(4L, var11); - GenLayerAddMushroomIsland var15 = new GenLayerAddMushroomIsland(5L, var10); - byte var4 = 4; -- if(var2 == WorldType.LARGE_BIOMES) { -+ -+ if (par2WorldType == WorldType.LARGE_BIOMES) { - var4 = 6; - } - -@@ -29,21 +45,22 @@ - GenLayerRiver var14 = new GenLayerRiver(1L, var5); - GenLayerSmooth var16 = new GenLayerSmooth(1000L, var14); - GenLayer var6 = GenLayerZoom.magnify(1000L, var15, 0); -- GenLayerBiome var17 = new GenLayerBiome(200L, var6, var2); -+ GenLayerBiome var17 = new GenLayerBiome(200L, var6, par2WorldType); - var6 = GenLayerZoom.magnify(1000L, var17, 2); - Object var18 = new GenLayerHills(1000L, var6); - -- for(int var7 = 0; var7 < var4; ++var7) { -+ for (int var7 = 0; var7 < var4; ++var7) { - var18 = new GenLayerZoom((long)(1000 + var7), (GenLayer)var18); -- if(var7 == 0) { -+ -+ if (var7 == 0) { - var18 = new GenLayerAddIsland(3L, (GenLayer)var18); - } - -- if(var7 == 1) { -+ if (var7 == 1) { - var18 = new GenLayerShore(1000L, (GenLayer)var18); - } - -- if(var7 == 1) { -+ if (var7 == 1) { - var18 = new GenLayerSwampRivers(1000L, (GenLayer)var18); - } - } -@@ -51,25 +68,30 @@ - GenLayerSmooth var19 = new GenLayerSmooth(1000L, (GenLayer)var18); - GenLayerRiverMix var20 = new GenLayerRiverMix(100L, var19, var16); - GenLayerVoronoiZoom var8 = new GenLayerVoronoiZoom(10L, var20); -- var20.initWorldGenSeed(var0); -- var8.initWorldGenSeed(var0); -- return new GenLayer[]{var20, var8, var20}; -- } -- -- public GenLayer(long var1) { -- this.baseSeed = var1; -- this.baseSeed *= this.baseSeed * 6364136223846793005L + 1442695040888963407L; -- this.baseSeed += var1; -- this.baseSeed *= this.baseSeed * 6364136223846793005L + 1442695040888963407L; -- this.baseSeed += var1; -- this.baseSeed *= this.baseSeed * 6364136223846793005L + 1442695040888963407L; -- this.baseSeed += var1; -- } -- -- public void initWorldGenSeed(long var1) { -- this.worldGenSeed = var1; -- if(this.parent != null) { -- this.parent.initWorldGenSeed(var1); -+ var20.initWorldGenSeed(par0); -+ var8.initWorldGenSeed(par0); -+ return new GenLayer[] {var20, var8, var20}; -+ } -+ -+ public GenLayer(long par1) { -+ this.baseSeed = par1; -+ this.baseSeed *= this.baseSeed * 6364136223846793005L + 1442695040888963407L; -+ this.baseSeed += par1; -+ this.baseSeed *= this.baseSeed * 6364136223846793005L + 1442695040888963407L; -+ this.baseSeed += par1; -+ this.baseSeed *= this.baseSeed * 6364136223846793005L + 1442695040888963407L; -+ this.baseSeed += par1; -+ } -+ -+ /** -+ * Initialize layer's local worldGenSeed based on its own baseSeed and the world's global seed (passed in as an -+ * argument). -+ */ -+ public void initWorldGenSeed(long par1) { -+ this.worldGenSeed = par1; -+ -+ if (this.parent != null) { -+ this.parent.initWorldGenSeed(par1); - } - - this.worldGenSeed *= this.worldGenSeed * 6364136223846793005L + 1442695040888963407L; -@@ -80,22 +102,29 @@ - this.worldGenSeed += this.baseSeed; - } - -- public void initChunkSeed(long var1, long var3) { -+ /** -+ * Initialize layer's current chunkSeed based on the local worldGenSeed and the (x,z) chunk coordinates. -+ */ -+ public void initChunkSeed(long par1, long par3) { - this.chunkSeed = this.worldGenSeed; - this.chunkSeed *= this.chunkSeed * 6364136223846793005L + 1442695040888963407L; -- this.chunkSeed += var1; -- this.chunkSeed *= this.chunkSeed * 6364136223846793005L + 1442695040888963407L; -- this.chunkSeed += var3; -- this.chunkSeed *= this.chunkSeed * 6364136223846793005L + 1442695040888963407L; -- this.chunkSeed += var1; -- this.chunkSeed *= this.chunkSeed * 6364136223846793005L + 1442695040888963407L; -- this.chunkSeed += var3; -+ this.chunkSeed += par1; -+ this.chunkSeed *= this.chunkSeed * 6364136223846793005L + 1442695040888963407L; -+ this.chunkSeed += par3; -+ this.chunkSeed *= this.chunkSeed * 6364136223846793005L + 1442695040888963407L; -+ this.chunkSeed += par1; -+ this.chunkSeed *= this.chunkSeed * 6364136223846793005L + 1442695040888963407L; -+ this.chunkSeed += par3; - } - -- protected int nextInt(int var1) { -- int var2 = (int)((this.chunkSeed >> 24) % (long)var1); -- if(var2 < 0) { -- var2 += var1; -+ /** -+ * returns a LCG pseudo random number from [0, x). Args: int x -+ */ -+ protected int nextInt(int par1) { -+ int var2 = (int)((this.chunkSeed >> 24) % (long)par1); -+ -+ if (var2 < 0) { -+ var2 += par1; - } - - this.chunkSeed *= this.chunkSeed * 6364136223846793005L + 1442695040888963407L; -@@ -103,5 +132,9 @@ - return var2; - } - -+ /** -+ * Returns a list of integer values generated by this layer. These may be interpreted as temperatures, rainfall -+ * amounts, or biomeList[] indices based on the particular GenLayer subclass. -+ */ - public abstract int[] getInts(int var1, int var2, int var3, int var4); - } ---- /dev/null -+++ org/spoutcraft/api/gui/GenericEntityWidget.java -@@ -1,0 +1,73 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.api.gui; -+ -+import java.io.IOException; -+ -+import org.spoutcraft.api.Spoutcraft; -+import org.spoutcraft.api.UnsafeClass; -+import org.spoutcraft.api.io.SpoutInputStream; -+import org.spoutcraft.api.io.SpoutOutputStream; -+ -+@UnsafeClass -+public class GenericEntityWidget extends GenericWidget implements EntityWidget { -+ private int entityId = 0; -+ -+ public GenericEntityWidget() { -+ } -+ -+ public GenericEntityWidget(int entityId) { -+ this.entityId = entityId; -+ } -+ -+ public WidgetType getType() { -+ return WidgetType.EntityWidget; -+ } -+ -+ public EntityWidget setEntityId(int id) { -+ entityId = id; -+ return this; -+ } -+ -+ public int getEntityId() { -+ return entityId; -+ } -+ -+ @Override -+ public void readData(SpoutInputStream input) throws IOException { -+ super.readData(input); -+ entityId = input.readInt(); -+ } -+ -+ @Override -+ public void writeData(SpoutOutputStream output) throws IOException { -+ super.writeData(output); -+ output.writeInt(entityId); -+ } -+ -+ @Override -+ public EntityWidget copy() { -+ return ((EntityWidget)super.copy()).setEntityId(getEntityId()); -+ } -+ -+ public void render() { -+ Spoutcraft.getClient().getRenderDelegate().render(this); -+ } -+} ---- net/minecraft/src/NoiseGeneratorPerlin.java -+++ net/minecraft/src/NoiseGeneratorPerlin.java -@@ -12,45 +12,49 @@ - this(new Random()); - } - -- public NoiseGeneratorPerlin(Random var1) { -+ public NoiseGeneratorPerlin(Random par1Random) { - this.permutations = new int[512]; -- this.xCoord = var1.nextDouble() * 256.0D; -- this.yCoord = var1.nextDouble() * 256.0D; -- this.zCoord = var1.nextDouble() * 256.0D; -- -+ this.xCoord = par1Random.nextDouble() * 256.0D; -+ this.yCoord = par1Random.nextDouble() * 256.0D; -+ this.zCoord = par1Random.nextDouble() * 256.0D; - int var2; -- for(var2 = 0; var2 < 256; this.permutations[var2] = var2++) { -+ -+ for (var2 = 0; var2 < 256; this.permutations[var2] = var2++) { -+ ; - } - -- for(var2 = 0; var2 < 256; ++var2) { -- int var3 = var1.nextInt(256 - var2) + var2; -+ for (var2 = 0; var2 < 256; ++var2) { -+ int var3 = par1Random.nextInt(256 - var2) + var2; - int var4 = this.permutations[var2]; - this.permutations[var2] = this.permutations[var3]; - this.permutations[var3] = var4; - this.permutations[var2 + 256] = this.permutations[var2]; - } -- -- } -- -- public final double lerp(double var1, double var3, double var5) { -- return var3 + var1 * (var5 - var3); -- } -- -- public final double func_76309_a(int var1, double var2, double var4) { -- int var6 = var1 & 15; -- double var7 = (double)(1 - ((var6 & 8) >> 3)) * var2; -- double var9 = var6 < 4 ? 0.0D : (var6 != 12 && var6 != 14 ? var4 : var2); -+ } -+ -+ public final double lerp(double par1, double par3, double par5) { -+ return par3 + par1 * (par5 - par3); -+ } -+ -+ public final double func_76309_a(int par1, double par2, double par4) { -+ int var6 = par1 & 15; -+ double var7 = (double)(1 - ((var6 & 8) >> 3)) * par2; -+ double var9 = var6 < 4 ? 0.0D : (var6 != 12 && var6 != 14 ? par4 : par2); - return ((var6 & 1) == 0 ? var7 : -var7) + ((var6 & 2) == 0 ? var9 : -var9); - } - -- public final double grad(int var1, double var2, double var4, double var6) { -- int var8 = var1 & 15; -- double var9 = var8 < 8 ? var2 : var4; -- double var11 = var8 < 4 ? var4 : (var8 != 12 && var8 != 14 ? var6 : var2); -+ public final double grad(int par1, double par2, double par4, double par6) { -+ int var8 = par1 & 15; -+ double var9 = var8 < 8 ? par2 : par4; -+ double var11 = var8 < 4 ? par4 : (var8 != 12 && var8 != 14 ? par6 : par2); - return ((var8 & 1) == 0 ? var9 : -var9) + ((var8 & 2) == 0 ? var11 : -var11); - } - -- public void populateNoiseArray(double[] var1, double var2, double var4, double var6, int var8, int var9, int var10, double var11, double var13, double var15, double var17) { -+ /** -+ * pars: noiseArray , xOffset , yOffset , zOffset , xSize , ySize , zSize , xScale, yScale , zScale , noiseScale. -+ * noiseArray should be xSize*ySize*zSize in size -+ */ -+ public void populateNoiseArray(double[] par1ArrayOfDouble, double par2, double par4, double par6, int par8, int par9, int par10, double par11, double par13, double par15, double par17) { - int var10001; - int var19; - int var22; -@@ -62,7 +66,8 @@ - int var41; - double var42; - int var75; -- if(var9 == 1) { -+ -+ if (par9 == 1) { - boolean var64 = false; - boolean var65 = false; - boolean var21 = false; -@@ -70,12 +75,13 @@ - double var70 = 0.0D; - double var73 = 0.0D; - var75 = 0; -- double var77 = 1.0D / var17; -+ double var77 = 1.0D / par17; - -- for(int var30 = 0; var30 < var8; ++var30) { -- var31 = var2 + (double)var30 * var11 + this.xCoord; -+ for (int var30 = 0; var30 < par8; ++var30) { -+ var31 = par2 + (double)var30 * par11 + this.xCoord; - int var78 = (int)var31; -- if(var31 < (double)var78) { -+ -+ if (var31 < (double)var78) { - --var78; - } - -@@ -83,10 +89,11 @@ - var31 -= (double)var78; - var35 = var31 * var31 * var31 * (var31 * (var31 * 6.0D - 15.0D) + 10.0D); - -- for(var37 = 0; var37 < var10; ++var37) { -- var38 = var6 + (double)var37 * var15 + this.zCoord; -+ for (var37 = 0; var37 < par10; ++var37) { -+ var38 = par6 + (double)var37 * par15 + this.zCoord; - var40 = (int)var38; -- if(var38 < (double)var40) { -+ -+ if (var38 < (double)var40) { - --var40; - } - -@@ -101,13 +108,12 @@ - var73 = this.lerp(var35, this.grad(this.permutations[var66 + 1], var31, 0.0D, var38 - 1.0D), this.grad(this.permutations[var22 + 1], var31 - 1.0D, 0.0D, var38 - 1.0D)); - double var79 = this.lerp(var42, var70, var73); - var10001 = var75++; -- var1[var10001] += var79 * var77; -+ par1ArrayOfDouble[var10001] += var79 * var77; - } - } -- - } else { - var19 = 0; -- double var20 = 1.0D / var17; -+ double var20 = 1.0D / par17; - var22 = -1; - boolean var23 = false; - boolean var24 = false; -@@ -120,10 +126,11 @@ - double var33 = 0.0D; - var35 = 0.0D; - -- for(var37 = 0; var37 < var8; ++var37) { -- var38 = var2 + (double)var37 * var11 + this.xCoord; -+ for (var37 = 0; var37 < par8; ++var37) { -+ var38 = par2 + (double)var37 * par11 + this.xCoord; - var40 = (int)var38; -- if(var38 < (double)var40) { -+ -+ if (var38 < (double)var40) { - --var40; - } - -@@ -131,10 +138,11 @@ - var38 -= (double)var40; - var42 = var38 * var38 * var38 * (var38 * (var38 * 6.0D - 15.0D) + 10.0D); - -- for(int var44 = 0; var44 < var10; ++var44) { -- double var45 = var6 + (double)var44 * var15 + this.zCoord; -+ for (int var44 = 0; var44 < par10; ++var44) { -+ double var45 = par6 + (double)var44 * par15 + this.zCoord; - int var47 = (int)var45; -- if(var45 < (double)var47) { -+ -+ if (var45 < (double)var47) { - --var47; - } - -@@ -142,17 +150,19 @@ - var45 -= (double)var47; - double var49 = var45 * var45 * var45 * (var45 * (var45 * 6.0D - 15.0D) + 10.0D); - -- for(int var51 = 0; var51 < var9; ++var51) { -- double var52 = var4 + (double)var51 * var13 + this.yCoord; -+ for (int var51 = 0; var51 < par9; ++var51) { -+ double var52 = par4 + (double)var51 * par13 + this.yCoord; - int var54 = (int)var52; -- if(var52 < (double)var54) { -+ -+ if (var52 < (double)var54) { - --var54; - } - - int var55 = var54 & 255; - var52 -= (double)var54; - double var56 = var52 * var52 * var52 * (var52 * (var52 * 6.0D - 15.0D) + 10.0D); -- if(var51 == 0 || var55 != var22) { -+ -+ if (var51 == 0 || var55 != var22) { - var22 = var55; - int var69 = this.permutations[var41] + var55; - int var71 = this.permutations[var69] + var48; -@@ -170,11 +180,10 @@ - double var60 = this.lerp(var56, var33, var35); - double var62 = this.lerp(var49, var58, var60); - var10001 = var19++; -- var1[var10001] += var62 * var20; -+ par1ArrayOfDouble[var10001] += var62 * var20; - } - } - } -- - } - } - } ---- /dev/null -+++ org/spoutcraft/api/TreeType.java -@@ -1,0 +1,31 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.api; -+ -+/** -+ * Tree type. -+ */ -+public enum TreeType { -+ TREE, -+ BIG_TREE, -+ REDWOOD, -+ TALL_REDWOOD, -+ BIRCH -+} ---- net/minecraft/src/ComponentNetherBridgePiece.java -+++ net/minecraft/src/ComponentNetherBridgePiece.java -@@ -5,29 +5,27 @@ - import java.util.Random; - - abstract class ComponentNetherBridgePiece extends StructureComponent { -- protected static final WeightedRandomChestContent[] field_111019_a = new WeightedRandomChestContent[]{new WeightedRandomChestContent(Item.diamond.itemID, 0, 1, 3, 5), new WeightedRandomChestContent(Item.ingotIron.itemID, 0, 1, 5, 5), new WeightedRandomChestContent(Item.ingotGold.itemID, 0, 1, 3, 15), new WeightedRandomChestContent(Item.swordGold.itemID, 0, 1, 1, 5), new WeightedRandomChestContent(Item.plateGold.itemID, 0, 1, 1, 5), new WeightedRandomChestContent(Item.flintAndSteel.itemID, 0, 1, 1, 5), new WeightedRandomChestContent(Item.netherStalkSeeds.itemID, 0, 3, 7, 5), new WeightedRandomChestContent(Item.saddle.itemID, 0, 1, 1, 10), new WeightedRandomChestContent(Item.horseArmorGold.itemID, 0, 1, 1, 8), new WeightedRandomChestContent(Item.horseArmorIron.itemID, 0, 1, 1, 5), new WeightedRandomChestContent(Item.horseArmorDiamond.itemID, 0, 1, 1, 3)}; -- -- public ComponentNetherBridgePiece() { -- } -- -- protected ComponentNetherBridgePiece(int var1) { -- super(var1); -- } -- -- protected void func_143011_b(NBTTagCompound var1) { -- } -- -- protected void func_143012_a(NBTTagCompound var1) { -- } -- -- private int getTotalWeight(List var1) { -+ protected static final WeightedRandomChestContent[] field_111019_a = new WeightedRandomChestContent[] {new WeightedRandomChestContent(Item.diamond.itemID, 0, 1, 3, 5), new WeightedRandomChestContent(Item.ingotIron.itemID, 0, 1, 5, 5), new WeightedRandomChestContent(Item.ingotGold.itemID, 0, 1, 3, 15), new WeightedRandomChestContent(Item.swordGold.itemID, 0, 1, 1, 5), new WeightedRandomChestContent(Item.plateGold.itemID, 0, 1, 1, 5), new WeightedRandomChestContent(Item.flintAndSteel.itemID, 0, 1, 1, 5), new WeightedRandomChestContent(Item.netherStalkSeeds.itemID, 0, 3, 7, 5), new WeightedRandomChestContent(Item.saddle.itemID, 0, 1, 1, 10), new WeightedRandomChestContent(Item.horseArmorGold.itemID, 0, 1, 1, 8), new WeightedRandomChestContent(Item.horseArmorIron.itemID, 0, 1, 1, 5), new WeightedRandomChestContent(Item.horseArmorDiamond.itemID, 0, 1, 1, 3)}; -+ -+ public ComponentNetherBridgePiece() {} -+ -+ protected ComponentNetherBridgePiece(int par1) { -+ super(par1); -+ } -+ -+ protected void func_143011_b(NBTTagCompound par1NBTTagCompound) {} -+ -+ protected void func_143012_a(NBTTagCompound par1NBTTagCompound) {} -+ -+ private int getTotalWeight(List par1List) { - boolean var2 = false; - int var3 = 0; -- - StructureNetherBridgePieceWeight var5; -- for(Iterator var4 = var1.iterator(); var4.hasNext(); var3 += var5.field_78826_b) { -+ -+ for (Iterator var4 = par1List.iterator(); var4.hasNext(); var3 += var5.field_78826_b) { - var5 = (StructureNetherBridgePieceWeight)var4.next(); -- if(var5.field_78824_d > 0 && var5.field_78827_c < var5.field_78824_d) { -+ -+ if (var5.field_78824_d > 0 && var5.field_78827_c < var5.field_78824_d) { - var2 = true; - } - } -@@ -35,30 +33,33 @@ - return var2 ? var3 : -1; - } - -- private ComponentNetherBridgePiece getNextComponent(ComponentNetherBridgeStartPiece var1, List var2, List var3, Random var4, int var5, int var6, int var7, int var8, int var9) { -- int var10 = this.getTotalWeight(var2); -- boolean var11 = var10 > 0 && var9 <= 30; -+ private ComponentNetherBridgePiece getNextComponent(ComponentNetherBridgeStartPiece par1ComponentNetherBridgeStartPiece, List par2List, List par3List, Random par4Random, int par5, int par6, int par7, int par8, int par9) { -+ int var10 = this.getTotalWeight(par2List); -+ boolean var11 = var10 > 0 && par9 <= 30; - int var12 = 0; - -- while(var12 < 5 && var11) { -+ while (var12 < 5 && var11) { - ++var12; -- int var13 = var4.nextInt(var10); -- Iterator var14 = var2.iterator(); -+ int var13 = par4Random.nextInt(var10); -+ Iterator var14 = par2List.iterator(); - -- while(var14.hasNext()) { -+ while (var14.hasNext()) { - StructureNetherBridgePieceWeight var15 = (StructureNetherBridgePieceWeight)var14.next(); - var13 -= var15.field_78826_b; -- if(var13 < 0) { -- if(!var15.func_78822_a(var9) || var15 == var1.theNetherBridgePieceWeight && !var15.field_78825_e) { -+ -+ if (var13 < 0) { -+ if (!var15.func_78822_a(par9) || var15 == par1ComponentNetherBridgeStartPiece.theNetherBridgePieceWeight && !var15.field_78825_e) { - break; - } - -- ComponentNetherBridgePiece var16 = StructureNetherBridgePieces.createNextComponent(var15, var3, var4, var5, var6, var7, var8, var9); -- if(var16 != null) { -+ ComponentNetherBridgePiece var16 = StructureNetherBridgePieces.createNextComponent(var15, par3List, par4Random, par5, par6, par7, par8, par9); -+ -+ if (var16 != null) { - ++var15.field_78827_c; -- var1.theNetherBridgePieceWeight = var15; -- if(!var15.func_78823_a()) { -- var2.remove(var15); -+ par1ComponentNetherBridgeStartPiece.theNetherBridgePieceWeight = var15; -+ -+ if (!var15.func_78823_a()) { -+ par2List.remove(var15); - } - - return var16; -@@ -67,74 +68,103 @@ - } - } - -- return ComponentNetherBridgeEnd.func_74971_a(var3, var4, var5, var6, var7, var8, var9); -+ return ComponentNetherBridgeEnd.func_74971_a(par3List, par4Random, par5, par6, par7, par8, par9); - } - -- private StructureComponent getNextComponent(ComponentNetherBridgeStartPiece var1, List var2, Random var3, int var4, int var5, int var6, int var7, int var8, boolean var9) { -- if(Math.abs(var4 - var1.getBoundingBox().minX) <= 112 && Math.abs(var6 - var1.getBoundingBox().minZ) <= 112) { -- List var10 = var1.c; -- if(var9) { -- var10 = var1.d; -+ /** -+ * Finds a random component to tack on to the bridge. Or builds the end. -+ */ -+ private StructureComponent getNextComponent(ComponentNetherBridgeStartPiece par1ComponentNetherBridgeStartPiece, List par2List, Random par3Random, int par4, int par5, int par6, int par7, int par8, boolean par9) { -+ if (Math.abs(par4 - par1ComponentNetherBridgeStartPiece.getBoundingBox().minX) <= 112 && Math.abs(par6 - par1ComponentNetherBridgeStartPiece.getBoundingBox().minZ) <= 112) { -+ List var10 = par1ComponentNetherBridgeStartPiece.primaryWeights; -+ -+ if (par9) { -+ var10 = par1ComponentNetherBridgeStartPiece.secondaryWeights; - } - -- ComponentNetherBridgePiece var11 = this.getNextComponent(var1, var10, var2, var3, var4, var5, var6, var7, var8 + 1); -- if(var11 != null) { -- var2.add(var11); -- var1.e.add(var11); -+ ComponentNetherBridgePiece var11 = this.getNextComponent(par1ComponentNetherBridgeStartPiece, var10, par2List, par3Random, par4, par5, par6, par7, par8 + 1); -+ -+ if (var11 != null) { -+ par2List.add(var11); -+ par1ComponentNetherBridgeStartPiece.field_74967_d.add(var11); - } - - return var11; - } else { -- return ComponentNetherBridgeEnd.func_74971_a(var2, var3, var4, var5, var6, var7, var8); -- } -- } -- -- protected StructureComponent getNextComponentNormal(ComponentNetherBridgeStartPiece var1, List var2, Random var3, int var4, int var5, boolean var6) { -- switch(this.coordBaseMode) { -- case 0: -- return this.getNextComponent(var1, var2, var3, this.boundingBox.minX + var4, this.boundingBox.minY + var5, this.boundingBox.maxZ + 1, this.coordBaseMode, this.getComponentType(), var6); -- case 1: -- return this.getNextComponent(var1, var2, var3, this.boundingBox.minX - 1, this.boundingBox.minY + var5, this.boundingBox.minZ + var4, this.coordBaseMode, this.getComponentType(), var6); -- case 2: -- return this.getNextComponent(var1, var2, var3, this.boundingBox.minX + var4, this.boundingBox.minY + var5, this.boundingBox.minZ - 1, this.coordBaseMode, this.getComponentType(), var6); -- case 3: -- return this.getNextComponent(var1, var2, var3, this.boundingBox.maxX + 1, this.boundingBox.minY + var5, this.boundingBox.minZ + var4, this.coordBaseMode, this.getComponentType(), var6); -- default: -- return null; -- } -- } -- -- protected StructureComponent getNextComponentX(ComponentNetherBridgeStartPiece var1, List var2, Random var3, int var4, int var5, boolean var6) { -- switch(this.coordBaseMode) { -- case 0: -- return this.getNextComponent(var1, var2, var3, this.boundingBox.minX - 1, this.boundingBox.minY + var4, this.boundingBox.minZ + var5, 1, this.getComponentType(), var6); -- case 1: -- return this.getNextComponent(var1, var2, var3, this.boundingBox.minX + var5, this.boundingBox.minY + var4, this.boundingBox.minZ - 1, 2, this.getComponentType(), var6); -- case 2: -- return this.getNextComponent(var1, var2, var3, this.boundingBox.minX - 1, this.boundingBox.minY + var4, this.boundingBox.minZ + var5, 1, this.getComponentType(), var6); -- case 3: -- return this.getNextComponent(var1, var2, var3, this.boundingBox.minX + var5, this.boundingBox.minY + var4, this.boundingBox.minZ - 1, 2, this.getComponentType(), var6); -- default: -- return null; -- } -- } -- -- protected StructureComponent getNextComponentZ(ComponentNetherBridgeStartPiece var1, List var2, Random var3, int var4, int var5, boolean var6) { -- switch(this.coordBaseMode) { -- case 0: -- return this.getNextComponent(var1, var2, var3, this.boundingBox.maxX + 1, this.boundingBox.minY + var4, this.boundingBox.minZ + var5, 3, this.getComponentType(), var6); -- case 1: -- return this.getNextComponent(var1, var2, var3, this.boundingBox.minX + var5, this.boundingBox.minY + var4, this.boundingBox.maxZ + 1, 0, this.getComponentType(), var6); -- case 2: -- return this.getNextComponent(var1, var2, var3, this.boundingBox.maxX + 1, this.boundingBox.minY + var4, this.boundingBox.minZ + var5, 3, this.getComponentType(), var6); -- case 3: -- return this.getNextComponent(var1, var2, var3, this.boundingBox.minX + var5, this.boundingBox.minY + var4, this.boundingBox.maxZ + 1, 0, this.getComponentType(), var6); -- default: -- return null; -- } -- } -- -- protected static boolean isAboveGround(StructureBoundingBox var0) { -- return var0 != null && var0.minY > 10; -+ return ComponentNetherBridgeEnd.func_74971_a(par2List, par3Random, par4, par5, par6, par7, par8); -+ } -+ } -+ -+ /** -+ * Gets the next component in any cardinal direction -+ */ -+ protected StructureComponent getNextComponentNormal(ComponentNetherBridgeStartPiece par1ComponentNetherBridgeStartPiece, List par2List, Random par3Random, int par4, int par5, boolean par6) { -+ switch (this.coordBaseMode) { -+ case 0: -+ return this.getNextComponent(par1ComponentNetherBridgeStartPiece, par2List, par3Random, this.boundingBox.minX + par4, this.boundingBox.minY + par5, this.boundingBox.maxZ + 1, this.coordBaseMode, this.getComponentType(), par6); -+ -+ case 1: -+ return this.getNextComponent(par1ComponentNetherBridgeStartPiece, par2List, par3Random, this.boundingBox.minX - 1, this.boundingBox.minY + par5, this.boundingBox.minZ + par4, this.coordBaseMode, this.getComponentType(), par6); -+ -+ case 2: -+ return this.getNextComponent(par1ComponentNetherBridgeStartPiece, par2List, par3Random, this.boundingBox.minX + par4, this.boundingBox.minY + par5, this.boundingBox.minZ - 1, this.coordBaseMode, this.getComponentType(), par6); -+ -+ case 3: -+ return this.getNextComponent(par1ComponentNetherBridgeStartPiece, par2List, par3Random, this.boundingBox.maxX + 1, this.boundingBox.minY + par5, this.boundingBox.minZ + par4, this.coordBaseMode, this.getComponentType(), par6); -+ -+ default: -+ return null; -+ } -+ } -+ -+ /** -+ * Gets the next component in the +/- X direction -+ */ -+ protected StructureComponent getNextComponentX(ComponentNetherBridgeStartPiece par1ComponentNetherBridgeStartPiece, List par2List, Random par3Random, int par4, int par5, boolean par6) { -+ switch (this.coordBaseMode) { -+ case 0: -+ return this.getNextComponent(par1ComponentNetherBridgeStartPiece, par2List, par3Random, this.boundingBox.minX - 1, this.boundingBox.minY + par4, this.boundingBox.minZ + par5, 1, this.getComponentType(), par6); -+ -+ case 1: -+ return this.getNextComponent(par1ComponentNetherBridgeStartPiece, par2List, par3Random, this.boundingBox.minX + par5, this.boundingBox.minY + par4, this.boundingBox.minZ - 1, 2, this.getComponentType(), par6); -+ -+ case 2: -+ return this.getNextComponent(par1ComponentNetherBridgeStartPiece, par2List, par3Random, this.boundingBox.minX - 1, this.boundingBox.minY + par4, this.boundingBox.minZ + par5, 1, this.getComponentType(), par6); -+ -+ case 3: -+ return this.getNextComponent(par1ComponentNetherBridgeStartPiece, par2List, par3Random, this.boundingBox.minX + par5, this.boundingBox.minY + par4, this.boundingBox.minZ - 1, 2, this.getComponentType(), par6); -+ -+ default: -+ return null; -+ } -+ } -+ -+ /** -+ * Gets the next component in the +/- Z direction -+ */ -+ protected StructureComponent getNextComponentZ(ComponentNetherBridgeStartPiece par1ComponentNetherBridgeStartPiece, List par2List, Random par3Random, int par4, int par5, boolean par6) { -+ switch (this.coordBaseMode) { -+ case 0: -+ return this.getNextComponent(par1ComponentNetherBridgeStartPiece, par2List, par3Random, this.boundingBox.maxX + 1, this.boundingBox.minY + par4, this.boundingBox.minZ + par5, 3, this.getComponentType(), par6); -+ -+ case 1: -+ return this.getNextComponent(par1ComponentNetherBridgeStartPiece, par2List, par3Random, this.boundingBox.minX + par5, this.boundingBox.minY + par4, this.boundingBox.maxZ + 1, 0, this.getComponentType(), par6); -+ -+ case 2: -+ return this.getNextComponent(par1ComponentNetherBridgeStartPiece, par2List, par3Random, this.boundingBox.maxX + 1, this.boundingBox.minY + par4, this.boundingBox.minZ + par5, 3, this.getComponentType(), par6); -+ -+ case 3: -+ return this.getNextComponent(par1ComponentNetherBridgeStartPiece, par2List, par3Random, this.boundingBox.minX + par5, this.boundingBox.minY + par4, this.boundingBox.maxZ + 1, 0, this.getComponentType(), par6); -+ -+ default: -+ return null; -+ } -+ } -+ -+ /** -+ * Checks if the bounding box's minY is > 10 -+ */ -+ protected static boolean isAboveGround(StructureBoundingBox par0StructureBoundingBox) { -+ return par0StructureBoundingBox != null && par0StructureBoundingBox.minY > 10; - } - } ---- /dev/null -+++ org/spoutcraft/client/entity/CraftCameraEntity.java -@@ -1,0 +1,60 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.client.entity; -+ -+import org.spoutcraft.api.property.Property; -+import org.spoutcraft.api.util.FixedLocation; -+import org.spoutcraft.api.util.Location; -+import org.spoutcraft.api.util.Vector; -+ -+public class CraftCameraEntity extends CraftEntity { -+ public CraftCameraEntity(FixedLocation location) { -+ super(location); -+ handle = new EntityCamera(this); -+ teleport(location); -+ addProperty("location", new Property() { -+ public void set(Object value) { -+ teleport((Location)value); -+ } -+ public Object get() { -+ return getLocation(); -+ } -+ }); -+ addProperty("velocity", new Property() { -+ public void set(Object value) { -+ setVelocity((Vector)value); -+ } -+ public Object get() { -+ return getVelocity(); -+ } -+ }); -+ } -+ -+ @Override -+ public boolean teleport(FixedLocation location) { -+ handle.setPositionAndRotation(location.getX(), location.getY(), location.getZ(), (float)location.getYaw(), (float)location.getPitch()); -+ ((EntityCamera)handle).setRotation((float)location.getYaw(), (float)location.getPitch()); -+ return true; -+ } -+ -+ public EntityCamera getHandle() { -+ return (EntityCamera) handle; -+ } -+} ---- net/minecraft/src/NBTBase.java -+++ net/minecraft/src/NBTBase.java -@@ -5,52 +5,72 @@ - import java.io.IOException; - - public abstract class NBTBase { -- public static final String[] b = new String[]{"END", "BYTE", "SHORT", "INT", "LONG", "FLOAT", "DOUBLE", "BYTE[]", "STRING", "LIST", "COMPOUND", "INT[]"}; -- private String a; -- -+ public static final String[] NBTTypes = new String[] {"END", "BYTE", "SHORT", "INT", "LONG", "FLOAT", "DOUBLE", "BYTE[]", "STRING", "LIST", "COMPOUND", "INT[]"}; -+ -+ /** The UTF string key used to lookup values. */ -+ private String name; -+ -+ /** -+ * Write the actual data contents of the tag, implemented in NBT extension classes -+ */ - abstract void write(DataOutput var1) throws IOException; - -+ /** -+ * Read the actual data contents of the tag, implemented in NBT extension classes -+ */ - abstract void load(DataInput var1, int var2) throws IOException; - -+ /** -+ * Gets the type byte for the tag. -+ */ - public abstract byte getId(); - -- protected NBTBase(String var1) { -- if(var1 == null) { -- this.a = ""; -+ protected NBTBase(String par1Str) { -+ if (par1Str == null) { -+ this.name = ""; - } else { -- this.a = var1; -+ this.name = par1Str; - } -- - } - -- public NBTBase setName(String var1) { -- if(var1 == null) { -- this.a = ""; -+ /** -+ * Sets the name for this tag and returns this for convenience. -+ */ -+ public NBTBase setName(String par1Str) { -+ if (par1Str == null) { -+ this.name = ""; - } else { -- this.a = var1; -+ this.name = par1Str; - } - - return this; - } - -+ /** -+ * Gets the name corresponding to the tag, or an empty string if none set. -+ */ - public String getName() { -- return this.a == null ? "" : this.a; -- } -- -- public static NBTBase readNamedTag(DataInput var0) throws IOException { -- return func_130104_b(var0, 0); -- } -- -- public static NBTBase func_130104_b(DataInput var0, int var1) throws IOException { -- byte var2 = var0.readByte(); -- if(var2 == 0) { -+ return this.name == null ? "" : this.name; -+ } -+ -+ /** -+ * Reads and returns a tag from the given DataInput, or the End tag if no tag could be read. -+ */ -+ public static NBTBase readNamedTag(DataInput par0DataInput) throws IOException { -+ return func_130104_b(par0DataInput, 0); -+ } -+ -+ public static NBTBase func_130104_b(DataInput par0DataInput, int par1) throws IOException { -+ byte var2 = par0DataInput.readByte(); -+ -+ if (var2 == 0) { - return new NBTTagEnd(); - } else { -- String var3 = var0.readUTF(); -+ String var3 = par0DataInput.readUTF(); - NBTBase var4 = newTag(var2, var3); - - try { -- var4.load(var0, var1); -+ var4.load(par0DataInput, par1); - return var4; - } catch (IOException var8) { - CrashReport var6 = CrashReport.makeCrashReport(var8, "Loading NBT data"); -@@ -62,88 +82,126 @@ - } - } - -- public static void writeNamedTag(NBTBase var0, DataOutput var1) throws IOException { -- var1.writeByte(var0.getId()); -- if(var0.getId() != 0) { -- var1.writeUTF(var0.getName()); -- var0.write(var1); -- } -- } -- -- public static NBTBase newTag(byte var0, String var1) { -- switch(var0) { -- case 0: -- return new NBTTagEnd(); -- case 1: -- return new NBTTagByte(var1); -- case 2: -- return new NBTTagShort(var1); -- case 3: -- return new NBTTagInt(var1); -- case 4: -- return new NBTTagLong(var1); -- case 5: -- return new NBTTagFloat(var1); -- case 6: -- return new NBTTagDouble(var1); -- case 7: -- return new NBTTagByteArray(var1); -- case 8: -- return new NBTTagString(var1); -- case 9: -- return new NBTTagList(var1); -- case 10: -- return new NBTTagCompound(var1); -- case 11: -- return new NBTTagIntArray(var1); -- default: -- return null; -- } -- } -- -- public static String getTagName(byte var0) { -- switch(var0) { -- case 0: -- return "TAG_End"; -- case 1: -- return "TAG_Byte"; -- case 2: -- return "TAG_Short"; -- case 3: -- return "TAG_Int"; -- case 4: -- return "TAG_Long"; -- case 5: -- return "TAG_Float"; -- case 6: -- return "TAG_Double"; -- case 7: -- return "TAG_Byte_Array"; -- case 8: -- return "TAG_String"; -- case 9: -- return "TAG_List"; -- case 10: -- return "TAG_Compound"; -- case 11: -- return "TAG_Int_Array"; -- default: -- return "UNKNOWN"; -- } -- } -- -+ /** -+ * Writes the specified tag to the given DataOutput, writing the type byte, the UTF string key and then calling the tag -+ * to write its data. -+ */ -+ public static void writeNamedTag(NBTBase par0NBTBase, DataOutput par1DataOutput) throws IOException { -+ par1DataOutput.writeByte(par0NBTBase.getId()); -+ -+ if (par0NBTBase.getId() != 0) { -+ par1DataOutput.writeUTF(par0NBTBase.getName()); -+ par0NBTBase.write(par1DataOutput); -+ } -+ } -+ -+ /** -+ * Creates and returns a new tag of the specified type, or null if invalid. -+ */ -+ public static NBTBase newTag(byte par0, String par1Str) { -+ switch (par0) { -+ case 0: -+ return new NBTTagEnd(); -+ -+ case 1: -+ return new NBTTagByte(par1Str); -+ -+ case 2: -+ return new NBTTagShort(par1Str); -+ -+ case 3: -+ return new NBTTagInt(par1Str); -+ -+ case 4: -+ return new NBTTagLong(par1Str); -+ -+ case 5: -+ return new NBTTagFloat(par1Str); -+ -+ case 6: -+ return new NBTTagDouble(par1Str); -+ -+ case 7: -+ return new NBTTagByteArray(par1Str); -+ -+ case 8: -+ return new NBTTagString(par1Str); -+ -+ case 9: -+ return new NBTTagList(par1Str); -+ -+ case 10: -+ return new NBTTagCompound(par1Str); -+ -+ case 11: -+ return new NBTTagIntArray(par1Str); -+ -+ default: -+ return null; -+ } -+ } -+ -+ /** -+ * Returns the string name of a tag with the specified type, or 'UNKNOWN' if invalid. -+ */ -+ public static String getTagName(byte par0) { -+ switch (par0) { -+ case 0: -+ return "TAG_End"; -+ -+ case 1: -+ return "TAG_Byte"; -+ -+ case 2: -+ return "TAG_Short"; -+ -+ case 3: -+ return "TAG_Int"; -+ -+ case 4: -+ return "TAG_Long"; -+ -+ case 5: -+ return "TAG_Float"; -+ -+ case 6: -+ return "TAG_Double"; -+ -+ case 7: -+ return "TAG_Byte_Array"; -+ -+ case 8: -+ return "TAG_String"; -+ -+ case 9: -+ return "TAG_List"; -+ -+ case 10: -+ return "TAG_Compound"; -+ -+ case 11: -+ return "TAG_Int_Array"; -+ -+ default: -+ return "UNKNOWN"; -+ } -+ } -+ -+ /** -+ * Creates a clone of the tag. -+ */ - public abstract NBTBase copy(); - -- public boolean equals(Object var1) { -- if(!(var1 instanceof NBTBase)) { -+ public boolean equals(Object par1Obj) { -+ if (!(par1Obj instanceof NBTBase)) { - return false; - } else { -- NBTBase var2 = (NBTBase)var1; -- return this.getId() != var2.getId() ? false : ((this.a != null || var2.a == null) && (this.a == null || var2.a != null) ? this.a == null || this.a.equals(var2.a) : false); -+ NBTBase var2 = (NBTBase)par1Obj; -+ return this.getId() != var2.getId() ? false : ((this.name != null || var2.name == null) && (this.name == null || var2.name != null) ? this.name == null || this.name.equals(var2.name) : false); - } - } - - public int hashCode() { -- return this.a.hashCode() ^ this.getId(); -+ return this.name.hashCode() ^ this.getId(); - } - } ---- net/minecraft/src/BlockEventData.java -+++ net/minecraft/src/BlockEventData.java -@@ -5,47 +5,69 @@ - private int coordY; - private int coordZ; - private int blockID; -+ -+ /** Different for each blockID */ - private int eventID; -+ -+ /** Different for each blockID, eventID */ - private int eventParameter; - -- public BlockEventData(int var1, int var2, int var3, int var4, int var5, int var6) { -- this.coordX = var1; -- this.coordY = var2; -- this.coordZ = var3; -- this.eventID = var5; -- this.eventParameter = var6; -- this.blockID = var4; -+ public BlockEventData(int par1, int par2, int par3, int par4, int par5, int par6) { -+ this.coordX = par1; -+ this.coordY = par2; -+ this.coordZ = par3; -+ this.eventID = par5; -+ this.eventParameter = par6; -+ this.blockID = par4; - } - -+ /** -+ * Get the X coordinate. -+ */ - public int getX() { - return this.coordX; - } - -+ /** -+ * Get the Y coordinate. -+ */ - public int getY() { - return this.coordY; - } - -+ /** -+ * Get the Z coordinate. -+ */ - public int getZ() { - return this.coordZ; - } - -+ /** -+ * Get the Event ID (different for each BlockID) -+ */ - public int getEventID() { - return this.eventID; - } - -+ /** -+ * Get the Event Parameter (different for each BlockID,EventID) -+ */ - public int getEventParameter() { - return this.eventParameter; - } - -+ /** -+ * Gets the BlockID for this BlockEventData -+ */ - public int getBlockID() { - return this.blockID; - } - -- public boolean equals(Object var1) { -- if(!(var1 instanceof BlockEventData)) { -+ public boolean equals(Object par1Obj) { -+ if (!(par1Obj instanceof BlockEventData)) { - return false; - } else { -- BlockEventData var2 = (BlockEventData)var1; -+ BlockEventData var2 = (BlockEventData)par1Obj; - return this.coordX == var2.coordX && this.coordY == var2.coordY && this.coordZ == var2.coordZ && this.eventID == var2.eventID && this.eventParameter == var2.eventParameter && this.blockID == var2.blockID; - } - } ---- /dev/null -+++ org/spoutcraft/api/util/Vector.java -@@ -1,0 +1,136 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.api.util; -+ -+public interface Vector extends FixedVector { -+ /** -+ * Set the X component. -+ * -+ * @param x -+ * @return this vector -+ */ -+ public Vector setX(double x); -+ -+ /** -+ * Set the Y component. -+ * -+ * @param y -+ * @return this vector -+ */ -+ public Vector setY(double y); -+ -+ /** -+ * Set the Z component. -+ * -+ * @param z -+ * @return this vector -+ */ -+ public Vector setZ(double z); -+ -+ /** -+ * Adds the vector by another. -+ * -+ * @param vec -+ * @return the same vector -+ */ -+ public Vector add(Vector vec); -+ -+ /** -+ * Subtracts the vector by another. -+ * -+ * @param vec -+ * @return the same vector -+ */ -+ public Vector subtract(Vector vec); -+ -+ /** -+ * Multiplies the vector by another. -+ * -+ * @param vec -+ * @return the same vector -+ */ -+ public Vector multiply(Vector vec); -+ -+ /** -+ * Divides the vector by another. -+ * -+ * @param vec -+ * @return the same vector -+ */ -+ public Vector divide(Vector vec); -+ -+ /** -+ * Copies another vector -+ * -+ * @param vec -+ * @return the same vector -+ */ -+ public Vector copy(Vector vec); -+ -+ /** -+ * Sets this vector to the midpoint between this vector and another. -+ * -+ * @param other -+ * @return this same vector (now a midpoint) -+ */ -+ public Vector midpoint(Vector other); -+ -+ /** -+ * Gets a new midpoint vector between this vector and another. -+ * -+ * @param other -+ * @return a new midpoint vector -+ */ -+ public Vector getMidpoint(Vector other); -+ -+ /** -+ * Performs scalar multiplication, multiplying all components with a scalar. -+ * -+ * @param m -+ * @return the same vector -+ */ -+ public Vector multiply(double m); -+ -+ /** -+ * Calculates the cross product of this vector with another. The cross product is defined as: -+ * -+ * x = y1 * z2 - y2 * z1
-+ * y = z1 * x2 - z2 * x1
-+ * z = x1 * y2 - x2 * y1 -+ * -+ * @param o -+ * @return the same vector -+ */ -+ public Vector crossProduct(Vector o); -+ -+ /** -+ * Converts this vector to a unit vector (a vector with length of 1). -+ * -+ * @return the same vector -+ */ -+ public Vector normalize(); -+ -+ /** -+ * Zero this vector's components. -+ * -+ * @return the same vector -+ */ -+ public Vector zero(); -+} ---- net/minecraft/src/ContainerHorseInventorySlotArmor.java -+++ net/minecraft/src/ContainerHorseInventorySlotArmor.java -@@ -2,16 +2,20 @@ - - class ContainerHorseInventorySlotArmor extends Slot { - final EntityHorse theHorse; -+ - final ContainerHorseInventory field_111240_b; - -- ContainerHorseInventorySlotArmor(ContainerHorseInventory var1, IInventory var2, int var3, int var4, int var5, EntityHorse var6) { -- super(var2, var3, var4, var5); -- this.field_111240_b = var1; -- this.theHorse = var6; -+ ContainerHorseInventorySlotArmor(ContainerHorseInventory par1ContainerHorseInventory, IInventory par2IInventory, int par3, int par4, int par5, EntityHorse par6EntityHorse) { -+ super(par2IInventory, par3, par4, par5); -+ this.field_111240_b = par1ContainerHorseInventory; -+ this.theHorse = par6EntityHorse; - } - -- public boolean isItemValid(ItemStack var1) { -- return super.isItemValid(var1) && this.theHorse.func_110259_cr() && EntityHorse.func_110211_v(var1.itemID); -+ /** -+ * Check if the stack is a valid item for this slot. Always true beside for the armor slots. -+ */ -+ public boolean isItemValid(ItemStack par1ItemStack) { -+ return super.isItemValid(par1ItemStack) && this.theHorse.func_110259_cr() && EntityHorse.func_110211_v(par1ItemStack.itemID); - } - - public boolean func_111238_b() { ---- net/minecraft/src/CreativeCrafting.java -+++ net/minecraft/src/CreativeCrafting.java -@@ -5,17 +5,24 @@ - public class CreativeCrafting implements ICrafting { - private final Minecraft mc; - -- public CreativeCrafting(Minecraft var1) { -- this.mc = var1; -- } -- -- public void updateCraftingInventory(Container var1, List var2) { -- } -- -- public void sendSlotContents(Container var1, int var2, ItemStack var3) { -- this.mc.playerController.sendSlotPacket(var3, var2); -- } -- -- public void sendProgressBarUpdate(Container var1, int var2, int var3) { -- } -+ public CreativeCrafting(Minecraft par1Minecraft) { -+ this.mc = par1Minecraft; -+ } -+ -+ public void sendContainerAndContentsToPlayer(Container par1Container, List par2List) {} -+ -+ /** -+ * Sends the contents of an inventory slot to the client-side Container. This doesn't have to match the actual contents -+ * of that slot. Args: Container, slot number, slot contents -+ */ -+ public void sendSlotContents(Container par1Container, int par2, ItemStack par3ItemStack) { -+ this.mc.playerController.sendSlotPacket(par3ItemStack, par2); -+ } -+ -+ /** -+ * Sends two ints to the client-side Container. Used for furnace burning time, smelting progress, brewing progress, and -+ * enchanting level. Normally the first int identifies which variable to update, and the second contains the new value. -+ * Both are truncated to shorts in non-local SMP. -+ */ -+ public void sendProgressBarUpdate(Container par1Container, int par2, int par3) {} - } ---- net/minecraft/src/EntityEnderman.java -+++ net/minecraft/src/EntityEnderman.java -@@ -3,16 +3,24 @@ - import java.util.UUID; - - public class EntityEnderman extends EntityMob { -- private static final UUID bp = UUID.fromString("020E0DFB-87AE-4653-9556-831010E291A0"); -- private static final AttributeModifier attackingSpeedBoostModifier = (new AttributeModifier(bp, "Attacking speed boost", (double)6.2F, 0)).setSaved(false); -+ private static final UUID attackingSpeedBoostModifierUUID = UUID.fromString("020E0DFB-87AE-4653-9556-831010E291A0"); -+ private static final AttributeModifier attackingSpeedBoostModifier = (new AttributeModifier(attackingSpeedBoostModifierUUID, "Attacking speed boost", 6.199999809265137D, 0)).setSaved(false); - private static boolean[] carriableBlocks = new boolean[256]; -+ -+ /** -+ * Counter to delay the teleportation of an enderman towards the currently attacked target -+ */ - private int teleportDelay; -+ -+ /** -+ * A player must stare at an enderman for 5 ticks before it becomes aggressive. This field counts those ticks. -+ */ - private int stareTimer; - private Entity lastEntityToAttack; - private boolean isAggressive; - -- public EntityEnderman(World var1) { -- super(var1); -+ public EntityEnderman(World par1World) { -+ super(par1World); - this.setSize(0.6F, 2.9F); - this.stepHeight = 1.0F; - } -@@ -20,7 +28,7 @@ - protected void applyEntityAttributes() { - super.applyEntityAttributes(); - this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setAttribute(40.0D); -- this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setAttribute((double)0.3F); -+ this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setAttribute(0.30000001192092896D); - this.getEntityAttribute(SharedMonsterAttributes.attackDamage).setAttribute(7.0D); - } - -@@ -31,28 +39,40 @@ - this.dataWatcher.addObject(18, new Byte((byte)0)); - } - -- public void writeEntityToNBT(NBTTagCompound var1) { -- super.writeEntityToNBT(var1); -- var1.setShort("carried", (short)this.getCarried()); -- var1.setShort("carriedData", (short)this.getCarryingData()); -- } -- -- public void readEntityFromNBT(NBTTagCompound var1) { -- super.readEntityFromNBT(var1); -- this.setCarried(var1.getShort("carried")); -- this.setCarryingData(var1.getShort("carriedData")); -- } -- -+ /** -+ * (abstract) Protected helper method to write subclass entity data to NBT. -+ */ -+ public void writeEntityToNBT(NBTTagCompound par1NBTTagCompound) { -+ super.writeEntityToNBT(par1NBTTagCompound); -+ par1NBTTagCompound.setShort("carried", (short)this.getCarried()); -+ par1NBTTagCompound.setShort("carriedData", (short)this.getCarryingData()); -+ } -+ -+ /** -+ * (abstract) Protected helper method to read subclass entity data from NBT. -+ */ -+ public void readEntityFromNBT(NBTTagCompound par1NBTTagCompound) { -+ super.readEntityFromNBT(par1NBTTagCompound); -+ this.setCarried(par1NBTTagCompound.getShort("carried")); -+ this.setCarryingData(par1NBTTagCompound.getShort("carriedData")); -+ } -+ -+ /** -+ * Finds the closest player within 16 blocks to attack, or null if this Entity isn't interested in attacking (Animals, -+ * Spiders at day, peaceful PigZombies). -+ */ - protected Entity findPlayerToAttack() { - EntityPlayer var1 = this.worldObj.getClosestVulnerablePlayerToEntity(this, 64.0D); -- if(var1 != null) { -- if(this.shouldAttackPlayer(var1)) { -+ -+ if (var1 != null) { -+ if (this.shouldAttackPlayer(var1)) { - this.isAggressive = true; -- if(this.stareTimer == 0) { -+ -+ if (this.stareTimer == 0) { - this.worldObj.playSoundAtEntity(var1, "mob.endermen.stare", 1.0F, 1.0F); - } - -- if(this.stareTimer++ == 5) { -+ if (this.stareTimer++ == 5) { - this.stareTimer = 0; - this.setScreaming(true); - return var1; -@@ -65,71 +85,85 @@ - return null; - } - -- private boolean shouldAttackPlayer(EntityPlayer var1) { -- ItemStack var2 = var1.inventory.armorInventory[3]; -- if(var2 != null && var2.itemID == Block.pumpkin.blockID) { -+ /** -+ * Checks to see if this enderman should be attacking this player -+ */ -+ private boolean shouldAttackPlayer(EntityPlayer par1EntityPlayer) { -+ ItemStack var2 = par1EntityPlayer.inventory.armorInventory[3]; -+ -+ if (var2 != null && var2.itemID == Block.pumpkin.blockID) { - return false; - } else { -- Vec3 var3 = var1.getLook(1.0F).normalize(); -- Vec3 var4 = this.worldObj.getWorldVec3Pool().getVecFromPool(this.posX - var1.posX, this.boundingBox.minY + (double)(this.height / 2.0F) - (var1.posY + (double)var1.getEyeHeight()), this.posZ - var1.posZ); -+ Vec3 var3 = par1EntityPlayer.getLook(1.0F).normalize(); -+ Vec3 var4 = this.worldObj.getWorldVec3Pool().getVecFromPool(this.posX - par1EntityPlayer.posX, this.boundingBox.minY + (double)(this.height / 2.0F) - (par1EntityPlayer.posY + (double)par1EntityPlayer.getEyeHeight()), this.posZ - par1EntityPlayer.posZ); - double var5 = var4.lengthVector(); - var4 = var4.normalize(); - double var7 = var3.dotProduct(var4); -- return var7 > 1.0D - 0.025D / var5 ? var1.canEntityBeSeen(this) : false; -+ return var7 > 1.0D - 0.025D / var5 ? par1EntityPlayer.canEntityBeSeen(this) : false; - } - } - -+ /** -+ * Called frequently so the entity can update its state every tick as required. For example, zombies and skeletons use -+ * this to react to sunlight and start to burn. -+ */ - public void onLivingUpdate() { -- if(this.isWet()) { -+ if (this.isWet()) { - this.attackEntityFrom(DamageSource.drown, 1.0F); - } - -- if(this.lastEntityToAttack != this.entityToAttack) { -+ if (this.lastEntityToAttack != this.entityToAttack) { - AttributeInstance var1 = this.getEntityAttribute(SharedMonsterAttributes.movementSpeed); - var1.removeModifier(attackingSpeedBoostModifier); -- if(this.entityToAttack != null) { -+ -+ if (this.entityToAttack != null) { - var1.applyModifier(attackingSpeedBoostModifier); - } - } - - this.lastEntityToAttack = this.entityToAttack; - int var6; -- if(!this.worldObj.isRemote && this.worldObj.getGameRules().getGameRuleBooleanValue("mobGriefing")) { -+ -+ if (!this.worldObj.isRemote && this.worldObj.getGameRules().getGameRuleBooleanValue("mobGriefing")) { - int var2; - int var3; - int var4; -- if(this.getCarried() == 0) { -- if(this.ab.nextInt(20) == 0) { -- var6 = MathHelper.floor_double(this.posX - 2.0D + this.ab.nextDouble() * 4.0D); -- var2 = MathHelper.floor_double(this.posY + this.ab.nextDouble() * 3.0D); -- var3 = MathHelper.floor_double(this.posZ - 2.0D + this.ab.nextDouble() * 4.0D); -+ -+ if (this.getCarried() == 0) { -+ if (this.rand.nextInt(20) == 0) { -+ var6 = MathHelper.floor_double(this.posX - 2.0D + this.rand.nextDouble() * 4.0D); -+ var2 = MathHelper.floor_double(this.posY + this.rand.nextDouble() * 3.0D); -+ var3 = MathHelper.floor_double(this.posZ - 2.0D + this.rand.nextDouble() * 4.0D); - var4 = this.worldObj.getBlockId(var6, var2, var3); -- if(carriableBlocks[var4]) { -+ -+ if (carriableBlocks[var4]) { - this.setCarried(this.worldObj.getBlockId(var6, var2, var3)); - this.setCarryingData(this.worldObj.getBlockMetadata(var6, var2, var3)); - this.worldObj.setBlock(var6, var2, var3, 0); - } - } -- } else if(this.ab.nextInt(2000) == 0) { -- var6 = MathHelper.floor_double(this.posX - 1.0D + this.ab.nextDouble() * 2.0D); -- var2 = MathHelper.floor_double(this.posY + this.ab.nextDouble() * 2.0D); -- var3 = MathHelper.floor_double(this.posZ - 1.0D + this.ab.nextDouble() * 2.0D); -+ } else if (this.rand.nextInt(2000) == 0) { -+ var6 = MathHelper.floor_double(this.posX - 1.0D + this.rand.nextDouble() * 2.0D); -+ var2 = MathHelper.floor_double(this.posY + this.rand.nextDouble() * 2.0D); -+ var3 = MathHelper.floor_double(this.posZ - 1.0D + this.rand.nextDouble() * 2.0D); - var4 = this.worldObj.getBlockId(var6, var2, var3); - int var5 = this.worldObj.getBlockId(var6, var2 - 1, var3); -- if(var4 == 0 && var5 > 0 && Block.blocksList[var5].renderAsNormalBlock()) { -+ -+ if (var4 == 0 && var5 > 0 && Block.blocksList[var5].renderAsNormalBlock()) { - this.worldObj.setBlock(var6, var2, var3, this.getCarried(), this.getCarryingData(), 3); - this.setCarried(0); - } - } - } - -- for(var6 = 0; var6 < 2; ++var6) { -- this.worldObj.spawnParticle("portal", this.posX + (this.ab.nextDouble() - 0.5D) * (double)this.width, this.posY + this.ab.nextDouble() * (double)this.height - 0.25D, this.posZ + (this.ab.nextDouble() - 0.5D) * (double)this.width, (this.ab.nextDouble() - 0.5D) * 2.0D, -this.ab.nextDouble(), (this.ab.nextDouble() - 0.5D) * 2.0D); -+ for (var6 = 0; var6 < 2; ++var6) { -+ this.worldObj.spawnParticle("portal", this.posX + (this.rand.nextDouble() - 0.5D) * (double)this.width, this.posY + this.rand.nextDouble() * (double)this.height - 0.25D, this.posZ + (this.rand.nextDouble() - 0.5D) * (double)this.width, (this.rand.nextDouble() - 0.5D) * 2.0D, -this.rand.nextDouble(), (this.rand.nextDouble() - 0.5D) * 2.0D); - } - -- if(this.worldObj.isDaytime() && !this.worldObj.isRemote) { -+ if (this.worldObj.isDaytime() && !this.worldObj.isRemote) { - float var7 = this.getBrightness(1.0F); -- if(var7 > 0.5F && this.worldObj.canBlockSeeTheSky(MathHelper.floor_double(this.posX), MathHelper.floor_double(this.posY), MathHelper.floor_double(this.posZ)) && this.ab.nextFloat() * 30.0F < (var7 - 0.4F) * 2.0F) { -+ -+ if (var7 > 0.5F && this.worldObj.canBlockSeeTheSky(MathHelper.floor_double(this.posX), MathHelper.floor_double(this.posY), MathHelper.floor_double(this.posZ)) && this.rand.nextFloat() * 30.0F < (var7 - 0.4F) * 2.0F) { - this.entityToAttack = null; - this.setScreaming(false); - this.isAggressive = false; -@@ -137,31 +171,32 @@ - } - } - -- if(this.isWet() || this.isBurning()) { -+ if (this.isWet() || this.isBurning()) { - this.entityToAttack = null; - this.setScreaming(false); - this.isAggressive = false; - this.teleportRandomly(); - } - -- if(this.isScreaming() && !this.isAggressive && this.ab.nextInt(100) == 0) { -+ if (this.isScreaming() && !this.isAggressive && this.rand.nextInt(100) == 0) { - this.setScreaming(false); - } - - this.isJumping = false; -- if(this.entityToAttack != null) { -+ -+ if (this.entityToAttack != null) { - this.faceEntity(this.entityToAttack, 100.0F, 100.0F); - } - -- if(!this.worldObj.isRemote && this.isEntityAlive()) { -- if(this.entityToAttack != null) { -- if(this.entityToAttack instanceof EntityPlayer && this.shouldAttackPlayer((EntityPlayer)this.entityToAttack)) { -- if(this.entityToAttack.getDistanceSqToEntity(this) < 16.0D) { -+ if (!this.worldObj.isRemote && this.isEntityAlive()) { -+ if (this.entityToAttack != null) { -+ if (this.entityToAttack instanceof EntityPlayer && this.shouldAttackPlayer((EntityPlayer)this.entityToAttack)) { -+ if (this.entityToAttack.getDistanceSqToEntity(this) < 16.0D) { - this.teleportRandomly(); - } - - this.teleportDelay = 0; -- } else if(this.entityToAttack.getDistanceSqToEntity(this) > 256.0D && this.teleportDelay++ >= 30 && this.teleportToEntity(this.entityToAttack)) { -+ } else if (this.entityToAttack.getDistanceSqToEntity(this) > 256.0D && this.teleportDelay++ >= 30 && this.teleportToEntity(this.entityToAttack)) { - this.teleportDelay = 0; - } - } else { -@@ -173,73 +208,82 @@ - super.onLivingUpdate(); - } - -+ /** -+ * Teleport the enderman to a random nearby position -+ */ - protected boolean teleportRandomly() { -- double var1 = this.posX + (this.ab.nextDouble() - 0.5D) * 64.0D; -- double var3 = this.posY + (double)(this.ab.nextInt(64) - 32); -- double var5 = this.posZ + (this.ab.nextDouble() - 0.5D) * 64.0D; -+ double var1 = this.posX + (this.rand.nextDouble() - 0.5D) * 64.0D; -+ double var3 = this.posY + (double)(this.rand.nextInt(64) - 32); -+ double var5 = this.posZ + (this.rand.nextDouble() - 0.5D) * 64.0D; - return this.teleportTo(var1, var3, var5); - } - -- protected boolean teleportToEntity(Entity var1) { -- Vec3 var2 = this.worldObj.getWorldVec3Pool().getVecFromPool(this.posX - var1.posX, this.boundingBox.minY + (double)(this.height / 2.0F) - var1.posY + (double)var1.getEyeHeight(), this.posZ - var1.posZ); -+ /** -+ * Teleport the enderman to another entity -+ */ -+ protected boolean teleportToEntity(Entity par1Entity) { -+ Vec3 var2 = this.worldObj.getWorldVec3Pool().getVecFromPool(this.posX - par1Entity.posX, this.boundingBox.minY + (double)(this.height / 2.0F) - par1Entity.posY + (double)par1Entity.getEyeHeight(), this.posZ - par1Entity.posZ); - var2 = var2.normalize(); - double var3 = 16.0D; -- double var5 = this.posX + (this.ab.nextDouble() - 0.5D) * 8.0D - var2.xCoord * var3; -- double var7 = this.posY + (double)(this.ab.nextInt(16) - 8) - var2.yCoord * var3; -- double var9 = this.posZ + (this.ab.nextDouble() - 0.5D) * 8.0D - var2.zCoord * var3; -+ double var5 = this.posX + (this.rand.nextDouble() - 0.5D) * 8.0D - var2.xCoord * var3; -+ double var7 = this.posY + (double)(this.rand.nextInt(16) - 8) - var2.yCoord * var3; -+ double var9 = this.posZ + (this.rand.nextDouble() - 0.5D) * 8.0D - var2.zCoord * var3; - return this.teleportTo(var5, var7, var9); - } - -- protected boolean teleportTo(double var1, double var3, double var5) { -+ /** -+ * Teleport the enderman -+ */ -+ protected boolean teleportTo(double par1, double par3, double par5) { - double var7 = this.posX; - double var9 = this.posY; - double var11 = this.posZ; -- this.posX = var1; -- this.posY = var3; -- this.posZ = var5; -+ this.posX = par1; -+ this.posY = par3; -+ this.posZ = par5; - boolean var13 = false; - int var14 = MathHelper.floor_double(this.posX); - int var15 = MathHelper.floor_double(this.posY); - int var16 = MathHelper.floor_double(this.posZ); - int var18; -- if(this.worldObj.blockExists(var14, var15, var16)) { -+ -+ if (this.worldObj.blockExists(var14, var15, var16)) { - boolean var17 = false; - -- while(true) { -- while(!var17 && var15 > 0) { -- var18 = this.worldObj.getBlockId(var14, var15 - 1, var16); -- if(var18 != 0 && Block.blocksList[var18].blockMaterial.blocksMovement()) { -- var17 = true; -- } else { -- --this.posY; -- --var15; -- } -- } -- -- if(var17) { -- this.setPosition(this.posX, this.posY, this.posZ); -- if(this.worldObj.getCollidingBoundingBoxes(this, this.boundingBox).isEmpty() && !this.worldObj.isAnyLiquid(this.boundingBox)) { -- var13 = true; -- } -- } -- break; -+ while (!var17 && var15 > 0) { -+ var18 = this.worldObj.getBlockId(var14, var15 - 1, var16); -+ -+ if (var18 != 0 && Block.blocksList[var18].blockMaterial.blocksMovement()) { -+ var17 = true; -+ } else { -+ --this.posY; -+ --var15; -+ } -+ } -+ -+ if (var17) { -+ this.setPosition(this.posX, this.posY, this.posZ); -+ -+ if (this.worldObj.getCollidingBoundingBoxes(this, this.boundingBox).isEmpty() && !this.worldObj.isAnyLiquid(this.boundingBox)) { -+ var13 = true; -+ } - } - } - -- if(!var13) { -+ if (!var13) { - this.setPosition(var7, var9, var11); - return false; - } else { - short var30 = 128; - -- for(var18 = 0; var18 < var30; ++var18) { -+ for (var18 = 0; var18 < var30; ++var18) { - double var19 = (double)var18 / ((double)var30 - 1.0D); -- float var21 = (this.ab.nextFloat() - 0.5F) * 0.2F; -- float var22 = (this.ab.nextFloat() - 0.5F) * 0.2F; -- float var23 = (this.ab.nextFloat() - 0.5F) * 0.2F; -- double var24 = var7 + (this.posX - var7) * var19 + (this.ab.nextDouble() - 0.5D) * (double)this.width * 2.0D; -- double var26 = var9 + (this.posY - var9) * var19 + this.ab.nextDouble() * (double)this.height; -- double var28 = var11 + (this.posZ - var11) * var19 + (this.ab.nextDouble() - 0.5D) * (double)this.width * 2.0D; -+ float var21 = (this.rand.nextFloat() - 0.5F) * 0.2F; -+ float var22 = (this.rand.nextFloat() - 0.5F) * 0.2F; -+ float var23 = (this.rand.nextFloat() - 0.5F) * 0.2F; -+ double var24 = var7 + (this.posX - var7) * var19 + (this.rand.nextDouble() - 0.5D) * (double)this.width * 2.0D; -+ double var26 = var9 + (this.posY - var9) * var19 + this.rand.nextDouble() * (double)this.height; -+ double var28 = var11 + (this.posZ - var11) * var19 + (this.rand.nextDouble() - 0.5D) * (double)this.width * 2.0D; - this.worldObj.spawnParticle("portal", var24, var26, var28, (double)var21, (double)var22, (double)var23); - } - -@@ -249,71 +293,103 @@ - } - } - -+ /** -+ * Returns the sound this mob makes while it's alive. -+ */ - protected String getLivingSound() { - return this.isScreaming() ? "mob.endermen.scream" : "mob.endermen.idle"; - } - -+ /** -+ * Returns the sound this mob makes when it is hurt. -+ */ - protected String getHurtSound() { - return "mob.endermen.hit"; - } - -+ /** -+ * Returns the sound this mob makes on death. -+ */ - protected String getDeathSound() { - return "mob.endermen.death"; - } - -+ /** -+ * Returns the item ID for the item the mob drops on death. -+ */ - protected int getDropItemId() { - return Item.enderPearl.itemID; - } - -- protected void dropFewItems(boolean var1, int var2) { -+ /** -+ * Drop 0-2 items of this living's type. @param par1 - Whether this entity has recently been hit by a player. @param -+ * par2 - Level of Looting used to kill this mob. -+ */ -+ protected void dropFewItems(boolean par1, int par2) { - int var3 = this.getDropItemId(); -- if(var3 > 0) { -- int var4 = this.ab.nextInt(2 + var2); -- -- for(int var5 = 0; var5 < var4; ++var5) { -+ -+ if (var3 > 0) { -+ int var4 = this.rand.nextInt(2 + par2); -+ -+ for (int var5 = 0; var5 < var4; ++var5) { - this.dropItem(var3, 1); - } - } -- -- } -- -- public void setCarried(int var1) { -- this.dataWatcher.updateObject(16, Byte.valueOf((byte)(var1 & 255))); -- } -- -+ } -+ -+ /** -+ * Set the id of the block an enderman carries -+ */ -+ public void setCarried(int par1) { -+ this.dataWatcher.updateObject(16, Byte.valueOf((byte)(par1 & 255))); -+ } -+ -+ /** -+ * Get the id of the block an enderman carries -+ */ - public int getCarried() { - return this.dataWatcher.getWatchableObjectByte(16); - } - -- public void setCarryingData(int var1) { -- this.dataWatcher.updateObject(17, Byte.valueOf((byte)(var1 & 255))); -+ /** -+ * Set the metadata of the block an enderman carries -+ */ -+ public void setCarryingData(int par1) { -+ this.dataWatcher.updateObject(17, Byte.valueOf((byte)(par1 & 255))); - } - -+ /** -+ * Get the metadata of the block an enderman carries -+ */ - public int getCarryingData() { - return this.dataWatcher.getWatchableObjectByte(17); - } - -- public boolean attackEntityFrom(DamageSource var1, float var2) { -- if(this.isEntityInvulnerable()) { -+ /** -+ * Called when the entity is attacked. -+ */ -+ public boolean attackEntityFrom(DamageSource par1DamageSource, float par2) { -+ if (this.isEntityInvulnerable()) { - return false; - } else { - this.setScreaming(true); -- if(var1 instanceof EntityDamageSource && var1.getEntity() instanceof EntityPlayer) { -+ -+ if (par1DamageSource instanceof EntityDamageSource && par1DamageSource.getEntity() instanceof EntityPlayer) { - this.isAggressive = true; - } - -- if(var1 instanceof EntityDamageSourceIndirect) { -+ if (par1DamageSource instanceof EntityDamageSourceIndirect) { - this.isAggressive = false; - -- for(int var3 = 0; var3 < 64; ++var3) { -- if(this.teleportRandomly()) { -+ for (int var3 = 0; var3 < 64; ++var3) { -+ if (this.teleportRandomly()) { - return true; - } - } - - return false; - } else { -- return super.attackEntityFrom(var1, var2); -+ return super.attackEntityFrom(par1DamageSource, par2); - } - } - } -@@ -322,8 +398,8 @@ - return this.dataWatcher.getWatchableObjectByte(18) > 0; - } - -- public void setScreaming(boolean var1) { -- this.dataWatcher.updateObject(18, Byte.valueOf((byte)(var1 ? 1 : 0))); -+ public void setScreaming(boolean par1) { -+ this.dataWatcher.updateObject(18, Byte.valueOf((byte)(par1 ? 1 : 0))); - } - - static { ---- /dev/null -+++ org/spoutcraft/client/special/BaseYAMLResource.java -@@ -1,0 +1,47 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.client.special; -+ -+import java.io.File; -+ -+import org.bukkit.util.config.Configuration; -+ -+public class BaseYAMLResource implements YAMLResource { -+ private Configuration cached = null; -+ private final File localCache; -+ public BaseYAMLResource(File file) { -+ this.localCache = file; -+ } -+ -+ public synchronized Configuration getYAML() { -+ updateYAML(); -+ return cached; -+ } -+ -+ public synchronized boolean updateYAML() { -+ if (cached == null) { -+ // Setup cached processor -+ cached = new Configuration(localCache); -+ cached.load(); -+ return true; -+ } -+ return false; -+ } -+} ---- net/minecraft/src/StructureBoundingBox.java -+++ net/minecraft/src/StructureBoundingBox.java -@@ -1,112 +1,156 @@ - package net.minecraft.src; - - public class StructureBoundingBox { -+ -+ /** The first x coordinate of a bounding box. */ - public int minX; -+ -+ /** The first y coordinate of a bounding box. */ - public int minY; -+ -+ /** The first z coordinate of a bounding box. */ - public int minZ; -+ -+ /** The second x coordinate of a bounding box. */ - public int maxX; -+ -+ /** The second y coordinate of a bounding box. */ - public int maxY; -+ -+ /** The second z coordinate of a bounding box. */ - public int maxZ; - -- public StructureBoundingBox() { -- } -+ public StructureBoundingBox() {} - -- public StructureBoundingBox(int[] var1) { -- if(var1.length == 6) { -- this.minX = var1[0]; -- this.minY = var1[1]; -- this.minZ = var1[2]; -- this.maxX = var1[3]; -- this.maxY = var1[4]; -- this.maxZ = var1[5]; -+ public StructureBoundingBox(int[] par1ArrayOfInteger) { -+ if (par1ArrayOfInteger.length == 6) { -+ this.minX = par1ArrayOfInteger[0]; -+ this.minY = par1ArrayOfInteger[1]; -+ this.minZ = par1ArrayOfInteger[2]; -+ this.maxX = par1ArrayOfInteger[3]; -+ this.maxY = par1ArrayOfInteger[4]; -+ this.maxZ = par1ArrayOfInteger[5]; - } -- - } - -+ /** -+ * returns a new StructureBoundingBox with MAX values -+ */ - public static StructureBoundingBox getNewBoundingBox() { - return new StructureBoundingBox(Integer.MAX_VALUE, Integer.MAX_VALUE, Integer.MAX_VALUE, Integer.MIN_VALUE, Integer.MIN_VALUE, Integer.MIN_VALUE); - } - -- public static StructureBoundingBox getComponentToAddBoundingBox(int var0, int var1, int var2, int var3, int var4, int var5, int var6, int var7, int var8, int var9) { -- switch(var9) { -- case 0: -- return new StructureBoundingBox(var0 + var3, var1 + var4, var2 + var5, var0 + var6 - 1 + var3, var1 + var7 - 1 + var4, var2 + var8 - 1 + var5); -- case 1: -- return new StructureBoundingBox(var0 - var8 + 1 + var5, var1 + var4, var2 + var3, var0 + var5, var1 + var7 - 1 + var4, var2 + var6 - 1 + var3); -- case 2: -- return new StructureBoundingBox(var0 + var3, var1 + var4, var2 - var8 + 1 + var5, var0 + var6 - 1 + var3, var1 + var7 - 1 + var4, var2 + var5); -- case 3: -- return new StructureBoundingBox(var0 + var5, var1 + var4, var2 + var3, var0 + var8 - 1 + var5, var1 + var7 - 1 + var4, var2 + var6 - 1 + var3); -- default: -- return new StructureBoundingBox(var0 + var3, var1 + var4, var2 + var5, var0 + var6 - 1 + var3, var1 + var7 - 1 + var4, var2 + var8 - 1 + var5); -+ /** -+ * used to project a possible new component Bounding Box - to check if it would cut anything already spawned -+ */ -+ public static StructureBoundingBox getComponentToAddBoundingBox(int par0, int par1, int par2, int par3, int par4, int par5, int par6, int par7, int par8, int par9) { -+ switch (par9) { -+ case 0: -+ return new StructureBoundingBox(par0 + par3, par1 + par4, par2 + par5, par0 + par6 - 1 + par3, par1 + par7 - 1 + par4, par2 + par8 - 1 + par5); -+ -+ case 1: -+ return new StructureBoundingBox(par0 - par8 + 1 + par5, par1 + par4, par2 + par3, par0 + par5, par1 + par7 - 1 + par4, par2 + par6 - 1 + par3); -+ -+ case 2: -+ return new StructureBoundingBox(par0 + par3, par1 + par4, par2 - par8 + 1 + par5, par0 + par6 - 1 + par3, par1 + par7 - 1 + par4, par2 + par5); -+ -+ case 3: -+ return new StructureBoundingBox(par0 + par5, par1 + par4, par2 + par3, par0 + par8 - 1 + par5, par1 + par7 - 1 + par4, par2 + par6 - 1 + par3); -+ -+ default: -+ return new StructureBoundingBox(par0 + par3, par1 + par4, par2 + par5, par0 + par6 - 1 + par3, par1 + par7 - 1 + par4, par2 + par8 - 1 + par5); - } - } - -- public StructureBoundingBox(StructureBoundingBox var1) { -- this.minX = var1.minX; -- this.minY = var1.minY; -- this.minZ = var1.minZ; -- this.maxX = var1.maxX; -- this.maxY = var1.maxY; -- this.maxZ = var1.maxZ; -- } -- -- public StructureBoundingBox(int var1, int var2, int var3, int var4, int var5, int var6) { -- this.minX = var1; -- this.minY = var2; -- this.minZ = var3; -- this.maxX = var4; -- this.maxY = var5; -- this.maxZ = var6; -- } -- -- public StructureBoundingBox(int var1, int var2, int var3, int var4) { -- this.minX = var1; -- this.minZ = var2; -- this.maxX = var3; -- this.maxZ = var4; -+ public StructureBoundingBox(StructureBoundingBox par1StructureBoundingBox) { -+ this.minX = par1StructureBoundingBox.minX; -+ this.minY = par1StructureBoundingBox.minY; -+ this.minZ = par1StructureBoundingBox.minZ; -+ this.maxX = par1StructureBoundingBox.maxX; -+ this.maxY = par1StructureBoundingBox.maxY; -+ this.maxZ = par1StructureBoundingBox.maxZ; -+ } -+ -+ public StructureBoundingBox(int par1, int par2, int par3, int par4, int par5, int par6) { -+ this.minX = par1; -+ this.minY = par2; -+ this.minZ = par3; -+ this.maxX = par4; -+ this.maxY = par5; -+ this.maxZ = par6; -+ } -+ -+ public StructureBoundingBox(int par1, int par2, int par3, int par4) { -+ this.minX = par1; -+ this.minZ = par2; -+ this.maxX = par3; -+ this.maxZ = par4; - this.minY = 1; - this.maxY = 512; - } - -- public boolean intersectsWith(StructureBoundingBox var1) { -- return this.maxX >= var1.minX && this.minX <= var1.maxX && this.maxZ >= var1.minZ && this.minZ <= var1.maxZ && this.maxY >= var1.minY && this.minY <= var1.maxY; -- } -- -- public boolean intersectsWith(int var1, int var2, int var3, int var4) { -- return this.maxX >= var1 && this.minX <= var3 && this.maxZ >= var2 && this.minZ <= var4; -- } -- -- public void expandTo(StructureBoundingBox var1) { -- this.minX = Math.min(this.minX, var1.minX); -- this.minY = Math.min(this.minY, var1.minY); -- this.minZ = Math.min(this.minZ, var1.minZ); -- this.maxX = Math.max(this.maxX, var1.maxX); -- this.maxY = Math.max(this.maxY, var1.maxY); -- this.maxZ = Math.max(this.maxZ, var1.maxZ); -- } -- -- public void offset(int var1, int var2, int var3) { -- this.minX += var1; -- this.minY += var2; -- this.minZ += var3; -- this.maxX += var1; -- this.maxY += var2; -- this.maxZ += var3; -- } -- -- public boolean isVecInside(int var1, int var2, int var3) { -- return var1 >= this.minX && var1 <= this.maxX && var3 >= this.minZ && var3 <= this.maxZ && var2 >= this.minY && var2 <= this.maxY; -- } -- -+ /** -+ * Returns whether the given bounding box intersects with this one. Args: structureboundingbox -+ */ -+ public boolean intersectsWith(StructureBoundingBox par1StructureBoundingBox) { -+ return this.maxX >= par1StructureBoundingBox.minX && this.minX <= par1StructureBoundingBox.maxX && this.maxZ >= par1StructureBoundingBox.minZ && this.minZ <= par1StructureBoundingBox.maxZ && this.maxY >= par1StructureBoundingBox.minY && this.minY <= par1StructureBoundingBox.maxY; -+ } -+ -+ /** -+ * Discover if a coordinate is inside the bounding box area. -+ */ -+ public boolean intersectsWith(int par1, int par2, int par3, int par4) { -+ return this.maxX >= par1 && this.minX <= par3 && this.maxZ >= par2 && this.minZ <= par4; -+ } -+ -+ /** -+ * Expands a bounding box's dimensions to include the supplied bounding box. -+ */ -+ public void expandTo(StructureBoundingBox par1StructureBoundingBox) { -+ this.minX = Math.min(this.minX, par1StructureBoundingBox.minX); -+ this.minY = Math.min(this.minY, par1StructureBoundingBox.minY); -+ this.minZ = Math.min(this.minZ, par1StructureBoundingBox.minZ); -+ this.maxX = Math.max(this.maxX, par1StructureBoundingBox.maxX); -+ this.maxY = Math.max(this.maxY, par1StructureBoundingBox.maxY); -+ this.maxZ = Math.max(this.maxZ, par1StructureBoundingBox.maxZ); -+ } -+ -+ /** -+ * Offsets the current bounding box by the specified coordinates. Args: x, y, z -+ */ -+ public void offset(int par1, int par2, int par3) { -+ this.minX += par1; -+ this.minY += par2; -+ this.minZ += par3; -+ this.maxX += par1; -+ this.maxY += par2; -+ this.maxZ += par3; -+ } -+ -+ /** -+ * Returns true if block is inside bounding box -+ */ -+ public boolean isVecInside(int par1, int par2, int par3) { -+ return par1 >= this.minX && par1 <= this.maxX && par3 >= this.minZ && par3 <= this.maxZ && par2 >= this.minY && par2 <= this.maxY; -+ } -+ -+ /** -+ * Returns width of a bounding box -+ */ - public int getXSize() { - return this.maxX - this.minX + 1; - } - -+ /** -+ * Returns height of a bounding box -+ */ - public int getYSize() { - return this.maxY - this.minY + 1; - } - -+ /** -+ * Returns length of a bounding box -+ */ - public int getZSize() { - return this.maxZ - this.minZ + 1; - } -@@ -127,7 +171,7 @@ - return "(" + this.minX + ", " + this.minY + ", " + this.minZ + "; " + this.maxX + ", " + this.maxY + ", " + this.maxZ + ")"; - } - -- public NBTTagIntArray func_143047_a(String var1) { -- return new NBTTagIntArray(var1, new int[]{this.minX, this.minY, this.minZ, this.maxX, this.maxY, this.maxZ}); -+ public NBTTagIntArray func_143047_a(String par1Str) { -+ return new NBTTagIntArray(par1Str, new int[] {this.minX, this.minY, this.minZ, this.maxX, this.maxY, this.maxZ}); - } - } ---- net/minecraft/src/ICommandManager.java -+++ net/minecraft/src/ICommandManager.java -@@ -6,9 +6,18 @@ - public interface ICommandManager { - int executeCommand(ICommandSender var1, String var2); - -+ /** -+ * Performs a "begins with" string match on each token in par2. Only returns commands that par1 can use. -+ */ - List getPossibleCommands(ICommandSender var1, String var2); - -+ /** -+ * returns all commands that the commandSender can use -+ */ - List getPossibleCommands(ICommandSender var1); - -+ /** -+ * returns a map of string to commads. All commands are returned, not just ones which someone has permission to use. -+ */ - Map getCommands(); - } ---- /dev/null -+++ org/spoutcraft/client/gui/minimap/ColorToggleCheckBox.java -@@ -1,0 +1,35 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.client.gui.minimap; -+ -+import org.spoutcraft.api.gui.GenericCheckBox; -+ -+public class ColorToggleCheckBox extends GenericCheckBox { -+ public ColorToggleCheckBox() { -+ super("Black and White"); -+ setChecked(!MinimapConfig.getInstance().isColor()); -+ setTooltip("Black and White\nRemoves color from the minimap."); -+ } -+ -+ @Override -+ public void onButtonClick() { -+ MinimapConfig.getInstance().setColor(!isChecked()); -+ } -+} ---- net/minecraft/src/Icon.java -+++ net/minecraft/src/Icon.java -@@ -1,20 +1,45 @@ - package net.minecraft.src; - - public interface Icon { -+ -+ /** -+ * Returns the width of the icon, in pixels. -+ */ - int getIconWidth(); - -+ /** -+ * Returns the height of the icon, in pixels. -+ */ - int getIconHeight(); - -+ /** -+ * Returns the minimum U coordinate to use when rendering with this icon. -+ */ - float getMinU(); - -+ /** -+ * Returns the maximum U coordinate to use when rendering with this icon. -+ */ - float getMaxU(); - -+ /** -+ * Gets a U coordinate on the icon. 0 returns uMin and 16 returns uMax. Other arguments return in-between values. -+ */ - float getInterpolatedU(double var1); - -+ /** -+ * Returns the minimum V coordinate to use when rendering with this icon. -+ */ - float getMinV(); - -+ /** -+ * Returns the maximum V coordinate to use when rendering with this icon. -+ */ - float getMaxV(); - -+ /** -+ * Gets a V coordinate on the icon. 0 returns vMin and 16 returns vMax. Other arguments return in-between values. -+ */ - float getInterpolatedV(double var1); - - String getIconName(); ---- net/minecraft/src/CrashReport.java -+++ net/minecraft/src/CrashReport.java -@@ -12,20 +12,32 @@ - import java.util.List; - - public class CrashReport { -- private final String a; -- private final Throwable b; -+ -+ /** Description of the crash report. */ -+ private final String description; -+ -+ /** The Throwable that is the "cause" for this crash and Crash Report. */ -+ private final Throwable cause; - private final CrashReportCategory field_85061_c = new CrashReportCategory(this, "System Details"); -- private final List d = new ArrayList(); -- private File e; -+ -+ /** Holds the keys and values of all crash report sections. */ -+ private final List crashReportSections = new ArrayList(); -+ -+ /** File of crash report. */ -+ private File crashReportFile; - private boolean field_85059_f = true; -- private StackTraceElement[] g = new StackTraceElement[0]; -+ private StackTraceElement[] field_85060_g = new StackTraceElement[0]; - -- public CrashReport(String var1, Throwable var2) { -- this.a = var1; -- this.b = var2; -+ public CrashReport(String par1Str, Throwable par2Throwable) { -+ this.description = par1Str; -+ this.cause = par2Throwable; - this.populateEnvironment(); - } - -+ /** -+ * Populates this crash report with initial information about the running server and operating system / java -+ * environment -+ */ - private void populateEnvironment() { - this.field_85061_c.addCrashSectionCallable("Minecraft Version", new CallableMinecraftVersion(this)); - this.field_85061_c.addCrashSectionCallable("Operating System", new CallableOSInfo(this)); -@@ -38,68 +50,83 @@ - this.field_85061_c.addCrashSectionCallable("IntCache", new CallableIntCache(this)); - } - -+ /** -+ * Returns the description of the Crash Report. -+ */ - public String getDescription() { -- return this.a; -+ return this.description; - } - -+ /** -+ * Returns the Throwable object that is the cause for the crash and Crash Report. -+ */ - public Throwable getCrashCause() { -- return this.b; -+ return this.cause; - } - -- public void getSectionsInStringBuilder(StringBuilder var1) { -- if(this.g != null && this.g.length > 0) { -- var1.append("-- Head --\n"); -- var1.append("Stacktrace:\n"); -- StackTraceElement[] var2 = this.g; -+ /** -+ * Gets the various sections of the crash report into the given StringBuilder -+ */ -+ public void getSectionsInStringBuilder(StringBuilder par1StringBuilder) { -+ if (this.field_85060_g != null && this.field_85060_g.length > 0) { -+ par1StringBuilder.append("-- Head --\n"); -+ par1StringBuilder.append("Stacktrace:\n"); -+ StackTraceElement[] var2 = this.field_85060_g; - int var3 = var2.length; - -- for(int var4 = 0; var4 < var3; ++var4) { -+ for (int var4 = 0; var4 < var3; ++var4) { - StackTraceElement var5 = var2[var4]; -- var1.append("\t").append("at ").append(var5.toString()); -- var1.append("\n"); -+ par1StringBuilder.append("\t").append("at ").append(var5.toString()); -+ par1StringBuilder.append("\n"); - } - -- var1.append("\n"); -+ par1StringBuilder.append("\n"); - } - -- Iterator var6 = this.d.iterator(); -+ Iterator var6 = this.crashReportSections.iterator(); - -- while(var6.hasNext()) { -+ while (var6.hasNext()) { - CrashReportCategory var7 = (CrashReportCategory)var6.next(); -- var7.func_85072_a(var1); -- var1.append("\n\n"); -+ var7.func_85072_a(par1StringBuilder); -+ par1StringBuilder.append("\n\n"); - } - -- this.field_85061_c.func_85072_a(var1); -+ this.field_85061_c.func_85072_a(par1StringBuilder); - } - -+ /** -+ * Gets the stack trace of the Throwable that caused this crash report, or if that fails, the cause .toString(). -+ */ - public String getCauseStackTraceOrString() { - StringWriter var1 = null; - PrintWriter var2 = null; -- String var3 = this.b.toString(); -+ String var3 = this.cause.toString(); - - try { - var1 = new StringWriter(); - var2 = new PrintWriter(var1); -- this.b.printStackTrace(var2); -+ this.cause.printStackTrace(var2); - var3 = var1.toString(); - } finally { - try { -- if(var1 != null) { -+ if (var1 != null) { - var1.close(); - } - -- if(var2 != null) { -+ if (var2 != null) { - var2.close(); - } - } catch (IOException var10) { -+ ; - } -- - } - - return var3; - } - -+ /** -+ * Gets the complete report with headers, stack trace, and different sections as a string. -+ */ - public String getCompleteReport() { - StringBuilder var1 = new StringBuilder(); - var1.append("---- Minecraft Crash Report ----\n"); -@@ -110,12 +137,12 @@ - var1.append((new SimpleDateFormat()).format(new Date())); - var1.append("\n"); - var1.append("Description: "); -- var1.append(this.a); -+ var1.append(this.description); - var1.append("\n\n"); - var1.append(this.getCauseStackTraceOrString()); - var1.append("\n\nA detailed walkthrough of the error, its code path and all known details is as follows:\n"); - -- for(int var2 = 0; var2 < 87; ++var2) { -+ for (int var2 = 0; var2 < 87; ++var2) { - var1.append("-"); - } - -@@ -124,26 +151,32 @@ - return var1.toString(); - } - -+ /** -+ * Gets the file this crash report is saved into. -+ */ - public File getFile() { -- return this.e; -+ return this.crashReportFile; - } - -- public boolean saveToFile(File var1, ILogAgent var2) { -- if(this.e != null) { -+ /** -+ * Saves the complete crash report to the given File. -+ */ -+ public boolean saveToFile(File par1File, ILogAgent par2ILogAgent) { -+ if (this.crashReportFile != null) { - return false; - } else { -- if(var1.getParentFile() != null) { -- var1.getParentFile().mkdirs(); -+ if (par1File.getParentFile() != null) { -+ par1File.getParentFile().mkdirs(); - } - - try { -- FileWriter var3 = new FileWriter(var1); -+ FileWriter var3 = new FileWriter(par1File); - var3.write(this.getCompleteReport()); - var3.close(); -- this.e = var1; -+ this.crashReportFile = par1File; - return true; - } catch (Throwable var4) { -- var2.logSevereException("Could not save crash report to " + var1, var4); -+ par2ILogAgent.logSevereException("Could not save crash report to " + par1File, var4); - return false; - } - } -@@ -153,42 +186,55 @@ - return this.field_85061_c; - } - -- public CrashReportCategory makeCategory(String var1) { -- return this.makeCategoryDepth(var1, 1); -+ /** -+ * Creates a CrashReportCategory -+ */ -+ public CrashReportCategory makeCategory(String par1Str) { -+ return this.makeCategoryDepth(par1Str, 1); - } - -- public CrashReportCategory makeCategoryDepth(String var1, int var2) { -- CrashReportCategory var3 = new CrashReportCategory(this, var1); -- if(this.field_85059_f) { -- int var4 = var3.func_85073_a(var2); -- StackTraceElement[] var5 = this.b.getStackTrace(); -+ /** -+ * Creates a CrashReportCategory for the given stack trace depth -+ */ -+ public CrashReportCategory makeCategoryDepth(String par1Str, int par2) { -+ CrashReportCategory var3 = new CrashReportCategory(this, par1Str); -+ -+ if (this.field_85059_f) { -+ int var4 = var3.func_85073_a(par2); -+ StackTraceElement[] var5 = this.cause.getStackTrace(); - StackTraceElement var6 = null; - StackTraceElement var7 = null; -- if(var5 != null && var5.length - var4 < var5.length) { -+ -+ if (var5 != null && var5.length - var4 < var5.length) { - var6 = var5[var5.length - var4]; -- if(var5.length + 1 - var4 < var5.length) { -+ -+ if (var5.length + 1 - var4 < var5.length) { - var7 = var5[var5.length + 1 - var4]; - } - } - - this.field_85059_f = var3.func_85069_a(var6, var7); -- if(var4 > 0 && !this.d.isEmpty()) { -- CrashReportCategory var8 = (CrashReportCategory)this.d.get(this.d.size() - 1); -+ -+ if (var4 > 0 && !this.crashReportSections.isEmpty()) { -+ CrashReportCategory var8 = (CrashReportCategory)this.crashReportSections.get(this.crashReportSections.size() - 1); - var8.func_85070_b(var4); -- } else if(var5 != null && var5.length >= var4) { -- this.g = new StackTraceElement[var5.length - var4]; -- System.arraycopy(var5, 0, this.g, 0, this.g.length); -+ } else if (var5 != null && var5.length >= var4) { -+ this.field_85060_g = new StackTraceElement[var5.length - var4]; -+ System.arraycopy(var5, 0, this.field_85060_g, 0, this.field_85060_g.length); - } else { - this.field_85059_f = false; - } - } - -- this.d.add(var3); -+ this.crashReportSections.add(var3); - return var3; - } - -+ /** -+ * Gets a random witty comment for inclusion in this CrashReport -+ */ - private static String getWittyComment() { -- String[] var0 = new String[]{"Who set us up the TNT?", "Everything\'s going to plan. No, really, that was supposed to happen.", "Uh... Did I do that?", "Oops.", "Why did you do that?", "I feel sad now :(", "My bad.", "I\'m sorry, Dave.", "I let you down. Sorry :(", "On the bright side, I bought you a teddy bear!", "Daisy, daisy...", "Oh - I know what I did wrong!", "Hey, that tickles! Hehehe!", "I blame Dinnerbone.", "You should try our sister game, Minceraft!", "Don\'t be sad. I\'ll do better next time, I promise!", "Don\'t be sad, have a hug! <3", "I just don\'t know what went wrong :(", "Shall we play a game?", "Quite honestly, I wouldn\'t worry myself about that.", "I bet Cylons wouldn\'t have this problem.", "Sorry :(", "Surprise! Haha. Well, this is awkward.", "Would you like a cupcake?", "Hi. I\'m Minecraft, and I\'m a crashaholic.", "Ooh. Shiny.", "This doesn\'t make any sense!", "Why is it breaking :(", "Don\'t do that.", "Ouch. That hurt :(", "You\'re mean.", "This is a token for 1 free hug. Redeem at your nearest Mojangsta: [~~HUG~~]", "There are four lights!"}; -+ String[] var0 = new String[] {"Who set us up the TNT?", "Everything\'s going to plan. No, really, that was supposed to happen.", "Uh... Did I do that?", "Oops.", "Why did you do that?", "I feel sad now :(", "My bad.", "I\'m sorry, Dave.", "I let you down. Sorry :(", "On the bright side, I bought you a teddy bear!", "Daisy, daisy...", "Oh - I know what I did wrong!", "Hey, that tickles! Hehehe!", "I blame Dinnerbone.", "You should try our sister game, Minceraft!", "Don\'t be sad. I\'ll do better next time, I promise!", "Don\'t be sad, have a hug! <3", "I just don\'t know what went wrong :(", "Shall we play a game?", "Quite honestly, I wouldn\'t worry myself about that.", "I bet Cylons wouldn\'t have this problem.", "Sorry :(", "Surprise! Haha. Well, this is awkward.", "Would you like a cupcake?", "Hi. I\'m Minecraft, and I\'m a crashaholic.", "Ooh. Shiny.", "This doesn\'t make any sense!", "Why is it breaking :(", "Don\'t do that.", "Ouch. That hurt :(", "You\'re mean.", "This is a token for 1 free hug. Redeem at your nearest Mojangsta: [~~HUG~~]", "There are four lights!"}; - - try { - return var0[(int)(System.nanoTime() % (long)var0.length)]; -@@ -197,12 +243,16 @@ - } - } - -- public static CrashReport makeCrashReport(Throwable var0, String var1) { -+ /** -+ * Creates a crash report for the exception -+ */ -+ public static CrashReport makeCrashReport(Throwable par0Throwable, String par1Str) { - CrashReport var2; -- if(var0 instanceof ReportedException) { -- var2 = ((ReportedException)var0).getCrashReport(); -+ -+ if (par0Throwable instanceof ReportedException) { -+ var2 = ((ReportedException)par0Throwable).getCrashReport(); - } else { -- var2 = new CrashReport(var1, var0); -+ var2 = new CrashReport(par1Str, par0Throwable); - } - - return var2; ---- net/minecraft/src/TextureMetadataSectionSerializer.java -+++ net/minecraft/src/TextureMetadataSectionSerializer.java -@@ -6,18 +6,21 @@ - import java.lang.reflect.Type; - - public class TextureMetadataSectionSerializer extends BaseMetadataSectionSerializer { -- public TextureMetadataSection func_110494_a(JsonElement var1, Type var2, JsonDeserializationContext var3) { -- JsonObject var4 = var1.getAsJsonObject(); -+ public TextureMetadataSection func_110494_a(JsonElement par1JsonElement, Type par2Type, JsonDeserializationContext par3JsonDeserializationContext) { -+ JsonObject var4 = par1JsonElement.getAsJsonObject(); - boolean var5 = this.func_110484_a(var4.get("blur"), "blur", Boolean.valueOf(false)); - boolean var6 = this.func_110484_a(var4.get("clamp"), "clamp", Boolean.valueOf(false)); - return new TextureMetadataSection(var5, var6); - } - -+ /** -+ * The name of this section type as it appears in JSON. -+ */ - public String getSectionName() { - return "texture"; - } - -- public Object deserialize(JsonElement var1, Type var2, JsonDeserializationContext var3) { -- return this.func_110494_a(var1, var2, var3); -+ public Object deserialize(JsonElement par1JsonElement, Type par2Type, JsonDeserializationContext par3JsonDeserializationContext) { -+ return this.func_110494_a(par1JsonElement, par2Type, par3JsonDeserializationContext); - } - } ---- net/minecraft/src/CommandServerBanlist.java -+++ net/minecraft/src/CommandServerBanlist.java -@@ -8,30 +8,38 @@ - return "banlist"; - } - -+ /** -+ * Return the required permission level for this command. -+ */ - public int getRequiredPermissionLevel() { - return 3; - } - -- public boolean canCommandSenderUseCommand(ICommandSender var1) { -- return (MinecraftServer.getServer().getConfigurationManager().getBannedIPs().isListActive() || MinecraftServer.getServer().getConfigurationManager().getBannedPlayers().isListActive()) && super.canCommandSenderUseCommand(var1); -+ /** -+ * Returns true if the given command sender is allowed to use this command. -+ */ -+ public boolean canCommandSenderUseCommand(ICommandSender par1ICommandSender) { -+ return (MinecraftServer.getServer().getConfigurationManager().getBannedIPs().isListActive() || MinecraftServer.getServer().getConfigurationManager().getBannedPlayers().isListActive()) && super.canCommandSenderUseCommand(par1ICommandSender); - } - -- public String getCommandUsage(ICommandSender var1) { -+ public String getCommandUsage(ICommandSender par1ICommandSender) { - return "commands.banlist.usage"; - } - -- public void processCommand(ICommandSender var1, String[] var2) { -- if(var2.length >= 1 && var2[0].equalsIgnoreCase("ips")) { -- var1.sendChatToPlayer(ChatMessageComponent.createFromTranslationWithSubstitutions("commands.banlist.ips", new Object[]{Integer.valueOf(MinecraftServer.getServer().getConfigurationManager().getBannedIPs().getBannedList().size())})); -- var1.sendChatToPlayer(ChatMessageComponent.createFromText(joinNiceString(MinecraftServer.getServer().getConfigurationManager().getBannedIPs().getBannedList().keySet().toArray()))); -+ public void processCommand(ICommandSender par1ICommandSender, String[] par2ArrayOfStr) { -+ if (par2ArrayOfStr.length >= 1 && par2ArrayOfStr[0].equalsIgnoreCase("ips")) { -+ par1ICommandSender.sendChatToPlayer(ChatMessageComponent.createFromTranslationWithSubstitutions("commands.banlist.ips", new Object[] {Integer.valueOf(MinecraftServer.getServer().getConfigurationManager().getBannedIPs().getBannedList().size())})); -+ par1ICommandSender.sendChatToPlayer(ChatMessageComponent.createFromText(joinNiceString(MinecraftServer.getServer().getConfigurationManager().getBannedIPs().getBannedList().keySet().toArray()))); - } else { -- var1.sendChatToPlayer(ChatMessageComponent.createFromTranslationWithSubstitutions("commands.banlist.players", new Object[]{Integer.valueOf(MinecraftServer.getServer().getConfigurationManager().getBannedPlayers().getBannedList().size())})); -- var1.sendChatToPlayer(ChatMessageComponent.createFromText(joinNiceString(MinecraftServer.getServer().getConfigurationManager().getBannedPlayers().getBannedList().keySet().toArray()))); -+ par1ICommandSender.sendChatToPlayer(ChatMessageComponent.createFromTranslationWithSubstitutions("commands.banlist.players", new Object[] {Integer.valueOf(MinecraftServer.getServer().getConfigurationManager().getBannedPlayers().getBannedList().size())})); -+ par1ICommandSender.sendChatToPlayer(ChatMessageComponent.createFromText(joinNiceString(MinecraftServer.getServer().getConfigurationManager().getBannedPlayers().getBannedList().keySet().toArray()))); - } -- - } - -- public List addTabCompletionOptions(ICommandSender var1, String[] var2) { -- return var2.length == 1 ? getListOfStringsMatchingLastWord(var2, new String[]{"players", "ips"}) : null; -+ /** -+ * Adds the strings available in this command to the given list of tab completion options. -+ */ -+ public List addTabCompletionOptions(ICommandSender par1ICommandSender, String[] par2ArrayOfStr) { -+ return par2ArrayOfStr.length == 1 ? getListOfStringsMatchingLastWord(par2ArrayOfStr, new String[] {"players", "ips"}): null; - } - } ---- /dev/null -+++ org/spoutcraft/client/gui/settings/controls/FancyWeatherButton.java -@@ -1,0 +1,41 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.client.gui.settings.controls; -+ -+import java.util.UUID; -+ -+import org.spoutcraft.client.config.Configuration; -+ -+public class FancyWeatherButton extends AutomatedCheckBox { -+ UUID fancyGraphics; -+ public FancyWeatherButton(UUID fancyGraphics) { -+ super("Fancy Weather"); -+ this.fancyGraphics = fancyGraphics; -+ setChecked(Configuration.isFancyWeather()); -+ setTooltip("Fancy Weather\nDefault - as set by setting Graphics\nFast - light rain/snow, faster\nFancy - heavy rain/snow, slower\nOFF - no rain/snow, fastest\nWhen rain is OFF the splashes and rain sounds\nare still active."); -+ } -+ -+ @Override -+ public void onButtonClick() { -+ Configuration.setFancyWeather(!Configuration.isFancyWeather()); -+ Configuration.write(); -+ ((FancyGraphicsButton)getScreen().getWidget(fancyGraphics)).custom = true; -+ } -+} ---- net/minecraft/src/CallableSuspiciousClasses.java -+++ net/minecraft/src/CallableSuspiciousClasses.java -@@ -11,15 +11,22 @@ - class CallableSuspiciousClasses implements Callable { - final CrashReport theCrashReport; - -- CallableSuspiciousClasses(CrashReport var1) { -- this.theCrashReport = var1; -+ CallableSuspiciousClasses(CrashReport par1CrashReport) { -+ this.theCrashReport = par1CrashReport; - } - -- public String callSuspiciousClasses() throws Exception { -+ public String callSuspiciousClasses() throws SecurityException, NoSuchFieldException, IllegalAccessException, IllegalArgumentException { - StringBuilder var1 = new StringBuilder(); -- Field var2 = ClassLoader.class.getDeclaredField("classes"); -- var2.setAccessible(true); -- ArrayList var3 = new ArrayList((Vector)var2.get(CrashReport.class.getClassLoader())); -+ ArrayList var3; -+ -+ try { -+ Field var2 = ClassLoader.class.getDeclaredField("classes"); -+ var2.setAccessible(true); -+ var3 = new ArrayList((Vector)var2.get(CrashReport.class.getClassLoader())); -+ } catch (Exception ex) { -+ return ""; -+ } -+ - boolean var4 = true; - boolean var5 = !CrashReport.class.getCanonicalName().equals("net.minecraft.CrashReport"); - HashMap var6 = new HashMap(); -@@ -27,105 +34,80 @@ - Collections.sort(var3, new ComparatorClassSorter(this)); - Iterator var8 = var3.iterator(); - -- while(true) { -- while(true) { -- Class var9; -- while(true) { -- String var10; -- do { -- do { -- do { -- do { -- do { -- do { -- do { -- do { -- do { -- do { -- do { -- do { -- if(!var8.hasNext()) { -- if(var4) { -- var1.append("No suspicious classes found."); -- } else { -- var1.append("]"); -- } -- -- return var1.toString(); -- } -- -- var9 = (Class)var8.next(); -- } while(var9 == null); -- -- var10 = var9.getCanonicalName(); -- } while(var10 == null); -- } while(var10.startsWith("org.lwjgl.")); -- } while(var10.startsWith("paulscode.")); -- } while(var10.startsWith("org.bouncycastle.")); -- } while(var10.startsWith("argo.")); -- } while(var10.startsWith("com.jcraft.")); -- } while(var10.startsWith("com.fasterxml.")); -- } while(var10.startsWith("com.google.")); -- } while(var10.startsWith("joptsimple.")); -- } while(var10.startsWith("org.apache.")); -- } while(var10.equals("util.GLX")); -- -- if(var5) { -- if(var10.length() > 3 && !var10.equals("net.minecraft.client.main.Main") && !var10.equals("net.minecraft.client.Minecraft") && !var10.equals("net.minecraft.client.ClientBrandRetriever") && !var10.equals("net.minecraft.server.MinecraftServer")) { -- break; -+ while (var8.hasNext()) { -+ Class var9 = (Class)var8.next(); -+ -+ if (var9 != null) { -+ String var10 = var9.getCanonicalName(); -+ -+ if (var10 != null && !var10.startsWith("org.lwjgl.") && !var10.startsWith("paulscode.") && !var10.startsWith("org.bouncycastle.") && !var10.startsWith("argo.") && !var10.startsWith("com.jcraft.") && !var10.startsWith("com.fasterxml.") && !var10.startsWith("com.google.") && !var10.startsWith("joptsimple.") && !var10.startsWith("org.apache.") && !var10.equals("util.GLX")) { -+ if (var5) { -+ if (var10.length() <= 3 || var10.equals("net.minecraft.client.main.Main") || var10.equals("net.minecraft.client.Minecraft") || var10.equals("net.minecraft.client.ClientBrandRetriever") || var10.equals("net.minecraft.server.MinecraftServer")) { -+ continue; -+ } -+ } else if (var10.startsWith("net.minecraft")) { -+ continue; -+ } -+ -+ Package var11 = var9.getPackage(); -+ String var12 = var11 == null ? "" : var11.getName(); -+ -+ if (var6.containsKey(var12)) { -+ int var13 = ((Integer)var6.get(var12)).intValue(); -+ var6.put(var12, Integer.valueOf(var13 + 1)); -+ -+ if (var13 == 3) { -+ if (!var4) { -+ var1.append(", "); -+ } -+ -+ var1.append("..."); -+ var4 = false; -+ continue; -+ } -+ -+ if (var13 > 3) { -+ continue; - } - } else { -- if(var10.startsWith("net.minecraft")) { -- continue; -- } -- break; -- } -- } -- -- Package var11 = var9.getPackage(); -- String var12 = var11 == null ? "" : var11.getName(); -- if(var6.containsKey(var12)) { -- int var13 = ((Integer)var6.get(var12)).intValue(); -- var6.put(var12, Integer.valueOf(var13 + 1)); -- if(var13 == 3) { -- if(!var4) { -- var1.append(", "); -- } -- -- var1.append("..."); -- var4 = false; -- continue; -- } -- -- if(var13 > 3) { -- continue; -- } -- } else { -- var6.put(var12, Integer.valueOf(1)); -- } -- -- if(!var7.equals(var12) && var7.length() > 0) { -- var1.append("], "); -- } -- -- if(!var4 && var7.equals(var12)) { -- var1.append(", "); -- } -- -- if(!var7.equals(var12)) { -- var1.append("["); -- var1.append(var12); -- var1.append("."); -- } -- -- var1.append(var9.getSimpleName()); -- var7 = var12; -- var4 = false; -+ var6.put(var12, Integer.valueOf(1)); -+ } -+ -+ if (!var7.equals(var12) && var7.length() > 0) { -+ var1.append("], "); -+ } -+ -+ if (!var4 && var7.equals(var12)) { -+ var1.append(", "); -+ } -+ -+ if (!var7.equals(var12)) { -+ var1.append("["); -+ var1.append(var12); -+ var1.append("."); -+ } -+ -+ var1.append(var9.getSimpleName()); -+ var7 = var12; -+ var4 = false; -+ } - } - } -+ -+ if (var4) { -+ var1.append("No suspicious classes found."); -+ } else { -+ var1.append("]"); -+ } -+ -+ return var1.toString(); - } - -- public Object call() throws Exception { -- return this.callSuspiciousClasses(); -+ public Object call() { -+ try { -+ return this.callSuspiciousClasses(); -+ } catch (Exception ex) { -+ return null; -+ } - } - } ---- net/minecraft/src/CrashReportCategory.java -+++ net/minecraft/src/CrashReportCategory.java -@@ -7,30 +7,32 @@ - - public class CrashReportCategory { - private final CrashReport theCrashReport; -- private final String b; -- private final List c = new ArrayList(); -- private StackTraceElement[] d = new StackTraceElement[0]; -- -- public CrashReportCategory(CrashReport var1, String var2) { -- this.theCrashReport = var1; -- this.b = var2; -- } -- -- public static String func_85074_a(double var0, double var2, double var4) { -- return String.format("%.2f,%.2f,%.2f - %s", new Object[]{Double.valueOf(var0), Double.valueOf(var2), Double.valueOf(var4), getLocationInfo(MathHelper.floor_double(var0), MathHelper.floor_double(var2), MathHelper.floor_double(var4))}); -- } -- -- public static String getLocationInfo(int var0, int var1, int var2) { -+ private final String field_85076_b; -+ private final List field_85077_c = new ArrayList(); -+ private StackTraceElement[] stackTrace = new StackTraceElement[0]; -+ -+ public CrashReportCategory(CrashReport par1CrashReport, String par2Str) { -+ this.theCrashReport = par1CrashReport; -+ this.field_85076_b = par2Str; -+ } -+ -+ public static String func_85074_a(double par0, double par2, double par4) { -+ return String.format("%.2f,%.2f,%.2f - %s", new Object[] {Double.valueOf(par0), Double.valueOf(par2), Double.valueOf(par4), getLocationInfo(MathHelper.floor_double(par0), MathHelper.floor_double(par2), MathHelper.floor_double(par4))}); -+ } -+ -+ /** -+ * Returns a string with world information on location.Args:x,y,z -+ */ -+ public static String getLocationInfo(int par0, int par1, int par2) { - StringBuilder var3 = new StringBuilder(); - - try { -- var3.append(String.format("World: (%d,%d,%d)", new Object[]{Integer.valueOf(var0), Integer.valueOf(var1), Integer.valueOf(var2)})); -+ var3.append(String.format("World: (%d,%d,%d)", new Object[] {Integer.valueOf(par0), Integer.valueOf(par1), Integer.valueOf(par2)})); - } catch (Throwable var16) { - var3.append("(Error finding world loc)"); - } - - var3.append(", "); -- - int var4; - int var5; - int var6; -@@ -40,17 +42,18 @@ - int var10; - int var11; - int var12; -+ - try { -- var4 = var0 >> 4; -- var5 = var2 >> 4; -- var6 = var0 & 15; -- var7 = var1 >> 4; -- var8 = var2 & 15; -+ var4 = par0 >> 4; -+ var5 = par2 >> 4; -+ var6 = par0 & 15; -+ var7 = par1 >> 4; -+ var8 = par2 & 15; - var9 = var4 << 4; - var10 = var5 << 4; - var11 = (var4 + 1 << 4) - 1; - var12 = (var5 + 1 << 4) - 1; -- var3.append(String.format("Chunk: (at %d,%d,%d in %d,%d; contains blocks %d,0,%d to %d,255,%d)", new Object[]{Integer.valueOf(var6), Integer.valueOf(var7), Integer.valueOf(var8), Integer.valueOf(var4), Integer.valueOf(var5), Integer.valueOf(var9), Integer.valueOf(var10), Integer.valueOf(var11), Integer.valueOf(var12)})); -+ var3.append(String.format("Chunk: (at %d,%d,%d in %d,%d; contains blocks %d,0,%d to %d,255,%d)", new Object[] {Integer.valueOf(var6), Integer.valueOf(var7), Integer.valueOf(var8), Integer.valueOf(var4), Integer.valueOf(var5), Integer.valueOf(var9), Integer.valueOf(var10), Integer.valueOf(var11), Integer.valueOf(var12)})); - } catch (Throwable var15) { - var3.append("(Error finding chunk loc)"); - } -@@ -58,8 +61,8 @@ - var3.append(", "); - - try { -- var4 = var0 >> 9; -- var5 = var2 >> 9; -+ var4 = par0 >> 9; -+ var5 = par2 >> 9; - var6 = var4 << 5; - var7 = var5 << 5; - var8 = (var4 + 1 << 5) - 1; -@@ -68,7 +71,7 @@ - var11 = var5 << 9; - var12 = (var4 + 1 << 9) - 1; - int var13 = (var5 + 1 << 9) - 1; -- var3.append(String.format("Region: (%d,%d; contains chunks %d,%d to %d,%d, blocks %d,0,%d to %d,255,%d)", new Object[]{Integer.valueOf(var4), Integer.valueOf(var5), Integer.valueOf(var6), Integer.valueOf(var7), Integer.valueOf(var8), Integer.valueOf(var9), Integer.valueOf(var10), Integer.valueOf(var11), Integer.valueOf(var12), Integer.valueOf(var13)})); -+ var3.append(String.format("Region: (%d,%d; contains chunks %d,%d to %d,%d, blocks %d,0,%d to %d,255,%d)", new Object[] {Integer.valueOf(var4), Integer.valueOf(var5), Integer.valueOf(var6), Integer.valueOf(var7), Integer.valueOf(var8), Integer.valueOf(var9), Integer.valueOf(var10), Integer.valueOf(var11), Integer.valueOf(var12), Integer.valueOf(var13)})); - } catch (Throwable var14) { - var3.append("(Error finding world loc)"); - } -@@ -76,40 +79,49 @@ - return var3.toString(); - } - -- public void addCrashSectionCallable(String var1, Callable var2) { -+ /** -+ * Adds a Crashreport section with the given name with the value set to the result of the given Callable; -+ */ -+ public void addCrashSectionCallable(String par1Str, Callable par2Callable) { - try { -- this.addCrashSection(var1, var2.call()); -+ this.addCrashSection(par1Str, par2Callable.call()); - } catch (Throwable var4) { -- this.addCrashSectionThrowable(var1, var4); -+ this.addCrashSectionThrowable(par1Str, var4); - } -- -- } -- -- public void addCrashSection(String var1, Object var2) { -- this.c.add(new CrashReportCategoryEntry(var1, var2)); -- } -- -- public void addCrashSectionThrowable(String var1, Throwable var2) { -- this.addCrashSection(var1, var2); -- } -- -- public int func_85073_a(int var1) { -+ } -+ -+ /** -+ * Adds a Crashreport section with the given name with the given value (convered .toString()) -+ */ -+ public void addCrashSection(String par1Str, Object par2Obj) { -+ this.field_85077_c.add(new CrashReportCategoryEntry(par1Str, par2Obj)); -+ } -+ -+ /** -+ * Adds a Crashreport section with the given name with the given Throwable -+ */ -+ public void addCrashSectionThrowable(String par1Str, Throwable par2Throwable) { -+ this.addCrashSection(par1Str, par2Throwable); -+ } -+ -+ public int func_85073_a(int par1) { - StackTraceElement[] var2 = Thread.currentThread().getStackTrace(); -- this.d = new StackTraceElement[var2.length - 3 - var1]; -- System.arraycopy(var2, 3 + var1, this.d, 0, this.d.length); -- return this.d.length; -+ this.stackTrace = new StackTraceElement[var2.length - 3 - par1]; -+ System.arraycopy(var2, 3 + par1, this.stackTrace, 0, this.stackTrace.length); -+ return this.stackTrace.length; - } - -- public boolean func_85069_a(StackTraceElement var1, StackTraceElement var2) { -- if(this.d.length != 0 && var1 != null) { -- StackTraceElement var3 = this.d[0]; -- if(var3.isNativeMethod() == var1.isNativeMethod() && var3.getClassName().equals(var1.getClassName()) && var3.getFileName().equals(var1.getFileName()) && var3.getMethodName().equals(var1.getMethodName())) { -- if(var2 != null != this.d.length > 1) { -+ public boolean func_85069_a(StackTraceElement par1StackTraceElement, StackTraceElement par2StackTraceElement) { -+ if (this.stackTrace.length != 0 && par1StackTraceElement != null) { -+ StackTraceElement var3 = this.stackTrace[0]; -+ -+ if (var3.isNativeMethod() == par1StackTraceElement.isNativeMethod() && var3.getClassName().equals(par1StackTraceElement.getClassName()) && var3.getFileName().equals(par1StackTraceElement.getFileName()) && var3.getMethodName().equals(par1StackTraceElement.getMethodName())) { -+ if (par2StackTraceElement != null != this.stackTrace.length > 1) { - return false; -- } else if(var2 != null && !this.d[1].equals(var2)) { -+ } else if (par2StackTraceElement != null && !this.stackTrace[1].equals(par2StackTraceElement)) { - return false; - } else { -- this.d[0] = var1; -+ this.stackTrace[0] = par1StackTraceElement; - return true; - } - } else { -@@ -120,42 +132,41 @@ - } - } - -- public void func_85070_b(int var1) { -- StackTraceElement[] var2 = new StackTraceElement[this.d.length - var1]; -- System.arraycopy(this.d, 0, var2, 0, var2.length); -- this.d = var2; -+ public void func_85070_b(int par1) { -+ StackTraceElement[] var2 = new StackTraceElement[this.stackTrace.length - par1]; -+ System.arraycopy(this.stackTrace, 0, var2, 0, var2.length); -+ this.stackTrace = var2; - } - -- public void func_85072_a(StringBuilder var1) { -- var1.append("-- ").append(this.b).append(" --\n"); -- var1.append("Details:"); -- Iterator var2 = this.c.iterator(); -+ public void func_85072_a(StringBuilder par1StringBuilder) { -+ par1StringBuilder.append("-- ").append(this.field_85076_b).append(" --\n"); -+ par1StringBuilder.append("Details:"); -+ Iterator var2 = this.field_85077_c.iterator(); - -- while(var2.hasNext()) { -+ while (var2.hasNext()) { - CrashReportCategoryEntry var3 = (CrashReportCategoryEntry)var2.next(); -- var1.append("\n\t"); -- var1.append(var3.func_85089_a()); -- var1.append(": "); -- var1.append(var3.func_85090_b()); -+ par1StringBuilder.append("\n\t"); -+ par1StringBuilder.append(var3.func_85089_a()); -+ par1StringBuilder.append(": "); -+ par1StringBuilder.append(var3.func_85090_b()); - } - -- if(this.d != null && this.d.length > 0) { -- var1.append("\nStacktrace:"); -- StackTraceElement[] var6 = this.d; -+ if (this.stackTrace != null && this.stackTrace.length > 0) { -+ par1StringBuilder.append("\nStacktrace:"); -+ StackTraceElement[] var6 = this.stackTrace; - int var7 = var6.length; - -- for(int var4 = 0; var4 < var7; ++var4) { -+ for (int var4 = 0; var4 < var7; ++var4) { - StackTraceElement var5 = var6[var4]; -- var1.append("\n\tat "); -- var1.append(var5.toString()); -+ par1StringBuilder.append("\n\tat "); -+ par1StringBuilder.append(var5.toString()); - } - } -- - } - -- public static void addBlockCrashInfo(CrashReportCategory var0, int var1, int var2, int var3, int var4, int var5) { -- var0.addCrashSectionCallable("Block type", new CallableBlockType(var4)); -- var0.addCrashSectionCallable("Block data value", new CallableBlockDataValue(var5)); -- var0.addCrashSectionCallable("Block location", new CallableBlockLocation(var1, var2, var3)); -+ public static void addBlockCrashInfo(CrashReportCategory par0CrashReportCategory, int par1, int par2, int par3, int par4, int par5) { -+ par0CrashReportCategory.addCrashSectionCallable("Block type", new CallableBlockType(par4)); -+ par0CrashReportCategory.addCrashSectionCallable("Block data value", new CallableBlockDataValue(par5)); -+ par0CrashReportCategory.addCrashSectionCallable("Block location", new CallableBlockLocation(par1, par2, par3)); - } - } ---- /dev/null -+++ org/spoutcraft/api/material/block/DoubleSlabs.java -@@ -1,0 +1,32 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.api.material.block; -+ -+import org.spoutcraft.api.material.SolidBlock; -+ -+public class DoubleSlabs extends GenericBlock implements SolidBlock { -+ public DoubleSlabs(String name, int id, int data) { -+ super(name, id, data); -+ } -+ -+ public boolean isFallingBlock() { -+ return false; -+ } -+} ---- net/minecraft/src/ModelMagmaCube.java -+++ net/minecraft/src/ModelMagmaCube.java -@@ -5,13 +5,14 @@ - ModelRenderer field_78108_b; - - public ModelMagmaCube() { -- for(int var1 = 0; var1 < this.field_78109_a.length; ++var1) { -+ for (int var1 = 0; var1 < this.field_78109_a.length; ++var1) { - byte var2 = 0; - int var3 = var1; -- if(var1 == 2) { -+ -+ if (var1 == 2) { - var2 = 24; - var3 = 10; -- } else if(var1 == 3) { -+ } else if (var1 == 3) { - var2 = 24; - var3 = 19; - } -@@ -24,26 +25,32 @@ - this.field_78108_b.addBox(-2.0F, 18.0F, -2.0F, 4, 4, 4); - } - -- public void setLivingAnimations(EntityLivingBase var1, float var2, float var3, float var4) { -- EntityMagmaCube var5 = (EntityMagmaCube)var1; -- float var6 = var5.prevSquishFactor + (var5.squishFactor - var5.prevSquishFactor) * var4; -- if(var6 < 0.0F) { -+ /** -+ * Used for easily adding entity-dependent animations. The second and third float params here are the same second and -+ * third as in the setRotationAngles method. -+ */ -+ public void setLivingAnimations(EntityLivingBase par1EntityLivingBase, float par2, float par3, float par4) { -+ EntityMagmaCube var5 = (EntityMagmaCube)par1EntityLivingBase; -+ float var6 = var5.prevSquishFactor + (var5.squishFactor - var5.prevSquishFactor) * par4; -+ -+ if (var6 < 0.0F) { - var6 = 0.0F; - } - -- for(int var7 = 0; var7 < this.field_78109_a.length; ++var7) { -+ for (int var7 = 0; var7 < this.field_78109_a.length; ++var7) { - this.field_78109_a[var7].rotationPointY = (float)(-(4 - var7)) * var6 * 1.7F; - } -- - } - -- public void render(Entity var1, float var2, float var3, float var4, float var5, float var6, float var7) { -- this.setRotationAngles(var2, var3, var4, var5, var6, var7, var1); -- this.field_78108_b.render(var7); -+ /** -+ * Sets the models various rotation angles then renders the model. -+ */ -+ public void render(Entity par1Entity, float par2, float par3, float par4, float par5, float par6, float par7) { -+ this.setRotationAngles(par2, par3, par4, par5, par6, par7, par1Entity); -+ this.field_78108_b.render(par7); - -- for(int var8 = 0; var8 < this.field_78109_a.length; ++var8) { -- this.field_78109_a[var8].render(var7); -+ for (int var8 = 0; var8 < this.field_78109_a.length; ++var8) { -+ this.field_78109_a[var8].render(par7); - } -- - } - } ---- net/minecraft/src/TileEntityEnderChestRenderer.java -+++ net/minecraft/src/TileEntityEnderChestRenderer.java -@@ -5,41 +5,48 @@ - - public class TileEntityEnderChestRenderer extends TileEntitySpecialRenderer { - private static final ResourceLocation field_110637_a = new ResourceLocation("textures/entity/chest/ender.png"); -+ -+ /** The Ender Chest Chest's model. */ - private ModelChest theEnderChestModel = new ModelChest(); - -- public void renderEnderChest(TileEntityEnderChest var1, double var2, double var4, double var6, float var8) { -+ /** -+ * Helps to render Ender Chest. -+ */ -+ public void renderEnderChest(TileEntityEnderChest par1TileEntityEnderChest, double par2, double par4, double par6, float par8) { - int var9 = 0; -- if(var1.hasWorldObj()) { -- var9 = var1.getBlockMetadata(); -+ -+ if (par1TileEntityEnderChest.hasWorldObj()) { -+ var9 = par1TileEntityEnderChest.getBlockMetadata(); - } - - this.bindTexture(field_110637_a); - GL11.glPushMatrix(); - GL11.glEnable(GL12.GL_RESCALE_NORMAL); - GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); -- GL11.glTranslatef((float)var2, (float)var4 + 1.0F, (float)var6 + 1.0F); -+ GL11.glTranslatef((float)par2, (float)par4 + 1.0F, (float)par6 + 1.0F); - GL11.glScalef(1.0F, -1.0F, -1.0F); - GL11.glTranslatef(0.5F, 0.5F, 0.5F); - short var10 = 0; -- if(var9 == 2) { -+ -+ if (var9 == 2) { - var10 = 180; - } - -- if(var9 == 3) { -+ if (var9 == 3) { - var10 = 0; - } - -- if(var9 == 4) { -+ if (var9 == 4) { - var10 = 90; - } - -- if(var9 == 5) { -+ if (var9 == 5) { - var10 = -90; - } - - GL11.glRotatef((float)var10, 0.0F, 1.0F, 0.0F); - GL11.glTranslatef(-0.5F, -0.5F, -0.5F); -- float var11 = var1.prevLidAngle + (var1.lidAngle - var1.prevLidAngle) * var8; -+ float var11 = par1TileEntityEnderChest.prevLidAngle + (par1TileEntityEnderChest.lidAngle - par1TileEntityEnderChest.prevLidAngle) * par8; - var11 = 1.0F - var11; - var11 = 1.0F - var11 * var11 * var11; - this.theEnderChestModel.chestLid.rotateAngleX = -(var11 * (float)Math.PI / 2.0F); -@@ -49,7 +56,7 @@ - GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - } - -- public void renderTileEntityAt(TileEntity var1, double var2, double var4, double var6, float var8) { -- this.renderEnderChest((TileEntityEnderChest)var1, var2, var4, var6, var8); -+ public void renderTileEntityAt(TileEntity par1TileEntity, double par2, double par4, double par6, float par8) { -+ this.renderEnderChest((TileEntityEnderChest)par1TileEntity, par2, par4, par6, par8); - } - } ---- /dev/null -+++ org/spoutcraft/client/gui/error/GuiUnexpectedError.java -@@ -1,0 +1,214 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.client.gui.error; -+ -+import java.awt.Desktop; -+import java.awt.Toolkit; -+import java.awt.datatransfer.StringSelection; -+import java.io.BufferedReader; -+import java.io.InputStreamReader; -+import java.io.OutputStreamWriter; -+import java.io.PrintWriter; -+import java.io.StringWriter; -+import java.net.URL; -+import java.net.URLConnection; -+ -+import org.lwjgl.Sys; -+import org.lwjgl.opengl.GL11; -+ -+import net.minecraft.src.Minecraft; -+import net.minecraft.src.GuiScreen; -+ -+import org.bukkit.ChatColor; -+ -+import org.spoutcraft.api.Spoutcraft; -+import org.spoutcraft.api.gui.Button; -+import org.spoutcraft.api.gui.Color; -+import org.spoutcraft.api.gui.GenericButton; -+import org.spoutcraft.api.gui.GenericLabel; -+import org.spoutcraft.api.gui.GenericScrollArea; -+import org.spoutcraft.api.gui.RenderPriority; -+import org.spoutcraft.api.gui.WidgetAnchor; -+import org.spoutcraft.client.SpoutClient; -+ -+public class GuiUnexpectedError extends GuiScreen { -+ private Throwable caused; -+ private GenericLabel hastebinLink; -+ -+ private String hastebinURL; -+ private boolean generated = false; -+ -+ public GuiUnexpectedError(Throwable caused) { -+ this.caused = caused; -+ } -+ -+ public void initGui() { -+ -+ GenericScrollArea screen = new GenericScrollArea(); -+ screen.setHeight(height - 16 - 24).setWidth(width).setY(16 + 24).setX(0); -+ getScreen().attachWidget("Spoutcraft", screen); -+ -+ GenericLabel label = new GenericLabel("Oh noes! An error has occurred!"); -+ int size = Spoutcraft.getMinecraftFont().getTextWidth(label.getText()); -+ label.setX((int) (width / 2 - size / 2)).setY(16); -+ label.setFixed(true).setPriority(RenderPriority.Lowest); -+ getScreen().attachWidget("Spoutcraft", label); -+ -+ int top = 60; -+ Color grey = new Color(0.80F, 0.80F, 0.80F, 0.65F); -+ -+ hastebinLink = new GenericLabel("Generating hastie..."); -+ hastebinLink.setX(95).setY(top); -+ hastebinLink.setTextColor(grey); -+ screen.attachWidget("Spoutcraft", hastebinLink); -+ generateHastie(); -+ -+ Button button = new CopyErrorURL(this).setText("Copy Link"); -+ button.setHeight(20).setWidth(80); -+ button.setX((int) (hastebinLink.getWidth() + hastebinLink.getX() + 10.0)); -+ button.setY(top-5); -+ button.setAlign(WidgetAnchor.TOP_CENTER); -+ screen.attachWidget("Spoutcraft", button); -+ -+ top += 25; -+ -+ button = new ReportErrorButton().setText("Report"); -+ button.setHeight(20).setWidth(70); -+ button.setX((int) (width / 2 - button.getWidth() - button.getWidth() / 2)); -+ button.setY(top); -+ button.setAlign(WidgetAnchor.TOP_CENTER); -+ screen.attachWidget("Spoutcraft", button); -+ -+ button = new IgnoreErrorButton().setText("Ignore"); -+ button.setHeight(20).setWidth(70); -+ button.setX((int) (width / 2 + button.getWidth() / 2)); -+ button.setY(top); -+ button.setAlign(WidgetAnchor.TOP_CENTER); -+ screen.attachWidget("Spoutcraft", button); -+ top += 30; -+ } -+ -+ @Override -+ public void drawScreen(int var1, int var2, float var3) { -+ drawDefaultBackground(); -+ } -+ -+ private void generateHastie() { -+ if (generated) { -+ hastebinLink.setText("Error Link: " + ChatColor.GREEN + hastebinURL); -+ return; -+ } -+ try { -+ StringBuilder builder = new StringBuilder("Spoutcraft Error Report:\n"); -+ builder.append(" Build: ").append(SpoutClient.getClientVersion()).append("\n"); -+ builder.append("-----------------------------------").append("\n"); -+ builder.append("Stack Trace:").append("\n"); -+ builder.append(" Exception: ").append(caused.getClass().getSimpleName()).append("\n"); -+ builder.append(" Message: ").append(caused.getMessage()).append("\n"); -+ builder.append(" Trace:").append("\n"); -+ -+ StringWriter sw = new StringWriter(); -+ caused.printStackTrace(new PrintWriter(sw)); -+ String causeString = sw.toString(); -+ builder.append(" ").append(sw).append("\n"); -+ -+ builder.append("-----------------------------------").append("\n"); -+ builder.append("Minecraft Information:\n"); -+ // ToDO: -+ //builder.append(" Texture Pack: ").append(Minecraft.getMinecraft().texturePackList.getSelectedTexturePack().getTexturePackFileName()).append("\n"); -+ //builder.append(" Texture Pack Res: ").append(TileSize.int_size + "x").append("\n"); -+ builder.append(" LWJGL Version: ").append(Sys.getVersion()).append("\n"); -+ -+ builder.append("System Information:\n"); -+ builder.append(" Operating System: ").append(System.getProperty("os.name")).append("\n"); -+ builder.append(" Operating System Version: ").append(System.getProperty("os.version")).append("\n"); -+ builder.append(" Operating System Architecture: ").append(System.getProperty("os.arch")).append("\n"); -+ builder.append(" Java version: ").append(System.getProperty("java.version")).append(" ").append(System.getProperty("sun.arch.data.model", "32")).append(" bit").append("\n"); -+ builder.append(" Total Memory: ").append(Runtime.getRuntime().totalMemory() / 1024L / 1024L).append(" MB\n"); -+ builder.append(" Max Memory: ").append(Runtime.getRuntime().maxMemory() / 1024L / 1024L).append(" MB\n"); -+ builder.append(" Memory Free: ").append(Runtime.getRuntime().freeMemory() / 1024L / 1024L).append(" MB\n"); -+ builder.append(" CPU Cores: ").append(Runtime.getRuntime().availableProcessors()).append("\n"); -+ builder.append(" OpenGL Version: ").append(GL11.glGetString(GL11.GL_VERSION)).append("\n"); -+ builder.append(" OpenGL Vendor: ").append(GL11.glGetString(GL11.GL_VENDOR)).append("\n"); -+ String message = builder.toString(); -+ -+ PasteBinAPI pastebin = new PasteBinAPI("963f01dd506cb3f607a487bc34b60d16"); -+ String response = pastebin.makePaste(message, "ser_" + System.currentTimeMillis(), "text"); -+ System.out.println("pastebin response: " + response); -+ if (!response.startsWith("http://pastebin.com")) { -+ URL url = new URL("http://www.hastebin.com/documents"); -+ URLConnection conn = url.openConnection(); -+ conn.setDoOutput(true); -+ OutputStreamWriter wr = new OutputStreamWriter(conn.getOutputStream()); -+ wr.write(builder.toString()); -+ wr.flush(); -+ -+ BufferedReader rd = new BufferedReader(new InputStreamReader(conn.getInputStream())); -+ String line = rd.readLine(); -+ hastebinURL = "hastebin.com/" + line.substring(8, line.length() - 2); // Get rid of the JSON stuff -+ wr.close(); -+ rd.close(); -+ } else { -+ hastebinURL = response; -+ } -+ hastebinLink.setText("Error: " + ChatColor.GREEN + hastebinURL); -+ generated = true; -+ } catch (Exception e) { -+ hastebinLink.setText("Connection error!"); -+ } -+ } -+ -+ protected void copyErrorToClipboard() { -+ Toolkit.getDefaultToolkit().getSystemClipboard().setContents(new StringSelection(hastebinURL), null); -+ } -+} -+ -+class CopyErrorURL extends GenericButton { -+ private GuiUnexpectedError error; -+ CopyErrorURL(GuiUnexpectedError error) { -+ this.error = error; -+ } -+ -+ public void onButtonClick() { -+ error.copyErrorToClipboard(); -+ } -+} -+ -+class IgnoreErrorButton extends GenericButton { -+ public void onButtonClick() { -+ Minecraft.getMinecraft().displayGuiScreen(new org.spoutcraft.client.gui.mainmenu.MainMenu()); -+ } -+} -+ -+class ReportErrorButton extends GenericButton { -+ public void onButtonClick() { -+ try { -+ URL url = new URL("http://spout.in/issues"); -+ Desktop.getDesktop().browse(url.toURI()); -+ } catch (Exception e) { } -+ Minecraft.getMinecraft().displayGuiScreen(new org.spoutcraft.client.gui.mainmenu.MainMenu()); -+ } -+} -+ -+class ExitGameButton extends GenericButton { -+ public void onButtonClick() { -+ Minecraft.getMinecraft().shutdownMinecraftApplet(); -+ } -+} ---- net/minecraft/src/ChunkProviderGenerate.java -+++ net/minecraft/src/ChunkProviderGenerate.java -@@ -4,59 +4,107 @@ - import java.util.Random; - - public class ChunkProviderGenerate implements IChunkProvider { -- private Random k; -+ -+ /** RNG. */ -+ private Random rand; -+ -+ /** A NoiseGeneratorOctaves used in generating terrain */ - private NoiseGeneratorOctaves noiseGen1; -+ -+ /** A NoiseGeneratorOctaves used in generating terrain */ - private NoiseGeneratorOctaves noiseGen2; -+ -+ /** A NoiseGeneratorOctaves used in generating terrain */ - private NoiseGeneratorOctaves noiseGen3; -+ -+ /** A NoiseGeneratorOctaves used in generating terrain */ - private NoiseGeneratorOctaves noiseGen4; -+ -+ /** A NoiseGeneratorOctaves used in generating terrain */ - public NoiseGeneratorOctaves noiseGen5; -+ -+ /** A NoiseGeneratorOctaves used in generating terrain */ - public NoiseGeneratorOctaves noiseGen6; - public NoiseGeneratorOctaves mobSpawnerNoise; -+ -+ /** Reference to the World object. */ - private World worldObj; -+ -+ /** are map structures going to be generated (e.g. strongholds) */ - private final boolean mapFeaturesEnabled; -+ -+ /** Holds the overall noise array used in chunk generation */ - private double[] noiseArray; - private double[] stoneNoise = new double[256]; - private MapGenBase caveGenerator = new MapGenCaves(); -+ -+ /** Holds Stronghold Generator */ - private MapGenStronghold strongholdGenerator = new MapGenStronghold(); -+ -+ /** Holds Village Generator */ - private MapGenVillage villageGenerator = new MapGenVillage(); -+ -+ /** Holds Mineshaft Generator */ - private MapGenMineshaft mineshaftGenerator = new MapGenMineshaft(); - private MapGenScatteredFeature scatteredFeatureGenerator = new MapGenScatteredFeature(); -+ -+ /** Holds ravine generator */ - private MapGenBase ravineGenerator = new MapGenRavine(); -+ -+ /** The biomes that are used to generate the chunk */ - private BiomeGenBase[] biomesForGeneration; -+ -+ /** A double array that hold terrain noise from noiseGen3 */ - double[] noise3; -+ -+ /** A double array that hold terrain noise */ - double[] noise1; -+ -+ /** A double array that hold terrain noise from noiseGen2 */ - double[] noise2; -+ -+ /** A double array that hold terrain noise from noiseGen5 */ - double[] noise5; -+ -+ /** A double array that holds terrain noise from noiseGen6 */ - double[] noise6; -+ -+ /** -+ * Used to store the 5x5 parabolic field that is used during terrain generation. -+ */ - float[] parabolicField; - int[][] field_73219_j = new int[32][32]; - -- public ChunkProviderGenerate(World var1, long var2, boolean var4) { -- this.worldObj = var1; -- this.mapFeaturesEnabled = var4; -- this.k = new Random(var2); -- this.noiseGen1 = new NoiseGeneratorOctaves(this.k, 16); -- this.noiseGen2 = new NoiseGeneratorOctaves(this.k, 16); -- this.noiseGen3 = new NoiseGeneratorOctaves(this.k, 8); -- this.noiseGen4 = new NoiseGeneratorOctaves(this.k, 4); -- this.noiseGen5 = new NoiseGeneratorOctaves(this.k, 10); -- this.noiseGen6 = new NoiseGeneratorOctaves(this.k, 16); -- this.mobSpawnerNoise = new NoiseGeneratorOctaves(this.k, 8); -+ public ChunkProviderGenerate(World par1World, long par2, boolean par4) { -+ this.worldObj = par1World; -+ this.mapFeaturesEnabled = par4; -+ this.rand = new Random(par2); -+ this.noiseGen1 = new NoiseGeneratorOctaves(this.rand, 16); -+ this.noiseGen2 = new NoiseGeneratorOctaves(this.rand, 16); -+ this.noiseGen3 = new NoiseGeneratorOctaves(this.rand, 8); -+ this.noiseGen4 = new NoiseGeneratorOctaves(this.rand, 4); -+ this.noiseGen5 = new NoiseGeneratorOctaves(this.rand, 10); -+ this.noiseGen6 = new NoiseGeneratorOctaves(this.rand, 16); -+ this.mobSpawnerNoise = new NoiseGeneratorOctaves(this.rand, 8); - } - -- public void generateTerrain(int var1, int var2, byte[] var3) { -+ /** -+ * Generates the shape of the terrain for the chunk though its all stone though the water is frozen if the temperature -+ * is low enough -+ */ -+ public void generateTerrain(int par1, int par2, byte[] par3ArrayOfByte) { - byte var4 = 4; - byte var5 = 16; - byte var6 = 63; - int var7 = var4 + 1; - byte var8 = 17; - int var9 = var4 + 1; -- this.biomesForGeneration = this.worldObj.getWorldChunkManager().getBiomesForGeneration(this.biomesForGeneration, var1 * 4 - 2, var2 * 4 - 2, var7 + 5, var9 + 5); -- this.noiseArray = this.initializeNoiseField(this.noiseArray, var1 * var4, 0, var2 * var4, var7, var8, var9); -+ this.biomesForGeneration = this.worldObj.getWorldChunkManager().getBiomesForGeneration(this.biomesForGeneration, par1 * 4 - 2, par2 * 4 - 2, var7 + 5, var9 + 5); -+ this.noiseArray = this.initializeNoiseField(this.noiseArray, par1 * var4, 0, par2 * var4, var7, var8, var9); - -- for(int var10 = 0; var10 < var4; ++var10) { -- for(int var11 = 0; var11 < var4; ++var11) { -- for(int var12 = 0; var12 < var5; ++var12) { -+ for (int var10 = 0; var10 < var4; ++var10) { -+ for (int var11 = 0; var11 < var4; ++var11) { -+ for (int var12 = 0; var12 < var5; ++var12) { - double var13 = 0.125D; - double var15 = this.noiseArray[((var10 + 0) * var9 + var11 + 0) * var8 + var12 + 0]; - double var17 = this.noiseArray[((var10 + 0) * var9 + var11 + 1) * var8 + var12 + 0]; -@@ -67,14 +115,14 @@ - double var27 = (this.noiseArray[((var10 + 1) * var9 + var11 + 0) * var8 + var12 + 1] - var19) * var13; - double var29 = (this.noiseArray[((var10 + 1) * var9 + var11 + 1) * var8 + var12 + 1] - var21) * var13; - -- for(int var31 = 0; var31 < 8; ++var31) { -+ for (int var31 = 0; var31 < 8; ++var31) { - double var32 = 0.25D; - double var34 = var15; - double var36 = var17; - double var38 = (var19 - var15) * var32; - double var40 = (var21 - var17) * var32; - -- for(int var42 = 0; var42 < 4; ++var42) { -+ for (int var42 = 0; var42 < 4; ++var42) { - int var43 = var42 + var10 * 4 << 11 | 0 + var11 * 4 << 7 | var12 * 8 + var31; - short var44 = 128; - var43 -= var44; -@@ -82,17 +130,13 @@ - double var49 = (var36 - var34) * var45; - double var47 = var34 - var49; - -- for(int var51 = 0; var51 < 4; ++var51) { -- var47 += var49; -- if(var47 > 0.0D) { -- var43 += var44; -- var3[var43] = (byte)Block.stone.blockID; -- } else if(var12 * 8 + var31 < var6) { -- var43 += var44; -- var3[var43] = (byte)Block.waterStill.blockID; -+ for (int var51 = 0; var51 < 4; ++var51) { -+ if ((var47 += var49) > 0.0D) { -+ par3ArrayOfByte[var43 += var44] = (byte)Block.stone.blockID; -+ } else if (var12 * 8 + var31 < var6) { -+ par3ArrayOfByte[var43 += var44] = (byte)Block.waterStill.blockID; - } else { -- var43 += var44; -- var3[var43] = 0; -+ par3ArrayOfByte[var43 += var44] = 0; - } - } - -@@ -108,43 +152,47 @@ - } - } - } -- - } - -- public void replaceBlocksForBiome(int var1, int var2, byte[] var3, BiomeGenBase[] var4) { -+ /** -+ * Replaces the stone that was placed in with blocks that match the biome -+ */ -+ public void replaceBlocksForBiome(int par1, int par2, byte[] par3ArrayOfByte, BiomeGenBase[] par4ArrayOfBiomeGenBase) { - byte var5 = 63; -- double var6 = 1.0D / 32.0D; -- this.stoneNoise = this.noiseGen4.generateNoiseOctaves(this.stoneNoise, var1 * 16, var2 * 16, 0, 16, 16, 1, var6 * 2.0D, var6 * 2.0D, var6 * 2.0D); -+ double var6 = 0.03125D; -+ this.stoneNoise = this.noiseGen4.generateNoiseOctaves(this.stoneNoise, par1 * 16, par2 * 16, 0, 16, 16, 1, var6 * 2.0D, var6 * 2.0D, var6 * 2.0D); - -- for(int var8 = 0; var8 < 16; ++var8) { -- for(int var9 = 0; var9 < 16; ++var9) { -- BiomeGenBase var10 = var4[var9 + var8 * 16]; -+ for (int var8 = 0; var8 < 16; ++var8) { -+ for (int var9 = 0; var9 < 16; ++var9) { -+ BiomeGenBase var10 = par4ArrayOfBiomeGenBase[var9 + var8 * 16]; - float var11 = var10.getFloatTemperature(); -- int var12 = (int)(this.stoneNoise[var8 + var9 * 16] / 3.0D + 3.0D + this.k.nextDouble() * 0.25D); -+ int var12 = (int)(this.stoneNoise[var8 + var9 * 16] / 3.0D + 3.0D + this.rand.nextDouble() * 0.25D); - int var13 = -1; - byte var14 = var10.topBlock; - byte var15 = var10.fillerBlock; - -- for(int var16 = 127; var16 >= 0; --var16) { -+ for (int var16 = 127; var16 >= 0; --var16) { - int var17 = (var9 * 16 + var8) * 128 + var16; -- if(var16 <= 0 + this.k.nextInt(5)) { -- var3[var17] = (byte)Block.bedrock.blockID; -+ -+ if (var16 <= 0 + this.rand.nextInt(5)) { -+ par3ArrayOfByte[var17] = (byte)Block.bedrock.blockID; - } else { -- byte var18 = var3[var17]; -- if(var18 == 0) { -+ byte var18 = par3ArrayOfByte[var17]; -+ -+ if (var18 == 0) { - var13 = -1; -- } else if(var18 == Block.stone.blockID) { -- if(var13 == -1) { -- if(var12 <= 0) { -+ } else if (var18 == Block.stone.blockID) { -+ if (var13 == -1) { -+ if (var12 <= 0) { - var14 = 0; - var15 = (byte)Block.stone.blockID; -- } else if(var16 >= var5 - 4 && var16 <= var5 + 1) { -+ } else if (var16 >= var5 - 4 && var16 <= var5 + 1) { - var14 = var10.topBlock; - var15 = var10.fillerBlock; - } - -- if(var16 < var5 && var14 == 0) { -- if(var11 < 0.15F) { -+ if (var16 < var5 && var14 == 0) { -+ if (var11 < 0.15F) { - var14 = (byte)Block.ice.blockID; - } else { - var14 = (byte)Block.waterStill.blockID; -@@ -152,16 +200,18 @@ - } - - var13 = var12; -- if(var16 >= var5 - 1) { -- var3[var17] = var14; -+ -+ if (var16 >= var5 - 1) { -+ par3ArrayOfByte[var17] = var14; - } else { -- var3[var17] = var15; -+ par3ArrayOfByte[var17] = var15; - } -- } else if(var13 > 0) { -+ } else if (var13 > 0) { - --var13; -- var3[var17] = var15; -- if(var13 == 0 && var15 == Block.sand.blockID) { -- var13 = this.k.nextInt(4); -+ par3ArrayOfByte[var17] = var15; -+ -+ if (var13 == 0 && var15 == Block.sand.blockID) { -+ var13 = this.rand.nextInt(4); - var15 = (byte)Block.sandStone.blockID; - } - } -@@ -170,32 +220,39 @@ - } - } - } -- -- } -- -- public Chunk loadChunk(int var1, int var2) { -- return this.provideChunk(var1, var2); -- } -- -- public Chunk provideChunk(int var1, int var2) { -- this.k.setSeed((long)var1 * 341873128712L + (long)var2 * 132897987541L); -- byte[] var3 = new byte[-Short.MIN_VALUE]; -- this.generateTerrain(var1, var2, var3); -- this.biomesForGeneration = this.worldObj.getWorldChunkManager().loadBlockGeneratorData(this.biomesForGeneration, var1 * 16, var2 * 16, 16, 16); -- this.replaceBlocksForBiome(var1, var2, var3, this.biomesForGeneration); -- this.caveGenerator.generate(this, this.worldObj, var1, var2, var3); -- this.ravineGenerator.generate(this, this.worldObj, var1, var2, var3); -- if(this.mapFeaturesEnabled) { -- this.mineshaftGenerator.generate(this, this.worldObj, var1, var2, var3); -- this.villageGenerator.generate(this, this.worldObj, var1, var2, var3); -- this.strongholdGenerator.generate(this, this.worldObj, var1, var2, var3); -- this.scatteredFeatureGenerator.generate(this, this.worldObj, var1, var2, var3); -+ } -+ -+ /** -+ * loads or generates the chunk at the chunk location specified -+ */ -+ public Chunk loadChunk(int par1, int par2) { -+ return this.provideChunk(par1, par2); -+ } -+ -+ /** -+ * Will return back a chunk, if it doesn't exist and its not a MP client it will generates all the blocks for the -+ * specified chunk from the map seed and chunk seed -+ */ -+ public Chunk provideChunk(int par1, int par2) { -+ this.rand.setSeed((long)par1 * 341873128712L + (long)par2 * 132897987541L); -+ byte[] var3 = new byte[32768]; -+ this.generateTerrain(par1, par2, var3); -+ this.biomesForGeneration = this.worldObj.getWorldChunkManager().loadBlockGeneratorData(this.biomesForGeneration, par1 * 16, par2 * 16, 16, 16); -+ this.replaceBlocksForBiome(par1, par2, var3, this.biomesForGeneration); -+ this.caveGenerator.generate(this, this.worldObj, par1, par2, var3); -+ this.ravineGenerator.generate(this, this.worldObj, par1, par2, var3); -+ -+ if (this.mapFeaturesEnabled) { -+ this.mineshaftGenerator.generate(this, this.worldObj, par1, par2, var3); -+ this.villageGenerator.generate(this, this.worldObj, par1, par2, var3); -+ this.strongholdGenerator.generate(this, this.worldObj, par1, par2, var3); -+ this.scatteredFeatureGenerator.generate(this, this.worldObj, par1, par2, var3); - } - -- Chunk var4 = new Chunk(this.worldObj, var3, var1, var2); -+ Chunk var4 = new Chunk(this.worldObj, var3, par1, par2); - byte[] var5 = var4.getBiomeArray(); - -- for(int var6 = 0; var6 < var5.length; ++var6) { -+ for (int var6 = 0; var6 < var5.length; ++var6) { - var5[var6] = (byte)this.biomesForGeneration[var6].biomeID; - } - -@@ -203,46 +260,52 @@ - return var4; - } - -- private double[] initializeNoiseField(double[] var1, int var2, int var3, int var4, int var5, int var6, int var7) { -- if(var1 == null) { -- var1 = new double[var5 * var6 * var7]; -+ /** -+ * generates a subset of the level's terrain data. Takes 7 arguments: the [empty] noise array, the position, and the -+ * size. -+ */ -+ private double[] initializeNoiseField(double[] par1ArrayOfDouble, int par2, int par3, int par4, int par5, int par6, int par7) { -+ if (par1ArrayOfDouble == null) { -+ par1ArrayOfDouble = new double[par5 * par6 * par7]; - } - -- if(this.parabolicField == null) { -+ if (this.parabolicField == null) { - this.parabolicField = new float[25]; - -- for(int var8 = -2; var8 <= 2; ++var8) { -- for(int var9 = -2; var9 <= 2; ++var9) { -+ for (int var8 = -2; var8 <= 2; ++var8) { -+ for (int var9 = -2; var9 <= 2; ++var9) { - float var10 = 10.0F / MathHelper.sqrt_float((float)(var8 * var8 + var9 * var9) + 0.2F); - this.parabolicField[var8 + 2 + (var9 + 2) * 5] = var10; - } - } - } - -- double var43 = 684.412D; - double var44 = 684.412D; -- this.noise5 = this.noiseGen5.generateNoiseOctaves(this.noise5, var2, var4, var5, var7, 1.121D, 1.121D, 0.5D); -- this.noise6 = this.noiseGen6.generateNoiseOctaves(this.noise6, var2, var4, var5, var7, 200.0D, 200.0D, 0.5D); -- this.noise3 = this.noiseGen3.generateNoiseOctaves(this.noise3, var2, var3, var4, var5, var6, var7, var43 / 80.0D, var44 / 160.0D, var43 / 80.0D); -- this.noise1 = this.noiseGen1.generateNoiseOctaves(this.noise1, var2, var3, var4, var5, var6, var7, var43, var44, var43); -- this.noise2 = this.noiseGen2.generateNoiseOctaves(this.noise2, var2, var3, var4, var5, var6, var7, var43, var44, var43); -+ double var45 = 684.412D; -+ this.noise5 = this.noiseGen5.generateNoiseOctaves(this.noise5, par2, par4, par5, par7, 1.121D, 1.121D, 0.5D); -+ this.noise6 = this.noiseGen6.generateNoiseOctaves(this.noise6, par2, par4, par5, par7, 200.0D, 200.0D, 0.5D); -+ this.noise3 = this.noiseGen3.generateNoiseOctaves(this.noise3, par2, par3, par4, par5, par6, par7, var44 / 80.0D, var45 / 160.0D, var44 / 80.0D); -+ this.noise1 = this.noiseGen1.generateNoiseOctaves(this.noise1, par2, par3, par4, par5, par6, par7, var44, var45, var44); -+ this.noise2 = this.noiseGen2.generateNoiseOctaves(this.noise2, par2, par3, par4, par5, par6, par7, var44, var45, var44); -+ boolean var43 = false; - boolean var42 = false; - int var12 = 0; - int var13 = 0; - -- for(int var14 = 0; var14 < var5; ++var14) { -- for(int var15 = 0; var15 < var7; ++var15) { -+ for (int var14 = 0; var14 < par5; ++var14) { -+ for (int var15 = 0; var15 < par7; ++var15) { - float var16 = 0.0F; - float var17 = 0.0F; - float var18 = 0.0F; - byte var19 = 2; -- BiomeGenBase var20 = this.biomesForGeneration[var14 + 2 + (var15 + 2) * (var5 + 5)]; -+ BiomeGenBase var20 = this.biomesForGeneration[var14 + 2 + (var15 + 2) * (par5 + 5)]; - -- for(int var21 = -var19; var21 <= var19; ++var21) { -- for(int var22 = -var19; var22 <= var19; ++var22) { -- BiomeGenBase var23 = this.biomesForGeneration[var14 + var21 + 2 + (var15 + var22 + 2) * (var5 + 5)]; -+ for (int var21 = -var19; var21 <= var19; ++var21) { -+ for (int var22 = -var19; var22 <= var19; ++var22) { -+ BiomeGenBase var23 = this.biomesForGeneration[var14 + var21 + 2 + (var15 + var22 + 2) * (par5 + 5)]; - float var24 = this.parabolicField[var21 + 2 + (var22 + 2) * 5] / (var23.minHeight + 2.0F); -- if(var23.minHeight > var20.minHeight) { -+ -+ if (var23.minHeight > var20.minHeight) { - var24 /= 2.0F; - } - -@@ -256,128 +319,144 @@ - var17 /= var18; - var16 = var16 * 0.9F + 0.1F; - var17 = (var17 * 4.0F - 1.0F) / 8.0F; -- double var45 = this.noise6[var13] / 8000.0D; -- if(var45 < 0.0D) { -- var45 = -var45 * 0.3D; -+ double var46 = this.noise6[var13] / 8000.0D; -+ -+ if (var46 < 0.0D) { -+ var46 = -var46 * 0.3D; - } - -- var45 = var45 * 3.0D - 2.0D; -- if(var45 < 0.0D) { -- var45 /= 2.0D; -- if(var45 < -1.0D) { -- var45 = -1.0D; -+ var46 = var46 * 3.0D - 2.0D; -+ -+ if (var46 < 0.0D) { -+ var46 /= 2.0D; -+ -+ if (var46 < -1.0D) { -+ var46 = -1.0D; - } - -- var45 /= 1.4D; -- var45 /= 2.0D; -+ var46 /= 1.4D; -+ var46 /= 2.0D; - } else { -- if(var45 > 1.0D) { -- var45 = 1.0D; -+ if (var46 > 1.0D) { -+ var46 = 1.0D; - } - -- var45 /= 8.0D; -+ var46 /= 8.0D; - } - - ++var13; - -- for(int var46 = 0; var46 < var6; ++var46) { -- double var47 = (double)var17; -+ for (int var47 = 0; var47 < par6; ++var47) { -+ double var48 = (double)var17; - double var26 = (double)var16; -- var47 += var45 * 0.2D; -- var47 = var47 * (double)var6 / 16.0D; -- double var28 = (double)var6 / 2.0D + var47 * 4.0D; -+ var48 += var46 * 0.2D; -+ var48 = var48 * (double)par6 / 16.0D; -+ double var28 = (double)par6 / 2.0D + var48 * 4.0D; - double var30 = 0.0D; -- double var32 = ((double)var46 - var28) * 12.0D * 128.0D / 128.0D / var26; -- if(var32 < 0.0D) { -+ double var32 = ((double)var47 - var28) * 12.0D * 128.0D / 128.0D / var26; -+ -+ if (var32 < 0.0D) { - var32 *= 4.0D; - } - - double var34 = this.noise1[var12] / 512.0D; - double var36 = this.noise2[var12] / 512.0D; - double var38 = (this.noise3[var12] / 10.0D + 1.0D) / 2.0D; -- if(var38 < 0.0D) { -+ -+ if (var38 < 0.0D) { - var30 = var34; -- } else if(var38 > 1.0D) { -+ } else if (var38 > 1.0D) { - var30 = var36; - } else { - var30 = var34 + (var36 - var34) * var38; - } - - var30 -= var32; -- if(var46 > var6 - 4) { -- double var40 = (double)((float)(var46 - (var6 - 4)) / 3.0F); -+ -+ if (var47 > par6 - 4) { -+ double var40 = (double)((float)(var47 - (par6 - 4)) / 3.0F); - var30 = var30 * (1.0D - var40) + -10.0D * var40; - } - -- var1[var12] = var30; -+ par1ArrayOfDouble[var12] = var30; - ++var12; - } - } - } - -- return var1; -+ return par1ArrayOfDouble; - } - -- public boolean chunkExists(int var1, int var2) { -+ /** -+ * Checks to see if a chunk exists at x, y -+ */ -+ public boolean chunkExists(int par1, int par2) { - return true; - } - -- public void populate(IChunkProvider var1, int var2, int var3) { -+ /** -+ * Populates chunk with ores etc etc -+ */ -+ public void populate(IChunkProvider par1IChunkProvider, int par2, int par3) { - BlockSand.fallInstantly = true; -- int var4 = var2 * 16; -- int var5 = var3 * 16; -+ int var4 = par2 * 16; -+ int var5 = par3 * 16; - BiomeGenBase var6 = this.worldObj.getBiomeGenForCoords(var4 + 16, var5 + 16); -- this.k.setSeed(this.worldObj.getSeed()); -- long var7 = this.k.nextLong() / 2L * 2L + 1L; -- long var9 = this.k.nextLong() / 2L * 2L + 1L; -- this.k.setSeed((long)var2 * var7 + (long)var3 * var9 ^ this.worldObj.getSeed()); -+ this.rand.setSeed(this.worldObj.getSeed()); -+ long var7 = this.rand.nextLong() / 2L * 2L + 1L; -+ long var9 = this.rand.nextLong() / 2L * 2L + 1L; -+ this.rand.setSeed((long)par2 * var7 + (long)par3 * var9 ^ this.worldObj.getSeed()); - boolean var11 = false; -- if(this.mapFeaturesEnabled) { -- this.mineshaftGenerator.generateStructuresInChunk(this.worldObj, this.k, var2, var3); -- var11 = this.villageGenerator.generateStructuresInChunk(this.worldObj, this.k, var2, var3); -- this.strongholdGenerator.generateStructuresInChunk(this.worldObj, this.k, var2, var3); -- this.scatteredFeatureGenerator.generateStructuresInChunk(this.worldObj, this.k, var2, var3); -+ -+ if (this.mapFeaturesEnabled) { -+ this.mineshaftGenerator.generateStructuresInChunk(this.worldObj, this.rand, par2, par3); -+ var11 = this.villageGenerator.generateStructuresInChunk(this.worldObj, this.rand, par2, par3); -+ this.strongholdGenerator.generateStructuresInChunk(this.worldObj, this.rand, par2, par3); -+ this.scatteredFeatureGenerator.generateStructuresInChunk(this.worldObj, this.rand, par2, par3); - } - - int var12; - int var13; - int var14; -- if(var6 != BiomeGenBase.desert && var6 != BiomeGenBase.desertHills && !var11 && this.k.nextInt(4) == 0) { -- var12 = var4 + this.k.nextInt(16) + 8; -- var13 = this.k.nextInt(128); -- var14 = var5 + this.k.nextInt(16) + 8; -- (new WorldGenLakes(Block.waterStill.blockID)).generate(this.worldObj, this.k, var12, var13, var14); -+ -+ if (var6 != BiomeGenBase.desert && var6 != BiomeGenBase.desertHills && !var11 && this.rand.nextInt(4) == 0) { -+ var12 = var4 + this.rand.nextInt(16) + 8; -+ var13 = this.rand.nextInt(128); -+ var14 = var5 + this.rand.nextInt(16) + 8; -+ (new WorldGenLakes(Block.waterStill.blockID)).generate(this.worldObj, this.rand, var12, var13, var14); - } - -- if(!var11 && this.k.nextInt(8) == 0) { -- var12 = var4 + this.k.nextInt(16) + 8; -- var13 = this.k.nextInt(this.k.nextInt(120) + 8); -- var14 = var5 + this.k.nextInt(16) + 8; -- if(var13 < 63 || this.k.nextInt(10) == 0) { -- (new WorldGenLakes(Block.lavaStill.blockID)).generate(this.worldObj, this.k, var12, var13, var14); -+ if (!var11 && this.rand.nextInt(8) == 0) { -+ var12 = var4 + this.rand.nextInt(16) + 8; -+ var13 = this.rand.nextInt(this.rand.nextInt(120) + 8); -+ var14 = var5 + this.rand.nextInt(16) + 8; -+ -+ if (var13 < 63 || this.rand.nextInt(10) == 0) { -+ (new WorldGenLakes(Block.lavaStill.blockID)).generate(this.worldObj, this.rand, var12, var13, var14); - } - } - -- for(var12 = 0; var12 < 8; ++var12) { -- var13 = var4 + this.k.nextInt(16) + 8; -- var14 = this.k.nextInt(128); -- int var15 = var5 + this.k.nextInt(16) + 8; -- (new WorldGenDungeons()).generate(this.worldObj, this.k, var13, var14, var15); -+ for (var12 = 0; var12 < 8; ++var12) { -+ var13 = var4 + this.rand.nextInt(16) + 8; -+ var14 = this.rand.nextInt(128); -+ int var15 = var5 + this.rand.nextInt(16) + 8; -+ (new WorldGenDungeons()).generate(this.worldObj, this.rand, var13, var14, var15); - } - -- var6.decorate(this.worldObj, this.k, var4, var5); -- SpawnerAnimals.performWorldGenSpawning(this.worldObj, var6, var4 + 8, var5 + 8, 16, 16, this.k); -+ var6.decorate(this.worldObj, this.rand, var4, var5); -+ SpawnerAnimals.performWorldGenSpawning(this.worldObj, var6, var4 + 8, var5 + 8, 16, 16, this.rand); - var4 += 8; - var5 += 8; - -- for(var12 = 0; var12 < 16; ++var12) { -- for(var13 = 0; var13 < 16; ++var13) { -+ for (var12 = 0; var12 < 16; ++var12) { -+ for (var13 = 0; var13 < 16; ++var13) { - var14 = this.worldObj.getPrecipitationHeight(var4 + var12, var5 + var13); -- if(this.worldObj.isBlockFreezable(var12 + var4, var14 - 1, var13 + var5)) { -+ -+ if (this.worldObj.isBlockFreezable(var12 + var4, var14 - 1, var13 + var5)) { - this.worldObj.setBlock(var12 + var4, var14 - 1, var13 + var5, Block.ice.blockID, 0, 2); - } - -- if(this.worldObj.canSnowAt(var12 + var4, var14, var13 + var5)) { -+ if (this.worldObj.canSnowAt(var12 + var4, var14, var13 + var5)) { - this.worldObj.setBlock(var12 + var4, var14, var13 + var5, Block.snow.blockID, 0, 2); - } - } -@@ -386,45 +465,66 @@ - BlockSand.fallInstantly = false; - } - -- public boolean saveChunks(boolean var1, IProgressUpdate var2) { -+ /** -+ * Two modes of operation: if passed true, save all Chunks in one go. If passed false, save up to two chunks. Return -+ * true if all chunks have been saved. -+ */ -+ public boolean saveChunks(boolean par1, IProgressUpdate par2IProgressUpdate) { - return true; - } - -- public void saveExtraData() { -- } -+ /** -+ * Save extra data not associated with any Chunk. Not saved during autosave, only during world unload. Currently -+ * unimplemented. -+ */ -+ public void saveExtraData() {} - -+ /** -+ * Unloads chunks that are marked to be unloaded. This is not guaranteed to unload every such chunk. -+ */ - public boolean unloadQueuedChunks() { - return false; - } - -+ /** -+ * Returns if the IChunkProvider supports saving. -+ */ - public boolean canSave() { - return true; - } - -+ /** -+ * Converts the instance data to a readable string. -+ */ - public String makeString() { - return "RandomLevelSource"; - } - -- public List getPossibleCreatures(EnumCreatureType var1, int var2, int var3, int var4) { -- BiomeGenBase var5 = this.worldObj.getBiomeGenForCoords(var2, var4); -- return var5 == null ? null : (var1 == EnumCreatureType.monster && this.scatteredFeatureGenerator.func_143030_a(var2, var3, var4) ? this.scatteredFeatureGenerator.getScatteredFeatureSpawnList() : var5.getSpawnableList(var1)); -+ /** -+ * Returns a list of creatures of the specified type that can spawn at the given location. -+ */ -+ public List getPossibleCreatures(EnumCreatureType par1EnumCreatureType, int par2, int par3, int par4) { -+ BiomeGenBase var5 = this.worldObj.getBiomeGenForCoords(par2, par4); -+ return var5 == null ? null : (par1EnumCreatureType == EnumCreatureType.monster && this.scatteredFeatureGenerator.func_143030_a(par2, par3, par4) ? this.scatteredFeatureGenerator.getScatteredFeatureSpawnList() : var5.getSpawnableList(par1EnumCreatureType)); - } - -- public ChunkPosition findClosestStructure(World var1, String var2, int var3, int var4, int var5) { -- return "Stronghold".equals(var2) && this.strongholdGenerator != null ? this.strongholdGenerator.getNearestInstance(var1, var3, var4, var5) : null; -+ /** -+ * Returns the location of the closest structure of the specified type. If not found returns null. -+ */ -+ public ChunkPosition findClosestStructure(World par1World, String par2Str, int par3, int par4, int par5) { -+ return "Stronghold".equals(par2Str) && this.strongholdGenerator != null ? this.strongholdGenerator.getNearestInstance(par1World, par3, par4, par5) : null; - } - - public int getLoadedChunkCount() { - return 0; - } - -- public void recreateStructures(int var1, int var2) { -- if(this.mapFeaturesEnabled) { -- this.mineshaftGenerator.generate(this, this.worldObj, var1, var2, (byte[])null); -- this.villageGenerator.generate(this, this.worldObj, var1, var2, (byte[])null); -- this.strongholdGenerator.generate(this, this.worldObj, var1, var2, (byte[])null); -- this.scatteredFeatureGenerator.generate(this, this.worldObj, var1, var2, (byte[])null); -+ public void recreateStructures(int par1, int par2) { -+ if (this.mapFeaturesEnabled) { -+ this.mineshaftGenerator.generate(this, this.worldObj, par1, par2, (byte[])null); -+ this.villageGenerator.generate(this, this.worldObj, par1, par2, (byte[])null); -+ this.strongholdGenerator.generate(this, this.worldObj, par1, par2, (byte[])null); -+ this.scatteredFeatureGenerator.generate(this, this.worldObj, par1, par2, (byte[])null); - } -- - } - } ---- net/minecraft/src/ItemFlintAndSteel.java -+++ net/minecraft/src/ItemFlintAndSteel.java -@@ -1,48 +1,53 @@ - package net.minecraft.src; - - public class ItemFlintAndSteel extends Item { -- public ItemFlintAndSteel(int var1) { -- super(var1); -+ public ItemFlintAndSteel(int par1) { -+ super(par1); - this.maxStackSize = 1; - this.setMaxDamage(64); - this.setCreativeTab(CreativeTabs.tabTools); - } - -- public boolean onItemUse(ItemStack var1, EntityPlayer var2, World var3, int var4, int var5, int var6, int var7, float var8, float var9, float var10) { -- if(var7 == 0) { -- --var5; -- } -- -- if(var7 == 1) { -- ++var5; -- } -- -- if(var7 == 2) { -- --var6; -- } -- -- if(var7 == 3) { -- ++var6; -- } -- -- if(var7 == 4) { -- --var4; -- } -- -- if(var7 == 5) { -- ++var4; -- } -- -- if(!var2.canPlayerEdit(var4, var5, var6, var7, var1)) { -+ /** -+ * Callback for item usage. If the item does something special on right clicking, he will have one of those. Return -+ * True if something happen and false if it don't. This is for ITEMS, not BLOCKS -+ */ -+ public boolean onItemUse(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, World par3World, int par4, int par5, int par6, int par7, float par8, float par9, float par10) { -+ if (par7 == 0) { -+ --par5; -+ } -+ -+ if (par7 == 1) { -+ ++par5; -+ } -+ -+ if (par7 == 2) { -+ --par6; -+ } -+ -+ if (par7 == 3) { -+ ++par6; -+ } -+ -+ if (par7 == 4) { -+ --par4; -+ } -+ -+ if (par7 == 5) { -+ ++par4; -+ } -+ -+ if (!par2EntityPlayer.canPlayerEdit(par4, par5, par6, par7, par1ItemStack)) { - return false; - } else { -- int var11 = var3.getBlockId(var4, var5, var6); -- if(var11 == 0) { -- var3.playSoundEffect((double)var4 + 0.5D, (double)var5 + 0.5D, (double)var6 + 0.5D, "fire.ignite", 1.0F, f.nextFloat() * 0.4F + 0.8F); -- var3.setBlock(var4, var5, var6, Block.fire.blockID); -+ int var11 = par3World.getBlockId(par4, par5, par6); -+ -+ if (var11 == 0) { -+ par3World.playSoundEffect((double)par4 + 0.5D, (double)par5 + 0.5D, (double)par6 + 0.5D, "fire.ignite", 1.0F, itemRand.nextFloat() * 0.4F + 0.8F); -+ par3World.setBlock(par4, par5, par6, Block.fire.blockID); - } - -- var1.damageItem(1, var2); -+ par1ItemStack.damageItem(1, par2EntityPlayer); - return true; - } - } ---- net/minecraft/src/NBTTagShort.java -+++ net/minecraft/src/NBTTagShort.java -@@ -5,25 +5,36 @@ - import java.io.IOException; - - public class NBTTagShort extends NBTBase { -+ -+ /** The short value for the tag. */ - public short data; - -- public NBTTagShort(String var1) { -- super(var1); -- } -- -- public NBTTagShort(String var1, short var2) { -- super(var1); -- this.data = var2; -- } -- -- void write(DataOutput var1) throws IOException { -- var1.writeShort(this.data); -- } -- -- void load(DataInput var1, int var2) throws IOException { -- this.data = var1.readShort(); -- } -- -+ public NBTTagShort(String par1Str) { -+ super(par1Str); -+ } -+ -+ public NBTTagShort(String par1Str, short par2) { -+ super(par1Str); -+ this.data = par2; -+ } -+ -+ /** -+ * Write the actual data contents of the tag, implemented in NBT extension classes -+ */ -+ void write(DataOutput par1DataOutput) throws IOException { -+ par1DataOutput.writeShort(this.data); -+ } -+ -+ /** -+ * Read the actual data contents of the tag, implemented in NBT extension classes -+ */ -+ void load(DataInput par1DataInput, int par2) throws IOException { -+ this.data = par1DataInput.readShort(); -+ } -+ -+ /** -+ * Gets the type byte for the tag. -+ */ - public byte getId() { - return (byte)2; - } -@@ -32,13 +43,16 @@ - return "" + this.data; - } - -+ /** -+ * Creates a clone of the tag. -+ */ - public NBTBase copy() { - return new NBTTagShort(this.getName(), this.data); - } - -- public boolean equals(Object var1) { -- if(super.equals(var1)) { -- NBTTagShort var2 = (NBTTagShort)var1; -+ public boolean equals(Object par1Obj) { -+ if (super.equals(par1Obj)) { -+ NBTTagShort var2 = (NBTTagShort)par1Obj; - return this.data == var2.data; - } else { - return false; ---- net/minecraft/src/EntitySnowball.java -+++ net/minecraft/src/EntitySnowball.java -@@ -1,35 +1,38 @@ - package net.minecraft.src; - - public class EntitySnowball extends EntityThrowable { -- public EntitySnowball(World var1) { -- super(var1); -- } -- -- public EntitySnowball(World var1, EntityLivingBase var2) { -- super(var1, var2); -- } -- -- public EntitySnowball(World var1, double var2, double var4, double var6) { -- super(var1, var2, var4, var6); -- } -- -- protected void onImpact(MovingObjectPosition var1) { -- if(var1.entityHit != null) { -+ public EntitySnowball(World par1World) { -+ super(par1World); -+ } -+ -+ public EntitySnowball(World par1World, EntityLivingBase par2EntityLivingBase) { -+ super(par1World, par2EntityLivingBase); -+ } -+ -+ public EntitySnowball(World par1World, double par2, double par4, double par6) { -+ super(par1World, par2, par4, par6); -+ } -+ -+ /** -+ * Called when this EntityThrowable hits a block or entity. -+ */ -+ protected void onImpact(MovingObjectPosition par1MovingObjectPosition) { -+ if (par1MovingObjectPosition.entityHit != null) { - byte var2 = 0; -- if(var1.entityHit instanceof EntityBlaze) { -+ -+ if (par1MovingObjectPosition.entityHit instanceof EntityBlaze) { - var2 = 3; - } - -- var1.entityHit.attackEntityFrom(DamageSource.causeThrownDamage(this, this.getThrower()), (float)var2); -+ par1MovingObjectPosition.entityHit.attackEntityFrom(DamageSource.causeThrownDamage(this, this.getThrower()), (float)var2); - } - -- for(int var3 = 0; var3 < 8; ++var3) { -+ for (int var3 = 0; var3 < 8; ++var3) { - this.worldObj.spawnParticle("snowballpoof", this.posX, this.posY, this.posZ, 0.0D, 0.0D, 0.0D); - } - -- if(!this.worldObj.isRemote) { -+ if (!this.worldObj.isRemote) { - this.setDead(); - } -- - } - } ---- net/minecraft/src/EntityLavaFX.java -+++ net/minecraft/src/EntityLavaFX.java -@@ -3,68 +3,77 @@ - public class EntityLavaFX extends EntityFX { - private float lavaParticleScale; - -- public EntityLavaFX(World var1, double var2, double var4, double var6) { -- super(var1, var2, var4, var6, 0.0D, 0.0D, 0.0D); -- this.motionX *= (double)0.8F; -- this.motionY *= (double)0.8F; -- this.motionZ *= (double)0.8F; -- this.motionY = (double)(this.ab.nextFloat() * 0.4F + 0.05F); -+ public EntityLavaFX(World par1World, double par2, double par4, double par6) { -+ super(par1World, par2, par4, par6, 0.0D, 0.0D, 0.0D); -+ this.motionX *= 0.800000011920929D; -+ this.motionY *= 0.800000011920929D; -+ this.motionZ *= 0.800000011920929D; -+ this.motionY = (double)(this.rand.nextFloat() * 0.4F + 0.05F); - this.particleRed = this.particleGreen = this.particleBlue = 1.0F; -- this.particleScale *= this.ab.nextFloat() * 2.0F + 0.2F; -+ this.particleScale *= this.rand.nextFloat() * 2.0F + 0.2F; - this.lavaParticleScale = this.particleScale; - this.particleMaxAge = (int)(16.0D / (Math.random() * 0.8D + 0.2D)); - this.noClip = false; - this.setParticleTextureIndex(49); - } - -- public int getBrightnessForRender(float var1) { -- float var2 = ((float)this.particleAge + var1) / (float)this.particleMaxAge; -- if(var2 < 0.0F) { -+ public int getBrightnessForRender(float par1) { -+ float var2 = ((float)this.particleAge + par1) / (float)this.particleMaxAge; -+ -+ if (var2 < 0.0F) { - var2 = 0.0F; - } - -- if(var2 > 1.0F) { -+ if (var2 > 1.0F) { - var2 = 1.0F; - } - -- int var3 = super.getBrightnessForRender(var1); -+ int var3 = super.getBrightnessForRender(par1); - short var4 = 240; - int var5 = var3 >> 16 & 255; - return var4 | var5 << 16; - } - -- public float getBrightness(float var1) { -+ /** -+ * Gets how bright this entity is. -+ */ -+ public float getBrightness(float par1) { - return 1.0F; - } - -- public void renderParticle(Tessellator var1, float var2, float var3, float var4, float var5, float var6, float var7) { -- float var8 = ((float)this.particleAge + var2) / (float)this.particleMaxAge; -+ public void renderParticle(Tessellator par1Tessellator, float par2, float par3, float par4, float par5, float par6, float par7) { -+ float var8 = ((float)this.particleAge + par2) / (float)this.particleMaxAge; - this.particleScale = this.lavaParticleScale * (1.0F - var8 * var8); -- super.renderParticle(var1, var2, var3, var4, var5, var6, var7); -+ super.renderParticle(par1Tessellator, par2, par3, par4, par5, par6, par7); - } - -+ /** -+ * Called to update the entity's position/logic. -+ */ - public void onUpdate() { - this.prevPosX = this.posX; - this.prevPosY = this.posY; - this.prevPosZ = this.posZ; -- if(this.particleAge++ >= this.particleMaxAge) { -+ -+ if (this.particleAge++ >= this.particleMaxAge) { - this.setDead(); - } - - float var1 = (float)this.particleAge / (float)this.particleMaxAge; -- if(this.ab.nextFloat() > var1) { -+ -+ if (this.rand.nextFloat() > var1) { - this.worldObj.spawnParticle("smoke", this.posX, this.posY, this.posZ, this.motionX, this.motionY, this.motionZ); - } - - this.motionY -= 0.03D; - this.moveEntity(this.motionX, this.motionY, this.motionZ); -- this.motionX *= (double)0.999F; -- this.motionY *= (double)0.999F; -- this.motionZ *= (double)0.999F; -- if(this.onGround) { -- this.motionX *= (double)0.7F; -- this.motionZ *= (double)0.7F; -- } -+ this.motionX *= 0.9990000128746033D; -+ this.motionY *= 0.9990000128746033D; -+ this.motionZ *= 0.9990000128746033D; - -+ if (this.onGround) { -+ this.motionX *= 0.699999988079071D; -+ this.motionZ *= 0.699999988079071D; -+ } - } - } ---- /dev/null -+++ org/spoutcraft/client/gui/controls/GuiControls.java -@@ -1,0 +1,253 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.client.gui.controls; -+ -+import net.minecraft.src.GuiScreen; -+ -+import org.spoutcraft.api.ChatColor; -+import org.spoutcraft.api.gui.Button; -+import org.spoutcraft.api.gui.CheckBox; -+import org.spoutcraft.api.gui.GenericButton; -+import org.spoutcraft.api.gui.GenericLabel; -+import org.spoutcraft.api.gui.GenericListView; -+import org.spoutcraft.api.gui.GenericScrollArea; -+import org.spoutcraft.api.gui.Keyboard; -+import org.spoutcraft.api.gui.Orientation; -+import org.spoutcraft.api.gui.ScrollArea; -+import org.spoutcraft.api.gui.Widget; -+import org.spoutcraft.client.SpoutClient; -+import org.spoutcraft.client.controls.Shortcut; -+import org.spoutcraft.client.controls.SimpleKeyBindingManager; -+import org.spoutcraft.client.gui.ButtonUpdater; -+import org.spoutcraft.client.gui.GuiSpoutScreen; -+ -+public class GuiControls extends GuiSpoutScreen implements ButtonUpdater { -+ private GenericLabel labelTitle, labelDescription; -+ private Button buttonDone, buttonAdd, buttonEdit, buttonRemove; -+ public CheckBox checkVanilla, checkSpoutcraft, checkCustom, checkShortcuts; -+ public ControlsSearch search; -+ private ScrollArea filter; -+ private GenericListView view; -+ private GuiScreen parentScreen; -+ private static ControlsModel model = null; -+ -+ public static final ChatColor VANILLA_COLOR = ChatColor.YELLOW; -+ public static final ChatColor SPOUTCRAFT_COLOR = ChatColor.RED; -+ public static final ChatColor CUSTOM_COLOR = ChatColor.BLUE; -+ public static final ChatColor SHORTCUTS_COLOR = ChatColor.GREEN; -+ -+ public GuiControls(GuiScreen parent) { -+ if (model == null) { -+ model = new ControlsModel(this); -+ } -+ this.parentScreen = parent; -+ } -+ -+ protected void createInstances() { -+ labelTitle = new GenericLabel("Controls"); -+ buttonDone = new GenericButton("Done"); -+ buttonAdd = new GenericButton("Add Shortcut"); -+ buttonEdit = new GenericButton("Edit"); -+ buttonEdit.setTooltip("Edit Shortcut"); -+ buttonRemove = new DeleteControlButton(this); -+ buttonRemove.setTooltip("Remove Shortcut"); -+ labelDescription = new GenericLabel(); -+ labelDescription.setText("Double-click an item, then press the key (combination)."); -+ labelDescription.setWrapLines(true); -+ filter = new GenericScrollArea(); -+ view = new GenericListView(model); -+ model.setCurrentGui(this); -+ -+ checkVanilla = new ControlsCheckBox(this, VANILLA_COLOR + "Minecraft Bindings"); -+ checkSpoutcraft = new ControlsCheckBox(this, SPOUTCRAFT_COLOR + "Spoutcraft Bindings"); -+ checkCustom = new ControlsCheckBox(this, CUSTOM_COLOR + "Custom Bindings"); -+ checkShortcuts = new ControlsCheckBox(this, SHORTCUTS_COLOR + "Shortcuts"); -+ search = new ControlsSearch(this); -+ -+ filter.attachWidget("Spoutcraft", checkVanilla); -+ filter.attachWidget("Spoutcraft", checkSpoutcraft); -+ filter.attachWidget("Spoutcraft", checkCustom); -+ filter.attachWidget("Spoutcraft", checkShortcuts); -+ -+ getScreen().attachWidget("Spoutcraft", search); -+ getScreen().attachWidget("Spoutcraft", labelTitle); -+ getScreen().attachWidget("Spoutcraft", filter); -+ getScreen().attachWidget("Spoutcraft", view); -+ getScreen().attachWidget("Spoutcraft", buttonAdd); -+ getScreen().attachWidget("Spoutcraft", buttonEdit); -+ getScreen().attachWidget("Spoutcraft", buttonRemove); -+ getScreen().attachWidget("Spoutcraft", buttonDone); -+ getScreen().attachWidget("Spoutcraft", labelDescription); -+ updateButtons(); -+ model.refresh(); -+ } -+ -+ protected void layoutWidgets() { -+ int top = 5; -+ -+ int swidth = mc.fontRenderer.getStringWidth(labelTitle.getText()); -+ labelTitle.setY(top + 7).setX(width / 2 - swidth / 2).setHeight(11).setWidth(swidth); -+ -+ search.setX(5).setY(top).setWidth(150).setHeight(20); -+ -+ top+=25; -+ -+ int sheight = height - top - 55; -+ -+ filter.setX(5).setY(top).setWidth(130).setHeight(sheight); -+ -+ view.setX((int) (5 + filter.getX() + filter.getWidth())).setY(top).setWidth((int) (width - 15 - filter.getWidth())).setHeight(sheight); -+ -+ int ftop = 5; -+ checkVanilla.setX(5).setY(ftop).setWidth(100).setHeight(20); -+ ftop += 25; -+ checkSpoutcraft.setX(5).setY(ftop).setWidth(100).setHeight(20); -+ ftop += 25; -+ checkCustom.setX(5).setY(ftop).setWidth(100).setHeight(20); -+ ftop += 25; -+ checkShortcuts.setX(5).setY(ftop).setWidth(100).setHeight(20); -+ -+ for (Widget w:filter.getAttachedWidgets()) { -+ w.setWidth(filter.getViewportSize(Orientation.HORIZONTAL) - 10); -+ } -+ search.setWidth((int) filter.getWidth()); -+ -+ top += 5 + view.getHeight(); -+ -+ int totalWidth = Math.min(width - 10, 200 * 3 + 10); -+ int cellWidth = (totalWidth - 10) / 3; -+ int left = width / 2 - totalWidth / 2; -+ int center = left + 5 + cellWidth; -+ int right = center + 5 + cellWidth; -+ -+ buttonAdd.setHeight(20).setWidth(cellWidth).setX(left).setY(top); -+ -+ buttonEdit.setHeight(20).setWidth(cellWidth).setX(center).setY(top); -+ -+ buttonRemove.setHeight(20).setWidth(cellWidth).setX(right).setY(top); -+ -+ top+=25; -+ -+ labelDescription.setHeight(20).setWidth(cellWidth * 2 + 5).setX(left).setY(top); -+ labelDescription.recalculateLines(); -+ -+ buttonDone.setHeight(20).setWidth(cellWidth).setX(right).setY(top); -+ } -+ -+ @Override -+ protected void buttonClicked(Button btn) { -+ if (btn.equals(buttonDone)) { -+ mc.displayGuiScreen(parentScreen); -+ return; -+ } -+ -+ if (btn.equals(buttonAdd)) { -+ Shortcut sh = new Shortcut(); -+ sh.setTitle(""); -+ sh.setKey(Keyboard.KEY_UNKNOWN.getKeyCode()); -+ editItem(sh); -+ return; -+ } -+ ControlsBasicItem item = model.getItem(view.getSelectedRow()); -+ ShortcutBindingItem sh = null; -+ if (item != null && item instanceof ShortcutBindingItem) { -+ sh = (ShortcutBindingItem) item; -+ } -+ if (sh != null && btn.equals(buttonEdit)) { -+ editItem(sh.getShortcut()); -+ } else if (btn.equals(buttonEdit) && item != null) { -+ model.setEditing(item); -+ } -+ } -+ -+ public void editItem(Shortcut item) { -+ GuiEditShortcut gui = new GuiEditShortcut(this, item); -+ mc.displayGuiScreen(gui); -+ } -+ -+ public void updateButtons() { -+ ControlsBasicItem item = model.getItem(view.getSelectedRow()); -+ buttonEdit.setEnabled(item != null); -+ ((DeleteControlButton)buttonRemove).setReallyShown(false); -+ //buttonRemove.setEnabled(item instanceof ShortcutBindingItem || item instanceof KeyBindingItem); -+ } -+ -+ protected void keyTyped(char c, int i, boolean pressed) { -+ ControlsBasicItem item = model.getEditingItem(); -+ if (item != null) { -+ if (item.useModifiers() && (!SimpleKeyBindingManager.isModifierKey(i) && pressed) || (SimpleKeyBindingManager.isModifierKey(i) && !pressed)) { -+ item.setModifiers(SimpleKeyBindingManager.getPressedModifiers()); -+ item.setKey(i); -+ model.finishEdit(); -+ } else if (!item.useModifiers()) { -+ item.setKey(i); -+ model.finishEdit(); -+ } -+ } -+ } -+ -+ @Override -+ public void handleKeyboardInput() { -+ ControlsBasicItem item = model.getEditingItem(); -+ if (item != null) { -+ this.keyTyped(org.lwjgl.input.Keyboard.getEventCharacter(), org.lwjgl.input.Keyboard.getEventKey(), org.lwjgl.input.Keyboard.getEventKeyState()); -+ } else { -+ super.handleKeyboardInput(); -+ } -+ } -+ -+ @Override -+ protected void mouseClicked(int x, int y, int button) { -+ ControlsBasicItem item = model.getEditingItem(); -+ if (item != null && item.useMouseButtons()) { -+ item.setModifiers(SimpleKeyBindingManager.getPressedModifiers()); -+ item.setKey(SimpleKeyBindingManager.MOUSE_OFFSET + button); -+ model.finishEdit(); -+ } -+ } -+ -+ public ControlsModel getModel() { -+ return model; -+ } -+ -+ public void deleteCurrentControl() { -+ SimpleKeyBindingManager man = (SimpleKeyBindingManager) SpoutClient.getInstance().getKeyBindingManager(); -+ ControlsBasicItem item = model.getItem(view.getSelectedRow()); -+ ShortcutBindingItem sh = null; -+ if (item != null && item instanceof ShortcutBindingItem) { -+ sh = (ShortcutBindingItem) item; -+ } -+ KeyBindingItem binding = null; -+ if (item != null && item instanceof KeyBindingItem) { -+ binding = (KeyBindingItem) item; -+ } -+ if (sh != null) { -+ man.unregisterShortcut(sh.getShortcut()); -+ man.save(); -+ } else if (binding != null) { -+ man.unregisterControl(binding.getBinding()); -+ man.save(); -+ model.refresh(); -+ } else { -+ item.setKey(-128); -+ } -+ model.refresh(); -+ } -+} ---- net/minecraft/src/ComponentVillageField.java -+++ net/minecraft/src/ComponentVillageField.java -@@ -4,95 +4,112 @@ - import java.util.Random; - - public class ComponentVillageField extends ComponentVillage { -+ -+ /** First crop type for this field. */ - private int cropTypeA; -+ -+ /** Second crop type for this field. */ - private int cropTypeB; -+ -+ /** Third crop type for this field. */ - private int cropTypeC; -+ -+ /** Fourth crop type for this field. */ - private int cropTypeD; - -- public ComponentVillageField() { -- } -- -- public ComponentVillageField(ComponentVillageStartPiece var1, int var2, Random var3, StructureBoundingBox var4, int var5) { -- super(var1, var2); -- this.coordBaseMode = var5; -- this.boundingBox = var4; -- this.cropTypeA = this.getRandomCrop(var3); -- this.cropTypeB = this.getRandomCrop(var3); -- this.cropTypeC = this.getRandomCrop(var3); -- this.cropTypeD = this.getRandomCrop(var3); -- } -- -- protected void func_143012_a(NBTTagCompound var1) { -- super.func_143012_a(var1); -- var1.setInteger("CA", this.cropTypeA); -- var1.setInteger("CB", this.cropTypeB); -- var1.setInteger("CC", this.cropTypeC); -- var1.setInteger("CD", this.cropTypeD); -- } -- -- protected void func_143011_b(NBTTagCompound var1) { -- super.func_143011_b(var1); -- this.cropTypeA = var1.getInteger("CA"); -- this.cropTypeB = var1.getInteger("CB"); -- this.cropTypeC = var1.getInteger("CC"); -- this.cropTypeD = var1.getInteger("CD"); -- } -- -- private int getRandomCrop(Random var1) { -- switch(var1.nextInt(5)) { -- case 0: -- return Block.carrot.blockID; -- case 1: -- return Block.potato.blockID; -- default: -- return Block.crops.blockID; -+ public ComponentVillageField() {} -+ -+ public ComponentVillageField(ComponentVillageStartPiece par1ComponentVillageStartPiece, int par2, Random par3Random, StructureBoundingBox par4StructureBoundingBox, int par5) { -+ super(par1ComponentVillageStartPiece, par2); -+ this.coordBaseMode = par5; -+ this.boundingBox = par4StructureBoundingBox; -+ this.cropTypeA = this.getRandomCrop(par3Random); -+ this.cropTypeB = this.getRandomCrop(par3Random); -+ this.cropTypeC = this.getRandomCrop(par3Random); -+ this.cropTypeD = this.getRandomCrop(par3Random); -+ } -+ -+ protected void func_143012_a(NBTTagCompound par1NBTTagCompound) { -+ super.func_143012_a(par1NBTTagCompound); -+ par1NBTTagCompound.setInteger("CA", this.cropTypeA); -+ par1NBTTagCompound.setInteger("CB", this.cropTypeB); -+ par1NBTTagCompound.setInteger("CC", this.cropTypeC); -+ par1NBTTagCompound.setInteger("CD", this.cropTypeD); -+ } -+ -+ protected void func_143011_b(NBTTagCompound par1NBTTagCompound) { -+ super.func_143011_b(par1NBTTagCompound); -+ this.cropTypeA = par1NBTTagCompound.getInteger("CA"); -+ this.cropTypeB = par1NBTTagCompound.getInteger("CB"); -+ this.cropTypeC = par1NBTTagCompound.getInteger("CC"); -+ this.cropTypeD = par1NBTTagCompound.getInteger("CD"); -+ } -+ -+ /** -+ * Returns a crop type to be planted on this field. -+ */ -+ private int getRandomCrop(Random par1Random) { -+ switch (par1Random.nextInt(5)) { -+ case 0: -+ return Block.carrot.blockID; -+ -+ case 1: -+ return Block.potato.blockID; -+ -+ default: -+ return Block.crops.blockID; - } - } - -- public static ComponentVillageField func_74900_a(ComponentVillageStartPiece var0, List var1, Random var2, int var3, int var4, int var5, int var6, int var7) { -- StructureBoundingBox var8 = StructureBoundingBox.getComponentToAddBoundingBox(var3, var4, var5, 0, 0, 0, 13, 4, 9, var6); -- return canVillageGoDeeper(var8) && StructureComponent.findIntersecting(var1, var8) == null ? new ComponentVillageField(var0, var7, var2, var8, var6) : null; -+ public static ComponentVillageField func_74900_a(ComponentVillageStartPiece par0ComponentVillageStartPiece, List par1List, Random par2Random, int par3, int par4, int par5, int par6, int par7) { -+ StructureBoundingBox var8 = StructureBoundingBox.getComponentToAddBoundingBox(par3, par4, par5, 0, 0, 0, 13, 4, 9, par6); -+ return canVillageGoDeeper(var8) && StructureComponent.findIntersecting(par1List, var8) == null ? new ComponentVillageField(par0ComponentVillageStartPiece, par7, par2Random, var8, par6) : null; - } - -- public boolean addComponentParts(World var1, Random var2, StructureBoundingBox var3) { -- if(this.field_143015_k < 0) { -- this.field_143015_k = this.getAverageGroundLevel(var1, var3); -- if(this.field_143015_k < 0) { -+ /** -+ * second Part of Structure generating, this for example places Spiderwebs, Mob Spawners, it closes Mineshafts at the -+ * end, it adds Fences... -+ */ -+ public boolean addComponentParts(World par1World, Random par2Random, StructureBoundingBox par3StructureBoundingBox) { -+ if (this.field_143015_k < 0) { -+ this.field_143015_k = this.getAverageGroundLevel(par1World, par3StructureBoundingBox); -+ -+ if (this.field_143015_k < 0) { - return true; - } - - this.boundingBox.offset(0, this.field_143015_k - this.boundingBox.maxY + 4 - 1, 0); - } - -- this.fillWithBlocks(var1, var3, 0, 1, 0, 12, 4, 8, 0, 0, false); -- this.fillWithBlocks(var1, var3, 1, 0, 1, 2, 0, 7, Block.tilledField.blockID, Block.tilledField.blockID, false); -- this.fillWithBlocks(var1, var3, 4, 0, 1, 5, 0, 7, Block.tilledField.blockID, Block.tilledField.blockID, false); -- this.fillWithBlocks(var1, var3, 7, 0, 1, 8, 0, 7, Block.tilledField.blockID, Block.tilledField.blockID, false); -- this.fillWithBlocks(var1, var3, 10, 0, 1, 11, 0, 7, Block.tilledField.blockID, Block.tilledField.blockID, false); -- this.fillWithBlocks(var1, var3, 0, 0, 0, 0, 0, 8, Block.wood.blockID, Block.wood.blockID, false); -- this.fillWithBlocks(var1, var3, 6, 0, 0, 6, 0, 8, Block.wood.blockID, Block.wood.blockID, false); -- this.fillWithBlocks(var1, var3, 12, 0, 0, 12, 0, 8, Block.wood.blockID, Block.wood.blockID, false); -- this.fillWithBlocks(var1, var3, 1, 0, 0, 11, 0, 0, Block.wood.blockID, Block.wood.blockID, false); -- this.fillWithBlocks(var1, var3, 1, 0, 8, 11, 0, 8, Block.wood.blockID, Block.wood.blockID, false); -- this.fillWithBlocks(var1, var3, 3, 0, 1, 3, 0, 7, Block.waterMoving.blockID, Block.waterMoving.blockID, false); -- this.fillWithBlocks(var1, var3, 9, 0, 1, 9, 0, 7, Block.waterMoving.blockID, Block.waterMoving.blockID, false); -- -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 0, 1, 0, 12, 4, 8, 0, 0, false); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 1, 0, 1, 2, 0, 7, Block.tilledField.blockID, Block.tilledField.blockID, false); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 4, 0, 1, 5, 0, 7, Block.tilledField.blockID, Block.tilledField.blockID, false); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 7, 0, 1, 8, 0, 7, Block.tilledField.blockID, Block.tilledField.blockID, false); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 10, 0, 1, 11, 0, 7, Block.tilledField.blockID, Block.tilledField.blockID, false); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 0, 0, 0, 0, 0, 8, Block.wood.blockID, Block.wood.blockID, false); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 6, 0, 0, 6, 0, 8, Block.wood.blockID, Block.wood.blockID, false); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 12, 0, 0, 12, 0, 8, Block.wood.blockID, Block.wood.blockID, false); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 1, 0, 0, 11, 0, 0, Block.wood.blockID, Block.wood.blockID, false); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 1, 0, 8, 11, 0, 8, Block.wood.blockID, Block.wood.blockID, false); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 3, 0, 1, 3, 0, 7, Block.waterMoving.blockID, Block.waterMoving.blockID, false); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 9, 0, 1, 9, 0, 7, Block.waterMoving.blockID, Block.waterMoving.blockID, false); - int var4; -- for(var4 = 1; var4 <= 7; ++var4) { -- this.placeBlockAtCurrentPosition(var1, this.cropTypeA, MathHelper.getRandomIntegerInRange(var2, 2, 7), 1, 1, var4, var3); -- this.placeBlockAtCurrentPosition(var1, this.cropTypeA, MathHelper.getRandomIntegerInRange(var2, 2, 7), 2, 1, var4, var3); -- this.placeBlockAtCurrentPosition(var1, this.cropTypeB, MathHelper.getRandomIntegerInRange(var2, 2, 7), 4, 1, var4, var3); -- this.placeBlockAtCurrentPosition(var1, this.cropTypeB, MathHelper.getRandomIntegerInRange(var2, 2, 7), 5, 1, var4, var3); -- this.placeBlockAtCurrentPosition(var1, this.cropTypeC, MathHelper.getRandomIntegerInRange(var2, 2, 7), 7, 1, var4, var3); -- this.placeBlockAtCurrentPosition(var1, this.cropTypeC, MathHelper.getRandomIntegerInRange(var2, 2, 7), 8, 1, var4, var3); -- this.placeBlockAtCurrentPosition(var1, this.cropTypeD, MathHelper.getRandomIntegerInRange(var2, 2, 7), 10, 1, var4, var3); -- this.placeBlockAtCurrentPosition(var1, this.cropTypeD, MathHelper.getRandomIntegerInRange(var2, 2, 7), 11, 1, var4, var3); -+ -+ for (var4 = 1; var4 <= 7; ++var4) { -+ this.placeBlockAtCurrentPosition(par1World, this.cropTypeA, MathHelper.getRandomIntegerInRange(par2Random, 2, 7), 1, 1, var4, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, this.cropTypeA, MathHelper.getRandomIntegerInRange(par2Random, 2, 7), 2, 1, var4, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, this.cropTypeB, MathHelper.getRandomIntegerInRange(par2Random, 2, 7), 4, 1, var4, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, this.cropTypeB, MathHelper.getRandomIntegerInRange(par2Random, 2, 7), 5, 1, var4, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, this.cropTypeC, MathHelper.getRandomIntegerInRange(par2Random, 2, 7), 7, 1, var4, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, this.cropTypeC, MathHelper.getRandomIntegerInRange(par2Random, 2, 7), 8, 1, var4, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, this.cropTypeD, MathHelper.getRandomIntegerInRange(par2Random, 2, 7), 10, 1, var4, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, this.cropTypeD, MathHelper.getRandomIntegerInRange(par2Random, 2, 7), 11, 1, var4, par3StructureBoundingBox); - } - -- for(var4 = 0; var4 < 9; ++var4) { -- for(int var5 = 0; var5 < 13; ++var5) { -- this.clearCurrentPositionBlocksUpwards(var1, var5, 4, var4, var3); -- this.fillCurrentPositionBlocksDownwards(var1, Block.dirt.blockID, 0, var5, -1, var4, var3); -+ for (var4 = 0; var4 < 9; ++var4) { -+ for (int var5 = 0; var5 < 13; ++var5) { -+ this.clearCurrentPositionBlocksUpwards(par1World, var5, 4, var4, par3StructureBoundingBox); -+ this.fillCurrentPositionBlocksDownwards(par1World, Block.dirt.blockID, 0, var5, -1, var4, par3StructureBoundingBox); - } - } - ---- net/minecraft/src/BlockWeb.java -+++ net/minecraft/src/BlockWeb.java -@@ -3,35 +3,58 @@ - import java.util.Random; - - public class BlockWeb extends Block { -- public BlockWeb(int var1) { -- super(var1, Material.web); -+ public BlockWeb(int par1) { -+ super(par1, Material.web); - this.setCreativeTab(CreativeTabs.tabDecorations); - } - -- public void onEntityCollidedWithBlock(World var1, int var2, int var3, int var4, Entity var5) { -- var5.setInWeb(); -+ /** -+ * Triggered whenever an entity collides with this block (enters into the block). Args: world, x, y, z, entity -+ */ -+ public void onEntityCollidedWithBlock(World par1World, int par2, int par3, int par4, Entity par5Entity) { -+ par5Entity.setInWeb(); - } - -+ /** -+ * Is this block (a) opaque and (b) a full 1m cube? This determines whether or not to render the shared face of two -+ * adjacent blocks and also whether the player can attach torches, redstone wire, etc to this block. -+ */ - public boolean isOpaqueCube() { - return false; - } - -- public AxisAlignedBB getCollisionBoundingBoxFromPool(World var1, int var2, int var3, int var4) { -+ /** -+ * Returns a bounding box from the pool of bounding boxes (this means this box can change after the pool has been -+ * cleared to be reused) -+ */ -+ public AxisAlignedBB getCollisionBoundingBoxFromPool(World par1World, int par2, int par3, int par4) { - return null; - } - -+ /** -+ * The type of render function that is called for this block -+ */ - public int getRenderType() { - return 1; - } - -+ /** -+ * If this block doesn't render as an ordinary block it will return False (examples: signs, buttons, stairs, etc) -+ */ - public boolean renderAsNormalBlock() { - return false; - } - -- public int idDropped(int var1, Random var2, int var3) { -+ /** -+ * Returns the ID of the items to drop on destruction. -+ */ -+ public int idDropped(int par1, Random par2Random, int par3) { - return Item.silk.itemID; - } - -+ /** -+ * Return true if a player with Silk Touch can harvest this block directly, and not its normal drops. -+ */ - protected boolean canSilkHarvest() { - return true; - } ---- net/minecraft/src/CallableConnectionName.java -+++ net/minecraft/src/CallableConnectionName.java -@@ -4,11 +4,12 @@ - - class CallableConnectionName implements Callable { - final NetServerHandler field_111201_a; -+ - final NetworkListenThread field_111200_b; - -- CallableConnectionName(NetworkListenThread var1, NetServerHandler var2) { -- this.field_111200_b = var1; -- this.field_111201_a = var2; -+ CallableConnectionName(NetworkListenThread par1NetworkListenThread, NetServerHandler par2NetServerHandler) { -+ this.field_111200_b = par1NetworkListenThread; -+ this.field_111201_a = par2NetServerHandler; - } - - public String func_111199_a() { ---- net/minecraft/src/BlockTripWireSource.java -+++ net/minecraft/src/BlockTripWireSource.java -@@ -3,138 +3,176 @@ - import java.util.Random; - - public class BlockTripWireSource extends Block { -- public BlockTripWireSource(int var1) { -- super(var1, Material.circuits); -+ public BlockTripWireSource(int par1) { -+ super(par1, Material.circuits); - this.setCreativeTab(CreativeTabs.tabRedstone); - this.setTickRandomly(true); - } - -- public AxisAlignedBB getCollisionBoundingBoxFromPool(World var1, int var2, int var3, int var4) { -+ /** -+ * Returns a bounding box from the pool of bounding boxes (this means this box can change after the pool has been -+ * cleared to be reused) -+ */ -+ public AxisAlignedBB getCollisionBoundingBoxFromPool(World par1World, int par2, int par3, int par4) { - return null; - } - -+ /** -+ * Is this block (a) opaque and (b) a full 1m cube? This determines whether or not to render the shared face of two -+ * adjacent blocks and also whether the player can attach torches, redstone wire, etc to this block. -+ */ - public boolean isOpaqueCube() { - return false; - } - -+ /** -+ * If this block doesn't render as an ordinary block it will return False (examples: signs, buttons, stairs, etc) -+ */ - public boolean renderAsNormalBlock() { - return false; - } - -+ /** -+ * The type of render function that is called for this block -+ */ - public int getRenderType() { - return 29; - } - -- public int tickRate(World var1) { -+ /** -+ * How many world ticks before ticking -+ */ -+ public int tickRate(World par1World) { - return 10; - } - -- public boolean canPlaceBlockOnSide(World var1, int var2, int var3, int var4, int var5) { -- return var5 == 2 && var1.isBlockNormalCube(var2, var3, var4 + 1) ? true : (var5 == 3 && var1.isBlockNormalCube(var2, var3, var4 - 1) ? true : (var5 == 4 && var1.isBlockNormalCube(var2 + 1, var3, var4) ? true : var5 == 5 && var1.isBlockNormalCube(var2 - 1, var3, var4))); -- } -- -- public boolean canPlaceBlockAt(World var1, int var2, int var3, int var4) { -- return var1.isBlockNormalCube(var2 - 1, var3, var4) ? true : (var1.isBlockNormalCube(var2 + 1, var3, var4) ? true : (var1.isBlockNormalCube(var2, var3, var4 - 1) ? true : var1.isBlockNormalCube(var2, var3, var4 + 1))); -- } -- -- public int onBlockPlaced(World var1, int var2, int var3, int var4, int var5, float var6, float var7, float var8, int var9) { -+ /** -+ * checks to see if you can place this block can be placed on that side of a block: BlockLever overrides -+ */ -+ public boolean canPlaceBlockOnSide(World par1World, int par2, int par3, int par4, int par5) { -+ return par5 == 2 && par1World.isBlockNormalCube(par2, par3, par4 + 1) ? true : (par5 == 3 && par1World.isBlockNormalCube(par2, par3, par4 - 1) ? true : (par5 == 4 && par1World.isBlockNormalCube(par2 + 1, par3, par4) ? true : par5 == 5 && par1World.isBlockNormalCube(par2 - 1, par3, par4))); -+ } -+ -+ /** -+ * Checks to see if its valid to put this block at the specified coordinates. Args: world, x, y, z -+ */ -+ public boolean canPlaceBlockAt(World par1World, int par2, int par3, int par4) { -+ return par1World.isBlockNormalCube(par2 - 1, par3, par4) ? true : (par1World.isBlockNormalCube(par2 + 1, par3, par4) ? true : (par1World.isBlockNormalCube(par2, par3, par4 - 1) ? true : par1World.isBlockNormalCube(par2, par3, par4 + 1))); -+ } -+ -+ /** -+ * Called when a block is placed using its ItemBlock. Args: World, X, Y, Z, side, hitX, hitY, hitZ, block metadata -+ */ -+ public int onBlockPlaced(World par1World, int par2, int par3, int par4, int par5, float par6, float par7, float par8, int par9) { - byte var10 = 0; -- if(var5 == 2 && var1.isBlockNormalCubeDefault(var2, var3, var4 + 1, true)) { -+ -+ if (par5 == 2 && par1World.isBlockNormalCubeDefault(par2, par3, par4 + 1, true)) { - var10 = 2; - } - -- if(var5 == 3 && var1.isBlockNormalCubeDefault(var2, var3, var4 - 1, true)) { -+ if (par5 == 3 && par1World.isBlockNormalCubeDefault(par2, par3, par4 - 1, true)) { - var10 = 0; - } - -- if(var5 == 4 && var1.isBlockNormalCubeDefault(var2 + 1, var3, var4, true)) { -+ if (par5 == 4 && par1World.isBlockNormalCubeDefault(par2 + 1, par3, par4, true)) { - var10 = 1; - } - -- if(var5 == 5 && var1.isBlockNormalCubeDefault(var2 - 1, var3, var4, true)) { -+ if (par5 == 5 && par1World.isBlockNormalCubeDefault(par2 - 1, par3, par4, true)) { - var10 = 3; - } - - return var10; - } - -- public void onPostBlockPlaced(World var1, int var2, int var3, int var4, int var5) { -- this.func_72143_a(var1, var2, var3, var4, this.blockID, var5, false, -1, 0); -+ /** -+ * Called after a block is placed -+ */ -+ public void onPostBlockPlaced(World par1World, int par2, int par3, int par4, int par5) { -+ this.func_72143_a(par1World, par2, par3, par4, this.blockID, par5, false, -1, 0); - } - -- public void onNeighborBlockChange(World var1, int var2, int var3, int var4, int var5) { -- if(var5 != this.blockID) { -- if(this.func_72144_l(var1, var2, var3, var4)) { -- int var6 = var1.getBlockMetadata(var2, var3, var4); -+ /** -+ * Lets the block know when one of its neighbor changes. Doesn't know which neighbor changed (coordinates passed are -+ * their own) Args: x, y, z, neighbor blockID -+ */ -+ public void onNeighborBlockChange(World par1World, int par2, int par3, int par4, int par5) { -+ if (par5 != this.blockID) { -+ if (this.func_72144_l(par1World, par2, par3, par4)) { -+ int var6 = par1World.getBlockMetadata(par2, par3, par4); - int var7 = var6 & 3; - boolean var8 = false; -- if(!var1.isBlockNormalCube(var2 - 1, var3, var4) && var7 == 3) { -- var8 = true; -- } -- -- if(!var1.isBlockNormalCube(var2 + 1, var3, var4) && var7 == 1) { -- var8 = true; -- } -- -- if(!var1.isBlockNormalCube(var2, var3, var4 - 1) && var7 == 0) { -- var8 = true; -- } -- -- if(!var1.isBlockNormalCube(var2, var3, var4 + 1) && var7 == 2) { -- var8 = true; -- } -- -- if(var8) { -- this.dropBlockAsItem(var1, var2, var3, var4, var6, 0); -- var1.setBlockToAir(var2, var3, var4); -+ -+ if (!par1World.isBlockNormalCube(par2 - 1, par3, par4) && var7 == 3) { -+ var8 = true; -+ } -+ -+ if (!par1World.isBlockNormalCube(par2 + 1, par3, par4) && var7 == 1) { -+ var8 = true; -+ } -+ -+ if (!par1World.isBlockNormalCube(par2, par3, par4 - 1) && var7 == 0) { -+ var8 = true; -+ } -+ -+ if (!par1World.isBlockNormalCube(par2, par3, par4 + 1) && var7 == 2) { -+ var8 = true; -+ } -+ -+ if (var8) { -+ this.dropBlockAsItem(par1World, par2, par3, par4, var6, 0); -+ par1World.setBlockToAir(par2, par3, par4); - } - } -- - } - } - -- public void func_72143_a(World var1, int var2, int var3, int var4, int var5, int var6, boolean var7, int var8, int var9) { -- int var10 = var6 & 3; -- boolean var11 = (var6 & 4) == 4; -- boolean var12 = (var6 & 8) == 8; -- boolean var13 = var5 == Block.tripWireSource.blockID; -+ public void func_72143_a(World par1World, int par2, int par3, int par4, int par5, int par6, boolean par7, int par8, int par9) { -+ int var10 = par6 & 3; -+ boolean var11 = (par6 & 4) == 4; -+ boolean var12 = (par6 & 8) == 8; -+ boolean var13 = par5 == Block.tripWireSource.blockID; - boolean var14 = false; -- boolean var15 = !var1.doesBlockHaveSolidTopSurface(var2, var3 - 1, var4); -+ boolean var15 = !par1World.doesBlockHaveSolidTopSurface(par2, par3 - 1, par4); - int var16 = Direction.offsetX[var10]; - int var17 = Direction.offsetZ[var10]; - int var18 = 0; - int[] var19 = new int[42]; -- - int var20; - int var21; - int var22; - int var23; - int var24; -- for(var20 = 1; var20 < 42; ++var20) { -- var21 = var2 + var16 * var20; -- var22 = var4 + var17 * var20; -- var23 = var1.getBlockId(var21, var3, var22); -- if(var23 == Block.tripWireSource.blockID) { -- var24 = var1.getBlockMetadata(var21, var3, var22); -- if((var24 & 3) == Direction.rotateOpposite[var10]) { -+ -+ for (var20 = 1; var20 < 42; ++var20) { -+ var21 = par2 + var16 * var20; -+ var22 = par4 + var17 * var20; -+ var23 = par1World.getBlockId(var21, par3, var22); -+ -+ if (var23 == Block.tripWireSource.blockID) { -+ var24 = par1World.getBlockMetadata(var21, par3, var22); -+ -+ if ((var24 & 3) == Direction.rotateOpposite[var10]) { - var18 = var20; - } -+ - break; - } - -- if(var23 != Block.tripWire.blockID && var20 != var8) { -+ if (var23 != Block.tripWire.blockID && var20 != par8) { - var19[var20] = -1; - var13 = false; - } else { -- var24 = var20 == var8 ? var9 : var1.getBlockMetadata(var21, var3, var22); -+ var24 = var20 == par8 ? par9 : par1World.getBlockMetadata(var21, par3, var22); - boolean var25 = (var24 & 8) != 8; - boolean var26 = (var24 & 1) == 1; - boolean var27 = (var24 & 2) == 2; - var13 &= var27 == var15; - var14 |= var25 && var26; - var19[var20] = var24; -- if(var20 == var8) { -- var1.scheduleBlockUpdate(var2, var3, var4, var5, this.tickRate(var1)); -+ -+ if (var20 == par8) { -+ par1World.scheduleBlockUpdate(par2, par3, par4, par5, this.tickRate(par1World)); - var13 &= var25; - } - } -@@ -143,137 +181,167 @@ - var13 &= var18 > 1; - var14 &= var13; - var20 = (var13 ? 4 : 0) | (var14 ? 8 : 0); -- var6 = var10 | var20; -- if(var18 > 0) { -- var21 = var2 + var16 * var18; -- var22 = var4 + var17 * var18; -+ par6 = var10 | var20; -+ -+ if (var18 > 0) { -+ var21 = par2 + var16 * var18; -+ var22 = par4 + var17 * var18; - var23 = Direction.rotateOpposite[var10]; -- var1.setBlockMetadata(var21, var3, var22, var23 | var20, 3); -- this.notifyNeighborOfChange(var1, var21, var3, var22, var23); -- this.playSoundEffect(var1, var21, var3, var22, var13, var14, var11, var12); -+ par1World.setBlockMetadataWithNotify(var21, par3, var22, var23 | var20, 3); -+ this.notifyNeighborOfChange(par1World, var21, par3, var22, var23); -+ this.playSoundEffect(par1World, var21, par3, var22, var13, var14, var11, var12); - } - -- this.playSoundEffect(var1, var2, var3, var4, var13, var14, var11, var12); -- if(var5 > 0) { -- var1.setBlockMetadata(var2, var3, var4, var6, 3); -- if(var7) { -- this.notifyNeighborOfChange(var1, var2, var3, var4, var10); -+ this.playSoundEffect(par1World, par2, par3, par4, var13, var14, var11, var12); -+ -+ if (par5 > 0) { -+ par1World.setBlockMetadataWithNotify(par2, par3, par4, par6, 3); -+ -+ if (par7) { -+ this.notifyNeighborOfChange(par1World, par2, par3, par4, var10); - } - } - -- if(var11 != var13) { -- for(var21 = 1; var21 < var18; ++var21) { -- var22 = var2 + var16 * var21; -- var23 = var4 + var17 * var21; -+ if (var11 != var13) { -+ for (var21 = 1; var21 < var18; ++var21) { -+ var22 = par2 + var16 * var21; -+ var23 = par4 + var17 * var21; - var24 = var19[var21]; -- if(var24 >= 0) { -- if(var13) { -+ -+ if (var24 >= 0) { -+ if (var13) { - var24 |= 4; - } else { - var24 &= -5; - } - -- var1.setBlockMetadata(var22, var3, var23, var24, 3); -+ par1World.setBlockMetadataWithNotify(var22, par3, var23, var24, 3); - } - } - } -- -- } -- -- public void updateTick(World var1, int var2, int var3, int var4, Random var5) { -- this.func_72143_a(var1, var2, var3, var4, this.blockID, var1.getBlockMetadata(var2, var3, var4), true, -1, 0); -- } -- -- private void playSoundEffect(World var1, int var2, int var3, int var4, boolean var5, boolean var6, boolean var7, boolean var8) { -- if(var6 && !var8) { -- var1.playSoundEffect((double)var2 + 0.5D, (double)var3 + 0.1D, (double)var4 + 0.5D, "random.click", 0.4F, 0.6F); -- } else if(!var6 && var8) { -- var1.playSoundEffect((double)var2 + 0.5D, (double)var3 + 0.1D, (double)var4 + 0.5D, "random.click", 0.4F, 0.5F); -- } else if(var5 && !var7) { -- var1.playSoundEffect((double)var2 + 0.5D, (double)var3 + 0.1D, (double)var4 + 0.5D, "random.click", 0.4F, 0.7F); -- } else if(!var5 && var7) { -- var1.playSoundEffect((double)var2 + 0.5D, (double)var3 + 0.1D, (double)var4 + 0.5D, "random.bowhit", 0.4F, 1.2F / (var1.s.nextFloat() * 0.2F + 0.9F)); -- } -- -- } -- -- private void notifyNeighborOfChange(World var1, int var2, int var3, int var4, int var5) { -- var1.notifyBlocksOfNeighborChange(var2, var3, var4, this.blockID); -- if(var5 == 3) { -- var1.notifyBlocksOfNeighborChange(var2 - 1, var3, var4, this.blockID); -- } else if(var5 == 1) { -- var1.notifyBlocksOfNeighborChange(var2 + 1, var3, var4, this.blockID); -- } else if(var5 == 0) { -- var1.notifyBlocksOfNeighborChange(var2, var3, var4 - 1, this.blockID); -- } else if(var5 == 2) { -- var1.notifyBlocksOfNeighborChange(var2, var3, var4 + 1, this.blockID); -- } -- -- } -- -- private boolean func_72144_l(World var1, int var2, int var3, int var4) { -- if(!this.canPlaceBlockAt(var1, var2, var3, var4)) { -- this.dropBlockAsItem(var1, var2, var3, var4, var1.getBlockMetadata(var2, var3, var4), 0); -- var1.setBlockToAir(var2, var3, var4); -+ } -+ -+ /** -+ * Ticks the block if it's been scheduled -+ */ -+ public void updateTick(World par1World, int par2, int par3, int par4, Random par5Random) { -+ this.func_72143_a(par1World, par2, par3, par4, this.blockID, par1World.getBlockMetadata(par2, par3, par4), true, -1, 0); -+ } -+ -+ /** -+ * only of the conditions are right -+ */ -+ private void playSoundEffect(World par1World, int par2, int par3, int par4, boolean par5, boolean par6, boolean par7, boolean par8) { -+ if (par6 && !par8) { -+ par1World.playSoundEffect((double)par2 + 0.5D, (double)par3 + 0.1D, (double)par4 + 0.5D, "random.click", 0.4F, 0.6F); -+ } else if (!par6 && par8) { -+ par1World.playSoundEffect((double)par2 + 0.5D, (double)par3 + 0.1D, (double)par4 + 0.5D, "random.click", 0.4F, 0.5F); -+ } else if (par5 && !par7) { -+ par1World.playSoundEffect((double)par2 + 0.5D, (double)par3 + 0.1D, (double)par4 + 0.5D, "random.click", 0.4F, 0.7F); -+ } else if (!par5 && par7) { -+ par1World.playSoundEffect((double)par2 + 0.5D, (double)par3 + 0.1D, (double)par4 + 0.5D, "random.bowhit", 0.4F, 1.2F / (par1World.rand.nextFloat() * 0.2F + 0.9F)); -+ } -+ } -+ -+ private void notifyNeighborOfChange(World par1World, int par2, int par3, int par4, int par5) { -+ par1World.notifyBlocksOfNeighborChange(par2, par3, par4, this.blockID); -+ -+ if (par5 == 3) { -+ par1World.notifyBlocksOfNeighborChange(par2 - 1, par3, par4, this.blockID); -+ } else if (par5 == 1) { -+ par1World.notifyBlocksOfNeighborChange(par2 + 1, par3, par4, this.blockID); -+ } else if (par5 == 0) { -+ par1World.notifyBlocksOfNeighborChange(par2, par3, par4 - 1, this.blockID); -+ } else if (par5 == 2) { -+ par1World.notifyBlocksOfNeighborChange(par2, par3, par4 + 1, this.blockID); -+ } -+ } -+ -+ private boolean func_72144_l(World par1World, int par2, int par3, int par4) { -+ if (!this.canPlaceBlockAt(par1World, par2, par3, par4)) { -+ this.dropBlockAsItem(par1World, par2, par3, par4, par1World.getBlockMetadata(par2, par3, par4), 0); -+ par1World.setBlockToAir(par2, par3, par4); - return false; - } else { - return true; - } - } - -- public void setBlockBoundsBasedOnState(IBlockAccess var1, int var2, int var3, int var4) { -- int var5 = var1.getBlockMetadata(var2, var3, var4) & 3; -- float var6 = 3.0F / 16.0F; -- if(var5 == 3) { -+ /** -+ * Updates the blocks bounds based on its current state. Args: world, x, y, z -+ */ -+ public void setBlockBoundsBasedOnState(IBlockAccess par1IBlockAccess, int par2, int par3, int par4) { -+ int var5 = par1IBlockAccess.getBlockMetadata(par2, par3, par4) & 3; -+ float var6 = 0.1875F; -+ -+ if (var5 == 3) { - this.setBlockBounds(0.0F, 0.2F, 0.5F - var6, var6 * 2.0F, 0.8F, 0.5F + var6); -- } else if(var5 == 1) { -+ } else if (var5 == 1) { - this.setBlockBounds(1.0F - var6 * 2.0F, 0.2F, 0.5F - var6, 1.0F, 0.8F, 0.5F + var6); -- } else if(var5 == 0) { -+ } else if (var5 == 0) { - this.setBlockBounds(0.5F - var6, 0.2F, 0.0F, 0.5F + var6, 0.8F, var6 * 2.0F); -- } else if(var5 == 2) { -+ } else if (var5 == 2) { - this.setBlockBounds(0.5F - var6, 0.2F, 1.0F - var6 * 2.0F, 0.5F + var6, 0.8F, 1.0F); - } -- - } - -- public void breakBlock(World var1, int var2, int var3, int var4, int var5, int var6) { -- boolean var7 = (var6 & 4) == 4; -- boolean var8 = (var6 & 8) == 8; -- if(var7 || var8) { -- this.func_72143_a(var1, var2, var3, var4, 0, var6, false, -1, 0); -+ /** -+ * Called on server worlds only when the block has been replaced by a different block ID, or the same block with a -+ * different metadata value, but before the new metadata value is set. Args: World, x, y, z, old block ID, old metadata -+ */ -+ public void breakBlock(World par1World, int par2, int par3, int par4, int par5, int par6) { -+ boolean var7 = (par6 & 4) == 4; -+ boolean var8 = (par6 & 8) == 8; -+ -+ if (var7 || var8) { -+ this.func_72143_a(par1World, par2, par3, par4, 0, par6, false, -1, 0); - } - -- if(var8) { -- var1.notifyBlocksOfNeighborChange(var2, var3, var4, this.blockID); -- int var9 = var6 & 3; -- if(var9 == 3) { -- var1.notifyBlocksOfNeighborChange(var2 - 1, var3, var4, this.blockID); -- } else if(var9 == 1) { -- var1.notifyBlocksOfNeighborChange(var2 + 1, var3, var4, this.blockID); -- } else if(var9 == 0) { -- var1.notifyBlocksOfNeighborChange(var2, var3, var4 - 1, this.blockID); -- } else if(var9 == 2) { -- var1.notifyBlocksOfNeighborChange(var2, var3, var4 + 1, this.blockID); -+ if (var8) { -+ par1World.notifyBlocksOfNeighborChange(par2, par3, par4, this.blockID); -+ int var9 = par6 & 3; -+ -+ if (var9 == 3) { -+ par1World.notifyBlocksOfNeighborChange(par2 - 1, par3, par4, this.blockID); -+ } else if (var9 == 1) { -+ par1World.notifyBlocksOfNeighborChange(par2 + 1, par3, par4, this.blockID); -+ } else if (var9 == 0) { -+ par1World.notifyBlocksOfNeighborChange(par2, par3, par4 - 1, this.blockID); -+ } else if (var9 == 2) { -+ par1World.notifyBlocksOfNeighborChange(par2, par3, par4 + 1, this.blockID); - } - } - -- super.breakBlock(var1, var2, var3, var4, var5, var6); -- } -- -- public int isProvidingWeakPower(IBlockAccess var1, int var2, int var3, int var4, int var5) { -- return (var1.getBlockMetadata(var2, var3, var4) & 8) == 8 ? 15 : 0; -- } -- -- public int isProvidingStrongPower(IBlockAccess var1, int var2, int var3, int var4, int var5) { -- int var6 = var1.getBlockMetadata(var2, var3, var4); -- if((var6 & 8) != 8) { -+ super.breakBlock(par1World, par2, par3, par4, par5, par6); -+ } -+ -+ /** -+ * Returns true if the block is emitting indirect/weak redstone power on the specified side. If isBlockNormalCube -+ * returns true, standard redstone propagation rules will apply instead and this will not be called. Args: World, X, Y, -+ * Z, side. Note that the side is reversed - eg it is 1 (up) when checking the bottom of the block. -+ */ -+ public int isProvidingWeakPower(IBlockAccess par1IBlockAccess, int par2, int par3, int par4, int par5) { -+ return (par1IBlockAccess.getBlockMetadata(par2, par3, par4) & 8) == 8 ? 15 : 0; -+ } -+ -+ /** -+ * Returns true if the block is emitting direct/strong redstone power on the specified side. Args: World, X, Y, Z, -+ * side. Note that the side is reversed - eg it is 1 (up) when checking the bottom of the block. -+ */ -+ public int isProvidingStrongPower(IBlockAccess par1IBlockAccess, int par2, int par3, int par4, int par5) { -+ int var6 = par1IBlockAccess.getBlockMetadata(par2, par3, par4); -+ -+ if ((var6 & 8) != 8) { - return 0; - } else { - int var7 = var6 & 3; -- return var7 == 2 && var5 == 2 ? 15 : (var7 == 0 && var5 == 3 ? 15 : (var7 == 1 && var5 == 4 ? 15 : (var7 == 3 && var5 == 5 ? 15 : 0))); -+ return var7 == 2 && par5 == 2 ? 15 : (var7 == 0 && par5 == 3 ? 15 : (var7 == 1 && par5 == 4 ? 15 : (var7 == 3 && par5 == 5 ? 15 : 0))); - } - } - -+ /** -+ * Can this block provide power. Only wire currently seems to have this change based on its state. -+ */ - public boolean canProvidePower() { - return true; - } ---- /dev/null -+++ com/prupe/mcpatcher/TexturePackChangeHandler.java -@@ -1,0 +1,218 @@ -+package com.prupe.mcpatcher; -+ -+import com.prupe.mcpatcher.TexturePackChangeHandler$1; -+import java.util.ArrayList; -+import java.util.Collections; -+import java.util.HashSet; -+import java.util.Iterator; -+import java.util.List; -+import java.util.Set; -+import java.util.Map.Entry; -+import net.minecraft.src.Minecraft; -+import net.minecraft.src.ResourceLocation; -+import net.minecraft.src.ResourcePack; -+import net.minecraft.src.SimpleTexture; -+import net.minecraft.src.TextureManager; -+import net.minecraft.src.TextureObject; -+ -+public abstract class TexturePackChangeHandler { -+ private static final MCLogger logger = MCLogger.getLogger("Texture Pack"); -+ private static final ArrayList handlers = new ArrayList(); -+ private static boolean initializing; -+ private static boolean changing; -+ private static long startTime; -+ private static long startMem; -+ private boolean updateNeeded; -+ protected final String name; -+ protected final int order; -+ -+ public TexturePackChangeHandler(String name, int order) { -+ this.name = name; -+ this.order = order; -+ } -+ -+ public void initialize() { -+ this.beforeChange(); -+ this.afterChange(); -+ } -+ -+ public void refresh() { -+ this.beforeChange(); -+ this.afterChange(); -+ } -+ -+ public abstract void beforeChange(); -+ -+ public abstract void afterChange(); -+ -+ public void afterChange2() {} -+ -+ protected void setUpdateNeeded(boolean updateNeeded) { -+ this.updateNeeded = updateNeeded; -+ } -+ -+ public static void scheduleTexturePackRefresh() { -+ // ToDO: -+ //Minecraft.getMinecraft().scheduleTexturePackRefresh(); -+ } -+ -+ public static void register(TexturePackChangeHandler handler) { -+ if (handler != null) { -+ if (Minecraft.getMinecraft().getResourceManager() != null) { -+ try { -+ logger.info("initializing %s...", new Object[] {handler.name}); -+ handler.initialize(); -+ } catch (Throwable var2) { -+ var2.printStackTrace(); -+ logger.severe("%s initialization failed", new Object[] {handler.name}); -+ } -+ } -+ -+ handlers.add(handler); -+ logger.fine("registered texture pack handler %s, priority %d", new Object[] {handler.name, Integer.valueOf(handler.order)}); -+ Collections.sort(handlers, new TexturePackChangeHandler$1()); -+ } -+ } -+ -+ public static void earlyInitialize(String className, String methodName) { -+ try { -+ logger.fine("calling %s.%s", new Object[] {className, methodName}); -+ Class.forName(className).getDeclaredMethod(methodName, new Class[0]).invoke((Object)null, new Object[0]); -+ } catch (Throwable var3) { -+ ; -+ } -+ } -+ -+ public static void checkForTexturePackChange() { -+ Iterator i$ = handlers.iterator(); -+ -+ while (i$.hasNext()) { -+ TexturePackChangeHandler handler = (TexturePackChangeHandler)i$.next(); -+ -+ if (handler.updateNeeded) { -+ handler.updateNeeded = false; -+ -+ try { -+ logger.info("refreshing %s...", new Object[] {handler.name}); -+ handler.refresh(); -+ } catch (Throwable var3) { -+ var3.printStackTrace(); -+ logger.severe("%s refresh failed", new Object[] {handler.name}); -+ } -+ } -+ } -+ } -+ -+ public static void beforeChange1(boolean initializing1) { -+ logger.finer("beforeChange1(%s) initializing=%s changing=%s", new Object[] {Boolean.valueOf(initializing1), Boolean.valueOf(initializing), Boolean.valueOf(changing)}); -+ -+ if (initializing1) { -+ logger.finer("skipping beforeChange1 because we are still initializing", new Object[0]); -+ initializing = true; -+ } else if (changing && !initializing) { -+ (new RuntimeException("unexpected recursive call to TexturePackChangeHandler")).printStackTrace(); -+ } else { -+ changing = true; -+ startTime = System.currentTimeMillis(); -+ Runtime runtime = Runtime.getRuntime(); -+ startMem = runtime.totalMemory() - runtime.freeMemory(); -+ List resourcePacks = TexturePackAPI.getResourcePacks((String)null); -+ logger.fine("%s resource packs (%d selected):", new Object[] {initializing ? "initializing" : "changing", Integer.valueOf(resourcePacks.size())}); -+ Iterator namespaces = resourcePacks.iterator(); -+ -+ while (namespaces.hasNext()) { -+ ResourcePack textureManager = (ResourcePack)namespaces.next(); -+ logger.fine("resource pack: %s", new Object[] {textureManager.getPackName()}); -+ } -+ -+ Set namespaces1 = TexturePackAPI.getNamespaces(); -+ logger.fine("%d resource namespaces:", new Object[] {Integer.valueOf(namespaces1.size())}); -+ Iterator textureManager1 = namespaces1.iterator(); -+ -+ while (textureManager1.hasNext()) { -+ String texturesToUnload = (String)textureManager1.next(); -+ logger.fine("namespace: %s", new Object[] {texturesToUnload}); -+ } -+ -+ textureManager1 = handlers.iterator(); -+ -+ while (textureManager1.hasNext()) { -+ TexturePackChangeHandler texturesToUnload1 = (TexturePackChangeHandler)textureManager1.next(); -+ -+ try { -+ logger.info("refreshing %s (pre)...", new Object[] {texturesToUnload1.name}); -+ texturesToUnload1.beforeChange(); -+ } catch (Throwable var10) { -+ var10.printStackTrace(); -+ logger.severe("%s.beforeChange failed", new Object[] {texturesToUnload1.name}); -+ } -+ } -+ -+ TextureManager textureManager2 = Minecraft.getMinecraft().getTextureManager(); -+ -+ if (textureManager2 != null) { -+ HashSet texturesToUnload2 = new HashSet(); -+ Iterator i$ = textureManager2.mapTextureObjects.entrySet().iterator(); -+ -+ while (i$.hasNext()) { -+ Entry resource = (Entry)i$.next(); -+ ResourceLocation resource1 = (ResourceLocation)resource.getKey(); -+ TextureObject texture = (TextureObject)resource.getValue(); -+ -+ if (texture instanceof SimpleTexture && !TexturePackAPI.hasResource(resource1)) { -+ texturesToUnload2.add(resource1); -+ } -+ } -+ -+ i$ = texturesToUnload2.iterator(); -+ -+ while (i$.hasNext()) { -+ ResourceLocation resource2 = (ResourceLocation)i$.next(); -+ TexturePackAPI.unloadTexture(resource2); -+ } -+ } -+ } -+ } -+ -+ public static void afterChange1(boolean initializing1) { -+ logger.finer("afterChange1(%s) initializing=%s changing=%s", new Object[] {Boolean.valueOf(initializing1), Boolean.valueOf(initializing), Boolean.valueOf(changing)}); -+ -+ if (initializing && !initializing1) { -+ logger.finer("deferring afterChange1 because we are still initializing", new Object[0]); -+ } else { -+ Iterator timeDiff = handlers.iterator(); -+ TexturePackChangeHandler handler; -+ -+ while (timeDiff.hasNext()) { -+ handler = (TexturePackChangeHandler)timeDiff.next(); -+ -+ try { -+ logger.info("refreshing %s (post)...", new Object[] {handler.name}); -+ handler.afterChange(); -+ } catch (Throwable var7) { -+ var7.printStackTrace(); -+ logger.severe("%s.afterChange failed", new Object[] {handler.name}); -+ } -+ } -+ -+ for (int var8 = handlers.size() - 1; var8 >= 0; --var8) { -+ handler = (TexturePackChangeHandler)handlers.get(var8); -+ -+ try { -+ handler.afterChange2(); -+ } catch (Throwable var6) { -+ var6.printStackTrace(); -+ logger.severe("%s.afterChange2 failed", new Object[] {handler.name}); -+ } -+ } -+ -+ System.gc(); -+ long var9 = System.currentTimeMillis() - startTime; -+ Runtime runtime = Runtime.getRuntime(); -+ long memDiff = runtime.totalMemory() - runtime.freeMemory() - startMem; -+ logger.info("done (%.3fs elapsed, mem usage %+.1fMB)\n", new Object[] {Double.valueOf((double)var9 / 1000.0D), Double.valueOf((double)memDiff / 1048576.0D)}); -+ changing = false; -+ initializing = false; -+ } -+ } -+} ---- net/minecraft/src/ICamera.java -+++ net/minecraft/src/ICamera.java -@@ -1,6 +1,10 @@ - package net.minecraft.src; - - public interface ICamera { -+ -+ /** -+ * Returns true if the bounding box is inside all 6 clipping planes, otherwise returns false. -+ */ - boolean isBoundingBoxInFrustum(AxisAlignedBB var1); - - void setPosition(double var1, double var3, double var5); ---- net/minecraft/src/Packet18Animation.java -+++ net/minecraft/src/Packet18Animation.java -@@ -4,32 +4,66 @@ - import java.io.DataOutput; - import java.io.IOException; - -+import org.spoutcraft.client.SpoutClient; -+import org.spoutcraft.client.packet.PacketFullVersion; -+import org.spoutcraft.client.packet.PacketRenderDistance; -+ - public class Packet18Animation extends Packet { -+ -+ /** The entity ID, in this case it's the player ID. */ - public int entityId; - public int animate; -- -- public Packet18Animation() { -- } -- -- public Packet18Animation(Entity var1, int var2) { -- this.entityId = var1.entityId; -- this.animate = var2; -- } -- -- public void readPacketData(DataInput var1) throws IOException { -- this.entityId = var1.readInt(); -- this.animate = var1.readByte(); -- } -- -- public void writePacketData(DataOutput var1) throws IOException { -- var1.writeInt(this.entityId); -- var1.writeByte(this.animate); -- } -- -- public void processPacket(NetHandler var1) { -- var1.handleAnimation(this); -- } -- -+ // Spout Start -+ Minecraft mc = SpoutClient.getHandle(); -+ // Spout End -+ -+ public Packet18Animation() {} -+ -+ public Packet18Animation(Entity par1Entity, int par2) { -+ this.entityId = par1Entity.entityId; -+ this.animate = par2; -+ } -+ -+ /** -+ * Abstract. Reads the raw packet data from the data stream. -+ */ -+ public void readPacketData(DataInput par1DataInput) throws IOException { -+ this.entityId = par1DataInput.readInt(); -+ this.animate = par1DataInput.readByte(); -+ } -+ -+ /** -+ * Abstract. Writes the raw packet data to the data stream. -+ */ -+ public void writePacketData(DataOutput par1DataOutput) throws IOException { -+ par1DataOutput.writeInt(this.entityId); -+ par1DataOutput.writeByte(this.animate); -+ } -+ -+ /** -+ * Passes this Packet on to the NetHandler for processing. -+ */ -+ public void processPacket(NetHandler par1NetHandler) { -+ // Spout Start -+ if (entityId == -42) { -+ SpoutClient.getInstance().setSpoutVersion(1); -+ ((NetClientHandler) par1NetHandler).addToSendQueue(this); -+ SpoutClient.getInstance().getPacketManager().sendSpoutPacket(new PacketRenderDistance((byte)Minecraft.getMinecraft().gameSettings.renderDistance)); -+ SpoutClient.getInstance().getPacketManager().sendSpoutPacket(new PacketFullVersion(SpoutClient.getClientVersion())); -+ System.out.println("Detected SpoutPlugin enabled server."); -+ if (this.mc.currentScreen instanceof GuiDownloadTerrain) { -+ this.mc.displayGuiScreen(null, true); -+ this.mc.displayGuiScreen(new org.spoutcraft.client.gui.precache.GuiPrecache()); -+ } -+ } else { -+ par1NetHandler.handleAnimation(this); -+ } -+ // Spout End -+ } -+ -+ /** -+ * Abstract. Return the size of the packet (not counting the header). -+ */ - public int getPacketSize() { - return 5; - } ---- /dev/null -+++ org/spoutcraft/api/gui/MinecraftTessellator.java -@@ -1,0 +1,54 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.api.gui; -+ -+public interface MinecraftTessellator { -+ public void draw(); -+ -+ public void startDrawingQuads(); -+ -+ public void startDrawing(int drawMode); -+ -+ public void setBrightness(int brightness); -+ -+ public void setTextureUV(double s, double t); -+ -+ public void setColorOpaqueFloat(float red, float green, float blue); -+ -+ public void setColorRGBAFloat(float red, float green, float blue, float alpha); -+ -+ public void setColorOpaque(int red, int green, int blue); -+ -+ public void setColorRGBA(int red, int green, int blue, int alpha); -+ -+ public void addVertexWithUV(double x, double y, double z, double s, double t); -+ -+ public void addVertex(double x, double y, double z); -+ -+ public void setColorOpaqueInt(int color); -+ -+ public void setColorRGBAInt(int color, int alpha); -+ -+ public void disableColor(); -+ -+ public void setNormal(float x, float y, float z); -+ -+ public void setTranslation(double x, double y, double z); -+} ---- net/minecraft/src/CallableType2.java -+++ net/minecraft/src/CallableType2.java -@@ -5,8 +5,8 @@ - class CallableType2 implements Callable { - final Minecraft mc; - -- CallableType2(Minecraft var1) { -- this.mc = var1; -+ CallableType2(Minecraft par1Minecraft) { -+ this.mc = par1Minecraft; - } - - public String func_82886_a() { ---- net/minecraft/src/GuiPlayerInfo.java -+++ net/minecraft/src/GuiPlayerInfo.java -@@ -1,12 +1,18 @@ - package net.minecraft.src; - - public class GuiPlayerInfo { -- public final String a; -- private final String c; -+ -+ /** The string value of the object */ -+ public final String name; -+ -+ /** Player name in lowercase. */ -+ private final String nameinLowerCase; -+ -+ /** Player response time to server in milliseconds */ - public int responseTime; - -- public GuiPlayerInfo(String var1) { -- this.a = var1; -- this.c = var1.toLowerCase(); -+ public GuiPlayerInfo(String par1Str) { -+ this.name = par1Str; -+ this.nameinLowerCase = par1Str.toLowerCase(); - } - } ---- /dev/null -+++ org/spoutcraft/client/gui/settings/controls/SmoothLightingSlider.java -@@ -1,0 +1,47 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.client.gui.settings.controls; -+ -+import net.minecraft.src.Minecraft; -+ -+import org.spoutcraft.api.gui.GenericSlider; -+import org.spoutcraft.client.config.Configuration; -+ -+public class SmoothLightingSlider extends GenericSlider { -+ public SmoothLightingSlider() { -+ super("Smooth Lighting"); -+ setSliderPosition(Configuration.getSmoothLighting()); -+ setTooltip("Smooth lighting\nOFF - no smooth lighting (faster)\n1% - light smooth lighting (slower)\n100% - dark smooth lighting (slower)"); -+ } -+ -+ @Override -+ public void onSliderDrag(float old, float newPos) { -+ Configuration.setSmoothLighting(newPos); -+ Minecraft.getMinecraft().gameSettings.ambientOcclusion = Configuration.getSmoothLighting() > 0F ? 0 : 2; -+ if (Minecraft.getMinecraft().theWorld != null) { -+ Minecraft.getMinecraft().renderGlobal.loadRenderers(); -+ } -+ Configuration.write(); -+ } -+ -+ public String getText() { -+ return "Smooth Lighting: " + (int)(this.getSliderPosition() * 100) + "%"; -+ } -+} ---- net/minecraft/src/EnchantmentThorns.java -+++ net/minecraft/src/EnchantmentThorns.java -@@ -3,47 +3,57 @@ - import java.util.Random; - - public class EnchantmentThorns extends Enchantment { -- public EnchantmentThorns(int var1, int var2) { -- super(var1, var2, EnumEnchantmentType.armor_torso); -+ public EnchantmentThorns(int par1, int par2) { -+ super(par1, par2, EnumEnchantmentType.armor_torso); - this.setName("thorns"); - } - -- public int getMinEnchantability(int var1) { -- return 10 + 20 * (var1 - 1); -- } -- -- public int getMaxEnchantability(int var1) { -- return super.getMinEnchantability(var1) + 50; -- } -- -+ /** -+ * Returns the minimal value of enchantability needed on the enchantment level passed. -+ */ -+ public int getMinEnchantability(int par1) { -+ return 10 + 20 * (par1 - 1); -+ } -+ -+ /** -+ * Returns the maximum value of enchantability nedded on the enchantment level passed. -+ */ -+ public int getMaxEnchantability(int par1) { -+ return super.getMinEnchantability(par1) + 50; -+ } -+ -+ /** -+ * Returns the maximum level that the enchantment can have. -+ */ - public int getMaxLevel() { - return 3; - } - -- public boolean canApply(ItemStack var1) { -- return var1.getItem() instanceof ItemArmor ? true : super.canApply(var1); -- } -- -- public static boolean func_92094_a(int var0, Random var1) { -- return var0 <= 0 ? false : var1.nextFloat() < 0.15F * (float)var0; -- } -- -- public static int func_92095_b(int var0, Random var1) { -- return var0 > 10 ? var0 - 10 : 1 + var1.nextInt(4); -- } -- -- public static void func_92096_a(Entity var0, EntityLivingBase var1, Random var2) { -- int var3 = EnchantmentHelper.func_92098_i(var1); -- ItemStack var4 = EnchantmentHelper.func_92099_a(Enchantment.thorns, var1); -- if(func_92094_a(var3, var2)) { -- var0.attackEntityFrom(DamageSource.causeThornsDamage(var1), (float)func_92095_b(var3, var2)); -- var0.playSound("damage.thorns", 0.5F, 1.0F); -- if(var4 != null) { -- var4.damageItem(3, var1); -+ public boolean canApply(ItemStack par1ItemStack) { -+ return par1ItemStack.getItem() instanceof ItemArmor ? true : super.canApply(par1ItemStack); -+ } -+ -+ public static boolean func_92094_a(int par0, Random par1Random) { -+ return par0 <= 0 ? false : par1Random.nextFloat() < 0.15F * (float)par0; -+ } -+ -+ public static int func_92095_b(int par0, Random par1Random) { -+ return par0 > 10 ? par0 - 10 : 1 + par1Random.nextInt(4); -+ } -+ -+ public static void func_92096_a(Entity par0Entity, EntityLivingBase par1EntityLivingBase, Random par2Random) { -+ int var3 = EnchantmentHelper.func_92098_i(par1EntityLivingBase); -+ ItemStack var4 = EnchantmentHelper.func_92099_a(Enchantment.thorns, par1EntityLivingBase); -+ -+ if (func_92094_a(var3, par2Random)) { -+ par0Entity.attackEntityFrom(DamageSource.causeThornsDamage(par1EntityLivingBase), (float)func_92095_b(var3, par2Random)); -+ par0Entity.playSound("damage.thorns", 0.5F, 1.0F); -+ -+ if (var4 != null) { -+ var4.damageItem(3, par1EntityLivingBase); - } -- } else if(var4 != null) { -- var4.damageItem(1, var1); -+ } else if (var4 != null) { -+ var4.damageItem(1, par1EntityLivingBase); - } -- - } - } ---- net/minecraft/src/GuiContainer.java -+++ net/minecraft/src/GuiContainer.java -@@ -1,34 +1,75 @@ - package net.minecraft.src; - -+import java.util.ArrayList; - import java.util.Arrays; -+import java.util.Collections; - import java.util.HashSet; - import java.util.Iterator; - import java.util.List; - import java.util.Set; -+ -+import net.minecraft.src.Minecraft; -+import net.minecraft.src.RenderHelper; -+ - import org.lwjgl.input.Keyboard; - import org.lwjgl.opengl.GL11; - import org.lwjgl.opengl.GL12; -+import org.spoutcraft.api.Spoutcraft; -+import org.spoutcraft.api.gui.Button; -+import org.spoutcraft.api.gui.GenericButton; -+import org.spoutcraft.api.gui.ScreenType; -+import org.spoutcraft.api.gui.Widget; -+import org.spoutcraft.client.MCItemStackComparator; -+import org.spoutcraft.client.gui.ScreenUtil; -+import org.spoutcraft.client.inventory.CraftItemStack; -+import org.spoutcraft.client.inventory.InventoryUtil; - - public abstract class GuiContainer extends GuiScreen { - protected static final ResourceLocation field_110408_a = new ResourceLocation("textures/gui/container/inventory.png"); -- protected static RenderItem itemRenderer = new RenderItem(); -+ -+ /** Stacks renderer. Icons, stack size, health, etc... */ -+ // Spout Start -+ protected static RenderItem itemRenderer; -+ // Spout End -+ -+ /** The X size of the inventory window in pixels. */ - protected int xSize = 176; -+ -+ /** The Y size of the inventory window in pixels. */ - protected int ySize = 166; -+ -+ /** A list of the players inventory slots. */ - public Container inventorySlots; -+ -+ /** -+ * Starting X position for the Gui. Inconsistent use for Gui backgrounds. -+ */ - protected int guiLeft; -+ -+ /** -+ * Starting Y position for the Gui. Inconsistent use for Gui backgrounds. -+ */ - protected int guiTop; - private Slot theSlot; -+ -+ /** Used when touchscreen is enabled */ - private Slot clickedSlot; -+ -+ /** Used when touchscreen is enabled */ - private boolean isRightMouseClick; -+ -+ /** Used when touchscreen is enabled */ - private ItemStack draggedStack; - private int field_85049_r; - private int field_85048_s; - private Slot returningStackDestSlot; - private long returningStackTime; -+ -+ /** Used when touchscreen is enabled */ - private ItemStack returningStack; - private Slot field_92033_y; - private long field_92032_z; -- protected final Set r = new HashSet(); -+ protected final Set field_94077_p = new HashSet(); - protected boolean field_94076_q; - private int field_94071_C; - private int field_94067_D; -@@ -40,31 +81,255 @@ - private boolean field_94074_J; - private ItemStack field_94075_K; - -- public GuiContainer(Container var1) { -- this.inventorySlots = var1; -+ // Spout Start -+ private Button orderByAlphabet, orderById; -+ static { -+ itemRenderer = GuiScreen.ourItemRenderer; -+ } -+ // Spout Start -+ -+ public GuiContainer(Container par1Container) { -+ this.inventorySlots = par1Container; - this.field_94068_E = true; - } - -+ /** -+ * Adds the buttons (and other controls) to the screen in question. -+ */ - public void initGui() { - super.initGui(); - this.mc.thePlayer.openContainer = this.inventorySlots; - this.guiLeft = (this.width - this.xSize) / 2; - this.guiTop = (this.height - this.ySize) / 2; -- } -- -- public void drawScreen(int var1, int var2, float var3) { -+ -+ // Spout Start -+ if (Spoutcraft.hasPermission("spout.plugin.sortinventory")) { -+ orderByAlphabet = new GenericButton("A-Z"); -+ orderById = new GenericButton("Id"); -+ orderByAlphabet.setTooltip("Will sort the inventory contents by their name"); -+ orderById.setTooltip("Will sort the inventory contents by their id"); -+ ScreenType type = ScreenUtil.getType(this); -+ -+ if (type == ScreenType.PLAYER_INVENTORY) { -+ if (!this.mc.thePlayer.getActivePotionEffects().isEmpty()) { -+ orderByAlphabet.setGeometry((guiLeft+146), (guiTop+65), 27, 13); -+ orderById.setGeometry((guiLeft+176), (guiTop+65), 22, 13); -+ } else { -+ orderByAlphabet.setGeometry((guiLeft+86), (guiTop+65), 27, 13); -+ orderById.setGeometry((guiLeft+116), (guiTop+65), 22, 13); -+ } -+ } else if (type == ScreenType.CHEST_INVENTORY) { -+ orderByAlphabet.setGeometry((guiLeft+115), (guiTop+3), 27, 12); -+ orderById.setGeometry((guiLeft+145), (guiTop+3), 22, 12); -+ } -+ -+ IInventory inv = inventorySlots.getIInventory(); -+ if (inv != null && inventorySlots.isSortableInventory()) { -+ getScreen().attachWidgets("Spoutcraft", orderByAlphabet, orderById); -+ } -+ } -+ // Spout End -+ } -+ -+ @Override -+ public void drawWidgets(int x, int y, float z) { -+ GL11.glDisable(GL12.GL_RESCALE_NORMAL); -+ RenderHelper.disableStandardItemLighting(); -+ GL11.glDisable(GL11.GL_LIGHTING); -+ GL11.glDisable(GL11.GL_DEPTH_TEST); -+ super.drawWidgets(x, y, z); -+ GL11.glEnable(GL11.GL_LIGHTING); -+ GL11.glEnable(GL11.GL_DEPTH_TEST); -+ } -+ -+ public void buttonClicked(Button btn) { -+ if (btn == orderByAlphabet || btn == orderById) { -+ try { -+ IInventory inv = inventorySlots.getIInventory(); -+ if (inv != null) { -+ if (inv instanceof InventoryPlayer) { -+ compactInventory(inv, true); -+ sortPlayerInventory(btn == orderByAlphabet); -+ } else { -+ compactInventory(inv, false); -+ sortInventory(inv, (btn == orderByAlphabet)); -+ } -+ } -+ } catch (Exception e) { -+ e.printStackTrace(); -+ } -+ } -+ } -+ -+ public int getNumItems(IInventory inventory) { -+ int used = 0; -+ for (int i = 0; i < inventory.getSizeInventory(); i++) { -+ if (inventory.getStackInSlot(i) != null) { -+ used++; -+ } -+ } -+ return used; -+ } -+ -+ public void compactInventory(IInventory inventory, boolean player) { -+ // To keep mp compatibility, fake window clicks -+ for (int i = 0; i < inventory.getSizeInventory(); i++) { -+ ItemStack item = inventory.getStackInSlot(i); -+ if (item != null && item.stackSize < item.getMaxStackSize()) { -+ -+ // Find a place to put this -+ int orig = i; -+ // Avoid the hotbar -+ if (orig < 9 && player) { -+ continue; -+ } -+ handleMouseClick(null, orig, 0, 0); // Pick up the item -+ -+ for (int j = 0; j < inventory.getSizeInventory(); j++) { -+ if (j != i) { -+ ItemStack other = inventory.getStackInSlot(j); -+ if (other != null && other.itemID == item.itemID && other.getItemDamage() == item.getItemDamage()) { -+ int slot = j; -+ // Avoid the hotbar -+ if (slot < 9 && player) { -+ continue; -+ } -+ handleMouseClick(null, slot, 0, 0); // Merge with the existing stack we found -+ -+ // Move onto the next item to merge if this one is completely used up -+ ItemStack cursor = Minecraft.getMinecraft().thePlayer.inventory.getItemStack(); -+ if (cursor == null) { -+ break; -+ } -+ } -+ } -+ } -+ -+ // If we didn't merge all of the item, put it back -+ ItemStack cursor = Minecraft.getMinecraft().thePlayer.inventory.getItemStack(); -+ if (cursor != null) { -+ handleMouseClick(null, orig, 0, 0); -+ } -+ } -+ } -+ } -+ -+ @SuppressWarnings("unchecked") -+ public void sortPlayerInventory(boolean byName) { -+ // To keep mp compatibility, fake window clicks -+ InventoryPlayer inventory = Minecraft.getMinecraft().thePlayer.inventory; -+ for (int itemPass = 0; itemPass < getNumItems(inventory); itemPass++) { -+ for (int pass = 0; pass < inventory.mainInventory.length; pass++) { -+ ArrayList items = new ArrayList(); -+ for (int i = 0; i < inventory.mainInventory.length; i++) { -+ ItemStack item = inventory.mainInventory[i]; -+ if (item == null || i < 9) { -+ items.add(null); -+ } else { -+ items.add(new PositionedItemStack(item, i)); -+ } -+ } -+ Collections.sort(items, new MCItemStackComparator(byName)); -+ -+ while (true) { -+ if (items.get(pass) instanceof PositionedItemStack) { -+ PositionedItemStack item = (PositionedItemStack) items.get(pass); -+ // Left click pick up item -+ int origSlot = item.position; -+ if (origSlot < 9) { -+ break; -+ } -+ int newSlot = pass; -+ if (origSlot != newSlot) { -+ // Left click pick up item -+ handleMouseClick(null, origSlot, 0, 0); -+ -+ // Left click place item down -+ handleMouseClick(null, newSlot, 0, 0); -+ -+ ItemStack cursor = Minecraft.getMinecraft().thePlayer.inventory.getItemStack(); -+ if (cursor != null) { -+ handleMouseClick(null, origSlot, 0, 0); -+ } -+ } -+ break; -+ } -+ pass++; -+ if (pass >= inventory.mainInventory.length) { -+ break; -+ } -+ } -+ } -+ } -+ } -+ -+ @SuppressWarnings("unchecked") -+ public void sortInventory(IInventory inventory, boolean byName) { -+ // To keep mp compatibility, fake window clicks -+ for (int itemPass = 0; itemPass < getNumItems(inventory); itemPass++) { -+ for (int pass = 0; pass < inventory.getSizeInventory(); pass++) { -+ ArrayList items = new ArrayList(); -+ for (int i = 0; i < inventory.getSizeInventory(); i++) { -+ ItemStack item = inventory.getStackInSlot(i); -+ if (item == null) { -+ items.add(null); -+ } else { -+ items.add(new PositionedItemStack(item, i)); -+ } -+ } -+ Collections.sort(items, new MCItemStackComparator(byName)); -+ -+ while (true) { -+ if (items.get(pass) instanceof PositionedItemStack) { -+ PositionedItemStack item = (PositionedItemStack) items.get(pass); -+ //Left click pick up item -+ Slot origSlot = getSlotFromPosition(item.position); -+ Slot newSlot = getSlotFromPosition(pass); -+ if (newSlot != origSlot) { -+ handleMouseClick(origSlot, 0, 0, 0); -+ -+ // Left click place item down -+ handleMouseClick(newSlot, 0, 0, 0); -+ -+ ItemStack cursor = Minecraft.getMinecraft().thePlayer.inventory.getItemStack(); -+ if (cursor != null) { -+ handleMouseClick(origSlot, 0, 0, 0); -+ } -+ } -+ break; -+ } -+ pass++; -+ if (pass >= inventory.getSizeInventory()) { -+ break; -+ } -+ } -+ } -+ } -+ } -+ -+ public Slot getSlotFromPosition(int pos) { -+ return InventoryUtil.getSlotFromPosition(pos, inventorySlots); -+ } -+ // Spout End -+ -+ /** -+ * Draws the screen and all the components in it. -+ */ -+ // ToDo: this method should be stripped and updated. -+ public void drawScreen(int par1, int par2, float par3) { - this.drawDefaultBackground(); - int var4 = this.guiLeft; - int var5 = this.guiTop; -- this.drawGuiContainerBackgroundLayer(var3, var1, var2); -+ this.drawGuiContainerBackgroundLayer(par3, par1, par2); - GL11.glDisable(GL12.GL_RESCALE_NORMAL); - RenderHelper.disableStandardItemLighting(); - GL11.glDisable(GL11.GL_LIGHTING); - GL11.glDisable(GL11.GL_DEPTH_TEST); -- super.drawScreen(var1, var2, var3); -- RenderHelper.enableGUIStandardItemLighting(); -+ super.drawScreen(par1, par2, par3); - GL11.glPushMatrix(); - GL11.glTranslatef((float)var4, (float)var5, 0.0F); -+ this.drawGuiContainerForegroundLayer(par1, par2); -+ RenderHelper.enableGUIStandardItemLighting(); - GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - GL11.glEnable(GL12.GL_RESCALE_NORMAL); - this.theSlot = null; -@@ -72,126 +337,227 @@ - short var7 = 240; - OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, (float)var6 / 1.0F, (float)var7 / 1.0F); - GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); -- - int var9; -- for(int var13 = 0; var13 < this.inventorySlots.c.size(); ++var13) { -- Slot var15 = (Slot)this.inventorySlots.c.get(var13); -- this.drawSlotInventory(var15); -- if(this.isMouseOverSlot(var15, var1, var2) && var15.func_111238_b()) { -- this.theSlot = var15; -+ -+ for (int var13 = 0; var13 < this.inventorySlots.inventorySlots.size(); ++var13) { -+ Slot var14 = (Slot)this.inventorySlots.inventorySlots.get(var13); -+ this.drawSlotInventory(var14); -+ -+ if (this.isMouseOverSlot(var14, par1, par2) && var14.func_111238_b()) { -+ this.theSlot = var14; - GL11.glDisable(GL11.GL_LIGHTING); - GL11.glDisable(GL11.GL_DEPTH_TEST); -- int var8 = var15.xDisplayPosition; -- var9 = var15.yDisplayPosition; -+ int var8 = var14.xDisplayPosition; -+ var9 = var14.yDisplayPosition; - this.drawGradientRect(var8, var9, var8 + 16, var9 + 16, -2130706433, -2130706433); - GL11.glEnable(GL11.GL_LIGHTING); - GL11.glEnable(GL11.GL_DEPTH_TEST); - } - } - -- this.drawGuiContainerForegroundLayer(var1, var2); -- InventoryPlayer var14 = this.mc.thePlayer.inventory; -- ItemStack var16 = this.draggedStack == null ? var14.getItemStack() : this.draggedStack; -- if(var16 != null) { -- byte var17 = 8; -+ InventoryPlayer var15 = this.mc.thePlayer.inventory; -+ ItemStack var16 = this.draggedStack == null ? var15.getItemStack() : this.draggedStack; -+ -+ if (var16 != null) { -+ byte var18 = 8; - var9 = this.draggedStack == null ? 8 : 16; - String var10 = null; -- if(this.draggedStack != null && this.isRightMouseClick) { -+ -+ if (this.draggedStack != null && this.isRightMouseClick) { - var16 = var16.copy(); - var16.stackSize = MathHelper.ceiling_float_int((float)var16.stackSize / 2.0F); -- } else if(this.field_94076_q && this.r.size() > 1) { -+ } else if (this.field_94076_q && this.field_94077_p.size() > 1) { - var16 = var16.copy(); - var16.stackSize = this.field_94069_F; -- if(var16.stackSize == 0) { -+ -+ if (var16.stackSize == 0) { - var10 = "" + EnumChatFormatting.YELLOW + "0"; - } - } - -- this.drawItemStack(var16, var1 - var4 - var17, var2 - var5 - var9, var10); -+ this.drawItemStack(var16, par1 - var4 - var18, par2 - var5 - var9, var10); - } - -- if(this.returningStack != null) { -- float var18 = (float)(Minecraft.getSystemTime() - this.returningStackTime) / 100.0F; -- if(var18 >= 1.0F) { -- var18 = 1.0F; -+ if (this.returningStack != null) { -+ float var17 = (float)(Minecraft.getSystemTime() - this.returningStackTime) / 100.0F; -+ -+ if (var17 >= 1.0F) { -+ var17 = 1.0F; - this.returningStack = null; - } - - var9 = this.returningStackDestSlot.xDisplayPosition - this.field_85049_r; - int var20 = this.returningStackDestSlot.yDisplayPosition - this.field_85048_s; -- int var11 = this.field_85049_r + (int)((float)var9 * var18); -- int var12 = this.field_85048_s + (int)((float)var20 * var18); -+ int var11 = this.field_85049_r + (int)((float)var9 * var17); -+ int var12 = this.field_85048_s + (int)((float)var20 * var17); - this.drawItemStack(this.returningStack, var11, var12, (String)null); - } - -- GL11.glPopMatrix(); -- if(var14.getItemStack() == null && this.theSlot != null && this.theSlot.getHasStack()) { -+ if (var15.getItemStack() == null && this.theSlot != null && this.theSlot.getHasStack()) { - ItemStack var19 = this.theSlot.getStack(); -- this.drawItemStackTooltip(var19, var1, var2); -+ this.drawItemStackTooltip(var19, par1 - var4 + 8, par2 - var5 + 8); - } - -+ GL11.glPopMatrix(); - GL11.glEnable(GL11.GL_LIGHTING); - GL11.glEnable(GL11.GL_DEPTH_TEST); -- RenderHelper.enableStandardItemLighting(); -+ RenderHelper.disableStandardItemLighting(); -+ GL11.glDisable(GL12.GL_RESCALE_NORMAL); - } - -- private void drawItemStack(ItemStack var1, int var2, int var3, String var4) { -+ private void drawItemStack(ItemStack par1ItemStack, int par2, int par3, String par4Str) { - GL11.glTranslatef(0.0F, 0.0F, 32.0F); - this.zLevel = 200.0F; - itemRenderer.zLevel = 200.0F; -- itemRenderer.renderItemAndEffectIntoGUI(this.fontRenderer, this.mc.getTextureManager(), var1, var2, var3); -- itemRenderer.renderItemOverlayIntoGUI(this.fontRenderer, this.mc.getTextureManager(), var1, var2, var3 - (this.draggedStack == null ? 0 : 8), var4); -+ itemRenderer.renderItemAndEffectIntoGUI(this.fontRenderer, this.mc.getTextureManager(), par1ItemStack, par2, par3); -+ itemRenderer.renderItemOverlayIntoGUI(this.fontRenderer, this.mc.getTextureManager(), par1ItemStack, par2, par3 - (this.draggedStack == null ? 0 : 8), par4Str); - this.zLevel = 0.0F; - itemRenderer.zLevel = 0.0F; - } - -- protected void drawItemStackTooltip(ItemStack var1, int var2, int var3) { -- List var4 = var1.getTooltip(this.mc.thePlayer, this.mc.gameSettings.advancedItemTooltips); -- -- for(int var5 = 0; var5 < var4.size(); ++var5) { -- if(var5 == 0) { -- var4.set(var5, "\u00a7" + Integer.toHexString(var1.getRarity().rarityColor) + (String)var4.get(var5)); -- } else { -- var4.set(var5, EnumChatFormatting.GRAY + (String)var4.get(var5)); -- } -+ protected void drawItemStackTooltip(ItemStack par1ItemStack, int par2, int par3) { -+ GL11.glDisable(GL12.GL_RESCALE_NORMAL); -+ RenderHelper.disableStandardItemLighting(); -+ GL11.glDisable(GL11.GL_LIGHTING); -+ GL11.glDisable(GL11.GL_DEPTH_TEST); -+ // Spout Start -+ List var4 = Arrays.asList(Spoutcraft.getMaterialManager().getToolTip(new CraftItemStack(par1ItemStack)).split("\n")); -+ // Spout End -+ -+ if (!var4.isEmpty()) { -+ int var5 = 0; -+ int var7; -+ int var6; -+ -+ for (var6 = 0; var6 < var4.size(); ++var6) { -+ var7 = this.fontRenderer.getStringWidth((String)var4.get(var6)); -+ -+ if (var7 > var5) { -+ var5 = var7; -+ } -+ } -+ -+ var6 = par2 + 12; -+ var7 = par3 - 12; -+ int var9 = 8; -+ -+ if (var4.size() > 1) { -+ var9 += 2 + (var4.size() - 1) * 10; -+ } -+ -+ if (this.guiTop + var7 + var9 + 6 > this.height) { -+ var7 = this.height - var9 - this.guiTop - 6; -+ } -+ -+ this.zLevel = 300.0F; -+ itemRenderer.zLevel = 300.0F; -+ int var10 = -267386864; -+ this.drawGradientRect(var6 - 3, var7 - 4, var6 + var5 + 3, var7 - 3, var10, var10); -+ this.drawGradientRect(var6 - 3, var7 + var9 + 3, var6 + var5 + 3, var7 + var9 + 4, var10, var10); -+ this.drawGradientRect(var6 - 3, var7 - 3, var6 + var5 + 3, var7 + var9 + 3, var10, var10); -+ this.drawGradientRect(var6 - 4, var7 - 3, var6 - 3, var7 + var9 + 3, var10, var10); -+ this.drawGradientRect(var6 + var5 + 3, var7 - 3, var6 + var5 + 4, var7 + var9 + 3, var10, var10); -+ int var11 = 1347420415; -+ int var12 = (var11 & 16711422) >> 1 | var11 & -16777216; -+ this.drawGradientRect(var6 - 3, var7 - 3 + 1, var6 - 3 + 1, var7 + var9 + 3 - 1, var11, var12); -+ this.drawGradientRect(var6 + var5 + 2, var7 - 3 + 1, var6 + var5 + 3, var7 + var9 + 3 - 1, var11, var12); -+ this.drawGradientRect(var6 - 3, var7 - 3, var6 + var5 + 3, var7 - 3 + 1, var11, var11); -+ this.drawGradientRect(var6 - 3, var7 + var9 + 2, var6 + var5 + 3, var7 + var9 + 3, var12, var12); -+ -+ for (int var13 = 0; var13 < var4.size(); ++var13) { -+ String var14 = (String)var4.get(var13); -+ -+ if (var13 == 0) { -+ var14 = "\u00a7" + Integer.toHexString(par1ItemStack.getRarity().rarityColor) + var14; -+ } else { -+ var14 = EnumChatFormatting.GRAY + var14; -+ } -+ -+ this.fontRenderer.drawStringWithShadow(var14, var6, var7, -1); -+ -+ if (var13 == 0) { -+ var7 += 2; -+ } -+ -+ var7 += 10; -+ } -+ -+ this.zLevel = 0.0F; -+ itemRenderer.zLevel = 0.0F; - } -- -- this.func_102021_a(var4, var2, var3); -- } -- -- protected void drawCreativeTabHoveringText(String var1, int var2, int var3) { -- this.func_102021_a(Arrays.asList(new String[]{var1}), var2, var3); -- } -- -- protected void func_102021_a(List var1, int var2, int var3) { -- if(!var1.isEmpty()) { -+ //ToDo: might need this -+ //this.func_102021_a(var4, par2, par3); -+ } -+ -+ /** -+ * Draws the text when mouse is over creative inventory tab. Params: current creative tab to be checked, current mouse -+ * x position, current mouse y position. -+ */ -+ protected void drawCreativeTabHoveringText(String par1Str, int par2, int par3) { -+ //Todo: may need this instead: -+ //this.func_102021_a(Arrays.asList(new String[] {par1Str}), par2, par3); -+ GL11.glDisable(GL12.GL_RESCALE_NORMAL); -+ RenderHelper.disableStandardItemLighting(); -+ GL11.glDisable(GL11.GL_LIGHTING); -+ GL11.glDisable(GL11.GL_DEPTH_TEST); -+ int var4 = this.fontRenderer.getStringWidth(par1Str); -+ int var5 = par2 + 12; -+ int var6 = par3 - 12; -+ byte var8 = 8; -+ this.zLevel = 300.0F; -+ itemRenderer.zLevel = 300.0F; -+ int var9 = -267386864; -+ this.drawGradientRect(var5 - 3, var6 - 4, var5 + var4 + 3, var6 - 3, var9, var9); -+ this.drawGradientRect(var5 - 3, var6 + var8 + 3, var5 + var4 + 3, var6 + var8 + 4, var9, var9); -+ this.drawGradientRect(var5 - 3, var6 - 3, var5 + var4 + 3, var6 + var8 + 3, var9, var9); -+ this.drawGradientRect(var5 - 4, var6 - 3, var5 - 3, var6 + var8 + 3, var9, var9); -+ this.drawGradientRect(var5 + var4 + 3, var6 - 3, var5 + var4 + 4, var6 + var8 + 3, var9, var9); -+ int var10 = 1347420415; -+ int var11 = (var10 & 16711422) >> 1 | var10 & -16777216; -+ this.drawGradientRect(var5 - 3, var6 - 3 + 1, var5 - 3 + 1, var6 + var8 + 3 - 1, var10, var11); -+ this.drawGradientRect(var5 + var4 + 2, var6 - 3 + 1, var5 + var4 + 3, var6 + var8 + 3 - 1, var10, var11); -+ this.drawGradientRect(var5 - 3, var6 - 3, var5 + var4 + 3, var6 - 3 + 1, var10, var10); -+ this.drawGradientRect(var5 - 3, var6 + var8 + 2, var5 + var4 + 3, var6 + var8 + 3, var11, var11); -+ this.fontRenderer.drawStringWithShadow(par1Str, var5, var6, -1); -+ this.zLevel = 0.0F; -+ itemRenderer.zLevel = 0.0F; -+ GL11.glEnable(GL11.GL_LIGHTING); -+ GL11.glEnable(GL11.GL_DEPTH_TEST); -+ RenderHelper.enableStandardItemLighting(); -+ GL11.glEnable(GL12.GL_RESCALE_NORMAL); -+ } -+ -+ protected void func_102021_a(List par1List, int par2, int par3) { -+ if (!par1List.isEmpty()) { - GL11.glDisable(GL12.GL_RESCALE_NORMAL); - RenderHelper.disableStandardItemLighting(); - GL11.glDisable(GL11.GL_LIGHTING); - GL11.glDisable(GL11.GL_DEPTH_TEST); - int var4 = 0; -- Iterator var5 = var1.iterator(); -+ Iterator var5 = par1List.iterator(); - -- while(var5.hasNext()) { -+ while (var5.hasNext()) { - String var6 = (String)var5.next(); - int var7 = this.fontRenderer.getStringWidth(var6); -- if(var7 > var4) { -+ -+ if (var7 > var4) { - var4 = var7; - } - } - -- int var14 = var2 + 12; -- int var15 = var3 - 12; -+ int var14 = par2 + 12; -+ int var15 = par3 - 12; - int var8 = 8; -- if(var1.size() > 1) { -- var8 += 2 + (var1.size() - 1) * 10; -+ -+ if (par1List.size() > 1) { -+ var8 += 2 + (par1List.size() - 1) * 10; - } - -- if(var14 + var4 > this.width) { -+ if (var14 + var4 > this.width) { - var14 -= 28 + var4; - } - -- if(var15 + var8 + 6 > this.height) { -+ if (var15 + var8 + 6 > this.height) { - var15 = this.height - var8 - 6; - } - -@@ -210,10 +576,11 @@ - this.drawGradientRect(var14 - 3, var15 - 3, var14 + var4 + 3, var15 - 3 + 1, var10, var10); - this.drawGradientRect(var14 - 3, var15 + var8 + 2, var14 + var4 + 3, var15 + var8 + 3, var11, var11); - -- for(int var12 = 0; var12 < var1.size(); ++var12) { -- String var13 = (String)var1.get(var12); -+ for (int var12 = 0; var12 < par1List.size(); ++var12) { -+ String var13 = (String)par1List.get(var12); - this.fontRenderer.drawStringWithShadow(var13, var14, var15, -1); -- if(var12 == 0) { -+ -+ if (var12 == 0) { - var15 += 2; - } - -@@ -228,52 +595,63 @@ - GL11.glEnable(GL12.GL_RESCALE_NORMAL); - } - } -- -- protected void drawGuiContainerForegroundLayer(int var1, int var2) { -- } -- -+ /** -+ * Draw the foreground layer for the GuiContainer (everything in front of the items) -+ */ -+ protected void drawGuiContainerForegroundLayer(int par1, int par2) {} -+ -+ /** -+ * Draw the background layer for the GuiContainer (everything behind the items) -+ */ - protected abstract void drawGuiContainerBackgroundLayer(float var1, int var2, int var3); - -- private void drawSlotInventory(Slot var1) { -- int var2 = var1.xDisplayPosition; -- int var3 = var1.yDisplayPosition; -- ItemStack var4 = var1.getStack(); -+ /** -+ * Draws an inventory slot -+ */ -+ private void drawSlotInventory(Slot par1Slot) { -+ int var2 = par1Slot.xDisplayPosition; -+ int var3 = par1Slot.yDisplayPosition; -+ ItemStack var4 = par1Slot.getStack(); - boolean var5 = false; -- boolean var6 = var1 == this.clickedSlot && this.draggedStack != null && !this.isRightMouseClick; -+ boolean var6 = par1Slot == this.clickedSlot && this.draggedStack != null && !this.isRightMouseClick; - ItemStack var7 = this.mc.thePlayer.inventory.getItemStack(); - String var8 = null; -- if(var1 == this.clickedSlot && this.draggedStack != null && this.isRightMouseClick && var4 != null) { -+ -+ if (par1Slot == this.clickedSlot && this.draggedStack != null && this.isRightMouseClick && var4 != null) { - var4 = var4.copy(); - var4.stackSize /= 2; -- } else if(this.field_94076_q && this.r.contains(var1) && var7 != null) { -- if(this.r.size() == 1) { -+ } else if (this.field_94076_q && this.field_94077_p.contains(par1Slot) && var7 != null) { -+ if (this.field_94077_p.size() == 1) { - return; - } - -- if(Container.func_94527_a(var1, var7, true) && this.inventorySlots.canDragIntoSlot(var1)) { -+ if (Container.func_94527_a(par1Slot, var7, true) && this.inventorySlots.canDragIntoSlot(par1Slot)) { - var4 = var7.copy(); - var5 = true; -- Container.func_94525_a(this.r, this.field_94071_C, var4, var1.getStack() == null ? 0 : var1.getStack().stackSize); -- if(var4.stackSize > var4.getMaxStackSize()) { -+ Container.func_94525_a(this.field_94077_p, this.field_94071_C, var4, par1Slot.getStack() == null ? 0 : par1Slot.getStack().stackSize); -+ -+ if (var4.stackSize > var4.getMaxStackSize()) { - var8 = EnumChatFormatting.YELLOW + "" + var4.getMaxStackSize(); - var4.stackSize = var4.getMaxStackSize(); - } - -- if(var4.stackSize > var1.getSlotStackLimit()) { -- var8 = EnumChatFormatting.YELLOW + "" + var1.getSlotStackLimit(); -- var4.stackSize = var1.getSlotStackLimit(); -+ if (var4.stackSize > par1Slot.getSlotStackLimit()) { -+ var8 = EnumChatFormatting.YELLOW + "" + par1Slot.getSlotStackLimit(); -+ var4.stackSize = par1Slot.getSlotStackLimit(); - } - } else { -- this.r.remove(var1); -+ this.field_94077_p.remove(par1Slot); - this.func_94066_g(); - } - } - - this.zLevel = 100.0F; - itemRenderer.zLevel = 100.0F; -- if(var4 == null) { -- Icon var9 = var1.getBackgroundIconIndex(); -- if(var9 != null) { -+ -+ if (var4 == null) { -+ Icon var9 = par1Slot.getBackgroundIconIndex(); -+ -+ if (var9 != null) { - GL11.glDisable(GL11.GL_LIGHTING); - this.mc.getTextureManager().bindTexture(TextureMap.locationItemsTexture); - this.drawTexturedModelRectFromIcon(var2, var3, var9, 16, 16); -@@ -282,8 +660,8 @@ - } - } - -- if(!var6) { -- if(var5) { -+ if (!var6) { -+ if (var5) { - drawRect(var2, var3, var2 + 16, var3 + 16, -2130706433); - } - -@@ -298,32 +676,36 @@ - - private void func_94066_g() { - ItemStack var1 = this.mc.thePlayer.inventory.getItemStack(); -- if(var1 != null && this.field_94076_q) { -+ if (var1 != null && this.field_94076_q) { - this.field_94069_F = var1.stackSize; -- - ItemStack var4; - int var5; -- for(Iterator var2 = this.r.iterator(); var2.hasNext(); this.field_94069_F -= var4.stackSize - var5) { -+ -+ for (Iterator var2 = this.field_94077_p.iterator(); var2.hasNext(); this.field_94069_F -= var4.stackSize - var5) { - Slot var3 = (Slot)var2.next(); - var4 = var1.copy(); - var5 = var3.getStack() == null ? 0 : var3.getStack().stackSize; -- Container.func_94525_a(this.r, this.field_94071_C, var4, var5); -- if(var4.stackSize > var4.getMaxStackSize()) { -+ Container.func_94525_a(this.field_94077_p, this.field_94071_C, var4, var5); -+ -+ if (var4.stackSize > var4.getMaxStackSize()) { - var4.stackSize = var4.getMaxStackSize(); - } - -- if(var4.stackSize > var3.getSlotStackLimit()) { -+ if (var4.stackSize > var3.getSlotStackLimit()) { - var4.stackSize = var3.getSlotStackLimit(); - } - } -- - } - } - -- private Slot getSlotAtPosition(int var1, int var2) { -- for(int var3 = 0; var3 < this.inventorySlots.c.size(); ++var3) { -- Slot var4 = (Slot)this.inventorySlots.c.get(var3); -- if(this.isMouseOverSlot(var4, var1, var2)) { -+ /** -+ * Returns the slot at the given coordinates or null if there is none. -+ */ -+ private Slot getSlotAtPosition(int par1, int par2) { -+ for (int var3 = 0; var3 < this.inventorySlots.inventorySlots.size(); ++var3) { -+ Slot var4 = (Slot)this.inventorySlots.inventorySlots.get(var3); -+ -+ if (this.isMouseOverSlot(var4, par1, par2)) { - return var4; - } - } -@@ -331,90 +713,85 @@ - return null; - } - -- protected void mouseClicked(int var1, int var2, int var3) { -- super.mouseClicked(var1, var2, var3); -- boolean var4 = var3 == this.mc.gameSettings.keyBindPickBlock.keyCode + 100; -- Slot var5 = this.getSlotAtPosition(var1, var2); -- long var6 = Minecraft.getSystemTime(); -- this.field_94074_J = this.field_94072_H == var5 && var6 - this.field_94070_G < 250L && this.field_94073_I == var3; -- this.field_94068_E = false; -- if(var3 == 0 || var3 == 1 || var4) { -- int var8 = this.guiLeft; -- int var9 = this.guiTop; -- boolean var10 = var1 < var8 || var2 < var9 || var1 >= var8 + this.xSize || var2 >= var9 + this.ySize; -- int var11 = -1; -- if(var5 != null) { -- var11 = var5.slotNumber; -- } -- -- if(var10) { -- var11 = -999; -- } -- -- if(this.mc.gameSettings.touchscreen && var10 && this.mc.thePlayer.inventory.getItemStack() == null) { -+ /** -+ * Called when the mouse is clicked. -+ */ -+ protected void mouseClicked(int par1, int par2, int par3) { -+ super.mouseClicked(par1, par2, par3); -+ boolean var4 = par3 == this.mc.gameSettings.keyBindPickBlock.keyCode + 100; -+ -+ if (par3 == 0 || par3 == 1 || var4) { -+ Slot var5 = this.getSlotAtPosition(par1, par2); -+ int var6 = this.guiLeft; -+ int var7 = this.guiTop; -+ boolean var8 = par1 < var6 || par2 < var7 || par1 >= var6 + this.xSize || par2 >= var7 + this.ySize; -+ int var9 = -1; -+ -+ if (var5 != null) { -+ var9 = var5.slotNumber; -+ } -+ -+ if (var8) { -+ // Spout Start -+ boolean isSpoutSlot = false; -+ for (Widget w : getScreen().getAttachedWidgets(true)) { -+ if (isInBoundingRect(w, par1, par2)) { -+ if (w instanceof org.spoutcraft.api.gui.Slot) { -+ isSpoutSlot = true; -+ break; -+ } -+ } -+ } -+ if (!isSpoutSlot) { -+ var9 = -999; -+ } -+ // Spout End -+ } -+ -+ if (this.mc.gameSettings.touchscreen && var8 && this.mc.thePlayer.inventory.getItemStack() == null) { - this.mc.displayGuiScreen((GuiScreen)null); - return; - } - -- if(var11 != -1) { -- if(this.mc.gameSettings.touchscreen) { -- if(var5 != null && var5.getHasStack()) { -+ if (var9 != -1) { -+ if (this.mc.gameSettings.touchscreen) { -+ if (var5 != null && var5.getHasStack()) { - this.clickedSlot = var5; - this.draggedStack = null; -- this.isRightMouseClick = var3 == 1; -+ this.isRightMouseClick = par3 == 1; - } else { - this.clickedSlot = null; - } -- } else if(!this.field_94076_q) { -- if(this.mc.thePlayer.inventory.getItemStack() == null) { -- if(var3 == this.mc.gameSettings.keyBindPickBlock.keyCode + 100) { -- this.handleMouseClick(var5, var11, var3, 3); -- } else { -- boolean var12 = var11 != -999 && (Keyboard.isKeyDown(Keyboard.KEY_LSHIFT) || Keyboard.isKeyDown(Keyboard.KEY_RSHIFT)); -- byte var13 = 0; -- if(var12) { -- this.field_94075_K = var5 != null && var5.getHasStack() ? var5.getStack() : null; -- var13 = 1; -- } else if(var11 == -999) { -- var13 = 4; -- } -- -- this.handleMouseClick(var5, var11, var3, var13); -- } -- -- this.field_94068_E = true; -- } else { -- this.field_94076_q = true; -- this.field_94067_D = var3; -- this.r.clear(); -- if(var3 == 0) { -- this.field_94071_C = 0; -- } else if(var3 == 1) { -- this.field_94071_C = 1; -- } -- } -+ } else if (var4) { -+ this.handleMouseClick(var5, var9, par3, 3); -+ } else { -+ boolean var10 = var9 != -999 && (Keyboard.isKeyDown(42) || Keyboard.isKeyDown(54)); -+ this.handleMouseClick(var5, var9, par3, var10 ? 1 : 0); - } - } - } -- -- this.field_94072_H = var5; -- this.field_94070_G = var6; -- this.field_94073_I = var3; - } - -- protected void mouseClickMove(int var1, int var2, int var3, long var4) { -- Slot var6 = this.getSlotAtPosition(var1, var2); -+ /** -+ * Called when a mouse button is pressed and the mouse is moved around. Parameters are : mouseX, mouseY, -+ * lastButtonClicked & timeSinceMouseClick. -+ */ -+ // ToDo: this may break a lot of stuff.... -+ protected void mouseClickMove(int par1, int par2, int par3, long par4) { -+ Slot var6 = this.getSlotAtPosition(par1, par2); - ItemStack var7 = this.mc.thePlayer.inventory.getItemStack(); -- if(this.clickedSlot != null && this.mc.gameSettings.touchscreen) { -- if(var3 == 0 || var3 == 1) { -- if(this.draggedStack == null) { -- if(var6 != this.clickedSlot) { -+ -+ if (this.clickedSlot != null && this.mc.gameSettings.touchscreen) { -+ if (par3 == 0 || par3 == 1) { -+ if (this.draggedStack == null) { -+ if (var6 != this.clickedSlot) { - this.draggedStack = this.clickedSlot.getStack().copy(); - } -- } else if(this.draggedStack.stackSize > 1 && var6 != null && Container.func_94527_a(var6, this.draggedStack, false)) { -+ } else if (this.draggedStack.stackSize > 1 && var6 != null && Container.func_94527_a(var6, this.draggedStack, false)) { - long var8 = Minecraft.getSystemTime(); -- if(this.field_92033_y == var6) { -- if(var8 - this.field_92032_z > 500L) { -+ -+ if (this.field_92033_y == var6) { -+ if (var8 - this.field_92032_z > 500L) { - this.handleMouseClick(this.clickedSlot, this.clickedSlot.slotNumber, 0, 0); - this.handleMouseClick(var6, var6.slotNumber, 1, 0); - this.handleMouseClick(this.clickedSlot, this.clickedSlot.slotNumber, 0, 0); -@@ -427,84 +804,93 @@ - } - } - } -- } else if(this.field_94076_q && var6 != null && var7 != null && var7.stackSize > this.r.size() && Container.func_94527_a(var6, var7, true) && var6.isItemValid(var7) && this.inventorySlots.canDragIntoSlot(var6)) { -- this.r.add(var6); -+ } else if (this.field_94076_q && var6 != null && var7 != null && var7.stackSize > this.field_94077_p.size() && Container.func_94527_a(var6, var7, true) && var6.isItemValid(var7) && this.inventorySlots.canDragIntoSlot(var6)) { -+ this.field_94077_p.add(var6); - this.func_94066_g(); - } -- - } - -- protected void mouseMovedOrUp(int var1, int var2, int var3) { -- Slot var4 = this.getSlotAtPosition(var1, var2); -+ /** -+ * Called when the mouse is moved or a mouse button is released. Signature: (mouseX, mouseY, which) which==-1 is -+ * mouseMove, which==0 or which==1 is mouseUp -+ */ -+ protected void mouseMovedOrUp(int par1, int par2, int par3) { -+ Slot var4 = this.getSlotAtPosition(par1, par2); - int var5 = this.guiLeft; - int var6 = this.guiTop; -- boolean var7 = var1 < var5 || var2 < var6 || var1 >= var5 + this.xSize || var2 >= var6 + this.ySize; -+ boolean var7 = par1 < var5 || par2 < var6 || par1 >= var5 + this.xSize || par2 >= var6 + this.ySize; - int var8 = -1; -- if(var4 != null) { -+ -+ if (var4 != null) { - var8 = var4.slotNumber; - } - -- if(var7) { -+ if (var7) { - var8 = -999; - } - - Slot var10; - Iterator var11; -- if(this.field_94074_J && var4 != null && var3 == 0 && this.inventorySlots.func_94530_a((ItemStack)null, var4)) { -- if(isShiftKeyDown()) { -- if(var4 != null && var4.inventory != null && this.field_94075_K != null) { -- var11 = this.inventorySlots.c.iterator(); -- -- while(var11.hasNext()) { -+ -+ if (this.field_94074_J && var4 != null && par3 == 0 && this.inventorySlots.func_94530_a((ItemStack)null, var4)) { -+ if (isShiftKeyDown()) { -+ if (var4 != null && var4.inventory != null && this.field_94075_K != null) { -+ var11 = this.inventorySlots.inventorySlots.iterator(); -+ -+ while (var11.hasNext()) { - var10 = (Slot)var11.next(); -- if(var10 != null && var10.canTakeStack(this.mc.thePlayer) && var10.getHasStack() && var10.inventory == var4.inventory && Container.func_94527_a(var10, this.field_94075_K, true)) { -- this.handleMouseClick(var10, var10.slotNumber, var3, 1); -+ -+ if (var10 != null && var10.canTakeStack(this.mc.thePlayer) && var10.getHasStack() && var10.inventory == var4.inventory && Container.func_94527_a(var10, this.field_94075_K, true)) { -+ this.handleMouseClick(var10, var10.slotNumber, par3, 1); - } - } - } - } else { -- this.handleMouseClick(var4, var8, var3, 6); -+ this.handleMouseClick(var4, var8, par3, 6); - } - - this.field_94074_J = false; - this.field_94070_G = 0L; - } else { -- if(this.field_94076_q && this.field_94067_D != var3) { -+ if (this.field_94076_q && this.field_94067_D != par3) { - this.field_94076_q = false; -- this.r.clear(); -+ this.field_94077_p.clear(); - this.field_94068_E = true; - return; - } - -- if(this.field_94068_E) { -+ if (this.field_94068_E) { - this.field_94068_E = false; - return; - } - - boolean var9; -- if(this.clickedSlot != null && this.mc.gameSettings.touchscreen) { -- if(var3 == 0 || var3 == 1) { -- if(this.draggedStack == null && var4 != this.clickedSlot) { -+ -+ if (this.clickedSlot != null && this.mc.gameSettings.touchscreen) { -+ if (par3 == 0 || par3 == 1) { -+ if (this.draggedStack == null && var4 != this.clickedSlot) { - this.draggedStack = this.clickedSlot.getStack(); - } - - var9 = Container.func_94527_a(var4, this.draggedStack, false); -- if(var8 != -1 && this.draggedStack != null && var9) { -- this.handleMouseClick(this.clickedSlot, this.clickedSlot.slotNumber, var3, 0); -+ -+ if (var8 != -1 && this.draggedStack != null && var9) { -+ this.handleMouseClick(this.clickedSlot, this.clickedSlot.slotNumber, par3, 0); - this.handleMouseClick(var4, var8, 0, 0); -- if(this.mc.thePlayer.inventory.getItemStack() != null) { -- this.handleMouseClick(this.clickedSlot, this.clickedSlot.slotNumber, var3, 0); -- this.field_85049_r = var1 - var5; -- this.field_85048_s = var2 - var6; -+ -+ if (this.mc.thePlayer.inventory.getItemStack() != null) { -+ this.handleMouseClick(this.clickedSlot, this.clickedSlot.slotNumber, par3, 0); -+ this.field_85049_r = par1 - var5; -+ this.field_85048_s = par2 - var6; - this.returningStackDestSlot = this.clickedSlot; - this.returningStack = this.draggedStack; - this.returningStackTime = Minecraft.getSystemTime(); - } else { - this.returningStack = null; - } -- } else if(this.draggedStack != null) { -- this.field_85049_r = var1 - var5; -- this.field_85048_s = var2 - var6; -+ } else if (this.draggedStack != null) { -+ this.field_85049_r = par1 - var5; -+ this.field_85048_s = par2 - var6; - this.returningStackDestSlot = this.clickedSlot; - this.returningStack = this.draggedStack; - this.returningStackTime = Minecraft.getSystemTime(); -@@ -513,77 +899,86 @@ - this.draggedStack = null; - this.clickedSlot = null; - } -- } else if(this.field_94076_q && !this.r.isEmpty()) { -+ } else if (this.field_94076_q && !this.field_94077_p.isEmpty()) { - this.handleMouseClick((Slot)null, -999, Container.func_94534_d(0, this.field_94071_C), 5); -- var11 = this.r.iterator(); -+ var11 = this.field_94077_p.iterator(); - -- while(var11.hasNext()) { -+ while (var11.hasNext()) { - var10 = (Slot)var11.next(); - this.handleMouseClick(var10, var10.slotNumber, Container.func_94534_d(1, this.field_94071_C), 5); - } - - this.handleMouseClick((Slot)null, -999, Container.func_94534_d(2, this.field_94071_C), 5); -- } else if(this.mc.thePlayer.inventory.getItemStack() != null) { -- if(var3 == this.mc.gameSettings.keyBindPickBlock.keyCode + 100) { -- this.handleMouseClick(var4, var8, var3, 3); -+ } else if (this.mc.thePlayer.inventory.getItemStack() != null) { -+ if (par3 == this.mc.gameSettings.keyBindPickBlock.keyCode + 100) { -+ this.handleMouseClick(var4, var8, par3, 3); - } else { -- var9 = var8 != -999 && (Keyboard.isKeyDown(Keyboard.KEY_LSHIFT) || Keyboard.isKeyDown(Keyboard.KEY_RSHIFT)); -- if(var9) { -+ var9 = var8 != -999 && (Keyboard.isKeyDown(42) || Keyboard.isKeyDown(54)); -+ -+ if (var9) { - this.field_94075_K = var4 != null && var4.getHasStack() ? var4.getStack() : null; - } -- -- this.handleMouseClick(var4, var8, var3, var9 ? 1 : 0); -+ // ToDo: Fixes dragging itemStack bug, but may be important later. -+ //this.handleMouseClick(var4, var8, par3, var9 ? 1 : 0); - } - } - } - -- if(this.mc.thePlayer.inventory.getItemStack() == null) { -+ if (this.mc.thePlayer.inventory.getItemStack() == null) { - this.field_94070_G = 0L; - } - - this.field_94076_q = false; - } - -- private boolean isMouseOverSlot(Slot var1, int var2, int var3) { -- return this.isPointInRegion(var1.xDisplayPosition, var1.yDisplayPosition, 16, 16, var2, var3); -+ /** -+ * Returns if the passed mouse position is over the specified slot. -+ */ -+ private boolean isMouseOverSlot(Slot par1Slot, int par2, int par3) { -+ return this.isPointInRegion(par1Slot.xDisplayPosition, par1Slot.yDisplayPosition, 16, 16, par2, par3); - } - -- protected boolean isPointInRegion(int var1, int var2, int var3, int var4, int var5, int var6) { -+ /** -+ * Args: left, top, width, height, pointX, pointY. Note: left, top are local to Gui, pointX, pointY are local to screen -+ */ -+ protected boolean isPointInRegion(int par1, int par2, int par3, int par4, int par5, int par6) { - int var7 = this.guiLeft; - int var8 = this.guiTop; -- var5 -= var7; -- var6 -= var8; -- return var5 >= var1 - 1 && var5 < var1 + var3 + 1 && var6 >= var2 - 1 && var6 < var2 + var4 + 1; -+ par5 -= var7; -+ par6 -= var8; -+ return par5 >= par1 - 1 && par5 < par1 + par3 + 1 && par6 >= par2 - 1 && par6 < par2 + par4 + 1; - } - -- protected void handleMouseClick(Slot var1, int var2, int var3, int var4) { -- if(var1 != null) { -- var2 = var1.slotNumber; -+ protected void handleMouseClick(Slot par1Slot, int par2, int par3, int par4) { -+ if (par1Slot != null) { -+ par2 = par1Slot.slotNumber; - } - -- this.mc.playerController.windowClick(this.inventorySlots.windowId, var2, var3, var4, this.mc.thePlayer); -+ this.mc.playerController.windowClick(this.inventorySlots.windowId, par2, par3, par4, this.mc.thePlayer); - } - -- protected void keyTyped(char var1, int var2) { -- if(var2 == 1 || var2 == this.mc.gameSettings.keyBindInventory.keyCode) { -+ /** -+ * Fired when a key is typed. This is the equivalent of KeyListener.keyTyped(KeyEvent e). -+ */ -+ protected void keyTyped(char par1, int par2) { -+ if (par2 == 1 || par2 == this.mc.gameSettings.keyBindInventory.keyCode) { - this.mc.thePlayer.closeScreen(); - } - -- this.checkHotbarKeys(var2); -- if(this.theSlot != null && this.theSlot.getHasStack()) { -- if(var2 == this.mc.gameSettings.keyBindPickBlock.keyCode) { -- this.handleMouseClick(this.theSlot, this.theSlot.slotNumber, 0, 3); -- } else if(var2 == this.mc.gameSettings.keyBindDrop.keyCode) { -- this.handleMouseClick(this.theSlot, this.theSlot.slotNumber, isCtrlKeyDown() ? 1 : 0, 4); -- } -+ this.checkHotbarKeys(par2); -+ -+ if (par2 == this.mc.gameSettings.keyBindPickBlock.keyCode && this.theSlot != null && this.theSlot.getHasStack()) { -+ this.handleMouseClick(this.theSlot, this.theSlot.slotNumber, this.ySize, 3); - } -- - } - -- protected boolean checkHotbarKeys(int var1) { -- if(this.mc.thePlayer.inventory.getItemStack() == null && this.theSlot != null) { -- for(int var2 = 0; var2 < 9; ++var2) { -- if(var1 == 2 + var2) { -+ /** -+ * This function is what controls the hotbar shortcut check when you press a number key when hovering a stack. -+ */ -+ protected boolean checkHotbarKeys(int par1) { -+ if (this.mc.thePlayer.inventory.getItemStack() == null && this.theSlot != null) { -+ for (int var2 = 0; var2 < 9; ++var2) { -+ if (par1 == 2 + var2) { - this.handleMouseClick(this.theSlot, this.theSlot.slotNumber, var2, 2); - return true; - } -@@ -593,21 +988,41 @@ - return false; - } - -+ /** -+ * Called when the screen is unloaded. Used to disable keyboard repeat events -+ */ - public void onGuiClosed() { -- if(this.mc.thePlayer != null) { -+ if (this.mc.thePlayer != null) { - this.inventorySlots.onContainerClosed(this.mc.thePlayer); - } - } - -+ /** -+ * Returns true if this GUI should pause the game when it is displayed in single-player -+ */ - public boolean doesGuiPauseGame() { - return false; - } - -+ /** -+ * Called from the main game loop to update the screen. -+ */ - public void updateScreen() { - super.updateScreen(); -- if(!this.mc.thePlayer.isEntityAlive() || this.mc.thePlayer.isDead) { -+ -+ if (!this.mc.thePlayer.isEntityAlive() || this.mc.thePlayer.isDead) { - this.mc.thePlayer.closeScreen(); - } -- -- } --} -+ } -+} -+ -+// Spout Start -+class PositionedItemStack extends ItemStack { -+ final int position; -+ public PositionedItemStack(ItemStack item, int position) { -+ super(item.itemID, item.stackSize, item.getItemDamage()); -+ this.position = position; -+ } -+ -+} -+// Spout End ---- net/minecraft/src/RenderWolf.java -+++ net/minecraft/src/RenderWolf.java -@@ -2,52 +2,70 @@ - - import org.lwjgl.opengl.GL11; - -+import com.prupe.mcpatcher.cc.ColorizeEntity; -+import com.prupe.mcpatcher.mob.MobRandomizer; -+ - public class RenderWolf extends RenderLiving { - private static final ResourceLocation wolfTextures = new ResourceLocation("textures/entity/wolf/wolf.png"); - private static final ResourceLocation tamedWolfTextures = new ResourceLocation("textures/entity/wolf/wolf_tame.png"); - private static final ResourceLocation anrgyWolfTextures = new ResourceLocation("textures/entity/wolf/wolf_angry.png"); - private static final ResourceLocation wolfCollarTextures = new ResourceLocation("textures/entity/wolf/wolf_collar.png"); - -- public RenderWolf(ModelBase var1, ModelBase var2, float var3) { -- super(var1, var3); -- this.setRenderPassModel(var2); -- } -- -- protected float getTailRotation(EntityWolf var1, float var2) { -- return var1.getTailRotation(); -- } -- -- protected int func_82447_a(EntityWolf var1, int var2, float var3) { -+ public RenderWolf(ModelBase par1ModelBase, ModelBase par2ModelBase, float par3) { -+ super(par1ModelBase, par3); -+ this.setRenderPassModel(par2ModelBase); -+ } -+ -+ protected float getTailRotation(EntityWolf par1EntityWolf, float par2) { -+ return par1EntityWolf.getTailRotation(); -+ } -+ -+ protected int func_82447_a(EntityWolf par1EntityWolf, int par2, float par3) { - float var4; -- if(var2 == 0 && var1.getWolfShaking()) { -- var4 = var1.getBrightness(var3) * var1.getShadingWhileShaking(var3); -+ -+ if (par2 == 0 && par1EntityWolf.getWolfShaking()) { -+ var4 = par1EntityWolf.getBrightness(par3) * par1EntityWolf.getShadingWhileShaking(par3); - this.bindTexture(wolfTextures); - GL11.glColor3f(var4, var4, var4); - return 1; -- } else if(var2 == 1 && var1.isTamed()) { -- this.bindTexture(wolfCollarTextures); -+ } else if (par2 == 1 && par1EntityWolf.isTamed()) { -+ // MCPatcher Start -+ //ToDo: need spoutcraft update -+ this.bindTexture(MobRandomizer.randomTexture((EntityLivingBase)par1EntityWolf, wolfCollarTextures)); -+ // MCPatcher End - var4 = 1.0F; -- int var5 = var1.getCollarColor(); -- GL11.glColor3f(var4 * EntitySheep.fleeceColorTable[var5][0], var4 * EntitySheep.fleeceColorTable[var5][1], var4 * EntitySheep.fleeceColorTable[var5][2]); -+ int var5 = par1EntityWolf.getCollarColor(); -+ // MCPatcher Start -+ GL11.glColor3f(var4 * ColorizeEntity.collarColors[var5][0], var4 * ColorizeEntity.collarColors[var5][1], var4 * ColorizeEntity.collarColors[var5][2]); -+ // MCPatcher End - return 1; - } else { - return -1; - } - } - -- protected ResourceLocation func_110914_a(EntityWolf var1) { -- return var1.isTamed() ? tamedWolfTextures : (var1.isAngry() ? anrgyWolfTextures : wolfTextures); -- } -- -- protected int shouldRenderPass(EntityLivingBase var1, int var2, float var3) { -- return this.func_82447_a((EntityWolf)var1, var2, var3); -- } -- -- protected float handleRotationFloat(EntityLivingBase var1, float var2) { -- return this.getTailRotation((EntityWolf)var1, var2); -- } -- -- protected ResourceLocation getEntityTexture(Entity var1) { -- return this.func_110914_a((EntityWolf)var1); -+ protected ResourceLocation func_110914_a(EntityWolf par1EntityWolf) { -+ return par1EntityWolf.isTamed() ? tamedWolfTextures : (par1EntityWolf.isAngry() ? anrgyWolfTextures : wolfTextures); -+ } -+ -+ /** -+ * Queries whether should render the specified pass or not. -+ */ -+ protected int shouldRenderPass(EntityLivingBase par1EntityLivingBase, int par2, float par3) { -+ return this.func_82447_a((EntityWolf)par1EntityLivingBase, par2, par3); -+ } -+ -+ /** -+ * Defines what float the third param in setRotationAngles of ModelBase is -+ */ -+ protected float handleRotationFloat(EntityLivingBase par1EntityLivingBase, float par2) { -+ return this.getTailRotation((EntityWolf)par1EntityLivingBase, par2); -+ } -+ -+ /** -+ * Returns the location of an entity's texture. Doesn't seem to be called unless you call Render.bindEntityTexture. -+ */ -+ protected ResourceLocation getEntityTexture(Entity par1Entity) { -+ return this.func_110914_a((EntityWolf)par1Entity); - } - } ---- net/minecraft/src/EntitySelectorInventory.java -+++ net/minecraft/src/EntitySelectorInventory.java -@@ -1,7 +1,11 @@ - package net.minecraft.src; - - final class EntitySelectorInventory implements IEntitySelector { -- public boolean isEntityApplicable(Entity var1) { -- return var1 instanceof IInventory && var1.isEntityAlive(); -+ -+ /** -+ * Return whether the specified entity is applicable to this filter. -+ */ -+ public boolean isEntityApplicable(Entity par1Entity) { -+ return par1Entity instanceof IInventory && par1Entity.isEntityAlive(); - } - } ---- net/minecraft/src/GenLayerAddMushroomIsland.java -+++ net/minecraft/src/GenLayerAddMushroomIsland.java -@@ -1,31 +1,36 @@ - package net.minecraft.src; - - public class GenLayerAddMushroomIsland extends GenLayer { -- public GenLayerAddMushroomIsland(long var1, GenLayer var3) { -- super(var1); -- this.parent = var3; -+ public GenLayerAddMushroomIsland(long par1, GenLayer par3GenLayer) { -+ super(par1); -+ this.parent = par3GenLayer; - } - -- public int[] getInts(int var1, int var2, int var3, int var4) { -- int var5 = var1 - 1; -- int var6 = var2 - 1; -- int var7 = var3 + 2; -- int var8 = var4 + 2; -+ /** -+ * Returns a list of integer values generated by this layer. These may be interpreted as temperatures, rainfall -+ * amounts, or biomeList[] indices based on the particular GenLayer subclass. -+ */ -+ public int[] getInts(int par1, int par2, int par3, int par4) { -+ int var5 = par1 - 1; -+ int var6 = par2 - 1; -+ int var7 = par3 + 2; -+ int var8 = par4 + 2; - int[] var9 = this.parent.getInts(var5, var6, var7, var8); -- int[] var10 = IntCache.getIntCache(var3 * var4); -+ int[] var10 = IntCache.getIntCache(par3 * par4); - -- for(int var11 = 0; var11 < var4; ++var11) { -- for(int var12 = 0; var12 < var3; ++var12) { -+ for (int var11 = 0; var11 < par4; ++var11) { -+ for (int var12 = 0; var12 < par3; ++var12) { - int var13 = var9[var12 + 0 + (var11 + 0) * var7]; - int var14 = var9[var12 + 2 + (var11 + 0) * var7]; - int var15 = var9[var12 + 0 + (var11 + 2) * var7]; - int var16 = var9[var12 + 2 + (var11 + 2) * var7]; - int var17 = var9[var12 + 1 + (var11 + 1) * var7]; -- this.initChunkSeed((long)(var12 + var1), (long)(var11 + var2)); -- if(var17 == 0 && var13 == 0 && var14 == 0 && var15 == 0 && var16 == 0 && this.nextInt(100) == 0) { -- var10[var12 + var11 * var3] = BiomeGenBase.mushroomIsland.biomeID; -+ this.initChunkSeed((long)(var12 + par1), (long)(var11 + par2)); -+ -+ if (var17 == 0 && var13 == 0 && var14 == 0 && var15 == 0 && var16 == 0 && this.nextInt(100) == 0) { -+ var10[var12 + var11 * par3] = BiomeGenBase.mushroomIsland.biomeID; - } else { -- var10[var12 + var11 * var3] = var17; -+ var10[var12 + var11 * par3] = var17; - } - } - } ---- /dev/null -+++ org/spoutcraft/client/gui/settings/controls/SkyToggleButton.java -@@ -1,0 +1,39 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.client.gui.settings.controls; -+ -+import org.spoutcraft.api.gui.GenericCheckBox; -+import org.spoutcraft.client.SpoutClient; -+import org.spoutcraft.client.config.Configuration; -+ -+public class SkyToggleButton extends GenericCheckBox { -+ public SkyToggleButton() { -+ super("Sky"); -+ setChecked(Configuration.isSky()); -+ setEnabled(SpoutClient.getInstance().isSkyCheat()); -+ setTooltip("Sky\nON - sky is visible, slower\nOFF - sky is not visible, faster\nWhen sky is OFF the moon and sun are still visible."); -+ } -+ -+ @Override -+ public void onButtonClick() { -+ Configuration.setSky(!Configuration.isSky()); -+ Configuration.write(); -+ } -+} ---- net/minecraft/src/RenderBat.java -+++ net/minecraft/src/RenderBat.java -@@ -4,69 +4,92 @@ - - public class RenderBat extends RenderLiving { - private static final ResourceLocation batTextures = new ResourceLocation("textures/entity/bat.png"); -- private int renderedBatSize = ((ModelBat)this.mainModel).getBatSize(); -+ -+ /** -+ * not actually sure this is size, is not used as of now, but the model would be recreated if the value changed and it -+ * seems a good match for a bats size -+ */ -+ private int renderedBatSize; - - public RenderBat() { - super(new ModelBat(), 0.25F); -+ this.renderedBatSize = ((ModelBat)this.mainModel).getBatSize(); - } - -- public void func_82443_a(EntityBat var1, double var2, double var4, double var6, float var8, float var9) { -+ public void func_82443_a(EntityBat par1EntityBat, double par2, double par4, double par6, float par8, float par9) { - int var10 = ((ModelBat)this.mainModel).getBatSize(); -- if(var10 != this.renderedBatSize) { -+ -+ if (var10 != this.renderedBatSize) { - this.renderedBatSize = var10; - this.mainModel = new ModelBat(); - } - -- super.doRenderLiving(var1, var2, var4, var6, var8, var9); -+ super.doRenderLiving(par1EntityBat, par2, par4, par6, par8, par9); - } - -- protected ResourceLocation getBatTextures(EntityBat var1) { -+ protected ResourceLocation getBatTextures(EntityBat par1EntityBat) { - return batTextures; - } - -- protected void func_82442_a(EntityBat var1, float var2) { -+ protected void func_82442_a(EntityBat par1EntityBat, float par2) { - GL11.glScalef(0.35F, 0.35F, 0.35F); - } - -- protected void func_82445_a(EntityBat var1, double var2, double var4, double var6) { -- super.renderLivingAt(var1, var2, var4, var6); -+ protected void func_82445_a(EntityBat par1EntityBat, double par2, double par4, double par6) { -+ super.renderLivingAt(par1EntityBat, par2, par4, par6); - } - -- protected void func_82444_a(EntityBat var1, float var2, float var3, float var4) { -- if(!var1.getIsBatHanging()) { -- GL11.glTranslatef(0.0F, MathHelper.cos(var2 * 0.3F) * 0.1F, 0.0F); -+ protected void func_82444_a(EntityBat par1EntityBat, float par2, float par3, float par4) { -+ if (!par1EntityBat.getIsBatHanging()) { -+ GL11.glTranslatef(0.0F, MathHelper.cos(par2 * 0.3F) * 0.1F, 0.0F); - } else { - GL11.glTranslatef(0.0F, -0.1F, 0.0F); - } - -- super.rotateCorpse(var1, var2, var3, var4); -- } -- -- public void doRenderLiving(EntityLiving var1, double var2, double var4, double var6, float var8, float var9) { -- this.func_82443_a((EntityBat)var1, var2, var4, var6, var8, var9); -- } -- -- protected void preRenderCallback(EntityLivingBase var1, float var2) { -- this.func_82442_a((EntityBat)var1, var2); -- } -- -- protected void rotateCorpse(EntityLivingBase var1, float var2, float var3, float var4) { -- this.func_82444_a((EntityBat)var1, var2, var3, var4); -- } -- -- protected void renderLivingAt(EntityLivingBase var1, double var2, double var4, double var6) { -- this.func_82445_a((EntityBat)var1, var2, var4, var6); -- } -- -- public void doRenderLiving(EntityLivingBase var1, double var2, double var4, double var6, float var8, float var9) { -- this.func_82443_a((EntityBat)var1, var2, var4, var6, var8, var9); -- } -- -- protected ResourceLocation getEntityTexture(Entity var1) { -- return this.getBatTextures((EntityBat)var1); -- } -- -- public void doRender(Entity var1, double var2, double var4, double var6, float var8, float var9) { -- this.func_82443_a((EntityBat)var1, var2, var4, var6, var8, var9); -+ super.rotateCorpse(par1EntityBat, par2, par3, par4); -+ } -+ -+ public void doRenderLiving(EntityLiving par1EntityLiving, double par2, double par4, double par6, float par8, float par9) { -+ this.func_82443_a((EntityBat)par1EntityLiving, par2, par4, par6, par8, par9); -+ } -+ -+ /** -+ * Allows the render to do any OpenGL state modifications necessary before the model is rendered. Args: entityLiving, -+ * partialTickTime -+ */ -+ protected void preRenderCallback(EntityLivingBase par1EntityLivingBase, float par2) { -+ this.func_82442_a((EntityBat)par1EntityLivingBase, par2); -+ } -+ -+ protected void rotateCorpse(EntityLivingBase par1EntityLivingBase, float par2, float par3, float par4) { -+ this.func_82444_a((EntityBat)par1EntityLivingBase, par2, par3, par4); -+ } -+ -+ /** -+ * Sets a simple glTranslate on a LivingEntity. -+ */ -+ protected void renderLivingAt(EntityLivingBase par1EntityLivingBase, double par2, double par4, double par6) { -+ this.func_82445_a((EntityBat)par1EntityLivingBase, par2, par4, par6); -+ } -+ -+ public void doRenderLiving(EntityLivingBase par1EntityLivingBase, double par2, double par4, double par6, float par8, float par9) { -+ this.func_82443_a((EntityBat)par1EntityLivingBase, par2, par4, par6, par8, par9); -+ } -+ -+ /** -+ * Returns the location of an entity's texture. Doesn't seem to be called unless you call Render.bindEntityTexture. -+ */ -+ protected ResourceLocation getEntityTexture(Entity par1Entity) { -+ return this.getBatTextures((EntityBat)par1Entity); -+ } -+ -+ /** -+ * Actually renders the given argument. This is a synthetic bridge method, always casting down its argument and then -+ * handing it off to a worker function which does the actual work. In all probabilty, the class Render is generic -+ * (Render -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.client.entity; -+ -+import net.minecraft.src.EntityLivingBase; -+import net.minecraft.src.EntityPlayerSP; -+ -+import org.spoutcraft.client.player.ClientPlayer; -+ -+public class CraftEntityFactory { -+ public static CraftEntity getCraftEntity(net.minecraft.src.Entity aThis) { -+ if (aThis instanceof EntityPlayerSP) { -+ return ClientPlayer.getInstance(); -+ } -+ if (aThis instanceof EntityLivingBase) { -+ return new CraftLivingEntity((EntityLivingBase)aThis); -+ } -+ return null; // Should not break, got most of the important stuff -+ } -+} ---- net/minecraft/src/Packet71Weather.java -+++ net/minecraft/src/Packet71Weather.java -@@ -11,40 +11,51 @@ - public int posZ; - public int isLightningBolt; - -- public Packet71Weather() { -- } -- -- public Packet71Weather(Entity var1) { -- this.entityID = var1.entityId; -- this.posX = MathHelper.floor_double(var1.posX * 32.0D); -- this.posY = MathHelper.floor_double(var1.posY * 32.0D); -- this.posZ = MathHelper.floor_double(var1.posZ * 32.0D); -- if(var1 instanceof EntityLightningBolt) { -+ public Packet71Weather() {} -+ -+ public Packet71Weather(Entity par1Entity) { -+ this.entityID = par1Entity.entityId; -+ this.posX = MathHelper.floor_double(par1Entity.posX * 32.0D); -+ this.posY = MathHelper.floor_double(par1Entity.posY * 32.0D); -+ this.posZ = MathHelper.floor_double(par1Entity.posZ * 32.0D); -+ -+ if (par1Entity instanceof EntityLightningBolt) { - this.isLightningBolt = 1; - } -- -- } -- -- public void readPacketData(DataInput var1) throws IOException { -- this.entityID = var1.readInt(); -- this.isLightningBolt = var1.readByte(); -- this.posX = var1.readInt(); -- this.posY = var1.readInt(); -- this.posZ = var1.readInt(); -- } -- -- public void writePacketData(DataOutput var1) throws IOException { -- var1.writeInt(this.entityID); -- var1.writeByte(this.isLightningBolt); -- var1.writeInt(this.posX); -- var1.writeInt(this.posY); -- var1.writeInt(this.posZ); -- } -- -- public void processPacket(NetHandler var1) { -- var1.handleWeather(this); -- } -- -+ } -+ -+ /** -+ * Abstract. Reads the raw packet data from the data stream. -+ */ -+ public void readPacketData(DataInput par1DataInput) throws IOException { -+ this.entityID = par1DataInput.readInt(); -+ this.isLightningBolt = par1DataInput.readByte(); -+ this.posX = par1DataInput.readInt(); -+ this.posY = par1DataInput.readInt(); -+ this.posZ = par1DataInput.readInt(); -+ } -+ -+ /** -+ * Abstract. Writes the raw packet data to the data stream. -+ */ -+ public void writePacketData(DataOutput par1DataOutput) throws IOException { -+ par1DataOutput.writeInt(this.entityID); -+ par1DataOutput.writeByte(this.isLightningBolt); -+ par1DataOutput.writeInt(this.posX); -+ par1DataOutput.writeInt(this.posY); -+ par1DataOutput.writeInt(this.posZ); -+ } -+ -+ /** -+ * Passes this Packet on to the NetHandler for processing. -+ */ -+ public void processPacket(NetHandler par1NetHandler) { -+ par1NetHandler.handleWeather(this); -+ } -+ -+ /** -+ * Abstract. Return the size of the packet (not counting the header). -+ */ - public int getPacketSize() { - return 17; - } ---- /dev/null -+++ org/spoutcraft/api/material/item/GenericArmor.java -@@ -1,0 +1,28 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.api.material.item; -+ -+import org.spoutcraft.api.material.Armor; -+ -+public class GenericArmor extends GenericItem implements Armor { -+ public GenericArmor(String name, int id) { -+ super(name, id); -+ } -+} ---- /dev/null -+++ org/spoutcraft/api/inventory/MaterialManager.java -@@ -1,0 +1,48 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.api.inventory; -+ -+public interface MaterialManager { -+ public float getFriction(org.spoutcraft.api.material.Block block); -+ -+ public void setFriction(org.spoutcraft.api.material.Block block, float friction); -+ -+ public void resetFriction(org.spoutcraft.api.material.Block block); -+ -+ public float getHardness(org.spoutcraft.api.material.Block block); -+ -+ public void setHardness(org.spoutcraft.api.material.Block block, float hardness); -+ -+ public void resetHardness(org.spoutcraft.api.material.Block block); -+ -+ public boolean isOpaque(org.spoutcraft.api.material.Block block); -+ -+ public void setOpaque(org.spoutcraft.api.material.Block block, boolean opacity); -+ -+ public void resetOpacity(org.spoutcraft.api.material.Block block); -+ -+ public int getLightLevel(org.spoutcraft.api.material.Block block); -+ -+ public void setLightLevel(org.spoutcraft.api.material.Block block, int level); -+ -+ public void resetLightLevel(org.spoutcraft.api.material.Block block); -+ -+ public String getToolTip(org.spoutcraft.api.inventory.ItemStack is); -+} ---- net/minecraft/src/GameRuleValue.java -+++ net/minecraft/src/GameRuleValue.java -@@ -1,35 +1,45 @@ - package net.minecraft.src; - - class GameRuleValue { -- private String a; -+ private String valueString; - private boolean valueBoolean; - private int valueInteger; - private double valueDouble; - -- public GameRuleValue(String var1) { -- this.setValue(var1); -+ public GameRuleValue(String par1Str) { -+ this.setValue(par1Str); - } - -- public void setValue(String var1) { -- this.a = var1; -- this.valueBoolean = Boolean.parseBoolean(var1); -+ /** -+ * Set this game rule value. -+ */ -+ public void setValue(String par1Str) { -+ this.valueString = par1Str; -+ this.valueBoolean = Boolean.parseBoolean(par1Str); - - try { -- this.valueInteger = Integer.parseInt(var1); -+ this.valueInteger = Integer.parseInt(par1Str); - } catch (NumberFormatException var4) { -+ ; - } - - try { -- this.valueDouble = Double.parseDouble(var1); -+ this.valueDouble = Double.parseDouble(par1Str); - } catch (NumberFormatException var3) { -+ ; - } -- - } - -+ /** -+ * Gets the GameRule's value as String. -+ */ - public String getGameRuleStringValue() { -- return this.a; -+ return this.valueString; - } - -+ /** -+ * Gets the GameRule's value as boolean. -+ */ - public boolean getGameRuleBooleanValue() { - return this.valueBoolean; - } ---- /dev/null -+++ org/spoutcraft/api/gui/GenericSlider.java -@@ -1,0 +1,162 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.api.gui; -+ -+import java.io.IOException; -+ -+import org.spoutcraft.api.Spoutcraft; -+import org.spoutcraft.api.UnsafeClass; -+import org.spoutcraft.api.io.SpoutInputStream; -+import org.spoutcraft.api.io.SpoutOutputStream; -+ -+@UnsafeClass -+public class GenericSlider extends GenericControl implements Slider { -+ protected Label label = new GenericLabel(); -+ protected float slider = 0.5f; -+ protected boolean dragged = false; -+ -+ public GenericSlider() { -+ } -+ -+ public GenericSlider(String text) { -+ label.setText(text); -+ } -+ -+ public int getVersion() { -+ return super.getVersion() + 2; -+ } -+ -+ @Override -+ public void readData(SpoutInputStream input) throws IOException { -+ super.readData(input); -+ setSliderPosition(input.readFloat()); -+ label.readData(input); -+ } -+ -+ @Override -+ public void writeData(SpoutOutputStream output) throws IOException { -+ super.writeData(output); -+ output.writeFloat(getSliderPosition()); -+ label.writeData(output); -+ } -+ -+ public float getSliderPosition() { -+ return slider; -+ } -+ -+ public Slider setSliderPosition(float value) { -+ if (value > 1f) { -+ value = 1f; -+ } else if (value < 0f) { -+ value = 0f; -+ } -+ slider = value; -+ return this; -+ } -+ -+ @Override -+ public double getScreenX() { -+ return super.getScreenX(); -+ } -+ -+ @Override -+ public double getScreenY() { -+ return super.getScreenY(); -+ } -+ -+ public WidgetType getType() { -+ return WidgetType.Slider; -+ } -+ -+ public void render() { -+ Spoutcraft.getClient().getRenderDelegate().render(this); -+ } -+ -+ public boolean isDragging() { -+ return dragged; -+ } -+ -+ public Slider setDragging(boolean dragged) { -+ this.dragged = dragged; -+ return this; -+ } -+ -+ public void onSliderDrag(float oldPos, float newPos) { -+ } -+ -+ @Override -+ public Slider copy() { -+ return ((Slider)super.copy()).setSliderPosition(getSliderPosition()); -+ } -+ -+ public String getText() { -+ return label.getText(); -+ } -+ -+ public Color getTextColor() { -+ return label.getTextColor(); -+ } -+ -+ public boolean isAuto() { -+ return label.isAuto(); -+ } -+ -+ public WidgetAnchor getAlign() { -+ return label.getAlign(); -+ } -+ -+ public Label setScale(float scale) { -+ label.setScale(scale); -+ return this; -+ } -+ -+ public float getScale() { -+ return label.getScale(); -+ } -+ -+ public Slider setText(String text) { -+ label.setText(text); -+ return this; -+ } -+ -+ public Slider setTextColor(Color color) { -+ label.setTextColor(color); -+ return this; -+ } -+ -+ public Slider setAuto(boolean auto) { -+ label.setAuto(auto); -+ return this; -+ } -+ -+ public Slider setAlign(WidgetAnchor align) { -+ label.setAlign(align); -+ return this; -+ } -+ -+ public Label setShadow(boolean shadow) { -+ label.setShadow(shadow); -+ return this; -+ } -+ -+ public boolean hasShadow() { -+ return label.hasShadow(); -+ } -+} ---- net/minecraft/src/Packet131MapData.java -+++ net/minecraft/src/Packet131MapData.java -@@ -6,38 +6,58 @@ - - public class Packet131MapData extends Packet { - public short itemID; -+ -+ /** -+ * Contains a unique ID for the item that this packet will be populating. -+ */ - public short uniqueID; -+ -+ /** -+ * Contains a buffer of arbitrary data with which to populate an individual item in the world. -+ */ - public byte[] itemData; - - public Packet131MapData() { - this.isChunkDataPacket = true; - } - -- public Packet131MapData(short var1, short var2, byte[] var3) { -+ public Packet131MapData(short par1, short par2, byte[] par3ArrayOfByte) { - this.isChunkDataPacket = true; -- this.itemID = var1; -- this.uniqueID = var2; -- this.itemData = var3; -- } -- -- public void readPacketData(DataInput var1) throws IOException { -- this.itemID = var1.readShort(); -- this.uniqueID = var1.readShort(); -- this.itemData = new byte[var1.readUnsignedShort()]; -- var1.readFully(this.itemData); -- } -- -- public void writePacketData(DataOutput var1) throws IOException { -- var1.writeShort(this.itemID); -- var1.writeShort(this.uniqueID); -- var1.writeShort(this.itemData.length); -- var1.write(this.itemData); -- } -- -- public void processPacket(NetHandler var1) { -- var1.handleMapData(this); -- } -- -+ this.itemID = par1; -+ this.uniqueID = par2; -+ this.itemData = par3ArrayOfByte; -+ } -+ -+ /** -+ * Abstract. Reads the raw packet data from the data stream. -+ */ -+ public void readPacketData(DataInput par1DataInput) throws IOException { -+ this.itemID = par1DataInput.readShort(); -+ this.uniqueID = par1DataInput.readShort(); -+ this.itemData = new byte[par1DataInput.readUnsignedShort()]; -+ par1DataInput.readFully(this.itemData); -+ } -+ -+ /** -+ * Abstract. Writes the raw packet data to the data stream. -+ */ -+ public void writePacketData(DataOutput par1DataOutput) throws IOException { -+ par1DataOutput.writeShort(this.itemID); -+ par1DataOutput.writeShort(this.uniqueID); -+ par1DataOutput.writeShort(this.itemData.length); -+ par1DataOutput.write(this.itemData); -+ } -+ -+ /** -+ * Passes this Packet on to the NetHandler for processing. -+ */ -+ public void processPacket(NetHandler par1NetHandler) { -+ par1NetHandler.handleMapData(this); -+ } -+ -+ /** -+ * Abstract. Return the size of the packet (not counting the header). -+ */ - public int getPacketSize() { - return 4 + this.itemData.length; - } ---- net/minecraft/src/CallableLevelDimension.java -+++ net/minecraft/src/CallableLevelDimension.java -@@ -5,8 +5,8 @@ - class CallableLevelDimension implements Callable { - final WorldInfo worldInfoInstance; - -- CallableLevelDimension(WorldInfo var1) { -- this.worldInfoInstance = var1; -+ CallableLevelDimension(WorldInfo par1WorldInfo) { -+ this.worldInfoInstance = par1WorldInfo; - } - - public String callLevelDimension() { ---- net/minecraft/src/LanguageMetadataSection.java -+++ net/minecraft/src/LanguageMetadataSection.java -@@ -3,13 +3,13 @@ - import java.util.Collection; - - public class LanguageMetadataSection implements MetadataSection { -- private final Collection a; -+ private final Collection languages; - -- public LanguageMetadataSection(Collection var1) { -- this.a = var1; -+ public LanguageMetadataSection(Collection par1Collection) { -+ this.languages = par1Collection; - } - - public Collection getLanguages() { -- return this.a; -+ return this.languages; - } - } ---- net/minecraft/src/EnumFacing.java -+++ net/minecraft/src/EnumFacing.java -@@ -8,21 +8,29 @@ - EAST(4, 5, -1, 0, 0), - WEST(5, 4, 1, 0, 0); - -+ /** Face order for D-U-N-S-E-W. */ - private final int order_a; -+ -+ /** Face order for U-D-S-N-W-E. */ - private final int order_b; - private final int frontOffsetX; - private final int frontOffsetY; - private final int frontOffsetZ; -+ -+ /** List of all values in EnumFacing. Order is D-U-N-S-E-W. */ - private static final EnumFacing[] faceList = new EnumFacing[6]; - -- private EnumFacing(int var3, int var4, int var5, int var6, int var7) { -- this.order_a = var3; -- this.order_b = var4; -- this.frontOffsetX = var5; -- this.frontOffsetY = var6; -- this.frontOffsetZ = var7; -+ private EnumFacing(int par3, int par4, int par5, int par6, int par7) { -+ this.order_a = par3; -+ this.order_b = par4; -+ this.frontOffsetX = par5; -+ this.frontOffsetY = par6; -+ this.frontOffsetZ = par7; - } - -+ /** -+ * Returns a offset that addresses the block in front of this facing. -+ */ - public int getFrontOffsetX() { - return this.frontOffsetX; - } -@@ -31,22 +39,27 @@ - return this.frontOffsetY; - } - -+ /** -+ * Returns a offset that addresses the block in front of this facing. -+ */ - public int getFrontOffsetZ() { - return this.frontOffsetZ; - } - -- public static EnumFacing getFront(int var0) { -- return faceList[var0 % faceList.length]; -+ /** -+ * Returns the facing that represents the block in front of it. -+ */ -+ public static EnumFacing getFront(int par0) { -+ return faceList[par0 % faceList.length]; - } - - static { - EnumFacing[] var0 = values(); - int var1 = var0.length; - -- for(int var2 = 0; var2 < var1; ++var2) { -+ for (int var2 = 0; var2 < var1; ++var2) { - EnumFacing var3 = var0[var2]; - faceList[var3.order_a] = var3; - } -- - } - } ---- /dev/null -+++ com/prupe/mcpatcher/cc/Lightmap.java -@@ -1,0 +1,153 @@ -+package com.prupe.mcpatcher.cc; -+ -+import com.prupe.mcpatcher.Config; -+import com.prupe.mcpatcher.MCLogger; -+import com.prupe.mcpatcher.TexturePackAPI; -+import java.awt.image.BufferedImage; -+import java.util.HashMap; -+import net.minecraft.src.EntityRenderer; -+import net.minecraft.src.Minecraft; -+import net.minecraft.src.ResourceLocation; -+import net.minecraft.src.World; -+ -+public final class Lightmap { -+ private static final MCLogger logger = MCLogger.getLogger("Custom Colors"); -+ private static final String LIGHTMAP_FORMAT = "lightmap/world%d.png"; -+ private static final int LIGHTMAP_SIZE = 16; -+ private static final int HEIGHT_WITHOUT_NIGHTVISION = 32; -+ private static final int HEIGHT_WITH_NIGHTVISION = 64; -+ private static final boolean useLightmaps = Config.getBoolean("Custom Colors", "lightmaps", true); -+ private static final HashMap lightmaps = new HashMap(); -+ private final int width; -+ private final boolean customNightvision; -+ private final int[] origMap; -+ private final boolean valid; -+ private final float[] sunrgb = new float[48]; -+ private final float[] torchrgb = new float[48]; -+ private final float[] sunrgbnv = new float[48]; -+ private final float[] torchrgbnv = new float[48]; -+ private final float[] rgb = new float[3]; -+ -+ static void reset() { -+ lightmaps.clear(); -+ } -+ -+ public static boolean computeLightmap(EntityRenderer renderer, World world, int[] mapRGB, float partialTick) { -+ if (world != null && useLightmaps) { -+ Lightmap lightmap = null; -+ int worldType = world.provider.dimensionId; -+ -+ if (lightmaps.containsKey(Integer.valueOf(worldType))) { -+ lightmap = (Lightmap)lightmaps.get(Integer.valueOf(worldType)); -+ } else { -+ ResourceLocation resource = TexturePackAPI.newMCPatcherResourceLocation(String.format("lightmap/world%d.png", new Object[] {Integer.valueOf(worldType)})); -+ BufferedImage image = TexturePackAPI.getImage(resource); -+ -+ if (image != null) { -+ lightmap = new Lightmap(resource, image); -+ -+ if (!lightmap.valid) { -+ lightmap = null; -+ } -+ } -+ -+ lightmaps.put(Integer.valueOf(worldType), lightmap); -+ } -+ -+ return lightmap != null && lightmap.compute(renderer, world, mapRGB, partialTick); -+ } else { -+ return false; -+ } -+ } -+ -+ private Lightmap(ResourceLocation resource, BufferedImage image) { -+ this.width = image.getWidth(); -+ int height = image.getHeight(); -+ this.customNightvision = height == 64; -+ this.origMap = new int[this.width * height]; -+ image.getRGB(0, 0, this.width, height, this.origMap, 0, this.width); -+ this.valid = height == 32 || height == 64; -+ -+ if (!this.valid) { -+ logger.error("%s must be exactly %d or %d pixels high", new Object[] {resource, Integer.valueOf(32), Integer.valueOf(64)}); -+ } -+ } -+ -+ private boolean compute(EntityRenderer renderer, World world, int[] mapRGB, float partialTick) { -+ float sun = Colorizer.clamp(world.lastLightningBolt > 0 ? 1.0F : 1.1666666F * (world.getSunBrightness(1.0F) - 0.2F)) * (float)(this.width - 1); -+ float torch = Colorizer.clamp(renderer.torchFlickerX + 0.5F) * (float)(this.width - 1); -+ float nightVisionStrength = renderer.getNightVisionStrength(partialTick); -+ float gamma = Colorizer.clamp(Minecraft.getMinecraft().gameSettings.gammaSetting); -+ int s; -+ -+ for (s = 0; s < 16; ++s) { -+ interpolate(this.origMap, s * this.width, sun, this.sunrgb, 3 * s); -+ interpolate(this.origMap, (s + 16) * this.width, torch, this.torchrgb, 3 * s); -+ -+ if (this.customNightvision && nightVisionStrength > 0.0F) { -+ interpolate(this.origMap, (s + 32) * this.width, sun, this.sunrgbnv, 3 * s); -+ interpolate(this.origMap, (s + 48) * this.width, torch, this.torchrgbnv, 3 * s); -+ } -+ } -+ -+ for (s = 0; s < 16; ++s) { -+ for (int t = 0; t < 16; ++t) { -+ int k; -+ -+ for (k = 0; k < 3; ++k) { -+ this.rgb[k] = Colorizer.clamp(this.sunrgb[3 * s + k] + this.torchrgb[3 * t + k]); -+ } -+ -+ if (nightVisionStrength > 0.0F) { -+ if (this.customNightvision) { -+ for (k = 0; k < 3; ++k) { -+ this.rgb[k] = Colorizer.clamp((1.0F - nightVisionStrength) * this.rgb[k] + nightVisionStrength * (this.sunrgbnv[3 * s + k] + this.torchrgbnv[3 * t + k])); -+ } -+ } else { -+ float var13 = Math.max(Math.max(this.rgb[0], this.rgb[1]), this.rgb[2]); -+ -+ if (var13 > 0.0F) { -+ var13 = 1.0F - nightVisionStrength + nightVisionStrength / var13; -+ -+ for (int tmp = 0; tmp < 3; ++tmp) { -+ this.rgb[tmp] = Colorizer.clamp(this.rgb[tmp] * var13); -+ } -+ } -+ } -+ } -+ -+ if (gamma != 0.0F) { -+ for (k = 0; k < 3; ++k) { -+ float var14 = 1.0F - this.rgb[k]; -+ var14 = 1.0F - var14 * var14 * var14 * var14; -+ this.rgb[k] = gamma * var14 + (1.0F - gamma) * this.rgb[k]; -+ } -+ } -+ -+ mapRGB[s * 16 + t] = -16777216 | Colorizer.float3ToInt(this.rgb); -+ } -+ } -+ -+ return true; -+ } -+ -+ private static void interpolate(int[] map, int offset1, float x, float[] rgb, int offset2) { -+ int x0 = (int)Math.floor((double)x); -+ int x1 = (int)Math.ceil((double)x); -+ -+ if (x0 == x1) { -+ Colorizer.intToFloat3(map[offset1 + x0], rgb, offset2); -+ } else { -+ float xf = x - (float)x0; -+ float xg = 1.0F - xf; -+ float[] rgb0 = new float[3]; -+ float[] rgb1 = new float[3]; -+ Colorizer.intToFloat3(map[offset1 + x0], rgb0); -+ Colorizer.intToFloat3(map[offset1 + x1], rgb1); -+ -+ for (int i = 0; i < 3; ++i) { -+ rgb[offset2 + i] = xg * rgb0[i] + xf * rgb1[i]; -+ } -+ } -+ } -+} ---- /dev/null -+++ net/minecraft/src/GuiParticle.java -@@ -1,0 +1,42 @@ -+package net.minecraft.src; -+ -+import java.util.ArrayList; -+import java.util.List; -+import net.minecraft.src.Minecraft; -+import org.lwjgl.opengl.GL11; -+ -+public class GuiParticle extends Gui { -+ private List particles = new ArrayList(); -+ private Minecraft mc; -+ -+ public GuiParticle(Minecraft par1Minecraft) { -+ this.mc = par1Minecraft; -+ } -+ -+ public void update() { -+ for (int var1 = 0; var1 < this.particles.size(); ++var1) { -+ Particle var2 = (Particle)this.particles.get(var1); -+ var2.preUpdate(); -+ var2.update(this); -+ -+ if (var2.isDead) { -+ this.particles.remove(var1--); -+ } -+ } -+ } -+ -+ public void draw(float par1) { -+ mc.getMinecraft().getTextureManager().bindTexture(new ResourceLocation("textures/particle/particles.png")); -+ for (int var2 = 0; var2 < this.particles.size(); ++var2) { -+ Particle var3 = (Particle)this.particles.get(var2); -+ int var4 = (int)(var3.prevPosX + (var3.posX - var3.prevPosX) * (double)par1 - 4.0D); -+ int var5 = (int)(var3.prevPosY + (var3.posY - var3.prevPosY) * (double)par1 - 4.0D); -+ float var6 = (float)(var3.prevTintAlpha + (var3.tintAlpha - var3.prevTintAlpha) * (double)par1); -+ float var7 = (float)(var3.prevTintRed + (var3.tintRed - var3.prevTintRed) * (double)par1); -+ float var8 = (float)(var3.prevTintGreen + (var3.tintGreen - var3.prevTintGreen) * (double)par1); -+ float var9 = (float)(var3.prevTintBlue + (var3.tintBlue - var3.prevTintBlue) * (double)par1); -+ GL11.glColor4f(var7, var8, var9, var6); -+ this.drawTexturedModalRect(var4, var5, 40, 0, 8, 8); -+ } -+ } -+} ---- net/minecraft/src/WorldServer.java -+++ net/minecraft/src/WorldServer.java -@@ -1,54 +1,77 @@ - package net.minecraft.src; - - import java.util.ArrayList; --import java.util.Collection; - import java.util.HashSet; - import java.util.Iterator; - import java.util.List; - import java.util.Random; - import java.util.Set; - import java.util.TreeSet; -+ - import net.minecraft.server.MinecraftServer; - - public class WorldServer extends World { -- private final MinecraftServer a; -+ private final MinecraftServer mcServer; - private final EntityTracker theEntityTracker; - private final PlayerManager thePlayerManager; -- private Set L; -- private TreeSet M; -+ private Set pendingTickListEntriesHashSet; -+ -+ /** All work to do in future ticks. */ -+ private TreeSet pendingTickListEntriesTreeSet; - public ChunkProviderServer theChunkProviderServer; -- public boolean levelSaving; -+ -+ /** set by CommandServerSave{all,Off,On} */ -+ public boolean canNotSave; -+ -+ /** is false if there are no players */ - private boolean allPlayersSleeping; - private int updateEntityTick; -+ -+ /** -+ * the teleporter to use when the entity is being transferred into the dimension -+ */ - private final Teleporter worldTeleporter; - private final SpawnerAnimals animalSpawner = new SpawnerAnimals(); -- private ServerBlockEventList[] blockEventCache = new ServerBlockEventList[]{new ServerBlockEventList((ServerBlockEvent)null), new ServerBlockEventList((ServerBlockEvent)null)}; -+ -+ /** -+ * Double buffer of ServerBlockEventList[] for holding pending BlockEventData's -+ */ -+ private ServerBlockEventList[] blockEventCache = new ServerBlockEventList[] {new ServerBlockEventList((ServerBlockEvent)null), new ServerBlockEventList((ServerBlockEvent)null)}; -+ -+ /** -+ * The index into the blockEventCache; either 0, or 1, toggled in sendBlockEventPackets where all BlockEvent are -+ * applied locally and send to clients. -+ */ - private int blockEventCacheIndex; -- private static final WeightedRandomChestContent[] bonusChestContent = new WeightedRandomChestContent[]{new WeightedRandomChestContent(Item.stick.itemID, 0, 1, 3, 10), new WeightedRandomChestContent(Block.planks.blockID, 0, 1, 3, 10), new WeightedRandomChestContent(Block.wood.blockID, 0, 1, 3, 10), new WeightedRandomChestContent(Item.axeStone.itemID, 0, 1, 1, 3), new WeightedRandomChestContent(Item.axeWood.itemID, 0, 1, 1, 5), new WeightedRandomChestContent(Item.pickaxeStone.itemID, 0, 1, 1, 3), new WeightedRandomChestContent(Item.pickaxeWood.itemID, 0, 1, 1, 5), new WeightedRandomChestContent(Item.appleRed.itemID, 0, 2, 3, 5), new WeightedRandomChestContent(Item.bread.itemID, 0, 2, 3, 3)}; -- private List U = new ArrayList(); -+ private static final WeightedRandomChestContent[] bonusChestContent = new WeightedRandomChestContent[] {new WeightedRandomChestContent(Item.stick.itemID, 0, 1, 3, 10), new WeightedRandomChestContent(Block.planks.blockID, 0, 1, 3, 10), new WeightedRandomChestContent(Block.wood.blockID, 0, 1, 3, 10), new WeightedRandomChestContent(Item.axeStone.itemID, 0, 1, 1, 3), new WeightedRandomChestContent(Item.axeWood.itemID, 0, 1, 1, 5), new WeightedRandomChestContent(Item.pickaxeStone.itemID, 0, 1, 1, 3), new WeightedRandomChestContent(Item.pickaxeWood.itemID, 0, 1, 1, 5), new WeightedRandomChestContent(Item.appleRed.itemID, 0, 2, 3, 5), new WeightedRandomChestContent(Item.bread.itemID, 0, 2, 3, 3)}; -+ private List pendingTickListEntriesThisTick = new ArrayList(); -+ -+ /** An IntHashMap of entity IDs (integers) to their Entity objects. */ - private IntHashMap entityIdMap; - -- public WorldServer(MinecraftServer var1, ISaveHandler var2, String var3, int var4, WorldSettings var5, Profiler var6, ILogAgent var7) { -- super(var2, var3, var5, WorldProvider.getProviderForDimension(var4), var6, var7); -- this.a = var1; -+ public WorldServer(MinecraftServer par1MinecraftServer, ISaveHandler par2ISaveHandler, String par3Str, int par4, WorldSettings par5WorldSettings, Profiler par6Profiler, ILogAgent par7ILogAgent) { -+ super(par2ISaveHandler, par3Str, par5WorldSettings, WorldProvider.getProviderForDimension(par4), par6Profiler, par7ILogAgent); -+ this.mcServer = par1MinecraftServer; - this.theEntityTracker = new EntityTracker(this); -- this.thePlayerManager = new PlayerManager(this, var1.getConfigurationManager().getViewDistance()); -- if(this.entityIdMap == null) { -+ this.thePlayerManager = new PlayerManager(this, par1MinecraftServer.getConfigurationManager().getViewDistance()); -+ -+ if (this.entityIdMap == null) { - this.entityIdMap = new IntHashMap(); - } - -- if(this.L == null) { -- this.L = new HashSet(); -+ if (this.pendingTickListEntriesHashSet == null) { -+ this.pendingTickListEntriesHashSet = new HashSet(); - } - -- if(this.M == null) { -- this.M = new TreeSet(); -+ if (this.pendingTickListEntriesTreeSet == null) { -+ this.pendingTickListEntriesTreeSet = new TreeSet(); - } - - this.worldTeleporter = new Teleporter(this); -- this.worldScoreboard = new ServerScoreboard(var1); -+ this.worldScoreboard = new ServerScoreboard(par1MinecraftServer); - ScoreboardSaveData var8 = (ScoreboardSaveData)this.mapStorage.loadData(ScoreboardSaveData.class, "scoreboard"); -- if(var8 == null) { -+ -+ if (var8 == null) { - var8 = new ScoreboardSaveData(); - this.mapStorage.setData("scoreboard", var8); - } -@@ -57,15 +80,20 @@ - ((ServerScoreboard)this.worldScoreboard).func_96547_a(var8); - } - -+ /** -+ * Runs a single tick for the world -+ */ - public void tick() { - super.tick(); -- if(this.getWorldInfo().isHardcoreModeEnabled() && this.difficultySetting < 3) { -+ -+ if (this.getWorldInfo().isHardcoreModeEnabled() && this.difficultySetting < 3) { - this.difficultySetting = 3; - } - - this.provider.worldChunkMgr.cleanupCache(); -- if(this.areAllPlayersAsleep()) { -- if(this.getGameRules().getGameRuleBooleanValue("doDaylightCycle")) { -+ -+ if (this.areAllPlayersAsleep()) { -+ if (this.getGameRules().getGameRuleBooleanValue("doDaylightCycle")) { - long var1 = this.worldInfo.getWorldTime() + 24000L; - this.worldInfo.setWorldTime(var1 - var1 % 24000L); - } -@@ -74,19 +102,22 @@ - } - - this.theProfiler.startSection("mobSpawner"); -- if(this.getGameRules().getGameRuleBooleanValue("doMobSpawning")) { -+ -+ if (this.getGameRules().getGameRuleBooleanValue("doMobSpawning")) { - this.animalSpawner.findChunksForSpawning(this, this.spawnHostileMobs, this.spawnPeacefulMobs, this.worldInfo.getWorldTotalTime() % 400L == 0L); - } - - this.theProfiler.endStartSection("chunkSource"); - this.chunkProvider.unloadQueuedChunks(); - int var3 = this.calculateSkylightSubtracted(1.0F); -- if(var3 != this.skylightSubtracted) { -+ -+ if (var3 != this.skylightSubtracted) { - this.skylightSubtracted = var3; - } - - this.worldInfo.incrementTotalWorldTime(this.worldInfo.getWorldTotalTime() + 1L); -- if(this.getGameRules().getGameRuleBooleanValue("doDaylightCycle")) { -+ -+ if (this.getGameRules().getGameRuleBooleanValue("doDaylightCycle")) { - this.worldInfo.setWorldTime(this.worldInfo.getWorldTime() + 1L); - } - -@@ -105,32 +136,39 @@ - this.sendAndApplyBlockEvents(); - } - -- public SpawnListEntry spawnRandomCreature(EnumCreatureType var1, int var2, int var3, int var4) { -- List var5 = this.getChunkProvider().getPossibleCreatures(var1, var2, var3, var4); -- return var5 != null && !var5.isEmpty() ? (SpawnListEntry)WeightedRandom.getRandomItem(this.s, (Collection)var5) : null; -+ /** -+ * only spawns creatures allowed by the chunkProvider -+ */ -+ public SpawnListEntry spawnRandomCreature(EnumCreatureType par1EnumCreatureType, int par2, int par3, int par4) { -+ List var5 = this.getChunkProvider().getPossibleCreatures(par1EnumCreatureType, par2, par3, par4); -+ return var5 != null && !var5.isEmpty() ? (SpawnListEntry)WeightedRandom.getRandomItem(this.rand, var5) : null; - } - -+ /** -+ * Updates the flag that indicates whether or not all players in the world are sleeping. -+ */ - public void updateAllPlayersSleepingFlag() { -- this.allPlayersSleeping = !this.h.isEmpty(); -- Iterator var1 = this.h.iterator(); -+ this.allPlayersSleeping = !this.playerEntities.isEmpty(); -+ Iterator var1 = this.playerEntities.iterator(); - -- while(var1.hasNext()) { -+ while (var1.hasNext()) { - EntityPlayer var2 = (EntityPlayer)var1.next(); -- if(!var2.isPlayerSleeping()) { -+ -+ if (!var2.isPlayerSleeping()) { - this.allPlayersSleeping = false; - break; - } - } -- - } - - protected void wakeAllPlayers() { - this.allPlayersSleeping = false; -- Iterator var1 = this.h.iterator(); -+ Iterator var1 = this.playerEntities.iterator(); - -- while(var1.hasNext()) { -+ while (var1.hasNext()) { - EntityPlayer var2 = (EntityPlayer)var1.next(); -- if(var2.isPlayerSleeping()) { -+ -+ if (var2.isPlayerSleeping()) { - var2.wakeUpPlayer(false, false, true); - } - } -@@ -146,17 +184,17 @@ - } - - public boolean areAllPlayersAsleep() { -- if(this.allPlayersSleeping && !this.isRemote) { -- Iterator var1 = this.h.iterator(); -- -+ if (this.allPlayersSleeping && !this.isRemote) { -+ Iterator var1 = this.playerEntities.iterator(); - EntityPlayer var2; -+ - do { -- if(!var1.hasNext()) { -+ if (!var1.hasNext()) { - return true; - } - - var2 = (EntityPlayer)var1.next(); -- } while(var2.isPlayerFullyAsleep()); -+ } while (var2.isPlayerFullyAsleep()); - - return false; - } else { -@@ -164,8 +202,11 @@ - } - } - -+ /** -+ * Sets a new spawn location by finding an uncovered block at a random (x,z) location in the chunk. -+ */ - public void setSpawnLocation() { -- if(this.worldInfo.getSpawnY() <= 0) { -+ if (this.worldInfo.getSpawnY() <= 0) { - this.worldInfo.setSpawnY(64); - } - -@@ -173,11 +214,12 @@ - int var2 = this.worldInfo.getSpawnZ(); - int var3 = 0; - -- while(this.getFirstUncoveredBlock(var1, var2) == 0) { -- var1 += this.s.nextInt(8) - this.s.nextInt(8); -- var2 += this.s.nextInt(8) - this.s.nextInt(8); -+ while (this.getFirstUncoveredBlock(var1, var2) == 0) { -+ var1 += this.rand.nextInt(8) - this.rand.nextInt(8); -+ var2 += this.rand.nextInt(8) - this.rand.nextInt(8); - ++var3; -- if(var3 == 10000) { -+ -+ if (var3 == 10000) { - break; - } - } -@@ -186,13 +228,16 @@ - this.worldInfo.setSpawnZ(var2); - } - -+ /** -+ * plays random cave ambient sounds and runs updateTick on random blocks within each chunk in the vacinity of a player -+ */ - protected void tickBlocksAndAmbiance() { - super.tickBlocksAndAmbiance(); - int var1 = 0; - int var2 = 0; -- Iterator var3 = this.G.iterator(); -+ Iterator var3 = this.activeChunkSet.iterator(); - -- while(var3.hasNext()) { -+ while (var3.hasNext()) { - ChunkCoordIntPair var4 = (ChunkCoordIntPair)var3.next(); - int var5 = var4.chunkXPos * 16; - int var6 = var4.chunkZPos * 16; -@@ -206,38 +251,44 @@ - int var9; - int var10; - int var11; -- if(this.s.nextInt(100000) == 0 && this.isRaining() && this.isThundering()) { -+ -+ if (this.rand.nextInt(100000) == 0 && this.isRaining() && this.isThundering()) { - this.updateLCG = this.updateLCG * 3 + 1013904223; - var8 = this.updateLCG >> 2; - var9 = var5 + (var8 & 15); - var10 = var6 + (var8 >> 8 & 15); - var11 = this.getPrecipitationHeight(var9, var10); -- if(this.canLightningStrikeAt(var9, var11, var10)) { -+ -+ if (this.canLightningStrikeAt(var9, var11, var10)) { - this.addWeatherEffect(new EntityLightningBolt(this, (double)var9, (double)var11, (double)var10)); - } - } - - this.theProfiler.endStartSection("iceandsnow"); - int var13; -- if(this.s.nextInt(16) == 0) { -+ -+ if (this.rand.nextInt(16) == 0) { - this.updateLCG = this.updateLCG * 3 + 1013904223; - var8 = this.updateLCG >> 2; - var9 = var8 & 15; - var10 = var8 >> 8 & 15; - var11 = this.getPrecipitationHeight(var9 + var5, var10 + var6); -- if(this.isBlockFreezableNaturally(var9 + var5, var11 - 1, var10 + var6)) { -+ -+ if (this.isBlockFreezableNaturally(var9 + var5, var11 - 1, var10 + var6)) { - this.setBlock(var9 + var5, var11 - 1, var10 + var6, Block.ice.blockID); - } - -- if(this.isRaining() && this.canSnowAt(var9 + var5, var11, var10 + var6)) { -+ if (this.isRaining() && this.canSnowAt(var9 + var5, var11, var10 + var6)) { - this.setBlock(var9 + var5, var11, var10 + var6, Block.snow.blockID); - } - -- if(this.isRaining()) { -+ if (this.isRaining()) { - BiomeGenBase var12 = this.getBiomeGenForCoords(var9 + var5, var10 + var6); -- if(var12.canSpawnLightningBolt()) { -+ -+ if (var12.canSpawnLightningBolt()) { - var13 = this.getBlockId(var9 + var5, var11 - 1, var10 + var6); -- if(var13 != 0) { -+ -+ if (var13 != 0) { - Block.blocksList[var13].fillWithRain(this, var9 + var5, var11 - 1, var10 + var6); - } - } -@@ -248,21 +299,23 @@ - ExtendedBlockStorage[] var19 = var7.getBlockStorageArray(); - var9 = var19.length; - -- for(var10 = 0; var10 < var9; ++var10) { -- ExtendedBlockStorage var20 = var19[var10]; -- if(var20 != null && var20.getNeedsRandomTick()) { -- for(int var21 = 0; var21 < 3; ++var21) { -+ for (var10 = 0; var10 < var9; ++var10) { -+ ExtendedBlockStorage var21 = var19[var10]; -+ -+ if (var21 != null && var21.getNeedsRandomTick()) { -+ for (int var20 = 0; var20 < 3; ++var20) { - this.updateLCG = this.updateLCG * 3 + 1013904223; - var13 = this.updateLCG >> 2; - int var14 = var13 & 15; - int var15 = var13 >> 8 & 15; - int var16 = var13 >> 16 & 15; -- int var17 = var20.getExtBlockID(var14, var16, var15); -+ int var17 = var21.getExtBlockID(var14, var16, var15); - ++var2; - Block var18 = Block.blocksList[var17]; -- if(var18 != null && var18.getTickRandomly()) { -+ -+ if (var18 != null && var18.getTickRandomly()) { - ++var1; -- var18.updateTick(this, var14 + var5, var16 + var20.getYLocation(), var15 + var6, this.s); -+ var18.updateTick(this, var14 + var5, var16 + var21.getYLocation(), var15 + var6, this.rand); - } - } - } -@@ -270,68 +323,81 @@ - - this.theProfiler.endSection(); - } -- -- } -- -- public boolean isBlockTickScheduledThisTick(int var1, int var2, int var3, int var4) { -- NextTickListEntry var5 = new NextTickListEntry(var1, var2, var3, var4); -- return this.U.contains(var5); -- } -- -- public void scheduleBlockUpdate(int var1, int var2, int var3, int var4, int var5) { -- this.scheduleBlockUpdateWithPriority(var1, var2, var3, var4, var5, 0); -- } -- -- public void scheduleBlockUpdateWithPriority(int var1, int var2, int var3, int var4, int var5, int var6) { -- NextTickListEntry var7 = new NextTickListEntry(var1, var2, var3, var4); -+ } -+ -+ /** -+ * Returns true if the given block will receive a scheduled tick in this tick. Args: X, Y, Z, blockID -+ */ -+ public boolean isBlockTickScheduledThisTick(int par1, int par2, int par3, int par4) { -+ NextTickListEntry var5 = new NextTickListEntry(par1, par2, par3, par4); -+ return this.pendingTickListEntriesThisTick.contains(var5); -+ } -+ -+ /** -+ * Schedules a tick to a block with a delay (Most commonly the tick rate) -+ */ -+ public void scheduleBlockUpdate(int par1, int par2, int par3, int par4, int par5) { -+ this.scheduleBlockUpdateWithPriority(par1, par2, par3, par4, par5, 0); -+ } -+ -+ public void scheduleBlockUpdateWithPriority(int par1, int par2, int par3, int par4, int par5, int par6) { -+ NextTickListEntry var7 = new NextTickListEntry(par1, par2, par3, par4); - byte var8 = 0; -- if(this.scheduledUpdatesAreImmediate && var4 > 0) { -- if(Block.blocksList[var4].func_82506_l()) { -+ -+ if (this.scheduledUpdatesAreImmediate && par4 > 0) { -+ if (Block.blocksList[par4].func_82506_l()) { - var8 = 8; -- if(this.checkChunksExist(var7.xCoord - var8, var7.yCoord - var8, var7.zCoord - var8, var7.xCoord + var8, var7.yCoord + var8, var7.zCoord + var8)) { -+ -+ if (this.checkChunksExist(var7.xCoord - var8, var7.yCoord - var8, var7.zCoord - var8, var7.xCoord + var8, var7.yCoord + var8, var7.zCoord + var8)) { - int var9 = this.getBlockId(var7.xCoord, var7.yCoord, var7.zCoord); -- if(var9 == var7.blockID && var9 > 0) { -- Block.blocksList[var9].updateTick(this, var7.xCoord, var7.yCoord, var7.zCoord, this.s); -+ -+ if (var9 == var7.blockID && var9 > 0) { -+ Block.blocksList[var9].updateTick(this, var7.xCoord, var7.yCoord, var7.zCoord, this.rand); - } - } - - return; - } - -- var5 = 1; -- } -- -- if(this.checkChunksExist(var1 - var8, var2 - var8, var3 - var8, var1 + var8, var2 + var8, var3 + var8)) { -- if(var4 > 0) { -- var7.setScheduledTime((long)var5 + this.worldInfo.getWorldTotalTime()); -- var7.setPriority(var6); -- } -- -- if(!this.L.contains(var7)) { -- this.L.add(var7); -- this.M.add(var7); -- } -- } -- -- } -- -- public void scheduleBlockUpdateFromLoad(int var1, int var2, int var3, int var4, int var5, int var6) { -- NextTickListEntry var7 = new NextTickListEntry(var1, var2, var3, var4); -- var7.setPriority(var6); -- if(var4 > 0) { -- var7.setScheduledTime((long)var5 + this.worldInfo.getWorldTotalTime()); -- } -- -- if(!this.L.contains(var7)) { -- this.L.add(var7); -- this.M.add(var7); -- } -- -- } -- -+ par5 = 1; -+ } -+ -+ if (this.checkChunksExist(par1 - var8, par2 - var8, par3 - var8, par1 + var8, par2 + var8, par3 + var8)) { -+ if (par4 > 0) { -+ var7.setScheduledTime((long)par5 + this.worldInfo.getWorldTotalTime()); -+ var7.setPriority(par6); -+ } -+ -+ if (!this.pendingTickListEntriesHashSet.contains(var7)) { -+ this.pendingTickListEntriesHashSet.add(var7); -+ this.pendingTickListEntriesTreeSet.add(var7); -+ } -+ } -+ } -+ -+ /** -+ * Schedules a block update from the saved information in a chunk. Called when the chunk is loaded. -+ */ -+ public void scheduleBlockUpdateFromLoad(int par1, int par2, int par3, int par4, int par5, int par6) { -+ NextTickListEntry var7 = new NextTickListEntry(par1, par2, par3, par4); -+ var7.setPriority(par6); -+ -+ if (par4 > 0) { -+ var7.setScheduledTime((long)par5 + this.worldInfo.getWorldTotalTime()); -+ } -+ -+ if (!this.pendingTickListEntriesHashSet.contains(var7)) { -+ this.pendingTickListEntriesHashSet.add(var7); -+ this.pendingTickListEntriesTreeSet.add(var7); -+ } -+ } -+ -+ /** -+ * Updates (and cleans up) entities and tile entities -+ */ - public void updateEntities() { -- if(this.h.isEmpty()) { -- if(this.updateEntityTick++ >= 1200) { -+ if (this.playerEntities.isEmpty()) { -+ if (this.updateEntityTick++ >= 1200) { - return; - } - } else { -@@ -341,51 +407,61 @@ - super.updateEntities(); - } - -+ /** -+ * Resets the updateEntityTick field to 0 -+ */ - public void resetUpdateEntityTick() { - this.updateEntityTick = 0; - } - -- public boolean tickUpdates(boolean var1) { -- int var2 = this.M.size(); -- if(var2 != this.L.size()) { -+ /** -+ * Runs through the list of updates to run and ticks them -+ */ -+ public boolean tickUpdates(boolean par1) { -+ int var2 = this.pendingTickListEntriesTreeSet.size(); -+ -+ if (var2 != this.pendingTickListEntriesHashSet.size()) { - throw new IllegalStateException("TickNextTick list out of synch"); - } else { -- if(var2 > 1000) { -+ if (var2 > 1000) { - var2 = 1000; - } - - this.theProfiler.startSection("cleaning"); -- - NextTickListEntry var4; -- for(int var3 = 0; var3 < var2; ++var3) { -- var4 = (NextTickListEntry)this.M.first(); -- if(!var1 && var4.scheduledTime > this.worldInfo.getWorldTotalTime()) { -+ -+ for (int var3 = 0; var3 < var2; ++var3) { -+ var4 = (NextTickListEntry)this.pendingTickListEntriesTreeSet.first(); -+ -+ if (!par1 && var4.scheduledTime > this.worldInfo.getWorldTotalTime()) { - break; - } - -- this.M.remove(var4); -- this.L.remove(var4); -- this.U.add(var4); -+ this.pendingTickListEntriesTreeSet.remove(var4); -+ this.pendingTickListEntriesHashSet.remove(var4); -+ this.pendingTickListEntriesThisTick.add(var4); - } - - this.theProfiler.endSection(); - this.theProfiler.startSection("ticking"); -- Iterator var14 = this.U.iterator(); -+ Iterator var14 = this.pendingTickListEntriesThisTick.iterator(); - -- while(var14.hasNext()) { -+ while (var14.hasNext()) { - var4 = (NextTickListEntry)var14.next(); - var14.remove(); - byte var5 = 0; -- if(this.checkChunksExist(var4.xCoord - var5, var4.yCoord - var5, var4.zCoord - var5, var4.xCoord + var5, var4.yCoord + var5, var4.zCoord + var5)) { -+ -+ if (this.checkChunksExist(var4.xCoord - var5, var4.yCoord - var5, var4.zCoord - var5, var4.xCoord + var5, var4.yCoord + var5, var4.zCoord + var5)) { - int var6 = this.getBlockId(var4.xCoord, var4.yCoord, var4.zCoord); -- if(var6 > 0 && Block.isAssociatedBlockID(var6, var4.blockID)) { -+ -+ if (var6 > 0 && Block.isAssociatedBlockID(var6, var4.blockID)) { - try { -- Block.blocksList[var6].updateTick(this, var4.xCoord, var4.yCoord, var4.zCoord, this.s); -+ Block.blocksList[var6].updateTick(this, var4.xCoord, var4.yCoord, var4.zCoord, this.rand); - } catch (Throwable var13) { - CrashReport var8 = CrashReport.makeCrashReport(var13, "Exception while ticking a block"); - CrashReportCategory var9 = var8.makeCategory("Block being ticked"); -- - int var10; -+ - try { - var10 = this.getBlockMetadata(var4.xCoord, var4.yCoord, var4.zCoord); - } catch (Throwable var12) { -@@ -402,39 +478,42 @@ - } - - this.theProfiler.endSection(); -- this.U.clear(); -- return !this.M.isEmpty(); -+ this.pendingTickListEntriesThisTick.clear(); -+ return !this.pendingTickListEntriesTreeSet.isEmpty(); - } - } - -- public List getPendingBlockUpdates(Chunk var1, boolean var2) { -+ public List getPendingBlockUpdates(Chunk par1Chunk, boolean par2) { - ArrayList var3 = null; -- ChunkCoordIntPair var4 = var1.getChunkCoordIntPair(); -+ ChunkCoordIntPair var4 = par1Chunk.getChunkCoordIntPair(); - int var5 = (var4.chunkXPos << 4) - 2; - int var6 = var5 + 16 + 2; - int var7 = (var4.chunkZPos << 4) - 2; - int var8 = var7 + 16 + 2; - -- for(int var9 = 0; var9 < 2; ++var9) { -+ for (int var9 = 0; var9 < 2; ++var9) { - Iterator var10; -- if(var9 == 0) { -- var10 = this.M.iterator(); -+ -+ if (var9 == 0) { -+ var10 = this.pendingTickListEntriesTreeSet.iterator(); - } else { -- var10 = this.U.iterator(); -- if(!this.U.isEmpty()) { -- System.out.println(this.U.size()); -+ var10 = this.pendingTickListEntriesThisTick.iterator(); -+ -+ if (!this.pendingTickListEntriesThisTick.isEmpty()) { -+ System.out.println(this.pendingTickListEntriesThisTick.size()); - } - } - -- while(var10.hasNext()) { -+ while (var10.hasNext()) { - NextTickListEntry var11 = (NextTickListEntry)var10.next(); -- if(var11.xCoord >= var5 && var11.xCoord < var6 && var11.zCoord >= var7 && var11.zCoord < var8) { -- if(var2) { -- this.L.remove(var11); -+ -+ if (var11.xCoord >= var5 && var11.xCoord < var6 && var11.zCoord >= var7 && var11.zCoord < var8) { -+ if (par2) { -+ this.pendingTickListEntriesHashSet.remove(var11); - var10.remove(); - } - -- if(var3 == null) { -+ if (var3 == null) { - var3 = new ArrayList(); - } - -@@ -446,30 +525,41 @@ - return var3; - } - -- public void updateEntityWithOptionalForce(Entity var1, boolean var2) { -- if(!this.a.getCanSpawnAnimals() && (var1 instanceof EntityAnimal || var1 instanceof EntityWaterMob)) { -- var1.setDead(); -- } -- -- if(!this.a.getCanSpawnNPCs() && var1 instanceof INpc) { -- var1.setDead(); -- } -- -- super.updateEntityWithOptionalForce(var1, var2); -+ /** -+ * Will update the entity in the world if the chunk the entity is in is currently loaded or its forced to update. Args: -+ * entity, forceUpdate -+ */ -+ public void updateEntityWithOptionalForce(Entity par1Entity, boolean par2) { -+ if (!this.mcServer.getCanSpawnAnimals() && (par1Entity instanceof EntityAnimal || par1Entity instanceof EntityWaterMob)) { -+ par1Entity.setDead(); -+ } -+ -+ if (!this.mcServer.getCanSpawnNPCs() && par1Entity instanceof INpc) { -+ par1Entity.setDead(); -+ } -+ -+ super.updateEntityWithOptionalForce(par1Entity, par2); - } - -+ /** -+ * Creates the chunk provider for this world. Called in the constructor. Retrieves provider from worldProvider? -+ */ - protected IChunkProvider createChunkProvider() { - IChunkLoader var1 = this.saveHandler.getChunkLoader(this.provider); - this.theChunkProviderServer = new ChunkProviderServer(this, var1, this.provider.createChunkGenerator()); - return this.theChunkProviderServer; - } - -- public List getTileEntityList(int var1, int var2, int var3, int var4, int var5, int var6) { -+ /** -+ * pars: min x,y,z , max x,y,z -+ */ -+ public List getAllTileEntityInBox(int par1, int par2, int par3, int par4, int par5, int par6) { - ArrayList var7 = new ArrayList(); - -- for(int var8 = 0; var8 < this.g.size(); ++var8) { -- TileEntity var9 = (TileEntity)this.g.get(var8); -- if(var9.xCoord >= var1 && var9.yCoord >= var2 && var9.zCoord >= var3 && var9.xCoord < var4 && var9.yCoord < var5 && var9.zCoord < var6) { -+ for (int var8 = 0; var8 < this.loadedTileEntityList.size(); ++var8) { -+ TileEntity var9 = (TileEntity)this.loadedTileEntityList.get(var8); -+ -+ if (var9.xCoord >= par1 && var9.yCoord >= par2 && var9.zCoord >= par3 && var9.xCoord < par4 && var9.yCoord < par5 && var9.zCoord < par6) { - var7.add(var9); - } - } -@@ -477,29 +567,35 @@ - return var7; - } - -- public boolean canMineBlock(EntityPlayer var1, int var2, int var3, int var4) { -- return !this.a.isBlockProtected(this, var2, var3, var4, var1); -+ /** -+ * Called when checking if a certain block can be mined or not. The 'spawn safe zone' check is located here. -+ */ -+ public boolean canMineBlock(EntityPlayer par1EntityPlayer, int par2, int par3, int par4) { -+ return !this.mcServer.isBlockProtected(this, par2, par3, par4, par1EntityPlayer); - } - -- protected void initialize(WorldSettings var1) { -- if(this.entityIdMap == null) { -+ protected void initialize(WorldSettings par1WorldSettings) { -+ if (this.entityIdMap == null) { - this.entityIdMap = new IntHashMap(); - } - -- if(this.L == null) { -- this.L = new HashSet(); -- } -- -- if(this.M == null) { -- this.M = new TreeSet(); -- } -- -- this.createSpawnPosition(var1); -- super.initialize(var1); -+ if (this.pendingTickListEntriesHashSet == null) { -+ this.pendingTickListEntriesHashSet = new HashSet(); -+ } -+ -+ if (this.pendingTickListEntriesTreeSet == null) { -+ this.pendingTickListEntriesTreeSet = new TreeSet(); -+ } -+ -+ this.createSpawnPosition(par1WorldSettings); -+ super.initialize(par1WorldSettings); - } - -- protected void createSpawnPosition(WorldSettings var1) { -- if(!this.provider.canRespawnHere()) { -+ /** -+ * creates a spawn position at random within 256 blocks of 0,0 -+ */ -+ protected void createSpawnPosition(WorldSettings par1WorldSettings) { -+ if (!this.provider.canRespawnHere()) { - this.worldInfo.setSpawnPosition(0, this.provider.getAverageGroundLevel(), 0); - } else { - this.findingSpawnPoint = true; -@@ -510,7 +606,8 @@ - int var6 = 0; - int var7 = this.provider.getAverageGroundLevel(); - int var8 = 0; -- if(var5 != null) { -+ -+ if (var5 != null) { - var6 = var5.x; - var8 = var5.z; - } else { -@@ -519,193 +616,247 @@ - - int var9 = 0; - -- while(!this.provider.canCoordinateBeSpawn(var6, var8)) { -+ while (!this.provider.canCoordinateBeSpawn(var6, var8)) { - var6 += var4.nextInt(64) - var4.nextInt(64); - var8 += var4.nextInt(64) - var4.nextInt(64); - ++var9; -- if(var9 == 1000) { -+ -+ if (var9 == 1000) { - break; - } - } - - this.worldInfo.setSpawnPosition(var6, var7, var8); - this.findingSpawnPoint = false; -- if(var1.isBonusChestEnabled()) { -+ -+ if (par1WorldSettings.isBonusChestEnabled()) { - this.createBonusChest(); - } -- - } - } - -+ /** -+ * Creates the bonus chest in the world. -+ */ - protected void createBonusChest() { - WorldGeneratorBonusChest var1 = new WorldGeneratorBonusChest(bonusChestContent, 10); - -- for(int var2 = 0; var2 < 10; ++var2) { -- int var3 = this.worldInfo.getSpawnX() + this.s.nextInt(6) - this.s.nextInt(6); -- int var4 = this.worldInfo.getSpawnZ() + this.s.nextInt(6) - this.s.nextInt(6); -+ for (int var2 = 0; var2 < 10; ++var2) { -+ int var3 = this.worldInfo.getSpawnX() + this.rand.nextInt(6) - this.rand.nextInt(6); -+ int var4 = this.worldInfo.getSpawnZ() + this.rand.nextInt(6) - this.rand.nextInt(6); - int var5 = this.getTopSolidOrLiquidBlock(var3, var4) + 1; -- if(var1.generate(this, this.s, var3, var5, var4)) { -+ -+ if (var1.generate(this, this.rand, var3, var5, var4)) { - break; - } - } -- - } - -+ /** -+ * Gets the hard-coded portal location to use when entering this dimension. -+ */ - public ChunkCoordinates getEntrancePortalLocation() { - return this.provider.getEntrancePortalLocation(); - } - -- public void saveAllChunks(boolean var1, IProgressUpdate var2) throws MinecraftException { -- if(this.chunkProvider.canSave()) { -- if(var2 != null) { -- var2.displaySavingString("Saving level"); -+ /** -+ * Saves all chunks to disk while updating progress bar. -+ */ -+ public void saveAllChunks(boolean par1, IProgressUpdate par2IProgressUpdate) throws MinecraftException { -+ if (this.chunkProvider.canSave()) { -+ if (par2IProgressUpdate != null) { -+ par2IProgressUpdate.displayProgressMessage("Saving level"); - } - - this.saveLevel(); -- if(var2 != null) { -- var2.displayLoadingString("Saving chunks"); -+ -+ if (par2IProgressUpdate != null) { -+ par2IProgressUpdate.resetProgresAndWorkingMessage("Saving chunks"); - } - -- this.chunkProvider.saveChunks(var1, var2); -+ this.chunkProvider.saveChunks(par1, par2IProgressUpdate); - } - } - -+ /** -+ * saves chunk data - currently only called during execution of the Save All command -+ */ - public void saveChunkData() { -- if(this.chunkProvider.canSave()) { -+ if (this.chunkProvider.canSave()) { - this.chunkProvider.saveExtraData(); - } - } - -+ /** -+ * Saves the chunks to disk. -+ */ - protected void saveLevel() throws MinecraftException { - this.checkSessionLock(); -- this.saveHandler.saveWorldInfoWithPlayer(this.worldInfo, this.a.getConfigurationManager().getHostPlayerData()); -+ this.saveHandler.saveWorldInfoWithPlayer(this.worldInfo, this.mcServer.getConfigurationManager().getHostPlayerData()); - this.mapStorage.saveAllData(); - } - -- protected void onEntityAdded(Entity var1) { -- super.onEntityAdded(var1); -- this.entityIdMap.addKey(var1.entityId, var1); -- Entity[] var2 = var1.getParts(); -- if(var2 != null) { -- for(int var3 = 0; var3 < var2.length; ++var3) { -+ // ToDo: Spoutcraft obtainEntitySkin -+ protected void onEntityAdded(Entity par1Entity) { -+ super.onEntityAdded(par1Entity); -+ this.entityIdMap.addKey(par1Entity.entityId, par1Entity); -+ Entity[] var2 = par1Entity.getParts(); -+ -+ if (var2 != null) { -+ for (int var3 = 0; var3 < var2.length; ++var3) { - this.entityIdMap.addKey(var2[var3].entityId, var2[var3]); - } - } -- - } - -- protected void onEntityRemoved(Entity var1) { -- super.onEntityRemoved(var1); -- this.entityIdMap.removeObject(var1.entityId); -- Entity[] var2 = var1.getParts(); -- if(var2 != null) { -- for(int var3 = 0; var3 < var2.length; ++var3) { -+ // ToDo: Spoutcraft releaseEntitySkin -+ protected void onEntityRemoved(Entity par1Entity) { -+ super.onEntityRemoved(par1Entity); -+ this.entityIdMap.removeObject(par1Entity.entityId); -+ Entity[] var2 = par1Entity.getParts(); -+ -+ if (var2 != null) { -+ for (int var3 = 0; var3 < var2.length; ++var3) { - this.entityIdMap.removeObject(var2[var3].entityId); - } - } -- -- } -- -- public Entity getEntityByID(int var1) { -- return (Entity)this.entityIdMap.lookup(var1); -- } -- -- public boolean addWeatherEffect(Entity var1) { -- if(super.addWeatherEffect(var1)) { -- this.a.getConfigurationManager().sendPacketToPlayersAroundPoint(var1.posX, var1.posY, var1.posZ, 512.0D, this.provider.dimensionId, new Packet71Weather(var1)); -+ } -+ -+ /** -+ * Returns the Entity with the given ID, or null if it doesn't exist in this World. -+ */ -+ public Entity getEntityByID(int par1) { -+ return (Entity)this.entityIdMap.lookup(par1); -+ } -+ -+ /** -+ * adds a lightning bolt to the list of lightning bolts in this world. -+ */ -+ public boolean addWeatherEffect(Entity par1Entity) { -+ if (super.addWeatherEffect(par1Entity)) { -+ this.mcServer.getConfigurationManager().sendToAllNear(par1Entity.posX, par1Entity.posY, par1Entity.posZ, 512.0D, this.provider.dimensionId, new Packet71Weather(par1Entity)); - return true; - } else { - return false; - } - } - -- public void setEntityState(Entity var1, byte var2) { -- Packet38EntityStatus var3 = new Packet38EntityStatus(var1.entityId, var2); -- this.getEntityTracker().sendPacketToTrackedPlayersAndTrackedEntity(var1, var3); -+ /** -+ * sends a Packet 38 (Entity Status) to all tracked players of that entity -+ */ -+ public void setEntityState(Entity par1Entity, byte par2) { -+ Packet38EntityStatus var3 = new Packet38EntityStatus(par1Entity.entityId, par2); -+ this.getEntityTracker().sendPacketToAllAssociatedPlayers(par1Entity, var3); - } - -- public Explosion newExplosion(Entity var1, double var2, double var4, double var6, float var8, boolean var9, boolean var10) { -- Explosion var11 = new Explosion(this, var1, var2, var4, var6, var8); -- var11.isFlaming = var9; -- var11.isSmoking = var10; -+ /** -+ * returns a new explosion. Does initiation (at time of writing Explosion is not finished) -+ */ -+ public Explosion newExplosion(Entity par1Entity, double par2, double par4, double par6, float par8, boolean par9, boolean par10) { -+ Explosion var11 = new Explosion(this, par1Entity, par2, par4, par6, par8); -+ var11.isFlaming = par9; -+ var11.isSmoking = par10; - var11.doExplosionA(); - var11.doExplosionB(false); -- if(!var10) { -- var11.h.clear(); -+ -+ if (!par10) { -+ var11.affectedBlockPositions.clear(); - } - -- Iterator var12 = this.h.iterator(); -+ Iterator var12 = this.playerEntities.iterator(); - -- while(var12.hasNext()) { -+ while (var12.hasNext()) { - EntityPlayer var13 = (EntityPlayer)var12.next(); -- if(var13.getDistanceSq(var2, var4, var6) < 4096.0D) { -- ((EntityPlayerMP)var13).playerNetServerHandler.sendPacket(new Packet60Explosion(var2, var4, var6, var8, var11.h, (Vec3)var11.func_77277_b().get(var13))); -+ -+ if (var13.getDistanceSq(par2, par4, par6) < 4096.0D) { -+ ((EntityPlayerMP)var13).playerNetServerHandler.sendPacketToPlayer(new Packet60Explosion(par2, par4, par6, par8, var11.affectedBlockPositions, (Vec3)var11.func_77277_b().get(var13))); - } - } - - return var11; - } - -- public void addBlockEvent(int var1, int var2, int var3, int var4, int var5, int var6) { -- BlockEventData var7 = new BlockEventData(var1, var2, var3, var4, var5, var6); -+ /** -+ * Adds a block event with the given Args to the blockEventCache. During the next tick(), the block specified will have -+ * its onBlockEvent handler called with the given parameters. Args: X,Y,Z, BlockID, EventID, EventParameter -+ */ -+ public void addBlockEvent(int par1, int par2, int par3, int par4, int par5, int par6) { -+ BlockEventData var7 = new BlockEventData(par1, par2, par3, par4, par5, par6); - Iterator var8 = this.blockEventCache[this.blockEventCacheIndex].iterator(); -- - BlockEventData var9; -+ - do { -- if(!var8.hasNext()) { -+ if (!var8.hasNext()) { - this.blockEventCache[this.blockEventCacheIndex].add(var7); - return; - } - - var9 = (BlockEventData)var8.next(); -- } while(!var9.equals(var7)); -- -+ } while (!var9.equals(var7)); - } - -+ /** -+ * Send and apply locally all pending BlockEvents to each player with 64m radius of the event. -+ */ - private void sendAndApplyBlockEvents() { -- while(!this.blockEventCache[this.blockEventCacheIndex].isEmpty()) { -+ while (!this.blockEventCache[this.blockEventCacheIndex].isEmpty()) { - int var1 = this.blockEventCacheIndex; - this.blockEventCacheIndex ^= 1; - Iterator var2 = this.blockEventCache[var1].iterator(); - -- while(var2.hasNext()) { -+ while (var2.hasNext()) { - BlockEventData var3 = (BlockEventData)var2.next(); -- if(this.onBlockEventReceived(var3)) { -- this.a.getConfigurationManager().sendPacketToPlayersAroundPoint((double)var3.getX(), (double)var3.getY(), (double)var3.getZ(), 64.0D, this.provider.dimensionId, new Packet54PlayNoteBlock(var3.getX(), var3.getY(), var3.getZ(), var3.getBlockID(), var3.getEventID(), var3.getEventParameter())); -+ -+ if (this.onBlockEventReceived(var3)) { -+ this.mcServer.getConfigurationManager().sendToAllNear((double)var3.getX(), (double)var3.getY(), (double)var3.getZ(), 64.0D, this.provider.dimensionId, new Packet54PlayNoteBlock(var3.getX(), var3.getY(), var3.getZ(), var3.getBlockID(), var3.getEventID(), var3.getEventParameter())); - } - } - - this.blockEventCache[var1].clear(); - } -- -- } -- -- private boolean onBlockEventReceived(BlockEventData var1) { -- int var2 = this.getBlockId(var1.getX(), var1.getY(), var1.getZ()); -- return var2 == var1.getBlockID() ? Block.blocksList[var2].onBlockEventReceived(this, var1.getX(), var1.getY(), var1.getZ(), var1.getEventID(), var1.getEventParameter()) : false; -- } -- -+ } -+ -+ /** -+ * Called to apply a pending BlockEvent to apply to the current world. -+ */ -+ private boolean onBlockEventReceived(BlockEventData par1BlockEventData) { -+ int var2 = this.getBlockId(par1BlockEventData.getX(), par1BlockEventData.getY(), par1BlockEventData.getZ()); -+ return var2 == par1BlockEventData.getBlockID() ? Block.blocksList[var2].onBlockEventReceived(this, par1BlockEventData.getX(), par1BlockEventData.getY(), par1BlockEventData.getZ(), par1BlockEventData.getEventID(), par1BlockEventData.getEventParameter()) : false; -+ } -+ -+ /** -+ * Syncs all changes to disk and wait for completion. -+ */ - public void flush() { - this.saveHandler.flush(); - } - -+ /** -+ * Updates all weather states. -+ */ - protected void updateWeather() { - boolean var1 = this.isRaining(); - super.updateWeather(); -- if(var1 != this.isRaining()) { -- if(var1) { -- this.a.getConfigurationManager().sendPacketToAllPlayers(new Packet70GameEvent(2, 0)); -+ -+ if (var1 != this.isRaining()) { -+ if (var1) { -+ this.mcServer.getConfigurationManager().sendPacketToAllPlayers(new Packet70GameEvent(2, 0)); - } else { -- this.a.getConfigurationManager().sendPacketToAllPlayers(new Packet70GameEvent(1, 0)); -+ this.mcServer.getConfigurationManager().sendPacketToAllPlayers(new Packet70GameEvent(1, 0)); - } - } -- - } - -+ /** -+ * Gets the MinecraftServer. -+ */ - public MinecraftServer getMinecraftServer() { -- return this.a; -+ return this.mcServer; - } - -+ /** -+ * Gets the EntityTracker -+ */ - public EntityTracker getEntityTracker() { - return this.theEntityTracker; - } ---- /dev/null -+++ org/spoutcraft/client/gui/server/CountryButton.java -@@ -1,0 +1,60 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.client.gui.server; -+ -+import java.util.ArrayList; -+import java.util.List; -+ -+import org.spoutcraft.api.gui.GenericComboBox; -+import org.spoutcraft.client.SpoutClient; -+import org.spoutcraft.client.gui.database.UrlElement; -+ -+public class CountryButton extends GenericComboBox implements UrlElement { -+ ServerListModel model = SpoutClient.getInstance().getServerManager().getServerList(); -+ -+ public CountryButton() { -+ List countries = new ArrayList(); -+ countries.add("All"); -+ countries.addAll(model.getCountries()); -+ setItems(countries); -+ setText("Country"); -+ } -+ -+ public boolean isActive() { -+ return getSelectedRow() != 0; -+ } -+ -+ public String getUrlPart() { -+ return "country=" + getSelectedItem(); -+ } -+ -+ @Override -+ public void onSelectionChanged(int row, String text) { -+ model.updateUrl(); -+ } -+ -+ public void setCurrentCountry(int i) { -+ setSelection(i + 1); -+ } -+ -+ public void clear() { -+ setSelection(0); -+ } -+} ---- /dev/null -+++ org/spoutcraft/client/packet/PacketGenericTool.java -@@ -1,0 +1,52 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.client.packet; -+ -+import java.io.IOException; -+ -+import org.spoutcraft.api.io.SpoutInputStream; -+import org.spoutcraft.api.io.SpoutOutputStream; -+import org.spoutcraft.api.material.item.GenericCustomTool; -+ -+public class PacketGenericTool implements SpoutPacket { -+ GenericCustomTool item = new GenericCustomTool(); -+ -+ public void readData(SpoutInputStream input) throws IOException { -+ item.readData(input); -+ } -+ -+ public void writeData(SpoutOutputStream output) throws IOException { -+ item.writeData(output); -+ } -+ -+ public void run(int playerId) { -+ } -+ -+ public void failure(int playerId) { -+ } -+ -+ public PacketType getPacketType() { -+ return PacketType.PacketGenericTool; -+ } -+ -+ public int getVersion() { -+ return item.getVersion(); -+ } -+} ---- net/minecraft/src/CommandServerBanIp.java -+++ net/minecraft/src/CommandServerBanIp.java -@@ -7,75 +7,88 @@ - import net.minecraft.server.MinecraftServer; - - public class CommandServerBanIp extends CommandBase { -- public static final Pattern a = Pattern.compile("^([01]?\\d\\d?|2[0-4]\\d|25[0-5])\\.([01]?\\d\\d?|2[0-4]\\d|25[0-5])\\.([01]?\\d\\d?|2[0-4]\\d|25[0-5])\\.([01]?\\d\\d?|2[0-4]\\d|25[0-5])$"); -+ public static final Pattern IPv4Pattern = Pattern.compile("^([01]?\\d\\d?|2[0-4]\\d|25[0-5])\\.([01]?\\d\\d?|2[0-4]\\d|25[0-5])\\.([01]?\\d\\d?|2[0-4]\\d|25[0-5])\\.([01]?\\d\\d?|2[0-4]\\d|25[0-5])$"); - - public String getCommandName() { - return "ban-ip"; - } - -+ /** -+ * Return the required permission level for this command. -+ */ - public int getRequiredPermissionLevel() { - return 3; - } - -- public boolean canCommandSenderUseCommand(ICommandSender var1) { -- return MinecraftServer.getServer().getConfigurationManager().getBannedIPs().isListActive() && super.canCommandSenderUseCommand(var1); -+ /** -+ * Returns true if the given command sender is allowed to use this command. -+ */ -+ public boolean canCommandSenderUseCommand(ICommandSender par1ICommandSender) { -+ return MinecraftServer.getServer().getConfigurationManager().getBannedIPs().isListActive() && super.canCommandSenderUseCommand(par1ICommandSender); - } - -- public String getCommandUsage(ICommandSender var1) { -+ public String getCommandUsage(ICommandSender par1ICommandSender) { - return "commands.banip.usage"; - } - -- public void processCommand(ICommandSender var1, String[] var2) { -- if(var2.length >= 1 && var2[0].length() > 1) { -- Matcher var3 = a.matcher(var2[0]); -+ public void processCommand(ICommandSender par1ICommandSender, String[] par2ArrayOfStr) { -+ if (par2ArrayOfStr.length >= 1 && par2ArrayOfStr[0].length() > 1) { -+ Matcher var3 = IPv4Pattern.matcher(par2ArrayOfStr[0]); - String var4 = null; -- if(var2.length >= 2) { -- var4 = func_82360_a(var1, var2, 1); -+ -+ if (par2ArrayOfStr.length >= 2) { -+ var4 = func_82360_a(par1ICommandSender, par2ArrayOfStr, 1); - } - -- if(var3.matches()) { -- this.banIP(var1, var2[0], var4); -+ if (var3.matches()) { -+ this.banIP(par1ICommandSender, par2ArrayOfStr[0], var4); - } else { -- EntityPlayerMP var5 = MinecraftServer.getServer().getConfigurationManager().getPlayerEntity(var2[0]); -- if(var5 == null) { -+ EntityPlayerMP var5 = MinecraftServer.getServer().getConfigurationManager().getPlayerForUsername(par2ArrayOfStr[0]); -+ -+ if (var5 == null) { - throw new PlayerNotFoundException("commands.banip.invalid", new Object[0]); - } - -- this.banIP(var1, var5.getPlayerIP(), var4); -+ this.banIP(par1ICommandSender, var5.getPlayerIP(), var4); - } -- - } else { - throw new WrongUsageException("commands.banip.usage", new Object[0]); - } - } - -- public List addTabCompletionOptions(ICommandSender var1, String[] var2) { -- return var2.length == 1 ? getListOfStringsMatchingLastWord(var2, MinecraftServer.getServer().getAllUsernames()) : null; -+ /** -+ * Adds the strings available in this command to the given list of tab completion options. -+ */ -+ public List addTabCompletionOptions(ICommandSender par1ICommandSender, String[] par2ArrayOfStr) { -+ return par2ArrayOfStr.length == 1 ? getListOfStringsMatchingLastWord(par2ArrayOfStr, MinecraftServer.getServer().getAllUsernames()) : null; - } - -- protected void banIP(ICommandSender var1, String var2, String var3) { -- BanEntry var4 = new BanEntry(var2); -- var4.setBannedBy(var1.getCommandSenderName()); -- if(var3 != null) { -- var4.setBanReason(var3); -+ /** -+ * Actually does the banning work. -+ */ -+ protected void banIP(ICommandSender par1ICommandSender, String par2Str, String par3Str) { -+ BanEntry var4 = new BanEntry(par2Str); -+ var4.setBannedBy(par1ICommandSender.getCommandSenderName()); -+ -+ if (par3Str != null) { -+ var4.setBanReason(par3Str); - } - - MinecraftServer.getServer().getConfigurationManager().getBannedIPs().put(var4); -- List var5 = MinecraftServer.getServer().getConfigurationManager().getPlayerList(var2); -+ List var5 = MinecraftServer.getServer().getConfigurationManager().getPlayerList(par2Str); - String[] var6 = new String[var5.size()]; - int var7 = 0; -- - EntityPlayerMP var9; -- for(Iterator var8 = var5.iterator(); var8.hasNext(); var6[var7++] = var9.getEntityName()) { -+ -+ for (Iterator var8 = var5.iterator(); var8.hasNext(); var6[var7++] = var9.getEntityName()) { - var9 = (EntityPlayerMP)var8.next(); -- var9.playerNetServerHandler.kickPlayer("You have been IP banned."); -+ var9.playerNetServerHandler.kickPlayerFromServer("You have been IP banned."); - } - -- if(var5.isEmpty()) { -- notifyAdmins(var1, "commands.banip.success", new Object[]{var2}); -+ if (var5.isEmpty()) { -+ notifyAdmins(par1ICommandSender, "commands.banip.success", new Object[] {par2Str}); - } else { -- notifyAdmins(var1, "commands.banip.success.players", new Object[]{var2, joinNiceString(var6)}); -+ notifyAdmins(par1ICommandSender, "commands.banip.success.players", new Object[] {par2Str, joinNiceString(var6)}); - } -- - } - } ---- net/minecraft/src/StatList.java -+++ net/minecraft/src/StatList.java -@@ -8,44 +8,103 @@ - import java.util.Map; - - public class StatList { -- protected static Map a = new HashMap(); -- public static List b = new ArrayList(); -- public static List c = new ArrayList(); -- public static List d = new ArrayList(); -- public static List e = new ArrayList(); -+ -+ /** Tracks one-off stats. */ -+ protected static Map oneShotStats = new HashMap(); -+ public static List allStats = new ArrayList(); -+ public static List generalStats = new ArrayList(); -+ public static List itemStats = new ArrayList(); -+ -+ /** Tracks the number of times a given block or item has been mined. */ -+ public static List objectMineStats = new ArrayList(); -+ -+ /** times the game has been started */ - public static StatBase startGameStat = (new StatBasic(1000, "stat.startGame")).initIndependentStat().registerStat(); -+ -+ /** times a world has been created */ - public static StatBase createWorldStat = (new StatBasic(1001, "stat.createWorld")).initIndependentStat().registerStat(); -+ -+ /** the number of times you have loaded a world */ - public static StatBase loadWorldStat = (new StatBasic(1002, "stat.loadWorld")).initIndependentStat().registerStat(); -+ -+ /** number of times you've joined a multiplayer world */ - public static StatBase joinMultiplayerStat = (new StatBasic(1003, "stat.joinMultiplayer")).initIndependentStat().registerStat(); -+ -+ /** number of times you've left a game */ - public static StatBase leaveGameStat = (new StatBasic(1004, "stat.leaveGame")).initIndependentStat().registerStat(); -+ -+ /** number of minutes you have played */ - public static StatBase minutesPlayedStat = (new StatBasic(1100, "stat.playOneMinute", StatBase.timeStatType)).initIndependentStat().registerStat(); -+ -+ /** distance you've walked */ - public static StatBase distanceWalkedStat = (new StatBasic(2000, "stat.walkOneCm", StatBase.distanceStatType)).initIndependentStat().registerStat(); -+ -+ /** distance you have swam */ - public static StatBase distanceSwumStat = (new StatBasic(2001, "stat.swimOneCm", StatBase.distanceStatType)).initIndependentStat().registerStat(); -+ -+ /** the distance you have fallen */ - public static StatBase distanceFallenStat = (new StatBasic(2002, "stat.fallOneCm", StatBase.distanceStatType)).initIndependentStat().registerStat(); -+ -+ /** the distance you've climbed */ - public static StatBase distanceClimbedStat = (new StatBasic(2003, "stat.climbOneCm", StatBase.distanceStatType)).initIndependentStat().registerStat(); -+ -+ /** the distance you've flown */ - public static StatBase distanceFlownStat = (new StatBasic(2004, "stat.flyOneCm", StatBase.distanceStatType)).initIndependentStat().registerStat(); -+ -+ /** the distance you've dived */ - public static StatBase distanceDoveStat = (new StatBasic(2005, "stat.diveOneCm", StatBase.distanceStatType)).initIndependentStat().registerStat(); -+ -+ /** the distance you've traveled by minecart */ - public static StatBase distanceByMinecartStat = (new StatBasic(2006, "stat.minecartOneCm", StatBase.distanceStatType)).initIndependentStat().registerStat(); -+ -+ /** the distance you've traveled by boat */ - public static StatBase distanceByBoatStat = (new StatBasic(2007, "stat.boatOneCm", StatBase.distanceStatType)).initIndependentStat().registerStat(); -+ -+ /** the distance you've traveled by pig */ - public static StatBase distanceByPigStat = (new StatBasic(2008, "stat.pigOneCm", StatBase.distanceStatType)).initIndependentStat().registerStat(); -+ -+ /** the times you've jumped */ - public static StatBase jumpStat = (new StatBasic(2010, "stat.jump")).initIndependentStat().registerStat(); -+ -+ /** the distance you've dropped (or times you've fallen?) */ - public static StatBase dropStat = (new StatBasic(2011, "stat.drop")).initIndependentStat().registerStat(); -+ -+ /** the amount of damage you've dealt */ - public static StatBase damageDealtStat = (new StatBasic(2020, "stat.damageDealt", StatBase.field_111202_k)).registerStat(); -+ -+ /** the amount of damage you have taken */ - public static StatBase damageTakenStat = (new StatBasic(2021, "stat.damageTaken", StatBase.field_111202_k)).registerStat(); -+ -+ /** the number of times you have died */ - public static StatBase deathsStat = (new StatBasic(2022, "stat.deaths")).registerStat(); -+ -+ /** the number of mobs you have killed */ - public static StatBase mobKillsStat = (new StatBasic(2023, "stat.mobKills")).registerStat(); -+ -+ /** counts the number of times you've killed a player */ - public static StatBase playerKillsStat = (new StatBasic(2024, "stat.playerKills")).registerStat(); - public static StatBase fishCaughtStat = (new StatBasic(2025, "stat.fishCaught")).registerStat(); - public static StatBase[] mineBlockStatArray = initMinableStats("stat.mineBlock", 16777216); -+ -+ /** Tracks the number of items a given block or item has been crafted. */ - public static StatBase[] objectCraftStats; -+ -+ /** Tracks the number of times a given block or item has been used. */ - public static StatBase[] objectUseStats; -+ -+ /** Tracks the number of times a given block or item has been broken. */ - public static StatBase[] objectBreakStats; - private static boolean blockStatsInitialized; - private static boolean itemStatsInitialized; - -- public static void nopInit() { -- } -+ /** -+ * This method simply NOPs. It is presumably used to call the static constructors on server start. -+ */ -+ public static void nopInit() {} - -+ /** -+ * Initializes statistic fields related to breakable items and blocks. -+ */ - public static void initBreakableStats() { - objectUseStats = initUsableStats(objectUseStats, "stat.useItem", 16908288, 0, 256); - objectBreakStats = initBreakStats(objectBreakStats, "stat.breakItem", 16973824, 0, 256); -@@ -60,21 +119,26 @@ - initCraftableStats(); - } - -+ /** -+ * Initializes statistics related to craftable items. Is only called after both block and item stats have been -+ * initialized. -+ */ - public static void initCraftableStats() { -- if(blockStatsInitialized && itemStatsInitialized) { -+ if (blockStatsInitialized && itemStatsInitialized) { - HashSet var0 = new HashSet(); - Iterator var1 = CraftingManager.getInstance().getRecipeList().iterator(); - -- while(var1.hasNext()) { -+ while (var1.hasNext()) { - IRecipe var2 = (IRecipe)var1.next(); -- if(var2.getRecipeOutput() != null) { -+ -+ if (var2.getRecipeOutput() != null) { - var0.add(Integer.valueOf(var2.getRecipeOutput().itemID)); - } - } - - var1 = FurnaceRecipes.smelting().getSmeltingList().values().iterator(); - -- while(var1.hasNext()) { -+ while (var1.hasNext()) { - ItemStack var4 = (ItemStack)var1.next(); - var0.add(Integer.valueOf(var4.itemID)); - } -@@ -82,10 +146,11 @@ - objectCraftStats = new StatBase[32000]; - var1 = var0.iterator(); - -- while(var1.hasNext()) { -+ while (var1.hasNext()) { - Integer var5 = (Integer)var1.next(); -- if(Item.itemsList[var5.intValue()] != null) { -- String var3 = StatCollector.translateToLocalFormatted("stat.craftItem", new Object[]{Item.itemsList[var5.intValue()].getStatName()}); -+ -+ if (Item.itemsList[var5.intValue()] != null) { -+ String var3 = StatCollector.translateToLocalFormatted("stat.craftItem", new Object[] {Item.itemsList[var5.intValue()].getStatName()}); - objectCraftStats[var5.intValue()] = (new StatCrafting(16842752 + var5.intValue(), var3, var5.intValue())).registerStat(); - } - } -@@ -94,14 +159,17 @@ - } - } - -- private static StatBase[] initMinableStats(String var0, int var1) { -+ /** -+ * Initializes statistic fields related to minable items and blocks. -+ */ -+ private static StatBase[] initMinableStats(String par0Str, int par1) { - StatBase[] var2 = new StatBase[256]; - -- for(int var3 = 0; var3 < 256; ++var3) { -- if(Block.blocksList[var3] != null && Block.blocksList[var3].getEnableStats()) { -- String var4 = StatCollector.translateToLocalFormatted(var0, new Object[]{Block.blocksList[var3].getLocalizedName()}); -- var2[var3] = (new StatCrafting(var1 + var3, var4, var3)).registerStat(); -- e.add((StatCrafting)var2[var3]); -+ for (int var3 = 0; var3 < 256; ++var3) { -+ if (Block.blocksList[var3] != null && Block.blocksList[var3].getEnableStats()) { -+ String var4 = StatCollector.translateToLocalFormatted(par0Str, new Object[] {Block.blocksList[var3].getLocalizedName()}); -+ var2[var3] = (new StatCrafting(par1 + var3, var4, var3)).registerStat(); -+ objectMineStats.add((StatCrafting)var2[var3]); - } - } - -@@ -109,69 +177,79 @@ - return var2; - } - -- private static StatBase[] initUsableStats(StatBase[] var0, String var1, int var2, int var3, int var4) { -- if(var0 == null) { -- var0 = new StatBase[32000]; -+ /** -+ * Initializes statistic fields related to usable items and blocks. -+ */ -+ private static StatBase[] initUsableStats(StatBase[] par0ArrayOfStatBase, String par1Str, int par2, int par3, int par4) { -+ if (par0ArrayOfStatBase == null) { -+ par0ArrayOfStatBase = new StatBase[32000]; - } - -- for(int var5 = var3; var5 < var4; ++var5) { -- if(Item.itemsList[var5] != null) { -- String var6 = StatCollector.translateToLocalFormatted(var1, new Object[]{Item.itemsList[var5].getStatName()}); -- var0[var5] = (new StatCrafting(var2 + var5, var6, var5)).registerStat(); -- if(var5 >= 256) { -- d.add((StatCrafting)var0[var5]); -+ for (int var5 = par3; var5 < par4; ++var5) { -+ if (Item.itemsList[var5] != null) { -+ String var6 = StatCollector.translateToLocalFormatted(par1Str, new Object[] {Item.itemsList[var5].getStatName()}); -+ par0ArrayOfStatBase[var5] = (new StatCrafting(par2 + var5, var6, var5)).registerStat(); -+ -+ if (var5 >= 256) { -+ itemStats.add((StatCrafting)par0ArrayOfStatBase[var5]); - } - } - } - -- replaceAllSimilarBlocks(var0); -- return var0; -+ replaceAllSimilarBlocks(par0ArrayOfStatBase); -+ return par0ArrayOfStatBase; - } - -- private static StatBase[] initBreakStats(StatBase[] var0, String var1, int var2, int var3, int var4) { -- if(var0 == null) { -- var0 = new StatBase[32000]; -+ private static StatBase[] initBreakStats(StatBase[] par0ArrayOfStatBase, String par1Str, int par2, int par3, int par4) { -+ if (par0ArrayOfStatBase == null) { -+ par0ArrayOfStatBase = new StatBase[32000]; - } - -- for(int var5 = var3; var5 < var4; ++var5) { -- if(Item.itemsList[var5] != null && Item.itemsList[var5].isDamageable()) { -- String var6 = StatCollector.translateToLocalFormatted(var1, new Object[]{Item.itemsList[var5].getStatName()}); -- var0[var5] = (new StatCrafting(var2 + var5, var6, var5)).registerStat(); -+ for (int var5 = par3; var5 < par4; ++var5) { -+ if (Item.itemsList[var5] != null && Item.itemsList[var5].isDamageable()) { -+ String var6 = StatCollector.translateToLocalFormatted(par1Str, new Object[] {Item.itemsList[var5].getStatName()}); -+ par0ArrayOfStatBase[var5] = (new StatCrafting(par2 + var5, var6, var5)).registerStat(); - } - } - -- replaceAllSimilarBlocks(var0); -- return var0; -- } -- -- private static void replaceAllSimilarBlocks(StatBase[] var0) { -- replaceSimilarBlocks(var0, Block.waterStill.blockID, Block.waterMoving.blockID); -- replaceSimilarBlocks(var0, Block.lavaStill.blockID, Block.lavaStill.blockID); -- replaceSimilarBlocks(var0, Block.pumpkinLantern.blockID, Block.pumpkin.blockID); -- replaceSimilarBlocks(var0, Block.furnaceBurning.blockID, Block.furnaceIdle.blockID); -- replaceSimilarBlocks(var0, Block.oreRedstoneGlowing.blockID, Block.oreRedstone.blockID); -- replaceSimilarBlocks(var0, Block.redstoneRepeaterActive.blockID, Block.redstoneRepeaterIdle.blockID); -- replaceSimilarBlocks(var0, Block.torchRedstoneActive.blockID, Block.torchRedstoneIdle.blockID); -- replaceSimilarBlocks(var0, Block.mushroomRed.blockID, Block.mushroomBrown.blockID); -- replaceSimilarBlocks(var0, Block.stoneDoubleSlab.blockID, Block.stoneSingleSlab.blockID); -- replaceSimilarBlocks(var0, Block.woodDoubleSlab.blockID, Block.woodSingleSlab.blockID); -- replaceSimilarBlocks(var0, Block.grass.blockID, Block.dirt.blockID); -- replaceSimilarBlocks(var0, Block.tilledField.blockID, Block.dirt.blockID); -- } -- -- private static void replaceSimilarBlocks(StatBase[] var0, int var1, int var2) { -- if(var0[var1] != null && var0[var2] == null) { -- var0[var2] = var0[var1]; -+ replaceAllSimilarBlocks(par0ArrayOfStatBase); -+ return par0ArrayOfStatBase; -+ } -+ -+ /** -+ * Forces all dual blocks to count for each other on the stats list -+ */ -+ private static void replaceAllSimilarBlocks(StatBase[] par0ArrayOfStatBase) { -+ replaceSimilarBlocks(par0ArrayOfStatBase, Block.waterStill.blockID, Block.waterMoving.blockID); -+ replaceSimilarBlocks(par0ArrayOfStatBase, Block.lavaStill.blockID, Block.lavaStill.blockID); -+ replaceSimilarBlocks(par0ArrayOfStatBase, Block.pumpkinLantern.blockID, Block.pumpkin.blockID); -+ replaceSimilarBlocks(par0ArrayOfStatBase, Block.furnaceBurning.blockID, Block.furnaceIdle.blockID); -+ replaceSimilarBlocks(par0ArrayOfStatBase, Block.oreRedstoneGlowing.blockID, Block.oreRedstone.blockID); -+ replaceSimilarBlocks(par0ArrayOfStatBase, Block.redstoneRepeaterActive.blockID, Block.redstoneRepeaterIdle.blockID); -+ replaceSimilarBlocks(par0ArrayOfStatBase, Block.torchRedstoneActive.blockID, Block.torchRedstoneIdle.blockID); -+ replaceSimilarBlocks(par0ArrayOfStatBase, Block.mushroomRed.blockID, Block.mushroomBrown.blockID); -+ replaceSimilarBlocks(par0ArrayOfStatBase, Block.stoneDoubleSlab.blockID, Block.stoneSingleSlab.blockID); -+ replaceSimilarBlocks(par0ArrayOfStatBase, Block.woodDoubleSlab.blockID, Block.woodSingleSlab.blockID); -+ replaceSimilarBlocks(par0ArrayOfStatBase, Block.grass.blockID, Block.dirt.blockID); -+ replaceSimilarBlocks(par0ArrayOfStatBase, Block.tilledField.blockID, Block.dirt.blockID); -+ } -+ -+ /** -+ * Forces stats for one block to add to another block, such as idle and active furnaces -+ */ -+ private static void replaceSimilarBlocks(StatBase[] par0ArrayOfStatBase, int par1, int par2) { -+ if (par0ArrayOfStatBase[par1] != null && par0ArrayOfStatBase[par2] == null) { -+ par0ArrayOfStatBase[par2] = par0ArrayOfStatBase[par1]; - } else { -- b.remove(var0[var1]); -- e.remove(var0[var1]); -- c.remove(var0[var1]); -- var0[var1] = var0[var2]; -+ allStats.remove(par0ArrayOfStatBase[par1]); -+ objectMineStats.remove(par0ArrayOfStatBase[par1]); -+ generalStats.remove(par0ArrayOfStatBase[par1]); -+ par0ArrayOfStatBase[par1] = par0ArrayOfStatBase[par2]; - } - } - -- public static StatBase getOneShotStat(int var0) { -- return (StatBase)a.get(Integer.valueOf(var0)); -+ public static StatBase getOneShotStat(int par0) { -+ return (StatBase)oneShotStats.get(Integer.valueOf(par0)); - } - - static { ---- /dev/null -+++ org/spoutcraft/client/player/accessories/TopHat.java -@@ -1,0 +1,56 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.client.player.accessories; -+ -+import net.minecraft.src.EntityPlayer; -+import net.minecraft.src.ModelBiped; -+import net.minecraft.src.ModelRenderer; -+ -+public class TopHat extends Accessory{ -+ public ModelRenderer bipedBottomHat; -+ public ModelRenderer bipedTopHat; -+ -+ public TopHat(ModelBiped model) { -+ super(model); -+ bipedBottomHat = new ModelRenderer(model, 0, 0); -+ bipedBottomHat.addBox(-5.5F, -9F, -5.5F, 11, 2, 11); -+ bipedTopHat = new ModelRenderer(model, 0, 13); -+ bipedTopHat.addBox(-3.5F, -17F, -3.5F, 7, 8, 7); -+ } -+ -+ @Override -+ public void render(EntityPlayer plr, float f) { -+ bipedBottomHat.rotateAngleY = getModel().bipedHead.rotateAngleY; -+ bipedBottomHat.rotateAngleX = getModel().bipedHead.rotateAngleX; -+ bipedBottomHat.rotationPointX = 0.0F; -+ bipedBottomHat.rotationPointY = 0.0F; -+ bipedBottomHat.render(f); -+ bipedTopHat.rotateAngleY = getModel().bipedHead.rotateAngleY; -+ bipedTopHat.rotateAngleX = getModel().bipedHead.rotateAngleX; -+ bipedTopHat.rotationPointX = 0.0F; -+ bipedTopHat.rotationPointY = 0.0F; -+ bipedTopHat.render(f); -+ } -+ -+ @Override -+ public AccessoryType getType() { -+ return AccessoryType.TOPHAT; -+ } -+} ---- net/minecraft/src/BlockWall.java -+++ net/minecraft/src/BlockWall.java -@@ -3,84 +3,111 @@ - import java.util.List; - - public class BlockWall extends Block { -- public static final String[] a = new String[]{"normal", "mossy"}; -- -- public BlockWall(int var1, Block var2) { -- super(var1, var2.blockMaterial); -- this.setHardness(var2.blockHardness); -- this.setResistance(var2.blockResistance / 3.0F); -- this.setStepSound(var2.stepSound); -+ -+ /** The types of the wall. */ -+ public static final String[] types = new String[] {"normal", "mossy"}; -+ -+ public BlockWall(int par1, Block par2Block) { -+ super(par1, par2Block.blockMaterial); -+ this.setHardness(par2Block.blockHardness); -+ this.setResistance(par2Block.blockResistance / 3.0F); -+ this.setStepSound(par2Block.stepSound); - this.setCreativeTab(CreativeTabs.tabBlock); - } - -- public Icon getIcon(int var1, int var2) { -- return var2 == 1 ? Block.cobblestoneMossy.getBlockTextureFromSide(var1) : Block.cobblestone.getBlockTextureFromSide(var1); -+ /** -+ * From the specified side and block metadata retrieves the blocks texture. Args: side, metadata -+ */ -+ public Icon getIcon(int par1, int par2) { -+ return par2 == 1 ? Block.cobblestoneMossy.getBlockTextureFromSide(par1) : Block.cobblestone.getBlockTextureFromSide(par1); - } - -+ /** -+ * The type of render function that is called for this block -+ */ - public int getRenderType() { - return 32; - } - -+ /** -+ * If this block doesn't render as an ordinary block it will return False (examples: signs, buttons, stairs, etc) -+ */ - public boolean renderAsNormalBlock() { - return false; - } - -- public boolean getBlocksMovement(IBlockAccess var1, int var2, int var3, int var4) { -+ public boolean getBlocksMovement(IBlockAccess par1IBlockAccess, int par2, int par3, int par4) { - return false; - } - -+ /** -+ * Is this block (a) opaque and (b) a full 1m cube? This determines whether or not to render the shared face of two -+ * adjacent blocks and also whether the player can attach torches, redstone wire, etc to this block. -+ */ - public boolean isOpaqueCube() { - return false; - } - -- public void setBlockBoundsBasedOnState(IBlockAccess var1, int var2, int var3, int var4) { -- boolean var5 = this.canConnectWallTo(var1, var2, var3, var4 - 1); -- boolean var6 = this.canConnectWallTo(var1, var2, var3, var4 + 1); -- boolean var7 = this.canConnectWallTo(var1, var2 - 1, var3, var4); -- boolean var8 = this.canConnectWallTo(var1, var2 + 1, var3, var4); -+ /** -+ * Updates the blocks bounds based on its current state. Args: world, x, y, z -+ */ -+ public void setBlockBoundsBasedOnState(IBlockAccess par1IBlockAccess, int par2, int par3, int par4) { -+ boolean var5 = this.canConnectWallTo(par1IBlockAccess, par2, par3, par4 - 1); -+ boolean var6 = this.canConnectWallTo(par1IBlockAccess, par2, par3, par4 + 1); -+ boolean var7 = this.canConnectWallTo(par1IBlockAccess, par2 - 1, par3, par4); -+ boolean var8 = this.canConnectWallTo(par1IBlockAccess, par2 + 1, par3, par4); - float var9 = 0.25F; -- float var10 = 12.0F / 16.0F; -+ float var10 = 0.75F; - float var11 = 0.25F; -- float var12 = 12.0F / 16.0F; -+ float var12 = 0.75F; - float var13 = 1.0F; -- if(var5) { -+ -+ if (var5) { - var11 = 0.0F; - } - -- if(var6) { -+ if (var6) { - var12 = 1.0F; - } - -- if(var7) { -+ if (var7) { - var9 = 0.0F; - } - -- if(var8) { -+ if (var8) { - var10 = 1.0F; - } - -- if(var5 && var6 && !var7 && !var8) { -- var13 = 13.0F / 16.0F; -- var9 = 5.0F / 16.0F; -- var10 = 11.0F / 16.0F; -- } else if(!var5 && !var6 && var7 && var8) { -- var13 = 13.0F / 16.0F; -- var11 = 5.0F / 16.0F; -- var12 = 11.0F / 16.0F; -+ if (var5 && var6 && !var7 && !var8) { -+ var13 = 0.8125F; -+ var9 = 0.3125F; -+ var10 = 0.6875F; -+ } else if (!var5 && !var6 && var7 && var8) { -+ var13 = 0.8125F; -+ var11 = 0.3125F; -+ var12 = 0.6875F; - } - - this.setBlockBounds(var9, 0.0F, var11, var10, var13, var12); - } - -- public AxisAlignedBB getCollisionBoundingBoxFromPool(World var1, int var2, int var3, int var4) { -- this.setBlockBoundsBasedOnState(var1, var2, var3, var4); -+ /** -+ * Returns a bounding box from the pool of bounding boxes (this means this box can change after the pool has been -+ * cleared to be reused) -+ */ -+ public AxisAlignedBB getCollisionBoundingBoxFromPool(World par1World, int par2, int par3, int par4) { -+ this.setBlockBoundsBasedOnState(par1World, par2, par3, par4); - this.maxY = 1.5D; -- return super.getCollisionBoundingBoxFromPool(var1, var2, var3, var4); -+ return super.getCollisionBoundingBoxFromPool(par1World, par2, par3, par4); - } - -- public boolean canConnectWallTo(IBlockAccess var1, int var2, int var3, int var4) { -- int var5 = var1.getBlockId(var2, var3, var4); -- if(var5 != this.blockID && var5 != Block.fenceGate.blockID) { -+ /** -+ * Return whether an adjacent block can connect to a wall. -+ */ -+ public boolean canConnectWallTo(IBlockAccess par1IBlockAccess, int par2, int par3, int par4) { -+ int var5 = par1IBlockAccess.getBlockId(par2, par3, par4); -+ -+ if (var5 != this.blockID && var5 != Block.fenceGate.blockID) { - Block var6 = Block.blocksList[var5]; - return var6 != null && var6.blockMaterial.isOpaque() && var6.renderAsNormalBlock() ? var6.blockMaterial != Material.pumpkin : false; - } else { -@@ -88,19 +115,32 @@ - } - } - -- public void getSubBlocks(int var1, CreativeTabs var2, List var3) { -- var3.add(new ItemStack(var1, 1, 0)); -- var3.add(new ItemStack(var1, 1, 1)); -- } -- -- public int damageDropped(int var1) { -- return var1; -- } -- -- public boolean shouldSideBeRendered(IBlockAccess var1, int var2, int var3, int var4, int var5) { -- return var5 == 0 ? super.shouldSideBeRendered(var1, var2, var3, var4, var5) : true; -- } -- -- public void registerIcons(IconRegister var1) { -- } -+ /** -+ * returns a list of blocks with the same ID, but different meta (eg: wood returns 4 blocks) -+ */ -+ public void getSubBlocks(int par1, CreativeTabs par2CreativeTabs, List par3List) { -+ par3List.add(new ItemStack(par1, 1, 0)); -+ par3List.add(new ItemStack(par1, 1, 1)); -+ } -+ -+ /** -+ * Determines the damage on the item the block drops. Used in cloth and wood. -+ */ -+ public int damageDropped(int par1) { -+ return par1; -+ } -+ -+ /** -+ * Returns true if the given side of this block type should be rendered, if the adjacent block is at the given -+ * coordinates. Args: blockAccess, x, y, z, side -+ */ -+ public boolean shouldSideBeRendered(IBlockAccess par1IBlockAccess, int par2, int par3, int par4, int par5) { -+ return par5 == 0 ? super.shouldSideBeRendered(par1IBlockAccess, par2, par3, par4, par5) : true; -+ } -+ -+ /** -+ * When this method is called, your block should register all the icons it needs with the given IconRegister. This is -+ * the only chance you get to register icons. -+ */ -+ public void registerIcons(IconRegister par1IconRegister) {} - } ---- /dev/null -+++ org/spoutcraft/client/gui/settings/controls/FancyItemsButton.java -@@ -1,0 +1,41 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.client.gui.settings.controls; -+ -+import java.util.UUID; -+ -+import org.spoutcraft.client.config.Configuration; -+ -+public class FancyItemsButton extends AutomatedCheckBox { -+ UUID fancyGraphics; -+ public FancyItemsButton(UUID fancyGraphics) { -+ super("Fancy Items"); -+ this.fancyGraphics = fancyGraphics; -+ setChecked(Configuration.isFancyItems()); -+ setTooltip("Fancy Items\nFast - lower quality, faster\nFancy - higher quality, slower\nFancy Items are rendered 2D.\nRancy Items are rendered 3D."); -+ } -+ -+ @Override -+ public void onButtonClick() { -+ Configuration.setFancyItems(!Configuration.isFancyItems()); -+ Configuration.write(); -+ ((FancyGraphicsButton)getScreen().getWidget(fancyGraphics)).custom = true; -+ } -+} ---- net/minecraft/src/ExceptionRetryCall.java -+++ net/minecraft/src/ExceptionRetryCall.java -@@ -3,8 +3,8 @@ - public class ExceptionRetryCall extends ExceptionMcoService { - public final int field_96393_c; - -- public ExceptionRetryCall(int var1) { -+ public ExceptionRetryCall(int par1) { - super(503, "Retry operation", -1); -- this.field_96393_c = var1; -+ this.field_96393_c = par1; - } - } ---- net/minecraft/src/WorldGenSand.java -+++ net/minecraft/src/WorldGenSand.java -@@ -3,30 +3,36 @@ - import java.util.Random; - - public class WorldGenSand extends WorldGenerator { -+ -+ /** Stores ID for WorldGenSand */ - private int sandID; -+ -+ /** The maximum radius used when generating a patch of blocks. */ - private int radius; - -- public WorldGenSand(int var1, int var2) { -- this.sandID = var2; -- this.radius = var1; -+ public WorldGenSand(int par1, int par2) { -+ this.sandID = par2; -+ this.radius = par1; - } - -- public boolean generate(World var1, Random var2, int var3, int var4, int var5) { -- if(var1.getBlockMaterial(var3, var4, var5) != Material.water) { -+ public boolean generate(World par1World, Random par2Random, int par3, int par4, int par5) { -+ if (par1World.getBlockMaterial(par3, par4, par5) != Material.water) { - return false; - } else { -- int var6 = var2.nextInt(this.radius - 2) + 2; -+ int var6 = par2Random.nextInt(this.radius - 2) + 2; - byte var7 = 2; - -- for(int var8 = var3 - var6; var8 <= var3 + var6; ++var8) { -- for(int var9 = var5 - var6; var9 <= var5 + var6; ++var9) { -- int var10 = var8 - var3; -- int var11 = var9 - var5; -- if(var10 * var10 + var11 * var11 <= var6 * var6) { -- for(int var12 = var4 - var7; var12 <= var4 + var7; ++var12) { -- int var13 = var1.getBlockId(var8, var12, var9); -- if(var13 == Block.dirt.blockID || var13 == Block.grass.blockID) { -- var1.setBlock(var8, var12, var9, this.sandID, 0, 2); -+ for (int var8 = par3 - var6; var8 <= par3 + var6; ++var8) { -+ for (int var9 = par5 - var6; var9 <= par5 + var6; ++var9) { -+ int var10 = var8 - par3; -+ int var11 = var9 - par5; -+ -+ if (var10 * var10 + var11 * var11 <= var6 * var6) { -+ for (int var12 = par4 - var7; var12 <= par4 + var7; ++var12) { -+ int var13 = par1World.getBlockId(var8, var12, var9); -+ -+ if (var13 == Block.dirt.blockID || var13 == Block.grass.blockID) { -+ par1World.setBlock(var8, var12, var9, this.sandID, 0, 2); - } - } - } ---- net/minecraft/src/RenderLiving.java -+++ net/minecraft/src/RenderLiving.java -@@ -2,108 +2,117 @@ - - import org.lwjgl.opengl.GL11; - -+import com.prupe.mcpatcher.mob.LineRenderer; -+ - public abstract class RenderLiving extends RendererLivingEntity { -- public RenderLiving(ModelBase var1, float var2) { -- super(var1, var2); -- } -- -- protected boolean func_130007_b(EntityLiving var1) { -- return super.func_110813_b(var1) && (var1.getAlwaysRenderNameTagForRender() || var1.hasCustomNameTag() && var1 == this.renderManager.field_96451_i); -- } -- -- public void doRenderLiving(EntityLiving var1, double var2, double var4, double var6, float var8, float var9) { -- super.doRenderLiving(var1, var2, var4, var6, var8, var9); -- this.func_110827_b(var1, var2, var4, var6, var8, var9); -- } -- -- private double func_110828_a(double var1, double var3, double var5) { -- return var1 + (var3 - var1) * var5; -- } -- -- protected void func_110827_b(EntityLiving var1, double var2, double var4, double var6, float var8, float var9) { -- Entity var10 = var1.getLeashedToEntity(); -- if(var10 != null) { -- var4 -= (1.6D - (double)var1.height) * 0.5D; -+ public RenderLiving(ModelBase par1ModelBase, float par2) { -+ super(par1ModelBase, par2); -+ } -+ -+ protected boolean func_130007_b(EntityLiving par1EntityLiving) { -+ return super.specialRender(par1EntityLiving) && (par1EntityLiving.getAlwaysRenderNameTagForRender() || par1EntityLiving.hasCustomNameTag() && par1EntityLiving == this.renderManager.field_96451_i); -+ } -+ -+ public void doRenderLiving(EntityLiving par1EntityLiving, double par2, double par4, double par6, float par8, float par9) { -+ super.doRenderLiving(par1EntityLiving, par2, par4, par6, par8, par9); -+ this.func_110827_b(par1EntityLiving, par2, par4, par6, par8, par9); -+ } -+ -+ private double func_110828_a(double par1, double par3, double par5) { -+ return par1 + (par3 - par1) * par5; -+ } -+ -+ protected void func_110827_b(EntityLiving par1EntityLiving, double par2, double par4, double par6, float par8, float par9) { -+ Entity var10 = par1EntityLiving.getLeashedToEntity(); -+ -+ if (var10 != null) { -+ par4 -= (1.6D - (double)par1EntityLiving.height) * 0.5D; - Tessellator var11 = Tessellator.instance; -- double var12 = this.func_110828_a((double)var10.prevRotationYaw, (double)var10.rotationYaw, (double)(var9 * 0.5F)) * (double)0.017453292F; -- double var14 = this.func_110828_a((double)var10.prevRotationPitch, (double)var10.rotationPitch, (double)(var9 * 0.5F)) * (double)0.017453292F; -+ double var12 = this.func_110828_a((double)var10.prevRotationYaw, (double)var10.rotationYaw, (double)(par9 * 0.5F)) * 0.01745329238474369D; -+ double var14 = this.func_110828_a((double)var10.prevRotationPitch, (double)var10.rotationPitch, (double)(par9 * 0.5F)) * 0.01745329238474369D; - double var16 = Math.cos(var12); - double var18 = Math.sin(var12); - double var20 = Math.sin(var14); -- if(var10 instanceof EntityHanging) { -+ -+ if (var10 instanceof EntityHanging) { - var16 = 0.0D; - var18 = 0.0D; - var20 = -1.0D; - } - - double var22 = Math.cos(var14); -- double var24 = this.func_110828_a(var10.prevPosX, var10.posX, (double)var9) - var16 * 0.7D - var18 * 0.5D * var22; -- double var26 = this.func_110828_a(var10.prevPosY + (double)var10.getEyeHeight() * 0.7D, var10.posY + (double)var10.getEyeHeight() * 0.7D, (double)var9) - var20 * 0.5D - 0.25D; -- double var28 = this.func_110828_a(var10.prevPosZ, var10.posZ, (double)var9) - var18 * 0.7D + var16 * 0.5D * var22; -- double var30 = this.func_110828_a((double)var1.prevRenderYawOffset, (double)var1.renderYawOffset, (double)var9) * (double)0.017453292F + Math.PI * 0.5D; -- var16 = Math.cos(var30) * (double)var1.width * 0.4D; -- var18 = Math.sin(var30) * (double)var1.width * 0.4D; -- double var32 = this.func_110828_a(var1.prevPosX, var1.posX, (double)var9) + var16; -- double var34 = this.func_110828_a(var1.prevPosY, var1.posY, (double)var9); -- double var36 = this.func_110828_a(var1.prevPosZ, var1.posZ, (double)var9) + var18; -- var2 += var16; -- var6 += var18; -+ double var24 = this.func_110828_a(var10.prevPosX, var10.posX, (double)par9) - var16 * 0.7D - var18 * 0.5D * var22; -+ double var26 = this.func_110828_a(var10.prevPosY + (double)var10.getEyeHeight() * 0.7D, var10.posY + (double)var10.getEyeHeight() * 0.7D, (double)par9) - var20 * 0.5D - 0.25D; -+ double var28 = this.func_110828_a(var10.prevPosZ, var10.posZ, (double)par9) - var18 * 0.7D + var16 * 0.5D * var22; -+ double var30 = this.func_110828_a((double)par1EntityLiving.prevRenderYawOffset, (double)par1EntityLiving.renderYawOffset, (double)par9) * 0.01745329238474369D + (Math.PI / 2D); -+ var16 = Math.cos(var30) * (double)par1EntityLiving.width * 0.4D; -+ var18 = Math.sin(var30) * (double)par1EntityLiving.width * 0.4D; -+ double var32 = this.func_110828_a(par1EntityLiving.prevPosX, par1EntityLiving.posX, (double)par9) + var16; -+ double var34 = this.func_110828_a(par1EntityLiving.prevPosY, par1EntityLiving.posY, (double)par9); -+ double var36 = this.func_110828_a(par1EntityLiving.prevPosZ, par1EntityLiving.posZ, (double)par9) + var18; -+ par2 += var16; -+ par6 += var18; - double var38 = (double)((float)(var24 - var32)); - double var40 = (double)((float)(var26 - var34)); - double var42 = (double)((float)(var28 - var36)); -- GL11.glDisable(GL11.GL_TEXTURE_2D); -- GL11.glDisable(GL11.GL_LIGHTING); -- GL11.glDisable(GL11.GL_CULL_FACE); -- boolean var44 = true; -- double var45 = 0.025D; -- var11.startDrawing(5); -- -- int var47; -- float var48; -- for(var47 = 0; var47 <= 24; ++var47) { -- if(var47 % 2 == 0) { -- var11.setColorRGBA_F(0.5F, 0.4F, 0.3F, 1.0F); -- } else { -- var11.setColorRGBA_F(0.35F, 0.28F, 0.21000001F, 1.0F); -- } -- -- var48 = (float)var47 / 24.0F; -- var11.addVertex(var2 + var38 * (double)var48 + 0.0D, var4 + var40 * (double)(var48 * var48 + var48) * 0.5D + (double)((24.0F - (float)var47) / 18.0F + 2.0F / 16.0F), var6 + var42 * (double)var48); -- var11.addVertex(var2 + var38 * (double)var48 + 0.025D, var4 + var40 * (double)(var48 * var48 + var48) * 0.5D + (double)((24.0F - (float)var47) / 18.0F + 2.0F / 16.0F) + 0.025D, var6 + var42 * (double)var48); -- } -- -- var11.draw(); -- var11.startDrawing(5); -- -- for(var47 = 0; var47 <= 24; ++var47) { -- if(var47 % 2 == 0) { -- var11.setColorRGBA_F(0.5F, 0.4F, 0.3F, 1.0F); -- } else { -- var11.setColorRGBA_F(0.35F, 0.28F, 0.21000001F, 1.0F); -- } -- -- var48 = (float)var47 / 24.0F; -- var11.addVertex(var2 + var38 * (double)var48 + 0.0D, var4 + var40 * (double)(var48 * var48 + var48) * 0.5D + (double)((24.0F - (float)var47) / 18.0F + 2.0F / 16.0F) + 0.025D, var6 + var42 * (double)var48); -- var11.addVertex(var2 + var38 * (double)var48 + 0.025D, var4 + var40 * (double)(var48 * var48 + var48) * 0.5D + (double)((24.0F - (float)var47) / 18.0F + 2.0F / 16.0F), var6 + var42 * (double)var48 + 0.025D); -- } -- -- var11.draw(); -- GL11.glEnable(GL11.GL_LIGHTING); -- GL11.glEnable(GL11.GL_TEXTURE_2D); -+ -+ if (!LineRenderer.renderLine(1, par2, par4, par6, var38, var40, var42)) { -+ GL11.glDisable(GL11.GL_TEXTURE_2D); -+ GL11.glDisable(GL11.GL_LIGHTING); -+ GL11.glDisable(GL11.GL_CULL_FACE); -+ boolean var44 = true; -+ double var45 = 0.025D; -+ var11.startDrawing(5); -+ int var47; -+ float var48; -+ -+ for (var47 = 0; var47 <= 24; ++var47) { -+ if (var47 % 2 == 0) { -+ var11.setColorRGBA_F(0.5F, 0.4F, 0.3F, 1.0F); -+ } else { -+ var11.setColorRGBA_F(0.35F, 0.28F, 0.21000001F, 1.0F); -+ } -+ -+ var48 = (float)var47 / 24.0F; -+ var11.addVertex(par2 + var38 * (double)var48 + 0.0D, par4 + var40 * (double)(var48 * var48 + var48) * 0.5D + (double)((24.0F - (float)var47) / 18.0F + 0.125F), par6 + var42 * (double)var48); -+ var11.addVertex(par2 + var38 * (double)var48 + 0.025D, par4 + var40 * (double)(var48 * var48 + var48) * 0.5D + (double)((24.0F - (float)var47) / 18.0F + 0.125F) + 0.025D, par6 + var42 * (double)var48); -+ } -+ -+ var11.draw(); -+ var11.startDrawing(5); -+ -+ for (var47 = 0; var47 <= 24; ++var47) { -+ if (var47 % 2 == 0) { -+ var11.setColorRGBA_F(0.5F, 0.4F, 0.3F, 1.0F); -+ } else { -+ var11.setColorRGBA_F(0.35F, 0.28F, 0.21000001F, 1.0F); -+ } -+ -+ var48 = (float)var47 / 24.0F; -+ var11.addVertex(par2 + var38 * (double)var48 + 0.0D, par4 + var40 * (double)(var48 * var48 + var48) * 0.5D + (double)((24.0F - (float)var47) / 18.0F + 0.125F) + 0.025D, par6 + var42 * (double)var48); -+ var11.addVertex(par2 + var38 * (double)var48 + 0.025D, par4 + var40 * (double)(var48 * var48 + var48) * 0.5D + (double)((24.0F - (float)var47) / 18.0F + 0.125F), par6 + var42 * (double)var48 + 0.025D); -+ } -+ -+ var11.draw(); -+ GL11.glEnable(GL11.GL_LIGHTING); -+ GL11.glEnable(GL11.GL_TEXTURE_2D); -+ } -+ - GL11.glEnable(GL11.GL_CULL_FACE); - } -- -- } -- -- protected boolean func_110813_b(EntityLivingBase var1) { -- return this.func_130007_b((EntityLiving)var1); -- } -- -- public void renderPlayer(EntityLivingBase var1, double var2, double var4, double var6, float var8, float var9) { -- this.doRenderLiving((EntityLiving)var1, var2, var4, var6, var8, var9); -- } -- -- public void doRender(Entity var1, double var2, double var4, double var6, float var8, float var9) { -- this.doRenderLiving((EntityLiving)var1, var2, var4, var6, var8, var9); -+ } -+ -+ public void renderPlayer(EntityLivingBase par1EntityLivingBase, double par2, double par4, double par6, float par8, float par9) { -+ this.doRenderLiving((EntityLiving)par1EntityLivingBase, par2, par4, par6, par8, par9); -+ } -+ -+ /** -+ * Actually renders the given argument. This is a synthetic bridge method, always casting down its argument and then -+ * handing it off to a worker function which does the actual work. In all probabilty, the class Render is generic -+ * (Render= 10) { -+ -+ if (var1 >= 10) { - return; - } - } - } -- - } - -- public void doPreChunk(int var1, int var2, boolean var3) { -- if(var3) { -- this.clientChunkProvider.loadChunk(var1, var2); -+ public void doPreChunk(int par1, int par2, boolean par3) { -+ if (par3) { -+ this.clientChunkProvider.loadChunk(par1, par2); -+ // Spout Start -+ SpoutClient.getInstance().getPacketManager().sendSpoutPacket(new PacketCustomBlockChunkOverride(par1, par2)); -+ // Spout End - } else { -- this.clientChunkProvider.unloadChunk(var1, var2); -- } -- -- if(!var3) { -- this.markBlockRangeForRenderUpdate(var1 * 16, 0, var2 * 16, var1 * 16 + 15, 256, var2 * 16 + 15); -- } -- -+ this.clientChunkProvider.unloadChunk(par1, par2); -+ } -+ -+ if (!par3) { -+ this.markBlockRangeForRenderUpdate(par1 * 16, 0, par2 * 16, par1 * 16 + 15, 256, par2 * 16 + 15); -+ } - } - -- public boolean spawnEntityInWorld(Entity var1) { -- boolean var2 = super.spawnEntityInWorld(var1); -- this.J.add(var1); -- if(!var2) { -- this.K.add(var1); -+ /** -+ * Called to place all entities as part of a world -+ */ -+ public boolean spawnEntityInWorld(Entity par1Entity) { -+ boolean var2 = super.spawnEntityInWorld(par1Entity); -+ this.entityList.add(par1Entity); -+ -+ if (!var2) { -+ this.entitySpawnQueue.add(par1Entity); - } - - return var2; - } - -- public void removeEntity(Entity var1) { -- super.removeEntity(var1); -- this.J.remove(var1); -+ /** -+ * Schedule the entity for removal during the next tick. Marks the entity dead in anticipation. -+ */ -+ public void removeEntity(Entity par1Entity) { -+ super.removeEntity(par1Entity); -+ this.entityList.remove(par1Entity); - } - -- protected void onEntityAdded(Entity var1) { -- super.onEntityAdded(var1); -- if(this.K.contains(var1)) { -- this.K.remove(var1); -+ //ToDo: was Spoutcraft obtainEntitySkin -+ protected void onEntityAdded(Entity par1Entity) { -+ super.onEntityAdded(par1Entity); -+ -+ if (this.entitySpawnQueue.contains(par1Entity)) { -+ this.entitySpawnQueue.remove(par1Entity); - } -- - } - -- protected void onEntityRemoved(Entity var1) { -- super.onEntityRemoved(var1); -- if(this.J.contains(var1)) { -- if(var1.isEntityAlive()) { -- this.K.add(var1); -+ //ToDO: was Spoutcraft releaseEntitySkin -+ protected void onEntityRemoved(Entity par1Entity) { -+ super.onEntityRemoved(par1Entity); -+ -+ if (this.entityList.contains(par1Entity)) { -+ if (par1Entity.isEntityAlive()) { -+ this.entitySpawnQueue.add(par1Entity); - } else { -- this.J.remove(var1); -+ this.entityList.remove(par1Entity); - } - } -- - } - -- public void addEntityToWorld(int var1, Entity var2) { -- Entity var3 = this.getEntityByID(var1); -- if(var3 != null) { -+ -+ /** -+ * Add an ID to Entity mapping to entityHashSet -+ */ -+ public void addEntityToWorld(int par1, Entity par2Entity) { -+ Entity var3 = this.getEntityByID(par1); -+ -+ if (var3 != null) { - this.removeEntity(var3); - } - -- this.J.add(var2); -- var2.entityId = var1; -- if(!this.spawnEntityInWorld(var2)) { -- this.K.add(var2); -+ this.entityList.add(par2Entity); -+ par2Entity.entityId = par1; -+ -+ if (!this.spawnEntityInWorld(par2Entity)) { -+ this.entitySpawnQueue.add(par2Entity); - } - -- this.entityHashSet.addKey(var1, var2); -- } -- -- public Entity getEntityByID(int var1) { -- return (Entity)(var1 == this.mc.thePlayer.entityId ? this.mc.thePlayer : (Entity)this.entityHashSet.lookup(var1)); -- } -- -- public Entity removeEntityFromWorld(int var1) { -- Entity var2 = (Entity)this.entityHashSet.removeObject(var1); -- if(var2 != null) { -- this.J.remove(var2); -+ this.entityHashSet.addKey(par1, par2Entity); -+ } -+ -+ /** -+ * Returns the Entity with the given ID, or null if it doesn't exist in this World. -+ */ -+ public Entity getEntityByID(int par1) { -+ return (Entity)(par1 == this.mc.thePlayer.entityId ? this.mc.thePlayer : (Entity)this.entityHashSet.lookup(par1)); -+ } -+ -+ public Entity removeEntityFromWorld(int par1) { -+ Entity var2 = (Entity)this.entityHashSet.removeObject(par1); -+ -+ if (var2 != null) { -+ this.entityList.remove(var2); - this.removeEntity(var2); - } - - return var2; - } - -- public boolean setBlockAndMetadataAndInvalidate(int var1, int var2, int var3, int var4, int var5) { -- this.invalidateBlockReceiveRegion(var1, var2, var3, var1, var2, var3); -- return super.setBlock(var1, var2, var3, var4, var5, 3); -+ public boolean setBlockAndMetadataAndInvalidate(int par1, int par2, int par3, int par4, int par5) { -+ this.invalidateBlockReceiveRegion(par1, par2, par3, par1, par2, par3); -+ return super.setBlock(par1, par2, par3, par4, par5, 3); - } - -+ /** -+ * If on MP, sends a quitting packet. -+ */ - public void sendQuittingDisconnectingPacket() { - this.sendQueue.quitWithPacket(new Packet255KickDisconnect("Quitting")); - } - -- public IUpdatePlayerListBox getMinecartSoundUpdater(EntityMinecart var1) { -- return new SoundUpdaterMinecart(this.mc.sndManager, var1, this.mc.thePlayer); -+ public IUpdatePlayerListBox getMinecartSoundUpdater(EntityMinecart par1EntityMinecart) { -+ return new SoundUpdaterMinecart(this.mc.sndManager, par1EntityMinecart, this.mc.thePlayer); - } - -+ /** -+ * Updates all weather states. -+ */ - protected void updateWeather() { -- if(!this.provider.hasNoSky) { -+ if (!this.provider.hasNoSky) { - this.prevRainingStrength = this.rainingStrength; -- if(this.worldInfo.isRaining()) { -+ -+ if (this.worldInfo.isRaining()) { - this.rainingStrength = (float)((double)this.rainingStrength + 0.01D); - } else { - this.rainingStrength = (float)((double)this.rainingStrength - 0.01D); - } - -- if(this.rainingStrength < 0.0F) { -+ if (this.rainingStrength < 0.0F) { - this.rainingStrength = 0.0F; - } - -- if(this.rainingStrength > 1.0F) { -+ if (this.rainingStrength > 1.0F) { - this.rainingStrength = 1.0F; - } - - this.prevThunderingStrength = this.thunderingStrength; -- if(this.worldInfo.isThundering()) { -+ -+ if (this.worldInfo.isThundering()) { - this.thunderingStrength = (float)((double)this.thunderingStrength + 0.01D); - } else { - this.thunderingStrength = (float)((double)this.thunderingStrength - 0.01D); - } - -- if(this.thunderingStrength < 0.0F) { -+ if (this.thunderingStrength < 0.0F) { - this.thunderingStrength = 0.0F; - } - -- if(this.thunderingStrength > 1.0F) { -+ if (this.thunderingStrength > 1.0F) { - this.thunderingStrength = 1.0F; - } -- - } - } - -- public void doVoidFogParticles(int var1, int var2, int var3) { -+ public void doVoidFogParticles(int par1, int par2, int par3) { - byte var4 = 16; - Random var5 = new Random(); - -- for(int var6 = 0; var6 < 1000; ++var6) { -- int var7 = var1 + this.s.nextInt(var4) - this.s.nextInt(var4); -- int var8 = var2 + this.s.nextInt(var4) - this.s.nextInt(var4); -- int var9 = var3 + this.s.nextInt(var4) - this.s.nextInt(var4); -+ // Spout Start -+ int num = Configuration.isFancyParticles() ? 1000 : 250; -+ for (int var6 = 0; var6 < num; ++var6) { -+ // Spout End -+ int var7 = par1 + this.rand.nextInt(var4) - this.rand.nextInt(var4); -+ int var8 = par2 + this.rand.nextInt(var4) - this.rand.nextInt(var4); -+ int var9 = par3 + this.rand.nextInt(var4) - this.rand.nextInt(var4); - int var10 = this.getBlockId(var7, var8, var9); -- if(var10 == 0 && this.s.nextInt(8) > var8 && this.provider.getWorldHasVoidParticles()) { -- this.spawnParticle("depthsuspend", (double)((float)var7 + this.s.nextFloat()), (double)((float)var8 + this.s.nextFloat()), (double)((float)var9 + this.s.nextFloat()), 0.0D, 0.0D, 0.0D); -- } else if(var10 > 0) { -+ -+ if (var10 == 0 && this.rand.nextInt(8) > var8 && this.provider.getWorldHasVoidParticles()) { -+ this.spawnParticle("depthsuspend", (double)((float)var7 + this.rand.nextFloat()), (double)((float)var8 + this.rand.nextFloat()), (double)((float)var9 + this.rand.nextFloat()), 0.0D, 0.0D, 0.0D); -+ } else if (var10 > 0) { - Block.blocksList[var10].randomDisplayTick(this, var7, var8, var9, var5); - } - } -- - } - -+ /** -+ * also releases skins. -+ */ - public void removeAllEntities() { -- this.e.removeAll(this.f); -- -+ this.loadedEntityList.removeAll(this.unloadedEntityList); - int var1; - Entity var2; - int var3; - int var4; -- for(var1 = 0; var1 < this.f.size(); ++var1) { -- var2 = (Entity)this.f.get(var1); -+ -+ for (var1 = 0; var1 < this.unloadedEntityList.size(); ++var1) { -+ var2 = (Entity)this.unloadedEntityList.get(var1); - var3 = var2.chunkCoordX; - var4 = var2.chunkCoordZ; -- if(var2.addedToChunk && this.chunkExists(var3, var4)) { -+ -+ if (var2.addedToChunk && this.chunkExists(var3, var4)) { - this.getChunkFromChunkCoords(var3, var4).removeEntity(var2); - } - } - -- for(var1 = 0; var1 < this.f.size(); ++var1) { -- this.onEntityRemoved((Entity)this.f.get(var1)); -+ for (var1 = 0; var1 < this.unloadedEntityList.size(); ++var1) { -+ this.onEntityRemoved((Entity)this.unloadedEntityList.get(var1)); - } - -- this.f.clear(); -- -- for(var1 = 0; var1 < this.e.size(); ++var1) { -- var2 = (Entity)this.e.get(var1); -- if(var2.ridingEntity != null) { -- if(!var2.ridingEntity.isDead && var2.ridingEntity.riddenByEntity == var2) { -+ this.unloadedEntityList.clear(); -+ -+ for (var1 = 0; var1 < this.loadedEntityList.size(); ++var1) { -+ var2 = (Entity)this.loadedEntityList.get(var1); -+ -+ if (var2.ridingEntity != null) { -+ if (!var2.ridingEntity.isDead && var2.ridingEntity.riddenByEntity == var2) { - continue; - } - -@@ -261,22 +332,25 @@ - var2.ridingEntity = null; - } - -- if(var2.isDead) { -+ if (var2.isDead) { - var3 = var2.chunkCoordX; - var4 = var2.chunkCoordZ; -- if(var2.addedToChunk && this.chunkExists(var3, var4)) { -+ -+ if (var2.addedToChunk && this.chunkExists(var3, var4)) { - this.getChunkFromChunkCoords(var3, var4).removeEntity(var2); - } - -- this.e.remove(var1--); -+ this.loadedEntityList.remove(var1--); - this.onEntityRemoved(var2); - } - } -- - } - -- public CrashReportCategory addWorldInfoToCrashReport(CrashReport var1) { -- CrashReportCategory var2 = super.addWorldInfoToCrashReport(var1); -+ /** -+ * Adds some basic stats of the world to the given crash report. -+ */ -+ public CrashReportCategory addWorldInfoToCrashReport(CrashReport par1CrashReport) { -+ CrashReportCategory var2 = super.addWorldInfoToCrashReport(par1CrashReport); - var2.addCrashSectionCallable("Forced entities", new CallableMPL1(this)); - var2.addCrashSectionCallable("Retry entities", new CallableMPL2(this)); - var2.addCrashSectionCallable("Server brand", new WorldClientINNER3(this)); -@@ -284,52 +358,59 @@ - return var2; - } - -- public void playSound(double var1, double var3, double var5, String var7, float var8, float var9, boolean var10) { -+ /** -+ * par8 is loudness, all pars passed to minecraftInstance.sndManager.playSound -+ */ -+ public void playSound(double par1, double par3, double par5, String par7Str, float par8, float par9, boolean par10) { - float var11 = 16.0F; -- if(var8 > 1.0F) { -- var11 *= var8; -+ -+ if (par8 > 1.0F) { -+ var11 *= par8; - } - -- double var12 = this.mc.renderViewEntity.getDistanceSq(var1, var3, var5); -- if(var12 < (double)(var11 * var11)) { -- if(var10 && var12 > 100.0D) { -+ double var12 = this.mc.renderViewEntity.getDistanceSq(par1, par3, par5); -+ -+ if (var12 < (double)(var11 * var11)) { -+ if (par10 && var12 > 100.0D) { - double var14 = Math.sqrt(var12) / 40.0D; -- this.mc.sndManager.func_92070_a(var7, (float)var1, (float)var3, (float)var5, var8, var9, (int)Math.round(var14 * 20.0D)); -+ this.mc.sndManager.func_92070_a(par7Str, (float)par1, (float)par3, (float)par5, par8, par9, (int)Math.round(var14 * 20.0D)); - } else { -- this.mc.sndManager.playSound(var7, (float)var1, (float)var3, (float)var5, var8, var9); -+ this.mc.sndManager.playSound(par7Str, (float)par1, (float)par3, (float)par5, par8, par9); - } - } -- -- } -- -- public void func_92088_a(double var1, double var3, double var5, double var7, double var9, double var11, NBTTagCompound var13) { -- this.mc.effectRenderer.addEffect(new EntityFireworkStarterFX(this, var1, var3, var5, var7, var9, var11, this.mc.effectRenderer, var13)); -- } -- -- public void func_96443_a(Scoreboard var1) { -- this.worldScoreboard = var1; -- } -- -- public void setWorldTime(long var1) { -- if(var1 < 0L) { -- var1 = -var1; -+ } -+ -+ public void func_92088_a(double par1, double par3, double par5, double par7, double par9, double par11, NBTTagCompound par13NBTTagCompound) { -+ this.mc.effectRenderer.addEffect(new EntityFireworkStarterFX(this, par1, par3, par5, par7, par9, par11, this.mc.effectRenderer, par13NBTTagCompound)); -+ } -+ -+ public void func_96443_a(Scoreboard par1Scoreboard) { -+ this.worldScoreboard = par1Scoreboard; -+ } -+ -+ /** -+ * Sets the world time. -+ */ -+ public void setWorldTime(long par1) { -+ if (par1 < 0L) { -+ par1 = -par1; - this.getGameRules().setOrCreateGameRule("doDaylightCycle", "false"); - } else { - this.getGameRules().setOrCreateGameRule("doDaylightCycle", "true"); - } - -- super.setWorldTime(var1); -- } -- -- static Set getEntityList(WorldClient var0) { -- return var0.J; -- } -- -- static Set getEntitySpawnQueue(WorldClient var0) { -- return var0.K; -- } -- -- static Minecraft func_142030_c(WorldClient var0) { -- return var0.mc; -+ super.setWorldTime(par1); -+ } -+ -+ static Set getEntityList(WorldClient par0WorldClient) { -+ return par0WorldClient.entityList; -+ } -+ -+ static Set getEntitySpawnQueue(WorldClient par0WorldClient) { -+ return par0WorldClient.entitySpawnQueue; -+ } -+ -+ static Minecraft func_142030_c(WorldClient par0WorldClient) { -+ return par0WorldClient.mc; - } - } ---- /dev/null -+++ org/spoutcraft/client/gui/minimap/CoordsToggleCheckBox.java -@@ -1,0 +1,45 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.client.gui.minimap; -+ -+import org.spoutcraft.api.gui.GenericCheckBox; -+import org.spoutcraft.client.SpoutClient; -+ -+public class CoordsToggleCheckBox extends GenericCheckBox { -+ public CoordsToggleCheckBox() { -+ super("Show Coordinates"); -+ setChecked(MinimapConfig.getInstance().isCoords()); -+ setEnabled(SpoutClient.getInstance().isCoordsCheat()); -+ setTooltip("Minimap Enabled\nEnables or disables the minimap on the HUD."); -+ } -+ -+ @Override -+ public String getTooltip() { -+ if (!isEnabled()) { -+ return "This option is not allowed by your server, it is considered cheating.\nContact your admins if you feel this is an error."; -+ } -+ return super.getTooltip(); -+ } -+ -+ @Override -+ public void onButtonClick() { -+ MinimapConfig.getInstance().setCoords(isChecked()); -+ } -+} ---- /dev/null -+++ org/spoutcraft/api/inventory/Recipe.java -@@ -1,0 +1,31 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.api.inventory; -+ -+/** -+ * Represents some type of crafting recipe. -+ */ -+public interface Recipe { -+ /** -+ * Get the result of this recipe. -+ * @return The result stack -+ */ -+ ItemStack getResult(); -+} ---- net/minecraft/src/ItemColored.java -+++ net/minecraft/src/ItemColored.java -@@ -1,41 +1,55 @@ - package net.minecraft.src; - - public class ItemColored extends ItemBlock { -- private final Block blockRef = Block.blocksList[this.getBlockID()]; -- private String[] b; -- -- public ItemColored(int var1, boolean var2) { -- super(var1); -- if(var2) { -+ private final Block blockRef; -+ private String[] blockNames; -+ -+ public ItemColored(int par1, boolean par2) { -+ super(par1); -+ this.blockRef = Block.blocksList[this.getBlockID()]; -+ -+ if (par2) { - this.setMaxDamage(0); - this.setHasSubtypes(true); - } -- -- } -- -- public int getColorFromItemStack(ItemStack var1, int var2) { -- return this.blockRef.getRenderColor(var1.getItemDamage()); -- } -- -- public Icon getIconFromDamage(int var1) { -- return this.blockRef.getIcon(0, var1); -- } -- -- public int getMetadata(int var1) { -- return var1; -- } -- -- public ItemColored setBlockNames(String[] var1) { -- this.b = var1; -+ } -+ -+ public int getColorFromItemStack(ItemStack par1ItemStack, int par2) { -+ return this.blockRef.getRenderColor(par1ItemStack.getItemDamage()); -+ } -+ -+ /** -+ * Gets an icon index based on an item's damage value -+ */ -+ public Icon getIconFromDamage(int par1) { -+ return this.blockRef.getIcon(0, par1); -+ } -+ -+ /** -+ * Returns the metadata of the block which this Item (ItemBlock) can place -+ */ -+ public int getMetadata(int par1) { -+ return par1; -+ } -+ -+ /** -+ * Sets the array of strings to be used for name lookups from item damage to metadata -+ */ -+ public ItemColored setBlockNames(String[] par1ArrayOfStr) { -+ this.blockNames = par1ArrayOfStr; - return this; - } - -- public String getUnlocalizedName(ItemStack var1) { -- if(this.b == null) { -- return super.getUnlocalizedName(var1); -+ /** -+ * Returns the unlocalized name of this item. This version accepts an ItemStack so different stacks can have different -+ * names based on their damage or NBT. -+ */ -+ public String getUnlocalizedName(ItemStack par1ItemStack) { -+ if (this.blockNames == null) { -+ return super.getUnlocalizedName(par1ItemStack); - } else { -- int var2 = var1.getItemDamage(); -- return var2 >= 0 && var2 < this.b.length ? super.getUnlocalizedName(var1) + "." + this.b[var2] : super.getUnlocalizedName(var1); -+ int var2 = par1ItemStack.getItemDamage(); -+ return var2 >= 0 && var2 < this.blockNames.length ? super.getUnlocalizedName(par1ItemStack) + "." + this.blockNames[var2] : super.getUnlocalizedName(par1ItemStack); - } - } - } ---- net/minecraft/src/ComponentStrongholdRoomCrossing.java -+++ net/minecraft/src/ComponentStrongholdRoomCrossing.java -@@ -4,128 +4,142 @@ - import java.util.Random; - - public class ComponentStrongholdRoomCrossing extends ComponentStronghold { -- private static final WeightedRandomChestContent[] strongholdRoomCrossingChestContents = new WeightedRandomChestContent[]{new WeightedRandomChestContent(Item.ingotIron.itemID, 0, 1, 5, 10), new WeightedRandomChestContent(Item.ingotGold.itemID, 0, 1, 3, 5), new WeightedRandomChestContent(Item.redstone.itemID, 0, 4, 9, 5), new WeightedRandomChestContent(Item.coal.itemID, 0, 3, 8, 10), new WeightedRandomChestContent(Item.bread.itemID, 0, 1, 3, 15), new WeightedRandomChestContent(Item.appleRed.itemID, 0, 1, 3, 15), new WeightedRandomChestContent(Item.pickaxeIron.itemID, 0, 1, 1, 1)}; -+ -+ /** -+ * Items that could generate in the chest that is located in Stronghold Room Crossing. -+ */ -+ private static final WeightedRandomChestContent[] strongholdRoomCrossingChestContents = new WeightedRandomChestContent[] {new WeightedRandomChestContent(Item.ingotIron.itemID, 0, 1, 5, 10), new WeightedRandomChestContent(Item.ingotGold.itemID, 0, 1, 3, 5), new WeightedRandomChestContent(Item.redstone.itemID, 0, 4, 9, 5), new WeightedRandomChestContent(Item.coal.itemID, 0, 3, 8, 10), new WeightedRandomChestContent(Item.bread.itemID, 0, 1, 3, 15), new WeightedRandomChestContent(Item.appleRed.itemID, 0, 1, 3, 15), new WeightedRandomChestContent(Item.pickaxeIron.itemID, 0, 1, 1, 1)}; - protected int roomType; - -- public ComponentStrongholdRoomCrossing() { -- } -- -- public ComponentStrongholdRoomCrossing(int var1, Random var2, StructureBoundingBox var3, int var4) { -- super(var1); -- this.coordBaseMode = var4; -- this.field_143013_d = this.getRandomDoor(var2); -- this.boundingBox = var3; -- this.roomType = var2.nextInt(5); -- } -- -- protected void func_143012_a(NBTTagCompound var1) { -- super.func_143012_a(var1); -- var1.setInteger("Type", this.roomType); -- } -- -- protected void func_143011_b(NBTTagCompound var1) { -- super.func_143011_b(var1); -- this.roomType = var1.getInteger("Type"); -- } -- -- public void buildComponent(StructureComponent var1, List var2, Random var3) { -- this.getNextComponentNormal((ComponentStrongholdStairs2)var1, var2, var3, 4, 1); -- this.getNextComponentX((ComponentStrongholdStairs2)var1, var2, var3, 1, 4); -- this.getNextComponentZ((ComponentStrongholdStairs2)var1, var2, var3, 1, 4); -- } -- -- public static ComponentStrongholdRoomCrossing findValidPlacement(List var0, Random var1, int var2, int var3, int var4, int var5, int var6) { -- StructureBoundingBox var7 = StructureBoundingBox.getComponentToAddBoundingBox(var2, var3, var4, -4, -1, 0, 11, 7, 11, var5); -- return canStrongholdGoDeeper(var7) && StructureComponent.findIntersecting(var0, var7) == null ? new ComponentStrongholdRoomCrossing(var6, var1, var7, var5) : null; -- } -- -- public boolean addComponentParts(World var1, Random var2, StructureBoundingBox var3) { -- if(this.isLiquidInStructureBoundingBox(var1, var3)) { -+ public ComponentStrongholdRoomCrossing() {} -+ -+ public ComponentStrongholdRoomCrossing(int par1, Random par2Random, StructureBoundingBox par3StructureBoundingBox, int par4) { -+ super(par1); -+ this.coordBaseMode = par4; -+ this.field_143013_d = this.getRandomDoor(par2Random); -+ this.boundingBox = par3StructureBoundingBox; -+ this.roomType = par2Random.nextInt(5); -+ } -+ -+ protected void func_143012_a(NBTTagCompound par1NBTTagCompound) { -+ super.func_143012_a(par1NBTTagCompound); -+ par1NBTTagCompound.setInteger("Type", this.roomType); -+ } -+ -+ protected void func_143011_b(NBTTagCompound par1NBTTagCompound) { -+ super.func_143011_b(par1NBTTagCompound); -+ this.roomType = par1NBTTagCompound.getInteger("Type"); -+ } -+ -+ /** -+ * Initiates construction of the Structure Component picked, at the current Location of StructGen -+ */ -+ public void buildComponent(StructureComponent par1StructureComponent, List par2List, Random par3Random) { -+ this.getNextComponentNormal((ComponentStrongholdStairs2)par1StructureComponent, par2List, par3Random, 4, 1); -+ this.getNextComponentX((ComponentStrongholdStairs2)par1StructureComponent, par2List, par3Random, 1, 4); -+ this.getNextComponentZ((ComponentStrongholdStairs2)par1StructureComponent, par2List, par3Random, 1, 4); -+ } -+ -+ public static ComponentStrongholdRoomCrossing findValidPlacement(List par0List, Random par1Random, int par2, int par3, int par4, int par5, int par6) { -+ StructureBoundingBox var7 = StructureBoundingBox.getComponentToAddBoundingBox(par2, par3, par4, -4, -1, 0, 11, 7, 11, par5); -+ return canStrongholdGoDeeper(var7) && StructureComponent.findIntersecting(par0List, var7) == null ? new ComponentStrongholdRoomCrossing(par6, par1Random, var7, par5) : null; -+ } -+ -+ /** -+ * second Part of Structure generating, this for example places Spiderwebs, Mob Spawners, it closes Mineshafts at the -+ * end, it adds Fences... -+ */ -+ public boolean addComponentParts(World par1World, Random par2Random, StructureBoundingBox par3StructureBoundingBox) { -+ if (this.isLiquidInStructureBoundingBox(par1World, par3StructureBoundingBox)) { - return false; - } else { -- this.fillWithRandomizedBlocks(var1, var3, 0, 0, 0, 10, 6, 10, true, var2, StructureStrongholdPieces.getStrongholdStones()); -- this.placeDoor(var1, var2, var3, this.field_143013_d, 4, 1, 0); -- this.fillWithBlocks(var1, var3, 4, 1, 10, 6, 3, 10, 0, 0, false); -- this.fillWithBlocks(var1, var3, 0, 1, 4, 0, 3, 6, 0, 0, false); -- this.fillWithBlocks(var1, var3, 10, 1, 4, 10, 3, 6, 0, 0, false); -+ this.fillWithRandomizedBlocks(par1World, par3StructureBoundingBox, 0, 0, 0, 10, 6, 10, true, par2Random, StructureStrongholdPieces.getStrongholdStones()); -+ this.placeDoor(par1World, par2Random, par3StructureBoundingBox, this.field_143013_d, 4, 1, 0); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 4, 1, 10, 6, 3, 10, 0, 0, false); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 0, 1, 4, 0, 3, 6, 0, 0, false); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 10, 1, 4, 10, 3, 6, 0, 0, false); - int var4; -- switch(this.roomType) { -- case 0: -- this.placeBlockAtCurrentPosition(var1, Block.stoneBrick.blockID, 0, 5, 1, 5, var3); -- this.placeBlockAtCurrentPosition(var1, Block.stoneBrick.blockID, 0, 5, 2, 5, var3); -- this.placeBlockAtCurrentPosition(var1, Block.stoneBrick.blockID, 0, 5, 3, 5, var3); -- this.placeBlockAtCurrentPosition(var1, Block.torchWood.blockID, 0, 4, 3, 5, var3); -- this.placeBlockAtCurrentPosition(var1, Block.torchWood.blockID, 0, 6, 3, 5, var3); -- this.placeBlockAtCurrentPosition(var1, Block.torchWood.blockID, 0, 5, 3, 4, var3); -- this.placeBlockAtCurrentPosition(var1, Block.torchWood.blockID, 0, 5, 3, 6, var3); -- this.placeBlockAtCurrentPosition(var1, Block.stoneSingleSlab.blockID, 0, 4, 1, 4, var3); -- this.placeBlockAtCurrentPosition(var1, Block.stoneSingleSlab.blockID, 0, 4, 1, 5, var3); -- this.placeBlockAtCurrentPosition(var1, Block.stoneSingleSlab.blockID, 0, 4, 1, 6, var3); -- this.placeBlockAtCurrentPosition(var1, Block.stoneSingleSlab.blockID, 0, 6, 1, 4, var3); -- this.placeBlockAtCurrentPosition(var1, Block.stoneSingleSlab.blockID, 0, 6, 1, 5, var3); -- this.placeBlockAtCurrentPosition(var1, Block.stoneSingleSlab.blockID, 0, 6, 1, 6, var3); -- this.placeBlockAtCurrentPosition(var1, Block.stoneSingleSlab.blockID, 0, 5, 1, 4, var3); -- this.placeBlockAtCurrentPosition(var1, Block.stoneSingleSlab.blockID, 0, 5, 1, 6, var3); -- break; -- case 1: -- for(var4 = 0; var4 < 5; ++var4) { -- this.placeBlockAtCurrentPosition(var1, Block.stoneBrick.blockID, 0, 3, 1, 3 + var4, var3); -- this.placeBlockAtCurrentPosition(var1, Block.stoneBrick.blockID, 0, 7, 1, 3 + var4, var3); -- this.placeBlockAtCurrentPosition(var1, Block.stoneBrick.blockID, 0, 3 + var4, 1, 3, var3); -- this.placeBlockAtCurrentPosition(var1, Block.stoneBrick.blockID, 0, 3 + var4, 1, 7, var3); -- } -- -- this.placeBlockAtCurrentPosition(var1, Block.stoneBrick.blockID, 0, 5, 1, 5, var3); -- this.placeBlockAtCurrentPosition(var1, Block.stoneBrick.blockID, 0, 5, 2, 5, var3); -- this.placeBlockAtCurrentPosition(var1, Block.stoneBrick.blockID, 0, 5, 3, 5, var3); -- this.placeBlockAtCurrentPosition(var1, Block.waterMoving.blockID, 0, 5, 4, 5, var3); -- break; -- case 2: -- for(var4 = 1; var4 <= 9; ++var4) { -- this.placeBlockAtCurrentPosition(var1, Block.cobblestone.blockID, 0, 1, 3, var4, var3); -- this.placeBlockAtCurrentPosition(var1, Block.cobblestone.blockID, 0, 9, 3, var4, var3); -- } -- -- for(var4 = 1; var4 <= 9; ++var4) { -- this.placeBlockAtCurrentPosition(var1, Block.cobblestone.blockID, 0, var4, 3, 1, var3); -- this.placeBlockAtCurrentPosition(var1, Block.cobblestone.blockID, 0, var4, 3, 9, var3); -- } -- -- this.placeBlockAtCurrentPosition(var1, Block.cobblestone.blockID, 0, 5, 1, 4, var3); -- this.placeBlockAtCurrentPosition(var1, Block.cobblestone.blockID, 0, 5, 1, 6, var3); -- this.placeBlockAtCurrentPosition(var1, Block.cobblestone.blockID, 0, 5, 3, 4, var3); -- this.placeBlockAtCurrentPosition(var1, Block.cobblestone.blockID, 0, 5, 3, 6, var3); -- this.placeBlockAtCurrentPosition(var1, Block.cobblestone.blockID, 0, 4, 1, 5, var3); -- this.placeBlockAtCurrentPosition(var1, Block.cobblestone.blockID, 0, 6, 1, 5, var3); -- this.placeBlockAtCurrentPosition(var1, Block.cobblestone.blockID, 0, 4, 3, 5, var3); -- this.placeBlockAtCurrentPosition(var1, Block.cobblestone.blockID, 0, 6, 3, 5, var3); -- -- for(var4 = 1; var4 <= 3; ++var4) { -- this.placeBlockAtCurrentPosition(var1, Block.cobblestone.blockID, 0, 4, var4, 4, var3); -- this.placeBlockAtCurrentPosition(var1, Block.cobblestone.blockID, 0, 6, var4, 4, var3); -- this.placeBlockAtCurrentPosition(var1, Block.cobblestone.blockID, 0, 4, var4, 6, var3); -- this.placeBlockAtCurrentPosition(var1, Block.cobblestone.blockID, 0, 6, var4, 6, var3); -- } -- -- this.placeBlockAtCurrentPosition(var1, Block.torchWood.blockID, 0, 5, 3, 5, var3); -- -- for(var4 = 2; var4 <= 8; ++var4) { -- this.placeBlockAtCurrentPosition(var1, Block.planks.blockID, 0, 2, 3, var4, var3); -- this.placeBlockAtCurrentPosition(var1, Block.planks.blockID, 0, 3, 3, var4, var3); -- if(var4 <= 3 || var4 >= 7) { -- this.placeBlockAtCurrentPosition(var1, Block.planks.blockID, 0, 4, 3, var4, var3); -- this.placeBlockAtCurrentPosition(var1, Block.planks.blockID, 0, 5, 3, var4, var3); -- this.placeBlockAtCurrentPosition(var1, Block.planks.blockID, 0, 6, 3, var4, var3); -- } -- -- this.placeBlockAtCurrentPosition(var1, Block.planks.blockID, 0, 7, 3, var4, var3); -- this.placeBlockAtCurrentPosition(var1, Block.planks.blockID, 0, 8, 3, var4, var3); -- } -- -- this.placeBlockAtCurrentPosition(var1, Block.ladder.blockID, this.getMetadataWithOffset(Block.ladder.blockID, 4), 9, 1, 3, var3); -- this.placeBlockAtCurrentPosition(var1, Block.ladder.blockID, this.getMetadataWithOffset(Block.ladder.blockID, 4), 9, 2, 3, var3); -- this.placeBlockAtCurrentPosition(var1, Block.ladder.blockID, this.getMetadataWithOffset(Block.ladder.blockID, 4), 9, 3, 3, var3); -- this.generateStructureChestContents(var1, var3, var2, 3, 4, 8, WeightedRandomChestContent.func_92080_a(strongholdRoomCrossingChestContents, new WeightedRandomChestContent[]{Item.enchantedBook.func_92114_b(var2)}), 1 + var2.nextInt(4)); -+ -+ switch (this.roomType) { -+ case 0: -+ this.placeBlockAtCurrentPosition(par1World, Block.stoneBrick.blockID, 0, 5, 1, 5, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.stoneBrick.blockID, 0, 5, 2, 5, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.stoneBrick.blockID, 0, 5, 3, 5, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.torchWood.blockID, 0, 4, 3, 5, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.torchWood.blockID, 0, 6, 3, 5, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.torchWood.blockID, 0, 5, 3, 4, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.torchWood.blockID, 0, 5, 3, 6, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.stoneSingleSlab.blockID, 0, 4, 1, 4, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.stoneSingleSlab.blockID, 0, 4, 1, 5, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.stoneSingleSlab.blockID, 0, 4, 1, 6, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.stoneSingleSlab.blockID, 0, 6, 1, 4, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.stoneSingleSlab.blockID, 0, 6, 1, 5, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.stoneSingleSlab.blockID, 0, 6, 1, 6, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.stoneSingleSlab.blockID, 0, 5, 1, 4, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.stoneSingleSlab.blockID, 0, 5, 1, 6, par3StructureBoundingBox); -+ break; -+ -+ case 1: -+ for (var4 = 0; var4 < 5; ++var4) { -+ this.placeBlockAtCurrentPosition(par1World, Block.stoneBrick.blockID, 0, 3, 1, 3 + var4, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.stoneBrick.blockID, 0, 7, 1, 3 + var4, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.stoneBrick.blockID, 0, 3 + var4, 1, 3, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.stoneBrick.blockID, 0, 3 + var4, 1, 7, par3StructureBoundingBox); -+ } -+ -+ this.placeBlockAtCurrentPosition(par1World, Block.stoneBrick.blockID, 0, 5, 1, 5, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.stoneBrick.blockID, 0, 5, 2, 5, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.stoneBrick.blockID, 0, 5, 3, 5, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.waterMoving.blockID, 0, 5, 4, 5, par3StructureBoundingBox); -+ break; -+ -+ case 2: -+ for (var4 = 1; var4 <= 9; ++var4) { -+ this.placeBlockAtCurrentPosition(par1World, Block.cobblestone.blockID, 0, 1, 3, var4, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.cobblestone.blockID, 0, 9, 3, var4, par3StructureBoundingBox); -+ } -+ -+ for (var4 = 1; var4 <= 9; ++var4) { -+ this.placeBlockAtCurrentPosition(par1World, Block.cobblestone.blockID, 0, var4, 3, 1, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.cobblestone.blockID, 0, var4, 3, 9, par3StructureBoundingBox); -+ } -+ -+ this.placeBlockAtCurrentPosition(par1World, Block.cobblestone.blockID, 0, 5, 1, 4, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.cobblestone.blockID, 0, 5, 1, 6, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.cobblestone.blockID, 0, 5, 3, 4, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.cobblestone.blockID, 0, 5, 3, 6, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.cobblestone.blockID, 0, 4, 1, 5, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.cobblestone.blockID, 0, 6, 1, 5, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.cobblestone.blockID, 0, 4, 3, 5, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.cobblestone.blockID, 0, 6, 3, 5, par3StructureBoundingBox); -+ -+ for (var4 = 1; var4 <= 3; ++var4) { -+ this.placeBlockAtCurrentPosition(par1World, Block.cobblestone.blockID, 0, 4, var4, 4, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.cobblestone.blockID, 0, 6, var4, 4, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.cobblestone.blockID, 0, 4, var4, 6, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.cobblestone.blockID, 0, 6, var4, 6, par3StructureBoundingBox); -+ } -+ -+ this.placeBlockAtCurrentPosition(par1World, Block.torchWood.blockID, 0, 5, 3, 5, par3StructureBoundingBox); -+ -+ for (var4 = 2; var4 <= 8; ++var4) { -+ this.placeBlockAtCurrentPosition(par1World, Block.planks.blockID, 0, 2, 3, var4, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.planks.blockID, 0, 3, 3, var4, par3StructureBoundingBox); -+ -+ if (var4 <= 3 || var4 >= 7) { -+ this.placeBlockAtCurrentPosition(par1World, Block.planks.blockID, 0, 4, 3, var4, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.planks.blockID, 0, 5, 3, var4, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.planks.blockID, 0, 6, 3, var4, par3StructureBoundingBox); -+ } -+ -+ this.placeBlockAtCurrentPosition(par1World, Block.planks.blockID, 0, 7, 3, var4, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.planks.blockID, 0, 8, 3, var4, par3StructureBoundingBox); -+ } -+ -+ this.placeBlockAtCurrentPosition(par1World, Block.ladder.blockID, this.getMetadataWithOffset(Block.ladder.blockID, 4), 9, 1, 3, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.ladder.blockID, this.getMetadataWithOffset(Block.ladder.blockID, 4), 9, 2, 3, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.ladder.blockID, this.getMetadataWithOffset(Block.ladder.blockID, 4), 9, 3, 3, par3StructureBoundingBox); -+ this.generateStructureChestContents(par1World, par3StructureBoundingBox, par2Random, 3, 4, 8, WeightedRandomChestContent.func_92080_a(strongholdRoomCrossingChestContents, new WeightedRandomChestContent[] {Item.enchantedBook.func_92114_b(par2Random)}), 1 + par2Random.nextInt(4)); - } - - return true; ---- net/minecraft/src/RenderEndPortal.java -+++ net/minecraft/src/RenderEndPortal.java -@@ -7,43 +7,47 @@ - public class RenderEndPortal extends TileEntitySpecialRenderer { - private static final ResourceLocation enderPortalEndSkyTextures = new ResourceLocation("textures/environment/end_sky.png"); - private static final ResourceLocation endPortalTextures = new ResourceLocation("textures/entity/end_portal.png"); -- private static final Random e = new Random(31100L); -- FloatBuffer a = GLAllocation.createDirectFloatBuffer(16); -+ private static final Random field_110644_e = new Random(31100L); -+ FloatBuffer field_76908_a = GLAllocation.createDirectFloatBuffer(16); - -- public void renderEndPortalTileEntity(TileEntityEndPortal var1, double var2, double var4, double var6, float var8) { -+ /** -+ * Renders the End Portal. -+ */ -+ public void renderEndPortalTileEntity(TileEntityEndPortal par1TileEntityEndPortal, double par2, double par4, double par6, float par8) { - float var9 = (float)this.tileEntityRenderer.playerX; - float var10 = (float)this.tileEntityRenderer.playerY; - float var11 = (float)this.tileEntityRenderer.playerZ; - GL11.glDisable(GL11.GL_LIGHTING); -- e.setSeed(31100L); -- float var12 = 12.0F / 16.0F; -+ field_110644_e.setSeed(31100L); -+ float var12 = 0.75F; - -- for(int var13 = 0; var13 < 16; ++var13) { -+ for (int var13 = 0; var13 < 16; ++var13) { - GL11.glPushMatrix(); - float var14 = (float)(16 - var13); -- float var15 = 1.0F / 16.0F; -+ float var15 = 0.0625F; - float var16 = 1.0F / (var14 + 1.0F); -- if(var13 == 0) { -+ -+ if (var13 == 0) { - this.bindTexture(enderPortalEndSkyTextures); - var16 = 0.1F; - var14 = 65.0F; -- var15 = 2.0F / 16.0F; -+ var15 = 0.125F; - GL11.glEnable(GL11.GL_BLEND); - GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); - } - -- if(var13 == 1) { -+ if (var13 == 1) { - this.bindTexture(endPortalTextures); - GL11.glEnable(GL11.GL_BLEND); - GL11.glBlendFunc(GL11.GL_ONE, GL11.GL_ONE); - var15 = 0.5F; - } - -- float var17 = (float)(-(var4 + (double)var12)); -+ float var17 = (float)(-(par4 + (double)var12)); - float var18 = var17 + ActiveRenderInfo.objectY; - float var19 = var17 + var14 + ActiveRenderInfo.objectY; - float var20 = var18 / var19; -- var20 += (float)(var4 + (double)var12); -+ var20 += (float)(par4 + (double)var12); - GL11.glTranslatef(var9, var20, var11); - GL11.glTexGeni(GL11.GL_S, GL11.GL_TEXTURE_GEN_MODE, GL11.GL_OBJECT_LINEAR); - GL11.glTexGeni(GL11.GL_T, GL11.GL_TEXTURE_GEN_MODE, GL11.GL_OBJECT_LINEAR); -@@ -71,20 +75,21 @@ - GL11.glTranslatef(ActiveRenderInfo.objectX * var14 / var18, ActiveRenderInfo.objectZ * var14 / var18, -var10); - Tessellator var23 = Tessellator.instance; - var23.startDrawingQuads(); -- var20 = e.nextFloat() * 0.5F + 0.1F; -- float var21 = e.nextFloat() * 0.5F + 0.4F; -- float var22 = e.nextFloat() * 0.5F + 0.5F; -- if(var13 == 0) { -+ var20 = field_110644_e.nextFloat() * 0.5F + 0.1F; -+ float var21 = field_110644_e.nextFloat() * 0.5F + 0.4F; -+ float var22 = field_110644_e.nextFloat() * 0.5F + 0.5F; -+ -+ if (var13 == 0) { - var22 = 1.0F; -- var21 = var22; -- var20 = var22; -+ var21 = 1.0F; -+ var20 = 1.0F; - } - - var23.setColorRGBA_F(var20 * var16, var21 * var16, var22 * var16, 1.0F); -- var23.addVertex(var2, var4 + (double)var12, var6); -- var23.addVertex(var2, var4 + (double)var12, var6 + 1.0D); -- var23.addVertex(var2 + 1.0D, var4 + (double)var12, var6 + 1.0D); -- var23.addVertex(var2 + 1.0D, var4 + (double)var12, var6); -+ var23.addVertex(par2, par4 + (double)var12, par6); -+ var23.addVertex(par2, par4 + (double)var12, par6 + 1.0D); -+ var23.addVertex(par2 + 1.0D, par4 + (double)var12, par6 + 1.0D); -+ var23.addVertex(par2 + 1.0D, par4 + (double)var12, par6); - var23.draw(); - GL11.glPopMatrix(); - GL11.glMatrixMode(GL11.GL_MODELVIEW); -@@ -98,14 +103,14 @@ - GL11.glEnable(GL11.GL_LIGHTING); - } - -- private FloatBuffer func_76907_a(float var1, float var2, float var3, float var4) { -- this.a.clear(); -- this.a.put(var1).put(var2).put(var3).put(var4); -- this.a.flip(); -- return this.a; -+ private FloatBuffer func_76907_a(float par1, float par2, float par3, float par4) { -+ this.field_76908_a.clear(); -+ this.field_76908_a.put(par1).put(par2).put(par3).put(par4); -+ this.field_76908_a.flip(); -+ return this.field_76908_a; - } - -- public void renderTileEntityAt(TileEntity var1, double var2, double var4, double var6, float var8) { -- this.renderEndPortalTileEntity((TileEntityEndPortal)var1, var2, var4, var6, var8); -+ public void renderTileEntityAt(TileEntity par1TileEntity, double par2, double par4, double par6, float par8) { -+ this.renderEndPortalTileEntity((TileEntityEndPortal)par1TileEntity, par2, par4, par6, par8); - } - } ---- net/minecraft/src/BlockStairs.java -+++ net/minecraft/src/BlockStairs.java -@@ -4,69 +4,91 @@ - import java.util.Random; - - public class BlockStairs extends Block { -- private static final int[][] field_72159_a = new int[][]{{2, 6}, {3, 7}, {2, 3}, {6, 7}, {0, 4}, {1, 5}, {0, 1}, {4, 5}}; -+ private static final int[][] field_72159_a = new int[][] {{2, 6}, {3, 7}, {2, 3}, {6, 7}, {0, 4}, {1, 5}, {0, 1}, {4, 5}}; -+ -+ /** The block that is used as model for the stair. */ - private final Block modelBlock; - private final int modelBlockMetadata; - private boolean field_72156_cr; - private int field_72160_cs; - -- protected BlockStairs(int var1, Block var2, int var3) { -- super(var1, var2.blockMaterial); -- this.modelBlock = var2; -- this.modelBlockMetadata = var3; -- this.setHardness(var2.blockHardness); -- this.setResistance(var2.blockResistance / 3.0F); -- this.setStepSound(var2.stepSound); -+ protected BlockStairs(int par1, Block par2Block, int par3) { -+ super(par1, par2Block.blockMaterial); -+ this.modelBlock = par2Block; -+ this.modelBlockMetadata = par3; -+ this.setHardness(par2Block.blockHardness); -+ this.setResistance(par2Block.blockResistance / 3.0F); -+ this.setStepSound(par2Block.stepSound); - this.setLightOpacity(255); - this.setCreativeTab(CreativeTabs.tabBlock); - } - -- public void setBlockBoundsBasedOnState(IBlockAccess var1, int var2, int var3, int var4) { -- if(this.field_72156_cr) { -+ /** -+ * Updates the blocks bounds based on its current state. Args: world, x, y, z -+ */ -+ public void setBlockBoundsBasedOnState(IBlockAccess par1IBlockAccess, int par2, int par3, int par4) { -+ if (this.field_72156_cr) { - this.setBlockBounds(0.5F * (float)(this.field_72160_cs % 2), 0.5F * (float)(this.field_72160_cs / 2 % 2), 0.5F * (float)(this.field_72160_cs / 4 % 2), 0.5F + 0.5F * (float)(this.field_72160_cs % 2), 0.5F + 0.5F * (float)(this.field_72160_cs / 2 % 2), 0.5F + 0.5F * (float)(this.field_72160_cs / 4 % 2)); - } else { - this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F); - } -- - } - -+ /** -+ * Is this block (a) opaque and (b) a full 1m cube? This determines whether or not to render the shared face of two -+ * adjacent blocks and also whether the player can attach torches, redstone wire, etc to this block. -+ */ - public boolean isOpaqueCube() { - return false; - } - -+ /** -+ * If this block doesn't render as an ordinary block it will return False (examples: signs, buttons, stairs, etc) -+ */ - public boolean renderAsNormalBlock() { - return false; - } - -+ /** -+ * The type of render function that is called for this block -+ */ - public int getRenderType() { - return 10; - } - -- public void func_82541_d(IBlockAccess var1, int var2, int var3, int var4) { -- int var5 = var1.getBlockMetadata(var2, var3, var4); -- if((var5 & 4) != 0) { -+ public void func_82541_d(IBlockAccess par1IBlockAccess, int par2, int par3, int par4) { -+ int var5 = par1IBlockAccess.getBlockMetadata(par2, par3, par4); -+ -+ if ((var5 & 4) != 0) { - this.setBlockBounds(0.0F, 0.5F, 0.0F, 1.0F, 1.0F, 1.0F); - } else { - this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.5F, 1.0F); - } -- -- } -- -- public static boolean isBlockStairsID(int var0) { -- return var0 > 0 && Block.blocksList[var0] instanceof BlockStairs; -- } -- -- private boolean isBlockStairsDirection(IBlockAccess var1, int var2, int var3, int var4, int var5) { -- int var6 = var1.getBlockId(var2, var3, var4); -- return isBlockStairsID(var6) && var1.getBlockMetadata(var2, var3, var4) == var5; -- } -- -- public boolean func_82542_g(IBlockAccess var1, int var2, int var3, int var4) { -- int var5 = var1.getBlockMetadata(var2, var3, var4); -+ } -+ -+ /** -+ * Checks if supplied ID is one of a BlockStairs -+ */ -+ public static boolean isBlockStairsID(int par0) { -+ return par0 > 0 && Block.blocksList[par0] instanceof BlockStairs; -+ } -+ -+ /** -+ * returns true if the given block is a stairs block and is in the given direction of par5. Parameters are -+ * IBlockAccess, x, y, z, direction -+ */ -+ private boolean isBlockStairsDirection(IBlockAccess par1IBlockAccess, int par2, int par3, int par4, int par5) { -+ int var6 = par1IBlockAccess.getBlockId(par2, par3, par4); -+ return isBlockStairsID(var6) && par1IBlockAccess.getBlockMetadata(par2, par3, par4) == par5; -+ } -+ -+ public boolean func_82542_g(IBlockAccess par1IBlockAccess, int par2, int par3, int par4) { -+ int var5 = par1IBlockAccess.getBlockMetadata(par2, par3, par4); - int var6 = var5 & 3; - float var7 = 0.5F; - float var8 = 1.0F; -- if((var5 & 4) != 0) { -+ -+ if ((var5 & 4) != 0) { - var7 = 0.0F; - var8 = 0.5F; - } -@@ -79,60 +101,69 @@ - int var14; - int var15; - int var16; -- if(var6 == 0) { -+ -+ if (var6 == 0) { - var9 = 0.5F; - var12 = 1.0F; -- var14 = var1.getBlockId(var2 + 1, var3, var4); -- var15 = var1.getBlockMetadata(var2 + 1, var3, var4); -- if(isBlockStairsID(var14) && (var5 & 4) == (var15 & 4)) { -+ var14 = par1IBlockAccess.getBlockId(par2 + 1, par3, par4); -+ var15 = par1IBlockAccess.getBlockMetadata(par2 + 1, par3, par4); -+ -+ if (isBlockStairsID(var14) && (var5 & 4) == (var15 & 4)) { - var16 = var15 & 3; -- if(var16 == 3 && !this.isBlockStairsDirection(var1, var2, var3, var4 + 1, var5)) { -+ -+ if (var16 == 3 && !this.isBlockStairsDirection(par1IBlockAccess, par2, par3, par4 + 1, var5)) { - var12 = 0.5F; - var13 = false; -- } else if(var16 == 2 && !this.isBlockStairsDirection(var1, var2, var3, var4 - 1, var5)) { -+ } else if (var16 == 2 && !this.isBlockStairsDirection(par1IBlockAccess, par2, par3, par4 - 1, var5)) { - var11 = 0.5F; - var13 = false; - } - } -- } else if(var6 == 1) { -+ } else if (var6 == 1) { - var10 = 0.5F; - var12 = 1.0F; -- var14 = var1.getBlockId(var2 - 1, var3, var4); -- var15 = var1.getBlockMetadata(var2 - 1, var3, var4); -- if(isBlockStairsID(var14) && (var5 & 4) == (var15 & 4)) { -+ var14 = par1IBlockAccess.getBlockId(par2 - 1, par3, par4); -+ var15 = par1IBlockAccess.getBlockMetadata(par2 - 1, par3, par4); -+ -+ if (isBlockStairsID(var14) && (var5 & 4) == (var15 & 4)) { - var16 = var15 & 3; -- if(var16 == 3 && !this.isBlockStairsDirection(var1, var2, var3, var4 + 1, var5)) { -+ -+ if (var16 == 3 && !this.isBlockStairsDirection(par1IBlockAccess, par2, par3, par4 + 1, var5)) { - var12 = 0.5F; - var13 = false; -- } else if(var16 == 2 && !this.isBlockStairsDirection(var1, var2, var3, var4 - 1, var5)) { -+ } else if (var16 == 2 && !this.isBlockStairsDirection(par1IBlockAccess, par2, par3, par4 - 1, var5)) { - var11 = 0.5F; - var13 = false; - } - } -- } else if(var6 == 2) { -+ } else if (var6 == 2) { - var11 = 0.5F; - var12 = 1.0F; -- var14 = var1.getBlockId(var2, var3, var4 + 1); -- var15 = var1.getBlockMetadata(var2, var3, var4 + 1); -- if(isBlockStairsID(var14) && (var5 & 4) == (var15 & 4)) { -+ var14 = par1IBlockAccess.getBlockId(par2, par3, par4 + 1); -+ var15 = par1IBlockAccess.getBlockMetadata(par2, par3, par4 + 1); -+ -+ if (isBlockStairsID(var14) && (var5 & 4) == (var15 & 4)) { - var16 = var15 & 3; -- if(var16 == 1 && !this.isBlockStairsDirection(var1, var2 + 1, var3, var4, var5)) { -+ -+ if (var16 == 1 && !this.isBlockStairsDirection(par1IBlockAccess, par2 + 1, par3, par4, var5)) { - var10 = 0.5F; - var13 = false; -- } else if(var16 == 0 && !this.isBlockStairsDirection(var1, var2 - 1, var3, var4, var5)) { -+ } else if (var16 == 0 && !this.isBlockStairsDirection(par1IBlockAccess, par2 - 1, par3, par4, var5)) { - var9 = 0.5F; - var13 = false; - } - } -- } else if(var6 == 3) { -- var14 = var1.getBlockId(var2, var3, var4 - 1); -- var15 = var1.getBlockMetadata(var2, var3, var4 - 1); -- if(isBlockStairsID(var14) && (var5 & 4) == (var15 & 4)) { -+ } else if (var6 == 3) { -+ var14 = par1IBlockAccess.getBlockId(par2, par3, par4 - 1); -+ var15 = par1IBlockAccess.getBlockMetadata(par2, par3, par4 - 1); -+ -+ if (isBlockStairsID(var14) && (var5 & 4) == (var15 & 4)) { - var16 = var15 & 3; -- if(var16 == 1 && !this.isBlockStairsDirection(var1, var2 + 1, var3, var4, var5)) { -+ -+ if (var16 == 1 && !this.isBlockStairsDirection(par1IBlockAccess, par2 + 1, par3, par4, var5)) { - var10 = 0.5F; - var13 = false; -- } else if(var16 == 0 && !this.isBlockStairsDirection(var1, var2 - 1, var3, var4, var5)) { -+ } else if (var16 == 0 && !this.isBlockStairsDirection(par1IBlockAccess, par2 - 1, par3, par4, var5)) { - var9 = 0.5F; - var13 = false; - } -@@ -143,12 +174,13 @@ - return var13; - } - -- public boolean func_82544_h(IBlockAccess var1, int var2, int var3, int var4) { -- int var5 = var1.getBlockMetadata(var2, var3, var4); -+ public boolean func_82544_h(IBlockAccess par1IBlockAccess, int par2, int par3, int par4) { -+ int var5 = par1IBlockAccess.getBlockMetadata(par2, par3, par4); - int var6 = var5 & 3; - float var7 = 0.5F; - float var8 = 1.0F; -- if((var5 & 4) != 0) { -+ -+ if ((var5 & 4) != 0) { - var7 = 0.0F; - var8 = 0.5F; - } -@@ -161,61 +193,70 @@ - int var14; - int var15; - int var16; -- if(var6 == 0) { -- var14 = var1.getBlockId(var2 - 1, var3, var4); -- var15 = var1.getBlockMetadata(var2 - 1, var3, var4); -- if(isBlockStairsID(var14) && (var5 & 4) == (var15 & 4)) { -+ -+ if (var6 == 0) { -+ var14 = par1IBlockAccess.getBlockId(par2 - 1, par3, par4); -+ var15 = par1IBlockAccess.getBlockMetadata(par2 - 1, par3, par4); -+ -+ if (isBlockStairsID(var14) && (var5 & 4) == (var15 & 4)) { - var16 = var15 & 3; -- if(var16 == 3 && !this.isBlockStairsDirection(var1, var2, var3, var4 - 1, var5)) { -+ -+ if (var16 == 3 && !this.isBlockStairsDirection(par1IBlockAccess, par2, par3, par4 - 1, var5)) { - var11 = 0.0F; - var12 = 0.5F; - var13 = true; -- } else if(var16 == 2 && !this.isBlockStairsDirection(var1, var2, var3, var4 + 1, var5)) { -+ } else if (var16 == 2 && !this.isBlockStairsDirection(par1IBlockAccess, par2, par3, par4 + 1, var5)) { - var11 = 0.5F; - var12 = 1.0F; - var13 = true; - } - } -- } else if(var6 == 1) { -- var14 = var1.getBlockId(var2 + 1, var3, var4); -- var15 = var1.getBlockMetadata(var2 + 1, var3, var4); -- if(isBlockStairsID(var14) && (var5 & 4) == (var15 & 4)) { -+ } else if (var6 == 1) { -+ var14 = par1IBlockAccess.getBlockId(par2 + 1, par3, par4); -+ var15 = par1IBlockAccess.getBlockMetadata(par2 + 1, par3, par4); -+ -+ if (isBlockStairsID(var14) && (var5 & 4) == (var15 & 4)) { - var9 = 0.5F; - var10 = 1.0F; - var16 = var15 & 3; -- if(var16 == 3 && !this.isBlockStairsDirection(var1, var2, var3, var4 - 1, var5)) { -+ -+ if (var16 == 3 && !this.isBlockStairsDirection(par1IBlockAccess, par2, par3, par4 - 1, var5)) { - var11 = 0.0F; - var12 = 0.5F; - var13 = true; -- } else if(var16 == 2 && !this.isBlockStairsDirection(var1, var2, var3, var4 + 1, var5)) { -+ } else if (var16 == 2 && !this.isBlockStairsDirection(par1IBlockAccess, par2, par3, par4 + 1, var5)) { - var11 = 0.5F; - var12 = 1.0F; - var13 = true; - } - } -- } else if(var6 == 2) { -- var14 = var1.getBlockId(var2, var3, var4 - 1); -- var15 = var1.getBlockMetadata(var2, var3, var4 - 1); -- if(isBlockStairsID(var14) && (var5 & 4) == (var15 & 4)) { -+ } else if (var6 == 2) { -+ var14 = par1IBlockAccess.getBlockId(par2, par3, par4 - 1); -+ var15 = par1IBlockAccess.getBlockMetadata(par2, par3, par4 - 1); -+ -+ if (isBlockStairsID(var14) && (var5 & 4) == (var15 & 4)) { - var11 = 0.0F; - var12 = 0.5F; - var16 = var15 & 3; -- if(var16 == 1 && !this.isBlockStairsDirection(var1, var2 - 1, var3, var4, var5)) { -+ -+ if (var16 == 1 && !this.isBlockStairsDirection(par1IBlockAccess, par2 - 1, par3, par4, var5)) { - var13 = true; -- } else if(var16 == 0 && !this.isBlockStairsDirection(var1, var2 + 1, var3, var4, var5)) { -+ } else if (var16 == 0 && !this.isBlockStairsDirection(par1IBlockAccess, par2 + 1, par3, par4, var5)) { - var9 = 0.5F; - var10 = 1.0F; - var13 = true; - } - } -- } else if(var6 == 3) { -- var14 = var1.getBlockId(var2, var3, var4 + 1); -- var15 = var1.getBlockMetadata(var2, var3, var4 + 1); -- if(isBlockStairsID(var14) && (var5 & 4) == (var15 & 4)) { -+ } else if (var6 == 3) { -+ var14 = par1IBlockAccess.getBlockId(par2, par3, par4 + 1); -+ var15 = par1IBlockAccess.getBlockMetadata(par2, par3, par4 + 1); -+ -+ if (isBlockStairsID(var14) && (var5 & 4) == (var15 & 4)) { - var16 = var15 & 3; -- if(var16 == 1 && !this.isBlockStairsDirection(var1, var2 - 1, var3, var4, var5)) { -+ -+ if (var16 == 1 && !this.isBlockStairsDirection(par1IBlockAccess, par2 - 1, par3, par4, var5)) { - var13 = true; -- } else if(var16 == 0 && !this.isBlockStairsDirection(var1, var2 + 1, var3, var4, var5)) { -+ } else if (var16 == 0 && !this.isBlockStairsDirection(par1IBlockAccess, par2 + 1, par3, par4, var5)) { - var9 = 0.5F; - var10 = 1.0F; - var13 = true; -@@ -223,160 +264,239 @@ - } - } - -- if(var13) { -+ if (var13) { - this.setBlockBounds(var9, var7, var11, var10, var8, var12); - } - - return var13; - } - -- public void addCollisionBoxesToList(World var1, int var2, int var3, int var4, AxisAlignedBB var5, List var6, Entity var7) { -- this.func_82541_d(var1, var2, var3, var4); -- super.addCollisionBoxesToList(var1, var2, var3, var4, var5, var6, var7); -- boolean var8 = this.func_82542_g(var1, var2, var3, var4); -- super.addCollisionBoxesToList(var1, var2, var3, var4, var5, var6, var7); -- if(var8 && this.func_82544_h(var1, var2, var3, var4)) { -- super.addCollisionBoxesToList(var1, var2, var3, var4, var5, var6, var7); -+ /** -+ * Adds all intersecting collision boxes to a list. (Be sure to only add boxes to the list if they intersect the mask.) -+ * Parameters: World, X, Y, Z, mask, list, colliding entity -+ */ -+ public void addCollisionBoxesToList(World par1World, int par2, int par3, int par4, AxisAlignedBB par5AxisAlignedBB, List par6List, Entity par7Entity) { -+ this.func_82541_d(par1World, par2, par3, par4); -+ super.addCollisionBoxesToList(par1World, par2, par3, par4, par5AxisAlignedBB, par6List, par7Entity); -+ boolean var8 = this.func_82542_g(par1World, par2, par3, par4); -+ super.addCollisionBoxesToList(par1World, par2, par3, par4, par5AxisAlignedBB, par6List, par7Entity); -+ -+ if (var8 && this.func_82544_h(par1World, par2, par3, par4)) { -+ super.addCollisionBoxesToList(par1World, par2, par3, par4, par5AxisAlignedBB, par6List, par7Entity); - } - - this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F); - } - -- public void randomDisplayTick(World var1, int var2, int var3, int var4, Random var5) { -- this.modelBlock.randomDisplayTick(var1, var2, var3, var4, var5); -- } -- -- public void onBlockClicked(World var1, int var2, int var3, int var4, EntityPlayer var5) { -- this.modelBlock.onBlockClicked(var1, var2, var3, var4, var5); -- } -- -- public void onBlockDestroyedByPlayer(World var1, int var2, int var3, int var4, int var5) { -- this.modelBlock.onBlockDestroyedByPlayer(var1, var2, var3, var4, var5); -- } -- -- public int getMixedBrightnessForBlock(IBlockAccess var1, int var2, int var3, int var4) { -- return this.modelBlock.getMixedBrightnessForBlock(var1, var2, var3, var4); -- } -- -- public float getBlockBrightness(IBlockAccess var1, int var2, int var3, int var4) { -- return this.modelBlock.getBlockBrightness(var1, var2, var3, var4); -- } -- -- public float getExplosionResistance(Entity var1) { -- return this.modelBlock.getExplosionResistance(var1); -- } -- -+ /** -+ * A randomly called display update to be able to add particles or other items for display -+ */ -+ public void randomDisplayTick(World par1World, int par2, int par3, int par4, Random par5Random) { -+ this.modelBlock.randomDisplayTick(par1World, par2, par3, par4, par5Random); -+ } -+ -+ /** -+ * Called when the block is clicked by a player. Args: x, y, z, entityPlayer -+ */ -+ public void onBlockClicked(World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer) { -+ this.modelBlock.onBlockClicked(par1World, par2, par3, par4, par5EntityPlayer); -+ } -+ -+ /** -+ * Called right before the block is destroyed by a player. Args: world, x, y, z, metaData -+ */ -+ public void onBlockDestroyedByPlayer(World par1World, int par2, int par3, int par4, int par5) { -+ this.modelBlock.onBlockDestroyedByPlayer(par1World, par2, par3, par4, par5); -+ } -+ -+ /** -+ * Goes straight to getLightBrightnessForSkyBlocks for Blocks, does some fancy computing for Fluids -+ */ -+ public int getMixedBrightnessForBlock(IBlockAccess par1IBlockAccess, int par2, int par3, int par4) { -+ return this.modelBlock.getMixedBrightnessForBlock(par1IBlockAccess, par2, par3, par4); -+ } -+ -+ /** -+ * How bright to render this block based on the light its receiving. Args: iBlockAccess, x, y, z -+ */ -+ public float getBlockBrightness(IBlockAccess par1IBlockAccess, int par2, int par3, int par4) { -+ return this.modelBlock.getBlockBrightness(par1IBlockAccess, par2, par3, par4); -+ } -+ -+ /** -+ * Returns how much this block can resist explosions from the passed in entity. -+ */ -+ public float getExplosionResistance(Entity par1Entity) { -+ return this.modelBlock.getExplosionResistance(par1Entity); -+ } -+ -+ /** -+ * Returns which pass should this block be rendered on. 0 for solids and 1 for alpha -+ */ - public int getRenderBlockPass() { - return this.modelBlock.getRenderBlockPass(); - } - -- public Icon getIcon(int var1, int var2) { -- return this.modelBlock.getIcon(var1, this.modelBlockMetadata); -- } -- -- public int tickRate(World var1) { -- return this.modelBlock.tickRate(var1); -- } -- -- public AxisAlignedBB getSelectedBoundingBoxFromPool(World var1, int var2, int var3, int var4) { -- return this.modelBlock.getSelectedBoundingBoxFromPool(var1, var2, var3, var4); -- } -- -- public void velocityToAddToEntity(World var1, int var2, int var3, int var4, Entity var5, Vec3 var6) { -- this.modelBlock.velocityToAddToEntity(var1, var2, var3, var4, var5, var6); -- } -- -+ /** -+ * From the specified side and block metadata retrieves the blocks texture. Args: side, metadata -+ */ -+ public Icon getIcon(int par1, int par2) { -+ return this.modelBlock.getIcon(par1, this.modelBlockMetadata); -+ } -+ -+ /** -+ * How many world ticks before ticking -+ */ -+ public int tickRate(World par1World) { -+ return this.modelBlock.tickRate(par1World); -+ } -+ -+ /** -+ * Returns the bounding box of the wired rectangular prism to render. -+ */ -+ public AxisAlignedBB getSelectedBoundingBoxFromPool(World par1World, int par2, int par3, int par4) { -+ return this.modelBlock.getSelectedBoundingBoxFromPool(par1World, par2, par3, par4); -+ } -+ -+ /** -+ * Can add to the passed in vector for a movement vector to be applied to the entity. Args: x, y, z, entity, vec3d -+ */ -+ public void velocityToAddToEntity(World par1World, int par2, int par3, int par4, Entity par5Entity, Vec3 par6Vec3) { -+ this.modelBlock.velocityToAddToEntity(par1World, par2, par3, par4, par5Entity, par6Vec3); -+ } -+ -+ /** -+ * Returns if this block is collidable (only used by Fire). Args: x, y, z -+ */ - public boolean isCollidable() { - return this.modelBlock.isCollidable(); - } - -- public boolean canCollideCheck(int var1, boolean var2) { -- return this.modelBlock.canCollideCheck(var1, var2); -- } -- -- public boolean canPlaceBlockAt(World var1, int var2, int var3, int var4) { -- return this.modelBlock.canPlaceBlockAt(var1, var2, var3, var4); -- } -- -- public void onBlockAdded(World var1, int var2, int var3, int var4) { -- this.onNeighborBlockChange(var1, var2, var3, var4, 0); -- this.modelBlock.onBlockAdded(var1, var2, var3, var4); -- } -- -- public void breakBlock(World var1, int var2, int var3, int var4, int var5, int var6) { -- this.modelBlock.breakBlock(var1, var2, var3, var4, var5, var6); -- } -- -- public void onEntityWalking(World var1, int var2, int var3, int var4, Entity var5) { -- this.modelBlock.onEntityWalking(var1, var2, var3, var4, var5); -- } -- -- public void updateTick(World var1, int var2, int var3, int var4, Random var5) { -- this.modelBlock.updateTick(var1, var2, var3, var4, var5); -- } -- -- public boolean onBlockActivated(World var1, int var2, int var3, int var4, EntityPlayer var5, int var6, float var7, float var8, float var9) { -- return this.modelBlock.onBlockActivated(var1, var2, var3, var4, var5, 0, 0.0F, 0.0F, 0.0F); -- } -- -- public void onBlockDestroyedByExplosion(World var1, int var2, int var3, int var4, Explosion var5) { -- this.modelBlock.onBlockDestroyedByExplosion(var1, var2, var3, var4, var5); -- } -- -- public void onBlockPlacedBy(World var1, int var2, int var3, int var4, EntityLivingBase var5, ItemStack var6) { -- int var7 = MathHelper.floor_double((double)(var5.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3; -- int var8 = var1.getBlockMetadata(var2, var3, var4) & 4; -- if(var7 == 0) { -- var1.setBlockMetadata(var2, var3, var4, 2 | var8, 2); -- } -- -- if(var7 == 1) { -- var1.setBlockMetadata(var2, var3, var4, 1 | var8, 2); -- } -- -- if(var7 == 2) { -- var1.setBlockMetadata(var2, var3, var4, 3 | var8, 2); -- } -- -- if(var7 == 3) { -- var1.setBlockMetadata(var2, var3, var4, 0 | var8, 2); -- } -- -- } -- -- public int onBlockPlaced(World var1, int var2, int var3, int var4, int var5, float var6, float var7, float var8, int var9) { -- return var5 != 0 && (var5 == 1 || (double)var7 <= 0.5D) ? var9 : var9 | 4; -- } -- -- public MovingObjectPosition collisionRayTrace(World var1, int var2, int var3, int var4, Vec3 var5, Vec3 var6) { -+ /** -+ * Returns whether this block is collideable based on the arguments passed in \n@param par1 block metaData \n@param -+ * par2 whether the player right-clicked while holding a boat -+ */ -+ public boolean canCollideCheck(int par1, boolean par2) { -+ return this.modelBlock.canCollideCheck(par1, par2); -+ } -+ -+ /** -+ * Checks to see if its valid to put this block at the specified coordinates. Args: world, x, y, z -+ */ -+ public boolean canPlaceBlockAt(World par1World, int par2, int par3, int par4) { -+ return this.modelBlock.canPlaceBlockAt(par1World, par2, par3, par4); -+ } -+ -+ /** -+ * Called whenever the block is added into the world. Args: world, x, y, z -+ */ -+ public void onBlockAdded(World par1World, int par2, int par3, int par4) { -+ this.onNeighborBlockChange(par1World, par2, par3, par4, 0); -+ this.modelBlock.onBlockAdded(par1World, par2, par3, par4); -+ } -+ -+ /** -+ * Called on server worlds only when the block has been replaced by a different block ID, or the same block with a -+ * different metadata value, but before the new metadata value is set. Args: World, x, y, z, old block ID, old metadata -+ */ -+ public void breakBlock(World par1World, int par2, int par3, int par4, int par5, int par6) { -+ this.modelBlock.breakBlock(par1World, par2, par3, par4, par5, par6); -+ } -+ -+ /** -+ * Called whenever an entity is walking on top of this block. Args: world, x, y, z, entity -+ */ -+ public void onEntityWalking(World par1World, int par2, int par3, int par4, Entity par5Entity) { -+ this.modelBlock.onEntityWalking(par1World, par2, par3, par4, par5Entity); -+ } -+ -+ /** -+ * Ticks the block if it's been scheduled -+ */ -+ public void updateTick(World par1World, int par2, int par3, int par4, Random par5Random) { -+ this.modelBlock.updateTick(par1World, par2, par3, par4, par5Random); -+ } -+ -+ /** -+ * Called upon block activation (right click on the block.) -+ */ -+ public boolean onBlockActivated(World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer, int par6, float par7, float par8, float par9) { -+ return this.modelBlock.onBlockActivated(par1World, par2, par3, par4, par5EntityPlayer, 0, 0.0F, 0.0F, 0.0F); -+ } -+ -+ /** -+ * Called upon the block being destroyed by an explosion -+ */ -+ public void onBlockDestroyedByExplosion(World par1World, int par2, int par3, int par4, Explosion par5Explosion) { -+ this.modelBlock.onBlockDestroyedByExplosion(par1World, par2, par3, par4, par5Explosion); -+ } -+ -+ /** -+ * Called when the block is placed in the world. -+ */ -+ public void onBlockPlacedBy(World par1World, int par2, int par3, int par4, EntityLivingBase par5EntityLivingBase, ItemStack par6ItemStack) { -+ int var7 = MathHelper.floor_double((double)(par5EntityLivingBase.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3; -+ int var8 = par1World.getBlockMetadata(par2, par3, par4) & 4; -+ -+ if (var7 == 0) { -+ par1World.setBlockMetadataWithNotify(par2, par3, par4, 2 | var8, 2); -+ } -+ -+ if (var7 == 1) { -+ par1World.setBlockMetadataWithNotify(par2, par3, par4, 1 | var8, 2); -+ } -+ -+ if (var7 == 2) { -+ par1World.setBlockMetadataWithNotify(par2, par3, par4, 3 | var8, 2); -+ } -+ -+ if (var7 == 3) { -+ par1World.setBlockMetadataWithNotify(par2, par3, par4, 0 | var8, 2); -+ } -+ } -+ -+ /** -+ * Called when a block is placed using its ItemBlock. Args: World, X, Y, Z, side, hitX, hitY, hitZ, block metadata -+ */ -+ public int onBlockPlaced(World par1World, int par2, int par3, int par4, int par5, float par6, float par7, float par8, int par9) { -+ return par5 != 0 && (par5 == 1 || (double)par7 <= 0.5D) ? par9 : par9 | 4; -+ } -+ -+ /** -+ * Ray traces through the blocks collision from start vector to end vector returning a ray trace hit. Args: world, x, -+ * y, z, startVec, endVec -+ */ -+ public MovingObjectPosition collisionRayTrace(World par1World, int par2, int par3, int par4, Vec3 par5Vec3, Vec3 par6Vec3) { - MovingObjectPosition[] var7 = new MovingObjectPosition[8]; -- int var8 = var1.getBlockMetadata(var2, var3, var4); -+ int var8 = par1World.getBlockMetadata(par2, par3, par4); - int var9 = var8 & 3; - boolean var10 = (var8 & 4) == 4; - int[] var11 = field_72159_a[var9 + (var10 ? 4 : 0)]; - this.field_72156_cr = true; -- - int var14; - int var15; - int var16; -- for(int var12 = 0; var12 < 8; ++var12) { -+ -+ for (int var12 = 0; var12 < 8; ++var12) { - this.field_72160_cs = var12; - int[] var13 = var11; - var14 = var11.length; - -- for(var15 = 0; var15 < var14; ++var15) { -+ for (var15 = 0; var15 < var14; ++var15) { - var16 = var13[var15]; -- if(var16 == var12) { -+ -+ if (var16 == var12) { -+ ; - } - } - -- var7[var12] = super.collisionRayTrace(var1, var2, var3, var4, var5, var6); -+ var7[var12] = super.collisionRayTrace(par1World, par2, par3, par4, par5Vec3, par6Vec3); - } - - int[] var21 = var11; - int var23 = var11.length; - -- for(var14 = 0; var14 < var23; ++var14) { -+ for (var14 = 0; var14 < var23; ++var14) { - var15 = var21[var14]; - var7[var15] = null; - } -@@ -386,11 +506,13 @@ - MovingObjectPosition[] var25 = var7; - var16 = var7.length; - -- for(int var17 = 0; var17 < var16; ++var17) { -+ for (int var17 = 0; var17 < var16; ++var17) { - MovingObjectPosition var18 = var25[var17]; -- if(var18 != null) { -- double var19 = var18.hitVec.squareDistanceTo(var6); -- if(var19 > var24) { -+ -+ if (var18 != null) { -+ double var19 = var18.hitVec.squareDistanceTo(par6Vec3); -+ -+ if (var19 > var24) { - var22 = var18; - var24 = var19; - } -@@ -400,6 +522,9 @@ - return var22; - } - -- public void registerIcons(IconRegister var1) { -- } -+ /** -+ * When this method is called, your block should register all the icons it needs with the given IconRegister. This is -+ * the only chance you get to register icons. -+ */ -+ public void registerIcons(IconRegister par1IconRegister) {} - } ---- net/minecraft/src/GuiWinGame.java -+++ net/minecraft/src/GuiWinGame.java -@@ -11,39 +11,57 @@ - public class GuiWinGame extends GuiScreen { - private static final ResourceLocation minecraftLogoTexture = new ResourceLocation("textures/gui/title/minecraft.png"); - private static final ResourceLocation field_110361_b = new ResourceLocation("textures/misc/vignette.png"); -+ -+ /** Counts the number of screen updates. */ - private int updateCounter; -- private List d; -+ -+ /** List of lines on the ending poem and credits. */ -+ private List lines; - private int field_73989_c; - private float field_73987_d = 0.5F; - -+ /** -+ * Called from the main game loop to update the screen. -+ */ - public void updateScreen() { - ++this.updateCounter; - float var1 = (float)(this.field_73989_c + this.height + this.height + 24) / this.field_73987_d; -- if((float)this.updateCounter > var1) { -- this.respawnPlayer(); -- } -- -- } -- -- protected void keyTyped(char var1, int var2) { -- if(var2 == 1) { -- this.respawnPlayer(); -- } -- -- } -- -+ -+ if ((float)this.updateCounter > var1) { -+ this.respawnPlayer(); -+ } -+ } -+ -+ /** -+ * Fired when a key is typed. This is the equivalent of KeyListener.keyTyped(KeyEvent e). -+ */ -+ protected void keyTyped(char par1, int par2) { -+ if (par2 == 1) { -+ this.respawnPlayer(); -+ } -+ } -+ -+ /** -+ * Respawns the player. -+ */ - private void respawnPlayer() { - this.mc.thePlayer.sendQueue.addToSendQueue(new Packet205ClientCommand(1)); - this.mc.displayGuiScreen((GuiScreen)null); - } - -+ /** -+ * Returns true if this GUI should pause the game when it is displayed in single-player -+ */ - public boolean doesGuiPauseGame() { - return true; - } - -+ /** -+ * Adds the buttons (and other controls) to the screen in question. -+ */ - public void initGui() { -- if(this.d == null) { -- this.d = new ArrayList(); -+ if (this.lines == null) { -+ this.lines = new ArrayList(); - - try { - String var1 = ""; -@@ -51,65 +69,60 @@ - short var3 = 274; - BufferedReader var4 = new BufferedReader(new InputStreamReader(this.mc.getResourceManager().getResource(new ResourceLocation("texts/end.txt")).getInputStream(), Charsets.UTF_8)); - Random var5 = new Random(8124371L); -- -- while(true) { -- var1 = var4.readLine(); -- int var6; -- if(var1 == null) { -- for(var6 = 0; var6 < 8; ++var6) { -- this.d.add(""); -- } -- -- var4 = new BufferedReader(new InputStreamReader(this.mc.getResourceManager().getResource(new ResourceLocation("texts/credits.txt")).getInputStream(), Charsets.UTF_8)); -- -- while(true) { -- var1 = var4.readLine(); -- if(var1 == null) { -- this.field_73989_c = this.d.size() * 12; -- return; -- } -- -- var1 = var1.replaceAll("PLAYERNAME", this.mc.getSession().getUsername()); -- var1 = var1.replaceAll("\t", " "); -- this.d.addAll(this.mc.fontRenderer.listFormattedStringToWidth(var1, var3)); -- this.d.add(""); -- } -- } -- -+ int var6; -+ -+ while ((var1 = var4.readLine()) != null) { - String var7; - String var8; -- for(var1 = var1.replaceAll("PLAYERNAME", this.mc.getSession().getUsername()); var1.contains(var2); var1 = var7 + EnumChatFormatting.WHITE + EnumChatFormatting.OBFUSCATED + "XXXXXXXX".substring(0, var5.nextInt(4) + 3) + var8) { -+ -+ for (var1 = var1.replaceAll("PLAYERNAME", this.mc.getSession().getUsername()); var1.contains(var2); var1 = var7 + EnumChatFormatting.WHITE + EnumChatFormatting.OBFUSCATED + "XXXXXXXX".substring(0, var5.nextInt(4) + 3) + var8) { - var6 = var1.indexOf(var2); - var7 = var1.substring(0, var6); - var8 = var1.substring(var6 + var2.length()); - } - -- this.d.addAll(this.mc.fontRenderer.listFormattedStringToWidth(var1, var3)); -- this.d.add(""); -- } -+ this.lines.addAll(this.mc.fontRenderer.listFormattedStringToWidth(var1, var3)); -+ this.lines.add(""); -+ } -+ -+ for (var6 = 0; var6 < 8; ++var6) { -+ this.lines.add(""); -+ } -+ -+ var4 = new BufferedReader(new InputStreamReader(this.mc.getResourceManager().getResource(new ResourceLocation("texts/credits.txt")).getInputStream(), Charsets.UTF_8)); -+ -+ while ((var1 = var4.readLine()) != null) { -+ var1 = var1.replaceAll("PLAYERNAME", this.mc.getSession().getUsername()); -+ var1 = var1.replaceAll("\t", " "); -+ this.lines.addAll(this.mc.fontRenderer.listFormattedStringToWidth(var1, var3)); -+ this.lines.add(""); -+ } -+ -+ this.field_73989_c = this.lines.size() * 12; - } catch (Exception var9) { - var9.printStackTrace(); - } - } - } - -- private void func_73986_b(int var1, int var2, float var3) { -+ private void func_73986_b(int par1, int par2, float par3) { - Tessellator var4 = Tessellator.instance; - this.mc.getTextureManager().bindTexture(Gui.optionsBackground); - var4.startDrawingQuads(); - var4.setColorRGBA_F(1.0F, 1.0F, 1.0F, 1.0F); - int var5 = this.width; -- float var6 = 0.0F - ((float)this.updateCounter + var3) * 0.5F * this.field_73987_d; -- float var7 = (float)this.height - ((float)this.updateCounter + var3) * 0.5F * this.field_73987_d; -+ float var6 = 0.0F - ((float)this.updateCounter + par3) * 0.5F * this.field_73987_d; -+ float var7 = (float)this.height - ((float)this.updateCounter + par3) * 0.5F * this.field_73987_d; - float var8 = 0.015625F; -- float var9 = ((float)this.updateCounter + var3 - 0.0F) * 0.02F; -+ float var9 = ((float)this.updateCounter + par3 - 0.0F) * 0.02F; - float var10 = (float)(this.field_73989_c + this.height + this.height + 24) / this.field_73987_d; -- float var11 = (var10 - 20.0F - ((float)this.updateCounter + var3)) * 0.005F; -- if(var11 < var9) { -+ float var11 = (var10 - 20.0F - ((float)this.updateCounter + par3)) * 0.005F; -+ -+ if (var11 < var9) { - var9 = var11; - } - -- if(var9 > 1.0F) { -+ if (var9 > 1.0F) { - var9 = 1.0F; - } - -@@ -123,13 +136,16 @@ - var4.draw(); - } - -- public void drawScreen(int var1, int var2, float var3) { -- this.func_73986_b(var1, var2, var3); -+ /** -+ * Draws the screen and all the components in it. -+ */ -+ public void drawScreen(int par1, int par2, float par3) { -+ this.func_73986_b(par1, par2, par3); - Tessellator var4 = Tessellator.instance; - short var5 = 274; - int var6 = this.width / 2 - var5 / 2; - int var7 = this.height + 50; -- float var8 = -((float)this.updateCounter + var3) * this.field_73987_d; -+ float var8 = -((float)this.updateCounter + par3) * this.field_73987_d; - GL11.glPushMatrix(); - GL11.glTranslatef(0.0F, var8, 0.0F); - this.mc.getTextureManager().bindTexture(minecraftLogoTexture); -@@ -138,22 +154,24 @@ - this.drawTexturedModalRect(var6 + 155, var7, 0, 45, 155, 44); - var4.setColorOpaque_I(16777215); - int var9 = var7 + 200; -- - int var10; -- for(var10 = 0; var10 < this.d.size(); ++var10) { -- if(var10 == this.d.size() - 1) { -+ -+ for (var10 = 0; var10 < this.lines.size(); ++var10) { -+ if (var10 == this.lines.size() - 1) { - float var11 = (float)var9 + var8 - (float)(this.height / 2 - 6); -- if(var11 < 0.0F) { -+ -+ if (var11 < 0.0F) { - GL11.glTranslatef(0.0F, -var11, 0.0F); - } - } - -- if((float)var9 + var8 + 12.0F + 8.0F > 0.0F && (float)var9 + var8 < (float)this.height) { -- String var12 = (String)this.d.get(var10); -- if(var12.startsWith("[C]")) { -+ if ((float)var9 + var8 + 12.0F + 8.0F > 0.0F && (float)var9 + var8 < (float)this.height) { -+ String var12 = (String)this.lines.get(var10); -+ -+ if (var12.startsWith("[C]")) { - this.fontRenderer.drawStringWithShadow(var12.substring(3), var6 + (var5 - this.fontRenderer.getStringWidth(var12.substring(3))) / 2, var9, 16777215); - } else { -- this.fontRenderer.b.setSeed((long)var10 * 4238972211L + (long)(this.updateCounter / 4)); -+ this.fontRenderer.fontRandom.setSeed((long)var10 * 4238972211L + (long)(this.updateCounter / 4)); - this.fontRenderer.drawStringWithShadow(var12, var6, var9, 16777215); - } - } -@@ -175,6 +193,6 @@ - var4.addVertexWithUV(0.0D, 0.0D, (double)this.zLevel, 0.0D, 0.0D); - var4.draw(); - GL11.glDisable(GL11.GL_BLEND); -- super.drawScreen(var1, var2, var3); -+ super.drawScreen(par1, par2, par3); - } - } ---- /dev/null -+++ org/spoutcraft/client/inventory/ItemData.java -@@ -1,0 +1,69 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.client.inventory; -+ -+import java.util.HashMap; -+ -+public class ItemData { -+ public final int id; -+ public final short data; -+ private static final HashMap> itemDatas= new HashMap>(); -+ protected ItemData(int id) { -+ this.id = id; -+ this.data = 0; -+ } -+ -+ private ItemData(int id, int data) { -+ this.id = id; -+ this.data = (short)data; -+ } -+ -+ @Override -+ public boolean equals(Object obj) { -+ if (obj instanceof ItemData) { -+ ItemData temp = (ItemData)obj; -+ return temp.id == id && temp.data == data; -+ } -+ return false; -+ } -+ -+ @Override -+ public int hashCode() { -+ return 37 * id * 7 * (2 + data); -+ } -+ -+ public static ItemData getItemData(int id) { -+ return getItemData(id, 0); -+ } -+ -+ public static ItemData getItemData(int id, int data) { -+ HashMap itemDatasForId = itemDatas.get(id); -+ if (itemDatasForId == null) { -+ itemDatasForId = new HashMap(); -+ itemDatas.put(id, itemDatasForId); -+ } -+ ItemData itemData = itemDatasForId.get(data); -+ if (itemData == null) { -+ itemData = new ItemData(id, data); -+ itemDatasForId.put(data, itemData); -+ } -+ return itemData; -+ } -+} ---- net/minecraft/src/ModelSquid.java -+++ net/minecraft/src/ModelSquid.java -@@ -1,7 +1,11 @@ - package net.minecraft.src; - - public class ModelSquid extends ModelBase { -+ -+ /** The squid's body */ - ModelRenderer squidBody; -+ -+ /** The squid's tentacles */ - ModelRenderer[] squidTentacles = new ModelRenderer[8]; - - public ModelSquid() { -@@ -10,7 +14,7 @@ - this.squidBody.addBox(-6.0F, -8.0F, -6.0F, 12, 16, 12); - this.squidBody.rotationPointY += (float)(24 + var1); - -- for(int var2 = 0; var2 < this.squidTentacles.length; ++var2) { -+ for (int var2 = 0; var2 < this.squidTentacles.length; ++var2) { - this.squidTentacles[var2] = new ModelRenderer(this, 48, 0); - double var3 = (double)var2 * Math.PI * 2.0D / (double)this.squidTentacles.length; - float var5 = (float)Math.cos(var3) * 5.0F; -@@ -19,30 +23,35 @@ - this.squidTentacles[var2].rotationPointX = var5; - this.squidTentacles[var2].rotationPointZ = var6; - this.squidTentacles[var2].rotationPointY = (float)(31 + var1); -- var3 = (double)var2 * Math.PI * -2.0D / (double)this.squidTentacles.length + Math.PI * 0.5D; -+ var3 = (double)var2 * Math.PI * -2.0D / (double)this.squidTentacles.length + (Math.PI / 2D); - this.squidTentacles[var2].rotateAngleY = (float)var3; - } -- - } - -- public void setRotationAngles(float var1, float var2, float var3, float var4, float var5, float var6, Entity var7) { -+ /** -+ * Sets the model's various rotation angles. For bipeds, par1 and par2 are used for animating the movement of arms and -+ * legs, where par1 represents the time(so that arms and legs swing back and forth) and par2 represents how "far" arms -+ * and legs can swing at most. -+ */ -+ public void setRotationAngles(float par1, float par2, float par3, float par4, float par5, float par6, Entity par7Entity) { - ModelRenderer[] var8 = this.squidTentacles; - int var9 = var8.length; - -- for(int var10 = 0; var10 < var9; ++var10) { -+ for (int var10 = 0; var10 < var9; ++var10) { - ModelRenderer var11 = var8[var10]; -- var11.rotateAngleX = var3; -+ var11.rotateAngleX = par3; - } -- - } - -- public void render(Entity var1, float var2, float var3, float var4, float var5, float var6, float var7) { -- this.setRotationAngles(var2, var3, var4, var5, var6, var7, var1); -- this.squidBody.render(var7); -+ /** -+ * Sets the models various rotation angles then renders the model. -+ */ -+ public void render(Entity par1Entity, float par2, float par3, float par4, float par5, float par6, float par7) { -+ this.setRotationAngles(par2, par3, par4, par5, par6, par7, par1Entity); -+ this.squidBody.render(par7); - -- for(int var8 = 0; var8 < this.squidTentacles.length; ++var8) { -- this.squidTentacles[var8].render(var7); -+ for (int var8 = 0; var8 < this.squidTentacles.length; ++var8) { -+ this.squidTentacles[var8].render(par7); - } -- - } - } ---- net/minecraft/src/RecipesArmor.java -+++ net/minecraft/src/RecipesArmor.java -@@ -1,18 +1,24 @@ - package net.minecraft.src; - - public class RecipesArmor { -- private String[][] a = new String[][]{{"XXX", "X X"}, {"X X", "XXX", "XXX"}, {"XXX", "X X", "X X"}, {"X X", "X X"}}; -- private Object[][] b = new Object[][]{{Item.leather, Block.fire, Item.ingotIron, Item.diamond, Item.ingotGold}, {Item.helmetLeather, Item.helmetChain, Item.helmetIron, Item.helmetDiamond, Item.helmetGold}, {Item.plateLeather, Item.plateChain, Item.plateIron, Item.plateDiamond, Item.plateGold}, {Item.legsLeather, Item.legsChain, Item.legsIron, Item.legsDiamond, Item.legsGold}, {Item.bootsLeather, Item.bootsChain, Item.bootsIron, Item.bootsDiamond, Item.bootsGold}}; -- -- public void addRecipes(CraftingManager var1) { -- for(int var2 = 0; var2 < this.b[0].length; ++var2) { -- Object var3 = this.b[0][var2]; -- -- for(int var4 = 0; var4 < this.b.length - 1; ++var4) { -- Item var5 = (Item)this.b[var4 + 1][var2]; -- var1.addRecipe(new ItemStack(var5), new Object[]{this.a[var4], Character.valueOf('X'), var3}); -+ private String[][] recipePatterns = new String[][] {{"XXX", "X X"}, {"X X", "XXX", "XXX"}, {"XXX", "X X", "X X"}, {"X X", "X X"}}; -+ private Object[][] recipeItems; -+ -+ public RecipesArmor() { -+ this.recipeItems = new Object[][] {{Item.leather, Block.fire, Item.ingotIron, Item.diamond, Item.ingotGold}, {Item.helmetLeather, Item.helmetChain, Item.helmetIron, Item.helmetDiamond, Item.helmetGold}, {Item.plateLeather, Item.plateChain, Item.plateIron, Item.plateDiamond, Item.plateGold}, {Item.legsLeather, Item.legsChain, Item.legsIron, Item.legsDiamond, Item.legsGold}, {Item.bootsLeather, Item.bootsChain, Item.bootsIron, Item.bootsDiamond, Item.bootsGold}}; -+ } -+ -+ /** -+ * Adds the armor recipes to the CraftingManager. -+ */ -+ public void addRecipes(CraftingManager par1CraftingManager) { -+ for (int var2 = 0; var2 < this.recipeItems[0].length; ++var2) { -+ Object var3 = this.recipeItems[0][var2]; -+ -+ for (int var4 = 0; var4 < this.recipeItems.length - 1; ++var4) { -+ Item var5 = (Item)this.recipeItems[var4 + 1][var2]; -+ par1CraftingManager.addRecipe(new ItemStack(var5), new Object[] {this.recipePatterns[var4], 'X', var3}); - } - } -- - } - } ---- /dev/null -+++ org/spoutcraft/client/gui/minimap/ResetButton.java -@@ -1,0 +1,41 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.client.gui.minimap; -+ -+import org.spoutcraft.client.SpoutClient; -+import org.spoutcraft.client.gui.SafeButton; -+ -+public class ResetButton extends SafeButton { -+ GuiMinimapMenu parent; -+ -+ public ResetButton(GuiMinimapMenu parent) { -+ setText("Reset to Default"); -+ setTooltip("Resets all options to default settings."); -+ this.parent = parent; -+ } -+ -+ @Override -+ protected void executeAction() { -+ MinimapConfig.initialize(false); -+ MinimapConfig.getInstance().save(); -+ -+ SpoutClient.getHandle().displayGuiScreen(new GuiMinimapMenu(parent.parent)); -+ } -+} ---- net/minecraft/src/BlockWood.java -+++ net/minecraft/src/BlockWood.java -@@ -3,39 +3,53 @@ - import java.util.List; - - public class BlockWood extends Block { -- public static final String[] a = new String[]{"oak", "spruce", "birch", "jungle"}; -+ -+ /** The type of tree this block came from. */ -+ public static final String[] woodType = new String[] {"oak", "spruce", "birch", "jungle"}; - private Icon[] iconArray; - -- public BlockWood(int var1) { -- super(var1, Material.wood); -+ public BlockWood(int par1) { -+ super(par1, Material.wood); - this.setCreativeTab(CreativeTabs.tabBlock); - } - -- public Icon getIcon(int var1, int var2) { -- if(var2 < 0 || var2 >= this.iconArray.length) { -- var2 = 0; -- } -- -- return this.iconArray[var2]; -- } -- -- public int damageDropped(int var1) { -- return var1; -- } -- -- public void getSubBlocks(int var1, CreativeTabs var2, List var3) { -- var3.add(new ItemStack(var1, 1, 0)); -- var3.add(new ItemStack(var1, 1, 1)); -- var3.add(new ItemStack(var1, 1, 2)); -- var3.add(new ItemStack(var1, 1, 3)); -- } -- -- public void registerIcons(IconRegister var1) { -- this.iconArray = new Icon[a.length]; -- -- for(int var2 = 0; var2 < this.iconArray.length; ++var2) { -- this.iconArray[var2] = var1.registerIcon(this.getTextureName() + "_" + a[var2]); -- } -- -+ /** -+ * From the specified side and block metadata retrieves the blocks texture. Args: side, metadata -+ */ -+ public Icon getIcon(int par1, int par2) { -+ if (par2 < 0 || par2 >= this.iconArray.length) { -+ par2 = 0; -+ } -+ -+ return this.iconArray[par2]; -+ } -+ -+ /** -+ * Determines the damage on the item the block drops. Used in cloth and wood. -+ */ -+ public int damageDropped(int par1) { -+ return par1; -+ } -+ -+ /** -+ * returns a list of blocks with the same ID, but different meta (eg: wood returns 4 blocks) -+ */ -+ public void getSubBlocks(int par1, CreativeTabs par2CreativeTabs, List par3List) { -+ par3List.add(new ItemStack(par1, 1, 0)); -+ par3List.add(new ItemStack(par1, 1, 1)); -+ par3List.add(new ItemStack(par1, 1, 2)); -+ par3List.add(new ItemStack(par1, 1, 3)); -+ } -+ -+ /** -+ * When this method is called, your block should register all the icons it needs with the given IconRegister. This is -+ * the only chance you get to register icons. -+ */ -+ public void registerIcons(IconRegister par1IconRegister) { -+ this.iconArray = new Icon[woodType.length]; -+ -+ for (int var2 = 0; var2 < this.iconArray.length; ++var2) { -+ this.iconArray[var2] = par1IconRegister.registerIcon(this.getTextureName() + "_" + woodType[var2]); -+ } - } - } ---- /dev/null -+++ org/spoutcraft/api/gui/GenericSlot.java -@@ -1,0 +1,151 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.api.gui; -+ -+import java.io.IOException; -+import java.util.ArrayList; -+import java.util.HashMap; -+import java.util.List; -+ -+import net.minecraft.src.Enchantment; -+ -+import org.spoutcraft.api.Spoutcraft; -+import org.spoutcraft.api.inventory.ItemStack; -+import org.spoutcraft.api.io.SpoutInputStream; -+import org.spoutcraft.api.io.SpoutOutputStream; -+ -+public class GenericSlot extends GenericControl implements Slot { -+ private ItemStack stack = new ItemStack(0); -+ private int depth = 16; -+ private boolean renderAmount = true; -+ -+ public WidgetType getType() { -+ return WidgetType.Slot; -+ } -+ -+ public void render() { -+ Spoutcraft.getRenderDelegate().render(this); -+ } -+ -+ public ItemStack getItem() { -+ if (stack == null) { -+ stack = new ItemStack(0); -+ } -+ return stack.clone(); -+ } -+ -+ public Slot setItem(ItemStack item) { -+ if (item == null) { -+ stack = new ItemStack(0); -+ setTooltip(""); -+ return this; -+ } -+ stack = item.clone(); -+ setTooltip(Spoutcraft.getMaterialManager().getToolTip(stack)); -+ return this; -+ } -+ -+ public boolean doesRenderAmount() { -+ return renderAmount; -+ } -+ -+ public GenericSlot setRenderAmount(boolean renderAmount) { -+ this.renderAmount = renderAmount; -+ return this; -+ } -+ -+ public boolean onItemPut(ItemStack item) { -+ return true; -+ } -+ -+ public boolean onItemTake(ItemStack item) { -+ return true; -+ } -+ -+ public void onItemShiftClicked() { -+ } -+ -+ public boolean onItemExchange(ItemStack current, ItemStack cursor) { -+ return true; -+ } -+ -+ public int getDepth() { -+ return depth; -+ } -+ -+ public Slot setDepth(int depth) { -+ this.depth = depth; -+ return this; -+ } -+ -+ @Override -+ public void readData(SpoutInputStream input) throws IOException { -+ super.readData(input); -+ -+ setItem(new ItemStack(input.readInt(), (int) input.readShort(), input.readShort())); -+ depth = input.readInt(); -+ -+ renderAmount = input.readBoolean(); -+ boolean hasDisplayName = input.readBoolean(); -+ if (hasDisplayName) { -+ stack.setDisplayName(input.readString()); -+ } -+ -+ boolean hasLore = input.readBoolean(); -+ if (hasLore) { -+ // TODO: Gather lore -+ int lsize = input.readInt(); -+ List lore = new ArrayList(); -+ for (int i = 0; i enchants = new HashMap(); -+ for (int i = 0; i 0) { -+ stack.setEnchants(enchants); -+ } -+ } -+ -+ setTooltip(Spoutcraft.getMaterialManager().getToolTip(stack)); -+ -+ } -+ -+ @Override -+ public void writeData(SpoutOutputStream output) throws IOException { -+ super.writeData(output); -+ output.writeInt(stack.getTypeId()); -+ output.writeShort((short)stack.getAmount()); -+ output.writeShort(stack.getDurability()); -+ output.writeInt(depth); -+ //TODO Server probably doesn't need to know this but eh what the hell... -+ output.writeBoolean(renderAmount); -+ } -+} ---- /dev/null -+++ org/spoutcraft/api/block/design/GenericBlockDesign.java -@@ -1,0 +1,463 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.api.block.design; -+ -+import java.io.DataInputStream; -+import java.io.IOException; -+import java.util.Random; -+ -+import org.lwjgl.opengl.GL11; -+ -+import org.spoutcraft.api.Spoutcraft; -+import org.spoutcraft.api.gui.MinecraftTessellator; -+import org.spoutcraft.api.io.SpoutInputStream; -+import org.spoutcraft.api.material.Block; -+import org.spoutcraft.api.packet.PacketUtil; -+import org.spoutcraft.api.util.MutableIntegerVector; -+import org.spoutcraft.client.SpoutcraftWorld; -+ -+public class GenericBlockDesign implements BlockDesign { -+ protected boolean reset = false; -+ -+ protected float lowXBound; -+ protected float lowYBound; -+ protected float lowZBound; -+ -+ protected float highXBound; -+ protected float highYBound; -+ protected float highZBound; -+ -+ protected String textureURL; -+ protected String textureAddon; -+ -+ protected Texture texture; -+ -+ protected float[][] xPos; -+ protected float[][] yPos; -+ protected float[][] zPos; -+ -+ protected float[][] textXPos; -+ protected float[][] textYPos; -+ -+ protected int[] lightSourceXOffset; -+ protected int[] lightSourceYOffset; -+ protected int[] lightSourceZOffset; -+ -+ protected float maxBrightness = 1.0F; -+ protected float minBrightness = 0F; -+ -+ protected float brightness = 0.5F; -+ -+ protected int renderPass = 0; -+ -+ public GenericBlockDesign() { -+ } -+ -+ public GenericBlockDesign(float lowXBound, float lowYBound, float lowZBound, float highXBound, float highYBound, float highZBound, String textureURL, String textureAddon, float[][] xPos, float[][] yPos, float[][] zPos, float[][] textXPos, float[][] textYPos, int renderPass) { -+ this.lowXBound = lowXBound; -+ this.lowYBound = lowYBound; -+ this.lowZBound = lowZBound; -+ -+ this.highXBound = highXBound; -+ this.highYBound = highYBound; -+ this.highZBound = highZBound; -+ -+ this.textureURL = textureURL; -+ this.textureAddon = textureAddon; -+ this.xPos = xPos; -+ this.yPos = yPos; -+ this.zPos = zPos; -+ this.textXPos = textXPos; -+ this.textYPos = textYPos; -+ this.renderPass = renderPass; -+ } -+ -+ public float[][] getX() { -+ return xPos; -+ } -+ -+ public float[][] getY() { -+ return yPos; -+ } -+ -+ public float[][] getZ() { -+ return zPos; -+ } -+ -+ public float[][] getTextureXPos() { -+ return textXPos; -+ } -+ -+ public float[][] getTextureYPos() { -+ return textYPos; -+ } -+ -+ public float getBrightness() { -+ return brightness; -+ } -+ -+ public float getMaxBrightness() { -+ return maxBrightness; -+ } -+ -+ public float getMinBrightness() { -+ return minBrightness; -+ } -+ -+ public float getLowXBound() { -+ return lowXBound; -+ } -+ -+ public float getLowYBound() { -+ return lowYBound; -+ } -+ -+ public float getLowZBound() { -+ return lowZBound; -+ } -+ -+ public float getHighXBound() { -+ return highXBound; -+ } -+ -+ public float getHighYBound() { -+ return highYBound; -+ } -+ -+ public float getHighZBound() { -+ return highZBound; -+ } -+ -+ public BlockDesign setMaxBrightness(float maxBrightness) { -+ this.maxBrightness = maxBrightness; -+ return this; -+ } -+ -+ public BlockDesign setMinBrightness(float minBrightness) { -+ this.minBrightness = minBrightness; -+ return this; -+ } -+ -+ public BlockDesign setBrightness(float brightness) { -+ this.brightness = brightness * maxBrightness + (1 - brightness) * minBrightness; -+ return this; -+ } -+ -+ public BlockDesign setRenderPass(int renderPass) { -+ this.renderPass = renderPass; -+ return this; -+ } -+ -+ public int getRenderPass() { -+ return renderPass; -+ } -+ -+ public int getVersion() { -+ return 3; -+ } -+ -+ public void read(SpoutInputStream input) throws IOException { -+ textureURL = PacketUtil.readString(input); -+ if (textureURL.equals(resetString)) { -+ reset = true; -+ return; -+ } -+ reset = false; -+ textureAddon = PacketUtil.readString(input); -+ xPos = PacketUtil.readDoubleArray(input); -+ yPos = PacketUtil.readDoubleArray(input); -+ zPos = PacketUtil.readDoubleArray(input); -+ textXPos = PacketUtil.readDoubleArray(input); -+ textYPos = PacketUtil.readDoubleArray(input); -+ lowXBound = input.readFloat(); -+ lowYBound = input.readFloat(); -+ lowZBound = input.readFloat(); -+ highXBound = input.readFloat(); -+ highYBound = input.readFloat(); -+ highZBound = input.readFloat(); -+ maxBrightness = input.readFloat(); -+ minBrightness = input.readFloat(); -+ renderPass = input.readInt(); -+ lightSourceXOffset = PacketUtil.readIntArray(input); -+ lightSourceYOffset = PacketUtil.readIntArray(input); -+ lightSourceZOffset = PacketUtil.readIntArray(input); -+ } -+ -+ public void read(DataInputStream input) throws IOException { -+ textureURL = PacketUtil.readString(input); -+ if (textureURL.equals(resetString)) { -+ reset = true; -+ return; -+ } -+ reset = false; -+ textureAddon = PacketUtil.readString(input); -+ xPos = PacketUtil.readDoubleArray(input); -+ yPos = PacketUtil.readDoubleArray(input); -+ zPos = PacketUtil.readDoubleArray(input); -+ textXPos = PacketUtil.readDoubleArray(input); -+ textYPos = PacketUtil.readDoubleArray(input); -+ lowXBound = input.readFloat(); -+ lowYBound = input.readFloat(); -+ lowZBound = input.readFloat(); -+ highXBound = input.readFloat(); -+ highYBound = input.readFloat(); -+ highZBound = input.readFloat(); -+ maxBrightness = input.readFloat(); -+ minBrightness = input.readFloat(); -+ renderPass = input.readInt(); -+ lightSourceXOffset = PacketUtil.readIntArray(input); -+ lightSourceYOffset = PacketUtil.readIntArray(input); -+ lightSourceZOffset = PacketUtil.readIntArray(input); -+ } -+ -+ private final static String resetString = "[reset]"; -+ -+ public BlockDesign setTexture(String addon, String textureURL) { -+ this.textureAddon = addon; -+ this.textureURL = textureURL; -+ return this; -+ } -+ -+ public BlockDesign setBoundingBox(float lowX, float lowY, float lowZ, float highX, float highY, float highZ) { -+ this.lowXBound = lowX; -+ this.lowYBound = lowY; -+ this.lowZBound = lowZ; -+ this.highXBound = highX; -+ this.highYBound = highY; -+ this.highZBound = highZ; -+ return this; -+ } -+ -+ public BlockDesign setQuadNumber(int quads) { -+ xPos = new float[quads][]; -+ yPos = new float[quads][]; -+ zPos = new float[quads][]; -+ textXPos = new float[quads][]; -+ textYPos = new float[quads][]; -+ lightSourceXOffset = new int[quads]; -+ lightSourceYOffset = new int[quads]; -+ lightSourceZOffset = new int[quads]; -+ -+ for (int i = 0; i < quads; i++) { -+ xPos[i] = new float[4]; -+ yPos[i] = new float[4]; -+ zPos[i] = new float[4]; -+ textXPos[i] = new float[4]; -+ textYPos[i] = new float[4]; -+ lightSourceXOffset[i] = 0; -+ lightSourceYOffset[i] = 0; -+ lightSourceZOffset[i] = 0; -+ } -+ return this; -+ } -+ -+ public BlockDesign setQuad(int quadNumber, float x1, float y1, float z1, int tx1, int ty1, float x2, float y2, float z2, int tx2, int ty2, float x3, float y3, float z3, int tx3, int ty3, float x4, float y4, float z4, int tx4, int ty4, int textureSizeX, int textureSizeY) { -+ setVertex(quadNumber, 0, x1, y1, z1, tx1, ty1, textureSizeX, textureSizeY); -+ setVertex(quadNumber, 1, x2, y2, z2, tx2, ty2, textureSizeX, textureSizeY); -+ setVertex(quadNumber, 2, x3, y3, z3, tx3, ty3, textureSizeX, textureSizeY); -+ setVertex(quadNumber, 3, x4, y4, z4, tx4, ty4, textureSizeX, textureSizeY); -+ return this; -+ } -+ -+ public BlockDesign setVertex(int quadNumber, int vertexNumber, float x, float y, float z, int tx, int ty, int textureSizeX, int textureSizeY) { -+ xPos[quadNumber][vertexNumber] = x; -+ yPos[quadNumber][vertexNumber] = y; -+ zPos[quadNumber][vertexNumber] = z; -+ textXPos[quadNumber][vertexNumber] = (float) tx / (float) textureSizeX; -+ textYPos[quadNumber][vertexNumber] = (float) ty / (float) textureSizeY; -+ return this; -+ } -+ -+ public String getTextureURL() { -+ return textureURL; -+ } -+ -+ public String getTextureAddon() { -+ return textureAddon; -+ } -+ -+ public boolean isReset() { -+ return reset; -+ } -+ -+ public BlockDesign setLightSource(int quad, int x, int y, int z) { -+ lightSourceXOffset[quad] = x; -+ lightSourceYOffset[quad] = y; -+ lightSourceZOffset[quad] = z; -+ return this; -+ } -+ -+ public MutableIntegerVector getLightSource(int quad, int x, int y, int z) { -+ MutableIntegerVector blockVector = new MutableIntegerVector(x + lightSourceXOffset[quad], y + lightSourceYOffset[quad], z + lightSourceZOffset[quad]); -+ return blockVector; -+ } -+ -+ public BlockDesign setTexture(String addon, Texture texture) { -+ this.texture = texture; -+ return setTexture(addon, texture.getTexture()); -+ } -+ -+ public Texture getTexture() { -+ return texture; -+ } -+ -+ public BlockDesign setQuad(Quad quad) { -+ return setVertex(quad.getVertex(0)).setVertex(quad.getVertex(1)).setVertex(quad.getVertex(2)).setVertex(quad.getVertex(3)); -+ } -+ -+ public BlockDesign setVertex(Vertex vertex) { -+ return setVertex(vertex.getQuadNum(), vertex.getIndex(), vertex.getX(), vertex.getY(), vertex.getZ(), vertex.getTextureX(), vertex.getTextureY(), vertex.getTextureWidth(), vertex.getTextureHeight()); -+ } -+ -+ public boolean renderBlock(Block block, int x, int y, int z) { -+ SpoutcraftWorld world = Spoutcraft.getWorld(); -+ if (block != null) { -+ boolean enclosed = true; -+ enclosed &= world.isOpaque(x, y + 1, z); -+ enclosed &= world.isOpaque(x, y - 1, z); -+ enclosed &= world.isOpaque(x, y, z + 1); -+ enclosed &= world.isOpaque(x, y, z - 1); -+ enclosed &= world.isOpaque(x + 1, y, z); -+ enclosed &= world.isOpaque(x - 1, y, z); -+ if (enclosed) { -+ return false; -+ } -+ } -+ -+ if (getX() == null) { -+ return false; -+ } -+ -+ setBrightness(1F); -+ -+ MinecraftTessellator tessellator = Spoutcraft.getTessellator(); -+ -+ int internalLightLevel = 0; -+ if (block == null) { -+ internalLightLevel = 0x00F000F0; -+ } else { -+ internalLightLevel = world.getMixedBrightnessAt(block, x, y, z); -+ } -+ -+ for (int i = 0; i < getX().length; i++) { -+ MutableIntegerVector sourceBlock = getLightSource(i, x, y, z); -+ -+ int sideBrightness; -+ -+ if (block != null && sourceBlock != null) { -+ sideBrightness = world.getMixedBrightnessAt(block, sourceBlock.getBlockX(), sourceBlock.getBlockY(), sourceBlock.getBlockZ()); -+ } else { -+ sideBrightness = internalLightLevel; -+ } -+ -+ if (block == null) { -+ if (i == 5) { -+ tessellator.setNormal(0, 1, 0); -+ } else if (i == 3) { -+ tessellator.setNormal(0, 0, 1); -+ } else if (i == 2) { -+ tessellator.setNormal(1, 0, 0); -+ } -+ } -+ -+ tessellator.setBrightness(sideBrightness); -+ -+ tessellator.setColorOpaqueFloat(1.0F, 1.0F, 1.0F); -+ -+ float[] xx = getX()[i]; -+ float[] yy = getY()[i]; -+ float[] zz = getZ()[i]; -+ float[] tx = getTextureXPos()[i]; -+ float[] ty = getTextureYPos()[i]; -+ -+ for (int j = 0; j < 4; j++) { -+ tessellator.addVertexWithUV(x + xx[j], y + yy[j], z + zz[j], tx[j], ty[j]); -+ } -+ } -+ return true; -+ } -+ -+ public boolean renderItemstack(net.minecraft.src.ItemStack item, float x, float y, float depth, float rotation, float scale, Random rand) { -+ int items = 1; -+ if (item != null) { -+ int amt = item.stackSize; -+ if (amt > 1) { -+ items = 2; -+ } -+ -+ if (amt > 5) { -+ items = 3; -+ } -+ -+ if (amt > 20) { -+ items = 4; -+ } -+ } -+ -+ boolean result = false; -+ -+ GL11.glPushMatrix(); -+ GL11.glColor4f(1, 1, 1, 1); -+ GL11.glTranslatef(x, y, depth); -+ -+ GL11.glRotatef(rotation, 0.0F, 1.0F, 0.0F); -+ GL11.glScalef(scale, scale, scale); -+ -+ Spoutcraft.getTessellator().startDrawingQuads(); -+ Spoutcraft.getTessellator().setNormal(0.0F, -1.0F, 0.0F); -+ -+ for (int i = 0; i < items; ++i) { -+ GL11.glPushMatrix(); -+ if (i > 0) { -+ float rotX = (rand.nextFloat() * 2.0F - 1.0F) * 0.2F / 0.25F; -+ float rotY = (rand.nextFloat() * 2.0F - 1.0F) * 0.2F / 0.25F; -+ float rotZ = (rand.nextFloat() * 2.0F - 1.0F) * 0.2F / 0.25F; -+ GL11.glTranslatef(rotX, rotY, rotZ); -+ } -+ -+ result &= renderBlock(null, 0, 0, 0); -+ -+ GL11.glPopMatrix(); -+ } -+ -+ Spoutcraft.getTessellator().draw(); -+ GL11.glPopMatrix(); -+ -+ return result; -+ } -+ -+ public boolean renderItemOnHUD(float x, float y, float depth) { -+ GL11.glPushMatrix(); -+ Spoutcraft.getTessellator().startDrawingQuads(); -+ -+ GL11.glTranslatef(x, y+1, depth); -+ GL11.glScalef(10.0F, 10.0F, 10.0F); -+ GL11.glTranslatef(1.0F, 0.5F, 1.0F); -+ GL11.glScalef(1.0F, 1.0F, -1.0F); -+ GL11.glRotatef(210.0F, 1.0F, 0.0F, 0.0F); -+ GL11.glRotatef(45.0F, 0.0F, 1.0F, 0.0F); -+ GL11.glRotatef(-90.0F, 0.0F, 1.0F, 0.0F); -+ boolean result = renderBlock(null, 0, 0, 0); -+ Spoutcraft.getTessellator().draw(); -+ GL11.glPopMatrix(); -+ -+ return result; -+ } -+} ---- net/minecraft/src/ItemEgg.java -+++ net/minecraft/src/ItemEgg.java -@@ -1,22 +1,26 @@ - package net.minecraft.src; - - public class ItemEgg extends Item { -- public ItemEgg(int var1) { -- super(var1); -+ public ItemEgg(int par1) { -+ super(par1); - this.maxStackSize = 16; - this.setCreativeTab(CreativeTabs.tabMaterials); - } - -- public ItemStack onItemRightClick(ItemStack var1, World var2, EntityPlayer var3) { -- if(!var3.capabilities.isCreativeMode) { -- --var1.stackSize; -- } -- -- var2.playSoundAtEntity(var3, "random.bow", 0.5F, 0.4F / (f.nextFloat() * 0.4F + 0.8F)); -- if(!var2.isRemote) { -- var2.spawnEntityInWorld(new EntityEgg(var2, var3)); -- } -- -- return var1; -+ /** -+ * Called whenever this item is equipped and the right mouse button is pressed. Args: itemStack, world, entityPlayer -+ */ -+ public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) { -+ if (!par3EntityPlayer.capabilities.isCreativeMode) { -+ --par1ItemStack.stackSize; -+ } -+ -+ par2World.playSoundAtEntity(par3EntityPlayer, "random.bow", 0.5F, 0.4F / (itemRand.nextFloat() * 0.4F + 0.8F)); -+ -+ if (!par2World.isRemote) { -+ par2World.spawnEntityInWorld(new EntityEgg(par2World, par3EntityPlayer)); -+ } -+ -+ return par1ItemStack; - } - } ---- net/minecraft/src/WorldTemplateList.java -+++ net/minecraft/src/WorldTemplateList.java -@@ -9,24 +9,27 @@ - import java.util.List; - - public class WorldTemplateList extends ValueObject { -- public List a; -+ public List field_110736_a; - -- public static WorldTemplateList func_110735_a(String var0) { -+ public static WorldTemplateList func_110735_a(String par0Str) { - WorldTemplateList var1 = new WorldTemplateList(); -- var1.a = new ArrayList(); -+ var1.field_110736_a = new ArrayList(); - - try { -- JsonRootNode var2 = (new JdomParser()).parse(var0); -- if(var2.isArrayNode(new Object[]{"templates"})) { -- Iterator var3 = var2.getArrayNode(new Object[]{"templates"}).iterator(); -- -- while(var3.hasNext()) { -+ JsonRootNode var2 = (new JdomParser()).parse(par0Str); -+ -+ if (var2.isArrayNode(new Object[] {"templates"})) { -+ Iterator var3 = var2.getArrayNode(new Object[] {"templates"}).iterator(); -+ -+ while (var3.hasNext()) { - JsonNode var4 = (JsonNode)var3.next(); -- var1.a.add(WorldTemplate.func_110730_a(var4)); -+ var1.field_110736_a.add(WorldTemplate.func_110730_a(var4)); - } - } - } catch (InvalidSyntaxException var5) { -+ ; - } catch (IllegalArgumentException var6) { -+ ; - } - - return var1; ---- net/minecraft/src/ContainerWorkbench.java -+++ net/minecraft/src/ContainerWorkbench.java -@@ -1,6 +1,8 @@ - package net.minecraft.src; - - public class ContainerWorkbench extends Container { -+ -+ /** The crafting matrix inventory (3x3). */ - public InventoryCrafting craftMatrix = new InventoryCrafting(this, 3, 3); - public IInventory craftResult = new InventoryCraftResult(); - private World worldObj; -@@ -8,96 +10,114 @@ - private int posY; - private int posZ; - -- public ContainerWorkbench(InventoryPlayer var1, World var2, int var3, int var4, int var5) { -- this.worldObj = var2; -- this.posX = var3; -- this.posY = var4; -- this.posZ = var5; -- this.addSlotToContainer(new SlotCrafting(var1.player, this.craftMatrix, this.craftResult, 0, 124, 35)); -- -- int var6; -+ public ContainerWorkbench(InventoryPlayer par1InventoryPlayer, World par2World, int par3, int par4, int par5) { -+ this.worldObj = par2World; -+ this.posX = par3; -+ this.posY = par4; -+ this.posZ = par5; -+ this.addSlotToContainer(new SlotCrafting(par1InventoryPlayer.player, this.craftMatrix, this.craftResult, 0, 124, 35)); - int var7; -- for(var6 = 0; var6 < 3; ++var6) { -- for(var7 = 0; var7 < 3; ++var7) { -+ int var6; -+ -+ for (var6 = 0; var6 < 3; ++var6) { -+ for (var7 = 0; var7 < 3; ++var7) { - this.addSlotToContainer(new Slot(this.craftMatrix, var7 + var6 * 3, 30 + var7 * 18, 17 + var6 * 18)); - } - } - -- for(var6 = 0; var6 < 3; ++var6) { -- for(var7 = 0; var7 < 9; ++var7) { -- this.addSlotToContainer(new Slot(var1, var7 + var6 * 9 + 9, 8 + var7 * 18, 84 + var6 * 18)); -+ for (var6 = 0; var6 < 3; ++var6) { -+ for (var7 = 0; var7 < 9; ++var7) { -+ this.addSlotToContainer(new Slot(par1InventoryPlayer, var7 + var6 * 9 + 9, 8 + var7 * 18, 84 + var6 * 18)); - } - } - -- for(var6 = 0; var6 < 9; ++var6) { -- this.addSlotToContainer(new Slot(var1, var6, 8 + var6 * 18, 142)); -+ for (var6 = 0; var6 < 9; ++var6) { -+ this.addSlotToContainer(new Slot(par1InventoryPlayer, var6, 8 + var6 * 18, 142)); - } - - this.onCraftMatrixChanged(this.craftMatrix); - } - -- public void onCraftMatrixChanged(IInventory var1) { -+ // Spout Start -+ public IInventory getIInventory() { -+ return null; -+ } -+ // Spout End -+ -+ /** -+ * Callback for when the crafting matrix is changed. -+ */ -+ public void onCraftMatrixChanged(IInventory par1IInventory) { - this.craftResult.setInventorySlotContents(0, CraftingManager.getInstance().findMatchingRecipe(this.craftMatrix, this.worldObj)); - } - -- public void onContainerClosed(EntityPlayer var1) { -- super.onContainerClosed(var1); -- if(!this.worldObj.isRemote) { -- for(int var2 = 0; var2 < 9; ++var2) { -+ /** -+ * Called when the container is closed. -+ */ -+ public void onContainerClosed(EntityPlayer par1EntityPlayer) { -+ super.onContainerClosed(par1EntityPlayer); -+ -+ if (!this.worldObj.isRemote) { -+ for (int var2 = 0; var2 < 9; ++var2) { - ItemStack var3 = this.craftMatrix.getStackInSlotOnClosing(var2); -- if(var3 != null) { -- var1.dropPlayerItem(var3); -+ -+ if (var3 != null) { -+ par1EntityPlayer.dropPlayerItem(var3); - } - } -- - } - } - -- public boolean canInteractWith(EntityPlayer var1) { -- return this.worldObj.getBlockId(this.posX, this.posY, this.posZ) != Block.workbench.blockID ? false : var1.getDistanceSq((double)this.posX + 0.5D, (double)this.posY + 0.5D, (double)this.posZ + 0.5D) <= 64.0D; -+ public boolean canInteractWith(EntityPlayer par1EntityPlayer) { -+ return this.worldObj.getBlockId(this.posX, this.posY, this.posZ) != Block.workbench.blockID ? false : par1EntityPlayer.getDistanceSq((double)this.posX + 0.5D, (double)this.posY + 0.5D, (double)this.posZ + 0.5D) <= 64.0D; - } - -- public ItemStack transferStackInSlot(EntityPlayer var1, int var2) { -+ /** -+ * Called when a player shift-clicks on a slot. You must override this or you will crash when someone does that. -+ */ -+ public ItemStack transferStackInSlot(EntityPlayer par1EntityPlayer, int par2) { - ItemStack var3 = null; -- Slot var4 = (Slot)this.c.get(var2); -- if(var4 != null && var4.getHasStack()) { -+ Slot var4 = (Slot)this.inventorySlots.get(par2); -+ -+ if (var4 != null && var4.getHasStack()) { - ItemStack var5 = var4.getStack(); - var3 = var5.copy(); -- if(var2 == 0) { -- if(!this.mergeItemStack(var5, 10, 46, true)) { -+ -+ if (par2 == 0) { -+ if (!this.mergeItemStack(var5, 10, 46, true)) { - return null; - } - - var4.onSlotChange(var5, var3); -- } else if(var2 >= 10 && var2 < 37) { -- if(!this.mergeItemStack(var5, 37, 46, false)) { -- return null; -- } -- } else if(var2 >= 37 && var2 < 46) { -- if(!this.mergeItemStack(var5, 10, 37, false)) { -- return null; -- } -- } else if(!this.mergeItemStack(var5, 10, 46, false)) { -+ } else if (par2 >= 10 && par2 < 37) { -+ if (!this.mergeItemStack(var5, 37, 46, false)) { -+ return null; -+ } -+ } else if (par2 >= 37 && par2 < 46) { -+ if (!this.mergeItemStack(var5, 10, 37, false)) { -+ return null; -+ } -+ } else if (!this.mergeItemStack(var5, 10, 46, false)) { - return null; - } - -- if(var5.stackSize == 0) { -+ if (var5.stackSize == 0) { - var4.putStack((ItemStack)null); - } else { - var4.onSlotChanged(); - } - -- if(var5.stackSize == var3.stackSize) { -+ if (var5.stackSize == var3.stackSize) { - return null; - } - -- var4.onPickupFromSlot(var1, var5); -+ var4.onPickupFromSlot(par1EntityPlayer, var5); - } - - return var3; - } - -- public boolean func_94530_a(ItemStack var1, Slot var2) { -- return var2.inventory != this.craftResult && super.func_94530_a(var1, var2); -+ public boolean func_94530_a(ItemStack par1ItemStack, Slot par2Slot) { -+ return par2Slot.inventory != this.craftResult && super.func_94530_a(par1ItemStack, par2Slot); - } - } ---- net/minecraft/src/McoServerAddress.java -+++ net/minecraft/src/McoServerAddress.java -@@ -5,16 +5,18 @@ - import argo.saj.InvalidSyntaxException; - - public class McoServerAddress extends ValueObject { -- public String a; -+ public String field_96417_a; - -- public static McoServerAddress func_98162_a(String var0) { -+ public static McoServerAddress func_98162_a(String par0Str) { - McoServerAddress var1 = new McoServerAddress(); - - try { -- JsonRootNode var2 = (new JdomParser()).parse(var0); -- var1.a = var2.getStringValue(new Object[]{"address"}); -+ JsonRootNode var2 = (new JdomParser()).parse(par0Str); -+ var1.field_96417_a = var2.getStringValue(new Object[] {"address"}); - } catch (InvalidSyntaxException var3) { -+ ; - } catch (IllegalArgumentException var4) { -+ ; - } - - return var1; ---- net/minecraft/src/ContainerPlayer.java -+++ net/minecraft/src/ContainerPlayer.java -@@ -1,116 +1,144 @@ - package net.minecraft.src; - - public class ContainerPlayer extends Container { -+ -+ /** The crafting matrix inventory. */ - public InventoryCrafting craftMatrix = new InventoryCrafting(this, 2, 2); - public IInventory craftResult = new InventoryCraftResult(); -+ -+ /** Determines if inventory manipulation should be handled. */ - public boolean isLocalWorld; - private final EntityPlayer thePlayer; - -- public ContainerPlayer(InventoryPlayer var1, boolean var2, EntityPlayer var3) { -- this.isLocalWorld = var2; -- this.thePlayer = var3; -- this.addSlotToContainer(new SlotCrafting(var1.player, this.craftMatrix, this.craftResult, 0, 144, 36)); -- -+ public ContainerPlayer(InventoryPlayer par1InventoryPlayer, boolean par2, EntityPlayer par3EntityPlayer) { -+ this.isLocalWorld = par2; -+ this.thePlayer = par3EntityPlayer; -+ this.addSlotToContainer(new SlotCrafting(par1InventoryPlayer.player, this.craftMatrix, this.craftResult, 0, 144, 36)); - int var4; - int var5; -- for(var4 = 0; var4 < 2; ++var4) { -- for(var5 = 0; var5 < 2; ++var5) { -+ -+ for (var4 = 0; var4 < 2; ++var4) { -+ for (var5 = 0; var5 < 2; ++var5) { - this.addSlotToContainer(new Slot(this.craftMatrix, var5 + var4 * 2, 88 + var5 * 18, 26 + var4 * 18)); - } - } - -- for(var4 = 0; var4 < 4; ++var4) { -- this.addSlotToContainer(new SlotArmor(this, var1, var1.getSizeInventory() - 1 - var4, 8, 8 + var4 * 18, var4)); -+ for (var4 = 0; var4 < 4; ++var4) { -+ this.addSlotToContainer(new SlotArmor(this, par1InventoryPlayer, par1InventoryPlayer.getSizeInventory() - 1 - var4, 8, 8 + var4 * 18, var4)); - } - -- for(var4 = 0; var4 < 3; ++var4) { -- for(var5 = 0; var5 < 9; ++var5) { -- this.addSlotToContainer(new Slot(var1, var5 + (var4 + 1) * 9, 8 + var5 * 18, 84 + var4 * 18)); -+ for (var4 = 0; var4 < 3; ++var4) { -+ for (var5 = 0; var5 < 9; ++var5) { -+ this.addSlotToContainer(new Slot(par1InventoryPlayer, var5 + (var4 + 1) * 9, 8 + var5 * 18, 84 + var4 * 18)); - } - } - -- for(var4 = 0; var4 < 9; ++var4) { -- this.addSlotToContainer(new Slot(var1, var4, 8 + var4 * 18, 142)); -+ for (var4 = 0; var4 < 9; ++var4) { -+ this.addSlotToContainer(new Slot(par1InventoryPlayer, var4, 8 + var4 * 18, 142)); - } - - this.onCraftMatrixChanged(this.craftMatrix); - } - -- public void onCraftMatrixChanged(IInventory var1) { -+ // Spout Start - Inventory sorting -+ public IInventory getIInventory() { -+ return Minecraft.getMinecraft().thePlayer.inventory; -+ } -+ -+ @Override -+ public boolean isSortableInventory() { -+ return true; -+ } -+ // Spout End -+ -+ /** -+ * Callback for when the crafting matrix is changed. -+ */ -+ public void onCraftMatrixChanged(IInventory par1IInventory) { - this.craftResult.setInventorySlotContents(0, CraftingManager.getInstance().findMatchingRecipe(this.craftMatrix, this.thePlayer.worldObj)); - } - -- public void onContainerClosed(EntityPlayer var1) { -- super.onContainerClosed(var1); -+ /** -+ * Called when the container is closed. -+ */ -+ public void onContainerClosed(EntityPlayer par1EntityPlayer) { -+ super.onContainerClosed(par1EntityPlayer); - -- for(int var2 = 0; var2 < 4; ++var2) { -+ for (int var2 = 0; var2 < 4; ++var2) { - ItemStack var3 = this.craftMatrix.getStackInSlotOnClosing(var2); -- if(var3 != null) { -- var1.dropPlayerItem(var3); -+ -+ if (var3 != null) { -+ par1EntityPlayer.dropPlayerItem(var3); - } - } - - this.craftResult.setInventorySlotContents(0, (ItemStack)null); - } - -- public boolean canInteractWith(EntityPlayer var1) { -+ public boolean canInteractWith(EntityPlayer par1EntityPlayer) { - return true; - } - -- public ItemStack transferStackInSlot(EntityPlayer var1, int var2) { -+ /** -+ * Called when a player shift-clicks on a slot. You must override this or you will crash when someone does that. -+ */ -+ public ItemStack transferStackInSlot(EntityPlayer par1EntityPlayer, int par2) { - ItemStack var3 = null; -- Slot var4 = (Slot)this.c.get(var2); -- if(var4 != null && var4.getHasStack()) { -+ Slot var4 = (Slot)this.inventorySlots.get(par2); -+ -+ if (var4 != null && var4.getHasStack()) { - ItemStack var5 = var4.getStack(); - var3 = var5.copy(); -- if(var2 == 0) { -- if(!this.mergeItemStack(var5, 9, 45, true)) { -+ -+ if (par2 == 0) { -+ if (!this.mergeItemStack(var5, 9, 45, true)) { - return null; - } - - var4.onSlotChange(var5, var3); -- } else if(var2 >= 1 && var2 < 5) { -- if(!this.mergeItemStack(var5, 9, 45, false)) { -- return null; -- } -- } else if(var2 >= 5 && var2 < 9) { -- if(!this.mergeItemStack(var5, 9, 45, false)) { -- return null; -- } -- } else if(var3.getItem() instanceof ItemArmor && !((Slot)this.c.get(5 + ((ItemArmor)var3.getItem()).armorType)).getHasStack()) { -+ } else if (par2 >= 1 && par2 < 5) { -+ if (!this.mergeItemStack(var5, 9, 45, false)) { -+ return null; -+ } -+ } else if (par2 >= 5 && par2 < 9) { -+ if (!this.mergeItemStack(var5, 9, 45, false)) { -+ return null; -+ } -+ } else if (var3.getItem() instanceof ItemArmor && !((Slot)this.inventorySlots.get(5 + ((ItemArmor)var3.getItem()).armorType)).getHasStack()) { - int var6 = 5 + ((ItemArmor)var3.getItem()).armorType; -- if(!this.mergeItemStack(var5, var6, var6 + 1, false)) { -- return null; -- } -- } else if(var2 >= 9 && var2 < 36) { -- if(!this.mergeItemStack(var5, 36, 45, false)) { -- return null; -- } -- } else if(var2 >= 36 && var2 < 45) { -- if(!this.mergeItemStack(var5, 9, 36, false)) { -- return null; -- } -- } else if(!this.mergeItemStack(var5, 9, 45, false)) { -+ -+ if (!this.mergeItemStack(var5, var6, var6 + 1, false)) { -+ return null; -+ } -+ } else if (par2 >= 9 && par2 < 36) { -+ if (!this.mergeItemStack(var5, 36, 45, false)) { -+ return null; -+ } -+ } else if (par2 >= 36 && par2 < 45) { -+ if (!this.mergeItemStack(var5, 9, 36, false)) { -+ return null; -+ } -+ } else if (!this.mergeItemStack(var5, 9, 45, false)) { - return null; - } - -- if(var5.stackSize == 0) { -+ if (var5.stackSize == 0) { - var4.putStack((ItemStack)null); - } else { - var4.onSlotChanged(); - } - -- if(var5.stackSize == var3.stackSize) { -+ if (var5.stackSize == var3.stackSize) { - return null; - } - -- var4.onPickupFromSlot(var1, var5); -+ var4.onPickupFromSlot(par1EntityPlayer, var5); - } - - return var3; - } - -- public boolean func_94530_a(ItemStack var1, Slot var2) { -- return var2.inventory != this.craftResult && super.func_94530_a(var1, var2); -+ public boolean func_94530_a(ItemStack par1ItemStack, Slot par2Slot) { -+ return par2Slot.inventory != this.craftResult && super.func_94530_a(par1ItemStack, par2Slot); - } - } ---- /dev/null -+++ org/spoutcraft/client/gui/settings/controls/FancyGraphicsButton.java -@@ -1,0 +1,66 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.client.gui.settings.controls; -+ -+import java.util.List; -+ -+import net.minecraft.src.Minecraft; -+ -+import org.spoutcraft.api.gui.CheckBox; -+import org.spoutcraft.client.config.Configuration; -+ -+public class FancyGraphicsButton extends AutomatedButton { -+ public boolean custom = false; -+ private List linkedButtons = null; -+ public FancyGraphicsButton() { -+ setTooltip("Visual quality\nFast - lower quality, faster\nFancy - higher quality, slower\nChanges the appearance of clouds, leaves, water,\nshadows and grass sides."); -+ } -+ -+ @Override -+ public String getText() { -+ return "Graphics: " + (custom ? "Custom" : (Configuration.isFancyGraphics() ? "Fancy" :"Fast")); -+ } -+ -+ @Override -+ public void onButtonClick() { -+ Configuration.setFancyGraphics(!Configuration.isFancyGraphics()); -+ for (CheckBox check : linkedButtons) { -+ if (check.isChecked() != Configuration.isFancyGraphics()) { -+ check.setChecked(Configuration.isFancyGraphics()); -+ check.onButtonClick(); -+ } -+ } -+ Minecraft.getMinecraft().gameSettings.fancyGraphics = Configuration.isFancyGraphics(); -+ if (Minecraft.getMinecraft().theWorld != null) { -+ Minecraft.getMinecraft().renderGlobal.updateAllRenderers(); -+ } -+ custom = false; -+ } -+ -+ public void setLinkedButtons(List linked) { -+ linkedButtons = linked; -+ for (CheckBox check : linkedButtons) { -+ if (check.isChecked() != Configuration.isFancyGraphics()) { -+ custom = true; -+ break; -+ } -+ } -+ } -+} ---- net/minecraft/src/InventoryMerchant.java -+++ net/minecraft/src/InventoryMerchant.java -@@ -7,41 +7,54 @@ - private MerchantRecipe currentRecipe; - private int currentRecipeIndex; - -- public InventoryMerchant(EntityPlayer var1, IMerchant var2) { -- this.thePlayer = var1; -- this.theMerchant = var2; -+ public InventoryMerchant(EntityPlayer par1EntityPlayer, IMerchant par2IMerchant) { -+ this.thePlayer = par1EntityPlayer; -+ this.theMerchant = par2IMerchant; - } - -+ /** -+ * Returns the number of slots in the inventory. -+ */ - public int getSizeInventory() { - return this.theInventory.length; - } - -- public ItemStack getStackInSlot(int var1) { -- return this.theInventory[var1]; -+ /** -+ * Returns the stack in slot i -+ */ -+ public ItemStack getStackInSlot(int par1) { -+ return this.theInventory[par1]; - } - -- public ItemStack decrStackSize(int var1, int var2) { -- if(this.theInventory[var1] != null) { -+ /** -+ * Removes from an inventory slot (first arg) up to a specified number (second arg) of items and returns them in a new -+ * stack. -+ */ -+ public ItemStack decrStackSize(int par1, int par2) { -+ if (this.theInventory[par1] != null) { - ItemStack var3; -- if(var1 == 2) { -- var3 = this.theInventory[var1]; -- this.theInventory[var1] = null; -+ -+ if (par1 == 2) { -+ var3 = this.theInventory[par1]; -+ this.theInventory[par1] = null; - return var3; -- } else if(this.theInventory[var1].stackSize <= var2) { -- var3 = this.theInventory[var1]; -- this.theInventory[var1] = null; -- if(this.inventoryResetNeededOnSlotChange(var1)) { -+ } else if (this.theInventory[par1].stackSize <= par2) { -+ var3 = this.theInventory[par1]; -+ this.theInventory[par1] = null; -+ -+ if (this.inventoryResetNeededOnSlotChange(par1)) { - this.resetRecipeAndSlots(); - } - - return var3; - } else { -- var3 = this.theInventory[var1].splitStack(var2); -- if(this.theInventory[var1].stackSize == 0) { -- this.theInventory[var1] = null; -+ var3 = this.theInventory[par1].splitStack(par2); -+ -+ if (this.theInventory[par1].stackSize == 0) { -+ this.theInventory[par1] = null; - } - -- if(this.inventoryResetNeededOnSlotChange(var1)) { -+ if (this.inventoryResetNeededOnSlotChange(par1)) { - this.resetRecipeAndSlots(); - } - -@@ -52,58 +65,86 @@ - } - } - -- private boolean inventoryResetNeededOnSlotChange(int var1) { -- return var1 == 0 || var1 == 1; -+ /** -+ * if par1 slot has changed, does resetRecipeAndSlots need to be called? -+ */ -+ private boolean inventoryResetNeededOnSlotChange(int par1) { -+ return par1 == 0 || par1 == 1; - } - -- public ItemStack getStackInSlotOnClosing(int var1) { -- if(this.theInventory[var1] != null) { -- ItemStack var2 = this.theInventory[var1]; -- this.theInventory[var1] = null; -+ /** -+ * When some containers are closed they call this on each slot, then drop whatever it returns as an EntityItem - like -+ * when you close a workbench GUI. -+ */ -+ public ItemStack getStackInSlotOnClosing(int par1) { -+ if (this.theInventory[par1] != null) { -+ ItemStack var2 = this.theInventory[par1]; -+ this.theInventory[par1] = null; - return var2; - } else { - return null; - } - } - -- public void setInventorySlotContents(int var1, ItemStack var2) { -- this.theInventory[var1] = var2; -- if(var2 != null && var2.stackSize > this.getInventoryStackLimit()) { -- var2.stackSize = this.getInventoryStackLimit(); -+ /** -+ * Sets the given item stack to the specified slot in the inventory (can be crafting or armor sections). -+ */ -+ public void setInventorySlotContents(int par1, ItemStack par2ItemStack) { -+ this.theInventory[par1] = par2ItemStack; -+ -+ if (par2ItemStack != null && par2ItemStack.stackSize > this.getInventoryStackLimit()) { -+ par2ItemStack.stackSize = this.getInventoryStackLimit(); - } - -- if(this.inventoryResetNeededOnSlotChange(var1)) { -+ if (this.inventoryResetNeededOnSlotChange(par1)) { - this.resetRecipeAndSlots(); - } -- - } - -+ /** -+ * Returns the name of the inventory. -+ */ - public String getInvName() { - return "mob.villager"; - } - -+ /** -+ * If this returns false, the inventory name will be used as an unlocalized name, and translated into the player's -+ * language. Otherwise it will be used directly. -+ */ - public boolean isInvNameLocalized() { - return false; - } - -+ /** -+ * Returns the maximum stack size for a inventory slot. Seems to always be 64, possibly will be extended. *Isn't this -+ * more of a set than a get?* -+ */ - public int getInventoryStackLimit() { - return 64; - } - -- public boolean isUseableByPlayer(EntityPlayer var1) { -- return this.theMerchant.getCustomer() == var1; -- } -- -- public void openChest() { -- } -- -- public void closeChest() { -- } -- -- public boolean isItemValidForSlot(int var1, ItemStack var2) { -+ /** -+ * Do not make give this method the name canInteractWith because it clashes with Container -+ */ -+ public boolean isUseableByPlayer(EntityPlayer par1EntityPlayer) { -+ return this.theMerchant.getCustomer() == par1EntityPlayer; -+ } -+ -+ public void openChest() {} -+ -+ public void closeChest() {} -+ -+ /** -+ * Returns true if automation is allowed to insert the given stack (ignoring stack size) into the given slot. -+ */ -+ public boolean isItemValidForSlot(int par1, ItemStack par2ItemStack) { - return true; - } - -+ /** -+ * Called when an the contents of an Inventory change, usually -+ */ - public void onInventoryChanged() { - this.resetRecipeAndSlots(); - } -@@ -112,23 +153,27 @@ - this.currentRecipe = null; - ItemStack var1 = this.theInventory[0]; - ItemStack var2 = this.theInventory[1]; -- if(var1 == null) { -+ -+ if (var1 == null) { - var1 = var2; - var2 = null; - } - -- if(var1 == null) { -+ if (var1 == null) { - this.setInventorySlotContents(2, (ItemStack)null); - } else { - MerchantRecipeList var3 = this.theMerchant.getRecipes(this.thePlayer); -- if(var3 != null) { -+ -+ if (var3 != null) { - MerchantRecipe var4 = var3.canRecipeBeUsed(var1, var2, this.currentRecipeIndex); -- if(var4 != null && !var4.func_82784_g()) { -+ -+ if (var4 != null && !var4.func_82784_g()) { - this.currentRecipe = var4; - this.setInventorySlotContents(2, var4.getItemToSell().copy()); -- } else if(var2 != null) { -+ } else if (var2 != null) { - var4 = var3.canRecipeBeUsed(var2, var1, this.currentRecipeIndex); -- if(var4 != null && !var4.func_82784_g()) { -+ -+ if (var4 != null && !var4.func_82784_g()) { - this.currentRecipe = var4; - this.setInventorySlotContents(2, var4.getItemToSell().copy()); - } else { -@@ -147,8 +192,8 @@ - return this.currentRecipe; - } - -- public void setCurrentRecipeIndex(int var1) { -- this.currentRecipeIndex = var1; -+ public void setCurrentRecipeIndex(int par1) { -+ this.currentRecipeIndex = par1; - this.resetRecipeAndSlots(); - } - } ---- net/minecraft/src/Timer.java -+++ net/minecraft/src/Timer.java -@@ -1,39 +1,79 @@ - package net.minecraft.src; - - public class Timer { -+ -+ /** The number of timer ticks per second of real time */ - float ticksPerSecond; -+ -+ /** -+ * The time reported by the high-resolution clock at the last call of updateTimer(), in seconds -+ */ - private double lastHRTime; -+ -+ /** -+ * How many full ticks have turned over since the last call to updateTimer(), capped at 10. -+ */ - public int elapsedTicks; -+ -+ /** -+ * How much time has elapsed since the last tick, in ticks, for use by display rendering routines (range: 0.0 - 1.0). -+ * This field is frozen if the display is paused to eliminate jitter. -+ */ - public float renderPartialTicks; -+ -+ /** -+ * A multiplier to make the timer (and therefore the game) go faster or slower. 0.5 makes the game run at half-speed. -+ */ - public float timerSpeed = 1.0F; -+ -+ /** -+ * How much time has elapsed since the last tick, in ticks (range: 0.0 - 1.0). -+ */ - public float elapsedPartialTicks; -+ -+ /** -+ * The time reported by the system clock at the last sync, in milliseconds -+ */ - private long lastSyncSysClock; -+ -+ /** -+ * The time reported by the high-resolution clock at the last sync, in milliseconds -+ */ - private long lastSyncHRClock; - private long field_74285_i; -+ -+ /** -+ * A ratio used to sync the high-resolution clock to the system clock, updated once per second -+ */ - private double timeSyncAdjustment = 1.0D; - -- public Timer(float var1) { -- this.ticksPerSecond = var1; -+ public Timer(float par1) { -+ this.ticksPerSecond = par1; - this.lastSyncSysClock = Minecraft.getSystemTime(); - this.lastSyncHRClock = System.nanoTime() / 1000000L; - } - -+ /** -+ * Updates all fields of the Timer using the current time -+ */ - public void updateTimer() { - long var1 = Minecraft.getSystemTime(); - long var3 = var1 - this.lastSyncSysClock; - long var5 = System.nanoTime() / 1000000L; - double var7 = (double)var5 / 1000.0D; -- if(var3 <= 1000L && var3 >= 0L) { -+ -+ if (var3 <= 1000L && var3 >= 0L) { - this.field_74285_i += var3; -- if(this.field_74285_i > 1000L) { -+ -+ if (this.field_74285_i > 1000L) { - long var9 = var5 - this.lastSyncHRClock; - double var11 = (double)this.field_74285_i / (double)var9; -- this.timeSyncAdjustment += (var11 - this.timeSyncAdjustment) * (double)0.2F; -+ this.timeSyncAdjustment += (var11 - this.timeSyncAdjustment) * 0.20000000298023224D; - this.lastSyncHRClock = var5; - this.field_74285_i = 0L; - } - -- if(this.field_74285_i < 0L) { -+ if (this.field_74285_i < 0L) { - this.lastSyncHRClock = var5; - } - } else { -@@ -43,18 +83,20 @@ - this.lastSyncSysClock = var1; - double var13 = (var7 - this.lastHRTime) * this.timeSyncAdjustment; - this.lastHRTime = var7; -- if(var13 < 0.0D) { -+ -+ if (var13 < 0.0D) { - var13 = 0.0D; - } - -- if(var13 > 1.0D) { -+ if (var13 > 1.0D) { - var13 = 1.0D; - } - - this.elapsedPartialTicks = (float)((double)this.elapsedPartialTicks + var13 * (double)this.timerSpeed * (double)this.ticksPerSecond); - this.elapsedTicks = (int)this.elapsedPartialTicks; - this.elapsedPartialTicks -= (float)this.elapsedTicks; -- if(this.elapsedTicks > 10) { -+ -+ if (this.elapsedTicks > 10) { - this.elapsedTicks = 10; - } - ---- net/minecraft/src/CommandBase.java -+++ net/minecraft/src/CommandBase.java -@@ -10,6 +10,9 @@ - public abstract class CommandBase implements ICommand { - private static IAdminCommand theAdmin; - -+ /** -+ * Return the required permission level for this command. -+ */ - public int getRequiredPermissionLevel() { - return 4; - } -@@ -18,69 +21,90 @@ - return null; - } - -- public boolean canCommandSenderUseCommand(ICommandSender var1) { -- return var1.canCommandSenderUseCommand(this.getRequiredPermissionLevel(), this.getCommandName()); -+ /** -+ * Returns true if the given command sender is allowed to use this command. -+ */ -+ public boolean canCommandSenderUseCommand(ICommandSender par1ICommandSender) { -+ return par1ICommandSender.canCommandSenderUseCommand(this.getRequiredPermissionLevel(), this.getCommandName()); - } - -- public List addTabCompletionOptions(ICommandSender var1, String[] var2) { -+ /** -+ * Adds the strings available in this command to the given list of tab completion options. -+ */ -+ public List addTabCompletionOptions(ICommandSender par1ICommandSender, String[] par2ArrayOfStr) { - return null; - } - -- public static int parseInt(ICommandSender var0, String var1) { -+ /** -+ * Parses an int from the given string. -+ */ -+ public static int parseInt(ICommandSender par0ICommandSender, String par1Str) { - try { -- return Integer.parseInt(var1); -+ return Integer.parseInt(par1Str); - } catch (NumberFormatException var3) { -- throw new NumberInvalidException("commands.generic.num.invalid", new Object[]{var1}); -+ throw new NumberInvalidException("commands.generic.num.invalid", new Object[] {par1Str}); - } - } - -- public static int parseIntWithMin(ICommandSender var0, String var1, int var2) { -- return parseIntBounded(var0, var1, var2, Integer.MAX_VALUE); -+ /** -+ * Parses an int from the given sring with a specified minimum. -+ */ -+ public static int parseIntWithMin(ICommandSender par0ICommandSender, String par1Str, int par2) { -+ return parseIntBounded(par0ICommandSender, par1Str, par2, Integer.MAX_VALUE); - } - -- public static int parseIntBounded(ICommandSender var0, String var1, int var2, int var3) { -- int var4 = parseInt(var0, var1); -- if(var4 < var2) { -- throw new NumberInvalidException("commands.generic.num.tooSmall", new Object[]{Integer.valueOf(var4), Integer.valueOf(var2)}); -- } else if(var4 > var3) { -- throw new NumberInvalidException("commands.generic.num.tooBig", new Object[]{Integer.valueOf(var4), Integer.valueOf(var3)}); -+ /** -+ * Parses an int from the given string within a specified bound. -+ */ -+ public static int parseIntBounded(ICommandSender par0ICommandSender, String par1Str, int par2, int par3) { -+ int var4 = parseInt(par0ICommandSender, par1Str); -+ -+ if (var4 < par2) { -+ throw new NumberInvalidException("commands.generic.num.tooSmall", new Object[] {Integer.valueOf(var4), Integer.valueOf(par2)}); -+ } else if (var4 > par3) { -+ throw new NumberInvalidException("commands.generic.num.tooBig", new Object[] {Integer.valueOf(var4), Integer.valueOf(par3)}); - } else { - return var4; - } - } - -- public static double parseDouble(ICommandSender var0, String var1) { -+ /** -+ * Parses a double from the given string or throws an exception if it's not a double. -+ */ -+ public static double parseDouble(ICommandSender par0ICommandSender, String par1Str) { - try { -- double var2 = Double.parseDouble(var1); -- if(!Doubles.isFinite(var2)) { -- throw new NumberInvalidException("commands.generic.double.invalid", new Object[]{var1}); -+ double var2 = Double.parseDouble(par1Str); -+ -+ if (!Doubles.isFinite(var2)) { -+ throw new NumberInvalidException("commands.generic.double.invalid", new Object[] {par1Str}); - } else { - return var2; - } - } catch (NumberFormatException var4) { -- throw new NumberInvalidException("commands.generic.double.invalid", new Object[]{var1}); -+ throw new NumberInvalidException("commands.generic.double.invalid", new Object[] {par1Str}); - } - } - -- public static double func_110664_a(ICommandSender var0, String var1, double var2) { -- return func_110661_a(var0, var1, var2, Double.MAX_VALUE); -+ public static double func_110664_a(ICommandSender par0ICommandSender, String par1Str, double par2) { -+ return func_110661_a(par0ICommandSender, par1Str, par2, Double.MAX_VALUE); - } - -- public static double func_110661_a(ICommandSender var0, String var1, double var2, double var4) { -- double var6 = parseDouble(var0, var1); -- if(var6 < var2) { -- throw new NumberInvalidException("commands.generic.double.tooSmall", new Object[]{Double.valueOf(var6), Double.valueOf(var2)}); -- } else if(var6 > var4) { -- throw new NumberInvalidException("commands.generic.double.tooBig", new Object[]{Double.valueOf(var6), Double.valueOf(var4)}); -+ public static double func_110661_a(ICommandSender par0ICommandSender, String par1Str, double par2, double par4) { -+ double var6 = parseDouble(par0ICommandSender, par1Str); -+ -+ if (var6 < par2) { -+ throw new NumberInvalidException("commands.generic.double.tooSmall", new Object[] {Double.valueOf(var6), Double.valueOf(par2)}); -+ } else if (var6 > par4) { -+ throw new NumberInvalidException("commands.generic.double.tooBig", new Object[] {Double.valueOf(var6), Double.valueOf(par4)}); - } else { - return var6; - } - } - -- public static boolean func_110662_c(ICommandSender var0, String var1) { -- if(!var1.equals("true") && !var1.equals("1")) { -- if(!var1.equals("false") && !var1.equals("0")) { -- throw new CommandException("commands.generic.boolean.invalid", new Object[]{var1}); -+ public static boolean func_110662_c(ICommandSender par0ICommandSender, String par1Str) { -+ if (!par1Str.equals("true") && !par1Str.equals("1")) { -+ if (!par1Str.equals("false") && !par1Str.equals("0")) { -+ throw new CommandException("commands.generic.boolean.invalid", new Object[] {par1Str}); - } else { - return false; - } -@@ -89,21 +113,26 @@ - } - } - -- public static EntityPlayerMP getCommandSenderAsPlayer(ICommandSender var0) { -- if(var0 instanceof EntityPlayerMP) { -- return (EntityPlayerMP)var0; -+ /** -+ * Returns the given ICommandSender as a EntityPlayer or throw an exception. -+ */ -+ public static EntityPlayerMP getCommandSenderAsPlayer(ICommandSender par0ICommandSender) { -+ if (par0ICommandSender instanceof EntityPlayerMP) { -+ return (EntityPlayerMP)par0ICommandSender; - } else { - throw new PlayerNotFoundException("You must specify which player you wish to perform this action on.", new Object[0]); - } - } - -- public static EntityPlayerMP getPlayer(ICommandSender var0, String var1) { -- EntityPlayerMP var2 = PlayerSelector.matchOnePlayer(var0, var1); -- if(var2 != null) { -+ public static EntityPlayerMP getPlayer(ICommandSender par0ICommandSender, String par1Str) { -+ EntityPlayerMP var2 = PlayerSelector.matchOnePlayer(par0ICommandSender, par1Str); -+ -+ if (var2 != null) { - return var2; - } else { -- var2 = MinecraftServer.getServer().getConfigurationManager().getPlayerEntity(var1); -- if(var2 == null) { -+ var2 = MinecraftServer.getServer().getConfigurationManager().getPlayerForUsername(par1Str); -+ -+ if (var2 == null) { - throw new PlayerNotFoundException(); - } else { - return var2; -@@ -111,35 +140,38 @@ - } - } - -- public static String func_96332_d(ICommandSender var0, String var1) { -- EntityPlayerMP var2 = PlayerSelector.matchOnePlayer(var0, var1); -- if(var2 != null) { -+ public static String func_96332_d(ICommandSender par0ICommandSender, String par1Str) { -+ EntityPlayerMP var2 = PlayerSelector.matchOnePlayer(par0ICommandSender, par1Str); -+ -+ if (var2 != null) { - return var2.getEntityName(); -- } else if(PlayerSelector.hasArguments(var1)) { -+ } else if (PlayerSelector.hasArguments(par1Str)) { - throw new PlayerNotFoundException(); - } else { -- return var1; -+ return par1Str; - } - } - -- public static String func_82360_a(ICommandSender var0, String[] var1, int var2) { -- return func_82361_a(var0, var1, var2, false); -+ public static String func_82360_a(ICommandSender par0ICommandSender, String[] par1ArrayOfStr, int par2) { -+ return func_82361_a(par0ICommandSender, par1ArrayOfStr, par2, false); - } - -- public static String func_82361_a(ICommandSender var0, String[] var1, int var2, boolean var3) { -+ public static String func_82361_a(ICommandSender par0ICommandSender, String[] par1ArrayOfStr, int par2, boolean par3) { - StringBuilder var4 = new StringBuilder(); - -- for(int var5 = var2; var5 < var1.length; ++var5) { -- if(var5 > var2) { -+ for (int var5 = par2; var5 < par1ArrayOfStr.length; ++var5) { -+ if (var5 > par2) { - var4.append(" "); - } - -- String var6 = var1[var5]; -- if(var3) { -- String var7 = PlayerSelector.matchPlayersAsString(var0, var6); -- if(var7 != null) { -+ String var6 = par1ArrayOfStr[var5]; -+ -+ if (par3) { -+ String var7 = PlayerSelector.matchPlayersAsString(par0ICommandSender, var6); -+ -+ if (var7 != null) { - var6 = var7; -- } else if(PlayerSelector.hasArguments(var6)) { -+ } else if (PlayerSelector.hasArguments(var6)) { - throw new PlayerNotFoundException(); - } - } -@@ -150,35 +182,39 @@ - return var4.toString(); - } - -- public static double func_110666_a(ICommandSender var0, double var1, String var3) { -- return func_110665_a(var0, var1, var3, -30000000, 30000000); -+ public static double func_110666_a(ICommandSender par0ICommandSender, double par1, String par3Str) { -+ return func_110665_a(par0ICommandSender, par1, par3Str, -30000000, 30000000); - } - -- public static double func_110665_a(ICommandSender var0, double var1, String var3, int var4, int var5) { -- boolean var6 = var3.startsWith("~"); -- if(var6 && Double.isNaN(var1)) { -- throw new NumberInvalidException("commands.generic.num.invalid", new Object[]{Double.valueOf(var1)}); -+ public static double func_110665_a(ICommandSender par0ICommandSender, double par1, String par3Str, int par4, int par5) { -+ boolean var6 = par3Str.startsWith("~"); -+ -+ if (var6 && Double.isNaN(par1)) { -+ throw new NumberInvalidException("commands.generic.num.invalid", new Object[] {Double.valueOf(par1)}); - } else { -- double var7 = var6 ? var1 : 0.0D; -- if(!var6 || var3.length() > 1) { -- boolean var9 = var3.contains("."); -- if(var6) { -- var3 = var3.substring(1); -+ double var7 = var6 ? par1 : 0.0D; -+ -+ if (!var6 || par3Str.length() > 1) { -+ boolean var9 = par3Str.contains("."); -+ -+ if (var6) { -+ par3Str = par3Str.substring(1); - } - -- var7 += parseDouble(var0, var3); -- if(!var9 && !var6) { -+ var7 += parseDouble(par0ICommandSender, par3Str); -+ -+ if (!var9 && !var6) { - var7 += 0.5D; - } - } - -- if(var4 != 0 || var5 != 0) { -- if(var7 < (double)var4) { -- throw new NumberInvalidException("commands.generic.double.tooSmall", new Object[]{Double.valueOf(var7), Integer.valueOf(var4)}); -+ if (par4 != 0 || par5 != 0) { -+ if (var7 < (double)par4) { -+ throw new NumberInvalidException("commands.generic.double.tooSmall", new Object[] {Double.valueOf(var7), Integer.valueOf(par4)}); - } - -- if(var7 > (double)var5) { -- throw new NumberInvalidException("commands.generic.double.tooBig", new Object[]{Double.valueOf(var7), Integer.valueOf(var5)}); -+ if (var7 > (double)par5) { -+ throw new NumberInvalidException("commands.generic.double.tooBig", new Object[] {Double.valueOf(var7), Integer.valueOf(par5)}); - } - } - -@@ -186,13 +222,17 @@ - } - } - -- public static String joinNiceString(Object[] var0) { -+ /** -+ * Joins the given string array into a "x, y, and z" seperated string. -+ */ -+ public static String joinNiceString(Object[] par0ArrayOfObj) { - StringBuilder var1 = new StringBuilder(); - -- for(int var2 = 0; var2 < var0.length; ++var2) { -- String var3 = var0[var2].toString(); -- if(var2 > 0) { -- if(var2 == var0.length - 1) { -+ for (int var2 = 0; var2 < par0ArrayOfObj.length; ++var2) { -+ String var3 = par0ArrayOfObj[var2].toString(); -+ -+ if (var2 > 0) { -+ if (var2 == par0ArrayOfObj.length - 1) { - var1.append(" and "); - } else { - var1.append(", "); -@@ -205,35 +245,43 @@ - return var1.toString(); - } - -- public static String func_96333_a(Collection var0) { -- return joinNiceString(var0.toArray(new String[var0.size()])); -+ public static String func_96333_a(Collection par0Collection) { -+ return joinNiceString(par0Collection.toArray(new String[par0Collection.size()])); - } - -- public static String func_110663_b(Collection var0) { -- String[] var1 = new String[var0.size()]; -+ public static String func_110663_b(Collection par0Collection) { -+ String[] var1 = new String[par0Collection.size()]; - int var2 = 0; -- - EntityLivingBase var4; -- for(Iterator var3 = var0.iterator(); var3.hasNext(); var1[var2++] = var4.getTranslatedEntityName()) { -+ -+ for (Iterator var3 = par0Collection.iterator(); var3.hasNext(); var1[var2++] = var4.getTranslatedEntityName()) { - var4 = (EntityLivingBase)var3.next(); - } - - return joinNiceString(var1); - } - -- public static boolean doesStringStartWith(String var0, String var1) { -- return var1.regionMatches(true, 0, var0, 0, var0.length()); -+ /** -+ * Returns true if the given substring is exactly equal to the start of the given string (case insensitive). -+ */ -+ public static boolean doesStringStartWith(String par0Str, String par1Str) { -+ return par1Str.regionMatches(true, 0, par0Str, 0, par0Str.length()); - } - -- public static List getListOfStringsMatchingLastWord(String[] var0, String... var1) { -- String var2 = var0[var0.length - 1]; -+ /** -+ * Returns a List of strings (chosen from the given strings) which the last word in the given string array is a -+ * beginning-match for. (Tab completion). -+ */ -+ public static List getListOfStringsMatchingLastWord(String[] par0ArrayOfStr, String ... par1ArrayOfStr) { -+ String var2 = par0ArrayOfStr[par0ArrayOfStr.length - 1]; - ArrayList var3 = new ArrayList(); -- String[] var4 = var1; -- int var5 = var1.length; -+ String[] var4 = par1ArrayOfStr; -+ int var5 = par1ArrayOfStr.length; - -- for(int var6 = 0; var6 < var5; ++var6) { -+ for (int var6 = 0; var6 < var5; ++var6) { - String var7 = var4[var6]; -- if(doesStringStartWith(var2, var7)) { -+ -+ if (doesStringStartWith(var2, var7)) { - var3.add(var7); - } - } -@@ -241,14 +289,19 @@ - return var3; - } - -- public static List getListOfStringsFromIterableMatchingLastWord(String[] var0, Iterable var1) { -- String var2 = var0[var0.length - 1]; -+ /** -+ * Returns a List of strings (chosen from the given string iterable) which the last word in the given string array is a -+ * beginning-match for. (Tab completion). -+ */ -+ public static List getListOfStringsFromIterableMatchingLastWord(String[] par0ArrayOfStr, Iterable par1Iterable) { -+ String var2 = par0ArrayOfStr[par0ArrayOfStr.length - 1]; - ArrayList var3 = new ArrayList(); -- Iterator var4 = var1.iterator(); -+ Iterator var4 = par1Iterable.iterator(); - -- while(var4.hasNext()) { -+ while (var4.hasNext()) { - String var5 = (String)var4.next(); -- if(doesStringStartWith(var2, var5)) { -+ -+ if (doesStringStartWith(var2, var5)) { - var3.add(var5); - } - } -@@ -256,30 +309,38 @@ - return var3; - } - -- public boolean isUsernameIndex(String[] var1, int var2) { -+ /** -+ * Return whether the specified command parameter index is a username parameter. -+ */ -+ public boolean isUsernameIndex(String[] par1ArrayOfStr, int par2) { - return false; - } - -- public static void notifyAdmins(ICommandSender var0, String var1, Object... var2) { -- notifyAdmins(var0, 0, var1, var2); -+ public static void notifyAdmins(ICommandSender par0ICommandSender, String par1Str, Object ... par2ArrayOfObj) { -+ notifyAdmins(par0ICommandSender, 0, par1Str, par2ArrayOfObj); - } - -- public static void notifyAdmins(ICommandSender var0, int var1, String var2, Object... var3) { -- if(theAdmin != null) { -- theAdmin.notifyAdmins(var0, var1, var2, var3); -+ public static void notifyAdmins(ICommandSender par0ICommandSender, int par1, String par2Str, Object ... par3ArrayOfObj) { -+ if (theAdmin != null) { -+ theAdmin.notifyAdmins(par0ICommandSender, par1, par2Str, par3ArrayOfObj); - } -- -- } -- -- public static void setAdminCommander(IAdminCommand var0) { -- theAdmin = var0; -- } -- -- public int compareTo(ICommand var1) { -- return this.getCommandName().compareTo(var1.getCommandName()); -- } -- -- public int compareTo(Object var1) { -- return this.compareTo((ICommand)var1); -+ } -+ -+ /** -+ * Sets the static IAdminCommander. -+ */ -+ public static void setAdminCommander(IAdminCommand par0IAdminCommand) { -+ theAdmin = par0IAdminCommand; -+ } -+ -+ /** -+ * Compares the name of this command to the name of the given command. -+ */ -+ public int compareTo(ICommand par1ICommand) { -+ return this.getCommandName().compareTo(par1ICommand.getCommandName()); -+ } -+ -+ public int compareTo(Object par1Obj) { -+ return this.compareTo((ICommand)par1Obj); - } - } ---- net/minecraft/src/Packet12PlayerLook.java -+++ net/minecraft/src/Packet12PlayerLook.java -@@ -9,25 +9,34 @@ - this.rotating = true; - } - -- public Packet12PlayerLook(float var1, float var2, boolean var3) { -- this.yaw = var1; -- this.pitch = var2; -- this.onGround = var3; -+ public Packet12PlayerLook(float par1, float par2, boolean par3) { -+ this.yaw = par1; -+ this.pitch = par2; -+ this.onGround = par3; - this.rotating = true; - } - -- public void readPacketData(DataInput var1) throws IOException { -- this.yaw = var1.readFloat(); -- this.pitch = var1.readFloat(); -- super.readPacketData(var1); -- } -- -- public void writePacketData(DataOutput var1) throws IOException { -- var1.writeFloat(this.yaw); -- var1.writeFloat(this.pitch); -- super.writePacketData(var1); -- } -- -+ /** -+ * Abstract. Reads the raw packet data from the data stream. -+ */ -+ public void readPacketData(DataInput par1DataInput) throws IOException { -+ this.yaw = par1DataInput.readFloat(); -+ this.pitch = par1DataInput.readFloat(); -+ super.readPacketData(par1DataInput); -+ } -+ -+ /** -+ * Abstract. Writes the raw packet data to the data stream. -+ */ -+ public void writePacketData(DataOutput par1DataOutput) throws IOException { -+ par1DataOutput.writeFloat(this.yaw); -+ par1DataOutput.writeFloat(this.pitch); -+ super.writePacketData(par1DataOutput); -+ } -+ -+ /** -+ * Abstract. Return the size of the packet (not counting the header). -+ */ - public int getPacketSize() { - return 9; - } ---- /dev/null -+++ org/spoutcraft/client/packet/PacketSendPrecache.java -@@ -1,0 +1,151 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.client.packet; -+ -+import java.io.File; -+import java.io.IOException; -+import java.util.zip.DataFormatException; -+import java.util.zip.Deflater; -+import java.util.zip.Inflater; -+ -+import org.apache.commons.io.FileUtils; -+import org.apache.commons.io.output.ByteArrayOutputStream; -+ -+import org.spoutcraft.api.io.SpoutInputStream; -+import org.spoutcraft.api.io.SpoutOutputStream; -+import org.spoutcraft.client.precache.PrecacheManager; -+import org.spoutcraft.client.precache.PrecacheTuple; -+ -+public class PacketSendPrecache implements CompressablePacket { -+ private byte[] fileData; -+ private String plugin; -+ private String version; -+ private boolean compressed = false; -+ -+ public PacketSendPrecache() { -+ } -+ -+ public PacketSendPrecache(File file) { -+ try { -+ this.fileData = FileUtils.readFileToByteArray(file); -+ } catch (IOException e) { -+ e.printStackTrace(); -+ } -+ } -+ -+ // TODO move to separate thread? -+ public void compress() { -+ if (!compressed) { -+ Deflater deflater = new Deflater(); -+ deflater.setInput(fileData); -+ deflater.setLevel(Deflater.BEST_COMPRESSION); -+ deflater.finish(); -+ ByteArrayOutputStream bos = new ByteArrayOutputStream(fileData.length); -+ byte[] buffer = new byte[1024]; -+ while (!deflater.finished()) { -+ int bytesCompressed = deflater.deflate(buffer); -+ bos.write(buffer, 0, bytesCompressed); -+ } -+ try { -+ bos.close(); -+ } catch (IOException e) { -+ e.printStackTrace(); -+ } -+ fileData = bos.toByteArray(); -+ compressed = true; -+ } -+ } -+ -+ public boolean isCompressed() { -+ return compressed; -+ } -+ -+ public void decompress() { -+ if (compressed) { -+ Inflater decompressor = new Inflater(); -+ decompressor.setInput(fileData); -+ -+ ByteArrayOutputStream bos = new ByteArrayOutputStream(fileData.length); -+ -+ byte[] buf = new byte[1024]; -+ while (!decompressor.finished()) { -+ try { -+ int count = decompressor.inflate(buf); -+ bos.write(buf, 0, count); -+ } catch (DataFormatException e) { -+ } -+ } -+ try { -+ bos.close(); -+ } catch (IOException e) { -+ } -+ -+ fileData = bos.toByteArray(); -+ } -+ } -+ -+ public void readData(SpoutInputStream input) throws IOException { -+ this.plugin = input.readString(); -+ this.version = input.readString(); -+ compressed = input.readBoolean(); -+ int size = input.readInt(); -+ this.fileData = new byte[size]; -+ input.read(fileData); -+ } -+ -+ public void writeData(SpoutOutputStream output) throws IOException { -+ output.writeString(plugin); -+ output.writeString(version); -+ output.writeBoolean(compressed); -+ output.writeInt(fileData.length); -+ output.write(fileData); -+ } -+ -+ public void failure(int playerId) { -+ } -+ -+ public PacketType getPacketType() { -+ return PacketType.PacketSendPrecache; -+ } -+ -+ public int getVersion() { -+ return 0; -+ } -+ -+ public void run(int playerId) { -+ // Packet recieved, grabbing the zip file -+ File zip = PrecacheManager.getPluginPreCacheFile(plugin, version); -+ if (zip.exists()) { -+ zip.delete(); -+ } -+ -+ try { -+ FileUtils.writeByteArrayToFile(zip, fileData); -+ } catch (IOException e) { -+ e.printStackTrace(); -+ } -+ -+ PrecacheTuple plugin = PrecacheManager.getPrecacheTuple(this.plugin, version); -+ if (plugin != null) { -+ PrecacheManager.setCached(plugin); -+ } -+ PrecacheManager.doNextCache(); -+ } -+} ---- /dev/null -+++ org/spoutcraft/client/gui/settings/controls/RenderDistanceButton.java -@@ -1,0 +1,55 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.client.gui.settings.controls; -+ -+import net.minecraft.src.Minecraft; -+ -+import org.spoutcraft.api.player.RenderDistance; -+import org.spoutcraft.client.SpoutClient; -+import org.spoutcraft.client.config.Configuration; -+ -+public class RenderDistanceButton extends AutomatedButton { -+ RenderDistance distance = RenderDistance.getRenderDistanceFromValue(Configuration.getRenderDistance()); -+ public RenderDistanceButton() { -+ setTooltip("Visible distance\nFar - 256m (slower\nNormal - 128m\nShort - 64m (faster)\nTiny - 32m (fastest)"); -+ } -+ -+ @Override -+ public String getText() { -+ return "Render Distance: " + distance.toString(); -+ } -+ -+ @Override -+ public void onButtonClick() { -+ if (SpoutClient.getInstance().getActivePlayer() != null) { -+ distance = SpoutClient.getInstance().getActivePlayer().getNextRenderDistance(); -+ Configuration.setRenderDistance(distance.getValue()); -+ } else { -+ Configuration.setRenderDistance(Configuration.getRenderDistance() + 1); -+ if (Configuration.getRenderDistance() > 3) { -+ Configuration.setRenderDistance(0); -+ } -+ distance = RenderDistance.getRenderDistanceFromValue(Configuration.getRenderDistance()); -+ } -+ Minecraft.getMinecraft().gameSettings.renderDistance = distance.getValue(); -+ Configuration.write(); -+ Minecraft.getMinecraft().gameSettings.saveOptions(); -+ } -+} ---- net/minecraft/src/MaterialTransparent.java -+++ net/minecraft/src/MaterialTransparent.java -@@ -1,8 +1,8 @@ - package net.minecraft.src; - - public class MaterialTransparent extends Material { -- public MaterialTransparent(MapColor var1) { -- super(var1); -+ public MaterialTransparent(MapColor par1MapColor) { -+ super(par1MapColor); - this.setReplaceable(); - } - -@@ -10,10 +10,16 @@ - return false; - } - -+ /** -+ * Will prevent grass from growing on dirt underneath and kill any grass below it if it returns true -+ */ - public boolean getCanBlockGrass() { - return false; - } - -+ /** -+ * Returns if this material is considered solid or not -+ */ - public boolean blocksMovement() { - return false; - } ---- net/minecraft/src/EntityGiantZombie.java -+++ net/minecraft/src/EntityGiantZombie.java -@@ -1,8 +1,8 @@ - package net.minecraft.src; - - public class EntityGiantZombie extends EntityMob { -- public EntityGiantZombie(World var1) { -- super(var1); -+ public EntityGiantZombie(World par1World) { -+ super(par1World); - this.yOffset *= 6.0F; - this.setSize(this.width * 6.0F, this.height * 6.0F); - } -@@ -14,7 +14,11 @@ - this.getEntityAttribute(SharedMonsterAttributes.attackDamage).setAttribute(50.0D); - } - -- public float getBlockPathWeight(int var1, int var2, int var3) { -- return this.worldObj.getLightBrightness(var1, var2, var3) - 0.5F; -+ /** -+ * Takes a coordinate in and returns a weight to determine how likely this creature will try to path to the block. -+ * Args: x, y, z -+ */ -+ public float getBlockPathWeight(int par1, int par2, int par3) { -+ return this.worldObj.getLightBrightness(par1, par2, par3) - 0.5F; - } - } ---- net/minecraft/src/CommandSetPlayerTimeout.java -+++ net/minecraft/src/CommandSetPlayerTimeout.java -@@ -7,19 +7,22 @@ - return "setidletimeout"; - } - -+ /** -+ * Return the required permission level for this command. -+ */ - public int getRequiredPermissionLevel() { - return 3; - } - -- public String getCommandUsage(ICommandSender var1) { -+ public String getCommandUsage(ICommandSender par1ICommandSender) { - return "commands.setidletimeout.usage"; - } - -- public void processCommand(ICommandSender var1, String[] var2) { -- if(var2.length == 1) { -- int var3 = parseIntWithMin(var1, var2[0], 0); -+ public void processCommand(ICommandSender par1ICommandSender, String[] par2ArrayOfStr) { -+ if (par2ArrayOfStr.length == 1) { -+ int var3 = parseIntWithMin(par1ICommandSender, par2ArrayOfStr[0], 0); - MinecraftServer.getServer().func_143006_e(var3); -- notifyAdmins(var1, "commands.setidletimeout.success", new Object[]{Integer.valueOf(var3)}); -+ notifyAdmins(par1ICommandSender, "commands.setidletimeout.success", new Object[] {Integer.valueOf(var3)}); - } else { - throw new WrongUsageException("commands.setidletimeout.usage", new Object[0]); - } ---- net/minecraft/src/ResourceLocation.java -+++ net/minecraft/src/ResourceLocation.java -@@ -3,59 +3,62 @@ - import org.apache.commons.lang3.Validate; - - public class ResourceLocation { -- private final String a; -- private final String b; -- -- public ResourceLocation(String var1, String var2) { -- Validate.notNull(var2); -- if(var1 != null && var1.length() != 0) { -- this.a = var1; -+ private final String resourceDomain; -+ private final String resourcePath; -+ -+ public ResourceLocation(String par1Str, String par2Str) { -+ Validate.notNull(par2Str); -+ -+ if (par1Str != null && par1Str.length() != 0) { -+ this.resourceDomain = par1Str; - } else { -- this.a = "minecraft"; -+ this.resourceDomain = "minecraft"; - } - -- this.b = var2; -+ this.resourcePath = par2Str; - } - -- public ResourceLocation(String var1) { -+ public ResourceLocation(String par1Str) { - String var2 = "minecraft"; -- String var3 = var1; -- int var4 = var1.indexOf(58); -- if(var4 >= 0) { -- var3 = var1.substring(var4 + 1, var1.length()); -- if(var4 > 1) { -- var2 = var1.substring(0, var4); -+ String var3 = par1Str; -+ int var4 = par1Str.indexOf(58); -+ -+ if (var4 >= 0) { -+ var3 = par1Str.substring(var4 + 1, par1Str.length()); -+ -+ if (var4 > 1) { -+ var2 = par1Str.substring(0, var4); - } - } - -- this.a = var2.toLowerCase(); -- this.b = var3; -+ this.resourceDomain = var2.toLowerCase(); -+ this.resourcePath = var3; - } - - public String getResourcePath() { -- return this.b; -+ return this.resourcePath; - } - - public String getResourceDomain() { -- return this.a; -+ return this.resourceDomain; - } - - public String toString() { -- return this.a + ":" + this.b; -+ return this.resourceDomain + ":" + this.resourcePath; - } - -- public boolean equals(Object var1) { -- if(this == var1) { -+ public boolean equals(Object par1Obj) { -+ if (this == par1Obj) { - return true; -- } else if(!(var1 instanceof ResourceLocation)) { -+ } else if (!(par1Obj instanceof ResourceLocation)) { - return false; - } else { -- ResourceLocation var2 = (ResourceLocation)var1; -- return this.a.equals(var2.a) && this.b.equals(var2.b); -+ ResourceLocation var2 = (ResourceLocation)par1Obj; -+ return this.resourceDomain.equals(var2.resourceDomain) && this.resourcePath.equals(var2.resourcePath); - } - } - - public int hashCode() { -- return 31 * this.a.hashCode() + this.b.hashCode(); -+ return 31 * this.resourceDomain.hashCode() + this.resourcePath.hashCode(); - } - } ---- /dev/null -+++ org/spoutcraft/client/util/NetworkUtils.java -@@ -1,0 +1,163 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.client.util; -+ -+import java.awt.Desktop; -+import java.io.BufferedReader; -+import java.io.IOException; -+import java.io.InputStreamReader; -+import java.net.HttpURLConnection; -+import java.net.InetSocketAddress; -+import java.net.URISyntaxException; -+import java.net.URL; -+import java.util.regex.Pattern; -+ -+import org.xbill.DNS.Lookup; -+import org.xbill.DNS.Record; -+import org.xbill.DNS.SRVRecord; -+import org.xbill.DNS.TextParseException; -+import org.xbill.DNS.Type; -+ -+import org.spoutcraft.client.gui.server.ServerItem; -+ -+public class NetworkUtils { -+ /** -+ * A {@link Pattern} matching valid DNS hostnames (as opposed to IP addresses). -+ */ -+ private static final Pattern HOSTNAME_PATTERN = Pattern.compile("[a-zA-Z-]"); -+ -+ public static void pingUrl(String Url) { -+ try { -+ URL url = new URL(Url); -+ HttpURLConnection con = (HttpURLConnection)(url.openConnection()); -+ System.setProperty("http.agent", ""); -+ con.setRequestProperty("User-Agent", "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/534.30 (KHTML, like Gecko) Chrome/12.0.742.100 Safari/534.30"); -+ BufferedReader in = new BufferedReader(new InputStreamReader(con.getInputStream())); -+ String str; -+ while ((str = in.readLine()) != null); -+ in.close(); -+ } catch (Exception e) { -+ } -+ } -+ -+ public static void openInBrowser(String url) { -+ try { -+ java.net.URI uri = new java.net.URI(url); -+ Desktop desktop = Desktop.getDesktop(); -+ desktop.browse(uri); -+ } catch (IOException e) { -+ e.printStackTrace(); -+ } catch (URISyntaxException e) { -+ e.printStackTrace(); -+ } -+ } -+ -+ /** -+ * Resolves a hostname to an {@link InetSocketAddress}, encapsulating an IP address and -+ * port. hostname may represent a valid DNS hostname or an IP address. If -+ * hostname is a valid DNS hostname and port is equal -+ * to {@link ServerItem#DEFAULT_PORT} (implying the user may not have specified a server -+ * port), a SRV record lookup may -+ * be attempted—see {@link #resolve(String)} for implementation details. -+ *

-+ * This method is the equivalent of passing true to {@link #resolve(String, int, boolean)}. -+ * -+ * @param hostname the DNS hostname to resolve. -+ * @param port the port number to encapsulate within the InetSocketAddress. -+ * @return an {@link InetSocketAddress}, which may be marked unresolved if hostname lookup failed. -+ */ -+ public static InetSocketAddress resolve(String hostname, int port) { -+ return resolve(hostname, port, true); -+ } -+ -+ /** -+ * Resolves a hostname to an {@link InetSocketAddress}, encapsulating an IP address and -+ * port. An optional SRV record -+ * lookup may be attempted—see {@link #resolve(String)} for implementation details. -+ * A SRV record lookup will only be attempted if hostname represents a valid -+ * DNS hostname, and port is equal to {@link ServerItem#DEFAULT_PORT} (implying -+ * the user may not have specified a server port). -+ *

-+ * If srv is true and SRV record lookup fails or returns no -+ * results, a regular DNS lookup will be attempted. -+ *

-+ * If the given hostname represents an IP address, it will not be resolved. -+ * -+ * @param hostname the DNS hostname to resolve. -+ * @param port the port number to encapsulate within the InetSocketAddress. -+ * @param srv whether to attempt a SRV record lookup. -+ * @return an {@link InetSocketAddress}, which may be marked unresolved if hostname lookup failed. -+ */ -+ public static InetSocketAddress resolve(String hostname, int port, boolean srv) { -+ if (srv && (port == ServerItem.DEFAULT_PORT) && (HOSTNAME_PATTERN.matcher(hostname).find())) { -+ try { -+ InetSocketAddress address = resolve(hostname); -+ if (address != null) { -+ return address; -+ } -+ } catch (TextParseException e) { -+ // Do nothing: fall back on a regular DNS lookup before failing -+ } -+ } -+ -+ return new InetSocketAddress(hostname, port); -+ } -+ -+ /** -+ * Resolves a hostname to an {@link InetSocketAddress}, encapsulating an IP address and -+ * port, using a SRV record lookup. -+ * This method assumes minecraft as the service name during the DNS query, -+ * such that a matching record looks like: -+ *

-+ * _minecraft._tcp.example.com. 86400 IN SRV 0 1 25565 minecraft.example.com. -+ *

-+ * If multiple SRV records exist for a given hostname, the record with the highest priority -+ * (that is, the lowest priority value) is selected. This implementation does not take -+ * into account relative weights for records with identical priorities, and behavior in -+ * such cases is undefined. -+ * -+ * @param hostname the DNS hostname to on which to perform a SRV lookup. -+ * @return an {@link InetSocketAddress}, or null if no SRV record was found. -+ * @throws TextParseException if the hostname is malformed. -+ */ -+ public static InetSocketAddress resolve(String hostname) throws TextParseException { -+ String query = "_minecraft._tcp." + hostname.trim(); -+ Record[] records = new Lookup(query, Type.SRV).run(); -+ -+ if ((records != null) && (records.length > 0)) { -+ SRVRecord srv = (SRVRecord)records[0]; -+ -+ if (records.length > 1) { -+ for (int i = 1; i < records.length; i++) { -+ SRVRecord record = (SRVRecord)records[i]; -+ if (record.getPriority() < srv.getPriority()) { -+ srv = record; -+ } -+ } -+ } -+ -+ String host = srv.getTarget().toString().replaceAll("\\.+$", ""); -+ int port = srv.getPort(); -+ return new InetSocketAddress(host, port); -+ } -+ -+ return null; -+ } -+} ---- /dev/null -+++ net/minecraft/src/ThreadDownloadImage.java -@@ -1,0 +1,73 @@ -+package net.minecraft.src; -+ -+import java.awt.image.BufferedImage; -+import java.net.HttpURLConnection; -+import java.net.URL; -+import javax.imageio.ImageIO; -+ -+class ThreadDownloadImage extends Thread { -+ -+ /** The URL of the image to download. */ -+ final String location; -+ -+ /** The image buffer to use. */ -+ final IImageBuffer buffer; -+ -+ /** The image data. */ -+ final ThreadDownloadImageData imageData; -+ -+ ThreadDownloadImage(ThreadDownloadImageData par1, String par2Str, IImageBuffer par3IImageBuffer) { -+ setDaemon(true); -+ this.imageData = par1; -+ this.location = par2Str; -+ this.buffer = par3IImageBuffer; -+ } -+ -+ public void run() { -+ HttpURLConnection var1 = null; -+ -+ try { -+ // Spout Start -+ HttpURLConnection.setFollowRedirects(true); -+ // Spout End -+ URL var2 = new URL(this.location); -+ var1 = (HttpURLConnection)var2.openConnection(); -+ // Spout Start -+ System.setProperty("http.agent", ""); -+ var1.setRequestProperty("User-Agent", "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/534.30 (KHTML, like Gecko) Chrome/12.0.742.100 Safari/534.30"); -+ // Spout End -+ var1.setDoInput(true); -+ var1.setDoOutput(false); -+ var1.connect(); -+ -+ if (var1.getResponseCode() / 100 == 4) { -+ return; -+ } -+ -+ BufferedImage image; -+ -+ if (this.buffer == null) { -+ image = ImageIO.read(var1.getInputStream()); -+ } else { -+ // Spout Start -+ image = ImageIO.read(var1.getInputStream()); -+ if (image != null) { -+ image = this.buffer.parseUserSkin(image); -+ } else { -+ System.out.println("No image data found for " + location); -+ return; -+ } -+ // Spout End -+ } -+ imageData.getBufferedImage(image); -+ } catch (Exception var6) { -+ // Spout Start -+ var6.printStackTrace(); -+ // Spout End -+ } finally { -+ if (var1 != null) { -+ var1.disconnect(); -+ } -+ } -+ } -+} ---- net/minecraft/src/Packet70GameEvent.java -+++ net/minecraft/src/Packet70GameEvent.java -@@ -5,32 +5,53 @@ - import java.io.IOException; - - public class Packet70GameEvent extends Packet { -- public static final String[] a = new String[]{"tile.bed.notValid", null, null, "gameMode.changed"}; -+ -+ /** -+ * The client prints clientMessage[eventType] to chat when this packet is received. -+ */ -+ public static final String[] clientMessage = new String[] {"tile.bed.notValid", null, null, "gameMode.changed"}; -+ -+ /** 0: Invalid bed, 1: Rain starts, 2: Rain stops, 3: Game mode changed. */ - public int eventType; -+ -+ /** -+ * When reason==3, the game mode to set. See EnumGameType for a list of values. -+ */ - public int gameMode; - -- public Packet70GameEvent() { -- } -- -- public Packet70GameEvent(int var1, int var2) { -- this.eventType = var1; -- this.gameMode = var2; -- } -- -- public void readPacketData(DataInput var1) throws IOException { -- this.eventType = var1.readByte(); -- this.gameMode = var1.readByte(); -- } -- -- public void writePacketData(DataOutput var1) throws IOException { -- var1.writeByte(this.eventType); -- var1.writeByte(this.gameMode); -- } -- -- public void processPacket(NetHandler var1) { -- var1.handleGameEvent(this); -- } -- -+ public Packet70GameEvent() {} -+ -+ public Packet70GameEvent(int par1, int par2) { -+ this.eventType = par1; -+ this.gameMode = par2; -+ } -+ -+ /** -+ * Abstract. Reads the raw packet data from the data stream. -+ */ -+ public void readPacketData(DataInput par1DataInput) throws IOException { -+ this.eventType = par1DataInput.readByte(); -+ this.gameMode = par1DataInput.readByte(); -+ } -+ -+ /** -+ * Abstract. Writes the raw packet data to the data stream. -+ */ -+ public void writePacketData(DataOutput par1DataOutput) throws IOException { -+ par1DataOutput.writeByte(this.eventType); -+ par1DataOutput.writeByte(this.gameMode); -+ } -+ -+ /** -+ * Passes this Packet on to the NetHandler for processing. -+ */ -+ public void processPacket(NetHandler par1NetHandler) { -+ par1NetHandler.handleGameEvent(this); -+ } -+ -+ /** -+ * Abstract. Return the size of the packet (not counting the header). -+ */ - public int getPacketSize() { - return 2; - } ---- /dev/null -+++ org/spoutcraft/client/gui/settings/controls/AutosaveButton.java -@@ -1,0 +1,68 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.client.gui.settings.controls; -+ -+import net.minecraft.src.Minecraft; -+ -+import org.spoutcraft.client.config.Configuration; -+ -+public class AutosaveButton extends AutomatedButton { -+ public AutosaveButton() { -+ setTooltip("Autosave interval\nDefault autosave interval (2s) is NOT RECOMMENDED.\nAutosave causes the famous Lag Spike of Death."); -+ } -+ -+ @Override -+ public String getText() { -+ switch(Configuration.getAutosave()) { -+ case 0: return "Autosave: 30 min"; -+ case 1: return "Autosave: 3 min"; -+ case 2: return "Autosave: 1 min"; -+ case 3: return "Autosave: 30 sec"; -+ case 4: return "Autosave: 10 sec"; -+ case 5: return "Autosave: 2 sec"; -+ } -+ return "Unknown State: " + Configuration.getAutosave(); -+ } -+ -+ @Override -+ public void onButtonClick() { -+ Configuration.setAutosave(Configuration.getAutosave() + 1); -+ if (Configuration.getAutosave() > 5) { -+ Configuration.setAutosave(0); -+ } -+ Configuration.write(); -+ -+ if (Minecraft.getMinecraft().theWorld != null) { -+ //Minecraft.getMinecraft().theWorld.autosavePeriod = getAutosaveTicks(); -+ } -+ } -+ -+ public static int getAutosaveTicks() { -+ switch(Configuration.getAutosave()) { -+ case 0: return 30 * 60 * 20; -+ case 1: return 3 * 60 * 20; -+ case 2: return 60 * 20; -+ case 3: return 30 * 20; -+ case 4: return 10 * 20; -+ case 5: return 2 * 20; -+ default: return 40; -+ } -+ } -+} ---- net/minecraft/src/Packet4UpdateTime.java -+++ net/minecraft/src/Packet4UpdateTime.java -@@ -5,50 +5,77 @@ - import java.io.IOException; - - public class Packet4UpdateTime extends Packet { -+ -+ /** World age in ticks. */ - public long worldAge; -+ -+ /** The world time in minutes. */ - public long time; - -- public Packet4UpdateTime() { -- } -- -- public Packet4UpdateTime(long var1, long var3, boolean var5) { -- this.worldAge = var1; -- this.time = var3; -- if(!var5) { -+ public Packet4UpdateTime() {} -+ -+ public Packet4UpdateTime(long par1, long par3, boolean par5) { -+ this.worldAge = par1; -+ this.time = par3; -+ -+ if (!par5) { - this.time = -this.time; -- if(this.time == 0L) { -+ -+ if (this.time == 0L) { - this.time = -1L; - } - } -- -- } -- -- public void readPacketData(DataInput var1) throws IOException { -- this.worldAge = var1.readLong(); -- this.time = var1.readLong(); -- } -- -- public void writePacketData(DataOutput var1) throws IOException { -- var1.writeLong(this.worldAge); -- var1.writeLong(this.time); -- } -- -- public void processPacket(NetHandler var1) { -- var1.handleUpdateTime(this); -- } -- -+ } -+ -+ /** -+ * Abstract. Reads the raw packet data from the data stream. -+ */ -+ public void readPacketData(DataInput par1DataInput) throws IOException { -+ this.worldAge = par1DataInput.readLong(); -+ this.time = par1DataInput.readLong(); -+ } -+ -+ /** -+ * Abstract. Writes the raw packet data to the data stream. -+ */ -+ public void writePacketData(DataOutput par1DataOutput) throws IOException { -+ par1DataOutput.writeLong(this.worldAge); -+ par1DataOutput.writeLong(this.time); -+ } -+ -+ /** -+ * Passes this Packet on to the NetHandler for processing. -+ */ -+ public void processPacket(NetHandler par1NetHandler) { -+ par1NetHandler.handleUpdateTime(this); -+ } -+ -+ /** -+ * Abstract. Return the size of the packet (not counting the header). -+ */ - public int getPacketSize() { - return 16; - } - -+ /** -+ * only false for the abstract Packet class, all real packets return true -+ */ - public boolean isRealPacket() { - return true; - } - -- public boolean containsSameEntityIDAs(Packet var1) { -+ /** -+ * eg return packet30entity.entityId == entityId; WARNING : will throw if you compare a packet to a different packet -+ * class -+ */ -+ public boolean containsSameEntityIDAs(Packet par1Packet) { - return true; - } - -+ /** -+ * If this returns true, the packet may be processed on any thread; otherwise it is queued for the main thread to -+ * handle. -+ */ - public boolean canProcessAsync() { - return true; - } ---- net/minecraft/src/MerchantRecipe.java -+++ net/minecraft/src/MerchantRecipe.java -@@ -1,61 +1,91 @@ - package net.minecraft.src; - - public class MerchantRecipe { -+ -+ /** Item the Villager buys. */ - private ItemStack itemToBuy; -+ -+ /** Second Item the Villager buys. */ - private ItemStack secondItemToBuy; -+ -+ /** Item the Villager sells. */ - private ItemStack itemToSell; -+ -+ /** -+ * Saves how much has been tool used when put into to slot to be enchanted. -+ */ - private int toolUses; -+ -+ /** Maximum times this trade can be used. */ - private int maxTradeUses; - -- public MerchantRecipe(NBTTagCompound var1) { -- this.readFromTags(var1); -+ public MerchantRecipe(NBTTagCompound par1NBTTagCompound) { -+ this.readFromTags(par1NBTTagCompound); - } - -- public MerchantRecipe(ItemStack var1, ItemStack var2, ItemStack var3) { -- this.itemToBuy = var1; -- this.secondItemToBuy = var2; -- this.itemToSell = var3; -+ public MerchantRecipe(ItemStack par1ItemStack, ItemStack par2ItemStack, ItemStack par3ItemStack) { -+ this.itemToBuy = par1ItemStack; -+ this.secondItemToBuy = par2ItemStack; -+ this.itemToSell = par3ItemStack; - this.maxTradeUses = 7; - } - -- public MerchantRecipe(ItemStack var1, ItemStack var2) { -- this(var1, (ItemStack)null, var2); -- } -- -- public MerchantRecipe(ItemStack var1, Item var2) { -- this(var1, new ItemStack(var2)); -- } -- -+ public MerchantRecipe(ItemStack par1ItemStack, ItemStack par2ItemStack) { -+ this(par1ItemStack, (ItemStack)null, par2ItemStack); -+ } -+ -+ public MerchantRecipe(ItemStack par1ItemStack, Item par2Item) { -+ this(par1ItemStack, new ItemStack(par2Item)); -+ } -+ -+ /** -+ * Gets the itemToBuy. -+ */ - public ItemStack getItemToBuy() { - return this.itemToBuy; - } - -+ /** -+ * Gets secondItemToBuy. -+ */ - public ItemStack getSecondItemToBuy() { - return this.secondItemToBuy; - } - -+ /** -+ * Gets if Villager has secondItemToBuy. -+ */ - public boolean hasSecondItemToBuy() { - return this.secondItemToBuy != null; - } - -+ /** -+ * Gets itemToSell. -+ */ - public ItemStack getItemToSell() { - return this.itemToSell; - } - -- public boolean hasSameIDsAs(MerchantRecipe var1) { -- return this.itemToBuy.itemID == var1.itemToBuy.itemID && this.itemToSell.itemID == var1.itemToSell.itemID ? this.secondItemToBuy == null && var1.secondItemToBuy == null || this.secondItemToBuy != null && var1.secondItemToBuy != null && this.secondItemToBuy.itemID == var1.secondItemToBuy.itemID : false; -+ /** -+ * checks if both the first and second ItemToBuy IDs are the same -+ */ -+ public boolean hasSameIDsAs(MerchantRecipe par1MerchantRecipe) { -+ return this.itemToBuy.itemID == par1MerchantRecipe.itemToBuy.itemID && this.itemToSell.itemID == par1MerchantRecipe.itemToSell.itemID ? this.secondItemToBuy == null && par1MerchantRecipe.secondItemToBuy == null || this.secondItemToBuy != null && par1MerchantRecipe.secondItemToBuy != null && this.secondItemToBuy.itemID == par1MerchantRecipe.secondItemToBuy.itemID : false; - } - -- public boolean hasSameItemsAs(MerchantRecipe var1) { -- return this.hasSameIDsAs(var1) && (this.itemToBuy.stackSize < var1.itemToBuy.stackSize || this.secondItemToBuy != null && this.secondItemToBuy.stackSize < var1.secondItemToBuy.stackSize); -+ /** -+ * checks first and second ItemToBuy ID's and count. Calls hasSameIDs -+ */ -+ public boolean hasSameItemsAs(MerchantRecipe par1MerchantRecipe) { -+ return this.hasSameIDsAs(par1MerchantRecipe) && (this.itemToBuy.stackSize < par1MerchantRecipe.itemToBuy.stackSize || this.secondItemToBuy != null && this.secondItemToBuy.stackSize < par1MerchantRecipe.secondItemToBuy.stackSize); - } - - public void incrementToolUses() { - ++this.toolUses; - } - -- public void func_82783_a(int var1) { -- this.maxTradeUses += var1; -+ public void func_82783_a(int par1) { -+ this.maxTradeUses += par1; - } - - public boolean func_82784_g() { -@@ -66,32 +96,33 @@ - this.toolUses = this.maxTradeUses; - } - -- public void readFromTags(NBTTagCompound var1) { -- NBTTagCompound var2 = var1.getCompoundTag("buy"); -+ public void readFromTags(NBTTagCompound par1NBTTagCompound) { -+ NBTTagCompound var2 = par1NBTTagCompound.getCompoundTag("buy"); - this.itemToBuy = ItemStack.loadItemStackFromNBT(var2); -- NBTTagCompound var3 = var1.getCompoundTag("sell"); -+ NBTTagCompound var3 = par1NBTTagCompound.getCompoundTag("sell"); - this.itemToSell = ItemStack.loadItemStackFromNBT(var3); -- if(var1.hasKey("buyB")) { -- this.secondItemToBuy = ItemStack.loadItemStackFromNBT(var1.getCompoundTag("buyB")); -- } -- -- if(var1.hasKey("uses")) { -- this.toolUses = var1.getInteger("uses"); -- } -- -- if(var1.hasKey("maxUses")) { -- this.maxTradeUses = var1.getInteger("maxUses"); -+ -+ if (par1NBTTagCompound.hasKey("buyB")) { -+ this.secondItemToBuy = ItemStack.loadItemStackFromNBT(par1NBTTagCompound.getCompoundTag("buyB")); -+ } -+ -+ if (par1NBTTagCompound.hasKey("uses")) { -+ this.toolUses = par1NBTTagCompound.getInteger("uses"); -+ } -+ -+ if (par1NBTTagCompound.hasKey("maxUses")) { -+ this.maxTradeUses = par1NBTTagCompound.getInteger("maxUses"); - } else { - this.maxTradeUses = 7; - } -- - } - - public NBTTagCompound writeToTags() { - NBTTagCompound var1 = new NBTTagCompound(); - var1.setCompoundTag("buy", this.itemToBuy.writeToNBT(new NBTTagCompound("buy"))); - var1.setCompoundTag("sell", this.itemToSell.writeToNBT(new NBTTagCompound("sell"))); -- if(this.secondItemToBuy != null) { -+ -+ if (this.secondItemToBuy != null) { - var1.setCompoundTag("buyB", this.secondItemToBuy.writeToNBT(new NBTTagCompound("buyB"))); - } - ---- net/minecraft/src/ItemLeash.java -+++ net/minecraft/src/ItemLeash.java -@@ -4,18 +4,23 @@ - import java.util.List; - - public class ItemLeash extends Item { -- public ItemLeash(int var1) { -- super(var1); -+ public ItemLeash(int par1) { -+ super(par1); - this.setCreativeTab(CreativeTabs.tabTools); - } - -- public boolean onItemUse(ItemStack var1, EntityPlayer var2, World var3, int var4, int var5, int var6, int var7, float var8, float var9, float var10) { -- int var11 = var3.getBlockId(var4, var5, var6); -- if(Block.blocksList[var11] != null && Block.blocksList[var11].getRenderType() == 11) { -- if(var3.isRemote) { -+ /** -+ * Callback for item usage. If the item does something special on right clicking, he will have one of those. Return -+ * True if something happen and false if it don't. This is for ITEMS, not BLOCKS -+ */ -+ public boolean onItemUse(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, World par3World, int par4, int par5, int par6, int par7, float par8, float par9, float par10) { -+ int var11 = par3World.getBlockId(par4, par5, par6); -+ -+ if (Block.blocksList[var11] != null && Block.blocksList[var11].getRenderType() == 11) { -+ if (par3World.isRemote) { - return true; - } else { -- func_135066_a(var2, var3, var4, var5, var6); -+ func_135066_a(par2EntityPlayer, par3World, par4, par5, par6); - return true; - } - } else { -@@ -23,19 +28,21 @@ - } - } - -- public static boolean func_135066_a(EntityPlayer var0, World var1, int var2, int var3, int var4) { -- EntityLeashKnot var5 = EntityLeashKnot.getKnotForBlock(var1, var2, var3, var4); -+ public static boolean func_135066_a(EntityPlayer par0EntityPlayer, World par1World, int par2, int par3, int par4) { -+ EntityLeashKnot var5 = EntityLeashKnot.getKnotForBlock(par1World, par2, par3, par4); - boolean var6 = false; - double var7 = 7.0D; -- List var9 = var1.getEntitiesWithinAABB(EntityLiving.class, AxisAlignedBB.getAABBPool().getAABB((double)var2 - var7, (double)var3 - var7, (double)var4 - var7, (double)var2 + var7, (double)var3 + var7, (double)var4 + var7)); -- if(var9 != null) { -+ List var9 = par1World.getEntitiesWithinAABB(EntityLiving.class, AxisAlignedBB.getAABBPool().getAABB((double)par2 - var7, (double)par3 - var7, (double)par4 - var7, (double)par2 + var7, (double)par3 + var7, (double)par4 + var7)); -+ -+ if (var9 != null) { - Iterator var10 = var9.iterator(); - -- while(var10.hasNext()) { -+ while (var10.hasNext()) { - EntityLiving var11 = (EntityLiving)var10.next(); -- if(var11.getLeashed() && var11.getLeashedToEntity() == var0) { -- if(var5 == null) { -- var5 = EntityLeashKnot.func_110129_a(var1, var2, var3, var4); -+ -+ if (var11.getLeashed() && var11.getLeashedToEntity() == par0EntityPlayer) { -+ if (var5 == null) { -+ var5 = EntityLeashKnot.func_110129_a(par1World, par2, par3, par4); - } - - var11.setLeashedToEntity(var5, true); ---- net/minecraft/src/Packet100OpenWindow.java -+++ net/minecraft/src/Packet100OpenWindow.java -@@ -7,56 +7,72 @@ - public class Packet100OpenWindow extends Packet { - public int windowId; - public int inventoryType; -- public String c; -+ public String windowTitle; - public int slotsCount; -+ -+ /** -+ * If false, the client will look up a string like "window.minecart". If true, the client uses what the server -+ * provides. -+ */ - public boolean useProvidedWindowTitle; - public int field_111008_f; - -- public Packet100OpenWindow() { -- } -- -- public Packet100OpenWindow(int var1, int var2, String var3, int var4, boolean var5) { -- this.windowId = var1; -- this.inventoryType = var2; -- this.c = var3; -- this.slotsCount = var4; -- this.useProvidedWindowTitle = var5; -- } -- -- public Packet100OpenWindow(int var1, int var2, String var3, int var4, boolean var5, int var6) { -- this(var1, var2, var3, var4, var5); -- this.field_111008_f = var6; -- } -- -- public void processPacket(NetHandler var1) { -- var1.handleOpenWindow(this); -- } -- -- public void readPacketData(DataInput var1) throws IOException { -- this.windowId = var1.readByte() & 255; -- this.inventoryType = var1.readByte() & 255; -- this.c = readString(var1, 32); -- this.slotsCount = var1.readByte() & 255; -- this.useProvidedWindowTitle = var1.readBoolean(); -- if(this.inventoryType == 11) { -- this.field_111008_f = var1.readInt(); -- } -- -- } -- -- public void writePacketData(DataOutput var1) throws IOException { -- var1.writeByte(this.windowId & 255); -- var1.writeByte(this.inventoryType & 255); -- writeString(this.c, var1); -- var1.writeByte(this.slotsCount & 255); -- var1.writeBoolean(this.useProvidedWindowTitle); -- if(this.inventoryType == 11) { -- var1.writeInt(this.field_111008_f); -- } -- -- } -- -+ public Packet100OpenWindow() {} -+ -+ public Packet100OpenWindow(int par1, int par2, String par3Str, int par4, boolean par5) { -+ this.windowId = par1; -+ this.inventoryType = par2; -+ this.windowTitle = par3Str; -+ this.slotsCount = par4; -+ this.useProvidedWindowTitle = par5; -+ } -+ -+ public Packet100OpenWindow(int par1, int par2, String par3Str, int par4, boolean par5, int par6) { -+ this(par1, par2, par3Str, par4, par5); -+ this.field_111008_f = par6; -+ } -+ -+ /** -+ * Passes this Packet on to the NetHandler for processing. -+ */ -+ public void processPacket(NetHandler par1NetHandler) { -+ par1NetHandler.handleOpenWindow(this); -+ } -+ -+ /** -+ * Abstract. Reads the raw packet data from the data stream. -+ */ -+ public void readPacketData(DataInput par1DataInput) throws IOException { -+ this.windowId = par1DataInput.readByte() & 255; -+ this.inventoryType = par1DataInput.readByte() & 255; -+ this.windowTitle = readString(par1DataInput, 32); -+ this.slotsCount = par1DataInput.readByte() & 255; -+ this.useProvidedWindowTitle = par1DataInput.readBoolean(); -+ -+ if (this.inventoryType == 11) { -+ this.field_111008_f = par1DataInput.readInt(); -+ } -+ } -+ -+ /** -+ * Abstract. Writes the raw packet data to the data stream. -+ */ -+ public void writePacketData(DataOutput par1DataOutput) throws IOException { -+ par1DataOutput.writeByte(this.windowId & 255); -+ par1DataOutput.writeByte(this.inventoryType & 255); -+ writeString(this.windowTitle, par1DataOutput); -+ par1DataOutput.writeByte(this.slotsCount & 255); -+ par1DataOutput.writeBoolean(this.useProvidedWindowTitle); -+ -+ if (this.inventoryType == 11) { -+ par1DataOutput.writeInt(this.field_111008_f); -+ } -+ } -+ -+ /** -+ * Abstract. Return the size of the packet (not counting the header). -+ */ - public int getPacketSize() { -- return this.inventoryType == 11 ? 8 + this.c.length() : 4 + this.c.length(); -+ return this.inventoryType == 11 ? 8 + this.windowTitle.length() : 4 + this.windowTitle.length(); - } - } ---- /dev/null -+++ org/spoutcraft/client/gui/minimap/GuiAdvancedEntitySettings.java -@@ -1,0 +1,108 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.client.gui.minimap; -+ -+import java.util.Collections; -+import java.util.Comparator; -+import java.util.LinkedList; -+import java.util.Map.Entry; -+ -+import net.minecraft.src.Entity; -+ -+import org.spoutcraft.api.gui.Button; -+import org.spoutcraft.api.gui.GenericButton; -+import org.spoutcraft.api.gui.GenericLabel; -+import org.spoutcraft.api.gui.GenericScrollArea; -+import org.spoutcraft.client.SpoutClient; -+import org.spoutcraft.client.gui.GuiSpoutScreen; -+ -+public class GuiAdvancedEntitySettings extends GuiSpoutScreen { -+ GuiMinimapMenu parent = null; -+ GenericScrollArea scroll; -+ GenericButton buttonDone; -+ GenericLabel title; -+ LinkedList checks = new LinkedList(); -+ -+ public GuiAdvancedEntitySettings(GuiMinimapMenu guiMinimapMenu) { -+ parent = guiMinimapMenu; -+ } -+ -+ @Override -+ protected void createInstances() { -+ title = new GenericLabel("Filter Mobs"); -+ buttonDone = new GenericButton("Done"); -+ scroll = new GenericScrollArea(); -+ for (Entry, String> e : WatchedEntity.mobFaceTextures.entrySet()) { -+ EntityVisibilityCheckbox ch = new EntityVisibilityCheckbox(e.getKey(), e.getValue()); -+ scroll.attachWidget("Spoutcraft", ch); -+ checks.add(ch); -+ } -+ Collections.sort(checks, new Comparator() { -+ public int compare(EntityVisibilityCheckbox o1, EntityVisibilityCheckbox o2) { -+ return o1.getText().compareTo(o2.getText()); -+ } -+ }); -+ -+ getScreen().attachWidgets("Spoutcraft", buttonDone, title, scroll); -+ } -+ -+ @Override -+ protected void layoutWidgets() { -+ title.setX(width / 2 - SpoutClient.getHandle().fontRenderer.getStringWidth(title.getText()) / 2); -+ title.setY(10); -+ -+ scroll.setGeometry(0, 25, width, height - 25 - 30); -+ -+ int needed = 315; -+ int top = 5; -+ int i = 0; -+ int left = width / 2 - needed / 2; -+ int center = left + 100 + 5; -+ int right = center + 100 + 5; -+ for (EntityVisibilityCheckbox ch : checks) { -+ ch.setGeometry(0, top, 100, 20); -+ switch(i%3) { -+ case 0: -+ ch.setX(left); -+ break; -+ case 1: -+ ch.setX(center); -+ break; -+ case 2: -+ ch.setX(right); -+ break; -+ } -+ i++; -+ if (i%3==0) { -+ top += 22; -+ } -+ } -+ scroll.updateInnerSize(); -+ -+ buttonDone.setGeometry(width / 2 + 5, height - 25, 150, 20); -+ } -+ -+ @Override -+ protected void buttonClicked(Button btn) { -+ if (btn == buttonDone) { -+ mc.displayGuiScreen(parent); -+ } -+ } -+} ---- net/minecraft/src/CreativeTabs.java -+++ net/minecraft/src/CreativeTabs.java -@@ -2,31 +2,42 @@ - - import java.util.List; - -+import org.spoutcraft.client.gui.inventory.CreativeTabCustom; -+ - public class CreativeTabs { -- public static final CreativeTabs[] creativeTabArray = new CreativeTabs[12]; -+ // Spout Start - Custom item/block tab -+ public static final CreativeTabs[] creativeTabArray = new CreativeTabs[13]; -+ // Spout End - public static final CreativeTabs tabBlock = new CreativeTabCombat(0, "buildingBlocks"); - public static final CreativeTabs tabDecorations = new CreativeTabBlock(1, "decorations"); - public static final CreativeTabs tabRedstone = new CreativeTabDeco(2, "redstone"); - public static final CreativeTabs tabTransport = new CreativeTabRedstone(3, "transportation"); -- public static final CreativeTabs tabMisc = (new CreativeTabTransport(4, "misc")).func_111229_a(new EnumEnchantmentType[]{EnumEnchantmentType.all}); -+ public static final CreativeTabs tabMisc = (new CreativeTabTransport(4, "misc")).func_111229_a(new EnumEnchantmentType[] {EnumEnchantmentType.all}); - public static final CreativeTabs tabAllSearch = (new CreativeTabMisc(5, "search")).setBackgroundImageName("item_search.png"); - public static final CreativeTabs tabFood = new CreativeTabSearch(6, "food"); -- public static final CreativeTabs tabTools = (new CreativeTabFood(7, "tools")).func_111229_a(new EnumEnchantmentType[]{EnumEnchantmentType.digger}); -- public static final CreativeTabs tabCombat = (new CreativeTabTools(8, "combat")).func_111229_a(new EnumEnchantmentType[]{EnumEnchantmentType.armor, EnumEnchantmentType.armor_feet, EnumEnchantmentType.armor_head, EnumEnchantmentType.armor_legs, EnumEnchantmentType.armor_torso, EnumEnchantmentType.bow, EnumEnchantmentType.weapon}); -+ public static final CreativeTabs tabTools = (new CreativeTabFood(7, "tools")).func_111229_a(new EnumEnchantmentType[] {EnumEnchantmentType.digger}); -+ public static final CreativeTabs tabCombat = (new CreativeTabTools(8, "combat")).func_111229_a(new EnumEnchantmentType[] {EnumEnchantmentType.armor, EnumEnchantmentType.armor_feet, EnumEnchantmentType.armor_head, EnumEnchantmentType.armor_legs, EnumEnchantmentType.armor_torso, EnumEnchantmentType.bow, EnumEnchantmentType.weapon}); - public static final CreativeTabs tabBrewing = new CreativeTabBrewing(9, "brewing"); - public static final CreativeTabs tabMaterials = new CreativeTabMaterial(10, "materials"); - public static final CreativeTabs tabInventory = (new CreativeTabInventory(11, "inventory")).setBackgroundImageName("inventory.png").setNoScrollbar().setNoTitle(); -+ // Spout Start - Custom item/block tab -+ public static final CreativeTabs tabSpout = new CreativeTabCustom(12, "custom"); -+ // Spout End - private final int tabIndex; -- private final String o; -- private String p = "items.png"; -+ private final String tabLabel; -+ -+ /** Texture to use. */ -+ private String backgroundImageName = "items.png"; - private boolean hasScrollbar = true; -+ -+ /** Whether to draw the title in the foreground of the creative GUI */ - private boolean drawTitle = true; - private EnumEnchantmentType[] field_111230_s; - -- public CreativeTabs(int var1, String var2) { -- this.tabIndex = var1; -- this.o = var2; -- creativeTabArray[var1] = this; -+ public CreativeTabs(int par1, String par2Str) { -+ this.tabIndex = par1; -+ this.tabLabel = par2Str; -+ creativeTabArray[par1] = this; - } - - public int getTabIndex() { -@@ -34,9 +45,12 @@ - } - - public String getTabLabel() { -- return this.o; -+ return this.tabLabel; - } - -+ /** -+ * Gets the translated Label. -+ */ - public String getTranslatedTabLabel() { - return "itemGroup." + this.getTabLabel(); - } -@@ -45,16 +59,19 @@ - return Item.itemsList[this.getTabIconItemIndex()]; - } - -+ /** -+ * the itemID for the item to be displayed on the tab -+ */ - public int getTabIconItemIndex() { - return 1; - } - - public String getBackgroundImageName() { -- return this.p; -+ return this.backgroundImageName; - } - -- public CreativeTabs setBackgroundImageName(String var1) { -- this.p = var1; -+ public CreativeTabs setBackgroundImageName(String par1Str) { -+ this.backgroundImageName = par1Str; - return this; - } - -@@ -76,33 +93,40 @@ - return this; - } - -+ /** -+ * returns index % 6 -+ */ - public int getTabColumn() { - return this.tabIndex % 6; - } - -+ /** -+ * returns tabIndex < 6 -+ */ - public boolean isTabInFirstRow() { - return this.tabIndex < 6; - } -- -+ - public EnumEnchantmentType[] func_111225_m() { - return this.field_111230_s; - } - -- public CreativeTabs func_111229_a(EnumEnchantmentType... var1) { -- this.field_111230_s = var1; -+ public CreativeTabs func_111229_a(EnumEnchantmentType ... par1ArrayOfEnumEnchantmentType) { -+ this.field_111230_s = par1ArrayOfEnumEnchantmentType; - return this; - } - -- public boolean func_111226_a(EnumEnchantmentType var1) { -- if(this.field_111230_s == null) { -+ public boolean func_111226_a(EnumEnchantmentType par1EnumEnchantmentType) { -+ if (this.field_111230_s == null) { - return false; - } else { - EnumEnchantmentType[] var2 = this.field_111230_s; - int var3 = var2.length; - -- for(int var4 = 0; var4 < var3; ++var4) { -+ for (int var4 = 0; var4 < var3; ++var4) { - EnumEnchantmentType var5 = var2[var4]; -- if(var5 == var1) { -+ -+ if (var5 == par1EnumEnchantmentType) { - return true; - } - } -@@ -111,43 +135,49 @@ - } - } - -- public void displayAllReleventItems(List var1) { -+ /** -+ * only shows items which have tabToDisplayOn == this -+ */ -+ public void displayAllReleventItems(List par1List) { - Item[] var2 = Item.itemsList; - int var3 = var2.length; - -- for(int var4 = 0; var4 < var3; ++var4) { -+ for (int var4 = 0; var4 < var3; ++var4) { - Item var5 = var2[var4]; -- if(var5 != null && var5.getCreativeTab() == this) { -- var5.getSubItems(var5.itemID, this, var1); -+ -+ if (var5 != null && var5.getCreativeTab() == this) { -+ var5.getSubItems(var5.itemID, this, par1List); - } - } - -- if(this.func_111225_m() != null) { -- this.addEnchantmentBooksToList(var1, this.func_111225_m()); -+ if (this.func_111225_m() != null) { -+ this.addEnchantmentBooksToList(par1List, this.func_111225_m()); - } -- - } - -- public void addEnchantmentBooksToList(List var1, EnumEnchantmentType... var2) { -+ /** -+ * Adds the enchantment books from the supplied EnumEnchantmentType to the given list. -+ */ -+ public void addEnchantmentBooksToList(List par1List, EnumEnchantmentType ... par2ArrayOfEnumEnchantmentType) { - Enchantment[] var3 = Enchantment.enchantmentsList; - int var4 = var3.length; - -- for(int var5 = 0; var5 < var4; ++var5) { -+ for (int var5 = 0; var5 < var4; ++var5) { - Enchantment var6 = var3[var5]; -- if(var6 != null && var6.type != null) { -+ -+ if (var6 != null && var6.type != null) { - boolean var7 = false; - -- for(int var8 = 0; var8 < var2.length && !var7; ++var8) { -- if(var6.type == var2[var8]) { -+ for (int var8 = 0; var8 < par2ArrayOfEnumEnchantmentType.length && !var7; ++var8) { -+ if (var6.type == par2ArrayOfEnumEnchantmentType[var8]) { - var7 = true; - } - } - -- if(var7) { -- var1.add(Item.enchantedBook.getEnchantedItemStack(new EnchantmentData(var6, var6.getMaxLevel()))); -+ if (var7) { -+ par1List.add(Item.enchantedBook.getEnchantedItemStack(new EnchantmentData(var6, var6.getMaxLevel()))); - } - } - } -- - } - } ---- net/minecraft/src/Hopper.java -+++ net/minecraft/src/Hopper.java -@@ -1,11 +1,24 @@ - package net.minecraft.src; - - public interface Hopper extends IInventory { -+ -+ /** -+ * Returns the worldObj for this tileEntity. -+ */ - World getWorldObj(); - -+ /** -+ * Gets the world X position for this hopper entity. -+ */ - double getXPos(); - -+ /** -+ * Gets the world Y position for this hopper entity. -+ */ - double getYPos(); - -+ /** -+ * Gets the world Z position for this hopper entity. -+ */ - double getZPos(); - } ---- net/minecraft/src/GuiButtonLanguage.java -+++ net/minecraft/src/GuiButtonLanguage.java -@@ -3,17 +3,21 @@ - import org.lwjgl.opengl.GL11; - - public class GuiButtonLanguage extends GuiButton { -- public GuiButtonLanguage(int var1, int var2, int var3) { -- super(var1, var2, var3, 20, 20, ""); -+ public GuiButtonLanguage(int par1, int par2, int par3) { -+ super(par1, par2, par3, 20, 20, ""); - } - -- public void drawButton(Minecraft var1, int var2, int var3) { -- if(this.drawButton) { -- var1.getTextureManager().bindTexture(GuiButton.buttonTextures); -+ /** -+ * Draws this button to the screen. -+ */ -+ public void drawButton(Minecraft par1Minecraft, int par2, int par3) { -+ if (this.drawButton) { -+ par1Minecraft.getTextureManager().bindTexture(GuiButton.buttonTextures); - GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); -- boolean var4 = var2 >= this.xPosition && var3 >= this.yPosition && var2 < this.xPosition + this.width && var3 < this.yPosition + this.height; -+ boolean var4 = par2 >= this.xPosition && par3 >= this.yPosition && par2 < this.xPosition + this.width && par3 < this.yPosition + this.height; - int var5 = 106; -- if(var4) { -+ -+ if (var4) { - var5 += this.height; - } - ---- net/minecraft/src/CommandSpreadPlayersPosition.java -+++ net/minecraft/src/CommandSpreadPlayersPosition.java -@@ -6,17 +6,16 @@ - double field_111101_a; - double field_111100_b; - -- CommandSpreadPlayersPosition() { -- } -- -- CommandSpreadPlayersPosition(double var1, double var3) { -- this.field_111101_a = var1; -- this.field_111100_b = var3; -- } -- -- double func_111099_a(CommandSpreadPlayersPosition var1) { -- double var2 = this.field_111101_a - var1.field_111101_a; -- double var4 = this.field_111100_b - var1.field_111100_b; -+ CommandSpreadPlayersPosition() {} -+ -+ CommandSpreadPlayersPosition(double par1, double par3) { -+ this.field_111101_a = par1; -+ this.field_111100_b = par3; -+ } -+ -+ double func_111099_a(CommandSpreadPlayersPosition par1CommandSpreadPlayersPosition) { -+ double var2 = this.field_111101_a - par1CommandSpreadPlayersPosition.field_111101_a; -+ double var4 = this.field_111100_b - par1CommandSpreadPlayersPosition.field_111100_b; - return Math.sqrt(var2 * var2 + var4 * var4); - } - -@@ -30,39 +29,41 @@ - return MathHelper.sqrt_double(this.field_111101_a * this.field_111101_a + this.field_111100_b * this.field_111100_b); - } - -- public void func_111094_b(CommandSpreadPlayersPosition var1) { -- this.field_111101_a -= var1.field_111101_a; -- this.field_111100_b -= var1.field_111100_b; -+ public void func_111094_b(CommandSpreadPlayersPosition par1CommandSpreadPlayersPosition) { -+ this.field_111101_a -= par1CommandSpreadPlayersPosition.field_111101_a; -+ this.field_111100_b -= par1CommandSpreadPlayersPosition.field_111100_b; - } - -- public boolean func_111093_a(double var1, double var3, double var5, double var7) { -+ public boolean func_111093_a(double par1, double par3, double par5, double par7) { - boolean var9 = false; -- if(this.field_111101_a < var1) { -- this.field_111101_a = var1; -+ -+ if (this.field_111101_a < par1) { -+ this.field_111101_a = par1; - var9 = true; -- } else if(this.field_111101_a > var5) { -- this.field_111101_a = var5; -+ } else if (this.field_111101_a > par5) { -+ this.field_111101_a = par5; - var9 = true; - } - -- if(this.field_111100_b < var3) { -- this.field_111100_b = var3; -+ if (this.field_111100_b < par3) { -+ this.field_111100_b = par3; - var9 = true; -- } else if(this.field_111100_b > var7) { -- this.field_111100_b = var7; -+ } else if (this.field_111100_b > par7) { -+ this.field_111100_b = par7; - var9 = true; - } - - return var9; - } - -- public int func_111092_a(World var1) { -+ public int func_111092_a(World par1World) { - int var2 = MathHelper.floor_double(this.field_111101_a); - int var3 = MathHelper.floor_double(this.field_111100_b); - -- for(int var4 = 256; var4 > 0; --var4) { -- int var5 = var1.getBlockId(var2, var4, var3); -- if(var5 != 0) { -+ for (int var4 = 256; var4 > 0; --var4) { -+ int var5 = par1World.getBlockId(var2, var4, var3); -+ -+ if (var5 != 0) { - return var4 + 1; - } - } -@@ -70,13 +71,14 @@ - return 257; - } - -- public boolean func_111098_b(World var1) { -+ public boolean func_111098_b(World par1World) { - int var2 = MathHelper.floor_double(this.field_111101_a); - int var3 = MathHelper.floor_double(this.field_111100_b); - -- for(int var4 = 256; var4 > 0; --var4) { -- int var5 = var1.getBlockId(var2, var4, var3); -- if(var5 != 0) { -+ for (int var4 = 256; var4 > 0; --var4) { -+ int var5 = par1World.getBlockId(var2, var4, var3); -+ -+ if (var5 != 0) { - Material var6 = Block.blocksList[var5].blockMaterial; - return !var6.isLiquid() && var6 != Material.fire; - } -@@ -85,8 +87,8 @@ - return false; - } - -- public void func_111097_a(Random var1, double var2, double var4, double var6, double var8) { -- this.field_111101_a = MathHelper.getRandomDoubleInRange(var1, var2, var6); -- this.field_111100_b = MathHelper.getRandomDoubleInRange(var1, var4, var8); -+ public void func_111097_a(Random par1Random, double par2, double par4, double par6, double par8) { -+ this.field_111101_a = MathHelper.getRandomDoubleInRange(par1Random, par2, par6); -+ this.field_111100_b = MathHelper.getRandomDoubleInRange(par1Random, par4, par8); - } - } ---- net/minecraft/src/BlockPistonMoving.java -+++ net/minecraft/src/BlockPistonMoving.java -@@ -3,142 +3,195 @@ - import java.util.Random; - - public class BlockPistonMoving extends BlockContainer { -- public BlockPistonMoving(int var1) { -- super(var1, Material.piston); -+ public BlockPistonMoving(int par1) { -+ super(par1, Material.piston); - this.setHardness(-1.0F); - } - -- public TileEntity createNewTileEntity(World var1) { -+ /** -+ * Returns a new instance of a block's tile entity class. Called on placing the block. -+ */ -+ public TileEntity createNewTileEntity(World par1World) { - return null; - } - -- public void onBlockAdded(World var1, int var2, int var3, int var4) { -- } -- -- public void breakBlock(World var1, int var2, int var3, int var4, int var5, int var6) { -- TileEntity var7 = var1.getBlockTileEntity(var2, var3, var4); -- if(var7 instanceof TileEntityPiston) { -+ /** -+ * Called whenever the block is added into the world. Args: world, x, y, z -+ */ -+ public void onBlockAdded(World par1World, int par2, int par3, int par4) {} -+ -+ /** -+ * Called on server worlds only when the block has been replaced by a different block ID, or the same block with a -+ * different metadata value, but before the new metadata value is set. Args: World, x, y, z, old block ID, old metadata -+ */ -+ public void breakBlock(World par1World, int par2, int par3, int par4, int par5, int par6) { -+ TileEntity var7 = par1World.getBlockTileEntity(par2, par3, par4); -+ -+ if (var7 instanceof TileEntityPiston) { - ((TileEntityPiston)var7).clearPistonTileEntity(); - } else { -- super.breakBlock(var1, var2, var3, var4, var5, var6); -+ super.breakBlock(par1World, par2, par3, par4, par5, par6); - } -- -- } -- -- public boolean canPlaceBlockAt(World var1, int var2, int var3, int var4) { -- return false; -- } -- -- public boolean canPlaceBlockOnSide(World var1, int var2, int var3, int var4, int var5) { -- return false; -- } -- -+ } -+ -+ /** -+ * Checks to see if its valid to put this block at the specified coordinates. Args: world, x, y, z -+ */ -+ public boolean canPlaceBlockAt(World par1World, int par2, int par3, int par4) { -+ return false; -+ } -+ -+ /** -+ * checks to see if you can place this block can be placed on that side of a block: BlockLever overrides -+ */ -+ public boolean canPlaceBlockOnSide(World par1World, int par2, int par3, int par4, int par5) { -+ return false; -+ } -+ -+ /** -+ * The type of render function that is called for this block -+ */ - public int getRenderType() { - return -1; - } - -+ /** -+ * Is this block (a) opaque and (b) a full 1m cube? This determines whether or not to render the shared face of two -+ * adjacent blocks and also whether the player can attach torches, redstone wire, etc to this block. -+ */ - public boolean isOpaqueCube() { - return false; - } - -+ /** -+ * If this block doesn't render as an ordinary block it will return False (examples: signs, buttons, stairs, etc) -+ */ - public boolean renderAsNormalBlock() { - return false; - } - -- public boolean onBlockActivated(World var1, int var2, int var3, int var4, EntityPlayer var5, int var6, float var7, float var8, float var9) { -- if(!var1.isRemote && var1.getBlockTileEntity(var2, var3, var4) == null) { -- var1.setBlockToAir(var2, var3, var4); -+ /** -+ * Called upon block activation (right click on the block.) -+ */ -+ public boolean onBlockActivated(World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer, int par6, float par7, float par8, float par9) { -+ if (!par1World.isRemote && par1World.getBlockTileEntity(par2, par3, par4) == null) { -+ par1World.setBlockToAir(par2, par3, par4); - return true; - } else { - return false; - } - } - -- public int idDropped(int var1, Random var2, int var3) { -+ /** -+ * Returns the ID of the items to drop on destruction. -+ */ -+ public int idDropped(int par1, Random par2Random, int par3) { - return 0; - } - -- public void dropBlockAsItemWithChance(World var1, int var2, int var3, int var4, int var5, float var6, int var7) { -- if(!var1.isRemote) { -- TileEntityPiston var8 = this.getTileEntityAtLocation(var1, var2, var3, var4); -- if(var8 != null) { -- Block.blocksList[var8.getStoredBlockID()].dropBlockAsItem(var1, var2, var3, var4, var8.getBlockMetadata(), 0); -+ /** -+ * Drops the block items with a specified chance of dropping the specified items -+ */ -+ public void dropBlockAsItemWithChance(World par1World, int par2, int par3, int par4, int par5, float par6, int par7) { -+ if (!par1World.isRemote) { -+ TileEntityPiston var8 = this.getTileEntityAtLocation(par1World, par2, par3, par4); -+ -+ if (var8 != null) { -+ Block.blocksList[var8.getStoredBlockID()].dropBlockAsItem(par1World, par2, par3, par4, var8.getBlockMetadata(), 0); - } - } - } - -- public void onNeighborBlockChange(World var1, int var2, int var3, int var4, int var5) { -- if(!var1.isRemote) { -- var1.getBlockTileEntity(var2, var3, var4); -+ /** -+ * Lets the block know when one of its neighbor changes. Doesn't know which neighbor changed (coordinates passed are -+ * their own) Args: x, y, z, neighbor blockID -+ */ -+ public void onNeighborBlockChange(World par1World, int par2, int par3, int par4, int par5) { -+ if (!par1World.isRemote) { -+ par1World.getBlockTileEntity(par2, par3, par4); - } -- -- } -- -- public static TileEntity getTileEntity(int var0, int var1, int var2, boolean var3, boolean var4) { -- return new TileEntityPiston(var0, var1, var2, var3, var4); -- } -- -- public AxisAlignedBB getCollisionBoundingBoxFromPool(World var1, int var2, int var3, int var4) { -- TileEntityPiston var5 = this.getTileEntityAtLocation(var1, var2, var3, var4); -- if(var5 == null) { -+ } -+ -+ /** -+ * gets a new TileEntityPiston created with the arguments provided. -+ */ -+ public static TileEntity getTileEntity(int par0, int par1, int par2, boolean par3, boolean par4) { -+ return new TileEntityPiston(par0, par1, par2, par3, par4); -+ } -+ -+ /** -+ * Returns a bounding box from the pool of bounding boxes (this means this box can change after the pool has been -+ * cleared to be reused) -+ */ -+ public AxisAlignedBB getCollisionBoundingBoxFromPool(World par1World, int par2, int par3, int par4) { -+ TileEntityPiston var5 = this.getTileEntityAtLocation(par1World, par2, par3, par4); -+ -+ if (var5 == null) { - return null; - } else { - float var6 = var5.getProgress(0.0F); -- if(var5.isExtending()) { -+ -+ if (var5.isExtending()) { - var6 = 1.0F - var6; - } - -- return this.getAxisAlignedBB(var1, var2, var3, var4, var5.getStoredBlockID(), var6, var5.getPistonOrientation()); -+ return this.getAxisAlignedBB(par1World, par2, par3, par4, var5.getStoredBlockID(), var6, var5.getPistonOrientation()); - } - } - -- public void setBlockBoundsBasedOnState(IBlockAccess var1, int var2, int var3, int var4) { -- TileEntityPiston var5 = this.getTileEntityAtLocation(var1, var2, var3, var4); -- if(var5 != null) { -+ /** -+ * Updates the blocks bounds based on its current state. Args: world, x, y, z -+ */ -+ public void setBlockBoundsBasedOnState(IBlockAccess par1IBlockAccess, int par2, int par3, int par4) { -+ TileEntityPiston var5 = this.getTileEntityAtLocation(par1IBlockAccess, par2, par3, par4); -+ -+ if (var5 != null) { - Block var6 = Block.blocksList[var5.getStoredBlockID()]; -- if(var6 == null || var6 == this) { -+ -+ if (var6 == null || var6 == this) { - return; - } - -- var6.setBlockBoundsBasedOnState(var1, var2, var3, var4); -+ var6.setBlockBoundsBasedOnState(par1IBlockAccess, par2, par3, par4); - float var7 = var5.getProgress(0.0F); -- if(var5.isExtending()) { -+ -+ if (var5.isExtending()) { - var7 = 1.0F - var7; - } - - int var8 = var5.getPistonOrientation(); -- this.minX = var6.getMinX() - (double)((float)Facing.offsetsXForSide[var8] * var7); -+ this.minX = var6.getBlockBoundsMinX() - (double)((float)Facing.offsetsXForSide[var8] * var7); - this.minY = var6.getBlockBoundsMinY() - (double)((float)Facing.offsetsYForSide[var8] * var7); - this.minZ = var6.getBlockBoundsMinZ() - (double)((float)Facing.offsetsZForSide[var8] * var7); - this.maxX = var6.getBlockBoundsMaxX() - (double)((float)Facing.offsetsXForSide[var8] * var7); - this.maxY = var6.getBlockBoundsMaxY() - (double)((float)Facing.offsetsYForSide[var8] * var7); - this.maxZ = var6.getBlockBoundsMaxZ() - (double)((float)Facing.offsetsZForSide[var8] * var7); - } -- - } - -- public AxisAlignedBB getAxisAlignedBB(World var1, int var2, int var3, int var4, int var5, float var6, int var7) { -- if(var5 != 0 && var5 != this.blockID) { -- AxisAlignedBB var8 = Block.blocksList[var5].getCollisionBoundingBoxFromPool(var1, var2, var3, var4); -- if(var8 == null) { -+ public AxisAlignedBB getAxisAlignedBB(World par1World, int par2, int par3, int par4, int par5, float par6, int par7) { -+ if (par5 != 0 && par5 != this.blockID) { -+ AxisAlignedBB var8 = Block.blocksList[par5].getCollisionBoundingBoxFromPool(par1World, par2, par3, par4); -+ -+ if (var8 == null) { - return null; - } else { -- if(Facing.offsetsXForSide[var7] < 0) { -- var8.minX -= (double)((float)Facing.offsetsXForSide[var7] * var6); -- } else { -- var8.maxX -= (double)((float)Facing.offsetsXForSide[var7] * var6); -- } -- -- if(Facing.offsetsYForSide[var7] < 0) { -- var8.minY -= (double)((float)Facing.offsetsYForSide[var7] * var6); -- } else { -- var8.maxY -= (double)((float)Facing.offsetsYForSide[var7] * var6); -- } -- -- if(Facing.offsetsZForSide[var7] < 0) { -- var8.minZ -= (double)((float)Facing.offsetsZForSide[var7] * var6); -- } else { -- var8.maxZ -= (double)((float)Facing.offsetsZForSide[var7] * var6); -+ if (Facing.offsetsXForSide[par7] < 0) { -+ var8.minX -= (double)((float)Facing.offsetsXForSide[par7] * par6); -+ } else { -+ var8.maxX -= (double)((float)Facing.offsetsXForSide[par7] * par6); -+ } -+ -+ if (Facing.offsetsYForSide[par7] < 0) { -+ var8.minY -= (double)((float)Facing.offsetsYForSide[par7] * par6); -+ } else { -+ var8.maxY -= (double)((float)Facing.offsetsYForSide[par7] * par6); -+ } -+ -+ if (Facing.offsetsZForSide[par7] < 0) { -+ var8.minZ -= (double)((float)Facing.offsetsZForSide[par7] * par6); -+ } else { -+ var8.maxZ -= (double)((float)Facing.offsetsZForSide[par7] * par6); - } - - return var8; -@@ -148,16 +201,26 @@ - } - } - -- private TileEntityPiston getTileEntityAtLocation(IBlockAccess var1, int var2, int var3, int var4) { -- TileEntity var5 = var1.getBlockTileEntity(var2, var3, var4); -+ /** -+ * gets the piston tile entity at the specified location -+ */ -+ private TileEntityPiston getTileEntityAtLocation(IBlockAccess par1IBlockAccess, int par2, int par3, int par4) { -+ TileEntity var5 = par1IBlockAccess.getBlockTileEntity(par2, par3, par4); - return var5 instanceof TileEntityPiston ? (TileEntityPiston)var5 : null; - } - -- public int idPicked(World var1, int var2, int var3, int var4) { -+ /** -+ * only called by clickMiddleMouseButton , and passed to inventory.setCurrentItem (along with isCreative) -+ */ -+ public int idPicked(World par1World, int par2, int par3, int par4) { - return 0; - } - -- public void registerIcons(IconRegister var1) { -- this.blockIcon = var1.registerIcon("piston_top_normal"); -+ /** -+ * When this method is called, your block should register all the icons it needs with the given IconRegister. This is -+ * the only chance you get to register icons. -+ */ -+ public void registerIcons(IconRegister par1IconRegister) { -+ this.blockIcon = par1IconRegister.registerIcon("piston_top_normal"); - } - } ---- net/minecraft/src/EnumSkyBlock.java -+++ net/minecraft/src/EnumSkyBlock.java -@@ -3,10 +3,9 @@ - public enum EnumSkyBlock { - Sky(15), - Block(0); -- - public final int defaultLightValue; - -- private EnumSkyBlock(int var3) { -- this.defaultLightValue = var3; -+ private EnumSkyBlock(int par3) { -+ this.defaultLightValue = par3; - } - } ---- net/minecraft/src/GuiSlotStatsGeneral.java -+++ net/minecraft/src/GuiSlotStatsGeneral.java -@@ -3,23 +3,34 @@ - class GuiSlotStatsGeneral extends GuiSlot { - final GuiStats statsGui; - -- public GuiSlotStatsGeneral(GuiStats var1) { -- super(GuiStats.getMinecraft(var1), var1.width, var1.height, 32, var1.height - 64, 10); -- this.statsGui = var1; -+ public GuiSlotStatsGeneral(GuiStats par1GuiStats) { -+ super(GuiStats.getMinecraft(par1GuiStats), par1GuiStats.width, par1GuiStats.height, 32, par1GuiStats.height - 64, 10); -+ this.statsGui = par1GuiStats; - this.setShowSelectionBox(false); - } - -+ /** -+ * Gets the size of the current slot list. -+ */ - protected int getSize() { -- return StatList.c.size(); -- } -- -- protected void elementClicked(int var1, boolean var2) { -- } -- -- protected boolean isSelected(int var1) { -+ return StatList.generalStats.size(); -+ } -+ -+ /** -+ * the element in the slot that was clicked, boolean for wether it was double clicked or not -+ */ -+ protected void elementClicked(int par1, boolean par2) {} -+ -+ /** -+ * returns true if the element passed in is currently selected -+ */ -+ protected boolean isSelected(int par1) { - return false; - } - -+ /** -+ * return the height of the content being scrolled -+ */ - protected int getContentHeight() { - return this.getSize() * 10; - } -@@ -28,10 +39,10 @@ - this.statsGui.drawDefaultBackground(); - } - -- protected void drawSlot(int var1, int var2, int var3, int var4, Tessellator var5) { -- StatBase var6 = (StatBase)StatList.c.get(var1); -- this.statsGui.drawString(GuiStats.getFontRenderer1(this.statsGui), I18n.getString(var6.getName()), var2 + 2, var3 + 1, var1 % 2 == 0 ? 16777215 : 9474192); -+ protected void drawSlot(int par1, int par2, int par3, int par4, Tessellator par5Tessellator) { -+ StatBase var6 = (StatBase)StatList.generalStats.get(par1); -+ this.statsGui.drawString(GuiStats.getFontRenderer1(this.statsGui), I18n.getString(var6.getName()), par2 + 2, par3 + 1, par1 % 2 == 0 ? 16777215 : 9474192); - String var7 = var6.func_75968_a(GuiStats.getStatsFileWriter(this.statsGui).writeStat(var6)); -- this.statsGui.drawString(GuiStats.getFontRenderer2(this.statsGui), var7, var2 + 2 + 213 - GuiStats.getFontRenderer3(this.statsGui).getStringWidth(var7), var3 + 1, var1 % 2 == 0 ? 16777215 : 9474192); -+ this.statsGui.drawString(GuiStats.getFontRenderer2(this.statsGui), var7, par2 + 2 + 213 - GuiStats.getFontRenderer3(this.statsGui).getStringWidth(var7), par3 + 1, par1 % 2 == 0 ? 16777215 : 9474192); - } - } ---- net/minecraft/src/EntityAIOwnerHurtTarget.java -+++ net/minecraft/src/EntityAIOwnerHurtTarget.java -@@ -5,18 +5,22 @@ - EntityLivingBase theTarget; - private int field_142050_e; - -- public EntityAIOwnerHurtTarget(EntityTameable var1) { -- super(var1, false); -- this.theEntityTameable = var1; -+ public EntityAIOwnerHurtTarget(EntityTameable par1EntityTameable) { -+ super(par1EntityTameable, false); -+ this.theEntityTameable = par1EntityTameable; - this.setMutexBits(1); - } - -+ /** -+ * Returns whether the EntityAIBase should begin execution. -+ */ - public boolean shouldExecute() { -- if(!this.theEntityTameable.isTamed()) { -+ if (!this.theEntityTameable.isTamed()) { - return false; - } else { - EntityLivingBase var1 = this.theEntityTameable.func_130012_q(); -- if(var1 == null) { -+ -+ if (var1 == null) { - return false; - } else { - this.theTarget = var1.getLastAttacker(); -@@ -26,10 +30,14 @@ - } - } - -+ /** -+ * Execute a one shot task or start executing a continuous task -+ */ - public void startExecuting() { - this.taskOwner.setAttackTarget(this.theTarget); - EntityLivingBase var1 = this.theEntityTameable.func_130012_q(); -- if(var1 != null) { -+ -+ if (var1 != null) { - this.field_142050_e = var1.getLastAttackerTime(); - } - ---- /dev/null -+++ org/spoutcraft/client/player/ClientPlayer.java -@@ -1,0 +1,254 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.client.player; -+ -+import org.lwjgl.input.Keyboard; -+ -+import net.minecraft.src.ChunkCoordinates; -+import net.minecraft.src.EntityPlayerSP; -+ -+import org.spoutcraft.api.GameMode; -+import org.spoutcraft.api.gui.InGameHUD; -+import org.spoutcraft.api.gui.Screen; -+import org.spoutcraft.api.inventory.ItemStack; -+import org.spoutcraft.api.player.RenderDistance; -+import org.spoutcraft.api.util.FixedLocation; -+import org.spoutcraft.api.util.Location; -+import org.spoutcraft.api.util.MutableLocation; -+import org.spoutcraft.client.SpoutClient; -+import org.spoutcraft.client.gui.InGameScreen; -+ -+public class ClientPlayer extends SpoutPlayer { -+ private static ClientPlayer instance = null; -+ private RenderDistance min, max; -+ private InGameScreen mainScreen = new InGameScreen(); -+ -+ public static ClientPlayer getInstance() { -+ if (instance == null) { -+ instance = new ClientPlayer(SpoutClient.getHandle().thePlayer); -+ instance.setPlayer(SpoutClient.getHandle().thePlayer); -+ SpoutClient.getInstance().player = (ClientPlayer) instance; -+ } -+ return instance; -+ } -+ -+ private ClientPlayer(EntityPlayerSP entity) { -+ super(entity); -+ min = RenderDistance.TINY; -+ max = RenderDistance.FAR; -+ } -+ -+ public EntityPlayerSP getHandle() { -+ return (EntityPlayerSP)super.getMCPlayer(); -+ } -+ -+ public RenderDistance getMaximumView() { -+ return max; -+ } -+ -+ public RenderDistance getMinimumView() { -+ return min; -+ } -+ -+ public void setMaximumView(RenderDistance distance) { -+ max = distance; -+ } -+ -+ public void setMinimumView(RenderDistance distance) { -+ min = distance; -+ } -+ -+ public RenderDistance getCurrentView() { -+ return RenderDistance.getRenderDistanceFromValue(SpoutClient.getHandle().gameSettings.renderDistance); -+ } -+ -+ public void setCurrentView(RenderDistance view) { -+ SpoutClient.getHandle().gameSettings.renderDistance = view.getValue(); -+ } -+ -+ public RenderDistance getNextRenderDistance() { -+ int next = getCurrentView().getValue() + (Keyboard.isKeyDown(Keyboard.KEY_LSHIFT) ? -1 : 1); -+ if (next > min.getValue()) { -+ next = max.getValue(); -+ } else if (next < max.getValue()) { -+ next = min.getValue(); -+ } -+ return RenderDistance.getRenderDistanceFromValue(next); -+ } -+ -+ public InGameHUD getMainScreen() { -+ return mainScreen; -+ } -+ -+ public void resetMainScreen() { -+ mainScreen = new InGameScreen(); -+ } -+ -+ public void showAchievement(String title, String message, int id) { -+ SpoutClient.getHandle().guiAchievement.queueNotification(title, message, id); -+ } -+ -+ public void showAchievement(String title, String message, int id, int data, int time) { -+ SpoutClient.getHandle().guiAchievement.queueNotification(title, message, id, (short) data, time); -+ } -+ -+ public FixedLocation getLastClickedLocation() { -+ return getHandle().lastClickLocation; -+ } -+ -+ public void sendMessage(String msg) { -+ SpoutClient.getHandle().ingameGUI.getChatGUI().printChatMessage(msg); -+ } -+ -+ public void setCompassTarget(Location loc) { -+ SpoutClient.getHandle().thePlayer.setSpawnChunk(new ChunkCoordinates(loc.getBlockX(), loc.getBlockY(), loc.getBlockZ()), true); -+ SpoutClient.getHandle().theWorld.getWorldInfo().setSpawnPosition(loc.getBlockX(), loc.getBlockY(), loc.getBlockZ()); -+ } -+ -+ public Location getCompassTarget() { -+ ChunkCoordinates coords = SpoutClient.getHandle().thePlayer.getBedLocation(); -+ return new MutableLocation(coords.posX, coords.posY, coords.posZ); -+ } -+ -+ public void sendRawMessage(String message) { -+ SpoutClient.getHandle().thePlayer.sendChatMessage(message); -+ } -+ -+ public void disconnect(String message) { -+ SpoutClient.getHandle().theWorld.sendQuittingDisconnectingPacket(); -+ SpoutClient.getHandle().loadWorld(null); -+ } -+ -+ public void chat(String msg) { -+ } -+ -+ public boolean performCommand(String command) { -+ // TODO Auto-generated method stub -+ return false; -+ } -+ -+ public boolean isSprinting() { -+ return SpoutClient.getHandle().thePlayer.isSprinting(); -+ } -+ -+ public void setSprinting(boolean sprinting) { -+ SpoutClient.getHandle().thePlayer.setSprinting(sprinting); -+ } -+ -+ public int getExperience() { -+ // TODO Auto-generated method stub -+ return 0; -+ } -+ -+ public void setExperience(int exp) { -+ // TODO Auto-generated method stub -+ -+ } -+ -+ public int getLevel() { -+ // TODO Auto-generated method stub -+ return 0; -+ } -+ -+ public void setLevel(int level) { -+ // TODO Auto-generated method stub -+ -+ } -+ -+ public int getTotalExperience() { -+ // TODO Auto-generated method stub -+ return 0; -+ } -+ -+ public void setTotalExperience(int exp) { -+ // TODO Auto-generated method stub -+ -+ } -+ -+ public float getExhaustion() { -+ // TODO Auto-generated method stub -+ return 0; -+ } -+ -+ public void setExhaustion(float value) { -+ // TODO Auto-generated method stub -+ -+ } -+ -+ public float getSaturation() { -+ // TODO Auto-generated method stub -+ return 0; -+ } -+ -+ public void setSaturation(float value) { -+ // TODO Auto-generated method stub -+ -+ } -+ -+ public int getFoodLevel() { -+ // TODO Auto-generated method stub -+ return 0; -+ } -+ -+ public void setFoodLevel(int value) { -+ // TODO Auto-generated method stub -+ -+ } -+ -+ public GameMode getGameMode() { -+ // TODO Auto-generated method stub -+ return null; -+ } -+ -+ public void setGameMode(GameMode mode) { -+ // TODO Auto-generated method stub -+ -+ } -+ -+ public Screen getCurrentScreen() { -+ if (SpoutClient.getHandle().currentScreen == null) { -+ return getMainScreen(); -+ } -+ return SpoutClient.getHandle().currentScreen.getScreen(); -+ } -+ -+ public ItemStack getItemStackOnCursor() { -+ ItemStack ret = new ItemStack(0); -+ if (SpoutClient.getHandle().thePlayer != null) { -+ net.minecraft.src.ItemStack mcStack = SpoutClient.getHandle().thePlayer.inventory.getItemStack(); -+ if (mcStack != null) { -+ ret = new ItemStack(mcStack.itemID, mcStack.stackSize, (short) mcStack.getItemDamage()); -+ } -+ } -+ return ret; -+ } -+ -+ public void setItemStackOnCursor(ItemStack stack) { -+ if (SpoutClient.getHandle().thePlayer == null) { -+ return; -+ } -+ if (stack == null || stack.getTypeId() == 0) { -+ SpoutClient.getHandle().thePlayer.inventory.setItemStack(null); -+ } else { -+ net.minecraft.src.ItemStack mcStack = new net.minecraft.src.ItemStack(stack.getTypeId(), stack.getAmount(), stack.getDurability()); -+ SpoutClient.getHandle().thePlayer.inventory.setItemStack(mcStack); -+ } -+ } -+} ---- net/minecraft/src/BlockBeacon.java -+++ net/minecraft/src/BlockBeacon.java -@@ -1,50 +1,74 @@ - package net.minecraft.src; - - public class BlockBeacon extends BlockContainer { -- public BlockBeacon(int var1) { -- super(var1, Material.glass); -+ public BlockBeacon(int par1) { -+ super(par1, Material.glass); - this.setHardness(3.0F); - this.setCreativeTab(CreativeTabs.tabMisc); - } - -- public TileEntity createNewTileEntity(World var1) { -+ /** -+ * Returns a new instance of a block's tile entity class. Called on placing the block. -+ */ -+ public TileEntity createNewTileEntity(World par1World) { - return new TileEntityBeacon(); - } - -- public boolean onBlockActivated(World var1, int var2, int var3, int var4, EntityPlayer var5, int var6, float var7, float var8, float var9) { -- if(var1.isRemote) { -+ /** -+ * Called upon block activation (right click on the block.) -+ */ -+ public boolean onBlockActivated(World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer, int par6, float par7, float par8, float par9) { -+ if (par1World.isRemote) { - return true; - } else { -- TileEntityBeacon var10 = (TileEntityBeacon)var1.getBlockTileEntity(var2, var3, var4); -- if(var10 != null) { -- var5.displayGUIBeacon(var10); -+ TileEntityBeacon var10 = (TileEntityBeacon)par1World.getBlockTileEntity(par2, par3, par4); -+ -+ if (var10 != null) { -+ par5EntityPlayer.displayGUIBeacon(var10); - } - - return true; - } - } - -+ /** -+ * Is this block (a) opaque and (b) a full 1m cube? This determines whether or not to render the shared face of two -+ * adjacent blocks and also whether the player can attach torches, redstone wire, etc to this block. -+ */ - public boolean isOpaqueCube() { - return false; - } - -+ /** -+ * If this block doesn't render as an ordinary block it will return False (examples: signs, buttons, stairs, etc) -+ */ - public boolean renderAsNormalBlock() { - return false; - } - -+ /** -+ * The type of render function that is called for this block -+ */ - public int getRenderType() { - return 34; - } - -- public void registerIcons(IconRegister var1) { -- super.registerIcons(var1); -+ /** -+ * When this method is called, your block should register all the icons it needs with the given IconRegister. This is -+ * the only chance you get to register icons. -+ */ -+ public void registerIcons(IconRegister par1IconRegister) { -+ super.registerIcons(par1IconRegister); - } - -- public void onBlockPlacedBy(World var1, int var2, int var3, int var4, EntityLivingBase var5, ItemStack var6) { -- super.onBlockPlacedBy(var1, var2, var3, var4, var5, var6); -- if(var6.hasDisplayName()) { -- ((TileEntityBeacon)var1.getBlockTileEntity(var2, var3, var4)).func_94047_a(var6.getDisplayName()); -+ /** -+ * Called when the block is placed in the world. -+ */ -+ public void onBlockPlacedBy(World par1World, int par2, int par3, int par4, EntityLivingBase par5EntityLivingBase, ItemStack par6ItemStack) { -+ super.onBlockPlacedBy(par1World, par2, par3, par4, par5EntityLivingBase, par6ItemStack); -+ -+ if (par6ItemStack.hasDisplayName()) { -+ ((TileEntityBeacon)par1World.getBlockTileEntity(par2, par3, par4)).func_94047_a(par6ItemStack.getDisplayName()); - } -- - } - } ---- net/minecraft/src/CallableUpdatingScreenName.java -+++ net/minecraft/src/CallableUpdatingScreenName.java -@@ -5,8 +5,8 @@ - class CallableUpdatingScreenName implements Callable { - final Minecraft theMinecraft; - -- CallableUpdatingScreenName(Minecraft var1) { -- this.theMinecraft = var1; -+ CallableUpdatingScreenName(Minecraft par1Minecraft) { -+ this.theMinecraft = par1Minecraft; - } - - public String callUpdatingScreenName() { ---- net/minecraft/src/RenderZombie.java -+++ net/minecraft/src/RenderZombie.java -@@ -4,8 +4,8 @@ - private static final ResourceLocation zombiePigmanTextures = new ResourceLocation("textures/entity/zombie_pigman.png"); - private static final ResourceLocation zombieTextures = new ResourceLocation("textures/entity/zombie/zombie.png"); - private static final ResourceLocation zombieVillagerTextures = new ResourceLocation("textures/entity/zombie/zombie_villager.png"); -- private ModelBiped field_82434_o = this.modelBipedMain; -- private ModelZombieVillager zombieVillagerModel = new ModelZombieVillager(); -+ private ModelBiped field_82434_o; -+ private ModelZombieVillager zombieVillagerModel; - protected ModelBiped field_82437_k; - protected ModelBiped field_82435_l; - protected ModelBiped field_82436_m; -@@ -14,6 +14,8 @@ - - public RenderZombie() { - super(new ModelZombie(), 0.5F, 1.0F); -+ this.field_82434_o = this.modelBipedMain; -+ this.zombieVillagerModel = new ModelZombieVillager(); - } - - protected void func_82421_b() { -@@ -25,28 +27,28 @@ - this.field_82433_n = new ModelZombieVillager(0.5F, 0.0F, true); - } - -- protected int func_82429_a(EntityZombie var1, int var2, float var3) { -- this.func_82427_a(var1); -- return super.func_130006_a(var1, var2, var3); -- } -- -- public void func_82426_a(EntityZombie var1, double var2, double var4, double var6, float var8, float var9) { -- this.func_82427_a(var1); -- super.doRenderLiving(var1, var2, var4, var6, var8, var9); -- } -- -- protected ResourceLocation func_110863_a(EntityZombie var1) { -- return var1 instanceof EntityPigZombie ? zombiePigmanTextures : (var1.isVillager() ? zombieVillagerTextures : zombieTextures); -- } -- -- protected void func_82428_a(EntityZombie var1, float var2) { -- this.func_82427_a(var1); -- super.func_130005_c(var1, var2); -- } -- -- private void func_82427_a(EntityZombie var1) { -- if(var1.isVillager()) { -- if(this.field_82431_q != this.zombieVillagerModel.func_82897_a()) { -+ protected int func_82429_a(EntityZombie par1EntityZombie, int par2, float par3) { -+ this.func_82427_a(par1EntityZombie); -+ return super.func_130006_a(par1EntityZombie, par2, par3); -+ } -+ -+ public void func_82426_a(EntityZombie par1EntityZombie, double par2, double par4, double par6, float par8, float par9) { -+ this.func_82427_a(par1EntityZombie); -+ super.doRenderLiving(par1EntityZombie, par2, par4, par6, par8, par9); -+ } -+ -+ protected ResourceLocation func_110863_a(EntityZombie par1EntityZombie) { -+ return par1EntityZombie instanceof EntityPigZombie ? zombiePigmanTextures : (par1EntityZombie.isVillager() ? zombieVillagerTextures : zombieTextures); -+ } -+ -+ protected void func_82428_a(EntityZombie par1EntityZombie, float par2) { -+ this.func_82427_a(par1EntityZombie); -+ super.func_130005_c(par1EntityZombie, par2); -+ } -+ -+ private void func_82427_a(EntityZombie par1EntityZombie) { -+ if (par1EntityZombie.isVillager()) { -+ if (this.field_82431_q != this.zombieVillagerModel.func_82897_a()) { - this.zombieVillagerModel = new ModelZombieVillager(); - this.field_82431_q = this.zombieVillagerModel.func_82897_a(); - this.field_82436_m = new ModelZombieVillager(1.0F, 0.0F, true); -@@ -65,51 +67,63 @@ - this.modelBipedMain = (ModelBiped)this.mainModel; - } - -- protected void func_82430_a(EntityZombie var1, float var2, float var3, float var4) { -- if(var1.isConverting()) { -- var3 += (float)(Math.cos((double)var1.ticksExisted * 3.25D) * Math.PI * 0.25D); -+ protected void func_82430_a(EntityZombie par1EntityZombie, float par2, float par3, float par4) { -+ if (par1EntityZombie.isConverting()) { -+ par3 += (float)(Math.cos((double)par1EntityZombie.ticksExisted * 3.25D) * Math.PI * 0.25D); - } - -- super.rotateCorpse(var1, var2, var3, var4); -- } -- -- protected void func_130005_c(EntityLiving var1, float var2) { -- this.func_82428_a((EntityZombie)var1, var2); -- } -- -- protected ResourceLocation func_110856_a(EntityLiving var1) { -- return this.func_110863_a((EntityZombie)var1); -- } -- -- public void doRenderLiving(EntityLiving var1, double var2, double var4, double var6, float var8, float var9) { -- this.func_82426_a((EntityZombie)var1, var2, var4, var6, var8, var9); -- } -- -- protected int func_130006_a(EntityLiving var1, int var2, float var3) { -- return this.func_82429_a((EntityZombie)var1, var2, var3); -- } -- -- protected int shouldRenderPass(EntityLivingBase var1, int var2, float var3) { -- return this.func_82429_a((EntityZombie)var1, var2, var3); -- } -- -- protected void renderEquippedItems(EntityLivingBase var1, float var2) { -- this.func_82428_a((EntityZombie)var1, var2); -- } -- -- protected void rotateCorpse(EntityLivingBase var1, float var2, float var3, float var4) { -- this.func_82430_a((EntityZombie)var1, var2, var3, var4); -- } -- -- public void renderPlayer(EntityLivingBase var1, double var2, double var4, double var6, float var8, float var9) { -- this.func_82426_a((EntityZombie)var1, var2, var4, var6, var8, var9); -- } -- -- protected ResourceLocation getEntityTexture(Entity var1) { -- return this.func_110863_a((EntityZombie)var1); -- } -- -- public void doRender(Entity var1, double var2, double var4, double var6, float var8, float var9) { -- this.func_82426_a((EntityZombie)var1, var2, var4, var6, var8, var9); -+ super.rotateCorpse(par1EntityZombie, par2, par3, par4); -+ } -+ -+ protected void func_130005_c(EntityLiving par1EntityLiving, float par2) { -+ this.func_82428_a((EntityZombie)par1EntityLiving, par2); -+ } -+ -+ protected ResourceLocation func_110856_a(EntityLiving par1EntityLiving) { -+ return this.func_110863_a((EntityZombie)par1EntityLiving); -+ } -+ -+ public void doRenderLiving(EntityLiving par1EntityLiving, double par2, double par4, double par6, float par8, float par9) { -+ this.func_82426_a((EntityZombie)par1EntityLiving, par2, par4, par6, par8, par9); -+ } -+ -+ protected int func_130006_a(EntityLiving par1EntityLiving, int par2, float par3) { -+ return this.func_82429_a((EntityZombie)par1EntityLiving, par2, par3); -+ } -+ -+ /** -+ * Queries whether should render the specified pass or not. -+ */ -+ protected int shouldRenderPass(EntityLivingBase par1EntityLivingBase, int par2, float par3) { -+ return this.func_82429_a((EntityZombie)par1EntityLivingBase, par2, par3); -+ } -+ -+ protected void renderEquippedItems(EntityLivingBase par1EntityLivingBase, float par2) { -+ this.func_82428_a((EntityZombie)par1EntityLivingBase, par2); -+ } -+ -+ protected void rotateCorpse(EntityLivingBase par1EntityLivingBase, float par2, float par3, float par4) { -+ this.func_82430_a((EntityZombie)par1EntityLivingBase, par2, par3, par4); -+ } -+ -+ public void renderPlayer(EntityLivingBase par1EntityLivingBase, double par2, double par4, double par6, float par8, float par9) { -+ this.func_82426_a((EntityZombie)par1EntityLivingBase, par2, par4, par6, par8, par9); -+ } -+ -+ /** -+ * Returns the location of an entity's texture. Doesn't seem to be called unless you call Render.bindEntityTexture. -+ */ -+ protected ResourceLocation getEntityTexture(Entity par1Entity) { -+ return this.func_110863_a((EntityZombie)par1Entity); -+ } -+ -+ /** -+ * Actually renders the given argument. This is a synthetic bridge method, always casting down its argument and then -+ * handing it off to a worker function which does the actual work. In all probabilty, the class Render is generic -+ * (Render -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.client.entity; -+ -+import net.minecraft.src.EntityLiving; -+import net.minecraft.src.EntityLivingBase; -+import net.minecraft.src.EntityPlayer; -+ -+import org.spoutcraft.api.entity.EntitySkinType; -+import org.spoutcraft.api.util.FixedLocation; -+import org.spoutcraft.api.util.MutableLocation; -+ -+public class CraftLivingEntity extends CraftEntity { -+ public CraftLivingEntity(EntityLivingBase living) { -+ super(living); -+ } -+ -+ public EntityLivingBase getEntityLiving() { -+ return (EntityLivingBase) handle; -+ } -+ -+ public float getHealth() { -+ return getEntityLiving().getHealth(); -+ } -+ -+ public void setHealth(float health) { -+ getEntityLiving().setHealth(health); -+ } -+ -+ public double getEyeHeight() { -+ return getEntityLiving().getEyeHeight(); -+ } -+ -+ public double getEyeHeight(boolean ignoreSneaking) { -+ if (ignoreSneaking) { -+ return getEntityLiving().height; -+ } -+ return getEyeHeight(); -+ } -+ -+ public FixedLocation getEyeLocation() { -+ return new MutableLocation(handle.posX, handle.posY + getEyeHeight(), handle.posZ); -+ } -+ -+ public boolean isInsideVehicle() { -+ return handle.ridingEntity != null; -+ } -+ -+ public boolean leaveVehicle() { -+ if (isInsideVehicle()) { -+ handle.mountEntity(null); -+ return true; -+ } -+ return false; -+ } -+ -+ public int getRemainingAir() { -+ return getEntityLiving().getAir(); -+ } -+ -+ public void setRemainingAir(int ticks) { -+ if (ticks < 0) { -+ throw new IllegalArgumentException("The Remaining Air can not be below 0"); -+ } -+ getEntityLiving().setAir(ticks); -+ } -+ -+ public int getMaximumAir() { -+ return getEntityLiving().maxAir; -+ } -+ -+ public void setMaximumAir(int ticks) { -+ if (ticks <= 0) { -+ throw new IllegalArgumentException("The Maximum Air can not be below 1"); -+ } -+ getEntityLiving().maxAir = ticks; -+ } -+ -+ public void damage(float amount) { -+ getEntityLiving().damageEntity(net.minecraft.src.DamageSource.generic, amount); -+ } -+ -+ public void damage(int amount, CraftEntity source) { -+ net.minecraft.src.DamageSource reason = net.minecraft.src.DamageSource.generic; -+ -+ if (source instanceof CraftHumanEntity) { -+ reason = net.minecraft.src.DamageSource.causePlayerDamage(((CraftHumanEntity)source).getMCPlayer()); -+ } else if (source instanceof CraftLivingEntity) { -+ reason = net.minecraft.src.DamageSource.causeMobDamage(((CraftLivingEntity)source).getEntityLiving()); -+ } -+ -+ getEntityLiving().damageEntity(reason, amount); -+ } -+ -+ public int getMaximumNoDamageTicks() { -+ return getEntityLiving().maxHurtResistantTime; -+ } -+ -+ public void setMaximumNoDamageTicks(int ticks) { -+ getEntityLiving().maxHurtResistantTime = ticks; -+ } -+ -+ public float getLastDamage() { -+ return getEntityLiving().lastDamage; -+ } -+ -+ public void setLastDamage(float damage) { -+ getEntityLiving().lastDamage = damage; -+ } -+ -+ public int getNoDamageTicks() { -+ return getEntityLiving().hurtResistantTime; -+ } -+ -+ public void setNoDamageTicks(int ticks) { -+ getEntityLiving().hurtResistantTime = ticks; -+ } -+ -+ public String getTitle() { -+ return getEntityLiving().displayName; -+ } -+ -+ public void setTitle(String title) { -+ getEntityLiving().displayName = title; -+ } -+ -+ public void resetTitle() { -+ getEntityLiving().displayName = null; -+ if (handle instanceof EntityPlayer) { -+ getEntityLiving().displayName = ((EntityPlayer)handle).username; -+ } -+ } -+ -+ @Override -+ public void setSkin(String skinURI, EntitySkinType type) { -+ getEntityLiving().setCustomTexture(skinURI, type.getId()); -+ } -+} ---- net/minecraft/src/Packet61DoorChange.java -+++ net/minecraft/src/Packet61DoorChange.java -@@ -12,40 +12,51 @@ - public int posZ; - private boolean disableRelativeVolume; - -- public Packet61DoorChange() { -- } -- -- public Packet61DoorChange(int var1, int var2, int var3, int var4, int var5, boolean var6) { -- this.sfxID = var1; -- this.posX = var2; -- this.posY = var3; -- this.posZ = var4; -- this.auxData = var5; -- this.disableRelativeVolume = var6; -- } -- -- public void readPacketData(DataInput var1) throws IOException { -- this.sfxID = var1.readInt(); -- this.posX = var1.readInt(); -- this.posY = var1.readByte() & 255; -- this.posZ = var1.readInt(); -- this.auxData = var1.readInt(); -- this.disableRelativeVolume = var1.readBoolean(); -- } -- -- public void writePacketData(DataOutput var1) throws IOException { -- var1.writeInt(this.sfxID); -- var1.writeInt(this.posX); -- var1.writeByte(this.posY & 255); -- var1.writeInt(this.posZ); -- var1.writeInt(this.auxData); -- var1.writeBoolean(this.disableRelativeVolume); -- } -- -- public void processPacket(NetHandler var1) { -- var1.handleDoorChange(this); -- } -- -+ public Packet61DoorChange() {} -+ -+ public Packet61DoorChange(int par1, int par2, int par3, int par4, int par5, boolean par6) { -+ this.sfxID = par1; -+ this.posX = par2; -+ this.posY = par3; -+ this.posZ = par4; -+ this.auxData = par5; -+ this.disableRelativeVolume = par6; -+ } -+ -+ /** -+ * Abstract. Reads the raw packet data from the data stream. -+ */ -+ public void readPacketData(DataInput par1DataInput) throws IOException { -+ this.sfxID = par1DataInput.readInt(); -+ this.posX = par1DataInput.readInt(); -+ this.posY = par1DataInput.readByte() & 255; -+ this.posZ = par1DataInput.readInt(); -+ this.auxData = par1DataInput.readInt(); -+ this.disableRelativeVolume = par1DataInput.readBoolean(); -+ } -+ -+ /** -+ * Abstract. Writes the raw packet data to the data stream. -+ */ -+ public void writePacketData(DataOutput par1DataOutput) throws IOException { -+ par1DataOutput.writeInt(this.sfxID); -+ par1DataOutput.writeInt(this.posX); -+ par1DataOutput.writeByte(this.posY & 255); -+ par1DataOutput.writeInt(this.posZ); -+ par1DataOutput.writeInt(this.auxData); -+ par1DataOutput.writeBoolean(this.disableRelativeVolume); -+ } -+ -+ /** -+ * Passes this Packet on to the NetHandler for processing. -+ */ -+ public void processPacket(NetHandler par1NetHandler) { -+ par1NetHandler.handleDoorChange(this); -+ } -+ -+ /** -+ * Abstract. Return the size of the packet (not counting the header). -+ */ - public int getPacketSize() { - return 21; - } ---- net/minecraft/src/RConUtils.java -+++ net/minecraft/src/RConUtils.java -@@ -3,36 +3,54 @@ - import java.io.UnsupportedEncodingException; - - public class RConUtils { -- public static char[] hexDigits = new char[]{'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f'}; -- -- public static String getBytesAsString(byte[] var0, int var1, int var2) { -- int var3 = var2 - 1; -- -+ -+ /** Translation array of decimal to hex digits */ -+ public static char[] hexDigits = new char[] {'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f'}; -+ -+ /** -+ * Read a null-terminated string from the given byte array -+ */ -+ public static String getBytesAsString(byte[] par0ArrayOfByte, int par1, int par2) { -+ int var3 = par2 - 1; - int var4; -- for(var4 = var1 > var3 ? var3 : var1; 0 != var0[var4] && var4 < var3; ++var4) { -+ -+ for (var4 = par1 > var3 ? var3 : par1; 0 != par0ArrayOfByte[var4] && var4 < var3; ++var4) { -+ ; - } - - try { -- return new String(var0, var1, var4 - var1, "UTF-8"); -+ return new String(par0ArrayOfByte, par1, var4 - par1, "UTF-8"); - } catch (UnsupportedEncodingException var6) { - var6.printStackTrace(); - return null; - } - } - -- public static int getRemainingBytesAsLEInt(byte[] var0, int var1) { -- return getBytesAsLEInt(var0, var1, var0.length); -- } -- -- public static int getBytesAsLEInt(byte[] var0, int var1, int var2) { -- return 0 > var2 - var1 - 4 ? 0 : var0[var1 + 3] << 24 | (var0[var1 + 2] & 255) << 16 | (var0[var1 + 1] & 255) << 8 | var0[var1] & 255; -- } -- -- public static int getBytesAsBEint(byte[] var0, int var1, int var2) { -- return 0 > var2 - var1 - 4 ? 0 : var0[var1] << 24 | (var0[var1 + 1] & 255) << 16 | (var0[var1 + 2] & 255) << 8 | var0[var1 + 3] & 255; -- } -- -- public static String getByteAsHexString(byte var0) { -- return "" + hexDigits[(var0 & 240) >>> 4] + hexDigits[var0 & 15]; -+ /** -+ * Read 4 bytes from the -+ */ -+ public static int getRemainingBytesAsLEInt(byte[] par0ArrayOfByte, int par1) { -+ return getBytesAsLEInt(par0ArrayOfByte, par1, par0ArrayOfByte.length); -+ } -+ -+ /** -+ * Read 4 bytes from the given array in little-endian format and return them as an int -+ */ -+ public static int getBytesAsLEInt(byte[] par0ArrayOfByte, int par1, int par2) { -+ return 0 > par2 - par1 - 4 ? 0 : par0ArrayOfByte[par1 + 3] << 24 | (par0ArrayOfByte[par1 + 2] & 255) << 16 | (par0ArrayOfByte[par1 + 1] & 255) << 8 | par0ArrayOfByte[par1] & 255; -+ } -+ -+ /** -+ * Read 4 bytes from the given array in big-endian format and return them as an int -+ */ -+ public static int getBytesAsBEint(byte[] par0ArrayOfByte, int par1, int par2) { -+ return 0 > par2 - par1 - 4 ? 0 : par0ArrayOfByte[par1] << 24 | (par0ArrayOfByte[par1 + 1] & 255) << 16 | (par0ArrayOfByte[par1 + 2] & 255) << 8 | par0ArrayOfByte[par1 + 3] & 255; -+ } -+ -+ /** -+ * Returns a String representation of the byte in hexadecimal format -+ */ -+ public static String getByteAsHexString(byte par0) { -+ return "" + hexDigits[(par0 & 240) >>> 4] + hexDigits[par0 & 15]; - } - } ---- /dev/null -+++ org/spoutcraft/client/packet/PacketClipboardText.java -@@ -1,0 +1,60 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.client.packet; -+ -+import java.io.IOException; -+ -+import org.spoutcraft.api.io.SpoutInputStream; -+import org.spoutcraft.api.io.SpoutOutputStream; -+ -+public class PacketClipboardText implements SpoutPacket { -+ protected String text; -+ public PacketClipboardText() { -+ } -+ -+ public PacketClipboardText(String text) { -+ this.text = text; -+ } -+ -+ public void readData(SpoutInputStream input) throws IOException { -+ text = input.readString(); -+ } -+ -+ public void writeData(SpoutOutputStream output) throws IOException { -+ if (text.length() > Short.MAX_VALUE) { -+ text = text.substring(0, Short.MAX_VALUE - 1); -+ } -+ output.writeString(text); -+ } -+ -+ public void run(int playerId) { -+ } -+ -+ public PacketType getPacketType() { -+ return PacketType.PacketClipboardText; -+ } -+ -+ public int getVersion() { -+ return 0; -+ } -+ -+ public void failure(int playerId) { -+ } -+} ---- net/minecraft/src/BlockDispenser.java -+++ net/minecraft/src/BlockDispenser.java -@@ -3,188 +3,245 @@ - import java.util.Random; - - public class BlockDispenser extends BlockContainer { -+ -+ /** Registry for all dispense behaviors. */ - public static final IRegistry dispenseBehaviorRegistry = new RegistryDefaulted(new BehaviorDefaultDispenseItem()); -- protected Random b = new Random(); -+ protected Random random = new Random(); - protected Icon furnaceTopIcon; - protected Icon furnaceFrontIcon; - protected Icon field_96473_e; - -- protected BlockDispenser(int var1) { -- super(var1, Material.rock); -+ protected BlockDispenser(int par1) { -+ super(par1, Material.rock); - this.setCreativeTab(CreativeTabs.tabRedstone); - } - -- public int tickRate(World var1) { -+ /** -+ * How many world ticks before ticking -+ */ -+ public int tickRate(World par1World) { - return 4; - } - -- public void onBlockAdded(World var1, int var2, int var3, int var4) { -- super.onBlockAdded(var1, var2, var3, var4); -- this.setDispenserDefaultDirection(var1, var2, var3, var4); -+ /** -+ * Called whenever the block is added into the world. Args: world, x, y, z -+ */ -+ public void onBlockAdded(World par1World, int par2, int par3, int par4) { -+ super.onBlockAdded(par1World, par2, par3, par4); -+ this.setDispenserDefaultDirection(par1World, par2, par3, par4); - } - -- private void setDispenserDefaultDirection(World var1, int var2, int var3, int var4) { -- if(!var1.isRemote) { -- int var5 = var1.getBlockId(var2, var3, var4 - 1); -- int var6 = var1.getBlockId(var2, var3, var4 + 1); -- int var7 = var1.getBlockId(var2 - 1, var3, var4); -- int var8 = var1.getBlockId(var2 + 1, var3, var4); -+ /** -+ * sets Dispenser block direction so that the front faces an non-opaque block; chooses west to be direction if all -+ * surrounding blocks are opaque. -+ */ -+ private void setDispenserDefaultDirection(World par1World, int par2, int par3, int par4) { -+ if (!par1World.isRemote) { -+ int var5 = par1World.getBlockId(par2, par3, par4 - 1); -+ int var6 = par1World.getBlockId(par2, par3, par4 + 1); -+ int var7 = par1World.getBlockId(par2 - 1, par3, par4); -+ int var8 = par1World.getBlockId(par2 + 1, par3, par4); - byte var9 = 3; -- if(Block.opaqueCubeLookup[var5] && !Block.opaqueCubeLookup[var6]) { -+ -+ if (Block.opaqueCubeLookup[var5] && !Block.opaqueCubeLookup[var6]) { - var9 = 3; - } - -- if(Block.opaqueCubeLookup[var6] && !Block.opaqueCubeLookup[var5]) { -+ if (Block.opaqueCubeLookup[var6] && !Block.opaqueCubeLookup[var5]) { - var9 = 2; - } - -- if(Block.opaqueCubeLookup[var7] && !Block.opaqueCubeLookup[var8]) { -+ if (Block.opaqueCubeLookup[var7] && !Block.opaqueCubeLookup[var8]) { - var9 = 5; - } - -- if(Block.opaqueCubeLookup[var8] && !Block.opaqueCubeLookup[var7]) { -+ if (Block.opaqueCubeLookup[var8] && !Block.opaqueCubeLookup[var7]) { - var9 = 4; - } - -- var1.setBlockMetadata(var2, var3, var4, var9, 2); -+ par1World.setBlockMetadataWithNotify(par2, par3, par4, var9, 2); - } - } - -- public Icon getIcon(int var1, int var2) { -- int var3 = var2 & 7; -- return var1 == var3 ? (var3 != 1 && var3 != 0 ? this.furnaceFrontIcon : this.field_96473_e) : (var3 != 1 && var3 != 0 ? (var1 != 1 && var1 != 0 ? this.blockIcon : this.furnaceTopIcon) : this.furnaceTopIcon); -- } -- -- public void registerIcons(IconRegister var1) { -- this.blockIcon = var1.registerIcon("furnace_side"); -- this.furnaceTopIcon = var1.registerIcon("furnace_top"); -- this.furnaceFrontIcon = var1.registerIcon(this.getTextureName() + "_front_horizontal"); -- this.field_96473_e = var1.registerIcon(this.getTextureName() + "_front_vertical"); -- } -- -- public boolean onBlockActivated(World var1, int var2, int var3, int var4, EntityPlayer var5, int var6, float var7, float var8, float var9) { -- if(var1.isRemote) { -+ /** -+ * From the specified side and block metadata retrieves the blocks texture. Args: side, metadata -+ */ -+ public Icon getIcon(int par1, int par2) { -+ int var3 = par2 & 7; -+ return par1 == var3 ? (var3 != 1 && var3 != 0 ? this.furnaceFrontIcon : this.field_96473_e) : (var3 != 1 && var3 != 0 ? (par1 != 1 && par1 != 0 ? this.blockIcon : this.furnaceTopIcon) : this.furnaceTopIcon); -+ } -+ -+ /** -+ * When this method is called, your block should register all the icons it needs with the given IconRegister. This is -+ * the only chance you get to register icons. -+ */ -+ public void registerIcons(IconRegister par1IconRegister) { -+ this.blockIcon = par1IconRegister.registerIcon("furnace_side"); -+ this.furnaceTopIcon = par1IconRegister.registerIcon("furnace_top"); -+ this.furnaceFrontIcon = par1IconRegister.registerIcon(this.getTextureName() + "_front_horizontal"); -+ this.field_96473_e = par1IconRegister.registerIcon(this.getTextureName() + "_front_vertical"); -+ } -+ -+ /** -+ * Called upon block activation (right click on the block.) -+ */ -+ public boolean onBlockActivated(World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer, int par6, float par7, float par8, float par9) { -+ if (par1World.isRemote) { - return true; - } else { -- TileEntityDispenser var10 = (TileEntityDispenser)var1.getBlockTileEntity(var2, var3, var4); -- if(var10 != null) { -- var5.displayGUIDispenser(var10); -+ TileEntityDispenser var10 = (TileEntityDispenser)par1World.getBlockTileEntity(par2, par3, par4); -+ -+ if (var10 != null) { -+ par5EntityPlayer.displayGUIDispenser(var10); - } - - return true; - } - } - -- protected void dispense(World var1, int var2, int var3, int var4) { -- BlockSourceImpl var5 = new BlockSourceImpl(var1, var2, var3, var4); -+ protected void dispense(World par1World, int par2, int par3, int par4) { -+ BlockSourceImpl var5 = new BlockSourceImpl(par1World, par2, par3, par4); - TileEntityDispenser var6 = (TileEntityDispenser)var5.getBlockTileEntity(); -- if(var6 != null) { -+ -+ if (var6 != null) { - int var7 = var6.getRandomStackFromInventory(); -- if(var7 < 0) { -- var1.playAuxSFX(1001, var2, var3, var4, 0); -+ -+ if (var7 < 0) { -+ par1World.playAuxSFX(1001, par2, par3, par4, 0); - } else { - ItemStack var8 = var6.getStackInSlot(var7); - IBehaviorDispenseItem var9 = this.getBehaviorForItemStack(var8); -- if(var9 != IBehaviorDispenseItem.itemDispenseBehaviorProvider) { -+ -+ if (var9 != IBehaviorDispenseItem.itemDispenseBehaviorProvider) { - ItemStack var10 = var9.dispense(var5, var8); - var6.setInventorySlotContents(var7, var10.stackSize == 0 ? null : var10); - } - } -- - } - } - -- protected IBehaviorDispenseItem getBehaviorForItemStack(ItemStack var1) { -- return (IBehaviorDispenseItem)dispenseBehaviorRegistry.getObject(var1.getItem()); -+ /** -+ * Returns the behavior for the given ItemStack. -+ */ -+ protected IBehaviorDispenseItem getBehaviorForItemStack(ItemStack par1ItemStack) { -+ return (IBehaviorDispenseItem)dispenseBehaviorRegistry.getObject(par1ItemStack.getItem()); - } - -- public void onNeighborBlockChange(World var1, int var2, int var3, int var4, int var5) { -- boolean var6 = var1.isBlockIndirectlyGettingPowered(var2, var3, var4) || var1.isBlockIndirectlyGettingPowered(var2, var3 + 1, var4); -- int var7 = var1.getBlockMetadata(var2, var3, var4); -+ /** -+ * Lets the block know when one of its neighbor changes. Doesn't know which neighbor changed (coordinates passed are -+ * their own) Args: x, y, z, neighbor blockID -+ */ -+ public void onNeighborBlockChange(World par1World, int par2, int par3, int par4, int par5) { -+ boolean var6 = par1World.isBlockIndirectlyGettingPowered(par2, par3, par4) || par1World.isBlockIndirectlyGettingPowered(par2, par3 + 1, par4); -+ int var7 = par1World.getBlockMetadata(par2, par3, par4); - boolean var8 = (var7 & 8) != 0; -- if(var6 && !var8) { -- var1.scheduleBlockUpdate(var2, var3, var4, this.blockID, this.tickRate(var1)); -- var1.setBlockMetadata(var2, var3, var4, var7 | 8, 4); -- } else if(!var6 && var8) { -- var1.setBlockMetadata(var2, var3, var4, var7 & -9, 4); -- } -- -- } -- -- public void updateTick(World var1, int var2, int var3, int var4, Random var5) { -- if(!var1.isRemote) { -- this.dispense(var1, var2, var3, var4); -- } -- -- } -- -- public TileEntity createNewTileEntity(World var1) { -+ -+ if (var6 && !var8) { -+ par1World.scheduleBlockUpdate(par2, par3, par4, this.blockID, this.tickRate(par1World)); -+ par1World.setBlockMetadataWithNotify(par2, par3, par4, var7 | 8, 4); -+ } else if (!var6 && var8) { -+ par1World.setBlockMetadataWithNotify(par2, par3, par4, var7 & -9, 4); -+ } -+ } -+ -+ /** -+ * Ticks the block if it's been scheduled -+ */ -+ public void updateTick(World par1World, int par2, int par3, int par4, Random par5Random) { -+ if (!par1World.isRemote) { -+ this.dispense(par1World, par2, par3, par4); -+ } -+ } -+ -+ /** -+ * Returns a new instance of a block's tile entity class. Called on placing the block. -+ */ -+ public TileEntity createNewTileEntity(World par1World) { - return new TileEntityDispenser(); - } - -- public void onBlockPlacedBy(World var1, int var2, int var3, int var4, EntityLivingBase var5, ItemStack var6) { -- int var7 = BlockPistonBase.determineOrientation(var1, var2, var3, var4, var5); -- var1.setBlockMetadata(var2, var3, var4, var7, 2); -- if(var6.hasDisplayName()) { -- ((TileEntityDispenser)var1.getBlockTileEntity(var2, var3, var4)).setCustomName(var6.getDisplayName()); -+ /** -+ * Called when the block is placed in the world. -+ */ -+ public void onBlockPlacedBy(World par1World, int par2, int par3, int par4, EntityLivingBase par5EntityLivingBase, ItemStack par6ItemStack) { -+ int var7 = BlockPistonBase.determineOrientation(par1World, par2, par3, par4, par5EntityLivingBase); -+ par1World.setBlockMetadataWithNotify(par2, par3, par4, var7, 2); -+ -+ if (par6ItemStack.hasDisplayName()) { -+ ((TileEntityDispenser)par1World.getBlockTileEntity(par2, par3, par4)).setCustomName(par6ItemStack.getDisplayName()); - } -- - } - -- public void breakBlock(World var1, int var2, int var3, int var4, int var5, int var6) { -- TileEntityDispenser var7 = (TileEntityDispenser)var1.getBlockTileEntity(var2, var3, var4); -- if(var7 != null) { -- for(int var8 = 0; var8 < var7.getSizeInventory(); ++var8) { -+ /** -+ * Called on server worlds only when the block has been replaced by a different block ID, or the same block with a -+ * different metadata value, but before the new metadata value is set. Args: World, x, y, z, old block ID, old metadata -+ */ -+ public void breakBlock(World par1World, int par2, int par3, int par4, int par5, int par6) { -+ TileEntityDispenser var7 = (TileEntityDispenser)par1World.getBlockTileEntity(par2, par3, par4); -+ -+ if (var7 != null) { -+ for (int var8 = 0; var8 < var7.getSizeInventory(); ++var8) { - ItemStack var9 = var7.getStackInSlot(var8); -- if(var9 != null) { -- float var10 = this.b.nextFloat() * 0.8F + 0.1F; -- float var11 = this.b.nextFloat() * 0.8F + 0.1F; -- float var12 = this.b.nextFloat() * 0.8F + 0.1F; -- -- while(var9.stackSize > 0) { -- int var13 = this.b.nextInt(21) + 10; -- if(var13 > var9.stackSize) { -+ -+ if (var9 != null) { -+ float var10 = this.random.nextFloat() * 0.8F + 0.1F; -+ float var11 = this.random.nextFloat() * 0.8F + 0.1F; -+ float var12 = this.random.nextFloat() * 0.8F + 0.1F; -+ -+ while (var9.stackSize > 0) { -+ int var13 = this.random.nextInt(21) + 10; -+ -+ if (var13 > var9.stackSize) { - var13 = var9.stackSize; - } - - var9.stackSize -= var13; -- EntityItem var14 = new EntityItem(var1, (double)((float)var2 + var10), (double)((float)var3 + var11), (double)((float)var4 + var12), new ItemStack(var9.itemID, var13, var9.getItemDamage())); -- if(var9.hasTagCompound()) { -+ EntityItem var14 = new EntityItem(par1World, (double)((float)par2 + var10), (double)((float)par3 + var11), (double)((float)par4 + var12), new ItemStack(var9.itemID, var13, var9.getItemDamage())); -+ -+ if (var9.hasTagCompound()) { - var14.getEntityItem().setTagCompound((NBTTagCompound)var9.getTagCompound().copy()); - } - - float var15 = 0.05F; -- var14.motionX = (double)((float)this.b.nextGaussian() * var15); -- var14.motionY = (double)((float)this.b.nextGaussian() * var15 + 0.2F); -- var14.motionZ = (double)((float)this.b.nextGaussian() * var15); -- var1.spawnEntityInWorld(var14); -+ var14.motionX = (double)((float)this.random.nextGaussian() * var15); -+ var14.motionY = (double)((float)this.random.nextGaussian() * var15 + 0.2F); -+ var14.motionZ = (double)((float)this.random.nextGaussian() * var15); -+ par1World.spawnEntityInWorld(var14); - } - } - } - -- var1.func_96440_m(var2, var3, var4, var5); -+ par1World.func_96440_m(par2, par3, par4, par5); - } - -- super.breakBlock(var1, var2, var3, var4, var5, var6); -+ super.breakBlock(par1World, par2, par3, par4, par5, par6); - } - -- public static IPosition getIPositionFromBlockSource(IBlockSource var0) { -- EnumFacing var1 = getFacing(var0.getBlockMetadata()); -- double var2 = var0.getX() + 0.7D * (double)var1.getFrontOffsetX(); -- double var4 = var0.getY() + 0.7D * (double)var1.getFrontOffsetY(); -- double var6 = var0.getZ() + 0.7D * (double)var1.getFrontOffsetZ(); -+ public static IPosition getIPositionFromBlockSource(IBlockSource par0IBlockSource) { -+ EnumFacing var1 = getFacing(par0IBlockSource.getBlockMetadata()); -+ double var2 = par0IBlockSource.getX() + 0.7D * (double)var1.getFrontOffsetX(); -+ double var4 = par0IBlockSource.getY() + 0.7D * (double)var1.getFrontOffsetY(); -+ double var6 = par0IBlockSource.getZ() + 0.7D * (double)var1.getFrontOffsetZ(); - return new PositionImpl(var2, var4, var6); - } - -- public static EnumFacing getFacing(int var0) { -- return EnumFacing.getFront(var0 & 7); -+ public static EnumFacing getFacing(int par0) { -+ return EnumFacing.getFront(par0 & 7); - } - -+ /** -+ * If this returns true, then comparators facing away from this block will use the value from -+ * getComparatorInputOverride instead of the actual redstone signal strength. -+ */ - public boolean hasComparatorInputOverride() { - return true; - } - -- public int getComparatorInputOverride(World var1, int var2, int var3, int var4, int var5) { -- return Container.calcRedstoneFromInventory((IInventory)var1.getBlockTileEntity(var2, var3, var4)); -+ /** -+ * If hasComparatorInputOverride returns true, the return value from this is used instead of the redstone signal -+ * strength when this block inputs to a comparator. -+ */ -+ public int getComparatorInputOverride(World par1World, int par2, int par3, int par4, int par5) { -+ return Container.calcRedstoneFromInventory((IInventory)par1World.getBlockTileEntity(par2, par3, par4)); - } - } ---- /dev/null -+++ com/prupe/mcpatcher/hd/AAHelper.java -@@ -1,0 +1,153 @@ -+package com.prupe.mcpatcher.hd; -+ -+import com.prupe.mcpatcher.Config; -+import com.prupe.mcpatcher.MCLogger; -+import java.awt.image.BufferedImage; -+import java.lang.reflect.Field; -+import net.minecraft.src.Resource; -+import net.minecraft.src.ResourceLocation; -+import net.minecraft.src.SimpleResource; -+import net.minecraft.src.TextureAtlasSprite; -+import org.lwjgl.opengl.PixelFormat; -+ -+//Spout Start -+import org.spoutcraft.client.config.Configuration; -+//Spout End -+ -+public class AAHelper { -+ private static final MCLogger logger = MCLogger.getLogger("Mipmap"); -+ private static final int debugColor = Config.getBoolean("Extended HD", "debugBorder", false) ? -16776961 : 0; -+ private static final int aaSamples = Config.getInt("Extended HD", "antiAliasing", 1); -+ private static Field addressField; -+ -+ public static PixelFormat setupPixelFormat(PixelFormat pixelFormat) { -+ if (Configuration.getAASampling() > 1) { -+ logger.config("setting AA samples to %d", new Object[] {Integer.valueOf(Configuration.getAASampling())}); -+ return pixelFormat.withSamples(Configuration.getAASampling()); -+ } else { -+ return pixelFormat; -+ } -+ } -+ -+ public static BufferedImage addBorder(TextureAtlasSprite stitched, Resource resource, BufferedImage input) { -+ if (input != null && resource instanceof SimpleResource && addressField != null) { -+ ResourceLocation name; -+ -+ try { -+ name = (ResourceLocation)addressField.get(resource); -+ } catch (IllegalAccessException var14) { -+ var14.printStackTrace(); -+ addressField = null; -+ return input; -+ } -+ -+ input = MipmapHelper.fixTransparency(name, input); -+ -+ if (!(stitched instanceof BorderedTexture)) { -+ return input; -+ } else { -+ int width = input.getWidth(); -+ int height = input.getHeight(); -+ int numFrames = height / width; -+ height = width; -+ int border = getBorderWidth(width); -+ ((BorderedTexture)stitched).setBorderWidth(border); -+ -+ if (border <= 0) { -+ return input; -+ } else { -+ int newWidth = width + 2 * border; -+ int newHeight = width + 2 * border; -+ BufferedImage output = new BufferedImage(newWidth, numFrames * newHeight, 2); -+ -+ for (int frame = 0; frame < numFrames; ++frame) { -+ int sy = frame * height; -+ int dy = frame * newHeight; -+ copyRegion(input, 0, sy, output, 0, dy, border, border, true, true); -+ copyRegion(input, 0, sy, output, border, dy, width, border, false, true); -+ copyRegion(input, width - border, sy, output, width + border, dy, border, border, true, true); -+ copyRegion(input, 0, sy, output, 0, dy + border, border, width, true, false); -+ copyRegion(input, 0, sy, output, border, dy + border, width, height, false, false); -+ copyRegion(input, width - border, sy, output, width + border, dy + border, border, width, true, false); -+ copyRegion(input, 0, sy + height - border, output, 0, dy + height + border, border, border, true, true); -+ copyRegion(input, 0, sy + height - border, output, border, dy + height + border, width, border, false, true); -+ copyRegion(input, width - border, sy + height - border, output, width + border, dy + height + border, border, border, true, true); -+ addDebugOutline(output, dy, width, height, border); -+ } -+ -+ return output; -+ } -+ } -+ } else { -+ return input; -+ } -+ } -+ -+ static boolean useAAForTexture(String texture) { -+ return (Configuration.getAASampling() > 1 || MipmapHelper.anisoLevel > 1) && MipmapHelper.useMipmapsForTexture(texture); -+ } -+ -+ private static int getBorderWidth(int size) { -+ int border; -+ -+ if (Configuration.getAASampling() <= 1 && MipmapHelper.anisoLevel <= 1) { -+ border = 0; -+ } else if (MipmapHelper.mipmapEnabled && MipmapHelper.maxMipmapLevel > 0) { -+ border = 1 << Math.max(Math.min(MipmapHelper.maxMipmapLevel, 4), 0); -+ } else { -+ border = 2; -+ } -+ -+ return Math.min(border, size); -+ } -+ -+ private static void copyRegion(BufferedImage input, int sx, int sy, BufferedImage output, int dx, int dy, int w, int h, boolean flipX, boolean flipY) { -+ int[] rgb = new int[w * h]; -+ input.getRGB(sx, sy, w, h, rgb, 0, w); -+ -+ if (!flipX && !flipY) { -+ output.setRGB(dx, dy, w, h, rgb, 0, w); -+ } else { -+ int[] rgbFlipped = new int[w * h]; -+ -+ for (int i = 0; i < w; ++i) { -+ for (int j = 0; j < h; ++j) { -+ rgbFlipped[w * j + i] = rgb[w * (flipY ? h - 1 - j : j) + (flipX ? w - 1 - i : i)]; -+ } -+ } -+ -+ output.setRGB(dx, dy, w, h, rgbFlipped, 0, w); -+ } -+ } -+ -+ private static void addDebugOutline(BufferedImage output, int dy, int width, int height, int border) { -+ if (debugColor != 0) { -+ int i; -+ -+ for (i = 0; i < width; ++i) { -+ output.setRGB(i + border, dy + border, debugColor); -+ output.setRGB(i + border, dy + height + border, debugColor); -+ } -+ -+ for (i = 0; i < height; ++i) { -+ output.setRGB(border, dy + i + border, debugColor); -+ output.setRGB(height + border, dy + i + border, debugColor); -+ } -+ } -+ } -+ -+ static { -+ Field[] arr$ = SimpleResource.class.getDeclaredFields(); -+ int len$ = arr$.length; -+ -+ for (int i$ = 0; i$ < len$; ++i$) { -+ Field f = arr$[i$]; -+ -+ if (ResourceLocation.class.isAssignableFrom(f.getType())) { -+ f.setAccessible(true); -+ addressField = f; -+ break; -+ } -+ } -+ } -+} ---- net/minecraft/src/EntitySelectorArmoredMob.java -+++ net/minecraft/src/EntitySelectorArmoredMob.java -@@ -3,18 +3,21 @@ - public class EntitySelectorArmoredMob implements IEntitySelector { - private final ItemStack field_96567_c; - -- public EntitySelectorArmoredMob(ItemStack var1) { -- this.field_96567_c = var1; -+ public EntitySelectorArmoredMob(ItemStack par1ItemStack) { -+ this.field_96567_c = par1ItemStack; - } - -- public boolean isEntityApplicable(Entity var1) { -- if(!var1.isEntityAlive()) { -+ /** -+ * Return whether the specified entity is applicable to this filter. -+ */ -+ public boolean isEntityApplicable(Entity par1Entity) { -+ if (!par1Entity.isEntityAlive()) { - return false; -- } else if(!(var1 instanceof EntityLivingBase)) { -+ } else if (!(par1Entity instanceof EntityLivingBase)) { - return false; - } else { -- EntityLivingBase var2 = (EntityLivingBase)var1; -- return var2.getEquipmentInSlot(EntityLiving.getArmorPosition(this.field_96567_c)) != null ? false : (var2 instanceof EntityLiving ? ((EntityLiving)var2).canPickUpLoot() : var2 instanceof EntityPlayer); -+ EntityLivingBase var2 = (EntityLivingBase)par1Entity; -+ return var2.getCurrentItemOrArmor(EntityLiving.getArmorPosition(this.field_96567_c)) != null ? false : (var2 instanceof EntityLiving ? ((EntityLiving)var2).canPickUpLoot() : var2 instanceof EntityPlayer); - } - } - } ---- net/minecraft/src/BlockNetherStalk.java -+++ net/minecraft/src/BlockNetherStalk.java -@@ -5,75 +5,108 @@ - public class BlockNetherStalk extends BlockFlower { - private Icon[] iconArray; - -- protected BlockNetherStalk(int var1) { -- super(var1); -+ protected BlockNetherStalk(int par1) { -+ super(par1); - this.setTickRandomly(true); - float var2 = 0.5F; - this.setBlockBounds(0.5F - var2, 0.0F, 0.5F - var2, 0.5F + var2, 0.25F, 0.5F + var2); - this.setCreativeTab((CreativeTabs)null); - } - -- protected boolean canThisPlantGrowOnThisBlockID(int var1) { -- return var1 == Block.slowSand.blockID; -- } -- -- public boolean canBlockStay(World var1, int var2, int var3, int var4) { -- return this.canThisPlantGrowOnThisBlockID(var1.getBlockId(var2, var3 - 1, var4)); -- } -- -- public void updateTick(World var1, int var2, int var3, int var4, Random var5) { -- int var6 = var1.getBlockMetadata(var2, var3, var4); -- if(var6 < 3 && var5.nextInt(10) == 0) { -+ /** -+ * Gets passed in the blockID of the block below and supposed to return true if its allowed to grow on the type of -+ * blockID passed in. Args: blockID -+ */ -+ protected boolean canThisPlantGrowOnThisBlockID(int par1) { -+ return par1 == Block.slowSand.blockID; -+ } -+ -+ /** -+ * Can this block stay at this position. Similar to canPlaceBlockAt except gets checked often with plants. -+ */ -+ public boolean canBlockStay(World par1World, int par2, int par3, int par4) { -+ return this.canThisPlantGrowOnThisBlockID(par1World.getBlockId(par2, par3 - 1, par4)); -+ } -+ -+ /** -+ * Ticks the block if it's been scheduled -+ */ -+ public void updateTick(World par1World, int par2, int par3, int par4, Random par5Random) { -+ int var6 = par1World.getBlockMetadata(par2, par3, par4); -+ -+ if (var6 < 3 && par5Random.nextInt(10) == 0) { - ++var6; -- var1.setBlockMetadata(var2, var3, var4, var6, 2); -+ par1World.setBlockMetadataWithNotify(par2, par3, par4, var6, 2); - } - -- super.updateTick(var1, var2, var3, var4, var5); -- } -- -- public Icon getIcon(int var1, int var2) { -- return var2 >= 3 ? this.iconArray[2] : (var2 > 0 ? this.iconArray[1] : this.iconArray[0]); -- } -- -+ super.updateTick(par1World, par2, par3, par4, par5Random); -+ } -+ -+ /** -+ * From the specified side and block metadata retrieves the blocks texture. Args: side, metadata -+ */ -+ public Icon getIcon(int par1, int par2) { -+ return par2 >= 3 ? this.iconArray[2] : (par2 > 0 ? this.iconArray[1] : this.iconArray[0]); -+ } -+ -+ /** -+ * The type of render function that is called for this block -+ */ - public int getRenderType() { - return 6; - } - -- public void dropBlockAsItemWithChance(World var1, int var2, int var3, int var4, int var5, float var6, int var7) { -- if(!var1.isRemote) { -+ /** -+ * Drops the block items with a specified chance of dropping the specified items -+ */ -+ public void dropBlockAsItemWithChance(World par1World, int par2, int par3, int par4, int par5, float par6, int par7) { -+ if (!par1World.isRemote) { - int var8 = 1; -- if(var5 >= 3) { -- var8 = 2 + var1.s.nextInt(3); -- if(var7 > 0) { -- var8 += var1.s.nextInt(var7 + 1); -+ -+ if (par5 >= 3) { -+ var8 = 2 + par1World.rand.nextInt(3); -+ -+ if (par7 > 0) { -+ var8 += par1World.rand.nextInt(par7 + 1); - } - } - -- for(int var9 = 0; var9 < var8; ++var9) { -- this.dropBlockAsItem_do(var1, var2, var3, var4, new ItemStack(Item.netherStalkSeeds)); -+ for (int var9 = 0; var9 < var8; ++var9) { -+ this.dropBlockAsItem_do(par1World, par2, par3, par4, new ItemStack(Item.netherStalkSeeds)); - } -- - } - } - -- public int idDropped(int var1, Random var2, int var3) { -- return 0; -- } -- -- public int quantityDropped(Random var1) { -- return 0; -- } -- -- public int idPicked(World var1, int var2, int var3, int var4) { -+ /** -+ * Returns the ID of the items to drop on destruction. -+ */ -+ public int idDropped(int par1, Random par2Random, int par3) { -+ return 0; -+ } -+ -+ /** -+ * Returns the quantity of items to drop on block destruction. -+ */ -+ public int quantityDropped(Random par1Random) { -+ return 0; -+ } -+ -+ /** -+ * only called by clickMiddleMouseButton , and passed to inventory.setCurrentItem (along with isCreative) -+ */ -+ public int idPicked(World par1World, int par2, int par3, int par4) { - return Item.netherStalkSeeds.itemID; - } - -- public void registerIcons(IconRegister var1) { -+ /** -+ * When this method is called, your block should register all the icons it needs with the given IconRegister. This is -+ * the only chance you get to register icons. -+ */ -+ public void registerIcons(IconRegister par1IconRegister) { - this.iconArray = new Icon[3]; - -- for(int var2 = 0; var2 < this.iconArray.length; ++var2) { -- this.iconArray[var2] = var1.registerIcon(this.getTextureName() + "_stage_" + var2); -+ for (int var2 = 0; var2 < this.iconArray.length; ++var2) { -+ this.iconArray[var2] = par1IconRegister.registerIcon(this.getTextureName() + "_stage_" + var2); - } -- - } - } ---- net/minecraft/src/RenderGiantZombie.java -+++ net/minecraft/src/RenderGiantZombie.java -@@ -4,26 +4,38 @@ - - public class RenderGiantZombie extends RenderLiving { - private static final ResourceLocation zombieTextures = new ResourceLocation("textures/entity/zombie/zombie.png"); -+ -+ /** Scale of the model to use */ - private float scale; - -- public RenderGiantZombie(ModelBase var1, float var2, float var3) { -- super(var1, var2 * var3); -- this.scale = var3; -+ public RenderGiantZombie(ModelBase par1ModelBase, float par2, float par3) { -+ super(par1ModelBase, par2 * par3); -+ this.scale = par3; - } - -- protected void preRenderScale(EntityGiantZombie var1, float var2) { -+ /** -+ * Applies the scale to the transform matrix -+ */ -+ protected void preRenderScale(EntityGiantZombie par1EntityGiantZombie, float par2) { - GL11.glScalef(this.scale, this.scale, this.scale); - } - -- protected ResourceLocation getZombieTextures(EntityGiantZombie var1) { -+ protected ResourceLocation getZombieTextures(EntityGiantZombie par1EntityGiantZombie) { - return zombieTextures; - } - -- protected void preRenderCallback(EntityLivingBase var1, float var2) { -- this.preRenderScale((EntityGiantZombie)var1, var2); -+ /** -+ * Allows the render to do any OpenGL state modifications necessary before the model is rendered. Args: entityLiving, -+ * partialTickTime -+ */ -+ protected void preRenderCallback(EntityLivingBase par1EntityLivingBase, float par2) { -+ this.preRenderScale((EntityGiantZombie)par1EntityLivingBase, par2); - } - -- protected ResourceLocation getEntityTexture(Entity var1) { -- return this.getZombieTextures((EntityGiantZombie)var1); -+ /** -+ * Returns the location of an entity's texture. Doesn't seem to be called unless you call Render.bindEntityTexture. -+ */ -+ protected ResourceLocation getEntityTexture(Entity par1Entity) { -+ return this.getZombieTextures((EntityGiantZombie)par1Entity); - } - } ---- net/minecraft/src/RegistryDefaulted.java -+++ net/minecraft/src/RegistryDefaulted.java -@@ -1,14 +1,18 @@ - package net.minecraft.src; - - public class RegistryDefaulted extends RegistrySimple { -- private final Object b; -- -- public RegistryDefaulted(Object var1) { -- this.b = var1; -+ -+ /** -+ * Default object for this registry, returned when an object is not found. -+ */ -+ private final Object defaultObject; -+ -+ public RegistryDefaulted(Object par1Obj) { -+ this.defaultObject = par1Obj; - } - -- public Object getObject(Object var1) { -- Object var2 = super.getObject(var1); -- return var2 == null ? this.b : var2; -+ public Object getObject(Object par1Obj) { -+ Object var2 = super.getObject(par1Obj); -+ return var2 == null ? this.defaultObject : var2; - } - } ---- net/minecraft/src/EntityWeatherEffect.java -+++ net/minecraft/src/EntityWeatherEffect.java -@@ -1,7 +1,7 @@ - package net.minecraft.src; - - public abstract class EntityWeatherEffect extends Entity { -- public EntityWeatherEffect(World var1) { -- super(var1); -+ public EntityWeatherEffect(World par1World) { -+ super(par1World); - } - } ---- net/minecraft/src/ServerCommandManager.java -+++ net/minecraft/src/ServerCommandManager.java -@@ -30,7 +30,8 @@ - this.registerCommand(new CommandSpreadPlayers()); - this.registerCommand(new CommandPlaySound()); - this.registerCommand(new ServerCommandScoreboard()); -- if(MinecraftServer.getServer().isDedicatedServer()) { -+ -+ if (MinecraftServer.getServer().isDedicatedServer()) { - this.registerCommand(new CommandServerOp()); - this.registerCommand(new CommandServerDeop()); - this.registerCommand(new CommandServerStop()); -@@ -53,33 +54,39 @@ - CommandBase.setAdminCommander(this); - } - -- public void notifyAdmins(ICommandSender var1, int var2, String var3, Object... var4) { -+ /** -+ * Sends a message to the admins of the server from a given CommandSender with the given resource string and given -+ * extra srings. If the int par2 is even or zero, the original sender is also notified. -+ */ -+ public void notifyAdmins(ICommandSender par1ICommandSender, int par2, String par3Str, Object ... par4ArrayOfObj) { - boolean var5 = true; -- if(var1 instanceof TileEntityCommandBlock && !MinecraftServer.getServer().worldServers[0].getGameRules().getGameRuleBooleanValue("commandBlockOutput")) { -+ -+ if (par1ICommandSender instanceof TileEntityCommandBlock && !MinecraftServer.getServer().worldServers[0].getGameRules().getGameRuleBooleanValue("commandBlockOutput")) { - var5 = false; - } - -- ChatMessageComponent var6 = ChatMessageComponent.createFromTranslationWithSubstitutions("chat.type.admin", new Object[]{var1.getCommandSenderName(), ChatMessageComponent.createFromTranslationWithSubstitutions(var3, var4)}); -+ ChatMessageComponent var6 = ChatMessageComponent.createFromTranslationWithSubstitutions("chat.type.admin", new Object[] {par1ICommandSender.getCommandSenderName(), ChatMessageComponent.createFromTranslationWithSubstitutions(par3Str, par4ArrayOfObj)}); - var6.setColor(EnumChatFormatting.GRAY); - var6.setItalic(Boolean.valueOf(true)); -- if(var5) { -- Iterator var7 = MinecraftServer.getServer().getConfigurationManager().a.iterator(); -- -- while(var7.hasNext()) { -+ -+ if (var5) { -+ Iterator var7 = MinecraftServer.getServer().getConfigurationManager().playerEntityList.iterator(); -+ -+ while (var7.hasNext()) { - EntityPlayerMP var8 = (EntityPlayerMP)var7.next(); -- if(var8 != var1 && MinecraftServer.getServer().getConfigurationManager().isPlayerOpped(var8.getCommandSenderName())) { -+ -+ if (var8 != par1ICommandSender && MinecraftServer.getServer().getConfigurationManager().isPlayerOpped(var8.getCommandSenderName())) { - var8.sendChatToPlayer(var6); - } - } - } - -- if(var1 != MinecraftServer.getServer()) { -+ if (par1ICommandSender != MinecraftServer.getServer()) { - MinecraftServer.getServer().sendChatToPlayer(var6); - } - -- if((var2 & 1) != 1) { -- var1.sendChatToPlayer(ChatMessageComponent.createFromTranslationWithSubstitutions(var3, var4)); -+ if ((par2 & 1) != 1) { -+ par1ICommandSender.sendChatToPlayer(ChatMessageComponent.createFromTranslationWithSubstitutions(par3Str, par4ArrayOfObj)); - } -- - } - } ---- net/minecraft/src/CommandServerStop.java -+++ net/minecraft/src/CommandServerStop.java -@@ -7,16 +7,19 @@ - return "stop"; - } - -+ /** -+ * Return the required permission level for this command. -+ */ - public int getRequiredPermissionLevel() { - return 4; - } - -- public String getCommandUsage(ICommandSender var1) { -+ public String getCommandUsage(ICommandSender par1ICommandSender) { - return "commands.stop.usage"; - } - -- public void processCommand(ICommandSender var1, String[] var2) { -- notifyAdmins(var1, "commands.stop.start", new Object[0]); -+ public void processCommand(ICommandSender par1ICommandSender, String[] par2ArrayOfStr) { -+ notifyAdmins(par1ICommandSender, "commands.stop.start", new Object[0]); - MinecraftServer.getServer().initiateShutdown(); - } - } ---- net/minecraft/src/ScoreObjective.java -+++ net/minecraft/src/ScoreObjective.java -@@ -2,15 +2,17 @@ - - public class ScoreObjective { - private final Scoreboard theScoreboard; -- private final String b; -+ private final String name; -+ -+ /** The ScoreObjectiveCriteria for this objetive */ - private final ScoreObjectiveCriteria objectiveCriteria; -- private String d; -+ private String displayName; - -- public ScoreObjective(Scoreboard var1, String var2, ScoreObjectiveCriteria var3) { -- this.theScoreboard = var1; -- this.b = var2; -- this.objectiveCriteria = var3; -- this.d = var2; -+ public ScoreObjective(Scoreboard par1Scoreboard, String par2Str, ScoreObjectiveCriteria par3ScoreObjectiveCriteria) { -+ this.theScoreboard = par1Scoreboard; -+ this.name = par2Str; -+ this.objectiveCriteria = par3ScoreObjectiveCriteria; -+ this.displayName = par2Str; - } - - public Scoreboard getScoreboard() { -@@ -18,7 +20,7 @@ - } - - public String getName() { -- return this.b; -+ return this.name; - } - - public ScoreObjectiveCriteria getCriteria() { -@@ -26,11 +28,11 @@ - } - - public String getDisplayName() { -- return this.d; -+ return this.displayName; - } - -- public void setDisplayName(String var1) { -- this.d = var1; -+ public void setDisplayName(String par1Str) { -+ this.displayName = par1Str; - this.theScoreboard.func_96532_b(this); - } - } ---- /dev/null -+++ com/prupe/mcpatcher/sky/SkyRenderer.java -@@ -1,0 +1,110 @@ -+package com.prupe.mcpatcher.sky; -+ -+import com.prupe.mcpatcher.Config; -+import com.prupe.mcpatcher.MCLogger; -+import com.prupe.mcpatcher.TexturePackAPI; -+import com.prupe.mcpatcher.TexturePackChangeHandler; -+import com.prupe.mcpatcher.sky.SkyRenderer$1; -+import com.prupe.mcpatcher.sky.SkyRenderer$Layer; -+import com.prupe.mcpatcher.sky.SkyRenderer$WorldEntry; -+import java.util.HashMap; -+import net.minecraft.src.Minecraft; -+import net.minecraft.src.ResourceLocation; -+import net.minecraft.src.Tessellator; -+import net.minecraft.src.World; -+ -+public class SkyRenderer { -+ private static final MCLogger logger = MCLogger.getLogger("Better Skies"); -+ private static final boolean enable = Config.getBoolean("Better Skies", "skybox", true); -+ private static double worldTime; -+ private static float celestialAngle; -+ private static float rainStrength; -+ private static final HashMap worldSkies = new HashMap(); -+ private static SkyRenderer$WorldEntry currentWorld; -+ public static boolean active; -+ -+ public static void setup(World world, float partialTick, float celestialAngle) { -+ if (TexturePackAPI.isDefaultTexturePack()) { -+ active = false; -+ } else { -+ int worldType = Minecraft.getMinecraft().theWorld.provider.dimensionId; -+ SkyRenderer$WorldEntry newEntry = getWorldEntry(worldType); -+ -+ if (newEntry != currentWorld && currentWorld != null) { -+ currentWorld.unloadTextures(); -+ } -+ -+ currentWorld = newEntry; -+ active = currentWorld.active(); -+ -+ if (active) { -+ worldTime = (double)((float)world.getWorldTime() + partialTick); -+ rainStrength = 1.0F - world.getRainStrength(partialTick); -+ celestialAngle = celestialAngle; -+ } -+ } -+ } -+ -+ public static void renderAll() { -+ if (active) { -+ currentWorld.renderAll(Tessellator.instance); -+ } -+ } -+ -+ public static ResourceLocation setupCelestialObject(ResourceLocation defaultTexture) { -+ if (active) { -+ SkyRenderer$Layer.clearBlendingMethod(); -+ SkyRenderer$Layer layer = currentWorld.getCelestialObject(defaultTexture); -+ -+ if (layer != null) { -+ layer.setBlendingMethod(rainStrength); -+ return SkyRenderer$Layer.access$300(layer); -+ } -+ } -+ -+ return defaultTexture; -+ } -+ -+ private static SkyRenderer$WorldEntry getWorldEntry(int worldType) { -+ SkyRenderer$WorldEntry entry = (SkyRenderer$WorldEntry)worldSkies.get(Integer.valueOf(worldType)); -+ -+ if (entry == null) { -+ entry = new SkyRenderer$WorldEntry(worldType); -+ worldSkies.put(Integer.valueOf(worldType), entry); -+ } -+ -+ return entry; -+ } -+ -+ static HashMap access$000() { -+ return worldSkies; -+ } -+ -+ static boolean access$100() { -+ return enable; -+ } -+ -+ static SkyRenderer$WorldEntry access$200(int x0) { -+ return getWorldEntry(x0); -+ } -+ -+ static MCLogger access$400() { -+ return logger; -+ } -+ -+ static float access$500() { -+ return rainStrength; -+ } -+ -+ static double access$600() { -+ return worldTime; -+ } -+ -+ static float access$700() { -+ return celestialAngle; -+ } -+ -+ static { -+ TexturePackChangeHandler.register(new SkyRenderer$1("Better Skies", 2)); -+ } -+} ---- net/minecraft/src/GuiTextField.java -+++ net/minecraft/src/GuiTextField.java -@@ -3,70 +3,115 @@ - import org.lwjgl.opengl.GL11; - - public class GuiTextField extends Gui { -+ -+ /** -+ * Have the font renderer from GuiScreen to render the textbox text into the screen. -+ */ - private final FontRenderer fontRenderer; - private final int xPos; - private final int yPos; -+ -+ /** The width of this text field. */ - private final int width; - private final int height; -- private String f = ""; -+ -+ /** Have the current text beign edited on the textbox. */ -+ private String text = ""; - private int maxStringLength = 32; - private int cursorCounter; - private boolean enableBackgroundDrawing = true; -+ -+ /** -+ * if true the textbox can lose focus by clicking elsewhere on the screen -+ */ - private boolean canLoseFocus = true; -+ -+ /** -+ * If this value is true along isEnabled, keyTyped will process the keys. -+ */ - private boolean isFocused; -+ -+ /** -+ * If this value is true along isFocused, keyTyped will process the keys. -+ */ - private boolean isEnabled = true; -+ -+ /** -+ * The current character index that should be used as start of the rendered text. -+ */ - private int lineScrollOffset; - private int cursorPosition; -+ -+ /** other selection position, maybe the same as the cursor */ - private int selectionEnd; - private int enabledColor = 14737632; - private int disabledColor = 7368816; -+ -+ /** True if this textbox is visible */ - private boolean visible = true; - -- public GuiTextField(FontRenderer var1, int var2, int var3, int var4, int var5) { -- this.fontRenderer = var1; -- this.xPos = var2; -- this.yPos = var3; -- this.width = var4; -- this.height = var5; -+ public GuiTextField(FontRenderer par1FontRenderer, int par2, int par3, int par4, int par5) { -+ this.fontRenderer = par1FontRenderer; -+ this.xPos = par2; -+ this.yPos = par3; -+ this.width = par4; -+ this.height = par5; - } - -+ /** -+ * Increments the cursor counter -+ */ - public void updateCursorCounter() { - ++this.cursorCounter; - } - -- public void setText(String var1) { -- if(var1.length() > this.maxStringLength) { -- this.f = var1.substring(0, this.maxStringLength); -+ /** -+ * Sets the text of the textbox. -+ */ -+ public void setText(String par1Str) { -+ if (par1Str.length() > this.maxStringLength) { -+ this.text = par1Str.substring(0, this.maxStringLength); - } else { -- this.f = var1; -+ this.text = par1Str; - } - - this.setCursorPositionEnd(); - } - -+ /** -+ * Returns the text beign edited on the textbox. -+ */ - public String getText() { -- return this.f; -+ return this.text; - } - -+ /** -+ * @return returns the text between the cursor and selectionEnd -+ */ - public String getSelectedtext() { - int var1 = this.cursorPosition < this.selectionEnd ? this.cursorPosition : this.selectionEnd; - int var2 = this.cursorPosition < this.selectionEnd ? this.selectionEnd : this.cursorPosition; -- return this.f.substring(var1, var2); -+ return this.text.substring(var1, var2); - } - -- public void writeText(String var1) { -+ /** -+ * replaces selected text, or inserts text at the position on the cursor -+ */ -+ public void writeText(String par1Str) { - String var2 = ""; -- String var3 = ChatAllowedCharacters.filerAllowedCharacters(var1); -+ String var3 = ChatAllowedCharacters.filerAllowedCharacters(par1Str); - int var4 = this.cursorPosition < this.selectionEnd ? this.cursorPosition : this.selectionEnd; - int var5 = this.cursorPosition < this.selectionEnd ? this.selectionEnd : this.cursorPosition; -- int var6 = this.maxStringLength - this.f.length() - (var4 - this.selectionEnd); -+ int var6 = this.maxStringLength - this.text.length() - (var4 - this.selectionEnd); - boolean var7 = false; -- if(this.f.length() > 0) { -- var2 = var2 + this.f.substring(0, var4); -+ -+ if (this.text.length() > 0) { -+ var2 = var2 + this.text.substring(0, var4); - } - - int var8; -- if(var6 < var3.length()) { -+ -+ if (var6 < var3.length()) { - var2 = var2 + var3.substring(0, var6); - var8 = var6; - } else { -@@ -74,228 +119,276 @@ - var8 = var3.length(); - } - -- if(this.f.length() > 0 && var5 < this.f.length()) { -- var2 = var2 + this.f.substring(var5); -+ if (this.text.length() > 0 && var5 < this.text.length()) { -+ var2 = var2 + this.text.substring(var5); - } - -- this.f = var2; -+ this.text = var2; - this.moveCursorBy(var4 - this.selectionEnd + var8); - } - -- public void deleteWords(int var1) { -- if(this.f.length() != 0) { -- if(this.selectionEnd != this.cursorPosition) { -+ /** -+ * Deletes the specified number of words starting at the cursor position. Negative numbers will delete words left of -+ * the cursor. -+ */ -+ public void deleteWords(int par1) { -+ if (this.text.length() != 0) { -+ if (this.selectionEnd != this.cursorPosition) { - this.writeText(""); - } else { -- this.deleteFromCursor(this.getNthWordFromCursor(var1) - this.cursorPosition); -+ this.deleteFromCursor(this.getNthWordFromCursor(par1) - this.cursorPosition); - } - } - } - -- public void deleteFromCursor(int var1) { -- if(this.f.length() != 0) { -- if(this.selectionEnd != this.cursorPosition) { -+ /** -+ * delete the selected text, otherwsie deletes characters from either side of the cursor. params: delete num -+ */ -+ public void deleteFromCursor(int par1) { -+ if (this.text.length() != 0) { -+ if (this.selectionEnd != this.cursorPosition) { - this.writeText(""); - } else { -- boolean var2 = var1 < 0; -- int var3 = var2 ? this.cursorPosition + var1 : this.cursorPosition; -- int var4 = var2 ? this.cursorPosition : this.cursorPosition + var1; -+ boolean var2 = par1 < 0; -+ int var3 = var2 ? this.cursorPosition + par1 : this.cursorPosition; -+ int var4 = var2 ? this.cursorPosition : this.cursorPosition + par1; - String var5 = ""; -- if(var3 >= 0) { -- var5 = this.f.substring(0, var3); -- } -- -- if(var4 < this.f.length()) { -- var5 = var5 + this.f.substring(var4); -- } -- -- this.f = var5; -- if(var2) { -- this.moveCursorBy(var1); -- } -- -+ -+ if (var3 >= 0) { -+ var5 = this.text.substring(0, var3); -+ } -+ -+ if (var4 < this.text.length()) { -+ var5 = var5 + this.text.substring(var4); -+ } -+ -+ this.text = var5; -+ -+ if (var2) { -+ this.moveCursorBy(par1); -+ } - } - } - } - -- public int getNthWordFromCursor(int var1) { -- return this.getNthWordFromPos(var1, this.getCursorPosition()); -- } -- -- public int getNthWordFromPos(int var1, int var2) { -- return this.func_73798_a(var1, this.getCursorPosition(), true); -- } -- -- public int func_73798_a(int var1, int var2, boolean var3) { -- int var4 = var2; -- boolean var5 = var1 < 0; -- int var6 = Math.abs(var1); -- -- for(int var7 = 0; var7 < var6; ++var7) { -- if(!var5) { -- int var8 = this.f.length(); -- var4 = this.f.indexOf(32, var4); -- if(var4 == -1) { -+ /** -+ * see @getNthNextWordFromPos() params: N, position -+ */ -+ public int getNthWordFromCursor(int par1) { -+ return this.getNthWordFromPos(par1, this.getCursorPosition()); -+ } -+ -+ /** -+ * gets the position of the nth word. N may be negative, then it looks backwards. params: N, position -+ */ -+ public int getNthWordFromPos(int par1, int par2) { -+ return this.func_73798_a(par1, this.getCursorPosition(), true); -+ } -+ -+ public int func_73798_a(int par1, int par2, boolean par3) { -+ int var4 = par2; -+ boolean var5 = par1 < 0; -+ int var6 = Math.abs(par1); -+ -+ for (int var7 = 0; var7 < var6; ++var7) { -+ if (var5) { -+ while (par3 && var4 > 0 && this.text.charAt(var4 - 1) == 32) { -+ --var4; -+ } -+ -+ while (var4 > 0 && this.text.charAt(var4 - 1) != 32) { -+ --var4; -+ } -+ } else { -+ int var8 = this.text.length(); -+ var4 = this.text.indexOf(32, var4); -+ -+ if (var4 == -1) { - var4 = var8; - } else { -- while(var3 && var4 < var8 && this.f.charAt(var4) == 32) { -+ while (par3 && var4 < var8 && this.text.charAt(var4) == 32) { - ++var4; - } - } -- } else { -- while(var3 && var4 > 0 && this.f.charAt(var4 - 1) == 32) { -- --var4; -- } -- -- while(var4 > 0 && this.f.charAt(var4 - 1) != 32) { -- --var4; -- } - } - } - - return var4; - } - -- public void moveCursorBy(int var1) { -- this.setCursorPosition(this.selectionEnd + var1); -+ /** -+ * Moves the text cursor by a specified number of characters and clears the selection -+ */ -+ public void moveCursorBy(int par1) { -+ this.setCursorPosition(this.selectionEnd + par1); - } - -- public void setCursorPosition(int var1) { -- this.cursorPosition = var1; -- int var2 = this.f.length(); -- if(this.cursorPosition < 0) { -+ /** -+ * sets the position of the cursor to the provided index -+ */ -+ public void setCursorPosition(int par1) { -+ this.cursorPosition = par1; -+ int var2 = this.text.length(); -+ -+ if (this.cursorPosition < 0) { - this.cursorPosition = 0; - } - -- if(this.cursorPosition > var2) { -+ if (this.cursorPosition > var2) { - this.cursorPosition = var2; - } - - this.setSelectionPos(this.cursorPosition); - } - -+ /** -+ * sets the cursors position to the beginning -+ */ - public void setCursorPositionZero() { - this.setCursorPosition(0); - } - -+ /** -+ * sets the cursors position to after the text -+ */ - public void setCursorPositionEnd() { -- this.setCursorPosition(this.f.length()); -+ this.setCursorPosition(this.text.length()); - } - -- public boolean textboxKeyTyped(char var1, int var2) { -- if(this.isEnabled && this.isFocused) { -- switch(var1) { -- case '\u0001': -- this.setCursorPositionEnd(); -- this.setSelectionPos(0); -- return true; -- case '\u0003': -- GuiScreen.setClipboardString(this.getSelectedtext()); -- return true; -- case '\u0016': -- this.writeText(GuiScreen.getClipboardString()); -- return true; -- case '\u0018': -- GuiScreen.setClipboardString(this.getSelectedtext()); -- this.writeText(""); -- return true; -- default: -- switch(var2) { -- case 14: -- if(GuiScreen.isCtrlKeyDown()) { -- this.deleteWords(-1); -- } else { -- this.deleteFromCursor(-1); -- } -- -- return true; -- case 199: -- if(GuiScreen.isShiftKeyDown()) { -- this.setSelectionPos(0); -- } else { -- this.setCursorPositionZero(); -- } -- -- return true; -- case 203: -- if(GuiScreen.isShiftKeyDown()) { -- if(GuiScreen.isCtrlKeyDown()) { -- this.setSelectionPos(this.getNthWordFromPos(-1, this.getSelectionEnd())); -- } else { -- this.setSelectionPos(this.getSelectionEnd() - 1); -- } -- } else if(GuiScreen.isCtrlKeyDown()) { -- this.setCursorPosition(this.getNthWordFromCursor(-1)); -- } else { -- this.moveCursorBy(-1); -- } -- -- return true; -- case 205: -- if(GuiScreen.isShiftKeyDown()) { -- if(GuiScreen.isCtrlKeyDown()) { -- this.setSelectionPos(this.getNthWordFromPos(1, this.getSelectionEnd())); -- } else { -- this.setSelectionPos(this.getSelectionEnd() + 1); -- } -- } else if(GuiScreen.isCtrlKeyDown()) { -- this.setCursorPosition(this.getNthWordFromCursor(1)); -- } else { -- this.moveCursorBy(1); -- } -- -- return true; -- case 207: -- if(GuiScreen.isShiftKeyDown()) { -- this.setSelectionPos(this.f.length()); -- } else { -- this.setCursorPositionEnd(); -- } -- -- return true; -- case 211: -- if(GuiScreen.isCtrlKeyDown()) { -- this.deleteWords(1); -- } else { -- this.deleteFromCursor(1); -- } -- -- return true; -+ /** -+ * Call this method from you GuiScreen to process the keys into textbox. -+ */ -+ public boolean textboxKeyTyped(char par1, int par2) { -+ if (this.isEnabled && this.isFocused) { -+ switch (par1) { -+ case 1: -+ this.setCursorPositionEnd(); -+ this.setSelectionPos(0); -+ return true; -+ -+ case 3: -+ GuiScreen.setClipboardString(this.getSelectedtext()); -+ return true; -+ -+ case 22: -+ this.writeText(GuiScreen.getClipboardString()); -+ return true; -+ -+ case 24: -+ GuiScreen.setClipboardString(this.getSelectedtext()); -+ this.writeText(""); -+ return true; -+ - default: -- if(ChatAllowedCharacters.isAllowedCharacter(var1)) { -- this.writeText(Character.toString(var1)); -- return true; -- } else { -- return false; -+ switch (par2) { -+ case 14: -+ if (GuiScreen.isCtrlKeyDown()) { -+ this.deleteWords(-1); -+ } else { -+ this.deleteFromCursor(-1); -+ } -+ -+ return true; -+ -+ case 199: -+ if (GuiScreen.isShiftKeyDown()) { -+ this.setSelectionPos(0); -+ } else { -+ this.setCursorPositionZero(); -+ } -+ -+ return true; -+ -+ case 203: -+ if (GuiScreen.isShiftKeyDown()) { -+ if (GuiScreen.isCtrlKeyDown()) { -+ this.setSelectionPos(this.getNthWordFromPos(-1, this.getSelectionEnd())); -+ } else { -+ this.setSelectionPos(this.getSelectionEnd() - 1); -+ } -+ } else if (GuiScreen.isCtrlKeyDown()) { -+ this.setCursorPosition(this.getNthWordFromCursor(-1)); -+ } else { -+ this.moveCursorBy(-1); -+ } -+ -+ return true; -+ -+ case 205: -+ if (GuiScreen.isShiftKeyDown()) { -+ if (GuiScreen.isCtrlKeyDown()) { -+ this.setSelectionPos(this.getNthWordFromPos(1, this.getSelectionEnd())); -+ } else { -+ this.setSelectionPos(this.getSelectionEnd() + 1); -+ } -+ } else if (GuiScreen.isCtrlKeyDown()) { -+ this.setCursorPosition(this.getNthWordFromCursor(1)); -+ } else { -+ this.moveCursorBy(1); -+ } -+ -+ return true; -+ -+ case 207: -+ if (GuiScreen.isShiftKeyDown()) { -+ this.setSelectionPos(this.text.length()); -+ } else { -+ this.setCursorPositionEnd(); -+ } -+ -+ return true; -+ -+ case 211: -+ if (GuiScreen.isCtrlKeyDown()) { -+ this.deleteWords(1); -+ } else { -+ this.deleteFromCursor(1); -+ } -+ -+ return true; -+ -+ default: -+ if (ChatAllowedCharacters.isAllowedCharacter(par1)) { -+ this.writeText(Character.toString(par1)); -+ return true; -+ } else { -+ return false; -+ } - } -- } - } - } else { - return false; - } - } - -- public void mouseClicked(int var1, int var2, int var3) { -- boolean var4 = var1 >= this.xPos && var1 < this.xPos + this.width && var2 >= this.yPos && var2 < this.yPos + this.height; -- if(this.canLoseFocus) { -+ /** -+ * Args: x, y, buttonClicked -+ */ -+ public void mouseClicked(int par1, int par2, int par3) { -+ boolean var4 = par1 >= this.xPos && par1 < this.xPos + this.width && par2 >= this.yPos && par2 < this.yPos + this.height; -+ -+ if (this.canLoseFocus) { - this.setFocused(this.isEnabled && var4); - } - -- if(this.isFocused && var3 == 0) { -- int var5 = var1 - this.xPos; -- if(this.enableBackgroundDrawing) { -+ if (this.isFocused && par3 == 0) { -+ int var5 = par1 - this.xPos; -+ -+ if (this.enableBackgroundDrawing) { - var5 -= 4; - } - -- String var6 = this.fontRenderer.trimStringToWidth(this.f.substring(this.lineScrollOffset), this.getWidth()); -+ String var6 = this.fontRenderer.trimStringToWidth(this.text.substring(this.lineScrollOffset), this.getWidth()); - this.setCursorPosition(this.fontRenderer.trimStringToWidth(var6, var5).length() + this.lineScrollOffset); - } -- - } - -+ /** -+ * Draws the textbox -+ */ - public void drawTextBox() { -- if(this.getVisible()) { -- if(this.getEnableBackgroundDrawing()) { -+ if (this.getVisible()) { -+ if (this.getEnableBackgroundDrawing()) { - drawRect(this.xPos - 1, this.yPos - 1, this.xPos + this.width + 1, this.yPos + this.height + 1, -6250336); - drawRect(this.xPos, this.yPos, this.xPos + this.width, this.yPos + this.height, -16777216); - } -@@ -303,62 +396,67 @@ - int var1 = this.isEnabled ? this.enabledColor : this.disabledColor; - int var2 = this.cursorPosition - this.lineScrollOffset; - int var3 = this.selectionEnd - this.lineScrollOffset; -- String var4 = this.fontRenderer.trimStringToWidth(this.f.substring(this.lineScrollOffset), this.getWidth()); -+ String var4 = this.fontRenderer.trimStringToWidth(this.text.substring(this.lineScrollOffset), this.getWidth()); - boolean var5 = var2 >= 0 && var2 <= var4.length(); - boolean var6 = this.isFocused && this.cursorCounter / 6 % 2 == 0 && var5; - int var7 = this.enableBackgroundDrawing ? this.xPos + 4 : this.xPos; - int var8 = this.enableBackgroundDrawing ? this.yPos + (this.height - 8) / 2 : this.yPos; - int var9 = var7; -- if(var3 > var4.length()) { -+ -+ if (var3 > var4.length()) { - var3 = var4.length(); - } - -- if(var4.length() > 0) { -+ if (var4.length() > 0) { - String var10 = var5 ? var4.substring(0, var2) : var4; - var9 = this.fontRenderer.drawStringWithShadow(var10, var7, var8, var1); - } - -- boolean var13 = this.cursorPosition < this.f.length() || this.f.length() >= this.getMaxStringLength(); -+ boolean var13 = this.cursorPosition < this.text.length() || this.text.length() >= this.getMaxStringLength(); - int var11 = var9; -- if(!var5) { -+ -+ if (!var5) { - var11 = var2 > 0 ? var7 + this.width : var7; -- } else if(var13) { -+ } else if (var13) { - var11 = var9 - 1; - --var9; - } - -- if(var4.length() > 0 && var5 && var2 < var4.length()) { -+ if (var4.length() > 0 && var5 && var2 < var4.length()) { - this.fontRenderer.drawStringWithShadow(var4.substring(var2), var9, var8, var1); - } - -- if(var6) { -- if(var13) { -+ if (var6) { -+ if (var13) { - Gui.drawRect(var11, var8 - 1, var11 + 1, var8 + 1 + this.fontRenderer.FONT_HEIGHT, -3092272); - } else { - this.fontRenderer.drawStringWithShadow("_", var11, var8, var1); - } - } - -- if(var3 != var2) { -+ if (var3 != var2) { - int var12 = var7 + this.fontRenderer.getStringWidth(var4.substring(0, var3)); - this.drawCursorVertical(var11, var8 - 1, var12 - 1, var8 + 1 + this.fontRenderer.FONT_HEIGHT); - } -- - } - } - -- private void drawCursorVertical(int var1, int var2, int var3, int var4) { -+ /** -+ * draws the vertical line cursor in the textbox -+ */ -+ private void drawCursorVertical(int par1, int par2, int par3, int par4) { - int var5; -- if(var1 < var3) { -- var5 = var1; -- var1 = var3; -- var3 = var5; -+ -+ if (par1 < par3) { -+ var5 = par1; -+ par1 = par3; -+ par3 = var5; - } - -- if(var2 < var4) { -- var5 = var2; -- var2 = var4; -- var4 = var5; -+ if (par2 < par4) { -+ var5 = par2; -+ par2 = par4; -+ par4 = var5; - } - - Tessellator var6 = Tessellator.instance; -@@ -367,120 +465,161 @@ - GL11.glEnable(GL11.GL_COLOR_LOGIC_OP); - GL11.glLogicOp(GL11.GL_OR_REVERSE); - var6.startDrawingQuads(); -- var6.addVertex((double)var1, (double)var4, 0.0D); -- var6.addVertex((double)var3, (double)var4, 0.0D); -- var6.addVertex((double)var3, (double)var2, 0.0D); -- var6.addVertex((double)var1, (double)var2, 0.0D); -+ var6.addVertex((double)par1, (double)par4, 0.0D); -+ var6.addVertex((double)par3, (double)par4, 0.0D); -+ var6.addVertex((double)par3, (double)par2, 0.0D); -+ var6.addVertex((double)par1, (double)par2, 0.0D); - var6.draw(); - GL11.glDisable(GL11.GL_COLOR_LOGIC_OP); - GL11.glEnable(GL11.GL_TEXTURE_2D); - } - -- public void setMaxStringLength(int var1) { -- this.maxStringLength = var1; -- if(this.f.length() > var1) { -- this.f = this.f.substring(0, var1); -+ public void setMaxStringLength(int par1) { -+ this.maxStringLength = par1; -+ -+ if (this.text.length() > par1) { -+ this.text = this.text.substring(0, par1); - } -- - } - -+ /** -+ * returns the maximum number of character that can be contained in this textbox -+ */ - public int getMaxStringLength() { - return this.maxStringLength; - } - -+ /** -+ * returns the current position of the cursor -+ */ - public int getCursorPosition() { - return this.cursorPosition; - } - -+ /** -+ * get enable drawing background and outline -+ */ - public boolean getEnableBackgroundDrawing() { - return this.enableBackgroundDrawing; - } - -- public void setEnableBackgroundDrawing(boolean var1) { -- this.enableBackgroundDrawing = var1; -- } -- -- public void setTextColor(int var1) { -- this.enabledColor = var1; -- } -- -- public void setDisabledTextColour(int var1) { -- this.disabledColor = var1; -- } -- -- public void setFocused(boolean var1) { -- if(var1 && !this.isFocused) { -+ /** -+ * enable drawing background and outline -+ */ -+ public void setEnableBackgroundDrawing(boolean par1) { -+ this.enableBackgroundDrawing = par1; -+ } -+ -+ /** -+ * Sets the text colour for this textbox (disabled text will not use this colour) -+ */ -+ public void setTextColor(int par1) { -+ this.enabledColor = par1; -+ } -+ -+ public void setDisabledTextColour(int par1) { -+ this.disabledColor = par1; -+ } -+ -+ /** -+ * setter for the focused field -+ */ -+ public void setFocused(boolean par1) { -+ if (par1 && !this.isFocused) { - this.cursorCounter = 0; - } - -- this.isFocused = var1; -+ this.isFocused = par1; - } - -+ /** -+ * getter for the focused field -+ */ - public boolean isFocused() { - return this.isFocused; - } - -- public void setEnabled(boolean var1) { -- this.isEnabled = var1; -+ public void setEnabled(boolean par1) { -+ this.isEnabled = par1; - } - -+ /** -+ * the side of the selection that is not the cursor, maye be the same as the cursor -+ */ - public int getSelectionEnd() { - return this.selectionEnd; - } - -+ /** -+ * returns the width of the textbox depending on if the the box is enabled -+ */ - public int getWidth() { - return this.getEnableBackgroundDrawing() ? this.width - 8 : this.width; - } - -- public void setSelectionPos(int var1) { -- int var2 = this.f.length(); -- if(var1 > var2) { -- var1 = var2; -- } -- -- if(var1 < 0) { -- var1 = 0; -- } -- -- this.selectionEnd = var1; -- if(this.fontRenderer != null) { -- if(this.lineScrollOffset > var2) { -+ /** -+ * Sets the position of the selection anchor (i.e. position the selection was started at) -+ */ -+ public void setSelectionPos(int par1) { -+ int var2 = this.text.length(); -+ -+ if (par1 > var2) { -+ par1 = var2; -+ } -+ -+ if (par1 < 0) { -+ par1 = 0; -+ } -+ -+ this.selectionEnd = par1; -+ -+ if (this.fontRenderer != null) { -+ if (this.lineScrollOffset > var2) { - this.lineScrollOffset = var2; - } - - int var3 = this.getWidth(); -- String var4 = this.fontRenderer.trimStringToWidth(this.f.substring(this.lineScrollOffset), var3); -+ String var4 = this.fontRenderer.trimStringToWidth(this.text.substring(this.lineScrollOffset), var3); - int var5 = var4.length() + this.lineScrollOffset; -- if(var1 == this.lineScrollOffset) { -- this.lineScrollOffset -= this.fontRenderer.trimStringToWidth(this.f, var3, true).length(); -- } -- -- if(var1 > var5) { -- this.lineScrollOffset += var1 - var5; -- } else if(var1 <= this.lineScrollOffset) { -- this.lineScrollOffset -= this.lineScrollOffset - var1; -- } -- -- if(this.lineScrollOffset < 0) { -+ -+ if (par1 == this.lineScrollOffset) { -+ this.lineScrollOffset -= this.fontRenderer.trimStringToWidth(this.text, var3, true).length(); -+ } -+ -+ if (par1 > var5) { -+ this.lineScrollOffset += par1 - var5; -+ } else if (par1 <= this.lineScrollOffset) { -+ this.lineScrollOffset -= this.lineScrollOffset - par1; -+ } -+ -+ if (this.lineScrollOffset < 0) { - this.lineScrollOffset = 0; - } - -- if(this.lineScrollOffset > var2) { -+ if (this.lineScrollOffset > var2) { - this.lineScrollOffset = var2; - } - } -- -- } -- -- public void setCanLoseFocus(boolean var1) { -- this.canLoseFocus = var1; -- } -- -+ } -+ -+ /** -+ * if true the textbox can lose focus by clicking elsewhere on the screen -+ */ -+ public void setCanLoseFocus(boolean par1) { -+ this.canLoseFocus = par1; -+ } -+ -+ /** -+ * @return {@code true} if this textbox is visible -+ */ - public boolean getVisible() { - return this.visible; - } - -- public void setVisible(boolean var1) { -- this.visible = var1; -+ /** -+ * Sets whether or not this textbox is visible -+ */ -+ public void setVisible(boolean par1) { -+ this.visible = par1; - } - } ---- /dev/null -+++ org/spoutcraft/api/material/block/Slab.java -@@ -1,0 +1,32 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.api.material.block; -+ -+import org.spoutcraft.api.material.SolidBlock; -+ -+public class Slab extends GenericBlock implements SolidBlock{ -+ public Slab(String name, int id, int data) { -+ super(name, id, data); -+ } -+ -+ public boolean isFallingBlock() { -+ return false; -+ } -+} ---- net/minecraft/src/CommandGameMode.java -+++ net/minecraft/src/CommandGameMode.java -@@ -8,45 +8,60 @@ - return "gamemode"; - } - -+ /** -+ * Return the required permission level for this command. -+ */ - public int getRequiredPermissionLevel() { - return 2; - } - -- public String getCommandUsage(ICommandSender var1) { -+ public String getCommandUsage(ICommandSender par1ICommandSender) { - return "commands.gamemode.usage"; - } - -- public void processCommand(ICommandSender var1, String[] var2) { -- if(var2.length > 0) { -- EnumGameType var3 = this.getGameModeFromCommand(var1, var2[0]); -- EntityPlayerMP var4 = var2.length >= 2 ? getPlayer(var1, var2[1]) : getCommandSenderAsPlayer(var1); -+ public void processCommand(ICommandSender par1ICommandSender, String[] par2ArrayOfStr) { -+ if (par2ArrayOfStr.length > 0) { -+ EnumGameType var3 = this.getGameModeFromCommand(par1ICommandSender, par2ArrayOfStr[0]); -+ EntityPlayerMP var4 = par2ArrayOfStr.length >= 2 ? getPlayer(par1ICommandSender, par2ArrayOfStr[1]) : getCommandSenderAsPlayer(par1ICommandSender); - var4.setGameType(var3); - var4.fallDistance = 0.0F; - ChatMessageComponent var5 = ChatMessageComponent.createFromTranslationKey("gameMode." + var3.getName()); -- if(var4 != var1) { -- notifyAdmins(var1, 1, "commands.gamemode.success.other", new Object[]{var4.getEntityName(), var5}); -+ -+ if (var4 != par1ICommandSender) { -+ notifyAdmins(par1ICommandSender, 1, "commands.gamemode.success.other", new Object[] {var4.getEntityName(), var5}); - } else { -- notifyAdmins(var1, 1, "commands.gamemode.success.self", new Object[]{var5}); -+ notifyAdmins(par1ICommandSender, 1, "commands.gamemode.success.self", new Object[] {var5}); - } -- - } else { - throw new WrongUsageException("commands.gamemode.usage", new Object[0]); - } - } - -- protected EnumGameType getGameModeFromCommand(ICommandSender var1, String var2) { -- return !var2.equalsIgnoreCase(EnumGameType.SURVIVAL.getName()) && !var2.equalsIgnoreCase("s") ? (!var2.equalsIgnoreCase(EnumGameType.CREATIVE.getName()) && !var2.equalsIgnoreCase("c") ? (!var2.equalsIgnoreCase(EnumGameType.ADVENTURE.getName()) && !var2.equalsIgnoreCase("a") ? WorldSettings.getGameTypeById(parseIntBounded(var1, var2, 0, EnumGameType.values().length - 2)) : EnumGameType.ADVENTURE) : EnumGameType.CREATIVE) : EnumGameType.SURVIVAL; -- } -- -- public List addTabCompletionOptions(ICommandSender var1, String[] var2) { -- return var2.length == 1 ? getListOfStringsMatchingLastWord(var2, new String[]{"survival", "creative", "adventure"}) : (var2.length == 2 ? getListOfStringsMatchingLastWord(var2, this.getListOfPlayerUsernames()) : null); -- } -- -+ /** -+ * Gets the Game Mode specified in the command. -+ */ -+ protected EnumGameType getGameModeFromCommand(ICommandSender par1ICommandSender, String par2Str) { -+ return !par2Str.equalsIgnoreCase(EnumGameType.SURVIVAL.getName()) && !par2Str.equalsIgnoreCase("s") ? (!par2Str.equalsIgnoreCase(EnumGameType.CREATIVE.getName()) && !par2Str.equalsIgnoreCase("c") ? (!par2Str.equalsIgnoreCase(EnumGameType.ADVENTURE.getName()) && !par2Str.equalsIgnoreCase("a") ? WorldSettings.getGameTypeById(parseIntBounded(par1ICommandSender, par2Str, 0, EnumGameType.values().length - 2)) : EnumGameType.ADVENTURE) : EnumGameType.CREATIVE) : EnumGameType.SURVIVAL; -+ } -+ -+ /** -+ * Adds the strings available in this command to the given list of tab completion options. -+ */ -+ public List addTabCompletionOptions(ICommandSender par1ICommandSender, String[] par2ArrayOfStr) { -+ return par2ArrayOfStr.length == 1 ? getListOfStringsMatchingLastWord(par2ArrayOfStr, new String[] {"survival", "creative", "adventure"}): (par2ArrayOfStr.length == 2 ? getListOfStringsMatchingLastWord(par2ArrayOfStr, this.getListOfPlayerUsernames()) : null); -+ } -+ -+ /** -+ * Returns String array containing all player usernames in the server. -+ */ - protected String[] getListOfPlayerUsernames() { - return MinecraftServer.getServer().getAllUsernames(); - } - -- public boolean isUsernameIndex(String[] var1, int var2) { -- return var2 == 1; -+ /** -+ * Return whether the specified command parameter index is a username parameter. -+ */ -+ public boolean isUsernameIndex(String[] par1ArrayOfStr, int par2) { -+ return par2 == 1; - } - } ---- net/minecraft/src/EntityXPOrb.java -+++ net/minecraft/src/EntityXPOrb.java -@@ -1,94 +1,128 @@ - package net.minecraft.src; - -+// Spout Start -+import org.spoutcraft.api.Spoutcraft; -+import org.spoutcraft.api.material.CustomBlock; -+import org.spoutcraft.api.material.MaterialData; -+// Spout End -+ - public class EntityXPOrb extends Entity { -+ -+ /** -+ * A constantly increasing value that RenderXPOrb uses to control the colour shifting (Green / yellow) -+ */ - public int xpColor; -+ -+ /** The age of the XP orb in ticks. */ - public int xpOrbAge; - public int field_70532_c; -+ -+ /** The health of this XP orb. */ - private int xpOrbHealth = 5; -- private int xpValue; -+ -+ /** This is how much XP this orb has. */ -+ // Spout Start - private to public -+ public int xpValue; -+ // Spout End -+ -+ /** The closest EntityPlayer to this orb. */ - private EntityPlayer closestPlayer; -+ -+ /** Threshold color for tracking players */ - private int xpTargetColor; - -- public EntityXPOrb(World var1, double var2, double var4, double var6, int var8) { -- super(var1); -+ public EntityXPOrb(World par1World, double par2, double par4, double par6, int par8) { -+ super(par1World); - this.setSize(0.5F, 0.5F); - this.yOffset = this.height / 2.0F; -- this.setPosition(var2, var4, var6); -+ this.setPosition(par2, par4, par6); - this.rotationYaw = (float)(Math.random() * 360.0D); -- this.motionX = (double)((float)(Math.random() * (double)0.2F - (double)0.1F) * 2.0F); -+ this.motionX = (double)((float)(Math.random() * 0.20000000298023224D - 0.10000000149011612D) * 2.0F); - this.motionY = (double)((float)(Math.random() * 0.2D) * 2.0F); -- this.motionZ = (double)((float)(Math.random() * (double)0.2F - (double)0.1F) * 2.0F); -- this.xpValue = var8; -+ this.motionZ = (double)((float)(Math.random() * 0.20000000298023224D - 0.10000000149011612D) * 2.0F); -+ this.xpValue = par8; - } - -+ /** -+ * returns if this entity triggers Block.onEntityWalking on the blocks they walk on. used for spiders and wolves to -+ * prevent them from trampling crops -+ */ - protected boolean canTriggerWalking() { - return false; - } - -- public EntityXPOrb(World var1) { -- super(var1); -+ public EntityXPOrb(World par1World) { -+ super(par1World); - this.setSize(0.25F, 0.25F); - this.yOffset = this.height / 2.0F; - } - -- protected void entityInit() { -- } -+ protected void entityInit() {} - -- public int getBrightnessForRender(float var1) { -+ public int getBrightnessForRender(float par1) { - float var2 = 0.5F; -- if(var2 < 0.0F) { -+ -+ if (var2 < 0.0F) { - var2 = 0.0F; - } - -- if(var2 > 1.0F) { -+ if (var2 > 1.0F) { - var2 = 1.0F; - } - -- int var3 = super.getBrightnessForRender(var1); -+ int var3 = super.getBrightnessForRender(par1); - int var4 = var3 & 255; - int var5 = var3 >> 16 & 255; - var4 += (int)(var2 * 15.0F * 16.0F); -- if(var4 > 240) { -+ -+ if (var4 > 240) { - var4 = 240; - } - - return var4 | var5 << 16; - } - -+ /** -+ * Called to update the entity's position/logic. -+ */ - public void onUpdate() { - super.onUpdate(); -- if(this.field_70532_c > 0) { -+ -+ if (this.field_70532_c > 0) { - --this.field_70532_c; - } - - this.prevPosX = this.posX; - this.prevPosY = this.posY; - this.prevPosZ = this.posZ; -- this.motionY -= (double)0.03F; -- if(this.worldObj.getBlockMaterial(MathHelper.floor_double(this.posX), MathHelper.floor_double(this.posY), MathHelper.floor_double(this.posZ)) == Material.lava) { -- this.motionY = (double)0.2F; -- this.motionX = (double)((this.ab.nextFloat() - this.ab.nextFloat()) * 0.2F); -- this.motionZ = (double)((this.ab.nextFloat() - this.ab.nextFloat()) * 0.2F); -- this.playSound("random.fizz", 0.4F, 2.0F + this.ab.nextFloat() * 0.4F); -+ this.motionY -= 0.029999999329447746D; -+ -+ if (this.worldObj.getBlockMaterial(MathHelper.floor_double(this.posX), MathHelper.floor_double(this.posY), MathHelper.floor_double(this.posZ)) == Material.lava) { -+ this.motionY = 0.20000000298023224D; -+ this.motionX = (double)((this.rand.nextFloat() - this.rand.nextFloat()) * 0.2F); -+ this.motionZ = (double)((this.rand.nextFloat() - this.rand.nextFloat()) * 0.2F); -+ this.playSound("random.fizz", 0.4F, 2.0F + this.rand.nextFloat() * 0.4F); - } - - this.pushOutOfBlocks(this.posX, (this.boundingBox.minY + this.boundingBox.maxY) / 2.0D, this.posZ); - double var1 = 8.0D; -- if(this.xpTargetColor < this.xpColor - 20 + this.entityId % 100) { -- if(this.closestPlayer == null || this.closestPlayer.getDistanceSqToEntity(this) > var1 * var1) { -+ -+ if (this.xpTargetColor < this.xpColor - 20 + this.entityId % 100) { -+ if (this.closestPlayer == null || this.closestPlayer.getDistanceSqToEntity(this) > var1 * var1) { - this.closestPlayer = this.worldObj.getClosestPlayerToEntity(this, var1); - } - - this.xpTargetColor = this.xpColor; - } - -- if(this.closestPlayer != null) { -+ if (this.closestPlayer != null) { - double var3 = (this.closestPlayer.posX - this.posX) / var1; - double var5 = (this.closestPlayer.posY + (double)this.closestPlayer.getEyeHeight() - this.posY) / var1; - double var7 = (this.closestPlayer.posZ - this.posZ) / var1; - double var9 = Math.sqrt(var3 * var3 + var5 * var5 + var7 * var7); - double var11 = 1.0D - var9; -- if(var11 > 0.0D) { -+ -+ if (var11 > 0.0D) { - var11 *= var11; - this.motionX += var3 / var9 * var11 * 0.1D; - this.motionY += var5 / var9 * var11 * 0.1D; -@@ -98,44 +132,71 @@ - - this.moveEntity(this.motionX, this.motionY, this.motionZ); - float var13 = 0.98F; -- if(this.onGround) { -- var13 = 0.1F * 0.1F * 58.8F; -+ -+ if (this.onGround) { -+ var13 = 0.58800006F; - int var4 = this.worldObj.getBlockId(MathHelper.floor_double(this.posX), MathHelper.floor_double(this.boundingBox.minY) - 1, MathHelper.floor_double(this.posZ)); -- if(var4 > 0) { -+ -+ if (var4 > 0) { - var13 = Block.blocksList[var4].slipperiness * 0.98F; -+ // Spout Start -+ if (!worldObj.isRemote) { -+ int x = MathHelper.floor_double(this.posX); -+ int y = MathHelper.floor_double(this.boundingBox.minY) - 1; -+ int z = MathHelper.floor_double(this.posZ); -+ short customId = Spoutcraft.getChunkAt(worldObj, x, y, z).getCustomBlockId(x, y, z); -+ if (customId > 0) { -+ CustomBlock block = MaterialData.getCustomBlock(customId); -+ if (block != null) { -+ var13 = block.getFriction() * 0.98F; -+ } -+ } -+ } -+ // Spout End - } - } - - this.motionX *= (double)var13; -- this.motionY *= (double)0.98F; -+ this.motionY *= 0.9800000190734863D; - this.motionZ *= (double)var13; -- if(this.onGround) { -- this.motionY *= (double)-0.9F; -+ -+ if (this.onGround) { -+ this.motionY *= -0.8999999761581421D; - } - - ++this.xpColor; - ++this.xpOrbAge; -- if(this.xpOrbAge >= 6000) { -+ -+ if (this.xpOrbAge >= 6000) { - this.setDead(); - } -- - } - -+ /** -+ * Returns if this entity is in water and will end up adding the waters velocity to the entity -+ */ - public boolean handleWaterMovement() { - return this.worldObj.handleMaterialAcceleration(this.boundingBox, Material.water, this); - } - -- protected void dealFireDamage(int var1) { -- this.attackEntityFrom(DamageSource.inFire, (float)var1); -+ /** -+ * Will deal the specified amount of damage to the entity if the entity isn't immune to fire damage. Args: amountDamage -+ */ -+ protected void dealFireDamage(int par1) { -+ this.attackEntityFrom(DamageSource.inFire, (float)par1); - } - -- public boolean attackEntityFrom(DamageSource var1, float var2) { -- if(this.isEntityInvulnerable()) { -+ /** -+ * Called when the entity is attacked. -+ */ -+ public boolean attackEntityFrom(DamageSource par1DamageSource, float par2) { -+ if (this.isEntityInvulnerable()) { - return false; - } else { - this.setBeenAttacked(); -- this.xpOrbHealth = (int)((float)this.xpOrbHealth - var2); -- if(this.xpOrbHealth <= 0) { -+ this.xpOrbHealth = (int)((float)this.xpOrbHealth - par2); -+ -+ if (this.xpOrbHealth <= 0) { - this.setDead(); - } - -@@ -143,43 +204,64 @@ - } - } - -- public void writeEntityToNBT(NBTTagCompound var1) { -- var1.setShort("Health", (short)((byte)this.xpOrbHealth)); -- var1.setShort("Age", (short)this.xpOrbAge); -- var1.setShort("Value", (short)this.xpValue); -- } -- -- public void readEntityFromNBT(NBTTagCompound var1) { -- this.xpOrbHealth = var1.getShort("Health") & 255; -- this.xpOrbAge = var1.getShort("Age"); -- this.xpValue = var1.getShort("Value"); -- } -- -- public void onCollideWithPlayer(EntityPlayer var1) { -- if(!this.worldObj.isRemote) { -- if(this.field_70532_c == 0 && var1.xpCooldown == 0) { -- var1.xpCooldown = 2; -- this.playSound("random.orb", 0.1F, 0.5F * ((this.ab.nextFloat() - this.ab.nextFloat()) * 0.7F + 1.8F)); -- var1.onItemPickup(this, 1); -- var1.addExperience(this.xpValue); -+ /** -+ * (abstract) Protected helper method to write subclass entity data to NBT. -+ */ -+ public void writeEntityToNBT(NBTTagCompound par1NBTTagCompound) { -+ par1NBTTagCompound.setShort("Health", (short)((byte)this.xpOrbHealth)); -+ par1NBTTagCompound.setShort("Age", (short)this.xpOrbAge); -+ par1NBTTagCompound.setShort("Value", (short)this.xpValue); -+ } -+ -+ /** -+ * (abstract) Protected helper method to read subclass entity data from NBT. -+ */ -+ public void readEntityFromNBT(NBTTagCompound par1NBTTagCompound) { -+ this.xpOrbHealth = par1NBTTagCompound.getShort("Health") & 255; -+ this.xpOrbAge = par1NBTTagCompound.getShort("Age"); -+ this.xpValue = par1NBTTagCompound.getShort("Value"); -+ } -+ -+ /** -+ * Called by a player entity when they collide with an entity -+ */ -+ public void onCollideWithPlayer(EntityPlayer par1EntityPlayer) { -+ if (!this.worldObj.isRemote) { -+ if (this.field_70532_c == 0 && par1EntityPlayer.xpCooldown == 0) { -+ par1EntityPlayer.xpCooldown = 2; -+ this.playSound("random.orb", 0.1F, 0.5F * ((this.rand.nextFloat() - this.rand.nextFloat()) * 0.7F + 1.8F)); -+ par1EntityPlayer.onItemPickup(this, 1); -+ par1EntityPlayer.addExperience(this.xpValue); - this.setDead(); - } -- - } - } - -+ /** -+ * Returns the XP value of this XP orb. -+ */ - public int getXpValue() { - return this.xpValue; - } - -+ /** -+ * Returns a number from 1 to 10 based on how much XP this orb is worth. This is used by RenderXPOrb to determine what -+ * texture to use. -+ */ - public int getTextureByXP() { - return this.xpValue >= 2477 ? 10 : (this.xpValue >= 1237 ? 9 : (this.xpValue >= 617 ? 8 : (this.xpValue >= 307 ? 7 : (this.xpValue >= 149 ? 6 : (this.xpValue >= 73 ? 5 : (this.xpValue >= 37 ? 4 : (this.xpValue >= 17 ? 3 : (this.xpValue >= 7 ? 2 : (this.xpValue >= 3 ? 1 : 0))))))))); - } - -- public static int getXPSplit(int var0) { -- return var0 >= 2477 ? 2477 : (var0 >= 1237 ? 1237 : (var0 >= 617 ? 617 : (var0 >= 307 ? 307 : (var0 >= 149 ? 149 : (var0 >= 73 ? 73 : (var0 >= 37 ? 37 : (var0 >= 17 ? 17 : (var0 >= 7 ? 7 : (var0 >= 3 ? 3 : 1))))))))); -+ /** -+ * Get xp split rate (Is called until the xp drop code in EntityLiving.onEntityUpdate is complete) -+ */ -+ public static int getXPSplit(int par0) { -+ return par0 >= 2477 ? 2477 : (par0 >= 1237 ? 1237 : (par0 >= 617 ? 617 : (par0 >= 307 ? 307 : (par0 >= 149 ? 149 : (par0 >= 73 ? 73 : (par0 >= 37 ? 37 : (par0 >= 17 ? 17 : (par0 >= 7 ? 7 : (par0 >= 3 ? 3 : 1))))))))); - } - -+ /** -+ * If returns false, the item will not inflict any damage against entities. -+ */ - public boolean canAttackWithItem() { - return false; - } ---- net/minecraft/src/ResourcePackRepository.java -+++ net/minecraft/src/ResourcePackRepository.java -@@ -6,56 +6,55 @@ - import java.io.FileFilter; - import java.util.ArrayList; - import java.util.Arrays; --import java.util.Collection; - import java.util.Collections; - import java.util.Iterator; - import java.util.List; - - public class ResourcePackRepository { -- protected static final FileFilter a = new ResourcePackRepositoryFilter(); -- private final File d; -+ protected static final FileFilter resourcePackFilter = new ResourcePackRepositoryFilter(); -+ private final File dirResourcepacks; - public final ResourcePack rprDefaultResourcePack; - public final MetadataSerializer rprMetadataSerializer; -- private List e = Lists.newArrayList(); -- private List f = Lists.newArrayList(); -+ private List repositoryEntriesAll = Lists.newArrayList(); -+ private List repositoryEntries = Lists.newArrayList(); - -- public ResourcePackRepository(File var1, ResourcePack var2, MetadataSerializer var3, GameSettings var4) { -- this.d = var1; -- this.rprDefaultResourcePack = var2; -- this.rprMetadataSerializer = var3; -+ public ResourcePackRepository(File par1File, ResourcePack par2ResourcePack, MetadataSerializer par3MetadataSerializer, GameSettings par4GameSettings) { -+ this.dirResourcepacks = par1File; -+ this.rprDefaultResourcePack = par2ResourcePack; -+ this.rprMetadataSerializer = par3MetadataSerializer; - this.fixDirResourcepacks(); - this.updateRepositoryEntriesAll(); -- Iterator var5 = this.e.iterator(); -+ Iterator var5 = this.repositoryEntriesAll.iterator(); - -- while(var5.hasNext()) { -+ while (var5.hasNext()) { - ResourcePackRepositoryEntry var6 = (ResourcePackRepositoryEntry)var5.next(); -- if(var6.getResourcePackName().equals(var4.m)) { -- this.f.add(var6); -+ -+ if (var6.getResourcePackName().equals(par4GameSettings.skin)) { -+ this.repositoryEntries.add(var6); - } - } -- - } - - private void fixDirResourcepacks() { -- if(!this.d.isDirectory()) { -- this.d.delete(); -- this.d.mkdirs(); -+ if (!this.dirResourcepacks.isDirectory()) { -+ this.dirResourcepacks.delete(); -+ this.dirResourcepacks.mkdirs(); - } -- - } - - private List getResourcePackFiles() { -- return this.d.isDirectory() ? Arrays.asList(this.d.listFiles(a)) : Collections.emptyList(); -+ return this.dirResourcepacks.isDirectory() ? Arrays.asList(this.dirResourcepacks.listFiles(resourcePackFilter)) : Collections.emptyList(); - } - - public void updateRepositoryEntriesAll() { - ArrayList var1 = Lists.newArrayList(); - Iterator var2 = this.getResourcePackFiles().iterator(); - -- while(var2.hasNext()) { -+ while (var2.hasNext()) { - File var3 = (File)var2.next(); - ResourcePackRepositoryEntry var4 = new ResourcePackRepositoryEntry(this, var3, (ResourcePackRepositoryFilter)null); -- if(!this.e.contains(var4)) { -+ -+ if (!this.repositoryEntriesAll.contains(var4)) { - try { - var4.updateResourcePack(); - var1.add(var4); -@@ -63,39 +62,39 @@ - var1.remove(var4); - } - } else { -- var1.add(this.e.get(this.e.indexOf(var4))); -+ var1.add(this.repositoryEntriesAll.get(this.repositoryEntriesAll.indexOf(var4))); - } - } - -- this.e.removeAll(var1); -- var2 = this.e.iterator(); -+ this.repositoryEntriesAll.removeAll(var1); -+ var2 = this.repositoryEntriesAll.iterator(); - -- while(var2.hasNext()) { -+ while (var2.hasNext()) { - ResourcePackRepositoryEntry var7 = (ResourcePackRepositoryEntry)var2.next(); - var7.closeResourcePack(); - } - -- this.e = var1; -+ this.repositoryEntriesAll = var1; - } - - public List getRepositoryEntriesAll() { -- return ImmutableList.copyOf((Collection)this.e); -+ return ImmutableList.copyOf(this.repositoryEntriesAll); - } - - public List getRepositoryEntries() { -- return ImmutableList.copyOf((Collection)this.f); -+ return ImmutableList.copyOf(this.repositoryEntries); - } - - public String getResourcePackName() { -- return this.f.isEmpty() ? "Default" : ((ResourcePackRepositoryEntry)this.f.get(0)).getResourcePackName(); -+ return this.repositoryEntries.isEmpty() ? "Default" : ((ResourcePackRepositoryEntry)this.repositoryEntries.get(0)).getResourcePackName(); - } - -- public void setRepositoryEntries(ResourcePackRepositoryEntry... var1) { -- this.f.clear(); -- Collections.addAll(this.f, var1); -+ public void setRepositoryEntries(ResourcePackRepositoryEntry ... par1ArrayOfResourcePackRepositoryEntry) { -+ this.repositoryEntries.clear(); -+ Collections.addAll(this.repositoryEntries, par1ArrayOfResourcePackRepositoryEntry); - } - - public File getDirResourcepacks() { -- return this.d; -+ return this.dirResourcepacks; - } - } ---- net/minecraft/src/ComponentStrongholdRightTurn.java -+++ net/minecraft/src/ComponentStrongholdRightTurn.java -@@ -4,25 +4,36 @@ - import java.util.Random; - - public class ComponentStrongholdRightTurn extends ComponentStrongholdLeftTurn { -- public void buildComponent(StructureComponent var1, List var2, Random var3) { -- if(this.coordBaseMode != 2 && this.coordBaseMode != 3) { -- this.getNextComponentX((ComponentStrongholdStairs2)var1, var2, var3, 1, 1); -+ public ComponentStrongholdRightTurn(int par1, Random par2Random, StructureBoundingBox par3StructureBoundingBox, int par4) { -+ super(par1, par2Random, par3StructureBoundingBox, par4); -+ } -+ -+ /** -+ * Initiates construction of the Structure Component picked, at the current Location of StructGen -+ */ -+ public void buildComponent(StructureComponent par1StructureComponent, List par2List, Random par3Random) { -+ if (this.coordBaseMode != 2 && this.coordBaseMode != 3) { -+ this.getNextComponentX((ComponentStrongholdStairs2)par1StructureComponent, par2List, par3Random, 1, 1); - } else { -- this.getNextComponentZ((ComponentStrongholdStairs2)var1, var2, var3, 1, 1); -+ this.getNextComponentZ((ComponentStrongholdStairs2)par1StructureComponent, par2List, par3Random, 1, 1); - } -- - } - -- public boolean addComponentParts(World var1, Random var2, StructureBoundingBox var3) { -- if(this.isLiquidInStructureBoundingBox(var1, var3)) { -+ /** -+ * second Part of Structure generating, this for example places Spiderwebs, Mob Spawners, it closes Mineshafts at the -+ * end, it adds Fences... -+ */ -+ public boolean addComponentParts(World par1World, Random par2Random, StructureBoundingBox par3StructureBoundingBox) { -+ if (this.isLiquidInStructureBoundingBox(par1World, par3StructureBoundingBox)) { - return false; - } else { -- this.fillWithRandomizedBlocks(var1, var3, 0, 0, 0, 4, 4, 4, true, var2, StructureStrongholdPieces.getStrongholdStones()); -- this.placeDoor(var1, var2, var3, this.field_143013_d, 1, 1, 0); -- if(this.coordBaseMode != 2 && this.coordBaseMode != 3) { -- this.fillWithBlocks(var1, var3, 0, 1, 1, 0, 3, 3, 0, 0, false); -+ this.fillWithRandomizedBlocks(par1World, par3StructureBoundingBox, 0, 0, 0, 4, 4, 4, true, par2Random, StructureStrongholdPieces.getStrongholdStones()); -+ this.placeDoor(par1World, par2Random, par3StructureBoundingBox, this.field_143013_d, 1, 1, 0); -+ -+ if (this.coordBaseMode != 2 && this.coordBaseMode != 3) { -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 0, 1, 1, 0, 3, 3, 0, 0, false); - } else { -- this.fillWithBlocks(var1, var3, 4, 1, 1, 4, 3, 3, 0, 0, false); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 4, 1, 1, 4, 3, 3, 0, 0, false); - } - - return true; ---- net/minecraft/src/WorldInfo.java -+++ net/minecraft/src/WorldInfo.java -@@ -3,197 +3,268 @@ - import net.minecraft.server.MinecraftServer; - - public class WorldInfo { -+ -+ /** Holds the seed of the currently world. */ - private long randomSeed; -- private WorldType terrainType = WorldType.DEFAULT; -- private String c = ""; -+ private WorldType terrainType; -+ private String generatorOptions; -+ -+ /** The spawn zone position X coordinate. */ - private int spawnX; -+ -+ /** The spawn zone position Y coordinate. */ - private int spawnY; -+ -+ /** The spawn zone position Z coordinate. */ - private int spawnZ; -+ -+ /** Total time for this world. */ - private long totalTime; -+ -+ /** The current world time in ticks, ranging from 0 to 23999. */ - private long worldTime; -+ -+ /** The last time the player was in this world. */ - private long lastTimePlayed; -+ -+ /** The size of entire save of current world on the disk, isn't exactly. */ - private long sizeOnDisk; - private NBTTagCompound playerTag; - private int dimension; -- private String m; -+ -+ /** The name of the save defined at world creation. */ -+ private String levelName; -+ -+ /** Introduced in beta 1.3, is the save version for future control. */ - private int saveVersion; -+ -+ /** True if it's raining, false otherwise. */ - private boolean raining; -+ -+ /** Number of ticks until next rain. */ - private int rainTime; -+ -+ /** Is thunderbolts failing now? */ - private boolean thundering; -+ -+ /** Number of ticks untils next thunderbolt. */ - private int thunderTime; -+ -+ /** The Game Type. */ - private EnumGameType theGameType; -+ -+ /** -+ * Whether the map features (e.g. strongholds) generation is enabled or disabled. -+ */ - private boolean mapFeaturesEnabled; -+ -+ /** Hardcore mode flag */ - private boolean hardcore; - private boolean allowCommands; - private boolean initialized; -- private GameRules theGameRules = new GameRules(); -+ private GameRules theGameRules; - - protected WorldInfo() { -+ this.terrainType = WorldType.DEFAULT; -+ this.generatorOptions = ""; -+ this.theGameRules = new GameRules(); - } - -- public WorldInfo(NBTTagCompound var1) { -- this.randomSeed = var1.getLong("RandomSeed"); -- if(var1.hasKey("generatorName")) { -- String var2 = var1.getString("generatorName"); -+ public WorldInfo(NBTTagCompound par1NBTTagCompound) { -+ this.terrainType = WorldType.DEFAULT; -+ this.generatorOptions = ""; -+ this.theGameRules = new GameRules(); -+ this.randomSeed = par1NBTTagCompound.getLong("RandomSeed"); -+ -+ if (par1NBTTagCompound.hasKey("generatorName")) { -+ String var2 = par1NBTTagCompound.getString("generatorName"); - this.terrainType = WorldType.parseWorldType(var2); -- if(this.terrainType == null) { -+ -+ if (this.terrainType == null) { - this.terrainType = WorldType.DEFAULT; -- } else if(this.terrainType.isVersioned()) { -+ } else if (this.terrainType.isVersioned()) { - int var3 = 0; -- if(var1.hasKey("generatorVersion")) { -- var3 = var1.getInteger("generatorVersion"); -+ -+ if (par1NBTTagCompound.hasKey("generatorVersion")) { -+ var3 = par1NBTTagCompound.getInteger("generatorVersion"); - } - - this.terrainType = this.terrainType.getWorldTypeForGeneratorVersion(var3); - } - -- if(var1.hasKey("generatorOptions")) { -- this.c = var1.getString("generatorOptions"); -+ if (par1NBTTagCompound.hasKey("generatorOptions")) { -+ this.generatorOptions = par1NBTTagCompound.getString("generatorOptions"); - } - } - -- this.theGameType = EnumGameType.getByID(var1.getInteger("GameType")); -- if(var1.hasKey("MapFeatures")) { -- this.mapFeaturesEnabled = var1.getBoolean("MapFeatures"); -+ this.theGameType = EnumGameType.getByID(par1NBTTagCompound.getInteger("GameType")); -+ -+ if (par1NBTTagCompound.hasKey("MapFeatures")) { -+ this.mapFeaturesEnabled = par1NBTTagCompound.getBoolean("MapFeatures"); - } else { - this.mapFeaturesEnabled = true; - } - -- this.spawnX = var1.getInteger("SpawnX"); -- this.spawnY = var1.getInteger("SpawnY"); -- this.spawnZ = var1.getInteger("SpawnZ"); -- this.totalTime = var1.getLong("Time"); -- if(var1.hasKey("DayTime")) { -- this.worldTime = var1.getLong("DayTime"); -+ this.spawnX = par1NBTTagCompound.getInteger("SpawnX"); -+ this.spawnY = par1NBTTagCompound.getInteger("SpawnY"); -+ this.spawnZ = par1NBTTagCompound.getInteger("SpawnZ"); -+ this.totalTime = par1NBTTagCompound.getLong("Time"); -+ -+ if (par1NBTTagCompound.hasKey("DayTime")) { -+ this.worldTime = par1NBTTagCompound.getLong("DayTime"); - } else { - this.worldTime = this.totalTime; - } - -- this.lastTimePlayed = var1.getLong("LastPlayed"); -- this.sizeOnDisk = var1.getLong("SizeOnDisk"); -- this.m = var1.getString("LevelName"); -- this.saveVersion = var1.getInteger("version"); -- this.rainTime = var1.getInteger("rainTime"); -- this.raining = var1.getBoolean("raining"); -- this.thunderTime = var1.getInteger("thunderTime"); -- this.thundering = var1.getBoolean("thundering"); -- this.hardcore = var1.getBoolean("hardcore"); -- if(var1.hasKey("initialized")) { -- this.initialized = var1.getBoolean("initialized"); -+ this.lastTimePlayed = par1NBTTagCompound.getLong("LastPlayed"); -+ this.sizeOnDisk = par1NBTTagCompound.getLong("SizeOnDisk"); -+ this.levelName = par1NBTTagCompound.getString("LevelName"); -+ this.saveVersion = par1NBTTagCompound.getInteger("version"); -+ this.rainTime = par1NBTTagCompound.getInteger("rainTime"); -+ this.raining = par1NBTTagCompound.getBoolean("raining"); -+ this.thunderTime = par1NBTTagCompound.getInteger("thunderTime"); -+ this.thundering = par1NBTTagCompound.getBoolean("thundering"); -+ this.hardcore = par1NBTTagCompound.getBoolean("hardcore"); -+ -+ if (par1NBTTagCompound.hasKey("initialized")) { -+ this.initialized = par1NBTTagCompound.getBoolean("initialized"); - } else { - this.initialized = true; - } - -- if(var1.hasKey("allowCommands")) { -- this.allowCommands = var1.getBoolean("allowCommands"); -+ if (par1NBTTagCompound.hasKey("allowCommands")) { -+ this.allowCommands = par1NBTTagCompound.getBoolean("allowCommands"); - } else { - this.allowCommands = this.theGameType == EnumGameType.CREATIVE; - } - -- if(var1.hasKey("Player")) { -- this.playerTag = var1.getCompoundTag("Player"); -+ if (par1NBTTagCompound.hasKey("Player")) { -+ this.playerTag = par1NBTTagCompound.getCompoundTag("Player"); - this.dimension = this.playerTag.getInteger("Dimension"); - } - -- if(var1.hasKey("GameRules")) { -- this.theGameRules.readGameRulesFromNBT(var1.getCompoundTag("GameRules")); -+ if (par1NBTTagCompound.hasKey("GameRules")) { -+ this.theGameRules.readGameRulesFromNBT(par1NBTTagCompound.getCompoundTag("GameRules")); - } -- - } - -- public WorldInfo(WorldSettings var1, String var2) { -- this.randomSeed = var1.getSeed(); -- this.theGameType = var1.getGameType(); -- this.mapFeaturesEnabled = var1.isMapFeaturesEnabled(); -- this.m = var2; -- this.hardcore = var1.getHardcoreEnabled(); -- this.terrainType = var1.getTerrainType(); -- this.c = var1.func_82749_j(); -- this.allowCommands = var1.areCommandsAllowed(); -+ public WorldInfo(WorldSettings par1WorldSettings, String par2Str) { -+ this.terrainType = WorldType.DEFAULT; -+ this.generatorOptions = ""; -+ this.theGameRules = new GameRules(); -+ this.randomSeed = par1WorldSettings.getSeed(); -+ this.theGameType = par1WorldSettings.getGameType(); -+ this.mapFeaturesEnabled = par1WorldSettings.isMapFeaturesEnabled(); -+ this.levelName = par2Str; -+ this.hardcore = par1WorldSettings.getHardcoreEnabled(); -+ this.terrainType = par1WorldSettings.getTerrainType(); -+ this.generatorOptions = par1WorldSettings.func_82749_j(); -+ this.allowCommands = par1WorldSettings.areCommandsAllowed(); - this.initialized = false; - } - -- public WorldInfo(WorldInfo var1) { -- this.randomSeed = var1.randomSeed; -- this.terrainType = var1.terrainType; -- this.c = var1.c; -- this.theGameType = var1.theGameType; -- this.mapFeaturesEnabled = var1.mapFeaturesEnabled; -- this.spawnX = var1.spawnX; -- this.spawnY = var1.spawnY; -- this.spawnZ = var1.spawnZ; -- this.totalTime = var1.totalTime; -- this.worldTime = var1.worldTime; -- this.lastTimePlayed = var1.lastTimePlayed; -- this.sizeOnDisk = var1.sizeOnDisk; -- this.playerTag = var1.playerTag; -- this.dimension = var1.dimension; -- this.m = var1.m; -- this.saveVersion = var1.saveVersion; -- this.rainTime = var1.rainTime; -- this.raining = var1.raining; -- this.thunderTime = var1.thunderTime; -- this.thundering = var1.thundering; -- this.hardcore = var1.hardcore; -- this.allowCommands = var1.allowCommands; -- this.initialized = var1.initialized; -- this.theGameRules = var1.theGameRules; -+ public WorldInfo(WorldInfo par1WorldInfo) { -+ this.terrainType = WorldType.DEFAULT; -+ this.generatorOptions = ""; -+ this.theGameRules = new GameRules(); -+ this.randomSeed = par1WorldInfo.randomSeed; -+ this.terrainType = par1WorldInfo.terrainType; -+ this.generatorOptions = par1WorldInfo.generatorOptions; -+ this.theGameType = par1WorldInfo.theGameType; -+ this.mapFeaturesEnabled = par1WorldInfo.mapFeaturesEnabled; -+ this.spawnX = par1WorldInfo.spawnX; -+ this.spawnY = par1WorldInfo.spawnY; -+ this.spawnZ = par1WorldInfo.spawnZ; -+ this.totalTime = par1WorldInfo.totalTime; -+ this.worldTime = par1WorldInfo.worldTime; -+ this.lastTimePlayed = par1WorldInfo.lastTimePlayed; -+ this.sizeOnDisk = par1WorldInfo.sizeOnDisk; -+ this.playerTag = par1WorldInfo.playerTag; -+ this.dimension = par1WorldInfo.dimension; -+ this.levelName = par1WorldInfo.levelName; -+ this.saveVersion = par1WorldInfo.saveVersion; -+ this.rainTime = par1WorldInfo.rainTime; -+ this.raining = par1WorldInfo.raining; -+ this.thunderTime = par1WorldInfo.thunderTime; -+ this.thundering = par1WorldInfo.thundering; -+ this.hardcore = par1WorldInfo.hardcore; -+ this.allowCommands = par1WorldInfo.allowCommands; -+ this.initialized = par1WorldInfo.initialized; -+ this.theGameRules = par1WorldInfo.theGameRules; - } - -+ /** -+ * Gets the NBTTagCompound for the worldInfo -+ */ - public NBTTagCompound getNBTTagCompound() { - NBTTagCompound var1 = new NBTTagCompound(); - this.updateTagCompound(var1, this.playerTag); - return var1; - } - -- public NBTTagCompound cloneNBTCompound(NBTTagCompound var1) { -+ /** -+ * Creates a new NBTTagCompound for the world, with the given NBTTag as the "Player" -+ */ -+ public NBTTagCompound cloneNBTCompound(NBTTagCompound par1NBTTagCompound) { - NBTTagCompound var2 = new NBTTagCompound(); -- this.updateTagCompound(var2, var1); -+ this.updateTagCompound(var2, par1NBTTagCompound); - return var2; - } - -- private void updateTagCompound(NBTTagCompound var1, NBTTagCompound var2) { -- var1.setLong("RandomSeed", this.randomSeed); -- var1.setString("generatorName", this.terrainType.getWorldTypeName()); -- var1.setInteger("generatorVersion", this.terrainType.getGeneratorVersion()); -- var1.setString("generatorOptions", this.c); -- var1.setInteger("GameType", this.theGameType.getID()); -- var1.setBoolean("MapFeatures", this.mapFeaturesEnabled); -- var1.setInteger("SpawnX", this.spawnX); -- var1.setInteger("SpawnY", this.spawnY); -- var1.setInteger("SpawnZ", this.spawnZ); -- var1.setLong("Time", this.totalTime); -- var1.setLong("DayTime", this.worldTime); -- var1.setLong("SizeOnDisk", this.sizeOnDisk); -- var1.setLong("LastPlayed", MinecraftServer.getCurrentTimeMillis()); -- var1.setString("LevelName", this.m); -- var1.setInteger("version", this.saveVersion); -- var1.setInteger("rainTime", this.rainTime); -- var1.setBoolean("raining", this.raining); -- var1.setInteger("thunderTime", this.thunderTime); -- var1.setBoolean("thundering", this.thundering); -- var1.setBoolean("hardcore", this.hardcore); -- var1.setBoolean("allowCommands", this.allowCommands); -- var1.setBoolean("initialized", this.initialized); -- var1.setCompoundTag("GameRules", this.theGameRules.writeGameRulesToNBT()); -- if(var2 != null) { -- var1.setCompoundTag("Player", var2); -+ private void updateTagCompound(NBTTagCompound par1NBTTagCompound, NBTTagCompound par2NBTTagCompound) { -+ par1NBTTagCompound.setLong("RandomSeed", this.randomSeed); -+ par1NBTTagCompound.setString("generatorName", this.terrainType.getWorldTypeName()); -+ par1NBTTagCompound.setInteger("generatorVersion", this.terrainType.getGeneratorVersion()); -+ par1NBTTagCompound.setString("generatorOptions", this.generatorOptions); -+ par1NBTTagCompound.setInteger("GameType", this.theGameType.getID()); -+ par1NBTTagCompound.setBoolean("MapFeatures", this.mapFeaturesEnabled); -+ par1NBTTagCompound.setInteger("SpawnX", this.spawnX); -+ par1NBTTagCompound.setInteger("SpawnY", this.spawnY); -+ par1NBTTagCompound.setInteger("SpawnZ", this.spawnZ); -+ par1NBTTagCompound.setLong("Time", this.totalTime); -+ par1NBTTagCompound.setLong("DayTime", this.worldTime); -+ par1NBTTagCompound.setLong("SizeOnDisk", this.sizeOnDisk); -+ par1NBTTagCompound.setLong("LastPlayed", MinecraftServer.getSystemTimeMillis()); -+ par1NBTTagCompound.setString("LevelName", this.levelName); -+ par1NBTTagCompound.setInteger("version", this.saveVersion); -+ par1NBTTagCompound.setInteger("rainTime", this.rainTime); -+ par1NBTTagCompound.setBoolean("raining", this.raining); -+ par1NBTTagCompound.setInteger("thunderTime", this.thunderTime); -+ par1NBTTagCompound.setBoolean("thundering", this.thundering); -+ par1NBTTagCompound.setBoolean("hardcore", this.hardcore); -+ par1NBTTagCompound.setBoolean("allowCommands", this.allowCommands); -+ par1NBTTagCompound.setBoolean("initialized", this.initialized); -+ par1NBTTagCompound.setCompoundTag("GameRules", this.theGameRules.writeGameRulesToNBT()); -+ -+ if (par2NBTTagCompound != null) { -+ par1NBTTagCompound.setCompoundTag("Player", par2NBTTagCompound); - } -- - } - -+ /** -+ * Returns the seed of current world. -+ */ - public long getSeed() { - return this.randomSeed; - } - -+ /** -+ * Returns the x spawn position -+ */ - public int getSpawnX() { - return this.spawnX; - } - -+ /** -+ * Return the Y axis spawning point of the player. -+ */ - public int getSpawnY() { - return this.spawnY; - } - -+ /** -+ * Returns the z spawn position -+ */ - public int getSpawnZ() { - return this.spawnZ; - } -@@ -202,6 +273,9 @@ - return this.totalTime; - } - -+ /** -+ * Get current world time -+ */ - public long getWorldTime() { - return this.worldTime; - } -@@ -210,104 +284,174 @@ - return this.sizeOnDisk; - } - -+ /** -+ * Returns the player's NBTTagCompound to be loaded -+ */ - public NBTTagCompound getPlayerNBTTagCompound() { - return this.playerTag; - } - -- public int getDimension() { -+ /** -+ * Returns vanilla MC dimension (-1,0,1). For custom dimension compatibility, always prefer WorldProvider.dimensionID -+ * accessed from World.provider.dimensionID -+ */ -+ public int getVanillaDimension() { - return this.dimension; - } - -- public void setSpawnX(int var1) { -- this.spawnX = var1; -- } -- -- public void setSpawnY(int var1) { -- this.spawnY = var1; -- } -- -- public void setSpawnZ(int var1) { -- this.spawnZ = var1; -- } -- -- public void incrementTotalWorldTime(long var1) { -- this.totalTime = var1; -- } -- -- public void setWorldTime(long var1) { -- this.worldTime = var1; -- } -- -- public void setSpawnPosition(int var1, int var2, int var3) { -- this.spawnX = var1; -- this.spawnY = var2; -- this.spawnZ = var3; -- } -- -+ /** -+ * Set the x spawn position to the passed in value -+ */ -+ public void setSpawnX(int par1) { -+ this.spawnX = par1; -+ } -+ -+ /** -+ * Sets the y spawn position -+ */ -+ public void setSpawnY(int par1) { -+ this.spawnY = par1; -+ } -+ -+ /** -+ * Set the z spawn position to the passed in value -+ */ -+ public void setSpawnZ(int par1) { -+ this.spawnZ = par1; -+ } -+ -+ public void incrementTotalWorldTime(long par1) { -+ this.totalTime = par1; -+ } -+ -+ /** -+ * Set current world time -+ */ -+ public void setWorldTime(long par1) { -+ this.worldTime = par1; -+ } -+ -+ /** -+ * Sets the spawn zone position. Args: x, y, z -+ */ -+ public void setSpawnPosition(int par1, int par2, int par3) { -+ this.spawnX = par1; -+ this.spawnY = par2; -+ this.spawnZ = par3; -+ } -+ -+ /** -+ * Get current world name -+ */ - public String getWorldName() { -- return this.m; -- } -- -- public void setWorldName(String var1) { -- this.m = var1; -- } -- -+ return this.levelName; -+ } -+ -+ public void setWorldName(String par1Str) { -+ this.levelName = par1Str; -+ } -+ -+ /** -+ * Returns the save version of this world -+ */ - public int getSaveVersion() { - return this.saveVersion; - } - -- public void setSaveVersion(int var1) { -- this.saveVersion = var1; -+ /** -+ * Sets the save version of the world -+ */ -+ public void setSaveVersion(int par1) { -+ this.saveVersion = par1; - } - -+ /** -+ * Return the last time the player was in this world. -+ */ - public long getLastTimePlayed() { - return this.lastTimePlayed; - } - -+ /** -+ * Returns true if it is thundering, false otherwise. -+ */ - public boolean isThundering() { - return this.thundering; - } - -- public void setThundering(boolean var1) { -- this.thundering = var1; -+ /** -+ * Sets whether it is thundering or not. -+ */ -+ public void setThundering(boolean par1) { -+ this.thundering = par1; - } - -+ /** -+ * Returns the number of ticks until next thunderbolt. -+ */ - public int getThunderTime() { - return this.thunderTime; - } - -- public void setThunderTime(int var1) { -- this.thunderTime = var1; -+ /** -+ * Defines the number of ticks until next thunderbolt. -+ */ -+ public void setThunderTime(int par1) { -+ this.thunderTime = par1; - } - -+ /** -+ * Returns true if it is raining, false otherwise. -+ */ - public boolean isRaining() { - return this.raining; - } - -- public void setRaining(boolean var1) { -- this.raining = var1; -+ /** -+ * Sets whether it is raining or not. -+ */ -+ public void setRaining(boolean par1) { -+ this.raining = par1; - } - -+ /** -+ * Return the number of ticks until rain. -+ */ - public int getRainTime() { - return this.rainTime; - } - -- public void setRainTime(int var1) { -- this.rainTime = var1; -+ /** -+ * Sets the number of ticks until rain. -+ */ -+ public void setRainTime(int par1) { -+ this.rainTime = par1; - } - -+ /** -+ * Gets the GameType. -+ */ - public EnumGameType getGameType() { - return this.theGameType; - } - -+ /** -+ * Get whether the map features (e.g. strongholds) generation is enabled or disabled. -+ */ - public boolean isMapFeaturesEnabled() { - return this.mapFeaturesEnabled; - } - -- public void setGameType(EnumGameType var1) { -- this.theGameType = var1; -+ /** -+ * Sets the GameType. -+ */ -+ public void setGameType(EnumGameType par1EnumGameType) { -+ this.theGameType = par1EnumGameType; - } - -+ /** -+ * Returns true if hardcore mode is enabled, otherwise false -+ */ - public boolean isHardcoreModeEnabled() { - return this.hardcore; - } -@@ -316,107 +460,134 @@ - return this.terrainType; - } - -- public void setTerrainType(WorldType var1) { -- this.terrainType = var1; -+ public void setTerrainType(WorldType par1WorldType) { -+ this.terrainType = par1WorldType; - } - - public String getGeneratorOptions() { -- return this.c; -+ return this.generatorOptions; - } - -+ /** -+ * Returns true if commands are allowed on this World. -+ */ - public boolean areCommandsAllowed() { - return this.allowCommands; - } - -+ /** -+ * Returns true if the World is initialized. -+ */ - public boolean isInitialized() { - return this.initialized; - } - -- public void setServerInitialized(boolean var1) { -- this.initialized = var1; -+ /** -+ * Sets the initialization status of the World. -+ */ -+ public void setServerInitialized(boolean par1) { -+ this.initialized = par1; - } - -+ /** -+ * Gets the GameRules class Instance. -+ */ - public GameRules getGameRulesInstance() { - return this.theGameRules; - } - -- public void addToCrashReport(CrashReportCategory var1) { -- var1.addCrashSectionCallable("Level seed", new CallableLevelSeed(this)); -- var1.addCrashSectionCallable("Level generator", new CallableLevelGenerator(this)); -- var1.addCrashSectionCallable("Level generator options", new CallableLevelGeneratorOptions(this)); -- var1.addCrashSectionCallable("Level spawn location", new CallableLevelSpawnLocation(this)); -- var1.addCrashSectionCallable("Level time", new CallableLevelTime(this)); -- var1.addCrashSectionCallable("Level dimension", new CallableLevelDimension(this)); -- var1.addCrashSectionCallable("Level storage version", new CallableLevelStorageVersion(this)); -- var1.addCrashSectionCallable("Level weather", new CallableLevelWeather(this)); -- var1.addCrashSectionCallable("Level game mode", new CallableLevelGamemode(this)); -- } -- -- static WorldType getTerrainTypeOfWorld(WorldInfo var0) { -- return var0.terrainType; -- } -- -- static boolean getMapFeaturesEnabled(WorldInfo var0) { -- return var0.mapFeaturesEnabled; -- } -- -- static String getWorldGeneratorOptions(WorldInfo var0) { -- return var0.c; -- } -- -- static int getSpawnXCoordinate(WorldInfo var0) { -- return var0.spawnX; -- } -- -- static int getSpawnYCoordinate(WorldInfo var0) { -- return var0.spawnY; -- } -- -- static int getSpawnZCoordinate(WorldInfo var0) { -- return var0.spawnZ; -- } -- -- static long func_85126_g(WorldInfo var0) { -- return var0.totalTime; -- } -- -- static long getWorldTime(WorldInfo var0) { -- return var0.worldTime; -- } -- -- static int func_85122_i(WorldInfo var0) { -- return var0.dimension; -- } -- -- static int getSaveVersion(WorldInfo var0) { -- return var0.saveVersion; -- } -- -- static int getRainTime(WorldInfo var0) { -- return var0.rainTime; -- } -- -- static boolean getRaining(WorldInfo var0) { -- return var0.raining; -- } -- -- static int getThunderTime(WorldInfo var0) { -- return var0.thunderTime; -- } -- -- static boolean getThundering(WorldInfo var0) { -- return var0.thundering; -- } -- -- static EnumGameType getGameType(WorldInfo var0) { -- return var0.theGameType; -- } -- -- static boolean func_85117_p(WorldInfo var0) { -- return var0.hardcore; -- } -- -- static boolean func_85131_q(WorldInfo var0) { -- return var0.allowCommands; -+ /** -+ * Adds this WorldInfo instance to the crash report. -+ */ -+ public void addToCrashReport(CrashReportCategory par1CrashReportCategory) { -+ par1CrashReportCategory.addCrashSectionCallable("Level seed", new CallableLevelSeed(this)); -+ par1CrashReportCategory.addCrashSectionCallable("Level generator", new CallableLevelGenerator(this)); -+ par1CrashReportCategory.addCrashSectionCallable("Level generator options", new CallableLevelGeneratorOptions(this)); -+ par1CrashReportCategory.addCrashSectionCallable("Level spawn location", new CallableLevelSpawnLocation(this)); -+ par1CrashReportCategory.addCrashSectionCallable("Level time", new CallableLevelTime(this)); -+ par1CrashReportCategory.addCrashSectionCallable("Level dimension", new CallableLevelDimension(this)); -+ par1CrashReportCategory.addCrashSectionCallable("Level storage version", new CallableLevelStorageVersion(this)); -+ par1CrashReportCategory.addCrashSectionCallable("Level weather", new CallableLevelWeather(this)); -+ par1CrashReportCategory.addCrashSectionCallable("Level game mode", new CallableLevelGamemode(this)); -+ } -+ -+ /** -+ * Return the terrain type of a world -+ */ -+ static WorldType getTerrainTypeOfWorld(WorldInfo par0WorldInfo) { -+ return par0WorldInfo.terrainType; -+ } -+ -+ /** -+ * Return the map feautures enabled of a world -+ */ -+ static boolean getMapFeaturesEnabled(WorldInfo par0WorldInfo) { -+ return par0WorldInfo.mapFeaturesEnabled; -+ } -+ -+ static String getWorldGeneratorOptions(WorldInfo par0WorldInfo) { -+ return par0WorldInfo.generatorOptions; -+ } -+ -+ static int getSpawnXCoordinate(WorldInfo par0WorldInfo) { -+ return par0WorldInfo.spawnX; -+ } -+ -+ static int getSpawnYCoordinate(WorldInfo par0WorldInfo) { -+ return par0WorldInfo.spawnY; -+ } -+ -+ static int getSpawnZCoordinate(WorldInfo par0WorldInfo) { -+ return par0WorldInfo.spawnZ; -+ } -+ -+ static long func_85126_g(WorldInfo par0WorldInfo) { -+ return par0WorldInfo.totalTime; -+ } -+ -+ static long getWorldTime(WorldInfo par0WorldInfo) { -+ return par0WorldInfo.worldTime; -+ } -+ -+ static int func_85122_i(WorldInfo par0WorldInfo) { -+ return par0WorldInfo.dimension; -+ } -+ -+ static int getSaveVersion(WorldInfo par0WorldInfo) { -+ return par0WorldInfo.saveVersion; -+ } -+ -+ static int getRainTime(WorldInfo par0WorldInfo) { -+ return par0WorldInfo.rainTime; -+ } -+ -+ /** -+ * Returns wether it's raining or not. -+ */ -+ static boolean getRaining(WorldInfo par0WorldInfo) { -+ return par0WorldInfo.raining; -+ } -+ -+ static int getThunderTime(WorldInfo par0WorldInfo) { -+ return par0WorldInfo.thunderTime; -+ } -+ -+ /** -+ * Returns wether it's thundering or not. -+ */ -+ static boolean getThundering(WorldInfo par0WorldInfo) { -+ return par0WorldInfo.thundering; -+ } -+ -+ static EnumGameType getGameType(WorldInfo par0WorldInfo) { -+ return par0WorldInfo.theGameType; -+ } -+ -+ static boolean func_85117_p(WorldInfo par0WorldInfo) { -+ return par0WorldInfo.hardcore; -+ } -+ -+ static boolean func_85131_q(WorldInfo par0WorldInfo) { -+ return par0WorldInfo.allowCommands; - } - } ---- net/minecraft/src/MinecraftINNER13.java -+++ net/minecraft/src/MinecraftINNER13.java -@@ -5,8 +5,8 @@ - class MinecraftINNER13 implements Callable { - final Minecraft field_142056_a; - -- MinecraftINNER13(Minecraft var1) { -- this.field_142056_a = var1; -+ MinecraftINNER13(Minecraft par1Minecraft) { -+ this.field_142056_a = par1Minecraft; - } - - public String func_142055_a() { ---- net/minecraft/src/BlockPressurePlateWeighted.java -+++ net/minecraft/src/BlockPressurePlateWeighted.java -@@ -3,26 +3,33 @@ - import java.util.Iterator; - - public class BlockPressurePlateWeighted extends BlockBasePressurePlate { -+ -+ /** The maximum number of items the plate weights. */ - private final int maxItemsWeighted; - -- protected BlockPressurePlateWeighted(int var1, String var2, Material var3, int var4) { -- super(var1, var2, var3); -- this.maxItemsWeighted = var4; -+ protected BlockPressurePlateWeighted(int par1, String par2Str, Material par3Material, int par4) { -+ super(par1, par2Str, par3Material); -+ this.maxItemsWeighted = par4; - } - -- protected int getPlateState(World var1, int var2, int var3, int var4) { -+ /** -+ * Returns the current state of the pressure plate. Returns a value between 0 and 15 based on the number of items on -+ * it. -+ */ -+ protected int getPlateState(World par1World, int par2, int par3, int par4) { - int var5 = 0; -- Iterator var6 = var1.getEntitiesWithinAABB(EntityItem.class, this.getSensitiveAABB(var2, var3, var4)).iterator(); -+ Iterator var6 = par1World.getEntitiesWithinAABB(EntityItem.class, this.getSensitiveAABB(par2, par3, par4)).iterator(); - -- while(var6.hasNext()) { -+ while (var6.hasNext()) { - EntityItem var7 = (EntityItem)var6.next(); - var5 += var7.getEntityItem().stackSize; -- if(var5 >= this.maxItemsWeighted) { -+ -+ if (var5 >= this.maxItemsWeighted) { - break; - } - } - -- if(var5 <= 0) { -+ if (var5 <= 0) { - return 0; - } else { - float var8 = (float)Math.min(this.maxItemsWeighted, var5) / (float)this.maxItemsWeighted; -@@ -30,15 +37,24 @@ - } - } - -- protected int getPowerSupply(int var1) { -- return var1; -- } -- -- protected int getMetaFromWeight(int var1) { -- return var1; -- } -- -- public int tickRate(World var1) { -+ /** -+ * Argument is metadata. Returns power level (0-15) -+ */ -+ protected int getPowerSupply(int par1) { -+ return par1; -+ } -+ -+ /** -+ * Argument is weight (0-15). Return the metadata to be set because of it. -+ */ -+ protected int getMetaFromWeight(int par1) { -+ return par1; -+ } -+ -+ /** -+ * How many world ticks before ticking -+ */ -+ public int tickRate(World par1World) { - return 10; - } - } ---- net/minecraft/src/BlockButtonWood.java -+++ net/minecraft/src/BlockButtonWood.java -@@ -1,11 +1,14 @@ - package net.minecraft.src; - - public class BlockButtonWood extends BlockButton { -- protected BlockButtonWood(int var1) { -- super(var1, true); -+ protected BlockButtonWood(int par1) { -+ super(par1, true); - } - -- public Icon getIcon(int var1, int var2) { -+ /** -+ * From the specified side and block metadata retrieves the blocks texture. Args: side, metadata -+ */ -+ public Icon getIcon(int par1, int par2) { - return Block.planks.getBlockTextureFromSide(1); - } - } ---- net/minecraft/src/ItemCoal.java -+++ net/minecraft/src/ItemCoal.java -@@ -5,28 +5,38 @@ - public class ItemCoal extends Item { - private Icon field_111220_a; - -- public ItemCoal(int var1) { -- super(var1); -+ public ItemCoal(int par1) { -+ super(par1); - this.setHasSubtypes(true); - this.setMaxDamage(0); - this.setCreativeTab(CreativeTabs.tabMaterials); - } - -- public String getUnlocalizedName(ItemStack var1) { -- return var1.getItemDamage() == 1 ? "item.charcoal" : "item.coal"; -- } -- -- public void getSubItems(int var1, CreativeTabs var2, List var3) { -- var3.add(new ItemStack(var1, 1, 0)); -- var3.add(new ItemStack(var1, 1, 1)); -- } -- -- public Icon getIconFromDamage(int var1) { -- return var1 == 1 ? this.field_111220_a : super.getIconFromDamage(var1); -- } -- -- public void registerIcons(IconRegister var1) { -- super.registerIcons(var1); -- this.field_111220_a = var1.registerIcon("charcoal"); -+ /** -+ * Returns the unlocalized name of this item. This version accepts an ItemStack so different stacks can have different -+ * names based on their damage or NBT. -+ */ -+ public String getUnlocalizedName(ItemStack par1ItemStack) { -+ return par1ItemStack.getItemDamage() == 1 ? "item.charcoal" : "item.coal"; -+ } -+ -+ /** -+ * returns a list of items with the same ID, but different meta (eg: dye returns 16 items) -+ */ -+ public void getSubItems(int par1, CreativeTabs par2CreativeTabs, List par3List) { -+ par3List.add(new ItemStack(par1, 1, 0)); -+ par3List.add(new ItemStack(par1, 1, 1)); -+ } -+ -+ /** -+ * Gets an icon index based on an item's damage value -+ */ -+ public Icon getIconFromDamage(int par1) { -+ return par1 == 1 ? this.field_111220_a : super.getIconFromDamage(par1); -+ } -+ -+ public void registerIcons(IconRegister par1IconRegister) { -+ super.registerIcons(par1IconRegister); -+ this.field_111220_a = par1IconRegister.registerIcon("charcoal"); - } - } ---- net/minecraft/src/Packet33RelEntityMoveLook.java -+++ net/minecraft/src/Packet33RelEntityMoveLook.java -@@ -9,34 +9,43 @@ - this.rotating = true; - } - -- public Packet33RelEntityMoveLook(int var1, byte var2, byte var3, byte var4, byte var5, byte var6) { -- super(var1); -- this.xPosition = var2; -- this.yPosition = var3; -- this.zPosition = var4; -- this.yaw = var5; -- this.pitch = var6; -+ public Packet33RelEntityMoveLook(int par1, byte par2, byte par3, byte par4, byte par5, byte par6) { -+ super(par1); -+ this.xPosition = par2; -+ this.yPosition = par3; -+ this.zPosition = par4; -+ this.yaw = par5; -+ this.pitch = par6; - this.rotating = true; - } - -- public void readPacketData(DataInput var1) throws IOException { -- super.readPacketData(var1); -- this.xPosition = var1.readByte(); -- this.yPosition = var1.readByte(); -- this.zPosition = var1.readByte(); -- this.yaw = var1.readByte(); -- this.pitch = var1.readByte(); -- } -- -- public void writePacketData(DataOutput var1) throws IOException { -- super.writePacketData(var1); -- var1.writeByte(this.xPosition); -- var1.writeByte(this.yPosition); -- var1.writeByte(this.zPosition); -- var1.writeByte(this.yaw); -- var1.writeByte(this.pitch); -- } -- -+ /** -+ * Abstract. Reads the raw packet data from the data stream. -+ */ -+ public void readPacketData(DataInput par1DataInput) throws IOException { -+ super.readPacketData(par1DataInput); -+ this.xPosition = par1DataInput.readByte(); -+ this.yPosition = par1DataInput.readByte(); -+ this.zPosition = par1DataInput.readByte(); -+ this.yaw = par1DataInput.readByte(); -+ this.pitch = par1DataInput.readByte(); -+ } -+ -+ /** -+ * Abstract. Writes the raw packet data to the data stream. -+ */ -+ public void writePacketData(DataOutput par1DataOutput) throws IOException { -+ super.writePacketData(par1DataOutput); -+ par1DataOutput.writeByte(this.xPosition); -+ par1DataOutput.writeByte(this.yPosition); -+ par1DataOutput.writeByte(this.zPosition); -+ par1DataOutput.writeByte(this.yaw); -+ par1DataOutput.writeByte(this.pitch); -+ } -+ -+ /** -+ * Abstract. Return the size of the packet (not counting the header). -+ */ - public int getPacketSize() { - return 9; - } ---- /dev/null -+++ org/spoutcraft/api/material/Weapon.java -@@ -1,0 +1,23 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.api.material; -+ -+public interface Weapon extends Item { -+} ---- net/minecraft/src/ChunkLoader.java -+++ net/minecraft/src/ChunkLoader.java -@@ -1,75 +1,87 @@ - package net.minecraft.src; - - public class ChunkLoader { -- public static AnvilConverterData load(NBTTagCompound var0) { -- int var1 = var0.getInteger("xPos"); -- int var2 = var0.getInteger("zPos"); -+ public static AnvilConverterData load(NBTTagCompound par0NBTTagCompound) { -+ int var1 = par0NBTTagCompound.getInteger("xPos"); -+ int var2 = par0NBTTagCompound.getInteger("zPos"); - AnvilConverterData var3 = new AnvilConverterData(var1, var2); -- var3.blocks = var0.getByteArray("Blocks"); -- var3.data = new NibbleArrayReader(var0.getByteArray("Data"), 7); -- var3.skyLight = new NibbleArrayReader(var0.getByteArray("SkyLight"), 7); -- var3.blockLight = new NibbleArrayReader(var0.getByteArray("BlockLight"), 7); -- var3.heightmap = var0.getByteArray("HeightMap"); -- var3.terrainPopulated = var0.getBoolean("TerrainPopulated"); -- var3.entities = var0.getTagList("Entities"); -- var3.tileEntities = var0.getTagList("TileEntities"); -- var3.tileTicks = var0.getTagList("TileTicks"); -+ var3.blocks = par0NBTTagCompound.getByteArray("Blocks"); -+ var3.data = new NibbleArrayReader(par0NBTTagCompound.getByteArray("Data"), 7); -+ var3.skyLight = new NibbleArrayReader(par0NBTTagCompound.getByteArray("SkyLight"), 7); -+ var3.blockLight = new NibbleArrayReader(par0NBTTagCompound.getByteArray("BlockLight"), 7); -+ var3.heightmap = par0NBTTagCompound.getByteArray("HeightMap"); -+ var3.terrainPopulated = par0NBTTagCompound.getBoolean("TerrainPopulated"); -+ var3.entities = par0NBTTagCompound.getTagList("Entities"); -+ var3.tileEntities = par0NBTTagCompound.getTagList("TileEntities"); -+ var3.tileTicks = par0NBTTagCompound.getTagList("TileTicks"); - - try { -- var3.lastUpdated = var0.getLong("LastUpdate"); -+ var3.lastUpdated = par0NBTTagCompound.getLong("LastUpdate"); - } catch (ClassCastException var5) { -- var3.lastUpdated = (long)var0.getInteger("LastUpdate"); -+ var3.lastUpdated = (long)par0NBTTagCompound.getInteger("LastUpdate"); - } - - return var3; - } - -- public static void convertToAnvilFormat(AnvilConverterData var0, NBTTagCompound var1, WorldChunkManager var2) { -- var1.setInteger("xPos", var0.x); -- var1.setInteger("zPos", var0.z); -- var1.setLong("LastUpdate", var0.lastUpdated); -- int[] var3 = new int[var0.heightmap.length]; -+ public static void convertToAnvilFormat(AnvilConverterData par0AnvilConverterData, NBTTagCompound par1NBTTagCompound, WorldChunkManager par2WorldChunkManager) { -+ par1NBTTagCompound.setInteger("xPos", par0AnvilConverterData.x); -+ par1NBTTagCompound.setInteger("zPos", par0AnvilConverterData.z); -+ par1NBTTagCompound.setLong("LastUpdate", par0AnvilConverterData.lastUpdated); -+ int[] var3 = new int[par0AnvilConverterData.heightmap.length]; - -- for(int var4 = 0; var4 < var0.heightmap.length; ++var4) { -- var3[var4] = var0.heightmap[var4]; -+ for (int var4 = 0; var4 < par0AnvilConverterData.heightmap.length; ++var4) { -+ var3[var4] = par0AnvilConverterData.heightmap[var4]; - } - -- var1.setIntArray("HeightMap", var3); -- var1.setBoolean("TerrainPopulated", var0.terrainPopulated); -+ par1NBTTagCompound.setIntArray("HeightMap", var3); -+ par1NBTTagCompound.setBoolean("TerrainPopulated", par0AnvilConverterData.terrainPopulated); - NBTTagList var16 = new NBTTagList("Sections"); -- - int var7; -- for(int var5 = 0; var5 < 8; ++var5) { -+ -+ for (int var5 = 0; var5 < 8; ++var5) { - boolean var6 = true; - -- for(var7 = 0; var7 < 16 && var6; ++var7) { -- for(int var8 = 0; var8 < 16 && var6; ++var8) { -- for(int var9 = 0; var9 < 16; ++var9) { -- int var10 = var7 << 11 | var9 << 7 | var8 + (var5 << 4); -- byte var11 = var0.blocks[var10]; -- if(var11 != 0) { -+ for (var7 = 0; var7 < 16 && var6; ++var7) { -+ int var8 = 0; -+ -+ while (var8 < 16 && var6) { -+ int var9 = 0; -+ -+ while (true) { -+ if (var9 < 16) { -+ int var10 = var7 << 11 | var9 << 7 | var8 + (var5 << 4); -+ byte var11 = par0AnvilConverterData.blocks[var10]; -+ -+ if (var11 == 0) { -+ ++var9; -+ continue; -+ } -+ - var6 = false; -- break; - } -+ -+ ++var8; -+ break; - } - } - } - -- if(!var6) { -+ if (!var6) { - byte[] var19 = new byte[4096]; - NibbleArray var20 = new NibbleArray(var19.length, 4); - NibbleArray var21 = new NibbleArray(var19.length, 4); - NibbleArray var22 = new NibbleArray(var19.length, 4); - -- for(int var23 = 0; var23 < 16; ++var23) { -- for(int var12 = 0; var12 < 16; ++var12) { -- for(int var13 = 0; var13 < 16; ++var13) { -+ for (int var23 = 0; var23 < 16; ++var23) { -+ for (int var12 = 0; var12 < 16; ++var12) { -+ for (int var13 = 0; var13 < 16; ++var13) { - int var14 = var23 << 11 | var13 << 7 | var12 + (var5 << 4); -- byte var15 = var0.blocks[var14]; -+ byte var15 = par0AnvilConverterData.blocks[var14]; - var19[var12 << 8 | var13 << 4 | var23] = (byte)(var15 & 255); -- var20.set(var23, var12, var13, var0.data.get(var23, var12 + (var5 << 4), var13)); -- var21.set(var23, var12, var13, var0.skyLight.get(var23, var12 + (var5 << 4), var13)); -- var22.set(var23, var12, var13, var0.blockLight.get(var23, var12 + (var5 << 4), var13)); -+ var20.set(var23, var12, var13, par0AnvilConverterData.data.get(var23, var12 + (var5 << 4), var13)); -+ var21.set(var23, var12, var13, par0AnvilConverterData.skyLight.get(var23, var12 + (var5 << 4), var13)); -+ var22.set(var23, var12, var13, par0AnvilConverterData.blockLight.get(var23, var12 + (var5 << 4), var13)); - } - } - } -@@ -84,21 +96,21 @@ - } - } - -- var1.setTag("Sections", var16); -+ par1NBTTagCompound.setTag("Sections", var16); - byte[] var17 = new byte[256]; - -- for(int var18 = 0; var18 < 16; ++var18) { -- for(var7 = 0; var7 < 16; ++var7) { -- var17[var7 << 4 | var18] = (byte)(var2.getBiomeGenAt(var0.x << 4 | var18, var0.z << 4 | var7).biomeID & 255); -+ for (int var18 = 0; var18 < 16; ++var18) { -+ for (var7 = 0; var7 < 16; ++var7) { -+ var17[var7 << 4 | var18] = (byte)(par2WorldChunkManager.getBiomeGenAt(par0AnvilConverterData.x << 4 | var18, par0AnvilConverterData.z << 4 | var7).biomeID & 255); - } - } - -- var1.setByteArray("Biomes", var17); -- var1.setTag("Entities", var0.entities); -- var1.setTag("TileEntities", var0.tileEntities); -- if(var0.tileTicks != null) { -- var1.setTag("TileTicks", var0.tileTicks); -- } -+ par1NBTTagCompound.setByteArray("Biomes", var17); -+ par1NBTTagCompound.setTag("Entities", par0AnvilConverterData.entities); -+ par1NBTTagCompound.setTag("TileEntities", par0AnvilConverterData.tileEntities); - -+ if (par0AnvilConverterData.tileTicks != null) { -+ par1NBTTagCompound.setTag("TileTicks", par0AnvilConverterData.tileTicks); -+ } - } - } ---- /dev/null -+++ org/spoutcraft/api/util/MutableIntegerVector.java -@@ -1,0 +1,68 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.api.util; -+ -+public class MutableIntegerVector extends MutableVector { -+ public MutableIntegerVector(int x, int y, int z) { -+ this.x = x; -+ this.y = y; -+ this.z = z; -+ } -+ -+ public int getIntX() { -+ return (int) x; -+ } -+ -+ public int getIntY() { -+ return (int) y; -+ } -+ -+ public int getIntZ() { -+ return (int) z; -+ } -+ -+ public void setIntX(int x) { -+ this.x = x; -+ } -+ -+ public void setIntY(int y) { -+ this.y = y; -+ } -+ -+ public void setIntZ(int z) { -+ this.z = z; -+ } -+ -+ @Override -+ public int hashCode() { -+ int z = getIntZ(); -+ return getIntX() + (getIntY() << 24) + (z << 12) + (z >> 20); -+ } -+ -+ @Override -+ public boolean equals(Object o) { -+ if (!(o instanceof MutableIntegerVector)) { -+ return false; -+ } -+ MutableIntegerVector other = (MutableIntegerVector) o; -+ -+ return this.getIntX() == other.getIntX() && this.getIntY() == other.getIntY() && this.getIntZ() == other.getIntZ(); -+ } -+} ---- net/minecraft/src/StructureNetherBridgePieces.java -+++ net/minecraft/src/StructureNetherBridgePieces.java -@@ -4,8 +4,8 @@ - import java.util.Random; - - public class StructureNetherBridgePieces { -- private static final StructureNetherBridgePieceWeight[] primaryComponents = new StructureNetherBridgePieceWeight[]{new StructureNetherBridgePieceWeight(ComponentNetherBridgeStraight.class, 30, 0, true), new StructureNetherBridgePieceWeight(ComponentNetherBridgeCrossing3.class, 10, 4), new StructureNetherBridgePieceWeight(ComponentNetherBridgeCrossing.class, 10, 4), new StructureNetherBridgePieceWeight(ComponentNetherBridgeStairs.class, 10, 3), new StructureNetherBridgePieceWeight(ComponentNetherBridgeThrone.class, 5, 2), new StructureNetherBridgePieceWeight(ComponentNetherBridgeEntrance.class, 5, 1)}; -- private static final StructureNetherBridgePieceWeight[] secondaryComponents = new StructureNetherBridgePieceWeight[]{new StructureNetherBridgePieceWeight(ComponentNetherBridgeCorridor5.class, 25, 0, true), new StructureNetherBridgePieceWeight(ComponentNetherBridgeCrossing2.class, 15, 5), new StructureNetherBridgePieceWeight(ComponentNetherBridgeCorridor2.class, 5, 10), new StructureNetherBridgePieceWeight(ComponentNetherBridgeCorridor.class, 5, 10), new StructureNetherBridgePieceWeight(ComponentNetherBridgeCorridor3.class, 10, 3, true), new StructureNetherBridgePieceWeight(ComponentNetherBridgeCorridor4.class, 7, 2), new StructureNetherBridgePieceWeight(ComponentNetherBridgeNetherStalkRoom.class, 5, 2)}; -+ private static final StructureNetherBridgePieceWeight[] primaryComponents = new StructureNetherBridgePieceWeight[] {new StructureNetherBridgePieceWeight(ComponentNetherBridgeStraight.class, 30, 0, true), new StructureNetherBridgePieceWeight(ComponentNetherBridgeCrossing3.class, 10, 4), new StructureNetherBridgePieceWeight(ComponentNetherBridgeCrossing.class, 10, 4), new StructureNetherBridgePieceWeight(ComponentNetherBridgeStairs.class, 10, 3), new StructureNetherBridgePieceWeight(ComponentNetherBridgeThrone.class, 5, 2), new StructureNetherBridgePieceWeight(ComponentNetherBridgeEntrance.class, 5, 1)}; -+ private static final StructureNetherBridgePieceWeight[] secondaryComponents = new StructureNetherBridgePieceWeight[] {new StructureNetherBridgePieceWeight(ComponentNetherBridgeCorridor5.class, 25, 0, true), new StructureNetherBridgePieceWeight(ComponentNetherBridgeCrossing2.class, 15, 5), new StructureNetherBridgePieceWeight(ComponentNetherBridgeCorridor2.class, 5, 10), new StructureNetherBridgePieceWeight(ComponentNetherBridgeCorridor.class, 5, 10), new StructureNetherBridgePieceWeight(ComponentNetherBridgeCorridor3.class, 10, 3, true), new StructureNetherBridgePieceWeight(ComponentNetherBridgeCorridor4.class, 7, 2), new StructureNetherBridgePieceWeight(ComponentNetherBridgeNetherStalkRoom.class, 5, 2)}; - - public static void func_143049_a() { - MapGenStructureIO.func_143031_a(ComponentNetherBridgeCrossing3.class, "NeBCr"); -@@ -25,42 +25,43 @@ - MapGenStructureIO.func_143031_a(ComponentNetherBridgeStartPiece.class, "NeStart"); - } - -- private static ComponentNetherBridgePiece createNextComponentRandom(StructureNetherBridgePieceWeight var0, List var1, Random var2, int var3, int var4, int var5, int var6, int var7) { -- Class var8 = var0.a; -+ private static ComponentNetherBridgePiece createNextComponentRandom(StructureNetherBridgePieceWeight par0StructureNetherBridgePieceWeight, List par1List, Random par2Random, int par3, int par4, int par5, int par6, int par7) { -+ Class var8 = par0StructureNetherBridgePieceWeight.weightClass; - Object var9 = null; -- if(var8 == ComponentNetherBridgeStraight.class) { -- var9 = ComponentNetherBridgeStraight.createValidComponent(var1, var2, var3, var4, var5, var6, var7); -- } else if(var8 == ComponentNetherBridgeCrossing3.class) { -- var9 = ComponentNetherBridgeCrossing3.createValidComponent(var1, var2, var3, var4, var5, var6, var7); -- } else if(var8 == ComponentNetherBridgeCrossing.class) { -- var9 = ComponentNetherBridgeCrossing.createValidComponent(var1, var2, var3, var4, var5, var6, var7); -- } else if(var8 == ComponentNetherBridgeStairs.class) { -- var9 = ComponentNetherBridgeStairs.createValidComponent(var1, var2, var3, var4, var5, var6, var7); -- } else if(var8 == ComponentNetherBridgeThrone.class) { -- var9 = ComponentNetherBridgeThrone.createValidComponent(var1, var2, var3, var4, var5, var6, var7); -- } else if(var8 == ComponentNetherBridgeEntrance.class) { -- var9 = ComponentNetherBridgeEntrance.createValidComponent(var1, var2, var3, var4, var5, var6, var7); -- } else if(var8 == ComponentNetherBridgeCorridor5.class) { -- var9 = ComponentNetherBridgeCorridor5.createValidComponent(var1, var2, var3, var4, var5, var6, var7); -- } else if(var8 == ComponentNetherBridgeCorridor2.class) { -- var9 = ComponentNetherBridgeCorridor2.createValidComponent(var1, var2, var3, var4, var5, var6, var7); -- } else if(var8 == ComponentNetherBridgeCorridor.class) { -- var9 = ComponentNetherBridgeCorridor.createValidComponent(var1, var2, var3, var4, var5, var6, var7); -- } else if(var8 == ComponentNetherBridgeCorridor3.class) { -- var9 = ComponentNetherBridgeCorridor3.createValidComponent(var1, var2, var3, var4, var5, var6, var7); -- } else if(var8 == ComponentNetherBridgeCorridor4.class) { -- var9 = ComponentNetherBridgeCorridor4.createValidComponent(var1, var2, var3, var4, var5, var6, var7); -- } else if(var8 == ComponentNetherBridgeCrossing2.class) { -- var9 = ComponentNetherBridgeCrossing2.createValidComponent(var1, var2, var3, var4, var5, var6, var7); -- } else if(var8 == ComponentNetherBridgeNetherStalkRoom.class) { -- var9 = ComponentNetherBridgeNetherStalkRoom.createValidComponent(var1, var2, var3, var4, var5, var6, var7); -+ -+ if (var8 == ComponentNetherBridgeStraight.class) { -+ var9 = ComponentNetherBridgeStraight.createValidComponent(par1List, par2Random, par3, par4, par5, par6, par7); -+ } else if (var8 == ComponentNetherBridgeCrossing3.class) { -+ var9 = ComponentNetherBridgeCrossing3.createValidComponent(par1List, par2Random, par3, par4, par5, par6, par7); -+ } else if (var8 == ComponentNetherBridgeCrossing.class) { -+ var9 = ComponentNetherBridgeCrossing.createValidComponent(par1List, par2Random, par3, par4, par5, par6, par7); -+ } else if (var8 == ComponentNetherBridgeStairs.class) { -+ var9 = ComponentNetherBridgeStairs.createValidComponent(par1List, par2Random, par3, par4, par5, par6, par7); -+ } else if (var8 == ComponentNetherBridgeThrone.class) { -+ var9 = ComponentNetherBridgeThrone.createValidComponent(par1List, par2Random, par3, par4, par5, par6, par7); -+ } else if (var8 == ComponentNetherBridgeEntrance.class) { -+ var9 = ComponentNetherBridgeEntrance.createValidComponent(par1List, par2Random, par3, par4, par5, par6, par7); -+ } else if (var8 == ComponentNetherBridgeCorridor5.class) { -+ var9 = ComponentNetherBridgeCorridor5.createValidComponent(par1List, par2Random, par3, par4, par5, par6, par7); -+ } else if (var8 == ComponentNetherBridgeCorridor2.class) { -+ var9 = ComponentNetherBridgeCorridor2.createValidComponent(par1List, par2Random, par3, par4, par5, par6, par7); -+ } else if (var8 == ComponentNetherBridgeCorridor.class) { -+ var9 = ComponentNetherBridgeCorridor.createValidComponent(par1List, par2Random, par3, par4, par5, par6, par7); -+ } else if (var8 == ComponentNetherBridgeCorridor3.class) { -+ var9 = ComponentNetherBridgeCorridor3.createValidComponent(par1List, par2Random, par3, par4, par5, par6, par7); -+ } else if (var8 == ComponentNetherBridgeCorridor4.class) { -+ var9 = ComponentNetherBridgeCorridor4.createValidComponent(par1List, par2Random, par3, par4, par5, par6, par7); -+ } else if (var8 == ComponentNetherBridgeCrossing2.class) { -+ var9 = ComponentNetherBridgeCrossing2.createValidComponent(par1List, par2Random, par3, par4, par5, par6, par7); -+ } else if (var8 == ComponentNetherBridgeNetherStalkRoom.class) { -+ var9 = ComponentNetherBridgeNetherStalkRoom.createValidComponent(par1List, par2Random, par3, par4, par5, par6, par7); - } - - return (ComponentNetherBridgePiece)var9; - } - -- static ComponentNetherBridgePiece createNextComponent(StructureNetherBridgePieceWeight var0, List var1, Random var2, int var3, int var4, int var5, int var6, int var7) { -- return createNextComponentRandom(var0, var1, var2, var3, var4, var5, var6, var7); -+ static ComponentNetherBridgePiece createNextComponent(StructureNetherBridgePieceWeight par0StructureNetherBridgePieceWeight, List par1List, Random par2Random, int par3, int par4, int par5, int par6, int par7) { -+ return createNextComponentRandom(par0StructureNetherBridgePieceWeight, par1List, par2Random, par3, par4, par5, par6, par7); - } - - static StructureNetherBridgePieceWeight[] getPrimaryComponents() { ---- /dev/null -+++ org/spoutcraft/api/keyboard/AbstractBinding.java -@@ -1,0 +1,132 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.api.keyboard; -+ -+import org.lwjgl.input.Keyboard; -+ -+public abstract class AbstractBinding { -+ public static final byte MOD_SHIFT = 1; -+ public static final byte MOD_CTRL = 2; -+ public static final byte MOD_ALT = 4; -+ /** -+ * SUPER is Windows key on Windows, Super on Linux, CMD/Command on Mac OS X -+ * On normal keyboards, this key is located between CTRL and ALT, -+ * on Apple Keyboards (or those which are compatible with Mac OS X), the CMD key is left AND right from the Spacebar. -+ */ -+ public static final byte MOD_SUPER = 8; -+ -+ private int key = -1; -+ -+ private byte modifiers = 0; -+ -+ public void setKey(int key) { -+ this.key = key; -+ } -+ -+ public int getKey() { -+ return key; -+ } -+ -+ public byte getModifiers() { -+ return modifiers; -+ } -+ -+ public void setRawModifiers(byte mod) { -+ this.modifiers = mod; -+ } -+ -+ public void setModifier(byte mod, boolean holding) { -+ if (holding) { -+ modifiers |= mod; -+ } else { -+ modifiers &= ~mod; -+ } -+ } -+ -+ public abstract void summon(int key, boolean keyReleased, int screen); -+ -+ public boolean matches(int key, byte modifiers) { -+ return key == getKey() && modifiers == getModifiers(); -+ } -+ -+ public abstract String getTitle(); -+ -+ public boolean hasModifier(byte mod) { -+ return (modifiers & mod) != 0; -+ } -+ -+ @Override -+ public String toString() { -+ String result = ""; -+ if (hasModifier(MOD_SHIFT)) { -+ result += "SHIFT + "; -+ } -+ if (hasModifier(MOD_CTRL)) { -+ result += "CTRL + "; -+ } -+ if (hasModifier(MOD_ALT)) { -+ result += "ALT + "; -+ } -+ if (hasModifier(MOD_SUPER)) { -+ result += "SUPER + "; -+ } -+ if (key > 0) { -+ result += Keyboard.getKeyName(key); -+ } else if (key == 0) { -+ result += "No key"; -+ } else if (key < 0) { -+ result += getMouseButtonName(key); -+ } -+ -+ return result; -+ } -+ -+ public static String getMouseButtonName(int button) { -+ button += 100; -+ switch(button) { -+ case 0: -+ return "Left button"; -+ case 1: -+ return "Right button"; -+ case 2: -+ return "Middle button"; -+ default: -+ return "Button " + button; -+ } -+ } -+ -+ @Override -+ public boolean equals(Object other) { -+ if (other instanceof AbstractBinding) { -+ AbstractBinding a = (AbstractBinding) other; -+ return a == this; -+ } -+ return false; -+ } -+ -+ @Override -+ public int hashCode() { -+ final int prime = 31; -+ int result = 1; -+ result = prime * result + key; -+ result = prime * result + modifiers; -+ return result; -+ } -+} ---- net/minecraft/src/EntitySkeleton.java -+++ net/minecraft/src/EntitySkeleton.java -@@ -6,8 +6,8 @@ - private EntityAIArrowAttack aiArrowAttack = new EntityAIArrowAttack(this, 1.0D, 20, 60, 15.0F); - private EntityAIAttackOnCollide aiAttackOnCollide = new EntityAIAttackOnCollide(this, EntityPlayer.class, 1.2D, false); - -- public EntitySkeleton(World var1) { -- super(var1); -+ public EntitySkeleton(World par1World) { -+ super(par1World); - this.tasks.addTask(1, new EntityAISwimming(this)); - this.tasks.addTask(2, new EntityAIRestrictSun(this)); - this.tasks.addTask(3, new EntityAIFleeSun(this, 1.0D)); -@@ -16,10 +16,10 @@ - this.tasks.addTask(6, new EntityAILookIdle(this)); - this.targetTasks.addTask(1, new EntityAIHurtByTarget(this, false)); - this.targetTasks.addTask(2, new EntityAINearestAttackableTarget(this, EntityPlayer.class, 0, true)); -- if(var1 != null && !var1.isRemote) { -+ -+ if (par1World != null && !par1World.isRemote) { - this.setCombatTask(); - } -- - } - - protected void applyEntityAttributes() { -@@ -32,30 +32,45 @@ - this.dataWatcher.addObject(13, new Byte((byte)0)); - } - -+ /** -+ * Returns true if the newer Entity AI code should be run -+ */ - public boolean isAIEnabled() { - return true; - } - -+ /** -+ * Returns the sound this mob makes while it's alive. -+ */ - protected String getLivingSound() { - return "mob.skeleton.say"; - } - -+ /** -+ * Returns the sound this mob makes when it is hurt. -+ */ - protected String getHurtSound() { - return "mob.skeleton.hurt"; - } - -+ /** -+ * Returns the sound this mob makes on death. -+ */ - protected String getDeathSound() { - return "mob.skeleton.death"; - } - -- protected void playStepSound(int var1, int var2, int var3, int var4) { -+ /** -+ * Plays step sound at given x, y, z for the entity -+ */ -+ protected void playStepSound(int par1, int par2, int par3, int par4) { - this.playSound("mob.skeleton.step", 0.15F, 1.0F); - } - -- public boolean attackEntityAsMob(Entity var1) { -- if(super.attackEntityAsMob(var1)) { -- if(this.getSkeletonType() == 1 && var1 instanceof EntityLivingBase) { -- ((EntityLivingBase)var1).addPotionEffect(new PotionEffect(Potion.wither.id, 200)); -+ public boolean attackEntityAsMob(Entity par1Entity) { -+ if (super.attackEntityAsMob(par1Entity)) { -+ if (this.getSkeletonType() == 1 && par1Entity instanceof EntityLivingBase) { -+ ((EntityLivingBase)par1Entity).addPotionEffect(new PotionEffect(Potion.wither.id, 200)); - } - - return true; -@@ -64,20 +79,30 @@ - } - } - -+ /** -+ * Get this Entity's EnumCreatureAttribute -+ */ - public EnumCreatureAttribute getCreatureAttribute() { - return EnumCreatureAttribute.UNDEAD; - } - -+ /** -+ * Called frequently so the entity can update its state every tick as required. For example, zombies and skeletons use -+ * this to react to sunlight and start to burn. -+ */ - public void onLivingUpdate() { -- if(this.worldObj.isDaytime() && !this.worldObj.isRemote) { -+ if (this.worldObj.isDaytime() && !this.worldObj.isRemote) { - float var1 = this.getBrightness(1.0F); -- if(var1 > 0.5F && this.ab.nextFloat() * 30.0F < (var1 - 0.4F) * 2.0F && this.worldObj.canBlockSeeTheSky(MathHelper.floor_double(this.posX), MathHelper.floor_double(this.posY), MathHelper.floor_double(this.posZ))) { -+ -+ if (var1 > 0.5F && this.rand.nextFloat() * 30.0F < (var1 - 0.4F) * 2.0F && this.worldObj.canBlockSeeTheSky(MathHelper.floor_double(this.posX), MathHelper.floor_double(this.posY), MathHelper.floor_double(this.posZ))) { - boolean var2 = true; -- ItemStack var3 = this.getEquipmentInSlot(4); -- if(var3 != null) { -- if(var3.isItemStackDamageable()) { -- var3.setItemDamage(var3.getItemDamageForDisplay() + this.ab.nextInt(2)); -- if(var3.getItemDamageForDisplay() >= var3.getMaxDamage()) { -+ ItemStack var3 = this.getCurrentItemOrArmor(4); -+ -+ if (var3 != null) { -+ if (var3.isItemStackDamageable()) { -+ var3.setItemDamage(var3.getItemDamageForDisplay() + this.rand.nextInt(2)); -+ -+ if (var3.getItemDamageForDisplay() >= var3.getMaxDamage()) { - this.renderBrokenItemStack(var3); - this.setCurrentItemOrArmor(4, (ItemStack)null); - } -@@ -86,85 +111,102 @@ - var2 = false; - } - -- if(var2) { -+ if (var2) { - this.setFire(8); - } - } - } - -- if(this.worldObj.isRemote && this.getSkeletonType() == 1) { -+ if (this.worldObj.isRemote && this.getSkeletonType() == 1) { - this.setSize(0.72F, 2.34F); - } - - super.onLivingUpdate(); - } - -+ /** -+ * Handles updating while being ridden by an entity -+ */ - public void updateRidden() { - super.updateRidden(); -- if(this.ridingEntity instanceof EntityCreature) { -+ -+ if (this.ridingEntity instanceof EntityCreature) { - EntityCreature var1 = (EntityCreature)this.ridingEntity; - this.renderYawOffset = var1.renderYawOffset; - } -- - } - -- public void onDeath(DamageSource var1) { -- super.onDeath(var1); -- if(var1.getSourceOfDamage() instanceof EntityArrow && var1.getEntity() instanceof EntityPlayer) { -- EntityPlayer var2 = (EntityPlayer)var1.getEntity(); -+ /** -+ * Called when the mob's health reaches 0. -+ */ -+ public void onDeath(DamageSource par1DamageSource) { -+ super.onDeath(par1DamageSource); -+ -+ if (par1DamageSource.getSourceOfDamage() instanceof EntityArrow && par1DamageSource.getEntity() instanceof EntityPlayer) { -+ EntityPlayer var2 = (EntityPlayer)par1DamageSource.getEntity(); - double var3 = var2.posX - this.posX; - double var5 = var2.posZ - this.posZ; -- if(var3 * var3 + var5 * var5 >= 2500.0D) { -+ -+ if (var3 * var3 + var5 * var5 >= 2500.0D) { - var2.triggerAchievement(AchievementList.snipeSkeleton); - } - } -- - } - -+ /** -+ * Returns the item ID for the item the mob drops on death. -+ */ - protected int getDropItemId() { - return Item.arrow.itemID; - } - -- protected void dropFewItems(boolean var1, int var2) { -+ /** -+ * Drop 0-2 items of this living's type. @param par1 - Whether this entity has recently been hit by a player. @param -+ * par2 - Level of Looting used to kill this mob. -+ */ -+ protected void dropFewItems(boolean par1, int par2) { - int var3; - int var4; -- if(this.getSkeletonType() == 1) { -- var3 = this.ab.nextInt(3 + var2) - 1; -- -- for(var4 = 0; var4 < var3; ++var4) { -+ -+ if (this.getSkeletonType() == 1) { -+ var3 = this.rand.nextInt(3 + par2) - 1; -+ -+ for (var4 = 0; var4 < var3; ++var4) { - this.dropItem(Item.coal.itemID, 1); - } - } else { -- var3 = this.ab.nextInt(3 + var2); -+ var3 = this.rand.nextInt(3 + par2); - -- for(var4 = 0; var4 < var3; ++var4) { -+ for (var4 = 0; var4 < var3; ++var4) { - this.dropItem(Item.arrow.itemID, 1); - } - } - -- var3 = this.ab.nextInt(3 + var2); -+ var3 = this.rand.nextInt(3 + par2); - -- for(var4 = 0; var4 < var3; ++var4) { -+ for (var4 = 0; var4 < var3; ++var4) { - this.dropItem(Item.bone.itemID, 1); - } -- - } - -- protected void dropRareDrop(int var1) { -- if(this.getSkeletonType() == 1) { -+ protected void dropRareDrop(int par1) { -+ if (this.getSkeletonType() == 1) { - this.entityDropItem(new ItemStack(Item.skull.itemID, 1, 1), 0.0F); - } -- - } - -+ /** -+ * Makes entity wear random armor based on difficulty -+ */ - protected void addRandomArmor() { - super.addRandomArmor(); - this.setCurrentItemOrArmor(0, new ItemStack(Item.bow)); - } - -- public EntityLivingData onSpawnWithEgg(EntityLivingData var1) { -- var1 = super.onSpawnWithEgg(var1); -- if(this.worldObj.provider instanceof WorldProviderHell && this.getRNG().nextInt(5) > 0) { -+ public EntityLivingData onSpawnWithEgg(EntityLivingData par1EntityLivingData) { -+ par1EntityLivingData = super.onSpawnWithEgg(par1EntityLivingData); -+ -+ if (this.worldObj.provider instanceof WorldProviderHell && this.getRNG().nextInt(5) > 0) { - this.tasks.addTask(4, this.aiAttackOnCollide); - this.setSkeletonType(1); - this.setCurrentItemOrArmor(0, new ItemStack(Item.swordStone)); -@@ -175,44 +217,53 @@ - this.enchantEquipment(); - } - -- this.setCanPickUpLoot(this.ab.nextFloat() < 0.55F * this.worldObj.getLocationTensionFactor(this.posX, this.posY, this.posZ)); -- if(this.getEquipmentInSlot(4) == null) { -+ this.setCanPickUpLoot(this.rand.nextFloat() < 0.55F * this.worldObj.getLocationTensionFactor(this.posX, this.posY, this.posZ)); -+ -+ if (this.getCurrentItemOrArmor(4) == null) { - Calendar var2 = this.worldObj.getCurrentDate(); -- if(var2.get(2) + 1 == 10 && var2.get(5) == 31 && this.ab.nextFloat() < 0.25F) { -- this.setCurrentItemOrArmor(4, new ItemStack(this.ab.nextFloat() < 0.1F ? Block.pumpkinLantern : Block.pumpkin)); -+ -+ if (var2.get(2) + 1 == 10 && var2.get(5) == 31 && this.rand.nextFloat() < 0.25F) { -+ this.setCurrentItemOrArmor(4, new ItemStack(this.rand.nextFloat() < 0.1F ? Block.pumpkinLantern : Block.pumpkin)); - this.equipmentDropChances[4] = 0.0F; - } - } - -- return var1; -+ return par1EntityLivingData; - } - -+ /** -+ * sets this entity's combat AI. -+ */ - public void setCombatTask() { - this.tasks.removeTask(this.aiAttackOnCollide); - this.tasks.removeTask(this.aiArrowAttack); - ItemStack var1 = this.getHeldItem(); -- if(var1 != null && var1.itemID == Item.bow.itemID) { -+ -+ if (var1 != null && var1.itemID == Item.bow.itemID) { - this.tasks.addTask(4, this.aiArrowAttack); - } else { - this.tasks.addTask(4, this.aiAttackOnCollide); - } -- - } - -- public void attackEntityWithRangedAttack(EntityLivingBase var1, float var2) { -- EntityArrow var3 = new EntityArrow(this.worldObj, this, var1, 1.6F, (float)(14 - this.worldObj.difficultySetting * 4)); -+ /** -+ * Attack the specified entity using a ranged attack. -+ */ -+ public void attackEntityWithRangedAttack(EntityLivingBase par1EntityLivingBase, float par2) { -+ EntityArrow var3 = new EntityArrow(this.worldObj, this, par1EntityLivingBase, 1.6F, (float)(14 - this.worldObj.difficultySetting * 4)); - int var4 = EnchantmentHelper.getEnchantmentLevel(Enchantment.power.effectId, this.getHeldItem()); - int var5 = EnchantmentHelper.getEnchantmentLevel(Enchantment.punch.effectId, this.getHeldItem()); -- var3.setDamage((double)(var2 * 2.0F) + this.ab.nextGaussian() * 0.25D + (double)((float)this.worldObj.difficultySetting * 0.11F)); -- if(var4 > 0) { -+ var3.setDamage((double)(par2 * 2.0F) + this.rand.nextGaussian() * 0.25D + (double)((float)this.worldObj.difficultySetting * 0.11F)); -+ -+ if (var4 > 0) { - var3.setDamage(var3.getDamage() + (double)var4 * 0.5D + 0.5D); - } - -- if(var5 > 0) { -+ if (var5 > 0) { - var3.setKnockbackStrength(var5); - } - -- if(EnchantmentHelper.getEnchantmentLevel(Enchantment.flame.effectId, this.getHeldItem()) > 0 || this.getSkeletonType() == 1) { -+ if (EnchantmentHelper.getEnchantmentLevel(Enchantment.flame.effectId, this.getHeldItem()) > 0 || this.getSkeletonType() == 1) { - var3.setFire(100); - } - -@@ -220,44 +271,63 @@ - this.worldObj.spawnEntityInWorld(var3); - } - -+ /** -+ * Return this skeleton's type. -+ */ - public int getSkeletonType() { - return this.dataWatcher.getWatchableObjectByte(13); - } - -- public void setSkeletonType(int var1) { -- this.dataWatcher.updateObject(13, Byte.valueOf((byte)var1)); -- this.isImmuneToFire = var1 == 1; -- if(var1 == 1) { -+ /** -+ * Set this skeleton's type. -+ */ -+ public void setSkeletonType(int par1) { -+ this.dataWatcher.updateObject(13, Byte.valueOf((byte)par1)); -+ this.isImmuneToFire = par1 == 1; -+ -+ if (par1 == 1) { - this.setSize(0.72F, 2.34F); - } else { - this.setSize(0.6F, 1.8F); - } -- - } - -- public void readEntityFromNBT(NBTTagCompound var1) { -- super.readEntityFromNBT(var1); -- if(var1.hasKey("SkeletonType")) { -- byte var2 = var1.getByte("SkeletonType"); -+ /** -+ * (abstract) Protected helper method to read subclass entity data from NBT. -+ */ -+ public void readEntityFromNBT(NBTTagCompound par1NBTTagCompound) { -+ super.readEntityFromNBT(par1NBTTagCompound); -+ -+ if (par1NBTTagCompound.hasKey("SkeletonType")) { -+ byte var2 = par1NBTTagCompound.getByte("SkeletonType"); - this.setSkeletonType(var2); - } - - this.setCombatTask(); - } - -- public void writeEntityToNBT(NBTTagCompound var1) { -- super.writeEntityToNBT(var1); -- var1.setByte("SkeletonType", (byte)this.getSkeletonType()); -+ /** -+ * (abstract) Protected helper method to write subclass entity data to NBT. -+ */ -+ public void writeEntityToNBT(NBTTagCompound par1NBTTagCompound) { -+ super.writeEntityToNBT(par1NBTTagCompound); -+ par1NBTTagCompound.setByte("SkeletonType", (byte)this.getSkeletonType()); - } - -- public void setCurrentItemOrArmor(int var1, ItemStack var2) { -- super.setCurrentItemOrArmor(var1, var2); -- if(!this.worldObj.isRemote && var1 == 0) { -+ /** -+ * Sets the held item, or an armor slot. Slot 0 is held item. Slot 1-4 is armor. Params: Item, slot -+ */ -+ public void setCurrentItemOrArmor(int par1, ItemStack par2ItemStack) { -+ super.setCurrentItemOrArmor(par1, par2ItemStack); -+ -+ if (!this.worldObj.isRemote && par1 == 0) { - this.setCombatTask(); - } -- - } - -+ /** -+ * Returns the Y Offset of this entity. -+ */ - public double getYOffset() { - return super.getYOffset() - 0.5D; - } ---- /dev/null -+++ org/spoutcraft/api/gui/ComboBox.java -@@ -1,0 +1,44 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.api.gui; -+ -+import java.util.List; -+ -+public interface ComboBox extends Button { -+ public ComboBox setItems(List items); -+ public List getItems(); -+ public ComboBox openList(); -+ public ComboBox closeList(); -+ public String getSelectedItem(); -+ public int getSelectedRow(); -+ public ComboBox setSelection(int row); -+ public void onSelectionChanged(int i, String text); -+ public boolean isOpen(); -+ /** -+ * Sets the format of the text on the button. Default is "%text%: %selected%" -+ * -+ * %text% will be replaced with whatever can be obtained by Button.getText() -+ * %selected% will be replaced with the text of the selected item -+ * @param format the format of the text on the button -+ * @return the instance -+ */ -+ public ComboBox setFormat(String format); -+ public String getFormat(); -+} ---- net/minecraft/src/Packet9Respawn.java -+++ net/minecraft/src/Packet9Respawn.java -@@ -6,47 +6,64 @@ - - public class Packet9Respawn extends Packet { - public int respawnDimension; -+ -+ /** -+ * The difficulty setting. 0 through 3 for peaceful, easy, normal, hard. The client always sends 1. -+ */ - public int difficulty; -+ -+ /** Defaults to 128 */ - public int worldHeight; - public EnumGameType gameType; - public WorldType terrainType; - -- public Packet9Respawn() { -- } -- -- public Packet9Respawn(int var1, byte var2, WorldType var3, int var4, EnumGameType var5) { -- this.respawnDimension = var1; -- this.difficulty = var2; -- this.worldHeight = var4; -- this.gameType = var5; -- this.terrainType = var3; -- } -- -- public void processPacket(NetHandler var1) { -- var1.handleRespawn(this); -- } -- -- public void readPacketData(DataInput var1) throws IOException { -- this.respawnDimension = var1.readInt(); -- this.difficulty = var1.readByte(); -- this.gameType = EnumGameType.getByID(var1.readByte()); -- this.worldHeight = var1.readShort(); -- String var2 = readString(var1, 16); -+ public Packet9Respawn() {} -+ -+ public Packet9Respawn(int par1, byte par2, WorldType par3WorldType, int par4, EnumGameType par5EnumGameType) { -+ this.respawnDimension = par1; -+ this.difficulty = par2; -+ this.worldHeight = par4; -+ this.gameType = par5EnumGameType; -+ this.terrainType = par3WorldType; -+ } -+ -+ /** -+ * Passes this Packet on to the NetHandler for processing. -+ */ -+ public void processPacket(NetHandler par1NetHandler) { -+ par1NetHandler.handleRespawn(this); -+ } -+ -+ /** -+ * Abstract. Reads the raw packet data from the data stream. -+ */ -+ public void readPacketData(DataInput par1DataInput) throws IOException { -+ this.respawnDimension = par1DataInput.readInt(); -+ this.difficulty = par1DataInput.readByte(); -+ this.gameType = EnumGameType.getByID(par1DataInput.readByte()); -+ this.worldHeight = par1DataInput.readShort(); -+ String var2 = readString(par1DataInput, 16); - this.terrainType = WorldType.parseWorldType(var2); -- if(this.terrainType == null) { -+ -+ if (this.terrainType == null) { - this.terrainType = WorldType.DEFAULT; - } -- -- } -- -- public void writePacketData(DataOutput var1) throws IOException { -- var1.writeInt(this.respawnDimension); -- var1.writeByte(this.difficulty); -- var1.writeByte(this.gameType.getID()); -- var1.writeShort(this.worldHeight); -- writeString(this.terrainType.getWorldTypeName(), var1); -- } -- -+ } -+ -+ /** -+ * Abstract. Writes the raw packet data to the data stream. -+ */ -+ public void writePacketData(DataOutput par1DataOutput) throws IOException { -+ par1DataOutput.writeInt(this.respawnDimension); -+ par1DataOutput.writeByte(this.difficulty); -+ par1DataOutput.writeByte(this.gameType.getID()); -+ par1DataOutput.writeShort(this.worldHeight); -+ writeString(this.terrainType.getWorldTypeName(), par1DataOutput); -+ } -+ -+ /** -+ * Abstract. Return the size of the packet (not counting the header). -+ */ - public int getPacketSize() { - return 8 + (this.terrainType == null ? 0 : this.terrainType.getWorldTypeName().length()); - } ---- /dev/null -+++ org/spoutcraft/api/player/ChatManager.java -@@ -1,0 +1,34 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.api.player; -+ -+import java.util.List; -+ -+public interface ChatManager { -+ public List getIgnoredPlayers(); -+ public List getWordsToHighlight(); -+ public boolean isHighlightingWords(); -+ public boolean isIgnoringPlayers(); -+ public String formatChatColors(String text); -+ public int getScroll(); -+ public boolean isShowingJoins(); -+ public boolean isUsingRegex(); -+ public float getOpacity(); -+} ---- net/minecraft/src/Scoreboard.java -+++ net/minecraft/src/Scoreboard.java -@@ -9,95 +9,107 @@ - import java.util.Map; - - public class Scoreboard { -- private final Map a = new HashMap(); -- private final Map b = new HashMap(); -- private final Map c = new HashMap(); -+ -+ /** Map of objective names to ScoreObjective objects. */ -+ private final Map scoreObjectives = new HashMap(); -+ private final Map field_96543_b = new HashMap(); -+ private final Map field_96544_c = new HashMap(); - private final ScoreObjective[] field_96541_d = new ScoreObjective[3]; -- private final Map e = new HashMap(); -- private final Map f = new HashMap(); -- -- public ScoreObjective getObjective(String var1) { -- return (ScoreObjective)this.a.get(var1); -+ private final Map field_96542_e = new HashMap(); -+ -+ /** Map of usernames to ScorePlayerTeam objects. */ -+ private final Map teamMemberships = new HashMap(); -+ -+ /** -+ * Returns a ScoreObjective for the objective name -+ */ -+ public ScoreObjective getObjective(String par1Str) { -+ return (ScoreObjective)this.scoreObjectives.get(par1Str); - } - -- public ScoreObjective func_96535_a(String var1, ScoreObjectiveCriteria var2) { -- ScoreObjective var3 = this.getObjective(var1); -- if(var3 != null) { -- throw new IllegalArgumentException("An objective with the name \'" + var1 + "\' already exists!"); -+ public ScoreObjective func_96535_a(String par1Str, ScoreObjectiveCriteria par2ScoreObjectiveCriteria) { -+ ScoreObjective var3 = this.getObjective(par1Str); -+ -+ if (var3 != null) { -+ throw new IllegalArgumentException("An objective with the name \'" + par1Str + "\' already exists!"); - } else { -- var3 = new ScoreObjective(this, var1, var2); -- Object var4 = (List)this.b.get(var2); -- if(var4 == null) { -+ var3 = new ScoreObjective(this, par1Str, par2ScoreObjectiveCriteria); -+ Object var4 = (List)this.field_96543_b.get(par2ScoreObjectiveCriteria); -+ -+ if (var4 == null) { - var4 = new ArrayList(); -- this.b.put(var2, var4); -+ this.field_96543_b.put(par2ScoreObjectiveCriteria, var4); - } - - ((List)var4).add(var3); -- this.a.put(var1, var3); -+ this.scoreObjectives.put(par1Str, var3); - this.func_96522_a(var3); - return var3; - } - } - -- public Collection func_96520_a(ScoreObjectiveCriteria var1) { -- Collection var2 = (Collection)this.b.get(var1); -+ public Collection func_96520_a(ScoreObjectiveCriteria par1ScoreObjectiveCriteria) { -+ Collection var2 = (Collection)this.field_96543_b.get(par1ScoreObjectiveCriteria); - return var2 == null ? new ArrayList() : new ArrayList(var2); - } - -- public Score func_96529_a(String var1, ScoreObjective var2) { -- Object var3 = (Map)this.c.get(var1); -- if(var3 == null) { -+ public Score func_96529_a(String par1Str, ScoreObjective par2ScoreObjective) { -+ Object var3 = (Map)this.field_96544_c.get(par1Str); -+ -+ if (var3 == null) { - var3 = new HashMap(); -- this.c.put(var1, var3); -+ this.field_96544_c.put(par1Str, var3); - } - -- Score var4 = (Score)((Map)var3).get(var2); -- if(var4 == null) { -- var4 = new Score(this, var2, var1); -- ((Map)var3).put(var2, var4); -+ Score var4 = (Score)((Map)var3).get(par2ScoreObjective); -+ -+ if (var4 == null) { -+ var4 = new Score(this, par2ScoreObjective, par1Str); -+ ((Map)var3).put(par2ScoreObjective, var4); - } - - return var4; - } - -- public Collection func_96534_i(ScoreObjective var1) { -+ public Collection func_96534_i(ScoreObjective par1ScoreObjective) { - ArrayList var2 = new ArrayList(); -- Iterator var3 = this.c.values().iterator(); -+ Iterator var3 = this.field_96544_c.values().iterator(); - -- while(var3.hasNext()) { -+ while (var3.hasNext()) { - Map var4 = (Map)var3.next(); -- Score var5 = (Score)var4.get(var1); -- if(var5 != null) { -+ Score var5 = (Score)var4.get(par1ScoreObjective); -+ -+ if (var5 != null) { - var2.add(var5); - } - } - -- Collections.sort(var2, Score.a); -+ Collections.sort(var2, Score.field_96658_a); - return var2; - } - - public Collection getScoreObjectives() { -- return this.a.values(); -+ return this.scoreObjectives.values(); - } - - public Collection getObjectiveNames() { -- return this.c.keySet(); -+ return this.field_96544_c.keySet(); - } - -- public void func_96515_c(String var1) { -- Map var2 = (Map)this.c.remove(var1); -- if(var2 != null) { -- this.func_96516_a(var1); -+ public void func_96515_c(String par1Str) { -+ Map var2 = (Map)this.field_96544_c.remove(par1Str); -+ -+ if (var2 != null) { -+ this.func_96516_a(par1Str); - } -- - } - - public Collection func_96528_e() { -- Collection var1 = this.c.values(); -+ Collection var1 = this.field_96544_c.values(); - ArrayList var2 = new ArrayList(); - Iterator var3 = var1.iterator(); - -- while(var3.hasNext()) { -+ while (var3.hasNext()) { - Map var4 = (Map)var3.next(); - var2.addAll(var4.values()); - } -@@ -105,153 +117,165 @@ - return var2; - } - -- public Map func_96510_d(String var1) { -- Object var2 = (Map)this.c.get(var1); -- if(var2 == null) { -+ public Map func_96510_d(String par1Str) { -+ Object var2 = (Map)this.field_96544_c.get(par1Str); -+ -+ if (var2 == null) { - var2 = new HashMap(); - } - - return (Map)var2; - } - -- public void func_96519_k(ScoreObjective var1) { -- this.a.remove(var1.getName()); -+ public void func_96519_k(ScoreObjective par1ScoreObjective) { -+ this.scoreObjectives.remove(par1ScoreObjective.getName()); - -- for(int var2 = 0; var2 < 3; ++var2) { -- if(this.func_96539_a(var2) == var1) { -+ for (int var2 = 0; var2 < 3; ++var2) { -+ if (this.func_96539_a(var2) == par1ScoreObjective) { - this.func_96530_a(var2, (ScoreObjective)null); - } - } - -- List var5 = (List)this.b.get(var1.getCriteria()); -- if(var5 != null) { -- var5.remove(var1); -+ List var5 = (List)this.field_96543_b.get(par1ScoreObjective.getCriteria()); -+ -+ if (var5 != null) { -+ var5.remove(par1ScoreObjective); - } - -- Iterator var3 = this.c.values().iterator(); -+ Iterator var3 = this.field_96544_c.values().iterator(); - -- while(var3.hasNext()) { -+ while (var3.hasNext()) { - Map var4 = (Map)var3.next(); -- var4.remove(var1); -+ var4.remove(par1ScoreObjective); - } - -- this.func_96533_c(var1); -- } -- -- public void func_96530_a(int var1, ScoreObjective var2) { -- this.field_96541_d[var1] = var2; -- } -- -- public ScoreObjective func_96539_a(int var1) { -- return this.field_96541_d[var1]; -- } -- -- public ScorePlayerTeam func_96508_e(String var1) { -- return (ScorePlayerTeam)this.e.get(var1); -- } -- -- public ScorePlayerTeam createTeam(String var1) { -- ScorePlayerTeam var2 = this.func_96508_e(var1); -- if(var2 != null) { -- throw new IllegalArgumentException("An objective with the name \'" + var1 + "\' already exists!"); -+ this.func_96533_c(par1ScoreObjective); -+ } -+ -+ public void func_96530_a(int par1, ScoreObjective par2ScoreObjective) { -+ this.field_96541_d[par1] = par2ScoreObjective; -+ } -+ -+ public ScoreObjective func_96539_a(int par1) { -+ return this.field_96541_d[par1]; -+ } -+ -+ public ScorePlayerTeam func_96508_e(String par1Str) { -+ return (ScorePlayerTeam)this.field_96542_e.get(par1Str); -+ } -+ -+ public ScorePlayerTeam func_96527_f(String par1Str) { -+ ScorePlayerTeam var2 = this.func_96508_e(par1Str); -+ -+ if (var2 != null) { -+ throw new IllegalArgumentException("An objective with the name \'" + par1Str + "\' already exists!"); - } else { -- var2 = new ScorePlayerTeam(this, var1); -- this.e.put(var1, var2); -+ var2 = new ScorePlayerTeam(this, par1Str); -+ this.field_96542_e.put(par1Str, var2); - this.func_96523_a(var2); - return var2; - } - } - -- public void func_96511_d(ScorePlayerTeam var1) { -- this.e.remove(var1.func_96661_b()); -- Iterator var2 = var1.getMembershipCollection().iterator(); -+ public void func_96511_d(ScorePlayerTeam par1ScorePlayerTeam) { -+ this.field_96542_e.remove(par1ScorePlayerTeam.func_96661_b()); -+ Iterator var2 = par1ScorePlayerTeam.getMembershipCollection().iterator(); - -- while(var2.hasNext()) { -+ while (var2.hasNext()) { - String var3 = (String)var2.next(); -- this.f.remove(var3); -- } -- -- this.func_96513_c(var1); -- } -- -- public void addPlayerToTeam(String var1, ScorePlayerTeam var2) { -- if(this.getPlayersTeam(var1) != null) { -- this.removePlayerFromTeams(var1); -- } -- -- this.f.put(var1, var2); -- var2.getMembershipCollection().add(var1); -- } -- -- public boolean removePlayerFromTeams(String var1) { -- ScorePlayerTeam var2 = this.getPlayersTeam(var1); -- if(var2 != null) { -- this.removePlayerFromTeam(var1, var2); -+ this.teamMemberships.remove(var3); -+ } -+ -+ this.func_96513_c(par1ScorePlayerTeam); -+ } -+ -+ public void func_96521_a(String par1Str, ScorePlayerTeam par2ScorePlayerTeam) { -+ if (this.getPlayersTeam(par1Str) != null) { -+ this.func_96524_g(par1Str); -+ } -+ -+ this.teamMemberships.put(par1Str, par2ScorePlayerTeam); -+ par2ScorePlayerTeam.getMembershipCollection().add(par1Str); -+ } -+ -+ public boolean func_96524_g(String par1Str) { -+ ScorePlayerTeam var2 = this.getPlayersTeam(par1Str); -+ -+ if (var2 != null) { -+ this.removePlayerFromTeam(par1Str, var2); - return true; - } else { - return false; - } - } - -- public void removePlayerFromTeam(String var1, ScorePlayerTeam var2) { -- if(this.getPlayersTeam(var1) != var2) { -- throw new IllegalStateException("Player is either on another team or not on any team. Cannot remove from team \'" + var2.func_96661_b() + "\'."); -+ /** -+ * Removes the given username from the given ScorePlayerTeam. If the player is not on the team then an -+ * IllegalStateException is thrown. -+ */ -+ public void removePlayerFromTeam(String par1Str, ScorePlayerTeam par2ScorePlayerTeam) { -+ if (this.getPlayersTeam(par1Str) != par2ScorePlayerTeam) { -+ throw new IllegalStateException("Player is either on another team or not on any team. Cannot remove from team \'" + par2ScorePlayerTeam.func_96661_b() + "\'."); - } else { -- this.f.remove(var1); -- var2.getMembershipCollection().remove(var1); -+ this.teamMemberships.remove(par1Str); -+ par2ScorePlayerTeam.getMembershipCollection().remove(par1Str); - } - } - - public Collection func_96531_f() { -- return this.e.keySet(); -+ return this.field_96542_e.keySet(); - } - - public Collection func_96525_g() { -- return this.e.values(); -- } -- -- public ScorePlayerTeam getPlayersTeam(String var1) { -- return (ScorePlayerTeam)this.f.get(var1); -- } -- -- public void func_96522_a(ScoreObjective var1) { -- } -- -- public void func_96532_b(ScoreObjective var1) { -- } -- -- public void func_96533_c(ScoreObjective var1) { -- } -- -- public void func_96536_a(Score var1) { -- } -- -- public void func_96516_a(String var1) { -- } -- -- public void func_96523_a(ScorePlayerTeam var1) { -- } -- -- public void func_96538_b(ScorePlayerTeam var1) { -- } -- -- public void func_96513_c(ScorePlayerTeam var1) { -- } -- -- public static String getObjectiveDisplaySlot(int var0) { -- switch(var0) { -- case 0: -- return "list"; -- case 1: -- return "sidebar"; -- case 2: -- return "belowName"; -- default: -- return null; -+ return this.field_96542_e.values(); -+ } -+ -+ /** -+ * Gets the ScorePlayerTeam object for the given username. -+ */ -+ public ScorePlayerTeam getPlayersTeam(String par1Str) { -+ return (ScorePlayerTeam)this.teamMemberships.get(par1Str); -+ } -+ -+ public void func_96522_a(ScoreObjective par1ScoreObjective) {} -+ -+ public void func_96532_b(ScoreObjective par1ScoreObjective) {} -+ -+ public void func_96533_c(ScoreObjective par1ScoreObjective) {} -+ -+ public void func_96536_a(Score par1Score) {} -+ -+ public void func_96516_a(String par1Str) {} -+ -+ public void func_96523_a(ScorePlayerTeam par1ScorePlayerTeam) {} -+ -+ public void func_96538_b(ScorePlayerTeam par1ScorePlayerTeam) {} -+ -+ public void func_96513_c(ScorePlayerTeam par1ScorePlayerTeam) {} -+ -+ /** -+ * Returns 'list' for 0, 'sidebar' for 1, 'belowName for 2, otherwise null. -+ */ -+ public static String getObjectiveDisplaySlot(int par0) { -+ switch (par0) { -+ case 0: -+ return "list"; -+ -+ case 1: -+ return "sidebar"; -+ -+ case 2: -+ return "belowName"; -+ -+ default: -+ return null; - } - } - -- public static int getObjectiveDisplaySlotNumber(String var0) { -- return var0.equalsIgnoreCase("list") ? 0 : (var0.equalsIgnoreCase("sidebar") ? 1 : (var0.equalsIgnoreCase("belowName") ? 2 : -1)); -+ /** -+ * Returns 0 for (case-insensitive) 'list', 1 for 'sidebar', 2 for 'belowName', otherwise -1. -+ */ -+ public static int getObjectiveDisplaySlotNumber(String par0Str) { -+ return par0Str.equalsIgnoreCase("list") ? 0 : (par0Str.equalsIgnoreCase("sidebar") ? 1 : (par0Str.equalsIgnoreCase("belowName") ? 2 : -1)); - } - } ---- /dev/null -+++ com/prupe/mcpatcher/cc/ColorizeItem.java -@@ -1,0 +1,119 @@ -+package com.prupe.mcpatcher.cc; -+ -+import com.prupe.mcpatcher.MCLogger; -+import java.util.ArrayList; -+import java.util.HashMap; -+import java.util.Iterator; -+import java.util.List; -+import java.util.Map; -+import java.util.Properties; -+import net.minecraft.src.MapColor; -+import net.minecraft.src.Potion; -+import net.minecraft.src.PotionHelper; -+ -+public class ColorizeItem { -+ private static final MCLogger logger = MCLogger.getLogger("Custom Colors"); -+ private static final Map entityNamesByID = new HashMap(); -+ private static final Map spawnerEggShellColors = new HashMap(); -+ private static final Map spawnerEggSpotColors = new HashMap(); -+ private static int waterBottleColor; -+ private static final List potions = new ArrayList(); -+ private static final String[] MAP_MATERIALS = new String[] {"air", "grass", "sand", "cloth", "tnt", "ice", "iron", "foliage", "snow", "clay", "dirt", "stone", "water", "wood"}; -+ -+ static void reset() { -+ spawnerEggShellColors.clear(); -+ spawnerEggSpotColors.clear(); -+ -+ if (PotionHelper.field_77925_n != null) { -+ PotionHelper.field_77925_n.clear(); -+ } -+ -+ waterBottleColor = 3694022; -+ Potion len$; -+ -+ for (Iterator arr$ = potions.iterator(); arr$.hasNext(); len$.liquidColor = len$.origColor) { -+ len$ = (Potion)arr$.next(); -+ } -+ -+ MapColor[] var4 = MapColor.mapColorArray; -+ int var5 = var4.length; -+ -+ for (int i$ = 0; i$ < var5; ++i$) { -+ MapColor mapColor = var4[i$]; -+ -+ if (mapColor != null) { -+ mapColor.colorValue = mapColor.origColorValue; -+ } -+ } -+ } -+ -+ static void reloadPotionColors(Properties properties) { -+ Iterator temp = potions.iterator(); -+ -+ while (temp.hasNext()) { -+ Potion potion = (Potion)temp.next(); -+ Colorizer.loadIntColor(potion.name, potion); -+ } -+ -+ int[] temp1 = new int[] {waterBottleColor}; -+ Colorizer.loadIntColor("potion.water", temp1, 0); -+ waterBottleColor = temp1[0]; -+ } -+ -+ static void reloadMapColors(Properties properties) { -+ for (int i = 0; i < MapColor.mapColorArray.length; ++i) { -+ if (MapColor.mapColorArray[i] != null) { -+ int[] rgb = new int[] {MapColor.mapColorArray[i].origColorValue}; -+ Colorizer.loadIntColor("map." + Colorizer.getStringKey(MAP_MATERIALS, i), rgb, 0); -+ MapColor.mapColorArray[i].colorValue = rgb[0]; -+ } -+ } -+ } -+ -+ public static void setupSpawnerEgg(String entityName, int entityID, int defaultShellColor, int defaultSpotColor) { -+ logger.config("egg.shell.%s=%06x", new Object[] {entityName, Integer.valueOf(defaultShellColor)}); -+ logger.config("egg.spots.%s=%06x", new Object[] {entityName, Integer.valueOf(defaultSpotColor)}); -+ entityNamesByID.put(Integer.valueOf(entityID), entityName); -+ } -+ -+ public static void setupPotion(Potion potion) { -+ potion.origColor = potion.liquidColor; -+ potions.add(potion); -+ } -+ -+ public static int colorizeSpawnerEgg(int defaultColor, int entityID, int spots) { -+ if (!Colorizer.useEggColors) { -+ return defaultColor; -+ } else { -+ Integer value = null; -+ Map eggMap = spots == 0 ? spawnerEggShellColors : spawnerEggSpotColors; -+ -+ if (eggMap.containsKey(Integer.valueOf(entityID))) { -+ value = (Integer)eggMap.get(Integer.valueOf(entityID)); -+ } else if (entityNamesByID.containsKey(Integer.valueOf(entityID))) { -+ String name = (String)entityNamesByID.get(Integer.valueOf(entityID)); -+ -+ if (name != null) { -+ int[] tmp = new int[] {defaultColor}; -+ Colorizer.loadIntColor((spots == 0 ? "egg.shell." : "egg.spots.") + name, tmp, 0); -+ eggMap.put(Integer.valueOf(entityID), Integer.valueOf(tmp[0])); -+ value = Integer.valueOf(tmp[0]); -+ } -+ } -+ -+ return value == null ? defaultColor : value.intValue(); -+ } -+ } -+ -+ public static int getWaterBottleColor() { -+ return waterBottleColor; -+ } -+ -+ static { -+ try { -+ reset(); -+ } catch (Throwable var1) { -+ var1.printStackTrace(); -+ } -+ } -+} ---- net/minecraft/src/BanEntry.java -+++ net/minecraft/src/BanEntry.java -@@ -7,104 +7,111 @@ - import net.minecraft.server.MinecraftServer; - - public class BanEntry { -- public static final SimpleDateFormat a = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss Z"); -- private final String b; -- private Date c = new Date(); -- private String d = "(Unknown)"; -- private Date e; -- private String f = "Banned by an operator."; -+ public static final SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss Z"); -+ private final String username; -+ private Date banStartDate = new Date(); -+ private String bannedBy = "(Unknown)"; -+ private Date banEndDate; -+ private String reason = "Banned by an operator."; - -- public BanEntry(String var1) { -- this.b = var1; -+ public BanEntry(String par1Str) { -+ this.username = par1Str; - } - - public String getBannedUsername() { -- return this.b; -+ return this.username; - } - - public Date getBanStartDate() { -- return this.c; -+ return this.banStartDate; - } - -- public void setBanStartDate(Date var1) { -- this.c = var1 != null ? var1 : new Date(); -+ /** -+ * null == start ban now -+ */ -+ public void setBanStartDate(Date par1Date) { -+ this.banStartDate = par1Date != null ? par1Date : new Date(); - } - - public String getBannedBy() { -- return this.d; -+ return this.bannedBy; - } - -- public void setBannedBy(String var1) { -- this.d = var1; -+ public void setBannedBy(String par1Str) { -+ this.bannedBy = par1Str; - } - - public Date getBanEndDate() { -- return this.e; -+ return this.banEndDate; - } - -- public void setBanEndDate(Date var1) { -- this.e = var1; -+ public void setBanEndDate(Date par1Date) { -+ this.banEndDate = par1Date; - } - - public boolean hasBanExpired() { -- return this.e == null ? false : this.e.before(new Date()); -+ return this.banEndDate == null ? false : this.banEndDate.before(new Date()); - } - - public String getBanReason() { -- return this.f; -+ return this.reason; - } - -- public void setBanReason(String var1) { -- this.f = var1; -+ public void setBanReason(String par1Str) { -+ this.reason = par1Str; - } - - public String buildBanString() { - StringBuilder var1 = new StringBuilder(); - var1.append(this.getBannedUsername()); - var1.append("|"); -- var1.append(a.format(this.getBanStartDate())); -+ var1.append(dateFormat.format(this.getBanStartDate())); - var1.append("|"); - var1.append(this.getBannedBy()); - var1.append("|"); -- var1.append(this.getBanEndDate() == null ? "Forever" : a.format(this.getBanEndDate())); -+ var1.append(this.getBanEndDate() == null ? "Forever" : dateFormat.format(this.getBanEndDate())); - var1.append("|"); - var1.append(this.getBanReason()); - return var1.toString(); - } - -- public static BanEntry parse(String var0) { -- if(var0.trim().length() < 2) { -+ public static BanEntry parse(String par0Str) { -+ if (par0Str.trim().length() < 2) { - return null; - } else { -- String[] var1 = var0.trim().split(Pattern.quote("|"), 5); -+ String[] var1 = par0Str.trim().split(Pattern.quote("|"), 5); - BanEntry var2 = new BanEntry(var1[0].trim()); - byte var3 = 0; - int var10000 = var1.length; - int var7 = var3 + 1; -- if(var10000 <= var7) { -+ -+ if (var10000 <= var7) { - return var2; - } else { - try { -- var2.setBanStartDate(a.parse(var1[var7].trim())); -+ var2.setBanStartDate(dateFormat.parse(var1[var7].trim())); - } catch (ParseException var6) { - MinecraftServer.getServer().getLogAgent().logWarningException("Could not read creation date format for ban entry \'" + var2.getBannedUsername() + "\' (was: \'" + var1[var7] + "\')", var6); - } - - var10000 = var1.length; - ++var7; -- if(var10000 <= var7) { -+ -+ if (var10000 <= var7) { - return var2; - } else { - var2.setBannedBy(var1[var7].trim()); - var10000 = var1.length; - ++var7; -- if(var10000 <= var7) { -+ -+ if (var10000 <= var7) { - return var2; - } else { - try { - String var4 = var1[var7].trim(); -- if(!var4.equalsIgnoreCase("Forever") && var4.length() > 0) { -- var2.setBanEndDate(a.parse(var4)); -+ -+ if (!var4.equalsIgnoreCase("Forever") && var4.length() > 0) { -+ var2.setBanEndDate(dateFormat.parse(var4)); - } - } catch (ParseException var5) { - MinecraftServer.getServer().getLogAgent().logWarningException("Could not read expiry date format for ban entry \'" + var2.getBannedUsername() + "\' (was: \'" + var1[var7] + "\')", var5); -@@ -112,7 +119,8 @@ - - var10000 = var1.length; - ++var7; -- if(var10000 <= var7) { -+ -+ if (var10000 <= var7) { - return var2; - } else { - var2.setBanReason(var1[var7].trim()); ---- net/minecraft/src/RConThreadQuery.java -+++ net/minecraft/src/RConThreadQuery.java -@@ -17,99 +17,142 @@ - import net.minecraft.server.MinecraftServer; - - public class RConThreadQuery extends RConThreadBase { -+ -+ /** The time of the last client auth check */ - private long lastAuthCheckTime; -+ -+ /** The RCon query port */ - private int queryPort; -+ -+ /** Port the server is running on */ - private int serverPort; -+ -+ /** The maximum number of players allowed on the server */ - private int maxPlayers; -- private String k; -- private String l; -- private DatagramSocket m; -+ -+ /** The current server message of the day */ -+ private String serverMotd; -+ -+ /** The name of the currently loaded world */ -+ private String worldName; -+ -+ /** The remote socket querying the server */ -+ private DatagramSocket querySocket; -+ -+ /** A buffer for incoming DatagramPackets */ - private byte[] buffer = new byte[1460]; -- private DatagramPacket o; -- private Map p; -- private String q; -- private String r; -- private Map s; -+ -+ /** Storage for incoming DatagramPackets */ -+ private DatagramPacket incomingPacket; -+ private Map field_72644_p; -+ -+ /** The hostname of this query server */ -+ private String queryHostname; -+ -+ /** The hostname of the running server */ -+ private String serverHostname; -+ -+ /** A map of SocketAddress objects to RConThreadQueryAuth objects */ -+ private Map queryClients; -+ -+ /** -+ * The time that this RConThreadQuery was constructed, from (new Date()).getTime() -+ */ - private long time; -+ -+ /** The RConQuery output stream */ - private RConOutputStream output; -+ -+ /** The time of the last query response sent */ - private long lastQueryResponseTime; - -- public RConThreadQuery(IServer var1) { -- super(var1); -- this.queryPort = var1.getIntProperty("query.port", 0); -- this.r = var1.getHostname(); -- this.serverPort = var1.getPort(); -- this.k = var1.getMotd(); -- this.maxPlayers = var1.getMaxPlayers(); -- this.l = var1.getFolderName(); -+ public RConThreadQuery(IServer par1IServer) { -+ super(par1IServer); -+ this.queryPort = par1IServer.getIntProperty("query.port", 0); -+ this.serverHostname = par1IServer.getHostname(); -+ this.serverPort = par1IServer.getPort(); -+ this.serverMotd = par1IServer.getServerMOTD(); -+ this.maxPlayers = par1IServer.getMaxPlayers(); -+ this.worldName = par1IServer.getFolderName(); - this.lastQueryResponseTime = 0L; -- this.q = "0.0.0.0"; -- if(0 != this.r.length() && !this.q.equals(this.r)) { -- this.q = this.r; -+ this.queryHostname = "0.0.0.0"; -+ -+ if (0 != this.serverHostname.length() && !this.queryHostname.equals(this.serverHostname)) { -+ this.queryHostname = this.serverHostname; - } else { -- this.r = "0.0.0.0"; -+ this.serverHostname = "0.0.0.0"; - - try { - InetAddress var2 = InetAddress.getLocalHost(); -- this.q = var2.getHostAddress(); -+ this.queryHostname = var2.getHostAddress(); - } catch (UnknownHostException var3) { -- this.logWarning("Unable to determine local host IP, please set server-ip in \'" + var1.getSettingsFilename() + "\' : " + var3.getMessage()); -+ this.logWarning("Unable to determine local host IP, please set server-ip in \'" + par1IServer.getSettingsFilename() + "\' : " + var3.getMessage()); - } - } - -- if(0 == this.queryPort) { -+ if (0 == this.queryPort) { - this.queryPort = this.serverPort; - this.logInfo("Setting default query port to " + this.queryPort); -- var1.setProperty("query.port", Integer.valueOf(this.queryPort)); -- var1.setProperty("debug", Boolean.valueOf(false)); -- var1.saveProperties(); -+ par1IServer.setProperty("query.port", Integer.valueOf(this.queryPort)); -+ par1IServer.setProperty("debug", Boolean.valueOf(false)); -+ par1IServer.saveProperties(); - } - -- this.p = new HashMap(); -+ this.field_72644_p = new HashMap(); - this.output = new RConOutputStream(1460); -- this.s = new HashMap(); -+ this.queryClients = new HashMap(); - this.time = (new Date()).getTime(); - } - -- private void sendResponsePacket(byte[] var1, DatagramPacket var2) throws IOException { -- this.m.send(new DatagramPacket(var1, var1.length, var2.getSocketAddress())); -+ /** -+ * Sends a byte array as a DatagramPacket response to the client who sent the given DatagramPacket -+ */ -+ private void sendResponsePacket(byte[] par1ArrayOfByte, DatagramPacket par2DatagramPacket) throws IOException { -+ this.querySocket.send(new DatagramPacket(par1ArrayOfByte, par1ArrayOfByte.length, par2DatagramPacket.getSocketAddress())); - } - -- private boolean parseIncomingPacket(DatagramPacket var1) throws IOException { -- byte[] var2 = var1.getData(); -- int var3 = var1.getLength(); -- SocketAddress var4 = var1.getSocketAddress(); -+ /** -+ * Parses an incoming DatagramPacket, returning true if the packet was valid -+ */ -+ private boolean parseIncomingPacket(DatagramPacket par1DatagramPacket) throws IOException { -+ byte[] var2 = par1DatagramPacket.getData(); -+ int var3 = par1DatagramPacket.getLength(); -+ SocketAddress var4 = par1DatagramPacket.getSocketAddress(); - this.logDebug("Packet len " + var3 + " [" + var4 + "]"); -- if(3 <= var3 && -2 == var2[0] && -3 == var2[1]) { -+ -+ if (3 <= var3 && -2 == var2[0] && -3 == var2[1]) { - this.logDebug("Packet \'" + RConUtils.getByteAsHexString(var2[2]) + "\' [" + var4 + "]"); -- switch(var2[2]) { -- case 0: -- if(!this.verifyClientAuth(var1).booleanValue()) { -- this.logDebug("Invalid challenge [" + var4 + "]"); -- return false; -- } else if(15 == var3) { -- this.sendResponsePacket(this.createQueryResponse(var1), var1); -- this.logDebug("Rules [" + var4 + "]"); -- } else { -- RConOutputStream var5 = new RConOutputStream(1460); -- var5.writeInt(0); -- var5.writeByteArray(this.getRequestID(var1.getSocketAddress())); -- var5.writeString(this.k); -- var5.writeString("SMP"); -- var5.writeString(this.l); -- var5.writeString(Integer.toString(this.getNumberOfPlayers())); -- var5.writeString(Integer.toString(this.maxPlayers)); -- var5.writeShort((short)this.serverPort); -- var5.writeString(this.q); -- this.sendResponsePacket(var5.toByteArray(), var1); -- this.logDebug("Status [" + var4 + "]"); -- } -- default: -- return true; -- case 9: -- this.sendAuthChallenge(var1); -- this.logDebug("Challenge [" + var4 + "]"); -- return true; -+ -+ switch (var2[2]) { -+ case 0: -+ if (!this.verifyClientAuth(par1DatagramPacket).booleanValue()) { -+ this.logDebug("Invalid challenge [" + var4 + "]"); -+ return false; -+ } else if (15 == var3) { -+ this.sendResponsePacket(this.createQueryResponse(par1DatagramPacket), par1DatagramPacket); -+ this.logDebug("Rules [" + var4 + "]"); -+ } else { -+ RConOutputStream var5 = new RConOutputStream(1460); -+ var5.writeInt(0); -+ var5.writeByteArray(this.getRequestID(par1DatagramPacket.getSocketAddress())); -+ var5.writeString(this.serverMotd); -+ var5.writeString("SMP"); -+ var5.writeString(this.worldName); -+ var5.writeString(Integer.toString(this.getNumberOfPlayers())); -+ var5.writeString(Integer.toString(this.maxPlayers)); -+ var5.writeShort((short)this.serverPort); -+ var5.writeString(this.queryHostname); -+ this.sendResponsePacket(var5.toByteArray(), par1DatagramPacket); -+ this.logDebug("Status [" + var4 + "]"); -+ } -+ -+ case 9: -+ this.sendAuthChallenge(par1DatagramPacket); -+ this.logDebug("Challenge [" + var4 + "]"); -+ return true; -+ -+ default: -+ return true; - } - } else { - this.logDebug("Invalid packet [" + var4 + "]"); -@@ -117,11 +160,15 @@ - } - } - -- private byte[] createQueryResponse(DatagramPacket var1) throws IOException { -- long var2 = MinecraftServer.getCurrentTimeMillis(); -- if(var2 < this.lastQueryResponseTime + 5000L) { -+ /** -+ * Creates a query response as a byte array for the specified query DatagramPacket -+ */ -+ private byte[] createQueryResponse(DatagramPacket par1DatagramPacket) throws IOException { -+ long var2 = MinecraftServer.getSystemTimeMillis(); -+ -+ if (var2 < this.lastQueryResponseTime + 5000L) { - byte[] var7 = this.output.toByteArray(); -- byte[] var8 = this.getRequestID(var1.getSocketAddress()); -+ byte[] var8 = this.getRequestID(par1DatagramPacket.getSocketAddress()); - var7[1] = var8[0]; - var7[2] = var8[1]; - var7[3] = var8[2]; -@@ -131,12 +178,12 @@ - this.lastQueryResponseTime = var2; - this.output.reset(); - this.output.writeInt(0); -- this.output.writeByteArray(this.getRequestID(var1.getSocketAddress())); -+ this.output.writeByteArray(this.getRequestID(par1DatagramPacket.getSocketAddress())); - this.output.writeString("splitnum"); - this.output.writeInt(128); - this.output.writeInt(0); - this.output.writeString("hostname"); -- this.output.writeString(this.k); -+ this.output.writeString(this.serverMotd); - this.output.writeString("gametype"); - this.output.writeString("SMP"); - this.output.writeString("game_id"); -@@ -146,7 +193,7 @@ - this.output.writeString("plugins"); - this.output.writeString(this.server.getPlugins()); - this.output.writeString("map"); -- this.output.writeString(this.l); -+ this.output.writeString(this.worldName); - this.output.writeString("numplayers"); - this.output.writeString("" + this.getNumberOfPlayers()); - this.output.writeString("maxplayers"); -@@ -154,7 +201,7 @@ - this.output.writeString("hostport"); - this.output.writeString("" + this.serverPort); - this.output.writeString("hostip"); -- this.output.writeString(this.q); -+ this.output.writeString(this.queryHostname); - this.output.writeInt(0); - this.output.writeInt(1); - this.output.writeString("player_"); -@@ -162,7 +209,7 @@ - String[] var4 = this.server.getAllUsernames(); - byte var5 = (byte)var4.length; - -- for(byte var6 = (byte)(var5 - 1); var6 >= 0; --var6) { -+ for (byte var6 = (byte)(var5 - 1); var6 >= 0; --var6) { - this.output.writeString(var4[var6]); - } - -@@ -171,58 +218,73 @@ - } - } - -- private byte[] getRequestID(SocketAddress var1) { -- return ((RConThreadQueryAuth)this.s.get(var1)).getRequestId(); -+ /** -+ * Returns the request ID provided by the authorized client -+ */ -+ private byte[] getRequestID(SocketAddress par1SocketAddress) { -+ return ((RConThreadQueryAuth)this.queryClients.get(par1SocketAddress)).getRequestId(); - } - -- private Boolean verifyClientAuth(DatagramPacket var1) { -- SocketAddress var2 = var1.getSocketAddress(); -- if(!this.s.containsKey(var2)) { -+ /** -+ * Returns true if the client has a valid auth, otherwise false -+ */ -+ private Boolean verifyClientAuth(DatagramPacket par1DatagramPacket) { -+ SocketAddress var2 = par1DatagramPacket.getSocketAddress(); -+ -+ if (!this.queryClients.containsKey(var2)) { - return Boolean.valueOf(false); - } else { -- byte[] var3 = var1.getData(); -- return ((RConThreadQueryAuth)this.s.get(var2)).getRandomChallenge() != RConUtils.getBytesAsBEint(var3, 7, var1.getLength()) ? Boolean.valueOf(false) : Boolean.valueOf(true); -+ byte[] var3 = par1DatagramPacket.getData(); -+ return ((RConThreadQueryAuth)this.queryClients.get(var2)).getRandomChallenge() != RConUtils.getBytesAsBEint(var3, 7, par1DatagramPacket.getLength()) ? Boolean.valueOf(false) : Boolean.valueOf(true); - } - } - -- private void sendAuthChallenge(DatagramPacket var1) throws IOException { -- RConThreadQueryAuth var2 = new RConThreadQueryAuth(this, var1); -- this.s.put(var1.getSocketAddress(), var2); -- this.sendResponsePacket(var2.getChallengeValue(), var1); -+ /** -+ * Sends an auth challenge DatagramPacket to the client and adds the client to the queryClients map -+ */ -+ private void sendAuthChallenge(DatagramPacket par1DatagramPacket) throws IOException { -+ RConThreadQueryAuth var2 = new RConThreadQueryAuth(this, par1DatagramPacket); -+ this.queryClients.put(par1DatagramPacket.getSocketAddress(), var2); -+ this.sendResponsePacket(var2.getChallengeValue(), par1DatagramPacket); - } - -+ /** -+ * Removes all clients whose auth is no longer valid -+ */ - private void cleanQueryClientsMap() { -- if(this.running) { -- long var1 = MinecraftServer.getCurrentTimeMillis(); -- if(var1 >= this.lastAuthCheckTime + 30000L) { -+ if (this.running) { -+ long var1 = MinecraftServer.getSystemTimeMillis(); -+ -+ if (var1 >= this.lastAuthCheckTime + 30000L) { - this.lastAuthCheckTime = var1; -- Iterator var3 = this.s.entrySet().iterator(); -+ Iterator var3 = this.queryClients.entrySet().iterator(); - -- while(var3.hasNext()) { -+ while (var3.hasNext()) { - Entry var4 = (Entry)var3.next(); -- if(((RConThreadQueryAuth)var4.getValue()).hasExpired(var1).booleanValue()) { -+ -+ if (((RConThreadQueryAuth)var4.getValue()).hasExpired(var1).booleanValue()) { - var3.remove(); - } - } -- - } - } - } - - public void run() { -- this.logInfo("Query running on " + this.r + ":" + this.queryPort); -- this.lastAuthCheckTime = MinecraftServer.getCurrentTimeMillis(); -- this.o = new DatagramPacket(this.buffer, this.buffer.length); -+ this.logInfo("Query running on " + this.serverHostname + ":" + this.queryPort); -+ this.lastAuthCheckTime = MinecraftServer.getSystemTimeMillis(); -+ this.incomingPacket = new DatagramPacket(this.buffer, this.buffer.length); - - try { -- while(this.running) { -+ while (this.running) { - try { -- this.m.receive(this.o); -+ this.querySocket.receive(this.incomingPacket); - this.cleanQueryClientsMap(); -- this.parseIncomingPacket(this.o); -+ this.parseIncomingPacket(this.incomingPacket); - } catch (SocketTimeoutException var7) { - this.cleanQueryClientsMap(); - } catch (PortUnreachableException var8) { -+ ; - } catch (IOException var9) { - this.stopWithException(var9); - } -@@ -230,45 +292,52 @@ - } finally { - this.closeAllSockets(); - } -- - } - -+ /** -+ * Creates a new Thread object from this class and starts running -+ */ - public void startThread() { -- if(!this.running) { -- if(0 < this.queryPort && '\uffff' >= this.queryPort) { -- if(this.initQuerySystem()) { -+ if (!this.running) { -+ if (0 < this.queryPort && 65535 >= this.queryPort) { -+ if (this.initQuerySystem()) { - super.startThread(); - } -- - } else { - this.logWarning("Invalid query port " + this.queryPort + " found in \'" + this.server.getSettingsFilename() + "\' (queries disabled)"); - } - } - } - -- private void stopWithException(Exception var1) { -- if(this.running) { -- this.logWarning("Unexpected exception, buggy JRE? (" + var1.toString() + ")"); -- if(!this.initQuerySystem()) { -+ /** -+ * Stops the query server and reports the given Exception -+ */ -+ private void stopWithException(Exception par1Exception) { -+ if (this.running) { -+ this.logWarning("Unexpected exception, buggy JRE? (" + par1Exception.toString() + ")"); -+ -+ if (!this.initQuerySystem()) { - this.logSevere("Failed to recover from buggy JRE, shutting down!"); - this.running = false; - } -- - } - } - -+ /** -+ * Initializes the query system by binding it to a port -+ */ - private boolean initQuerySystem() { - try { -- this.m = new DatagramSocket(this.queryPort, InetAddress.getByName(this.r)); -- this.registerSocket(this.m); -- this.m.setSoTimeout(500); -+ this.querySocket = new DatagramSocket(this.queryPort, InetAddress.getByName(this.serverHostname)); -+ this.registerSocket(this.querySocket); -+ this.querySocket.setSoTimeout(500); - return true; - } catch (SocketException var2) { -- this.logWarning("Unable to initialise query system on " + this.r + ":" + this.queryPort + " (Socket): " + var2.getMessage()); -+ this.logWarning("Unable to initialise query system on " + this.serverHostname + ":" + this.queryPort + " (Socket): " + var2.getMessage()); - } catch (UnknownHostException var3) { -- this.logWarning("Unable to initialise query system on " + this.r + ":" + this.queryPort + " (Unknown Host): " + var3.getMessage()); -+ this.logWarning("Unable to initialise query system on " + this.serverHostname + ":" + this.queryPort + " (Unknown Host): " + var3.getMessage()); - } catch (Exception var4) { -- this.logWarning("Unable to initialise query system on " + this.r + ":" + this.queryPort + " (E): " + var4.getMessage()); -+ this.logWarning("Unable to initialise query system on " + this.serverHostname + ":" + this.queryPort + " (E): " + var4.getMessage()); - } - - return false; ---- /dev/null -+++ org/spoutcraft/client/gui/settings/controls/AutomatedCheckBox.java -@@ -1,0 +1,38 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.client.gui.settings.controls; -+ -+import org.spoutcraft.api.gui.GenericCheckBox; -+import org.spoutcraft.client.config.Configuration; -+ -+public class AutomatedCheckBox extends GenericCheckBox { -+ public AutomatedCheckBox() { -+ super(); -+ } -+ -+ public AutomatedCheckBox(String title) { -+ super(title); -+ } -+ -+ @Override -+ public boolean isEnabled() { -+ return !Configuration.isAutomatePerformance(); -+ } -+} ---- /dev/null -+++ org/spoutcraft/client/gui/database/GuiAPIDisplay.java -@@ -1,0 +1,26 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.client.gui.database; -+ -+import net.minecraft.src.GuiScreen; -+ -+public abstract class GuiAPIDisplay extends GuiScreen { -+ public abstract void updateButtons(); -+} ---- net/minecraft/src/LanServerList.java -+++ net/minecraft/src/LanServerList.java -@@ -7,7 +7,7 @@ - import java.util.List; - - public class LanServerList { -- private ArrayList b = new ArrayList(); -+ private ArrayList listOfLanServers = new ArrayList(); - boolean wasUpdated; - - public synchronized boolean getWasUpdated() { -@@ -19,31 +19,32 @@ - } - - public synchronized List getLanServers() { -- return Collections.unmodifiableList(this.b); -+ return Collections.unmodifiableList(this.listOfLanServers); - } - -- public synchronized void func_77551_a(String var1, InetAddress var2) { -- String var3 = ThreadLanServerPing.getMotdFromPingResponse(var1); -- String var4 = ThreadLanServerPing.getAdFromPingResponse(var1); -- if(var4 != null) { -- var4 = var2.getHostAddress() + ":" + var4; -+ public synchronized void func_77551_a(String par1Str, InetAddress par2InetAddress) { -+ String var3 = ThreadLanServerPing.getMotdFromPingResponse(par1Str); -+ String var4 = ThreadLanServerPing.getAdFromPingResponse(par1Str); -+ -+ if (var4 != null) { -+ var4 = par2InetAddress.getHostAddress() + ":" + var4; - boolean var5 = false; -- Iterator var6 = this.b.iterator(); -+ Iterator var6 = this.listOfLanServers.iterator(); - -- while(var6.hasNext()) { -+ while (var6.hasNext()) { - LanServer var7 = (LanServer)var6.next(); -- if(var7.getServerIpPort().equals(var4)) { -+ -+ if (var7.getServerIpPort().equals(var4)) { - var7.updateLastSeen(); - var5 = true; - break; - } - } - -- if(!var5) { -- this.b.add(new LanServer(var3, var4)); -+ if (!var5) { -+ this.listOfLanServers.add(new LanServer(var3, var4)); - this.wasUpdated = true; - } -- - } - } - } ---- net/minecraft/src/ItemRedstone.java -+++ net/minecraft/src/ItemRedstone.java -@@ -1,48 +1,52 @@ - package net.minecraft.src; - - public class ItemRedstone extends Item { -- public ItemRedstone(int var1) { -- super(var1); -+ public ItemRedstone(int par1) { -+ super(par1); - this.setCreativeTab(CreativeTabs.tabRedstone); - } - -- public boolean onItemUse(ItemStack var1, EntityPlayer var2, World var3, int var4, int var5, int var6, int var7, float var8, float var9, float var10) { -- if(var3.getBlockId(var4, var5, var6) != Block.snow.blockID) { -- if(var7 == 0) { -- --var5; -- } -- -- if(var7 == 1) { -- ++var5; -- } -- -- if(var7 == 2) { -- --var6; -- } -- -- if(var7 == 3) { -- ++var6; -- } -- -- if(var7 == 4) { -- --var4; -- } -- -- if(var7 == 5) { -- ++var4; -- } -- -- if(!var3.isAirBlock(var4, var5, var6)) { -+ /** -+ * Callback for item usage. If the item does something special on right clicking, he will have one of those. Return -+ * True if something happen and false if it don't. This is for ITEMS, not BLOCKS -+ */ -+ public boolean onItemUse(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, World par3World, int par4, int par5, int par6, int par7, float par8, float par9, float par10) { -+ if (par3World.getBlockId(par4, par5, par6) != Block.snow.blockID) { -+ if (par7 == 0) { -+ --par5; -+ } -+ -+ if (par7 == 1) { -+ ++par5; -+ } -+ -+ if (par7 == 2) { -+ --par6; -+ } -+ -+ if (par7 == 3) { -+ ++par6; -+ } -+ -+ if (par7 == 4) { -+ --par4; -+ } -+ -+ if (par7 == 5) { -+ ++par4; -+ } -+ -+ if (!par3World.isAirBlock(par4, par5, par6)) { - return false; - } - } - -- if(!var2.canPlayerEdit(var4, var5, var6, var7, var1)) { -+ if (!par2EntityPlayer.canPlayerEdit(par4, par5, par6, par7, par1ItemStack)) { - return false; - } else { -- if(Block.redstoneWire.canPlaceBlockAt(var3, var4, var5, var6)) { -- --var1.stackSize; -- var3.setBlock(var4, var5, var6, Block.redstoneWire.blockID); -+ if (Block.redstoneWire.canPlaceBlockAt(par3World, par4, par5, par6)) { -+ --par1ItemStack.stackSize; -+ par3World.setBlock(par4, par5, par6, Block.redstoneWire.blockID); - } - - return true; ---- /dev/null -+++ org/spoutcraft/client/gui/settings/controls/WaterBiomeColorsButton.java -@@ -1,0 +1,43 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.client.gui.settings.controls; -+ -+import net.minecraft.src.Minecraft; -+ -+import org.spoutcraft.api.gui.GenericCheckBox; -+import org.spoutcraft.client.config.Configuration; -+ -+public class WaterBiomeColorsButton extends GenericCheckBox { -+ public WaterBiomeColorsButton() { -+ super("Water Biome Colors"); -+ this.setChecked(Configuration.isWaterBiomeColors()); -+ setTooltip("Water Biome Colors\nOn - water will have colors adjusted for biomes\nOff - vanilla water colors."); -+ } -+ -+ @Override -+ public void onButtonClick() { -+ Configuration.setWaterBiomeColors(!Configuration.isWaterBiomeColors()); -+ Configuration.write(); -+ -+ if (Minecraft.getMinecraft().theWorld != null) { -+ Minecraft.getMinecraft().renderGlobal.updateAllRenderers(); -+ } -+ } -+} ---- net/minecraft/src/ResourcePackRepositoryEntry.java -+++ net/minecraft/src/ResourcePackRepositoryEntry.java -@@ -7,47 +7,48 @@ - import org.apache.commons.io.IOUtils; - - public class ResourcePackRepositoryEntry { -- private final File b; -+ private final File resourcePackFile; - private ResourcePack reResourcePack; - private PackMetadataSection rePackMetadataSection; -- private BufferedImage e; -+ private BufferedImage texturePackIcon; - private ResourceLocation locationTexturePackIcon; -+ - final ResourcePackRepository reResourcePackRepository; - -- private ResourcePackRepositoryEntry(ResourcePackRepository var1, File var2) { -- this.reResourcePackRepository = var1; -- this.b = var2; -+ private ResourcePackRepositoryEntry(ResourcePackRepository par1ResourcePackRepository, File par2File) { -+ this.reResourcePackRepository = par1ResourcePackRepository; -+ this.resourcePackFile = par2File; - } - - public void updateResourcePack() throws IOException { -- this.reResourcePack = (ResourcePack)(this.b.isDirectory() ? new FolderResourcePack(this.b) : new FileResourcePack(this.b)); -+ this.reResourcePack = (ResourcePack)(this.resourcePackFile.isDirectory() ? new FolderResourcePack(this.resourcePackFile) : new FileResourcePack(this.resourcePackFile)); - this.rePackMetadataSection = (PackMetadataSection)this.reResourcePack.getPackMetadata(this.reResourcePackRepository.rprMetadataSerializer, "pack"); - - try { -- this.e = this.reResourcePack.getPackImage(); -+ this.texturePackIcon = this.reResourcePack.getPackImage(); - } catch (IOException var2) { -+ ; - } - -- if(this.e == null) { -- this.e = this.reResourcePackRepository.rprDefaultResourcePack.getPackImage(); -+ if (this.texturePackIcon == null) { -+ this.texturePackIcon = this.reResourcePackRepository.rprDefaultResourcePack.getPackImage(); - } - - this.closeResourcePack(); - } - -- public void bindTexturePackIcon(TextureManager var1) { -- if(this.locationTexturePackIcon == null) { -- this.locationTexturePackIcon = var1.getDynamicTextureLocation("texturepackicon", new DynamicTexture(this.e)); -+ public void bindTexturePackIcon(TextureManager par1TextureManager) { -+ if (this.locationTexturePackIcon == null) { -+ this.locationTexturePackIcon = par1TextureManager.getDynamicTextureLocation("texturepackicon", new DynamicTexture(this.texturePackIcon)); - } - -- var1.bindTexture(this.locationTexturePackIcon); -+ par1TextureManager.bindTexture(this.locationTexturePackIcon); - } - - public void closeResourcePack() { -- if(this.reResourcePack instanceof Closeable) { -+ if (this.reResourcePack instanceof Closeable) { - IOUtils.closeQuietly((Closeable)this.reResourcePack); - } -- - } - - public ResourcePack getResourcePack() { -@@ -62,8 +63,8 @@ - return this.rePackMetadataSection == null ? EnumChatFormatting.RED + "Invalid pack.mcmeta (or missing \'pack\' section)" : this.rePackMetadataSection.getPackDescription(); - } - -- public boolean equals(Object var1) { -- return this == var1 ? true : (var1 instanceof ResourcePackRepositoryEntry ? this.toString().equals(var1.toString()) : false); -+ public boolean equals(Object par1Obj) { -+ return this == par1Obj ? true : (par1Obj instanceof ResourcePackRepositoryEntry ? this.toString().equals(par1Obj.toString()) : false); - } - - public int hashCode() { -@@ -71,10 +72,10 @@ - } - - public String toString() { -- return String.format("%s:%s:%d", new Object[]{this.b.getName(), this.b.isDirectory() ? "folder" : "zip", Long.valueOf(this.b.lastModified())}); -+ return String.format("%s:%s:%d", new Object[] {this.resourcePackFile.getName(), this.resourcePackFile.isDirectory() ? "folder" : "zip", Long.valueOf(this.resourcePackFile.lastModified())}); - } - -- ResourcePackRepositoryEntry(ResourcePackRepository var1, File var2, ResourcePackRepositoryFilter var3) { -- this(var1, var2); -+ ResourcePackRepositoryEntry(ResourcePackRepository par1ResourcePackRepository, File par2File, ResourcePackRepositoryFilter par3ResourcePackRepositoryFilter) { -+ this(par1ResourcePackRepository, par2File); - } - } ---- /dev/null -+++ org/spoutcraft/client/gui/server/ServerListInfo.java -@@ -1,0 +1,36 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.client.gui.server; -+ -+import java.util.ArrayList; -+import java.util.HashMap; -+import java.util.LinkedHashMap; -+import java.util.List; -+ -+public class ServerListInfo { -+ public List serverList = new ArrayList();; -+ public int activeCountry = 0; -+ public List countries = new ArrayList(); -+ public HashMap> countryMappings = new LinkedHashMap>(); -+ public int page = 0; -+ public int pages = 0; -+ -+ public String status ; -+} ---- net/minecraft/src/GuiBrewingStand.java -+++ net/minecraft/src/GuiBrewingStand.java -@@ -6,58 +6,72 @@ - private static final ResourceLocation brewingStandGuiTextures = new ResourceLocation("textures/gui/container/brewing_stand.png"); - private TileEntityBrewingStand brewingStand; - -- public GuiBrewingStand(InventoryPlayer var1, TileEntityBrewingStand var2) { -- super(new ContainerBrewingStand(var1, var2)); -- this.brewingStand = var2; -+ public GuiBrewingStand(InventoryPlayer par1InventoryPlayer, TileEntityBrewingStand par2TileEntityBrewingStand) { -+ super(new ContainerBrewingStand(par1InventoryPlayer, par2TileEntityBrewingStand)); -+ this.brewingStand = par2TileEntityBrewingStand; - } - -- protected void drawGuiContainerForegroundLayer(int var1, int var2) { -+ /** -+ * Draw the foreground layer for the GuiContainer (everything in front of the items) -+ */ -+ protected void drawGuiContainerForegroundLayer(int par1, int par2) { - String var3 = this.brewingStand.isInvNameLocalized() ? this.brewingStand.getInvName() : I18n.getString(this.brewingStand.getInvName()); - this.fontRenderer.drawString(var3, this.xSize / 2 - this.fontRenderer.getStringWidth(var3) / 2, 6, 4210752); - this.fontRenderer.drawString(I18n.getString("container.inventory"), 8, this.ySize - 96 + 2, 4210752); - } - -- protected void drawGuiContainerBackgroundLayer(float var1, int var2, int var3) { -+ /** -+ * Draw the background layer for the GuiContainer (everything behind the items) -+ */ -+ protected void drawGuiContainerBackgroundLayer(float par1, int par2, int par3) { - GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - this.mc.getTextureManager().bindTexture(brewingStandGuiTextures); - int var4 = (this.width - this.xSize) / 2; - int var5 = (this.height - this.ySize) / 2; - this.drawTexturedModalRect(var4, var5, 0, 0, this.xSize, this.ySize); - int var6 = this.brewingStand.getBrewTime(); -- if(var6 > 0) { -+ -+ if (var6 > 0) { - int var7 = (int)(28.0F * (1.0F - (float)var6 / 400.0F)); -- if(var7 > 0) { -+ -+ if (var7 > 0) { - this.drawTexturedModalRect(var4 + 97, var5 + 16, 176, 0, 9, var7); - } - - int var8 = var6 / 2 % 7; -- switch(var8) { -- case 0: -- var7 = 29; -- break; -- case 1: -- var7 = 24; -- break; -- case 2: -- var7 = 20; -- break; -- case 3: -- var7 = 16; -- break; -- case 4: -- var7 = 11; -- break; -- case 5: -- var7 = 6; -- break; -- case 6: -- var7 = 0; -+ -+ switch (var8) { -+ case 0: -+ var7 = 29; -+ break; -+ -+ case 1: -+ var7 = 24; -+ break; -+ -+ case 2: -+ var7 = 20; -+ break; -+ -+ case 3: -+ var7 = 16; -+ break; -+ -+ case 4: -+ var7 = 11; -+ break; -+ -+ case 5: -+ var7 = 6; -+ break; -+ -+ case 6: -+ var7 = 0; - } - -- if(var7 > 0) { -+ if (var7 > 0) { - this.drawTexturedModalRect(var4 + 65, var5 + 14 + 29 - var7, 185, 29 - var7, 12, var7); - } - } -- - } - } ---- /dev/null -+++ org/spoutcraft/client/packet/PacketPermissionUpdate.java -@@ -1,0 +1,80 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.client.packet; -+ -+import java.io.IOException; -+import java.util.HashMap; -+import java.util.Map; -+import java.util.Map.Entry; -+ -+import org.spoutcraft.api.io.SpoutInputStream; -+import org.spoutcraft.api.io.SpoutOutputStream; -+import org.spoutcraft.client.SpoutClient; -+ -+public class PacketPermissionUpdate implements SpoutPacket { -+private Map permissions; -+ -+ public PacketPermissionUpdate() { -+ permissions = new HashMap(); -+ } -+ -+ public PacketPermissionUpdate(Map permissions) { -+ this.permissions = permissions; -+ } -+ -+ @Override -+ public void writeData(SpoutOutputStream output) throws IOException { -+ output.writeInt(permissions.size()); -+ for (Entry perm:permissions.entrySet()) { -+ output.writeString(perm.getKey()); -+ output.writeBoolean(perm.getValue()); -+ } -+ } -+ -+ @Override -+ public void readData(SpoutInputStream input) throws IOException { -+ int num = input.readInt(); -+ for (int i = 0; i < num; i++) { -+ String perm = input.readString(); -+ boolean allowed = input.readBoolean(); -+ permissions.put(perm, allowed); -+ } -+ } -+ -+ @Override -+ public PacketType getPacketType() { -+ return PacketType.PacketPermissionUpdate; -+ } -+ -+ @Override -+ public int getVersion() { -+ return 0; -+ } -+ -+ @Override -+ public void run(int playerId) { -+ for (Entry perm:permissions.entrySet()) { -+ SpoutClient.getInstance().setPermission(perm.getKey(), perm.getValue()); -+ } -+ } -+ -+ @Override -+ public void failure(int playerId) {} -+} ---- /dev/null -+++ org/spoutcraft/client/gui/settings/controls/SmoothFPSButton.java -@@ -1,0 +1,36 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.client.gui.settings.controls; -+ -+import org.spoutcraft.client.config.Configuration; -+ -+public class SmoothFPSButton extends AutomatedCheckBox { -+ public SmoothFPSButton() { -+ super("Smooth FPS"); -+ setChecked(Configuration.isSmoothFPS()); -+ setTooltip("Stabilizes FPS by flushing the graphic driver buffers\nOFF - no stabilization, FPS may fluctuate\nON - FPS stabilization\nThis option is graphic driver dependant and its effect\nis not always visible"); -+ } -+ -+ @Override -+ public void onButtonClick() { -+ Configuration.setSmoothFPS(!Configuration.isSmoothFPS()); -+ Configuration.write(); -+ } -+} ---- net/minecraft/src/RecipeFireworks.java -+++ net/minecraft/src/RecipeFireworks.java -@@ -5,7 +5,10 @@ - public class RecipeFireworks implements IRecipe { - private ItemStack field_92102_a; - -- public boolean matches(InventoryCrafting var1, World var2) { -+ /** -+ * Used to check if a recipe matches current crafting inventory -+ */ -+ public boolean matches(InventoryCrafting par1InventoryCrafting, World par2World) { - this.field_92102_a = null; - int var3 = 0; - int var4 = 0; -@@ -14,29 +17,30 @@ - int var7 = 0; - int var8 = 0; - -- for(int var9 = 0; var9 < var1.getSizeInventory(); ++var9) { -- ItemStack var10 = var1.getStackInSlot(var9); -- if(var10 != null) { -- if(var10.itemID == Item.gunpowder.itemID) { -+ for (int var9 = 0; var9 < par1InventoryCrafting.getSizeInventory(); ++var9) { -+ ItemStack var10 = par1InventoryCrafting.getStackInSlot(var9); -+ -+ if (var10 != null) { -+ if (var10.itemID == Item.gunpowder.itemID) { - ++var4; -- } else if(var10.itemID == Item.fireworkCharge.itemID) { -+ } else if (var10.itemID == Item.fireworkCharge.itemID) { - ++var6; -- } else if(var10.itemID == Item.dyePowder.itemID) { -+ } else if (var10.itemID == Item.dyePowder.itemID) { - ++var5; -- } else if(var10.itemID == Item.paper.itemID) { -+ } else if (var10.itemID == Item.paper.itemID) { - ++var3; -- } else if(var10.itemID == Item.glowstone.itemID) { -- ++var7; -- } else if(var10.itemID == Item.diamond.itemID) { -- ++var7; -- } else if(var10.itemID == Item.fireballCharge.itemID) { -- ++var8; -- } else if(var10.itemID == Item.feather.itemID) { -- ++var8; -- } else if(var10.itemID == Item.goldNugget.itemID) { -+ } else if (var10.itemID == Item.glowstone.itemID) { -+ ++var7; -+ } else if (var10.itemID == Item.diamond.itemID) { -+ ++var7; -+ } else if (var10.itemID == Item.fireballCharge.itemID) { -+ ++var8; -+ } else if (var10.itemID == Item.feather.itemID) { -+ ++var8; -+ } else if (var10.itemID == Item.goldNugget.itemID) { - ++var8; - } else { -- if(var10.itemID != Item.skull.itemID) { -+ if (var10.itemID != Item.skull.itemID) { - return false; - } - -@@ -46,19 +50,23 @@ - } - - var7 += var5 + var8; -- if(var4 <= 3 && var3 <= 1) { -+ -+ if (var4 <= 3 && var3 <= 1) { - NBTTagCompound var16; - NBTTagCompound var19; -- if(var4 >= 1 && var3 == 1 && var7 == 0) { -+ -+ if (var4 >= 1 && var3 == 1 && var7 == 0) { - this.field_92102_a = new ItemStack(Item.firework); -- if(var6 > 0) { -+ -+ if (var6 > 0) { - var16 = new NBTTagCompound(); - var19 = new NBTTagCompound("Fireworks"); - NBTTagList var25 = new NBTTagList("Explosions"); - -- for(int var22 = 0; var22 < var1.getSizeInventory(); ++var22) { -- ItemStack var26 = var1.getStackInSlot(var22); -- if(var26 != null && var26.itemID == Item.fireworkCharge.itemID && var26.hasTagCompound() && var26.getTagCompound().hasKey("Explosion")) { -+ for (int var22 = 0; var22 < par1InventoryCrafting.getSizeInventory(); ++var22) { -+ ItemStack var26 = par1InventoryCrafting.getStackInSlot(var22); -+ -+ if (var26 != null && var26.itemID == Item.fireworkCharge.itemID && var26.hasTagCompound() && var26.getTagCompound().hasKey("Explosion")) { - var25.appendTag(var26.getTagCompound().getCompoundTag("Explosion")); - } - } -@@ -70,29 +78,30 @@ - } - - return true; -- } else if(var4 == 1 && var3 == 0 && var6 == 0 && var5 > 0 && var8 <= 1) { -+ } else if (var4 == 1 && var3 == 0 && var6 == 0 && var5 > 0 && var8 <= 1) { - this.field_92102_a = new ItemStack(Item.fireworkCharge); - var16 = new NBTTagCompound(); - var19 = new NBTTagCompound("Explosion"); - byte var23 = 0; - ArrayList var12 = new ArrayList(); - -- for(int var13 = 0; var13 < var1.getSizeInventory(); ++var13) { -- ItemStack var14 = var1.getStackInSlot(var13); -- if(var14 != null) { -- if(var14.itemID == Item.dyePowder.itemID) { -+ for (int var13 = 0; var13 < par1InventoryCrafting.getSizeInventory(); ++var13) { -+ ItemStack var14 = par1InventoryCrafting.getStackInSlot(var13); -+ -+ if (var14 != null) { -+ if (var14.itemID == Item.dyePowder.itemID) { - var12.add(Integer.valueOf(ItemDye.dyeColors[var14.getItemDamage()])); -- } else if(var14.itemID == Item.glowstone.itemID) { -+ } else if (var14.itemID == Item.glowstone.itemID) { - var19.setBoolean("Flicker", true); -- } else if(var14.itemID == Item.diamond.itemID) { -+ } else if (var14.itemID == Item.diamond.itemID) { - var19.setBoolean("Trail", true); -- } else if(var14.itemID == Item.fireballCharge.itemID) { -+ } else if (var14.itemID == Item.fireballCharge.itemID) { - var23 = 1; -- } else if(var14.itemID == Item.feather.itemID) { -+ } else if (var14.itemID == Item.feather.itemID) { - var23 = 4; -- } else if(var14.itemID == Item.goldNugget.itemID) { -+ } else if (var14.itemID == Item.goldNugget.itemID) { - var23 = 2; -- } else if(var14.itemID == Item.skull.itemID) { -+ } else if (var14.itemID == Item.skull.itemID) { - var23 = 3; - } - } -@@ -100,7 +109,7 @@ - - int[] var24 = new int[var12.size()]; - -- for(int var27 = 0; var27 < var24.length; ++var27) { -+ for (int var27 = 0; var27 < var24.length; ++var27) { - var24[var27] = ((Integer)var12.get(var27)).intValue(); - } - -@@ -109,15 +118,16 @@ - var16.setTag("Explosion", var19); - this.field_92102_a.setTagCompound(var16); - return true; -- } else if(var4 == 0 && var3 == 0 && var6 == 1 && var5 > 0 && var5 == var7) { -+ } else if (var4 == 0 && var3 == 0 && var6 == 1 && var5 > 0 && var5 == var7) { - ArrayList var15 = new ArrayList(); - -- for(int var17 = 0; var17 < var1.getSizeInventory(); ++var17) { -- ItemStack var11 = var1.getStackInSlot(var17); -- if(var11 != null) { -- if(var11.itemID == Item.dyePowder.itemID) { -+ for (int var17 = 0; var17 < par1InventoryCrafting.getSizeInventory(); ++var17) { -+ ItemStack var11 = par1InventoryCrafting.getStackInSlot(var17); -+ -+ if (var11 != null) { -+ if (var11.itemID == Item.dyePowder.itemID) { - var15.add(Integer.valueOf(ItemDye.dyeColors[var11.getItemDamage()])); -- } else if(var11.itemID == Item.fireworkCharge.itemID) { -+ } else if (var11.itemID == Item.fireworkCharge.itemID) { - this.field_92102_a = var11.copy(); - this.field_92102_a.stackSize = 1; - } -@@ -126,13 +136,14 @@ - - int[] var18 = new int[var15.size()]; - -- for(int var20 = 0; var20 < var18.length; ++var20) { -+ for (int var20 = 0; var20 < var18.length; ++var20) { - var18[var20] = ((Integer)var15.get(var20)).intValue(); - } - -- if(this.field_92102_a != null && this.field_92102_a.hasTagCompound()) { -+ if (this.field_92102_a != null && this.field_92102_a.hasTagCompound()) { - NBTTagCompound var21 = this.field_92102_a.getTagCompound().getCompoundTag("Explosion"); -- if(var21 == null) { -+ -+ if (var21 == null) { - return false; - } else { - var21.setIntArray("FadeColors", var18); -@@ -149,10 +160,16 @@ - } - } - -- public ItemStack getCraftingResult(InventoryCrafting var1) { -+ /** -+ * Returns an Item that is the result of this recipe -+ */ -+ public ItemStack getCraftingResult(InventoryCrafting par1InventoryCrafting) { - return this.field_92102_a.copy(); - } - -+ /** -+ * Returns the size of the recipe area -+ */ - public int getRecipeSize() { - return 10; - } ---- /dev/null -+++ org/spoutcraft/api/gui/GenericPopup.java -@@ -1,0 +1,85 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.api.gui; -+ -+import java.io.IOException; -+ -+import org.spoutcraft.api.UnsafeClass; -+import org.spoutcraft.api.io.SpoutInputStream; -+import org.spoutcraft.api.io.SpoutOutputStream; -+ -+@UnsafeClass -+public class GenericPopup extends GenericScreen implements PopupScreen { -+ protected boolean transparent = false, pause = true; -+ protected double mouseX, mouseY; -+ -+ public GenericPopup() { -+ } -+ -+ public int getVersion() { -+ return super.getVersion() + 0; -+ } -+ -+ @Override -+ public void readData(SpoutInputStream input) throws IOException { -+ super.readData(input); -+ this.setTransparent(input.readBoolean()); -+ } -+ -+ @Override -+ public void writeData(SpoutOutputStream output) throws IOException { -+ super.writeData(output); -+ output.writeBoolean(isTransparent()); -+ } -+ -+ public boolean isTransparent() { -+ return transparent; -+ } -+ -+ public PopupScreen setTransparent(boolean value) { -+ this.transparent = value; -+ return this; -+ } -+ -+ public WidgetType getType() { -+ return WidgetType.PopupScreen; -+ } -+ -+ public boolean close() { -+ if (getScreen() != null) { -+ if (getScreen() instanceof InGameHUD) { -+ ((InGameHUD) getScreen()).closePopup(); -+ } -+ } -+ return false; -+ } -+ -+ public ScreenType getScreenType() { -+ return ScreenType.CUSTOM_SCREEN; -+ } -+ -+ public boolean isPausingGame() { -+ return pause; -+ } -+ -+ public void setPauseGame(boolean v) { -+ pause = v; -+ } -+} ---- net/minecraft/src/DispenserBehaviorMobEgg.java -+++ net/minecraft/src/DispenserBehaviorMobEgg.java -@@ -1,17 +1,22 @@ - package net.minecraft.src; - - final class DispenserBehaviorMobEgg extends BehaviorDefaultDispenseItem { -- public ItemStack dispenseStack(IBlockSource var1, ItemStack var2) { -- EnumFacing var3 = BlockDispenser.getFacing(var1.getBlockMetadata()); -- double var4 = var1.getX() + (double)var3.getFrontOffsetX(); -- double var6 = (double)((float)var1.getYInt() + 0.2F); -- double var8 = var1.getZ() + (double)var3.getFrontOffsetZ(); -- Entity var10 = ItemMonsterPlacer.spawnCreature(var1.getWorld(), var2.getItemDamage(), var4, var6, var8); -- if(var10 instanceof EntityLivingBase && var2.hasDisplayName()) { -- ((EntityLiving)var10).setCustomNameTag(var2.getDisplayName()); -+ -+ /** -+ * Dispense the specified stack, play the dispense sound and spawn particles. -+ */ -+ public ItemStack dispenseStack(IBlockSource par1IBlockSource, ItemStack par2ItemStack) { -+ EnumFacing var3 = BlockDispenser.getFacing(par1IBlockSource.getBlockMetadata()); -+ double var4 = par1IBlockSource.getX() + (double)var3.getFrontOffsetX(); -+ double var6 = (double)((float)par1IBlockSource.getYInt() + 0.2F); -+ double var8 = par1IBlockSource.getZ() + (double)var3.getFrontOffsetZ(); -+ Entity var10 = ItemMonsterPlacer.spawnCreature(par1IBlockSource.getWorld(), par2ItemStack.getItemDamage(), var4, var6, var8); -+ -+ if (var10 instanceof EntityLivingBase && par2ItemStack.hasDisplayName()) { -+ ((EntityLiving)var10).setCustomNameTag(par2ItemStack.getDisplayName()); - } - -- var2.splitStack(1); -- return var2; -+ par2ItemStack.splitStack(1); -+ return par2ItemStack; - } - } ---- /dev/null -+++ com/prupe/mcpatcher/TileLoader$1.java -@@ -1,0 +1,86 @@ -+package com.prupe.mcpatcher; -+ -+import java.io.IOException; -+import java.util.Iterator; -+ -+import net.minecraft.src.Tessellator; -+import net.minecraft.src.TextureMap; -+ -+final class TileLoader$1 extends TexturePackChangeHandler { -+ TileLoader$1(String x0, int x1) { -+ super(x0, x1); -+ } -+ -+ public void initialize() {} -+ -+ public void beforeChange() { -+ TileLoader.access$002(true); -+ TessellatorUtils.clear(Tessellator.instance); -+ Iterator i$ = TileLoader.access$100().iterator(); -+ -+ while (i$.hasNext()) { -+ TextureMap textureMap = (TextureMap)i$.next(); -+ -+ try { -+ textureMap.unloadGLTexture(); -+ } catch (Throwable var4) { -+ var4.printStackTrace(); -+ } -+ } -+ -+ TileLoader.access$100().clear(); -+ TileLoader.access$200().clear(); -+ TileLoader.access$300().clear(); -+ } -+ -+ public void afterChange() { -+ while (true) { -+ Iterator i$ = TileLoader.access$200().iterator(); -+ -+ while (true) { -+ if (i$.hasNext()) { -+ TileLoader loader = (TileLoader)i$.next(); -+ -+ if (TileLoader.access$400(loader).isEmpty()) { -+ continue; -+ } -+ -+ if (!loader.allowOverflow || TileLoader.access$500() <= 0) { -+ loader.subLogger.warning("could not load all %s tiles (%d remaining)", new Object[] {loader.mapName, Integer.valueOf(TileLoader.access$400(loader).size())}); -+ TileLoader.access$400(loader).clear(); -+ break; -+ } -+ -+ TileLoader.access$602(false); -+ String mapName = loader.mapName + "_overflow" + TileLoader.access$704(loader); -+ TileLoader.access$800().fine("new TextureAtlas(%s)", new Object[] {mapName}); -+ TextureMap map = new TextureMap(2, mapName); -+ try { -+ map.loadTexture(TexturePackAPI.getResourceManager()); -+ } catch (IOException e) { -+ // TODO Auto-generated catch block -+ e.printStackTrace(); -+ } -+ if (TileLoader.access$600()) { -+ TileLoader.access$100().add(map); -+ break; -+ } -+ -+ TileLoader.access$800().severe("TileLoader.registerIcons was never called! Possible conflict in TextureAtlas.class", new Object[0]); -+ } -+ -+ TileLoader.access$002(false); -+ return; -+ } -+ } -+ } -+ -+ public void afterChange2() { -+ Iterator i$ = TileLoader.access$200().iterator(); -+ -+ while (i$.hasNext()) { -+ TileLoader loader = (TileLoader)i$.next(); -+ loader.finish(); -+ } -+ } -+} ---- net/minecraft/src/Entity.java -+++ net/minecraft/src/Entity.java -@@ -1,67 +1,176 @@ - package net.minecraft.src; - -+import java.util.LinkedList; - import java.util.List; - import java.util.Random; - import java.util.UUID; -+ - import net.minecraft.server.MinecraftServer; -+import net.minecraft.src.EntityPlayer; -+ -+import org.spoutcraft.client.SpoutClient; -+import org.spoutcraft.client.entity.CraftEntityFactory; - - public abstract class Entity { - private static int nextEntityID; -- public int entityId = nextEntityID++; -- public double renderDistanceWeight = 1.0D; -+ // Spout Start -+ public static List toProcess = new LinkedList(); -+ // Spout End -+ public int entityId; -+ public double renderDistanceWeight; -+ -+ /** -+ * Blocks entities from spawning when they do their AABB check to make sure the spot is clear of entities that can -+ * prevent spawning. -+ */ - public boolean preventEntitySpawning; -+ -+ /** The entity that is riding this entity */ - public Entity riddenByEntity; -+ -+ /** The entity we are currently riding */ - public Entity ridingEntity; - public boolean forceSpawn; -+ -+ /** Reference to the World object. */ - public World worldObj; - public double prevPosX; - public double prevPosY; - public double prevPosZ; -+ -+ /** Entity position X */ - public double posX; -+ -+ /** Entity position Y */ - public double posY; -+ -+ /** Entity position Z */ - public double posZ; -+ -+ /** Entity motion X */ - public double motionX; -+ -+ /** Entity motion Y */ - public double motionY; -+ -+ /** Entity motion Z */ - public double motionZ; -+ -+ /** Entity rotation Yaw */ - public float rotationYaw; -+ -+ /** Entity rotation Pitch */ - public float rotationPitch; - public float prevRotationYaw; - public float prevRotationPitch; -- public final AxisAlignedBB boundingBox = AxisAlignedBB.getBoundingBox(0.0D, 0.0D, 0.0D, 0.0D, 0.0D, 0.0D); -+ -+ /** Axis aligned bounding box. */ -+ public final AxisAlignedBB boundingBox; - public boolean onGround; -+ -+ /** -+ * True if after a move this entity has collided with something on X- or Z-axis -+ */ - public boolean isCollidedHorizontally; -+ -+ /** -+ * True if after a move this entity has collided with something on Y-axis -+ */ - public boolean isCollidedVertically; -+ -+ /** -+ * True if after a move this entity has collided with something either vertically or horizontally -+ */ - public boolean isCollided; - public boolean velocityChanged; - protected boolean isInWeb; -- public boolean field_70135_K = true; -+ public boolean field_70135_K; -+ -+ /** -+ * Gets set by setDead, so this must be the flag whether an Entity is dead (inactive may be better term) -+ */ - public boolean isDead; - public float yOffset; -- public float width = 0.6F; -- public float height = 1.8F; -+ -+ /** How wide this entity is considered to be */ -+ public float width; -+ -+ /** How high this entity is considered to be */ -+ public float height; -+ -+ /** The previous ticks distance walked multiplied by 0.6 */ - public float prevDistanceWalkedModified; -+ -+ /** The distance walked multiplied by 0.6 */ - public float distanceWalkedModified; - public float distanceWalkedOnStepModified; - public float fallDistance; -- private int nextStepDistance = 1; -+ -+ /** -+ * The distance that has to be exceeded in order to triger a new step sound and an onEntityWalking event on a block -+ */ -+ private int nextStepDistance; -+ -+ /** -+ * The entity's X coordinate at the previous tick, used to calculate position during rendering routines -+ */ - public double lastTickPosX; -+ -+ /** -+ * The entity's Y coordinate at the previous tick, used to calculate position during rendering routines -+ */ - public double lastTickPosY; -+ -+ /** -+ * The entity's Z coordinate at the previous tick, used to calculate position during rendering routines -+ */ - public double lastTickPosZ; - public float ySize; -+ -+ /** -+ * How high this entity can step up when running into a block to try to get over it (currently make note the entity -+ * will always step up this amount and not just the amount needed) -+ */ - public float stepHeight; -+ -+ /** -+ * Whether this entity won't clip with collision or not (make note it won't disable gravity) -+ */ - public boolean noClip; -+ -+ /** -+ * Reduces the velocity applied by entity collisions by the specified percent. -+ */ - public float entityCollisionReduction; -- protected Random ab = new Random(); -+ protected Random rand; -+ -+ /** How many ticks has this entity had ran since being alive */ - public int ticksExisted; -- public int fireResistance = 1; -- private int fire; -+ -+ /** -+ * The amount of ticks you have to stand inside of fire before be set on fire -+ */ -+ public int fireResistance; -+ // Spout Start - private to public -+ public int fire; -+ // Spout End -+ -+ /** -+ * Whether this entity is currently inside of water (if it handles water movement that is) -+ */ - protected boolean inWater; -+ -+ /** -+ * Remaining time an entity will be "immune" to further damage after being hurt. -+ */ - public int hurtResistantTime; -- private boolean firstUpdate = true; -+ private boolean firstUpdate; - protected boolean isImmuneToFire; -- protected DataWatcher dataWatcher = new DataWatcher(); -+ protected DataWatcher dataWatcher; - private double entityRiderPitchDelta; - private double entityRiderYawDelta; -+ -+ /** Has this entity been added to the chunk its within */ - public boolean addedToChunk; - public int chunkCoordX; - public int chunkCoordY; -@@ -69,27 +178,60 @@ - public int serverPosX; - public int serverPosY; - public int serverPosZ; -+ -+ /** -+ * Render entity even if it is outside the camera frustum. Only true in EntityFish for now. Used in RenderGlobal: -+ * render if ignoreFrustumCheck or in frustum. -+ */ - public boolean ignoreFrustumCheck; - public boolean isAirBorne; - public int timeUntilPortal; -+ -+ /** Whether the entity is inside a Portal */ - protected boolean inPortal; - protected int portalCounter; -+ -+ /** Which dimension the player is in (-1 = the Nether, 0 = normal world) */ - public int dimension; - protected int teleportDirection; - private boolean invulnerable; -- private UUID i = UUID.randomUUID(); -- public EnumEntitySize myEntitySize = EnumEntitySize.SIZE_2; -+ private UUID entityUniqueID; -+ // Spout Start -+ public boolean partiallyInWater = false; -+ public org.spoutcraft.client.entity.CraftEntity spoutEnty; -+ public UUID uniqueId = UUID.randomUUID(); -+ public boolean wasOnGround; -+ public boolean clientonly = false; -+ // Spout End -+ public EnumEntitySize myEntitySize; - -- public Entity(World var1) { -- this.worldObj = var1; -+ public Entity(World par1World) { -+ this.entityId = nextEntityID++; -+ this.renderDistanceWeight = 1.0D; -+ this.boundingBox = AxisAlignedBB.getBoundingBox(0.0D, 0.0D, 0.0D, 0.0D, 0.0D, 0.0D); -+ this.field_70135_K = true; -+ this.width = 0.6F; -+ this.height = 1.8F; -+ this.nextStepDistance = 1; -+ this.rand = new Random(); -+ this.fireResistance = 1; -+ this.firstUpdate = true; -+ this.dataWatcher = new DataWatcher(); -+ this.entityUniqueID = UUID.randomUUID(); -+ this.myEntitySize = EnumEntitySize.SIZE_2; -+ this.worldObj = par1World; - this.setPosition(0.0D, 0.0D, 0.0D); -- if(var1 != null) { -- this.dimension = var1.provider.dimensionId; -+ -+ if (par1World != null) { -+ this.dimension = par1World.provider.dimensionId; - } - - this.dataWatcher.addObject(0, Byte.valueOf((byte)0)); - this.dataWatcher.addObject(1, Short.valueOf((short)300)); - this.entityInit(); -+ // Spout Start -+ this.spoutEnty = CraftEntityFactory.getCraftEntity(this); -+ // Spout End - } - - protected abstract void entityInit(); -@@ -98,19 +240,24 @@ - return this.dataWatcher; - } - -- public boolean equals(Object var1) { -- return var1 instanceof Entity ? ((Entity)var1).entityId == this.entityId : false; -+ public boolean equals(Object par1Obj) { -+ return par1Obj instanceof Entity ? ((Entity)par1Obj).entityId == this.entityId : false; - } - - public int hashCode() { - return this.entityId; - } - -+ /** -+ * Keeps moving the entity up so it isn't colliding with blocks and other requirements for this entity to be spawned -+ * (only actually used on players though its also on Entity) -+ */ - protected void preparePlayerToSpawn() { -- if(this.worldObj != null) { -- while(this.posY > 0.0D) { -+ if (this.worldObj != null) { -+ while (this.posY > 0.0D) { - this.setPosition(this.posX, this.posY, this.posZ); -- if(this.worldObj.getCollidingBoundingBoxes(this, this.boundingBox).isEmpty()) { -+ -+ if (this.worldObj.getCollidingBoundingBoxes(this, this.boundingBox).isEmpty()) { - break; - } - -@@ -122,65 +269,83 @@ - } - } - -+ /** -+ * Will get destroyed next tick. -+ */ - public void setDead() { - this.isDead = true; - } - -- protected void setSize(float var1, float var2) { -+ /** -+ * Sets the width and height of the entity. Args: width, height -+ */ -+ protected void setSize(float par1, float par2) { - float var3; -- if(var1 != this.width || var2 != this.height) { -- var3 = this.width; -- this.width = var1; -- this.height = var2; -+ -+ if (par1 != this.width || par2 != this.height) { -+ var3 = this.width; -+ this.width = par1; -+ this.height = par2; - this.boundingBox.maxX = this.boundingBox.minX + (double)this.width; - this.boundingBox.maxZ = this.boundingBox.minZ + (double)this.width; - this.boundingBox.maxY = this.boundingBox.minY + (double)this.height; -- if(this.width > var3 && !this.firstUpdate && !this.worldObj.isRemote) { -+ if (this.width > var3 && !this.firstUpdate && !this.worldObj.isRemote) { - this.moveEntity((double)(var3 - this.width), 0.0D, (double)(var3 - this.width)); - } - } - -- var3 = var1 % 2.0F; -- if((double)var3 < 0.375D) { -+ var3 = par1 % 2.0F; -+ -+ if ((double)var3 < 0.375D) { - this.myEntitySize = EnumEntitySize.SIZE_1; -- } else if((double)var3 < 0.75D) { -+ } else if ((double)var3 < 0.75D) { - this.myEntitySize = EnumEntitySize.SIZE_2; -- } else if((double)var3 < 1.0D) { -+ } else if ((double)var3 < 1.0D) { - this.myEntitySize = EnumEntitySize.SIZE_3; -- } else if((double)var3 < 1.375D) { -+ } else if ((double)var3 < 1.375D) { - this.myEntitySize = EnumEntitySize.SIZE_4; -- } else if((double)var3 < 1.75D) { -+ } else if ((double)var3 < 1.75D) { - this.myEntitySize = EnumEntitySize.SIZE_5; - } else { - this.myEntitySize = EnumEntitySize.SIZE_6; - } -- -- } -- -- protected void setRotation(float var1, float var2) { -- this.rotationYaw = var1 % 360.0F; -- this.rotationPitch = var2 % 360.0F; -- } -- -- public void setPosition(double var1, double var3, double var5) { -- this.posX = var1; -- this.posY = var3; -- this.posZ = var5; -+ } -+ -+ /** -+ * Sets the rotation of the entity -+ */ -+ protected void setRotation(float par1, float par2) { -+ this.rotationYaw = par1 % 360.0F; -+ this.rotationPitch = par2 % 360.0F; -+ } -+ -+ /** -+ * Sets the x,y,z of the entity from the given parameters. Also seems to set up a bounding box. -+ */ -+ public void setPosition(double par1, double par3, double par5) { -+ this.posX = par1; -+ this.posY = par3; -+ this.posZ = par5; - float var7 = this.width / 2.0F; - float var8 = this.height; -- this.boundingBox.setBounds(var1 - (double)var7, var3 - (double)this.yOffset + (double)this.ySize, var5 - (double)var7, var1 + (double)var7, var3 - (double)this.yOffset + (double)this.ySize + (double)var8, var5 + (double)var7); -+ this.boundingBox.setBounds(par1 - (double)var7, par3 - (double)this.yOffset + (double)this.ySize, par5 - (double)var7, par1 + (double)var7, par3 - (double)this.yOffset + (double)this.ySize + (double)var8, par5 + (double)var7); - } - -- public void setAngles(float var1, float var2) { -+ /** -+ * Adds par1*0.15 to the entity's yaw, and *subtracts* par2*0.15 from the pitch. Clamps pitch from -90 to 90. Both -+ * arguments in degrees. -+ */ -+ public void setAngles(float par1, float par2) { - float var3 = this.rotationPitch; - float var4 = this.rotationYaw; -- this.rotationYaw = (float)((double)this.rotationYaw + (double)var1 * 0.15D); -- this.rotationPitch = (float)((double)this.rotationPitch - (double)var2 * 0.15D); -- if(this.rotationPitch < -90.0F) { -+ this.rotationYaw = (float)((double)this.rotationYaw + (double)par1 * 0.15D); -+ this.rotationPitch = (float)((double)this.rotationPitch - (double)par2 * 0.15D); -+ -+ if (this.rotationPitch < -90.0F) { - this.rotationPitch = -90.0F; - } - -- if(this.rotationPitch > 90.0F) { -+ if (this.rotationPitch > 90.0F) { - this.rotationPitch = 90.0F; - } - -@@ -188,16 +353,25 @@ - this.prevRotationYaw += this.rotationYaw - var4; - } - -+ /** -+ * Called to update the entity's position/logic. -+ */ - public void onUpdate() { - this.onEntityUpdate(); - } - -+ /** -+ * Gets called every tick from main Entity class -+ */ - public void onEntityUpdate() { - this.worldObj.theProfiler.startSection("entityBaseTick"); -- if(this.ridingEntity != null && this.ridingEntity.isDead) { -+ -+ if (this.ridingEntity != null && this.ridingEntity.isDead) { - this.ridingEntity = null; - } -- -+ // Spout Start -+ partiallyInWater = isInsideOfMaterial(Material.water, -1); -+ // Spout End - this.prevDistanceWalkedModified = this.distanceWalkedModified; - this.prevPosX = this.posX; - this.prevPosY = this.posY; -@@ -205,17 +379,20 @@ - this.prevRotationPitch = this.rotationPitch; - this.prevRotationYaw = this.rotationYaw; - int var2; -- if(!this.worldObj.isRemote && this.worldObj instanceof WorldServer) { -+ -+ if (!this.worldObj.isRemote && this.worldObj instanceof WorldServer) { - this.worldObj.theProfiler.startSection("portal"); - MinecraftServer var1 = ((WorldServer)this.worldObj).getMinecraftServer(); - var2 = this.getMaxInPortalTime(); -- if(this.inPortal) { -- if(var1.getAllowNether()) { -- if(this.ridingEntity == null && this.portalCounter++ >= var2) { -+ -+ if (this.inPortal) { -+ if (var1.getAllowNether()) { -+ if (this.ridingEntity == null && this.portalCounter++ >= var2) { - this.portalCounter = var2; - this.timeUntilPortal = this.getPortalCooldown(); - byte var3; -- if(this.worldObj.provider.dimensionId == -1) { -+ -+ if (this.worldObj.provider.dimensionId == -1) { - var3 = 0; - } else { - var3 = -1; -@@ -227,43 +404,46 @@ - this.inPortal = false; - } - } else { -- if(this.portalCounter > 0) { -+ if (this.portalCounter > 0) { - this.portalCounter -= 4; - } - -- if(this.portalCounter < 0) { -+ if (this.portalCounter < 0) { - this.portalCounter = 0; - } - } - -- if(this.timeUntilPortal > 0) { -+ if (this.timeUntilPortal > 0) { - --this.timeUntilPortal; - } - - this.worldObj.theProfiler.endSection(); - } - -- if(this.isSprinting() && !this.isInWater()) { -+ if (this.isSprinting() && !this.isInWater()) { - int var5 = MathHelper.floor_double(this.posX); -- var2 = MathHelper.floor_double(this.posY - (double)0.2F - (double)this.yOffset); -+ var2 = MathHelper.floor_double(this.posY - 0.20000000298023224D - (double)this.yOffset); - int var6 = MathHelper.floor_double(this.posZ); - int var4 = this.worldObj.getBlockId(var5, var2, var6); -- if(var4 > 0) { -- this.worldObj.spawnParticle("tilecrack_" + var4 + "_" + this.worldObj.getBlockMetadata(var5, var2, var6), this.posX + ((double)this.ab.nextFloat() - 0.5D) * (double)this.width, this.boundingBox.minY + 0.1D, this.posZ + ((double)this.ab.nextFloat() - 0.5D) * (double)this.width, -this.motionX * 4.0D, 1.5D, -this.motionZ * 4.0D); -+ -+ if (var4 > 0) { -+ this.worldObj.spawnParticle("tilecrack_" + var4 + "_" + this.worldObj.getBlockMetadata(var5, var2, var6), this.posX + ((double)this.rand.nextFloat() - 0.5D) * (double)this.width, this.boundingBox.minY + 0.1D, this.posZ + ((double)this.rand.nextFloat() - 0.5D) * (double)this.width, -this.motionX * 4.0D, 1.5D, -this.motionZ * 4.0D); - } - } - - this.handleWaterMovement(); -- if(this.worldObj.isRemote) { -+ -+ if (this.worldObj.isRemote) { - this.fire = 0; -- } else if(this.fire > 0) { -- if(this.isImmuneToFire) { -+ } else if (this.fire > 0) { -+ if (this.isImmuneToFire) { - this.fire -= 4; -- if(this.fire < 0) { -+ -+ if (this.fire < 0) { - this.fire = 0; - } - } else { -- if(this.fire % 20 == 0) { -+ if (this.fire % 20 == 0) { - this.attackEntityFrom(DamageSource.onFire, 1.0F); - } - -@@ -271,61 +451,81 @@ - } - } - -- if(this.handleLavaMovement()) { -+ if (this.handleLavaMovement()) { - this.setOnFireFromLava(); - this.fallDistance *= 0.5F; - } - -- if(this.posY < -64.0D) { -+ if (this.posY < -64.0D) { - this.kill(); - } - -- if(!this.worldObj.isRemote) { -- this.setFlag(0, this.fire > 0); -+ if (!this.worldObj.isRemote) { -+ this.setFlag(0, this.fire > 0); - } - - this.firstUpdate = false; - this.worldObj.theProfiler.endSection(); - } - -+ /** -+ * Return the amount of time this entity should stay in a portal before being transported. -+ */ - public int getMaxInPortalTime() { - return 0; - } - -+ /** -+ * Called whenever the entity is walking inside of lava. -+ */ - protected void setOnFireFromLava() { -- if(!this.isImmuneToFire) { -+ if (!this.isImmuneToFire) { - this.attackEntityFrom(DamageSource.lava, 4.0F); - this.setFire(15); - } -- - } - -- public void setFire(int var1) { -- int var2 = var1 * 20; -+ /** -+ * Sets entity to burn for x amount of seconds, cannot lower amount of existing fire. -+ */ -+ public void setFire(int par1) { -+ int var2 = par1 * 20; - var2 = EnchantmentProtection.getFireTimeForEntity(this, var2); -- if(this.fire < var2) { -+ -+ if (this.fire < var2) { - this.fire = var2; - } -- - } - -+ /** -+ * Removes fire from entity. -+ */ - public void extinguish() { - this.fire = 0; - } - -+ /** -+ * sets the dead flag. Used when you fall off the bottom of the world. -+ */ - protected void kill() { - this.setDead(); - } - -- public boolean isOffsetPositionInLiquid(double var1, double var3, double var5) { -- AxisAlignedBB var7 = this.boundingBox.getOffsetBoundingBox(var1, var3, var5); -+ /** -+ * Checks if the offset position from the entity's current position is inside of liquid. Args: x, y, z -+ */ -+ public boolean isOffsetPositionInLiquid(double par1, double par3, double par5) { -+ AxisAlignedBB var7 = this.boundingBox.getOffsetBoundingBox(par1, par3, par5); - List var8 = this.worldObj.getCollidingBoundingBoxes(this, var7); - return !var8.isEmpty() ? false : !this.worldObj.isAnyLiquid(var7); - } - -- public void moveEntity(double var1, double var3, double var5) { -- if(this.noClip) { -- this.boundingBox.offset(var1, var3, var5); -+ /** -+ * Tries to moves the entity by the passed in displacement. Args: x, y, z -+ */ -+ public void moveEntity(double par1, double par3, double par5) { -+ if (this.noClip) { -+ this.boundingBox.offset(par1, par3, par5); - this.posX = (this.boundingBox.minX + this.boundingBox.maxX) / 2.0D; - this.posY = this.boundingBox.minY + (double)this.yOffset - (double)this.ySize; - this.posZ = (this.boundingBox.minZ + this.boundingBox.maxZ) / 2.0D; -@@ -335,169 +535,179 @@ - double var7 = this.posX; - double var9 = this.posY; - double var11 = this.posZ; -- if(this.isInWeb) { -+ -+ if (this.isInWeb) { - this.isInWeb = false; -- var1 *= 0.25D; -- var3 *= (double)0.05F; -- var5 *= 0.25D; -+ par1 *= 0.25D; -+ par3 *= 0.05000000074505806D; -+ par5 *= 0.25D; - this.motionX = 0.0D; - this.motionY = 0.0D; - this.motionZ = 0.0D; - } - -- double var13 = var1; -- double var15 = var3; -- double var17 = var5; -+ double var13 = par1; -+ double var15 = par3; -+ double var17 = par5; - AxisAlignedBB var19 = this.boundingBox.copy(); - boolean var20 = this.onGround && this.isSneaking() && this instanceof EntityPlayer; -- if(var20) { -+ -+ if (var20) { - double var21; -- for(var21 = 0.05D; var1 != 0.0D && this.worldObj.getCollidingBoundingBoxes(this, this.boundingBox.getOffsetBoundingBox(var1, -1.0D, 0.0D)).isEmpty(); var13 = var1) { -- if(var1 < var21 && var1 >= -var21) { -- var1 = 0.0D; -- } else if(var1 > 0.0D) { -- var1 -= var21; -- } else { -- var1 += var21; -- } -- } -- -- for(; var5 != 0.0D && this.worldObj.getCollidingBoundingBoxes(this, this.boundingBox.getOffsetBoundingBox(0.0D, -1.0D, var5)).isEmpty(); var17 = var5) { -- if(var5 < var21 && var5 >= -var21) { -- var5 = 0.0D; -- } else if(var5 > 0.0D) { -- var5 -= var21; -- } else { -- var5 += var21; -- } -- } -- -- while(var1 != 0.0D && var5 != 0.0D && this.worldObj.getCollidingBoundingBoxes(this, this.boundingBox.getOffsetBoundingBox(var1, -1.0D, var5)).isEmpty()) { -- if(var1 < var21 && var1 >= -var21) { -- var1 = 0.0D; -- } else if(var1 > 0.0D) { -- var1 -= var21; -- } else { -- var1 += var21; -- } -- -- if(var5 < var21 && var5 >= -var21) { -- var5 = 0.0D; -- } else if(var5 > 0.0D) { -- var5 -= var21; -- } else { -- var5 += var21; -- } -- -- var13 = var1; -- var17 = var5; -- } -- } -- -- List var35 = this.worldObj.getCollidingBoundingBoxes(this, this.boundingBox.addCoord(var1, var3, var5)); -- -- for(int var22 = 0; var22 < var35.size(); ++var22) { -- var3 = ((AxisAlignedBB)var35.get(var22)).calculateYOffset(this.boundingBox, var3); -- } -- -- this.boundingBox.offset(0.0D, var3, 0.0D); -- if(!this.field_70135_K && var15 != var3) { -- var5 = 0.0D; -- var3 = var5; -- var1 = var5; -- } -- -- boolean var36 = this.onGround || var15 != var3 && var15 < 0.0D; -- -+ -+ for (var21 = 0.05D; par1 != 0.0D && this.worldObj.getCollidingBoundingBoxes(this, this.boundingBox.getOffsetBoundingBox(par1, -1.0D, 0.0D)).isEmpty(); var13 = par1) { -+ if (par1 < var21 && par1 >= -var21) { -+ par1 = 0.0D; -+ } else if (par1 > 0.0D) { -+ par1 -= var21; -+ } else { -+ par1 += var21; -+ } -+ } -+ -+ for (; par5 != 0.0D && this.worldObj.getCollidingBoundingBoxes(this, this.boundingBox.getOffsetBoundingBox(0.0D, -1.0D, par5)).isEmpty(); var17 = par5) { -+ if (par5 < var21 && par5 >= -var21) { -+ par5 = 0.0D; -+ } else if (par5 > 0.0D) { -+ par5 -= var21; -+ } else { -+ par5 += var21; -+ } -+ } -+ -+ while (par1 != 0.0D && par5 != 0.0D && this.worldObj.getCollidingBoundingBoxes(this, this.boundingBox.getOffsetBoundingBox(par1, -1.0D, par5)).isEmpty()) { -+ if (par1 < var21 && par1 >= -var21) { -+ par1 = 0.0D; -+ } else if (par1 > 0.0D) { -+ par1 -= var21; -+ } else { -+ par1 += var21; -+ } -+ -+ if (par5 < var21 && par5 >= -var21) { -+ par5 = 0.0D; -+ } else if (par5 > 0.0D) { -+ par5 -= var21; -+ } else { -+ par5 += var21; -+ } -+ -+ var13 = par1; -+ var17 = par5; -+ } -+ } -+ -+ List var36 = this.worldObj.getCollidingBoundingBoxes(this, this.boundingBox.addCoord(par1, par3, par5)); -+ -+ for (int var22 = 0; var22 < var36.size(); ++var22) { -+ par3 = ((AxisAlignedBB)var36.get(var22)).calculateYOffset(this.boundingBox, par3); -+ } -+ -+ this.boundingBox.offset(0.0D, par3, 0.0D); -+ -+ if (!this.field_70135_K && var15 != par3) { -+ par5 = 0.0D; -+ par3 = 0.0D; -+ par1 = 0.0D; -+ } -+ -+ boolean var35 = this.onGround || var15 != par3 && var15 < 0.0D; - int var23; -- for(var23 = 0; var23 < var35.size(); ++var23) { -- var1 = ((AxisAlignedBB)var35.get(var23)).calculateXOffset(this.boundingBox, var1); -- } -- -- this.boundingBox.offset(var1, 0.0D, 0.0D); -- if(!this.field_70135_K && var13 != var1) { -- var5 = 0.0D; -- var3 = var5; -- var1 = var5; -- } -- -- for(var23 = 0; var23 < var35.size(); ++var23) { -- var5 = ((AxisAlignedBB)var35.get(var23)).calculateZOffset(this.boundingBox, var5); -- } -- -- this.boundingBox.offset(0.0D, 0.0D, var5); -- if(!this.field_70135_K && var17 != var5) { -- var5 = 0.0D; -- var3 = var5; -- var1 = var5; -+ -+ for (var23 = 0; var23 < var36.size(); ++var23) { -+ par1 = ((AxisAlignedBB)var36.get(var23)).calculateXOffset(this.boundingBox, par1); -+ } -+ -+ this.boundingBox.offset(par1, 0.0D, 0.0D); -+ -+ if (!this.field_70135_K && var13 != par1) { -+ par5 = 0.0D; -+ par3 = 0.0D; -+ par1 = 0.0D; -+ } -+ -+ for (var23 = 0; var23 < var36.size(); ++var23) { -+ par5 = ((AxisAlignedBB)var36.get(var23)).calculateZOffset(this.boundingBox, par5); -+ } -+ -+ this.boundingBox.offset(0.0D, 0.0D, par5); -+ -+ if (!this.field_70135_K && var17 != par5) { -+ par5 = 0.0D; -+ par3 = 0.0D; -+ par1 = 0.0D; - } - - double var25; - double var27; - int var30; - double var37; -- if(this.stepHeight > 0.0F && var36 && (var20 || this.ySize < 0.05F) && (var13 != var1 || var17 != var5)) { -- var37 = var1; -- var25 = var3; -- var27 = var5; -- var1 = var13; -- var3 = (double)this.stepHeight; -- var5 = var17; -+ -+ if (this.stepHeight > 0.0F && var35 && (var20 || this.ySize < 0.05F) && (var13 != par1 || var17 != par5)) { -+ var37 = par1; -+ var25 = par3; -+ var27 = par5; -+ par1 = var13; -+ par3 = (double)this.stepHeight; -+ par5 = var17; - AxisAlignedBB var29 = this.boundingBox.copy(); - this.boundingBox.setBB(var19); -- var35 = this.worldObj.getCollidingBoundingBoxes(this, this.boundingBox.addCoord(var13, var3, var17)); -- -- for(var30 = 0; var30 < var35.size(); ++var30) { -- var3 = ((AxisAlignedBB)var35.get(var30)).calculateYOffset(this.boundingBox, var3); -- } -- -- this.boundingBox.offset(0.0D, var3, 0.0D); -- if(!this.field_70135_K && var15 != var3) { -- var5 = 0.0D; -- var3 = var5; -- var1 = var5; -- } -- -- for(var30 = 0; var30 < var35.size(); ++var30) { -- var1 = ((AxisAlignedBB)var35.get(var30)).calculateXOffset(this.boundingBox, var1); -- } -- -- this.boundingBox.offset(var1, 0.0D, 0.0D); -- if(!this.field_70135_K && var13 != var1) { -- var5 = 0.0D; -- var3 = var5; -- var1 = var5; -- } -- -- for(var30 = 0; var30 < var35.size(); ++var30) { -- var5 = ((AxisAlignedBB)var35.get(var30)).calculateZOffset(this.boundingBox, var5); -- } -- -- this.boundingBox.offset(0.0D, 0.0D, var5); -- if(!this.field_70135_K && var17 != var5) { -- var5 = 0.0D; -- var3 = var5; -- var1 = var5; -- } -- -- if(!this.field_70135_K && var15 != var3) { -- var5 = 0.0D; -- var3 = var5; -- var1 = var5; -+ var36 = this.worldObj.getCollidingBoundingBoxes(this, this.boundingBox.addCoord(var13, par3, var17)); -+ -+ for (var30 = 0; var30 < var36.size(); ++var30) { -+ par3 = ((AxisAlignedBB)var36.get(var30)).calculateYOffset(this.boundingBox, par3); -+ } -+ -+ this.boundingBox.offset(0.0D, par3, 0.0D); -+ -+ if (!this.field_70135_K && var15 != par3) { -+ par5 = 0.0D; -+ par3 = 0.0D; -+ par1 = 0.0D; -+ } -+ -+ for (var30 = 0; var30 < var36.size(); ++var30) { -+ par1 = ((AxisAlignedBB)var36.get(var30)).calculateXOffset(this.boundingBox, par1); -+ } -+ -+ this.boundingBox.offset(par1, 0.0D, 0.0D); -+ -+ if (!this.field_70135_K && var13 != par1) { -+ par5 = 0.0D; -+ par3 = 0.0D; -+ par1 = 0.0D; -+ } -+ -+ for (var30 = 0; var30 < var36.size(); ++var30) { -+ par5 = ((AxisAlignedBB)var36.get(var30)).calculateZOffset(this.boundingBox, par5); -+ } -+ -+ this.boundingBox.offset(0.0D, 0.0D, par5); -+ -+ if (!this.field_70135_K && var17 != par5) { -+ par5 = 0.0D; -+ par3 = 0.0D; -+ par1 = 0.0D; -+ } -+ -+ if (!this.field_70135_K && var15 != par3) { -+ par5 = 0.0D; -+ par3 = 0.0D; -+ par1 = 0.0D; - } else { -- var3 = (double)(-this.stepHeight); -+ par3 = (double)(-this.stepHeight); - -- for(var30 = 0; var30 < var35.size(); ++var30) { -- var3 = ((AxisAlignedBB)var35.get(var30)).calculateYOffset(this.boundingBox, var3); -+ for (var30 = 0; var30 < var36.size(); ++var30) { -+ par3 = ((AxisAlignedBB)var36.get(var30)).calculateYOffset(this.boundingBox, par3); - } - -- this.boundingBox.offset(0.0D, var3, 0.0D); -+ this.boundingBox.offset(0.0D, par3, 0.0D); - } - -- if(var37 * var37 + var27 * var27 >= var1 * var1 + var5 * var5) { -- var1 = var37; -- var3 = var25; -- var5 = var27; -+ if (var37 * var37 + var27 * var27 >= par1 * par1 + par5 * par5) { -+ par1 = var37; -+ par3 = var25; -+ par5 = var27; - this.boundingBox.setBB(var29); - } - } -@@ -507,57 +717,64 @@ - this.posX = (this.boundingBox.minX + this.boundingBox.maxX) / 2.0D; - this.posY = this.boundingBox.minY + (double)this.yOffset - (double)this.ySize; - this.posZ = (this.boundingBox.minZ + this.boundingBox.maxZ) / 2.0D; -- this.isCollidedHorizontally = var13 != var1 || var17 != var5; -- this.isCollidedVertically = var15 != var3; -- this.onGround = var15 != var3 && var15 < 0.0D; -+ this.isCollidedHorizontally = var13 != par1 || var17 != par5; -+ this.isCollidedVertically = var15 != par3; -+ this.onGround = var15 != par3 && var15 < 0.0D; - this.isCollided = this.isCollidedHorizontally || this.isCollidedVertically; -- this.updateFallState(var3, this.onGround); -- if(var13 != var1) { -+ this.updateFallState(par3, this.onGround); -+ -+ if (var13 != par1) { - this.motionX = 0.0D; - } - -- if(var15 != var3) { -+ if (var15 != par3) { - this.motionY = 0.0D; - } - -- if(var17 != var5) { -+ if (var17 != par5) { - this.motionZ = 0.0D; - } - - var37 = this.posX - var7; - var25 = this.posY - var9; - var27 = this.posZ - var11; -- if(this.canTriggerWalking() && !var20 && this.ridingEntity == null) { -- int var38 = MathHelper.floor_double(this.posX); -- var30 = MathHelper.floor_double(this.posY - (double)0.2F - (double)this.yOffset); -+ -+ if (this.canTriggerWalking() && !var20 && this.ridingEntity == null) { -+ int var39 = MathHelper.floor_double(this.posX); -+ var30 = MathHelper.floor_double(this.posY - 0.20000000298023224D - (double)this.yOffset); - int var31 = MathHelper.floor_double(this.posZ); -- int var32 = this.worldObj.getBlockId(var38, var30, var31); -- if(var32 == 0) { -- int var33 = this.worldObj.blockGetRenderType(var38, var30 - 1, var31); -- if(var33 == 11 || var33 == 32 || var33 == 21) { -- var32 = this.worldObj.getBlockId(var38, var30 - 1, var31); -+ int var32 = this.worldObj.getBlockId(var39, var30, var31); -+ -+ if (var32 == 0) { -+ int var33 = this.worldObj.blockGetRenderType(var39, var30 - 1, var31); -+ -+ if (var33 == 11 || var33 == 32 || var33 == 21) { -+ var32 = this.worldObj.getBlockId(var39, var30 - 1, var31); - } - } - -- if(var32 != Block.ladder.blockID) { -+ if (var32 != Block.ladder.blockID) { - var25 = 0.0D; - } - - this.distanceWalkedModified = (float)((double)this.distanceWalkedModified + (double)MathHelper.sqrt_double(var37 * var37 + var27 * var27) * 0.6D); - this.distanceWalkedOnStepModified = (float)((double)this.distanceWalkedOnStepModified + (double)MathHelper.sqrt_double(var37 * var37 + var25 * var25 + var27 * var27) * 0.6D); -- if(this.distanceWalkedOnStepModified > (float)this.nextStepDistance && var32 > 0) { -+ -+ if (this.distanceWalkedOnStepModified > (float)this.nextStepDistance && var32 > 0) { - this.nextStepDistance = (int)this.distanceWalkedOnStepModified + 1; -- if(this.isInWater()) { -- float var42 = MathHelper.sqrt_double(this.motionX * this.motionX * (double)0.2F + this.motionY * this.motionY + this.motionZ * this.motionZ * (double)0.2F) * 0.35F; -- if(var42 > 1.0F) { -+ -+ if (this.isInWater()) { -+ float var42 = MathHelper.sqrt_double(this.motionX * this.motionX * 0.20000000298023224D + this.motionY * this.motionY + this.motionZ * this.motionZ * 0.20000000298023224D) * 0.35F; -+ -+ if (var42 > 1.0F) { - var42 = 1.0F; - } - -- this.playSound("liquid.swim", var42, 1.0F + (this.ab.nextFloat() - this.ab.nextFloat()) * 0.4F); -+ this.playSound("liquid.swim", var42, 1.0F + (this.rand.nextFloat() - this.rand.nextFloat()) * 0.4F); - } - -- this.playStepSound(var38, var30, var31, var32); -- Block.blocksList[var32].onEntityWalking(this.worldObj, var38, var30, var31, this); -+ this.playStepSound(var39, var30, var31, var32); -+ Block.blocksList[var32].onEntityWalking(this.worldObj, var39, var30, var31, this); - } - } - -@@ -565,26 +782,29 @@ - this.doBlockCollisions(); - } catch (Throwable var34) { - CrashReport var41 = CrashReport.makeCrashReport(var34, "Checking entity tile collision"); -- CrashReportCategory var40 = var41.makeCategory("Entity being checked for collision"); -- this.addEntityCrashInfo(var40); -+ CrashReportCategory var38 = var41.makeCategory("Entity being checked for collision"); -+ this.addEntityCrashInfo(var38); - throw new ReportedException(var41); - } - -- boolean var39 = this.isWet(); -- if(this.worldObj.isBoundingBoxBurning(this.boundingBox.contract(0.001D, 0.001D, 0.001D))) { -+ boolean var40 = this.isWet(); -+ -+ if (this.worldObj.isBoundingBoxBurning(this.boundingBox.contract(0.001D, 0.001D, 0.001D))) { - this.dealFireDamage(1); -- if(!var39) { -+ -+ if (!var40) { - ++this.fire; -- if(this.fire == 0) { -+ -+ if (this.fire == 0) { - this.setFire(8); - } - } -- } else if(this.fire <= 0) { -+ } else if (this.fire <= 0) { - this.fire = -this.fireResistance; - } - -- if(var39 && this.fire > 0) { -- this.playSound("random.fizz", 0.7F, 1.6F + (this.ab.nextFloat() - this.ab.nextFloat()) * 0.4F); -+ if (var40 && this.fire > 0) { -+ this.playSound("random.fizz", 0.7F, 1.6F + (this.rand.nextFloat() - this.rand.nextFloat()) * 0.4F); - this.fire = -this.fireResistance; - } - -@@ -592,6 +812,9 @@ - } - } - -+ /** -+ * Checks for block collisions, and calls the associated onBlockCollided method for the collided block. -+ */ - protected void doBlockCollisions() { - int var1 = MathHelper.floor_double(this.boundingBox.minX + 0.001D); - int var2 = MathHelper.floor_double(this.boundingBox.minY + 0.001D); -@@ -599,12 +822,14 @@ - int var4 = MathHelper.floor_double(this.boundingBox.maxX - 0.001D); - int var5 = MathHelper.floor_double(this.boundingBox.maxY - 0.001D); - int var6 = MathHelper.floor_double(this.boundingBox.maxZ - 0.001D); -- if(this.worldObj.checkChunksExist(var1, var2, var3, var4, var5, var6)) { -- for(int var7 = var1; var7 <= var4; ++var7) { -- for(int var8 = var2; var8 <= var5; ++var8) { -- for(int var9 = var3; var9 <= var6; ++var9) { -+ -+ if (this.worldObj.checkChunksExist(var1, var2, var3, var4, var5, var6)) { -+ for (int var7 = var1; var7 <= var4; ++var7) { -+ for (int var8 = var2; var8 <= var5; ++var8) { -+ for (int var9 = var3; var9 <= var6; ++var9) { - int var10 = this.worldObj.getBlockId(var7, var8, var9); -- if(var10 > 0) { -+ -+ if (var10 > 0) { - try { - Block.blocksList[var10].onEntityCollidedWithBlock(this.worldObj, var7, var8, var9, this); - } catch (Throwable var14) { -@@ -618,93 +843,126 @@ - } - } - } -- - } - -- protected void playStepSound(int var1, int var2, int var3, int var4) { -- StepSound var5 = Block.blocksList[var4].stepSound; -- if(this.worldObj.getBlockId(var1, var2 + 1, var3) == Block.snow.blockID) { -+ /** -+ * Plays step sound at given x, y, z for the entity -+ */ -+ protected void playStepSound(int par1, int par2, int par3, int par4) { -+ StepSound var5 = Block.blocksList[par4].stepSound; -+ -+ if (this.worldObj.getBlockId(par1, par2 + 1, par3) == Block.snow.blockID) { - var5 = Block.snow.stepSound; - this.playSound(var5.getStepSound(), var5.getVolume() * 0.15F, var5.getPitch()); -- } else if(!Block.blocksList[var4].blockMaterial.isLiquid()) { -+ } else if (!Block.blocksList[par4].blockMaterial.isLiquid()) { - this.playSound(var5.getStepSound(), var5.getVolume() * 0.15F, var5.getPitch()); - } -- -- } -- -- public void playSound(String var1, float var2, float var3) { -- this.worldObj.playSoundAtEntity(this, var1, var2, var3); -- } -- -+ } -+ -+ public void playSound(String par1Str, float par2, float par3) { -+ this.worldObj.playSoundAtEntity(this, par1Str, par2, par3); -+ } -+ -+ /** -+ * returns if this entity triggers Block.onEntityWalking on the blocks they walk on. used for spiders and wolves to -+ * prevent them from trampling crops -+ */ - protected boolean canTriggerWalking() { - return true; - } - -- protected void updateFallState(double var1, boolean var3) { -- if(var3) { -- if(this.fallDistance > 0.0F) { -+ /** -+ * Takes in the distance the entity has fallen this tick and whether its on the ground to update the fall distance and -+ * deal fall damage if landing on the ground. Args: distanceFallenThisTick, onGround -+ */ -+ protected void updateFallState(double par1, boolean par3) { -+ if (par3) { -+ if (this.fallDistance > 0.0F) { - this.fall(this.fallDistance); - this.fallDistance = 0.0F; - } -- } else if(var1 < 0.0D) { -- this.fallDistance = (float)((double)this.fallDistance - var1); -+ } else if (par1 < 0.0D) { -+ this.fallDistance = (float)((double)this.fallDistance - par1); - } -- -- } -- -+ } -+ -+ /** -+ * First layer of player interaction -+ */ -+ public boolean interactFirst(EntityPlayer par1EntityPlayer) { -+ return false; -+ } -+ -+ /** -+ * returns the bounding box for this entity -+ */ - public AxisAlignedBB getBoundingBox() { - return null; - } - -- protected void dealFireDamage(int var1) { -- if(!this.isImmuneToFire) { -- this.attackEntityFrom(DamageSource.inFire, (float)var1); -+ /** -+ * Will deal the specified amount of damage to the entity if the entity isn't immune to fire damage. Args: amountDamage -+ */ -+ protected void dealFireDamage(int par1) { -+ if (!this.isImmuneToFire) { -+ this.attackEntityFrom(DamageSource.inFire, (float)par1); - } -- - } - - public final boolean isImmuneToFire() { - return this.isImmuneToFire; - } - -- protected void fall(float var1) { -- if(this.riddenByEntity != null) { -- this.riddenByEntity.fall(var1); -+ /** -+ * Called when the mob is falling. Calculates and applies fall damage. -+ */ -+ protected void fall(float par1) { -+ if (this.riddenByEntity != null) { -+ this.riddenByEntity.fall(par1); - } -- - } - -+ /** -+ * Checks if this entity is either in water or on an open air block in rain (used in wolves). -+ */ - public boolean isWet() { - return this.inWater || this.worldObj.canLightningStrikeAt(MathHelper.floor_double(this.posX), MathHelper.floor_double(this.posY), MathHelper.floor_double(this.posZ)) || this.worldObj.canLightningStrikeAt(MathHelper.floor_double(this.posX), MathHelper.floor_double(this.posY + (double)this.height), MathHelper.floor_double(this.posZ)); - } - -+ /** -+ * Checks if this entity is inside water (if inWater field is true as a result of handleWaterMovement() returning true) -+ */ - public boolean isInWater() { - return this.inWater; - } - -+ /** -+ * Returns if this entity is in water and will end up adding the waters velocity to the entity -+ */ - public boolean handleWaterMovement() { -- if(this.worldObj.handleMaterialAcceleration(this.boundingBox.expand(0.0D, (double)-0.4F, 0.0D).contract(0.001D, 0.001D, 0.001D), Material.water, this)) { -- if(!this.inWater && !this.firstUpdate) { -- float var1 = MathHelper.sqrt_double(this.motionX * this.motionX * (double)0.2F + this.motionY * this.motionY + this.motionZ * this.motionZ * (double)0.2F) * 0.2F; -- if(var1 > 1.0F) { -+ if (this.worldObj.handleMaterialAcceleration(this.boundingBox.expand(0.0D, -0.4000000059604645D, 0.0D).contract(0.001D, 0.001D, 0.001D), Material.water, this)) { -+ if (!this.inWater && !this.firstUpdate) { -+ float var1 = MathHelper.sqrt_double(this.motionX * this.motionX * 0.20000000298023224D + this.motionY * this.motionY + this.motionZ * this.motionZ * 0.20000000298023224D) * 0.2F; -+ -+ if (var1 > 1.0F) { - var1 = 1.0F; - } - -- this.playSound("liquid.splash", var1, 1.0F + (this.ab.nextFloat() - this.ab.nextFloat()) * 0.4F); -+ this.playSound("liquid.splash", var1, 1.0F + (this.rand.nextFloat() - this.rand.nextFloat()) * 0.4F); - float var2 = (float)MathHelper.floor_double(this.boundingBox.minY); -- -- int var3; - float var4; - float var5; -- for(var3 = 0; (float)var3 < 1.0F + this.width * 20.0F; ++var3) { -- var4 = (this.ab.nextFloat() * 2.0F - 1.0F) * this.width; -- var5 = (this.ab.nextFloat() * 2.0F - 1.0F) * this.width; -- this.worldObj.spawnParticle("bubble", this.posX + (double)var4, (double)(var2 + 1.0F), this.posZ + (double)var5, this.motionX, this.motionY - (double)(this.ab.nextFloat() * 0.2F), this.motionZ); -+ int var3; -+ -+ for (var3 = 0; (float)var3 < 1.0F + this.width * 20.0F; ++var3) { -+ var4 = (this.rand.nextFloat() * 2.0F - 1.0F) * this.width; -+ var5 = (this.rand.nextFloat() * 2.0F - 1.0F) * this.width; -+ this.worldObj.spawnParticle("bubble", this.posX + (double)var4, (double)(var2 + 1.0F), this.posZ + (double)var5, this.motionX, this.motionY - (double)(this.rand.nextFloat() * 0.2F), this.motionZ); - } - -- for(var3 = 0; (float)var3 < 1.0F + this.width * 20.0F; ++var3) { -- var4 = (this.ab.nextFloat() * 2.0F - 1.0F) * this.width; -- var5 = (this.ab.nextFloat() * 2.0F - 1.0F) * this.width; -+ for (var3 = 0; (float)var3 < 1.0F + this.width * 20.0F; ++var3) { -+ var4 = (this.rand.nextFloat() * 2.0F - 1.0F) * this.width; -+ var5 = (this.rand.nextFloat() * 2.0F - 1.0F) * this.width; - this.worldObj.spawnParticle("splash", this.posX + (double)var4, (double)(var2 + 1.0F), this.posZ + (double)var5, this.motionX, this.motionY, this.motionZ); - } - } -@@ -719,14 +977,26 @@ - return this.inWater; - } - -- public boolean isInsideOfMaterial(Material var1) { -- double var2 = this.posY + (double)this.getEyeHeight(); -+ /** -+ * Checks if the current block the entity is within of the specified material type -+ */ -+ // Spout Start -+ public boolean isInsideOfMaterial(Material material) { -+ return isInsideOfMaterial(material, 0); -+ } -+ -+ public boolean isInsideOfMaterial(Material material, float offset) { -+ double var2 = this.posY + (double)this.getEyeHeight() + offset; -+ // Spout End - int var4 = MathHelper.floor_double(this.posX); - int var5 = MathHelper.floor_float((float)MathHelper.floor_double(var2)); - int var6 = MathHelper.floor_double(this.posZ); - int var7 = this.worldObj.getBlockId(var4, var5, var6); -- if(var7 != 0 && Block.blocksList[var7].blockMaterial == var1) { -- float var8 = BlockFluid.getFluidHeightPercent(this.worldObj.getBlockMetadata(var4, var5, var6)) - 1.0F / 9.0F; -+ -+ // Spout Start -+ if (var7 != 0 && Block.blocksList[var7].blockMaterial == material) { -+ // Spout End -+ float var8 = BlockFluid.getFluidHeightPercent(this.worldObj.getBlockMetadata(var4, var5, var6)) - 0.11111111F; - float var9 = (float)(var5 + 1) - var8; - return var2 < (double)var9; - } else { -@@ -738,156 +1008,214 @@ - return 0.0F; - } - -+ /** -+ * Whether or not the current entity is in lava -+ */ - public boolean handleLavaMovement() { -- return this.worldObj.isMaterialInBB(this.boundingBox.expand((double)-0.1F, (double)-0.4F, (double)-0.1F), Material.lava); -+ return this.worldObj.isMaterialInBB(this.boundingBox.expand(-0.10000000149011612D, -0.4000000059604645D, -0.10000000149011612D), Material.lava); - } - -- public void moveFlying(float var1, float var2, float var3) { -- float var4 = var1 * var1 + var2 * var2; -- if(var4 >= 1.0E-4F) { -+ /** -+ * Used in both water and by flying objects -+ */ -+ public void moveFlying(float par1, float par2, float par3) { -+ float var4 = par1 * par1 + par2 * par2; -+ -+ if (var4 >= 1.0E-4F) { - var4 = MathHelper.sqrt_float(var4); -- if(var4 < 1.0F) { -+ -+ if (var4 < 1.0F) { - var4 = 1.0F; - } - -- var4 = var3 / var4; -- var1 *= var4; -- var2 *= var4; -+ var4 = par3 / var4; -+ par1 *= var4; -+ par2 *= var4; - float var5 = MathHelper.sin(this.rotationYaw * (float)Math.PI / 180.0F); - float var6 = MathHelper.cos(this.rotationYaw * (float)Math.PI / 180.0F); -- this.motionX += (double)(var1 * var6 - var2 * var5); -- this.motionZ += (double)(var2 * var6 + var1 * var5); -+ this.motionX += (double)(par1 * var6 - par2 * var5); -+ this.motionZ += (double)(par2 * var6 + par1 * var5); - } - } - -- public int getBrightnessForRender(float var1) { -+ public int getBrightnessForRender(float par1) { - int var2 = MathHelper.floor_double(this.posX); - int var3 = MathHelper.floor_double(this.posZ); -- if(this.worldObj.blockExists(var2, 0, var3)) { -- double var4 = (this.boundingBox.maxY - this.boundingBox.minY) * 0.66D; -- int var6 = MathHelper.floor_double(this.posY - (double)this.yOffset + var4); -- return this.worldObj.getLightBrightnessForSkyBlocks(var2, var6, var3, 0); -+ -+ if (this.worldObj.blockExists(var2, 0, var3)) { -+ if (SpoutClient.getInstance().xrayMode) { -+ return 15728640; -+ } else { -+ double var4 = (this.boundingBox.maxY - this.boundingBox.minY) * 0.66D; -+ int var6 = MathHelper.floor_double(this.posY - (double)this.yOffset + var4); -+ return this.worldObj.getLightBrightnessForSkyBlocks(var2, var6, var3, 0); -+ } - } else { - return 0; - } - } - -- public float getBrightness(float var1) { -+ /** -+ * Gets how bright this entity is. -+ */ -+ public float getBrightness(float par1) { - int var2 = MathHelper.floor_double(this.posX); - int var3 = MathHelper.floor_double(this.posZ); -- if(this.worldObj.blockExists(var2, 0, var3)) { -- double var4 = (this.boundingBox.maxY - this.boundingBox.minY) * 0.66D; -- int var6 = MathHelper.floor_double(this.posY - (double)this.yOffset + var4); -- return this.worldObj.getLightBrightness(var2, var6, var3); -+ -+ if (this.worldObj.blockExists(var2, 0, var3)) { -+ if (SpoutClient.getInstance().xrayMode) { -+ return 1000.0F; -+ } else { -+ double var4 = (this.boundingBox.maxY - this.boundingBox.minY) * 0.66D; -+ int var6 = MathHelper.floor_double(this.posY - (double)this.yOffset + var4); -+ return this.worldObj.getLightBrightness(var2, var6, var3); -+ } - } else { - return 0.0F; - } - } - -- public void setWorld(World var1) { -- this.worldObj = var1; -+ /** -+ * Sets the reference to the World object. -+ */ -+ public void setWorld(World par1World) { -+ this.worldObj = par1World; - } - -- public void setPositionAndRotation(double var1, double var3, double var5, float var7, float var8) { -- this.prevPosX = this.posX = var1; -- this.prevPosY = this.posY = var3; -- this.prevPosZ = this.posZ = var5; -- this.prevRotationYaw = this.rotationYaw = var7; -- this.prevRotationPitch = this.rotationPitch = var8; -+ /** -+ * Sets the entity's position and rotation. Args: posX, posY, posZ, yaw, pitch -+ */ -+ public void setPositionAndRotation(double par1, double par3, double par5, float par7, float par8) { -+ this.prevPosX = this.posX = par1; -+ this.prevPosY = this.posY = par3; -+ this.prevPosZ = this.posZ = par5; -+ this.prevRotationYaw = this.rotationYaw = par7; -+ this.prevRotationPitch = this.rotationPitch = par8; - this.ySize = 0.0F; -- double var9 = (double)(this.prevRotationYaw - var7); -- if(var9 < -180.0D) { -+ double var9 = (double)(this.prevRotationYaw - par7); -+ -+ if (var9 < -180.0D) { - this.prevRotationYaw += 360.0F; - } - -- if(var9 >= 180.0D) { -+ if (var9 >= 180.0D) { - this.prevRotationYaw -= 360.0F; - } - - this.setPosition(this.posX, this.posY, this.posZ); -- this.setRotation(var7, var8); -+ this.setRotation(par7, par8); - } - -- public void setLocationAndAngles(double var1, double var3, double var5, float var7, float var8) { -- this.lastTickPosX = this.prevPosX = this.posX = var1; -- this.lastTickPosY = this.prevPosY = this.posY = var3 + (double)this.yOffset; -- this.lastTickPosZ = this.prevPosZ = this.posZ = var5; -- this.rotationYaw = var7; -- this.rotationPitch = var8; -+ /** -+ * Sets the location and Yaw/Pitch of an entity in the world -+ */ -+ public void setLocationAndAngles(double par1, double par3, double par5, float par7, float par8) { -+ this.lastTickPosX = this.prevPosX = this.posX = par1; -+ this.lastTickPosY = this.prevPosY = this.posY = par3 + (double)this.yOffset; -+ this.lastTickPosZ = this.prevPosZ = this.posZ = par5; -+ this.rotationYaw = par7; -+ this.rotationPitch = par8; - this.setPosition(this.posX, this.posY, this.posZ); - } - -- public float getDistanceToEntity(Entity var1) { -- float var2 = (float)(this.posX - var1.posX); -- float var3 = (float)(this.posY - var1.posY); -- float var4 = (float)(this.posZ - var1.posZ); -+ /** -+ * Returns the distance to the entity. Args: entity -+ */ -+ public float getDistanceToEntity(Entity par1Entity) { -+ float var2 = (float)(this.posX - par1Entity.posX); -+ float var3 = (float)(this.posY - par1Entity.posY); -+ float var4 = (float)(this.posZ - par1Entity.posZ); - return MathHelper.sqrt_float(var2 * var2 + var3 * var3 + var4 * var4); - } - -- public double getDistanceSq(double var1, double var3, double var5) { -- double var7 = this.posX - var1; -- double var9 = this.posY - var3; -- double var11 = this.posZ - var5; -+ /** -+ * Gets the squared distance to the position. Args: x, y, z -+ */ -+ public double getDistanceSq(double par1, double par3, double par5) { -+ double var7 = this.posX - par1; -+ double var9 = this.posY - par3; -+ double var11 = this.posZ - par5; - return var7 * var7 + var9 * var9 + var11 * var11; - } - -- public double getDistance(double var1, double var3, double var5) { -- double var7 = this.posX - var1; -- double var9 = this.posY - var3; -- double var11 = this.posZ - var5; -+ /** -+ * Gets the distance to the position. Args: x, y, z -+ */ -+ public double getDistance(double par1, double par3, double par5) { -+ double var7 = this.posX - par1; -+ double var9 = this.posY - par3; -+ double var11 = this.posZ - par5; - return (double)MathHelper.sqrt_double(var7 * var7 + var9 * var9 + var11 * var11); - } - -- public double getDistanceSqToEntity(Entity var1) { -- double var2 = this.posX - var1.posX; -- double var4 = this.posY - var1.posY; -- double var6 = this.posZ - var1.posZ; -+ /** -+ * Returns the squared distance to the entity. Args: entity -+ */ -+ public double getDistanceSqToEntity(Entity par1Entity) { -+ double var2 = this.posX - par1Entity.posX; -+ double var4 = this.posY - par1Entity.posY; -+ double var6 = this.posZ - par1Entity.posZ; - return var2 * var2 + var4 * var4 + var6 * var6; - } - -- public void onCollideWithPlayer(EntityPlayer var1) { -- } -+ /** -+ * Called by a player entity when they collide with an entity -+ */ -+ public void onCollideWithPlayer(EntityPlayer par1EntityPlayer) {} - -- public void applyEntityCollision(Entity var1) { -- if(var1.riddenByEntity != this && var1.ridingEntity != this) { -- double var2 = var1.posX - this.posX; -- double var4 = var1.posZ - this.posZ; -+ /** -+ * Applies a velocity to each of the entities pushing them away from each other. Args: entity -+ */ -+ public void applyEntityCollision(Entity par1Entity) { -+ if (par1Entity.riddenByEntity != this && par1Entity.ridingEntity != this) { -+ double var2 = par1Entity.posX - this.posX; -+ double var4 = par1Entity.posZ - this.posZ; - double var6 = MathHelper.abs_max(var2, var4); -- if(var6 >= (double)0.01F) { -+ -+ if (var6 >= 0.009999999776482582D) { - var6 = (double)MathHelper.sqrt_double(var6); - var2 /= var6; - var4 /= var6; - double var8 = 1.0D / var6; -- if(var8 > 1.0D) { -+ -+ if (var8 > 1.0D) { - var8 = 1.0D; - } - - var2 *= var8; - var4 *= var8; -- var2 *= (double)0.05F; -- var4 *= (double)0.05F; -+ var2 *= 0.05000000074505806D; -+ var4 *= 0.05000000074505806D; - var2 *= (double)(1.0F - this.entityCollisionReduction); - var4 *= (double)(1.0F - this.entityCollisionReduction); - this.addVelocity(-var2, 0.0D, -var4); -- var1.addVelocity(var2, 0.0D, var4); -+ par1Entity.addVelocity(var2, 0.0D, var4); - } -- - } - } - -- public void addVelocity(double var1, double var3, double var5) { -- this.motionX += var1; -- this.motionY += var3; -- this.motionZ += var5; -+ /** -+ * Adds to the current velocity of the entity. Args: x, y, z -+ */ -+ public void addVelocity(double par1, double par3, double par5) { -+ this.motionX += par1; -+ this.motionY += par3; -+ this.motionZ += par5; - this.isAirBorne = true; - } - -+ /** -+ * Sets that this entity has been attacked. -+ */ - protected void setBeenAttacked() { - this.velocityChanged = true; - } - -- public boolean attackEntityFrom(DamageSource var1, float var2) { -- if(this.isEntityInvulnerable()) { -+ /** -+ * Called when the entity is attacked. -+ */ -+ public boolean attackEntityFrom(DamageSource par1DamageSource, float par2) { -+ if (this.isEntityInvulnerable()) { - return false; - } else { - this.setBeenAttacked(); -@@ -895,75 +1223,110 @@ - } - } - -+ /** -+ * Returns true if other Entities should be prevented from moving through this Entity. -+ */ - public boolean canBeCollidedWith() { - return false; - } - -+ /** -+ * Returns true if this entity should push and be pushed by other entities when colliding. -+ */ - public boolean canBePushed() { - return false; - } - -- public void addToPlayerScore(Entity var1, int var2) { -- } -+ /** -+ * Adds a value to the player score. Currently not actually used and the entity passed in does nothing. Args: entity, -+ * scoreToAdd -+ */ -+ public void addToPlayerScore(Entity par1Entity, int par2) {} - -- public boolean isInRangeToRenderVec3D(Vec3 var1) { -- double var2 = this.posX - var1.xCoord; -- double var4 = this.posY - var1.yCoord; -- double var6 = this.posZ - var1.zCoord; -+ /** -+ * Checks using a Vec3d to determine if this entity is within range of that vector to be rendered. Args: vec3D -+ */ -+ public boolean isInRangeToRenderVec3D(Vec3 par1Vec3) { -+ double var2 = this.posX - par1Vec3.xCoord; -+ double var4 = this.posY - par1Vec3.yCoord; -+ double var6 = this.posZ - par1Vec3.zCoord; - double var8 = var2 * var2 + var4 * var4 + var6 * var6; - return this.isInRangeToRenderDist(var8); - } - -- public boolean isInRangeToRenderDist(double var1) { -+ /** -+ * Checks if the entity is in range to render by using the past in distance and comparing it to its average edge length -+ * * 64 * renderDistanceWeight Args: distance -+ */ -+ public boolean isInRangeToRenderDist(double par1) { - double var3 = this.boundingBox.getAverageEdgeLength(); - var3 *= 64.0D * this.renderDistanceWeight; -- return var1 < var3 * var3; -- } -- -- public boolean writeMountToNBT(NBTTagCompound var1) { -- String var2 = this.getEntityString(); -- if(!this.isDead && var2 != null) { -- var1.setString("id", var2); -- this.writeToNBT(var1); -- return true; -- } else { -- return false; -- } -- } -- -- public boolean writeToNBTOptional(NBTTagCompound var1) { -- String var2 = this.getEntityString(); -- if(!this.isDead && var2 != null && this.riddenByEntity == null) { -- var1.setString("id", var2); -- this.writeToNBT(var1); -- return true; -- } else { -- return false; -- } -- } -- -- public void writeToNBT(NBTTagCompound var1) { -+ return par1 < var3 * var3; -+ } -+ -+ /** -+ * Like writeToNBTOptional but does not check if the entity is ridden. Used for saving ridden entities with their -+ * riders. -+ */ -+ public boolean writeMountToNBT(NBTTagCompound par1NBTTagCompound) { -+ -+ String var2 = this.getEntityString(); -+ -+ if (!this.isDead && var2 != null) { -+ par1NBTTagCompound.setString("id", var2); -+ this.writeToNBT(par1NBTTagCompound); -+ return true; -+ } else { -+ return false; -+ } -+ } -+ -+ /** -+ * Either write this entity to the NBT tag given and return true, or return false without doing anything. If this -+ * returns false the entity is not saved on disk. Ridden entities return false here as they are saved with their rider. -+ */ -+ public boolean writeToNBTOptional(NBTTagCompound par1NBTTagCompound) { -+ String var2 = this.getEntityString(); -+ -+ if (!this.isDead && var2 != null && this.riddenByEntity == null) { -+ par1NBTTagCompound.setString("id", var2); -+ this.writeToNBT(par1NBTTagCompound); -+ return true; -+ } else { -+ return false; -+ } -+ } -+ -+ /** -+ * Save the entity to NBT (calls an abstract helper method to write extra data) -+ */ -+ public void writeToNBT(NBTTagCompound par1NBTTagCompound) { - try { -- var1.setTag("Pos", this.newDoubleNBTList(new double[]{this.posX, this.posY + (double)this.ySize, this.posZ})); -- var1.setTag("Motion", this.newDoubleNBTList(new double[]{this.motionX, this.motionY, this.motionZ})); -- var1.setTag("Rotation", this.newFloatNBTList(new float[]{this.rotationYaw, this.rotationPitch})); -- var1.setFloat("FallDistance", this.fallDistance); -- var1.setShort("Fire", (short)this.fire); -- var1.setShort("Air", (short)this.getAir()); -- var1.setBoolean("OnGround", this.onGround); -- var1.setInteger("Dimension", this.dimension); -- var1.setBoolean("Invulnerable", this.invulnerable); -- var1.setInteger("PortalCooldown", this.timeUntilPortal); -- var1.setLong("UUIDMost", this.i.getMostSignificantBits()); -- var1.setLong("UUIDLeast", this.i.getLeastSignificantBits()); -- this.writeEntityToNBT(var1); -- if(this.ridingEntity != null) { -+ par1NBTTagCompound.setTag("Pos", this.newDoubleNBTList(new double[] {this.posX, this.posY + (double)this.ySize, this.posZ})); -+ par1NBTTagCompound.setTag("Motion", this.newDoubleNBTList(new double[] {this.motionX, this.motionY, this.motionZ})); -+ par1NBTTagCompound.setTag("Rotation", this.newFloatNBTList(new float[] {this.rotationYaw, this.rotationPitch})); -+ par1NBTTagCompound.setFloat("FallDistance", this.fallDistance); -+ par1NBTTagCompound.setShort("Fire", (short)this.fire); -+ par1NBTTagCompound.setShort("Air", (short)this.getAir()); -+ par1NBTTagCompound.setBoolean("OnGround", this.onGround); -+ par1NBTTagCompound.setInteger("Dimension", this.dimension); -+ // Spout Start -+ par1NBTTagCompound.setLong("ID_LSB", uniqueId.getLeastSignificantBits()); -+ par1NBTTagCompound.setLong("ID_MSB", uniqueId.getMostSignificantBits()); -+ // Spout End -+ par1NBTTagCompound.setBoolean("Invulnerable", this.invulnerable); -+ par1NBTTagCompound.setInteger("PortalCooldown", this.timeUntilPortal); -+ par1NBTTagCompound.setLong("UUIDMost", this.entityUniqueID.getMostSignificantBits()); -+ par1NBTTagCompound.setLong("UUIDLeast", this.entityUniqueID.getLeastSignificantBits()); -+ this.writeEntityToNBT(par1NBTTagCompound); -+ -+ if (this.ridingEntity != null) { - NBTTagCompound var2 = new NBTTagCompound("Riding"); -- if(this.ridingEntity.writeMountToNBT(var2)) { -- var1.setTag("Riding", var2); -+ -+ if (this.ridingEntity.writeMountToNBT(var2)) { -+ par1NBTTagCompound.setTag("Riding", var2); - } - } -- - } catch (Throwable var5) { - CrashReport var3 = CrashReport.makeCrashReport(var5, "Saving entity NBT"); - CrashReportCategory var4 = var3.makeCategory("Entity being saved"); -@@ -972,46 +1335,60 @@ - } - } - -- public void readFromNBT(NBTTagCompound var1) { -+ /** -+ * Reads the entity from NBT (calls an abstract helper method to read specialized data) -+ */ -+ public void readFromNBT(NBTTagCompound par1NBTTagCompound) { - try { -- NBTTagList var2 = var1.getTagList("Pos"); -- NBTTagList var6 = var1.getTagList("Motion"); -- NBTTagList var7 = var1.getTagList("Rotation"); -- this.motionX = ((NBTTagDouble)var6.tagAt(0)).data; -- this.motionY = ((NBTTagDouble)var6.tagAt(1)).data; -- this.motionZ = ((NBTTagDouble)var6.tagAt(2)).data; -- if(Math.abs(this.motionX) > 10.0D) { -+ NBTTagList var2 = par1NBTTagCompound.getTagList("Pos"); -+ NBTTagList var7 = par1NBTTagCompound.getTagList("Motion"); -+ NBTTagList var6 = par1NBTTagCompound.getTagList("Rotation"); -+ this.motionX = ((NBTTagDouble)var7.tagAt(0)).data; -+ this.motionY = ((NBTTagDouble)var7.tagAt(1)).data; -+ this.motionZ = ((NBTTagDouble)var7.tagAt(2)).data; -+ -+ if (Math.abs(this.motionX) > 10.0D) { - this.motionX = 0.0D; - } - -- if(Math.abs(this.motionY) > 10.0D) { -+ if (Math.abs(this.motionY) > 10.0D) { - this.motionY = 0.0D; - } - -- if(Math.abs(this.motionZ) > 10.0D) { -+ if (Math.abs(this.motionZ) > 10.0D) { - this.motionZ = 0.0D; - } - - this.prevPosX = this.lastTickPosX = this.posX = ((NBTTagDouble)var2.tagAt(0)).data; - this.prevPosY = this.lastTickPosY = this.posY = ((NBTTagDouble)var2.tagAt(1)).data; - this.prevPosZ = this.lastTickPosZ = this.posZ = ((NBTTagDouble)var2.tagAt(2)).data; -- this.prevRotationYaw = this.rotationYaw = ((NBTTagFloat)var7.tagAt(0)).data; -- this.prevRotationPitch = this.rotationPitch = ((NBTTagFloat)var7.tagAt(1)).data; -- this.fallDistance = var1.getFloat("FallDistance"); -- this.fire = var1.getShort("Fire"); -- this.setAir(var1.getShort("Air")); -- this.onGround = var1.getBoolean("OnGround"); -- this.dimension = var1.getInteger("Dimension"); -- this.invulnerable = var1.getBoolean("Invulnerable"); -- this.timeUntilPortal = var1.getInteger("PortalCooldown"); -- if(var1.hasKey("UUIDMost") && var1.hasKey("UUIDLeast")) { -- this.i = new UUID(var1.getLong("UUIDMost"), var1.getLong("UUIDLeast")); -+ this.prevRotationYaw = this.rotationYaw = ((NBTTagFloat)var6.tagAt(0)).data; -+ this.prevRotationPitch = this.rotationPitch = ((NBTTagFloat)var6.tagAt(1)).data; -+ this.fallDistance = par1NBTTagCompound.getFloat("FallDistance"); -+ this.fire = par1NBTTagCompound.getShort("Fire"); -+ this.setAir(par1NBTTagCompound.getShort("Air")); -+ this.onGround = par1NBTTagCompound.getBoolean("OnGround"); -+ this.dimension = par1NBTTagCompound.getInteger("Dimension"); -+ this.invulnerable = par1NBTTagCompound.getBoolean("Invulnerable"); -+ this.timeUntilPortal = par1NBTTagCompound.getInteger("PortalCooldown"); -+ -+ if (par1NBTTagCompound.hasKey("UUIDMost") && par1NBTTagCompound.hasKey("UUIDLeast")) { -+ this.entityUniqueID = new UUID(par1NBTTagCompound.getLong("UUIDMost"), par1NBTTagCompound.getLong("UUIDLeast")); - } - - this.setPosition(this.posX, this.posY, this.posZ); - this.setRotation(this.rotationYaw, this.rotationPitch); -- this.readEntityFromNBT(var1); -- if(this.shouldSetPosAfterLoading()) { -+ // Spout Start -+ long lsb = par1NBTTagCompound.getLong("ID_LSB"); -+ long msb = par1NBTTagCompound.getLong("ID_MSB"); -+ UUID id = new UUID(msb, lsb); -+ if (!id.equals(new UUID(0, 0))) { -+ uniqueId = id; -+ } -+ // Spout End -+ this.readEntityFromNBT(par1NBTTagCompound); -+ -+ if (this.shouldSetPosAfterLoading()) { - this.setPosition(this.posX, this.posY, this.posZ); - } - -@@ -1027,23 +1404,33 @@ - return true; - } - -+ /** -+ * Returns the string that identifies this Entity's class -+ */ - protected final String getEntityString() { - return EntityList.getEntityString(this); - } - -+ /** -+ * (abstract) Protected helper method to read subclass entity data from NBT. -+ */ - protected abstract void readEntityFromNBT(NBTTagCompound var1); - -+ /** -+ * (abstract) Protected helper method to write subclass entity data to NBT. -+ */ - protected abstract void writeEntityToNBT(NBTTagCompound var1); - -- public void onChunkLoad() { -- } -- -- protected NBTTagList newDoubleNBTList(double... var1) { -+ public void onChunkLoad() {} -+ /** -+ * creates a NBT list from the array of doubles passed to this function -+ */ -+ protected NBTTagList newDoubleNBTList(double ... par1ArrayOfDouble) { - NBTTagList var2 = new NBTTagList(); -- double[] var3 = var1; -- int var4 = var1.length; -+ double[] var3 = par1ArrayOfDouble; -+ int var4 = par1ArrayOfDouble.length; - -- for(int var5 = 0; var5 < var4; ++var5) { -+ for (int var5 = 0; var5 < var4; ++var5) { - double var6 = var3[var5]; - var2.appendTag(new NBTTagDouble((String)null, var6)); - } -@@ -1051,12 +1438,15 @@ - return var2; - } - -- protected NBTTagList newFloatNBTList(float... var1) { -+ /** -+ * Returns a new NBTTagList filled with the specified floats -+ */ -+ protected NBTTagList newFloatNBTList(float ... par1ArrayOfFloat) { - NBTTagList var2 = new NBTTagList(); -- float[] var3 = var1; -- int var4 = var1.length; -+ float[] var3 = par1ArrayOfFloat; -+ int var4 = par1ArrayOfFloat.length; - -- for(int var5 = 0; var5 < var4; ++var5) { -+ for (int var5 = 0; var5 < var4; ++var5) { - float var6 = var3[var5]; - var2.appendTag(new NBTTagFloat((String)null, var6)); - } -@@ -1068,38 +1458,54 @@ - return this.height / 2.0F; - } - -- public EntityItem dropItem(int var1, int var2) { -- return this.dropItemWithOffset(var1, var2, 0.0F); -- } -- -- public EntityItem dropItemWithOffset(int var1, int var2, float var3) { -- return this.entityDropItem(new ItemStack(var1, var2, 0), var3); -- } -- -- public EntityItem entityDropItem(ItemStack var1, float var2) { -- if(var1.stackSize == 0) { -+ /** -+ * Drops an item stack at the entity's position. Args: itemID, count -+ */ -+ public EntityItem dropItem(int par1, int par2) { -+ return this.dropItemWithOffset(par1, par2, 0.0F); -+ } -+ -+ /** -+ * Drops an item stack with a specified y offset. Args: itemID, count, yOffset -+ */ -+ public EntityItem dropItemWithOffset(int par1, int par2, float par3) { -+ return this.entityDropItem(new ItemStack(par1, par2, 0), par3); -+ } -+ -+ /** -+ * Drops an item at the position of the entity. -+ */ -+ public EntityItem entityDropItem(ItemStack par1ItemStack, float par2) { -+ if (par1ItemStack.stackSize == 0) { - return null; - } else { -- EntityItem var3 = new EntityItem(this.worldObj, this.posX, this.posY + (double)var2, this.posZ, var1); -+ EntityItem var3 = new EntityItem(this.worldObj, this.posX, this.posY + (double)par2, this.posZ, par1ItemStack); - var3.delayBeforeCanPickup = 10; - this.worldObj.spawnEntityInWorld(var3); - return var3; - } - } - -+ /** -+ * Checks whether target entity is alive. -+ */ - public boolean isEntityAlive() { - return !this.isDead; - } - -+ /** -+ * Checks if this entity is inside of an opaque block -+ */ - public boolean isEntityInsideOpaqueBlock() { -- for(int var1 = 0; var1 < 8; ++var1) { -+ for (int var1 = 0; var1 < 8; ++var1) { - float var2 = ((float)((var1 >> 0) % 2) - 0.5F) * this.width * 0.8F; - float var3 = ((float)((var1 >> 1) % 2) - 0.5F) * 0.1F; - float var4 = ((float)((var1 >> 2) % 2) - 0.5F) * this.width * 0.8F; - int var5 = MathHelper.floor_double(this.posX + (double)var2); - int var6 = MathHelper.floor_double(this.posY + (double)this.getEyeHeight() + (double)var3); - int var7 = MathHelper.floor_double(this.posZ + (double)var4); -- if(this.worldObj.isBlockNormalCube(var5, var6, var7)) { -+ -+ if (this.worldObj.isBlockNormalCube(var5, var6, var7)) { - return true; - } - } -@@ -1107,135 +1513,172 @@ - return false; - } - -- public boolean interactFirst(EntityPlayer var1) { -- return false; -+ /** -+ * Only used by renderer in EntityLivingBase subclasses.\nDetermines if an entity is visible or not to a specfic -+ * player, if the entity is normally invisible.\nFor EntityLivingBase subclasses, returning false when invisible will -+ * render the entity semitransparent. -+ */ -+ public boolean isInvisibleToPlayer(EntityPlayer par1EntityPlayer) { -+ return this.isInvisible(); - } - -- public AxisAlignedBB getCollisionBox(Entity var1) { -+ /** -+ * Returns a boundingBox used to collide the entity with other entities and blocks. This enables the entity to be -+ * pushable on contact, like boats or minecarts. -+ */ -+ public AxisAlignedBB getCollisionBox(Entity par1Entity) { - return null; - } - -+ /** -+ * Handles updating while being ridden by an entity -+ */ - public void updateRidden() { -- if(this.ridingEntity.isDead) { -+ if (this.ridingEntity.isDead) { - this.ridingEntity = null; - } else { - this.motionX = 0.0D; - this.motionY = 0.0D; - this.motionZ = 0.0D; - this.onUpdate(); -- if(this.ridingEntity != null) { -+ -+ if (this.ridingEntity != null) { - this.ridingEntity.updateRiderPosition(); - this.entityRiderYawDelta += (double)(this.ridingEntity.rotationYaw - this.ridingEntity.prevRotationYaw); - -- for(this.entityRiderPitchDelta += (double)(this.ridingEntity.rotationPitch - this.ridingEntity.prevRotationPitch); this.entityRiderYawDelta >= 180.0D; this.entityRiderYawDelta -= 360.0D) { -+ for (this.entityRiderPitchDelta += (double)(this.ridingEntity.rotationPitch - this.ridingEntity.prevRotationPitch); this.entityRiderYawDelta >= 180.0D; this.entityRiderYawDelta -= 360.0D) { -+ ; - } - -- while(this.entityRiderYawDelta < -180.0D) { -+ while (this.entityRiderYawDelta < -180.0D) { - this.entityRiderYawDelta += 360.0D; - } - -- while(this.entityRiderPitchDelta >= 180.0D) { -+ while (this.entityRiderPitchDelta >= 180.0D) { - this.entityRiderPitchDelta -= 360.0D; - } - -- while(this.entityRiderPitchDelta < -180.0D) { -+ while (this.entityRiderPitchDelta < -180.0D) { - this.entityRiderPitchDelta += 360.0D; - } - - double var1 = this.entityRiderYawDelta * 0.5D; - double var3 = this.entityRiderPitchDelta * 0.5D; - float var5 = 10.0F; -- if(var1 > (double)var5) { -+ -+ if (var1 > (double)var5) { - var1 = (double)var5; - } - -- if(var1 < (double)(-var5)) { -+ if (var1 < (double)(-var5)) { - var1 = (double)(-var5); - } - -- if(var3 > (double)var5) { -+ if (var3 > (double)var5) { - var3 = (double)var5; - } - -- if(var3 < (double)(-var5)) { -+ if (var3 < (double)(-var5)) { - var3 = (double)(-var5); - } - - this.entityRiderYawDelta -= var1; -- this.entityRiderPitchDelta -= var3; -+ this.entityRiderPitchDelta -= var3; - } - } - } - - public void updateRiderPosition() { -- if(this.riddenByEntity != null) { -+ if (this.riddenByEntity != null) { - this.riddenByEntity.setPosition(this.posX, this.posY + this.getMountedYOffset() + this.riddenByEntity.getYOffset(), this.posZ); - } - } - -+ /** -+ * Returns the Y Offset of this entity. -+ */ - public double getYOffset() { - return (double)this.yOffset; - } - -+ /** -+ * Returns the Y offset from the entity's position for any entity riding this one. -+ */ - public double getMountedYOffset() { - return (double)this.height * 0.75D; - } - -- public void mountEntity(Entity var1) { -+ /** -+ * Called when a player mounts an entity. e.g. mounts a pig, mounts a boat. -+ */ -+ public void mountEntity(Entity par1Entity) { - this.entityRiderPitchDelta = 0.0D; - this.entityRiderYawDelta = 0.0D; -- if(var1 == null) { -- if(this.ridingEntity != null) { -+ -+ if (par1Entity == null) { -+ if (this.ridingEntity != null) { - this.setLocationAndAngles(this.ridingEntity.posX, this.ridingEntity.boundingBox.minY + (double)this.ridingEntity.height, this.ridingEntity.posZ, this.rotationYaw, this.rotationPitch); - this.ridingEntity.riddenByEntity = null; - } - - this.ridingEntity = null; - } else { -- if(this.ridingEntity != null) { -+ if (this.ridingEntity != null) { - this.ridingEntity.riddenByEntity = null; - } - -- this.ridingEntity = var1; -- var1.riddenByEntity = this; -+ this.ridingEntity = par1Entity; -+ par1Entity.riddenByEntity = this; - } - } - -- public void setPositionAndRotation2(double var1, double var3, double var5, float var7, float var8, int var9) { -- this.setPosition(var1, var3, var5); -- this.setRotation(var7, var8); -- List var10 = this.worldObj.getCollidingBoundingBoxes(this, this.boundingBox.contract(1.0D / 32.0D, 0.0D, 1.0D / 32.0D)); -- if(!var10.isEmpty()) { -+ /** -+ * Sets the position and rotation. Only difference from the other one is no bounding on the rotation. Args: posX, posY, -+ * posZ, yaw, pitch -+ */ -+ public void setPositionAndRotation2(double par1, double par3, double par5, float par7, float par8, int par9) { -+ this.setPosition(par1, par3, par5); -+ this.setRotation(par7, par8); -+ List var10 = this.worldObj.getCollidingBoundingBoxes(this, this.boundingBox.contract(0.03125D, 0.0D, 0.03125D)); -+ -+ if (!var10.isEmpty()) { - double var11 = 0.0D; - -- for(int var13 = 0; var13 < var10.size(); ++var13) { -+ for (int var13 = 0; var13 < var10.size(); ++var13) { - AxisAlignedBB var14 = (AxisAlignedBB)var10.get(var13); -- if(var14.maxY > var11) { -+ -+ if (var14.maxY > var11) { - var11 = var14.maxY; - } - } - -- var3 += var11 - this.boundingBox.minY; -- this.setPosition(var1, var3, var5); -+ par3 += var11 - this.boundingBox.minY; -+ this.setPosition(par1, par3, par5); - } -- - } - - public float getCollisionBorderSize() { - return 0.1F; - } - -+ /** -+ * returns a (normalized) vector of where this entity is looking -+ */ - public Vec3 getLookVec() { - return null; - } - -+ /** -+ * Called by portal blocks when an entity is within it. -+ */ - public void setInPortal() { -- if(this.timeUntilPortal > 0) { -+ if (this.timeUntilPortal > 0) { - this.timeUntilPortal = this.getPortalCooldown(); - } else { - double var1 = this.prevPosX - this.posX; - double var3 = this.prevPosZ - this.posZ; -- if(!this.worldObj.isRemote && !this.inPortal) { -+ -+ if (!this.worldObj.isRemote && !this.inPortal) { - this.teleportDirection = Direction.getMovementDirection(var1, var3); - } - -@@ -1243,116 +1686,162 @@ - } - } - -+ /** -+ * Return the amount of cooldown before this entity can use a portal again. -+ */ - public int getPortalCooldown() { - return 900; - } - -- public void setVelocity(double var1, double var3, double var5) { -- this.motionX = var1; -- this.motionY = var3; -- this.motionZ = var5; -- } -- -- public void handleHealthUpdate(byte var1) { -- } -- -- public void performHurtAnimation() { -- } -- -- public ItemStack[] getInventory() { -+ /** -+ * Sets the velocity to the args. Args: x, y, z -+ */ -+ public void setVelocity(double par1, double par3, double par5) { -+ this.motionX = par1; -+ this.motionY = par3; -+ this.motionZ = par5; -+ } -+ -+ public void handleHealthUpdate(byte par1) {} -+ -+ /** -+ * Setups the entity to do the hurt animation. Only used by packets in multiplayer. -+ */ -+ public void performHurtAnimation() {} -+ -+ public ItemStack[] getLastActiveItems() { - return null; - } - -- public void setCurrentItemOrArmor(int var1, ItemStack var2) { -- } -+ /** -+ * Sets the held item, or an armor slot. Slot 0 is held item. Slot 1-4 is armor. Params: Item, slot -+ */ -+ public void setCurrentItemOrArmor(int par1, ItemStack par2ItemStack) {} - -+ /** -+ * Returns true if the entity is on fire. Used by render to add the fire effect on rendering. -+ */ - public boolean isBurning() { - return !this.isImmuneToFire && (this.fire > 0 || this.getFlag(0)); - } - -+ /** -+ * Returns true if the entity is riding another entity, used by render to rotate the legs to be in 'sit' position for -+ * players. -+ */ - public boolean isRiding() { - return this.ridingEntity != null; - } - -+ /** -+ * Returns if this entity is sneaking. -+ */ - public boolean isSneaking() { - return this.getFlag(1); - } - -- public void setSneaking(boolean var1) { -- this.setFlag(1, var1); -+ /** -+ * Sets the sneaking flag. -+ */ -+ public void setSneaking(boolean par1) { -+ this.setFlag(1, par1); - } - -+ /** -+ * Get if the Entity is sprinting. -+ */ - public boolean isSprinting() { - return this.getFlag(3); - } - -- public void setSprinting(boolean var1) { -- this.setFlag(3, var1); -+ /** -+ * Set sprinting switch for Entity. -+ */ -+ public void setSprinting(boolean par1) { -+ this.setFlag(3, par1); - } - - public boolean isInvisible() { - return this.getFlag(5); - } - -- public boolean isInvisibleToPlayer(EntityPlayer var1) { -+ public boolean func_98034_c(EntityPlayer par1EntityPlayer) { - return this.isInvisible(); - } - -- public void setInvisible(boolean var1) { -- this.setFlag(5, var1); -+ public void setInvisible(boolean par1) { -+ this.setFlag(5, par1); - } - - public boolean isEating() { - return this.getFlag(4); - } - -- public void setEating(boolean var1) { -- this.setFlag(4, var1); -- } -- -- protected boolean getFlag(int var1) { -- return (this.dataWatcher.getWatchableObjectByte(0) & 1 << var1) != 0; -- } -- -- protected void setFlag(int var1, boolean var2) { -+ public void setEating(boolean par1) { -+ this.setFlag(4, par1); -+ } -+ -+ /** -+ * Returns true if the flag is active for the entity. Known flags: 0) is burning; 1) is sneaking; 2) is riding -+ * something; 3) is sprinting; 4) is eating -+ */ -+ protected boolean getFlag(int par1) { -+ return (this.dataWatcher.getWatchableObjectByte(0) & 1 << par1) != 0; -+ } -+ -+ /** -+ * Enable or disable a entity flag, see getEntityFlag to read the know flags. -+ */ -+ // Spout Start - protected to public -+ public void setFlag(int par1, boolean par2) { -+ // Spout End - byte var3 = this.dataWatcher.getWatchableObjectByte(0); -- if(var2) { -- this.dataWatcher.updateObject(0, Byte.valueOf((byte)(var3 | 1 << var1))); -+ -+ if (par2) { -+ this.dataWatcher.updateObject(0, Byte.valueOf((byte)(var3 | 1 << par1))); - } else { -- this.dataWatcher.updateObject(0, Byte.valueOf((byte)(var3 & ~(1 << var1)))); -+ this.dataWatcher.updateObject(0, Byte.valueOf((byte)(var3 & ~(1 << par1)))); - } -- - } - - public int getAir() { - return this.dataWatcher.getWatchableObjectShort(1); - } - -- public void setAir(int var1) { -- this.dataWatcher.updateObject(1, Short.valueOf((short)var1)); -+ public void setAir(int par1) { -+ this.dataWatcher.updateObject(1, Short.valueOf((short)par1)); - } - -- public void onStruckByLightning(EntityLightningBolt var1) { -+ /** -+ * Called when a lightning bolt hits the entity. -+ */ -+ public void onStruckByLightning(EntityLightningBolt par1EntityLightningBolt) { - this.dealFireDamage(5); - ++this.fire; -- if(this.fire == 0) { -+ -+ if (this.fire == 0) { - this.setFire(8); - } -- -- } -- -- public void onKillEntity(EntityLivingBase var1) { -- } -- -- protected boolean pushOutOfBlocks(double var1, double var3, double var5) { -- int var7 = MathHelper.floor_double(var1); -- int var8 = MathHelper.floor_double(var3); -- int var9 = MathHelper.floor_double(var5); -- double var10 = var1 - (double)var7; -- double var12 = var3 - (double)var8; -- double var14 = var5 - (double)var9; -+ } -+ -+ /** -+ * This method gets called when the entity kills another one. -+ */ -+ public void onKillEntity(EntityLivingBase par1EntityLivingBase) {} -+ -+ /** -+ * Adds velocity to push the entity out of blocks at the specified x, y, z position Args: x, y, z -+ */ -+ protected boolean pushOutOfBlocks(double par1, double par3, double par5) { -+ int var7 = MathHelper.floor_double(par1); -+ int var8 = MathHelper.floor_double(par3); -+ int var9 = MathHelper.floor_double(par5); -+ double var10 = par1 - (double)var7; -+ double var12 = par3 - (double)var8; -+ double var14 = par5 - (double)var9; - List var16 = this.worldObj.getCollidingBlockBounds(this.boundingBox); -- if(var16.isEmpty() && !this.worldObj.isBlockFullCube(var7, var8, var9)) { -+ -+ if (var16.isEmpty() && !this.worldObj.isBlockFullCube(var7, var8, var9)) { - return false; - } else { - boolean var17 = !this.worldObj.isBlockFullCube(var7 - 1, var8, var9); -@@ -1363,53 +1852,55 @@ - boolean var22 = !this.worldObj.isBlockFullCube(var7, var8, var9 + 1); - byte var23 = 3; - double var24 = 9999.0D; -- if(var17 && var10 < var24) { -+ -+ if (var17 && var10 < var24) { - var24 = var10; - var23 = 0; - } - -- if(var18 && 1.0D - var10 < var24) { -+ if (var18 && 1.0D - var10 < var24) { - var24 = 1.0D - var10; - var23 = 1; - } - -- if(var20 && 1.0D - var12 < var24) { -+ if (var20 && 1.0D - var12 < var24) { - var24 = 1.0D - var12; - var23 = 3; - } - -- if(var21 && var14 < var24) { -+ if (var21 && var14 < var24) { - var24 = var14; - var23 = 4; - } - -- if(var22 && 1.0D - var14 < var24) { -+ if (var22 && 1.0D - var14 < var24) { - var24 = 1.0D - var14; - var23 = 5; - } - -- float var26 = this.ab.nextFloat() * 0.2F + 0.1F; -- if(var23 == 0) { -+ float var26 = this.rand.nextFloat() * 0.2F + 0.1F; -+ -+ if (var23 == 0) { - this.motionX = (double)(-var26); - } - -- if(var23 == 1) { -+ if (var23 == 1) { - this.motionX = (double)var26; - } - -- if(var23 == 2) { -+ if (var23 == 2) { - this.motionY = (double)(-var26); - } - -- if(var23 == 3) { -+ if (var23 == 3) { - this.motionY = (double)var26; - } - -- if(var23 == 4) { -+ if (var23 == 4) { - this.motionZ = (double)(-var26); - } - -- if(var23 == 5) { -+ if (var23 == 5) { - this.motionZ = (double)var26; - } - -@@ -1417,72 +1908,108 @@ - } - } - -+ /** -+ * Sets the Entity inside a web block. -+ */ - public void setInWeb() { - this.isInWeb = true; - this.fallDistance = 0.0F; - } - -+ /** -+ * Gets the username of the entity. -+ */ - public String getEntityName() { - String var1 = EntityList.getEntityString(this); -- if(var1 == null) { -+ -+ if (var1 == null) { - var1 = "generic"; - } - - return StatCollector.translateToLocal("entity." + var1 + ".name"); - } - -+ /** -+ * Return the Entity parts making up this Entity (currently only for dragons) -+ */ - public Entity[] getParts() { - return null; - } - -- public boolean isEntityEqual(Entity var1) { -- return this == var1; -+ /** -+ * Returns true if Entity argument is equal to this Entity -+ */ -+ public boolean isEntityEqual(Entity par1Entity) { -+ return this == par1Entity; - } - - public float getRotationYawHead() { - return 0.0F; - } - -- public void setRotationYawHead(float var1) { -- } -+ /** -+ * Sets the head's yaw rotation of the entity. -+ */ -+ public void setRotationYawHead(float par1) {} - -+ /** -+ * If returns false, the item will not inflict any damage against entities. -+ */ - public boolean canAttackWithItem() { - return true; - } - -- public boolean hitByEntity(Entity var1) { -+ /** -+ * Called when a player attacks an entity. If this returns true the attack will not happen. -+ */ -+ public boolean hitByEntity(Entity par1Entity) { - return false; - } - - public String toString() { -- return String.format("%s[\'%s\'/%d, l=\'%s\', x=%.2f, y=%.2f, z=%.2f]", new Object[]{this.getClass().getSimpleName(), this.getEntityName(), Integer.valueOf(this.entityId), this.worldObj == null ? "~NULL~" : this.worldObj.getWorldInfo().getWorldName(), Double.valueOf(this.posX), Double.valueOf(this.posY), Double.valueOf(this.posZ)}); -+ return String.format("%s[\'%s\'/%d, l=\'%s\', x=%.2f, y=%.2f, z=%.2f]", new Object[] {this.getClass().getSimpleName(), this.getEntityName(), Integer.valueOf(this.entityId), this.worldObj == null ? "~NULL~" : this.worldObj.getWorldInfo().getWorldName(), Double.valueOf(this.posX), Double.valueOf(this.posY), Double.valueOf(this.posZ)}); - } - -+ /** -+ * Return whether this entity is invulnerable to damage. -+ */ - public boolean isEntityInvulnerable() { - return this.invulnerable; - } - -- public void copyLocationAndAnglesFrom(Entity var1) { -- this.setLocationAndAngles(var1.posX, var1.posY, var1.posZ, var1.rotationYaw, var1.rotationPitch); -+ /** -+ * Sets this entity's location and angles to the location and angles of the passed in entity. -+ */ -+ public void copyLocationAndAnglesFrom(Entity par1Entity) { -+ this.setLocationAndAngles(par1Entity.posX, par1Entity.posY, par1Entity.posZ, par1Entity.rotationYaw, par1Entity.rotationPitch); - } - -- public void copyDataFrom(Entity var1, boolean var2) { -+ /** -+ * Copies important data from another entity to this entity. Used when teleporting entities between worlds, as this -+ * actually deletes the teleporting entity and re-creates it on the other side. Params: Entity to copy from, unused -+ * (always true) -+ */ -+ public void copyDataFrom(Entity par1Entity, boolean par2) { - NBTTagCompound var3 = new NBTTagCompound(); -- var1.writeToNBT(var3); -+ par1Entity.writeToNBT(var3); - this.readFromNBT(var3); -- this.timeUntilPortal = var1.timeUntilPortal; -- this.teleportDirection = var1.teleportDirection; -+ this.timeUntilPortal = par1Entity.timeUntilPortal; -+ this.teleportDirection = par1Entity.teleportDirection; - } - -- public void travelToDimension(int var1) { -- if(!this.worldObj.isRemote && !this.isDead) { -+ /** -+ * Teleports the entity to another dimension. Params: Dimension number to teleport to -+ */ -+ public void travelToDimension(int par1) { -+ if (!this.worldObj.isRemote && !this.isDead) { - this.worldObj.theProfiler.startSection("changeDimension"); - MinecraftServer var2 = MinecraftServer.getServer(); - int var3 = this.dimension; - WorldServer var4 = var2.worldServerForDimension(var3); -- WorldServer var5 = var2.worldServerForDimension(var1); -- this.dimension = var1; -- if(var3 == 1 && var1 == 1) { -+ WorldServer var5 = var2.worldServerForDimension(par1); -+ this.dimension = par1; -+ -+ if (var3 == 1 && par1 == 1) { - var5 = var2.worldServerForDimension(0); - this.dimension = 0; - } -@@ -1493,9 +2020,11 @@ - var2.getConfigurationManager().transferEntityToWorld(this, var3, var4, var5); - this.worldObj.theProfiler.endStartSection("reloading"); - Entity var6 = EntityList.createEntityByName(EntityList.getEntityString(this), var5); -- if(var6 != null) { -+ -+ if (var6 != null) { - var6.copyDataFrom(this, true); -- if(var3 == 1 && var1 == 1) { -+ -+ if (var3 == 1 && par1 == 1) { - ChunkCoordinates var7 = var5.getSpawnPoint(); - var7.posY = this.worldObj.getTopSolidOrLiquidBlock(var7.posX, var7.posZ); - var6.setLocationAndAngles((double)var7.posX, (double)var7.posY, (double)var7.posZ, var6.rotationYaw, var6.rotationPitch); -@@ -1512,14 +2041,21 @@ - } - } - -- public float getBlockExplosionResistance(Explosion var1, World var2, int var3, int var4, int var5, Block var6) { -- return var6.getExplosionResistance(this); -+ /** -+ * Gets a block's resistance to this entity's explosion. Used to make rails immune to TNT minecarts' explosions and -+ * Wither skulls more destructive. -+ */ -+ public float getBlockExplosionResistance(Explosion par1Explosion, World par2World, int par3, int par4, int par5, Block par6Block) { -+ return par6Block.getExplosionResistance(this); - } - -- public boolean shouldExplodeBlock(Explosion var1, World var2, int var3, int var4, int var5, int var6, float var7) { -+ public boolean shouldExplodeBlock(Explosion par1Explosion, World par2World, int par3, int par4, int par5, int par6, float par7) { - return true; - } - -+ /** -+ * The number of iterations PathFinder.getSafePoint will execute before giving up. -+ */ - public int getMaxSafePointTries() { - return 3; - } -@@ -1528,31 +2064,40 @@ - return this.teleportDirection; - } - -+ /** -+ * Return whether this entity should NOT trigger a pressure plate or a tripwire. -+ */ - public boolean doesEntityNotTriggerPressurePlate() { - return false; - } - -- public void addEntityCrashInfo(CrashReportCategory var1) { -- var1.addCrashSectionCallable("Entity Type", new CallableEntityType(this)); -- var1.addCrashSection("Entity ID", Integer.valueOf(this.entityId)); -- var1.addCrashSectionCallable("Entity Name", new CallableEntityName(this)); -- var1.addCrashSection("Entity\'s Exact location", String.format("%.2f, %.2f, %.2f", new Object[]{Double.valueOf(this.posX), Double.valueOf(this.posY), Double.valueOf(this.posZ)})); -- var1.addCrashSection("Entity\'s Block location", CrashReportCategory.getLocationInfo(MathHelper.floor_double(this.posX), MathHelper.floor_double(this.posY), MathHelper.floor_double(this.posZ))); -- var1.addCrashSection("Entity\'s Momentum", String.format("%.2f, %.2f, %.2f", new Object[]{Double.valueOf(this.motionX), Double.valueOf(this.motionY), Double.valueOf(this.motionZ)})); -+ public void addEntityCrashInfo(CrashReportCategory par1CrashReportCategory) { -+ par1CrashReportCategory.addCrashSectionCallable("Entity Type", new CallableEntityType(this)); -+ par1CrashReportCategory.addCrashSection("Entity ID", Integer.valueOf(this.entityId)); -+ par1CrashReportCategory.addCrashSectionCallable("Entity Name", new CallableEntityName(this)); -+ par1CrashReportCategory.addCrashSection("Entity\'s Exact location", String.format("%.2f, %.2f, %.2f", new Object[] {Double.valueOf(this.posX), Double.valueOf(this.posY), Double.valueOf(this.posZ)})); -+ par1CrashReportCategory.addCrashSection("Entity\'s Block location", CrashReportCategory.getLocationInfo(MathHelper.floor_double(this.posX), MathHelper.floor_double(this.posY), MathHelper.floor_double(this.posZ))); -+ par1CrashReportCategory.addCrashSection("Entity\'s Momentum", String.format("%.2f, %.2f, %.2f", new Object[] {Double.valueOf(this.motionX), Double.valueOf(this.motionY), Double.valueOf(this.motionZ)})); - } - -+ /** -+ * Return whether this entity should be rendered as on fire. -+ */ - public boolean canRenderOnFire() { - return this.isBurning(); - } - - public UUID getUniqueID() { -- return this.i; -+ return this.entityUniqueID; - } - - public boolean isPushedByWater() { - return true; - } - -+ /** -+ * Returns the translated name of the entity. -+ */ - public String getTranslatedEntityName() { - return this.getEntityName(); - } ---- net/minecraft/src/ComponentNetherBridgeCorridor.java -+++ net/minecraft/src/ComponentNetherBridgeCorridor.java -@@ -6,62 +6,73 @@ - public class ComponentNetherBridgeCorridor extends ComponentNetherBridgePiece { - private boolean field_111021_b; - -- public ComponentNetherBridgeCorridor() { -- } -- -- public ComponentNetherBridgeCorridor(int var1, Random var2, StructureBoundingBox var3, int var4) { -- super(var1); -- this.coordBaseMode = var4; -- this.boundingBox = var3; -- this.field_111021_b = var2.nextInt(3) == 0; -- } -- -- protected void func_143011_b(NBTTagCompound var1) { -- super.func_143011_b(var1); -- this.field_111021_b = var1.getBoolean("Chest"); -- } -- -- protected void func_143012_a(NBTTagCompound var1) { -- super.func_143012_a(var1); -- var1.setBoolean("Chest", this.field_111021_b); -- } -- -- public void buildComponent(StructureComponent var1, List var2, Random var3) { -- this.getNextComponentX((ComponentNetherBridgeStartPiece)var1, var2, var3, 0, 1, true); -- } -- -- public static ComponentNetherBridgeCorridor createValidComponent(List var0, Random var1, int var2, int var3, int var4, int var5, int var6) { -- StructureBoundingBox var7 = StructureBoundingBox.getComponentToAddBoundingBox(var2, var3, var4, -1, 0, 0, 5, 7, 5, var5); -- return isAboveGround(var7) && StructureComponent.findIntersecting(var0, var7) == null ? new ComponentNetherBridgeCorridor(var6, var1, var7, var5) : null; -- } -- -- public boolean addComponentParts(World var1, Random var2, StructureBoundingBox var3) { -- this.fillWithBlocks(var1, var3, 0, 0, 0, 4, 1, 4, Block.netherBrick.blockID, Block.netherBrick.blockID, false); -- this.fillWithBlocks(var1, var3, 0, 2, 0, 4, 5, 4, 0, 0, false); -- this.fillWithBlocks(var1, var3, 4, 2, 0, 4, 5, 4, Block.netherBrick.blockID, Block.netherBrick.blockID, false); -- this.fillWithBlocks(var1, var3, 4, 3, 1, 4, 4, 1, Block.netherFence.blockID, Block.netherFence.blockID, false); -- this.fillWithBlocks(var1, var3, 4, 3, 3, 4, 4, 3, Block.netherFence.blockID, Block.netherFence.blockID, false); -- this.fillWithBlocks(var1, var3, 0, 2, 0, 0, 5, 0, Block.netherBrick.blockID, Block.netherBrick.blockID, false); -- this.fillWithBlocks(var1, var3, 0, 2, 4, 3, 5, 4, Block.netherBrick.blockID, Block.netherBrick.blockID, false); -- this.fillWithBlocks(var1, var3, 1, 3, 4, 1, 4, 4, Block.netherFence.blockID, Block.netherBrick.blockID, false); -- this.fillWithBlocks(var1, var3, 3, 3, 4, 3, 4, 4, Block.netherFence.blockID, Block.netherBrick.blockID, false); -+ public ComponentNetherBridgeCorridor() {} -+ -+ public ComponentNetherBridgeCorridor(int par1, Random par2Random, StructureBoundingBox par3StructureBoundingBox, int par4) { -+ super(par1); -+ this.coordBaseMode = par4; -+ this.boundingBox = par3StructureBoundingBox; -+ this.field_111021_b = par2Random.nextInt(3) == 0; -+ } -+ -+ protected void func_143011_b(NBTTagCompound par1NBTTagCompound) { -+ super.func_143011_b(par1NBTTagCompound); -+ this.field_111021_b = par1NBTTagCompound.getBoolean("Chest"); -+ } -+ -+ protected void func_143012_a(NBTTagCompound par1NBTTagCompound) { -+ super.func_143012_a(par1NBTTagCompound); -+ par1NBTTagCompound.setBoolean("Chest", this.field_111021_b); -+ } -+ -+ /** -+ * Initiates construction of the Structure Component picked, at the current Location of StructGen -+ */ -+ public void buildComponent(StructureComponent par1StructureComponent, List par2List, Random par3Random) { -+ this.getNextComponentX((ComponentNetherBridgeStartPiece)par1StructureComponent, par2List, par3Random, 0, 1, true); -+ } -+ -+ /** -+ * Creates and returns a new component piece. Or null if it could not find enough room to place it. -+ */ -+ public static ComponentNetherBridgeCorridor createValidComponent(List par0List, Random par1Random, int par2, int par3, int par4, int par5, int par6) { -+ StructureBoundingBox var7 = StructureBoundingBox.getComponentToAddBoundingBox(par2, par3, par4, -1, 0, 0, 5, 7, 5, par5); -+ return isAboveGround(var7) && StructureComponent.findIntersecting(par0List, var7) == null ? new ComponentNetherBridgeCorridor(par6, par1Random, var7, par5) : null; -+ } -+ -+ /** -+ * second Part of Structure generating, this for example places Spiderwebs, Mob Spawners, it closes Mineshafts at the -+ * end, it adds Fences... -+ */ -+ public boolean addComponentParts(World par1World, Random par2Random, StructureBoundingBox par3StructureBoundingBox) { -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 0, 0, 0, 4, 1, 4, Block.netherBrick.blockID, Block.netherBrick.blockID, false); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 0, 2, 0, 4, 5, 4, 0, 0, false); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 4, 2, 0, 4, 5, 4, Block.netherBrick.blockID, Block.netherBrick.blockID, false); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 4, 3, 1, 4, 4, 1, Block.netherFence.blockID, Block.netherFence.blockID, false); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 4, 3, 3, 4, 4, 3, Block.netherFence.blockID, Block.netherFence.blockID, false); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 0, 2, 0, 0, 5, 0, Block.netherBrick.blockID, Block.netherBrick.blockID, false); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 0, 2, 4, 3, 5, 4, Block.netherBrick.blockID, Block.netherBrick.blockID, false); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 1, 3, 4, 1, 4, 4, Block.netherFence.blockID, Block.netherBrick.blockID, false); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 3, 3, 4, 3, 4, 4, Block.netherFence.blockID, Block.netherBrick.blockID, false); - int var4; - int var5; -- if(this.field_111021_b) { -+ -+ if (this.field_111021_b) { - var4 = this.getYWithOffset(2); - var5 = this.getXWithOffset(3, 3); - int var6 = this.getZWithOffset(3, 3); -- if(var3.isVecInside(var5, var4, var6)) { -+ -+ if (par3StructureBoundingBox.isVecInside(var5, var4, var6)) { - this.field_111021_b = false; -- this.generateStructureChestContents(var1, var3, var2, 3, 2, 3, field_111019_a, 2 + var2.nextInt(4)); -+ this.generateStructureChestContents(par1World, par3StructureBoundingBox, par2Random, 3, 2, 3, field_111019_a, 2 + par2Random.nextInt(4)); - } - } - -- this.fillWithBlocks(var1, var3, 0, 6, 0, 4, 6, 4, Block.netherBrick.blockID, Block.netherBrick.blockID, false); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 0, 6, 0, 4, 6, 4, Block.netherBrick.blockID, Block.netherBrick.blockID, false); - -- for(var4 = 0; var4 <= 4; ++var4) { -- for(var5 = 0; var5 <= 4; ++var5) { -- this.fillCurrentPositionBlocksDownwards(var1, Block.netherBrick.blockID, 0, var4, -1, var5, var3); -+ for (var4 = 0; var4 <= 4; ++var4) { -+ for (var5 = 0; var5 <= 4; ++var5) { -+ this.fillCurrentPositionBlocksDownwards(par1World, Block.netherBrick.blockID, 0, var4, -1, var5, par3StructureBoundingBox); - } - } - ---- net/minecraft/src/EntityDropParticleFX.java -+++ net/minecraft/src/EntityDropParticleFX.java -@@ -1,16 +1,35 @@ - package net.minecraft.src; - -+// MCPatcher Start -+import com.prupe.mcpatcher.cc.ColorizeBlock; -+import com.prupe.mcpatcher.cc.ColorizeEntity; -+import com.prupe.mcpatcher.cc.Colorizer; -+// MCPatcher End -+ - public class EntityDropParticleFX extends EntityFX { -+ -+ /** the material type for dropped items/blocks */ - private Material materialType; -+ -+ /** The height of the current bob */ - private int bobTimer; - -- public EntityDropParticleFX(World var1, double var2, double var4, double var6, Material var8) { -- super(var1, var2, var4, var6, 0.0D, 0.0D, 0.0D); -+ public EntityDropParticleFX(World par1World, double par2, double par4, double par6, Material par8Material) { -+ super(par1World, par2, par4, par6, 0.0D, 0.0D, 0.0D); - this.motionX = this.motionY = this.motionZ = 0.0D; -- if(var8 == Material.water) { -- this.particleRed = 0.0F; -- this.particleGreen = 0.0F; -- this.particleBlue = 1.0F; -+ -+ if (par8Material == Material.water) { -+ // MCPatcher Start -+ if (ColorizeBlock.computeWaterColor(this.posX, this.posY, this.posZ)) { -+ this.particleRed = ColorizeBlock.waterColor[0]; -+ this.particleGreen = ColorizeBlock.waterColor[1]; -+ this.particleBlue = ColorizeBlock.waterColor[2]; -+ } else { -+ this.particleRed = 0.2F; -+ this.particleGreen = 0.3F; -+ this.particleBlue = 1.0F; -+ } -+ // MCPatcher End - } else { - this.particleRed = 1.0F; - this.particleGreen = 0.0F; -@@ -20,36 +39,48 @@ - this.setParticleTextureIndex(113); - this.setSize(0.01F, 0.01F); - this.particleGravity = 0.06F; -- this.materialType = var8; -+ this.materialType = par8Material; - this.bobTimer = 40; - this.particleMaxAge = (int)(64.0D / (Math.random() * 0.8D + 0.2D)); - this.motionX = this.motionY = this.motionZ = 0.0D; - } - -- public int getBrightnessForRender(float var1) { -- return this.materialType == Material.water ? super.getBrightnessForRender(var1) : 257; -- } -- -- public float getBrightness(float var1) { -- return this.materialType == Material.water ? super.getBrightness(var1) : 1.0F; -- } -- -+ public int getBrightnessForRender(float par1) { -+ return this.materialType == Material.water ? super.getBrightnessForRender(par1) : 257; -+ } -+ -+ /** -+ * Gets how bright this entity is. -+ */ -+ public float getBrightness(float par1) { -+ return this.materialType == Material.water ? super.getBrightness(par1) : 1.0F; -+ } -+ -+ /** -+ * Called to update the entity's position/logic. -+ */ - public void onUpdate() { - this.prevPosX = this.posX; - this.prevPosY = this.posY; - this.prevPosZ = this.posZ; -- if(this.materialType == Material.water) { -- this.particleRed = 0.2F; -- this.particleGreen = 0.3F; -- this.particleBlue = 1.0F; -- } else { -- this.particleRed = 1.0F; -- this.particleGreen = 16.0F / (float)(40 - this.bobTimer + 16); -- this.particleBlue = 4.0F / (float)(40 - this.bobTimer + 8); -+ -+ // MCPatcher Start -+ if (this.materialType != Material.water) { -+ if (ColorizeEntity.computeLavaDropColor(40 - this.bobTimer)) { -+ this.particleRed = Colorizer.setColor[0]; -+ this.particleGreen = Colorizer.setColor[1]; -+ this.particleBlue = Colorizer.setColor[2]; -+ } else { -+ this.particleRed = 1.0F; -+ this.particleGreen = 16.0F / (float)(40 - this.bobTimer + 16); -+ this.particleBlue = 4.0F / (float)(40 - this.bobTimer + 8); -+ } -+ // MCPatcher End - } - - this.motionY -= (double)this.particleGravity; -- if(this.bobTimer-- > 0) { -+ -+ if (this.bobTimer-- > 0) { - this.motionX *= 0.02D; - this.motionY *= 0.02D; - this.motionZ *= 0.02D; -@@ -59,32 +90,34 @@ - } - - this.moveEntity(this.motionX, this.motionY, this.motionZ); -- this.motionX *= (double)0.98F; -- this.motionY *= (double)0.98F; -- this.motionZ *= (double)0.98F; -- if(this.particleMaxAge-- <= 0) { -+ this.motionX *= 0.9800000190734863D; -+ this.motionY *= 0.9800000190734863D; -+ this.motionZ *= 0.9800000190734863D; -+ -+ if (this.particleMaxAge-- <= 0) { - this.setDead(); - } - -- if(this.onGround) { -- if(this.materialType == Material.water) { -+ if (this.onGround) { -+ if (this.materialType == Material.water) { - this.setDead(); - this.worldObj.spawnParticle("splash", this.posX, this.posY, this.posZ, 0.0D, 0.0D, 0.0D); - } else { - this.setParticleTextureIndex(114); - } - -- this.motionX *= (double)0.7F; -- this.motionZ *= (double)0.7F; -+ this.motionX *= 0.699999988079071D; -+ this.motionZ *= 0.699999988079071D; - } - - Material var1 = this.worldObj.getBlockMaterial(MathHelper.floor_double(this.posX), MathHelper.floor_double(this.posY), MathHelper.floor_double(this.posZ)); -- if(var1.isLiquid() || var1.isSolid()) { -+ -+ if (var1.isLiquid() || var1.isSolid()) { - double var2 = (double)((float)(MathHelper.floor_double(this.posY) + 1) - BlockFluid.getFluidHeightPercent(this.worldObj.getBlockMetadata(MathHelper.floor_double(this.posX), MathHelper.floor_double(this.posY), MathHelper.floor_double(this.posZ)))); -- if(this.posY < var2) { -+ -+ if (this.posY < var2) { - this.setDead(); - } - } -- - } - } ---- net/minecraft/src/DispenserBehaviorSnowball.java -+++ net/minecraft/src/DispenserBehaviorSnowball.java -@@ -1,7 +1,11 @@ - package net.minecraft.src; - - final class DispenserBehaviorSnowball extends BehaviorProjectileDispense { -- protected IProjectile getProjectileEntity(World var1, IPosition var2) { -- return new EntitySnowball(var1, var2.getX(), var2.getY(), var2.getZ()); -+ -+ /** -+ * Return the projectile entity spawned by this dispense behavior. -+ */ -+ protected IProjectile getProjectileEntity(World par1World, IPosition par2IPosition) { -+ return new EntitySnowball(par1World, par2IPosition.getX(), par2IPosition.getY(), par2IPosition.getZ()); - } - } ---- net/minecraft/src/DerivedWorldInfo.java -+++ net/minecraft/src/DerivedWorldInfo.java -@@ -1,32 +1,52 @@ - package net.minecraft.src; - - public class DerivedWorldInfo extends WorldInfo { -+ -+ /** Instance of WorldInfo. */ - private final WorldInfo theWorldInfo; - -- public DerivedWorldInfo(WorldInfo var1) { -- this.theWorldInfo = var1; -+ public DerivedWorldInfo(WorldInfo par1WorldInfo) { -+ this.theWorldInfo = par1WorldInfo; - } - -+ /** -+ * Gets the NBTTagCompound for the worldInfo -+ */ - public NBTTagCompound getNBTTagCompound() { - return this.theWorldInfo.getNBTTagCompound(); - } - -- public NBTTagCompound cloneNBTCompound(NBTTagCompound var1) { -- return this.theWorldInfo.cloneNBTCompound(var1); -+ /** -+ * Creates a new NBTTagCompound for the world, with the given NBTTag as the "Player" -+ */ -+ public NBTTagCompound cloneNBTCompound(NBTTagCompound par1NBTTagCompound) { -+ return this.theWorldInfo.cloneNBTCompound(par1NBTTagCompound); - } - -+ /** -+ * Returns the seed of current world. -+ */ - public long getSeed() { - return this.theWorldInfo.getSeed(); - } - -+ /** -+ * Returns the x spawn position -+ */ - public int getSpawnX() { - return this.theWorldInfo.getSpawnX(); - } - -+ /** -+ * Return the Y axis spawning point of the player. -+ */ - public int getSpawnY() { - return this.theWorldInfo.getSpawnY(); - } - -+ /** -+ * Returns the z spawn position -+ */ - public int getSpawnZ() { - return this.theWorldInfo.getSpawnZ(); - } -@@ -35,6 +55,9 @@ - return this.theWorldInfo.getWorldTotalTime(); - } - -+ /** -+ * Get current world time -+ */ - public long getWorldTime() { - return this.theWorldInfo.getWorldTime(); - } -@@ -43,86 +66,141 @@ - return this.theWorldInfo.getSizeOnDisk(); - } - -+ /** -+ * Returns the player's NBTTagCompound to be loaded -+ */ - public NBTTagCompound getPlayerNBTTagCompound() { - return this.theWorldInfo.getPlayerNBTTagCompound(); - } - -- public int getDimension() { -- return this.theWorldInfo.getDimension(); -+ /** -+ * Returns vanilla MC dimension (-1,0,1). For custom dimension compatibility, always prefer WorldProvider.dimensionID -+ * accessed from World.provider.dimensionID -+ */ -+ public int getVanillaDimension() { -+ return this.theWorldInfo.getVanillaDimension(); - } - -+ /** -+ * Get current world name -+ */ - public String getWorldName() { - return this.theWorldInfo.getWorldName(); - } - -+ /** -+ * Returns the save version of this world -+ */ - public int getSaveVersion() { - return this.theWorldInfo.getSaveVersion(); - } - -+ /** -+ * Return the last time the player was in this world. -+ */ - public long getLastTimePlayed() { - return this.theWorldInfo.getLastTimePlayed(); - } - -+ /** -+ * Returns true if it is thundering, false otherwise. -+ */ - public boolean isThundering() { - return this.theWorldInfo.isThundering(); - } - -+ /** -+ * Returns the number of ticks until next thunderbolt. -+ */ - public int getThunderTime() { - return this.theWorldInfo.getThunderTime(); - } - -+ /** -+ * Returns true if it is raining, false otherwise. -+ */ - public boolean isRaining() { - return this.theWorldInfo.isRaining(); - } - -+ /** -+ * Return the number of ticks until rain. -+ */ - public int getRainTime() { - return this.theWorldInfo.getRainTime(); - } - -+ /** -+ * Gets the GameType. -+ */ - public EnumGameType getGameType() { - return this.theWorldInfo.getGameType(); - } - -- public void setSpawnX(int var1) { -- } -- -- public void setSpawnY(int var1) { -- } -- -- public void setSpawnZ(int var1) { -- } -- -- public void incrementTotalWorldTime(long var1) { -- } -- -- public void setWorldTime(long var1) { -- } -- -- public void setSpawnPosition(int var1, int var2, int var3) { -- } -- -- public void setWorldName(String var1) { -- } -- -- public void setSaveVersion(int var1) { -- } -- -- public void setThundering(boolean var1) { -- } -- -- public void setThunderTime(int var1) { -- } -- -- public void setRaining(boolean var1) { -- } -- -- public void setRainTime(int var1) { -- } -- -+ /** -+ * Set the x spawn position to the passed in value -+ */ -+ public void setSpawnX(int par1) {} -+ -+ /** -+ * Sets the y spawn position -+ */ -+ public void setSpawnY(int par1) {} -+ -+ /** -+ * Set the z spawn position to the passed in value -+ */ -+ public void setSpawnZ(int par1) {} -+ -+ public void incrementTotalWorldTime(long par1) {} -+ -+ /** -+ * Set current world time -+ */ -+ public void setWorldTime(long par1) {} -+ -+ /** -+ * Sets the spawn zone position. Args: x, y, z -+ */ -+ public void setSpawnPosition(int par1, int par2, int par3) {} -+ -+ public void setWorldName(String par1Str) {} -+ -+ /** -+ * Sets the save version of the world -+ */ -+ public void setSaveVersion(int par1) {} -+ -+ /** -+ * Sets whether it is thundering or not. -+ */ -+ public void setThundering(boolean par1) {} -+ -+ /** -+ * Defines the number of ticks until next thunderbolt. -+ */ -+ public void setThunderTime(int par1) {} -+ -+ /** -+ * Sets whether it is raining or not. -+ */ -+ public void setRaining(boolean par1) {} -+ -+ /** -+ * Sets the number of ticks until rain. -+ */ -+ public void setRainTime(int par1) {} -+ -+ /** -+ * Get whether the map features (e.g. strongholds) generation is enabled or disabled. -+ */ - public boolean isMapFeaturesEnabled() { - return this.theWorldInfo.isMapFeaturesEnabled(); - } - -+ /** -+ * Returns true if hardcore mode is enabled, otherwise false -+ */ - public boolean isHardcoreModeEnabled() { - return this.theWorldInfo.isHardcoreModeEnabled(); - } -@@ -131,20 +209,30 @@ - return this.theWorldInfo.getTerrainType(); - } - -- public void setTerrainType(WorldType var1) { -- } -+ public void setTerrainType(WorldType par1WorldType) {} - -+ /** -+ * Returns true if commands are allowed on this World. -+ */ - public boolean areCommandsAllowed() { - return this.theWorldInfo.areCommandsAllowed(); - } - -+ /** -+ * Returns true if the World is initialized. -+ */ - public boolean isInitialized() { - return this.theWorldInfo.isInitialized(); - } - -- public void setServerInitialized(boolean var1) { -- } -+ /** -+ * Sets the initialization status of the World. -+ */ -+ public void setServerInitialized(boolean par1) {} - -+ /** -+ * Gets the GameRules class Instance. -+ */ - public GameRules getGameRulesInstance() { - return this.theWorldInfo.getGameRulesInstance(); - } ---- /dev/null -+++ org/spoutcraft/api/material/block/Sapling.java -@@ -1,0 +1,40 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.api.material.block; -+ -+import org.spoutcraft.api.material.Plant; -+ -+public class Sapling extends GenericBlock implements Plant{ -+ public Sapling(String name, int data) { -+ super(name, 6, data); -+ } -+ -+ public boolean isHasGrowthStages() { -+ return true; -+ } -+ -+ public int getNumGrowthStages() { -+ return 3; -+ } -+ -+ public int getMinimumLightToGrow() { -+ return 8; -+ } -+} ---- net/minecraft/src/ItemFireworkCharge.java -+++ net/minecraft/src/ItemFireworkCharge.java -@@ -5,24 +5,29 @@ - public class ItemFireworkCharge extends Item { - private Icon theIcon; - -- public ItemFireworkCharge(int var1) { -- super(var1); -- } -- -- public Icon getIconFromDamageForRenderPass(int var1, int var2) { -- return var2 > 0 ? this.theIcon : super.getIconFromDamageForRenderPass(var1, var2); -- } -- -- public int getColorFromItemStack(ItemStack var1, int var2) { -- if(var2 != 1) { -- return super.getColorFromItemStack(var1, var2); -+ public ItemFireworkCharge(int par1) { -+ super(par1); -+ } -+ -+ /** -+ * Gets an icon index based on an item's damage value and the given render pass -+ */ -+ public Icon getIconFromDamageForRenderPass(int par1, int par2) { -+ return par2 > 0 ? this.theIcon : super.getIconFromDamageForRenderPass(par1, par2); -+ } -+ -+ public int getColorFromItemStack(ItemStack par1ItemStack, int par2) { -+ if (par2 != 1) { -+ return super.getColorFromItemStack(par1ItemStack, par2); - } else { -- NBTBase var3 = func_92108_a(var1, "Colors"); -- if(var3 == null) { -+ NBTBase var3 = func_92108_a(par1ItemStack, "Colors"); -+ -+ if (var3 == null) { - return 9079434; - } else { - NBTTagIntArray var4 = (NBTTagIntArray)var3; -- if(var4.intArray.length == 1) { -+ -+ if (var4.intArray.length == 1) { - return var4.intArray[0]; - } else { - int var5 = 0; -@@ -31,10 +36,10 @@ - int[] var8 = var4.intArray; - int var9 = var8.length; - -- for(int var10 = 0; var10 < var9; ++var10) { -+ for (int var10 = 0; var10 < var9; ++var10) { - int var11 = var8[var10]; - var5 += (var11 & 16711680) >> 16; -- var6 += (var11 & '\uff00') >> 8; -+ var6 += (var11 & 65280) >> 8; - var7 += (var11 & 255) >> 0; - } - -@@ -51,116 +56,126 @@ - return true; - } - -- public static NBTBase func_92108_a(ItemStack var0, String var1) { -- if(var0.hasTagCompound()) { -- NBTTagCompound var2 = var0.getTagCompound().getCompoundTag("Explosion"); -- if(var2 != null) { -- return var2.getTag(var1); -+ public static NBTBase func_92108_a(ItemStack par0ItemStack, String par1Str) { -+ if (par0ItemStack.hasTagCompound()) { -+ NBTTagCompound var2 = par0ItemStack.getTagCompound().getCompoundTag("Explosion"); -+ -+ if (var2 != null) { -+ return var2.getTag(par1Str); - } - } - - return null; - } - -- public void addInformation(ItemStack var1, EntityPlayer var2, List var3, boolean var4) { -- if(var1.hasTagCompound()) { -- NBTTagCompound var5 = var1.getTagCompound().getCompoundTag("Explosion"); -- if(var5 != null) { -- func_92107_a(var5, var3); -+ /** -+ * allows items to add custom lines of information to the mouseover description -+ */ -+ public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4) { -+ if (par1ItemStack.hasTagCompound()) { -+ NBTTagCompound var5 = par1ItemStack.getTagCompound().getCompoundTag("Explosion"); -+ -+ if (var5 != null) { -+ func_92107_a(var5, par3List); - } - } -- - } - -- public static void func_92107_a(NBTTagCompound var0, List var1) { -- byte var2 = var0.getByte("Type"); -- if(var2 >= 0 && var2 <= 4) { -- var1.add(StatCollector.translateToLocal("item.fireworksCharge.type." + var2).trim()); -+ public static void func_92107_a(NBTTagCompound par0NBTTagCompound, List par1List) { -+ byte var2 = par0NBTTagCompound.getByte("Type"); -+ -+ if (var2 >= 0 && var2 <= 4) { -+ par1List.add(StatCollector.translateToLocal("item.fireworksCharge.type." + var2).trim()); - } else { -- var1.add(StatCollector.translateToLocal("item.fireworksCharge.type").trim()); -+ par1List.add(StatCollector.translateToLocal("item.fireworksCharge.type").trim()); - } - -- int[] var3 = var0.getIntArray("Colors"); -+ int[] var3 = par0NBTTagCompound.getIntArray("Colors"); - int var8; - int var9; -- if(var3.length > 0) { -+ -+ if (var3.length > 0) { - boolean var4 = true; - String var5 = ""; - int[] var6 = var3; - int var7 = var3.length; - -- for(var8 = 0; var8 < var7; ++var8) { -+ for (var8 = 0; var8 < var7; ++var8) { - var9 = var6[var8]; -- if(!var4) { -+ -+ if (!var4) { - var5 = var5 + ", "; - } - - var4 = false; - boolean var10 = false; - -- for(int var11 = 0; var11 < 16; ++var11) { -- if(var9 == ItemDye.dyeColors[var11]) { -+ for (int var11 = 0; var11 < 16; ++var11) { -+ if (var9 == ItemDye.dyeColors[var11]) { - var10 = true; -- var5 = var5 + StatCollector.translateToLocal("item.fireworksCharge." + ItemDye.a[var11]); -+ var5 = var5 + StatCollector.translateToLocal("item.fireworksCharge." + ItemDye.dyeColorNames[var11]); - break; - } - } - -- if(!var10) { -+ if (!var10) { - var5 = var5 + StatCollector.translateToLocal("item.fireworksCharge.customColor"); - } - } - -- var1.add(var5); -+ par1List.add(var5); - } - -- int[] var13 = var0.getIntArray("FadeColors"); -+ int[] var13 = par0NBTTagCompound.getIntArray("FadeColors"); - boolean var15; -- if(var13.length > 0) { -+ -+ if (var13.length > 0) { - var15 = true; - String var14 = StatCollector.translateToLocal("item.fireworksCharge.fadeTo") + " "; - int[] var16 = var13; - var8 = var13.length; - -- for(var9 = 0; var9 < var8; ++var9) { -+ for (var9 = 0; var9 < var8; ++var9) { - int var18 = var16[var9]; -- if(!var15) { -+ -+ if (!var15) { - var14 = var14 + ", "; - } - - var15 = false; - boolean var19 = false; - -- for(int var12 = 0; var12 < 16; ++var12) { -- if(var18 == ItemDye.dyeColors[var12]) { -+ for (int var12 = 0; var12 < 16; ++var12) { -+ if (var18 == ItemDye.dyeColors[var12]) { - var19 = true; -- var14 = var14 + StatCollector.translateToLocal("item.fireworksCharge." + ItemDye.a[var12]); -+ var14 = var14 + StatCollector.translateToLocal("item.fireworksCharge." + ItemDye.dyeColorNames[var12]); - break; - } - } - -- if(!var19) { -+ if (!var19) { - var14 = var14 + StatCollector.translateToLocal("item.fireworksCharge.customColor"); - } - } - -- var1.add(var14); -- } -- -- var15 = var0.getBoolean("Trail"); -- if(var15) { -- var1.add(StatCollector.translateToLocal("item.fireworksCharge.trail")); -- } -- -- boolean var17 = var0.getBoolean("Flicker"); -- if(var17) { -- var1.add(StatCollector.translateToLocal("item.fireworksCharge.flicker")); -- } -- -+ par1List.add(var14); -+ } -+ -+ var15 = par0NBTTagCompound.getBoolean("Trail"); -+ -+ if (var15) { -+ par1List.add(StatCollector.translateToLocal("item.fireworksCharge.trail")); -+ } -+ -+ boolean var17 = par0NBTTagCompound.getBoolean("Flicker"); -+ -+ if (var17) { -+ par1List.add(StatCollector.translateToLocal("item.fireworksCharge.flicker")); -+ } - } - -- public void registerIcons(IconRegister var1) { -- super.registerIcons(var1); -- this.theIcon = var1.registerIcon(this.getIconString() + "_overlay"); -+ public void registerIcons(IconRegister par1IconRegister) { -+ super.registerIcons(par1IconRegister); -+ this.theIcon = par1IconRegister.registerIcon(this.getIconString() + "_overlay"); - } - } ---- /dev/null -+++ org/spoutcraft/api/gui/Control.java -@@ -1,0 +1,88 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.api.gui; -+ -+import org.spoutcraft.api.UnsafeClass; -+ -+@UnsafeClass -+public interface Control extends Widget { -+ /** -+ * True if the control is enabled and can receive input -+ * -+ * @return enabled -+ */ -+ public boolean isEnabled(); -+ -+ /** -+ * Disables input to the control, but still allows it to be visible -+ * -+ * @param enable -+ * @return Control -+ */ -+ public Control setEnabled(boolean enable); -+ -+ /** -+ * Gets the color of this control -+ * -+ * @return color -+ */ -+ public Color getColor(); -+ -+ /** -+ * Sets the color of this control -+ * -+ * @param color to set -+ * @return Control -+ */ -+ public Control setColor(Color color); -+ -+ /** -+ * Gets the color of this control when it is disabled -+ * -+ * @return disabled color -+ */ -+ public Color getDisabledColor(); -+ -+ /** -+ * Sets the color of this control when it is disabled -+ * -+ * @param color to set -+ * @return Control -+ */ -+ public Control setDisabledColor(Color color); -+ -+ public boolean isFocus(); -+ -+ public Control setFocus(boolean focus); -+ -+ /** -+ * Will be called if this control has focus and a key was pressed. -+ * @param key the pressed key. -+ * @return true if you handled the keypress and it shouldn't be handled elsewhere. -+ */ -+ public boolean onKeyPressed(Keyboard key); -+ -+ /** -+ * Will be called if this control has focus and a key was released. -+ * @param key the released key. -+ * @return true if you handled the keyrelease and it shouldn't be handled elsewhere. -+ */ -+ public boolean onKeyReleased(Keyboard key); -+} ---- /dev/null -+++ org/spoutcraft/client/gui/settings/controls/FlightSpeedSlider.java -@@ -1,0 +1,49 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.client.gui.settings.controls; -+ -+import org.spoutcraft.api.gui.GenericSlider; -+import org.spoutcraft.client.SpoutClient; -+import org.spoutcraft.client.config.Configuration; -+ -+public class FlightSpeedSlider extends GenericSlider { -+ public FlightSpeedSlider() { -+ super("Flight Speed"); -+ setEnabled(SpoutClient.getInstance().isFlySpeedCheat()); -+ if (SpoutClient.getInstance().isFlySpeedCheat()) { -+ this.setSliderPosition(Configuration.getFlightSpeedFactor() / 10); -+ } else { -+ this.setSliderPosition(1.0F / 10); -+ } -+ setTooltip("Flight Speed Multiplier\nAlters how fast you fly in creative. 1X is vanilla speed."); -+ } -+ -+ @Override -+ public String getText() { -+ double pos = this.getSliderPosition() * 10; -+ return "Flight Speed: " + (Math.round(pos * 100D) / 100D) + "X"; -+ } -+ -+ @Override -+ public void onSliderDrag(float old, float newPos) { -+ Configuration.setFlightSpeedFactor(newPos * 10); -+ Configuration.write(); -+ } -+} ---- net/minecraft/src/RenderMooshroom.java -+++ net/minecraft/src/RenderMooshroom.java -@@ -1,64 +1,98 @@ - package net.minecraft.src; - -+// MCPatcher Start -+ - import org.lwjgl.opengl.GL11; - -+import com.prupe.mcpatcher.mob.MobOverlay; -+ -+// MCPatcher End -+ - public class RenderMooshroom extends RenderLiving { - private static final ResourceLocation mooshroomTextures = new ResourceLocation("textures/entity/cow/mooshroom.png"); -- -- public RenderMooshroom(ModelBase var1, float var2) { -- super(var1, var2); -- } -- -- public void renderLivingMooshroom(EntityMooshroom var1, double var2, double var4, double var6, float var8, float var9) { -- super.doRenderLiving(var1, var2, var4, var6, var8, var9); -- } -- -- protected ResourceLocation getMooshroomTextures(EntityMooshroom var1) { -+ public RenderMooshroom(ModelBase par1ModelBase, float par2) { -+ super(par1ModelBase, par2); -+ } -+ -+ public void renderLivingMooshroom(EntityMooshroom par1EntityMooshroom, double par2, double par4, double par6, float par8, float par9) { -+ super.doRenderLiving(par1EntityMooshroom, par2, par4, par6, par8, par9); -+ } -+ -+ protected ResourceLocation getMooshroomTextures(EntityMooshroom par1EntityMooshroom) { - return mooshroomTextures; - } -+ -+ protected void renderMooshroomEquippedItems(EntityMooshroom par1EntityMooshroom, float par2) { -+ super.renderEquippedItems(par1EntityMooshroom, par2); - -- protected void renderMooshroomEquippedItems(EntityMooshroom var1, float var2) { -- super.renderEquippedItems(var1, var2); -- if(!var1.isChild()) { -- this.bindTexture(TextureMap.locationBlocksTexture); -+ // MCPatcher Start -+ if (par1EntityMooshroom.isChild()) { -+ MobOverlay.finishMooshroom(); -+ } else { -+ this.bindTexture(MobOverlay.setupMooshroom(par1EntityMooshroom, TextureMap.locationBlocksTexture)); -+ // MCPatcher End - GL11.glEnable(GL11.GL_CULL_FACE); - GL11.glPushMatrix(); - GL11.glScalef(1.0F, -1.0F, 1.0F); - GL11.glTranslatef(0.2F, 0.4F, 0.5F); - GL11.glRotatef(42.0F, 0.0F, 1.0F, 0.0F); -- this.renderBlocks.renderBlockAsItem(Block.mushroomRed, 0, 1.0F); -+ // MCPatcher Start -+ if (!MobOverlay.renderMooshroomOverlay()) { -+ this.renderBlocks.renderBlockAsItem(Block.mushroomRed, 0, 1.0F); -+ } -+ // MCPatcher End - GL11.glTranslatef(0.1F, 0.0F, -0.6F); - GL11.glRotatef(42.0F, 0.0F, 1.0F, 0.0F); -- this.renderBlocks.renderBlockAsItem(Block.mushroomRed, 0, 1.0F); -+ // MCPatcher Start -+ if (!MobOverlay.renderMooshroomOverlay()) { -+ this.renderBlocks.renderBlockAsItem(Block.mushroomRed, 0, 1.0F); -+ } -+ // MCPatcher End - GL11.glPopMatrix(); - GL11.glPushMatrix(); -- ((ModelQuadruped)this.mainModel).head.postRender(1.0F / 16.0F); -+ ((ModelQuadruped)this.mainModel).head.postRender(0.0625F); - GL11.glScalef(1.0F, -1.0F, 1.0F); -- GL11.glTranslatef(0.0F, 12.0F / 16.0F, -0.2F); -+ GL11.glTranslatef(0.0F, 0.75F, -0.2F); - GL11.glRotatef(12.0F, 0.0F, 1.0F, 0.0F); -- this.renderBlocks.renderBlockAsItem(Block.mushroomRed, 0, 1.0F); -+ // MCPatcher Start -+ if (!MobOverlay.renderMooshroomOverlay()) { -+ this.renderBlocks.renderBlockAsItem(Block.mushroomRed, 0, 1.0F); -+ } -+ // MCPatcher End - GL11.glPopMatrix(); - GL11.glDisable(GL11.GL_CULL_FACE); -+ // MCPatcher Start -+ MobOverlay.finishMooshroom(); -+ // MCPatcher End - } - } - -- public void doRenderLiving(EntityLiving var1, double var2, double var4, double var6, float var8, float var9) { -- this.renderLivingMooshroom((EntityMooshroom)var1, var2, var4, var6, var8, var9); -- } -- -- protected void renderEquippedItems(EntityLivingBase var1, float var2) { -- this.renderMooshroomEquippedItems((EntityMooshroom)var1, var2); -- } -- -- public void renderPlayer(EntityLivingBase var1, double var2, double var4, double var6, float var8, float var9) { -- this.renderLivingMooshroom((EntityMooshroom)var1, var2, var4, var6, var8, var9); -- } -- -- protected ResourceLocation getEntityTexture(Entity var1) { -- return this.getMooshroomTextures((EntityMooshroom)var1); -- } -- -- public void doRender(Entity var1, double var2, double var4, double var6, float var8, float var9) { -- this.renderLivingMooshroom((EntityMooshroom)var1, var2, var4, var6, var8, var9); -+ public void doRenderLiving(EntityLiving par1EntityLiving, double par2, double par4, double par6, float par8, float par9) { -+ this.renderLivingMooshroom((EntityMooshroom)par1EntityLiving, par2, par4, par6, par8, par9); -+ } -+ -+ protected void renderEquippedItems(EntityLivingBase par1EntityLivingBase, float par2) { -+ this.renderMooshroomEquippedItems((EntityMooshroom)par1EntityLivingBase, par2); -+ } -+ -+ public void renderPlayer(EntityLivingBase par1EntityLivingBase, double par2, double par4, double par6, float par8, float par9) { -+ this.renderLivingMooshroom((EntityMooshroom)par1EntityLivingBase, par2, par4, par6, par8, par9); -+ } -+ -+ /** -+ * Returns the location of an entity's texture. Doesn't seem to be called unless you call Render.bindEntityTexture. -+ */ -+ protected ResourceLocation getEntityTexture(Entity par1Entity) { -+ return this.getMooshroomTextures((EntityMooshroom)par1Entity); -+ } -+ -+ /** -+ * Actually renders the given argument. This is a synthetic bridge method, always casting down its argument and then -+ * handing it off to a worker function which does the actual work. In all probabilty, the class Render is generic -+ * (Render queue = new LinkedList(); -+ public long packetQueueTime = 0L; -+ public boolean queued = false; -+ // Spout End -+ -+ public NetClientHandler(Minecraft par1Minecraft, String par2Str, int par3) throws IOException { -+ this(par1Minecraft, par2Str, par3, null); //Spout -+ } -+ -+ public NetClientHandler(Minecraft par1Minecraft, String par2Str, int par3, GuiScreen par4GuiScreen) throws IOException { -+ this.mc = par1Minecraft; -+ this.field_98183_l = par4GuiScreen; -+ // Spout Start -+ InetSocketAddress address = NetworkUtils.resolve(par2Str, par3); -+ if (address.isUnresolved()) { -+ throw new UnknownHostException(address.getHostName()); -+ } -+ this.netManager = new TcpConnection(par1Minecraft.getLogAgent(), new Socket(address.getAddress(), address.getPort()), "Client", this); -+ -+ org.spoutcraft.client.gui.error.GuiConnectionLost.lastServerIp = par2Str; -+ org.spoutcraft.client.gui.error.GuiConnectionLost.lastServerPort = par3; -+ -+ ClientPlayer.getInstance().resetMainScreen(); -+ SpoutClient.getInstance().setSpoutActive(false); -+ // Spout End -+ } -+ -+ public NetClientHandler(Minecraft par1Minecraft, IntegratedServer par2IntegratedServer) throws IOException { -+ this.mc = par1Minecraft; -+ this.netManager = new MemoryConnection(par1Minecraft.getLogAgent(), this); -+ par2IntegratedServer.getServerListeningThread().func_71754_a((MemoryConnection)this.netManager, par1Minecraft.getSession().getUsername()); -+ } -+ -+ /** -+ * sets netManager and worldClient to null -+ */ - public void cleanup() { -- if(this.netManager != null) { -+ if (this.netManager != null) { - this.netManager.wakeThreads(); - } - - this.netManager = null; - this.worldClient = null; -+ -+ // Spout Start -+ ClientPlayer.getInstance().resetMainScreen(); -+ SpoutClient.getInstance().setSpoutActive(false); -+ // Spout End - } - -+ /** -+ * Processes the packets that have been read since the last call to this function. -+ */ - public void processReadPackets() { -- if(!this.disconnected && this.netManager != null) { -+ if (!this.disconnected && this.netManager != null) { - this.netManager.processReadPackets(); - } - -- if(this.netManager != null) { -+ if (this.netManager != null) { - this.netManager.wakeThreads(); - } -- - } - -- public void handleServerAuthData(Packet253ServerAuthData var1) { -- String var2 = var1.getServerId().trim(); -- PublicKey var3 = var1.getPublicKey(); -+ public void handleServerAuthData(Packet253ServerAuthData par1Packet253ServerAuthData) { -+ String var2 = par1Packet253ServerAuthData.getServerId().trim(); -+ PublicKey var3 = par1Packet253ServerAuthData.getPublicKey(); - SecretKey var4 = CryptManager.createNewSharedKey(); -- if(!"-".equals(var2)) { -+ -+ if (!"-".equals(var2)) { - String var5 = (new BigInteger(CryptManager.getServerIdHash(var2, var3, var4))).toString(16); - String var6 = this.sendSessionRequest(this.mc.getSession().getUsername(), this.mc.getSession().getSessionID(), var5); -- if(!"ok".equalsIgnoreCase(var6)) { -- this.netManager.networkShutdown("disconnect.loginFailedInfo", new Object[]{var6}); -+ -+ if (!"ok".equalsIgnoreCase(var6)) { -+ this.netManager.networkShutdown("disconnect.loginFailedInfo", new Object[] {var6}); - return; - } - } - -- this.addToSendQueue(new Packet252SharedKey(var4, var3, var1.getVerifyToken())); -+ this.addToSendQueue(new Packet252SharedKey(var4, var3, par1Packet253ServerAuthData.getVerifyToken())); - } - -- private String sendSessionRequest(String var1, String var2, String var3) { -+ /** -+ * Send request to http://session.minecraft.net with user's sessionId and serverId hash -+ */ -+ private String sendSessionRequest(String par1Str, String par2Str, String par3Str) { - try { -- URL var4 = new URL("http://session.minecraft.net/game/joinserver.jsp?user=" + urlEncode(var1) + "&sessionId=" + urlEncode(var2) + "&serverId=" + urlEncode(var3)); -+ URL var4 = new URL("http://session.minecraft.net/game/joinserver.jsp?user=" + urlEncode(par1Str) + "&sessionId=" + urlEncode(par2Str) + "&serverId=" + urlEncode(par3Str)); - InputStream var5 = var4.openConnection(this.mc.getProxy()).getInputStream(); - BufferedReader var6 = new BufferedReader(new InputStreamReader(var5)); - String var7 = var6.readLine(); -@@ -105,295 +170,336 @@ - } - } - -- private static String urlEncode(String var0) throws IOException { -- return URLEncoder.encode(var0, "UTF-8"); -+ /** -+ * Encode the given string for insertion into a URL -+ */ -+ private static String urlEncode(String par0Str) throws IOException { -+ return URLEncoder.encode(par0Str, "UTF-8"); - } - -- public void handleSharedKey(Packet252SharedKey var1) { -+ public void handleSharedKey(Packet252SharedKey par1Packet252SharedKey) { - this.addToSendQueue(new Packet205ClientCommand(0)); - } - -- public void handleLogin(Packet1Login var1) { -+ public void handleLogin(Packet1Login par1Packet1Login) { - this.mc.playerController = new PlayerControllerMP(this.mc, this); - this.mc.statFileWriter.readStat(StatList.joinMultiplayerStat, 1); -- this.worldClient = new WorldClient(this, new WorldSettings(0L, var1.gameType, false, var1.hardcoreMode, var1.terrainType), var1.dimension, var1.difficultySetting, this.mc.mcProfiler, this.mc.getLogAgent()); -+ this.worldClient = new WorldClient(this, new WorldSettings(0L, par1Packet1Login.gameType, false, par1Packet1Login.hardcoreMode, par1Packet1Login.terrainType), par1Packet1Login.dimension, par1Packet1Login.difficultySetting, this.mc.mcProfiler, this.mc.getLogAgent()); - this.worldClient.isRemote = true; - this.mc.loadWorld(this.worldClient); -- this.mc.thePlayer.dimension = var1.dimension; -- this.mc.displayGuiScreen(new GuiDownloadTerrain(this)); -- this.mc.thePlayer.entityId = var1.clientEntityId; -- this.currentServerMaxPlayers = var1.maxPlayers; -- this.mc.playerController.setGameType(var1.gameType); -+ this.mc.thePlayer.dimension = par1Packet1Login.dimension; -+ // Spout Start -+ if (!(this.mc.currentScreen instanceof GuiPrecache)) { -+ this.mc.displayGuiScreen(new GuiDownloadTerrain(this)); -+ } -+ //this.mc.displayGuiScreen(new org.spoutcraft.client.gui.precache.GuiPrecache()); -+ System.out.println("Starting cache manager... " + System.currentTimeMillis()); -+ // Spout End -+ this.mc.thePlayer.entityId = par1Packet1Login.clientEntityId; -+ this.currentServerMaxPlayers = par1Packet1Login.maxPlayers; -+ this.mc.playerController.setGameType(par1Packet1Login.gameType); - this.mc.gameSettings.sendSettingsToServer(); - this.netManager.addToSendQueue(new Packet250CustomPayload("MC|Brand", ClientBrandRetriever.getClientModName().getBytes(Charsets.UTF_8))); - } - -- public void handleVehicleSpawn(Packet23VehicleSpawn var1) { -- double var2 = (double)var1.xPosition / 32.0D; -- double var4 = (double)var1.yPosition / 32.0D; -- double var6 = (double)var1.zPosition / 32.0D; -+ public void handleVehicleSpawn(Packet23VehicleSpawn par1Packet23VehicleSpawn) { -+ double var2 = (double)par1Packet23VehicleSpawn.xPosition / 32.0D; -+ double var4 = (double)par1Packet23VehicleSpawn.yPosition / 32.0D; -+ double var6 = (double)par1Packet23VehicleSpawn.zPosition / 32.0D; - Object var8 = null; -- if(var1.type == 10) { -- var8 = EntityMinecart.createMinecart(this.worldClient, var2, var4, var6, var1.throwerEntityId); -- } else if(var1.type == 90) { -- Entity var9 = this.getEntityByID(var1.throwerEntityId); -- if(var9 instanceof EntityPlayer) { -+ -+ if (par1Packet23VehicleSpawn.type == 10) { -+ var8 = EntityMinecart.createMinecart(this.worldClient, var2, var4, var6, par1Packet23VehicleSpawn.throwerEntityId); -+ } else if (par1Packet23VehicleSpawn.type == 90) { -+ Entity var9 = this.getEntityByID(par1Packet23VehicleSpawn.throwerEntityId); -+ -+ if (var9 instanceof EntityPlayer) { - var8 = new EntityFishHook(this.worldClient, var2, var4, var6, (EntityPlayer)var9); - } - -- var1.throwerEntityId = 0; -- } else if(var1.type == 60) { -+ par1Packet23VehicleSpawn.throwerEntityId = 0; -+ } else if (par1Packet23VehicleSpawn.type == 60) { - var8 = new EntityArrow(this.worldClient, var2, var4, var6); -- } else if(var1.type == 61) { -+ } else if (par1Packet23VehicleSpawn.type == 61) { - var8 = new EntitySnowball(this.worldClient, var2, var4, var6); -- } else if(var1.type == 71) { -- var8 = new EntityItemFrame(this.worldClient, (int)var2, (int)var4, (int)var6, var1.throwerEntityId); -- var1.throwerEntityId = 0; -- } else if(var1.type == 77) { -+ } else if (par1Packet23VehicleSpawn.type == 71) { -+ var8 = new EntityItemFrame(this.worldClient, (int)var2, (int)var4, (int)var6, par1Packet23VehicleSpawn.throwerEntityId); -+ par1Packet23VehicleSpawn.throwerEntityId = 0; -+ } else if (par1Packet23VehicleSpawn.type == 77) { - var8 = new EntityLeashKnot(this.worldClient, (int)var2, (int)var4, (int)var6); -- var1.throwerEntityId = 0; -- } else if(var1.type == 65) { -+ par1Packet23VehicleSpawn.throwerEntityId = 0; -+ } else if (par1Packet23VehicleSpawn.type == 65) { - var8 = new EntityEnderPearl(this.worldClient, var2, var4, var6); -- } else if(var1.type == 72) { -+ } else if (par1Packet23VehicleSpawn.type == 72) { - var8 = new EntityEnderEye(this.worldClient, var2, var4, var6); -- } else if(var1.type == 76) { -+ } else if (par1Packet23VehicleSpawn.type == 76) { - var8 = new EntityFireworkRocket(this.worldClient, var2, var4, var6, (ItemStack)null); -- } else if(var1.type == 63) { -- var8 = new EntityLargeFireball(this.worldClient, var2, var4, var6, (double)var1.speedX / 8000.0D, (double)var1.speedY / 8000.0D, (double)var1.speedZ / 8000.0D); -- var1.throwerEntityId = 0; -- } else if(var1.type == 64) { -- var8 = new EntitySmallFireball(this.worldClient, var2, var4, var6, (double)var1.speedX / 8000.0D, (double)var1.speedY / 8000.0D, (double)var1.speedZ / 8000.0D); -- var1.throwerEntityId = 0; -- } else if(var1.type == 66) { -- var8 = new EntityWitherSkull(this.worldClient, var2, var4, var6, (double)var1.speedX / 8000.0D, (double)var1.speedY / 8000.0D, (double)var1.speedZ / 8000.0D); -- var1.throwerEntityId = 0; -- } else if(var1.type == 62) { -+ } else if (par1Packet23VehicleSpawn.type == 63) { -+ var8 = new EntityLargeFireball(this.worldClient, var2, var4, var6, (double)par1Packet23VehicleSpawn.speedX / 8000.0D, (double)par1Packet23VehicleSpawn.speedY / 8000.0D, (double)par1Packet23VehicleSpawn.speedZ / 8000.0D); -+ par1Packet23VehicleSpawn.throwerEntityId = 0; -+ } else if (par1Packet23VehicleSpawn.type == 64) { -+ var8 = new EntitySmallFireball(this.worldClient, var2, var4, var6, (double)par1Packet23VehicleSpawn.speedX / 8000.0D, (double)par1Packet23VehicleSpawn.speedY / 8000.0D, (double)par1Packet23VehicleSpawn.speedZ / 8000.0D); -+ par1Packet23VehicleSpawn.throwerEntityId = 0; -+ } else if (par1Packet23VehicleSpawn.type == 66) { -+ var8 = new EntityWitherSkull(this.worldClient, var2, var4, var6, (double)par1Packet23VehicleSpawn.speedX / 8000.0D, (double)par1Packet23VehicleSpawn.speedY / 8000.0D, (double)par1Packet23VehicleSpawn.speedZ / 8000.0D); -+ par1Packet23VehicleSpawn.throwerEntityId = 0; -+ } else if (par1Packet23VehicleSpawn.type == 62) { - var8 = new EntityEgg(this.worldClient, var2, var4, var6); -- } else if(var1.type == 73) { -- var8 = new EntityPotion(this.worldClient, var2, var4, var6, var1.throwerEntityId); -- var1.throwerEntityId = 0; -- } else if(var1.type == 75) { -+ } else if (par1Packet23VehicleSpawn.type == 73) { -+ var8 = new EntityPotion(this.worldClient, var2, var4, var6, par1Packet23VehicleSpawn.throwerEntityId); -+ par1Packet23VehicleSpawn.throwerEntityId = 0; -+ } else if (par1Packet23VehicleSpawn.type == 75) { - var8 = new EntityExpBottle(this.worldClient, var2, var4, var6); -- var1.throwerEntityId = 0; -- } else if(var1.type == 1) { -+ par1Packet23VehicleSpawn.throwerEntityId = 0; -+ } else if (par1Packet23VehicleSpawn.type == 1) { - var8 = new EntityBoat(this.worldClient, var2, var4, var6); -- } else if(var1.type == 50) { -+ } else if (par1Packet23VehicleSpawn.type == 50) { - var8 = new EntityTNTPrimed(this.worldClient, var2, var4, var6, (EntityLivingBase)null); -- } else if(var1.type == 51) { -+ } else if (par1Packet23VehicleSpawn.type == 51) { - var8 = new EntityEnderCrystal(this.worldClient, var2, var4, var6); -- } else if(var1.type == 2) { -+ } else if (par1Packet23VehicleSpawn.type == 2) { - var8 = new EntityItem(this.worldClient, var2, var4, var6); -- } else if(var1.type == 70) { -- var8 = new EntityFallingSand(this.worldClient, var2, var4, var6, var1.throwerEntityId & '\uffff', var1.throwerEntityId >> 16); -- var1.throwerEntityId = 0; -+ } else if (par1Packet23VehicleSpawn.type == 70) { -+ var8 = new EntityFallingSand(this.worldClient, var2, var4, var6, par1Packet23VehicleSpawn.throwerEntityId & 65535, par1Packet23VehicleSpawn.throwerEntityId >> 16); -+ par1Packet23VehicleSpawn.throwerEntityId = 0; - } - -- if(var8 != null) { -- ((Entity)var8).serverPosX = var1.xPosition; -- ((Entity)var8).serverPosY = var1.yPosition; -- ((Entity)var8).serverPosZ = var1.zPosition; -- ((Entity)var8).rotationPitch = (float)(var1.pitch * 360) / 256.0F; -- ((Entity)var8).rotationYaw = (float)(var1.yaw * 360) / 256.0F; -+ if (var8 != null) { -+ ((Entity)var8).serverPosX = par1Packet23VehicleSpawn.xPosition; -+ ((Entity)var8).serverPosY = par1Packet23VehicleSpawn.yPosition; -+ ((Entity)var8).serverPosZ = par1Packet23VehicleSpawn.zPosition; -+ ((Entity)var8).rotationPitch = (float)(par1Packet23VehicleSpawn.pitch * 360) / 256.0F; -+ ((Entity)var8).rotationYaw = (float)(par1Packet23VehicleSpawn.yaw * 360) / 256.0F; - Entity[] var12 = ((Entity)var8).getParts(); -- if(var12 != null) { -- int var10 = var1.entityId - ((Entity)var8).entityId; -- -- for(int var11 = 0; var11 < var12.length; ++var11) { -+ -+ if (var12 != null) { -+ int var10 = par1Packet23VehicleSpawn.entityId - ((Entity)var8).entityId; -+ -+ for (int var11 = 0; var11 < var12.length; ++var11) { - var12[var11].entityId += var10; - } - } - -- ((Entity)var8).entityId = var1.entityId; -- this.worldClient.addEntityToWorld(var1.entityId, (Entity)var8); -- if(var1.throwerEntityId > 0) { -- if(var1.type == 60) { -- Entity var13 = this.getEntityByID(var1.throwerEntityId); -- if(var13 instanceof EntityLivingBase) { -+ ((Entity)var8).entityId = par1Packet23VehicleSpawn.entityId; -+ this.worldClient.addEntityToWorld(par1Packet23VehicleSpawn.entityId, (Entity)var8); -+ -+ if (par1Packet23VehicleSpawn.throwerEntityId > 0) { -+ if (par1Packet23VehicleSpawn.type == 60) { -+ Entity var13 = this.getEntityByID(par1Packet23VehicleSpawn.throwerEntityId); -+ -+ if (var13 instanceof EntityLivingBase) { - EntityArrow var14 = (EntityArrow)var8; - var14.shootingEntity = var13; - } - } - -- ((Entity)var8).setVelocity((double)var1.speedX / 8000.0D, (double)var1.speedY / 8000.0D, (double)var1.speedZ / 8000.0D); -+ ((Entity)var8).setVelocity((double)par1Packet23VehicleSpawn.speedX / 8000.0D, (double)par1Packet23VehicleSpawn.speedY / 8000.0D, (double)par1Packet23VehicleSpawn.speedZ / 8000.0D); - } - } -- - } - -- public void handleEntityExpOrb(Packet26EntityExpOrb var1) { -- EntityXPOrb var2 = new EntityXPOrb(this.worldClient, (double)var1.posX, (double)var1.posY, (double)var1.posZ, var1.xpValue); -- var2.serverPosX = var1.posX; -- var2.serverPosY = var1.posY; -- var2.serverPosZ = var1.posZ; -+ /** -+ * Handle a entity experience orb packet. -+ */ -+ public void handleEntityExpOrb(Packet26EntityExpOrb par1Packet26EntityExpOrb) { -+ EntityXPOrb var2 = new EntityXPOrb(this.worldClient, (double)par1Packet26EntityExpOrb.posX, (double)par1Packet26EntityExpOrb.posY, (double)par1Packet26EntityExpOrb.posZ, par1Packet26EntityExpOrb.xpValue); -+ var2.serverPosX = par1Packet26EntityExpOrb.posX; -+ var2.serverPosY = par1Packet26EntityExpOrb.posY; -+ var2.serverPosZ = par1Packet26EntityExpOrb.posZ; - var2.rotationYaw = 0.0F; - var2.rotationPitch = 0.0F; -- var2.entityId = var1.entityId; -- this.worldClient.addEntityToWorld(var1.entityId, var2); -+ var2.entityId = par1Packet26EntityExpOrb.entityId; -+ this.worldClient.addEntityToWorld(par1Packet26EntityExpOrb.entityId, var2); - } - -- public void handleWeather(Packet71Weather var1) { -- double var2 = (double)var1.posX / 32.0D; -- double var4 = (double)var1.posY / 32.0D; -- double var6 = (double)var1.posZ / 32.0D; -+ /** -+ * Handles weather packet -+ */ -+ public void handleWeather(Packet71Weather par1Packet71Weather) { -+ double var2 = (double)par1Packet71Weather.posX / 32.0D; -+ double var4 = (double)par1Packet71Weather.posY / 32.0D; -+ double var6 = (double)par1Packet71Weather.posZ / 32.0D; - EntityLightningBolt var8 = null; -- if(var1.isLightningBolt == 1) { -+ -+ if (par1Packet71Weather.isLightningBolt == 1) { - var8 = new EntityLightningBolt(this.worldClient, var2, var4, var6); - } - -- if(var8 != null) { -- var8.serverPosX = var1.posX; -- var8.serverPosY = var1.posY; -- var8.serverPosZ = var1.posZ; -+ if (var8 != null) { -+ var8.serverPosX = par1Packet71Weather.posX; -+ var8.serverPosY = par1Packet71Weather.posY; -+ var8.serverPosZ = par1Packet71Weather.posZ; - var8.rotationYaw = 0.0F; - var8.rotationPitch = 0.0F; -- var8.entityId = var1.entityID; -+ var8.entityId = par1Packet71Weather.entityID; - this.worldClient.addWeatherEffect(var8); - } -- -- } -- -- public void handleEntityPainting(Packet25EntityPainting var1) { -- EntityPainting var2 = new EntityPainting(this.worldClient, var1.xPosition, var1.yPosition, var1.zPosition, var1.direction, var1.f); -- this.worldClient.addEntityToWorld(var1.entityId, var2); -- } -- -- public void handleEntityVelocity(Packet28EntityVelocity var1) { -- Entity var2 = this.getEntityByID(var1.entityId); -- if(var2 != null) { -- var2.setVelocity((double)var1.motionX / 8000.0D, (double)var1.motionY / 8000.0D, (double)var1.motionZ / 8000.0D); -- } -- } -- -- public void handleEntityMetadata(Packet40EntityMetadata var1) { -- Entity var2 = this.getEntityByID(var1.entityId); -- if(var2 != null && var1.getMetadata() != null) { -- var2.getDataWatcher().updateWatchedObjectsFromList(var1.getMetadata()); -- } -- -- } -- -- public void handleNamedEntitySpawn(Packet20NamedEntitySpawn var1) { -- double var2 = (double)var1.xPosition / 32.0D; -- double var4 = (double)var1.yPosition / 32.0D; -- double var6 = (double)var1.zPosition / 32.0D; -- float var8 = (float)(var1.rotation * 360) / 256.0F; -- float var9 = (float)(var1.pitch * 360) / 256.0F; -- EntityOtherPlayerMP var10 = new EntityOtherPlayerMP(this.mc.theWorld, var1.b); -- var10.prevPosX = var10.lastTickPosX = (double)(var10.serverPosX = var1.xPosition); -- var10.prevPosY = var10.lastTickPosY = (double)(var10.serverPosY = var1.yPosition); -- var10.prevPosZ = var10.lastTickPosZ = (double)(var10.serverPosZ = var1.zPosition); -- int var11 = var1.currentItem; -- if(var11 == 0) { -+ } -+ -+ /** -+ * Packet handler -+ */ -+ public void handleEntityPainting(Packet25EntityPainting par1Packet25EntityPainting) { -+ EntityPainting var2 = new EntityPainting(this.worldClient, par1Packet25EntityPainting.xPosition, par1Packet25EntityPainting.yPosition, par1Packet25EntityPainting.zPosition, par1Packet25EntityPainting.direction, par1Packet25EntityPainting.title); -+ this.worldClient.addEntityToWorld(par1Packet25EntityPainting.entityId, var2); -+ } -+ -+ /** -+ * Packet handler -+ */ -+ public void handleEntityVelocity(Packet28EntityVelocity par1Packet28EntityVelocity) { -+ Entity var2 = this.getEntityByID(par1Packet28EntityVelocity.entityId); -+ -+ if (var2 != null) { -+ var2.setVelocity((double)par1Packet28EntityVelocity.motionX / 8000.0D, (double)par1Packet28EntityVelocity.motionY / 8000.0D, (double)par1Packet28EntityVelocity.motionZ / 8000.0D); -+ } -+ } -+ -+ /** -+ * Packet handler -+ */ -+ public void handleEntityMetadata(Packet40EntityMetadata par1Packet40EntityMetadata) { -+ Entity var2 = this.getEntityByID(par1Packet40EntityMetadata.entityId); -+ -+ if (var2 != null && par1Packet40EntityMetadata.getMetadata() != null) { -+ var2.getDataWatcher().updateWatchedObjectsFromList(par1Packet40EntityMetadata.getMetadata()); -+ } -+ } -+ -+ public void handleNamedEntitySpawn(Packet20NamedEntitySpawn par1Packet20NamedEntitySpawn) { -+ double var2 = (double)par1Packet20NamedEntitySpawn.xPosition / 32.0D; -+ double var4 = (double)par1Packet20NamedEntitySpawn.yPosition / 32.0D; -+ double var6 = (double)par1Packet20NamedEntitySpawn.zPosition / 32.0D; -+ float var8 = (float)(par1Packet20NamedEntitySpawn.rotation * 360) / 256.0F; -+ float var9 = (float)(par1Packet20NamedEntitySpawn.pitch * 360) / 256.0F; -+ EntityOtherPlayerMP var10 = new EntityOtherPlayerMP(this.mc.theWorld, par1Packet20NamedEntitySpawn.name); -+ var10.prevPosX = var10.lastTickPosX = (double)(var10.serverPosX = par1Packet20NamedEntitySpawn.xPosition); -+ var10.prevPosY = var10.lastTickPosY = (double)(var10.serverPosY = par1Packet20NamedEntitySpawn.yPosition); -+ var10.prevPosZ = var10.lastTickPosZ = (double)(var10.serverPosZ = par1Packet20NamedEntitySpawn.zPosition); -+ int var11 = par1Packet20NamedEntitySpawn.currentItem; -+ -+ if (var11 == 0) { - var10.inventory.mainInventory[var10.inventory.currentItem] = null; - } else { - var10.inventory.mainInventory[var10.inventory.currentItem] = new ItemStack(var11, 1, 0); - } - - var10.setPositionAndRotation(var2, var4, var6, var8, var9); -- this.worldClient.addEntityToWorld(var1.entityId, var10); -- List var12 = var1.getWatchedMetadata(); -- if(var12 != null) { -+ this.worldClient.addEntityToWorld(par1Packet20NamedEntitySpawn.entityId, var10); -+ List var12 = par1Packet20NamedEntitySpawn.getWatchedMetadata(); -+ -+ if (var12 != null) { - var10.getDataWatcher().updateWatchedObjectsFromList(var12); - } -- -+ // Spout Start - Set the entity's title -+ if (var10.worldObj.customTitles.containsKey(var10.entityId)) { -+ ((org.spoutcraft.client.entity.CraftLivingEntity)SpoutClient.getInstance().getEntityFromId(var10.entityId).spoutEnty).setTitle(var10.worldObj.customTitles.get(var10.entityId)); -+ } -+ // Spout End - } - -- public void handleEntityTeleport(Packet34EntityTeleport var1) { -- Entity var2 = this.getEntityByID(var1.entityId); -- if(var2 != null) { -- var2.serverPosX = var1.xPosition; -- var2.serverPosY = var1.yPosition; -- var2.serverPosZ = var1.zPosition; -+ public void handleEntityTeleport(Packet34EntityTeleport par1Packet34EntityTeleport) { -+ Entity var2 = this.getEntityByID(par1Packet34EntityTeleport.entityId); -+ -+ if (var2 != null) { -+ var2.serverPosX = par1Packet34EntityTeleport.xPosition; -+ var2.serverPosY = par1Packet34EntityTeleport.yPosition; -+ var2.serverPosZ = par1Packet34EntityTeleport.zPosition; - double var3 = (double)var2.serverPosX / 32.0D; -- double var5 = (double)var2.serverPosY / 32.0D + 1.0D / 64.0D; -+ double var5 = (double)var2.serverPosY / 32.0D + 0.015625D; - double var7 = (double)var2.serverPosZ / 32.0D; -- float var9 = (float)(var1.yaw * 360) / 256.0F; -- float var10 = (float)(var1.pitch * 360) / 256.0F; -+ float var9 = (float)(par1Packet34EntityTeleport.yaw * 360) / 256.0F; -+ float var10 = (float)(par1Packet34EntityTeleport.pitch * 360) / 256.0F; - var2.setPositionAndRotation2(var3, var5, var7, var9, var10, 3); - } - } - -- public void handleBlockItemSwitch(Packet16BlockItemSwitch var1) { -- if(var1.id >= 0 && var1.id < InventoryPlayer.getHotbarSize()) { -- this.mc.thePlayer.inventory.currentItem = var1.id; -+ public void handleBlockItemSwitch(Packet16BlockItemSwitch par1Packet16BlockItemSwitch) { -+ if (par1Packet16BlockItemSwitch.id >= 0 && par1Packet16BlockItemSwitch.id < InventoryPlayer.getHotbarSize()) { -+ this.mc.thePlayer.inventory.currentItem = par1Packet16BlockItemSwitch.id; - } -- - } - -- public void handleEntity(Packet30Entity var1) { -- Entity var2 = this.getEntityByID(var1.entityId); -- if(var2 != null) { -- var2.serverPosX += var1.xPosition; -- var2.serverPosY += var1.yPosition; -- var2.serverPosZ += var1.zPosition; -+ public void handleEntity(Packet30Entity par1Packet30Entity) { -+ Entity var2 = this.getEntityByID(par1Packet30Entity.entityId); -+ -+ if (var2 != null) { -+ var2.serverPosX += par1Packet30Entity.xPosition; -+ var2.serverPosY += par1Packet30Entity.yPosition; -+ var2.serverPosZ += par1Packet30Entity.zPosition; - double var3 = (double)var2.serverPosX / 32.0D; - double var5 = (double)var2.serverPosY / 32.0D; - double var7 = (double)var2.serverPosZ / 32.0D; -- float var9 = var1.rotating ? (float)(var1.yaw * 360) / 256.0F : var2.rotationYaw; -- float var10 = var1.rotating ? (float)(var1.pitch * 360) / 256.0F : var2.rotationPitch; -+ float var9 = par1Packet30Entity.rotating ? (float)(par1Packet30Entity.yaw * 360) / 256.0F : var2.rotationYaw; -+ float var10 = par1Packet30Entity.rotating ? (float)(par1Packet30Entity.pitch * 360) / 256.0F : var2.rotationPitch; - var2.setPositionAndRotation2(var3, var5, var7, var9, var10, 3); - } - } - -- public void handleEntityHeadRotation(Packet35EntityHeadRotation var1) { -- Entity var2 = this.getEntityByID(var1.entityId); -- if(var2 != null) { -- float var3 = (float)(var1.headRotationYaw * 360) / 256.0F; -+ public void handleEntityHeadRotation(Packet35EntityHeadRotation par1Packet35EntityHeadRotation) { -+ Entity var2 = this.getEntityByID(par1Packet35EntityHeadRotation.entityId); -+ -+ if (var2 != null) { -+ float var3 = (float)(par1Packet35EntityHeadRotation.headRotationYaw * 360) / 256.0F; - var2.setRotationYawHead(var3); - } - } - -- public void handleDestroyEntity(Packet29DestroyEntity var1) { -- for(int var2 = 0; var2 < var1.entityId.length; ++var2) { -- this.worldClient.removeEntityFromWorld(var1.entityId[var2]); -+ public void handleDestroyEntity(Packet29DestroyEntity par1Packet29DestroyEntity) { -+ for (int var2 = 0; var2 < par1Packet29DestroyEntity.entityId.length; ++var2) { -+ this.worldClient.removeEntityFromWorld(par1Packet29DestroyEntity.entityId[var2]); - } -- - } - -- public void handleFlying(Packet10Flying var1) { -+ public void handleFlying(Packet10Flying par1Packet10Flying) { - EntityClientPlayerMP var2 = this.mc.thePlayer; - double var3 = var2.posX; - double var5 = var2.posY; - double var7 = var2.posZ; - float var9 = var2.rotationYaw; - float var10 = var2.rotationPitch; -- if(var1.moving) { -- var3 = var1.xPosition; -- var5 = var1.yPosition; -- var7 = var1.zPosition; -+ -+ if (par1Packet10Flying.moving) { -+ var3 = par1Packet10Flying.xPosition; -+ var5 = par1Packet10Flying.yPosition; -+ var7 = par1Packet10Flying.zPosition; - } - -- if(var1.rotating) { -- var9 = var1.yaw; -- var10 = var1.pitch; -+ if (par1Packet10Flying.rotating) { -+ var9 = par1Packet10Flying.yaw; -+ var10 = par1Packet10Flying.pitch; - } - - var2.ySize = 0.0F; - var2.motionX = var2.motionY = var2.motionZ = 0.0D; - var2.setPositionAndRotation(var3, var5, var7, var9, var10); -- var1.xPosition = var2.posX; -- var1.yPosition = var2.boundingBox.minY; -- var1.zPosition = var2.posZ; -- var1.stance = var2.posY; -- this.netManager.addToSendQueue(var1); -- if(!this.doneLoadingTerrain) { -+ par1Packet10Flying.xPosition = var2.posX; -+ par1Packet10Flying.yPosition = var2.boundingBox.minY; -+ par1Packet10Flying.zPosition = var2.posZ; -+ par1Packet10Flying.stance = var2.posY; -+ this.netManager.addToSendQueue(par1Packet10Flying); -+ -+ if (!this.doneLoadingTerrain) { - this.mc.thePlayer.prevPosX = this.mc.thePlayer.posX; - this.mc.thePlayer.prevPosY = this.mc.thePlayer.posY; - this.mc.thePlayer.prevPosZ = this.mc.thePlayer.posZ; - this.doneLoadingTerrain = true; -- this.mc.displayGuiScreen((GuiScreen)null); -+ -+ if (!(this.mc.currentScreen instanceof GuiPrecache)) { -+ this.mc.displayGuiScreen((GuiScreen)null); -+ } - } -- - } - -- public void handleMultiBlockChange(Packet52MultiBlockChange var1) { -- int var2 = var1.xPosition * 16; -- int var3 = var1.zPosition * 16; -- if(var1.metadataArray != null) { -- DataInputStream var4 = new DataInputStream(new ByteArrayInputStream(var1.metadataArray)); -+ public void handleMultiBlockChange(Packet52MultiBlockChange par1Packet52MultiBlockChange) { -+ int var2 = par1Packet52MultiBlockChange.xPosition * 16; -+ int var3 = par1Packet52MultiBlockChange.zPosition * 16; -+ -+ if (par1Packet52MultiBlockChange.metadataArray != null) { -+ DataInputStream var4 = new DataInputStream(new ByteArrayInputStream(par1Packet52MultiBlockChange.metadataArray)); - - try { -- for(int var5 = 0; var5 < var1.size; ++var5) { -+ for (int var5 = 0; var5 < par1Packet52MultiBlockChange.size; ++var5) { - short var6 = var4.readShort(); - short var7 = var4.readShort(); - int var8 = var7 >> 4 & 4095; -@@ -404,772 +510,918 @@ - this.worldClient.setBlockAndMetadataAndInvalidate(var10 + var2, var12, var11 + var3, var8, var9); - } - } catch (IOException var13) { -+ ; - } -- - } - } - -- public void handleMapChunk(Packet51MapChunk var1) { -- if(var1.includeInitialize) { -- if(var1.yChMin == 0) { -- this.worldClient.doPreChunk(var1.xCh, var1.zCh, false); -+ /** -+ * Handle Packet51MapChunk (full chunk update of blocks, metadata, light levels, and optionally biome data) -+ */ -+ public void handleMapChunk(Packet51MapChunk par1Packet51MapChunk) { -+ // Spout Start -+ if (par1Packet51MapChunk.yChMax == -1 && par1Packet51MapChunk.yChMin == -1) { -+ getNetManager().networkShutdown("Spout Cache Error - Corrupt File Deleted", new Object[0]); -+ kick("Cache Error - Corrupt File Deleted"); -+ return; -+ } -+ if (worldClient == null) { -+ return; -+ } -+ // Spout End -+ if (par1Packet51MapChunk.includeInitialize) { -+ if (par1Packet51MapChunk.yChMin == 0) { -+ this.worldClient.doPreChunk(par1Packet51MapChunk.xCh, par1Packet51MapChunk.zCh, false); - return; - } - -- this.worldClient.doPreChunk(var1.xCh, var1.zCh, true); -- } -- -- this.worldClient.invalidateBlockReceiveRegion(var1.xCh << 4, 0, var1.zCh << 4, (var1.xCh << 4) + 15, 256, (var1.zCh << 4) + 15); -- Chunk var2 = this.worldClient.getChunkFromChunkCoords(var1.xCh, var1.zCh); -- if(var1.includeInitialize && var2 == null) { -- this.worldClient.doPreChunk(var1.xCh, var1.zCh, true); -- var2 = this.worldClient.getChunkFromChunkCoords(var1.xCh, var1.zCh); -- } -- -- if(var2 != null) { -- var2.fillChunk(var1.getCompressedChunkData(), var1.yChMin, var1.yChMax, var1.includeInitialize); -- this.worldClient.markBlockRangeForRenderUpdate(var1.xCh << 4, 0, var1.zCh << 4, (var1.xCh << 4) + 15, 256, (var1.zCh << 4) + 15); -- if(!var1.includeInitialize || !(this.worldClient.provider instanceof WorldProviderSurface)) { -+ this.worldClient.doPreChunk(par1Packet51MapChunk.xCh, par1Packet51MapChunk.zCh, true); -+ } -+ -+ this.worldClient.invalidateBlockReceiveRegion(par1Packet51MapChunk.xCh << 4, 0, par1Packet51MapChunk.zCh << 4, (par1Packet51MapChunk.xCh << 4) + 15, 256, (par1Packet51MapChunk.zCh << 4) + 15); -+ Chunk var2 = this.worldClient.getChunkFromChunkCoords(par1Packet51MapChunk.xCh, par1Packet51MapChunk.zCh); -+ -+ if (par1Packet51MapChunk.includeInitialize && var2 == null) { -+ this.worldClient.doPreChunk(par1Packet51MapChunk.xCh, par1Packet51MapChunk.zCh, true); -+ var2 = this.worldClient.getChunkFromChunkCoords(par1Packet51MapChunk.xCh, par1Packet51MapChunk.zCh); -+ } -+ -+ if (var2 != null) { -+ var2.fillChunk(par1Packet51MapChunk.getCompressedChunkData(), par1Packet51MapChunk.yChMin, par1Packet51MapChunk.yChMax, par1Packet51MapChunk.includeInitialize); -+ this.worldClient.markBlockRangeForRenderUpdate(par1Packet51MapChunk.xCh << 4, 0, par1Packet51MapChunk.zCh << 4, (par1Packet51MapChunk.xCh << 4) + 15, 256, (par1Packet51MapChunk.zCh << 4) + 15); -+ -+ if (!par1Packet51MapChunk.includeInitialize || !(this.worldClient.provider instanceof WorldProviderSurface)) { -+ // Spout Start -+ if (Configuration.isClientLight()) { - var2.resetRelightChecks(); -+ } -+ // Spout End - } - } -- -- } -- -- public void handleBlockChange(Packet53BlockChange var1) { -- this.worldClient.setBlockAndMetadataAndInvalidate(var1.xPosition, var1.yPosition, var1.zPosition, var1.type, var1.metadata); -- } -- -- public void handleKickDisconnect(Packet255KickDisconnect var1) { -+ } -+ -+ public void handleBlockChange(Packet53BlockChange par1Packet53BlockChange) { -+ this.worldClient.setBlockAndMetadataAndInvalidate(par1Packet53BlockChange.xPosition, par1Packet53BlockChange.yPosition, par1Packet53BlockChange.zPosition, par1Packet53BlockChange.type, par1Packet53BlockChange.metadata); -+ } -+ -+ // Spout Start -+ public void kick(String reason) { -+ if (this.mc.thePlayer != null) { -+ this.mc.thePlayer.closeScreen(); // Close the active screen first! -+ } - this.netManager.networkShutdown("disconnect.kicked", new Object[0]); - this.disconnected = true; - this.mc.loadWorld((WorldClient)null); -- if(this.field_98183_l != null) { -- this.mc.displayGuiScreen(new GuiScreenDisconnectedOnline(this.field_98183_l, "disconnect.disconnected", "disconnect.genericReason", new Object[]{var1.a})); -- } else { -- this.mc.displayGuiScreen(new GuiDisconnected(new GuiMultiplayer(new GuiMainMenu()), "disconnect.disconnected", "disconnect.genericReason", new Object[]{var1.a})); -- } -- -- } -- -- public void handleErrorMessage(String var1, Object[] var2) { -- if(!this.disconnected) { -+ this.mc.displayGuiScreen(new GuiDisconnected(null, "disconnect.disconnected", "disconnect.genericReason", new Object[] {reason})); -+ } -+ -+ public void handleKickDisconnect(Packet255KickDisconnect par1Packet255KickDisconnect) { -+ kick(par1Packet255KickDisconnect.reason); -+ } -+ // Spout End -+ -+ public void handleErrorMessage(String par1Str, Object[] par2ArrayOfObj) { -+ if (!this.disconnected) { - this.disconnected = true; - this.mc.loadWorld((WorldClient)null); -- if(this.field_98183_l != null) { -- this.mc.displayGuiScreen(new GuiScreenDisconnectedOnline(this.field_98183_l, "disconnect.lost", var1, var2)); -+ // Spout Start -+ System.out.println(par1Str); -+ if (par1Str != null && par1Str.toLowerCase().contains("endofstream")) { -+ this.mc.displayGuiScreen(new org.spoutcraft.client.gui.error.GuiConnectionLost()); -+ } else if (par2ArrayOfObj == null || par2ArrayOfObj.length == 0 || !(par2ArrayOfObj[0] instanceof String)) { -+ this.mc.displayGuiScreen(new GuiDisconnected(null, "disconnect.lost", par1Str, par2ArrayOfObj)); -+ } else if (((String)par2ArrayOfObj[0]).toLowerCase().contains("connection reset")) { -+ this.mc.displayGuiScreen(new org.spoutcraft.client.gui.error.GuiConnectionLost()); -+ } else if (((String)par2ArrayOfObj[0]).toLowerCase().contains("connection refused")) { -+ this.mc.displayGuiScreen(new org.spoutcraft.client.gui.error.GuiConnectionLost("The server is not currently online!")); -+ } else if (((String)par2ArrayOfObj[0]).toLowerCase().contains("overflow")) { -+ this.mc.displayGuiScreen(new org.spoutcraft.client.gui.error.GuiConnectionLost("The server is currently experiencing heavy traffic. Try again later.")); - } else { -- this.mc.displayGuiScreen(new GuiDisconnected(new GuiMultiplayer(new GuiMainMenu()), "disconnect.lost", var1, var2)); -+ this.mc.displayGuiScreen(new GuiDisconnected(null, "disconnect.lost", par1Str, par2ArrayOfObj)); - } -- -+ // Spout End - } - } - -- public void quitWithPacket(Packet var1) { -- if(!this.disconnected) { -- this.netManager.addToSendQueue(var1); -+ public void quitWithPacket(Packet par1Packet) { -+ if (!this.disconnected) { -+ this.netManager.addToSendQueue(par1Packet); - this.netManager.serverShutdown(); - } - } - -- public void addToSendQueue(Packet var1) { -- if(!this.disconnected) { -- this.netManager.addToSendQueue(var1); -+ /** -+ * Adds the packet to the send queue -+ */ -+ public void addToSendQueue(Packet par1Packet) { -+ if (!this.disconnected) { -+ this.netManager.addToSendQueue(par1Packet); - } - } - -- public void handleCollect(Packet22Collect var1) { -- Entity var2 = this.getEntityByID(var1.collectedEntityId); -- Object var3 = (EntityLivingBase)this.getEntityByID(var1.collectorEntityId); -- if(var3 == null) { -+ public void handleCollect(Packet22Collect par1Packet22Collect) { -+ Entity var2 = this.getEntityByID(par1Packet22Collect.collectedEntityId); -+ Object var3 = (EntityLivingBase)this.getEntityByID(par1Packet22Collect.collectorEntityId); -+ -+ if (var3 == null) { - var3 = this.mc.thePlayer; - } - -- if(var2 != null) { -- if(var2 instanceof EntityXPOrb) { -- this.worldClient.playSoundAtEntity(var2, "random.orb", 0.2F, ((this.e.nextFloat() - this.e.nextFloat()) * 0.7F + 1.0F) * 2.0F); -+ if (var2 != null) { -+ if (var2 instanceof EntityXPOrb) { -+ this.worldClient.playSoundAtEntity(var2, "random.orb", 0.2F, ((this.rand.nextFloat() - this.rand.nextFloat()) * 0.7F + 1.0F) * 2.0F); - } else { -- this.worldClient.playSoundAtEntity(var2, "random.pop", 0.2F, ((this.e.nextFloat() - this.e.nextFloat()) * 0.7F + 1.0F) * 2.0F); -+ this.worldClient.playSoundAtEntity(var2, "random.pop", 0.2F, ((this.rand.nextFloat() - this.rand.nextFloat()) * 0.7F + 1.0F) * 2.0F); - } - - this.mc.effectRenderer.addEffect(new EntityPickupFX(this.mc.theWorld, var2, (Entity)var3, -0.5F)); -- this.worldClient.removeEntityFromWorld(var1.collectedEntityId); -+ this.worldClient.removeEntityFromWorld(par1Packet22Collect.collectedEntityId); - } -- -- } -- -- public void handleChat(Packet3Chat var1) { -- this.mc.ingameGUI.getChatGUI().printChatMessage(ChatMessageComponent.createFromJson(var1.a).toStringWithFormatting(true)); -- } -- -- public void handleAnimation(Packet18Animation var1) { -- Entity var2 = this.getEntityByID(var1.entityId); -- if(var2 != null) { -- if(var1.animate == 1) { -+ } -+ -+ public void handleChat(Packet3Chat par1Packet3Chat) { -+ this.mc.ingameGUI.getChatGUI().printChatMessage(ChatMessageComponent.createFromJson(par1Packet3Chat.message).toStringWithFormatting(true)); -+ } -+ -+ public void handleAnimation(Packet18Animation par1Packet18Animation) { -+ Entity var2 = this.getEntityByID(par1Packet18Animation.entityId); -+ -+ if (var2 != null) { -+ if (par1Packet18Animation.animate == 1) { - EntityLivingBase var3 = (EntityLivingBase)var2; - var3.swingItem(); -- } else if(var1.animate == 2) { -+ } else if (par1Packet18Animation.animate == 2) { - var2.performHurtAnimation(); -- } else if(var1.animate == 3) { -+ } else if (par1Packet18Animation.animate == 3) { - EntityPlayer var4 = (EntityPlayer)var2; - var4.wakeUpPlayer(false, false, false); -- } else if(var1.animate != 4) { -- if(var1.animate == 6) { -+ } else if (par1Packet18Animation.animate != 4) { -+ if (par1Packet18Animation.animate == 6) { - this.mc.effectRenderer.addEffect(new EntityCrit2FX(this.mc.theWorld, var2)); -- } else if(var1.animate == 7) { -+ } else if (par1Packet18Animation.animate == 7) { - EntityCrit2FX var5 = new EntityCrit2FX(this.mc.theWorld, var2, "magicCrit"); - this.mc.effectRenderer.addEffect(var5); -- } else if(var1.animate == 5 && var2 instanceof EntityOtherPlayerMP) { -+ } else if (par1Packet18Animation.animate == 5 && var2 instanceof EntityOtherPlayerMP) { -+ ; - } - } -- - } - } - -- public void handleSleep(Packet17Sleep var1) { -- Entity var2 = this.getEntityByID(var1.entityID); -- if(var2 != null) { -- if(var1.field_73622_e == 0) { -+ public void handleSleep(Packet17Sleep par1Packet17Sleep) { -+ Entity var2 = this.getEntityByID(par1Packet17Sleep.entityID); -+ -+ if (var2 != null) { -+ if (par1Packet17Sleep.field_73622_e == 0) { - EntityPlayer var3 = (EntityPlayer)var2; -- var3.sleepInBedAt(var1.bedX, var1.bedY, var1.bedZ); -+ var3.sleepInBedAt(par1Packet17Sleep.bedX, par1Packet17Sleep.bedY, par1Packet17Sleep.bedZ); - } -- - } - } - -+ /** -+ * Disconnects the network connection. -+ */ - public void disconnect() { - this.disconnected = true; - this.netManager.wakeThreads(); - this.netManager.networkShutdown("disconnect.closed", new Object[0]); - } - -- public void handleMobSpawn(Packet24MobSpawn var1) { -- double var2 = (double)var1.xPosition / 32.0D; -- double var4 = (double)var1.yPosition / 32.0D; -- double var6 = (double)var1.zPosition / 32.0D; -- float var8 = (float)(var1.yaw * 360) / 256.0F; -- float var9 = (float)(var1.pitch * 360) / 256.0F; -- EntityLivingBase var10 = (EntityLivingBase)EntityList.createEntityByID(var1.type, this.mc.theWorld); -- var10.serverPosX = var1.xPosition; -- var10.serverPosY = var1.yPosition; -- var10.serverPosZ = var1.zPosition; -- var10.rotationYawHead = (float)(var1.headYaw * 360) / 256.0F; -+ public void handleMobSpawn(Packet24MobSpawn par1Packet24MobSpawn) { -+ double var2 = (double)par1Packet24MobSpawn.xPosition / 32.0D; -+ double var4 = (double)par1Packet24MobSpawn.yPosition / 32.0D; -+ double var6 = (double)par1Packet24MobSpawn.zPosition / 32.0D; -+ float var8 = (float)(par1Packet24MobSpawn.yaw * 360) / 256.0F; -+ float var9 = (float)(par1Packet24MobSpawn.pitch * 360) / 256.0F; -+ EntityLivingBase var10 = (EntityLivingBase)EntityList.createEntityByID(par1Packet24MobSpawn.type, this.mc.theWorld); -+ var10.serverPosX = par1Packet24MobSpawn.xPosition; -+ var10.serverPosY = par1Packet24MobSpawn.yPosition; -+ var10.serverPosZ = par1Packet24MobSpawn.zPosition; -+ var10.rotationYawHead = (float)(par1Packet24MobSpawn.headYaw * 360) / 256.0F; - Entity[] var11 = var10.getParts(); -- if(var11 != null) { -- int var12 = var1.entityId - var10.entityId; -- -- for(int var13 = 0; var13 < var11.length; ++var13) { -+ -+ if (var11 != null) { -+ int var12 = par1Packet24MobSpawn.entityId - var10.entityId; -+ -+ for (int var13 = 0; var13 < var11.length; ++var13) { - var11[var13].entityId += var12; - } - } - -- var10.entityId = var1.entityId; -+ var10.entityId = par1Packet24MobSpawn.entityId; - var10.setPositionAndRotation(var2, var4, var6, var8, var9); -- var10.motionX = (double)((float)var1.velocityX / 8000.0F); -- var10.motionY = (double)((float)var1.velocityY / 8000.0F); -- var10.motionZ = (double)((float)var1.velocityZ / 8000.0F); -- this.worldClient.addEntityToWorld(var1.entityId, var10); -- List var14 = var1.getMetadata(); -- if(var14 != null) { -+ var10.motionX = (double)((float)par1Packet24MobSpawn.velocityX / 8000.0F); -+ var10.motionY = (double)((float)par1Packet24MobSpawn.velocityY / 8000.0F); -+ var10.motionZ = (double)((float)par1Packet24MobSpawn.velocityZ / 8000.0F); -+ this.worldClient.addEntityToWorld(par1Packet24MobSpawn.entityId, var10); -+ List var14 = par1Packet24MobSpawn.getMetadata(); -+ -+ if (var14 != null) { - var10.getDataWatcher().updateWatchedObjectsFromList(var14); - } -- -- } -- -- public void handleUpdateTime(Packet4UpdateTime var1) { -- this.mc.theWorld.func_82738_a(var1.worldAge); -- this.mc.theWorld.setWorldTime(var1.time); -- } -- -- public void handleSpawnPosition(Packet6SpawnPosition var1) { -- this.mc.thePlayer.setSpawnChunk(new ChunkCoordinates(var1.xPosition, var1.yPosition, var1.zPosition), true); -- this.mc.theWorld.getWorldInfo().setSpawnPosition(var1.xPosition, var1.yPosition, var1.zPosition); -- } -- -- public void handleAttachEntity(Packet39AttachEntity var1) { -- Object var2 = this.getEntityByID(var1.ridingEntityId); -- Entity var3 = this.getEntityByID(var1.vehicleEntityId); -- if(var1.attachState == 0) { -+ // Spout Start - Set the entity's title -+ if (var10.worldObj.customTitles.containsKey(var10.entityId)) { -+ ((org.spoutcraft.client.entity.CraftLivingEntity)SpoutClient.getInstance().getEntityFromId(var10.entityId).spoutEnty).setTitle(var10.worldObj.customTitles.get(var10.entityId)); -+ } -+ // Spout End -+ } -+ -+ public void handleUpdateTime(Packet4UpdateTime par1Packet4UpdateTime) { -+ this.mc.theWorld.func_82738_a(par1Packet4UpdateTime.worldAge); -+ this.mc.theWorld.setWorldTime(par1Packet4UpdateTime.time); -+ } -+ -+ public void handleSpawnPosition(Packet6SpawnPosition par1Packet6SpawnPosition) { -+ this.mc.thePlayer.setSpawnChunk(new ChunkCoordinates(par1Packet6SpawnPosition.xPosition, par1Packet6SpawnPosition.yPosition, par1Packet6SpawnPosition.zPosition), true); -+ this.mc.theWorld.getWorldInfo().setSpawnPosition(par1Packet6SpawnPosition.xPosition, par1Packet6SpawnPosition.yPosition, par1Packet6SpawnPosition.zPosition); -+ } -+ -+ /** -+ * Packet handler -+ */ -+ public void handleAttachEntity(Packet39AttachEntity par1Packet39AttachEntity) { -+ Object var2 = this.getEntityByID(par1Packet39AttachEntity.ridingEntityId); -+ Entity var3 = this.getEntityByID(par1Packet39AttachEntity.vehicleEntityId); -+ -+ if (par1Packet39AttachEntity.attachState == 0) { - boolean var4 = false; -- if(var1.ridingEntityId == this.mc.thePlayer.entityId) { -+ -+ if (par1Packet39AttachEntity.ridingEntityId == this.mc.thePlayer.entityId) { - var2 = this.mc.thePlayer; -- if(var3 instanceof EntityBoat) { -+ -+ if (var3 instanceof EntityBoat) { - ((EntityBoat)var3).func_70270_d(false); - } - - var4 = ((Entity)var2).ridingEntity == null && var3 != null; -- } else if(var3 instanceof EntityBoat) { -+ } else if (var3 instanceof EntityBoat) { - ((EntityBoat)var3).func_70270_d(true); - } - -- if(var2 == null) { -+ if (var2 == null) { - return; - } - - ((Entity)var2).mountEntity(var3); -- if(var4) { -+ -+ if (var4) { - GameSettings var5 = this.mc.gameSettings; -- this.mc.ingameGUI.func_110326_a(I18n.getStringParams("mount.onboard", new Object[]{GameSettings.getKeyDisplayString(var5.keyBindSneak.keyCode)}), false); -+ this.mc.ingameGUI.func_110326_a(I18n.getStringParams("mount.onboard", new Object[] {GameSettings.getKeyDisplayString(var5.keyBindSneak.keyCode)}), false); - } -- } else if(var1.attachState == 1 && var2 != null && var2 instanceof EntityLiving) { -- if(var3 != null) { -+ } else if (par1Packet39AttachEntity.attachState == 1 && var2 != null && var2 instanceof EntityLiving) { -+ if (var3 != null) { - ((EntityLiving)var2).setLeashedToEntity(var3, false); - } else { - ((EntityLiving)var2).clearLeashed(false, false); - } - } -- - } - -- public void handleEntityStatus(Packet38EntityStatus var1) { -- Entity var2 = this.getEntityByID(var1.entityId); -- if(var2 != null) { -- var2.handleHealthUpdate(var1.entityStatus); -+ /** -+ * Packet handler -+ */ -+ public void handleEntityStatus(Packet38EntityStatus par1Packet38EntityStatus) { -+ Entity var2 = this.getEntityByID(par1Packet38EntityStatus.entityId); -+ -+ if (var2 != null) { -+ var2.handleHealthUpdate(par1Packet38EntityStatus.entityStatus); - } -- -- } -- -- private Entity getEntityByID(int var1) { -- return (Entity)(var1 == this.mc.thePlayer.entityId ? this.mc.thePlayer : this.worldClient.getEntityByID(var1)); -- } -- -- public void handleUpdateHealth(Packet8UpdateHealth var1) { -- this.mc.thePlayer.setPlayerSPHealth(var1.healthMP); -- this.mc.thePlayer.getFoodStats().setFoodLevel(var1.food); -- this.mc.thePlayer.getFoodStats().setFoodSaturationLevel(var1.foodSaturation); -- } -- -- public void handleExperience(Packet43Experience var1) { -- this.mc.thePlayer.setXPStats(var1.experience, var1.experienceTotal, var1.experienceLevel); -- } -- -- public void handleRespawn(Packet9Respawn var1) { -- if(var1.respawnDimension != this.mc.thePlayer.dimension) { -+ } -+ -+ private Entity getEntityByID(int par1) { -+ return (Entity)(par1 == this.mc.thePlayer.entityId ? this.mc.thePlayer : this.worldClient.getEntityByID(par1)); -+ } -+ -+ /** -+ * Recieves player health from the server and then proceeds to set it locally on the client. -+ */ -+ public void handleUpdateHealth(Packet8UpdateHealth par1Packet8UpdateHealth) { -+ this.mc.thePlayer.setPlayerSPHealth(par1Packet8UpdateHealth.healthMP); -+ this.mc.thePlayer.getFoodStats().setFoodLevel(par1Packet8UpdateHealth.food); -+ this.mc.thePlayer.getFoodStats().setFoodSaturationLevel(par1Packet8UpdateHealth.foodSaturation); -+ } -+ -+ /** -+ * Handle an experience packet. -+ */ -+ public void handleExperience(Packet43Experience par1Packet43Experience) { -+ this.mc.thePlayer.setXPStats(par1Packet43Experience.experience, par1Packet43Experience.experienceTotal, par1Packet43Experience.experienceLevel); -+ } -+ -+ /** -+ * respawns the player -+ */ -+ public void handleRespawn(Packet9Respawn par1Packet9Respawn) { -+ if (par1Packet9Respawn.respawnDimension != this.mc.thePlayer.dimension) { - this.doneLoadingTerrain = false; - Scoreboard var2 = this.worldClient.getScoreboard(); -- this.worldClient = new WorldClient(this, new WorldSettings(0L, var1.gameType, false, this.mc.theWorld.getWorldInfo().isHardcoreModeEnabled(), var1.terrainType), var1.respawnDimension, var1.difficulty, this.mc.mcProfiler, this.mc.getLogAgent()); -+ this.worldClient = new WorldClient(this, new WorldSettings(0L, par1Packet9Respawn.gameType, false, this.mc.theWorld.getWorldInfo().isHardcoreModeEnabled(), par1Packet9Respawn.terrainType), par1Packet9Respawn.respawnDimension, par1Packet9Respawn.difficulty, this.mc.mcProfiler, this.mc.getLogAgent()); - this.worldClient.func_96443_a(var2); - this.worldClient.isRemote = true; - this.mc.loadWorld(this.worldClient); -- this.mc.thePlayer.dimension = var1.respawnDimension; -+ this.mc.thePlayer.dimension = par1Packet9Respawn.respawnDimension; - this.mc.displayGuiScreen(new GuiDownloadTerrain(this)); - } - -- this.mc.setDimensionAndSpawnPlayer(var1.respawnDimension); -- this.mc.playerController.setGameType(var1.gameType); -+ this.mc.setDimensionAndSpawnPlayer(par1Packet9Respawn.respawnDimension); -+ this.mc.playerController.setGameType(par1Packet9Respawn.gameType); - } - -- public void handleExplosion(Packet60Explosion var1) { -- Explosion var2 = new Explosion(this.mc.theWorld, (Entity)null, var1.explosionX, var1.explosionY, var1.explosionZ, var1.explosionSize); -- var2.h = var1.e; -+ public void handleExplosion(Packet60Explosion par1Packet60Explosion) { -+ Explosion var2 = new Explosion(this.mc.theWorld, (Entity)null, par1Packet60Explosion.explosionX, par1Packet60Explosion.explosionY, par1Packet60Explosion.explosionZ, par1Packet60Explosion.explosionSize); -+ var2.affectedBlockPositions = par1Packet60Explosion.chunkPositionRecords; - var2.doExplosionB(true); -- this.mc.thePlayer.motionX += (double)var1.getPlayerVelocityX(); -- this.mc.thePlayer.motionY += (double)var1.getPlayerVelocityY(); -- this.mc.thePlayer.motionZ += (double)var1.getPlayerVelocityZ(); -+ this.mc.thePlayer.motionX += (double)par1Packet60Explosion.getPlayerVelocityX(); -+ this.mc.thePlayer.motionY += (double)par1Packet60Explosion.getPlayerVelocityY(); -+ this.mc.thePlayer.motionZ += (double)par1Packet60Explosion.getPlayerVelocityZ(); - } - -- public void handleOpenWindow(Packet100OpenWindow var1) { -+ public void handleOpenWindow(Packet100OpenWindow par1Packet100OpenWindow) { - EntityClientPlayerMP var2 = this.mc.thePlayer; -- switch(var1.inventoryType) { -- case 0: -- var2.displayGUIChest(new InventoryBasic(var1.c, var1.useProvidedWindowTitle, var1.slotsCount)); -- var2.openContainer.windowId = var1.windowId; -- break; -- case 1: -- var2.displayGUIWorkbench(MathHelper.floor_double(var2.posX), MathHelper.floor_double(var2.posY), MathHelper.floor_double(var2.posZ)); -- var2.openContainer.windowId = var1.windowId; -- break; -- case 2: -- TileEntityFurnace var4 = new TileEntityFurnace(); -- if(var1.useProvidedWindowTitle) { -- var4.setGuiDisplayName(var1.c); -- } -- -- var2.displayGUIFurnace(var4); -- var2.openContainer.windowId = var1.windowId; -- break; -- case 3: -- TileEntityDispenser var7 = new TileEntityDispenser(); -- if(var1.useProvidedWindowTitle) { -- var7.setCustomName(var1.c); -- } -- -- var2.displayGUIDispenser(var7); -- var2.openContainer.windowId = var1.windowId; -- break; -- case 4: -- var2.displayGUIEnchantment(MathHelper.floor_double(var2.posX), MathHelper.floor_double(var2.posY), MathHelper.floor_double(var2.posZ), var1.useProvidedWindowTitle ? var1.c : null); -- var2.openContainer.windowId = var1.windowId; -- break; -- case 5: -- TileEntityBrewingStand var5 = new TileEntityBrewingStand(); -- if(var1.useProvidedWindowTitle) { -- var5.func_94131_a(var1.c); -- } -- -- var2.displayGUIBrewingStand(var5); -- var2.openContainer.windowId = var1.windowId; -- break; -- case 6: -- var2.displayGUIMerchant(new NpcMerchant(var2), var1.useProvidedWindowTitle ? var1.c : null); -- var2.openContainer.windowId = var1.windowId; -- break; -- case 7: -- TileEntityBeacon var8 = new TileEntityBeacon(); -- var2.displayGUIBeacon(var8); -- if(var1.useProvidedWindowTitle) { -- var8.func_94047_a(var1.c); -- } -- -- var2.openContainer.windowId = var1.windowId; -- break; -- case 8: -- var2.displayGUIAnvil(MathHelper.floor_double(var2.posX), MathHelper.floor_double(var2.posY), MathHelper.floor_double(var2.posZ)); -- var2.openContainer.windowId = var1.windowId; -- break; -- case 9: -- TileEntityHopper var3 = new TileEntityHopper(); -- if(var1.useProvidedWindowTitle) { -- var3.setInventoryName(var1.c); -- } -- -- var2.displayGUIHopper(var3); -- var2.openContainer.windowId = var1.windowId; -- break; -- case 10: -- TileEntityDropper var6 = new TileEntityDropper(); -- if(var1.useProvidedWindowTitle) { -- var6.setCustomName(var1.c); -- } -- -- var2.displayGUIDispenser(var6); -- var2.openContainer.windowId = var1.windowId; -- break; -- case 11: -- Entity var9 = this.getEntityByID(var1.field_111008_f); -- if(var9 != null && var9 instanceof EntityHorse) { -- var2.displayGUIHorse((EntityHorse)var9, new AnimalChest(var1.c, var1.useProvidedWindowTitle, var1.slotsCount)); -- var2.openContainer.windowId = var1.windowId; -- } -+ -+ switch (par1Packet100OpenWindow.inventoryType) { -+ case 0: -+ var2.displayGUIChest(new InventoryBasic(par1Packet100OpenWindow.windowTitle, par1Packet100OpenWindow.useProvidedWindowTitle, par1Packet100OpenWindow.slotsCount)); -+ var2.openContainer.windowId = par1Packet100OpenWindow.windowId; -+ break; -+ -+ case 1: -+ var2.displayGUIWorkbench(MathHelper.floor_double(var2.posX), MathHelper.floor_double(var2.posY), MathHelper.floor_double(var2.posZ)); -+ var2.openContainer.windowId = par1Packet100OpenWindow.windowId; -+ break; -+ -+ case 2: -+ TileEntityFurnace var4 = new TileEntityFurnace(); -+ -+ if (par1Packet100OpenWindow.useProvidedWindowTitle) { -+ var4.setGuiDisplayName(par1Packet100OpenWindow.windowTitle); -+ } -+ -+ var2.displayGUIFurnace(var4); -+ var2.openContainer.windowId = par1Packet100OpenWindow.windowId; -+ break; -+ -+ case 3: -+ TileEntityDispenser var7 = new TileEntityDispenser(); -+ -+ if (par1Packet100OpenWindow.useProvidedWindowTitle) { -+ var7.setCustomName(par1Packet100OpenWindow.windowTitle); -+ } -+ -+ var2.displayGUIDispenser(var7); -+ var2.openContainer.windowId = par1Packet100OpenWindow.windowId; -+ break; -+ -+ case 4: -+ var2.displayGUIEnchantment(MathHelper.floor_double(var2.posX), MathHelper.floor_double(var2.posY), MathHelper.floor_double(var2.posZ), par1Packet100OpenWindow.useProvidedWindowTitle ? par1Packet100OpenWindow.windowTitle : null); -+ var2.openContainer.windowId = par1Packet100OpenWindow.windowId; -+ break; -+ -+ case 5: -+ TileEntityBrewingStand var5 = new TileEntityBrewingStand(); -+ -+ if (par1Packet100OpenWindow.useProvidedWindowTitle) { -+ var5.func_94131_a(par1Packet100OpenWindow.windowTitle); -+ } -+ -+ var2.displayGUIBrewingStand(var5); -+ var2.openContainer.windowId = par1Packet100OpenWindow.windowId; -+ break; -+ -+ case 6: -+ var2.displayGUIMerchant(new NpcMerchant(var2), par1Packet100OpenWindow.useProvidedWindowTitle ? par1Packet100OpenWindow.windowTitle : null); -+ var2.openContainer.windowId = par1Packet100OpenWindow.windowId; -+ break; -+ -+ case 7: -+ TileEntityBeacon var8 = new TileEntityBeacon(); -+ var2.displayGUIBeacon(var8); -+ -+ if (par1Packet100OpenWindow.useProvidedWindowTitle) { -+ var8.func_94047_a(par1Packet100OpenWindow.windowTitle); -+ } -+ -+ var2.openContainer.windowId = par1Packet100OpenWindow.windowId; -+ break; -+ -+ case 8: -+ var2.displayGUIAnvil(MathHelper.floor_double(var2.posX), MathHelper.floor_double(var2.posY), MathHelper.floor_double(var2.posZ)); -+ var2.openContainer.windowId = par1Packet100OpenWindow.windowId; -+ break; -+ -+ case 9: -+ TileEntityHopper var3 = new TileEntityHopper(); -+ -+ if (par1Packet100OpenWindow.useProvidedWindowTitle) { -+ var3.setInventoryName(par1Packet100OpenWindow.windowTitle); -+ } -+ -+ var2.displayGUIHopper(var3); -+ var2.openContainer.windowId = par1Packet100OpenWindow.windowId; -+ break; -+ -+ case 10: -+ TileEntityDropper var6 = new TileEntityDropper(); -+ -+ if (par1Packet100OpenWindow.useProvidedWindowTitle) { -+ var6.setCustomName(par1Packet100OpenWindow.windowTitle); -+ } -+ -+ var2.displayGUIDispenser(var6); -+ var2.openContainer.windowId = par1Packet100OpenWindow.windowId; -+ break; -+ -+ case 11: -+ Entity var9 = this.getEntityByID(par1Packet100OpenWindow.field_111008_f); -+ -+ if (var9 != null && var9 instanceof EntityHorse) { -+ var2.displayGUIHorse((EntityHorse)var9, new AnimalChest(par1Packet100OpenWindow.windowTitle, par1Packet100OpenWindow.useProvidedWindowTitle, par1Packet100OpenWindow.slotsCount)); -+ var2.openContainer.windowId = par1Packet100OpenWindow.windowId; -+ } - } -- - } - -- public void handleSetSlot(Packet103SetSlot var1) { -+ public void handleSetSlot(Packet103SetSlot par1Packet103SetSlot) { - EntityClientPlayerMP var2 = this.mc.thePlayer; -- if(var1.windowId == -1) { -- var2.inventory.setItemStack(var1.myItemStack); -+ -+ if (par1Packet103SetSlot.windowId == -1) { -+ var2.inventory.setItemStack(par1Packet103SetSlot.myItemStack); - } else { - boolean var3 = false; -- if(this.mc.currentScreen instanceof GuiContainerCreative) { -+ -+ if (this.mc.currentScreen instanceof GuiContainerCreative) { - GuiContainerCreative var4 = (GuiContainerCreative)this.mc.currentScreen; - var3 = var4.getCurrentTabIndex() != CreativeTabs.tabInventory.getTabIndex(); - } - -- if(var1.windowId == 0 && var1.itemSlot >= 36 && var1.itemSlot < 45) { -- ItemStack var5 = var2.inventoryContainer.getSlot(var1.itemSlot).getStack(); -- if(var1.myItemStack != null && (var5 == null || var5.stackSize < var1.myItemStack.stackSize)) { -- var1.myItemStack.animationsToGo = 5; -+ if (par1Packet103SetSlot.windowId == 0 && par1Packet103SetSlot.itemSlot >= 36 && par1Packet103SetSlot.itemSlot < 45) { -+ ItemStack var5 = var2.inventoryContainer.getSlot(par1Packet103SetSlot.itemSlot).getStack(); -+ -+ if (par1Packet103SetSlot.myItemStack != null && (var5 == null || var5.stackSize < par1Packet103SetSlot.myItemStack.stackSize)) { -+ par1Packet103SetSlot.myItemStack.animationsToGo = 5; - } - -- var2.inventoryContainer.putStackInSlot(var1.itemSlot, var1.myItemStack); -- } else if(var1.windowId == var2.openContainer.windowId && (var1.windowId != 0 || !var3)) { -- var2.openContainer.putStackInSlot(var1.itemSlot, var1.myItemStack); -+ var2.inventoryContainer.putStackInSlot(par1Packet103SetSlot.itemSlot, par1Packet103SetSlot.myItemStack); -+ } else if (par1Packet103SetSlot.windowId == var2.openContainer.windowId && (par1Packet103SetSlot.windowId != 0 || !var3)) { -+ var2.openContainer.putStackInSlot(par1Packet103SetSlot.itemSlot, par1Packet103SetSlot.myItemStack); - } - } -- - } - -- public void handleTransaction(Packet106Transaction var1) { -+ public void handleTransaction(Packet106Transaction par1Packet106Transaction) { - Container var2 = null; - EntityClientPlayerMP var3 = this.mc.thePlayer; -- if(var1.windowId == 0) { -+ -+ if (par1Packet106Transaction.windowId == 0) { - var2 = var3.inventoryContainer; -- } else if(var1.windowId == var3.openContainer.windowId) { -+ } else if (par1Packet106Transaction.windowId == var3.openContainer.windowId) { - var2 = var3.openContainer; - } - -- if(var2 != null && !var1.accepted) { -- this.addToSendQueue(new Packet106Transaction(var1.windowId, var1.shortWindowId, true)); -+ if (var2 != null && !par1Packet106Transaction.accepted) { -+ this.addToSendQueue(new Packet106Transaction(par1Packet106Transaction.windowId, par1Packet106Transaction.shortWindowId, true)); - } -- - } - -- public void handleWindowItems(Packet104WindowItems var1) { -+ public void handleWindowItems(Packet104WindowItems par1Packet104WindowItems) { - EntityClientPlayerMP var2 = this.mc.thePlayer; -- if(var1.windowId == 0) { -- var2.inventoryContainer.putStacksInSlots(var1.itemStack); -- } else if(var1.windowId == var2.openContainer.windowId) { -- var2.openContainer.putStacksInSlots(var1.itemStack); -+ -+ if (par1Packet104WindowItems.windowId == 0) { -+ var2.inventoryContainer.putStacksInSlots(par1Packet104WindowItems.itemStack); -+ } else if (par1Packet104WindowItems.windowId == var2.openContainer.windowId) { -+ var2.openContainer.putStacksInSlots(par1Packet104WindowItems.itemStack); - } -- - } -+ -+ public void func_142031_a(Packet133TileEditorOpen par1Packet133TileEditorOpen) { -+ TileEntity var2 = this.worldClient.getBlockTileEntity(par1Packet133TileEditorOpen.field_142035_b, par1Packet133TileEditorOpen.field_142036_c, par1Packet133TileEditorOpen.field_142034_d); - -- public void func_142031_a(Packet133TileEditorOpen var1) { -- TileEntity var2 = this.worldClient.getBlockTileEntity(var1.field_142035_b, var1.field_142036_c, var1.field_142034_d); -- if(var2 != null) { -+ if (var2 != null) { - this.mc.thePlayer.displayGUIEditSign(var2); -- } else if(var1.field_142037_a == 0) { -+ } else if (par1Packet133TileEditorOpen.field_142037_a == 0) { - TileEntitySign var3 = new TileEntitySign(); - var3.setWorldObj(this.worldClient); -- var3.xCoord = var1.field_142035_b; -- var3.yCoord = var1.field_142036_c; -- var3.zCoord = var1.field_142034_d; -+ var3.xCoord = par1Packet133TileEditorOpen.field_142035_b; -+ var3.yCoord = par1Packet133TileEditorOpen.field_142036_c; -+ var3.zCoord = par1Packet133TileEditorOpen.field_142034_d; - this.mc.thePlayer.displayGUIEditSign(var3); - } -- - } - -- public void handleUpdateSign(Packet130UpdateSign var1) { -+ /** -+ * Updates Client side signs -+ */ -+ public void handleUpdateSign(Packet130UpdateSign par1Packet130UpdateSign) { - boolean var2 = false; -- if(this.mc.theWorld.blockExists(var1.xPosition, var1.yPosition, var1.zPosition)) { -- TileEntity var3 = this.mc.theWorld.getBlockTileEntity(var1.xPosition, var1.yPosition, var1.zPosition); -- if(var3 instanceof TileEntitySign) { -+ -+ if (this.mc.theWorld.blockExists(par1Packet130UpdateSign.xPosition, par1Packet130UpdateSign.yPosition, par1Packet130UpdateSign.zPosition)) { -+ TileEntity var3 = this.mc.theWorld.getBlockTileEntity(par1Packet130UpdateSign.xPosition, par1Packet130UpdateSign.yPosition, par1Packet130UpdateSign.zPosition); -+ -+ if (var3 instanceof TileEntitySign) { - TileEntitySign var4 = (TileEntitySign)var3; -- if(var4.isEditable()) { -- for(int var5 = 0; var5 < 4; ++var5) { -- var4.a[var5] = var1.d[var5]; -+ -+ if (var4.isEditable()) { -+ for (int var5 = 0; var5 < 4; ++var5) { -+ var4.signText[var5] = par1Packet130UpdateSign.signLines[var5]; - } - - var4.onInventoryChanged(); -+ // Spout Start -+ var4.recalculateText(); -+ // Spout End - } - - var2 = true; - } - } - -- if(!var2 && this.mc.thePlayer != null) { -- this.mc.thePlayer.sendChatToPlayer(ChatMessageComponent.createFromText("Unable to locate sign at " + var1.xPosition + ", " + var1.yPosition + ", " + var1.zPosition)); -+ if (!var2 && this.mc.thePlayer != null) { -+ // Disable this notification until I can find cause. -+ //this.mc.thePlayer.sendChatToPlayer(ChatMessageComponent.createFromText("Unable to locate sign at " + par1Packet130UpdateSign.xPosition + ", " + par1Packet130UpdateSign.yPosition + ", " + par1Packet130UpdateSign.zPosition)); - } -- - } - -- public void handleTileEntityData(Packet132TileEntityData var1) { -- if(this.mc.theWorld.blockExists(var1.xPosition, var1.yPosition, var1.zPosition)) { -- TileEntity var2 = this.mc.theWorld.getBlockTileEntity(var1.xPosition, var1.yPosition, var1.zPosition); -- if(var2 != null) { -- if(var1.actionType == 1 && var2 instanceof TileEntityMobSpawner) { -- var2.readFromNBT(var1.data); -- } else if(var1.actionType == 2 && var2 instanceof TileEntityCommandBlock) { -- var2.readFromNBT(var1.data); -- } else if(var1.actionType == 3 && var2 instanceof TileEntityBeacon) { -- var2.readFromNBT(var1.data); -- } else if(var1.actionType == 4 && var2 instanceof TileEntitySkull) { -- var2.readFromNBT(var1.data); -+ public void handleTileEntityData(Packet132TileEntityData par1Packet132TileEntityData) { -+ if (this.mc.theWorld.blockExists(par1Packet132TileEntityData.xPosition, par1Packet132TileEntityData.yPosition, par1Packet132TileEntityData.zPosition)) { -+ TileEntity var2 = this.mc.theWorld.getBlockTileEntity(par1Packet132TileEntityData.xPosition, par1Packet132TileEntityData.yPosition, par1Packet132TileEntityData.zPosition); -+ -+ if (var2 != null) { -+ if (par1Packet132TileEntityData.actionType == 1 && var2 instanceof TileEntityMobSpawner) { -+ var2.readFromNBT(par1Packet132TileEntityData.data); -+ } else if (par1Packet132TileEntityData.actionType == 2 && var2 instanceof TileEntityCommandBlock) { -+ var2.readFromNBT(par1Packet132TileEntityData.data); -+ } else if (par1Packet132TileEntityData.actionType == 3 && var2 instanceof TileEntityBeacon) { -+ var2.readFromNBT(par1Packet132TileEntityData.data); -+ } else if (par1Packet132TileEntityData.actionType == 4 && var2 instanceof TileEntitySkull) { -+ var2.readFromNBT(par1Packet132TileEntityData.data); - } - } - } -- - } - -- public void handleUpdateProgressbar(Packet105UpdateProgressbar var1) { -+ public void handleUpdateProgressbar(Packet105UpdateProgressbar par1Packet105UpdateProgressbar) { - EntityClientPlayerMP var2 = this.mc.thePlayer; -- this.unexpectedPacket(var1); -- if(var2.openContainer != null && var2.openContainer.windowId == var1.windowId) { -- var2.openContainer.updateProgressBar(var1.progressBar, var1.progressBarValue); -- } -- -- } -- -- public void handlePlayerInventory(Packet5PlayerInventory var1) { -- Entity var2 = this.getEntityByID(var1.entityID); -- if(var2 != null) { -- var2.setCurrentItemOrArmor(var1.slot, var1.getItemSlot()); -- } -- -- } -- -- public void handleCloseWindow(Packet101CloseWindow var1) { -+ this.unexpectedPacket(par1Packet105UpdateProgressbar); -+ -+ if (var2.openContainer != null && var2.openContainer.windowId == par1Packet105UpdateProgressbar.windowId) { -+ var2.openContainer.updateProgressBar(par1Packet105UpdateProgressbar.progressBar, par1Packet105UpdateProgressbar.progressBarValue); -+ } -+ } -+ -+ public void handlePlayerInventory(Packet5PlayerInventory par1Packet5PlayerInventory) { -+ Entity var2 = this.getEntityByID(par1Packet5PlayerInventory.entityID); -+ -+ if (var2 != null) { -+ var2.setCurrentItemOrArmor(par1Packet5PlayerInventory.slot, par1Packet5PlayerInventory.getItemSlot()); -+ } -+ } -+ -+ public void handleCloseWindow(Packet101CloseWindow par1Packet101CloseWindow) { - this.mc.thePlayer.func_92015_f(); - } - -- public void handleBlockEvent(Packet54PlayNoteBlock var1) { -- this.mc.theWorld.addBlockEvent(var1.xLocation, var1.yLocation, var1.zLocation, var1.blockId, var1.instrumentType, var1.pitch); -- } -- -- public void handleBlockDestroy(Packet55BlockDestroy var1) { -- this.mc.theWorld.destroyBlockInWorldPartially(var1.getEntityId(), var1.getPosX(), var1.getPosY(), var1.getPosZ(), var1.getDestroyedStage()); -- } -- -- public void handleMapChunks(Packet56MapChunks var1) { -- for(int var2 = 0; var2 < var1.getNumberOfChunkInPacket(); ++var2) { -- int var3 = var1.getChunkPosX(var2); -- int var4 = var1.getChunkPosZ(var2); -+ public void handleBlockEvent(Packet54PlayNoteBlock par1Packet54PlayNoteBlock) { -+ this.mc.theWorld.addBlockEvent(par1Packet54PlayNoteBlock.xLocation, par1Packet54PlayNoteBlock.yLocation, par1Packet54PlayNoteBlock.zLocation, par1Packet54PlayNoteBlock.blockId, par1Packet54PlayNoteBlock.instrumentType, par1Packet54PlayNoteBlock.pitch); -+ } -+ -+ public void handleBlockDestroy(Packet55BlockDestroy par1Packet55BlockDestroy) { -+ this.mc.theWorld.destroyBlockInWorldPartially(par1Packet55BlockDestroy.getEntityId(), par1Packet55BlockDestroy.getPosX(), par1Packet55BlockDestroy.getPosY(), par1Packet55BlockDestroy.getPosZ(), par1Packet55BlockDestroy.getDestroyedStage()); -+ } -+ -+ public void handleMapChunks(Packet56MapChunks par1Packet56MapChunks) { -+ for (int var2 = 0; var2 < par1Packet56MapChunks.getNumberOfChunkInPacket(); ++var2) { -+ int var3 = par1Packet56MapChunks.getChunkPosX(var2); -+ int var4 = par1Packet56MapChunks.getChunkPosZ(var2); - this.worldClient.doPreChunk(var3, var4, true); - this.worldClient.invalidateBlockReceiveRegion(var3 << 4, 0, var4 << 4, (var3 << 4) + 15, 256, (var4 << 4) + 15); - Chunk var5 = this.worldClient.getChunkFromChunkCoords(var3, var4); -- if(var5 == null) { -+ -+ if (var5 == null) { - this.worldClient.doPreChunk(var3, var4, true); - var5 = this.worldClient.getChunkFromChunkCoords(var3, var4); - } - -- if(var5 != null) { -- var5.fillChunk(var1.getChunkCompressedData(var2), var1.field_73590_a[var2], var1.field_73588_b[var2], true); -+ if (var5 != null) { -+ var5.fillChunk(par1Packet56MapChunks.getChunkCompressedData(var2), par1Packet56MapChunks.field_73590_a[var2], par1Packet56MapChunks.field_73588_b[var2], true); - this.worldClient.markBlockRangeForRenderUpdate(var3 << 4, 0, var4 << 4, (var3 << 4) + 15, 256, (var4 << 4) + 15); -- if(!(this.worldClient.provider instanceof WorldProviderSurface)) { -+ -+ if (!(this.worldClient.provider instanceof WorldProviderSurface)) { - var5.resetRelightChecks(); - } - } - } -- - } - -+ /** -+ * If this returns false, all packets will be queued for the main thread to handle, even if they would otherwise be -+ * processed asynchronously. Used to avoid processing packets on the client before the world has been downloaded (which -+ * happens on the main thread) -+ */ - public boolean canProcessPacketsAsync() { - return this.mc != null && this.mc.theWorld != null && this.mc.thePlayer != null && this.worldClient != null; - } - -- public void handleGameEvent(Packet70GameEvent var1) { -+ public void handleGameEvent(Packet70GameEvent par1Packet70GameEvent) { - EntityClientPlayerMP var2 = this.mc.thePlayer; -- int var3 = var1.eventType; -- int var4 = var1.gameMode; -- if(var3 >= 0 && var3 < Packet70GameEvent.a.length && Packet70GameEvent.a[var3] != null) { -- var2.addChatMessage(Packet70GameEvent.a[var3]); -+ int var3 = par1Packet70GameEvent.eventType; -+ int var4 = par1Packet70GameEvent.gameMode; -+ -+ if (var3 >= 0 && var3 < Packet70GameEvent.clientMessage.length && Packet70GameEvent.clientMessage[var3] != null) { -+ var2.addChatMessage(Packet70GameEvent.clientMessage[var3]); - } - -- if(var3 == 1) { -+ if (var3 == 1) { - this.worldClient.getWorldInfo().setRaining(true); - this.worldClient.setRainStrength(0.0F); -- } else if(var3 == 2) { -+ } else if (var3 == 2) { - this.worldClient.getWorldInfo().setRaining(false); - this.worldClient.setRainStrength(1.0F); -- } else if(var3 == 3) { -+ } else if (var3 == 3) { - this.mc.playerController.setGameType(EnumGameType.getByID(var4)); -- } else if(var3 == 4) { -+ // Spout Start - Trigger survival HUD update -+ GuiIngame.dirtySurvival(); -+ // Spout End -+ } else if (var3 == 4) { - this.mc.displayGuiScreen(new GuiWinGame()); -- } else if(var3 == 5) { -+ } else if (var3 == 5) { - GameSettings var5 = this.mc.gameSettings; -- if(var4 == 0) { -+ -+ if (var4 == 0) { - this.mc.displayGuiScreen(new GuiScreenDemo()); -- } else if(var4 == 101) { -- this.mc.ingameGUI.getChatGUI().addTranslatedMessage("demo.help.movement", new Object[]{Keyboard.getKeyName(var5.keyBindForward.keyCode), Keyboard.getKeyName(var5.keyBindLeft.keyCode), Keyboard.getKeyName(var5.keyBindBack.keyCode), Keyboard.getKeyName(var5.keyBindRight.keyCode)}); -- } else if(var4 == 102) { -- this.mc.ingameGUI.getChatGUI().addTranslatedMessage("demo.help.jump", new Object[]{Keyboard.getKeyName(var5.keyBindJump.keyCode)}); -- } else if(var4 == 103) { -- this.mc.ingameGUI.getChatGUI().addTranslatedMessage("demo.help.inventory", new Object[]{Keyboard.getKeyName(var5.keyBindInventory.keyCode)}); -+ } else if (var4 == 101) { -+ this.mc.ingameGUI.getChatGUI().addTranslatedMessage("demo.help.movement", new Object[] {Keyboard.getKeyName(var5.keyBindForward.keyCode), Keyboard.getKeyName(var5.keyBindLeft.keyCode), Keyboard.getKeyName(var5.keyBindBack.keyCode), Keyboard.getKeyName(var5.keyBindRight.keyCode)}); -+ } else if (var4 == 102) { -+ this.mc.ingameGUI.getChatGUI().addTranslatedMessage("demo.help.jump", new Object[] {Keyboard.getKeyName(var5.keyBindJump.keyCode)}); -+ } else if (var4 == 103) { -+ this.mc.ingameGUI.getChatGUI().addTranslatedMessage("demo.help.inventory", new Object[] {Keyboard.getKeyName(var5.keyBindInventory.keyCode)}); - } -- } else if(var3 == 6) { -+ } else if (var3 == 6) { - this.worldClient.playSound(var2.posX, var2.posY + (double)var2.getEyeHeight(), var2.posZ, "random.successful_hit", 0.18F, 0.45F, false); - } -- -- } -- -- public void handleMapData(Packet131MapData var1) { -- if(var1.itemID == Item.map.itemID) { -- ItemMap.getMPMapData(var1.uniqueID, this.mc.theWorld).updateMPMapData(var1.itemData); -- } else { -- this.mc.getLogAgent().logWarning("Unknown itemid: " + var1.uniqueID); -- } -- -- } -- -- public void handleDoorChange(Packet61DoorChange var1) { -- if(var1.getRelativeVolumeDisabled()) { -- this.mc.theWorld.func_82739_e(var1.sfxID, var1.posX, var1.posY, var1.posZ, var1.auxData); -- } else { -- this.mc.theWorld.playAuxSFX(var1.sfxID, var1.posX, var1.posY, var1.posZ, var1.auxData); -- } -- -- } -- -- public void handleStatistic(Packet200Statistic var1) { -- this.mc.thePlayer.incrementStat(StatList.getOneShotStat(var1.statisticId), var1.amount); -- } -- -- public void handleEntityEffect(Packet41EntityEffect var1) { -- Entity var2 = this.getEntityByID(var1.entityId); -- if(var2 instanceof EntityLivingBase) { -- PotionEffect var3 = new PotionEffect(var1.effectId, var1.duration, var1.effectAmplifier); -- var3.setPotionDurationMax(var1.isDurationMax()); -+ } -+ -+ /** -+ * Contains logic for handling packets containing arbitrary unique item data. Currently this is only for maps. -+ */ -+ public void handleMapData(Packet131MapData par1Packet131MapData) { -+ if (par1Packet131MapData.itemID == Item.map.itemID) { -+ ItemMap.getMPMapData(par1Packet131MapData.uniqueID, this.mc.theWorld).updateMPMapData(par1Packet131MapData.itemData); -+ } else { -+ this.mc.getLogAgent().logWarning("Unknown itemid: " + par1Packet131MapData.uniqueID); -+ } -+ } -+ -+ public void handleDoorChange(Packet61DoorChange par1Packet61DoorChange) { -+ if (par1Packet61DoorChange.getRelativeVolumeDisabled()) { -+ this.mc.theWorld.func_82739_e(par1Packet61DoorChange.sfxID, par1Packet61DoorChange.posX, par1Packet61DoorChange.posY, par1Packet61DoorChange.posZ, par1Packet61DoorChange.auxData); -+ } else { -+ this.mc.theWorld.playAuxSFX(par1Packet61DoorChange.sfxID, par1Packet61DoorChange.posX, par1Packet61DoorChange.posY, par1Packet61DoorChange.posZ, par1Packet61DoorChange.auxData); -+ } -+ } -+ -+ /** -+ * Increment player statistics -+ */ -+ public void handleStatistic(Packet200Statistic par1Packet200Statistic) { -+ this.mc.thePlayer.incrementStat(StatList.getOneShotStat(par1Packet200Statistic.statisticId), par1Packet200Statistic.amount); -+ } -+ -+ /** -+ * Handle an entity effect packet. -+ */ -+ public void handleEntityEffect(Packet41EntityEffect par1Packet41EntityEffect) { -+ Entity var2 = this.getEntityByID(par1Packet41EntityEffect.entityId); -+ -+ if (var2 instanceof EntityLivingBase) { -+ PotionEffect var3 = new PotionEffect(par1Packet41EntityEffect.effectId, par1Packet41EntityEffect.duration, par1Packet41EntityEffect.effectAmplifier); -+ var3.setPotionDurationMax(par1Packet41EntityEffect.isDurationMax()); - ((EntityLivingBase)var2).addPotionEffect(var3); - } - } - -- public void handleRemoveEntityEffect(Packet42RemoveEntityEffect var1) { -- Entity var2 = this.getEntityByID(var1.entityId); -- if(var2 instanceof EntityLivingBase) { -- ((EntityLivingBase)var2).removePotionEffectClient(var1.effectId); -+ /** -+ * Handle a remove entity effect packet. -+ */ -+ public void handleRemoveEntityEffect(Packet42RemoveEntityEffect par1Packet42RemoveEntityEffect) { -+ Entity var2 = this.getEntityByID(par1Packet42RemoveEntityEffect.entityId); -+ -+ if (var2 instanceof EntityLivingBase) { -+ ((EntityLivingBase)var2).removePotionEffectClient(par1Packet42RemoveEntityEffect.effectId); - } - } - -+ /** -+ * determine if it is a server handler -+ */ - public boolean isServerHandler() { - return false; - } - -- public void handlePlayerInfo(Packet201PlayerInfo var1) { -- GuiPlayerInfo var2 = (GuiPlayerInfo)this.k.get(var1.a); -- if(var2 == null && var1.isConnected) { -- var2 = new GuiPlayerInfo(var1.a); -- this.k.put(var1.a, var2); -- this.c.add(var2); -- } -- -- if(var2 != null && !var1.isConnected) { -- this.k.remove(var1.a); -- this.c.remove(var2); -- } -- -- if(var1.isConnected && var2 != null) { -- var2.responseTime = var1.ping; -- } -- -- } -- -- public void handleKeepAlive(Packet0KeepAlive var1) { -- this.addToSendQueue(new Packet0KeepAlive(var1.randomId)); -- } -- -- public void handlePlayerAbilities(Packet202PlayerAbilities var1) { -+ /** -+ * Handle a player information packet. -+ */ -+ public void handlePlayerInfo(Packet201PlayerInfo par1Packet201PlayerInfo) { -+ GuiPlayerInfo var2 = (GuiPlayerInfo)this.playerInfoMap.get(par1Packet201PlayerInfo.playerName); -+ -+ if (var2 == null && par1Packet201PlayerInfo.isConnected) { -+ var2 = new GuiPlayerInfo(par1Packet201PlayerInfo.playerName); -+ this.playerInfoMap.put(par1Packet201PlayerInfo.playerName, var2); -+ this.playerInfoList.add(var2); -+ } -+ -+ if (var2 != null && !par1Packet201PlayerInfo.isConnected) { -+ this.playerInfoMap.remove(par1Packet201PlayerInfo.playerName); -+ this.playerInfoList.remove(var2); -+ } -+ -+ if (par1Packet201PlayerInfo.isConnected && var2 != null) { -+ var2.responseTime = par1Packet201PlayerInfo.ping; -+ } -+ } -+ -+ /** -+ * Handle a keep alive packet. -+ */ -+ public void handleKeepAlive(Packet0KeepAlive par1Packet0KeepAlive) { -+ this.addToSendQueue(new Packet0KeepAlive(par1Packet0KeepAlive.randomId)); -+ } -+ -+ /** -+ * Handle a player abilities packet. -+ */ -+ public void handlePlayerAbilities(Packet202PlayerAbilities par1Packet202PlayerAbilities) { - EntityClientPlayerMP var2 = this.mc.thePlayer; -- var2.capabilities.isFlying = var1.getFlying(); -- var2.capabilities.isCreativeMode = var1.isCreativeMode(); -- var2.capabilities.disableDamage = var1.getDisableDamage(); -- var2.capabilities.allowFlying = var1.getAllowFlying(); -- var2.capabilities.setFlySpeed(var1.getFlySpeed()); -- var2.capabilities.setPlayerWalkSpeed(var1.getWalkSpeed()); -+ var2.capabilities.isFlying = par1Packet202PlayerAbilities.getFlying(); -+ var2.capabilities.isCreativeMode = par1Packet202PlayerAbilities.isCreativeMode(); -+ var2.capabilities.disableDamage = par1Packet202PlayerAbilities.getDisableDamage(); -+ var2.capabilities.allowFlying = par1Packet202PlayerAbilities.getAllowFlying(); -+ var2.capabilities.setFlySpeed(par1Packet202PlayerAbilities.getFlySpeed()); -+ var2.capabilities.setPlayerWalkSpeed(par1Packet202PlayerAbilities.getWalkSpeed()); - } - -- public void handleAutoComplete(Packet203AutoComplete var1) { -- String[] var2 = var1.getText().split("\u0000"); -- if(this.mc.currentScreen instanceof GuiChat) { -+ public void handleAutoComplete(Packet203AutoComplete par1Packet203AutoComplete) { -+ String[] var2 = par1Packet203AutoComplete.getText().split("\u0000"); -+ -+ if (this.mc.currentScreen instanceof GuiChat) { - GuiChat var3 = (GuiChat)this.mc.currentScreen; - var3.func_73894_a(var2); - } -- -- } -- -- public void handleLevelSound(Packet62LevelSound var1) { -- this.mc.theWorld.playSound(var1.getEffectX(), var1.getEffectY(), var1.getEffectZ(), var1.getSoundName(), var1.getVolume(), var1.getPitch(), false); -- } -- -- public void handleCustomPayload(Packet250CustomPayload var1) { -- if("MC|TrList".equals(var1.a)) { -- DataInputStream var2 = new DataInputStream(new ByteArrayInputStream(var1.data)); -- -- try { -- int var3 = var2.readInt(); -- GuiScreen var4 = this.mc.currentScreen; -- if(var4 != null && var4 instanceof GuiMerchant && var3 == this.mc.thePlayer.openContainer.windowId) { -- IMerchant var5 = ((GuiMerchant)var4).getIMerchant(); -- MerchantRecipeList var6 = MerchantRecipeList.readRecipiesFromStream(var2); -- var5.setRecipes(var6); -+ } -+ -+ public void handleLevelSound(Packet62LevelSound par1Packet62LevelSound) { -+ this.mc.theWorld.playSound(par1Packet62LevelSound.getEffectX(), par1Packet62LevelSound.getEffectY(), par1Packet62LevelSound.getEffectZ(), par1Packet62LevelSound.getSoundName(), par1Packet62LevelSound.getVolume(), par1Packet62LevelSound.getPitch(), false); -+ } -+ -+ public void handleCustomPayload(Packet250CustomPayload par1Packet250CustomPayload) { -+ if ("MC|TrList".equals(par1Packet250CustomPayload.channel)) { -+ if (Configuration.isServerTexturePromptsEnabled()) { -+ DataInputStream var2 = new DataInputStream(new ByteArrayInputStream(par1Packet250CustomPayload.data)); -+ -+ try { -+ int var3 = var2.readInt(); -+ GuiScreen var4 = this.mc.currentScreen; -+ -+ if (var4 != null && var4 instanceof GuiMerchant && var3 == this.mc.thePlayer.openContainer.windowId) { -+ IMerchant var5 = ((GuiMerchant)var4).getIMerchant(); -+ MerchantRecipeList var6 = MerchantRecipeList.readRecipiesFromStream(var2); -+ var5.setRecipes(var6); -+ } -+ } catch (IOException var7) { -+ var7.printStackTrace(); - } -- } catch (IOException var7) { -- var7.printStackTrace(); - } -- } else if("MC|Brand".equals(var1.a)) { -- this.mc.thePlayer.func_142020_c(new String(var1.data, Charsets.UTF_8)); -+ } else if ("MC|Brand".equals(par1Packet250CustomPayload.channel)) { -+ this.mc.thePlayer.func_142020_c(new String(par1Packet250CustomPayload.data, Charsets.UTF_8)); - } -- - } - -- public void handleSetObjective(Packet206SetObjective var1) { -+ /** -+ * Handle a set objective packet. -+ */ -+ public void handleSetObjective(Packet206SetObjective par1Packet206SetObjective) { - Scoreboard var2 = this.worldClient.getScoreboard(); - ScoreObjective var3; -- if(var1.change == 0) { -- var3 = var2.func_96535_a(var1.a, ScoreObjectiveCriteria.field_96641_b); -- var3.setDisplayName(var1.b); -+ -+ if (par1Packet206SetObjective.change == 0) { -+ var3 = var2.func_96535_a(par1Packet206SetObjective.objectiveName, ScoreObjectiveCriteria.field_96641_b); -+ var3.setDisplayName(par1Packet206SetObjective.objectiveDisplayName); - } else { -- var3 = var2.getObjective(var1.a); -- if(var1.change == 1) { -+ var3 = var2.getObjective(par1Packet206SetObjective.objectiveName); -+ -+ if (par1Packet206SetObjective.change == 1) { - var2.func_96519_k(var3); -- } else if(var1.change == 2) { -- var3.setDisplayName(var1.b); -+ } else if (par1Packet206SetObjective.change == 2) { -+ var3.setDisplayName(par1Packet206SetObjective.objectiveDisplayName); - } - } -- - } - -- public void handleSetScore(Packet207SetScore var1) { -+ /** -+ * Handle a set score packet. -+ */ -+ public void handleSetScore(Packet207SetScore par1Packet207SetScore) { - Scoreboard var2 = this.worldClient.getScoreboard(); -- ScoreObjective var3 = var2.getObjective(var1.b); -- if(var1.updateOrRemove == 0) { -- Score var4 = var2.func_96529_a(var1.a, var3); -- var4.func_96647_c(var1.value); -- } else if(var1.updateOrRemove == 1) { -- var2.func_96515_c(var1.a); -+ ScoreObjective var3 = var2.getObjective(par1Packet207SetScore.scoreName); -+ -+ if (par1Packet207SetScore.updateOrRemove == 0) { -+ Score var4 = var2.func_96529_a(par1Packet207SetScore.itemName, var3); -+ var4.func_96647_c(par1Packet207SetScore.value); -+ } else if (par1Packet207SetScore.updateOrRemove == 1) { -+ var2.func_96515_c(par1Packet207SetScore.itemName); - } -- - } - -- public void handleSetDisplayObjective(Packet208SetDisplayObjective var1) { -+ /** -+ * Handle a set display objective packet. -+ */ -+ public void handleSetDisplayObjective(Packet208SetDisplayObjective par1Packet208SetDisplayObjective) { - Scoreboard var2 = this.worldClient.getScoreboard(); -- if(var1.b.length() == 0) { -- var2.func_96530_a(var1.scoreboardPosition, (ScoreObjective)null); -+ -+ if (par1Packet208SetDisplayObjective.scoreName.length() == 0) { -+ var2.func_96530_a(par1Packet208SetDisplayObjective.scoreboardPosition, (ScoreObjective)null); - } else { -- ScoreObjective var3 = var2.getObjective(var1.b); -- var2.func_96530_a(var1.scoreboardPosition, var3); -+ ScoreObjective var3 = var2.getObjective(par1Packet208SetDisplayObjective.scoreName); -+ var2.func_96530_a(par1Packet208SetDisplayObjective.scoreboardPosition, var3); - } -- - } - -- public void handleSetPlayerTeam(Packet209SetPlayerTeam var1) { -+ /** -+ * Handle a set player team packet. -+ */ -+ public void handleSetPlayerTeam(Packet209SetPlayerTeam par1Packet209SetPlayerTeam) { - Scoreboard var2 = this.worldClient.getScoreboard(); - ScorePlayerTeam var3; -- if(var1.mode == 0) { -- var3 = var2.createTeam(var1.a); -+ -+ if (par1Packet209SetPlayerTeam.mode == 0) { -+ var3 = var2.func_96527_f(par1Packet209SetPlayerTeam.teamName); - } else { -- var3 = var2.func_96508_e(var1.a); -+ var3 = var2.func_96508_e(par1Packet209SetPlayerTeam.teamName); - } - -- if(var1.mode == 0 || var1.mode == 2) { -- var3.setTeamName(var1.b); -- var3.setNamePrefix(var1.c); -- var3.setNameSuffix(var1.d); -- var3.func_98298_a(var1.friendlyFire); -+ if (par1Packet209SetPlayerTeam.mode == 0 || par1Packet209SetPlayerTeam.mode == 2) { -+ var3.func_96664_a(par1Packet209SetPlayerTeam.teamDisplayName); -+ var3.func_96666_b(par1Packet209SetPlayerTeam.teamPrefix); -+ var3.func_96662_c(par1Packet209SetPlayerTeam.teamSuffix); -+ var3.func_98298_a(par1Packet209SetPlayerTeam.friendlyFire); - } - - Iterator var4; - String var5; -- if(var1.mode == 0 || var1.mode == 3) { -- var4 = var1.e.iterator(); -- -- while(var4.hasNext()) { -+ -+ if (par1Packet209SetPlayerTeam.mode == 0 || par1Packet209SetPlayerTeam.mode == 3) { -+ var4 = par1Packet209SetPlayerTeam.playerNames.iterator(); -+ -+ while (var4.hasNext()) { - var5 = (String)var4.next(); -- var2.addPlayerToTeam(var5, var3); -+ var2.func_96521_a(var5, var3); - } - } - -- if(var1.mode == 4) { -- var4 = var1.e.iterator(); -+ if (par1Packet209SetPlayerTeam.mode == 4) { -+ var4 = par1Packet209SetPlayerTeam.playerNames.iterator(); - -- while(var4.hasNext()) { -+ while (var4.hasNext()) { - var5 = (String)var4.next(); - var2.removePlayerFromTeam(var5, var3); - } - } - -- if(var1.mode == 1) { -+ if (par1Packet209SetPlayerTeam.mode == 1) { - var2.func_96511_d(var3); - } -- - } - -- public void handleWorldParticles(Packet63WorldParticles var1) { -- for(int var2 = 0; var2 < var1.getQuantity(); ++var2) { -- double var3 = this.e.nextGaussian() * (double)var1.getOffsetX(); -- double var5 = this.e.nextGaussian() * (double)var1.getOffsetY(); -- double var7 = this.e.nextGaussian() * (double)var1.getOffsetZ(); -- double var9 = this.e.nextGaussian() * (double)var1.getSpeed(); -- double var11 = this.e.nextGaussian() * (double)var1.getSpeed(); -- double var13 = this.e.nextGaussian() * (double)var1.getSpeed(); -- this.worldClient.spawnParticle(var1.getParticleName(), var1.getPositionX() + var3, var1.getPositionY() + var5, var1.getPositionZ() + var7, var9, var11, var13); -+ /** -+ * Handle a world particles packet. -+ */ -+ public void handleWorldParticles(Packet63WorldParticles par1Packet63WorldParticles) { -+ for (int var2 = 0; var2 < par1Packet63WorldParticles.getQuantity(); ++var2) { -+ double var3 = this.rand.nextGaussian() * (double)par1Packet63WorldParticles.getOffsetX(); -+ double var5 = this.rand.nextGaussian() * (double)par1Packet63WorldParticles.getOffsetY(); -+ double var7 = this.rand.nextGaussian() * (double)par1Packet63WorldParticles.getOffsetZ(); -+ double var9 = this.rand.nextGaussian() * (double)par1Packet63WorldParticles.getSpeed(); -+ double var11 = this.rand.nextGaussian() * (double)par1Packet63WorldParticles.getSpeed(); -+ double var13 = this.rand.nextGaussian() * (double)par1Packet63WorldParticles.getSpeed(); -+ this.worldClient.spawnParticle(par1Packet63WorldParticles.getParticleName(), par1Packet63WorldParticles.getPositionX() + var3, par1Packet63WorldParticles.getPositionY() + var5, par1Packet63WorldParticles.getPositionZ() + var7, var9, var11, var13); - } -- - } -+ -+ public void func_110773_a(Packet44UpdateAttributes par1Packet44UpdateAttributes) { -+ Entity var2 = this.getEntityByID(par1Packet44UpdateAttributes.func_111002_d()); - -- public void func_110773_a(Packet44UpdateAttributes var1) { -- Entity var2 = this.getEntityByID(var1.func_111002_d()); -- if(var2 != null) { -- if(!(var2 instanceof EntityLivingBase)) { -+ if (var2 != null) { -+ if (!(var2 instanceof EntityLivingBase)) { - throw new IllegalStateException("Server tried to update attributes of a non-living entity (actually: " + var2 + ")"); - } else { - BaseAttributeMap var3 = ((EntityLivingBase)var2).getAttributeMap(); -- Iterator var4 = var1.func_111003_f().iterator(); -+ Iterator var4 = par1Packet44UpdateAttributes.func_111003_f().iterator(); - -- while(var4.hasNext()) { -+ while (var4.hasNext()) { - Packet44UpdateAttributesSnapshot var5 = (Packet44UpdateAttributesSnapshot)var4.next(); - AttributeInstance var6 = var3.getAttributeInstanceByName(var5.func_142040_a()); -- if(var6 == null) { -+ -+ if (var6 == null) { - var6 = var3.func_111150_b(new RangedAttribute(var5.func_142040_a(), 0.0D, 2.2250738585072014E-308D, Double.MAX_VALUE)); - } - -@@ -1177,16 +1429,19 @@ - var6.func_142049_d(); - Iterator var7 = var5.func_142039_c().iterator(); - -- while(var7.hasNext()) { -+ while (var7.hasNext()) { - AttributeModifier var8 = (AttributeModifier)var7.next(); - var6.applyModifier(var8); - } - } -- - } - } - } - -+ -+ /** -+ * Return the NetworkManager instance used by this NetClientHandler -+ */ - public INetworkManager getNetManager() { - return this.netManager; - } ---- /dev/null -+++ org/spoutcraft/api/util/FixedVector.java -@@ -1,0 +1,126 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.api.util; -+ -+public interface FixedVector extends Cloneable { -+ /** -+ * Gets the X component. -+ * -+ * @return x -+ */ -+ public double getX(); -+ -+ /** -+ * Gets the floored value of the X component, indicating the block that this vector is contained with. -+ * -+ * @return block X -+ */ -+ public int getBlockX(); -+ -+ /** -+ * Gets the Y component. -+ * -+ * @return y -+ */ -+ public double getY(); -+ -+ /** -+ * Gets the floored value of the Y component, indicating the block that this vector is contained with. -+ * -+ * @return block y -+ */ -+ public int getBlockY(); -+ -+ /** -+ * Gets the Z component. -+ * -+ * @return z -+ */ -+ public double getZ(); -+ -+ /** -+ * Gets the floored value of the Z component, indicating the block that this vector is contained with. -+ * -+ * @return block z -+ */ -+ public int getBlockZ(); -+ -+ /** -+ * Gets the magnitude of the vector, defined as sqrt(x^2+y^2+z^2). The value of this method is not cached and uses a costly square-root function, so do not repeatedly call this method to get the vector's magnitude. NaN will be returned if the inner result of the sqrt() function overflows, which will be caused if the length is too long. -+ * -+ * @return the magnitude -+ */ -+ public double length(); -+ -+ /** -+ * Gets the magnitude of the vector squared. -+ * -+ * @return the magnitude -+ */ -+ public double lengthSquared(); -+ -+ /** -+ * Get the distance between this vector and another. The value of this method is not cached and uses a costly square-root function, so do not repeatedly call this method to get the vector's magnitude. NaN will be returned if the inner result of the sqrt() function overflows, which will be caused if the distance is too long. -+ * -+ * @return the distance -+ */ -+ public double distance(Vector other); -+ -+ /** -+ * Get the squared distance between this vector and another. -+ * -+ * @return the distance -+ */ -+ public double distanceSquared(Vector other); -+ -+ /** -+ * Gets the angle between this vector and another in radians. -+ * -+ * @param other -+ * @return angle in radians -+ */ -+ public float angle(Vector other); -+ -+ /** -+ * Calculates the dot product of this vector with another. The dot product is defined as x1*x2+y1*y2+z1*z2. The returned value is a scalar. -+ * -+ * @param other -+ * @return dot product -+ */ -+ public double dot(Vector other); -+ -+ /** -+ * Returns whether this vector is in an axis-aligned bounding box. The minimum and maximum vectors given must be truly the minimum and maximum X, Y and Z components. -+ * -+ * @param min -+ * @param max -+ * @return whether this vector is in the AABB -+ */ -+ public boolean isInAABB(Vector min, Vector max); -+ -+ /** -+ * Returns whether this vector is within a sphere. -+ * -+ * @param origin -+ * @param radius -+ * @return whether this vector is in the sphere -+ */ -+ public boolean isInSphere(Vector origin, double radius); -+} ---- net/minecraft/src/DedicatedServerListenThread.java -+++ net/minecraft/src/DedicatedServerListenThread.java -@@ -1,14 +1,17 @@ - package net.minecraft.src; - -+import java.io.IOException; - import java.net.InetAddress; - import net.minecraft.server.MinecraftServer; - - public class DedicatedServerListenThread extends NetworkListenThread { -+ -+ /** Instance of ServerListenThread. */ - private final ServerListenThread theServerListenThread; - -- public DedicatedServerListenThread(MinecraftServer var1, InetAddress var2, int var3) { -- super(var1); -- this.theServerListenThread = new ServerListenThread(this, var2, var3); -+ public DedicatedServerListenThread(MinecraftServer par1MinecraftServer, InetAddress par2InetAddress, int par3) throws IOException { -+ super(par1MinecraftServer); -+ this.theServerListenThread = new ServerListenThread(this, par2InetAddress, par3); - this.theServerListenThread.start(); - } - -@@ -18,17 +21,20 @@ - this.theServerListenThread.interrupt(); - } - -- public void handleNetworkListenThread() { -+ /** -+ * processes packets and pending connections -+ */ -+ public void networkTick() { - this.theServerListenThread.processPendingConnections(); -- super.handleNetworkListenThread(); -+ super.networkTick(); - } - - public DedicatedServer getDedicatedServer() { - return (DedicatedServer)super.getServer(); - } - -- public void func_71761_a(InetAddress var1) { -- this.theServerListenThread.func_71769_a(var1); -+ public void func_71761_a(InetAddress par1InetAddress) { -+ this.theServerListenThread.func_71769_a(par1InetAddress); - } - - public MinecraftServer getServer() { ---- /dev/null -+++ org/spoutcraft/client/packet/PacketScreenAction.java -@@ -1,0 +1,79 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.client.packet; -+ -+import java.io.IOException; -+ -+import org.spoutcraft.api.gui.ScreenType; -+import org.spoutcraft.api.io.SpoutInputStream; -+import org.spoutcraft.api.io.SpoutOutputStream; -+import org.spoutcraft.client.SpoutClient; -+ -+public class PacketScreenAction implements SpoutPacket { -+ protected byte action = -1; -+ protected byte screen = -1; // UnknownScreen -+ -+ public PacketScreenAction() { -+ } -+ -+ public PacketScreenAction(ScreenAction action, ScreenType screen) { -+ this.action = (byte)action.getId(); -+ this.screen = (byte)screen.getCode(); -+ } -+ -+ public int getNumBytes() { -+ return 2; -+ } -+ -+ public void readData(SpoutInputStream input) throws IOException { -+ action = (byte) input.read(); -+ screen = (byte) input.read(); -+ } -+ -+ public void writeData(SpoutOutputStream output) throws IOException { -+ output.write(action); -+ output.write(screen); -+ } -+ -+ public void run(int playerId) { -+ switch(ScreenAction.getScreenActionFromId(action)) { -+ case Open: -+ SpoutClient.getHandle().displayPreviousScreen(); -+ break; -+ case Close: -+ SpoutClient.getHandle().displayPreviousScreen(); -+ break; -+ case Force_Close: -+ SpoutClient.getHandle().displayGuiScreen(null, false); -+ break; -+ } -+ } -+ -+ public PacketType getPacketType() { -+ return PacketType.PacketScreenAction; -+ } -+ -+ public int getVersion() { -+ return 2; -+ } -+ -+ public void failure(int playerId) { -+ } -+} ---- net/minecraft/src/IMob.java -+++ net/minecraft/src/IMob.java -@@ -1,5 +1,7 @@ - package net.minecraft.src; - - public interface IMob extends IAnimals { -+ -+ /** Entity selector for IMob types. */ - IEntitySelector mobSelector = new FilterIMob(); - } ---- /dev/null -+++ org/spoutcraft/api/gui/Rectangle.java -@@ -1,0 +1,209 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.api.gui; -+ -+import org.apache.commons.lang3.builder.EqualsBuilder; -+import org.apache.commons.lang3.builder.HashCodeBuilder; -+ -+import org.spoutcraft.api.UnsafeClass; -+import org.spoutcraft.api.animation.Animatable; -+import org.spoutcraft.api.property.Property; -+import org.spoutcraft.api.property.PropertyInterface; -+import org.spoutcraft.api.property.PropertyObject; -+ -+@UnsafeClass -+public class Rectangle extends PropertyObject implements PropertyInterface, Animatable { -+ int width, height, x, y; -+ -+ public Rectangle(int x, int y, int width, int height) { -+ setX(x); -+ setY(y); -+ setWidth(width); -+ setHeight(height); -+ -+ initProperties(); -+ } -+ -+ private void initProperties() { -+ addProperty("x", new Property() { -+ public void set(Object value) { -+ setX((Integer) value); -+ } -+ -+ public Object get() { -+ return getX(); -+ } -+ }); -+ addProperty("y", new Property() { -+ public void set(Object value) { -+ setY((Integer) value); -+ } -+ -+ public Object get() { -+ return getY(); -+ } -+ }); -+ addProperty("width", new Property() { -+ public void set(Object value) { -+ setWidth((Integer) value); -+ } -+ -+ public Object get() { -+ return getWidth(); -+ } -+ }); -+ addProperty("height", new Property() { -+ public void set(Object value) { -+ setHeight((Integer) value); -+ } -+ -+ public Object get() { -+ return getHeight(); -+ } -+ }); -+ } -+ -+ public int getWidth() { -+ return width; -+ } -+ -+ public void setWidth(int width) { -+ this.width = width; -+ } -+ -+ public int getHeight() { -+ return height; -+ } -+ -+ public void setHeight(int height) { -+ this.height = height; -+ } -+ -+ public int getX() { -+ return x; -+ } -+ -+ public void setX(int x) { -+ this.x = x; -+ } -+ -+ public int getY() { -+ return y; -+ } -+ -+ public void setY(int y) { -+ this.y = y; -+ } -+ -+ public int getTop() { -+ return getY(); -+ } -+ -+ public int getLeft() { -+ return getX(); -+ } -+ -+ public int getBottom() { -+ return getY() + getHeight(); -+ } -+ -+ public int getRight() { -+ return getX() + getWidth(); -+ } -+ -+ /** -+ * Shifts the position by given x and y. -+ * @param x -+ * @param y -+ */ -+ public void moveBy(int x, int y) { -+ this.x += x; -+ this.y += y; -+ } -+ -+ /** -+ * Resizes the rect with given width and height -+ * @param width -+ * @param height -+ */ -+ public void resize(int width, int height) { -+ this.width = width; -+ this.height = height; -+ } -+ -+ /** -+ * Moves rect to given x and y position. -+ * @param x -+ * @param y -+ */ -+ public void move(int x, int y) { -+ this.x = x; -+ this.y = y; -+ } -+ -+ public Animatable getValueAt(double p, Animatable startValue, Animatable endValue) { -+ int w, h, x, y; -+ Rectangle p1 = (Rectangle) startValue; -+ Rectangle p2 = (Rectangle) endValue; -+ h = p1.height; -+ w = p1.width; -+ x = p1.x; -+ y = p1.y; -+ h += (p2.height - h) * p; -+ w += (p2.width - w) * p; -+ x += (p2.x - x) * p; -+ y += (p2.y - y) * p; -+ return new Rectangle(x, y, w, h); -+ } -+ -+ @Override -+ public boolean equals(Object obj) { -+ if (obj instanceof Rectangle) { -+ Rectangle other = (Rectangle) obj; -+ return (new EqualsBuilder()).append(width, other.width).append(height, other.height).append(x, other.x).append(y, other.y).isEquals(); -+ } -+ return false; -+ } -+ -+ @Override -+ public int hashCode() { -+ return (new HashCodeBuilder()).append(width).append(height).append(x).append(y).toHashCode(); -+ } -+ -+ @Override -+ public String toString() { -+ return super.toString() + "{ x: " + x + " y: " + y + " width: " + width + " height: " + height + " }"; -+ } -+ -+ public Rectangle clone() { -+ return new Rectangle(x, y, width, height); -+ } -+ -+ /** -+ * Copies the values from the other instance to this instance -+ * @param other the Rectangle to copy the values from. -+ */ -+ public void copy(Rectangle other) { -+ setX(other.x); -+ setY(other.y); -+ setWidth(other.width); -+ setHeight(other.height); -+ } -+} ---- net/minecraft/src/EntityAIBeg.java -+++ net/minecraft/src/EntityAIBeg.java -@@ -7,39 +7,57 @@ - private float minPlayerDistance; - private int field_75384_e; - -- public EntityAIBeg(EntityWolf var1, float var2) { -- this.theWolf = var1; -- this.worldObject = var1.worldObj; -- this.minPlayerDistance = var2; -+ public EntityAIBeg(EntityWolf par1EntityWolf, float par2) { -+ this.theWolf = par1EntityWolf; -+ this.worldObject = par1EntityWolf.worldObj; -+ this.minPlayerDistance = par2; - this.setMutexBits(2); - } - -+ /** -+ * Returns whether the EntityAIBase should begin execution. -+ */ - public boolean shouldExecute() { - this.thePlayer = this.worldObject.getClosestPlayerToEntity(this.theWolf, (double)this.minPlayerDistance); - return this.thePlayer == null ? false : this.hasPlayerGotBoneInHand(this.thePlayer); - } - -+ /** -+ * Returns whether an in-progress EntityAIBase should continue executing -+ */ - public boolean continueExecuting() { - return !this.thePlayer.isEntityAlive() ? false : (this.theWolf.getDistanceSqToEntity(this.thePlayer) > (double)(this.minPlayerDistance * this.minPlayerDistance) ? false : this.field_75384_e > 0 && this.hasPlayerGotBoneInHand(this.thePlayer)); - } - -+ /** -+ * Execute a one shot task or start executing a continuous task -+ */ - public void startExecuting() { - this.theWolf.func_70918_i(true); - this.field_75384_e = 40 + this.theWolf.getRNG().nextInt(40); - } - -+ /** -+ * Resets the task -+ */ - public void resetTask() { - this.theWolf.func_70918_i(false); - this.thePlayer = null; - } - -+ /** -+ * Updates the task -+ */ - public void updateTask() { - this.theWolf.getLookHelper().setLookPosition(this.thePlayer.posX, this.thePlayer.posY + (double)this.thePlayer.getEyeHeight(), this.thePlayer.posZ, 10.0F, (float)this.theWolf.getVerticalFaceSpeed()); - --this.field_75384_e; - } - -- private boolean hasPlayerGotBoneInHand(EntityPlayer var1) { -- ItemStack var2 = var1.inventory.getCurrentItem(); -+ /** -+ * Gets if the Player has the Bone in the hand. -+ */ -+ private boolean hasPlayerGotBoneInHand(EntityPlayer par1EntityPlayer) { -+ ItemStack var2 = par1EntityPlayer.inventory.getCurrentItem(); - return var2 == null ? false : (!this.theWolf.isTamed() && var2.itemID == Item.bone.itemID ? true : this.theWolf.isBreedingItem(var2)); - } - } ---- net/minecraft/src/ItemBow.java -+++ net/minecraft/src/ItemBow.java -@@ -1,99 +1,121 @@ - package net.minecraft.src; - - public class ItemBow extends Item { -- public static final String[] a = new String[]{"pulling_0", "pulling_1", "pulling_2"}; -+ public static final String[] bowPullIconNameArray = new String[] {"pulling_0", "pulling_1", "pulling_2"}; - private Icon[] iconArray; - -- public ItemBow(int var1) { -- super(var1); -+ public ItemBow(int par1) { -+ super(par1); - this.maxStackSize = 1; - this.setMaxDamage(384); - this.setCreativeTab(CreativeTabs.tabCombat); - } - -- public void onPlayerStoppedUsing(ItemStack var1, World var2, EntityPlayer var3, int var4) { -- boolean var5 = var3.capabilities.isCreativeMode || EnchantmentHelper.getEnchantmentLevel(Enchantment.infinity.effectId, var1) > 0; -- if(var5 || var3.inventory.hasItem(Item.arrow.itemID)) { -- int var6 = this.getMaxItemUseDuration(var1) - var4; -+ /** -+ * called when the player releases the use item button. Args: itemstack, world, entityplayer, itemInUseCount -+ */ -+ public void onPlayerStoppedUsing(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer, int par4) { -+ boolean var5 = par3EntityPlayer.capabilities.isCreativeMode || EnchantmentHelper.getEnchantmentLevel(Enchantment.infinity.effectId, par1ItemStack) > 0; -+ -+ if (var5 || par3EntityPlayer.inventory.hasItem(Item.arrow.itemID)) { -+ int var6 = this.getMaxItemUseDuration(par1ItemStack) - par4; - float var7 = (float)var6 / 20.0F; - var7 = (var7 * var7 + var7 * 2.0F) / 3.0F; -- if((double)var7 < 0.1D) { -+ -+ if ((double)var7 < 0.1D) { - return; - } - -- if(var7 > 1.0F) { -+ if (var7 > 1.0F) { - var7 = 1.0F; - } - -- EntityArrow var8 = new EntityArrow(var2, var3, var7 * 2.0F); -- if(var7 == 1.0F) { -+ EntityArrow var8 = new EntityArrow(par2World, par3EntityPlayer, var7 * 2.0F); -+ -+ if (var7 == 1.0F) { - var8.setIsCritical(true); - } - -- int var9 = EnchantmentHelper.getEnchantmentLevel(Enchantment.power.effectId, var1); -- if(var9 > 0) { -+ int var9 = EnchantmentHelper.getEnchantmentLevel(Enchantment.power.effectId, par1ItemStack); -+ -+ if (var9 > 0) { - var8.setDamage(var8.getDamage() + (double)var9 * 0.5D + 0.5D); - } - -- int var10 = EnchantmentHelper.getEnchantmentLevel(Enchantment.punch.effectId, var1); -- if(var10 > 0) { -+ int var10 = EnchantmentHelper.getEnchantmentLevel(Enchantment.punch.effectId, par1ItemStack); -+ -+ if (var10 > 0) { - var8.setKnockbackStrength(var10); - } - -- if(EnchantmentHelper.getEnchantmentLevel(Enchantment.flame.effectId, var1) > 0) { -+ if (EnchantmentHelper.getEnchantmentLevel(Enchantment.flame.effectId, par1ItemStack) > 0) { - var8.setFire(100); - } - -- var1.damageItem(1, var3); -- var2.playSoundAtEntity(var3, "random.bow", 1.0F, 1.0F / (f.nextFloat() * 0.4F + 1.2F) + var7 * 0.5F); -- if(var5) { -+ par1ItemStack.damageItem(1, par3EntityPlayer); -+ par2World.playSoundAtEntity(par3EntityPlayer, "random.bow", 1.0F, 1.0F / (itemRand.nextFloat() * 0.4F + 1.2F) + var7 * 0.5F); -+ -+ if (var5) { - var8.canBePickedUp = 2; - } else { -- var3.inventory.consumeInventoryItem(Item.arrow.itemID); -+ par3EntityPlayer.inventory.consumeInventoryItem(Item.arrow.itemID); - } - -- if(!var2.isRemote) { -- var2.spawnEntityInWorld(var8); -+ if (!par2World.isRemote) { -+ par2World.spawnEntityInWorld(var8); - } - } -- -- } -- -- public ItemStack onEaten(ItemStack var1, World var2, EntityPlayer var3) { -- return var1; -- } -- -- public int getMaxItemUseDuration(ItemStack var1) { -+ } -+ -+ public ItemStack onEaten(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) { -+ return par1ItemStack; -+ } -+ -+ /** -+ * How long it takes to use or consume an item -+ */ -+ public int getMaxItemUseDuration(ItemStack par1ItemStack) { - return 72000; - } - -- public EnumAction getItemUseAction(ItemStack var1) { -+ /** -+ * returns the action that specifies what animation to play when the items is being used -+ */ -+ public EnumAction getItemUseAction(ItemStack par1ItemStack) { - return EnumAction.bow; - } - -- public ItemStack onItemRightClick(ItemStack var1, World var2, EntityPlayer var3) { -- if(var3.capabilities.isCreativeMode || var3.inventory.hasItem(Item.arrow.itemID)) { -- var3.setItemInUse(var1, this.getMaxItemUseDuration(var1)); -+ /** -+ * Called whenever this item is equipped and the right mouse button is pressed. Args: itemStack, world, entityPlayer -+ */ -+ public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) { -+ if (par3EntityPlayer.capabilities.isCreativeMode || par3EntityPlayer.inventory.hasItem(Item.arrow.itemID)) { -+ par3EntityPlayer.setItemInUse(par1ItemStack, this.getMaxItemUseDuration(par1ItemStack)); - } - -- return var1; -+ return par1ItemStack; - } - -+ /** -+ * Return the enchantability factor of the item, most of the time is based on material. -+ */ - public int getItemEnchantability() { - return 1; - } - -- public void registerIcons(IconRegister var1) { -- this.itemIcon = var1.registerIcon(this.getIconString() + "_standby"); -- this.iconArray = new Icon[a.length]; -+ public void registerIcons(IconRegister par1IconRegister) { -+ this.itemIcon = par1IconRegister.registerIcon(this.getIconString() + "_standby"); -+ this.iconArray = new Icon[bowPullIconNameArray.length]; - -- for(int var2 = 0; var2 < this.iconArray.length; ++var2) { -- this.iconArray[var2] = var1.registerIcon(this.getIconString() + "_" + a[var2]); -+ for (int var2 = 0; var2 < this.iconArray.length; ++var2) { -+ this.iconArray[var2] = par1IconRegister.registerIcon(this.getIconString() + "_" + bowPullIconNameArray[var2]); - } -- - } - -- public Icon getItemIconForUseDuration(int var1) { -- return this.iconArray[var1]; -+ /** -+ * used to cycle through icons based on their used duration, i.e. for the bow -+ */ -+ public Icon getItemIconForUseDuration(int par1) { -+ return this.iconArray[par1]; - } - } ---- /dev/null -+++ org/spoutcraft/api/gui/ListWidgetItem.java -@@ -1,0 +1,59 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.api.gui; -+ -+import org.spoutcraft.api.UnsafeClass; -+ -+@UnsafeClass -+public interface ListWidgetItem { -+ /** -+ * Set the parent listwidget -+ * @param widget the parent widget -+ */ -+ public void setListWidget(ListWidget widget); -+ -+ /** -+ * Gets the parent listwidget -+ * @returns parent widget -+ */ -+ public ListWidget getListWidget(); -+ -+ /** -+ * @return the height of the content of the item. -+ */ -+ public int getHeight(); -+ -+ /** -+ * Renders the item. -+ * @param x position of the item -+ * @param y position of the item -+ * @param width of the item -+ * @param height of the item -+ */ -+ public void render(int x, int y, int width, int height); -+ -+ /** -+ * Will be called when someone clicks on this item -+ * @param x the relative x position where the item was clicked -+ * @param y the relative y position where the item was clicked -+ * @param doubleClick wether the item has been doubleclicked -+ */ -+ public void onClick(int x, int y, boolean doubleClick); -+} ---- net/minecraft/src/PlayerControllerMP.java -+++ net/minecraft/src/PlayerControllerMP.java -@@ -1,76 +1,126 @@ - package net.minecraft.src; - - public class PlayerControllerMP { -+ -+ /** The Minecraft instance. */ - private final Minecraft mc; - private final NetClientHandler netClientHandler; -+ -+ /** PosX of the current block being destroyed */ - private int currentBlockX = -1; -+ -+ /** PosY of the current block being destroyed */ - private int currentBlockY = -1; -+ -+ /** PosZ of the current block being destroyed */ - private int currentblockZ = -1; - private ItemStack field_85183_f; -+ -+ /** Current block damage (MP) */ - private float curBlockDamageMP; -+ -+ /** -+ * Tick counter, when it hits 4 it resets back to 0 and plays the step sound -+ */ - private float stepSoundTickCounter; -+ -+ /** -+ * Delays the first damage on the block after the first click on the block -+ */ - private int blockHitDelay; -+ -+ /** Tells if the player is hitting a block */ - private boolean isHittingBlock; -- private EnumGameType currentGameType = EnumGameType.SURVIVAL; -+ -+ /** Current game type for the player */ -+ private EnumGameType currentGameType; -+ -+ /** Index of the current item held by the player in the inventory hotbar */ - private int currentPlayerItem; - -- public PlayerControllerMP(Minecraft var1, NetClientHandler var2) { -- this.mc = var1; -- this.netClientHandler = var2; -+ public PlayerControllerMP(Minecraft par1Minecraft, NetClientHandler par2NetClientHandler) { -+ this.currentGameType = EnumGameType.SURVIVAL; -+ this.mc = par1Minecraft; -+ this.netClientHandler = par2NetClientHandler; - } - -- public static void clickBlockCreative(Minecraft var0, PlayerControllerMP var1, int var2, int var3, int var4, int var5) { -- if(!var0.theWorld.extinguishFire(var0.thePlayer, var2, var3, var4, var5)) { -- var1.onPlayerDestroyBlock(var2, var3, var4, var5); -+ /** -+ * Block dig operation in creative mode (instantly digs the block). -+ */ -+ public static void clickBlockCreative(Minecraft par0Minecraft, PlayerControllerMP par1PlayerControllerMP, int par2, int par3, int par4, int par5) { -+ if (!par0Minecraft.theWorld.extinguishFire(par0Minecraft.thePlayer, par2, par3, par4, par5)) { -+ par1PlayerControllerMP.onPlayerDestroyBlock(par2, par3, par4, par5); - } -- -- } -- -- public void setPlayerCapabilities(EntityPlayer var1) { -- this.currentGameType.configurePlayerCapabilities(var1.capabilities); -- } -- -+ } -+ -+ /** -+ * Sets player capabilities depending on current gametype. params: player -+ */ -+ public void setPlayerCapabilities(EntityPlayer par1EntityPlayer) { -+ this.currentGameType.configurePlayerCapabilities(par1EntityPlayer.capabilities); -+ } -+ -+ /** -+ * If modified to return true, the player spins around slowly around (0, 68.5, 0). The GUI is disabled, the view is set -+ * to first person, and both chat and menu are disabled. Unless the server is modified to ignore illegal stances, -+ * attempting to enter a world at all will result in an immediate kick due to an illegal stance. Appears to be left- -+ * over debug, or demo code. -+ */ - public boolean enableEverythingIsScrewedUpMode() { - return false; - } - -- public void setGameType(EnumGameType var1) { -- this.currentGameType = var1; -+ /** -+ * Sets the game type for the player. -+ */ -+ public void setGameType(EnumGameType par1EnumGameType) { -+ this.currentGameType = par1EnumGameType; - this.currentGameType.configurePlayerCapabilities(this.mc.thePlayer.capabilities); - } - -- public void flipPlayer(EntityPlayer var1) { -- var1.rotationYaw = -180.0F; -+ /** -+ * Flips the player around. Args: player -+ */ -+ public void flipPlayer(EntityPlayer par1EntityPlayer) { -+ par1EntityPlayer.rotationYaw = -180.0F; - } - - public boolean shouldDrawHUD() { - return this.currentGameType.isSurvivalOrAdventure(); - } - -- public boolean onPlayerDestroyBlock(int var1, int var2, int var3, int var4) { -- if(this.currentGameType.isAdventure() && !this.mc.thePlayer.isCurrentToolAdventureModeExempt(var1, var2, var3)) { -+ /** -+ * Called when a player completes the destruction of a block -+ */ -+ public boolean onPlayerDestroyBlock(int par1, int par2, int par3, int par4) { -+ if (this.currentGameType.isAdventure() && !this.mc.thePlayer.isCurrentToolAdventureModeExempt(par1, par2, par3)) { - return false; -- } else if(this.currentGameType.isCreative() && this.mc.thePlayer.getHeldItem() != null && this.mc.thePlayer.getHeldItem().getItem() instanceof ItemSword) { -+ } else if (this.currentGameType.isCreative() && this.mc.thePlayer.getHeldItem() != null && this.mc.thePlayer.getHeldItem().getItem() instanceof ItemSword) { - return false; - } else { - WorldClient var5 = this.mc.theWorld; -- Block var6 = Block.blocksList[var5.getBlockId(var1, var2, var3)]; -- if(var6 == null) { -+ Block var6 = Block.blocksList[var5.getBlockId(par1, par2, par3)]; -+ -+ if (var6 == null) { - return false; - } else { -- var5.playAuxSFX(2001, var1, var2, var3, var6.blockID + (var5.getBlockMetadata(var1, var2, var3) << 12)); -- int var7 = var5.getBlockMetadata(var1, var2, var3); -- boolean var8 = var5.setBlockToAir(var1, var2, var3); -- if(var8) { -- var6.onBlockDestroyedByPlayer(var5, var1, var2, var3, var7); -+ var5.playAuxSFX(2001, par1, par2, par3, var6.blockID + (var5.getBlockMetadata(par1, par2, par3) << 12)); -+ int var7 = var5.getBlockMetadata(par1, par2, par3); -+ boolean var8 = var5.setBlockToAir(par1, par2, par3); -+ -+ if (var8) { -+ var6.onBlockDestroyedByPlayer(var5, par1, par2, par3, var7); - } - - this.currentBlockY = -1; -- if(!this.currentGameType.isCreative()) { -+ -+ if (!this.currentGameType.isCreative()) { - ItemStack var9 = this.mc.thePlayer.getCurrentEquippedItem(); -- if(var9 != null) { -- var9.onBlockDestroyed(var5, var6.blockID, var1, var2, var3, this.mc.thePlayer); -- if(var9.stackSize == 0) { -+ -+ if (var9 != null) { -+ var9.onBlockDestroyed(var5, var6.blockID, par1, par2, par3, this.mc.thePlayer); -+ -+ if (var9.stackSize == 0) { - this.mc.thePlayer.destroyCurrentEquippedItem(); - } - } -@@ -81,42 +131,50 @@ - } - } - -- public void clickBlock(int var1, int var2, int var3, int var4) { -- if(!this.currentGameType.isAdventure() || this.mc.thePlayer.isCurrentToolAdventureModeExempt(var1, var2, var3)) { -- if(this.currentGameType.isCreative()) { -- this.netClientHandler.addToSendQueue(new Packet14BlockDig(0, var1, var2, var3, var4)); -- clickBlockCreative(this.mc, this, var1, var2, var3, var4); -+ /** -+ * Called by Minecraft class when the player is hitting a block with an item. Args: x, y, z, side -+ */ -+ public void clickBlock(int par1, int par2, int par3, int par4) { -+ if (!this.currentGameType.isAdventure() || this.mc.thePlayer.isCurrentToolAdventureModeExempt(par1, par2, par3)) { -+ if (this.currentGameType.isCreative()) { -+ this.netClientHandler.addToSendQueue(new Packet14BlockDig(0, par1, par2, par3, par4)); -+ clickBlockCreative(this.mc, this, par1, par2, par3, par4); - this.blockHitDelay = 5; -- } else if(!this.isHittingBlock || !this.sameToolAndBlock(var1, var2, var3)) { -- if(this.isHittingBlock) { -- this.netClientHandler.addToSendQueue(new Packet14BlockDig(1, this.currentBlockX, this.currentBlockY, this.currentblockZ, var4)); -- } -- -- this.netClientHandler.addToSendQueue(new Packet14BlockDig(0, var1, var2, var3, var4)); -- int var5 = this.mc.theWorld.getBlockId(var1, var2, var3); -- if(var5 > 0 && this.curBlockDamageMP == 0.0F) { -- Block.blocksList[var5].onBlockClicked(this.mc.theWorld, var1, var2, var3, this.mc.thePlayer); -- } -- -- if(var5 > 0 && Block.blocksList[var5].getPlayerRelativeBlockHardness(this.mc.thePlayer, this.mc.thePlayer.worldObj, var1, var2, var3) >= 1.0F) { -- this.onPlayerDestroyBlock(var1, var2, var3, var4); -+ } else if (!this.isHittingBlock || !this.sameToolAndBlock(par1, par2, par3)) { -+ if (this.isHittingBlock) { -+ this.netClientHandler.addToSendQueue(new Packet14BlockDig(1, this.currentBlockX, this.currentBlockY, this.currentblockZ, par4)); -+ } -+ -+ this.netClientHandler.addToSendQueue(new Packet14BlockDig(0, par1, par2, par3, par4)); -+ int var5 = this.mc.theWorld.getBlockId(par1, par2, par3); -+ -+ if (var5 > 0 && this.curBlockDamageMP == 0.0F) { -+ Block.blocksList[var5].onBlockClicked(this.mc.theWorld, par1, par2, par3, this.mc.thePlayer); -+ } -+ -+ // Spout Start -+ if (var5 > 0 && Block.blocksList[var5].getPlayerRelativeBlockHardness(this.mc.thePlayer) >= 1.0F) { -+ // Spout End -+ this.onPlayerDestroyBlock(par1, par2, par3, par4); - } else { - this.isHittingBlock = true; -- this.currentBlockX = var1; -- this.currentBlockY = var2; -- this.currentblockZ = var3; -+ this.currentBlockX = par1; -+ this.currentBlockY = par2; -+ this.currentblockZ = par3; - this.field_85183_f = this.mc.thePlayer.getHeldItem(); - this.curBlockDamageMP = 0.0F; - this.stepSoundTickCounter = 0.0F; - this.mc.theWorld.destroyBlockInWorldPartially(this.mc.thePlayer.entityId, this.currentBlockX, this.currentBlockY, this.currentblockZ, (int)(this.curBlockDamageMP * 10.0F) - 1); - } - } -- - } - } - -+ /** -+ * Resets current block damage and isHittingBlock -+ */ - public void resetBlockRemoving() { -- if(this.isHittingBlock) { -+ if (this.isHittingBlock) { - this.netClientHandler.addToSendQueue(new Packet14BlockDig(1, this.currentBlockX, this.currentBlockY, this.currentblockZ, -1)); - } - -@@ -125,33 +183,42 @@ - this.mc.theWorld.destroyBlockInWorldPartially(this.mc.thePlayer.entityId, this.currentBlockX, this.currentBlockY, this.currentblockZ, -1); - } - -- public void onPlayerDamageBlock(int var1, int var2, int var3, int var4) { -+ /** -+ * Called when a player damages a block and updates damage counters -+ */ -+ public void onPlayerDamageBlock(int par1, int par2, int par3, int par4) { - this.syncCurrentPlayItem(); -- if(this.blockHitDelay > 0) { -+ -+ if (this.blockHitDelay > 0) { - --this.blockHitDelay; -- } else if(this.currentGameType.isCreative()) { -+ } else if (this.currentGameType.isCreative()) { - this.blockHitDelay = 5; -- this.netClientHandler.addToSendQueue(new Packet14BlockDig(0, var1, var2, var3, var4)); -- clickBlockCreative(this.mc, this, var1, var2, var3, var4); -+ this.netClientHandler.addToSendQueue(new Packet14BlockDig(0, par1, par2, par3, par4)); -+ clickBlockCreative(this.mc, this, par1, par2, par3, par4); - } else { -- if(this.sameToolAndBlock(var1, var2, var3)) { -- int var5 = this.mc.theWorld.getBlockId(var1, var2, var3); -- if(var5 == 0) { -+ if (this.sameToolAndBlock(par1, par2, par3)) { -+ int var5 = this.mc.theWorld.getBlockId(par1, par2, par3); -+ -+ if (var5 == 0) { - this.isHittingBlock = false; - return; - } - - Block var6 = Block.blocksList[var5]; -- this.curBlockDamageMP += var6.getPlayerRelativeBlockHardness(this.mc.thePlayer, this.mc.thePlayer.worldObj, var1, var2, var3); -- if(this.stepSoundTickCounter % 4.0F == 0.0F && var6 != null) { -- this.mc.sndManager.playSound(var6.stepSound.getStepSound(), (float)var1 + 0.5F, (float)var2 + 0.5F, (float)var3 + 0.5F, (var6.stepSound.getVolume() + 1.0F) / 8.0F, var6.stepSound.getPitch() * 0.5F); -+ // Spout Start -+ this.curBlockDamageMP += var6.getPlayerRelativeBlockHardness(this.mc.thePlayer); -+ // Spout End -+ -+ if (this.stepSoundTickCounter % 4.0F == 0.0F && var6 != null) { -+ this.mc.sndManager.playSound(var6.stepSound.getStepSound(), (float)par1 + 0.5F, (float)par2 + 0.5F, (float)par3 + 0.5F, (var6.stepSound.getVolume() + 1.0F) / 8.0F, var6.stepSound.getPitch() * 0.5F); - } - - ++this.stepSoundTickCounter; -- if(this.curBlockDamageMP >= 1.0F) { -+ -+ if (this.curBlockDamageMP >= 1.0F) { - this.isHittingBlock = false; -- this.netClientHandler.addToSendQueue(new Packet14BlockDig(2, var1, var2, var3, var4)); -- this.onPlayerDestroyBlock(var1, var2, var3, var4); -+ this.netClientHandler.addToSendQueue(new Packet14BlockDig(2, par1, par2, par3, par4)); -+ this.onPlayerDestroyBlock(par1, par2, par3, par4); - this.curBlockDamageMP = 0.0F; - this.stepSoundTickCounter = 0.0F; - this.blockHitDelay = 5; -@@ -159,12 +226,14 @@ - - this.mc.theWorld.destroyBlockInWorldPartially(this.mc.thePlayer.entityId, this.currentBlockX, this.currentBlockY, this.currentblockZ, (int)(this.curBlockDamageMP * 10.0F) - 1); - } else { -- this.clickBlock(var1, var2, var3, var4); -+ this.clickBlock(par1, par2, par3, par4); - } -- - } - } - -+ /** -+ * player reach distance = 4F -+ */ - public float getBlockReachDistance() { - return this.currentGameType.isCreative() ? 5.0F : 4.5F; - } -@@ -174,143 +243,176 @@ - this.mc.sndManager.playRandomMusicIfReady(); - } - -- private boolean sameToolAndBlock(int var1, int var2, int var3) { -+ private boolean sameToolAndBlock(int par1, int par2, int par3) { - ItemStack var4 = this.mc.thePlayer.getHeldItem(); - boolean var5 = this.field_85183_f == null && var4 == null; -- if(this.field_85183_f != null && var4 != null) { -+ -+ if (this.field_85183_f != null && var4 != null) { - var5 = var4.itemID == this.field_85183_f.itemID && ItemStack.areItemStackTagsEqual(var4, this.field_85183_f) && (var4.isItemStackDamageable() || var4.getItemDamage() == this.field_85183_f.getItemDamage()); - } - -- return var1 == this.currentBlockX && var2 == this.currentBlockY && var3 == this.currentblockZ && var5; -+ return par1 == this.currentBlockX && par2 == this.currentBlockY && par3 == this.currentblockZ && var5; - } - -+ /** -+ * Syncs the current player item with the server -+ */ - private void syncCurrentPlayItem() { - int var1 = this.mc.thePlayer.inventory.currentItem; -- if(var1 != this.currentPlayerItem) { -+ -+ if (var1 != this.currentPlayerItem) { - this.currentPlayerItem = var1; - this.netClientHandler.addToSendQueue(new Packet16BlockItemSwitch(this.currentPlayerItem)); - } -- - } - -- public boolean onPlayerRightClick(EntityPlayer var1, World var2, ItemStack var3, int var4, int var5, int var6, int var7, Vec3 var8) { -+ /** -+ * Handles a players right click. Args: player, world, x, y, z, side, hitVec -+ */ -+ public boolean onPlayerRightClick(EntityPlayer par1EntityPlayer, World par2World, ItemStack par3ItemStack, int par4, int par5, int par6, int par7, Vec3 par8Vec3) { - this.syncCurrentPlayItem(); -- float var9 = (float)var8.xCoord - (float)var4; -- float var10 = (float)var8.yCoord - (float)var5; -- float var11 = (float)var8.zCoord - (float)var6; -+ float var9 = (float)par8Vec3.xCoord - (float)par4; -+ float var10 = (float)par8Vec3.yCoord - (float)par5; -+ float var11 = (float)par8Vec3.zCoord - (float)par6; - boolean var12 = false; - int var13; -- if(!var1.isSneaking() || var1.getHeldItem() == null) { -- var13 = var2.getBlockId(var4, var5, var6); -- if(var13 > 0 && Block.blocksList[var13].onBlockActivated(var2, var4, var5, var6, var1, var7, var9, var10, var11)) { -+ -+ if (!par1EntityPlayer.isSneaking() || par1EntityPlayer.getHeldItem() == null) { -+ var13 = par2World.getBlockId(par4, par5, par6); -+ -+ if (var13 > 0 && Block.blocksList[var13].onBlockActivated(par2World, par4, par5, par6, par1EntityPlayer, par7, var9, var10, var11)) { - var12 = true; - } - } - -- if(!var12 && var3 != null && var3.getItem() instanceof ItemBlock) { -- ItemBlock var16 = (ItemBlock)var3.getItem(); -- if(!var16.canPlaceItemBlockOnSide(var2, var4, var5, var6, var7, var1, var3)) { -+ if (!var12 && par3ItemStack != null && par3ItemStack.getItem() instanceof ItemBlock) { -+ ItemBlock var16 = (ItemBlock)par3ItemStack.getItem(); -+ -+ if (!var16.canPlaceItemBlockOnSide(par2World, par4, par5, par6, par7, par1EntityPlayer, par3ItemStack)) { - return false; - } - } - -- this.netClientHandler.addToSendQueue(new Packet15Place(var4, var5, var6, var7, var1.inventory.getCurrentItem(), var9, var10, var11)); -- if(var12) { -+ this.netClientHandler.addToSendQueue(new Packet15Place(par4, par5, par6, par7, par1EntityPlayer.inventory.getCurrentItem(), var9, var10, var11)); -+ -+ if (var12) { - return true; -- } else if(var3 == null) { -+ } else if (par3ItemStack == null) { - return false; -- } else if(this.currentGameType.isCreative()) { -- var13 = var3.getItemDamage(); -- int var14 = var3.stackSize; -- boolean var15 = var3.tryPlaceItemIntoWorld(var1, var2, var4, var5, var6, var7, var9, var10, var11); -- var3.setItemDamage(var13); -- var3.stackSize = var14; -+ } else if (this.currentGameType.isCreative()) { -+ var13 = par3ItemStack.getItemDamage(); -+ int var14 = par3ItemStack.stackSize; -+ boolean var15 = par3ItemStack.tryPlaceItemIntoWorld(par1EntityPlayer, par2World, par4, par5, par6, par7, var9, var10, var11); -+ par3ItemStack.setItemDamage(var13); -+ par3ItemStack.stackSize = var14; - return var15; - } else { -- return var3.tryPlaceItemIntoWorld(var1, var2, var4, var5, var6, var7, var9, var10, var11); -+ return par3ItemStack.tryPlaceItemIntoWorld(par1EntityPlayer, par2World, par4, par5, par6, par7, var9, var10, var11); - } - } - -- public boolean sendUseItem(EntityPlayer var1, World var2, ItemStack var3) { -+ /** -+ * Notifies the server of things like consuming food, etc... -+ */ -+ public boolean sendUseItem(EntityPlayer par1EntityPlayer, World par2World, ItemStack par3ItemStack) { - this.syncCurrentPlayItem(); -- this.netClientHandler.addToSendQueue(new Packet15Place(-1, -1, -1, 255, var1.inventory.getCurrentItem(), 0.0F, 0.0F, 0.0F)); -- int var4 = var3.stackSize; -- ItemStack var5 = var3.useItemRightClick(var2, var1); -- if(var5 != var3 || var5 != null && var5.stackSize != var4) { -- var1.inventory.mainInventory[var1.inventory.currentItem] = var5; -- if(var5.stackSize == 0) { -- var1.inventory.mainInventory[var1.inventory.currentItem] = null; -+ this.netClientHandler.addToSendQueue(new Packet15Place(-1, -1, -1, 255, par1EntityPlayer.inventory.getCurrentItem(), 0.0F, 0.0F, 0.0F)); -+ int var4 = par3ItemStack.stackSize; -+ ItemStack var5 = par3ItemStack.useItemRightClick(par2World, par1EntityPlayer); -+ -+ if (var5 == par3ItemStack && (var5 == null || var5.stackSize == var4)) { -+ return false; -+ } else { -+ par1EntityPlayer.inventory.mainInventory[par1EntityPlayer.inventory.currentItem] = var5; -+ -+ if (var5.stackSize == 0) { -+ par1EntityPlayer.inventory.mainInventory[par1EntityPlayer.inventory.currentItem] = null; - } - - return true; -- } else { -- return false; - } - } - -- public EntityClientPlayerMP func_78754_a(World var1) { -- return new EntityClientPlayerMP(this.mc, var1, this.mc.getSession(), this.netClientHandler); -- } -- -- public void attackEntity(EntityPlayer var1, Entity var2) { -- this.syncCurrentPlayItem(); -- this.netClientHandler.addToSendQueue(new Packet7UseEntity(var1.entityId, var2.entityId, 1)); -- var1.attackTargetEntityWithCurrentItem(var2); -- } -- -- public boolean func_78768_b(EntityPlayer var1, Entity var2) { -- this.syncCurrentPlayItem(); -- this.netClientHandler.addToSendQueue(new Packet7UseEntity(var1.entityId, var2.entityId, 0)); -- return var1.interactWith(var2); -- } -- -- public ItemStack windowClick(int var1, int var2, int var3, int var4, EntityPlayer var5) { -- short var6 = var5.openContainer.getNextTransactionID(var5.inventory); -- ItemStack var7 = var5.openContainer.slotClick(var2, var3, var4, var5); -- this.netClientHandler.addToSendQueue(new Packet102WindowClick(var1, var2, var3, var4, var7, var6)); -+ public EntityClientPlayerMP func_78754_a(World par1World) { -+ return new EntityClientPlayerMP(this.mc, par1World, this.mc.getSession(), this.netClientHandler); -+ } -+ -+ /** -+ * Attacks an entity -+ */ -+ public void attackEntity(EntityPlayer par1EntityPlayer, Entity par2Entity) { -+ this.syncCurrentPlayItem(); -+ this.netClientHandler.addToSendQueue(new Packet7UseEntity(par1EntityPlayer.entityId, par2Entity.entityId, 1)); -+ par1EntityPlayer.attackTargetEntityWithCurrentItem(par2Entity); -+ } -+ -+ public boolean func_78768_b(EntityPlayer par1EntityPlayer, Entity par2Entity) { -+ this.syncCurrentPlayItem(); -+ this.netClientHandler.addToSendQueue(new Packet7UseEntity(par1EntityPlayer.entityId, par2Entity.entityId, 0)); -+ return par1EntityPlayer.interactWith(par2Entity); -+ } -+ -+ public ItemStack windowClick(int par1, int par2, int par3, int par4, EntityPlayer par5EntityPlayer) { -+ short var6 = par5EntityPlayer.openContainer.getNextTransactionID(par5EntityPlayer.inventory); -+ ItemStack var7 = par5EntityPlayer.openContainer.slotClick(par2, par3, par4, par5EntityPlayer); -+ this.netClientHandler.addToSendQueue(new Packet102WindowClick(par1, par2, par3, par4, var7, var6)); - return var7; - } - -- public void sendEnchantPacket(int var1, int var2) { -- this.netClientHandler.addToSendQueue(new Packet108EnchantItem(var1, var2)); -- } -- -- public void sendSlotPacket(ItemStack var1, int var2) { -- if(this.currentGameType.isCreative()) { -- this.netClientHandler.addToSendQueue(new Packet107CreativeSetSlot(var2, var1)); -- } -- -- } -- -- public void func_78752_a(ItemStack var1) { -- if(this.currentGameType.isCreative() && var1 != null) { -- this.netClientHandler.addToSendQueue(new Packet107CreativeSetSlot(-1, var1)); -- } -- -- } -- -- public void onStoppedUsingItem(EntityPlayer var1) { -+ /** -+ * GuiEnchantment uses this during multiplayer to tell PlayerControllerMP to send a packet indicating the enchantment -+ * action the player has taken. -+ */ -+ public void sendEnchantPacket(int par1, int par2) { -+ this.netClientHandler.addToSendQueue(new Packet108EnchantItem(par1, par2)); -+ } -+ -+ /** -+ * Used in PlayerControllerMP to update the server with an ItemStack in a slot. -+ */ -+ public void sendSlotPacket(ItemStack par1ItemStack, int par2) { -+ if (this.currentGameType.isCreative()) { -+ this.netClientHandler.addToSendQueue(new Packet107CreativeSetSlot(par2, par1ItemStack)); -+ } -+ } -+ -+ public void func_78752_a(ItemStack par1ItemStack) { -+ if (this.currentGameType.isCreative() && par1ItemStack != null) { -+ this.netClientHandler.addToSendQueue(new Packet107CreativeSetSlot(-1, par1ItemStack)); -+ } -+ } -+ -+ public void onStoppedUsingItem(EntityPlayer par1EntityPlayer) { - this.syncCurrentPlayItem(); - this.netClientHandler.addToSendQueue(new Packet14BlockDig(5, 0, 0, 0, 255)); -- var1.stopUsingItem(); -+ par1EntityPlayer.stopUsingItem(); - } - - public boolean func_78763_f() { - return this.currentGameType.isSurvivalOrAdventure(); - } - -+ /** -+ * Checks if the player is not creative, used for checking if it should break a block instantly -+ */ - public boolean isNotCreative() { - return !this.currentGameType.isCreative(); - } - -+ /** -+ * returns true if player is in creative mode -+ */ - public boolean isInCreativeMode() { - return this.currentGameType.isCreative(); - } - -+ /** -+ * true for hitting entities far away. -+ */ - public boolean extendedReach() { - return this.currentGameType.isCreative(); - } -- -+ - public boolean func_110738_j() { - return this.mc.thePlayer.isRiding() && this.mc.thePlayer.ridingEntity instanceof EntityHorse; - } ---- /dev/null -+++ org/spoutcraft/api/gui/RenderUtil.java -@@ -1,0 +1,128 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.api.gui; -+ -+import org.lwjgl.opengl.GL11; -+ -+import org.spoutcraft.api.Spoutcraft; -+ -+public final class RenderUtil { -+ /** -+ * Draws a symmetrical polygon. Large values of segments (>50) approximate a circle. -+ * @param cx x coordinate or the center of the circle -+ * @param cy y coordinate for the center of the circle -+ * @param r radius of the circle -+ * @param numSegments to draw (number of sides to the polygon. Large values > 50 approximate a circle) -+ */ -+ public static void drawSymmetricalPolygon(float cx, float cy, float r, int numSegments) { -+ float theta = 2 * 3.1415926F / ((float)numSegments); -+ float c = (float) Math.cos(theta); // Precalculate the sine and cosine -+ float s = (float) Math.sin(theta); -+ float t; -+ -+ float x = r; // We start at angle = 0 -+ float y = 0; -+ -+ GL11.glBegin(GL11.GL_LINE_LOOP); -+ for (int ii = 0; ii < numSegments; ii++) { -+ GL11.glVertex2f(x + cx, y + cy); // Output vertex -+ -+ // Apply the rotation matrix -+ t = x; -+ x = c * x - s * y; -+ y = s * t + c * y; -+ } -+ GL11.glEnd(); -+ } -+ -+ public static void drawRectangle(int x, int y, int width, int height, int color) { -+ int temp; -+ if (x < width) { -+ temp = x; -+ x = width; -+ width = temp; -+ } -+ -+ if (y < height) { -+ temp = y; -+ y = height; -+ height = temp; -+ } -+ -+ float alpha = (float) (color >> 24 & 255) / 255.0F; -+ float red = (float) (color >> 16 & 255) / 255.0F; -+ float green = (float) (color >> 8 & 255) / 255.0F; -+ float blue = (float) (color & 255) / 255.0F; -+ GL11.glEnable(GL11.GL_BLEND); -+ GL11.glDisable(GL11.GL_TEXTURE_2D); -+ GL11.glBlendFunc(770, 771); -+ GL11.glColor4f(red, green, blue, alpha); -+ MinecraftTessellator tessellator = Spoutcraft.getTessellator(); -+ tessellator.startDrawingQuads(); -+ tessellator.addVertex((double) x, (double) height, 0.0D); -+ tessellator.addVertex((double) width, (double) height, 0.0D); -+ tessellator.addVertex((double) width, (double) y, 0.0D); -+ tessellator.addVertex((double) x, (double) y, 0.0D); -+ tessellator.draw(); -+ GL11.glEnable(GL11.GL_TEXTURE_2D); -+ GL11.glDisable(GL11.GL_BLEND); -+ } -+ -+ public static void drawGradientRectangle(int x, int y, int gradientX, int gradientY, int colorOne, int colorTwo) { -+ float alphaOne = (float) (colorOne >> 24 & 255) / 255.0F; -+ float redOne = (float) (colorOne >> 16 & 255) / 255.0F; -+ float greenOne = (float) (colorOne >> 8 & 255) / 255.0F; -+ float blueOne = (float) (colorOne & 255) / 255.0F; -+ float alphaTwo = (float) (colorTwo >> 24 & 255) / 255.0F; -+ float redTwo = (float) (colorTwo >> 16 & 255) / 255.0F; -+ float greenTwo = (float) (colorTwo >> 8 & 255) / 255.0F; -+ float blueTwo = (float) (colorTwo & 255) / 255.0F; -+ GL11.glDisable(GL11.GL_TEXTURE_2D); -+ GL11.glEnable(GL11.GL_BLEND); -+ GL11.glDisable(GL11.GL_ALPHA_TEST); -+ GL11.glBlendFunc(770, 771); -+ GL11.glShadeModel(GL11.GL_SMOOTH); -+ MinecraftTessellator tessellator = Spoutcraft.getTessellator(); -+ tessellator.startDrawingQuads(); -+ tessellator.setColorRGBAFloat(redOne, greenOne, blueOne, alphaOne); -+ tessellator.addVertex((double) gradientX, (double) y, 0.0D); -+ tessellator.addVertex((double) x, (double) y, 0.0D); -+ tessellator.setColorRGBAFloat(redTwo, greenTwo, blueTwo, alphaTwo); -+ tessellator.addVertex((double) x, (double) gradientY, 0.0D); -+ tessellator.addVertex((double) gradientX, (double) gradientY, 0.0D); -+ tessellator.draw(); -+ GL11.glShadeModel(GL11.GL_FLAT); -+ GL11.glDisable(GL11.GL_BLEND); -+ GL11.glEnable(GL11.GL_ALPHA_TEST); -+ GL11.glEnable(GL11.GL_TEXTURE_2D); -+ } -+ -+ public static void drawTexturedModalRectangle(int x, int y, int var3, int modalX, int modalY, int modalZ, float zLevel) { -+ float var7 = 0.00390625F; -+ float var8 = 0.00390625F; -+ MinecraftTessellator tessellator = Spoutcraft.getTessellator(); -+ tessellator.startDrawingQuads(); -+ tessellator.addVertexWithUV((double) x, (double) (y + modalZ), (double) zLevel, (double) ((float) (var3) * var7), (double) ((float) (modalX + modalZ) * var8)); -+ tessellator.addVertexWithUV((double) (x + modalY), (double) (y + modalZ), (double) zLevel, (double) ((float) (var3 + modalY) * var7), (double) ((float) (modalX + modalZ) * var8)); -+ tessellator.addVertexWithUV((double) (x + modalY), (double) (y), (double) zLevel, (double) ((float) (var3 + modalY) * var7), (double) ((float) (modalX) * var8)); -+ tessellator.addVertexWithUV((double) x, (double) y, (double) zLevel, (double) ((float) (var3) * var7), (double) ((float) (modalX) * var8)); -+ tessellator.draw(); -+ } -+} ---- net/minecraft/src/RecipesIngots.java -+++ net/minecraft/src/RecipesIngots.java -@@ -1,17 +1,24 @@ - package net.minecraft.src; - - public class RecipesIngots { -- private Object[][] a = new Object[][]{{Block.blockGold, new ItemStack(Item.ingotGold, 9)}, {Block.blockIron, new ItemStack(Item.ingotIron, 9)}, {Block.blockDiamond, new ItemStack(Item.diamond, 9)}, {Block.blockEmerald, new ItemStack(Item.emerald, 9)}, {Block.blockLapis, new ItemStack(Item.dyePowder, 9, 4)}, {Block.blockRedstone, new ItemStack(Item.redstone, 9)}, {Block.coalBlock, new ItemStack(Item.coal, 9, 0)}, {Block.hay, new ItemStack(Item.wheat, 9)}}; -- -- public void addRecipes(CraftingManager var1) { -- for(int var2 = 0; var2 < this.a.length; ++var2) { -- Block var3 = (Block)this.a[var2][0]; -- ItemStack var4 = (ItemStack)this.a[var2][1]; -- var1.addRecipe(new ItemStack(var3), new Object[]{"###", "###", "###", Character.valueOf('#'), var4}); -- var1.addRecipe(var4, new Object[]{"#", Character.valueOf('#'), var3}); -+ private Object[][] recipeItems; -+ -+ public RecipesIngots() { -+ this.recipeItems = new Object[][] {{Block.blockGold, new ItemStack(Item.ingotGold, 9)}, {Block.blockIron, new ItemStack(Item.ingotIron, 9)}, {Block.blockDiamond, new ItemStack(Item.diamond, 9)}, {Block.blockEmerald, new ItemStack(Item.emerald, 9)}, {Block.blockLapis, new ItemStack(Item.dyePowder, 9, 4)}, {Block.blockRedstone, new ItemStack(Item.redstone, 9)}, {Block.coalBlock, new ItemStack(Item.coal, 9, 0)}, {Block.hay, new ItemStack(Item.wheat, 9)}}; -+ } -+ -+ /** -+ * Adds the ingot recipes to the CraftingManager. -+ */ -+ public void addRecipes(CraftingManager par1CraftingManager) { -+ for (int var2 = 0; var2 < this.recipeItems.length; ++var2) { -+ Block var3 = (Block)this.recipeItems[var2][0]; -+ ItemStack var4 = (ItemStack)this.recipeItems[var2][1]; -+ par1CraftingManager.addRecipe(new ItemStack(var3), new Object[] {"###", "###", "###", '#', var4}); -+ par1CraftingManager.addRecipe(var4, new Object[] {"#", '#', var3}); - } - -- var1.addRecipe(new ItemStack(Item.ingotGold), new Object[]{"###", "###", "###", Character.valueOf('#'), Item.goldNugget}); -- var1.addRecipe(new ItemStack(Item.goldNugget, 9), new Object[]{"#", Character.valueOf('#'), Item.ingotGold}); -+ par1CraftingManager.addRecipe(new ItemStack(Item.ingotGold), new Object[] {"###", "###", "###", '#', Item.goldNugget}); -+ par1CraftingManager.addRecipe(new ItemStack(Item.goldNugget, 9), new Object[] {"#", '#', Item.ingotGold}); - } - } ---- /dev/null -+++ org/spoutcraft/api/gui/Texture.java -@@ -1,0 +1,120 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.api.gui; -+ -+import org.spoutcraft.api.UnsafeClass; -+ -+@UnsafeClass -+public interface Texture extends Widget { -+ /** -+ * Gets the url of this texture to render -+ * -+ * @return url -+ */ -+ public String getUrl(); -+ -+ /** -+ * Sets the url of this texture to render -+ * All textures must be of png type and a size that is a factor of 2 (e.g 64x128). Use the alpha channel for hiding empty space. -+ * @param url to set this texture to -+ * @return texture -+ */ -+ public Texture setUrl(String Url); -+ -+ /** -+ * Gets if the texture draws the full alpha channel instead of just using a bit-mask. -+ * @return if it's drawing the alpha channel -+ */ -+ public boolean isDrawingAlphaChannel(); -+ -+ /** -+ * Sets if the texture should draw the full alpha channel instead of just using a bit-mask. -+ * @param draw to set the drawing state -+ * @return texture -+ */ -+ public Texture setDrawAlphaChannel(boolean draw); -+ -+ /** -+ * Set the offset to the top of the image. -+ * Setting this to a anything other than -1 will draw a 1:1 slice of the -+ * texture rather than scaling it to fit the width and height. -+ * @param top the top offset -+ * @return texture -+ */ -+ public Texture setTop(int top); -+ -+ /** -+ * Get the offset to the top of the image. -+ * @return top offset -+ */ -+ public int getTop(); -+ -+ /** -+ * Set the offset to the left of the image. -+ * Setting this to a anything other than -1 will draw a 1:1 slice of the -+ * texture rather than scaling it to fit the width and height. -+ * @param left the left offset -+ * @return texture -+ */ -+ public Texture setLeft(int left); -+ -+ /** -+ * Get the offset to the left of the image. -+ * @return left offset -+ */ -+ public int getLeft(); -+ -+ /** -+ * @see setFinishDelegate -+ * @return the finishdelegate -+ */ -+ public Runnable getFinishDelegate(); -+ -+ /** -+ * Given deleages run()-method will be called when the download of the image has been completed. -+ * The internal delegate-variable will be set to null after that. -+ * @param finishDelegate -+ * @return instance of the texture -+ */ -+ public Texture setFinishDelegate(Runnable finishDelegate); -+ -+ /** -+ * @return the actual width of the image -+ */ -+ public int getOriginalWidth(); -+ -+ /** -+ * @return the actual height of the image -+ */ -+ public int getOriginalHeight(); -+ -+ /** -+ * True if this texture is a local texture (inside the minecraft or spoutcraft jar) -+ * @return local texture -+ */ -+ public boolean isLocal(); -+ -+ /** -+ * Marks this as a texture that is local (inside the minecraft or spoutcraft jar) -+ * @param value to set -+ * @return this -+ */ -+ public Texture setLocal(boolean value); -+} ---- net/minecraft/src/SlotArmor.java -+++ net/minecraft/src/SlotArmor.java -@@ -1,23 +1,41 @@ - package net.minecraft.src; - - class SlotArmor extends Slot { -+ -+ /** -+ * The armor type that can be placed on that slot, it uses the same values of armorType field on ItemArmor. -+ */ - final int armorType; -+ -+ /** -+ * The parent class of this clot, ContainerPlayer, SlotArmor is a Anon inner class. -+ */ - final ContainerPlayer parent; - -- SlotArmor(ContainerPlayer var1, IInventory var2, int var3, int var4, int var5, int var6) { -- super(var2, var3, var4, var5); -- this.parent = var1; -- this.armorType = var6; -+ SlotArmor(ContainerPlayer par1ContainerPlayer, IInventory par2IInventory, int par3, int par4, int par5, int par6) { -+ super(par2IInventory, par3, par4, par5); -+ this.parent = par1ContainerPlayer; -+ this.armorType = par6; - } - -+ /** -+ * Returns the maximum stack size for a given slot (usually the same as getInventoryStackLimit(), but 1 in the case of -+ * armor slots) -+ */ - public int getSlotStackLimit() { - return 1; - } - -- public boolean isItemValid(ItemStack var1) { -- return var1 == null ? false : (var1.getItem() instanceof ItemArmor ? ((ItemArmor)var1.getItem()).armorType == this.armorType : (var1.getItem().itemID != Block.pumpkin.blockID && var1.getItem().itemID != Item.skull.itemID ? false : this.armorType == 0)); -+ /** -+ * Check if the stack is a valid item for this slot. Always true beside for the armor slots. -+ */ -+ public boolean isItemValid(ItemStack par1ItemStack) { -+ return par1ItemStack == null ? false : (par1ItemStack.getItem() instanceof ItemArmor ? ((ItemArmor)par1ItemStack.getItem()).armorType == this.armorType : (par1ItemStack.getItem().itemID != Block.pumpkin.blockID && par1ItemStack.getItem().itemID != Item.skull.itemID ? false : this.armorType == 0)); - } - -+ /** -+ * Returns the icon index on items.png that is used as background image of the slot. -+ */ - public Icon getBackgroundIconIndex() { - return ItemArmor.func_94602_b(this.armorType); - } ---- net/minecraft/src/StringUtils.java -+++ net/minecraft/src/StringUtils.java -@@ -3,16 +3,19 @@ - import java.util.regex.Pattern; - - public class StringUtils { -- private static final Pattern a = Pattern.compile("(?i)\\u00A7[0-9A-FK-OR]"); -+ private static final Pattern patternControlCode = Pattern.compile("(?i)\\u00A7[0-9A-FK-OR]"); - -- public static String ticksToElapsedTime(int var0) { -- int var1 = var0 / 20; -+ /** -+ * Returns the time elapsed for the given number of ticks, in "mm:ss" format. -+ */ -+ public static String ticksToElapsedTime(int par0) { -+ int var1 = par0 / 20; - int var2 = var1 / 60; - var1 %= 60; - return var1 < 10 ? var2 + ":0" + var1 : var2 + ":" + var1; - } - -- public static String stripControlCodes(String var0) { -- return a.matcher(var0).replaceAll(""); -+ public static String stripControlCodes(String par0Str) { -+ return patternControlCode.matcher(par0Str).replaceAll(""); - } - } ---- /dev/null -+++ com/prupe/mcpatcher/sky/SkyRenderer$1.java -@@ -1,0 +1,27 @@ -+package com.prupe.mcpatcher.sky; -+ -+import com.prupe.mcpatcher.TexturePackChangeHandler; -+import net.minecraft.src.Minecraft; -+import net.minecraft.src.WorldClient; -+ -+final class SkyRenderer$1 extends TexturePackChangeHandler { -+ SkyRenderer$1(String x0, int x1) { -+ super(x0, x1); -+ } -+ -+ public void beforeChange() { -+ SkyRenderer.access$000().clear(); -+ } -+ -+ public void afterChange() { -+ if (SkyRenderer.access$100()) { -+ WorldClient world = Minecraft.getMinecraft().theWorld; -+ -+ if (world != null) { -+ SkyRenderer.access$200(world.provider.dimensionId); -+ } -+ } -+ -+ FireworksHelper.reload(); -+ } -+} ---- net/minecraft/src/EnchantmentDamage.java -+++ net/minecraft/src/EnchantmentDamage.java -@@ -1,42 +1,78 @@ - package net.minecraft.src; - - public class EnchantmentDamage extends Enchantment { -- private static final String[] C = new String[]{"all", "undead", "arthropods"}; -- private static final int[] baseEnchantability = new int[]{1, 5, 5}; -- private static final int[] levelEnchantability = new int[]{11, 8, 8}; -- private static final int[] thresholdEnchantability = new int[]{20, 20, 20}; -+ -+ /** Holds the name to be translated of each protection type. */ -+ private static final String[] protectionName = new String[] {"all", "undead", "arthropods"}; -+ -+ /** -+ * Holds the base factor of enchantability needed to be able to use the enchant. -+ */ -+ private static final int[] baseEnchantability = new int[] {1, 5, 5}; -+ -+ /** -+ * Holds how much each level increased the enchantability factor to be able to use this enchant. -+ */ -+ private static final int[] levelEnchantability = new int[] {11, 8, 8}; -+ -+ /** -+ * Used on the formula of base enchantability, this is the 'window' factor of values to be able to use thing enchant. -+ */ -+ private static final int[] thresholdEnchantability = new int[] {20, 20, 20}; -+ -+ /** -+ * Defines the type of damage of the enchantment, 0 = all, 1 = undead, 3 = arthropods -+ */ - public final int damageType; - -- public EnchantmentDamage(int var1, int var2, int var3) { -- super(var1, var2, EnumEnchantmentType.weapon); -- this.damageType = var3; -- } -- -- public int getMinEnchantability(int var1) { -- return baseEnchantability[this.damageType] + (var1 - 1) * levelEnchantability[this.damageType]; -- } -- -- public int getMaxEnchantability(int var1) { -- return this.getMinEnchantability(var1) + thresholdEnchantability[this.damageType]; -- } -- -+ public EnchantmentDamage(int par1, int par2, int par3) { -+ super(par1, par2, EnumEnchantmentType.weapon); -+ this.damageType = par3; -+ } -+ -+ /** -+ * Returns the minimal value of enchantability needed on the enchantment level passed. -+ */ -+ public int getMinEnchantability(int par1) { -+ return baseEnchantability[this.damageType] + (par1 - 1) * levelEnchantability[this.damageType]; -+ } -+ -+ /** -+ * Returns the maximum value of enchantability nedded on the enchantment level passed. -+ */ -+ public int getMaxEnchantability(int par1) { -+ return this.getMinEnchantability(par1) + thresholdEnchantability[this.damageType]; -+ } -+ -+ /** -+ * Returns the maximum level that the enchantment can have. -+ */ - public int getMaxLevel() { - return 5; - } - -- public float calcModifierLiving(int var1, EntityLivingBase var2) { -- return this.damageType == 0 ? (float)var1 * 1.25F : (this.damageType == 1 && var2.getCreatureAttribute() == EnumCreatureAttribute.UNDEAD ? (float)var1 * 2.5F : (this.damageType == 2 && var2.getCreatureAttribute() == EnumCreatureAttribute.ARTHROPOD ? (float)var1 * 2.5F : 0.0F)); -+ /** -+ * Calculates de (magic) damage done by the enchantment on a living entity based on level and entity passed. -+ */ -+ public float calcModifierLiving(int par1, EntityLivingBase par2EntityLivingBase) { -+ return this.damageType == 0 ? (float)par1 * 1.25F : (this.damageType == 1 && par2EntityLivingBase.getCreatureAttribute() == EnumCreatureAttribute.UNDEAD ? (float)par1 * 2.5F : (this.damageType == 2 && par2EntityLivingBase.getCreatureAttribute() == EnumCreatureAttribute.ARTHROPOD ? (float)par1 * 2.5F : 0.0F)); - } - -+ /** -+ * Return the name of key in translation table of this enchantment. -+ */ - public String getName() { -- return "enchantment.damage." + C[this.damageType]; -- } -- -- public boolean canApplyTogether(Enchantment var1) { -- return !(var1 instanceof EnchantmentDamage); -- } -- -- public boolean canApply(ItemStack var1) { -- return var1.getItem() instanceof ItemAxe ? true : super.canApply(var1); -+ return "enchantment.damage." + protectionName[this.damageType]; -+ } -+ -+ /** -+ * Determines if the enchantment passed can be applyied together with this enchantment. -+ */ -+ public boolean canApplyTogether(Enchantment par1Enchantment) { -+ return !(par1Enchantment instanceof EnchantmentDamage); -+ } -+ -+ public boolean canApply(ItemStack par1ItemStack) { -+ return par1ItemStack.getItem() instanceof ItemAxe ? true : super.canApply(par1ItemStack); - } - } ---- /dev/null -+++ org/spoutcraft/client/entity/CraftEntity.java -@@ -1,0 +1,173 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.client.entity; -+ -+import java.util.HashSet; -+import java.util.List; -+import java.util.Set; -+import java.util.UUID; -+ -+import org.spoutcraft.api.entity.EntitySkinType; -+import org.spoutcraft.api.property.Property; -+import org.spoutcraft.api.property.PropertyObject; -+import org.spoutcraft.api.util.FixedLocation; -+import org.spoutcraft.api.util.Location; -+import org.spoutcraft.api.util.MutableLocation; -+import org.spoutcraft.api.util.MutableVector; -+import org.spoutcraft.api.util.Vector; -+import org.spoutcraft.client.SpoutcraftWorld; -+ -+public class CraftEntity extends PropertyObject{ -+ protected net.minecraft.src.Entity handle = null; -+ -+ public CraftEntity() { -+ } -+ -+ public CraftEntity(FixedLocation location) { -+ } -+ -+ public CraftEntity(net.minecraft.src.Entity handle) { -+ this.handle = handle; -+ addProperty("location", new Property() { -+ public void set(Object value) { -+ teleport((Location)value); -+ } -+ public Object get() { -+ return getLocation(); -+ } -+ }); -+ addProperty("velocity", new Property() { -+ public void set(Object value) { -+ setVelocity((Vector)value); -+ } -+ public Object get() { -+ return getVelocity(); -+ } -+ }); -+ } -+ -+ public Location getLocation() { -+ return new MutableLocation(handle.posX,handle.posY,handle.posZ,handle.rotationYaw,handle.rotationPitch); -+ } -+ -+ public void setVelocity(Vector velocity) { -+ handle.motionX = velocity.getX(); -+ handle.motionY = velocity.getY(); -+ handle.motionZ = velocity.getZ(); -+ } -+ -+ public Vector getVelocity() { -+ return new MutableVector(handle.motionX, handle.motionY, handle.motionZ); -+ } -+ -+ public SpoutcraftWorld getWorld() { -+ return handle.worldObj.world; -+ } -+ -+ public boolean teleport(FixedLocation location) { -+ handle.setPosition(location.getX(), location.getY(), location.getZ()); -+ handle.setAngles((float)location.getYaw(), (float)location.getPitch()); -+ return true; -+ } -+ -+ public boolean teleport(CraftEntity destination) { -+ return teleport(destination.getLocation()); -+ } -+ -+ public Set getNearbyEntities(double x, double y, double z) { -+ List notchEntityList = handle.worldObj.getEntitiesWithinAABBExcludingEntity(handle, handle.boundingBox.expand(x, y, z)); -+ Set entities = new HashSet(notchEntityList.size()); -+ -+ for (net.minecraft.src.Entity e: notchEntityList) { -+ entities.add(e.spoutEnty); -+ } -+ return entities; -+ } -+ -+ public int getEntityId() { -+ return handle.entityId; -+ } -+ -+ public int getFireTicks() { -+ return handle.fire; -+ } -+ -+ public int getMaxFireTicks() { -+ return handle.fire; -+ } -+ -+ public void setFireTicks(int ticks) { -+ handle.fire = ticks; -+ } -+ -+ public void remove() { -+ handle.setDead(); -+ } -+ -+ public boolean isDead() { -+ return handle.isDead; -+ } -+ -+ public CraftEntity getPassenger() { -+ return handle.riddenByEntity.spoutEnty; -+ } -+ -+ public boolean setPassenger(CraftEntity passenger) { -+ handle.riddenByEntity = ((CraftEntity)passenger).handle; -+ ((CraftEntity)passenger).handle.ridingEntity = handle; -+ return true; -+ } -+ -+ public boolean isEmpty() { -+ return handle.riddenByEntity == null; -+ } -+ -+ public boolean eject() { -+ if (!isEmpty()) { -+ handle.riddenByEntity.ridingEntity = null; -+ handle.riddenByEntity = null; -+ return true; -+ } -+ return false; -+ } -+ -+ public float getFallDistance() { -+ return handle.fallDistance; -+ } -+ -+ public void setFallDistance(float distance) { -+ handle.fallDistance = distance; -+ } -+ -+ public UUID getUniqueId() { -+ return handle.uniqueId; -+ } -+ -+ public int getTicksLived() { -+ return handle.ticksExisted; -+ } -+ -+ public void setTicksLived(int value) { -+ handle.ticksExisted = value; -+ } -+ -+ public void setSkin(String skinURI, EntitySkinType type) { -+ } -+} ---- /dev/null -+++ org/spoutcraft/api/material/item/GenericTool.java -@@ -1,0 +1,54 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.api.material.item; -+ -+import org.spoutcraft.api.material.Block; -+import org.spoutcraft.api.material.Tool; -+ -+public class GenericTool extends GenericItem implements Tool { -+ public GenericTool(String name, int id) { -+ super(name, id); -+ } -+ -+ public short getDurability() { -+ // TODO Auto-generated method stub -+ return 0; -+ } -+ -+ public Tool setDurability(short durability) { -+ // TODO Auto-generated method stub -+ return this; -+ } -+ -+ public float getStrengthModifier(Block block) { -+ // TODO Auto-generated method stub -+ return 0; -+ } -+ -+ public Tool setStrengthModifier(Block block, float modifier) { -+ // TODO Auto-generated method stub -+ return this; -+ } -+ -+ public Block[] getStrengthModifiedBlocks() { -+ // TODO Auto-generated method stub -+ return null; -+ } -+} ---- net/minecraft/src/ServerCommand.java -+++ net/minecraft/src/ServerCommand.java -@@ -1,11 +1,13 @@ - package net.minecraft.src; - - public class ServerCommand { -- public final String a; -+ -+ /** The command string. */ -+ public final String command; - public final ICommandSender sender; - -- public ServerCommand(String var1, ICommandSender var2) { -- this.a = var1; -- this.sender = var2; -+ public ServerCommand(String par1Str, ICommandSender par2ICommandSender) { -+ this.command = par1Str; -+ this.sender = par2ICommandSender; - } - } ---- net/minecraft/src/IUpdatePlayerListBox.java -+++ net/minecraft/src/IUpdatePlayerListBox.java -@@ -1,5 +1,9 @@ - package net.minecraft.src; - - public interface IUpdatePlayerListBox { -+ -+ /** -+ * Updates the JList with a new model. -+ */ - void update(); - } ---- net/minecraft/src/StatStringFormatKeyInv.java -+++ net/minecraft/src/StatStringFormatKeyInv.java -@@ -1,15 +1,20 @@ - package net.minecraft.src; - - class StatStringFormatKeyInv implements IStatStringFormat { -+ -+ /** Minecraft instance */ - final Minecraft mc; - -- StatStringFormatKeyInv(Minecraft var1) { -- this.mc = var1; -+ StatStringFormatKeyInv(Minecraft par1Minecraft) { -+ this.mc = par1Minecraft; - } - -- public String formatString(String var1) { -+ /** -+ * Formats the strings based on 'IStatStringFormat' interface. -+ */ -+ public String formatString(String par1Str) { - try { -- return String.format(var1, new Object[]{GameSettings.getKeyDisplayString(this.mc.gameSettings.keyBindInventory.keyCode)}); -+ return String.format(par1Str, new Object[] {GameSettings.getKeyDisplayString(this.mc.gameSettings.keyBindInventory.keyCode)}); - } catch (Exception var3) { - return "Error: " + var3.getLocalizedMessage(); - } ---- net/minecraft/src/Packet35EntityHeadRotation.java -+++ net/minecraft/src/Packet35EntityHeadRotation.java -@@ -8,41 +8,63 @@ - public int entityId; - public byte headRotationYaw; - -- public Packet35EntityHeadRotation() { -- } -- -- public Packet35EntityHeadRotation(int var1, byte var2) { -- this.entityId = var1; -- this.headRotationYaw = var2; -- } -- -- public void readPacketData(DataInput var1) throws IOException { -- this.entityId = var1.readInt(); -- this.headRotationYaw = var1.readByte(); -- } -- -- public void writePacketData(DataOutput var1) throws IOException { -- var1.writeInt(this.entityId); -- var1.writeByte(this.headRotationYaw); -- } -- -- public void processPacket(NetHandler var1) { -- var1.handleEntityHeadRotation(this); -- } -- -+ public Packet35EntityHeadRotation() {} -+ -+ public Packet35EntityHeadRotation(int par1, byte par2) { -+ this.entityId = par1; -+ this.headRotationYaw = par2; -+ } -+ -+ /** -+ * Abstract. Reads the raw packet data from the data stream. -+ */ -+ public void readPacketData(DataInput par1DataInput) throws IOException { -+ this.entityId = par1DataInput.readInt(); -+ this.headRotationYaw = par1DataInput.readByte(); -+ } -+ -+ /** -+ * Abstract. Writes the raw packet data to the data stream. -+ */ -+ public void writePacketData(DataOutput par1DataOutput) throws IOException { -+ par1DataOutput.writeInt(this.entityId); -+ par1DataOutput.writeByte(this.headRotationYaw); -+ } -+ -+ /** -+ * Passes this Packet on to the NetHandler for processing. -+ */ -+ public void processPacket(NetHandler par1NetHandler) { -+ par1NetHandler.handleEntityHeadRotation(this); -+ } -+ -+ /** -+ * Abstract. Return the size of the packet (not counting the header). -+ */ - public int getPacketSize() { - return 5; - } - -+ /** -+ * only false for the abstract Packet class, all real packets return true -+ */ - public boolean isRealPacket() { - return true; - } - -- public boolean containsSameEntityIDAs(Packet var1) { -- Packet35EntityHeadRotation var2 = (Packet35EntityHeadRotation)var1; -+ /** -+ * eg return packet30entity.entityId == entityId; WARNING : will throw if you compare a packet to a different packet -+ * class -+ */ -+ public boolean containsSameEntityIDAs(Packet par1Packet) { -+ Packet35EntityHeadRotation var2 = (Packet35EntityHeadRotation)par1Packet; - return var2.entityId == this.entityId; - } - -+ /** -+ * If this returns true, the packet may be processed on any thread; otherwise it is queued for the main thread to -+ * handle. -+ */ - public boolean canProcessAsync() { - return true; - } ---- net/minecraft/src/BlockRedstoneTorch.java -+++ net/minecraft/src/BlockRedstoneTorch.java -@@ -7,26 +7,33 @@ - import java.util.Random; - - public class BlockRedstoneTorch extends BlockTorch { -+ -+ /** Whether the redstone torch is currently active or not. */ - private boolean torchActive; -- private static Map b = new HashMap(); -- -- private boolean checkForBurnout(World var1, int var2, int var3, int var4, boolean var5) { -- if(!b.containsKey(var1)) { -- b.put(var1, new ArrayList()); -+ -+ /** Map of ArrayLists of RedstoneUpdateInfo. Key of map is World. */ -+ private static Map redstoneUpdateInfoCache = new HashMap(); -+ -+ private boolean checkForBurnout(World par1World, int par2, int par3, int par4, boolean par5) { -+ if (!redstoneUpdateInfoCache.containsKey(par1World)) { -+ redstoneUpdateInfoCache.put(par1World, new ArrayList()); - } - -- List var6 = (List)b.get(var1); -- if(var5) { -- var6.add(new RedstoneUpdateInfo(var2, var3, var4, var1.getTotalWorldTime())); -+ List var6 = (List)redstoneUpdateInfoCache.get(par1World); -+ -+ if (par5) { -+ var6.add(new RedstoneUpdateInfo(par2, par3, par4, par1World.getTotalWorldTime())); - } - - int var7 = 0; - -- for(int var8 = 0; var8 < var6.size(); ++var8) { -+ for (int var8 = 0; var8 < var6.size(); ++var8) { - RedstoneUpdateInfo var9 = (RedstoneUpdateInfo)var6.get(var8); -- if(var9.x == var2 && var9.y == var3 && var9.z == var4) { -+ -+ if (var9.x == par2 && var9.y == par3 && var9.z == par4) { - ++var7; -- if(var7 >= 8) { -+ -+ if (var7 >= 8) { - return true; - } - } -@@ -35,137 +42,180 @@ - return false; - } - -- protected BlockRedstoneTorch(int var1, boolean var2) { -- super(var1); -- this.torchActive = var2; -+ protected BlockRedstoneTorch(int par1, boolean par2) { -+ super(par1); -+ this.torchActive = par2; - this.setTickRandomly(true); - this.setCreativeTab((CreativeTabs)null); - } - -- public int tickRate(World var1) { -+ /** -+ * How many world ticks before ticking -+ */ -+ public int tickRate(World par1World) { - return 2; - } - -- public void onBlockAdded(World var1, int var2, int var3, int var4) { -- if(var1.getBlockMetadata(var2, var3, var4) == 0) { -- super.onBlockAdded(var1, var2, var3, var4); -- } -- -- if(this.torchActive) { -- var1.notifyBlocksOfNeighborChange(var2, var3 - 1, var4, this.blockID); -- var1.notifyBlocksOfNeighborChange(var2, var3 + 1, var4, this.blockID); -- var1.notifyBlocksOfNeighborChange(var2 - 1, var3, var4, this.blockID); -- var1.notifyBlocksOfNeighborChange(var2 + 1, var3, var4, this.blockID); -- var1.notifyBlocksOfNeighborChange(var2, var3, var4 - 1, this.blockID); -- var1.notifyBlocksOfNeighborChange(var2, var3, var4 + 1, this.blockID); -- } -- -- } -- -- public void breakBlock(World var1, int var2, int var3, int var4, int var5, int var6) { -- if(this.torchActive) { -- var1.notifyBlocksOfNeighborChange(var2, var3 - 1, var4, this.blockID); -- var1.notifyBlocksOfNeighborChange(var2, var3 + 1, var4, this.blockID); -- var1.notifyBlocksOfNeighborChange(var2 - 1, var3, var4, this.blockID); -- var1.notifyBlocksOfNeighborChange(var2 + 1, var3, var4, this.blockID); -- var1.notifyBlocksOfNeighborChange(var2, var3, var4 - 1, this.blockID); -- var1.notifyBlocksOfNeighborChange(var2, var3, var4 + 1, this.blockID); -- } -- -- } -- -- public int isProvidingWeakPower(IBlockAccess var1, int var2, int var3, int var4, int var5) { -- if(!this.torchActive) { -+ /** -+ * Called whenever the block is added into the world. Args: world, x, y, z -+ */ -+ public void onBlockAdded(World par1World, int par2, int par3, int par4) { -+ if (par1World.getBlockMetadata(par2, par3, par4) == 0) { -+ super.onBlockAdded(par1World, par2, par3, par4); -+ } -+ -+ if (this.torchActive) { -+ par1World.notifyBlocksOfNeighborChange(par2, par3 - 1, par4, this.blockID); -+ par1World.notifyBlocksOfNeighborChange(par2, par3 + 1, par4, this.blockID); -+ par1World.notifyBlocksOfNeighborChange(par2 - 1, par3, par4, this.blockID); -+ par1World.notifyBlocksOfNeighborChange(par2 + 1, par3, par4, this.blockID); -+ par1World.notifyBlocksOfNeighborChange(par2, par3, par4 - 1, this.blockID); -+ par1World.notifyBlocksOfNeighborChange(par2, par3, par4 + 1, this.blockID); -+ } -+ } -+ -+ /** -+ * Called on server worlds only when the block has been replaced by a different block ID, or the same block with a -+ * different metadata value, but before the new metadata value is set. Args: World, x, y, z, old block ID, old metadata -+ */ -+ public void breakBlock(World par1World, int par2, int par3, int par4, int par5, int par6) { -+ if (this.torchActive) { -+ par1World.notifyBlocksOfNeighborChange(par2, par3 - 1, par4, this.blockID); -+ par1World.notifyBlocksOfNeighborChange(par2, par3 + 1, par4, this.blockID); -+ par1World.notifyBlocksOfNeighborChange(par2 - 1, par3, par4, this.blockID); -+ par1World.notifyBlocksOfNeighborChange(par2 + 1, par3, par4, this.blockID); -+ par1World.notifyBlocksOfNeighborChange(par2, par3, par4 - 1, this.blockID); -+ par1World.notifyBlocksOfNeighborChange(par2, par3, par4 + 1, this.blockID); -+ } -+ } -+ -+ /** -+ * Returns true if the block is emitting indirect/weak redstone power on the specified side. If isBlockNormalCube -+ * returns true, standard redstone propagation rules will apply instead and this will not be called. Args: World, X, Y, -+ * Z, side. Note that the side is reversed - eg it is 1 (up) when checking the bottom of the block. -+ */ -+ public int isProvidingWeakPower(IBlockAccess par1IBlockAccess, int par2, int par3, int par4, int par5) { -+ if (!this.torchActive) { - return 0; - } else { -- int var6 = var1.getBlockMetadata(var2, var3, var4); -- return var6 == 5 && var5 == 1 ? 0 : (var6 == 3 && var5 == 3 ? 0 : (var6 == 4 && var5 == 2 ? 0 : (var6 == 1 && var5 == 5 ? 0 : (var6 == 2 && var5 == 4 ? 0 : 15)))); -+ int var6 = par1IBlockAccess.getBlockMetadata(par2, par3, par4); -+ return var6 == 5 && par5 == 1 ? 0 : (var6 == 3 && par5 == 3 ? 0 : (var6 == 4 && par5 == 2 ? 0 : (var6 == 1 && par5 == 5 ? 0 : (var6 == 2 && par5 == 4 ? 0 : 15)))); - } - } - -- private boolean isIndirectlyPowered(World var1, int var2, int var3, int var4) { -- int var5 = var1.getBlockMetadata(var2, var3, var4); -- return var5 == 5 && var1.getIndirectPowerOutput(var2, var3 - 1, var4, 0) ? true : (var5 == 3 && var1.getIndirectPowerOutput(var2, var3, var4 - 1, 2) ? true : (var5 == 4 && var1.getIndirectPowerOutput(var2, var3, var4 + 1, 3) ? true : (var5 == 1 && var1.getIndirectPowerOutput(var2 - 1, var3, var4, 4) ? true : var5 == 2 && var1.getIndirectPowerOutput(var2 + 1, var3, var4, 5)))); -+ /** -+ * Returns true or false based on whether the block the torch is attached to is providing indirect power. -+ */ -+ private boolean isIndirectlyPowered(World par1World, int par2, int par3, int par4) { -+ int var5 = par1World.getBlockMetadata(par2, par3, par4); -+ return var5 == 5 && par1World.getIndirectPowerOutput(par2, par3 - 1, par4, 0) ? true : (var5 == 3 && par1World.getIndirectPowerOutput(par2, par3, par4 - 1, 2) ? true : (var5 == 4 && par1World.getIndirectPowerOutput(par2, par3, par4 + 1, 3) ? true : (var5 == 1 && par1World.getIndirectPowerOutput(par2 - 1, par3, par4, 4) ? true : var5 == 2 && par1World.getIndirectPowerOutput(par2 + 1, par3, par4, 5)))); - } - -- public void updateTick(World var1, int var2, int var3, int var4, Random var5) { -- boolean var6 = this.isIndirectlyPowered(var1, var2, var3, var4); -- List var7 = (List)b.get(var1); -+ /** -+ * Ticks the block if it's been scheduled -+ */ -+ public void updateTick(World par1World, int par2, int par3, int par4, Random par5Random) { -+ boolean var6 = this.isIndirectlyPowered(par1World, par2, par3, par4); -+ List var7 = (List)redstoneUpdateInfoCache.get(par1World); - -- while(var7 != null && !var7.isEmpty() && var1.getTotalWorldTime() - ((RedstoneUpdateInfo)var7.get(0)).updateTime > 60L) { -+ while (var7 != null && !var7.isEmpty() && par1World.getTotalWorldTime() - ((RedstoneUpdateInfo)var7.get(0)).updateTime > 60L) { - var7.remove(0); - } - -- if(this.torchActive) { -- if(var6) { -- var1.setBlock(var2, var3, var4, Block.torchRedstoneIdle.blockID, var1.getBlockMetadata(var2, var3, var4), 3); -- if(this.checkForBurnout(var1, var2, var3, var4, true)) { -- var1.playSoundEffect((double)((float)var2 + 0.5F), (double)((float)var3 + 0.5F), (double)((float)var4 + 0.5F), "random.fizz", 0.5F, 2.6F + (var1.s.nextFloat() - var1.s.nextFloat()) * 0.8F); -- -- for(int var8 = 0; var8 < 5; ++var8) { -- double var9 = (double)var2 + var5.nextDouble() * 0.6D + 0.2D; -- double var11 = (double)var3 + var5.nextDouble() * 0.6D + 0.2D; -- double var13 = (double)var4 + var5.nextDouble() * 0.6D + 0.2D; -- var1.spawnParticle("smoke", var9, var11, var13, 0.0D, 0.0D, 0.0D); -+ if (this.torchActive) { -+ if (var6) { -+ par1World.setBlock(par2, par3, par4, Block.torchRedstoneIdle.blockID, par1World.getBlockMetadata(par2, par3, par4), 3); -+ -+ if (this.checkForBurnout(par1World, par2, par3, par4, true)) { -+ par1World.playSoundEffect((double)((float)par2 + 0.5F), (double)((float)par3 + 0.5F), (double)((float)par4 + 0.5F), "random.fizz", 0.5F, 2.6F + (par1World.rand.nextFloat() - par1World.rand.nextFloat()) * 0.8F); -+ -+ for (int var8 = 0; var8 < 5; ++var8) { -+ double var9 = (double)par2 + par5Random.nextDouble() * 0.6D + 0.2D; -+ double var11 = (double)par3 + par5Random.nextDouble() * 0.6D + 0.2D; -+ double var13 = (double)par4 + par5Random.nextDouble() * 0.6D + 0.2D; -+ par1World.spawnParticle("smoke", var9, var11, var13, 0.0D, 0.0D, 0.0D); - } - } - } -- } else if(!var6 && !this.checkForBurnout(var1, var2, var3, var4, false)) { -- var1.setBlock(var2, var3, var4, Block.torchRedstoneActive.blockID, var1.getBlockMetadata(var2, var3, var4), 3); -+ } else if (!var6 && !this.checkForBurnout(par1World, par2, par3, par4, false)) { -+ par1World.setBlock(par2, par3, par4, Block.torchRedstoneActive.blockID, par1World.getBlockMetadata(par2, par3, par4), 3); - } -- - } - -- public void onNeighborBlockChange(World var1, int var2, int var3, int var4, int var5) { -- if(!this.func_94397_d(var1, var2, var3, var4, var5)) { -- boolean var6 = this.isIndirectlyPowered(var1, var2, var3, var4); -- if(this.torchActive && var6 || !this.torchActive && !var6) { -- var1.scheduleBlockUpdate(var2, var3, var4, this.blockID, this.tickRate(var1)); -+ /** -+ * Lets the block know when one of its neighbor changes. Doesn't know which neighbor changed (coordinates passed are -+ * their own) Args: x, y, z, neighbor blockID -+ */ -+ public void onNeighborBlockChange(World par1World, int par2, int par3, int par4, int par5) { -+ if (!this.func_94397_d(par1World, par2, par3, par4, par5)) { -+ boolean var6 = this.isIndirectlyPowered(par1World, par2, par3, par4); -+ -+ if (this.torchActive && var6 || !this.torchActive && !var6) { -+ par1World.scheduleBlockUpdate(par2, par3, par4, this.blockID, this.tickRate(par1World)); - } -- - } - } - -- public int isProvidingStrongPower(IBlockAccess var1, int var2, int var3, int var4, int var5) { -- return var5 == 0 ? this.isProvidingWeakPower(var1, var2, var3, var4, var5) : 0; -+ /** -+ * Returns true if the block is emitting direct/strong redstone power on the specified side. Args: World, X, Y, Z, -+ * side. Note that the side is reversed - eg it is 1 (up) when checking the bottom of the block. -+ */ -+ public int isProvidingStrongPower(IBlockAccess par1IBlockAccess, int par2, int par3, int par4, int par5) { -+ return par5 == 0 ? this.isProvidingWeakPower(par1IBlockAccess, par2, par3, par4, par5) : 0; - } - -- public int idDropped(int var1, Random var2, int var3) { -+ /** -+ * Returns the ID of the items to drop on destruction. -+ */ -+ public int idDropped(int par1, Random par2Random, int par3) { - return Block.torchRedstoneActive.blockID; - } - -+ /** -+ * Can this block provide power. Only wire currently seems to have this change based on its state. -+ */ - public boolean canProvidePower() { - return true; - } - -- public void randomDisplayTick(World var1, int var2, int var3, int var4, Random var5) { -- if(this.torchActive) { -- int var6 = var1.getBlockMetadata(var2, var3, var4); -- double var7 = (double)((float)var2 + 0.5F) + (double)(var5.nextFloat() - 0.5F) * 0.2D; -- double var9 = (double)((float)var3 + 0.7F) + (double)(var5.nextFloat() - 0.5F) * 0.2D; -- double var11 = (double)((float)var4 + 0.5F) + (double)(var5.nextFloat() - 0.5F) * 0.2D; -- double var13 = (double)0.22F; -- double var15 = (double)0.27F; -- if(var6 == 1) { -- var1.spawnParticle("reddust", var7 - var15, var9 + var13, var11, 0.0D, 0.0D, 0.0D); -- } else if(var6 == 2) { -- var1.spawnParticle("reddust", var7 + var15, var9 + var13, var11, 0.0D, 0.0D, 0.0D); -- } else if(var6 == 3) { -- var1.spawnParticle("reddust", var7, var9 + var13, var11 - var15, 0.0D, 0.0D, 0.0D); -- } else if(var6 == 4) { -- var1.spawnParticle("reddust", var7, var9 + var13, var11 + var15, 0.0D, 0.0D, 0.0D); -+ /** -+ * A randomly called display update to be able to add particles or other items for display -+ */ -+ public void randomDisplayTick(World par1World, int par2, int par3, int par4, Random par5Random) { -+ if (this.torchActive) { -+ int var6 = par1World.getBlockMetadata(par2, par3, par4); -+ double var7 = (double)((float)par2 + 0.5F) + (double)(par5Random.nextFloat() - 0.5F) * 0.2D; -+ double var9 = (double)((float)par3 + 0.7F) + (double)(par5Random.nextFloat() - 0.5F) * 0.2D; -+ double var11 = (double)((float)par4 + 0.5F) + (double)(par5Random.nextFloat() - 0.5F) * 0.2D; -+ double var13 = 0.2199999988079071D; -+ double var15 = 0.27000001072883606D; -+ -+ if (var6 == 1) { -+ par1World.spawnParticle("reddust", var7 - var15, var9 + var13, var11, 0.0D, 0.0D, 0.0D); -+ } else if (var6 == 2) { -+ par1World.spawnParticle("reddust", var7 + var15, var9 + var13, var11, 0.0D, 0.0D, 0.0D); -+ } else if (var6 == 3) { -+ par1World.spawnParticle("reddust", var7, var9 + var13, var11 - var15, 0.0D, 0.0D, 0.0D); -+ } else if (var6 == 4) { -+ par1World.spawnParticle("reddust", var7, var9 + var13, var11 + var15, 0.0D, 0.0D, 0.0D); - } else { -- var1.spawnParticle("reddust", var7, var9, var11, 0.0D, 0.0D, 0.0D); -+ par1World.spawnParticle("reddust", var7, var9, var11, 0.0D, 0.0D, 0.0D); - } -- - } - } - -- public int idPicked(World var1, int var2, int var3, int var4) { -+ /** -+ * only called by clickMiddleMouseButton , and passed to inventory.setCurrentItem (along with isCreative) -+ */ -+ public int idPicked(World par1World, int par2, int par3, int par4) { - return Block.torchRedstoneActive.blockID; - } - -- public boolean isAssociatedBlockID(int var1) { -- return var1 == Block.torchRedstoneIdle.blockID || var1 == Block.torchRedstoneActive.blockID; -+ /** -+ * Returns true if the given block ID is equivalent to this one. Example: redstoneTorchOn matches itself and -+ * redstoneTorchOff, and vice versa. Most blocks only match themselves. -+ */ -+ public boolean isAssociatedBlockID(int par1) { -+ return par1 == Block.torchRedstoneIdle.blockID || par1 == Block.torchRedstoneActive.blockID; - } - } ---- net/minecraft/src/SelectionListInvited.java -+++ net/minecraft/src/SelectionListInvited.java -@@ -3,41 +3,39 @@ - class SelectionListInvited extends SelectionListBase { - final GuiScreenConfigureWorld theGuiScreenConfigureWorld; - -- public SelectionListInvited(GuiScreenConfigureWorld var1) { -- super(GuiScreenConfigureWorld.getMinecraft(var1), GuiScreenConfigureWorld.func_96271_b(var1), GuiScreenConfigureWorld.func_96274_a(var1, 2), GuiScreenConfigureWorld.func_96269_c(var1), GuiScreenConfigureWorld.func_96274_a(var1, 9) - GuiScreenConfigureWorld.func_96274_a(var1, 2), 12); -- this.theGuiScreenConfigureWorld = var1; -+ public SelectionListInvited(GuiScreenConfigureWorld par1GuiScreenConfigureWorld) { -+ super(GuiScreenConfigureWorld.getMinecraft(par1GuiScreenConfigureWorld), GuiScreenConfigureWorld.func_96271_b(par1GuiScreenConfigureWorld), GuiScreenConfigureWorld.func_96274_a(par1GuiScreenConfigureWorld, 2), GuiScreenConfigureWorld.func_96269_c(par1GuiScreenConfigureWorld), GuiScreenConfigureWorld.func_96274_a(par1GuiScreenConfigureWorld, 9) - GuiScreenConfigureWorld.func_96274_a(par1GuiScreenConfigureWorld, 2), 12); -+ this.theGuiScreenConfigureWorld = par1GuiScreenConfigureWorld; - } - - protected int func_96608_a() { -- return GuiScreenConfigureWorld.func_96266_d(this.theGuiScreenConfigureWorld).f.size() + 1; -+ return GuiScreenConfigureWorld.func_96266_d(this.theGuiScreenConfigureWorld).field_96402_f.size() + 1; - } - -- protected void func_96615_a(int var1, boolean var2) { -- if(var1 < GuiScreenConfigureWorld.func_96266_d(this.theGuiScreenConfigureWorld).f.size()) { -- GuiScreenConfigureWorld.func_96270_b(this.theGuiScreenConfigureWorld, var1); -+ protected void func_96615_a(int par1, boolean par2) { -+ if (par1 < GuiScreenConfigureWorld.func_96266_d(this.theGuiScreenConfigureWorld).field_96402_f.size()) { -+ GuiScreenConfigureWorld.func_96270_b(this.theGuiScreenConfigureWorld, par1); - } - } - -- protected boolean func_96609_a(int var1) { -- return var1 == GuiScreenConfigureWorld.func_96263_e(this.theGuiScreenConfigureWorld); -+ protected boolean func_96609_a(int par1) { -+ return par1 == GuiScreenConfigureWorld.func_96263_e(this.theGuiScreenConfigureWorld); - } - - protected int func_96613_b() { - return this.func_96608_a() * 12; - } - -- protected void func_96611_c() { -- } -+ protected void func_96611_c() {} - -- protected void func_96610_a(int var1, int var2, int var3, int var4, Tessellator var5) { -- if(var1 < GuiScreenConfigureWorld.func_96266_d(this.theGuiScreenConfigureWorld).f.size()) { -- this.func_98263_b(var1, var2, var3, var4, var5); -+ protected void func_96610_a(int par1, int par2, int par3, int par4, Tessellator par5Tessellator) { -+ if (par1 < GuiScreenConfigureWorld.func_96266_d(this.theGuiScreenConfigureWorld).field_96402_f.size()) { -+ this.func_98263_b(par1, par2, par3, par4, par5Tessellator); - } -- - } - -- private void func_98263_b(int var1, int var2, int var3, int var4, Tessellator var5) { -- String var6 = (String)GuiScreenConfigureWorld.func_96266_d(this.theGuiScreenConfigureWorld).f.get(var1); -- this.theGuiScreenConfigureWorld.drawString(GuiScreenConfigureWorld.func_96273_f(this.theGuiScreenConfigureWorld), var6, var2 + 2, var3 + 1, 16777215); -+ private void func_98263_b(int par1, int par2, int par3, int par4, Tessellator par5Tessellator) { -+ String var6 = (String)GuiScreenConfigureWorld.func_96266_d(this.theGuiScreenConfigureWorld).field_96402_f.get(par1); -+ this.theGuiScreenConfigureWorld.drawString(GuiScreenConfigureWorld.func_96273_f(this.theGuiScreenConfigureWorld), var6, par2 + 2, par3 + 1, 16777215); - } - } ---- /dev/null -+++ org/spoutcraft/client/gui/settings/controls/ServerLightButton.java -@@ -1,0 +1,46 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.client.gui.settings.controls; -+ -+import net.minecraft.src.Minecraft; -+ -+import org.spoutcraft.client.config.Configuration; -+ -+public class ServerLightButton extends AutomatedCheckBox { -+ public ServerLightButton() { -+ super("Client Light"); -+ setChecked(Configuration.isClientLight()); -+ setTooltip("Recalculates the light from servers in multiplayer.\n\nDisabling the recalculation is faster, but may result in odd\nlight patterns or light holes."); -+ } -+ -+ @Override -+ public void onButtonClick() { -+ Configuration.setClientLight(!Configuration.isClientLight()); -+ Configuration.write(); -+ } -+ -+ @Override -+ public String getTooltip() { -+ if (Minecraft.getMinecraft().theWorld == null || Minecraft.getMinecraft().theWorld.isRemote) { -+ return super.getTooltip(); -+ } -+ return "Has no effect in Single Player"; -+ } -+} ---- net/minecraft/src/EntityItemFrame.java -+++ net/minecraft/src/EntityItemFrame.java -@@ -1,15 +1,17 @@ - package net.minecraft.src; - - public class EntityItemFrame extends EntityHanging { -+ -+ /** Chance for this item frame's item to drop from the frame. */ - private float itemDropChance = 1.0F; - -- public EntityItemFrame(World var1) { -- super(var1); -+ public EntityItemFrame(World par1World) { -+ super(par1World); - } - -- public EntityItemFrame(World var1, int var2, int var3, int var4, int var5) { -- super(var1, var2, var3, var4, var5); -- this.setDirection(var5); -+ public EntityItemFrame(World par1World, int par2, int par3, int par4, int par5) { -+ super(par1World, par2, par3, par4, par5); -+ this.setDirection(par5); - } - - protected void entityInit() { -@@ -25,39 +27,51 @@ - return 9; - } - -- public boolean isInRangeToRenderDist(double var1) { -+ /** -+ * Checks if the entity is in range to render by using the past in distance and comparing it to its average edge length -+ * * 64 * renderDistanceWeight Args: distance -+ */ -+ public boolean isInRangeToRenderDist(double par1) { - double var3 = 16.0D; - var3 *= 64.0D * this.renderDistanceWeight; -- return var1 < var3 * var3; -+ return par1 < var3 * var3; - } - -- public void onBroken(Entity var1) { -+ /** -+ * Called when this entity is broken. Entity parameter may be null. -+ */ -+ public void onBroken(Entity par1Entity) { - ItemStack var2 = this.getDisplayedItem(); -- if(var1 instanceof EntityPlayer) { -- EntityPlayer var3 = (EntityPlayer)var1; -- if(var3.capabilities.isCreativeMode) { -+ -+ if (par1Entity instanceof EntityPlayer) { -+ EntityPlayer var3 = (EntityPlayer)par1Entity; -+ -+ if (var3.capabilities.isCreativeMode) { - this.removeFrameFromMap(var2); - return; - } - } - - this.entityDropItem(new ItemStack(Item.itemFrame), 0.0F); -- if(var2 != null && this.ab.nextFloat() < this.itemDropChance) { -+ -+ if (var2 != null && this.rand.nextFloat() < this.itemDropChance) { - var2 = var2.copy(); - this.removeFrameFromMap(var2); - this.entityDropItem(var2, 0.0F); - } -- - } - -- private void removeFrameFromMap(ItemStack var1) { -- if(var1 != null) { -- if(var1.itemID == Item.map.itemID) { -- MapData var2 = ((ItemMap)var1.getItem()).getMapData(var1, this.worldObj); -- var2.g.remove("frame-" + this.entityId); -+ /** -+ * Removes the dot representing this frame's position from the map when the item frame is broken. -+ */ -+ private void removeFrameFromMap(ItemStack par1ItemStack) { -+ if (par1ItemStack != null) { -+ if (par1ItemStack.itemID == Item.map.itemID) { -+ MapData var2 = ((ItemMap)par1ItemStack.getItem()).getMapData(par1ItemStack, this.worldObj); -+ var2.playersVisibleOnMap.remove("frame-" + this.entityId); - } - -- var1.setItemFrame((EntityItemFrame)null); -+ par1ItemStack.setItemFrame((EntityItemFrame)null); - } - } - -@@ -65,55 +79,71 @@ - return this.getDataWatcher().getWatchableObjectItemStack(2); - } - -- public void setDisplayedItem(ItemStack var1) { -- var1 = var1.copy(); -- var1.stackSize = 1; -- var1.setItemFrame(this); -- this.getDataWatcher().updateObject(2, var1); -+ public void setDisplayedItem(ItemStack par1ItemStack) { -+ par1ItemStack = par1ItemStack.copy(); -+ par1ItemStack.stackSize = 1; -+ par1ItemStack.setItemFrame(this); -+ this.getDataWatcher().updateObject(2, par1ItemStack); - this.getDataWatcher().setObjectWatched(2); - } - -+ /** -+ * Return the rotation of the item currently on this frame. -+ */ - public int getRotation() { - return this.getDataWatcher().getWatchableObjectByte(3); - } - -- public void setItemRotation(int var1) { -- this.getDataWatcher().updateObject(3, Byte.valueOf((byte)(var1 % 4))); -+ public void setItemRotation(int par1) { -+ this.getDataWatcher().updateObject(3, Byte.valueOf((byte)(par1 % 4))); - } - -- public void writeEntityToNBT(NBTTagCompound var1) { -- if(this.getDisplayedItem() != null) { -- var1.setCompoundTag("Item", this.getDisplayedItem().writeToNBT(new NBTTagCompound())); -- var1.setByte("ItemRotation", (byte)this.getRotation()); -- var1.setFloat("ItemDropChance", this.itemDropChance); -+ /** -+ * (abstract) Protected helper method to write subclass entity data to NBT. -+ */ -+ public void writeEntityToNBT(NBTTagCompound par1NBTTagCompound) { -+ if (this.getDisplayedItem() != null) { -+ par1NBTTagCompound.setCompoundTag("Item", this.getDisplayedItem().writeToNBT(new NBTTagCompound())); -+ par1NBTTagCompound.setByte("ItemRotation", (byte)this.getRotation()); -+ par1NBTTagCompound.setFloat("ItemDropChance", this.itemDropChance); - } - -- super.writeEntityToNBT(var1); -+ super.writeEntityToNBT(par1NBTTagCompound); - } - -- public void readEntityFromNBT(NBTTagCompound var1) { -- NBTTagCompound var2 = var1.getCompoundTag("Item"); -- if(var2 != null && !var2.hasNoTags()) { -+ /** -+ * (abstract) Protected helper method to read subclass entity data from NBT. -+ */ -+ public void readEntityFromNBT(NBTTagCompound par1NBTTagCompound) { -+ NBTTagCompound var2 = par1NBTTagCompound.getCompoundTag("Item"); -+ -+ if (var2 != null && !var2.hasNoTags()) { - this.setDisplayedItem(ItemStack.loadItemStackFromNBT(var2)); -- this.setItemRotation(var1.getByte("ItemRotation")); -- if(var1.hasKey("ItemDropChance")) { -- this.itemDropChance = var1.getFloat("ItemDropChance"); -+ this.setItemRotation(par1NBTTagCompound.getByte("ItemRotation")); -+ -+ if (par1NBTTagCompound.hasKey("ItemDropChance")) { -+ this.itemDropChance = par1NBTTagCompound.getFloat("ItemDropChance"); - } - } - -- super.readEntityFromNBT(var1); -+ super.readEntityFromNBT(par1NBTTagCompound); - } - -- public boolean interactFirst(EntityPlayer var1) { -- if(this.getDisplayedItem() == null) { -- ItemStack var2 = var1.getHeldItem(); -- if(var2 != null && !this.worldObj.isRemote) { -+ /** -+ * First layer of player interaction -+ */ -+ public boolean interactFirst(EntityPlayer par1EntityPlayer) { -+ if (this.getDisplayedItem() == null) { -+ ItemStack var2 = par1EntityPlayer.getHeldItem(); -+ -+ if (var2 != null && !this.worldObj.isRemote) { - this.setDisplayedItem(var2); -- if(!var1.capabilities.isCreativeMode && --var2.stackSize <= 0) { -- var1.inventory.setInventorySlotContents(var1.inventory.currentItem, (ItemStack)null); -+ -+ if (!par1EntityPlayer.capabilities.isCreativeMode && --var2.stackSize <= 0) { -+ par1EntityPlayer.inventory.setInventorySlotContents(par1EntityPlayer.inventory.currentItem, (ItemStack)null); - } - } -- } else if(!this.worldObj.isRemote) { -+ } else if (!this.worldObj.isRemote) { - this.setItemRotation(this.getRotation() + 1); - } - ---- net/minecraft/src/ModelSpider.java -+++ net/minecraft/src/ModelSpider.java -@@ -1,16 +1,38 @@ - package net.minecraft.src; - - public class ModelSpider extends ModelBase { -+ -+ /** The spider's head box */ - public ModelRenderer spiderHead; -+ -+ /** The spider's neck box */ - public ModelRenderer spiderNeck; -+ -+ /** The spider's body box */ - public ModelRenderer spiderBody; -+ -+ /** Spider's first leg */ - public ModelRenderer spiderLeg1; -+ -+ /** Spider's second leg */ - public ModelRenderer spiderLeg2; -+ -+ /** Spider's third leg */ - public ModelRenderer spiderLeg3; -+ -+ /** Spider's fourth leg */ - public ModelRenderer spiderLeg4; -+ -+ /** Spider's fifth leg */ - public ModelRenderer spiderLeg5; -+ -+ /** Spider's sixth leg */ - public ModelRenderer spiderLeg6; -+ -+ /** Spider's seventh leg */ - public ModelRenderer spiderLeg7; -+ -+ /** Spider's eight leg */ - public ModelRenderer spiderLeg8; - - public ModelSpider() { -@@ -51,25 +73,33 @@ - this.spiderLeg8.setRotationPoint(4.0F, (float)var2, -1.0F); - } - -- public void render(Entity var1, float var2, float var3, float var4, float var5, float var6, float var7) { -- this.setRotationAngles(var2, var3, var4, var5, var6, var7, var1); -- this.spiderHead.render(var7); -- this.spiderNeck.render(var7); -- this.spiderBody.render(var7); -- this.spiderLeg1.render(var7); -- this.spiderLeg2.render(var7); -- this.spiderLeg3.render(var7); -- this.spiderLeg4.render(var7); -- this.spiderLeg5.render(var7); -- this.spiderLeg6.render(var7); -- this.spiderLeg7.render(var7); -- this.spiderLeg8.render(var7); -+ /** -+ * Sets the models various rotation angles then renders the model. -+ */ -+ public void render(Entity par1Entity, float par2, float par3, float par4, float par5, float par6, float par7) { -+ this.setRotationAngles(par2, par3, par4, par5, par6, par7, par1Entity); -+ this.spiderHead.render(par7); -+ this.spiderNeck.render(par7); -+ this.spiderBody.render(par7); -+ this.spiderLeg1.render(par7); -+ this.spiderLeg2.render(par7); -+ this.spiderLeg3.render(par7); -+ this.spiderLeg4.render(par7); -+ this.spiderLeg5.render(par7); -+ this.spiderLeg6.render(par7); -+ this.spiderLeg7.render(par7); -+ this.spiderLeg8.render(par7); - } - -- public void setRotationAngles(float var1, float var2, float var3, float var4, float var5, float var6, Entity var7) { -- this.spiderHead.rotateAngleY = var4 / (180.0F / (float)Math.PI); -- this.spiderHead.rotateAngleX = var5 / (180.0F / (float)Math.PI); -- float var8 = (float)Math.PI * 0.25F; -+ /** -+ * Sets the model's various rotation angles. For bipeds, par1 and par2 are used for animating the movement of arms and -+ * legs, where par1 represents the time(so that arms and legs swing back and forth) and par2 represents how "far" arms -+ * and legs can swing at most. -+ */ -+ public void setRotationAngles(float par1, float par2, float par3, float par4, float par5, float par6, Entity par7Entity) { -+ this.spiderHead.rotateAngleY = par4 / (180F / (float)Math.PI); -+ this.spiderHead.rotateAngleX = par5 / (180F / (float)Math.PI); -+ float var8 = ((float)Math.PI / 4F); - this.spiderLeg1.rotateAngleZ = -var8; - this.spiderLeg2.rotateAngleZ = var8; - this.spiderLeg3.rotateAngleZ = -var8 * 0.74F; -@@ -79,7 +109,7 @@ - this.spiderLeg7.rotateAngleZ = -var8; - this.spiderLeg8.rotateAngleZ = var8; - float var9 = -0.0F; -- float var10 = (float)Math.PI * 0.125F; -+ float var10 = 0.3926991F; - this.spiderLeg1.rotateAngleY = var10 * 2.0F + var9; - this.spiderLeg2.rotateAngleY = -var10 * 2.0F - var9; - this.spiderLeg3.rotateAngleY = var10 * 1.0F + var9; -@@ -88,14 +118,14 @@ - this.spiderLeg6.rotateAngleY = var10 * 1.0F - var9; - this.spiderLeg7.rotateAngleY = -var10 * 2.0F + var9; - this.spiderLeg8.rotateAngleY = var10 * 2.0F - var9; -- float var11 = -(MathHelper.cos(var1 * 0.6662F * 2.0F + 0.0F) * 0.4F) * var2; -- float var12 = -(MathHelper.cos(var1 * 0.6662F * 2.0F + (float)Math.PI) * 0.4F) * var2; -- float var13 = -(MathHelper.cos(var1 * 0.6662F * 2.0F + (float)Math.PI * 0.5F) * 0.4F) * var2; -- float var14 = -(MathHelper.cos(var1 * 0.6662F * 2.0F + (float)Math.PI * 3.0F / 2.0F) * 0.4F) * var2; -- float var15 = Math.abs(MathHelper.sin(var1 * 0.6662F + 0.0F) * 0.4F) * var2; -- float var16 = Math.abs(MathHelper.sin(var1 * 0.6662F + (float)Math.PI) * 0.4F) * var2; -- float var17 = Math.abs(MathHelper.sin(var1 * 0.6662F + (float)Math.PI * 0.5F) * 0.4F) * var2; -- float var18 = Math.abs(MathHelper.sin(var1 * 0.6662F + (float)Math.PI * 3.0F / 2.0F) * 0.4F) * var2; -+ float var11 = -(MathHelper.cos(par1 * 0.6662F * 2.0F + 0.0F) * 0.4F) * par2; -+ float var12 = -(MathHelper.cos(par1 * 0.6662F * 2.0F + (float)Math.PI) * 0.4F) * par2; -+ float var13 = -(MathHelper.cos(par1 * 0.6662F * 2.0F + ((float)Math.PI / 2F)) * 0.4F) * par2; -+ float var14 = -(MathHelper.cos(par1 * 0.6662F * 2.0F + ((float)Math.PI * 3F / 2F)) * 0.4F) * par2; -+ float var15 = Math.abs(MathHelper.sin(par1 * 0.6662F + 0.0F) * 0.4F) * par2; -+ float var16 = Math.abs(MathHelper.sin(par1 * 0.6662F + (float)Math.PI) * 0.4F) * par2; -+ float var17 = Math.abs(MathHelper.sin(par1 * 0.6662F + ((float)Math.PI / 2F)) * 0.4F) * par2; -+ float var18 = Math.abs(MathHelper.sin(par1 * 0.6662F + ((float)Math.PI * 3F / 2F)) * 0.4F) * par2; - this.spiderLeg1.rotateAngleY += var11; - this.spiderLeg2.rotateAngleY += -var11; - this.spiderLeg3.rotateAngleY += var12; ---- net/minecraft/src/BlockSandStone.java -+++ net/minecraft/src/BlockSandStone.java -@@ -3,51 +3,64 @@ - import java.util.List; - - public class BlockSandStone extends Block { -- public static final String[] a = new String[]{"default", "chiseled", "smooth"}; -- private static final String[] b = new String[]{"normal", "carved", "smooth"}; -+ public static final String[] SAND_STONE_TYPES = new String[] {"default", "chiseled", "smooth"}; -+ private static final String[] field_94405_b = new String[] {"normal", "carved", "smooth"}; - private Icon[] field_94406_c; - private Icon field_94403_cO; - private Icon field_94404_cP; - -- public BlockSandStone(int var1) { -- super(var1, Material.rock); -+ public BlockSandStone(int par1) { -+ super(par1, Material.rock); - this.setCreativeTab(CreativeTabs.tabBlock); - } - -- public Icon getIcon(int var1, int var2) { -- if(var1 != 1 && (var1 != 0 || var2 != 1 && var2 != 2)) { -- if(var1 == 0) { -+ /** -+ * From the specified side and block metadata retrieves the blocks texture. Args: side, metadata -+ */ -+ public Icon getIcon(int par1, int par2) { -+ if (par1 != 1 && (par1 != 0 || par2 != 1 && par2 != 2)) { -+ if (par1 == 0) { - return this.field_94404_cP; - } else { -- if(var2 < 0 || var2 >= this.field_94406_c.length) { -- var2 = 0; -+ if (par2 < 0 || par2 >= this.field_94406_c.length) { -+ par2 = 0; - } - -- return this.field_94406_c[var2]; -+ return this.field_94406_c[par2]; - } - } else { - return this.field_94403_cO; - } - } - -- public int damageDropped(int var1) { -- return var1; -- } -- -- public void getSubBlocks(int var1, CreativeTabs var2, List var3) { -- var3.add(new ItemStack(var1, 1, 0)); -- var3.add(new ItemStack(var1, 1, 1)); -- var3.add(new ItemStack(var1, 1, 2)); -- } -- -- public void registerIcons(IconRegister var1) { -- this.field_94406_c = new Icon[b.length]; -- -- for(int var2 = 0; var2 < this.field_94406_c.length; ++var2) { -- this.field_94406_c[var2] = var1.registerIcon(this.getTextureName() + "_" + b[var2]); -+ /** -+ * Determines the damage on the item the block drops. Used in cloth and wood. -+ */ -+ public int damageDropped(int par1) { -+ return par1; -+ } -+ -+ /** -+ * returns a list of blocks with the same ID, but different meta (eg: wood returns 4 blocks) -+ */ -+ public void getSubBlocks(int par1, CreativeTabs par2CreativeTabs, List par3List) { -+ par3List.add(new ItemStack(par1, 1, 0)); -+ par3List.add(new ItemStack(par1, 1, 1)); -+ par3List.add(new ItemStack(par1, 1, 2)); -+ } -+ -+ /** -+ * When this method is called, your block should register all the icons it needs with the given IconRegister. This is -+ * the only chance you get to register icons. -+ */ -+ public void registerIcons(IconRegister par1IconRegister) { -+ this.field_94406_c = new Icon[field_94405_b.length]; -+ -+ for (int var2 = 0; var2 < this.field_94406_c.length; ++var2) { -+ this.field_94406_c[var2] = par1IconRegister.registerIcon(this.getTextureName() + "_" + field_94405_b[var2]); - } - -- this.field_94403_cO = var1.registerIcon(this.getTextureName() + "_top"); -- this.field_94404_cP = var1.registerIcon(this.getTextureName() + "_bottom"); -+ this.field_94403_cO = par1IconRegister.registerIcon(this.getTextureName() + "_top"); -+ this.field_94404_cP = par1IconRegister.registerIcon(this.getTextureName() + "_bottom"); - } - } ---- net/minecraft/src/ItemSkull.java -+++ net/minecraft/src/ItemSkull.java -@@ -3,110 +3,129 @@ - import java.util.List; - - public class ItemSkull extends Item { -- private static final String[] b = new String[]{"skeleton", "wither", "zombie", "char", "creeper"}; -- public static final String[] a = new String[]{"skeleton", "wither", "zombie", "steve", "creeper"}; -+ private static final String[] skullTypes = new String[] {"skeleton", "wither", "zombie", "char", "creeper"}; -+ public static final String[] field_94587_a = new String[] {"skeleton", "wither", "zombie", "steve", "creeper"}; - private Icon[] field_94586_c; - -- public ItemSkull(int var1) { -- super(var1); -+ public ItemSkull(int par1) { -+ super(par1); - this.setCreativeTab(CreativeTabs.tabDecorations); - this.setMaxDamage(0); - this.setHasSubtypes(true); - } - -- public boolean onItemUse(ItemStack var1, EntityPlayer var2, World var3, int var4, int var5, int var6, int var7, float var8, float var9, float var10) { -- if(var7 == 0) { -+ /** -+ * Callback for item usage. If the item does something special on right clicking, he will have one of those. Return -+ * True if something happen and false if it don't. This is for ITEMS, not BLOCKS -+ */ -+ public boolean onItemUse(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, World par3World, int par4, int par5, int par6, int par7, float par8, float par9, float par10) { -+ if (par7 == 0) { - return false; -- } else if(!var3.getBlockMaterial(var4, var5, var6).isSolid()) { -+ } else if (!par3World.getBlockMaterial(par4, par5, par6).isSolid()) { - return false; - } else { -- if(var7 == 1) { -- ++var5; -- } -- -- if(var7 == 2) { -- --var6; -- } -- -- if(var7 == 3) { -- ++var6; -- } -- -- if(var7 == 4) { -- --var4; -- } -- -- if(var7 == 5) { -- ++var4; -- } -- -- if(!var2.canPlayerEdit(var4, var5, var6, var7, var1)) { -+ if (par7 == 1) { -+ ++par5; -+ } -+ -+ if (par7 == 2) { -+ --par6; -+ } -+ -+ if (par7 == 3) { -+ ++par6; -+ } -+ -+ if (par7 == 4) { -+ --par4; -+ } -+ -+ if (par7 == 5) { -+ ++par4; -+ } -+ -+ if (!par2EntityPlayer.canPlayerEdit(par4, par5, par6, par7, par1ItemStack)) { - return false; -- } else if(!Block.skull.canPlaceBlockAt(var3, var4, var5, var6)) { -+ } else if (!Block.skull.canPlaceBlockAt(par3World, par4, par5, par6)) { - return false; - } else { -- var3.setBlock(var4, var5, var6, Block.skull.blockID, var7, 2); -+ par3World.setBlock(par4, par5, par6, Block.skull.blockID, par7, 2); - int var11 = 0; -- if(var7 == 1) { -- var11 = MathHelper.floor_double((double)(var2.rotationYaw * 16.0F / 360.0F) + 0.5D) & 15; -+ -+ if (par7 == 1) { -+ var11 = MathHelper.floor_double((double)(par2EntityPlayer.rotationYaw * 16.0F / 360.0F) + 0.5D) & 15; - } - -- TileEntity var12 = var3.getBlockTileEntity(var4, var5, var6); -- if(var12 != null && var12 instanceof TileEntitySkull) { -+ TileEntity var12 = par3World.getBlockTileEntity(par4, par5, par6); -+ -+ if (var12 != null && var12 instanceof TileEntitySkull) { - String var13 = ""; -- if(var1.hasTagCompound() && var1.getTagCompound().hasKey("SkullOwner")) { -- var13 = var1.getTagCompound().getString("SkullOwner"); -+ -+ if (par1ItemStack.hasTagCompound() && par1ItemStack.getTagCompound().hasKey("SkullOwner")) { -+ var13 = par1ItemStack.getTagCompound().getString("SkullOwner"); - } - -- ((TileEntitySkull)var12).setSkullType(var1.getItemDamage(), var13); -+ ((TileEntitySkull)var12).setSkullType(par1ItemStack.getItemDamage(), var13); - ((TileEntitySkull)var12).setSkullRotation(var11); -- ((BlockSkull)Block.skull).makeWither(var3, var4, var5, var6, (TileEntitySkull)var12); -+ ((BlockSkull)Block.skull).makeWither(par3World, par4, par5, par6, (TileEntitySkull)var12); - } - -- --var1.stackSize; -+ --par1ItemStack.stackSize; - return true; - } - } - } - -- public void getSubItems(int var1, CreativeTabs var2, List var3) { -- for(int var4 = 0; var4 < b.length; ++var4) { -- var3.add(new ItemStack(var1, 1, var4)); -- } -- -- } -- -- public Icon getIconFromDamage(int var1) { -- if(var1 < 0 || var1 >= b.length) { -- var1 = 0; -- } -- -- return this.field_94586_c[var1]; -- } -- -- public int getMetadata(int var1) { -- return var1; -- } -- -- public String getUnlocalizedName(ItemStack var1) { -- int var2 = var1.getItemDamage(); -- if(var2 < 0 || var2 >= b.length) { -+ /** -+ * returns a list of items with the same ID, but different meta (eg: dye returns 16 items) -+ */ -+ public void getSubItems(int par1, CreativeTabs par2CreativeTabs, List par3List) { -+ for (int var4 = 0; var4 < skullTypes.length; ++var4) { -+ par3List.add(new ItemStack(par1, 1, var4)); -+ } -+ } -+ -+ /** -+ * Gets an icon index based on an item's damage value -+ */ -+ public Icon getIconFromDamage(int par1) { -+ if (par1 < 0 || par1 >= skullTypes.length) { -+ par1 = 0; -+ } -+ -+ return this.field_94586_c[par1]; -+ } -+ -+ /** -+ * Returns the metadata of the block which this Item (ItemBlock) can place -+ */ -+ public int getMetadata(int par1) { -+ return par1; -+ } -+ -+ /** -+ * Returns the unlocalized name of this item. This version accepts an ItemStack so different stacks can have different -+ * names based on their damage or NBT. -+ */ -+ public String getUnlocalizedName(ItemStack par1ItemStack) { -+ int var2 = par1ItemStack.getItemDamage(); -+ -+ if (var2 < 0 || var2 >= skullTypes.length) { - var2 = 0; - } - -- return super.getUnlocalizedName() + "." + b[var2]; -- } -- -- public String getItemDisplayName(ItemStack var1) { -- return var1.getItemDamage() == 3 && var1.hasTagCompound() && var1.getTagCompound().hasKey("SkullOwner") ? StatCollector.translateToLocalFormatted("item.skull.player.name", new Object[]{var1.getTagCompound().getString("SkullOwner")}) : super.getItemDisplayName(var1); -- } -- -- public void registerIcons(IconRegister var1) { -- this.field_94586_c = new Icon[a.length]; -- -- for(int var2 = 0; var2 < a.length; ++var2) { -- this.field_94586_c[var2] = var1.registerIcon(this.getIconString() + "_" + a[var2]); -+ return super.getUnlocalizedName() + "." + skullTypes[var2]; -+ } -+ -+ public String getItemDisplayName(ItemStack par1ItemStack) { -+ return par1ItemStack.getItemDamage() == 3 && par1ItemStack.hasTagCompound() && par1ItemStack.getTagCompound().hasKey("SkullOwner") ? StatCollector.translateToLocalFormatted("item.skull.player.name", new Object[] {par1ItemStack.getTagCompound().getString("SkullOwner")}): super.getItemDisplayName(par1ItemStack); -+ } -+ -+ public void registerIcons(IconRegister par1IconRegister) { -+ this.field_94586_c = new Icon[field_94587_a.length]; -+ -+ for (int var2 = 0; var2 < field_94587_a.length; ++var2) { -+ this.field_94586_c[var2] = par1IconRegister.registerIcon(this.getIconString() + "_" + field_94587_a[var2]); - } -- - } - } ---- /dev/null -+++ org/spoutcraft/client/gui/minimap/HeightMapCheckBox.java -@@ -1,0 +1,35 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.client.gui.minimap; -+ -+import org.spoutcraft.api.gui.GenericCheckBox; -+ -+public class HeightMapCheckBox extends GenericCheckBox { -+ public HeightMapCheckBox() { -+ super("Show Height Map"); -+ setChecked(MinimapConfig.getInstance().isHeightmap()); -+ setTooltip("If enabled, shows a heightmap in the minimap and the overview map."); -+ } -+ -+ @Override -+ public void onButtonClick() { -+ MinimapConfig.getInstance().setHeightmap(this.isChecked()); -+ } -+} ---- net/minecraft/src/EntityAITempt.java -+++ net/minecraft/src/EntityAITempt.java -@@ -1,35 +1,64 @@ - package net.minecraft.src; - - public class EntityAITempt extends EntityAIBase { -+ -+ /** The entity using this AI that is tempted by the player. */ - private EntityCreature temptedEntity; - private double field_75282_b; -+ -+ /** X position of player tempting this mob */ - private double targetX; -+ -+ /** Y position of player tempting this mob */ - private double targetY; -+ -+ /** Z position of player tempting this mob */ - private double targetZ; - private double field_75278_f; - private double field_75279_g; -+ -+ /** The player that is tempting the entity that is using this AI. */ - private EntityPlayer temptingPlayer; -+ -+ /** -+ * A counter that is decremented each time the shouldExecute method is called. The shouldExecute method will always -+ * return false if delayTemptCounter is greater than 0. -+ */ - private int delayTemptCounter; -+ -+ /** True if this EntityAITempt task is running */ - private boolean isRunning; -+ -+ /** -+ * This field saves the ID of the items that can be used to breed entities with this behaviour. -+ */ - private int breedingFood; -+ -+ /** -+ * Whether the entity using this AI will be scared by the tempter's sudden movement. -+ */ - private boolean scaredByPlayerMovement; - private boolean field_75286_m; - -- public EntityAITempt(EntityCreature var1, double var2, int var4, boolean var5) { -- this.temptedEntity = var1; -- this.field_75282_b = var2; -- this.breedingFood = var4; -- this.scaredByPlayerMovement = var5; -+ public EntityAITempt(EntityCreature par1EntityCreature, double par2, int par4, boolean par5) { -+ this.temptedEntity = par1EntityCreature; -+ this.field_75282_b = par2; -+ this.breedingFood = par4; -+ this.scaredByPlayerMovement = par5; - this.setMutexBits(3); - } - -+ /** -+ * Returns whether the EntityAIBase should begin execution. -+ */ - public boolean shouldExecute() { -- if(this.delayTemptCounter > 0) { -+ if (this.delayTemptCounter > 0) { - --this.delayTemptCounter; - return false; - } else { - this.temptingPlayer = this.temptedEntity.worldObj.getClosestPlayerToEntity(this.temptedEntity, 10.0D); -- if(this.temptingPlayer == null) { -+ -+ if (this.temptingPlayer == null) { - return false; - } else { - ItemStack var1 = this.temptingPlayer.getCurrentEquippedItem(); -@@ -38,14 +67,17 @@ - } - } - -+ /** -+ * Returns whether an in-progress EntityAIBase should continue executing -+ */ - public boolean continueExecuting() { -- if(this.scaredByPlayerMovement) { -- if(this.temptedEntity.getDistanceSqToEntity(this.temptingPlayer) < 36.0D) { -- if(this.temptingPlayer.getDistanceSq(this.targetX, this.targetY, this.targetZ) > 0.1D * 0.1D) { -+ if (this.scaredByPlayerMovement) { -+ if (this.temptedEntity.getDistanceSqToEntity(this.temptingPlayer) < 36.0D) { -+ if (this.temptingPlayer.getDistanceSq(this.targetX, this.targetY, this.targetZ) > 0.010000000000000002D) { - return false; - } - -- if(Math.abs((double)this.temptingPlayer.rotationPitch - this.field_75278_f) > 5.0D || Math.abs((double)this.temptingPlayer.rotationYaw - this.field_75279_g) > 5.0D) { -+ if (Math.abs((double)this.temptingPlayer.rotationPitch - this.field_75278_f) > 5.0D || Math.abs((double)this.temptingPlayer.rotationYaw - this.field_75279_g) > 5.0D) { - return false; - } - } else { -@@ -61,6 +93,9 @@ - return this.shouldExecute(); - } - -+ /** -+ * Execute a one shot task or start executing a continuous task -+ */ - public void startExecuting() { - this.targetX = this.temptingPlayer.posX; - this.targetY = this.temptingPlayer.posY; -@@ -70,6 +105,9 @@ - this.temptedEntity.getNavigator().setAvoidsWater(false); - } - -+ /** -+ * Resets the task -+ */ - public void resetTask() { - this.temptingPlayer = null; - this.temptedEntity.getNavigator().clearPathEntity(); -@@ -78,16 +116,22 @@ - this.temptedEntity.getNavigator().setAvoidsWater(this.field_75286_m); - } - -+ /** -+ * Updates the task -+ */ - public void updateTask() { - this.temptedEntity.getLookHelper().setLookPositionWithEntity(this.temptingPlayer, 30.0F, (float)this.temptedEntity.getVerticalFaceSpeed()); -- if(this.temptedEntity.getDistanceSqToEntity(this.temptingPlayer) < 6.25D) { -+ -+ if (this.temptedEntity.getDistanceSqToEntity(this.temptingPlayer) < 6.25D) { - this.temptedEntity.getNavigator().clearPathEntity(); - } else { - this.temptedEntity.getNavigator().tryMoveToEntityLiving(this.temptingPlayer, this.field_75282_b); - } -- - } - -+ /** -+ * @see #isRunning -+ */ - public boolean isRunning() { - return this.isRunning; - } ---- net/minecraft/src/RenderHorse.java -+++ net/minecraft/src/RenderHorse.java -@@ -5,81 +5,96 @@ - import org.lwjgl.opengl.GL11; - - public class RenderHorse extends RenderLiving { -- private static final Map a = Maps.newHashMap(); -+ private static final Map field_110852_a = Maps.newHashMap(); - private static final ResourceLocation whiteHorseTextures = new ResourceLocation("textures/entity/horse/horse_white.png"); - private static final ResourceLocation muleTextures = new ResourceLocation("textures/entity/horse/mule.png"); - private static final ResourceLocation donkeyTextures = new ResourceLocation("textures/entity/horse/donkey.png"); - private static final ResourceLocation zombieHorseTextures = new ResourceLocation("textures/entity/horse/horse_zombie.png"); - private static final ResourceLocation skeletonHorseTextures = new ResourceLocation("textures/entity/horse/horse_skeleton.png"); - -- public RenderHorse(ModelBase var1, float var2) { -- super(var1, var2); -+ public RenderHorse(ModelBase par1ModelBase, float par2) { -+ super(par1ModelBase, par2); - } - -- protected void func_110847_a(EntityHorse var1, float var2) { -+ protected void func_110847_a(EntityHorse par1EntityHorse, float par2) { - float var3 = 1.0F; -- int var4 = var1.getHorseType(); -- if(var4 == 1) { -+ int var4 = par1EntityHorse.getHorseType(); -+ -+ if (var4 == 1) { - var3 *= 0.87F; -- } else if(var4 == 2) { -+ } else if (var4 == 2) { - var3 *= 0.92F; - } - - GL11.glScalef(var3, var3, var3); -- super.preRenderCallback(var1, var2); -+ super.preRenderCallback(par1EntityHorse, par2); - } - -- protected void func_110846_a(EntityHorse var1, float var2, float var3, float var4, float var5, float var6, float var7) { -- if(var1.isInvisible()) { -- this.mainModel.setRotationAngles(var2, var3, var4, var5, var6, var7, var1); -+ protected void func_110846_a(EntityHorse par1EntityHorse, float par2, float par3, float par4, float par5, float par6, float par7) { -+ if (par1EntityHorse.isInvisible()) { -+ this.mainModel.setRotationAngles(par2, par3, par4, par5, par6, par7, par1EntityHorse); - } else { -- this.bindEntityTexture(var1); -- this.mainModel.render(var1, var2, var3, var4, var5, var6, var7); -+ this.bindEntityTexture(par1EntityHorse); -+ this.mainModel.render(par1EntityHorse, par2, par3, par4, par5, par6, par7); - } -- - } - -- protected ResourceLocation func_110849_a(EntityHorse var1) { -- if(!var1.func_110239_cn()) { -- switch(var1.getHorseType()) { -- case 0: -- default: -- return whiteHorseTextures; -- case 1: -- return donkeyTextures; -- case 2: -- return muleTextures; -- case 3: -- return zombieHorseTextures; -- case 4: -- return skeletonHorseTextures; -+ protected ResourceLocation func_110849_a(EntityHorse par1EntityHorse) { -+ if (!par1EntityHorse.func_110239_cn()) { -+ switch (par1EntityHorse.getHorseType()) { -+ case 0: -+ default: -+ return whiteHorseTextures; -+ -+ case 1: -+ return donkeyTextures; -+ -+ case 2: -+ return muleTextures; -+ -+ case 3: -+ return zombieHorseTextures; -+ -+ case 4: -+ return skeletonHorseTextures; - } - } else { -- return this.func_110848_b(var1); -+ return this.func_110848_b(par1EntityHorse); - } - } - -- private ResourceLocation func_110848_b(EntityHorse var1) { -- String var2 = var1.getHorseTexture(); -- ResourceLocation var3 = (ResourceLocation)a.get(var2); -- if(var3 == null) { -+ private ResourceLocation func_110848_b(EntityHorse par1EntityHorse) { -+ String var2 = par1EntityHorse.getHorseTexture(); -+ ResourceLocation var3 = (ResourceLocation)field_110852_a.get(var2); -+ -+ if (var3 == null) { - var3 = new ResourceLocation(var2); -- Minecraft.getMinecraft().getTextureManager().loadTexture(var3, new LayeredTexture(var1.getVariantTexturePaths())); -- a.put(var2, var3); -+ Minecraft.getMinecraft().getTextureManager().loadTexture(var3, new LayeredTexture(par1EntityHorse.getVariantTexturePaths())); -+ field_110852_a.put(var2, var3); - } - - return var3; - } - -- protected void preRenderCallback(EntityLivingBase var1, float var2) { -- this.func_110847_a((EntityHorse)var1, var2); -- } -- -- protected void renderModel(EntityLivingBase var1, float var2, float var3, float var4, float var5, float var6, float var7) { -- this.func_110846_a((EntityHorse)var1, var2, var3, var4, var5, var6, var7); -- } -- -- protected ResourceLocation getEntityTexture(Entity var1) { -- return this.func_110849_a((EntityHorse)var1); -+ /** -+ * Allows the render to do any OpenGL state modifications necessary before the model is rendered. Args: entityLiving, -+ * partialTickTime -+ */ -+ protected void preRenderCallback(EntityLivingBase par1EntityLivingBase, float par2) { -+ this.func_110847_a((EntityHorse)par1EntityLivingBase, par2); -+ } -+ -+ /** -+ * Renders the model in RenderLiving -+ */ -+ protected void renderModel(EntityLivingBase par1EntityLivingBase, float par2, float par3, float par4, float par5, float par6, float par7) { -+ this.func_110846_a((EntityHorse)par1EntityLivingBase, par2, par3, par4, par5, par6, par7); -+ } -+ -+ /** -+ * Returns the location of an entity's texture. Doesn't seem to be called unless you call Render.bindEntityTexture. -+ */ -+ protected ResourceLocation getEntityTexture(Entity par1Entity) { -+ return this.func_110849_a((EntityHorse)par1Entity); - } - } ---- net/minecraft/src/Language.java -+++ net/minecraft/src/Language.java -@@ -1,20 +1,20 @@ - package net.minecraft.src; - - public class Language implements Comparable { -- private final String a; -- private final String b; -- private final String c; -+ private final String languageCode; -+ private final String region; -+ private final String name; - private final boolean bidirectional; - -- public Language(String var1, String var2, String var3, boolean var4) { -- this.a = var1; -- this.b = var2; -- this.c = var3; -- this.bidirectional = var4; -+ public Language(String par1Str, String par2Str, String par3Str, boolean par4) { -+ this.languageCode = par1Str; -+ this.region = par2Str; -+ this.name = par3Str; -+ this.bidirectional = par4; - } - - public String getLanguageCode() { -- return this.a; -+ return this.languageCode; - } - - public boolean isBidirectional() { -@@ -22,22 +22,22 @@ - } - - public String toString() { -- return String.format("%s (%s)", new Object[]{this.c, this.b}); -+ return String.format("%s (%s)", new Object[] {this.name, this.region}); - } - -- public boolean equals(Object var1) { -- return this == var1 ? true : (!(var1 instanceof Language) ? false : this.a.equals(((Language)var1).a)); -+ public boolean equals(Object par1Obj) { -+ return this == par1Obj ? true : (!(par1Obj instanceof Language) ? false : this.languageCode.equals(((Language)par1Obj).languageCode)); - } - - public int hashCode() { -- return this.a.hashCode(); -- } -- -- public int func_135033_a(Language var1) { -- return this.a.compareTo(var1.a); -- } -- -- public int compareTo(Object var1) { -- return this.func_135033_a((Language)var1); -+ return this.languageCode.hashCode(); -+ } -+ -+ public int func_135033_a(Language par1Language) { -+ return this.languageCode.compareTo(par1Language.languageCode); -+ } -+ -+ public int compareTo(Object par1Obj) { -+ return this.func_135033_a((Language)par1Obj); - } - } ---- net/minecraft/src/EnchantmentOxygen.java -+++ net/minecraft/src/EnchantmentOxygen.java -@@ -1,19 +1,28 @@ - package net.minecraft.src; - - public class EnchantmentOxygen extends Enchantment { -- public EnchantmentOxygen(int var1, int var2) { -- super(var1, var2, EnumEnchantmentType.armor_head); -+ public EnchantmentOxygen(int par1, int par2) { -+ super(par1, par2, EnumEnchantmentType.armor_head); - this.setName("oxygen"); - } - -- public int getMinEnchantability(int var1) { -- return 10 * var1; -- } -- -- public int getMaxEnchantability(int var1) { -- return this.getMinEnchantability(var1) + 30; -- } -- -+ /** -+ * Returns the minimal value of enchantability needed on the enchantment level passed. -+ */ -+ public int getMinEnchantability(int par1) { -+ return 10 * par1; -+ } -+ -+ /** -+ * Returns the maximum value of enchantability nedded on the enchantment level passed. -+ */ -+ public int getMaxEnchantability(int par1) { -+ return this.getMinEnchantability(par1) + 30; -+ } -+ -+ /** -+ * Returns the maximum level that the enchantment can have. -+ */ - public int getMaxLevel() { - return 3; - } ---- /dev/null -+++ org/spoutcraft/client/gui/ScreenUtil.java -@@ -1,0 +1,170 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.client.gui; -+ -+import net.minecraft.src.GuiAchievements; -+import net.minecraft.src.GuiBrewingStand; -+import net.minecraft.src.GuiChat; -+import net.minecraft.src.GuiChest; -+import net.minecraft.src.GuiContainerCreative; -+import net.minecraft.src.GuiCrafting; -+import net.minecraft.src.GuiDispenser; -+import net.minecraft.src.GuiEditSign; -+import net.minecraft.src.GuiEnchantment; -+import net.minecraft.src.GuiFurnace; -+import net.minecraft.src.GuiGameOver; -+import net.minecraft.src.GuiIngameMenu; -+import net.minecraft.src.GuiInventory; -+import net.minecraft.src.GuiLanguage; -+import net.minecraft.src.GuiScreen; -+import net.minecraft.src.GuiSleepMP; -+import net.minecraft.src.GuiStats; -+import net.minecraft.src.GuiWinGame; -+import net.minecraft.src.StatFileWriter; -+ -+import org.spoutcraft.api.gui.ScreenType; -+import org.spoutcraft.client.SpoutClient; -+import org.spoutcraft.client.controls.GuiAmbigousInput; -+import org.spoutcraft.client.gui.controls.GuiControls; -+import org.spoutcraft.client.gui.controls.GuiEditShortcut; -+import org.spoutcraft.client.gui.minimap.GuiAddWaypoint; -+import org.spoutcraft.client.gui.minimap.GuiMinimapMenu; -+import org.spoutcraft.client.gui.minimap.GuiMoveMinimap; -+import org.spoutcraft.client.gui.minimap.GuiOverviewMap; -+import org.spoutcraft.client.gui.settings.GuiAdvancedOptions; -+import org.spoutcraft.client.gui.settings.GuiSimpleOptions; -+ -+public class ScreenUtil { -+ public static void open(ScreenType type) { -+ GuiScreen toOpen = null; -+ StatFileWriter statfile = SpoutClient.getHandle().statFileWriter; -+ switch(type) { -+ case CHAT_SCREEN: -+ toOpen = new GuiChat(); -+ break; -+ case SLEEP_SCREEN: -+ toOpen = new GuiSleepMP(); -+ break; -+ case PLAYER_INVENTORY: -+ toOpen = new GuiInventory(SpoutClient.getHandle().thePlayer); -+ break; -+ case INGAME_MENU: -+ toOpen = new GuiIngameMenu(); -+ break; -+ case OPTIONS_MENU: -+ toOpen = GuiSimpleOptions.constructOptionsScreen(new GuiIngameMenu()); -+ break; -+ case VIDEO_SETTINGS_MENU: -+ toOpen = GuiSimpleOptions.constructOptionsScreen(new GuiIngameMenu()); -+ break; -+ case CONTROLS_MENU: -+ toOpen = new GuiControls(GuiSimpleOptions.constructOptionsScreen(new GuiIngameMenu())); -+ break; -+ case ACHIEVEMENTS_SCREEN: -+ toOpen = new GuiAchievements(statfile); -+ break; -+ case STATISTICS_SCREEN: -+ toOpen = new GuiStats(new GuiIngameMenu(), statfile); -+ break; -+ case GAME_OVER_SCREEN: -+ toOpen = new GuiGameOver(); -+ break; -+ case CHANGE_LANGUAGE: -+ //TODO: broken -+ //toOpen = new GuiLanguage(GuiSimpleOptions.constructOptionsScreen(new GuiIngameMenu()), SpoutClient.getHandle().gameSettings); -+ break; -+ case MINIMAP_SETTINGS: -+ toOpen = new GuiMinimapMenu(GuiSimpleOptions.constructOptionsScreen(new GuiIngameMenu())); -+ break; -+ case MOVE_MINIMAP: -+ toOpen = new GuiMoveMinimap(new GuiMinimapMenu(GuiSimpleOptions.constructOptionsScreen(new GuiIngameMenu()))); -+ break; -+ case OVERVIEW_MAP: -+ toOpen = new GuiOverviewMap(); -+ break; -+ case WIN_GAME: -+ toOpen = new GuiWinGame(); -+ break; -+ } -+ SpoutClient.getHandle().displayGuiScreen(toOpen); -+ } -+ -+ public static ScreenType getType(GuiScreen gui) { -+ ScreenType screen = ScreenType.UNKNOWN; -+ if (gui == null) { -+ screen = ScreenType.GAME_SCREEN; -+ } -+ if (gui instanceof CustomScreen) { -+ screen = ScreenType.CUSTOM_SCREEN; -+ } else if (gui instanceof GuiAdvancedOptions) { -+ screen = ScreenType.VIDEO_SETTINGS_MENU; -+ } else if (gui instanceof GuiAchievements) { -+ screen = ScreenType.ACHIEVEMENTS_SCREEN; -+ } else if (gui instanceof GuiAddWaypoint) { -+ screen = ScreenType.ADD_WAYPOINT; -+ } else if (gui instanceof GuiSleepMP) { -+ screen = ScreenType.SLEEP_SCREEN; -+ } else if (gui instanceof GuiChat) { -+ screen = ScreenType.CHAT_SCREEN; -+ } else if (gui instanceof GuiBrewingStand) { -+ screen = ScreenType.BREWING_STAND_INVENTORY; -+ } else if (gui instanceof GuiChest) { -+ screen = ScreenType.CHEST_INVENTORY; -+ } else if (gui instanceof GuiContainerCreative) { -+ screen = ScreenType.PLAYER_INVENTORY_CREATIVE; -+ } else if (gui instanceof GuiCrafting) { -+ screen = ScreenType.WORKBENCH_INVENTORY; -+ } else if (gui instanceof GuiDispenser) { -+ screen = ScreenType.DISPENSER_INVENTORY; -+ } else if (gui instanceof GuiEnchantment) { -+ screen = ScreenType.ENCHANTMENT_INVENTORY; -+ } else if (gui instanceof GuiFurnace) { -+ screen = ScreenType.FURNACE_INVENTORY; -+ } else if (gui instanceof GuiInventory) { -+ screen = ScreenType.PLAYER_INVENTORY; -+ } else if (gui instanceof GuiEditShortcut) { -+ screen = ScreenType.EDIT_SHORTCUT; -+ } else if (gui instanceof GuiEditSign) { -+ screen = ScreenType.SIGN_SCREEN; -+ } else if (gui instanceof GuiGameOver) { -+ screen = ScreenType.GAME_OVER_SCREEN; -+ } else if (gui instanceof GuiIngameMenu) { -+ screen = ScreenType.INGAME_MENU; -+ } else if (gui instanceof GuiLanguage) { -+ screen = ScreenType.CHANGE_LANGUAGE; -+ } else if (gui instanceof GuiMinimapMenu) { -+ screen = ScreenType.MINIMAP_SETTINGS; -+ } else if (gui instanceof GuiAmbigousInput) { -+ screen = ScreenType.AMBIGUOUS_SHORTCUT; -+ } else if (gui instanceof GuiControls) { -+ screen = ScreenType.CONTROLS_MENU; -+ } else if (gui instanceof GuiMoveMinimap) { -+ screen = ScreenType.MOVE_MINIMAP; -+ } else if (gui instanceof GuiOverviewMap) { -+ screen = ScreenType.OVERVIEW_MAP; -+ } else if (gui instanceof GuiStats) { -+ screen = ScreenType.STATISTICS_SCREEN; -+ } else if (gui instanceof GuiWinGame) { -+ screen = ScreenType.WIN_GAME; -+ } -+ -+ return screen; -+ } -+} ---- /dev/null -+++ org/spoutcraft/client/packet/PacketValidatePrecache.java -@@ -1,0 +1,81 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.client.packet; -+ -+import java.io.IOException; -+ -+import org.spoutcraft.api.io.SpoutInputStream; -+import org.spoutcraft.api.io.SpoutOutputStream; -+import org.spoutcraft.client.precache.PrecacheManager; -+import org.spoutcraft.client.precache.PrecacheTuple; -+ -+public class PacketValidatePrecache implements SpoutPacket { -+ int count; -+ PrecacheTuple[] plugins; -+ -+ @Override -+ public void readData(SpoutInputStream input) throws IOException { -+ count = input.readInt(); -+ plugins = new PrecacheTuple[count]; -+ if (count > 0) { -+ for (int i = 0; i -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.api; -+ -+import java.util.HashMap; -+ -+/** -+ * Represents the art on a painting -+ */ -+public enum Art { -+ KEBAB(0,1,1), -+ AZTEC(1,1,1), -+ ALBAN(2,1,1), -+ AZTEC2(3,1,1), -+ BOMB(4,1,1), -+ PLANT(5,1,1), -+ WASTELAND(6,1,1), -+ POOL(7,2,1), -+ COURBET(8,2,1), -+ SEA(9,2,1), -+ SUNSET(10,2,1), -+ CREEBET(11,2,1), -+ WANDERER(12,1,2), -+ GRAHAM(13,1,2), -+ MATCH(14,4,2), -+ BUST(15,2,2), -+ STAGE(16,2,2), -+ VOID(17,2,2), -+ SKULL_AND_ROSES(18,2,2), -+ FIGHTERS(19,2,2), -+ POINTER(20,4,4), -+ PIGSCENE(21,4,4), -+ BURNINGSKULL(22,4,4), -+ SKELETON(23,4,3), -+ DONKEYKONG(24,4,3); -+ private int id, width, height; -+ private static HashMap names = new HashMap(); -+ private static HashMap ids = new HashMap(); -+ static { -+ for (Art art : Art.values()) { -+ ids.put(art.id, art); -+ names.put(art.toString(), art); -+ } -+ } -+ -+ private Art(int id, int width, int height) { -+ this.id = id; -+ this.width = width; -+ this.height = height; -+ } -+ -+ /** -+ * Gets the width of the painting, in blocks -+ * -+ * @return The width of the painting, in blocks -+ */ -+ public int getBlockWidth() { -+ return width; -+ } -+ -+ /** -+ * Gets the height of the painting, in blocks -+ * -+ * @return The height of the painting, in blocks -+ */ -+ public int getBlockHeight() { -+ return height; -+ } -+ -+ /** -+ * Get the ID of this painting. -+ * -+ * @return The ID of this painting -+ */ -+ public int getId() { -+ return id; -+ } -+ -+ /** -+ * Get a painting by its numeric ID -+ * -+ * @param id The ID -+ * @return The painting -+ */ -+ public static Art getById(int id) { -+ return ids.get(id); -+ } -+ -+ /** -+ * Get a painting by its unique name -+ * -+ * @param name The name -+ * @return The painting -+ */ -+ public static Art getByName(String name) { -+ return names.get(name); -+ } -+} ---- net/minecraft/src/MetadataSerializerRegistration.java -+++ net/minecraft/src/MetadataSerializerRegistration.java -@@ -2,16 +2,17 @@ - - class MetadataSerializerRegistration { - final MetadataSectionSerializer field_110502_a; -- final Class b; -+ final Class field_110500_b; -+ - final MetadataSerializer field_110501_c; - -- private MetadataSerializerRegistration(MetadataSerializer var1, MetadataSectionSerializer var2, Class var3) { -- this.field_110501_c = var1; -- this.field_110502_a = var2; -- this.b = var3; -+ private MetadataSerializerRegistration(MetadataSerializer par1MetadataSerializer, MetadataSectionSerializer par2MetadataSectionSerializer, Class par3Class) { -+ this.field_110501_c = par1MetadataSerializer; -+ this.field_110502_a = par2MetadataSectionSerializer; -+ this.field_110500_b = par3Class; - } - -- MetadataSerializerRegistration(MetadataSerializer var1, MetadataSectionSerializer var2, Class var3, MetadataSerializerEmptyAnon var4) { -- this(var1, var2, var3); -+ MetadataSerializerRegistration(MetadataSerializer par1MetadataSerializer, MetadataSectionSerializer par2MetadataSectionSerializer, Class par3Class, MetadataSerializerEmptyAnon par4MetadataSerializerEmptyAnon) { -+ this(par1MetadataSerializer, par2MetadataSectionSerializer, par3Class); - } - } ---- /dev/null -+++ com/prupe/mcpatcher/hd/FontUtils.java -@@ -1,0 +1,290 @@ -+package com.prupe.mcpatcher.hd; -+ -+import com.prupe.mcpatcher.Config; -+import com.prupe.mcpatcher.MCLogger; -+import com.prupe.mcpatcher.TexturePackAPI; -+import com.prupe.mcpatcher.TexturePackChangeHandler; -+import com.prupe.mcpatcher.hd.FontUtils$1; -+import java.awt.image.BufferedImage; -+import java.util.HashSet; -+import java.util.Iterator; -+import java.util.Properties; -+import java.util.Set; -+import java.util.Map.Entry; -+import net.minecraft.src.FontRenderer; -+import net.minecraft.src.ResourceLocation; -+ -+public class FontUtils { -+ private static final MCLogger logger = MCLogger.getLogger("HD Font"); -+ private static final boolean enable = Config.getBoolean("Extended HD", "hdFont", true); -+ private static final boolean enableNonHD = Config.getBoolean("Extended HD", "nonHDFontWidth", false); -+ private static final int ROWS = 16; -+ private static final int COLS = 16; -+ public static final char[] AVERAGE_CHARS = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123467890".toCharArray(); -+ public static final int[] SPACERS = new int[] {33721342, 41975936, 234881023}; -+ private static final boolean showLines = false; -+ private static final Set allRenderers = new HashSet(); -+ -+ static void init() {} -+ -+ public static ResourceLocation getFontName(FontRenderer fontRenderer, ResourceLocation font) { -+ if (fontRenderer.defaultFont == null) { -+ fontRenderer.defaultFont = font; -+ } -+ -+ if (fontRenderer.hdFont == null) { -+ String newFont = fontRenderer.defaultFont.getResourceDomain(); -+ String name = fontRenderer.defaultFont.getResourcePath().replaceAll(".*/", ""); -+ fontRenderer.hdFont = new ResourceLocation(newFont, "mcpatcher/font/" + name); -+ } -+ -+ ResourceLocation newFont1; -+ -+ if (enable && TexturePackAPI.hasResource(fontRenderer.hdFont)) { -+ logger.fine("using %s instead of %s", new Object[] {fontRenderer.hdFont, fontRenderer.defaultFont}); -+ fontRenderer.isHD = true; -+ newFont1 = fontRenderer.hdFont; -+ } else { -+ logger.fine("using default %s", new Object[] {fontRenderer.defaultFont}); -+ fontRenderer.isHD = enable && enableNonHD; -+ newFont1 = fontRenderer.defaultFont; -+ } -+ -+ fontRenderer.fontAdj = fontRenderer.isHD ? 0.0F : 1.0F; -+ return newFont1; -+ } -+ -+ public static float[] computeCharWidthsf(FontRenderer fontRenderer, ResourceLocation filename, BufferedImage image, int[] rgb, int[] charWidth, float fontAdj) { -+ float[] charWidthf = new float[charWidth.length]; -+ int width; -+ -+ if (!fontRenderer.isHD) { -+ fontRenderer.fontAdj = fontAdj; -+ -+ for (width = 0; width < charWidth.length; ++width) { -+ charWidthf[width] = (float)charWidth[width]; -+ } -+ -+ charWidthf[32] = 4.0F; -+ return charWidthf; -+ } else { -+ allRenderers.add(fontRenderer); -+ width = image.getWidth(); -+ int height = image.getHeight(); -+ int colWidth = width / 16; -+ int rowHeight = height / 16; -+ int isOverride = 0; -+ int ch; -+ -+ while (isOverride < charWidth.length) { -+ ch = isOverride / 16; -+ int col = isOverride % 16; -+ int colIdx = colWidth - 1; -+ label84: -+ -+ while (true) { -+ if (colIdx >= 0) { -+ int x = col * colWidth + colIdx; -+ int rowIdx = 0; -+ -+ while (true) { -+ if (rowIdx >= rowHeight) { -+ --colIdx; -+ continue label84; -+ } -+ -+ int y = ch * rowHeight + rowIdx; -+ int pixel = rgb[x + y * width]; -+ -+ if (isOpaque(pixel)) { -+ if (printThis(isOverride)) { -+ logger.finer("\'%c\' pixel (%d, %d) = %08x, colIdx = %d", new Object[] {Character.valueOf((char)isOverride), Integer.valueOf(x), Integer.valueOf(y), Integer.valueOf(pixel), Integer.valueOf(colIdx)}); -+ } -+ -+ charWidthf[isOverride] = 128.0F * (float)(colIdx + 1) / (float)width + 1.0F; -+ break; -+ } -+ -+ ++rowIdx; -+ } -+ } -+ -+ ++isOverride; -+ break; -+ } -+ } -+ -+ for (isOverride = 0; isOverride < charWidthf.length; ++isOverride) { -+ if (charWidthf[isOverride] <= 0.0F) { -+ charWidthf[isOverride] = 2.0F; -+ } else if (charWidthf[isOverride] >= 7.99F) { -+ charWidthf[isOverride] = 7.99F; -+ } -+ } -+ -+ boolean[] var20 = new boolean[charWidth.length]; -+ -+ try { -+ getCharWidthOverrides(filename, charWidthf, var20); -+ } catch (Throwable var19) { -+ var19.printStackTrace(); -+ } -+ -+ if (!var20[32]) { -+ charWidthf[32] = defaultSpaceWidth(charWidthf); -+ } -+ -+ for (ch = 0; ch < charWidth.length; ++ch) { -+ charWidth[ch] = Math.round(charWidthf[ch]); -+ -+ if (printThis(ch)) { -+ logger.finer("charWidth[\'%c\'] = %f", new Object[] {Character.valueOf((char)ch), Float.valueOf(charWidthf[ch])}); -+ } -+ } -+ -+ return charWidthf; -+ } -+ } -+ -+ private static float getCharWidthf(FontRenderer fontRenderer, char ch) { -+ float width = (float)fontRenderer.getCharWidth(ch); -+ return width >= 0.0F && fontRenderer.charWidthf != null && ch < fontRenderer.charWidthf.length && ch >= 0 ? fontRenderer.charWidthf[ch] : width; -+ } -+ -+ public static float getCharWidthf(FontRenderer fontRenderer, int[] charWidth, int ch) { -+ return fontRenderer.isHD ? fontRenderer.charWidthf[ch] * (float)fontRenderer.FONT_HEIGHT / 8.0F : (float)charWidth[ch]; -+ } -+ -+ public static float getStringWidthf(FontRenderer fontRenderer, String s) { -+ float totalWidth = 0.0F; -+ -+ if (s != null) { -+ boolean isLink = false; -+ -+ for (int i = 0; i < s.length(); ++i) { -+ char c = s.charAt(i); -+ float cWidth = getCharWidthf(fontRenderer, c); -+ -+ if (cWidth < 0.0F && i < s.length() - 1) { -+ ++i; -+ c = s.charAt(i); -+ -+ if (c != 108 && c != 76) { -+ if (c == 114 || c == 82) { -+ isLink = false; -+ } -+ } else { -+ isLink = true; -+ } -+ -+ cWidth = 0.0F; -+ } -+ -+ totalWidth += cWidth; -+ -+ if (isLink) { -+ ++totalWidth; -+ } -+ } -+ } -+ -+ return totalWidth; -+ } -+ -+ public static ResourceLocation getUnicodePage(ResourceLocation resource) { -+ if (enable && resource != null) { -+ ResourceLocation newResource = new ResourceLocation(resource.getResourceDomain(), resource.getResourcePath().replaceFirst("^textures/", "mcpatcher/")); -+ -+ if (TexturePackAPI.hasResource(newResource)) { -+ logger.fine("using %s instead of %s", new Object[] {newResource, resource}); -+ return newResource; -+ } -+ } -+ -+ return resource; -+ } -+ -+ private static boolean isOpaque(int pixel) { -+ int[] arr$ = SPACERS; -+ int len$ = arr$.length; -+ -+ for (int i$ = 0; i$ < len$; ++i$) { -+ int i = arr$[i$]; -+ -+ if (pixel == i) { -+ return false; -+ } -+ } -+ -+ return (pixel >> 24 & 240) > 0; -+ } -+ -+ private static boolean printThis(int ch) { -+ return "ABCDEF abcdef".indexOf(ch) >= 0; -+ } -+ -+ private static float defaultSpaceWidth(float[] charWidthf) { -+ if (TexturePackAPI.isDefaultTexturePack()) { -+ return 4.0F; -+ } else { -+ float sum = 0.0F; -+ int n = 0; -+ char[] arr$ = AVERAGE_CHARS; -+ int len$ = arr$.length; -+ -+ for (int i$ = 0; i$ < len$; ++i$) { -+ char ch = arr$[i$]; -+ -+ if (charWidthf[ch] > 0.0F) { -+ sum += charWidthf[ch]; -+ ++n; -+ } -+ } -+ -+ if (n > 0) { -+ return sum / (float)n * 7.0F / 12.0F; -+ } else { -+ return 4.0F; -+ } -+ } -+ } -+ -+ private static void getCharWidthOverrides(ResourceLocation font, float[] charWidthf, boolean[] isOverride) { -+ ResourceLocation textFile = TexturePackAPI.transformResourceLocation(font, ".png", ".properties"); -+ Properties props = TexturePackAPI.getProperties(textFile); -+ -+ if (props != null) { -+ logger.fine("reading character widths from %s", new Object[] {textFile}); -+ Iterator i$ = props.entrySet().iterator(); -+ -+ while (i$.hasNext()) { -+ Entry entry = (Entry)i$.next(); -+ String key = entry.getKey().toString().trim(); -+ String value = entry.getValue().toString().trim(); -+ -+ if (key.matches("^width\\.\\d+$") && !value.equals("")) { -+ try { -+ int e = Integer.parseInt(key.substring(6)); -+ float width = Float.parseFloat(value); -+ -+ if (e >= 0 && e < charWidthf.length) { -+ logger.finer("setting charWidthf[%d] to %f", new Object[] {Integer.valueOf(e), Float.valueOf(width)}); -+ charWidthf[e] = width; -+ isOverride[e] = true; -+ } -+ } catch (NumberFormatException var11) { -+ ; -+ } -+ } -+ } -+ } -+ } -+ -+ static Set access$000() { -+ return allRenderers; -+ } -+ -+ static { -+ TexturePackChangeHandler.register(new FontUtils$1("HD Font", 1)); -+ } -+} ---- /dev/null -+++ org/spoutcraft/client/inventory/SpoutcraftRecipe.java -@@ -1,0 +1,26 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.client.inventory; -+ -+import org.spoutcraft.api.inventory.Recipe; -+ -+public interface SpoutcraftRecipe extends Recipe { -+ void addToCraftingManager(); -+} ---- net/minecraft/src/DedicatedPlayerList.java -+++ net/minecraft/src/DedicatedPlayerList.java -@@ -9,17 +9,18 @@ - import net.minecraft.server.MinecraftServer; - - public class DedicatedPlayerList extends ServerConfigurationManager { -- private File d; -- private File e; -- -- public DedicatedPlayerList(DedicatedServer var1) { -- super(var1); -- this.d = var1.getFile("ops.txt"); -- this.e = var1.getFile("white-list.txt"); -- this.viewDistance = var1.getIntProperty("view-distance", 10); -- this.maxPlayers = var1.getIntProperty("max-players", 20); -- this.setWhiteListEnabled(var1.getBooleanProperty("white-list", false)); -- if(!var1.isSinglePlayer()) { -+ private File opsList; -+ private File whiteList; -+ -+ public DedicatedPlayerList(DedicatedServer par1DedicatedServer) { -+ super(par1DedicatedServer); -+ this.opsList = par1DedicatedServer.getFile("ops.txt"); -+ this.whiteList = par1DedicatedServer.getFile("white-list.txt"); -+ this.viewDistance = par1DedicatedServer.getIntProperty("view-distance", 10); -+ this.maxPlayers = par1DedicatedServer.getIntProperty("max-players", 20); -+ this.setWhiteListEnabled(par1DedicatedServer.getBooleanProperty("white-list", false)); -+ -+ if (!par1DedicatedServer.isSinglePlayer()) { - this.getBannedPlayers().setListActive(true); - this.getBannedIPs().setListActive(true); - } -@@ -31,38 +32,53 @@ - this.loadOpsList(); - this.readWhiteList(); - this.saveOpsList(); -- if(!this.e.exists()) { -+ -+ if (!this.whiteList.exists()) { - this.saveWhiteList(); - } -- - } - -- public void setWhiteListEnabled(boolean var1) { -- super.setWhiteListEnabled(var1); -- this.getDedicatedServerInstance().setProperty("white-list", Boolean.valueOf(var1)); -+ public void setWhiteListEnabled(boolean par1) { -+ super.setWhiteListEnabled(par1); -+ this.getDedicatedServerInstance().setProperty("white-list", Boolean.valueOf(par1)); - this.getDedicatedServerInstance().saveProperties(); - } - -- public void addOp(String var1) { -- super.addOp(var1); -- this.saveOpsList(); -- } -- -- public void removeOp(String var1) { -- super.removeOp(var1); -- this.saveOpsList(); -- } -- -- public void removeFromWhitelist(String var1) { -- super.removeFromWhitelist(var1); -- this.saveWhiteList(); -- } -- -- public void addToWhiteList(String var1) { -- super.addToWhiteList(var1); -- this.saveWhiteList(); -- } -- -+ /** -+ * This adds a username to the ops list, then saves the op list -+ */ -+ public void addOp(String par1Str) { -+ super.addOp(par1Str); -+ this.saveOpsList(); -+ } -+ -+ /** -+ * This removes a username from the ops list, then saves the op list -+ */ -+ public void removeOp(String par1Str) { -+ super.removeOp(par1Str); -+ this.saveOpsList(); -+ } -+ -+ /** -+ * Remove the specified player from the whitelist. -+ */ -+ public void removeFromWhitelist(String par1Str) { -+ super.removeFromWhitelist(par1Str); -+ this.saveWhiteList(); -+ } -+ -+ /** -+ * Add the specified player to the white list. -+ */ -+ public void addToWhiteList(String par1Str) { -+ super.addToWhiteList(par1Str); -+ this.saveWhiteList(); -+ } -+ -+ /** -+ * Either does nothing, or calls readWhiteList. -+ */ - public void loadWhiteList() { - this.readWhiteList(); - } -@@ -70,30 +86,25 @@ - private void loadOpsList() { - try { - this.getOps().clear(); -- BufferedReader var1 = new BufferedReader(new FileReader(this.d)); -+ BufferedReader var1 = new BufferedReader(new FileReader(this.opsList)); - String var2 = ""; - -- while(true) { -- var2 = var1.readLine(); -- if(var2 == null) { -- var1.close(); -- break; -- } -- -+ while ((var2 = var1.readLine()) != null) { - this.getOps().add(var2.trim().toLowerCase()); - } -+ -+ var1.close(); - } catch (Exception var3) { - this.getDedicatedServerInstance().getLogAgent().logWarning("Failed to load operators list: " + var3); - } -- - } - - private void saveOpsList() { - try { -- PrintWriter var1 = new PrintWriter(new FileWriter(this.d, false)); -+ PrintWriter var1 = new PrintWriter(new FileWriter(this.opsList, false)); - Iterator var2 = this.getOps().iterator(); - -- while(var2.hasNext()) { -+ while (var2.hasNext()) { - String var3 = (String)var2.next(); - var1.println(var3); - } -@@ -102,36 +113,30 @@ - } catch (Exception var4) { - this.getDedicatedServerInstance().getLogAgent().logWarning("Failed to save operators list: " + var4); - } -- - } - - private void readWhiteList() { - try { - this.getWhiteListedPlayers().clear(); -- BufferedReader var1 = new BufferedReader(new FileReader(this.e)); -+ BufferedReader var1 = new BufferedReader(new FileReader(this.whiteList)); - String var2 = ""; - -- while(true) { -- var2 = var1.readLine(); -- if(var2 == null) { -- var1.close(); -- break; -- } -- -+ while ((var2 = var1.readLine()) != null) { - this.getWhiteListedPlayers().add(var2.trim().toLowerCase()); - } -+ -+ var1.close(); - } catch (Exception var3) { - this.getDedicatedServerInstance().getLogAgent().logWarning("Failed to load white-list: " + var3); - } -- - } - - private void saveWhiteList() { - try { -- PrintWriter var1 = new PrintWriter(new FileWriter(this.e, false)); -+ PrintWriter var1 = new PrintWriter(new FileWriter(this.whiteList, false)); - Iterator var2 = this.getWhiteListedPlayers().iterator(); - -- while(var2.hasNext()) { -+ while (var2.hasNext()) { - String var3 = (String)var2.next(); - var1.println(var3); - } -@@ -140,12 +145,14 @@ - } catch (Exception var4) { - this.getDedicatedServerInstance().getLogAgent().logWarning("Failed to save white-list: " + var4); - } -- - } - -- public boolean isAllowedToLogin(String var1) { -- var1 = var1.trim().toLowerCase(); -- return !this.isWhiteListEnabled() || this.isPlayerOpped(var1) || this.getWhiteListedPlayers().contains(var1); -+ /** -+ * Determine if the player is allowed to connect based on current server settings. -+ */ -+ public boolean isAllowedToLogin(String par1Str) { -+ par1Str = par1Str.trim().toLowerCase(); -+ return !this.isWhiteListEnabled() || this.isPlayerOpped(par1Str) || this.getWhiteListedPlayers().contains(par1Str); - } - - public DedicatedServer getDedicatedServerInstance() { ---- net/minecraft/src/ItemBoat.java -+++ net/minecraft/src/ItemBoat.java -@@ -3,76 +3,84 @@ - import java.util.List; - - public class ItemBoat extends Item { -- public ItemBoat(int var1) { -- super(var1); -+ public ItemBoat(int par1) { -+ super(par1); - this.maxStackSize = 1; - this.setCreativeTab(CreativeTabs.tabTransport); - } - -- public ItemStack onItemRightClick(ItemStack var1, World var2, EntityPlayer var3) { -+ /** -+ * Called whenever this item is equipped and the right mouse button is pressed. Args: itemStack, world, entityPlayer -+ */ -+ public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) { - float var4 = 1.0F; -- float var5 = var3.prevRotationPitch + (var3.rotationPitch - var3.prevRotationPitch) * var4; -- float var6 = var3.prevRotationYaw + (var3.rotationYaw - var3.prevRotationYaw) * var4; -- double var7 = var3.prevPosX + (var3.posX - var3.prevPosX) * (double)var4; -- double var9 = var3.prevPosY + (var3.posY - var3.prevPosY) * (double)var4 + 1.62D - (double)var3.yOffset; -- double var11 = var3.prevPosZ + (var3.posZ - var3.prevPosZ) * (double)var4; -- Vec3 var13 = var2.getWorldVec3Pool().getVecFromPool(var7, var9, var11); -- float var14 = MathHelper.cos(-var6 * ((float)Math.PI / 180.0F) - (float)Math.PI); -- float var15 = MathHelper.sin(-var6 * ((float)Math.PI / 180.0F) - (float)Math.PI); -- float var16 = -MathHelper.cos(-var5 * ((float)Math.PI / 180.0F)); -- float var17 = MathHelper.sin(-var5 * ((float)Math.PI / 180.0F)); -+ float var5 = par3EntityPlayer.prevRotationPitch + (par3EntityPlayer.rotationPitch - par3EntityPlayer.prevRotationPitch) * var4; -+ float var6 = par3EntityPlayer.prevRotationYaw + (par3EntityPlayer.rotationYaw - par3EntityPlayer.prevRotationYaw) * var4; -+ double var7 = par3EntityPlayer.prevPosX + (par3EntityPlayer.posX - par3EntityPlayer.prevPosX) * (double)var4; -+ double var9 = par3EntityPlayer.prevPosY + (par3EntityPlayer.posY - par3EntityPlayer.prevPosY) * (double)var4 + 1.62D - (double)par3EntityPlayer.yOffset; -+ double var11 = par3EntityPlayer.prevPosZ + (par3EntityPlayer.posZ - par3EntityPlayer.prevPosZ) * (double)var4; -+ Vec3 var13 = par2World.getWorldVec3Pool().getVecFromPool(var7, var9, var11); -+ float var14 = MathHelper.cos(-var6 * 0.017453292F - (float)Math.PI); -+ float var15 = MathHelper.sin(-var6 * 0.017453292F - (float)Math.PI); -+ float var16 = -MathHelper.cos(-var5 * 0.017453292F); -+ float var17 = MathHelper.sin(-var5 * 0.017453292F); - float var18 = var15 * var16; - float var20 = var14 * var16; - double var21 = 5.0D; - Vec3 var23 = var13.addVector((double)var18 * var21, (double)var17 * var21, (double)var20 * var21); -- MovingObjectPosition var24 = var2.rayTraceBlocks(var13, var23, true); -- if(var24 == null) { -- return var1; -+ MovingObjectPosition var24 = par2World.clip(var13, var23, true); -+ -+ if (var24 == null) { -+ return par1ItemStack; - } else { -- Vec3 var25 = var3.getLook(var4); -+ Vec3 var25 = par3EntityPlayer.getLook(var4); - boolean var26 = false; - float var27 = 1.0F; -- List var28 = var2.getEntitiesWithinAABBExcludingEntity(var3, var3.boundingBox.addCoord(var25.xCoord * var21, var25.yCoord * var21, var25.zCoord * var21).expand((double)var27, (double)var27, (double)var27)); -- -+ List var28 = par2World.getEntitiesWithinAABBExcludingEntity(par3EntityPlayer, par3EntityPlayer.boundingBox.addCoord(var25.xCoord * var21, var25.yCoord * var21, var25.zCoord * var21).expand((double)var27, (double)var27, (double)var27)); - int var29; -- for(var29 = 0; var29 < var28.size(); ++var29) { -+ -+ for (var29 = 0; var29 < var28.size(); ++var29) { - Entity var30 = (Entity)var28.get(var29); -- if(var30.canBeCollidedWith()) { -+ -+ if (var30.canBeCollidedWith()) { - float var31 = var30.getCollisionBorderSize(); - AxisAlignedBB var32 = var30.boundingBox.expand((double)var31, (double)var31, (double)var31); -- if(var32.isVecInside(var13)) { -+ -+ if (var32.isVecInside(var13)) { - var26 = true; - } - } - } - -- if(var26) { -- return var1; -+ if (var26) { -+ return par1ItemStack; - } else { -- if(var24.typeOfHit == EnumMovingObjectType.TILE) { -+ if (var24.typeOfHit == EnumMovingObjectType.TILE) { - var29 = var24.blockX; - int var33 = var24.blockY; - int var34 = var24.blockZ; -- if(var2.getBlockId(var29, var33, var34) == Block.snow.blockID) { -+ -+ if (par2World.getBlockId(var29, var33, var34) == Block.snow.blockID) { - --var33; - } - -- EntityBoat var35 = new EntityBoat(var2, (double)((float)var29 + 0.5F), (double)((float)var33 + 1.0F), (double)((float)var34 + 0.5F)); -- var35.rotationYaw = (float)(((MathHelper.floor_double((double)(var3.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3) - 1) * 90); -- if(!var2.getCollidingBoundingBoxes(var35, var35.boundingBox.expand(-0.1D, -0.1D, -0.1D)).isEmpty()) { -- return var1; -- } -- -- if(!var2.isRemote) { -- var2.spawnEntityInWorld(var35); -- } -- -- if(!var3.capabilities.isCreativeMode) { -- --var1.stackSize; -+ EntityBoat var35 = new EntityBoat(par2World, (double)((float)var29 + 0.5F), (double)((float)var33 + 1.0F), (double)((float)var34 + 0.5F)); -+ var35.rotationYaw = (float)(((MathHelper.floor_double((double)(par3EntityPlayer.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3) - 1) * 90); -+ -+ if (!par2World.getCollidingBoundingBoxes(var35, var35.boundingBox.expand(-0.1D, -0.1D, -0.1D)).isEmpty()) { -+ return par1ItemStack; -+ } -+ -+ if (!par2World.isRemote) { -+ par2World.spawnEntityInWorld(var35); -+ } -+ -+ if (!par3EntityPlayer.capabilities.isCreativeMode) { -+ --par1ItemStack.stackSize; - } - } - -- return var1; -+ return par1ItemStack; - } - } - } ---- /dev/null -+++ org/spoutcraft/api/gui/InGameHUD.java -@@ -1,0 +1,116 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.api.gui; -+ -+public interface InGameHUD extends Screen { -+ /** -+ * Gets the armor bar associated with this HUD -+ * -+ * @return armor bar -+ */ -+ public ArmorBar getArmorBar(); -+ -+ /** -+ * Gets the chat text box associated with this HUD -+ * -+ * @return chat text box -+ */ -+ public ChatTextBox getChatTextBox(); -+ -+ /** -+ * Gets the chat text bar associated with this HUD -+ * -+ * @return chat bar -+ */ -+ public ChatBar getChatBar(); -+ -+ /** -+ * Gets the underwater bubble bar associated with this HUD -+ * -+ * @return bubble bar -+ */ -+ public BubbleBar getBubbleBar(); -+ -+ /** -+ * Gets the health bar associated with this HUD -+ * -+ * @return health bar -+ */ -+ public HealthBar getHealthBar(); -+ -+ /** -+ * Gets the hunger bar associated with this HUD -+ * -+ * @return hunger bar -+ */ -+ public HungerBar getHungerBar(); -+ -+ /** -+ * Gets the Exp bar associated with this HUD -+ * -+ * @return exp bar -+ */ -+ public ExpBar getExpBar(); -+ -+ /** -+ * Gets the player list associated with this HUD -+ * -+ * @return player list -+ */ -+ public ServerPlayerList getServerPlayerList(); -+ -+ /** -+ * Is true if the widget can be attached to the screen. -+ * Primary controls, like the health bar can not be attached twice. -+ * Control widgets that require input from the mouse or keyboard can not be attached -+ * @param widget -+ * @return true if the widge can be attached -+ */ -+ public boolean canAttachWidget(Widget widget); -+ -+ /** -+ * Attachs a popup screen and brings it to the front of the screen -+ * -+ * @param screen to pop up -+ * @return true if the popup screen was attached, false if there was already a popup launched -+ */ -+ public boolean attachPopupScreen(PopupScreen screen); -+ -+ /** -+ * Gets the active popup screen for this player, or null if none available -+ * -+ * @return the active popup -+ */ -+ public PopupScreen getActivePopup(); -+ -+ /** -+ * Closes the popup screen, or returns false on failure -+ * -+ * @return true if a popup screen was closed -+ */ -+ public boolean closePopup(); -+ -+ /** -+ * Ease of use method setting all the survival mode HUD elements to setVisible(toggle); -+ * -+ * @param toggle true or false -+ */ -+ public void toggleSurvivalHUD(boolean toggle); -+} ---- net/minecraft/src/InventoryLargeChest.java -+++ net/minecraft/src/InventoryLargeChest.java -@@ -1,72 +1,115 @@ - package net.minecraft.src; - - public class InventoryLargeChest implements IInventory { -- private String a; -+ -+ /** Name of the chest. */ -+ private String name; -+ -+ /** Inventory object corresponding to double chest upper part */ - private IInventory upperChest; -+ -+ /** Inventory object corresponding to double chest lower part */ - private IInventory lowerChest; - -- public InventoryLargeChest(String var1, IInventory var2, IInventory var3) { -- this.a = var1; -- if(var2 == null) { -- var2 = var3; -- } -- -- if(var3 == null) { -- var3 = var2; -- } -- -- this.upperChest = var2; -- this.lowerChest = var3; -+ public InventoryLargeChest(String par1Str, IInventory par2IInventory, IInventory par3IInventory) { -+ this.name = par1Str; -+ -+ if (par2IInventory == null) { -+ par2IInventory = par3IInventory; -+ } -+ -+ if (par3IInventory == null) { -+ par3IInventory = par2IInventory; -+ } -+ -+ this.upperChest = par2IInventory; -+ this.lowerChest = par3IInventory; - } - -+ /** -+ * Returns the number of slots in the inventory. -+ */ - public int getSizeInventory() { - return this.upperChest.getSizeInventory() + this.lowerChest.getSizeInventory(); - } - -- public boolean isPartOfLargeChest(IInventory var1) { -- return this.upperChest == var1 || this.lowerChest == var1; -+ /** -+ * Return whether the given inventory is part of this large chest. -+ */ -+ public boolean isPartOfLargeChest(IInventory par1IInventory) { -+ return this.upperChest == par1IInventory || this.lowerChest == par1IInventory; - } - -+ /** -+ * Returns the name of the inventory. -+ */ - public String getInvName() { -- return this.upperChest.isInvNameLocalized() ? this.upperChest.getInvName() : (this.lowerChest.isInvNameLocalized() ? this.lowerChest.getInvName() : this.a); -+ return this.upperChest.isInvNameLocalized() ? this.upperChest.getInvName() : (this.lowerChest.isInvNameLocalized() ? this.lowerChest.getInvName() : this.name); - } - -+ /** -+ * If this returns false, the inventory name will be used as an unlocalized name, and translated into the player's -+ * language. Otherwise it will be used directly. -+ */ - public boolean isInvNameLocalized() { - return this.upperChest.isInvNameLocalized() || this.lowerChest.isInvNameLocalized(); - } - -- public ItemStack getStackInSlot(int var1) { -- return var1 >= this.upperChest.getSizeInventory() ? this.lowerChest.getStackInSlot(var1 - this.upperChest.getSizeInventory()) : this.upperChest.getStackInSlot(var1); -- } -- -- public ItemStack decrStackSize(int var1, int var2) { -- return var1 >= this.upperChest.getSizeInventory() ? this.lowerChest.decrStackSize(var1 - this.upperChest.getSizeInventory(), var2) : this.upperChest.decrStackSize(var1, var2); -- } -- -- public ItemStack getStackInSlotOnClosing(int var1) { -- return var1 >= this.upperChest.getSizeInventory() ? this.lowerChest.getStackInSlotOnClosing(var1 - this.upperChest.getSizeInventory()) : this.upperChest.getStackInSlotOnClosing(var1); -- } -- -- public void setInventorySlotContents(int var1, ItemStack var2) { -- if(var1 >= this.upperChest.getSizeInventory()) { -- this.lowerChest.setInventorySlotContents(var1 - this.upperChest.getSizeInventory(), var2); -+ /** -+ * Returns the stack in slot i -+ */ -+ public ItemStack getStackInSlot(int par1) { -+ return par1 >= this.upperChest.getSizeInventory() ? this.lowerChest.getStackInSlot(par1 - this.upperChest.getSizeInventory()) : this.upperChest.getStackInSlot(par1); -+ } -+ -+ /** -+ * Removes from an inventory slot (first arg) up to a specified number (second arg) of items and returns them in a new -+ * stack. -+ */ -+ public ItemStack decrStackSize(int par1, int par2) { -+ return par1 >= this.upperChest.getSizeInventory() ? this.lowerChest.decrStackSize(par1 - this.upperChest.getSizeInventory(), par2) : this.upperChest.decrStackSize(par1, par2); -+ } -+ -+ /** -+ * When some containers are closed they call this on each slot, then drop whatever it returns as an EntityItem - like -+ * when you close a workbench GUI. -+ */ -+ public ItemStack getStackInSlotOnClosing(int par1) { -+ return par1 >= this.upperChest.getSizeInventory() ? this.lowerChest.getStackInSlotOnClosing(par1 - this.upperChest.getSizeInventory()) : this.upperChest.getStackInSlotOnClosing(par1); -+ } -+ -+ /** -+ * Sets the given item stack to the specified slot in the inventory (can be crafting or armor sections). -+ */ -+ public void setInventorySlotContents(int par1, ItemStack par2ItemStack) { -+ if (par1 >= this.upperChest.getSizeInventory()) { -+ this.lowerChest.setInventorySlotContents(par1 - this.upperChest.getSizeInventory(), par2ItemStack); - } else { -- this.upperChest.setInventorySlotContents(var1, var2); -+ this.upperChest.setInventorySlotContents(par1, par2ItemStack); - } -- - } - -+ /** -+ * Returns the maximum stack size for a inventory slot. Seems to always be 64, possibly will be extended. *Isn't this -+ * more of a set than a get?* -+ */ - public int getInventoryStackLimit() { - return this.upperChest.getInventoryStackLimit(); - } - -+ /** -+ * Called when an the contents of an Inventory change, usually -+ */ - public void onInventoryChanged() { - this.upperChest.onInventoryChanged(); - this.lowerChest.onInventoryChanged(); - } - -- public boolean isUseableByPlayer(EntityPlayer var1) { -- return this.upperChest.isUseableByPlayer(var1) && this.lowerChest.isUseableByPlayer(var1); -+ /** -+ * Do not make give this method the name canInteractWith because it clashes with Container -+ */ -+ public boolean isUseableByPlayer(EntityPlayer par1EntityPlayer) { -+ return this.upperChest.isUseableByPlayer(par1EntityPlayer) && this.lowerChest.isUseableByPlayer(par1EntityPlayer); - } - - public void openChest() { -@@ -79,7 +122,10 @@ - this.lowerChest.closeChest(); - } - -- public boolean isItemValidForSlot(int var1, ItemStack var2) { -+ /** -+ * Returns true if automation is allowed to insert the given stack (ignoring stack size) into the given slot. -+ */ -+ public boolean isItemValidForSlot(int par1, ItemStack par2ItemStack) { - return true; - } - } ---- net/minecraft/src/ComponentNetherBridgeCrossing3.java -+++ net/minecraft/src/ComponentNetherBridgeCrossing3.java -@@ -4,76 +4,86 @@ - import java.util.Random; - - public class ComponentNetherBridgeCrossing3 extends ComponentNetherBridgePiece { -- public ComponentNetherBridgeCrossing3() { -- } -- -- public ComponentNetherBridgeCrossing3(int var1, Random var2, StructureBoundingBox var3, int var4) { -- super(var1); -- this.coordBaseMode = var4; -- this.boundingBox = var3; -- } -- -- protected ComponentNetherBridgeCrossing3(Random var1, int var2, int var3) { -+ public ComponentNetherBridgeCrossing3() {} -+ -+ public ComponentNetherBridgeCrossing3(int par1, Random par2Random, StructureBoundingBox par3StructureBoundingBox, int par4) { -+ super(par1); -+ this.coordBaseMode = par4; -+ this.boundingBox = par3StructureBoundingBox; -+ } -+ -+ protected ComponentNetherBridgeCrossing3(Random par1Random, int par2, int par3) { - super(0); -- this.coordBaseMode = var1.nextInt(4); -- switch(this.coordBaseMode) { -- case 0: -- case 2: -- this.boundingBox = new StructureBoundingBox(var2, 64, var3, var2 + 19 - 1, 73, var3 + 19 - 1); -- break; -- default: -- this.boundingBox = new StructureBoundingBox(var2, 64, var3, var2 + 19 - 1, 73, var3 + 19 - 1); -+ this.coordBaseMode = par1Random.nextInt(4); -+ -+ switch (this.coordBaseMode) { -+ case 0: -+ case 2: -+ this.boundingBox = new StructureBoundingBox(par2, 64, par3, par2 + 19 - 1, 73, par3 + 19 - 1); -+ break; -+ -+ default: -+ this.boundingBox = new StructureBoundingBox(par2, 64, par3, par2 + 19 - 1, 73, par3 + 19 - 1); - } -- -- } -- -- public void buildComponent(StructureComponent var1, List var2, Random var3) { -- this.getNextComponentNormal((ComponentNetherBridgeStartPiece)var1, var2, var3, 8, 3, false); -- this.getNextComponentX((ComponentNetherBridgeStartPiece)var1, var2, var3, 3, 8, false); -- this.getNextComponentZ((ComponentNetherBridgeStartPiece)var1, var2, var3, 3, 8, false); -- } -- -- public static ComponentNetherBridgeCrossing3 createValidComponent(List var0, Random var1, int var2, int var3, int var4, int var5, int var6) { -- StructureBoundingBox var7 = StructureBoundingBox.getComponentToAddBoundingBox(var2, var3, var4, -8, -3, 0, 19, 10, 19, var5); -- return isAboveGround(var7) && StructureComponent.findIntersecting(var0, var7) == null ? new ComponentNetherBridgeCrossing3(var6, var1, var7, var5) : null; -- } -- -- public boolean addComponentParts(World var1, Random var2, StructureBoundingBox var3) { -- this.fillWithBlocks(var1, var3, 7, 3, 0, 11, 4, 18, Block.netherBrick.blockID, Block.netherBrick.blockID, false); -- this.fillWithBlocks(var1, var3, 0, 3, 7, 18, 4, 11, Block.netherBrick.blockID, Block.netherBrick.blockID, false); -- this.fillWithBlocks(var1, var3, 8, 5, 0, 10, 7, 18, 0, 0, false); -- this.fillWithBlocks(var1, var3, 0, 5, 8, 18, 7, 10, 0, 0, false); -- this.fillWithBlocks(var1, var3, 7, 5, 0, 7, 5, 7, Block.netherBrick.blockID, Block.netherBrick.blockID, false); -- this.fillWithBlocks(var1, var3, 7, 5, 11, 7, 5, 18, Block.netherBrick.blockID, Block.netherBrick.blockID, false); -- this.fillWithBlocks(var1, var3, 11, 5, 0, 11, 5, 7, Block.netherBrick.blockID, Block.netherBrick.blockID, false); -- this.fillWithBlocks(var1, var3, 11, 5, 11, 11, 5, 18, Block.netherBrick.blockID, Block.netherBrick.blockID, false); -- this.fillWithBlocks(var1, var3, 0, 5, 7, 7, 5, 7, Block.netherBrick.blockID, Block.netherBrick.blockID, false); -- this.fillWithBlocks(var1, var3, 11, 5, 7, 18, 5, 7, Block.netherBrick.blockID, Block.netherBrick.blockID, false); -- this.fillWithBlocks(var1, var3, 0, 5, 11, 7, 5, 11, Block.netherBrick.blockID, Block.netherBrick.blockID, false); -- this.fillWithBlocks(var1, var3, 11, 5, 11, 18, 5, 11, Block.netherBrick.blockID, Block.netherBrick.blockID, false); -- this.fillWithBlocks(var1, var3, 7, 2, 0, 11, 2, 5, Block.netherBrick.blockID, Block.netherBrick.blockID, false); -- this.fillWithBlocks(var1, var3, 7, 2, 13, 11, 2, 18, Block.netherBrick.blockID, Block.netherBrick.blockID, false); -- this.fillWithBlocks(var1, var3, 7, 0, 0, 11, 1, 3, Block.netherBrick.blockID, Block.netherBrick.blockID, false); -- this.fillWithBlocks(var1, var3, 7, 0, 15, 11, 1, 18, Block.netherBrick.blockID, Block.netherBrick.blockID, false); -- -+ } -+ -+ /** -+ * Initiates construction of the Structure Component picked, at the current Location of StructGen -+ */ -+ public void buildComponent(StructureComponent par1StructureComponent, List par2List, Random par3Random) { -+ this.getNextComponentNormal((ComponentNetherBridgeStartPiece)par1StructureComponent, par2List, par3Random, 8, 3, false); -+ this.getNextComponentX((ComponentNetherBridgeStartPiece)par1StructureComponent, par2List, par3Random, 3, 8, false); -+ this.getNextComponentZ((ComponentNetherBridgeStartPiece)par1StructureComponent, par2List, par3Random, 3, 8, false); -+ } -+ -+ /** -+ * Creates and returns a new component piece. Or null if it could not find enough room to place it. -+ */ -+ public static ComponentNetherBridgeCrossing3 createValidComponent(List par0List, Random par1Random, int par2, int par3, int par4, int par5, int par6) { -+ StructureBoundingBox var7 = StructureBoundingBox.getComponentToAddBoundingBox(par2, par3, par4, -8, -3, 0, 19, 10, 19, par5); -+ return isAboveGround(var7) && StructureComponent.findIntersecting(par0List, var7) == null ? new ComponentNetherBridgeCrossing3(par6, par1Random, var7, par5) : null; -+ } -+ -+ /** -+ * second Part of Structure generating, this for example places Spiderwebs, Mob Spawners, it closes Mineshafts at the -+ * end, it adds Fences... -+ */ -+ public boolean addComponentParts(World par1World, Random par2Random, StructureBoundingBox par3StructureBoundingBox) { -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 7, 3, 0, 11, 4, 18, Block.netherBrick.blockID, Block.netherBrick.blockID, false); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 0, 3, 7, 18, 4, 11, Block.netherBrick.blockID, Block.netherBrick.blockID, false); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 8, 5, 0, 10, 7, 18, 0, 0, false); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 0, 5, 8, 18, 7, 10, 0, 0, false); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 7, 5, 0, 7, 5, 7, Block.netherBrick.blockID, Block.netherBrick.blockID, false); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 7, 5, 11, 7, 5, 18, Block.netherBrick.blockID, Block.netherBrick.blockID, false); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 11, 5, 0, 11, 5, 7, Block.netherBrick.blockID, Block.netherBrick.blockID, false); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 11, 5, 11, 11, 5, 18, Block.netherBrick.blockID, Block.netherBrick.blockID, false); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 0, 5, 7, 7, 5, 7, Block.netherBrick.blockID, Block.netherBrick.blockID, false); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 11, 5, 7, 18, 5, 7, Block.netherBrick.blockID, Block.netherBrick.blockID, false); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 0, 5, 11, 7, 5, 11, Block.netherBrick.blockID, Block.netherBrick.blockID, false); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 11, 5, 11, 18, 5, 11, Block.netherBrick.blockID, Block.netherBrick.blockID, false); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 7, 2, 0, 11, 2, 5, Block.netherBrick.blockID, Block.netherBrick.blockID, false); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 7, 2, 13, 11, 2, 18, Block.netherBrick.blockID, Block.netherBrick.blockID, false); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 7, 0, 0, 11, 1, 3, Block.netherBrick.blockID, Block.netherBrick.blockID, false); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 7, 0, 15, 11, 1, 18, Block.netherBrick.blockID, Block.netherBrick.blockID, false); - int var4; - int var5; -- for(var4 = 7; var4 <= 11; ++var4) { -- for(var5 = 0; var5 <= 2; ++var5) { -- this.fillCurrentPositionBlocksDownwards(var1, Block.netherBrick.blockID, 0, var4, -1, var5, var3); -- this.fillCurrentPositionBlocksDownwards(var1, Block.netherBrick.blockID, 0, var4, -1, 18 - var5, var3); -+ -+ for (var4 = 7; var4 <= 11; ++var4) { -+ for (var5 = 0; var5 <= 2; ++var5) { -+ this.fillCurrentPositionBlocksDownwards(par1World, Block.netherBrick.blockID, 0, var4, -1, var5, par3StructureBoundingBox); -+ this.fillCurrentPositionBlocksDownwards(par1World, Block.netherBrick.blockID, 0, var4, -1, 18 - var5, par3StructureBoundingBox); - } - } - -- this.fillWithBlocks(var1, var3, 0, 2, 7, 5, 2, 11, Block.netherBrick.blockID, Block.netherBrick.blockID, false); -- this.fillWithBlocks(var1, var3, 13, 2, 7, 18, 2, 11, Block.netherBrick.blockID, Block.netherBrick.blockID, false); -- this.fillWithBlocks(var1, var3, 0, 0, 7, 3, 1, 11, Block.netherBrick.blockID, Block.netherBrick.blockID, false); -- this.fillWithBlocks(var1, var3, 15, 0, 7, 18, 1, 11, Block.netherBrick.blockID, Block.netherBrick.blockID, false); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 0, 2, 7, 5, 2, 11, Block.netherBrick.blockID, Block.netherBrick.blockID, false); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 13, 2, 7, 18, 2, 11, Block.netherBrick.blockID, Block.netherBrick.blockID, false); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 0, 0, 7, 3, 1, 11, Block.netherBrick.blockID, Block.netherBrick.blockID, false); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 15, 0, 7, 18, 1, 11, Block.netherBrick.blockID, Block.netherBrick.blockID, false); - -- for(var4 = 0; var4 <= 2; ++var4) { -- for(var5 = 7; var5 <= 11; ++var5) { -- this.fillCurrentPositionBlocksDownwards(var1, Block.netherBrick.blockID, 0, var4, -1, var5, var3); -- this.fillCurrentPositionBlocksDownwards(var1, Block.netherBrick.blockID, 0, 18 - var4, -1, var5, var3); -+ for (var4 = 0; var4 <= 2; ++var4) { -+ for (var5 = 7; var5 <= 11; ++var5) { -+ this.fillCurrentPositionBlocksDownwards(par1World, Block.netherBrick.blockID, 0, var4, -1, var5, par3StructureBoundingBox); -+ this.fillCurrentPositionBlocksDownwards(par1World, Block.netherBrick.blockID, 0, 18 - var4, -1, var5, par3StructureBoundingBox); - } - } - ---- net/minecraft/src/AttributeInstance.java -+++ net/minecraft/src/AttributeInstance.java -@@ -12,6 +12,9 @@ - - Collection func_111122_c(); - -+ /** -+ * Returns attribute modifier, if any, by the given UUID -+ */ - AttributeModifier getModifier(UUID var1); - - void applyModifier(AttributeModifier var1); ---- net/minecraft/src/RenderEnchantmentTable.java -+++ net/minecraft/src/RenderEnchantmentTable.java -@@ -6,51 +6,53 @@ - private static final ResourceLocation enchantingTableBookTextures = new ResourceLocation("textures/entity/enchanting_table_book.png"); - private ModelBook enchantmentBook = new ModelBook(); - -- public void renderTileEntityEnchantmentTableAt(TileEntityEnchantmentTable var1, double var2, double var4, double var6, float var8) { -+ public void renderTileEntityEnchantmentTableAt(TileEntityEnchantmentTable par1TileEntityEnchantmentTable, double par2, double par4, double par6, float par8) { - GL11.glPushMatrix(); -- GL11.glTranslatef((float)var2 + 0.5F, (float)var4 + 12.0F / 16.0F, (float)var6 + 0.5F); -- float var9 = (float)var1.tickCount + var8; -+ GL11.glTranslatef((float)par2 + 0.5F, (float)par4 + 0.75F, (float)par6 + 0.5F); -+ float var9 = (float)par1TileEntityEnchantmentTable.tickCount + par8; - GL11.glTranslatef(0.0F, 0.1F + MathHelper.sin(var9 * 0.1F) * 0.01F, 0.0F); -- - float var10; -- for(var10 = var1.bookRotation2 - var1.bookRotationPrev; var10 >= (float)Math.PI; var10 -= (float)Math.PI * 2.0F) { -- } -- -- while(var10 < -((float)Math.PI)) { -- var10 += (float)Math.PI * 2.0F; -- } -- -- float var11 = var1.bookRotationPrev + var10 * var8; -+ -+ for (var10 = par1TileEntityEnchantmentTable.bookRotation2 - par1TileEntityEnchantmentTable.bookRotationPrev; var10 >= (float)Math.PI; var10 -= ((float)Math.PI * 2F)) { -+ ; -+ } -+ -+ while (var10 < -(float)Math.PI) { -+ var10 += ((float)Math.PI * 2F); -+ } -+ -+ float var11 = par1TileEntityEnchantmentTable.bookRotationPrev + var10 * par8; - GL11.glRotatef(-var11 * 180.0F / (float)Math.PI, 0.0F, 1.0F, 0.0F); - GL11.glRotatef(80.0F, 0.0F, 0.0F, 1.0F); - this.bindTexture(enchantingTableBookTextures); -- float var12 = var1.pageFlipPrev + (var1.pageFlip - var1.pageFlipPrev) * var8 + 0.25F; -- float var13 = var1.pageFlipPrev + (var1.pageFlip - var1.pageFlipPrev) * var8 + 12.0F / 16.0F; -+ float var12 = par1TileEntityEnchantmentTable.pageFlipPrev + (par1TileEntityEnchantmentTable.pageFlip - par1TileEntityEnchantmentTable.pageFlipPrev) * par8 + 0.25F; -+ float var13 = par1TileEntityEnchantmentTable.pageFlipPrev + (par1TileEntityEnchantmentTable.pageFlip - par1TileEntityEnchantmentTable.pageFlipPrev) * par8 + 0.75F; - var12 = (var12 - (float)MathHelper.truncateDoubleToInt((double)var12)) * 1.6F - 0.3F; - var13 = (var13 - (float)MathHelper.truncateDoubleToInt((double)var13)) * 1.6F - 0.3F; -- if(var12 < 0.0F) { -+ -+ if (var12 < 0.0F) { - var12 = 0.0F; - } - -- if(var13 < 0.0F) { -+ if (var13 < 0.0F) { - var13 = 0.0F; - } - -- if(var12 > 1.0F) { -+ if (var12 > 1.0F) { - var12 = 1.0F; - } - -- if(var13 > 1.0F) { -+ if (var13 > 1.0F) { - var13 = 1.0F; - } - -- float var14 = var1.bookSpreadPrev + (var1.bookSpread - var1.bookSpreadPrev) * var8; -+ float var14 = par1TileEntityEnchantmentTable.bookSpreadPrev + (par1TileEntityEnchantmentTable.bookSpread - par1TileEntityEnchantmentTable.bookSpreadPrev) * par8; - GL11.glEnable(GL11.GL_CULL_FACE); -- this.enchantmentBook.render((Entity)null, var9, var12, var13, var14, 0.0F, 1.0F / 16.0F); -+ this.enchantmentBook.render((Entity)null, var9, var12, var13, var14, 0.0F, 0.0625F); - GL11.glPopMatrix(); - } - -- public void renderTileEntityAt(TileEntity var1, double var2, double var4, double var6, float var8) { -- this.renderTileEntityEnchantmentTableAt((TileEntityEnchantmentTable)var1, var2, var4, var6, var8); -+ public void renderTileEntityAt(TileEntity par1TileEntity, double par2, double par4, double par6, float par8) { -+ this.renderTileEntityEnchantmentTableAt((TileEntityEnchantmentTable)par1TileEntity, par2, par4, par6, par8); - } - } ---- net/minecraft/src/EntityGolem.java -+++ net/minecraft/src/EntityGolem.java -@@ -1,29 +1,46 @@ - package net.minecraft.src; - - public abstract class EntityGolem extends EntityCreature implements IAnimals { -- public EntityGolem(World var1) { -- super(var1); -- } -- -- protected void fall(float var1) { -- } -- -+ public EntityGolem(World par1World) { -+ super(par1World); -+ } -+ -+ /** -+ * Called when the mob is falling. Calculates and applies fall damage. -+ */ -+ protected void fall(float par1) {} -+ -+ /** -+ * Returns the sound this mob makes while it's alive. -+ */ - protected String getLivingSound() { - return "none"; - } - -+ /** -+ * Returns the sound this mob makes when it is hurt. -+ */ - protected String getHurtSound() { - return "none"; - } - -+ /** -+ * Returns the sound this mob makes on death. -+ */ - protected String getDeathSound() { - return "none"; - } - -+ /** -+ * Get number of ticks, at least during which the living entity will be silent. -+ */ - public int getTalkInterval() { - return 120; - } - -+ /** -+ * Determines if an entity can be despawned, used on idle far away entities -+ */ - protected boolean canDespawn() { - return false; - } ---- net/minecraft/src/PacketCount.java -+++ net/minecraft/src/PacketCount.java -@@ -4,23 +4,31 @@ - import java.util.Map; - - public class PacketCount { -+ -+ /** If false, countPacket does nothing */ - public static boolean allowCounting = true; -- private static final Map b = new HashMap(); -- private static final Map c = new HashMap(); -- private static final Object d = new Object(); -- -- public static void countPacket(int var0, long var1) { -- if(allowCounting) { -- Object var3 = d; -- synchronized(var3) { -- if(b.containsKey(Integer.valueOf(var0))) { -- b.put(Integer.valueOf(var0), Long.valueOf(((Long)b.get(Integer.valueOf(var0))).longValue() + 1L)); -- c.put(Integer.valueOf(var0), Long.valueOf(((Long)c.get(Integer.valueOf(var0))).longValue() + var1)); -+ -+ /** A count of the total number of each packet sent grouped by IDs. */ -+ private static final Map packetCountForID = new HashMap(); -+ -+ /** A count of the total size of each packet sent grouped by IDs. */ -+ private static final Map sizeCountForID = new HashMap(); -+ -+ /** Used to make threads queue to add packets */ -+ private static final Object lock = new Object(); -+ -+ public static void countPacket(int par0, long par1) { -+ if (allowCounting) { -+ Object var3 = lock; -+ -+ synchronized (lock) { -+ if (packetCountForID.containsKey(Integer.valueOf(par0))) { -+ packetCountForID.put(Integer.valueOf(par0), Long.valueOf(((Long)packetCountForID.get(Integer.valueOf(par0))).longValue() + 1L)); -+ sizeCountForID.put(Integer.valueOf(par0), Long.valueOf(((Long)sizeCountForID.get(Integer.valueOf(par0))).longValue() + par1)); - } else { -- b.put(Integer.valueOf(var0), Long.valueOf(1L)); -- c.put(Integer.valueOf(var0), Long.valueOf(var1)); -+ packetCountForID.put(Integer.valueOf(par0), Long.valueOf(1L)); -+ sizeCountForID.put(Integer.valueOf(par0), Long.valueOf(par1)); - } -- - } - } - } ---- /dev/null -+++ org/spoutcraft/api/gui/KeyManager.java -@@ -1,0 +1,28 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.api.gui; -+ -+public interface KeyManager { -+ public boolean isKeyDown(Keyboard ch); -+ -+ public boolean isRepeatingEvents(); -+ -+ public void setRepeatingEvents(boolean repeat); -+} ---- net/minecraft/src/BlockHopper.java -+++ net/minecraft/src/BlockHopper.java -@@ -4,179 +4,250 @@ - import java.util.Random; - - public class BlockHopper extends BlockContainer { -- private final Random a = new Random(); -+ private final Random field_94457_a = new Random(); - private Icon hopperIcon; - private Icon hopperTopIcon; - private Icon hopperInsideIcon; - -- public BlockHopper(int var1) { -- super(var1, Material.iron); -+ public BlockHopper(int par1) { -+ super(par1, Material.iron); - this.setCreativeTab(CreativeTabs.tabRedstone); - this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F); - } - -- public void setBlockBoundsBasedOnState(IBlockAccess var1, int var2, int var3, int var4) { -+ /** -+ * Updates the blocks bounds based on its current state. Args: world, x, y, z -+ */ -+ public void setBlockBoundsBasedOnState(IBlockAccess par1IBlockAccess, int par2, int par3, int par4) { - this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F); - } - -- public void addCollisionBoxesToList(World var1, int var2, int var3, int var4, AxisAlignedBB var5, List var6, Entity var7) { -- this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 10.0F / 16.0F, 1.0F); -- super.addCollisionBoxesToList(var1, var2, var3, var4, var5, var6, var7); -- float var8 = 2.0F / 16.0F; -+ /** -+ * Adds all intersecting collision boxes to a list. (Be sure to only add boxes to the list if they intersect the mask.) -+ * Parameters: World, X, Y, Z, mask, list, colliding entity -+ */ -+ public void addCollisionBoxesToList(World par1World, int par2, int par3, int par4, AxisAlignedBB par5AxisAlignedBB, List par6List, Entity par7Entity) { -+ this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.625F, 1.0F); -+ super.addCollisionBoxesToList(par1World, par2, par3, par4, par5AxisAlignedBB, par6List, par7Entity); -+ float var8 = 0.125F; - this.setBlockBounds(0.0F, 0.0F, 0.0F, var8, 1.0F, 1.0F); -- super.addCollisionBoxesToList(var1, var2, var3, var4, var5, var6, var7); -+ super.addCollisionBoxesToList(par1World, par2, par3, par4, par5AxisAlignedBB, par6List, par7Entity); - this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, var8); -- super.addCollisionBoxesToList(var1, var2, var3, var4, var5, var6, var7); -+ super.addCollisionBoxesToList(par1World, par2, par3, par4, par5AxisAlignedBB, par6List, par7Entity); - this.setBlockBounds(1.0F - var8, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F); -- super.addCollisionBoxesToList(var1, var2, var3, var4, var5, var6, var7); -+ super.addCollisionBoxesToList(par1World, par2, par3, par4, par5AxisAlignedBB, par6List, par7Entity); - this.setBlockBounds(0.0F, 0.0F, 1.0F - var8, 1.0F, 1.0F, 1.0F); -- super.addCollisionBoxesToList(var1, var2, var3, var4, var5, var6, var7); -+ super.addCollisionBoxesToList(par1World, par2, par3, par4, par5AxisAlignedBB, par6List, par7Entity); - this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F); - } - -- public int onBlockPlaced(World var1, int var2, int var3, int var4, int var5, float var6, float var7, float var8, int var9) { -- int var10 = Facing.oppositeSide[var5]; -- if(var10 == 1) { -+ /** -+ * Called when a block is placed using its ItemBlock. Args: World, X, Y, Z, side, hitX, hitY, hitZ, block metadata -+ */ -+ public int onBlockPlaced(World par1World, int par2, int par3, int par4, int par5, float par6, float par7, float par8, int par9) { -+ int var10 = Facing.oppositeSide[par5]; -+ -+ if (var10 == 1) { - var10 = 0; - } - - return var10; - } - -- public TileEntity createNewTileEntity(World var1) { -+ /** -+ * Returns a new instance of a block's tile entity class. Called on placing the block. -+ */ -+ public TileEntity createNewTileEntity(World par1World) { - return new TileEntityHopper(); - } - -- public void onBlockPlacedBy(World var1, int var2, int var3, int var4, EntityLivingBase var5, ItemStack var6) { -- super.onBlockPlacedBy(var1, var2, var3, var4, var5, var6); -- if(var6.hasDisplayName()) { -- TileEntityHopper var7 = getHopperTile(var1, var2, var3, var4); -- var7.setInventoryName(var6.getDisplayName()); -+ /** -+ * Called when the block is placed in the world. -+ */ -+ public void onBlockPlacedBy(World par1World, int par2, int par3, int par4, EntityLivingBase par5EntityLivingBase, ItemStack par6ItemStack) { -+ super.onBlockPlacedBy(par1World, par2, par3, par4, par5EntityLivingBase, par6ItemStack); -+ -+ if (par6ItemStack.hasDisplayName()) { -+ TileEntityHopper var7 = getHopperTile(par1World, par2, par3, par4); -+ var7.setInventoryName(par6ItemStack.getDisplayName()); - } -- -- } -- -- public void onBlockAdded(World var1, int var2, int var3, int var4) { -- super.onBlockAdded(var1, var2, var3, var4); -- this.updateMetadata(var1, var2, var3, var4); -- } -- -- public boolean onBlockActivated(World var1, int var2, int var3, int var4, EntityPlayer var5, int var6, float var7, float var8, float var9) { -- if(var1.isRemote) { -+ } -+ -+ /** -+ * Called whenever the block is added into the world. Args: world, x, y, z -+ */ -+ public void onBlockAdded(World par1World, int par2, int par3, int par4) { -+ super.onBlockAdded(par1World, par2, par3, par4); -+ this.updateMetadata(par1World, par2, par3, par4); -+ } -+ -+ /** -+ * Called upon block activation (right click on the block.) -+ */ -+ public boolean onBlockActivated(World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer, int par6, float par7, float par8, float par9) { -+ if (par1World.isRemote) { - return true; - } else { -- TileEntityHopper var10 = getHopperTile(var1, var2, var3, var4); -- if(var10 != null) { -- var5.displayGUIHopper(var10); -+ TileEntityHopper var10 = getHopperTile(par1World, par2, par3, par4); -+ -+ if (var10 != null) { -+ par5EntityPlayer.displayGUIHopper(var10); - } - - return true; - } - } - -- public void onNeighborBlockChange(World var1, int var2, int var3, int var4, int var5) { -- this.updateMetadata(var1, var2, var3, var4); -+ /** -+ * Lets the block know when one of its neighbor changes. Doesn't know which neighbor changed (coordinates passed are -+ * their own) Args: x, y, z, neighbor blockID -+ */ -+ public void onNeighborBlockChange(World par1World, int par2, int par3, int par4, int par5) { -+ this.updateMetadata(par1World, par2, par3, par4); - } - -- private void updateMetadata(World var1, int var2, int var3, int var4) { -- int var5 = var1.getBlockMetadata(var2, var3, var4); -+ /** -+ * Updates the Metadata to include if the Hopper gets powered by Redstone or not -+ */ -+ private void updateMetadata(World par1World, int par2, int par3, int par4) { -+ int var5 = par1World.getBlockMetadata(par2, par3, par4); - int var6 = getDirectionFromMetadata(var5); -- boolean var7 = !var1.isBlockIndirectlyGettingPowered(var2, var3, var4); -+ boolean var7 = !par1World.isBlockIndirectlyGettingPowered(par2, par3, par4); - boolean var8 = getIsBlockNotPoweredFromMetadata(var5); -- if(var7 != var8) { -- var1.setBlockMetadata(var2, var3, var4, var6 | (var7 ? 0 : 8), 4); -+ -+ if (var7 != var8) { -+ par1World.setBlockMetadataWithNotify(par2, par3, par4, var6 | (var7 ? 0 : 8), 4); - } -- - } - -- public void breakBlock(World var1, int var2, int var3, int var4, int var5, int var6) { -- TileEntityHopper var7 = (TileEntityHopper)var1.getBlockTileEntity(var2, var3, var4); -- if(var7 != null) { -- for(int var8 = 0; var8 < var7.getSizeInventory(); ++var8) { -+ /** -+ * Called on server worlds only when the block has been replaced by a different block ID, or the same block with a -+ * different metadata value, but before the new metadata value is set. Args: World, x, y, z, old block ID, old metadata -+ */ -+ public void breakBlock(World par1World, int par2, int par3, int par4, int par5, int par6) { -+ TileEntityHopper var7 = (TileEntityHopper)par1World.getBlockTileEntity(par2, par3, par4); -+ -+ if (var7 != null) { -+ for (int var8 = 0; var8 < var7.getSizeInventory(); ++var8) { - ItemStack var9 = var7.getStackInSlot(var8); -- if(var9 != null) { -- float var10 = this.a.nextFloat() * 0.8F + 0.1F; -- float var11 = this.a.nextFloat() * 0.8F + 0.1F; -- float var12 = this.a.nextFloat() * 0.8F + 0.1F; -- -- while(var9.stackSize > 0) { -- int var13 = this.a.nextInt(21) + 10; -- if(var13 > var9.stackSize) { -+ -+ if (var9 != null) { -+ float var10 = this.field_94457_a.nextFloat() * 0.8F + 0.1F; -+ float var11 = this.field_94457_a.nextFloat() * 0.8F + 0.1F; -+ float var12 = this.field_94457_a.nextFloat() * 0.8F + 0.1F; -+ -+ while (var9.stackSize > 0) { -+ int var13 = this.field_94457_a.nextInt(21) + 10; -+ -+ if (var13 > var9.stackSize) { - var13 = var9.stackSize; - } - - var9.stackSize -= var13; -- EntityItem var14 = new EntityItem(var1, (double)((float)var2 + var10), (double)((float)var3 + var11), (double)((float)var4 + var12), new ItemStack(var9.itemID, var13, var9.getItemDamage())); -- if(var9.hasTagCompound()) { -+ EntityItem var14 = new EntityItem(par1World, (double)((float)par2 + var10), (double)((float)par3 + var11), (double)((float)par4 + var12), new ItemStack(var9.itemID, var13, var9.getItemDamage())); -+ -+ if (var9.hasTagCompound()) { - var14.getEntityItem().setTagCompound((NBTTagCompound)var9.getTagCompound().copy()); - } - - float var15 = 0.05F; -- var14.motionX = (double)((float)this.a.nextGaussian() * var15); -- var14.motionY = (double)((float)this.a.nextGaussian() * var15 + 0.2F); -- var14.motionZ = (double)((float)this.a.nextGaussian() * var15); -- var1.spawnEntityInWorld(var14); -+ var14.motionX = (double)((float)this.field_94457_a.nextGaussian() * var15); -+ var14.motionY = (double)((float)this.field_94457_a.nextGaussian() * var15 + 0.2F); -+ var14.motionZ = (double)((float)this.field_94457_a.nextGaussian() * var15); -+ par1World.spawnEntityInWorld(var14); - } - } - } - -- var1.func_96440_m(var2, var3, var4, var5); -+ par1World.func_96440_m(par2, par3, par4, par5); - } - -- super.breakBlock(var1, var2, var3, var4, var5, var6); -+ super.breakBlock(par1World, par2, par3, par4, par5, par6); - } - -+ /** -+ * The type of render function that is called for this block -+ */ - public int getRenderType() { - return 38; - } - -+ /** -+ * If this block doesn't render as an ordinary block it will return False (examples: signs, buttons, stairs, etc) -+ */ - public boolean renderAsNormalBlock() { - return false; - } - -+ /** -+ * Is this block (a) opaque and (b) a full 1m cube? This determines whether or not to render the shared face of two -+ * adjacent blocks and also whether the player can attach torches, redstone wire, etc to this block. -+ */ - public boolean isOpaqueCube() { - return false; - } - -- public boolean shouldSideBeRendered(IBlockAccess var1, int var2, int var3, int var4, int var5) { -+ /** -+ * Returns true if the given side of this block type should be rendered, if the adjacent block is at the given -+ * coordinates. Args: blockAccess, x, y, z, side -+ */ -+ public boolean shouldSideBeRendered(IBlockAccess par1IBlockAccess, int par2, int par3, int par4, int par5) { - return true; - } - -- public Icon getIcon(int var1, int var2) { -- return var1 == 1 ? this.hopperTopIcon : this.hopperIcon; -- } -- -- public static int getDirectionFromMetadata(int var0) { -- return var0 & 7; -- } -- -- public static boolean getIsBlockNotPoweredFromMetadata(int var0) { -- return (var0 & 8) != 8; -- } -- -+ /** -+ * From the specified side and block metadata retrieves the blocks texture. Args: side, metadata -+ */ -+ public Icon getIcon(int par1, int par2) { -+ return par1 == 1 ? this.hopperTopIcon : this.hopperIcon; -+ } -+ -+ public static int getDirectionFromMetadata(int par0) { -+ return par0 & 7; -+ } -+ -+ public static boolean getIsBlockNotPoweredFromMetadata(int par0) { -+ return (par0 & 8) != 8; -+ } -+ -+ /** -+ * If this returns true, then comparators facing away from this block will use the value from -+ * getComparatorInputOverride instead of the actual redstone signal strength. -+ */ - public boolean hasComparatorInputOverride() { - return true; - } - -- public int getComparatorInputOverride(World var1, int var2, int var3, int var4, int var5) { -- return Container.calcRedstoneFromInventory(getHopperTile(var1, var2, var3, var4)); -- } -- -- public void registerIcons(IconRegister var1) { -- this.hopperIcon = var1.registerIcon("hopper_outside"); -- this.hopperTopIcon = var1.registerIcon("hopper_top"); -- this.hopperInsideIcon = var1.registerIcon("hopper_inside"); -- } -- -- public static Icon getHopperIcon(String var0) { -- return var0.equals("hopper_outside") ? Block.hopperBlock.hopperIcon : (var0.equals("hopper_inside") ? Block.hopperBlock.hopperInsideIcon : null); -- } -- -+ /** -+ * If hasComparatorInputOverride returns true, the return value from this is used instead of the redstone signal -+ * strength when this block inputs to a comparator. -+ */ -+ public int getComparatorInputOverride(World par1World, int par2, int par3, int par4, int par5) { -+ return Container.calcRedstoneFromInventory(getHopperTile(par1World, par2, par3, par4)); -+ } -+ -+ /** -+ * When this method is called, your block should register all the icons it needs with the given IconRegister. This is -+ * the only chance you get to register icons. -+ */ -+ public void registerIcons(IconRegister par1IconRegister) { -+ this.hopperIcon = par1IconRegister.registerIcon("hopper_outside"); -+ this.hopperTopIcon = par1IconRegister.registerIcon("hopper_top"); -+ this.hopperInsideIcon = par1IconRegister.registerIcon("hopper_inside"); -+ } -+ -+ public static Icon getHopperIcon(String par0Str) { -+ return par0Str.equals("hopper_outside") ? Block.hopperBlock.hopperIcon : (par0Str.equals("hopper_inside") ? Block.hopperBlock.hopperInsideIcon : null); -+ } -+ -+ /** -+ * Gets the icon name of the ItemBlock corresponding to this block. Used by hoppers. -+ */ - public String getItemIconName() { - return "hopper"; - } - -- public static TileEntityHopper getHopperTile(IBlockAccess var0, int var1, int var2, int var3) { -- return (TileEntityHopper)var0.getBlockTileEntity(var1, var2, var3); -+ public static TileEntityHopper getHopperTile(IBlockAccess par0IBlockAccess, int par1, int par2, int par3) { -+ return (TileEntityHopper)par0IBlockAccess.getBlockTileEntity(par1, par2, par3); - } - } ---- /dev/null -+++ org/spoutcraft/client/gui/server/ServerItem.java -@@ -1,0 +1,430 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.client.gui.server; -+ -+import org.lwjgl.opengl.GL11; -+import org.newdawn.slick.opengl.Texture; -+ -+import net.minecraft.src.FontRenderer; -+import net.minecraft.src.Minecraft; -+import net.minecraft.src.ResourceLocation; -+ -+import org.bukkit.ChatColor; -+ -+import org.spoutcraft.api.Spoutcraft; -+import org.spoutcraft.api.gui.Color; -+import org.spoutcraft.api.gui.ListWidget; -+import org.spoutcraft.api.gui.ListWidgetItem; -+import org.spoutcraft.api.gui.RenderUtil; -+import org.spoutcraft.client.SpoutClient; -+import org.spoutcraft.client.gui.MCRenderDelegate; -+import org.spoutcraft.client.io.CustomTextureManager; -+import org.spoutcraft.client.io.FileUtil; -+import org.spoutcraft.client.util.NetworkUtils; -+ -+public class ServerItem implements ListWidgetItem { -+ /** -+ * The default Minecraft server port. -+ */ -+ public static final int DEFAULT_PORT = 25565; -+ -+ protected ListWidget widget; -+ -+ protected String ip; -+ protected int port; -+ protected String title; -+ -+ protected int databaseId = -1; -+ -+ protected Boolean acceptsTextures; -+ -+ // Options from the serverlist API -+ protected String country = null; -+ -+ public static final int OPEN = 0; -+ public static final int WHITELIST = 1; -+ public static final int GRAYLIST = 2; -+ public static final int BLACKLIST = 3; -+ public int versionWidth = 10; -+ -+ protected byte accessType = ServerItem.OPEN; -+ -+ protected boolean showPingWhilePolling = false; -+ -+ protected ServerModel favorites = SpoutClient.getInstance().getServerManager().getFavorites(); -+ protected ServerListModel serverList = SpoutClient.getInstance().getServerManager().getServerList(); -+ -+ protected boolean isFavorite = true; -+ -+ protected PollResult pollResult; -+ -+ private static final String latestMC = "1.4.7"; -+ protected String mcversion = latestMC; -+ public boolean showPing = false; -+ -+ public ServerItem clone() { -+ ServerItem clone = new ServerItem(getTitle(), getIp(), getPort(), getDatabaseId(), mcversion); -+ return clone; -+ } -+ -+ public void setShowPing(boolean showPing) { -+ this.showPing = showPing; -+ } -+ -+ public boolean isShowPing() { -+ return showPing; -+ } -+ -+ public void update(ServerItem other) { -+ this.ip = other.ip; -+ this.port = other.port; -+ this.title = other.title; -+ this.databaseId = other.databaseId; -+ this.pollResult = PollResult.getPoll(ip, port, databaseId); -+ } -+ -+ public ServerItem(String title, String ip, int port, int dbId) { -+ this(title, ip, port, dbId, latestMC); -+ } -+ -+ public ServerItem(String title, String ip, int port, int dbId, String version) { -+ this.ip = ip; -+ this.port = port; -+ this.title = title; -+ this.databaseId = dbId; -+ this.pollResult = PollResult.getPoll(ip, port, dbId); -+ mcversion = version; -+ } -+ -+ public void setFavorite(boolean b) { -+ isFavorite = b; -+ } -+ -+ public void setListWidget(ListWidget widget) { -+ this.widget = widget; -+ } -+ -+ public ListWidget getListWidget() { -+ return widget; -+ } -+ -+ public int getHeight() { -+ return 33; -+ } -+ -+ public void render(int x, int y, int width, int height) { -+ MCRenderDelegate r = (MCRenderDelegate) Spoutcraft.getRenderDelegate(); -+ if (databaseId != -1) { -+ String iconUrl = "http://solder.inspirenxe.org/resources/spoutcraft/servers/images/" + databaseId + ".png"; -+ Texture icon = CustomTextureManager.getTextureFromUrl("Spoutcraft", iconUrl); -+ if (icon == null) { -+ CustomTextureManager.downloadTexture("Spoutcraft", iconUrl, true); -+ icon = CustomTextureManager.getTextureFromPath(FileUtil.getAssetsDir().getPath()+"/icon/unknown_server.png"); -+ } -+ GL11.glPushMatrix(); -+ GL11.glTranslated(x + 2, y + 2, 0); -+ r.drawTexture(icon, 25, 25); -+ GL11.glPopMatrix(); -+ } -+ -+ int marginleft = 29; -+ -+ int ping = getPing(); -+ -+ FontRenderer font = SpoutClient.getHandle().fontRenderer; -+ -+ int margin1 = 0; -+ int margin2 = 0; -+ -+ if (getPing() > 0 && (!isPolling() || showPingWhilePolling)) { -+ if (isShowPing()) { -+ String sping = getPing() + " ms"; -+ int pingwidth = font.getStringWidth(sping); -+ margin1 = pingwidth + 14; -+ font.drawStringWithShadow(sping, x + width - pingwidth - 14, y + 2, 0xaaaaaa); -+ } -+ String sPlayers = getPlayers() + " / " + getMaxPlayers() + " players"; -+ int playerswidth = font.getStringWidth(sPlayers); -+ margin2 = playerswidth; -+ font.drawStringWithShadow(sPlayers, x + width - playerswidth - 2, y + 11, 0xaaaaaa); -+ } -+ -+ font.drawStringWithShadow(r.getFittingText(title, width - margin1 - marginleft), x + marginleft, y + 2, 0xffffff); -+ String sMotd = ""; -+ if ((getPing() == PollResult.PING_POLLING || isPolling()) && !showPingWhilePolling) { -+ sMotd = showPing ? "Polling ..." : "Retrieving MOTD"; -+ } else if (!showPingWhilePolling) { -+ switch (getPing()) { -+ case PollResult.PING_UNKNOWN: -+ sMotd = ChatColor.RED + "Unknown Host!"; -+ break; -+ case PollResult.PING_TIMEOUT: -+ sMotd = ChatColor.RED + "Operation timed out!"; -+ break; -+ case PollResult.PING_BAD_MESSAGE: -+ sMotd = ChatColor.RED + "Bad Message (Server version likely outdated)!"; -+ break; -+ default: -+ sMotd = ChatColor.GREEN + getMotd(); -+ break; -+ } -+ } -+ -+ int color = 0xffffff; -+ if ((getPing() == PollResult.PING_POLLING || isPolling()) && !showPingWhilePolling) { -+ Color c1 = new Color(0, 0, 0); -+ double darkness = 0; -+ long t = System.currentTimeMillis() % 1000; -+ darkness = Math.cos(t * 2 * Math.PI / 1000) * 0.2 + 0.2; -+ c1.setBlue(1f - (float)darkness); -+ color = c1.toInt(); -+ } -+ -+ font.drawStringWithShadow(r.getFittingText(sMotd, width - 10 - margin2 - marginleft), x + marginleft, y + 11, color); -+ -+ GL11.glColor4f(1f, 1f, 1f, 1f); -+ -+ // Fancy icons -+ int xOffset = 0; -+ int yOffset = 0; -+ if (isPolling() && isShowPing()) { -+ xOffset = 1; -+ yOffset = (int)(System.currentTimeMillis() / 100L & 7L); -+ if (yOffset > 4) { -+ yOffset = 8 - yOffset; -+ } -+ } else if (isShowPing()) { -+ xOffset = 0; -+ if (ping < 0L) { -+ yOffset = 5; -+ } else if (ping < 150L) { -+ yOffset = 0; -+ } else if (ping < 300L) { -+ yOffset = 1; -+ } else if (ping < 600L) { -+ yOffset = 2; -+ } else if (ping < 1000L) { -+ yOffset = 3; -+ } else { -+ yOffset = 4; -+ } -+ } -+ if (isShowPing()) { -+ Minecraft.getMinecraft().getTextureManager().bindTexture(new ResourceLocation("textures/gui/icons.png")); -+ RenderUtil.drawTexturedModalRectangle(x + width - 2 - 10, y + 2, 0 + xOffset * 10, 176 + yOffset * 8, 10, 8, 0f); -+ } -+ if (port != DEFAULT_PORT) { -+ font.drawStringWithShadow(ip + ":" +port, x+marginleft, y+20, 0xaaaaaa); -+ } else { -+ font.drawStringWithShadow(ip, x+marginleft, y+20, 0xaaaaaa); -+ } -+ -+ // Icon drawing -+ int iconMargin = 2; -+ -+ if (country != null) { -+ String url = "http://cdn.spout.org/img/flag/" + country.toLowerCase() + ".png"; -+ Texture icon = CustomTextureManager.getTextureFromUrl("Spoutcraft", url); -+ if (icon != null) { -+ GL11.glPushMatrix(); -+ GL11.glTranslatef(x + width - iconMargin - 16, y + 20, 0); -+ r.drawTexture(icon, 16, 11); -+ GL11.glPopMatrix(); -+ iconMargin += 5 + 16; -+ } else { -+ CustomTextureManager.downloadTexture("Spoutcraft", url); -+ } -+ } -+ -+ if (accessType != OPEN) { -+ String name = "lock"; -+ switch(accessType) { -+ case WHITELIST: -+ name = "whitelist"; -+ break; -+ case GRAYLIST: -+ name = "graylist"; -+ break; -+ case BLACKLIST: -+ name = "blacklist"; -+ break; -+ } -+ Texture lockIcon = CustomTextureManager.getTextureFromPath(FileUtil.getAssetsDir().getPath()+"/" + name + ".png"); -+ GL11.glPushMatrix(); -+ GL11.glTranslatef(x + width - iconMargin - 7, y + 20, 0); -+ r.drawTexture(lockIcon, 7, 11); -+ GL11.glPopMatrix(); -+ iconMargin += 5 + 7; -+ } -+ -+ if (pollResult.getVersion() != null) { -+ GL11.glPushMatrix(); -+ versionWidth = font.getStringWidth("1.0.0"); -+ if (isCompatible(SpoutClient.spoutcraftVersion)) { -+ font.drawStringWithShadow(pollResult.getVersion(), x + width - versionWidth - 20, y + 21, 0x00FF00); -+ } else { -+ font.drawStringWithShadow(pollResult.getVersion(), x + width - versionWidth - 20, y + 21, 0xF44607); -+ } -+ GL11.glPopMatrix(); -+ } else { -+ GL11.glPushMatrix(); -+ versionWidth = font.getStringWidth("Unknown"); -+ font.drawStringWithShadow("Unknown", x + width - versionWidth - 20, y + 21, 0xFF0000); -+ GL11.glPopMatrix(); -+ } -+ } -+ -+ public void onClick(int x, int y, boolean doubleClick) { -+ if (doubleClick) { -+ if (isCompatible(SpoutClient.spoutcraftVersion)) { -+ SpoutClient.getInstance().getServerManager().join(this, isFavorite?favorites.getCurrentGui():serverList.getCurrentGui(), isFavorite?"Favorites":"Server List"); -+ } -+ } -+ } -+ -+ public void poll() { -+ pollResult.poll(); -+ } -+ -+ public String getIp() { -+ return ip; -+ } -+ -+ public void setIp(String ip) { -+ this.ip = ip; -+ this.pollResult = PollResult.getPoll(ip, port, databaseId); // Force poll update -+ } -+ -+ public int getPort() { -+ return port; -+ } -+ -+ public void setPort(int port) { -+ this.port = port; -+ this.pollResult = PollResult.getPoll(ip, port, databaseId); // Force poll update -+ } -+ -+ public String getTitle() { -+ return title; -+ } -+ -+ public void setTitle(String title) { -+ this.title = title; -+ } -+ -+ public int getDatabaseId() { -+ return databaseId; -+ } -+ -+ public void setDatabaseId(int databaseId) { -+ this.databaseId = databaseId; -+ this.pollResult = PollResult.getPoll(ip, port, databaseId); // Force poll update -+ } -+ -+ public int getPing() { -+ return pollResult.getPing(); -+ } -+ -+ public boolean isPolling() { -+ return pollResult.isPolling(); -+ } -+ -+ public void endPolling() { -+ pollResult.endPolling(); -+ } -+ -+ public String getMotd() { -+ return pollResult.getMotd(); -+ } -+ -+ public int getPlayers() { -+ return pollResult.getPlayers(); -+ } -+ -+ public int getMaxPlayers() { -+ return pollResult.getMaxPlayers(); -+ } -+ -+ public String getVersion() { -+ String version = pollResult.getVersion(); -+ if (version != null) { -+ return version; -+ } -+ return "0.0.0"; -+ } -+ -+ public void setCountry(String country) { -+ this.country = country; -+ } -+ -+ public String getCountry() { -+ return this.country; -+ } -+ -+ public boolean isWhitelisted() { -+ return accessType == ServerItem.WHITELIST; -+ } -+ -+ public boolean isGraylisted() { -+ return accessType == ServerItem.GRAYLIST; -+ } -+ -+ public boolean isBlacklisted() { -+ return accessType == ServerItem.BLACKLIST; -+ } -+ -+ public boolean isOpen() { -+ return accessType == ServerItem.OPEN; -+ } -+ -+ public void setAccessType(byte access) { -+ this.accessType = access; -+ } -+ -+ public void setShowPingWhilePolling(boolean b) { -+ this.showPingWhilePolling = b; -+ } -+ -+ public Boolean getAcceptsTextures() { -+ return this.acceptsTextures; -+ } -+ -+ public void setAcceptsTextures(boolean acceptsTextures) { -+ this.acceptsTextures = acceptsTextures; -+ } -+ -+ public boolean isCompatible(String version) { -+ // Update the following method to allow users to login to server based on conditional versioning response. -+ if (version.equals("1.6.4")) { -+ if (getVersion().equals("1.6.1")) { -+ return false; -+ } -+ -+ if (getVersion().equals("1.6.2")) { -+ return false; -+ } -+ -+ if (getVersion().equals("1.6.4")) { -+ return true; -+ } -+ } -+ return false; -+ } -+} ---- /dev/null -+++ org/spoutcraft/client/gui/server/GuiFavorites.java -@@ -1,0 +1,316 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.client.gui.server; -+ -+import net.minecraft.src.GuiScreen; -+ -+import org.spoutcraft.api.gui.Button; -+import org.spoutcraft.api.gui.Color; -+import org.spoutcraft.api.gui.GenericButton; -+import org.spoutcraft.api.gui.GenericLabel; -+import org.spoutcraft.api.gui.GenericTextField; -+import org.spoutcraft.api.gui.Keyboard; -+import org.spoutcraft.api.gui.TextField; -+import org.spoutcraft.api.gui.GenericListView; -+import org.spoutcraft.client.SpoutClient; -+ -+public class GuiFavorites extends GuiScreen { -+ private GuiScreen parent; -+ -+ // GUI stuff -+ private Button buttonJoin, buttonAdd, buttonDelete, buttonEdit, buttonMainMenu, buttonServerList, buttonClear, buttonQuickJoin, buttonMoveUp, buttonMoveDown, buttonRefresh; -+ private GenericLabel labelTitle; -+ private TextField textQuickJoin; -+ private GenericListView view; -+ public ServerModel model = SpoutClient.getInstance().getServerManager().getFavorites(); -+ private long pollTime = 0L; -+ -+ public GuiFavorites(GuiScreen parent) { -+ this.parent = parent; -+ model.setCurrentGUI(this); -+ } -+ -+ @Override -+ public void initGui() { -+ labelTitle = new GenericLabel("Favorite Servers"); -+ labelTitle.setY(12).setX(width / 2 - mc.fontRenderer.getStringWidth(labelTitle.getText()) / 2); -+ labelTitle.setHeight(15).setWidth(mc.fontRenderer.getStringWidth(labelTitle.getText()) / 2); -+ getScreen().attachWidget("Spoutcraft", labelTitle); -+ -+ buttonMoveUp = new GenericButton("/\\"); -+ buttonMoveUp.setTooltip("Move Item Up"); -+ buttonMoveUp.setX(5).setY(5); -+ buttonMoveUp.setHeight(20).setWidth(20); -+ getScreen().attachWidget("Spoutcraft", buttonMoveUp); -+ -+ buttonMoveDown = new GenericButton("\\/"); -+ buttonMoveDown.setTooltip("Move Item Down"); -+ buttonMoveDown.setX(25).setY(5); -+ buttonMoveDown.setHeight(20).setWidth(20); -+ getScreen().attachWidget("Spoutcraft", buttonMoveDown); -+ -+ buttonRefresh = new GenericButton("Refresh"); -+ buttonRefresh.setHeight(20).setWidth(100).setX(width - 105).setY(5); -+ getScreen().attachWidget("Spoutcraft", buttonRefresh); -+ -+ int viewheight = height - 110; -+ view = new GenericListView(model); -+ view.setX(5).setY(30).setWidth(width - 10).setHeight(viewheight); -+ getScreen().attachWidget("Spoutcraft", view); -+ -+ int top = (int) (view.getY() + view.getHeight() + 5); -+ -+ int totalWidth = Math.min(width - 9, 200 * 3 + 10); -+ int cellWidth = (totalWidth - 10) / 3; -+ int left = width / 2 - totalWidth / 2; -+ int center = left + cellWidth + 5; -+ int right = center + cellWidth + 5; -+ -+ String text = SpoutClient.getHandle().gameSettings.lastServer.replace("_", ":"); -+ if (textQuickJoin != null) { -+ text = textQuickJoin.getText(); -+ } -+ textQuickJoin = new QuickJoin(); -+ textQuickJoin.setX(left + 2).setY(top + 2).setHeight(16).setWidth((cellWidth * 2 + 5 - 4) - (cellWidth/2)); -+ textQuickJoin.setMaximumCharacters(0); -+ textQuickJoin.setText(text); -+ getScreen().attachWidget("Spoutcraft", textQuickJoin); -+ -+ buttonClear = new GenericButton("Clear"); -+ buttonClear.setX(left + 10 + (cellWidth*2) - (cellWidth/2)).setY(top).setWidth((cellWidth/2) - 5).setHeight(20); -+ getScreen().attachWidget("Spoutcraft", buttonClear); -+ -+ buttonQuickJoin = new GenericButton("Quick Join"); -+ buttonQuickJoin.setX(right).setY(top).setWidth(cellWidth).setHeight(20); -+ getScreen().attachWidget("Spoutcraft", buttonQuickJoin); -+ -+ top += 25; -+ -+ buttonJoin = new GenericButton("Join Server"); -+ buttonJoin.setX(right).setY(top).setWidth(cellWidth).setHeight(20); -+ getScreen().attachWidget("Spoutcraft", buttonJoin); -+ -+ buttonAdd = new GenericButton("Add Favorite"); -+ buttonAdd.setX(center).setY(top).setWidth(cellWidth).setHeight(20); -+ getScreen().attachWidget("Spoutcraft", buttonAdd); -+ -+ buttonEdit = new GenericButton("Edit"); -+ buttonEdit.setX(left).setY(top).setWidth(cellWidth).setHeight(20); -+ getScreen().attachWidget("Spoutcraft", buttonEdit); -+ -+ top += 25; -+ -+ buttonDelete = new DeleteFavoriteButton(this); -+ buttonDelete.setX(left).setY(top).setWidth(cellWidth).setHeight(20); -+ getScreen().attachWidget("Spoutcraft", buttonDelete); -+ -+ buttonServerList = new GenericButton("Public Servers"); -+ buttonServerList.setX(center).setY(top).setWidth(cellWidth) -+ .setHeight(20); -+ getScreen().attachWidget("Spoutcraft", buttonServerList); -+ -+ buttonMainMenu = new GenericButton("Main Menu"); -+ buttonMainMenu.setX(right).setY(top).setWidth(cellWidth).setHeight(20); -+ getScreen().attachWidget("Spoutcraft", buttonMainMenu); -+ refresh(); -+ updateButtons(); -+ SpoutClient.getInstance().getServerManager().staticServers.load(); -+ } -+ -+ private class QuickJoin extends GenericTextField { -+ @Override -+ public boolean onKeyPressed(Keyboard key) { -+ if (key == Keyboard.KEY_RETURN && buttonQuickJoin.isEnabled()) { -+ doQuickJoin(); -+ return true; -+ } else { -+ buttonQuickJoin.setEnabled(textQuickJoin.getText().length() > 0); -+ } -+ return false; -+ } -+ } -+ -+ @Override -+ public void drawScreen(int var1, int var2, float var3) { -+ drawDefaultBackground(); -+ } -+ -+ @Override -+ public void buttonClicked(Button btn) { -+ if (btn.equals(buttonMainMenu)) { -+ SpoutClient.getHandle().displayGuiScreen(new org.spoutcraft.client.gui.mainmenu.MainMenu()); -+ } -+ if (btn.equals(buttonServerList)) { -+ //SpoutClient.getHandle().displayGuiScreen(new GuiServerList()); -+ SpoutClient.getHandle().displayGuiScreen(new GuiStaticServerList(this)); //Use static version until WebAPI is updated. -+ } -+ if (btn.equals(buttonClear)) { -+ textQuickJoin.setText(""); -+ } -+ if (btn.equals(buttonQuickJoin)) { -+ doQuickJoin(); -+ } -+ if (btn.equals(buttonAdd)) { -+ String address = ""; -+ if (model instanceof FavoritesModel) { -+ address = textQuickJoin.getText(); -+ } else if (model instanceof LANModel) { -+ ServerItem item = (ServerItem) view.getSelectedItem(); -+ address = item.ip + ":" + item.port; -+ } -+ SpoutClient.getHandle().displayGuiScreen(new GuiAddFavorite(address, this)); -+ } -+ if (btn.equals(buttonEdit)) { -+ ServerItem item = (ServerItem) view.getSelectedItem(); -+ // Produces a "hang" why ever :( -+ if (item != null) { -+ SpoutClient.getHandle().displayGuiScreen(new GuiAddFavorite(item, this)); -+ } else { -+ updateButtons(); -+ } -+ } -+ if (btn.equals(buttonJoin)) { -+ ServerItem item = null; -+ if (view.getSelectedRow() > -1) { -+ item = (ServerItem) model.getItem(view.getSelectedRow()); -+ } -+ if (item != null) { -+ SpoutClient.getInstance().getServerManager().join(item, this, "Favorites"); -+ } else { -+ // Just in case something weird happens -+ updateButtons(); -+ } -+ } -+ FavoritesModel fav = null; -+ if (model instanceof FavoritesModel) { -+ fav = (FavoritesModel) model; -+ } -+ if (btn.equals(buttonMoveUp) && fav != null) { -+ if (view.getSelectedRow() != -1) { -+ fav.move(view.getSelectedRow(), view.getSelectedRow() - 1); -+ view.shiftSelection(-1); -+ fav.save(); -+ } -+ } -+ if (btn.equals(buttonMoveDown) && fav != null) { -+ if (view.getSelectedRow() != -1) { -+ fav.move(view.getSelectedRow(), view.getSelectedRow() + 1); -+ view.shiftSelection(1); -+ fav.save(); -+ } -+ } -+ if (btn.equals(buttonRefresh)) { -+ refresh(); -+ } -+ } -+ -+ public void refresh() { -+ pollTime = System.currentTimeMillis(); -+ for (int i = 0; i < model.getSize(); i++) { -+ ServerItem item = (ServerItem) model.getItem(i); -+ item.poll(); -+ } -+ } -+ -+ public void deleteCurrentFavorite() { -+ if (model instanceof FavoritesModel) { -+ FavoritesModel fav = (FavoritesModel) model; -+ fav.removeServer((ServerItem) view.getSelectedItem()); -+ fav.save(); -+ } -+ } -+ -+ public void doQuickJoin() { -+ try { -+ String adress = textQuickJoin.getText(); -+ if (!adress.isEmpty()) { -+ String split[] = adress.split(":"); -+ String ip = split[0]; -+ int port = split.length > 1 ? Integer.parseInt(split[1]) : ServerItem.DEFAULT_PORT; -+ SpoutClient.getHandle().gameSettings.lastServer = adress.replace(":", "_"); -+ SpoutClient.getHandle().gameSettings.saveOptions(); -+ SpoutClient.getInstance().getServerManager().join(ip, port, this, "Favorites"); -+ } -+ } catch (Exception e) { -+ } -+ } -+ -+ public void updateButtons() { -+ boolean enable = true; -+ -+ if (view != null && view.getSelectedRow() == -1) { -+ enable = false; -+ } -+ -+ // GUI has not been initialized -+ if (buttonEdit == null) { -+ return; -+ } -+ buttonEdit.setEnabled(enable); -+ buttonDelete.setEnabled(enable); -+ buttonJoin.setEnabled(enable); -+ buttonDelete.setText("Delete"); -+ buttonMoveDown.setEnabled(enable); -+ buttonMoveUp.setEnabled(enable); -+ buttonAdd.setEnabled(true); -+ -+ if (model.isPolling()) { -+ buttonRefresh.setEnabled(false); -+ buttonRefresh.setText("Polling..."); -+ buttonRefresh.setDisabledColor(new Color(0f, 0f, 1f)); -+ } else { -+ buttonRefresh.setEnabled(true); -+ buttonRefresh.setText("Refresh"); -+ } -+ -+ if (view.getSelectedItem() instanceof ServerItem) { -+ ServerItem item = (ServerItem) view.getSelectedItem(); -+ buttonJoin.setEnabled(item.isCompatible(SpoutClient.spoutcraftVersion)); -+ } -+ } -+ -+ @Override -+ public void updateScreen() { -+ if (model.isPolling()) { -+ Color color = new Color(0, 0f, 0); -+ double darkness = 0; -+ long t = System.currentTimeMillis() % 1000; -+ darkness = Math.cos(t * 2 * Math.PI / 1000) * 0.2 + 0.2; -+ color.setBlue(1f - (float) darkness); -+ if (model.isPolling()) { -+ buttonRefresh.setDisabledColor(color); -+ } -+ -+ // If polling locks up and takes > 15s, unlock the button -+ if (pollTime + 15000L < System.currentTimeMillis()) { -+ for (int i = 0; i < model.getSize(); i++) { -+ ServerItem item = (ServerItem) model.getItem(i); -+ if (item.isPolling()) { -+ item.endPolling(); -+ } -+ } -+ model.setPolling(false); -+ } -+ } -+ buttonClear.setEnabled(textQuickJoin.getText().length() > 0); -+ buttonQuickJoin.setEnabled(textQuickJoin.getText().length() > 0); -+ super.updateScreen(); -+ } -+} ---- /dev/null -+++ org/spoutcraft/api/material/Liquid.java -@@ -1,0 +1,24 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.api.material; -+ -+public interface Liquid extends Block{ -+ public boolean isFlowing(); -+} ---- net/minecraft/src/EntitySnowShovelFX.java -+++ net/minecraft/src/EntitySnowShovelFX.java -@@ -3,59 +3,64 @@ - public class EntitySnowShovelFX extends EntityFX { - float snowDigParticleScale; - -- public EntitySnowShovelFX(World var1, double var2, double var4, double var6, double var8, double var10, double var12) { -- this(var1, var2, var4, var6, var8, var10, var12, 1.0F); -+ public EntitySnowShovelFX(World par1World, double par2, double par4, double par6, double par8, double par10, double par12) { -+ this(par1World, par2, par4, par6, par8, par10, par12, 1.0F); - } - -- public EntitySnowShovelFX(World var1, double var2, double var4, double var6, double var8, double var10, double var12, float var14) { -- super(var1, var2, var4, var6, var8, var10, var12); -- this.motionX *= (double)0.1F; -- this.motionY *= (double)0.1F; -- this.motionZ *= (double)0.1F; -- this.motionX += var8; -- this.motionY += var10; -- this.motionZ += var12; -- this.particleRed = this.particleGreen = this.particleBlue = 1.0F - (float)(Math.random() * (double)0.3F); -- this.particleScale *= 12.0F / 16.0F; -- this.particleScale *= var14; -+ public EntitySnowShovelFX(World par1World, double par2, double par4, double par6, double par8, double par10, double par12, float par14) { -+ super(par1World, par2, par4, par6, par8, par10, par12); -+ this.motionX *= 0.10000000149011612D; -+ this.motionY *= 0.10000000149011612D; -+ this.motionZ *= 0.10000000149011612D; -+ this.motionX += par8; -+ this.motionY += par10; -+ this.motionZ += par12; -+ this.particleRed = this.particleGreen = this.particleBlue = 1.0F - (float)(Math.random() * 0.30000001192092896D); -+ this.particleScale *= 0.75F; -+ this.particleScale *= par14; - this.snowDigParticleScale = this.particleScale; - this.particleMaxAge = (int)(8.0D / (Math.random() * 0.8D + 0.2D)); -- this.particleMaxAge = (int)((float)this.particleMaxAge * var14); -+ this.particleMaxAge = (int)((float)this.particleMaxAge * par14); - this.noClip = false; - } - -- public void renderParticle(Tessellator var1, float var2, float var3, float var4, float var5, float var6, float var7) { -- float var8 = ((float)this.particleAge + var2) / (float)this.particleMaxAge * 32.0F; -- if(var8 < 0.0F) { -+ public void renderParticle(Tessellator par1Tessellator, float par2, float par3, float par4, float par5, float par6, float par7) { -+ float var8 = ((float)this.particleAge + par2) / (float)this.particleMaxAge * 32.0F; -+ -+ if (var8 < 0.0F) { - var8 = 0.0F; - } - -- if(var8 > 1.0F) { -+ if (var8 > 1.0F) { - var8 = 1.0F; - } - - this.particleScale = this.snowDigParticleScale * var8; -- super.renderParticle(var1, var2, var3, var4, var5, var6, var7); -+ super.renderParticle(par1Tessellator, par2, par3, par4, par5, par6, par7); - } - -+ /** -+ * Called to update the entity's position/logic. -+ */ - public void onUpdate() { - this.prevPosX = this.posX; - this.prevPosY = this.posY; - this.prevPosZ = this.posZ; -- if(this.particleAge++ >= this.particleMaxAge) { -+ -+ if (this.particleAge++ >= this.particleMaxAge) { - this.setDead(); - } - - this.setParticleTextureIndex(7 - this.particleAge * 8 / this.particleMaxAge); - this.motionY -= 0.03D; - this.moveEntity(this.motionX, this.motionY, this.motionZ); -- this.motionX *= (double)0.99F; -- this.motionY *= (double)0.99F; -- this.motionZ *= (double)0.99F; -- if(this.onGround) { -- this.motionX *= (double)0.7F; -- this.motionZ *= (double)0.7F; -- } -+ this.motionX *= 0.9900000095367432D; -+ this.motionY *= 0.9900000095367432D; -+ this.motionZ *= 0.9900000095367432D; - -+ if (this.onGround) { -+ this.motionX *= 0.699999988079071D; -+ this.motionZ *= 0.699999988079071D; -+ } - } - } ---- net/minecraft/src/RenderTNTPrimed.java -+++ net/minecraft/src/RenderTNTPrimed.java -@@ -9,17 +9,19 @@ - this.shadowSize = 0.5F; - } - -- public void renderPrimedTNT(EntityTNTPrimed var1, double var2, double var4, double var6, float var8, float var9) { -+ public void renderPrimedTNT(EntityTNTPrimed par1EntityTNTPrimed, double par2, double par4, double par6, float par8, float par9) { - GL11.glPushMatrix(); -- GL11.glTranslatef((float)var2, (float)var4, (float)var6); -+ GL11.glTranslatef((float)par2, (float)par4, (float)par6); - float var10; -- if((float)var1.fuse - var9 + 1.0F < 10.0F) { -- var10 = 1.0F - ((float)var1.fuse - var9 + 1.0F) / 10.0F; -- if(var10 < 0.0F) { -+ -+ if ((float)par1EntityTNTPrimed.fuse - par9 + 1.0F < 10.0F) { -+ var10 = 1.0F - ((float)par1EntityTNTPrimed.fuse - par9 + 1.0F) / 10.0F; -+ -+ if (var10 < 0.0F) { - var10 = 0.0F; - } - -- if(var10 > 1.0F) { -+ if (var10 > 1.0F) { - var10 = 1.0F; - } - -@@ -29,10 +31,11 @@ - GL11.glScalef(var11, var11, var11); - } - -- var10 = (1.0F - ((float)var1.fuse - var9 + 1.0F) / 100.0F) * 0.8F; -- this.bindEntityTexture(var1); -- this.blockRenderer.renderBlockAsItem(Block.tnt, 0, var1.getBrightness(var9)); -- if(var1.fuse / 5 % 2 == 0) { -+ var10 = (1.0F - ((float)par1EntityTNTPrimed.fuse - par9 + 1.0F) / 100.0F) * 0.8F; -+ this.bindEntityTexture(par1EntityTNTPrimed); -+ this.blockRenderer.renderBlockAsItem(Block.tnt, 0, par1EntityTNTPrimed.getBrightness(par9)); -+ -+ if (par1EntityTNTPrimed.fuse / 5 % 2 == 0) { - GL11.glDisable(GL11.GL_TEXTURE_2D); - GL11.glDisable(GL11.GL_LIGHTING); - GL11.glEnable(GL11.GL_BLEND); -@@ -48,15 +51,24 @@ - GL11.glPopMatrix(); - } - -- protected ResourceLocation func_110808_a(EntityTNTPrimed var1) { -+ protected ResourceLocation func_110808_a(EntityTNTPrimed par1EntityTNTPrimed) { - return TextureMap.locationBlocksTexture; - } - -- protected ResourceLocation getEntityTexture(Entity var1) { -- return this.func_110808_a((EntityTNTPrimed)var1); -+ /** -+ * Returns the location of an entity's texture. Doesn't seem to be called unless you call Render.bindEntityTexture. -+ */ -+ protected ResourceLocation getEntityTexture(Entity par1Entity) { -+ return this.func_110808_a((EntityTNTPrimed)par1Entity); - } - -- public void doRender(Entity var1, double var2, double var4, double var6, float var8, float var9) { -- this.renderPrimedTNT((EntityTNTPrimed)var1, var2, var4, var6, var8, var9); -+ /** -+ * Actually renders the given argument. This is a synthetic bridge method, always casting down its argument and then -+ * handing it off to a worker function which does the actual work. In all probabilty, the class Render is generic -+ * (Render -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.api.gui; -+ -+import org.spoutcraft.api.UnsafeClass; -+ -+@UnsafeClass -+public interface Slider extends Control, Label { -+ /** -+ * Gets the slider position (between 0.0f and 1.0f) -+ * -+ * @return slider position -+ */ -+ public float getSliderPosition(); -+ -+ /** -+ * Sets the slider position. Values below 0.0f are rounded to 0, and values above 1.0f are rounded to 1 -+ * -+ * @param value to set -+ * @return slider -+ */ -+ public Slider setSliderPosition(float value); -+ -+ public boolean isDragging(); -+ -+ public Slider setDragging(boolean dragged); -+ -+ public Slider setText(String text); -+ -+ public Slider setTextColor(Color color); -+ -+ public Slider setAuto(boolean auto); -+ -+ public Slider setAlign(WidgetAnchor align); -+ -+ public void onSliderDrag(float oldPos, float newPos); -+} ---- /dev/null -+++ org/spoutcraft/client/special/Holiday.java -@@ -1,0 +1,62 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.client.special; -+ -+public class Holiday { -+ private final String name; -+ private final long start; -+ private final long end; -+ private final String cape; -+ private final String splash; -+ private final boolean particles; -+ -+ public Holiday(String name, long start, long end, String cape, String splash, boolean particles) { -+ this.name = name; -+ this.start = start; -+ this.end = end; -+ this.cape = cape; -+ this.splash = splash; -+ this.particles = particles; -+ } -+ -+ public long getStart() { -+ return start; -+ } -+ -+ public long getEnd() { -+ return end; -+ } -+ -+ public String getCape() { -+ return cape; -+ } -+ -+ public String getSplash() { -+ return splash; -+ } -+ -+ public boolean isParticles() { -+ return particles; -+ } -+ -+ public String getName() { -+ return name; -+ } -+} ---- net/minecraft/src/ModelWitch.java -+++ net/minecraft/src/ModelWitch.java -@@ -5,8 +5,8 @@ - private ModelRenderer field_82901_h = (new ModelRenderer(this)).setTextureSize(64, 128); - private ModelRenderer witchHat; - -- public ModelWitch(float var1) { -- super(var1, 0.0F, 64, 128); -+ public ModelWitch(float par1) { -+ super(par1, 0.0F, 64, 128); - this.field_82901_h.setRotationPoint(0.0F, -2.0F, 0.0F); - this.field_82901_h.setTextureOffset(0, 0).addBox(0.0F, 3.0F, -6.75F, 1, 1, 1, -0.25F); - this.villagerNose.addChild(this.field_82901_h); -@@ -34,18 +34,23 @@ - var3.addChild(var4); - } - -- public void setRotationAngles(float var1, float var2, float var3, float var4, float var5, float var6, Entity var7) { -- super.setRotationAngles(var1, var2, var3, var4, var5, var6, var7); -+ /** -+ * Sets the model's various rotation angles. For bipeds, par1 and par2 are used for animating the movement of arms and -+ * legs, where par1 represents the time(so that arms and legs swing back and forth) and par2 represents how "far" arms -+ * and legs can swing at most. -+ */ -+ public void setRotationAngles(float par1, float par2, float par3, float par4, float par5, float par6, Entity par7Entity) { -+ super.setRotationAngles(par1, par2, par3, par4, par5, par6, par7Entity); - this.villagerNose.offsetX = this.villagerNose.offsetY = this.villagerNose.offsetZ = 0.0F; -- float var8 = 0.01F * (float)(var7.entityId % 10); -- this.villagerNose.rotateAngleX = MathHelper.sin((float)var7.ticksExisted * var8) * 4.5F * (float)Math.PI / 180.0F; -+ float var8 = 0.01F * (float)(par7Entity.entityId % 10); -+ this.villagerNose.rotateAngleX = MathHelper.sin((float)par7Entity.ticksExisted * var8) * 4.5F * (float)Math.PI / 180.0F; - this.villagerNose.rotateAngleY = 0.0F; -- this.villagerNose.rotateAngleZ = MathHelper.cos((float)var7.ticksExisted * var8) * 2.5F * (float)Math.PI / 180.0F; -- if(this.field_82900_g) { -+ this.villagerNose.rotateAngleZ = MathHelper.cos((float)par7Entity.ticksExisted * var8) * 2.5F * (float)Math.PI / 180.0F; -+ -+ if (this.field_82900_g) { - this.villagerNose.rotateAngleX = -0.9F; - this.villagerNose.offsetZ = -0.09375F; -- this.villagerNose.offsetY = 3.0F / 16.0F; -+ this.villagerNose.offsetY = 0.1875F; - } -- - } - } ---- /dev/null -+++ org/spoutcraft/client/gui/settings/controls/ChatButton.java -@@ -1,0 +1,41 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.client.gui.settings.controls; -+ -+import net.minecraft.src.GuiScreen; -+import net.minecraft.src.ScreenChatOptions; -+ -+import org.spoutcraft.api.gui.GenericButton; -+import org.spoutcraft.client.SpoutClient; -+ -+public class ChatButton extends GenericButton { -+ GuiScreen parent; -+ -+ public ChatButton(GuiScreen parent) { -+ super("Chat Options"); -+ this.parent = parent; -+ } -+ -+ @Override -+ public void onButtonClick() { -+ ScreenChatOptions chatSettings = new ScreenChatOptions(parent, SpoutClient.getHandle().gameSettings); -+ SpoutClient.getHandle().displayGuiScreen(chatSettings); -+ } -+} ---- net/minecraft/src/EntityAITradePlayer.java -+++ net/minecraft/src/EntityAITradePlayer.java -@@ -3,19 +3,22 @@ - public class EntityAITradePlayer extends EntityAIBase { - private EntityVillager villager; - -- public EntityAITradePlayer(EntityVillager var1) { -- this.villager = var1; -+ public EntityAITradePlayer(EntityVillager par1EntityVillager) { -+ this.villager = par1EntityVillager; - this.setMutexBits(5); - } - -+ /** -+ * Returns whether the EntityAIBase should begin execution. -+ */ - public boolean shouldExecute() { -- if(!this.villager.isEntityAlive()) { -- return false; -- } else if(this.villager.isInWater()) { -- return false; -- } else if(!this.villager.onGround) { -- return false; -- } else if(this.villager.velocityChanged) { -+ if (!this.villager.isEntityAlive()) { -+ return false; -+ } else if (this.villager.isInWater()) { -+ return false; -+ } else if (!this.villager.onGround) { -+ return false; -+ } else if (this.villager.velocityChanged) { - return false; - } else { - EntityPlayer var1 = this.villager.getCustomer(); -@@ -23,10 +26,16 @@ - } - } - -+ /** -+ * Execute a one shot task or start executing a continuous task -+ */ - public void startExecuting() { - this.villager.getNavigator().clearPathEntity(); - } - -+ /** -+ * Resets the task -+ */ - public void resetTask() { - this.villager.setCustomer((EntityPlayer)null); - } ---- net/minecraft/src/AnvilChunkLoader.java -+++ net/minecraft/src/AnvilChunkLoader.java -@@ -1,8 +1,6 @@ - package net.minecraft.src; - --import java.io.DataInput; - import java.io.DataInputStream; --import java.io.DataOutput; - import java.io.DataOutputStream; - import java.io.File; - import java.io.IOException; -@@ -13,108 +11,123 @@ - import java.util.Set; - - public class AnvilChunkLoader implements IChunkLoader, IThreadedFileIO { -- private List a = new ArrayList(); -- private Set b = new HashSet(); -- private Object c = new Object(); -- private final File d; -- -- public AnvilChunkLoader(File var1) { -- this.d = var1; -+ private List chunksToRemove = new ArrayList(); -+ private Set pendingAnvilChunksCoordinates = new HashSet(); -+ private Object syncLockObject = new Object(); -+ -+ /** Save directory for chunks using the Anvil format */ -+ private final File chunkSaveLocation; -+ -+ public AnvilChunkLoader(File par1File) { -+ this.chunkSaveLocation = par1File; - } - -- public Chunk loadChunk(World var1, int var2, int var3) throws IOException { -+ /** -+ * Loads the specified(XZ) chunk into the specified world. -+ */ -+ public Chunk loadChunk(World par1World, int par2, int par3) throws IOException { - NBTTagCompound var4 = null; -- ChunkCoordIntPair var5 = new ChunkCoordIntPair(var2, var3); -- Object var6 = this.c; -- synchronized(var6) { -- if(this.b.contains(var5)) { -- for(int var7 = 0; var7 < this.a.size(); ++var7) { -- if(((AnvilChunkLoaderPending)this.a.get(var7)).chunkCoordinate.equals(var5)) { -- var4 = ((AnvilChunkLoaderPending)this.a.get(var7)).nbtTags; -+ ChunkCoordIntPair var5 = new ChunkCoordIntPair(par2, par3); -+ Object var6 = this.syncLockObject; -+ -+ synchronized (this.syncLockObject) { -+ if (this.pendingAnvilChunksCoordinates.contains(var5)) { -+ for (int var7 = 0; var7 < this.chunksToRemove.size(); ++var7) { -+ if (((AnvilChunkLoaderPending)this.chunksToRemove.get(var7)).chunkCoordinate.equals(var5)) { -+ var4 = ((AnvilChunkLoaderPending)this.chunksToRemove.get(var7)).nbtTags; - break; - } - } - } - } - -- if(var4 == null) { -- DataInputStream var10 = RegionFileCache.getChunkInputStream(this.d, var2, var3); -- if(var10 == null) { -+ if (var4 == null) { -+ DataInputStream var10 = RegionFileCache.getChunkInputStream(this.chunkSaveLocation, par2, par3); -+ -+ if (var10 == null) { - return null; - } - -- var4 = CompressedStreamTools.read((DataInput)var10); -+ var4 = CompressedStreamTools.read(var10); - } - -- return this.checkedReadChunkFromNBT(var1, var2, var3, var4); -+ return this.checkedReadChunkFromNBT(par1World, par2, par3, var4); - } - -- protected Chunk checkedReadChunkFromNBT(World var1, int var2, int var3, NBTTagCompound var4) { -- if(!var4.hasKey("Level")) { -- var1.getWorldLogAgent().logSevere("Chunk file at " + var2 + "," + var3 + " is missing level data, skipping"); -+ /** -+ * Wraps readChunkFromNBT. Checks the coordinates and several NBT tags. -+ */ -+ protected Chunk checkedReadChunkFromNBT(World par1World, int par2, int par3, NBTTagCompound par4NBTTagCompound) { -+ if (!par4NBTTagCompound.hasKey("Level")) { -+ par1World.getWorldLogAgent().logSevere("Chunk file at " + par2 + "," + par3 + " is missing level data, skipping"); - return null; -- } else if(!var4.getCompoundTag("Level").hasKey("Sections")) { -- var1.getWorldLogAgent().logSevere("Chunk file at " + var2 + "," + var3 + " is missing block data, skipping"); -+ } else if (!par4NBTTagCompound.getCompoundTag("Level").hasKey("Sections")) { -+ par1World.getWorldLogAgent().logSevere("Chunk file at " + par2 + "," + par3 + " is missing block data, skipping"); - return null; - } else { -- Chunk var5 = this.readChunkFromNBT(var1, var4.getCompoundTag("Level")); -- if(!var5.isAtLocation(var2, var3)) { -- var1.getWorldLogAgent().logSevere("Chunk file at " + var2 + "," + var3 + " is in the wrong location; relocating. (Expected " + var2 + ", " + var3 + ", got " + var5.xPosition + ", " + var5.zPosition + ")"); -- var4.setInteger("xPos", var2); -- var4.setInteger("zPos", var3); -- var5 = this.readChunkFromNBT(var1, var4.getCompoundTag("Level")); -+ Chunk var5 = this.readChunkFromNBT(par1World, par4NBTTagCompound.getCompoundTag("Level")); -+ -+ if (!var5.isAtLocation(par2, par3)) { -+ par1World.getWorldLogAgent().logSevere("Chunk file at " + par2 + "," + par3 + " is in the wrong location; relocating. (Expected " + par2 + ", " + par3 + ", got " + var5.xPosition + ", " + var5.zPosition + ")"); -+ par4NBTTagCompound.setInteger("xPos", par2); -+ par4NBTTagCompound.setInteger("zPos", par3); -+ var5 = this.readChunkFromNBT(par1World, par4NBTTagCompound.getCompoundTag("Level")); - } - - return var5; - } - } - -- public void saveChunk(World var1, Chunk var2) throws IOException, MinecraftException { -- var1.checkSessionLock(); -+ public void saveChunk(World par1World, Chunk par2Chunk) throws MinecraftException, IOException { -+ par1World.checkSessionLock(); - - try { - NBTTagCompound var3 = new NBTTagCompound(); - NBTTagCompound var4 = new NBTTagCompound(); - var3.setTag("Level", var4); -- this.writeChunkToNBT(var2, var1, var4); -- this.addChunkToPending(var2.getChunkCoordIntPair(), var3); -+ this.writeChunkToNBT(par2Chunk, par1World, var4); -+ this.addChunkToPending(par2Chunk.getChunkCoordIntPair(), var3); - } catch (Exception var5) { - var5.printStackTrace(); - } -- - } - -- protected void addChunkToPending(ChunkCoordIntPair var1, NBTTagCompound var2) { -- Object var3 = this.c; -- synchronized(var3) { -- if(this.b.contains(var1)) { -- for(int var4 = 0; var4 < this.a.size(); ++var4) { -- if(((AnvilChunkLoaderPending)this.a.get(var4)).chunkCoordinate.equals(var1)) { -- this.a.set(var4, new AnvilChunkLoaderPending(var1, var2)); -+ protected void addChunkToPending(ChunkCoordIntPair par1ChunkCoordIntPair, NBTTagCompound par2NBTTagCompound) { -+ Object var3 = this.syncLockObject; -+ -+ synchronized (this.syncLockObject) { -+ if (this.pendingAnvilChunksCoordinates.contains(par1ChunkCoordIntPair)) { -+ for (int var4 = 0; var4 < this.chunksToRemove.size(); ++var4) { -+ if (((AnvilChunkLoaderPending)this.chunksToRemove.get(var4)).chunkCoordinate.equals(par1ChunkCoordIntPair)) { -+ this.chunksToRemove.set(var4, new AnvilChunkLoaderPending(par1ChunkCoordIntPair, par2NBTTagCompound)); - return; - } - } - } - -- this.a.add(new AnvilChunkLoaderPending(var1, var2)); -- this.b.add(var1); -+ this.chunksToRemove.add(new AnvilChunkLoaderPending(par1ChunkCoordIntPair, par2NBTTagCompound)); -+ this.pendingAnvilChunksCoordinates.add(par1ChunkCoordIntPair); - ThreadedFileIOBase.threadedIOInstance.queueIO(this); - } - } - -+ /** -+ * Returns a boolean stating if the write was unsuccessful. -+ */ - public boolean writeNextIO() { - AnvilChunkLoaderPending var1 = null; -- Object var2 = this.c; -- synchronized(var2) { -- if(this.a.isEmpty()) { -+ Object var2 = this.syncLockObject; -+ -+ synchronized (this.syncLockObject) { -+ if (this.chunksToRemove.isEmpty()) { - return false; - } - -- var1 = (AnvilChunkLoaderPending)this.a.remove(0); -- this.b.remove(var1.chunkCoordinate); -+ var1 = (AnvilChunkLoaderPending)this.chunksToRemove.remove(0); -+ this.pendingAnvilChunksCoordinates.remove(var1.chunkCoordinate); - } - -- if(var1 != null) { -+ if (var1 != null) { - try { - this.writeChunkNBTTags(var1); - } catch (Exception var4) { -@@ -125,51 +138,67 @@ - return true; - } - -- private void writeChunkNBTTags(AnvilChunkLoaderPending var1) throws IOException { -- DataOutputStream var2 = RegionFileCache.getChunkOutputStream(this.d, var1.chunkCoordinate.chunkXPos, var1.chunkCoordinate.chunkZPos); -- CompressedStreamTools.write(var1.nbtTags, (DataOutput)var2); -+ private void writeChunkNBTTags(AnvilChunkLoaderPending par1AnvilChunkLoaderPending) throws IOException { -+ DataOutputStream var2 = RegionFileCache.getChunkOutputStream(this.chunkSaveLocation, par1AnvilChunkLoaderPending.chunkCoordinate.chunkXPos, par1AnvilChunkLoaderPending.chunkCoordinate.chunkZPos); -+ CompressedStreamTools.write(par1AnvilChunkLoaderPending.nbtTags, var2); - var2.close(); - } - -- public void saveExtraChunkData(World var1, Chunk var2) { -- } -- -- public void chunkTick() { -- } -- -+ /** -+ * Save extra data associated with this Chunk not normally saved during autosave, only during chunk unload. Currently -+ * unused. -+ */ -+ public void saveExtraChunkData(World par1World, Chunk par2Chunk) {} -+ -+ /** -+ * Called every World.tick() -+ */ -+ public void chunkTick() {} -+ -+ /** -+ * Save extra data not associated with any Chunk. Not saved during autosave, only during world unload. Currently -+ * unused. -+ */ - public void saveExtraData() { -- while(this.writeNextIO()) { -+ while (this.writeNextIO()) { -+ ; - } -- - } - -- private void writeChunkToNBT(Chunk var1, World var2, NBTTagCompound var3) { -- var3.setInteger("xPos", var1.xPosition); -- var3.setInteger("zPos", var1.zPosition); -- var3.setLong("LastUpdate", var2.getTotalWorldTime()); -- var3.setIntArray("HeightMap", var1.heightMap); -- var3.setBoolean("TerrainPopulated", var1.isTerrainPopulated); -- var3.setLong("InhabitedTime", var1.inhabitedTime); -- ExtendedBlockStorage[] var4 = var1.getBlockStorageArray(); -+ /** -+ * Writes the Chunk passed as an argument to the NBTTagCompound also passed, using the World argument to retrieve the -+ * Chunk's last update time. -+ */ -+ private void writeChunkToNBT(Chunk par1Chunk, World par2World, NBTTagCompound par3NBTTagCompound) { -+ par3NBTTagCompound.setInteger("xPos", par1Chunk.xPosition); -+ par3NBTTagCompound.setInteger("zPos", par1Chunk.zPosition); -+ par3NBTTagCompound.setLong("LastUpdate", par2World.getTotalWorldTime()); -+ par3NBTTagCompound.setIntArray("HeightMap", par1Chunk.heightMap); -+ par3NBTTagCompound.setBoolean("TerrainPopulated", par1Chunk.isTerrainPopulated); -+ par3NBTTagCompound.setLong("InhabitedTime", par1Chunk.inhabitedTime); -+ ExtendedBlockStorage[] var4 = par1Chunk.getBlockStorageArray(); - NBTTagList var5 = new NBTTagList("Sections"); -- boolean var6 = !var2.provider.hasNoSky; -+ boolean var6 = !par2World.provider.hasNoSky; - ExtendedBlockStorage[] var7 = var4; - int var8 = var4.length; -- - NBTTagCompound var11; -- for(int var9 = 0; var9 < var8; ++var9) { -+ -+ for (int var9 = 0; var9 < var8; ++var9) { - ExtendedBlockStorage var10 = var7[var9]; -- if(var10 != null) { -+ -+ if (var10 != null) { - var11 = new NBTTagCompound(); - var11.setByte("Y", (byte)(var10.getYLocation() >> 4 & 255)); - var11.setByteArray("Blocks", var10.getBlockLSBArray()); -- if(var10.getBlockMSBArray() != null) { -+ -+ if (var10.getBlockMSBArray() != null) { - var11.setByteArray("Add", var10.getBlockMSBArray().data); - } - - var11.setByteArray("Data", var10.getMetadataArray().data); - var11.setByteArray("BlockLight", var10.getBlocklightArray().data); -- if(var6) { -+ -+ if (var6) { - var11.setByteArray("SkyLight", var10.getSkylightArray().data); - } else { - var11.setByteArray("SkyLight", new byte[var10.getBlocklightArray().data.length]); -@@ -179,44 +208,46 @@ - } - } - -- var3.setTag("Sections", var5); -- var3.setByteArray("Biomes", var1.getBiomeArray()); -- var1.hasEntities = false; -+ par3NBTTagCompound.setTag("Sections", var5); -+ par3NBTTagCompound.setByteArray("Biomes", par1Chunk.getBiomeArray()); -+ par1Chunk.hasEntities = false; - NBTTagList var16 = new NBTTagList(); -- - Iterator var18; -- for(var8 = 0; var8 < var1.j.length; ++var8) { -- var18 = var1.j[var8].iterator(); -- -- while(var18.hasNext()) { -+ -+ for (var8 = 0; var8 < par1Chunk.entityLists.length; ++var8) { -+ var18 = par1Chunk.entityLists[var8].iterator(); -+ -+ while (var18.hasNext()) { - Entity var20 = (Entity)var18.next(); - var11 = new NBTTagCompound(); -- if(var20.writeToNBTOptional(var11)) { -- var1.hasEntities = true; -+ -+ if (var20.writeToNBTOptional(var11)) { -+ par1Chunk.hasEntities = true; - var16.appendTag(var11); - } - } - } - -- var3.setTag("Entities", var16); -+ par3NBTTagCompound.setTag("Entities", var16); - NBTTagList var17 = new NBTTagList(); -- var18 = var1.i.values().iterator(); -+ var18 = par1Chunk.chunkTileEntityMap.values().iterator(); - -- while(var18.hasNext()) { -+ while (var18.hasNext()) { - TileEntity var21 = (TileEntity)var18.next(); - var11 = new NBTTagCompound(); - var21.writeToNBT(var11); - var17.appendTag(var11); - } - -- var3.setTag("TileEntities", var17); -- List var19 = var2.getPendingBlockUpdates(var1, false); -- if(var19 != null) { -- long var22 = var2.getTotalWorldTime(); -+ par3NBTTagCompound.setTag("TileEntities", var17); -+ List var19 = par2World.getPendingBlockUpdates(par1Chunk, false); -+ -+ if (var19 != null) { -+ long var22 = par2World.getTotalWorldTime(); - NBTTagList var12 = new NBTTagList(); - Iterator var13 = var19.iterator(); - -- while(var13.hasNext()) { -+ while (var13.hasNext()) { - NextTickListEntry var14 = (NextTickListEntry)var13.next(); - NBTTagCompound var15 = new NBTTagCompound(); - var15.setInteger("i", var14.blockID); -@@ -228,35 +259,40 @@ - var12.appendTag(var15); - } - -- var3.setTag("TileTicks", var12); -+ par3NBTTagCompound.setTag("TileTicks", var12); - } -- - } - -- private Chunk readChunkFromNBT(World var1, NBTTagCompound var2) { -- int var3 = var2.getInteger("xPos"); -- int var4 = var2.getInteger("zPos"); -- Chunk var5 = new Chunk(var1, var3, var4); -- var5.heightMap = var2.getIntArray("HeightMap"); -- var5.isTerrainPopulated = var2.getBoolean("TerrainPopulated"); -- var5.inhabitedTime = var2.getLong("InhabitedTime"); -- NBTTagList var6 = var2.getTagList("Sections"); -+ /** -+ * Reads the data stored in the passed NBTTagCompound and creates a Chunk with that data in the passed World. Returns -+ * the created Chunk. -+ */ -+ private Chunk readChunkFromNBT(World par1World, NBTTagCompound par2NBTTagCompound) { -+ int var3 = par2NBTTagCompound.getInteger("xPos"); -+ int var4 = par2NBTTagCompound.getInteger("zPos"); -+ Chunk var5 = new Chunk(par1World, var3, var4); -+ var5.heightMap = par2NBTTagCompound.getIntArray("HeightMap"); -+ var5.isTerrainPopulated = par2NBTTagCompound.getBoolean("TerrainPopulated"); -+ var5.inhabitedTime = par2NBTTagCompound.getLong("InhabitedTime"); -+ NBTTagList var6 = par2NBTTagCompound.getTagList("Sections"); - byte var7 = 16; - ExtendedBlockStorage[] var8 = new ExtendedBlockStorage[var7]; -- boolean var9 = !var1.provider.hasNoSky; -+ boolean var9 = !par1World.provider.hasNoSky; - -- for(int var10 = 0; var10 < var6.tagCount(); ++var10) { -+ for (int var10 = 0; var10 < var6.tagCount(); ++var10) { - NBTTagCompound var11 = (NBTTagCompound)var6.tagAt(var10); - byte var12 = var11.getByte("Y"); - ExtendedBlockStorage var13 = new ExtendedBlockStorage(var12 << 4, var9); - var13.setBlockLSBArray(var11.getByteArray("Blocks")); -- if(var11.hasKey("Add")) { -+ -+ if (var11.hasKey("Add")) { - var13.setBlockMSBArray(new NibbleArray(var11.getByteArray("Add"), 4)); - } - - var13.setBlockMetadataArray(new NibbleArray(var11.getByteArray("Data"), 4)); - var13.setBlocklightArray(new NibbleArray(var11.getByteArray("BlockLight"), 4)); -- if(var9) { -+ -+ if (var9) { - var13.setSkylightArray(new NibbleArray(var11.getByteArray("SkyLight"), 4)); - } - -@@ -265,23 +301,27 @@ - } - - var5.setStorageArrays(var8); -- if(var2.hasKey("Biomes")) { -- var5.setBiomeArray(var2.getByteArray("Biomes")); -+ -+ if (par2NBTTagCompound.hasKey("Biomes")) { -+ var5.setBiomeArray(par2NBTTagCompound.getByteArray("Biomes")); - } - -- NBTTagList var17 = var2.getTagList("Entities"); -- if(var17 != null) { -- for(int var18 = 0; var18 < var17.tagCount(); ++var18) { -+ NBTTagList var17 = par2NBTTagCompound.getTagList("Entities"); -+ -+ if (var17 != null) { -+ for (int var18 = 0; var18 < var17.tagCount(); ++var18) { - NBTTagCompound var20 = (NBTTagCompound)var17.tagAt(var18); -- Entity var22 = EntityList.createEntityFromNBT(var20, var1); -+ Entity var22 = EntityList.createEntityFromNBT(var20, par1World); - var5.hasEntities = true; -- if(var22 != null) { -+ -+ if (var22 != null) { - var5.addEntity(var22); - Entity var14 = var22; - -- for(NBTTagCompound var15 = var20; var15.hasKey("Riding"); var15 = var15.getCompoundTag("Riding")) { -- Entity var16 = EntityList.createEntityFromNBT(var15.getCompoundTag("Riding"), var1); -- if(var16 != null) { -+ for (NBTTagCompound var15 = var20; var15.hasKey("Riding"); var15 = var15.getCompoundTag("Riding")) { -+ Entity var16 = EntityList.createEntityFromNBT(var15.getCompoundTag("Riding"), par1World); -+ -+ if (var16 != null) { - var5.addEntity(var16); - var14.mountEntity(var16); - } -@@ -292,23 +332,26 @@ - } - } - -- NBTTagList var19 = var2.getTagList("TileEntities"); -- if(var19 != null) { -- for(int var21 = 0; var21 < var19.tagCount(); ++var21) { -+ NBTTagList var19 = par2NBTTagCompound.getTagList("TileEntities"); -+ -+ if (var19 != null) { -+ for (int var21 = 0; var21 < var19.tagCount(); ++var21) { - NBTTagCompound var24 = (NBTTagCompound)var19.tagAt(var21); - TileEntity var26 = TileEntity.createAndLoadEntity(var24); -- if(var26 != null) { -+ -+ if (var26 != null) { - var5.addTileEntity(var26); - } - } - } - -- if(var2.hasKey("TileTicks")) { -- NBTTagList var23 = var2.getTagList("TileTicks"); -- if(var23 != null) { -- for(int var25 = 0; var25 < var23.tagCount(); ++var25) { -+ if (par2NBTTagCompound.hasKey("TileTicks")) { -+ NBTTagList var23 = par2NBTTagCompound.getTagList("TileTicks"); -+ -+ if (var23 != null) { -+ for (int var25 = 0; var25 < var23.tagCount(); ++var25) { - NBTTagCompound var27 = (NBTTagCompound)var23.tagAt(var25); -- var1.scheduleBlockUpdateFromLoad(var27.getInteger("x"), var27.getInteger("y"), var27.getInteger("z"), var27.getInteger("i"), var27.getInteger("t"), var27.getInteger("p")); -+ par1World.scheduleBlockUpdateFromLoad(var27.getInteger("x"), var27.getInteger("y"), var27.getInteger("z"), var27.getInteger("i"), var27.getInteger("t"), var27.getInteger("p")); - } - } - } ---- net/minecraft/src/Packet16BlockItemSwitch.java -+++ net/minecraft/src/Packet16BlockItemSwitch.java -@@ -5,36 +5,56 @@ - import java.io.IOException; - - public class Packet16BlockItemSwitch extends Packet { -+ -+ /** The block/item id to be equipped. */ - public int id; - -- public Packet16BlockItemSwitch() { -- } -- -- public Packet16BlockItemSwitch(int var1) { -- this.id = var1; -- } -- -- public void readPacketData(DataInput var1) throws IOException { -- this.id = var1.readShort(); -- } -- -- public void writePacketData(DataOutput var1) throws IOException { -- var1.writeShort(this.id); -- } -- -- public void processPacket(NetHandler var1) { -- var1.handleBlockItemSwitch(this); -- } -- -+ public Packet16BlockItemSwitch() {} -+ -+ public Packet16BlockItemSwitch(int par1) { -+ this.id = par1; -+ } -+ -+ /** -+ * Abstract. Reads the raw packet data from the data stream. -+ */ -+ public void readPacketData(DataInput par1DataInput) throws IOException { -+ this.id = par1DataInput.readShort(); -+ } -+ -+ /** -+ * Abstract. Writes the raw packet data to the data stream. -+ */ -+ public void writePacketData(DataOutput par1DataOutput) throws IOException { -+ par1DataOutput.writeShort(this.id); -+ } -+ -+ /** -+ * Passes this Packet on to the NetHandler for processing. -+ */ -+ public void processPacket(NetHandler par1NetHandler) { -+ par1NetHandler.handleBlockItemSwitch(this); -+ } -+ -+ /** -+ * Abstract. Return the size of the packet (not counting the header). -+ */ - public int getPacketSize() { - return 2; - } - -+ /** -+ * only false for the abstract Packet class, all real packets return true -+ */ - public boolean isRealPacket() { - return true; - } - -- public boolean containsSameEntityIDAs(Packet var1) { -+ /** -+ * eg return packet30entity.entityId == entityId; WARNING : will throw if you compare a packet to a different packet -+ * class -+ */ -+ public boolean containsSameEntityIDAs(Packet par1Packet) { - return true; - } - } ---- net/minecraft/src/BlockGravel.java -+++ net/minecraft/src/BlockGravel.java -@@ -3,15 +3,18 @@ - import java.util.Random; - - public class BlockGravel extends BlockSand { -- public BlockGravel(int var1) { -- super(var1); -+ public BlockGravel(int par1) { -+ super(par1); - } - -- public int idDropped(int var1, Random var2, int var3) { -- if(var3 > 3) { -- var3 = 3; -+ /** -+ * Returns the ID of the items to drop on destruction. -+ */ -+ public int idDropped(int par1, Random par2Random, int par3) { -+ if (par3 > 3) { -+ par3 = 3; - } - -- return var2.nextInt(10 - var3 * 3) == 0 ? Item.flint.itemID : this.blockID; -+ return par2Random.nextInt(10 - par3 * 3) == 0 ? Item.flint.itemID : this.blockID; - } - } ---- net/minecraft/src/ComponentNetherBridgeCorridor2.java -+++ net/minecraft/src/ComponentNetherBridgeCorridor2.java -@@ -6,62 +6,73 @@ - public class ComponentNetherBridgeCorridor2 extends ComponentNetherBridgePiece { - private boolean field_111020_b; - -- public ComponentNetherBridgeCorridor2() { -- } -- -- public ComponentNetherBridgeCorridor2(int var1, Random var2, StructureBoundingBox var3, int var4) { -- super(var1); -- this.coordBaseMode = var4; -- this.boundingBox = var3; -- this.field_111020_b = var2.nextInt(3) == 0; -- } -- -- protected void func_143011_b(NBTTagCompound var1) { -- super.func_143011_b(var1); -- this.field_111020_b = var1.getBoolean("Chest"); -- } -- -- protected void func_143012_a(NBTTagCompound var1) { -- super.func_143012_a(var1); -- var1.setBoolean("Chest", this.field_111020_b); -- } -- -- public void buildComponent(StructureComponent var1, List var2, Random var3) { -- this.getNextComponentZ((ComponentNetherBridgeStartPiece)var1, var2, var3, 0, 1, true); -- } -- -- public static ComponentNetherBridgeCorridor2 createValidComponent(List var0, Random var1, int var2, int var3, int var4, int var5, int var6) { -- StructureBoundingBox var7 = StructureBoundingBox.getComponentToAddBoundingBox(var2, var3, var4, -1, 0, 0, 5, 7, 5, var5); -- return isAboveGround(var7) && StructureComponent.findIntersecting(var0, var7) == null ? new ComponentNetherBridgeCorridor2(var6, var1, var7, var5) : null; -- } -- -- public boolean addComponentParts(World var1, Random var2, StructureBoundingBox var3) { -- this.fillWithBlocks(var1, var3, 0, 0, 0, 4, 1, 4, Block.netherBrick.blockID, Block.netherBrick.blockID, false); -- this.fillWithBlocks(var1, var3, 0, 2, 0, 4, 5, 4, 0, 0, false); -- this.fillWithBlocks(var1, var3, 0, 2, 0, 0, 5, 4, Block.netherBrick.blockID, Block.netherBrick.blockID, false); -- this.fillWithBlocks(var1, var3, 0, 3, 1, 0, 4, 1, Block.netherFence.blockID, Block.netherFence.blockID, false); -- this.fillWithBlocks(var1, var3, 0, 3, 3, 0, 4, 3, Block.netherFence.blockID, Block.netherFence.blockID, false); -- this.fillWithBlocks(var1, var3, 4, 2, 0, 4, 5, 0, Block.netherBrick.blockID, Block.netherBrick.blockID, false); -- this.fillWithBlocks(var1, var3, 1, 2, 4, 4, 5, 4, Block.netherBrick.blockID, Block.netherBrick.blockID, false); -- this.fillWithBlocks(var1, var3, 1, 3, 4, 1, 4, 4, Block.netherFence.blockID, Block.netherBrick.blockID, false); -- this.fillWithBlocks(var1, var3, 3, 3, 4, 3, 4, 4, Block.netherFence.blockID, Block.netherBrick.blockID, false); -+ public ComponentNetherBridgeCorridor2() {} -+ -+ public ComponentNetherBridgeCorridor2(int par1, Random par2Random, StructureBoundingBox par3StructureBoundingBox, int par4) { -+ super(par1); -+ this.coordBaseMode = par4; -+ this.boundingBox = par3StructureBoundingBox; -+ this.field_111020_b = par2Random.nextInt(3) == 0; -+ } -+ -+ protected void func_143011_b(NBTTagCompound par1NBTTagCompound) { -+ super.func_143011_b(par1NBTTagCompound); -+ this.field_111020_b = par1NBTTagCompound.getBoolean("Chest"); -+ } -+ -+ protected void func_143012_a(NBTTagCompound par1NBTTagCompound) { -+ super.func_143012_a(par1NBTTagCompound); -+ par1NBTTagCompound.setBoolean("Chest", this.field_111020_b); -+ } -+ -+ /** -+ * Initiates construction of the Structure Component picked, at the current Location of StructGen -+ */ -+ public void buildComponent(StructureComponent par1StructureComponent, List par2List, Random par3Random) { -+ this.getNextComponentZ((ComponentNetherBridgeStartPiece)par1StructureComponent, par2List, par3Random, 0, 1, true); -+ } -+ -+ /** -+ * Creates and returns a new component piece. Or null if it could not find enough room to place it. -+ */ -+ public static ComponentNetherBridgeCorridor2 createValidComponent(List par0List, Random par1Random, int par2, int par3, int par4, int par5, int par6) { -+ StructureBoundingBox var7 = StructureBoundingBox.getComponentToAddBoundingBox(par2, par3, par4, -1, 0, 0, 5, 7, 5, par5); -+ return isAboveGround(var7) && StructureComponent.findIntersecting(par0List, var7) == null ? new ComponentNetherBridgeCorridor2(par6, par1Random, var7, par5) : null; -+ } -+ -+ /** -+ * second Part of Structure generating, this for example places Spiderwebs, Mob Spawners, it closes Mineshafts at the -+ * end, it adds Fences... -+ */ -+ public boolean addComponentParts(World par1World, Random par2Random, StructureBoundingBox par3StructureBoundingBox) { -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 0, 0, 0, 4, 1, 4, Block.netherBrick.blockID, Block.netherBrick.blockID, false); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 0, 2, 0, 4, 5, 4, 0, 0, false); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 0, 2, 0, 0, 5, 4, Block.netherBrick.blockID, Block.netherBrick.blockID, false); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 0, 3, 1, 0, 4, 1, Block.netherFence.blockID, Block.netherFence.blockID, false); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 0, 3, 3, 0, 4, 3, Block.netherFence.blockID, Block.netherFence.blockID, false); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 4, 2, 0, 4, 5, 0, Block.netherBrick.blockID, Block.netherBrick.blockID, false); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 1, 2, 4, 4, 5, 4, Block.netherBrick.blockID, Block.netherBrick.blockID, false); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 1, 3, 4, 1, 4, 4, Block.netherFence.blockID, Block.netherBrick.blockID, false); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 3, 3, 4, 3, 4, 4, Block.netherFence.blockID, Block.netherBrick.blockID, false); - int var4; - int var5; -- if(this.field_111020_b) { -+ -+ if (this.field_111020_b) { - var4 = this.getYWithOffset(2); - var5 = this.getXWithOffset(1, 3); - int var6 = this.getZWithOffset(1, 3); -- if(var3.isVecInside(var5, var4, var6)) { -+ -+ if (par3StructureBoundingBox.isVecInside(var5, var4, var6)) { - this.field_111020_b = false; -- this.generateStructureChestContents(var1, var3, var2, 1, 2, 3, field_111019_a, 2 + var2.nextInt(4)); -+ this.generateStructureChestContents(par1World, par3StructureBoundingBox, par2Random, 1, 2, 3, field_111019_a, 2 + par2Random.nextInt(4)); - } - } - -- this.fillWithBlocks(var1, var3, 0, 6, 0, 4, 6, 4, Block.netherBrick.blockID, Block.netherBrick.blockID, false); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 0, 6, 0, 4, 6, 4, Block.netherBrick.blockID, Block.netherBrick.blockID, false); - -- for(var4 = 0; var4 <= 4; ++var4) { -- for(var5 = 0; var5 <= 4; ++var5) { -- this.fillCurrentPositionBlocksDownwards(var1, Block.netherBrick.blockID, 0, var4, -1, var5, var3); -+ for (var4 = 0; var4 <= 4; ++var4) { -+ for (var5 = 0; var5 <= 4; ++var5) { -+ this.fillCurrentPositionBlocksDownwards(par1World, Block.netherBrick.blockID, 0, var4, -1, var5, par3StructureBoundingBox); - } - } - ---- net/minecraft/src/EntityMinecartFurnace.java -+++ net/minecraft/src/EntityMinecartFurnace.java -@@ -5,12 +5,12 @@ - public double pushX; - public double pushZ; - -- public EntityMinecartFurnace(World var1) { -- super(var1); -+ public EntityMinecartFurnace(World par1World) { -+ super(par1World); - } - -- public EntityMinecartFurnace(World var1, double var2, double var4, double var6) { -- super(var1, var2, var4, var6); -+ public EntityMinecartFurnace(World par1World, double par2, double par4, double par6) { -+ super(par1World, par2, par4, par6); - } - - public int getMinecartType() { -@@ -22,39 +22,45 @@ - this.dataWatcher.addObject(16, new Byte((byte)0)); - } - -+ /** -+ * Called to update the entity's position/logic. -+ */ - public void onUpdate() { - super.onUpdate(); -- if(this.fuel > 0) { -+ -+ if (this.fuel > 0) { - --this.fuel; - } - -- if(this.fuel <= 0) { -+ if (this.fuel <= 0) { - this.pushX = this.pushZ = 0.0D; - } - - this.setMinecartPowered(this.fuel > 0); -- if(this.isMinecartPowered() && this.ab.nextInt(4) == 0) { -+ -+ if (this.isMinecartPowered() && this.rand.nextInt(4) == 0) { - this.worldObj.spawnParticle("largesmoke", this.posX, this.posY + 0.8D, this.posZ, 0.0D, 0.0D, 0.0D); - } -- - } - -- public void killMinecart(DamageSource var1) { -- super.killMinecart(var1); -- if(!var1.isExplosion()) { -+ public void killMinecart(DamageSource par1DamageSource) { -+ super.killMinecart(par1DamageSource); -+ -+ if (!par1DamageSource.isExplosion()) { - this.entityDropItem(new ItemStack(Block.furnaceIdle, 1), 0.0F); - } -- - } - -- protected void updateOnTrack(int var1, int var2, int var3, double var4, double var6, int var8, int var9) { -- super.updateOnTrack(var1, var2, var3, var4, var6, var8, var9); -+ protected void updateOnTrack(int par1, int par2, int par3, double par4, double par6, int par8, int par9) { -+ super.updateOnTrack(par1, par2, par3, par4, par6, par8, par9); - double var10 = this.pushX * this.pushX + this.pushZ * this.pushZ; -- if(var10 > 1.0E-4D && this.motionX * this.motionX + this.motionZ * this.motionZ > 0.001D) { -+ -+ if (var10 > 1.0E-4D && this.motionX * this.motionX + this.motionZ * this.motionZ > 0.001D) { - var10 = (double)MathHelper.sqrt_double(var10); - this.pushX /= var10; - this.pushZ /= var10; -- if(this.pushX * this.motionX + this.pushZ * this.motionZ < 0.0D) { -+ -+ if (this.pushX * this.motionX + this.pushZ * this.motionZ < 0.0D) { - this.pushX = 0.0D; - this.pushZ = 0.0D; - } else { -@@ -62,70 +68,79 @@ - this.pushZ = this.motionZ; - } - } -- - } - - protected void applyDrag() { - double var1 = this.pushX * this.pushX + this.pushZ * this.pushZ; -- if(var1 > 1.0E-4D) { -+ -+ if (var1 > 1.0E-4D) { - var1 = (double)MathHelper.sqrt_double(var1); - this.pushX /= var1; - this.pushZ /= var1; - double var3 = 0.05D; -- this.motionX *= (double)0.8F; -+ this.motionX *= 0.800000011920929D; - this.motionY *= 0.0D; -- this.motionZ *= (double)0.8F; -+ this.motionZ *= 0.800000011920929D; - this.motionX += this.pushX * var3; - this.motionZ += this.pushZ * var3; - } else { -- this.motionX *= (double)0.98F; -+ this.motionX *= 0.9800000190734863D; - this.motionY *= 0.0D; -- this.motionZ *= (double)0.98F; -+ this.motionZ *= 0.9800000190734863D; - } - - super.applyDrag(); - } - -- public boolean interactFirst(EntityPlayer var1) { -- ItemStack var2 = var1.inventory.getCurrentItem(); -- if(var2 != null && var2.itemID == Item.coal.itemID) { -- if(!var1.capabilities.isCreativeMode && --var2.stackSize == 0) { -- var1.inventory.setInventorySlotContents(var1.inventory.currentItem, (ItemStack)null); -+ /** -+ * First layer of player interaction -+ */ -+ public boolean interactFirst(EntityPlayer par1EntityPlayer) { -+ ItemStack var2 = par1EntityPlayer.inventory.getCurrentItem(); -+ -+ if (var2 != null && var2.itemID == Item.coal.itemID) { -+ if (!par1EntityPlayer.capabilities.isCreativeMode && --var2.stackSize == 0) { -+ par1EntityPlayer.inventory.setInventorySlotContents(par1EntityPlayer.inventory.currentItem, (ItemStack)null); - } - - this.fuel += 3600; - } - -- this.pushX = this.posX - var1.posX; -- this.pushZ = this.posZ - var1.posZ; -+ this.pushX = this.posX - par1EntityPlayer.posX; -+ this.pushZ = this.posZ - par1EntityPlayer.posZ; - return true; - } - -- protected void writeEntityToNBT(NBTTagCompound var1) { -- super.writeEntityToNBT(var1); -- var1.setDouble("PushX", this.pushX); -- var1.setDouble("PushZ", this.pushZ); -- var1.setShort("Fuel", (short)this.fuel); -+ /** -+ * (abstract) Protected helper method to write subclass entity data to NBT. -+ */ -+ protected void writeEntityToNBT(NBTTagCompound par1NBTTagCompound) { -+ super.writeEntityToNBT(par1NBTTagCompound); -+ par1NBTTagCompound.setDouble("PushX", this.pushX); -+ par1NBTTagCompound.setDouble("PushZ", this.pushZ); -+ par1NBTTagCompound.setShort("Fuel", (short)this.fuel); - } - -- protected void readEntityFromNBT(NBTTagCompound var1) { -- super.readEntityFromNBT(var1); -- this.pushX = var1.getDouble("PushX"); -- this.pushZ = var1.getDouble("PushZ"); -- this.fuel = var1.getShort("Fuel"); -+ /** -+ * (abstract) Protected helper method to read subclass entity data from NBT. -+ */ -+ protected void readEntityFromNBT(NBTTagCompound par1NBTTagCompound) { -+ super.readEntityFromNBT(par1NBTTagCompound); -+ this.pushX = par1NBTTagCompound.getDouble("PushX"); -+ this.pushZ = par1NBTTagCompound.getDouble("PushZ"); -+ this.fuel = par1NBTTagCompound.getShort("Fuel"); - } - - protected boolean isMinecartPowered() { - return (this.dataWatcher.getWatchableObjectByte(16) & 1) != 0; - } - -- protected void setMinecartPowered(boolean var1) { -- if(var1) { -+ protected void setMinecartPowered(boolean par1) { -+ if (par1) { - this.dataWatcher.updateObject(16, Byte.valueOf((byte)(this.dataWatcher.getWatchableObjectByte(16) | 1))); - } else { - this.dataWatcher.updateObject(16, Byte.valueOf((byte)(this.dataWatcher.getWatchableObjectByte(16) & -2))); - } -- - } - - public Block getDefaultDisplayTile() { ---- net/minecraft/src/ThreadStatSyncherReceive.java -+++ net/minecraft/src/ThreadStatSyncherReceive.java -@@ -3,15 +3,15 @@ - class ThreadStatSyncherReceive extends Thread { - final StatsSyncher syncher; - -- ThreadStatSyncherReceive(StatsSyncher var1) { -- this.syncher = var1; -+ ThreadStatSyncherReceive(StatsSyncher par1StatsSyncher) { -+ this.syncher = par1StatsSyncher; - } - - public void run() { - try { -- if(StatsSyncher.func_77419_a(this.syncher) != null) { -+ if (StatsSyncher.func_77419_a(this.syncher) != null) { - StatsSyncher.func_77414_a(this.syncher, StatsSyncher.func_77419_a(this.syncher), StatsSyncher.func_77408_b(this.syncher), StatsSyncher.func_77407_c(this.syncher), StatsSyncher.func_77411_d(this.syncher)); -- } else if(StatsSyncher.func_77408_b(this.syncher).exists()) { -+ } else if (StatsSyncher.func_77408_b(this.syncher).exists()) { - StatsSyncher.func_77416_a(this.syncher, StatsSyncher.func_77410_a(this.syncher, StatsSyncher.func_77408_b(this.syncher), StatsSyncher.func_77407_c(this.syncher), StatsSyncher.func_77411_d(this.syncher))); - } - } catch (Exception var5) { -@@ -19,6 +19,5 @@ - } finally { - StatsSyncher.setBusy(this.syncher, false); - } -- - } - } ---- /dev/null -+++ org/spoutcraft/client/gui/settings/controls/DisplayPlayerNames3rdPersonButton.java -@@ -1,0 +1,38 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.client.gui.settings.controls; -+ -+import net.minecraft.src.Minecraft; -+ -+import org.spoutcraft.client.config.Configuration; -+ -+public class DisplayPlayerNames3rdPersonButton extends AutomatedCheckBox { -+ public DisplayPlayerNames3rdPersonButton() { -+ super("Show Player Name in 3rd Person"); -+ setChecked(Configuration.isDisplayPlayerNames3rdPerson()); -+ setTooltip("Displays the players name when in 3rd person view."); -+ } -+ -+ @Override -+ public void onButtonClick() { -+ Configuration.setDisplayPlayerNames3rdPerson(!Configuration.isDisplayPlayerNames3rdPerson()); -+ Configuration.write(); -+ } -+} ---- /dev/null -+++ org/spoutcraft/client/player/accessories/PacketAccessory.java -@@ -1,0 +1,85 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.client.player.accessories; -+ -+import java.io.IOException; -+ -+import org.spoutcraft.api.io.SpoutInputStream; -+import org.spoutcraft.api.io.SpoutOutputStream; -+import org.spoutcraft.client.packet.PacketType; -+import org.spoutcraft.client.packet.SpoutPacket; -+ -+public class PacketAccessory implements SpoutPacket{ -+ private AccessoryType type; -+ private String url, who; -+ private boolean add; -+ -+ public PacketAccessory() { -+ } -+ -+ public PacketAccessory(AccessoryType type, String url) { -+ this(type, url, true); -+ } -+ -+ public PacketAccessory(AccessoryType type, String url, boolean add) { -+ this.type = type; -+ this.url = url; -+ this.add = add; -+ } -+ -+ @Override -+ public void readData(SpoutInputStream input) throws IOException { -+ who = input.readString(); -+ type = AccessoryType.get(input.readInt()); -+ url = input.readString(); -+ add = input.readBoolean(); -+ } -+ -+ @Override -+ public void writeData(SpoutOutputStream output) throws IOException { -+ output.writeString(who); -+ output.writeInt(type.getId()); -+ output.writeString(url); -+ output.writeBoolean(add); -+ } -+ -+ @Override -+ public void run(int playerId) { -+ if (add) { -+ AccessoryHandler.addAccessoryType(who, type, url); -+ } else { -+ AccessoryHandler.removeAccessoryType(who, type); -+ } -+ } -+ -+ @Override -+ public void failure(int playerId) { -+ } -+ -+ @Override -+ public PacketType getPacketType() { -+ return PacketType.PacketAccessory; -+ } -+ -+ @Override -+ public int getVersion() { -+ return 2; -+ } -+} ---- net/minecraft/src/GuiScreenSubscription.java -+++ net/minecraft/src/GuiScreenSubscription.java -@@ -12,71 +12,89 @@ - private final int field_98066_c = 0; - private final int field_98064_d = 1; - private int field_98068_n; -- private String p; -- -- public GuiScreenSubscription(GuiScreen var1, McoServer var2) { -- this.field_98067_a = var1; -- this.field_98065_b = var2; -- } -- -- public void updateScreen() { -- } -- -+ private String field_98069_o; -+ -+ public GuiScreenSubscription(GuiScreen par1GuiScreen, McoServer par2McoServer) { -+ this.field_98067_a = par1GuiScreen; -+ this.field_98065_b = par2McoServer; -+ } -+ -+ /** -+ * Called from the main game loop to update the screen. -+ */ -+ public void updateScreen() {} -+ -+ /** -+ * Adds the buttons (and other controls) to the screen in question. -+ */ - public void initGui() { - this.func_98063_a(this.field_98065_b.field_96408_a); - Keyboard.enableRepeatEvents(true); -- this.i.add(new GuiButton(0, this.width / 2 - 100, this.height / 4 + 120 + 12, I18n.getString("gui.cancel"))); -+ this.buttonList.add(new GuiButton(0, this.width / 2 - 100, this.height / 4 + 120 + 12, I18n.getString("gui.cancel"))); - } - -- private void func_98063_a(long var1) { -+ private void func_98063_a(long par1) { - McoClient var3 = new McoClient(this.mc.getSession()); - - try { -- ValueObjectSubscription var4 = var3.func_98177_f(var1); -+ ValueObjectSubscription var4 = var3.func_98177_f(par1); - this.field_98068_n = var4.field_98170_b; -- this.p = this.func_98062_b(var4.field_98171_a); -+ this.field_98069_o = this.func_98062_b(var4.field_98171_a); - } catch (ExceptionMcoService var5) { - Minecraft.getMinecraft().getLogAgent().logSevere(var5.toString()); - } catch (IOException var6) { - Minecraft.getMinecraft().getLogAgent().logWarning("Realms: could not parse response"); - } -- - } - -- private String func_98062_b(long var1) { -+ private String func_98062_b(long par1) { - GregorianCalendar var3 = new GregorianCalendar(TimeZone.getDefault()); -- var3.setTimeInMillis(var1); -+ var3.setTimeInMillis(par1); - return SimpleDateFormat.getDateTimeInstance().format(var3.getTime()); - } - -+ /** -+ * Called when the screen is unloaded. Used to disable keyboard repeat events -+ */ - public void onGuiClosed() { - Keyboard.enableRepeatEvents(false); - } - -- protected void actionPerformed(GuiButton var1) { -- if(var1.enabled) { -- if(var1.id == 0) { -+ /** -+ * Fired when a control is clicked. This is the equivalent of ActionListener.actionPerformed(ActionEvent e). -+ */ -+ protected void actionPerformed(GuiButton par1GuiButton) { -+ if (par1GuiButton.enabled) { -+ if (par1GuiButton.id == 0) { - this.mc.displayGuiScreen(this.field_98067_a); -- } else if(var1.id == 1) { -+ } else if (par1GuiButton.id == 1) { -+ ; - } -- - } - } - -- protected void keyTyped(char var1, int var2) { -- } -- -- protected void mouseClicked(int var1, int var2, int var3) { -- super.mouseClicked(var1, var2, var3); -- } -- -- public void drawScreen(int var1, int var2, float var3) { -+ /** -+ * Fired when a key is typed. This is the equivalent of KeyListener.keyTyped(KeyEvent e). -+ */ -+ protected void keyTyped(char par1, int par2) {} -+ -+ /** -+ * Called when the mouse is clicked. -+ */ -+ protected void mouseClicked(int par1, int par2, int par3) { -+ super.mouseClicked(par1, par2, par3); -+ } -+ -+ /** -+ * Draws the screen and all the components in it. -+ */ -+ public void drawScreen(int par1, int par2, float par3) { - this.drawDefaultBackground(); - this.drawCenteredString(this.fontRenderer, I18n.getString("mco.configure.world.subscription.title"), this.width / 2, 17, 16777215); - this.drawString(this.fontRenderer, I18n.getString("mco.configure.world.subscription.start"), this.width / 2 - 100, 53, 10526880); -- this.drawString(this.fontRenderer, this.p, this.width / 2 - 100, 66, 16777215); -+ this.drawString(this.fontRenderer, this.field_98069_o, this.width / 2 - 100, 66, 16777215); - this.drawString(this.fontRenderer, I18n.getString("mco.configure.world.subscription.daysleft"), this.width / 2 - 100, 85, 10526880); - this.drawString(this.fontRenderer, String.valueOf(this.field_98068_n), this.width / 2 - 100, 98, 16777215); -- super.drawScreen(var1, var2, var3); -+ super.drawScreen(par1, par2, par3); - } - } ---- net/minecraft/src/ModelSkeleton.java -+++ net/minecraft/src/ModelSkeleton.java -@@ -5,30 +5,39 @@ - this(0.0F); - } - -- public ModelSkeleton(float var1) { -- super(var1, 0.0F, 64, 32); -+ public ModelSkeleton(float par1) { -+ super(par1, 0.0F, 64, 32); - this.bipedRightArm = new ModelRenderer(this, 40, 16); -- this.bipedRightArm.addBox(-1.0F, -2.0F, -1.0F, 2, 12, 2, var1); -+ this.bipedRightArm.addBox(-1.0F, -2.0F, -1.0F, 2, 12, 2, par1); - this.bipedRightArm.setRotationPoint(-5.0F, 2.0F, 0.0F); - this.bipedLeftArm = new ModelRenderer(this, 40, 16); - this.bipedLeftArm.mirror = true; -- this.bipedLeftArm.addBox(-1.0F, -2.0F, -1.0F, 2, 12, 2, var1); -+ this.bipedLeftArm.addBox(-1.0F, -2.0F, -1.0F, 2, 12, 2, par1); - this.bipedLeftArm.setRotationPoint(5.0F, 2.0F, 0.0F); - this.bipedRightLeg = new ModelRenderer(this, 0, 16); -- this.bipedRightLeg.addBox(-1.0F, 0.0F, -1.0F, 2, 12, 2, var1); -+ this.bipedRightLeg.addBox(-1.0F, 0.0F, -1.0F, 2, 12, 2, par1); - this.bipedRightLeg.setRotationPoint(-2.0F, 12.0F, 0.0F); - this.bipedLeftLeg = new ModelRenderer(this, 0, 16); - this.bipedLeftLeg.mirror = true; -- this.bipedLeftLeg.addBox(-1.0F, 0.0F, -1.0F, 2, 12, 2, var1); -+ this.bipedLeftLeg.addBox(-1.0F, 0.0F, -1.0F, 2, 12, 2, par1); - this.bipedLeftLeg.setRotationPoint(2.0F, 12.0F, 0.0F); - } - -- public void setLivingAnimations(EntityLivingBase var1, float var2, float var3, float var4) { -- this.aimedBow = ((EntitySkeleton)var1).getSkeletonType() == 1; -- super.setLivingAnimations(var1, var2, var3, var4); -+ /** -+ * Used for easily adding entity-dependent animations. The second and third float params here are the same second and -+ * third as in the setRotationAngles method. -+ */ -+ public void setLivingAnimations(EntityLivingBase par1EntityLivingBase, float par2, float par3, float par4) { -+ this.aimedBow = ((EntitySkeleton)par1EntityLivingBase).getSkeletonType() == 1; -+ super.setLivingAnimations(par1EntityLivingBase, par2, par3, par4); - } - -- public void setRotationAngles(float var1, float var2, float var3, float var4, float var5, float var6, Entity var7) { -- super.setRotationAngles(var1, var2, var3, var4, var5, var6, var7); -+ /** -+ * Sets the model's various rotation angles. For bipeds, par1 and par2 are used for animating the movement of arms and -+ * legs, where par1 represents the time(so that arms and legs swing back and forth) and par2 represents how "far" arms -+ * and legs can swing at most. -+ */ -+ public void setRotationAngles(float par1, float par2, float par3, float par4, float par5, float par6, Entity par7Entity) { -+ super.setRotationAngles(par1, par2, par3, par4, par5, par6, par7Entity); - } - } ---- net/minecraft/src/ComponentVillageHouse4_Garden.java -+++ net/minecraft/src/ComponentVillageHouse4_Garden.java -@@ -6,112 +6,119 @@ - public class ComponentVillageHouse4_Garden extends ComponentVillage { - private boolean isRoofAccessible; - -- public ComponentVillageHouse4_Garden() { -- } -- -- public ComponentVillageHouse4_Garden(ComponentVillageStartPiece var1, int var2, Random var3, StructureBoundingBox var4, int var5) { -- super(var1, var2); -- this.coordBaseMode = var5; -- this.boundingBox = var4; -- this.isRoofAccessible = var3.nextBoolean(); -- } -- -- protected void func_143012_a(NBTTagCompound var1) { -- super.func_143012_a(var1); -- var1.setBoolean("Terrace", this.isRoofAccessible); -- } -- -- protected void func_143011_b(NBTTagCompound var1) { -- super.func_143011_b(var1); -- this.isRoofAccessible = var1.getBoolean("Terrace"); -- } -- -- public static ComponentVillageHouse4_Garden func_74912_a(ComponentVillageStartPiece var0, List var1, Random var2, int var3, int var4, int var5, int var6, int var7) { -- StructureBoundingBox var8 = StructureBoundingBox.getComponentToAddBoundingBox(var3, var4, var5, 0, 0, 0, 5, 6, 5, var6); -- return StructureComponent.findIntersecting(var1, var8) != null ? null : new ComponentVillageHouse4_Garden(var0, var7, var2, var8, var6); -- } -- -- public boolean addComponentParts(World var1, Random var2, StructureBoundingBox var3) { -- if(this.field_143015_k < 0) { -- this.field_143015_k = this.getAverageGroundLevel(var1, var3); -- if(this.field_143015_k < 0) { -+ public ComponentVillageHouse4_Garden() {} -+ -+ public ComponentVillageHouse4_Garden(ComponentVillageStartPiece par1ComponentVillageStartPiece, int par2, Random par3Random, StructureBoundingBox par4StructureBoundingBox, int par5) { -+ super(par1ComponentVillageStartPiece, par2); -+ this.coordBaseMode = par5; -+ this.boundingBox = par4StructureBoundingBox; -+ this.isRoofAccessible = par3Random.nextBoolean(); -+ } -+ -+ protected void func_143012_a(NBTTagCompound par1NBTTagCompound) { -+ super.func_143012_a(par1NBTTagCompound); -+ par1NBTTagCompound.setBoolean("Terrace", this.isRoofAccessible); -+ } -+ -+ protected void func_143011_b(NBTTagCompound par1NBTTagCompound) { -+ super.func_143011_b(par1NBTTagCompound); -+ this.isRoofAccessible = par1NBTTagCompound.getBoolean("Terrace"); -+ } -+ -+ public static ComponentVillageHouse4_Garden func_74912_a(ComponentVillageStartPiece par0ComponentVillageStartPiece, List par1List, Random par2Random, int par3, int par4, int par5, int par6, int par7) { -+ StructureBoundingBox var8 = StructureBoundingBox.getComponentToAddBoundingBox(par3, par4, par5, 0, 0, 0, 5, 6, 5, par6); -+ return StructureComponent.findIntersecting(par1List, var8) != null ? null : new ComponentVillageHouse4_Garden(par0ComponentVillageStartPiece, par7, par2Random, var8, par6); -+ } -+ -+ /** -+ * second Part of Structure generating, this for example places Spiderwebs, Mob Spawners, it closes Mineshafts at the -+ * end, it adds Fences... -+ */ -+ public boolean addComponentParts(World par1World, Random par2Random, StructureBoundingBox par3StructureBoundingBox) { -+ if (this.field_143015_k < 0) { -+ this.field_143015_k = this.getAverageGroundLevel(par1World, par3StructureBoundingBox); -+ -+ if (this.field_143015_k < 0) { - return true; - } - - this.boundingBox.offset(0, this.field_143015_k - this.boundingBox.maxY + 6 - 1, 0); - } - -- this.fillWithBlocks(var1, var3, 0, 0, 0, 4, 0, 4, Block.cobblestone.blockID, Block.cobblestone.blockID, false); -- this.fillWithBlocks(var1, var3, 0, 4, 0, 4, 4, 4, Block.wood.blockID, Block.wood.blockID, false); -- this.fillWithBlocks(var1, var3, 1, 4, 1, 3, 4, 3, Block.planks.blockID, Block.planks.blockID, false); -- this.placeBlockAtCurrentPosition(var1, Block.cobblestone.blockID, 0, 0, 1, 0, var3); -- this.placeBlockAtCurrentPosition(var1, Block.cobblestone.blockID, 0, 0, 2, 0, var3); -- this.placeBlockAtCurrentPosition(var1, Block.cobblestone.blockID, 0, 0, 3, 0, var3); -- this.placeBlockAtCurrentPosition(var1, Block.cobblestone.blockID, 0, 4, 1, 0, var3); -- this.placeBlockAtCurrentPosition(var1, Block.cobblestone.blockID, 0, 4, 2, 0, var3); -- this.placeBlockAtCurrentPosition(var1, Block.cobblestone.blockID, 0, 4, 3, 0, var3); -- this.placeBlockAtCurrentPosition(var1, Block.cobblestone.blockID, 0, 0, 1, 4, var3); -- this.placeBlockAtCurrentPosition(var1, Block.cobblestone.blockID, 0, 0, 2, 4, var3); -- this.placeBlockAtCurrentPosition(var1, Block.cobblestone.blockID, 0, 0, 3, 4, var3); -- this.placeBlockAtCurrentPosition(var1, Block.cobblestone.blockID, 0, 4, 1, 4, var3); -- this.placeBlockAtCurrentPosition(var1, Block.cobblestone.blockID, 0, 4, 2, 4, var3); -- this.placeBlockAtCurrentPosition(var1, Block.cobblestone.blockID, 0, 4, 3, 4, var3); -- this.fillWithBlocks(var1, var3, 0, 1, 1, 0, 3, 3, Block.planks.blockID, Block.planks.blockID, false); -- this.fillWithBlocks(var1, var3, 4, 1, 1, 4, 3, 3, Block.planks.blockID, Block.planks.blockID, false); -- this.fillWithBlocks(var1, var3, 1, 1, 4, 3, 3, 4, Block.planks.blockID, Block.planks.blockID, false); -- this.placeBlockAtCurrentPosition(var1, Block.thinGlass.blockID, 0, 0, 2, 2, var3); -- this.placeBlockAtCurrentPosition(var1, Block.thinGlass.blockID, 0, 2, 2, 4, var3); -- this.placeBlockAtCurrentPosition(var1, Block.thinGlass.blockID, 0, 4, 2, 2, var3); -- this.placeBlockAtCurrentPosition(var1, Block.planks.blockID, 0, 1, 1, 0, var3); -- this.placeBlockAtCurrentPosition(var1, Block.planks.blockID, 0, 1, 2, 0, var3); -- this.placeBlockAtCurrentPosition(var1, Block.planks.blockID, 0, 1, 3, 0, var3); -- this.placeBlockAtCurrentPosition(var1, Block.planks.blockID, 0, 2, 3, 0, var3); -- this.placeBlockAtCurrentPosition(var1, Block.planks.blockID, 0, 3, 3, 0, var3); -- this.placeBlockAtCurrentPosition(var1, Block.planks.blockID, 0, 3, 2, 0, var3); -- this.placeBlockAtCurrentPosition(var1, Block.planks.blockID, 0, 3, 1, 0, var3); -- if(this.getBlockIdAtCurrentPosition(var1, 2, 0, -1, var3) == 0 && this.getBlockIdAtCurrentPosition(var1, 2, -1, -1, var3) != 0) { -- this.placeBlockAtCurrentPosition(var1, Block.stairsCobblestone.blockID, this.getMetadataWithOffset(Block.stairsCobblestone.blockID, 3), 2, 0, -1, var3); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 0, 0, 0, 4, 0, 4, Block.cobblestone.blockID, Block.cobblestone.blockID, false); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 0, 4, 0, 4, 4, 4, Block.wood.blockID, Block.wood.blockID, false); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 1, 4, 1, 3, 4, 3, Block.planks.blockID, Block.planks.blockID, false); -+ this.placeBlockAtCurrentPosition(par1World, Block.cobblestone.blockID, 0, 0, 1, 0, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.cobblestone.blockID, 0, 0, 2, 0, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.cobblestone.blockID, 0, 0, 3, 0, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.cobblestone.blockID, 0, 4, 1, 0, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.cobblestone.blockID, 0, 4, 2, 0, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.cobblestone.blockID, 0, 4, 3, 0, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.cobblestone.blockID, 0, 0, 1, 4, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.cobblestone.blockID, 0, 0, 2, 4, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.cobblestone.blockID, 0, 0, 3, 4, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.cobblestone.blockID, 0, 4, 1, 4, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.cobblestone.blockID, 0, 4, 2, 4, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.cobblestone.blockID, 0, 4, 3, 4, par3StructureBoundingBox); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 0, 1, 1, 0, 3, 3, Block.planks.blockID, Block.planks.blockID, false); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 4, 1, 1, 4, 3, 3, Block.planks.blockID, Block.planks.blockID, false); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 1, 1, 4, 3, 3, 4, Block.planks.blockID, Block.planks.blockID, false); -+ this.placeBlockAtCurrentPosition(par1World, Block.thinGlass.blockID, 0, 0, 2, 2, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.thinGlass.blockID, 0, 2, 2, 4, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.thinGlass.blockID, 0, 4, 2, 2, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.planks.blockID, 0, 1, 1, 0, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.planks.blockID, 0, 1, 2, 0, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.planks.blockID, 0, 1, 3, 0, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.planks.blockID, 0, 2, 3, 0, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.planks.blockID, 0, 3, 3, 0, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.planks.blockID, 0, 3, 2, 0, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.planks.blockID, 0, 3, 1, 0, par3StructureBoundingBox); -+ -+ if (this.getBlockIdAtCurrentPosition(par1World, 2, 0, -1, par3StructureBoundingBox) == 0 && this.getBlockIdAtCurrentPosition(par1World, 2, -1, -1, par3StructureBoundingBox) != 0) { -+ this.placeBlockAtCurrentPosition(par1World, Block.stairsCobblestone.blockID, this.getMetadataWithOffset(Block.stairsCobblestone.blockID, 3), 2, 0, -1, par3StructureBoundingBox); - } - -- this.fillWithBlocks(var1, var3, 1, 1, 1, 3, 3, 3, 0, 0, false); -- if(this.isRoofAccessible) { -- this.placeBlockAtCurrentPosition(var1, Block.fence.blockID, 0, 0, 5, 0, var3); -- this.placeBlockAtCurrentPosition(var1, Block.fence.blockID, 0, 1, 5, 0, var3); -- this.placeBlockAtCurrentPosition(var1, Block.fence.blockID, 0, 2, 5, 0, var3); -- this.placeBlockAtCurrentPosition(var1, Block.fence.blockID, 0, 3, 5, 0, var3); -- this.placeBlockAtCurrentPosition(var1, Block.fence.blockID, 0, 4, 5, 0, var3); -- this.placeBlockAtCurrentPosition(var1, Block.fence.blockID, 0, 0, 5, 4, var3); -- this.placeBlockAtCurrentPosition(var1, Block.fence.blockID, 0, 1, 5, 4, var3); -- this.placeBlockAtCurrentPosition(var1, Block.fence.blockID, 0, 2, 5, 4, var3); -- this.placeBlockAtCurrentPosition(var1, Block.fence.blockID, 0, 3, 5, 4, var3); -- this.placeBlockAtCurrentPosition(var1, Block.fence.blockID, 0, 4, 5, 4, var3); -- this.placeBlockAtCurrentPosition(var1, Block.fence.blockID, 0, 4, 5, 1, var3); -- this.placeBlockAtCurrentPosition(var1, Block.fence.blockID, 0, 4, 5, 2, var3); -- this.placeBlockAtCurrentPosition(var1, Block.fence.blockID, 0, 4, 5, 3, var3); -- this.placeBlockAtCurrentPosition(var1, Block.fence.blockID, 0, 0, 5, 1, var3); -- this.placeBlockAtCurrentPosition(var1, Block.fence.blockID, 0, 0, 5, 2, var3); -- this.placeBlockAtCurrentPosition(var1, Block.fence.blockID, 0, 0, 5, 3, var3); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 1, 1, 1, 3, 3, 3, 0, 0, false); -+ -+ if (this.isRoofAccessible) { -+ this.placeBlockAtCurrentPosition(par1World, Block.fence.blockID, 0, 0, 5, 0, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.fence.blockID, 0, 1, 5, 0, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.fence.blockID, 0, 2, 5, 0, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.fence.blockID, 0, 3, 5, 0, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.fence.blockID, 0, 4, 5, 0, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.fence.blockID, 0, 0, 5, 4, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.fence.blockID, 0, 1, 5, 4, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.fence.blockID, 0, 2, 5, 4, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.fence.blockID, 0, 3, 5, 4, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.fence.blockID, 0, 4, 5, 4, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.fence.blockID, 0, 4, 5, 1, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.fence.blockID, 0, 4, 5, 2, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.fence.blockID, 0, 4, 5, 3, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.fence.blockID, 0, 0, 5, 1, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.fence.blockID, 0, 0, 5, 2, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.fence.blockID, 0, 0, 5, 3, par3StructureBoundingBox); - } - - int var4; -- if(this.isRoofAccessible) { -+ -+ if (this.isRoofAccessible) { - var4 = this.getMetadataWithOffset(Block.ladder.blockID, 3); -- this.placeBlockAtCurrentPosition(var1, Block.ladder.blockID, var4, 3, 1, 3, var3); -- this.placeBlockAtCurrentPosition(var1, Block.ladder.blockID, var4, 3, 2, 3, var3); -- this.placeBlockAtCurrentPosition(var1, Block.ladder.blockID, var4, 3, 3, 3, var3); -- this.placeBlockAtCurrentPosition(var1, Block.ladder.blockID, var4, 3, 4, 3, var3); -+ this.placeBlockAtCurrentPosition(par1World, Block.ladder.blockID, var4, 3, 1, 3, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.ladder.blockID, var4, 3, 2, 3, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.ladder.blockID, var4, 3, 3, 3, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.ladder.blockID, var4, 3, 4, 3, par3StructureBoundingBox); - } - -- this.placeBlockAtCurrentPosition(var1, Block.torchWood.blockID, 0, 2, 3, 1, var3); -+ this.placeBlockAtCurrentPosition(par1World, Block.torchWood.blockID, 0, 2, 3, 1, par3StructureBoundingBox); - -- for(var4 = 0; var4 < 5; ++var4) { -- for(int var5 = 0; var5 < 5; ++var5) { -- this.clearCurrentPositionBlocksUpwards(var1, var5, 6, var4, var3); -- this.fillCurrentPositionBlocksDownwards(var1, Block.cobblestone.blockID, 0, var5, -1, var4, var3); -+ for (var4 = 0; var4 < 5; ++var4) { -+ for (int var5 = 0; var5 < 5; ++var5) { -+ this.clearCurrentPositionBlocksUpwards(par1World, var5, 6, var4, par3StructureBoundingBox); -+ this.fillCurrentPositionBlocksDownwards(par1World, Block.cobblestone.blockID, 0, var5, -1, var4, par3StructureBoundingBox); - } - } - -- this.spawnVillagers(var1, var3, 1, 1, 2, 1); -+ this.spawnVillagers(par1World, par3StructureBoundingBox, 1, 1, 2, 1); - return true; - } - } ---- /dev/null -+++ com/prupe/mcpatcher/mob/MobRuleList.java -@@ -1,0 +1,153 @@ -+package com.prupe.mcpatcher.mob; -+ -+import com.prupe.mcpatcher.MCLogger; -+import com.prupe.mcpatcher.TexturePackAPI; -+import com.prupe.mcpatcher.mob.MobRuleList$MobRuleEntry; -+import java.lang.reflect.Method; -+import java.util.ArrayList; -+import java.util.BitSet; -+import java.util.HashMap; -+import java.util.Iterator; -+import java.util.List; -+import java.util.Map; -+import java.util.Properties; -+import net.minecraft.src.ResourceLocation; -+ -+class MobRuleList { -+ private static final MCLogger logger = MCLogger.getLogger("Random Mobs"); -+ public static final String ALTERNATIVES_REGEX = "_(eyes|overlay|tame|angry|collar|fur|invulnerable|shooting)\\.properties$"; -+ private static final Map allRules = new HashMap(); -+ private final ResourceLocation baseSkin; -+ private final List allSkins; -+ private final int skinCount; -+ private final List entries; -+ private static Method parseBiomeList; -+ static Method getBiomeIDAt; -+ -+ private MobRuleList(ResourceLocation baseSkin) { -+ this.baseSkin = baseSkin; -+ String newPath = baseSkin.getResourcePath().replaceFirst("^textures/entity/", "mcpatcher/mob/"); -+ ResourceLocation newSkin = new ResourceLocation(baseSkin.getResourceDomain(), newPath); -+ this.allSkins = new ArrayList(); -+ this.allSkins.add(baseSkin); -+ int filename = 2; -+ -+ while (true) { -+ ResourceLocation altFilename = TexturePackAPI.transformResourceLocation(newSkin, ".png", filename + ".png"); -+ -+ if (!TexturePackAPI.hasResource(altFilename)) { -+ this.skinCount = this.allSkins.size(); -+ -+ if (this.skinCount <= 1) { -+ this.entries = null; -+ return; -+ } else { -+ logger.fine("found %d variations for %s", new Object[] {Integer.valueOf(this.skinCount), baseSkin}); -+ ResourceLocation var10 = TexturePackAPI.transformResourceLocation(newSkin, ".png", ".properties"); -+ altFilename = new ResourceLocation(newSkin.getResourceDomain(), var10.getResourcePath().replaceFirst("_(eyes|overlay|tame|angry|collar|fur|invulnerable|shooting)\\.properties$", ".properties")); -+ Properties properties = TexturePackAPI.getProperties(var10); -+ -+ if (properties == null && !var10.equals(altFilename)) { -+ properties = TexturePackAPI.getProperties(altFilename); -+ -+ if (properties != null) { -+ logger.fine("using %s for %s", new Object[] {altFilename, baseSkin}); -+ } -+ } -+ -+ ArrayList tmpEntries = new ArrayList(); -+ -+ if (properties != null) { -+ int i = 0; -+ -+ while (true) { -+ MobRuleList$MobRuleEntry entry = MobRuleList$MobRuleEntry.load(properties, i, this.skinCount); -+ -+ if (entry == null) { -+ if (i > 0) { -+ break; -+ } -+ } else { -+ logger.fine(" %s", new Object[] {entry.toString()}); -+ tmpEntries.add(entry); -+ } -+ -+ ++i; -+ } -+ } -+ -+ this.entries = tmpEntries.isEmpty() ? null : tmpEntries; -+ return; -+ } -+ } -+ -+ this.allSkins.add(altFilename); -+ ++filename; -+ } -+ } -+ -+ ResourceLocation getSkin(long key, int i, int j, int k, Integer biome) { -+ if (this.entries == null) { -+ int i$1 = (int)(key % (long)this.skinCount); -+ -+ if (i$1 < 0) { -+ i$1 += this.skinCount; -+ } -+ -+ return (ResourceLocation)this.allSkins.get(i$1); -+ } else { -+ Iterator i$ = this.entries.iterator(); -+ MobRuleList$MobRuleEntry entry; -+ -+ do { -+ if (!i$.hasNext()) { -+ return this.baseSkin; -+ } -+ -+ entry = (MobRuleList$MobRuleEntry)i$.next(); -+ } while (!entry.match(i, j, k, biome)); -+ -+ int index = entry.weightedIndex.choose(key); -+ return (ResourceLocation)this.allSkins.get(entry.skins[index]); -+ } -+ } -+ -+ static MobRuleList get(ResourceLocation texture) { -+ MobRuleList list = (MobRuleList)allRules.get(texture); -+ -+ if (list == null) { -+ list = new MobRuleList(texture); -+ allRules.put(texture, list); -+ } -+ -+ return list; -+ } -+ -+ static void clear() { -+ allRules.clear(); -+ } -+ -+ static Method access$000() { -+ return parseBiomeList; -+ } -+ -+ static Method access$002(Method x0) { -+ parseBiomeList = x0; -+ return x0; -+ } -+ -+ static { -+ try { -+ Class e = Class.forName("com.prupe.mcpatcher.cc.BiomeHelper"); -+ parseBiomeList = e.getDeclaredMethod("parseBiomeList", new Class[] {String.class, BitSet.class}); -+ getBiomeIDAt = e.getDeclaredMethod("getBiomeIDAt", new Class[] {Integer.TYPE, Integer.TYPE, Integer.TYPE}); -+ parseBiomeList.setAccessible(true); -+ getBiomeIDAt.setAccessible(true); -+ logger.fine("biome integration active", new Object[0]); -+ } catch (Throwable var1) { -+ parseBiomeList = null; -+ getBiomeIDAt = null; -+ logger.warning("biome integration failed", new Object[0]); -+ } -+ } -+} ---- /dev/null -+++ org/spoutcraft/client/spoutworth/SpoutWorth.java -@@ -1,0 +1,378 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.client.spoutworth; -+ -+import gnu.trove.iterator.TLongIterator; -+import gnu.trove.list.linked.TLongLinkedList; -+ -+import net.minecraft.src.Minecraft; -+ -+import org.spoutcraft.client.config.Configuration; -+ -+public class SpoutWorth { -+ private static SpoutWorth instance = null; -+ public static SpoutWorth getInstance() { -+ if (instance == null) { -+ instance = new SpoutWorth(); -+ } -+ return instance; -+ } -+ -+ private static final int MAX_FPS_TRACKED = 1000; -+ private static final int IDEAL_FPS = 60; -+ -+ TLongLinkedList fpsList = new TLongLinkedList(); -+ long avgFPS = -1; -+ long appearanceCooldown = 0; -+ long currentFPS = IDEAL_FPS; -+ String debug; -+ boolean belowIdeal = false; -+ -+ public void updateFPS(long fps) { -+ fpsList.add(fps); -+ if (fpsList.size() > MAX_FPS_TRACKED) { -+ fpsList.removeAt(0); -+ } -+ avgFPS = -1; -+ currentFPS = fps; -+ doTick(); -+ } -+ -+ public long getAverageFPS() { -+ if (avgFPS != -1) { -+ return avgFPS; -+ } -+ if (fpsList.size() == 0) { -+ return IDEAL_FPS; -+ } -+ long total = 0; -+ TLongIterator i = fpsList.iterator(); -+ while (i.hasNext()) { -+ total += i.next(); -+ } -+ avgFPS = Math.max(1, total / fpsList.size()); -+ return avgFPS; -+ } -+ -+ public long getIdealFPS() { -+ return Math.min(getAverageFPS() + 10, IDEAL_FPS); -+ } -+ -+ public void doTick() { -+ Configuration.setSignDistance(Math.max(8, Configuration.getSignDistance())); -+ if (!Configuration.isAutomatePerformance()) { -+ return; -+ } -+ -+ Configuration.setPerformance(0); -+ Configuration.setFarView(false); -+ -+ long idealFPS = getIdealFPS(); -+ // Calculate how close we are to acheiving ideal FPS -+ long percent = getAverageFPS() * 100 / idealFPS; -+ long percentCur = currentFPS * 100 / idealFPS; -+ -+ // Increase our ideal standards if we are looking for best performance -+ if (Configuration.getAutomateMode() == 0) { -+ percent -= 10; -+ percentCur -= 10; -+ } else if (Configuration.getAutomateMode() == 1) { // Decrease our ideal standards if we are looking for balanced performance -+ percent += 15; -+ percentCur += 15; -+ } else if (Configuration.getAutomateMode() == 2) { // Decrease our ideal standards if we are looking for best appearance -+ percent += 40; -+ percentCur += 40; -+ } -+ -+ boolean improving = percentCur > percent; -+ -+ belowIdeal = percent < 75; -+ debug = "Ideal Percent: " + percent + " Current Percent: " + percentCur + " Improving: " + improving; -+ -+ if (percent > 200) { -+ if (--appearanceCooldown <= 0) { -+ appearanceCooldown = 600; -+ increaseAppearance(); -+ increaseAppearance(); -+ } -+ } else if (percent > 150 || (percent > 125 && improving)) { -+ if (--appearanceCooldown <= 0) { -+ appearanceCooldown = 600; -+ increaseAppearance(); -+ } -+ } else if (percent < 40) { -+ decreaseAppearance(true, improving ? 10 : 0); -+ appearanceCooldown = 120; -+ } else if (percent < 66) { -+ if (--appearanceCooldown <= 0) { -+ decreaseAppearance(improving, 0); -+ appearanceCooldown = 240; -+ } -+ } else if (percent < 85) { -+ if (--appearanceCooldown <= 0) { -+ decreaseAppearance(); -+ appearanceCooldown = 480; -+ } -+ } -+ } -+ -+ public boolean isFullyLoaded() { -+ return fpsList.size() == SpoutWorth.MAX_FPS_TRACKED; -+ } -+ -+ public boolean isBelowIdeal() { -+ return belowIdeal && Configuration.isAutomatePerformance(); -+ } -+ -+ public String getDebugText() { -+ return debug; -+ } -+ -+ public void increaseAppearance() { -+ if (!Configuration.isSky()) { -+ Configuration.setSky(true); -+ Configuration.write(); -+ return; -+ } -+ if (!Configuration.isStars()) { -+ Configuration.setStars(true); -+ Configuration.write(); -+ return; -+ } -+ if (!Configuration.isFancyWater()) { -+ Configuration.setFancyWater(true); -+ Configuration.write(); -+ return; -+ } -+ if (!Configuration.isFancyParticles()) { -+ Configuration.setFancyParticles(true); -+ Configuration.write(); -+ return; -+ } -+ if (!Configuration.isFancyFog()) { -+ Configuration.setFancyFog(true); -+ Configuration.write(); -+ return; -+ } -+ if (!Configuration.isFancyGrass()) { -+ Configuration.setFancyGrass(true); -+ Configuration.write(); -+ return; -+ } -+ if (!Configuration.isFancyBiomeColors()) { -+ Configuration.setFancyBiomeColors(true); -+ Configuration.write(); -+ return; -+ } -+ if (!Configuration.isFancyLight()) { -+ Configuration.setFancyLight(true); -+ Configuration.write(); -+ return; -+ } -+ if (!Configuration.isFancyLight()) { -+ Configuration.setFancyLight(true); -+ Configuration.write(); -+ return; -+ } -+ if (!Configuration.isFancyClouds()) { -+ Configuration.setFancyClouds(true); -+ Configuration.write(); -+ return; -+ } -+ if (!Configuration.isFancyTrees()) { -+ Configuration.setFancyTrees(true); -+ Configuration.write(); -+ return; -+ } -+ if (!Configuration.isFancyWeather()) { -+ Configuration.setFancyWeather(true); -+ Configuration.write(); -+ return; -+ } -+ if (Configuration.getBetterGrass() == 1) { -+ Configuration.setBetterGrass(2); -+ Configuration.write(); -+ return; -+ } -+ if (Configuration.getRenderDistance() != 0) { -+ Configuration.setRenderDistance(Configuration.getRenderDistance() - 1); -+ Minecraft.getMinecraft().gameSettings.renderDistance = Configuration.getRenderDistance(); -+ Configuration.write(); -+ return; -+ } -+ if (Configuration.getAdvancedOpenGL() != 0) { -+ Configuration.setAdvancedOpenGL(0); -+ Minecraft.getMinecraft().gameSettings.advancedOpengl = false; -+ Configuration.write(); -+ return; -+ } -+ if (Configuration.getSignDistance() != Integer.MAX_VALUE) { -+ Configuration.setSignDistance(Configuration.getSignDistance() * 2); -+ if (Configuration.getSignDistance() >= 128) { -+ Configuration.setSignDistance(Integer.MAX_VALUE); -+ } -+ Configuration.write(); -+ return; -+ } -+ if (!Configuration.isAmbientOcclusion()) { -+ Configuration.setAmbientOcclusion(true); -+ Configuration.write(); -+ return; -+ } -+ } -+ -+ public void decreaseAppearance() { -+ decreaseAppearance(false, 0); -+ } -+ -+ public void decreaseAppearance(boolean drastic, long haltRenderingCount) { -+ int downgrade = drastic ? 2 : 1; -+ -+ if (Configuration.isSky()) { -+ Configuration.setSky(false); -+ if (--downgrade == 0) { -+ Configuration.write(); -+ return; -+ } -+ } -+ if (Configuration.getChunkRenderPasses() > 1) { -+ Configuration.setChunkRenderPasses(1); -+ if (--downgrade == 0) { -+ Configuration.write(); -+ return; -+ } -+ } -+ if (Configuration.getRenderDistance() < 2) { -+ Configuration.setRenderDistance(Configuration.getRenderDistance() + 1); -+ Minecraft.getMinecraft().gameSettings.renderDistance = Configuration.getRenderDistance(); -+ if (--downgrade == 0) { -+ Configuration.write(); -+ return; -+ } -+ } -+ if (Configuration.getAdvancedOpenGL() == 2 || Configuration.getAdvancedOpenGL() == 0) { -+ Configuration.setAdvancedOpenGL(1); -+ Minecraft.getMinecraft().gameSettings.advancedOpengl = true; -+ if (--downgrade == 0) { -+ Configuration.write(); -+ return; -+ } -+ } -+ if (Configuration.getSignDistance() > 8) { -+ Configuration.setSignDistance(Configuration.getSignDistance() / 2); -+ if (--downgrade == 0) { -+ Configuration.write(); -+ return; -+ } -+ } -+ -+ if (Configuration.isFancyParticles()) { -+ Configuration.setFancyParticles(false); -+ if (--downgrade == 0) { -+ Configuration.write(); -+ return; -+ } -+ } -+ if (Configuration.isFancyFog()) { -+ Configuration.setFancyFog(false); -+ Configuration.write(); -+ if (--downgrade == 0) { -+ return; -+ } -+ } -+ if (Configuration.isFancyGrass()) { -+ Configuration.setFancyGrass(false); -+ if (--downgrade == 0) { -+ Configuration.write(); -+ return; -+ } -+ } -+ if (Configuration.isFancyBiomeColors()) { -+ Configuration.setFancyBiomeColors(false); -+ if (--downgrade == 0) { -+ Configuration.write(); -+ return; -+ } -+ } -+ if (Configuration.isStars()) { -+ Configuration.setStars(false); -+ if (--downgrade == 0) { -+ Configuration.write(); -+ return; -+ } -+ } -+ if (Configuration.isFancyLight()) { -+ Configuration.setFancyLight(false); -+ if (--downgrade == 0) { -+ Configuration.write(); -+ return; -+ } -+ } -+ if (Configuration.isFancyLight()) { -+ Configuration.setFancyLight(false); -+ if (--downgrade == 0) { -+ Configuration.write(); -+ return; -+ } -+ } -+ if (Configuration.isFancyClouds()) { -+ Configuration.setFancyClouds(false); -+ if (--downgrade == 0) { -+ Configuration.write(); -+ return; -+ } -+ } -+ if (Configuration.isFancyTrees()) { -+ Configuration.setFancyTrees(false); -+ if (--downgrade == 0) { -+ Configuration.write(); -+ return; -+ } -+ } -+ if (Configuration.isFancyWeather()) { -+ Configuration.setFancyWeather(false); -+ if (--downgrade == 0) { -+ Configuration.write(); -+ return; -+ } -+ } -+ if (Configuration.getBetterGrass() == 2) { -+ Configuration.setBetterGrass(1); -+ if (--downgrade == 0) { -+ Configuration.write(); -+ return; -+ } -+ } -+ if (Configuration.isFancyWater()) { -+ Configuration.setFancyWater(false); -+ if (--downgrade == 0) { -+ Configuration.write(); -+ return; -+ } -+ } -+ if (Configuration.isAmbientOcclusion()) { -+ Configuration.setAmbientOcclusion(false); -+ if (--downgrade == 0) { -+ Configuration.write(); -+ return; -+ } -+ } -+ } -+} ---- net/minecraft/src/WorldProviderHell.java -+++ net/minecraft/src/WorldProviderHell.java -@@ -1,6 +1,18 @@ - package net.minecraft.src; - -+// MCPatcher Start -+ -+import com.prupe.mcpatcher.cc.ColorizeWorld; -+ -+import org.spoutcraft.api.gui.Color; -+import org.spoutcraft.client.SpoutClient; -+ -+// MCPatcher End - public class WorldProviderHell extends WorldProvider { -+ -+ /** -+ * creates a new world chunk manager for WorldProvider -+ */ - public void registerWorldChunkManager() { - this.worldChunkMgr = new WorldChunkManagerHell(BiomeGenBase.hell, 1.0F, 0.0F); - this.isHellWorld = true; -@@ -8,44 +20,79 @@ - this.dimensionId = -1; - } - -- public Vec3 getFogColor(float var1, float var2) { -- return this.worldObj.getWorldVec3Pool().getVecFromPool((double)0.2F, (double)0.03F, (double)0.03F); -+ /** -+ * Return Vec3D with biome specific fog color -+ */ -+ public Vec3 getFogColor(float par1, float par2) { -+ // Spout Start -+ Color fogColor = SpoutClient.getInstance().getSkyManager().getFogColor(); -+ if (fogColor != null) { -+ return Vec3.createVectorHelper(fogColor.getRedF(), fogColor.getGreenF(), fogColor.getBlueF()); -+ } else { -+ // MCPatcher Start -+ return this.worldObj.getWorldVec3Pool().getVecFromPool((double)ColorizeWorld.netherFogColor[0], (double)ColorizeWorld.netherFogColor[1], (double)ColorizeWorld.netherFogColor[2]); -+ // MCPatcher End -+ } -+ // Spout End - } - -+ /** -+ * Creates the light to brightness table -+ */ - protected void generateLightBrightnessTable() { - float var1 = 0.1F; - -- for(int var2 = 0; var2 <= 15; ++var2) { -+ for (int var2 = 0; var2 <= 15; ++var2) { - float var3 = 1.0F - (float)var2 / 15.0F; - this.lightBrightnessTable[var2] = (1.0F - var3) / (var3 * 3.0F + 1.0F) * (1.0F - var1) + var1; - } -- - } - -+ /** -+ * Returns a new chunk provider which generates chunks for this world -+ */ - public IChunkProvider createChunkGenerator() { - return new ChunkProviderHell(this.worldObj, this.worldObj.getSeed()); - } - -+ /** -+ * Returns 'true' if in the "main surface world", but 'false' if in the Nether or End dimensions. -+ */ - public boolean isSurfaceWorld() { - return false; - } - -- public boolean canCoordinateBeSpawn(int var1, int var2) { -+ /** -+ * Will check if the x, z position specified is alright to be set as the map spawn point -+ */ -+ public boolean canCoordinateBeSpawn(int par1, int par2) { - return false; - } - -- public float calculateCelestialAngle(long var1, float var3) { -+ /** -+ * Calculates the angle of sun and moon in the sky relative to a specified time (usually worldTime) -+ */ -+ public float calculateCelestialAngle(long par1, float par3) { - return 0.5F; - } - -+ /** -+ * True if the player can respawn in this dimension (true = overworld, false = nether). -+ */ - public boolean canRespawnHere() { - return false; - } - -- public boolean doesXZShowFog(int var1, int var2) { -+ /** -+ * Returns true if the given X,Z coordinate should show environmental fog. -+ */ -+ public boolean doesXZShowFog(int par1, int par2) { - return true; - } - -+ /** -+ * Returns the dimension's name, e.g. "The End", "Nether", or "Overworld". -+ */ - public String getDimensionName() { - return "Nether"; - } ---- net/minecraft/src/Packet44UpdateAttributes.java -+++ net/minecraft/src/Packet44UpdateAttributes.java -@@ -11,71 +11,79 @@ - - public class Packet44UpdateAttributes extends Packet { - private int field_111005_a; -- private final List b = new ArrayList(); -- -- public Packet44UpdateAttributes() { -- } -- -- public Packet44UpdateAttributes(int var1, Collection var2) { -- this.field_111005_a = var1; -- Iterator var3 = var2.iterator(); -- -- while(var3.hasNext()) { -+ private final List field_111004_b = new ArrayList(); -+ -+ public Packet44UpdateAttributes() {} -+ -+ public Packet44UpdateAttributes(int par1, Collection par2Collection) { -+ this.field_111005_a = par1; -+ Iterator var3 = par2Collection.iterator(); -+ -+ while (var3.hasNext()) { - AttributeInstance var4 = (AttributeInstance)var3.next(); -- this.b.add(new Packet44UpdateAttributesSnapshot(this, var4.func_111123_a().getAttributeUnlocalizedName(), var4.getBaseValue(), var4.func_111122_c())); -+ this.field_111004_b.add(new Packet44UpdateAttributesSnapshot(this, var4.func_111123_a().getAttributeUnlocalizedName(), var4.getBaseValue(), var4.func_111122_c())); - } -- - } - -- public void readPacketData(DataInput var1) throws IOException { -- this.field_111005_a = var1.readInt(); -- int var2 = var1.readInt(); -+ /** -+ * Abstract. Reads the raw packet data from the data stream. -+ */ -+ public void readPacketData(DataInput par1DataInput) throws IOException { -+ this.field_111005_a = par1DataInput.readInt(); -+ int var2 = par1DataInput.readInt(); - -- for(int var3 = 0; var3 < var2; ++var3) { -- String var4 = readString(var1, 64); -- double var5 = var1.readDouble(); -+ for (int var3 = 0; var3 < var2; ++var3) { -+ String var4 = readString(par1DataInput, 64); -+ double var5 = par1DataInput.readDouble(); - ArrayList var7 = new ArrayList(); -- short var8 = var1.readShort(); -+ short var8 = par1DataInput.readShort(); - -- for(int var9 = 0; var9 < var8; ++var9) { -- UUID var10 = new UUID(var1.readLong(), var1.readLong()); -- var7.add(new AttributeModifier(var10, "Unknown synced attribute modifier", var1.readDouble(), var1.readByte())); -+ for (int var9 = 0; var9 < var8; ++var9) { -+ UUID var10 = new UUID(par1DataInput.readLong(), par1DataInput.readLong()); -+ var7.add(new AttributeModifier(var10, "Unknown synced attribute modifier", par1DataInput.readDouble(), par1DataInput.readByte())); - } - -- this.b.add(new Packet44UpdateAttributesSnapshot(this, var4, var5, var7)); -+ this.field_111004_b.add(new Packet44UpdateAttributesSnapshot(this, var4, var5, var7)); - } -- - } - -- public void writePacketData(DataOutput var1) throws IOException { -- var1.writeInt(this.field_111005_a); -- var1.writeInt(this.b.size()); -- Iterator var2 = this.b.iterator(); -+ /** -+ * Abstract. Writes the raw packet data to the data stream. -+ */ -+ public void writePacketData(DataOutput par1DataOutput) throws IOException { -+ par1DataOutput.writeInt(this.field_111005_a); -+ par1DataOutput.writeInt(this.field_111004_b.size()); -+ Iterator var2 = this.field_111004_b.iterator(); - -- while(var2.hasNext()) { -+ while (var2.hasNext()) { - Packet44UpdateAttributesSnapshot var3 = (Packet44UpdateAttributesSnapshot)var2.next(); -- writeString(var3.func_142040_a(), var1); -- var1.writeDouble(var3.func_142041_b()); -- var1.writeShort(var3.func_142039_c().size()); -+ writeString(var3.func_142040_a(), par1DataOutput); -+ par1DataOutput.writeDouble(var3.func_142041_b()); -+ par1DataOutput.writeShort(var3.func_142039_c().size()); - Iterator var4 = var3.func_142039_c().iterator(); - -- while(var4.hasNext()) { -+ while (var4.hasNext()) { - AttributeModifier var5 = (AttributeModifier)var4.next(); -- var1.writeLong(var5.getID().getMostSignificantBits()); -- var1.writeLong(var5.getID().getLeastSignificantBits()); -- var1.writeDouble(var5.getAmount()); -- var1.writeByte(var5.getOperation()); -+ par1DataOutput.writeLong(var5.getID().getMostSignificantBits()); -+ par1DataOutput.writeLong(var5.getID().getLeastSignificantBits()); -+ par1DataOutput.writeDouble(var5.getAmount()); -+ par1DataOutput.writeByte(var5.getOperation()); - } - } -- -- } -- -- public void processPacket(NetHandler var1) { -- var1.func_110773_a(this); -- } -- -+ } -+ -+ /** -+ * Passes this Packet on to the NetHandler for processing. -+ */ -+ public void processPacket(NetHandler par1NetHandler) { -+ par1NetHandler.func_110773_a(this); -+ } -+ -+ /** -+ * Abstract. Return the size of the packet (not counting the header). -+ */ - public int getPacketSize() { -- return 8 + this.b.size() * 24; -+ return 8 + this.field_111004_b.size() * 24; - } - - public int func_111002_d() { -@@ -83,6 +91,6 @@ - } - - public List func_111003_f() { -- return this.b; -+ return this.field_111004_b; - } - } ---- net/minecraft/src/GuiScreenPendingInvitationList.java -+++ net/minecraft/src/GuiScreenPendingInvitationList.java -@@ -3,26 +3,35 @@ - class GuiScreenPendingInvitationList extends GuiScreenSelectLocation { - final GuiScreenPendingInvitation field_130120_a; - -- public GuiScreenPendingInvitationList(GuiScreenPendingInvitation var1) { -- super(GuiScreenPendingInvitation.func_130054_j(var1), var1.width, var1.height, 32, var1.height - 64, 36); -- this.field_130120_a = var1; -+ public GuiScreenPendingInvitationList(GuiScreenPendingInvitation par1GuiScreenPendingInvitation) { -+ super(GuiScreenPendingInvitation.func_130054_j(par1GuiScreenPendingInvitation), par1GuiScreenPendingInvitation.width, par1GuiScreenPendingInvitation.height, 32, par1GuiScreenPendingInvitation.height - 64, 36); -+ this.field_130120_a = par1GuiScreenPendingInvitation; - } - -+ /** -+ * Gets the size of the current slot list. -+ */ - protected int getSize() { - return GuiScreenPendingInvitation.func_130042_e(this.field_130120_a).size() + 1; - } - -- protected void elementClicked(int var1, boolean var2) { -- if(var1 < GuiScreenPendingInvitation.func_130042_e(this.field_130120_a).size()) { -- GuiScreenPendingInvitation.func_130053_a(this.field_130120_a, var1); -+ /** -+ * the element in the slot that was clicked, boolean for wether it was double clicked or not -+ */ -+ protected void elementClicked(int par1, boolean par2) { -+ if (par1 < GuiScreenPendingInvitation.func_130042_e(this.field_130120_a).size()) { -+ GuiScreenPendingInvitation.func_130053_a(this.field_130120_a, par1); - } - } - -- protected boolean isSelected(int var1) { -- return var1 == GuiScreenPendingInvitation.func_130049_d(this.field_130120_a); -+ /** -+ * returns true if the element passed in is currently selected -+ */ -+ protected boolean isSelected(int par1) { -+ return par1 == GuiScreenPendingInvitation.func_130049_d(this.field_130120_a); - } - -- protected boolean func_104086_b(int var1) { -+ protected boolean func_104086_b(int par1) { - return false; - } - -@@ -34,16 +43,15 @@ - this.field_130120_a.drawDefaultBackground(); - } - -- protected void drawSlot(int var1, int var2, int var3, int var4, Tessellator var5) { -- if(var1 < GuiScreenPendingInvitation.func_130042_e(this.field_130120_a).size()) { -- this.func_130119_b(var1, var2, var3, var4, var5); -+ protected void drawSlot(int par1, int par2, int par3, int par4, Tessellator par5Tessellator) { -+ if (par1 < GuiScreenPendingInvitation.func_130042_e(this.field_130120_a).size()) { -+ this.func_130119_b(par1, par2, par3, par4, par5Tessellator); - } -- - } - -- private void func_130119_b(int var1, int var2, int var3, int var4, Tessellator var5) { -- PendingInvite var6 = (PendingInvite)GuiScreenPendingInvitation.func_130042_e(this.field_130120_a).get(var1); -- this.field_130120_a.drawString(GuiScreenPendingInvitation.func_130045_k(this.field_130120_a), var6.b, var2 + 2, var3 + 1, 16777215); -- this.field_130120_a.drawString(GuiScreenPendingInvitation.func_130052_l(this.field_130120_a), var6.c, var2 + 2, var3 + 12, 7105644); -+ private void func_130119_b(int par1, int par2, int par3, int par4, Tessellator par5Tessellator) { -+ PendingInvite var6 = (PendingInvite)GuiScreenPendingInvitation.func_130042_e(this.field_130120_a).get(par1); -+ this.field_130120_a.drawString(GuiScreenPendingInvitation.func_130045_k(this.field_130120_a), var6.field_130092_b, par2 + 2, par3 + 1, 16777215); -+ this.field_130120_a.drawString(GuiScreenPendingInvitation.func_130052_l(this.field_130120_a), var6.field_130093_c, par2 + 2, par3 + 12, 7105644); - } - } ---- net/minecraft/src/CreativeTabDeco.java -+++ net/minecraft/src/CreativeTabDeco.java -@@ -1,10 +1,13 @@ - package net.minecraft.src; - - final class CreativeTabDeco extends CreativeTabs { -- CreativeTabDeco(int var1, String var2) { -- super(var1, var2); -+ CreativeTabDeco(int par1, String par2Str) { -+ super(par1, par2Str); - } - -+ /** -+ * the itemID for the item to be displayed on the tab -+ */ - public int getTabIconItemIndex() { - return Item.redstone.itemID; - } ---- /dev/null -+++ org/spoutcraft/client/special/VIP.java -@@ -1,0 +1,95 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.client.special; -+ -+import java.util.HashMap; -+import java.util.Map; -+ -+public class VIP { -+ private final String username; -+ private final String title; -+ private final String cape; -+ private final String armorBaseUrl; -+ private final float scale; -+ private final Map particles; -+ private final Map acs; -+ -+ public VIP(String username, String title, String cape, Map particles, Map acs, String armor, float scale) { -+ this.username = username; -+ this.title = title; -+ this.cape = cape; -+ this.armorBaseUrl = armor; -+ this.scale = scale; -+ this.acs = acs; -+ if (particles != null) { -+ this.particles = new HashMap(particles); -+ } else { -+ this.particles = new HashMap(1); -+ } -+ } -+ -+ public String getTitle() { -+ return title; -+ } -+ -+ public Map getParticles() { -+ return particles; -+ } -+ -+ public String getCape() { -+ return cape; -+ } -+ -+ @Override -+ public boolean equals(Object obj) { -+ if (obj instanceof VIP) { -+ VIP other = (VIP) obj; -+ if (other.username.equals(username)) { -+ return true; -+ } -+ } -+ return false; -+ } -+ -+ @Override -+ public int hashCode() { -+ return username.hashCode(); -+ } -+ -+ public String getUsername() { -+ return username; -+ } -+ -+ public float getScale() { -+ return scale; -+ } -+ -+ public String getArmor(int id) { -+ if (armorBaseUrl != null) { -+ return armorBaseUrl + "_" + id + ".png"; -+ } else { -+ return null; -+ } -+ } -+ -+ public Map Accessories() { -+ return acs; -+ } -+} ---- /dev/null -+++ org/spoutcraft/client/packet/PacketSendLink.java -@@ -1,0 +1,77 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.client.packet; -+ -+import net.minecraft.src.Minecraft; -+import net.minecraft.src.GuiConfirmOpenLink; -+ -+import org.spoutcraft.api.io.SpoutInputStream; -+import org.spoutcraft.api.io.SpoutOutputStream; -+ -+import java.io.IOException; -+import java.net.URL; -+ -+ -+public class PacketSendLink implements SpoutPacket { -+ protected URL link; -+ -+ public PacketSendLink() { -+ link = null; -+ } -+ -+ @Override -+ public void readData(SpoutInputStream input) throws IOException { -+ link = new URL(input.readString()); -+ } -+ -+ @Override -+ public void writeData(SpoutOutputStream output) throws IOException { -+ throw new IOException("The client may not send a link to the server!"); -+ } -+ -+ @Override -+ public void run(int playerId) { -+ if (link != null) { -+ try { -+ Minecraft.getMinecraft().displayGuiScreen(new GuiConfirmOpenLink(Minecraft.getMinecraft().currentScreen, link.toString(), 0, false)); -+ } catch (Exception e) { } -+ } -+ } -+ -+ @Override -+ public void failure(int playerId) { -+ -+ } -+ -+ @Override -+ public PacketType getPacketType() { -+ return PacketType.PacketSendLink; -+ } -+ -+ @Override -+ public int getVersion() { -+ return 0; -+ } -+ -+ @Override -+ public String toString() { -+ return "PacketSendLink{ version= " + getVersion() + ", link= " + (link == null ? "null" : link.toString()) + " }"; -+ } -+} ---- net/minecraft/src/EntityTracker.java -+++ net/minecraft/src/EntityTracker.java -@@ -7,105 +7,113 @@ - - public class EntityTracker { - private final WorldServer theWorld; -- private Set b = new HashSet(); -- private IntHashMap trackedEntityHashTable = new IntHashMap(); -- private int maxTrackingDistanceThreshold; -- -- public EntityTracker(WorldServer var1) { -- this.theWorld = var1; -- this.maxTrackingDistanceThreshold = var1.getMinecraftServer().getConfigurationManager().getEntityViewDistance(); -+ -+ /** -+ * List of tracked entities, used for iteration operations on tracked entities. -+ */ -+ private Set trackedEntities = new HashSet(); -+ private IntHashMap trackedEntityIDs = new IntHashMap(); -+ private int entityViewDistance; -+ -+ public EntityTracker(WorldServer par1WorldServer) { -+ this.theWorld = par1WorldServer; -+ this.entityViewDistance = par1WorldServer.getMinecraftServer().getConfigurationManager().getEntityViewDistance(); - } - -- public void trackEntity(Entity var1) { -- if(var1 instanceof EntityPlayerMP) { -- this.trackEntity(var1, 512, 2); -- EntityPlayerMP var2 = (EntityPlayerMP)var1; -- Iterator var3 = this.b.iterator(); -+ /** -+ * if entity is a player sends all tracked events to the player, otherwise, adds with a visibility and update arate -+ * based on the class type -+ */ -+ public void addEntityToTracker(Entity par1Entity) { -+ if (par1Entity instanceof EntityPlayerMP) { -+ this.addEntityToTracker(par1Entity, 512, 2); -+ EntityPlayerMP var2 = (EntityPlayerMP)par1Entity; -+ Iterator var3 = this.trackedEntities.iterator(); - -- while(var3.hasNext()) { -+ while (var3.hasNext()) { - EntityTrackerEntry var4 = (EntityTrackerEntry)var3.next(); -- if(var4.trackedEntity != var2) { -- var4.updatePlayerEntity(var2); -+ -+ if (var4.myEntity != var2) { -+ var4.tryStartWachingThis(var2); - } - } -- } else if(var1 instanceof EntityFishHook) { -- this.trackEntity(var1, 64, 5, true); -- } else if(var1 instanceof EntityArrow) { -- this.trackEntity(var1, 64, 20, false); -- } else if(var1 instanceof EntitySmallFireball) { -- this.trackEntity(var1, 64, 10, false); -- } else if(var1 instanceof EntityFireball) { -- this.trackEntity(var1, 64, 10, false); -- } else if(var1 instanceof EntitySnowball) { -- this.trackEntity(var1, 64, 10, true); -- } else if(var1 instanceof EntityEnderPearl) { -- this.trackEntity(var1, 64, 10, true); -- } else if(var1 instanceof EntityEnderEye) { -- this.trackEntity(var1, 64, 4, true); -- } else if(var1 instanceof EntityEgg) { -- this.trackEntity(var1, 64, 10, true); -- } else if(var1 instanceof EntityPotion) { -- this.trackEntity(var1, 64, 10, true); -- } else if(var1 instanceof EntityExpBottle) { -- this.trackEntity(var1, 64, 10, true); -- } else if(var1 instanceof EntityFireworkRocket) { -- this.trackEntity(var1, 64, 10, true); -- } else if(var1 instanceof EntityItem) { -- this.trackEntity(var1, 64, 20, true); -- } else if(var1 instanceof EntityMinecart) { -- this.trackEntity(var1, 80, 3, true); -- } else if(var1 instanceof EntityBoat) { -- this.trackEntity(var1, 80, 3, true); -- } else if(var1 instanceof EntitySquid) { -- this.trackEntity(var1, 64, 3, true); -- } else if(var1 instanceof EntityWither) { -- this.trackEntity(var1, 80, 3, false); -- } else if(var1 instanceof EntityBat) { -- this.trackEntity(var1, 80, 3, false); -- } else if(var1 instanceof IAnimals) { -- this.trackEntity(var1, 80, 3, true); -- } else if(var1 instanceof EntityDragon) { -- this.trackEntity(var1, 160, 3, true); -- } else if(var1 instanceof EntityTNTPrimed) { -- this.trackEntity(var1, 160, 10, true); -- } else if(var1 instanceof EntityFallingSand) { -- this.trackEntity(var1, 160, 20, true); -- } else if(var1 instanceof EntityHanging) { -- this.trackEntity(var1, 160, Integer.MAX_VALUE, false); -- } else if(var1 instanceof EntityXPOrb) { -- this.trackEntity(var1, 160, 20, true); -- } else if(var1 instanceof EntityEnderCrystal) { -- this.trackEntity(var1, 256, Integer.MAX_VALUE, false); -+ } else if (par1Entity instanceof EntityFishHook) { -+ this.addEntityToTracker(par1Entity, 64, 5, true); -+ } else if (par1Entity instanceof EntityArrow) { -+ this.addEntityToTracker(par1Entity, 64, 20, false); -+ } else if (par1Entity instanceof EntitySmallFireball) { -+ this.addEntityToTracker(par1Entity, 64, 10, false); -+ } else if (par1Entity instanceof EntityFireball) { -+ this.addEntityToTracker(par1Entity, 64, 10, false); -+ } else if (par1Entity instanceof EntitySnowball) { -+ this.addEntityToTracker(par1Entity, 64, 10, true); -+ } else if (par1Entity instanceof EntityEnderPearl) { -+ this.addEntityToTracker(par1Entity, 64, 10, true); -+ } else if (par1Entity instanceof EntityEnderEye) { -+ this.addEntityToTracker(par1Entity, 64, 4, true); -+ } else if (par1Entity instanceof EntityEgg) { -+ this.addEntityToTracker(par1Entity, 64, 10, true); -+ } else if (par1Entity instanceof EntityPotion) { -+ this.addEntityToTracker(par1Entity, 64, 10, true); -+ } else if (par1Entity instanceof EntityExpBottle) { -+ this.addEntityToTracker(par1Entity, 64, 10, true); -+ } else if (par1Entity instanceof EntityFireworkRocket) { -+ this.addEntityToTracker(par1Entity, 64, 10, true); -+ } else if (par1Entity instanceof EntityItem) { -+ this.addEntityToTracker(par1Entity, 64, 20, true); -+ } else if (par1Entity instanceof EntityMinecart) { -+ this.addEntityToTracker(par1Entity, 80, 3, true); -+ } else if (par1Entity instanceof EntityBoat) { -+ this.addEntityToTracker(par1Entity, 80, 3, true); -+ } else if (par1Entity instanceof EntitySquid) { -+ this.addEntityToTracker(par1Entity, 64, 3, true); -+ } else if (par1Entity instanceof EntityWither) { -+ this.addEntityToTracker(par1Entity, 80, 3, false); -+ } else if (par1Entity instanceof EntityBat) { -+ this.addEntityToTracker(par1Entity, 80, 3, false); -+ } else if (par1Entity instanceof IAnimals) { -+ this.addEntityToTracker(par1Entity, 80, 3, true); -+ } else if (par1Entity instanceof EntityDragon) { -+ this.addEntityToTracker(par1Entity, 160, 3, true); -+ } else if (par1Entity instanceof EntityTNTPrimed) { -+ this.addEntityToTracker(par1Entity, 160, 10, true); -+ } else if (par1Entity instanceof EntityFallingSand) { -+ this.addEntityToTracker(par1Entity, 160, 20, true); -+ } else if (par1Entity instanceof EntityHanging) { -+ this.addEntityToTracker(par1Entity, 160, Integer.MAX_VALUE, false); -+ } else if (par1Entity instanceof EntityXPOrb) { -+ this.addEntityToTracker(par1Entity, 160, 20, true); -+ } else if (par1Entity instanceof EntityEnderCrystal) { -+ this.addEntityToTracker(par1Entity, 256, Integer.MAX_VALUE, false); - } -- -- } -- -- public void trackEntity(Entity var1, int var2, int var3) { -- this.trackEntity(var1, var2, var3, false); -- } -- -- public void trackEntity(Entity var1, int var2, int var3, boolean var4) { -- if(var2 > this.maxTrackingDistanceThreshold) { -- var2 = this.maxTrackingDistanceThreshold; -+ } -+ -+ public void addEntityToTracker(Entity par1Entity, int par2, int par3) { -+ this.addEntityToTracker(par1Entity, par2, par3, false); -+ } -+ -+ public void addEntityToTracker(Entity par1Entity, int par2, int par3, boolean par4) { -+ if (par2 > this.entityViewDistance) { -+ par2 = this.entityViewDistance; - } - - try { -- if(this.trackedEntityHashTable.containsItem(var1.entityId)) { -+ if (this.trackedEntityIDs.containsItem(par1Entity.entityId)) { - throw new IllegalStateException("Entity is already tracked!"); - } - -- EntityTrackerEntry var5 = new EntityTrackerEntry(var1, var2, var3, var4); -- this.b.add(var5); -- this.trackedEntityHashTable.addKey(var1.entityId, var5); -- var5.updatePlayerEntities(this.theWorld.h); -+ EntityTrackerEntry var5 = new EntityTrackerEntry(par1Entity, par2, par3, par4); -+ this.trackedEntities.add(var5); -+ this.trackedEntityIDs.addKey(par1Entity.entityId, var5); -+ var5.sendEventsToPlayers(this.theWorld.playerEntities); - } catch (Throwable var11) { - CrashReport var6 = CrashReport.makeCrashReport(var11, "Adding entity to track"); - CrashReportCategory var7 = var6.makeCategory("Entity To Track"); -- var7.addCrashSection("Tracking range", var2 + " blocks"); -- var7.addCrashSectionCallable("Update interval", new CallableEntityTracker(this, var3)); -- var1.addEntityCrashInfo(var7); -+ var7.addCrashSection("Tracking range", par2 + " blocks"); -+ var7.addCrashSectionCallable("Update interval", new CallableEntityTracker(this, par3)); -+ par1Entity.addEntityCrashInfo(var7); - CrashReportCategory var8 = var6.makeCategory("Entity That Is Already Tracked"); -- ((EntityTrackerEntry)this.trackedEntityHashTable.lookup(var1.entityId)).trackedEntity.addEntityCrashInfo(var8); -+ ((EntityTrackerEntry)this.trackedEntityIDs.lookup(par1Entity.entityId)).myEntity.addEntityCrashInfo(var8); - - try { - throw new ReportedException(var6); -@@ -114,89 +122,94 @@ - var10.printStackTrace(); - } - } -- - } - -- public void untrackEntity(Entity var1) { -- if(var1 instanceof EntityPlayerMP) { -- EntityPlayerMP var2 = (EntityPlayerMP)var1; -- Iterator var3 = this.b.iterator(); -+ public void removeEntityFromAllTrackingPlayers(Entity par1Entity) { -+ if (par1Entity instanceof EntityPlayerMP) { -+ EntityPlayerMP var2 = (EntityPlayerMP)par1Entity; -+ Iterator var3 = this.trackedEntities.iterator(); - -- while(var3.hasNext()) { -+ while (var3.hasNext()) { - EntityTrackerEntry var4 = (EntityTrackerEntry)var3.next(); -- var4.removeFromTrackedPlayers(var2); -+ var4.removeFromWatchingList(var2); - } - } - -- EntityTrackerEntry var5 = (EntityTrackerEntry)this.trackedEntityHashTable.removeObject(var1.entityId); -- if(var5 != null) { -- this.b.remove(var5); -- var5.sendDestroyEntityPacketToTrackedPlayers(); -- } -+ EntityTrackerEntry var5 = (EntityTrackerEntry)this.trackedEntityIDs.removeObject(par1Entity.entityId); - -+ if (var5 != null) { -+ this.trackedEntities.remove(var5); -+ var5.informAllAssociatedPlayersOfItemDestruction(); -+ } - } - - public void updateTrackedEntities() { - ArrayList var1 = new ArrayList(); -- Iterator var2 = this.b.iterator(); -+ Iterator var2 = this.trackedEntities.iterator(); - -- while(var2.hasNext()) { -+ while (var2.hasNext()) { - EntityTrackerEntry var3 = (EntityTrackerEntry)var2.next(); -- var3.updatePlayerList(this.theWorld.h); -- if(var3.playerEntitiesUpdated && var3.trackedEntity instanceof EntityPlayerMP) { -- var1.add((EntityPlayerMP)var3.trackedEntity); -+ var3.sendLocationToAllClients(this.theWorld.playerEntities); -+ -+ if (var3.playerEntitiesUpdated && var3.myEntity instanceof EntityPlayerMP) { -+ var1.add((EntityPlayerMP)var3.myEntity); - } - } - -- for(int var6 = 0; var6 < var1.size(); ++var6) { -+ for (int var6 = 0; var6 < var1.size(); ++var6) { - EntityPlayerMP var7 = (EntityPlayerMP)var1.get(var6); -- Iterator var4 = this.b.iterator(); -+ Iterator var4 = this.trackedEntities.iterator(); - -- while(var4.hasNext()) { -+ while (var4.hasNext()) { - EntityTrackerEntry var5 = (EntityTrackerEntry)var4.next(); -- if(var5.trackedEntity != var7) { -- var5.updatePlayerEntity(var7); -+ -+ if (var5.myEntity != var7) { -+ var5.tryStartWachingThis(var7); - } - } - } -- -- } -- -- public void sendPacketToTrackedPlayers(Entity var1, Packet var2) { -- EntityTrackerEntry var3 = (EntityTrackerEntry)this.trackedEntityHashTable.lookup(var1.entityId); -- if(var3 != null) { -- var3.sendPacketToTrackedPlayers(var2); -- } -- -- } -- -- public void sendPacketToTrackedPlayersAndTrackedEntity(Entity var1, Packet var2) { -- EntityTrackerEntry var3 = (EntityTrackerEntry)this.trackedEntityHashTable.lookup(var1.entityId); -- if(var3 != null) { -- var3.sendPacketToTrackedPlayersAndTrackedEntity(var2); -- } -- -- } -- -- public void removePlayerFromTrackers(EntityPlayerMP var1) { -- Iterator var2 = this.b.iterator(); -- -- while(var2.hasNext()) { -+ } -+ -+ /** -+ * does not send the packet to the entity if the entity is a player -+ */ -+ public void sendPacketToAllPlayersTrackingEntity(Entity par1Entity, Packet par2Packet) { -+ EntityTrackerEntry var3 = (EntityTrackerEntry)this.trackedEntityIDs.lookup(par1Entity.entityId); -+ -+ if (var3 != null) { -+ var3.sendPacketToAllTrackingPlayers(par2Packet); -+ } -+ } -+ -+ /** -+ * sends to the entity if the entity is a player -+ */ -+ public void sendPacketToAllAssociatedPlayers(Entity par1Entity, Packet par2Packet) { -+ EntityTrackerEntry var3 = (EntityTrackerEntry)this.trackedEntityIDs.lookup(par1Entity.entityId); -+ -+ if (var3 != null) { -+ var3.sendPacketToAllAssociatedPlayers(par2Packet); -+ } -+ } -+ -+ public void removePlayerFromTrackers(EntityPlayerMP par1EntityPlayerMP) { -+ Iterator var2 = this.trackedEntities.iterator(); -+ -+ while (var2.hasNext()) { - EntityTrackerEntry var3 = (EntityTrackerEntry)var2.next(); -- var3.removeTrackedPlayerSymmetric(var1); -+ var3.removePlayerFromTracker(par1EntityPlayerMP); - } -- - } - -- public void func_85172_a(EntityPlayerMP var1, Chunk var2) { -- Iterator var3 = this.b.iterator(); -+ public void func_85172_a(EntityPlayerMP par1EntityPlayerMP, Chunk par2Chunk) { -+ Iterator var3 = this.trackedEntities.iterator(); - -- while(var3.hasNext()) { -+ while (var3.hasNext()) { - EntityTrackerEntry var4 = (EntityTrackerEntry)var3.next(); -- if(var4.trackedEntity != var1 && var4.trackedEntity.chunkCoordX == var2.xPosition && var4.trackedEntity.chunkCoordZ == var2.zPosition) { -- var4.updatePlayerEntity(var1); -+ -+ if (var4.myEntity != par1EntityPlayerMP && var4.myEntity.chunkCoordX == par2Chunk.xPosition && var4.myEntity.chunkCoordZ == par2Chunk.zPosition) { -+ var4.tryStartWachingThis(par1EntityPlayerMP); - } - } -- - } - } ---- net/minecraft/src/Packet203AutoComplete.java -+++ net/minecraft/src/Packet203AutoComplete.java -@@ -5,40 +5,63 @@ - import java.io.IOException; - - public class Packet203AutoComplete extends Packet { -- private String a; -- -- public Packet203AutoComplete() { -- } -- -- public Packet203AutoComplete(String var1) { -- this.a = var1; -- } -- -- public void readPacketData(DataInput var1) throws IOException { -- this.a = readString(var1, Short.MAX_VALUE); -- } -- -- public void writePacketData(DataOutput var1) throws IOException { -- writeString(org.apache.commons.lang3.StringUtils.substring(this.a, 0, Short.MAX_VALUE), var1); -- } -- -- public void processPacket(NetHandler var1) { -- var1.handleAutoComplete(this); -- } -- -+ -+ /** -+ * Sent by the client containing the text to be autocompleted. Sent by the server with possible completions separated -+ * by null (two bytes in UTF-16) -+ */ -+ private String text; -+ -+ public Packet203AutoComplete() {} -+ -+ public Packet203AutoComplete(String par1Str) { -+ this.text = par1Str; -+ } -+ -+ /** -+ * Abstract. Reads the raw packet data from the data stream. -+ */ -+ public void readPacketData(DataInput par1DataInput) throws IOException { -+ this.text = readString(par1DataInput, 32767); -+ } -+ -+ /** -+ * Abstract. Writes the raw packet data to the data stream. -+ */ -+ public void writePacketData(DataOutput par1DataOutput) throws IOException { -+ writeString(org.apache.commons.lang3.StringUtils.substring(this.text, 0, 32767), par1DataOutput); -+ } -+ -+ /** -+ * Passes this Packet on to the NetHandler for processing. -+ */ -+ public void processPacket(NetHandler par1NetHandler) { -+ par1NetHandler.handleAutoComplete(this); -+ } -+ -+ /** -+ * Abstract. Return the size of the packet (not counting the header). -+ */ - public int getPacketSize() { -- return 2 + this.a.length() * 2; -+ return 2 + this.text.length() * 2; - } - - public String getText() { -- return this.a; -+ return this.text; - } - -+ /** -+ * only false for the abstract Packet class, all real packets return true -+ */ - public boolean isRealPacket() { - return true; - } - -- public boolean containsSameEntityIDAs(Packet var1) { -+ /** -+ * eg return packet30entity.entityId == entityId; WARNING : will throw if you compare a packet to a different packet -+ * class -+ */ -+ public boolean containsSameEntityIDAs(Packet par1Packet) { - return true; - } - } ---- /dev/null -+++ org/spoutcraft/client/ScheduledTextFieldUpdate.java -@@ -1,0 +1,67 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.client; -+ -+import org.spoutcraft.api.gui.Screen; -+import org.spoutcraft.api.gui.TextField; -+import org.spoutcraft.client.packet.PacketControlAction; -+ -+public class ScheduledTextFieldUpdate implements Runnable { -+ private static final long DELAY_TIME = 500; -+ private static final long SLEEP_TIME = 125; -+ private TextField textField; -+ private Screen screen; -+ private long sendTime; -+ private Thread thread; -+ -+ public ScheduledTextFieldUpdate(Screen screen, TextField textField) { -+ this.textField = textField; -+ this.screen = screen; -+ } -+ -+ public void run() { -+ delay(); -+ while (!expired()) { -+ try { -+ Thread.sleep(SLEEP_TIME); -+ } catch (InterruptedException e) { -+ break; -+ } -+ } -+ textField.onTypingFinished(); -+ SpoutClient.getInstance().getPacketManager().sendSpoutPacket(new PacketControlAction(screen, textField, textField.getText(), textField.getCursorPosition())); -+ } -+ -+ public synchronized void delay() { -+ sendTime = System.currentTimeMillis() + DELAY_TIME; -+ } -+ -+ public synchronized boolean expired() { -+ return sendTime <= System.currentTimeMillis(); -+ } -+ -+ public synchronized void start() { -+ (thread = new Thread(this)).start(); -+ } -+ -+ public synchronized boolean isAlive() { -+ return thread.isAlive(); -+ } -+} ---- /dev/null -+++ org/spoutcraft/api/inventory/InventoryBuilder.java -@@ -1,0 +1,30 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.api.inventory; -+ -+import java.util.Collection; -+ -+public interface InventoryBuilder { -+ public Inventory construct(ItemStack[] items, String name); -+ -+ public Inventory construct(Collection items, String name); -+ -+ public Inventory construct(int size, String name); -+} ---- /dev/null -+++ org/spoutcraft/client/ClipboardThread.java -@@ -1,0 +1,65 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.client; -+ -+import java.awt.Toolkit; -+import java.awt.datatransfer.DataFlavor; -+import java.awt.datatransfer.Transferable; -+import java.awt.datatransfer.UnsupportedFlavorException; -+import java.io.IOException; -+ -+import net.minecraft.src.EntityClientPlayerMP; -+ -+import org.spoutcraft.client.packet.PacketClipboardText; -+ -+public class ClipboardThread extends Thread { -+ public ClipboardThread(EntityClientPlayerMP player) { -+ this.player = player; -+ } -+ EntityClientPlayerMP player; -+ String prevClipboardText = ""; -+ public void run() { -+ while (!isInterrupted()) { -+ try { -+ sleep(1000); -+ } catch (InterruptedException e1) { -+ Thread.currentThread().interrupt(); -+ } -+ try { -+ Transferable contents = Toolkit.getDefaultToolkit().getSystemClipboard().getContents(null); -+ if (contents.isDataFlavorSupported(DataFlavor.stringFlavor)) { -+ String text = null; -+ try { -+ text = (String) contents.getTransferData(DataFlavor.stringFlavor); -+ } catch (UnsupportedFlavorException e) { -+ } catch (IOException e) { -+ } -+ if (text != null) { -+ if (!text.equals(prevClipboardText)) { -+ prevClipboardText = text; -+ SpoutClient.getInstance().getPacketManager().sendSpoutPacket(new PacketClipboardText(text)); -+ } -+ } -+ } -+ } catch (Exception e2) { -+ } -+ } -+ } -+} ---- /dev/null -+++ org/spoutcraft/api/material/item/GenericCustomItem.java -@@ -1,0 +1,126 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.api.material.item; -+ -+import java.io.IOException; -+ -+import org.spoutcraft.api.io.SpoutInputStream; -+import org.spoutcraft.api.io.SpoutOutputStream; -+import org.spoutcraft.api.material.CustomItem; -+import org.spoutcraft.api.material.MaterialData; -+import org.spoutcraft.api.util.UniqueItemStringMap; -+ -+public class GenericCustomItem implements CustomItem { -+ private String name; -+ private String fullName; -+ private String addon; -+ private int customId; -+ public String texture; -+ -+ /** -+ * Creates a GenericCustomItem with no values, used for serialization purposes only. -+ */ -+ public GenericCustomItem() { -+ } -+ -+ public GenericCustomItem(String addon, String name, int customId) { -+ this.name = name; -+ this.fullName = addon + name; -+ this.customId = customId; -+ this.addon = addon; -+ this.setName(name); -+ MaterialData.addCustomItem(this); -+ } -+ -+ public GenericCustomItem(String addon, String name) { -+ this(addon, name, UniqueItemStringMap.getId(addon + name)); -+ } -+ -+ public GenericCustomItem(String addon, String name, String texture) { -+ this(addon, name); -+ this.setTexture(texture); -+ } -+ -+ public int getRawId() { -+ return 318; // Flint -+ } -+ -+ public int getRawData() { -+ return customId; -+ } -+ -+ public boolean hasSubtypes() { -+ return true; -+ } -+ -+ public String getName() { -+ return name; -+ } -+ -+ public void setName(String name) { -+ this.name = name; -+ this.fullName = addon + name; -+ } -+ -+ public int getCustomId() { -+ return customId; -+ } -+ -+ public String getFullName() { -+ return fullName; -+ } -+ -+ public String getNotchianName() { -+ return getName(); -+ } -+ -+ public String getAddon() { -+ return addon; -+ } -+ -+ public CustomItem setTexture(String texture) { -+ this.texture = texture; -+ return this; -+ } -+ -+ public String getTexture() { -+ return texture; -+ } -+ -+ public void readData(SpoutInputStream input) throws IOException { -+ customId = input.readInt(); -+ name = input.readString(); -+ addon = input.readString(); -+ texture = input.readString(); -+ setName(name); -+ MaterialData.addCustomItem(this); -+ } -+ -+ public void writeData(SpoutOutputStream output) throws IOException { -+ output.write(customId); -+ output.writeString(getName()); -+ output.writeString(getAddon()); -+ output.writeString(getTexture()); -+ } -+ -+ public int getVersion() { -+ return 0; -+ } -+} ---- net/minecraft/src/EntityWitherAttackFilter.java -+++ net/minecraft/src/EntityWitherAttackFilter.java -@@ -1,7 +1,11 @@ - package net.minecraft.src; - - final class EntityWitherAttackFilter implements IEntitySelector { -- public boolean isEntityApplicable(Entity var1) { -- return var1 instanceof EntityLivingBase && ((EntityLivingBase)var1).getCreatureAttribute() != EnumCreatureAttribute.UNDEAD; -+ -+ /** -+ * Return whether the specified entity is applicable to this filter. -+ */ -+ public boolean isEntityApplicable(Entity par1Entity) { -+ return par1Entity instanceof EntityLivingBase && ((EntityLivingBase)par1Entity).getCreatureAttribute() != EnumCreatureAttribute.UNDEAD; - } - } ---- /dev/null -+++ com/prupe/mcpatcher/TessellatorUtils.java -@@ -1,0 +1,204 @@ -+package com.prupe.mcpatcher; -+ -+import java.lang.reflect.Field; -+import java.lang.reflect.Modifier; -+import java.util.ArrayList; -+import java.util.HashMap; -+import java.util.Iterator; -+import java.util.Map; -+import java.util.WeakHashMap; -+import net.minecraft.src.Icon; -+import net.minecraft.src.Tessellator; -+import net.minecraft.src.TextureMap; -+ -+public class TessellatorUtils { -+ private static final MCLogger logger = MCLogger.getLogger("Tilesheet"); -+ private static final Integer MAGIC_VALUE = Integer.valueOf(305419896); -+ private static final Map textureMapNames = new WeakHashMap(); -+ private static final Map iconMap = new HashMap(); -+ private static Field[] fieldsToCopy; -+ public static boolean haveBufferSize; -+ -+ public static void clearDefaultTextureMap(Tessellator tessellator) { -+ tessellator.textureMap = null; -+ } -+ -+ public static Tessellator getTessellator(Tessellator tessellator, Icon icon) { -+ TextureMap textureMap = (TextureMap)iconMap.get(icon); -+ -+ if (textureMap == null) { -+ return tessellator; -+ } else { -+ Tessellator newTessellator = (Tessellator)tessellator.children.get(textureMap); -+ -+ if (newTessellator == null) { -+ String mapName = (String)textureMapNames.get(textureMap); -+ -+ if (mapName == null) { -+ mapName = textureMap.toString(); -+ } -+ -+ logger.fine("new Tessellator for texture map %s gl texture %d", new Object[] {mapName, Integer.valueOf(textureMap.glTextureId)}); -+ newTessellator = new Tessellator(2097152); -+ copyFields(tessellator, newTessellator, true); -+ newTessellator.textureMap = textureMap; -+ tessellator.children.put(textureMap, newTessellator); -+ } else { -+ copyFields(tessellator, newTessellator, false); -+ } -+ -+ return newTessellator; -+ } -+ } -+ -+ static void registerTextureMap(TextureMap textureMap, String name) { -+ textureMapNames.put(textureMap, name); -+ } -+ -+ static void registerIcon(TextureMap textureMap, Icon icon) { -+ iconMap.put(icon, textureMap); -+ } -+ -+ private static Field[] getFieldsToCopy(Tessellator tessellator) { -+ int saveBufferSize; -+ -+ if (haveBufferSize) { -+ saveBufferSize = tessellator.bufferSize; -+ tessellator.bufferSize = MAGIC_VALUE.intValue(); -+ } else { -+ saveBufferSize = 0; -+ } -+ -+ int saveVertexCount = tessellator.vertexCount; -+ int saveAddedVertices = tessellator.addedVertices; -+ int saveRawBufferIndex = tessellator.rawBufferIndex; -+ tessellator.vertexCount = MAGIC_VALUE.intValue(); -+ tessellator.addedVertices = MAGIC_VALUE.intValue(); -+ tessellator.rawBufferIndex = MAGIC_VALUE.intValue(); -+ ArrayList fields = new ArrayList(); -+ Field[] arr$ = Tessellator.class.getDeclaredFields(); -+ int len$ = arr$.length; -+ -+ for (int i$ = 0; i$ < len$; ++i$) { -+ Field f = arr$[i$]; -+ -+ try { -+ Class e = f.getType(); -+ int modifiers = f.getModifiers(); -+ -+ if (!Modifier.isStatic(modifiers) && e.isPrimitive() && !f.getName().equals("rawBufferSize")) { -+ f.setAccessible(true); -+ -+ if (e != Integer.TYPE || !MAGIC_VALUE.equals(f.get(tessellator))) { -+ logger.finest("copy %s %s %s", new Object[] {Modifier.toString(f.getModifiers()), f.getType().toString(), f.getName()}); -+ fields.add(f); -+ } -+ } -+ } catch (Throwable var12) { -+ var12.printStackTrace(); -+ } -+ } -+ -+ if (!haveBufferSize) { -+ tessellator.bufferSize = saveBufferSize; -+ } -+ -+ tessellator.vertexCount = saveVertexCount; -+ tessellator.addedVertices = saveAddedVertices; -+ tessellator.rawBufferIndex = saveRawBufferIndex; -+ return (Field[])fields.toArray(new Field[fields.size()]); -+ } -+ -+ private static void copyFields(Tessellator a, Tessellator b, boolean isNew) { -+ if (fieldsToCopy == null) { -+ fieldsToCopy = getFieldsToCopy(a); -+ } -+ -+ Field[] arr$ = fieldsToCopy; -+ int len$ = arr$.length; -+ -+ for (int i$ = 0; i$ < len$; ++i$) { -+ Field field = arr$[i$]; -+ -+ try { -+ Object e = field.get(a); -+ -+ if (isNew) { -+ logger.finest("copy %s %s %s = %s", new Object[] {Modifier.toString(field.getModifiers()), field.getType(), field.getName(), e}); -+ } -+ -+ field.set(b, e); -+ } catch (IllegalAccessException var8) { -+ var8.printStackTrace(); -+ } -+ } -+ -+ if (a.isDrawing && !b.isDrawing) { -+ b.startDrawing(a.drawMode); -+ } else if (!a.isDrawing && b.isDrawing) { -+ b.reset(); -+ } -+ } -+ -+ static void clear(Tessellator tessellator) { -+ Iterator i$ = tessellator.children.values().iterator(); -+ -+ while (i$.hasNext()) { -+ Tessellator child = (Tessellator)i$.next(); -+ clear(child); -+ } -+ -+ tessellator.children.clear(); -+ textureMapNames.clear(); -+ iconMap.clear(); -+ } -+ -+ public static void resetChildren(Tessellator tessellator) { -+ Iterator i$ = tessellator.children.values().iterator(); -+ -+ while (i$.hasNext()) { -+ Tessellator child = (Tessellator)i$.next(); -+ child.reset(); -+ } -+ } -+ -+ public static int drawChildren(int sum, Tessellator tessellator) { -+ Tessellator child; -+ -+ for (Iterator i$ = tessellator.children.values().iterator(); i$.hasNext(); sum += child.draw()) { -+ child = (Tessellator)i$.next(); -+ } -+ -+ return sum; -+ } -+ -+ public static void startDrawingChildren(Tessellator tessellator, int drawMode) { -+ Iterator i$ = tessellator.children.values().iterator(); -+ -+ while (i$.hasNext()) { -+ Tessellator child = (Tessellator)i$.next(); -+ child.startDrawing(drawMode); -+ } -+ } -+ -+ private static String toString(Tessellator tessellator) { -+ if (tessellator == null) { -+ return "Tessellator{null}"; -+ } else { -+ String desc = tessellator.toString(); -+ TextureMap textureMap = tessellator.textureMap; -+ -+ if (textureMap != null) { -+ String mapName = (String)textureMapNames.get(textureMap); -+ -+ if (mapName == null) { -+ desc = textureMap.toString(); -+ } else { -+ desc = mapName; -+ } -+ } -+ -+ return String.format("Tessellator{%s, isDrawing=%s, %d children}", new Object[] {desc, Boolean.valueOf(tessellator.isDrawing), Integer.valueOf(tessellator.children.size())}); -+ } -+ } -+} ---- net/minecraft/src/EntityPlayerMP.java -+++ net/minecraft/src/EntityPlayerMP.java -@@ -12,82 +12,136 @@ - import net.minecraft.server.MinecraftServer; - - public class EntityPlayerMP extends EntityPlayer implements ICrafting { -- private String bN = "en_US"; -+ private String translator = "en_US"; -+ -+ /** -+ * The NetServerHandler assigned to this player by the ServerConfigurationManager. -+ */ - public NetServerHandler playerNetServerHandler; -- public MinecraftServer b; -+ -+ /** Reference to the MinecraftServer object. */ -+ public MinecraftServer mcServer; -+ -+ /** The ItemInWorldManager belonging to this player */ - public ItemInWorldManager theItemInWorldManager; -+ -+ /** player X position as seen by PlayerManager */ - public double managedPosX; -+ -+ /** player Z position as seen by PlayerManager */ - public double managedPosZ; -- public final List f = new LinkedList(); -- public final List g = new LinkedList(); -+ -+ /** LinkedList that holds the loaded chunks. */ -+ public final List loadedChunks = new LinkedList(); -+ -+ /** entities added to this list will be packet29'd to the player */ -+ public final List destroyedItemsNetCache = new LinkedList(); - private float field_130068_bO = Float.MIN_VALUE; -+ -+ /** set to getHealth */ - private float lastHealth = -1.0E8F; -+ -+ /** set to foodStats.GetFoodLevel */ - private int lastFoodLevel = -99999999; -+ -+ /** set to foodStats.getSaturationLevel() == 0.0F each tick */ - private boolean wasHungry = true; -+ -+ /** Amount of experience the client was last set to */ - private int lastExperience = -99999999; -- private int ticksOfInvuln = 60; -+ -+ /** de-increments onUpdate, attackEntityFrom is ignored if this >0 */ -+ private int initialInvulnerability = 60; -+ -+ /** must be between 3>x>15 (strictly between) */ - private int renderDistance; - private int chatVisibility; - private boolean chatColours = true; - private long field_143005_bX = 0L; -+ -+ /** -+ * The currently in use window ID. Incremented every time a window is opened. -+ */ - private int currentWindowId; -- public boolean isChangingQuantityOnly; -+ -+ /** -+ * poor mans concurency flag, lets hope the jvm doesn't re-order the setting of this flag wrt the inventory change on -+ * the next line -+ */ -+ public boolean playerInventoryBeingManipulated; - public int ping; -+ -+ /** -+ * Set when a player beats the ender dragon, used to respawn the player at the spawn point while retaining inventory -+ * and XP -+ */ - public boolean playerConqueredTheEnd; - -- public EntityPlayerMP(MinecraftServer var1, World var2, String var3, ItemInWorldManager var4) { -- super(var2, var3); -- var4.thisPlayerMP = this; -- this.theItemInWorldManager = var4; -- this.renderDistance = var1.getConfigurationManager().getViewDistance(); -- ChunkCoordinates var5 = var2.getSpawnPoint(); -+ public EntityPlayerMP(MinecraftServer par1MinecraftServer, World par2World, String par3Str, ItemInWorldManager par4ItemInWorldManager) { -+ super(par2World, par3Str); -+ par4ItemInWorldManager.thisPlayerMP = this; -+ this.theItemInWorldManager = par4ItemInWorldManager; -+ this.renderDistance = par1MinecraftServer.getConfigurationManager().getViewDistance(); -+ ChunkCoordinates var5 = par2World.getSpawnPoint(); - int var6 = var5.posX; - int var7 = var5.posZ; - int var8 = var5.posY; -- if(!var2.provider.hasNoSky && var2.getWorldInfo().getGameType() != EnumGameType.ADVENTURE) { -- int var9 = Math.max(5, var1.getSpawnProtectionSize() - 6); -- var6 += this.ab.nextInt(var9 * 2) - var9; -- var7 += this.ab.nextInt(var9 * 2) - var9; -- var8 = var2.getTopSolidOrLiquidBlock(var6, var7); -+ -+ if (!par2World.provider.hasNoSky && par2World.getWorldInfo().getGameType() != EnumGameType.ADVENTURE) { -+ int var9 = Math.max(5, par1MinecraftServer.getSpawnProtectionSize() - 6); -+ var6 += this.rand.nextInt(var9 * 2) - var9; -+ var7 += this.rand.nextInt(var9 * 2) - var9; -+ var8 = par2World.getTopSolidOrLiquidBlock(var6, var7); - } - -- this.b = var1; -+ this.mcServer = par1MinecraftServer; - this.stepHeight = 0.0F; - this.yOffset = 0.0F; - this.setLocationAndAngles((double)var6 + 0.5D, (double)var8, (double)var7 + 0.5D, 0.0F, 0.0F); - -- while(!var2.getCollidingBoundingBoxes(this, this.boundingBox).isEmpty()) { -+ while (!par2World.getCollidingBoundingBoxes(this, this.boundingBox).isEmpty()) { - this.setPosition(this.posX, this.posY + 1.0D, this.posZ); - } -- - } - -- public void readEntityFromNBT(NBTTagCompound var1) { -- super.readEntityFromNBT(var1); -- if(var1.hasKey("playerGameType")) { -- if(MinecraftServer.getServer().getForceGamemode()) { -+ /** -+ * (abstract) Protected helper method to read subclass entity data from NBT. -+ */ -+ public void readEntityFromNBT(NBTTagCompound par1NBTTagCompound) { -+ super.readEntityFromNBT(par1NBTTagCompound); -+ -+ if (par1NBTTagCompound.hasKey("playerGameType")) { -+ if (MinecraftServer.getServer().getForceGamemode()) { - this.theItemInWorldManager.setGameType(MinecraftServer.getServer().getGameType()); - } else { -- this.theItemInWorldManager.setGameType(EnumGameType.getByID(var1.getInteger("playerGameType"))); -+ this.theItemInWorldManager.setGameType(EnumGameType.getByID(par1NBTTagCompound.getInteger("playerGameType"))); - } - } -- -- } -- -- public void writeEntityToNBT(NBTTagCompound var1) { -- super.writeEntityToNBT(var1); -- var1.setInteger("playerGameType", this.theItemInWorldManager.getGameType().getID()); -- } -- -- public void addExperienceLevel(int var1) { -- super.addExperienceLevel(var1); -+ } -+ -+ /** -+ * (abstract) Protected helper method to write subclass entity data to NBT. -+ */ -+ public void writeEntityToNBT(NBTTagCompound par1NBTTagCompound) { -+ super.writeEntityToNBT(par1NBTTagCompound); -+ par1NBTTagCompound.setInteger("playerGameType", this.theItemInWorldManager.getGameType().getID()); -+ } -+ -+ /** -+ * Add experience levels to this player. -+ */ -+ public void addExperienceLevel(int par1) { -+ super.addExperienceLevel(par1); - this.lastExperience = -1; - } - - public void addSelfToInternalCraftingInventory() { -- this.openContainer.onCraftGuiOpened(this); -+ this.openContainer.addCraftingToCrafters(this); - } - -+ /** -+ * sets the players height back to normal after doing things like sleeping and dieing -+ */ - protected void resetHeight() { - this.yOffset = 0.0F; - } -@@ -96,104 +150,109 @@ - return 1.62F; - } - -+ /** -+ * Called to update the entity's position/logic. -+ */ - public void onUpdate() { - this.theItemInWorldManager.updateBlockRemoving(); -- --this.ticksOfInvuln; -+ --this.initialInvulnerability; - this.openContainer.detectAndSendChanges(); -- if(!this.worldObj.isRemote && !this.openContainer.canInteractWith(this)) { -+ -+ if (!this.worldObj.isRemote && !this.openContainer.canInteractWith(this)) { - this.closeScreen(); - this.openContainer = this.inventoryContainer; - } - -- while(!this.g.isEmpty()) { -- int var1 = Math.min(this.g.size(), 127); -+ while (!this.destroyedItemsNetCache.isEmpty()) { -+ int var1 = Math.min(this.destroyedItemsNetCache.size(), 127); - int[] var2 = new int[var1]; -- Iterator var3 = this.g.iterator(); -+ Iterator var3 = this.destroyedItemsNetCache.iterator(); - int var4 = 0; - -- while(var3.hasNext() && var4 < var1) { -+ while (var3.hasNext() && var4 < var1) { - var2[var4++] = ((Integer)var3.next()).intValue(); - var3.remove(); - } - -- this.playerNetServerHandler.sendPacket(new Packet29DestroyEntity(var2)); -+ this.playerNetServerHandler.sendPacketToPlayer(new Packet29DestroyEntity(var2)); - } - -- if(!this.f.isEmpty()) { -+ if (!this.loadedChunks.isEmpty()) { - ArrayList var6 = new ArrayList(); -- Iterator var7 = this.f.iterator(); -+ Iterator var7 = this.loadedChunks.iterator(); - ArrayList var8 = new ArrayList(); - -- while(var7.hasNext() && var6.size() < 5) { -+ while (var7.hasNext() && var6.size() < 5) { - ChunkCoordIntPair var9 = (ChunkCoordIntPair)var7.next(); - var7.remove(); -- if(var9 != null && this.worldObj.blockExists(var9.chunkXPos << 4, 0, var9.chunkZPos << 4)) { -+ -+ if (var9 != null && this.worldObj.blockExists(var9.chunkXPos << 4, 0, var9.chunkZPos << 4)) { - var6.add(this.worldObj.getChunkFromChunkCoords(var9.chunkXPos, var9.chunkZPos)); -- var8.addAll(((WorldServer)this.worldObj).getTileEntityList(var9.chunkXPos * 16, 0, var9.chunkZPos * 16, var9.chunkXPos * 16 + 16, 256, var9.chunkZPos * 16 + 16)); -+ var8.addAll(((WorldServer)this.worldObj).getAllTileEntityInBox(var9.chunkXPos * 16, 0, var9.chunkZPos * 16, var9.chunkXPos * 16 + 16, 256, var9.chunkZPos * 16 + 16)); - } - } - -- if(!var6.isEmpty()) { -- this.playerNetServerHandler.sendPacket(new Packet56MapChunks(var6)); -+ if (!var6.isEmpty()) { -+ this.playerNetServerHandler.sendPacketToPlayer(new Packet56MapChunks(var6)); - Iterator var10 = var8.iterator(); - -- while(var10.hasNext()) { -+ while (var10.hasNext()) { - TileEntity var5 = (TileEntity)var10.next(); -- this.getTileEntityInfo(var5); -+ this.sendTileEntityToPlayer(var5); - } - - var10 = var6.iterator(); - -- while(var10.hasNext()) { -+ while (var10.hasNext()) { - Chunk var11 = (Chunk)var10.next(); - this.getServerForPlayer().getEntityTracker().func_85172_a(this, var11); - } - } - } - -- if(this.field_143005_bX > 0L && this.b.func_143007_ar() > 0 && MinecraftServer.getCurrentTimeMillis() - this.field_143005_bX > (long)(this.b.func_143007_ar() * 1000 * 60)) { -- this.playerNetServerHandler.kickPlayer("You have been idle for too long!"); -+ if (this.field_143005_bX > 0L && this.mcServer.func_143007_ar() > 0 && MinecraftServer.getSystemTimeMillis() - this.field_143005_bX > (long)(this.mcServer.func_143007_ar() * 1000 * 60)) { -+ this.playerNetServerHandler.kickPlayerFromServer("You have been idle for too long!"); - } -- - } - - public void onUpdateEntity() { - try { - super.onUpdate(); - -- for(int var1 = 0; var1 < this.inventory.getSizeInventory(); ++var1) { -+ for (int var1 = 0; var1 < this.inventory.getSizeInventory(); ++var1) { - ItemStack var6 = this.inventory.getStackInSlot(var1); -- if(var6 != null && Item.itemsList[var6.itemID].isMap() && this.playerNetServerHandler.getNumChunkDataPackets() <= 5) { -- Packet var8 = ((ItemMapBase)Item.itemsList[var6.itemID]).getUpdatePacket(var6, this.worldObj, this); -- if(var8 != null) { -- this.playerNetServerHandler.sendPacket(var8); -+ -+ if (var6 != null && Item.itemsList[var6.itemID].isMap() && this.playerNetServerHandler.packetSize() <= 5) { -+ Packet var8 = ((ItemMapBase)Item.itemsList[var6.itemID]).createMapDataPacket(var6, this.worldObj, this); -+ -+ if (var8 != null) { -+ this.playerNetServerHandler.sendPacketToPlayer(var8); - } - } - } - -- if(this.getHealth() != this.lastHealth || this.lastFoodLevel != this.foodStats.getFoodLevel() || this.foodStats.getSaturationLevel() == 0.0F != this.wasHungry) { -- this.playerNetServerHandler.sendPacket(new Packet8UpdateHealth(this.getHealth(), this.foodStats.getFoodLevel(), this.foodStats.getSaturationLevel())); -+ if (this.getHealth() != this.lastHealth || this.lastFoodLevel != this.foodStats.getFoodLevel() || this.foodStats.getSaturationLevel() == 0.0F != this.wasHungry) { -+ this.playerNetServerHandler.sendPacketToPlayer(new Packet8UpdateHealth(this.getHealth(), this.foodStats.getFoodLevel(), this.foodStats.getSaturationLevel())); - this.lastHealth = this.getHealth(); - this.lastFoodLevel = this.foodStats.getFoodLevel(); - this.wasHungry = this.foodStats.getSaturationLevel() == 0.0F; - } - -- if(this.getHealth() + this.getAbsorptionAmount() != this.field_130068_bO) { -+ if (this.getHealth() + this.getAbsorptionAmount() != this.field_130068_bO) { - this.field_130068_bO = this.getHealth() + this.getAbsorptionAmount(); - Collection var5 = this.getWorldScoreboard().func_96520_a(ScoreObjectiveCriteria.health); - Iterator var7 = var5.iterator(); - -- while(var7.hasNext()) { -+ while (var7.hasNext()) { - ScoreObjective var9 = (ScoreObjective)var7.next(); -- this.getWorldScoreboard().func_96529_a(this.getEntityName(), var9).func_96651_a(Arrays.asList(new EntityPlayer[]{this})); -+ this.getWorldScoreboard().func_96529_a(this.getEntityName(), var9).func_96651_a(Arrays.asList(new EntityPlayer[] {this})); - } - } - -- if(this.experienceTotal != this.lastExperience) { -+ if (this.experienceTotal != this.lastExperience) { - this.lastExperience = this.experienceTotal; -- this.playerNetServerHandler.sendPacket(new Packet43Experience(this.experience, this.experienceTotal, this.experienceLevel)); -+ this.playerNetServerHandler.sendPacketToPlayer(new Packet43Experience(this.experience, this.experienceTotal, this.experienceLevel)); - } -- - } catch (Throwable var4) { - CrashReport var2 = CrashReport.makeCrashReport(var4, "Ticking player"); - CrashReportCategory var3 = var2.makeCategory("Player being ticked"); -@@ -202,401 +261,504 @@ - } - } - -- public void onDeath(DamageSource var1) { -- this.b.getConfigurationManager().sendChatMsg(this.func_110142_aN().func_94546_b()); -- if(!this.worldObj.getGameRules().getGameRuleBooleanValue("keepInventory")) { -+ /** -+ * Called when the mob's health reaches 0. -+ */ -+ public void onDeath(DamageSource par1DamageSource) { -+ this.mcServer.getConfigurationManager().sendChatMsg(this.func_110142_aN().func_94546_b()); -+ -+ if (!this.worldObj.getGameRules().getGameRuleBooleanValue("keepInventory")) { - this.inventory.dropAllItems(); - } - - Collection var2 = this.worldObj.getScoreboard().func_96520_a(ScoreObjectiveCriteria.deathCount); - Iterator var3 = var2.iterator(); - -- while(var3.hasNext()) { -+ while (var3.hasNext()) { - ScoreObjective var4 = (ScoreObjective)var3.next(); - Score var5 = this.getWorldScoreboard().func_96529_a(this.getEntityName(), var4); - var5.func_96648_a(); - } - - EntityLivingBase var6 = this.func_94060_bK(); -- if(var6 != null) { -+ -+ if (var6 != null) { - var6.addToPlayerScore(this, this.scoreValue); - } - - this.addStat(StatList.deathsStat, 1); - } - -- public boolean attackEntityFrom(DamageSource var1, float var2) { -- if(this.isEntityInvulnerable()) { -+ /** -+ * Called when the entity is attacked. -+ */ -+ public boolean attackEntityFrom(DamageSource par1DamageSource, float par2) { -+ if (this.isEntityInvulnerable()) { - return false; - } else { -- boolean var3 = this.b.isDedicatedServer() && this.b.isPVPEnabled() && "fall".equals(var1.o); -- if(!var3 && this.ticksOfInvuln > 0 && var1 != DamageSource.outOfWorld) { -+ boolean var3 = this.mcServer.isDedicatedServer() && this.mcServer.isPVPEnabled() && "fall".equals(par1DamageSource.damageType); -+ -+ if (!var3 && this.initialInvulnerability > 0 && par1DamageSource != DamageSource.outOfWorld) { - return false; - } else { -- if(var1 instanceof EntityDamageSource) { -- Entity var4 = var1.getEntity(); -- if(var4 instanceof EntityPlayer && !this.canAttackPlayer((EntityPlayer)var4)) { -+ if (par1DamageSource instanceof EntityDamageSource) { -+ Entity var4 = par1DamageSource.getEntity(); -+ -+ if (var4 instanceof EntityPlayer && !this.canAttackPlayer((EntityPlayer)var4)) { - return false; - } - -- if(var4 instanceof EntityArrow) { -+ if (var4 instanceof EntityArrow) { - EntityArrow var5 = (EntityArrow)var4; -- if(var5.shootingEntity instanceof EntityPlayer && !this.canAttackPlayer((EntityPlayer)var5.shootingEntity)) { -+ -+ if (var5.shootingEntity instanceof EntityPlayer && !this.canAttackPlayer((EntityPlayer)var5.shootingEntity)) { - return false; - } - } - } - -- return super.attackEntityFrom(var1, var2); -+ return super.attackEntityFrom(par1DamageSource, par2); - } - } - } - -- public boolean canAttackPlayer(EntityPlayer var1) { -- return !this.b.isPVPEnabled() ? false : super.canAttackPlayer(var1); -+ public boolean canAttackPlayer(EntityPlayer par1EntityPlayer) { -+ return !this.mcServer.isPVPEnabled() ? false : super.canAttackPlayer(par1EntityPlayer); - } - -- public void travelToDimension(int var1) { -- if(this.dimension == 1 && var1 == 1) { -+ /** -+ * Teleports the entity to another dimension. Params: Dimension number to teleport to -+ */ -+ public void travelToDimension(int par1) { -+ if (this.dimension == 1 && par1 == 1) { - this.triggerAchievement(AchievementList.theEnd2); - this.worldObj.removeEntity(this); - this.playerConqueredTheEnd = true; -- this.playerNetServerHandler.sendPacket(new Packet70GameEvent(4, 0)); -+ this.playerNetServerHandler.sendPacketToPlayer(new Packet70GameEvent(4, 0)); - } else { -- if(this.dimension == 0 && var1 == 1) { -+ if (this.dimension == 0 && par1 == 1) { - this.triggerAchievement(AchievementList.theEnd); -- ChunkCoordinates var2 = this.b.worldServerForDimension(var1).getEntrancePortalLocation(); -- if(var2 != null) { -+ ChunkCoordinates var2 = this.mcServer.worldServerForDimension(par1).getEntrancePortalLocation(); -+ -+ if (var2 != null) { - this.playerNetServerHandler.setPlayerLocation((double)var2.posX, (double)var2.posY, (double)var2.posZ, 0.0F, 0.0F); - } - -- var1 = 1; -+ par1 = 1; - } else { - this.triggerAchievement(AchievementList.portal); - } - -- this.b.getConfigurationManager().transferPlayerToDimension(this, var1); -+ this.mcServer.getConfigurationManager().transferPlayerToDimension(this, par1); - this.lastExperience = -1; - this.lastHealth = -1.0F; - this.lastFoodLevel = -1; - } -- - } - -- private void getTileEntityInfo(TileEntity var1) { -- if(var1 != null) { -- Packet var2 = var1.getDescriptionPacket(); -- if(var2 != null) { -- this.playerNetServerHandler.sendPacket(var2); -+ /** -+ * called from onUpdate for all tileEntity in specific chunks -+ */ -+ private void sendTileEntityToPlayer(TileEntity par1TileEntity) { -+ if (par1TileEntity != null) { -+ Packet var2 = par1TileEntity.getDescriptionPacket(); -+ -+ if (var2 != null) { -+ this.playerNetServerHandler.sendPacketToPlayer(var2); - } - } -- - } - -- public void onItemPickup(Entity var1, int var2) { -- super.onItemPickup(var1, var2); -+ /** -+ * Called whenever an item is picked up from walking over it. Args: pickedUpEntity, stackSize -+ */ -+ public void onItemPickup(Entity par1Entity, int par2) { -+ super.onItemPickup(par1Entity, par2); - this.openContainer.detectAndSendChanges(); - } - -- public EnumStatus sleepInBedAt(int var1, int var2, int var3) { -- EnumStatus var4 = super.sleepInBedAt(var1, var2, var3); -- if(var4 == EnumStatus.OK) { -- Packet17Sleep var5 = new Packet17Sleep(this, 0, var1, var2, var3); -- this.getServerForPlayer().getEntityTracker().sendPacketToTrackedPlayers(this, var5); -+ /** -+ * Attempts to have the player sleep in a bed at the specified location. -+ */ -+ public EnumStatus sleepInBedAt(int par1, int par2, int par3) { -+ EnumStatus var4 = super.sleepInBedAt(par1, par2, par3); -+ -+ if (var4 == EnumStatus.OK) { -+ Packet17Sleep var5 = new Packet17Sleep(this, 0, par1, par2, par3); -+ this.getServerForPlayer().getEntityTracker().sendPacketToAllPlayersTrackingEntity(this, var5); - this.playerNetServerHandler.setPlayerLocation(this.posX, this.posY, this.posZ, this.rotationYaw, this.rotationPitch); -- this.playerNetServerHandler.sendPacket(var5); -+ this.playerNetServerHandler.sendPacketToPlayer(var5); - } - - return var4; - } - -- public void wakeUpPlayer(boolean var1, boolean var2, boolean var3) { -- if(this.isPlayerSleeping()) { -- this.getServerForPlayer().getEntityTracker().sendPacketToTrackedPlayersAndTrackedEntity(this, new Packet18Animation(this, 3)); -+ /** -+ * Wake up the player if they're sleeping. -+ */ -+ public void wakeUpPlayer(boolean par1, boolean par2, boolean par3) { -+ if (this.isPlayerSleeping()) { -+ this.getServerForPlayer().getEntityTracker().sendPacketToAllAssociatedPlayers(this, new Packet18Animation(this, 3)); - } - -- super.wakeUpPlayer(var1, var2, var3); -- if(this.playerNetServerHandler != null) { -+ super.wakeUpPlayer(par1, par2, par3); -+ -+ if (this.playerNetServerHandler != null) { - this.playerNetServerHandler.setPlayerLocation(this.posX, this.posY, this.posZ, this.rotationYaw, this.rotationPitch); - } -- - } - -- public void mountEntity(Entity var1) { -- super.mountEntity(var1); -- this.playerNetServerHandler.sendPacket(new Packet39AttachEntity(0, this, this.ridingEntity)); -+ /** -+ * Called when a player mounts an entity. e.g. mounts a pig, mounts a boat. -+ */ -+ public void mountEntity(Entity par1Entity) { -+ super.mountEntity(par1Entity); -+ this.playerNetServerHandler.sendPacketToPlayer(new Packet39AttachEntity(0, this, this.ridingEntity)); - this.playerNetServerHandler.setPlayerLocation(this.posX, this.posY, this.posZ, this.rotationYaw, this.rotationPitch); - } - -- protected void updateFallState(double var1, boolean var3) { -- } -- -- public void handleFalling(double var1, boolean var3) { -- super.updateFallState(var1, var3); -- } -- -- public void displayGUIEditSign(TileEntity var1) { -- if(var1 instanceof TileEntitySign) { -- ((TileEntitySign)var1).func_142010_a(this); -- this.playerNetServerHandler.sendPacket(new Packet133TileEditorOpen(0, var1.xCoord, var1.yCoord, var1.zCoord)); -+ /** -+ * Takes in the distance the entity has fallen this tick and whether its on the ground to update the fall distance and -+ * deal fall damage if landing on the ground. Args: distanceFallenThisTick, onGround -+ */ -+ protected void updateFallState(double par1, boolean par3) {} -+ -+ /** -+ * likeUpdateFallState, but called from updateFlyingState, rather than moveEntity -+ */ -+ public void updateFlyingState(double par1, boolean par3) { -+ super.updateFallState(par1, par3); -+ } -+ -+ /** -+ * Displays the GUI for editing a sign. Args: tileEntitySign -+ */ -+ public void displayGUIEditSign(TileEntity par1TileEntity) { -+ if (par1TileEntity instanceof TileEntitySign) { -+ ((TileEntitySign)par1TileEntity).func_142010_a(this); -+ this.playerNetServerHandler.sendPacketToPlayer(new Packet133TileEditorOpen(0, par1TileEntity.xCoord, par1TileEntity.yCoord, par1TileEntity.zCoord)); - } -- - } - -- private void getNextWindowId() { -+ private void incrementWindowID() { - this.currentWindowId = this.currentWindowId % 100 + 1; - } - -- public void displayGUIWorkbench(int var1, int var2, int var3) { -- this.getNextWindowId(); -- this.playerNetServerHandler.sendPacket(new Packet100OpenWindow(this.currentWindowId, 1, "Crafting", 9, true)); -- this.openContainer = new ContainerWorkbench(this.inventory, this.worldObj, var1, var2, var3); -- this.openContainer.windowId = this.currentWindowId; -- this.openContainer.onCraftGuiOpened(this); -- } -- -- public void displayGUIEnchantment(int var1, int var2, int var3, String var4) { -- this.getNextWindowId(); -- this.playerNetServerHandler.sendPacket(new Packet100OpenWindow(this.currentWindowId, 4, var4 == null ? "" : var4, 9, var4 != null)); -- this.openContainer = new ContainerEnchantment(this.inventory, this.worldObj, var1, var2, var3); -- this.openContainer.windowId = this.currentWindowId; -- this.openContainer.onCraftGuiOpened(this); -- } -- -- public void displayGUIAnvil(int var1, int var2, int var3) { -- this.getNextWindowId(); -- this.playerNetServerHandler.sendPacket(new Packet100OpenWindow(this.currentWindowId, 8, "Repairing", 9, true)); -- this.openContainer = new ContainerRepair(this.inventory, this.worldObj, var1, var2, var3, this); -- this.openContainer.windowId = this.currentWindowId; -- this.openContainer.onCraftGuiOpened(this); -- } -- -- public void displayGUIChest(IInventory var1) { -- if(this.openContainer != this.inventoryContainer) { -+ /** -+ * Displays the crafting GUI for a workbench. -+ */ -+ public void displayGUIWorkbench(int par1, int par2, int par3) { -+ this.incrementWindowID(); -+ this.playerNetServerHandler.sendPacketToPlayer(new Packet100OpenWindow(this.currentWindowId, 1, "Crafting", 9, true)); -+ this.openContainer = new ContainerWorkbench(this.inventory, this.worldObj, par1, par2, par3); -+ this.openContainer.windowId = this.currentWindowId; -+ this.openContainer.addCraftingToCrafters(this); -+ } -+ -+ public void displayGUIEnchantment(int par1, int par2, int par3, String par4Str) { -+ this.incrementWindowID(); -+ this.playerNetServerHandler.sendPacketToPlayer(new Packet100OpenWindow(this.currentWindowId, 4, par4Str == null ? "" : par4Str, 9, par4Str != null)); -+ this.openContainer = new ContainerEnchantment(this.inventory, this.worldObj, par1, par2, par3); -+ this.openContainer.windowId = this.currentWindowId; -+ this.openContainer.addCraftingToCrafters(this); -+ } -+ -+ /** -+ * Displays the GUI for interacting with an anvil. -+ */ -+ public void displayGUIAnvil(int par1, int par2, int par3) { -+ this.incrementWindowID(); -+ this.playerNetServerHandler.sendPacketToPlayer(new Packet100OpenWindow(this.currentWindowId, 8, "Repairing", 9, true)); -+ this.openContainer = new ContainerRepair(this.inventory, this.worldObj, par1, par2, par3, this); -+ this.openContainer.windowId = this.currentWindowId; -+ this.openContainer.addCraftingToCrafters(this); -+ } -+ -+ /** -+ * Displays the GUI for interacting with a chest inventory. Args: chestInventory -+ */ -+ public void displayGUIChest(IInventory par1IInventory) { -+ if (this.openContainer != this.inventoryContainer) { - this.closeScreen(); - } - -- this.getNextWindowId(); -- this.playerNetServerHandler.sendPacket(new Packet100OpenWindow(this.currentWindowId, 0, var1.getInvName(), var1.getSizeInventory(), var1.isInvNameLocalized())); -- this.openContainer = new ContainerChest(this.inventory, var1); -- this.openContainer.windowId = this.currentWindowId; -- this.openContainer.onCraftGuiOpened(this); -- } -- -- public void displayGUIHopper(TileEntityHopper var1) { -- this.getNextWindowId(); -- this.playerNetServerHandler.sendPacket(new Packet100OpenWindow(this.currentWindowId, 9, var1.getInvName(), var1.getSizeInventory(), var1.isInvNameLocalized())); -- this.openContainer = new ContainerHopper(this.inventory, var1); -- this.openContainer.windowId = this.currentWindowId; -- this.openContainer.onCraftGuiOpened(this); -- } -- -- public void displayGUIHopperMinecart(EntityMinecartHopper var1) { -- this.getNextWindowId(); -- this.playerNetServerHandler.sendPacket(new Packet100OpenWindow(this.currentWindowId, 9, var1.getInvName(), var1.getSizeInventory(), var1.isInvNameLocalized())); -- this.openContainer = new ContainerHopper(this.inventory, var1); -- this.openContainer.windowId = this.currentWindowId; -- this.openContainer.onCraftGuiOpened(this); -- } -- -- public void displayGUIFurnace(TileEntityFurnace var1) { -- this.getNextWindowId(); -- this.playerNetServerHandler.sendPacket(new Packet100OpenWindow(this.currentWindowId, 2, var1.getInvName(), var1.getSizeInventory(), var1.isInvNameLocalized())); -- this.openContainer = new ContainerFurnace(this.inventory, var1); -- this.openContainer.windowId = this.currentWindowId; -- this.openContainer.onCraftGuiOpened(this); -- } -- -- public void displayGUIDispenser(TileEntityDispenser var1) { -- this.getNextWindowId(); -- this.playerNetServerHandler.sendPacket(new Packet100OpenWindow(this.currentWindowId, var1 instanceof TileEntityDropper ? 10 : 3, var1.getInvName(), var1.getSizeInventory(), var1.isInvNameLocalized())); -- this.openContainer = new ContainerDispenser(this.inventory, var1); -- this.openContainer.windowId = this.currentWindowId; -- this.openContainer.onCraftGuiOpened(this); -- } -- -- public void displayGUIBrewingStand(TileEntityBrewingStand var1) { -- this.getNextWindowId(); -- this.playerNetServerHandler.sendPacket(new Packet100OpenWindow(this.currentWindowId, 5, var1.getInvName(), var1.getSizeInventory(), var1.isInvNameLocalized())); -- this.openContainer = new ContainerBrewingStand(this.inventory, var1); -- this.openContainer.windowId = this.currentWindowId; -- this.openContainer.onCraftGuiOpened(this); -- } -- -- public void displayGUIBeacon(TileEntityBeacon var1) { -- this.getNextWindowId(); -- this.playerNetServerHandler.sendPacket(new Packet100OpenWindow(this.currentWindowId, 7, var1.getInvName(), var1.getSizeInventory(), var1.isInvNameLocalized())); -- this.openContainer = new ContainerBeacon(this.inventory, var1); -- this.openContainer.windowId = this.currentWindowId; -- this.openContainer.onCraftGuiOpened(this); -- } -- -- public void displayGUIMerchant(IMerchant var1, String var2) { -- this.getNextWindowId(); -- this.openContainer = new ContainerMerchant(this.inventory, var1, this.worldObj); -- this.openContainer.windowId = this.currentWindowId; -- this.openContainer.onCraftGuiOpened(this); -+ this.incrementWindowID(); -+ this.playerNetServerHandler.sendPacketToPlayer(new Packet100OpenWindow(this.currentWindowId, 0, par1IInventory.getInvName(), par1IInventory.getSizeInventory(), par1IInventory.isInvNameLocalized())); -+ this.openContainer = new ContainerChest(this.inventory, par1IInventory); -+ this.openContainer.windowId = this.currentWindowId; -+ this.openContainer.addCraftingToCrafters(this); -+ } -+ -+ public void displayGUIHopper(TileEntityHopper par1TileEntityHopper) { -+ this.incrementWindowID(); -+ this.playerNetServerHandler.sendPacketToPlayer(new Packet100OpenWindow(this.currentWindowId, 9, par1TileEntityHopper.getInvName(), par1TileEntityHopper.getSizeInventory(), par1TileEntityHopper.isInvNameLocalized())); -+ this.openContainer = new ContainerHopper(this.inventory, par1TileEntityHopper); -+ this.openContainer.windowId = this.currentWindowId; -+ this.openContainer.addCraftingToCrafters(this); -+ } -+ -+ public void displayGUIHopperMinecart(EntityMinecartHopper par1EntityMinecartHopper) { -+ this.incrementWindowID(); -+ this.playerNetServerHandler.sendPacketToPlayer(new Packet100OpenWindow(this.currentWindowId, 9, par1EntityMinecartHopper.getInvName(), par1EntityMinecartHopper.getSizeInventory(), par1EntityMinecartHopper.isInvNameLocalized())); -+ this.openContainer = new ContainerHopper(this.inventory, par1EntityMinecartHopper); -+ this.openContainer.windowId = this.currentWindowId; -+ this.openContainer.addCraftingToCrafters(this); -+ } -+ -+ /** -+ * Displays the furnace GUI for the passed in furnace entity. Args: tileEntityFurnace -+ */ -+ public void displayGUIFurnace(TileEntityFurnace par1TileEntityFurnace) { -+ this.incrementWindowID(); -+ this.playerNetServerHandler.sendPacketToPlayer(new Packet100OpenWindow(this.currentWindowId, 2, par1TileEntityFurnace.getInvName(), par1TileEntityFurnace.getSizeInventory(), par1TileEntityFurnace.isInvNameLocalized())); -+ this.openContainer = new ContainerFurnace(this.inventory, par1TileEntityFurnace); -+ this.openContainer.windowId = this.currentWindowId; -+ this.openContainer.addCraftingToCrafters(this); -+ } -+ -+ /** -+ * Displays the dipsenser GUI for the passed in dispenser entity. Args: TileEntityDispenser -+ */ -+ public void displayGUIDispenser(TileEntityDispenser par1TileEntityDispenser) { -+ this.incrementWindowID(); -+ this.playerNetServerHandler.sendPacketToPlayer(new Packet100OpenWindow(this.currentWindowId, par1TileEntityDispenser instanceof TileEntityDropper ? 10 : 3, par1TileEntityDispenser.getInvName(), par1TileEntityDispenser.getSizeInventory(), par1TileEntityDispenser.isInvNameLocalized())); -+ this.openContainer = new ContainerDispenser(this.inventory, par1TileEntityDispenser); -+ this.openContainer.windowId = this.currentWindowId; -+ this.openContainer.addCraftingToCrafters(this); -+ } -+ -+ /** -+ * Displays the GUI for interacting with a brewing stand. -+ */ -+ public void displayGUIBrewingStand(TileEntityBrewingStand par1TileEntityBrewingStand) { -+ this.incrementWindowID(); -+ this.playerNetServerHandler.sendPacketToPlayer(new Packet100OpenWindow(this.currentWindowId, 5, par1TileEntityBrewingStand.getInvName(), par1TileEntityBrewingStand.getSizeInventory(), par1TileEntityBrewingStand.isInvNameLocalized())); -+ this.openContainer = new ContainerBrewingStand(this.inventory, par1TileEntityBrewingStand); -+ this.openContainer.windowId = this.currentWindowId; -+ this.openContainer.addCraftingToCrafters(this); -+ } -+ -+ /** -+ * Displays the GUI for interacting with a beacon. -+ */ -+ public void displayGUIBeacon(TileEntityBeacon par1TileEntityBeacon) { -+ this.incrementWindowID(); -+ this.playerNetServerHandler.sendPacketToPlayer(new Packet100OpenWindow(this.currentWindowId, 7, par1TileEntityBeacon.getInvName(), par1TileEntityBeacon.getSizeInventory(), par1TileEntityBeacon.isInvNameLocalized())); -+ this.openContainer = new ContainerBeacon(this.inventory, par1TileEntityBeacon); -+ this.openContainer.windowId = this.currentWindowId; -+ this.openContainer.addCraftingToCrafters(this); -+ } -+ -+ public void displayGUIMerchant(IMerchant par1IMerchant, String par2Str) { -+ this.incrementWindowID(); -+ this.openContainer = new ContainerMerchant(this.inventory, par1IMerchant, this.worldObj); -+ this.openContainer.windowId = this.currentWindowId; -+ this.openContainer.addCraftingToCrafters(this); - InventoryMerchant var3 = ((ContainerMerchant)this.openContainer).getMerchantInventory(); -- this.playerNetServerHandler.sendPacket(new Packet100OpenWindow(this.currentWindowId, 6, var2 == null ? "" : var2, var3.getSizeInventory(), var2 != null)); -- MerchantRecipeList var4 = var1.getRecipes(this); -- if(var4 != null) { -+ this.playerNetServerHandler.sendPacketToPlayer(new Packet100OpenWindow(this.currentWindowId, 6, par2Str == null ? "" : par2Str, var3.getSizeInventory(), par2Str != null)); -+ MerchantRecipeList var4 = par1IMerchant.getRecipes(this); -+ -+ if (var4 != null) { - try { - ByteArrayOutputStream var5 = new ByteArrayOutputStream(); - DataOutputStream var6 = new DataOutputStream(var5); - var6.writeInt(this.currentWindowId); - var4.writeRecipiesToStream(var6); -- this.playerNetServerHandler.sendPacket(new Packet250CustomPayload("MC|TrList", var5.toByteArray())); -+ this.playerNetServerHandler.sendPacketToPlayer(new Packet250CustomPayload("MC|TrList", var5.toByteArray())); - } catch (IOException var7) { - var7.printStackTrace(); - } - } -- - } - -- public void displayGUIHorse(EntityHorse var1, IInventory var2) { -- if(this.openContainer != this.inventoryContainer) { -+ public void displayGUIHorse(EntityHorse par1EntityHorse, IInventory par2IInventory) { -+ if (this.openContainer != this.inventoryContainer) { - this.closeScreen(); - } - -- this.getNextWindowId(); -- this.playerNetServerHandler.sendPacket(new Packet100OpenWindow(this.currentWindowId, 11, var2.getInvName(), var2.getSizeInventory(), var2.isInvNameLocalized(), var1.entityId)); -- this.openContainer = new ContainerHorseInventory(this.inventory, var2, var1); -+ this.incrementWindowID(); -+ this.playerNetServerHandler.sendPacketToPlayer(new Packet100OpenWindow(this.currentWindowId, 11, par2IInventory.getInvName(), par2IInventory.getSizeInventory(), par2IInventory.isInvNameLocalized(), par1EntityHorse.entityId)); -+ this.openContainer = new ContainerHorseInventory(this.inventory, par2IInventory, par1EntityHorse); - this.openContainer.windowId = this.currentWindowId; -- this.openContainer.onCraftGuiOpened(this); -+ this.openContainer.addCraftingToCrafters(this); - } - -- public void sendSlotContents(Container var1, int var2, ItemStack var3) { -- if(!(var1.getSlot(var2) instanceof SlotCrafting)) { -- if(!this.isChangingQuantityOnly) { -- this.playerNetServerHandler.sendPacket(new Packet103SetSlot(var1.windowId, var2, var3)); -+ /** -+ * Sends the contents of an inventory slot to the client-side Container. This doesn't have to match the actual contents -+ * of that slot. Args: Container, slot number, slot contents -+ */ -+ public void sendSlotContents(Container par1Container, int par2, ItemStack par3ItemStack) { -+ if (!(par1Container.getSlot(par2) instanceof SlotCrafting)) { -+ if (!this.playerInventoryBeingManipulated) { -+ this.playerNetServerHandler.sendPacketToPlayer(new Packet103SetSlot(par1Container.windowId, par2, par3ItemStack)); - } - } - } - -- public void sendContainerToPlayer(Container var1) { -- this.updateCraftingInventory(var1, var1.getInventory()); -- } -- -- public void updateCraftingInventory(Container var1, List var2) { -- this.playerNetServerHandler.sendPacket(new Packet104WindowItems(var1.windowId, var2)); -- this.playerNetServerHandler.sendPacket(new Packet103SetSlot(-1, -1, this.inventory.getItemStack())); -- } -- -- public void sendProgressBarUpdate(Container var1, int var2, int var3) { -- this.playerNetServerHandler.sendPacket(new Packet105UpdateProgressbar(var1.windowId, var2, var3)); -- } -- -+ public void sendContainerToPlayer(Container par1Container) { -+ this.sendContainerAndContentsToPlayer(par1Container, par1Container.getInventory()); -+ } -+ -+ public void sendContainerAndContentsToPlayer(Container par1Container, List par2List) { -+ this.playerNetServerHandler.sendPacketToPlayer(new Packet104WindowItems(par1Container.windowId, par2List)); -+ this.playerNetServerHandler.sendPacketToPlayer(new Packet103SetSlot(-1, -1, this.inventory.getItemStack())); -+ } -+ -+ /** -+ * Sends two ints to the client-side Container. Used for furnace burning time, smelting progress, brewing progress, and -+ * enchanting level. Normally the first int identifies which variable to update, and the second contains the new value. -+ * Both are truncated to shorts in non-local SMP. -+ */ -+ public void sendProgressBarUpdate(Container par1Container, int par2, int par3) { -+ this.playerNetServerHandler.sendPacketToPlayer(new Packet105UpdateProgressbar(par1Container.windowId, par2, par3)); -+ } -+ -+ /** -+ * sets current screen to null (used on escape buttons of GUIs) -+ */ - public void closeScreen() { -- this.playerNetServerHandler.sendPacket(new Packet101CloseWindow(this.openContainer.windowId)); -+ this.playerNetServerHandler.sendPacketToPlayer(new Packet101CloseWindow(this.openContainer.windowId)); - this.closeContainer(); - } - -+ /** -+ * updates item held by mouse -+ */ - public void updateHeldItem() { -- if(!this.isChangingQuantityOnly) { -- this.playerNetServerHandler.sendPacket(new Packet103SetSlot(-1, -1, this.inventory.getItemStack())); -+ if (!this.playerInventoryBeingManipulated) { -+ this.playerNetServerHandler.sendPacketToPlayer(new Packet103SetSlot(-1, -1, this.inventory.getItemStack())); - } - } - -+ /** -+ * Closes the container the player currently has open. -+ */ - public void closeContainer() { - this.openContainer.onContainerClosed(this); - this.openContainer = this.inventoryContainer; - } - -- public void setEntityActionState(float var1, float var2, boolean var3, boolean var4) { -- if(this.ridingEntity != null) { -- if(var1 >= -1.0F && var1 <= 1.0F) { -- this.moveStrafing = var1; -- } -- -- if(var2 >= -1.0F && var2 <= 1.0F) { -- this.moveForward = var2; -- } -- -- this.isJumping = var3; -- this.setSneaking(var4); -+ public void setEntityActionState(float par1, float par2, boolean par3, boolean par4) { -+ if (this.ridingEntity != null) { -+ if (par1 >= -1.0F && par1 <= 1.0F) { -+ this.moveStrafing = par1; -+ } -+ -+ if (par2 >= -1.0F && par2 <= 1.0F) { -+ this.moveForward = par2; -+ } -+ -+ this.isJumping = par3; -+ this.setSneaking(par4); - } -- - } - -- public void addStat(StatBase var1, int var2) { -- if(var1 != null) { -- if(!var1.isIndependent) { -- this.playerNetServerHandler.sendPacket(new Packet200Statistic(var1.statId, var2)); -+ /** -+ * Adds a value to a statistic field. -+ */ -+ public void addStat(StatBase par1StatBase, int par2) { -+ if (par1StatBase != null) { -+ if (!par1StatBase.isIndependent) { -+ this.playerNetServerHandler.sendPacketToPlayer(new Packet200Statistic(par1StatBase.statId, par2)); - } -- - } - } - - public void mountEntityAndWakeUp() { -- if(this.riddenByEntity != null) { -+ if (this.riddenByEntity != null) { - this.riddenByEntity.mountEntity(this); - } - -- if(this.sleeping) { -+ if (this.sleeping) { - this.wakeUpPlayer(true, false, false); - } -- - } - -+ /** -+ * this function is called when a players inventory is sent to him, lastHealth is updated on any dimension transitions, -+ * then reset. -+ */ - public void setPlayerHealthUpdated() { - this.lastHealth = -1.0E8F; - } - -- public void addChatMessage(String var1) { -- this.playerNetServerHandler.sendPacket(new Packet3Chat(ChatMessageComponent.createFromTranslationKey(var1))); -+ /** -+ * Add a chat message to the player -+ */ -+ public void addChatMessage(String par1Str) { -+ this.playerNetServerHandler.sendPacketToPlayer(new Packet3Chat(ChatMessageComponent.createFromTranslationKey(par1Str))); - } - -+ /** -+ * Used for when item use count runs out, ie: eating completed -+ */ - protected void onItemUseFinish() { -- this.playerNetServerHandler.sendPacket(new Packet38EntityStatus(this.entityId, (byte)9)); -+ this.playerNetServerHandler.sendPacketToPlayer(new Packet38EntityStatus(this.entityId, (byte)9)); - super.onItemUseFinish(); - } - -- public void setItemInUse(ItemStack var1, int var2) { -- super.setItemInUse(var1, var2); -- if(var1 != null && var1.getItem() != null && var1.getItem().getItemUseAction(var1) == EnumAction.eat) { -- this.getServerForPlayer().getEntityTracker().sendPacketToTrackedPlayersAndTrackedEntity(this, new Packet18Animation(this, 5)); -+ /** -+ * sets the itemInUse when the use item button is clicked. Args: itemstack, int maxItemUseDuration -+ */ -+ public void setItemInUse(ItemStack par1ItemStack, int par2) { -+ super.setItemInUse(par1ItemStack, par2); -+ -+ if (par1ItemStack != null && par1ItemStack.getItem() != null && par1ItemStack.getItem().getItemUseAction(par1ItemStack) == EnumAction.eat) { -+ this.getServerForPlayer().getEntityTracker().sendPacketToAllAssociatedPlayers(this, new Packet18Animation(this, 5)); - } -- - } - -- public void clonePlayer(EntityPlayer var1, boolean var2) { -- super.clonePlayer(var1, var2); -+ /** -+ * Copies the values from the given player into this player if boolean par2 is true. Always clones Ender Chest -+ * Inventory. -+ */ -+ public void clonePlayer(EntityPlayer par1EntityPlayer, boolean par2) { -+ super.clonePlayer(par1EntityPlayer, par2); - this.lastExperience = -1; - this.lastHealth = -1.0F; - this.lastFoodLevel = -1; -- this.g.addAll(((EntityPlayerMP)var1).g); -- } -- -- protected void onNewPotionEffect(PotionEffect var1) { -- super.onNewPotionEffect(var1); -- this.playerNetServerHandler.sendPacket(new Packet41EntityEffect(this.entityId, var1)); -- } -- -- protected void onChangedPotionEffect(PotionEffect var1, boolean var2) { -- super.onChangedPotionEffect(var1, var2); -- this.playerNetServerHandler.sendPacket(new Packet41EntityEffect(this.entityId, var1)); -- } -- -- protected void onFinishedPotionEffect(PotionEffect var1) { -- super.onFinishedPotionEffect(var1); -- this.playerNetServerHandler.sendPacket(new Packet42RemoveEntityEffect(this.entityId, var1)); -- } -- -- public void setPositionAndUpdate(double var1, double var3, double var5) { -- this.playerNetServerHandler.setPlayerLocation(var1, var3, var5, this.rotationYaw, this.rotationPitch); -- } -- -- public void onCriticalHit(Entity var1) { -- this.getServerForPlayer().getEntityTracker().sendPacketToTrackedPlayersAndTrackedEntity(this, new Packet18Animation(var1, 6)); -- } -- -- public void onEnchantmentCritical(Entity var1) { -- this.getServerForPlayer().getEntityTracker().sendPacketToTrackedPlayersAndTrackedEntity(this, new Packet18Animation(var1, 7)); -- } -- -+ this.destroyedItemsNetCache.addAll(((EntityPlayerMP)par1EntityPlayer).destroyedItemsNetCache); -+ } -+ -+ protected void onNewPotionEffect(PotionEffect par1PotionEffect) { -+ super.onNewPotionEffect(par1PotionEffect); -+ this.playerNetServerHandler.sendPacketToPlayer(new Packet41EntityEffect(this.entityId, par1PotionEffect)); -+ } -+ -+ protected void onChangedPotionEffect(PotionEffect par1PotionEffect, boolean par2) { -+ super.onChangedPotionEffect(par1PotionEffect, par2); -+ this.playerNetServerHandler.sendPacketToPlayer(new Packet41EntityEffect(this.entityId, par1PotionEffect)); -+ } -+ -+ protected void onFinishedPotionEffect(PotionEffect par1PotionEffect) { -+ super.onFinishedPotionEffect(par1PotionEffect); -+ this.playerNetServerHandler.sendPacketToPlayer(new Packet42RemoveEntityEffect(this.entityId, par1PotionEffect)); -+ } -+ -+ /** -+ * Move the entity to the coordinates informed, but keep yaw/pitch values. -+ */ -+ public void setPositionAndUpdate(double par1, double par3, double par5) { -+ this.playerNetServerHandler.setPlayerLocation(par1, par3, par5, this.rotationYaw, this.rotationPitch); -+ } -+ -+ /** -+ * Called when the player performs a critical hit on the Entity. Args: entity that was hit critically -+ */ -+ public void onCriticalHit(Entity par1Entity) { -+ this.getServerForPlayer().getEntityTracker().sendPacketToAllAssociatedPlayers(this, new Packet18Animation(par1Entity, 6)); -+ } -+ -+ public void onEnchantmentCritical(Entity par1Entity) { -+ this.getServerForPlayer().getEntityTracker().sendPacketToAllAssociatedPlayers(this, new Packet18Animation(par1Entity, 7)); -+ } -+ -+ /** -+ * Sends the player's abilities to the server (if there is one). -+ */ - public void sendPlayerAbilities() { -- if(this.playerNetServerHandler != null) { -- this.playerNetServerHandler.sendPacket(new Packet202PlayerAbilities(this.capabilities)); -+ if (this.playerNetServerHandler != null) { -+ this.playerNetServerHandler.sendPacketToPlayer(new Packet202PlayerAbilities(this.capabilities)); - } - } - -@@ -604,56 +766,73 @@ - return (WorldServer)this.worldObj; - } - -- public void setGameType(EnumGameType var1) { -- this.theItemInWorldManager.setGameType(var1); -- this.playerNetServerHandler.sendPacket(new Packet70GameEvent(3, var1.getID())); -- } -- -- public void sendChatToPlayer(ChatMessageComponent var1) { -- this.playerNetServerHandler.sendPacket(new Packet3Chat(var1)); -- } -- -- public boolean canCommandSenderUseCommand(int var1, String var2) { -- return "seed".equals(var2) && !this.b.isDedicatedServer() ? true : (!"tell".equals(var2) && !"help".equals(var2) && !"me".equals(var2) ? (this.b.getConfigurationManager().isPlayerOpped(this.bu) ? this.b.func_110455_j() >= var1 : false) : true); -- } -- -+ /** -+ * Sets the player's game mode and sends it to them. -+ */ -+ public void setGameType(EnumGameType par1EnumGameType) { -+ this.theItemInWorldManager.setGameType(par1EnumGameType); -+ this.playerNetServerHandler.sendPacketToPlayer(new Packet70GameEvent(3, par1EnumGameType.getID())); -+ } -+ -+ public void sendChatToPlayer(ChatMessageComponent par1ChatMessageComponent) { -+ this.playerNetServerHandler.sendPacketToPlayer(new Packet3Chat(par1ChatMessageComponent)); -+ } -+ -+ /** -+ * Returns true if the command sender is allowed to use the given command. -+ */ -+ public boolean canCommandSenderUseCommand(int par1, String par2Str) { -+ return "seed".equals(par2Str) && !this.mcServer.isDedicatedServer() ? true : (!"tell".equals(par2Str) && !"help".equals(par2Str) && !"me".equals(par2Str) ? (this.mcServer.getConfigurationManager().isPlayerOpped(this.username) ? this.mcServer.func_110455_j() >= par1 : false) : true); -+ } -+ -+ /** -+ * Gets the player's IP address. Used in /banip. -+ */ - public String getPlayerIP() { -- String var1 = this.playerNetServerHandler.netManager.getRemoteAddress().toString(); -+ String var1 = this.playerNetServerHandler.netManager.getSocketAddress().toString(); - var1 = var1.substring(var1.indexOf("/") + 1); - var1 = var1.substring(0, var1.indexOf(":")); - return var1; - } - -- public void updateClientInfo(Packet204ClientInfo var1) { -- this.bN = var1.getLanguage(); -- int var2 = 256 >> var1.getRenderDistance(); -- if(var2 > 3 && var2 < 15) { -+ public void updateClientInfo(Packet204ClientInfo par1Packet204ClientInfo) { -+ this.translator = par1Packet204ClientInfo.getLanguage(); -+ int var2 = 256 >> par1Packet204ClientInfo.getRenderDistance(); -+ -+ if (var2 > 3 && var2 < 15) { - this.renderDistance = var2; - } - -- this.chatVisibility = var1.getChatVisibility(); -- this.chatColours = var1.getChatColours(); -- if(this.b.isSinglePlayer() && this.b.getServerOwner().equals(this.bu)) { -- this.b.setDifficultyForAllWorlds(var1.getDifficulty()); -+ this.chatVisibility = par1Packet204ClientInfo.getChatVisibility(); -+ this.chatColours = par1Packet204ClientInfo.getChatColours(); -+ -+ if (this.mcServer.isSinglePlayer() && this.mcServer.getServerOwner().equals(this.username)) { -+ this.mcServer.setDifficultyForAllWorlds(par1Packet204ClientInfo.getDifficulty()); - } - -- this.setHideCape(1, !var1.getShowCape()); -+ this.setHideCape(1, !par1Packet204ClientInfo.getShowCape()); - } - - public int getChatVisibility() { - return this.chatVisibility; - } - -- public void requestTexturePackLoad(String var1, int var2) { -- String var3 = var1 + "\u0000" + var2; -- this.playerNetServerHandler.sendPacket(new Packet250CustomPayload("MC|TPack", var3.getBytes())); -+ /** -+ * on recieving this message the client (if permission is given) will download the requested textures -+ */ -+ public void requestTexturePackLoad(String par1Str, int par2) { -+ String var3 = par1Str + "\u0000" + par2; -+ this.playerNetServerHandler.sendPacketToPlayer(new Packet250CustomPayload("MC|TPack", var3.getBytes())); - } - -- public ChunkCoordinates getCommandSenderPosition() { -+ /** -+ * Return the position for this command sender. -+ */ -+ public ChunkCoordinates getPlayerCoordinates() { - return new ChunkCoordinates(MathHelper.floor_double(this.posX), MathHelper.floor_double(this.posY + 0.5D), MathHelper.floor_double(this.posZ)); - } - - public void func_143004_u() { -- this.field_143005_bX = MinecraftServer.getCurrentTimeMillis(); -+ this.field_143005_bX = MinecraftServer.getSystemTimeMillis(); - } - } ---- net/minecraft/src/GuiScreen.java -+++ net/minecraft/src/GuiScreen.java -@@ -6,175 +6,818 @@ - import java.awt.datatransfer.StringSelection; - import java.awt.datatransfer.Transferable; - import java.util.ArrayList; -+import java.util.IdentityHashMap; - import java.util.List; --import org.lwjgl.input.Keyboard; -+import java.util.concurrent.ConcurrentSkipListMap; -+ - import org.lwjgl.input.Mouse; -+import org.lwjgl.input.Keyboard; - import org.lwjgl.opengl.GL11; -- --public class GuiScreen extends Gui { -+import org.spoutcraft.api.gui.Button; -+import org.spoutcraft.api.gui.CheckBox; -+import org.spoutcraft.api.gui.ComboBox; -+import org.spoutcraft.api.gui.Control; -+import org.spoutcraft.api.gui.GenericComboBox; -+import org.spoutcraft.api.gui.GenericComboBox.ComboBoxView; -+import org.spoutcraft.api.gui.GenericGradient; -+import org.spoutcraft.api.gui.GenericOverlayScreen; -+//import org.spoutcraft.api.gui.Keyboard; -+import org.spoutcraft.api.gui.ListWidget; -+import org.spoutcraft.api.gui.ListWidgetItem; -+import org.spoutcraft.api.gui.Orientation; -+import org.spoutcraft.api.gui.OverlayScreen; -+import org.spoutcraft.api.gui.RadioButton; -+import org.spoutcraft.api.gui.RenderPriority; -+import org.spoutcraft.api.gui.Screen; -+import org.spoutcraft.api.gui.ScreenType; -+import org.spoutcraft.api.gui.Scrollable; -+import org.spoutcraft.api.gui.Slider; -+import org.spoutcraft.api.gui.Slot; -+import org.spoutcraft.api.gui.TextField; -+import org.spoutcraft.api.gui.Widget; -+import org.spoutcraft.api.inventory.ItemStack; -+import org.spoutcraft.client.ScheduledTextFieldUpdate; -+import org.spoutcraft.client.SpoutClient; -+import org.spoutcraft.client.config.Configuration; -+import org.spoutcraft.client.controls.SimpleKeyBindingManager; -+import org.spoutcraft.client.gui.CustomScreen; -+import org.spoutcraft.client.gui.MCRenderDelegate; -+import org.spoutcraft.client.gui.ScreenUtil; -+import org.spoutcraft.client.packet.PacketComboBox; -+import org.spoutcraft.client.packet.PacketControlAction; -+import org.spoutcraft.client.packet.PacketKeyPress; -+import org.spoutcraft.client.packet.PacketSlotClick; -+ -+public class GuiScreen extends Gui { -+ -+ /** Reference to the Minecraft object. */ - protected Minecraft mc; -+ -+ /** The width of the screen object. */ - public int width; -+ -+ /** The height of the screen object. */ - public int height; -- protected List i = new ArrayList(); -+ -+ /** A list of all the buttons in this container. */ -+ protected List buttonList = new ArrayList(); - public boolean allowUserInput; -+ -+ /** The FontRenderer used by GuiScreen */ - protected FontRenderer fontRenderer; -+ public GuiParticle guiParticles; -+ -+ /** The button that was just pressed. */ - private GuiButton selectedButton; - private int eventButton; -- private long lastMouseEvent; -+ private long field_85043_c; - private int field_92018_d; - -- public void drawScreen(int var1, int var2, float var3) { -- for(int var4 = 0; var4 < this.i.size(); ++var4) { -- GuiButton var5 = (GuiButton)this.i.get(var4); -- var5.drawButton(this.mc, var1, var2); -- } -- -- } -- -- protected void keyTyped(char var1, int var2) { -- if(var2 == 1) { -+ // Spout Start -+ public GenericGradient bg; -+ public Screen screen = null; -+ private long updateTicks; -+ private Scrollable holding = null; -+ private Orientation holdingScrollBar = Orientation.VERTICAL; -+ private long lastMouseMove = 0; -+ public static int TOOLTIP_DELAY = 500; -+ long renderEndNanoTime = 0L; -+ protected static int limitedFramerate = 120; -+ private long lastClick = 0; -+ protected static RenderItem ourItemRenderer = new RenderItem(); -+ private boolean firstrun = true; -+ protected IdentityHashMap scheduledTextFieldUpdates = new IdentityHashMap(); -+ -+ /** -+ * Draws the screen with widgets - do not override - use drawScreen() instead -+ */ -+ public void drawScreenPre(int x, int y, float z) { -+ drawScreen(x, y, z); -+ drawWidgets(x, y, z); -+ -+ // Limit main menu framerate to 120 FPS as long as we aren't in a game already -+ if (this.mc.theWorld == null) { -+ long sleeptime = (this.renderEndNanoTime + (long) (1000000000 / limitedFramerate) - System.nanoTime()) / 1000000L; -+ if (sleeptime > 0L && sleeptime < 500L) { -+ try { -+ Thread.sleep(sleeptime); -+ } catch (InterruptedException var12) { -+ var12.printStackTrace(); -+ } -+ } -+ -+ this.renderEndNanoTime = System.nanoTime(); -+ } -+ -+ int i = 0; -+ int j = 0; -+ if(mc.thePlayer != null) { -+ InventoryPlayer inventoryplayer = mc.thePlayer.inventory; -+ if(inventoryplayer.getItemStack() != null) { -+ RenderHelper.disableStandardItemLighting(); -+ RenderHelper.enableGUIStandardItemLighting(); -+ GL11.glTranslatef(0.0F, 0.0F, 32F); -+ zLevel = 200F; -+ ourItemRenderer.zLevel = 200F; -+ ourItemRenderer.renderItemIntoGUI(fontRenderer, mc.renderEngine, inventoryplayer.getItemStack(), x - i - 8, y - j - 8); -+ ourItemRenderer.renderItemOverlayIntoGUI(fontRenderer, mc.renderEngine, inventoryplayer.getItemStack(), x - i - 8, y - j - 8); -+ zLevel = 0.0F; -+ ourItemRenderer.zLevel = 0.0F; -+ RenderHelper.enableStandardItemLighting(); -+ } -+ } -+ } -+ // Spout End -+ -+ /** -+ * Draws the screen and all the components in it. -+ */ -+ public void drawScreen(int par1, int par2, float par3) { -+ for (int var4 = 0; var4 < this.buttonList.size(); ++var4) { -+ GuiButton var5 = (GuiButton)this.buttonList.get(var4); -+ var5.drawButton(this.mc, par1, par2); -+ } -+ } -+ -+ /** -+ * Fired when a key is typed. This is the equivalent of KeyListener.keyTyped(KeyEvent e). -+ */ -+ protected void keyTyped(char par1, int par2) { -+ if (par2 == 1) { - this.mc.displayGuiScreen((GuiScreen)null); -+ // Spout Start -+ if (mc.currentScreen == null) { - this.mc.setIngameFocus(); -- } -- -- } -- -+ } -+ // Spout End -+ } -+ } -+ -+ // Spout Start -+ public final void update(Screen screen) { -+ if (this.screen != null) { -+ for (Widget w : this.screen.getAttachedWidgets()) { -+ screen.attachWidget(w.getAddon(), w); -+ } -+ } -+ this.screen = screen; -+ } -+ // Spout End -+ -+ /** -+ * Returns a string stored in the system clipboard. -+ */ - public static String getClipboardString() { - try { - Transferable var0 = Toolkit.getDefaultToolkit().getSystemClipboard().getContents((Object)null); -- if(var0 != null && var0.isDataFlavorSupported(DataFlavor.stringFlavor)) { -+ -+ if (var0 != null && var0.isDataFlavorSupported(DataFlavor.stringFlavor)) { - return (String)var0.getTransferData(DataFlavor.stringFlavor); - } - } catch (Exception var1) { -+ ; - } - - return ""; - } - -- public static void setClipboardString(String var0) { -- try { -- StringSelection var1 = new StringSelection(var0); -+ // Spout Start - Wrap ALL the methods! -+ // Making these protected so you can always override behaviour you don't want. -+ protected void mouseClickedPre(int mouseX, int mouseY, int eventButton) { -+ mouseClicked(mouseX, mouseY, eventButton); // Call vanilla method -+ if (getScreen() == null) { -+ return; -+ } -+ screen.setMouseX(mouseX); -+ screen.setMouseY(mouseY); -+ -+ ComboBox openCombobox = null; -+ -+ if (eventButton == 0) { -+ boolean handled = false; -+ for (int i = 4; i >= 0; i--) { -+ Widget lastWidget = null; -+ for (Widget widget : screen.getAttachedWidgets(true)) { -+ lastWidget = widget; -+ if (widget.getPriority().getId() != i) { -+ continue; -+ } -+ if (widget instanceof Control) { -+ Control control = (Control) widget; -+ if (control.isEnabled() && control.isVisible() && isInBoundingRect(control, mouseX, mouseY)) { -+ if (control.getScreen() instanceof Scrollable) { -+ if (!isInBoundingRect(control.getScreen(), mouseX, mouseY)) { -+ continue; -+ } -+ } -+ control.setFocus(true); -+ if (control instanceof Scrollable) { -+ handled = handled || handleClickOnScrollable((Scrollable) control, mouseX, mouseY); -+ if (!handled && control instanceof ListWidget) { -+ handled = handled || handleClickOnListWidget((ListWidget) control, mouseX, mouseY); -+ } -+ } -+ if (!handled) { -+ if (control instanceof Button) { -+ handleButtonClick((Button) control); -+ handled = true; -+ } else if (control instanceof Slider) { -+ ((Slider) control).setDragging(true); -+ handled = true; -+ } else if (control instanceof TextField) { -+ ((TextField) control).setCursorPosition(((TextField) control).getText().length()); -+ handled = true; -+ } else if (control instanceof Slot) { -+ handleClickOnSlot((Slot) control, 0); -+ } -+ } -+ } -+ } -+ -+ if (lastWidget instanceof ComboBox) { -+ ComboBox box = (ComboBox) lastWidget; -+ if (box.isOpen()) { -+ openCombobox = box; -+ } -+ } -+ if (handled) { -+ break; -+ } -+ } -+ if (handled) { -+ if (lastWidget == openCombobox) { -+ openCombobox = null; -+ } -+ playSoundFX("random.click", 1.0F, 1.0F); -+ break; -+ } -+ } -+ } else if (eventButton == 1) { -+ for (Widget widget : screen.getAttachedWidgets(true)) { -+ if (widget instanceof Control) { -+ Control c = (Control) widget; -+ if (c.isEnabled() && c.isVisible() && isInBoundingRect(widget, mouseX, mouseY)) { -+ if (widget instanceof Slot) { -+ handleClickOnSlot((Slot) widget, 1); -+ break; -+ } -+ } -+ } -+ } -+ } -+ if (openCombobox != null) { -+ openCombobox.closeList(); -+ } -+ } -+ -+ private void handleClickOnSlot(Slot slot, int button) { -+ try { -+ if (mc.thePlayer == null) { -+ return; -+ } -+ PacketSlotClick packet = new PacketSlotClick(slot, button,Keyboard.isKeyDown(Keyboard.KEY_LSHIFT) || Keyboard.isKeyDown(Keyboard.KEY_RSHIFT)); -+ SpoutClient.getInstance().getPacketManager().sendSpoutPacket(packet); -+ ItemStack stackOnCursor = new ItemStack(0); -+ if (mc.thePlayer.inventory.getItemStack() != null) { -+ net.minecraft.src.ItemStack mcStack = mc.thePlayer.inventory.getItemStack(); -+ stackOnCursor = new ItemStack(mcStack.itemID, mcStack.stackSize, (short) mcStack.getItemDamage()); -+ } -+ ItemStack stackInSlot = slot.getItem(); -+ if ((stackOnCursor == null || stackOnCursor.getTypeId() == 0) && stackInSlot.getTypeId() == 0) { -+ return; // Nothing to do -+ } -+ if (stackOnCursor.getTypeId() == 0 && stackInSlot.getTypeId() != 0 && button == 1) { // Split item -+ int amountSlot = stackInSlot.getAmount() / 2; -+ int amountCursor = stackInSlot.getAmount() - amountSlot; -+ if (stackInSlot.getAmount() == 1) { -+ amountSlot = 0; -+ amountCursor = 1; -+ } -+ stackOnCursor = stackInSlot.clone(); -+ stackOnCursor.setAmount(amountCursor); -+ stackInSlot.setAmount(amountSlot); -+ if (amountSlot == 0) { -+ stackInSlot = new ItemStack(0); -+ } -+ boolean success = slot.onItemTake(stackOnCursor); -+ if (success) { -+ slot.setItem(stackInSlot); -+ } else { -+ return; -+ } -+ } else if (stackOnCursor != null && (stackInSlot.getTypeId() == 0 || (stackInSlot.getTypeId() == stackOnCursor.getTypeId() && stackInSlot.getDurability() == stackOnCursor.getDurability()))) { //Put item -+ ItemStack toPut = stackOnCursor.clone(); -+ int putAmount = toPut.getAmount(); -+ if (button == 1) { -+ putAmount = 1; -+ } -+ int amount = stackInSlot.getTypeId() == 0 ? 0 : stackInSlot.getAmount(); -+ amount += putAmount; -+ int maxStackSize = toPut.getMaxStackSize(); -+ if (maxStackSize == -1) { -+ maxStackSize = 64; -+ } -+ if (amount > maxStackSize) { -+ putAmount -= amount - maxStackSize; -+ amount = maxStackSize; -+ } -+ if (putAmount <= 0) { -+ return; -+ } -+ toPut.setAmount(putAmount); -+ boolean success = slot.onItemPut(toPut); -+ if (success) { -+ stackOnCursor.setAmount(stackOnCursor.getAmount() - putAmount); -+ if (stackOnCursor.getAmount() == 0) { -+ stackOnCursor = new ItemStack(0); -+ } -+ ItemStack put = toPut.clone(); -+ put.setAmount(amount); -+ slot.setItem(put); -+ } -+ } else if (stackOnCursor == null || stackOnCursor.getTypeId() == 0) { // Take item or shift click -+ if (Keyboard.isKeyDown(Keyboard.KEY_LSHIFT) || Keyboard.isKeyDown(Keyboard.KEY_RSHIFT)) { -+ slot.onItemShiftClicked(); -+ } else { // Take item -+ boolean success = slot.onItemTake(stackInSlot); -+ if (success) { -+ stackOnCursor = stackInSlot; -+ slot.setItem(new ItemStack(0)); -+ } -+ } -+ } else if (stackOnCursor.getTypeId() != stackInSlot.getTypeId() || stackOnCursor.getDurability() != stackInSlot.getDurability()) { // Exchange slot stack and cursor stack -+ boolean success = slot.onItemExchange(stackInSlot, stackOnCursor.clone()); -+ if (success) { -+ slot.setItem(stackOnCursor.clone()); -+ stackOnCursor = stackInSlot; -+ } -+ } -+ -+ if (stackOnCursor == null || stackOnCursor.getTypeId() == 0) { -+ mc.thePlayer.inventory.setItemStack(null); -+ } else { -+ net.minecraft.src.ItemStack mcStack = new net.minecraft.src.ItemStack(stackOnCursor.getTypeId(), stackOnCursor.getAmount(), stackOnCursor.getDurability()); -+ mc.thePlayer.inventory.setItemStack(mcStack); -+ } -+ } catch(Exception e) { -+ e.printStackTrace(); -+ } -+ } -+ -+ private void playSoundFX(String sound, float f, float f1) { -+ this.mc.sndManager.playSoundFX(sound, 1.0F, 1.0F); -+ } -+ -+ private boolean handleClickOnListWidget(ListWidget lw, int mouseX, int mouseY) { -+ int x = (int) (mouseX - lw.getActualX()); -+ int y = (int) (mouseY - lw.getActualY()); -+ if (x < 5) { -+ return false; -+ } -+ int scroll = lw.getScrollPosition(Orientation.VERTICAL); -+ y += scroll; -+ y -= 5; -+ int currentHeight = 0; -+ int n = 0; -+ for (ListWidgetItem item : lw.getItems()) { -+ -+ if (currentHeight <= y && y <= currentHeight + item.getHeight()) { -+ boolean doubleclick = false; -+ if (System.currentTimeMillis() - 200 < lastClick) { -+ doubleclick = true; -+ } -+ lw.setSelection(n); -+ PacketControlAction action = null; -+ if (!doubleclick) { -+ action = new PacketControlAction(lw.getScreen(), lw, "click", lw.getSelectedRow()); -+ } else { -+ action = new PacketControlAction(lw.getScreen(), lw, "doubleclick", lw.getSelectedRow()); -+ } -+ ListWidgetItem current = lw.getSelectedItem(); -+ current.onClick(x - 5, y - currentHeight, doubleclick); -+ lw.onSelected(lw.getSelectedRow(), doubleclick); -+ if (lw instanceof ComboBoxView) { -+ PacketComboBox packet = new PacketComboBox(((ComboBoxView) lw).getComboBox()); -+ SpoutClient.getInstance().getPacketManager().sendSpoutPacket(packet); -+ } else { -+ SpoutClient.getInstance().getPacketManager().sendSpoutPacket(action); -+ } -+ -+ lastClick = System.currentTimeMillis(); -+ return true; -+ } -+ n++; -+ currentHeight += item.getHeight(); -+ } -+ return false; -+ } -+ -+ private boolean handleClickOnScrollable(Scrollable lw, int mouseX, int mouseY) { -+ int x = (int) (mouseX - lw.getActualX()); -+ int y = (int) (mouseY - lw.getActualY()); -+ int scrollY = lw.getScrollPosition(Orientation.VERTICAL); -+ int scrollX = lw.getScrollPosition(Orientation.HORIZONTAL); -+ if (x > lw.getWidth() - 16 && lw.needsScrollBar(Orientation.VERTICAL)) { -+ double scrollFactor = 0; -+ double p = (double) scrollY / (double) lw.getMaximumScrollPosition(Orientation.VERTICAL); -+ scrollFactor = 3 + p * (lw.getViewportSize(Orientation.VERTICAL) - 16.0 - 6.0); -+ if (scrollFactor <= y && y <= scrollFactor + 16) { -+ holding = lw; -+ holdingScrollBar = Orientation.VERTICAL; -+ } -+ } -+ if (y > lw.getHeight() - 16 && lw.needsScrollBar(Orientation.HORIZONTAL)) { -+ double scrollFactor = 0; -+ double p = (double) scrollX / (double) lw.getMaximumScrollPosition(Orientation.HORIZONTAL); -+ scrollFactor = 3 + p * (lw.getViewportSize(Orientation.HORIZONTAL) - 16.0 - 6.0); -+ if (scrollFactor <= x && x <= scrollFactor + 16) { -+ holding = lw; -+ holdingScrollBar = Orientation.HORIZONTAL; -+ } -+ } -+ if (holding != null) { -+ return true; -+ } -+ return false; -+ } -+ -+ private void handleButtonClick(Button control) { -+ if (control instanceof CheckBox) { -+ CheckBox check = (CheckBox) control; -+ check.setChecked(!check.isChecked()); -+ } -+ if (control instanceof RadioButton) { -+ RadioButton radio = (RadioButton) control; -+ radio.setSelected(true); -+ } -+ this.buttonClicked((Button) control); -+ SpoutClient.getInstance().getPacketManager().sendSpoutPacket(new PacketControlAction(screen, control, 1)); -+ ((Button) control).onButtonClick(); -+ if (control instanceof GenericComboBox) { -+ PacketComboBox packet = new PacketComboBox((GenericComboBox) control); -+ SpoutClient.getInstance().getPacketManager().sendSpoutPacket(packet); -+ } -+ } -+ // Spout End -+ -+ /** -+ * store a string in the system clipboard -+ */ -+ public static void setClipboardString(String par0Str) { -+ try { -+ StringSelection var1 = new StringSelection(par0Str); - Toolkit.getDefaultToolkit().getSystemClipboard().setContents(var1, (ClipboardOwner)null); - } catch (Exception var2) { -+ ; - } -- - } - -- protected void mouseClicked(int var1, int var2, int var3) { -- if(var3 == 0) { -- for(int var4 = 0; var4 < this.i.size(); ++var4) { -- GuiButton var5 = (GuiButton)this.i.get(var4); -- if(var5.mousePressed(this.mc, var1, var2)) { -+ /** -+ * Called when the mouse is clicked. -+ */ -+ protected void mouseClicked(int par1, int par2, int par3) { -+ if (par3 == 0) { -+ for (int var4 = 0; var4 < this.buttonList.size(); ++var4) { -+ GuiButton var5 = (GuiButton)this.buttonList.get(var4); -+ -+ if (var5.mousePressed(this.mc, par1, par2)) { - this.selectedButton = var5; - this.mc.sndManager.playSoundFX("random.click", 1.0F, 1.0F); - this.actionPerformed(var5); - } - } - } -- -- } -- -- protected void mouseMovedOrUp(int var1, int var2, int var3) { -- if(this.selectedButton != null && var3 == 0) { -- this.selectedButton.mouseReleased(var1, var2); -+ } -+ // Spout Start -+ protected void mouseMovedOrUpPre(int mouseX, int mouseY, int eventButton) { -+ lastMouseMove = System.currentTimeMillis(); -+ mouseMovedOrUp(mouseX, mouseY, eventButton); -+ if (getScreen() == null) { -+ return; -+ } -+ screen.setMouseX(mouseX); -+ screen.setMouseY(mouseY); -+ for (Widget widget : screen.getAttachedWidgets(true)) { -+ if (widget instanceof Control) { -+ Control control = (Control) widget; -+ if (control.isEnabled() && control.isVisible()) { -+ if (eventButton == 0) { -+ if (control.isFocus() && !isInBoundingRect(control, mouseX, mouseY)) { // released control -+ control.setFocus(false); -+ } -+ if (control instanceof Slider && ((Slider) control).isDragging()) { -+ ((Slider) control).setDragging(false); -+ SpoutClient.getInstance().getPacketManager().sendSpoutPacket(new PacketControlAction(screen, control, ((Slider) control).getSliderPosition())); -+ ((Slider) control).onSliderDrag(((Slider) control).getSliderPosition(), ((Slider) control).getSliderPosition()); -+ } -+ } -+ } -+ } -+ } -+ if (holding != null && holdingScrollBar != null) { -+ double p = 0; -+ if (holdingScrollBar == Orientation.VERTICAL) { -+ int y = (int) (mouseY - holding.getActualY()); -+ p = (double) y / holding.getViewportSize(Orientation.VERTICAL); -+ } else { -+ int x = (int) (mouseX - holding.getActualX()); -+ p = (double) x / holding.getViewportSize(Orientation.HORIZONTAL); -+ } -+ holding.setScrollPosition(holdingScrollBar, (int) ((double) holding.getMaximumScrollPosition(holdingScrollBar) * p)); -+ -+ if (eventButton == 0) { -+ holding = null; -+ } -+ } -+ } -+ -+ protected boolean shouldShowTooltip() { -+ return !Configuration.isDelayedTooltips() || System.currentTimeMillis() - TOOLTIP_DELAY > lastMouseMove; -+ } -+ // Spout End -+ -+ /** -+ * Called when the mouse is moved or a mouse button is released. Signature: (mouseX, mouseY, which) which==-1 is -+ * mouseMove, which==0 or which==1 is mouseUp -+ */ -+ protected void mouseMovedOrUp(int par1, int par2, int par3) { -+ if (this.selectedButton != null && par3 == 0) { -+ this.selectedButton.mouseReleased(par1, par2); - this.selectedButton = null; - } -- -- } -- -- protected void mouseClickMove(int var1, int var2, int var3, long var4) { -- } -- -- protected void actionPerformed(GuiButton var1) { -- } -- -- public void setWorldAndResolution(Minecraft var1, int var2, int var3) { -- this.mc = var1; -- this.fontRenderer = var1.fontRenderer; -- this.width = var2; -- this.height = var3; -- this.i.clear(); -+ } -+ -+ /** -+ * Called when a mouse button is pressed and the mouse is moved around. Parameters are : mouseX, mouseY, -+ * lastButtonClicked & timeSinceMouseClick. -+ */ -+ protected void mouseClickMove(int par1, int par2, int par3, long par4) {} -+ -+ /** -+ * Fired when a control is clicked. This is the equivalent of ActionListener.actionPerformed(ActionEvent e). -+ */ -+ protected void actionPerformed(GuiButton par1GuiButton) {} -+ -+ /** -+ * Causes the screen to lay out its subcomponents again. This is the equivalent of the Java call Container.validate() -+ */ -+ public void setWorldAndResolution(Minecraft par1Minecraft, int par2, int par3) { -+ this.mc = par1Minecraft; -+ this.guiParticles = new GuiParticle(par1Minecraft); -+ this.fontRenderer = par1Minecraft.fontRenderer; -+ this.width = par2; -+ this.height = par3; -+ this.buttonList.clear(); -+ // Spout Start -+ if (!(this instanceof CustomScreen) && screen != null && !firstrun) { -+ for (Widget w : screen.getAttachedWidgets()) { -+ screen.removeWidget(w); -+ } -+ } -+ firstrun = false; -+ bg = (GenericGradient) new GenericGradient().setHeight(this.height).setWidth(this.width); -+ // Spout End - this.initGui(); - } - -- public void initGui() { -- } -+ /** -+ * Adds the buttons (and other controls) to the screen in question. -+ */ -+ public void initGui() {} - -+ /** -+ * Delegates mouse and keyboard input. -+ */ - public void handleInput() { -- while(Mouse.next()) { -+ while (Mouse.next()) { - this.handleMouseInput(); - } - -- while(Keyboard.next()) { -+ while (Keyboard.next()) { -+ // Spout Start -+ if (mc.thePlayer instanceof EntityClientPlayerMP && SpoutClient.getInstance().isSpoutEnabled()) { -+ EntityClientPlayerMP player = (EntityClientPlayerMP) mc.thePlayer; -+ ScreenType screen = ScreenUtil.getType(this); -+ int i = Keyboard.getEventKey(); -+ boolean keyReleased = Keyboard.getEventKeyState(); -+ PacketKeyPress packet = new PacketKeyPress(i, keyReleased, (MovementInputFromOptions) player.movementInput, screen); -+ SpoutClient.getInstance().getPacketManager().sendSpoutPacket(packet); -+ } -+ ((SimpleKeyBindingManager)SpoutClient.getInstance().getKeyBindingManager()).pressKey(Keyboard.getEventKey(), Keyboard.getEventKeyState(), ScreenUtil.getType(this).getCode()); -+ // Spout End - this.handleKeyboardInput(); - } -- - } - -+ /** -+ * Handles mouse input. -+ */ -+ // Spout Start - Rewritten -+ // ToDo: needs a rewritten rewrite AND Mac keybind toggle. - public void handleMouseInput() { -- int var1 = Mouse.getEventX() * this.width / this.mc.displayWidth; -- int var2 = this.height - Mouse.getEventY() * this.height / this.mc.displayHeight - 1; -- int var3 = Mouse.getEventButton(); -- if(Minecraft.isRunningOnMac && var3 == 0 && (Keyboard.isKeyDown(Keyboard.KEY_LCONTROL) || Keyboard.isKeyDown(Keyboard.KEY_RCONTROL))) { -- var3 = 1; -- } -- -- if(Mouse.getEventButtonState()) { -- if(this.mc.gameSettings.touchscreen && this.field_92018_d++ > 0) { -- return; -- } -- -- this.eventButton = var3; -- this.lastMouseEvent = Minecraft.getSystemTime(); -- this.mouseClicked(var1, var2, this.eventButton); -- } else if(var3 != -1) { -- if(this.mc.gameSettings.touchscreen && --this.field_92018_d > 0) { -- return; -- } -- -- this.eventButton = -1; -- this.mouseMovedOrUp(var1, var2, var3); -- } else if(this.eventButton != -1 && this.lastMouseEvent > 0L) { -- long var4 = Minecraft.getSystemTime() - this.lastMouseEvent; -- this.mouseClickMove(var1, var2, this.eventButton, var4); -- } -- -- } -- -+ int x; -+ int y; -+ if (Mouse.getEventButtonState()) { -+ if (this.mc.gameSettings.touchscreen && this.field_92018_d++ > 0) { -+ return; -+ } -+ x = Mouse.getEventX() * this.width / this.mc.displayWidth; -+ y = this.height - Mouse.getEventY() * this.height / this.mc.displayHeight - 1; -+ this.mouseClickedPre(x, y, Mouse.getEventButton()); -+ } else { -+ if (this.mc.gameSettings.touchscreen && this.field_92018_d++ > 0) { -+ return; -+ } -+ x = Mouse.getEventX() * this.width / this.mc.displayWidth; -+ y = this.height - Mouse.getEventY() * this.height / this.mc.displayHeight - 1; -+ this.mouseMovedOrUpPre(x, y, Mouse.getEventButton()); -+ } -+ int scroll = Mouse.getEventDWheel(); -+ if (scroll != 0) { -+ scroll *= 7; -+ handleScroll(x, y, scroll); -+ } -+ } -+ -+ protected void handleScroll(int x, int y, int scroll) { -+ Orientation axis = Orientation.VERTICAL; -+ if (Keyboard.isKeyDown(Keyboard.KEY_LSHIFT)) { -+ axis = Orientation.HORIZONTAL; -+ } -+ for (Widget w : getScreen().getAttachedWidgets(true)) { -+ if (w != null && isInBoundingRect(w, x, y)) { -+ if (w instanceof Scrollable) { -+ // Stupid LWJGL not recognizing vertical scrolls :( -+ Scrollable lw = (Scrollable) w; -+ if (axis == Orientation.VERTICAL) { -+ lw.scroll(0, -scroll / 30); -+ } else { -+ lw.scroll(-scroll / 30, 0); -+ } -+ PacketControlAction action = new PacketControlAction(lw.getScreen() != null ? lw.getScreen() : getScreen(), lw, axis.toString(), lw.getScrollPosition(axis)); -+ SpoutClient.getInstance().getPacketManager().sendSpoutPacket(action); -+ } -+ } -+ } -+ } -+ // Spout End -+ -+ /** -+ * Handles keyboard input. -+ */ -+ // ToDo: needs isMacOS variations added. - public void handleKeyboardInput() { -- if(Keyboard.getEventKeyState()) { -- int var1 = Keyboard.getEventKey(); -- char var2 = Keyboard.getEventCharacter(); -- if(var1 == 87) { -- this.mc.toggleFullscreen(); -- return; -- } -- -- this.keyTyped(var2, var1); -- } -- -+ // Spout Start -+ boolean handled = false; -+ if (Keyboard.getEventKey() == Keyboard.KEY_ESCAPE) { -+ Keyboard.enableRepeatEvents(false); -+ } else if (getScreen() != null) { -+ boolean tab = Keyboard.getEventKey() == Keyboard.KEY_TAB; -+ TextField focusedTF = null; -+ ConcurrentSkipListMap tabIndexMap = tab ? new ConcurrentSkipListMap() : null; -+ -+ for (Widget widget : screen.getAttachedWidgets(true)) { -+ if (widget instanceof Control) { -+ Control control = (Control) widget; -+ if (control.isFocus()) { -+ if (Keyboard.getEventKeyState()) { -+ handled = control.onKeyPressed(org.spoutcraft.api.gui.Keyboard.getKey(Keyboard.getEventKey())); -+ } else { -+ handled = control.onKeyReleased(org.spoutcraft.api.gui.Keyboard.getKey(Keyboard.getEventKey())); -+ } -+ } -+ if (handled) { -+ break; -+ } -+ } -+ if (!Keyboard.getEventKeyState()) { -+ break; -+ } -+ if (widget instanceof TextField) { -+ TextField tf = (TextField) widget; -+ // Handle tabbing get all textfields of this screen and start looking for the next bigger tab-index -+ if (tab) { -+ if (tf.isFocus()) { -+ focusedTF = tf; -+ } -+ tabIndexMap.put(tf.getTabIndex(), tf); -+ // Pass typed key to text processor -+ } else if (tf.isEnabled() && tf.isFocus()) { -+ if (tf.getTextProcessor().handleInput(Keyboard.getEventCharacter(), Keyboard.getEventKey())) { -+ tf.onTextFieldChange(); -+ ScheduledTextFieldUpdate updateThread = null; -+ if (scheduledTextFieldUpdates.containsKey(tf)) { -+ updateThread = scheduledTextFieldUpdates.get(tf); -+ if (updateThread.isAlive()) { -+ updateThread.delay(); -+ } else { -+ updateThread.start(); -+ } -+ } else { -+ updateThread = new ScheduledTextFieldUpdate(screen, tf); -+ scheduledTextFieldUpdates.put(tf, updateThread); -+ updateThread.start(); -+ } -+ } -+ handled = true; -+ break; -+ } -+ } -+ if (widget instanceof ListWidget) { -+ ListWidget lw = (ListWidget) widget; -+ if (lw.isEnabled() && lw.isFocus()) { -+ PacketControlAction action = null; -+ if (Keyboard.getEventKey() == Keyboard.KEY_DOWN && Keyboard.getEventKeyState()) { -+ handled = true; -+ lw.shiftSelection(1); -+ lw.onSelected(lw.getSelectedRow(), false); -+ lw.getSelectedItem().onClick(-1, -1, false); -+ action = new PacketControlAction(lw.getScreen() != null ? lw.getScreen() : getScreen(), lw, "selected", lw.getSelectedRow()); -+ } -+ if (Keyboard.getEventKey() == Keyboard.KEY_UP && Keyboard.getEventKeyState()) { -+ handled = true; -+ lw.shiftSelection(-1); -+ lw.onSelected(lw.getSelectedRow(), false); -+ lw.getSelectedItem().onClick(-1, -1, false); -+ action = new PacketControlAction(lw.getScreen() != null ? lw.getScreen() : getScreen(), lw, "selected", lw.getSelectedRow()); -+ } -+ if (Keyboard.getEventKey() == Keyboard.KEY_RETURN && Keyboard.getEventKeyState()) { -+ handled = true; -+ if (lw.getSelectedRow() != -1) { -+ lw.onSelected(lw.getSelectedRow(), true); -+ lw.getSelectedItem().onClick(-1, -1, true); -+ action = new PacketControlAction(lw.getScreen() != null ? lw.getScreen() : getScreen(), lw, "doubleclick", lw.getSelectedRow()); -+ } -+ } -+ if (action != null) { -+ SpoutClient.getInstance().getPacketManager().sendSpoutPacket(action); -+ break; -+ } -+ } -+ } -+ } -+ -+ // Start looking for the next bigger tab-index -+ if (tab && focusedTF != null) { -+ Integer index = tabIndexMap.higherKey(focusedTF.getTabIndex()); -+ if (index == null) { -+ index = tabIndexMap.ceilingKey(0); -+ } -+ if (index != null) { -+ focusedTF.setFocus(false); -+ tabIndexMap.get(index).setFocus(true); -+ handled = true; -+ } -+ } -+ } -+ if (!handled) { -+ // Start of vanilla code - got wrapped with this if -+ if (Keyboard.getEventKeyState()) { -+ if (Keyboard.getEventKey() == 87) { -+ this.mc.toggleFullscreen(); -+ return; -+ } -+ this.keyTyped(Keyboard.getEventCharacter(), Keyboard.getEventKey()); -+ } -+ // End of vanilla code -+ } -+ // Spout End - } - -+ /** -+ * Called from the main game loop to update the screen. -+ */ -+ // Spout Start - public void updateScreen() { -- } -- -- public void onGuiClosed() { -- } -- -+ updateTicks++; -+ MCRenderDelegate.shouldRenderCursor = updateTicks / 6 % 2 == 0; -+ } -+ // Spout End -+ -+ /** -+ * Called when the screen is unloaded. Used to disable keyboard repeat events -+ */ -+ public void onGuiClosed() {} -+ -+ /** -+ * Draws either a gradient over the background screen (when it exists) or a flat gradient over background.png -+ */ - public void drawDefaultBackground() { - this.drawWorldBackground(0); - } - -- public void drawWorldBackground(int var1) { -- if(this.mc.theWorld != null) { -+ public void drawWorldBackground(int par1) { -+ if (this.mc.theWorld != null) { - this.drawGradientRect(0, 0, this.width, this.height, -1072689136, -804253680); - } else { -- this.drawBackground(var1); -+ this.drawBackground(par1); - } -- - } - -- public void drawBackground(int var1) { -+ /** -+ * Draws the background (i is always 0 as of 1.2.2) -+ */ -+ public void drawBackground(int par1) { - GL11.glDisable(GL11.GL_LIGHTING); - GL11.glDisable(GL11.GL_FOG); - Tessellator var2 = Tessellator.instance; -@@ -183,25 +826,174 @@ - float var3 = 32.0F; - var2.startDrawingQuads(); - var2.setColorOpaque_I(4210752); -- var2.addVertexWithUV(0.0D, (double)this.height, 0.0D, 0.0D, (double)((float)this.height / var3 + (float)var1)); -- var2.addVertexWithUV((double)this.width, (double)this.height, 0.0D, (double)((float)this.width / var3), (double)((float)this.height / var3 + (float)var1)); -- var2.addVertexWithUV((double)this.width, 0.0D, 0.0D, (double)((float)this.width / var3), (double)var1); -- var2.addVertexWithUV(0.0D, 0.0D, 0.0D, 0.0D, (double)var1); -+ var2.addVertexWithUV(0.0D, (double)this.height, 0.0D, 0.0D, (double)((float)this.height / var3 + (float)par1)); -+ var2.addVertexWithUV((double)this.width, (double)this.height, 0.0D, (double)((float)this.width / var3), (double)((float)this.height / var3 + (float)par1)); -+ var2.addVertexWithUV((double)this.width, 0.0D, 0.0D, (double)((float)this.width / var3), (double)par1); -+ var2.addVertexWithUV(0.0D, 0.0D, 0.0D, 0.0D, (double)par1); - var2.draw(); - } - -+ /** -+ * Returns true if this GUI should pause the game when it is displayed in single-player -+ */ - public boolean doesGuiPauseGame() { - return true; - } - -- public void confirmClicked(boolean var1, int var2) { -- } -+ public void confirmClicked(boolean par1, int par2) {} -+ -+ // Spout Start -+ public void drawWidgets(int x, int y, float z) { -+ if (getScreen() == null) { -+ return; -+ } -+ // Draw ALL the widgets! -+ screen.render(); -+ if (shouldShowTooltip()) { -+ drawTooltips(x, y); -+ } -+ } -+ -+ // Note: already inside of the sandbox -+ protected void drawTooltips(int x, int y) { -+ // Draw the tooltip! -+ String tooltip = ""; -+ // Widget tooltipWidget = null; -+ for (RenderPriority priority : RenderPriority.values()) { -+ for (Widget widget : screen.getAttachedWidgets(true)) { // We need ALL the tooltips now -+ if (widget.getPriority() == priority) { -+ if (widget.isVisible() && isInBoundingRect(widget, x, y) && widget.getTooltip() != null && !widget.getTooltip().equals("")) { -+ if (widget.getScreen() instanceof Scrollable) { -+ if (!isInBoundingRect(widget.getScreen(), x, y)) { -+ continue; -+ } -+ } -+ tooltip = widget.getTooltip(); -+ //tooltipWidget = widget; -+ // No return here, when a widget that is over it comes next, tooltip will be overwritten. -+ } else if (widget.getTooltip() == null && widget.isVisible()) { -+ return; -+ } -+ } -+ } -+ } -+ -+ if (!tooltip.equals("")) { -+ drawTooltip(tooltip, x, y); -+ } -+ } -+ -+ public void drawTooltip(String tooltip, int x, int y) { -+ GL11.glPushMatrix(); -+ String lines[] = this.fontRenderer.wrapFormattedStringToWidth(tooltip,(width-22)).split("\n"); //Autowrap tooltips to reported screen width -+ int tooltipWidth = 0; -+ int tooltipHeight = 8 * lines.length + 3; -+ for (String line : lines) { -+ tooltipWidth = Math.max(this.fontRenderer.getStringWidth(line), tooltipWidth); -+ } -+ int offsetX = 0; -+ if (x + tooltipWidth > width) { -+ offsetX = -tooltipWidth - 11; -+ if (offsetX + x < 0) { -+ offsetX = -x; -+ } -+ } -+ int offsetY = 0; -+ if (y + tooltipHeight + 2 > height) { -+ offsetY = -tooltipHeight; -+ if (offsetY + y < 0) { -+ offsetY = -y; -+ } -+ } -+ -+ x += 6; -+ y -= 6; -+ -+ int j2 = 0; -+ for (int k2 = 0; k2 < lines.length; k2++) { -+ int i3 = fontRenderer.getStringWidth(lines[k2]); -+ if (i3 > j2) { -+ j2 = i3; -+ } -+ } -+ -+ int l2 = x + offsetX; -+ int j3 = y + offsetY; -+ int k3 = j2; -+ int l3 = 8; -+ if (lines.length > 1) { -+ l3 += (lines.length - 1) * 10; -+ } -+ // zLevel = 300F; -+ int i4 = 0xf0100010; -+ drawGradientRect(l2 - 3, j3 - 4, l2 + k3 + 3, j3 - 3, i4, i4); -+ drawGradientRect(l2 - 3, j3 + l3 + 3, l2 + k3 + 3, j3 + l3 + 4, i4, i4); -+ drawGradientRect(l2 - 3, j3 - 3, l2 + k3 + 3, j3 + l3 + 3, i4, i4); -+ drawGradientRect(l2 - 4, j3 - 3, l2 - 3, j3 + l3 + 3, i4, i4); -+ drawGradientRect(l2 + k3 + 3, j3 - 3, l2 + k3 + 4, j3 + l3 + 3, i4, i4); -+ int j4 = 0x505000ff; -+ int k4 = (j4 & 0xfefefe) >> 1 | j4 & 0xff000000; -+ drawGradientRect(l2 - 3, (j3 - 3) + 1, (l2 - 3) + 1, (j3 + l3 + 3) - 1, j4, k4); -+ drawGradientRect(l2 + k3 + 2, (j3 - 3) + 1, l2 + k3 + 3, (j3 + l3 + 3) - 1, j4, k4); -+ drawGradientRect(l2 - 3, j3 - 3, l2 + k3 + 3, (j3 - 3) + 1, j4, j4); -+ drawGradientRect(l2 - 3, j3 + l3 + 2, l2 + k3 + 3, j3 + l3 + 3, k4, k4); -+ -+ this.drawGradientRect(x - 3 + offsetX, y - 3 + offsetY, x + tooltipWidth + 3 + offsetX, y + tooltipHeight + offsetY, -1073741824, -1073741824); -+ -+ //int i = 0; -+ GL11.glColor4f(1f, 1f, 1f, 1f); -+ for (String line : lines) { -+ this.fontRenderer.drawStringWithShadow(line, l2, j3, -1); -+ j3 += 10; -+ } -+ GL11.glPopMatrix(); -+ } -+ -+ public boolean isInBoundingRect(Widget widget, int x, int y) { -+ int left = (int) widget.getActualX(); -+ int top = (int) widget.getActualY(); -+ int height = (int) widget.getHeight(); -+ int width = (int) widget.getWidth(); -+ int right = left + width; -+ int bottom = top + height; -+ if (left <= x && x < right && top <= y && y < bottom) { -+ return true; -+ } -+ return false; -+ } -+ -+ public boolean isInBoundingRect(int widgetX, int widgetY, int height, int width, int x, int y) { -+ int left = widgetX; -+ int top = widgetY; -+ int right = left + width; -+ int bottom = top + height; -+ if (left <= x && x < right && top <= y && y < bottom) { -+ return true; -+ } -+ return false; -+ } -+ -+ public Screen getScreen() { -+ if (screen == null) { -+ ScreenType type = ScreenUtil.getType(this); -+ if (type == ScreenType.GAME_SCREEN || type == ScreenType.CUSTOM_SCREEN) { -+ return screen; -+ } -+ screen = new GenericOverlayScreen(); -+ ((OverlayScreen) screen).setScreenType(type); -+ } -+ return screen; -+ } -+ -+ protected void buttonClicked(Button btn) { -+ } -+ // Spout End - - public static boolean isCtrlKeyDown() { -- return Minecraft.isRunningOnMac ? Keyboard.isKeyDown(Keyboard.KEY_LMETA) || Keyboard.isKeyDown(Keyboard.KEY_RMETA) : Keyboard.isKeyDown(Keyboard.KEY_LCONTROL) || Keyboard.isKeyDown(Keyboard.KEY_RCONTROL); -+ return Minecraft.isRunningOnMac ? Keyboard.isKeyDown(219) || Keyboard.isKeyDown(220) : Keyboard.isKeyDown(29) || Keyboard.isKeyDown(157); - } - - public static boolean isShiftKeyDown() { -- return Keyboard.isKeyDown(Keyboard.KEY_LSHIFT) || Keyboard.isKeyDown(Keyboard.KEY_RSHIFT); -+ return Keyboard.isKeyDown(42) || Keyboard.isKeyDown(54); - } - } ---- net/minecraft/src/ItemHangingEntity.java -+++ net/minecraft/src/ItemHangingEntity.java -@@ -1,31 +1,36 @@ - package net.minecraft.src; - - public class ItemHangingEntity extends Item { -- private final Class a; -+ private final Class hangingEntityClass; - -- public ItemHangingEntity(int var1, Class var2) { -- super(var1); -- this.a = var2; -+ public ItemHangingEntity(int par1, Class par2Class) { -+ super(par1); -+ this.hangingEntityClass = par2Class; - this.setCreativeTab(CreativeTabs.tabDecorations); - } - -- public boolean onItemUse(ItemStack var1, EntityPlayer var2, World var3, int var4, int var5, int var6, int var7, float var8, float var9, float var10) { -- if(var7 == 0) { -+ /** -+ * Callback for item usage. If the item does something special on right clicking, he will have one of those. Return -+ * True if something happen and false if it don't. This is for ITEMS, not BLOCKS -+ */ -+ public boolean onItemUse(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, World par3World, int par4, int par5, int par6, int par7, float par8, float par9, float par10) { -+ if (par7 == 0) { - return false; -- } else if(var7 == 1) { -+ } else if (par7 == 1) { - return false; - } else { -- int var11 = Direction.facingToDirection[var7]; -- EntityHanging var12 = this.createHangingEntity(var3, var4, var5, var6, var11); -- if(!var2.canPlayerEdit(var4, var5, var6, var7, var1)) { -+ int var11 = Direction.facingToDirection[par7]; -+ EntityHanging var12 = this.createHangingEntity(par3World, par4, par5, par6, var11); -+ -+ if (!par2EntityPlayer.canPlayerEdit(par4, par5, par6, par7, par1ItemStack)) { - return false; - } else { -- if(var12 != null && var12.onValidSurface()) { -- if(!var3.isRemote) { -- var3.spawnEntityInWorld(var12); -+ if (var12 != null && var12.onValidSurface()) { -+ if (!par3World.isRemote) { -+ par3World.spawnEntityInWorld(var12); - } - -- --var1.stackSize; -+ --par1ItemStack.stackSize; - } - - return true; -@@ -33,7 +38,10 @@ - } - } - -- private EntityHanging createHangingEntity(World var1, int var2, int var3, int var4, int var5) { -- return (EntityHanging)(this.a == EntityPainting.class ? new EntityPainting(var1, var2, var3, var4, var5) : (this.a == EntityItemFrame.class ? new EntityItemFrame(var1, var2, var3, var4, var5) : null)); -+ /** -+ * Create the hanging entity associated to this item. -+ */ -+ private EntityHanging createHangingEntity(World par1World, int par2, int par3, int par4, int par5) { -+ return (EntityHanging)(this.hangingEntityClass == EntityPainting.class ? new EntityPainting(par1World, par2, par3, par4, par5) : (this.hangingEntityClass == EntityItemFrame.class ? new EntityItemFrame(par1World, par2, par3, par4, par5) : null)); - } - } ---- net/minecraft/src/RenderHelper.java -+++ net/minecraft/src/RenderHelper.java -@@ -4,10 +4,15 @@ - import org.lwjgl.opengl.GL11; - - public class RenderHelper { -- private static FloatBuffer a = GLAllocation.createDirectFloatBuffer(16); -- private static final Vec3 field_82884_b = Vec3.createVectorHelper((double)0.2F, 1.0D, (double)-0.7F).normalize(); -- private static final Vec3 field_82885_c = Vec3.createVectorHelper((double)-0.2F, 1.0D, (double)0.7F).normalize(); -- -+ -+ /** Float buffer used to set OpenGL material colors */ -+ private static FloatBuffer colorBuffer = GLAllocation.createDirectFloatBuffer(16); -+ private static final Vec3 field_82884_b = Vec3.createVectorHelper(0.20000000298023224D, 1.0D, -0.699999988079071D).normalize(); -+ private static final Vec3 field_82885_c = Vec3.createVectorHelper(-0.20000000298023224D, 1.0D, 0.699999988079071D).normalize(); -+ -+ /** -+ * Disables the OpenGL lighting properties enabled by enableStandardItemLighting -+ */ - public static void disableStandardItemLighting() { - GL11.glDisable(GL11.GL_LIGHTING); - GL11.glDisable(GL11.GL_LIGHT0); -@@ -15,6 +20,9 @@ - GL11.glDisable(GL11.GL_COLOR_MATERIAL); - } - -+ /** -+ * Sets the OpenGL lighting properties to the values used when rendering blocks as items -+ */ - public static void enableStandardItemLighting() { - GL11.glEnable(GL11.GL_LIGHTING); - GL11.glEnable(GL11.GL_LIGHT0); -@@ -36,17 +44,26 @@ - GL11.glLightModel(GL11.GL_LIGHT_MODEL_AMBIENT, setColorBuffer(var0, var0, var0, 1.0F)); - } - -- private static FloatBuffer setColorBuffer(double var0, double var2, double var4, double var6) { -- return setColorBuffer((float)var0, (float)var2, (float)var4, (float)var6); -- } -- -- private static FloatBuffer setColorBuffer(float var0, float var1, float var2, float var3) { -- a.clear(); -- a.put(var0).put(var1).put(var2).put(var3); -- a.flip(); -- return a; -- } -- -+ /** -+ * Update and return colorBuffer with the RGBA values passed as arguments -+ */ -+ private static FloatBuffer setColorBuffer(double par0, double par2, double par4, double par6) { -+ return setColorBuffer((float)par0, (float)par2, (float)par4, (float)par6); -+ } -+ -+ /** -+ * Update and return colorBuffer with the RGBA values passed as arguments -+ */ -+ private static FloatBuffer setColorBuffer(float par0, float par1, float par2, float par3) { -+ colorBuffer.clear(); -+ colorBuffer.put(par0).put(par1).put(par2).put(par3); -+ colorBuffer.flip(); -+ return colorBuffer; -+ } -+ -+ /** -+ * Sets OpenGL lighting for rendering blocks as items inside GUI screens (such as containers). -+ */ - public static void enableGUIStandardItemLighting() { - GL11.glPushMatrix(); - GL11.glRotatef(-30.0F, 0.0F, 1.0F, 0.0F); ---- net/minecraft/src/CallableTexturePack.java -+++ net/minecraft/src/CallableTexturePack.java -@@ -5,12 +5,12 @@ - class CallableTexturePack implements Callable { - final Minecraft theMinecraft; - -- CallableTexturePack(Minecraft var1) { -- this.theMinecraft = var1; -+ CallableTexturePack(Minecraft par1Minecraft) { -+ this.theMinecraft = par1Minecraft; - } - - public String callTexturePack() { -- return this.theMinecraft.gameSettings.m; -+ return this.theMinecraft.gameSettings.skin; - } - - public Object call() { ---- net/minecraft/src/ContainerEnchantment.java -+++ net/minecraft/src/ContainerEnchantment.java -@@ -4,98 +4,117 @@ - import java.util.Random; - - public class ContainerEnchantment extends Container { -+ -+ /** SlotEnchantmentTable object with ItemStack to be enchanted */ - public IInventory tableInventory = new SlotEnchantmentTable(this, "Enchant", true, 1); -+ -+ /** current world (for bookshelf counting) */ - private World worldPointer; - private int posX; - private int posY; - private int posZ; -- private Random l = new Random(); -+ private Random rand = new Random(); -+ -+ /** used as seed for EnchantmentNameParts (see GuiEnchantment) */ - public long nameSeed; -+ -+ /** 3-member array storing the enchantment levels of each slot */ - public int[] enchantLevels = new int[3]; - -- public ContainerEnchantment(InventoryPlayer var1, World var2, int var3, int var4, int var5) { -- this.worldPointer = var2; -- this.posX = var3; -- this.posY = var4; -- this.posZ = var5; -+ public ContainerEnchantment(InventoryPlayer par1InventoryPlayer, World par2World, int par3, int par4, int par5) { -+ this.worldPointer = par2World; -+ this.posX = par3; -+ this.posY = par4; -+ this.posZ = par5; - this.addSlotToContainer(new SlotEnchantment(this, this.tableInventory, 0, 25, 47)); -- - int var6; -- for(var6 = 0; var6 < 3; ++var6) { -- for(int var7 = 0; var7 < 9; ++var7) { -- this.addSlotToContainer(new Slot(var1, var7 + var6 * 9 + 9, 8 + var7 * 18, 84 + var6 * 18)); -+ -+ for (var6 = 0; var6 < 3; ++var6) { -+ for (int var7 = 0; var7 < 9; ++var7) { -+ this.addSlotToContainer(new Slot(par1InventoryPlayer, var7 + var6 * 9 + 9, 8 + var7 * 18, 84 + var6 * 18)); - } - } - -- for(var6 = 0; var6 < 9; ++var6) { -- this.addSlotToContainer(new Slot(var1, var6, 8 + var6 * 18, 142)); -+ for (var6 = 0; var6 < 9; ++var6) { -+ this.addSlotToContainer(new Slot(par1InventoryPlayer, var6, 8 + var6 * 18, 142)); - } -- -- } -- -- public void onCraftGuiOpened(ICrafting var1) { -- super.onCraftGuiOpened(var1); -- var1.sendProgressBarUpdate(this, 0, this.enchantLevels[0]); -- var1.sendProgressBarUpdate(this, 1, this.enchantLevels[1]); -- var1.sendProgressBarUpdate(this, 2, this.enchantLevels[2]); -- } -- -+ } -+ -+ // Spout Start -+ public IInventory getIInventory() { -+ return tableInventory; -+ } -+ // Spout End -+ -+ public void addCraftingToCrafters(ICrafting par1ICrafting) { -+ super.addCraftingToCrafters(par1ICrafting); -+ par1ICrafting.sendProgressBarUpdate(this, 0, this.enchantLevels[0]); -+ par1ICrafting.sendProgressBarUpdate(this, 1, this.enchantLevels[1]); -+ par1ICrafting.sendProgressBarUpdate(this, 2, this.enchantLevels[2]); -+ } -+ -+ /** -+ * Looks for changes made in the container, sends them to every listener. -+ */ - public void detectAndSendChanges() { - super.detectAndSendChanges(); - -- for(int var1 = 0; var1 < this.e.size(); ++var1) { -- ICrafting var2 = (ICrafting)this.e.get(var1); -+ for (int var1 = 0; var1 < this.crafters.size(); ++var1) { -+ ICrafting var2 = (ICrafting)this.crafters.get(var1); - var2.sendProgressBarUpdate(this, 0, this.enchantLevels[0]); - var2.sendProgressBarUpdate(this, 1, this.enchantLevels[1]); - var2.sendProgressBarUpdate(this, 2, this.enchantLevels[2]); - } -- - } - -- public void updateProgressBar(int var1, int var2) { -- if(var1 >= 0 && var1 <= 2) { -- this.enchantLevels[var1] = var2; -+ public void updateProgressBar(int par1, int par2) { -+ if (par1 >= 0 && par1 <= 2) { -+ this.enchantLevels[par1] = par2; - } else { -- super.updateProgressBar(var1, var2); -+ super.updateProgressBar(par1, par2); - } -- - } - -- public void onCraftMatrixChanged(IInventory var1) { -- if(var1 == this.tableInventory) { -- ItemStack var2 = var1.getStackInSlot(0); -+ /** -+ * Callback for when the crafting matrix is changed. -+ */ -+ public void onCraftMatrixChanged(IInventory par1IInventory) { -+ if (par1IInventory == this.tableInventory) { -+ ItemStack var2 = par1IInventory.getStackInSlot(0); - int var3; -- if(var2 != null && var2.isItemEnchantable()) { -- this.nameSeed = this.l.nextLong(); -- if(!this.worldPointer.isRemote) { -+ -+ if (var2 != null && var2.isItemEnchantable()) { -+ this.nameSeed = this.rand.nextLong(); -+ -+ if (!this.worldPointer.isRemote) { - var3 = 0; -- - int var4; -- for(var4 = -1; var4 <= 1; ++var4) { -- for(int var5 = -1; var5 <= 1; ++var5) { -- if((var4 != 0 || var5 != 0) && this.worldPointer.isAirBlock(this.posX + var5, this.posY, this.posZ + var4) && this.worldPointer.isAirBlock(this.posX + var5, this.posY + 1, this.posZ + var4)) { -- if(this.worldPointer.getBlockId(this.posX + var5 * 2, this.posY, this.posZ + var4 * 2) == Block.bookShelf.blockID) { -- ++var3; -- } -- -- if(this.worldPointer.getBlockId(this.posX + var5 * 2, this.posY + 1, this.posZ + var4 * 2) == Block.bookShelf.blockID) { -- ++var3; -- } -- -- if(var5 != 0 && var4 != 0) { -- if(this.worldPointer.getBlockId(this.posX + var5 * 2, this.posY, this.posZ + var4) == Block.bookShelf.blockID) { -- ++var3; -- } -- -- if(this.worldPointer.getBlockId(this.posX + var5 * 2, this.posY + 1, this.posZ + var4) == Block.bookShelf.blockID) { -- ++var3; -- } -- -- if(this.worldPointer.getBlockId(this.posX + var5, this.posY, this.posZ + var4 * 2) == Block.bookShelf.blockID) { -- ++var3; -- } -- -- if(this.worldPointer.getBlockId(this.posX + var5, this.posY + 1, this.posZ + var4 * 2) == Block.bookShelf.blockID) { -+ -+ for (var4 = -1; var4 <= 1; ++var4) { -+ for (int var5 = -1; var5 <= 1; ++var5) { -+ if ((var4 != 0 || var5 != 0) && this.worldPointer.isAirBlock(this.posX + var5, this.posY, this.posZ + var4) && this.worldPointer.isAirBlock(this.posX + var5, this.posY + 1, this.posZ + var4)) { -+ if (this.worldPointer.getBlockId(this.posX + var5 * 2, this.posY, this.posZ + var4 * 2) == Block.bookShelf.blockID) { -+ ++var3; -+ } -+ -+ if (this.worldPointer.getBlockId(this.posX + var5 * 2, this.posY + 1, this.posZ + var4 * 2) == Block.bookShelf.blockID) { -+ ++var3; -+ } -+ -+ if (var5 != 0 && var4 != 0) { -+ if (this.worldPointer.getBlockId(this.posX + var5 * 2, this.posY, this.posZ + var4) == Block.bookShelf.blockID) { -+ ++var3; -+ } -+ -+ if (this.worldPointer.getBlockId(this.posX + var5 * 2, this.posY + 1, this.posZ + var4) == Block.bookShelf.blockID) { -+ ++var3; -+ } -+ -+ if (this.worldPointer.getBlockId(this.posX + var5, this.posY, this.posZ + var4 * 2) == Block.bookShelf.blockID) { -+ ++var3; -+ } -+ -+ if (this.worldPointer.getBlockId(this.posX + var5, this.posY + 1, this.posZ + var4 * 2) == Block.bookShelf.blockID) { - ++var3; - } - } -@@ -103,39 +122,45 @@ - } - } - -- for(var4 = 0; var4 < 3; ++var4) { -- this.enchantLevels[var4] = EnchantmentHelper.calcItemStackEnchantability(this.l, var4, var3, var2); -+ for (var4 = 0; var4 < 3; ++var4) { -+ this.enchantLevels[var4] = EnchantmentHelper.calcItemStackEnchantability(this.rand, var4, var3, var2); - } - - this.detectAndSendChanges(); - } - } else { -- for(var3 = 0; var3 < 3; ++var3) { -+ for (var3 = 0; var3 < 3; ++var3) { - this.enchantLevels[var3] = 0; - } - } - } -- - } - -- public boolean enchantItem(EntityPlayer var1, int var2) { -+ /** -+ * enchants the item on the table using the specified slot; also deducts XP from player -+ */ -+ public boolean enchantItem(EntityPlayer par1EntityPlayer, int par2) { - ItemStack var3 = this.tableInventory.getStackInSlot(0); -- if(this.enchantLevels[var2] > 0 && var3 != null && (var1.experienceLevel >= this.enchantLevels[var2] || var1.capabilities.isCreativeMode)) { -- if(!this.worldPointer.isRemote) { -- List var4 = EnchantmentHelper.buildEnchantmentList(this.l, var3, this.enchantLevels[var2]); -+ -+ if (this.enchantLevels[par2] > 0 && var3 != null && (par1EntityPlayer.experienceLevel >= this.enchantLevels[par2] || par1EntityPlayer.capabilities.isCreativeMode)) { -+ if (!this.worldPointer.isRemote) { -+ List var4 = EnchantmentHelper.buildEnchantmentList(this.rand, var3, this.enchantLevels[par2]); - boolean var5 = var3.itemID == Item.book.itemID; -- if(var4 != null) { -- var1.addExperienceLevel(-this.enchantLevels[var2]); -- if(var5) { -+ -+ if (var4 != null) { -+ par1EntityPlayer.addExperienceLevel(-this.enchantLevels[par2]); -+ -+ if (var5) { - var3.itemID = Item.enchantedBook.itemID; - } - -- int var6 = var5 ? this.l.nextInt(var4.size()) : -1; -+ int var6 = var5 ? this.rand.nextInt(var4.size()) : -1; - -- for(int var7 = 0; var7 < var4.size(); ++var7) { -+ for (int var7 = 0; var7 < var4.size(); ++var7) { - EnchantmentData var8 = (EnchantmentData)var4.get(var7); -- if(!var5 || var7 == var6) { -- if(var5) { -+ -+ if (!var5 || var7 == var6) { -+ if (var5) { - Item.enchantedBook.addEnchantment(var3, var8); - } else { - var3.addEnchantment(var8.enchantmentobj, var8.enchantmentLevel); -@@ -153,56 +178,65 @@ - } - } - -- public void onContainerClosed(EntityPlayer var1) { -- super.onContainerClosed(var1); -- if(!this.worldPointer.isRemote) { -+ /** -+ * Called when the container is closed. -+ */ -+ public void onContainerClosed(EntityPlayer par1EntityPlayer) { -+ super.onContainerClosed(par1EntityPlayer); -+ -+ if (!this.worldPointer.isRemote) { - ItemStack var2 = this.tableInventory.getStackInSlotOnClosing(0); -- if(var2 != null) { -- var1.dropPlayerItem(var2); -+ -+ if (var2 != null) { -+ par1EntityPlayer.dropPlayerItem(var2); - } -- - } - } - -- public boolean canInteractWith(EntityPlayer var1) { -- return this.worldPointer.getBlockId(this.posX, this.posY, this.posZ) != Block.enchantmentTable.blockID ? false : var1.getDistanceSq((double)this.posX + 0.5D, (double)this.posY + 0.5D, (double)this.posZ + 0.5D) <= 64.0D; -+ public boolean canInteractWith(EntityPlayer par1EntityPlayer) { -+ return this.worldPointer.getBlockId(this.posX, this.posY, this.posZ) != Block.enchantmentTable.blockID ? false : par1EntityPlayer.getDistanceSq((double)this.posX + 0.5D, (double)this.posY + 0.5D, (double)this.posZ + 0.5D) <= 64.0D; - } - -- public ItemStack transferStackInSlot(EntityPlayer var1, int var2) { -+ /** -+ * Called when a player shift-clicks on a slot. You must override this or you will crash when someone does that. -+ */ -+ public ItemStack transferStackInSlot(EntityPlayer par1EntityPlayer, int par2) { - ItemStack var3 = null; -- Slot var4 = (Slot)this.c.get(var2); -- if(var4 != null && var4.getHasStack()) { -+ Slot var4 = (Slot)this.inventorySlots.get(par2); -+ -+ if (var4 != null && var4.getHasStack()) { - ItemStack var5 = var4.getStack(); - var3 = var5.copy(); -- if(var2 == 0) { -- if(!this.mergeItemStack(var5, 1, 37, true)) { -+ -+ if (par2 == 0) { -+ if (!this.mergeItemStack(var5, 1, 37, true)) { - return null; - } - } else { -- if(((Slot)this.c.get(0)).getHasStack() || !((Slot)this.c.get(0)).isItemValid(var5)) { -+ if (((Slot)this.inventorySlots.get(0)).getHasStack() || !((Slot)this.inventorySlots.get(0)).isItemValid(var5)) { - return null; - } - -- if(var5.hasTagCompound() && var5.stackSize == 1) { -- ((Slot)this.c.get(0)).putStack(var5.copy()); -+ if (var5.hasTagCompound() && var5.stackSize == 1) { -+ ((Slot)this.inventorySlots.get(0)).putStack(var5.copy()); - var5.stackSize = 0; -- } else if(var5.stackSize >= 1) { -- ((Slot)this.c.get(0)).putStack(new ItemStack(var5.itemID, 1, var5.getItemDamage())); -+ } else if (var5.stackSize >= 1) { -+ ((Slot)this.inventorySlots.get(0)).putStack(new ItemStack(var5.itemID, 1, var5.getItemDamage())); - --var5.stackSize; - } - } - -- if(var5.stackSize == 0) { -+ if (var5.stackSize == 0) { - var4.putStack((ItemStack)null); - } else { - var4.onSlotChanged(); - } - -- if(var5.stackSize == var3.stackSize) { -+ if (var5.stackSize == var3.stackSize) { - return null; - } - -- var4.onPickupFromSlot(var1, var5); -+ var4.onPickupFromSlot(par1EntityPlayer, var5); - } - - return var3; ---- /dev/null -+++ org/spoutcraft/client/packet/PacketItemName.java -@@ -1,0 +1,83 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.client.packet; -+ -+import java.io.IOException; -+ -+import org.spoutcraft.api.io.SpoutInputStream; -+import org.spoutcraft.api.io.SpoutOutputStream; -+import org.spoutcraft.api.material.Material; -+import org.spoutcraft.api.material.MaterialData; -+ -+public class PacketItemName implements SpoutPacket { -+ private int id; -+ private short data; -+ private String name; -+ public PacketItemName() { -+ } -+ -+ public PacketItemName(int id, short data, String name) { -+ this.id = id; -+ this.data = data; -+ this.name = name; -+ } -+ -+ public void readData(SpoutInputStream input) throws IOException { -+ id = input.readInt(); -+ data = input.readShort(); -+ name = input.readString(); -+ } -+ -+ public void writeData(SpoutOutputStream output) throws IOException { -+ output.writeInt(id); -+ output.writeShort(data); -+ output.writeString(name); -+ } -+ -+ public void run(int PlayerId) { -+ Material material = MaterialData.getOrCreateMaterial(id, data); -+ if (material == null) { -+ material = MaterialData.getCustomItem(data); -+ } -+ if (name.equals("[resetall]")) { -+ MaterialData.reset(); -+ } -+ if (material != null) { -+ if (name.equals("[reset]")) { -+ material.setName(material.getNotchianName()); -+ } else { -+ material.setName(name); -+ } -+ } else { -+ //System.out.println("Tried to set item name to [" + name + "] for unknown material (" + id + ", " + data + ")"); -+ } -+ } -+ -+ public PacketType getPacketType() { -+ return PacketType.PacketItemName; -+ } -+ -+ public int getVersion() { -+ return 0; -+ } -+ -+ public void failure(int playerId) { -+ } -+} ---- net/minecraft/src/GuiCreateFlatWorldListSlot.java -+++ net/minecraft/src/GuiCreateFlatWorldListSlot.java -@@ -5,31 +5,33 @@ - - class GuiCreateFlatWorldListSlot extends GuiSlot { - public int field_82454_a; -+ - final GuiCreateFlatWorld createFlatWorldGui; - -- public GuiCreateFlatWorldListSlot(GuiCreateFlatWorld var1) { -- super(var1.mc, var1.width, var1.height, 43, var1.height - 60, 24); -- this.createFlatWorldGui = var1; -+ public GuiCreateFlatWorldListSlot(GuiCreateFlatWorld par1GuiCreateFlatWorld) { -+ super(par1GuiCreateFlatWorld.mc, par1GuiCreateFlatWorld.width, par1GuiCreateFlatWorld.height, 43, par1GuiCreateFlatWorld.height - 60, 24); -+ this.createFlatWorldGui = par1GuiCreateFlatWorld; - this.field_82454_a = -1; - } - -- private void func_82452_a(int var1, int var2, ItemStack var3) { -- this.func_82451_d(var1 + 1, var2 + 1); -+ private void func_82452_a(int par1, int par2, ItemStack par3ItemStack) { -+ this.func_82451_d(par1 + 1, par2 + 1); - GL11.glEnable(GL12.GL_RESCALE_NORMAL); -- if(var3 != null) { -+ -+ if (par3ItemStack != null) { - RenderHelper.enableGUIStandardItemLighting(); -- GuiCreateFlatWorld.getRenderItem().renderItemIntoGUI(this.createFlatWorldGui.fontRenderer, this.createFlatWorldGui.mc.getTextureManager(), var3, var1 + 2, var2 + 2); -+ GuiCreateFlatWorld.getRenderItem().renderItemIntoGUI(this.createFlatWorldGui.fontRenderer, this.createFlatWorldGui.mc.getTextureManager(), par3ItemStack, par1 + 2, par2 + 2); - RenderHelper.disableStandardItemLighting(); - } - - GL11.glDisable(GL12.GL_RESCALE_NORMAL); - } - -- private void func_82451_d(int var1, int var2) { -- this.func_82450_b(var1, var2, 0, 0); -+ private void func_82451_d(int par1, int par2) { -+ this.func_82450_b(par1, par2, 0, 0); - } - -- private void func_82450_b(int var1, int var2, int var3, int var4) { -+ private void func_82450_b(int par1, int par2, int par3, int par4) { - GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - this.createFlatWorldGui.mc.getTextureManager().bindTexture(Gui.statIcons); - float var5 = 0.0078125F; -@@ -38,45 +40,54 @@ - boolean var8 = true; - Tessellator var9 = Tessellator.instance; - var9.startDrawingQuads(); -- var9.addVertexWithUV((double)(var1 + 0), (double)(var2 + 18), (double)this.createFlatWorldGui.zLevel, (double)((float)(var3 + 0) * 0.0078125F), (double)((float)(var4 + 18) * 0.0078125F)); -- var9.addVertexWithUV((double)(var1 + 18), (double)(var2 + 18), (double)this.createFlatWorldGui.zLevel, (double)((float)(var3 + 18) * 0.0078125F), (double)((float)(var4 + 18) * 0.0078125F)); -- var9.addVertexWithUV((double)(var1 + 18), (double)(var2 + 0), (double)this.createFlatWorldGui.zLevel, (double)((float)(var3 + 18) * 0.0078125F), (double)((float)(var4 + 0) * 0.0078125F)); -- var9.addVertexWithUV((double)(var1 + 0), (double)(var2 + 0), (double)this.createFlatWorldGui.zLevel, (double)((float)(var3 + 0) * 0.0078125F), (double)((float)(var4 + 0) * 0.0078125F)); -+ var9.addVertexWithUV((double)(par1 + 0), (double)(par2 + 18), (double)this.createFlatWorldGui.zLevel, (double)((float)(par3 + 0) * 0.0078125F), (double)((float)(par4 + 18) * 0.0078125F)); -+ var9.addVertexWithUV((double)(par1 + 18), (double)(par2 + 18), (double)this.createFlatWorldGui.zLevel, (double)((float)(par3 + 18) * 0.0078125F), (double)((float)(par4 + 18) * 0.0078125F)); -+ var9.addVertexWithUV((double)(par1 + 18), (double)(par2 + 0), (double)this.createFlatWorldGui.zLevel, (double)((float)(par3 + 18) * 0.0078125F), (double)((float)(par4 + 0) * 0.0078125F)); -+ var9.addVertexWithUV((double)(par1 + 0), (double)(par2 + 0), (double)this.createFlatWorldGui.zLevel, (double)((float)(par3 + 0) * 0.0078125F), (double)((float)(par4 + 0) * 0.0078125F)); - var9.draw(); - } - -+ /** -+ * Gets the size of the current slot list. -+ */ - protected int getSize() { - return GuiCreateFlatWorld.func_82271_a(this.createFlatWorldGui).getFlatLayers().size(); - } - -- protected void elementClicked(int var1, boolean var2) { -- this.field_82454_a = var1; -+ /** -+ * the element in the slot that was clicked, boolean for wether it was double clicked or not -+ */ -+ protected void elementClicked(int par1, boolean par2) { -+ this.field_82454_a = par1; - this.createFlatWorldGui.func_82270_g(); - } - -- protected boolean isSelected(int var1) { -- return var1 == this.field_82454_a; -- } -- -- protected void drawBackground() { -- } -- -- protected void drawSlot(int var1, int var2, int var3, int var4, Tessellator var5) { -- FlatLayerInfo var6 = (FlatLayerInfo)GuiCreateFlatWorld.func_82271_a(this.createFlatWorldGui).getFlatLayers().get(GuiCreateFlatWorld.func_82271_a(this.createFlatWorldGui).getFlatLayers().size() - var1 - 1); -+ /** -+ * returns true if the element passed in is currently selected -+ */ -+ protected boolean isSelected(int par1) { -+ return par1 == this.field_82454_a; -+ } -+ -+ protected void drawBackground() {} -+ -+ protected void drawSlot(int par1, int par2, int par3, int par4, Tessellator par5Tessellator) { -+ FlatLayerInfo var6 = (FlatLayerInfo)GuiCreateFlatWorld.func_82271_a(this.createFlatWorldGui).getFlatLayers().get(GuiCreateFlatWorld.func_82271_a(this.createFlatWorldGui).getFlatLayers().size() - par1 - 1); - ItemStack var7 = var6.getFillBlock() == 0 ? null : new ItemStack(var6.getFillBlock(), 1, var6.getFillBlockMeta()); - String var8 = var7 == null ? "Air" : Item.itemsList[var6.getFillBlock()].getItemStackDisplayName(var7); -- this.func_82452_a(var2, var3, var7); -- this.createFlatWorldGui.fontRenderer.drawString(var8, var2 + 18 + 5, var3 + 3, 16777215); -+ this.func_82452_a(par2, par3, var7); -+ this.createFlatWorldGui.fontRenderer.drawString(var8, par2 + 18 + 5, par3 + 3, 16777215); - String var9; -- if(var1 == 0) { -- var9 = I18n.getStringParams("createWorld.customize.flat.layer.top", new Object[]{Integer.valueOf(var6.getLayerCount())}); -- } else if(var1 == GuiCreateFlatWorld.func_82271_a(this.createFlatWorldGui).getFlatLayers().size() - 1) { -- var9 = I18n.getStringParams("createWorld.customize.flat.layer.bottom", new Object[]{Integer.valueOf(var6.getLayerCount())}); -+ -+ if (par1 == 0) { -+ var9 = I18n.getStringParams("createWorld.customize.flat.layer.top", new Object[] {Integer.valueOf(var6.getLayerCount())}); -+ } else if (par1 == GuiCreateFlatWorld.func_82271_a(this.createFlatWorldGui).getFlatLayers().size() - 1) { -+ var9 = I18n.getStringParams("createWorld.customize.flat.layer.bottom", new Object[] {Integer.valueOf(var6.getLayerCount())}); - } else { -- var9 = I18n.getStringParams("createWorld.customize.flat.layer", new Object[]{Integer.valueOf(var6.getLayerCount())}); -+ var9 = I18n.getStringParams("createWorld.customize.flat.layer", new Object[] {Integer.valueOf(var6.getLayerCount())}); - } - -- this.createFlatWorldGui.fontRenderer.drawString(var9, var2 + 2 + 213 - this.createFlatWorldGui.fontRenderer.getStringWidth(var9), var3 + 3, 16777215); -+ this.createFlatWorldGui.fontRenderer.drawString(var9, par2 + 2 + 213 - this.createFlatWorldGui.fontRenderer.getStringWidth(var9), par3 + 3, 16777215); - } - - protected int getScrollBarX() { ---- net/minecraft/src/EntityZombie.java -+++ net/minecraft/src/EntityZombie.java -@@ -5,12 +5,16 @@ - - public class EntityZombie extends EntityMob { - protected static final Attribute field_110186_bp = (new RangedAttribute("zombie.spawnReinforcements", 0.0D, 0.0D, 1.0D)).func_111117_a("Spawn Reinforcements Chance"); -- private static final UUID bq = UUID.fromString("B9766B59-9566-4402-BC1F-2EE2A276D836"); -- private static final AttributeModifier babySpeedBoostModifier = new AttributeModifier(bq, "Baby speed boost", 0.5D, 1); -+ private static final UUID babySpeedBoostUUID = UUID.fromString("B9766B59-9566-4402-BC1F-2EE2A276D836"); -+ private static final AttributeModifier babySpeedBoostModifier = new AttributeModifier(babySpeedBoostUUID, "Baby speed boost", 0.5D, 1); -+ -+ /** -+ * Ticker used to determine the time remaining for this zombie to convert into a villager when cured. -+ */ - private int conversionTime; - -- public EntityZombie(World var1) { -- super(var1); -+ public EntityZombie(World par1World) { -+ super(par1World); - this.getNavigator().setBreakDoors(true); - this.tasks.addTask(0, new EntityAISwimming(this)); - this.tasks.addTask(1, new EntityAIBreakDoor(this)); -@@ -29,9 +33,9 @@ - protected void applyEntityAttributes() { - super.applyEntityAttributes(); - this.getEntityAttribute(SharedMonsterAttributes.followRange).setAttribute(40.0D); -- this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setAttribute((double)0.23F); -+ this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setAttribute(0.23000000417232513D); - this.getEntityAttribute(SharedMonsterAttributes.attackDamage).setAttribute(3.0D); -- this.getAttributeMap().func_111150_b(field_110186_bp).setAttribute(this.ab.nextDouble() * (double)0.1F); -+ this.getAttributeMap().func_111150_b(field_110186_bp).setAttribute(this.rand.nextDouble() * 0.10000000149011612D); - } - - protected void entityInit() { -@@ -41,53 +45,80 @@ - this.getDataWatcher().addObject(14, Byte.valueOf((byte)0)); - } - -+ /** -+ * Returns the current armor value as determined by a call to InventoryPlayer.getTotalArmorValue -+ */ - public int getTotalArmorValue() { - int var1 = super.getTotalArmorValue() + 2; -- if(var1 > 20) { -+ -+ if (var1 > 20) { - var1 = 20; - } - - return var1; - } - -+ /** -+ * Returns true if the newer Entity AI code should be run -+ */ - protected boolean isAIEnabled() { - return true; - } - -+ /** -+ * If Animal, checks if the age timer is negative -+ */ - public boolean isChild() { - return this.getDataWatcher().getWatchableObjectByte(12) == 1; - } - -- public void setChild(boolean var1) { -- this.getDataWatcher().updateObject(12, Byte.valueOf((byte)(var1 ? 1 : 0))); -- if(this.worldObj != null && !this.worldObj.isRemote) { -+ /** -+ * Set whether this zombie is a child. -+ */ -+ public void setChild(boolean par1) { -+ this.getDataWatcher().updateObject(12, Byte.valueOf((byte)(par1 ? 1 : 0))); -+ -+ if (this.worldObj != null && !this.worldObj.isRemote) { - AttributeInstance var2 = this.getEntityAttribute(SharedMonsterAttributes.movementSpeed); - var2.removeModifier(babySpeedBoostModifier); -- if(var1) { -+ -+ if (par1) { - var2.applyModifier(babySpeedBoostModifier); - } - } -- - } - -+ /** -+ * Return whether this zombie is a villager. -+ */ - public boolean isVillager() { - return this.getDataWatcher().getWatchableObjectByte(13) == 1; - } - -- public void setVillager(boolean var1) { -- this.getDataWatcher().updateObject(13, Byte.valueOf((byte)(var1 ? 1 : 0))); -+ /** -+ * Set whether this zombie is a villager. -+ */ -+ public void setVillager(boolean par1) { -+ this.getDataWatcher().updateObject(13, Byte.valueOf((byte)(par1 ? 1 : 0))); - } - -+ /** -+ * Called frequently so the entity can update its state every tick as required. For example, zombies and skeletons use -+ * this to react to sunlight and start to burn. -+ */ - public void onLivingUpdate() { -- if(this.worldObj.isDaytime() && !this.worldObj.isRemote && !this.isChild()) { -+ if (this.worldObj.isDaytime() && !this.worldObj.isRemote && !this.isChild()) { - float var1 = this.getBrightness(1.0F); -- if(var1 > 0.5F && this.ab.nextFloat() * 30.0F < (var1 - 0.4F) * 2.0F && this.worldObj.canBlockSeeTheSky(MathHelper.floor_double(this.posX), MathHelper.floor_double(this.posY), MathHelper.floor_double(this.posZ))) { -+ -+ if (var1 > 0.5F && this.rand.nextFloat() * 30.0F < (var1 - 0.4F) * 2.0F && this.worldObj.canBlockSeeTheSky(MathHelper.floor_double(this.posX), MathHelper.floor_double(this.posY), MathHelper.floor_double(this.posZ))) { - boolean var2 = true; -- ItemStack var3 = this.getEquipmentInSlot(4); -- if(var3 != null) { -- if(var3.isItemStackDamageable()) { -- var3.setItemDamage(var3.getItemDamageForDisplay() + this.ab.nextInt(2)); -- if(var3.getItemDamageForDisplay() >= var3.getMaxDamage()) { -+ ItemStack var3 = this.getCurrentItemOrArmor(4); -+ -+ if (var3 != null) { -+ if (var3.isItemStackDamageable()) { -+ var3.setItemDamage(var3.getItemDamageForDisplay() + this.rand.nextInt(2)); -+ -+ if (var3.getItemDamageForDisplay() >= var3.getMaxDamage()) { - this.renderBrokenItemStack(var3); - this.setCurrentItemOrArmor(4, (ItemStack)null); - } -@@ -96,7 +127,7 @@ - var2 = false; - } - -- if(var2) { -+ if (var2) { - this.setFire(8); - } - } -@@ -105,37 +136,43 @@ - super.onLivingUpdate(); - } - -- public boolean attackEntityFrom(DamageSource var1, float var2) { -- if(!super.attackEntityFrom(var1, var2)) { -+ /** -+ * Called when the entity is attacked. -+ */ -+ public boolean attackEntityFrom(DamageSource par1DamageSource, float par2) { -+ if (!super.attackEntityFrom(par1DamageSource, par2)) { - return false; - } else { - EntityLivingBase var3 = this.getAttackTarget(); -- if(var3 == null && this.getEntityToAttack() instanceof EntityLivingBase) { -+ -+ if (var3 == null && this.getEntityToAttack() instanceof EntityLivingBase) { - var3 = (EntityLivingBase)this.getEntityToAttack(); - } - -- if(var3 == null && var1.getEntity() instanceof EntityLivingBase) { -- var3 = (EntityLivingBase)var1.getEntity(); -+ if (var3 == null && par1DamageSource.getEntity() instanceof EntityLivingBase) { -+ var3 = (EntityLivingBase)par1DamageSource.getEntity(); - } - -- if(var3 != null && this.worldObj.difficultySetting >= 3 && (double)this.ab.nextFloat() < this.getEntityAttribute(field_110186_bp).getAttributeValue()) { -+ if (var3 != null && this.worldObj.difficultySetting >= 3 && (double)this.rand.nextFloat() < this.getEntityAttribute(field_110186_bp).getAttributeValue()) { - int var4 = MathHelper.floor_double(this.posX); - int var5 = MathHelper.floor_double(this.posY); - int var6 = MathHelper.floor_double(this.posZ); - EntityZombie var7 = new EntityZombie(this.worldObj); - -- for(int var8 = 0; var8 < 50; ++var8) { -- int var9 = var4 + MathHelper.getRandomIntegerInRange(this.ab, 7, 40) * MathHelper.getRandomIntegerInRange(this.ab, -1, 1); -- int var10 = var5 + MathHelper.getRandomIntegerInRange(this.ab, 7, 40) * MathHelper.getRandomIntegerInRange(this.ab, -1, 1); -- int var11 = var6 + MathHelper.getRandomIntegerInRange(this.ab, 7, 40) * MathHelper.getRandomIntegerInRange(this.ab, -1, 1); -- if(this.worldObj.doesBlockHaveSolidTopSurface(var9, var10 - 1, var11) && this.worldObj.getBlockLightValue(var9, var10, var11) < 10) { -+ for (int var8 = 0; var8 < 50; ++var8) { -+ int var9 = var4 + MathHelper.getRandomIntegerInRange(this.rand, 7, 40) * MathHelper.getRandomIntegerInRange(this.rand, -1, 1); -+ int var10 = var5 + MathHelper.getRandomIntegerInRange(this.rand, 7, 40) * MathHelper.getRandomIntegerInRange(this.rand, -1, 1); -+ int var11 = var6 + MathHelper.getRandomIntegerInRange(this.rand, 7, 40) * MathHelper.getRandomIntegerInRange(this.rand, -1, 1); -+ -+ if (this.worldObj.doesBlockHaveSolidTopSurface(var9, var10 - 1, var11) && this.worldObj.getBlockLightValue(var9, var10, var11) < 10) { - var7.setPosition((double)var9, (double)var10, (double)var11); -- if(this.worldObj.checkNoEntityCollision(var7.boundingBox) && this.worldObj.getCollidingBoundingBoxes(var7, var7.boundingBox).isEmpty() && !this.worldObj.isAnyLiquid(var7.boundingBox)) { -+ -+ if (this.worldObj.checkNoEntityCollision(var7.boundingBox) && this.worldObj.getCollidingBoundingBoxes(var7, var7.boundingBox).isEmpty() && !this.worldObj.isAnyLiquid(var7.boundingBox)) { - this.worldObj.spawnEntityInWorld(var7); - var7.setAttackTarget(var3); - var7.onSpawnWithEgg((EntityLivingData)null); -- this.getEntityAttribute(field_110186_bp).applyModifier(new AttributeModifier("Zombie reinforcement caller charge", (double)-0.05F, 0)); -- var7.getEntityAttribute(field_110186_bp).applyModifier(new AttributeModifier("Zombie reinforcement callee charge", (double)-0.05F, 0)); -+ this.getEntityAttribute(field_110186_bp).applyModifier(new AttributeModifier("Zombie reinforcement caller charge", -0.05000000074505806D, 0)); -+ var7.getEntityAttribute(field_110186_bp).applyModifier(new AttributeModifier("Zombie reinforcement callee charge", -0.05000000074505806D, 0)); - break; - } - } -@@ -146,11 +183,15 @@ - } - } - -+ /** -+ * Called to update the entity's position/logic. -+ */ - public void onUpdate() { -- if(!this.worldObj.isRemote && this.isConverting()) { -+ if (!this.worldObj.isRemote && this.isConverting()) { - int var1 = this.getConversionTimeBoost(); - this.conversionTime -= var1; -- if(this.conversionTime <= 0) { -+ -+ if (this.conversionTime <= 0) { - this.convertToVillager(); - } - } -@@ -158,169 +199,213 @@ - super.onUpdate(); - } - -- public boolean attackEntityAsMob(Entity var1) { -- boolean var2 = super.attackEntityAsMob(var1); -- if(var2 && this.getHeldItem() == null && this.isBurning() && this.ab.nextFloat() < (float)this.worldObj.difficultySetting * 0.3F) { -- var1.setFire(2 * this.worldObj.difficultySetting); -+ public boolean attackEntityAsMob(Entity par1Entity) { -+ boolean var2 = super.attackEntityAsMob(par1Entity); -+ -+ if (var2 && this.getHeldItem() == null && this.isBurning() && this.rand.nextFloat() < (float)this.worldObj.difficultySetting * 0.3F) { -+ par1Entity.setFire(2 * this.worldObj.difficultySetting); - } - - return var2; - } - -+ /** -+ * Returns the sound this mob makes while it's alive. -+ */ - protected String getLivingSound() { - return "mob.zombie.say"; - } - -+ /** -+ * Returns the sound this mob makes when it is hurt. -+ */ - protected String getHurtSound() { - return "mob.zombie.hurt"; - } - -+ /** -+ * Returns the sound this mob makes on death. -+ */ - protected String getDeathSound() { - return "mob.zombie.death"; - } - -- protected void playStepSound(int var1, int var2, int var3, int var4) { -+ /** -+ * Plays step sound at given x, y, z for the entity -+ */ -+ protected void playStepSound(int par1, int par2, int par3, int par4) { - this.playSound("mob.zombie.step", 0.15F, 1.0F); - } - -+ /** -+ * Returns the item ID for the item the mob drops on death. -+ */ - protected int getDropItemId() { - return Item.rottenFlesh.itemID; - } - -+ /** -+ * Get this Entity's EnumCreatureAttribute -+ */ - public EnumCreatureAttribute getCreatureAttribute() { - return EnumCreatureAttribute.UNDEAD; - } - -- protected void dropRareDrop(int var1) { -- switch(this.ab.nextInt(3)) { -- case 0: -- this.dropItem(Item.ingotIron.itemID, 1); -- break; -- case 1: -- this.dropItem(Item.carrot.itemID, 1); -- break; -- case 2: -- this.dropItem(Item.potato.itemID, 1); -+ protected void dropRareDrop(int par1) { -+ switch (this.rand.nextInt(3)) { -+ case 0: -+ this.dropItem(Item.ingotIron.itemID, 1); -+ break; -+ -+ case 1: -+ this.dropItem(Item.carrot.itemID, 1); -+ break; -+ -+ case 2: -+ this.dropItem(Item.potato.itemID, 1); - } -- - } - -+ /** -+ * Makes entity wear random armor based on difficulty -+ */ - protected void addRandomArmor() { - super.addRandomArmor(); -- if(this.ab.nextFloat() < (this.worldObj.difficultySetting == 3 ? 0.05F : 0.01F)) { -- int var1 = this.ab.nextInt(3); -- if(var1 == 0) { -+ -+ if (this.rand.nextFloat() < (this.worldObj.difficultySetting == 3 ? 0.05F : 0.01F)) { -+ int var1 = this.rand.nextInt(3); -+ -+ if (var1 == 0) { - this.setCurrentItemOrArmor(0, new ItemStack(Item.swordIron)); - } else { - this.setCurrentItemOrArmor(0, new ItemStack(Item.shovelIron)); - } - } -- -- } -- -- public void writeEntityToNBT(NBTTagCompound var1) { -- super.writeEntityToNBT(var1); -- if(this.isChild()) { -- var1.setBoolean("IsBaby", true); -- } -- -- if(this.isVillager()) { -- var1.setBoolean("IsVillager", true); -- } -- -- var1.setInteger("ConversionTime", this.isConverting() ? this.conversionTime : -1); -- } -- -- public void readEntityFromNBT(NBTTagCompound var1) { -- super.readEntityFromNBT(var1); -- if(var1.getBoolean("IsBaby")) { -+ } -+ -+ /** -+ * (abstract) Protected helper method to write subclass entity data to NBT. -+ */ -+ public void writeEntityToNBT(NBTTagCompound par1NBTTagCompound) { -+ super.writeEntityToNBT(par1NBTTagCompound); -+ -+ if (this.isChild()) { -+ par1NBTTagCompound.setBoolean("IsBaby", true); -+ } -+ -+ if (this.isVillager()) { -+ par1NBTTagCompound.setBoolean("IsVillager", true); -+ } -+ -+ par1NBTTagCompound.setInteger("ConversionTime", this.isConverting() ? this.conversionTime : -1); -+ } -+ -+ /** -+ * (abstract) Protected helper method to read subclass entity data from NBT. -+ */ -+ public void readEntityFromNBT(NBTTagCompound par1NBTTagCompound) { -+ super.readEntityFromNBT(par1NBTTagCompound); -+ -+ if (par1NBTTagCompound.getBoolean("IsBaby")) { - this.setChild(true); - } - -- if(var1.getBoolean("IsVillager")) { -+ if (par1NBTTagCompound.getBoolean("IsVillager")) { - this.setVillager(true); - } - -- if(var1.hasKey("ConversionTime") && var1.getInteger("ConversionTime") > -1) { -- this.startConversion(var1.getInteger("ConversionTime")); -+ if (par1NBTTagCompound.hasKey("ConversionTime") && par1NBTTagCompound.getInteger("ConversionTime") > -1) { -+ this.startConversion(par1NBTTagCompound.getInteger("ConversionTime")); - } -- - } - -- public void onKillEntity(EntityLivingBase var1) { -- super.onKillEntity(var1); -- if(this.worldObj.difficultySetting >= 2 && var1 instanceof EntityVillager) { -- if(this.worldObj.difficultySetting == 2 && this.ab.nextBoolean()) { -+ /** -+ * This method gets called when the entity kills another one. -+ */ -+ public void onKillEntity(EntityLivingBase par1EntityLivingBase) { -+ super.onKillEntity(par1EntityLivingBase); -+ -+ if (this.worldObj.difficultySetting >= 2 && par1EntityLivingBase instanceof EntityVillager) { -+ if (this.worldObj.difficultySetting == 2 && this.rand.nextBoolean()) { - return; - } - - EntityZombie var2 = new EntityZombie(this.worldObj); -- var2.copyLocationAndAnglesFrom(var1); -- this.worldObj.removeEntity(var1); -+ var2.copyLocationAndAnglesFrom(par1EntityLivingBase); -+ this.worldObj.removeEntity(par1EntityLivingBase); - var2.onSpawnWithEgg((EntityLivingData)null); - var2.setVillager(true); -- if(var1.isChild()) { -+ -+ if (par1EntityLivingBase.isChild()) { - var2.setChild(true); - } - - this.worldObj.spawnEntityInWorld(var2); - this.worldObj.playAuxSFXAtEntity((EntityPlayer)null, 1016, (int)this.posX, (int)this.posY, (int)this.posZ, 0); - } -- - } - -- public EntityLivingData onSpawnWithEgg(EntityLivingData var1) { -- Object var4 = super.onSpawnWithEgg(var1); -+ public EntityLivingData onSpawnWithEgg(EntityLivingData par1EntityLivingData) { -+ Object par1EntityLivingData1 = super.onSpawnWithEgg(par1EntityLivingData); - float var2 = this.worldObj.getLocationTensionFactor(this.posX, this.posY, this.posZ); -- this.setCanPickUpLoot(this.ab.nextFloat() < 0.55F * var2); -- if(var4 == null) { -- var4 = new EntityZombieGroupData(this, this.worldObj.s.nextFloat() < 0.05F, this.worldObj.s.nextFloat() < 0.05F, (EntityZombieINNER1)null); -+ this.setCanPickUpLoot(this.rand.nextFloat() < 0.55F * var2); -+ -+ if (par1EntityLivingData1 == null) { -+ par1EntityLivingData1 = new EntityZombieGroupData(this, this.worldObj.rand.nextFloat() < 0.05F, this.worldObj.rand.nextFloat() < 0.05F, (EntityZombieINNER1)null); - } - -- if(var4 instanceof EntityZombieGroupData) { -- EntityZombieGroupData var3 = (EntityZombieGroupData)var4; -- if(var3.field_142046_b) { -+ if (par1EntityLivingData1 instanceof EntityZombieGroupData) { -+ EntityZombieGroupData var3 = (EntityZombieGroupData)par1EntityLivingData1; -+ -+ if (var3.field_142046_b) { - this.setVillager(true); - } - -- if(var3.field_142048_a) { -+ if (var3.field_142048_a) { - this.setChild(true); - } - } - - this.addRandomArmor(); - this.enchantEquipment(); -- if(this.getEquipmentInSlot(4) == null) { -+ -+ if (this.getCurrentItemOrArmor(4) == null) { - Calendar var5 = this.worldObj.getCurrentDate(); -- if(var5.get(2) + 1 == 10 && var5.get(5) == 31 && this.ab.nextFloat() < 0.25F) { -- this.setCurrentItemOrArmor(4, new ItemStack(this.ab.nextFloat() < 0.1F ? Block.pumpkinLantern : Block.pumpkin)); -+ -+ if (var5.get(2) + 1 == 10 && var5.get(5) == 31 && this.rand.nextFloat() < 0.25F) { -+ this.setCurrentItemOrArmor(4, new ItemStack(this.rand.nextFloat() < 0.1F ? Block.pumpkinLantern : Block.pumpkin)); - this.equipmentDropChances[4] = 0.0F; - } - } - -- this.getEntityAttribute(SharedMonsterAttributes.knockbackResistance).applyModifier(new AttributeModifier("Random spawn bonus", this.ab.nextDouble() * (double)0.05F, 0)); -- this.getEntityAttribute(SharedMonsterAttributes.followRange).applyModifier(new AttributeModifier("Random zombie-spawn bonus", this.ab.nextDouble() * 1.5D, 2)); -- if(this.ab.nextFloat() < var2 * 0.05F) { -- this.getEntityAttribute(field_110186_bp).applyModifier(new AttributeModifier("Leader zombie bonus", this.ab.nextDouble() * 0.25D + 0.5D, 0)); -- this.getEntityAttribute(SharedMonsterAttributes.maxHealth).applyModifier(new AttributeModifier("Leader zombie bonus", this.ab.nextDouble() * 3.0D + 1.0D, 2)); -+ this.getEntityAttribute(SharedMonsterAttributes.knockbackResistance).applyModifier(new AttributeModifier("Random spawn bonus", this.rand.nextDouble() * 0.05000000074505806D, 0)); -+ this.getEntityAttribute(SharedMonsterAttributes.followRange).applyModifier(new AttributeModifier("Random zombie-spawn bonus", this.rand.nextDouble() * 1.5D, 2)); -+ -+ if (this.rand.nextFloat() < var2 * 0.05F) { -+ this.getEntityAttribute(field_110186_bp).applyModifier(new AttributeModifier("Leader zombie bonus", this.rand.nextDouble() * 0.25D + 0.5D, 0)); -+ this.getEntityAttribute(SharedMonsterAttributes.maxHealth).applyModifier(new AttributeModifier("Leader zombie bonus", this.rand.nextDouble() * 3.0D + 1.0D, 2)); - } - -- return (EntityLivingData)var4; -+ return (EntityLivingData)par1EntityLivingData1; - } - -- public boolean interact(EntityPlayer var1) { -- ItemStack var2 = var1.getCurrentEquippedItem(); -- if(var2 != null && var2.getItem() == Item.appleGold && var2.getItemDamage() == 0 && this.isVillager() && this.isPotionActive(Potion.weakness)) { -- if(!var1.capabilities.isCreativeMode) { -+ /** -+ * Called when a player interacts with a mob. e.g. gets milk from a cow, gets into the saddle on a pig. -+ */ -+ public boolean interact(EntityPlayer par1EntityPlayer) { -+ ItemStack var2 = par1EntityPlayer.getCurrentEquippedItem(); -+ -+ if (var2 != null && var2.getItem() == Item.appleGold && var2.getItemDamage() == 0 && this.isVillager() && this.isPotionActive(Potion.weakness)) { -+ if (!par1EntityPlayer.capabilities.isCreativeMode) { - --var2.stackSize; - } - -- if(var2.stackSize <= 0) { -- var1.inventory.setInventorySlotContents(var1.inventory.currentItem, (ItemStack)null); -+ if (var2.stackSize <= 0) { -+ par1EntityPlayer.inventory.setInventorySlotContents(par1EntityPlayer.inventory.currentItem, (ItemStack)null); - } - -- if(!this.worldObj.isRemote) { -- this.startConversion(this.ab.nextInt(2401) + 3600); -+ if (!this.worldObj.isRemote) { -+ this.startConversion(this.rand.nextInt(2401) + 3600); - } - - return true; -@@ -329,37 +414,50 @@ - } - } - -- protected void startConversion(int var1) { -- this.conversionTime = var1; -+ /** -+ * Starts converting this zombie into a villager. The zombie converts into a villager after the specified time in -+ * ticks. -+ */ -+ protected void startConversion(int par1) { -+ this.conversionTime = par1; - this.getDataWatcher().updateObject(14, Byte.valueOf((byte)1)); - this.removePotionEffect(Potion.weakness.id); -- this.addPotionEffect(new PotionEffect(Potion.damageBoost.id, var1, Math.min(this.worldObj.difficultySetting - 1, 0))); -+ this.addPotionEffect(new PotionEffect(Potion.damageBoost.id, par1, Math.min(this.worldObj.difficultySetting - 1, 0))); - this.worldObj.setEntityState(this, (byte)16); - } - -- public void handleHealthUpdate(byte var1) { -- if(var1 == 16) { -- this.worldObj.playSound(this.posX + 0.5D, this.posY + 0.5D, this.posZ + 0.5D, "mob.zombie.remedy", 1.0F + this.ab.nextFloat(), this.ab.nextFloat() * 0.7F + 0.3F, false); -+ public void handleHealthUpdate(byte par1) { -+ if (par1 == 16) { -+ this.worldObj.playSound(this.posX + 0.5D, this.posY + 0.5D, this.posZ + 0.5D, "mob.zombie.remedy", 1.0F + this.rand.nextFloat(), this.rand.nextFloat() * 0.7F + 0.3F, false); - } else { -- super.handleHealthUpdate(var1); -+ super.handleHealthUpdate(par1); - } -- - } - -+ /** -+ * Determines if an entity can be despawned, used on idle far away entities -+ */ - protected boolean canDespawn() { - return !this.isConverting(); - } - -+ /** -+ * Returns whether this zombie is in the process of converting to a villager -+ */ - public boolean isConverting() { - return this.getDataWatcher().getWatchableObjectByte(14) == 1; - } - -+ /** -+ * Convert this zombie into a villager. -+ */ - protected void convertToVillager() { - EntityVillager var1 = new EntityVillager(this.worldObj); - var1.copyLocationAndAnglesFrom(this); - var1.onSpawnWithEgg((EntityLivingData)null); - var1.func_82187_q(); -- if(this.isChild()) { -+ -+ if (this.isChild()) { - var1.setGrowingAge(-24000); - } - -@@ -369,17 +467,22 @@ - this.worldObj.playAuxSFXAtEntity((EntityPlayer)null, 1017, (int)this.posX, (int)this.posY, (int)this.posZ, 0); - } - -+ /** -+ * Return the amount of time decremented from conversionTime every tick. -+ */ - protected int getConversionTimeBoost() { - int var1 = 1; -- if(this.ab.nextFloat() < 0.01F) { -+ -+ if (this.rand.nextFloat() < 0.01F) { - int var2 = 0; - -- for(int var3 = (int)this.posX - 4; var3 < (int)this.posX + 4 && var2 < 14; ++var3) { -- for(int var4 = (int)this.posY - 4; var4 < (int)this.posY + 4 && var2 < 14; ++var4) { -- for(int var5 = (int)this.posZ - 4; var5 < (int)this.posZ + 4 && var2 < 14; ++var5) { -+ for (int var3 = (int)this.posX - 4; var3 < (int)this.posX + 4 && var2 < 14; ++var3) { -+ for (int var4 = (int)this.posY - 4; var4 < (int)this.posY + 4 && var2 < 14; ++var4) { -+ for (int var5 = (int)this.posZ - 4; var5 < (int)this.posZ + 4 && var2 < 14; ++var5) { - int var6 = this.worldObj.getBlockId(var3, var4, var5); -- if(var6 == Block.fenceIron.blockID || var6 == Block.bed.blockID) { -- if(this.ab.nextFloat() < 0.3F) { -+ -+ if (var6 == Block.fenceIron.blockID || var6 == Block.bed.blockID) { -+ if (this.rand.nextFloat() < 0.3F) { - ++var1; - } - ---- net/minecraft/src/BlockLeaves.java -+++ net/minecraft/src/BlockLeaves.java -@@ -3,15 +3,21 @@ - import java.util.List; - import java.util.Random; - -+import com.prupe.mcpatcher.cc.ColorizeBlock; -+import com.prupe.mcpatcher.cc.Colorizer; -+ - public class BlockLeaves extends BlockLeavesBase { -- public static final String[] a = new String[]{"oak", "spruce", "birch", "jungle"}; -- public static final String[][] b = new String[][]{{"leaves_oak", "leaves_spruce", "leaves_birch", "leaves_jungle"}, {"leaves_oak_opaque", "leaves_spruce_opaque", "leaves_birch_opaque", "leaves_jungle_opaque"}}; -+ public static final String[] LEAF_TYPES = new String[] {"oak", "spruce", "birch", "jungle"}; -+ public static final String[][] field_94396_b = new String[][] {{"leaves_oak", "leaves_spruce", "leaves_birch", "leaves_jungle"}, {"leaves_oak_opaque", "leaves_spruce_opaque", "leaves_birch_opaque", "leaves_jungle_opaque"}}; -+ -+ -+ /** 1 for fast graphic. 0 for fancy graphics. used in iconArray. */ - private int iconType; - private Icon[][] iconArray = new Icon[2][]; - int[] adjacentTreeBlocks; - -- protected BlockLeaves(int var1) { -- super(var1, Material.leaves, false); -+ protected BlockLeaves(int par1) { -+ super(par1, Material.leaves, false); - this.setTickRandomly(true); - this.setCreativeTab(CreativeTabs.tabDecorations); - } -@@ -22,26 +28,38 @@ - return ColorizerFoliage.getFoliageColor(var1, var3); - } - -- public int getRenderColor(int var1) { -- return (var1 & 3) == 1 ? ColorizerFoliage.getFoliageColorPine() : ((var1 & 3) == 2 ? ColorizerFoliage.getFoliageColorBirch() : ColorizerFoliage.getFoliageColorBasic()); -+ /** -+ * Returns the color this block should be rendered. Used by leaves. -+ */ -+ public int getRenderColor(int par1) { -+ return (par1 & 3) == 1 ? ColorizerFoliage.getFoliageColorPine() : ((par1 & 3) == 2 ? ColorizerFoliage.getFoliageColorBirch() : ColorizerFoliage.getFoliageColorBasic()); - } - -- public int colorMultiplier(IBlockAccess var1, int var2, int var3, int var4) { -- int var5 = var1.getBlockMetadata(var2, var3, var4); -- if((var5 & 3) == 1) { -- return ColorizerFoliage.getFoliageColorPine(); -- } else if((var5 & 3) == 2) { -- return ColorizerFoliage.getFoliageColorBirch(); -+ /** -+ * Returns a integer with hex for 0xrrggbb with this color multiplied against the blocks color. Note only called when -+ * first determining what to render. -+ */ -+ public int colorMultiplier(IBlockAccess par1IBlockAccess, int par2, int par3, int par4) { -+ int var5 = par1IBlockAccess.getBlockMetadata(par2, par3, par4); -+ -+ if ((var5 & 3) == 1) { -+ // MCPatcher Start -+ return ColorizeBlock.colorizeBiomeWithBlending(ColorizerFoliage.getFoliageColorPine(), Colorizer.COLOR_MAP_PINE, par2, par3, par4); -+ // MCPatcher End -+ } else if ((var5 & 3) == 2) { -+ // MCPatcher Start -+ return ColorizeBlock.colorizeBiomeWithBlending(ColorizerFoliage.getFoliageColorBirch(), Colorizer.COLOR_MAP_BIRCH, par2, par3, par4); -+ // MCPatcher End - } else { - int var6 = 0; - int var7 = 0; - int var8 = 0; - -- for(int var9 = -1; var9 <= 1; ++var9) { -- for(int var10 = -1; var10 <= 1; ++var10) { -- int var11 = var1.getBiomeGenForCoords(var2 + var10, var4 + var9).getBiomeFoliageColor(); -+ for (int var9 = -1; var9 <= 1; ++var9) { -+ for (int var10 = -1; var10 <= 1; ++var10) { -+ int var11 = par1IBlockAccess.getBiomeGenForCoords(par2 + var10, par4 + var9).getBiomeFoliageColor(); - var6 += (var11 & 16711680) >> 16; -- var7 += (var11 & '\uff00') >> 8; -+ var7 += (var11 & 65280) >> 8; - var8 += var11 & 255; - } - } -@@ -50,222 +68,260 @@ - } - } - -- public void breakBlock(World var1, int var2, int var3, int var4, int var5, int var6) { -+ /** -+ * Called on server worlds only when the block has been replaced by a different block ID, or the same block with a -+ * different metadata value, but before the new metadata value is set. Args: World, x, y, z, old block ID, old metadata -+ */ -+ public void breakBlock(World par1World, int par2, int par3, int par4, int par5, int par6) { - byte var7 = 1; - int var8 = var7 + 1; -- if(var1.checkChunksExist(var2 - var8, var3 - var8, var4 - var8, var2 + var8, var3 + var8, var4 + var8)) { -- for(int var9 = -var7; var9 <= var7; ++var9) { -- for(int var10 = -var7; var10 <= var7; ++var10) { -- for(int var11 = -var7; var11 <= var7; ++var11) { -- int var12 = var1.getBlockId(var2 + var9, var3 + var10, var4 + var11); -- if(var12 == Block.leaves.blockID) { -- int var13 = var1.getBlockMetadata(var2 + var9, var3 + var10, var4 + var11); -- var1.setBlockMetadata(var2 + var9, var3 + var10, var4 + var11, var13 | 8, 4); -+ -+ if (par1World.checkChunksExist(par2 - var8, par3 - var8, par4 - var8, par2 + var8, par3 + var8, par4 + var8)) { -+ for (int var9 = -var7; var9 <= var7; ++var9) { -+ for (int var10 = -var7; var10 <= var7; ++var10) { -+ for (int var11 = -var7; var11 <= var7; ++var11) { -+ int var12 = par1World.getBlockId(par2 + var9, par3 + var10, par4 + var11); -+ -+ if (var12 == Block.leaves.blockID) { -+ int var13 = par1World.getBlockMetadata(par2 + var9, par3 + var10, par4 + var11); -+ par1World.setBlockMetadataWithNotify(par2 + var9, par3 + var10, par4 + var11, var13 | 8, 4); - } - } - } - } - } -- - } - -- public void updateTick(World var1, int var2, int var3, int var4, Random var5) { -- if(!var1.isRemote) { -- int var6 = var1.getBlockMetadata(var2, var3, var4); -- if((var6 & 8) != 0 && (var6 & 4) == 0) { -+ /** -+ * Ticks the block if it's been scheduled -+ */ -+ public void updateTick(World par1World, int par2, int par3, int par4, Random par5Random) { -+ if (!par1World.isRemote) { -+ int var6 = par1World.getBlockMetadata(par2, par3, par4); -+ -+ if ((var6 & 8) != 0 && (var6 & 4) == 0) { - byte var7 = 4; - int var8 = var7 + 1; - byte var9 = 32; - int var10 = var9 * var9; - int var11 = var9 / 2; -- if(this.adjacentTreeBlocks == null) { -+ -+ if (this.adjacentTreeBlocks == null) { - this.adjacentTreeBlocks = new int[var9 * var9 * var9]; - } - - int var12; -- if(var1.checkChunksExist(var2 - var8, var3 - var8, var4 - var8, var2 + var8, var3 + var8, var4 + var8)) { -- var12 = -var7; -- -- label112: -- while(true) { -- int var13; -- int var14; -- int var15; -- if(var12 > var7) { -- var12 = 1; -- -- while(true) { -- if(var12 > 4) { -- break label112; -- } -- -- for(var13 = -var7; var13 <= var7; ++var13) { -- for(var14 = -var7; var14 <= var7; ++var14) { -- for(var15 = -var7; var15 <= var7; ++var15) { -- if(this.adjacentTreeBlocks[(var13 + var11) * var10 + (var14 + var11) * var9 + var15 + var11] == var12 - 1) { -- if(this.adjacentTreeBlocks[(var13 + var11 - 1) * var10 + (var14 + var11) * var9 + var15 + var11] == -2) { -- this.adjacentTreeBlocks[(var13 + var11 - 1) * var10 + (var14 + var11) * var9 + var15 + var11] = var12; -- } -- -- if(this.adjacentTreeBlocks[(var13 + var11 + 1) * var10 + (var14 + var11) * var9 + var15 + var11] == -2) { -- this.adjacentTreeBlocks[(var13 + var11 + 1) * var10 + (var14 + var11) * var9 + var15 + var11] = var12; -- } -- -- if(this.adjacentTreeBlocks[(var13 + var11) * var10 + (var14 + var11 - 1) * var9 + var15 + var11] == -2) { -- this.adjacentTreeBlocks[(var13 + var11) * var10 + (var14 + var11 - 1) * var9 + var15 + var11] = var12; -- } -- -- if(this.adjacentTreeBlocks[(var13 + var11) * var10 + (var14 + var11 + 1) * var9 + var15 + var11] == -2) { -- this.adjacentTreeBlocks[(var13 + var11) * var10 + (var14 + var11 + 1) * var9 + var15 + var11] = var12; -- } -- -- if(this.adjacentTreeBlocks[(var13 + var11) * var10 + (var14 + var11) * var9 + (var15 + var11 - 1)] == -2) { -- this.adjacentTreeBlocks[(var13 + var11) * var10 + (var14 + var11) * var9 + (var15 + var11 - 1)] = var12; -- } -- -- if(this.adjacentTreeBlocks[(var13 + var11) * var10 + (var14 + var11) * var9 + var15 + var11 + 1] == -2) { -- this.adjacentTreeBlocks[(var13 + var11) * var10 + (var14 + var11) * var9 + var15 + var11 + 1] = var12; -- } -- } -- } -- } -- } -- -- ++var12; -- } -- } -- -- for(var13 = -var7; var13 <= var7; ++var13) { -- for(var14 = -var7; var14 <= var7; ++var14) { -- var15 = var1.getBlockId(var2 + var12, var3 + var13, var4 + var14); -- if(var15 == Block.wood.blockID) { -+ -+ if (par1World.checkChunksExist(par2 - var8, par3 - var8, par4 - var8, par2 + var8, par3 + var8, par4 + var8)) { -+ int var13; -+ int var14; -+ int var15; -+ -+ for (var12 = -var7; var12 <= var7; ++var12) { -+ for (var13 = -var7; var13 <= var7; ++var13) { -+ for (var14 = -var7; var14 <= var7; ++var14) { -+ var15 = par1World.getBlockId(par2 + var12, par3 + var13, par4 + var14); -+ -+ if (var15 == Block.wood.blockID) { - this.adjacentTreeBlocks[(var12 + var11) * var10 + (var13 + var11) * var9 + var14 + var11] = 0; -- } else if(var15 == Block.leaves.blockID) { -+ } else if (var15 == Block.leaves.blockID) { - this.adjacentTreeBlocks[(var12 + var11) * var10 + (var13 + var11) * var9 + var14 + var11] = -2; - } else { - this.adjacentTreeBlocks[(var12 + var11) * var10 + (var13 + var11) * var9 + var14 + var11] = -1; - } - } - } -- -- ++var12; -+ } -+ -+ for (var12 = 1; var12 <= 4; ++var12) { -+ for (var13 = -var7; var13 <= var7; ++var13) { -+ for (var14 = -var7; var14 <= var7; ++var14) { -+ for (var15 = -var7; var15 <= var7; ++var15) { -+ if (this.adjacentTreeBlocks[(var13 + var11) * var10 + (var14 + var11) * var9 + var15 + var11] == var12 - 1) { -+ if (this.adjacentTreeBlocks[(var13 + var11 - 1) * var10 + (var14 + var11) * var9 + var15 + var11] == -2) { -+ this.adjacentTreeBlocks[(var13 + var11 - 1) * var10 + (var14 + var11) * var9 + var15 + var11] = var12; -+ } -+ -+ if (this.adjacentTreeBlocks[(var13 + var11 + 1) * var10 + (var14 + var11) * var9 + var15 + var11] == -2) { -+ this.adjacentTreeBlocks[(var13 + var11 + 1) * var10 + (var14 + var11) * var9 + var15 + var11] = var12; -+ } -+ -+ if (this.adjacentTreeBlocks[(var13 + var11) * var10 + (var14 + var11 - 1) * var9 + var15 + var11] == -2) { -+ this.adjacentTreeBlocks[(var13 + var11) * var10 + (var14 + var11 - 1) * var9 + var15 + var11] = var12; -+ } -+ -+ if (this.adjacentTreeBlocks[(var13 + var11) * var10 + (var14 + var11 + 1) * var9 + var15 + var11] == -2) { -+ this.adjacentTreeBlocks[(var13 + var11) * var10 + (var14 + var11 + 1) * var9 + var15 + var11] = var12; -+ } -+ -+ if (this.adjacentTreeBlocks[(var13 + var11) * var10 + (var14 + var11) * var9 + (var15 + var11 - 1)] == -2) { -+ this.adjacentTreeBlocks[(var13 + var11) * var10 + (var14 + var11) * var9 + (var15 + var11 - 1)] = var12; -+ } -+ -+ if (this.adjacentTreeBlocks[(var13 + var11) * var10 + (var14 + var11) * var9 + var15 + var11 + 1] == -2) { -+ this.adjacentTreeBlocks[(var13 + var11) * var10 + (var14 + var11) * var9 + var15 + var11 + 1] = var12; -+ } -+ } -+ } -+ } -+ } - } - } - - var12 = this.adjacentTreeBlocks[var11 * var10 + var11 * var9 + var11]; -- if(var12 >= 0) { -- var1.setBlockMetadata(var2, var3, var4, var6 & -9, 4); -+ -+ if (var12 >= 0) { -+ par1World.setBlockMetadataWithNotify(par2, par3, par4, var6 & -9, 4); - } else { -- this.removeLeaves(var1, var2, var3, var4); -+ this.removeLeaves(par1World, par2, par3, par4); - } - } -- -- } -- } -- -- public void randomDisplayTick(World var1, int var2, int var3, int var4, Random var5) { -- if(var1.canLightningStrikeAt(var2, var3 + 1, var4) && !var1.doesBlockHaveSolidTopSurface(var2, var3 - 1, var4) && var5.nextInt(15) == 1) { -- double var6 = (double)((float)var2 + var5.nextFloat()); -- double var8 = (double)var3 - 0.05D; -- double var10 = (double)((float)var4 + var5.nextFloat()); -- var1.spawnParticle("dripWater", var6, var8, var10, 0.0D, 0.0D, 0.0D); -- } -- -- } -- -- private void removeLeaves(World var1, int var2, int var3, int var4) { -- this.dropBlockAsItem(var1, var2, var3, var4, var1.getBlockMetadata(var2, var3, var4), 0); -- var1.setBlockToAir(var2, var3, var4); -- } -- -- public int quantityDropped(Random var1) { -- return var1.nextInt(20) == 0 ? 1 : 0; -- } -- -- public int idDropped(int var1, Random var2, int var3) { -+ } -+ } -+ -+ /** -+ * A randomly called display update to be able to add particles or other items for display -+ */ -+ public void randomDisplayTick(World par1World, int par2, int par3, int par4, Random par5Random) { -+ if (par1World.canLightningStrikeAt(par2, par3 + 1, par4) && !par1World.doesBlockHaveSolidTopSurface(par2, par3 - 1, par4) && par5Random.nextInt(15) == 1) { -+ double var6 = (double)((float)par2 + par5Random.nextFloat()); -+ double var8 = (double)par3 - 0.05D; -+ double var10 = (double)((float)par4 + par5Random.nextFloat()); -+ par1World.spawnParticle("dripWater", var6, var8, var10, 0.0D, 0.0D, 0.0D); -+ } -+ } -+ -+ private void removeLeaves(World par1World, int par2, int par3, int par4) { -+ this.dropBlockAsItem(par1World, par2, par3, par4, par1World.getBlockMetadata(par2, par3, par4), 0); -+ par1World.setBlockToAir(par2, par3, par4); -+ } -+ -+ /** -+ * Returns the quantity of items to drop on block destruction. -+ */ -+ public int quantityDropped(Random par1Random) { -+ return par1Random.nextInt(20) == 0 ? 1 : 0; -+ } -+ -+ /** -+ * Returns the ID of the items to drop on destruction. -+ */ -+ public int idDropped(int par1, Random par2Random, int par3) { - return Block.sapling.blockID; - } - -- public void dropBlockAsItemWithChance(World var1, int var2, int var3, int var4, int var5, float var6, int var7) { -- if(!var1.isRemote) { -+ /** -+ * Drops the block items with a specified chance of dropping the specified items -+ */ -+ public void dropBlockAsItemWithChance(World par1World, int par2, int par3, int par4, int par5, float par6, int par7) { -+ if (!par1World.isRemote) { - int var8 = 20; -- if((var5 & 3) == 3) { -+ -+ if ((par5 & 3) == 3) { - var8 = 40; - } - -- if(var7 > 0) { -- var8 -= 2 << var7; -- if(var8 < 10) { -+ if (par7 > 0) { -+ var8 -= 2 << par7; -+ -+ if (var8 < 10) { - var8 = 10; - } - } - -- if(var1.s.nextInt(var8) == 0) { -- int var9 = this.idDropped(var5, var1.s, var7); -- this.dropBlockAsItem_do(var1, var2, var3, var4, new ItemStack(var9, 1, this.damageDropped(var5))); -+ if (par1World.rand.nextInt(var8) == 0) { -+ int var9 = this.idDropped(par5, par1World.rand, par7); -+ this.dropBlockAsItem_do(par1World, par2, par3, par4, new ItemStack(var9, 1, this.damageDropped(par5))); - } - - var8 = 200; -- if(var7 > 0) { -- var8 -= 10 << var7; -- if(var8 < 40) { -+ -+ if (par7 > 0) { -+ var8 -= 10 << par7; -+ -+ if (var8 < 40) { - var8 = 40; - } - } - -- if((var5 & 3) == 0 && var1.s.nextInt(var8) == 0) { -- this.dropBlockAsItem_do(var1, var2, var3, var4, new ItemStack(Item.appleRed, 1, 0)); -+ if ((par5 & 3) == 0 && par1World.rand.nextInt(var8) == 0) { -+ this.dropBlockAsItem_do(par1World, par2, par3, par4, new ItemStack(Item.appleRed, 1, 0)); - } - } -- - } - -- public void harvestBlock(World var1, EntityPlayer var2, int var3, int var4, int var5, int var6) { -- if(!var1.isRemote && var2.getCurrentEquippedItem() != null && var2.getCurrentEquippedItem().itemID == Item.shears.itemID) { -- var2.addStat(StatList.mineBlockStatArray[this.blockID], 1); -- this.dropBlockAsItem_do(var1, var3, var4, var5, new ItemStack(Block.leaves.blockID, 1, var6 & 3)); -+ /** -+ * Called when the player destroys a block with an item that can harvest it. (i, j, k) are the coordinates of the block -+ * and l is the block's subtype/damage. -+ */ -+ public void harvestBlock(World par1World, EntityPlayer par2EntityPlayer, int par3, int par4, int par5, int par6) { -+ if (!par1World.isRemote && par2EntityPlayer.getCurrentEquippedItem() != null && par2EntityPlayer.getCurrentEquippedItem().itemID == Item.shears.itemID) { -+ par2EntityPlayer.addStat(StatList.mineBlockStatArray[this.blockID], 1); -+ this.dropBlockAsItem_do(par1World, par3, par4, par5, new ItemStack(Block.leaves.blockID, 1, par6 & 3)); - } else { -- super.harvestBlock(var1, var2, var3, var4, var5, var6); -+ super.harvestBlock(par1World, par2EntityPlayer, par3, par4, par5, par6); - } -- -- } -- -- public int damageDropped(int var1) { -- return var1 & 3; -- } -- -+ } -+ -+ /** -+ * Determines the damage on the item the block drops. Used in cloth and wood. -+ */ -+ public int damageDropped(int par1) { -+ return par1 & 3; -+ } -+ -+ /** -+ * Is this block (a) opaque and (b) a full 1m cube? This determines whether or not to render the shared face of two -+ * adjacent blocks and also whether the player can attach torches, redstone wire, etc to this block. -+ */ - public boolean isOpaqueCube() { - return !this.graphicsLevel; - } - -- public Icon getIcon(int var1, int var2) { -- return (var2 & 3) == 1 ? this.iconArray[this.iconType][1] : ((var2 & 3) == 3 ? this.iconArray[this.iconType][3] : ((var2 & 3) == 2 ? this.iconArray[this.iconType][2] : this.iconArray[this.iconType][0])); -- } -- -- public void setGraphicsLevel(boolean var1) { -- this.graphicsLevel = var1; -- this.iconType = var1 ? 0 : 1; -- } -- -- public void getSubBlocks(int var1, CreativeTabs var2, List var3) { -- var3.add(new ItemStack(var1, 1, 0)); -- var3.add(new ItemStack(var1, 1, 1)); -- var3.add(new ItemStack(var1, 1, 2)); -- var3.add(new ItemStack(var1, 1, 3)); -- } -- -- protected ItemStack createStackedBlock(int var1) { -- return new ItemStack(this.blockID, 1, var1 & 3); -- } -- -- public void registerIcons(IconRegister var1) { -- for(int var2 = 0; var2 < b.length; ++var2) { -- this.iconArray[var2] = new Icon[b[var2].length]; -- -- for(int var3 = 0; var3 < b[var2].length; ++var3) { -- this.iconArray[var2][var3] = var1.registerIcon(b[var2][var3]); -+ /** -+ * From the specified side and block metadata retrieves the blocks texture. Args: side, metadata -+ */ -+ public Icon getIcon(int par1, int par2) { -+ return (par2 & 3) == 1 ? this.iconArray[this.iconType][1] : ((par2 & 3) == 3 ? this.iconArray[this.iconType][3] : ((par2 & 3) == 2 ? this.iconArray[this.iconType][2] : this.iconArray[this.iconType][0])); -+ } -+ -+ /** -+ * Pass true to draw this block using fancy graphics, or false for fast graphics. -+ */ -+ public void setGraphicsLevel(boolean par1) { -+ this.graphicsLevel = par1; -+ this.iconType = par1 ? 0 : 1; -+ } -+ -+ /** -+ * returns a list of blocks with the same ID, but different meta (eg: wood returns 4 blocks) -+ */ -+ public void getSubBlocks(int par1, CreativeTabs par2CreativeTabs, List par3List) { -+ par3List.add(new ItemStack(par1, 1, 0)); -+ par3List.add(new ItemStack(par1, 1, 1)); -+ par3List.add(new ItemStack(par1, 1, 2)); -+ par3List.add(new ItemStack(par1, 1, 3)); -+ } -+ -+ /** -+ * Returns an item stack containing a single instance of the current block type. 'i' is the block's subtype/damage and -+ * is ignored for blocks which do not support subtypes. Blocks which cannot be harvested should return null. -+ */ -+ protected ItemStack createStackedBlock(int par1) { -+ return new ItemStack(this.blockID, 1, par1 & 3); -+ } -+ -+ /** -+ * When this method is called, your block should register all the icons it needs with the given IconRegister. This is -+ * the only chance you get to register icons. -+ */ -+ public void registerIcons(IconRegister par1IconRegister) { -+ for (int var2 = 0; var2 < field_94396_b.length; ++var2) { -+ this.iconArray[var2] = new Icon[field_94396_b[var2].length]; -+ -+ for (int var3 = 0; var3 < field_94396_b[var2].length; ++var3) { -+ this.iconArray[var2][var3] = par1IconRegister.registerIcon(field_94396_b[var2][var3]); - } - } -- - } - } ---- net/minecraft/src/CallableClientProfiler.java -+++ net/minecraft/src/CallableClientProfiler.java -@@ -5,8 +5,8 @@ - class CallableClientProfiler implements Callable { - final Minecraft theMinecraft; - -- CallableClientProfiler(Minecraft var1) { -- this.theMinecraft = var1; -+ CallableClientProfiler(Minecraft par1Minecraft) { -+ this.theMinecraft = par1Minecraft; - } - - public String callClientProfilerInfo() { ---- net/minecraft/src/TileEntityMobSpawnerRenderer.java -+++ net/minecraft/src/TileEntityMobSpawnerRenderer.java -@@ -3,30 +3,30 @@ - import org.lwjgl.opengl.GL11; - - public class TileEntityMobSpawnerRenderer extends TileEntitySpecialRenderer { -- public void renderTileEntityMobSpawner(TileEntityMobSpawner var1, double var2, double var4, double var6, float var8) { -+ public void renderTileEntityMobSpawner(TileEntityMobSpawner par1TileEntityMobSpawner, double par2, double par4, double par6, float par8) { - GL11.glPushMatrix(); -- GL11.glTranslatef((float)var2 + 0.5F, (float)var4, (float)var6 + 0.5F); -- func_98144_a(var1.getSpawnerLogic(), var2, var4, var6, var8); -+ GL11.glTranslatef((float)par2 + 0.5F, (float)par4, (float)par6 + 0.5F); -+ func_98144_a(par1TileEntityMobSpawner.getSpawnerLogic(), par2, par4, par6, par8); - GL11.glPopMatrix(); - } - -- public static void func_98144_a(MobSpawnerBaseLogic var0, double var1, double var3, double var5, float var7) { -- Entity var8 = var0.func_98281_h(); -- if(var8 != null) { -- var8.setWorld(var0.getSpawnerWorld()); -- float var9 = 7.0F / 16.0F; -+ public static void func_98144_a(MobSpawnerBaseLogic par0MobSpawnerBaseLogic, double par1, double par3, double par5, float par7) { -+ Entity var8 = par0MobSpawnerBaseLogic.func_98281_h(); -+ -+ if (var8 != null) { -+ var8.setWorld(par0MobSpawnerBaseLogic.getSpawnerWorld()); -+ float var9 = 0.4375F; - GL11.glTranslatef(0.0F, 0.4F, 0.0F); -- GL11.glRotatef((float)(var0.field_98284_d + (var0.field_98287_c - var0.field_98284_d) * (double)var7) * 10.0F, 0.0F, 1.0F, 0.0F); -+ GL11.glRotatef((float)(par0MobSpawnerBaseLogic.field_98284_d + (par0MobSpawnerBaseLogic.field_98287_c - par0MobSpawnerBaseLogic.field_98284_d) * (double)par7) * 10.0F, 0.0F, 1.0F, 0.0F); - GL11.glRotatef(-30.0F, 1.0F, 0.0F, 0.0F); - GL11.glTranslatef(0.0F, -0.4F, 0.0F); - GL11.glScalef(var9, var9, var9); -- var8.setLocationAndAngles(var1, var3, var5, 0.0F, 0.0F); -- RenderManager.instance.renderEntityWithPosYaw(var8, 0.0D, 0.0D, 0.0D, 0.0F, var7); -+ var8.setLocationAndAngles(par1, par3, par5, 0.0F, 0.0F); -+ RenderManager.instance.renderEntityWithPosYaw(var8, 0.0D, 0.0D, 0.0D, 0.0F, par7); - } -- - } - -- public void renderTileEntityAt(TileEntity var1, double var2, double var4, double var6, float var8) { -- this.renderTileEntityMobSpawner((TileEntityMobSpawner)var1, var2, var4, var6, var8); -+ public void renderTileEntityAt(TileEntity par1TileEntity, double par2, double par4, double par6, float par8) { -+ this.renderTileEntityMobSpawner((TileEntityMobSpawner)par1TileEntity, par2, par4, par6, par8); - } - } ---- /dev/null -+++ org/spoutcraft/api/gui/GenericPolygon.java -@@ -1,0 +1,104 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.api.gui; -+ -+import java.util.LinkedList; -+ -+import org.apache.commons.lang3.tuple.Pair; -+ -+import org.lwjgl.opengl.GL11; -+ -+import org.spoutcraft.api.Spoutcraft; -+ -+public class GenericPolygon extends GenericWidget implements Polygon { -+ LinkedList> points = new LinkedList>(); -+ Color lastColor = null; -+ -+ public WidgetType getType() { -+ return WidgetType.Polygon; -+ } -+ -+ public void render() { -+ GL11.glDisable(GL11.GL_TEXTURE_2D); -+ GL11.glEnable(GL11.GL_BLEND); -+ GL11.glDisable(GL11.GL_ALPHA_TEST); -+ GL11.glBlendFunc(770, 771); -+ GL11.glShadeModel(GL11.GL_SMOOTH); -+ MinecraftTessellator t = Spoutcraft.getTessellator(); -+ GL11.glTranslated(getActualX(), getActualY(), 0); -+ t.startDrawingQuads(); -+ for (Pair point:points) { -+ Point p = point.getLeft(); -+ Color c = point.getRight(); -+ t.setColorRGBAFloat(c.getRedF(), c.getGreenF(), c.getBlueF(), c.getAlphaF()); -+ t.addVertex(p.getX(), p.getY(), 0); -+ -+ } -+ t.draw(); -+ GL11.glShadeModel(GL11.GL_FLAT); -+ GL11.glDisable(GL11.GL_BLEND); -+ GL11.glEnable(GL11.GL_ALPHA_TEST); -+ GL11.glEnable(GL11.GL_TEXTURE_2D); -+ } -+ -+ public Polygon addPoint(Point p) throws IllegalStateException { -+ if (lastColor == null) { -+ throw new IllegalStateException("No color set."); -+ } -+ return addPoint(p, lastColor); -+ } -+ -+ public Polygon addPoint(int x, int y) throws IllegalStateException { -+ return addPoint(new Point(x, y)); -+ } -+ -+ public Polygon addPoint(Point p, Color c) { -+ lastColor = c.clone(); -+ Pair toAdd = Pair.of(p, c); -+ points.add(toAdd); -+ return this; -+ } -+ -+ public Polygon addPoint(int x, int y, Color c) { -+ return addPoint(new Point(x, y), c); -+ } -+ -+ public LinkedList getPoints() { -+ // TODO Auto-generated method stub -+ return null; -+ } -+ -+ public LinkedList getColors() { -+ // TODO Auto-generated method stub -+ return null; -+ } -+ -+ @Override -+ public double getWidth() { -+ // TODO Auto-generated method stub -+ return super.getWidth(); -+ } -+ -+ @Override -+ public double getHeight() { -+ // TODO Auto-generated method stub -+ return super.getHeight(); -+ } -+} ---- net/minecraft/src/CommandServerBan.java -+++ net/minecraft/src/CommandServerBan.java -@@ -8,39 +8,50 @@ - return "ban"; - } - -+ /** -+ * Return the required permission level for this command. -+ */ - public int getRequiredPermissionLevel() { - return 3; - } - -- public String getCommandUsage(ICommandSender var1) { -+ public String getCommandUsage(ICommandSender par1ICommandSender) { - return "commands.ban.usage"; - } - -- public boolean canCommandSenderUseCommand(ICommandSender var1) { -- return MinecraftServer.getServer().getConfigurationManager().getBannedPlayers().isListActive() && super.canCommandSenderUseCommand(var1); -+ /** -+ * Returns true if the given command sender is allowed to use this command. -+ */ -+ public boolean canCommandSenderUseCommand(ICommandSender par1ICommandSender) { -+ return MinecraftServer.getServer().getConfigurationManager().getBannedPlayers().isListActive() && super.canCommandSenderUseCommand(par1ICommandSender); - } - -- public void processCommand(ICommandSender var1, String[] var2) { -- if(var2.length >= 1 && var2[0].length() > 0) { -- EntityPlayerMP var3 = MinecraftServer.getServer().getConfigurationManager().getPlayerEntity(var2[0]); -- BanEntry var4 = new BanEntry(var2[0]); -- var4.setBannedBy(var1.getCommandSenderName()); -- if(var2.length >= 2) { -- var4.setBanReason(func_82360_a(var1, var2, 1)); -+ public void processCommand(ICommandSender par1ICommandSender, String[] par2ArrayOfStr) { -+ if (par2ArrayOfStr.length >= 1 && par2ArrayOfStr[0].length() > 0) { -+ EntityPlayerMP var3 = MinecraftServer.getServer().getConfigurationManager().getPlayerForUsername(par2ArrayOfStr[0]); -+ BanEntry var4 = new BanEntry(par2ArrayOfStr[0]); -+ var4.setBannedBy(par1ICommandSender.getCommandSenderName()); -+ -+ if (par2ArrayOfStr.length >= 2) { -+ var4.setBanReason(func_82360_a(par1ICommandSender, par2ArrayOfStr, 1)); - } - - MinecraftServer.getServer().getConfigurationManager().getBannedPlayers().put(var4); -- if(var3 != null) { -- var3.playerNetServerHandler.kickPlayer("You are banned from this server."); -+ -+ if (var3 != null) { -+ var3.playerNetServerHandler.kickPlayerFromServer("You are banned from this server."); - } - -- notifyAdmins(var1, "commands.ban.success", new Object[]{var2[0]}); -+ notifyAdmins(par1ICommandSender, "commands.ban.success", new Object[] {par2ArrayOfStr[0]}); - } else { - throw new WrongUsageException("commands.ban.usage", new Object[0]); - } - } - -- public List addTabCompletionOptions(ICommandSender var1, String[] var2) { -- return var2.length >= 1 ? getListOfStringsMatchingLastWord(var2, MinecraftServer.getServer().getAllUsernames()) : null; -+ /** -+ * Adds the strings available in this command to the given list of tab completion options. -+ */ -+ public List addTabCompletionOptions(ICommandSender par1ICommandSender, String[] par2ArrayOfStr) { -+ return par2ArrayOfStr.length >= 1 ? getListOfStringsMatchingLastWord(par2ArrayOfStr, MinecraftServer.getServer().getAllUsernames()) : null; - } - } ---- net/minecraft/src/ItemBed.java -+++ net/minecraft/src/ItemBed.java -@@ -1,46 +1,52 @@ - package net.minecraft.src; - - public class ItemBed extends Item { -- public ItemBed(int var1) { -- super(var1); -+ public ItemBed(int par1) { -+ super(par1); - this.setCreativeTab(CreativeTabs.tabDecorations); - } - -- public boolean onItemUse(ItemStack var1, EntityPlayer var2, World var3, int var4, int var5, int var6, int var7, float var8, float var9, float var10) { -- if(var3.isRemote) { -+ /** -+ * Callback for item usage. If the item does something special on right clicking, he will have one of those. Return -+ * True if something happen and false if it don't. This is for ITEMS, not BLOCKS -+ */ -+ public boolean onItemUse(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, World par3World, int par4, int par5, int par6, int par7, float par8, float par9, float par10) { -+ if (par3World.isRemote) { - return true; -- } else if(var7 != 1) { -+ } else if (par7 != 1) { - return false; - } else { -- ++var5; -+ ++par5; - BlockBed var11 = (BlockBed)Block.bed; -- int var12 = MathHelper.floor_double((double)(var2.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3; -+ int var12 = MathHelper.floor_double((double)(par2EntityPlayer.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3; - byte var13 = 0; - byte var14 = 0; -- if(var12 == 0) { -+ -+ if (var12 == 0) { - var14 = 1; - } - -- if(var12 == 1) { -+ if (var12 == 1) { - var13 = -1; - } - -- if(var12 == 2) { -+ if (var12 == 2) { - var14 = -1; - } - -- if(var12 == 3) { -+ if (var12 == 3) { - var13 = 1; - } - -- if(var2.canPlayerEdit(var4, var5, var6, var7, var1) && var2.canPlayerEdit(var4 + var13, var5, var6 + var14, var7, var1)) { -- if(var3.isAirBlock(var4, var5, var6) && var3.isAirBlock(var4 + var13, var5, var6 + var14) && var3.doesBlockHaveSolidTopSurface(var4, var5 - 1, var6) && var3.doesBlockHaveSolidTopSurface(var4 + var13, var5 - 1, var6 + var14)) { -- var3.setBlock(var4, var5, var6, var11.blockID, var12, 3); -- if(var3.getBlockId(var4, var5, var6) == var11.blockID) { -- var3.setBlock(var4 + var13, var5, var6 + var14, var11.blockID, var12 + 8, 3); -+ if (par2EntityPlayer.canPlayerEdit(par4, par5, par6, par7, par1ItemStack) && par2EntityPlayer.canPlayerEdit(par4 + var13, par5, par6 + var14, par7, par1ItemStack)) { -+ if (par3World.isAirBlock(par4, par5, par6) && par3World.isAirBlock(par4 + var13, par5, par6 + var14) && par3World.doesBlockHaveSolidTopSurface(par4, par5 - 1, par6) && par3World.doesBlockHaveSolidTopSurface(par4 + var13, par5 - 1, par6 + var14)) { -+ par3World.setBlock(par4, par5, par6, var11.blockID, var12, 3); -+ -+ if (par3World.getBlockId(par4, par5, par6) == var11.blockID) { -+ par3World.setBlock(par4 + var13, par5, par6 + var14, var11.blockID, var12 + 8, 3); - } - -- --var1.stackSize; -+ --par1ItemStack.stackSize; - return true; - } else { - return false; ---- /dev/null -+++ org/spoutcraft/api/material/MaterialData.java -@@ -1,0 +1,892 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.api.material; -+ -+import java.lang.reflect.Constructor; -+import java.lang.reflect.Field; -+import java.lang.reflect.Modifier; -+import java.util.HashMap; -+import java.util.LinkedList; -+import java.util.List; -+ -+import gnu.trove.map.hash.TIntObjectHashMap; -+ -+import org.spoutcraft.api.material.block.Air; -+import org.spoutcraft.api.material.block.DoubleSlabs; -+import org.spoutcraft.api.material.block.GenericLiquid; -+import org.spoutcraft.api.material.block.Grass; -+import org.spoutcraft.api.material.block.LongGrass; -+import org.spoutcraft.api.material.block.Sapling; -+import org.spoutcraft.api.material.block.Slab; -+import org.spoutcraft.api.material.block.Solid; -+import org.spoutcraft.api.material.block.StoneBricks; -+import org.spoutcraft.api.material.block.Tree; -+import org.spoutcraft.api.material.block.Wool; -+import org.spoutcraft.api.material.item.Coal; -+import org.spoutcraft.api.material.item.Dye; -+import org.spoutcraft.api.material.item.GenericArmor; -+import org.spoutcraft.api.material.item.GenericFood; -+import org.spoutcraft.api.material.item.GenericItem; -+import org.spoutcraft.api.material.item.GenericTool; -+import org.spoutcraft.api.material.item.GenericWeapon; -+import org.spoutcraft.api.material.item.Potion; -+import org.spoutcraft.api.material.item.SpawnEgg; -+ -+public class MaterialData { -+ private final static Object[] idLookup = new Object[3200]; -+ private final static List customBlocks = new LinkedList(); -+ private final static List customItems = new LinkedList(); -+ private final static TIntObjectHashMap customItemLookup = new TIntObjectHashMap(250); -+ private final static TIntObjectHashMap customBlockLookup = new TIntObjectHashMap(250); -+ private final static HashMap nameLookup = new HashMap(1000); -+ private final static int FLINT_ID = 318; -+ public static final Block air = new Air("Air"); -+ public static final Block stone = new Solid("Stone", 1); -+ public static final Block grass = new Grass("Grass"); -+ public static final Block dirt = new Solid("Dirt", 3); -+ public static final Block cobblestone = new Solid("Cobblestone", 4); -+ public static final Block wood = new Solid("Wooden Planks", 5, 0); -+ public static final Block spruceWood = new Solid("Wooden Planks", 5, 1); -+ public static final Block birchWood = new Solid("Wooden Planks", 5, 2); -+ public static final Block jungleWood = new Solid("Wooden Planks", 5, 3); -+ public static final Block sapling = new Sapling("Sapling", 0); -+ public static final Block spruceSapling = new Sapling("Spruce Sapling", 1); -+ public static final Block birchSapling = new Sapling("Birch Sapling", 2); -+ public static final Block jungleSapling = new Sapling("Sapling", 3); -+ public static final Block bedrock = new Solid("Bedrock", 7); -+ public static final Block water = new GenericLiquid("Water", 8, true); -+ public static final Block stationaryWater = new GenericLiquid("Stationary Water", 9, false); -+ public static final Block lava = new GenericLiquid("Lava", 10, true); -+ public static final Block stationaryLava = new GenericLiquid("Stationary Lava", 11, false); -+ public static final Block sand = new Solid("Sand", 12, true); -+ public static final Block gravel = new Solid("Gravel", 13, true); -+ public static final Block goldOre = new Solid("Gold Ore", 14); -+ public static final Block ironOre = new Solid("Iron Ore", 15); -+ public static final Block coalOre = new Solid("Coal Ore", 16); -+ public static final Block log = new Tree("Wood", 17, 0); -+ public static final Block spruceLog = new Tree("Wood", 17, 1); -+ public static final Block birchLog = new Tree("Wood", 17, 2); -+ public static final Block jungleLog = new Tree("Jungle Wood", 17, 3); -+ public static final Block leaves = new Tree("Leaves", 18, 0); -+ public static final Block spruceLeaves = new Tree("Leaves", 18, 1); -+ public static final Block birchLeaves = new Tree("Leaves", 18, 2); -+ public static final Block jungleLeaves = new Tree("Leaves", 18, 3); -+ public static final Block sponge = new Solid("Sponge", 19); -+ public static final Block glass = new Solid("Glass", 20); -+ public static final Block lapisOre = new Solid("Lapis Lazuli Ore", 21); -+ public static final Block lapisBlock = new Solid("Lapis Lazuli Block", 22); -+ public static final Block dispenser = new Solid("Dispenser", 23); -+ public static final Block sandstone = new Solid("Sandstone", 24, 0); -+ public static final Block decorativeSandstone = new Solid("Sandstone", 24, 1); -+ public static final Block smoothSandstone = new Solid("Sandstone", 24, 2); -+ public static final Block noteblock = new Solid("Note Block", 25); -+ public static final Block bedBlock = new Solid("Bed", 26); -+ public static final Block poweredRail = new Solid("Powered Rail", 27); -+ public static final Block detectorRail = new Solid("Detector Rail", 28); -+ public static final Block pistonStickyBase = new Solid("Sticky Piston", 29); -+ public static final Block web = new Solid("Cobweb", 30); -+ public static final Block deadShrub = new LongGrass("Dead Grass", 31, 0); -+ public static final Block tallGrass = new LongGrass("Tall Grass", 31, 1); -+ public static final Block fern = new LongGrass("Fern", 31, 2); -+ public static final Block deadBush = new LongGrass("Dead Shrubs", 32, 0); -+ public static final Block pistonBase = new Solid("Piston", 33); -+ public static final Block pistonExtension = new Solid("Piston (Head)", 34); -+ public static final Block whiteWool = new Wool("Wool", 35, 0); -+ public static final Block orangeWool = new Wool("Orange Wool", 35, 1); -+ public static final Block magentaWool = new Wool("Magenta Wool", 35, 2); -+ public static final Block lightBlueWool = new Wool("Light Blue Wool", 35, 3); -+ public static final Block yellowWool = new Wool("Yellow Wool", 35, 4); -+ public static final Block limeWool = new Wool("Light Green Wool", 35, 5); -+ public static final Block pinkWool = new Wool("Pink Wool", 35, 6); -+ public static final Block greyWool = new Wool("Grey Wool", 35, 7); -+ public static final Block lightGreyWool = new Wool("Light Grey Wool", 35, 8); -+ public static final Block cyanWool = new Wool("Cyan Wool", 35, 9); -+ public static final Block purpleWool = new Wool("Purple Wool", 35, 10); -+ public static final Block blueWool = new Wool("Blue Wool", 35, 11); -+ public static final Block brownWool = new Wool("Brown Wool", 35, 12); -+ public static final Block greenWool = new Wool("Dark Green Wool", 35, 13); -+ public static final Block redWool = new Wool("Red Wool", 35, 14); -+ public static final Block blackWool = new Wool("Black Wool", 35, 15); -+ public static final Block movedByPiston = new Solid("Moved By Piston", 36); -+ public static final Block dandelion = new Solid("Dandelion", 37); -+ public static final Block rose = new Solid("Rose", 38); -+ public static final Block brownMushroom = new Solid("Brown Mushroom", 39); -+ public static final Block redMushroom = new Solid("Red Mushroom", 40); -+ public static final Block goldBlock = new Solid("Gold Block", 41); -+ public static final Block ironBlock = new Solid("Iron Block", 42); -+ public static final Block stoneDoubleSlabs = new DoubleSlabs("Stone Double Slab", 43, 0); -+ public static final Block sandstoneDoubleSlabs = new DoubleSlabs("Sandstone Double Slab", 43, 1); -+ public static final Block cobblestoneDoubleSlabs = new DoubleSlabs("Stone Double Slab", 43, 3); -+ public static final Block brickDoubleSlabs = new DoubleSlabs("Brick Double Slab", 43, 4); -+ public static final Block stoneBrickDoubleSlabs = new DoubleSlabs("Stone Brick Double Slab", 43, 5); -+ public static final Block netherBrickDoubleSlabs = new DoubleSlabs("Nether Brick Double Slab", 43, 6); -+ public static final Block squartzBrickDoubleSlabs = new DoubleSlabs("Quartz Brick Double Slab", 43, 7); -+ public static final Block stoneSlab = new Slab("Stone Slab", 44, 0); -+ public static final Block sandstoneSlab = new Slab("Sandstone Slab", 44, 1); -+ public static final Block cobblestoneSlab = new Slab("Stone Slab", 44, 3); -+ public static final Block brickSlab = new Slab("Brick Slab", 44, 4); -+ public static final Block stoneBrickSlab = new Slab("Stone Brick Slab", 44, 5); -+ public static final Block netherBrickSlab = new Slab("Nether Brick Slab", 44, 6); -+ public static final Block quartzBrickSlab = new Slab("Quartz Brick Slab", 44, 7); -+ public static final Block brick = new Solid("Brick Block", 45); -+ public static final Block tnt = new Solid("TNT", 46); -+ public static final Block bookshelf = new Solid("Bookshelf", 47); -+ public static final Block mossStone = new Solid("Moss Stone", 48); -+ public static final Block obsidian = new Solid("Obsidian", 49); -+ public static final Block torch = new Solid("Torch", 50); -+ public static final Block fire = new Solid("Fire", 51); -+ public static final Block monsterSpawner = new Solid("Monster Spawner", 52); -+ public static final Block woodenStairs = new Solid("Wooden Stairs", 53); -+ public static final Block chest = new Solid("Chest", 54); -+ public static final Block redstoneWire = new Solid("Redstone Wire", 55); -+ public static final Block diamondOre = new Solid("Diamond Ore", 56); -+ public static final Block diamondBlock = new Solid("Diamond Block", 57); -+ public static final Block craftingTable = new Solid("Crafting Table", 58); -+ public static final Block crops = new Solid("Seeds", 59); -+ public static final Block farmland = new Solid("Farmland", 60); -+ public static final Block furnace = new Solid("Furnace", 61); -+ public static final Block burningfurnace = new Solid("Burning Furnace", 62); -+ public static final Block signPost = new Solid("Sign Post", 63); -+ public static final Block woodenDoorBlock = new Solid("Wooden Door", 64); -+ public static final Block ladders = new Solid("Ladders", 65); -+ public static final Block rails = new Solid("Rails", 66); -+ public static final Block cobblestoneStairs = new Solid("Cobblestone Stairs", 67); -+ public static final Block wallSign = new Solid("Wall Sign", 68); -+ public static final Block lever = new Solid("Lever", 69); -+ public static final Block stonePressurePlate = new Solid("Stone Pressure Plate", 70); -+ public static final Block ironDoorBlock = new Solid("Iron Door", 71); -+ public static final Block woodenPressurePlate = new Solid("Wooden Pressure Plate", 72); -+ public static final Block redstoneOre = new Solid("Redstone Ore", 73); -+ public static final Block glowingRedstoneOre = new Solid("Glowing Redstone Ore", 74); -+ public static final Block redstoneTorchOff = new Solid("Redstone Torch", 75); -+ public static final Block redstoneTorchOn = new Solid("Redstone Torch (On)", 76); -+ public static final Block stoneButton = new Solid("Stone Button", 77); -+ public static final Block snow = new Solid("Snow", 78); -+ public static final Block ice = new Solid("Ice", 79); -+ public static final Block snowBlock = new Solid("Snow Block", 80); -+ public static final Block cactus = new Solid("Cactus", 81); -+ public static final Block clayBlock = new Solid("Clay Block", 82); -+ public static final Block sugarCaneBlock = new Solid("Sugar Cane", 83); -+ public static final Block jukebox = new Solid("Jukebox", 84); -+ public static final Block fence = new Solid("Fence", 85); -+ public static final Block pumpkin = new Solid("Pumpkin", 86); -+ public static final Block netherrack = new Solid("Netherrack", 87); -+ public static final Block soulSand = new Solid("Soul Sand", 88); -+ public static final Block glowstoneBlock = new Solid("Glowstone Block", 89); -+ public static final Block portal = new Solid("Portal", 90); -+ public static final Block jackOLantern = new Solid("Jack 'o' Lantern", 91); -+ public static final Block cakeBlock = new Solid("Cake Block", 92); -+ public static final Block redstoneRepeaterOff = new Solid("Redstone Repeater", 93); -+ public static final Block redstoneRepeaterOn = new Solid("Redstone Repeater (On)", 94); -+ public static final Block lockedChest = new Solid("Locked Chest", 95); -+ public static final Block trapdoor = new Solid("Trapdoor", 96); -+ public static final Block silverfishStone = new Solid("Silverfish Stone", 97); -+ public static final Block stoneBricks = new StoneBricks("Stone Brick", 98, 0); -+ public static final Block mossyStoneBricks = new StoneBricks("Mossy Stone Brick", 98, 1); -+ public static final Block crackedStoneBricks = new StoneBricks("Cracked Stone Brick", 98, 2); -+ public static final Block circleStoneBricks = new StoneBricks("Circle Stone Brick", 98, 3); -+ public static final Block hugeBrownMushroom = new Solid("Huge Brown Mushroom", 99); -+ public static final Block hugeRedMushroom = new Solid("Huge Red Mushroom", 100); -+ public static final Block ironBars = new Solid("Iron Bars", 101); -+ public static final Block glassPane = new Solid("Glass Pane", 102); -+ public static final Block watermelon = new Solid("Watermelon", 103); -+ public static final Block pumpkinStem = new Solid("Pumpkin Stem", 104); -+ public static final Block melonStem = new Solid("Melon Stem", 105); -+ public static final Block vines = new Solid("Vines", 106); -+ public static final Block fenceGate = new Solid("Fence Gate", 107); -+ public static final Block brickStairs = new Solid("Brick Stairs", 108); -+ public static final Block stoneBrickStairs = new Solid("Stone Brick Stairs", 109); -+ public static final Block mycelium = new Solid("Mycelium", 110); -+ public static final Block lilyPad = new Solid("Lily Pad", 111); -+ public static final Block netherBrick = new Solid("Nether Brick", 112); -+ public static final Block netherBrickFence = new Solid("Nether Brick Fence", 113); -+ public static final Block netherBrickStairs = new Solid("Nether Brick Stairs", 114); -+ public static final Block netherWartBlock = new Solid("Nether Wart", 115); -+ public static final Block enchantmentTable = new Solid("Enchantment Table", 116); -+ public static final Block brewingStandBlock = new Solid("Brewing Stand", 117); -+ public static final Block cauldronBlock = new Solid("Cauldron", 118); -+ public static final Block endPortal = new Solid("End Portal", 119); -+ public static final Block endPortalFrame = new Solid("End Portal Frame", 120); -+ public static final Block endStone = new Solid("End Stone", 121); -+ public static final Block dragonEgg = new Solid("Dragon Egg", 122); -+ public static final Block redstoneLampOff = new Solid("Redstone Lamp (Off)", 123); -+ public static final Block redstoneLampOn = new Solid("Redstone Lamp", 124); -+ public static final Block oakWoodDoubleSlabs = new DoubleSlabs("Oak Wood Double Slab", 125, 0); -+ public static final Block spruceWoodDoubleSlabs = new DoubleSlabs("Spruce Wood Double Slab", 125, 1); -+ public static final Block birchWoodDoubleSlabs = new DoubleSlabs("Birch Wood Double Slab", 125, 2); -+ public static final Block jungleWoodDoubleSlabs = new DoubleSlabs("Jungle Wood Double Slab", 125, 3); -+ public static final Block oakWoodSlab = new Slab("Oak Wood Slab", 126, 0); -+ public static final Block spruceWoodSlab = new Slab("Spruce Wood Slab", 126, 1); -+ public static final Block birchWoodSlab = new Slab("Birch Wood Slab", 126, 2); -+ public static final Block jungleWoodSlab = new Slab("Jungle Wood Slab", 126, 3); -+ public static final Block cocoa = new Solid("Cocoa", 127); -+ public static final Block sandstoneStairs = new Solid("Sandstone Stairs", 128); -+ public static final Block emeraldOre = new Solid("Emerald Ore", 129); -+ public static final Block enderChest = new Solid("Ender Chest", 130); -+ public static final Block tripwireHook = new Solid("Tripwire Hook", 131); -+ public static final Block tripwire = new Solid("Tripwire", 132); -+ public static final Block emeraldBlock = new Solid("Block of Emerald", 133); -+ public static final Block spruceWoodStairs = new Solid("Spruce Wood Stairs", 134); -+ public static final Block birchWoodStairs = new Solid("Birch Wood Stairs", 135); -+ public static final Block jungleWoodStairs = new Solid("Jungle Wood Stairs", 136); -+ public static final Block command = new Solid("Command", 137); -+ public static final Block beacon = new Solid("Beacon", 138); -+ public static final Block cobblewall = new Solid("Cobblestone Wall", 139); -+ public static final Block mossyCobbleWall = new Solid("Mossy Cobblestone Wall", 139,1); -+ public static final Block flowerpot = new Solid("Flower Pot", 140); -+ public static final Block carrot = new Solid("Carrot", 141); -+ public static final Block potato = new Solid("Potato", 142); -+ public static final Block woodbutton = new Solid("Wood Button", 143); -+ public static final Block skull = new Solid("Skull", 144); -+ public static final Block anvil = new Solid("Anvil", 145); -+ public static final Block chestTrapped = new Solid("Trapped Chest", 146); -+ public static final Block pressurePlateGold = new Solid("Weighted Pressure Plate (Light)", 147); -+ public static final Block pressurePlateIron = new Solid("Weighted Pressure Plate (Heavy)", 148); -+ public static final Block redstoneComparatorIdle = new Solid("Redstone Comparator (inactive)", 149); -+ public static final Block redstoneComparatorActive = new Solid("Redstone Comparator (active)", 150); -+ public static final Block daylightSensor = new Solid("Daylight Sensor", 151); -+ public static final Block blockRedstone = new Solid("Redstone Block", 152); -+ public static final Block oreNetherQuartz = new Solid("Nether Quartz Ore", 153); -+ public static final Block hopperBlock = new Solid("Hopper", 154); -+ public static final Block blockNetherQuartz = new Solid("Quartz Block", 155); -+ public static final Block chiseledQuartzBlock = new Solid("Chiseled Quarts Block", 155,1); -+ public static final Block pillarQuartzBlock = new Solid("Chiseled Quarts Block", 155,2); -+ public static final Block stairsNetherQuartz = new Solid("Quartz Stairs", 156); -+ public static final Block railActivator = new Solid("Activator Rail", 157); -+ public static final Block dropper = new Solid("Dropper", 158); -+ public static final Block stainedClay = new Solid("White Stained Clay", 159); -+ public static final Block orangeStainedClay = new Solid("Orange Stained Clay", 159, 1); -+ public static final Block magentaStainedClay = new Solid("Magenta Stained Clay", 159, 2); -+ public static final Block liteBlueStainedClay = new Solid("Light Blue Stained Clay", 159, 3); -+ public static final Block yellowStainedClay = new Solid("Yellow Stained Clay", 159, 4); -+ public static final Block limeStainedClay = new Solid("Lime Stained Clay", 159, 5); -+ public static final Block pinkStainedClay = new Solid("Pink Stained Clay", 159, 6); -+ public static final Block grayStainedClay = new Solid("Orange Stained Clay", 159, 7); -+ public static final Block liteGrayStainedClay = new Solid("Light Gray Stained Clay", 159, 8); -+ public static final Block cyanStainedClay = new Solid("Cyan Stained Clay", 159, 9); -+ public static final Block purpleStainedClay = new Solid("Purple Stained Clay", 159, 10); -+ public static final Block blueStainedClay = new Solid("Blue Stained Clay", 159, 11); -+ public static final Block brownStainedClay = new Solid("Brown Stained Clay", 159, 12); -+ public static final Block greenStainedClay = new Solid("Green Stained Clay", 159, 13); -+ public static final Block redStainedClay = new Solid("Red Stained Clay", 159, 14); -+ public static final Block blackStainedClay = new Solid("Black Stained Clay", 159, 15); -+ public static final Block hay = new Solid("Hay", 170); -+ public static final Block carpet = new Solid("White Carpet", 171); -+ public static final Block orangeCarpet = new Solid("Orange Carpet", 171, 1); -+ public static final Block magentaCarpet = new Solid("Magenta Carpet", 171, 2); -+ public static final Block liteBlueCarpet = new Solid("Light Blue Carpet", 171, 3); -+ public static final Block yellowCarpet = new Solid("Yellow Carpet", 171, 4); -+ public static final Block limeCarpet = new Solid("Lime Carpet", 171, 5); -+ public static final Block pinkCarpet = new Solid("Pink Carpet", 171, 6); -+ public static final Block grayCarpet = new Solid("Gray Carpet", 171, 7); -+ public static final Block liteGrayCarpet = new Solid("Light Gray Carpet", 171, 8); -+ public static final Block cyanCarpet = new Solid("Cyan Carpet", 171, 9); -+ public static final Block purpleCarpet = new Solid("Purple Carpet", 171, 10); -+ public static final Block blueCarpet = new Solid("Blue Carpet", 171, 11); -+ public static final Block brownCarpet = new Solid("Brown Carpet", 171, 12); -+ public static final Block greenCarpet = new Solid("Green Carpet", 171, 13); -+ public static final Block redCarpet = new Solid("Red Carpet", 171, 14); -+ public static final Block blackCarpet = new Solid("Black Carpet", 171, 15); -+ public static final Block hardenedClay = new Solid("Hardened Clay", 172); -+ public static final Block coalBlock = new Solid("Coal Block", 173); -+ public static final Item ironShovel = new GenericTool("Iron Shovel", 256); -+ public static final Item ironPickaxe = new GenericTool("Iron Pickaxe", 257); -+ public static final Item ironAxe = new GenericTool("Iron Axe", 258); -+ public static final Item flintAndSteel = new GenericTool("Flint and Steel", 259); -+ public static final Item redApple = new GenericFood("Apple", 260, 4); -+ public static final Item bow = new GenericWeapon("Bow", 261); -+ public static final Item arrow = new GenericItem("Arrow", 262); -+ public static final Item coal = new Coal("Coal", 263, 0); -+ public static final Item charcoal = new Coal("Charcoal", 263, 1); -+ public static final Item diamond = new GenericItem("Diamond", 264); -+ public static final Item ironIngot = new GenericItem("Iron Ingot", 265); -+ public static final Item goldIngot = new GenericItem("Gold Ingot", 266); -+ public static final Item ironSword = new GenericWeapon("Iron Sword", 267); -+ public static final Item woodenSword = new GenericWeapon("Wooden Sword", 268); -+ public static final Item woodenShovel = new GenericTool("Wooden Shovel", 269); -+ public static final Item woodenPickaxe = new GenericTool("Wooden Pickaxe", 270); -+ public static final Item woodenAxe = new GenericTool("Wooden Axe", 271); -+ public static final Item stoneSword = new GenericWeapon("Stone Sword", 272); -+ public static final Item stoneShovel = new GenericTool("Stone Shovel", 273); -+ public static final Item stonePickaxe = new GenericTool("Stone Pickaxe", 274); -+ public static final Item stoneAxe = new GenericTool("Stone Axe", 275); -+ public static final Item diamondSword = new GenericWeapon("Diamond Sword", 276); -+ public static final Item diamondShovel = new GenericTool("Diamond Shovel", 277); -+ public static final Item diamondPickaxe = new GenericTool("Diamond Pickaxe", 278); -+ public static final Item diamondAxe = new GenericTool("Diamond Axe", 279); -+ public static final Item stick = new GenericItem("Stick", 280); -+ public static final Item bowl = new GenericItem("Bowl", 281); -+ public static final Item mushroomSoup = new GenericFood("Mushroom Soup", 282, 8); -+ public static final Item goldSword = new GenericWeapon("Gold Sword", 283); -+ public static final Item goldShovel = new GenericTool("Gold Shovel", 284); -+ public static final Item goldPickaxe = new GenericTool("Gold Pickaxe", 285); -+ public static final Item goldAxe = new GenericTool("Gold Axe", 286); -+ public static final Item string = new GenericItem("String", 287); -+ public static final Item feather = new GenericItem("Feather", 288); -+ public static final Item gunpowder = new GenericItem("Gunpowder", 289); -+ public static final Item woodenHoe = new GenericTool("Wooden Hoe", 290); -+ public static final Item stoneHoe = new GenericTool("Stone Hoe", 291); -+ public static final Item ironHoe = new GenericTool("Iron Hoe", 292); -+ public static final Item diamondHoe = new GenericTool("Diamond Hoe", 293); -+ public static final Item goldHoe = new GenericTool("Gold Hoe", 294); -+ public static final Item seeds = new GenericItem("Seeds", 295); -+ public static final Item wheat = new GenericItem("Wheat", 296); -+ public static final Item bread = new GenericFood("Bread", 297, 5); -+ public static final Item leatherCap = new GenericArmor("Leather Cap", 298); -+ public static final Item leatherTunic = new GenericArmor("Leather Tunic", 299); -+ public static final Item leatherPants = new GenericArmor("Leather Pants", 300); -+ public static final Item leatherBoots = new GenericArmor("Leather Boots", 301); -+ public static final Item chainHelmet = new GenericArmor("Chain Helmet", 302); -+ public static final Item chainChestplate = new GenericArmor("Chain Chestplate", 303); -+ public static final Item chainLeggings = new GenericArmor("Chain Leggings", 304); -+ public static final Item chainBoots = new GenericArmor("Chain Boots", 305); -+ public static final Item ironHelmet = new GenericArmor("Iron Helmet", 306); -+ public static final Item ironChestplate = new GenericArmor("Iron Chestplate", 307); -+ public static final Item ironLeggings = new GenericArmor("Iron Leggings", 308); -+ public static final Item ironBoots = new GenericArmor("Iron Boots", 309); -+ public static final Item diamondHelmet = new GenericArmor("Diamond Helmet", 310); -+ public static final Item diamondChestplate = new GenericArmor("Diamond Chestplate", 311); -+ public static final Item diamondLeggings = new GenericArmor("Diamond Leggings", 312); -+ public static final Item diamondBoots = new GenericArmor("Diamond Boots", 313); -+ public static final Item goldHelmet = new GenericArmor("Gold Helmet", 314); -+ public static final Item goldChestplate = new GenericArmor("Gold Chestplate", 315); -+ public static final Item goldLeggings = new GenericArmor("Gold Leggings", 316); -+ public static final Item goldBoots = new GenericArmor("Gold Boots", 317); -+ public static final Item flint = new GenericItem("Flint", 318, 0, true); -+ public static final Item rawPorkchop = new GenericFood("Raw Porkchop", 319, 3); -+ public static final Item cookedPorkchop = new GenericFood("Cooked Porkchop", 320, 8); -+ public static final Item paintings = new GenericItem("Paintings", 321); -+ public static final Item goldenApple = new GenericFood("Golden Apple", 322, 10); -+ public static final Item sign = new GenericItem("Sign", 323); -+ public static final Item woodenDoor = new GenericItem("Wooden Door", 324); -+ public static final Item bucket = new GenericItem("Bucket", 325); -+ public static final Item waterBucket = new GenericItem("Water Bucket", 326); -+ public static final Item lavaBucket = new GenericItem("Lava Bucket", 327); -+ public static final Item minecart = new GenericItem("Minecart", 328); -+ public static final Item saddle = new GenericItem("Saddle", 329); -+ public static final Item ironDoor = new GenericItem("Iron Door", 330); -+ public static final Item redstone = new GenericItem("Redstone", 331); -+ public static final Item snowball = new GenericItem("Snowball", 332); -+ public static final Item boat = new GenericItem("Boat", 333); -+ public static final Item leather = new GenericItem("Leather", 334); -+ public static final Item milk = new GenericItem("Milk", 335); -+ public static final Item clayBrick = new GenericItem("Brick", 336); -+ public static final Item clay = new GenericItem("Clay", 337); -+ public static final Item sugarCane = new GenericItem("Sugar Cane", 338); -+ public static final Item paper = new GenericItem("Paper", 339); -+ public static final Item book = new GenericItem("Book", 340); -+ public static final Item slimeball = new GenericItem("Slimeball", 341); -+ public static final Item minecartChest = new GenericItem("Minecart with Chest", 342); -+ public static final Item minecartFurnace = new GenericItem("Minecart with Furnace", 343); -+ public static final Item egg = new GenericItem("Egg", 344); -+ public static final Item compass = new GenericItem("Compass", 345); -+ public static final Item fishingRod = new GenericTool("Fishing Rod", 346); -+ public static final Item clock = new GenericItem("Clock", 347); -+ public static final Item glowstoneDust = new GenericItem("Glowstone Dust", 348); -+ public static final Item rawFish = new GenericFood("Raw Fish", 349, 2); -+ public static final Item cookedFish = new GenericFood("Cooked Fish", 350, 5); -+ public static final Item inkSac = new Dye("Ink Sac", 351, 0); -+ public static final Item roseRed = new Dye("Rose Red", 351, 1); -+ public static final Item cactusGreen = new Dye("Cactus Green", 351, 2); -+ public static final Item cocoaBeans = new Dye("Cocoa Beans", 351, 3); -+ public static final Item lapisLazuli = new Dye("Lapis Lazuli", 351, 4); -+ public static final Item purpleDye = new Dye("Purple Dye", 351, 5); -+ public static final Item cyanDye = new Dye("Cyan Dye", 351, 6); -+ public static final Item lightGrayDye = new Dye("Light Gray Dye", 351, 7); -+ public static final Item grayDye = new Dye("Gray Dye", 351, 8); -+ public static final Item pinkDye = new Dye("Pink Dye", 351, 9); -+ public static final Item limeDye = new Dye("Lime Dye", 351, 10); -+ public static final Item dandelionYellow = new Dye("Dandelion Yellow", 351, 11); -+ public static final Item lightBlueDye = new Dye("Light Blue Dye", 351, 12); -+ public static final Item magentaDye = new Dye("Magenta Dye", 351, 13); -+ public static final Item orangeDye = new Dye("Orange Dye", 351, 14); -+ public static final Item boneMeal = new Dye("Bone Meal", 351, 15); -+ public static final Item bone = new GenericItem("Bone", 352); -+ public static final Item sugar = new GenericItem("Sugar", 353); -+ public static final Item cake = new GenericItem("Cake", 354); -+ public static final Item bed = new GenericItem("Bed", 355); -+ public static final Item redstoneRepeater = new GenericItem("Redstone Repeater", 356); -+ public static final Item cookie = new GenericFood("Cookie", 357, 1); -+ public static final Item map = new GenericItem("Map (%s)", 358); -+ public static final Item shears = new GenericTool("Shears", 359); -+ public static final Item melonSlice = new GenericFood("Melon Slice", 360, 2); -+ public static final Item pumpkinSeeds = new GenericItem("Pumpkin Seeds", 361); -+ public static final Item melonSeeds = new GenericItem("Melon Seeds", 362); -+ public static final Item rawBeef = new GenericFood("Raw Beef", 363, 3); -+ public static final Item steak = new GenericFood("Steak", 364, 8); -+ public static final Item rawChicken = new GenericFood("Raw Chicken", 365, 2); -+ public static final Item cookedChicken = new GenericFood("Cooked Chicken", 366, 6); -+ public static final Item rottenFlesh = new GenericFood("Rotten Flesh", 367, 4); -+ public static final Item enderPearl = new GenericItem("Ender Pearl", 368); -+ public static final Item blazeRod = new GenericItem("Blaze Rod", 369); -+ public static final Item ghastTear = new GenericItem("Ghast Tear", 370); -+ public static final Item goldNugget = new GenericItem("Gold Nugget", 371); -+ public static final Item netherWart = new GenericItem("Nether Wart", 372); -+ // Potions - Base -+ public static final Item waterBottle = new Potion("Water Bottle", 373, 0); -+ public static final Item awkwardPotion = new Potion("Awkward Potion", 373, 16); -+ public static final Item thickPotion = new Potion("Thick Potion", 373, 32); -+ public static final Item mundanePotion = new Potion("Mundane Potion", 373, 64); -+ public static final Item mundanePotionExtended = new Potion("Mundane Potion", 373, 8192); -+ // Potions - Positive -+ public static final Item potionOfRegeneration = new Potion("Potion of Regeneration", 373, 8193); -+ public static final Item potionOfRegenerationExtended = new Potion("Potion of Regeneration", 373, 8257); -+ public static final Item potionOfRegenerationII = new Potion("Potion of Regeneration II", 373, 8225); -+ public static final Item potionOfSwiftness = new Potion("Potion of Swiftness", 373, 8194); -+ public static final Item potionOfSwiftnessExt = new Potion("Potion of Swiftness", 373, 8258); -+ public static final Item potionOfSwiftnessII = new Potion("Potion of Swiftness II", 373, 8226); -+ public static final Item potionOfFireResistance = new Potion("Potion of Fire Resistance", 373, 8195); -+ public static final Item potionOfFireResistanceExtended = new Potion("Potion of Fire Resistance", 373, 8259); -+ public static final Item potionOfFireResistanceReverted = new Potion("Potion of Fire Resistance", 373, 8227); -+ public static final Item potionOfHealing = new Potion("Potion of Healing", 373, 8197); -+ public static final Item potionOfHealingReverted = new Potion("Potion of Healing", 373, 8261); -+ public static final Item potionOfHealingII = new Potion("Potion of Healing II", 373, 8229); -+ public static final Item potionOfStrength = new Potion("Potion of Strength", 373, 8201); -+ public static final Item potionOfStrengthExtended = new Potion("Potion of Strength", 373, 8265); -+ public static final Item potionOfStrengthII = new Potion("Potion of Strength II", 373, 8233); -+ // Potions - Negative -+ public static final Item potionOfPoison = new Potion("Potion of Poison", 373, 8196); -+ public static final Item potionOfPoisonExtended = new Potion("Potion of Poison", 373, 8260); -+ public static final Item potionOfPoisonII = new Potion("Potion of Poison II", 373, 8228); -+ public static final Item potionOfWeakness = new Potion("Potion of Weakness", 373, 8200); -+ public static final Item potionOfWeaknessExtended = new Potion("Potion of Weakness", 373, 8264); -+ public static final Item potionOfWeaknessReverted = new Potion("Potion of Weakness", 373, 8232); -+ public static final Item potionOfSlowness = new Potion("Potion of Slowness", 373, 8202); -+ public static final Item potionOfSlownessExtended = new Potion("Potion of Slowness", 373, 8266); -+ public static final Item potionOfSlownessReverted = new Potion("Potion of Slowness", 373, 8234); -+ public static final Item potionOfHarming = new Potion("Potion of Harming", 373, 8204); -+ public static final Item potionOfHarmingReverted = new Potion("Potion of Harming", 373, 8268); -+ public static final Item potionOfHarmingII = new Potion("Potion of Harming II", 373, 8236); -+ // Potions - Unbrewable -+ public static final Item potionOfRegenerationIIExtended = new Potion("Potion of Regeneration II", 373, 8289); -+ public static final Item potionOfSwiftnessIIExtended = new Potion("Potion of Swiftness II", 373, 8290); -+ public static final Item potionOfStrengthIIExtended = new Potion("Potion of Strength II", 373, 8297); -+ public static final Item potionOfPoisonIIExtended = new Potion("Potion of Poison II", 373, 8292); -+ // Splash Potions - Base -+ public static final Item splashMundanePotion = new Potion("Splash Mundane Potion", 373, 16384); -+ // Splash Potions - Positive -+ public static final Item splashPotionOfRegeneration = new Potion("Splash Potion of Regeneration", 373, 16385); -+ public static final Item splashPotionOfRegenerationExtended = new Potion("Splash Potion of Regeneration", 373, 16449); -+ public static final Item splashPotionOfRegenerationII = new Potion("Splash Potion of Regeneration II", 373, 16417); -+ public static final Item splashPotionOfSwiftness = new Potion("Splash Potion of Swiftness", 373, 16386); -+ public static final Item splashPotionOfSwiftnessExt = new Potion("Splash Potion of Swiftness", 373, 16450); -+ public static final Item splashPotionOfSwiftnessII = new Potion("Splash Potion of Swiftness II", 373, 16418); -+ public static final Item splashPotionOfFireResistance = new Potion("Splash Potion of Fire Resistance", 373, 16387); -+ public static final Item splashPotionOfFireResistanceExtended = new Potion("Splash Potion of Fire Resistance", 373, 16451); -+ public static final Item splashPotionOfFireResistanceReverted = new Potion("Splash Potion of Fire Resistance", 373, 16419); -+ public static final Item splashPotionOfHealing = new Potion("Splash Potion of Healing", 373, 16389); -+ public static final Item splashPotionOfHealingReverted = new Potion("Splash Potion of Healing", 373, 16453); -+ public static final Item splashPotionOfHealingII = new Potion("Splash Potion of Healing II", 373, 16421); -+ public static final Item splashPotionOfStrength = new Potion("Splash Potion of Strength", 373, 16393); -+ public static final Item splashPotionOfStrengthExtended = new Potion("Splash Potion of Strength", 373, 16457); -+ public static final Item splashPotionOfStrengthII = new Potion("Splash Potion of Strength II", 373, 16425); -+ // Splash Potions - Negative -+ public static final Item splashPotionOfPoison = new Potion("Splash Potion of Poison", 373, 16388); -+ public static final Item splashPotionOfPoisonExtended = new Potion("Splash Potion of Poison", 373, 16452); -+ public static final Item splashPotionOfPoisonII = new Potion("Splash Potion of Poison II", 373, 16420); -+ public static final Item splashPotionOfWeakness = new Potion("Splash Potion of Weakness", 373, 16392); -+ public static final Item splashPotionOfWeaknessExtended = new Potion("Splash Potion of Weakness", 373, 16456); -+ public static final Item splashPotionOfWeaknessReverted = new Potion("Splash Potion of Weakness", 373, 16424); -+ public static final Item splashPotionOfSlowness = new Potion("Splash Potion of Slowness", 373, 16394); -+ public static final Item splashPotionOfSlownessExtended = new Potion("Splash Potion of Slowness", 373, 16458); -+ public static final Item splashPotionOfSlownessReverted = new Potion("Splash Potion of Slowness", 373, 16426); -+ public static final Item splashPotionOfHarming = new Potion("Splash Potion of Harming", 373, 16396); -+ public static final Item splashPotionOfHarmingReverted = new Potion("Splash Potion of Harming", 373, 16460); -+ public static final Item splashPotionOfHarmingII = new Potion("Splash Potion of Harming II", 373, 16428); -+ -+ // Splash Potions - Unbrewable -+ //public static final Item splashPotionOfRegenerationIIExtended = new Potion("Splash Potion of Regeneration II", 373, 16481); -+ //public static final Item splashPotionOfSwiftnessIIExtended = new Potion("Splash Potion of Swiftness II", 373, 16482); -+ //public static final Item splashPotionOfStrengthIIExtended = new Potion("Splash Potion of Strength II", 373, 16489); -+ //public static final Item splashPotionOfPoisonIIExtended = new Potion("Splash Potion of Poison II", 373, 16484); -+ public static final Item glassBottle = new GenericItem("Glass Bottle", 374); -+ public static final Item spiderEye = new GenericFood("Spider Eye", 375, 2); -+ public static final Item fermentedSpiderEye = new GenericItem("Fermented Spider Eye", 376); -+ public static final Item blazePowder = new GenericItem("Blaze Powder", 377); -+ public static final Item magmaCream = new GenericItem("Magma Cream", 378); -+ public static final Item brewingStand = new GenericItem("Brewing Stand", 379); -+ public static final Item cauldron = new GenericItem("Cauldron", 380); -+ public static final Item eyeOfEnder = new GenericItem("Eye of Ender", 381); -+ public static final Item glisteringMelon = new GenericItem("Glistering Melon", 382); -+ public static final Item spawnEggMooshroom = new SpawnEgg("Spawn Mooshroom", 383, 96); -+ public static final Item spawnEggSkeleton = new SpawnEgg("Spawn Skeleton", 383, 51); -+ public static final Item spawnEggCreeper = new SpawnEgg("Spawn Creeper", 383, 50); -+ public static final Item spawnEggSlime = new SpawnEgg("Spawn Slime", 383, 55); -+ public static final Item spawnEggZombie = new SpawnEgg("Spawn Zombie", 383, 54); -+ public static final Item spawnEggSpider = new SpawnEgg("Spawn Spider", 383, 52); -+ public static final Item spawnEggChicken = new SpawnEgg("Spawn Chicken", 383, 93); -+ public static final Item spawnEggCaveSpider = new SpawnEgg("Spawn Cave Spider", 383, 59); -+ public static final Item spawnEggCow = new SpawnEgg("Spawn Cow", 383, 92); -+ public static final Item spawnEggEnderman = new SpawnEgg("Spawn Enderman", 383, 58); -+ public static final Item spawnEggWolf = new SpawnEgg("Spawn Wolf", 383, 95); -+ public static final Item spawnEggPigZombie = new SpawnEgg("Spawn Pig Zombie", 383, 57); -+ public static final Item spawnEggSquid = new SpawnEgg("Spawn Squid", 383, 94); -+ public static final Item spawnEggGhast = new SpawnEgg("Spawn Ghast", 383, 56); -+ public static final Item spawnEggMagmaCube = new SpawnEgg("Spawn Magma Cube", 383, 62); -+ public static final Item spawnEggSheep = new SpawnEgg("Spawn Sheep", 383, 91); -+ public static final Item spawnEggBlaze = new SpawnEgg("Spawn Blaze", 383, 61); -+ public static final Item spawnEggVillager = new SpawnEgg("Spawn Villager", 383, 120); -+ public static final Item spawnEggSilverfish = new SpawnEgg("Spawn Silverfish", 383, 60); -+ public static final Item spawnEggPig = new SpawnEgg("Spawn Pig", 383, 90); -+ public static final Item spawnEggOcelot = new SpawnEgg("Spawn Ocelot", 383, 98); -+ public static final Item bottleOEnchanting = new GenericItem("Bottle o' Enchanting", 384); -+ public static final Item fireCharge = new GenericItem("Fire Charge", 385); -+ public static final Item bookAndQuill = new GenericItem("Book And Quill", 386); -+ public static final Item writtenBook = new GenericItem("Written Book", 387); -+ public static final Item emerald = new GenericItem("Emerald", 388); -+ public static final Item itemframe = new GenericItem("Item Frame", 389); -+ public static final Item flowerpotitem = new GenericItem("Flower Pot Item", 390); -+ public static final Item carrotitem = new GenericItem("Carrot Item", 391); -+ public static final Item potatoitem = new GenericItem("Potato Item", 392); -+ public static final Item bakedpotato = new GenericItem("Baked Potato", 393); -+ public static final Item poisonouspotato = new GenericItem("Poisonous Potato", 394); -+ public static final Item emptymap = new GenericItem("Empty Map", 395); -+ public static final Item goldencarrot = new GenericItem("Golden Carrot", 396); -+ public static final Item skullitem = new GenericItem("Skull Item", 397); -+ public static final Item carrotstick = new GenericItem("Carrot Stick", 398, 1); -+ public static final Item netherstar = new GenericItem("Nether Star", 399); -+ public static final Item pumpkinpie = new GenericItem("Pumpkin Pie", 400); -+ public static final Item firework = new GenericItem("Firework", 401); -+ public static final Item fireworkcharge = new GenericItem("Firework Charge", 402); -+ public static final Item enchantedbook = new GenericItem("Enchanted Book", 403); -+ public static final Item redstoneComparator = new GenericItem("Redstone Comparator", 404); -+ public static final Item netherBrickItem = new GenericItem("Nether Brick", 405); -+ public static final Item netherQuartzItem = new GenericItem("Nether Quarts", 406); -+ public static final Item minecartTNT = new GenericItem("Minecart TNT", 407); -+ public static final Item minecartHopper = new GenericItem("Minecart Hopper", 408); -+ public static final Item ironHorseArmor = new GenericItem("Iron Horse Armor", 417); -+ public static final Item goldHorseArmor = new GenericItem("Gold Horse Armor", 418); -+ public static final Item diamondHorseArmor = new GenericItem("Diamond Horse Armor", 419); -+ public static final Item lead = new GenericItem("Lead", 420); -+ public static final Item nameTag = new GenericItem("Name Tag", 421); -+ public static final Item goldMusicDisc = new GenericItem("Music Disc", 2256); -+ public static final Item greenMusicDisc = new GenericItem("Music Disc", 2257); -+ public static final Item orangeMusicDisc = new GenericItem("Music Disc", 2258); -+ public static final Item redMusicDisc = new GenericItem("Music Disc", 2259); -+ public static final Item cyanMusicDisc = new GenericItem("Music Disc", 2260); -+ public static final Item blueMusicDisc = new GenericItem("Music Disc", 2261); -+ public static final Item purpleMusicDisc = new GenericItem("Music Disc", 2262); -+ public static final Item blackMusicDisc = new GenericItem("Music Disc", 2263); -+ public static final Item whiteMusicDisc = new GenericItem("Music Disc", 2264); -+ public static final Item forestGreenMusicDisc = new GenericItem("Music Disc", 2265); -+ public static final Item brokenMusicDisc = new GenericItem("Music Disc", 2266); -+ static { -+ reset(); -+ } -+ -+ public static void reset() { -+ // Reset all values -+ for (int i = 0; i < idLookup.length; i++) { -+ idLookup[i] = null; -+ } -+ nameLookup.clear(); -+ customBlocks.clear(); -+ customBlockLookup.clear(); -+ customItems.clear(); -+ customItemLookup.clear(); -+ -+ Field[] fields = MaterialData.class.getFields(); -+ for (Field f : fields) { -+ if (Modifier.isStatic(f.getModifiers())) { -+ try { -+ Object value = f.get(null); -+ if (value instanceof Material) { -+ Material mat = (Material)value; -+ mat.setName(mat.getNotchianName()); -+ -+ int id = mat.getRawId(); -+ int data = mat.getRawData(); -+ -+ insertItem(id, data, mat); -+ } -+ } catch (IllegalArgumentException e) { -+ } catch (IllegalAccessException e) { -+ } -+ } -+ } -+ } -+ -+ private static void insertItem(int id, int data, Material mat) { -+ if (id < idLookup.length && id > -1) { -+ nameLookup.put(mat.getNotchianName().toLowerCase(), mat); -+ if (idLookup[mat.getRawId()] == null) { -+ idLookup[mat.getRawId()] = mat; -+ } else if (idLookup[mat.getRawId()] instanceof Material[]) { -+ Material[] multiple = (Material[])idLookup[mat.getRawId()]; -+ int size = mat.getRawData() * 2 + 1; -+ if (multiple.length < size) { -+ multiple = adjust(multiple, size); -+ } -+ multiple[mat.getRawData()] = mat; -+ idLookup[mat.getRawId()] = multiple; -+ } else if (idLookup[mat.getRawId()] instanceof Material) { -+ Material existing = (Material) idLookup[mat.getRawId()]; -+ int size = Math.max(existing.getRawData(), mat.getRawData()) * 2 + 1; -+ Material[] multiple = new Material[size]; -+ multiple[existing.getRawData()] = existing; -+ multiple[mat.getRawData()] = mat; -+ idLookup[mat.getRawId()] = multiple; -+ } else { -+ System.out.println("WARNING! Unknown lookup contents, " + idLookup[mat.getRawId()]); -+ } -+ } else { -+ System.out.println("WARNING! Material " + mat.getNotchianName() + " Could Not Fit " + id + ", " + data + " into the lookup array!"); -+ } -+ } -+ -+ private static Material[] adjust(Material[] oldArray, int size) { -+ Material[] newArray = new Material[size]; -+ for (int i = 0; i < oldArray.length; i++) { -+ newArray[i] = oldArray[i]; -+ } -+ return newArray; -+ } -+ -+ /** -+ * Adds a custom item to the material list -+ * @param item to add -+ */ -+ public static void addCustomItem(CustomItem item) { -+ customItemLookup.put(item.getCustomId(), item); -+ customItems.add(item); -+ nameLookup.put(item.getNotchianName().toLowerCase(), item); -+ } -+ -+ /** -+ * Adds a custom block to the material list -+ * @param block to add -+ */ -+ public static void addCustomBlock(CustomBlock block) { -+ customBlockLookup.put(block.getCustomId(), block); -+ customBlocks.add(block); -+ nameLookup.put(block.getNotchianName().toLowerCase(), block); -+ } -+ -+ /** -+ * -+ * @param Gets the material from the given id -+ * @return material, or null if none found -+ */ -+ public static Material getMaterial(int id) { -+ return getMaterial(id, (short)0); -+ } -+ -+ /** -+ * Gets the material from the given id and data. -+ * -+ * If a non-zero data value is given for a material with no subtypes, the material at the id and data value of zero will be returned instead. -+ * @param id to get -+ * @param data to get -+ * @return material or null if none found -+ */ -+ public static Material getMaterial(int id, short data) { -+ Object o = idLookup[id]; -+ if (id == FLINT_ID && data >= 1024) { -+ o = getCustomBlock(data); -+ if (o == null) { -+ o = getCustomItem(data); -+ } -+ return (Material)o; -+ } -+ if (o == null || o instanceof Material) { -+ return (Material)o; -+ } -+ Material[] materials = (Material[])o; -+ Material m = materials[0]; -+ if (data < materials.length && data > -1) { -+ return materials[data]; -+ } -+ return m; -+ } -+ -+ /** -+ * Gets the material from the given id and data, or creates it if nessecary. -+ * -+ * Creation occurs when a material exists at the given id, and zero data value, but does not have any subtypes. -+ * A new material that is a copy of the material at the given id and zero data value is created. -+ * If creation fails for any reason, null will be returned. -+ * If the material has subtypes normally, null will be returned if there is no subtype at the given data value -+ * @param id to get -+ * @param data to get -+ * @return material found, created, or null -+ */ -+ public static Material getOrCreateMaterial(int id, short data) { -+ Object o = idLookup[id]; -+ Material[] materials; -+ Material mat; -+ if (idLookup[id] == null) { -+ return null; -+ } -+ if (o instanceof Material) { -+ mat = (Material)o; -+ materials = new Material[Math.max(mat.getRawData(), data) *2 + 1]; -+ materials[mat.getRawData()] = mat; -+ } else { -+ materials = (Material[])o; -+ if (data >= materials.length) { -+ materials = adjust(materials, data * 2 + 1); -+ } -+ mat = materials[data]; -+ } -+ idLookup[id] = materials; -+ -+ if (mat != null && id != FLINT_ID) { -+ if (mat.getRawId() == id && mat.getRawData() == data) { -+ return mat; -+ } -+ Material orig = mat; -+ try { -+ Class[] params = {String.class, int.class, int.class, boolean.class}; -+ Constructor constructor = orig.getClass().getConstructor(params); -+ constructor.setAccessible(true); -+ mat = constructor.newInstance(orig.getName(), id, data, true); -+ insertItem(id, data, mat); -+ } catch (Exception e) { -+ System.out.println("[Spoutcraft] Available constructors: "); -+ for (Constructor c : orig.getClass().getConstructors()) { -+ System.out.println("[Spoutcraft] Constructor Params: " + c.getParameterTypes()); -+ } -+ e.printStackTrace(); -+ System.out.println("[Spoutcraft] Failed to create a duplicate item in MaterialData.getOrCreateMaterial, for " + id + ", " + data); -+ } -+ return mat; -+ } -+ return null; -+ } -+ -+ /** -+ * Gets the block at the given id, or null if none found -+ * @param id to get -+ * @return block, or null if none found -+ */ -+ public static Block getBlock(int id) { -+ return getBlock(id, (short)0); -+ } -+ -+ /** -+ * Gets the block at the given id and data, or null if none found -+ * @param id to get -+ * @param data to get -+ * @return block, or null if none found -+ */ -+ public static Block getBlock(int id, short data) { -+ Material mat = getMaterial(id, data); -+ if (mat instanceof Block) { -+ return (Block)mat; -+ } -+ return null; -+ } -+ -+ /** -+ * Gets an array of all currently registered custom blocks -+ * @return all registered custom blocks -+ */ -+ public static CustomBlock[] getCustomBlocks() { -+ CustomBlock[] blocks = new CustomBlock[customBlocks.size()]; -+ for (int i = 0; i < blocks.length; i++) { -+ blocks[i] = customBlocks.get(i); -+ } -+ return blocks; -+ } -+ -+ /** -+ * Gets an array of all currently registered custom items -+ * @return all registered custom items -+ */ -+ public static CustomItem[] getCustomItems() { -+ CustomItem[] items = new CustomItem[customItems.size()]; -+ for (int i = 0; i < items.length; i++) { -+ items[i] = customItems.get(i); -+ } -+ return items; -+ } -+ -+ /** -+ * Gets the custom block associated with the custom block id -+ * @param customId -+ * @return -+ */ -+ public static CustomBlock getCustomBlock(int customId) { -+ return customBlockLookup.get(customId); -+ } -+ -+ /** -+ * Gets the custom item associated with the given id -+ * @param customId to look up from -+ * @return custom item -+ */ -+ public static CustomItem getCustomItem(int customId) { -+ return customItemLookup.get(customId); -+ } -+ -+ /** -+ * Gets the item at the given id, or null if none found -+ * @param id to get -+ * @return item or null if none found -+ */ -+ public static Item getItem(int id) { -+ return getItem(id, (short)0); -+ } -+ -+ /** -+ * Gets the item at the given id and data, or null if none found -+ * @param id to get -+ * @param data to get -+ * @return item or null if none found -+ */ -+ public static Item getItem(int id, short data) { -+ Material mat = getMaterial(id, data); -+ if (mat instanceof Item) { -+ return (Item)mat; -+ } -+ return null; -+ } -+ -+ /** -+ * Returns a list of all the current materials in the game, notchian, custom, or otherwise -+ * @return a list of all materials -+ */ -+ public static List getMaterials() { -+ LinkedList materials = new LinkedList(); -+ for (int i = 0; i < idLookup.length; i++) { -+ if (idLookup[i] instanceof Material) { -+ materials.add((Material)idLookup[i]); -+ } else if (idLookup[i] instanceof Material[]) { -+ for (Material mat : ((Material[])idLookup[i])) { -+ if (mat != null) { -+ materials.add(mat); -+ } -+ } -+ } -+ } -+ materials.addAll(customBlocks); -+ materials.addAll(customItems); -+ return materials; -+ } -+ -+ /** -+ * Gets the associated material with its notchian name -+ * @param name to lookup -+ * @return material, or null if none found -+ */ -+ public static Material getMaterial(String notchianName) { -+ return nameLookup.get(notchianName.toLowerCase()); -+ } -+} ---- net/minecraft/src/Packet5PlayerInventory.java -+++ net/minecraft/src/Packet5PlayerInventory.java -@@ -5,49 +5,76 @@ - import java.io.IOException; - - public class Packet5PlayerInventory extends Packet { -+ -+ /** Entity ID of the object. */ - public int entityID; -+ -+ /** Equipment slot: 0=held, 1-4=armor slot */ - public int slot; -+ -+ /** The item in the slot format (an ItemStack) */ - private ItemStack itemSlot; - -- public Packet5PlayerInventory() { -- } -- -- public Packet5PlayerInventory(int var1, int var2, ItemStack var3) { -- this.entityID = var1; -- this.slot = var2; -- this.itemSlot = var3 == null ? null : var3.copy(); -- } -- -- public void readPacketData(DataInput var1) throws IOException { -- this.entityID = var1.readInt(); -- this.slot = var1.readShort(); -- this.itemSlot = readItemStack(var1); -- } -- -- public void writePacketData(DataOutput var1) throws IOException { -- var1.writeInt(this.entityID); -- var1.writeShort(this.slot); -- writeItemStack(this.itemSlot, var1); -- } -- -- public void processPacket(NetHandler var1) { -- var1.handlePlayerInventory(this); -- } -- -+ public Packet5PlayerInventory() {} -+ -+ public Packet5PlayerInventory(int par1, int par2, ItemStack par3ItemStack) { -+ this.entityID = par1; -+ this.slot = par2; -+ this.itemSlot = par3ItemStack == null ? null : par3ItemStack.copy(); -+ } -+ -+ /** -+ * Abstract. Reads the raw packet data from the data stream. -+ */ -+ public void readPacketData(DataInput par1DataInput) throws IOException { -+ this.entityID = par1DataInput.readInt(); -+ this.slot = par1DataInput.readShort(); -+ this.itemSlot = readItemStack(par1DataInput); -+ } -+ -+ /** -+ * Abstract. Writes the raw packet data to the data stream. -+ */ -+ public void writePacketData(DataOutput par1DataOutput) throws IOException { -+ par1DataOutput.writeInt(this.entityID); -+ par1DataOutput.writeShort(this.slot); -+ writeItemStack(this.itemSlot, par1DataOutput); -+ } -+ -+ /** -+ * Passes this Packet on to the NetHandler for processing. -+ */ -+ public void processPacket(NetHandler par1NetHandler) { -+ par1NetHandler.handlePlayerInventory(this); -+ } -+ -+ /** -+ * Abstract. Return the size of the packet (not counting the header). -+ */ - public int getPacketSize() { - return 8; - } - -+ /** -+ * Gets the item in the slot format (an ItemStack) -+ */ - public ItemStack getItemSlot() { - return this.itemSlot; - } - -+ /** -+ * only false for the abstract Packet class, all real packets return true -+ */ - public boolean isRealPacket() { - return true; - } - -- public boolean containsSameEntityIDAs(Packet var1) { -- Packet5PlayerInventory var2 = (Packet5PlayerInventory)var1; -+ /** -+ * eg return packet30entity.entityId == entityId; WARNING : will throw if you compare a packet to a different packet -+ * class -+ */ -+ public boolean containsSameEntityIDAs(Packet par1Packet) { -+ Packet5PlayerInventory var2 = (Packet5PlayerInventory)par1Packet; - return var2.entityID == this.entityID && var2.slot == this.slot; - } - } ---- net/minecraft/src/TaskWorldCreation.java -+++ net/minecraft/src/TaskWorldCreation.java -@@ -4,18 +4,19 @@ - import java.io.UnsupportedEncodingException; - - class TaskWorldCreation extends TaskLongRunning { -- private final String c; -- private final String d; -- private final String e; -+ private final String field_96589_c; -+ private final String field_96587_d; -+ private final String field_104065_f; - private final WorldTemplate field_111253_f; -+ - final GuiScreenCreateOnlineWorld field_96590_a; - -- public TaskWorldCreation(GuiScreenCreateOnlineWorld var1, String var2, String var3, String var4, WorldTemplate var5) { -- this.field_96590_a = var1; -- this.c = var2; -- this.d = var3; -- this.e = var4; -- this.field_111253_f = var5; -+ public TaskWorldCreation(GuiScreenCreateOnlineWorld par1GuiScreenCreateOnlineWorld, String par2Str, String par3Str, String par4Str, WorldTemplate par5WorldTemplate) { -+ this.field_96590_a = par1GuiScreenCreateOnlineWorld; -+ this.field_96589_c = par2Str; -+ this.field_96587_d = par3Str; -+ this.field_104065_f = par4Str; -+ this.field_111253_f = par5WorldTemplate; - } - - public void run() { -@@ -24,10 +25,10 @@ - McoClient var2 = new McoClient(GuiScreenCreateOnlineWorld.func_96248_a(this.field_96590_a).getSession()); - - try { -- if(this.field_111253_f != null) { -- var2.func_96386_a(this.c, this.d, this.e, this.field_111253_f.a); -+ if (this.field_111253_f != null) { -+ var2.func_96386_a(this.field_96589_c, this.field_96587_d, this.field_104065_f, this.field_111253_f.field_110734_a); - } else { -- var2.func_96386_a(this.c, this.d, this.e, "-1"); -+ var2.func_96386_a(this.field_96589_c, this.field_96587_d, this.field_104065_f, "-1"); - } - - GuiScreenCreateOnlineWorld.func_96246_c(this.field_96590_a).displayGuiScreen(GuiScreenCreateOnlineWorld.func_96247_b(this.field_96590_a)); -@@ -43,6 +44,5 @@ - } catch (Exception var7) { - this.setFailedMessage(var7.getLocalizedMessage()); - } -- - } - } ---- net/minecraft/src/EntitySheep.java -+++ net/minecraft/src/EntitySheep.java -@@ -4,12 +4,24 @@ - - public class EntitySheep extends EntityAnimal { - private final InventoryCrafting field_90016_e = new InventoryCrafting(new ContainerSheep(this), 2, 1); -- public static final float[][] fleeceColorTable = new float[][]{{1.0F, 1.0F, 1.0F}, {0.85F, 0.5F, 0.2F}, {0.7F, 0.3F, 0.85F}, {0.4F, 0.6F, 0.85F}, {0.9F, 0.9F, 0.2F}, {0.5F, 0.8F, 0.1F}, {0.95F, 0.5F, 0.65F}, {0.3F, 0.3F, 0.3F}, {0.6F, 0.6F, 0.6F}, {0.3F, 0.5F, 0.6F}, {0.5F, 0.25F, 0.7F}, {0.2F, 0.3F, 0.7F}, {0.4F, 0.3F, 0.2F}, {0.4F, 0.5F, 0.2F}, {0.6F, 0.2F, 0.2F}, {0.1F, 0.1F, 0.1F}}; -+ -+ /** -+ * Holds the RGB table of the sheep colors - in OpenGL glColor3f values - used to render the sheep colored fleece. -+ */ -+ // Spout Start - Removed final -+ public static float[][] fleeceColorTable = new float[][] {{1.0F, 1.0F, 1.0F}, {0.85F, 0.5F, 0.2F}, {0.7F, 0.3F, 0.85F}, {0.4F, 0.6F, 0.85F}, {0.9F, 0.9F, 0.2F}, {0.5F, 0.8F, 0.1F}, {0.95F, 0.5F, 0.65F}, {0.3F, 0.3F, 0.3F}, {0.6F, 0.6F, 0.6F}, {0.3F, 0.5F, 0.6F}, {0.5F, 0.25F, 0.7F}, {0.2F, 0.3F, 0.7F}, {0.4F, 0.3F, 0.2F}, {0.4F, 0.5F, 0.2F}, {0.6F, 0.2F, 0.2F}, {0.1F, 0.1F, 0.1F}}; -+ // Spout End -+ -+ /** -+ * Used to control movement as well as wool regrowth. Set to 40 on handleHealthUpdate and counts down with each tick. -+ */ - private int sheepTimer; -+ -+ /** The eat grass AI task for this mob. */ - private EntityAIEatGrass aiEatGrass = new EntityAIEatGrass(this); - -- public EntitySheep(World var1) { -- super(var1); -+ public EntitySheep(World par1World) { -+ super(par1World); - this.setSize(0.9F, 1.3F); - this.getNavigator().setAvoidsWater(true); - this.tasks.addTask(0, new EntityAISwimming(this)); -@@ -25,6 +37,9 @@ - this.field_90016_e.setInventorySlotContents(1, new ItemStack(Item.dyePowder, 1, 0)); - } - -+ /** -+ * Returns true if the newer Entity AI code should be run -+ */ - protected boolean isAIEnabled() { - return true; - } -@@ -34,8 +49,12 @@ - super.updateAITasks(); - } - -+ /** -+ * Called frequently so the entity can update its state every tick as required. For example, zombies and skeletons use -+ * this to react to sunlight and start to burn. -+ */ - public void onLivingUpdate() { -- if(this.worldObj.isRemote) { -+ if (this.worldObj.isRemote) { - this.sheepTimer = Math.max(0, this.sheepTimer - 1); - } - -@@ -45,7 +64,7 @@ - protected void applyEntityAttributes() { - super.applyEntityAttributes(); - this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setAttribute(8.0D); -- this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setAttribute((double)0.23F); -+ this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setAttribute(0.23000000417232513D); - } - - protected void entityInit() { -@@ -53,86 +72,113 @@ - this.dataWatcher.addObject(16, new Byte((byte)0)); - } - -- protected void dropFewItems(boolean var1, int var2) { -- if(!this.getSheared()) { -+ /** -+ * Drop 0-2 items of this living's type. @param par1 - Whether this entity has recently been hit by a player. @param -+ * par2 - Level of Looting used to kill this mob. -+ */ -+ protected void dropFewItems(boolean par1, int par2) { -+ if (!this.getSheared()) { - this.entityDropItem(new ItemStack(Block.cloth.blockID, 1, this.getFleeceColor()), 0.0F); - } -- - } - -+ /** -+ * Returns the item ID for the item the mob drops on death. -+ */ - protected int getDropItemId() { - return Block.cloth.blockID; - } - -- public void handleHealthUpdate(byte var1) { -- if(var1 == 10) { -+ public void handleHealthUpdate(byte par1) { -+ if (par1 == 10) { - this.sheepTimer = 40; - } else { -- super.handleHealthUpdate(var1); -+ super.handleHealthUpdate(par1); - } -- -- } -- -- public float func_70894_j(float var1) { -- return this.sheepTimer <= 0 ? 0.0F : (this.sheepTimer >= 4 && this.sheepTimer <= 36 ? 1.0F : (this.sheepTimer < 4 ? ((float)this.sheepTimer - var1) / 4.0F : -((float)(this.sheepTimer - 40) - var1) / 4.0F)); -- } -- -- public float func_70890_k(float var1) { -- if(this.sheepTimer > 4 && this.sheepTimer <= 36) { -- float var2 = ((float)(this.sheepTimer - 4) - var1) / 32.0F; -- return (float)Math.PI * 0.2F + (float)Math.PI * 0.07F * MathHelper.sin(var2 * 28.7F); -+ } -+ -+ public float func_70894_j(float par1) { -+ return this.sheepTimer <= 0 ? 0.0F : (this.sheepTimer >= 4 && this.sheepTimer <= 36 ? 1.0F : (this.sheepTimer < 4 ? ((float)this.sheepTimer - par1) / 4.0F : -((float)(this.sheepTimer - 40) - par1) / 4.0F)); -+ } -+ -+ public float func_70890_k(float par1) { -+ if (this.sheepTimer > 4 && this.sheepTimer <= 36) { -+ float var2 = ((float)(this.sheepTimer - 4) - par1) / 32.0F; -+ return ((float)Math.PI / 5F) + ((float)Math.PI * 7F / 100F) * MathHelper.sin(var2 * 28.7F); - } else { -- return this.sheepTimer > 0 ? (float)Math.PI * 0.2F : this.rotationPitch / (180.0F / (float)Math.PI); -+ return this.sheepTimer > 0 ? ((float)Math.PI / 5F) : this.rotationPitch / (180F / (float)Math.PI); - } - } - -- public boolean interact(EntityPlayer var1) { -- ItemStack var2 = var1.inventory.getCurrentItem(); -- if(var2 != null && var2.itemID == Item.shears.itemID && !this.getSheared() && !this.isChild()) { -- if(!this.worldObj.isRemote) { -+ /** -+ * Called when a player interacts with a mob. e.g. gets milk from a cow, gets into the saddle on a pig. -+ */ -+ public boolean interact(EntityPlayer par1EntityPlayer) { -+ ItemStack var2 = par1EntityPlayer.inventory.getCurrentItem(); -+ -+ if (var2 != null && var2.itemID == Item.shears.itemID && !this.getSheared() && !this.isChild()) { -+ if (!this.worldObj.isRemote) { - this.setSheared(true); -- int var3 = 1 + this.ab.nextInt(3); -+ int var3 = 1 + this.rand.nextInt(3); - -- for(int var4 = 0; var4 < var3; ++var4) { -+ for (int var4 = 0; var4 < var3; ++var4) { - EntityItem var5 = this.entityDropItem(new ItemStack(Block.cloth.blockID, 1, this.getFleeceColor()), 1.0F); -- var5.motionY += (double)(this.ab.nextFloat() * 0.05F); -- var5.motionX += (double)((this.ab.nextFloat() - this.ab.nextFloat()) * 0.1F); -- var5.motionZ += (double)((this.ab.nextFloat() - this.ab.nextFloat()) * 0.1F); -+ var5.motionY += (double)(this.rand.nextFloat() * 0.05F); -+ var5.motionX += (double)((this.rand.nextFloat() - this.rand.nextFloat()) * 0.1F); -+ var5.motionZ += (double)((this.rand.nextFloat() - this.rand.nextFloat()) * 0.1F); - } - } - -- var2.damageItem(1, var1); -+ var2.damageItem(1, par1EntityPlayer); - this.playSound("mob.sheep.shear", 1.0F, 1.0F); - } - -- return super.interact(var1); -- } -- -- public void writeEntityToNBT(NBTTagCompound var1) { -- super.writeEntityToNBT(var1); -- var1.setBoolean("Sheared", this.getSheared()); -- var1.setByte("Color", (byte)this.getFleeceColor()); -- } -- -- public void readEntityFromNBT(NBTTagCompound var1) { -- super.readEntityFromNBT(var1); -- this.setSheared(var1.getBoolean("Sheared")); -- this.setFleeceColor(var1.getByte("Color")); -- } -- -+ return super.interact(par1EntityPlayer); -+ } -+ -+ /** -+ * (abstract) Protected helper method to write subclass entity data to NBT. -+ */ -+ public void writeEntityToNBT(NBTTagCompound par1NBTTagCompound) { -+ super.writeEntityToNBT(par1NBTTagCompound); -+ par1NBTTagCompound.setBoolean("Sheared", this.getSheared()); -+ par1NBTTagCompound.setByte("Color", (byte)this.getFleeceColor()); -+ } -+ -+ /** -+ * (abstract) Protected helper method to read subclass entity data from NBT. -+ */ -+ public void readEntityFromNBT(NBTTagCompound par1NBTTagCompound) { -+ super.readEntityFromNBT(par1NBTTagCompound); -+ this.setSheared(par1NBTTagCompound.getBoolean("Sheared")); -+ this.setFleeceColor(par1NBTTagCompound.getByte("Color")); -+ } -+ -+ /** -+ * Returns the sound this mob makes while it's alive. -+ */ - protected String getLivingSound() { - return "mob.sheep.say"; - } - -+ /** -+ * Returns the sound this mob makes when it is hurt. -+ */ - protected String getHurtSound() { - return "mob.sheep.say"; - } - -+ /** -+ * Returns the sound this mob makes on death. -+ */ - protected String getDeathSound() { - return "mob.sheep.say"; - } - -- protected void playStepSound(int var1, int var2, int var3, int var4) { -+ /** -+ * Plays step sound at given x, y, z for the entity -+ */ -+ protected void playStepSound(int par1, int par2, int par3, int par4) { - this.playSound("mob.sheep.step", 0.15F, 1.0F); - } - -@@ -140,73 +186,87 @@ - return this.dataWatcher.getWatchableObjectByte(16) & 15; - } - -- public void setFleeceColor(int var1) { -+ public void setFleeceColor(int par1) { - byte var2 = this.dataWatcher.getWatchableObjectByte(16); -- this.dataWatcher.updateObject(16, Byte.valueOf((byte)(var2 & 240 | var1 & 15))); -+ this.dataWatcher.updateObject(16, Byte.valueOf((byte)(var2 & 240 | par1 & 15))); - } - -+ /** -+ * returns true if a sheeps wool has been sheared -+ */ - public boolean getSheared() { - return (this.dataWatcher.getWatchableObjectByte(16) & 16) != 0; - } - -- public void setSheared(boolean var1) { -+ /** -+ * make a sheep sheared if set to true -+ */ -+ public void setSheared(boolean par1) { - byte var2 = this.dataWatcher.getWatchableObjectByte(16); -- if(var1) { -+ -+ if (par1) { - this.dataWatcher.updateObject(16, Byte.valueOf((byte)(var2 | 16))); - } else { - this.dataWatcher.updateObject(16, Byte.valueOf((byte)(var2 & -17))); - } -- -- } -- -- public static int getRandomFleeceColor(Random var0) { -- int var1 = var0.nextInt(100); -- return var1 < 5 ? 15 : (var1 < 10 ? 7 : (var1 < 15 ? 8 : (var1 < 18 ? 12 : (var0.nextInt(500) == 0 ? 6 : 0)))); -- } -- -- public EntitySheep func_90015_b(EntityAgeable var1) { -- EntitySheep var2 = (EntitySheep)var1; -+ } -+ -+ /** -+ * This method is called when a sheep spawns in the world to select the color of sheep fleece. -+ */ -+ public static int getRandomFleeceColor(Random par0Random) { -+ int var1 = par0Random.nextInt(100); -+ return var1 < 5 ? 15 : (var1 < 10 ? 7 : (var1 < 15 ? 8 : (var1 < 18 ? 12 : (par0Random.nextInt(500) == 0 ? 6 : 0)))); -+ } -+ -+ public EntitySheep func_90015_b(EntityAgeable par1EntityAgeable) { -+ EntitySheep var2 = (EntitySheep)par1EntityAgeable; - EntitySheep var3 = new EntitySheep(this.worldObj); - int var4 = this.func_90014_a(this, var2); - var3.setFleeceColor(15 - var4); - return var3; - } - -+ /** -+ * This function applies the benefits of growing back wool and faster growing up to the acting entity. (This function -+ * is used in the AIEatGrass) -+ */ - public void eatGrassBonus() { - this.setSheared(false); -- if(this.isChild()) { -+ -+ if (this.isChild()) { - this.addGrowth(60); - } -- -- } -- -- public EntityLivingData onSpawnWithEgg(EntityLivingData var1) { -- var1 = super.onSpawnWithEgg(var1); -- this.setFleeceColor(getRandomFleeceColor(this.worldObj.s)); -- return var1; -- } -- -- private int func_90014_a(EntityAnimal var1, EntityAnimal var2) { -- int var3 = this.func_90013_b(var1); -- int var4 = this.func_90013_b(var2); -+ } -+ -+ public EntityLivingData onSpawnWithEgg(EntityLivingData par1EntityLivingData) { -+ par1EntityLivingData = super.onSpawnWithEgg(par1EntityLivingData); -+ this.setFleeceColor(getRandomFleeceColor(this.worldObj.rand)); -+ return par1EntityLivingData; -+ } -+ -+ private int func_90014_a(EntityAnimal par1EntityAnimal, EntityAnimal par2EntityAnimal) { -+ int var3 = this.func_90013_b(par1EntityAnimal); -+ int var4 = this.func_90013_b(par2EntityAnimal); - this.field_90016_e.getStackInSlot(0).setItemDamage(var3); - this.field_90016_e.getStackInSlot(1).setItemDamage(var4); -- ItemStack var5 = CraftingManager.getInstance().findMatchingRecipe(this.field_90016_e, ((EntitySheep)var1).worldObj); -+ ItemStack var5 = CraftingManager.getInstance().findMatchingRecipe(this.field_90016_e, ((EntitySheep)par1EntityAnimal).worldObj); - int var6; -- if(var5 != null && var5.getItem().itemID == Item.dyePowder.itemID) { -+ -+ if (var5 != null && var5.getItem().itemID == Item.dyePowder.itemID) { - var6 = var5.getItemDamage(); - } else { -- var6 = this.worldObj.s.nextBoolean() ? var3 : var4; -+ var6 = this.worldObj.rand.nextBoolean() ? var3 : var4; - } - - return var6; - } - -- private int func_90013_b(EntityAnimal var1) { -- return 15 - ((EntitySheep)var1).getFleeceColor(); -+ private int func_90013_b(EntityAnimal par1EntityAnimal) { -+ return 15 - ((EntitySheep)par1EntityAnimal).getFleeceColor(); - } - -- public EntityAgeable createChild(EntityAgeable var1) { -- return this.func_90015_b(var1); -+ public EntityAgeable createChild(EntityAgeable par1EntityAgeable) { -+ return this.func_90015_b(par1EntityAgeable); - } - } ---- net/minecraft/src/EntityLargeFireball.java -+++ net/minecraft/src/EntityLargeFireball.java -@@ -3,40 +3,48 @@ - public class EntityLargeFireball extends EntityFireball { - public int field_92057_e = 1; - -- public EntityLargeFireball(World var1) { -- super(var1); -- } -- -- public EntityLargeFireball(World var1, double var2, double var4, double var6, double var8, double var10, double var12) { -- super(var1, var2, var4, var6, var8, var10, var12); -- } -- -- public EntityLargeFireball(World var1, EntityLivingBase var2, double var3, double var5, double var7) { -- super(var1, var2, var3, var5, var7); -- } -- -- protected void onImpact(MovingObjectPosition var1) { -- if(!this.worldObj.isRemote) { -- if(var1.entityHit != null) { -- var1.entityHit.attackEntityFrom(DamageSource.causeFireballDamage(this, this.shootingEntity), 6.0F); -+ public EntityLargeFireball(World par1World) { -+ super(par1World); -+ } -+ -+ public EntityLargeFireball(World par1World, double par2, double par4, double par6, double par8, double par10, double par12) { -+ super(par1World, par2, par4, par6, par8, par10, par12); -+ } -+ -+ public EntityLargeFireball(World par1World, EntityLivingBase par2EntityLivingBase, double par3, double par5, double par7) { -+ super(par1World, par2EntityLivingBase, par3, par5, par7); -+ } -+ -+ /** -+ * Called when this EntityFireball hits a block or entity. -+ */ -+ protected void onImpact(MovingObjectPosition par1MovingObjectPosition) { -+ if (!this.worldObj.isRemote) { -+ if (par1MovingObjectPosition.entityHit != null) { -+ par1MovingObjectPosition.entityHit.attackEntityFrom(DamageSource.causeFireballDamage(this, this.shootingEntity), 6.0F); - } - - this.worldObj.newExplosion((Entity)null, this.posX, this.posY, this.posZ, (float)this.field_92057_e, true, this.worldObj.getGameRules().getGameRuleBooleanValue("mobGriefing")); - this.setDead(); - } -- -- } -- -- public void writeEntityToNBT(NBTTagCompound var1) { -- super.writeEntityToNBT(var1); -- var1.setInteger("ExplosionPower", this.field_92057_e); -- } -- -- public void readEntityFromNBT(NBTTagCompound var1) { -- super.readEntityFromNBT(var1); -- if(var1.hasKey("ExplosionPower")) { -- this.field_92057_e = var1.getInteger("ExplosionPower"); -+ } -+ -+ /** -+ * (abstract) Protected helper method to write subclass entity data to NBT. -+ */ -+ public void writeEntityToNBT(NBTTagCompound par1NBTTagCompound) { -+ super.writeEntityToNBT(par1NBTTagCompound); -+ par1NBTTagCompound.setInteger("ExplosionPower", this.field_92057_e); -+ } -+ -+ /** -+ * (abstract) Protected helper method to read subclass entity data from NBT. -+ */ -+ public void readEntityFromNBT(NBTTagCompound par1NBTTagCompound) { -+ super.readEntityFromNBT(par1NBTTagCompound); -+ -+ if (par1NBTTagCompound.hasKey("ExplosionPower")) { -+ this.field_92057_e = par1NBTTagCompound.getInteger("ExplosionPower"); - } -- - } - } ---- net/minecraft/src/GuiCommandBlock.java -+++ net/minecraft/src/GuiCommandBlock.java -@@ -5,40 +5,56 @@ - import org.lwjgl.input.Keyboard; - - public class GuiCommandBlock extends GuiScreen { -+ -+ /** Text field containing the command block's command. */ - private GuiTextField commandTextField; -+ -+ /** Command block being edited. */ - private final TileEntityCommandBlock commandBlock; - private GuiButton doneBtn; - private GuiButton cancelBtn; - -- public GuiCommandBlock(TileEntityCommandBlock var1) { -- this.commandBlock = var1; -+ public GuiCommandBlock(TileEntityCommandBlock par1TileEntityCommandBlock) { -+ this.commandBlock = par1TileEntityCommandBlock; - } - -+ /** -+ * Called from the main game loop to update the screen. -+ */ - public void updateScreen() { - this.commandTextField.updateCursorCounter(); - } - -+ /** -+ * Adds the buttons (and other controls) to the screen in question. -+ */ - public void initGui() { - Keyboard.enableRepeatEvents(true); -- this.i.clear(); -- this.i.add(this.doneBtn = new GuiButton(0, this.width / 2 - 100, this.height / 4 + 96 + 12, I18n.getString("gui.done"))); -- this.i.add(this.cancelBtn = new GuiButton(1, this.width / 2 - 100, this.height / 4 + 120 + 12, I18n.getString("gui.cancel"))); -+ this.buttonList.clear(); -+ this.buttonList.add(this.doneBtn = new GuiButton(0, this.width / 2 - 100, this.height / 4 + 96 + 12, I18n.getString("gui.done"))); -+ this.buttonList.add(this.cancelBtn = new GuiButton(1, this.width / 2 - 100, this.height / 4 + 120 + 12, I18n.getString("gui.cancel"))); - this.commandTextField = new GuiTextField(this.fontRenderer, this.width / 2 - 150, 60, 300, 20); -- this.commandTextField.setMaxStringLength(Short.MAX_VALUE); -+ this.commandTextField.setMaxStringLength(32767); - this.commandTextField.setFocused(true); - this.commandTextField.setText(this.commandBlock.getCommand()); - this.doneBtn.enabled = this.commandTextField.getText().trim().length() > 0; - } - -+ /** -+ * Called when the screen is unloaded. Used to disable keyboard repeat events -+ */ - public void onGuiClosed() { - Keyboard.enableRepeatEvents(false); - } - -- protected void actionPerformed(GuiButton var1) { -- if(var1.enabled) { -- if(var1.id == 1) { -+ /** -+ * Fired when a control is clicked. This is the equivalent of ActionListener.actionPerformed(ActionEvent e). -+ */ -+ protected void actionPerformed(GuiButton par1GuiButton) { -+ if (par1GuiButton.enabled) { -+ if (par1GuiButton.id == 1) { - this.mc.displayGuiScreen((GuiScreen)null); -- } else if(var1.id == 0) { -+ } else if (par1GuiButton.id == 0) { - String var2 = "MC|AdvCdm"; - ByteArrayOutputStream var3 = new ByteArrayOutputStream(); - DataOutputStream var4 = new DataOutputStream(var3); -@@ -55,29 +71,37 @@ - - this.mc.displayGuiScreen((GuiScreen)null); - } -- - } - } - -- protected void keyTyped(char var1, int var2) { -- this.commandTextField.textboxKeyTyped(var1, var2); -+ /** -+ * Fired when a key is typed. This is the equivalent of KeyListener.keyTyped(KeyEvent e). -+ */ -+ protected void keyTyped(char par1, int par2) { -+ this.commandTextField.textboxKeyTyped(par1, par2); - this.doneBtn.enabled = this.commandTextField.getText().trim().length() > 0; -- if(var2 != 28 && var2 != 156) { -- if(var2 == 1) { -+ -+ if (par2 != 28 && par2 != 156) { -+ if (par2 == 1) { - this.actionPerformed(this.cancelBtn); - } - } else { - this.actionPerformed(this.doneBtn); - } -- -- } -- -- protected void mouseClicked(int var1, int var2, int var3) { -- super.mouseClicked(var1, var2, var3); -- this.commandTextField.mouseClicked(var1, var2, var3); -- } -- -- public void drawScreen(int var1, int var2, float var3) { -+ } -+ -+ /** -+ * Called when the mouse is clicked. -+ */ -+ protected void mouseClicked(int par1, int par2, int par3) { -+ super.mouseClicked(par1, par2, par3); -+ this.commandTextField.mouseClicked(par1, par2, par3); -+ } -+ -+ /** -+ * Draws the screen and all the components in it. -+ */ -+ public void drawScreen(int par1, int par2, float par3) { - this.drawDefaultBackground(); - this.drawCenteredString(this.fontRenderer, I18n.getString("advMode.setCommand"), this.width / 2, 20, 16777215); - this.drawString(this.fontRenderer, I18n.getString("advMode.command"), this.width / 2 - 150, 47, 10526880); -@@ -85,6 +109,6 @@ - this.drawString(this.fontRenderer, I18n.getString("advMode.randomPlayer"), this.width / 2 - 150, 108, 10526880); - this.drawString(this.fontRenderer, I18n.getString("advMode.allPlayers"), this.width / 2 - 150, 119, 10526880); - this.commandTextField.drawTextBox(); -- super.drawScreen(var1, var2, var3); -+ super.drawScreen(par1, par2, par3); - } - } ---- /dev/null -+++ com/prupe/mcpatcher/ctm/GlassPaneRenderer.java -@@ -1,0 +1,139 @@ -+package com.prupe.mcpatcher.ctm; -+ -+import com.prupe.mcpatcher.Config; -+import com.prupe.mcpatcher.TessellatorUtils; -+import java.util.Arrays; -+import net.minecraft.src.Block; -+import net.minecraft.src.Icon; -+import net.minecraft.src.RenderBlocks; -+import net.minecraft.src.Tessellator; -+ -+//Spout Start -+import org.spoutcraft.client.config.Configuration; -+//Spout End -+ -+public class GlassPaneRenderer { -+ private static final boolean enable = Config.getBoolean("Connected Textures", "glassPane", true); -+ public static boolean active; -+ private static final Icon[] icons = new Icon[6]; -+ private static Tessellator tessellator; -+ private static double u0; -+ private static double uM; -+ private static double u1; -+ private static double v0; -+ private static double v1; -+ -+ public static void render(RenderBlocks renderBlocks, Block blockPane, Icon origIcon, int i, int j, int k, boolean connectNorth, boolean connectSouth, boolean connectWest, boolean connectEast) { -+ if (!Configuration.isConnectedTextures()) { -+ active = false; -+ } else { -+ active = true; -+ -+ for (int i0 = 2; i0 <= 5; ++i0) { -+ icons[i0] = CTMUtils.getTile(renderBlocks, blockPane, i, j, k, i0, origIcon, Tessellator.instance); -+ -+ if (icons[i0] == null) { -+ active = RenderPassAPI.instance.skipDefaultRendering(blockPane); -+ return; -+ } -+ } -+ -+ double var27 = (double)i; -+ double iM = var27 + 0.5D; -+ double i1 = var27 + 1.0D; -+ double j0 = (double)j; -+ double j1 = j0 + 1.0D; -+ double k0 = (double)k; -+ double kM = k0 + 0.5D; -+ double k1 = k0 + 1.0D; -+ boolean connectAny = connectWest || connectEast || connectNorth || connectSouth; -+ -+ if ((!connectEast || !connectWest) && connectAny) { -+ if (connectWest && !connectEast) { -+ setupTileCoords(3); -+ tessellator.addVertexWithUV(var27, j1, kM, uM, v0); -+ tessellator.addVertexWithUV(var27, j0, kM, uM, v1); -+ tessellator.addVertexWithUV(iM, j0, kM, u1, v1); -+ tessellator.addVertexWithUV(iM, j1, kM, u1, v0); -+ setupTileCoords(2); -+ tessellator.addVertexWithUV(iM, j1, kM, u0, v0); -+ tessellator.addVertexWithUV(iM, j0, kM, u0, v1); -+ tessellator.addVertexWithUV(var27, j0, kM, uM, v1); -+ tessellator.addVertexWithUV(var27, j1, kM, uM, v0); -+ } else if (!connectWest && connectEast) { -+ setupTileCoords(3); -+ tessellator.addVertexWithUV(iM, j1, kM, u0, v0); -+ tessellator.addVertexWithUV(iM, j0, kM, u0, v1); -+ tessellator.addVertexWithUV(i1, j0, kM, uM, v1); -+ tessellator.addVertexWithUV(i1, j1, kM, uM, v0); -+ setupTileCoords(2); -+ tessellator.addVertexWithUV(i1, j1, kM, uM, v0); -+ tessellator.addVertexWithUV(i1, j0, kM, uM, v1); -+ tessellator.addVertexWithUV(iM, j0, kM, u1, v1); -+ tessellator.addVertexWithUV(iM, j1, kM, u1, v0); -+ } -+ } else { -+ setupTileCoords(3); -+ tessellator.addVertexWithUV(var27, j1, kM, u0, v0); -+ tessellator.addVertexWithUV(var27, j0, kM, u0, v1); -+ tessellator.addVertexWithUV(i1, j0, kM, u1, v1); -+ tessellator.addVertexWithUV(i1, j1, kM, u1, v0); -+ setupTileCoords(2); -+ tessellator.addVertexWithUV(i1, j1, kM, u0, v0); -+ tessellator.addVertexWithUV(i1, j0, kM, u0, v1); -+ tessellator.addVertexWithUV(var27, j0, kM, u1, v1); -+ tessellator.addVertexWithUV(var27, j1, kM, u1, v0); -+ } -+ -+ if ((!connectNorth || !connectSouth) && connectAny) { -+ if (connectNorth && !connectSouth) { -+ setupTileCoords(4); -+ tessellator.addVertexWithUV(iM, j1, k0, uM, v0); -+ tessellator.addVertexWithUV(iM, j0, k0, uM, v1); -+ tessellator.addVertexWithUV(iM, j0, kM, u1, v1); -+ tessellator.addVertexWithUV(iM, j1, kM, u1, v0); -+ setupTileCoords(5); -+ tessellator.addVertexWithUV(iM, j1, kM, u0, v0); -+ tessellator.addVertexWithUV(iM, j0, kM, u0, v1); -+ tessellator.addVertexWithUV(iM, j0, k0, uM, v1); -+ tessellator.addVertexWithUV(iM, j1, k0, uM, v0); -+ } else if (!connectNorth && connectSouth) { -+ setupTileCoords(4); -+ tessellator.addVertexWithUV(iM, j1, kM, u0, v0); -+ tessellator.addVertexWithUV(iM, j0, kM, u0, v1); -+ tessellator.addVertexWithUV(iM, j0, k1, uM, v1); -+ tessellator.addVertexWithUV(iM, j1, k1, uM, v0); -+ setupTileCoords(5); -+ tessellator.addVertexWithUV(iM, j1, k1, uM, v0); -+ tessellator.addVertexWithUV(iM, j0, k1, uM, v1); -+ tessellator.addVertexWithUV(iM, j0, kM, u1, v1); -+ tessellator.addVertexWithUV(iM, j1, kM, u1, v0); -+ } -+ } else { -+ setupTileCoords(4); -+ tessellator.addVertexWithUV(iM, j1, k0, u0, v0); -+ tessellator.addVertexWithUV(iM, j0, k0, u0, v1); -+ tessellator.addVertexWithUV(iM, j0, k1, u1, v1); -+ tessellator.addVertexWithUV(iM, j1, k1, u1, v0); -+ setupTileCoords(5); -+ tessellator.addVertexWithUV(iM, j1, k1, u0, v0); -+ tessellator.addVertexWithUV(iM, j0, k1, u0, v1); -+ tessellator.addVertexWithUV(iM, j0, k0, u1, v1); -+ tessellator.addVertexWithUV(iM, j1, k0, u1, v0); -+ } -+ -+ Arrays.fill(icons, (Object)null); -+ tessellator = null; -+ } -+ } -+ -+ private static void setupTileCoords(int face) { -+ Icon icon = icons[face]; -+ tessellator = TessellatorUtils.getTessellator(Tessellator.instance, icons[face]); -+ u0 = (double)icon.getMinU(); -+ uM = (double)icon.getInterpolatedU(8.0D); -+ u1 = (double)icon.getMaxU(); -+ v0 = (double)icon.getMinV(); -+ v1 = (double)icon.getMaxV(); -+ } -+} ---- net/minecraft/src/GuiNewChat.java -+++ net/minecraft/src/GuiNewChat.java -@@ -3,29 +3,37 @@ - import java.util.ArrayList; - import java.util.Iterator; - import java.util.List; -+ - import org.lwjgl.opengl.GL11; - - public class GuiNewChat extends Gui { -+ -+ /** The Minecraft instance. */ - private final Minecraft mc; -- private final List b = new ArrayList(); -- private final List c = new ArrayList(); -- private final List d = new ArrayList(); -+ -+ /** A list of messages previously sent through the chat GUI */ -+ private final List sentMessages = new ArrayList(); -+ -+ /** Chat lines to be displayed in the chat box */ -+ private final List chatLines = new ArrayList(); -+ private final List field_96134_d = new ArrayList(); - private int field_73768_d; - private boolean field_73769_e; - -- public GuiNewChat(Minecraft var1) { -- this.mc = var1; -+ public GuiNewChat(Minecraft par1Minecraft) { -+ this.mc = par1Minecraft; - } - -- public void drawChat(int var1) { -- if(this.mc.gameSettings.chatVisibility != 2) { -+ public void drawChat(int par1) { -+ if (this.mc.gameSettings.chatVisibility != 2) { - int var2 = this.func_96127_i(); - boolean var3 = false; - int var4 = 0; -- int var5 = this.d.size(); -+ int var5 = this.field_96134_d.size(); - float var6 = this.mc.gameSettings.chatOpacity * 0.9F + 0.1F; -- if(var5 > 0) { -- if(this.getChatOpen()) { -+ -+ if (var5 > 0) { -+ if (this.getChatOpen()) { - var3 = true; - } - -@@ -34,41 +42,47 @@ - GL11.glPushMatrix(); - GL11.glTranslatef(2.0F, 20.0F, 0.0F); - GL11.glScalef(var7, var7, 1.0F); -- - int var9; - int var11; - int var14; -- for(var9 = 0; var9 + this.field_73768_d < this.d.size() && var9 < var2; ++var9) { -- ChatLine var10 = (ChatLine)this.d.get(var9 + this.field_73768_d); -- if(var10 != null) { -- var11 = var1 - var10.getUpdatedCounter(); -- if(var11 < 200 || var3) { -+ -+ for (var9 = 0; var9 + this.field_73768_d < this.field_96134_d.size() && var9 < var2; ++var9) { -+ ChatLine var10 = (ChatLine)this.field_96134_d.get(var9 + this.field_73768_d); -+ -+ if (var10 != null) { -+ var11 = par1 - var10.getUpdatedCounter(); -+ -+ if (var11 < 200 || var3) { - double var12 = (double)var11 / 200.0D; - var12 = 1.0D - var12; - var12 *= 10.0D; -- if(var12 < 0.0D) { -+ -+ if (var12 < 0.0D) { - var12 = 0.0D; - } - -- if(var12 > 1.0D) { -+ if (var12 > 1.0D) { - var12 = 1.0D; - } - - var12 *= var12; - var14 = (int)(255.0D * var12); -- if(var3) { -+ -+ if (var3) { - var14 = 255; - } - - var14 = (int)((float)var14 * var6); - ++var4; -- if(var14 > 3) { -+ -+ if (var14 > 3) { - byte var15 = 0; - int var16 = -var9 * 9; - drawRect(var15, var16 - 9, var15 + var8 + 4, var16, var14 / 2 << 24); - GL11.glEnable(GL11.GL_BLEND); - String var17 = var10.getChatLineString(); -- if(!this.mc.gameSettings.chatColours) { -+ -+ if (!this.mc.gameSettings.chatColours) { - var17 = StringUtils.stripControlCodes(var17); - } - -@@ -78,18 +92,19 @@ - } - } - -- if(var3) { -+ if (var3) { - var9 = this.mc.fontRenderer.FONT_HEIGHT; - GL11.glTranslatef(-3.0F, 0.0F, 0.0F); - int var18 = var5 * var9 + var5; - var11 = var4 * var9 + var4; -- int var19 = this.field_73768_d * var11 / var5; -+ int var20 = this.field_73768_d * var11 / var5; - int var13 = var11 * var11 / var18; -- if(var18 != var11) { -- var14 = var19 > 0 ? 170 : 96; -- int var20 = this.field_73769_e ? 13382451 : 3355562; -- drawRect(0, -var19, 2, -var19 - var13, var20 + (var14 << 24)); -- drawRect(2, -var19, 1, -var19 - var13, 13421772 + (var14 << 24)); -+ -+ if (var18 != var11) { -+ var14 = var20 > 0 ? 170 : 96; -+ int var19 = this.field_73769_e ? 13382451 : 3355562; -+ drawRect(0, -var20, 2, -var20 - var13, var19 + (var14 << 24)); -+ drawRect(2, -var20, 1, -var20 - var13, 13421772 + (var14 << 24)); - } - } - -@@ -98,116 +113,140 @@ - } - } - -+ /** -+ * Clears the chat. -+ */ - public void clearChatMessages() { -- this.d.clear(); -- this.c.clear(); -- this.b.clear(); -- } -- -- public void printChatMessage(String var1) { -- this.printChatMessageWithOptionalDeletion(var1, 0); -- } -- -- public void printChatMessageWithOptionalDeletion(String var1, int var2) { -- this.func_96129_a(var1, var2, this.mc.ingameGUI.getUpdateCounter(), false); -- this.mc.getLogAgent().logInfo("[CHAT] " + EnumChatFormatting.func_110646_a(var1)); -- } -- -- private void func_96129_a(String var1, int var2, int var3, boolean var4) { -+ this.field_96134_d.clear(); -+ this.chatLines.clear(); -+ this.sentMessages.clear(); -+ } -+ -+ /** -+ * takes a String and prints it to chat -+ */ -+ public void printChatMessage(String par1Str) { -+ this.printChatMessageWithOptionalDeletion(par1Str, 0); -+ } -+ -+ /** -+ * prints the String to Chat. If the ID is not 0, deletes an existing Chat Line of that ID from the GUI -+ */ -+ public void printChatMessageWithOptionalDeletion(String par1Str, int par2) { -+ this.func_96129_a(par1Str, par2, this.mc.ingameGUI.getUpdateCounter(), false); -+ // Spout Start -+ //this.mc.getLogAgent().logInfo("[CHAT] " + EnumChatFormatting.func_110646_a(par1Str)); -+ // Spout End -+ } -+ -+ private void func_96129_a(String par1Str, int par2, int par3, boolean par4) { - boolean var5 = this.getChatOpen(); - boolean var6 = true; -- if(var2 != 0) { -- this.deleteChatLine(var2); -+ -+ if (par2 != 0) { -+ this.deleteChatLine(par2); - } - -- Iterator var7 = this.mc.fontRenderer.listFormattedStringToWidth(var1, MathHelper.floor_float((float)this.func_96126_f() / this.func_96131_h())).iterator(); -+ Iterator var7 = this.mc.fontRenderer.listFormattedStringToWidth(par1Str, MathHelper.floor_float((float)this.func_96126_f() / this.func_96131_h())).iterator(); - -- while(var7.hasNext()) { -+ while (var7.hasNext()) { - String var8 = (String)var7.next(); -- if(var5 && this.field_73768_d > 0) { -+ -+ if (var5 && this.field_73768_d > 0) { - this.field_73769_e = true; - this.scroll(1); - } - -- if(!var6) { -+ if (!var6) { - var8 = " " + var8; - } - - var6 = false; -- this.d.add(0, new ChatLine(var3, var8, var2)); -- } -- -- while(this.d.size() > 100) { -- this.d.remove(this.d.size() - 1); -- } -- -- if(!var4) { -- this.c.add(0, new ChatLine(var3, var1.trim(), var2)); -- -- while(this.c.size() > 100) { -- this.c.remove(this.c.size() - 1); -+ this.field_96134_d.add(0, new ChatLine(par3, var8, par2)); -+ } -+ -+ while (this.field_96134_d.size() > 100) { -+ this.field_96134_d.remove(this.field_96134_d.size() - 1); -+ } -+ -+ if (!par4) { -+ this.chatLines.add(0, new ChatLine(par3, par1Str.trim(), par2)); -+ -+ while (this.chatLines.size() > 100) { -+ this.chatLines.remove(this.chatLines.size() - 1); - } - } -- - } - - public void func_96132_b() { -- this.d.clear(); -+ this.field_96134_d.clear(); - this.resetScroll(); - -- for(int var1 = this.c.size() - 1; var1 >= 0; --var1) { -- ChatLine var2 = (ChatLine)this.c.get(var1); -+ for (int var1 = this.chatLines.size() - 1; var1 >= 0; --var1) { -+ ChatLine var2 = (ChatLine)this.chatLines.get(var1); - this.func_96129_a(var2.getChatLineString(), var2.getChatLineID(), var2.getUpdatedCounter(), true); - } -- - } - -+ /** -+ * Gets the list of messages previously sent through the chat GUI -+ */ - public List getSentMessages() { -- return this.b; -+ return this.sentMessages; - } - -- public void addToSentMessages(String var1) { -- if(this.b.isEmpty() || !((String)this.b.get(this.b.size() - 1)).equals(var1)) { -- this.b.add(var1); -+ /** -+ * Adds this string to the list of sent messages, for recall using the up/down arrow keys -+ */ -+ public void addToSentMessages(String par1Str) { -+ if (this.sentMessages.isEmpty() || !((String)this.sentMessages.get(this.sentMessages.size() - 1)).equals(par1Str)) { -+ this.sentMessages.add(par1Str); - } -- - } - -+ /** -+ * Resets the chat scroll (executed when the GUI is closed) -+ */ - public void resetScroll() { - this.field_73768_d = 0; - this.field_73769_e = false; - } - -- public void scroll(int var1) { -- this.field_73768_d += var1; -- int var2 = this.d.size(); -- if(this.field_73768_d > var2 - this.func_96127_i()) { -+ /** -+ * Scrolls the chat by the given number of lines. -+ */ -+ public void scroll(int par1) { -+ this.field_73768_d += par1; -+ int var2 = this.field_96134_d.size(); -+ -+ if (this.field_73768_d > var2 - this.func_96127_i()) { - this.field_73768_d = var2 - this.func_96127_i(); - } - -- if(this.field_73768_d <= 0) { -+ if (this.field_73768_d <= 0) { - this.field_73768_d = 0; - this.field_73769_e = false; - } -- - } - -- public ChatClickData func_73766_a(int var1, int var2) { -- if(!this.getChatOpen()) { -+ public ChatClickData func_73766_a(int par1, int par2) { -+ if (!this.getChatOpen()) { - return null; - } else { - ScaledResolution var3 = new ScaledResolution(this.mc.gameSettings, this.mc.displayWidth, this.mc.displayHeight); - int var4 = var3.getScaleFactor(); - float var5 = this.func_96131_h(); -- int var6 = var1 / var4 - 3; -- int var7 = var2 / var4 - 25; -+ int var6 = par1 / var4 - 3; -+ int var7 = par2 / var4 - 25; - var6 = MathHelper.floor_float((float)var6 / var5); - var7 = MathHelper.floor_float((float)var7 / var5); -- if(var6 >= 0 && var7 >= 0) { -- int var8 = Math.min(this.func_96127_i(), this.d.size()); -- if(var6 <= MathHelper.floor_float((float)this.func_96126_f() / this.func_96131_h()) && var7 < this.mc.fontRenderer.FONT_HEIGHT * var8 + var8) { -+ -+ if (var6 >= 0 && var7 >= 0) { -+ int var8 = Math.min(this.func_96127_i(), this.field_96134_d.size()); -+ -+ if (var6 <= MathHelper.floor_float((float)this.func_96126_f() / this.func_96131_h()) && var7 < this.mc.fontRenderer.FONT_HEIGHT * var8 + var8) { - int var9 = var7 / (this.mc.fontRenderer.FONT_HEIGHT + 1) + this.field_73768_d; -- return new ChatClickData(this.mc.fontRenderer, (ChatLine)this.d.get(var9), var6, var7 - (var9 - this.field_73768_d) * this.mc.fontRenderer.FONT_HEIGHT + var9); -+ return new ChatClickData(this.mc.fontRenderer, (ChatLine)this.field_96134_d.get(var9), var6, var7 - (var9 - this.field_73768_d) * this.mc.fontRenderer.FONT_HEIGHT + var9); - } else { - return null; - } -@@ -217,36 +256,45 @@ - } - } - -- public void addTranslatedMessage(String var1, Object... var2) { -- this.printChatMessage(I18n.getStringParams(var1, var2)); -+ /** -+ * Adds a message to the chat after translating to the client's locale. -+ */ -+ public void addTranslatedMessage(String par1Str, Object ... par2ArrayOfObj) { -+ this.printChatMessage(I18n.getStringParams(par1Str, par2ArrayOfObj)); - } - -+ /** -+ * @return {@code true} if the chat GUI is open -+ */ - public boolean getChatOpen() { - return this.mc.currentScreen instanceof GuiChat; - } - -- public void deleteChatLine(int var1) { -- Iterator var2 = this.d.iterator(); -- -+ /** -+ * finds and deletes a Chat line by ID -+ */ -+ public void deleteChatLine(int par1) { -+ Iterator var2 = this.field_96134_d.iterator(); - ChatLine var3; -+ - do { -- if(!var2.hasNext()) { -- var2 = this.c.iterator(); -+ if (!var2.hasNext()) { -+ var2 = this.chatLines.iterator(); - - do { -- if(!var2.hasNext()) { -+ if (!var2.hasNext()) { - return; - } - - var3 = (ChatLine)var2.next(); -- } while(var3.getChatLineID() != var1); -+ } while (var3.getChatLineID() != par1); - - var2.remove(); - return; - } - - var3 = (ChatLine)var2.next(); -- } while(var3.getChatLineID() != var1); -+ } while (var3.getChatLineID() != par1); - - var2.remove(); - } -@@ -263,16 +311,16 @@ - return this.mc.gameSettings.chatScale; - } - -- public static final int func_96128_a(float var0) { -+ public static final int func_96128_a(float par0) { - short var1 = 320; - byte var2 = 40; -- return MathHelper.floor_float(var0 * (float)(var1 - var2) + (float)var2); -+ return MathHelper.floor_float(par0 * (float)(var1 - var2) + (float)var2); - } - -- public static final int func_96130_b(float var0) { -+ public static final int func_96130_b(float par0) { - short var1 = 180; - byte var2 = 20; -- return MathHelper.floor_float(var0 * (float)(var1 - var2) + (float)var2); -+ return MathHelper.floor_float(par0 * (float)(var1 - var2) + (float)var2); - } - - public int func_96127_i() { ---- net/minecraft/src/FontRenderer.java -+++ net/minecraft/src/FontRenderer.java -@@ -9,48 +9,126 @@ - import java.util.List; - import java.util.Random; - import javax.imageio.ImageIO; -+ - import org.lwjgl.opengl.GL11; - -+import com.prupe.mcpatcher.cc.ColorizeWorld; -+import com.prupe.mcpatcher.hd.FontUtils; -+ - public class FontRenderer implements ResourceManagerReloadListener { - private static final ResourceLocation[] unicodePageLocations = new ResourceLocation[256]; -+ -+ /** Array of width of all the characters in default.png */ - private int[] charWidth = new int[256]; -- public int FONT_HEIGHT = 9; -- public Random b = new Random(); -+ -+ /** the height in pixels of default text */ -+ // Spout Start - Smaller text -+ public int FONT_HEIGHT = 8; -+ // Spout End -+ public Random fontRandom = new Random(); -+ -+ /** -+ * Array of the start/end column (in upper/lower nibble) for every glyph in the /font directory. -+ */ - private byte[] glyphWidth = new byte[65536]; -+ -+ /** -+ * Array of GL texture ids for loaded glyph_XX.png images. Indexed by Unicode block (group of 256 chars). -+ */ -+ // Spout Start - Removed final modifier -+ // TODO: Something? -+ private int[] glyphTextureName = new int[256]; -+ // Spout End -+ -+ /** -+ * Array of RGB triplets defining the 16 standard chat colors followed by 16 darker version of the same colors for drop -+ * shadows. -+ */ - private int[] colorCode = new int[32]; -- private final ResourceLocation locationFontTexture; -- private final TextureManager renderEngine; -+ private ResourceLocation locationFontTexture; -+ -+ /** -+ * The currently bound GL texture ID. Avoids unnecessary glBindTexture() for the same texture if it's already bound. -+ */ -+ private int boundTextureName; -+ -+ /** The RenderEngine used to load and setup glyph textures. */ -+ // Spout start - Removed final modifier -+ private TextureManager renderEngine; -+ // Spout End -+ -+ /** Current X coordinate at which to draw the next character. */ - private float posX; -+ -+ /** Current Y coordinate at which to draw the next character. */ - private float posY; -- private boolean unicodeFlag; -+ -+ /** -+ * If true, strings should be rendered with Unicode fonts instead of the default.png font -+ */ -+ public boolean unicodeFlag; -+ -+ /** -+ * If true, the Unicode Bidirectional Algorithm should be run before rendering any string. -+ */ - private boolean bidiFlag; -+ -+ /** Used to specify new red value for the current color. */ - private float red; -+ -+ /** Used to specify new blue value for the current color. */ - private float blue; -+ -+ /** Used to specify new green value for the current color. */ - private float green; -+ -+ /** Used to speify new alpha value for the current color. */ - private float alpha; -+ -+ /** Text color of the currently rendering string. */ - private int textColor; -+ -+ /** Set if the "k" style (random) is active in currently rendering string */ - private boolean randomStyle; -+ -+ /** Set if the "l" style (bold) is active in currently rendering string */ - private boolean boldStyle; -+ -+ /** Set if the "o" style (italic) is active in currently rendering string */ - private boolean italicStyle; -+ -+ /** -+ * Set if the "n" style (underlined) is active in currently rendering string -+ */ - private boolean underlineStyle; -+ -+ /** -+ * Set if the "m" style (strikethrough) is active in currently rendering string -+ */ - private boolean strikethroughStyle; -- -- public FontRenderer(GameSettings var1, ResourceLocation var2, TextureManager var3, boolean var4) { -- this.locationFontTexture = var2; -- this.renderEngine = var3; -- this.unicodeFlag = var4; -- var3.bindTexture(this.locationFontTexture); -- -- for(int var5 = 0; var5 < 32; ++var5) { -+ public float[] charWidthf; -+ public ResourceLocation defaultFont; -+ public ResourceLocation hdFont; -+ public boolean isHD; -+ public float fontAdj; -+ -+ public FontRenderer(GameSettings par1GameSettings, ResourceLocation par2ResourceLocation, TextureManager par3TextureManager, boolean par4) { -+ this.locationFontTexture = par2ResourceLocation; -+ this.renderEngine = par3TextureManager; -+ this.unicodeFlag = par4; -+ par3TextureManager.bindTexture(this.locationFontTexture); -+ -+ for (int var5 = 0; var5 < 32; ++var5) { - int var6 = (var5 >> 3 & 1) * 85; - int var7 = (var5 >> 2 & 1) * 170 + var6; - int var8 = (var5 >> 1 & 1) * 170 + var6; - int var9 = (var5 >> 0 & 1) * 170 + var6; -- if(var5 == 6) { -+ -+ if (var5 == 6) { - var7 += 85; - } - -- if(var1.anaglyph) { -+ if (par1GameSettings.anaglyph) { - int var10 = (var7 * 30 + var8 * 59 + var9 * 11) / 100; - int var11 = (var7 * 30 + var8 * 70) / 100; - int var12 = (var7 * 30 + var9 * 70) / 100; -@@ -59,7 +137,7 @@ - var9 = var12; - } - -- if(var5 >= 16) { -+ if (var5 >= 16) { - var7 /= 4; - var8 /= 4; - var9 /= 4; -@@ -67,17 +145,18 @@ - - this.colorCode[var5] = (var7 & 255) << 16 | (var8 & 255) << 8 | var9 & 255; - } -- - this.readGlyphSizes(); - } - -- public void onResourceManagerReload(ResourceManager var1) { -+ public void onResourceManagerReload(ResourceManager par1ResourceManager) { - this.readFontTexture(); - } - -- private void readFontTexture() { -+ public void readFontTexture() { - BufferedImage var1; -+ - try { -+ this.locationFontTexture = FontUtils.getFontName(this, this.locationFontTexture); - var1 = ImageIO.read(Minecraft.getMinecraft().getResourceManager().getResource(this.locationFontTexture).getInputStream()); - } catch (IOException var17) { - throw new RuntimeException(var17); -@@ -91,35 +170,45 @@ - int var6 = var2 / 16; - byte var7 = 1; - float var8 = 8.0F / (float)var6; -+ int var9 = 0; - -- for(int var9 = 0; var9 < 256; ++var9) { -+ while (var9 < 256) { - int var10 = var9 % 16; - int var11 = var9 / 16; -- if(var9 == 32) { -+ -+ if (var9 == 32) { - this.charWidth[var9] = 3 + var7; - } - -- int var12; -- for(var12 = var6 - 1; var12 >= 0; --var12) { -- int var13 = var10 * var6 + var12; -- boolean var14 = true; -- -- for(int var15 = 0; var15 < var5 && var14; ++var15) { -- int var16 = (var11 * var6 + var15) * var2; -- if((var4[var13 + var16] >> 24 & 255) != 0) { -- var14 = false; -- } -- } -- -- if(!var14) { -- break; -- } -+ int var12 = var6 - 1; -+ -+ while (true) { -+ if (var12 >= 0) { -+ int var13 = var10 * var6 + var12; -+ boolean var14 = true; -+ -+ for (int var15 = 0; var15 < var5 && var14; ++var15) { -+ int var16 = (var11 * var6 + var15) * var2; -+ -+ if ((var4[var13 + var16] >> 24 & 255) != 0) { -+ var14 = false; -+ } -+ } -+ -+ if (var14) { -+ --var12; -+ continue; -+ } -+ } -+ -+ ++var12; -+ this.charWidth[var9] = (int)(0.5D + (double)((float)var12 * var8)) + var7; -+ ++var9; -+ break; - } -- -- ++var12; -- this.charWidth[var9] = (int)(0.5D + (double)((float)var12 * var8)) + var7; - } - -+ this.charWidthf = FontUtils.computeCharWidthsf(this, this.locationFontTexture, var1, var4, this.charWidth, 1.0F); - } - - private void readGlyphSizes() { -@@ -131,55 +220,67 @@ - } - } - -- private float renderCharAtPos(int var1, char var2, boolean var3) { -- return var2 == 32 ? 4.0F : (var1 > 0 && !this.unicodeFlag ? this.renderDefaultChar(var1 + 32, var3) : this.renderUnicodeChar(var2, var3)); -+ /** -+ * Pick how to render a single character and return the width used. -+ */ -+ private float renderCharAtPos(int par1, char par2, boolean par3) { -+ return par2 == 32 ? this.charWidthf[32] : (par1 > 0 && !this.unicodeFlag ? this.renderDefaultChar(par1 + 32, par3) : this.renderUnicodeChar(par2, par3)); - } - -- private float renderDefaultChar(int var1, boolean var2) { -- float var3 = (float)(var1 % 16 * 8); -- float var4 = (float)(var1 / 16 * 8); -- float var5 = var2 ? 1.0F : 0.0F; -+ /** -+ * Render a single character with the default.png font at current (posX,posY) location... -+ */ -+ private float renderDefaultChar(int par1, boolean par2) { -+ float var3 = (float)(par1 % 16 * 8); -+ float var4 = (float)(par1 / 16 * 8); -+ float var5 = par2 ? 1.0F : 0.0F; - this.renderEngine.bindTexture(this.locationFontTexture); -- float var6 = (float)this.charWidth[var1] - 0.01F; -+ float var6 = (float)this.charWidth[par1] - 0.01F; - GL11.glBegin(GL11.GL_TRIANGLE_STRIP); - GL11.glTexCoord2f(var3 / 128.0F, var4 / 128.0F); - GL11.glVertex3f(this.posX + var5, this.posY, 0.0F); - GL11.glTexCoord2f(var3 / 128.0F, (var4 + 7.99F) / 128.0F); - GL11.glVertex3f(this.posX - var5, this.posY + 7.99F, 0.0F); -- GL11.glTexCoord2f((var3 + var6 - 1.0F) / 128.0F, var4 / 128.0F); -- GL11.glVertex3f(this.posX + var6 - 1.0F + var5, this.posY, 0.0F); -- GL11.glTexCoord2f((var3 + var6 - 1.0F) / 128.0F, (var4 + 7.99F) / 128.0F); -- GL11.glVertex3f(this.posX + var6 - 1.0F - var5, this.posY + 7.99F, 0.0F); -+ GL11.glTexCoord2f((var3 + var6 - this.fontAdj) / 128.0F, var4 / 128.0F); -+ GL11.glVertex3f(this.posX + var6 - this.fontAdj + var5, this.posY, 0.0F); -+ GL11.glTexCoord2f((var3 + var6 - this.fontAdj) / 128.0F, (var4 + 7.99F) / 128.0F); -+ GL11.glVertex3f(this.posX + var6 - this.fontAdj - var5, this.posY + 7.99F, 0.0F); - GL11.glEnd(); -- return (float)this.charWidth[var1]; -+ return FontUtils.getCharWidthf(this, this.charWidth, par1); - } - -- private ResourceLocation getUnicodePageLocation(int var1) { -- if(unicodePageLocations[var1] == null) { -- unicodePageLocations[var1] = new ResourceLocation(String.format("textures/font/unicode_page_%02x.png", new Object[]{Integer.valueOf(var1)})); -+ private ResourceLocation getUnicodePageLocation(int par1) { -+ if (unicodePageLocations[par1] == null) { -+ unicodePageLocations[par1] = new ResourceLocation(String.format("textures/font/unicode_page_%02x.png", new Object[] {Integer.valueOf(par1)})); - } - -- return unicodePageLocations[var1]; -- } -- -- private void loadGlyphTexture(int var1) { -- this.renderEngine.bindTexture(this.getUnicodePageLocation(var1)); -- } -- -- private float renderUnicodeChar(char var1, boolean var2) { -- if(this.glyphWidth[var1] == 0) { -+ return FontUtils.getUnicodePage(unicodePageLocations[par1]); -+ } -+ -+ /** -+ * Load one of the /font/glyph_XX.png into a new GL texture and store the texture ID in glyphTextureName array. -+ */ -+ private void loadGlyphTexture(int par1) { -+ this.renderEngine.bindTexture(this.getUnicodePageLocation(par1)); -+ } -+ -+ /** -+ * Render a single Unicode character at current (posX,posY) location using one of the /font/glyph_XX.png files... -+ */ -+ private float renderUnicodeChar(char par1, boolean par2) { -+ if (this.glyphWidth[par1] == 0) { - return 0.0F; - } else { -- int var3 = var1 / 256; -+ int var3 = par1 / 256; - this.loadGlyphTexture(var3); -- int var4 = this.glyphWidth[var1] >>> 4; -- int var5 = this.glyphWidth[var1] & 15; -+ int var4 = this.glyphWidth[par1] >>> 4; -+ int var5 = this.glyphWidth[par1] & 15; - float var6 = (float)var4; - float var7 = (float)(var5 + 1); -- float var8 = (float)(var1 % 16 * 16) + var6; -- float var9 = (float)((var1 & 255) / 16 * 16); -+ float var8 = (float)(par1 % 16 * 16) + var6; -+ float var9 = (float)((par1 & 255) / 16 * 16); - float var10 = var7 - var6 - 0.02F; -- float var11 = var2 ? 1.0F : 0.0F; -+ float var11 = par2 ? 1.0F : 0.0F; - GL11.glBegin(GL11.GL_TRIANGLE_STRIP); - GL11.glTexCoord2f(var8 / 256.0F, var9 / 256.0F); - GL11.glVertex3f(this.posX + var11, this.posY, 0.0F); -@@ -194,43 +295,57 @@ - } - } - -- public int drawStringWithShadow(String var1, int var2, int var3, int var4) { -- return this.drawString(var1, var2, var3, var4, true); -- } -- -- public int drawString(String var1, int var2, int var3, int var4) { -- return this.drawString(var1, var2, var3, var4, false); -- } -- -- public int drawString(String var1, int var2, int var3, int var4, boolean var5) { -+ /** -+ * Draws the specified string with a shadow. -+ */ -+ public int drawStringWithShadow(String par1Str, int par2, int par3, int par4) { -+ return this.drawString(par1Str, par2, par3, par4, true); -+ } -+ -+ /** -+ * Draws the specified string. -+ */ -+ public int drawString(String par1Str, int par2, int par3, int par4) { -+ return this.drawString(par1Str, par2, par3, par4, false); -+ } -+ -+ /** -+ * Draws the specified string. Args: string, x, y, color, dropShadow -+ */ -+ public int drawString(String par1Str, int par2, int par3, int par4, boolean par5) { - this.resetStyles(); -- if(this.bidiFlag) { -- var1 = this.bidiReorder(var1); -+ -+ if (this.bidiFlag) { -+ par1Str = this.bidiReorder(par1Str); - } - - int var6; -- if(var5) { -- var6 = this.renderString(var1, var2 + 1, var3 + 1, var4, true); -- var6 = Math.max(var6, this.renderString(var1, var2, var3, var4, false)); -+ -+ if (par5) { -+ var6 = this.renderString(par1Str, par2 + 1, par3 + 1, par4, true); -+ var6 = Math.max(var6, this.renderString(par1Str, par2, par3, par4, false)); - } else { -- var6 = this.renderString(var1, var2, var3, var4, false); -+ var6 = this.renderString(par1Str, par2, par3, par4, false); - } - - return var6; - } - -- private String bidiReorder(String var1) { -- if(var1 != null && Bidi.requiresBidi(var1.toCharArray(), 0, var1.length())) { -- Bidi var2 = new Bidi(var1, -2); -+ /** -+ * Apply Unicode Bidirectional Algorithm to string and return a new possibly reordered string for visual rendering. -+ */ -+ private String bidiReorder(String par1Str) { -+ if (par1Str != null && Bidi.requiresBidi(par1Str.toCharArray(), 0, par1Str.length())) { -+ Bidi var2 = new Bidi(par1Str, -2); - byte[] var3 = new byte[var2.getRunCount()]; - String[] var4 = new String[var3.length]; -- - int var7; -- for(int var5 = 0; var5 < var3.length; ++var5) { -+ -+ for (int var5 = 0; var5 < var3.length; ++var5) { - int var6 = var2.getRunStart(var5); - var7 = var2.getRunLimit(var5); - int var8 = var2.getRunLevel(var5); -- String var9 = var1.substring(var6, var7); -+ String var9 = par1Str.substring(var6, var7); - var3[var5] = (byte)var8; - var4[var5] = var9; - } -@@ -238,40 +353,52 @@ - String[] var11 = (String[])var4.clone(); - Bidi.reorderVisually(var3, 0, var4, 0, var3.length); - StringBuilder var12 = new StringBuilder(); -+ var7 = 0; - -- for(var7 = 0; var7 < var4.length; ++var7) { -+ while (var7 < var4.length) { - byte var13 = var3[var7]; -- -- int var14; -- for(var14 = 0; var14 < var11.length; ++var14) { -- if(var11[var14].equals(var4[var7])) { -+ int var14 = 0; -+ -+ while (true) { -+ if (var14 < var11.length) { -+ if (!var11[var14].equals(var4[var7])) { -+ ++var14; -+ continue; -+ } -+ - var13 = var3[var14]; -- break; - } -- } -- -- if((var13 & 1) == 0) { -- var12.append(var4[var7]); -- } else { -- for(var14 = var4[var7].length() - 1; var14 >= 0; --var14) { -- char var10 = var4[var7].charAt(var14); -- if(var10 == 40) { -- var10 = 41; -- } else if(var10 == 41) { -- var10 = 40; -+ -+ if ((var13 & 1) == 0) { -+ var12.append(var4[var7]); -+ } else { -+ for (var14 = var4[var7].length() - 1; var14 >= 0; --var14) { -+ char var10 = var4[var7].charAt(var14); -+ -+ if (var10 == 40) { -+ var10 = 41; -+ } else if (var10 == 41) { -+ var10 = 40; -+ } -+ -+ var12.append(var10); - } -- -- var12.append(var10); - } -+ -+ ++var7; -+ break; - } - } - - return var12.toString(); - } else { -- return var1; -+ return par1Str; - } - } - -+ /** -+ * Reset all style flag fields in the class to false; called at the start of string rendering -+ */ - private void resetStyles() { - this.randomStyle = false; - this.boldStyle = false; -@@ -280,41 +407,47 @@ - this.strikethroughStyle = false; - } - -- private void renderStringAtPos(String var1, boolean var2) { -- for(int var3 = 0; var3 < var1.length(); ++var3) { -- char var4 = var1.charAt(var3); -+ /** -+ * Render a single line string at the current (posX,posY) and update posX -+ */ -+ private void renderStringAtPos(String par1Str, boolean par2) { -+ for (int var3 = 0; var3 < par1Str.length(); ++var3) { -+ char var4 = par1Str.charAt(var3); - int var5; - int var6; -- if(var4 == 167 && var3 + 1 < var1.length()) { -- var5 = "0123456789abcdefklmnor".indexOf(var1.toLowerCase().charAt(var3 + 1)); -- if(var5 < 16) { -+ -+ if (var4 == 167 && var3 + 1 < par1Str.length()) { -+ var5 = "0123456789abcdefklmnor".indexOf(par1Str.toLowerCase().charAt(var3 + 1)); -+ -+ if (var5 < 16) { - this.randomStyle = false; - this.boldStyle = false; - this.strikethroughStyle = false; - this.underlineStyle = false; - this.italicStyle = false; -- if(var5 < 0 || var5 > 15) { -+ -+ if (var5 < 0 || var5 > 15) { - var5 = 15; - } - -- if(var2) { -+ if (par2) { - var5 += 16; - } - -- var6 = this.colorCode[var5]; -+ var6 = ColorizeWorld.colorizeText(this.colorCode[var5], var5); - this.textColor = var6; - GL11.glColor4f((float)(var6 >> 16) / 255.0F, (float)(var6 >> 8 & 255) / 255.0F, (float)(var6 & 255) / 255.0F, this.alpha); -- } else if(var5 == 16) { -+ } else if (var5 == 16) { - this.randomStyle = true; -- } else if(var5 == 17) { -+ } else if (var5 == 17) { - this.boldStyle = true; -- } else if(var5 == 18) { -+ } else if (var5 == 18) { - this.strikethroughStyle = true; -- } else if(var5 == 19) { -+ } else if (var5 == 19) { - this.underlineStyle = true; -- } else if(var5 == 20) { -+ } else if (var5 == 20) { - this.italicStyle = true; -- } else if(var5 == 21) { -+ } else if (var5 == 21) { - this.randomStyle = false; - this.boldStyle = false; - this.strikethroughStyle = false; -@@ -325,38 +458,43 @@ - - ++var3; - } else { -- var5 = ChatAllowedCharacters.a.indexOf(var4); -- if(this.randomStyle && var5 > 0) { -+ var5 = ChatAllowedCharacters.allowedCharacters.indexOf(var4); -+ -+ if (this.randomStyle && var5 > 0) { - do { -- var6 = this.b.nextInt(ChatAllowedCharacters.a.length()); -- } while(this.charWidth[var5 + 32] != this.charWidth[var6 + 32]); -+ var6 = this.fontRandom.nextInt(ChatAllowedCharacters.allowedCharacters.length()); -+ } while (this.charWidth[var5 + 32] != this.charWidth[var6 + 32]); - - var5 = var6; - } - - float var11 = this.unicodeFlag ? 0.5F : 1.0F; -- boolean var7 = (var5 <= 0 || this.unicodeFlag) && var2; -- if(var7) { -+ boolean var7 = (var5 <= 0 || this.unicodeFlag) && par2; -+ -+ if (var7) { - this.posX -= var11; - this.posY -= var11; - } - - float var8 = this.renderCharAtPos(var5, var4, this.italicStyle); -- if(var7) { -+ -+ if (var7) { - this.posX += var11; - this.posY += var11; - } - -- if(this.boldStyle) { -+ if (this.boldStyle) { - this.posX += var11; -- if(var7) { -+ -+ if (var7) { - this.posX -= var11; - this.posY -= var11; - } - - this.renderCharAtPos(var5, var4, this.italicStyle); - this.posX -= var11; -- if(var7) { -+ -+ if (var7) { - this.posX += var11; - this.posY += var11; - } -@@ -365,7 +503,8 @@ - } - - Tessellator var9; -- if(this.strikethroughStyle) { -+ -+ if (this.strikethroughStyle) { - var9 = Tessellator.instance; - GL11.glDisable(GL11.GL_TEXTURE_2D); - var9.startDrawingQuads(); -@@ -377,7 +516,7 @@ - GL11.glEnable(GL11.GL_TEXTURE_2D); - } - -- if(this.underlineStyle) { -+ if (this.underlineStyle) { - var9 = Tessellator.instance; - GL11.glDisable(GL11.GL_TEXTURE_2D); - var9.startDrawingQuads(); -@@ -393,58 +532,73 @@ - this.posX += (float)((int)var8); - } - } -- - } - -- private int renderStringAligned(String var1, int var2, int var3, int var4, int var5, boolean var6) { -- if(this.bidiFlag) { -- var1 = this.bidiReorder(var1); -- int var7 = this.getStringWidth(var1); -- var2 = var2 + var4 - var7; -+ /** -+ * Render string either left or right aligned depending on bidiFlag -+ */ -+ private int renderStringAligned(String par1Str, int par2, int par3, int par4, int par5, boolean par6) { -+ if (this.bidiFlag) { -+ par1Str = this.bidiReorder(par1Str); -+ int var7 = this.getStringWidth(par1Str); -+ par2 = par2 + par4 - var7; - } - -- return this.renderString(var1, var2, var3, var5, var6); -+ return this.renderString(par1Str, par2, par3, par5, par6); - } - -- private int renderString(String var1, int var2, int var3, int var4, boolean var5) { -- if(var1 == null) { -+ /** -+ * Render single line string by setting GL color, current (posX,posY), and calling renderStringAtPos() -+ */ -+ private int renderString(String par1Str, int par2, int par3, int par4, boolean par5) { -+ if (par1Str == null) { - return 0; - } else { -- if((var4 & -67108864) == 0) { -- var4 |= -16777216; -- } -- -- if(var5) { -- var4 = (var4 & 16579836) >> 2 | var4 & -16777216; -- } -- -- this.red = (float)(var4 >> 16 & 255) / 255.0F; -- this.blue = (float)(var4 >> 8 & 255) / 255.0F; -- this.green = (float)(var4 & 255) / 255.0F; -- this.alpha = (float)(var4 >> 24 & 255) / 255.0F; -+ this.boundTextureName = 0; -+ par4 = ColorizeWorld.colorizeText(par4); -+ -+ if ((par4 & -67108864) == 0) { -+ par4 |= -16777216; -+ } -+ -+ if (par5) { -+ par4 = (par4 & 16579836) >> 2 | par4 & -16777216; -+ } -+ -+ this.red = (float)(par4 >> 16 & 255) / 255.0F; -+ this.blue = (float)(par4 >> 8 & 255) / 255.0F; -+ this.green = (float)(par4 & 255) / 255.0F; -+ this.alpha = (float)(par4 >> 24 & 255) / 255.0F; - GL11.glColor4f(this.red, this.blue, this.green, this.alpha); -- this.posX = (float)var2; -- this.posY = (float)var3; -- this.renderStringAtPos(var1, var5); -+ this.posX = (float)par2; -+ this.posY = (float)par3; -+ this.renderStringAtPos(par1Str, par5); - return (int)this.posX; - } - } - -- public int getStringWidth(String var1) { -- if(var1 == null) { -+ /** -+ * Returns the width of this string. Equivalent of FontMetrics.stringWidth(String s). -+ */ -+ public int getStringWidth(String par1Str) { -+ if (this.isHD) { -+ return (int)FontUtils.getStringWidthf(this, par1Str); -+ } else if (par1Str == null) { - return 0; - } else { - int var2 = 0; - boolean var3 = false; - -- for(int var4 = 0; var4 < var1.length(); ++var4) { -- char var5 = var1.charAt(var4); -+ for (int var4 = 0; var4 < par1Str.length(); ++var4) { -+ char var5 = par1Str.charAt(var4); - int var6 = this.getCharWidth(var5); -- if(var6 < 0 && var4 < var1.length() - 1) { -+ -+ if (var6 < 0 && var4 < par1Str.length() - 1) { - ++var4; -- var5 = var1.charAt(var4); -- if(var5 != 108 && var5 != 76) { -- if(var5 == 114 || var5 == 82) { -+ var5 = par1Str.charAt(var4); -+ -+ if (var5 != 108 && var5 != 76) { -+ if (var5 == 114 || var5 == 82) { - var3 = false; - } - } else { -@@ -455,7 +609,8 @@ - } - - var2 += var6; -- if(var3) { -+ -+ if (var3) { - ++var2; - } - } -@@ -464,19 +619,24 @@ - } - } - -- public int getCharWidth(char var1) { -- if(var1 == 167) { -+ /** -+ * Returns the width of this character as rendered. -+ */ -+ public int getCharWidth(char par1) { -+ if (par1 == 167) { - return -1; -- } else if(var1 == 32) { -+ } else if (par1 == 32) { - return 4; - } else { -- int var2 = ChatAllowedCharacters.a.indexOf(var1); -- if(var2 >= 0 && !this.unicodeFlag) { -+ int var2 = ChatAllowedCharacters.allowedCharacters.indexOf(par1); -+ -+ if (var2 >= 0 && !this.unicodeFlag) { - return this.charWidth[var2 + 32]; -- } else if(this.glyphWidth[var1] != 0) { -- int var3 = this.glyphWidth[var1] >>> 4; -- int var4 = this.glyphWidth[var1] & 15; -- if(var4 > 7) { -+ } else if (this.glyphWidth[par1] != 0) { -+ int var3 = this.glyphWidth[par1] >>> 4; -+ int var4 = this.glyphWidth[par1] & 15; -+ -+ if (var4 > 7) { - var4 = 15; - var3 = 0; - } -@@ -489,44 +649,53 @@ - } - } - -- public String trimStringToWidth(String var1, int var2) { -- return this.trimStringToWidth(var1, var2, false); -+ /** -+ * Trims a string to fit a specified Width. -+ */ -+ public String trimStringToWidth(String par1Str, int par2) { -+ return this.trimStringToWidth(par1Str, par2, false); - } - -- public String trimStringToWidth(String var1, int var2, boolean var3) { -+ /** -+ * Trims a string to a specified width, and will reverse it if par3 is set. -+ */ -+ public String trimStringToWidth(String par1Str, int par2, boolean par3) { - StringBuilder var4 = new StringBuilder(); - int var5 = 0; -- int var6 = var3 ? var1.length() - 1 : 0; -- int var7 = var3 ? -1 : 1; -+ int var6 = par3 ? par1Str.length() - 1 : 0; -+ int var7 = par3 ? -1 : 1; - boolean var8 = false; - boolean var9 = false; - -- for(int var10 = var6; var10 >= 0 && var10 < var1.length() && var5 < var2; var10 += var7) { -- char var11 = var1.charAt(var10); -+ for (int var10 = var6; var10 >= 0 && var10 < par1Str.length() && var5 < par2; var10 += var7) { -+ char var11 = par1Str.charAt(var10); - int var12 = this.getCharWidth(var11); -- if(var8) { -+ -+ if (var8) { - var8 = false; -- if(var11 != 108 && var11 != 76) { -- if(var11 == 114 || var11 == 82) { -+ -+ if (var11 != 108 && var11 != 76) { -+ if (var11 == 114 || var11 == 82) { - var9 = false; - } - } else { - var9 = true; - } -- } else if(var12 < 0) { -+ } else if (var12 < 0) { - var8 = true; - } else { - var5 += var12; -- if(var9) { -+ -+ if (var9) { - ++var5; - } - } - -- if(var5 > var2) { -+ if (var5 > par2) { - break; - } - -- if(var3) { -+ if (par3) { - var4.insert(0, var11); - } else { - var4.append(var11); -@@ -536,105 +705,142 @@ - return var4.toString(); - } - -- private String trimStringNewline(String var1) { -- while(var1 != null && var1.endsWith("\n")) { -- var1 = var1.substring(0, var1.length() - 1); -+ /** -+ * Remove all newline characters from the end of the string -+ */ -+ private String trimStringNewline(String par1Str) { -+ while (par1Str != null && par1Str.endsWith("\n")) { -+ par1Str = par1Str.substring(0, par1Str.length() - 1); - } - -- return var1; -+ return par1Str; - } - -- public void drawSplitString(String var1, int var2, int var3, int var4, int var5) { -+ /** -+ * Splits and draws a String with wordwrap (maximum length is parameter k) -+ */ -+ public void drawSplitString(String par1Str, int par2, int par3, int par4, int par5) { - this.resetStyles(); -- this.textColor = var5; -- var1 = this.trimStringNewline(var1); -- this.renderSplitString(var1, var2, var3, var4, false); -+ this.textColor = par5; -+ par1Str = this.trimStringNewline(par1Str); -+ this.renderSplitString(par1Str, par2, par3, par4, false); - } - -- private void renderSplitString(String var1, int var2, int var3, int var4, boolean var5) { -- List var6 = this.listFormattedStringToWidth(var1, var4); -+ /** -+ * Perform actual work of rendering a multi-line string with wordwrap and with darker drop shadow color if flag is set -+ */ -+ private void renderSplitString(String par1Str, int par2, int par3, int par4, boolean par5) { -+ List var6 = this.listFormattedStringToWidth(par1Str, par4); - -- for(Iterator var7 = var6.iterator(); var7.hasNext(); var3 += this.FONT_HEIGHT) { -+ for (Iterator var7 = var6.iterator(); var7.hasNext(); par3 += this.FONT_HEIGHT) { - String var8 = (String)var7.next(); -- this.renderStringAligned(var8, var2, var3, var4, this.textColor, var5); -+ this.renderStringAligned(var8, par2, par3, par4, this.textColor, par5); - } -- -- } -- -- public int splitStringWidth(String var1, int var2) { -- return this.FONT_HEIGHT * this.listFormattedStringToWidth(var1, var2).size(); -- } -- -- public void setUnicodeFlag(boolean var1) { -- this.unicodeFlag = var1; -- } -- -+ } -+ -+ /** -+ * Returns the width of the wordwrapped String (maximum length is parameter k) -+ */ -+ public int splitStringWidth(String par1Str, int par2) { -+ return this.FONT_HEIGHT * this.listFormattedStringToWidth(par1Str, par2).size(); -+ } -+ -+ /** -+ * Set unicodeFlag controlling whether strings should be rendered with Unicode fonts instead of the default.png font. -+ */ -+ public void setUnicodeFlag(boolean par1) { -+ this.unicodeFlag = par1; -+ } -+ -+ /** -+ * Get unicodeFlag controlling whether strings should be rendered with Unicode fonts instead of the default.png font. -+ */ - public boolean getUnicodeFlag() { - return this.unicodeFlag; - } - -- public void setBidiFlag(boolean var1) { -- this.bidiFlag = var1; -- } -- -- public List listFormattedStringToWidth(String var1, int var2) { -- return Arrays.asList(this.wrapFormattedStringToWidth(var1, var2).split("\n")); -- } -- -- String wrapFormattedStringToWidth(String var1, int var2) { -- int var3 = this.sizeStringToWidth(var1, var2); -- if(var1.length() <= var3) { -- return var1; -+ /** -+ * Set bidiFlag to control if the Unicode Bidirectional Algorithm should be run before rendering any string. -+ */ -+ public void setBidiFlag(boolean par1) { -+ this.bidiFlag = par1; -+ } -+ -+ /** -+ * Breaks a string into a list of pieces that will fit a specified width. -+ */ -+ public List listFormattedStringToWidth(String par1Str, int par2) { -+ return Arrays.asList(this.wrapFormattedStringToWidth(par1Str, par2).split("\n")); -+ } -+ -+ /** -+ * Inserts newline and formatting into a string to wrap it within the specified width. -+ */ -+ String wrapFormattedStringToWidth(String par1Str, int par2) { -+ int var3 = this.sizeStringToWidth(par1Str, par2); -+ -+ if (par1Str.length() <= var3) { -+ return par1Str; - } else { -- String var4 = var1.substring(0, var3); -- char var5 = var1.charAt(var3); -+ String var4 = par1Str.substring(0, var3); -+ char var5 = par1Str.charAt(var3); - boolean var6 = var5 == 32 || var5 == 10; -- String var7 = getFormatFromString(var4) + var1.substring(var3 + (var6 ? 1 : 0)); -- return var4 + "\n" + this.wrapFormattedStringToWidth(var7, var2); -+ String var7 = getFormatFromString(var4) + par1Str.substring(var3 + (var6 ? 1 : 0)); -+ return var4 + "\n" + this.wrapFormattedStringToWidth(var7, par2); - } - } - -- private int sizeStringToWidth(String var1, int var2) { -- int var3 = var1.length(); -+ /** -+ * Determines how many characters from the string will fit into the specified width. -+ */ -+ private int sizeStringToWidth(String par1Str, int par2) { -+ int var3 = par1Str.length(); - int var4 = 0; - int var5 = 0; - int var6 = -1; - -- for(boolean var7 = false; var5 < var3; ++var5) { -- char var8 = var1.charAt(var5); -- switch(var8) { -- case '\n': -- --var5; -- break; -- case ' ': -- var6 = var5; -- default: -- var4 += this.getCharWidth(var8); -- if(var7) { -- ++var4; -- } -- break; -- case '\u00a7': -- if(var5 < var3 - 1) { -- ++var5; -- char var9 = var1.charAt(var5); -- if(var9 != 108 && var9 != 76) { -- if(var9 == 114 || var9 == 82 || isFormatColor(var9)) { -- var7 = false; -+ for (boolean var7 = false; var5 < var3; ++var5) { -+ char var8 = par1Str.charAt(var5); -+ -+ switch (var8) { -+ case 10: -+ --var5; -+ break; -+ -+ case 167: -+ if (var5 < var3 - 1) { -+ ++var5; -+ char var9 = par1Str.charAt(var5); -+ -+ if (var9 != 108 && var9 != 76) { -+ if (var9 == 114 || var9 == 82 || isFormatColor(var9)) { -+ var7 = false; -+ } -+ } else { -+ var7 = true; - } -- } else { -- var7 = true; -- } -- } -+ } -+ -+ break; -+ -+ case 32: -+ var6 = var5; -+ -+ default: -+ var4 += this.getCharWidth(var8); -+ -+ if (var7) { -+ ++var4; -+ } - } - -- if(var8 == 10) { -+ if (var8 == 10) { - ++var5; - var6 = var5; - break; - } - -- if(var4 > var2) { -+ if (var4 > par2) { - break; - } - } -@@ -642,36 +848,46 @@ - return var5 != var3 && var6 != -1 && var6 < var5 ? var6 : var5; - } - -- private static boolean isFormatColor(char var0) { -- return var0 >= 48 && var0 <= 57 || var0 >= 97 && var0 <= 102 || var0 >= 65 && var0 <= 70; -- } -- -- private static boolean isFormatSpecial(char var0) { -- return var0 >= 107 && var0 <= 111 || var0 >= 75 && var0 <= 79 || var0 == 114 || var0 == 82; -- } -- -- private static String getFormatFromString(String var0) { -+ /** -+ * Checks if the char code is a hexadecimal character, used to set colour. -+ */ -+ private static boolean isFormatColor(char par0) { -+ return par0 >= 48 && par0 <= 57 || par0 >= 97 && par0 <= 102 || par0 >= 65 && par0 <= 70; -+ } -+ -+ /** -+ * Checks if the char code is O-K...lLrRk-o... used to set special formatting. -+ */ -+ private static boolean isFormatSpecial(char par0) { -+ return par0 >= 107 && par0 <= 111 || par0 >= 75 && par0 <= 79 || par0 == 114 || par0 == 82; -+ } -+ -+ /** -+ * Digests a string for nonprinting formatting characters then returns a string containing only that formatting. -+ */ -+ private static String getFormatFromString(String par0Str) { - String var1 = ""; - int var2 = -1; -- int var3 = var0.length(); -- -- while(true) { -- var2 = var0.indexOf(167, var2 + 1); -- if(var2 == -1) { -- return var1; -- } -- -- if(var2 < var3 - 1) { -- char var4 = var0.charAt(var2 + 1); -- if(isFormatColor(var4)) { -+ int var3 = par0Str.length(); -+ -+ while ((var2 = par0Str.indexOf(167, var2 + 1)) != -1) { -+ if (var2 < var3 - 1) { -+ char var4 = par0Str.charAt(var2 + 1); -+ -+ if (isFormatColor(var4)) { - var1 = "\u00a7" + var4; -- } else if(isFormatSpecial(var4)) { -+ } else if (isFormatSpecial(var4)) { - var1 = var1 + "\u00a7" + var4; - } - } - } -+ -+ return var1; - } - -+ /** -+ * Get bidiFlag that controls if the Unicode Bidirectional Algorithm should be run before rendering any string -+ */ - public boolean getBidiFlag() { - return this.bidiFlag; - } ---- /dev/null -+++ org/spoutcraft/client/SpoutVersion.java -@@ -1,0 +1,49 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.client; -+ -+public class SpoutVersion { -+ private final int major; -+ private final int minor; -+ private final int build; -+ private final int subbuild; -+ -+ public SpoutVersion() { -+ major = 0; -+ minor = 0; -+ build = -1; -+ subbuild = 0; -+ } -+ -+ public SpoutVersion(int major, int minor, int build, int subbuild) { -+ this.major = major; -+ this.minor = minor; -+ this.build = build; -+ this.subbuild = subbuild; -+ } -+ -+ public long getVersion() { -+ return major * 100 + minor * 10 + build; -+ } -+ -+ public String toString() { -+ return (new StringBuilder("")).append(major).append(".").append(minor).append(".").append(build).append(".").append(subbuild).toString(); -+ } -+} ---- /dev/null -+++ org/spoutcraft/api/gui/AbstractListModel.java -@@ -1,0 +1,52 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.api.gui; -+ -+import java.util.Collections; -+import java.util.HashSet; -+import java.util.Set; -+ -+public abstract class AbstractListModel { -+ private HashSet views = new HashSet(); -+ -+ public abstract ListWidgetItem getItem(int row); -+ -+ public abstract int getSize(); -+ -+ public abstract void onSelected(int item, boolean doubleClick); -+ -+ public void addView(GenericListView view) { -+ views.add(view); -+ } -+ -+ public void removeView(GenericListView view) { -+ views.remove(view); -+ } -+ -+ public void sizeChanged() { -+ for (GenericListView view:views) { -+ view.sizeChanged(); -+ } -+ } -+ -+ public Set getViews() { -+ return Collections.unmodifiableSet(views); -+ } -+} ---- net/minecraft/src/Packet25EntityPainting.java -+++ net/minecraft/src/Packet25EntityPainting.java -@@ -10,42 +10,53 @@ - public int yPosition; - public int zPosition; - public int direction; -- public String f; -- -- public Packet25EntityPainting() { -- } -- -- public Packet25EntityPainting(EntityPainting var1) { -- this.entityId = var1.entityId; -- this.xPosition = var1.xPosition; -- this.yPosition = var1.yPosition; -- this.zPosition = var1.zPosition; -- this.direction = var1.hangingDirection; -- this.f = var1.art.B; -- } -- -- public void readPacketData(DataInput var1) throws IOException { -- this.entityId = var1.readInt(); -- this.f = readString(var1, EnumArt.maxArtTitleLength); -- this.xPosition = var1.readInt(); -- this.yPosition = var1.readInt(); -- this.zPosition = var1.readInt(); -- this.direction = var1.readInt(); -- } -- -- public void writePacketData(DataOutput var1) throws IOException { -- var1.writeInt(this.entityId); -- writeString(this.f, var1); -- var1.writeInt(this.xPosition); -- var1.writeInt(this.yPosition); -- var1.writeInt(this.zPosition); -- var1.writeInt(this.direction); -- } -- -- public void processPacket(NetHandler var1) { -- var1.handleEntityPainting(this); -- } -- -+ public String title; -+ -+ public Packet25EntityPainting() {} -+ -+ public Packet25EntityPainting(EntityPainting par1EntityPainting) { -+ this.entityId = par1EntityPainting.entityId; -+ this.xPosition = par1EntityPainting.xPosition; -+ this.yPosition = par1EntityPainting.yPosition; -+ this.zPosition = par1EntityPainting.zPosition; -+ this.direction = par1EntityPainting.hangingDirection; -+ this.title = par1EntityPainting.art.title; -+ } -+ -+ /** -+ * Abstract. Reads the raw packet data from the data stream. -+ */ -+ public void readPacketData(DataInput par1DataInput) throws IOException { -+ this.entityId = par1DataInput.readInt(); -+ this.title = readString(par1DataInput, EnumArt.maxArtTitleLength); -+ this.xPosition = par1DataInput.readInt(); -+ this.yPosition = par1DataInput.readInt(); -+ this.zPosition = par1DataInput.readInt(); -+ this.direction = par1DataInput.readInt(); -+ } -+ -+ /** -+ * Abstract. Writes the raw packet data to the data stream. -+ */ -+ public void writePacketData(DataOutput par1DataOutput) throws IOException { -+ par1DataOutput.writeInt(this.entityId); -+ writeString(this.title, par1DataOutput); -+ par1DataOutput.writeInt(this.xPosition); -+ par1DataOutput.writeInt(this.yPosition); -+ par1DataOutput.writeInt(this.zPosition); -+ par1DataOutput.writeInt(this.direction); -+ } -+ -+ /** -+ * Passes this Packet on to the NetHandler for processing. -+ */ -+ public void processPacket(NetHandler par1NetHandler) { -+ par1NetHandler.handleEntityPainting(this); -+ } -+ -+ /** -+ * Abstract. Return the size of the packet (not counting the header). -+ */ - public int getPacketSize() { - return 24; - } ---- net/minecraft/src/WorldGenFlowers.java -+++ net/minecraft/src/WorldGenFlowers.java -@@ -3,19 +3,22 @@ - import java.util.Random; - - public class WorldGenFlowers extends WorldGenerator { -+ -+ /** The ID of the plant block used in this plant generator. */ - private int plantBlockId; - -- public WorldGenFlowers(int var1) { -- this.plantBlockId = var1; -+ public WorldGenFlowers(int par1) { -+ this.plantBlockId = par1; - } - -- public boolean generate(World var1, Random var2, int var3, int var4, int var5) { -- for(int var6 = 0; var6 < 64; ++var6) { -- int var7 = var3 + var2.nextInt(8) - var2.nextInt(8); -- int var8 = var4 + var2.nextInt(4) - var2.nextInt(4); -- int var9 = var5 + var2.nextInt(8) - var2.nextInt(8); -- if(var1.isAirBlock(var7, var8, var9) && (!var1.provider.hasNoSky || var8 < 127) && Block.blocksList[this.plantBlockId].canBlockStay(var1, var7, var8, var9)) { -- var1.setBlock(var7, var8, var9, this.plantBlockId, 0, 2); -+ public boolean generate(World par1World, Random par2Random, int par3, int par4, int par5) { -+ for (int var6 = 0; var6 < 64; ++var6) { -+ int var7 = par3 + par2Random.nextInt(8) - par2Random.nextInt(8); -+ int var8 = par4 + par2Random.nextInt(4) - par2Random.nextInt(4); -+ int var9 = par5 + par2Random.nextInt(8) - par2Random.nextInt(8); -+ -+ if (par1World.isAirBlock(var7, var8, var9) && (!par1World.provider.hasNoSky || var8 < 127) && Block.blocksList[this.plantBlockId].canBlockStay(par1World, var7, var8, var9)) { -+ par1World.setBlock(var7, var8, var9, this.plantBlockId, 0, 2); - } - } - ---- net/minecraft/src/ComponentScatteredFeature.java -+++ net/minecraft/src/ComponentScatteredFeature.java -@@ -3,66 +3,72 @@ - import java.util.Random; - - abstract class ComponentScatteredFeature extends StructureComponent { -+ -+ /** The size of the bounding box for this feature in the X axis */ - protected int scatteredFeatureSizeX; -+ -+ /** The size of the bounding box for this feature in the Y axis */ - protected int scatteredFeatureSizeY; -+ -+ /** The size of the bounding box for this feature in the Z axis */ - protected int scatteredFeatureSizeZ; - protected int field_74936_d = -1; - -- public ComponentScatteredFeature() { -- } -+ public ComponentScatteredFeature() {} - -- protected ComponentScatteredFeature(Random var1, int var2, int var3, int var4, int var5, int var6, int var7) { -+ protected ComponentScatteredFeature(Random par1Random, int par2, int par3, int par4, int par5, int par6, int par7) { - super(0); -- this.scatteredFeatureSizeX = var5; -- this.scatteredFeatureSizeY = var6; -- this.scatteredFeatureSizeZ = var7; -- this.coordBaseMode = var1.nextInt(4); -- switch(this.coordBaseMode) { -- case 0: -- case 2: -- this.boundingBox = new StructureBoundingBox(var2, var3, var4, var2 + var5 - 1, var3 + var6 - 1, var4 + var7 - 1); -- break; -- default: -- this.boundingBox = new StructureBoundingBox(var2, var3, var4, var2 + var7 - 1, var3 + var6 - 1, var4 + var5 - 1); -+ this.scatteredFeatureSizeX = par5; -+ this.scatteredFeatureSizeY = par6; -+ this.scatteredFeatureSizeZ = par7; -+ this.coordBaseMode = par1Random.nextInt(4); -+ -+ switch (this.coordBaseMode) { -+ case 0: -+ case 2: -+ this.boundingBox = new StructureBoundingBox(par2, par3, par4, par2 + par5 - 1, par3 + par6 - 1, par4 + par7 - 1); -+ break; -+ -+ default: -+ this.boundingBox = new StructureBoundingBox(par2, par3, par4, par2 + par7 - 1, par3 + par6 - 1, par4 + par5 - 1); - } -- -- } -- -- protected void func_143012_a(NBTTagCompound var1) { -- var1.setInteger("Width", this.scatteredFeatureSizeX); -- var1.setInteger("Height", this.scatteredFeatureSizeY); -- var1.setInteger("Depth", this.scatteredFeatureSizeZ); -- var1.setInteger("HPos", this.field_74936_d); -- } -- -- protected void func_143011_b(NBTTagCompound var1) { -- this.scatteredFeatureSizeX = var1.getInteger("Width"); -- this.scatteredFeatureSizeY = var1.getInteger("Height"); -- this.scatteredFeatureSizeZ = var1.getInteger("Depth"); -- this.field_74936_d = var1.getInteger("HPos"); -- } -- -- protected boolean func_74935_a(World var1, StructureBoundingBox var2, int var3) { -- if(this.field_74936_d >= 0) { -+ } -+ -+ protected void func_143012_a(NBTTagCompound par1NBTTagCompound) { -+ par1NBTTagCompound.setInteger("Width", this.scatteredFeatureSizeX); -+ par1NBTTagCompound.setInteger("Height", this.scatteredFeatureSizeY); -+ par1NBTTagCompound.setInteger("Depth", this.scatteredFeatureSizeZ); -+ par1NBTTagCompound.setInteger("HPos", this.field_74936_d); -+ } -+ -+ protected void func_143011_b(NBTTagCompound par1NBTTagCompound) { -+ this.scatteredFeatureSizeX = par1NBTTagCompound.getInteger("Width"); -+ this.scatteredFeatureSizeY = par1NBTTagCompound.getInteger("Height"); -+ this.scatteredFeatureSizeZ = par1NBTTagCompound.getInteger("Depth"); -+ this.field_74936_d = par1NBTTagCompound.getInteger("HPos"); -+ } -+ -+ protected boolean func_74935_a(World par1World, StructureBoundingBox par2StructureBoundingBox, int par3) { -+ if (this.field_74936_d >= 0) { - return true; - } else { - int var4 = 0; - int var5 = 0; - -- for(int var6 = this.boundingBox.minZ; var6 <= this.boundingBox.maxZ; ++var6) { -- for(int var7 = this.boundingBox.minX; var7 <= this.boundingBox.maxX; ++var7) { -- if(var2.isVecInside(var7, 64, var6)) { -- var4 += Math.max(var1.getTopSolidOrLiquidBlock(var7, var6), var1.provider.getAverageGroundLevel()); -+ for (int var6 = this.boundingBox.minZ; var6 <= this.boundingBox.maxZ; ++var6) { -+ for (int var7 = this.boundingBox.minX; var7 <= this.boundingBox.maxX; ++var7) { -+ if (par2StructureBoundingBox.isVecInside(var7, 64, var6)) { -+ var4 += Math.max(par1World.getTopSolidOrLiquidBlock(var7, var6), par1World.provider.getAverageGroundLevel()); - ++var5; - } - } - } - -- if(var5 == 0) { -+ if (var5 == 0) { - return false; - } else { - this.field_74936_d = var4 / var5; -- this.boundingBox.offset(0, this.field_74936_d - this.boundingBox.minY + var3, 0); -+ this.boundingBox.offset(0, this.field_74936_d - this.boundingBox.minY + par3, 0); - return true; - } - } ---- net/minecraft/src/GuiChest.java -+++ net/minecraft/src/GuiChest.java -@@ -6,25 +6,35 @@ - private static final ResourceLocation field_110421_t = new ResourceLocation("textures/gui/container/generic_54.png"); - private IInventory upperChestInventory; - private IInventory lowerChestInventory; -+ -+ /** -+ * window height is calculated with this values, the more rows, the heigher -+ */ - private int inventoryRows; - -- public GuiChest(IInventory var1, IInventory var2) { -- super(new ContainerChest(var1, var2)); -- this.upperChestInventory = var1; -- this.lowerChestInventory = var2; -+ public GuiChest(IInventory par1IInventory, IInventory par2IInventory) { -+ super(new ContainerChest(par1IInventory, par2IInventory)); -+ this.upperChestInventory = par1IInventory; -+ this.lowerChestInventory = par2IInventory; - this.allowUserInput = false; - short var3 = 222; - int var4 = var3 - 108; -- this.inventoryRows = var2.getSizeInventory() / 9; -+ this.inventoryRows = par2IInventory.getSizeInventory() / 9; - this.ySize = var4 + this.inventoryRows * 18; - } - -- protected void drawGuiContainerForegroundLayer(int var1, int var2) { -+ /** -+ * Draw the foreground layer for the GuiContainer (everything in front of the items) -+ */ -+ protected void drawGuiContainerForegroundLayer(int par1, int par2) { - this.fontRenderer.drawString(this.lowerChestInventory.isInvNameLocalized() ? this.lowerChestInventory.getInvName() : I18n.getString(this.lowerChestInventory.getInvName()), 8, 6, 4210752); - this.fontRenderer.drawString(this.upperChestInventory.isInvNameLocalized() ? this.upperChestInventory.getInvName() : I18n.getString(this.upperChestInventory.getInvName()), 8, this.ySize - 96 + 2, 4210752); - } - -- protected void drawGuiContainerBackgroundLayer(float var1, int var2, int var3) { -+ /** -+ * Draw the background layer for the GuiContainer (everything behind the items) -+ */ -+ protected void drawGuiContainerBackgroundLayer(float par1, int par2, int par3) { - GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - this.mc.getTextureManager().bindTexture(field_110421_t); - int var4 = (this.width - this.xSize) / 2; ---- net/minecraft/src/ItemDye.java -+++ net/minecraft/src/ItemDye.java -@@ -3,73 +3,88 @@ - import java.util.List; - - public class ItemDye extends Item { -- public static final String[] a = new String[]{"black", "red", "green", "brown", "blue", "purple", "cyan", "silver", "gray", "pink", "lime", "yellow", "lightBlue", "magenta", "orange", "white"}; -- public static final String[] b = new String[]{"black", "red", "green", "brown", "blue", "purple", "cyan", "silver", "gray", "pink", "lime", "yellow", "light_blue", "magenta", "orange", "white"}; -- public static final int[] dyeColors = new int[]{1973019, 11743532, 3887386, 5320730, 2437522, 8073150, 2651799, 11250603, 4408131, 14188952, 4312372, 14602026, 6719955, 12801229, 15435844, 15790320}; -+ -+ /** List of dye color names */ -+ public static final String[] dyeColorNames = new String[] {"black", "red", "green", "brown", "blue", "purple", "cyan", "silver", "gray", "pink", "lime", "yellow", "lightBlue", "magenta", "orange", "white"}; -+ public static final String[] dyeItemNames = new String[] {"black", "red", "green", "brown", "blue", "purple", "cyan", "silver", "gray", "pink", "lime", "yellow", "light_blue", "magenta", "orange", "white"}; -+ public static final int[] dyeColors = new int[] {1973019, 11743532, 3887386, 5320730, 2437522, 8073150, 2651799, 11250603, 4408131, 14188952, 4312372, 14602026, 6719955, 12801229, 15435844, 15790320}; - private Icon[] dyeIcons; - -- public ItemDye(int var1) { -- super(var1); -+ public ItemDye(int par1) { -+ super(par1); - this.setHasSubtypes(true); - this.setMaxDamage(0); - this.setCreativeTab(CreativeTabs.tabMaterials); - } - -- public Icon getIconFromDamage(int var1) { -- int var2 = MathHelper.clamp_int(var1, 0, 15); -+ /** -+ * Gets an icon index based on an item's damage value -+ */ -+ public Icon getIconFromDamage(int par1) { -+ int var2 = MathHelper.clamp_int(par1, 0, 15); - return this.dyeIcons[var2]; - } - -- public String getUnlocalizedName(ItemStack var1) { -- int var2 = MathHelper.clamp_int(var1.getItemDamage(), 0, 15); -- return super.getUnlocalizedName() + "." + a[var2]; -+ /** -+ * Returns the unlocalized name of this item. This version accepts an ItemStack so different stacks can have different -+ * names based on their damage or NBT. -+ */ -+ public String getUnlocalizedName(ItemStack par1ItemStack) { -+ int var2 = MathHelper.clamp_int(par1ItemStack.getItemDamage(), 0, 15); -+ return super.getUnlocalizedName() + "." + dyeColorNames[var2]; - } - -- public boolean onItemUse(ItemStack var1, EntityPlayer var2, World var3, int var4, int var5, int var6, int var7, float var8, float var9, float var10) { -- if(!var2.canPlayerEdit(var4, var5, var6, var7, var1)) { -+ /** -+ * Callback for item usage. If the item does something special on right clicking, he will have one of those. Return -+ * True if something happen and false if it don't. This is for ITEMS, not BLOCKS -+ */ -+ public boolean onItemUse(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, World par3World, int par4, int par5, int par6, int par7, float par8, float par9, float par10) { -+ if (!par2EntityPlayer.canPlayerEdit(par4, par5, par6, par7, par1ItemStack)) { - return false; - } else { -- if(var1.getItemDamage() == 15) { -- if(func_96604_a(var1, var3, var4, var5, var6)) { -- if(!var3.isRemote) { -- var3.playAuxSFX(2005, var4, var5, var6, 0); -+ if (par1ItemStack.getItemDamage() == 15) { -+ if (func_96604_a(par1ItemStack, par3World, par4, par5, par6)) { -+ if (!par3World.isRemote) { -+ par3World.playAuxSFX(2005, par4, par5, par6, 0); - } - - return true; - } -- } else if(var1.getItemDamage() == 3) { -- int var11 = var3.getBlockId(var4, var5, var6); -- int var12 = var3.getBlockMetadata(var4, var5, var6); -- if(var11 == Block.wood.blockID && BlockLog.limitToValidMetadata(var12) == 3) { -- if(var7 == 0) { -- return false; -- } -- -- if(var7 == 1) { -- return false; -- } -- -- if(var7 == 2) { -- --var6; -- } -- -- if(var7 == 3) { -- ++var6; -- } -- -- if(var7 == 4) { -- --var4; -- } -- -- if(var7 == 5) { -- ++var4; -- } -- -- if(var3.isAirBlock(var4, var5, var6)) { -- int var13 = Block.blocksList[Block.cocoaPlant.blockID].onBlockPlaced(var3, var4, var5, var6, var7, var8, var9, var10, 0); -- var3.setBlock(var4, var5, var6, Block.cocoaPlant.blockID, var13, 2); -- if(!var2.capabilities.isCreativeMode) { -- --var1.stackSize; -+ } else if (par1ItemStack.getItemDamage() == 3) { -+ int var11 = par3World.getBlockId(par4, par5, par6); -+ int var12 = par3World.getBlockMetadata(par4, par5, par6); -+ -+ if (var11 == Block.wood.blockID && BlockLog.limitToValidMetadata(var12) == 3) { -+ if (par7 == 0) { -+ return false; -+ } -+ -+ if (par7 == 1) { -+ return false; -+ } -+ -+ if (par7 == 2) { -+ --par6; -+ } -+ -+ if (par7 == 3) { -+ ++par6; -+ } -+ -+ if (par7 == 4) { -+ --par4; -+ } -+ -+ if (par7 == 5) { -+ ++par4; -+ } -+ -+ if (par3World.isAirBlock(par4, par5, par6)) { -+ int var13 = Block.blocksList[Block.cocoaPlant.blockID].onBlockPlaced(par3World, par4, par5, par6, par7, par8, par9, par10, 0); -+ par3World.setBlock(par4, par5, par6, Block.cocoaPlant.blockID, var13, 2); -+ -+ if (!par2EntityPlayer.capabilities.isCreativeMode) { -+ --par1ItemStack.stackSize; - } - } - -@@ -81,27 +96,28 @@ - } - } - -- public static boolean func_96604_a(ItemStack var0, World var1, int var2, int var3, int var4) { -- int var5 = var1.getBlockId(var2, var3, var4); -- if(var5 == Block.sapling.blockID) { -- if(!var1.isRemote) { -- if((double)var1.s.nextFloat() < 0.45D) { -- ((BlockSapling)Block.sapling).markOrGrowMarked(var1, var2, var3, var4, var1.s); -+ public static boolean func_96604_a(ItemStack par0ItemStack, World par1World, int par2, int par3, int par4) { -+ int var5 = par1World.getBlockId(par2, par3, par4); -+ -+ if (var5 == Block.sapling.blockID) { -+ if (!par1World.isRemote) { -+ if ((double)par1World.rand.nextFloat() < 0.45D) { -+ ((BlockSapling)Block.sapling).markOrGrowMarked(par1World, par2, par3, par4, par1World.rand); - } - -- --var0.stackSize; -+ --par0ItemStack.stackSize; - } - - return true; -- } else if(var5 != Block.mushroomBrown.blockID && var5 != Block.mushroomRed.blockID) { -- if(var5 != Block.melonStem.blockID && var5 != Block.pumpkinStem.blockID) { -- if(var5 > 0 && Block.blocksList[var5] instanceof BlockCrops) { -- if(var1.getBlockMetadata(var2, var3, var4) == 7) { -+ } else if (var5 != Block.mushroomBrown.blockID && var5 != Block.mushroomRed.blockID) { -+ if (var5 != Block.melonStem.blockID && var5 != Block.pumpkinStem.blockID) { -+ if (var5 > 0 && Block.blocksList[var5] instanceof BlockCrops) { -+ if (par1World.getBlockMetadata(par2, par3, par4) == 7) { - return false; - } else { -- if(!var1.isRemote) { -- ((BlockCrops)Block.blocksList[var5]).fertilize(var1, var2, var3, var4); -- --var0.stackSize; -+ if (!par1World.isRemote) { -+ ((BlockCrops)Block.blocksList[var5]).fertilize(par1World, par2, par3, par4); -+ --par0ItemStack.stackSize; - } - - return true; -@@ -110,53 +126,56 @@ - int var6; - int var7; - int var8; -- if(var5 == Block.cocoaPlant.blockID) { -- var6 = var1.getBlockMetadata(var2, var3, var4); -+ -+ if (var5 == Block.cocoaPlant.blockID) { -+ var6 = par1World.getBlockMetadata(par2, par3, par4); - var7 = BlockDirectional.getDirection(var6); - var8 = BlockCocoa.func_72219_c(var6); -- if(var8 >= 2) { -+ -+ if (var8 >= 2) { - return false; - } else { -- if(!var1.isRemote) { -+ if (!par1World.isRemote) { - ++var8; -- var1.setBlockMetadata(var2, var3, var4, var8 << 2 | var7, 2); -- --var0.stackSize; -+ par1World.setBlockMetadataWithNotify(par2, par3, par4, var8 << 2 | var7, 2); -+ --par0ItemStack.stackSize; - } - - return true; - } -- } else if(var5 != Block.grass.blockID) { -+ } else if (var5 != Block.grass.blockID) { - return false; - } else { -- if(!var1.isRemote) { -- --var0.stackSize; -- -+ if (!par1World.isRemote) { -+ --par0ItemStack.stackSize; - label102: -- for(var6 = 0; var6 < 128; ++var6) { -- var7 = var2; -- var8 = var3 + 1; -- int var9 = var4; -- -- for(int var10 = 0; var10 < var6 / 16; ++var10) { -- var7 += f.nextInt(3) - 1; -- var8 += (f.nextInt(3) - 1) * f.nextInt(3) / 2; -- var9 += f.nextInt(3) - 1; -- if(var1.getBlockId(var7, var8 - 1, var9) != Block.grass.blockID || var1.isBlockNormalCube(var7, var8, var9)) { -+ -+ for (var6 = 0; var6 < 128; ++var6) { -+ var7 = par2; -+ var8 = par3 + 1; -+ int var9 = par4; -+ -+ for (int var10 = 0; var10 < var6 / 16; ++var10) { -+ var7 += itemRand.nextInt(3) - 1; -+ var8 += (itemRand.nextInt(3) - 1) * itemRand.nextInt(3) / 2; -+ var9 += itemRand.nextInt(3) - 1; -+ -+ if (par1World.getBlockId(var7, var8 - 1, var9) != Block.grass.blockID || par1World.isBlockNormalCube(var7, var8, var9)) { - continue label102; - } - } - -- if(var1.getBlockId(var7, var8, var9) == 0) { -- if(f.nextInt(10) != 0) { -- if(Block.tallGrass.canBlockStay(var1, var7, var8, var9)) { -- var1.setBlock(var7, var8, var9, Block.tallGrass.blockID, 1, 3); -- } -- } else if(f.nextInt(3) != 0) { -- if(Block.plantYellow.canBlockStay(var1, var7, var8, var9)) { -- var1.setBlock(var7, var8, var9, Block.plantYellow.blockID); -- } -- } else if(Block.plantRed.canBlockStay(var1, var7, var8, var9)) { -- var1.setBlock(var7, var8, var9, Block.plantRed.blockID); -+ if (par1World.getBlockId(var7, var8, var9) == 0) { -+ if (itemRand.nextInt(10) != 0) { -+ if (Block.tallGrass.canBlockStay(par1World, var7, var8, var9)) { -+ par1World.setBlock(var7, var8, var9, Block.tallGrass.blockID, 1, 3); -+ } -+ } else if (itemRand.nextInt(3) != 0) { -+ if (Block.plantYellow.canBlockStay(par1World, var7, var8, var9)) { -+ par1World.setBlock(var7, var8, var9, Block.plantYellow.blockID); -+ } -+ } else if (Block.plantRed.canBlockStay(par1World, var7, var8, var9)) { -+ par1World.setBlock(var7, var8, var9, Block.plantRed.blockID); - } - } - } -@@ -165,56 +184,61 @@ - return true; - } - } -- } else if(var1.getBlockMetadata(var2, var3, var4) == 7) { -+ } else if (par1World.getBlockMetadata(par2, par3, par4) == 7) { - return false; - } else { -- if(!var1.isRemote) { -- ((BlockStem)Block.blocksList[var5]).fertilizeStem(var1, var2, var3, var4); -- --var0.stackSize; -+ if (!par1World.isRemote) { -+ ((BlockStem)Block.blocksList[var5]).fertilizeStem(par1World, par2, par3, par4); -+ --par0ItemStack.stackSize; - } - - return true; - } - } else { -- if(!var1.isRemote) { -- if((double)var1.s.nextFloat() < 0.4D) { -- ((BlockMushroom)Block.blocksList[var5]).fertilizeMushroom(var1, var2, var3, var4, var1.s); -+ if (!par1World.isRemote) { -+ if ((double)par1World.rand.nextFloat() < 0.4D) { -+ ((BlockMushroom)Block.blocksList[var5]).fertilizeMushroom(par1World, par2, par3, par4, par1World.rand); - } - -- --var0.stackSize; -+ --par0ItemStack.stackSize; - } - - return true; - } - } - -- public static void func_96603_a(World var0, int var1, int var2, int var3, int var4) { -- int var5 = var0.getBlockId(var1, var2, var3); -- if(var4 == 0) { -- var4 = 15; -+ public static void func_96603_a(World par0World, int par1, int par2, int par3, int par4) { -+ int var5 = par0World.getBlockId(par1, par2, par3); -+ -+ if (par4 == 0) { -+ par4 = 15; - } - - Block var6 = var5 > 0 && var5 < Block.blocksList.length ? Block.blocksList[var5] : null; -- if(var6 != null) { -- var6.setBlockBoundsBasedOnState(var0, var1, var2, var3); -- -- for(int var7 = 0; var7 < var4; ++var7) { -- double var8 = f.nextGaussian() * 0.02D; -- double var10 = f.nextGaussian() * 0.02D; -- double var12 = f.nextGaussian() * 0.02D; -- var0.spawnParticle("happyVillager", (double)((float)var1 + f.nextFloat()), (double)var2 + (double)f.nextFloat() * var6.getBlockBoundsMaxY(), (double)((float)var3 + f.nextFloat()), var8, var10, var12); -+ -+ if (var6 != null) { -+ var6.setBlockBoundsBasedOnState(par0World, par1, par2, par3); -+ -+ for (int var7 = 0; var7 < par4; ++var7) { -+ double var8 = itemRand.nextGaussian() * 0.02D; -+ double var10 = itemRand.nextGaussian() * 0.02D; -+ double var12 = itemRand.nextGaussian() * 0.02D; -+ par0World.spawnParticle("happyVillager", (double)((float)par1 + itemRand.nextFloat()), (double)par2 + (double)itemRand.nextFloat() * var6.getBlockBoundsMaxY(), (double)((float)par3 + itemRand.nextFloat()), var8, var10, var12); - } -- - } - } - -- public boolean itemInteractionForEntity(ItemStack var1, EntityPlayer var2, EntityLivingBase var3) { -- if(var3 instanceof EntitySheep) { -- EntitySheep var4 = (EntitySheep)var3; -- int var5 = BlockColored.getBlockFromDye(var1.getItemDamage()); -- if(!var4.getSheared() && var4.getFleeceColor() != var5) { -+ /** -+ * Returns true if the item can be used on the given entity, e.g. shears on sheep. -+ */ -+ public boolean itemInteractionForEntity(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, EntityLivingBase par3EntityLivingBase) { -+ if (par3EntityLivingBase instanceof EntitySheep) { -+ EntitySheep var4 = (EntitySheep)par3EntityLivingBase; -+ int var5 = BlockColored.getBlockFromDye(par1ItemStack.getItemDamage()); -+ -+ if (!var4.getSheared() && var4.getFleeceColor() != var5) { - var4.setFleeceColor(var5); -- --var1.stackSize; -+ --par1ItemStack.stackSize; - } - - return true; -@@ -223,19 +247,20 @@ - } - } - -- public void getSubItems(int var1, CreativeTabs var2, List var3) { -- for(int var4 = 0; var4 < 16; ++var4) { -- var3.add(new ItemStack(var1, 1, var4)); -+ /** -+ * returns a list of items with the same ID, but different meta (eg: dye returns 16 items) -+ */ -+ public void getSubItems(int par1, CreativeTabs par2CreativeTabs, List par3List) { -+ for (int var4 = 0; var4 < 16; ++var4) { -+ par3List.add(new ItemStack(par1, 1, var4)); - } -- - } - -- public void registerIcons(IconRegister var1) { -- this.dyeIcons = new Icon[b.length]; -+ public void registerIcons(IconRegister par1IconRegister) { -+ this.dyeIcons = new Icon[dyeItemNames.length]; - -- for(int var2 = 0; var2 < b.length; ++var2) { -- this.dyeIcons[var2] = var1.registerIcon(this.getIconString() + "_" + b[var2]); -+ for (int var2 = 0; var2 < dyeItemNames.length; ++var2) { -+ this.dyeIcons[var2] = par1IconRegister.registerIcon(this.getIconString() + "_" + dyeItemNames[var2]); - } -- - } - } ---- net/minecraft/src/CommandServerEmote.java -+++ net/minecraft/src/CommandServerEmote.java -@@ -8,24 +8,30 @@ - return "me"; - } - -+ /** -+ * Return the required permission level for this command. -+ */ - public int getRequiredPermissionLevel() { - return 0; - } - -- public String getCommandUsage(ICommandSender var1) { -+ public String getCommandUsage(ICommandSender par1ICommandSender) { - return "commands.me.usage"; - } - -- public void processCommand(ICommandSender var1, String[] var2) { -- if(var2.length > 0) { -- String var3 = func_82361_a(var1, var2, 0, var1.canCommandSenderUseCommand(1, "me")); -- MinecraftServer.getServer().getConfigurationManager().sendChatMsg(ChatMessageComponent.createFromTranslationWithSubstitutions("chat.type.emote", new Object[]{var1.getCommandSenderName(), var3})); -+ public void processCommand(ICommandSender par1ICommandSender, String[] par2ArrayOfStr) { -+ if (par2ArrayOfStr.length > 0) { -+ String var3 = func_82361_a(par1ICommandSender, par2ArrayOfStr, 0, par1ICommandSender.canCommandSenderUseCommand(1, "me")); -+ MinecraftServer.getServer().getConfigurationManager().sendChatMsg(ChatMessageComponent.createFromTranslationWithSubstitutions("chat.type.emote", new Object[] {par1ICommandSender.getCommandSenderName(), var3})); - } else { - throw new WrongUsageException("commands.me.usage", new Object[0]); - } - } - -- public List addTabCompletionOptions(ICommandSender var1, String[] var2) { -- return getListOfStringsMatchingLastWord(var2, MinecraftServer.getServer().getAllUsernames()); -+ /** -+ * Adds the strings available in this command to the given list of tab completion options. -+ */ -+ public List addTabCompletionOptions(ICommandSender par1ICommandSender, String[] par2ArrayOfStr) { -+ return getListOfStringsMatchingLastWord(par2ArrayOfStr, MinecraftServer.getServer().getAllUsernames()); - } - } ---- /dev/null -+++ com/prupe/mcpatcher/cc/ColorizeBlock.java -@@ -1,0 +1,307 @@ -+package com.prupe.mcpatcher.cc; -+ -+import com.prupe.mcpatcher.Config; -+import com.prupe.mcpatcher.MCLogger; -+import com.prupe.mcpatcher.MCPatcherUtils; -+import com.prupe.mcpatcher.TexturePackAPI; -+import java.util.Arrays; -+import java.util.HashMap; -+import java.util.Iterator; -+import java.util.Map; -+import java.util.Properties; -+import java.util.Map.Entry; -+import net.minecraft.src.Block; -+import net.minecraft.src.IBlockAccess; -+import net.minecraft.src.ResourceLocation; -+import org.lwjgl.opengl.GL11; -+ -+public class ColorizeBlock { -+ private static final MCLogger logger = MCLogger.getLogger("Custom Colors"); -+ private static final ResourceLocation REDSTONE_COLORS = TexturePackAPI.newMCPatcherResourceLocation("colormap/redstone.png"); -+ private static final ResourceLocation STEM_COLORS = TexturePackAPI.newMCPatcherResourceLocation("colormap/stem.png"); -+ private static final ResourceLocation PUMPKIN_STEM_COLORS = TexturePackAPI.newMCPatcherResourceLocation("colormap/pumpkinstem.png"); -+ private static final ResourceLocation MELON_STEM_COLORS = TexturePackAPI.newMCPatcherResourceLocation("colormap/melonstem.png"); -+ private static final ResourceLocation SWAMPGRASSCOLOR = TexturePackAPI.newMCPatcherResourceLocation("colormap/swampgrass.png"); -+ private static final ResourceLocation SWAMPFOLIAGECOLOR = TexturePackAPI.newMCPatcherResourceLocation("colormap/swampfoliage.png"); -+ private static final ResourceLocation PINECOLOR = TexturePackAPI.newMCPatcherResourceLocation("colormap/pine.png"); -+ private static final ResourceLocation BIRCHCOLOR = TexturePackAPI.newMCPatcherResourceLocation("colormap/birch.png"); -+ private static final ResourceLocation FOLIAGECOLOR = TexturePackAPI.newMCPatcherResourceLocation("colormap/foliage.png"); -+ private static final ResourceLocation WATERCOLOR = TexturePackAPI.newMCPatcherResourceLocation("colormap/water.png"); -+ private static final ResourceLocation UNDERWATERCOLOR = TexturePackAPI.newMCPatcherResourceLocation("colormap/underwater.png"); -+ private static final ResourceLocation FOGCOLOR0 = TexturePackAPI.newMCPatcherResourceLocation("colormap/fog0.png"); -+ private static final ResourceLocation SKYCOLOR0 = TexturePackAPI.newMCPatcherResourceLocation("colormap/sky0.png"); -+ private static final String PALETTE_BLOCK_KEY = "palette.block."; -+ private static final int BLOCK_ID_PUMPKIN_STEM = 104; -+ private static final int BLOCK_ID_MELON_STEM = 105; -+ private static final ColorMap[] blockColorMaps = new ColorMap[Block.blocksList.length]; -+ private static final Map blockMetaColorMaps = new HashMap(); -+ private static int lilypadColor; -+ private static float[][] redstoneColor; -+ private static int[] pumpkinStemColors; -+ private static int[] melonStemColors; -+ private static final int blockBlendRadius = Config.getInt("Custom Colors", "blockBlendRadius", 1); -+ private static final float blockBlendScale = (float)Math.pow((double)(2 * blockBlendRadius + 1), -2.0D); -+ public static float[] waterColor; -+ -+ static void reset() { -+ Colorizer.fixedColorMaps[0] = new ColorMap(5131854); -+ Colorizer.fixedColorMaps[1] = new ColorMap(5131854); -+ Colorizer.fixedColorMaps[2] = new ColorMap(6396257); -+ Colorizer.fixedColorMaps[3] = new ColorMap(8431445); -+ Colorizer.fixedColorMaps[4] = new ColorMap(4764952); -+ Colorizer.fixedColorMaps[5] = new ColorMap(16777215); -+ Colorizer.fixedColorMaps[6] = new ColorMap(329011); -+ Colorizer.fixedColorMaps[7] = new ColorMap(12638463); -+ Colorizer.fixedColorMaps[8] = new ColorMap(16777215); -+ Arrays.fill(blockColorMaps, (Object)null); -+ blockMetaColorMaps.clear(); -+ lilypadColor = 2129968; -+ waterColor = new float[] {0.2F, 0.3F, 1.0F}; -+ redstoneColor = (float[][])null; -+ pumpkinStemColors = null; -+ melonStemColors = null; -+ } -+ -+ static void reloadColorMaps(Properties properties) { -+ Colorizer.fixedColorMaps[0].loadColorMap(Colorizer.useSwampColors, SWAMPGRASSCOLOR); -+ Colorizer.fixedColorMaps[1].loadColorMap(Colorizer.useSwampColors, SWAMPFOLIAGECOLOR); -+ Colorizer.fixedColorMaps[2].loadColorMap(Colorizer.useTreeColors, PINECOLOR); -+ Colorizer.fixedColorMaps[3].loadColorMap(Colorizer.useTreeColors, BIRCHCOLOR); -+ Colorizer.fixedColorMaps[4].loadColorMap(Colorizer.useTreeColors, FOLIAGECOLOR); -+ Colorizer.fixedColorMaps[4].clear(); -+ Colorizer.fixedColorMaps[5].loadColorMap(Colorizer.useWaterColors, WATERCOLOR); -+ Colorizer.fixedColorMaps[6].loadColorMap(Colorizer.useWaterColors, UNDERWATERCOLOR); -+ Colorizer.fixedColorMaps[7].loadColorMap(Colorizer.useFogColors, FOGCOLOR0); -+ Colorizer.fixedColorMaps[8].loadColorMap(Colorizer.useFogColors, SKYCOLOR0); -+ } -+ -+ static void reloadSwampColors(Properties properties) { -+ int[] temp = new int[] {lilypadColor}; -+ Colorizer.loadIntColor("lilypad", temp, 0); -+ lilypadColor = temp[0]; -+ } -+ -+ static void reloadBlockColors(Properties properties) { -+ Iterator i$ = properties.entrySet().iterator(); -+ -+ while (i$.hasNext()) { -+ Entry entry = (Entry)i$.next(); -+ -+ if (entry.getKey() instanceof String && entry.getValue() instanceof String) { -+ String key = (String)entry.getKey(); -+ String value = (String)entry.getValue(); -+ -+ if (key.startsWith("palette.block.")) { -+ ResourceLocation address = TexturePackAPI.parseResourceLocation(Colorizer.COLOR_PROPERTIES, key.substring("palette.block.".length()).trim()); -+ -+ if (address != null) { -+ ColorMap colorMap = new ColorMap(16777215); -+ colorMap.loadColorMap(true, address); -+ -+ if (colorMap.isCustom()) { -+ String[] arr$ = value.split("\\s+"); -+ int len$ = arr$.length; -+ -+ for (int i$1 = 0; i$1 < len$; ++i$1) { -+ String idString = arr$[i$1]; -+ String[] tokens = idString.split(":"); -+ int[] tokensInt = new int[tokens.length]; -+ -+ try { -+ for (int e = 0; e < tokens.length; ++e) { -+ tokensInt[e] = Integer.parseInt(tokens[e]); -+ } -+ } catch (NumberFormatException var14) { -+ continue; -+ } -+ -+ switch (tokensInt.length) { -+ case 1: -+ if (tokensInt[0] < 0 || tokensInt[0] >= blockColorMaps.length) { -+ continue; -+ } -+ -+ blockColorMaps[tokensInt[0]] = colorMap; -+ break; -+ -+ case 2: -+ blockMetaColorMaps.put(Float.valueOf(ColorMap.getBlockMetaKey(tokensInt[0], tokensInt[1])), colorMap); -+ break; -+ -+ default: -+ continue; -+ } -+ -+ logger.finer("using %s for block %s, default color %06x", new Object[] {key, idString, Integer.valueOf(colorMap.colorize())}); -+ } -+ } -+ } -+ } -+ } -+ } -+ } -+ -+ static void reloadRedstoneColors(Properties properties) { -+ int[] rgb = MCPatcherUtils.getImageRGB(TexturePackAPI.getImage(REDSTONE_COLORS)); -+ -+ if (rgb != null && rgb.length >= 16) { -+ redstoneColor = new float[16][]; -+ -+ for (int i = 0; i < 16; ++i) { -+ float[] f = new float[3]; -+ Colorizer.intToFloat3(rgb[i], f); -+ redstoneColor[i] = f; -+ } -+ } -+ } -+ -+ static void reloadStemColors(Properties properties) { -+ int[] stemColors = getStemRGB(STEM_COLORS); -+ pumpkinStemColors = getStemRGB(PUMPKIN_STEM_COLORS); -+ -+ if (pumpkinStemColors == null) { -+ pumpkinStemColors = stemColors; -+ } -+ -+ melonStemColors = getStemRGB(MELON_STEM_COLORS); -+ -+ if (melonStemColors == null) { -+ melonStemColors = stemColors; -+ } -+ } -+ -+ private static int[] getStemRGB(ResourceLocation resource) { -+ int[] rgb = MCPatcherUtils.getImageRGB(TexturePackAPI.getImage(resource)); -+ return rgb != null && rgb.length >= 8 ? rgb : null; -+ } -+ -+ public static int colorizeBiome(int defaultColor, int index, double temperature, double rainfall) { -+ return Colorizer.fixedColorMaps[index].colorize(defaultColor, temperature, rainfall); -+ } -+ -+ public static int colorizeBiome(int defaultColor, int index) { -+ return Colorizer.fixedColorMaps[index].colorize(defaultColor); -+ } -+ -+ public static int colorizeBiome(int defaultColor, int index, int i, int j, int k) { -+ return Colorizer.fixedColorMaps[index].colorize(defaultColor, i, j, k); -+ } -+ -+ public static int colorizeBiomeWithBlending(int defaultColor, int index, int i, int j, int k) { -+ return colorizeWithBlending(Colorizer.fixedColorMaps[index], defaultColor, i, j, k); -+ } -+ -+ public static int colorizeWater(Object dummy, int i, int k) { -+ return Colorizer.fixedColorMaps[5].colorize(BiomeHelper.getWaterColorMultiplier(i, 64, k), i, 64, k); -+ } -+ -+ public static int colorizeBlock(Block block, int i, int j, int k, int metadata) { -+ ColorMap colorMap = null; -+ -+ if (!blockMetaColorMaps.isEmpty()) { -+ colorMap = (ColorMap)blockMetaColorMaps.get(Float.valueOf(ColorMap.getBlockMetaKey(block.blockID, metadata))); -+ } -+ -+ if (colorMap == null && block.blockID >= 0 && block.blockID < blockColorMaps.length) { -+ colorMap = blockColorMaps[block.blockID]; -+ } -+ -+ return colorizeWithBlending(colorMap, 16777215, i, j, k); -+ } -+ -+ private static int colorizeWithBlending(ColorMap colorMap, int defaultColor, int i, int j, int k) { -+ if (colorMap != null && colorMap.isCustom() && blockBlendRadius > 0) { -+ float[] f = new float[3]; -+ colorMap.colorizeWithBlending(i, j, k, blockBlendRadius, f); -+ return Colorizer.float3ToInt(f); -+ } else { -+ return defaultColor; -+ } -+ } -+ -+ public static int colorizeBlock(Block block) { -+ ColorMap colorMap = blockColorMaps[block.blockID]; -+ return colorMap == null ? 16777215 : colorMap.colorize(16777215); -+ } -+ -+ public static int colorizeStem(int defaultColor, Block block, int blockMetadata) { -+ int[] colors; -+ -+ switch (block.blockID) { -+ case 104: -+ colors = pumpkinStemColors; -+ break; -+ -+ case 105: -+ colors = melonStemColors; -+ break; -+ -+ default: -+ return defaultColor; -+ } -+ -+ return colors == null ? defaultColor : colors[blockMetadata & 7]; -+ } -+ -+ public static int getLilyPadColor() { -+ return lilypadColor; -+ } -+ -+ public static int getItemColorFromDamage(int defaultColor, int blockID, int damage) { -+ return blockID != 8 && blockID != 9 ? defaultColor : colorizeBiome(defaultColor, 5); -+ } -+ -+ public static boolean computeRedstoneWireColor(int current) { -+ if (redstoneColor == null) { -+ return false; -+ } else { -+ System.arraycopy(redstoneColor[Math.max(Math.min(current, 15), 0)], 0, Colorizer.setColor, 0, 3); -+ return true; -+ } -+ } -+ -+ public static int colorizeRedstoneWire(IBlockAccess blockAccess, int i, int j, int k, int defaultColor) { -+ if (redstoneColor == null) { -+ return defaultColor; -+ } else { -+ int metadata = Math.max(Math.min(blockAccess.getBlockMetadata(i, j, k), 15), 0); -+ return Colorizer.float3ToInt(redstoneColor[metadata]); -+ } -+ } -+ -+ public static boolean computeWaterColor(double x, double y, double z) { -+ if (Colorizer.useParticleColors && Colorizer.fixedColorMaps[5].isCustom()) { -+ int rgb = colorizeBiome(16777215, 5, (int)x, (int)y, (int)z); -+ float[] multiplier = new float[3]; -+ Colorizer.intToFloat3(rgb, multiplier); -+ -+ for (int i = 0; i < 3; ++i) { -+ waterColor[i] = multiplier[i] * ColorizeEntity.waterBaseColor[i]; -+ } -+ -+ return true; -+ } else { -+ return false; -+ } -+ } -+ -+ public static void computeWaterColor() { -+ int rgb = colorizeBiome(16777215, 5); -+ Colorizer.intToFloat3(rgb, waterColor); -+ } -+ -+ public static void colorizeWaterBlockGL(int blockID) { -+ if (blockID == 8 || blockID == 9) { -+ computeWaterColor(); -+ GL11.glColor4f(waterColor[0], waterColor[1], waterColor[2], 1.0F); -+ } -+ } -+ -+ static { -+ try { -+ reset(); -+ } catch (Throwable var1) { -+ var1.printStackTrace(); -+ } -+ } -+} ---- net/minecraft/src/GenLayerVoronoiZoom.java -+++ net/minecraft/src/GenLayerVoronoiZoom.java -@@ -1,31 +1,35 @@ - package net.minecraft.src; - - public class GenLayerVoronoiZoom extends GenLayer { -- public GenLayerVoronoiZoom(long var1, GenLayer var3) { -- super(var1); -- super.parent = var3; -+ public GenLayerVoronoiZoom(long par1, GenLayer par3GenLayer) { -+ super(par1); -+ super.parent = par3GenLayer; - } - -- public int[] getInts(int var1, int var2, int var3, int var4) { -- var1 -= 2; -- var2 -= 2; -+ /** -+ * Returns a list of integer values generated by this layer. These may be interpreted as temperatures, rainfall -+ * amounts, or biomeList[] indices based on the particular GenLayer subclass. -+ */ -+ public int[] getInts(int par1, int par2, int par3, int par4) { -+ par1 -= 2; -+ par2 -= 2; - byte var5 = 2; - int var6 = 1 << var5; -- int var7 = var1 >> var5; -- int var8 = var2 >> var5; -- int var9 = (var3 >> var5) + 3; -- int var10 = (var4 >> var5) + 3; -+ int var7 = par1 >> var5; -+ int var8 = par2 >> var5; -+ int var9 = (par3 >> var5) + 3; -+ int var10 = (par4 >> var5) + 3; - int[] var11 = this.parent.getInts(var7, var8, var9, var10); - int var12 = var9 << var5; - int var13 = var10 << var5; - int[] var14 = IntCache.getIntCache(var12 * var13); -- - int var16; -- for(int var15 = 0; var15 < var10 - 1; ++var15) { -+ -+ for (int var15 = 0; var15 < var10 - 1; ++var15) { - var16 = var11[0 + (var15 + 0) * var9]; - int var17 = var11[0 + (var15 + 1) * var9]; - -- for(int var18 = 0; var18 < var9 - 1; ++var18) { -+ for (int var18 = 0; var18 < var9 - 1; ++var18) { - double var19 = (double)var6 * 0.9D; - this.initChunkSeed((long)(var18 + var7 << var5), (long)(var15 + var8 << var5)); - double var21 = ((double)this.nextInt(1024) / 1024.0D - 0.5D) * var19; -@@ -42,19 +46,20 @@ - int var37 = var11[var18 + 1 + (var15 + 0) * var9]; - int var38 = var11[var18 + 1 + (var15 + 1) * var9]; - -- for(int var39 = 0; var39 < var6; ++var39) { -+ for (int var39 = 0; var39 < var6; ++var39) { - int var40 = ((var15 << var5) + var39) * var12 + (var18 << var5); - -- for(int var41 = 0; var41 < var6; ++var41) { -+ for (int var41 = 0; var41 < var6; ++var41) { - double var42 = ((double)var39 - var23) * ((double)var39 - var23) + ((double)var41 - var21) * ((double)var41 - var21); - double var44 = ((double)var39 - var27) * ((double)var39 - var27) + ((double)var41 - var25) * ((double)var41 - var25); - double var46 = ((double)var39 - var31) * ((double)var39 - var31) + ((double)var41 - var29) * ((double)var41 - var29); - double var48 = ((double)var39 - var35) * ((double)var39 - var35) + ((double)var41 - var33) * ((double)var41 - var33); -- if(var42 < var44 && var42 < var46 && var42 < var48) { -+ -+ if (var42 < var44 && var42 < var46 && var42 < var48) { - var14[var40++] = var16; -- } else if(var44 < var42 && var44 < var46 && var44 < var48) { -+ } else if (var44 < var42 && var44 < var46 && var44 < var48) { - var14[var40++] = var37; -- } else if(var46 < var42 && var46 < var44 && var46 < var48) { -+ } else if (var46 < var42 && var46 < var44 && var46 < var48) { - var14[var40++] = var17; - } else { - var14[var40++] = var38; -@@ -67,10 +72,10 @@ - } - } - -- int[] var50 = IntCache.getIntCache(var3 * var4); -+ int[] var50 = IntCache.getIntCache(par3 * par4); - -- for(var16 = 0; var16 < var4; ++var16) { -- System.arraycopy(var14, (var16 + (var2 & var6 - 1)) * (var9 << var5) + (var1 & var6 - 1), var50, var16 * var3, var3); -+ for (var16 = 0; var16 < par4; ++var16) { -+ System.arraycopy(var14, (var16 + (par2 & var6 - 1)) * (var9 << var5) + (par1 & var6 - 1), var50, var16 * par3, par3); - } - - return var50; ---- net/minecraft/src/CommandShowSeed.java -+++ net/minecraft/src/CommandShowSeed.java -@@ -3,24 +3,31 @@ - import net.minecraft.server.MinecraftServer; - - public class CommandShowSeed extends CommandBase { -- public boolean canCommandSenderUseCommand(ICommandSender var1) { -- return MinecraftServer.getServer().isSinglePlayer() || super.canCommandSenderUseCommand(var1); -+ -+ /** -+ * Returns true if the given command sender is allowed to use this command. -+ */ -+ public boolean canCommandSenderUseCommand(ICommandSender par1ICommandSender) { -+ return MinecraftServer.getServer().isSinglePlayer() || super.canCommandSenderUseCommand(par1ICommandSender); - } - - public String getCommandName() { - return "seed"; - } - -+ /** -+ * Return the required permission level for this command. -+ */ - public int getRequiredPermissionLevel() { - return 2; - } - -- public String getCommandUsage(ICommandSender var1) { -+ public String getCommandUsage(ICommandSender par1ICommandSender) { - return "commands.seed.usage"; - } - -- public void processCommand(ICommandSender var1, String[] var2) { -- Object var3 = var1 instanceof EntityPlayer ? ((EntityPlayer)var1).worldObj : MinecraftServer.getServer().worldServerForDimension(0); -- var1.sendChatToPlayer(ChatMessageComponent.createFromTranslationWithSubstitutions("commands.seed.success", new Object[]{Long.valueOf(((World)var3).getSeed())})); -+ public void processCommand(ICommandSender par1ICommandSender, String[] par2ArrayOfStr) { -+ Object var3 = par1ICommandSender instanceof EntityPlayer ? ((EntityPlayer)par1ICommandSender).worldObj : MinecraftServer.getServer().worldServerForDimension(0); -+ par1ICommandSender.sendChatToPlayer(ChatMessageComponent.createFromTranslationWithSubstitutions("commands.seed.success", new Object[] {Long.valueOf(((World)var3).getSeed())})); - } - } ---- net/minecraft/src/EntityAIPlay.java -+++ net/minecraft/src/EntityAIPlay.java -@@ -9,36 +9,42 @@ - private double field_75261_c; - private int playTime; - -- public EntityAIPlay(EntityVillager var1, double var2) { -- this.villagerObj = var1; -- this.field_75261_c = var2; -+ public EntityAIPlay(EntityVillager par1EntityVillager, double par2) { -+ this.villagerObj = par1EntityVillager; -+ this.field_75261_c = par2; - this.setMutexBits(1); - } - -+ /** -+ * Returns whether the EntityAIBase should begin execution. -+ */ - public boolean shouldExecute() { -- if(this.villagerObj.getGrowingAge() >= 0) { -+ if (this.villagerObj.getGrowingAge() >= 0) { - return false; -- } else if(this.villagerObj.getRNG().nextInt(400) != 0) { -+ } else if (this.villagerObj.getRNG().nextInt(400) != 0) { - return false; - } else { - List var1 = this.villagerObj.worldObj.getEntitiesWithinAABB(EntityVillager.class, this.villagerObj.boundingBox.expand(6.0D, 3.0D, 6.0D)); - double var2 = Double.MAX_VALUE; - Iterator var4 = var1.iterator(); - -- while(var4.hasNext()) { -+ while (var4.hasNext()) { - EntityVillager var5 = (EntityVillager)var4.next(); -- if(var5 != this.villagerObj && !var5.isPlaying() && var5.getGrowingAge() < 0) { -+ -+ if (var5 != this.villagerObj && !var5.isPlaying() && var5.getGrowingAge() < 0) { - double var6 = var5.getDistanceSqToEntity(this.villagerObj); -- if(var6 <= var2) { -+ -+ if (var6 <= var2) { - var2 = var6; - this.targetVillager = var5; - } - } - } - -- if(this.targetVillager == null) { -+ if (this.targetVillager == null) { - Vec3 var8 = RandomPositionGenerator.findRandomTarget(this.villagerObj, 16, 3); -- if(var8 == null) { -+ -+ if (var8 == null) { - return false; - } - } -@@ -47,37 +53,50 @@ - } - } - -+ /** -+ * Returns whether an in-progress EntityAIBase should continue executing -+ */ - public boolean continueExecuting() { - return this.playTime > 0; - } - -+ /** -+ * Execute a one shot task or start executing a continuous task -+ */ - public void startExecuting() { -- if(this.targetVillager != null) { -+ if (this.targetVillager != null) { - this.villagerObj.setPlaying(true); - } - - this.playTime = 1000; - } - -+ /** -+ * Resets the task -+ */ - public void resetTask() { - this.villagerObj.setPlaying(false); - this.targetVillager = null; - } - -+ /** -+ * Updates the task -+ */ - public void updateTask() { - --this.playTime; -- if(this.targetVillager != null) { -- if(this.villagerObj.getDistanceSqToEntity(this.targetVillager) > 4.0D) { -+ -+ if (this.targetVillager != null) { -+ if (this.villagerObj.getDistanceSqToEntity(this.targetVillager) > 4.0D) { - this.villagerObj.getNavigator().tryMoveToEntityLiving(this.targetVillager, this.field_75261_c); - } -- } else if(this.villagerObj.getNavigator().noPath()) { -+ } else if (this.villagerObj.getNavigator().noPath()) { - Vec3 var1 = RandomPositionGenerator.findRandomTarget(this.villagerObj, 16, 3); -- if(var1 == null) { -+ -+ if (var1 == null) { - return; - } - - this.villagerObj.getNavigator().tryMoveToXYZ(var1.xCoord, var1.yCoord, var1.zCoord, this.field_75261_c); - } -- - } - } ---- net/minecraft/src/TileEntityBrewingStand.java -+++ net/minecraft/src/TileEntityBrewingStand.java -@@ -3,52 +3,74 @@ - import java.util.List; - - public class TileEntityBrewingStand extends TileEntity implements ISidedInventory { -- private static final int[] field_102017_a = new int[]{3}; -- private static final int[] field_102016_b = new int[]{0, 1, 2}; -+ private static final int[] field_102017_a = new int[] {3}; -+ private static final int[] field_102016_b = new int[] {0, 1, 2}; -+ -+ /** The itemstacks currently placed in the slots of the brewing stand */ - private ItemStack[] brewingItemStacks = new ItemStack[4]; - private int brewTime; -+ -+ /** -+ * an integer with each bit specifying whether that slot of the stand contains a potion -+ */ - private int filledSlots; - private int ingredientID; -- private String g; -+ private String field_94132_e; - -+ /** -+ * Returns the name of the inventory. -+ */ - public String getInvName() { -- return this.isInvNameLocalized() ? this.g : "container.brewing"; -+ return this.isInvNameLocalized() ? this.field_94132_e : "container.brewing"; - } - -+ /** -+ * If this returns false, the inventory name will be used as an unlocalized name, and translated into the player's -+ * language. Otherwise it will be used directly. -+ */ - public boolean isInvNameLocalized() { -- return this.g != null && this.g.length() > 0; -- } -- -- public void func_94131_a(String var1) { -- this.g = var1; -- } -- -+ return this.field_94132_e != null && this.field_94132_e.length() > 0; -+ } -+ -+ public void func_94131_a(String par1Str) { -+ this.field_94132_e = par1Str; -+ } -+ -+ /** -+ * Returns the number of slots in the inventory. -+ */ - public int getSizeInventory() { - return this.brewingItemStacks.length; - } - -+ /** -+ * Allows the entity to update its state. Overridden in most subclasses, e.g. the mob spawner uses this to count ticks -+ * and creates a new spawn inside its implementation. -+ */ - public void updateEntity() { -- if(this.brewTime > 0) { -+ if (this.brewTime > 0) { - --this.brewTime; -- if(this.brewTime == 0) { -+ -+ if (this.brewTime == 0) { - this.brewPotions(); - this.onInventoryChanged(); -- } else if(!this.canBrew()) { -+ } else if (!this.canBrew()) { - this.brewTime = 0; - this.onInventoryChanged(); -- } else if(this.ingredientID != this.brewingItemStacks[3].itemID) { -+ } else if (this.ingredientID != this.brewingItemStacks[3].itemID) { - this.brewTime = 0; - this.onInventoryChanged(); - } -- } else if(this.canBrew()) { -+ } else if (this.canBrew()) { - this.brewTime = 400; - this.ingredientID = this.brewingItemStacks[3].itemID; - } - - int var1 = this.getFilledSlots(); -- if(var1 != this.filledSlots) { -+ -+ if (var1 != this.filledSlots) { - this.filledSlots = var1; -- this.worldObj.setBlockMetadata(this.xCoord, this.yCoord, this.zCoord, var1, 2); -+ this.worldObj.setBlockMetadataWithNotify(this.xCoord, this.yCoord, this.zCoord, var1, 2); - } - - super.updateEntity(); -@@ -59,25 +81,28 @@ - } - - private boolean canBrew() { -- if(this.brewingItemStacks[3] != null && this.brewingItemStacks[3].stackSize > 0) { -+ if (this.brewingItemStacks[3] != null && this.brewingItemStacks[3].stackSize > 0) { - ItemStack var1 = this.brewingItemStacks[3]; -- if(!Item.itemsList[var1.itemID].isPotionIngredient()) { -+ -+ if (!Item.itemsList[var1.itemID].isPotionIngredient()) { - return false; - } else { - boolean var2 = false; - -- for(int var3 = 0; var3 < 3; ++var3) { -- if(this.brewingItemStacks[var3] != null && this.brewingItemStacks[var3].itemID == Item.potion.itemID) { -+ for (int var3 = 0; var3 < 3; ++var3) { -+ if (this.brewingItemStacks[var3] != null && this.brewingItemStacks[var3].itemID == Item.potion.itemID) { - int var4 = this.brewingItemStacks[var3].getItemDamage(); - int var5 = this.getPotionResult(var4, var1); -- if(!ItemPotion.isSplash(var4) && ItemPotion.isSplash(var5)) { -+ -+ if (!ItemPotion.isSplash(var4) && ItemPotion.isSplash(var5)) { - var2 = true; - break; - } - - List var6 = Item.potion.getEffects(var4); - List var7 = Item.potion.getEffects(var5); -- if((var4 <= 0 || var6 != var7) && (var6 == null || !var6.equals(var7) && var7 != null) && var4 != var5) { -+ -+ if ((var4 <= 0 || var6 != var7) && (var6 == null || !var6.equals(var7) && var7 != null) && var4 != var5) { - var2 = true; - break; - } -@@ -92,68 +117,79 @@ - } - - private void brewPotions() { -- if(this.canBrew()) { -+ if (this.canBrew()) { - ItemStack var1 = this.brewingItemStacks[3]; - -- for(int var2 = 0; var2 < 3; ++var2) { -- if(this.brewingItemStacks[var2] != null && this.brewingItemStacks[var2].itemID == Item.potion.itemID) { -+ for (int var2 = 0; var2 < 3; ++var2) { -+ if (this.brewingItemStacks[var2] != null && this.brewingItemStacks[var2].itemID == Item.potion.itemID) { - int var3 = this.brewingItemStacks[var2].getItemDamage(); - int var4 = this.getPotionResult(var3, var1); - List var5 = Item.potion.getEffects(var3); - List var6 = Item.potion.getEffects(var4); -- if(var3 > 0 && var5 == var6 || var5 != null && (var5.equals(var6) || var6 == null)) { -- if(!ItemPotion.isSplash(var3) && ItemPotion.isSplash(var4)) { -+ -+ if ((var3 <= 0 || var5 != var6) && (var5 == null || !var5.equals(var6) && var6 != null)) { -+ if (var3 != var4) { - this.brewingItemStacks[var2].setItemDamage(var4); - } -- } else if(var3 != var4) { -+ } else if (!ItemPotion.isSplash(var3) && ItemPotion.isSplash(var4)) { - this.brewingItemStacks[var2].setItemDamage(var4); - } - } - } - -- if(Item.itemsList[var1.itemID].hasContainerItem()) { -+ if (Item.itemsList[var1.itemID].hasContainerItem()) { - this.brewingItemStacks[3] = new ItemStack(Item.itemsList[var1.itemID].getContainerItem()); - } else { - --this.brewingItemStacks[3].stackSize; -- if(this.brewingItemStacks[3].stackSize <= 0) { -+ -+ if (this.brewingItemStacks[3].stackSize <= 0) { - this.brewingItemStacks[3] = null; - } - } -- - } - } - -- private int getPotionResult(int var1, ItemStack var2) { -- return var2 == null ? var1 : (Item.itemsList[var2.itemID].isPotionIngredient() ? PotionHelper.applyIngredient(var1, Item.itemsList[var2.itemID].getPotionEffect()) : var1); -+ /** -+ * The result of brewing a potion of the specified damage value with an ingredient itemstack. -+ */ -+ private int getPotionResult(int par1, ItemStack par2ItemStack) { -+ return par2ItemStack == null ? par1 : (Item.itemsList[par2ItemStack.itemID].isPotionIngredient() ? PotionHelper.applyIngredient(par1, Item.itemsList[par2ItemStack.itemID].getPotionEffect()) : par1); - } - -- public void readFromNBT(NBTTagCompound var1) { -- super.readFromNBT(var1); -- NBTTagList var2 = var1.getTagList("Items"); -+ /** -+ * Reads a tile entity from NBT. -+ */ -+ public void readFromNBT(NBTTagCompound par1NBTTagCompound) { -+ super.readFromNBT(par1NBTTagCompound); -+ NBTTagList var2 = par1NBTTagCompound.getTagList("Items"); - this.brewingItemStacks = new ItemStack[this.getSizeInventory()]; - -- for(int var3 = 0; var3 < var2.tagCount(); ++var3) { -+ for (int var3 = 0; var3 < var2.tagCount(); ++var3) { - NBTTagCompound var4 = (NBTTagCompound)var2.tagAt(var3); - byte var5 = var4.getByte("Slot"); -- if(var5 >= 0 && var5 < this.brewingItemStacks.length) { -+ -+ if (var5 >= 0 && var5 < this.brewingItemStacks.length) { - this.brewingItemStacks[var5] = ItemStack.loadItemStackFromNBT(var4); - } - } - -- this.brewTime = var1.getShort("BrewTime"); -- if(var1.hasKey("CustomName")) { -- this.g = var1.getString("CustomName"); -+ this.brewTime = par1NBTTagCompound.getShort("BrewTime"); -+ -+ if (par1NBTTagCompound.hasKey("CustomName")) { -+ this.field_94132_e = par1NBTTagCompound.getString("CustomName"); - } -- - } - -- public void writeToNBT(NBTTagCompound var1) { -- super.writeToNBT(var1); -- var1.setShort("BrewTime", (short)this.brewTime); -+ /** -+ * Writes a tile entity to NBT. -+ */ -+ public void writeToNBT(NBTTagCompound par1NBTTagCompound) { -+ super.writeToNBT(par1NBTTagCompound); -+ par1NBTTagCompound.setShort("BrewTime", (short)this.brewTime); - NBTTagList var2 = new NBTTagList(); - -- for(int var3 = 0; var3 < this.brewingItemStacks.length; ++var3) { -- if(this.brewingItemStacks[var3] != null) { -+ for (int var3 = 0; var3 < this.brewingItemStacks.length; ++var3) { -+ if (this.brewingItemStacks[var3] != null) { - NBTTagCompound var4 = new NBTTagCompound(); - var4.setByte("Slot", (byte)var3); - this.brewingItemStacks[var3].writeToNBT(var4); -@@ -161,71 +197,95 @@ - } - } - -- var1.setTag("Items", var2); -- if(this.isInvNameLocalized()) { -- var1.setString("CustomName", this.g); -+ par1NBTTagCompound.setTag("Items", var2); -+ -+ if (this.isInvNameLocalized()) { -+ par1NBTTagCompound.setString("CustomName", this.field_94132_e); - } -- -- } -- -- public ItemStack getStackInSlot(int var1) { -- return var1 >= 0 && var1 < this.brewingItemStacks.length ? this.brewingItemStacks[var1] : null; -- } -- -- public ItemStack decrStackSize(int var1, int var2) { -- if(var1 >= 0 && var1 < this.brewingItemStacks.length) { -- ItemStack var3 = this.brewingItemStacks[var1]; -- this.brewingItemStacks[var1] = null; -+ } -+ -+ /** -+ * Returns the stack in slot i -+ */ -+ public ItemStack getStackInSlot(int par1) { -+ return par1 >= 0 && par1 < this.brewingItemStacks.length ? this.brewingItemStacks[par1] : null; -+ } -+ -+ /** -+ * Removes from an inventory slot (first arg) up to a specified number (second arg) of items and returns them in a new -+ * stack. -+ */ -+ public ItemStack decrStackSize(int par1, int par2) { -+ if (par1 >= 0 && par1 < this.brewingItemStacks.length) { -+ ItemStack var3 = this.brewingItemStacks[par1]; -+ this.brewingItemStacks[par1] = null; - return var3; - } else { - return null; - } - } - -- public ItemStack getStackInSlotOnClosing(int var1) { -- if(var1 >= 0 && var1 < this.brewingItemStacks.length) { -- ItemStack var2 = this.brewingItemStacks[var1]; -- this.brewingItemStacks[var1] = null; -+ /** -+ * When some containers are closed they call this on each slot, then drop whatever it returns as an EntityItem - like -+ * when you close a workbench GUI. -+ */ -+ public ItemStack getStackInSlotOnClosing(int par1) { -+ if (par1 >= 0 && par1 < this.brewingItemStacks.length) { -+ ItemStack var2 = this.brewingItemStacks[par1]; -+ this.brewingItemStacks[par1] = null; - return var2; - } else { - return null; - } - } - -- public void setInventorySlotContents(int var1, ItemStack var2) { -- if(var1 >= 0 && var1 < this.brewingItemStacks.length) { -- this.brewingItemStacks[var1] = var2; -+ /** -+ * Sets the given item stack to the specified slot in the inventory (can be crafting or armor sections). -+ */ -+ public void setInventorySlotContents(int par1, ItemStack par2ItemStack) { -+ if (par1 >= 0 && par1 < this.brewingItemStacks.length) { -+ this.brewingItemStacks[par1] = par2ItemStack; - } -- - } - -+ /** -+ * Returns the maximum stack size for a inventory slot. Seems to always be 64, possibly will be extended. *Isn't this -+ * more of a set than a get?* -+ */ - public int getInventoryStackLimit() { - return 64; - } - -- public boolean isUseableByPlayer(EntityPlayer var1) { -- return this.worldObj.getBlockTileEntity(this.xCoord, this.yCoord, this.zCoord) != this ? false : var1.getDistanceSq((double)this.xCoord + 0.5D, (double)this.yCoord + 0.5D, (double)this.zCoord + 0.5D) <= 64.0D; -- } -- -- public void openChest() { -- } -- -- public void closeChest() { -- } -- -- public boolean isItemValidForSlot(int var1, ItemStack var2) { -- return var1 == 3 ? Item.itemsList[var2.itemID].isPotionIngredient() : var2.itemID == Item.potion.itemID || var2.itemID == Item.glassBottle.itemID; -- } -- -- public void setBrewTime(int var1) { -- this.brewTime = var1; -- } -- -+ /** -+ * Do not make give this method the name canInteractWith because it clashes with Container -+ */ -+ public boolean isUseableByPlayer(EntityPlayer par1EntityPlayer) { -+ return this.worldObj.getBlockTileEntity(this.xCoord, this.yCoord, this.zCoord) != this ? false : par1EntityPlayer.getDistanceSq((double)this.xCoord + 0.5D, (double)this.yCoord + 0.5D, (double)this.zCoord + 0.5D) <= 64.0D; -+ } -+ -+ public void openChest() {} -+ -+ public void closeChest() {} -+ -+ /** -+ * Returns true if automation is allowed to insert the given stack (ignoring stack size) into the given slot. -+ */ -+ public boolean isItemValidForSlot(int par1, ItemStack par2ItemStack) { -+ return par1 == 3 ? Item.itemsList[par2ItemStack.itemID].isPotionIngredient() : par2ItemStack.itemID == Item.potion.itemID || par2ItemStack.itemID == Item.glassBottle.itemID; -+ } -+ -+ public void setBrewTime(int par1) { -+ this.brewTime = par1; -+ } -+ -+ /** -+ * returns an integer with each bit specifying wether that slot of the stand contains a potion -+ */ - public int getFilledSlots() { - int var1 = 0; - -- for(int var2 = 0; var2 < 3; ++var2) { -- if(this.brewingItemStacks[var2] != null) { -+ for (int var2 = 0; var2 < 3; ++var2) { -+ if (this.brewingItemStacks[var2] != null) { - var1 |= 1 << var2; - } - } -@@ -233,15 +293,25 @@ - return var1; - } - -- public int[] getSlotsForFace(int var1) { -- return var1 == 1 ? field_102017_a : field_102016_b; -- } -- -- public boolean canInsertItem(int var1, ItemStack var2, int var3) { -- return this.isItemValidForSlot(var1, var2); -- } -- -- public boolean canExtractItem(int var1, ItemStack var2, int var3) { -+ /** -+ * Returns an array containing the indices of the slots that can be accessed by automation on the given side of this -+ * block. -+ */ -+ public int[] getAccessibleSlotsFromSide(int par1) { -+ return par1 == 1 ? field_102017_a : field_102016_b; -+ } -+ -+ /** -+ * Returns true if automation can insert the given item in the given slot from the given side. Args: Slot, item, side -+ */ -+ public boolean canInsertItem(int par1, ItemStack par2ItemStack, int par3) { -+ return this.isItemValidForSlot(par1, par2ItemStack); -+ } -+ -+ /** -+ * Returns true if automation can extract the given item in the given slot from the given side. Args: Slot, item, side -+ */ -+ public boolean canExtractItem(int par1, ItemStack par2ItemStack, int par3) { - return true; - } - } ---- net/minecraft/src/ComponentVillageRoadPiece.java -+++ net/minecraft/src/ComponentVillageRoadPiece.java -@@ -1,10 +1,9 @@ - package net.minecraft.src; - - public abstract class ComponentVillageRoadPiece extends ComponentVillage { -- public ComponentVillageRoadPiece() { -- } -+ public ComponentVillageRoadPiece() {} - -- protected ComponentVillageRoadPiece(ComponentVillageStartPiece var1, int var2) { -- super(var1, var2); -+ protected ComponentVillageRoadPiece(ComponentVillageStartPiece par1ComponentVillageStartPiece, int par2) { -+ super(par1ComponentVillageStartPiece, par2); - } - } ---- net/minecraft/src/RConThreadBase.java -+++ net/minecraft/src/RConThreadBase.java -@@ -8,132 +8,186 @@ - import java.util.List; - - public abstract class RConThreadBase implements Runnable { -+ -+ /** True if the Thread is running, false otherwise */ - protected boolean running; -+ -+ /** Reference to the IServer object. */ - protected IServer server; -- protected Thread c; -+ -+ /** Thread for this runnable class */ -+ protected Thread rconThread; - protected int field_72615_d = 5; -- protected List e = new ArrayList(); -- protected List f = new ArrayList(); -- -- RConThreadBase(IServer var1) { -- this.server = var1; -- if(this.server.isDebuggingEnabled()) { -+ -+ /** A list of registered DatagramSockets */ -+ protected List socketList = new ArrayList(); -+ -+ /** A list of registered ServerSockets */ -+ protected List serverSocketList = new ArrayList(); -+ -+ RConThreadBase(IServer par1IServer) { -+ this.server = par1IServer; -+ -+ if (this.server.isDebuggingEnabled()) { - this.logWarning("Debugging is enabled, performance maybe reduced!"); - } -- - } - -+ /** -+ * Creates a new Thread object from this class and starts running -+ */ - public synchronized void startThread() { -- this.c = new Thread(this); -- this.c.start(); -+ this.rconThread = new Thread(this); -+ this.rconThread.start(); - this.running = true; - } - -+ /** -+ * Returns true if the Thread is running, false otherwise -+ */ - public boolean isRunning() { - return this.running; - } - -- protected void logDebug(String var1) { -- this.server.logDebug(var1); -- } -- -- protected void logInfo(String var1) { -- this.server.logInfo(var1); -- } -- -- protected void logWarning(String var1) { -- this.server.logWarning(var1); -- } -- -- protected void logSevere(String var1) { -- this.server.logSevere(var1); -- } -- -+ /** -+ * Log debug message -+ */ -+ protected void logDebug(String par1Str) { -+ this.server.logDebug(par1Str); -+ } -+ -+ /** -+ * Log information message -+ */ -+ protected void logInfo(String par1Str) { -+ this.server.logInfo(par1Str); -+ } -+ -+ /** -+ * Log warning message -+ */ -+ protected void logWarning(String par1Str) { -+ this.server.logWarning(par1Str); -+ } -+ -+ /** -+ * Log severe error message -+ */ -+ protected void logSevere(String par1Str) { -+ this.server.logSevere(par1Str); -+ } -+ -+ /** -+ * Returns the number of players on the server -+ */ - protected int getNumberOfPlayers() { - return this.server.getCurrentPlayerCount(); - } - -- protected void registerSocket(DatagramSocket var1) { -- this.logDebug("registerSocket: " + var1); -- this.e.add(var1); -+ /** -+ * Registers a DatagramSocket with this thread -+ */ -+ protected void registerSocket(DatagramSocket par1DatagramSocket) { -+ this.logDebug("registerSocket: " + par1DatagramSocket); -+ this.socketList.add(par1DatagramSocket); - } - -- protected boolean closeSocket(DatagramSocket var1, boolean var2) { -- this.logDebug("closeSocket: " + var1); -- if(null == var1) { -+ /** -+ * Closes the specified DatagramSocket -+ */ -+ protected boolean closeSocket(DatagramSocket par1DatagramSocket, boolean par2) { -+ this.logDebug("closeSocket: " + par1DatagramSocket); -+ -+ if (null == par1DatagramSocket) { - return false; - } else { - boolean var3 = false; -- if(!var1.isClosed()) { -- var1.close(); -+ -+ if (!par1DatagramSocket.isClosed()) { -+ par1DatagramSocket.close(); - var3 = true; - } - -- if(var2) { -- this.e.remove(var1); -+ if (par2) { -+ this.socketList.remove(par1DatagramSocket); - } - - return var3; - } - } - -- protected boolean closeServerSocket(ServerSocket var1) { -- return this.closeServerSocket_do(var1, true); -+ /** -+ * Closes the specified ServerSocket -+ */ -+ protected boolean closeServerSocket(ServerSocket par1ServerSocket) { -+ return this.closeServerSocket_do(par1ServerSocket, true); - } - -- protected boolean closeServerSocket_do(ServerSocket var1, boolean var2) { -- this.logDebug("closeSocket: " + var1); -- if(null == var1) { -+ /** -+ * Closes the specified ServerSocket -+ */ -+ protected boolean closeServerSocket_do(ServerSocket par1ServerSocket, boolean par2) { -+ this.logDebug("closeSocket: " + par1ServerSocket); -+ -+ if (null == par1ServerSocket) { - return false; - } else { - boolean var3 = false; - - try { -- if(!var1.isClosed()) { -- var1.close(); -+ if (!par1ServerSocket.isClosed()) { -+ par1ServerSocket.close(); - var3 = true; - } - } catch (IOException var5) { - this.logWarning("IO: " + var5.getMessage()); - } - -- if(var2) { -- this.f.remove(var1); -+ if (par2) { -+ this.serverSocketList.remove(par1ServerSocket); - } - - return var3; - } - } - -+ /** -+ * Closes all of the opened sockets -+ */ - protected void closeAllSockets() { - this.closeAllSockets_do(false); - } - -- protected void closeAllSockets_do(boolean var1) { -+ /** -+ * Closes all of the opened sockets -+ */ -+ protected void closeAllSockets_do(boolean par1) { - int var2 = 0; -- Iterator var3 = this.e.iterator(); -+ Iterator var3 = this.socketList.iterator(); - -- while(var3.hasNext()) { -+ while (var3.hasNext()) { - DatagramSocket var4 = (DatagramSocket)var3.next(); -- if(this.closeSocket(var4, false)) { -+ -+ if (this.closeSocket(var4, false)) { - ++var2; - } - } - -- this.e.clear(); -- var3 = this.f.iterator(); -+ this.socketList.clear(); -+ var3 = this.serverSocketList.iterator(); - -- while(var3.hasNext()) { -+ while (var3.hasNext()) { - ServerSocket var5 = (ServerSocket)var3.next(); -- if(this.closeServerSocket_do(var5, false)) { -+ -+ if (this.closeServerSocket_do(var5, false)) { - ++var2; - } - } - -- this.f.clear(); -- if(var1 && 0 < var2) { -+ this.serverSocketList.clear(); -+ -+ if (par1 && 0 < var2) { - this.logWarning("Force closed " + var2 + " sockets"); - } -- - } - } ---- net/minecraft/src/ComponentVillageHouse3.java -+++ net/minecraft/src/ComponentVillageHouse3.java -@@ -4,140 +4,146 @@ - import java.util.Random; - - public class ComponentVillageHouse3 extends ComponentVillage { -- public ComponentVillageHouse3() { -- } -- -- public ComponentVillageHouse3(ComponentVillageStartPiece var1, int var2, Random var3, StructureBoundingBox var4, int var5) { -- super(var1, var2); -- this.coordBaseMode = var5; -- this.boundingBox = var4; -- } -- -- public static ComponentVillageHouse3 func_74921_a(ComponentVillageStartPiece var0, List var1, Random var2, int var3, int var4, int var5, int var6, int var7) { -- StructureBoundingBox var8 = StructureBoundingBox.getComponentToAddBoundingBox(var3, var4, var5, 0, 0, 0, 9, 7, 12, var6); -- return canVillageGoDeeper(var8) && StructureComponent.findIntersecting(var1, var8) == null ? new ComponentVillageHouse3(var0, var7, var2, var8, var6) : null; -- } -- -- public boolean addComponentParts(World var1, Random var2, StructureBoundingBox var3) { -- if(this.field_143015_k < 0) { -- this.field_143015_k = this.getAverageGroundLevel(var1, var3); -- if(this.field_143015_k < 0) { -+ public ComponentVillageHouse3() {} -+ -+ public ComponentVillageHouse3(ComponentVillageStartPiece par1ComponentVillageStartPiece, int par2, Random par3Random, StructureBoundingBox par4StructureBoundingBox, int par5) { -+ super(par1ComponentVillageStartPiece, par2); -+ this.coordBaseMode = par5; -+ this.boundingBox = par4StructureBoundingBox; -+ } -+ -+ public static ComponentVillageHouse3 func_74921_a(ComponentVillageStartPiece par0ComponentVillageStartPiece, List par1List, Random par2Random, int par3, int par4, int par5, int par6, int par7) { -+ StructureBoundingBox var8 = StructureBoundingBox.getComponentToAddBoundingBox(par3, par4, par5, 0, 0, 0, 9, 7, 12, par6); -+ return canVillageGoDeeper(var8) && StructureComponent.findIntersecting(par1List, var8) == null ? new ComponentVillageHouse3(par0ComponentVillageStartPiece, par7, par2Random, var8, par6) : null; -+ } -+ -+ /** -+ * second Part of Structure generating, this for example places Spiderwebs, Mob Spawners, it closes Mineshafts at the -+ * end, it adds Fences... -+ */ -+ public boolean addComponentParts(World par1World, Random par2Random, StructureBoundingBox par3StructureBoundingBox) { -+ if (this.field_143015_k < 0) { -+ this.field_143015_k = this.getAverageGroundLevel(par1World, par3StructureBoundingBox); -+ -+ if (this.field_143015_k < 0) { - return true; - } - - this.boundingBox.offset(0, this.field_143015_k - this.boundingBox.maxY + 7 - 1, 0); - } - -- this.fillWithBlocks(var1, var3, 1, 1, 1, 7, 4, 4, 0, 0, false); -- this.fillWithBlocks(var1, var3, 2, 1, 6, 8, 4, 10, 0, 0, false); -- this.fillWithBlocks(var1, var3, 2, 0, 5, 8, 0, 10, Block.planks.blockID, Block.planks.blockID, false); -- this.fillWithBlocks(var1, var3, 1, 0, 1, 7, 0, 4, Block.planks.blockID, Block.planks.blockID, false); -- this.fillWithBlocks(var1, var3, 0, 0, 0, 0, 3, 5, Block.cobblestone.blockID, Block.cobblestone.blockID, false); -- this.fillWithBlocks(var1, var3, 8, 0, 0, 8, 3, 10, Block.cobblestone.blockID, Block.cobblestone.blockID, false); -- this.fillWithBlocks(var1, var3, 1, 0, 0, 7, 2, 0, Block.cobblestone.blockID, Block.cobblestone.blockID, false); -- this.fillWithBlocks(var1, var3, 1, 0, 5, 2, 1, 5, Block.cobblestone.blockID, Block.cobblestone.blockID, false); -- this.fillWithBlocks(var1, var3, 2, 0, 6, 2, 3, 10, Block.cobblestone.blockID, Block.cobblestone.blockID, false); -- this.fillWithBlocks(var1, var3, 3, 0, 10, 7, 3, 10, Block.cobblestone.blockID, Block.cobblestone.blockID, false); -- this.fillWithBlocks(var1, var3, 1, 2, 0, 7, 3, 0, Block.planks.blockID, Block.planks.blockID, false); -- this.fillWithBlocks(var1, var3, 1, 2, 5, 2, 3, 5, Block.planks.blockID, Block.planks.blockID, false); -- this.fillWithBlocks(var1, var3, 0, 4, 1, 8, 4, 1, Block.planks.blockID, Block.planks.blockID, false); -- this.fillWithBlocks(var1, var3, 0, 4, 4, 3, 4, 4, Block.planks.blockID, Block.planks.blockID, false); -- this.fillWithBlocks(var1, var3, 0, 5, 2, 8, 5, 3, Block.planks.blockID, Block.planks.blockID, false); -- this.placeBlockAtCurrentPosition(var1, Block.planks.blockID, 0, 0, 4, 2, var3); -- this.placeBlockAtCurrentPosition(var1, Block.planks.blockID, 0, 0, 4, 3, var3); -- this.placeBlockAtCurrentPosition(var1, Block.planks.blockID, 0, 8, 4, 2, var3); -- this.placeBlockAtCurrentPosition(var1, Block.planks.blockID, 0, 8, 4, 3, var3); -- this.placeBlockAtCurrentPosition(var1, Block.planks.blockID, 0, 8, 4, 4, var3); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 1, 1, 1, 7, 4, 4, 0, 0, false); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 2, 1, 6, 8, 4, 10, 0, 0, false); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 2, 0, 5, 8, 0, 10, Block.planks.blockID, Block.planks.blockID, false); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 1, 0, 1, 7, 0, 4, Block.planks.blockID, Block.planks.blockID, false); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 0, 0, 0, 0, 3, 5, Block.cobblestone.blockID, Block.cobblestone.blockID, false); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 8, 0, 0, 8, 3, 10, Block.cobblestone.blockID, Block.cobblestone.blockID, false); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 1, 0, 0, 7, 2, 0, Block.cobblestone.blockID, Block.cobblestone.blockID, false); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 1, 0, 5, 2, 1, 5, Block.cobblestone.blockID, Block.cobblestone.blockID, false); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 2, 0, 6, 2, 3, 10, Block.cobblestone.blockID, Block.cobblestone.blockID, false); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 3, 0, 10, 7, 3, 10, Block.cobblestone.blockID, Block.cobblestone.blockID, false); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 1, 2, 0, 7, 3, 0, Block.planks.blockID, Block.planks.blockID, false); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 1, 2, 5, 2, 3, 5, Block.planks.blockID, Block.planks.blockID, false); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 0, 4, 1, 8, 4, 1, Block.planks.blockID, Block.planks.blockID, false); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 0, 4, 4, 3, 4, 4, Block.planks.blockID, Block.planks.blockID, false); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 0, 5, 2, 8, 5, 3, Block.planks.blockID, Block.planks.blockID, false); -+ this.placeBlockAtCurrentPosition(par1World, Block.planks.blockID, 0, 0, 4, 2, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.planks.blockID, 0, 0, 4, 3, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.planks.blockID, 0, 8, 4, 2, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.planks.blockID, 0, 8, 4, 3, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.planks.blockID, 0, 8, 4, 4, par3StructureBoundingBox); - int var4 = this.getMetadataWithOffset(Block.stairsWoodOak.blockID, 3); - int var5 = this.getMetadataWithOffset(Block.stairsWoodOak.blockID, 2); -- - int var6; - int var7; -- for(var6 = -1; var6 <= 2; ++var6) { -- for(var7 = 0; var7 <= 8; ++var7) { -- this.placeBlockAtCurrentPosition(var1, Block.stairsWoodOak.blockID, var4, var7, 4 + var6, var6, var3); -- if((var6 > -1 || var7 <= 1) && (var6 > 0 || var7 <= 3) && (var6 > 1 || var7 <= 4 || var7 >= 6)) { -- this.placeBlockAtCurrentPosition(var1, Block.stairsWoodOak.blockID, var5, var7, 4 + var6, 5 - var6, var3); -+ -+ for (var6 = -1; var6 <= 2; ++var6) { -+ for (var7 = 0; var7 <= 8; ++var7) { -+ this.placeBlockAtCurrentPosition(par1World, Block.stairsWoodOak.blockID, var4, var7, 4 + var6, var6, par3StructureBoundingBox); -+ -+ if ((var6 > -1 || var7 <= 1) && (var6 > 0 || var7 <= 3) && (var6 > 1 || var7 <= 4 || var7 >= 6)) { -+ this.placeBlockAtCurrentPosition(par1World, Block.stairsWoodOak.blockID, var5, var7, 4 + var6, 5 - var6, par3StructureBoundingBox); - } - } - } - -- this.fillWithBlocks(var1, var3, 3, 4, 5, 3, 4, 10, Block.planks.blockID, Block.planks.blockID, false); -- this.fillWithBlocks(var1, var3, 7, 4, 2, 7, 4, 10, Block.planks.blockID, Block.planks.blockID, false); -- this.fillWithBlocks(var1, var3, 4, 5, 4, 4, 5, 10, Block.planks.blockID, Block.planks.blockID, false); -- this.fillWithBlocks(var1, var3, 6, 5, 4, 6, 5, 10, Block.planks.blockID, Block.planks.blockID, false); -- this.fillWithBlocks(var1, var3, 5, 6, 3, 5, 6, 10, Block.planks.blockID, Block.planks.blockID, false); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 3, 4, 5, 3, 4, 10, Block.planks.blockID, Block.planks.blockID, false); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 7, 4, 2, 7, 4, 10, Block.planks.blockID, Block.planks.blockID, false); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 4, 5, 4, 4, 5, 10, Block.planks.blockID, Block.planks.blockID, false); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 6, 5, 4, 6, 5, 10, Block.planks.blockID, Block.planks.blockID, false); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 5, 6, 3, 5, 6, 10, Block.planks.blockID, Block.planks.blockID, false); - var6 = this.getMetadataWithOffset(Block.stairsWoodOak.blockID, 0); -- - int var8; -- for(var7 = 4; var7 >= 1; --var7) { -- this.placeBlockAtCurrentPosition(var1, Block.planks.blockID, 0, var7, 2 + var7, 7 - var7, var3); -- -- for(var8 = 8 - var7; var8 <= 10; ++var8) { -- this.placeBlockAtCurrentPosition(var1, Block.stairsWoodOak.blockID, var6, var7, 2 + var7, var8, var3); -+ -+ for (var7 = 4; var7 >= 1; --var7) { -+ this.placeBlockAtCurrentPosition(par1World, Block.planks.blockID, 0, var7, 2 + var7, 7 - var7, par3StructureBoundingBox); -+ -+ for (var8 = 8 - var7; var8 <= 10; ++var8) { -+ this.placeBlockAtCurrentPosition(par1World, Block.stairsWoodOak.blockID, var6, var7, 2 + var7, var8, par3StructureBoundingBox); - } - } - - var7 = this.getMetadataWithOffset(Block.stairsWoodOak.blockID, 1); -- this.placeBlockAtCurrentPosition(var1, Block.planks.blockID, 0, 6, 6, 3, var3); -- this.placeBlockAtCurrentPosition(var1, Block.planks.blockID, 0, 7, 5, 4, var3); -- this.placeBlockAtCurrentPosition(var1, Block.stairsWoodOak.blockID, var7, 6, 6, 4, var3); -- -+ this.placeBlockAtCurrentPosition(par1World, Block.planks.blockID, 0, 6, 6, 3, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.planks.blockID, 0, 7, 5, 4, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.stairsWoodOak.blockID, var7, 6, 6, 4, par3StructureBoundingBox); - int var9; -- for(var8 = 6; var8 <= 8; ++var8) { -- for(var9 = 5; var9 <= 10; ++var9) { -- this.placeBlockAtCurrentPosition(var1, Block.stairsWoodOak.blockID, var7, var8, 12 - var8, var9, var3); -- } -- } -- -- this.placeBlockAtCurrentPosition(var1, Block.wood.blockID, 0, 0, 2, 1, var3); -- this.placeBlockAtCurrentPosition(var1, Block.wood.blockID, 0, 0, 2, 4, var3); -- this.placeBlockAtCurrentPosition(var1, Block.thinGlass.blockID, 0, 0, 2, 2, var3); -- this.placeBlockAtCurrentPosition(var1, Block.thinGlass.blockID, 0, 0, 2, 3, var3); -- this.placeBlockAtCurrentPosition(var1, Block.wood.blockID, 0, 4, 2, 0, var3); -- this.placeBlockAtCurrentPosition(var1, Block.thinGlass.blockID, 0, 5, 2, 0, var3); -- this.placeBlockAtCurrentPosition(var1, Block.wood.blockID, 0, 6, 2, 0, var3); -- this.placeBlockAtCurrentPosition(var1, Block.wood.blockID, 0, 8, 2, 1, var3); -- this.placeBlockAtCurrentPosition(var1, Block.thinGlass.blockID, 0, 8, 2, 2, var3); -- this.placeBlockAtCurrentPosition(var1, Block.thinGlass.blockID, 0, 8, 2, 3, var3); -- this.placeBlockAtCurrentPosition(var1, Block.wood.blockID, 0, 8, 2, 4, var3); -- this.placeBlockAtCurrentPosition(var1, Block.planks.blockID, 0, 8, 2, 5, var3); -- this.placeBlockAtCurrentPosition(var1, Block.wood.blockID, 0, 8, 2, 6, var3); -- this.placeBlockAtCurrentPosition(var1, Block.thinGlass.blockID, 0, 8, 2, 7, var3); -- this.placeBlockAtCurrentPosition(var1, Block.thinGlass.blockID, 0, 8, 2, 8, var3); -- this.placeBlockAtCurrentPosition(var1, Block.wood.blockID, 0, 8, 2, 9, var3); -- this.placeBlockAtCurrentPosition(var1, Block.wood.blockID, 0, 2, 2, 6, var3); -- this.placeBlockAtCurrentPosition(var1, Block.thinGlass.blockID, 0, 2, 2, 7, var3); -- this.placeBlockAtCurrentPosition(var1, Block.thinGlass.blockID, 0, 2, 2, 8, var3); -- this.placeBlockAtCurrentPosition(var1, Block.wood.blockID, 0, 2, 2, 9, var3); -- this.placeBlockAtCurrentPosition(var1, Block.wood.blockID, 0, 4, 4, 10, var3); -- this.placeBlockAtCurrentPosition(var1, Block.thinGlass.blockID, 0, 5, 4, 10, var3); -- this.placeBlockAtCurrentPosition(var1, Block.wood.blockID, 0, 6, 4, 10, var3); -- this.placeBlockAtCurrentPosition(var1, Block.planks.blockID, 0, 5, 5, 10, var3); -- this.placeBlockAtCurrentPosition(var1, 0, 0, 2, 1, 0, var3); -- this.placeBlockAtCurrentPosition(var1, 0, 0, 2, 2, 0, var3); -- this.placeBlockAtCurrentPosition(var1, Block.torchWood.blockID, 0, 2, 3, 1, var3); -- this.placeDoorAtCurrentPosition(var1, var3, var2, 2, 1, 0, this.getMetadataWithOffset(Block.doorWood.blockID, 1)); -- this.fillWithBlocks(var1, var3, 1, 0, -1, 3, 2, -1, 0, 0, false); -- if(this.getBlockIdAtCurrentPosition(var1, 2, 0, -1, var3) == 0 && this.getBlockIdAtCurrentPosition(var1, 2, -1, -1, var3) != 0) { -- this.placeBlockAtCurrentPosition(var1, Block.stairsCobblestone.blockID, this.getMetadataWithOffset(Block.stairsCobblestone.blockID, 3), 2, 0, -1, var3); -- } -- -- for(var8 = 0; var8 < 5; ++var8) { -- for(var9 = 0; var9 < 9; ++var9) { -- this.clearCurrentPositionBlocksUpwards(var1, var9, 7, var8, var3); -- this.fillCurrentPositionBlocksDownwards(var1, Block.cobblestone.blockID, 0, var9, -1, var8, var3); -- } -- } -- -- for(var8 = 5; var8 < 11; ++var8) { -- for(var9 = 2; var9 < 9; ++var9) { -- this.clearCurrentPositionBlocksUpwards(var1, var9, 7, var8, var3); -- this.fillCurrentPositionBlocksDownwards(var1, Block.cobblestone.blockID, 0, var9, -1, var8, var3); -- } -- } -- -- this.spawnVillagers(var1, var3, 4, 1, 2, 2); -+ -+ for (var8 = 6; var8 <= 8; ++var8) { -+ for (var9 = 5; var9 <= 10; ++var9) { -+ this.placeBlockAtCurrentPosition(par1World, Block.stairsWoodOak.blockID, var7, var8, 12 - var8, var9, par3StructureBoundingBox); -+ } -+ } -+ -+ this.placeBlockAtCurrentPosition(par1World, Block.wood.blockID, 0, 0, 2, 1, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.wood.blockID, 0, 0, 2, 4, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.thinGlass.blockID, 0, 0, 2, 2, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.thinGlass.blockID, 0, 0, 2, 3, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.wood.blockID, 0, 4, 2, 0, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.thinGlass.blockID, 0, 5, 2, 0, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.wood.blockID, 0, 6, 2, 0, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.wood.blockID, 0, 8, 2, 1, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.thinGlass.blockID, 0, 8, 2, 2, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.thinGlass.blockID, 0, 8, 2, 3, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.wood.blockID, 0, 8, 2, 4, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.planks.blockID, 0, 8, 2, 5, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.wood.blockID, 0, 8, 2, 6, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.thinGlass.blockID, 0, 8, 2, 7, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.thinGlass.blockID, 0, 8, 2, 8, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.wood.blockID, 0, 8, 2, 9, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.wood.blockID, 0, 2, 2, 6, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.thinGlass.blockID, 0, 2, 2, 7, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.thinGlass.blockID, 0, 2, 2, 8, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.wood.blockID, 0, 2, 2, 9, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.wood.blockID, 0, 4, 4, 10, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.thinGlass.blockID, 0, 5, 4, 10, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.wood.blockID, 0, 6, 4, 10, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.planks.blockID, 0, 5, 5, 10, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, 0, 0, 2, 1, 0, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, 0, 0, 2, 2, 0, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.torchWood.blockID, 0, 2, 3, 1, par3StructureBoundingBox); -+ this.placeDoorAtCurrentPosition(par1World, par3StructureBoundingBox, par2Random, 2, 1, 0, this.getMetadataWithOffset(Block.doorWood.blockID, 1)); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 1, 0, -1, 3, 2, -1, 0, 0, false); -+ -+ if (this.getBlockIdAtCurrentPosition(par1World, 2, 0, -1, par3StructureBoundingBox) == 0 && this.getBlockIdAtCurrentPosition(par1World, 2, -1, -1, par3StructureBoundingBox) != 0) { -+ this.placeBlockAtCurrentPosition(par1World, Block.stairsCobblestone.blockID, this.getMetadataWithOffset(Block.stairsCobblestone.blockID, 3), 2, 0, -1, par3StructureBoundingBox); -+ } -+ -+ for (var8 = 0; var8 < 5; ++var8) { -+ for (var9 = 0; var9 < 9; ++var9) { -+ this.clearCurrentPositionBlocksUpwards(par1World, var9, 7, var8, par3StructureBoundingBox); -+ this.fillCurrentPositionBlocksDownwards(par1World, Block.cobblestone.blockID, 0, var9, -1, var8, par3StructureBoundingBox); -+ } -+ } -+ -+ for (var8 = 5; var8 < 11; ++var8) { -+ for (var9 = 2; var9 < 9; ++var9) { -+ this.clearCurrentPositionBlocksUpwards(par1World, var9, 7, var8, par3StructureBoundingBox); -+ this.fillCurrentPositionBlocksDownwards(par1World, Block.cobblestone.blockID, 0, var9, -1, var8, par3StructureBoundingBox); -+ } -+ } -+ -+ this.spawnVillagers(par1World, par3StructureBoundingBox, 4, 1, 2, 2); - return true; - } - } ---- /dev/null -+++ org/spoutcraft/api/gui/BasicLabel.java -@@ -1,0 +1,45 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.api.gui; -+ -+public interface BasicLabel extends Label { -+ /** -+ * Recalculates the word wrapping result. -+ */ -+ public void recalculateLines(); -+ -+ /** -+ * @return the lines of the text. If wordwrapping is enabled, this will already be wrapped to width. -+ */ -+ public String [] getLines(); -+ -+ /** -+ * Enables word wrapping. Right now, this will wrap for spaces when a line is too big to be displayed in the width. -+ * If a single word is longer than the width, it will be cut off by char. -+ * @param wrapLines wether to enable the feature. -+ * @return instance of the label -+ */ -+ public Label setWrapLines(boolean wrapLines); -+ -+ /** -+ * @return if this label has word wrapping enabled. -+ */ -+ public boolean isWrapLines(); -+} ---- net/minecraft/src/PendingInvitesList.java -+++ net/minecraft/src/PendingInvitesList.java -@@ -9,22 +9,24 @@ - import java.util.List; - - public class PendingInvitesList extends ValueObject { -- public List a = Lists.newArrayList(); -+ public List field_130096_a = Lists.newArrayList(); - -- public static PendingInvitesList func_130095_a(String var0) { -+ public static PendingInvitesList func_130095_a(String par0Str) { - PendingInvitesList var1 = new PendingInvitesList(); - - try { -- JsonRootNode var2 = (new JdomParser()).parse(var0); -- if(var2.isArrayNode(new Object[]{"invites"})) { -- Iterator var3 = var2.getArrayNode(new Object[]{"invites"}).iterator(); -- -- while(var3.hasNext()) { -+ JsonRootNode var2 = (new JdomParser()).parse(par0Str); -+ -+ if (var2.isArrayNode(new Object[] {"invites"})) { -+ Iterator var3 = var2.getArrayNode(new Object[] {"invites"}).iterator(); -+ -+ while (var3.hasNext()) { - JsonNode var4 = (JsonNode)var3.next(); -- var1.a.add(PendingInvite.func_130091_a(var4)); -+ var1.field_130096_a.add(PendingInvite.func_130091_a(var4)); - } - } - } catch (InvalidSyntaxException var5) { -+ ; - } - - return var1; ---- net/minecraft/src/NetworkListenThread.java -+++ net/minecraft/src/NetworkListenThread.java -@@ -1,56 +1,66 @@ - package net.minecraft.src; - -+import java.io.IOException; - import java.util.ArrayList; - import java.util.Collections; - import java.util.List; - import net.minecraft.server.MinecraftServer; - - public abstract class NetworkListenThread { -- private final MinecraftServer b; -- private final List c = Collections.synchronizedList(new ArrayList()); -+ -+ /** Reference to the MinecraftServer object. */ -+ private final MinecraftServer mcServer; -+ private final List connections = Collections.synchronizedList(new ArrayList()); -+ -+ /** Whether the network listener object is listening. */ - public volatile boolean isListening; - -- public NetworkListenThread(MinecraftServer var1) { -- this.b = var1; -+ public NetworkListenThread(MinecraftServer par1MinecraftServer) throws IOException { -+ this.mcServer = par1MinecraftServer; - this.isListening = true; - } - -- public void addPlayer(NetServerHandler var1) { -- this.c.add(var1); -+ /** -+ * adds this connection to the list of currently connected players -+ */ -+ public void addPlayer(NetServerHandler par1NetServerHandler) { -+ this.connections.add(par1NetServerHandler); - } - - public void stopListening() { - this.isListening = false; - } - -- public void handleNetworkListenThread() { -- for(int var1 = 0; var1 < this.c.size(); ++var1) { -- NetServerHandler var2 = (NetServerHandler)this.c.get(var1); -+ /** -+ * processes packets and pending connections -+ */ -+ public void networkTick() { -+ for (int var1 = 0; var1 < this.connections.size(); ++var1) { -+ NetServerHandler var2 = (NetServerHandler)this.connections.get(var1); - - try { -- var2.handlePackets(); -+ var2.networkTick(); - } catch (Exception var6) { -- if(var2.netManager instanceof MemoryConnection) { -+ if (var2.netManager instanceof MemoryConnection) { - CrashReport var4 = CrashReport.makeCrashReport(var6, "Ticking memory connection"); - CrashReportCategory var5 = var4.makeCategory("Ticking connection"); - var5.addCrashSectionCallable("Connection", new CallableConnectionName(this, var2)); - throw new ReportedException(var4); - } - -- this.b.getLogAgent().logWarningException("Failed to handle packet for " + var2.playerEntity.getEntityName() + "/" + var2.playerEntity.getPlayerIP() + ": " + var6, var6); -- var2.kickPlayer("Internal server error"); -+ this.mcServer.getLogAgent().logWarningException("Failed to handle packet for " + var2.playerEntity.getEntityName() + "/" + var2.playerEntity.getPlayerIP() + ": " + var6, var6); -+ var2.kickPlayerFromServer("Internal server error"); - } - -- if(var2.connectionClosed) { -- this.c.remove(var1--); -+ if (var2.connectionClosed) { -+ this.connections.remove(var1--); - } - - var2.netManager.wakeThreads(); - } -- - } - - public MinecraftServer getServer() { -- return this.b; -+ return this.mcServer; - } - } ---- /dev/null -+++ org/spoutcraft/client/gui/settings/controls/FancyLightingButton.java -@@ -1,0 +1,47 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.client.gui.settings.controls; -+ -+import java.util.UUID; -+ -+import net.minecraft.src.Minecraft; -+ -+import org.spoutcraft.client.config.Configuration; -+ -+public class FancyLightingButton extends AutomatedCheckBox { -+ UUID fancyGraphics; -+ public FancyLightingButton(UUID fancyGraphics) { -+ super("Fancy Light"); -+ this.fancyGraphics = fancyGraphics; -+ setChecked(Configuration.isFancyLight()); -+ setTooltip("Fancy Light\nFast - lower quality, faster\nFancy - higher quality, slower\nFancy Light applies more advanced occluded lighting over blocks.\nWorks best with smooth lighting."); -+ } -+ -+ @Override -+ public void onButtonClick() { -+ Configuration.setFancyLight(!Configuration.isFancyLight()); -+ Configuration.write(); -+ ((FancyGraphicsButton)getScreen().getWidget(fancyGraphics)).custom = true; -+ -+ if (Minecraft.getMinecraft().theWorld != null) { -+ Minecraft.getMinecraft().renderGlobal.updateAllRenderers(); -+ } -+ } -+} ---- net/minecraft/src/NBTTagInt.java -+++ net/minecraft/src/NBTTagInt.java -@@ -5,25 +5,36 @@ - import java.io.IOException; - - public class NBTTagInt extends NBTBase { -+ -+ /** The integer value for the tag. */ - public int data; - -- public NBTTagInt(String var1) { -- super(var1); -- } -- -- public NBTTagInt(String var1, int var2) { -- super(var1); -- this.data = var2; -- } -- -- void write(DataOutput var1) throws IOException { -- var1.writeInt(this.data); -- } -- -- void load(DataInput var1, int var2) throws IOException { -- this.data = var1.readInt(); -- } -- -+ public NBTTagInt(String par1Str) { -+ super(par1Str); -+ } -+ -+ public NBTTagInt(String par1Str, int par2) { -+ super(par1Str); -+ this.data = par2; -+ } -+ -+ /** -+ * Write the actual data contents of the tag, implemented in NBT extension classes -+ */ -+ void write(DataOutput par1DataOutput) throws IOException { -+ par1DataOutput.writeInt(this.data); -+ } -+ -+ /** -+ * Read the actual data contents of the tag, implemented in NBT extension classes -+ */ -+ void load(DataInput par1DataInput, int par2) throws IOException { -+ this.data = par1DataInput.readInt(); -+ } -+ -+ /** -+ * Gets the type byte for the tag. -+ */ - public byte getId() { - return (byte)3; - } -@@ -32,13 +43,16 @@ - return "" + this.data; - } - -+ /** -+ * Creates a clone of the tag. -+ */ - public NBTBase copy() { - return new NBTTagInt(this.getName(), this.data); - } - -- public boolean equals(Object var1) { -- if(super.equals(var1)) { -- NBTTagInt var2 = (NBTTagInt)var1; -+ public boolean equals(Object par1Obj) { -+ if (super.equals(par1Obj)) { -+ NBTTagInt var2 = (NBTTagInt)par1Obj; - return this.data == var2.data; - } else { - return false; ---- net/minecraft/src/ItemSword.java -+++ net/minecraft/src/ItemSword.java -@@ -6,77 +6,112 @@ - private float weaponDamage; - private final EnumToolMaterial toolMaterial; - -- public ItemSword(int var1, EnumToolMaterial var2) { -- super(var1); -- this.toolMaterial = var2; -+ public ItemSword(int par1, EnumToolMaterial par2EnumToolMaterial) { -+ super(par1); -+ this.toolMaterial = par2EnumToolMaterial; - this.maxStackSize = 1; -- this.setMaxDamage(var2.getMaxUses()); -+ this.setMaxDamage(par2EnumToolMaterial.getMaxUses()); - this.setCreativeTab(CreativeTabs.tabCombat); -- this.weaponDamage = 4.0F + var2.getDamageVsEntity(); -+ this.weaponDamage = 4.0F + par2EnumToolMaterial.getDamageVsEntity(); - } - - public float func_82803_g() { - return this.toolMaterial.getDamageVsEntity(); - } - -- public float getStrVsBlock(ItemStack var1, Block var2) { -- if(var2.blockID == Block.web.blockID) { -+ /** -+ * Returns the strength of the stack against a given block. 1.0F base, (Quality+1)*2 if correct blocktype, 1.5F if -+ * sword -+ */ -+ public float getStrVsBlock(ItemStack par1ItemStack, Block par2Block) { -+ if (par2Block.blockID == Block.web.blockID) { - return 15.0F; - } else { -- Material var3 = var2.blockMaterial; -+ Material var3 = par2Block.blockMaterial; - return var3 != Material.plants && var3 != Material.vine && var3 != Material.coral && var3 != Material.leaves && var3 != Material.pumpkin ? 1.0F : 1.5F; - } - } - -- public boolean hitEntity(ItemStack var1, EntityLivingBase var2, EntityLivingBase var3) { -- var1.damageItem(1, var3); -+ /** -+ * Current implementations of this method in child classes do not use the entry argument beside ev. They just raise the -+ * damage on the stack. -+ */ -+ public boolean hitEntity(ItemStack par1ItemStack, EntityLivingBase par2EntityLivingBase, EntityLivingBase par3EntityLivingBase) { -+ par1ItemStack.damageItem(1, par3EntityLivingBase); - return true; - } - -- public boolean onBlockDestroyed(ItemStack var1, World var2, int var3, int var4, int var5, int var6, EntityLivingBase var7) { -- if((double)Block.blocksList[var3].getBlockHardness(var2, var4, var5, var6) != 0.0D) { -- var1.damageItem(2, var7); -+ public boolean onBlockDestroyed(ItemStack par1ItemStack, World par2World, int par3, int par4, int par5, int par6, EntityLivingBase par7EntityLivingBase) { -+ if ((double)Block.blocksList[par3].getBlockHardness(par2World, par4, par5, par6) != 0.0D) { -+ par1ItemStack.damageItem(2, par7EntityLivingBase); - } - - return true; - } - -+ /** -+ * Returns True is the item is renderer in full 3D when hold. -+ */ - public boolean isFull3D() { - return true; - } - -- public EnumAction getItemUseAction(ItemStack var1) { -+ /** -+ * returns the action that specifies what animation to play when the items is being used -+ */ -+ public EnumAction getItemUseAction(ItemStack par1ItemStack) { - return EnumAction.block; - } - -- public int getMaxItemUseDuration(ItemStack var1) { -+ /** -+ * How long it takes to use or consume an item -+ */ -+ public int getMaxItemUseDuration(ItemStack par1ItemStack) { - return 72000; - } - -- public ItemStack onItemRightClick(ItemStack var1, World var2, EntityPlayer var3) { -- var3.setItemInUse(var1, this.getMaxItemUseDuration(var1)); -- return var1; -- } -- -- public boolean canHarvestBlock(Block var1) { -- return var1.blockID == Block.web.blockID; -- } -- -+ /** -+ * Called whenever this item is equipped and the right mouse button is pressed. Args: itemStack, world, entityPlayer -+ */ -+ public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) { -+ par3EntityPlayer.setItemInUse(par1ItemStack, this.getMaxItemUseDuration(par1ItemStack)); -+ return par1ItemStack; -+ } -+ -+ /** -+ * Returns if the item (tool) can harvest results from the block type. -+ */ -+ public boolean canHarvestBlock(Block par1Block) { -+ return par1Block.blockID == Block.web.blockID; -+ } -+ -+ /** -+ * Return the enchantability factor of the item, most of the time is based on material. -+ */ - public int getItemEnchantability() { - return this.toolMaterial.getEnchantability(); - } - -+ /** -+ * Return the name for this tool's material. -+ */ - public String getToolMaterialName() { - return this.toolMaterial.toString(); - } - -- public boolean getIsRepairable(ItemStack var1, ItemStack var2) { -- return this.toolMaterial.getToolCraftingMaterial() == var2.itemID ? true : super.getIsRepairable(var1, var2); -+ /** -+ * Return whether this item is repairable in an anvil. -+ */ -+ public boolean getIsRepairable(ItemStack par1ItemStack, ItemStack par2ItemStack) { -+ return this.toolMaterial.getToolCraftingMaterial() == par2ItemStack.itemID ? true : super.getIsRepairable(par1ItemStack, par2ItemStack); - } - -+ /** -+ * Gets a map of item attribute modifiers, used by ItemSword to increase hit damage. -+ */ - public Multimap getItemAttributeModifiers() { - Multimap var1 = super.getItemAttributeModifiers(); -- var1.put(SharedMonsterAttributes.attackDamage.getAttributeUnlocalizedName(), new AttributeModifier(e, "Weapon modifier", (double)this.weaponDamage, 0)); -+ var1.put(SharedMonsterAttributes.attackDamage.getAttributeUnlocalizedName(), new AttributeModifier(field_111210_e, "Weapon modifier", (double)this.weaponDamage, 0)); - return var1; - } - } ---- net/minecraft/src/EntityAIPanic.java -+++ net/minecraft/src/EntityAIPanic.java -@@ -7,18 +7,22 @@ - private double randPosY; - private double randPosZ; - -- public EntityAIPanic(EntityCreature var1, double var2) { -- this.theEntityCreature = var1; -- this.speed = var2; -+ public EntityAIPanic(EntityCreature par1EntityCreature, double par2) { -+ this.theEntityCreature = par1EntityCreature; -+ this.speed = par2; - this.setMutexBits(1); - } - -+ /** -+ * Returns whether the EntityAIBase should begin execution. -+ */ - public boolean shouldExecute() { -- if(this.theEntityCreature.getAITarget() == null && !this.theEntityCreature.isBurning()) { -+ if (this.theEntityCreature.getAITarget() == null && !this.theEntityCreature.isBurning()) { - return false; - } else { - Vec3 var1 = RandomPositionGenerator.findRandomTarget(this.theEntityCreature, 5, 4); -- if(var1 == null) { -+ -+ if (var1 == null) { - return false; - } else { - this.randPosX = var1.xCoord; -@@ -29,10 +33,16 @@ - } - } - -+ /** -+ * Execute a one shot task or start executing a continuous task -+ */ - public void startExecuting() { - this.theEntityCreature.getNavigator().tryMoveToXYZ(this.randPosX, this.randPosY, this.randPosZ, this.speed); - } - -+ /** -+ * Returns whether an in-progress EntityAIBase should continue executing -+ */ - public boolean continueExecuting() { - return !this.theEntityCreature.getNavigator().noPath(); - } ---- net/minecraft/src/ComponentMineshaftCross.java -+++ net/minecraft/src/ComponentMineshaftCross.java -@@ -7,126 +7,140 @@ - private int corridorDirection; - private boolean isMultipleFloors; - -- public ComponentMineshaftCross() { -- } -- -- protected void func_143012_a(NBTTagCompound var1) { -- var1.setBoolean("tf", this.isMultipleFloors); -- var1.setInteger("D", this.corridorDirection); -- } -- -- protected void func_143011_b(NBTTagCompound var1) { -- this.isMultipleFloors = var1.getBoolean("tf"); -- this.corridorDirection = var1.getInteger("D"); -- } -- -- public ComponentMineshaftCross(int var1, Random var2, StructureBoundingBox var3, int var4) { -- super(var1); -- this.corridorDirection = var4; -- this.boundingBox = var3; -- this.isMultipleFloors = var3.getYSize() > 3; -- } -- -- public static StructureBoundingBox findValidPlacement(List var0, Random var1, int var2, int var3, int var4, int var5) { -- StructureBoundingBox var6 = new StructureBoundingBox(var2, var3, var4, var2, var3 + 2, var4); -- if(var1.nextInt(4) == 0) { -+ public ComponentMineshaftCross() {} -+ -+ protected void func_143012_a(NBTTagCompound par1NBTTagCompound) { -+ par1NBTTagCompound.setBoolean("tf", this.isMultipleFloors); -+ par1NBTTagCompound.setInteger("D", this.corridorDirection); -+ } -+ -+ protected void func_143011_b(NBTTagCompound par1NBTTagCompound) { -+ this.isMultipleFloors = par1NBTTagCompound.getBoolean("tf"); -+ this.corridorDirection = par1NBTTagCompound.getInteger("D"); -+ } -+ -+ public ComponentMineshaftCross(int par1, Random par2Random, StructureBoundingBox par3StructureBoundingBox, int par4) { -+ super(par1); -+ this.corridorDirection = par4; -+ this.boundingBox = par3StructureBoundingBox; -+ this.isMultipleFloors = par3StructureBoundingBox.getYSize() > 3; -+ } -+ -+ public static StructureBoundingBox findValidPlacement(List par0List, Random par1Random, int par2, int par3, int par4, int par5) { -+ StructureBoundingBox var6 = new StructureBoundingBox(par2, par3, par4, par2, par3 + 2, par4); -+ -+ if (par1Random.nextInt(4) == 0) { - var6.maxY += 4; - } - -- switch(var5) { -- case 0: -- var6.minX = var2 - 1; -- var6.maxX = var2 + 3; -- var6.maxZ = var4 + 4; -- break; -- case 1: -- var6.minX = var2 - 4; -- var6.minZ = var4 - 1; -- var6.maxZ = var4 + 3; -- break; -- case 2: -- var6.minX = var2 - 1; -- var6.maxX = var2 + 3; -- var6.minZ = var4 - 4; -- break; -- case 3: -- var6.maxX = var2 + 4; -- var6.minZ = var4 - 1; -- var6.maxZ = var4 + 3; -+ switch (par5) { -+ case 0: -+ var6.minX = par2 - 1; -+ var6.maxX = par2 + 3; -+ var6.maxZ = par4 + 4; -+ break; -+ -+ case 1: -+ var6.minX = par2 - 4; -+ var6.minZ = par4 - 1; -+ var6.maxZ = par4 + 3; -+ break; -+ -+ case 2: -+ var6.minX = par2 - 1; -+ var6.maxX = par2 + 3; -+ var6.minZ = par4 - 4; -+ break; -+ -+ case 3: -+ var6.maxX = par2 + 4; -+ var6.minZ = par4 - 1; -+ var6.maxZ = par4 + 3; - } - -- return StructureComponent.findIntersecting(var0, var6) != null ? null : var6; -+ return StructureComponent.findIntersecting(par0List, var6) != null ? null : var6; - } - -- public void buildComponent(StructureComponent var1, List var2, Random var3) { -+ /** -+ * Initiates construction of the Structure Component picked, at the current Location of StructGen -+ */ -+ public void buildComponent(StructureComponent par1StructureComponent, List par2List, Random par3Random) { - int var4 = this.getComponentType(); -- switch(this.corridorDirection) { -- case 0: -- StructureMineshaftPieces.getNextComponent(var1, var2, var3, this.boundingBox.minX + 1, this.boundingBox.minY, this.boundingBox.maxZ + 1, 0, var4); -- StructureMineshaftPieces.getNextComponent(var1, var2, var3, this.boundingBox.minX - 1, this.boundingBox.minY, this.boundingBox.minZ + 1, 1, var4); -- StructureMineshaftPieces.getNextComponent(var1, var2, var3, this.boundingBox.maxX + 1, this.boundingBox.minY, this.boundingBox.minZ + 1, 3, var4); -- break; -- case 1: -- StructureMineshaftPieces.getNextComponent(var1, var2, var3, this.boundingBox.minX + 1, this.boundingBox.minY, this.boundingBox.minZ - 1, 2, var4); -- StructureMineshaftPieces.getNextComponent(var1, var2, var3, this.boundingBox.minX + 1, this.boundingBox.minY, this.boundingBox.maxZ + 1, 0, var4); -- StructureMineshaftPieces.getNextComponent(var1, var2, var3, this.boundingBox.minX - 1, this.boundingBox.minY, this.boundingBox.minZ + 1, 1, var4); -- break; -- case 2: -- StructureMineshaftPieces.getNextComponent(var1, var2, var3, this.boundingBox.minX + 1, this.boundingBox.minY, this.boundingBox.minZ - 1, 2, var4); -- StructureMineshaftPieces.getNextComponent(var1, var2, var3, this.boundingBox.minX - 1, this.boundingBox.minY, this.boundingBox.minZ + 1, 1, var4); -- StructureMineshaftPieces.getNextComponent(var1, var2, var3, this.boundingBox.maxX + 1, this.boundingBox.minY, this.boundingBox.minZ + 1, 3, var4); -- break; -- case 3: -- StructureMineshaftPieces.getNextComponent(var1, var2, var3, this.boundingBox.minX + 1, this.boundingBox.minY, this.boundingBox.minZ - 1, 2, var4); -- StructureMineshaftPieces.getNextComponent(var1, var2, var3, this.boundingBox.minX + 1, this.boundingBox.minY, this.boundingBox.maxZ + 1, 0, var4); -- StructureMineshaftPieces.getNextComponent(var1, var2, var3, this.boundingBox.maxX + 1, this.boundingBox.minY, this.boundingBox.minZ + 1, 3, var4); -- } -- -- if(this.isMultipleFloors) { -- if(var3.nextBoolean()) { -- StructureMineshaftPieces.getNextComponent(var1, var2, var3, this.boundingBox.minX + 1, this.boundingBox.minY + 3 + 1, this.boundingBox.minZ - 1, 2, var4); -- } -- -- if(var3.nextBoolean()) { -- StructureMineshaftPieces.getNextComponent(var1, var2, var3, this.boundingBox.minX - 1, this.boundingBox.minY + 3 + 1, this.boundingBox.minZ + 1, 1, var4); -- } -- -- if(var3.nextBoolean()) { -- StructureMineshaftPieces.getNextComponent(var1, var2, var3, this.boundingBox.maxX + 1, this.boundingBox.minY + 3 + 1, this.boundingBox.minZ + 1, 3, var4); -- } -- -- if(var3.nextBoolean()) { -- StructureMineshaftPieces.getNextComponent(var1, var2, var3, this.boundingBox.minX + 1, this.boundingBox.minY + 3 + 1, this.boundingBox.maxZ + 1, 0, var4); -- } -- } -- -+ -+ switch (this.corridorDirection) { -+ case 0: -+ StructureMineshaftPieces.getNextComponent(par1StructureComponent, par2List, par3Random, this.boundingBox.minX + 1, this.boundingBox.minY, this.boundingBox.maxZ + 1, 0, var4); -+ StructureMineshaftPieces.getNextComponent(par1StructureComponent, par2List, par3Random, this.boundingBox.minX - 1, this.boundingBox.minY, this.boundingBox.minZ + 1, 1, var4); -+ StructureMineshaftPieces.getNextComponent(par1StructureComponent, par2List, par3Random, this.boundingBox.maxX + 1, this.boundingBox.minY, this.boundingBox.minZ + 1, 3, var4); -+ break; -+ -+ case 1: -+ StructureMineshaftPieces.getNextComponent(par1StructureComponent, par2List, par3Random, this.boundingBox.minX + 1, this.boundingBox.minY, this.boundingBox.minZ - 1, 2, var4); -+ StructureMineshaftPieces.getNextComponent(par1StructureComponent, par2List, par3Random, this.boundingBox.minX + 1, this.boundingBox.minY, this.boundingBox.maxZ + 1, 0, var4); -+ StructureMineshaftPieces.getNextComponent(par1StructureComponent, par2List, par3Random, this.boundingBox.minX - 1, this.boundingBox.minY, this.boundingBox.minZ + 1, 1, var4); -+ break; -+ -+ case 2: -+ StructureMineshaftPieces.getNextComponent(par1StructureComponent, par2List, par3Random, this.boundingBox.minX + 1, this.boundingBox.minY, this.boundingBox.minZ - 1, 2, var4); -+ StructureMineshaftPieces.getNextComponent(par1StructureComponent, par2List, par3Random, this.boundingBox.minX - 1, this.boundingBox.minY, this.boundingBox.minZ + 1, 1, var4); -+ StructureMineshaftPieces.getNextComponent(par1StructureComponent, par2List, par3Random, this.boundingBox.maxX + 1, this.boundingBox.minY, this.boundingBox.minZ + 1, 3, var4); -+ break; -+ -+ case 3: -+ StructureMineshaftPieces.getNextComponent(par1StructureComponent, par2List, par3Random, this.boundingBox.minX + 1, this.boundingBox.minY, this.boundingBox.minZ - 1, 2, var4); -+ StructureMineshaftPieces.getNextComponent(par1StructureComponent, par2List, par3Random, this.boundingBox.minX + 1, this.boundingBox.minY, this.boundingBox.maxZ + 1, 0, var4); -+ StructureMineshaftPieces.getNextComponent(par1StructureComponent, par2List, par3Random, this.boundingBox.maxX + 1, this.boundingBox.minY, this.boundingBox.minZ + 1, 3, var4); -+ } -+ -+ if (this.isMultipleFloors) { -+ if (par3Random.nextBoolean()) { -+ StructureMineshaftPieces.getNextComponent(par1StructureComponent, par2List, par3Random, this.boundingBox.minX + 1, this.boundingBox.minY + 3 + 1, this.boundingBox.minZ - 1, 2, var4); -+ } -+ -+ if (par3Random.nextBoolean()) { -+ StructureMineshaftPieces.getNextComponent(par1StructureComponent, par2List, par3Random, this.boundingBox.minX - 1, this.boundingBox.minY + 3 + 1, this.boundingBox.minZ + 1, 1, var4); -+ } -+ -+ if (par3Random.nextBoolean()) { -+ StructureMineshaftPieces.getNextComponent(par1StructureComponent, par2List, par3Random, this.boundingBox.maxX + 1, this.boundingBox.minY + 3 + 1, this.boundingBox.minZ + 1, 3, var4); -+ } -+ -+ if (par3Random.nextBoolean()) { -+ StructureMineshaftPieces.getNextComponent(par1StructureComponent, par2List, par3Random, this.boundingBox.minX + 1, this.boundingBox.minY + 3 + 1, this.boundingBox.maxZ + 1, 0, var4); -+ } -+ } - } - -- public boolean addComponentParts(World var1, Random var2, StructureBoundingBox var3) { -- if(this.isLiquidInStructureBoundingBox(var1, var3)) { -+ /** -+ * second Part of Structure generating, this for example places Spiderwebs, Mob Spawners, it closes Mineshafts at the -+ * end, it adds Fences... -+ */ -+ public boolean addComponentParts(World par1World, Random par2Random, StructureBoundingBox par3StructureBoundingBox) { -+ if (this.isLiquidInStructureBoundingBox(par1World, par3StructureBoundingBox)) { - return false; - } else { -- if(this.isMultipleFloors) { -- this.fillWithBlocks(var1, var3, this.boundingBox.minX + 1, this.boundingBox.minY, this.boundingBox.minZ, this.boundingBox.maxX - 1, this.boundingBox.minY + 3 - 1, this.boundingBox.maxZ, 0, 0, false); -- this.fillWithBlocks(var1, var3, this.boundingBox.minX, this.boundingBox.minY, this.boundingBox.minZ + 1, this.boundingBox.maxX, this.boundingBox.minY + 3 - 1, this.boundingBox.maxZ - 1, 0, 0, false); -- this.fillWithBlocks(var1, var3, this.boundingBox.minX + 1, this.boundingBox.maxY - 2, this.boundingBox.minZ, this.boundingBox.maxX - 1, this.boundingBox.maxY, this.boundingBox.maxZ, 0, 0, false); -- this.fillWithBlocks(var1, var3, this.boundingBox.minX, this.boundingBox.maxY - 2, this.boundingBox.minZ + 1, this.boundingBox.maxX, this.boundingBox.maxY, this.boundingBox.maxZ - 1, 0, 0, false); -- this.fillWithBlocks(var1, var3, this.boundingBox.minX + 1, this.boundingBox.minY + 3, this.boundingBox.minZ + 1, this.boundingBox.maxX - 1, this.boundingBox.minY + 3, this.boundingBox.maxZ - 1, 0, 0, false); -+ if (this.isMultipleFloors) { -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, this.boundingBox.minX + 1, this.boundingBox.minY, this.boundingBox.minZ, this.boundingBox.maxX - 1, this.boundingBox.minY + 3 - 1, this.boundingBox.maxZ, 0, 0, false); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, this.boundingBox.minX, this.boundingBox.minY, this.boundingBox.minZ + 1, this.boundingBox.maxX, this.boundingBox.minY + 3 - 1, this.boundingBox.maxZ - 1, 0, 0, false); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, this.boundingBox.minX + 1, this.boundingBox.maxY - 2, this.boundingBox.minZ, this.boundingBox.maxX - 1, this.boundingBox.maxY, this.boundingBox.maxZ, 0, 0, false); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, this.boundingBox.minX, this.boundingBox.maxY - 2, this.boundingBox.minZ + 1, this.boundingBox.maxX, this.boundingBox.maxY, this.boundingBox.maxZ - 1, 0, 0, false); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, this.boundingBox.minX + 1, this.boundingBox.minY + 3, this.boundingBox.minZ + 1, this.boundingBox.maxX - 1, this.boundingBox.minY + 3, this.boundingBox.maxZ - 1, 0, 0, false); - } else { -- this.fillWithBlocks(var1, var3, this.boundingBox.minX + 1, this.boundingBox.minY, this.boundingBox.minZ, this.boundingBox.maxX - 1, this.boundingBox.maxY, this.boundingBox.maxZ, 0, 0, false); -- this.fillWithBlocks(var1, var3, this.boundingBox.minX, this.boundingBox.minY, this.boundingBox.minZ + 1, this.boundingBox.maxX, this.boundingBox.maxY, this.boundingBox.maxZ - 1, 0, 0, false); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, this.boundingBox.minX + 1, this.boundingBox.minY, this.boundingBox.minZ, this.boundingBox.maxX - 1, this.boundingBox.maxY, this.boundingBox.maxZ, 0, 0, false); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, this.boundingBox.minX, this.boundingBox.minY, this.boundingBox.minZ + 1, this.boundingBox.maxX, this.boundingBox.maxY, this.boundingBox.maxZ - 1, 0, 0, false); - } - -- this.fillWithBlocks(var1, var3, this.boundingBox.minX + 1, this.boundingBox.minY, this.boundingBox.minZ + 1, this.boundingBox.minX + 1, this.boundingBox.maxY, this.boundingBox.minZ + 1, Block.planks.blockID, 0, false); -- this.fillWithBlocks(var1, var3, this.boundingBox.minX + 1, this.boundingBox.minY, this.boundingBox.maxZ - 1, this.boundingBox.minX + 1, this.boundingBox.maxY, this.boundingBox.maxZ - 1, Block.planks.blockID, 0, false); -- this.fillWithBlocks(var1, var3, this.boundingBox.maxX - 1, this.boundingBox.minY, this.boundingBox.minZ + 1, this.boundingBox.maxX - 1, this.boundingBox.maxY, this.boundingBox.minZ + 1, Block.planks.blockID, 0, false); -- this.fillWithBlocks(var1, var3, this.boundingBox.maxX - 1, this.boundingBox.minY, this.boundingBox.maxZ - 1, this.boundingBox.maxX - 1, this.boundingBox.maxY, this.boundingBox.maxZ - 1, Block.planks.blockID, 0, false); -- -- for(int var4 = this.boundingBox.minX; var4 <= this.boundingBox.maxX; ++var4) { -- for(int var5 = this.boundingBox.minZ; var5 <= this.boundingBox.maxZ; ++var5) { -- int var6 = this.getBlockIdAtCurrentPosition(var1, var4, this.boundingBox.minY - 1, var5, var3); -- if(var6 == 0) { -- this.placeBlockAtCurrentPosition(var1, Block.planks.blockID, 0, var4, this.boundingBox.minY - 1, var5, var3); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, this.boundingBox.minX + 1, this.boundingBox.minY, this.boundingBox.minZ + 1, this.boundingBox.minX + 1, this.boundingBox.maxY, this.boundingBox.minZ + 1, Block.planks.blockID, 0, false); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, this.boundingBox.minX + 1, this.boundingBox.minY, this.boundingBox.maxZ - 1, this.boundingBox.minX + 1, this.boundingBox.maxY, this.boundingBox.maxZ - 1, Block.planks.blockID, 0, false); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, this.boundingBox.maxX - 1, this.boundingBox.minY, this.boundingBox.minZ + 1, this.boundingBox.maxX - 1, this.boundingBox.maxY, this.boundingBox.minZ + 1, Block.planks.blockID, 0, false); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, this.boundingBox.maxX - 1, this.boundingBox.minY, this.boundingBox.maxZ - 1, this.boundingBox.maxX - 1, this.boundingBox.maxY, this.boundingBox.maxZ - 1, Block.planks.blockID, 0, false); -+ -+ for (int var4 = this.boundingBox.minX; var4 <= this.boundingBox.maxX; ++var4) { -+ for (int var5 = this.boundingBox.minZ; var5 <= this.boundingBox.maxZ; ++var5) { -+ int var6 = this.getBlockIdAtCurrentPosition(par1World, var4, this.boundingBox.minY - 1, var5, par3StructureBoundingBox); -+ -+ if (var6 == 0) { -+ this.placeBlockAtCurrentPosition(par1World, Block.planks.blockID, 0, var4, this.boundingBox.minY - 1, var5, par3StructureBoundingBox); - } - } - } ---- net/minecraft/src/EntitySelectorAlive.java -+++ net/minecraft/src/EntitySelectorAlive.java -@@ -1,7 +1,11 @@ - package net.minecraft.src; - - final class EntitySelectorAlive implements IEntitySelector { -- public boolean isEntityApplicable(Entity var1) { -- return var1.isEntityAlive(); -+ -+ /** -+ * Return whether the specified entity is applicable to this filter. -+ */ -+ public boolean isEntityApplicable(Entity par1Entity) { -+ return par1Entity.isEntityAlive(); - } - } ---- /dev/null -+++ org/spoutcraft/client/packet/PacketControlAction.java -@@ -1,0 +1,85 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.client.packet; -+ -+import java.io.IOException; -+import java.util.UUID; -+ -+import org.spoutcraft.api.gui.Screen; -+import org.spoutcraft.api.gui.Widget; -+import org.spoutcraft.api.io.SpoutInputStream; -+import org.spoutcraft.api.io.SpoutOutputStream; -+ -+public class PacketControlAction implements SpoutPacket { -+ protected UUID screen; -+ protected UUID widget; -+ protected float state; -+ protected String data = ""; -+ public PacketControlAction() { -+ } -+ -+ public PacketControlAction(Screen screen, Widget widget, float state) { -+ this.screen = screen.getId(); -+ this.widget = widget.getId(); -+ this.state = state; -+ } -+ -+ public PacketControlAction(Screen screen, Widget widget, String data, float position) { -+ this.screen = screen.getId(); -+ this.widget = widget.getId(); -+ this.state = position; -+ this.data = data; -+ } -+ -+ public void readData(SpoutInputStream input) throws IOException { -+ long msb = input.readLong(); -+ long lsb = input.readLong(); -+ this.screen = new UUID(msb, lsb); -+ msb = input.readLong(); -+ lsb = input.readLong(); -+ this.widget = new UUID(msb, lsb); -+ this.state = input.readFloat(); -+ this.data = input.readString(); -+ } -+ -+ public void writeData(SpoutOutputStream output) throws IOException { -+ output.writeLong(screen.getMostSignificantBits()); -+ output.writeLong(screen.getLeastSignificantBits()); -+ output.writeLong(widget.getMostSignificantBits()); -+ output.writeLong(widget.getLeastSignificantBits()); -+ output.writeFloat(state); -+ output.writeString(data); -+ } -+ -+ public void run(int playerId) { -+ // Nothing to do -+ } -+ -+ public PacketType getPacketType() { -+ return PacketType.PacketControlAction; -+ } -+ -+ public int getVersion() { -+ return 0; -+ } -+ -+ public void failure(int playerId) { -+ } -+} ---- net/minecraft/src/MapGenStronghold.java -+++ net/minecraft/src/MapGenStronghold.java -@@ -9,57 +9,71 @@ - import java.util.Map.Entry; - - public class MapGenStronghold extends MapGenStructure { -- private BiomeGenBase[] allowedBiomeGenBases = new BiomeGenBase[]{BiomeGenBase.desert, BiomeGenBase.forest, BiomeGenBase.extremeHills, BiomeGenBase.swampland, BiomeGenBase.taiga, BiomeGenBase.icePlains, BiomeGenBase.iceMountains, BiomeGenBase.desertHills, BiomeGenBase.forestHills, BiomeGenBase.extremeHillsEdge, BiomeGenBase.jungle, BiomeGenBase.jungleHills}; -+ private BiomeGenBase[] allowedBiomeGenBases; -+ -+ /** -+ * is spawned false and set true once the defined BiomeGenBases were compared with the present ones -+ */ - private boolean ranBiomeCheck; -- private ChunkCoordIntPair[] structureCoords = new ChunkCoordIntPair[3]; -- private double field_82671_h = 32.0D; -- private int field_82672_i = 3; -+ private ChunkCoordIntPair[] structureCoords; -+ private double field_82671_h; -+ private int field_82672_i; - - public MapGenStronghold() { -+ this.allowedBiomeGenBases = new BiomeGenBase[] {BiomeGenBase.desert, BiomeGenBase.forest, BiomeGenBase.extremeHills, BiomeGenBase.swampland, BiomeGenBase.taiga, BiomeGenBase.icePlains, BiomeGenBase.iceMountains, BiomeGenBase.desertHills, BiomeGenBase.forestHills, BiomeGenBase.extremeHillsEdge, BiomeGenBase.jungle, BiomeGenBase.jungleHills}; -+ this.structureCoords = new ChunkCoordIntPair[3]; -+ this.field_82671_h = 32.0D; -+ this.field_82672_i = 3; - } - -- public MapGenStronghold(Map var1) { -- Iterator var2 = var1.entrySet().iterator(); -+ public MapGenStronghold(Map par1Map) { -+ this.allowedBiomeGenBases = new BiomeGenBase[] {BiomeGenBase.desert, BiomeGenBase.forest, BiomeGenBase.extremeHills, BiomeGenBase.swampland, BiomeGenBase.taiga, BiomeGenBase.icePlains, BiomeGenBase.iceMountains, BiomeGenBase.desertHills, BiomeGenBase.forestHills, BiomeGenBase.extremeHillsEdge, BiomeGenBase.jungle, BiomeGenBase.jungleHills}; -+ this.structureCoords = new ChunkCoordIntPair[3]; -+ this.field_82671_h = 32.0D; -+ this.field_82672_i = 3; -+ Iterator var2 = par1Map.entrySet().iterator(); - -- while(var2.hasNext()) { -+ while (var2.hasNext()) { - Entry var3 = (Entry)var2.next(); -- if(((String)var3.getKey()).equals("distance")) { -+ -+ if (((String)var3.getKey()).equals("distance")) { - this.field_82671_h = MathHelper.func_82713_a((String)var3.getValue(), this.field_82671_h, 1.0D); -- } else if(((String)var3.getKey()).equals("count")) { -+ } else if (((String)var3.getKey()).equals("count")) { - this.structureCoords = new ChunkCoordIntPair[MathHelper.parseIntWithDefaultAndMax((String)var3.getValue(), this.structureCoords.length, 1)]; -- } else if(((String)var3.getKey()).equals("spread")) { -+ } else if (((String)var3.getKey()).equals("spread")) { - this.field_82672_i = MathHelper.parseIntWithDefaultAndMax((String)var3.getValue(), this.field_82672_i, 1); - } - } -- - } - - public String func_143025_a() { - return "Stronghold"; - } - -- protected boolean canSpawnStructureAtCoords(int var1, int var2) { -- if(!this.ranBiomeCheck) { -+ protected boolean canSpawnStructureAtCoords(int par1, int par2) { -+ if (!this.ranBiomeCheck) { - Random var3 = new Random(); - var3.setSeed(this.worldObj.getSeed()); - double var4 = var3.nextDouble() * Math.PI * 2.0D; - int var6 = 1; - -- for(int var7 = 0; var7 < this.structureCoords.length; ++var7) { -+ for (int var7 = 0; var7 < this.structureCoords.length; ++var7) { - double var8 = (1.25D * (double)var6 + var3.nextDouble()) * this.field_82671_h * (double)var6; - int var10 = (int)Math.round(Math.cos(var4) * var8); - int var11 = (int)Math.round(Math.sin(var4) * var8); - ArrayList var12 = new ArrayList(); - Collections.addAll(var12, this.allowedBiomeGenBases); - ChunkPosition var13 = this.worldObj.getWorldChunkManager().findBiomePosition((var10 << 4) + 8, (var11 << 4) + 8, 112, var12, var3); -- if(var13 != null) { -+ -+ if (var13 != null) { - var10 = var13.x >> 4; - var11 = var13.z >> 4; - } - - this.structureCoords[var7] = new ChunkCoordIntPair(var10, var11); -- var4 += Math.PI * 2.0D * (double)var6 / (double)this.field_82672_i; -- if(var7 == this.field_82672_i) { -+ var4 += (Math.PI * 2D) * (double)var6 / (double)this.field_82672_i; -+ -+ if (var7 == this.field_82672_i) { - var6 += 2 + var3.nextInt(5); - this.field_82672_i += 1 + var3.nextInt(2); - } -@@ -71,9 +85,10 @@ - ChunkCoordIntPair[] var14 = this.structureCoords; - int var15 = var14.length; - -- for(int var5 = 0; var5 < var15; ++var5) { -+ for (int var5 = 0; var5 < var15; ++var5) { - ChunkCoordIntPair var16 = var14[var5]; -- if(var1 == var16.chunkXPos && var2 == var16.chunkZPos) { -+ -+ if (par1 == var16.chunkXPos && par2 == var16.chunkZPos) { - return true; - } - } -@@ -81,14 +96,19 @@ - return false; - } - -+ /** -+ * Returns a list of other locations at which the structure generation has been run, or null if not relevant to this -+ * structure generator. -+ */ - protected List getCoordList() { - ArrayList var1 = new ArrayList(); - ChunkCoordIntPair[] var2 = this.structureCoords; - int var3 = var2.length; - -- for(int var4 = 0; var4 < var3; ++var4) { -+ for (int var4 = 0; var4 < var3; ++var4) { - ChunkCoordIntPair var5 = var2[var4]; -- if(var5 != null) { -+ -+ if (var5 != null) { - var1.add(var5.getChunkPosition(64)); - } - } -@@ -96,9 +116,11 @@ - return var1; - } - -- protected StructureStart getStructureStart(int var1, int var2) { -+ protected StructureStart getStructureStart(int par1, int par2) { - StructureStrongholdStart var3; -- for(var3 = new StructureStrongholdStart(this.worldObj, this.b, var1, var2); var3.getComponents().isEmpty() || ((ComponentStrongholdStairs2)var3.getComponents().get(0)).strongholdPortalRoom == null; var3 = new StructureStrongholdStart(this.worldObj, this.b, var1, var2)) { -+ -+ for (var3 = new StructureStrongholdStart(this.worldObj, this.rand, par1, par2); var3.getComponents().isEmpty() || ((ComponentStrongholdStairs2)var3.getComponents().get(0)).strongholdPortalRoom == null; var3 = new StructureStrongholdStart(this.worldObj, this.rand, par1, par2)) { -+ ; - } - - return var3; ---- net/minecraft/src/GuiSlotOnlineServerList.java -+++ net/minecraft/src/GuiSlotOnlineServerList.java -@@ -5,40 +5,50 @@ - class GuiSlotOnlineServerList extends GuiScreenSelectLocation { - final GuiScreenOnlineServers field_96294_a; - -- public GuiSlotOnlineServerList(GuiScreenOnlineServers var1) { -- super(GuiScreenOnlineServers.func_140037_f(var1), var1.width, var1.height, 32, var1.height - 64, 36); -- this.field_96294_a = var1; -+ public GuiSlotOnlineServerList(GuiScreenOnlineServers par1GuiScreenOnlineServers) { -+ super(GuiScreenOnlineServers.func_140037_f(par1GuiScreenOnlineServers), par1GuiScreenOnlineServers.width, par1GuiScreenOnlineServers.height, 32, par1GuiScreenOnlineServers.height - 64, 36); -+ this.field_96294_a = par1GuiScreenOnlineServers; - } - -+ /** -+ * Gets the size of the current slot list. -+ */ - protected int getSize() { - return GuiScreenOnlineServers.func_140013_c(this.field_96294_a).size() + 1; - } - -- protected void elementClicked(int var1, boolean var2) { -- if(var1 < GuiScreenOnlineServers.func_140013_c(this.field_96294_a).size()) { -- McoServer var3 = (McoServer)GuiScreenOnlineServers.func_140013_c(this.field_96294_a).get(var1); -+ /** -+ * the element in the slot that was clicked, boolean for wether it was double clicked or not -+ */ -+ protected void elementClicked(int par1, boolean par2) { -+ if (par1 < GuiScreenOnlineServers.func_140013_c(this.field_96294_a).size()) { -+ McoServer var3 = (McoServer)GuiScreenOnlineServers.func_140013_c(this.field_96294_a).get(par1); - GuiScreenOnlineServers.func_140036_b(this.field_96294_a, var3.field_96408_a); -- if(!GuiScreenOnlineServers.func_140015_g(this.field_96294_a).getSession().getUsername().equals(var3.e)) { -- GuiScreenOnlineServers.func_140038_h(this.field_96294_a).f = I18n.getString("mco.selectServer.leave"); -+ -+ if (!GuiScreenOnlineServers.func_140015_g(this.field_96294_a).getSession().getUsername().equals(var3.field_96405_e)) { -+ GuiScreenOnlineServers.func_140038_h(this.field_96294_a).displayString = I18n.getString("mco.selectServer.leave"); - } else { -- GuiScreenOnlineServers.func_140038_h(this.field_96294_a).f = I18n.getString("mco.selectServer.configure"); -+ GuiScreenOnlineServers.func_140038_h(this.field_96294_a).displayString = I18n.getString("mco.selectServer.configure"); - } - -- GuiScreenOnlineServers.func_140033_i(this.field_96294_a).enabled = var3.d.equals("OPEN") && !var3.field_98166_h; -- if(var2 && GuiScreenOnlineServers.func_140033_i(this.field_96294_a).enabled) { -+ GuiScreenOnlineServers.func_140033_i(this.field_96294_a).enabled = var3.field_96404_d.equals("OPEN") && !var3.field_98166_h; -+ -+ if (par2 && GuiScreenOnlineServers.func_140033_i(this.field_96294_a).enabled) { - GuiScreenOnlineServers.func_140008_c(this.field_96294_a, GuiScreenOnlineServers.func_140041_a(this.field_96294_a)); - } -- - } - } - -- protected boolean isSelected(int var1) { -- return var1 == GuiScreenOnlineServers.func_140027_d(this.field_96294_a, GuiScreenOnlineServers.func_140041_a(this.field_96294_a)); -+ /** -+ * returns true if the element passed in is currently selected -+ */ -+ protected boolean isSelected(int par1) { -+ return par1 == GuiScreenOnlineServers.func_140027_d(this.field_96294_a, GuiScreenOnlineServers.func_140041_a(this.field_96294_a)); - } - -- protected boolean func_104086_b(int var1) { -+ protected boolean func_104086_b(int par1) { - try { -- return var1 >= 0 && var1 < GuiScreenOnlineServers.func_140013_c(this.field_96294_a).size() && ((McoServer)GuiScreenOnlineServers.func_140013_c(this.field_96294_a).get(var1)).e.toLowerCase().equals(GuiScreenOnlineServers.func_104032_j(this.field_96294_a).getSession().getUsername()); -+ return par1 >= 0 && par1 < GuiScreenOnlineServers.func_140013_c(this.field_96294_a).size() && ((McoServer)GuiScreenOnlineServers.func_140013_c(this.field_96294_a).get(par1)).field_96405_e.toLowerCase().equals(GuiScreenOnlineServers.func_104032_j(this.field_96294_a).getSession().getUsername()); - } catch (Exception var3) { - return false; - } -@@ -52,45 +62,44 @@ - this.field_96294_a.drawDefaultBackground(); - } - -- protected void drawSlot(int var1, int var2, int var3, int var4, Tessellator var5) { -- if(var1 < GuiScreenOnlineServers.func_140013_c(this.field_96294_a).size()) { -- this.func_96292_b(var1, var2, var3, var4, var5); -+ protected void drawSlot(int par1, int par2, int par3, int par4, Tessellator par5Tessellator) { -+ if (par1 < GuiScreenOnlineServers.func_140013_c(this.field_96294_a).size()) { -+ this.func_96292_b(par1, par2, par3, par4, par5Tessellator); - } -- - } - -- private void func_96292_b(int var1, int var2, int var3, int var4, Tessellator var5) { -- McoServer var6 = (McoServer)GuiScreenOnlineServers.func_140013_c(this.field_96294_a).get(var1); -- this.field_96294_a.drawString(GuiScreenOnlineServers.func_140023_k(this.field_96294_a), var6.func_96398_b(), var2 + 2, var3 + 1, 16777215); -+ private void func_96292_b(int par1, int par2, int par3, int par4, Tessellator par5Tessellator) { -+ McoServer var6 = (McoServer)GuiScreenOnlineServers.func_140013_c(this.field_96294_a).get(par1); -+ this.field_96294_a.drawString(GuiScreenOnlineServers.func_140023_k(this.field_96294_a), var6.func_96398_b(), par2 + 2, par3 + 1, 16777215); - short var7 = 207; - byte var8 = 1; -- if(var6.field_98166_h) { -- GuiScreenOnlineServers.func_104031_c(this.field_96294_a, var2 + var7, var3 + var8, this.field_104094_d, this.field_104095_e); -- } else if(var6.d.equals("CLOSED")) { -- GuiScreenOnlineServers.func_140035_b(this.field_96294_a, var2 + var7, var3 + var8, this.field_104094_d, this.field_104095_e); -- } else if(var6.e.equals(GuiScreenOnlineServers.func_140014_l(this.field_96294_a).getSession().getUsername()) && var6.field_104063_i < 7) { -- this.func_96293_a(var1, var2 - 14, var3, var6); -- GuiScreenOnlineServers.func_140031_a(this.field_96294_a, var2 + var7, var3 + var8, this.field_104094_d, this.field_104095_e, var6.field_104063_i); -- } else if(var6.d.equals("OPEN")) { -- GuiScreenOnlineServers.func_140020_c(this.field_96294_a, var2 + var7, var3 + var8, this.field_104094_d, this.field_104095_e); -- this.func_96293_a(var1, var2 - 14, var3, var6); -+ -+ if (var6.field_98166_h) { -+ GuiScreenOnlineServers.func_104031_c(this.field_96294_a, par2 + var7, par3 + var8, this.field_104094_d, this.field_104095_e); -+ } else if (var6.field_96404_d.equals("CLOSED")) { -+ GuiScreenOnlineServers.func_140035_b(this.field_96294_a, par2 + var7, par3 + var8, this.field_104094_d, this.field_104095_e); -+ } else if (var6.field_96405_e.equals(GuiScreenOnlineServers.func_140014_l(this.field_96294_a).getSession().getUsername()) && var6.field_104063_i < 7) { -+ this.func_96293_a(par1, par2 - 14, par3, var6); -+ GuiScreenOnlineServers.func_140031_a(this.field_96294_a, par2 + var7, par3 + var8, this.field_104094_d, this.field_104095_e, var6.field_104063_i); -+ } else if (var6.field_96404_d.equals("OPEN")) { -+ GuiScreenOnlineServers.func_140020_c(this.field_96294_a, par2 + var7, par3 + var8, this.field_104094_d, this.field_104095_e); -+ this.func_96293_a(par1, par2 - 14, par3, var6); - } - -- this.field_96294_a.drawString(GuiScreenOnlineServers.func_140039_m(this.field_96294_a), var6.func_96397_a(), var2 + 2, var3 + 12, 7105644); -- this.field_96294_a.drawString(GuiScreenOnlineServers.func_98079_k(this.field_96294_a), var6.e, var2 + 2, var3 + 12 + 11, 5000268); -+ this.field_96294_a.drawString(GuiScreenOnlineServers.func_140039_m(this.field_96294_a), var6.func_96397_a(), par2 + 2, par3 + 12, 7105644); -+ this.field_96294_a.drawString(GuiScreenOnlineServers.func_98079_k(this.field_96294_a), var6.field_96405_e, par2 + 2, par3 + 12 + 11, 5000268); - } - -- private void func_96293_a(int var1, int var2, int var3, McoServer var4) { -- if(var4.g != null) { -- Object var5 = GuiScreenOnlineServers.func_140029_i(); -- synchronized(var5) { -- if(GuiScreenOnlineServers.func_140018_j() < 5 && (!var4.field_96411_l || var4.field_102022_m)) { -- (new ThreadConnectToOnlineServer(this, var4)).start(); -+ private void func_96293_a(int par1, int par2, int par3, McoServer par4McoServer) { -+ if (par4McoServer.field_96403_g != null) { -+ synchronized (GuiScreenOnlineServers.func_140029_i()) { -+ if (GuiScreenOnlineServers.func_140018_j() < 5 && (!par4McoServer.field_96411_l || par4McoServer.field_102022_m)) { -+ (new ThreadConnectToOnlineServer(this, par4McoServer)).start(); - } - } - -- if(var4.m != null) { -- this.field_96294_a.drawString(GuiScreenOnlineServers.func_110402_q(this.field_96294_a), var4.m, var2 + 215 - GuiScreenOnlineServers.func_140010_p(this.field_96294_a).getStringWidth(var4.m), var3 + 1, 8421504); -+ if (par4McoServer.field_96414_k != null) { -+ this.field_96294_a.drawString(GuiScreenOnlineServers.func_110402_q(this.field_96294_a), par4McoServer.field_96414_k, par2 + 215 - GuiScreenOnlineServers.func_140010_p(this.field_96294_a).getStringWidth(par4McoServer.field_96414_k), par3 + 1, 8421504); - } - - GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); ---- net/minecraft/src/Packet0KeepAlive.java -+++ net/minecraft/src/Packet0KeepAlive.java -@@ -7,37 +7,59 @@ - public class Packet0KeepAlive extends Packet { - public int randomId; - -- public Packet0KeepAlive() { -- } -- -- public Packet0KeepAlive(int var1) { -- this.randomId = var1; -- } -- -- public void processPacket(NetHandler var1) { -- var1.handleKeepAlive(this); -- } -- -- public void readPacketData(DataInput var1) throws IOException { -- this.randomId = var1.readInt(); -- } -- -- public void writePacketData(DataOutput var1) throws IOException { -- var1.writeInt(this.randomId); -- } -- -+ public Packet0KeepAlive() {} -+ -+ public Packet0KeepAlive(int par1) { -+ this.randomId = par1; -+ } -+ -+ /** -+ * Passes this Packet on to the NetHandler for processing. -+ */ -+ public void processPacket(NetHandler par1NetHandler) { -+ par1NetHandler.handleKeepAlive(this); -+ } -+ -+ /** -+ * Abstract. Reads the raw packet data from the data stream. -+ */ -+ public void readPacketData(DataInput par1DataInput) throws IOException { -+ this.randomId = par1DataInput.readInt(); -+ } -+ -+ /** -+ * Abstract. Writes the raw packet data to the data stream. -+ */ -+ public void writePacketData(DataOutput par1DataOutput) throws IOException { -+ par1DataOutput.writeInt(this.randomId); -+ } -+ -+ /** -+ * Abstract. Return the size of the packet (not counting the header). -+ */ - public int getPacketSize() { - return 4; - } - -+ /** -+ * only false for the abstract Packet class, all real packets return true -+ */ - public boolean isRealPacket() { - return true; - } - -- public boolean containsSameEntityIDAs(Packet var1) { -+ /** -+ * eg return packet30entity.entityId == entityId; WARNING : will throw if you compare a packet to a different packet -+ * class -+ */ -+ public boolean containsSameEntityIDAs(Packet par1Packet) { - return true; - } - -+ /** -+ * If this returns true, the packet may be processed on any thread; otherwise it is queued for the main thread to -+ * handle. -+ */ - public boolean canProcessAsync() { - return true; - } ---- net/minecraft/src/BiomeGenEnd.java -+++ net/minecraft/src/BiomeGenEnd.java -@@ -1,19 +1,22 @@ - package net.minecraft.src; - - public class BiomeGenEnd extends BiomeGenBase { -- public BiomeGenEnd(int var1) { -- super(var1); -- this.J.clear(); -- this.K.clear(); -- this.L.clear(); -- this.M.clear(); -- this.J.add(new SpawnListEntry(EntityEnderman.class, 10, 4, 4)); -+ public BiomeGenEnd(int par1) { -+ super(par1); -+ this.spawnableMonsterList.clear(); -+ this.spawnableCreatureList.clear(); -+ this.spawnableWaterCreatureList.clear(); -+ this.spawnableCaveCreatureList.clear(); -+ this.spawnableMonsterList.add(new SpawnListEntry(EntityEnderman.class, 10, 4, 4)); - this.topBlock = (byte)Block.dirt.blockID; - this.fillerBlock = (byte)Block.dirt.blockID; - this.theBiomeDecorator = new BiomeEndDecorator(this); - } - -- public int getSkyColorByTemp(float var1) { -+ /** -+ * takes temperature, returns color -+ */ -+ public int getSkyColorByTemp(float par1) { - return 0; - } - } ---- net/minecraft/src/GrassColorReloadListener.java -+++ net/minecraft/src/GrassColorReloadListener.java -@@ -5,11 +5,11 @@ - public class GrassColorReloadListener implements ResourceManagerReloadListener { - private static final ResourceLocation field_130078_a = new ResourceLocation("textures/colormap/grass.png"); - -- public void onResourceManagerReload(ResourceManager var1) { -+ public void onResourceManagerReload(ResourceManager par1ResourceManager) { - try { -- ColorizerGrass.setGrassBiomeColorizer(TextureUtil.readImageData(var1, field_130078_a)); -+ ColorizerGrass.setGrassBiomeColorizer(TextureUtil.readImageData(par1ResourceManager, field_130078_a)); - } catch (IOException var3) { -+ ; - } -- - } - } ---- net/minecraft/src/Slot.java -+++ net/minecraft/src/Slot.java -@@ -1,82 +1,133 @@ - package net.minecraft.src; - - public class Slot { -- private final int slotIndex; -+ -+ /** The index of the slot in the inventory. */ -+ // Spout Start - private to public -+ public final int slotIndex; -+ // Spout End -+ -+ /** The inventory we want to extract a slot from. */ - public final IInventory inventory; -+ -+ /** the id of the slot(also the index in the inventory arraylist) */ - public int slotNumber; -+ -+ /** display position of the inventory slot on the screen x axis */ - public int xDisplayPosition; -+ -+ /** display position of the inventory slot on the screen y axis */ - public int yDisplayPosition; - -- public Slot(IInventory var1, int var2, int var3, int var4) { -- this.inventory = var1; -- this.slotIndex = var2; -- this.xDisplayPosition = var3; -- this.yDisplayPosition = var4; -+ public Slot(IInventory par1IInventory, int par2, int par3, int par4) { -+ this.inventory = par1IInventory; -+ this.slotIndex = par2; -+ this.xDisplayPosition = par3; -+ this.yDisplayPosition = par4; - } - -- public void onSlotChange(ItemStack var1, ItemStack var2) { -- if(var1 != null && var2 != null) { -- if(var1.itemID == var2.itemID) { -- int var3 = var2.stackSize - var1.stackSize; -- if(var3 > 0) { -- this.onCrafting(var1, var3); -+ /** -+ * if par2 has more items than par1, onCrafting(item,countIncrease) is called -+ */ -+ public void onSlotChange(ItemStack par1ItemStack, ItemStack par2ItemStack) { -+ if (par1ItemStack != null && par2ItemStack != null) { -+ if (par1ItemStack.itemID == par2ItemStack.itemID) { -+ int var3 = par2ItemStack.stackSize - par1ItemStack.stackSize; -+ -+ if (var3 > 0) { -+ this.onCrafting(par1ItemStack, var3); - } -- - } - } - } - -- protected void onCrafting(ItemStack var1, int var2) { -- } -- -- protected void onCrafting(ItemStack var1) { -- } -- -- public void onPickupFromSlot(EntityPlayer var1, ItemStack var2) { -+ /** -+ * the itemStack passed in is the output - ie, iron ingots, and pickaxes, not ore and wood. Typically increases an -+ * internal count then calls onCrafting(item). -+ */ -+ protected void onCrafting(ItemStack par1ItemStack, int par2) {} -+ -+ /** -+ * the itemStack passed in is the output - ie, iron ingots, and pickaxes, not ore and wood. -+ */ -+ protected void onCrafting(ItemStack par1ItemStack) {} -+ -+ public void onPickupFromSlot(EntityPlayer par1EntityPlayer, ItemStack par2ItemStack) { - this.onSlotChanged(); - } - -- public boolean isItemValid(ItemStack var1) { -+ /** -+ * Check if the stack is a valid item for this slot. Always true beside for the armor slots. -+ */ -+ public boolean isItemValid(ItemStack par1ItemStack) { - return true; - } - -+ /** -+ * Helper fnct to get the stack in the slot. -+ */ - public ItemStack getStack() { - return this.inventory.getStackInSlot(this.slotIndex); - } - -+ /** -+ * Returns if this slot contains a stack. -+ */ - public boolean getHasStack() { - return this.getStack() != null; - } - -- public void putStack(ItemStack var1) { -- this.inventory.setInventorySlotContents(this.slotIndex, var1); -+ /** -+ * Helper method to put a stack in the slot. -+ */ -+ public void putStack(ItemStack par1ItemStack) { -+ this.inventory.setInventorySlotContents(this.slotIndex, par1ItemStack); - this.onSlotChanged(); - } - -+ /** -+ * Called when the stack in a Slot changes -+ */ - public void onSlotChanged() { - this.inventory.onInventoryChanged(); - } - -+ /** -+ * Returns the maximum stack size for a given slot (usually the same as getInventoryStackLimit(), but 1 in the case of -+ * armor slots) -+ */ - public int getSlotStackLimit() { - return this.inventory.getInventoryStackLimit(); - } - -+ /** -+ * Returns the icon index on items.png that is used as background image of the slot. -+ */ - public Icon getBackgroundIconIndex() { - return null; - } - -- public ItemStack decrStackSize(int var1) { -- return this.inventory.decrStackSize(this.slotIndex, var1); -- } -- -- public boolean isHere(IInventory var1, int var2) { -- return var1 == this.inventory && var2 == this.slotIndex; -- } -- -- public boolean canTakeStack(EntityPlayer var1) { -+ /** -+ * Decrease the size of the stack in slot (first int arg) by the amount of the second int arg. Returns the new stack. -+ */ -+ public ItemStack decrStackSize(int par1) { -+ return this.inventory.decrStackSize(this.slotIndex, par1); -+ } -+ -+ /** -+ * returns true if this slot is in par2 of par1 -+ */ -+ public boolean isSlotInInventory(IInventory par1IInventory, int par2) { -+ return par1IInventory == this.inventory && par2 == this.slotIndex; -+ } -+ -+ /** -+ * Return whether this slot's stack can be taken from this slot. -+ */ -+ public boolean canTakeStack(EntityPlayer par1EntityPlayer) { - return true; - } -- -+ - public boolean func_111238_b() { - return true; - } ---- /dev/null -+++ org/spoutcraft/client/gui/settings/controls/WeatherToggleButton.java -@@ -1,0 +1,47 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.client.gui.settings.controls; -+ -+import org.spoutcraft.api.gui.GenericCheckBox; -+import org.spoutcraft.client.SpoutClient; -+import org.spoutcraft.client.config.Configuration; -+ -+public class WeatherToggleButton extends GenericCheckBox { -+ public WeatherToggleButton() { -+ super("Weather"); -+ setChecked(Configuration.isWeather()); -+ setEnabled(SpoutClient.getInstance().isWeatherCheat()); -+ setTooltip("Weather\nON - weather is active, slower\nOFF - weather is not active, faster\nThe weather controls rain, snow and thunderstorms."); -+ } -+ -+ @Override -+ public String getTooltip() { -+ if (!isEnabled()) { -+ return "This option is not allowed by your server, it is considered cheating."; -+ } -+ return super.getTooltip(); -+ } -+ -+ @Override -+ public void onButtonClick() { -+ Configuration.setWeather(!Configuration.isWeather()); -+ Configuration.write(); -+ } -+} ---- /dev/null -+++ org/spoutcraft/api/gui/Label.java -@@ -1,0 +1,100 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.api.gui; -+ -+import org.spoutcraft.api.UnsafeClass; -+ -+@UnsafeClass -+public interface Label extends Widget { -+ /** -+ * Gets the text of the label -+ * -+ * @return text -+ */ -+ public String getText(); -+ -+ /** -+ * Sets the text of the label -+ * -+ * @param text to set -+ * @return label -+ */ -+ public Label setText(String text); -+ -+ /** -+ * Gets the color for the text -+ * -+ * @return color -+ */ -+ public Color getTextColor(); -+ -+ /** -+ * Sets the color for the text -+ * -+ * @param color to set -+ * @return label -+ */ -+ public Label setTextColor(Color color); -+ -+ /** -+ * Determines if text expands to fill width and height -+ * If word wrapping and auto is enabled, the height of the label will reflect the heigth of all lines. -+ * -+ * @param auto -+ * @return label -+ */ -+ public Label setAuto(boolean auto); -+ -+ /** -+ * Gets if the text will expand to fill width and height -+ * -+ * @param auto -+ * @return label -+ */ -+ public boolean isAuto(); -+ -+ public WidgetAnchor getAlign(); -+ -+ public Widget setAlign(WidgetAnchor pos); -+ -+ /** -+ * Set the scale of the text -+ * @param scale to set -+ */ -+ public Label setScale(float scale); -+ -+ /** -+ * Gets the scale of the text -+ * @return scale of text -+ */ -+ public float getScale(); -+ -+ /** -+ * Sets whether or not the label has a shadow. -+ * @param shadow -+ */ -+ public Label setShadow(boolean shadow); -+ -+ /** -+ * Gets whether or not the label has a shadow. -+ * @return -+ */ -+ public boolean hasShadow(); -+} ---- net/minecraft/src/SoundManager.java -+++ net/minecraft/src/SoundManager.java -@@ -8,40 +8,77 @@ - import java.util.List; - import java.util.Random; - import java.util.Set; -+ -+import de.cuina.fireandfuel.CodecJLayerMP3; - import org.apache.commons.io.FileUtils; - import paulscode.sound.SoundSystem; - import paulscode.sound.SoundSystemConfig; - import paulscode.sound.SoundSystemException; --import paulscode.sound.codecs.CodecJOrbis; - import paulscode.sound.codecs.CodecWav; - import paulscode.sound.libraries.LibraryLWJGLOpenAL; -- -+import thedudeguy.paulscode.sound.codecs.CodecJOrbis; -+ -+import org.spoutcraft.api.sound.Music; -+import org.spoutcraft.client.SpoutClient; -+import org.spoutcraft.client.packet.PacketMusicChange; -+ -+// Spout Start - Unused import -+//import paulscode.sound.codecs.CodecJOrbis; -+// Spout End - public class SoundManager implements ResourceManagerReloadListener { -- private static final String[] a = new String[]{"ogg"}; -- private SoundSystem b; -+ private static final String[] field_130084_a = new String[] {"ogg"}; -+ -+ /** A reference to the sound system. */ -+ private SoundSystem sndSystem; -+ -+ /** Set to true when the SoundManager has been initialised. */ - private boolean loaded; -+ -+ /** Sound pool containing sounds. */ - private final SoundPool soundPoolSounds; -+ -+ /** Sound pool containing streaming audio. */ - private final SoundPool soundPoolStreaming; -+ -+ /** Sound pool containing music. */ - private final SoundPool soundPoolMusic; -+ -+ /** -+ * The last ID used when a sound is played, passed into SoundSystem to give active sounds a unique ID -+ */ - private int latestSoundID; -+ -+ /** A reference to the game settings. */ - private final GameSettings options; -- private final File i; -- private final Set j = new HashSet(); -- private final List k = new ArrayList(); -- private Random l = new Random(); -- private int ticksBeforeMusic = this.l.nextInt(12000); -- -- public SoundManager(ResourceManager var1, GameSettings var2, File var3) { -- this.options = var2; -- this.i = var3; -- this.soundPoolSounds = new SoundPool(var1, "sound", true); -- this.soundPoolStreaming = new SoundPool(var1, "records", false); -- this.soundPoolMusic = new SoundPool(var1, "music", true); -+ private final File fileAssets; -+ -+ /** Identifiers of all currently playing sounds. Type: HashSet */ -+ private final Set playingSounds = new HashSet(); -+ private final List field_92072_h = new ArrayList(); -+ -+ /** RNG. */ -+ private Random rand = new Random(); -+ private int ticksBeforeMusic; -+ // Spout Start -+ private final int SOUND_EFFECTS_PER_TICK = 3; -+ private int soundEffectsLimit = SOUND_EFFECTS_PER_TICK; -+ // Spout End -+ -+ public SoundManager(ResourceManager par1ResourceManager, GameSettings par2GameSettings, File par3File) { -+ this.ticksBeforeMusic = this.rand.nextInt(12000); -+ this.options = par2GameSettings; -+ this.fileAssets = par3File; -+ this.soundPoolSounds = new SoundPool(par1ResourceManager, "sound", true); -+ this.soundPoolStreaming = new SoundPool(par1ResourceManager, "records", false); -+ this.soundPoolMusic = new SoundPool(par1ResourceManager, "music", true); - - try { - SoundSystemConfig.addLibrary(LibraryLWJGLOpenAL.class); - SoundSystemConfig.setCodec("ogg", CodecJOrbis.class); - SoundSystemConfig.setCodec("wav", CodecWav.class); -+ // Spout Start -+ SoundSystemConfig.setCodec("mp3", CodecJLayerMP3.class); -+ // Spout End - } catch (SoundSystemException var5) { - var5.printStackTrace(); - System.err.println("error linking with the LibraryJavaSound plug-in"); -@@ -50,44 +87,49 @@ - this.loadSounds(); - } - -- public void onResourceManagerReload(ResourceManager var1) { -+ public void onResourceManagerReload(ResourceManager par1ResourceManager) { - this.stopAllSounds(); - this.cleanup(); - this.tryToSetLibraryAndCodecs(); - } - - private void loadSounds() { -- if(this.i.isDirectory()) { -- Collection var1 = FileUtils.listFiles(this.i, a, true); -+ if (this.fileAssets.isDirectory()) { -+ Collection var1 = FileUtils.listFiles(this.fileAssets, field_130084_a, true); - Iterator var2 = var1.iterator(); - -- while(var2.hasNext()) { -+ while (var2.hasNext()) { - File var3 = (File)var2.next(); - this.loadSoundFile(var3); - } - } -- - } - -- private void loadSoundFile(File var1) { -- String var2 = this.i.toURI().relativize(var1.toURI()).getPath(); -+ private void loadSoundFile(File par1File) { -+ String var2 = this.fileAssets.toURI().relativize(par1File.toURI()).getPath(); - int var3 = var2.indexOf("/"); -- if(var3 != -1) { -+ -+ if (var3 != -1) { - String var4 = var2.substring(0, var3); - var2 = var2.substring(var3 + 1); -- if("sound".equalsIgnoreCase(var4)) { -+ -+ if ("sound".equalsIgnoreCase(var4)) { - this.addSound(var2); -- } else if("records".equalsIgnoreCase(var4)) { -+ } else if ("records".equalsIgnoreCase(var4)) { - this.addStreaming(var2); -- } else if("music".equalsIgnoreCase(var4)) { -+ } else if ("music".equalsIgnoreCase(var4)) { - this.addMusic(var2); - } -- - } - } - -+ -+ /** -+ * Tries to add the paulscode library and the relevant codecs. If it fails, the volumes (sound and music) will be set -+ * to zero in the options file. -+ */ - private synchronized void tryToSetLibraryAndCodecs() { -- if(!this.loaded) { -+ if (!this.loaded) { - float var1 = this.options.soundVolume; - float var2 = this.options.musicVolume; - this.options.soundVolume = 0.0F; -@@ -109,298 +151,544 @@ - } - } - -+ /** -+ * Called when one of the sound level options has changed. -+ */ - public void onSoundOptionsChanged() { -- if(this.loaded) { -- if(this.options.musicVolume == 0.0F) { -- this.b.stop("BgMusic"); -- this.b.stop("streaming"); -+ if (this.loaded) { -+ if (this.options.musicVolume == 0.0F) { -+ this.sndSystem.stop("BgMusic"); -+ this.sndSystem.stop("streaming"); - } else { -- this.b.setVolume("BgMusic", this.options.musicVolume); -- this.b.setVolume("streaming", this.options.musicVolume); -+ this.sndSystem.setVolume("BgMusic", this.options.musicVolume); -+ this.sndSystem.setVolume("streaming", this.options.musicVolume); - } -- - } - } - -+ /** -+ * Cleans up the Sound System -+ */ - public void cleanup() { -- if(this.loaded) { -- this.b.cleanup(); -+ if (this.loaded) { -+ this.sndSystem.cleanup(); - this.loaded = false; - } -- -- } -- -- public void addSound(String var1) { -- this.soundPoolSounds.addSound(var1); -- } -- -- public void addStreaming(String var1) { -- this.soundPoolStreaming.addSound(var1); -- } -- -- public void addMusic(String var1) { -- this.soundPoolMusic.addSound(var1); -- } -- -+ } -+ -+ /** -+ * Adds a sounds with the name from the file. Args: name, file -+ */ -+ public void addSound(String par1Str) { -+ this.soundPoolSounds.addSound(par1Str); -+ } -+ -+ /** -+ * Adds an audio file to the streaming SoundPool. -+ */ -+ public void addStreaming(String par1Str) { -+ this.soundPoolStreaming.addSound(par1Str); -+ } -+ -+ /** -+ * Adds an audio file to the music SoundPool. -+ */ -+ public void addMusic(String par1Str) { -+ this.soundPoolMusic.addSound(par1Str); -+ } -+ -+ -+ /** -+ * If its time to play new music it starts it up. -+ */ - public void playRandomMusicIfReady() { -- if(this.loaded && this.options.musicVolume != 0.0F) { -- if(!this.b.playing("BgMusic") && !this.b.playing("streaming")) { -- if(this.ticksBeforeMusic > 0) { -+ if (this.loaded && this.options.musicVolume != 0.0F) { -+ if (!this.sndSystem.playing("BgMusic") && !this.sndSystem.playing("streaming")) { -+ if (this.ticksBeforeMusic > 0) { - --this.ticksBeforeMusic; - } else { - SoundPoolEntry var1 = this.soundPoolMusic.getRandomSound(); -- if(var1 != null) { -- this.ticksBeforeMusic = this.l.nextInt(12000) + 12000; -- this.b.backgroundMusic("BgMusic", var1.getSoundUrl(), var1.getSoundName(), false); -- this.b.setVolume("BgMusic", this.options.musicVolume); -- this.b.play("BgMusic"); -+ -+ if (var1 != null) { -+ // Spout Start -+ if (SpoutClient.getInstance().isSpoutEnabled()) { -+ EntityPlayer player = SpoutClient.getHandle().thePlayer; -+ if (player instanceof EntityClientPlayerMP) { -+ if (waitingSound == null) { -+ Music music = Music.getMusicFromName(var1.soundName); -+ if (music != null) { -+ waitingSound = var1; -+ SpoutClient.getInstance().getPacketManager().sendSpoutPacket(new PacketMusicChange(music.getId(), (int)options.musicVolume * 100)); -+ return; -+ } -+ } else if (allowed) { -+ var1 = waitingSound; -+ waitingSound = null; -+ allowed = false; -+ cancelled = false; -+ } else if (cancelled) { -+ var1 = null; -+ allowed = false; -+ cancelled = false; -+ ticksBeforeMusic = rand.nextInt(12000) + 12000; -+ return; -+ } else { -+ return; -+ } -+ } -+ } -+ // Spout End -+ this.ticksBeforeMusic = this.rand.nextInt(12000) + 12000; -+ this.sndSystem.backgroundMusic("BgMusic", var1.getSoundUrl(), var1.getSoundName(), false); -+ sndSystem.setVolume("BgMusic", this.options.musicVolume); -+ sndSystem.play("BgMusic"); - } -- - } - } - } - } - -- public void setListener(EntityLivingBase var1, float var2) { -- if(this.loaded && this.options.soundVolume != 0.0F && var1 != null) { -- float var3 = var1.prevRotationPitch + (var1.rotationPitch - var1.prevRotationPitch) * var2; -- float var4 = var1.prevRotationYaw + (var1.rotationYaw - var1.prevRotationYaw) * var2; -- double var5 = var1.prevPosX + (var1.posX - var1.prevPosX) * (double)var2; -- double var7 = var1.prevPosY + (var1.posY - var1.prevPosY) * (double)var2; -- double var9 = var1.prevPosZ + (var1.posZ - var1.prevPosZ) * (double)var2; -- float var11 = MathHelper.cos(-var4 * ((float)Math.PI / 180.0F) - (float)Math.PI); -- float var12 = MathHelper.sin(-var4 * ((float)Math.PI / 180.0F) - (float)Math.PI); -+ /** -+ * Sets the listener of sounds -+ */ -+ public void setListener(EntityLivingBase par1EntityLivingBase, float par2) { -+ if (this.loaded && this.options.soundVolume != 0.0F && par1EntityLivingBase != null) { -+ float var3 = par1EntityLivingBase.prevRotationPitch + (par1EntityLivingBase.rotationPitch - par1EntityLivingBase.prevRotationPitch) * par2; -+ float var4 = par1EntityLivingBase.prevRotationYaw + (par1EntityLivingBase.rotationYaw - par1EntityLivingBase.prevRotationYaw) * par2; -+ double var5 = par1EntityLivingBase.prevPosX + (par1EntityLivingBase.posX - par1EntityLivingBase.prevPosX) * (double)par2; -+ double var7 = par1EntityLivingBase.prevPosY + (par1EntityLivingBase.posY - par1EntityLivingBase.prevPosY) * (double)par2; -+ double var9 = par1EntityLivingBase.prevPosZ + (par1EntityLivingBase.posZ - par1EntityLivingBase.prevPosZ) * (double)par2; -+ float var11 = MathHelper.cos(-var4 * 0.017453292F - (float)Math.PI); -+ float var12 = MathHelper.sin(-var4 * 0.017453292F - (float)Math.PI); - float var13 = -var12; -- float var14 = -MathHelper.sin(-var3 * ((float)Math.PI / 180.0F) - (float)Math.PI); -+ float var14 = -MathHelper.sin(-var3 * 0.017453292F - (float)Math.PI); - float var15 = -var11; - float var16 = 0.0F; - float var17 = 1.0F; - float var18 = 0.0F; -- this.b.setListenerPosition((float)var5, (float)var7, (float)var9); -- this.b.setListenerOrientation(var13, var14, var15, var16, var17, var18); -+ this.sndSystem.setListenerPosition((float)var5, (float)var7, (float)var9); -+ this.sndSystem.setListenerOrientation(var13, var14, var15, var16, var17, var18); - } - } - -+ /** -+ * Stops all currently playing sounds -+ */ - public void stopAllSounds() { -- if(this.loaded) { -- Iterator var1 = this.j.iterator(); -+ if (this.loaded) { -+ Iterator var1 = this.playingSounds.iterator(); - -- while(var1.hasNext()) { -+ while (var1.hasNext()) { - String var2 = (String)var1.next(); -- this.b.stop(var2); -+ this.sndSystem.stop(var2); - } - -- this.j.clear(); -+ this.playingSounds.clear(); - } -- - } - -- public void playStreaming(String var1, float var2, float var3, float var4) { -- if(this.loaded && (this.options.soundVolume != 0.0F || var1 == null)) { -+ public void playStreaming(String par1Str, float par2, float par3, float par4) { -+ if (this.loaded && (this.options.soundVolume != 0.0F || par1Str == null)) { - String var5 = "streaming"; -- if(this.b.playing(var5)) { -- this.b.stop(var5); -+ -+ if (this.sndSystem.playing(var5)) { -+ this.sndSystem.stop(var5); - } - -- if(var1 != null) { -- SoundPoolEntry var6 = this.soundPoolStreaming.getRandomSoundFromSoundPool(var1); -- if(var6 != null) { -- if(this.b.playing("BgMusic")) { -- this.b.stop("BgMusic"); -+ if (par1Str != null) { -+ SoundPoolEntry var6 = this.soundPoolStreaming.getRandomSoundFromSoundPool(par1Str); -+ -+ if (var6 != null) { -+ if (this.sndSystem.playing("BgMusic")) { -+ this.sndSystem.stop("BgMusic"); - } - -- this.b.newStreamingSource(true, var5, var6.getSoundUrl(), var6.getSoundName(), false, var2, var3, var4, 2, 64.0F); -- this.b.setVolume(var5, 0.5F * this.options.soundVolume); -- this.b.play(var5); -+ this.sndSystem.newStreamingSource(true, var5, var6.getSoundUrl(), var6.getSoundName(), false, par2, par3, par4, 2, 64.0F); -+ this.sndSystem.setVolume(var5, 0.5F * this.options.soundVolume); -+ this.sndSystem.play(var5); - } -- - } - } - } - -- public void updateSoundLocation(Entity var1) { -- this.updateSoundLocation(var1, var1); -+ /** -+ * Updates the sound associated with the entity with that entity's position and velocity. Args: the entity -+ */ -+ public void updateSoundLocation(Entity par1Entity) { -+ this.updateSoundLocation(par1Entity, par1Entity); - } - -- public void updateSoundLocation(Entity var1, Entity var2) { -- String var3 = "entity_" + var1.entityId; -- if(this.j.contains(var3)) { -- if(this.b.playing(var3)) { -- this.b.setPosition(var3, (float)var2.posX, (float)var2.posY, (float)var2.posZ); -- this.b.setVelocity(var3, (float)var2.motionX, (float)var2.motionY, (float)var2.motionZ); -+ /** -+ * Updates the sound associated with soundEntity with the position and velocity of trackEntity. Args: soundEntity, -+ * trackEntity -+ */ -+ public void updateSoundLocation(Entity par1Entity, Entity par2Entity) { -+ String var3 = "entity_" + par1Entity.entityId; -+ -+ if (this.playingSounds.contains(var3)) { -+ if (this.sndSystem.playing(var3)) { -+ this.sndSystem.setPosition(var3, (float)par2Entity.posX, (float)par2Entity.posY, (float)par2Entity.posZ); -+ this.sndSystem.setVelocity(var3, (float)par2Entity.motionX, (float)par2Entity.motionY, (float)par2Entity.motionZ); - } else { -- this.j.remove(var3); -+ this.playingSounds.remove(var3); - } - } -- - } - -- public boolean isEntitySoundPlaying(Entity var1) { -- if(var1 != null && this.loaded) { -- String var2 = "entity_" + var1.entityId; -- return this.b.playing(var2); -+ /** -+ * Returns true if a sound is currently associated with the given entity, or false otherwise. -+ */ -+ public boolean isEntitySoundPlaying(Entity par1Entity) { -+ if (par1Entity != null && this.loaded) { -+ String var2 = "entity_" + par1Entity.entityId; -+ return this.sndSystem.playing(var2); - } else { - return false; - } - } - -- public void stopEntitySound(Entity var1) { -- if(var1 != null && this.loaded) { -- String var2 = "entity_" + var1.entityId; -- if(this.j.contains(var2)) { -- if(this.b.playing(var2)) { -- this.b.stop(var2); -+ /** -+ * Stops playing the sound associated with the given entity -+ */ -+ public void stopEntitySound(Entity par1Entity) { -+ if (par1Entity != null && this.loaded) { -+ String var2 = "entity_" + par1Entity.entityId; -+ -+ if (this.playingSounds.contains(var2)) { -+ if (this.sndSystem.playing(var2)) { -+ this.sndSystem.stop(var2); - } - -- this.j.remove(var2); -- } -- -- } -- } -- -- public void setEntitySoundVolume(Entity var1, float var2) { -- if(var1 != null && this.loaded && this.options.soundVolume != 0.0F) { -- String var3 = "entity_" + var1.entityId; -- if(this.b.playing(var3)) { -- this.b.setVolume(var3, var2 * this.options.soundVolume); -- } -- } -- } -- -- public void setEntitySoundPitch(Entity var1, float var2) { -- if(var1 != null && this.loaded && this.options.soundVolume != 0.0F) { -- String var3 = "entity_" + var1.entityId; -- if(this.b.playing(var3)) { -- this.b.setPitch(var3, var2); -- } -- } -- } -- -- public void playEntitySound(String var1, Entity var2, float var3, float var4, boolean var5) { -- if(this.loaded && (this.options.soundVolume != 0.0F || var1 == null) && var2 != null) { -- String var6 = "entity_" + var2.entityId; -- if(this.j.contains(var6)) { -- this.updateSoundLocation(var2); -+ this.playingSounds.remove(var2); -+ } -+ } -+ } -+ -+ /** -+ * Sets the volume of the sound associated with the given entity, if one is playing. The volume is scaled by the global -+ * sound volume. Args: the entity, the volume (from 0 to 1) -+ */ -+ public void setEntitySoundVolume(Entity par1Entity, float par2) { -+ if (par1Entity != null && this.loaded && this.options.soundVolume != 0.0F) { -+ String var3 = "entity_" + par1Entity.entityId; -+ -+ if (this.sndSystem.playing(var3)) { -+ this.sndSystem.setVolume(var3, par2 * this.options.soundVolume); -+ } -+ } -+ } -+ -+ /** -+ * Sets the pitch of the sound associated with the given entity, if one is playing. Args: the entity, the pitch -+ */ -+ public void setEntitySoundPitch(Entity par1Entity, float par2) { -+ if (par1Entity != null && this.loaded && this.options.soundVolume != 0.0F) { -+ String var3 = "entity_" + par1Entity.entityId; -+ -+ if (this.sndSystem.playing(var3)) { -+ this.sndSystem.setPitch(var3, par2); -+ } -+ } -+ } -+ -+ /** -+ * If a sound is already playing from the given entity, update the position and velocity of that sound to match the -+ * entity. Otherwise, start playing a sound from that entity. Setting the last flag to true will prevent other sounds -+ * from overriding this one. Args: The sound name, the entity, the volume, the pitch, priority -+ */ -+ public void playEntitySound(String par1Str, Entity par2Entity, float par3, float par4, boolean par5) { -+ if (this.loaded && (this.options.soundVolume != 0.0F || par1Str == null) && par2Entity != null) { -+ String var6 = "entity_" + par2Entity.entityId; -+ -+ if (this.playingSounds.contains(var6)) { -+ this.updateSoundLocation(par2Entity); - } else { -- if(this.b.playing(var6)) { -- this.b.stop(var6); -+ if (this.sndSystem.playing(var6)) { -+ this.sndSystem.stop(var6); - } - -- if(var1 != null) { -- SoundPoolEntry var7 = this.soundPoolSounds.getRandomSoundFromSoundPool(var1); -- if(var7 != null && var3 > 0.0F) { -+ if (par1Str != null) { -+ SoundPoolEntry var7 = this.soundPoolSounds.getRandomSoundFromSoundPool(par1Str); -+ -+ if (var7 != null && par3 > 0.0F) { - float var8 = 16.0F; -- if(var3 > 1.0F) { -- var8 *= var3; -- } -- -- this.b.newSource(var5, var6, var7.getSoundUrl(), var7.getSoundName(), false, (float)var2.posX, (float)var2.posY, (float)var2.posZ, 2, var8); -- this.b.setLooping(var6, true); -- this.b.setPitch(var6, var4); -- if(var3 > 1.0F) { -- var3 = 1.0F; -- } -- -- this.b.setVolume(var6, var3 * this.options.soundVolume); -- this.b.setVelocity(var6, (float)var2.motionX, (float)var2.motionY, (float)var2.motionZ); -- this.b.play(var6); -- this.j.add(var6); -+ -+ if (par3 > 1.0F) { -+ var8 *= par3; -+ } -+ -+ this.sndSystem.newSource(par5, var6, var7.getSoundUrl(), var7.getSoundName(), false, (float)par2Entity.posX, (float)par2Entity.posY, (float)par2Entity.posZ, 2, var8); -+ this.sndSystem.setLooping(var6, true); -+ this.sndSystem.setPitch(var6, par4); -+ -+ if (par3 > 1.0F) { -+ par3 = 1.0F; -+ } -+ -+ this.sndSystem.setVolume(var6, par3 * this.options.soundVolume); -+ this.sndSystem.setVelocity(var6, (float)par2Entity.motionX, (float)par2Entity.motionY, (float)par2Entity.motionZ); -+ this.sndSystem.play(var6); -+ this.playingSounds.add(var6); - } -- -- } -- } -- } -- } -- -- public void playSound(String var1, float var2, float var3, float var4, float var5, float var6) { -- if(this.loaded && this.options.soundVolume != 0.0F) { -- SoundPoolEntry var7 = this.soundPoolSounds.getRandomSoundFromSoundPool(var1); -- if(var7 != null && var5 > 0.0F) { -- this.latestSoundID = (this.latestSoundID + 1) % 256; -- String var8 = "sound_" + this.latestSoundID; -- float var9 = 16.0F; -- if(var5 > 1.0F) { -- var9 *= var5; -- } -- -- this.b.newSource(var5 > 1.0F, var8, var7.getSoundUrl(), var7.getSoundName(), false, var2, var3, var4, 2, var9); -- if(var5 > 1.0F) { -- var5 = 1.0F; -- } -- -- this.b.setPitch(var8, var6); -- this.b.setVolume(var8, var5 * this.options.soundVolume); -- this.b.play(var8); -- } -- -- } -- } -- -- public void playSoundFX(String var1, float var2, float var3) { -- if(this.loaded && this.options.soundVolume != 0.0F) { -- SoundPoolEntry var4 = this.soundPoolSounds.getRandomSoundFromSoundPool(var1); -- if(var4 != null && var2 > 0.0F) { -- this.latestSoundID = (this.latestSoundID + 1) % 256; -- String var5 = "sound_" + this.latestSoundID; -- this.b.newSource(false, var5, var4.getSoundUrl(), var4.getSoundName(), false, 0.0F, 0.0F, 0.0F, 0, 0.0F); -- if(var2 > 1.0F) { -- var2 = 1.0F; -- } -- -- var2 *= 0.25F; -- this.b.setPitch(var5, var3); -- this.b.setVolume(var5, var2 * this.options.soundVolume); -- this.b.play(var5); -- } -- -- } -- } -- -+ } -+ } -+ } -+ } -+ -+ // Spout Start -+ /** -+ * Plays a sound. Args: soundName, x, y, z, volume, pitch -+ * calls upon the replacement method so the original calls function properly. -+ */ -+ public void playSound(String s, float f, float f1, float f2, float f3, float f4) { -+ playSound(s, f, f1, f2, f3, f4, -1, 1.0F); -+ } -+ -+ /** -+ * Replaces the original playSound method -+ * @param s - effect name. -+ * @param f - x -+ * @param f1 - y -+ * @param f2 - z -+ * @param f3 - pitch -+ * @param f4 - distance -+ * @param variationId - variation of the sound effect. Set to -1 to select a random variation or if no variations exist -+ * @param volume - volume -+ */ -+ public void playSound(String s, float f, float f1, float f2, float f3, float f4, int variationId, float volume) { -+ if (!loaded || options.soundVolume == 0.0F) { -+ return; -+ } -+ -+ if (soundEffectsLimit-- <= 0) { -+ return; -+ } -+ -+ SoundPoolEntry soundpoolentry; -+ -+ if (variationId > -1) { -+ soundpoolentry = soundPoolSounds.getSoundFromSoundPool(s, variationId); -+ } else { -+ soundpoolentry = soundPoolSounds.getRandomSoundFromSoundPool(s); -+ } -+ -+ if (soundpoolentry != null && f3 > 0.0F) { -+ latestSoundID = (latestSoundID + 1) % 256; -+ String s1; -+ -+ if (variationId == -1) { -+ s1 = (new StringBuilder()).append("sound_").append(latestSoundID).toString(); -+ } else { -+ s1 = (new StringBuilder()).append("sound_").append(variationId).toString(); -+ } -+ -+ float f5 = 16F; -+ if (f3 > 1.0F){ -+ f5 *= f3; -+ } -+ this.sndSystem.newSource(f3 > 1.0F, s1, soundpoolentry.getSoundUrl(), soundpoolentry.getSoundName(), false, f, f1, f2, 2, f5); -+ this.sndSystem.setPitch(s1, f4); -+ if (f3 > 1.0F) { -+ f3 = 1.0F; -+ } -+ f3 *= volume; -+ this.sndSystem.setVolume(s1, f3 * options.soundVolume); -+ this.sndSystem.play(s1); -+ } -+ } -+ -+ /** -+ * Plays a sound effect with the volume and pitch of the parameters passed. The sound isn't affected by position of the -+ * player (full volume and center balanced) -+ */ -+ public void playSoundFX(String s, float f, float f1) { -+ playSoundFX(s, f, f1, -1, 1.0F); -+ } -+ -+ public void playSoundFX(String s, float f, float f1, int soundId, float volume) { -+ if (!loaded || options.soundVolume == 0.0F) { -+ return; -+ } -+ if (soundEffectsLimit-- <= 0) { -+ return; -+ } -+ SoundPoolEntry soundpoolentry = soundPoolSounds.getRandomSoundFromSoundPool(s); -+ if (soundpoolentry != null) { -+ latestSoundID = (latestSoundID + 1) % 256; -+ String s1; -+ -+ if (soundId == -1) { -+ s1 = (new StringBuilder()).append("sound_").append(latestSoundID).toString(); -+ } else { -+ s1 = (new StringBuilder()).append("sound_").append(soundId).toString(); -+ } -+ sndSystem.newSource(false, s1, soundpoolentry.getSoundUrl(), soundpoolentry.getSoundName(), false, 0.0F, 0.0F, 0.0F, 0, 0.0F); -+ if (f > 1.0F) { -+ f = 1.0F; -+ } -+ f *= 0.25F; -+ f *= volume; -+ this.sndSystem.setPitch(s1, f1); -+ this.sndSystem.setVolume(s1, f * options.soundVolume); -+ this.sndSystem.play(s1); -+ } -+ } -+ -+ public void playMusic(String music, int id, float volume) { -+ playMusic(music, id, 0, 0, 0, volume, 0F); -+ } -+ -+ public void playMusic(String music, int id, int x, int y, int z, float volume, float distance) { -+ if (!loaded || options.musicVolume == 0.0F) { -+ return; -+ } -+ stopMusic(); -+ -+ SoundPoolEntry soundpoolentry = soundPoolMusic.getSoundFromSoundPool(music, id); -+ if (soundpoolentry != null) { -+ ticksBeforeMusic = rand.nextInt(12000) + 12000; -+ -+ if (distance > 0F) { -+ this.sndSystem.removeSource("BgMusic"); -+ this.sndSystem.newStreamingSource(false, "BgMusic", soundpoolentry.getSoundUrl(), soundpoolentry.getSoundName(), false, x, y, z, 2, distance); -+ } else { -+ this.sndSystem.backgroundMusic("BgMusic", soundpoolentry.getSoundUrl(), soundpoolentry.getSoundName(), false); -+ } -+ this.sndSystem.setVolume("BgMusic", options.musicVolume * volume); -+ this.sndSystem.play("BgMusic"); -+ } -+ } -+ -+ public void playCustomSoundEffect(String effect, float volume) { -+ playCustomSoundEffect(effect, 0, 0, 0, volume, 0F); -+ } -+ -+ public void playCustomSoundEffect(String music, int x, int y, int z, float volume, float distance) { -+ if (!loaded || options.soundVolume == 0.0F) { -+ return; -+ } -+ -+ if (soundEffectsLimit-- <= 0) { -+ return; -+ } -+ -+ SoundPoolEntry soundpoolentry = soundPoolSounds.getRandomSoundFromSoundPool(music); -+ if (soundpoolentry != null) { -+ String source; -+ if (distance > 0F) { -+ source = sndSystem.quickStream(false, soundpoolentry.getSoundUrl(), soundpoolentry.getSoundName(), false, x, y, z, 2, distance); -+ } else { -+ source = sndSystem.quickStream(false, soundpoolentry.getSoundUrl(), soundpoolentry.getSoundName(), false, 0.0F, 0.0F, 0.0F, 0, 0.0F); -+ } -+ this.sndSystem.setVolume(source, volume * options.soundVolume); -+ this.sndSystem.play(source); -+ } -+ } -+ -+ public void preload(String music) { -+ sndSystem.loadSound(music); -+ } -+ -+ public boolean hasMusic(String sound, int id) { -+ return soundPoolMusic.getSoundFromSoundPool(sound, id) != null; -+ } -+ -+ public boolean hasSoundEffect(String sound, int id) { -+ return soundPoolSounds.getSoundFromSoundPool(sound, id) != null; -+ } -+ -+ public void addCustomSoundEffect(String sound, File song) { -+ soundPoolSounds.addCustomSound(sound, song); -+ } -+ -+ public void addCustomMusic(String sound, File song) { -+ soundPoolMusic.addCustomSound(sound, song); -+ } -+ -+ public void stopMusic() { -+ if (this.sndSystem != null) { -+ if (this.sndSystem.playing("BgMusic")) { -+ this.sndSystem.stop("BgMusic"); -+ } -+ -+ if (this.sndSystem.playing("streaming")) { -+ this.sndSystem.stop("streaming"); -+ } -+ } -+ } -+ -+ public void fadeOut(int time) { -+ if (this.sndSystem.playing("BgMusic")) { -+ this.sndSystem.fadeOut("BgMusic", null, time); -+ } -+ -+ if (this.sndSystem.playing("streaming")){ -+ this.sndSystem.fadeOut("streaming", null, time); -+ } -+ } -+ -+ public void resetTime() { -+ ticksBeforeMusic = rand.nextInt(12000) + 12000; -+ } -+ -+ public void tick() { -+ soundEffectsLimit = SOUND_EFFECTS_PER_TICK; -+ } -+ -+ public SoundPoolEntry waitingSound = null; -+ public boolean allowed = false; -+ public boolean cancelled = false; -+ // Spout End -+ -+ /** -+ * Pauses all currently playing sounds -+ */ - public void pauseAllSounds() { -- Iterator var1 = this.j.iterator(); -+ Iterator var1 = this.playingSounds.iterator(); - -- while(var1.hasNext()) { -+ while (var1.hasNext()) { - String var2 = (String)var1.next(); -- this.b.pause(var2); -+ this.sndSystem.pause(var2); - } -- - } - -+ /** -+ * Resumes playing all currently playing sounds (after pauseAllSounds) -+ */ - public void resumeAllSounds() { -- Iterator var1 = this.j.iterator(); -+ Iterator var1 = this.playingSounds.iterator(); - -- while(var1.hasNext()) { -+ while (var1.hasNext()) { - String var2 = (String)var1.next(); -- this.b.play(var2); -+ this.sndSystem.play(var2); - } -- - } - - public void func_92071_g() { -- if(!this.k.isEmpty()) { -- Iterator var1 = this.k.iterator(); -+ if (!this.field_92072_h.isEmpty()) { -+ Iterator var1 = this.field_92072_h.iterator(); - -- while(var1.hasNext()) { -+ while (var1.hasNext()) { - ScheduledSound var2 = (ScheduledSound)var1.next(); - --var2.field_92064_g; -- if(var2.field_92064_g <= 0) { -- this.playSound(var2.a, var2.field_92067_b, var2.field_92068_c, var2.field_92065_d, var2.field_92066_e, var2.field_92063_f); -+ -+ if (var2.field_92064_g <= 0) { -+ this.playSound(var2.field_92069_a, var2.field_92067_b, var2.field_92068_c, var2.field_92065_d, var2.field_92066_e, var2.field_92063_f); - var1.remove(); - } - } -- - } - } - -- public void func_92070_a(String var1, float var2, float var3, float var4, float var5, float var6, int var7) { -- this.k.add(new ScheduledSound(var1, var2, var3, var4, var5, var6, var7)); -- } -- -- static SoundSystem func_130080_a(SoundManager var0, SoundSystem var1) { -- return var0.b = var1; -- } -- -- static boolean func_130082_a(SoundManager var0, boolean var1) { -- return var0.loaded = var1; -+ public void func_92070_a(String par1Str, float par2, float par3, float par4, float par5, float par6, int par7) { -+ this.field_92072_h.add(new ScheduledSound(par1Str, par2, par3, par4, par5, par6, par7)); -+ } -+ -+ static SoundSystem func_130080_a(SoundManager par0SoundManager, SoundSystem par1SoundSystem) { -+ return par0SoundManager.sndSystem = par1SoundSystem; -+ } -+ -+ static boolean func_130082_a(SoundManager par0SoundManager, boolean par1) { -+ return par0SoundManager.loaded = par1; - } - } ---- net/minecraft/src/GuiFurnace.java -+++ net/minecraft/src/GuiFurnace.java -@@ -6,25 +6,32 @@ - private static final ResourceLocation furnaceGuiTextures = new ResourceLocation("textures/gui/container/furnace.png"); - private TileEntityFurnace furnaceInventory; - -- public GuiFurnace(InventoryPlayer var1, TileEntityFurnace var2) { -- super(new ContainerFurnace(var1, var2)); -- this.furnaceInventory = var2; -+ public GuiFurnace(InventoryPlayer par1InventoryPlayer, TileEntityFurnace par2TileEntityFurnace) { -+ super(new ContainerFurnace(par1InventoryPlayer, par2TileEntityFurnace)); -+ this.furnaceInventory = par2TileEntityFurnace; - } - -- protected void drawGuiContainerForegroundLayer(int var1, int var2) { -+ /** -+ * Draw the foreground layer for the GuiContainer (everything in front of the items) -+ */ -+ protected void drawGuiContainerForegroundLayer(int par1, int par2) { - String var3 = this.furnaceInventory.isInvNameLocalized() ? this.furnaceInventory.getInvName() : I18n.getString(this.furnaceInventory.getInvName()); - this.fontRenderer.drawString(var3, this.xSize / 2 - this.fontRenderer.getStringWidth(var3) / 2, 6, 4210752); - this.fontRenderer.drawString(I18n.getString("container.inventory"), 8, this.ySize - 96 + 2, 4210752); - } - -- protected void drawGuiContainerBackgroundLayer(float var1, int var2, int var3) { -+ /** -+ * Draw the background layer for the GuiContainer (everything behind the items) -+ */ -+ protected void drawGuiContainerBackgroundLayer(float par1, int par2, int par3) { - GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - this.mc.getTextureManager().bindTexture(furnaceGuiTextures); - int var4 = (this.width - this.xSize) / 2; - int var5 = (this.height - this.ySize) / 2; - this.drawTexturedModalRect(var4, var5, 0, 0, this.xSize, this.ySize); - int var6; -- if(this.furnaceInventory.isBurning()) { -+ -+ if (this.furnaceInventory.isBurning()) { - var6 = this.furnaceInventory.getBurnTimeRemainingScaled(12); - this.drawTexturedModalRect(var4 + 56, var5 + 36 + 12 - var6, 176, 12 - var6, 14, var6 + 2); - } ---- net/minecraft/src/FontMetadataSection.java -+++ net/minecraft/src/FontMetadataSection.java -@@ -5,9 +5,9 @@ - private final float[] charLefts; - private final float[] charSpacings; - -- public FontMetadataSection(float[] var1, float[] var2, float[] var3) { -- this.charWidths = var1; -- this.charLefts = var2; -- this.charSpacings = var3; -+ public FontMetadataSection(float[] par1ArrayOfFloat, float[] par2ArrayOfFloat, float[] par3ArrayOfFloat) { -+ this.charWidths = par1ArrayOfFloat; -+ this.charLefts = par2ArrayOfFloat; -+ this.charSpacings = par3ArrayOfFloat; - } - } ---- /dev/null -+++ com/prupe/mcpatcher/TexturePackChangeHandler$1.java -@@ -1,0 +1,9 @@ -+package com.prupe.mcpatcher; -+ -+import java.util.Comparator; -+ -+final class TexturePackChangeHandler$1 implements Comparator { -+ public int compare(TexturePackChangeHandler o1, TexturePackChangeHandler o2) { -+ return o1.order - o2.order; -+ } -+} ---- net/minecraft/src/StructureStart.java -+++ net/minecraft/src/StructureStart.java -@@ -5,17 +5,18 @@ - import java.util.Random; - - public abstract class StructureStart { -- protected LinkedList a = new LinkedList(); -+ -+ /** List of all StructureComponents that are part of this structure */ -+ protected LinkedList components = new LinkedList(); - protected StructureBoundingBox boundingBox; - private int field_143024_c; - private int field_143023_d; - -- public StructureStart() { -- } -+ public StructureStart() {} - -- public StructureStart(int var1, int var2) { -- this.field_143024_c = var1; -- this.field_143023_d = var2; -+ public StructureStart(int par1, int par2) { -+ this.field_143024_c = par1; -+ this.field_143023_d = par2; - } - - public StructureBoundingBox getBoundingBox() { -@@ -23,42 +24,47 @@ - } - - public LinkedList getComponents() { -- return this.a; -+ return this.components; - } - -- public void generateStructure(World var1, Random var2, StructureBoundingBox var3) { -- Iterator var4 = this.a.iterator(); -+ /** -+ * Keeps iterating Structure Pieces and spawning them until the checks tell it to stop -+ */ -+ public void generateStructure(World par1World, Random par2Random, StructureBoundingBox par3StructureBoundingBox) { -+ Iterator var4 = this.components.iterator(); - -- while(var4.hasNext()) { -+ while (var4.hasNext()) { - StructureComponent var5 = (StructureComponent)var4.next(); -- if(var5.getBoundingBox().intersectsWith(var3) && !var5.addComponentParts(var1, var2, var3)) { -+ -+ if (var5.getBoundingBox().intersectsWith(par3StructureBoundingBox) && !var5.addComponentParts(par1World, par2Random, par3StructureBoundingBox)) { - var4.remove(); - } - } -- - } - -+ /** -+ * Calculates total bounding box based on components' bounding boxes and saves it to boundingBox -+ */ - protected void updateBoundingBox() { - this.boundingBox = StructureBoundingBox.getNewBoundingBox(); -- Iterator var1 = this.a.iterator(); -+ Iterator var1 = this.components.iterator(); - -- while(var1.hasNext()) { -+ while (var1.hasNext()) { - StructureComponent var2 = (StructureComponent)var1.next(); - this.boundingBox.expandTo(var2.getBoundingBox()); - } -- - } - -- public NBTTagCompound func_143021_a(int var1, int var2) { -+ public NBTTagCompound func_143021_a(int par1, int par2) { - NBTTagCompound var3 = new NBTTagCompound(); - var3.setString("id", MapGenStructureIO.func_143033_a(this)); -- var3.setInteger("ChunkX", var1); -- var3.setInteger("ChunkZ", var2); -+ var3.setInteger("ChunkX", par1); -+ var3.setInteger("ChunkZ", par2); - var3.setTag("BB", this.boundingBox.func_143047_a("BB")); - NBTTagList var4 = new NBTTagList("Children"); -- Iterator var5 = this.a.iterator(); -+ Iterator var5 = this.components.iterator(); - -- while(var5.hasNext()) { -+ while (var5.hasNext()) { - StructureComponent var6 = (StructureComponent)var5.next(); - var4.appendTag(var6.func_143010_b()); - } -@@ -68,67 +74,72 @@ - return var3; - } - -- public void func_143022_a(NBTTagCompound var1) { -- } -- -- public void func_143020_a(World var1, NBTTagCompound var2) { -- this.field_143024_c = var2.getInteger("ChunkX"); -- this.field_143023_d = var2.getInteger("ChunkZ"); -- if(var2.hasKey("BB")) { -- this.boundingBox = new StructureBoundingBox(var2.getIntArray("BB")); -- } -- -- NBTTagList var3 = var2.getTagList("Children"); -- -- for(int var4 = 0; var4 < var3.tagCount(); ++var4) { -- this.a.add(MapGenStructureIO.func_143032_b((NBTTagCompound)var3.tagAt(var4), var1)); -- } -- -- this.func_143017_b(var2); -- } -- -- public void func_143017_b(NBTTagCompound var1) { -- } -- -- protected void markAvailableHeight(World var1, Random var2, int var3) { -- int var4 = 63 - var3; -+ public void func_143022_a(NBTTagCompound par1NBTTagCompound) {} -+ -+ public void func_143020_a(World par1World, NBTTagCompound par2NBTTagCompound) { -+ this.field_143024_c = par2NBTTagCompound.getInteger("ChunkX"); -+ this.field_143023_d = par2NBTTagCompound.getInteger("ChunkZ"); -+ -+ if (par2NBTTagCompound.hasKey("BB")) { -+ this.boundingBox = new StructureBoundingBox(par2NBTTagCompound.getIntArray("BB")); -+ } -+ -+ NBTTagList var3 = par2NBTTagCompound.getTagList("Children"); -+ -+ for (int var4 = 0; var4 < var3.tagCount(); ++var4) { -+ this.components.add(MapGenStructureIO.func_143032_b((NBTTagCompound)var3.tagAt(var4), par1World)); -+ } -+ -+ this.func_143017_b(par2NBTTagCompound); -+ } -+ -+ public void func_143017_b(NBTTagCompound par1NBTTagCompound) {} -+ -+ /** -+ * offsets the structure Bounding Boxes up to a certain height, typically 63 - 10 -+ */ -+ protected void markAvailableHeight(World par1World, Random par2Random, int par3) { -+ int var4 = 63 - par3; - int var5 = this.boundingBox.getYSize() + 1; -- if(var5 < var4) { -- var5 += var2.nextInt(var4 - var5); -+ -+ if (var5 < var4) { -+ var5 += par2Random.nextInt(var4 - var5); - } - - int var6 = var5 - this.boundingBox.maxY; - this.boundingBox.offset(0, var6, 0); -- Iterator var7 = this.a.iterator(); -+ Iterator var7 = this.components.iterator(); - -- while(var7.hasNext()) { -+ while (var7.hasNext()) { - StructureComponent var8 = (StructureComponent)var7.next(); - var8.getBoundingBox().offset(0, var6, 0); - } -- - } - -- protected void setRandomHeight(World var1, Random var2, int var3, int var4) { -- int var5 = var4 - var3 + 1 - this.boundingBox.getYSize(); -+ protected void setRandomHeight(World par1World, Random par2Random, int par3, int par4) { -+ int var5 = par4 - par3 + 1 - this.boundingBox.getYSize(); - boolean var6 = true; - int var10; -- if(var5 > 1) { -- var10 = var3 + var2.nextInt(var5); -+ -+ if (var5 > 1) { -+ var10 = par3 + par2Random.nextInt(var5); - } else { -- var10 = var3; -+ var10 = par3; - } - - int var7 = var10 - this.boundingBox.minY; - this.boundingBox.offset(0, var7, 0); -- Iterator var8 = this.a.iterator(); -+ Iterator var8 = this.components.iterator(); - -- while(var8.hasNext()) { -+ while (var8.hasNext()) { - StructureComponent var9 = (StructureComponent)var8.next(); - var9.getBoundingBox().offset(0, var7, 0); - } -- - } - -+ /** -+ * currently only defined for Villages, returns true if Village has more than 2 non-road components -+ */ - public boolean isSizeableStructure() { - return true; - } ---- /dev/null -+++ org/spoutcraft/client/gui/UpdatingComboBox.java -@@ -1,0 +1,39 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.client.gui; -+ -+import org.spoutcraft.api.gui.GenericComboBox; -+ -+public class UpdatingComboBox extends GenericComboBox { -+ private ButtonUpdater updater = null; -+ -+ public ButtonUpdater getUpdater() { -+ return updater; -+ } -+ -+ public void setUpdater(ButtonUpdater updater) { -+ this.updater = updater; -+ } -+ -+ @Override -+ public void onSelectionChanged(int i, String text) { -+ getUpdater().updateButtons(); -+ } -+} ---- net/minecraft/src/EntityWolf.java -+++ net/minecraft/src/EntityWolf.java -@@ -1,15 +1,22 @@ - package net.minecraft.src; - - public class EntityWolf extends EntityTameable { -+ // ToDO: Need Spoutcraft API Texture Override abilities. - private float field_70926_e; - private float field_70924_f; -+ -+ /** true is the wolf is wet else false */ - private boolean isShaking; - private boolean field_70928_h; -+ -+ /** -+ * This time increases while wolf is shaking and emitting water particles. -+ */ - private float timeWolfIsShaking; - private float prevTimeWolfIsShaking; - -- public EntityWolf(World var1) { -- super(var1); -+ public EntityWolf(World par1World) { -+ super(par1World); - this.setSize(0.6F, 0.8F); - this.getNavigator().setAvoidsWater(true); - this.tasks.addTask(1, new EntityAISwimming(this)); -@@ -31,29 +38,38 @@ - - protected void applyEntityAttributes() { - super.applyEntityAttributes(); -- this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setAttribute((double)0.3F); -- if(this.isTamed()) { -+ this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setAttribute(0.30000001192092896D); -+ -+ if (this.isTamed()) { - this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setAttribute(20.0D); - } else { - this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setAttribute(8.0D); - } -- - } - -+ /** -+ * Returns true if the newer Entity AI code should be run -+ */ - public boolean isAIEnabled() { - return true; - } - -- public void setAttackTarget(EntityLivingBase var1) { -- super.setAttackTarget(var1); -- if(var1 == null) { -+ /** -+ * Sets the active target the Task system uses for tracking -+ */ -+ public void setAttackTarget(EntityLivingBase par1EntityLivingBase) { -+ super.setAttackTarget(par1EntityLivingBase); -+ -+ if (par1EntityLivingBase == null) { - this.setAngry(false); -- } else if(!this.isTamed()) { -+ } else if (!this.isTamed()) { - this.setAngry(true); - } -- - } - -+ /** -+ * main AI tick function, replaces updateEntityActionState -+ */ - protected void updateAITick() { - this.dataWatcher.updateObject(18, Float.valueOf(this.getHealth())); - } -@@ -65,186 +81,238 @@ - this.dataWatcher.addObject(20, new Byte((byte)BlockColored.getBlockFromDye(1))); - } - -- protected void playStepSound(int var1, int var2, int var3, int var4) { -+ /** -+ * Plays step sound at given x, y, z for the entity -+ */ -+ protected void playStepSound(int par1, int par2, int par3, int par4) { - this.playSound("mob.wolf.step", 0.15F, 1.0F); - } - -- public void writeEntityToNBT(NBTTagCompound var1) { -- super.writeEntityToNBT(var1); -- var1.setBoolean("Angry", this.isAngry()); -- var1.setByte("CollarColor", (byte)this.getCollarColor()); -+ /** -+ * (abstract) Protected helper method to write subclass entity data to NBT. -+ */ -+ public void writeEntityToNBT(NBTTagCompound par1NBTTagCompound) { -+ super.writeEntityToNBT(par1NBTTagCompound); -+ par1NBTTagCompound.setBoolean("Angry", this.isAngry()); -+ par1NBTTagCompound.setByte("CollarColor", (byte)this.getCollarColor()); - } - -- public void readEntityFromNBT(NBTTagCompound var1) { -- super.readEntityFromNBT(var1); -- this.setAngry(var1.getBoolean("Angry")); -- if(var1.hasKey("CollarColor")) { -- this.setCollarColor(var1.getByte("CollarColor")); -+ /** -+ * (abstract) Protected helper method to read subclass entity data from NBT. -+ */ -+ public void readEntityFromNBT(NBTTagCompound par1NBTTagCompound) { -+ super.readEntityFromNBT(par1NBTTagCompound); -+ this.setAngry(par1NBTTagCompound.getBoolean("Angry")); -+ -+ if (par1NBTTagCompound.hasKey("CollarColor")) { -+ this.setCollarColor(par1NBTTagCompound.getByte("CollarColor")); - } -- - } - -+ /** -+ * Returns the sound this mob makes while it's alive. -+ */ - protected String getLivingSound() { -- return this.isAngry() ? "mob.wolf.growl" : (this.ab.nextInt(3) == 0 ? (this.isTamed() && this.dataWatcher.getWatchableObjectFloat(18) < 10.0F ? "mob.wolf.whine" : "mob.wolf.panting") : "mob.wolf.bark"); -+ return this.isAngry() ? "mob.wolf.growl" : (this.rand.nextInt(3) == 0 ? (this.isTamed() && this.dataWatcher.getWatchableObjectFloat(18) < 10.0F ? "mob.wolf.whine" : "mob.wolf.panting") : "mob.wolf.bark"); - } - -+ /** -+ * Returns the sound this mob makes when it is hurt. -+ */ - protected String getHurtSound() { - return "mob.wolf.hurt"; - } - -+ /** -+ * Returns the sound this mob makes on death. -+ */ - protected String getDeathSound() { - return "mob.wolf.death"; - } - -+ /** -+ * Returns the volume for the sounds this mob makes. -+ */ - protected float getSoundVolume() { - return 0.4F; - } - -+ /** -+ * Returns the item ID for the item the mob drops on death. -+ */ - protected int getDropItemId() { - return -1; - } - -+ /** -+ * Called frequently so the entity can update its state every tick as required. For example, zombies and skeletons use -+ * this to react to sunlight and start to burn. -+ */ - public void onLivingUpdate() { - super.onLivingUpdate(); -- if(!this.worldObj.isRemote && this.isShaking && !this.field_70928_h && !this.hasPath() && this.onGround) { -+ -+ if (!this.worldObj.isRemote && this.isShaking && !this.field_70928_h && !this.hasPath() && this.onGround) { - this.field_70928_h = true; - this.timeWolfIsShaking = 0.0F; - this.prevTimeWolfIsShaking = 0.0F; - this.worldObj.setEntityState(this, (byte)8); - } -- - } - -+ /** -+ * Called to update the entity's position/logic. -+ */ - public void onUpdate() { - super.onUpdate(); - this.field_70924_f = this.field_70926_e; -- if(this.func_70922_bv()) { -+ -+ if (this.func_70922_bv()) { - this.field_70926_e += (1.0F - this.field_70926_e) * 0.4F; - } else { - this.field_70926_e += (0.0F - this.field_70926_e) * 0.4F; - } - -- if(this.func_70922_bv()) { -+ if (this.func_70922_bv()) { - this.numTicksToChaseTarget = 10; - } - -- if(this.isWet()) { -+ if (this.isWet()) { - this.isShaking = true; - this.field_70928_h = false; - this.timeWolfIsShaking = 0.0F; - this.prevTimeWolfIsShaking = 0.0F; -- } else if((this.isShaking || this.field_70928_h) && this.field_70928_h) { -- if(this.timeWolfIsShaking == 0.0F) { -- this.playSound("mob.wolf.shake", this.getSoundVolume(), (this.ab.nextFloat() - this.ab.nextFloat()) * 0.2F + 1.0F); -+ } else if ((this.isShaking || this.field_70928_h) && this.field_70928_h) { -+ if (this.timeWolfIsShaking == 0.0F) { -+ this.playSound("mob.wolf.shake", this.getSoundVolume(), (this.rand.nextFloat() - this.rand.nextFloat()) * 0.2F + 1.0F); - } - - this.prevTimeWolfIsShaking = this.timeWolfIsShaking; - this.timeWolfIsShaking += 0.05F; -- if(this.prevTimeWolfIsShaking >= 2.0F) { -+ -+ if (this.prevTimeWolfIsShaking >= 2.0F) { - this.isShaking = false; - this.field_70928_h = false; - this.prevTimeWolfIsShaking = 0.0F; - this.timeWolfIsShaking = 0.0F; - } - -- if(this.timeWolfIsShaking > 0.4F) { -+ if (this.timeWolfIsShaking > 0.4F) { - float var1 = (float)this.boundingBox.minY; - int var2 = (int)(MathHelper.sin((this.timeWolfIsShaking - 0.4F) * (float)Math.PI) * 7.0F); - -- for(int var3 = 0; var3 < var2; ++var3) { -- float var4 = (this.ab.nextFloat() * 2.0F - 1.0F) * this.width * 0.5F; -- float var5 = (this.ab.nextFloat() * 2.0F - 1.0F) * this.width * 0.5F; -+ for (int var3 = 0; var3 < var2; ++var3) { -+ float var4 = (this.rand.nextFloat() * 2.0F - 1.0F) * this.width * 0.5F; -+ float var5 = (this.rand.nextFloat() * 2.0F - 1.0F) * this.width * 0.5F; - this.worldObj.spawnParticle("splash", this.posX + (double)var4, (double)(var1 + 0.8F), this.posZ + (double)var5, this.motionX, this.motionY, this.motionZ); - } - } - } -- - } - - public boolean getWolfShaking() { - return this.isShaking; - } - -- public float getShadingWhileShaking(float var1) { -- return 12.0F / 16.0F + (this.prevTimeWolfIsShaking + (this.timeWolfIsShaking - this.prevTimeWolfIsShaking) * var1) / 2.0F * 0.25F; -+ /** -+ * Used when calculating the amount of shading to apply while the wolf is shaking. -+ */ -+ public float getShadingWhileShaking(float par1) { -+ return 0.75F + (this.prevTimeWolfIsShaking + (this.timeWolfIsShaking - this.prevTimeWolfIsShaking) * par1) / 2.0F * 0.25F; - } - -- public float getShakeAngle(float var1, float var2) { -- float var3 = (this.prevTimeWolfIsShaking + (this.timeWolfIsShaking - this.prevTimeWolfIsShaking) * var1 + var2) / 1.8F; -- if(var3 < 0.0F) { -+ public float getShakeAngle(float par1, float par2) { -+ float var3 = (this.prevTimeWolfIsShaking + (this.timeWolfIsShaking - this.prevTimeWolfIsShaking) * par1 + par2) / 1.8F; -+ -+ if (var3 < 0.0F) { - var3 = 0.0F; -- } else if(var3 > 1.0F) { -+ } else if (var3 > 1.0F) { - var3 = 1.0F; - } - - return MathHelper.sin(var3 * (float)Math.PI) * MathHelper.sin(var3 * (float)Math.PI * 11.0F) * 0.15F * (float)Math.PI; - } - -- public float getInterestedAngle(float var1) { -- return (this.field_70924_f + (this.field_70926_e - this.field_70924_f) * var1) * 0.15F * (float)Math.PI; -+ public float getInterestedAngle(float par1) { -+ return (this.field_70924_f + (this.field_70926_e - this.field_70924_f) * par1) * 0.15F * (float)Math.PI; - } - - public float getEyeHeight() { - return this.height * 0.8F; - } - -+ /** -+ * The speed it takes to move the entityliving's rotationPitch through the faceEntity method. This is only currently -+ * use in wolves. -+ */ - public int getVerticalFaceSpeed() { - return this.isSitting() ? 20 : super.getVerticalFaceSpeed(); - } - -- public boolean attackEntityFrom(DamageSource var1, float var2) { -- if(this.isEntityInvulnerable()) { -+ /** -+ * Called when the entity is attacked. -+ */ -+ public boolean attackEntityFrom(DamageSource par1DamageSource, float par2) { -+ if (this.isEntityInvulnerable()) { - return false; - } else { -- Entity var3 = var1.getEntity(); -+ Entity var3 = par1DamageSource.getEntity(); - this.aiSit.setSitting(false); -- if(var3 != null && !(var3 instanceof EntityPlayer) && !(var3 instanceof EntityArrow)) { -- var2 = (var2 + 1.0F) / 2.0F; -+ -+ if (var3 != null && !(var3 instanceof EntityPlayer) && !(var3 instanceof EntityArrow)) { -+ par2 = (par2 + 1.0F) / 2.0F; - } - -- return super.attackEntityFrom(var1, var2); -+ return super.attackEntityFrom(par1DamageSource, par2); - } - } - -- public boolean attackEntityAsMob(Entity var1) { -+ public boolean attackEntityAsMob(Entity par1Entity) { - int var2 = this.isTamed() ? 4 : 2; -- return var1.attackEntityFrom(DamageSource.causeMobDamage(this), (float)var2); -+ return par1Entity.attackEntityFrom(DamageSource.causeMobDamage(this), (float)var2); - } - -- public void setTamed(boolean var1) { -- super.setTamed(var1); -- if(var1) { -+ public void setTamed(boolean par1) { -+ super.setTamed(par1); -+ -+ if (par1) { - this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setAttribute(20.0D); - } else { - this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setAttribute(8.0D); - } -- - } - -- public boolean interact(EntityPlayer var1) { -- ItemStack var2 = var1.inventory.getCurrentItem(); -- if(this.isTamed()) { -- if(var2 != null) { -- if(Item.itemsList[var2.itemID] instanceof ItemFood) { -+ /** -+ * Called when a player interacts with a mob. e.g. gets milk from a cow, gets into the saddle on a pig. -+ */ -+ public boolean interact(EntityPlayer par1EntityPlayer) { -+ ItemStack var2 = par1EntityPlayer.inventory.getCurrentItem(); -+ -+ if (this.isTamed()) { -+ if (var2 != null) { -+ if (Item.itemsList[var2.itemID] instanceof ItemFood) { - ItemFood var3 = (ItemFood)Item.itemsList[var2.itemID]; -- if(var3.isWolfsFavoriteMeat() && this.dataWatcher.getWatchableObjectFloat(18) < 20.0F) { -- if(!var1.capabilities.isCreativeMode) { -+ -+ if (var3.isWolfsFavoriteMeat() && this.dataWatcher.getWatchableObjectFloat(18) < 20.0F) { -+ if (!par1EntityPlayer.capabilities.isCreativeMode) { - --var2.stackSize; - } - - this.heal((float)var3.getHealAmount()); -- if(var2.stackSize <= 0) { -- var1.inventory.setInventorySlotContents(var1.inventory.currentItem, (ItemStack)null); -+ -+ if (var2.stackSize <= 0) { -+ par1EntityPlayer.inventory.setInventorySlotContents(par1EntityPlayer.inventory.currentItem, (ItemStack)null); - } - - return true; - } -- } else if(var2.itemID == Item.dyePowder.itemID) { -+ } else if (var2.itemID == Item.dyePowder.itemID) { - int var4 = BlockColored.getBlockFromDye(var2.getItemDamage()); -- if(var4 != this.getCollarColor()) { -+ -+ if (var4 != this.getCollarColor()) { - this.setCollarColor(var4); -- if(!var1.capabilities.isCreativeMode && --var2.stackSize <= 0) { -- var1.inventory.setInventorySlotContents(var1.inventory.currentItem, (ItemStack)null); -+ -+ if (!par1EntityPlayer.capabilities.isCreativeMode && --var2.stackSize <= 0) { -+ par1EntityPlayer.inventory.setInventorySlotContents(par1EntityPlayer.inventory.currentItem, (ItemStack)null); - } - - return true; -@@ -252,30 +320,30 @@ - } - } - -- if(var1.getCommandSenderName().equalsIgnoreCase(this.getOwnerName()) && !this.worldObj.isRemote && !this.isBreedingItem(var2)) { -+ if (par1EntityPlayer.getCommandSenderName().equalsIgnoreCase(this.getOwnerName()) && !this.worldObj.isRemote && !this.isBreedingItem(var2)) { - this.aiSit.setSitting(!this.isSitting()); - this.isJumping = false; - this.setPathToEntity((PathEntity)null); - this.setTarget((Entity)null); - this.setAttackTarget((EntityLivingBase)null); - } -- } else if(var2 != null && var2.itemID == Item.bone.itemID && !this.isAngry()) { -- if(!var1.capabilities.isCreativeMode) { -+ } else if (var2 != null && var2.itemID == Item.bone.itemID && !this.isAngry()) { -+ if (!par1EntityPlayer.capabilities.isCreativeMode) { - --var2.stackSize; - } - -- if(var2.stackSize <= 0) { -- var1.inventory.setInventorySlotContents(var1.inventory.currentItem, (ItemStack)null); -+ if (var2.stackSize <= 0) { -+ par1EntityPlayer.inventory.setInventorySlotContents(par1EntityPlayer.inventory.currentItem, (ItemStack)null); - } - -- if(!this.worldObj.isRemote) { -- if(this.ab.nextInt(3) == 0) { -+ if (!this.worldObj.isRemote) { -+ if (this.rand.nextInt(3) == 0) { - this.setTamed(true); - this.setPathToEntity((PathEntity)null); - this.setAttackTarget((EntityLivingBase)null); - this.aiSit.setSitting(true); - this.setHealth(20.0F); -- this.setOwner(var1.getCommandSenderName()); -+ this.setOwner(par1EntityPlayer.getCommandSenderName()); - this.playTameEffect(true); - this.worldObj.setEntityState(this, (byte)7); - } else { -@@ -287,58 +355,80 @@ - return true; - } - -- return super.interact(var1); -+ return super.interact(par1EntityPlayer); - } - -- public void handleHealthUpdate(byte var1) { -- if(var1 == 8) { -+ public void handleHealthUpdate(byte par1) { -+ if (par1 == 8) { - this.field_70928_h = true; - this.timeWolfIsShaking = 0.0F; - this.prevTimeWolfIsShaking = 0.0F; - } else { -- super.handleHealthUpdate(var1); -+ super.handleHealthUpdate(par1); - } -- - } - - public float getTailRotation() { -- return this.isAngry() ? (float)Math.PI * 0.49F : (this.isTamed() ? (0.55F - (20.0F - this.dataWatcher.getWatchableObjectFloat(18)) * 0.02F) * (float)Math.PI : (float)Math.PI * 0.2F); -- } -- -- public boolean isBreedingItem(ItemStack var1) { -- return var1 == null ? false : (!(Item.itemsList[var1.itemID] instanceof ItemFood) ? false : ((ItemFood)Item.itemsList[var1.itemID]).isWolfsFavoriteMeat()); -- } -- -+ return this.isAngry() ? 1.5393804F : (this.isTamed() ? (0.55F - (20.0F - this.dataWatcher.getWatchableObjectFloat(18)) * 0.02F) * (float)Math.PI : ((float)Math.PI / 5F)); -+ } -+ -+ /** -+ * Checks if the parameter is an item which this animal can be fed to breed it (wheat, carrots or seeds depending on -+ * the animal type) -+ */ -+ public boolean isBreedingItem(ItemStack par1ItemStack) { -+ return par1ItemStack == null ? false : (!(Item.itemsList[par1ItemStack.itemID] instanceof ItemFood) ? false : ((ItemFood)Item.itemsList[par1ItemStack.itemID]).isWolfsFavoriteMeat()); -+ } -+ -+ /** -+ * Will return how many at most can spawn in a chunk at once. -+ */ - public int getMaxSpawnedInChunk() { - return 8; - } - -+ /** -+ * Determines whether this wolf is angry or not. -+ */ - public boolean isAngry() { - return (this.dataWatcher.getWatchableObjectByte(16) & 2) != 0; - } - -- public void setAngry(boolean var1) { -+ /** -+ * Sets whether this wolf is angry or not. -+ */ -+ public void setAngry(boolean par1) { - byte var2 = this.dataWatcher.getWatchableObjectByte(16); -- if(var1) { -+ -+ if (par1) { - this.dataWatcher.updateObject(16, Byte.valueOf((byte)(var2 | 2))); - } else { - this.dataWatcher.updateObject(16, Byte.valueOf((byte)(var2 & -3))); - } -- - } - -+ /** -+ * Return this wolf's collar color. -+ */ - public int getCollarColor() { - return this.dataWatcher.getWatchableObjectByte(20) & 15; - } - -- public void setCollarColor(int var1) { -- this.dataWatcher.updateObject(20, Byte.valueOf((byte)(var1 & 15))); -+ /** -+ * Set this wolf's collar color. -+ */ -+ public void setCollarColor(int par1) { -+ this.dataWatcher.updateObject(20, Byte.valueOf((byte)(par1 & 15))); - } - -- public EntityWolf spawnBabyAnimal(EntityAgeable var1) { -+ /** -+ * This function is used when two same-species animals in 'love mode' breed to generate the new baby animal. -+ */ -+ public EntityWolf spawnBabyAnimal(EntityAgeable par1EntityAgeable) { - EntityWolf var2 = new EntityWolf(this.worldObj); - String var3 = this.getOwnerName(); -- if(var3 != null && var3.trim().length() > 0) { -+ -+ if (var3 != null && var3.trim().length() > 0) { - var2.setOwner(var3); - var2.setTamed(true); - } -@@ -346,24 +436,26 @@ - return var2; - } - -- public void func_70918_i(boolean var1) { -- if(var1) { -+ public void func_70918_i(boolean par1) { -+ if (par1) { - this.dataWatcher.updateObject(19, Byte.valueOf((byte)1)); - } else { - this.dataWatcher.updateObject(19, Byte.valueOf((byte)0)); - } -- - } - -- public boolean canMateWith(EntityAnimal var1) { -- if(var1 == this) { -- return false; -- } else if(!this.isTamed()) { -- return false; -- } else if(!(var1 instanceof EntityWolf)) { -+ /** -+ * Returns true if the mob is currently able to mate with the specified mob. -+ */ -+ public boolean canMateWith(EntityAnimal par1EntityAnimal) { -+ if (par1EntityAnimal == this) { -+ return false; -+ } else if (!this.isTamed()) { -+ return false; -+ } else if (!(par1EntityAnimal instanceof EntityWolf)) { - return false; - } else { -- EntityWolf var2 = (EntityWolf)var1; -+ EntityWolf var2 = (EntityWolf)par1EntityAnimal; - return !var2.isTamed() ? false : (var2.isSitting() ? false : this.isInLove() && var2.isInLove()); - } - } -@@ -372,26 +464,30 @@ - return this.dataWatcher.getWatchableObjectByte(19) == 1; - } - -+ /** -+ * Determines if an entity can be despawned, used on idle far away entities -+ */ - protected boolean canDespawn() { - return !this.isTamed() && this.ticksExisted > 2400; - } - -- public boolean func_142018_a(EntityLivingBase var1, EntityLivingBase var2) { -- if(!(var1 instanceof EntityCreeper) && !(var1 instanceof EntityGhast)) { -- if(var1 instanceof EntityWolf) { -- EntityWolf var3 = (EntityWolf)var1; -- if(var3.isTamed() && var3.func_130012_q() == var2) { -+ public boolean func_142018_a(EntityLivingBase par1EntityLivingBase, EntityLivingBase par2EntityLivingBase) { -+ if (!(par1EntityLivingBase instanceof EntityCreeper) && !(par1EntityLivingBase instanceof EntityGhast)) { -+ if (par1EntityLivingBase instanceof EntityWolf) { -+ EntityWolf var3 = (EntityWolf)par1EntityLivingBase; -+ -+ if (var3.isTamed() && var3.func_130012_q() == par2EntityLivingBase) { - return false; - } - } - -- return var1 instanceof EntityPlayer && var2 instanceof EntityPlayer && !((EntityPlayer)var2).canAttackPlayer((EntityPlayer)var1) ? false : !(var1 instanceof EntityHorse) || !((EntityHorse)var1).isTame(); -+ return par1EntityLivingBase instanceof EntityPlayer && par2EntityLivingBase instanceof EntityPlayer && !((EntityPlayer)par2EntityLivingBase).canAttackPlayer((EntityPlayer)par1EntityLivingBase) ? false : !(par1EntityLivingBase instanceof EntityHorse) || !((EntityHorse)par1EntityLivingBase).isTame(); - } else { - return false; - } - } - -- public EntityAgeable createChild(EntityAgeable var1) { -- return this.spawnBabyAnimal(var1); -+ public EntityAgeable createChild(EntityAgeable par1EntityAgeable) { -+ return this.spawnBabyAnimal(par1EntityAgeable); - } - } ---- /dev/null -+++ org/spoutcraft/api/gui/Scrollable.java -@@ -1,0 +1,114 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.api.gui; -+ -+import org.spoutcraft.api.UnsafeClass; -+ -+@UnsafeClass -+public interface Scrollable extends Control { -+ /** -+ * Renders the contents of the Scrollable. -+ * The viewport is already transformed and a matrix is pushed. -+ */ -+ public void renderContents(); -+ /** -+ * Gets the inner size for given axis, in pixels. -+ * @param axis of the size vector -+ * @return the size of the viewport on given axis -+ */ -+ public int getInnerSize(Orientation axis); -+ /** -+ * Gets the scroll position, in pixels. -+ * @param axis of the scroll vector -+ * @return the position of the viewport on given axis -+ */ -+ public int getScrollPosition(Orientation axis); -+ /** -+ * Sets the scroll position on the axis, in pixels. -+ * The allowed scroll amount ranges from 0 to getMaximumScrollPosition for given axis. -+ * @param axis the axis to scroll -+ * @param position the position of the viewport on given axis -+ */ -+ public void setScrollPosition(Orientation axis, int position); -+ /** -+ * Adds x and y to the Horizontal and Vertical scroll position. -+ * @param x -+ * @param y -+ */ -+ public void scroll(int x, int y); -+ -+ /** -+ * Adjusts the scroll position so that the given rectangle will fit into the viewport. -+ * If the given rect is too big, it will scroll to the x or y position of the rectangle. -+ * @param rect -+ */ -+ public void ensureVisible(Rectangle rect); -+ -+ /** -+ * Gets the maximum allowed scroll position. -+ * @param axis -+ * @return the maximum scroll position. Use the return value to scroll to the very bottom. -+ * @returns 0 if no scrolling is possible, that means the whole content would fit into the viewport. -+ */ -+ public int getMaximumScrollPosition(Orientation axis); -+ -+ /** -+ * Depending on the set ScrollBarPolicy, returns wether to show or not to show a scrollbar on the given axis -+ * @param axis to check if it should view a scrollbar -+ * @return if the scrollbar should be shown for that axis -+ */ -+ public boolean needsScrollBar(Orientation axis); -+ -+ /** -+ * Sets the scrollbar policy for the given axis -+ * @param axis -+ * @param policy -+ */ -+ public void setScrollBarPolicy(Orientation axis, ScrollBarPolicy policy); -+ -+ /** -+ * Gets the scrollbar policy for the given axis -+ * @param axis -+ * @return the scrollbar policy for the given axis -+ */ -+ public ScrollBarPolicy getScrollBarPolicy(Orientation axis); -+ -+ /** -+ * Gets the size of the rectangle inside the scrollable. This is usually getWidth/Height() - 16 when the corresponding scrollbar is visible. -+ * @param axis -+ * @return -+ */ -+ public int getViewportSize(Orientation axis); -+ -+ public int getMargin(PositionOrientation pos); -+ -+ /** -+ * Gets the background color of this list -+ * @return color -+ */ -+ public Color getBackgroundColor(); -+ -+ /** -+ * Sets the background color of this list -+ * @param color to set -+ * @return this -+ */ -+ public Scrollable setBackgroundColor(Color color); -+} ---- net/minecraft/src/ThreadLanServerFind.java -+++ net/minecraft/src/ThreadLanServerFind.java -@@ -7,28 +7,34 @@ - import java.net.SocketTimeoutException; - - public class ThreadLanServerFind extends Thread { -+ -+ /** The LanServerList */ - private final LanServerList localServerList; -- private final InetAddress b; -- private final MulticastSocket c; -- -- public ThreadLanServerFind(LanServerList var1) { -+ -+ /** InetAddress for 224.0.2.60 */ -+ private final InetAddress broadcastAddress; -+ -+ /** The socket we're using to receive packets on. */ -+ private final MulticastSocket socket; -+ -+ public ThreadLanServerFind(LanServerList par1LanServerList) throws IOException { - super("LanServerDetector"); -- this.localServerList = var1; -+ this.localServerList = par1LanServerList; - this.setDaemon(true); -- this.c = new MulticastSocket(4445); -- this.b = InetAddress.getByName("224.0.2.60"); -- this.c.setSoTimeout(5000); -- this.c.joinGroup(this.b); -+ this.socket = new MulticastSocket(4445); -+ this.broadcastAddress = InetAddress.getByName("224.0.2.60"); -+ this.socket.setSoTimeout(5000); -+ this.socket.joinGroup(this.broadcastAddress); - } - - public void run() { - byte[] var2 = new byte[1024]; - -- while(!this.isInterrupted()) { -+ while (!this.isInterrupted()) { - DatagramPacket var1 = new DatagramPacket(var2, var2.length); - - try { -- this.c.receive(var1); -+ this.socket.receive(var1); - } catch (SocketTimeoutException var5) { - continue; - } catch (IOException var6) { -@@ -42,10 +48,11 @@ - } - - try { -- this.c.leaveGroup(this.b); -+ this.socket.leaveGroup(this.broadcastAddress); - } catch (IOException var4) { -+ ; - } - -- this.c.close(); -+ this.socket.close(); - } - } ---- net/minecraft/src/ContainerHorseInventory.java -+++ net/minecraft/src/ContainerHorseInventory.java -@@ -4,63 +4,68 @@ - private IInventory field_111243_a; - private EntityHorse theHorse; - -- public ContainerHorseInventory(IInventory var1, IInventory var2, EntityHorse var3) { -- this.field_111243_a = var2; -- this.theHorse = var3; -+ public ContainerHorseInventory(IInventory par1IInventory, IInventory par2IInventory, EntityHorse par3EntityHorse) { -+ this.field_111243_a = par2IInventory; -+ this.theHorse = par3EntityHorse; - byte var4 = 3; -- var2.openChest(); -+ par2IInventory.openChest(); - int var5 = (var4 - 4) * 18; -- this.addSlotToContainer(new ContainerHorseInventorySlotSaddle(this, var2, 0, 8, 18)); -- this.addSlotToContainer(new ContainerHorseInventorySlotArmor(this, var2, 1, 8, 36, var3)); -+ this.addSlotToContainer(new ContainerHorseInventorySlotSaddle(this, par2IInventory, 0, 8, 18)); -+ this.addSlotToContainer(new ContainerHorseInventorySlotArmor(this, par2IInventory, 1, 8, 36, par3EntityHorse)); - int var6; - int var7; -- if(var3.isChested()) { -- for(var6 = 0; var6 < var4; ++var6) { -- for(var7 = 0; var7 < 5; ++var7) { -- this.addSlotToContainer(new Slot(var2, 2 + var7 + var6 * 5, 80 + var7 * 18, 18 + var6 * 18)); -+ -+ if (par3EntityHorse.isChested()) { -+ for (var6 = 0; var6 < var4; ++var6) { -+ for (var7 = 0; var7 < 5; ++var7) { -+ this.addSlotToContainer(new Slot(par2IInventory, 2 + var7 + var6 * 5, 80 + var7 * 18, 18 + var6 * 18)); - } - } - } - -- for(var6 = 0; var6 < 3; ++var6) { -- for(var7 = 0; var7 < 9; ++var7) { -- this.addSlotToContainer(new Slot(var1, var7 + var6 * 9 + 9, 8 + var7 * 18, 102 + var6 * 18 + var5)); -+ for (var6 = 0; var6 < 3; ++var6) { -+ for (var7 = 0; var7 < 9; ++var7) { -+ this.addSlotToContainer(new Slot(par1IInventory, var7 + var6 * 9 + 9, 8 + var7 * 18, 102 + var6 * 18 + var5)); - } - } - -- for(var6 = 0; var6 < 9; ++var6) { -- this.addSlotToContainer(new Slot(var1, var6, 8 + var6 * 18, 160 + var5)); -+ for (var6 = 0; var6 < 9; ++var6) { -+ this.addSlotToContainer(new Slot(par1IInventory, var6, 8 + var6 * 18, 160 + var5)); - } -- -- } -- -- public boolean canInteractWith(EntityPlayer var1) { -- return this.field_111243_a.isUseableByPlayer(var1) && this.theHorse.isEntityAlive() && this.theHorse.getDistanceToEntity(var1) < 8.0F; -- } -- -- public ItemStack transferStackInSlot(EntityPlayer var1, int var2) { -+ } -+ -+ public boolean canInteractWith(EntityPlayer par1EntityPlayer) { -+ return this.field_111243_a.isUseableByPlayer(par1EntityPlayer) && this.theHorse.isEntityAlive() && this.theHorse.getDistanceToEntity(par1EntityPlayer) < 8.0F; -+ } -+ -+ /** -+ * Called when a player shift-clicks on a slot. You must override this or you will crash when someone does that. -+ */ -+ public ItemStack transferStackInSlot(EntityPlayer par1EntityPlayer, int par2) { - ItemStack var3 = null; -- Slot var4 = (Slot)this.c.get(var2); -- if(var4 != null && var4.getHasStack()) { -+ Slot var4 = (Slot)this.inventorySlots.get(par2); -+ -+ if (var4 != null && var4.getHasStack()) { - ItemStack var5 = var4.getStack(); - var3 = var5.copy(); -- if(var2 < this.field_111243_a.getSizeInventory()) { -- if(!this.mergeItemStack(var5, this.field_111243_a.getSizeInventory(), this.c.size(), true)) { -- return null; -- } -- } else if(this.getSlot(1).isItemValid(var5) && !this.getSlot(1).getHasStack()) { -- if(!this.mergeItemStack(var5, 1, 2, false)) { -- return null; -- } -- } else if(this.getSlot(0).isItemValid(var5)) { -- if(!this.mergeItemStack(var5, 0, 1, false)) { -- return null; -- } -- } else if(this.field_111243_a.getSizeInventory() <= 2 || !this.mergeItemStack(var5, 2, this.field_111243_a.getSizeInventory(), false)) { -+ -+ if (par2 < this.field_111243_a.getSizeInventory()) { -+ if (!this.mergeItemStack(var5, this.field_111243_a.getSizeInventory(), this.inventorySlots.size(), true)) { -+ return null; -+ } -+ } else if (this.getSlot(1).isItemValid(var5) && !this.getSlot(1).getHasStack()) { -+ if (!this.mergeItemStack(var5, 1, 2, false)) { -+ return null; -+ } -+ } else if (this.getSlot(0).isItemValid(var5)) { -+ if (!this.mergeItemStack(var5, 0, 1, false)) { -+ return null; -+ } -+ } else if (this.field_111243_a.getSizeInventory() <= 2 || !this.mergeItemStack(var5, 2, this.field_111243_a.getSizeInventory(), false)) { - return null; - } - -- if(var5.stackSize == 0) { -+ if (var5.stackSize == 0) { - var4.putStack((ItemStack)null); - } else { - var4.onSlotChanged(); -@@ -70,8 +75,11 @@ - return var3; - } - -- public void onContainerClosed(EntityPlayer var1) { -- super.onContainerClosed(var1); -+ /** -+ * Called when the container is closed. -+ */ -+ public void onContainerClosed(EntityPlayer par1EntityPlayer) { -+ super.onContainerClosed(par1EntityPlayer); - this.field_111243_a.closeChest(); - } - } ---- net/minecraft/src/Packet8UpdateHealth.java -+++ net/minecraft/src/Packet8UpdateHealth.java -@@ -5,44 +5,68 @@ - import java.io.IOException; - - public class Packet8UpdateHealth extends Packet { -+ -+ /** Variable used for incoming health packets */ - public float healthMP; - public int food; -+ -+ /** -+ * Players logging on get a saturation of 5.0. Eating food increases the saturation as well as the food bar. -+ */ - public float foodSaturation; - -- public Packet8UpdateHealth() { -- } -- -- public Packet8UpdateHealth(float var1, int var2, float var3) { -- this.healthMP = var1; -- this.food = var2; -- this.foodSaturation = var3; -- } -- -- public void readPacketData(DataInput var1) throws IOException { -- this.healthMP = var1.readFloat(); -- this.food = var1.readShort(); -- this.foodSaturation = var1.readFloat(); -- } -- -- public void writePacketData(DataOutput var1) throws IOException { -- var1.writeFloat(this.healthMP); -- var1.writeShort(this.food); -- var1.writeFloat(this.foodSaturation); -- } -- -- public void processPacket(NetHandler var1) { -- var1.handleUpdateHealth(this); -- } -- -+ public Packet8UpdateHealth() {} -+ -+ public Packet8UpdateHealth(float par1, int par2, float par3) { -+ this.healthMP = par1; -+ this.food = par2; -+ this.foodSaturation = par3; -+ } -+ -+ /** -+ * Abstract. Reads the raw packet data from the data stream. -+ */ -+ public void readPacketData(DataInput par1DataInput) throws IOException { -+ this.healthMP = par1DataInput.readFloat(); -+ this.food = par1DataInput.readShort(); -+ this.foodSaturation = par1DataInput.readFloat(); -+ } -+ -+ /** -+ * Abstract. Writes the raw packet data to the data stream. -+ */ -+ public void writePacketData(DataOutput par1DataOutput) throws IOException { -+ par1DataOutput.writeFloat(this.healthMP); -+ par1DataOutput.writeShort(this.food); -+ par1DataOutput.writeFloat(this.foodSaturation); -+ } -+ -+ /** -+ * Passes this Packet on to the NetHandler for processing. -+ */ -+ public void processPacket(NetHandler par1NetHandler) { -+ par1NetHandler.handleUpdateHealth(this); -+ } -+ -+ /** -+ * Abstract. Return the size of the packet (not counting the header). -+ */ - public int getPacketSize() { - return 8; - } - -+ /** -+ * only false for the abstract Packet class, all real packets return true -+ */ - public boolean isRealPacket() { - return true; - } - -- public boolean containsSameEntityIDAs(Packet var1) { -+ /** -+ * eg return packet30entity.entityId == entityId; WARNING : will throw if you compare a packet to a different packet -+ * class -+ */ -+ public boolean containsSameEntityIDAs(Packet par1Packet) { - return true; - } - } ---- /dev/null -+++ org/spoutcraft/client/gui/minimap/Waypoint.java -@@ -1,0 +1,45 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.client.gui.minimap; -+ -+public class Waypoint { -+ public String name; -+ public int x; -+ public int y; -+ public int z; -+ public boolean enabled; -+ public boolean deathpoint = false; -+ public boolean server = false; -+ -+ /** -+ * Initialize a waypoint with default color. -+ * @param name -+ * @param x -+ * @param z -+ * @param enabled -+ */ -+ public Waypoint(String name, int x, int y, int z, boolean enabled) { -+ this.name = name; -+ this.x = x; -+ this.y = y; -+ this.z = z; -+ this.enabled = enabled; -+ } -+} ---- net/minecraft/src/RenderCow.java -+++ net/minecraft/src/RenderCow.java -@@ -3,15 +3,18 @@ - public class RenderCow extends RenderLiving { - private static final ResourceLocation cowTextures = new ResourceLocation("textures/entity/cow/cow.png"); - -- public RenderCow(ModelBase var1, float var2) { -- super(var1, var2); -+ public RenderCow(ModelBase par1ModelBase, float par2) { -+ super(par1ModelBase, par2); - } - -- protected ResourceLocation getCowTextures(EntityCow var1) { -+ protected ResourceLocation getCowTextures(EntityCow par1EntityCow) { - return cowTextures; - } - -- protected ResourceLocation getEntityTexture(Entity var1) { -- return this.getCowTextures((EntityCow)var1); -+ /** -+ * Returns the location of an entity's texture. Doesn't seem to be called unless you call Render.bindEntityTexture. -+ */ -+ protected ResourceLocation getEntityTexture(Entity par1Entity) { -+ return this.getCowTextures((EntityCow)par1Entity); - } - } ---- net/minecraft/src/TcpReaderThread.java -+++ net/minecraft/src/TcpReaderThread.java -@@ -3,28 +3,28 @@ - class TcpReaderThread extends Thread { - final TcpConnection theTcpConnection; - -- TcpReaderThread(TcpConnection var1, String var2) { -- super(var2); -- this.theTcpConnection = var1; -+ TcpReaderThread(TcpConnection par1TcpConnection, String par2Str) { -+ super(par2Str); -+ this.theTcpConnection = par1TcpConnection; - } - - public void run() { -- TcpConnection.a.getAndIncrement(); -+ TcpConnection.field_74471_a.getAndIncrement(); - - try { -- while(TcpConnection.isRunning(this.theTcpConnection) && !TcpConnection.isServerTerminating(this.theTcpConnection)) { -- while(true) { -- if(!TcpConnection.readNetworkPacket(this.theTcpConnection)) { -+ while (TcpConnection.isRunning(this.theTcpConnection) && !TcpConnection.isServerTerminating(this.theTcpConnection)) { -+ while (true) { -+ if (!TcpConnection.readNetworkPacket(this.theTcpConnection)) { - try { - sleep(2L); - } catch (InterruptedException var5) { -+ ; - } - } - } - } - } finally { -- TcpConnection.a.getAndDecrement(); -+ TcpConnection.field_74471_a.getAndDecrement(); - } -- - } - } ---- net/minecraft/src/CallableLevelStorageVersion.java -+++ net/minecraft/src/CallableLevelStorageVersion.java -@@ -5,25 +5,27 @@ - class CallableLevelStorageVersion implements Callable { - final WorldInfo worldInfoInstance; - -- CallableLevelStorageVersion(WorldInfo var1) { -- this.worldInfoInstance = var1; -+ CallableLevelStorageVersion(WorldInfo par1WorldInfo) { -+ this.worldInfoInstance = par1WorldInfo; - } - - public String callLevelStorageFormat() { - String var1 = "Unknown?"; - - try { -- switch(WorldInfo.getSaveVersion(this.worldInfoInstance)) { -- case 19132: -- var1 = "McRegion"; -- break; -- case 19133: -- var1 = "Anvil"; -+ switch (WorldInfo.getSaveVersion(this.worldInfoInstance)) { -+ case 19132: -+ var1 = "McRegion"; -+ break; -+ -+ case 19133: -+ var1 = "Anvil"; - } - } catch (Throwable var3) { -+ ; - } - -- return String.format("0x%05X - %s", new Object[]{Integer.valueOf(WorldInfo.getSaveVersion(this.worldInfoInstance)), var1}); -+ return String.format("0x%05X - %s", new Object[] {Integer.valueOf(WorldInfo.getSaveVersion(this.worldInfoInstance)), var1}); - } - - public Object call() { ---- /dev/null -+++ org/spoutcraft/client/gui/server/AccessTypeFilter.java -@@ -1,0 +1,65 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.client.gui.server; -+ -+import java.util.ArrayList; -+import java.util.List; -+ -+import org.spoutcraft.api.gui.GenericComboBox; -+import org.spoutcraft.client.gui.database.AbstractAPIModel; -+import org.spoutcraft.client.gui.database.UrlElement; -+ -+public class AccessTypeFilter extends GenericComboBox implements UrlElement { -+ private String[] strings = { "All", "Open", "Whitelisted", "Graylisted", "Blacklisted"}; -+ private int [] ids = {-1, 0, 1, 2, 3}; -+ AbstractAPIModel model; -+ -+ public AccessTypeFilter(AbstractAPIModel model) { -+ this.model = model; -+ List l = new ArrayList(); -+ for (String type:strings) { -+ l.add(type); -+ } -+ setItems(l); -+ setSelection(0); -+ } -+ -+ public boolean isActive() { -+ return ids[getSelectedRow()] != -1; -+ } -+ -+ public String getUrlPart() { -+ return "accessType=" + ids[getSelectedRow()]; -+ } -+ -+ public void clear() { -+ setSelection(0); -+ } -+ -+ @Override -+ public void onSelectionChanged(int i, String text) { -+ model.updateUrl(); -+ } -+ -+ @Override -+ public String getText() { -+ return "Access: " + super.getText(); -+ } -+} ---- net/minecraft/src/EnumEnchantmentType.java -+++ net/minecraft/src/EnumEnchantmentType.java -@@ -11,18 +11,21 @@ - digger, - bow; - -- public boolean canEnchantItem(Item var1) { -- if(this == all) { -+ /** -+ * Return true if the item passed can be enchanted by a enchantment of this type. -+ */ -+ public boolean canEnchantItem(Item par1Item) { -+ if (this == all) { - return true; -- } else if(var1 instanceof ItemArmor) { -- if(this == armor) { -+ } else if (par1Item instanceof ItemArmor) { -+ if (this == armor) { - return true; - } else { -- ItemArmor var2 = (ItemArmor)var1; -+ ItemArmor var2 = (ItemArmor)par1Item; - return var2.armorType == 0 ? this == armor_head : (var2.armorType == 2 ? this == armor_legs : (var2.armorType == 1 ? this == armor_torso : (var2.armorType == 3 ? this == armor_feet : false))); - } - } else { -- return var1 instanceof ItemSword ? this == weapon : (var1 instanceof ItemTool ? this == digger : (var1 instanceof ItemBow ? this == bow : false)); -+ return par1Item instanceof ItemSword ? this == weapon : (par1Item instanceof ItemTool ? this == digger : (par1Item instanceof ItemBow ? this == bow : false)); - } - } - } ---- net/minecraft/src/CallableTileEntityID.java -+++ net/minecraft/src/CallableTileEntityID.java -@@ -5,15 +5,15 @@ - class CallableTileEntityID implements Callable { - final TileEntity theTileEntity; - -- CallableTileEntityID(TileEntity var1) { -- this.theTileEntity = var1; -+ CallableTileEntityID(TileEntity par1TileEntity) { -+ this.theTileEntity = par1TileEntity; - } - - public String callTileEntityID() { - int var1 = this.theTileEntity.worldObj.getBlockId(this.theTileEntity.xCoord, this.theTileEntity.yCoord, this.theTileEntity.zCoord); - - try { -- return String.format("ID #%d (%s // %s)", new Object[]{Integer.valueOf(var1), Block.blocksList[var1].getUnlocalizedName(), Block.blocksList[var1].getClass().getCanonicalName()}); -+ return String.format("ID #%d (%s // %s)", new Object[] {Integer.valueOf(var1), Block.blocksList[var1].getUnlocalizedName(), Block.blocksList[var1].getClass().getCanonicalName()}); - } catch (Throwable var3) { - return "ID #" + var1; - } ---- /dev/null -+++ org/spoutcraft/client/gui/settings/controls/AntiAliasingButton.java -@@ -1,0 +1,41 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.client.gui.settings.controls; -+ -+import org.spoutcraft.client.config.Configuration; -+ -+public class AntiAliasingButton extends AutomatedButton { -+ public int aaSampling = Configuration.getAASampling(); -+ public AntiAliasingButton() { -+ setTooltip("Anti-Aliasing \n Changing requires complete restart."); -+ } -+ -+ @Override -+ public String getText() { -+ return "Anti-Aliasing (Samples): " + Configuration.getAASampling(); -+ } -+ -+ @Override -+ public void onButtonClick() { -+ Configuration.setAASampling(); -+ Configuration.write(); -+ -+ } -+} ---- net/minecraft/src/EntityLiving.java -+++ net/minecraft/src/EntityLiving.java -@@ -5,43 +5,63 @@ - import java.util.UUID; - - public abstract class EntityLiving extends EntityLivingBase { -+ -+ /** Number of ticks since this EntityLiving last produced its sound */ - public int livingSoundTime; -+ -+ /** The experience points the Entity gives. */ - protected int experienceValue; - private EntityLookHelper lookHelper; - private EntityMoveHelper moveHelper; -+ -+ /** Entity jumping helper */ - private EntityJumpHelper jumpHelper; - private EntityBodyHelper bodyHelper; - private PathNavigate navigator; - protected final EntityAITasks tasks; - protected final EntityAITasks targetTasks; -+ -+ /** The active target the Task system uses for tracking */ -+ //Spout Start - private EntityLivingBase attackTarget; - private EntitySenses senses; -+ -+ /** Equipment (armor and held item) for this entity. */ - private ItemStack[] equipment = new ItemStack[5]; -+ -+ /** Chances for each equipment piece from dropping when this entity dies. */ - protected float[] equipmentDropChances = new float[5]; -+ -+ /** Whether this entity can pick up items from the ground. */ - private boolean canPickUpLoot; -+ -+ /** Whether this entity should NOT despawn. */ - private boolean persistenceRequired; - protected float defaultPitch; -+ -+ /** This entity's current target. */ - private Entity currentTarget; -+ -+ /** How long to keep a specific target entity */ - protected int numTicksToChaseTarget; - private boolean isLeashed; - private Entity leashedToEntity; - private NBTTagCompound field_110170_bx; - -- public EntityLiving(World var1) { -- super(var1); -- this.tasks = new EntityAITasks(var1 != null && var1.theProfiler != null ? var1.theProfiler : null); -- this.targetTasks = new EntityAITasks(var1 != null && var1.theProfiler != null ? var1.theProfiler : null); -+ public EntityLiving(World par1World) { -+ super(par1World); -+ this.tasks = new EntityAITasks(par1World != null && par1World.theProfiler != null ? par1World.theProfiler : null); -+ this.targetTasks = new EntityAITasks(par1World != null && par1World.theProfiler != null ? par1World.theProfiler : null); - this.lookHelper = new EntityLookHelper(this); - this.moveHelper = new EntityMoveHelper(this); - this.jumpHelper = new EntityJumpHelper(this); - this.bodyHelper = new EntityBodyHelper(this); -- this.navigator = new PathNavigate(this, var1); -+ this.navigator = new PathNavigate(this, par1World); - this.senses = new EntitySenses(this); - -- for(int var2 = 0; var2 < this.equipmentDropChances.length; ++var2) { -+ for (int var2 = 0; var2 < this.equipmentDropChances.length; ++var2) { - this.equipmentDropChances[var2] = 0.085F; - } -- - } - - protected void applyEntityAttributes() { -@@ -65,24 +85,39 @@ - return this.navigator; - } - -+ /** -+ * returns the EntitySenses Object for the EntityLiving -+ */ - public EntitySenses getEntitySenses() { - return this.senses; - } - -+ /** -+ * Gets the active target the Task system uses for tracking -+ */ - public EntityLivingBase getAttackTarget() { - return this.attackTarget; - } - -- public void setAttackTarget(EntityLivingBase var1) { -- this.attackTarget = var1; -- } -- -- public boolean canAttackClass(Class var1) { -- return EntityCreeper.class != var1 && EntityGhast.class != var1; -- } -- -- public void eatGrassBonus() { -- } -+ /** -+ * Sets the active target the Task system uses for tracking -+ */ -+ public void setAttackTarget(EntityLivingBase par1EntityLivingBase) { -+ this.attackTarget = par1EntityLivingBase; -+ } -+ -+ /** -+ * Returns true if this entity can attack entities of the specified class. -+ */ -+ public boolean canAttackClass(Class par1Class) { -+ return EntityCreeper.class != par1Class && EntityGhast.class != par1Class; -+ } -+ -+ /** -+ * This function applies the benefits of growing back wool and faster growing up to the acting entity. (This function -+ * is used in the AIEatGrass) -+ */ -+ public void eatGrassBonus() {} - - protected void entityInit() { - super.entityInit(); -@@ -90,22 +125,32 @@ - this.dataWatcher.addObject(10, ""); - } - -+ /** -+ * Get number of ticks, at least during which the living entity will be silent. -+ */ - public int getTalkInterval() { - return 80; - } - -+ /** -+ * Plays living's sound at its position -+ */ - public void playLivingSound() { - String var1 = this.getLivingSound(); -- if(var1 != null) { -+ -+ if (var1 != null) { - this.playSound(var1, this.getSoundVolume(), this.getSoundPitch()); - } -- - } - -+ /** -+ * Gets called every tick from main Entity class -+ */ - public void onEntityUpdate() { - super.onEntityUpdate(); - this.worldObj.theProfiler.startSection("mobBaseTick"); -- if(this.isEntityAlive() && this.ab.nextInt(1000) < this.livingSoundTime++) { -+ -+ if (this.isEntityAlive() && this.rand.nextInt(1000) < this.livingSoundTime++) { - this.livingSoundTime = -this.getTalkInterval(); - this.playLivingSound(); - } -@@ -113,14 +158,17 @@ - this.worldObj.theProfiler.endSection(); - } - -- protected int getExperiencePoints(EntityPlayer var1) { -- if(this.experienceValue > 0) { -+ /** -+ * Get the experience points the entity currently has. -+ */ -+ protected int getExperiencePoints(EntityPlayer par1EntityPlayer) { -+ if (this.experienceValue > 0) { - int var2 = this.experienceValue; -- ItemStack[] var3 = this.getInventory(); -+ ItemStack[] var3 = this.getLastActiveItems(); - -- for(int var4 = 0; var4 < var3.length; ++var4) { -- if(var3[var4] != null && this.equipmentDropChances[var4] <= 1.0F) { -- var2 += 1 + this.ab.nextInt(3); -+ for (int var4 = 0; var4 < var3.length; ++var4) { -+ if (var3[var4] != null && this.equipmentDropChances[var4] <= 1.0F) { -+ var2 += 1 + this.rand.nextInt(3); - } - } - -@@ -130,213 +178,241 @@ - } - } - -+ /** -+ * Spawns an explosion particle around the Entity's location -+ */ - public void spawnExplosionParticle() { -- for(int var1 = 0; var1 < 20; ++var1) { -- double var2 = this.ab.nextGaussian() * 0.02D; -- double var4 = this.ab.nextGaussian() * 0.02D; -- double var6 = this.ab.nextGaussian() * 0.02D; -+ for (int var1 = 0; var1 < 20; ++var1) { -+ double var2 = this.rand.nextGaussian() * 0.02D; -+ double var4 = this.rand.nextGaussian() * 0.02D; -+ double var6 = this.rand.nextGaussian() * 0.02D; - double var8 = 10.0D; -- this.worldObj.spawnParticle("explode", this.posX + (double)(this.ab.nextFloat() * this.width * 2.0F) - (double)this.width - var2 * var8, this.posY + (double)(this.ab.nextFloat() * this.height) - var4 * var8, this.posZ + (double)(this.ab.nextFloat() * this.width * 2.0F) - (double)this.width - var6 * var8, var2, var4, var6); -+ this.worldObj.spawnParticle("explode", this.posX + (double)(this.rand.nextFloat() * this.width * 2.0F) - (double)this.width - var2 * var8, this.posY + (double)(this.rand.nextFloat() * this.height) - var4 * var8, this.posZ + (double)(this.rand.nextFloat() * this.width * 2.0F) - (double)this.width - var6 * var8, var2, var4, var6); - } -- - } - -+ /** -+ * Called to update the entity's position/logic. -+ */ - public void onUpdate() { - super.onUpdate(); -- if(!this.worldObj.isRemote) { -+ -+ if (!this.worldObj.isRemote) { - this.func_110159_bB(); - } -- - } - -- protected float func_110146_f(float var1, float var2) { -- if(this.isAIEnabled()) { -+ protected float func_110146_f(float par1, float par2) { -+ if (this.isAIEnabled()) { - this.bodyHelper.func_75664_a(); -- return var2; -+ return par2; - } else { -- return super.func_110146_f(var1, var2); -+ return super.func_110146_f(par1, par2); - } - } - -+ /** -+ * Returns the sound this mob makes while it's alive. -+ */ - protected String getLivingSound() { - return null; - } - -+ /** -+ * Returns the item ID for the item the mob drops on death. -+ */ - protected int getDropItemId() { - return 0; - } - -- protected void dropFewItems(boolean var1, int var2) { -+ /** -+ * Drop 0-2 items of this living's type. @param par1 - Whether this entity has recently been hit by a player. @param -+ * par2 - Level of Looting used to kill this mob. -+ */ -+ protected void dropFewItems(boolean par1, int par2) { - int var3 = this.getDropItemId(); -- if(var3 > 0) { -- int var4 = this.ab.nextInt(3); -- if(var2 > 0) { -- var4 += this.ab.nextInt(var2 + 1); -+ -+ if (var3 > 0) { -+ int var4 = this.rand.nextInt(3); -+ -+ if (par2 > 0) { -+ var4 += this.rand.nextInt(par2 + 1); - } - -- for(int var5 = 0; var5 < var4; ++var5) { -+ for (int var5 = 0; var5 < var4; ++var5) { - this.dropItem(var3, 1); - } - } -- - } - -- public void writeEntityToNBT(NBTTagCompound var1) { -- super.writeEntityToNBT(var1); -- var1.setBoolean("CanPickUpLoot", this.canPickUpLoot()); -- var1.setBoolean("PersistenceRequired", this.persistenceRequired); -+ /** -+ * (abstract) Protected helper method to write subclass entity data to NBT. -+ */ -+ public void writeEntityToNBT(NBTTagCompound par1NBTTagCompound) { -+ super.writeEntityToNBT(par1NBTTagCompound); -+ par1NBTTagCompound.setBoolean("CanPickUpLoot", this.canPickUpLoot()); -+ par1NBTTagCompound.setBoolean("PersistenceRequired", this.persistenceRequired); - NBTTagList var2 = new NBTTagList(); -- - NBTTagCompound var4; -- for(int var3 = 0; var3 < this.equipment.length; ++var3) { -+ -+ for (int var3 = 0; var3 < this.equipment.length; ++var3) { - var4 = new NBTTagCompound(); -- if(this.equipment[var3] != null) { -+ -+ if (this.equipment[var3] != null) { - this.equipment[var3].writeToNBT(var4); - } - - var2.appendTag(var4); - } - -- var1.setTag("Equipment", var2); -+ par1NBTTagCompound.setTag("Equipment", var2); - NBTTagList var6 = new NBTTagList(); - -- for(int var7 = 0; var7 < this.equipmentDropChances.length; ++var7) { -+ for (int var7 = 0; var7 < this.equipmentDropChances.length; ++var7) { - var6.appendTag(new NBTTagFloat(var7 + "", this.equipmentDropChances[var7])); - } - -- var1.setTag("DropChances", var6); -- var1.setString("CustomName", this.getCustomNameTag()); -- var1.setBoolean("CustomNameVisible", this.getAlwaysRenderNameTag()); -- var1.setBoolean("Leashed", this.isLeashed); -- if(this.leashedToEntity != null) { -+ par1NBTTagCompound.setTag("DropChances", var6); -+ par1NBTTagCompound.setString("CustomName", this.getCustomNameTag()); -+ par1NBTTagCompound.setBoolean("CustomNameVisible", this.getAlwaysRenderNameTag()); -+ par1NBTTagCompound.setBoolean("Leashed", this.isLeashed); -+ -+ if (this.leashedToEntity != null) { - var4 = new NBTTagCompound("Leash"); -- if(this.leashedToEntity instanceof EntityLivingBase) { -+ -+ if (this.leashedToEntity instanceof EntityLivingBase) { - var4.setLong("UUIDMost", this.leashedToEntity.getUniqueID().getMostSignificantBits()); - var4.setLong("UUIDLeast", this.leashedToEntity.getUniqueID().getLeastSignificantBits()); -- } else if(this.leashedToEntity instanceof EntityHanging) { -+ } else if (this.leashedToEntity instanceof EntityHanging) { - EntityHanging var5 = (EntityHanging)this.leashedToEntity; - var4.setInteger("X", var5.xPosition); - var4.setInteger("Y", var5.yPosition); - var4.setInteger("Z", var5.zPosition); - } - -- var1.setTag("Leash", var4); -+ par1NBTTagCompound.setTag("Leash", var4); - } -- - } - -- public void readEntityFromNBT(NBTTagCompound var1) { -- super.readEntityFromNBT(var1); -- this.setCanPickUpLoot(var1.getBoolean("CanPickUpLoot")); -- this.persistenceRequired = var1.getBoolean("PersistenceRequired"); -- if(var1.hasKey("CustomName") && var1.getString("CustomName").length() > 0) { -- this.setCustomNameTag(var1.getString("CustomName")); -+ /** -+ * (abstract) Protected helper method to read subclass entity data from NBT. -+ */ -+ -+ public void readEntityFromNBT(NBTTagCompound par1NBTTagCompound) { -+ super.readEntityFromNBT(par1NBTTagCompound); -+ this.setCanPickUpLoot(par1NBTTagCompound.getBoolean("CanPickUpLoot")); -+ this.persistenceRequired = par1NBTTagCompound.getBoolean("PersistenceRequired"); -+ -+ if (par1NBTTagCompound.hasKey("CustomName") && par1NBTTagCompound.getString("CustomName").length() > 0) { -+ this.setCustomNameTag(par1NBTTagCompound.getString("CustomName")); - } - -- this.setAlwaysRenderNameTag(var1.getBoolean("CustomNameVisible")); -+ this.setAlwaysRenderNameTag(par1NBTTagCompound.getBoolean("CustomNameVisible")); - NBTTagList var2; - int var3; -- if(var1.hasKey("Equipment")) { -- var2 = var1.getTagList("Equipment"); -- -- for(var3 = 0; var3 < this.equipment.length; ++var3) { -+ -+ if (par1NBTTagCompound.hasKey("Equipment")) { -+ var2 = par1NBTTagCompound.getTagList("Equipment"); -+ -+ for (var3 = 0; var3 < this.equipment.length; ++var3) { - this.equipment[var3] = ItemStack.loadItemStackFromNBT((NBTTagCompound)var2.tagAt(var3)); - } - } - -- if(var1.hasKey("DropChances")) { -- var2 = var1.getTagList("DropChances"); -+ if (par1NBTTagCompound.hasKey("DropChances")) { -+ var2 = par1NBTTagCompound.getTagList("DropChances"); - -- for(var3 = 0; var3 < var2.tagCount(); ++var3) { -+ for (var3 = 0; var3 < var2.tagCount(); ++var3) { - this.equipmentDropChances[var3] = ((NBTTagFloat)var2.tagAt(var3)).data; - } - } - -- this.isLeashed = var1.getBoolean("Leashed"); -- if(this.isLeashed && var1.hasKey("Leash")) { -- this.field_110170_bx = var1.getCompoundTag("Leash"); -+ this.isLeashed = par1NBTTagCompound.getBoolean("Leashed"); -+ -+ if (this.isLeashed && par1NBTTagCompound.hasKey("Leash")) { -+ this.field_110170_bx = par1NBTTagCompound.getCompoundTag("Leash"); - } -- -- } -- -- public void setMoveForward(float var1) { -- this.moveForward = var1; -- } -- -- public void setAIMoveSpeed(float var1) { -- super.setAIMoveSpeed(var1); -- this.setMoveForward(var1); -- } -- -+ } -+ -+ public void setMoveForward(float par1) { -+ this.moveForward = par1; -+ } -+ -+ /** -+ * set the movespeed used for the new AI system -+ */ -+ public void setAIMoveSpeed(float par1) { -+ super.setAIMoveSpeed(par1); -+ this.setMoveForward(par1); -+ } -+ -+ /** -+ * Called frequently so the entity can update its state every tick as required. For example, zombies and skeletons use -+ * this to react to sunlight and start to burn. -+ */ - public void onLivingUpdate() { - super.onLivingUpdate(); - this.worldObj.theProfiler.startSection("looting"); -- if(!this.worldObj.isRemote && this.canPickUpLoot() && !this.dead && this.worldObj.getGameRules().getGameRuleBooleanValue("mobGriefing")) { -+ -+ if (!this.worldObj.isRemote && this.canPickUpLoot() && !this.dead && this.worldObj.getGameRules().getGameRuleBooleanValue("mobGriefing")) { - List var1 = this.worldObj.getEntitiesWithinAABB(EntityItem.class, this.boundingBox.expand(1.0D, 0.0D, 1.0D)); - Iterator var2 = var1.iterator(); - -- label122: -- while(true) { -- EntityItem var3; -- ItemStack var4; -- int var5; -- do { -- do { -- do { -- if(!var2.hasNext()) { -- break label122; -- } -- -- var3 = (EntityItem)var2.next(); -- } while(var3.isDead); -- } while(var3.getEntityItem() == null); -- -- var4 = var3.getEntityItem(); -- var5 = getArmorPosition(var4); -- } while(var5 <= -1); -- -- boolean var6 = true; -- ItemStack var7 = this.getEquipmentInSlot(var5); -- if(var7 != null) { -- if(var5 == 0) { -- if(var4.getItem() instanceof ItemSword && !(var7.getItem() instanceof ItemSword)) { -- var6 = true; -- } else if(var4.getItem() instanceof ItemSword && var7.getItem() instanceof ItemSword) { -- ItemSword var10 = (ItemSword)var4.getItem(); -- ItemSword var11 = (ItemSword)var7.getItem(); -- if(var10.func_82803_g() != var11.func_82803_g()) { -- var6 = var10.func_82803_g() > var11.func_82803_g(); -+ while (var2.hasNext()) { -+ EntityItem var3 = (EntityItem)var2.next(); -+ -+ if (!var3.isDead && var3.getEntityItem() != null) { -+ ItemStack var4 = var3.getEntityItem(); -+ int var5 = getArmorPosition(var4); -+ -+ if (var5 > -1) { -+ boolean var6 = true; -+ ItemStack var7 = this.getCurrentItemOrArmor(var5); -+ -+ if (var7 != null) { -+ if (var5 == 0) { -+ if (var4.getItem() instanceof ItemSword && !(var7.getItem() instanceof ItemSword)) { -+ var6 = true; -+ } else if (var4.getItem() instanceof ItemSword && var7.getItem() instanceof ItemSword) { -+ ItemSword var8 = (ItemSword)var4.getItem(); -+ ItemSword var9 = (ItemSword)var7.getItem(); -+ -+ if (var8.func_82803_g() == var9.func_82803_g()) { -+ var6 = var4.getItemDamage() > var7.getItemDamage() || var4.hasTagCompound() && !var7.hasTagCompound(); -+ } else { -+ var6 = var8.func_82803_g() > var9.func_82803_g(); -+ } -+ } else { -+ var6 = false; -+ } -+ } else if (var4.getItem() instanceof ItemArmor && !(var7.getItem() instanceof ItemArmor)) { -+ var6 = true; -+ } else if (var4.getItem() instanceof ItemArmor && var7.getItem() instanceof ItemArmor) { -+ ItemArmor var10 = (ItemArmor)var4.getItem(); -+ ItemArmor var11 = (ItemArmor)var7.getItem(); -+ -+ if (var10.damageReduceAmount == var11.damageReduceAmount) { -+ var6 = var4.getItemDamage() > var7.getItemDamage() || var4.hasTagCompound() && !var7.hasTagCompound(); -+ } else { -+ var6 = var10.damageReduceAmount > var11.damageReduceAmount; -+ } - } else { -- var6 = var4.getItemDamage() > var7.getItemDamage() || var4.hasTagCompound() && !var7.hasTagCompound(); -- } -- } else { -- var6 = false; -- } -- } else if(var4.getItem() instanceof ItemArmor && !(var7.getItem() instanceof ItemArmor)) { -- var6 = true; -- } else if(var4.getItem() instanceof ItemArmor && var7.getItem() instanceof ItemArmor) { -- ItemArmor var8 = (ItemArmor)var4.getItem(); -- ItemArmor var9 = (ItemArmor)var7.getItem(); -- if(var8.damageReduceAmount != var9.damageReduceAmount) { -- var6 = var8.damageReduceAmount > var9.damageReduceAmount; -- } else { -- var6 = var4.getItemDamage() > var7.getItemDamage() || var4.hasTagCompound() && !var7.hasTagCompound(); -- } -- } else { -- var6 = false; -- } -- } -- -- if(var6) { -- if(var7 != null && this.ab.nextFloat() - 0.1F < this.equipmentDropChances[var5]) { -- this.entityDropItem(var7, 0.0F); -- } -- -- this.setCurrentItemOrArmor(var5, var4); -- this.equipmentDropChances[var5] = 2.0F; -- this.persistenceRequired = true; -- this.onItemPickup(var3, 1); -- var3.setDead(); -+ var6 = false; -+ } -+ } -+ -+ if (var6) { -+ if (var7 != null && this.rand.nextFloat() - 0.1F < this.equipmentDropChances[var5]) { -+ this.entityDropItem(var7, 0.0F); -+ } -+ -+ this.setCurrentItemOrArmor(var5, var4); -+ this.equipmentDropChances[var5] = 2.0F; -+ this.persistenceRequired = true; -+ this.onItemPickup(var3, 1); -+ var3.setDead(); -+ } -+ } - } - } - } -@@ -344,35 +420,45 @@ - this.worldObj.theProfiler.endSection(); - } - -+ /** -+ * Returns true if the newer Entity AI code should be run -+ */ - protected boolean isAIEnabled() { - return false; - } - -+ /** -+ * Determines if an entity can be despawned, used on idle far away entities -+ */ - protected boolean canDespawn() { - return true; - } - -+ /** -+ * Makes the entity despawn if requirements are reached -+ */ - protected void despawnEntity() { -- if(this.persistenceRequired) { -+ if (this.persistenceRequired) { - this.entityAge = 0; - } else { - EntityPlayer var1 = this.worldObj.getClosestPlayerToEntity(this, -1.0D); -- if(var1 != null) { -+ -+ if (var1 != null) { - double var2 = var1.posX - this.posX; - double var4 = var1.posY - this.posY; - double var6 = var1.posZ - this.posZ; - double var8 = var2 * var2 + var4 * var4 + var6 * var6; -- if(this.canDespawn() && var8 > 16384.0D) { -+ -+ if (this.canDespawn() && var8 > 16384.0D) { - this.setDead(); - } - -- if(this.entityAge > 600 && this.ab.nextInt(800) == 0 && var8 > 1024.0D && this.canDespawn()) { -+ if (this.entityAge > 600 && this.rand.nextInt(800) == 0 && var8 > 1024.0D && this.canDespawn()) { - this.setDead(); -- } else if(var8 < 1024.0D) { -+ } else if (var8 < 1024.0D) { - this.entityAge = 0; - } - } -- - } - } - -@@ -413,24 +499,27 @@ - this.moveForward = 0.0F; - this.despawnEntity(); - float var1 = 8.0F; -- if(this.ab.nextFloat() < 0.02F) { -+ -+ if (this.rand.nextFloat() < 0.02F) { - EntityPlayer var2 = this.worldObj.getClosestPlayerToEntity(this, (double)var1); -- if(var2 != null) { -+ -+ if (var2 != null) { - this.currentTarget = var2; -- this.numTicksToChaseTarget = 10 + this.ab.nextInt(20); -+ this.numTicksToChaseTarget = 10 + this.rand.nextInt(20); - } else { -- this.randomYawVelocity = (this.ab.nextFloat() - 0.5F) * 20.0F; -+ this.randomYawVelocity = (this.rand.nextFloat() - 0.5F) * 20.0F; - } - } - -- if(this.currentTarget != null) { -+ if (this.currentTarget != null) { - this.faceEntity(this.currentTarget, 10.0F, (float)this.getVerticalFaceSpeed()); -- if(this.numTicksToChaseTarget-- <= 0 || this.currentTarget.isDead || this.currentTarget.getDistanceSqToEntity(this) > (double)(var1 * var1)) { -+ -+ if (this.numTicksToChaseTarget-- <= 0 || this.currentTarget.isDead || this.currentTarget.getDistanceSqToEntity(this) > (double)(var1 * var1)) { - this.currentTarget = null; - } - } else { -- if(this.ab.nextFloat() < 0.05F) { -- this.randomYawVelocity = (this.ab.nextFloat() - 0.5F) * 20.0F; -+ if (this.rand.nextFloat() < 0.05F) { -+ this.randomYawVelocity = (this.rand.nextFloat() - 0.5F) * 20.0F; - } - - this.rotationYaw += this.randomYawVelocity; -@@ -439,66 +528,91 @@ - - boolean var4 = this.isInWater(); - boolean var3 = this.handleLavaMovement(); -- if(var4 || var3) { -- this.isJumping = this.ab.nextFloat() < 0.8F; -+ -+ if (var4 || var3) { -+ this.isJumping = this.rand.nextFloat() < 0.8F; - } -- - } - -+ /** -+ * The speed it takes to move the entityliving's rotationPitch through the faceEntity method. This is only currently -+ * use in wolves. -+ */ - public int getVerticalFaceSpeed() { - return 40; - } - -- public void faceEntity(Entity var1, float var2, float var3) { -- double var4 = var1.posX - this.posX; -- double var8 = var1.posZ - this.posZ; -+ /** -+ * Changes pitch and yaw so that the entity calling the function is facing the entity provided as an argument. -+ */ -+ public void faceEntity(Entity par1Entity, float par2, float par3) { -+ double var4 = par1Entity.posX - this.posX; -+ double var8 = par1Entity.posZ - this.posZ; - double var6; -- if(var1 instanceof EntityLivingBase) { -- EntityLivingBase var10 = (EntityLivingBase)var1; -+ -+ if (par1Entity instanceof EntityLivingBase) { -+ EntityLivingBase var10 = (EntityLivingBase)par1Entity; - var6 = var10.posY + (double)var10.getEyeHeight() - (this.posY + (double)this.getEyeHeight()); - } else { -- var6 = (var1.boundingBox.minY + var1.boundingBox.maxY) / 2.0D - (this.posY + (double)this.getEyeHeight()); -+ var6 = (par1Entity.boundingBox.minY + par1Entity.boundingBox.maxY) / 2.0D - (this.posY + (double)this.getEyeHeight()); - } - - double var14 = (double)MathHelper.sqrt_double(var4 * var4 + var8 * var8); -- float var12 = (float)(Math.atan2(var8, var4) * 180.0D / (double)((float)Math.PI)) - 90.0F; -- float var13 = (float)(-(Math.atan2(var6, var14) * 180.0D / (double)((float)Math.PI))); -- this.rotationPitch = this.updateRotation(this.rotationPitch, var13, var3); -- this.rotationYaw = this.updateRotation(this.rotationYaw, var12, var2); -- } -- -- private float updateRotation(float var1, float var2, float var3) { -- float var4 = MathHelper.wrapAngleTo180_float(var2 - var1); -- if(var4 > var3) { -- var4 = var3; -- } -- -- if(var4 < -var3) { -- var4 = -var3; -- } -- -- return var1 + var4; -- } -- -+ float var12 = (float)(Math.atan2(var8, var4) * 180.0D / Math.PI) - 90.0F; -+ float var13 = (float)(-(Math.atan2(var6, var14) * 180.0D / Math.PI)); -+ this.rotationPitch = this.updateRotation(this.rotationPitch, var13, par3); -+ this.rotationYaw = this.updateRotation(this.rotationYaw, var12, par2); -+ } -+ -+ /** -+ * Arguments: current rotation, intended rotation, max increment. -+ */ -+ private float updateRotation(float par1, float par2, float par3) { -+ float var4 = MathHelper.wrapAngleTo180_float(par2 - par1); -+ -+ if (var4 > par3) { -+ var4 = par3; -+ } -+ -+ if (var4 < -par3) { -+ var4 = -par3; -+ } -+ -+ return par1 + var4; -+ } -+ -+ /** -+ * Checks if the entity's current position is a valid location to spawn this entity. -+ */ - public boolean getCanSpawnHere() { - return this.worldObj.checkNoEntityCollision(this.boundingBox) && this.worldObj.getCollidingBoundingBoxes(this, this.boundingBox).isEmpty() && !this.worldObj.isAnyLiquid(this.boundingBox); - } - -+ /** -+ * Returns render size modifier -+ */ - public float getRenderSizeModifier() { - return 1.0F; - } - -+ /** -+ * Will return how many at most can spawn in a chunk at once. -+ */ - public int getMaxSpawnedInChunk() { - return 4; - } - -+ /** -+ * The number of iterations PathFinder.getSafePoint will execute before giving up. -+ */ - public int getMaxSafePointTries() { -- if(this.getAttackTarget() == null) { -+ if (this.getAttackTarget() == null) { - return 3; - } else { - int var1 = (int)(this.getHealth() - this.getMaxHealth() * 0.33F); - var1 -= (3 - this.worldObj.difficultySetting) * 4; -- if(var1 < 0) { -+ -+ if (var1 < 0) { - var1 = 0; - } - -@@ -506,39 +620,53 @@ - } - } - -+ /** -+ * Returns the item that this EntityLiving is holding, if any. -+ */ - public ItemStack getHeldItem() { - return this.equipment[0]; - } - -- public ItemStack getEquipmentInSlot(int var1) { -- return this.equipment[var1]; -- } -- -- public ItemStack func_130225_q(int var1) { -- return this.equipment[var1 + 1]; -- } -- -- public void setCurrentItemOrArmor(int var1, ItemStack var2) { -- this.equipment[var1] = var2; -- } -- -- public ItemStack[] getInventory() { -+ /** -+ * 0 = item, 1-n is armor -+ */ -+ public ItemStack getCurrentItemOrArmor(int par1) { -+ return this.equipment[par1]; -+ } -+ -+ public ItemStack func_130225_q(int par1) { -+ return this.equipment[par1 + 1]; -+ } -+ -+ /** -+ * Sets the held item, or an armor slot. Slot 0 is held item. Slot 1-4 is armor. Params: Item, slot -+ */ -+ public void setCurrentItemOrArmor(int par1, ItemStack par2ItemStack) { -+ this.equipment[par1] = par2ItemStack; -+ } -+ -+ public ItemStack[] getLastActiveItems() { - return this.equipment; - } - -- protected void dropEquipment(boolean var1, int var2) { -- for(int var3 = 0; var3 < this.getInventory().length; ++var3) { -- ItemStack var4 = this.getEquipmentInSlot(var3); -+ /** -+ * Drop the equipment for this entity. -+ */ -+ protected void dropEquipment(boolean par1, int par2) { -+ for (int var3 = 0; var3 < this.getLastActiveItems().length; ++var3) { -+ ItemStack var4 = this.getCurrentItemOrArmor(var3); - boolean var5 = this.equipmentDropChances[var3] > 1.0F; -- if(var4 != null && (var1 || var5) && this.ab.nextFloat() - (float)var2 * 0.01F < this.equipmentDropChances[var3]) { -- if(!var5 && var4.isItemStackDamageable()) { -+ -+ if (var4 != null && (par1 || var5) && this.rand.nextFloat() - (float)par2 * 0.01F < this.equipmentDropChances[var3]) { -+ if (!var5 && var4.isItemStackDamageable()) { - int var6 = Math.max(var4.getMaxDamage() - 25, 1); -- int var7 = var4.getMaxDamage() - this.ab.nextInt(this.ab.nextInt(var6) + 1); -- if(var7 > var6) { -+ int var7 = var4.getMaxDamage() - this.rand.nextInt(this.rand.nextInt(var6) + 1); -+ -+ if (var7 > var6) { - var7 = var6; - } - -- if(var7 < 1) { -+ if (var7 < 1) { - var7 = 1; - } - -@@ -548,54 +676,61 @@ - this.entityDropItem(var4, 0.0F); - } - } -- - } - -+ /** -+ * Makes entity wear random armor based on difficulty -+ */ - protected void addRandomArmor() { -- if(this.ab.nextFloat() < 0.15F * this.worldObj.getLocationTensionFactor(this.posX, this.posY, this.posZ)) { -- int var1 = this.ab.nextInt(2); -+ if (this.rand.nextFloat() < 0.15F * this.worldObj.getLocationTensionFactor(this.posX, this.posY, this.posZ)) { -+ int var1 = this.rand.nextInt(2); - float var2 = this.worldObj.difficultySetting == 3 ? 0.1F : 0.25F; -- if(this.ab.nextFloat() < 0.095F) { -- ++var1; -- } -- -- if(this.ab.nextFloat() < 0.095F) { -- ++var1; -- } -- -- if(this.ab.nextFloat() < 0.095F) { -- ++var1; -- } -- -- for(int var3 = 3; var3 >= 0; --var3) { -+ -+ if (this.rand.nextFloat() < 0.095F) { -+ ++var1; -+ } -+ -+ if (this.rand.nextFloat() < 0.095F) { -+ ++var1; -+ } -+ -+ if (this.rand.nextFloat() < 0.095F) { -+ ++var1; -+ } -+ -+ for (int var3 = 3; var3 >= 0; --var3) { - ItemStack var4 = this.func_130225_q(var3); -- if(var3 < 3 && this.ab.nextFloat() < var2) { -+ -+ if (var3 < 3 && this.rand.nextFloat() < var2) { - break; - } - -- if(var4 == null) { -+ if (var4 == null) { - Item var5 = getArmorItemForSlot(var3 + 1, var1); -- if(var5 != null) { -+ -+ if (var5 != null) { - this.setCurrentItemOrArmor(var3 + 1, new ItemStack(var5)); - } - } - } - } -- - } - -- public static int getArmorPosition(ItemStack var0) { -- if(var0.itemID != Block.pumpkin.blockID && var0.itemID != Item.skull.itemID) { -- if(var0.getItem() instanceof ItemArmor) { -- switch(((ItemArmor)var0.getItem()).armorType) { -- case 0: -- return 4; -- case 1: -- return 3; -- case 2: -- return 2; -- case 3: -- return 1; -+ public static int getArmorPosition(ItemStack par0ItemStack) { -+ if (par0ItemStack.itemID != Block.pumpkin.blockID && par0ItemStack.itemID != Item.skull.itemID) { -+ if (par0ItemStack.getItem() instanceof ItemArmor) { -+ switch (((ItemArmor)par0ItemStack.getItem()).armorType) { -+ case 0: -+ return 4; -+ -+ case 1: -+ return 3; -+ -+ case 2: -+ return 2; -+ -+ case 3: -+ return 1; - } - } - -@@ -605,85 +740,103 @@ - } - } - -- public static Item getArmorItemForSlot(int var0, int var1) { -- switch(var0) { -- case 4: -- if(var1 == 0) { -- return Item.helmetLeather; -- } else if(var1 == 1) { -- return Item.helmetGold; -- } else if(var1 == 2) { -- return Item.helmetChain; -- } else if(var1 == 3) { -- return Item.helmetIron; -- } else if(var1 == 4) { -- return Item.helmetDiamond; -- } -- case 3: -- if(var1 == 0) { -- return Item.plateLeather; -- } else if(var1 == 1) { -- return Item.plateGold; -- } else if(var1 == 2) { -- return Item.plateChain; -- } else if(var1 == 3) { -- return Item.plateIron; -- } else if(var1 == 4) { -- return Item.plateDiamond; -- } -- case 2: -- if(var1 == 0) { -- return Item.legsLeather; -- } else if(var1 == 1) { -- return Item.legsGold; -- } else if(var1 == 2) { -- return Item.legsChain; -- } else if(var1 == 3) { -- return Item.legsIron; -- } else if(var1 == 4) { -- return Item.legsDiamond; -- } -- case 1: -- if(var1 == 0) { -- return Item.bootsLeather; -- } else if(var1 == 1) { -- return Item.bootsGold; -- } else if(var1 == 2) { -- return Item.bootsChain; -- } else if(var1 == 3) { -- return Item.bootsIron; -- } else if(var1 == 4) { -- return Item.bootsDiamond; -- } -- default: -- return null; -+ /** -+ * Params: Armor slot, Item tier -+ */ -+ public static Item getArmorItemForSlot(int par0, int par1) { -+ switch (par0) { -+ case 4: -+ if (par1 == 0) { -+ return Item.helmetLeather; -+ } else if (par1 == 1) { -+ return Item.helmetGold; -+ } else if (par1 == 2) { -+ return Item.helmetChain; -+ } else if (par1 == 3) { -+ return Item.helmetIron; -+ } else if (par1 == 4) { -+ return Item.helmetDiamond; -+ } -+ -+ case 3: -+ if (par1 == 0) { -+ return Item.plateLeather; -+ } else if (par1 == 1) { -+ return Item.plateGold; -+ } else if (par1 == 2) { -+ return Item.plateChain; -+ } else if (par1 == 3) { -+ return Item.plateIron; -+ } else if (par1 == 4) { -+ return Item.plateDiamond; -+ } -+ -+ case 2: -+ if (par1 == 0) { -+ return Item.legsLeather; -+ } else if (par1 == 1) { -+ return Item.legsGold; -+ } else if (par1 == 2) { -+ return Item.legsChain; -+ } else if (par1 == 3) { -+ return Item.legsIron; -+ } else if (par1 == 4) { -+ return Item.legsDiamond; -+ } -+ -+ case 1: -+ if (par1 == 0) { -+ return Item.bootsLeather; -+ } else if (par1 == 1) { -+ return Item.bootsGold; -+ } else if (par1 == 2) { -+ return Item.bootsChain; -+ } else if (par1 == 3) { -+ return Item.bootsIron; -+ } else if (par1 == 4) { -+ return Item.bootsDiamond; -+ } -+ -+ default: -+ return null; - } - } - -+ /** -+ * Enchants the entity's armor and held item based on difficulty -+ */ - protected void enchantEquipment() { - float var1 = this.worldObj.getLocationTensionFactor(this.posX, this.posY, this.posZ); -- if(this.getHeldItem() != null && this.ab.nextFloat() < 0.25F * var1) { -- EnchantmentHelper.addRandomEnchantment(this.ab, this.getHeldItem(), (int)(5.0F + var1 * (float)this.ab.nextInt(18))); -+ -+ if (this.getHeldItem() != null && this.rand.nextFloat() < 0.25F * var1) { -+ EnchantmentHelper.addRandomEnchantment(this.rand, this.getHeldItem(), (int)(5.0F + var1 * (float)this.rand.nextInt(18))); - } - -- for(int var2 = 0; var2 < 4; ++var2) { -+ for (int var2 = 0; var2 < 4; ++var2) { - ItemStack var3 = this.func_130225_q(var2); -- if(var3 != null && this.ab.nextFloat() < 0.5F * var1) { -- EnchantmentHelper.addRandomEnchantment(this.ab, var3, (int)(5.0F + var1 * (float)this.ab.nextInt(18))); -+ -+ if (var3 != null && this.rand.nextFloat() < 0.5F * var1) { -+ EnchantmentHelper.addRandomEnchantment(this.rand, var3, (int)(5.0F + var1 * (float)this.rand.nextInt(18))); - } - } -- -- } -- -- public EntityLivingData onSpawnWithEgg(EntityLivingData var1) { -- this.getEntityAttribute(SharedMonsterAttributes.followRange).applyModifier(new AttributeModifier("Random spawn bonus", this.ab.nextGaussian() * 0.05D, 1)); -- return var1; -- } -- -+ } -+ -+ public EntityLivingData onSpawnWithEgg(EntityLivingData par1EntityLivingData) { -+ this.getEntityAttribute(SharedMonsterAttributes.followRange).applyModifier(new AttributeModifier("Random spawn bonus", this.rand.nextGaussian() * 0.05D, 1)); -+ return par1EntityLivingData; -+ } -+ -+ /** -+ * returns true if all the conditions for steering the entity are met. For pigs, this is true if it is being ridden by -+ * a player and the player is holding a carrot-on-a-stick -+ */ - public boolean canBeSteered() { - return false; - } - -+ /** -+ * Gets the username of the entity. -+ */ - public String getEntityName() { - return this.hasCustomNameTag() ? this.getCustomNameTag() : super.getEntityName(); - } -@@ -692,8 +845,8 @@ - this.persistenceRequired = true; - } - -- public void setCustomNameTag(String var1) { -- this.dataWatcher.updateObject(10, var1); -+ public void setCustomNameTag(String par1Str) { -+ this.dataWatcher.updateObject(10, par1Str); - } - - public String getCustomNameTag() { -@@ -704,8 +857,8 @@ - return this.dataWatcher.getWatchableObjectString(10).length() > 0; - } - -- public void setAlwaysRenderNameTag(boolean var1) { -- this.dataWatcher.updateObject(11, Byte.valueOf((byte)(var1 ? 1 : 0))); -+ public void setAlwaysRenderNameTag(boolean par1) { -+ this.dataWatcher.updateObject(11, Byte.valueOf((byte)(par1 ? 1 : 0))); - } - - public boolean getAlwaysRenderNameTag() { -@@ -716,79 +869,85 @@ - return this.getAlwaysRenderNameTag(); - } - -- public void setEquipmentDropChance(int var1, float var2) { -- this.equipmentDropChances[var1] = var2; -+ public void setEquipmentDropChance(int par1, float par2) { -+ this.equipmentDropChances[par1] = par2; - } - - public boolean canPickUpLoot() { - return this.canPickUpLoot; - } - -- public void setCanPickUpLoot(boolean var1) { -- this.canPickUpLoot = var1; -+ public void setCanPickUpLoot(boolean par1) { -+ this.canPickUpLoot = par1; - } - - public boolean isNoDespawnRequired() { - return this.persistenceRequired; - } - -- public final boolean interactFirst(EntityPlayer var1) { -- if(this.getLeashed() && this.getLeashedToEntity() == var1) { -- this.clearLeashed(true, !var1.capabilities.isCreativeMode); -+ /** -+ * First layer of player interaction -+ */ -+ public final boolean interactFirst(EntityPlayer par1EntityPlayer) { -+ if (this.getLeashed() && this.getLeashedToEntity() == par1EntityPlayer) { -+ this.clearLeashed(true, !par1EntityPlayer.capabilities.isCreativeMode); - return true; - } else { -- ItemStack var2 = var1.inventory.getCurrentItem(); -- if(var2 != null && var2.itemID == Item.leash.itemID && this.allowLeashing()) { -- if(!(this instanceof EntityTameable) || !((EntityTameable)this).isTamed()) { -- this.setLeashedToEntity(var1, true); -- --var2.stackSize; -- return true; -- } -- -- if(var1.getCommandSenderName().equalsIgnoreCase(((EntityTameable)this).getOwnerName())) { -- this.setLeashedToEntity(var1, true); -- --var2.stackSize; -- return true; -- } -- } -- -- if(this.interact(var1)) { -- return true; -- } else { -- return super.interactFirst(var1); -- } -+ ItemStack var2 = par1EntityPlayer.inventory.getCurrentItem(); -+ -+ if (var2 != null && var2.itemID == Item.leash.itemID && this.allowLeashing()) { -+ if (!(this instanceof EntityTameable) || !((EntityTameable)this).isTamed()) { -+ this.setLeashedToEntity(par1EntityPlayer, true); -+ --var2.stackSize; -+ return true; -+ } -+ -+ if (par1EntityPlayer.getCommandSenderName().equalsIgnoreCase(((EntityTameable)this).getOwnerName())) { -+ this.setLeashedToEntity(par1EntityPlayer, true); -+ --var2.stackSize; -+ return true; -+ } -+ } -+ -+ return this.interact(par1EntityPlayer) ? true : super.interactFirst(par1EntityPlayer); - } - } - -- protected boolean interact(EntityPlayer var1) { -+ /** -+ * Called when a player interacts with a mob. e.g. gets milk from a cow, gets into the saddle on a pig. -+ */ -+ protected boolean interact(EntityPlayer par1EntityPlayer) { - return false; - } - - protected void func_110159_bB() { -- if(this.field_110170_bx != null) { -+ if (this.field_110170_bx != null) { - this.recreateLeash(); - } - -- if(this.isLeashed) { -- if(this.leashedToEntity == null || this.leashedToEntity.isDead) { -+ if (this.isLeashed) { -+ if (this.leashedToEntity == null || this.leashedToEntity.isDead) { - this.clearLeashed(true, true); - } - } - } - -- public void clearLeashed(boolean var1, boolean var2) { -- if(this.isLeashed) { -+ /** -+ * Removes the leash from this entity. Second parameter tells whether to send a packet to surrounding players. -+ */ -+ public void clearLeashed(boolean par1, boolean par2) { -+ if (this.isLeashed) { - this.isLeashed = false; - this.leashedToEntity = null; -- if(!this.worldObj.isRemote && var2) { -+ -+ if (!this.worldObj.isRemote && par2) { - this.dropItem(Item.leash.itemID, 1); - } - -- if(!this.worldObj.isRemote && var1 && this.worldObj instanceof WorldServer) { -- ((WorldServer)this.worldObj).getEntityTracker().sendPacketToTrackedPlayers(this, new Packet39AttachEntity(1, this, (Entity)null)); -+ if (!this.worldObj.isRemote && par1 && this.worldObj instanceof WorldServer) { -+ ((WorldServer)this.worldObj).getEntityTracker().sendPacketToAllPlayersTrackingEntity(this, new Packet39AttachEntity(1, this, (Entity)null)); - } - } -- - } - - public boolean allowLeashing() { -@@ -803,35 +962,41 @@ - return this.leashedToEntity; - } - -- public void setLeashedToEntity(Entity var1, boolean var2) { -+ /** -+ * Sets the entity to be leashed to.\nArgs:\n@param par1Entity: The entity to be tethered to.\n@param par2: Whether to -+ * send an attaching notification packet to surrounding players. -+ */ -+ public void setLeashedToEntity(Entity par1Entity, boolean par2) { - this.isLeashed = true; -- this.leashedToEntity = var1; -- if(!this.worldObj.isRemote && var2 && this.worldObj instanceof WorldServer) { -- ((WorldServer)this.worldObj).getEntityTracker().sendPacketToTrackedPlayers(this, new Packet39AttachEntity(1, this, this.leashedToEntity)); -- } -+ this.leashedToEntity = par1Entity; - -+ if (!this.worldObj.isRemote && par2 && this.worldObj instanceof WorldServer) { -+ ((WorldServer)this.worldObj).getEntityTracker().sendPacketToAllPlayersTrackingEntity(this, new Packet39AttachEntity(1, this, this.leashedToEntity)); -+ } - } - - private void recreateLeash() { -- if(this.isLeashed && this.field_110170_bx != null) { -- if(this.field_110170_bx.hasKey("UUIDMost") && this.field_110170_bx.hasKey("UUIDLeast")) { -+ if (this.isLeashed && this.field_110170_bx != null) { -+ if (this.field_110170_bx.hasKey("UUIDMost") && this.field_110170_bx.hasKey("UUIDLeast")) { - UUID var5 = new UUID(this.field_110170_bx.getLong("UUIDMost"), this.field_110170_bx.getLong("UUIDLeast")); - List var6 = this.worldObj.getEntitiesWithinAABB(EntityLivingBase.class, this.boundingBox.expand(10.0D, 10.0D, 10.0D)); - Iterator var7 = var6.iterator(); - -- while(var7.hasNext()) { -+ while (var7.hasNext()) { - EntityLivingBase var8 = (EntityLivingBase)var7.next(); -- if(var8.getUniqueID().equals(var5)) { -+ -+ if (var8.getUniqueID().equals(var5)) { - this.leashedToEntity = var8; - break; - } - } -- } else if(this.field_110170_bx.hasKey("X") && this.field_110170_bx.hasKey("Y") && this.field_110170_bx.hasKey("Z")) { -+ } else if (this.field_110170_bx.hasKey("X") && this.field_110170_bx.hasKey("Y") && this.field_110170_bx.hasKey("Z")) { - int var1 = this.field_110170_bx.getInteger("X"); - int var2 = this.field_110170_bx.getInteger("Y"); - int var3 = this.field_110170_bx.getInteger("Z"); - EntityLeashKnot var4 = EntityLeashKnot.getKnotForBlock(this.worldObj, var1, var2, var3); -- if(var4 == null) { -+ -+ if (var4 == null) { - var4 = EntityLeashKnot.func_110129_a(this.worldObj, var1, var2, var3); - } - -@@ -842,5 +1007,5 @@ - } - - this.field_110170_bx = null; -- } -+ } - } ---- /dev/null -+++ org/spoutcraft/client/entity/EntityText.java -@@ -1,0 +1,118 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.client.entity; -+ -+import net.minecraft.src.Entity; -+import net.minecraft.src.FontRenderer; -+import net.minecraft.src.NBTTagCompound; -+import net.minecraft.src.World; -+ -+import org.bukkit.ChatColor; -+ -+import org.spoutcraft.client.SpoutClient; -+ -+public class EntityText extends Entity { -+ private String text; -+ -+ private boolean rotateWithPlayer = true; -+ -+ private float scale = 1.0F; -+ -+ private int duration; -+ -+ public EntityText(World var1) { -+ super(var1); -+ setText(ChatColor.RED + "test " + ChatColor.GREEN + "Some Green Text"); -+ setPosition(-125, 90, 1501); -+ updateGeometry(); -+ this.clientonly = true; -+ isDead = false; -+ } -+ -+ @Override -+ protected void entityInit() { -+ } -+ -+ @Override -+ protected void readEntityFromNBT(NBTTagCompound var1) { -+ text = var1.getString("text"); -+ rotateWithPlayer = var1.getBoolean("rotateWithPlayer"); -+ scale = var1.getFloat("scale"); -+ } -+ -+ @Override -+ protected void writeEntityToNBT(NBTTagCompound var1) { -+ var1.setString("text", text); -+ var1.setBoolean("rotateWithPlayer", rotateWithPlayer); -+ var1.setFloat("scale", scale); -+ } -+ -+ public void setText(String text) { -+ this.text = text; -+ updateGeometry(); -+ } -+ -+ public String getText() { -+ return text; -+ } -+ -+ public void setRotateWithPlayer(boolean rotateWithPlayer) { -+ this.rotateWithPlayer = rotateWithPlayer; -+ } -+ -+ public boolean isRotateWithPlayer() { -+ return rotateWithPlayer; -+ } -+ -+ public void setScale(float scale) { -+ this.scale = scale; -+ updateGeometry(); -+ } -+ -+ public float getScale() { -+ return scale; -+ } -+ -+ private void updateGeometry() { -+ FontRenderer font = SpoutClient.getHandle().fontRenderer; -+ this.width = (float) font.getStringWidth(text) * 0.0139F * scale; -+ this.height = 0.124F * scale; -+ } -+ -+ public void setDuration(int duration) { -+ this.duration = duration; -+ } -+ -+ @Override -+ public void onUpdate() { -+ super.onUpdate(); -+ if (duration > 0) { -+ if (duration < ticksExisted) { -+ this.setDead(); -+ } -+ } -+ moveEntity(motionX, motionY, motionZ); -+ } -+ -+ @Override -+ protected boolean canTriggerWalking() { -+ return false; -+ } -+} ---- net/minecraft/src/BiomeEndDecorator.java -+++ net/minecraft/src/BiomeEndDecorator.java -@@ -1,26 +1,30 @@ - package net.minecraft.src; - - public class BiomeEndDecorator extends BiomeDecorator { -- protected WorldGenerator spikeGen = new WorldGenSpikes(Block.whiteStone.blockID); -+ protected WorldGenerator spikeGen; - -- public BiomeEndDecorator(BiomeGenBase var1) { -- super(var1); -+ public BiomeEndDecorator(BiomeGenBase par1BiomeGenBase) { -+ super(par1BiomeGenBase); -+ this.spikeGen = new WorldGenSpikes(Block.whiteStone.blockID); - } - -+ /** -+ * The method that does the work of actually decorating chunks -+ */ - protected void decorate() { - this.generateOres(); -- if(this.b.nextInt(5) == 0) { -- int var1 = this.chunk_X + this.b.nextInt(16) + 8; -- int var2 = this.chunk_Z + this.b.nextInt(16) + 8; -+ -+ if (this.randomGenerator.nextInt(5) == 0) { -+ int var1 = this.chunk_X + this.randomGenerator.nextInt(16) + 8; -+ int var2 = this.chunk_Z + this.randomGenerator.nextInt(16) + 8; - int var3 = this.currentWorld.getTopSolidOrLiquidBlock(var1, var2); -- this.spikeGen.generate(this.currentWorld, this.b, var1, var3, var2); -+ this.spikeGen.generate(this.currentWorld, this.randomGenerator, var1, var3, var2); - } - -- if(this.chunk_X == 0 && this.chunk_Z == 0) { -+ if (this.chunk_X == 0 && this.chunk_Z == 0) { - EntityDragon var4 = new EntityDragon(this.currentWorld); -- var4.setLocationAndAngles(0.0D, 128.0D, 0.0D, this.b.nextFloat() * 360.0F, 0.0F); -+ var4.setLocationAndAngles(0.0D, 128.0D, 0.0D, this.randomGenerator.nextFloat() * 360.0F, 0.0F); - this.currentWorld.spawnEntityInWorld(var4); - } -- - } - } ---- net/minecraft/src/EntityBreakingFX.java -+++ net/minecraft/src/EntityBreakingFX.java -@@ -1,53 +1,81 @@ - package net.minecraft.src; - -+import net.minecraft.src.Item; -+import net.minecraft.src.Minecraft; -+import net.minecraft.src.World; -+ -+import org.newdawn.slick.opengl.Texture; -+ -+import org.spoutcraft.client.io.CustomTextureManager; -+import org.spoutcraft.client.SpoutClient; -+ - public class EntityBreakingFX extends EntityFX { -- public EntityBreakingFX(World var1, double var2, double var4, double var6, Item var8) { -- this(var1, var2, var4, var6, var8, 0); -- } -- -- public EntityBreakingFX(World var1, double var2, double var4, double var6, Item var8, int var9) { -- super(var1, var2, var4, var6, 0.0D, 0.0D, 0.0D); -- this.setParticleIcon(var8.getIconFromDamage(var9)); -+ -+ public Texture currentTexture = null; -+ -+ // Spout > Lots of things changed in this class. -+ public EntityBreakingFX(World par1World, double par2, double par4, double par6, Item par8Item) { -+ this(par1World, par2, par4, par6, par8Item, 0, null); -+ } -+ -+ public EntityBreakingFX(World par1World, double par2, double par4, double par6, Item par8Item, int par9) { -+ this(par1World, par2, par4, par6, par8Item, par9, null); -+ } -+ -+ public EntityBreakingFX(World par1World, double par2, double par4, double par6, Item par8Item, int par9, Texture texture) { -+ super(par1World, par2, par4, par6, 0.0D, 0.0D, 0.0D); -+ this.currentTexture = texture; -+ this.setParticleIcon(par8Item.getIconFromDamage(par9)); - this.particleRed = this.particleGreen = this.particleBlue = 1.0F; - this.particleGravity = Block.blockSnow.blockParticleGravity; - this.particleScale /= 2.0F; -- } -- -- public EntityBreakingFX(World var1, double var2, double var4, double var6, double var8, double var10, double var12, Item var14, int var15) { -- this(var1, var2, var4, var6, var14, var15); -- this.motionX *= (double)0.1F; -- this.motionY *= (double)0.1F; -- this.motionZ *= (double)0.1F; -- this.motionX += var8; -- this.motionY += var10; -- this.motionZ += var12; -+ -+ } -+ -+ public EntityBreakingFX(World par1World, double par2, double par4, double par6, double par8, double par10, double par12, Item par14Item, int par15) { -+ this(par1World, par2, par4, par6, par8, par10, par12, par14Item, par15, null); -+ } -+ -+ public EntityBreakingFX(World par1World, double par2, double par4, double par6, double par8, double par10, double par12, Item par14Item, int par15, Texture texture) { -+ this(par1World, par2, par4, par6, par14Item, par15, texture); -+ this.motionX *= 0.10000000149011612D; -+ this.motionY *= 0.10000000149011612D; -+ this.motionZ *= 0.10000000149011612D; -+ this.motionX += par8; -+ this.motionY += par10; -+ this.motionZ += par12; - } - - public int getFXLayer() { - return 2; - } - -- public void renderParticle(Tessellator var1, float var2, float var3, float var4, float var5, float var6, float var7) { -+ public void renderParticle(Tessellator par1Tessellator, float par2, float par3, float par4, float par5, float par6, float par7) { -+ if (currentTexture != null) { -+ SpoutClient.getHandle().renderEngine.bindTexture(currentTexture.getTextureID()); -+ } - float var8 = ((float)this.particleTextureIndexX + this.particleTextureJitterX / 4.0F) / 16.0F; -- float var9 = var8 + 0.999F / 64.0F; -+ float var9 = var8 + 0.015609375F; - float var10 = ((float)this.particleTextureIndexY + this.particleTextureJitterY / 4.0F) / 16.0F; -- float var11 = var10 + 0.999F / 64.0F; -+ float var11 = var10 + 0.015609375F; - float var12 = 0.1F * this.particleScale; -- if(this.particleIcon != null) { -+ -+ if (this.particleIcon != null) { - var8 = this.particleIcon.getInterpolatedU((double)(this.particleTextureJitterX / 4.0F * 16.0F)); - var9 = this.particleIcon.getInterpolatedU((double)((this.particleTextureJitterX + 1.0F) / 4.0F * 16.0F)); - var10 = this.particleIcon.getInterpolatedV((double)(this.particleTextureJitterY / 4.0F * 16.0F)); - var11 = this.particleIcon.getInterpolatedV((double)((this.particleTextureJitterY + 1.0F) / 4.0F * 16.0F)); - } -- -- float var13 = (float)(this.prevPosX + (this.posX - this.prevPosX) * (double)var2 - interpPosX); -- float var14 = (float)(this.prevPosY + (this.posY - this.prevPosY) * (double)var2 - interpPosY); -- float var15 = (float)(this.prevPosZ + (this.posZ - this.prevPosZ) * (double)var2 - interpPosZ); -+ -+ // ToDo: More work needed here to set the custom X/Y coords of the vertex calculations since we are not using icons for custom blocks. -+ float var13 = (float)(this.prevPosX + (this.posX - this.prevPosX) * (double)par2 - interpPosX); -+ float var14 = (float)(this.prevPosY + (this.posY - this.prevPosY) * (double)par2 - interpPosY); -+ float var15 = (float)(this.prevPosZ + (this.posZ - this.prevPosZ) * (double)par2 - interpPosZ); - float var16 = 1.0F; -- var1.setColorOpaque_F(var16 * this.particleRed, var16 * this.particleGreen, var16 * this.particleBlue); -- var1.addVertexWithUV((double)(var13 - var3 * var12 - var6 * var12), (double)(var14 - var4 * var12), (double)(var15 - var5 * var12 - var7 * var12), (double)var8, (double)var11); -- var1.addVertexWithUV((double)(var13 - var3 * var12 + var6 * var12), (double)(var14 + var4 * var12), (double)(var15 - var5 * var12 + var7 * var12), (double)var8, (double)var10); -- var1.addVertexWithUV((double)(var13 + var3 * var12 + var6 * var12), (double)(var14 + var4 * var12), (double)(var15 + var5 * var12 + var7 * var12), (double)var9, (double)var10); -- var1.addVertexWithUV((double)(var13 + var3 * var12 - var6 * var12), (double)(var14 - var4 * var12), (double)(var15 + var5 * var12 - var7 * var12), (double)var9, (double)var11); -+ par1Tessellator.setColorOpaque_F(var16 * this.particleRed, var16 * this.particleGreen, var16 * this.particleBlue); -+ par1Tessellator.addVertexWithUV((double)(var13 - par3 * var12 - par6 * var12), (double)(var14 - par4 * var12), (double)(var15 - par5 * var12 - par7 * var12), (double)var8, (double)var11); -+ par1Tessellator.addVertexWithUV((double)(var13 - par3 * var12 + par6 * var12), (double)(var14 + par4 * var12), (double)(var15 - par5 * var12 + par7 * var12), (double)var8, (double)var10); -+ par1Tessellator.addVertexWithUV((double)(var13 + par3 * var12 + par6 * var12), (double)(var14 + par4 * var12), (double)(var15 + par5 * var12 + par7 * var12), (double)var9, (double)var10); -+ par1Tessellator.addVertexWithUV((double)(var13 + par3 * var12 - par6 * var12), (double)(var14 - par4 * var12), (double)(var15 + par5 * var12 - par7 * var12), (double)var9, (double)var11); - } - } ---- net/minecraft/src/EntityAIOcelotAttack.java -+++ net/minecraft/src/EntityAIOcelotAttack.java -@@ -6,15 +6,19 @@ - EntityLivingBase theVictim; - int attackCountdown; - -- public EntityAIOcelotAttack(EntityLiving var1) { -- this.theEntity = var1; -- this.theWorld = var1.worldObj; -+ public EntityAIOcelotAttack(EntityLiving par1EntityLiving) { -+ this.theEntity = par1EntityLiving; -+ this.theWorld = par1EntityLiving.worldObj; - this.setMutexBits(3); - } - -+ /** -+ * Returns whether the EntityAIBase should begin execution. -+ */ - public boolean shouldExecute() { - EntityLivingBase var1 = this.theEntity.getAttackTarget(); -- if(var1 == null) { -+ -+ if (var1 == null) { - return false; - } else { - this.theVictim = var1; -@@ -22,30 +26,41 @@ - } - } - -+ /** -+ * Returns whether an in-progress EntityAIBase should continue executing -+ */ - public boolean continueExecuting() { - return !this.theVictim.isEntityAlive() ? false : (this.theEntity.getDistanceSqToEntity(this.theVictim) > 225.0D ? false : !this.theEntity.getNavigator().noPath() || this.shouldExecute()); - } - -+ /** -+ * Resets the task -+ */ - public void resetTask() { - this.theVictim = null; - this.theEntity.getNavigator().clearPathEntity(); - } - -+ /** -+ * Updates the task -+ */ - public void updateTask() { - this.theEntity.getLookHelper().setLookPositionWithEntity(this.theVictim, 30.0F, 30.0F); - double var1 = (double)(this.theEntity.width * 2.0F * this.theEntity.width * 2.0F); - double var3 = this.theEntity.getDistanceSq(this.theVictim.posX, this.theVictim.boundingBox.minY, this.theVictim.posZ); - double var5 = 0.8D; -- if(var3 > var1 && var3 < 16.0D) { -+ -+ if (var3 > var1 && var3 < 16.0D) { - var5 = 1.33D; -- } else if(var3 < 225.0D) { -+ } else if (var3 < 225.0D) { - var5 = 0.6D; - } - - this.theEntity.getNavigator().tryMoveToEntityLiving(this.theVictim, var5); - this.attackCountdown = Math.max(this.attackCountdown - 1, 0); -- if(var3 <= var1) { -- if(this.attackCountdown <= 0) { -+ -+ if (var3 <= var1) { -+ if (this.attackCountdown <= 0) { - this.attackCountdown = 20; - this.theEntity.attackEntityAsMob(this.theVictim); - } ---- net/minecraft/src/ComponentScatteredFeatureSwampHut.java -+++ net/minecraft/src/ComponentScatteredFeatureSwampHut.java -@@ -3,77 +3,83 @@ - import java.util.Random; - - public class ComponentScatteredFeatureSwampHut extends ComponentScatteredFeature { -+ -+ /** Whether this swamp hut has a witch. */ - private boolean hasWitch; - -- public ComponentScatteredFeatureSwampHut() { -- } -- -- public ComponentScatteredFeatureSwampHut(Random var1, int var2, int var3) { -- super(var1, var2, 64, var3, 7, 5, 9); -- } -- -- protected void func_143012_a(NBTTagCompound var1) { -- super.func_143012_a(var1); -- var1.setBoolean("Witch", this.hasWitch); -- } -- -- protected void func_143011_b(NBTTagCompound var1) { -- super.func_143011_b(var1); -- this.hasWitch = var1.getBoolean("Witch"); -- } -- -- public boolean addComponentParts(World var1, Random var2, StructureBoundingBox var3) { -- if(!this.func_74935_a(var1, var3, 0)) { -+ public ComponentScatteredFeatureSwampHut() {} -+ -+ public ComponentScatteredFeatureSwampHut(Random par1Random, int par2, int par3) { -+ super(par1Random, par2, 64, par3, 7, 5, 9); -+ } -+ -+ protected void func_143012_a(NBTTagCompound par1NBTTagCompound) { -+ super.func_143012_a(par1NBTTagCompound); -+ par1NBTTagCompound.setBoolean("Witch", this.hasWitch); -+ } -+ -+ protected void func_143011_b(NBTTagCompound par1NBTTagCompound) { -+ super.func_143011_b(par1NBTTagCompound); -+ this.hasWitch = par1NBTTagCompound.getBoolean("Witch"); -+ } -+ -+ /** -+ * second Part of Structure generating, this for example places Spiderwebs, Mob Spawners, it closes Mineshafts at the -+ * end, it adds Fences... -+ */ -+ public boolean addComponentParts(World par1World, Random par2Random, StructureBoundingBox par3StructureBoundingBox) { -+ if (!this.func_74935_a(par1World, par3StructureBoundingBox, 0)) { - return false; - } else { -- this.fillWithMetadataBlocks(var1, var3, 1, 1, 1, 5, 1, 7, Block.planks.blockID, 1, Block.planks.blockID, 1, false); -- this.fillWithMetadataBlocks(var1, var3, 1, 4, 2, 5, 4, 7, Block.planks.blockID, 1, Block.planks.blockID, 1, false); -- this.fillWithMetadataBlocks(var1, var3, 2, 1, 0, 4, 1, 0, Block.planks.blockID, 1, Block.planks.blockID, 1, false); -- this.fillWithMetadataBlocks(var1, var3, 2, 2, 2, 3, 3, 2, Block.planks.blockID, 1, Block.planks.blockID, 1, false); -- this.fillWithMetadataBlocks(var1, var3, 1, 2, 3, 1, 3, 6, Block.planks.blockID, 1, Block.planks.blockID, 1, false); -- this.fillWithMetadataBlocks(var1, var3, 5, 2, 3, 5, 3, 6, Block.planks.blockID, 1, Block.planks.blockID, 1, false); -- this.fillWithMetadataBlocks(var1, var3, 2, 2, 7, 4, 3, 7, Block.planks.blockID, 1, Block.planks.blockID, 1, false); -- this.fillWithBlocks(var1, var3, 1, 0, 2, 1, 3, 2, Block.wood.blockID, Block.wood.blockID, false); -- this.fillWithBlocks(var1, var3, 5, 0, 2, 5, 3, 2, Block.wood.blockID, Block.wood.blockID, false); -- this.fillWithBlocks(var1, var3, 1, 0, 7, 1, 3, 7, Block.wood.blockID, Block.wood.blockID, false); -- this.fillWithBlocks(var1, var3, 5, 0, 7, 5, 3, 7, Block.wood.blockID, Block.wood.blockID, false); -- this.placeBlockAtCurrentPosition(var1, Block.fence.blockID, 0, 2, 3, 2, var3); -- this.placeBlockAtCurrentPosition(var1, Block.fence.blockID, 0, 3, 3, 7, var3); -- this.placeBlockAtCurrentPosition(var1, 0, 0, 1, 3, 4, var3); -- this.placeBlockAtCurrentPosition(var1, 0, 0, 5, 3, 4, var3); -- this.placeBlockAtCurrentPosition(var1, 0, 0, 5, 3, 5, var3); -- this.placeBlockAtCurrentPosition(var1, Block.flowerPot.blockID, 7, 1, 3, 5, var3); -- this.placeBlockAtCurrentPosition(var1, Block.workbench.blockID, 0, 3, 2, 6, var3); -- this.placeBlockAtCurrentPosition(var1, Block.cauldron.blockID, 0, 4, 2, 6, var3); -- this.placeBlockAtCurrentPosition(var1, Block.fence.blockID, 0, 1, 2, 1, var3); -- this.placeBlockAtCurrentPosition(var1, Block.fence.blockID, 0, 5, 2, 1, var3); -+ this.fillWithMetadataBlocks(par1World, par3StructureBoundingBox, 1, 1, 1, 5, 1, 7, Block.planks.blockID, 1, Block.planks.blockID, 1, false); -+ this.fillWithMetadataBlocks(par1World, par3StructureBoundingBox, 1, 4, 2, 5, 4, 7, Block.planks.blockID, 1, Block.planks.blockID, 1, false); -+ this.fillWithMetadataBlocks(par1World, par3StructureBoundingBox, 2, 1, 0, 4, 1, 0, Block.planks.blockID, 1, Block.planks.blockID, 1, false); -+ this.fillWithMetadataBlocks(par1World, par3StructureBoundingBox, 2, 2, 2, 3, 3, 2, Block.planks.blockID, 1, Block.planks.blockID, 1, false); -+ this.fillWithMetadataBlocks(par1World, par3StructureBoundingBox, 1, 2, 3, 1, 3, 6, Block.planks.blockID, 1, Block.planks.blockID, 1, false); -+ this.fillWithMetadataBlocks(par1World, par3StructureBoundingBox, 5, 2, 3, 5, 3, 6, Block.planks.blockID, 1, Block.planks.blockID, 1, false); -+ this.fillWithMetadataBlocks(par1World, par3StructureBoundingBox, 2, 2, 7, 4, 3, 7, Block.planks.blockID, 1, Block.planks.blockID, 1, false); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 1, 0, 2, 1, 3, 2, Block.wood.blockID, Block.wood.blockID, false); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 5, 0, 2, 5, 3, 2, Block.wood.blockID, Block.wood.blockID, false); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 1, 0, 7, 1, 3, 7, Block.wood.blockID, Block.wood.blockID, false); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 5, 0, 7, 5, 3, 7, Block.wood.blockID, Block.wood.blockID, false); -+ this.placeBlockAtCurrentPosition(par1World, Block.fence.blockID, 0, 2, 3, 2, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.fence.blockID, 0, 3, 3, 7, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, 0, 0, 1, 3, 4, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, 0, 0, 5, 3, 4, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, 0, 0, 5, 3, 5, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.flowerPot.blockID, 7, 1, 3, 5, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.workbench.blockID, 0, 3, 2, 6, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.cauldron.blockID, 0, 4, 2, 6, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.fence.blockID, 0, 1, 2, 1, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.fence.blockID, 0, 5, 2, 1, par3StructureBoundingBox); - int var4 = this.getMetadataWithOffset(Block.stairsWoodOak.blockID, 3); - int var5 = this.getMetadataWithOffset(Block.stairsWoodOak.blockID, 1); - int var6 = this.getMetadataWithOffset(Block.stairsWoodOak.blockID, 0); - int var7 = this.getMetadataWithOffset(Block.stairsWoodOak.blockID, 2); -- this.fillWithMetadataBlocks(var1, var3, 0, 4, 1, 6, 4, 1, Block.stairsWoodSpruce.blockID, var4, Block.stairsWoodSpruce.blockID, var4, false); -- this.fillWithMetadataBlocks(var1, var3, 0, 4, 2, 0, 4, 7, Block.stairsWoodSpruce.blockID, var6, Block.stairsWoodSpruce.blockID, var6, false); -- this.fillWithMetadataBlocks(var1, var3, 6, 4, 2, 6, 4, 7, Block.stairsWoodSpruce.blockID, var5, Block.stairsWoodSpruce.blockID, var5, false); -- this.fillWithMetadataBlocks(var1, var3, 0, 4, 8, 6, 4, 8, Block.stairsWoodSpruce.blockID, var7, Block.stairsWoodSpruce.blockID, var7, false); -- -+ this.fillWithMetadataBlocks(par1World, par3StructureBoundingBox, 0, 4, 1, 6, 4, 1, Block.stairsWoodSpruce.blockID, var4, Block.stairsWoodSpruce.blockID, var4, false); -+ this.fillWithMetadataBlocks(par1World, par3StructureBoundingBox, 0, 4, 2, 0, 4, 7, Block.stairsWoodSpruce.blockID, var6, Block.stairsWoodSpruce.blockID, var6, false); -+ this.fillWithMetadataBlocks(par1World, par3StructureBoundingBox, 6, 4, 2, 6, 4, 7, Block.stairsWoodSpruce.blockID, var5, Block.stairsWoodSpruce.blockID, var5, false); -+ this.fillWithMetadataBlocks(par1World, par3StructureBoundingBox, 0, 4, 8, 6, 4, 8, Block.stairsWoodSpruce.blockID, var7, Block.stairsWoodSpruce.blockID, var7, false); - int var8; - int var9; -- for(var8 = 2; var8 <= 7; var8 += 5) { -- for(var9 = 1; var9 <= 5; var9 += 4) { -- this.fillCurrentPositionBlocksDownwards(var1, Block.wood.blockID, 0, var9, -1, var8, var3); -+ -+ for (var8 = 2; var8 <= 7; var8 += 5) { -+ for (var9 = 1; var9 <= 5; var9 += 4) { -+ this.fillCurrentPositionBlocksDownwards(par1World, Block.wood.blockID, 0, var9, -1, var8, par3StructureBoundingBox); - } - } - -- if(!this.hasWitch) { -+ if (!this.hasWitch) { - var8 = this.getXWithOffset(2, 5); - var9 = this.getYWithOffset(2); - int var10 = this.getZWithOffset(2, 5); -- if(var3.isVecInside(var8, var9, var10)) { -+ -+ if (par3StructureBoundingBox.isVecInside(var8, var9, var10)) { - this.hasWitch = true; -- EntityWitch var11 = new EntityWitch(var1); -+ EntityWitch var11 = new EntityWitch(par1World); - var11.setLocationAndAngles((double)var8 + 0.5D, (double)var9, (double)var10 + 0.5D, 0.0F, 0.0F); - var11.onSpawnWithEgg((EntityLivingData)null); -- var1.spawnEntityInWorld(var11); -+ par1World.spawnEntityInWorld(var11); - } - } - ---- net/minecraft/src/ItemMultiTextureTile.java -+++ net/minecraft/src/ItemMultiTextureTile.java -@@ -2,30 +2,41 @@ - - public class ItemMultiTextureTile extends ItemBlock { - private final Block theBlock; -- private final String[] b; -+ private final String[] field_82804_b; - -- public ItemMultiTextureTile(int var1, Block var2, String[] var3) { -- super(var1); -- this.theBlock = var2; -- this.b = var3; -+ public ItemMultiTextureTile(int par1, Block par2Block, String[] par3ArrayOfStr) { -+ super(par1); -+ this.theBlock = par2Block; -+ this.field_82804_b = par3ArrayOfStr; - this.setMaxDamage(0); - this.setHasSubtypes(true); - } - -- public Icon getIconFromDamage(int var1) { -- return this.theBlock.getIcon(2, var1); -- } -- -- public int getMetadata(int var1) { -- return var1; -- } -- -- public String getUnlocalizedName(ItemStack var1) { -- int var2 = var1.getItemDamage(); -- if(var2 < 0 || var2 >= this.b.length) { -+ /** -+ * Gets an icon index based on an item's damage value -+ */ -+ public Icon getIconFromDamage(int par1) { -+ return this.theBlock.getIcon(2, par1); -+ } -+ -+ /** -+ * Returns the metadata of the block which this Item (ItemBlock) can place -+ */ -+ public int getMetadata(int par1) { -+ return par1; -+ } -+ -+ /** -+ * Returns the unlocalized name of this item. This version accepts an ItemStack so different stacks can have different -+ * names based on their damage or NBT. -+ */ -+ public String getUnlocalizedName(ItemStack par1ItemStack) { -+ int var2 = par1ItemStack.getItemDamage(); -+ -+ if (var2 < 0 || var2 >= this.field_82804_b.length) { - var2 = 0; - } - -- return super.getUnlocalizedName() + "." + this.b[var2]; -+ return super.getUnlocalizedName() + "." + this.field_82804_b[var2]; - } - } ---- net/minecraft/src/ItemMap.java -+++ net/minecraft/src/ItemMap.java -@@ -3,74 +3,78 @@ - import java.util.List; - - public class ItemMap extends ItemMapBase { -- protected ItemMap(int var1) { -- super(var1); -+ protected ItemMap(int par1) { -+ super(par1); - this.setHasSubtypes(true); - } - -- public static MapData getMPMapData(short var0, World var1) { -- String var2 = "map_" + var0; -- MapData var3 = (MapData)var1.loadItemData(MapData.class, var2); -- if(var3 == null) { -+ public static MapData getMPMapData(short par0, World par1World) { -+ String var2 = "map_" + par0; -+ MapData var3 = (MapData)par1World.loadItemData(MapData.class, var2); -+ -+ if (var3 == null) { - var3 = new MapData(var2); -- var1.setItemData(var2, var3); -+ par1World.setItemData(var2, var3); - } - - return var3; - } - -- public MapData getMapData(ItemStack var1, World var2) { -- String var3 = "map_" + var1.getItemDamage(); -- MapData var4 = (MapData)var2.loadItemData(MapData.class, var3); -- if(var4 == null && !var2.isRemote) { -- var1.setItemDamage(var2.getUniqueDataId("map")); -- var3 = "map_" + var1.getItemDamage(); -+ public MapData getMapData(ItemStack par1ItemStack, World par2World) { -+ String var3 = "map_" + par1ItemStack.getItemDamage(); -+ MapData var4 = (MapData)par2World.loadItemData(MapData.class, var3); -+ -+ if (var4 == null && !par2World.isRemote) { -+ par1ItemStack.setItemDamage(par2World.getUniqueDataId("map")); -+ var3 = "map_" + par1ItemStack.getItemDamage(); - var4 = new MapData(var3); - var4.scale = 3; - int var5 = 128 * (1 << var4.scale); -- var4.xCenter = Math.round((float)var2.getWorldInfo().getSpawnX() / (float)var5) * var5; -- var4.zCenter = Math.round((float)(var2.getWorldInfo().getSpawnZ() / var5)) * var5; -- var4.dimension = (byte)var2.provider.dimensionId; -+ var4.xCenter = Math.round((float)par2World.getWorldInfo().getSpawnX() / (float)var5) * var5; -+ var4.zCenter = Math.round((float)(par2World.getWorldInfo().getSpawnZ() / var5)) * var5; -+ var4.dimension = (byte)par2World.provider.dimensionId; - var4.markDirty(); -- var2.setItemData(var3, var4); -+ par2World.setItemData(var3, var4); - } - - return var4; - } - -- public void updateMapData(World var1, Entity var2, MapData var3) { -- if(var1.provider.dimensionId == var3.dimension && var2 instanceof EntityPlayer) { -+ public void updateMapData(World par1World, Entity par2Entity, MapData par3MapData) { -+ if (par1World.provider.dimensionId == par3MapData.dimension && par2Entity instanceof EntityPlayer) { - short var4 = 128; - short var5 = 128; -- int var6 = 1 << var3.scale; -- int var7 = var3.xCenter; -- int var8 = var3.zCenter; -- int var9 = MathHelper.floor_double(var2.posX - (double)var7) / var6 + var4 / 2; -- int var10 = MathHelper.floor_double(var2.posZ - (double)var8) / var6 + var5 / 2; -+ int var6 = 1 << par3MapData.scale; -+ int var7 = par3MapData.xCenter; -+ int var8 = par3MapData.zCenter; -+ int var9 = MathHelper.floor_double(par2Entity.posX - (double)var7) / var6 + var4 / 2; -+ int var10 = MathHelper.floor_double(par2Entity.posZ - (double)var8) / var6 + var5 / 2; - int var11 = 128 / var6; -- if(var1.provider.hasNoSky) { -+ -+ if (par1World.provider.hasNoSky) { - var11 /= 2; - } - -- MapInfo var12 = var3.func_82568_a((EntityPlayer)var2); -+ MapInfo var12 = par3MapData.func_82568_a((EntityPlayer)par2Entity); - ++var12.field_82569_d; - -- for(int var13 = var9 - var11 + 1; var13 < var9 + var11; ++var13) { -- if((var13 & 15) == (var12.field_82569_d & 15)) { -+ for (int var13 = var9 - var11 + 1; var13 < var9 + var11; ++var13) { -+ if ((var13 & 15) == (var12.field_82569_d & 15)) { - int var14 = 255; - int var15 = 0; - double var16 = 0.0D; - -- for(int var18 = var10 - var11 - 1; var18 < var10 + var11; ++var18) { -- if(var13 >= 0 && var18 >= -1 && var13 < var4 && var18 < var5) { -+ for (int var18 = var10 - var11 - 1; var18 < var10 + var11; ++var18) { -+ if (var13 >= 0 && var18 >= -1 && var13 < var4 && var18 < var5) { - int var19 = var13 - var9; - int var20 = var18 - var10; - boolean var21 = var19 * var19 + var20 * var20 > (var11 - 2) * (var11 - 2); - int var22 = (var7 / var6 + var13 - var4 / 2) * var6; - int var23 = (var8 / var6 + var18 - var5 / 2) * var6; - int[] var24 = new int[256]; -- Chunk var25 = var1.getChunkFromBlockCoords(var22, var23); -- if(!var25.isEmpty()) { -+ Chunk var25 = par1World.getChunkFromBlockCoords(var22, var23); -+ -+ if (!var25.isEmpty()) { - int var26 = var22 & 15; - int var27 = var23 & 15; - int var28 = 0; -@@ -79,10 +83,12 @@ - int var32; - int var33; - int var36; -- if(var1.provider.hasNoSky) { -+ -+ if (par1World.provider.hasNoSky) { - var31 = var22 + var23 * 231871; - var31 = var31 * var31 * 31287121 + var31 * 11; -- if((var31 >> 20 & 1) == 0) { -+ -+ if ((var31 >> 20 & 1) == 0) { - var24[Block.dirt.blockID] += 10; - } else { - var24[Block.stone.blockID] += 10; -@@ -90,40 +96,44 @@ - - var29 = 100.0D; - } else { -- for(var31 = 0; var31 < var6; ++var31) { -- for(var32 = 0; var32 < var6; ++var32) { -+ for (var31 = 0; var31 < var6; ++var31) { -+ for (var32 = 0; var32 < var6; ++var32) { - var33 = var25.getHeightValue(var31 + var26, var32 + var27) + 1; - int var34 = 0; -- if(var33 > 1) { -+ -+ if (var33 > 1) { - boolean var35; -+ - do { - var35 = true; - var34 = var25.getBlockID(var31 + var26, var33 - 1, var32 + var27); -- if(var34 == 0) { -+ -+ if (var34 == 0) { - var35 = false; -- } else if(var33 > 0 && var34 > 0 && Block.blocksList[var34].blockMaterial.materialMapColor == MapColor.airColor) { -+ } else if (var33 > 0 && var34 > 0 && Block.blocksList[var34].blockMaterial.materialMapColor == MapColor.airColor) { - var35 = false; - } - -- if(!var35) { -+ if (!var35) { - --var33; -- if(var33 <= 0) { -+ -+ if (var33 <= 0) { - break; - } - - var34 = var25.getBlockID(var31 + var26, var33 - 1, var32 + var27); - } -- } while(var33 > 0 && !var35); -+ } while (var33 > 0 && !var35); - -- if(var33 > 0 && var34 != 0 && Block.blocksList[var34].blockMaterial.isLiquid()) { -+ if (var33 > 0 && var34 != 0 && Block.blocksList[var34].blockMaterial.isLiquid()) { - var36 = var33 - 1; - boolean var37 = false; -- - int var41; -+ - do { - var41 = var25.getBlockID(var31 + var26, var36--, var32 + var27); - ++var28; -- } while(var36 > 0 && var41 != 0 && Block.blocksList[var41].blockMaterial.isLiquid()); -+ } while (var36 > 0 && var41 != 0 && Block.blocksList[var41].blockMaterial.isLiquid()); - } - } - -@@ -137,8 +147,8 @@ - var31 = 0; - var32 = 0; - -- for(var33 = 0; var33 < 256; ++var33) { -- if(var24[var33] > var31) { -+ for (var33 = 0; var33 < 256; ++var33) { -+ if (var24[var33] > var31) { - var32 = var33; - var31 = var24[var33]; - } -@@ -146,25 +156,29 @@ - - double var39 = (var29 - var16) * 4.0D / (double)(var6 + 4) + ((double)(var13 + var18 & 1) - 0.5D) * 0.4D; - byte var40 = 1; -- if(var39 > 0.6D) { -+ -+ if (var39 > 0.6D) { - var40 = 2; - } - -- if(var39 < -0.6D) { -+ if (var39 < -0.6D) { - var40 = 0; - } - - var36 = 0; -- if(var32 > 0) { -+ -+ if (var32 > 0) { - MapColor var42 = Block.blocksList[var32].blockMaterial.materialMapColor; -- if(var42 == MapColor.waterColor) { -+ -+ if (var42 == MapColor.waterColor) { - var39 = (double)var28 * 0.1D + (double)(var13 + var18 & 1) * 0.2D; - var40 = 1; -- if(var39 < 0.5D) { -+ -+ if (var39 < 0.5D) { - var40 = 2; - } - -- if(var39 > 0.9D) { -+ if (var39 > 0.9D) { - var40 = 0; - } - } -@@ -173,61 +187,73 @@ - } - - var16 = var29; -- if(var18 >= 0 && var19 * var19 + var20 * var20 < var11 * var11 && (!var21 || (var13 + var18 & 1) != 0)) { -- byte var43 = var3.colors[var13 + var18 * var4]; -+ -+ if (var18 >= 0 && var19 * var19 + var20 * var20 < var11 * var11 && (!var21 || (var13 + var18 & 1) != 0)) { -+ byte var43 = par3MapData.colors[var13 + var18 * var4]; - byte var38 = (byte)(var36 * 4 + var40); -- if(var43 != var38) { -- if(var14 > var18) { -+ -+ if (var43 != var38) { -+ if (var14 > var18) { - var14 = var18; - } - -- if(var15 < var18) { -+ if (var15 < var18) { - var15 = var18; - } - -- var3.colors[var13 + var18 * var4] = var38; -+ par3MapData.colors[var13 + var18 * var4] = var38; - } - } - } - } - } - -- if(var14 <= var15) { -- var3.setColumnDirty(var13, var14, var15); -+ if (var14 <= var15) { -+ par3MapData.setColumnDirty(var13, var14, var15); - } - } - } -- -- } -- } -- -- public void onUpdate(ItemStack var1, World var2, Entity var3, int var4, boolean var5) { -- if(!var2.isRemote) { -- MapData var6 = this.getMapData(var1, var2); -- if(var3 instanceof EntityPlayer) { -- EntityPlayer var7 = (EntityPlayer)var3; -- var6.updateVisiblePlayers(var7, var1); -- } -- -- if(var5) { -- this.updateMapData(var2, var3, var6); -- } -- -- } -- } -- -- public Packet getUpdatePacket(ItemStack var1, World var2, EntityPlayer var3) { -- byte[] var4 = this.getMapData(var1, var2).getUpdatePacketData(var1, var2, var3); -- return var4 == null ? null : new Packet131MapData((short)Item.map.itemID, (short)var1.getItemDamage(), var4); -- } -- -- public void onCreated(ItemStack var1, World var2, EntityPlayer var3) { -- if(var1.hasTagCompound() && var1.getTagCompound().getBoolean("map_is_scaling")) { -- MapData var4 = Item.map.getMapData(var1, var2); -- var1.setItemDamage(var2.getUniqueDataId("map")); -- MapData var5 = new MapData("map_" + var1.getItemDamage()); -+ } -+ } -+ -+ /** -+ * Called each tick as long the item is on a player inventory. Uses by maps to check if is on a player hand and update -+ * it's contents. -+ */ -+ public void onUpdate(ItemStack par1ItemStack, World par2World, Entity par3Entity, int par4, boolean par5) { -+ if (!par2World.isRemote) { -+ MapData var6 = this.getMapData(par1ItemStack, par2World); -+ -+ if (par3Entity instanceof EntityPlayer) { -+ EntityPlayer var7 = (EntityPlayer)par3Entity; -+ var6.updateVisiblePlayers(var7, par1ItemStack); -+ } -+ -+ if (par5) { -+ this.updateMapData(par2World, par3Entity, var6); -+ } -+ } -+ } -+ -+ /** -+ * returns null if no update is to be sent -+ */ -+ public Packet createMapDataPacket(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) { -+ byte[] var4 = this.getMapData(par1ItemStack, par2World).getUpdatePacketData(par1ItemStack, par2World, par3EntityPlayer); -+ return var4 == null ? null : new Packet131MapData((short)Item.map.itemID, (short)par1ItemStack.getItemDamage(), var4); -+ } -+ -+ /** -+ * Called when item is crafted/smelted. Used only by maps so far. -+ */ -+ public void onCreated(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) { -+ if (par1ItemStack.hasTagCompound() && par1ItemStack.getTagCompound().getBoolean("map_is_scaling")) { -+ MapData var4 = Item.map.getMapData(par1ItemStack, par2World); -+ par1ItemStack.setItemDamage(par2World.getUniqueDataId("map")); -+ MapData var5 = new MapData("map_" + par1ItemStack.getItemDamage()); - var5.scale = (byte)(var4.scale + 1); -- if(var5.scale > 4) { -+ -+ if (var5.scale > 4) { - var5.scale = 4; - } - -@@ -235,21 +261,23 @@ - var5.zCenter = var4.zCenter; - var5.dimension = var4.dimension; - var5.markDirty(); -- var2.setItemData("map_" + var1.getItemDamage(), var5); -+ par2World.setItemData("map_" + par1ItemStack.getItemDamage(), var5); - } -- - } - -- public void addInformation(ItemStack var1, EntityPlayer var2, List var3, boolean var4) { -- MapData var5 = this.getMapData(var1, var2.worldObj); -- if(var4) { -- if(var5 == null) { -- var3.add("Unknown map"); -+ /** -+ * allows items to add custom lines of information to the mouseover description -+ */ -+ public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4) { -+ MapData var5 = this.getMapData(par1ItemStack, par2EntityPlayer.worldObj); -+ -+ if (par4) { -+ if (var5 == null) { -+ par3List.add("Unknown map"); - } else { -- var3.add("Scaling at 1:" + (1 << var5.scale)); -- var3.add("(Level " + var5.scale + "/" + 4 + ")"); -+ par3List.add("Scaling at 1:" + (1 << var5.scale)); -+ par3List.add("(Level " + var5.scale + "/" + 4 + ")"); - } - } -- - } - } ---- /dev/null -+++ org/spoutcraft/api/gui/GenericGradient.java -@@ -1,0 +1,96 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.api.gui; -+ -+import java.io.IOException; -+ -+import org.spoutcraft.api.Spoutcraft; -+import org.spoutcraft.api.UnsafeClass; -+import org.spoutcraft.api.io.SpoutInputStream; -+import org.spoutcraft.api.io.SpoutOutputStream; -+ -+@UnsafeClass -+public class GenericGradient extends GenericWidget implements Gradient { -+ protected Color color1 = new Color(0.06F, 0.06F, 0.06F, 0.75F), color2 = new Color(0.06F, 0.06F, 0.06F, 0.82F); -+ protected Orientation axis = Orientation.VERTICAL; -+ -+ public GenericGradient() { -+ } -+ -+ public Gradient setTopColor(Color color) { -+ this.color1 = color; -+ return this; -+ } -+ -+ public Gradient setBottomColor(Color color) { -+ this.color2 = color; -+ return this; -+ } -+ -+ public Color getTopColor() { -+ return this.color1; -+ } -+ -+ public Color getBottomColor() { -+ return this.color2; -+ } -+ -+ public WidgetType getType() { -+ return WidgetType.Gradient; -+ } -+ -+ @Override -+ public int getVersion() { -+ return super.getVersion() + 2; -+ } -+ -+ @Override -+ public void readData(SpoutInputStream input) throws IOException { -+ super.readData(input); -+ this.setTopColor(input.readColor()); -+ this.setBottomColor(input.readColor()); -+ this.setOrientation(Orientation.getOrientationFromId(input.read())); -+ } -+ -+ @Override -+ public void writeData(SpoutOutputStream output) throws IOException { -+ super.writeData(output); -+ output.writeColor(getTopColor()); -+ output.writeColor(getBottomColor()); -+ output.write(getOrientation().getId()); -+ } -+ -+ @Override -+ public Gradient copy() { -+ return ((Gradient)super.copy()).setTopColor(getTopColor()).setBottomColor(getBottomColor()); -+ } -+ public void render() { -+ Spoutcraft.getClient().getRenderDelegate().render(this); -+ } -+ -+ public Gradient setOrientation(Orientation axis) { -+ this.axis = axis; -+ return this; -+ } -+ -+ public Orientation getOrientation() { -+ return axis; -+ } -+} ---- /dev/null -+++ org/spoutcraft/client/gui/controls/KeyBindingItem.java -@@ -1,0 +1,96 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.client.gui.controls; -+ -+import net.minecraft.src.FontRenderer; -+ -+import org.spoutcraft.client.SpoutClient; -+import org.spoutcraft.client.controls.SimpleKeyBindingManager; -+import org.spoutcraft.client.gui.MCRenderDelegate; -+ -+public class KeyBindingItem extends ControlsBasicItem { -+ private org.spoutcraft.api.keyboard.KeyBinding binding; -+ private ControlsModel parent; -+ private SimpleKeyBindingManager manager = (SimpleKeyBindingManager) SpoutClient.getInstance().getKeyBindingManager(); -+ public KeyBindingItem(org.spoutcraft.api.keyboard.KeyBinding binding, ControlsModel model) { -+ super(model); -+ this.parent = model; -+ this.binding = binding; -+ } -+ -+ public int getHeight() { -+ return 20; -+ } -+ -+ public void render(int x, int y, int width, int height) { -+ MCRenderDelegate r = (MCRenderDelegate) SpoutClient.getInstance().getRenderDelegate(); -+ FontRenderer font = SpoutClient.getHandle().fontRenderer; -+ font.drawStringWithShadow("B", x + 2, y + 2, 0xff0000ff); -+ int w = font.getStringWidth("B"); -+ String keyString = parent.getEditingItem() == this ? "> <" : binding.toString(); -+ int w2 = font.getStringWidth(keyString); -+ font.drawStringWithShadow(keyString, width - w2, y + 2, 0xffcccccc); -+ font.drawStringWithShadow(binding.getAddonName(), x + w + 4, y + 11, 0xffffffff); -+ String fitting = r.getFittingText(getName(), width - w - w2 - 4); -+ -+ font.drawStringWithShadow(fitting, x + w + 4, y + 2, !isConflicting() ? 0xffffffff:0xffff0000); -+ } -+ -+ @Override -+ public void setModifiers(int m) { -+ binding.setRawModifiers((byte) m); -+ } -+ -+ @Override -+ public int getModifiers() { -+ return binding.getModifiers(); -+ } -+ -+ @Override -+ public void setKey(int id) { -+ binding.setKey(id); -+ manager.updateBindings(); -+ manager.save(); -+ } -+ -+ @Override -+ public int getKey() { -+ return binding.getKey(); -+ } -+ -+ @Override -+ public boolean useModifiers() { -+ return true; -+ } -+ -+ @Override -+ public boolean useMouseButtons() { -+ return true; -+ } -+ -+ @Override -+ public String getName() { -+ return binding.getDescription(); -+ } -+ -+ public org.spoutcraft.api.keyboard.KeyBinding getBinding() { -+ return binding; -+ } -+} ---- net/minecraft/src/ItemLilyPad.java -+++ net/minecraft/src/ItemLilyPad.java -@@ -1,40 +1,46 @@ - package net.minecraft.src; - - public class ItemLilyPad extends ItemColored { -- public ItemLilyPad(int var1) { -- super(var1, false); -+ public ItemLilyPad(int par1) { -+ super(par1, false); - } - -- public ItemStack onItemRightClick(ItemStack var1, World var2, EntityPlayer var3) { -- MovingObjectPosition var4 = this.getMovingObjectPositionFromPlayer(var2, var3, true); -- if(var4 == null) { -- return var1; -+ /** -+ * Called whenever this item is equipped and the right mouse button is pressed. Args: itemStack, world, entityPlayer -+ */ -+ public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) { -+ MovingObjectPosition var4 = this.getMovingObjectPositionFromPlayer(par2World, par3EntityPlayer, true); -+ -+ if (var4 == null) { -+ return par1ItemStack; - } else { -- if(var4.typeOfHit == EnumMovingObjectType.TILE) { -+ if (var4.typeOfHit == EnumMovingObjectType.TILE) { - int var5 = var4.blockX; - int var6 = var4.blockY; - int var7 = var4.blockZ; -- if(!var2.canMineBlock(var3, var5, var6, var7)) { -- return var1; -- } -- -- if(!var3.canPlayerEdit(var5, var6, var7, var4.sideHit, var1)) { -- return var1; -- } -- -- if(var2.getBlockMaterial(var5, var6, var7) == Material.water && var2.getBlockMetadata(var5, var6, var7) == 0 && var2.isAirBlock(var5, var6 + 1, var7)) { -- var2.setBlock(var5, var6 + 1, var7, Block.waterlily.blockID); -- if(!var3.capabilities.isCreativeMode) { -- --var1.stackSize; -+ -+ if (!par2World.canMineBlock(par3EntityPlayer, var5, var6, var7)) { -+ return par1ItemStack; -+ } -+ -+ if (!par3EntityPlayer.canPlayerEdit(var5, var6, var7, var4.sideHit, par1ItemStack)) { -+ return par1ItemStack; -+ } -+ -+ if (par2World.getBlockMaterial(var5, var6, var7) == Material.water && par2World.getBlockMetadata(var5, var6, var7) == 0 && par2World.isAirBlock(var5, var6 + 1, var7)) { -+ par2World.setBlock(var5, var6 + 1, var7, Block.waterlily.blockID); -+ -+ if (!par3EntityPlayer.capabilities.isCreativeMode) { -+ --par1ItemStack.stackSize; - } - } - } - -- return var1; -+ return par1ItemStack; - } - } - -- public int getColorFromItemStack(ItemStack var1, int var2) { -- return Block.waterlily.getRenderColor(var1.getItemDamage()); -+ public int getColorFromItemStack(ItemStack par1ItemStack, int par2) { -+ return Block.waterlily.getRenderColor(par1ItemStack.getItemDamage()); - } - } ---- net/minecraft/src/ItemMapBase.java -+++ net/minecraft/src/ItemMapBase.java -@@ -1,15 +1,21 @@ - package net.minecraft.src; - - public class ItemMapBase extends Item { -- protected ItemMapBase(int var1) { -- super(var1); -+ protected ItemMapBase(int par1) { -+ super(par1); - } - -+ /** -+ * false for all Items except sub-classes of ItemMapBase -+ */ - public boolean isMap() { - return true; - } - -- public Packet getUpdatePacket(ItemStack var1, World var2, EntityPlayer var3) { -+ /** -+ * returns null if no update is to be sent -+ */ -+ public Packet createMapDataPacket(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) { - return null; - } - } ---- net/minecraft/src/CallableJavaInfo.java -+++ net/minecraft/src/CallableJavaInfo.java -@@ -3,12 +3,17 @@ - import java.util.concurrent.Callable; - - class CallableJavaInfo implements Callable { -+ -+ /** Reference to the CrashReport object. */ - final CrashReport theCrashReport; - -- CallableJavaInfo(CrashReport var1) { -- this.theCrashReport = var1; -+ CallableJavaInfo(CrashReport par1CrashReport) { -+ this.theCrashReport = par1CrashReport; - } - -+ /** -+ * Returns the Java VM Information as a String. Includes the Version and Vender. -+ */ - public String getJavaInfoAsString() { - return System.getProperty("java.version") + ", " + System.getProperty("java.vendor"); - } ---- /dev/null -+++ org/spoutcraft/api/gui/GenericOverlayScreen.java -@@ -1,0 +1,43 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.api.gui; -+ -+import org.spoutcraft.api.UnsafeClass; -+ -+@UnsafeClass -+public class GenericOverlayScreen extends GenericScreen implements OverlayScreen { -+ ScreenType screenType; -+ -+ public GenericOverlayScreen() { -+ } -+ -+ public WidgetType getType() { -+ return WidgetType.OverlayScreen; -+ } -+ -+ public ScreenType getScreenType() { -+ return screenType; -+ } -+ -+ public OverlayScreen setScreenType(ScreenType screenType) { -+ this.screenType = screenType; -+ return this; -+ } -+} ---- net/minecraft/src/EnumArt.java -+++ net/minecraft/src/EnumArt.java -@@ -28,18 +28,21 @@ - Skeleton("Skeleton", 64, 48, 192, 64), - DonkeyKong("DonkeyKong", 64, 48, 192, 112); - -+ /** Holds the maximum length of paintings art title. */ - public static final int maxArtTitleLength = "SkullAndRoses".length(); -- public final String B; -+ -+ /** Painting Title. */ -+ public final String title; - public final int sizeX; - public final int sizeY; - public final int offsetX; - public final int offsetY; - -- private EnumArt(String var3, int var4, int var5, int var6, int var7) { -- this.B = var3; -- this.sizeX = var4; -- this.sizeY = var5; -- this.offsetX = var6; -- this.offsetY = var7; -+ private EnumArt(String par3Str, int par4, int par5, int par6, int par7) { -+ this.title = par3Str; -+ this.sizeX = par4; -+ this.sizeY = par5; -+ this.offsetX = par6; -+ this.offsetY = par7; - } - } ---- net/minecraft/src/RenderPig.java -+++ net/minecraft/src/RenderPig.java -@@ -3,30 +3,48 @@ - public class RenderPig extends RenderLiving { - private static final ResourceLocation saddledPigTextures = new ResourceLocation("textures/entity/pig/pig_saddle.png"); - private static final ResourceLocation pigTextures = new ResourceLocation("textures/entity/pig/pig.png"); -- -- public RenderPig(ModelBase var1, ModelBase var2, float var3) { -- super(var1, var3); -- this.setRenderPassModel(var2); -+ -+ public RenderPig(ModelBase par1ModelBase, ModelBase par2ModelBase, float par3) { -+ super(par1ModelBase, par3); -+ this.setRenderPassModel(par2ModelBase); - } - -- protected int renderSaddledPig(EntityPig var1, int var2, float var3) { -- if(var2 == 0 && var1.getSaddled()) { -+ protected int renderSaddledPig(EntityPig par1EntityPig, int par2, float par3) { -+ // Spout Start -+ //ToDO: EntitySkinType's need to be fixed -+ //loadTexture(par1EntityPig.getCustomTexture(EntitySkinType.PIG_SADDLE, "/mob/saddle.png")); -+ -+ // Spout End -+ if (par2 == 0 && par1EntityPig.getSaddled()) { -+ // Spout Start - Unused -+ //this.loadTexture("/mob/saddle.png"); - this.bindTexture(saddledPigTextures); -+ // Spout Endz - return 1; - } else { - return -1; - } - } - -- protected ResourceLocation getPigTextures(EntityPig var1) { -+ public void renderLivingPig(EntityPig par1EntityPig, double par2, double par4, double par6, float par8, float par9) { -+ super.doRenderLiving(par1EntityPig, par2, par4, par6, par8, par9); -+ } -+ -+ protected ResourceLocation getPigTextures(EntityPig par1EntityPig) { - return pigTextures; - } - -- protected int shouldRenderPass(EntityLivingBase var1, int var2, float var3) { -- return this.renderSaddledPig((EntityPig)var1, var2, var3); -+ /** -+ * Queries whether should render the specified pass or not. -+ */ -+ protected int shouldRenderPass(EntityLivingBase par1EntityLivingBase, int par2, float par3) { -+ return this.renderSaddledPig((EntityPig)par1EntityLivingBase, par2, par3); - } - -- protected ResourceLocation getEntityTexture(Entity var1) { -- return this.getPigTextures((EntityPig)var1); -+ /** -+ * Returns the location of an entity's texture. Doesn't seem to be called unless you call Render.bindEntityTexture. -+ */ -+ protected ResourceLocation getEntityTexture(Entity par1Entity) { -+ return this.getPigTextures((EntityPig)par1Entity); - } - } ---- net/minecraft/src/CommandServerMessage.java -+++ net/minecraft/src/CommandServerMessage.java -@@ -6,43 +6,53 @@ - - public class CommandServerMessage extends CommandBase { - public List getCommandAliases() { -- return Arrays.asList(new String[]{"w", "msg"}); -+ return Arrays.asList(new String[] {"w", "msg"}); - } - - public String getCommandName() { - return "tell"; - } - -+ /** -+ * Return the required permission level for this command. -+ */ - public int getRequiredPermissionLevel() { - return 0; - } - -- public String getCommandUsage(ICommandSender var1) { -+ public String getCommandUsage(ICommandSender par1ICommandSender) { - return "commands.message.usage"; - } - -- public void processCommand(ICommandSender var1, String[] var2) { -- if(var2.length < 2) { -+ public void processCommand(ICommandSender par1ICommandSender, String[] par2ArrayOfStr) { -+ if (par2ArrayOfStr.length < 2) { - throw new WrongUsageException("commands.message.usage", new Object[0]); - } else { -- EntityPlayerMP var3 = getPlayer(var1, var2[0]); -- if(var3 == null) { -+ EntityPlayerMP var3 = getPlayer(par1ICommandSender, par2ArrayOfStr[0]); -+ -+ if (var3 == null) { - throw new PlayerNotFoundException(); -- } else if(var3 == var1) { -+ } else if (var3 == par1ICommandSender) { - throw new PlayerNotFoundException("commands.message.sameTarget", new Object[0]); - } else { -- String var4 = func_82361_a(var1, var2, 1, !(var1 instanceof EntityPlayer)); -- var3.sendChatToPlayer(ChatMessageComponent.createFromTranslationWithSubstitutions("commands.message.display.incoming", new Object[]{var1.getCommandSenderName(), var4}).setColor(EnumChatFormatting.GRAY).setItalic(Boolean.valueOf(true))); -- var1.sendChatToPlayer(ChatMessageComponent.createFromTranslationWithSubstitutions("commands.message.display.outgoing", new Object[]{var3.getCommandSenderName(), var4}).setColor(EnumChatFormatting.GRAY).setItalic(Boolean.valueOf(true))); -+ String var4 = func_82361_a(par1ICommandSender, par2ArrayOfStr, 1, !(par1ICommandSender instanceof EntityPlayer)); -+ var3.sendChatToPlayer(ChatMessageComponent.createFromTranslationWithSubstitutions("commands.message.display.incoming", new Object[] {par1ICommandSender.getCommandSenderName(), var4}).setColor(EnumChatFormatting.GRAY).setItalic(Boolean.valueOf(true))); -+ par1ICommandSender.sendChatToPlayer(ChatMessageComponent.createFromTranslationWithSubstitutions("commands.message.display.outgoing", new Object[] {var3.getCommandSenderName(), var4}).setColor(EnumChatFormatting.GRAY).setItalic(Boolean.valueOf(true))); - } - } - } - -- public List addTabCompletionOptions(ICommandSender var1, String[] var2) { -- return getListOfStringsMatchingLastWord(var2, MinecraftServer.getServer().getAllUsernames()); -+ /** -+ * Adds the strings available in this command to the given list of tab completion options. -+ */ -+ public List addTabCompletionOptions(ICommandSender par1ICommandSender, String[] par2ArrayOfStr) { -+ return getListOfStringsMatchingLastWord(par2ArrayOfStr, MinecraftServer.getServer().getAllUsernames()); - } - -- public boolean isUsernameIndex(String[] var1, int var2) { -- return var2 == 0; -+ /** -+ * Return whether the specified command parameter index is a username parameter. -+ */ -+ public boolean isUsernameIndex(String[] par1ArrayOfStr, int par2) { -+ return par2 == 0; - } - } ---- /dev/null -+++ org/spoutcraft/api/material/block/GenericBlock.java -@@ -1,0 +1,120 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.api.material.block; -+ -+import org.spoutcraft.api.Spoutcraft; -+import org.spoutcraft.api.block.design.BlockDesign; -+import org.spoutcraft.api.material.Block; -+ -+public class GenericBlock implements Block{ -+ private final int id; -+ private final int data; -+ private final boolean subtypes; -+ private final String name; -+ private String customName; -+ private BlockDesign design; -+ -+ private GenericBlock(String name, int id, int data, boolean subtypes) { -+ this.name = name; -+ this.id = id; -+ this.data = data; -+ this.subtypes = subtypes; -+ } -+ -+ protected GenericBlock(String name, int id, int data) { -+ this(name, id, data, true); -+ } -+ -+ protected GenericBlock(String name, int id) { -+ this(name, id, 0, false); -+ } -+ -+ public int getRawId() { -+ return id; -+ } -+ -+ public int getRawData() { -+ return data; -+ } -+ -+ public boolean hasSubtypes() { -+ return subtypes; -+ } -+ -+ public String getName() { -+ if (customName != null) { -+ return customName; -+ } -+ return name; -+ } -+ -+ public String getNotchianName() { -+ return name; -+ } -+ -+ public void setName(String name) { -+ this.customName = name; -+ } -+ -+ public float getFriction() { -+ return Spoutcraft.getClient().getMaterialManager().getFriction(this); -+ } -+ -+ public Block setFriction(float friction) { -+ Spoutcraft.getClient().getMaterialManager().setFriction(this, friction); -+ return this; -+ } -+ -+ public float getHardness() { -+ return Spoutcraft.getClient().getMaterialManager().getHardness(this); -+ } -+ -+ public Block setHardness(float hardness) { -+ Spoutcraft.getClient().getMaterialManager().setHardness(this, hardness); -+ return this; -+ } -+ -+ public boolean isOpaque() { -+ return Spoutcraft.getClient().getMaterialManager().isOpaque(this); -+ } -+ -+ public Block setOpaque(boolean opaque) { -+ Spoutcraft.getClient().getMaterialManager().setOpaque(this, opaque); -+ return this; -+ } -+ -+ public int getLightLevel() { -+ return Spoutcraft.getClient().getMaterialManager().getLightLevel(this); -+ } -+ -+ public Block setLightLevel(int level) { -+ Spoutcraft.getClient().getMaterialManager().setLightLevel(this, level); -+ return this; -+ } -+ -+ public BlockDesign getBlockDesign() { -+ return design; -+ } -+ -+ public Block setBlockDesign(BlockDesign design) { -+ this.design = design; -+ return this; -+ } -+} ---- net/minecraft/src/GuiScreenClientOutdated.java -+++ net/minecraft/src/GuiScreenClientOutdated.java -@@ -3,35 +3,45 @@ - public class GuiScreenClientOutdated extends GuiScreen { - private final GuiScreen previousScreen; - -- public GuiScreenClientOutdated(GuiScreen var1) { -- this.previousScreen = var1; -+ public GuiScreenClientOutdated(GuiScreen par1GuiScreen) { -+ this.previousScreen = par1GuiScreen; - } - -+ /** -+ * Adds the buttons (and other controls) to the screen in question. -+ */ - public void initGui() { -- this.i.clear(); -- this.i.add(new GuiButton(0, this.width / 2 - 100, this.height / 4 + 120 + 12, "Back")); -+ this.buttonList.clear(); -+ this.buttonList.add(new GuiButton(0, this.width / 2 - 100, this.height / 4 + 120 + 12, "Back")); - } - -- public void drawScreen(int var1, int var2, float var3) { -+ /** -+ * Draws the screen and all the components in it. -+ */ -+ public void drawScreen(int par1, int par2, float par3) { - this.drawDefaultBackground(); - String var4 = I18n.getString("mco.client.outdated.title"); - String var5 = I18n.getString("mco.client.outdated.msg"); - this.drawCenteredString(this.fontRenderer, var4, this.width / 2, this.height / 2 - 50, 16711680); - this.drawCenteredString(this.fontRenderer, var5, this.width / 2, this.height / 2 - 30, 16777215); -- super.drawScreen(var1, var2, var3); -- } -- -- protected void actionPerformed(GuiButton var1) { -- if(var1.id == 0) { -- this.mc.displayGuiScreen(this.previousScreen); -- } -- -- } -- -- protected void keyTyped(char var1, int var2) { -- if(var2 == 28 || var2 == 156) { -- this.mc.displayGuiScreen(this.previousScreen); -- } -- -+ super.drawScreen(par1, par2, par3); -+ } -+ -+ /** -+ * Fired when a control is clicked. This is the equivalent of ActionListener.actionPerformed(ActionEvent e). -+ */ -+ protected void actionPerformed(GuiButton par1GuiButton) { -+ if (par1GuiButton.id == 0) { -+ this.mc.displayGuiScreen(this.previousScreen); -+ } -+ } -+ -+ /** -+ * Fired when a key is typed. This is the equivalent of KeyListener.keyTyped(KeyEvent e). -+ */ -+ protected void keyTyped(char par1, int par2) { -+ if (par2 == 28 || par2 == 156) { -+ this.mc.displayGuiScreen(this.previousScreen); -+ } - } - } ---- net/minecraft/src/PositionTextureVertex.java -+++ net/minecraft/src/PositionTextureVertex.java -@@ -5,23 +5,23 @@ - public float texturePositionX; - public float texturePositionY; - -- public PositionTextureVertex(float var1, float var2, float var3, float var4, float var5) { -- this(Vec3.createVectorHelper((double)var1, (double)var2, (double)var3), var4, var5); -- } -- -- public PositionTextureVertex setTexturePosition(float var1, float var2) { -- return new PositionTextureVertex(this, var1, var2); -- } -- -- public PositionTextureVertex(PositionTextureVertex var1, float var2, float var3) { -- this.vector3D = var1.vector3D; -- this.texturePositionX = var2; -- this.texturePositionY = var3; -- } -- -- public PositionTextureVertex(Vec3 var1, float var2, float var3) { -- this.vector3D = var1; -- this.texturePositionX = var2; -- this.texturePositionY = var3; -+ public PositionTextureVertex(float par1, float par2, float par3, float par4, float par5) { -+ this(Vec3.createVectorHelper((double)par1, (double)par2, (double)par3), par4, par5); -+ } -+ -+ public PositionTextureVertex setTexturePosition(float par1, float par2) { -+ return new PositionTextureVertex(this, par1, par2); -+ } -+ -+ public PositionTextureVertex(PositionTextureVertex par1PositionTextureVertex, float par2, float par3) { -+ this.vector3D = par1PositionTextureVertex.vector3D; -+ this.texturePositionX = par2; -+ this.texturePositionY = par3; -+ } -+ -+ public PositionTextureVertex(Vec3 par1Vec3, float par2, float par3) { -+ this.vector3D = par1Vec3; -+ this.texturePositionX = par2; -+ this.texturePositionY = par3; - } - } ---- net/minecraft/src/ThreadLanServerPing.java -+++ net/minecraft/src/ThreadLanServerPing.java -@@ -6,28 +6,30 @@ - import java.net.InetAddress; - - public class ThreadLanServerPing extends Thread { -- private final String a; -- private final DatagramSocket b; -+ private final String motd; -+ -+ /** The socket we're using to send packets on. */ -+ private final DatagramSocket socket; - private boolean isStopping = true; -- private final String d; -+ private final String address; - -- public ThreadLanServerPing(String var1, String var2) { -+ public ThreadLanServerPing(String par1Str, String par2Str) throws IOException { - super("LanServerPinger"); -- this.a = var1; -- this.d = var2; -+ this.motd = par1Str; -+ this.address = par2Str; - this.setDaemon(true); -- this.b = new DatagramSocket(); -+ this.socket = new DatagramSocket(); - } - - public void run() { -- String var1 = getPingResponse(this.a, this.d); -+ String var1 = getPingResponse(this.motd, this.address); - byte[] var2 = var1.getBytes(); - -- while(!this.isInterrupted() && this.isStopping) { -+ while (!this.isInterrupted() && this.isStopping) { - try { - InetAddress var3 = InetAddress.getByName("224.0.2.60"); - DatagramPacket var4 = new DatagramPacket(var2, var2.length, var3, 4445); -- this.b.send(var4); -+ this.socket.send(var4); - } catch (IOException var6) { - Minecraft.getMinecraft().getLogAgent().logWarning("LanServerPinger: " + var6.getMessage()); - break; -@@ -36,9 +38,9 @@ - try { - sleep(1500L); - } catch (InterruptedException var5) { -+ ; - } - } -- - } - - public void interrupt() { -@@ -46,35 +48,39 @@ - this.isStopping = false; - } - -- public static String getPingResponse(String var0, String var1) { -- return "[MOTD]" + var0 + "[/MOTD][AD]" + var1 + "[/AD]"; -+ public static String getPingResponse(String par0Str, String par1Str) { -+ return "[MOTD]" + par0Str + "[/MOTD][AD]" + par1Str + "[/AD]"; - } - -- public static String getMotdFromPingResponse(String var0) { -- int var1 = var0.indexOf("[MOTD]"); -- if(var1 < 0) { -+ public static String getMotdFromPingResponse(String par0Str) { -+ int var1 = par0Str.indexOf("[MOTD]"); -+ -+ if (var1 < 0) { - return "missing no"; - } else { -- int var2 = var0.indexOf("[/MOTD]", var1 + "[MOTD]".length()); -- return var2 < var1 ? "missing no" : var0.substring(var1 + "[MOTD]".length(), var2); -+ int var2 = par0Str.indexOf("[/MOTD]", var1 + "[MOTD]".length()); -+ return var2 < var1 ? "missing no" : par0Str.substring(var1 + "[MOTD]".length(), var2); - } - } - -- public static String getAdFromPingResponse(String var0) { -- int var1 = var0.indexOf("[/MOTD]"); -- if(var1 < 0) { -+ public static String getAdFromPingResponse(String par0Str) { -+ int var1 = par0Str.indexOf("[/MOTD]"); -+ -+ if (var1 < 0) { - return null; - } else { -- int var2 = var0.indexOf("[/MOTD]", var1 + "[/MOTD]".length()); -- if(var2 >= 0) { -+ int var2 = par0Str.indexOf("[/MOTD]", var1 + "[/MOTD]".length()); -+ -+ if (var2 >= 0) { - return null; - } else { -- int var3 = var0.indexOf("[AD]", var1 + "[/MOTD]".length()); -- if(var3 < 0) { -+ int var3 = par0Str.indexOf("[AD]", var1 + "[/MOTD]".length()); -+ -+ if (var3 < 0) { - return null; - } else { -- int var4 = var0.indexOf("[/AD]", var3 + "[AD]".length()); -- return var4 < var3 ? null : var0.substring(var3 + "[AD]".length(), var4); -+ int var4 = par0Str.indexOf("[/AD]", var3 + "[AD]".length()); -+ return var4 < var3 ? null : par0Str.substring(var3 + "[AD]".length(), var4); - } - } - } ---- net/minecraft/src/RConThreadClient.java -+++ net/minecraft/src/RConThreadClient.java -@@ -8,131 +8,154 @@ - import java.net.SocketTimeoutException; - - public class RConThreadClient extends RConThreadBase { -+ -+ /** -+ * True if the client has succefssfully logged into the RCon, otherwise false -+ */ - private boolean loggedIn; -- private Socket h; -+ -+ /** The client's Socket connection */ -+ private Socket clientSocket; -+ -+ /** A buffer for incoming Socket data */ - private byte[] buffer = new byte[1460]; -- private String j; -- -- RConThreadClient(IServer var1, Socket var2) { -- super(var1); -- this.h = var2; -+ -+ /** The RCon password */ -+ private String rconPassword; -+ -+ RConThreadClient(IServer par1IServer, Socket par2Socket) { -+ super(par1IServer); -+ this.clientSocket = par2Socket; - - try { -- this.h.setSoTimeout(0); -+ this.clientSocket.setSoTimeout(0); - } catch (Exception var4) { - this.running = false; - } - -- this.j = var1.getStringProperty("rcon.password", ""); -- this.logInfo("Rcon connection from: " + var2.getInetAddress()); -+ this.rconPassword = par1IServer.getStringProperty("rcon.password", ""); -+ this.logInfo("Rcon connection from: " + par2Socket.getInetAddress()); - } - - public void run() { -- while(true) { -- try { -- if(!this.running) { -- return; -+ try { -+ while (true) { -+ if (!this.running) { -+ break; - } - -- BufferedInputStream var1 = new BufferedInputStream(this.h.getInputStream()); -+ BufferedInputStream var1 = new BufferedInputStream(this.clientSocket.getInputStream()); - int var2 = var1.read(this.buffer, 0, 1460); -- if(10 > var2) { -- return; -- } -- -- byte var3 = 0; -- int var4 = RConUtils.getBytesAsLEInt(this.buffer, 0, var2); -- if(var4 == var2 - 4) { -+ -+ if (10 <= var2) { -+ byte var3 = 0; -+ int var4 = RConUtils.getBytesAsLEInt(this.buffer, 0, var2); -+ -+ if (var4 != var2 - 4) { -+ return; -+ } -+ - int var21 = var3 + 4; - int var5 = RConUtils.getBytesAsLEInt(this.buffer, var21, var2); - var21 += 4; - int var6 = RConUtils.getRemainingBytesAsLEInt(this.buffer, var21); - var21 += 4; -- switch(var6) { -- case 2: -- if(this.loggedIn) { -- String var8 = RConUtils.getBytesAsString(this.buffer, var21, var2); -- -- try { -- this.sendMultipacketResponse(var5, this.server.handleRConCommand(var8)); -- } catch (Exception var16) { -- this.sendMultipacketResponse(var5, "Error executing: " + var8 + " (" + var16.getMessage() + ")"); -- } -- continue; -- } -- -- this.sendLoginFailedResponse(); -- continue; -- case 3: -- String var7 = RConUtils.getBytesAsString(this.buffer, var21, var2); -- int var10000 = var21 + var7.length(); -- if(0 != var7.length() && var7.equals(this.j)) { -- this.loggedIn = true; -- this.sendResponse(var5, 2, ""); -- continue; -- } -- -- this.loggedIn = false; -- this.sendLoginFailedResponse(); -- continue; -- default: -- this.sendMultipacketResponse(var5, String.format("Unknown request %s", new Object[]{Integer.toHexString(var6)})); -- continue; -+ -+ switch (var6) { -+ case 2: -+ if (this.loggedIn) { -+ String var8 = RConUtils.getBytesAsString(this.buffer, var21, var2); -+ -+ try { -+ this.sendMultipacketResponse(var5, this.server.executeCommand(var8)); -+ } catch (Exception var16) { -+ this.sendMultipacketResponse(var5, "Error executing: " + var8 + " (" + var16.getMessage() + ")"); -+ } -+ -+ continue; -+ } -+ -+ this.sendLoginFailedResponse(); -+ continue; -+ -+ case 3: -+ String var7 = RConUtils.getBytesAsString(this.buffer, var21, var2); -+ int var10000 = var21 + var7.length(); -+ -+ if (0 != var7.length() && var7.equals(this.rconPassword)) { -+ this.loggedIn = true; -+ this.sendResponse(var5, 2, ""); -+ continue; -+ } -+ -+ this.loggedIn = false; -+ this.sendLoginFailedResponse(); -+ continue; -+ -+ default: -+ this.sendMultipacketResponse(var5, String.format("Unknown request %s", new Object[] {Integer.toHexString(var6)})); -+ continue; - } - } -- } catch (SocketTimeoutException var17) { -- return; -- } catch (IOException var18) { -- return; -- } catch (Exception var19) { -- System.out.println(var19); -- return; -- } finally { -- this.closeSocket(); - } -- -- return; -+ } catch (SocketTimeoutException var17) { -+ } catch (IOException var18) { -+ } catch (Exception var19) { -+ System.out.println(var19); -+ } finally { -+ this.closeSocket(); - } - } - -- private void sendResponse(int var1, int var2, String var3) throws IOException { -+ /** -+ * Sends the given response message to the client -+ */ -+ private void sendResponse(int par1, int par2, String par3Str) throws IOException { - ByteArrayOutputStream var4 = new ByteArrayOutputStream(1248); - DataOutputStream var5 = new DataOutputStream(var4); -- byte[] var6 = var3.getBytes("UTF-8"); -+ byte[] var6 = par3Str.getBytes("UTF-8"); - var5.writeInt(Integer.reverseBytes(var6.length + 10)); -- var5.writeInt(Integer.reverseBytes(var1)); -- var5.writeInt(Integer.reverseBytes(var2)); -+ var5.writeInt(Integer.reverseBytes(par1)); -+ var5.writeInt(Integer.reverseBytes(par2)); - var5.write(var6); - var5.write(0); - var5.write(0); -- this.h.getOutputStream().write(var4.toByteArray()); -+ this.clientSocket.getOutputStream().write(var4.toByteArray()); - } - -+ /** -+ * Sends the standard RCon 'authorization failed' response packet -+ */ - private void sendLoginFailedResponse() throws IOException { - this.sendResponse(-1, 2, ""); - } - -- private void sendMultipacketResponse(int var1, String var2) throws IOException { -- int var3 = var2.length(); -+ /** -+ * Splits the response message into individual packets and sends each one -+ */ -+ private void sendMultipacketResponse(int par1, String par2Str) throws IOException { -+ int var3 = par2Str.length(); - - do { - int var4 = 4096 <= var3 ? 4096 : var3; -- this.sendResponse(var1, 0, var2.substring(0, var4)); -- var2 = var2.substring(var4); -- var3 = var2.length(); -- } while(0 != var3); -- -+ this.sendResponse(par1, 0, par2Str.substring(0, var4)); -+ par2Str = par2Str.substring(var4); -+ var3 = par2Str.length(); -+ } while (0 != var3); - } - -+ /** -+ * Closes the client socket -+ */ - private void closeSocket() { -- if(null != this.h) { -+ if (null != this.clientSocket) { - try { -- this.h.close(); -+ this.clientSocket.close(); - } catch (IOException var2) { - this.logWarning("IO: " + var2.getMessage()); - } - -- this.h = null; -+ this.clientSocket = null; - } - } - } ---- net/minecraft/src/RenderDragon.java -+++ net/minecraft/src/RenderDragon.java -@@ -8,73 +8,87 @@ - private static final ResourceLocation enderDragonCrystalBeamTextures = new ResourceLocation("textures/entity/endercrystal/endercrystal_beam.png"); - private static final ResourceLocation enderDragonEyesTextures = new ResourceLocation("textures/entity/enderdragon/dragon_eyes.png"); - private static final ResourceLocation enderDragonTextures = new ResourceLocation("textures/entity/enderdragon/dragon.png"); -- protected ModelDragon modelDragon = (ModelDragon)this.mainModel; -+ -+ /** An instance of the dragon model in RenderDragon */ -+ protected ModelDragon modelDragon; - - public RenderDragon() { - super(new ModelDragon(0.0F), 0.5F); -+ this.modelDragon = (ModelDragon)this.mainModel; - this.setRenderPassModel(this.mainModel); - } - -- protected void rotateDragonBody(EntityDragon var1, float var2, float var3, float var4) { -- float var5 = (float)var1.getMovementOffsets(7, var4)[0]; -- float var6 = (float)(var1.getMovementOffsets(5, var4)[1] - var1.getMovementOffsets(10, var4)[1]); -+ /** -+ * Used to rotate the dragon as a whole in RenderDragon. It's called in the rotateCorpse method. -+ */ -+ protected void rotateDragonBody(EntityDragon par1EntityDragon, float par2, float par3, float par4) { -+ float var5 = (float)par1EntityDragon.getMovementOffsets(7, par4)[0]; -+ float var6 = (float)(par1EntityDragon.getMovementOffsets(5, par4)[1] - par1EntityDragon.getMovementOffsets(10, par4)[1]); - GL11.glRotatef(-var5, 0.0F, 1.0F, 0.0F); - GL11.glRotatef(var6 * 10.0F, 1.0F, 0.0F, 0.0F); - GL11.glTranslatef(0.0F, 0.0F, 1.0F); -- if(var1.deathTime > 0) { -- float var7 = ((float)var1.deathTime + var4 - 1.0F) / 20.0F * 1.6F; -+ -+ if (par1EntityDragon.deathTime > 0) { -+ float var7 = ((float)par1EntityDragon.deathTime + par4 - 1.0F) / 20.0F * 1.6F; - var7 = MathHelper.sqrt_float(var7); -- if(var7 > 1.0F) { -+ -+ if (var7 > 1.0F) { - var7 = 1.0F; - } - -- GL11.glRotatef(var7 * this.getDeathMaxRotation(var1), 0.0F, 0.0F, 1.0F); -+ GL11.glRotatef(var7 * this.getDeathMaxRotation(par1EntityDragon), 0.0F, 0.0F, 1.0F); - } -- - } - -- protected void renderDragonModel(EntityDragon var1, float var2, float var3, float var4, float var5, float var6, float var7) { -- if(var1.deathTicks > 0) { -- float var8 = (float)var1.deathTicks / 200.0F; -+ /** -+ * Renders the dragon model. Called by renderModel. -+ */ -+ protected void renderDragonModel(EntityDragon par1EntityDragon, float par2, float par3, float par4, float par5, float par6, float par7) { -+ if (par1EntityDragon.deathTicks > 0) { -+ float var8 = (float)par1EntityDragon.deathTicks / 200.0F; - GL11.glDepthFunc(GL11.GL_LEQUAL); - GL11.glEnable(GL11.GL_ALPHA_TEST); - GL11.glAlphaFunc(GL11.GL_GREATER, var8); - this.bindTexture(enderDragonExplodingTextures); -- this.mainModel.render(var1, var2, var3, var4, var5, var6, var7); -+ this.mainModel.render(par1EntityDragon, par2, par3, par4, par5, par6, par7); - GL11.glAlphaFunc(GL11.GL_GREATER, 0.1F); - GL11.glDepthFunc(GL11.GL_EQUAL); - } - -- this.bindEntityTexture(var1); -- this.mainModel.render(var1, var2, var3, var4, var5, var6, var7); -- if(var1.hurtTime > 0) { -+ this.bindEntityTexture(par1EntityDragon); -+ this.mainModel.render(par1EntityDragon, par2, par3, par4, par5, par6, par7); -+ -+ if (par1EntityDragon.hurtTime > 0) { - GL11.glDepthFunc(GL11.GL_EQUAL); - GL11.glDisable(GL11.GL_TEXTURE_2D); - GL11.glEnable(GL11.GL_BLEND); - GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); - GL11.glColor4f(1.0F, 0.0F, 0.0F, 0.5F); -- this.mainModel.render(var1, var2, var3, var4, var5, var6, var7); -+ this.mainModel.render(par1EntityDragon, par2, par3, par4, par5, par6, par7); - GL11.glEnable(GL11.GL_TEXTURE_2D); - GL11.glDisable(GL11.GL_BLEND); - GL11.glDepthFunc(GL11.GL_LEQUAL); - } -- - } - -- public void renderDragon(EntityDragon var1, double var2, double var4, double var6, float var8, float var9) { -- BossStatus.setBossStatus(var1, false); -- super.doRenderLiving(var1, var2, var4, var6, var8, var9); -- if(var1.healingEnderCrystal != null) { -- float var10 = (float)var1.healingEnderCrystal.innerRotation + var9; -+ /** -+ * Renders the dragon, along with its dying animation -+ */ -+ public void renderDragon(EntityDragon par1EntityDragon, double par2, double par4, double par6, float par8, float par9) { -+ BossStatus.setBossStatus(par1EntityDragon, false); -+ super.doRenderLiving(par1EntityDragon, par2, par4, par6, par8, par9); -+ -+ if (par1EntityDragon.healingEnderCrystal != null) { -+ float var10 = (float)par1EntityDragon.healingEnderCrystal.innerRotation + par9; - float var11 = MathHelper.sin(var10 * 0.2F) / 2.0F + 0.5F; - var11 = (var11 * var11 + var11) * 0.2F; -- float var12 = (float)(var1.healingEnderCrystal.posX - var1.posX - (var1.prevPosX - var1.posX) * (double)(1.0F - var9)); -- float var13 = (float)((double)var11 + var1.healingEnderCrystal.posY - 1.0D - var1.posY - (var1.prevPosY - var1.posY) * (double)(1.0F - var9)); -- float var14 = (float)(var1.healingEnderCrystal.posZ - var1.posZ - (var1.prevPosZ - var1.posZ) * (double)(1.0F - var9)); -+ float var12 = (float)(par1EntityDragon.healingEnderCrystal.posX - par1EntityDragon.posX - (par1EntityDragon.prevPosX - par1EntityDragon.posX) * (double)(1.0F - par9)); -+ float var13 = (float)((double)var11 + par1EntityDragon.healingEnderCrystal.posY - 1.0D - par1EntityDragon.posY - (par1EntityDragon.prevPosY - par1EntityDragon.posY) * (double)(1.0F - par9)); -+ float var14 = (float)(par1EntityDragon.healingEnderCrystal.posZ - par1EntityDragon.posZ - (par1EntityDragon.prevPosZ - par1EntityDragon.posZ) * (double)(1.0F - par9)); - float var15 = MathHelper.sqrt_float(var12 * var12 + var14 * var14); - float var16 = MathHelper.sqrt_float(var12 * var12 + var13 * var13 + var14 * var14); - GL11.glPushMatrix(); -- GL11.glTranslatef((float)var2, (float)var4 + 2.0F, (float)var6); -+ GL11.glTranslatef((float)par2, (float)par4 + 2.0F, (float)par6); - GL11.glRotatef((float)(-Math.atan2((double)var14, (double)var12)) * 180.0F / (float)Math.PI - 90.0F, 0.0F, 1.0F, 0.0F); - GL11.glRotatef((float)(-Math.atan2((double)var15, (double)var13)) * 180.0F / (float)Math.PI - 90.0F, 1.0F, 0.0F, 0.0F); - Tessellator var17 = Tessellator.instance; -@@ -82,14 +96,14 @@ - GL11.glDisable(GL11.GL_CULL_FACE); - this.bindTexture(enderDragonCrystalBeamTextures); - GL11.glShadeModel(GL11.GL_SMOOTH); -- float var18 = 0.0F - ((float)var1.ticksExisted + var9) * 0.01F; -- float var19 = MathHelper.sqrt_float(var12 * var12 + var13 * var13 + var14 * var14) / 32.0F - ((float)var1.ticksExisted + var9) * 0.01F; -+ float var18 = 0.0F - ((float)par1EntityDragon.ticksExisted + par9) * 0.01F; -+ float var19 = MathHelper.sqrt_float(var12 * var12 + var13 * var13 + var14 * var14) / 32.0F - ((float)par1EntityDragon.ticksExisted + par9) * 0.01F; - var17.startDrawing(5); - byte var20 = 8; - -- for(int var21 = 0; var21 <= var20; ++var21) { -- float var22 = MathHelper.sin((float)(var21 % var20) * (float)Math.PI * 2.0F / (float)var20) * (12.0F / 16.0F); -- float var23 = MathHelper.cos((float)(var21 % var20) * (float)Math.PI * 2.0F / (float)var20) * (12.0F / 16.0F); -+ for (int var21 = 0; var21 <= var20; ++var21) { -+ float var22 = MathHelper.sin((float)(var21 % var20) * (float)Math.PI * 2.0F / (float)var20) * 0.75F; -+ float var23 = MathHelper.cos((float)(var21 % var20) * (float)Math.PI * 2.0F / (float)var20) * 0.75F; - float var24 = (float)(var21 % var20) * 1.0F / (float)var20; - var17.setColorOpaque_I(0); - var17.addVertexWithUV((double)(var22 * 0.2F), (double)(var23 * 0.2F), 0.0D, (double)var24, (double)var19); -@@ -103,21 +117,25 @@ - RenderHelper.enableStandardItemLighting(); - GL11.glPopMatrix(); - } -- - } - -- protected ResourceLocation getEnderDragonTextures(EntityDragon var1) { -+ protected ResourceLocation getEnderDragonTextures(EntityDragon par1EntityDragon) { - return enderDragonTextures; - } - -- protected void renderDragonDying(EntityDragon var1, float var2) { -- super.renderEquippedItems(var1, var2); -+ /** -+ * Renders the animation for when an enderdragon dies -+ */ -+ protected void renderDragonDying(EntityDragon par1EntityDragon, float par2) { -+ super.renderEquippedItems(par1EntityDragon, par2); - Tessellator var3 = Tessellator.instance; -- if(var1.deathTicks > 0) { -+ -+ if (par1EntityDragon.deathTicks > 0) { - RenderHelper.disableStandardItemLighting(); -- float var4 = ((float)var1.deathTicks + var2) / 200.0F; -+ float var4 = ((float)par1EntityDragon.deathTicks + par2) / 200.0F; - float var5 = 0.0F; -- if(var4 > 0.8F) { -+ -+ if (var4 > 0.8F) { - var5 = (var4 - 0.8F) / 0.2F; - } - -@@ -132,7 +150,7 @@ - GL11.glPushMatrix(); - GL11.glTranslatef(0.0F, -1.0F, -2.0F); - -- for(int var7 = 0; (float)var7 < (var4 + var4 * var4) / 2.0F * 60.0F; ++var7) { -+ for (int var7 = 0; (float)var7 < (var4 + var4 * var4) / 2.0F * 60.0F; ++var7) { - GL11.glRotatef(var6.nextFloat() * 360.0F, 1.0F, 0.0F, 0.0F); - GL11.glRotatef(var6.nextFloat() * 360.0F, 0.0F, 1.0F, 0.0F); - GL11.glRotatef(var6.nextFloat() * 360.0F, 0.0F, 0.0F, 1.0F); -@@ -162,15 +180,17 @@ - GL11.glEnable(GL11.GL_ALPHA_TEST); - RenderHelper.enableStandardItemLighting(); - } -- - } - -- protected int renderGlow(EntityDragon var1, int var2, float var3) { -- if(var2 == 1) { -+ /** -+ * Renders the overlay for glowing eyes and the mouth. Called by shouldRenderPass. -+ */ -+ protected int renderGlow(EntityDragon par1EntityDragon, int par2, float par3) { -+ if (par2 == 1) { - GL11.glDepthFunc(GL11.GL_LEQUAL); - } - -- if(var2 != 0) { -+ if (par2 != 0) { - return -1; - } else { - this.bindTexture(enderDragonEyesTextures); -@@ -180,7 +200,7 @@ - GL11.glBlendFunc(GL11.GL_ONE, GL11.GL_ONE); - GL11.glDisable(GL11.GL_LIGHTING); - GL11.glDepthFunc(GL11.GL_EQUAL); -- char var5 = '\uf0f0'; -+ char var5 = 61680; - int var6 = var5 % 65536; - int var7 = var5 / 65536; - OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, (float)var6 / 1.0F, (float)var7 / 1.0F); -@@ -191,35 +211,50 @@ - } - } - -- public void doRenderLiving(EntityLiving var1, double var2, double var4, double var6, float var8, float var9) { -- this.renderDragon((EntityDragon)var1, var2, var4, var6, var8, var9); -- } -- -- protected int shouldRenderPass(EntityLivingBase var1, int var2, float var3) { -- return this.renderGlow((EntityDragon)var1, var2, var3); -- } -- -- protected void renderEquippedItems(EntityLivingBase var1, float var2) { -- this.renderDragonDying((EntityDragon)var1, var2); -- } -- -- protected void rotateCorpse(EntityLivingBase var1, float var2, float var3, float var4) { -- this.rotateDragonBody((EntityDragon)var1, var2, var3, var4); -- } -- -- protected void renderModel(EntityLivingBase var1, float var2, float var3, float var4, float var5, float var6, float var7) { -- this.renderDragonModel((EntityDragon)var1, var2, var3, var4, var5, var6, var7); -- } -- -- public void renderPlayer(EntityLivingBase var1, double var2, double var4, double var6, float var8, float var9) { -- this.renderDragon((EntityDragon)var1, var2, var4, var6, var8, var9); -- } -- -- protected ResourceLocation getEntityTexture(Entity var1) { -- return this.getEnderDragonTextures((EntityDragon)var1); -- } -- -- public void doRender(Entity var1, double var2, double var4, double var6, float var8, float var9) { -- this.renderDragon((EntityDragon)var1, var2, var4, var6, var8, var9); -+ public void doRenderLiving(EntityLiving par1EntityLiving, double par2, double par4, double par6, float par8, float par9) { -+ this.renderDragon((EntityDragon)par1EntityLiving, par2, par4, par6, par8, par9); -+ } -+ -+ /** -+ * Queries whether should render the specified pass or not. -+ */ -+ protected int shouldRenderPass(EntityLivingBase par1EntityLivingBase, int par2, float par3) { -+ return this.renderGlow((EntityDragon)par1EntityLivingBase, par2, par3); -+ } -+ -+ protected void renderEquippedItems(EntityLivingBase par1EntityLivingBase, float par2) { -+ this.renderDragonDying((EntityDragon)par1EntityLivingBase, par2); -+ } -+ -+ protected void rotateCorpse(EntityLivingBase par1EntityLivingBase, float par2, float par3, float par4) { -+ this.rotateDragonBody((EntityDragon)par1EntityLivingBase, par2, par3, par4); -+ } -+ -+ /** -+ * Renders the model in RenderLiving -+ */ -+ protected void renderModel(EntityLivingBase par1EntityLivingBase, float par2, float par3, float par4, float par5, float par6, float par7) { -+ this.renderDragonModel((EntityDragon)par1EntityLivingBase, par2, par3, par4, par5, par6, par7); -+ } -+ -+ public void renderPlayer(EntityLivingBase par1EntityLivingBase, double par2, double par4, double par6, float par8, float par9) { -+ this.renderDragon((EntityDragon)par1EntityLivingBase, par2, par4, par6, par8, par9); -+ } -+ -+ /** -+ * Returns the location of an entity's texture. Doesn't seem to be called unless you call Render.bindEntityTexture. -+ */ -+ protected ResourceLocation getEntityTexture(Entity par1Entity) { -+ return this.getEnderDragonTextures((EntityDragon)par1Entity); -+ } -+ -+ /** -+ * Actually renders the given argument. This is a synthetic bridge method, always casting down its argument and then -+ * handing it off to a worker function which does the actual work. In all probabilty, the class Render is generic -+ * (Render -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.api.gui; -+ -+import org.spoutcraft.api.animation.Animatable; -+ -+public class Point implements Animatable{ -+ private int x, y; -+ -+ public Point() { -+ x = 0; -+ y = 0; -+ } -+ -+ public Point(int x, int y) { -+ this.x = x; -+ this.y = y; -+ } -+ -+ public Point(Point other) { -+ this.x = other.x; -+ this.y = other.y; -+ } -+ -+ public int getX() { -+ return x; -+ } -+ -+ public void setX(int x) { -+ this.x = x; -+ } -+ -+ public int getY() { -+ return y; -+ } -+ -+ public void setY(int y) { -+ this.y = y; -+ } -+ -+ public Point copy() { -+ return new Point(this); -+ } -+ -+ @Override -+ public String toString() { -+ return "Point{x=" + x + "; y=" + y + "}"; -+ } -+ -+ public Animatable getValueAt(double p, Animatable startValue, Animatable endValue) { -+ Point p1 = (Point) startValue; -+ Point p2 = (Point) endValue; -+ int x = (int) (p1.x + (p2.x - p1.x) * p); -+ int y = (int) (p1.y + (p2.y - p1.y) * p); -+ return new Point(x, y); -+ } -+} ---- /dev/null -+++ org/spoutcraft/client/gui/settings/controls/PerformanceButton.java -@@ -1,0 +1,52 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.client.gui.settings.controls; -+ -+import org.lwjgl.opengl.Display; -+ -+import net.minecraft.src.Minecraft; -+ -+import org.spoutcraft.client.config.Configuration; -+ -+public class PerformanceButton extends AutomatedButton { -+ public PerformanceButton() { -+ setTooltip("FPS Limit\nMax FPS - no limit (fastest)\nBalanced - limit 120 FPS (slower)\nPower saver - limit 40 FPS (slowest)\nVSync - limit to monitor framerate (60, 30, 20)\nBalanced and Power saver decrease the FPS even if\nthe limit value is not reached."); -+ } -+ -+ @Override -+ public String getText() { -+ switch (Configuration.getPerformance()) { -+ case 0: return "Performance: Max FPS"; -+ case 1: return "Performance: Balanced"; -+ case 2: return "Performance: Power Saver"; -+ case 3: return "Performance: Vsync"; -+ } -+ return "Unknown State: " + Configuration.getPerformance(); -+ } -+ -+ @Override -+ public void onButtonClick() { -+ Configuration.setPerformance(Configuration.getPerformance() + 1); -+ Configuration.setPerformance(Configuration.getPerformance() & 3); -+ Configuration.write(); -+ Minecraft.getMinecraft().gameSettings.limitFramerate = Configuration.getPerformance(); -+ Display.setVSyncEnabled(Configuration.getPerformance() == 3); -+ } -+} ---- net/minecraft/src/RenderVillager.java -+++ net/minecraft/src/RenderVillager.java -@@ -9,44 +9,56 @@ - private static final ResourceLocation priestVillagerTextures = new ResourceLocation("textures/entity/villager/priest.png"); - private static final ResourceLocation smithVillagerTextures = new ResourceLocation("textures/entity/villager/smith.png"); - private static final ResourceLocation butcherVillagerTextures = new ResourceLocation("textures/entity/villager/butcher.png"); -- protected ModelVillager villagerModel = (ModelVillager)this.mainModel; -+ -+ /** Model of the villager. */ -+ protected ModelVillager villagerModel; - - public RenderVillager() { - super(new ModelVillager(0.0F), 0.5F); -+ this.villagerModel = (ModelVillager)this.mainModel; - } - -- protected int shouldVillagerRenderPass(EntityVillager var1, int var2, float var3) { -+ /** -+ * Determines wether Villager Render pass or not. -+ */ -+ protected int shouldVillagerRenderPass(EntityVillager par1EntityVillager, int par2, float par3) { - return -1; - } - -- public void renderVillager(EntityVillager var1, double var2, double var4, double var6, float var8, float var9) { -- super.doRenderLiving(var1, var2, var4, var6, var8, var9); -+ public void renderVillager(EntityVillager par1EntityVillager, double par2, double par4, double par6, float par8, float par9) { -+ super.doRenderLiving(par1EntityVillager, par2, par4, par6, par8, par9); - } - -- protected ResourceLocation func_110902_a(EntityVillager var1) { -- switch(var1.getProfession()) { -- case 0: -- return farmerVillagerTextures; -- case 1: -- return librarianVillagerTextures; -- case 2: -- return priestVillagerTextures; -- case 3: -- return smithVillagerTextures; -- case 4: -- return butcherVillagerTextures; -- default: -- return villagerTextures; -+ protected ResourceLocation func_110902_a(EntityVillager par1EntityVillager) { -+ switch (par1EntityVillager.getProfession()) { -+ case 0: -+ return farmerVillagerTextures; -+ -+ case 1: -+ return librarianVillagerTextures; -+ -+ case 2: -+ return priestVillagerTextures; -+ -+ case 3: -+ return smithVillagerTextures; -+ -+ case 4: -+ return butcherVillagerTextures; -+ -+ default: -+ return villagerTextures; - } - } - -- protected void renderVillagerEquipedItems(EntityVillager var1, float var2) { -- super.renderEquippedItems(var1, var2); -+ protected void renderVillagerEquipedItems(EntityVillager par1EntityVillager, float par2) { -+ super.renderEquippedItems(par1EntityVillager, par2); - } - -- protected void preRenderVillager(EntityVillager var1, float var2) { -- float var3 = 15.0F / 16.0F; -- if(var1.getGrowingAge() < 0) { -+ protected void preRenderVillager(EntityVillager par1EntityVillager, float par2) { -+ float var3 = 0.9375F; -+ -+ if (par1EntityVillager.getGrowingAge() < 0) { - var3 = (float)((double)var3 * 0.5D); - this.shadowSize = 0.25F; - } else { -@@ -56,31 +68,47 @@ - GL11.glScalef(var3, var3, var3); - } - -- public void doRenderLiving(EntityLiving var1, double var2, double var4, double var6, float var8, float var9) { -- this.renderVillager((EntityVillager)var1, var2, var4, var6, var8, var9); -- } -- -- protected void preRenderCallback(EntityLivingBase var1, float var2) { -- this.preRenderVillager((EntityVillager)var1, var2); -- } -- -- protected int shouldRenderPass(EntityLivingBase var1, int var2, float var3) { -- return this.shouldVillagerRenderPass((EntityVillager)var1, var2, var3); -- } -- -- protected void renderEquippedItems(EntityLivingBase var1, float var2) { -- this.renderVillagerEquipedItems((EntityVillager)var1, var2); -- } -- -- public void renderPlayer(EntityLivingBase var1, double var2, double var4, double var6, float var8, float var9) { -- this.renderVillager((EntityVillager)var1, var2, var4, var6, var8, var9); -- } -- -- protected ResourceLocation getEntityTexture(Entity var1) { -- return this.func_110902_a((EntityVillager)var1); -- } -- -- public void doRender(Entity var1, double var2, double var4, double var6, float var8, float var9) { -- this.renderVillager((EntityVillager)var1, var2, var4, var6, var8, var9); -+ public void doRenderLiving(EntityLiving par1EntityLiving, double par2, double par4, double par6, float par8, float par9) { -+ this.renderVillager((EntityVillager)par1EntityLiving, par2, par4, par6, par8, par9); -+ } -+ -+ /** -+ * Allows the render to do any OpenGL state modifications necessary before the model is rendered. Args: entityLiving, -+ * partialTickTime -+ */ -+ protected void preRenderCallback(EntityLivingBase par1EntityLivingBase, float par2) { -+ this.preRenderVillager((EntityVillager)par1EntityLivingBase, par2); -+ } -+ -+ /** -+ * Queries whether should render the specified pass or not. -+ */ -+ protected int shouldRenderPass(EntityLivingBase par1EntityLivingBase, int par2, float par3) { -+ return this.shouldVillagerRenderPass((EntityVillager)par1EntityLivingBase, par2, par3); -+ } -+ -+ protected void renderEquippedItems(EntityLivingBase par1EntityLivingBase, float par2) { -+ this.renderVillagerEquipedItems((EntityVillager)par1EntityLivingBase, par2); -+ } -+ -+ public void renderPlayer(EntityLivingBase par1EntityLivingBase, double par2, double par4, double par6, float par8, float par9) { -+ this.renderVillager((EntityVillager)par1EntityLivingBase, par2, par4, par6, par8, par9); -+ } -+ -+ /** -+ * Returns the location of an entity's texture. Doesn't seem to be called unless you call Render.bindEntityTexture. -+ */ -+ protected ResourceLocation getEntityTexture(Entity par1Entity) { -+ return this.func_110902_a((EntityVillager)par1Entity); -+ } -+ -+ /** -+ * Actually renders the given argument. This is a synthetic bridge method, always casting down its argument and then -+ * handing it off to a worker function which does the actual work. In all probabilty, the class Render is generic -+ * (Render var1.scheduledTime ? 1 : (this.priority != var1.priority ? this.priority - var1.priority : (this.tickEntryID < var1.tickEntryID ? -1 : (this.tickEntryID > var1.tickEntryID ? 1 : 0)))); -+ /** -+ * Compares this tick entry to another tick entry for sorting purposes. Compared first based on the scheduled time and -+ * second based on tickEntryID. -+ */ -+ public int comparer(NextTickListEntry par1NextTickListEntry) { -+ return this.scheduledTime < par1NextTickListEntry.scheduledTime ? -1 : (this.scheduledTime > par1NextTickListEntry.scheduledTime ? 1 : (this.priority != par1NextTickListEntry.priority ? this.priority - par1NextTickListEntry.priority : (this.tickEntryID < par1NextTickListEntry.tickEntryID ? -1 : (this.tickEntryID > par1NextTickListEntry.tickEntryID ? 1 : 0)))); - } - - public String toString() { - return this.blockID + ": (" + this.xCoord + ", " + this.yCoord + ", " + this.zCoord + "), " + this.scheduledTime + ", " + this.priority + ", " + this.tickEntryID; - } - -- public int compareTo(Object var1) { -- return this.comparer((NextTickListEntry)var1); -+ public int compareTo(Object par1Obj) { -+ return this.comparer((NextTickListEntry)par1Obj); - } - } ---- /dev/null -+++ org/spoutcraft/client/gui/minimap/EntityVisibilityCheckbox.java -@@ -1,0 +1,48 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.client.gui.minimap; -+ -+import net.minecraft.src.Entity; -+ -+import org.spoutcraft.api.gui.CheckBox; -+import org.spoutcraft.api.gui.GenericCheckBox; -+ -+public class EntityVisibilityCheckbox extends GenericCheckBox { -+ private Class clazz; -+ private boolean save = true; -+ -+ public EntityVisibilityCheckbox(Class clazz, String texture) { -+ this.clazz = clazz; -+ String name = texture.substring(0, texture.length() - 4).replaceAll("_", " ").trim(); -+ setText(name); -+ save = false; -+ setChecked(MinimapConfig.getInstance().isEntityVisible(clazz)); -+ save = true; -+ } -+ -+ @Override -+ public CheckBox setChecked(boolean checked) { -+ if (save) { -+ MinimapConfig.getInstance().setEntityVisible(clazz, checked); -+ MinimapConfig.getInstance().save(); -+ } -+ return super.setChecked(checked); -+ } -+} ---- /dev/null -+++ org/spoutcraft/api/gui/GenericControl.java -@@ -1,0 +1,110 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.api.gui; -+ -+import java.io.IOException; -+ -+import org.spoutcraft.api.Spoutcraft; -+import org.spoutcraft.api.io.SpoutInputStream; -+import org.spoutcraft.api.io.SpoutOutputStream; -+ -+public abstract class GenericControl extends GenericWidget implements Control{ -+ protected boolean enabled = true; -+ protected Color color = new Color(0.878F, 0.878F, 0.878F); -+ protected Color disabledColor = new Color(0.625F, 0.625F, 0.625F); -+ protected boolean focus = false; -+ -+ public GenericControl() { -+ } -+ -+ public int getVersion() { -+ return super.getVersion() + 3; -+ } -+ -+ @Override -+ public void readData(SpoutInputStream input) throws IOException { -+ super.readData(input); -+ setEnabled(input.readBoolean()); -+ setColor(input.readColor()); -+ setDisabledColor(input.readColor()); -+ setFocus(input.readBoolean()); -+ } -+ -+ @Override -+ public void writeData(SpoutOutputStream output) throws IOException { -+ super.writeData(output); -+ output.writeBoolean(isEnabled()); -+ output.writeColor(getColor()); -+ output.writeColor(getDisabledColor()); -+ output.writeBoolean(isFocus()); -+ } -+ -+ public boolean isEnabled() { -+ return enabled; -+ } -+ -+ public Control setEnabled(boolean enable) { -+ enabled = enable; -+ return this; -+ } -+ -+ public Color getColor() { -+ return color; -+ } -+ -+ public Control setColor(Color color) { -+ this.color = color; -+ return this; -+ } -+ -+ public Color getDisabledColor() { -+ return disabledColor; -+ } -+ -+ public Control setDisabledColor(Color color) { -+ this.disabledColor = color; -+ return this; -+ } -+ -+ public boolean isFocus() { -+ return focus; -+ } -+ -+ public Control setFocus(boolean focus) { -+ if (this.focus != focus) { -+ this.focus = focus; -+ Spoutcraft.getWidgetManager().sendFocusUpdate(this, focus); -+ } -+ return this; -+ } -+ -+ @Override -+ public Control copy() { -+ return ((Control)super.copy()).setEnabled(isEnabled()).setColor(getColor().clone()).setDisabledColor(getDisabledColor().clone()); -+ } -+ -+ public boolean onKeyPressed(Keyboard key) { -+ return false; -+ } -+ -+ public boolean onKeyReleased(Keyboard key) { -+ return false; -+ } -+} ---- net/minecraft/src/GuiScreenBackupDownloadThread.java -+++ net/minecraft/src/GuiScreenBackupDownloadThread.java -@@ -3,18 +3,17 @@ - class GuiScreenBackupDownloadThread extends Thread { - final GuiScreenBackup field_111250_a; - -- GuiScreenBackupDownloadThread(GuiScreenBackup var1) { -- this.field_111250_a = var1; -+ GuiScreenBackupDownloadThread(GuiScreenBackup par1GuiScreenBackup) { -+ this.field_111250_a = par1GuiScreenBackup; - } - - public void run() { - McoClient var1 = new McoClient(GuiScreenBackup.func_110366_a(this.field_111250_a).getSession()); - - try { -- GuiScreenBackup.func_110373_a(this.field_111250_a, var1.func_111232_c(GuiScreenBackup.func_110367_b(this.field_111250_a)).a); -+ GuiScreenBackup.func_110373_a(this.field_111250_a, var1.func_111232_c(GuiScreenBackup.func_110367_b(this.field_111250_a)).field_111223_a); - } catch (ExceptionMcoService var3) { - GuiScreenBackup.func_130030_c(this.field_111250_a).getLogAgent().logSevere(var3.toString()); - } -- - } - } ---- net/minecraft/src/NBTTagEnd.java -+++ net/minecraft/src/NBTTagEnd.java -@@ -9,12 +9,19 @@ - super((String)null); - } - -- void load(DataInput var1, int var2) throws IOException { -- } -- -- void write(DataOutput var1) throws IOException { -- } -- -+ /** -+ * Read the actual data contents of the tag, implemented in NBT extension classes -+ */ -+ void load(DataInput par1DataInput, int par2) throws IOException {} -+ -+ /** -+ * Write the actual data contents of the tag, implemented in NBT extension classes -+ */ -+ void write(DataOutput par1DataOutput) throws IOException {} -+ -+ /** -+ * Gets the type byte for the tag. -+ */ - public byte getId() { - return (byte)0; - } -@@ -23,6 +30,9 @@ - return "END"; - } - -+ /** -+ * Creates a clone of the tag. -+ */ - public NBTBase copy() { - return new NBTTagEnd(); - } ---- net/minecraft/src/CommandServerWhitelist.java -+++ net/minecraft/src/CommandServerWhitelist.java -@@ -10,58 +10,61 @@ - return "whitelist"; - } - -+ /** -+ * Return the required permission level for this command. -+ */ - public int getRequiredPermissionLevel() { - return 3; - } - -- public String getCommandUsage(ICommandSender var1) { -+ public String getCommandUsage(ICommandSender par1ICommandSender) { - return "commands.whitelist.usage"; - } - -- public void processCommand(ICommandSender var1, String[] var2) { -- if(var2.length >= 1) { -- if(var2[0].equals("on")) { -+ public void processCommand(ICommandSender par1ICommandSender, String[] par2ArrayOfStr) { -+ if (par2ArrayOfStr.length >= 1) { -+ if (par2ArrayOfStr[0].equals("on")) { - MinecraftServer.getServer().getConfigurationManager().setWhiteListEnabled(true); -- notifyAdmins(var1, "commands.whitelist.enabled", new Object[0]); -+ notifyAdmins(par1ICommandSender, "commands.whitelist.enabled", new Object[0]); - return; - } - -- if(var2[0].equals("off")) { -+ if (par2ArrayOfStr[0].equals("off")) { - MinecraftServer.getServer().getConfigurationManager().setWhiteListEnabled(false); -- notifyAdmins(var1, "commands.whitelist.disabled", new Object[0]); -+ notifyAdmins(par1ICommandSender, "commands.whitelist.disabled", new Object[0]); - return; - } - -- if(var2[0].equals("list")) { -- var1.sendChatToPlayer(ChatMessageComponent.createFromTranslationWithSubstitutions("commands.whitelist.list", new Object[]{Integer.valueOf(MinecraftServer.getServer().getConfigurationManager().getWhiteListedPlayers().size()), Integer.valueOf(MinecraftServer.getServer().getConfigurationManager().getAvailablePlayerDat().length)})); -+ if (par2ArrayOfStr[0].equals("list")) { -+ par1ICommandSender.sendChatToPlayer(ChatMessageComponent.createFromTranslationWithSubstitutions("commands.whitelist.list", new Object[] {Integer.valueOf(MinecraftServer.getServer().getConfigurationManager().getWhiteListedPlayers().size()), Integer.valueOf(MinecraftServer.getServer().getConfigurationManager().getAvailablePlayerDat().length)})); - Set var3 = MinecraftServer.getServer().getConfigurationManager().getWhiteListedPlayers(); -- var1.sendChatToPlayer(ChatMessageComponent.createFromText(joinNiceString(var3.toArray(new String[var3.size()])))); -+ par1ICommandSender.sendChatToPlayer(ChatMessageComponent.createFromText(joinNiceString(var3.toArray(new String[var3.size()])))); - return; - } - -- if(var2[0].equals("add")) { -- if(var2.length < 2) { -+ if (par2ArrayOfStr[0].equals("add")) { -+ if (par2ArrayOfStr.length < 2) { - throw new WrongUsageException("commands.whitelist.add.usage", new Object[0]); - } - -- MinecraftServer.getServer().getConfigurationManager().addToWhiteList(var2[1]); -- notifyAdmins(var1, "commands.whitelist.add.success", new Object[]{var2[1]}); -+ MinecraftServer.getServer().getConfigurationManager().addToWhiteList(par2ArrayOfStr[1]); -+ notifyAdmins(par1ICommandSender, "commands.whitelist.add.success", new Object[] {par2ArrayOfStr[1]}); - return; - } - -- if(var2[0].equals("remove")) { -- if(var2.length < 2) { -+ if (par2ArrayOfStr[0].equals("remove")) { -+ if (par2ArrayOfStr.length < 2) { - throw new WrongUsageException("commands.whitelist.remove.usage", new Object[0]); - } - -- MinecraftServer.getServer().getConfigurationManager().removeFromWhitelist(var2[1]); -- notifyAdmins(var1, "commands.whitelist.remove.success", new Object[]{var2[1]}); -+ MinecraftServer.getServer().getConfigurationManager().removeFromWhitelist(par2ArrayOfStr[1]); -+ notifyAdmins(par1ICommandSender, "commands.whitelist.remove.success", new Object[] {par2ArrayOfStr[1]}); - return; - } - -- if(var2[0].equals("reload")) { -+ if (par2ArrayOfStr[0].equals("reload")) { - MinecraftServer.getServer().getConfigurationManager().loadWhiteList(); -- notifyAdmins(var1, "commands.whitelist.reloaded", new Object[0]); -+ notifyAdmins(par1ICommandSender, "commands.whitelist.reloaded", new Object[0]); - return; - } - } -@@ -69,21 +72,25 @@ - throw new WrongUsageException("commands.whitelist.usage", new Object[0]); - } - -- public List addTabCompletionOptions(ICommandSender var1, String[] var2) { -- if(var2.length == 1) { -- return getListOfStringsMatchingLastWord(var2, new String[]{"on", "off", "list", "add", "remove", "reload"}); -+ /** -+ * Adds the strings available in this command to the given list of tab completion options. -+ */ -+ public List addTabCompletionOptions(ICommandSender par1ICommandSender, String[] par2ArrayOfStr) { -+ if (par2ArrayOfStr.length == 1) { -+ return getListOfStringsMatchingLastWord(par2ArrayOfStr, new String[] {"on", "off", "list", "add", "remove", "reload"}); - } else { -- if(var2.length == 2) { -- if(var2[0].equals("add")) { -+ if (par2ArrayOfStr.length == 2) { -+ if (par2ArrayOfStr[0].equals("add")) { - String[] var3 = MinecraftServer.getServer().getConfigurationManager().getAvailablePlayerDat(); - ArrayList var4 = new ArrayList(); -- String var5 = var2[var2.length - 1]; -+ String var5 = par2ArrayOfStr[par2ArrayOfStr.length - 1]; - String[] var6 = var3; - int var7 = var3.length; - -- for(int var8 = 0; var8 < var7; ++var8) { -+ for (int var8 = 0; var8 < var7; ++var8) { - String var9 = var6[var8]; -- if(doesStringStartWith(var5, var9) && !MinecraftServer.getServer().getConfigurationManager().getWhiteListedPlayers().contains(var9)) { -+ -+ if (doesStringStartWith(var5, var9) && !MinecraftServer.getServer().getConfigurationManager().getWhiteListedPlayers().contains(var9)) { - var4.add(var9); - } - } -@@ -91,8 +98,8 @@ - return var4; - } - -- if(var2[0].equals("remove")) { -- return getListOfStringsFromIterableMatchingLastWord(var2, MinecraftServer.getServer().getConfigurationManager().getWhiteListedPlayers()); -+ if (par2ArrayOfStr[0].equals("remove")) { -+ return getListOfStringsFromIterableMatchingLastWord(par2ArrayOfStr, MinecraftServer.getServer().getConfigurationManager().getWhiteListedPlayers()); - } - } - ---- /dev/null -+++ org/spoutcraft/client/inventory/InventoryUtil.java -@@ -1,0 +1,76 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.client.inventory; -+ -+import net.minecraft.src.Minecraft; -+import net.minecraft.src.Container; -+import net.minecraft.src.EntityClientPlayerMP; -+import net.minecraft.src.InventoryPlayer; -+import net.minecraft.src.ItemStack; -+import net.minecraft.src.Packet101CloseWindow; -+import net.minecraft.src.Slot; -+ -+public class InventoryUtil { -+ public static void replaceItem(int id, int damage) { -+ int slot = -1; -+ InventoryPlayer inventory = Minecraft.getMinecraft().thePlayer.inventory; -+ for (int i = 0; i < inventory.mainInventory.length; i++) { -+ if (inventory.mainInventory[i] != null && i != inventory.currentItem) { -+ if (inventory.mainInventory[i].itemID == id && (damage == -1 || (damage == inventory.mainInventory[i].getItemDamage()))) { -+ if (!Minecraft.getMinecraft().isMultiplayerWorld()) { -+ inventory.mainInventory[inventory.currentItem].stackSize = inventory.mainInventory[i].stackSize; -+ inventory.mainInventory[inventory.currentItem].setItemDamage(inventory.mainInventory[i].getItemDamage()); -+ inventory.mainInventory[i] = null; -+ } -+ slot = i; -+ break; -+ } -+ } -+ } -+ if (Minecraft.getMinecraft().isMultiplayerWorld() && slot > -1) { -+ int window = Minecraft.getMinecraft().thePlayer.openContainer.windowId; -+ ItemStack replacement = inventory.mainInventory[slot].copy(); -+ -+ Minecraft.getMinecraft().playerController.windowClick(window, slot < 9 ? slot + 36 : slot, 0, 0, Minecraft.getMinecraft().thePlayer); -+ Minecraft.getMinecraft().playerController.windowClick(window, inventory.currentItem + 36, 0, 0, Minecraft.getMinecraft().thePlayer); -+ ((EntityClientPlayerMP)Minecraft.getMinecraft().thePlayer).sendQueue.addToSendQueue(new Packet101CloseWindow(window)); -+ ((EntityClientPlayerMP)Minecraft.getMinecraft().thePlayer).sendQueue.queued = true; -+ ((EntityClientPlayerMP)Minecraft.getMinecraft().thePlayer).sendQueue.packetQueueTime = System.currentTimeMillis() + 30L; -+ -+ ItemStack current = inventory.mainInventory[inventory.currentItem]; -+ if (replacement != null && current != null) { -+ current.stackSize = replacement.stackSize; -+ current.setItemDamage(replacement.getItemDamage()); -+ } -+ inventory.mainInventory[slot] = null; -+ } -+ } -+ -+ public static Slot getSlotFromPosition(int pos, Container inventorySlots) { -+ for (int i = 0; i < inventorySlots.inventorySlots.size(); i++) { -+ if (inventorySlots.inventorySlots.get(i) != null) { -+ if (((Slot)inventorySlots.inventorySlots.get(i)).slotIndex == pos) { -+ return ((Slot)inventorySlots.inventorySlots.get(i)); -+ } -+ } -+ } -+ return null; -+ } -+} ---- /dev/null -+++ org/spoutcraft/client/gui/InGameScreen.java -@@ -1,0 +1,251 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.client.gui; -+ -+import java.util.LinkedList; -+import java.util.UUID; -+ -+import org.spoutcraft.api.gui.ArmorBar; -+import org.spoutcraft.api.gui.BubbleBar; -+import org.spoutcraft.api.gui.ChatBar; -+import org.spoutcraft.api.gui.ChatTextBox; -+import org.spoutcraft.api.gui.ExpBar; -+import org.spoutcraft.api.gui.GenericScreen; -+import org.spoutcraft.api.gui.HealthBar; -+import org.spoutcraft.api.gui.HungerBar; -+import org.spoutcraft.api.gui.InGameHUD; -+import org.spoutcraft.api.gui.PopupScreen; -+import org.spoutcraft.api.gui.Screen; -+import org.spoutcraft.api.gui.ScreenType; -+import org.spoutcraft.api.gui.ServerPlayerList; -+import org.spoutcraft.api.gui.Widget; -+import org.spoutcraft.api.gui.WidgetType; -+import org.spoutcraft.client.SpoutClient; -+ -+public class InGameScreen extends GenericScreen implements InGameHUD { -+ protected HealthBar health; -+ protected BubbleBar bubble; -+ protected ChatBar chat; -+ protected ChatTextBox chatText; -+ protected ArmorBar armor; -+ protected HungerBar hunger; -+ protected ExpBar exp; -+ protected ServerPlayerList playerList; -+ protected PopupScreen activePopup = null; -+ protected LinkedList queuedScreens = new LinkedList(); -+ -+ public InGameScreen() { -+ this.health = new HealthBar(); -+ this.bubble = new BubbleBar(); -+ this.chat = new ChatBar(); -+ this.chatText = new ChatTextBox(); -+ this.armor = new ArmorBar(); -+ this.hunger = new HungerBar(); -+ this.exp = new ExpBar(); -+ this.playerList = new ServerPlayerList(); -+ -+ attachWidgets("Spoutcraft", health, bubble, chat, chatText, armor, hunger, exp, playerList); -+ } -+ -+ public int getVersion() { -+ return 0; -+ } -+ -+ @Override -+ public void onTick() { -+ if (SpoutClient.getHandle().currentScreen == null) { -+ activePopup = null; -+ } -+ if (activePopup != null) { -+ activePopup.onTick(); -+ } else { -+ PopupScreen queued = queuedScreens.poll(); -+ if (queued != null) { -+ attachPopupScreen(queued); -+ } -+ } -+ super.onTick(); -+ } -+ -+ @Override -+ public InGameScreen attachWidget(String addon, Widget widget) { -+ if (canAttachWidget(widget)) { -+ super.attachWidget(addon, widget); -+ return this; -+ } -+ throw new UnsupportedOperationException("Unsupported widget type"); -+ } -+ -+ @Override -+ public boolean updateWidget(Widget widget) { -+ if (widget instanceof HealthBar) { -+ health = (HealthBar)widget; -+ } else if (widget instanceof BubbleBar) { -+ bubble = (BubbleBar)widget; -+ } else if (widget instanceof ChatTextBox) { -+ chatText = (ChatTextBox)widget; -+ } else if (widget instanceof ChatBar) { -+ chat = (ChatBar)widget; -+ updateChatWindowSize((int) getWidth(), (int) getHeight()); -+ } else if (widget instanceof ArmorBar) { -+ armor = (ArmorBar)widget; -+ } else if (widget instanceof HungerBar) { -+ hunger = (HungerBar)widget; -+ } else if (widget instanceof ExpBar) { -+ exp = (ExpBar)widget; -+ } else if (widget instanceof ServerPlayerList) { -+ playerList = (ServerPlayerList)widget; -+ } -+ return super.updateWidget(widget); -+ } -+ -+ @Override -+ public Screen removeWidget(Widget widget) { -+ if (widget instanceof HealthBar) { -+ throw new UnsupportedOperationException("Cannot remove the health bar. Use setVisible(false) to hide it instead"); -+ } -+ if (widget instanceof BubbleBar) { -+ throw new UnsupportedOperationException("Cannot remove the bubble bar. Use setVisible(false) to hide it instead"); -+ } -+ if (widget instanceof ChatTextBox) { -+ throw new UnsupportedOperationException("Cannot remove the chat text box. Use setVisible(false) to hide it instead"); -+ } -+ if (widget instanceof ChatBar) { -+ throw new UnsupportedOperationException("Cannot remove the chat bar. Use setVisible(false) to hide it instead"); -+ } -+ if (widget instanceof ArmorBar) { -+ throw new UnsupportedOperationException("Cannot remove the armor bar. Use setVisible(false) to hide it instead"); -+ } -+ if (widget instanceof HungerBar) { -+ throw new UnsupportedOperationException("Cannot remove the hunger bar. Use setVisible(false) to hide it instead"); -+ } -+ if (widget instanceof ExpBar) { -+ throw new UnsupportedOperationException("Cannot remove the exp bar. Use setVisible(false) to hide it instead"); -+ } -+ if (widget instanceof ServerPlayerList) { -+ throw new UnsupportedOperationException("Cannot remove the player list. Use setVisisble(false) to hide it instead"); -+ } -+ return super.removeWidget(widget); -+ } -+ -+ @Override -+ public UUID getId() { -+ return new UUID(0, 0); -+ } -+ -+ public boolean closePopup() { -+ SpoutClient.getHandle().displayGuiScreen(null); -+ activePopup = null; -+ return true; -+ } -+ -+ public HealthBar getHealthBar() { -+ return health; -+ } -+ -+ public BubbleBar getBubbleBar() { -+ return bubble; -+ } -+ -+ public ChatBar getChatBar() { -+ return chat; -+ } -+ -+ public ChatTextBox getChatTextBox() { -+ return chatText; -+ } -+ -+ public ArmorBar getArmorBar() { -+ return armor; -+ } -+ -+ public HungerBar getHungerBar() { -+ return hunger; -+ } -+ -+ public ExpBar getExpBar() { -+ return exp; -+ } -+ -+ public ServerPlayerList getServerPlayerList() { -+ return playerList; -+ } -+ -+ public PopupScreen getActivePopup() { -+ return activePopup; -+ } -+ -+ public boolean attachPopupScreen(PopupScreen screen) { -+ if (getActivePopup() == null) { -+ activePopup = screen; -+ SpoutClient.getHandle().displayGuiScreen(new CustomScreen(screen)); -+ return true; -+ } -+ queuedScreens.add(screen); -+ return false; -+ } -+ -+ public boolean canAttachWidget(Widget widget) { -+ if (widget instanceof Screen) { -+ return false; -+ } -+ return true; -+ } -+ -+ public WidgetType getType() { -+ return WidgetType.InGameScreen; -+ } -+ -+ public void clearPopup() { -+ activePopup = null; -+ } -+ -+ @Override -+ protected boolean canRender(Widget widget) { -+ return super.canRender(widget) && !isCustomWidget(widget); -+ } -+ -+ public static boolean isCustomWidget(Widget widget) { -+ return widget instanceof HealthBar || widget instanceof BubbleBar || widget instanceof ChatTextBox || widget instanceof ChatBar || widget instanceof ArmorBar || widget instanceof HungerBar || widget instanceof ExpBar || widget instanceof ServerPlayerList; -+ } -+ -+ public ScreenType getScreenType() { -+ return ScreenType.GAME_SCREEN; -+ } -+ -+ public void toggleSurvivalHUD(boolean toggle) { -+ health.setVisible(toggle); -+ bubble.setVisible(toggle); -+ armor.setVisible(toggle); -+ hunger.setVisible(toggle); -+ exp.setVisible(toggle); -+ } -+ -+ private void updateChatWindowSize(int screenWidth, int screenHeight) { -+ chatText.setGeometry(0, 0, 320, screenHeight); -+ //chat.setGeometry(0, 0, 320, screenHeight); -+ } -+ -+ @Override -+ protected void onScreenResized(int oldWidth, int oldHeight, int newWidth, int newHeight) { -+ updateChatWindowSize(newWidth, newHeight); -+ super.onScreenResized(oldWidth, oldHeight, newWidth, newHeight); -+ } -+} ---- net/minecraft/src/ItemEnchantedBook.java -+++ net/minecraft/src/ItemEnchantedBook.java -@@ -4,50 +4,64 @@ - import java.util.Random; - - public class ItemEnchantedBook extends Item { -- public ItemEnchantedBook(int var1) { -- super(var1); -+ public ItemEnchantedBook(int par1) { -+ super(par1); - } - -- public boolean hasEffect(ItemStack var1) { -+ public boolean hasEffect(ItemStack par1ItemStack) { - return true; - } - -- public boolean isItemTool(ItemStack var1) { -+ /** -+ * Checks isDamagable and if it cannot be stacked -+ */ -+ public boolean isItemTool(ItemStack par1ItemStack) { - return false; - } - -- public EnumRarity getRarity(ItemStack var1) { -- return this.func_92110_g(var1).tagCount() > 0 ? EnumRarity.uncommon : super.getRarity(var1); -- } -- -- public NBTTagList func_92110_g(ItemStack var1) { -- return var1.stackTagCompound != null && var1.stackTagCompound.hasKey("StoredEnchantments") ? (NBTTagList)var1.stackTagCompound.getTag("StoredEnchantments") : new NBTTagList(); -- } -- -- public void addInformation(ItemStack var1, EntityPlayer var2, List var3, boolean var4) { -- super.addInformation(var1, var2, var3, var4); -- NBTTagList var5 = this.func_92110_g(var1); -- if(var5 != null) { -- for(int var6 = 0; var6 < var5.tagCount(); ++var6) { -+ /** -+ * Return an item rarity from EnumRarity -+ */ -+ public EnumRarity getRarity(ItemStack par1ItemStack) { -+ return this.func_92110_g(par1ItemStack).tagCount() > 0 ? EnumRarity.uncommon : super.getRarity(par1ItemStack); -+ } -+ -+ public NBTTagList func_92110_g(ItemStack par1ItemStack) { -+ return par1ItemStack.stackTagCompound != null && par1ItemStack.stackTagCompound.hasKey("StoredEnchantments") ? (NBTTagList)par1ItemStack.stackTagCompound.getTag("StoredEnchantments") : new NBTTagList(); -+ } -+ -+ /** -+ * allows items to add custom lines of information to the mouseover description -+ */ -+ public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4) { -+ super.addInformation(par1ItemStack, par2EntityPlayer, par3List, par4); -+ NBTTagList var5 = this.func_92110_g(par1ItemStack); -+ -+ if (var5 != null) { -+ for (int var6 = 0; var6 < var5.tagCount(); ++var6) { - short var7 = ((NBTTagCompound)var5.tagAt(var6)).getShort("id"); - short var8 = ((NBTTagCompound)var5.tagAt(var6)).getShort("lvl"); -- if(Enchantment.enchantmentsList[var7] != null) { -- var3.add(Enchantment.enchantmentsList[var7].getTranslatedName(var8)); -+ -+ if (Enchantment.enchantmentsList[var7] != null) { -+ par3List.add(Enchantment.enchantmentsList[var7].getTranslatedName(var8)); - } - } - } -- - } - -- public void addEnchantment(ItemStack var1, EnchantmentData var2) { -- NBTTagList var3 = this.func_92110_g(var1); -+ /** -+ * Adds an stored enchantment to an enchanted book ItemStack -+ */ -+ public void addEnchantment(ItemStack par1ItemStack, EnchantmentData par2EnchantmentData) { -+ NBTTagList var3 = this.func_92110_g(par1ItemStack); - boolean var4 = true; - -- for(int var5 = 0; var5 < var3.tagCount(); ++var5) { -+ for (int var5 = 0; var5 < var3.tagCount(); ++var5) { - NBTTagCompound var6 = (NBTTagCompound)var3.tagAt(var5); -- if(var6.getShort("id") == var2.enchantmentobj.effectId) { -- if(var6.getShort("lvl") < var2.enchantmentLevel) { -- var6.setShort("lvl", (short)var2.enchantmentLevel); -+ -+ if (var6.getShort("id") == par2EnchantmentData.enchantmentobj.effectId) { -+ if (var6.getShort("lvl") < par2EnchantmentData.enchantmentLevel) { -+ var6.setShort("lvl", (short)par2EnchantmentData.enchantmentLevel); - } - - var4 = false; -@@ -55,42 +69,44 @@ - } - } - -- if(var4) { -+ if (var4) { - NBTTagCompound var7 = new NBTTagCompound(); -- var7.setShort("id", (short)var2.enchantmentobj.effectId); -- var7.setShort("lvl", (short)var2.enchantmentLevel); -+ var7.setShort("id", (short)par2EnchantmentData.enchantmentobj.effectId); -+ var7.setShort("lvl", (short)par2EnchantmentData.enchantmentLevel); - var3.appendTag(var7); - } - -- if(!var1.hasTagCompound()) { -- var1.setTagCompound(new NBTTagCompound()); -+ if (!par1ItemStack.hasTagCompound()) { -+ par1ItemStack.setTagCompound(new NBTTagCompound()); - } - -- var1.getTagCompound().setTag("StoredEnchantments", var3); -+ par1ItemStack.getTagCompound().setTag("StoredEnchantments", var3); - } - -- public ItemStack getEnchantedItemStack(EnchantmentData var1) { -+ /** -+ * Returns the ItemStack of an enchanted version of this item. -+ */ -+ public ItemStack getEnchantedItemStack(EnchantmentData par1EnchantmentData) { - ItemStack var2 = new ItemStack(this); -- this.addEnchantment(var2, var1); -+ this.addEnchantment(var2, par1EnchantmentData); - return var2; - } - -- public void func_92113_a(Enchantment var1, List var2) { -- for(int var3 = var1.getMinLevel(); var3 <= var1.getMaxLevel(); ++var3) { -- var2.add(this.getEnchantedItemStack(new EnchantmentData(var1, var3))); -+ public void func_92113_a(Enchantment par1Enchantment, List par2List) { -+ for (int var3 = par1Enchantment.getMinLevel(); var3 <= par1Enchantment.getMaxLevel(); ++var3) { -+ par2List.add(this.getEnchantedItemStack(new EnchantmentData(par1Enchantment, var3))); - } -- -- } -- -- public WeightedRandomChestContent func_92114_b(Random var1) { -- return this.func_92112_a(var1, 1, 1, 1); -- } -- -- public WeightedRandomChestContent func_92112_a(Random var1, int var2, int var3, int var4) { -- Enchantment var5 = Enchantment.enchantmentsBookList[var1.nextInt(Enchantment.enchantmentsBookList.length)]; -+ } -+ -+ public WeightedRandomChestContent func_92114_b(Random par1Random) { -+ return this.func_92112_a(par1Random, 1, 1, 1); -+ } -+ -+ public WeightedRandomChestContent func_92112_a(Random par1Random, int par2, int par3, int par4) { -+ Enchantment var5 = Enchantment.enchantmentsBookList[par1Random.nextInt(Enchantment.enchantmentsBookList.length)]; - ItemStack var6 = new ItemStack(this.itemID, 1, 0); -- int var7 = MathHelper.getRandomIntegerInRange(var1, var5.getMinLevel(), var5.getMaxLevel()); -+ int var7 = MathHelper.getRandomIntegerInRange(par1Random, var5.getMinLevel(), var5.getMaxLevel()); - this.addEnchantment(var6, new EnchantmentData(var5, var7)); -- return new WeightedRandomChestContent(var6, var2, var3, var4); -+ return new WeightedRandomChestContent(var6, par2, par3, par4); - } - } ---- /dev/null -+++ org/spoutcraft/api/animation/ValueSetDelegate.java -@@ -1,0 +1,39 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.api.animation; -+ -+/** -+ * This is used to set the new values to the animated object. Implement this interface for your properties. -+ */ -+public interface ValueSetDelegate { -+ /** -+ * Sets the value to the object. Will be called each animation cycle. -+ * -+ * @param value to be set to the object. -+ */ -+ public void set(Animatable value); -+ -+ /** -+ * Sets the value to the object as Number (int, double, etc.) Will be called each animation cycle. -+ * -+ * @param value to be set to the object. -+ */ -+ public void set(Number value); -+} ---- /dev/null -+++ com/prupe/mcpatcher/ctm/CTMUtils$1.java -@@ -1,0 +1,89 @@ -+package com.prupe.mcpatcher.ctm; -+ -+import com.prupe.mcpatcher.TexturePackAPI; -+import com.prupe.mcpatcher.TexturePackChangeHandler; -+import com.prupe.mcpatcher.TileLoader; -+import com.prupe.mcpatcher.ctm.TileOverrideImpl$BetterGrass; -+import java.util.Arrays; -+import java.util.Iterator; -+import net.minecraft.src.Block; -+import net.minecraft.src.ResourceLocation; -+ -+final class CTMUtils$1 extends TexturePackChangeHandler { -+ CTMUtils$1(String x0, int x1) { -+ super(x0, x1); -+ } -+ -+ public void initialize() {} -+ -+ public void beforeChange() { -+ RenderPassAPI.instance.clear(); -+ CTMUtils.access$000().clear(); -+ Arrays.fill(CTMUtils.access$100(), (Object)null); -+ CTMUtils.access$200().clear(); -+ CTMUtils.access$302(new TileLoader("textures/blocks", true, CTMUtils.access$400())); -+ CTMUtils.access$502((TileOverrideImpl$BetterGrass)null); -+ -+ if (CTMUtils.access$600() || CTMUtils.access$700()) { -+ Iterator i$ = TexturePackAPI.listResources("mcpatcher/ctm", ".properties", true, false, true).iterator(); -+ -+ while (i$.hasNext()) { -+ ResourceLocation resource = (ResourceLocation)i$.next(); -+ CTMUtils.access$800(TileOverride.create(resource, CTMUtils.access$300())); -+ } -+ } -+ } -+ -+ public void afterChange() { -+ if (CTMUtils.access$900()) { -+ CTMUtils.access$800(CTMUtils.access$502(new TileOverrideImpl$BetterGrass(CTMUtils.access$300(), 2, "grass"))); -+ CTMUtils.access$800(new TileOverrideImpl$BetterGrass(CTMUtils.access$300(), 110, "mycel")); -+ } -+ -+ Iterator i$ = CTMUtils.access$000().iterator(); -+ -+ while (i$.hasNext()) { -+ ITileOverride overrides = (ITileOverride)i$.next(); -+ overrides.registerIcons(); -+ } -+ -+ int i$1; -+ ITileOverride[] var8; -+ -+ for (int var6 = 0; var6 < CTMUtils.access$100().length; ++var6) { -+ if (CTMUtils.access$100()[var6] != null && Block.blocksList[var6] != null) { -+ var8 = CTMUtils.access$100()[var6]; -+ i$1 = var8.length; -+ -+ for (int overrides1 = 0; overrides1 < i$1; ++overrides1) { -+ ITileOverride override = var8[overrides1]; -+ -+ if (override != null && !override.isDisabled() && override.getRenderPass() >= 0) { -+ RenderPassAPI.instance.setRenderPassForBlock(Block.blocksList[var6], override.getRenderPass()); -+ } -+ } -+ } -+ } -+ -+ ITileOverride[][] var7 = CTMUtils.access$100(); -+ int var9 = var7.length; -+ -+ for (i$1 = 0; i$1 < var9; ++i$1) { -+ ITileOverride[] var10 = var7[i$1]; -+ this.sortOverrides(var10); -+ } -+ -+ i$ = CTMUtils.access$200().values().iterator(); -+ -+ while (i$.hasNext()) { -+ var8 = (ITileOverride[])i$.next(); -+ this.sortOverrides(var8); -+ } -+ } -+ -+ private void sortOverrides(ITileOverride[] overrides) { -+ if (overrides != null) { -+ Arrays.sort(overrides); -+ } -+ } -+} ---- net/minecraft/src/RenderSorter.java -+++ net/minecraft/src/RenderSorter.java -@@ -3,25 +3,27 @@ - import java.util.Comparator; - - public class RenderSorter implements Comparator { -+ -+ /** The entity (usually the player) that the camera is inside. */ - private EntityLivingBase baseEntity; - -- public RenderSorter(EntityLivingBase var1) { -- this.baseEntity = var1; -+ public RenderSorter(EntityLivingBase par1EntityLivingBase) { -+ this.baseEntity = par1EntityLivingBase; - } - -- public int doCompare(WorldRenderer var1, WorldRenderer var2) { -- if(var1.isInFrustum && !var2.isInFrustum) { -+ public int doCompare(WorldRenderer par1WorldRenderer, WorldRenderer par2WorldRenderer) { -+ if (par1WorldRenderer.isInFrustum && !par2WorldRenderer.isInFrustum) { - return 1; -- } else if(var2.isInFrustum && !var1.isInFrustum) { -+ } else if (par2WorldRenderer.isInFrustum && !par1WorldRenderer.isInFrustum) { - return -1; - } else { -- double var3 = (double)var1.distanceToEntitySquared(this.baseEntity); -- double var5 = (double)var2.distanceToEntitySquared(this.baseEntity); -- return var3 < var5 ? 1 : (var3 > var5 ? -1 : (var1.chunkIndex < var2.chunkIndex ? 1 : -1)); -+ double var3 = (double)par1WorldRenderer.distanceToEntitySquared(this.baseEntity); -+ double var5 = (double)par2WorldRenderer.distanceToEntitySquared(this.baseEntity); -+ return var3 < var5 ? 1 : (var3 > var5 ? -1 : (par1WorldRenderer.chunkIndex < par2WorldRenderer.chunkIndex ? 1 : -1)); - } - } - -- public int compare(Object var1, Object var2) { -- return this.doCompare((WorldRenderer)var1, (WorldRenderer)var2); -+ public int compare(Object par1Obj, Object par2Obj) { -+ return this.doCompare((WorldRenderer)par1Obj, (WorldRenderer)par2Obj); - } - } ---- net/minecraft/src/ComponentMineshaftCorridor.java -+++ net/minecraft/src/ComponentMineshaftCorridor.java -@@ -7,155 +7,182 @@ - private boolean hasRails; - private boolean hasSpiders; - private boolean spawnerPlaced; -+ -+ /** -+ * A count of the different sections of this mine. The space between ceiling supports. -+ */ - private int sectionCount; - -- public ComponentMineshaftCorridor() { -- } -- -- protected void func_143012_a(NBTTagCompound var1) { -- var1.setBoolean("hr", this.hasRails); -- var1.setBoolean("sc", this.hasSpiders); -- var1.setBoolean("hps", this.spawnerPlaced); -- var1.setInteger("Num", this.sectionCount); -- } -- -- protected void func_143011_b(NBTTagCompound var1) { -- this.hasRails = var1.getBoolean("hr"); -- this.hasSpiders = var1.getBoolean("sc"); -- this.spawnerPlaced = var1.getBoolean("hps"); -- this.sectionCount = var1.getInteger("Num"); -- } -- -- public ComponentMineshaftCorridor(int var1, Random var2, StructureBoundingBox var3, int var4) { -- super(var1); -- this.coordBaseMode = var4; -- this.boundingBox = var3; -- this.hasRails = var2.nextInt(3) == 0; -- this.hasSpiders = !this.hasRails && var2.nextInt(23) == 0; -- if(this.coordBaseMode != 2 && this.coordBaseMode != 0) { -- this.sectionCount = var3.getXSize() / 5; -+ public ComponentMineshaftCorridor() {} -+ -+ protected void func_143012_a(NBTTagCompound par1NBTTagCompound) { -+ par1NBTTagCompound.setBoolean("hr", this.hasRails); -+ par1NBTTagCompound.setBoolean("sc", this.hasSpiders); -+ par1NBTTagCompound.setBoolean("hps", this.spawnerPlaced); -+ par1NBTTagCompound.setInteger("Num", this.sectionCount); -+ } -+ -+ protected void func_143011_b(NBTTagCompound par1NBTTagCompound) { -+ this.hasRails = par1NBTTagCompound.getBoolean("hr"); -+ this.hasSpiders = par1NBTTagCompound.getBoolean("sc"); -+ this.spawnerPlaced = par1NBTTagCompound.getBoolean("hps"); -+ this.sectionCount = par1NBTTagCompound.getInteger("Num"); -+ } -+ -+ public ComponentMineshaftCorridor(int par1, Random par2Random, StructureBoundingBox par3StructureBoundingBox, int par4) { -+ super(par1); -+ this.coordBaseMode = par4; -+ this.boundingBox = par3StructureBoundingBox; -+ this.hasRails = par2Random.nextInt(3) == 0; -+ this.hasSpiders = !this.hasRails && par2Random.nextInt(23) == 0; -+ -+ if (this.coordBaseMode != 2 && this.coordBaseMode != 0) { -+ this.sectionCount = par3StructureBoundingBox.getXSize() / 5; - } else { -- this.sectionCount = var3.getZSize() / 5; -+ this.sectionCount = par3StructureBoundingBox.getZSize() / 5; - } -- - } - -- public static StructureBoundingBox findValidPlacement(List var0, Random var1, int var2, int var3, int var4, int var5) { -- StructureBoundingBox var6 = new StructureBoundingBox(var2, var3, var4, var2, var3 + 2, var4); -- -+ public static StructureBoundingBox findValidPlacement(List par0List, Random par1Random, int par2, int par3, int par4, int par5) { -+ StructureBoundingBox var6 = new StructureBoundingBox(par2, par3, par4, par2, par3 + 2, par4); - int var7; -- for(var7 = var1.nextInt(3) + 2; var7 > 0; --var7) { -+ -+ for (var7 = par1Random.nextInt(3) + 2; var7 > 0; --var7) { - int var8 = var7 * 5; -- switch(var5) { -+ -+ switch (par5) { -+ case 0: -+ var6.maxX = par2 + 2; -+ var6.maxZ = par4 + (var8 - 1); -+ break; -+ -+ case 1: -+ var6.minX = par2 - (var8 - 1); -+ var6.maxZ = par4 + 2; -+ break; -+ -+ case 2: -+ var6.maxX = par2 + 2; -+ var6.minZ = par4 - (var8 - 1); -+ break; -+ -+ case 3: -+ var6.maxX = par2 + (var8 - 1); -+ var6.maxZ = par4 + 2; -+ } -+ -+ if (StructureComponent.findIntersecting(par0List, var6) == null) { -+ break; -+ } -+ } -+ -+ return var7 > 0 ? var6 : null; -+ } -+ -+ /** -+ * Initiates construction of the Structure Component picked, at the current Location of StructGen -+ */ -+ public void buildComponent(StructureComponent par1StructureComponent, List par2List, Random par3Random) { -+ int var4 = this.getComponentType(); -+ int var5 = par3Random.nextInt(4); -+ -+ switch (this.coordBaseMode) { - case 0: -- var6.maxX = var2 + 2; -- var6.maxZ = var4 + (var8 - 1); -+ if (var5 <= 1) { -+ StructureMineshaftPieces.getNextComponent(par1StructureComponent, par2List, par3Random, this.boundingBox.minX, this.boundingBox.minY - 1 + par3Random.nextInt(3), this.boundingBox.maxZ + 1, this.coordBaseMode, var4); -+ } else if (var5 == 2) { -+ StructureMineshaftPieces.getNextComponent(par1StructureComponent, par2List, par3Random, this.boundingBox.minX - 1, this.boundingBox.minY - 1 + par3Random.nextInt(3), this.boundingBox.maxZ - 3, 1, var4); -+ } else { -+ StructureMineshaftPieces.getNextComponent(par1StructureComponent, par2List, par3Random, this.boundingBox.maxX + 1, this.boundingBox.minY - 1 + par3Random.nextInt(3), this.boundingBox.maxZ - 3, 3, var4); -+ } -+ - break; -+ - case 1: -- var6.minX = var2 - (var8 - 1); -- var6.maxZ = var4 + 2; -+ if (var5 <= 1) { -+ StructureMineshaftPieces.getNextComponent(par1StructureComponent, par2List, par3Random, this.boundingBox.minX - 1, this.boundingBox.minY - 1 + par3Random.nextInt(3), this.boundingBox.minZ, this.coordBaseMode, var4); -+ } else if (var5 == 2) { -+ StructureMineshaftPieces.getNextComponent(par1StructureComponent, par2List, par3Random, this.boundingBox.minX, this.boundingBox.minY - 1 + par3Random.nextInt(3), this.boundingBox.minZ - 1, 2, var4); -+ } else { -+ StructureMineshaftPieces.getNextComponent(par1StructureComponent, par2List, par3Random, this.boundingBox.minX, this.boundingBox.minY - 1 + par3Random.nextInt(3), this.boundingBox.maxZ + 1, 0, var4); -+ } -+ - break; -+ - case 2: -- var6.maxX = var2 + 2; -- var6.minZ = var4 - (var8 - 1); -+ if (var5 <= 1) { -+ StructureMineshaftPieces.getNextComponent(par1StructureComponent, par2List, par3Random, this.boundingBox.minX, this.boundingBox.minY - 1 + par3Random.nextInt(3), this.boundingBox.minZ - 1, this.coordBaseMode, var4); -+ } else if (var5 == 2) { -+ StructureMineshaftPieces.getNextComponent(par1StructureComponent, par2List, par3Random, this.boundingBox.minX - 1, this.boundingBox.minY - 1 + par3Random.nextInt(3), this.boundingBox.minZ, 1, var4); -+ } else { -+ StructureMineshaftPieces.getNextComponent(par1StructureComponent, par2List, par3Random, this.boundingBox.maxX + 1, this.boundingBox.minY - 1 + par3Random.nextInt(3), this.boundingBox.minZ, 3, var4); -+ } -+ - break; -+ - case 3: -- var6.maxX = var2 + (var8 - 1); -- var6.maxZ = var4 + 2; -- } -- -- if(StructureComponent.findIntersecting(var0, var6) == null) { -- break; -- } -- } -- -- return var7 > 0 ? var6 : null; -- } -- -- public void buildComponent(StructureComponent var1, List var2, Random var3) { -- int var4 = this.getComponentType(); -- int var5 = var3.nextInt(4); -- switch(this.coordBaseMode) { -- case 0: -- if(var5 <= 1) { -- StructureMineshaftPieces.getNextComponent(var1, var2, var3, this.boundingBox.minX, this.boundingBox.minY - 1 + var3.nextInt(3), this.boundingBox.maxZ + 1, this.coordBaseMode, var4); -- } else if(var5 == 2) { -- StructureMineshaftPieces.getNextComponent(var1, var2, var3, this.boundingBox.minX - 1, this.boundingBox.minY - 1 + var3.nextInt(3), this.boundingBox.maxZ - 3, 1, var4); -- } else { -- StructureMineshaftPieces.getNextComponent(var1, var2, var3, this.boundingBox.maxX + 1, this.boundingBox.minY - 1 + var3.nextInt(3), this.boundingBox.maxZ - 3, 3, var4); -- } -- break; -- case 1: -- if(var5 <= 1) { -- StructureMineshaftPieces.getNextComponent(var1, var2, var3, this.boundingBox.minX - 1, this.boundingBox.minY - 1 + var3.nextInt(3), this.boundingBox.minZ, this.coordBaseMode, var4); -- } else if(var5 == 2) { -- StructureMineshaftPieces.getNextComponent(var1, var2, var3, this.boundingBox.minX, this.boundingBox.minY - 1 + var3.nextInt(3), this.boundingBox.minZ - 1, 2, var4); -- } else { -- StructureMineshaftPieces.getNextComponent(var1, var2, var3, this.boundingBox.minX, this.boundingBox.minY - 1 + var3.nextInt(3), this.boundingBox.maxZ + 1, 0, var4); -- } -- break; -- case 2: -- if(var5 <= 1) { -- StructureMineshaftPieces.getNextComponent(var1, var2, var3, this.boundingBox.minX, this.boundingBox.minY - 1 + var3.nextInt(3), this.boundingBox.minZ - 1, this.coordBaseMode, var4); -- } else if(var5 == 2) { -- StructureMineshaftPieces.getNextComponent(var1, var2, var3, this.boundingBox.minX - 1, this.boundingBox.minY - 1 + var3.nextInt(3), this.boundingBox.minZ, 1, var4); -- } else { -- StructureMineshaftPieces.getNextComponent(var1, var2, var3, this.boundingBox.maxX + 1, this.boundingBox.minY - 1 + var3.nextInt(3), this.boundingBox.minZ, 3, var4); -- } -- break; -- case 3: -- if(var5 <= 1) { -- StructureMineshaftPieces.getNextComponent(var1, var2, var3, this.boundingBox.maxX + 1, this.boundingBox.minY - 1 + var3.nextInt(3), this.boundingBox.minZ, this.coordBaseMode, var4); -- } else if(var5 == 2) { -- StructureMineshaftPieces.getNextComponent(var1, var2, var3, this.boundingBox.maxX - 3, this.boundingBox.minY - 1 + var3.nextInt(3), this.boundingBox.minZ - 1, 2, var4); -- } else { -- StructureMineshaftPieces.getNextComponent(var1, var2, var3, this.boundingBox.maxX - 3, this.boundingBox.minY - 1 + var3.nextInt(3), this.boundingBox.maxZ + 1, 0, var4); -- } -- } -- -- if(var4 < 8) { -+ if (var5 <= 1) { -+ StructureMineshaftPieces.getNextComponent(par1StructureComponent, par2List, par3Random, this.boundingBox.maxX + 1, this.boundingBox.minY - 1 + par3Random.nextInt(3), this.boundingBox.minZ, this.coordBaseMode, var4); -+ } else if (var5 == 2) { -+ StructureMineshaftPieces.getNextComponent(par1StructureComponent, par2List, par3Random, this.boundingBox.maxX - 3, this.boundingBox.minY - 1 + par3Random.nextInt(3), this.boundingBox.minZ - 1, 2, var4); -+ } else { -+ StructureMineshaftPieces.getNextComponent(par1StructureComponent, par2List, par3Random, this.boundingBox.maxX - 3, this.boundingBox.minY - 1 + par3Random.nextInt(3), this.boundingBox.maxZ + 1, 0, var4); -+ } -+ } -+ -+ if (var4 < 8) { - int var6; - int var7; -- if(this.coordBaseMode != 2 && this.coordBaseMode != 0) { -- for(var6 = this.boundingBox.minX + 3; var6 + 3 <= this.boundingBox.maxX; var6 += 5) { -- var7 = var3.nextInt(5); -- if(var7 == 0) { -- StructureMineshaftPieces.getNextComponent(var1, var2, var3, var6, this.boundingBox.minY, this.boundingBox.minZ - 1, 2, var4 + 1); -- } else if(var7 == 1) { -- StructureMineshaftPieces.getNextComponent(var1, var2, var3, var6, this.boundingBox.minY, this.boundingBox.maxZ + 1, 0, var4 + 1); -+ -+ if (this.coordBaseMode != 2 && this.coordBaseMode != 0) { -+ for (var6 = this.boundingBox.minX + 3; var6 + 3 <= this.boundingBox.maxX; var6 += 5) { -+ var7 = par3Random.nextInt(5); -+ -+ if (var7 == 0) { -+ StructureMineshaftPieces.getNextComponent(par1StructureComponent, par2List, par3Random, var6, this.boundingBox.minY, this.boundingBox.minZ - 1, 2, var4 + 1); -+ } else if (var7 == 1) { -+ StructureMineshaftPieces.getNextComponent(par1StructureComponent, par2List, par3Random, var6, this.boundingBox.minY, this.boundingBox.maxZ + 1, 0, var4 + 1); - } - } - } else { -- for(var6 = this.boundingBox.minZ + 3; var6 + 3 <= this.boundingBox.maxZ; var6 += 5) { -- var7 = var3.nextInt(5); -- if(var7 == 0) { -- StructureMineshaftPieces.getNextComponent(var1, var2, var3, this.boundingBox.minX - 1, this.boundingBox.minY, var6, 1, var4 + 1); -- } else if(var7 == 1) { -- StructureMineshaftPieces.getNextComponent(var1, var2, var3, this.boundingBox.maxX + 1, this.boundingBox.minY, var6, 3, var4 + 1); -+ for (var6 = this.boundingBox.minZ + 3; var6 + 3 <= this.boundingBox.maxZ; var6 += 5) { -+ var7 = par3Random.nextInt(5); -+ -+ if (var7 == 0) { -+ StructureMineshaftPieces.getNextComponent(par1StructureComponent, par2List, par3Random, this.boundingBox.minX - 1, this.boundingBox.minY, var6, 1, var4 + 1); -+ } else if (var7 == 1) { -+ StructureMineshaftPieces.getNextComponent(par1StructureComponent, par2List, par3Random, this.boundingBox.maxX + 1, this.boundingBox.minY, var6, 3, var4 + 1); - } - } - } - } -- - } - -- protected boolean generateStructureChestContents(World var1, StructureBoundingBox var2, Random var3, int var4, int var5, int var6, WeightedRandomChestContent[] var7, int var8) { -- int var9 = this.getXWithOffset(var4, var6); -- int var10 = this.getYWithOffset(var5); -- int var11 = this.getZWithOffset(var4, var6); -- if(var2.isVecInside(var9, var10, var11) && var1.getBlockId(var9, var10, var11) == 0) { -- var1.setBlock(var9, var10, var11, Block.rail.blockID, this.getMetadataWithOffset(Block.rail.blockID, var3.nextBoolean() ? 1 : 0), 2); -- EntityMinecartChest var12 = new EntityMinecartChest(var1, (double)((float)var9 + 0.5F), (double)((float)var10 + 0.5F), (double)((float)var11 + 0.5F)); -- WeightedRandomChestContent.generateChestContents(var3, var7, var12, var8); -- var1.spawnEntityInWorld(var12); -+ /** -+ * Used to generate chests with items in it. ex: Temple Chests, Village Blacksmith Chests, Mineshaft Chests. -+ */ -+ protected boolean generateStructureChestContents(World par1World, StructureBoundingBox par2StructureBoundingBox, Random par3Random, int par4, int par5, int par6, WeightedRandomChestContent[] par7ArrayOfWeightedRandomChestContent, int par8) { -+ int var9 = this.getXWithOffset(par4, par6); -+ int var10 = this.getYWithOffset(par5); -+ int var11 = this.getZWithOffset(par4, par6); -+ -+ if (par2StructureBoundingBox.isVecInside(var9, var10, var11) && par1World.getBlockId(var9, var10, var11) == 0) { -+ par1World.setBlock(var9, var10, var11, Block.rail.blockID, this.getMetadataWithOffset(Block.rail.blockID, par3Random.nextBoolean() ? 1 : 0), 2); -+ EntityMinecartChest var12 = new EntityMinecartChest(par1World, (double)((float)var9 + 0.5F), (double)((float)var10 + 0.5F), (double)((float)var11 + 0.5F)); -+ WeightedRandomChestContent.generateChestContents(par3Random, par7ArrayOfWeightedRandomChestContent, var12, par8); -+ par1World.spawnEntityInWorld(var12); - return true; - } else { - return false; - } - } - -- public boolean addComponentParts(World var1, Random var2, StructureBoundingBox var3) { -- if(this.isLiquidInStructureBoundingBox(var1, var3)) { -+ /** -+ * second Part of Structure generating, this for example places Spiderwebs, Mob Spawners, it closes Mineshafts at the -+ * end, it adds Fences... -+ */ -+ public boolean addComponentParts(World par1World, Random par2Random, StructureBoundingBox par3StructureBoundingBox) { -+ if (this.isLiquidInStructureBoundingBox(par1World, par3StructureBoundingBox)) { - return false; - } else { - boolean var4 = false; -@@ -163,74 +190,82 @@ - boolean var6 = false; - boolean var7 = true; - int var8 = this.sectionCount * 5 - 1; -- this.fillWithBlocks(var1, var3, 0, 0, 0, 2, 1, var8, 0, 0, false); -- this.randomlyFillWithBlocks(var1, var3, var2, 0.8F, 0, 2, 0, 2, 2, var8, 0, 0, false); -- if(this.hasSpiders) { -- this.randomlyFillWithBlocks(var1, var3, var2, 0.6F, 0, 0, 0, 2, 1, var8, Block.web.blockID, 0, false); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 0, 0, 0, 2, 1, var8, 0, 0, false); -+ this.randomlyFillWithBlocks(par1World, par3StructureBoundingBox, par2Random, 0.8F, 0, 2, 0, 2, 2, var8, 0, 0, false); -+ -+ if (this.hasSpiders) { -+ this.randomlyFillWithBlocks(par1World, par3StructureBoundingBox, par2Random, 0.6F, 0, 0, 0, 2, 1, var8, Block.web.blockID, 0, false); - } - - int var9; - int var10; - int var11; -- for(var9 = 0; var9 < this.sectionCount; ++var9) { -+ -+ for (var9 = 0; var9 < this.sectionCount; ++var9) { - var10 = 2 + var9 * 5; -- this.fillWithBlocks(var1, var3, 0, 0, var10, 0, 1, var10, Block.fence.blockID, 0, false); -- this.fillWithBlocks(var1, var3, 2, 0, var10, 2, 1, var10, Block.fence.blockID, 0, false); -- if(var2.nextInt(4) == 0) { -- this.fillWithBlocks(var1, var3, 0, 2, var10, 0, 2, var10, Block.planks.blockID, 0, false); -- this.fillWithBlocks(var1, var3, 2, 2, var10, 2, 2, var10, Block.planks.blockID, 0, false); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 0, 0, var10, 0, 1, var10, Block.fence.blockID, 0, false); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 2, 0, var10, 2, 1, var10, Block.fence.blockID, 0, false); -+ -+ if (par2Random.nextInt(4) == 0) { -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 0, 2, var10, 0, 2, var10, Block.planks.blockID, 0, false); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 2, 2, var10, 2, 2, var10, Block.planks.blockID, 0, false); - } else { -- this.fillWithBlocks(var1, var3, 0, 2, var10, 2, 2, var10, Block.planks.blockID, 0, false); -- } -- -- this.randomlyPlaceBlock(var1, var3, var2, 0.1F, 0, 2, var10 - 1, Block.web.blockID, 0); -- this.randomlyPlaceBlock(var1, var3, var2, 0.1F, 2, 2, var10 - 1, Block.web.blockID, 0); -- this.randomlyPlaceBlock(var1, var3, var2, 0.1F, 0, 2, var10 + 1, Block.web.blockID, 0); -- this.randomlyPlaceBlock(var1, var3, var2, 0.1F, 2, 2, var10 + 1, Block.web.blockID, 0); -- this.randomlyPlaceBlock(var1, var3, var2, 0.05F, 0, 2, var10 - 2, Block.web.blockID, 0); -- this.randomlyPlaceBlock(var1, var3, var2, 0.05F, 2, 2, var10 - 2, Block.web.blockID, 0); -- this.randomlyPlaceBlock(var1, var3, var2, 0.05F, 0, 2, var10 + 2, Block.web.blockID, 0); -- this.randomlyPlaceBlock(var1, var3, var2, 0.05F, 2, 2, var10 + 2, Block.web.blockID, 0); -- this.randomlyPlaceBlock(var1, var3, var2, 0.05F, 1, 2, var10 - 1, Block.torchWood.blockID, 0); -- this.randomlyPlaceBlock(var1, var3, var2, 0.05F, 1, 2, var10 + 1, Block.torchWood.blockID, 0); -- if(var2.nextInt(100) == 0) { -- this.generateStructureChestContents(var1, var3, var2, 2, 0, var10 - 1, WeightedRandomChestContent.func_92080_a(StructureMineshaftPieces.func_78816_a(), new WeightedRandomChestContent[]{Item.enchantedBook.func_92114_b(var2)}), 3 + var2.nextInt(4)); -- } -- -- if(var2.nextInt(100) == 0) { -- this.generateStructureChestContents(var1, var3, var2, 0, 0, var10 + 1, WeightedRandomChestContent.func_92080_a(StructureMineshaftPieces.func_78816_a(), new WeightedRandomChestContent[]{Item.enchantedBook.func_92114_b(var2)}), 3 + var2.nextInt(4)); -- } -- -- if(this.hasSpiders && !this.spawnerPlaced) { -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 0, 2, var10, 2, 2, var10, Block.planks.blockID, 0, false); -+ } -+ -+ this.randomlyPlaceBlock(par1World, par3StructureBoundingBox, par2Random, 0.1F, 0, 2, var10 - 1, Block.web.blockID, 0); -+ this.randomlyPlaceBlock(par1World, par3StructureBoundingBox, par2Random, 0.1F, 2, 2, var10 - 1, Block.web.blockID, 0); -+ this.randomlyPlaceBlock(par1World, par3StructureBoundingBox, par2Random, 0.1F, 0, 2, var10 + 1, Block.web.blockID, 0); -+ this.randomlyPlaceBlock(par1World, par3StructureBoundingBox, par2Random, 0.1F, 2, 2, var10 + 1, Block.web.blockID, 0); -+ this.randomlyPlaceBlock(par1World, par3StructureBoundingBox, par2Random, 0.05F, 0, 2, var10 - 2, Block.web.blockID, 0); -+ this.randomlyPlaceBlock(par1World, par3StructureBoundingBox, par2Random, 0.05F, 2, 2, var10 - 2, Block.web.blockID, 0); -+ this.randomlyPlaceBlock(par1World, par3StructureBoundingBox, par2Random, 0.05F, 0, 2, var10 + 2, Block.web.blockID, 0); -+ this.randomlyPlaceBlock(par1World, par3StructureBoundingBox, par2Random, 0.05F, 2, 2, var10 + 2, Block.web.blockID, 0); -+ this.randomlyPlaceBlock(par1World, par3StructureBoundingBox, par2Random, 0.05F, 1, 2, var10 - 1, Block.torchWood.blockID, 0); -+ this.randomlyPlaceBlock(par1World, par3StructureBoundingBox, par2Random, 0.05F, 1, 2, var10 + 1, Block.torchWood.blockID, 0); -+ -+ if (par2Random.nextInt(100) == 0) { -+ this.generateStructureChestContents(par1World, par3StructureBoundingBox, par2Random, 2, 0, var10 - 1, WeightedRandomChestContent.func_92080_a(StructureMineshaftPieces.func_78816_a(), new WeightedRandomChestContent[] {Item.enchantedBook.func_92114_b(par2Random)}), 3 + par2Random.nextInt(4)); -+ } -+ -+ if (par2Random.nextInt(100) == 0) { -+ this.generateStructureChestContents(par1World, par3StructureBoundingBox, par2Random, 0, 0, var10 + 1, WeightedRandomChestContent.func_92080_a(StructureMineshaftPieces.func_78816_a(), new WeightedRandomChestContent[] {Item.enchantedBook.func_92114_b(par2Random)}), 3 + par2Random.nextInt(4)); -+ } -+ -+ if (this.hasSpiders && !this.spawnerPlaced) { - var11 = this.getYWithOffset(0); -- int var12 = var10 - 1 + var2.nextInt(3); -+ int var12 = var10 - 1 + par2Random.nextInt(3); - int var13 = this.getXWithOffset(1, var12); - var12 = this.getZWithOffset(1, var12); -- if(var3.isVecInside(var13, var11, var12)) { -+ -+ if (par3StructureBoundingBox.isVecInside(var13, var11, var12)) { - this.spawnerPlaced = true; -- var1.setBlock(var13, var11, var12, Block.mobSpawner.blockID, 0, 2); -- TileEntityMobSpawner var14 = (TileEntityMobSpawner)var1.getBlockTileEntity(var13, var11, var12); -- if(var14 != null) { -+ par1World.setBlock(var13, var11, var12, Block.mobSpawner.blockID, 0, 2); -+ TileEntityMobSpawner var14 = (TileEntityMobSpawner)par1World.getBlockTileEntity(var13, var11, var12); -+ -+ if (var14 != null) { - var14.getSpawnerLogic().setMobID("CaveSpider"); - } - } - } - } - -- for(var9 = 0; var9 <= 2; ++var9) { -- for(var10 = 0; var10 <= var8; ++var10) { -- var11 = this.getBlockIdAtCurrentPosition(var1, var9, -1, var10, var3); -- if(var11 == 0) { -- this.placeBlockAtCurrentPosition(var1, Block.planks.blockID, 0, var9, -1, var10, var3); -+ for (var9 = 0; var9 <= 2; ++var9) { -+ for (var10 = 0; var10 <= var8; ++var10) { -+ var11 = this.getBlockIdAtCurrentPosition(par1World, var9, -1, var10, par3StructureBoundingBox); -+ -+ if (var11 == 0) { -+ this.placeBlockAtCurrentPosition(par1World, Block.planks.blockID, 0, var9, -1, var10, par3StructureBoundingBox); - } - } - } - -- if(this.hasRails) { -- for(var9 = 0; var9 <= var8; ++var9) { -- var10 = this.getBlockIdAtCurrentPosition(var1, 1, -1, var9, var3); -- if(var10 > 0 && Block.opaqueCubeLookup[var10]) { -- this.randomlyPlaceBlock(var1, var3, var2, 0.7F, 1, 0, var9, Block.rail.blockID, this.getMetadataWithOffset(Block.rail.blockID, 0)); -+ if (this.hasRails) { -+ for (var9 = 0; var9 <= var8; ++var9) { -+ var10 = this.getBlockIdAtCurrentPosition(par1World, 1, -1, var9, par3StructureBoundingBox); -+ -+ if (var10 > 0 && Block.opaqueCubeLookup[var10]) { -+ this.randomlyPlaceBlock(par1World, par3StructureBoundingBox, par2Random, 0.7F, 1, 0, var9, Block.rail.blockID, this.getMetadataWithOffset(Block.rail.blockID, 0)); - } - } - } ---- net/minecraft/server/MinecraftServer.java -+++ net/minecraft/server/MinecraftServer.java -@@ -53,127 +53,200 @@ - import net.minecraft.src.WorldType; - - public abstract class MinecraftServer implements ICommandSender, Runnable, IPlayerUsage { -- private static MinecraftServer l; -+ -+ /** Instance of Minecraft Server. */ -+ private static MinecraftServer mcServer; - private final ISaveFormat anvilConverterForAnvilFile; -- private final PlayerUsageSnooper usageSnooper = new PlayerUsageSnooper("server", this, getCurrentTimeMillis()); -- private final File o; -- private final List p = new ArrayList(); -+ -+ /** The PlayerUsageSnooper instance. */ -+ private final PlayerUsageSnooper usageSnooper = new PlayerUsageSnooper("server", this, getSystemTimeMillis()); -+ private final File anvilFile; -+ -+ /** -+ * Collection of objects to update every tick. Type: List -+ */ -+ private final List tickables = new ArrayList(); - private final ICommandManager commandManager; - public final Profiler theProfiler = new Profiler(); -- private String r; -+ -+ /** The server's hostname. */ -+ private String hostname; -+ -+ /** The server's port. */ - private int serverPort = -1; -+ -+ /** The server world instances. */ - public WorldServer[] worldServers; -+ -+ /** The ServerConfigurationManager instance. */ - private ServerConfigurationManager serverConfigManager; -+ -+ /** -+ * Indicates whether the server is running or not. Set to false to initiate a shutdown. -+ */ - private boolean serverRunning = true; -+ -+ /** Indicates to other classes that the server is safely stopped. */ - private boolean serverStopped; -+ -+ /** Incremented every tick. */ - private int tickCounter; -- protected Proxy c = Proxy.NO_PROXY; -- public String d; -+ protected Proxy serverProxy; -+ -+ /** -+ * The task the server is currently working on(and will output on outputPercentRemaining). -+ */ -+ public String currentTask; -+ -+ /** The percentage of the current task finished so far. */ - public int percentDone; -+ -+ /** True if the server is in online mode. */ - private boolean onlineMode; -+ -+ /** True if the server has animals turned on. */ - private boolean canSpawnAnimals; - private boolean canSpawnNPCs; -+ -+ /** Indicates whether PvP is active on the server or not. */ - private boolean pvpEnabled; -+ -+ /** Determines if flight is allowed or not. */ - private boolean allowFlight; -- private String C; -+ -+ /** The server MOTD string. */ -+ private String motd; -+ -+ /** Maximum build height. */ - private int buildLimit; -- private int field_143008_E = 0; -+ private int field_143008_E; - private long lastSentPacketID; - private long lastSentPacketSize; - private long lastReceivedID; - private long lastReceivedSize; -- public final long[] sentPacketCountArray = new long[100]; -- public final long[] sentPacketSizeArray = new long[100]; -- public final long[] receivedPacketCountArray = new long[100]; -- public final long[] receivedPacketSizeArray = new long[100]; -- public final long[] tickTimeArray = new long[100]; -+ public final long[] sentPacketCountArray; -+ public final long[] sentPacketSizeArray; -+ public final long[] receivedPacketCountArray; -+ public final long[] receivedPacketSizeArray; -+ public final long[] tickTimeArray; -+ -+ /** Stats are [dimension][tick%100] system.nanoTime is stored. */ - public long[][] timeOfLastDimensionTick; -- private KeyPair J; -- private String K; -- private String L; -- private String M; -+ private KeyPair serverKeyPair; -+ -+ /** Username of the server owner (for integrated servers) */ -+ private String serverOwner; -+ private String folderName; -+ private String worldName; - private boolean isDemo; - private boolean enableBonusChest; -+ -+ /** -+ * If true, there is no need to save chunks or stop the server, because that is already being done. -+ */ - private boolean worldIsBeingDeleted; -- private String Q = ""; -+ private String texturePack; - private boolean serverIsRunning; -+ -+ /** -+ * Set when warned for "Can't keep up", which triggers again after 15 seconds. -+ */ - private long timeOfLastWarning; -- private String T; -+ private String userMessage; - private boolean startProfiling; - private boolean isGamemodeForced; - -- public MinecraftServer(File var1) { -- l = this; -- this.o = var1; -+ public MinecraftServer(File par1File) { -+ this.serverProxy = Proxy.NO_PROXY; -+ this.field_143008_E = 0; -+ this.sentPacketCountArray = new long[100]; -+ this.sentPacketSizeArray = new long[100]; -+ this.receivedPacketCountArray = new long[100]; -+ this.receivedPacketSizeArray = new long[100]; -+ this.tickTimeArray = new long[100]; -+ this.texturePack = ""; -+ mcServer = this; -+ this.anvilFile = par1File; - this.commandManager = new ServerCommandManager(); -- this.anvilConverterForAnvilFile = new AnvilSaveConverter(var1); -+ this.anvilConverterForAnvilFile = new AnvilSaveConverter(par1File); - this.registerDispenseBehaviors(); - } - -+ /** -+ * Register all dispense behaviors. -+ */ - private void registerDispenseBehaviors() { - DispenserBehaviors.registerDispenserBehaviours(); - } - -+ /** -+ * Initialises the server and starts it. -+ */ - protected abstract boolean startServer() throws IOException; - -- protected void convertMapIfNeeded(String var1) { -- if(this.getActiveAnvilConverter().isOldMapFormat(var1)) { -+ protected void convertMapIfNeeded(String par1Str) { -+ if (this.getActiveAnvilConverter().isOldMapFormat(par1Str)) { - this.getLogAgent().logInfo("Converting map!"); - this.setUserMessage("menu.convertingLevel"); -- this.getActiveAnvilConverter().convertMapFormat(var1, new ConvertingProgressUpdate(this)); -+ this.getActiveAnvilConverter().convertMapFormat(par1Str, new ConvertingProgressUpdate(this)); - } -- - } - -- protected synchronized void setUserMessage(String var1) { -- this.T = var1; -+ /** -+ * Typically "menu.convertingLevel", "menu.loadingLevel" or others. -+ */ -+ protected synchronized void setUserMessage(String par1Str) { -+ this.userMessage = par1Str; - } - - public synchronized String getUserMessage() { -- return this.T; -+ return this.userMessage; - } - -- protected void loadAllWorlds(String var1, String var2, long var3, WorldType var5, String var6) { -- this.convertMapIfNeeded(var1); -+ protected void loadAllWorlds(String par1Str, String par2Str, long par3, WorldType par5WorldType, String par6Str) { -+ this.convertMapIfNeeded(par1Str); - this.setUserMessage("menu.loadingLevel"); - this.worldServers = new WorldServer[3]; - this.timeOfLastDimensionTick = new long[this.worldServers.length][100]; -- ISaveHandler var7 = this.anvilConverterForAnvilFile.getSaveLoader(var1, true); -+ ISaveHandler var7 = this.anvilConverterForAnvilFile.getSaveLoader(par1Str, true); - WorldInfo var9 = var7.loadWorldInfo(); - WorldSettings var8; -- if(var9 == null) { -- var8 = new WorldSettings(var3, this.getGameType(), this.canStructuresSpawn(), this.isHardcore(), var5); -- var8.func_82750_a(var6); -+ -+ if (var9 == null) { -+ var8 = new WorldSettings(par3, this.getGameType(), this.canStructuresSpawn(), this.isHardcore(), par5WorldType); -+ var8.func_82750_a(par6Str); - } else { - var8 = new WorldSettings(var9); - } - -- if(this.enableBonusChest) { -+ if (this.enableBonusChest) { - var8.enableBonusChest(); - } - -- for(int var10 = 0; var10 < this.worldServers.length; ++var10) { -+ for (int var10 = 0; var10 < this.worldServers.length; ++var10) { - byte var11 = 0; -- if(var10 == 1) { -+ -+ if (var10 == 1) { - var11 = -1; - } - -- if(var10 == 2) { -+ if (var10 == 2) { - var11 = 1; - } - -- if(var10 == 0) { -- if(this.isDemo()) { -- this.worldServers[var10] = new DemoWorldServer(this, var7, var2, var11, this.theProfiler, this.getLogAgent()); -+ if (var10 == 0) { -+ if (this.isDemo()) { -+ this.worldServers[var10] = new DemoWorldServer(this, var7, par2Str, var11, this.theProfiler, this.getLogAgent()); - } else { -- this.worldServers[var10] = new WorldServer(this, var7, var2, var11, var8, this.theProfiler, this.getLogAgent()); -+ this.worldServers[var10] = new WorldServer(this, var7, par2Str, var11, var8, this.theProfiler, this.getLogAgent()); - } - } else { -- this.worldServers[var10] = new WorldServerMulti(this, var7, var2, var11, var8, this.worldServers[0], this.theProfiler, this.getLogAgent()); -+ this.worldServers[var10] = new WorldServerMulti(this, var7, par2Str, var11, var8, this.worldServers[0], this.theProfiler, this.getLogAgent()); - } - - this.worldServers[var10].addWorldAccess(new WorldManager(this, this.worldServers[var10])); -- if(!this.isSinglePlayer()) { -+ -+ if (!this.isSinglePlayer()) { - this.worldServers[var10].getWorldInfo().setGameType(this.getGameType()); - } - -@@ -195,12 +268,13 @@ - this.getLogAgent().logInfo("Preparing start region for level " + var6); - WorldServer var7 = this.worldServers[var6]; - ChunkCoordinates var8 = var7.getSpawnPoint(); -- long var9 = getCurrentTimeMillis(); -- -- for(int var11 = -192; var11 <= 192 && this.isServerRunning(); var11 += 16) { -- for(int var12 = -192; var12 <= 192 && this.isServerRunning(); var12 += 16) { -- long var13 = getCurrentTimeMillis(); -- if(var13 - var9 > 1000L) { -+ long var9 = getSystemTimeMillis(); -+ -+ for (int var11 = -192; var11 <= 192 && this.isServerRunning(); var11 += 16) { -+ for (int var12 = -192; var12 <= 192 && this.isServerRunning(); var12 += 16) { -+ long var13 = getSystemTimeMillis(); -+ -+ if (var13 - var9 > 1000L) { - this.outputPercentRemaining("Preparing spawn area", var5 * 100 / 625); - var9 = var13; - } -@@ -217,32 +291,48 @@ - - public abstract EnumGameType getGameType(); - -+ /** -+ * Defaults to "1" (Easy) for the dedicated server, defaults to "2" (Normal) on the client. -+ */ - public abstract int getDifficulty(); - -+ /** -+ * Defaults to false. -+ */ - public abstract boolean isHardcore(); - - public abstract int func_110455_j(); - -- protected void outputPercentRemaining(String var1, int var2) { -- this.d = var1; -- this.percentDone = var2; -- this.getLogAgent().logInfo(var1 + ": " + var2 + "%"); -+ /** -+ * Used to display a percent remaining given text and the percentage. -+ */ -+ protected void outputPercentRemaining(String par1Str, int par2) { -+ this.currentTask = par1Str; -+ this.percentDone = par2; -+ this.getLogAgent().logInfo(par1Str + ": " + par2 + "%"); - } - -+ /** -+ * Set current task to null and set its percentage to 0. -+ */ - protected void clearCurrentTask() { -- this.d = null; -+ this.currentTask = null; - this.percentDone = 0; - } - -- protected void saveAllWorlds(boolean var1) { -- if(!this.worldIsBeingDeleted) { -+ /** -+ * par1 indicates if a log message should be output. -+ */ -+ protected void saveAllWorlds(boolean par1) { -+ if (!this.worldIsBeingDeleted) { - WorldServer[] var2 = this.worldServers; - int var3 = var2.length; - -- for(int var4 = 0; var4 < var3; ++var4) { -+ for (int var4 = 0; var4 < var3; ++var4) { - WorldServer var5 = var2[var4]; -- if(var5 != null) { -- if(!var1) { -+ -+ if (var5 != null) { -+ if (!par1) { - this.getLogAgent().logInfo("Saving chunks for level \'" + var5.getWorldInfo().getWorldName() + "\'/" + var5.provider.getDimensionName()); - } - -@@ -253,18 +343,21 @@ - } - } - } -- - } - } - -+ /** -+ * Saves all necessary data as preparation for stopping the server. -+ */ - public void stopServer() { -- if(!this.worldIsBeingDeleted) { -+ if (!this.worldIsBeingDeleted) { - this.getLogAgent().logInfo("Stopping server"); -- if(this.getNetworkThread() != null) { -+ -+ if (this.getNetworkThread() != null) { - this.getNetworkThread().stopListening(); - } - -- if(this.serverConfigManager != null) { -+ if (this.serverConfigManager != null) { - this.getLogAgent().logInfo("Saving players"); - this.serverConfigManager.saveAllPlayerData(); - this.serverConfigManager.removeAllPlayers(); -@@ -273,60 +366,67 @@ - this.getLogAgent().logInfo("Saving worlds"); - this.saveAllWorlds(false); - -- for(int var1 = 0; var1 < this.worldServers.length; ++var1) { -+ for (int var1 = 0; var1 < this.worldServers.length; ++var1) { - WorldServer var2 = this.worldServers[var1]; - var2.flush(); - } - -- if(this.usageSnooper != null && this.usageSnooper.isSnooperRunning()) { -+ if (this.usageSnooper != null && this.usageSnooper.isSnooperRunning()) { - this.usageSnooper.stopSnooper(); - } -- - } - } - -+ /** -+ * "getHostname" is already taken, but both return the hostname. -+ */ - public String getServerHostname() { -- return this.r; -+ return this.hostname; - } - -- public void setHostname(String var1) { -- this.r = var1; -+ public void setHostname(String par1Str) { -+ this.hostname = par1Str; - } - - public boolean isServerRunning() { - return this.serverRunning; - } - -+ /** -+ * Sets the serverRunning variable to false, in order to get the server to shut down. -+ */ - public void initiateShutdown() { - this.serverRunning = false; - } - - public void run() { - try { -- if(this.startServer()) { -- long var1 = getCurrentTimeMillis(); -+ if (this.startServer()) { -+ long var1 = getSystemTimeMillis(); - -- for(long var50 = 0L; this.serverRunning; this.serverIsRunning = true) { -- long var5 = getCurrentTimeMillis(); -+ for (long var50 = 0L; this.serverRunning; this.serverIsRunning = true) { -+ long var5 = getSystemTimeMillis(); - long var7 = var5 - var1; -- if(var7 > 2000L && var1 - this.timeOfLastWarning >= 15000L) { -+ -+ if (var7 > 2000L && var1 - this.timeOfLastWarning >= 15000L) { - this.getLogAgent().logWarning("Can\'t keep up! Did the system time change, or is the server overloaded?"); - var7 = 2000L; - this.timeOfLastWarning = var1; - } - -- if(var7 < 0L) { -+ if (var7 < 0L) { - this.getLogAgent().logWarning("Time ran backwards! Did the system time change?"); - var7 = 0L; - } - - var50 += var7; - var1 = var5; -- if(this.worldServers[0].areAllPlayersAsleep()) { -+ -+ if (this.worldServers[0].areAllPlayersAsleep()) { - this.tick(); - var50 = 0L; - } else { -- while(var50 > 50L) { -+ while (var50 > 50L) { - var50 -= 50L; - this.tick(); - } -@@ -341,14 +441,16 @@ - var48.printStackTrace(); - this.getLogAgent().logSevereException("Encountered an unexpected exception " + var48.getClass().getSimpleName(), var48); - CrashReport var2 = null; -- if(var48 instanceof ReportedException) { -+ -+ if (var48 instanceof ReportedException) { - var2 = this.addServerInfoToCrashReport(((ReportedException)var48).getCrashReport()); - } else { - var2 = this.addServerInfoToCrashReport(new CrashReport("Exception in server tick loop", var48)); - } - - File var3 = new File(new File(this.getDataDirectory(), "crash-reports"), "crash-" + (new SimpleDateFormat("yyyy-MM-dd_HH.mm.ss")).format(new Date()) + "-server.txt"); -- if(var2.saveToFile(var3, this.getLogAgent())) { -+ -+ if (var2.saveToFile(var3, this.getLogAgent())) { - this.getLogAgent().logSevere("This crash report has been saved to: " + var3.getAbsolutePath()); - } else { - this.getLogAgent().logSevere("We were unable to save this crash report to disk."); -@@ -364,26 +466,32 @@ - } finally { - this.systemExitNow(); - } -- - } -- - } - - protected File getDataDirectory() { - return new File("."); - } - -- protected void finalTick(CrashReport var1) { -- } -- -- protected void systemExitNow() { -- } -- -+ /** -+ * Called on exit from the main run() loop. -+ */ -+ protected void finalTick(CrashReport par1CrashReport) {} -+ -+ /** -+ * Directly calls System.exit(0), instantly killing the program. -+ */ -+ protected void systemExitNow() {} -+ -+ /** -+ * Main function called by run() every loop. -+ */ - public void tick() { - long var1 = System.nanoTime(); - AxisAlignedBB.getAABBPool().cleanPool(); - ++this.tickCounter; -- if(this.startProfiling) { -+ -+ if (this.startProfiling) { - this.startProfiling = false; - this.theProfiler.profilingEnabled = true; - this.theProfiler.clearProfiling(); -@@ -391,7 +499,8 @@ - - this.theProfiler.startSection("root"); - this.updateTimeLightAndEntities(); -- if(this.tickCounter % 900 == 0) { -+ -+ if (this.tickCounter % 900 == 0) { - this.theProfiler.startSection("save"); - this.serverConfigManager.saveAllPlayerData(); - this.saveAllWorlds(true); -@@ -410,11 +519,12 @@ - this.lastReceivedSize = Packet.receivedSize; - this.theProfiler.endSection(); - this.theProfiler.startSection("snooper"); -- if(!this.usageSnooper.isSnooperRunning() && this.tickCounter > 100) { -+ -+ if (!this.usageSnooper.isSnooperRunning() && this.tickCounter > 100) { - this.usageSnooper.startSnooper(); - } - -- if(this.tickCounter % 6000 == 0) { -+ if (this.tickCounter % 6000 == 0) { - this.usageSnooper.addMemoryStatsToSnooper(); - } - -@@ -424,25 +534,27 @@ - - public void updateTimeLightAndEntities() { - this.theProfiler.startSection("levels"); -- - int var1; -- for(var1 = 0; var1 < this.worldServers.length; ++var1) { -+ -+ for (var1 = 0; var1 < this.worldServers.length; ++var1) { - long var2 = System.nanoTime(); -- if(var1 == 0 || this.getAllowNether()) { -+ -+ if (var1 == 0 || this.getAllowNether()) { - WorldServer var4 = this.worldServers[var1]; - this.theProfiler.startSection(var4.getWorldInfo().getWorldName()); - this.theProfiler.startSection("pools"); - var4.getWorldVec3Pool().clear(); - this.theProfiler.endSection(); -- if(this.tickCounter % 20 == 0) { -+ -+ if (this.tickCounter % 20 == 0) { - this.theProfiler.startSection("timeSync"); - this.serverConfigManager.sendPacketToAllPlayersInDimension(new Packet4UpdateTime(var4.getTotalWorldTime(), var4.getWorldTime(), var4.getGameRules().getGameRuleBooleanValue("doDaylightCycle")), var4.provider.dimensionId); - this.theProfiler.endSection(); - } - - this.theProfiler.startSection("tick"); -- - CrashReport var6; -+ - try { - var4.tick(); - } catch (Throwable var8) { -@@ -470,13 +582,13 @@ - } - - this.theProfiler.endStartSection("connection"); -- this.getNetworkThread().handleNetworkListenThread(); -+ this.getNetworkThread().networkTick(); - this.theProfiler.endStartSection("players"); -- this.serverConfigManager.onTick(); -+ this.serverConfigManager.sendPlayerInfoToAllPlayers(); - this.theProfiler.endStartSection("tickables"); - -- for(var1 = 0; var1 < this.p.size(); ++var1) { -- ((IUpdatePlayerListBox)this.p.get(var1)).update(); -+ for (var1 = 0; var1 < this.tickables.size(); ++var1) { -+ ((IUpdatePlayerListBox)this.tickables.get(var1)).update(); - } - - this.theProfiler.endSection(); -@@ -490,104 +602,158 @@ - (new ThreadMinecraftServer(this, "Server thread")).start(); - } - -- public File getFile(String var1) { -- return new File(this.getDataDirectory(), var1); -- } -- -- public void logInfo(String var1) { -- this.getLogAgent().logInfo(var1); -- } -- -- public void logWarning(String var1) { -- this.getLogAgent().logWarning(var1); -- } -- -- public WorldServer worldServerForDimension(int var1) { -- return var1 == -1 ? this.worldServers[1] : (var1 == 1 ? this.worldServers[2] : this.worldServers[0]); -- } -- -+ /** -+ * Returns a File object from the specified string. -+ */ -+ public File getFile(String par1Str) { -+ return new File(this.getDataDirectory(), par1Str); -+ } -+ -+ /** -+ * Logs the message with a level of INFO. -+ */ -+ public void logInfo(String par1Str) { -+ this.getLogAgent().logInfo(par1Str); -+ } -+ -+ /** -+ * Logs the message with a level of WARN. -+ */ -+ public void logWarning(String par1Str) { -+ this.getLogAgent().logWarning(par1Str); -+ } -+ -+ /** -+ * Gets the worldServer by the given dimension. -+ */ -+ public WorldServer worldServerForDimension(int par1) { -+ return par1 == -1 ? this.worldServers[1] : (par1 == 1 ? this.worldServers[2] : this.worldServers[0]); -+ } -+ -+ /** -+ * Returns the server's hostname. -+ */ - public String getHostname() { -- return this.r; -+ return this.hostname; - } - -+ /** -+ * Never used, but "getServerPort" is already taken. -+ */ - public int getPort() { - return this.serverPort; - } - -- public String getMotd() { -- return this.C; -+ /** -+ * Returns the server message of the day -+ */ -+ public String getServerMOTD() { -+ return this.motd; - } - -+ /** -+ * Returns the server's Minecraft version as string. -+ */ - public String getMinecraftVersion() { - return "1.6.4"; - } - -+ /** -+ * Returns the number of players currently on the server. -+ */ - public int getCurrentPlayerCount() { - return this.serverConfigManager.getCurrentPlayerCount(); - } - -+ /** -+ * Returns the maximum number of players allowed on the server. -+ */ - public int getMaxPlayers() { - return this.serverConfigManager.getMaxPlayers(); - } - -+ /** -+ * Returns an array of the usernames of all the connected players. -+ */ - public String[] getAllUsernames() { - return this.serverConfigManager.getAllUsernames(); - } - -+ /** -+ * Used by RCon's Query in the form of "MajorServerMod 1.2.3: MyPlugin 1.3; AnotherPlugin 2.1; AndSoForth 1.0". -+ */ - public String getPlugins() { - return ""; - } - -- public String handleRConCommand(String var1) { -- RConConsoleSource.instance.resetLog(); -- this.commandManager.executeCommand(RConConsoleSource.instance, var1); -- return RConConsoleSource.instance.getLogContents(); -+ public String executeCommand(String par1Str) { -+ RConConsoleSource.consoleBuffer.resetLog(); -+ this.commandManager.executeCommand(RConConsoleSource.consoleBuffer, par1Str); -+ return RConConsoleSource.consoleBuffer.getChatBuffer(); - } - -+ /** -+ * Returns true if debugging is enabled, false otherwise. -+ */ - public boolean isDebuggingEnabled() { - return false; - } - -- public void logSevere(String var1) { -- this.getLogAgent().logSevere(var1); -+ /** -+ * Logs the error message with a level of SEVERE. -+ */ -+ public void logSevere(String par1Str) { -+ this.getLogAgent().logSevere(par1Str); - } - -- public void logDebug(String var1) { -- if(this.isDebuggingEnabled()) { -- this.getLogAgent().logInfo(var1); -+ /** -+ * If isDebuggingEnabled(), logs the message with a level of INFO. -+ */ -+ public void logDebug(String par1Str) { -+ if (this.isDebuggingEnabled()) { -+ this.getLogAgent().logInfo(par1Str); - } -- - } - - public String getServerModName() { - return "vanilla"; - } - -- public CrashReport addServerInfoToCrashReport(CrashReport var1) { -- var1.getCategory().addCrashSectionCallable("Profiler Position", new CallableIsServerModded(this)); -- if(this.worldServers != null && this.worldServers.length > 0 && this.worldServers[0] != null) { -- var1.getCategory().addCrashSectionCallable("Vec3 Pool Size", new CallableServerProfiler(this)); -- } -- -- if(this.serverConfigManager != null) { -- var1.getCategory().addCrashSectionCallable("Player Count", new CallableServerMemoryStats(this)); -- } -- -- return var1; -+ /** -+ * Adds the server info, including from theWorldServer, to the crash report. -+ */ -+ public CrashReport addServerInfoToCrashReport(CrashReport par1CrashReport) { -+ par1CrashReport.getCategory().addCrashSectionCallable("Profiler Position", new CallableIsServerModded(this)); -+ -+ if (this.worldServers != null && this.worldServers.length > 0 && this.worldServers[0] != null) { -+ par1CrashReport.getCategory().addCrashSectionCallable("Vec3 Pool Size", new CallableServerProfiler(this)); -+ } -+ -+ if (this.serverConfigManager != null) { -+ par1CrashReport.getCategory().addCrashSectionCallable("Player Count", new CallableServerMemoryStats(this)); -+ } -+ -+ return par1CrashReport; - } - -- public List getPossibleCompletions(ICommandSender var1, String var2) { -+ /** -+ * If par2Str begins with /, then it searches for commands, otherwise it returns players. -+ */ -+ public List getPossibleCompletions(ICommandSender par1ICommandSender, String par2Str) { - ArrayList var3 = new ArrayList(); -- if(var2.startsWith("/")) { -- var2 = var2.substring(1); -- boolean var10 = !var2.contains(" "); -- List var11 = this.commandManager.getPossibleCommands(var1, var2); -- if(var11 != null) { -+ -+ if (par2Str.startsWith("/")) { -+ par2Str = par2Str.substring(1); -+ boolean var10 = !par2Str.contains(" "); -+ List var11 = this.commandManager.getPossibleCommands(par1ICommandSender, par2Str); -+ -+ if (var11 != null) { - Iterator var12 = var11.iterator(); - -- while(var12.hasNext()) { -+ while (var12.hasNext()) { - String var13 = (String)var12.next(); -- if(var10) { -+ -+ if (var10) { - var3.add("/" + var13); - } else { - var3.add(var13); -@@ -597,14 +763,15 @@ - - return var3; - } else { -- String[] var4 = var2.split(" ", -1); -+ String[] var4 = par2Str.split(" ", -1); - String var5 = var4[var4.length - 1]; - String[] var6 = this.serverConfigManager.getAllUsernames(); - int var7 = var6.length; - -- for(int var8 = 0; var8 < var7; ++var8) { -+ for (int var8 = 0; var8 < var7; ++var8) { - String var9 = var6[var8]; -- if(CommandBase.doesStringStartWith(var5, var9)) { -+ -+ if (CommandBase.doesStringStartWith(var5, var9)) { - var3.add(var9); - } - } -@@ -613,19 +780,28 @@ - } - } - -+ /** -+ * Gets mcServer. -+ */ - public static MinecraftServer getServer() { -- return l; -+ return mcServer; - } - -+ /** -+ * Gets the name of this command sender (usually username, but possibly "Rcon") -+ */ - public String getCommandSenderName() { - return "Server"; - } - -- public void sendChatToPlayer(ChatMessageComponent var1) { -- this.getLogAgent().logInfo(var1.toString()); -+ public void sendChatToPlayer(ChatMessageComponent par1ChatMessageComponent) { -+ this.getLogAgent().logInfo(par1ChatMessageComponent.toString()); - } - -- public boolean canCommandSenderUseCommand(int var1, String var2) { -+ /** -+ * Returns true if the command sender is allowed to use the given command. -+ */ -+ public boolean canCommandSenderUseCommand(int par1, String par2Str) { - return true; - } - -@@ -633,96 +809,119 @@ - return this.commandManager; - } - -+ /** -+ * Gets KeyPair instanced in MinecraftServer. -+ */ - public KeyPair getKeyPair() { -- return this.J; -+ return this.serverKeyPair; - } - -+ /** -+ * Gets serverPort. -+ */ - public int getServerPort() { - return this.serverPort; - } - -- public void setServerPort(int var1) { -- this.serverPort = var1; -+ public void setServerPort(int par1) { -+ this.serverPort = par1; - } - -+ /** -+ * Returns the username of the server owner (for integrated servers) -+ */ - public String getServerOwner() { -- return this.K; -+ return this.serverOwner; - } - -- public void setServerOwner(String var1) { -- this.K = var1; -+ /** -+ * Sets the username of the owner of this server (in the case of an integrated server) -+ */ -+ public void setServerOwner(String par1Str) { -+ this.serverOwner = par1Str; - } - - public boolean isSinglePlayer() { -- return this.K != null; -+ return this.serverOwner != null; - } - - public String getFolderName() { -- return this.L; -- } -- -- public void setFolderName(String var1) { -- this.L = var1; -- } -- -- public void setWorldName(String var1) { -- this.M = var1; -+ return this.folderName; -+ } -+ -+ public void setFolderName(String par1Str) { -+ this.folderName = par1Str; -+ } -+ -+ public void setWorldName(String par1Str) { -+ this.worldName = par1Str; - } - - public String getWorldName() { -- return this.M; -- } -- -- public void setKeyPair(KeyPair var1) { -- this.J = var1; -- } -- -- public void setDifficultyForAllWorlds(int var1) { -- for(int var2 = 0; var2 < this.worldServers.length; ++var2) { -+ return this.worldName; -+ } -+ -+ public void setKeyPair(KeyPair par1KeyPair) { -+ this.serverKeyPair = par1KeyPair; -+ } -+ -+ public void setDifficultyForAllWorlds(int par1) { -+ for (int var2 = 0; var2 < this.worldServers.length; ++var2) { - WorldServer var3 = this.worldServers[var2]; -- if(var3 != null) { -- if(var3.getWorldInfo().isHardcoreModeEnabled()) { -+ -+ if (var3 != null) { -+ if (var3.getWorldInfo().isHardcoreModeEnabled()) { - var3.difficultySetting = 3; - var3.setAllowedSpawnTypes(true, true); -- } else if(this.isSinglePlayer()) { -- var3.difficultySetting = var1; -+ } else if (this.isSinglePlayer()) { -+ var3.difficultySetting = par1; - var3.setAllowedSpawnTypes(var3.difficultySetting > 0, true); - } else { -- var3.difficultySetting = var1; -+ var3.difficultySetting = par1; - var3.setAllowedSpawnTypes(this.allowSpawnMonsters(), this.canSpawnAnimals); - } - } - } -- - } - - protected boolean allowSpawnMonsters() { - return true; - } - -+ /** -+ * Gets whether this is a demo or not. -+ */ - public boolean isDemo() { - return this.isDemo; - } - -- public void setDemo(boolean var1) { -- this.isDemo = var1; -+ /** -+ * Sets whether this is a demo or not. -+ */ -+ public void setDemo(boolean par1) { -+ this.isDemo = par1; - } - -- public void canCreateBonusChest(boolean var1) { -- this.enableBonusChest = var1; -+ public void canCreateBonusChest(boolean par1) { -+ this.enableBonusChest = par1; - } - - public ISaveFormat getActiveAnvilConverter() { - return this.anvilConverterForAnvilFile; - } - -+ /** -+ * WARNING : directly calls -+ * getActiveAnvilConverter().deleteWorldDirectory(theWorldServer[0].getSaveHandler().getWorldDirectoryName()); -+ */ - public void deleteWorldAndStopServer() { - this.worldIsBeingDeleted = true; - this.getActiveAnvilConverter().flushCache(); - -- for(int var1 = 0; var1 < this.worldServers.length; ++var1) { -+ for (int var1 = 0; var1 < this.worldServers.length; ++var1) { - WorldServer var2 = this.worldServers[var1]; -- if(var2 != null) { -+ -+ if (var2 != null) { - var2.flush(); - } - } -@@ -732,59 +931,65 @@ - } - - public String getTexturePack() { -- return this.Q; -- } -- -- public void setTexturePack(String var1) { -- this.Q = var1; -- } -- -- public void addServerStatsToSnooper(PlayerUsageSnooper var1) { -- var1.addData("whitelist_enabled", Boolean.valueOf(false)); -- var1.addData("whitelist_count", Integer.valueOf(0)); -- var1.addData("players_current", Integer.valueOf(this.getCurrentPlayerCount())); -- var1.addData("players_max", Integer.valueOf(this.getMaxPlayers())); -- var1.addData("players_seen", Integer.valueOf(this.serverConfigManager.getAvailablePlayerDat().length)); -- var1.addData("uses_auth", Boolean.valueOf(this.onlineMode)); -- var1.addData("gui_state", this.getGuiEnabled() ? "enabled" : "disabled"); -- var1.addData("run_time", Long.valueOf((getCurrentTimeMillis() - var1.func_130105_g()) / 60L * 1000L)); -- var1.addData("avg_tick_ms", Integer.valueOf((int)(MathHelper.average(this.tickTimeArray) * 1.0E-6D))); -- var1.addData("avg_sent_packet_count", Integer.valueOf((int)MathHelper.average(this.sentPacketCountArray))); -- var1.addData("avg_sent_packet_size", Integer.valueOf((int)MathHelper.average(this.sentPacketSizeArray))); -- var1.addData("avg_rec_packet_count", Integer.valueOf((int)MathHelper.average(this.receivedPacketCountArray))); -- var1.addData("avg_rec_packet_size", Integer.valueOf((int)MathHelper.average(this.receivedPacketSizeArray))); -+ return this.texturePack; -+ } -+ -+ public void setTexturePack(String par1Str) { -+ this.texturePack = par1Str; -+ } -+ -+ public void addServerStatsToSnooper(PlayerUsageSnooper par1PlayerUsageSnooper) { -+ par1PlayerUsageSnooper.addData("whitelist_enabled", Boolean.valueOf(false)); -+ par1PlayerUsageSnooper.addData("whitelist_count", Integer.valueOf(0)); -+ par1PlayerUsageSnooper.addData("players_current", Integer.valueOf(this.getCurrentPlayerCount())); -+ par1PlayerUsageSnooper.addData("players_max", Integer.valueOf(this.getMaxPlayers())); -+ par1PlayerUsageSnooper.addData("players_seen", Integer.valueOf(this.serverConfigManager.getAvailablePlayerDat().length)); -+ par1PlayerUsageSnooper.addData("uses_auth", Boolean.valueOf(this.onlineMode)); -+ par1PlayerUsageSnooper.addData("gui_state", this.getGuiEnabled() ? "enabled" : "disabled"); -+ par1PlayerUsageSnooper.addData("run_time", Long.valueOf((getSystemTimeMillis() - par1PlayerUsageSnooper.func_130105_g()) / 60L * 1000L)); -+ par1PlayerUsageSnooper.addData("avg_tick_ms", Integer.valueOf((int)(MathHelper.average(this.tickTimeArray) * 1.0E-6D))); -+ par1PlayerUsageSnooper.addData("avg_sent_packet_count", Integer.valueOf((int)MathHelper.average(this.sentPacketCountArray))); -+ par1PlayerUsageSnooper.addData("avg_sent_packet_size", Integer.valueOf((int)MathHelper.average(this.sentPacketSizeArray))); -+ par1PlayerUsageSnooper.addData("avg_rec_packet_count", Integer.valueOf((int)MathHelper.average(this.receivedPacketCountArray))); -+ par1PlayerUsageSnooper.addData("avg_rec_packet_size", Integer.valueOf((int)MathHelper.average(this.receivedPacketSizeArray))); - int var2 = 0; - -- for(int var3 = 0; var3 < this.worldServers.length; ++var3) { -- if(this.worldServers[var3] != null) { -+ for (int var3 = 0; var3 < this.worldServers.length; ++var3) { -+ if (this.worldServers[var3] != null) { - WorldServer var4 = this.worldServers[var3]; - WorldInfo var5 = var4.getWorldInfo(); -- var1.addData("world[" + var2 + "][dimension]", Integer.valueOf(var4.provider.dimensionId)); -- var1.addData("world[" + var2 + "][mode]", var5.getGameType()); -- var1.addData("world[" + var2 + "][difficulty]", Integer.valueOf(var4.difficultySetting)); -- var1.addData("world[" + var2 + "][hardcore]", Boolean.valueOf(var5.isHardcoreModeEnabled())); -- var1.addData("world[" + var2 + "][generator_name]", var5.getTerrainType().getWorldTypeName()); -- var1.addData("world[" + var2 + "][generator_version]", Integer.valueOf(var5.getTerrainType().getGeneratorVersion())); -- var1.addData("world[" + var2 + "][height]", Integer.valueOf(this.buildLimit)); -- var1.addData("world[" + var2 + "][chunks_loaded]", Integer.valueOf(var4.getChunkProvider().getLoadedChunkCount())); -+ par1PlayerUsageSnooper.addData("world[" + var2 + "][dimension]", Integer.valueOf(var4.provider.dimensionId)); -+ par1PlayerUsageSnooper.addData("world[" + var2 + "][mode]", var5.getGameType()); -+ par1PlayerUsageSnooper.addData("world[" + var2 + "][difficulty]", Integer.valueOf(var4.difficultySetting)); -+ par1PlayerUsageSnooper.addData("world[" + var2 + "][hardcore]", Boolean.valueOf(var5.isHardcoreModeEnabled())); -+ par1PlayerUsageSnooper.addData("world[" + var2 + "][generator_name]", var5.getTerrainType().getWorldTypeName()); -+ par1PlayerUsageSnooper.addData("world[" + var2 + "][generator_version]", Integer.valueOf(var5.getTerrainType().getGeneratorVersion())); -+ par1PlayerUsageSnooper.addData("world[" + var2 + "][height]", Integer.valueOf(this.buildLimit)); -+ par1PlayerUsageSnooper.addData("world[" + var2 + "][chunks_loaded]", Integer.valueOf(var4.getChunkProvider().getLoadedChunkCount())); - ++var2; - } - } - -- var1.addData("worlds", Integer.valueOf(var2)); -- } -- -- public void addServerTypeToSnooper(PlayerUsageSnooper var1) { -- var1.addData("singleplayer", Boolean.valueOf(this.isSinglePlayer())); -- var1.addData("server_brand", this.getServerModName()); -- var1.addData("gui_supported", GraphicsEnvironment.isHeadless() ? "headless" : "supported"); -- var1.addData("dedicated", Boolean.valueOf(this.isDedicatedServer())); -- } -- -+ par1PlayerUsageSnooper.addData("worlds", Integer.valueOf(var2)); -+ } -+ -+ public void addServerTypeToSnooper(PlayerUsageSnooper par1PlayerUsageSnooper) { -+ par1PlayerUsageSnooper.addData("singleplayer", Boolean.valueOf(this.isSinglePlayer())); -+ par1PlayerUsageSnooper.addData("server_brand", this.getServerModName()); -+ par1PlayerUsageSnooper.addData("gui_supported", GraphicsEnvironment.isHeadless() ? "headless" : "supported"); -+ par1PlayerUsageSnooper.addData("dedicated", Boolean.valueOf(this.isDedicatedServer())); -+ } -+ -+ /** -+ * Returns whether snooping is enabled or not. -+ */ - public boolean isSnooperEnabled() { - return true; - } - -+ /** -+ * This is checked to be 16 upon receiving the packet, otherwise the packet is ignored. -+ */ - public int textureSize() { - return 16; - } -@@ -795,58 +1000,61 @@ - return this.onlineMode; - } - -- public void setOnlineMode(boolean var1) { -- this.onlineMode = var1; -+ public void setOnlineMode(boolean par1) { -+ this.onlineMode = par1; - } - - public boolean getCanSpawnAnimals() { - return this.canSpawnAnimals; - } - -- public void setCanSpawnAnimals(boolean var1) { -- this.canSpawnAnimals = var1; -+ public void setCanSpawnAnimals(boolean par1) { -+ this.canSpawnAnimals = par1; - } - - public boolean getCanSpawnNPCs() { - return this.canSpawnNPCs; - } - -- public void setCanSpawnNPCs(boolean var1) { -- this.canSpawnNPCs = var1; -+ public void setCanSpawnNPCs(boolean par1) { -+ this.canSpawnNPCs = par1; - } - - public boolean isPVPEnabled() { - return this.pvpEnabled; - } - -- public void setAllowPvp(boolean var1) { -- this.pvpEnabled = var1; -+ public void setAllowPvp(boolean par1) { -+ this.pvpEnabled = par1; - } - - public boolean isFlightAllowed() { - return this.allowFlight; - } - -- public void setAllowFlight(boolean var1) { -- this.allowFlight = var1; -+ public void setAllowFlight(boolean par1) { -+ this.allowFlight = par1; - } - -+ /** -+ * Return whether command blocks are enabled. -+ */ - public abstract boolean isCommandBlockEnabled(); - - public String getMOTD() { -- return this.C; -+ return this.motd; - } - -- public void setMOTD(String var1) { -- this.C = var1; -+ public void setMOTD(String par1Str) { -+ this.motd = par1Str; - } - - public int getBuildLimit() { - return this.buildLimit; - } - -- public void setBuildLimit(int var1) { -- this.buildLimit = var1; -+ public void setBuildLimit(int par1) { -+ this.buildLimit = par1; - } - - public boolean isServerStopped() { -@@ -857,15 +1065,17 @@ - return this.serverConfigManager; - } - -- public void setConfigurationManager(ServerConfigurationManager var1) { -- this.serverConfigManager = var1; -+ public void setConfigurationManager(ServerConfigurationManager par1ServerConfigurationManager) { -+ this.serverConfigManager = par1ServerConfigurationManager; - } - -- public void setGameType(EnumGameType var1) { -- for(int var2 = 0; var2 < this.worldServers.length; ++var2) { -- getServer().worldServers[var2].getWorldInfo().setGameType(var1); -+ /** -+ * Sets the game type for all worlds. -+ */ -+ public void setGameType(EnumGameType par1EnumGameType) { -+ for (int var2 = 0; var2 < this.worldServers.length; ++var2) { -+ getServer().worldServers[var2].getWorldInfo().setGameType(par1EnumGameType); - } -- - } - - public abstract NetworkListenThread getNetworkThread(); -@@ -878,6 +1088,9 @@ - return false; - } - -+ /** -+ * On dedicated does nothing. On integrated, sets commandsAllowedForAll, gameType and allows external connections. -+ */ - public abstract String shareToLAN(EnumGameType var1, boolean var2); - - public int getTickCounter() { -@@ -892,7 +1105,10 @@ - return this.usageSnooper; - } - -- public ChunkCoordinates getCommandSenderPosition() { -+ /** -+ * Return the position for this command sender. -+ */ -+ public ChunkCoordinates getPlayerCoordinates() { - return new ChunkCoordinates(0, 0, 0); - } - -@@ -900,18 +1116,24 @@ - return this.worldServers[0]; - } - -+ /** -+ * Return the spawn protection area's size. -+ */ - public int getSpawnProtectionSize() { - return 16; - } - -- public boolean isBlockProtected(World var1, int var2, int var3, int var4, EntityPlayer var5) { -+ /** -+ * Returns true if a player does not have permission to edit the block at the given coordinates. -+ */ -+ public boolean isBlockProtected(World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer) { - return false; - } - - public abstract ILogAgent getLogAgent(); - -- public void setForceGamemode(boolean var1) { -- this.isGamemodeForced = var1; -+ public void setForceGamemode(boolean par1) { -+ this.isGamemodeForced = par1; - } - - public boolean getForceGamemode() { -@@ -919,10 +1141,13 @@ - } - - public Proxy getServerProxy() { -- return this.c; -+ return this.serverProxy; - } - -- public static long getCurrentTimeMillis() { -+ /** -+ * returns the difference, measured in milliseconds, between the current system time and midnight, January 1, 1970 UTC. -+ */ -+ public static long getSystemTimeMillis() { - return System.currentTimeMillis(); - } - -@@ -930,11 +1155,14 @@ - return this.field_143008_E; - } - -- public void func_143006_e(int var1) { -- this.field_143008_E = var1; -+ public void func_143006_e(int par1) { -+ this.field_143008_E = par1; - } - -- public static ServerConfigurationManager getServerConfigurationManager(MinecraftServer var0) { -- return var0.serverConfigManager; -+ /** -+ * Gets the current player count, maximum player count, and player entity list. -+ */ -+ public static ServerConfigurationManager getServerConfigurationManager(MinecraftServer par0MinecraftServer) { -+ return par0MinecraftServer.serverConfigManager; - } - } ---- net/minecraft/src/WorldProviderEnd.java -+++ net/minecraft/src/WorldProviderEnd.java -@@ -1,65 +1,103 @@ - package net.minecraft.src; - -+// MCPatcher Start -+import com.prupe.mcpatcher.cc.ColorizeWorld; -+// MCPatcher End -+ - public class WorldProviderEnd extends WorldProvider { -+ -+ /** -+ * creates a new world chunk manager for WorldProvider -+ */ - public void registerWorldChunkManager() { - this.worldChunkMgr = new WorldChunkManagerHell(BiomeGenBase.sky, 0.5F, 0.0F); - this.dimensionId = 1; - this.hasNoSky = true; - } - -+ /** -+ * Returns a new chunk provider which generates chunks for this world -+ */ - public IChunkProvider createChunkGenerator() { - return new ChunkProviderEnd(this.worldObj, this.worldObj.getSeed()); - } - -- public float calculateCelestialAngle(long var1, float var3) { -+ /** -+ * Calculates the angle of sun and moon in the sky relative to a specified time (usually worldTime) -+ */ -+ public float calculateCelestialAngle(long par1, float par3) { - return 0.0F; - } - -- public float[] calcSunriseSunsetColors(float var1, float var2) { -+ /** -+ * Returns array with sunrise/sunset colors -+ */ -+ public float[] calcSunriseSunsetColors(float par1, float par2) { - return null; - } - -- public Vec3 getFogColor(float var1, float var2) { -+ /** -+ * Return Vec3D with biome specific fog color -+ */ -+ public Vec3 getFogColor(float par1, float par2) { - int var3 = 10518688; -- float var4 = MathHelper.cos(var1 * (float)Math.PI * 2.0F) * 2.0F + 0.5F; -- if(var4 < 0.0F) { -+ float var4 = MathHelper.cos(par1 * (float)Math.PI * 2.0F) * 2.0F + 0.5F; -+ -+ if (var4 < 0.0F) { - var4 = 0.0F; - } - -- if(var4 > 1.0F) { -+ if (var4 > 1.0F) { - var4 = 1.0F; - } - - float var5 = (float)(var3 >> 16 & 255) / 255.0F; - float var6 = (float)(var3 >> 8 & 255) / 255.0F; - float var7 = (float)(var3 & 255) / 255.0F; -- var5 *= var4 * 0.0F + 0.15F; -- var6 *= var4 * 0.0F + 0.15F; -- var7 *= var4 * 0.0F + 0.15F; -- return this.worldObj.getWorldVec3Pool().getVecFromPool((double)var5, (double)var6, (double)var7); -+ // MCPatcher Start -+ float var10000 = var5 * (var4 * 0.0F + 0.15F); -+ var10000 = var6 * (var4 * 0.0F + 0.15F); -+ var10000 = var7 * (var4 * 0.0F + 0.15F); -+ return this.worldObj.getWorldVec3Pool().getVecFromPool((double)ColorizeWorld.endFogColor[0], (double)ColorizeWorld.endFogColor[1], (double)ColorizeWorld.endFogColor[2]); -+ // MCPatcher End - } - - public boolean isSkyColored() { - return false; - } - -+ /** -+ * True if the player can respawn in this dimension (true = overworld, false = nether). -+ */ - public boolean canRespawnHere() { - return false; - } - -+ /** -+ * Returns 'true' if in the "main surface world", but 'false' if in the Nether or End dimensions. -+ */ - public boolean isSurfaceWorld() { - return false; - } - -+ /** -+ * the y level at which clouds are rendered. -+ */ - public float getCloudHeight() { - return 8.0F; - } - -- public boolean canCoordinateBeSpawn(int var1, int var2) { -- int var3 = this.worldObj.getFirstUncoveredBlock(var1, var2); -+ /** -+ * Will check if the x, z position specified is alright to be set as the map spawn point -+ */ -+ public boolean canCoordinateBeSpawn(int par1, int par2) { -+ int var3 = this.worldObj.getFirstUncoveredBlock(par1, par2); - return var3 == 0 ? false : Block.blocksList[var3].blockMaterial.blocksMovement(); - } - -+ /** -+ * Gets the hard-coded portal location to use when entering this dimension. -+ */ - public ChunkCoordinates getEntrancePortalLocation() { - return new ChunkCoordinates(100, 50, 0); - } -@@ -68,10 +106,16 @@ - return 50; - } - -- public boolean doesXZShowFog(int var1, int var2) { -+ /** -+ * Returns true if the given X,Z coordinate should show environmental fog. -+ */ -+ public boolean doesXZShowFog(int par1, int par2) { - return true; - } - -+ /** -+ * Returns the dimension's name, e.g. "The End", "Nether", or "Overworld". -+ */ - public String getDimensionName() { - return "The End"; - } ---- /dev/null -+++ org/spoutcraft/client/gui/controls/VanillaBindingItem.java -@@ -1,0 +1,107 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.client.gui.controls; -+ -+import net.minecraft.src.FontRenderer; -+import net.minecraft.src.GameSettings; -+import net.minecraft.src.KeyBinding; -+ -+import org.spoutcraft.client.SpoutClient; -+ -+public class VanillaBindingItem extends ControlsBasicItem { -+ protected KeyBinding binding; -+ private int n ; -+ private ControlsModel parent; -+ public VanillaBindingItem(int n, KeyBinding binding, ControlsModel model) { -+ super(model); -+ this.binding = binding; -+ this.n = n; -+ this.parent = model; -+ } -+ -+ public int getHeight() { -+ return 11; -+ } -+ -+ public void render(int x, int y, int width, int height) { -+ FontRenderer font = SpoutClient.getHandle().fontRenderer; -+ font.drawStringWithShadow("V", x + 2, y + 2, 0xffffff00); -+ int w = font.getStringWidth("V"); -+ font.drawStringWithShadow(getName(), x + w + 4, y + 2, !isConflicting() ? 0xffffffff:0xffff0000); -+ String keyString = parent.getEditingItem() == this ? "> <" : getDisplayKey();; -+ w = font.getStringWidth(keyString); -+ font.drawStringWithShadow(keyString, width - w, y + 2, 0xffcccccc); -+ } -+ -+ public String getDisplayKey() { -+ if (binding.keyCode == -128) { -+ return "Unbound"; -+ } -+ return GameSettings.getKeyDisplayString(getKey()); -+ } -+ -+ @Override -+ public void setKey(int id) { -+ SpoutClient.getHandle().gameSettings.setKeyBinding(n, id); -+ KeyBinding.resetKeyBindingArrayAndHash(); -+ } -+ -+ @Override -+ public int getKey() { -+ return binding.keyCode; -+ } -+ -+ public boolean useModifiers() { -+ return false; -+ } -+ -+ public boolean useMouseButtons() { -+ return true; -+ } -+ -+ public String getName() { -+ return SpoutClient.getHandle().gameSettings.getKeyBindingDescription(n); -+ } -+ -+ @Override -+ public boolean conflicts(ControlsBasicItem other) { -+ if (other instanceof SpoutcraftBindingItem) { -+ GameSettings settings = SpoutClient.getHandle().gameSettings; -+ SpoutcraftBindingItem item = (SpoutcraftBindingItem)other; -+ boolean flightKey = item.binding == settings.keyFlyBack || -+ item.binding == settings.keyFlyLeft || -+ item.binding == settings.keyFlyForward || -+ item.binding == settings.keyFlyRight || -+ item.binding == settings.keyFlyUp || -+ item.binding == settings.keyFlyDown; -+ boolean movementKey = binding == settings.keyBindBack || -+ binding == settings.keyBindLeft || -+ binding == settings.keyBindForward || -+ binding == settings.keyBindRight || -+ binding == settings.keyBindJump || -+ binding == settings.keyBindSneak; -+ // Allow overlaps -+ if (flightKey && movementKey) { -+ return false; -+ } -+ } -+ return super.conflicts(other); -+ } -+} ---- net/minecraft/src/WorldGenTaiga1.java -+++ net/minecraft/src/WorldGenTaiga1.java -@@ -3,31 +3,35 @@ - import java.util.Random; - - public class WorldGenTaiga1 extends WorldGenerator { -- public boolean generate(World var1, Random var2, int var3, int var4, int var5) { -- int var6 = var2.nextInt(5) + 7; -- int var7 = var6 - var2.nextInt(2) - 3; -+ public boolean generate(World par1World, Random par2Random, int par3, int par4, int par5) { -+ int var6 = par2Random.nextInt(5) + 7; -+ int var7 = var6 - par2Random.nextInt(2) - 3; - int var8 = var6 - var7; -- int var9 = 1 + var2.nextInt(var8 + 1); -+ int var9 = 1 + par2Random.nextInt(var8 + 1); - boolean var10 = true; -- if(var4 >= 1 && var4 + var6 + 1 <= 128) { -+ -+ if (par4 >= 1 && par4 + var6 + 1 <= 128) { - int var11; - int var13; - int var14; - int var15; - int var18; -- for(var11 = var4; var11 <= var4 + 1 + var6 && var10; ++var11) { -+ -+ for (var11 = par4; var11 <= par4 + 1 + var6 && var10; ++var11) { - boolean var12 = true; -- if(var11 - var4 < var7) { -+ -+ if (var11 - par4 < var7) { - var18 = 0; - } else { - var18 = var9; - } - -- for(var13 = var3 - var18; var13 <= var3 + var18 && var10; ++var13) { -- for(var14 = var5 - var18; var14 <= var5 + var18 && var10; ++var14) { -- if(var11 >= 0 && var11 < 128) { -- var15 = var1.getBlockId(var13, var11, var14); -- if(var15 != 0 && var15 != Block.leaves.blockID) { -+ for (var13 = par3 - var18; var13 <= par3 + var18 && var10; ++var13) { -+ for (var14 = par5 - var18; var14 <= par5 + var18 && var10; ++var14) { -+ if (var11 >= 0 && var11 < 128) { -+ var15 = par1World.getBlockId(var13, var11, var14); -+ -+ if (var15 != 0 && var15 != Block.leaves.blockID) { - var10 = false; - } - } else { -@@ -37,37 +41,40 @@ - } - } - -- if(!var10) { -+ if (!var10) { - return false; - } else { -- var11 = var1.getBlockId(var3, var4 - 1, var5); -- if((var11 == Block.grass.blockID || var11 == Block.dirt.blockID) && var4 < 128 - var6 - 1) { -- this.setBlock(var1, var3, var4 - 1, var5, Block.dirt.blockID); -+ var11 = par1World.getBlockId(par3, par4 - 1, par5); -+ -+ if ((var11 == Block.grass.blockID || var11 == Block.dirt.blockID) && par4 < 128 - var6 - 1) { -+ this.setBlock(par1World, par3, par4 - 1, par5, Block.dirt.blockID); - var18 = 0; - -- for(var13 = var4 + var6; var13 >= var4 + var7; --var13) { -- for(var14 = var3 - var18; var14 <= var3 + var18; ++var14) { -- var15 = var14 - var3; -- -- for(int var16 = var5 - var18; var16 <= var5 + var18; ++var16) { -- int var17 = var16 - var5; -- if((Math.abs(var15) != var18 || Math.abs(var17) != var18 || var18 <= 0) && !Block.opaqueCubeLookup[var1.getBlockId(var14, var13, var16)]) { -- this.setBlockAndMetadata(var1, var14, var13, var16, Block.leaves.blockID, 1); -+ for (var13 = par4 + var6; var13 >= par4 + var7; --var13) { -+ for (var14 = par3 - var18; var14 <= par3 + var18; ++var14) { -+ var15 = var14 - par3; -+ -+ for (int var16 = par5 - var18; var16 <= par5 + var18; ++var16) { -+ int var17 = var16 - par5; -+ -+ if ((Math.abs(var15) != var18 || Math.abs(var17) != var18 || var18 <= 0) && !Block.opaqueCubeLookup[par1World.getBlockId(var14, var13, var16)]) { -+ this.setBlockAndMetadata(par1World, var14, var13, var16, Block.leaves.blockID, 1); - } - } - } - -- if(var18 >= 1 && var13 == var4 + var7 + 1) { -+ if (var18 >= 1 && var13 == par4 + var7 + 1) { - --var18; -- } else if(var18 < var9) { -+ } else if (var18 < var9) { - ++var18; - } - } - -- for(var13 = 0; var13 < var6 - 1; ++var13) { -- var14 = var1.getBlockId(var3, var4 + var13, var5); -- if(var14 == 0 || var14 == Block.leaves.blockID) { -- this.setBlockAndMetadata(var1, var3, var4 + var13, var5, Block.wood.blockID, 1); -+ for (var13 = 0; var13 < var6 - 1; ++var13) { -+ var14 = par1World.getBlockId(par3, par4 + var13, par5); -+ -+ if (var14 == 0 || var14 == Block.leaves.blockID) { -+ this.setBlockAndMetadata(par1World, par3, par4 + var13, par5, Block.wood.blockID, 1); - } - } - ---- /dev/null -+++ org/spoutcraft/client/gui/settings/controls/ReplaceBlocksButton.java -@@ -1,0 +1,37 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.client.gui.settings.controls; -+ -+import org.spoutcraft.api.gui.GenericCheckBox; -+import org.spoutcraft.client.config.Configuration; -+ -+public class ReplaceBlocksButton extends GenericCheckBox { -+ public ReplaceBlocksButton() { -+ super("Auto Replace Blocks"); -+ setChecked(Configuration.isReplaceBlocks()); -+ setTooltip("Replaces used up blocks with spares from your inventory"); -+ } -+ -+ @Override -+ public void onButtonClick() { -+ Configuration.setReplaceBlocks(!Configuration.isReplaceBlocks()); -+ Configuration.write(); -+ } -+} ---- net/minecraft/src/ModelBox.java -+++ net/minecraft/src/ModelBox.java -@@ -1,48 +1,67 @@ - package net.minecraft.src; - - public class ModelBox { -+ -+ /** -+ * The (x,y,z) vertex positions and (u,v) texture coordinates for each of the 8 points on a cube -+ */ - private PositionTextureVertex[] vertexPositions; -+ -+ /** An array of 6 TexturedQuads, one for each face of a cube */ - private TexturedQuad[] quadList; -+ -+ /** X vertex coordinate of lower box corner */ - public final float posX1; -+ -+ /** Y vertex coordinate of lower box corner */ - public final float posY1; -+ -+ /** Z vertex coordinate of lower box corner */ - public final float posZ1; -+ -+ /** X vertex coordinate of upper box corner */ - public final float posX2; -+ -+ /** Y vertex coordinate of upper box corner */ - public final float posY2; -+ -+ /** Z vertex coordinate of upper box corner */ - public final float posZ2; -- public String g; -+ public String field_78247_g; - -- public ModelBox(ModelRenderer var1, int var2, int var3, float var4, float var5, float var6, int var7, int var8, int var9, float var10) { -- this.posX1 = var4; -- this.posY1 = var5; -- this.posZ1 = var6; -- this.posX2 = var4 + (float)var7; -- this.posY2 = var5 + (float)var8; -- this.posZ2 = var6 + (float)var9; -+ public ModelBox(ModelRenderer par1ModelRenderer, int par2, int par3, float par4, float par5, float par6, int par7, int par8, int par9, float par10) { -+ this.posX1 = par4; -+ this.posY1 = par5; -+ this.posZ1 = par6; -+ this.posX2 = par4 + (float)par7; -+ this.posY2 = par5 + (float)par8; -+ this.posZ2 = par6 + (float)par9; - this.vertexPositions = new PositionTextureVertex[8]; - this.quadList = new TexturedQuad[6]; -- float var11 = var4 + (float)var7; -- float var12 = var5 + (float)var8; -- float var13 = var6 + (float)var9; -- var4 -= var10; -- var5 -= var10; -- var6 -= var10; -- var11 += var10; -- var12 += var10; -- var13 += var10; -- if(var1.mirror) { -+ float var11 = par4 + (float)par7; -+ float var12 = par5 + (float)par8; -+ float var13 = par6 + (float)par9; -+ par4 -= par10; -+ par5 -= par10; -+ par6 -= par10; -+ var11 += par10; -+ var12 += par10; -+ var13 += par10; -+ -+ if (par1ModelRenderer.mirror) { - float var14 = var11; -- var11 = var4; -- var4 = var14; -+ var11 = par4; -+ par4 = var14; - } - -- PositionTextureVertex var23 = new PositionTextureVertex(var4, var5, var6, 0.0F, 0.0F); -- PositionTextureVertex var15 = new PositionTextureVertex(var11, var5, var6, 0.0F, 8.0F); -- PositionTextureVertex var16 = new PositionTextureVertex(var11, var12, var6, 8.0F, 8.0F); -- PositionTextureVertex var17 = new PositionTextureVertex(var4, var12, var6, 8.0F, 0.0F); -- PositionTextureVertex var18 = new PositionTextureVertex(var4, var5, var13, 0.0F, 0.0F); -- PositionTextureVertex var19 = new PositionTextureVertex(var11, var5, var13, 0.0F, 8.0F); -+ PositionTextureVertex var23 = new PositionTextureVertex(par4, par5, par6, 0.0F, 0.0F); -+ PositionTextureVertex var15 = new PositionTextureVertex(var11, par5, par6, 0.0F, 8.0F); -+ PositionTextureVertex var16 = new PositionTextureVertex(var11, var12, par6, 8.0F, 8.0F); -+ PositionTextureVertex var17 = new PositionTextureVertex(par4, var12, par6, 8.0F, 0.0F); -+ PositionTextureVertex var18 = new PositionTextureVertex(par4, par5, var13, 0.0F, 0.0F); -+ PositionTextureVertex var19 = new PositionTextureVertex(var11, par5, var13, 0.0F, 8.0F); - PositionTextureVertex var20 = new PositionTextureVertex(var11, var12, var13, 8.0F, 8.0F); -- PositionTextureVertex var21 = new PositionTextureVertex(var4, var12, var13, 8.0F, 0.0F); -+ PositionTextureVertex var21 = new PositionTextureVertex(par4, var12, var13, 8.0F, 0.0F); - this.vertexPositions[0] = var23; - this.vertexPositions[1] = var15; - this.vertexPositions[2] = var16; -@@ -51,29 +70,31 @@ - this.vertexPositions[5] = var19; - this.vertexPositions[6] = var20; - this.vertexPositions[7] = var21; -- this.quadList[0] = new TexturedQuad(new PositionTextureVertex[]{var19, var15, var16, var20}, var2 + var9 + var7, var3 + var9, var2 + var9 + var7 + var9, var3 + var9 + var8, var1.textureWidth, var1.textureHeight); -- this.quadList[1] = new TexturedQuad(new PositionTextureVertex[]{var23, var18, var21, var17}, var2, var3 + var9, var2 + var9, var3 + var9 + var8, var1.textureWidth, var1.textureHeight); -- this.quadList[2] = new TexturedQuad(new PositionTextureVertex[]{var19, var18, var23, var15}, var2 + var9, var3, var2 + var9 + var7, var3 + var9, var1.textureWidth, var1.textureHeight); -- this.quadList[3] = new TexturedQuad(new PositionTextureVertex[]{var16, var17, var21, var20}, var2 + var9 + var7, var3 + var9, var2 + var9 + var7 + var7, var3, var1.textureWidth, var1.textureHeight); -- this.quadList[4] = new TexturedQuad(new PositionTextureVertex[]{var15, var23, var17, var16}, var2 + var9, var3 + var9, var2 + var9 + var7, var3 + var9 + var8, var1.textureWidth, var1.textureHeight); -- this.quadList[5] = new TexturedQuad(new PositionTextureVertex[]{var18, var19, var20, var21}, var2 + var9 + var7 + var9, var3 + var9, var2 + var9 + var7 + var9 + var7, var3 + var9 + var8, var1.textureWidth, var1.textureHeight); -- if(var1.mirror) { -- for(int var22 = 0; var22 < this.quadList.length; ++var22) { -+ this.quadList[0] = new TexturedQuad(new PositionTextureVertex[] {var19, var15, var16, var20}, par2 + par9 + par7, par3 + par9, par2 + par9 + par7 + par9, par3 + par9 + par8, par1ModelRenderer.textureWidth, par1ModelRenderer.textureHeight); -+ this.quadList[1] = new TexturedQuad(new PositionTextureVertex[] {var23, var18, var21, var17}, par2, par3 + par9, par2 + par9, par3 + par9 + par8, par1ModelRenderer.textureWidth, par1ModelRenderer.textureHeight); -+ this.quadList[2] = new TexturedQuad(new PositionTextureVertex[] {var19, var18, var23, var15}, par2 + par9, par3, par2 + par9 + par7, par3 + par9, par1ModelRenderer.textureWidth, par1ModelRenderer.textureHeight); -+ this.quadList[3] = new TexturedQuad(new PositionTextureVertex[] {var16, var17, var21, var20}, par2 + par9 + par7, par3 + par9, par2 + par9 + par7 + par7, par3, par1ModelRenderer.textureWidth, par1ModelRenderer.textureHeight); -+ this.quadList[4] = new TexturedQuad(new PositionTextureVertex[] {var15, var23, var17, var16}, par2 + par9, par3 + par9, par2 + par9 + par7, par3 + par9 + par8, par1ModelRenderer.textureWidth, par1ModelRenderer.textureHeight); -+ this.quadList[5] = new TexturedQuad(new PositionTextureVertex[] {var18, var19, var20, var21}, par2 + par9 + par7 + par9, par3 + par9, par2 + par9 + par7 + par9 + par7, par3 + par9 + par8, par1ModelRenderer.textureWidth, par1ModelRenderer.textureHeight); -+ -+ if (par1ModelRenderer.mirror) { -+ for (int var22 = 0; var22 < this.quadList.length; ++var22) { - this.quadList[var22].flipFace(); - } - } -- - } - -- public void render(Tessellator var1, float var2) { -- for(int var3 = 0; var3 < this.quadList.length; ++var3) { -- this.quadList[var3].draw(var1, var2); -+ /** -+ * Draw the six sided box defined by this ModelBox -+ */ -+ public void render(Tessellator par1Tessellator, float par2) { -+ for (int var3 = 0; var3 < this.quadList.length; ++var3) { -+ this.quadList[var3].draw(par1Tessellator, par2); - } -- - } - -- public ModelBox func_78244_a(String var1) { -- this.g = var1; -+ public ModelBox func_78244_a(String par1Str) { -+ this.field_78247_g = par1Str; - return this; - } - } ---- net/minecraft/src/Packet23VehicleSpawn.java -+++ net/minecraft/src/Packet23VehicleSpawn.java -@@ -5,60 +5,89 @@ - import java.io.IOException; - - public class Packet23VehicleSpawn extends Packet { -+ -+ /** Entity ID of the object. */ - public int entityId; -+ -+ /** The X position of the object. */ - public int xPosition; -+ -+ /** The Y position of the object. */ - public int yPosition; -+ -+ /** The Z position of the object. */ - public int zPosition; -+ -+ /** -+ * Not sent if the thrower entity ID is 0. The speed of this fireball along the X axis. -+ */ - public int speedX; -+ -+ /** -+ * Not sent if the thrower entity ID is 0. The speed of this fireball along the Y axis. -+ */ - public int speedY; -+ -+ /** -+ * Not sent if the thrower entity ID is 0. The speed of this fireball along the Z axis. -+ */ - public int speedZ; -+ -+ /** The pitch in steps of 2p/256 */ - public int pitch; -+ -+ /** The yaw in steps of 2p/256 */ - public int yaw; -+ -+ /** The type of object. */ - public int type; -+ -+ /** 0 if not a fireball. Otherwise, this is the Entity ID of the thrower. */ - public int throwerEntityId; - -- public Packet23VehicleSpawn() { -- } -- -- public Packet23VehicleSpawn(Entity var1, int var2) { -- this(var1, var2, 0); -- } -- -- public Packet23VehicleSpawn(Entity var1, int var2, int var3) { -- this.entityId = var1.entityId; -- this.xPosition = MathHelper.floor_double(var1.posX * 32.0D); -- this.yPosition = MathHelper.floor_double(var1.posY * 32.0D); -- this.zPosition = MathHelper.floor_double(var1.posZ * 32.0D); -- this.pitch = MathHelper.floor_float(var1.rotationPitch * 256.0F / 360.0F); -- this.yaw = MathHelper.floor_float(var1.rotationYaw * 256.0F / 360.0F); -- this.type = var2; -- this.throwerEntityId = var3; -- if(var3 > 0) { -- double var4 = var1.motionX; -- double var6 = var1.motionY; -- double var8 = var1.motionZ; -+ public Packet23VehicleSpawn() {} -+ -+ public Packet23VehicleSpawn(Entity par1Entity, int par2) { -+ this(par1Entity, par2, 0); -+ } -+ -+ public Packet23VehicleSpawn(Entity par1Entity, int par2, int par3) { -+ this.entityId = par1Entity.entityId; -+ this.xPosition = MathHelper.floor_double(par1Entity.posX * 32.0D); -+ this.yPosition = MathHelper.floor_double(par1Entity.posY * 32.0D); -+ this.zPosition = MathHelper.floor_double(par1Entity.posZ * 32.0D); -+ this.pitch = MathHelper.floor_float(par1Entity.rotationPitch * 256.0F / 360.0F); -+ this.yaw = MathHelper.floor_float(par1Entity.rotationYaw * 256.0F / 360.0F); -+ this.type = par2; -+ this.throwerEntityId = par3; -+ -+ if (par3 > 0) { -+ double var4 = par1Entity.motionX; -+ double var6 = par1Entity.motionY; -+ double var8 = par1Entity.motionZ; - double var10 = 3.9D; -- if(var4 < -var10) { -+ -+ if (var4 < -var10) { - var4 = -var10; - } - -- if(var6 < -var10) { -+ if (var6 < -var10) { - var6 = -var10; - } - -- if(var8 < -var10) { -+ if (var8 < -var10) { - var8 = -var10; - } - -- if(var4 > var10) { -+ if (var4 > var10) { - var4 = var10; - } - -- if(var6 > var10) { -+ if (var6 > var10) { - var6 = var10; - } - -- if(var8 > var10) { -+ if (var8 > var10) { - var8 = var10; - } - -@@ -66,47 +95,58 @@ - this.speedY = (int)(var6 * 8000.0D); - this.speedZ = (int)(var8 * 8000.0D); - } -- -- } -- -- public void readPacketData(DataInput var1) throws IOException { -- this.entityId = var1.readInt(); -- this.type = var1.readByte(); -- this.xPosition = var1.readInt(); -- this.yPosition = var1.readInt(); -- this.zPosition = var1.readInt(); -- this.pitch = var1.readByte(); -- this.yaw = var1.readByte(); -- this.throwerEntityId = var1.readInt(); -- if(this.throwerEntityId > 0) { -- this.speedX = var1.readShort(); -- this.speedY = var1.readShort(); -- this.speedZ = var1.readShort(); -- } -- -- } -- -- public void writePacketData(DataOutput var1) throws IOException { -- var1.writeInt(this.entityId); -- var1.writeByte(this.type); -- var1.writeInt(this.xPosition); -- var1.writeInt(this.yPosition); -- var1.writeInt(this.zPosition); -- var1.writeByte(this.pitch); -- var1.writeByte(this.yaw); -- var1.writeInt(this.throwerEntityId); -- if(this.throwerEntityId > 0) { -- var1.writeShort(this.speedX); -- var1.writeShort(this.speedY); -- var1.writeShort(this.speedZ); -- } -- -- } -- -- public void processPacket(NetHandler var1) { -- var1.handleVehicleSpawn(this); -- } -- -+ } -+ -+ /** -+ * Abstract. Reads the raw packet data from the data stream. -+ */ -+ public void readPacketData(DataInput par1DataInput) throws IOException { -+ this.entityId = par1DataInput.readInt(); -+ this.type = par1DataInput.readByte(); -+ this.xPosition = par1DataInput.readInt(); -+ this.yPosition = par1DataInput.readInt(); -+ this.zPosition = par1DataInput.readInt(); -+ this.pitch = par1DataInput.readByte(); -+ this.yaw = par1DataInput.readByte(); -+ this.throwerEntityId = par1DataInput.readInt(); -+ -+ if (this.throwerEntityId > 0) { -+ this.speedX = par1DataInput.readShort(); -+ this.speedY = par1DataInput.readShort(); -+ this.speedZ = par1DataInput.readShort(); -+ } -+ } -+ -+ /** -+ * Abstract. Writes the raw packet data to the data stream. -+ */ -+ public void writePacketData(DataOutput par1DataOutput) throws IOException { -+ par1DataOutput.writeInt(this.entityId); -+ par1DataOutput.writeByte(this.type); -+ par1DataOutput.writeInt(this.xPosition); -+ par1DataOutput.writeInt(this.yPosition); -+ par1DataOutput.writeInt(this.zPosition); -+ par1DataOutput.writeByte(this.pitch); -+ par1DataOutput.writeByte(this.yaw); -+ par1DataOutput.writeInt(this.throwerEntityId); -+ -+ if (this.throwerEntityId > 0) { -+ par1DataOutput.writeShort(this.speedX); -+ par1DataOutput.writeShort(this.speedY); -+ par1DataOutput.writeShort(this.speedZ); -+ } -+ } -+ -+ /** -+ * Passes this Packet on to the NetHandler for processing. -+ */ -+ public void processPacket(NetHandler par1NetHandler) { -+ par1NetHandler.handleVehicleSpawn(this); -+ } -+ -+ /** -+ * Abstract. Return the size of the packet (not counting the header). -+ */ - public int getPacketSize() { - return 21 + this.throwerEntityId > 0 ? 6 : 0; - } ---- net/minecraft/src/ItemLeaves.java -+++ net/minecraft/src/ItemLeaves.java -@@ -1,31 +1,42 @@ - package net.minecraft.src; - - public class ItemLeaves extends ItemBlock { -- public ItemLeaves(int var1) { -- super(var1); -+ public ItemLeaves(int par1) { -+ super(par1); - this.setMaxDamage(0); - this.setHasSubtypes(true); - } - -- public int getMetadata(int var1) { -- return var1 | 4; -- } -- -- public Icon getIconFromDamage(int var1) { -- return Block.leaves.getIcon(0, var1); -- } -- -- public int getColorFromItemStack(ItemStack var1, int var2) { -- int var3 = var1.getItemDamage(); -+ /** -+ * Returns the metadata of the block which this Item (ItemBlock) can place -+ */ -+ public int getMetadata(int par1) { -+ return par1 | 4; -+ } -+ -+ /** -+ * Gets an icon index based on an item's damage value -+ */ -+ public Icon getIconFromDamage(int par1) { -+ return Block.leaves.getIcon(0, par1); -+ } -+ -+ public int getColorFromItemStack(ItemStack par1ItemStack, int par2) { -+ int var3 = par1ItemStack.getItemDamage(); - return (var3 & 1) == 1 ? ColorizerFoliage.getFoliageColorPine() : ((var3 & 2) == 2 ? ColorizerFoliage.getFoliageColorBirch() : ColorizerFoliage.getFoliageColorBasic()); - } - -- public String getUnlocalizedName(ItemStack var1) { -- int var2 = var1.getItemDamage(); -- if(var2 < 0 || var2 >= BlockLeaves.a.length) { -+ /** -+ * Returns the unlocalized name of this item. This version accepts an ItemStack so different stacks can have different -+ * names based on their damage or NBT. -+ */ -+ public String getUnlocalizedName(ItemStack par1ItemStack) { -+ int var2 = par1ItemStack.getItemDamage(); -+ -+ if (var2 < 0 || var2 >= BlockLeaves.LEAF_TYPES.length) { - var2 = 0; - } - -- return super.getUnlocalizedName() + "." + BlockLeaves.a[var2]; -+ return super.getUnlocalizedName() + "." + BlockLeaves.LEAF_TYPES[var2]; - } - } ---- net/minecraft/src/BlockPistonExtension.java -+++ net/minecraft/src/BlockPistonExtension.java -@@ -4,173 +4,234 @@ - import java.util.Random; - - public class BlockPistonExtension extends Block { -+ -+ /** The texture for the 'head' of the piston. Sticky or normal. */ - private Icon headTexture; - -- public BlockPistonExtension(int var1) { -- super(var1, Material.piston); -+ public BlockPistonExtension(int par1) { -+ super(par1, Material.piston); - this.setStepSound(soundStoneFootstep); - this.setHardness(0.5F); - } - -- public void setHeadTexture(Icon var1) { -- this.headTexture = var1; -+ public void setHeadTexture(Icon par1Icon) { -+ this.headTexture = par1Icon; - } - - public void clearHeadTexture() { - this.headTexture = null; - } - -- public void onBlockHarvested(World var1, int var2, int var3, int var4, int var5, EntityPlayer var6) { -- if(var6.capabilities.isCreativeMode) { -- int var7 = getDirectionMeta(var5); -- int var8 = var1.getBlockId(var2 - Facing.offsetsXForSide[var7], var3 - Facing.offsetsYForSide[var7], var4 - Facing.offsetsZForSide[var7]); -- if(var8 == Block.pistonBase.blockID || var8 == Block.pistonStickyBase.blockID) { -- var1.setBlockToAir(var2 - Facing.offsetsXForSide[var7], var3 - Facing.offsetsYForSide[var7], var4 - Facing.offsetsZForSide[var7]); -- } -- } -- -- super.onBlockHarvested(var1, var2, var3, var4, var5, var6); -- } -- -- public void breakBlock(World var1, int var2, int var3, int var4, int var5, int var6) { -- super.breakBlock(var1, var2, var3, var4, var5, var6); -- int var7 = Facing.oppositeSide[getDirectionMeta(var6)]; -- var2 += Facing.offsetsXForSide[var7]; -- var3 += Facing.offsetsYForSide[var7]; -- var4 += Facing.offsetsZForSide[var7]; -- int var8 = var1.getBlockId(var2, var3, var4); -- if(var8 == Block.pistonBase.blockID || var8 == Block.pistonStickyBase.blockID) { -- var6 = var1.getBlockMetadata(var2, var3, var4); -- if(BlockPistonBase.isExtended(var6)) { -- Block.blocksList[var8].dropBlockAsItem(var1, var2, var3, var4, var6, 0); -- var1.setBlockToAir(var2, var3, var4); -- } -- } -- -- } -- -- public Icon getIcon(int var1, int var2) { -- int var3 = getDirectionMeta(var2); -- return var1 == var3 ? (this.headTexture != null ? this.headTexture : ((var2 & 8) != 0 ? BlockPistonBase.getPistonBaseIcon("piston_top_sticky") : BlockPistonBase.getPistonBaseIcon("piston_top_normal"))) : (var3 < 6 && var1 == Facing.oppositeSide[var3] ? BlockPistonBase.getPistonBaseIcon("piston_top_normal") : BlockPistonBase.getPistonBaseIcon("piston_side")); -- } -- -- public void registerIcons(IconRegister var1) { -- } -- -+ /** -+ * Called when the block is attempted to be harvested -+ */ -+ public void onBlockHarvested(World par1World, int par2, int par3, int par4, int par5, EntityPlayer par6EntityPlayer) { -+ if (par6EntityPlayer.capabilities.isCreativeMode) { -+ int var7 = getDirectionMeta(par5); -+ int var8 = par1World.getBlockId(par2 - Facing.offsetsXForSide[var7], par3 - Facing.offsetsYForSide[var7], par4 - Facing.offsetsZForSide[var7]); -+ -+ if (var8 == Block.pistonBase.blockID || var8 == Block.pistonStickyBase.blockID) { -+ par1World.setBlockToAir(par2 - Facing.offsetsXForSide[var7], par3 - Facing.offsetsYForSide[var7], par4 - Facing.offsetsZForSide[var7]); -+ } -+ } -+ -+ super.onBlockHarvested(par1World, par2, par3, par4, par5, par6EntityPlayer); -+ } -+ -+ /** -+ * Called on server worlds only when the block has been replaced by a different block ID, or the same block with a -+ * different metadata value, but before the new metadata value is set. Args: World, x, y, z, old block ID, old metadata -+ */ -+ public void breakBlock(World par1World, int par2, int par3, int par4, int par5, int par6) { -+ super.breakBlock(par1World, par2, par3, par4, par5, par6); -+ int var7 = Facing.oppositeSide[getDirectionMeta(par6)]; -+ par2 += Facing.offsetsXForSide[var7]; -+ par3 += Facing.offsetsYForSide[var7]; -+ par4 += Facing.offsetsZForSide[var7]; -+ int var8 = par1World.getBlockId(par2, par3, par4); -+ -+ if (var8 == Block.pistonBase.blockID || var8 == Block.pistonStickyBase.blockID) { -+ par6 = par1World.getBlockMetadata(par2, par3, par4); -+ -+ if (BlockPistonBase.isExtended(par6)) { -+ Block.blocksList[var8].dropBlockAsItem(par1World, par2, par3, par4, par6, 0); -+ par1World.setBlockToAir(par2, par3, par4); -+ } -+ } -+ } -+ -+ /** -+ * From the specified side and block metadata retrieves the blocks texture. Args: side, metadata -+ */ -+ public Icon getIcon(int par1, int par2) { -+ int var3 = getDirectionMeta(par2); -+ return par1 == var3 ? (this.headTexture != null ? this.headTexture : ((par2 & 8) != 0 ? BlockPistonBase.getPistonBaseIcon("piston_top_sticky") : BlockPistonBase.getPistonBaseIcon("piston_top_normal"))) : (var3 < 6 && par1 == Facing.oppositeSide[var3] ? BlockPistonBase.getPistonBaseIcon("piston_top_normal") : BlockPistonBase.getPistonBaseIcon("piston_side")); -+ } -+ -+ /** -+ * When this method is called, your block should register all the icons it needs with the given IconRegister. This is -+ * the only chance you get to register icons. -+ */ -+ public void registerIcons(IconRegister par1IconRegister) {} -+ -+ /** -+ * The type of render function that is called for this block -+ */ - public int getRenderType() { - return 17; - } - -+ /** -+ * Is this block (a) opaque and (b) a full 1m cube? This determines whether or not to render the shared face of two -+ * adjacent blocks and also whether the player can attach torches, redstone wire, etc to this block. -+ */ - public boolean isOpaqueCube() { - return false; - } - -+ /** -+ * If this block doesn't render as an ordinary block it will return False (examples: signs, buttons, stairs, etc) -+ */ - public boolean renderAsNormalBlock() { - return false; - } - -- public boolean canPlaceBlockAt(World var1, int var2, int var3, int var4) { -- return false; -- } -- -- public boolean canPlaceBlockOnSide(World var1, int var2, int var3, int var4, int var5) { -- return false; -- } -- -- public int quantityDropped(Random var1) { -+ /** -+ * Checks to see if its valid to put this block at the specified coordinates. Args: world, x, y, z -+ */ -+ public boolean canPlaceBlockAt(World par1World, int par2, int par3, int par4) { -+ return false; -+ } -+ -+ /** -+ * checks to see if you can place this block can be placed on that side of a block: BlockLever overrides -+ */ -+ public boolean canPlaceBlockOnSide(World par1World, int par2, int par3, int par4, int par5) { -+ return false; -+ } -+ -+ /** -+ * Returns the quantity of items to drop on block destruction. -+ */ -+ public int quantityDropped(Random par1Random) { - return 0; - } - -- public void addCollisionBoxesToList(World var1, int var2, int var3, int var4, AxisAlignedBB var5, List var6, Entity var7) { -- int var8 = var1.getBlockMetadata(var2, var3, var4); -+ /** -+ * Adds all intersecting collision boxes to a list. (Be sure to only add boxes to the list if they intersect the mask.) -+ * Parameters: World, X, Y, Z, mask, list, colliding entity -+ */ -+ public void addCollisionBoxesToList(World par1World, int par2, int par3, int par4, AxisAlignedBB par5AxisAlignedBB, List par6List, Entity par7Entity) { -+ int var8 = par1World.getBlockMetadata(par2, par3, par4); - float var9 = 0.25F; -- float var10 = 6.0F / 16.0F; -- float var11 = 10.0F / 16.0F; -+ float var10 = 0.375F; -+ float var11 = 0.625F; - float var12 = 0.25F; -- float var13 = 12.0F / 16.0F; -- switch(getDirectionMeta(var8)) { -- case 0: -- this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.25F, 1.0F); -- super.addCollisionBoxesToList(var1, var2, var3, var4, var5, var6, var7); -- this.setBlockBounds(6.0F / 16.0F, 0.25F, 6.0F / 16.0F, 10.0F / 16.0F, 1.0F, 10.0F / 16.0F); -- super.addCollisionBoxesToList(var1, var2, var3, var4, var5, var6, var7); -- break; -- case 1: -- this.setBlockBounds(0.0F, 12.0F / 16.0F, 0.0F, 1.0F, 1.0F, 1.0F); -- super.addCollisionBoxesToList(var1, var2, var3, var4, var5, var6, var7); -- this.setBlockBounds(6.0F / 16.0F, 0.0F, 6.0F / 16.0F, 10.0F / 16.0F, 12.0F / 16.0F, 10.0F / 16.0F); -- super.addCollisionBoxesToList(var1, var2, var3, var4, var5, var6, var7); -- break; -- case 2: -- this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 0.25F); -- super.addCollisionBoxesToList(var1, var2, var3, var4, var5, var6, var7); -- this.setBlockBounds(0.25F, 6.0F / 16.0F, 0.25F, 12.0F / 16.0F, 10.0F / 16.0F, 1.0F); -- super.addCollisionBoxesToList(var1, var2, var3, var4, var5, var6, var7); -- break; -- case 3: -- this.setBlockBounds(0.0F, 0.0F, 12.0F / 16.0F, 1.0F, 1.0F, 1.0F); -- super.addCollisionBoxesToList(var1, var2, var3, var4, var5, var6, var7); -- this.setBlockBounds(0.25F, 6.0F / 16.0F, 0.0F, 12.0F / 16.0F, 10.0F / 16.0F, 12.0F / 16.0F); -- super.addCollisionBoxesToList(var1, var2, var3, var4, var5, var6, var7); -- break; -- case 4: -- this.setBlockBounds(0.0F, 0.0F, 0.0F, 0.25F, 1.0F, 1.0F); -- super.addCollisionBoxesToList(var1, var2, var3, var4, var5, var6, var7); -- this.setBlockBounds(6.0F / 16.0F, 0.25F, 0.25F, 10.0F / 16.0F, 12.0F / 16.0F, 1.0F); -- super.addCollisionBoxesToList(var1, var2, var3, var4, var5, var6, var7); -- break; -- case 5: -- this.setBlockBounds(12.0F / 16.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F); -- super.addCollisionBoxesToList(var1, var2, var3, var4, var5, var6, var7); -- this.setBlockBounds(0.0F, 6.0F / 16.0F, 0.25F, 12.0F / 16.0F, 10.0F / 16.0F, 12.0F / 16.0F); -- super.addCollisionBoxesToList(var1, var2, var3, var4, var5, var6, var7); -+ float var13 = 0.75F; -+ -+ switch (getDirectionMeta(var8)) { -+ case 0: -+ this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.25F, 1.0F); -+ super.addCollisionBoxesToList(par1World, par2, par3, par4, par5AxisAlignedBB, par6List, par7Entity); -+ this.setBlockBounds(0.375F, 0.25F, 0.375F, 0.625F, 1.0F, 0.625F); -+ super.addCollisionBoxesToList(par1World, par2, par3, par4, par5AxisAlignedBB, par6List, par7Entity); -+ break; -+ -+ case 1: -+ this.setBlockBounds(0.0F, 0.75F, 0.0F, 1.0F, 1.0F, 1.0F); -+ super.addCollisionBoxesToList(par1World, par2, par3, par4, par5AxisAlignedBB, par6List, par7Entity); -+ this.setBlockBounds(0.375F, 0.0F, 0.375F, 0.625F, 0.75F, 0.625F); -+ super.addCollisionBoxesToList(par1World, par2, par3, par4, par5AxisAlignedBB, par6List, par7Entity); -+ break; -+ -+ case 2: -+ this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 0.25F); -+ super.addCollisionBoxesToList(par1World, par2, par3, par4, par5AxisAlignedBB, par6List, par7Entity); -+ this.setBlockBounds(0.25F, 0.375F, 0.25F, 0.75F, 0.625F, 1.0F); -+ super.addCollisionBoxesToList(par1World, par2, par3, par4, par5AxisAlignedBB, par6List, par7Entity); -+ break; -+ -+ case 3: -+ this.setBlockBounds(0.0F, 0.0F, 0.75F, 1.0F, 1.0F, 1.0F); -+ super.addCollisionBoxesToList(par1World, par2, par3, par4, par5AxisAlignedBB, par6List, par7Entity); -+ this.setBlockBounds(0.25F, 0.375F, 0.0F, 0.75F, 0.625F, 0.75F); -+ super.addCollisionBoxesToList(par1World, par2, par3, par4, par5AxisAlignedBB, par6List, par7Entity); -+ break; -+ -+ case 4: -+ this.setBlockBounds(0.0F, 0.0F, 0.0F, 0.25F, 1.0F, 1.0F); -+ super.addCollisionBoxesToList(par1World, par2, par3, par4, par5AxisAlignedBB, par6List, par7Entity); -+ this.setBlockBounds(0.375F, 0.25F, 0.25F, 0.625F, 0.75F, 1.0F); -+ super.addCollisionBoxesToList(par1World, par2, par3, par4, par5AxisAlignedBB, par6List, par7Entity); -+ break; -+ -+ case 5: -+ this.setBlockBounds(0.75F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F); -+ super.addCollisionBoxesToList(par1World, par2, par3, par4, par5AxisAlignedBB, par6List, par7Entity); -+ this.setBlockBounds(0.0F, 0.375F, 0.25F, 0.75F, 0.625F, 0.75F); -+ super.addCollisionBoxesToList(par1World, par2, par3, par4, par5AxisAlignedBB, par6List, par7Entity); - } - - this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F); - } - -- public void setBlockBoundsBasedOnState(IBlockAccess var1, int var2, int var3, int var4) { -- int var5 = var1.getBlockMetadata(var2, var3, var4); -+ /** -+ * Updates the blocks bounds based on its current state. Args: world, x, y, z -+ */ -+ public void setBlockBoundsBasedOnState(IBlockAccess par1IBlockAccess, int par2, int par3, int par4) { -+ int var5 = par1IBlockAccess.getBlockMetadata(par2, par3, par4); - float var6 = 0.25F; -- switch(getDirectionMeta(var5)) { -- case 0: -- this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.25F, 1.0F); -- break; -- case 1: -- this.setBlockBounds(0.0F, 12.0F / 16.0F, 0.0F, 1.0F, 1.0F, 1.0F); -- break; -- case 2: -- this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 0.25F); -- break; -- case 3: -- this.setBlockBounds(0.0F, 0.0F, 12.0F / 16.0F, 1.0F, 1.0F, 1.0F); -- break; -- case 4: -- this.setBlockBounds(0.0F, 0.0F, 0.0F, 0.25F, 1.0F, 1.0F); -- break; -- case 5: -- this.setBlockBounds(12.0F / 16.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F); -+ -+ switch (getDirectionMeta(var5)) { -+ case 0: -+ this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.25F, 1.0F); -+ break; -+ -+ case 1: -+ this.setBlockBounds(0.0F, 0.75F, 0.0F, 1.0F, 1.0F, 1.0F); -+ break; -+ -+ case 2: -+ this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 0.25F); -+ break; -+ -+ case 3: -+ this.setBlockBounds(0.0F, 0.0F, 0.75F, 1.0F, 1.0F, 1.0F); -+ break; -+ -+ case 4: -+ this.setBlockBounds(0.0F, 0.0F, 0.0F, 0.25F, 1.0F, 1.0F); -+ break; -+ -+ case 5: -+ this.setBlockBounds(0.75F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F); - } -- - } - -- public void onNeighborBlockChange(World var1, int var2, int var3, int var4, int var5) { -- int var6 = getDirectionMeta(var1.getBlockMetadata(var2, var3, var4)); -- int var7 = var1.getBlockId(var2 - Facing.offsetsXForSide[var6], var3 - Facing.offsetsYForSide[var6], var4 - Facing.offsetsZForSide[var6]); -- if(var7 != Block.pistonBase.blockID && var7 != Block.pistonStickyBase.blockID) { -- var1.setBlockToAir(var2, var3, var4); -+ /** -+ * Lets the block know when one of its neighbor changes. Doesn't know which neighbor changed (coordinates passed are -+ * their own) Args: x, y, z, neighbor blockID -+ */ -+ public void onNeighborBlockChange(World par1World, int par2, int par3, int par4, int par5) { -+ int var6 = getDirectionMeta(par1World.getBlockMetadata(par2, par3, par4)); -+ int var7 = par1World.getBlockId(par2 - Facing.offsetsXForSide[var6], par3 - Facing.offsetsYForSide[var6], par4 - Facing.offsetsZForSide[var6]); -+ -+ if (var7 != Block.pistonBase.blockID && var7 != Block.pistonStickyBase.blockID) { -+ par1World.setBlockToAir(par2, par3, par4); - } else { -- Block.blocksList[var7].onNeighborBlockChange(var1, var2 - Facing.offsetsXForSide[var6], var3 - Facing.offsetsYForSide[var6], var4 - Facing.offsetsZForSide[var6], var5); -+ Block.blocksList[var7].onNeighborBlockChange(par1World, par2 - Facing.offsetsXForSide[var6], par3 - Facing.offsetsYForSide[var6], par4 - Facing.offsetsZForSide[var6], par5); - } -- -- } -- -- public static int getDirectionMeta(int var0) { -- return var0 & 7; -- } -- -- public int idPicked(World var1, int var2, int var3, int var4) { -- int var5 = var1.getBlockMetadata(var2, var3, var4); -+ } -+ -+ public static int getDirectionMeta(int par0) { -+ return par0 & 7; -+ } -+ -+ /** -+ * only called by clickMiddleMouseButton , and passed to inventory.setCurrentItem (along with isCreative) -+ */ -+ public int idPicked(World par1World, int par2, int par3, int par4) { -+ int var5 = par1World.getBlockMetadata(par2, par3, par4); - return (var5 & 8) != 0 ? Block.pistonStickyBase.blockID : Block.pistonBase.blockID; - } - } ---- /dev/null -+++ org/spoutcraft/api/material/block/Solid.java -@@ -1,0 +1,49 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.api.material.block; -+ -+import org.spoutcraft.api.material.SolidBlock; -+ -+public class Solid extends GenericBlock implements SolidBlock{ -+ private final boolean falling; -+ public Solid(String name, int id, int data, boolean falling) { -+ super(name, id, data); -+ this.falling = falling; -+ } -+ -+ public Solid(String name, int id, boolean falling) { -+ super(name, id, 0); -+ this.falling = falling; -+ } -+ -+ public Solid(String name, int id) { -+ super(name, id, 0); -+ this.falling = false; -+ } -+ -+ public Solid(String name, int id, int data) { -+ super(name, id, data); -+ this.falling = false; -+ } -+ -+ public boolean isFallingBlock() { -+ return falling; -+ } -+} ---- net/minecraft/src/EntityAIBase.java -+++ net/minecraft/src/EntityAIBase.java -@@ -1,31 +1,59 @@ - package net.minecraft.src; - - public abstract class EntityAIBase { -+ -+ /** -+ * A bitmask telling which other tasks may not run concurrently. The test is a simple bitwise AND - if it yields zero, -+ * the two tasks may run concurrently, if not - they must run exclusively from each other. -+ */ - private int mutexBits; - -+ /** -+ * Returns whether the EntityAIBase should begin execution. -+ */ - public abstract boolean shouldExecute(); - -+ /** -+ * Returns whether an in-progress EntityAIBase should continue executing -+ */ - public boolean continueExecuting() { - return this.shouldExecute(); - } - -- public boolean isContinuous() { -+ /** -+ * Determine if this AI Task is interruptible by a higher (= lower value) priority task. -+ */ -+ public boolean isInterruptible() { - return true; - } - -- public void startExecuting() { -- } -- -- public void resetTask() { -- } -- -- public void updateTask() { -- } -- -- public void setMutexBits(int var1) { -- this.mutexBits = var1; -- } -- -+ /** -+ * Execute a one shot task or start executing a continuous task -+ */ -+ public void startExecuting() {} -+ -+ /** -+ * Resets the task -+ */ -+ public void resetTask() {} -+ -+ /** -+ * Updates the task -+ */ -+ public void updateTask() {} -+ -+ /** -+ * Sets a bitmask telling which other tasks may not run concurrently. The test is a simple bitwise AND - if it yields -+ * zero, the two tasks may run concurrently, if not - they must run exclusively from each other. -+ */ -+ public void setMutexBits(int par1) { -+ this.mutexBits = par1; -+ } -+ -+ /** -+ * Get a bitmask telling which other tasks may not run concurrently. The test is a simple bitwise AND - if it yields -+ * zero, the two tasks may run concurrently, if not - they must run exclusively from each other. -+ */ - public int getMutexBits() { - return this.mutexBits; - } ---- net/minecraft/src/ItemBucketMilk.java -+++ net/minecraft/src/ItemBucketMilk.java -@@ -1,34 +1,43 @@ - package net.minecraft.src; - - public class ItemBucketMilk extends Item { -- public ItemBucketMilk(int var1) { -- super(var1); -+ public ItemBucketMilk(int par1) { -+ super(par1); - this.setMaxStackSize(1); - this.setCreativeTab(CreativeTabs.tabMisc); - } - -- public ItemStack onEaten(ItemStack var1, World var2, EntityPlayer var3) { -- if(!var3.capabilities.isCreativeMode) { -- --var1.stackSize; -- } -- -- if(!var2.isRemote) { -- var3.clearActivePotions(); -- } -- -- return var1.stackSize <= 0 ? new ItemStack(Item.bucketEmpty) : var1; -+ public ItemStack onEaten(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) { -+ if (!par3EntityPlayer.capabilities.isCreativeMode) { -+ --par1ItemStack.stackSize; -+ } -+ -+ if (!par2World.isRemote) { -+ par3EntityPlayer.clearActivePotions(); -+ } -+ -+ return par1ItemStack.stackSize <= 0 ? new ItemStack(Item.bucketEmpty) : par1ItemStack; - } - -- public int getMaxItemUseDuration(ItemStack var1) { -+ /** -+ * How long it takes to use or consume an item -+ */ -+ public int getMaxItemUseDuration(ItemStack par1ItemStack) { - return 32; - } - -- public EnumAction getItemUseAction(ItemStack var1) { -+ /** -+ * returns the action that specifies what animation to play when the items is being used -+ */ -+ public EnumAction getItemUseAction(ItemStack par1ItemStack) { - return EnumAction.drink; - } - -- public ItemStack onItemRightClick(ItemStack var1, World var2, EntityPlayer var3) { -- var3.setItemInUse(var1, this.getMaxItemUseDuration(var1)); -- return var1; -+ /** -+ * Called whenever this item is equipped and the right mouse button is pressed. Args: itemStack, world, entityPlayer -+ */ -+ public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) { -+ par3EntityPlayer.setItemInUse(par1ItemStack, this.getMaxItemUseDuration(par1ItemStack)); -+ return par1ItemStack; - } - } ---- net/minecraft/src/MapGenBase.java -+++ net/minecraft/src/MapGenBase.java -@@ -3,28 +3,35 @@ - import java.util.Random; - - public class MapGenBase { -+ -+ /** The number of Chunks to gen-check in any given direction. */ - protected int range = 8; -- protected Random b = new Random(); -+ -+ /** The RNG used by the MapGen classes. */ -+ protected Random rand = new Random(); -+ -+ /** This world object. */ - protected World worldObj; - -- public void generate(IChunkProvider var1, World var2, int var3, int var4, byte[] var5) { -+ public void generate(IChunkProvider par1IChunkProvider, World par2World, int par3, int par4, byte[] par5ArrayOfByte) { - int var6 = this.range; -- this.worldObj = var2; -- this.b.setSeed(var2.getSeed()); -- long var7 = this.b.nextLong(); -- long var9 = this.b.nextLong(); -+ this.worldObj = par2World; -+ this.rand.setSeed(par2World.getSeed()); -+ long var7 = this.rand.nextLong(); -+ long var9 = this.rand.nextLong(); - -- for(int var11 = var3 - var6; var11 <= var3 + var6; ++var11) { -- for(int var12 = var4 - var6; var12 <= var4 + var6; ++var12) { -+ for (int var11 = par3 - var6; var11 <= par3 + var6; ++var11) { -+ for (int var12 = par4 - var6; var12 <= par4 + var6; ++var12) { - long var13 = (long)var11 * var7; - long var15 = (long)var12 * var9; -- this.b.setSeed(var13 ^ var15 ^ var2.getSeed()); -- this.recursiveGenerate(var2, var11, var12, var3, var4, var5); -+ this.rand.setSeed(var13 ^ var15 ^ par2World.getSeed()); -+ this.recursiveGenerate(par2World, var11, var12, par3, par4, par5ArrayOfByte); - } - } -- -- } -- -- protected void recursiveGenerate(World var1, int var2, int var3, int var4, int var5, byte[] var6) { -- } -+ } -+ -+ /** -+ * Recursively called by generate() (generate) and optionally by itself. -+ */ -+ protected void recursiveGenerate(World par1World, int par2, int par3, int par4, int par5, byte[] par6ArrayOfByte) {} - } ---- net/minecraft/src/WorldGenGlowStone1.java -+++ net/minecraft/src/WorldGenGlowStone1.java -@@ -3,54 +3,56 @@ - import java.util.Random; - - public class WorldGenGlowStone1 extends WorldGenerator { -- public boolean generate(World var1, Random var2, int var3, int var4, int var5) { -- if(!var1.isAirBlock(var3, var4, var5)) { -+ public boolean generate(World par1World, Random par2Random, int par3, int par4, int par5) { -+ if (!par1World.isAirBlock(par3, par4, par5)) { - return false; -- } else if(var1.getBlockId(var3, var4 + 1, var5) != Block.netherrack.blockID) { -+ } else if (par1World.getBlockId(par3, par4 + 1, par5) != Block.netherrack.blockID) { - return false; - } else { -- var1.setBlock(var3, var4, var5, Block.glowStone.blockID, 0, 2); -- -- for(int var6 = 0; var6 < 1500; ++var6) { -- int var7 = var3 + var2.nextInt(8) - var2.nextInt(8); -- int var8 = var4 - var2.nextInt(12); -- int var9 = var5 + var2.nextInt(8) - var2.nextInt(8); -- if(var1.getBlockId(var7, var8, var9) == 0) { -+ par1World.setBlock(par3, par4, par5, Block.glowStone.blockID, 0, 2); -+ -+ for (int var6 = 0; var6 < 1500; ++var6) { -+ int var7 = par3 + par2Random.nextInt(8) - par2Random.nextInt(8); -+ int var8 = par4 - par2Random.nextInt(12); -+ int var9 = par5 + par2Random.nextInt(8) - par2Random.nextInt(8); -+ -+ if (par1World.getBlockId(var7, var8, var9) == 0) { - int var10 = 0; - -- for(int var11 = 0; var11 < 6; ++var11) { -+ for (int var11 = 0; var11 < 6; ++var11) { - int var12 = 0; -- if(var11 == 0) { -- var12 = var1.getBlockId(var7 - 1, var8, var9); -- } -- -- if(var11 == 1) { -- var12 = var1.getBlockId(var7 + 1, var8, var9); -- } -- -- if(var11 == 2) { -- var12 = var1.getBlockId(var7, var8 - 1, var9); -- } -- -- if(var11 == 3) { -- var12 = var1.getBlockId(var7, var8 + 1, var9); -- } -- -- if(var11 == 4) { -- var12 = var1.getBlockId(var7, var8, var9 - 1); -- } -- -- if(var11 == 5) { -- var12 = var1.getBlockId(var7, var8, var9 + 1); -- } -- -- if(var12 == Block.glowStone.blockID) { -+ -+ if (var11 == 0) { -+ var12 = par1World.getBlockId(var7 - 1, var8, var9); -+ } -+ -+ if (var11 == 1) { -+ var12 = par1World.getBlockId(var7 + 1, var8, var9); -+ } -+ -+ if (var11 == 2) { -+ var12 = par1World.getBlockId(var7, var8 - 1, var9); -+ } -+ -+ if (var11 == 3) { -+ var12 = par1World.getBlockId(var7, var8 + 1, var9); -+ } -+ -+ if (var11 == 4) { -+ var12 = par1World.getBlockId(var7, var8, var9 - 1); -+ } -+ -+ if (var11 == 5) { -+ var12 = par1World.getBlockId(var7, var8, var9 + 1); -+ } -+ -+ if (var12 == Block.glowStone.blockID) { - ++var10; - } - } - -- if(var10 == 1) { -- var1.setBlock(var7, var8, var9, Block.glowStone.blockID, 0, 2); -+ if (var10 == 1) { -+ par1World.setBlock(var7, var8, var9, Block.glowStone.blockID, 0, 2); - } - } - } ---- net/minecraft/src/DispenserBehaviorExperience.java -+++ net/minecraft/src/DispenserBehaviorExperience.java -@@ -1,8 +1,12 @@ - package net.minecraft.src; - - final class DispenserBehaviorExperience extends BehaviorProjectileDispense { -- protected IProjectile getProjectileEntity(World var1, IPosition var2) { -- return new EntityExpBottle(var1, var2.getX(), var2.getY(), var2.getZ()); -+ -+ /** -+ * Return the projectile entity spawned by this dispense behavior. -+ */ -+ protected IProjectile getProjectileEntity(World par1World, IPosition par2IPosition) { -+ return new EntityExpBottle(par1World, par2IPosition.getX(), par2IPosition.getY(), par2IPosition.getZ()); - } - - protected float func_82498_a() { ---- net/minecraft/src/GuiErrorScreen.java -+++ net/minecraft/src/GuiErrorScreen.java -@@ -1,30 +1,49 @@ - package net.minecraft.src; - - public class GuiErrorScreen extends GuiScreen { -- private String a; -- private String b; -- -- public GuiErrorScreen(String var1, String var2) { -- this.a = var1; -- this.b = var2; -+ -+ /** -+ * Unused class. Would contain a message drawn to the center of the screen. -+ */ -+ private String message1; -+ -+ /** -+ * Unused class. Would contain a message drawn to the center of the screen. -+ */ -+ private String message2; -+ -+ public GuiErrorScreen(String par1Str, String par2Str) { -+ this.message1 = par1Str; -+ this.message2 = par2Str; - } - -+ /** -+ * Adds the buttons (and other controls) to the screen in question. -+ */ - public void initGui() { - super.initGui(); -- this.i.add(new GuiButton(0, this.width / 2 - 100, 140, I18n.getString("gui.cancel"))); -+ this.buttonList.add(new GuiButton(0, this.width / 2 - 100, 140, I18n.getString("gui.cancel"))); - } - -- public void drawScreen(int var1, int var2, float var3) { -+ /** -+ * Draws the screen and all the components in it. -+ */ -+ public void drawScreen(int par1, int par2, float par3) { - this.drawGradientRect(0, 0, this.width, this.height, -12574688, -11530224); -- this.drawCenteredString(this.fontRenderer, this.a, this.width / 2, 90, 16777215); -- this.drawCenteredString(this.fontRenderer, this.b, this.width / 2, 110, 16777215); -- super.drawScreen(var1, var2, var3); -- } -- -- protected void keyTyped(char var1, int var2) { -- } -- -- protected void actionPerformed(GuiButton var1) { -+ this.drawCenteredString(this.fontRenderer, this.message1, this.width / 2, 90, 16777215); -+ this.drawCenteredString(this.fontRenderer, this.message2, this.width / 2, 110, 16777215); -+ super.drawScreen(par1, par2, par3); -+ } -+ -+ /** -+ * Fired when a key is typed. This is the equivalent of KeyListener.keyTyped(KeyEvent e). -+ */ -+ protected void keyTyped(char par1, int par2) {} -+ -+ /** -+ * Fired when a control is clicked. This is the equivalent of ActionListener.actionPerformed(ActionEvent e). -+ */ -+ protected void actionPerformed(GuiButton par1GuiButton) { - this.mc.displayGuiScreen((GuiScreen)null); - } - } ---- net/minecraft/src/BlockTallGrass.java -+++ net/minecraft/src/BlockTallGrass.java -@@ -4,21 +4,24 @@ - import java.util.Random; - - public class BlockTallGrass extends BlockFlower { -- private static final String[] a = new String[]{"deadbush", "tallgrass", "fern"}; -+ private static final String[] grassTypes = new String[] {"deadbush", "tallgrass", "fern"}; - private Icon[] iconArray; - -- protected BlockTallGrass(int var1) { -- super(var1, Material.vine); -+ protected BlockTallGrass(int par1) { -+ super(par1, Material.vine); - float var2 = 0.4F; - this.setBlockBounds(0.5F - var2, 0.0F, 0.5F - var2, 0.5F + var2, 0.8F, 0.5F + var2); - } - -- public Icon getIcon(int var1, int var2) { -- if(var2 >= this.iconArray.length) { -- var2 = 0; -+ /** -+ * From the specified side and block metadata retrieves the blocks texture. Args: side, metadata -+ */ -+ public Icon getIcon(int par1, int par2) { -+ if (par2 >= this.iconArray.length) { -+ par2 = 0; - } - -- return this.iconArray[var2]; -+ return this.iconArray[par2]; - } - - public int getBlockColor() { -@@ -27,50 +30,74 @@ - return ColorizerGrass.getGrassColor(var1, var3); - } - -- public int getRenderColor(int var1) { -- return var1 == 0 ? 16777215 : ColorizerFoliage.getFoliageColorBasic(); -- } -- -- public int colorMultiplier(IBlockAccess var1, int var2, int var3, int var4) { -- int var5 = var1.getBlockMetadata(var2, var3, var4); -- return var5 == 0 ? 16777215 : var1.getBiomeGenForCoords(var2, var4).getBiomeGrassColor(); -- } -- -- public int idDropped(int var1, Random var2, int var3) { -- return var2.nextInt(8) == 0 ? Item.seeds.itemID : -1; -- } -- -- public int quantityDroppedWithBonus(int var1, Random var2) { -- return 1 + var2.nextInt(var1 * 2 + 1); -- } -- -- public void harvestBlock(World var1, EntityPlayer var2, int var3, int var4, int var5, int var6) { -- if(!var1.isRemote && var2.getCurrentEquippedItem() != null && var2.getCurrentEquippedItem().itemID == Item.shears.itemID) { -- var2.addStat(StatList.mineBlockStatArray[this.blockID], 1); -- this.dropBlockAsItem_do(var1, var3, var4, var5, new ItemStack(Block.tallGrass, 1, var6)); -+ /** -+ * Returns the color this block should be rendered. Used by leaves. -+ */ -+ public int getRenderColor(int par1) { -+ return par1 == 0 ? 16777215 : ColorizerFoliage.getFoliageColorBasic(); -+ } -+ -+ /** -+ * Returns a integer with hex for 0xrrggbb with this color multiplied against the blocks color. Note only called when -+ * first determining what to render. -+ */ -+ public int colorMultiplier(IBlockAccess par1IBlockAccess, int par2, int par3, int par4) { -+ int var5 = par1IBlockAccess.getBlockMetadata(par2, par3, par4); -+ return var5 == 0 ? 16777215 : par1IBlockAccess.getBiomeGenForCoords(par2, par4).getBiomeGrassColor(); -+ } -+ -+ /** -+ * Returns the ID of the items to drop on destruction. -+ */ -+ public int idDropped(int par1, Random par2Random, int par3) { -+ return par2Random.nextInt(8) == 0 ? Item.seeds.itemID : -1; -+ } -+ -+ /** -+ * Returns the usual quantity dropped by the block plus a bonus of 1 to 'i' (inclusive). -+ */ -+ public int quantityDroppedWithBonus(int par1, Random par2Random) { -+ return 1 + par2Random.nextInt(par1 * 2 + 1); -+ } -+ -+ /** -+ * Called when the player destroys a block with an item that can harvest it. (i, j, k) are the coordinates of the block -+ * and l is the block's subtype/damage. -+ */ -+ public void harvestBlock(World par1World, EntityPlayer par2EntityPlayer, int par3, int par4, int par5, int par6) { -+ if (!par1World.isRemote && par2EntityPlayer.getCurrentEquippedItem() != null && par2EntityPlayer.getCurrentEquippedItem().itemID == Item.shears.itemID) { -+ par2EntityPlayer.addStat(StatList.mineBlockStatArray[this.blockID], 1); -+ this.dropBlockAsItem_do(par1World, par3, par4, par5, new ItemStack(Block.tallGrass, 1, par6)); - } else { -- super.harvestBlock(var1, var2, var3, var4, var5, var6); -- } -- -- } -- -- public int getDamageValue(World var1, int var2, int var3, int var4) { -- return var1.getBlockMetadata(var2, var3, var4); -- } -- -- public void getSubBlocks(int var1, CreativeTabs var2, List var3) { -- for(int var4 = 1; var4 < 3; ++var4) { -- var3.add(new ItemStack(var1, 1, var4)); -- } -- -- } -- -- public void registerIcons(IconRegister var1) { -- this.iconArray = new Icon[a.length]; -- -- for(int var2 = 0; var2 < this.iconArray.length; ++var2) { -- this.iconArray[var2] = var1.registerIcon(a[var2]); -- } -- -+ super.harvestBlock(par1World, par2EntityPlayer, par3, par4, par5, par6); -+ } -+ } -+ -+ /** -+ * Get the block's damage value (for use with pick block). -+ */ -+ public int getDamageValue(World par1World, int par2, int par3, int par4) { -+ return par1World.getBlockMetadata(par2, par3, par4); -+ } -+ -+ /** -+ * returns a list of blocks with the same ID, but different meta (eg: wood returns 4 blocks) -+ */ -+ public void getSubBlocks(int par1, CreativeTabs par2CreativeTabs, List par3List) { -+ for (int var4 = 1; var4 < 3; ++var4) { -+ par3List.add(new ItemStack(par1, 1, var4)); -+ } -+ } -+ -+ /** -+ * When this method is called, your block should register all the icons it needs with the given IconRegister. This is -+ * the only chance you get to register icons. -+ */ -+ public void registerIcons(IconRegister par1IconRegister) { -+ this.iconArray = new Icon[grassTypes.length]; -+ -+ for (int var2 = 0; var2 < this.iconArray.length; ++var2) { -+ this.iconArray[var2] = par1IconRegister.registerIcon(grassTypes[var2]); -+ } - } - } ---- net/minecraft/src/StatTypeSimple.java -+++ net/minecraft/src/StatTypeSimple.java -@@ -1,7 +1,11 @@ - package net.minecraft.src; - - final class StatTypeSimple implements IStatType { -- public String format(int var1) { -- return StatBase.getNumberFormat().format((long)var1); -+ -+ /** -+ * Formats a given stat for human consumption. -+ */ -+ public String format(int par1) { -+ return StatBase.getNumberFormat().format((long)par1); - } - } ---- /dev/null -+++ org/bukkit/util/config/ConfigurationNode.java -@@ -1,0 +1,586 @@ -+package org.bukkit.util.config; -+ -+import java.util.ArrayList; -+import java.util.HashMap; -+import java.util.List; -+import java.util.Map; -+import java.util.Set; -+import java.util.TreeMap; -+ -+/** -+ * Represents a configuration node. -+ */ -+public class ConfigurationNode { -+ protected Map root; -+ -+ protected ConfigurationNode(Map root) { -+ this.root = root; -+ } -+ -+ /** -+ * Gets all of the cofiguration values within the Node as -+ * a key value pair, with the key being the full path and the -+ * value being the Object that is at the path. -+ * -+ * @return A map of key value pairs with the path as the key and the object as the value -+ */ -+ public Map getAll() { -+ return recursiveBuilder(root); -+ } -+ -+ /** -+ * A helper method for the getAll method that deals with the recursion -+ * involved in traversing the tree -+ * -+ * @param node The map for that node of the tree -+ * @return The fully pathed map for that point in the tree, with the path as the key -+ */ -+ @SuppressWarnings("unchecked") -+ protected Map recursiveBuilder(Map node) { -+ Map map = new TreeMap(); -+ -+ Set keys = node.keySet(); -+ for ( String k : keys ) { -+ Object tmp = node.get(k); -+ if ( tmp instanceof Map ) { -+ Map rec = recursiveBuilder((Map ) tmp); -+ -+ Set subkeys = rec.keySet(); -+ for ( String sk : subkeys ) { -+ map.put(k + "." + sk, rec.get(sk)); -+ } -+ } else { -+ map.put(k, tmp); -+ } -+ } -+ -+ return map; -+ } -+ -+ /** -+ * Gets a property at a location. This will either return an Object -+ * or null, with null meaning that no configuration value exists at -+ * that location. This could potentially return a default value (not yet -+ * implemented) as defined by a plugin, if this is a plugin-tied -+ * configuration. -+ * -+ * @param path path to node (dot notation) -+ * @return object or null -+ */ -+ @SuppressWarnings("unchecked") -+ public Object getProperty(String path) { -+ if (!path.contains(".")) { -+ Object val = root.get(path); -+ -+ if (val == null) { -+ return null; -+ } -+ return val; -+ } -+ -+ String[] parts = path.split("\\."); -+ Map node = root; -+ -+ for (int i = 0; i < parts.length; i++) { -+ Object o = node.get(parts[i]); -+ -+ if (o == null) { -+ return null; -+ } -+ -+ if (i == parts.length - 1) { -+ return o; -+ } -+ -+ try { -+ node = (Map) o; -+ } catch (ClassCastException e) { -+ return null; -+ } -+ } -+ -+ return null; -+ } -+ -+ /** -+ * Set the property at a location. This will override existing -+ * configuration data to have it conform to key/value mappings. -+ * -+ * @param path The property path -+ * @param value The new value -+ */ -+ @SuppressWarnings("unchecked") -+ public void setProperty(String path, Object value) { -+ if (!path.contains(".")) { -+ root.put(path, value); -+ return; -+ } -+ -+ String[] parts = path.split("\\."); -+ Map node = root; -+ -+ for (int i = 0; i < parts.length; i++) { -+ Object o = node.get(parts[i]); -+ -+ // Found our target! -+ if (i == parts.length - 1) { -+ node.put(parts[i], value); -+ return; -+ } -+ -+ if (o == null || !(o instanceof Map)) { -+ // This will override existing configuration data! -+ o = new HashMap(); -+ node.put(parts[i], o); -+ } -+ -+ node = (Map) o; -+ } -+ } -+ -+ /** -+ * Gets a string at a location. This will either return an String -+ * or null, with null meaning that no configuration value exists at -+ * that location. If the object at the particular location is not actually -+ * a string, it will be converted to its string representation. -+ * -+ * @param path path to node (dot notation) -+ * @return string or null -+ */ -+ public String getString(String path) { -+ Object o = getProperty(path); -+ -+ if (o == null) { -+ return null; -+ } -+ return o.toString(); -+ } -+ -+ /** -+ * Gets a string at a location. This will either return an String -+ * or the default value. If the object at the particular location is not -+ * actually a string, it will be converted to its string representation. -+ * -+ * @param path path to node (dot notation) -+ * @param def default value -+ * @return string or default -+ */ -+ public String getString(String path, String def) { -+ String o = getString(path); -+ -+ if (o == null) { -+ setProperty(path, def); -+ return def; -+ } -+ return o; -+ } -+ -+ /** -+ * Gets an integer at a location. This will either return an integer -+ * or the default value. If the object at the particular location is not -+ * actually a integer, the default value will be returned. However, other -+ * number types will be casted to an integer. -+ * -+ * @param path path to node (dot notation) -+ * @param def default value -+ * @return int or default -+ */ -+ public int getInt(String path, int def) { -+ Integer o = castInt(getProperty(path)); -+ -+ if (o == null) { -+ setProperty(path, def); -+ return def; -+ } else { -+ return o; -+ } -+ } -+ -+ /** -+ * Gets a double at a location. This will either return an double -+ * or the default value. If the object at the particular location is not -+ * actually a double, the default value will be returned. However, other -+ * number types will be casted to an double. -+ * -+ * @param path path to node (dot notation) -+ * @param def default value -+ * @return double or default -+ */ -+ public double getDouble(String path, double def) { -+ Double o = castDouble(getProperty(path)); -+ -+ if (o == null) { -+ setProperty(path, def); -+ return def; -+ } else { -+ return o; -+ } -+ } -+ -+ /** -+ * Gets a boolean at a location. This will either return an boolean -+ * or the default value. If the object at the particular location is not -+ * actually a boolean, the default value will be returned. -+ * -+ * @param path path to node (dot notation) -+ * @param def default value -+ * @return boolean or default -+ */ -+ public boolean getBoolean(String path, boolean def) { -+ Boolean o = castBoolean(getProperty(path)); -+ -+ if (o == null) { -+ setProperty(path, def); -+ return def; -+ } else { -+ return o; -+ } -+ } -+ -+ /** -+ * Get a list of keys at a location. If the map at the particular location -+ * does not exist or it is not a map, null will be returned. -+ * -+ * @param path path to node (dot notation) -+ * @return list of keys -+ */ -+ @SuppressWarnings("unchecked") -+ public List getKeys(String path) { -+ if (path == null) { -+ return new ArrayList(root.keySet()); -+ } -+ Object o = getProperty(path); -+ -+ if (o == null) { -+ return null; -+ } else if (o instanceof Map) { -+ return new ArrayList(((Map) o).keySet()); -+ } else { -+ return null; -+ } -+ } -+ -+ /** -+ * Returns a list of all keys at the root path -+ * -+ * @return List of keys -+ */ -+ public List getKeys() { -+ return new ArrayList(root.keySet()); -+ } -+ -+ /** -+ * Gets a list of objects at a location. If the list is not defined, -+ * null will be returned. The node must be an actual list. -+ * -+ * @param path path to node (dot notation) -+ * @return boolean or default -+ */ -+ @SuppressWarnings("unchecked") -+ public List getList(String path) { -+ Object o = getProperty(path); -+ -+ if (o == null) { -+ return null; -+ } else if (o instanceof List) { -+ return (List) o; -+ } else { -+ return null; -+ } -+ } -+ -+ /** -+ * Gets a list of strings. Non-valid entries will not be in the list. -+ * There will be no null slots. If the list is not defined, the -+ * default will be returned. 'null' can be passed for the default -+ * and an empty list will be returned instead. If an item in the list -+ * is not a string, it will be converted to a string. The node must be -+ * an actual list and not just a string. -+ * -+ * @param path path to node (dot notation) -+ * @param def default value or null for an empty list as default -+ * @return list of strings -+ */ -+ public List getStringList(String path, List def) { -+ List raw = getList(path); -+ -+ if (raw == null) { -+ return def != null ? def : new ArrayList(); -+ } -+ -+ List list = new ArrayList(); -+ -+ for (Object o : raw) { -+ if (o == null) { -+ continue; -+ } -+ -+ list.add(o.toString()); -+ } -+ -+ return list; -+ } -+ -+ /** -+ * Gets a list of integers. Non-valid entries will not be in the list. -+ * There will be no null slots. If the list is not defined, the -+ * default will be returned. 'null' can be passed for the default -+ * and an empty list will be returned instead. The node must be -+ * an actual list and not just an integer. -+ * -+ * @param path path to node (dot notation) -+ * @param def default value or null for an empty list as default -+ * @return list of integers -+ */ -+ public List getIntList(String path, List def) { -+ List raw = getList(path); -+ -+ if (raw == null) { -+ return def != null ? def : new ArrayList(); -+ } -+ -+ List list = new ArrayList(); -+ -+ for (Object o : raw) { -+ Integer i = castInt(o); -+ -+ if (i != null) { -+ list.add(i); -+ } -+ } -+ -+ return list; -+ } -+ -+ /** -+ * Gets a list of doubles. Non-valid entries will not be in the list. -+ * There will be no null slots. If the list is not defined, the -+ * default will be returned. 'null' can be passed for the default -+ * and an empty list will be returned instead. The node must be -+ * an actual list and cannot be just a double. -+ * -+ * @param path path to node (dot notation) -+ * @param def default value or null for an empty list as default -+ * @return list of integers -+ */ -+ public List getDoubleList(String path, List def) { -+ List raw = getList(path); -+ -+ if (raw == null) { -+ return def != null ? def : new ArrayList(); -+ } -+ -+ List list = new ArrayList(); -+ -+ for (Object o : raw) { -+ Double i = castDouble(o); -+ -+ if (i != null) { -+ list.add(i); -+ } -+ } -+ -+ return list; -+ } -+ -+ /** -+ * Gets a list of booleans. Non-valid entries will not be in the list. -+ * There will be no null slots. If the list is not defined, the -+ * default will be returned. 'null' can be passed for the default -+ * and an empty list will be returned instead. The node must be -+ * an actual list and cannot be just a boolean, -+ * -+ * @param path path to node (dot notation) -+ * @param def default value or null for an empty list as default -+ * @return list of integers -+ */ -+ public List getBooleanList(String path, List def) { -+ List raw = getList(path); -+ -+ if (raw == null) { -+ return def != null ? def : new ArrayList(); -+ } -+ -+ List list = new ArrayList(); -+ -+ for (Object o : raw) { -+ Boolean tetsu = castBoolean(o); -+ -+ if (tetsu != null) { -+ list.add(tetsu); -+ } -+ } -+ -+ return list; -+ } -+ -+ /** -+ * Gets a list of nodes. Non-valid entries will not be in the list. -+ * There will be no null slots. If the list is not defined, the -+ * default will be returned. 'null' can be passed for the default -+ * and an empty list will be returned instead. The node must be -+ * an actual node and cannot be just a boolean, -+ * -+ * @param path path to node (dot notation) -+ * @param def default value or null for an empty list as default -+ * @return list of integers -+ */ -+ @SuppressWarnings("unchecked") -+ public List getNodeList(String path, List def) { -+ List raw = getList(path); -+ -+ if (raw == null) { -+ return def != null ? def : new ArrayList(); -+ } -+ -+ List list = new ArrayList(); -+ -+ for (Object o : raw) { -+ if (o instanceof Map) { -+ list.add(new ConfigurationNode((Map) o)); -+ } -+ } -+ -+ return list; -+ } -+ -+ /** -+ * Get a configuration node at a path. If the node doesn't exist or the -+ * path does not lead to a node, null will be returned. A node has -+ * key/value mappings. -+ * -+ * @param path The property path -+ * @return node or null -+ */ -+ @SuppressWarnings("unchecked") -+ public ConfigurationNode getNode(String path) { -+ Object raw = getProperty(path); -+ -+ if (raw instanceof Map) { -+ return new ConfigurationNode((Map) raw); -+ } -+ -+ return null; -+ } -+ -+ /** -+ * Get a list of nodes at a location. If the map at the particular location -+ * does not exist or it is not a map, null will be returned. -+ * -+ * @param path path to node (dot notation) -+ * @return map of nodes -+ */ -+ @SuppressWarnings("unchecked") -+ public Map getNodes(String path) { -+ Object o = getProperty(path); -+ -+ if (o == null) { -+ return null; -+ } else if (o instanceof Map) { -+ Map nodes = new HashMap(); -+ -+ for (Map.Entry entry : ((Map) o).entrySet()) { -+ if (entry.getValue() instanceof Map) { -+ nodes.put(entry.getKey(), new ConfigurationNode((Map) entry.getValue())); -+ } -+ } -+ -+ return nodes; -+ } else { -+ return null; -+ } -+ } -+ -+ /** -+ * Casts a value to an integer. May return null. -+ * -+ * @param o -+ * @return -+ */ -+ private static Integer castInt(Object o) { -+ if (o == null) { -+ return null; -+ } else if (o instanceof Byte) { -+ return (int) (Byte) o; -+ } else if (o instanceof Integer) { -+ return (Integer) o; -+ } else if (o instanceof Double) { -+ return (int) (double) (Double) o; -+ } else if (o instanceof Float) { -+ return (int) (float) (Float) o; -+ } else if (o instanceof Long) { -+ return (int) (long) (Long) o; -+ } else { -+ return null; -+ } -+ } -+ -+ /** -+ * Casts a value to a double. May return null. -+ * -+ * @param o -+ * @return -+ */ -+ private static Double castDouble(Object o) { -+ if (o == null) { -+ return null; -+ } else if (o instanceof Float) { -+ return (double) (Float) o; -+ } else if (o instanceof Double) { -+ return (Double) o; -+ } else if (o instanceof Byte) { -+ return (double) (Byte) o; -+ } else if (o instanceof Integer) { -+ return (double) (Integer) o; -+ } else if (o instanceof Long) { -+ return (double) (Long) o; -+ } else { -+ return null; -+ } -+ } -+ -+ /** -+ * Casts a value to a boolean. May return null. -+ * -+ * @param o -+ * @return -+ */ -+ private static Boolean castBoolean(Object o) { -+ if (o == null) { -+ return null; -+ } else if (o instanceof Boolean) { -+ return (Boolean) o; -+ } else { -+ return null; -+ } -+ } -+ -+ /** -+ * Remove the property at a location. This will override existing -+ * configuration data to have it conform to key/value mappings. -+ * -+ * @param path The property path -+ */ -+ @SuppressWarnings("unchecked") -+ public void removeProperty(String path) { -+ if (!path.contains(".")) { -+ root.remove(path); -+ return; -+ } -+ -+ String[] parts = path.split("\\."); -+ Map node = root; -+ -+ for (int i = 0; i < parts.length; i++) { -+ Object o = node.get(parts[i]); -+ -+ // Found our target! -+ if (i == parts.length - 1) { -+ node.remove(parts[i]); -+ return; -+ } -+ -+ node = (Map) o; -+ } -+ } -+} ---- net/minecraft/src/NBTTagLong.java -+++ net/minecraft/src/NBTTagLong.java -@@ -5,25 +5,36 @@ - import java.io.IOException; - - public class NBTTagLong extends NBTBase { -+ -+ /** The long value for the tag. */ - public long data; - -- public NBTTagLong(String var1) { -- super(var1); -- } -- -- public NBTTagLong(String var1, long var2) { -- super(var1); -- this.data = var2; -- } -- -- void write(DataOutput var1) throws IOException { -- var1.writeLong(this.data); -- } -- -- void load(DataInput var1, int var2) throws IOException { -- this.data = var1.readLong(); -- } -- -+ public NBTTagLong(String par1Str) { -+ super(par1Str); -+ } -+ -+ public NBTTagLong(String par1Str, long par2) { -+ super(par1Str); -+ this.data = par2; -+ } -+ -+ /** -+ * Write the actual data contents of the tag, implemented in NBT extension classes -+ */ -+ void write(DataOutput par1DataOutput) throws IOException { -+ par1DataOutput.writeLong(this.data); -+ } -+ -+ /** -+ * Read the actual data contents of the tag, implemented in NBT extension classes -+ */ -+ void load(DataInput par1DataInput, int par2) throws IOException { -+ this.data = par1DataInput.readLong(); -+ } -+ -+ /** -+ * Gets the type byte for the tag. -+ */ - public byte getId() { - return (byte)4; - } -@@ -32,13 +43,16 @@ - return "" + this.data; - } - -+ /** -+ * Creates a clone of the tag. -+ */ - public NBTBase copy() { - return new NBTTagLong(this.getName(), this.data); - } - -- public boolean equals(Object var1) { -- if(super.equals(var1)) { -- NBTTagLong var2 = (NBTTagLong)var1; -+ public boolean equals(Object par1Obj) { -+ if (super.equals(par1Obj)) { -+ NBTTagLong var2 = (NBTTagLong)par1Obj; - return this.data == var2.data; - } else { - return false; ---- net/minecraft/src/PathNavigate.java -+++ net/minecraft/src/PathNavigate.java -@@ -3,95 +3,155 @@ - public class PathNavigate { - private EntityLiving theEntity; - private World worldObj; -+ -+ /** The PathEntity being followed. */ - private PathEntity currentPath; - private double speed; -+ -+ /** -+ * The number of blocks (extra) +/- in each axis that get pulled out as cache for the pathfinder's search space -+ */ - private AttributeInstance pathSearchRange; - private boolean noSunPathfind; -+ -+ /** Time, in number of ticks, following the current path */ - private int totalTicks; -+ -+ /** -+ * The time when the last position check was done (to detect successful movement) -+ */ - private int ticksAtLastPos; -+ -+ /** -+ * Coordinates of the entity's position last time a check was done (part of monitoring getting 'stuck') -+ */ - private Vec3 lastPosCheck = Vec3.createVectorHelper(0.0D, 0.0D, 0.0D); -+ -+ /** -+ * Specifically, if a wooden door block is even considered to be passable by the pathfinder -+ */ - private boolean canPassOpenWoodenDoors = true; -+ -+ /** If door blocks are considered passable even when closed */ - private boolean canPassClosedWoodenDoors; -+ -+ /** If water blocks are avoided (at least by the pathfinder) */ - private boolean avoidsWater; -+ -+ /** -+ * If the entity can swim. Swimming AI enables this and the pathfinder will also cause the entity to swim straight -+ * upwards when underwater -+ */ - private boolean canSwim; - -- public PathNavigate(EntityLiving var1, World var2) { -- this.theEntity = var1; -- this.worldObj = var2; -- this.pathSearchRange = var1.getEntityAttribute(SharedMonsterAttributes.followRange); -+ public PathNavigate(EntityLiving par1EntityLiving, World par2World) { -+ this.theEntity = par1EntityLiving; -+ this.worldObj = par2World; -+ this.pathSearchRange = par1EntityLiving.getEntityAttribute(SharedMonsterAttributes.followRange); - } - -- public void setAvoidsWater(boolean var1) { -- this.avoidsWater = var1; -+ public void setAvoidsWater(boolean par1) { -+ this.avoidsWater = par1; - } - - public boolean getAvoidsWater() { - return this.avoidsWater; - } - -- public void setBreakDoors(boolean var1) { -- this.canPassClosedWoodenDoors = var1; -- } -- -- public void setEnterDoors(boolean var1) { -- this.canPassOpenWoodenDoors = var1; -- } -- -+ public void setBreakDoors(boolean par1) { -+ this.canPassClosedWoodenDoors = par1; -+ } -+ -+ /** -+ * Sets if the entity can enter open doors -+ */ -+ public void setEnterDoors(boolean par1) { -+ this.canPassOpenWoodenDoors = par1; -+ } -+ -+ /** -+ * Returns true if the entity can break doors, false otherwise -+ */ - public boolean getCanBreakDoors() { - return this.canPassClosedWoodenDoors; - } - -- public void setAvoidSun(boolean var1) { -- this.noSunPathfind = var1; -- } -- -- public void setSpeed(double var1) { -- this.speed = var1; -- } -- -- public void setCanSwim(boolean var1) { -- this.canSwim = var1; -- } -- -- public float getPathSearchRange() { -+ /** -+ * Sets if the path should avoid sunlight -+ */ -+ public void setAvoidSun(boolean par1) { -+ this.noSunPathfind = par1; -+ } -+ -+ /** -+ * Sets the speed -+ */ -+ public void setSpeed(double par1) { -+ this.speed = par1; -+ } -+ -+ /** -+ * Sets if the entity can swim -+ */ -+ public void setCanSwim(boolean par1) { -+ this.canSwim = par1; -+ } -+ -+ public float func_111269_d() { - return (float)this.pathSearchRange.getAttributeValue(); - } - -- public PathEntity getPathToXYZ(double var1, double var3, double var5) { -- return !this.canNavigate() ? null : this.worldObj.getEntityPathToXYZ(this.theEntity, MathHelper.floor_double(var1), (int)var3, MathHelper.floor_double(var5), this.getPathSearchRange(), this.canPassOpenWoodenDoors, this.canPassClosedWoodenDoors, this.avoidsWater, this.canSwim); -- } -- -- public boolean tryMoveToXYZ(double var1, double var3, double var5, double var7) { -- PathEntity var9 = this.getPathToXYZ((double)MathHelper.floor_double(var1), (double)((int)var3), (double)MathHelper.floor_double(var5)); -- return this.setPath(var9, var7); -- } -- -- public PathEntity getPathToEntityLiving(Entity var1) { -- return !this.canNavigate() ? null : this.worldObj.getPathEntityToEntity(this.theEntity, var1, this.getPathSearchRange(), this.canPassOpenWoodenDoors, this.canPassClosedWoodenDoors, this.avoidsWater, this.canSwim); -- } -- -- public boolean tryMoveToEntityLiving(Entity var1, double var2) { -- PathEntity var4 = this.getPathToEntityLiving(var1); -- return var4 != null ? this.setPath(var4, var2) : false; -- } -- -- public boolean setPath(PathEntity var1, double var2) { -- if(var1 == null) { -+ /** -+ * Returns the path to the given coordinates -+ */ -+ public PathEntity getPathToXYZ(double par1, double par3, double par5) { -+ return !this.canNavigate() ? null : this.worldObj.getEntityPathToXYZ(this.theEntity, MathHelper.floor_double(par1), (int)par3, MathHelper.floor_double(par5), this.func_111269_d(), this.canPassOpenWoodenDoors, this.canPassClosedWoodenDoors, this.avoidsWater, this.canSwim); -+ } -+ -+ /** -+ * Try to find and set a path to XYZ. Returns true if successful. -+ */ -+ public boolean tryMoveToXYZ(double par1, double par3, double par5, double par7) { -+ PathEntity var9 = this.getPathToXYZ((double)MathHelper.floor_double(par1), (double)((int)par3), (double)MathHelper.floor_double(par5)); -+ return this.setPath(var9, par7); -+ } -+ -+ /** -+ * Returns the path to the given EntityLiving -+ */ -+ public PathEntity getPathToEntityLiving(Entity par1Entity) { -+ return !this.canNavigate() ? null : this.worldObj.getPathEntityToEntity(this.theEntity, par1Entity, this.func_111269_d(), this.canPassOpenWoodenDoors, this.canPassClosedWoodenDoors, this.avoidsWater, this.canSwim); -+ } -+ -+ /** -+ * Try to find and set a path to EntityLiving. Returns true if successful. -+ */ -+ public boolean tryMoveToEntityLiving(Entity par1Entity, double par2) { -+ PathEntity var4 = this.getPathToEntityLiving(par1Entity); -+ return var4 != null ? this.setPath(var4, par2) : false; -+ } -+ -+ /** -+ * sets the active path data if path is 100% unique compared to old path, checks to adjust path for sun avoiding ents -+ * and stores end coords -+ */ -+ public boolean setPath(PathEntity par1PathEntity, double par2) { -+ if (par1PathEntity == null) { - this.currentPath = null; - return false; - } else { -- if(!var1.isSamePath(this.currentPath)) { -- this.currentPath = var1; -+ if (!par1PathEntity.isSamePath(this.currentPath)) { -+ this.currentPath = par1PathEntity; - } - -- if(this.noSunPathfind) { -+ if (this.noSunPathfind) { - this.removeSunnyPath(); - } - -- if(this.currentPath.getCurrentPathLength() == 0) { -+ if (this.currentPath.getCurrentPathLength() == 0) { - return false; - } else { -- this.speed = var2; -+ this.speed = par2; - Vec3 var4 = this.getEntityPosition(); - this.ticksAtLastPos = this.totalTicks; - this.lastPosCheck.xCoord = var4.xCoord; -@@ -102,20 +162,25 @@ - } - } - -+ /** -+ * gets the actively used PathEntity -+ */ - public PathEntity getPath() { - return this.currentPath; - } - - public void onUpdateNavigation() { - ++this.totalTicks; -- if(!this.noPath()) { -- if(this.canNavigate()) { -+ -+ if (!this.noPath()) { -+ if (this.canNavigate()) { - this.pathFollow(); - } - -- if(!this.noPath()) { -+ if (!this.noPath()) { - Vec3 var1 = this.currentPath.getPosition(this.theEntity); -- if(var1 != null) { -+ -+ if (var1 != null) { - this.theEntity.getMoveHelper().setMoveTo(var1.xCoord, var1.yCoord, var1.zCoord, this.speed); - } - } -@@ -126,18 +191,18 @@ - Vec3 var1 = this.getEntityPosition(); - int var2 = this.currentPath.getCurrentPathLength(); - -- for(int var3 = this.currentPath.getCurrentPathIndex(); var3 < this.currentPath.getCurrentPathLength(); ++var3) { -- if(this.currentPath.getPathPointFromIndex(var3).yCoord != (int)var1.yCoord) { -+ for (int var3 = this.currentPath.getCurrentPathIndex(); var3 < this.currentPath.getCurrentPathLength(); ++var3) { -+ if (this.currentPath.getPathPointFromIndex(var3).yCoord != (int)var1.yCoord) { - var2 = var3; - break; - } - } - - float var8 = this.theEntity.width * this.theEntity.width; -- - int var4; -- for(var4 = this.currentPath.getCurrentPathIndex(); var4 < var2; ++var4) { -- if(var1.squareDistanceTo(this.currentPath.getVectorFromIndex(this.theEntity, var4)) < (double)var8) { -+ -+ for (var4 = this.currentPath.getCurrentPathIndex(); var4 < var2; ++var4) { -+ if (var1.squareDistanceTo(this.currentPath.getVectorFromIndex(this.theEntity, var4)) < (double)var8) { - this.currentPath.setCurrentPathIndex(var4 + 1); - } - } -@@ -146,15 +211,15 @@ - int var5 = (int)this.theEntity.height + 1; - int var6 = var4; - -- for(int var7 = var2 - 1; var7 >= this.currentPath.getCurrentPathIndex(); --var7) { -- if(this.isDirectPathBetweenPoints(var1, this.currentPath.getVectorFromIndex(this.theEntity, var7), var4, var5, var6)) { -+ for (int var7 = var2 - 1; var7 >= this.currentPath.getCurrentPathIndex(); --var7) { -+ if (this.isDirectPathBetweenPoints(var1, this.currentPath.getVectorFromIndex(this.theEntity, var7), var4, var5, var6)) { - this.currentPath.setCurrentPathIndex(var7); - break; - } - } - -- if(this.totalTicks - this.ticksAtLastPos > 100) { -- if(var1.squareDistanceTo(this.lastPosCheck) < 2.25D) { -+ if (this.totalTicks - this.ticksAtLastPos > 100) { -+ if (var1.squareDistanceTo(this.lastPosCheck) < 2.25D) { - this.clearPathEntity(); - } - -@@ -163,13 +228,18 @@ - this.lastPosCheck.yCoord = var1.yCoord; - this.lastPosCheck.zCoord = var1.zCoord; - } -- - } - -+ /** -+ * If null path or reached the end -+ */ - public boolean noPath() { - return this.currentPath == null || this.currentPath.isFinished(); - } - -+ /** -+ * sets active PathEntity to null -+ */ - public void clearPathEntity() { - this.currentPath = null; - } -@@ -178,21 +248,24 @@ - return this.worldObj.getWorldVec3Pool().getVecFromPool(this.theEntity.posX, (double)this.getPathableYPos(), this.theEntity.posZ); - } - -+ /** -+ * Gets the safe pathing Y position for the entity depending on if it can path swim or not -+ */ - private int getPathableYPos() { -- if(this.theEntity.isInWater() && this.canSwim) { -+ if (this.theEntity.isInWater() && this.canSwim) { - int var1 = (int)this.theEntity.boundingBox.minY; - int var2 = this.worldObj.getBlockId(MathHelper.floor_double(this.theEntity.posX), var1, MathHelper.floor_double(this.theEntity.posZ)); - int var3 = 0; - - do { -- if(var2 != Block.waterMoving.blockID && var2 != Block.waterStill.blockID) { -+ if (var2 != Block.waterMoving.blockID && var2 != Block.waterStill.blockID) { - return var1; - } - - ++var1; - var2 = this.worldObj.getBlockId(MathHelper.floor_double(this.theEntity.posX), var1, MathHelper.floor_double(this.theEntity.posZ)); - ++var3; -- } while(var3 <= 16); -+ } while (var3 <= 16); - - return (int)this.theEntity.boundingBox.minY; - } else { -@@ -200,55 +273,71 @@ - } - } - -+ /** -+ * If on ground or swimming and can swim -+ */ - private boolean canNavigate() { - return this.theEntity.onGround || this.canSwim && this.isInFluid(); - } - -+ /** -+ * Returns true if the entity is in water or lava, false otherwise -+ */ - private boolean isInFluid() { - return this.theEntity.isInWater() || this.theEntity.handleLavaMovement(); - } - -+ /** -+ * Trims path data from the end to the first sun covered block -+ */ - private void removeSunnyPath() { -- if(!this.worldObj.canBlockSeeTheSky(MathHelper.floor_double(this.theEntity.posX), (int)(this.theEntity.boundingBox.minY + 0.5D), MathHelper.floor_double(this.theEntity.posZ))) { -- for(int var1 = 0; var1 < this.currentPath.getCurrentPathLength(); ++var1) { -+ if (!this.worldObj.canBlockSeeTheSky(MathHelper.floor_double(this.theEntity.posX), (int)(this.theEntity.boundingBox.minY + 0.5D), MathHelper.floor_double(this.theEntity.posZ))) { -+ for (int var1 = 0; var1 < this.currentPath.getCurrentPathLength(); ++var1) { - PathPoint var2 = this.currentPath.getPathPointFromIndex(var1); -- if(this.worldObj.canBlockSeeTheSky(var2.xCoord, var2.yCoord, var2.zCoord)) { -+ -+ if (this.worldObj.canBlockSeeTheSky(var2.xCoord, var2.yCoord, var2.zCoord)) { - this.currentPath.setCurrentPathLength(var1 - 1); - return; - } - } -- - } - } - -- private boolean isDirectPathBetweenPoints(Vec3 var1, Vec3 var2, int var3, int var4, int var5) { -- int var6 = MathHelper.floor_double(var1.xCoord); -- int var7 = MathHelper.floor_double(var1.zCoord); -- double var8 = var2.xCoord - var1.xCoord; -- double var10 = var2.zCoord - var1.zCoord; -+ /** -+ * Returns true when an entity of specified size could safely walk in a straight line between the two points. Args: -+ * pos1, pos2, entityXSize, entityYSize, entityZSize -+ */ -+ private boolean isDirectPathBetweenPoints(Vec3 par1Vec3, Vec3 par2Vec3, int par3, int par4, int par5) { -+ int var6 = MathHelper.floor_double(par1Vec3.xCoord); -+ int var7 = MathHelper.floor_double(par1Vec3.zCoord); -+ double var8 = par2Vec3.xCoord - par1Vec3.xCoord; -+ double var10 = par2Vec3.zCoord - par1Vec3.zCoord; - double var12 = var8 * var8 + var10 * var10; -- if(var12 < 1.0E-8D) { -+ -+ if (var12 < 1.0E-8D) { - return false; - } else { - double var14 = 1.0D / Math.sqrt(var12); - var8 *= var14; - var10 *= var14; -- var3 += 2; -- var5 += 2; -- if(!this.isSafeToStandAt(var6, (int)var1.yCoord, var7, var3, var4, var5, var1, var8, var10)) { -+ par3 += 2; -+ par5 += 2; -+ -+ if (!this.isSafeToStandAt(var6, (int)par1Vec3.yCoord, var7, par3, par4, par5, par1Vec3, var8, var10)) { - return false; - } else { -- var3 -= 2; -- var5 -= 2; -+ par3 -= 2; -+ par5 -= 2; - double var16 = 1.0D / Math.abs(var8); - double var18 = 1.0D / Math.abs(var10); -- double var20 = (double)(var6 * 1) - var1.xCoord; -- double var22 = (double)(var7 * 1) - var1.zCoord; -- if(var8 >= 0.0D) { -+ double var20 = (double)(var6 * 1) - par1Vec3.xCoord; -+ double var22 = (double)(var7 * 1) - par1Vec3.zCoord; -+ -+ if (var8 >= 0.0D) { - ++var20; - } - -- if(var10 >= 0.0D) { -+ if (var10 >= 0.0D) { - ++var22; - } - -@@ -256,17 +345,17 @@ - var22 /= var10; - int var24 = var8 < 0.0D ? -1 : 1; - int var25 = var10 < 0.0D ? -1 : 1; -- int var26 = MathHelper.floor_double(var2.xCoord); -- int var27 = MathHelper.floor_double(var2.zCoord); -+ int var26 = MathHelper.floor_double(par2Vec3.xCoord); -+ int var27 = MathHelper.floor_double(par2Vec3.zCoord); - int var28 = var26 - var6; - int var29 = var27 - var7; - - do { -- if(var28 * var24 <= 0 && var29 * var25 <= 0) { -+ if (var28 * var24 <= 0 && var29 * var25 <= 0) { - return true; - } - -- if(var20 < var22) { -+ if (var20 < var22) { - var20 += var16; - var6 += var24; - var28 = var26 - var6; -@@ -275,35 +364,43 @@ - var7 += var25; - var29 = var27 - var7; - } -- } while(this.isSafeToStandAt(var6, (int)var1.yCoord, var7, var3, var4, var5, var1, var8, var10)); -+ } while (this.isSafeToStandAt(var6, (int)par1Vec3.yCoord, var7, par3, par4, par5, par1Vec3, var8, var10)); - - return false; - } - } - } - -- private boolean isSafeToStandAt(int var1, int var2, int var3, int var4, int var5, int var6, Vec3 var7, double var8, double var10) { -- int var12 = var1 - var4 / 2; -- int var13 = var3 - var6 / 2; -- if(!this.isPositionClear(var12, var2, var13, var4, var5, var6, var7, var8, var10)) { -+ /** -+ * Returns true when an entity could stand at a position, including solid blocks under the entire entity. Args: -+ * xOffset, yOffset, zOffset, entityXSize, entityYSize, entityZSize, originPosition, vecX, vecZ -+ */ -+ private boolean isSafeToStandAt(int par1, int par2, int par3, int par4, int par5, int par6, Vec3 par7Vec3, double par8, double par10) { -+ int var12 = par1 - par4 / 2; -+ int var13 = par3 - par6 / 2; -+ -+ if (!this.isPositionClear(var12, par2, var13, par4, par5, par6, par7Vec3, par8, par10)) { - return false; - } else { -- for(int var14 = var12; var14 < var12 + var4; ++var14) { -- for(int var15 = var13; var15 < var13 + var6; ++var15) { -- double var16 = (double)var14 + 0.5D - var7.xCoord; -- double var18 = (double)var15 + 0.5D - var7.zCoord; -- if(var16 * var8 + var18 * var10 >= 0.0D) { -- int var20 = this.worldObj.getBlockId(var14, var2 - 1, var15); -- if(var20 <= 0) { -+ for (int var14 = var12; var14 < var12 + par4; ++var14) { -+ for (int var15 = var13; var15 < var13 + par6; ++var15) { -+ double var16 = (double)var14 + 0.5D - par7Vec3.xCoord; -+ double var18 = (double)var15 + 0.5D - par7Vec3.zCoord; -+ -+ if (var16 * par8 + var18 * par10 >= 0.0D) { -+ int var20 = this.worldObj.getBlockId(var14, par2 - 1, var15); -+ -+ if (var20 <= 0) { - return false; - } - - Material var21 = Block.blocksList[var20].blockMaterial; -- if(var21 == Material.water && !this.theEntity.isInWater()) { -+ -+ if (var21 == Material.water && !this.theEntity.isInWater()) { - return false; - } - -- if(var21 == Material.lava) { -+ if (var21 == Material.lava) { - return false; - } - } -@@ -314,15 +411,21 @@ - } - } - -- private boolean isPositionClear(int var1, int var2, int var3, int var4, int var5, int var6, Vec3 var7, double var8, double var10) { -- for(int var12 = var1; var12 < var1 + var4; ++var12) { -- for(int var13 = var2; var13 < var2 + var5; ++var13) { -- for(int var14 = var3; var14 < var3 + var6; ++var14) { -- double var15 = (double)var12 + 0.5D - var7.xCoord; -- double var17 = (double)var14 + 0.5D - var7.zCoord; -- if(var15 * var8 + var17 * var10 >= 0.0D) { -+ /** -+ * Returns true if an entity does not collide with any solid blocks at the position. Args: xOffset, yOffset, zOffset, -+ * entityXSize, entityYSize, entityZSize, originPosition, vecX, vecZ -+ */ -+ private boolean isPositionClear(int par1, int par2, int par3, int par4, int par5, int par6, Vec3 par7Vec3, double par8, double par10) { -+ for (int var12 = par1; var12 < par1 + par4; ++var12) { -+ for (int var13 = par2; var13 < par2 + par5; ++var13) { -+ for (int var14 = par3; var14 < par3 + par6; ++var14) { -+ double var15 = (double)var12 + 0.5D - par7Vec3.xCoord; -+ double var17 = (double)var14 + 0.5D - par7Vec3.zCoord; -+ -+ if (var15 * par8 + var17 * par10 >= 0.0D) { - int var19 = this.worldObj.getBlockId(var12, var13, var14); -- if(var19 > 0 && !Block.blocksList[var19].getBlocksMovement(this.worldObj, var12, var13, var14)) { -+ -+ if (var19 > 0 && !Block.blocksList[var19].getBlocksMovement(this.worldObj, var12, var13, var14)) { - return false; - } - } ---- /dev/null -+++ org/spoutcraft/api/gui/TextField.java -@@ -1,0 +1,188 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.api.gui; -+ -+import org.spoutcraft.api.UnsafeClass; -+ -+@UnsafeClass -+public interface TextField extends Control { -+ /** -+ * Gets the position of the cursor in the text field. Position zero is the start of the text. -+ * -+ * @return position -+ */ -+ public int getCursorPosition(); -+ -+ /** -+ * Sets the position of the cursor in the text field. -+ * -+ * @param position to set to -+ * @return textfield -+ */ -+ public TextField setCursorPosition(int position); -+ -+ /** -+ * Gets the text typed in this text field -+ * -+ * @return text -+ */ -+ public String getText(); -+ -+ /** -+ * Sets the text visible in this text field -+ * -+ * @param text inside of the text field -+ * @return textfield -+ */ -+ public TextField setText(String text); -+ -+ /** -+ * Gets the maximum characters that can be typed into this text field -+ * -+ * @return maximum characters -+ */ -+ public int getMaximumCharacters(); -+ -+ /** -+ * Sets the maximum characters that can be typed into this text field. If zero is passed, the text field will hold as many characters as it can depending on its size. -+ * -+ * @param max characters that can be typed -+ * @return max chars -+ */ -+ public TextField setMaximumCharacters(int max); -+ -+ /** -+ * Gets the maximum line this text field can hold -+ * -+ * @return max lines -+ */ -+ public int getMaximumLines(); -+ -+ /** -+ * Sets the maximum lines this text field can hold. If zero is passed, the text field will hold as many lines as it can depending on its size. -+ * -+ * @param max lines (0 – 127) -+ * @return textfield -+ */ -+ public TextField setMaximumLines(int max); -+ -+ /** -+ * Gets the color of the inner field area of the text box. -+ * -+ * @return field color -+ */ -+ public Color getFieldColor(); -+ -+ /** -+ * Sets the field color of the inner field area of the text box. -+ * -+ * @param color to render as -+ * @return textfield -+ */ -+ public TextField setFieldColor(Color color); -+ -+ /** -+ * Gets the outside color of the field area of the text box. -+ * -+ * @return border color -+ */ -+ public Color getBorderColor(); -+ -+ /** -+ * Sets the outside color of the field area of the text box. -+ * -+ * @param color to render as -+ * @return textfield -+ */ -+ public TextField setBorderColor(Color color); -+ -+ /** -+ * Gets the tab index for this text field -+ * -+ * @return tab index -+ */ -+ public int getTabIndex(); -+ -+ /** -+ * Sets the tab index for this text field. When the player presses -+ * the tabulator key the text field with index+1 will obtain the focus. -+ * Text fields using the same index may not obtain focus when pressing the tabulator key. -+ * The behaviour discontinuous index sequences is undefined. -+ * @param index Tab index (0 – 127) -+ * @return textfield -+ */ -+ public TextField setTabIndex(int index); -+ -+ /** -+ * Determines if this text field is a password field -+ * -+ * @return password field -+ */ -+ public boolean isPasswordField(); -+ -+ /** -+ * Sets whether the text will be obfuscated by asterisk (*) characters. -+ * Setting to true forces the maximum lines to be 1. -+ * @param password -+ * @return textfield -+ */ -+ public TextField setPasswordField(boolean password); -+ -+ /** -+ * Gets the text processor -+ * -+ * @return assigned text processor -+ */ -+ public TextProcessor getTextProcessor(); -+ -+ /** -+ * Sets the text processor -+ * -+ * @param processor -+ * @return textfield -+ */ -+ public TextField setTextProcessor(TextProcessor processor); -+ -+ /** -+ * Fires when this text field is typed into on the screen. -+ * This event will also be sent to the screen listener -+ * @param event -+ */ -+ public void onTextFieldChange(); -+ -+ /** -+ * Fires when the user presses Enter. -+ */ -+ public void onTypingFinished(); -+ -+ /** -+ * Sets the placeholder to text. -+ * The placeholder will be displayed when no text is in the TextField -+ * @param text to set as placeholder -+ * @return textfield -+ */ -+ public TextField setPlaceholder(String text); -+ -+ /** -+ * Gets the placeholder -+ * @return the placeholder -+ */ -+ public String getPlaceholder(); -+} ---- net/minecraft/src/NBTTagCompound.java -+++ net/minecraft/src/NBTTagCompound.java -@@ -9,258 +9,365 @@ - import java.util.Map; - - public class NBTTagCompound extends NBTBase { -- private Map a = new HashMap(); -+ -+ /** -+ * The key-value pairs for the tag. Each key is a UTF string, each value is a tag. -+ */ -+ private Map tagMap = new HashMap(); - - public NBTTagCompound() { - super(""); - } - -- public NBTTagCompound(String var1) { -- super(var1); -+ public NBTTagCompound(String par1Str) { -+ super(par1Str); - } - -- void write(DataOutput var1) throws IOException { -- Iterator var2 = this.a.values().iterator(); -+ /** -+ * Write the actual data contents of the tag, implemented in NBT extension classes -+ */ -+ void write(DataOutput par1DataOutput) throws IOException { -+ Iterator var2 = this.tagMap.values().iterator(); - -- while(var2.hasNext()) { -+ while (var2.hasNext()) { - NBTBase var3 = (NBTBase)var2.next(); -- NBTBase.writeNamedTag(var3, var1); -+ NBTBase.writeNamedTag(var3, par1DataOutput); - } - -- var1.writeByte(0); -+ par1DataOutput.writeByte(0); - } - -- void load(DataInput var1, int var2) throws IOException { -- if(var2 > 512) { -+ /** -+ * Read the actual data contents of the tag, implemented in NBT extension classes -+ */ -+ void load(DataInput par1DataInput, int par2) throws IOException { -+ if (par2 > 512) { - throw new RuntimeException("Tried to read NBT tag with too high complexity, depth > 512"); - } else { -- this.a.clear(); -- -- while(true) { -- NBTBase var3 = NBTBase.func_130104_b(var1, var2 + 1); -- if(var3.getId() == 0) { -- return; -- } -- -- this.a.put(var3.getName(), var3); -+ this.tagMap.clear(); -+ NBTBase var3; -+ -+ while ((var3 = NBTBase.func_130104_b(par1DataInput, par2 + 1)).getId() != 0) { -+ this.tagMap.put(var3.getName(), var3); - } - } - } - -+ /** -+ * Returns all the values in the tagMap HashMap. -+ */ - public Collection getTags() { -- return this.a.values(); -+ return this.tagMap.values(); - } - -+ /** -+ * Gets the type byte for the tag. -+ */ - public byte getId() { - return (byte)10; - } - -- public void setTag(String var1, NBTBase var2) { -- this.a.put(var1, var2.setName(var1)); -- } -- -- public void setByte(String var1, byte var2) { -- this.a.put(var1, new NBTTagByte(var1, var2)); -- } -- -- public void setShort(String var1, short var2) { -- this.a.put(var1, new NBTTagShort(var1, var2)); -- } -- -- public void setInteger(String var1, int var2) { -- this.a.put(var1, new NBTTagInt(var1, var2)); -- } -- -- public void setLong(String var1, long var2) { -- this.a.put(var1, new NBTTagLong(var1, var2)); -- } -- -- public void setFloat(String var1, float var2) { -- this.a.put(var1, new NBTTagFloat(var1, var2)); -- } -- -- public void setDouble(String var1, double var2) { -- this.a.put(var1, new NBTTagDouble(var1, var2)); -- } -- -- public void setString(String var1, String var2) { -- this.a.put(var1, new NBTTagString(var1, var2)); -- } -- -- public void setByteArray(String var1, byte[] var2) { -- this.a.put(var1, new NBTTagByteArray(var1, var2)); -- } -- -- public void setIntArray(String var1, int[] var2) { -- this.a.put(var1, new NBTTagIntArray(var1, var2)); -- } -- -- public void setCompoundTag(String var1, NBTTagCompound var2) { -- this.a.put(var1, var2.setName(var1)); -- } -- -- public void setBoolean(String var1, boolean var2) { -- this.setByte(var1, (byte)(var2 ? 1 : 0)); -- } -- -- public NBTBase getTag(String var1) { -- return (NBTBase)this.a.get(var1); -- } -- -- public boolean hasKey(String var1) { -- return this.a.containsKey(var1); -- } -- -- public byte getByte(String var1) { -- try { -- return !this.a.containsKey(var1) ? 0 : ((NBTTagByte)this.a.get(var1)).data; -- } catch (ClassCastException var3) { -- throw new ReportedException(this.createCrashReport(var1, 1, var3)); -- } -- } -- -- public short getShort(String var1) { -- try { -- return !this.a.containsKey(var1) ? 0 : ((NBTTagShort)this.a.get(var1)).data; -- } catch (ClassCastException var3) { -- throw new ReportedException(this.createCrashReport(var1, 2, var3)); -- } -- } -- -- public int getInteger(String var1) { -- try { -- return !this.a.containsKey(var1) ? 0 : ((NBTTagInt)this.a.get(var1)).data; -- } catch (ClassCastException var3) { -- throw new ReportedException(this.createCrashReport(var1, 3, var3)); -- } -- } -- -- public long getLong(String var1) { -- try { -- return !this.a.containsKey(var1) ? 0L : ((NBTTagLong)this.a.get(var1)).data; -- } catch (ClassCastException var3) { -- throw new ReportedException(this.createCrashReport(var1, 4, var3)); -- } -- } -- -- public float getFloat(String var1) { -- try { -- return !this.a.containsKey(var1) ? 0.0F : ((NBTTagFloat)this.a.get(var1)).data; -- } catch (ClassCastException var3) { -- throw new ReportedException(this.createCrashReport(var1, 5, var3)); -- } -- } -- -- public double getDouble(String var1) { -- try { -- return !this.a.containsKey(var1) ? 0.0D : ((NBTTagDouble)this.a.get(var1)).data; -- } catch (ClassCastException var3) { -- throw new ReportedException(this.createCrashReport(var1, 6, var3)); -- } -- } -- -- public String getString(String var1) { -- try { -- return !this.a.containsKey(var1) ? "" : ((NBTTagString)this.a.get(var1)).a; -- } catch (ClassCastException var3) { -- throw new ReportedException(this.createCrashReport(var1, 8, var3)); -- } -- } -- -- public byte[] getByteArray(String var1) { -- try { -- return !this.a.containsKey(var1) ? new byte[0] : ((NBTTagByteArray)this.a.get(var1)).byteArray; -- } catch (ClassCastException var3) { -- throw new ReportedException(this.createCrashReport(var1, 7, var3)); -- } -- } -- -- public int[] getIntArray(String var1) { -- try { -- return !this.a.containsKey(var1) ? new int[0] : ((NBTTagIntArray)this.a.get(var1)).intArray; -- } catch (ClassCastException var3) { -- throw new ReportedException(this.createCrashReport(var1, 11, var3)); -- } -- } -- -- public NBTTagCompound getCompoundTag(String var1) { -- try { -- return !this.a.containsKey(var1) ? new NBTTagCompound(var1) : (NBTTagCompound)this.a.get(var1); -- } catch (ClassCastException var3) { -- throw new ReportedException(this.createCrashReport(var1, 10, var3)); -- } -- } -- -- public NBTTagList getTagList(String var1) { -- try { -- return !this.a.containsKey(var1) ? new NBTTagList(var1) : (NBTTagList)this.a.get(var1); -- } catch (ClassCastException var3) { -- throw new ReportedException(this.createCrashReport(var1, 9, var3)); -- } -- } -- -- public boolean getBoolean(String var1) { -- return this.getByte(var1) != 0; -- } -- -- public void removeTag(String var1) { -- this.a.remove(var1); -+ /** -+ * Stores the given tag into the map with the given string key. This is mostly used to store tag lists. -+ */ -+ public void setTag(String par1Str, NBTBase par2NBTBase) { -+ this.tagMap.put(par1Str, par2NBTBase.setName(par1Str)); -+ } -+ -+ /** -+ * Stores a new NBTTagByte with the given byte value into the map with the given string key. -+ */ -+ public void setByte(String par1Str, byte par2) { -+ this.tagMap.put(par1Str, new NBTTagByte(par1Str, par2)); -+ } -+ -+ /** -+ * Stores a new NBTTagShort with the given short value into the map with the given string key. -+ */ -+ public void setShort(String par1Str, short par2) { -+ this.tagMap.put(par1Str, new NBTTagShort(par1Str, par2)); -+ } -+ -+ /** -+ * Stores a new NBTTagInt with the given integer value into the map with the given string key. -+ */ -+ public void setInteger(String par1Str, int par2) { -+ this.tagMap.put(par1Str, new NBTTagInt(par1Str, par2)); -+ } -+ -+ /** -+ * Stores a new NBTTagLong with the given long value into the map with the given string key. -+ */ -+ public void setLong(String par1Str, long par2) { -+ this.tagMap.put(par1Str, new NBTTagLong(par1Str, par2)); -+ } -+ -+ /** -+ * Stores a new NBTTagFloat with the given float value into the map with the given string key. -+ */ -+ public void setFloat(String par1Str, float par2) { -+ this.tagMap.put(par1Str, new NBTTagFloat(par1Str, par2)); -+ } -+ -+ /** -+ * Stores a new NBTTagDouble with the given double value into the map with the given string key. -+ */ -+ public void setDouble(String par1Str, double par2) { -+ this.tagMap.put(par1Str, new NBTTagDouble(par1Str, par2)); -+ } -+ -+ /** -+ * Stores a new NBTTagString with the given string value into the map with the given string key. -+ */ -+ public void setString(String par1Str, String par2Str) { -+ this.tagMap.put(par1Str, new NBTTagString(par1Str, par2Str)); -+ } -+ -+ /** -+ * Stores a new NBTTagByteArray with the given array as data into the map with the given string key. -+ */ -+ public void setByteArray(String par1Str, byte[] par2ArrayOfByte) { -+ this.tagMap.put(par1Str, new NBTTagByteArray(par1Str, par2ArrayOfByte)); -+ } -+ -+ /** -+ * Stores a new NBTTagIntArray with the given array as data into the map with the given string key. -+ */ -+ public void setIntArray(String par1Str, int[] par2ArrayOfInteger) { -+ this.tagMap.put(par1Str, new NBTTagIntArray(par1Str, par2ArrayOfInteger)); -+ } -+ -+ /** -+ * Stores the given NBTTagCompound into the map with the given string key. -+ */ -+ public void setCompoundTag(String par1Str, NBTTagCompound par2NBTTagCompound) { -+ this.tagMap.put(par1Str, par2NBTTagCompound.setName(par1Str)); -+ } -+ -+ /** -+ * Stores the given boolean value as a NBTTagByte, storing 1 for true and 0 for false, using the given string key. -+ */ -+ public void setBoolean(String par1Str, boolean par2) { -+ this.setByte(par1Str, (byte)(par2 ? 1 : 0)); -+ } -+ -+ /** -+ * gets a generic tag with the specified name -+ */ -+ public NBTBase getTag(String par1Str) { -+ return (NBTBase)this.tagMap.get(par1Str); -+ } -+ -+ /** -+ * Returns whether the given string has been previously stored as a key in the map. -+ */ -+ public boolean hasKey(String par1Str) { -+ return this.tagMap.containsKey(par1Str); -+ } -+ -+ /** -+ * Retrieves a byte value using the specified key, or 0 if no such key was stored. -+ */ -+ public byte getByte(String par1Str) { -+ try { -+ return !this.tagMap.containsKey(par1Str) ? 0 : ((NBTTagByte)this.tagMap.get(par1Str)).data; -+ } catch (ClassCastException var3) { -+ throw new ReportedException(this.createCrashReport(par1Str, 1, var3)); -+ } -+ } -+ -+ /** -+ * Retrieves a short value using the specified key, or 0 if no such key was stored. -+ */ -+ public short getShort(String par1Str) { -+ try { -+ return !this.tagMap.containsKey(par1Str) ? 0 : ((NBTTagShort)this.tagMap.get(par1Str)).data; -+ } catch (ClassCastException var3) { -+ throw new ReportedException(this.createCrashReport(par1Str, 2, var3)); -+ } -+ } -+ -+ /** -+ * Retrieves an integer value using the specified key, or 0 if no such key was stored. -+ */ -+ public int getInteger(String par1Str) { -+ try { -+ return !this.tagMap.containsKey(par1Str) ? 0 : ((NBTTagInt)this.tagMap.get(par1Str)).data; -+ } catch (ClassCastException var3) { -+ throw new ReportedException(this.createCrashReport(par1Str, 3, var3)); -+ } -+ } -+ -+ /** -+ * Retrieves a long value using the specified key, or 0 if no such key was stored. -+ */ -+ public long getLong(String par1Str) { -+ try { -+ return !this.tagMap.containsKey(par1Str) ? 0L : ((NBTTagLong)this.tagMap.get(par1Str)).data; -+ } catch (ClassCastException var3) { -+ throw new ReportedException(this.createCrashReport(par1Str, 4, var3)); -+ } -+ } -+ -+ /** -+ * Retrieves a float value using the specified key, or 0 if no such key was stored. -+ */ -+ public float getFloat(String par1Str) { -+ try { -+ return !this.tagMap.containsKey(par1Str) ? 0.0F : ((NBTTagFloat)this.tagMap.get(par1Str)).data; -+ } catch (ClassCastException var3) { -+ throw new ReportedException(this.createCrashReport(par1Str, 5, var3)); -+ } -+ } -+ -+ /** -+ * Retrieves a double value using the specified key, or 0 if no such key was stored. -+ */ -+ public double getDouble(String par1Str) { -+ try { -+ return !this.tagMap.containsKey(par1Str) ? 0.0D : ((NBTTagDouble)this.tagMap.get(par1Str)).data; -+ } catch (ClassCastException var3) { -+ throw new ReportedException(this.createCrashReport(par1Str, 6, var3)); -+ } -+ } -+ -+ /** -+ * Retrieves a string value using the specified key, or an empty string if no such key was stored. -+ */ -+ public String getString(String par1Str) { -+ try { -+ return !this.tagMap.containsKey(par1Str) ? "" : ((NBTTagString)this.tagMap.get(par1Str)).data; -+ } catch (ClassCastException var3) { -+ throw new ReportedException(this.createCrashReport(par1Str, 8, var3)); -+ } -+ } -+ -+ /** -+ * Retrieves a byte array using the specified key, or a zero-length array if no such key was stored. -+ */ -+ public byte[] getByteArray(String par1Str) { -+ try { -+ return !this.tagMap.containsKey(par1Str) ? new byte[0] : ((NBTTagByteArray)this.tagMap.get(par1Str)).byteArray; -+ } catch (ClassCastException var3) { -+ throw new ReportedException(this.createCrashReport(par1Str, 7, var3)); -+ } -+ } -+ -+ /** -+ * Retrieves an int array using the specified key, or a zero-length array if no such key was stored. -+ */ -+ public int[] getIntArray(String par1Str) { -+ try { -+ return !this.tagMap.containsKey(par1Str) ? new int[0] : ((NBTTagIntArray)this.tagMap.get(par1Str)).intArray; -+ } catch (ClassCastException var3) { -+ throw new ReportedException(this.createCrashReport(par1Str, 11, var3)); -+ } -+ } -+ -+ /** -+ * Retrieves a NBTTagCompound subtag matching the specified key, or a new empty NBTTagCompound if no such key was -+ * stored. -+ */ -+ public NBTTagCompound getCompoundTag(String par1Str) { -+ try { -+ return !this.tagMap.containsKey(par1Str) ? new NBTTagCompound(par1Str) : (NBTTagCompound)this.tagMap.get(par1Str); -+ } catch (ClassCastException var3) { -+ throw new ReportedException(this.createCrashReport(par1Str, 10, var3)); -+ } -+ } -+ -+ /** -+ * Retrieves a NBTTagList subtag matching the specified key, or a new empty NBTTagList if no such key was stored. -+ */ -+ public NBTTagList getTagList(String par1Str) { -+ try { -+ return !this.tagMap.containsKey(par1Str) ? new NBTTagList(par1Str) : (NBTTagList)this.tagMap.get(par1Str); -+ } catch (ClassCastException var3) { -+ throw new ReportedException(this.createCrashReport(par1Str, 9, var3)); -+ } -+ } -+ -+ /** -+ * Retrieves a boolean value using the specified key, or false if no such key was stored. This uses the getByte method. -+ */ -+ public boolean getBoolean(String par1Str) { -+ return this.getByte(par1Str) != 0; -+ } -+ -+ /** -+ * Remove the specified tag. -+ */ -+ public void removeTag(String par1Str) { -+ this.tagMap.remove(par1Str); - } - - public String toString() { - String var1 = this.getName() + ":["; -- - String var3; -- for(Iterator var2 = this.a.keySet().iterator(); var2.hasNext(); var1 = var1 + var3 + ":" + this.a.get(var3) + ",") { -+ -+ for (Iterator var2 = this.tagMap.keySet().iterator(); var2.hasNext(); var1 = var1 + var3 + ":" + this.tagMap.get(var3) + ",") { - var3 = (String)var2.next(); - } - - return var1 + "]"; - } - -+ /** -+ * Return whether this compound has no tags. -+ */ - public boolean hasNoTags() { -- return this.a.isEmpty(); -+ return this.tagMap.isEmpty(); - } - -- private CrashReport createCrashReport(String var1, int var2, ClassCastException var3) { -- CrashReport var4 = CrashReport.makeCrashReport(var3, "Reading NBT data"); -+ /** -+ * Create a crash report which indicates a NBT read error. -+ */ -+ private CrashReport createCrashReport(String par1Str, int par2, ClassCastException par3ClassCastException) { -+ CrashReport var4 = CrashReport.makeCrashReport(par3ClassCastException, "Reading NBT data"); - CrashReportCategory var5 = var4.makeCategoryDepth("Corrupt NBT tag", 1); -- var5.addCrashSectionCallable("Tag type found", new CallableTagCompound1(this, var1)); -- var5.addCrashSectionCallable("Tag type expected", new CallableTagCompound2(this, var2)); -- var5.addCrashSection("Tag name", var1); -- if(this.getName() != null && this.getName().length() > 0) { -+ var5.addCrashSectionCallable("Tag type found", new CallableTagCompound1(this, par1Str)); -+ var5.addCrashSectionCallable("Tag type expected", new CallableTagCompound2(this, par2)); -+ var5.addCrashSection("Tag name", par1Str); -+ -+ if (this.getName() != null && this.getName().length() > 0) { - var5.addCrashSection("Tag parent", this.getName()); - } - - return var4; - } - -+ /** -+ * Creates a clone of the tag. -+ */ - public NBTBase copy() { - NBTTagCompound var1 = new NBTTagCompound(this.getName()); -- Iterator var2 = this.a.keySet().iterator(); -+ Iterator var2 = this.tagMap.keySet().iterator(); - -- while(var2.hasNext()) { -+ while (var2.hasNext()) { - String var3 = (String)var2.next(); -- var1.setTag(var3, ((NBTBase)this.a.get(var3)).copy()); -+ var1.setTag(var3, ((NBTBase)this.tagMap.get(var3)).copy()); - } - - return var1; - } - -- public boolean equals(Object var1) { -- if(super.equals(var1)) { -- NBTTagCompound var2 = (NBTTagCompound)var1; -- return this.a.entrySet().equals(var2.a.entrySet()); -+ public boolean equals(Object par1Obj) { -+ if (super.equals(par1Obj)) { -+ NBTTagCompound var2 = (NBTTagCompound)par1Obj; -+ return this.tagMap.entrySet().equals(var2.tagMap.entrySet()); - } else { - return false; - } - } - - public int hashCode() { -- return super.hashCode() ^ this.a.hashCode(); -+ return super.hashCode() ^ this.tagMap.hashCode(); - } - -- static Map getTagMap(NBTTagCompound var0) { -- return var0.a; -+ /** -+ * Return the tag map for this compound. -+ */ -+ static Map getTagMap(NBTTagCompound par0NBTTagCompound) { -+ return par0NBTTagCompound.tagMap; - } - } ---- net/minecraft/src/MapStorage.java -+++ net/minecraft/src/MapStorage.java -@@ -1,8 +1,6 @@ - package net.minecraft.src; - --import java.io.DataInput; - import java.io.DataInputStream; --import java.io.DataOutput; - import java.io.DataOutputStream; - import java.io.File; - import java.io.FileInputStream; -@@ -15,28 +13,42 @@ - - public class MapStorage { - private ISaveHandler saveHandler; -- private Map b = new HashMap(); -- private List c = new ArrayList(); -- private Map d = new HashMap(); -- -- public MapStorage(ISaveHandler var1) { -- this.saveHandler = var1; -+ -+ /** Map of item data String id to loaded MapDataBases */ -+ private Map loadedDataMap = new HashMap(); -+ -+ /** List of loaded MapDataBases. */ -+ private List loadedDataList = new ArrayList(); -+ -+ /** -+ * Map of MapDataBase id String prefixes ('map' etc) to max known unique Short id (the 0 part etc) for that prefix -+ */ -+ private Map idCounts = new HashMap(); -+ -+ public MapStorage(ISaveHandler par1ISaveHandler) { -+ this.saveHandler = par1ISaveHandler; - this.loadIdCounts(); - } - -- public WorldSavedData loadData(Class var1, String var2) { -- WorldSavedData var3 = (WorldSavedData)this.b.get(var2); -- if(var3 != null) { -+ /** -+ * Loads an existing MapDataBase corresponding to the given String id from disk, instantiating the given Class, or -+ * returns null if none such file exists. args: Class to instantiate, String dataid -+ */ -+ public WorldSavedData loadData(Class par1Class, String par2Str) { -+ WorldSavedData var3 = (WorldSavedData)this.loadedDataMap.get(par2Str); -+ -+ if (var3 != null) { - return var3; - } else { -- if(this.saveHandler != null) { -+ if (this.saveHandler != null) { - try { -- File var4 = this.saveHandler.getMapFileFromName(var2); -- if(var4 != null && var4.exists()) { -+ File var4 = this.saveHandler.getMapFileFromName(par2Str); -+ -+ if (var4 != null && var4.exists()) { - try { -- var3 = (WorldSavedData)var1.getConstructor(new Class[]{String.class}).newInstance(new Object[]{var2}); -+ var3 = (WorldSavedData)par1Class.getConstructor(new Class[] {String.class}).newInstance(new Object[] {par2Str}); - } catch (Exception var7) { -- throw new RuntimeException("Failed to instantiate " + var1.toString(), var7); -+ throw new RuntimeException("Failed to instantiate " + par1Class.toString(), var7); - } - - FileInputStream var5 = new FileInputStream(var4); -@@ -49,46 +61,56 @@ - } - } - -- if(var3 != null) { -- this.b.put(var2, var3); -- this.c.add(var3); -+ if (var3 != null) { -+ this.loadedDataMap.put(par2Str, var3); -+ this.loadedDataList.add(var3); - } - - return var3; - } - } - -- public void setData(String var1, WorldSavedData var2) { -- if(var2 == null) { -+ /** -+ * Assigns the given String id to the given MapDataBase, removing any existing ones of the same id. -+ */ -+ public void setData(String par1Str, WorldSavedData par2WorldSavedData) { -+ if (par2WorldSavedData == null) { - throw new RuntimeException("Can\'t set null data"); - } else { -- if(this.b.containsKey(var1)) { -- this.c.remove(this.b.remove(var1)); -+ if (this.loadedDataMap.containsKey(par1Str)) { -+ this.loadedDataList.remove(this.loadedDataMap.remove(par1Str)); - } - -- this.b.put(var1, var2); -- this.c.add(var2); -+ this.loadedDataMap.put(par1Str, par2WorldSavedData); -+ this.loadedDataList.add(par2WorldSavedData); - } - } - -+ /** -+ * Saves all dirty loaded MapDataBases to disk. -+ */ - public void saveAllData() { -- for(int var1 = 0; var1 < this.c.size(); ++var1) { -- WorldSavedData var2 = (WorldSavedData)this.c.get(var1); -- if(var2.isDirty()) { -+ for (int var1 = 0; var1 < this.loadedDataList.size(); ++var1) { -+ WorldSavedData var2 = (WorldSavedData)this.loadedDataList.get(var1); -+ -+ if (var2.isDirty()) { - this.saveData(var2); - var2.setDirty(false); - } - } -- - } - -- private void saveData(WorldSavedData var1) { -- if(this.saveHandler != null) { -+ /** -+ * Saves the given MapDataBase to disk. -+ */ -+ private void saveData(WorldSavedData par1WorldSavedData) { -+ if (this.saveHandler != null) { - try { -- File var2 = this.saveHandler.getMapFileFromName(var1.h); -- if(var2 != null) { -+ File var2 = this.saveHandler.getMapFileFromName(par1WorldSavedData.mapName); -+ -+ if (var2 != null) { - NBTTagCompound var3 = new NBTTagCompound(); -- var1.writeToNBT(var3); -+ par1WorldSavedData.writeToNBT(var3); - NBTTagCompound var4 = new NBTTagCompound(); - var4.setCompoundTag("data", var3); - FileOutputStream var5 = new FileOutputStream(var2); -@@ -98,66 +120,76 @@ - } catch (Exception var6) { - var6.printStackTrace(); - } -- - } - } - -+ /** -+ * Loads the idCounts Map from the 'idcounts' file. -+ */ - private void loadIdCounts() { - try { -- this.d.clear(); -- if(this.saveHandler == null) { -+ this.idCounts.clear(); -+ -+ if (this.saveHandler == null) { - return; - } - - File var1 = this.saveHandler.getMapFileFromName("idcounts"); -- if(var1 != null && var1.exists()) { -+ -+ if (var1 != null && var1.exists()) { - DataInputStream var2 = new DataInputStream(new FileInputStream(var1)); -- NBTTagCompound var3 = CompressedStreamTools.read((DataInput)var2); -+ NBTTagCompound var3 = CompressedStreamTools.read(var2); - var2.close(); - Iterator var4 = var3.getTags().iterator(); - -- while(var4.hasNext()) { -+ while (var4.hasNext()) { - NBTBase var5 = (NBTBase)var4.next(); -- if(var5 instanceof NBTTagShort) { -+ -+ if (var5 instanceof NBTTagShort) { - NBTTagShort var6 = (NBTTagShort)var5; - String var7 = var6.getName(); - short var8 = var6.data; -- this.d.put(var7, Short.valueOf(var8)); -+ this.idCounts.put(var7, Short.valueOf(var8)); - } - } - } - } catch (Exception var9) { - var9.printStackTrace(); - } -- - } - -- public int getUniqueDataId(String var1) { -- Short var2 = (Short)this.d.get(var1); -- if(var2 == null) { -+ /** -+ * Returns an unique new data id for the given prefix and saves the idCounts map to the 'idcounts' file. -+ */ -+ public int getUniqueDataId(String par1Str) { -+ Short var2 = (Short)this.idCounts.get(par1Str); -+ -+ if (var2 == null) { - var2 = Short.valueOf((short)0); - } else { - var2 = Short.valueOf((short)(var2.shortValue() + 1)); - } - -- this.d.put(var1, var2); -- if(this.saveHandler == null) { -+ this.idCounts.put(par1Str, var2); -+ -+ if (this.saveHandler == null) { - return var2.shortValue(); - } else { - try { - File var3 = this.saveHandler.getMapFileFromName("idcounts"); -- if(var3 != null) { -+ -+ if (var3 != null) { - NBTTagCompound var4 = new NBTTagCompound(); -- Iterator var5 = this.d.keySet().iterator(); -+ Iterator var5 = this.idCounts.keySet().iterator(); - -- while(var5.hasNext()) { -+ while (var5.hasNext()) { - String var6 = (String)var5.next(); -- short var7 = ((Short)this.d.get(var6)).shortValue(); -+ short var7 = ((Short)this.idCounts.get(var6)).shortValue(); - var4.setShort(var6, var7); - } - - DataOutputStream var9 = new DataOutputStream(new FileOutputStream(var3)); -- CompressedStreamTools.write(var4, (DataOutput)var9); -+ CompressedStreamTools.write(var4, var9); - var9.close(); - } - } catch (Exception var8) { ---- /dev/null -+++ org/spoutcraft/client/gui/settings/controls/FancyCloudsButton.java -@@ -1,0 +1,41 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.client.gui.settings.controls; -+ -+import java.util.UUID; -+ -+import org.spoutcraft.client.config.Configuration; -+ -+public class FancyCloudsButton extends AutomatedCheckBox { -+ UUID fancyGraphics; -+ public FancyCloudsButton(UUID fancyGraphics) { -+ super("Fancy Clouds"); -+ this.fancyGraphics = fancyGraphics; -+ setChecked(Configuration.isFancyClouds()); -+ setTooltip("Clouds\nFast - lower quality, faster\nFancy - higher quality, slower\nFast clouds are rendered 2D.\nFancy clouds are rendered 3D."); -+ } -+ -+ @Override -+ public void onButtonClick() { -+ Configuration.setFancyClouds(!Configuration.isFancyClouds()); -+ Configuration.write(); -+ ((FancyGraphicsButton)getScreen().getWidget(fancyGraphics)).custom = true; -+ } -+} ---- net/minecraft/src/BlockLog.java -+++ net/minecraft/src/BlockLog.java -@@ -4,71 +4,100 @@ - import java.util.Random; - - public class BlockLog extends BlockRotatedPillar { -- public static final String[] b = new String[]{"oak", "spruce", "birch", "jungle"}; -+ -+ /** The type of tree this log came from. */ -+ public static final String[] woodType = new String[] {"oak", "spruce", "birch", "jungle"}; - private Icon[] field_111052_c; - private Icon[] tree_top; - -- protected BlockLog(int var1) { -- super(var1, Material.wood); -+ protected BlockLog(int par1) { -+ super(par1, Material.wood); - this.setCreativeTab(CreativeTabs.tabBlock); - } - -- public int quantityDropped(Random var1) { -+ /** -+ * Returns the quantity of items to drop on block destruction. -+ */ -+ public int quantityDropped(Random par1Random) { - return 1; - } - -- public int idDropped(int var1, Random var2, int var3) { -+ /** -+ * Returns the ID of the items to drop on destruction. -+ */ -+ public int idDropped(int par1, Random par2Random, int par3) { - return Block.wood.blockID; - } - -- public void breakBlock(World var1, int var2, int var3, int var4, int var5, int var6) { -+ /** -+ * Called on server worlds only when the block has been replaced by a different block ID, or the same block with a -+ * different metadata value, but before the new metadata value is set. Args: World, x, y, z, old block ID, old metadata -+ */ -+ public void breakBlock(World par1World, int par2, int par3, int par4, int par5, int par6) { - byte var7 = 4; - int var8 = var7 + 1; -- if(var1.checkChunksExist(var2 - var8, var3 - var8, var4 - var8, var2 + var8, var3 + var8, var4 + var8)) { -- for(int var9 = -var7; var9 <= var7; ++var9) { -- for(int var10 = -var7; var10 <= var7; ++var10) { -- for(int var11 = -var7; var11 <= var7; ++var11) { -- int var12 = var1.getBlockId(var2 + var9, var3 + var10, var4 + var11); -- if(var12 == Block.leaves.blockID) { -- int var13 = var1.getBlockMetadata(var2 + var9, var3 + var10, var4 + var11); -- if((var13 & 8) == 0) { -- var1.setBlockMetadata(var2 + var9, var3 + var10, var4 + var11, var13 | 8, 4); -+ -+ if (par1World.checkChunksExist(par2 - var8, par3 - var8, par4 - var8, par2 + var8, par3 + var8, par4 + var8)) { -+ for (int var9 = -var7; var9 <= var7; ++var9) { -+ for (int var10 = -var7; var10 <= var7; ++var10) { -+ for (int var11 = -var7; var11 <= var7; ++var11) { -+ int var12 = par1World.getBlockId(par2 + var9, par3 + var10, par4 + var11); -+ -+ if (var12 == Block.leaves.blockID) { -+ int var13 = par1World.getBlockMetadata(par2 + var9, par3 + var10, par4 + var11); -+ -+ if ((var13 & 8) == 0) { -+ par1World.setBlockMetadataWithNotify(par2 + var9, par3 + var10, par4 + var11, var13 | 8, 4); - } - } - } - } - } - } -- -- } -- -- protected Icon getSideIcon(int var1) { -- return this.field_111052_c[var1]; -- } -- -- protected Icon getEndIcon(int var1) { -- return this.tree_top[var1]; -- } -- -- public static int limitToValidMetadata(int var0) { -- return var0 & 3; -- } -- -- public void getSubBlocks(int var1, CreativeTabs var2, List var3) { -- var3.add(new ItemStack(var1, 1, 0)); -- var3.add(new ItemStack(var1, 1, 1)); -- var3.add(new ItemStack(var1, 1, 2)); -- var3.add(new ItemStack(var1, 1, 3)); -- } -- -- public void registerIcons(IconRegister var1) { -- this.field_111052_c = new Icon[b.length]; -- this.tree_top = new Icon[b.length]; -- -- for(int var2 = 0; var2 < this.field_111052_c.length; ++var2) { -- this.field_111052_c[var2] = var1.registerIcon(this.getTextureName() + "_" + b[var2]); -- this.tree_top[var2] = var1.registerIcon(this.getTextureName() + "_" + b[var2] + "_top"); -+ } -+ -+ /** -+ * The icon for the side of the block. -+ */ -+ protected Icon getSideIcon(int par1) { -+ return this.field_111052_c[par1]; -+ } -+ -+ /** -+ * The icon for the tops and bottoms of the block. -+ */ -+ protected Icon getEndIcon(int par1) { -+ return this.tree_top[par1]; -+ } -+ -+ /** -+ * returns a number between 0 and 3 -+ */ -+ public static int limitToValidMetadata(int par0) { -+ return par0 & 3; -+ } -+ -+ /** -+ * returns a list of blocks with the same ID, but different meta (eg: wood returns 4 blocks) -+ */ -+ public void getSubBlocks(int par1, CreativeTabs par2CreativeTabs, List par3List) { -+ par3List.add(new ItemStack(par1, 1, 0)); -+ par3List.add(new ItemStack(par1, 1, 1)); -+ par3List.add(new ItemStack(par1, 1, 2)); -+ par3List.add(new ItemStack(par1, 1, 3)); -+ } -+ -+ /** -+ * When this method is called, your block should register all the icons it needs with the given IconRegister. This is -+ * the only chance you get to register icons. -+ */ -+ public void registerIcons(IconRegister par1IconRegister) { -+ this.field_111052_c = new Icon[woodType.length]; -+ this.tree_top = new Icon[woodType.length]; -+ -+ for (int var2 = 0; var2 < this.field_111052_c.length; ++var2) { -+ this.field_111052_c[var2] = par1IconRegister.registerIcon(this.getTextureName() + "_" + woodType[var2]); -+ this.tree_top[var2] = par1IconRegister.registerIcon(this.getTextureName() + "_" + woodType[var2] + "_top"); - } -- - } - } ---- /dev/null -+++ org/spoutcraft/client/gui/settings/controls/TimeButton.java -@@ -1,0 +1,58 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.client.gui.settings.controls; -+ -+import org.spoutcraft.api.gui.GenericButton; -+import org.spoutcraft.client.SpoutClient; -+import org.spoutcraft.client.config.Configuration; -+ -+public class TimeButton extends GenericButton { -+ public TimeButton() { -+ setEnabled(SpoutClient.getInstance().isTimeCheat()); -+ setTooltip("Time\nDefault - normal day/night cycles\nDay Only - day only\nNight Only - night only"); -+ } -+ -+ @Override -+ public String getText() { -+ switch(Configuration.getTime()) { -+ case 0: return "Time: Default"; -+ case 1: return "Time: Night"; -+ case 2: return "Time: Day"; -+ } -+ return "Unknown State: " + Configuration.getTime(); -+ } -+ -+ @Override -+ public String getTooltip() { -+ if (!isEnabled()) { -+ return "This option is not allowed by your server, it is considered cheating."; -+ } -+ return super.getTooltip(); -+ } -+ -+ @Override -+ public void onButtonClick() { -+ Configuration.setTime(Configuration.getTime() + 1); -+ if (Configuration.getTime() > 2) { -+ Configuration.setTime(0); -+ } -+ Configuration.write(); -+ } -+} ---- net/minecraft/src/CallableParticlePositionInfo.java -+++ net/minecraft/src/CallableParticlePositionInfo.java -@@ -4,15 +4,18 @@ - - class CallableParticlePositionInfo implements Callable { - final double posX; -+ - final double posY; -+ - final double posZ; -+ - final RenderGlobal globalRenderer; - -- CallableParticlePositionInfo(RenderGlobal var1, double var2, double var4, double var6) { -- this.globalRenderer = var1; -- this.posX = var2; -- this.posY = var4; -- this.posZ = var6; -+ CallableParticlePositionInfo(RenderGlobal par1RenderGlobal, double par2, double par4, double par6) { -+ this.globalRenderer = par1RenderGlobal; -+ this.posX = par2; -+ this.posY = par4; -+ this.posZ = par6; - } - - public String callParticlePositionInfo() { ---- net/minecraft/src/MaterialLogic.java -+++ net/minecraft/src/MaterialLogic.java -@@ -1,8 +1,8 @@ - package net.minecraft.src; - - public class MaterialLogic extends Material { -- public MaterialLogic(MapColor var1) { -- super(var1); -+ public MaterialLogic(MapColor par1MapColor) { -+ super(par1MapColor); - this.setAdventureModeExempt(); - } - -@@ -10,10 +10,16 @@ - return false; - } - -+ /** -+ * Will prevent grass from growing on dirt underneath and kill any grass below it if it returns true -+ */ - public boolean getCanBlockGrass() { - return false; - } - -+ /** -+ * Returns if this material is considered solid or not -+ */ - public boolean blocksMovement() { - return false; - } ---- net/minecraft/src/ModelRenderer.java -+++ net/minecraft/src/ModelRenderer.java -@@ -5,9 +5,17 @@ - import org.lwjgl.opengl.GL11; - - public class ModelRenderer { -+ -+ /** The size of the texture file's width in pixels. */ - public float textureWidth; -+ -+ /** The size of the texture file's height in pixels. */ - public float textureHeight; -+ -+ /** The X offset into the texture used for displaying this model */ - private int textureOffsetX; -+ -+ /** The Y offset into the texture used for displaying this model */ - private int textureOffsetY; - public float rotationPointX; - public float rotationPointY; -@@ -16,122 +24,137 @@ - public float rotateAngleY; - public float rotateAngleZ; - private boolean compiled; -+ -+ /** The GL display list rendered by the Tessellator for this model */ - private int displayList; - public boolean mirror; - public boolean showModel; -+ -+ /** Hides the model. */ - public boolean isHidden; -- public List l; -- public List m; -- public final String n; -+ public List cubeList; -+ public List childModels; -+ public final String boxName; - private ModelBase baseModel; - public float offsetX; - public float offsetY; - public float offsetZ; - -- public ModelRenderer(ModelBase var1, String var2) { -+ public ModelRenderer(ModelBase par1ModelBase, String par2Str) { - this.textureWidth = 64.0F; - this.textureHeight = 32.0F; - this.showModel = true; -- this.l = new ArrayList(); -- this.baseModel = var1; -- var1.r.add(this); -- this.n = var2; -- this.setTextureSize(var1.textureWidth, var1.textureHeight); -- } -- -- public ModelRenderer(ModelBase var1) { -- this(var1, (String)null); -- } -- -- public ModelRenderer(ModelBase var1, int var2, int var3) { -- this(var1); -- this.setTextureOffset(var2, var3); -- } -- -- public void addChild(ModelRenderer var1) { -- if(this.m == null) { -- this.m = new ArrayList(); -+ this.cubeList = new ArrayList(); -+ this.baseModel = par1ModelBase; -+ par1ModelBase.boxList.add(this); -+ this.boxName = par2Str; -+ this.setTextureSize(par1ModelBase.textureWidth, par1ModelBase.textureHeight); -+ } -+ -+ public ModelRenderer(ModelBase par1ModelBase) { -+ this(par1ModelBase, (String)null); -+ } -+ -+ public ModelRenderer(ModelBase par1ModelBase, int par2, int par3) { -+ this(par1ModelBase); -+ this.setTextureOffset(par2, par3); -+ } -+ -+ /** -+ * Sets the current box's rotation points and rotation angles to another box. -+ */ -+ public void addChild(ModelRenderer par1ModelRenderer) { -+ if (this.childModels == null) { -+ this.childModels = new ArrayList(); - } - -- this.m.add(var1); -+ this.childModels.add(par1ModelRenderer); - } - -- public ModelRenderer setTextureOffset(int var1, int var2) { -- this.textureOffsetX = var1; -- this.textureOffsetY = var2; -+ public ModelRenderer setTextureOffset(int par1, int par2) { -+ this.textureOffsetX = par1; -+ this.textureOffsetY = par2; - return this; - } - -- public ModelRenderer addBox(String var1, float var2, float var3, float var4, int var5, int var6, int var7) { -- var1 = this.n + "." + var1; -- TextureOffset var8 = this.baseModel.getTextureOffset(var1); -+ public ModelRenderer addBox(String par1Str, float par2, float par3, float par4, int par5, int par6, int par7) { -+ par1Str = this.boxName + "." + par1Str; -+ TextureOffset var8 = this.baseModel.getTextureOffset(par1Str); - this.setTextureOffset(var8.textureOffsetX, var8.textureOffsetY); -- this.l.add((new ModelBox(this, this.textureOffsetX, this.textureOffsetY, var2, var3, var4, var5, var6, var7, 0.0F)).func_78244_a(var1)); -- return this; -- } -- -- public ModelRenderer addBox(float var1, float var2, float var3, int var4, int var5, int var6) { -- this.l.add(new ModelBox(this, this.textureOffsetX, this.textureOffsetY, var1, var2, var3, var4, var5, var6, 0.0F)); -- return this; -- } -- -- public void addBox(float var1, float var2, float var3, int var4, int var5, int var6, float var7) { -- this.l.add(new ModelBox(this, this.textureOffsetX, this.textureOffsetY, var1, var2, var3, var4, var5, var6, var7)); -- } -- -- public void setRotationPoint(float var1, float var2, float var3) { -- this.rotationPointX = var1; -- this.rotationPointY = var2; -- this.rotationPointZ = var3; -- } -- -- public void render(float var1) { -- if(!this.isHidden) { -- if(this.showModel) { -- if(!this.compiled) { -- this.compileDisplayList(var1); -+ this.cubeList.add((new ModelBox(this, this.textureOffsetX, this.textureOffsetY, par2, par3, par4, par5, par6, par7, 0.0F)).func_78244_a(par1Str)); -+ return this; -+ } -+ -+ public ModelRenderer addBox(float par1, float par2, float par3, int par4, int par5, int par6) { -+ this.cubeList.add(new ModelBox(this, this.textureOffsetX, this.textureOffsetY, par1, par2, par3, par4, par5, par6, 0.0F)); -+ return this; -+ } -+ -+ /** -+ * Creates a textured box. Args: originX, originY, originZ, width, height, depth, scaleFactor. -+ */ -+ public void addBox(float par1, float par2, float par3, int par4, int par5, int par6, float par7) { -+ this.cubeList.add(new ModelBox(this, this.textureOffsetX, this.textureOffsetY, par1, par2, par3, par4, par5, par6, par7)); -+ } -+ -+ public void setRotationPoint(float par1, float par2, float par3) { -+ this.rotationPointX = par1; -+ this.rotationPointY = par2; -+ this.rotationPointZ = par3; -+ } -+ -+ public void render(float par1) { -+ if (!this.isHidden) { -+ if (this.showModel) { -+ if (!this.compiled) { -+ this.compileDisplayList(par1); - } - - GL11.glTranslatef(this.offsetX, this.offsetY, this.offsetZ); - int var2; -- if(this.rotateAngleX == 0.0F && this.rotateAngleY == 0.0F && this.rotateAngleZ == 0.0F) { -- if(this.rotationPointX == 0.0F && this.rotationPointY == 0.0F && this.rotationPointZ == 0.0F) { -+ -+ if (this.rotateAngleX == 0.0F && this.rotateAngleY == 0.0F && this.rotateAngleZ == 0.0F) { -+ if (this.rotationPointX == 0.0F && this.rotationPointY == 0.0F && this.rotationPointZ == 0.0F) { - GL11.glCallList(this.displayList); -- if(this.m != null) { -- for(var2 = 0; var2 < this.m.size(); ++var2) { -- ((ModelRenderer)this.m.get(var2)).render(var1); -+ -+ if (this.childModels != null) { -+ for (var2 = 0; var2 < this.childModels.size(); ++var2) { -+ ((ModelRenderer)this.childModels.get(var2)).render(par1); - } - } - } else { -- GL11.glTranslatef(this.rotationPointX * var1, this.rotationPointY * var1, this.rotationPointZ * var1); -+ GL11.glTranslatef(this.rotationPointX * par1, this.rotationPointY * par1, this.rotationPointZ * par1); - GL11.glCallList(this.displayList); -- if(this.m != null) { -- for(var2 = 0; var2 < this.m.size(); ++var2) { -- ((ModelRenderer)this.m.get(var2)).render(var1); -+ -+ if (this.childModels != null) { -+ for (var2 = 0; var2 < this.childModels.size(); ++var2) { -+ ((ModelRenderer)this.childModels.get(var2)).render(par1); - } - } - -- GL11.glTranslatef(-this.rotationPointX * var1, -this.rotationPointY * var1, -this.rotationPointZ * var1); -+ GL11.glTranslatef(-this.rotationPointX * par1, -this.rotationPointY * par1, -this.rotationPointZ * par1); - } - } else { - GL11.glPushMatrix(); -- GL11.glTranslatef(this.rotationPointX * var1, this.rotationPointY * var1, this.rotationPointZ * var1); -- if(this.rotateAngleZ != 0.0F) { -- GL11.glRotatef(this.rotateAngleZ * (180.0F / (float)Math.PI), 0.0F, 0.0F, 1.0F); -- } -- -- if(this.rotateAngleY != 0.0F) { -- GL11.glRotatef(this.rotateAngleY * (180.0F / (float)Math.PI), 0.0F, 1.0F, 0.0F); -- } -- -- if(this.rotateAngleX != 0.0F) { -- GL11.glRotatef(this.rotateAngleX * (180.0F / (float)Math.PI), 1.0F, 0.0F, 0.0F); -+ GL11.glTranslatef(this.rotationPointX * par1, this.rotationPointY * par1, this.rotationPointZ * par1); -+ -+ if (this.rotateAngleZ != 0.0F) { -+ GL11.glRotatef(this.rotateAngleZ * (180F / (float)Math.PI), 0.0F, 0.0F, 1.0F); -+ } -+ -+ if (this.rotateAngleY != 0.0F) { -+ GL11.glRotatef(this.rotateAngleY * (180F / (float)Math.PI), 0.0F, 1.0F, 0.0F); -+ } -+ -+ if (this.rotateAngleX != 0.0F) { -+ GL11.glRotatef(this.rotateAngleX * (180F / (float)Math.PI), 1.0F, 0.0F, 0.0F); - } - - GL11.glCallList(this.displayList); -- if(this.m != null) { -- for(var2 = 0; var2 < this.m.size(); ++var2) { -- ((ModelRenderer)this.m.get(var2)).render(var1); -+ -+ if (this.childModels != null) { -+ for (var2 = 0; var2 < this.childModels.size(); ++var2) { -+ ((ModelRenderer)this.childModels.get(var2)).render(par1); - } - } - -@@ -143,25 +166,26 @@ - } - } - -- public void renderWithRotation(float var1) { -- if(!this.isHidden) { -- if(this.showModel) { -- if(!this.compiled) { -- this.compileDisplayList(var1); -+ public void renderWithRotation(float par1) { -+ if (!this.isHidden) { -+ if (this.showModel) { -+ if (!this.compiled) { -+ this.compileDisplayList(par1); - } - - GL11.glPushMatrix(); -- GL11.glTranslatef(this.rotationPointX * var1, this.rotationPointY * var1, this.rotationPointZ * var1); -- if(this.rotateAngleY != 0.0F) { -- GL11.glRotatef(this.rotateAngleY * (180.0F / (float)Math.PI), 0.0F, 1.0F, 0.0F); -- } -- -- if(this.rotateAngleX != 0.0F) { -- GL11.glRotatef(this.rotateAngleX * (180.0F / (float)Math.PI), 1.0F, 0.0F, 0.0F); -- } -- -- if(this.rotateAngleZ != 0.0F) { -- GL11.glRotatef(this.rotateAngleZ * (180.0F / (float)Math.PI), 0.0F, 0.0F, 1.0F); -+ GL11.glTranslatef(this.rotationPointX * par1, this.rotationPointY * par1, this.rotationPointZ * par1); -+ -+ if (this.rotateAngleY != 0.0F) { -+ GL11.glRotatef(this.rotateAngleY * (180F / (float)Math.PI), 0.0F, 1.0F, 0.0F); -+ } -+ -+ if (this.rotateAngleX != 0.0F) { -+ GL11.glRotatef(this.rotateAngleX * (180F / (float)Math.PI), 1.0F, 0.0F, 0.0F); -+ } -+ -+ if (this.rotateAngleZ != 0.0F) { -+ GL11.glRotatef(this.rotateAngleZ * (180F / (float)Math.PI), 0.0F, 0.0F, 1.0F); - } - - GL11.glCallList(this.displayList); -@@ -170,52 +194,61 @@ - } - } - -- public void postRender(float var1) { -- if(!this.isHidden) { -- if(this.showModel) { -- if(!this.compiled) { -- this.compileDisplayList(var1); -+ /** -+ * Allows the changing of Angles after a box has been rendered -+ */ -+ public void postRender(float par1) { -+ if (!this.isHidden) { -+ if (this.showModel) { -+ if (!this.compiled) { -+ this.compileDisplayList(par1); - } - -- if(this.rotateAngleX == 0.0F && this.rotateAngleY == 0.0F && this.rotateAngleZ == 0.0F) { -- if(this.rotationPointX != 0.0F || this.rotationPointY != 0.0F || this.rotationPointZ != 0.0F) { -- GL11.glTranslatef(this.rotationPointX * var1, this.rotationPointY * var1, this.rotationPointZ * var1); -+ if (this.rotateAngleX == 0.0F && this.rotateAngleY == 0.0F && this.rotateAngleZ == 0.0F) { -+ if (this.rotationPointX != 0.0F || this.rotationPointY != 0.0F || this.rotationPointZ != 0.0F) { -+ GL11.glTranslatef(this.rotationPointX * par1, this.rotationPointY * par1, this.rotationPointZ * par1); - } - } else { -- GL11.glTranslatef(this.rotationPointX * var1, this.rotationPointY * var1, this.rotationPointZ * var1); -- if(this.rotateAngleZ != 0.0F) { -- GL11.glRotatef(this.rotateAngleZ * (180.0F / (float)Math.PI), 0.0F, 0.0F, 1.0F); -- } -- -- if(this.rotateAngleY != 0.0F) { -- GL11.glRotatef(this.rotateAngleY * (180.0F / (float)Math.PI), 0.0F, 1.0F, 0.0F); -- } -- -- if(this.rotateAngleX != 0.0F) { -- GL11.glRotatef(this.rotateAngleX * (180.0F / (float)Math.PI), 1.0F, 0.0F, 0.0F); -+ GL11.glTranslatef(this.rotationPointX * par1, this.rotationPointY * par1, this.rotationPointZ * par1); -+ -+ if (this.rotateAngleZ != 0.0F) { -+ GL11.glRotatef(this.rotateAngleZ * (180F / (float)Math.PI), 0.0F, 0.0F, 1.0F); -+ } -+ -+ if (this.rotateAngleY != 0.0F) { -+ GL11.glRotatef(this.rotateAngleY * (180F / (float)Math.PI), 0.0F, 1.0F, 0.0F); -+ } -+ -+ if (this.rotateAngleX != 0.0F) { -+ GL11.glRotatef(this.rotateAngleX * (180F / (float)Math.PI), 1.0F, 0.0F, 0.0F); - } - } -- - } - } - } - -- private void compileDisplayList(float var1) { -+ /** -+ * Compiles a GL display list for this model -+ */ -+ private void compileDisplayList(float par1) { - this.displayList = GLAllocation.generateDisplayLists(1); - GL11.glNewList(this.displayList, GL11.GL_COMPILE); - Tessellator var2 = Tessellator.instance; - -- for(int var3 = 0; var3 < this.l.size(); ++var3) { -- ((ModelBox)this.l.get(var3)).render(var2, var1); -+ for (int var3 = 0; var3 < this.cubeList.size(); ++var3) { -+ ((ModelBox)this.cubeList.get(var3)).render(var2, par1); - } - - GL11.glEndList(); - this.compiled = true; - } - -- public ModelRenderer setTextureSize(int var1, int var2) { -- this.textureWidth = (float)var1; -- this.textureHeight = (float)var2; -+ /** -+ * Returns the model renderer with the new texture parameters. -+ */ -+ public ModelRenderer setTextureSize(int par1, int par2) { -+ this.textureWidth = (float)par1; -+ this.textureHeight = (float)par2; - return this; - } - } ---- net/minecraft/src/PlayerUsageSnooperThread.java -+++ net/minecraft/src/PlayerUsageSnooperThread.java -@@ -1,26 +1,27 @@ - package net.minecraft.src; - - import java.util.HashMap; --import java.util.Map; - import java.util.TimerTask; - - class PlayerUsageSnooperThread extends TimerTask { -+ -+ /** The PlayerUsageSnooper object. */ - final PlayerUsageSnooper snooper; - -- PlayerUsageSnooperThread(PlayerUsageSnooper var1) { -- this.snooper = var1; -+ PlayerUsageSnooperThread(PlayerUsageSnooper par1PlayerUsageSnooper) { -+ this.snooper = par1PlayerUsageSnooper; - } - - public void run() { -- if(PlayerUsageSnooper.getStatsCollectorFor(this.snooper).isSnooperEnabled()) { -- Object var2 = PlayerUsageSnooper.getSyncLockFor(this.snooper); -+ if (PlayerUsageSnooper.getStatsCollectorFor(this.snooper).isSnooperEnabled()) { - HashMap var1; -- synchronized(var2) { -+ -+ synchronized (PlayerUsageSnooper.getSyncLockFor(this.snooper)) { - var1 = new HashMap(PlayerUsageSnooper.getDataMapFor(this.snooper)); - var1.put("snooper_count", Integer.valueOf(PlayerUsageSnooper.getSelfCounterFor(this.snooper))); - } - -- HttpUtil.sendPost(PlayerUsageSnooper.getStatsCollectorFor(this.snooper).getLogAgent(), PlayerUsageSnooper.getServerUrlFor(this.snooper), (Map)var1, true); -+ HttpUtil.sendPost(PlayerUsageSnooper.getStatsCollectorFor(this.snooper).getLogAgent(), PlayerUsageSnooper.getServerUrlFor(this.snooper), var1, true); - } - } - } ---- net/minecraft/src/CallableTagCompound1.java -+++ net/minecraft/src/CallableTagCompound1.java -@@ -3,16 +3,17 @@ - import java.util.concurrent.Callable; - - class CallableTagCompound1 implements Callable { -- final String a; -+ final String field_82585_a; -+ - final NBTTagCompound theNBTTagCompound; - -- CallableTagCompound1(NBTTagCompound var1, String var2) { -- this.theNBTTagCompound = var1; -- this.a = var2; -+ CallableTagCompound1(NBTTagCompound par1NBTTagCompound, String par2Str) { -+ this.theNBTTagCompound = par1NBTTagCompound; -+ this.field_82585_a = par2Str; - } - - public String func_82583_a() { -- return NBTBase.b[((NBTBase)NBTTagCompound.getTagMap(this.theNBTTagCompound).get(this.a)).getId()]; -+ return NBTBase.NBTTypes[((NBTBase)NBTTagCompound.getTagMap(this.theNBTTagCompound).get(this.field_82585_a)).getId()]; - } - - public Object call() { ---- /dev/null -+++ org/spoutcraft/api/Client.java -@@ -1,0 +1,79 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.api; -+ -+import java.io.File; -+import java.util.logging.Logger; -+ -+import org.spoutcraft.api.gui.RenderDelegate; -+import org.spoutcraft.api.gui.WidgetManager; -+import org.spoutcraft.api.inventory.MaterialManager; -+import org.spoutcraft.api.keyboard.KeyBindingManager; -+import org.spoutcraft.api.player.BiomeManager; -+import org.spoutcraft.api.player.SkyManager; -+import org.spoutcraft.api.property.PropertyInterface; -+ -+public interface Client extends PropertyInterface { -+ public String getName(); -+ -+ public String getVersion(); -+ -+ public Logger getLogger(); -+ -+ public File getUpdateFolder(); -+ -+ public SkyManager getSkyManager(); -+ -+ public KeyBindingManager getKeyBindingManager(); -+ -+ public BiomeManager getBiomeManager(); -+ -+ public MaterialManager getMaterialManager(); -+ -+ public boolean isSpoutEnabled(); -+ -+ public long getServerVersion(); -+ -+ public File getAudioCache(); -+ -+ public File getTemporaryCache(); -+ -+ public File getTextureCache(); -+ -+ public File getTexturePackFolder(); -+ -+ public File getStatsFolder(); -+ -+ public long getTick(); -+ -+ public Mode getMode(); -+ -+ public RenderDelegate getRenderDelegate(); -+ -+ public enum Mode { -+ Single_Player, -+ Multiplayer, -+ Menu; -+ } -+ -+ public WidgetManager getWidgetManager(); -+ -+ public boolean hasPermission(String permission); -+} ---- net/minecraft/src/WeightedRandom.java -+++ net/minecraft/src/WeightedRandom.java -@@ -5,48 +5,61 @@ - import java.util.Random; - - public class WeightedRandom { -- public static int getTotalWeight(Collection var0) { -- int var1 = 0; - -+ /** -+ * Returns the total weight of all items in a collection. -+ */ -+ public static int getTotalWeight(Collection par0Collection) { -+ int var1 = 0; - WeightedRandomItem var3; -- for(Iterator var2 = var0.iterator(); var2.hasNext(); var1 += var3.itemWeight) { -+ -+ for (Iterator var2 = par0Collection.iterator(); var2.hasNext(); var1 += var3.itemWeight) { - var3 = (WeightedRandomItem)var2.next(); - } - - return var1; - } - -- public static WeightedRandomItem getRandomItem(Random var0, Collection var1, int var2) { -- if(var2 <= 0) { -+ /** -+ * Returns a random choice from the input items, with a total weight value. -+ */ -+ public static WeightedRandomItem getRandomItem(Random par0Random, Collection par1Collection, int par2) { -+ if (par2 <= 0) { - throw new IllegalArgumentException(); - } else { -- int var3 = var0.nextInt(var2); -- Iterator var4 = var1.iterator(); -- -+ int var3 = par0Random.nextInt(par2); -+ Iterator var4 = par1Collection.iterator(); - WeightedRandomItem var5; -+ - do { -- if(!var4.hasNext()) { -+ if (!var4.hasNext()) { - return null; - } - - var5 = (WeightedRandomItem)var4.next(); - var3 -= var5.itemWeight; -- } while(var3 >= 0); -+ } while (var3 >= 0); - - return var5; - } - } - -- public static WeightedRandomItem getRandomItem(Random var0, Collection var1) { -- return getRandomItem(var0, var1, getTotalWeight(var1)); -+ /** -+ * Returns a random choice from the input items. -+ */ -+ public static WeightedRandomItem getRandomItem(Random par0Random, Collection par1Collection) { -+ return getRandomItem(par0Random, par1Collection, getTotalWeight(par1Collection)); - } - -- public static int getTotalWeight(WeightedRandomItem[] var0) { -+ /** -+ * Returns the total weight of all items in a array. -+ */ -+ public static int getTotalWeight(WeightedRandomItem[] par0ArrayOfWeightedRandomItem) { - int var1 = 0; -- WeightedRandomItem[] var2 = var0; -- int var3 = var0.length; -+ WeightedRandomItem[] var2 = par0ArrayOfWeightedRandomItem; -+ int var3 = par0ArrayOfWeightedRandomItem.length; - -- for(int var4 = 0; var4 < var3; ++var4) { -+ for (int var4 = 0; var4 < var3; ++var4) { - WeightedRandomItem var5 = var2[var4]; - var1 += var5.itemWeight; - } -@@ -54,18 +67,22 @@ - return var1; - } - -- public static WeightedRandomItem getRandomItem(Random var0, WeightedRandomItem[] var1, int var2) { -- if(var2 <= 0) { -+ /** -+ * Returns a random choice from the input array of items, with a total weight value. -+ */ -+ public static WeightedRandomItem getRandomItem(Random par0Random, WeightedRandomItem[] par1ArrayOfWeightedRandomItem, int par2) { -+ if (par2 <= 0) { - throw new IllegalArgumentException(); - } else { -- int var3 = var0.nextInt(var2); -- WeightedRandomItem[] var4 = var1; -- int var5 = var1.length; -+ int var3 = par0Random.nextInt(par2); -+ WeightedRandomItem[] var4 = par1ArrayOfWeightedRandomItem; -+ int var5 = par1ArrayOfWeightedRandomItem.length; - -- for(int var6 = 0; var6 < var5; ++var6) { -+ for (int var6 = 0; var6 < var5; ++var6) { - WeightedRandomItem var7 = var4[var6]; - var3 -= var7.itemWeight; -- if(var3 < 0) { -+ -+ if (var3 < 0) { - return var7; - } - } -@@ -74,7 +91,10 @@ - } - } - -- public static WeightedRandomItem getRandomItem(Random var0, WeightedRandomItem[] var1) { -- return getRandomItem(var0, var1, getTotalWeight(var1)); -+ /** -+ * Returns a random choice from the input items. -+ */ -+ public static WeightedRandomItem getRandomItem(Random par0Random, WeightedRandomItem[] par1ArrayOfWeightedRandomItem) { -+ return getRandomItem(par0Random, par1ArrayOfWeightedRandomItem, getTotalWeight(par1ArrayOfWeightedRandomItem)); - } - } ---- net/minecraft/src/ItemSpade.java -+++ net/minecraft/src/ItemSpade.java -@@ -1,13 +1,18 @@ - package net.minecraft.src; - - public class ItemSpade extends ItemTool { -- private static Block[] blocksEffectiveAgainst = new Block[]{Block.grass, Block.dirt, Block.sand, Block.gravel, Block.snow, Block.blockSnow, Block.blockClay, Block.tilledField, Block.slowSand, Block.mycelium}; -- -- public ItemSpade(int var1, EnumToolMaterial var2) { -- super(var1, 1.0F, var2, blocksEffectiveAgainst); -+ -+ /** an array of the blocks this spade is effective against */ -+ private static Block[] blocksEffectiveAgainst = new Block[] {Block.grass, Block.dirt, Block.sand, Block.gravel, Block.snow, Block.blockSnow, Block.blockClay, Block.tilledField, Block.slowSand, Block.mycelium}; -+ -+ public ItemSpade(int par1, EnumToolMaterial par2EnumToolMaterial) { -+ super(par1, 1.0F, par2EnumToolMaterial, blocksEffectiveAgainst); - } - -- public boolean canHarvestBlock(Block var1) { -- return var1 == Block.snow ? true : var1 == Block.blockSnow; -+ /** -+ * Returns if the item (tool) can harvest results from the block type. -+ */ -+ public boolean canHarvestBlock(Block par1Block) { -+ return par1Block == Block.snow ? true : par1Block == Block.blockSnow; - } - } ---- net/minecraft/src/DemoWorldServer.java -+++ net/minecraft/src/DemoWorldServer.java -@@ -6,7 +6,7 @@ - private static final long demoWorldSeed = (long)"North Carolina".hashCode(); - public static final WorldSettings demoWorldSettings = (new WorldSettings(demoWorldSeed, EnumGameType.SURVIVAL, true, false, WorldType.DEFAULT)).enableBonusChest(); - -- public DemoWorldServer(MinecraftServer var1, ISaveHandler var2, String var3, int var4, Profiler var5, ILogAgent var6) { -- super(var1, var2, var3, var4, demoWorldSettings, var5, var6); -+ public DemoWorldServer(MinecraftServer par1MinecraftServer, ISaveHandler par2ISaveHandler, String par3Str, int par4, Profiler par5Profiler, ILogAgent par6ILogAgent) { -+ super(par1MinecraftServer, par2ISaveHandler, par3Str, par4, demoWorldSettings, par5Profiler, par6ILogAgent); - } - } ---- net/minecraft/src/EntityVillager.java -+++ net/minecraft/src/EntityVillager.java -@@ -11,24 +11,41 @@ - private boolean isMating; - private boolean isPlaying; - Village villageObj; -+ -+ /** This villager's current customer. */ - private EntityPlayer buyingPlayer; -+ -+ /** Initialises the MerchantRecipeList.java */ - private MerchantRecipeList buyingList; - private int timeUntilReset; -+ -+ /** addDefaultEquipmentAndRecipies is called if this is true */ - private boolean needsInitilization; - private int wealth; -- private String by; -+ -+ /** Last player to trade with this villager, used for aggressivity. */ -+ private String lastBuyingPlayer; - private boolean field_82190_bM; - private float field_82191_bN; -- private static final Map bB = new HashMap(); -- private static final Map bC = new HashMap(); -- -- public EntityVillager(World var1) { -- this(var1, 0); -+ -+ /** -+ * a villagers recipe list is intialized off this list ; the 2 params are min/max amount they will trade for 1 emerald -+ */ -+ private static final Map villagerStockList = new HashMap(); -+ -+ /** -+ * Selling list of Blacksmith items. negative numbers mean 1 emerald for n items, positive numbers are n emeralds for 1 -+ * item -+ */ -+ private static final Map blacksmithSellingList = new HashMap(); -+ -+ public EntityVillager(World par1World) { -+ this(par1World, 0); - } - -- public EntityVillager(World var1, int var2) { -- super(var1); -- this.setProfession(var2); -+ public EntityVillager(World par1World, int par2) { -+ super(par1World); -+ this.setProfession(par2); - this.setSize(0.6F, 1.8F); - this.getNavigator().setBreakDoors(true); - this.getNavigator().setAvoidsWater(true); -@@ -54,47 +71,58 @@ - this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setAttribute(0.5D); - } - -+ /** -+ * Returns true if the newer Entity AI code should be run -+ */ - public boolean isAIEnabled() { - return true; - } - -+ /** -+ * main AI tick function, replaces updateEntityActionState -+ */ - protected void updateAITick() { -- if(--this.randomTickDivider <= 0) { -+ if (--this.randomTickDivider <= 0) { - this.worldObj.villageCollectionObj.addVillagerPosition(MathHelper.floor_double(this.posX), MathHelper.floor_double(this.posY), MathHelper.floor_double(this.posZ)); -- this.randomTickDivider = 70 + this.ab.nextInt(50); -+ this.randomTickDivider = 70 + this.rand.nextInt(50); - this.villageObj = this.worldObj.villageCollectionObj.findNearestVillage(MathHelper.floor_double(this.posX), MathHelper.floor_double(this.posY), MathHelper.floor_double(this.posZ), 32); -- if(this.villageObj == null) { -+ -+ if (this.villageObj == null) { - this.detachHome(); - } else { - ChunkCoordinates var1 = this.villageObj.getCenter(); - this.setHomeArea(var1.posX, var1.posY, var1.posZ, (int)((float)this.villageObj.getVillageRadius() * 0.6F)); -- if(this.field_82190_bM) { -+ -+ if (this.field_82190_bM) { - this.field_82190_bM = false; - this.villageObj.func_82683_b(5); - } - } - } - -- if(!this.isTrading() && this.timeUntilReset > 0) { -+ if (!this.isTrading() && this.timeUntilReset > 0) { - --this.timeUntilReset; -- if(this.timeUntilReset <= 0) { -- if(this.needsInitilization) { -- if(this.buyingList.size() > 1) { -+ -+ if (this.timeUntilReset <= 0) { -+ if (this.needsInitilization) { -+ if (this.buyingList.size() > 1) { - Iterator var3 = this.buyingList.iterator(); - -- while(var3.hasNext()) { -+ while (var3.hasNext()) { - MerchantRecipe var2 = (MerchantRecipe)var3.next(); -- if(var2.func_82784_g()) { -- var2.func_82783_a(this.ab.nextInt(6) + this.ab.nextInt(6) + 2); -+ -+ if (var2.func_82784_g()) { -+ var2.func_82783_a(this.rand.nextInt(6) + this.rand.nextInt(6) + 2); - } - } - } - - this.addDefaultEquipmentAndRecipies(1); - this.needsInitilization = false; -- if(this.villageObj != null && this.by != null) { -+ -+ if (this.villageObj != null && this.lastBuyingPlayer != null) { - this.worldObj.setEntityState(this, (byte)14); -- this.villageObj.setReputationForPlayer(this.by, 1); -+ this.villageObj.setReputationForPlayer(this.lastBuyingPlayer, 1); - } - } - -@@ -105,18 +133,22 @@ - super.updateAITick(); - } - -- public boolean interact(EntityPlayer var1) { -- ItemStack var2 = var1.inventory.getCurrentItem(); -+ /** -+ * Called when a player interacts with a mob. e.g. gets milk from a cow, gets into the saddle on a pig. -+ */ -+ public boolean interact(EntityPlayer par1EntityPlayer) { -+ ItemStack var2 = par1EntityPlayer.inventory.getCurrentItem(); - boolean var3 = var2 != null && var2.itemID == Item.monsterPlacer.itemID; -- if(!var3 && this.isEntityAlive() && !this.isTrading() && !this.isChild()) { -- if(!this.worldObj.isRemote) { -- this.setCustomer(var1); -- var1.displayGUIMerchant(this, this.getCustomNameTag()); -+ -+ if (!var3 && this.isEntityAlive() && !this.isTrading() && !this.isChild()) { -+ if (!this.worldObj.isRemote) { -+ this.setCustomer(par1EntityPlayer); -+ par1EntityPlayer.displayGUIMerchant(this, this.getCustomNameTag()); - } - - return true; - } else { -- return super.interact(var1); -+ return super.interact(par1EntityPlayer); - } - } - -@@ -125,45 +157,63 @@ - this.dataWatcher.addObject(16, Integer.valueOf(0)); - } - -- public void writeEntityToNBT(NBTTagCompound var1) { -- super.writeEntityToNBT(var1); -- var1.setInteger("Profession", this.getProfession()); -- var1.setInteger("Riches", this.wealth); -- if(this.buyingList != null) { -- var1.setCompoundTag("Offers", this.buyingList.getRecipiesAsTags()); -+ /** -+ * (abstract) Protected helper method to write subclass entity data to NBT. -+ */ -+ public void writeEntityToNBT(NBTTagCompound par1NBTTagCompound) { -+ super.writeEntityToNBT(par1NBTTagCompound); -+ par1NBTTagCompound.setInteger("Profession", this.getProfession()); -+ par1NBTTagCompound.setInteger("Riches", this.wealth); -+ -+ if (this.buyingList != null) { -+ par1NBTTagCompound.setCompoundTag("Offers", this.buyingList.getRecipiesAsTags()); - } -- - } - -- public void readEntityFromNBT(NBTTagCompound var1) { -- super.readEntityFromNBT(var1); -- this.setProfession(var1.getInteger("Profession")); -- this.wealth = var1.getInteger("Riches"); -- if(var1.hasKey("Offers")) { -- NBTTagCompound var2 = var1.getCompoundTag("Offers"); -+ /** -+ * (abstract) Protected helper method to read subclass entity data from NBT. -+ */ -+ public void readEntityFromNBT(NBTTagCompound par1NBTTagCompound) { -+ super.readEntityFromNBT(par1NBTTagCompound); -+ this.setProfession(par1NBTTagCompound.getInteger("Profession")); -+ this.wealth = par1NBTTagCompound.getInteger("Riches"); -+ -+ if (par1NBTTagCompound.hasKey("Offers")) { -+ NBTTagCompound var2 = par1NBTTagCompound.getCompoundTag("Offers"); - this.buyingList = new MerchantRecipeList(var2); - } -- - } - -+ /** -+ * Determines if an entity can be despawned, used on idle far away entities -+ */ - protected boolean canDespawn() { - return false; - } - -+ /** -+ * Returns the sound this mob makes while it's alive. -+ */ - protected String getLivingSound() { - return this.isTrading() ? "mob.villager.haggle" : "mob.villager.idle"; - } - -+ /** -+ * Returns the sound this mob makes when it is hurt. -+ */ - protected String getHurtSound() { - return "mob.villager.hit"; - } - -+ /** -+ * Returns the sound this mob makes on death. -+ */ - protected String getDeathSound() { - return "mob.villager.death"; - } - -- public void setProfession(int var1) { -- this.dataWatcher.updateObject(16, Integer.valueOf(var1)); -+ public void setProfession(int par1) { -+ this.dataWatcher.updateObject(16, Integer.valueOf(par1)); - } - - public int getProfession() { -@@ -174,59 +224,67 @@ - return this.isMating; - } - -- public void setMating(boolean var1) { -- this.isMating = var1; -+ public void setMating(boolean par1) { -+ this.isMating = par1; - } - -- public void setPlaying(boolean var1) { -- this.isPlaying = var1; -+ public void setPlaying(boolean par1) { -+ this.isPlaying = par1; - } - - public boolean isPlaying() { - return this.isPlaying; - } - -- public void setRevengeTarget(EntityLivingBase var1) { -- super.setRevengeTarget(var1); -- if(this.villageObj != null && var1 != null) { -- this.villageObj.addOrRenewAgressor(var1); -- if(var1 instanceof EntityPlayer) { -+ public void setRevengeTarget(EntityLivingBase par1EntityLivingBase) { -+ super.setRevengeTarget(par1EntityLivingBase); -+ -+ if (this.villageObj != null && par1EntityLivingBase != null) { -+ this.villageObj.addOrRenewAgressor(par1EntityLivingBase); -+ -+ if (par1EntityLivingBase instanceof EntityPlayer) { - byte var2 = -1; -- if(this.isChild()) { -+ -+ if (this.isChild()) { - var2 = -3; - } - -- this.villageObj.setReputationForPlayer(((EntityPlayer)var1).getCommandSenderName(), var2); -- if(this.isEntityAlive()) { -+ this.villageObj.setReputationForPlayer(((EntityPlayer)par1EntityLivingBase).getCommandSenderName(), var2); -+ -+ if (this.isEntityAlive()) { - this.worldObj.setEntityState(this, (byte)13); - } - } - } -- - } - -- public void onDeath(DamageSource var1) { -- if(this.villageObj != null) { -- Entity var2 = var1.getEntity(); -- if(var2 != null) { -- if(var2 instanceof EntityPlayer) { -+ /** -+ * Called when the mob's health reaches 0. -+ */ -+ public void onDeath(DamageSource par1DamageSource) { -+ if (this.villageObj != null) { -+ Entity var2 = par1DamageSource.getEntity(); -+ -+ if (var2 != null) { -+ if (var2 instanceof EntityPlayer) { - this.villageObj.setReputationForPlayer(((EntityPlayer)var2).getCommandSenderName(), -2); -- } else if(var2 instanceof IMob) { -+ } else if (var2 instanceof IMob) { - this.villageObj.endMatingSeason(); - } -- } else if(var2 == null) { -+ } else if (var2 == null) { - EntityPlayer var3 = this.worldObj.getClosestPlayerToEntity(this, 16.0D); -- if(var3 != null) { -+ -+ if (var3 != null) { - this.villageObj.endMatingSeason(); - } - } - } - -- super.onDeath(var1); -+ super.onDeath(par1DamageSource); - } - -- public void setCustomer(EntityPlayer var1) { -- this.buyingPlayer = var1; -+ public void setCustomer(EntityPlayer par1EntityPlayer) { -+ this.buyingPlayer = par1EntityPlayer; - } - - public EntityPlayer getCustomer() { -@@ -237,53 +295,61 @@ - return this.buyingPlayer != null; - } - -- public void useRecipe(MerchantRecipe var1) { -- var1.incrementToolUses(); -+ public void useRecipe(MerchantRecipe par1MerchantRecipe) { -+ par1MerchantRecipe.incrementToolUses(); - this.livingSoundTime = -this.getTalkInterval(); - this.playSound("mob.villager.yes", this.getSoundVolume(), this.getSoundPitch()); -- if(var1.hasSameIDsAs((MerchantRecipe)this.buyingList.get(this.buyingList.size() - 1))) { -+ -+ if (par1MerchantRecipe.hasSameIDsAs((MerchantRecipe)this.buyingList.get(this.buyingList.size() - 1))) { - this.timeUntilReset = 40; - this.needsInitilization = true; -- if(this.buyingPlayer != null) { -- this.by = this.buyingPlayer.getCommandSenderName(); -+ -+ if (this.buyingPlayer != null) { -+ this.lastBuyingPlayer = this.buyingPlayer.getCommandSenderName(); - } else { -- this.by = null; -+ this.lastBuyingPlayer = null; - } - } - -- if(var1.getItemToBuy().itemID == Item.emerald.itemID) { -- this.wealth += var1.getItemToBuy().stackSize; -+ if (par1MerchantRecipe.getItemToBuy().itemID == Item.emerald.itemID) { -+ this.wealth += par1MerchantRecipe.getItemToBuy().stackSize; - } -- - } - -- public void func_110297_a_(ItemStack var1) { -- if(!this.worldObj.isRemote && this.livingSoundTime > -this.getTalkInterval() + 20) { -+ public void func_110297_a_(ItemStack par1ItemStack) { -+ if (!this.worldObj.isRemote && this.livingSoundTime > -this.getTalkInterval() + 20) { - this.livingSoundTime = -this.getTalkInterval(); -- if(var1 != null) { -+ -+ if (par1ItemStack != null) { - this.playSound("mob.villager.yes", this.getSoundVolume(), this.getSoundPitch()); - } else { - this.playSound("mob.villager.no", this.getSoundVolume(), this.getSoundPitch()); - } - } -- - } - -- public MerchantRecipeList getRecipes(EntityPlayer var1) { -- if(this.buyingList == null) { -+ public MerchantRecipeList getRecipes(EntityPlayer par1EntityPlayer) { -+ if (this.buyingList == null) { - this.addDefaultEquipmentAndRecipies(1); - } - - return this.buyingList; - } - -- private float adjustProbability(float var1) { -- float var2 = var1 + this.field_82191_bN; -+ /** -+ * Adjusts the probability of obtaining a given recipe being offered by a villager -+ */ -+ private float adjustProbability(float par1) { -+ float var2 = par1 + this.field_82191_bN; - return var2 > 0.9F ? 0.9F - (var2 - 0.9F) : var2; - } - -- private void addDefaultEquipmentAndRecipies(int var1) { -- if(this.buyingList != null) { -+ /** -+ * based on the villagers profession add items, equipment, and recipies adds par1 random items to the list of things -+ * that the villager wants to buy. (at most 1 of each wanted type is added) -+ */ -+ private void addDefaultEquipmentAndRecipies(int par1) { -+ if (this.buyingList != null) { - this.field_82191_bN = MathHelper.sqrt_float((float)this.buyingList.size()) * 0.2F; - } else { - this.field_82191_bN = 0.0F; -@@ -293,194 +359,209 @@ - var2 = new MerchantRecipeList(); - int var6; - label50: -- switch(this.getProfession()) { -- case 0: -- addMerchantItem(var2, Item.wheat.itemID, this.ab, this.adjustProbability(0.9F)); -- addMerchantItem(var2, Block.cloth.blockID, this.ab, this.adjustProbability(0.5F)); -- addMerchantItem(var2, Item.chickenRaw.itemID, this.ab, this.adjustProbability(0.5F)); -- addMerchantItem(var2, Item.fishCooked.itemID, this.ab, this.adjustProbability(0.4F)); -- addBlacksmithItem(var2, Item.bread.itemID, this.ab, this.adjustProbability(0.9F)); -- addBlacksmithItem(var2, Item.melon.itemID, this.ab, this.adjustProbability(0.3F)); -- addBlacksmithItem(var2, Item.appleRed.itemID, this.ab, this.adjustProbability(0.3F)); -- addBlacksmithItem(var2, Item.cookie.itemID, this.ab, this.adjustProbability(0.3F)); -- addBlacksmithItem(var2, Item.shears.itemID, this.ab, this.adjustProbability(0.3F)); -- addBlacksmithItem(var2, Item.flintAndSteel.itemID, this.ab, this.adjustProbability(0.3F)); -- addBlacksmithItem(var2, Item.chickenCooked.itemID, this.ab, this.adjustProbability(0.3F)); -- addBlacksmithItem(var2, Item.arrow.itemID, this.ab, this.adjustProbability(0.5F)); -- if(this.ab.nextFloat() < this.adjustProbability(0.5F)) { -- var2.add(new MerchantRecipe(new ItemStack(Block.gravel, 10), new ItemStack(Item.emerald), new ItemStack(Item.flint.itemID, 4 + this.ab.nextInt(2), 0))); -- } -- break; -- case 1: -- addMerchantItem(var2, Item.paper.itemID, this.ab, this.adjustProbability(0.8F)); -- addMerchantItem(var2, Item.book.itemID, this.ab, this.adjustProbability(0.8F)); -- addMerchantItem(var2, Item.writtenBook.itemID, this.ab, this.adjustProbability(0.3F)); -- addBlacksmithItem(var2, Block.bookShelf.blockID, this.ab, this.adjustProbability(0.8F)); -- addBlacksmithItem(var2, Block.glass.blockID, this.ab, this.adjustProbability(0.2F)); -- addBlacksmithItem(var2, Item.compass.itemID, this.ab, this.adjustProbability(0.2F)); -- addBlacksmithItem(var2, Item.pocketSundial.itemID, this.ab, this.adjustProbability(0.2F)); -- if(this.ab.nextFloat() < this.adjustProbability(0.07F)) { -- Enchantment var8 = Enchantment.enchantmentsBookList[this.ab.nextInt(Enchantment.enchantmentsBookList.length)]; -- int var10 = MathHelper.getRandomIntegerInRange(this.ab, var8.getMinLevel(), var8.getMaxLevel()); -- ItemStack var11 = Item.enchantedBook.getEnchantedItemStack(new EnchantmentData(var8, var10)); -- var6 = 2 + this.ab.nextInt(5 + var10 * 10) + 3 * var10; -- var2.add(new MerchantRecipe(new ItemStack(Item.book), new ItemStack(Item.emerald, var6), var11)); -- } -- break; -- case 2: -- addBlacksmithItem(var2, Item.eyeOfEnder.itemID, this.ab, this.adjustProbability(0.3F)); -- addBlacksmithItem(var2, Item.expBottle.itemID, this.ab, this.adjustProbability(0.2F)); -- addBlacksmithItem(var2, Item.redstone.itemID, this.ab, this.adjustProbability(0.4F)); -- addBlacksmithItem(var2, Block.glowStone.blockID, this.ab, this.adjustProbability(0.3F)); -- int[] var3 = new int[]{Item.swordIron.itemID, Item.swordDiamond.itemID, Item.plateIron.itemID, Item.plateDiamond.itemID, Item.axeIron.itemID, Item.axeDiamond.itemID, Item.pickaxeIron.itemID, Item.pickaxeDiamond.itemID}; -- int[] var4 = var3; -- int var5 = var3.length; -- var6 = 0; -- -- while(true) { -- if(var6 >= var5) { -- break label50; -- } -- -- int var7 = var4[var6]; -- if(this.ab.nextFloat() < this.adjustProbability(0.05F)) { -- var2.add(new MerchantRecipe(new ItemStack(var7, 1, 0), new ItemStack(Item.emerald, 2 + this.ab.nextInt(3), 0), EnchantmentHelper.addRandomEnchantment(this.ab, new ItemStack(var7, 1, 0), 5 + this.ab.nextInt(15)))); -- } -- -- ++var6; -- } -- case 3: -- addMerchantItem(var2, Item.coal.itemID, this.ab, this.adjustProbability(0.7F)); -- addMerchantItem(var2, Item.ingotIron.itemID, this.ab, this.adjustProbability(0.5F)); -- addMerchantItem(var2, Item.ingotGold.itemID, this.ab, this.adjustProbability(0.5F)); -- addMerchantItem(var2, Item.diamond.itemID, this.ab, this.adjustProbability(0.5F)); -- addBlacksmithItem(var2, Item.swordIron.itemID, this.ab, this.adjustProbability(0.5F)); -- addBlacksmithItem(var2, Item.swordDiamond.itemID, this.ab, this.adjustProbability(0.5F)); -- addBlacksmithItem(var2, Item.axeIron.itemID, this.ab, this.adjustProbability(0.3F)); -- addBlacksmithItem(var2, Item.axeDiamond.itemID, this.ab, this.adjustProbability(0.3F)); -- addBlacksmithItem(var2, Item.pickaxeIron.itemID, this.ab, this.adjustProbability(0.5F)); -- addBlacksmithItem(var2, Item.pickaxeDiamond.itemID, this.ab, this.adjustProbability(0.5F)); -- addBlacksmithItem(var2, Item.shovelIron.itemID, this.ab, this.adjustProbability(0.2F)); -- addBlacksmithItem(var2, Item.shovelDiamond.itemID, this.ab, this.adjustProbability(0.2F)); -- addBlacksmithItem(var2, Item.hoeIron.itemID, this.ab, this.adjustProbability(0.2F)); -- addBlacksmithItem(var2, Item.hoeDiamond.itemID, this.ab, this.adjustProbability(0.2F)); -- addBlacksmithItem(var2, Item.bootsIron.itemID, this.ab, this.adjustProbability(0.2F)); -- addBlacksmithItem(var2, Item.bootsDiamond.itemID, this.ab, this.adjustProbability(0.2F)); -- addBlacksmithItem(var2, Item.helmetIron.itemID, this.ab, this.adjustProbability(0.2F)); -- addBlacksmithItem(var2, Item.helmetDiamond.itemID, this.ab, this.adjustProbability(0.2F)); -- addBlacksmithItem(var2, Item.plateIron.itemID, this.ab, this.adjustProbability(0.2F)); -- addBlacksmithItem(var2, Item.plateDiamond.itemID, this.ab, this.adjustProbability(0.2F)); -- addBlacksmithItem(var2, Item.legsIron.itemID, this.ab, this.adjustProbability(0.2F)); -- addBlacksmithItem(var2, Item.legsDiamond.itemID, this.ab, this.adjustProbability(0.2F)); -- addBlacksmithItem(var2, Item.bootsChain.itemID, this.ab, this.adjustProbability(0.1F)); -- addBlacksmithItem(var2, Item.helmetChain.itemID, this.ab, this.adjustProbability(0.1F)); -- addBlacksmithItem(var2, Item.plateChain.itemID, this.ab, this.adjustProbability(0.1F)); -- addBlacksmithItem(var2, Item.legsChain.itemID, this.ab, this.adjustProbability(0.1F)); -- break; -- case 4: -- addMerchantItem(var2, Item.coal.itemID, this.ab, this.adjustProbability(0.7F)); -- addMerchantItem(var2, Item.porkRaw.itemID, this.ab, this.adjustProbability(0.5F)); -- addMerchantItem(var2, Item.beefRaw.itemID, this.ab, this.adjustProbability(0.5F)); -- addBlacksmithItem(var2, Item.saddle.itemID, this.ab, this.adjustProbability(0.1F)); -- addBlacksmithItem(var2, Item.plateLeather.itemID, this.ab, this.adjustProbability(0.3F)); -- addBlacksmithItem(var2, Item.bootsLeather.itemID, this.ab, this.adjustProbability(0.3F)); -- addBlacksmithItem(var2, Item.helmetLeather.itemID, this.ab, this.adjustProbability(0.3F)); -- addBlacksmithItem(var2, Item.legsLeather.itemID, this.ab, this.adjustProbability(0.3F)); -- addBlacksmithItem(var2, Item.porkCooked.itemID, this.ab, this.adjustProbability(0.3F)); -- addBlacksmithItem(var2, Item.beefCooked.itemID, this.ab, this.adjustProbability(0.3F)); -+ -+ switch (this.getProfession()) { -+ case 0: -+ addMerchantItem(var2, Item.wheat.itemID, this.rand, this.adjustProbability(0.9F)); -+ addMerchantItem(var2, Block.cloth.blockID, this.rand, this.adjustProbability(0.5F)); -+ addMerchantItem(var2, Item.chickenRaw.itemID, this.rand, this.adjustProbability(0.5F)); -+ addMerchantItem(var2, Item.fishCooked.itemID, this.rand, this.adjustProbability(0.4F)); -+ addBlacksmithItem(var2, Item.bread.itemID, this.rand, this.adjustProbability(0.9F)); -+ addBlacksmithItem(var2, Item.melon.itemID, this.rand, this.adjustProbability(0.3F)); -+ addBlacksmithItem(var2, Item.appleRed.itemID, this.rand, this.adjustProbability(0.3F)); -+ addBlacksmithItem(var2, Item.cookie.itemID, this.rand, this.adjustProbability(0.3F)); -+ addBlacksmithItem(var2, Item.shears.itemID, this.rand, this.adjustProbability(0.3F)); -+ addBlacksmithItem(var2, Item.flintAndSteel.itemID, this.rand, this.adjustProbability(0.3F)); -+ addBlacksmithItem(var2, Item.chickenCooked.itemID, this.rand, this.adjustProbability(0.3F)); -+ addBlacksmithItem(var2, Item.arrow.itemID, this.rand, this.adjustProbability(0.5F)); -+ -+ if (this.rand.nextFloat() < this.adjustProbability(0.5F)) { -+ var2.add(new MerchantRecipe(new ItemStack(Block.gravel, 10), new ItemStack(Item.emerald), new ItemStack(Item.flint.itemID, 4 + this.rand.nextInt(2), 0))); -+ } -+ -+ break; -+ -+ case 1: -+ addMerchantItem(var2, Item.paper.itemID, this.rand, this.adjustProbability(0.8F)); -+ addMerchantItem(var2, Item.book.itemID, this.rand, this.adjustProbability(0.8F)); -+ addMerchantItem(var2, Item.writtenBook.itemID, this.rand, this.adjustProbability(0.3F)); -+ addBlacksmithItem(var2, Block.bookShelf.blockID, this.rand, this.adjustProbability(0.8F)); -+ addBlacksmithItem(var2, Block.glass.blockID, this.rand, this.adjustProbability(0.2F)); -+ addBlacksmithItem(var2, Item.compass.itemID, this.rand, this.adjustProbability(0.2F)); -+ addBlacksmithItem(var2, Item.pocketSundial.itemID, this.rand, this.adjustProbability(0.2F)); -+ -+ if (this.rand.nextFloat() < this.adjustProbability(0.07F)) { -+ Enchantment var8 = Enchantment.enchantmentsBookList[this.rand.nextInt(Enchantment.enchantmentsBookList.length)]; -+ int var10 = MathHelper.getRandomIntegerInRange(this.rand, var8.getMinLevel(), var8.getMaxLevel()); -+ ItemStack var11 = Item.enchantedBook.getEnchantedItemStack(new EnchantmentData(var8, var10)); -+ var6 = 2 + this.rand.nextInt(5 + var10 * 10) + 3 * var10; -+ var2.add(new MerchantRecipe(new ItemStack(Item.book), new ItemStack(Item.emerald, var6), var11)); -+ } -+ -+ break; -+ -+ case 2: -+ addBlacksmithItem(var2, Item.eyeOfEnder.itemID, this.rand, this.adjustProbability(0.3F)); -+ addBlacksmithItem(var2, Item.expBottle.itemID, this.rand, this.adjustProbability(0.2F)); -+ addBlacksmithItem(var2, Item.redstone.itemID, this.rand, this.adjustProbability(0.4F)); -+ addBlacksmithItem(var2, Block.glowStone.blockID, this.rand, this.adjustProbability(0.3F)); -+ int[] var3 = new int[] {Item.swordIron.itemID, Item.swordDiamond.itemID, Item.plateIron.itemID, Item.plateDiamond.itemID, Item.axeIron.itemID, Item.axeDiamond.itemID, Item.pickaxeIron.itemID, Item.pickaxeDiamond.itemID}; -+ int[] var4 = var3; -+ int var5 = var3.length; -+ var6 = 0; -+ -+ while (true) { -+ if (var6 >= var5) { -+ break label50; -+ } -+ -+ int var7 = var4[var6]; -+ -+ if (this.rand.nextFloat() < this.adjustProbability(0.05F)) { -+ var2.add(new MerchantRecipe(new ItemStack(var7, 1, 0), new ItemStack(Item.emerald, 2 + this.rand.nextInt(3), 0), EnchantmentHelper.addRandomEnchantment(this.rand, new ItemStack(var7, 1, 0), 5 + this.rand.nextInt(15)))); -+ } -+ -+ ++var6; -+ } -+ -+ case 3: -+ addMerchantItem(var2, Item.coal.itemID, this.rand, this.adjustProbability(0.7F)); -+ addMerchantItem(var2, Item.ingotIron.itemID, this.rand, this.adjustProbability(0.5F)); -+ addMerchantItem(var2, Item.ingotGold.itemID, this.rand, this.adjustProbability(0.5F)); -+ addMerchantItem(var2, Item.diamond.itemID, this.rand, this.adjustProbability(0.5F)); -+ addBlacksmithItem(var2, Item.swordIron.itemID, this.rand, this.adjustProbability(0.5F)); -+ addBlacksmithItem(var2, Item.swordDiamond.itemID, this.rand, this.adjustProbability(0.5F)); -+ addBlacksmithItem(var2, Item.axeIron.itemID, this.rand, this.adjustProbability(0.3F)); -+ addBlacksmithItem(var2, Item.axeDiamond.itemID, this.rand, this.adjustProbability(0.3F)); -+ addBlacksmithItem(var2, Item.pickaxeIron.itemID, this.rand, this.adjustProbability(0.5F)); -+ addBlacksmithItem(var2, Item.pickaxeDiamond.itemID, this.rand, this.adjustProbability(0.5F)); -+ addBlacksmithItem(var2, Item.shovelIron.itemID, this.rand, this.adjustProbability(0.2F)); -+ addBlacksmithItem(var2, Item.shovelDiamond.itemID, this.rand, this.adjustProbability(0.2F)); -+ addBlacksmithItem(var2, Item.hoeIron.itemID, this.rand, this.adjustProbability(0.2F)); -+ addBlacksmithItem(var2, Item.hoeDiamond.itemID, this.rand, this.adjustProbability(0.2F)); -+ addBlacksmithItem(var2, Item.bootsIron.itemID, this.rand, this.adjustProbability(0.2F)); -+ addBlacksmithItem(var2, Item.bootsDiamond.itemID, this.rand, this.adjustProbability(0.2F)); -+ addBlacksmithItem(var2, Item.helmetIron.itemID, this.rand, this.adjustProbability(0.2F)); -+ addBlacksmithItem(var2, Item.helmetDiamond.itemID, this.rand, this.adjustProbability(0.2F)); -+ addBlacksmithItem(var2, Item.plateIron.itemID, this.rand, this.adjustProbability(0.2F)); -+ addBlacksmithItem(var2, Item.plateDiamond.itemID, this.rand, this.adjustProbability(0.2F)); -+ addBlacksmithItem(var2, Item.legsIron.itemID, this.rand, this.adjustProbability(0.2F)); -+ addBlacksmithItem(var2, Item.legsDiamond.itemID, this.rand, this.adjustProbability(0.2F)); -+ addBlacksmithItem(var2, Item.bootsChain.itemID, this.rand, this.adjustProbability(0.1F)); -+ addBlacksmithItem(var2, Item.helmetChain.itemID, this.rand, this.adjustProbability(0.1F)); -+ addBlacksmithItem(var2, Item.plateChain.itemID, this.rand, this.adjustProbability(0.1F)); -+ addBlacksmithItem(var2, Item.legsChain.itemID, this.rand, this.adjustProbability(0.1F)); -+ break; -+ -+ case 4: -+ addMerchantItem(var2, Item.coal.itemID, this.rand, this.adjustProbability(0.7F)); -+ addMerchantItem(var2, Item.porkRaw.itemID, this.rand, this.adjustProbability(0.5F)); -+ addMerchantItem(var2, Item.beefRaw.itemID, this.rand, this.adjustProbability(0.5F)); -+ addBlacksmithItem(var2, Item.saddle.itemID, this.rand, this.adjustProbability(0.1F)); -+ addBlacksmithItem(var2, Item.plateLeather.itemID, this.rand, this.adjustProbability(0.3F)); -+ addBlacksmithItem(var2, Item.bootsLeather.itemID, this.rand, this.adjustProbability(0.3F)); -+ addBlacksmithItem(var2, Item.helmetLeather.itemID, this.rand, this.adjustProbability(0.3F)); -+ addBlacksmithItem(var2, Item.legsLeather.itemID, this.rand, this.adjustProbability(0.3F)); -+ addBlacksmithItem(var2, Item.porkCooked.itemID, this.rand, this.adjustProbability(0.3F)); -+ addBlacksmithItem(var2, Item.beefCooked.itemID, this.rand, this.adjustProbability(0.3F)); - } - -- if(var2.isEmpty()) { -- addMerchantItem(var2, Item.ingotGold.itemID, this.ab, 1.0F); -+ if (var2.isEmpty()) { -+ addMerchantItem(var2, Item.ingotGold.itemID, this.rand, 1.0F); - } - - Collections.shuffle(var2); -- if(this.buyingList == null) { -+ -+ if (this.buyingList == null) { - this.buyingList = new MerchantRecipeList(); - } - -- for(int var9 = 0; var9 < var1 && var9 < var2.size(); ++var9) { -+ for (int var9 = 0; var9 < par1 && var9 < var2.size(); ++var9) { - this.buyingList.addToListWithCheck((MerchantRecipe)var2.get(var9)); - } -- -- } -- -- public void setRecipes(MerchantRecipeList var1) { -- } -- -- private static void addMerchantItem(MerchantRecipeList var0, int var1, Random var2, float var3) { -- if(var2.nextFloat() < var3) { -- var0.add(new MerchantRecipe(getRandomSizedStack(var1, var2), Item.emerald)); -+ } -+ -+ public void setRecipes(MerchantRecipeList par1MerchantRecipeList) {} -+ -+ /** -+ * each recipie takes a random stack from villagerStockList and offers it for 1 emerald -+ */ -+ private static void addMerchantItem(MerchantRecipeList par0MerchantRecipeList, int par1, Random par2Random, float par3) { -+ if (par2Random.nextFloat() < par3) { -+ par0MerchantRecipeList.add(new MerchantRecipe(getRandomSizedStack(par1, par2Random), Item.emerald)); - } -- -- } -- -- private static ItemStack getRandomSizedStack(int var0, Random var1) { -- return new ItemStack(var0, getRandomCountForItem(var0, var1), 0); -- } -- -- private static int getRandomCountForItem(int var0, Random var1) { -- Tuple var2 = (Tuple)bB.get(Integer.valueOf(var0)); -- return var2 == null ? 1 : (((Integer)var2.getFirst()).intValue() >= ((Integer)var2.getSecond()).intValue() ? ((Integer)var2.getFirst()).intValue() : ((Integer)var2.getFirst()).intValue() + var1.nextInt(((Integer)var2.getSecond()).intValue() - ((Integer)var2.getFirst()).intValue())); -- } -- -- private static void addBlacksmithItem(MerchantRecipeList var0, int var1, Random var2, float var3) { -- if(var2.nextFloat() < var3) { -- int var4 = getRandomCountForBlacksmithItem(var1, var2); -+ } -+ -+ private static ItemStack getRandomSizedStack(int par0, Random par1Random) { -+ return new ItemStack(par0, getRandomCountForItem(par0, par1Random), 0); -+ } -+ -+ /** -+ * default to 1, and villagerStockList contains a min/max amount for each index -+ */ -+ private static int getRandomCountForItem(int par0, Random par1Random) { -+ Tuple var2 = (Tuple)villagerStockList.get(Integer.valueOf(par0)); -+ return var2 == null ? 1 : (((Integer)var2.getFirst()).intValue() >= ((Integer)var2.getSecond()).intValue() ? ((Integer)var2.getFirst()).intValue() : ((Integer)var2.getFirst()).intValue() + par1Random.nextInt(((Integer)var2.getSecond()).intValue() - ((Integer)var2.getFirst()).intValue())); -+ } -+ -+ private static void addBlacksmithItem(MerchantRecipeList par0MerchantRecipeList, int par1, Random par2Random, float par3) { -+ if (par2Random.nextFloat() < par3) { -+ int var4 = getRandomCountForBlacksmithItem(par1, par2Random); - ItemStack var5; - ItemStack var6; -- if(var4 < 0) { -+ -+ if (var4 < 0) { - var5 = new ItemStack(Item.emerald.itemID, 1, 0); -- var6 = new ItemStack(var1, -var4, 0); -+ var6 = new ItemStack(par1, -var4, 0); - } else { - var5 = new ItemStack(Item.emerald.itemID, var4, 0); -- var6 = new ItemStack(var1, 1, 0); -+ var6 = new ItemStack(par1, 1, 0); - } - -- var0.add(new MerchantRecipe(var5, var6)); -+ par0MerchantRecipeList.add(new MerchantRecipe(var5, var6)); - } -- -- } -- -- private static int getRandomCountForBlacksmithItem(int var0, Random var1) { -- Tuple var2 = (Tuple)bC.get(Integer.valueOf(var0)); -- return var2 == null ? 1 : (((Integer)var2.getFirst()).intValue() >= ((Integer)var2.getSecond()).intValue() ? ((Integer)var2.getFirst()).intValue() : ((Integer)var2.getFirst()).intValue() + var1.nextInt(((Integer)var2.getSecond()).intValue() - ((Integer)var2.getFirst()).intValue())); -- } -- -- public void handleHealthUpdate(byte var1) { -- if(var1 == 12) { -+ } -+ -+ private static int getRandomCountForBlacksmithItem(int par0, Random par1Random) { -+ Tuple var2 = (Tuple)blacksmithSellingList.get(Integer.valueOf(par0)); -+ return var2 == null ? 1 : (((Integer)var2.getFirst()).intValue() >= ((Integer)var2.getSecond()).intValue() ? ((Integer)var2.getFirst()).intValue() : ((Integer)var2.getFirst()).intValue() + par1Random.nextInt(((Integer)var2.getSecond()).intValue() - ((Integer)var2.getFirst()).intValue())); -+ } -+ -+ public void handleHealthUpdate(byte par1) { -+ if (par1 == 12) { - this.generateRandomParticles("heart"); -- } else if(var1 == 13) { -+ } else if (par1 == 13) { - this.generateRandomParticles("angryVillager"); -- } else if(var1 == 14) { -+ } else if (par1 == 14) { - this.generateRandomParticles("happyVillager"); - } else { -- super.handleHealthUpdate(var1); -- } -- -- } -- -- private void generateRandomParticles(String var1) { -- for(int var2 = 0; var2 < 5; ++var2) { -- double var3 = this.ab.nextGaussian() * 0.02D; -- double var5 = this.ab.nextGaussian() * 0.02D; -- double var7 = this.ab.nextGaussian() * 0.02D; -- this.worldObj.spawnParticle(var1, this.posX + (double)(this.ab.nextFloat() * this.width * 2.0F) - (double)this.width, this.posY + 1.0D + (double)(this.ab.nextFloat() * this.height), this.posZ + (double)(this.ab.nextFloat() * this.width * 2.0F) - (double)this.width, var3, var5, var7); -- } -- -- } -- -- public EntityLivingData onSpawnWithEgg(EntityLivingData var1) { -- var1 = super.onSpawnWithEgg(var1); -- this.setProfession(this.worldObj.s.nextInt(5)); -- return var1; -+ super.handleHealthUpdate(par1); -+ } -+ } -+ -+ /** -+ * par1 is the particleName -+ */ -+ private void generateRandomParticles(String par1Str) { -+ for (int var2 = 0; var2 < 5; ++var2) { -+ double var3 = this.rand.nextGaussian() * 0.02D; -+ double var5 = this.rand.nextGaussian() * 0.02D; -+ double var7 = this.rand.nextGaussian() * 0.02D; -+ this.worldObj.spawnParticle(par1Str, this.posX + (double)(this.rand.nextFloat() * this.width * 2.0F) - (double)this.width, this.posY + 1.0D + (double)(this.rand.nextFloat() * this.height), this.posZ + (double)(this.rand.nextFloat() * this.width * 2.0F) - (double)this.width, var3, var5, var7); -+ } -+ } -+ -+ public EntityLivingData onSpawnWithEgg(EntityLivingData par1EntityLivingData) { -+ par1EntityLivingData = super.onSpawnWithEgg(par1EntityLivingData); -+ this.setProfession(this.worldObj.rand.nextInt(5)); -+ return par1EntityLivingData; - } - - public void func_82187_q() { - this.field_82190_bM = true; - } - -- public EntityVillager func_90012_b(EntityAgeable var1) { -+ public EntityVillager func_90012_b(EntityAgeable par1EntityAgeable) { - EntityVillager var2 = new EntityVillager(this.worldObj); - var2.onSpawnWithEgg((EntityLivingData)null); - return var2; -@@ -490,74 +571,74 @@ - return false; - } - -- public EntityAgeable createChild(EntityAgeable var1) { -- return this.func_90012_b(var1); -+ public EntityAgeable createChild(EntityAgeable par1EntityAgeable) { -+ return this.func_90012_b(par1EntityAgeable); - } - - static { -- bB.put(Integer.valueOf(Item.coal.itemID), new Tuple(Integer.valueOf(16), Integer.valueOf(24))); -- bB.put(Integer.valueOf(Item.ingotIron.itemID), new Tuple(Integer.valueOf(8), Integer.valueOf(10))); -- bB.put(Integer.valueOf(Item.ingotGold.itemID), new Tuple(Integer.valueOf(8), Integer.valueOf(10))); -- bB.put(Integer.valueOf(Item.diamond.itemID), new Tuple(Integer.valueOf(4), Integer.valueOf(6))); -- bB.put(Integer.valueOf(Item.paper.itemID), new Tuple(Integer.valueOf(24), Integer.valueOf(36))); -- bB.put(Integer.valueOf(Item.book.itemID), new Tuple(Integer.valueOf(11), Integer.valueOf(13))); -- bB.put(Integer.valueOf(Item.writtenBook.itemID), new Tuple(Integer.valueOf(1), Integer.valueOf(1))); -- bB.put(Integer.valueOf(Item.enderPearl.itemID), new Tuple(Integer.valueOf(3), Integer.valueOf(4))); -- bB.put(Integer.valueOf(Item.eyeOfEnder.itemID), new Tuple(Integer.valueOf(2), Integer.valueOf(3))); -- bB.put(Integer.valueOf(Item.porkRaw.itemID), new Tuple(Integer.valueOf(14), Integer.valueOf(18))); -- bB.put(Integer.valueOf(Item.beefRaw.itemID), new Tuple(Integer.valueOf(14), Integer.valueOf(18))); -- bB.put(Integer.valueOf(Item.chickenRaw.itemID), new Tuple(Integer.valueOf(14), Integer.valueOf(18))); -- bB.put(Integer.valueOf(Item.fishCooked.itemID), new Tuple(Integer.valueOf(9), Integer.valueOf(13))); -- bB.put(Integer.valueOf(Item.seeds.itemID), new Tuple(Integer.valueOf(34), Integer.valueOf(48))); -- bB.put(Integer.valueOf(Item.melonSeeds.itemID), new Tuple(Integer.valueOf(30), Integer.valueOf(38))); -- bB.put(Integer.valueOf(Item.pumpkinSeeds.itemID), new Tuple(Integer.valueOf(30), Integer.valueOf(38))); -- bB.put(Integer.valueOf(Item.wheat.itemID), new Tuple(Integer.valueOf(18), Integer.valueOf(22))); -- bB.put(Integer.valueOf(Block.cloth.blockID), new Tuple(Integer.valueOf(14), Integer.valueOf(22))); -- bB.put(Integer.valueOf(Item.rottenFlesh.itemID), new Tuple(Integer.valueOf(36), Integer.valueOf(64))); -- bC.put(Integer.valueOf(Item.flintAndSteel.itemID), new Tuple(Integer.valueOf(3), Integer.valueOf(4))); -- bC.put(Integer.valueOf(Item.shears.itemID), new Tuple(Integer.valueOf(3), Integer.valueOf(4))); -- bC.put(Integer.valueOf(Item.swordIron.itemID), new Tuple(Integer.valueOf(7), Integer.valueOf(11))); -- bC.put(Integer.valueOf(Item.swordDiamond.itemID), new Tuple(Integer.valueOf(12), Integer.valueOf(14))); -- bC.put(Integer.valueOf(Item.axeIron.itemID), new Tuple(Integer.valueOf(6), Integer.valueOf(8))); -- bC.put(Integer.valueOf(Item.axeDiamond.itemID), new Tuple(Integer.valueOf(9), Integer.valueOf(12))); -- bC.put(Integer.valueOf(Item.pickaxeIron.itemID), new Tuple(Integer.valueOf(7), Integer.valueOf(9))); -- bC.put(Integer.valueOf(Item.pickaxeDiamond.itemID), new Tuple(Integer.valueOf(10), Integer.valueOf(12))); -- bC.put(Integer.valueOf(Item.shovelIron.itemID), new Tuple(Integer.valueOf(4), Integer.valueOf(6))); -- bC.put(Integer.valueOf(Item.shovelDiamond.itemID), new Tuple(Integer.valueOf(7), Integer.valueOf(8))); -- bC.put(Integer.valueOf(Item.hoeIron.itemID), new Tuple(Integer.valueOf(4), Integer.valueOf(6))); -- bC.put(Integer.valueOf(Item.hoeDiamond.itemID), new Tuple(Integer.valueOf(7), Integer.valueOf(8))); -- bC.put(Integer.valueOf(Item.bootsIron.itemID), new Tuple(Integer.valueOf(4), Integer.valueOf(6))); -- bC.put(Integer.valueOf(Item.bootsDiamond.itemID), new Tuple(Integer.valueOf(7), Integer.valueOf(8))); -- bC.put(Integer.valueOf(Item.helmetIron.itemID), new Tuple(Integer.valueOf(4), Integer.valueOf(6))); -- bC.put(Integer.valueOf(Item.helmetDiamond.itemID), new Tuple(Integer.valueOf(7), Integer.valueOf(8))); -- bC.put(Integer.valueOf(Item.plateIron.itemID), new Tuple(Integer.valueOf(10), Integer.valueOf(14))); -- bC.put(Integer.valueOf(Item.plateDiamond.itemID), new Tuple(Integer.valueOf(16), Integer.valueOf(19))); -- bC.put(Integer.valueOf(Item.legsIron.itemID), new Tuple(Integer.valueOf(8), Integer.valueOf(10))); -- bC.put(Integer.valueOf(Item.legsDiamond.itemID), new Tuple(Integer.valueOf(11), Integer.valueOf(14))); -- bC.put(Integer.valueOf(Item.bootsChain.itemID), new Tuple(Integer.valueOf(5), Integer.valueOf(7))); -- bC.put(Integer.valueOf(Item.helmetChain.itemID), new Tuple(Integer.valueOf(5), Integer.valueOf(7))); -- bC.put(Integer.valueOf(Item.plateChain.itemID), new Tuple(Integer.valueOf(11), Integer.valueOf(15))); -- bC.put(Integer.valueOf(Item.legsChain.itemID), new Tuple(Integer.valueOf(9), Integer.valueOf(11))); -- bC.put(Integer.valueOf(Item.bread.itemID), new Tuple(Integer.valueOf(-4), Integer.valueOf(-2))); -- bC.put(Integer.valueOf(Item.melon.itemID), new Tuple(Integer.valueOf(-8), Integer.valueOf(-4))); -- bC.put(Integer.valueOf(Item.appleRed.itemID), new Tuple(Integer.valueOf(-8), Integer.valueOf(-4))); -- bC.put(Integer.valueOf(Item.cookie.itemID), new Tuple(Integer.valueOf(-10), Integer.valueOf(-7))); -- bC.put(Integer.valueOf(Block.glass.blockID), new Tuple(Integer.valueOf(-5), Integer.valueOf(-3))); -- bC.put(Integer.valueOf(Block.bookShelf.blockID), new Tuple(Integer.valueOf(3), Integer.valueOf(4))); -- bC.put(Integer.valueOf(Item.plateLeather.itemID), new Tuple(Integer.valueOf(4), Integer.valueOf(5))); -- bC.put(Integer.valueOf(Item.bootsLeather.itemID), new Tuple(Integer.valueOf(2), Integer.valueOf(4))); -- bC.put(Integer.valueOf(Item.helmetLeather.itemID), new Tuple(Integer.valueOf(2), Integer.valueOf(4))); -- bC.put(Integer.valueOf(Item.legsLeather.itemID), new Tuple(Integer.valueOf(2), Integer.valueOf(4))); -- bC.put(Integer.valueOf(Item.saddle.itemID), new Tuple(Integer.valueOf(6), Integer.valueOf(8))); -- bC.put(Integer.valueOf(Item.expBottle.itemID), new Tuple(Integer.valueOf(-4), Integer.valueOf(-1))); -- bC.put(Integer.valueOf(Item.redstone.itemID), new Tuple(Integer.valueOf(-4), Integer.valueOf(-1))); -- bC.put(Integer.valueOf(Item.compass.itemID), new Tuple(Integer.valueOf(10), Integer.valueOf(12))); -- bC.put(Integer.valueOf(Item.pocketSundial.itemID), new Tuple(Integer.valueOf(10), Integer.valueOf(12))); -- bC.put(Integer.valueOf(Block.glowStone.blockID), new Tuple(Integer.valueOf(-3), Integer.valueOf(-1))); -- bC.put(Integer.valueOf(Item.porkCooked.itemID), new Tuple(Integer.valueOf(-7), Integer.valueOf(-5))); -- bC.put(Integer.valueOf(Item.beefCooked.itemID), new Tuple(Integer.valueOf(-7), Integer.valueOf(-5))); -- bC.put(Integer.valueOf(Item.chickenCooked.itemID), new Tuple(Integer.valueOf(-8), Integer.valueOf(-6))); -- bC.put(Integer.valueOf(Item.eyeOfEnder.itemID), new Tuple(Integer.valueOf(7), Integer.valueOf(11))); -- bC.put(Integer.valueOf(Item.arrow.itemID), new Tuple(Integer.valueOf(-12), Integer.valueOf(-8))); -+ villagerStockList.put(Integer.valueOf(Item.coal.itemID), new Tuple(Integer.valueOf(16), Integer.valueOf(24))); -+ villagerStockList.put(Integer.valueOf(Item.ingotIron.itemID), new Tuple(Integer.valueOf(8), Integer.valueOf(10))); -+ villagerStockList.put(Integer.valueOf(Item.ingotGold.itemID), new Tuple(Integer.valueOf(8), Integer.valueOf(10))); -+ villagerStockList.put(Integer.valueOf(Item.diamond.itemID), new Tuple(Integer.valueOf(4), Integer.valueOf(6))); -+ villagerStockList.put(Integer.valueOf(Item.paper.itemID), new Tuple(Integer.valueOf(24), Integer.valueOf(36))); -+ villagerStockList.put(Integer.valueOf(Item.book.itemID), new Tuple(Integer.valueOf(11), Integer.valueOf(13))); -+ villagerStockList.put(Integer.valueOf(Item.writtenBook.itemID), new Tuple(Integer.valueOf(1), Integer.valueOf(1))); -+ villagerStockList.put(Integer.valueOf(Item.enderPearl.itemID), new Tuple(Integer.valueOf(3), Integer.valueOf(4))); -+ villagerStockList.put(Integer.valueOf(Item.eyeOfEnder.itemID), new Tuple(Integer.valueOf(2), Integer.valueOf(3))); -+ villagerStockList.put(Integer.valueOf(Item.porkRaw.itemID), new Tuple(Integer.valueOf(14), Integer.valueOf(18))); -+ villagerStockList.put(Integer.valueOf(Item.beefRaw.itemID), new Tuple(Integer.valueOf(14), Integer.valueOf(18))); -+ villagerStockList.put(Integer.valueOf(Item.chickenRaw.itemID), new Tuple(Integer.valueOf(14), Integer.valueOf(18))); -+ villagerStockList.put(Integer.valueOf(Item.fishCooked.itemID), new Tuple(Integer.valueOf(9), Integer.valueOf(13))); -+ villagerStockList.put(Integer.valueOf(Item.seeds.itemID), new Tuple(Integer.valueOf(34), Integer.valueOf(48))); -+ villagerStockList.put(Integer.valueOf(Item.melonSeeds.itemID), new Tuple(Integer.valueOf(30), Integer.valueOf(38))); -+ villagerStockList.put(Integer.valueOf(Item.pumpkinSeeds.itemID), new Tuple(Integer.valueOf(30), Integer.valueOf(38))); -+ villagerStockList.put(Integer.valueOf(Item.wheat.itemID), new Tuple(Integer.valueOf(18), Integer.valueOf(22))); -+ villagerStockList.put(Integer.valueOf(Block.cloth.blockID), new Tuple(Integer.valueOf(14), Integer.valueOf(22))); -+ villagerStockList.put(Integer.valueOf(Item.rottenFlesh.itemID), new Tuple(Integer.valueOf(36), Integer.valueOf(64))); -+ blacksmithSellingList.put(Integer.valueOf(Item.flintAndSteel.itemID), new Tuple(Integer.valueOf(3), Integer.valueOf(4))); -+ blacksmithSellingList.put(Integer.valueOf(Item.shears.itemID), new Tuple(Integer.valueOf(3), Integer.valueOf(4))); -+ blacksmithSellingList.put(Integer.valueOf(Item.swordIron.itemID), new Tuple(Integer.valueOf(7), Integer.valueOf(11))); -+ blacksmithSellingList.put(Integer.valueOf(Item.swordDiamond.itemID), new Tuple(Integer.valueOf(12), Integer.valueOf(14))); -+ blacksmithSellingList.put(Integer.valueOf(Item.axeIron.itemID), new Tuple(Integer.valueOf(6), Integer.valueOf(8))); -+ blacksmithSellingList.put(Integer.valueOf(Item.axeDiamond.itemID), new Tuple(Integer.valueOf(9), Integer.valueOf(12))); -+ blacksmithSellingList.put(Integer.valueOf(Item.pickaxeIron.itemID), new Tuple(Integer.valueOf(7), Integer.valueOf(9))); -+ blacksmithSellingList.put(Integer.valueOf(Item.pickaxeDiamond.itemID), new Tuple(Integer.valueOf(10), Integer.valueOf(12))); -+ blacksmithSellingList.put(Integer.valueOf(Item.shovelIron.itemID), new Tuple(Integer.valueOf(4), Integer.valueOf(6))); -+ blacksmithSellingList.put(Integer.valueOf(Item.shovelDiamond.itemID), new Tuple(Integer.valueOf(7), Integer.valueOf(8))); -+ blacksmithSellingList.put(Integer.valueOf(Item.hoeIron.itemID), new Tuple(Integer.valueOf(4), Integer.valueOf(6))); -+ blacksmithSellingList.put(Integer.valueOf(Item.hoeDiamond.itemID), new Tuple(Integer.valueOf(7), Integer.valueOf(8))); -+ blacksmithSellingList.put(Integer.valueOf(Item.bootsIron.itemID), new Tuple(Integer.valueOf(4), Integer.valueOf(6))); -+ blacksmithSellingList.put(Integer.valueOf(Item.bootsDiamond.itemID), new Tuple(Integer.valueOf(7), Integer.valueOf(8))); -+ blacksmithSellingList.put(Integer.valueOf(Item.helmetIron.itemID), new Tuple(Integer.valueOf(4), Integer.valueOf(6))); -+ blacksmithSellingList.put(Integer.valueOf(Item.helmetDiamond.itemID), new Tuple(Integer.valueOf(7), Integer.valueOf(8))); -+ blacksmithSellingList.put(Integer.valueOf(Item.plateIron.itemID), new Tuple(Integer.valueOf(10), Integer.valueOf(14))); -+ blacksmithSellingList.put(Integer.valueOf(Item.plateDiamond.itemID), new Tuple(Integer.valueOf(16), Integer.valueOf(19))); -+ blacksmithSellingList.put(Integer.valueOf(Item.legsIron.itemID), new Tuple(Integer.valueOf(8), Integer.valueOf(10))); -+ blacksmithSellingList.put(Integer.valueOf(Item.legsDiamond.itemID), new Tuple(Integer.valueOf(11), Integer.valueOf(14))); -+ blacksmithSellingList.put(Integer.valueOf(Item.bootsChain.itemID), new Tuple(Integer.valueOf(5), Integer.valueOf(7))); -+ blacksmithSellingList.put(Integer.valueOf(Item.helmetChain.itemID), new Tuple(Integer.valueOf(5), Integer.valueOf(7))); -+ blacksmithSellingList.put(Integer.valueOf(Item.plateChain.itemID), new Tuple(Integer.valueOf(11), Integer.valueOf(15))); -+ blacksmithSellingList.put(Integer.valueOf(Item.legsChain.itemID), new Tuple(Integer.valueOf(9), Integer.valueOf(11))); -+ blacksmithSellingList.put(Integer.valueOf(Item.bread.itemID), new Tuple(Integer.valueOf(-4), Integer.valueOf(-2))); -+ blacksmithSellingList.put(Integer.valueOf(Item.melon.itemID), new Tuple(Integer.valueOf(-8), Integer.valueOf(-4))); -+ blacksmithSellingList.put(Integer.valueOf(Item.appleRed.itemID), new Tuple(Integer.valueOf(-8), Integer.valueOf(-4))); -+ blacksmithSellingList.put(Integer.valueOf(Item.cookie.itemID), new Tuple(Integer.valueOf(-10), Integer.valueOf(-7))); -+ blacksmithSellingList.put(Integer.valueOf(Block.glass.blockID), new Tuple(Integer.valueOf(-5), Integer.valueOf(-3))); -+ blacksmithSellingList.put(Integer.valueOf(Block.bookShelf.blockID), new Tuple(Integer.valueOf(3), Integer.valueOf(4))); -+ blacksmithSellingList.put(Integer.valueOf(Item.plateLeather.itemID), new Tuple(Integer.valueOf(4), Integer.valueOf(5))); -+ blacksmithSellingList.put(Integer.valueOf(Item.bootsLeather.itemID), new Tuple(Integer.valueOf(2), Integer.valueOf(4))); -+ blacksmithSellingList.put(Integer.valueOf(Item.helmetLeather.itemID), new Tuple(Integer.valueOf(2), Integer.valueOf(4))); -+ blacksmithSellingList.put(Integer.valueOf(Item.legsLeather.itemID), new Tuple(Integer.valueOf(2), Integer.valueOf(4))); -+ blacksmithSellingList.put(Integer.valueOf(Item.saddle.itemID), new Tuple(Integer.valueOf(6), Integer.valueOf(8))); -+ blacksmithSellingList.put(Integer.valueOf(Item.expBottle.itemID), new Tuple(Integer.valueOf(-4), Integer.valueOf(-1))); -+ blacksmithSellingList.put(Integer.valueOf(Item.redstone.itemID), new Tuple(Integer.valueOf(-4), Integer.valueOf(-1))); -+ blacksmithSellingList.put(Integer.valueOf(Item.compass.itemID), new Tuple(Integer.valueOf(10), Integer.valueOf(12))); -+ blacksmithSellingList.put(Integer.valueOf(Item.pocketSundial.itemID), new Tuple(Integer.valueOf(10), Integer.valueOf(12))); -+ blacksmithSellingList.put(Integer.valueOf(Block.glowStone.blockID), new Tuple(Integer.valueOf(-3), Integer.valueOf(-1))); -+ blacksmithSellingList.put(Integer.valueOf(Item.porkCooked.itemID), new Tuple(Integer.valueOf(-7), Integer.valueOf(-5))); -+ blacksmithSellingList.put(Integer.valueOf(Item.beefCooked.itemID), new Tuple(Integer.valueOf(-7), Integer.valueOf(-5))); -+ blacksmithSellingList.put(Integer.valueOf(Item.chickenCooked.itemID), new Tuple(Integer.valueOf(-8), Integer.valueOf(-6))); -+ blacksmithSellingList.put(Integer.valueOf(Item.eyeOfEnder.itemID), new Tuple(Integer.valueOf(7), Integer.valueOf(11))); -+ blacksmithSellingList.put(Integer.valueOf(Item.arrow.itemID), new Tuple(Integer.valueOf(-12), Integer.valueOf(-8))); - } - } ---- net/minecraft/src/GenLayerRiverInit.java -+++ net/minecraft/src/GenLayerRiverInit.java -@@ -1,19 +1,23 @@ - package net.minecraft.src; - - public class GenLayerRiverInit extends GenLayer { -- public GenLayerRiverInit(long var1, GenLayer var3) { -- super(var1); -- this.parent = var3; -+ public GenLayerRiverInit(long par1, GenLayer par3GenLayer) { -+ super(par1); -+ this.parent = par3GenLayer; - } - -- public int[] getInts(int var1, int var2, int var3, int var4) { -- int[] var5 = this.parent.getInts(var1, var2, var3, var4); -- int[] var6 = IntCache.getIntCache(var3 * var4); -+ /** -+ * Returns a list of integer values generated by this layer. These may be interpreted as temperatures, rainfall -+ * amounts, or biomeList[] indices based on the particular GenLayer subclass. -+ */ -+ public int[] getInts(int par1, int par2, int par3, int par4) { -+ int[] var5 = this.parent.getInts(par1, par2, par3, par4); -+ int[] var6 = IntCache.getIntCache(par3 * par4); - -- for(int var7 = 0; var7 < var4; ++var7) { -- for(int var8 = 0; var8 < var3; ++var8) { -- this.initChunkSeed((long)(var8 + var1), (long)(var7 + var2)); -- var6[var8 + var7 * var3] = var5[var8 + var7 * var3] > 0 ? this.nextInt(2) + 2 : 0; -+ for (int var7 = 0; var7 < par4; ++var7) { -+ for (int var8 = 0; var8 < par3; ++var8) { -+ this.initChunkSeed((long)(var8 + par1), (long)(var7 + par2)); -+ var6[var8 + var7 * par3] = var5[var8 + var7 * par3] > 0 ? this.nextInt(2) + 2 : 0; - } - } - ---- net/minecraft/src/PotionHealth.java -+++ net/minecraft/src/PotionHealth.java -@@ -1,15 +1,21 @@ - package net.minecraft.src; - - public class PotionHealth extends Potion { -- public PotionHealth(int var1, boolean var2, int var3) { -- super(var1, var2, var3); -+ public PotionHealth(int par1, boolean par2, int par3) { -+ super(par1, par2, par3); - } - -+ /** -+ * Returns true if the potion has an instant effect instead of a continuous one (eg Harming) -+ */ - public boolean isInstant() { - return true; - } - -- public boolean isReady(int var1, int var2) { -- return var1 >= 1; -+ /** -+ * checks if Potion effect is ready to be applied this tick. -+ */ -+ public boolean isReady(int par1, int par2) { -+ return par1 >= 1; - } - } ---- net/minecraft/src/EntityJumpHelper.java -+++ net/minecraft/src/EntityJumpHelper.java -@@ -4,14 +4,17 @@ - private EntityLiving entity; - private boolean isJumping; - -- public EntityJumpHelper(EntityLiving var1) { -- this.entity = var1; -+ public EntityJumpHelper(EntityLiving par1EntityLiving) { -+ this.entity = par1EntityLiving; - } - - public void setJumping() { - this.isJumping = true; - } - -+ /** -+ * Called to actually make the entity jump if isJumping is true. -+ */ - public void doJump() { - this.entity.setJumping(this.isJumping); - this.isJumping = false; ---- /dev/null -+++ org/spoutcraft/api/gui/GenericListWidget.java -@@ -1,0 +1,218 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.api.gui; -+ -+import java.io.IOException; -+import java.util.ArrayList; -+import java.util.List; -+ -+import org.spoutcraft.api.Spoutcraft; -+import org.spoutcraft.api.io.SpoutInputStream; -+import org.spoutcraft.api.io.SpoutOutputStream; -+ -+public class GenericListWidget extends GenericScrollable implements ListWidget { -+ private List items = new ArrayList(); -+ private int selected = -1; -+ protected int cachedTotalHeight = -1; -+ -+ public WidgetType getType() { -+ return WidgetType.ListWidget; -+ } -+ -+ public ListWidgetItem[] getItems() { -+ ListWidgetItem[] sample = {}; -+ return items.toArray(sample); -+ } -+ -+ public ListWidgetItem getItem(int i) { -+ if (i == -1) { -+ return null; -+ } -+ ListWidgetItem items [] = getItems(); -+ if (i>=items.length) { -+ return null; -+ } -+ return items[i]; -+ } -+ -+ public ListWidget addItem(ListWidgetItem item) { -+ items.add(item); -+ item.setListWidget(this); -+ cachedTotalHeight = -1; -+ return this; -+ } -+ -+ public ListWidget addItems(ListWidgetItem... items) { -+ for (ListWidgetItem item : items) { -+ this.addItem(item); -+ } -+ return this; -+ } -+ -+ public boolean removeItem(ListWidgetItem item) { -+ if (items.contains(item)) { -+ items.remove(item); -+ item.setListWidget(null); -+ cachedTotalHeight = -1; -+ return true; -+ } -+ return false; -+ } -+ -+ public ListWidgetItem getSelectedItem() { -+ return getItem(selected); -+ } -+ -+ public int getSelectedRow() { -+ return selected; -+ } -+ -+ public ListWidget setSelection(int n) { -+ selected = n; -+ if (selected < -1) { -+ selected = -1; -+ } -+ if (selected > items.size()-1) { -+ selected = items.size()-1; -+ } -+ -+ // Check if selection is visible -+ ensureVisible(getItemRect(selected)); -+ return this; -+ } -+ -+ public Rectangle getItemRect(int n) { -+ ListWidgetItem item = getItem(n); -+ Rectangle result = new Rectangle(0,0,0,0); -+ if (item == null) { -+ return result; -+ } -+ result.setX(0); -+ result.setY(getItemYOnScreen(n)); -+ result.setHeight(item.getHeight()); -+ result.setWidth(getInnerSize(Orientation.VERTICAL)); -+ return result; -+ } -+ -+ protected int getItemYOnScreen(int n) { -+ int height = 0; -+ for (int i = 0; i -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.api.util; -+ -+public interface Location extends Vector, FixedLocation { -+ /** -+ * Sets the yaw of this location -+ * -+ * @param yaw New yaw -+ * @return this location -+ */ -+ public Location setYaw(double yaw); -+ -+ /** -+ * Sets the pitch of this location -+ * -+ * @param pitch New pitch -+ * @return this location -+ */ -+ public Location setPitch(double pitch); -+} ---- /dev/null -+++ com/prupe/mcpatcher/ctm/RenderPass$2.java -@@ -1,0 +1,34 @@ -+package com.prupe.mcpatcher.ctm; -+ -+import com.prupe.mcpatcher.BlendMethod; -+import com.prupe.mcpatcher.MCPatcherUtils; -+import com.prupe.mcpatcher.TexturePackAPI; -+import com.prupe.mcpatcher.TexturePackChangeHandler; -+import java.util.Properties; -+ -+final class RenderPass$2 extends TexturePackChangeHandler { -+ RenderPass$2(String x0, int x1) { -+ super(x0, x1); -+ } -+ -+ public void beforeChange() { -+ RenderPass.access$402(BlendMethod.ALPHA); -+ RenderPass.access$502(true); -+ } -+ -+ public void afterChange() { -+ Properties properties = TexturePackAPI.getProperties(RenderPass.access$600()); -+ -+ if (properties != null) { -+ String method = properties.getProperty("blend.3", "alpha").trim().toLowerCase(); -+ RenderPass.access$402(BlendMethod.parse(method)); -+ -+ if (RenderPass.access$400() == null) { -+ RenderPass.access$700().error("%s: unknown blend method \'%s\'", new Object[] {RenderPass.access$600(), method}); -+ RenderPass.access$402(BlendMethod.ALPHA); -+ } -+ -+ RenderPass.access$502(MCPatcherUtils.getBooleanProperty(properties, "enableLightmap.3", !RenderPass.access$400().isColorBased())); -+ } -+ } -+} ---- net/minecraft/src/BlockFlowing.java -+++ net/minecraft/src/BlockFlowing.java -@@ -3,173 +3,210 @@ - import java.util.Random; - - public class BlockFlowing extends BlockFluid { -+ -+ /** -+ * Number of horizontally adjacent liquid source blocks. Diagonal doesn't count. Only source blocks of the same liquid -+ * as the block using the field are counted. -+ */ - int numAdjacentSources; -+ -+ /** -+ * Indicates whether the flow direction is optimal. Each array index corresponds to one of the four cardinal -+ * directions. -+ */ - boolean[] isOptimalFlowDirection = new boolean[4]; -+ -+ /** -+ * The estimated cost to flow in a given direction from the current point. Each array index corresponds to one of the -+ * four cardinal directions. -+ */ - int[] flowCost = new int[4]; - -- protected BlockFlowing(int var1, Material var2) { -- super(var1, var2); -- } -- -- private void updateFlow(World var1, int var2, int var3, int var4) { -- int var5 = var1.getBlockMetadata(var2, var3, var4); -- var1.setBlock(var2, var3, var4, this.blockID + 1, var5, 2); -- } -- -- public boolean getBlocksMovement(IBlockAccess var1, int var2, int var3, int var4) { -+ protected BlockFlowing(int par1, Material par2Material) { -+ super(par1, par2Material); -+ } -+ -+ /** -+ * Updates the flow for the BlockFlowing object. -+ */ -+ private void updateFlow(World par1World, int par2, int par3, int par4) { -+ int var5 = par1World.getBlockMetadata(par2, par3, par4); -+ par1World.setBlock(par2, par3, par4, this.blockID + 1, var5, 2); -+ } -+ -+ public boolean getBlocksMovement(IBlockAccess par1IBlockAccess, int par2, int par3, int par4) { - return this.blockMaterial != Material.lava; - } - -- public void updateTick(World var1, int var2, int var3, int var4, Random var5) { -- int var6 = this.getFlowDecay(var1, var2, var3, var4); -+ /** -+ * Ticks the block if it's been scheduled -+ */ -+ public void updateTick(World par1World, int par2, int par3, int par4, Random par5Random) { -+ int var6 = this.getFlowDecay(par1World, par2, par3, par4); - byte var7 = 1; -- if(this.blockMaterial == Material.lava && !var1.provider.isHellWorld) { -+ -+ if (this.blockMaterial == Material.lava && !par1World.provider.isHellWorld) { - var7 = 2; - } - - boolean var8 = true; -- int var9 = this.tickRate(var1); -+ int var9 = this.tickRate(par1World); - int var11; -- if(var6 > 0) { -+ -+ if (var6 > 0) { - byte var10 = -100; - this.numAdjacentSources = 0; -- int var13 = this.getSmallestFlowDecay(var1, var2 - 1, var3, var4, var10); -- var13 = this.getSmallestFlowDecay(var1, var2 + 1, var3, var4, var13); -- var13 = this.getSmallestFlowDecay(var1, var2, var3, var4 - 1, var13); -- var13 = this.getSmallestFlowDecay(var1, var2, var3, var4 + 1, var13); -+ int var13 = this.getSmallestFlowDecay(par1World, par2 - 1, par3, par4, var10); -+ var13 = this.getSmallestFlowDecay(par1World, par2 + 1, par3, par4, var13); -+ var13 = this.getSmallestFlowDecay(par1World, par2, par3, par4 - 1, var13); -+ var13 = this.getSmallestFlowDecay(par1World, par2, par3, par4 + 1, var13); - var11 = var13 + var7; -- if(var11 >= 8 || var13 < 0) { -+ -+ if (var11 >= 8 || var13 < 0) { - var11 = -1; - } - -- if(this.getFlowDecay(var1, var2, var3 + 1, var4) >= 0) { -- int var12 = this.getFlowDecay(var1, var2, var3 + 1, var4); -- if(var12 >= 8) { -+ if (this.getFlowDecay(par1World, par2, par3 + 1, par4) >= 0) { -+ int var12 = this.getFlowDecay(par1World, par2, par3 + 1, par4); -+ -+ if (var12 >= 8) { - var11 = var12; - } else { - var11 = var12 + 8; - } - } - -- if(this.numAdjacentSources >= 2 && this.blockMaterial == Material.water) { -- if(var1.getBlockMaterial(var2, var3 - 1, var4).isSolid()) { -+ if (this.numAdjacentSources >= 2 && this.blockMaterial == Material.water) { -+ if (par1World.getBlockMaterial(par2, par3 - 1, par4).isSolid()) { - var11 = 0; -- } else if(var1.getBlockMaterial(var2, var3 - 1, var4) == this.blockMaterial && var1.getBlockMetadata(var2, var3 - 1, var4) == 0) { -+ } else if (par1World.getBlockMaterial(par2, par3 - 1, par4) == this.blockMaterial && par1World.getBlockMetadata(par2, par3 - 1, par4) == 0) { - var11 = 0; - } - } - -- if(this.blockMaterial == Material.lava && var6 < 8 && var11 < 8 && var11 > var6 && var5.nextInt(4) != 0) { -+ if (this.blockMaterial == Material.lava && var6 < 8 && var11 < 8 && var11 > var6 && par5Random.nextInt(4) != 0) { - var9 *= 4; - } - -- if(var11 == var6) { -- if(var8) { -- this.updateFlow(var1, var2, var3, var4); -+ if (var11 == var6) { -+ if (var8) { -+ this.updateFlow(par1World, par2, par3, par4); - } - } else { - var6 = var11; -- if(var11 < 0) { -- var1.setBlockToAir(var2, var3, var4); -+ -+ if (var11 < 0) { -+ par1World.setBlockToAir(par2, par3, par4); - } else { -- var1.setBlockMetadata(var2, var3, var4, var11, 2); -- var1.scheduleBlockUpdate(var2, var3, var4, this.blockID, var9); -- var1.notifyBlocksOfNeighborChange(var2, var3, var4, this.blockID); -+ par1World.setBlockMetadataWithNotify(par2, par3, par4, var11, 2); -+ par1World.scheduleBlockUpdate(par2, par3, par4, this.blockID, var9); -+ par1World.notifyBlocksOfNeighborChange(par2, par3, par4, this.blockID); - } - } - } else { -- this.updateFlow(var1, var2, var3, var4); -+ this.updateFlow(par1World, par2, par3, par4); - } - -- if(this.liquidCanDisplaceBlock(var1, var2, var3 - 1, var4)) { -- if(this.blockMaterial == Material.lava && var1.getBlockMaterial(var2, var3 - 1, var4) == Material.water) { -- var1.setBlock(var2, var3 - 1, var4, Block.stone.blockID); -- this.triggerLavaMixEffects(var1, var2, var3 - 1, var4); -+ if (this.liquidCanDisplaceBlock(par1World, par2, par3 - 1, par4)) { -+ if (this.blockMaterial == Material.lava && par1World.getBlockMaterial(par2, par3 - 1, par4) == Material.water) { -+ par1World.setBlock(par2, par3 - 1, par4, Block.stone.blockID); -+ this.triggerLavaMixEffects(par1World, par2, par3 - 1, par4); - return; - } - -- if(var6 >= 8) { -- this.flowIntoBlock(var1, var2, var3 - 1, var4, var6); -+ if (var6 >= 8) { -+ this.flowIntoBlock(par1World, par2, par3 - 1, par4, var6); - } else { -- this.flowIntoBlock(var1, var2, var3 - 1, var4, var6 + 8); -+ this.flowIntoBlock(par1World, par2, par3 - 1, par4, var6 + 8); - } -- } else if(var6 >= 0 && (var6 == 0 || this.blockBlocksFlow(var1, var2, var3 - 1, var4))) { -- boolean[] var14 = this.getOptimalFlowDirections(var1, var2, var3, var4); -+ } else if (var6 >= 0 && (var6 == 0 || this.blockBlocksFlow(par1World, par2, par3 - 1, par4))) { -+ boolean[] var14 = this.getOptimalFlowDirections(par1World, par2, par3, par4); - var11 = var6 + var7; -- if(var6 >= 8) { -+ -+ if (var6 >= 8) { - var11 = 1; - } - -- if(var11 >= 8) { -+ if (var11 >= 8) { - return; - } - -- if(var14[0]) { -- this.flowIntoBlock(var1, var2 - 1, var3, var4, var11); -- } -- -- if(var14[1]) { -- this.flowIntoBlock(var1, var2 + 1, var3, var4, var11); -- } -- -- if(var14[2]) { -- this.flowIntoBlock(var1, var2, var3, var4 - 1, var11); -- } -- -- if(var14[3]) { -- this.flowIntoBlock(var1, var2, var3, var4 + 1, var11); -+ if (var14[0]) { -+ this.flowIntoBlock(par1World, par2 - 1, par3, par4, var11); -+ } -+ -+ if (var14[1]) { -+ this.flowIntoBlock(par1World, par2 + 1, par3, par4, var11); -+ } -+ -+ if (var14[2]) { -+ this.flowIntoBlock(par1World, par2, par3, par4 - 1, var11); -+ } -+ -+ if (var14[3]) { -+ this.flowIntoBlock(par1World, par2, par3, par4 + 1, var11); - } - } -- - } - -- private void flowIntoBlock(World var1, int var2, int var3, int var4, int var5) { -- if(this.liquidCanDisplaceBlock(var1, var2, var3, var4)) { -- int var6 = var1.getBlockId(var2, var3, var4); -- if(var6 > 0) { -- if(this.blockMaterial == Material.lava) { -- this.triggerLavaMixEffects(var1, var2, var3, var4); -+ /** -+ * flowIntoBlock(World world, int x, int y, int z, int newFlowDecay) - Flows into the block at the coordinates and -+ * changes the block type to the liquid. -+ */ -+ private void flowIntoBlock(World par1World, int par2, int par3, int par4, int par5) { -+ if (this.liquidCanDisplaceBlock(par1World, par2, par3, par4)) { -+ int var6 = par1World.getBlockId(par2, par3, par4); -+ -+ if (var6 > 0) { -+ if (this.blockMaterial == Material.lava) { -+ this.triggerLavaMixEffects(par1World, par2, par3, par4); - } else { -- Block.blocksList[var6].dropBlockAsItem(var1, var2, var3, var4, var1.getBlockMetadata(var2, var3, var4), 0); -+ Block.blocksList[var6].dropBlockAsItem(par1World, par2, par3, par4, par1World.getBlockMetadata(par2, par3, par4), 0); - } - } - -- var1.setBlock(var2, var3, var4, this.blockID, var5, 3); -+ par1World.setBlock(par2, par3, par4, this.blockID, par5, 3); - } -- - } - -- private int calculateFlowCost(World var1, int var2, int var3, int var4, int var5, int var6) { -+ /** -+ * calculateFlowCost(World world, int x, int y, int z, int accumulatedCost, int previousDirectionOfFlow) - Used to -+ * determine the path of least resistance, this method returns the lowest possible flow cost for the direction of flow -+ * indicated. Each necessary horizontal flow adds to the flow cost. -+ */ -+ private int calculateFlowCost(World par1World, int par2, int par3, int par4, int par5, int par6) { - int var7 = 1000; - -- for(int var8 = 0; var8 < 4; ++var8) { -- if((var8 != 0 || var6 != 1) && (var8 != 1 || var6 != 0) && (var8 != 2 || var6 != 3) && (var8 != 3 || var6 != 2)) { -- int var9 = var2; -- int var11 = var4; -- if(var8 == 0) { -- var9 = var2 - 1; -+ for (int var8 = 0; var8 < 4; ++var8) { -+ if ((var8 != 0 || par6 != 1) && (var8 != 1 || par6 != 0) && (var8 != 2 || par6 != 3) && (var8 != 3 || par6 != 2)) { -+ int var9 = par2; -+ int var11 = par4; -+ -+ if (var8 == 0) { -+ var9 = par2 - 1; - } - -- if(var8 == 1) { -+ if (var8 == 1) { - ++var9; - } - -- if(var8 == 2) { -- var11 = var4 - 1; -+ if (var8 == 2) { -+ var11 = par4 - 1; - } - -- if(var8 == 3) { -+ if (var8 == 3) { - ++var11; - } - -- if(!this.blockBlocksFlow(var1, var9, var3, var11) && (var1.getBlockMaterial(var9, var3, var11) != this.blockMaterial || var1.getBlockMetadata(var9, var3, var11) != 0)) { -- if(!this.blockBlocksFlow(var1, var9, var3 - 1, var11)) { -- return var5; -+ if (!this.blockBlocksFlow(par1World, var9, par3, var11) && (par1World.getBlockMaterial(var9, par3, var11) != this.blockMaterial || par1World.getBlockMetadata(var9, par3, var11) != 0)) { -+ if (!this.blockBlocksFlow(par1World, var9, par3 - 1, var11)) { -+ return par5; - } - -- if(var5 < 4) { -- int var12 = this.calculateFlowCost(var1, var9, var3, var11, var5 + 1, var8); -- if(var12 < var7) { -+ if (par5 < 4) { -+ int var12 = this.calculateFlowCost(par1World, var9, par3, var11, par5 + 1, var8); -+ -+ if (var12 < var7) { - var7 = var12; - } - } -@@ -180,32 +217,39 @@ - return var7; - } - -- private boolean[] getOptimalFlowDirections(World var1, int var2, int var3, int var4) { -+ /** -+ * Returns a boolean array indicating which flow directions are optimal based on each direction's calculated flow cost. -+ * Each array index corresponds to one of the four cardinal directions. A value of true indicates the direction is -+ * optimal. -+ */ -+ private boolean[] getOptimalFlowDirections(World par1World, int par2, int par3, int par4) { - int var5; - int var6; -- for(var5 = 0; var5 < 4; ++var5) { -+ -+ for (var5 = 0; var5 < 4; ++var5) { - this.flowCost[var5] = 1000; -- var6 = var2; -- int var8 = var4; -- if(var5 == 0) { -- var6 = var2 - 1; -+ var6 = par2; -+ int var8 = par4; -+ -+ if (var5 == 0) { -+ var6 = par2 - 1; - } - -- if(var5 == 1) { -+ if (var5 == 1) { - ++var6; - } - -- if(var5 == 2) { -- var8 = var4 - 1; -+ if (var5 == 2) { -+ var8 = par4 - 1; - } - -- if(var5 == 3) { -+ if (var5 == 3) { - ++var8; - } - -- if(!this.blockBlocksFlow(var1, var6, var3, var8) && (var1.getBlockMaterial(var6, var3, var8) != this.blockMaterial || var1.getBlockMetadata(var6, var3, var8) != 0)) { -- if(this.blockBlocksFlow(var1, var6, var3 - 1, var8)) { -- this.flowCost[var5] = this.calculateFlowCost(var1, var6, var3, var8, 1, var5); -+ if (!this.blockBlocksFlow(par1World, var6, par3, var8) && (par1World.getBlockMaterial(var6, par3, var8) != this.blockMaterial || par1World.getBlockMetadata(var6, par3, var8) != 0)) { -+ if (this.blockBlocksFlow(par1World, var6, par3 - 1, var8)) { -+ this.flowCost[var5] = this.calculateFlowCost(par1World, var6, par3, var8, 1, var5); - } else { - this.flowCost[var5] = 0; - } -@@ -214,23 +258,27 @@ - - var5 = this.flowCost[0]; - -- for(var6 = 1; var6 < 4; ++var6) { -- if(this.flowCost[var6] < var5) { -+ for (var6 = 1; var6 < 4; ++var6) { -+ if (this.flowCost[var6] < var5) { - var5 = this.flowCost[var6]; - } - } - -- for(var6 = 0; var6 < 4; ++var6) { -+ for (var6 = 0; var6 < 4; ++var6) { - this.isOptimalFlowDirection[var6] = this.flowCost[var6] == var5; - } - - return this.isOptimalFlowDirection; - } - -- private boolean blockBlocksFlow(World var1, int var2, int var3, int var4) { -- int var5 = var1.getBlockId(var2, var3, var4); -- if(var5 != Block.doorWood.blockID && var5 != Block.doorIron.blockID && var5 != Block.signPost.blockID && var5 != Block.ladder.blockID && var5 != Block.reed.blockID) { -- if(var5 == 0) { -+ /** -+ * Returns true if block at coords blocks fluids -+ */ -+ private boolean blockBlocksFlow(World par1World, int par2, int par3, int par4) { -+ int var5 = par1World.getBlockId(par2, par3, par4); -+ -+ if (var5 != Block.doorWood.blockID && var5 != Block.doorIron.blockID && var5 != Block.signPost.blockID && var5 != Block.ladder.blockID && var5 != Block.reed.blockID) { -+ if (var5 == 0) { - return false; - } else { - Material var6 = Block.blocksList[var5].blockMaterial; -@@ -241,34 +289,47 @@ - } - } - -- protected int getSmallestFlowDecay(World var1, int var2, int var3, int var4, int var5) { -- int var6 = this.getFlowDecay(var1, var2, var3, var4); -- if(var6 < 0) { -- return var5; -+ /** -+ * getSmallestFlowDecay(World world, intx, int y, int z, int currentSmallestFlowDecay) - Looks up the flow decay at the -+ * coordinates given and returns the smaller of this value or the provided currentSmallestFlowDecay. If one value is -+ * valid and the other isn't, the valid value will be returned. Valid values are >= 0. Flow decay is the amount that a -+ * liquid has dissipated. 0 indicates a source block. -+ */ -+ protected int getSmallestFlowDecay(World par1World, int par2, int par3, int par4, int par5) { -+ int var6 = this.getFlowDecay(par1World, par2, par3, par4); -+ -+ if (var6 < 0) { -+ return par5; - } else { -- if(var6 == 0) { -+ if (var6 == 0) { - ++this.numAdjacentSources; - } - -- if(var6 >= 8) { -+ if (var6 >= 8) { - var6 = 0; - } - -- return var5 >= 0 && var6 >= var5 ? var5 : var6; -- } -- } -- -- private boolean liquidCanDisplaceBlock(World var1, int var2, int var3, int var4) { -- Material var5 = var1.getBlockMaterial(var2, var3, var4); -- return var5 == this.blockMaterial ? false : (var5 == Material.lava ? false : !this.blockBlocksFlow(var1, var2, var3, var4)); -- } -- -- public void onBlockAdded(World var1, int var2, int var3, int var4) { -- super.onBlockAdded(var1, var2, var3, var4); -- if(var1.getBlockId(var2, var3, var4) == this.blockID) { -- var1.scheduleBlockUpdate(var2, var3, var4, this.blockID, this.tickRate(var1)); -- } -- -+ return par5 >= 0 && var6 >= par5 ? par5 : var6; -+ } -+ } -+ -+ /** -+ * Returns true if the block at the coordinates can be displaced by the liquid. -+ */ -+ private boolean liquidCanDisplaceBlock(World par1World, int par2, int par3, int par4) { -+ Material var5 = par1World.getBlockMaterial(par2, par3, par4); -+ return var5 == this.blockMaterial ? false : (var5 == Material.lava ? false : !this.blockBlocksFlow(par1World, par2, par3, par4)); -+ } -+ -+ /** -+ * Called whenever the block is added into the world. Args: world, x, y, z -+ */ -+ public void onBlockAdded(World par1World, int par2, int par3, int par4) { -+ super.onBlockAdded(par1World, par2, par3, par4); -+ -+ if (par1World.getBlockId(par2, par3, par4) == this.blockID) { -+ par1World.scheduleBlockUpdate(par2, par3, par4, this.blockID, this.tickRate(par1World)); -+ } - } - - public boolean func_82506_l() { ---- /dev/null -+++ org/spoutcraft/client/packet/PacketNotification.java -@@ -1,0 +1,63 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.client.packet; -+ -+import java.io.IOException; -+ -+import org.spoutcraft.api.io.SpoutInputStream; -+import org.spoutcraft.api.io.SpoutOutputStream; -+import org.spoutcraft.client.SpoutClient; -+ -+public class PacketNotification extends PacketAlert { -+ protected int time; -+ protected short data; -+ public PacketNotification() { -+ } -+ -+ public PacketNotification(String title, String message, int itemId, short data, int time) { -+ super(title, message, itemId); -+ this.time = time; -+ this.data = data; -+ } -+ -+ public void readData(SpoutInputStream input) throws IOException { -+ super.readData(input); -+ this.data = input.readShort(); -+ this.time = input.readInt(); -+ } -+ -+ public void writeData(SpoutOutputStream output) throws IOException { -+ super.writeData(output); -+ output.writeShort(data); -+ output.writeInt(time); -+ } -+ -+ public PacketType getPacketType() { -+ return PacketType.PacketNotification; -+ } -+ -+ public void run(int PlayerId) { -+ SpoutClient.getInstance().getActivePlayer().showAchievement(title, message, itemId, data, time); -+ } -+ -+ public int getVersion() { -+ return 0; -+ } -+} ---- net/minecraft/src/ItemCloth.java -+++ net/minecraft/src/ItemCloth.java -@@ -1,21 +1,31 @@ - package net.minecraft.src; - - public class ItemCloth extends ItemBlock { -- public ItemCloth(int var1) { -- super(var1); -+ public ItemCloth(int par1) { -+ super(par1); - this.setMaxDamage(0); - this.setHasSubtypes(true); - } - -- public Icon getIconFromDamage(int var1) { -- return Block.cloth.getIcon(2, BlockColored.getBlockFromDye(var1)); -- } -- -- public int getMetadata(int var1) { -- return var1; -- } -- -- public String getUnlocalizedName(ItemStack var1) { -- return super.getUnlocalizedName() + "." + ItemDye.a[BlockColored.getBlockFromDye(var1.getItemDamage())]; -+ /** -+ * Gets an icon index based on an item's damage value -+ */ -+ public Icon getIconFromDamage(int par1) { -+ return Block.cloth.getIcon(2, BlockColored.getBlockFromDye(par1)); -+ } -+ -+ /** -+ * Returns the metadata of the block which this Item (ItemBlock) can place -+ */ -+ public int getMetadata(int par1) { -+ return par1; -+ } -+ -+ /** -+ * Returns the unlocalized name of this item. This version accepts an ItemStack so different stacks can have different -+ * names based on their damage or NBT. -+ */ -+ public String getUnlocalizedName(ItemStack par1ItemStack) { -+ return super.getUnlocalizedName() + "." + ItemDye.dyeColorNames[BlockColored.getBlockFromDye(par1ItemStack.getItemDamage())]; - } - } ---- net/minecraft/src/World.java -+++ net/minecraft/src/World.java -@@ -8,75 +8,185 @@ - import java.util.List; - import java.util.Random; - import java.util.Set; -+ -+import gnu.trove.map.hash.TIntObjectHashMap; -+ -+import com.prupe.mcpatcher.cc.ColorizeWorld; -+import com.prupe.mcpatcher.cc.Colorizer; -+ -+import org.newdawn.slick.opengl.Texture; -+ - import net.minecraft.server.MinecraftServer; -+import net.minecraft.src.NBTTagCompound; -+ -+// Spout Start -+import org.spoutcraft.api.Spoutcraft; -+import org.spoutcraft.api.material.CustomBlock; -+import org.spoutcraft.api.material.MaterialData; -+import org.spoutcraft.client.SpoutClient; -+import org.spoutcraft.client.SpoutcraftWorld; -+import org.spoutcraft.client.block.SpoutcraftChunk; -+import org.spoutcraft.client.config.Configuration; -+// Spout End - - public abstract class World implements IBlockAccess { -+ -+ /** -+ * boolean; if true updates scheduled by scheduleBlockUpdate happen immediately -+ */ - public boolean scheduledUpdatesAreImmediate; -- public List e = new ArrayList(); -- protected List f = new ArrayList(); -- public List g = new ArrayList(); -- private List a = new ArrayList(); -- private List b = new ArrayList(); -- public List h = new ArrayList(); -- public List i = new ArrayList(); -+ -+ /** A list of all Entities in all currently-loaded chunks */ -+ public List loadedEntityList = new ArrayList(); -+ protected List unloadedEntityList = new ArrayList(); -+ -+ /** A list of all TileEntities in all currently-loaded chunks */ -+ public List loadedTileEntityList = new ArrayList(); -+ private List addedTileEntityList = new ArrayList(); -+ -+ /** Entities marked for removal. */ -+ private List entityRemoval = new ArrayList(); -+ -+ /** Array list of players in the world. */ -+ public List playerEntities = new ArrayList(); -+ -+ /** a list of all the lightning entities */ -+ public List weatherEffects = new ArrayList(); - private long cloudColour = 16777215L; -+ -+ /** How much light is subtracted from full daylight */ - public int skylightSubtracted; -+ -+ /** -+ * Contains the current Linear Congruential Generator seed for block updates. Used with an A value of 3 and a C value -+ * of 0x3c6ef35f, producing a highly planar series of values ill-suited for choosing random blocks in a 16x128x16 -+ * field. -+ */ - protected int updateLCG = (new Random()).nextInt(); -+ -+ /** -+ * magic number used to generate fast random numbers for 3d distribution within a chunk -+ */ - protected final int DIST_HASH_MAGIC = 1013904223; - protected float prevRainingStrength; - protected float rainingStrength; - protected float prevThunderingStrength; - protected float thunderingStrength; -+ -+ /** -+ * Set to 2 whenever a lightning bolt is generated in SSP. Decrements if > 0 in updateWeather(). Value appears to be -+ * unused. -+ */ - public int lastLightningBolt; -+ -+ /** Option > Difficulty setting (0 - 3) */ - public int difficultySetting; -- public Random s = new Random(); -+ -+ /** RNG for World. */ -+ public Random rand = new Random(); -+ -+ /** The WorldProvider instance that World uses. */ - public final WorldProvider provider; -- protected List u = new ArrayList(); -- protected IChunkProvider chunkProvider; -+ protected List worldAccesses = new ArrayList(); -+ -+ /** Handles chunk operations and caching */ -+ // Spout Start - protected to public -+ public IChunkProvider chunkProvider; -+ // Spout End - protected final ISaveHandler saveHandler; -- protected WorldInfo worldInfo; -+ -+ /** -+ * holds information about a world (size on disk, time, spawn point, seed, ...) -+ */ -+ // Spout Start - protected to public -+ public WorldInfo worldInfo; -+ // Spout End -+ -+ /** Boolean that is set to true when trying to find a spawn point */ - public boolean findingSpawnPoint; - public MapStorage mapStorage; - public final VillageCollection villageCollectionObj; - protected final VillageSiege villageSiegeObj = new VillageSiege(this); - public final Profiler theProfiler; -+ -+ /** The world-local pool of vectors */ - private final Vec3Pool vecPool = new Vec3Pool(300, 2000); -- private final Calendar K = Calendar.getInstance(); -+ private final Calendar theCalendar = Calendar.getInstance(); - protected Scoreboard worldScoreboard = new Scoreboard(); -+ -+ /** The log agent for this world. */ - private final ILogAgent worldLogAgent; -- private ArrayList M = new ArrayList(); -+ private ArrayList collidingBoundingBoxes = new ArrayList(); - private boolean scanningTileEntities; -- protected boolean spawnHostileMobs = true; -- protected boolean spawnPeacefulMobs = true; -- protected Set G = new HashSet(); -- private int ambientTickCountdown = this.s.nextInt(12000); -- int[] lightUpdateBlockList = new int[-Short.MIN_VALUE]; -+ -+ /** indicates if enemies are spawned or not */ -+ // Spout Start - protected to public -+ public boolean spawnHostileMobs = true; -+ // Spout End -+ -+ /** A flag indicating whether we should spawn peaceful mobs. */ -+ // Spout Start - protected to public -+ public boolean spawnPeacefulMobs = true; -+ // Spout End -+ -+ /** Positions to update */ -+ protected Set activeChunkSet = new HashSet(); -+ -+ /** number of ticks until the next random ambients play */ -+ private int ambientTickCountdown; -+ -+ /** -+ * is a temporary list of blocks and light values used when updating light levels. Holds up to 32x32x32 blocks (the -+ * maximum influence of a light source.) Every element is a packed bit value: 0000000000LLLLzzzzzzyyyyyyxxxxxx. The -+ * 4-bit L is a light level used when darkening blocks. 6-bit numbers x, y and z represent the block's offset from the -+ * original block, plus 32 (i.e. value of 31 would mean a -1 offset -+ */ -+ // Spout Start - public -+ public int[] lightUpdateBlockList; -+ // Spout End -+ -+ /** This is set to true for client worlds, and false for server worlds. */ - public boolean isRemote; -- -- public BiomeGenBase getBiomeGenForCoords(int var1, int var2) { -- if(this.blockExists(var1, 0, var2)) { -- Chunk var3 = this.getChunkFromBlockCoords(var1, var2); -- if(var3 != null) { -- return var3.getBiomeGenForWorldCoords(var1 & 15, var2 & 15, this.provider.worldChunkMgr); -+ // Spout Start -+ public final SpoutcraftWorld world = new SpoutcraftWorld(this); -+ public final TIntObjectHashMap customTitles = new TIntObjectHashMap(200); -+ // Spout End -+ -+ /** -+ * Gets the biome for a given set of x/z coordinates -+ */ -+ public BiomeGenBase getBiomeGenForCoords(int par1, int par2) { -+ if (this.blockExists(par1, 0, par2)) { -+ Chunk var3 = this.getChunkFromBlockCoords(par1, par2); -+ -+ if (var3 != null) { -+ return var3.getBiomeGenForWorldCoords(par1 & 15, par2 & 15, this.provider.worldChunkMgr); - } - } - -- return this.provider.worldChunkMgr.getBiomeGenAt(var1, var2); -+ return this.provider.worldChunkMgr.getBiomeGenAt(par1, par2); - } - - public WorldChunkManager getWorldChunkManager() { - return this.provider.worldChunkMgr; - } - -- public World(ISaveHandler var1, String var2, WorldProvider var3, WorldSettings var4, Profiler var5, ILogAgent var6) { -- this.saveHandler = var1; -- this.theProfiler = var5; -- this.worldInfo = new WorldInfo(var4, var2); -- this.provider = var3; -- this.mapStorage = new MapStorage(var1); -- this.worldLogAgent = var6; -+ public World(ISaveHandler par1ISaveHandler, String par2Str, WorldProvider par3WorldProvider, WorldSettings par4WorldSettings, Profiler par5Profiler, ILogAgent par6ILogAgent) { -+ this.ambientTickCountdown = this.rand.nextInt(12000); -+ if (Configuration.optimizedLightingUpdates) { -+ this.lightUpdateBlockList = new int[256]; -+ } else { -+ this.lightUpdateBlockList = new int[32768]; -+ } -+ this.saveHandler = par1ISaveHandler; -+ this.theProfiler = par5Profiler; -+ this.worldInfo = new WorldInfo(par4WorldSettings, par2Str); -+ this.provider = par3WorldProvider; -+ this.mapStorage = new MapStorage(par1ISaveHandler); -+ this.worldLogAgent = par6ILogAgent; - VillageCollection var7 = (VillageCollection)this.mapStorage.loadData(VillageCollection.class, "villages"); -- if(var7 == null) { -+ -+ if (var7 == null) { - this.villageCollectionObj = new VillageCollection(this); - this.mapStorage.setData("villages", this.villageCollectionObj); - } else { -@@ -84,43 +194,52 @@ - this.villageCollectionObj.func_82566_a(this); - } - -- var3.registerWorld(this); -+ par3WorldProvider.registerWorld(this); - this.chunkProvider = this.createChunkProvider(); - this.calculateInitialSkylight(); - this.calculateInitialWeather(); - } - -- public World(ISaveHandler var1, String var2, WorldSettings var3, WorldProvider var4, Profiler var5, ILogAgent var6) { -- this.saveHandler = var1; -- this.theProfiler = var5; -- this.mapStorage = new MapStorage(var1); -- this.worldLogAgent = var6; -- this.worldInfo = var1.loadWorldInfo(); -- if(var4 != null) { -- this.provider = var4; -- } else if(this.worldInfo != null && this.worldInfo.getDimension() != 0) { -- this.provider = WorldProvider.getProviderForDimension(this.worldInfo.getDimension()); -+ public World(ISaveHandler par1ISaveHandler, String par2Str, WorldSettings par3WorldSettings, WorldProvider par4WorldProvider, Profiler par5Profiler, ILogAgent par6ILogAgent) { -+ this.ambientTickCountdown = this.rand.nextInt(12000); -+ if (Configuration.optimizedLightingUpdates) { -+ this.lightUpdateBlockList = new int[256]; -+ } else { -+ this.lightUpdateBlockList = new int[32768]; -+ } -+ this.saveHandler = par1ISaveHandler; -+ this.theProfiler = par5Profiler; -+ this.mapStorage = new MapStorage(par1ISaveHandler); -+ this.worldLogAgent = par6ILogAgent; -+ this.worldInfo = par1ISaveHandler.loadWorldInfo(); -+ -+ if (par4WorldProvider != null) { -+ this.provider = par4WorldProvider; -+ } else if (this.worldInfo != null && this.worldInfo.getVanillaDimension() != 0) { -+ this.provider = WorldProvider.getProviderForDimension(this.worldInfo.getVanillaDimension()); - } else { - this.provider = WorldProvider.getProviderForDimension(0); - } - -- if(this.worldInfo == null) { -- this.worldInfo = new WorldInfo(var3, var2); -+ if (this.worldInfo == null) { -+ this.worldInfo = new WorldInfo(par3WorldSettings, par2Str); - } else { -- this.worldInfo.setWorldName(var2); -+ this.worldInfo.setWorldName(par2Str); - } - - this.provider.registerWorld(this); - this.chunkProvider = this.createChunkProvider(); -- if(!this.worldInfo.isInitialized()) { -+ -+ if (!this.worldInfo.isInitialized()) { - try { -- this.initialize(var3); -+ this.initialize(par3WorldSettings); - } catch (Throwable var11) { - CrashReport var8 = CrashReport.makeCrashReport(var11, "Exception initializing level"); - - try { - this.addWorldInfoToCrashReport(var8); - } catch (Throwable var10) { -+ ; - } - - throw new ReportedException(var8); -@@ -130,7 +249,8 @@ - } - - VillageCollection var7 = (VillageCollection)this.mapStorage.loadData(VillageCollection.class, "villages"); -- if(var7 == null) { -+ -+ if (var7 == null) { - this.villageCollectionObj = new VillageCollection(this); - this.mapStorage.setData("villages", this.villageCollectionObj); - } else { -@@ -142,41 +262,55 @@ - this.calculateInitialWeather(); - } - -+ /** -+ * Creates the chunk provider for this world. Called in the constructor. Retrieves provider from worldProvider? -+ */ - protected abstract IChunkProvider createChunkProvider(); - -- protected void initialize(WorldSettings var1) { -+ protected void initialize(WorldSettings par1WorldSettings) { - this.worldInfo.setServerInitialized(true); - } - -+ /** -+ * Sets a new spawn location by finding an uncovered block at a random (x,z) location in the chunk. -+ */ - public void setSpawnLocation() { - this.setSpawnLocation(8, 64, 8); - } - -- public int getFirstUncoveredBlock(int var1, int var2) { -+ /** -+ * Returns the block ID of the first block at this (x,z) location with air above it, searching from sea level upwards. -+ */ -+ public int getFirstUncoveredBlock(int par1, int par2) { - int var3; -- for(var3 = 63; !this.isAirBlock(var1, var3 + 1, var2); ++var3) { -+ -+ for (var3 = 63; !this.isAirBlock(par1, var3 + 1, par2); ++var3) { -+ ; - } - -- return this.getBlockId(var1, var3, var2); -+ return this.getBlockId(par1, var3, par2); - } - -- public int getBlockId(int var1, int var2, int var3) { -- if(var1 >= -30000000 && var3 >= -30000000 && var1 < 30000000 && var3 < 30000000) { -- if(var2 < 0) { -+ /** -+ * Returns the block ID at coords x,y,z -+ */ -+ public int getBlockId(int par1, int par2, int par3) { -+ if (par1 >= -30000000 && par3 >= -30000000 && par1 < 30000000 && par3 < 30000000) { -+ if (par2 < 0) { - return 0; -- } else if(var2 >= 256) { -+ } else if (par2 >= 256) { - return 0; - } else { - Chunk var4 = null; - - try { -- var4 = this.getChunkFromChunkCoords(var1 >> 4, var3 >> 4); -- return var4.getBlockID(var1 & 15, var2, var3 & 15); -+ var4 = this.getChunkFromChunkCoords(par1 >> 4, par3 >> 4); -+ return var4.getBlockID(par1 & 15, par2, par3 & 15); - } catch (Throwable var8) { - CrashReport var6 = CrashReport.makeCrashReport(var8, "Exception getting block type in world"); - CrashReportCategory var7 = var6.makeCategory("Requested block coordinates"); - var7.addCrashSection("Found chunk", Boolean.valueOf(var4 == null)); -- var7.addCrashSection("Location", CrashReportCategory.getLocationInfo(var1, var2, var3)); -+ var7.addCrashSection("Location", CrashReportCategory.getLocationInfo(par1, par2, par3)); - throw new ReportedException(var6); - } - } -@@ -185,88 +319,123 @@ - } - } - -- public boolean isAirBlock(int var1, int var2, int var3) { -- return this.getBlockId(var1, var2, var3) == 0; -+ /** -+ * Returns true if the block at the specified coordinates is empty -+ */ -+ public boolean isAirBlock(int par1, int par2, int par3) { -+ return this.getBlockId(par1, par2, par3) == 0; - } - -- public boolean blockHasTileEntity(int var1, int var2, int var3) { -- int var4 = this.getBlockId(var1, var2, var3); -+ /** -+ * Checks if a block at a given position should have a tile entity. -+ */ -+ public boolean blockHasTileEntity(int par1, int par2, int par3) { -+ int var4 = this.getBlockId(par1, par2, par3); - return Block.blocksList[var4] != null && Block.blocksList[var4].hasTileEntity(); - } - -- public int blockGetRenderType(int var1, int var2, int var3) { -- int var4 = this.getBlockId(var1, var2, var3); -+ /** -+ * Returns the render type of the block at the given coordinate. -+ */ -+ public int blockGetRenderType(int par1, int par2, int par3) { -+ int var4 = this.getBlockId(par1, par2, par3); - return Block.blocksList[var4] != null ? Block.blocksList[var4].getRenderType() : -1; - } - -- public boolean blockExists(int var1, int var2, int var3) { -- return var2 >= 0 && var2 < 256 ? this.chunkExists(var1 >> 4, var3 >> 4) : false; -- } -- -- public boolean doChunksNearChunkExist(int var1, int var2, int var3, int var4) { -- return this.checkChunksExist(var1 - var4, var2 - var4, var3 - var4, var1 + var4, var2 + var4, var3 + var4); -- } -- -- public boolean checkChunksExist(int var1, int var2, int var3, int var4, int var5, int var6) { -- if(var5 >= 0 && var2 < 256) { -- var1 >>= 4; -- var3 >>= 4; -- var4 >>= 4; -- var6 >>= 4; -- -- for(int var7 = var1; var7 <= var4; ++var7) { -- for(int var8 = var3; var8 <= var6; ++var8) { -- if(!this.chunkExists(var7, var8)) { -- return false; -- } -+ /** -+ * Returns whether a block exists at world coordinates x, y, z -+ */ -+ public boolean blockExists(int par1, int par2, int par3) { -+ return par2 >= 0 && par2 < 256 ? this.chunkExists(par1 >> 4, par3 >> 4) : false; -+ } -+ -+ /** -+ * Checks if any of the chunks within distance (argument 4) blocks of the given block exist -+ */ -+ public boolean doChunksNearChunkExist(int par1, int par2, int par3, int par4) { -+ return this.checkChunksExist(par1 - par4, par2 - par4, par3 - par4, par1 + par4, par2 + par4, par3 + par4); -+ } -+ -+ /** -+ * Checks between a min and max all the chunks inbetween actually exist. Args: minX, minY, minZ, maxX, maxY, maxZ -+ */ -+ public boolean checkChunksExist(int par1, int par2, int par3, int par4, int par5, int par6) { -+ if (par5 >= 0 && par2 < 256) { -+ par1 >>= 4; -+ par3 >>= 4; -+ par4 >>= 4; -+ par6 >>= 4; -+ -+ for (int var7 = par1; var7 <= par4; ++var7) { -+ for (int var8 = par3; var8 <= par6; ++var8) { -+ if (!this.chunkExists(var7, var8)) { -+ return false; - } - } -+ } - -- return true; -+ return true; - } else { - return false; - } - } - -- protected boolean chunkExists(int var1, int var2) { -- return this.chunkProvider.chunkExists(var1, var2); -- } -- -- public Chunk getChunkFromBlockCoords(int var1, int var2) { -- return this.getChunkFromChunkCoords(var1 >> 4, var2 >> 4); -- } -- -- public Chunk getChunkFromChunkCoords(int var1, int var2) { -- return this.chunkProvider.provideChunk(var1, var2); -- } -- -- public boolean setBlock(int var1, int var2, int var3, int var4, int var5, int var6) { -- if(var1 >= -30000000 && var3 >= -30000000 && var1 < 30000000 && var3 < 30000000) { -- if(var2 < 0) { -+ /** -+ * Returns whether a chunk exists at chunk coordinates x, y -+ */ -+ protected boolean chunkExists(int par1, int par2) { -+ return this.chunkProvider.chunkExists(par1, par2); -+ } -+ -+ /** -+ * Returns a chunk looked up by block coordinates. Args: x, z -+ */ -+ public Chunk getChunkFromBlockCoords(int par1, int par2) { -+ return this.getChunkFromChunkCoords(par1 >> 4, par2 >> 4); -+ } -+ -+ /** -+ * Returns back a chunk looked up by chunk coordinates Args: x, y -+ */ -+ public Chunk getChunkFromChunkCoords(int par1, int par2) { -+ return this.chunkProvider.provideChunk(par1, par2); -+ } -+ -+ /** -+ * Sets the block ID and metadata at a given location. Args: X, Y, Z, new block ID, new metadata, flags. Flag 1 will -+ * cause a block update. Flag 2 will send the change to clients (you almost always want this). Flag 4 prevents the -+ * block from being re-rendered, if this is a client world. Flags can be added together. -+ */ -+ public boolean setBlock(int par1, int par2, int par3, int par4, int par5, int par6) { -+ if (par1 >= -30000000 && par3 >= -30000000 && par1 < 30000000 && par3 < 30000000) { -+ if (par2 < 0) { - return false; -- } else if(var2 >= 256) { -+ } else if (par2 >= 256) { - return false; - } else { -- Chunk var7 = this.getChunkFromChunkCoords(var1 >> 4, var3 >> 4); -+ Chunk var7 = this.getChunkFromChunkCoords(par1 >> 4, par3 >> 4); - int var8 = 0; -- if((var6 & 1) != 0) { -- var8 = var7.getBlockID(var1 & 15, var2, var3 & 15); -+ -+ if ((par6 & 1) != 0) { -+ var8 = var7.getBlockID(par1 & 15, par2, par3 & 15); - } - -- boolean var9 = var7.setBlockIDWithMetadata(var1 & 15, var2, var3 & 15, var4, var5); -+ boolean var9 = var7.setBlockIDWithMetadata(par1 & 15, par2, par3 & 15, par4, par5); - this.theProfiler.startSection("checkLight"); -- this.updateAllLightTypes(var1, var2, var3); -+ this.updateAllLightTypes(par1, par2, par3); - this.theProfiler.endSection(); -- if(var9) { -- if((var6 & 2) != 0 && (!this.isRemote || (var6 & 4) == 0)) { -- this.markBlockForUpdate(var1, var2, var3); -+ -+ if (var9) { -+ if ((par6 & 2) != 0 && (!this.isRemote || (par6 & 4) == 0)) { -+ this.markBlockForUpdate(par1, par2, par3); - } - -- if(!this.isRemote && (var6 & 1) != 0) { -- this.notifyBlockChange(var1, var2, var3, var8); -- Block var10 = Block.blocksList[var4]; -- if(var10 != null && var10.hasComparatorInputOverride()) { -- this.func_96440_m(var1, var2, var3, var4); -+ if (!this.isRemote && (par6 & 1) != 0) { -+ this.notifyBlockChange(par1, par2, par3, var8); -+ Block var10 = Block.blocksList[par4]; -+ -+ if (var10 != null && var10.hasComparatorInputOverride()) { -+ this.func_96440_m(par1, par2, par3, par4); - } - } - } -@@ -278,50 +447,63 @@ - } - } - -- public Material getBlockMaterial(int var1, int var2, int var3) { -- int var4 = this.getBlockId(var1, var2, var3); -+ /** -+ * Returns the block's material. -+ */ -+ public Material getBlockMaterial(int par1, int par2, int par3) { -+ int var4 = this.getBlockId(par1, par2, par3); - return var4 == 0 ? Material.air : Block.blocksList[var4].blockMaterial; - } - -- public int getBlockMetadata(int var1, int var2, int var3) { -- if(var1 >= -30000000 && var3 >= -30000000 && var1 < 30000000 && var3 < 30000000) { -- if(var2 < 0) { -+ /** -+ * Returns the block metadata at coords x,y,z -+ */ -+ public int getBlockMetadata(int par1, int par2, int par3) { -+ if (par1 >= -30000000 && par3 >= -30000000 && par1 < 30000000 && par3 < 30000000) { -+ if (par2 < 0) { - return 0; -- } else if(var2 >= 256) { -+ } else if (par2 >= 256) { - return 0; - } else { -- Chunk var4 = this.getChunkFromChunkCoords(var1 >> 4, var3 >> 4); -- var1 &= 15; -- var3 &= 15; -- return var4.getBlockMetadata(var1, var2, var3); -+ Chunk var4 = this.getChunkFromChunkCoords(par1 >> 4, par3 >> 4); -+ par1 &= 15; -+ par3 &= 15; -+ return var4.getBlockMetadata(par1, par2, par3); - } - } else { - return 0; - } - } - -- public boolean setBlockMetadata(int var1, int var2, int var3, int var4, int var5) { -- if(var1 >= -30000000 && var3 >= -30000000 && var1 < 30000000 && var3 < 30000000) { -- if(var2 < 0) { -+ /** -+ * Sets the blocks metadata and if set will then notify blocks that this block changed, depending on the flag. Args: x, -+ * y, z, metadata, flag. See setBlock for flag description -+ */ -+ public boolean setBlockMetadataWithNotify(int par1, int par2, int par3, int par4, int par5) { -+ if (par1 >= -30000000 && par3 >= -30000000 && par1 < 30000000 && par3 < 30000000) { -+ if (par2 < 0) { - return false; -- } else if(var2 >= 256) { -+ } else if (par2 >= 256) { - return false; - } else { -- Chunk var6 = this.getChunkFromChunkCoords(var1 >> 4, var3 >> 4); -- int var7 = var1 & 15; -- int var8 = var3 & 15; -- boolean var9 = var6.setBlockMetadata(var7, var2, var8, var4); -- if(var9) { -- int var10 = var6.getBlockID(var7, var2, var8); -- if((var5 & 2) != 0 && (!this.isRemote || (var5 & 4) == 0)) { -- this.markBlockForUpdate(var1, var2, var3); -+ Chunk var6 = this.getChunkFromChunkCoords(par1 >> 4, par3 >> 4); -+ int var7 = par1 & 15; -+ int var8 = par3 & 15; -+ boolean var9 = var6.setBlockMetadata(var7, par2, var8, par4); -+ -+ if (var9) { -+ int var10 = var6.getBlockID(var7, par2, var8); -+ -+ if ((par5 & 2) != 0 && (!this.isRemote || (par5 & 4) == 0)) { -+ this.markBlockForUpdate(par1, par2, par3); - } - -- if(!this.isRemote && (var5 & 1) != 0) { -- this.notifyBlockChange(var1, var2, var3, var10); -+ if (!this.isRemote && (par5 & 1) != 0) { -+ this.notifyBlockChange(par1, par2, par3, var10); - Block var11 = Block.blocksList[var10]; -- if(var11 != null && var11.hasComparatorInputOverride()) { -- this.func_96440_m(var1, var2, var3, var10); -+ -+ if (var11 != null && var11.hasComparatorInputOverride()) { -+ this.func_96440_m(par1, par2, par3, var10); - } - } - } -@@ -333,174 +515,226 @@ - } - } - -- public boolean setBlockToAir(int var1, int var2, int var3) { -- return this.setBlock(var1, var2, var3, 0, 0, 3); -+ /** -+ * Sets a block to 0 and notifies relevant systems with the block change Args: x, y, z -+ */ -+ public boolean setBlockToAir(int par1, int par2, int par3) { -+ return this.setBlock(par1, par2, par3, 0, 0, 3); - } - -- public boolean destroyBlock(int var1, int var2, int var3, boolean var4) { -- int var5 = this.getBlockId(var1, var2, var3); -- if(var5 > 0) { -- int var6 = this.getBlockMetadata(var1, var2, var3); -- this.playAuxSFX(2001, var1, var2, var3, var5 + (var6 << 12)); -- if(var4) { -- Block.blocksList[var5].dropBlockAsItem(this, var1, var2, var3, var6, 0); -+ /** -+ * Destroys a block and optionally drops items. Args: X, Y, Z, dropItems -+ */ -+ public boolean destroyBlock(int par1, int par2, int par3, boolean par4) { -+ int var5 = this.getBlockId(par1, par2, par3); -+ -+ if (var5 > 0) { -+ int var6 = this.getBlockMetadata(par1, par2, par3); -+ this.playAuxSFX(2001, par1, par2, par3, var5 + (var6 << 12)); -+ -+ if (par4) { -+ Block.blocksList[var5].dropBlockAsItem(this, par1, par2, par3, var6, 0); - } - -- return this.setBlock(var1, var2, var3, 0, 0, 3); -+ return this.setBlock(par1, par2, par3, 0, 0, 3); - } else { - return false; - } - } - -- public boolean setBlock(int var1, int var2, int var3, int var4) { -- return this.setBlock(var1, var2, var3, var4, 0, 3); -+ /** -+ * Sets a block and notifies relevant systems with the block change Args: x, y, z, blockID -+ */ -+ public boolean setBlock(int par1, int par2, int par3, int par4) { -+ return this.setBlock(par1, par2, par3, par4, 0, 3); - } - -- public void markBlockForUpdate(int var1, int var2, int var3) { -- for(int var4 = 0; var4 < this.u.size(); ++var4) { -- ((IWorldAccess)this.u.get(var4)).markBlockForUpdate(var1, var2, var3); -+ /** -+ * On the client, re-renders the block. On the server, sends the block to the client (which will re-render it only if -+ * the ID or MD changes), including the tile entity description packet if applicable. Args: x, y, z -+ */ -+ public void markBlockForUpdate(int par1, int par2, int par3) { -+ for (int var4 = 0; var4 < this.worldAccesses.size(); ++var4) { -+ ((IWorldAccess)this.worldAccesses.get(var4)).markBlockForUpdate(par1, par2, par3); - } -- -- } -- -- public void notifyBlockChange(int var1, int var2, int var3, int var4) { -- this.notifyBlocksOfNeighborChange(var1, var2, var3, var4); -- } -- -- public void markBlocksDirtyVertical(int var1, int var2, int var3, int var4) { -+ } -+ -+ /** -+ * The block type change and need to notify other systems Args: x, y, z, blockID -+ */ -+ public void notifyBlockChange(int par1, int par2, int par3, int par4) { -+ this.notifyBlocksOfNeighborChange(par1, par2, par3, par4); -+ } -+ -+ /** -+ * marks a vertical line of blocks as dirty -+ */ -+ public void markBlocksDirtyVertical(int par1, int par2, int par3, int par4) { - int var5; -- if(var3 > var4) { -- var5 = var4; -- var4 = var3; -- var3 = var5; -+ -+ if (par3 > par4) { -+ var5 = par4; -+ par4 = par3; -+ par3 = var5; - } - -- if(!this.provider.hasNoSky) { -- for(var5 = var3; var5 <= var4; ++var5) { -- this.updateLightByType(EnumSkyBlock.Sky, var1, var5, var2); -+ if (!this.provider.hasNoSky) { -+ for (var5 = par3; var5 <= par4; ++var5) { -+ this.updateLightByType(EnumSkyBlock.Sky, par1, var5, par2); - } - } - -- this.markBlockRangeForRenderUpdate(var1, var3, var2, var1, var4, var2); -- } -- -- public void markBlockRangeForRenderUpdate(int var1, int var2, int var3, int var4, int var5, int var6) { -- for(int var7 = 0; var7 < this.u.size(); ++var7) { -- ((IWorldAccess)this.u.get(var7)).markBlockRangeForRenderUpdate(var1, var2, var3, var4, var5, var6); -- } -- -- } -- -- public void notifyBlocksOfNeighborChange(int var1, int var2, int var3, int var4) { -- this.notifyBlockOfNeighborChange(var1 - 1, var2, var3, var4); -- this.notifyBlockOfNeighborChange(var1 + 1, var2, var3, var4); -- this.notifyBlockOfNeighborChange(var1, var2 - 1, var3, var4); -- this.notifyBlockOfNeighborChange(var1, var2 + 1, var3, var4); -- this.notifyBlockOfNeighborChange(var1, var2, var3 - 1, var4); -- this.notifyBlockOfNeighborChange(var1, var2, var3 + 1, var4); -- } -- -- public void notifyBlocksOfNeighborChange(int var1, int var2, int var3, int var4, int var5) { -- if(var5 != 4) { -- this.notifyBlockOfNeighborChange(var1 - 1, var2, var3, var4); -- } -- -- if(var5 != 5) { -- this.notifyBlockOfNeighborChange(var1 + 1, var2, var3, var4); -- } -- -- if(var5 != 0) { -- this.notifyBlockOfNeighborChange(var1, var2 - 1, var3, var4); -- } -- -- if(var5 != 1) { -- this.notifyBlockOfNeighborChange(var1, var2 + 1, var3, var4); -- } -- -- if(var5 != 2) { -- this.notifyBlockOfNeighborChange(var1, var2, var3 - 1, var4); -- } -- -- if(var5 != 3) { -- this.notifyBlockOfNeighborChange(var1, var2, var3 + 1, var4); -- } -- -- } -- -- public void notifyBlockOfNeighborChange(int var1, int var2, int var3, int var4) { -- if(!this.isRemote) { -- int var5 = this.getBlockId(var1, var2, var3); -+ this.markBlockRangeForRenderUpdate(par1, par3, par2, par1, par4, par2); -+ } -+ -+ /** -+ * On the client, re-renders all blocks in this range, inclusive. On the server, does nothing. Args: min x, min y, min -+ * z, max x, max y, max z -+ */ -+ public void markBlockRangeForRenderUpdate(int par1, int par2, int par3, int par4, int par5, int par6) { -+ for (int var7 = 0; var7 < this.worldAccesses.size(); ++var7) { -+ ((IWorldAccess)this.worldAccesses.get(var7)).markBlockRangeForRenderUpdate(par1, par2, par3, par4, par5, par6); -+ } -+ } -+ -+ /** -+ * Notifies neighboring blocks that this specified block changed Args: x, y, z, blockID -+ */ -+ public void notifyBlocksOfNeighborChange(int par1, int par2, int par3, int par4) { -+ this.notifyBlockOfNeighborChange(par1 - 1, par2, par3, par4); -+ this.notifyBlockOfNeighborChange(par1 + 1, par2, par3, par4); -+ this.notifyBlockOfNeighborChange(par1, par2 - 1, par3, par4); -+ this.notifyBlockOfNeighborChange(par1, par2 + 1, par3, par4); -+ this.notifyBlockOfNeighborChange(par1, par2, par3 - 1, par4); -+ this.notifyBlockOfNeighborChange(par1, par2, par3 + 1, par4); -+ } -+ -+ /** -+ * Calls notifyBlockOfNeighborChange on adjacent blocks, except the one on the given side. Args: X, Y, Z, -+ * changingBlockID, side -+ */ -+ public void notifyBlocksOfNeighborChange(int par1, int par2, int par3, int par4, int par5) { -+ if (par5 != 4) { -+ this.notifyBlockOfNeighborChange(par1 - 1, par2, par3, par4); -+ } -+ -+ if (par5 != 5) { -+ this.notifyBlockOfNeighborChange(par1 + 1, par2, par3, par4); -+ } -+ -+ if (par5 != 0) { -+ this.notifyBlockOfNeighborChange(par1, par2 - 1, par3, par4); -+ } -+ -+ if (par5 != 1) { -+ this.notifyBlockOfNeighborChange(par1, par2 + 1, par3, par4); -+ } -+ -+ if (par5 != 2) { -+ this.notifyBlockOfNeighborChange(par1, par2, par3 - 1, par4); -+ } -+ -+ if (par5 != 3) { -+ this.notifyBlockOfNeighborChange(par1, par2, par3 + 1, par4); -+ } -+ } -+ -+ /** -+ * Notifies a block that one of its neighbor change to the specified type Args: x, y, z, blockID -+ */ -+ public void notifyBlockOfNeighborChange(int par1, int par2, int par3, int par4) { -+ if (!this.isRemote) { -+ int var5 = this.getBlockId(par1, par2, par3); - Block var6 = Block.blocksList[var5]; -- if(var6 != null) { -+ -+ if (var6 != null) { - try { -- var6.onNeighborBlockChange(this, var1, var2, var3, var4); -+ var6.onNeighborBlockChange(this, par1, par2, par3, par4); - } catch (Throwable var13) { - CrashReport var8 = CrashReport.makeCrashReport(var13, "Exception while updating neighbours"); - CrashReportCategory var9 = var8.makeCategory("Block being updated"); -- - int var10; -+ - try { -- var10 = this.getBlockMetadata(var1, var2, var3); -+ var10 = this.getBlockMetadata(par1, par2, par3); - } catch (Throwable var12) { - var10 = -1; - } - -- var9.addCrashSectionCallable("Source block type", new CallableLvl1(this, var4)); -- CrashReportCategory.addBlockCrashInfo(var9, var1, var2, var3, var5, var10); -+ var9.addCrashSectionCallable("Source block type", new CallableLvl1(this, par4)); -+ CrashReportCategory.addBlockCrashInfo(var9, par1, par2, par3, var5, var10); - throw new ReportedException(var8); - } - } -- - } - } - -- public boolean isBlockTickScheduledThisTick(int var1, int var2, int var3, int var4) { -+ /** -+ * Returns true if the given block will receive a scheduled tick in this tick. Args: X, Y, Z, blockID -+ */ -+ public boolean isBlockTickScheduledThisTick(int par1, int par2, int par3, int par4) { - return false; - } - -- public boolean canBlockSeeTheSky(int var1, int var2, int var3) { -- return this.getChunkFromChunkCoords(var1 >> 4, var3 >> 4).canBlockSeeTheSky(var1 & 15, var2, var3 & 15); -+ /** -+ * Checks if the specified block is able to see the sky -+ */ -+ public boolean canBlockSeeTheSky(int par1, int par2, int par3) { -+ return this.getChunkFromChunkCoords(par1 >> 4, par3 >> 4).canBlockSeeTheSky(par1 & 15, par2, par3 & 15); - } - -- public int getFullBlockLightValue(int var1, int var2, int var3) { -- if(var2 < 0) { -+ /** -+ * Does the same as getBlockLightValue_do but without checking if its not a normal block -+ */ -+ public int getFullBlockLightValue(int par1, int par2, int par3) { -+ if (par2 < 0) { - return 0; - } else { -- if(var2 >= 256) { -- var2 = 255; -+ if (par2 >= 256) { -+ par2 = 255; - } - -- return this.getChunkFromChunkCoords(var1 >> 4, var3 >> 4).getBlockLightValue(var1 & 15, var2, var3 & 15, 0); -+ return this.getChunkFromChunkCoords(par1 >> 4, par3 >> 4).getBlockLightValue(par1 & 15, par2, par3 & 15, 0); - } - } - -- public int getBlockLightValue(int var1, int var2, int var3) { -- return this.getBlockLightValue_do(var1, var2, var3, true); -+ /** -+ * Gets the light value of a block location -+ */ -+ public int getBlockLightValue(int par1, int par2, int par3) { -+ return this.getBlockLightValue_do(par1, par2, par3, true); - } - -- public int getBlockLightValue_do(int var1, int var2, int var3, boolean var4) { -- if(var1 >= -30000000 && var3 >= -30000000 && var1 < 30000000 && var3 < 30000000) { -- if(var4) { -- int var5 = this.getBlockId(var1, var2, var3); -- if(Block.useNeighborBrightness[var5]) { -- int var6 = this.getBlockLightValue_do(var1, var2 + 1, var3, false); -- int var7 = this.getBlockLightValue_do(var1 + 1, var2, var3, false); -- int var8 = this.getBlockLightValue_do(var1 - 1, var2, var3, false); -- int var9 = this.getBlockLightValue_do(var1, var2, var3 + 1, false); -- int var10 = this.getBlockLightValue_do(var1, var2, var3 - 1, false); -- if(var7 > var6) { -+ /** -+ * Gets the light value of a block location. This is the actual function that gets the value and has a bool flag that -+ * indicates if its a half step block to get the maximum light value of a direct neighboring block (left, right, -+ * forward, back, and up) -+ */ -+ public int getBlockLightValue_do(int par1, int par2, int par3, boolean par4) { -+ if (par1 >= -30000000 && par3 >= -30000000 && par1 < 30000000 && par3 < 30000000) { -+ if (par4) { -+ int var5 = this.getBlockId(par1, par2, par3); -+ -+ if (Block.useNeighborBrightness[var5]) { -+ int var6 = this.getBlockLightValue_do(par1, par2 + 1, par3, false); -+ int var7 = this.getBlockLightValue_do(par1 + 1, par2, par3, false); -+ int var8 = this.getBlockLightValue_do(par1 - 1, par2, par3, false); -+ int var9 = this.getBlockLightValue_do(par1, par2, par3 + 1, false); -+ int var10 = this.getBlockLightValue_do(par1, par2, par3 - 1, false); -+ -+ if (var7 > var6) { - var6 = var7; - } - -- if(var8 > var6) { -+ if (var8 > var6) { - var6 = var8; - } - -- if(var9 > var6) { -+ if (var9 > var6) { - var6 = var9; - } - -- if(var10 > var6) { -+ if (var10 > var6) { - var6 = var10; - } - -@@ -508,42 +742,49 @@ - } - } - -- if(var2 < 0) { -+ if (par2 < 0) { - return 0; - } else { -- if(var2 >= 256) { -- var2 = 255; -+ if (par2 >= 256) { -+ par2 = 255; - } - -- Chunk var11 = this.getChunkFromChunkCoords(var1 >> 4, var3 >> 4); -- var1 &= 15; -- var3 &= 15; -- return var11.getBlockLightValue(var1, var2, var3, this.skylightSubtracted); -+ Chunk var11 = this.getChunkFromChunkCoords(par1 >> 4, par3 >> 4); -+ par1 &= 15; -+ par3 &= 15; -+ return var11.getBlockLightValue(par1, par2, par3, this.skylightSubtracted); - } - } else { - return 15; - } - } - -- public int getHeightValue(int var1, int var2) { -- if(var1 >= -30000000 && var2 >= -30000000 && var1 < 30000000 && var2 < 30000000) { -- if(!this.chunkExists(var1 >> 4, var2 >> 4)) { -+ /** -+ * Returns the y coordinate with a block in it at this x, z coordinate -+ */ -+ public int getHeightValue(int par1, int par2) { -+ if (par1 >= -30000000 && par2 >= -30000000 && par1 < 30000000 && par2 < 30000000) { -+ if (!this.chunkExists(par1 >> 4, par2 >> 4)) { - return 0; - } else { -- Chunk var3 = this.getChunkFromChunkCoords(var1 >> 4, var2 >> 4); -- return var3.getHeightValue(var1 & 15, var2 & 15); -+ Chunk var3 = this.getChunkFromChunkCoords(par1 >> 4, par2 >> 4); -+ return var3.getHeightValue(par1 & 15, par2 & 15); - } - } else { - return 0; - } - } - -- public int getChunkHeightMapMinimum(int var1, int var2) { -- if(var1 >= -30000000 && var2 >= -30000000 && var1 < 30000000 && var2 < 30000000) { -- if(!this.chunkExists(var1 >> 4, var2 >> 4)) { -+ /** -+ * Gets the heightMapMinimum field of the given chunk, or 0 if the chunk is not loaded. Coords are in blocks. Args: X, -+ * Z -+ */ -+ public int getChunkHeightMapMinimum(int par1, int par2) { -+ if (par1 >= -30000000 && par2 >= -30000000 && par1 < 30000000 && par2 < 30000000) { -+ if (!this.chunkExists(par1 >> 4, par2 >> 4)) { - return 0; - } else { -- Chunk var3 = this.getChunkFromChunkCoords(var1 >> 4, var2 >> 4); -+ Chunk var3 = this.getChunkFromChunkCoords(par1 >> 4, par2 >> 4); - return var3.heightMapMinimum; - } - } else { -@@ -551,164 +792,200 @@ - } - } - -- public int getSkyBlockTypeBrightness(EnumSkyBlock var1, int var2, int var3, int var4) { -- if(this.provider.hasNoSky && var1 == EnumSkyBlock.Sky) { -+ /** -+ * Brightness for SkyBlock.Sky is clear white and (through color computing it is assumed) DEPENDENT ON DAYTIME. -+ * Brightness for SkyBlock.Block is yellowish and independent. -+ */ -+ public int getSkyBlockTypeBrightness(EnumSkyBlock par1EnumSkyBlock, int par2, int par3, int par4) { -+ if (this.provider.hasNoSky && par1EnumSkyBlock == EnumSkyBlock.Sky) { - return 0; - } else { -- if(var3 < 0) { -- var3 = 0; -- } -- -- if(var3 >= 256) { -- return var1.defaultLightValue; -- } else if(var2 >= -30000000 && var4 >= -30000000 && var2 < 30000000 && var4 < 30000000) { -- int var5 = var2 >> 4; -- int var6 = var4 >> 4; -- if(!this.chunkExists(var5, var6)) { -- return var1.defaultLightValue; -- } else if(Block.useNeighborBrightness[this.getBlockId(var2, var3, var4)]) { -- int var12 = this.getSavedLightValue(var1, var2, var3 + 1, var4); -- int var8 = this.getSavedLightValue(var1, var2 + 1, var3, var4); -- int var9 = this.getSavedLightValue(var1, var2 - 1, var3, var4); -- int var10 = this.getSavedLightValue(var1, var2, var3, var4 + 1); -- int var11 = this.getSavedLightValue(var1, var2, var3, var4 - 1); -- if(var8 > var12) { -- var12 = var8; -- } -- -- if(var9 > var12) { -- var12 = var9; -- } -- -- if(var10 > var12) { -- var12 = var10; -- } -- -- if(var11 > var12) { -- var12 = var11; -- } -- -- return var12; -- } else { -- Chunk var7 = this.getChunkFromChunkCoords(var5, var6); -- return var7.getSavedLightValue(var1, var2 & 15, var3, var4 & 15); -- } -- } else { -- return var1.defaultLightValue; -- } -- } -- } -- -- public int getSavedLightValue(EnumSkyBlock var1, int var2, int var3, int var4) { -- if(var3 < 0) { -- var3 = 0; -- } -- -- if(var3 >= 256) { -- var3 = 255; -- } -- -- if(var2 >= -30000000 && var4 >= -30000000 && var2 < 30000000 && var4 < 30000000) { -- int var5 = var2 >> 4; -- int var6 = var4 >> 4; -- if(!this.chunkExists(var5, var6)) { -- return var1.defaultLightValue; -+ if (par3 < 0) { -+ par3 = 0; -+ } -+ -+ if (par3 >= 256) { -+ return par1EnumSkyBlock.defaultLightValue; -+ } else if (par2 >= -30000000 && par4 >= -30000000 && par2 < 30000000 && par4 < 30000000) { -+ int var5 = par2 >> 4; -+ int var6 = par4 >> 4; -+ -+ if (!this.chunkExists(var5, var6)) { -+ return par1EnumSkyBlock.defaultLightValue; -+ } else if (Block.useNeighborBrightness[this.getBlockId(par2, par3, par4)]) { -+ int var12 = this.getSavedLightValue(par1EnumSkyBlock, par2, par3 + 1, par4); -+ int var8 = this.getSavedLightValue(par1EnumSkyBlock, par2 + 1, par3, par4); -+ int var9 = this.getSavedLightValue(par1EnumSkyBlock, par2 - 1, par3, par4); -+ int var10 = this.getSavedLightValue(par1EnumSkyBlock, par2, par3, par4 + 1); -+ int var11 = this.getSavedLightValue(par1EnumSkyBlock, par2, par3, par4 - 1); -+ -+ if (var8 > var12) { -+ var12 = var8; -+ } -+ -+ if (var9 > var12) { -+ var12 = var9; -+ } -+ -+ if (var10 > var12) { -+ var12 = var10; -+ } -+ -+ if (var11 > var12) { -+ var12 = var11; -+ } -+ -+ return var12; - } else { - Chunk var7 = this.getChunkFromChunkCoords(var5, var6); -- return var7.getSavedLightValue(var1, var2 & 15, var3, var4 & 15); -- } -- } else { -- return var1.defaultLightValue; -- } -- } -- -- public void setLightValue(EnumSkyBlock var1, int var2, int var3, int var4, int var5) { -- if(var2 >= -30000000 && var4 >= -30000000 && var2 < 30000000 && var4 < 30000000) { -- if(var3 >= 0) { -- if(var3 < 256) { -- if(this.chunkExists(var2 >> 4, var4 >> 4)) { -- Chunk var6 = this.getChunkFromChunkCoords(var2 >> 4, var4 >> 4); -- var6.setLightValue(var1, var2 & 15, var3, var4 & 15, var5); -- -- for(int var7 = 0; var7 < this.u.size(); ++var7) { -- ((IWorldAccess)this.u.get(var7)).markBlockForRenderUpdate(var2, var3, var4); -+ return var7.getSavedLightValue(par1EnumSkyBlock, par2 & 15, par3, par4 & 15); -+ } -+ } else { -+ return par1EnumSkyBlock.defaultLightValue; -+ } -+ } -+ } -+ -+ /** -+ * Returns saved light value without taking into account the time of day. Either looks in the sky light map or block -+ * light map based on the enumSkyBlock arg. -+ */ -+ public int getSavedLightValue(EnumSkyBlock par1EnumSkyBlock, int par2, int par3, int par4) { -+ if (par3 < 0) { -+ par3 = 0; -+ } -+ -+ if (par3 >= 256) { -+ par3 = 255; -+ } -+ -+ if (par2 >= -30000000 && par4 >= -30000000 && par2 < 30000000 && par4 < 30000000) { -+ int var5 = par2 >> 4; -+ int var6 = par4 >> 4; -+ -+ if (!this.chunkExists(var5, var6)) { -+ return par1EnumSkyBlock.defaultLightValue; -+ } else { -+ Chunk var7 = this.getChunkFromChunkCoords(var5, var6); -+ return var7.getSavedLightValue(par1EnumSkyBlock, par2 & 15, par3, par4 & 15); -+ } -+ } else { -+ return par1EnumSkyBlock.defaultLightValue; -+ } -+ } -+ -+ /** -+ * Sets the light value either into the sky map or block map depending on if enumSkyBlock is set to sky or block. Args: -+ * enumSkyBlock, x, y, z, lightValue -+ */ -+ public void setLightValue(EnumSkyBlock par1EnumSkyBlock, int par2, int par3, int par4, int par5) { -+ if (par2 >= -30000000 && par4 >= -30000000 && par2 < 30000000 && par4 < 30000000) { -+ if (par3 >= 0) { -+ if (par3 < 256) { -+ if (this.chunkExists(par2 >> 4, par4 >> 4)) { -+ Chunk var6 = this.getChunkFromChunkCoords(par2 >> 4, par4 >> 4); -+ var6.setLightValue(par1EnumSkyBlock, par2 & 15, par3, par4 & 15, par5); -+ -+ for (int var7 = 0; var7 < this.worldAccesses.size(); ++var7) { -+ ((IWorldAccess)this.worldAccesses.get(var7)).markBlockForRenderUpdate(par2, par3, par4); - } -- - } - } - } - } - } - -- public void markBlockForRenderUpdate(int var1, int var2, int var3) { -- for(int var4 = 0; var4 < this.u.size(); ++var4) { -- ((IWorldAccess)this.u.get(var4)).markBlockForRenderUpdate(var1, var2, var3); -+ /** -+ * On the client, re-renders this block. On the server, does nothing. Used for lighting updates. -+ */ -+ public void markBlockForRenderUpdate(int par1, int par2, int par3) { -+ for (int var4 = 0; var4 < this.worldAccesses.size(); ++var4) { -+ ((IWorldAccess)this.worldAccesses.get(var4)).markBlockForRenderUpdate(par1, par2, par3); - } -- - } - -- public int getLightBrightnessForSkyBlocks(int var1, int var2, int var3, int var4) { -- int var5 = this.getSkyBlockTypeBrightness(EnumSkyBlock.Sky, var1, var2, var3); -- int var6 = this.getSkyBlockTypeBrightness(EnumSkyBlock.Block, var1, var2, var3); -- if(var6 < var4) { -- var6 = var4; -+ /** -+ * Any Light rendered on a 1.8 Block goes through here -+ */ -+ public int getLightBrightnessForSkyBlocks(int par1, int par2, int par3, int par4) { -+ int var5 = this.getSkyBlockTypeBrightness(EnumSkyBlock.Sky, par1, par2, par3); -+ int var6 = this.getSkyBlockTypeBrightness(EnumSkyBlock.Block, par1, par2, par3); -+ -+ if (var6 < par4) { -+ var6 = par4; - } - - return var5 << 20 | var6 << 4; - } - -- public float getBrightness(int var1, int var2, int var3, int var4) { -- int var5 = this.getBlockLightValue(var1, var2, var3); -- if(var5 < var4) { -- var5 = var4; -+ public float getBrightness(int par1, int par2, int par3, int par4) { -+ int var5 = this.getBlockLightValue(par1, par2, par3); -+ -+ if (var5 < par4) { -+ var5 = par4; - } - - return this.provider.lightBrightnessTable[var5]; - } - -- public float getLightBrightness(int var1, int var2, int var3) { -- return this.provider.lightBrightnessTable[this.getBlockLightValue(var1, var2, var3)]; -+ /** -+ * Returns how bright the block is shown as which is the block's light value looked up in a lookup table (light values -+ * aren't linear for brightness). Args: x, y, z -+ */ -+ public float getLightBrightness(int par1, int par2, int par3) { -+ return this.provider.lightBrightnessTable[this.getBlockLightValue(par1, par2, par3)]; - } - -+ /** -+ * Checks whether its daytime by seeing if the light subtracted from the skylight is less than 4 -+ */ - public boolean isDaytime() { - return this.skylightSubtracted < 4; - } - -- public MovingObjectPosition rayTraceBlocks(Vec3 var1, Vec3 var2) { -- return this.rayTraceBlocks(var1, var2, false, false); -- } -- -- public MovingObjectPosition rayTraceBlocks(Vec3 var1, Vec3 var2, boolean var3) { -- return this.rayTraceBlocks(var1, var2, var3, false); -- } -- -- public MovingObjectPosition rayTraceBlocks(Vec3 var1, Vec3 var2, boolean var3, boolean var4) { -- if(!Double.isNaN(var1.xCoord) && !Double.isNaN(var1.yCoord) && !Double.isNaN(var1.zCoord)) { -- if(!Double.isNaN(var2.xCoord) && !Double.isNaN(var2.yCoord) && !Double.isNaN(var2.zCoord)) { -- int var5 = MathHelper.floor_double(var2.xCoord); -- int var6 = MathHelper.floor_double(var2.yCoord); -- int var7 = MathHelper.floor_double(var2.zCoord); -- int var8 = MathHelper.floor_double(var1.xCoord); -- int var9 = MathHelper.floor_double(var1.yCoord); -- int var10 = MathHelper.floor_double(var1.zCoord); -+ /** -+ * Performs a raycast against all blocks in the world except liquids. -+ */ -+ public MovingObjectPosition clip(Vec3 par1Vec3, Vec3 par2Vec3) { -+ return this.rayTraceBlocks_do_do(par1Vec3, par2Vec3, false, false); -+ } -+ -+ /** -+ * Performs a raycast against all blocks in the world, and optionally liquids. -+ */ -+ public MovingObjectPosition clip(Vec3 par1Vec3, Vec3 par2Vec3, boolean par3) { -+ return this.rayTraceBlocks_do_do(par1Vec3, par2Vec3, par3, false); -+ } -+ -+ public MovingObjectPosition rayTraceBlocks_do_do(Vec3 par1Vec3, Vec3 par2Vec3, boolean par3, boolean par4) { -+ if (!Double.isNaN(par1Vec3.xCoord) && !Double.isNaN(par1Vec3.yCoord) && !Double.isNaN(par1Vec3.zCoord)) { -+ if (!Double.isNaN(par2Vec3.xCoord) && !Double.isNaN(par2Vec3.yCoord) && !Double.isNaN(par2Vec3.zCoord)) { -+ int var5 = MathHelper.floor_double(par2Vec3.xCoord); -+ int var6 = MathHelper.floor_double(par2Vec3.yCoord); -+ int var7 = MathHelper.floor_double(par2Vec3.zCoord); -+ int var8 = MathHelper.floor_double(par1Vec3.xCoord); -+ int var9 = MathHelper.floor_double(par1Vec3.yCoord); -+ int var10 = MathHelper.floor_double(par1Vec3.zCoord); - int var11 = this.getBlockId(var8, var9, var10); - int var12 = this.getBlockMetadata(var8, var9, var10); - Block var13 = Block.blocksList[var11]; -- if((!var4 || var13 == null || var13.getCollisionBoundingBoxFromPool(this, var8, var9, var10) != null) && var11 > 0 && var13.canCollideCheck(var12, var3)) { -- MovingObjectPosition var14 = var13.collisionRayTrace(this, var8, var9, var10, var1, var2); -- if(var14 != null) { -+ -+ if ((!par4 || var13 == null || var13.getCollisionBoundingBoxFromPool(this, var8, var9, var10) != null) && var11 > 0 && var13.canCollideCheck(var12, par3)) { -+ MovingObjectPosition var14 = var13.collisionRayTrace(this, var8, var9, var10, par1Vec3, par2Vec3); -+ -+ if (var14 != null) { - return var14; - } - } - - var11 = 200; - -- while(var11-- >= 0) { -- if(Double.isNaN(var1.xCoord) || Double.isNaN(var1.yCoord) || Double.isNaN(var1.zCoord)) { -+ while (var11-- >= 0) { -+ if (Double.isNaN(par1Vec3.xCoord) || Double.isNaN(par1Vec3.yCoord) || Double.isNaN(par1Vec3.zCoord)) { - return null; - } - -- if(var8 == var5 && var9 == var6 && var10 == var7) { -+ if (var8 == var5 && var9 == var6 && var10 == var7) { - return null; - } - -@@ -718,25 +995,26 @@ - double var15 = 999.0D; - double var17 = 999.0D; - double var19 = 999.0D; -- if(var5 > var8) { -+ -+ if (var5 > var8) { - var15 = (double)var8 + 1.0D; -- } else if(var5 < var8) { -+ } else if (var5 < var8) { - var15 = (double)var8 + 0.0D; - } else { - var39 = false; - } - -- if(var6 > var9) { -+ if (var6 > var9) { - var17 = (double)var9 + 1.0D; -- } else if(var6 < var9) { -+ } else if (var6 < var9) { - var17 = (double)var9 + 0.0D; - } else { - var40 = false; - } - -- if(var7 > var10) { -+ if (var7 > var10) { - var19 = (double)var10 + 1.0D; -- } else if(var7 < var10) { -+ } else if (var7 < var10) { - var19 = (double)var10 + 0.0D; - } else { - var41 = false; -@@ -745,70 +1023,75 @@ - double var21 = 999.0D; - double var23 = 999.0D; - double var25 = 999.0D; -- double var27 = var2.xCoord - var1.xCoord; -- double var29 = var2.yCoord - var1.yCoord; -- double var31 = var2.zCoord - var1.zCoord; -- if(var39) { -- var21 = (var15 - var1.xCoord) / var27; -- } -- -- if(var40) { -- var23 = (var17 - var1.yCoord) / var29; -- } -- -- if(var41) { -- var25 = (var19 - var1.zCoord) / var31; -+ double var27 = par2Vec3.xCoord - par1Vec3.xCoord; -+ double var29 = par2Vec3.yCoord - par1Vec3.yCoord; -+ double var31 = par2Vec3.zCoord - par1Vec3.zCoord; -+ -+ if (var39) { -+ var21 = (var15 - par1Vec3.xCoord) / var27; -+ } -+ -+ if (var40) { -+ var23 = (var17 - par1Vec3.yCoord) / var29; -+ } -+ -+ if (var41) { -+ var25 = (var19 - par1Vec3.zCoord) / var31; - } - - boolean var33 = false; - byte var42; -- if(var21 < var23 && var21 < var25) { -- if(var5 > var8) { -+ -+ if (var21 < var23 && var21 < var25) { -+ if (var5 > var8) { - var42 = 4; - } else { - var42 = 5; - } - -- var1.xCoord = var15; -- var1.yCoord += var29 * var21; -- var1.zCoord += var31 * var21; -- } else if(var23 < var25) { -- if(var6 > var9) { -+ par1Vec3.xCoord = var15; -+ par1Vec3.yCoord += var29 * var21; -+ par1Vec3.zCoord += var31 * var21; -+ } else if (var23 < var25) { -+ if (var6 > var9) { - var42 = 0; - } else { - var42 = 1; - } - -- var1.xCoord += var27 * var23; -- var1.yCoord = var17; -- var1.zCoord += var31 * var23; -+ par1Vec3.xCoord += var27 * var23; -+ par1Vec3.yCoord = var17; -+ par1Vec3.zCoord += var31 * var23; - } else { -- if(var7 > var10) { -+ if (var7 > var10) { - var42 = 2; - } else { - var42 = 3; - } - -- var1.xCoord += var27 * var25; -- var1.yCoord += var29 * var25; -- var1.zCoord = var19; -+ par1Vec3.xCoord += var27 * var25; -+ par1Vec3.yCoord += var29 * var25; -+ par1Vec3.zCoord = var19; - } - -- Vec3 var34 = this.getWorldVec3Pool().getVecFromPool(var1.xCoord, var1.yCoord, var1.zCoord); -- var8 = (int)(var34.xCoord = (double)MathHelper.floor_double(var1.xCoord)); -- if(var42 == 5) { -+ Vec3 var34 = this.getWorldVec3Pool().getVecFromPool(par1Vec3.xCoord, par1Vec3.yCoord, par1Vec3.zCoord); -+ var8 = (int)(var34.xCoord = (double)MathHelper.floor_double(par1Vec3.xCoord)); -+ -+ if (var42 == 5) { - --var8; - ++var34.xCoord; - } - -- var9 = (int)(var34.yCoord = (double)MathHelper.floor_double(var1.yCoord)); -- if(var42 == 1) { -+ var9 = (int)(var34.yCoord = (double)MathHelper.floor_double(par1Vec3.yCoord)); -+ -+ if (var42 == 1) { - --var9; - ++var34.yCoord; - } - -- var10 = (int)(var34.zCoord = (double)MathHelper.floor_double(var1.zCoord)); -- if(var42 == 3) { -+ var10 = (int)(var34.zCoord = (double)MathHelper.floor_double(par1Vec3.zCoord)); -+ -+ if (var42 == 3) { - --var10; - ++var34.zCoord; - } -@@ -816,9 +1099,11 @@ - int var35 = this.getBlockId(var8, var9, var10); - int var36 = this.getBlockMetadata(var8, var9, var10); - Block var37 = Block.blocksList[var35]; -- if((!var4 || var37 == null || var37.getCollisionBoundingBoxFromPool(this, var8, var9, var10) != null) && var35 > 0 && var37.canCollideCheck(var36, var3)) { -- MovingObjectPosition var38 = var37.collisionRayTrace(this, var8, var9, var10, var1, var2); -- if(var38 != null) { -+ -+ if ((!par4 || var37 == null || var37.getCollisionBoundingBoxFromPool(this, var8, var9, var10) != null) && var35 > 0 && var37.canCollideCheck(var36, par3)) { -+ MovingObjectPosition var38 = var37.collisionRayTrace(this, var8, var9, var10, par1Vec3, par2Vec3); -+ -+ if (var38 != null) { - return var38; - } - } -@@ -833,151 +1118,199 @@ - } - } - -- public void playSoundAtEntity(Entity var1, String var2, float var3, float var4) { -- if(var1 != null && var2 != null) { -- for(int var5 = 0; var5 < this.u.size(); ++var5) { -- ((IWorldAccess)this.u.get(var5)).playSound(var2, var1.posX, var1.posY - (double)var1.yOffset, var1.posZ, var3, var4); -- } -- -- } -- } -- -- public void playSoundToNearExcept(EntityPlayer var1, String var2, float var3, float var4) { -- if(var1 != null && var2 != null) { -- for(int var5 = 0; var5 < this.u.size(); ++var5) { -- ((IWorldAccess)this.u.get(var5)).playSoundToNearExcept(var1, var2, var1.posX, var1.posY - (double)var1.yOffset, var1.posZ, var3, var4); -- } -- -- } -- } -- -- public void playSoundEffect(double var1, double var3, double var5, String var7, float var8, float var9) { -- if(var7 != null) { -- for(int var10 = 0; var10 < this.u.size(); ++var10) { -- ((IWorldAccess)this.u.get(var10)).playSound(var7, var1, var3, var5, var8, var9); -- } -- -- } -- } -- -- public void playSound(double var1, double var3, double var5, String var7, float var8, float var9, boolean var10) { -- } -- -- public void playRecord(String var1, int var2, int var3, int var4) { -- for(int var5 = 0; var5 < this.u.size(); ++var5) { -- ((IWorldAccess)this.u.get(var5)).playRecord(var1, var2, var3, var4); -- } -- -- } -- -- public void spawnParticle(String var1, double var2, double var4, double var6, double var8, double var10, double var12) { -- for(int var14 = 0; var14 < this.u.size(); ++var14) { -- ((IWorldAccess)this.u.get(var14)).spawnParticle(var1, var2, var4, var6, var8, var10, var12); -- } -- -- } -- -- public boolean addWeatherEffect(Entity var1) { -- this.i.add(var1); -+ /** -+ * Plays a sound at the entity's position. Args: entity, sound, volume (relative to 1.0), and frequency (or pitch, also -+ * relative to 1.0). -+ */ -+ public void playSoundAtEntity(Entity par1Entity, String par2Str, float par3, float par4) { -+ if (par1Entity != null && par2Str != null) { -+ for (int var5 = 0; var5 < this.worldAccesses.size(); ++var5) { -+ ((IWorldAccess)this.worldAccesses.get(var5)).playSound(par2Str, par1Entity.posX, par1Entity.posY - (double)par1Entity.yOffset, par1Entity.posZ, par3, par4); -+ } -+ } -+ } -+ -+ /** -+ * Plays sound to all near players except the player reference given -+ */ -+ public void playSoundToNearExcept(EntityPlayer par1EntityPlayer, String par2Str, float par3, float par4) { -+ if (par1EntityPlayer != null && par2Str != null) { -+ for (int var5 = 0; var5 < this.worldAccesses.size(); ++var5) { -+ ((IWorldAccess)this.worldAccesses.get(var5)).playSoundToNearExcept(par1EntityPlayer, par2Str, par1EntityPlayer.posX, par1EntityPlayer.posY - (double)par1EntityPlayer.yOffset, par1EntityPlayer.posZ, par3, par4); -+ } -+ } -+ } -+ -+ /** -+ * Play a sound effect. Many many parameters for this function. Not sure what they do, but a classic call is : -+ * (double)i + 0.5D, (double)j + 0.5D, (double)k + 0.5D, 'random.door_open', 1.0F, world.rand.nextFloat() * 0.1F + 0.9F -+ * with i,j,k position of the block. -+ */ -+ public void playSoundEffect(double par1, double par3, double par5, String par7Str, float par8, float par9) { -+ if (par7Str != null) { -+ for (int var10 = 0; var10 < this.worldAccesses.size(); ++var10) { -+ ((IWorldAccess)this.worldAccesses.get(var10)).playSound(par7Str, par1, par3, par5, par8, par9); -+ } -+ } -+ } -+ -+ /** -+ * par8 is loudness, all pars passed to minecraftInstance.sndManager.playSound -+ */ -+ public void playSound(double par1, double par3, double par5, String par7Str, float par8, float par9, boolean par10) {} -+ -+ /** -+ * Plays a record at the specified coordinates of the specified name. Args: recordName, x, y, z -+ */ -+ public void playRecord(String par1Str, int par2, int par3, int par4) { -+ for (int var5 = 0; var5 < this.worldAccesses.size(); ++var5) { -+ ((IWorldAccess)this.worldAccesses.get(var5)).playRecord(par1Str, par2, par3, par4); -+ } -+ } -+ -+ /** -+ * Spawns a particle. Args particleName, x, y, z, velX, velY, velZ -+ */ -+ public void spawnParticle(String par1Str, double par2, double par4, double par6, double par8, double par10, double par12) { -+ spawnParticle(par1Str, par2, par4, par6, par8, par10, par12, null); -+ } -+ -+ // Spout Start -+ // Custom Particle Methods -+ public void spawnParticle(String par1Str, double par2, double par4, double par6, double par8, double par10, double par12, Texture texture) { -+ for (int var14 = 0; var14 < this.worldAccesses.size(); ++var14) { -+ ((IWorldAccess)this.worldAccesses.get(var14)).spawnParticle(par1Str, par2, par4, par6, par8, par10, par12, texture); -+ } -+ } -+ // Spout End -+ -+ /** -+ * adds a lightning bolt to the list of lightning bolts in this world. -+ */ -+ public boolean addWeatherEffect(Entity par1Entity) { -+ this.weatherEffects.add(par1Entity); - return true; - } - -- public boolean spawnEntityInWorld(Entity var1) { -- int var2 = MathHelper.floor_double(var1.posX / 16.0D); -- int var3 = MathHelper.floor_double(var1.posZ / 16.0D); -- boolean var4 = var1.forceSpawn; -- if(var1 instanceof EntityPlayer) { -+ /** -+ * Called to place all entities as part of a world -+ */ -+ public boolean spawnEntityInWorld(Entity par1Entity) { -+ int var2 = MathHelper.floor_double(par1Entity.posX / 16.0D); -+ int var3 = MathHelper.floor_double(par1Entity.posZ / 16.0D); -+ boolean var4 = par1Entity.forceSpawn; -+ -+ if (par1Entity instanceof EntityPlayer) { - var4 = true; - } - -- if(!var4 && !this.chunkExists(var2, var3)) { -+ if (!var4 && !this.chunkExists(var2, var3)) { - return false; - } else { -- if(var1 instanceof EntityPlayer) { -- EntityPlayer var5 = (EntityPlayer)var1; -- this.h.add(var5); -+ if (par1Entity instanceof EntityPlayer) { -+ EntityPlayer var5 = (EntityPlayer)par1Entity; -+ this.playerEntities.add(var5); - this.updateAllPlayersSleepingFlag(); - } - -- this.getChunkFromChunkCoords(var2, var3).addEntity(var1); -- this.e.add(var1); -- this.onEntityAdded(var1); -+ this.getChunkFromChunkCoords(var2, var3).addEntity(par1Entity); -+ this.loadedEntityList.add(par1Entity); -+ this.onEntityAdded(par1Entity); - return true; - } - } - -- protected void onEntityAdded(Entity var1) { -- for(int var2 = 0; var2 < this.u.size(); ++var2) { -- ((IWorldAccess)this.u.get(var2)).onEntityCreate(var1); -- } -- -- } -- -- protected void onEntityRemoved(Entity var1) { -- for(int var2 = 0; var2 < this.u.size(); ++var2) { -- ((IWorldAccess)this.u.get(var2)).onEntityDestroy(var1); -- } -- -- } -- -- public void removeEntity(Entity var1) { -- if(var1.riddenByEntity != null) { -- var1.riddenByEntity.mountEntity((Entity)null); -- } -- -- if(var1.ridingEntity != null) { -- var1.mountEntity((Entity)null); -- } -- -- var1.setDead(); -- if(var1 instanceof EntityPlayer) { -- this.h.remove(var1); -- this.updateAllPlayersSleepingFlag(); -- } -- -- } -- -- public void removePlayerEntityDangerously(Entity var1) { -- var1.setDead(); -- if(var1 instanceof EntityPlayer) { -- this.h.remove(var1); -- this.updateAllPlayersSleepingFlag(); -- } -- -- int var2 = var1.chunkCoordX; -- int var3 = var1.chunkCoordZ; -- if(var1.addedToChunk && this.chunkExists(var2, var3)) { -- this.getChunkFromChunkCoords(var2, var3).removeEntity(var1); -- } -- -- this.e.remove(var1); -- this.onEntityRemoved(var1); -- } -- -- public void addWorldAccess(IWorldAccess var1) { -- this.u.add(var1); -- } -- -- public void removeWorldAccess(IWorldAccess var1) { -- this.u.remove(var1); -- } -- -- public List getCollidingBoundingBoxes(Entity var1, AxisAlignedBB var2) { -- this.M.clear(); -- int var3 = MathHelper.floor_double(var2.minX); -- int var4 = MathHelper.floor_double(var2.maxX + 1.0D); -- int var5 = MathHelper.floor_double(var2.minY); -- int var6 = MathHelper.floor_double(var2.maxY + 1.0D); -- int var7 = MathHelper.floor_double(var2.minZ); -- int var8 = MathHelper.floor_double(var2.maxZ + 1.0D); -- -- for(int var9 = var3; var9 < var4; ++var9) { -- for(int var10 = var7; var10 < var8; ++var10) { -- if(this.blockExists(var9, 64, var10)) { -- for(int var11 = var5 - 1; var11 < var6; ++var11) { -+ //ToDo: Was obtainEntitySkin + Spoutcraft API code -+ protected void onEntityAdded(Entity par1Entity) { -+ for (int var2 = 0; var2 < this.worldAccesses.size(); ++var2) { -+ ((IWorldAccess)this.worldAccesses.get(var2)).onEntityCreate(par1Entity); -+ } -+ } -+ -+ //ToDo: was releaseEntitySkin + Spoutcraft API code -+ protected void onEntityRemoved(Entity par1Entity) { -+ for (int var2 = 0; var2 < this.worldAccesses.size(); ++var2) { -+ ((IWorldAccess)this.worldAccesses.get(var2)).onEntityDestroy(par1Entity); -+ } -+ } -+ -+ /** -+ * Schedule the entity for removal during the next tick. Marks the entity dead in anticipation. -+ */ -+ public void removeEntity(Entity par1Entity) { -+ if (par1Entity.riddenByEntity != null) { -+ par1Entity.riddenByEntity.mountEntity((Entity)null); -+ } -+ -+ if (par1Entity.ridingEntity != null) { -+ par1Entity.mountEntity((Entity)null); -+ } -+ -+ par1Entity.setDead(); -+ -+ if (par1Entity instanceof EntityPlayer) { -+ this.playerEntities.remove(par1Entity); -+ this.updateAllPlayersSleepingFlag(); -+ } -+ } -+ -+ /** -+ * Do NOT use this method to remove normal entities- use normal removeEntity -+ */ -+ public void removePlayerEntityDangerously(Entity par1Entity) { -+ par1Entity.setDead(); -+ -+ if (par1Entity instanceof EntityPlayer) { -+ this.playerEntities.remove(par1Entity); -+ this.updateAllPlayersSleepingFlag(); -+ } -+ -+ int var2 = par1Entity.chunkCoordX; -+ int var3 = par1Entity.chunkCoordZ; -+ -+ if (par1Entity.addedToChunk && this.chunkExists(var2, var3)) { -+ this.getChunkFromChunkCoords(var2, var3).removeEntity(par1Entity); -+ } -+ -+ this.loadedEntityList.remove(par1Entity); -+ this.onEntityRemoved(par1Entity); -+ } -+ -+ /** -+ * Adds a IWorldAccess to the list of worldAccesses -+ */ -+ public void addWorldAccess(IWorldAccess par1IWorldAccess) { -+ this.worldAccesses.add(par1IWorldAccess); -+ } -+ -+ /** -+ * Removes a worldAccess from the worldAccesses object -+ */ -+ public void removeWorldAccess(IWorldAccess par1IWorldAccess) { -+ this.worldAccesses.remove(par1IWorldAccess); -+ } -+ -+ /** -+ * Returns a list of bounding boxes that collide with aabb excluding the passed in entity's collision. Args: entity, -+ * aabb -+ */ -+ public List getCollidingBoundingBoxes(Entity par1Entity, AxisAlignedBB par2AxisAlignedBB) { -+ this.collidingBoundingBoxes.clear(); -+ int var3 = MathHelper.floor_double(par2AxisAlignedBB.minX); -+ int var4 = MathHelper.floor_double(par2AxisAlignedBB.maxX + 1.0D); -+ int var5 = MathHelper.floor_double(par2AxisAlignedBB.minY); -+ int var6 = MathHelper.floor_double(par2AxisAlignedBB.maxY + 1.0D); -+ int var7 = MathHelper.floor_double(par2AxisAlignedBB.minZ); -+ int var8 = MathHelper.floor_double(par2AxisAlignedBB.maxZ + 1.0D); -+ -+ for (int var9 = var3; var9 < var4; ++var9) { -+ for (int var10 = var7; var10 < var8; ++var10) { -+ if (this.blockExists(var9, 64, var10)) { -+ for (int var11 = var5 - 1; var11 < var6; ++var11) { - Block var12 = Block.blocksList[this.getBlockId(var9, var11, var10)]; -- if(var12 != null) { -- var12.addCollisionBoxesToList(this, var9, var11, var10, var2, this.M, var1); -+ -+ if (var12 != null) { -+ var12.addCollisionBoxesToList(this, var9, var11, var10, par2AxisAlignedBB, this.collidingBoundingBoxes, par1Entity); - } - } - } -@@ -985,128 +1318,163 @@ - } - - double var14 = 0.25D; -- List var15 = this.getEntitiesWithinAABBExcludingEntity(var1, var2.expand(var14, var14, var14)); -- -- for(int var16 = 0; var16 < var15.size(); ++var16) { -- AxisAlignedBB var13 = ((Entity)var15.get(var16)).getBoundingBox(); -- if(var13 != null && var13.intersectsWith(var2)) { -- this.M.add(var13); -+ List var16 = this.getEntitiesWithinAABBExcludingEntity(par1Entity, par2AxisAlignedBB.expand(var14, var14, var14)); -+ -+ for (int var15 = 0; var15 < var16.size(); ++var15) { -+ AxisAlignedBB var13 = ((Entity)var16.get(var15)).getBoundingBox(); -+ -+ if (var13 != null && var13.intersectsWith(par2AxisAlignedBB)) { -+ this.collidingBoundingBoxes.add(var13); - } - -- var13 = var1.getCollisionBox((Entity)var15.get(var16)); -- if(var13 != null && var13.intersectsWith(var2)) { -- this.M.add(var13); -+ var13 = par1Entity.getCollisionBox((Entity)var16.get(var15)); -+ -+ if (var13 != null && var13.intersectsWith(par2AxisAlignedBB)) { -+ this.collidingBoundingBoxes.add(var13); - } - } - -- return this.M; -+ return this.collidingBoundingBoxes; - } - -- public List getCollidingBlockBounds(AxisAlignedBB var1) { -- this.M.clear(); -- int var2 = MathHelper.floor_double(var1.minX); -- int var3 = MathHelper.floor_double(var1.maxX + 1.0D); -- int var4 = MathHelper.floor_double(var1.minY); -- int var5 = MathHelper.floor_double(var1.maxY + 1.0D); -- int var6 = MathHelper.floor_double(var1.minZ); -- int var7 = MathHelper.floor_double(var1.maxZ + 1.0D); -+ /** -+ * calculates and returns a list of colliding bounding boxes within a given AABB -+ */ -+ public List getCollidingBlockBounds(AxisAlignedBB par1AxisAlignedBB) { -+ this.collidingBoundingBoxes.clear(); -+ int var2 = MathHelper.floor_double(par1AxisAlignedBB.minX); -+ int var3 = MathHelper.floor_double(par1AxisAlignedBB.maxX + 1.0D); -+ int var4 = MathHelper.floor_double(par1AxisAlignedBB.minY); -+ int var5 = MathHelper.floor_double(par1AxisAlignedBB.maxY + 1.0D); -+ int var6 = MathHelper.floor_double(par1AxisAlignedBB.minZ); -+ int var7 = MathHelper.floor_double(par1AxisAlignedBB.maxZ + 1.0D); - -- for(int var8 = var2; var8 < var3; ++var8) { -- for(int var9 = var6; var9 < var7; ++var9) { -- if(this.blockExists(var8, 64, var9)) { -- for(int var10 = var4 - 1; var10 < var5; ++var10) { -+ for (int var8 = var2; var8 < var3; ++var8) { -+ for (int var9 = var6; var9 < var7; ++var9) { -+ if (this.blockExists(var8, 64, var9)) { -+ for (int var10 = var4 - 1; var10 < var5; ++var10) { - Block var11 = Block.blocksList[this.getBlockId(var8, var10, var9)]; -- if(var11 != null) { -- var11.addCollisionBoxesToList(this, var8, var10, var9, var1, this.M, (Entity)null); -+ -+ if (var11 != null) { -+ var11.addCollisionBoxesToList(this, var8, var10, var9, par1AxisAlignedBB, this.collidingBoundingBoxes, (Entity)null); - } - } - } - } - } - -- return this.M; -+ return this.collidingBoundingBoxes; - } - -- public int calculateSkylightSubtracted(float var1) { -- float var2 = this.getCelestialAngle(var1); -+ /** -+ * Returns the amount of skylight subtracted for the current time -+ */ -+ public int calculateSkylightSubtracted(float par1) { -+ float var2 = this.getCelestialAngle(par1); - float var3 = 1.0F - (MathHelper.cos(var2 * (float)Math.PI * 2.0F) * 2.0F + 0.5F); -- if(var3 < 0.0F) { -+ -+ if (var3 < 0.0F) { - var3 = 0.0F; - } - -- if(var3 > 1.0F) { -+ if (var3 > 1.0F) { - var3 = 1.0F; - } - - var3 = 1.0F - var3; -- var3 = (float)((double)var3 * (1.0D - (double)(this.getRainStrength(var1) * 5.0F) / 16.0D)); -- var3 = (float)((double)var3 * (1.0D - (double)(this.getWeightedThunderStrength(var1) * 5.0F) / 16.0D)); -+ var3 = (float)((double)var3 * (1.0D - (double)(this.getRainStrength(par1) * 5.0F) / 16.0D)); -+ var3 = (float)((double)var3 * (1.0D - (double)(this.getWeightedThunderStrength(par1) * 5.0F) / 16.0D)); - var3 = 1.0F - var3; - return (int)(var3 * 11.0F); - } - -- public float getSunBrightness(float var1) { -- float var2 = this.getCelestialAngle(var1); -+ /** -+ * Returns the sun brightness - checks time of day, rain and thunder -+ */ -+ public float getSunBrightness(float par1) { -+ float var2 = this.getCelestialAngle(par1); - float var3 = 1.0F - (MathHelper.cos(var2 * (float)Math.PI * 2.0F) * 2.0F + 0.2F); -- if(var3 < 0.0F) { -+ -+ if (var3 < 0.0F) { - var3 = 0.0F; - } - -- if(var3 > 1.0F) { -+ if (var3 > 1.0F) { - var3 = 1.0F; - } - - var3 = 1.0F - var3; -- var3 = (float)((double)var3 * (1.0D - (double)(this.getRainStrength(var1) * 5.0F) / 16.0D)); -- var3 = (float)((double)var3 * (1.0D - (double)(this.getWeightedThunderStrength(var1) * 5.0F) / 16.0D)); -+ var3 = (float)((double)var3 * (1.0D - (double)(this.getRainStrength(par1) * 5.0F) / 16.0D)); -+ var3 = (float)((double)var3 * (1.0D - (double)(this.getWeightedThunderStrength(par1) * 5.0F) / 16.0D)); - return var3 * 0.8F + 0.2F; - } - -- public Vec3 getSkyColor(Entity var1, float var2) { -- float var3 = this.getCelestialAngle(var2); -+ /** -+ * Calculates the color for the skybox -+ */ -+ public Vec3 getSkyColor(Entity par1Entity, float par2) { -+ float var3 = this.getCelestialAngle(par2); - float var4 = MathHelper.cos(var3 * (float)Math.PI * 2.0F) * 2.0F + 0.5F; -- if(var4 < 0.0F) { -+ -+ if (var4 < 0.0F) { - var4 = 0.0F; - } - -- if(var4 > 1.0F) { -+ if (var4 > 1.0F) { - var4 = 1.0F; - } - -- int var5 = MathHelper.floor_double(var1.posX); -- int var6 = MathHelper.floor_double(var1.posZ); -+ int var5 = MathHelper.floor_double(par1Entity.posX); -+ int var6 = MathHelper.floor_double(par1Entity.posZ); - BiomeGenBase var7 = this.getBiomeGenForCoords(var5, var6); - float var8 = var7.getFloatTemperature(); - int var9 = var7.getSkyColorByTemp(var8); -- float var10 = (float)(var9 >> 16 & 255) / 255.0F; -- float var11 = (float)(var9 >> 8 & 255) / 255.0F; -- float var12 = (float)(var9 & 255) / 255.0F; -+ // MCPatcher Start -+ ColorizeWorld.setupForFog(par1Entity); -+ float var10; -+ float var11; -+ float var12; -+ -+ if (ColorizeWorld.computeSkyColor(this, par2)) { -+ var10 = Colorizer.setColor[0]; -+ var11 = Colorizer.setColor[1]; -+ var12 = Colorizer.setColor[2]; -+ } else { -+ var10 = (float)(var9 >> 16 & 255) / 255.0F; -+ var11 = (float)(var9 >> 8 & 255) / 255.0F; -+ var12 = (float)(var9 & 255) / 255.0F; -+ } -+ // MCPatcher End -+ - var10 *= var4; - var11 *= var4; - var12 *= var4; -- float var13 = this.getRainStrength(var2); -+ float var13 = this.getRainStrength(par2); - float var14; - float var15; -- if(var13 > 0.0F) { -+ -+ if (var13 > 0.0F) { - var14 = (var10 * 0.3F + var11 * 0.59F + var12 * 0.11F) * 0.6F; -- var15 = 1.0F - var13 * (12.0F / 16.0F); -+ var15 = 1.0F - var13 * 0.75F; - var10 = var10 * var15 + var14 * (1.0F - var15); - var11 = var11 * var15 + var14 * (1.0F - var15); - var12 = var12 * var15 + var14 * (1.0F - var15); - } - -- var14 = this.getWeightedThunderStrength(var2); -- if(var14 > 0.0F) { -+ var14 = this.getWeightedThunderStrength(par2); -+ -+ if (var14 > 0.0F) { - var15 = (var10 * 0.3F + var11 * 0.59F + var12 * 0.11F) * 0.2F; -- float var16 = 1.0F - var14 * (12.0F / 16.0F); -+ float var16 = 1.0F - var14 * 0.75F; - var10 = var10 * var16 + var15 * (1.0F - var16); - var11 = var11 * var16 + var15 * (1.0F - var16); - var12 = var12 * var16 + var15 * (1.0F - var16); - } - -- if(this.lastLightningBolt > 0) { -- var15 = (float)this.lastLightningBolt - var2; -- if(var15 > 1.0F) { -+ if (this.lastLightningBolt > 0) { -+ var15 = (float)this.lastLightningBolt - par2; -+ -+ if (var15 > 1.0F) { - var15 = 1.0F; - } - -@@ -1119,41 +1487,52 @@ - return this.getWorldVec3Pool().getVecFromPool((double)var10, (double)var11, (double)var12); - } - -- public float getCelestialAngle(float var1) { -- return this.provider.calculateCelestialAngle(this.worldInfo.getWorldTime(), var1); -+ /** -+ * calls calculateCelestialAngle -+ */ -+ public float getCelestialAngle(float par1) { -+ return this.provider.calculateCelestialAngle(this.worldInfo.getWorldTime(), par1); - } - - public int getMoonPhase() { - return this.provider.getMoonPhase(this.worldInfo.getWorldTime()); - } -- -+ -+ /** -+ * gets the current fullness of the moon expressed as a float between 1.0 and 0.0, in steps of .25 -+ */ - public float getCurrentMoonPhaseFactor() { - return WorldProvider.moonPhaseFactors[this.provider.getMoonPhase(this.worldInfo.getWorldTime())]; - } - -- public float getCelestialAngleRadians(float var1) { -- float var2 = this.getCelestialAngle(var1); -+ /** -+ * Return getCelestialAngle()*2*PI -+ */ -+ public float getCelestialAngleRadians(float par1) { -+ float var2 = this.getCelestialAngle(par1); - return var2 * (float)Math.PI * 2.0F; - } - -- public Vec3 getCloudColour(float var1) { -- float var2 = this.getCelestialAngle(var1); -+ public Vec3 getCloudColour(float par1) { -+ float var2 = this.getCelestialAngle(par1); - float var3 = MathHelper.cos(var2 * (float)Math.PI * 2.0F) * 2.0F + 0.5F; -- if(var3 < 0.0F) { -+ -+ if (var3 < 0.0F) { - var3 = 0.0F; - } - -- if(var3 > 1.0F) { -+ if (var3 > 1.0F) { - var3 = 1.0F; - } - - float var4 = (float)(this.cloudColour >> 16 & 255L) / 255.0F; - float var5 = (float)(this.cloudColour >> 8 & 255L) / 255.0F; - float var6 = (float)(this.cloudColour & 255L) / 255.0F; -- float var7 = this.getRainStrength(var1); -+ float var7 = this.getRainStrength(par1); - float var8; - float var9; -- if(var7 > 0.0F) { -+ -+ if (var7 > 0.0F) { - var8 = (var4 * 0.3F + var5 * 0.59F + var6 * 0.11F) * 0.6F; - var9 = 1.0F - var7 * 0.95F; - var4 = var4 * var9 + var8 * (1.0F - var9); -@@ -1164,8 +1543,9 @@ - var4 *= var3 * 0.9F + 0.1F; - var5 *= var3 * 0.9F + 0.1F; - var6 *= var3 * 0.85F + 0.15F; -- var8 = this.getWeightedThunderStrength(var1); -- if(var8 > 0.0F) { -+ var8 = this.getWeightedThunderStrength(par1); -+ -+ if (var8 > 0.0F) { - var9 = (var4 * 0.3F + var5 * 0.59F + var6 * 0.11F) * 0.2F; - float var10 = 1.0F - var8 * 0.95F; - var4 = var4 * var10 + var9 * (1.0F - var10); -@@ -1176,23 +1556,33 @@ - return this.getWorldVec3Pool().getVecFromPool((double)var4, (double)var5, (double)var6); - } - -- public Vec3 getFogColor(float var1) { -- float var2 = this.getCelestialAngle(var1); -- return this.provider.getFogColor(var2, var1); -- } -- -- public int getPrecipitationHeight(int var1, int var2) { -- return this.getChunkFromBlockCoords(var1, var2).getPrecipitationHeight(var1 & 15, var2 & 15); -- } -- -- public int getTopSolidOrLiquidBlock(int var1, int var2) { -- Chunk var3 = this.getChunkFromBlockCoords(var1, var2); -+ /** -+ * Returns vector(ish) with R/G/B for fog -+ */ -+ public Vec3 getFogColor(float par1) { -+ float var2 = this.getCelestialAngle(par1); -+ return this.provider.getFogColor(var2, par1); -+ } -+ -+ /** -+ * Gets the height to which rain/snow will fall. Calculates it if not already stored. -+ */ -+ public int getPrecipitationHeight(int par1, int par2) { -+ return this.getChunkFromBlockCoords(par1, par2).getPrecipitationHeight(par1 & 15, par2 & 15); -+ } -+ -+ /** -+ * Finds the highest block on the x, z coordinate that is solid and returns its y coord. Args x, z -+ */ -+ public int getTopSolidOrLiquidBlock(int par1, int par2) { -+ Chunk var3 = this.getChunkFromBlockCoords(par1, par2); - int var4 = var3.getTopFilledSegment() + 15; -- var1 &= 15; -- -- for(var2 &= 15; var4 > 0; --var4) { -- int var5 = var3.getBlockID(var1, var4, var2); -- if(var5 != 0 && Block.blocksList[var5].blockMaterial.blocksMovement() && Block.blocksList[var5].blockMaterial != Material.leaves) { -+ par1 &= 15; -+ -+ for (par2 &= 15; var4 > 0; --var4) { -+ int var5 = var3.getBlockID(par1, var4, par2); -+ -+ if (var5 != 0 && Block.blocksList[var5].blockMaterial.blocksMovement() && Block.blocksList[var5].blockMaterial != Material.leaves) { - return var4 + 1; - } - } -@@ -1200,39 +1590,49 @@ - return -1; - } - -- public float getStarBrightness(float var1) { -- float var2 = this.getCelestialAngle(var1); -+ /** -+ * How bright are stars in the sky -+ */ -+ public float getStarBrightness(float par1) { -+ float var2 = this.getCelestialAngle(par1); - float var3 = 1.0F - (MathHelper.cos(var2 * (float)Math.PI * 2.0F) * 2.0F + 0.25F); -- if(var3 < 0.0F) { -+ -+ if (var3 < 0.0F) { - var3 = 0.0F; - } - -- if(var3 > 1.0F) { -+ if (var3 > 1.0F) { - var3 = 1.0F; - } - - return var3 * var3 * 0.5F; - } - -- public void scheduleBlockUpdate(int var1, int var2, int var3, int var4, int var5) { -- } -- -- public void scheduleBlockUpdateWithPriority(int var1, int var2, int var3, int var4, int var5, int var6) { -- } -- -- public void scheduleBlockUpdateFromLoad(int var1, int var2, int var3, int var4, int var5, int var6) { -- } -- -+ /** -+ * Schedules a tick to a block with a delay (Most commonly the tick rate) -+ */ -+ public void scheduleBlockUpdate(int par1, int par2, int par3, int par4, int par5) {} -+ -+ public void scheduleBlockUpdateWithPriority(int par1, int par2, int par3, int par4, int par5, int par6) {} -+ -+ /** -+ * Schedules a block update from the saved information in a chunk. Called when the chunk is loaded. -+ */ -+ public void scheduleBlockUpdateFromLoad(int par1, int par2, int par3, int par4, int par5, int par6) {} -+ -+ /** -+ * Updates (and cleans up) entities and tile entities -+ */ - public void updateEntities() { - this.theProfiler.startSection("entities"); - this.theProfiler.startSection("global"); -- - int var1; - Entity var2; - CrashReport var4; - CrashReportCategory var5; -- for(var1 = 0; var1 < this.i.size(); ++var1) { -- var2 = (Entity)this.i.get(var1); -+ -+ for (var1 = 0; var1 < this.weatherEffects.size(); ++var1) { -+ var2 = (Entity)this.weatherEffects.get(var1); - - try { - ++var2.ticksExisted; -@@ -1240,7 +1640,8 @@ - } catch (Throwable var8) { - var4 = CrashReport.makeCrashReport(var8, "Ticking entity"); - var5 = var4.makeCategory("Entity being ticked"); -- if(var2 == null) { -+ -+ if (var2 == null) { - var5.addCrashSection("Entity", "~~NULL~~"); - } else { - var2.addEntityCrashInfo(var5); -@@ -1249,36 +1650,38 @@ - throw new ReportedException(var4); - } - -- if(var2.isDead) { -- this.i.remove(var1--); -+ if (var2.isDead) { -+ this.weatherEffects.remove(var1--); - } - } - - this.theProfiler.endStartSection("remove"); -- this.e.removeAll(this.f); -- -+ this.loadedEntityList.removeAll(this.unloadedEntityList); - int var3; - int var13; -- for(var1 = 0; var1 < this.f.size(); ++var1) { -- var2 = (Entity)this.f.get(var1); -+ -+ for (var1 = 0; var1 < this.unloadedEntityList.size(); ++var1) { -+ var2 = (Entity)this.unloadedEntityList.get(var1); - var3 = var2.chunkCoordX; - var13 = var2.chunkCoordZ; -- if(var2.addedToChunk && this.chunkExists(var3, var13)) { -+ -+ if (var2.addedToChunk && this.chunkExists(var3, var13)) { - this.getChunkFromChunkCoords(var3, var13).removeEntity(var2); - } - } - -- for(var1 = 0; var1 < this.f.size(); ++var1) { -- this.onEntityRemoved((Entity)this.f.get(var1)); -+ for (var1 = 0; var1 < this.unloadedEntityList.size(); ++var1) { -+ this.onEntityRemoved((Entity)this.unloadedEntityList.get(var1)); - } - -- this.f.clear(); -+ this.unloadedEntityList.clear(); - this.theProfiler.endStartSection("regular"); - -- for(var1 = 0; var1 < this.e.size(); ++var1) { -- var2 = (Entity)this.e.get(var1); -- if(var2.ridingEntity != null) { -- if(!var2.ridingEntity.isDead && var2.ridingEntity.riddenByEntity == var2) { -+ for (var1 = 0; var1 < this.loadedEntityList.size(); ++var1) { -+ var2 = (Entity)this.loadedEntityList.get(var1); -+ -+ if (var2.ridingEntity != null) { -+ if (!var2.ridingEntity.isDead && var2.ridingEntity.riddenByEntity == var2) { - continue; - } - -@@ -1287,7 +1690,8 @@ - } - - this.theProfiler.startSection("tick"); -- if(!var2.isDead) { -+ -+ if (!var2.isDead) { - try { - this.updateEntity(var2); - } catch (Throwable var7) { -@@ -1300,14 +1704,16 @@ - - this.theProfiler.endSection(); - this.theProfiler.startSection("remove"); -- if(var2.isDead) { -+ -+ if (var2.isDead) { - var3 = var2.chunkCoordX; - var13 = var2.chunkCoordZ; -- if(var2.addedToChunk && this.chunkExists(var3, var13)) { -+ -+ if (var2.addedToChunk && this.chunkExists(var3, var13)) { - this.getChunkFromChunkCoords(var3, var13).removeEntity(var2); - } - -- this.e.remove(var1--); -+ this.loadedEntityList.remove(var1--); - this.onEntityRemoved(var2); - } - -@@ -1316,11 +1722,12 @@ - - this.theProfiler.endStartSection("tileEntities"); - this.scanningTileEntities = true; -- Iterator var14 = this.g.iterator(); -+ Iterator var14 = this.loadedTileEntityList.iterator(); - -- while(var14.hasNext()) { -+ while (var14.hasNext()) { - TileEntity var9 = (TileEntity)var14.next(); -- if(!var9.isInvalid() && var9.hasWorldObj() && this.blockExists(var9.xCoord, var9.yCoord, var9.zCoord)) { -+ -+ if (!var9.isInvalid() && var9.hasWorldObj() && this.blockExists(var9.xCoord, var9.yCoord, var9.zCoord)) { - try { - var9.updateEntity(); - } catch (Throwable var6) { -@@ -1331,11 +1738,13 @@ - } - } - -- if(var9.isInvalid()) { -+ if (var9.isInvalid()) { - var14.remove(); -- if(this.chunkExists(var9.xCoord >> 4, var9.zCoord >> 4)) { -+ -+ if (this.chunkExists(var9.xCoord >> 4, var9.zCoord >> 4)) { - Chunk var11 = this.getChunkFromChunkCoords(var9.xCoord >> 4, var9.zCoord >> 4); -- if(var11 != null) { -+ -+ if (var11 != null) { - var11.removeChunkBlockTileEntity(var9.xCoord & 15, var9.yCoord, var9.zCoord & 15); - } - } -@@ -1343,23 +1752,27 @@ - } - - this.scanningTileEntities = false; -- if(!this.b.isEmpty()) { -- this.g.removeAll(this.b); -- this.b.clear(); -+ -+ if (!this.entityRemoval.isEmpty()) { -+ this.loadedTileEntityList.removeAll(this.entityRemoval); -+ this.entityRemoval.clear(); - } - - this.theProfiler.endStartSection("pendingTileEntities"); -- if(!this.a.isEmpty()) { -- for(int var10 = 0; var10 < this.a.size(); ++var10) { -- TileEntity var12 = (TileEntity)this.a.get(var10); -- if(!var12.isInvalid()) { -- if(!this.g.contains(var12)) { -- this.g.add(var12); -+ -+ if (!this.addedTileEntityList.isEmpty()) { -+ for (int var10 = 0; var10 < this.addedTileEntityList.size(); ++var10) { -+ TileEntity var12 = (TileEntity)this.addedTileEntityList.get(var10); -+ -+ if (!var12.isInvalid()) { -+ if (!this.loadedTileEntityList.contains(var12)) { -+ this.loadedTileEntityList.add(var12); - } - -- if(this.chunkExists(var12.xCoord >> 4, var12.zCoord >> 4)) { -+ if (this.chunkExists(var12.xCoord >> 4, var12.zCoord >> 4)) { - Chunk var15 = this.getChunkFromChunkCoords(var12.xCoord >> 4, var12.zCoord >> 4); -- if(var15 != null) { -+ -+ if (var15 != null) { - var15.setChunkBlockTileEntity(var12.xCoord & 15, var12.yCoord, var12.zCoord & 15, var12); - } - } -@@ -1368,105 +1781,123 @@ - } - } - -- this.a.clear(); -+ this.addedTileEntityList.clear(); - } - - this.theProfiler.endSection(); - this.theProfiler.endSection(); - } - -- public void addTileEntity(Collection var1) { -- if(this.scanningTileEntities) { -- this.a.addAll(var1); -+ public void addTileEntity(Collection par1Collection) { -+ if (this.scanningTileEntities) { -+ this.addedTileEntityList.addAll(par1Collection); - } else { -- this.g.addAll(var1); -+ this.loadedTileEntityList.addAll(par1Collection); - } -- -- } -- -- public void updateEntity(Entity var1) { -- this.updateEntityWithOptionalForce(var1, true); -- } -- -- public void updateEntityWithOptionalForce(Entity var1, boolean var2) { -- int var3 = MathHelper.floor_double(var1.posX); -- int var4 = MathHelper.floor_double(var1.posZ); -+ } -+ -+ /** -+ * Will update the entity in the world if the chunk the entity is in is currently loaded. Args: entity -+ */ -+ public void updateEntity(Entity par1Entity) { -+ this.updateEntityWithOptionalForce(par1Entity, true); -+ } -+ -+ /** -+ * Will update the entity in the world if the chunk the entity is in is currently loaded or its forced to update. Args: -+ * entity, forceUpdate -+ */ -+ public void updateEntityWithOptionalForce(Entity par1Entity, boolean par2) { -+ int var3 = MathHelper.floor_double(par1Entity.posX); -+ int var4 = MathHelper.floor_double(par1Entity.posZ); - byte var5 = 32; -- if(!var2 || this.checkChunksExist(var3 - var5, 0, var4 - var5, var3 + var5, 0, var4 + var5)) { -- var1.lastTickPosX = var1.posX; -- var1.lastTickPosY = var1.posY; -- var1.lastTickPosZ = var1.posZ; -- var1.prevRotationYaw = var1.rotationYaw; -- var1.prevRotationPitch = var1.rotationPitch; -- if(var2 && var1.addedToChunk) { -- ++var1.ticksExisted; -- if(var1.ridingEntity != null) { -- var1.updateRidden(); -- } else { -- var1.onUpdate(); -+ -+ if (!par2 || this.checkChunksExist(var3 - var5, 0, var4 - var5, var3 + var5, 0, var4 + var5)) { -+ par1Entity.lastTickPosX = par1Entity.posX; -+ par1Entity.lastTickPosY = par1Entity.posY; -+ par1Entity.lastTickPosZ = par1Entity.posZ; -+ par1Entity.prevRotationYaw = par1Entity.rotationYaw; -+ par1Entity.prevRotationPitch = par1Entity.rotationPitch; -+ -+ if (par2 && par1Entity.addedToChunk) { -+ ++par1Entity.ticksExisted; -+ -+ if (par1Entity.ridingEntity != null) { -+ par1Entity.updateRidden(); -+ } else { -+ par1Entity.onUpdate(); - } - } - - this.theProfiler.startSection("chunkCheck"); -- if(Double.isNaN(var1.posX) || Double.isInfinite(var1.posX)) { -- var1.posX = var1.lastTickPosX; -- } -- -- if(Double.isNaN(var1.posY) || Double.isInfinite(var1.posY)) { -- var1.posY = var1.lastTickPosY; -- } -- -- if(Double.isNaN(var1.posZ) || Double.isInfinite(var1.posZ)) { -- var1.posZ = var1.lastTickPosZ; -- } -- -- if(Double.isNaN((double)var1.rotationPitch) || Double.isInfinite((double)var1.rotationPitch)) { -- var1.rotationPitch = var1.prevRotationPitch; -- } -- -- if(Double.isNaN((double)var1.rotationYaw) || Double.isInfinite((double)var1.rotationYaw)) { -- var1.rotationYaw = var1.prevRotationYaw; -- } -- -- int var6 = MathHelper.floor_double(var1.posX / 16.0D); -- int var7 = MathHelper.floor_double(var1.posY / 16.0D); -- int var8 = MathHelper.floor_double(var1.posZ / 16.0D); -- if(!var1.addedToChunk || var1.chunkCoordX != var6 || var1.chunkCoordY != var7 || var1.chunkCoordZ != var8) { -- if(var1.addedToChunk && this.chunkExists(var1.chunkCoordX, var1.chunkCoordZ)) { -- this.getChunkFromChunkCoords(var1.chunkCoordX, var1.chunkCoordZ).removeEntityAtIndex(var1, var1.chunkCoordY); -+ -+ if (Double.isNaN(par1Entity.posX) || Double.isInfinite(par1Entity.posX)) { -+ par1Entity.posX = par1Entity.lastTickPosX; -+ } -+ -+ if (Double.isNaN(par1Entity.posY) || Double.isInfinite(par1Entity.posY)) { -+ par1Entity.posY = par1Entity.lastTickPosY; -+ } -+ -+ if (Double.isNaN(par1Entity.posZ) || Double.isInfinite(par1Entity.posZ)) { -+ par1Entity.posZ = par1Entity.lastTickPosZ; -+ } -+ -+ if (Double.isNaN((double)par1Entity.rotationPitch) || Double.isInfinite((double)par1Entity.rotationPitch)) { -+ par1Entity.rotationPitch = par1Entity.prevRotationPitch; -+ } -+ -+ if (Double.isNaN((double)par1Entity.rotationYaw) || Double.isInfinite((double)par1Entity.rotationYaw)) { -+ par1Entity.rotationYaw = par1Entity.prevRotationYaw; -+ } -+ -+ int var6 = MathHelper.floor_double(par1Entity.posX / 16.0D); -+ int var7 = MathHelper.floor_double(par1Entity.posY / 16.0D); -+ int var8 = MathHelper.floor_double(par1Entity.posZ / 16.0D); -+ -+ if (!par1Entity.addedToChunk || par1Entity.chunkCoordX != var6 || par1Entity.chunkCoordY != var7 || par1Entity.chunkCoordZ != var8) { -+ if (par1Entity.addedToChunk && this.chunkExists(par1Entity.chunkCoordX, par1Entity.chunkCoordZ)) { -+ this.getChunkFromChunkCoords(par1Entity.chunkCoordX, par1Entity.chunkCoordZ).removeEntityAtIndex(par1Entity, par1Entity.chunkCoordY); - } - -- if(this.chunkExists(var6, var8)) { -- var1.addedToChunk = true; -- this.getChunkFromChunkCoords(var6, var8).addEntity(var1); -+ if (this.chunkExists(var6, var8)) { -+ par1Entity.addedToChunk = true; -+ this.getChunkFromChunkCoords(var6, var8).addEntity(par1Entity); - } else { -- var1.addedToChunk = false; -+ par1Entity.addedToChunk = false; - } - } - - this.theProfiler.endSection(); -- if(var2 && var1.addedToChunk && var1.riddenByEntity != null) { -- if(!var1.riddenByEntity.isDead && var1.riddenByEntity.ridingEntity == var1) { -- this.updateEntity(var1.riddenByEntity); -+ -+ if (par2 && par1Entity.addedToChunk && par1Entity.riddenByEntity != null) { -+ if (!par1Entity.riddenByEntity.isDead && par1Entity.riddenByEntity.ridingEntity == par1Entity) { -+ this.updateEntity(par1Entity.riddenByEntity); - } else { -- var1.riddenByEntity.ridingEntity = null; -- var1.riddenByEntity = null; -+ par1Entity.riddenByEntity.ridingEntity = null; -+ par1Entity.riddenByEntity = null; - } - } -- - } - } - -- public boolean checkNoEntityCollision(AxisAlignedBB var1) { -- return this.checkNoEntityCollision(var1, (Entity)null); -+ /** -+ * Returns true if there are no solid, live entities in the specified AxisAlignedBB -+ */ -+ public boolean checkNoEntityCollision(AxisAlignedBB par1AxisAlignedBB) { -+ return this.checkNoEntityCollision(par1AxisAlignedBB, (Entity)null); - } - -- public boolean checkNoEntityCollision(AxisAlignedBB var1, Entity var2) { -- List var3 = this.getEntitiesWithinAABBExcludingEntity((Entity)null, var1); -+ /** -+ * Returns true if there are no solid, live entities in the specified AxisAlignedBB, excluding the given entity -+ */ -+ public boolean checkNoEntityCollision(AxisAlignedBB par1AxisAlignedBB, Entity par2Entity) { -+ List var3 = this.getEntitiesWithinAABBExcludingEntity((Entity)null, par1AxisAlignedBB); - -- for(int var4 = 0; var4 < var3.size(); ++var4) { -+ for (int var4 = 0; var4 < var3.size(); ++var4) { - Entity var5 = (Entity)var3.get(var4); -- if(!var5.isDead && var5.preventEntitySpawning && var5 != var2) { -+ -+ if (!var5.isDead && var5.preventEntitySpawning && var5 != par2Entity) { - return false; - } - } -@@ -1474,85 +1905,100 @@ - return true; - } - -- public boolean checkBlockCollision(AxisAlignedBB var1) { -- int var2 = MathHelper.floor_double(var1.minX); -- int var3 = MathHelper.floor_double(var1.maxX + 1.0D); -- int var4 = MathHelper.floor_double(var1.minY); -- int var5 = MathHelper.floor_double(var1.maxY + 1.0D); -- int var6 = MathHelper.floor_double(var1.minZ); -- int var7 = MathHelper.floor_double(var1.maxZ + 1.0D); -- if(var1.minX < 0.0D) { -- --var2; -- } -- -- if(var1.minY < 0.0D) { -- --var4; -- } -- -- if(var1.minZ < 0.0D) { -- --var6; -- } -- -- for(int var8 = var2; var8 < var3; ++var8) { -- for(int var9 = var4; var9 < var5; ++var9) { -- for(int var10 = var6; var10 < var7; ++var10) { -- Block var11 = Block.blocksList[this.getBlockId(var8, var9, var10)]; -- if(var11 != null) { -- return true; -- } -- } -- } -- } -- -- return false; -- } -- -- public boolean isAnyLiquid(AxisAlignedBB var1) { -- int var2 = MathHelper.floor_double(var1.minX); -- int var3 = MathHelper.floor_double(var1.maxX + 1.0D); -- int var4 = MathHelper.floor_double(var1.minY); -- int var5 = MathHelper.floor_double(var1.maxY + 1.0D); -- int var6 = MathHelper.floor_double(var1.minZ); -- int var7 = MathHelper.floor_double(var1.maxZ + 1.0D); -- if(var1.minX < 0.0D) { -- --var2; -- } -- -- if(var1.minY < 0.0D) { -- --var4; -- } -- -- if(var1.minZ < 0.0D) { -- --var6; -- } -- -- for(int var8 = var2; var8 < var3; ++var8) { -- for(int var9 = var4; var9 < var5; ++var9) { -- for(int var10 = var6; var10 < var7; ++var10) { -- Block var11 = Block.blocksList[this.getBlockId(var8, var9, var10)]; -- if(var11 != null && var11.blockMaterial.isLiquid()) { -- return true; -- } -- } -- } -- } -- -- return false; -- } -- -- public boolean isBoundingBoxBurning(AxisAlignedBB var1) { -- int var2 = MathHelper.floor_double(var1.minX); -- int var3 = MathHelper.floor_double(var1.maxX + 1.0D); -- int var4 = MathHelper.floor_double(var1.minY); -- int var5 = MathHelper.floor_double(var1.maxY + 1.0D); -- int var6 = MathHelper.floor_double(var1.minZ); -- int var7 = MathHelper.floor_double(var1.maxZ + 1.0D); -- if(this.checkChunksExist(var2, var4, var6, var3, var5, var7)) { -- for(int var8 = var2; var8 < var3; ++var8) { -- for(int var9 = var4; var9 < var5; ++var9) { -- for(int var10 = var6; var10 < var7; ++var10) { -+ /** -+ * Returns true if there are any blocks in the region constrained by an AxisAlignedBB -+ */ -+ public boolean checkBlockCollision(AxisAlignedBB par1AxisAlignedBB) { -+ int var2 = MathHelper.floor_double(par1AxisAlignedBB.minX); -+ int var3 = MathHelper.floor_double(par1AxisAlignedBB.maxX + 1.0D); -+ int var4 = MathHelper.floor_double(par1AxisAlignedBB.minY); -+ int var5 = MathHelper.floor_double(par1AxisAlignedBB.maxY + 1.0D); -+ int var6 = MathHelper.floor_double(par1AxisAlignedBB.minZ); -+ int var7 = MathHelper.floor_double(par1AxisAlignedBB.maxZ + 1.0D); -+ -+ if (par1AxisAlignedBB.minX < 0.0D) { -+ --var2; -+ } -+ -+ if (par1AxisAlignedBB.minY < 0.0D) { -+ --var4; -+ } -+ -+ if (par1AxisAlignedBB.minZ < 0.0D) { -+ --var6; -+ } -+ -+ for (int var8 = var2; var8 < var3; ++var8) { -+ for (int var9 = var4; var9 < var5; ++var9) { -+ for (int var10 = var6; var10 < var7; ++var10) { -+ Block var11 = Block.blocksList[this.getBlockId(var8, var9, var10)]; -+ -+ if (var11 != null) { -+ return true; -+ } -+ } -+ } -+ } -+ -+ return false; -+ } -+ -+ /** -+ * Returns if any of the blocks within the aabb are liquids. Args: aabb -+ */ -+ public boolean isAnyLiquid(AxisAlignedBB par1AxisAlignedBB) { -+ int var2 = MathHelper.floor_double(par1AxisAlignedBB.minX); -+ int var3 = MathHelper.floor_double(par1AxisAlignedBB.maxX + 1.0D); -+ int var4 = MathHelper.floor_double(par1AxisAlignedBB.minY); -+ int var5 = MathHelper.floor_double(par1AxisAlignedBB.maxY + 1.0D); -+ int var6 = MathHelper.floor_double(par1AxisAlignedBB.minZ); -+ int var7 = MathHelper.floor_double(par1AxisAlignedBB.maxZ + 1.0D); -+ -+ if (par1AxisAlignedBB.minX < 0.0D) { -+ --var2; -+ } -+ -+ if (par1AxisAlignedBB.minY < 0.0D) { -+ --var4; -+ } -+ -+ if (par1AxisAlignedBB.minZ < 0.0D) { -+ --var6; -+ } -+ -+ for (int var8 = var2; var8 < var3; ++var8) { -+ for (int var9 = var4; var9 < var5; ++var9) { -+ for (int var10 = var6; var10 < var7; ++var10) { -+ Block var11 = Block.blocksList[this.getBlockId(var8, var9, var10)]; -+ -+ if (var11 != null && var11.blockMaterial.isLiquid()) { -+ return true; -+ } -+ } -+ } -+ } -+ -+ return false; -+ } -+ -+ /** -+ * Returns whether or not the given bounding box is on fire or not -+ */ -+ public boolean isBoundingBoxBurning(AxisAlignedBB par1AxisAlignedBB) { -+ int var2 = MathHelper.floor_double(par1AxisAlignedBB.minX); -+ int var3 = MathHelper.floor_double(par1AxisAlignedBB.maxX + 1.0D); -+ int var4 = MathHelper.floor_double(par1AxisAlignedBB.minY); -+ int var5 = MathHelper.floor_double(par1AxisAlignedBB.maxY + 1.0D); -+ int var6 = MathHelper.floor_double(par1AxisAlignedBB.minZ); -+ int var7 = MathHelper.floor_double(par1AxisAlignedBB.maxZ + 1.0D); -+ -+ if (this.checkChunksExist(var2, var4, var6, var3, var5, var7)) { -+ for (int var8 = var2; var8 < var3; ++var8) { -+ for (int var9 = var4; var9 < var5; ++var9) { -+ for (int var10 = var6; var10 < var7; ++var10) { - int var11 = this.getBlockId(var8, var9, var10); -- if(var11 == Block.fire.blockID || var11 == Block.lavaMoving.blockID || var11 == Block.lavaStill.blockID) { -+ -+ if (var11 == Block.fire.blockID || var11 == Block.lavaMoving.blockID || var11 == Block.lavaStill.blockID) { - return true; - } - } -@@ -1563,59 +2009,69 @@ - return false; - } - -- public boolean handleMaterialAcceleration(AxisAlignedBB var1, Material var2, Entity var3) { -- int var4 = MathHelper.floor_double(var1.minX); -- int var5 = MathHelper.floor_double(var1.maxX + 1.0D); -- int var6 = MathHelper.floor_double(var1.minY); -- int var7 = MathHelper.floor_double(var1.maxY + 1.0D); -- int var8 = MathHelper.floor_double(var1.minZ); -- int var9 = MathHelper.floor_double(var1.maxZ + 1.0D); -- if(!this.checkChunksExist(var4, var6, var8, var5, var7, var9)) { -+ /** -+ * handles the acceleration of an object whilst in water. Not sure if it is used elsewhere. -+ */ -+ public boolean handleMaterialAcceleration(AxisAlignedBB par1AxisAlignedBB, Material par2Material, Entity par3Entity) { -+ int var4 = MathHelper.floor_double(par1AxisAlignedBB.minX); -+ int var5 = MathHelper.floor_double(par1AxisAlignedBB.maxX + 1.0D); -+ int var6 = MathHelper.floor_double(par1AxisAlignedBB.minY); -+ int var7 = MathHelper.floor_double(par1AxisAlignedBB.maxY + 1.0D); -+ int var8 = MathHelper.floor_double(par1AxisAlignedBB.minZ); -+ int var9 = MathHelper.floor_double(par1AxisAlignedBB.maxZ + 1.0D); -+ -+ if (!this.checkChunksExist(var4, var6, var8, var5, var7, var9)) { - return false; - } else { - boolean var10 = false; - Vec3 var11 = this.getWorldVec3Pool().getVecFromPool(0.0D, 0.0D, 0.0D); - -- for(int var12 = var4; var12 < var5; ++var12) { -- for(int var13 = var6; var13 < var7; ++var13) { -- for(int var14 = var8; var14 < var9; ++var14) { -+ for (int var12 = var4; var12 < var5; ++var12) { -+ for (int var13 = var6; var13 < var7; ++var13) { -+ for (int var14 = var8; var14 < var9; ++var14) { - Block var15 = Block.blocksList[this.getBlockId(var12, var13, var14)]; -- if(var15 != null && var15.blockMaterial == var2) { -+ -+ if (var15 != null && var15.blockMaterial == par2Material) { - double var16 = (double)((float)(var13 + 1) - BlockFluid.getFluidHeightPercent(this.getBlockMetadata(var12, var13, var14))); -- if((double)var7 >= var16) { -+ -+ if ((double)var7 >= var16) { - var10 = true; -- var15.velocityToAddToEntity(this, var12, var13, var14, var3, var11); -+ var15.velocityToAddToEntity(this, var12, var13, var14, par3Entity, var11); - } - } - } - } - } - -- if(var11.lengthVector() > 0.0D && var3.isPushedByWater()) { -+ if (var11.lengthVector() > 0.0D && par3Entity.isPushedByWater()) { - var11 = var11.normalize(); - double var18 = 0.014D; -- var3.motionX += var11.xCoord * var18; -- var3.motionY += var11.yCoord * var18; -- var3.motionZ += var11.zCoord * var18; -+ par3Entity.motionX += var11.xCoord * var18; -+ par3Entity.motionY += var11.yCoord * var18; -+ par3Entity.motionZ += var11.zCoord * var18; - } - - return var10; - } - } - -- public boolean isMaterialInBB(AxisAlignedBB var1, Material var2) { -- int var3 = MathHelper.floor_double(var1.minX); -- int var4 = MathHelper.floor_double(var1.maxX + 1.0D); -- int var5 = MathHelper.floor_double(var1.minY); -- int var6 = MathHelper.floor_double(var1.maxY + 1.0D); -- int var7 = MathHelper.floor_double(var1.minZ); -- int var8 = MathHelper.floor_double(var1.maxZ + 1.0D); -+ /** -+ * Returns true if the given bounding box contains the given material -+ */ -+ public boolean isMaterialInBB(AxisAlignedBB par1AxisAlignedBB, Material par2Material) { -+ int var3 = MathHelper.floor_double(par1AxisAlignedBB.minX); -+ int var4 = MathHelper.floor_double(par1AxisAlignedBB.maxX + 1.0D); -+ int var5 = MathHelper.floor_double(par1AxisAlignedBB.minY); -+ int var6 = MathHelper.floor_double(par1AxisAlignedBB.maxY + 1.0D); -+ int var7 = MathHelper.floor_double(par1AxisAlignedBB.minZ); -+ int var8 = MathHelper.floor_double(par1AxisAlignedBB.maxZ + 1.0D); - -- for(int var9 = var3; var9 < var4; ++var9) { -- for(int var10 = var5; var10 < var6; ++var10) { -- for(int var11 = var7; var11 < var8; ++var11) { -+ for (int var9 = var3; var9 < var4; ++var9) { -+ for (int var10 = var5; var10 < var6; ++var10) { -+ for (int var11 = var7; var11 < var8; ++var11) { - Block var12 = Block.blocksList[this.getBlockId(var9, var10, var11)]; -- if(var12 != null && var12.blockMaterial == var2) { -+ -+ if (var12 != null && var12.blockMaterial == par2Material) { - return true; - } - } -@@ -1625,26 +2081,31 @@ - return false; - } - -- public boolean isAABBInMaterial(AxisAlignedBB var1, Material var2) { -- int var3 = MathHelper.floor_double(var1.minX); -- int var4 = MathHelper.floor_double(var1.maxX + 1.0D); -- int var5 = MathHelper.floor_double(var1.minY); -- int var6 = MathHelper.floor_double(var1.maxY + 1.0D); -- int var7 = MathHelper.floor_double(var1.minZ); -- int var8 = MathHelper.floor_double(var1.maxZ + 1.0D); -+ /** -+ * checks if the given AABB is in the material given. Used while swimming. -+ */ -+ public boolean isAABBInMaterial(AxisAlignedBB par1AxisAlignedBB, Material par2Material) { -+ int var3 = MathHelper.floor_double(par1AxisAlignedBB.minX); -+ int var4 = MathHelper.floor_double(par1AxisAlignedBB.maxX + 1.0D); -+ int var5 = MathHelper.floor_double(par1AxisAlignedBB.minY); -+ int var6 = MathHelper.floor_double(par1AxisAlignedBB.maxY + 1.0D); -+ int var7 = MathHelper.floor_double(par1AxisAlignedBB.minZ); -+ int var8 = MathHelper.floor_double(par1AxisAlignedBB.maxZ + 1.0D); - -- for(int var9 = var3; var9 < var4; ++var9) { -- for(int var10 = var5; var10 < var6; ++var10) { -- for(int var11 = var7; var11 < var8; ++var11) { -+ for (int var9 = var3; var9 < var4; ++var9) { -+ for (int var10 = var5; var10 < var6; ++var10) { -+ for (int var11 = var7; var11 < var8; ++var11) { - Block var12 = Block.blocksList[this.getBlockId(var9, var10, var11)]; -- if(var12 != null && var12.blockMaterial == var2) { -+ -+ if (var12 != null && var12.blockMaterial == par2Material) { - int var13 = this.getBlockMetadata(var9, var10, var11); - double var14 = (double)(var10 + 1); -- if(var13 < 8) { -+ -+ if (var13 < 8) { - var14 = (double)(var10 + 1) - (double)var13 / 8.0D; - } - -- if(var14 >= var1.minY) { -+ if (var14 >= par1AxisAlignedBB.minY) { - return true; - } - } -@@ -1655,33 +2116,43 @@ - return false; - } - -- public Explosion createExplosion(Entity var1, double var2, double var4, double var6, float var8, boolean var9) { -- return this.newExplosion(var1, var2, var4, var6, var8, false, var9); -+ /** -+ * Creates an explosion. Args: entity, x, y, z, strength -+ */ -+ public Explosion createExplosion(Entity par1Entity, double par2, double par4, double par6, float par8, boolean par9) { -+ return this.newExplosion(par1Entity, par2, par4, par6, par8, false, par9); - } - -- public Explosion newExplosion(Entity var1, double var2, double var4, double var6, float var8, boolean var9, boolean var10) { -- Explosion var11 = new Explosion(this, var1, var2, var4, var6, var8); -- var11.isFlaming = var9; -- var11.isSmoking = var10; -+ /** -+ * returns a new explosion. Does initiation (at time of writing Explosion is not finished) -+ */ -+ public Explosion newExplosion(Entity par1Entity, double par2, double par4, double par6, float par8, boolean par9, boolean par10) { -+ Explosion var11 = new Explosion(this, par1Entity, par2, par4, par6, par8); -+ var11.isFlaming = par9; -+ var11.isSmoking = par10; - var11.doExplosionA(); - var11.doExplosionB(true); - return var11; - } - -- public float getBlockDensity(Vec3 var1, AxisAlignedBB var2) { -- double var3 = 1.0D / ((var2.maxX - var2.minX) * 2.0D + 1.0D); -- double var5 = 1.0D / ((var2.maxY - var2.minY) * 2.0D + 1.0D); -- double var7 = 1.0D / ((var2.maxZ - var2.minZ) * 2.0D + 1.0D); -+ /** -+ * Gets the percentage of real blocks within within a bounding box, along a specified vector. -+ */ -+ public float getBlockDensity(Vec3 par1Vec3, AxisAlignedBB par2AxisAlignedBB) { -+ double var3 = 1.0D / ((par2AxisAlignedBB.maxX - par2AxisAlignedBB.minX) * 2.0D + 1.0D); -+ double var5 = 1.0D / ((par2AxisAlignedBB.maxY - par2AxisAlignedBB.minY) * 2.0D + 1.0D); -+ double var7 = 1.0D / ((par2AxisAlignedBB.maxZ - par2AxisAlignedBB.minZ) * 2.0D + 1.0D); - int var9 = 0; - int var10 = 0; - -- for(float var11 = 0.0F; var11 <= 1.0F; var11 = (float)((double)var11 + var3)) { -- for(float var12 = 0.0F; var12 <= 1.0F; var12 = (float)((double)var12 + var5)) { -- for(float var13 = 0.0F; var13 <= 1.0F; var13 = (float)((double)var13 + var7)) { -- double var14 = var2.minX + (var2.maxX - var2.minX) * (double)var11; -- double var16 = var2.minY + (var2.maxY - var2.minY) * (double)var12; -- double var18 = var2.minZ + (var2.maxZ - var2.minZ) * (double)var13; -- if(this.rayTraceBlocks(this.getWorldVec3Pool().getVecFromPool(var14, var16, var18), var1) == null) { -+ for (float var11 = 0.0F; var11 <= 1.0F; var11 = (float)((double)var11 + var3)) { -+ for (float var12 = 0.0F; var12 <= 1.0F; var12 = (float)((double)var12 + var5)) { -+ for (float var13 = 0.0F; var13 <= 1.0F; var13 = (float)((double)var13 + var7)) { -+ double var14 = par2AxisAlignedBB.minX + (par2AxisAlignedBB.maxX - par2AxisAlignedBB.minX) * (double)var11; -+ double var16 = par2AxisAlignedBB.minY + (par2AxisAlignedBB.maxY - par2AxisAlignedBB.minY) * (double)var12; -+ double var18 = par2AxisAlignedBB.minZ + (par2AxisAlignedBB.maxZ - par2AxisAlignedBB.minZ) * (double)var13; -+ -+ if (this.clip(this.getWorldVec3Pool().getVecFromPool(var14, var16, var18), par1Vec3) == null) { - ++var9; - } - -@@ -1693,74 +2164,91 @@ - return (float)var9 / (float)var10; - } - -- public boolean extinguishFire(EntityPlayer var1, int var2, int var3, int var4, int var5) { -- if(var5 == 0) { -- --var3; -- } -- -- if(var5 == 1) { -- ++var3; -- } -- -- if(var5 == 2) { -- --var4; -- } -- -- if(var5 == 3) { -- ++var4; -- } -- -- if(var5 == 4) { -- --var2; -- } -- -- if(var5 == 5) { -- ++var2; -- } -- -- if(this.getBlockId(var2, var3, var4) == Block.fire.blockID) { -- this.playAuxSFXAtEntity(var1, 1004, var2, var3, var4, 0); -- this.setBlockToAir(var2, var3, var4); -+ /** -+ * If the block in the given direction of the given coordinate is fire, extinguish it. Args: Player, X,Y,Z, -+ * blockDirection -+ */ -+ public boolean extinguishFire(EntityPlayer par1EntityPlayer, int par2, int par3, int par4, int par5) { -+ if (par5 == 0) { -+ --par3; -+ } -+ -+ if (par5 == 1) { -+ ++par3; -+ } -+ -+ if (par5 == 2) { -+ --par4; -+ } -+ -+ if (par5 == 3) { -+ ++par4; -+ } -+ -+ if (par5 == 4) { -+ --par2; -+ } -+ -+ if (par5 == 5) { -+ ++par2; -+ } -+ -+ if (this.getBlockId(par2, par3, par4) == Block.fire.blockID) { -+ this.playAuxSFXAtEntity(par1EntityPlayer, 1004, par2, par3, par4, 0); -+ this.setBlockToAir(par2, par3, par4); - return true; - } else { - return false; - } - } - -+ /** -+ * This string is 'All: (number of loaded entities)' Viewable by press ing F3 -+ */ - public String getDebugLoadedEntities() { -- return "All: " + this.e.size(); -+ return "All: " + this.loadedEntityList.size(); - } - -+ /** -+ * Returns the name of the current chunk provider, by calling chunkprovider.makeString() -+ */ - public String getProviderName() { - return this.chunkProvider.makeString(); - } - -- public TileEntity getBlockTileEntity(int var1, int var2, int var3) { -- if(var2 >= 0 && var2 < 256) { -+ /** -+ * Returns the TileEntity associated with a given block in X,Y,Z coordinates, or null if no TileEntity exists -+ */ -+ public TileEntity getBlockTileEntity(int par1, int par2, int par3) { -+ if (par2 >= 0 && par2 < 256) { - TileEntity var4 = null; - int var5; - TileEntity var6; -- if(this.scanningTileEntities) { -- for(var5 = 0; var5 < this.a.size(); ++var5) { -- var6 = (TileEntity)this.a.get(var5); -- if(!var6.isInvalid() && var6.xCoord == var1 && var6.yCoord == var2 && var6.zCoord == var3) { -+ -+ if (this.scanningTileEntities) { -+ for (var5 = 0; var5 < this.addedTileEntityList.size(); ++var5) { -+ var6 = (TileEntity)this.addedTileEntityList.get(var5); -+ -+ if (!var6.isInvalid() && var6.xCoord == par1 && var6.yCoord == par2 && var6.zCoord == par3) { - var4 = var6; - break; - } - } - } - -- if(var4 == null) { -- Chunk var7 = this.getChunkFromChunkCoords(var1 >> 4, var3 >> 4); -- if(var7 != null) { -- var4 = var7.getChunkBlockTileEntity(var1 & 15, var2, var3 & 15); -+ if (var4 == null) { -+ Chunk var7 = this.getChunkFromChunkCoords(par1 >> 4, par3 >> 4); -+ -+ if (var7 != null) { -+ var4 = var7.getChunkBlockTileEntity(par1 & 15, par2, par3 & 15); - } - } - -- if(var4 == null) { -- for(var5 = 0; var5 < this.a.size(); ++var5) { -- var6 = (TileEntity)this.a.get(var5); -- if(!var6.isInvalid() && var6.xCoord == var1 && var6.yCoord == var2 && var6.zCoord == var3) { -+ if (var4 == null) { -+ for (var5 = 0; var5 < this.addedTileEntityList.size(); ++var5) { -+ var6 = (TileEntity)this.addedTileEntityList.get(var5); -+ -+ if (!var6.isInvalid() && var6.xCoord == par1 && var6.yCoord == par2 && var6.zCoord == par3) { - var4 = var6; - break; - } -@@ -1773,301 +2261,374 @@ - } - } - -- public void setBlockTileEntity(int var1, int var2, int var3, TileEntity var4) { -- if(var4 != null && !var4.isInvalid()) { -- if(this.scanningTileEntities) { -- var4.xCoord = var1; -- var4.yCoord = var2; -- var4.zCoord = var3; -- Iterator var5 = this.a.iterator(); -+ /** -+ * Sets the TileEntity for a given block in X, Y, Z coordinates -+ */ -+ public void setBlockTileEntity(int par1, int par2, int par3, TileEntity par4TileEntity) { -+ if (par4TileEntity != null && !par4TileEntity.isInvalid()) { -+ if (this.scanningTileEntities) { -+ par4TileEntity.xCoord = par1; -+ par4TileEntity.yCoord = par2; -+ par4TileEntity.zCoord = par3; -+ Iterator var5 = this.addedTileEntityList.iterator(); - -- while(var5.hasNext()) { -+ while (var5.hasNext()) { - TileEntity var6 = (TileEntity)var5.next(); -- if(var6.xCoord == var1 && var6.yCoord == var2 && var6.zCoord == var3) { -+ -+ if (var6.xCoord == par1 && var6.yCoord == par2 && var6.zCoord == par3) { - var6.invalidate(); - var5.remove(); - } - } - -- this.a.add(var4); -+ this.addedTileEntityList.add(par4TileEntity); - } else { -- this.g.add(var4); -- Chunk var7 = this.getChunkFromChunkCoords(var1 >> 4, var3 >> 4); -- if(var7 != null) { -- var7.setChunkBlockTileEntity(var1 & 15, var2, var3 & 15, var4); -+ this.loadedTileEntityList.add(par4TileEntity); -+ Chunk var7 = this.getChunkFromChunkCoords(par1 >> 4, par3 >> 4); -+ -+ if (var7 != null) { -+ var7.setChunkBlockTileEntity(par1 & 15, par2, par3 & 15, par4TileEntity); - } - } - } -- - } - -- public void removeBlockTileEntity(int var1, int var2, int var3) { -- TileEntity var4 = this.getBlockTileEntity(var1, var2, var3); -- if(var4 != null && this.scanningTileEntities) { -+ /** -+ * Removes the TileEntity for a given block in X,Y,Z coordinates -+ */ -+ public void removeBlockTileEntity(int par1, int par2, int par3) { -+ TileEntity var4 = this.getBlockTileEntity(par1, par2, par3); -+ -+ if (var4 != null && this.scanningTileEntities) { - var4.invalidate(); -- this.a.remove(var4); -+ this.addedTileEntityList.remove(var4); - } else { -- if(var4 != null) { -- this.a.remove(var4); -- this.g.remove(var4); -+ if (var4 != null) { -+ this.addedTileEntityList.remove(var4); -+ this.loadedTileEntityList.remove(var4); - } - -- Chunk var5 = this.getChunkFromChunkCoords(var1 >> 4, var3 >> 4); -- if(var5 != null) { -- var5.removeChunkBlockTileEntity(var1 & 15, var2, var3 & 15); -+ Chunk var5 = this.getChunkFromChunkCoords(par1 >> 4, par3 >> 4); -+ -+ if (var5 != null) { -+ var5.removeChunkBlockTileEntity(par1 & 15, par2, par3 & 15); - } - } -- -- } -- -- public void markTileEntityForDespawn(TileEntity var1) { -- this.b.add(var1); -- } -- -- public boolean isBlockOpaqueCube(int var1, int var2, int var3) { -- Block var4 = Block.blocksList[this.getBlockId(var1, var2, var3)]; -+ } -+ -+ /** -+ * adds tile entity to despawn list (renamed from markEntityForDespawn) -+ */ -+ public void markTileEntityForDespawn(TileEntity par1TileEntity) { -+ this.entityRemoval.add(par1TileEntity); -+ } -+ -+ /** -+ * Returns true if the block at the specified coordinates is an opaque cube. Args: x, y, z -+ */ -+ public boolean isBlockOpaqueCube(int par1, int par2, int par3) { -+ Block var4 = Block.blocksList[this.getBlockId(par1, par2, par3)]; - return var4 == null ? false : var4.isOpaqueCube(); - } - -- public boolean isBlockNormalCube(int var1, int var2, int var3) { -- return Block.isNormalCube(this.getBlockId(var1, var2, var3)); -+ /** -+ * Indicate if a material is a normal solid opaque cube. -+ */ -+ public boolean isBlockNormalCube(int par1, int par2, int par3) { -+ return Block.isNormalCube(this.getBlockId(par1, par2, par3)); - } - -- public boolean isBlockFullCube(int var1, int var2, int var3) { -- int var4 = this.getBlockId(var1, var2, var3); -- if(var4 != 0 && Block.blocksList[var4] != null) { -- AxisAlignedBB var5 = Block.blocksList[var4].getCollisionBoundingBoxFromPool(this, var1, var2, var3); -+ public boolean isBlockFullCube(int par1, int par2, int par3) { -+ int var4 = this.getBlockId(par1, par2, par3); -+ -+ if (var4 != 0 && Block.blocksList[var4] != null) { -+ AxisAlignedBB var5 = Block.blocksList[var4].getCollisionBoundingBoxFromPool(this, par1, par2, par3); - return var5 != null && var5.getAverageEdgeLength() >= 1.0D; - } else { - return false; - } - } - -- public boolean doesBlockHaveSolidTopSurface(int var1, int var2, int var3) { -- Block var4 = Block.blocksList[this.getBlockId(var1, var2, var3)]; -- return this.isBlockTopFacingSurfaceSolid(var4, this.getBlockMetadata(var1, var2, var3)); -- } -- -- public boolean isBlockTopFacingSurfaceSolid(Block var1, int var2) { -- return var1 == null ? false : (var1.blockMaterial.isOpaque() && var1.renderAsNormalBlock() ? true : (var1 instanceof BlockStairs ? (var2 & 4) == 4 : (var1 instanceof BlockHalfSlab ? (var2 & 8) == 8 : (var1 instanceof BlockHopper ? true : (var1 instanceof BlockSnow ? (var2 & 7) == 7 : false))))); -- } -- -- public boolean isBlockNormalCubeDefault(int var1, int var2, int var3, boolean var4) { -- if(var1 >= -30000000 && var3 >= -30000000 && var1 < 30000000 && var3 < 30000000) { -- Chunk var5 = this.chunkProvider.provideChunk(var1 >> 4, var3 >> 4); -- if(var5 != null && !var5.isEmpty()) { -- Block var6 = Block.blocksList[this.getBlockId(var1, var2, var3)]; -+ /** -+ * Returns true if the block at the given coordinate has a solid (buildable) top surface. -+ */ -+ public boolean doesBlockHaveSolidTopSurface(int par1, int par2, int par3) { -+ Block var4 = Block.blocksList[this.getBlockId(par1, par2, par3)]; -+ return this.isBlockTopFacingSurfaceSolid(var4, this.getBlockMetadata(par1, par2, par3)); -+ } -+ -+ /** -+ * Performs check to see if the block is a normal, solid block, or if the metadata of the block indicates that its -+ * facing puts its solid side upwards. (inverted stairs, for example) -+ */ -+ public boolean isBlockTopFacingSurfaceSolid(Block par1Block, int par2) { -+ return par1Block == null ? false : (par1Block.blockMaterial.isOpaque() && par1Block.renderAsNormalBlock() ? true : (par1Block instanceof BlockStairs ? (par2 & 4) == 4 : (par1Block instanceof BlockHalfSlab ? (par2 & 8) == 8 : (par1Block instanceof BlockHopper ? true : (par1Block instanceof BlockSnow ? (par2 & 7) == 7 : false))))); -+ } -+ -+ /** -+ * Checks if the block is a solid, normal cube. If the chunk does not exist, or is not loaded, it returns the boolean -+ * parameter. -+ */ -+ public boolean isBlockNormalCubeDefault(int par1, int par2, int par3, boolean par4) { -+ if (par1 >= -30000000 && par3 >= -30000000 && par1 < 30000000 && par3 < 30000000) { -+ Chunk var5 = this.chunkProvider.provideChunk(par1 >> 4, par3 >> 4); -+ -+ if (var5 != null && !var5.isEmpty()) { -+ Block var6 = Block.blocksList[this.getBlockId(par1, par2, par3)]; - return var6 == null ? false : var6.blockMaterial.isOpaque() && var6.renderAsNormalBlock(); - } else { -- return var4; -+ return par4; - } - } else { -- return var4; -+ return par4; - } - } - -+ /** -+ * Called on construction of the World class to setup the initial skylight values -+ */ - public void calculateInitialSkylight() { - int var1 = this.calculateSkylightSubtracted(1.0F); -- if(var1 != this.skylightSubtracted) { -+ -+ if (var1 != this.skylightSubtracted) { - this.skylightSubtracted = var1; - } -- -- } -- -- public void setAllowedSpawnTypes(boolean var1, boolean var2) { -- this.spawnHostileMobs = var1; -- this.spawnPeacefulMobs = var2; -- } -- -+ } -+ -+ /** -+ * Set which types of mobs are allowed to spawn (peaceful vs hostile). -+ */ -+ public void setAllowedSpawnTypes(boolean par1, boolean par2) { -+ this.spawnHostileMobs = par1; -+ this.spawnPeacefulMobs = par2; -+ } -+ -+ /** -+ * Runs a single tick for the world -+ */ - public void tick() { - this.updateWeather(); - } - -+ /** -+ * Called from World constructor to set rainingStrength and thunderingStrength -+ */ - private void calculateInitialWeather() { -- if(this.worldInfo.isRaining()) { -+ if (this.worldInfo.isRaining()) { - this.rainingStrength = 1.0F; -- if(this.worldInfo.isThundering()) { -+ -+ if (this.worldInfo.isThundering()) { - this.thunderingStrength = 1.0F; - } - } -- - } - -+ /** -+ * Updates all weather states. -+ */ - protected void updateWeather() { -- if(!this.provider.hasNoSky) { -+ if (!this.provider.hasNoSky) { - int var1 = this.worldInfo.getThunderTime(); -- if(var1 <= 0) { -- if(this.worldInfo.isThundering()) { -- this.worldInfo.setThunderTime(this.s.nextInt(12000) + 3600); -+ -+ if (var1 <= 0) { -+ if (this.worldInfo.isThundering()) { -+ this.worldInfo.setThunderTime(this.rand.nextInt(12000) + 3600); - } else { -- this.worldInfo.setThunderTime(this.s.nextInt(168000) + 12000); -+ this.worldInfo.setThunderTime(this.rand.nextInt(168000) + 12000); - } - } else { - --var1; - this.worldInfo.setThunderTime(var1); -- if(var1 <= 0) { -+ -+ if (var1 <= 0) { - this.worldInfo.setThundering(!this.worldInfo.isThundering()); - } - } - - int var2 = this.worldInfo.getRainTime(); -- if(var2 <= 0) { -- if(this.worldInfo.isRaining()) { -- this.worldInfo.setRainTime(this.s.nextInt(12000) + 12000); -+ -+ if (var2 <= 0) { -+ if (this.worldInfo.isRaining()) { -+ this.worldInfo.setRainTime(this.rand.nextInt(12000) + 12000); - } else { -- this.worldInfo.setRainTime(this.s.nextInt(168000) + 12000); -+ this.worldInfo.setRainTime(this.rand.nextInt(168000) + 12000); - } - } else { - --var2; - this.worldInfo.setRainTime(var2); -- if(var2 <= 0) { -+ -+ if (var2 <= 0) { - this.worldInfo.setRaining(!this.worldInfo.isRaining()); - } - } - - this.prevRainingStrength = this.rainingStrength; -- if(this.worldInfo.isRaining()) { -+ -+ if (this.worldInfo.isRaining()) { - this.rainingStrength = (float)((double)this.rainingStrength + 0.01D); - } else { - this.rainingStrength = (float)((double)this.rainingStrength - 0.01D); - } - -- if(this.rainingStrength < 0.0F) { -+ if (this.rainingStrength < 0.0F) { - this.rainingStrength = 0.0F; - } - -- if(this.rainingStrength > 1.0F) { -+ if (this.rainingStrength > 1.0F) { - this.rainingStrength = 1.0F; - } - - this.prevThunderingStrength = this.thunderingStrength; -- if(this.worldInfo.isThundering()) { -+ -+ if (this.worldInfo.isThundering()) { - this.thunderingStrength = (float)((double)this.thunderingStrength + 0.01D); - } else { - this.thunderingStrength = (float)((double)this.thunderingStrength - 0.01D); - } - -- if(this.thunderingStrength < 0.0F) { -+ if (this.thunderingStrength < 0.0F) { - this.thunderingStrength = 0.0F; - } - -- if(this.thunderingStrength > 1.0F) { -+ if (this.thunderingStrength > 1.0F) { - this.thunderingStrength = 1.0F; - } -- - } - } - -- public void commandToggleDownfall() { -+ public void toggleRain() { - this.worldInfo.setRainTime(1); - } - - protected void setActivePlayerChunksAndCheckLight() { -- this.G.clear(); -+ this.activeChunkSet.clear(); - this.theProfiler.startSection("buildList"); -- - int var1; - EntityPlayer var2; - int var3; - int var4; -- for(var1 = 0; var1 < this.h.size(); ++var1) { -- var2 = (EntityPlayer)this.h.get(var1); -+ -+ for (var1 = 0; var1 < this.playerEntities.size(); ++var1) { -+ var2 = (EntityPlayer)this.playerEntities.get(var1); - var3 = MathHelper.floor_double(var2.posX / 16.0D); - var4 = MathHelper.floor_double(var2.posZ / 16.0D); - byte var5 = 7; - -- for(int var6 = -var5; var6 <= var5; ++var6) { -- for(int var7 = -var5; var7 <= var5; ++var7) { -- this.G.add(new ChunkCoordIntPair(var6 + var3, var7 + var4)); -+ for (int var6 = -var5; var6 <= var5; ++var6) { -+ for (int var7 = -var5; var7 <= var5; ++var7) { -+ this.activeChunkSet.add(new ChunkCoordIntPair(var6 + var3, var7 + var4)); - } - } - } - - this.theProfiler.endSection(); -- if(this.ambientTickCountdown > 0) { -+ -+ if (this.ambientTickCountdown > 0) { - --this.ambientTickCountdown; - } - - this.theProfiler.startSection("playerCheckLight"); -- if(!this.h.isEmpty()) { -- var1 = this.s.nextInt(this.h.size()); -- var2 = (EntityPlayer)this.h.get(var1); -- var3 = MathHelper.floor_double(var2.posX) + this.s.nextInt(11) - 5; -- var4 = MathHelper.floor_double(var2.posY) + this.s.nextInt(11) - 5; -- int var8 = MathHelper.floor_double(var2.posZ) + this.s.nextInt(11) - 5; -+ -+ // Spout Start -+ if (!this.playerEntities.isEmpty() && Configuration.isClientLight()) { -+ // Spout End -+ var1 = this.rand.nextInt(this.playerEntities.size()); -+ var2 = (EntityPlayer)this.playerEntities.get(var1); -+ var3 = MathHelper.floor_double(var2.posX) + this.rand.nextInt(11) - 5; -+ var4 = MathHelper.floor_double(var2.posY) + this.rand.nextInt(11) - 5; -+ int var8 = MathHelper.floor_double(var2.posZ) + this.rand.nextInt(11) - 5; - this.updateAllLightTypes(var3, var4, var8); - } - - this.theProfiler.endSection(); - } - -- protected void moodSoundAndLightCheck(int var1, int var2, Chunk var3) { -+ protected void moodSoundAndLightCheck(int par1, int par2, Chunk par3Chunk) { - this.theProfiler.endStartSection("moodSound"); -- if(this.ambientTickCountdown == 0 && !this.isRemote) { -+ -+ if (this.ambientTickCountdown == 0 && !this.isRemote) { - this.updateLCG = this.updateLCG * 3 + 1013904223; - int var4 = this.updateLCG >> 2; - int var5 = var4 & 15; - int var6 = var4 >> 8 & 15; -- int var7 = var4 >> 16 & 127; -- int var8 = var3.getBlockID(var5, var7, var6); -- var5 += var1; -- var6 += var2; -- if(var8 == 0 && this.getFullBlockLightValue(var5, var7, var6) <= this.s.nextInt(8) && this.getSavedLightValue(EnumSkyBlock.Sky, var5, var7, var6) <= 0) { -- EntityPlayer var9 = this.getClosestPlayer((double)var5 + 0.5D, (double)var7 + 0.5D, (double)var6 + 0.5D, 8.0D); -- if(var9 != null && var9.getDistanceSq((double)var5 + 0.5D, (double)var7 + 0.5D, (double)var6 + 0.5D) > 4.0D) { -- this.playSoundEffect((double)var5 + 0.5D, (double)var7 + 0.5D, (double)var6 + 0.5D, "ambient.cave.cave", 0.7F, 0.8F + this.s.nextFloat() * 0.2F); -- this.ambientTickCountdown = this.s.nextInt(12000) + 6000; -+ int var7 = var4 >> 16 & 127; -+ int var8 = par3Chunk.getBlockID(var5, var7, var6); -+ var5 += par1; -+ var6 += par2; -+ -+ if (var8 == 0 && this.getFullBlockLightValue(var5, var7, var6) <= this.rand.nextInt(8) && this.getSavedLightValue(EnumSkyBlock.Sky, var5, var7, var6) <= 0) { -+ EntityPlayer var9 = this.getClosestPlayer((double)var5 + 0.5D, (double)var7 + 0.5D, (double)var6 + 0.5D, 8.0D); -+ -+ if (var9 != null && var9.getDistanceSq((double)var5 + 0.5D, (double)var7 + 0.5D, (double)var6 + 0.5D) > 4.0D) { -+ this.playSoundEffect((double)var5 + 0.5D, (double)var7 + 0.5D, (double)var6 + 0.5D, "ambient.cave.cave", 0.7F, 0.8F + this.rand.nextFloat() * 0.2F); -+ this.ambientTickCountdown = this.rand.nextInt(12000) + 6000; -+ } - } -- } - } - - this.theProfiler.endStartSection("checkLight"); -- var3.enqueueRelightChecks(); -+ par3Chunk.enqueueRelightChecks(); - } - -+ /** -+ * plays random cave ambient sounds and runs updateTick on random blocks within each chunk in the vacinity of a player -+ */ - protected void tickBlocksAndAmbiance() { - this.setActivePlayerChunksAndCheckLight(); - } - -- public boolean isBlockFreezable(int var1, int var2, int var3) { -- return this.canBlockFreeze(var1, var2, var3, false); -- } -- -- public boolean isBlockFreezableNaturally(int var1, int var2, int var3) { -- return this.canBlockFreeze(var1, var2, var3, true); -- } -- -- public boolean canBlockFreeze(int var1, int var2, int var3, boolean var4) { -- BiomeGenBase var5 = this.getBiomeGenForCoords(var1, var3); -+ /** -+ * checks to see if a given block is both water and is cold enough to freeze -+ */ -+ public boolean isBlockFreezable(int par1, int par2, int par3) { -+ return this.canBlockFreeze(par1, par2, par3, false); -+ } -+ -+ /** -+ * checks to see if a given block is both water and has at least one immediately adjacent non-water block -+ */ -+ public boolean isBlockFreezableNaturally(int par1, int par2, int par3) { -+ return this.canBlockFreeze(par1, par2, par3, true); -+ } -+ -+ /** -+ * checks to see if a given block is both water, and cold enough to freeze - if the par4 boolean is set, this will only -+ * return true if there is a non-water block immediately adjacent to the specified block -+ */ -+ public boolean canBlockFreeze(int par1, int par2, int par3, boolean par4) { -+ BiomeGenBase var5 = this.getBiomeGenForCoords(par1, par3); - float var6 = var5.getFloatTemperature(); -- if(var6 > 0.15F) { -+ -+ if (var6 > 0.15F) { - return false; - } else { -- if(var2 >= 0 && var2 < 256 && this.getSavedLightValue(EnumSkyBlock.Block, var1, var2, var3) < 10) { -- int var7 = this.getBlockId(var1, var2, var3); -- if((var7 == Block.waterStill.blockID || var7 == Block.waterMoving.blockID) && this.getBlockMetadata(var1, var2, var3) == 0) { -- if(!var4) { -+ if (par2 >= 0 && par2 < 256 && this.getSavedLightValue(EnumSkyBlock.Block, par1, par2, par3) < 10) { -+ int var7 = this.getBlockId(par1, par2, par3); -+ -+ if ((var7 == Block.waterStill.blockID || var7 == Block.waterMoving.blockID) && this.getBlockMetadata(par1, par2, par3) == 0) { -+ if (!par4) { - return true; - } - - boolean var8 = true; -- if(var8 && this.getBlockMaterial(var1 - 1, var2, var3) != Material.water) { -- var8 = false; -- } -- -- if(var8 && this.getBlockMaterial(var1 + 1, var2, var3) != Material.water) { -- var8 = false; -- } -- -- if(var8 && this.getBlockMaterial(var1, var2, var3 - 1) != Material.water) { -- var8 = false; -- } -- -- if(var8 && this.getBlockMaterial(var1, var2, var3 + 1) != Material.water) { -- var8 = false; -- } -- -- if(!var8) { -+ -+ if (var8 && this.getBlockMaterial(par1 - 1, par2, par3) != Material.water) { -+ var8 = false; -+ } -+ -+ if (var8 && this.getBlockMaterial(par1 + 1, par2, par3) != Material.water) { -+ var8 = false; -+ } -+ -+ if (var8 && this.getBlockMaterial(par1, par2, par3 - 1) != Material.water) { -+ var8 = false; -+ } -+ -+ if (var8 && this.getBlockMaterial(par1, par2, par3 + 1) != Material.water) { -+ var8 = false; -+ } -+ -+ if (!var8) { - return true; - } - } -@@ -2077,16 +2638,21 @@ - } - } - -- public boolean canSnowAt(int var1, int var2, int var3) { -- BiomeGenBase var4 = this.getBiomeGenForCoords(var1, var3); -+ /** -+ * Tests whether or not snow can be placed at a given location -+ */ -+ public boolean canSnowAt(int par1, int par2, int par3) { -+ BiomeGenBase var4 = this.getBiomeGenForCoords(par1, par3); - float var5 = var4.getFloatTemperature(); -- if(var5 > 0.15F) { -+ -+ if (var5 > 0.15F) { - return false; - } else { -- if(var2 >= 0 && var2 < 256 && this.getSavedLightValue(EnumSkyBlock.Block, var1, var2, var3) < 10) { -- int var6 = this.getBlockId(var1, var2 - 1, var3); -- int var7 = this.getBlockId(var1, var2, var3); -- if(var7 == 0 && Block.snow.canPlaceBlockAt(this, var1, var2, var3) && var6 != 0 && var6 != Block.ice.blockID && Block.blocksList[var6].blockMaterial.blocksMovement()) { -+ if (par2 >= 0 && par2 < 256 && this.getSavedLightValue(EnumSkyBlock.Block, par1, par2, par3) < 10) { -+ int var6 = this.getBlockId(par1, par2 - 1, par3); -+ int var7 = this.getBlockId(par1, par2, par3); -+ -+ if (var7 == 0 && Block.snow.canPlaceBlockAt(this, par1, par2, par3) && var6 != 0 && var6 != Block.ice.blockID && Block.blocksList[var6].blockMaterial.blocksMovement()) { - return true; - } - } -@@ -2095,44 +2661,46 @@ - } - } - -- public void updateAllLightTypes(int var1, int var2, int var3) { -- if(!this.provider.hasNoSky) { -- this.updateLightByType(EnumSkyBlock.Sky, var1, var2, var3); -+ public void updateAllLightTypes(int par1, int par2, int par3) { -+ if (!this.provider.hasNoSky) { -+ this.updateLightByType(EnumSkyBlock.Sky, par1, par2, par3); - } - -- this.updateLightByType(EnumSkyBlock.Block, var1, var2, var3); -+ this.updateLightByType(EnumSkyBlock.Block, par1, par2, par3); - } - -- private int computeLightValue(int var1, int var2, int var3, EnumSkyBlock var4) { -- if(var4 == EnumSkyBlock.Sky && this.canBlockSeeTheSky(var1, var2, var3)) { -+ private int computeLightValue(int par1, int par2, int par3, EnumSkyBlock par4EnumSkyBlock) { -+ if (par4EnumSkyBlock == EnumSkyBlock.Sky && this.canBlockSeeTheSky(par1, par2, par3)) { - return 15; - } else { -- int var5 = this.getBlockId(var1, var2, var3); -- int var6 = var4 == EnumSkyBlock.Sky ? 0 : Block.lightValue[var5]; -+ int var5 = this.getBlockId(par1, par2, par3); -+ int var6 = par4EnumSkyBlock == EnumSkyBlock.Sky ? 0 : Block.lightValue[var5]; - int var7 = Block.lightOpacity[var5]; -- if(var7 >= 15 && Block.lightValue[var5] > 0) { -- var7 = 1; -- } -- -- if(var7 < 1) { -- var7 = 1; -- } -- -- if(var7 >= 15) { -+ -+ if (var7 >= 15 && Block.lightValue[var5] > 0) { -+ var7 = 1; -+ } -+ -+ if (var7 < 1) { -+ var7 = 1; -+ } -+ -+ if (var7 >= 15) { - return 0; -- } else if(var6 >= 14) { -+ } else if (var6 >= 14) { - return var6; - } else { -- for(int var8 = 0; var8 < 6; ++var8) { -- int var9 = var1 + Facing.offsetsXForSide[var8]; -- int var10 = var2 + Facing.offsetsYForSide[var8]; -- int var11 = var3 + Facing.offsetsZForSide[var8]; -- int var12 = this.getSavedLightValue(var4, var9, var10, var11) - var7; -- if(var12 > var6) { -+ for (int var8 = 0; var8 < 6; ++var8) { -+ int var9 = par1 + Facing.offsetsXForSide[var8]; -+ int var10 = par2 + Facing.offsetsYForSide[var8]; -+ int var11 = par3 + Facing.offsetsZForSide[var8]; -+ int var12 = this.getSavedLightValue(par4EnumSkyBlock, var9, var10, var11) - var7; -+ -+ if (var12 > var6) { - var6 = var12; - } - -- if(var6 >= 14) { -+ if (var6 >= 14) { - return var6; - } - } -@@ -2142,108 +2710,289 @@ - } - } - -- public void updateLightByType(EnumSkyBlock var1, int var2, int var3, int var4) { -- if(this.doChunksNearChunkExist(var2, var3, var4, 17)) { -+ // Spout Start - Lighting Calculations revert to 1.4.7 setup to make Spout CustomBlock Lighting work. -+ public int getBlockLightOpacity(int par1, int par2, int par3) { -+ return par1 >= -30000000 && par3 >= -30000000 && par1 < 30000000 && par3 < 30000000 ? (par2 < 0 ? 0 : (par2 >= 256 ? 0 : this.getChunkFromChunkCoords(par1 >> 4, par3 >> 4).getBlockLightOpacity(par1 & 15, par2, par3 & 15))) : 0; -+ } -+ -+ private int computeSkyLightValue(int par1, int par2, int par3, int par4, int par5, int par6) { -+ int var7 = 0; -+ -+ if (this.canBlockSeeTheSky(par2, par3, par4)) { -+ var7 = 15; -+ } else { -+ if (par6 == 0) { -+ par6 = 1; -+ } -+ -+ int var8 = this.getSavedLightValue(EnumSkyBlock.Sky, par2 - 1, par3, par4) - par6; -+ int var9 = this.getSavedLightValue(EnumSkyBlock.Sky, par2 + 1, par3, par4) - par6; -+ int var10 = this.getSavedLightValue(EnumSkyBlock.Sky, par2, par3 - 1, par4) - par6; -+ int var11 = this.getSavedLightValue(EnumSkyBlock.Sky, par2, par3 + 1, par4) - par6; -+ int var12 = this.getSavedLightValue(EnumSkyBlock.Sky, par2, par3, par4 - 1) - par6; -+ int var13 = this.getSavedLightValue(EnumSkyBlock.Sky, par2, par3, par4 + 1) - par6; -+ -+ if (var8 > var7) { -+ var7 = var8; -+ } -+ -+ if (var9 > var7) { -+ var7 = var9; -+ } -+ -+ if (var10 > var7) { -+ var7 = var10; -+ } -+ -+ if (var11 > var7) { -+ var7 = var11; -+ } -+ -+ if (var12 > var7) { -+ var7 = var12; -+ } -+ -+ if (var13 > var7) { -+ var7 = var13; -+ } -+ } -+ -+ return var7; -+ } -+ -+ private int computeBlockLightValue(int par1, int par2, int par3, int par4, int par5, int par6) { -+ // Spout Start -+ int light = Block.lightValue[par5]; -+ -+ // Fix for generation-time accessing -+ short customId = 0; -+ if (SpoutClient.getInstance().getRawWorld() != null) { -+ SpoutcraftChunk chunk = Spoutcraft.getChunkAt(SpoutClient.getInstance().getRawWorld(), par2, par3, par4); -+ customId = chunk.getCustomBlockId(par2, par3, par4); -+ } -+ if (customId > 0) { -+ CustomBlock block = MaterialData.getCustomBlock(customId); -+ if (block != null) { -+ light = block.getLightLevel(); -+ } -+ } -+ int var7 = light; -+ // Spout End -+ int var8 = this.getSavedLightValue(EnumSkyBlock.Block, par2 - 1, par3, par4) - par6; -+ int var9 = this.getSavedLightValue(EnumSkyBlock.Block, par2 + 1, par3, par4) - par6; -+ int var10 = this.getSavedLightValue(EnumSkyBlock.Block, par2, par3 - 1, par4) - par6; -+ int var11 = this.getSavedLightValue(EnumSkyBlock.Block, par2, par3 + 1, par4) - par6; -+ int var12 = this.getSavedLightValue(EnumSkyBlock.Block, par2, par3, par4 - 1) - par6; -+ int var13 = this.getSavedLightValue(EnumSkyBlock.Block, par2, par3, par4 + 1) - par6; -+ -+ if (var8 > var7) { -+ var7 = var8; -+ } -+ -+ if (var9 > var7) { -+ var7 = var9; -+ } -+ -+ if (var10 > var7) { -+ var7 = var10; -+ } -+ -+ if (var11 > var7) { -+ var7 = var11; -+ } -+ -+ if (var12 > var7) { -+ var7 = var12; -+ } -+ -+ if (var13 > var7) { -+ var7 = var13; -+ } -+ -+ return var7; -+ } -+ -+ public void updateLightByType(EnumSkyBlock par1EnumSkyBlock, int par2, int par3, int par4) { -+ // Spout Start -+ this.updateLightByType(this.lightUpdateBlockList, par1EnumSkyBlock, par2, par3, par4); -+ } -+ -+ public void updateLightByType(int[] lightUpdateBlockList, EnumSkyBlock par1EnumSkyBlock, int par2, int par3, int par4) { -+ // Spout End -+ if (this.doChunksNearChunkExist(par2, par3, par4, 17)) { - int var5 = 0; - int var6 = 0; - this.theProfiler.startSection("getBrightness"); -- int var7 = this.getSavedLightValue(var1, var2, var3, var4); -- int var8 = this.computeLightValue(var2, var3, var4, var1); -- int var9; -- int var10; -- int var11; -+ int var7 = this.getSavedLightValue(par1EnumSkyBlock, par2, par3, par4); -+ boolean var8 = false; -+ int var9 = this.getBlockId(par2, par3, par4); -+ int var10 = this.getBlockLightOpacity(par2, par3, par4); -+ -+ if (var10 == 0) { -+ var10 = 1; -+ } -+ -+ boolean var11 = false; -+ int var24; -+ -+ if (par1EnumSkyBlock == EnumSkyBlock.Sky) { -+ var24 = this.computeSkyLightValue(var7, par2, par3, par4, var9, var10); -+ } else { -+ var24 = this.computeBlockLightValue(var7, par2, par3, par4, var9, var10); -+ } -+ - int var12; - int var13; - int var14; - int var15; -- int var16; - int var17; -- if(var8 > var7) { -- this.lightUpdateBlockList[var6++] = 133152; -- } else if(var8 < var7) { -- this.lightUpdateBlockList[var6++] = 133152 | var7 << 18; -- -- label90: -- while(true) { -- do { -- do { -- do { -- if(var5 >= var6) { -- var5 = 0; -- break label90; -+ int var16; -+ int var19; -+ int var18; -+ -+ if (var24 > var7) { -+ // Spout Start -+ lightUpdateBlockList[var6++] = 133152; -+ // Spout End -+ } else if (var24 < var7) { -+ if (par1EnumSkyBlock != EnumSkyBlock.Block) { -+ ; -+ } -+ -+ // Spout Start -+ lightUpdateBlockList[var6++] = 133152 + (var7 << 18); -+ // Spout End -+ -+ while (var5 < var6) { -+ // Spout Start -+ var9 = lightUpdateBlockList[var5++]; -+ // Spout End -+ var10 = (var9 & 63) - 32 + par2; -+ var24 = (var9 >> 6 & 63) - 32 + par3; -+ var12 = (var9 >> 12 & 63) - 32 + par4; -+ var13 = var9 >> 18 & 15; -+ var14 = this.getSavedLightValue(par1EnumSkyBlock, var10, var24, var12); -+ -+ if (var14 == var13) { -+ this.setLightValue(par1EnumSkyBlock, var10, var24, var12, 0); -+ -+ if (var13 > 0) { -+ var15 = var10 - par2; -+ var16 = var24 - par3; -+ var17 = var12 - par4; -+ -+ if (var15 < 0) { -+ var15 = -var15; -+ } -+ -+ if (var16 < 0) { -+ var16 = -var16; -+ } -+ -+ if (var17 < 0) { -+ var17 = -var17; -+ } -+ -+ if (var15 + var16 + var17 < 17) { -+ for (var18 = 0; var18 < 6; ++var18) { -+ var19 = var18 % 2 * 2 - 1; -+ int var20 = var10 + var18 / 2 % 3 / 2 * var19; -+ int var21 = var24 + (var18 / 2 + 1) % 3 / 2 * var19; -+ int var22 = var12 + (var18 / 2 + 2) % 3 / 2 * var19; -+ var14 = this.getSavedLightValue(par1EnumSkyBlock, var20, var21, var22); -+ int var23 = Block.lightOpacity[this.getBlockId(var20, var21, var22)]; -+ -+ if (var23 == 0) { -+ var23 = 1; -+ } -+ -+ // Spout Start -+ if (var14 == var13 - var23 && var6 < lightUpdateBlockList.length) { -+ lightUpdateBlockList[var6++] = var20 - par2 + 32 + (var21 - par3 + 32 << 6) + (var22 - par4 + 32 << 12) + (var13 - var23 << 18); -+ // Spout End -+ } - } -- -- var9 = this.lightUpdateBlockList[var5++]; -- var10 = (var9 & 63) - 32 + var2; -- var11 = (var9 >> 6 & 63) - 32 + var3; -- var12 = (var9 >> 12 & 63) - 32 + var4; -- var13 = var9 >> 18 & 15; -- var14 = this.getSavedLightValue(var1, var10, var11, var12); -- } while(var14 != var13); -- -- this.setLightValue(var1, var10, var11, var12, 0); -- } while(var13 <= 0); -- -- var15 = MathHelper.abs_int(var10 - var2); -- var16 = MathHelper.abs_int(var11 - var3); -- var17 = MathHelper.abs_int(var12 - var4); -- } while(var15 + var16 + var17 >= 17); -- -- for(int var18 = 0; var18 < 6; ++var18) { -- int var19 = var10 + Facing.offsetsXForSide[var18]; -- int var20 = var11 + Facing.offsetsYForSide[var18]; -- int var21 = var12 + Facing.offsetsZForSide[var18]; -- int var22 = Math.max(1, Block.lightOpacity[this.getBlockId(var19, var20, var21)]); -- var14 = this.getSavedLightValue(var1, var19, var20, var21); -- if(var14 == var13 - var22 && var6 < this.lightUpdateBlockList.length) { -- this.lightUpdateBlockList[var6++] = var19 - var2 + 32 | var20 - var3 + 32 << 6 | var21 - var4 + 32 << 12 | var13 - var22 << 18; -+ } - } - } - } -+ -+ var5 = 0; - } - - this.theProfiler.endSection(); - this.theProfiler.startSection("checkedPosition < toCheckCount"); - -- while(var5 < var6) { -- var9 = this.lightUpdateBlockList[var5++]; -- var10 = (var9 & 63) - 32 + var2; -- var11 = (var9 >> 6 & 63) - 32 + var3; -- var12 = (var9 >> 12 & 63) - 32 + var4; -- var13 = this.getSavedLightValue(var1, var10, var11, var12); -- var14 = this.computeLightValue(var10, var11, var12, var1); -- if(var14 != var13) { -- this.setLightValue(var1, var10, var11, var12, var14); -- if(var14 > var13) { -- var15 = Math.abs(var10 - var2); -- var16 = Math.abs(var11 - var3); -- var17 = Math.abs(var12 - var4); -- boolean var23 = var6 < this.lightUpdateBlockList.length - 6; -- if(var15 + var16 + var17 < 17 && var23) { -- if(this.getSavedLightValue(var1, var10 - 1, var11, var12) < var14) { -- this.lightUpdateBlockList[var6++] = var10 - 1 - var2 + 32 + (var11 - var3 + 32 << 6) + (var12 - var4 + 32 << 12); -- } -- -- if(this.getSavedLightValue(var1, var10 + 1, var11, var12) < var14) { -- this.lightUpdateBlockList[var6++] = var10 + 1 - var2 + 32 + (var11 - var3 + 32 << 6) + (var12 - var4 + 32 << 12); -- } -- -- if(this.getSavedLightValue(var1, var10, var11 - 1, var12) < var14) { -- this.lightUpdateBlockList[var6++] = var10 - var2 + 32 + (var11 - 1 - var3 + 32 << 6) + (var12 - var4 + 32 << 12); -- } -- -- if(this.getSavedLightValue(var1, var10, var11 + 1, var12) < var14) { -- this.lightUpdateBlockList[var6++] = var10 - var2 + 32 + (var11 + 1 - var3 + 32 << 6) + (var12 - var4 + 32 << 12); -- } -- -- if(this.getSavedLightValue(var1, var10, var11, var12 - 1) < var14) { -- this.lightUpdateBlockList[var6++] = var10 - var2 + 32 + (var11 - var3 + 32 << 6) + (var12 - 1 - var4 + 32 << 12); -- } -- -- if(this.getSavedLightValue(var1, var10, var11, var12 + 1) < var14) { -- this.lightUpdateBlockList[var6++] = var10 - var2 + 32 + (var11 - var3 + 32 << 6) + (var12 + 1 - var4 + 32 << 12); -- } -- } -+ while (var5 < var6) { -+ // Spout Start -+ var9 = lightUpdateBlockList[var5++]; -+ // Spout End -+ var10 = (var9 & 63) - 32 + par2; -+ var24 = (var9 >> 6 & 63) - 32 + par3; -+ var12 = (var9 >> 12 & 63) - 32 + par4; -+ var13 = this.getSavedLightValue(par1EnumSkyBlock, var10, var24, var12); -+ var14 = this.getBlockId(var10, var24, var12); -+ var15 = Block.lightOpacity[var14]; -+ -+ if (var15 == 0) { -+ var15 = 1; -+ } -+ -+ boolean var25 = false; -+ -+ if (par1EnumSkyBlock == EnumSkyBlock.Sky) { -+ var16 = this.computeSkyLightValue(var13, var10, var24, var12, var14, var15); -+ } else { -+ var16 = this.computeBlockLightValue(var13, var10, var24, var12, var14, var15); -+ } -+ -+ if (var16 != var13) { -+ this.setLightValue(par1EnumSkyBlock, var10, var24, var12, var16); -+ -+ if (var16 > var13) { -+ var17 = var10 - par2; -+ var18 = var24 - par3; -+ var19 = var12 - par4; -+ -+ if (var17 < 0) { -+ var17 = -var17; -+ } -+ -+ if (var18 < 0) { -+ var18 = -var18; -+ } -+ -+ if (var19 < 0) { -+ var19 = -var19; -+ } -+ -+ // Spout Start -+ if (var17 + var18 + var19 < 17 && var6 < lightUpdateBlockList.length - 6) { -+ if (this.getSavedLightValue(par1EnumSkyBlock, var10 - 1, var24, var12) < var16) { -+ lightUpdateBlockList[var6++] = var10 - 1 - par2 + 32 + (var24 - par3 + 32 << 6) + (var12 - par4 + 32 << 12); -+ } -+ -+ if (this.getSavedLightValue(par1EnumSkyBlock, var10 + 1, var24, var12) < var16) { -+ lightUpdateBlockList[var6++] = var10 + 1 - par2 + 32 + (var24 - par3 + 32 << 6) + (var12 - par4 + 32 << 12); -+ } -+ -+ if (this.getSavedLightValue(par1EnumSkyBlock, var10, var24 - 1, var12) < var16) { -+ lightUpdateBlockList[var6++] = var10 - par2 + 32 + (var24 - 1 - par3 + 32 << 6) + (var12 - par4 + 32 << 12); -+ } -+ -+ if (this.getSavedLightValue(par1EnumSkyBlock, var10, var24 + 1, var12) < var16) { -+ lightUpdateBlockList[var6++] = var10 - par2 + 32 + (var24 + 1 - par3 + 32 << 6) + (var12 - par4 + 32 << 12); -+ } -+ -+ if (this.getSavedLightValue(par1EnumSkyBlock, var10, var24, var12 - 1) < var16) { -+ lightUpdateBlockList[var6++] = var10 - par2 + 32 + (var24 - par3 + 32 << 6) + (var12 - 1 - par4 + 32 << 12); -+ } -+ -+ if (this.getSavedLightValue(par1EnumSkyBlock, var10, var24, var12 + 1) < var16) { -+ lightUpdateBlockList[var6++] = var10 - par2 + 32 + (var24 - par3 + 32 << 6) + (var12 + 1 - par4 + 32 << 12); -+ } -+ } -+ // Spout End - } - } - } -@@ -2252,29 +3001,37 @@ - } - } - -- public boolean tickUpdates(boolean var1) { -+ // Spout End - Lighting Calculations revert to 1.4.7 setup to make Spout CustomBlock Lighting work. -+ -+ /** -+ * Runs through the list of updates to run and ticks them -+ */ -+ public boolean tickUpdates(boolean par1) { - return false; - } - -- public List getPendingBlockUpdates(Chunk var1, boolean var2) { -+ public List getPendingBlockUpdates(Chunk par1Chunk, boolean par2) { - return null; - } - -- public List getEntitiesWithinAABBExcludingEntity(Entity var1, AxisAlignedBB var2) { -- return this.getEntitiesWithinAABBExcludingEntity(var1, var2, (IEntitySelector)null); -+ /** -+ * Will get all entities within the specified AABB excluding the one passed into it. Args: entityToExclude, aabb -+ */ -+ public List getEntitiesWithinAABBExcludingEntity(Entity par1Entity, AxisAlignedBB par2AxisAlignedBB) { -+ return this.getEntitiesWithinAABBExcludingEntity(par1Entity, par2AxisAlignedBB, (IEntitySelector)null); - } - -- public List getEntitiesWithinAABBExcludingEntity(Entity var1, AxisAlignedBB var2, IEntitySelector var3) { -+ public List getEntitiesWithinAABBExcludingEntity(Entity par1Entity, AxisAlignedBB par2AxisAlignedBB, IEntitySelector par3IEntitySelector) { - ArrayList var4 = new ArrayList(); -- int var5 = MathHelper.floor_double((var2.minX - 2.0D) / 16.0D); -- int var6 = MathHelper.floor_double((var2.maxX + 2.0D) / 16.0D); -- int var7 = MathHelper.floor_double((var2.minZ - 2.0D) / 16.0D); -- int var8 = MathHelper.floor_double((var2.maxZ + 2.0D) / 16.0D); -+ int var5 = MathHelper.floor_double((par2AxisAlignedBB.minX - 2.0D) / 16.0D); -+ int var6 = MathHelper.floor_double((par2AxisAlignedBB.maxX + 2.0D) / 16.0D); -+ int var7 = MathHelper.floor_double((par2AxisAlignedBB.minZ - 2.0D) / 16.0D); -+ int var8 = MathHelper.floor_double((par2AxisAlignedBB.maxZ + 2.0D) / 16.0D); - -- for(int var9 = var5; var9 <= var6; ++var9) { -- for(int var10 = var7; var10 <= var8; ++var10) { -- if(this.chunkExists(var9, var10)) { -- this.getChunkFromChunkCoords(var9, var10).getEntitiesWithinAABBForEntity(var1, var2, var4, var3); -+ for (int var9 = var5; var9 <= var6; ++var9) { -+ for (int var10 = var7; var10 <= var8; ++var10) { -+ if (this.chunkExists(var9, var10)) { -+ this.getChunkFromChunkCoords(var9, var10).getEntitiesWithinAABBForEntity(par1Entity, par2AxisAlignedBB, var4, par3IEntitySelector); - } - } - } -@@ -2282,21 +3039,24 @@ - return var4; - } - -- public List getEntitiesWithinAABB(Class var1, AxisAlignedBB var2) { -- return this.selectEntitiesWithinAABB(var1, var2, (IEntitySelector)null); -+ /** -+ * Returns all entities of the specified class type which intersect with the AABB. Args: entityClass, aabb -+ */ -+ public List getEntitiesWithinAABB(Class par1Class, AxisAlignedBB par2AxisAlignedBB) { -+ return this.selectEntitiesWithinAABB(par1Class, par2AxisAlignedBB, (IEntitySelector)null); - } - -- public List selectEntitiesWithinAABB(Class var1, AxisAlignedBB var2, IEntitySelector var3) { -- int var4 = MathHelper.floor_double((var2.minX - 2.0D) / 16.0D); -- int var5 = MathHelper.floor_double((var2.maxX + 2.0D) / 16.0D); -- int var6 = MathHelper.floor_double((var2.minZ - 2.0D) / 16.0D); -- int var7 = MathHelper.floor_double((var2.maxZ + 2.0D) / 16.0D); -+ public List selectEntitiesWithinAABB(Class par1Class, AxisAlignedBB par2AxisAlignedBB, IEntitySelector par3IEntitySelector) { -+ int var4 = MathHelper.floor_double((par2AxisAlignedBB.minX - 2.0D) / 16.0D); -+ int var5 = MathHelper.floor_double((par2AxisAlignedBB.maxX + 2.0D) / 16.0D); -+ int var6 = MathHelper.floor_double((par2AxisAlignedBB.minZ - 2.0D) / 16.0D); -+ int var7 = MathHelper.floor_double((par2AxisAlignedBB.maxZ + 2.0D) / 16.0D); - ArrayList var8 = new ArrayList(); - -- for(int var9 = var4; var9 <= var5; ++var9) { -- for(int var10 = var6; var10 <= var7; ++var10) { -- if(this.chunkExists(var9, var10)) { -- this.getChunkFromChunkCoords(var9, var10).getEntitiesOfTypeWithinAAAB(var1, var2, var8, var3); -+ for (int var9 = var4; var9 <= var5; ++var9) { -+ for (int var10 = var6; var10 <= var7; ++var10) { -+ if (this.chunkExists(var9, var10)) { -+ this.getChunkFromChunkCoords(var9, var10).getEntitiesOfTypeWithinAAAB(par1Class, par2AxisAlignedBB, var8, par3IEntitySelector); - } - } - } -@@ -2304,16 +3064,18 @@ - return var8; - } - -- public Entity findNearestEntityWithinAABB(Class var1, AxisAlignedBB var2, Entity var3) { -- List var4 = this.getEntitiesWithinAABB(var1, var2); -+ public Entity findNearestEntityWithinAABB(Class par1Class, AxisAlignedBB par2AxisAlignedBB, Entity par3Entity) { -+ List var4 = this.getEntitiesWithinAABB(par1Class, par2AxisAlignedBB); - Entity var5 = null; - double var6 = Double.MAX_VALUE; - -- for(int var8 = 0; var8 < var4.size(); ++var8) { -+ for (int var8 = 0; var8 < var4.size(); ++var8) { - Entity var9 = (Entity)var4.get(var8); -- if(var9 != var3) { -- double var10 = var3.getDistanceSqToEntity(var9); -- if(var10 <= var6) { -+ -+ if (var9 != par3Entity) { -+ double var10 = par3Entity.getDistanceSqToEntity(var9); -+ -+ if (var10 <= var6) { - var5 = var9; - var6 = var10; - } -@@ -2323,25 +3085,38 @@ - return var5; - } - -+ /** -+ * Returns the Entity with the given ID, or null if it doesn't exist in this World. -+ */ - public abstract Entity getEntityByID(int var1); - -+ /** -+ * Accessor for world Loaded Entity List -+ */ - public List getLoadedEntityList() { -- return this.e; -+ return this.loadedEntityList; - } - -- public void markTileEntityChunkModified(int var1, int var2, int var3, TileEntity var4) { -- if(this.blockExists(var1, var2, var3)) { -- this.getChunkFromBlockCoords(var1, var3).setChunkModified(); -+ /** -+ * Args: X, Y, Z, tile entity Marks the chunk the tile entity is in as modified. This is essential as chunks that are -+ * not marked as modified may be rolled back when exiting the game. -+ */ -+ public void markTileEntityChunkModified(int par1, int par2, int par3, TileEntity par4TileEntity) { -+ if (this.blockExists(par1, par2, par3)) { -+ this.getChunkFromBlockCoords(par1, par3).setChunkModified(); - } -- - } - -- public int countEntities(Class var1) { -+ /** -+ * Counts how many entities of an entity class exist in the world. Args: entityClass -+ */ -+ public int countEntities(Class par1Class) { - int var2 = 0; - -- for(int var3 = 0; var3 < this.e.size(); ++var3) { -- Entity var4 = (Entity)this.e.get(var3); -- if((!(var4 instanceof EntityLiving) || !((EntityLiving)var4).isNoDespawnRequired()) && var1.isAssignableFrom(var4.getClass())) { -+ for (int var3 = 0; var3 < this.loadedEntityList.size(); ++var3) { -+ Entity var4 = (Entity)this.loadedEntityList.get(var3); -+ -+ if ((!(var4 instanceof EntityLiving) || !((EntityLiving)var4).isNoDespawnRequired()) && par1Class.isAssignableFrom(var4.getClass())) { - ++var2; - } - } -@@ -2349,45 +3124,54 @@ - return var2; - } - -- public void addLoadedEntities(List var1) { -- this.e.addAll(var1); -+ /** -+ * adds entities to the loaded entities list, and loads thier skins. -+ */ -+ public void addLoadedEntities(List par1List) { -+ this.loadedEntityList.addAll(par1List); - -- for(int var2 = 0; var2 < var1.size(); ++var2) { -- this.onEntityAdded((Entity)var1.get(var2)); -+ for (int var2 = 0; var2 < par1List.size(); ++var2) { -+ this.onEntityAdded((Entity)par1List.get(var2)); - } -- -- } -- -- public void unloadEntities(List var1) { -- this.f.addAll(var1); -- } -- -- public boolean canPlaceEntityOnSide(int var1, int var2, int var3, int var4, boolean var5, int var6, Entity var7, ItemStack var8) { -- int var9 = this.getBlockId(var2, var3, var4); -+ } -+ -+ /** -+ * Adds a list of entities to be unloaded on the next pass of World.updateEntities() -+ */ -+ public void unloadEntities(List par1List) { -+ this.unloadedEntityList.addAll(par1List); -+ } -+ -+ /** -+ * Returns true if the given Entity can be placed on the given side of the given block position. -+ */ -+ public boolean canPlaceEntityOnSide(int par1, int par2, int par3, int par4, boolean par5, int par6, Entity par7Entity, ItemStack par8ItemStack) { -+ int var9 = this.getBlockId(par2, par3, par4); - Block var10 = Block.blocksList[var9]; -- Block var11 = Block.blocksList[var1]; -- AxisAlignedBB var12 = var11.getCollisionBoundingBoxFromPool(this, var2, var3, var4); -- if(var5) { -+ Block var11 = Block.blocksList[par1]; -+ AxisAlignedBB var12 = var11.getCollisionBoundingBoxFromPool(this, par2, par3, par4); -+ -+ if (par5) { - var12 = null; - } - -- if(var12 != null && !this.checkNoEntityCollision(var12, var7)) { -+ if (var12 != null && !this.checkNoEntityCollision(var12, par7Entity)) { - return false; - } else { -- if(var10 != null && (var10 == Block.waterMoving || var10 == Block.waterStill || var10 == Block.lavaMoving || var10 == Block.lavaStill || var10 == Block.fire || var10.blockMaterial.isReplaceable())) { -+ if (var10 != null && (var10 == Block.waterMoving || var10 == Block.waterStill || var10 == Block.lavaMoving || var10 == Block.lavaStill || var10 == Block.fire || var10.blockMaterial.isReplaceable())) { - var10 = null; - } - -- return var10 != null && var10.blockMaterial == Material.circuits && var11 == Block.anvil ? true : var1 > 0 && var10 == null && var11.canPlaceBlockOnSide(this, var2, var3, var4, var6, var8); -+ return var10 != null && var10.blockMaterial == Material.circuits && var11 == Block.anvil ? true : par1 > 0 && var10 == null && var11.canPlaceBlockOnSide(this, par2, par3, par4, par6, par8ItemStack); - } - } - -- public PathEntity getPathEntityToEntity(Entity var1, Entity var2, float var3, boolean var4, boolean var5, boolean var6, boolean var7) { -+ public PathEntity getPathEntityToEntity(Entity par1Entity, Entity par2Entity, float par3, boolean par4, boolean par5, boolean par6, boolean par7) { - this.theProfiler.startSection("pathfind"); -- int var8 = MathHelper.floor_double(var1.posX); -- int var9 = MathHelper.floor_double(var1.posY + 1.0D); -- int var10 = MathHelper.floor_double(var1.posZ); -- int var11 = (int)(var3 + 16.0F); -+ int var8 = MathHelper.floor_double(par1Entity.posX); -+ int var9 = MathHelper.floor_double(par1Entity.posY + 1.0D); -+ int var10 = MathHelper.floor_double(par1Entity.posZ); -+ int var11 = (int)(par3 + 16.0F); - int var12 = var8 - var11; - int var13 = var9 - var11; - int var14 = var10 - var11; -@@ -2395,17 +3179,17 @@ - int var16 = var9 + var11; - int var17 = var10 + var11; - ChunkCache var18 = new ChunkCache(this, var12, var13, var14, var15, var16, var17, 0); -- PathEntity var19 = (new PathFinder(var18, var4, var5, var6, var7)).createEntityPathTo(var1, var2, var3); -+ PathEntity var19 = (new PathFinder(var18, par4, par5, par6, par7)).createEntityPathTo(par1Entity, par2Entity, par3); - this.theProfiler.endSection(); - return var19; - } - -- public PathEntity getEntityPathToXYZ(Entity var1, int var2, int var3, int var4, float var5, boolean var6, boolean var7, boolean var8, boolean var9) { -+ public PathEntity getEntityPathToXYZ(Entity par1Entity, int par2, int par3, int par4, float par5, boolean par6, boolean par7, boolean par8, boolean par9) { - this.theProfiler.startSection("pathfind"); -- int var10 = MathHelper.floor_double(var1.posX); -- int var11 = MathHelper.floor_double(var1.posY); -- int var12 = MathHelper.floor_double(var1.posZ); -- int var13 = (int)(var5 + 8.0F); -+ int var10 = MathHelper.floor_double(par1Entity.posX); -+ int var11 = MathHelper.floor_double(par1Entity.posY); -+ int var12 = MathHelper.floor_double(par1Entity.posZ); -+ int var13 = (int)(par5 + 8.0F); - int var14 = var10 - var13; - int var15 = var11 - var13; - int var16 = var12 - var13; -@@ -2413,39 +3197,50 @@ - int var18 = var11 + var13; - int var19 = var12 + var13; - ChunkCache var20 = new ChunkCache(this, var14, var15, var16, var17, var18, var19, 0); -- PathEntity var21 = (new PathFinder(var20, var6, var7, var8, var9)).createEntityPathTo(var1, var2, var3, var4, var5); -+ PathEntity var21 = (new PathFinder(var20, par6, par7, par8, par9)).createEntityPathTo(par1Entity, par2, par3, par4, par5); - this.theProfiler.endSection(); - return var21; - } - -- public int isBlockProvidingPowerTo(int var1, int var2, int var3, int var4) { -- int var5 = this.getBlockId(var1, var2, var3); -- return var5 == 0 ? 0 : Block.blocksList[var5].isProvidingStrongPower(this, var1, var2, var3, var4); -+ /** -+ * Is this block powering in the specified direction Args: x, y, z, direction -+ */ -+ public int isBlockProvidingPowerTo(int par1, int par2, int par3, int par4) { -+ int var5 = this.getBlockId(par1, par2, par3); -+ return var5 == 0 ? 0 : Block.blocksList[var5].isProvidingStrongPower(this, par1, par2, par3, par4); - } - -- public int getBlockPowerInput(int var1, int var2, int var3) { -+ /** -+ * Returns the highest redstone signal strength powering the given block. Args: X, Y, Z. -+ */ -+ public int getBlockPowerInput(int par1, int par2, int par3) { - byte var4 = 0; -- int var5 = Math.max(var4, this.isBlockProvidingPowerTo(var1, var2 - 1, var3, 0)); -- if(var5 >= 15) { -+ int var5 = Math.max(var4, this.isBlockProvidingPowerTo(par1, par2 - 1, par3, 0)); -+ -+ if (var5 >= 15) { - return var5; - } else { -- var5 = Math.max(var5, this.isBlockProvidingPowerTo(var1, var2 + 1, var3, 1)); -- if(var5 >= 15) { -+ var5 = Math.max(var5, this.isBlockProvidingPowerTo(par1, par2 + 1, par3, 1)); -+ -+ if (var5 >= 15) { - return var5; - } else { -- var5 = Math.max(var5, this.isBlockProvidingPowerTo(var1, var2, var3 - 1, 2)); -- if(var5 >= 15) { -+ var5 = Math.max(var5, this.isBlockProvidingPowerTo(par1, par2, par3 - 1, 2)); -+ -+ if (var5 >= 15) { - return var5; - } else { -- var5 = Math.max(var5, this.isBlockProvidingPowerTo(var1, var2, var3 + 1, 3)); -- if(var5 >= 15) { -+ var5 = Math.max(var5, this.isBlockProvidingPowerTo(par1, par2, par3 + 1, 3)); -+ -+ if (var5 >= 15) { - return var5; - } else { -- var5 = Math.max(var5, this.isBlockProvidingPowerTo(var1 - 1, var2, var3, 4)); -- if(var5 >= 15) { -+ var5 = Math.max(var5, this.isBlockProvidingPowerTo(par1 - 1, par2, par3, 4)); -+ -+ if (var5 >= 15) { - return var5; - } else { -- var5 = Math.max(var5, this.isBlockProvidingPowerTo(var1 + 1, var2, var3, 5)); -+ var5 = Math.max(var5, this.isBlockProvidingPowerTo(par1 + 1, par2, par3, 5)); - return var5 >= 15 ? var5 : var5; - } - } -@@ -2454,33 +3249,45 @@ - } - } - -- public boolean getIndirectPowerOutput(int var1, int var2, int var3, int var4) { -- return this.getIndirectPowerLevelTo(var1, var2, var3, var4) > 0; -+ /** -+ * Returns the indirect signal strength being outputted by the given block in the *opposite* of the given direction. -+ * Args: X, Y, Z, direction -+ */ -+ public boolean getIndirectPowerOutput(int par1, int par2, int par3, int par4) { -+ return this.getIndirectPowerLevelTo(par1, par2, par3, par4) > 0; - } - -- public int getIndirectPowerLevelTo(int var1, int var2, int var3, int var4) { -- if(this.isBlockNormalCube(var1, var2, var3)) { -- return this.getBlockPowerInput(var1, var2, var3); -+ /** -+ * Gets the power level from a certain block face. Args: x, y, z, direction -+ */ -+ public int getIndirectPowerLevelTo(int par1, int par2, int par3, int par4) { -+ if (this.isBlockNormalCube(par1, par2, par3)) { -+ return this.getBlockPowerInput(par1, par2, par3); - } else { -- int var5 = this.getBlockId(var1, var2, var3); -- return var5 == 0 ? 0 : Block.blocksList[var5].isProvidingWeakPower(this, var1, var2, var3, var4); -+ int var5 = this.getBlockId(par1, par2, par3); -+ return var5 == 0 ? 0 : Block.blocksList[var5].isProvidingWeakPower(this, par1, par2, par3, par4); - } - } - -- public boolean isBlockIndirectlyGettingPowered(int var1, int var2, int var3) { -- return this.getIndirectPowerLevelTo(var1, var2 - 1, var3, 0) > 0 ? true : (this.getIndirectPowerLevelTo(var1, var2 + 1, var3, 1) > 0 ? true : (this.getIndirectPowerLevelTo(var1, var2, var3 - 1, 2) > 0 ? true : (this.getIndirectPowerLevelTo(var1, var2, var3 + 1, 3) > 0 ? true : (this.getIndirectPowerLevelTo(var1 - 1, var2, var3, 4) > 0 ? true : this.getIndirectPowerLevelTo(var1 + 1, var2, var3, 5) > 0)))); -+ /** -+ * Used to see if one of the blocks next to you or your block is getting power from a neighboring block. Used by items -+ * like TNT or Doors so they don't have redstone going straight into them. Args: x, y, z -+ */ -+ public boolean isBlockIndirectlyGettingPowered(int par1, int par2, int par3) { -+ return this.getIndirectPowerLevelTo(par1, par2 - 1, par3, 0) > 0 ? true : (this.getIndirectPowerLevelTo(par1, par2 + 1, par3, 1) > 0 ? true : (this.getIndirectPowerLevelTo(par1, par2, par3 - 1, 2) > 0 ? true : (this.getIndirectPowerLevelTo(par1, par2, par3 + 1, 3) > 0 ? true : (this.getIndirectPowerLevelTo(par1 - 1, par2, par3, 4) > 0 ? true : this.getIndirectPowerLevelTo(par1 + 1, par2, par3, 5) > 0)))); - } - -- public int getStrongestIndirectPower(int var1, int var2, int var3) { -+ public int getStrongestIndirectPower(int par1, int par2, int par3) { - int var4 = 0; - -- for(int var5 = 0; var5 < 6; ++var5) { -- int var6 = this.getIndirectPowerLevelTo(var1 + Facing.offsetsXForSide[var5], var2 + Facing.offsetsYForSide[var5], var3 + Facing.offsetsZForSide[var5], var5); -- if(var6 >= 15) { -+ for (int var5 = 0; var5 < 6; ++var5) { -+ int var6 = this.getIndirectPowerLevelTo(par1 + Facing.offsetsXForSide[var5], par2 + Facing.offsetsYForSide[var5], par3 + Facing.offsetsZForSide[var5], var5); -+ -+ if (var6 >= 15) { - return 15; - } - -- if(var6 > var4) { -+ if (var6 > var4) { - var4 = var6; - } - } -@@ -2488,18 +3295,27 @@ - return var4; - } - -- public EntityPlayer getClosestPlayerToEntity(Entity var1, double var2) { -- return this.getClosestPlayer(var1.posX, var1.posY, var1.posZ, var2); -+ /** -+ * Gets the closest player to the entity within the specified distance (if distance is less than 0 then ignored). Args: -+ * entity, dist -+ */ -+ public EntityPlayer getClosestPlayerToEntity(Entity par1Entity, double par2) { -+ return this.getClosestPlayer(par1Entity.posX, par1Entity.posY, par1Entity.posZ, par2); - } - -- public EntityPlayer getClosestPlayer(double var1, double var3, double var5, double var7) { -+ /** -+ * Gets the closest player to the point within the specified distance (distance can be set to less than 0 to not limit -+ * the distance). Args: x, y, z, dist -+ */ -+ public EntityPlayer getClosestPlayer(double par1, double par3, double par5, double par7) { - double var9 = -1.0D; - EntityPlayer var11 = null; - -- for(int var12 = 0; var12 < this.h.size(); ++var12) { -- EntityPlayer var13 = (EntityPlayer)this.h.get(var12); -- double var14 = var13.getDistanceSq(var1, var3, var5); -- if((var7 < 0.0D || var14 < var7 * var7) && (var9 == -1.0D || var14 < var9)) { -+ for (int var12 = 0; var12 < this.playerEntities.size(); ++var12) { -+ EntityPlayer var13 = (EntityPlayer)this.playerEntities.get(var12); -+ double var14 = var13.getDistanceSq(par1, par3, par5); -+ -+ if ((par7 < 0.0D || var14 < par7 * par7) && (var9 == -1.0D || var14 < var9)) { - var9 = var14; - var11 = var13; - } -@@ -2508,33 +3324,42 @@ - return var11; - } - -- public EntityPlayer getClosestVulnerablePlayerToEntity(Entity var1, double var2) { -- return this.getClosestVulnerablePlayer(var1.posX, var1.posY, var1.posZ, var2); -+ /** -+ * Returns the closest vulnerable player to this entity within the given radius, or null if none is found -+ */ -+ public EntityPlayer getClosestVulnerablePlayerToEntity(Entity par1Entity, double par2) { -+ return this.getClosestVulnerablePlayer(par1Entity.posX, par1Entity.posY, par1Entity.posZ, par2); - } - -- public EntityPlayer getClosestVulnerablePlayer(double var1, double var3, double var5, double var7) { -+ /** -+ * Returns the closest vulnerable player within the given radius, or null if none is found. -+ */ -+ public EntityPlayer getClosestVulnerablePlayer(double par1, double par3, double par5, double par7) { - double var9 = -1.0D; - EntityPlayer var11 = null; - -- for(int var12 = 0; var12 < this.h.size(); ++var12) { -- EntityPlayer var13 = (EntityPlayer)this.h.get(var12); -- if(!var13.capabilities.disableDamage && var13.isEntityAlive()) { -- double var14 = var13.getDistanceSq(var1, var3, var5); -- double var16 = var7; -- if(var13.isSneaking()) { -- var16 = var7 * (double)0.8F; -+ for (int var12 = 0; var12 < this.playerEntities.size(); ++var12) { -+ EntityPlayer var13 = (EntityPlayer)this.playerEntities.get(var12); -+ -+ if (!var13.capabilities.disableDamage && var13.isEntityAlive()) { -+ double var14 = var13.getDistanceSq(par1, par3, par5); -+ double var16 = par7; -+ -+ if (var13.isSneaking()) { -+ var16 = par7 * 0.800000011920929D; - } - -- if(var13.isInvisible()) { -+ if (var13.isInvisible()) { - float var18 = var13.getArmorVisibility(); -- if(var18 < 0.1F) { -+ -+ if (var18 < 0.1F) { - var18 = 0.1F; - } - - var16 *= (double)(0.7F * var18); - } - -- if((var7 < 0.0D || var14 < var16 * var16) && (var9 == -1.0D || var14 < var9)) { -+ if ((par7 < 0.0D || var14 < var16 * var16) && (var9 == -1.0D || var14 < var9)) { - var9 = var14; - var11 = var13; - } -@@ -2544,27 +3369,38 @@ - return var11; - } - -- public EntityPlayer getPlayerEntityByName(String var1) { -- for(int var2 = 0; var2 < this.h.size(); ++var2) { -- if(var1.equals(((EntityPlayer)this.h.get(var2)).getCommandSenderName())) { -- return (EntityPlayer)this.h.get(var2); -+ /** -+ * Find a player by name in this world. -+ */ -+ public EntityPlayer getPlayerEntityByName(String par1Str) { -+ for (int var2 = 0; var2 < this.playerEntities.size(); ++var2) { -+ if (par1Str.equals(((EntityPlayer)this.playerEntities.get(var2)).getCommandSenderName())) { -+ return (EntityPlayer)this.playerEntities.get(var2); - } - } - - return null; - } - -- public void sendQuittingDisconnectingPacket() { -- } -+ /** -+ * If on MP, sends a quitting packet. -+ */ -+ public void sendQuittingDisconnectingPacket() {} - -+ /** -+ * Checks whether the session lock file was modified by another process -+ */ - public void checkSessionLock() throws MinecraftException { - this.saveHandler.checkSessionLock(); - } - -- public void func_82738_a(long var1) { -- this.worldInfo.incrementTotalWorldTime(var1); -+ public void func_82738_a(long par1) { -+ this.worldInfo.incrementTotalWorldTime(par1); - } - -+ /** -+ * Retrieve the world seed from level.dat -+ */ - public long getSeed() { - return this.worldInfo.getSeed(); - } -@@ -2577,179 +3413,258 @@ - return this.worldInfo.getWorldTime(); - } - -- public void setWorldTime(long var1) { -- this.worldInfo.setWorldTime(var1); -+ /** -+ * Sets the world time. -+ */ -+ public void setWorldTime(long par1) { -+ this.worldInfo.setWorldTime(par1); - } - -+ /** -+ * Returns the coordinates of the spawn point -+ */ - public ChunkCoordinates getSpawnPoint() { - return new ChunkCoordinates(this.worldInfo.getSpawnX(), this.worldInfo.getSpawnY(), this.worldInfo.getSpawnZ()); - } - -- public void setSpawnLocation(int var1, int var2, int var3) { -- this.worldInfo.setSpawnPosition(var1, var2, var3); -+ public void setSpawnLocation(int par1, int par2, int par3) { -+ this.worldInfo.setSpawnPosition(par1, par2, par3); - } - -- public void joinEntityInSurroundings(Entity var1) { -- int var2 = MathHelper.floor_double(var1.posX / 16.0D); -- int var3 = MathHelper.floor_double(var1.posZ / 16.0D); -+ /** -+ * spwans an entity and loads surrounding chunks -+ */ -+ public void joinEntityInSurroundings(Entity par1Entity) { -+ int var2 = MathHelper.floor_double(par1Entity.posX / 16.0D); -+ int var3 = MathHelper.floor_double(par1Entity.posZ / 16.0D); - byte var4 = 2; - -- for(int var5 = var2 - var4; var5 <= var2 + var4; ++var5) { -- for(int var6 = var3 - var4; var6 <= var3 + var4; ++var6) { -+ for (int var5 = var2 - var4; var5 <= var2 + var4; ++var5) { -+ for (int var6 = var3 - var4; var6 <= var3 + var4; ++var6) { - this.getChunkFromChunkCoords(var5, var6); - } - } - -- if(!this.e.contains(var1)) { -- this.e.add(var1); -+ if (!this.loadedEntityList.contains(par1Entity)) { -+ this.loadedEntityList.add(par1Entity); - } -- - } - -- public boolean canMineBlock(EntityPlayer var1, int var2, int var3, int var4) { -+ /** -+ * Called when checking if a certain block can be mined or not. The 'spawn safe zone' check is located here. -+ */ -+ public boolean canMineBlock(EntityPlayer par1EntityPlayer, int par2, int par3, int par4) { - return true; - } - -- public void setEntityState(Entity var1, byte var2) { -- } -+ /** -+ * sends a Packet 38 (Entity Status) to all tracked players of that entity -+ */ -+ public void setEntityState(Entity par1Entity, byte par2) {} - -+ /** -+ * gets the IChunkProvider this world uses. -+ */ - public IChunkProvider getChunkProvider() { - return this.chunkProvider; - } - -- public void addBlockEvent(int var1, int var2, int var3, int var4, int var5, int var6) { -- if(var4 > 0) { -- Block.blocksList[var4].onBlockEventReceived(this, var1, var2, var3, var5, var6); -+ /** -+ * Adds a block event with the given Args to the blockEventCache. During the next tick(), the block specified will have -+ * its onBlockEvent handler called with the given parameters. Args: X,Y,Z, BlockID, EventID, EventParameter -+ */ -+ public void addBlockEvent(int par1, int par2, int par3, int par4, int par5, int par6) { -+ if (par4 > 0) { -+ Block.blocksList[par4].onBlockEventReceived(this, par1, par2, par3, par5, par6); - } -- - } - -+ /** -+ * Returns this world's current save handler -+ */ - public ISaveHandler getSaveHandler() { - return this.saveHandler; - } - -+ /** -+ * Gets the World's WorldInfo instance -+ */ - public WorldInfo getWorldInfo() { - return this.worldInfo; - } - -+ /** -+ * Gets the GameRules instance. -+ */ - public GameRules getGameRules() { - return this.worldInfo.getGameRulesInstance(); - } - -- public void updateAllPlayersSleepingFlag() { -- } -- -- public float getWeightedThunderStrength(float var1) { -- return (this.prevThunderingStrength + (this.thunderingStrength - this.prevThunderingStrength) * var1) * this.getRainStrength(var1); -- } -- -- public float getRainStrength(float var1) { -- return this.prevRainingStrength + (this.rainingStrength - this.prevRainingStrength) * var1; -- } -- -- public void setRainStrength(float var1) { -- this.prevRainingStrength = var1; -- this.rainingStrength = var1; -- } -- -+ /** -+ * Updates the flag that indicates whether or not all players in the world are sleeping. -+ */ -+ public void updateAllPlayersSleepingFlag() {} -+ -+ public float getWeightedThunderStrength(float par1) { -+ return (this.prevThunderingStrength + (this.thunderingStrength - this.prevThunderingStrength) * par1) * this.getRainStrength(par1); -+ } -+ -+ /** -+ * Not sure about this actually. Reverting this one myself. -+ */ -+ public float getRainStrength(float par1) { -+ return this.prevRainingStrength + (this.rainingStrength - this.prevRainingStrength) * par1; -+ } -+ -+ public void setRainStrength(float par1) { -+ this.prevRainingStrength = par1; -+ this.rainingStrength = par1; -+ } -+ -+ /** -+ * Returns true if the current thunder strength (weighted with the rain strength) is greater than 0.9 -+ */ - public boolean isThundering() { - return (double)this.getWeightedThunderStrength(1.0F) > 0.9D; - } - -+ /** -+ * Returns true if the current rain strength is greater than 0.2 -+ */ - public boolean isRaining() { - return (double)this.getRainStrength(1.0F) > 0.2D; - } - -- public boolean canLightningStrikeAt(int var1, int var2, int var3) { -- if(!this.isRaining()) { -- return false; -- } else if(!this.canBlockSeeTheSky(var1, var2, var3)) { -- return false; -- } else if(this.getPrecipitationHeight(var1, var3) > var2) { -+ public boolean canLightningStrikeAt(int par1, int par2, int par3) { -+ if (!this.isRaining()) { -+ return false; -+ } else if (!this.canBlockSeeTheSky(par1, par2, par3)) { -+ return false; -+ } else if (this.getPrecipitationHeight(par1, par3) > par2) { - return false; - } else { -- BiomeGenBase var4 = this.getBiomeGenForCoords(var1, var3); -+ BiomeGenBase var4 = this.getBiomeGenForCoords(par1, par3); - return var4.getEnableSnow() ? false : var4.canSpawnLightningBolt(); - } - } - -- public boolean isBlockHighHumidity(int var1, int var2, int var3) { -- BiomeGenBase var4 = this.getBiomeGenForCoords(var1, var3); -+ /** -+ * Checks to see if the biome rainfall values for a given x,y,z coordinate set are extremely high -+ */ -+ public boolean isBlockHighHumidity(int par1, int par2, int par3) { -+ BiomeGenBase var4 = this.getBiomeGenForCoords(par1, par3); - return var4.isHighHumidity(); - } - -- public void setItemData(String var1, WorldSavedData var2) { -- this.mapStorage.setData(var1, var2); -- } -- -- public WorldSavedData loadItemData(Class var1, String var2) { -- return this.mapStorage.loadData(var1, var2); -- } -- -- public int getUniqueDataId(String var1) { -- return this.mapStorage.getUniqueDataId(var1); -- } -- -- public void func_82739_e(int var1, int var2, int var3, int var4, int var5) { -- for(int var6 = 0; var6 < this.u.size(); ++var6) { -- ((IWorldAccess)this.u.get(var6)).broadcastSound(var1, var2, var3, var4, var5); -+ /** -+ * Assigns the given String id to the given MapDataBase using the MapStorage, removing any existing ones of the same -+ * id. -+ */ -+ public void setItemData(String par1Str, WorldSavedData par2WorldSavedData) { -+ this.mapStorage.setData(par1Str, par2WorldSavedData); -+ } -+ -+ /** -+ * Loads an existing MapDataBase corresponding to the given String id from disk using the MapStorage, instantiating the -+ * given Class, or returns null if none such file exists. args: Class to instantiate, String dataid -+ */ -+ public WorldSavedData loadItemData(Class par1Class, String par2Str) { -+ return this.mapStorage.loadData(par1Class, par2Str); -+ } -+ -+ /** -+ * Returns an unique new data id from the MapStorage for the given prefix and saves the idCounts map to the 'idcounts' -+ * file. -+ */ -+ public int getUniqueDataId(String par1Str) { -+ return this.mapStorage.getUniqueDataId(par1Str); -+ } -+ -+ public void func_82739_e(int par1, int par2, int par3, int par4, int par5) { -+ for (int var6 = 0; var6 < this.worldAccesses.size(); ++var6) { -+ ((IWorldAccess)this.worldAccesses.get(var6)).broadcastSound(par1, par2, par3, par4, par5); - } -- -- } -- -- public void playAuxSFX(int var1, int var2, int var3, int var4, int var5) { -- this.playAuxSFXAtEntity((EntityPlayer)null, var1, var2, var3, var4, var5); -- } -- -- public void playAuxSFXAtEntity(EntityPlayer var1, int var2, int var3, int var4, int var5, int var6) { -+ } -+ -+ /** -+ * See description for playAuxSFX. -+ */ -+ public void playAuxSFX(int par1, int par2, int par3, int par4, int par5) { -+ this.playAuxSFXAtEntity((EntityPlayer)null, par1, par2, par3, par4, par5); -+ } -+ -+ /** -+ * See description for playAuxSFX. -+ */ -+ public void playAuxSFXAtEntity(EntityPlayer par1EntityPlayer, int par2, int par3, int par4, int par5, int par6) { - try { -- for(int var7 = 0; var7 < this.u.size(); ++var7) { -- ((IWorldAccess)this.u.get(var7)).playAuxSFX(var1, var2, var3, var4, var5, var6); -+ for (int var7 = 0; var7 < this.worldAccesses.size(); ++var7) { -+ ((IWorldAccess)this.worldAccesses.get(var7)).playAuxSFX(par1EntityPlayer, par2, par3, par4, par5, par6); - } -- - } catch (Throwable var10) { - CrashReport var8 = CrashReport.makeCrashReport(var10, "Playing level event"); - CrashReportCategory var9 = var8.makeCategory("Level event being played"); -- var9.addCrashSection("Block coordinates", CrashReportCategory.getLocationInfo(var3, var4, var5)); -- var9.addCrashSection("Event source", var1); -- var9.addCrashSection("Event type", Integer.valueOf(var2)); -- var9.addCrashSection("Event data", Integer.valueOf(var6)); -+ var9.addCrashSection("Block coordinates", CrashReportCategory.getLocationInfo(par3, par4, par5)); -+ var9.addCrashSection("Event source", par1EntityPlayer); -+ var9.addCrashSection("Event type", Integer.valueOf(par2)); -+ var9.addCrashSection("Event data", Integer.valueOf(par6)); - throw new ReportedException(var8); - } - } - -+ /** -+ * Returns current world height. -+ */ - public int getHeight() { - return 256; - } - -+ /** -+ * Returns current world height. -+ */ - public int getActualHeight() { - return this.provider.hasNoSky ? 128 : 256; - } - -- public IUpdatePlayerListBox getMinecartSoundUpdater(EntityMinecart var1) { -+ public IUpdatePlayerListBox getMinecartSoundUpdater(EntityMinecart par1EntityMinecart) { - return null; - } - -- public Random setRandomSeed(int var1, int var2, int var3) { -- long var4 = (long)var1 * 341873128712L + (long)var2 * 132897987541L + this.getWorldInfo().getSeed() + (long)var3; -- this.s.setSeed(var4); -- return this.s; -- } -- -- public ChunkPosition findClosestStructure(String var1, int var2, int var3, int var4) { -- return this.getChunkProvider().findClosestStructure(this, var1, var2, var3, var4); -- } -- -+ /** -+ * puts the World Random seed to a specific state dependant on the inputs -+ */ -+ public Random setRandomSeed(int par1, int par2, int par3) { -+ long var4 = (long)par1 * 341873128712L + (long)par2 * 132897987541L + this.getWorldInfo().getSeed() + (long)par3; -+ this.rand.setSeed(var4); -+ return this.rand; -+ } -+ -+ /** -+ * Returns the location of the closest structure of the specified type. If not found returns null. -+ */ -+ public ChunkPosition findClosestStructure(String par1Str, int par2, int par3, int par4) { -+ return this.getChunkProvider().findClosestStructure(this, par1Str, par2, par3, par4); -+ } -+ -+ /** -+ * set by !chunk.getAreLevelsEmpty -+ */ - public boolean extendedLevelsInChunkCache() { - return false; - } - -+ /** -+ * Returns horizon height for use in rendering the sky. -+ */ - public double getHorizon() { - return this.worldInfo.getTerrainType() == WorldType.FLAT ? 0.0D : 63.0D; - } - -- public CrashReportCategory addWorldInfoToCrashReport(CrashReport var1) { -- CrashReportCategory var2 = var1.makeCategoryDepth("Affected level", 1); -+ /** -+ * Adds some basic stats of the world to the given crash report. -+ */ -+ public CrashReportCategory addWorldInfoToCrashReport(CrashReport par1CrashReport) { -+ CrashReportCategory var2 = par1CrashReport.makeCategoryDepth("Affected level", 1); - var2.addCrashSection("Level name", this.worldInfo == null ? "????" : this.worldInfo.getWorldName()); - var2.addCrashSectionCallable("All players", new CallableLvl2(this)); - var2.addCrashSectionCallable("Chunk stats", new CallableLvl3(this)); -@@ -2763,77 +3678,139 @@ - return var2; - } - -- public void destroyBlockInWorldPartially(int var1, int var2, int var3, int var4, int var5) { -- for(int var6 = 0; var6 < this.u.size(); ++var6) { -- IWorldAccess var7 = (IWorldAccess)this.u.get(var6); -- var7.destroyBlockPartially(var1, var2, var3, var4, var5); -+ /** -+ * Starts (or continues) destroying a block with given ID at the given coordinates for the given partially destroyed -+ * value -+ */ -+ public void destroyBlockInWorldPartially(int par1, int par2, int par3, int par4, int par5) { -+ for (int var6 = 0; var6 < this.worldAccesses.size(); ++var6) { -+ IWorldAccess var7 = (IWorldAccess)this.worldAccesses.get(var6); -+ var7.destroyBlockPartially(par1, par2, par3, par4, par5); - } -- - } - -+ /** -+ * Return the Vec3Pool object for this world. -+ */ - public Vec3Pool getWorldVec3Pool() { - return this.vecPool; - } - -+ /** -+ * returns a calendar object containing the current date -+ */ - public Calendar getCurrentDate() { -- if(this.getTotalWorldTime() % 600L == 0L) { -- this.K.setTimeInMillis(MinecraftServer.getCurrentTimeMillis()); -+ if (this.getTotalWorldTime() % 600L == 0L) { -+ this.theCalendar.setTimeInMillis(MinecraftServer.getSystemTimeMillis()); - } - -- return this.K; -+ return this.theCalendar; - } - -- public void func_92088_a(double var1, double var3, double var5, double var7, double var9, double var11, NBTTagCompound var13) { -- } -+ public void func_92088_a(double par1, double par3, double par5, double par7, double par9, double par11, NBTTagCompound par13NBTTagCompound) {} - - public Scoreboard getScoreboard() { - return this.worldScoreboard; - } - -- public void func_96440_m(int var1, int var2, int var3, int var4) { -- for(int var5 = 0; var5 < 4; ++var5) { -- int var6 = var1 + Direction.offsetX[var5]; -- int var7 = var3 + Direction.offsetZ[var5]; -- int var8 = this.getBlockId(var6, var2, var7); -- if(var8 != 0) { -+ public void func_96440_m(int par1, int par2, int par3, int par4) { -+ for (int var5 = 0; var5 < 4; ++var5) { -+ int var6 = par1 + Direction.offsetX[var5]; -+ int var7 = par3 + Direction.offsetZ[var5]; -+ int var8 = this.getBlockId(var6, par2, var7); -+ -+ if (var8 != 0) { - Block var9 = Block.blocksList[var8]; -- if(Block.redstoneComparatorIdle.func_94487_f(var8)) { -- var9.onNeighborBlockChange(this, var6, var2, var7, var4); -- } else if(Block.isNormalCube(var8)) { -+ -+ if (Block.redstoneComparatorIdle.func_94487_f(var8)) { -+ var9.onNeighborBlockChange(this, var6, par2, var7, par4); -+ } else if (Block.isNormalCube(var8)) { - var6 += Direction.offsetX[var5]; - var7 += Direction.offsetZ[var5]; -- var8 = this.getBlockId(var6, var2, var7); -+ var8 = this.getBlockId(var6, par2, var7); - var9 = Block.blocksList[var8]; -- if(Block.redstoneComparatorIdle.func_94487_f(var8)) { -- var9.onNeighborBlockChange(this, var6, var2, var7, var4); -+ -+ if (Block.redstoneComparatorIdle.func_94487_f(var8)) { -+ var9.onNeighborBlockChange(this, var6, par2, var7, par4); - } - } - } - } -- - } - - public ILogAgent getWorldLogAgent() { - return this.worldLogAgent; - } - -- public float getLocationTensionFactor(double var1, double var3, double var5) { -- return this.getTensionFactorForBlock(MathHelper.floor_double(var1), MathHelper.floor_double(var3), MathHelper.floor_double(var5)); -+ /** -+ * returns a float value that can be used to determine how likely something is to go awry in the area. It increases -+ * based on how long the player is within the vicinity, the lunar phase, and game difficulty. The value can be up to -+ * 1.5 on the highest difficulty, 1.0 otherwise. -+ */ -+ public float getLocationTensionFactor(double par1, double par3, double par5) { -+ return this.getTensionFactorForBlock(MathHelper.floor_double(par1), MathHelper.floor_double(par3), MathHelper.floor_double(par5)); - } - -- public float getTensionFactorForBlock(int var1, int var2, int var3) { -+ /** -+ * returns a float value that can be used to determine how likely something is to go awry in the area. It increases -+ * based on how long the player is within the vicinity, the lunar phase, and game difficulty. The value can be up to -+ * 1.5 on the highest difficulty, 1.0 otherwise. -+ */ -+ public float getTensionFactorForBlock(int par1, int par2, int par3) { - float var4 = 0.0F; - boolean var5 = this.difficultySetting == 3; -- if(this.blockExists(var1, var2, var3)) { -+ -+ if (this.blockExists(par1, par2, par3)) { - float var6 = this.getCurrentMoonPhaseFactor(); -- var4 += MathHelper.clamp_float((float)this.getChunkFromBlockCoords(var1, var3).inhabitedTime / 3600000.0F, 0.0F, 1.0F) * (var5 ? 1.0F : 12.0F / 16.0F); -+ var4 += MathHelper.clamp_float((float)this.getChunkFromBlockCoords(par1, par3).inhabitedTime / 3600000.0F, 0.0F, 1.0F) * (var5 ? 1.0F : 0.75F); - var4 += var6 * 0.25F; - } - -- if(this.difficultySetting < 2) { -+ if (this.difficultySetting < 2) { - var4 *= (float)this.difficultySetting / 2.0F; - } - - return MathHelper.clamp_float(var4, 0.0F, var5 ? 1.5F : 1.0F); - } -+ -+ // Spout Start -+ public void doColorfulStuff() { -+ for(int i = 0; i < this.playerEntities.size(); ++i) { -+ EntityPlayer ep = (EntityPlayer)this.playerEntities.get(i); -+ if (ep != Minecraft.getMinecraft().thePlayer || Minecraft.getMinecraft().gameSettings.thirdPersonView != 0) { -+ ep.doFancyStuff(); -+ } -+ } -+ } -+ -+ public int getGrassColorCache(int x, int y, int z) { -+ Chunk chunk = getChunkFromBlockCoords(x, z); -+ if (chunk != null) { -+ return chunk.grassColorCache; -+ } -+ return 0xffffff; -+ } -+ -+ public void setGrassColorCache(int x, int y, int z, int color) { -+ Chunk chunk = getChunkFromBlockCoords(x, z); -+ if (chunk != null) { -+ chunk.grassColorCache = color; -+ } -+ } -+ -+ public int getWaterColorCache(int x, int y, int z) { -+ Chunk chunk = getChunkFromBlockCoords(x, z); -+ if (chunk != null) { -+ return chunk.waterColorCache; -+ } -+ return 0xffffff; -+ } -+ -+ public void setWaterColorCache(int x, int y, int z, int color) { -+ Chunk chunk = getChunkFromBlockCoords(x, z); -+ if (chunk != null) { -+ chunk.waterColorCache = color; -+ } -+ } -+ // Spout End - } ---- net/minecraft/src/RenderArrow.java -+++ net/minecraft/src/RenderArrow.java -@@ -6,12 +6,12 @@ - public class RenderArrow extends Render { - private static final ResourceLocation arrowTextures = new ResourceLocation("textures/entity/arrow.png"); - -- public void renderArrow(EntityArrow var1, double var2, double var4, double var6, float var8, float var9) { -- this.bindEntityTexture(var1); -+ public void renderArrow(EntityArrow par1EntityArrow, double par2, double par4, double par6, float par8, float par9) { -+ this.bindEntityTexture(par1EntityArrow); - GL11.glPushMatrix(); -- GL11.glTranslatef((float)var2, (float)var4, (float)var6); -- GL11.glRotatef(var1.prevRotationYaw + (var1.rotationYaw - var1.prevRotationYaw) * var9 - 90.0F, 0.0F, 1.0F, 0.0F); -- GL11.glRotatef(var1.prevRotationPitch + (var1.rotationPitch - var1.prevRotationPitch) * var9, 0.0F, 0.0F, 1.0F); -+ GL11.glTranslatef((float)par2, (float)par4, (float)par6); -+ GL11.glRotatef(par1EntityArrow.prevRotationYaw + (par1EntityArrow.rotationYaw - par1EntityArrow.prevRotationYaw) * par9 - 90.0F, 0.0F, 1.0F, 0.0F); -+ GL11.glRotatef(par1EntityArrow.prevRotationPitch + (par1EntityArrow.rotationPitch - par1EntityArrow.prevRotationPitch) * par9, 0.0F, 0.0F, 1.0F); - Tessellator var10 = Tessellator.instance; - byte var11 = 0; - float var12 = 0.0F; -@@ -24,8 +24,9 @@ - float var19 = (float)(10 + var11 * 10) / 32.0F; - float var20 = 0.05625F; - GL11.glEnable(GL12.GL_RESCALE_NORMAL); -- float var21 = (float)var1.arrowShake - var9; -- if(var21 > 0.0F) { -+ float var21 = (float)par1EntityArrow.arrowShake - par9; -+ -+ if (var21 > 0.0F) { - float var22 = -MathHelper.sin(var21 * 3.0F) * var21; - GL11.glRotatef(var22, 0.0F, 0.0F, 1.0F); - } -@@ -48,7 +49,7 @@ - var10.addVertexWithUV(-7.0D, -2.0D, -2.0D, (double)var16, (double)var19); - var10.draw(); - -- for(int var23 = 0; var23 < 4; ++var23) { -+ for (int var23 = 0; var23 < 4; ++var23) { - GL11.glRotatef(90.0F, 1.0F, 0.0F, 0.0F); - GL11.glNormal3f(0.0F, 0.0F, var20); - var10.startDrawingQuads(); -@@ -63,15 +64,24 @@ - GL11.glPopMatrix(); - } - -- protected ResourceLocation getArrowTextures(EntityArrow var1) { -+ protected ResourceLocation getArrowTextures(EntityArrow par1EntityArrow) { - return arrowTextures; - } - -- protected ResourceLocation getEntityTexture(Entity var1) { -- return this.getArrowTextures((EntityArrow)var1); -+ /** -+ * Returns the location of an entity's texture. Doesn't seem to be called unless you call Render.bindEntityTexture. -+ */ -+ protected ResourceLocation getEntityTexture(Entity par1Entity) { -+ return this.getArrowTextures((EntityArrow)par1Entity); - } - -- public void doRender(Entity var1, double var2, double var4, double var6, float var8, float var9) { -- this.renderArrow((EntityArrow)var1, var2, var4, var6, var8, var9); -+ /** -+ * Actually renders the given argument. This is a synthetic bridge method, always casting down its argument and then -+ * handing it off to a worker function which does the actual work. In all probabilty, the class Render is generic -+ * (Render -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.api; -+ -+import java.util.HashMap; -+import java.util.Map; -+ -+public enum Instrument { -+ PIANO((byte) 0x0), // All other -+ BASS_DRUM((byte) 0x1), // Stone -+ SNARE_DRUM((byte) 0x2), // Sand -+ STICKS((byte) 0x3), // Glass -+ BASS_GUITAR((byte) 0x4); // Wood -+ -+ private final byte type; -+ private final static Map types = new HashMap(); -+ -+ private Instrument(byte type) { -+ this.type = type; -+ } -+ -+ public byte getType() { -+ return this.type; -+ } -+ -+ public static Instrument getByType(final byte type) { -+ return types.get(type); -+ } -+ -+ static { -+ for (Instrument instrument : Instrument.values()) { -+ types.put(instrument.getType(), instrument); -+ } -+ } -+} ---- net/minecraft/src/GuiConfirmOpenLink.java -+++ net/minecraft/src/GuiConfirmOpenLink.java -@@ -1,47 +1,77 @@ - package net.minecraft.src; - -+import net.minecraft.src.GuiButton; -+ -+import org.lwjgl.Sys; -+ - public class GuiConfirmOpenLink extends GuiYesNo { -- private String p; -- private String q; -- private String r; -+ -+ /** Text to warn players from opening unsafe links. */ -+ private String openLinkWarning; -+ -+ /** Label for the Copy to Clipboard button. */ -+ private String copyLinkButtonText; -+ private String field_92028_p; - private boolean field_92027_q = true; - -- public GuiConfirmOpenLink(GuiScreen var1, String var2, int var3, boolean var4) { -- super(var1, I18n.getString(var4 ? "chat.link.confirmTrusted" : "chat.link.confirm"), var2, var3); -- this.c = I18n.getString(var4 ? "chat.link.open" : "gui.yes"); -- this.d = I18n.getString(var4 ? "gui.cancel" : "gui.no"); -- this.q = I18n.getString("chat.copy"); -- this.p = I18n.getString("chat.link.warning"); -- this.r = var2; -+ public GuiConfirmOpenLink(GuiScreen par1GuiScreen, String par2Str, int par3, boolean par4) { -+ super(par1GuiScreen, I18n.getString(par4 ? "chat.link.confirmTrusted" : "chat.link.confirm"), par2Str, par3); -+ this.buttonText1 = I18n.getString(par4 ? "chat.link.open" : "gui.yes"); -+ this.buttonText2 = I18n.getString(par4 ? "gui.cancel" : "gui.no"); -+ this.copyLinkButtonText = I18n.getString("chat.copy"); -+ this.openLinkWarning = I18n.getString("chat.link.warning"); -+ this.field_92028_p = par2Str; - } - -+ /** -+ * Adds the buttons (and other controls) to the screen in question. -+ */ - public void initGui() { -- this.i.add(new GuiButton(0, this.width / 3 - 83 + 0, this.height / 6 + 96, 100, 20, this.c)); -- this.i.add(new GuiButton(2, this.width / 3 - 83 + 105, this.height / 6 + 96, 100, 20, this.q)); -- this.i.add(new GuiButton(1, this.width / 3 - 83 + 210, this.height / 6 + 96, 100, 20, this.d)); -+ this.buttonList.add(new GuiButton(0, this.width / 3 - 83 + 0, this.height / 6 + 96, 100, 20, this.buttonText1)); -+ this.buttonList.add(new GuiButton(2, this.width / 3 - 83 + 105, this.height / 6 + 96, 100, 20, this.copyLinkButtonText)); -+ this.buttonList.add(new GuiButton(1, this.width / 3 - 83 + 210, this.height / 6 + 96, 100, 20, this.buttonText2)); - } - -- protected void actionPerformed(GuiButton var1) { -- if(var1.id == 2) { -+ /** -+ * Fired when a control is clicked. This is the equivalent of ActionListener.actionPerformed(ActionEvent e). -+ */ -+ protected void actionPerformed(GuiButton par1GuiButton) { -+ if (par1GuiButton.id == 2) { - this.copyLinkToClipboard(); - } -- -- this.parentScreen.confirmClicked(var1.id == 0, this.worldNumber); -- } -- -- public void copyLinkToClipboard() { -- setClipboardString(this.r); -- } -- -- public void drawScreen(int var1, int var2, float var3) { -- super.drawScreen(var1, var2, var3); -- if(this.field_92027_q) { -- this.drawCenteredString(this.fontRenderer, this.p, this.width / 2, 110, 16764108); -+ // Spout Start -+ if (this.parentScreen instanceof GuiChat) { -+ this.parentScreen.confirmClicked(par1GuiButton.id == 0, this.worldNumber); -+ } else if (par1GuiButton.id == 0) { -+ try { -+ Sys.openURL(this.field_92028_p); -+ } catch (Exception e) {} -+ this.mc.displayGuiScreen(null); -+ } else if (par1GuiButton.id == 1) { -+ this.mc.displayGuiScreen(null); - } -- -- } -- -- public void func_92026_h() { -- this.field_92027_q = false; -- } -+ // Spout End -+ } -+ -+/** -+ * Copies the link to the system clipboard. -+ */ -+public void copyLinkToClipboard() { -+ setClipboardString(this.field_92028_p); -+} -+ -+/** -+ * Draws the screen and all the components in it. -+ */ -+public void drawScreen(int par1, int par2, float par3) { -+ super.drawScreen(par1, par2, par3); -+ -+ if (this.field_92027_q) { -+ this.drawCenteredString(this.fontRenderer, this.openLinkWarning, this.width / 2, 110, 16764108); -+ } -+} -+ -+public void func_92026_h() { -+ this.field_92027_q = false; -+} - } ---- net/minecraft/src/TextureMap.java -+++ net/minecraft/src/TextureMap.java -@@ -2,6 +2,9 @@ - - import com.google.common.collect.Lists; - import com.google.common.collect.Maps; -+import com.prupe.mcpatcher.TileLoader; -+import com.prupe.mcpatcher.hd.BorderedTexture; -+import com.prupe.mcpatcher.hd.MipmapHelper; - import java.io.IOException; - import java.util.HashMap; - import java.util.Iterator; -@@ -12,47 +15,51 @@ - public class TextureMap extends AbstractTexture implements TickableTextureObject, IconRegister { - public static final ResourceLocation locationBlocksTexture = new ResourceLocation("textures/atlas/blocks.png"); - public static final ResourceLocation locationItemsTexture = new ResourceLocation("textures/atlas/items.png"); -- private final List d = Lists.newArrayList(); -- private final Map e = Maps.newHashMap(); -- private final Map f = Maps.newHashMap(); -+ public final List listAnimatedSprites = Lists.newArrayList(); -+ private final Map mapRegisteredSprites = Maps.newHashMap(); -+ private final Map mapUploadedSprites = Maps.newHashMap(); -+ -+ /** 0 = terrain.png, 1 = items.png */ - private final int textureType; -- private final String h; -+ private final String basePath; - private final TextureAtlasSprite missingImage = new TextureAtlasSprite("missingno"); - -- public TextureMap(int var1, String var2) { -- this.textureType = var1; -- this.h = var2; -+ public TextureMap(int par1, String par2Str) { -+ this.textureType = par1; -+ this.basePath = par2Str; - this.registerIcons(); - } - - private void initMissingImage() { -- this.missingImage.setFramesTextureData(Lists.newArrayList((Object[])(new int[][]{TextureUtil.missingTextureData}))); -+ this.missingImage.setFramesTextureData(Lists.newArrayList(new int[][] {TextureUtil.missingTextureData})); - this.missingImage.setIconWidth(16); - this.missingImage.setIconHeight(16); - } - -- public void loadTexture(ResourceManager var1) throws IOException { -+ public void loadTexture(ResourceManager par1ResourceManager) throws IOException { - this.initMissingImage(); -- this.loadTextureAtlas(var1); -+ this.loadTextureAtlas(par1ResourceManager); - } - -- public void loadTextureAtlas(ResourceManager var1) { -+ public void loadTextureAtlas(ResourceManager par1ResourceManager) { - int var2 = Minecraft.getGLMaximumTextureSize(); - Stitcher var3 = new Stitcher(var2, var2, true); -- this.f.clear(); -- this.d.clear(); -- Iterator var4 = this.e.entrySet().iterator(); -+ this.mapUploadedSprites.clear(); -+ this.listAnimatedSprites.clear(); -+ this.registerIcons(); -+ TileLoader.registerIcons(this, this.basePath, this.mapRegisteredSprites); -+ Iterator var4 = this.mapRegisteredSprites.entrySet().iterator(); - -- while(var4.hasNext()) { -+ while (var4.hasNext()) { - Entry var5 = (Entry)var4.next(); - ResourceLocation var6 = new ResourceLocation((String)var5.getKey()); - TextureAtlasSprite var7 = (TextureAtlasSprite)var5.getValue(); -- ResourceLocation var8 = new ResourceLocation(var6.getResourceDomain(), String.format("%s/%s%s", new Object[]{this.h, var6.getResourcePath(), ".png"})); -+ ResourceLocation var8 = new ResourceLocation(var6.getResourceDomain(), TileLoader.getOverridePath(this.basePath, var6.getResourcePath(), ".png")); - - try { -- var7.loadSprite(var1.getResource(var8)); -+ var7.loadSprite(par1ResourceManager.getResource(var8)); - } catch (RuntimeException var13) { -- Minecraft.getMinecraft().getLogAgent().logSevere(String.format("Unable to parse animation metadata from %s: %s", new Object[]{var8, var13.getMessage()})); -+ Minecraft.getMinecraft().getLogAgent().logSevere(String.format("Unable to parse animation metadata from %s: %s", new Object[] {var8, var13.getMessage()})); - continue; - } catch (IOException var14) { - Minecraft.getMinecraft().getLogAgent().logSevere("Using missing texture, unable to load: " + var8); -@@ -70,29 +77,36 @@ - throw var12; - } - -- TextureUtil.allocateTexture(this.getGlTextureId(), var3.getCurrentWidth(), var3.getCurrentHeight()); -- HashMap var15 = Maps.newHashMap(this.e); -+ MipmapHelper.setupTexture(this.getGlTextureId(), var3.getCurrentWidth(), var3.getCurrentHeight(), this.basePath); -+ HashMap var15 = Maps.newHashMap(this.mapRegisteredSprites); - Iterator var16 = var3.getStichSlots().iterator(); -- - TextureAtlasSprite var17; -- while(var16.hasNext()) { -+ -+ while (var16.hasNext()) { - var17 = (TextureAtlasSprite)var16.next(); - String var18 = var17.getIconName(); - var15.remove(var18); -- this.f.put(var18, var17); -+ this.mapUploadedSprites.put(var18, var17); - - try { -- TextureUtil.uploadTextureSub(var17.getFrameTextureData(0), var17.getIconWidth(), var17.getIconHeight(), var17.getOriginX(), var17.getOriginY(), false, false); -+ int[] var10000 = var17.getFrameTextureData(0); -+ int var10001 = var17.getIconWidth(); -+ int var10002 = var17.getIconHeight(); -+ int var10003 = var17.getOriginX(); -+ int var10004 = var17.getOriginY(); -+ boolean var10005 = false; -+ boolean var10006 = false; -+ MipmapHelper.copySubTexture(var10000, var10001, var10002, var10003, var10004, this.basePath); - } catch (Throwable var11) { - CrashReport var9 = CrashReport.makeCrashReport(var11, "Stitching texture atlas"); - CrashReportCategory var10 = var9.makeCategory("Texture being stitched together"); -- var10.addCrashSection("Atlas path", this.h); -+ var10.addCrashSection("Atlas path", this.basePath); - var10.addCrashSection("Sprite", var17); - throw new ReportedException(var9); - } - -- if(var17.hasAnimationMetadata()) { -- this.d.add(var17); -+ if (var17.hasAnimationMetadata()) { -+ this.listAnimatedSprites.add(var17); - } else { - var17.clearFramesTextureData(); - } -@@ -100,24 +114,25 @@ - - var16 = var15.values().iterator(); - -- while(var16.hasNext()) { -+ while (var16.hasNext()) { - var17 = (TextureAtlasSprite)var16.next(); - var17.copyFrom(this.missingImage); - } -- - } - - private void registerIcons() { -- this.e.clear(); -+ this.mapRegisteredSprites.clear(); - int var2; - int var3; -- if(this.textureType == 0) { -+ -+ if (this.textureType == 0) { - Block[] var1 = Block.blocksList; - var2 = var1.length; - -- for(var3 = 0; var3 < var2; ++var3) { -+ for (var3 = 0; var3 < var2; ++var3) { - Block var4 = var1[var3]; -- if(var4 != null) { -+ -+ if (var4 != null) { - var4.registerIcons(this); - } - } -@@ -129,18 +144,19 @@ - Item[] var5 = Item.itemsList; - var2 = var5.length; - -- for(var3 = 0; var3 < var2; ++var3) { -+ for (var3 = 0; var3 < var2; ++var3) { - Item var6 = var5[var3]; -- if(var6 != null && var6.getSpriteNumber() == this.textureType) { -+ -+ if (var6 != null && var6.getSpriteNumber() == this.textureType) { - var6.registerIcons(this); - } - } -- - } - -- public TextureAtlasSprite getAtlasSprite(String var1) { -- TextureAtlasSprite var2 = (TextureAtlasSprite)this.f.get(var1); -- if(var2 == null) { -+ public TextureAtlasSprite getAtlasSprite(String par1Str) { -+ TextureAtlasSprite var2 = (TextureAtlasSprite)this.mapUploadedSprites.get(par1Str); -+ -+ if (var2 == null) { - var2 = this.missingImage; - } - -@@ -149,35 +165,35 @@ - - public void updateAnimations() { - TextureUtil.bindTexture(this.getGlTextureId()); -- Iterator var1 = this.d.iterator(); -+ Iterator var1 = this.listAnimatedSprites.iterator(); - -- while(var1.hasNext()) { -+ while (var1.hasNext()) { - TextureAtlasSprite var2 = (TextureAtlasSprite)var1.next(); - var2.updateAnimation(); - } -- - } - -- public Icon registerIcon(String var1) { -- if(var1 == null) { -+ public Icon registerIcon(String par1Str) { -+ if (par1Str == null) { - (new RuntimeException("Don\'t register null!")).printStackTrace(); - } - -- Object var2 = (TextureAtlasSprite)this.e.get(var1); -- if(var2 == null) { -- if(this.textureType == 1) { -- if("clock".equals(var1)) { -- var2 = new TextureClock(var1); -- } else if("compass".equals(var1)) { -- var2 = new TextureCompass(var1); -+ Object var2 = (TextureAtlasSprite)this.mapRegisteredSprites.get(par1Str); -+ -+ if (var2 == null) { -+ if (this.textureType == 1) { -+ if (TileLoader.isSpecialTexture(this, par1Str, "clock")) { -+ var2 = new TextureClock(par1Str); -+ } else if (TileLoader.isSpecialTexture(this, par1Str, "compass")) { -+ var2 = new TextureCompass(par1Str); - } else { -- var2 = new TextureAtlasSprite(var1); -+ var2 = BorderedTexture.create(this.basePath, par1Str); - } - } else { -- var2 = new TextureAtlasSprite(var1); -+ var2 = BorderedTexture.create(this.basePath, par1Str); - } - -- this.e.put(var1, var2); -+ this.mapRegisteredSprites.put(par1Str, var2); - } - - return (Icon)var2; ---- /dev/null -+++ org/spoutcraft/client/gui/settings/controls/SignDistanceButton.java -@@ -1,0 +1,45 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.client.gui.settings.controls; -+ -+import org.spoutcraft.client.config.Configuration; -+ -+public class SignDistanceButton extends AutomatedButton { -+ public SignDistanceButton() { -+ setTooltip("The distance from which you can see the text on a sign\nFarther distances can decrease FPS."); -+ } -+ -+ @Override -+ public String getText() { -+ return "Sign Distance: " + (Configuration.getSignDistance() != Integer.MAX_VALUE ? Configuration.getSignDistance() : "Infinite"); -+ } -+ -+ @Override -+ public void onButtonClick() { -+ if (Configuration.getSignDistance() < 128) { -+ Configuration.setSignDistance(Configuration.getSignDistance() * 2); -+ } else if (Configuration.getSignDistance() == 128) { -+ Configuration.setSignDistance(Integer.MAX_VALUE); -+ } else { -+ Configuration.setSignDistance(8); -+ } -+ Configuration.write(); -+ } -+} ---- net/minecraft/src/CommandClearInventory.java -+++ net/minecraft/src/CommandClearInventory.java -@@ -8,40 +8,53 @@ - return "clear"; - } - -- public String getCommandUsage(ICommandSender var1) { -+ public String getCommandUsage(ICommandSender par1ICommandSender) { - return "commands.clear.usage"; - } - -+ /** -+ * Return the required permission level for this command. -+ */ - public int getRequiredPermissionLevel() { - return 2; - } - -- public void processCommand(ICommandSender var1, String[] var2) { -- EntityPlayerMP var3 = var2.length == 0 ? getCommandSenderAsPlayer(var1) : getPlayer(var1, var2[0]); -- int var4 = var2.length >= 2 ? parseIntWithMin(var1, var2[1], 1) : -1; -- int var5 = var2.length >= 3 ? parseIntWithMin(var1, var2[2], 0) : -1; -+ public void processCommand(ICommandSender par1ICommandSender, String[] par2ArrayOfStr) { -+ EntityPlayerMP var3 = par2ArrayOfStr.length == 0 ? getCommandSenderAsPlayer(par1ICommandSender) : getPlayer(par1ICommandSender, par2ArrayOfStr[0]); -+ int var4 = par2ArrayOfStr.length >= 2 ? parseIntWithMin(par1ICommandSender, par2ArrayOfStr[1], 1) : -1; -+ int var5 = par2ArrayOfStr.length >= 3 ? parseIntWithMin(par1ICommandSender, par2ArrayOfStr[2], 0) : -1; - int var6 = var3.inventory.clearInventory(var4, var5); - var3.inventoryContainer.detectAndSendChanges(); -- if(!var3.capabilities.isCreativeMode) { -+ -+ if (!var3.capabilities.isCreativeMode) { - var3.updateHeldItem(); - } - -- if(var6 == 0) { -- throw new CommandException("commands.clear.failure", new Object[]{var3.getEntityName()}); -+ if (var6 == 0) { -+ throw new CommandException("commands.clear.failure", new Object[] {var3.getEntityName()}); - } else { -- notifyAdmins(var1, "commands.clear.success", new Object[]{var3.getEntityName(), Integer.valueOf(var6)}); -+ notifyAdmins(par1ICommandSender, "commands.clear.success", new Object[] {var3.getEntityName(), Integer.valueOf(var6)}); - } - } - -- public List addTabCompletionOptions(ICommandSender var1, String[] var2) { -- return var2.length == 1 ? getListOfStringsMatchingLastWord(var2, this.getAllOnlineUsernames()) : null; -+ /** -+ * Adds the strings available in this command to the given list of tab completion options. -+ */ -+ public List addTabCompletionOptions(ICommandSender par1ICommandSender, String[] par2ArrayOfStr) { -+ return par2ArrayOfStr.length == 1 ? getListOfStringsMatchingLastWord(par2ArrayOfStr, this.getAllOnlineUsernames()) : null; - } - -+ /** -+ * Return all usernames currently connected to the server. -+ */ - protected String[] getAllOnlineUsernames() { - return MinecraftServer.getServer().getAllUsernames(); - } - -- public boolean isUsernameIndex(String[] var1, int var2) { -- return var2 == 0; -+ /** -+ * Return whether the specified command parameter index is a username parameter. -+ */ -+ public boolean isUsernameIndex(String[] par1ArrayOfStr, int par2) { -+ return par2 == 0; - } - } ---- net/minecraft/src/ItemSimpleFoiled.java -+++ net/minecraft/src/ItemSimpleFoiled.java -@@ -1,11 +1,11 @@ - package net.minecraft.src; - - public class ItemSimpleFoiled extends Item { -- public ItemSimpleFoiled(int var1) { -- super(var1); -+ public ItemSimpleFoiled(int par1) { -+ super(par1); - } - -- public boolean hasEffect(ItemStack var1) { -+ public boolean hasEffect(ItemStack par1ItemStack) { - return true; - } - } ---- net/minecraft/src/EntityAuraFX.java -+++ net/minecraft/src/EntityAuraFX.java -@@ -1,22 +1,30 @@ - package net.minecraft.src; - -+// MCPatcher Start -+import com.prupe.mcpatcher.cc.ColorizeEntity; -+import com.prupe.mcpatcher.cc.Colorizer; -+// MCPatcher End -+ - public class EntityAuraFX extends EntityFX { -- public EntityAuraFX(World var1, double var2, double var4, double var6, double var8, double var10, double var12) { -- super(var1, var2, var4, var6, var8, var10, var12); -- float var14 = this.ab.nextFloat() * 0.1F + 0.2F; -+ public EntityAuraFX(World par1World, double par2, double par4, double par6, double par8, double par10, double par12) { -+ super(par1World, par2, par4, par6, par8, par10, par12); -+ float var14 = this.rand.nextFloat() * 0.1F + 0.2F; - this.particleRed = var14; - this.particleGreen = var14; - this.particleBlue = var14; - this.setParticleTextureIndex(0); - this.setSize(0.02F, 0.02F); -- this.particleScale *= this.ab.nextFloat() * 0.6F + 0.5F; -- this.motionX *= (double)0.02F; -- this.motionY *= (double)0.02F; -- this.motionZ *= (double)0.02F; -+ this.particleScale *= this.rand.nextFloat() * 0.6F + 0.5F; -+ this.motionX *= 0.019999999552965164D; -+ this.motionY *= 0.019999999552965164D; -+ this.motionZ *= 0.019999999552965164D; - this.particleMaxAge = (int)(20.0D / (Math.random() * 0.8D + 0.2D)); - this.noClip = true; - } - -+ /** -+ * Called to update the entity's position/logic. -+ */ - public void onUpdate() { - this.prevPosX = this.posX; - this.prevPosY = this.posY; -@@ -25,9 +33,21 @@ - this.motionX *= 0.99D; - this.motionY *= 0.99D; - this.motionZ *= 0.99D; -- if(this.particleMaxAge-- <= 0) { -+ -+ if (this.particleMaxAge-- <= 0) { - this.setDead(); - } -- -- } -+ } -+ -+ // MCPatcher Start -+ public EntityAuraFX colorize() { -+ if (ColorizeEntity.computeMyceliumParticleColor()) { -+ this.particleRed = Colorizer.setColor[0]; -+ this.particleGreen = Colorizer.setColor[1]; -+ this.particleBlue = Colorizer.setColor[2]; -+ } -+ -+ return this; -+ } -+ // MCPatcher End - } ---- net/minecraft/src/EntityPig.java -+++ net/minecraft/src/EntityPig.java -@@ -1,10 +1,12 @@ - package net.minecraft.src; - - public class EntityPig extends EntityAnimal { -+ -+ /** AI task for player control. */ - private final EntityAIControlledByPlayer aiControlledByPlayer; - -- public EntityPig(World var1) { -- super(var1); -+ public EntityPig(World par1World) { -+ super(par1World); - this.setSize(0.9F, 0.9F); - this.getNavigator().setAvoidsWater(true); - this.tasks.addTask(0, new EntityAISwimming(this)); -@@ -19,6 +21,9 @@ - this.tasks.addTask(8, new EntityAILookIdle(this)); - } - -+ /** -+ * Returns true if the newer Entity AI code should be run -+ */ - public boolean isAIEnabled() { - return true; - } -@@ -33,6 +38,10 @@ - super.updateAITasks(); - } - -+ /** -+ * returns true if all the conditions for steering the entity are met. For pigs, this is true if it is being ridden by -+ * a player and the player is holding a carrot-on-a-stick -+ */ - public boolean canBeSteered() { - ItemStack var1 = ((EntityPlayer)this.riddenByEntity).getHeldItem(); - return var1 != null && var1.itemID == Item.carrotOnAStick.itemID; -@@ -43,79 +52,114 @@ - this.dataWatcher.addObject(16, Byte.valueOf((byte)0)); - } - -- public void writeEntityToNBT(NBTTagCompound var1) { -- super.writeEntityToNBT(var1); -- var1.setBoolean("Saddle", this.getSaddled()); -- } -- -- public void readEntityFromNBT(NBTTagCompound var1) { -- super.readEntityFromNBT(var1); -- this.setSaddled(var1.getBoolean("Saddle")); -- } -- -+ /** -+ * (abstract) Protected helper method to write subclass entity data to NBT. -+ */ -+ public void writeEntityToNBT(NBTTagCompound par1NBTTagCompound) { -+ super.writeEntityToNBT(par1NBTTagCompound); -+ par1NBTTagCompound.setBoolean("Saddle", this.getSaddled()); -+ } -+ -+ /** -+ * (abstract) Protected helper method to read subclass entity data from NBT. -+ */ -+ public void readEntityFromNBT(NBTTagCompound par1NBTTagCompound) { -+ super.readEntityFromNBT(par1NBTTagCompound); -+ this.setSaddled(par1NBTTagCompound.getBoolean("Saddle")); -+ } -+ -+ /** -+ * Returns the sound this mob makes while it's alive. -+ */ - protected String getLivingSound() { - return "mob.pig.say"; - } - -+ /** -+ * Returns the sound this mob makes when it is hurt. -+ */ - protected String getHurtSound() { - return "mob.pig.say"; - } - -+ /** -+ * Returns the sound this mob makes on death. -+ */ - protected String getDeathSound() { - return "mob.pig.death"; - } - -- protected void playStepSound(int var1, int var2, int var3, int var4) { -+ /** -+ * Plays step sound at given x, y, z for the entity -+ */ -+ protected void playStepSound(int par1, int par2, int par3, int par4) { - this.playSound("mob.pig.step", 0.15F, 1.0F); - } - -- public boolean interact(EntityPlayer var1) { -- if(super.interact(var1)) { -- return true; -- } else if(!this.getSaddled() || this.worldObj.isRemote || this.riddenByEntity != null && this.riddenByEntity != var1) { -+ /** -+ * Called when a player interacts with a mob. e.g. gets milk from a cow, gets into the saddle on a pig. -+ */ -+ public boolean interact(EntityPlayer par1EntityPlayer) { -+ if (super.interact(par1EntityPlayer)) { -+ return true; -+ } else if (this.getSaddled() && !this.worldObj.isRemote && (this.riddenByEntity == null || this.riddenByEntity == par1EntityPlayer)) { -+ par1EntityPlayer.mountEntity(this); -+ return true; -+ } else { - return false; -- } else { -- var1.mountEntity(this); -- return true; - } - } - -+ /** -+ * Returns the item ID for the item the mob drops on death. -+ */ - protected int getDropItemId() { - return this.isBurning() ? Item.porkCooked.itemID : Item.porkRaw.itemID; - } - -- protected void dropFewItems(boolean var1, int var2) { -- int var3 = this.ab.nextInt(3) + 1 + this.ab.nextInt(1 + var2); -+ /** -+ * Drop 0-2 items of this living's type. @param par1 - Whether this entity has recently been hit by a player. @param -+ * par2 - Level of Looting used to kill this mob. -+ */ -+ protected void dropFewItems(boolean par1, int par2) { -+ int var3 = this.rand.nextInt(3) + 1 + this.rand.nextInt(1 + par2); - -- for(int var4 = 0; var4 < var3; ++var4) { -- if(this.isBurning()) { -+ for (int var4 = 0; var4 < var3; ++var4) { -+ if (this.isBurning()) { - this.dropItem(Item.porkCooked.itemID, 1); - } else { - this.dropItem(Item.porkRaw.itemID, 1); - } - } - -- if(this.getSaddled()) { -+ if (this.getSaddled()) { - this.dropItem(Item.saddle.itemID, 1); - } -- - } - -+ /** -+ * Returns true if the pig is saddled. -+ */ - public boolean getSaddled() { - return (this.dataWatcher.getWatchableObjectByte(16) & 1) != 0; - } - -- public void setSaddled(boolean var1) { -- if(var1) { -+ /** -+ * Set or remove the saddle of the pig. -+ */ -+ public void setSaddled(boolean par1) { -+ if (par1) { - this.dataWatcher.updateObject(16, Byte.valueOf((byte)1)); - } else { - this.dataWatcher.updateObject(16, Byte.valueOf((byte)0)); - } -- - } - -- public void onStruckByLightning(EntityLightningBolt var1) { -- if(!this.worldObj.isRemote) { -+ /** -+ * Called when a lightning bolt hits the entity. -+ */ -+ public void onStruckByLightning(EntityLightningBolt par1EntityLightningBolt) { -+ if (!this.worldObj.isRemote) { - EntityPigZombie var2 = new EntityPigZombie(this.worldObj); - var2.setLocationAndAngles(this.posX, this.posY, this.posZ, this.rotationYaw, this.rotationPitch); - this.worldObj.spawnEntityInWorld(var2); -@@ -123,27 +167,40 @@ - } - } - -- protected void fall(float var1) { -- super.fall(var1); -- if(var1 > 5.0F && this.riddenByEntity instanceof EntityPlayer) { -+ /** -+ * Called when the mob is falling. Calculates and applies fall damage. -+ */ -+ protected void fall(float par1) { -+ super.fall(par1); -+ -+ if (par1 > 5.0F && this.riddenByEntity instanceof EntityPlayer) { - ((EntityPlayer)this.riddenByEntity).triggerAchievement(AchievementList.flyPig); - } -- - } - -- public EntityPig spawnBabyAnimal(EntityAgeable var1) { -+ /** -+ * This function is used when two same-species animals in 'love mode' breed to generate the new baby animal. -+ */ -+ public EntityPig spawnBabyAnimal(EntityAgeable par1EntityAgeable) { - return new EntityPig(this.worldObj); - } - -- public boolean isBreedingItem(ItemStack var1) { -- return var1 != null && var1.itemID == Item.carrot.itemID; -+ /** -+ * Checks if the parameter is an item which this animal can be fed to breed it (wheat, carrots or seeds depending on -+ * the animal type) -+ */ -+ public boolean isBreedingItem(ItemStack par1ItemStack) { -+ return par1ItemStack != null && par1ItemStack.itemID == Item.carrot.itemID; - } - -+ /** -+ * Return the AI task for player control. -+ */ - public EntityAIControlledByPlayer getAIControlledByPlayer() { - return this.aiControlledByPlayer; - } - -- public EntityAgeable createChild(EntityAgeable var1) { -- return this.spawnBabyAnimal(var1); -+ public EntityAgeable createChild(EntityAgeable par1EntityAgeable) { -+ return this.spawnBabyAnimal(par1EntityAgeable); - } - } ---- net/minecraft/src/BlockSnow.java -+++ net/minecraft/src/BlockSnow.java -@@ -3,90 +3,140 @@ - import java.util.Random; - - public class BlockSnow extends Block { -- protected BlockSnow(int var1) { -- super(var1, Material.snow); -- this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 2.0F / 16.0F, 1.0F); -+ protected BlockSnow(int par1) { -+ super(par1, Material.snow); -+ this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.125F, 1.0F); - this.setTickRandomly(true); - this.setCreativeTab(CreativeTabs.tabDecorations); - this.setBlockBoundsForSnowDepth(0); - } - -- public void registerIcons(IconRegister var1) { -- this.blockIcon = var1.registerIcon("snow"); -- } -- -- public AxisAlignedBB getCollisionBoundingBoxFromPool(World var1, int var2, int var3, int var4) { -- int var5 = var1.getBlockMetadata(var2, var3, var4) & 7; -- float var6 = 2.0F / 16.0F; -- return AxisAlignedBB.getAABBPool().getAABB((double)var2 + this.minX, (double)var3 + this.minY, (double)var4 + this.minZ, (double)var2 + this.maxX, (double)((float)var3 + (float)var5 * var6), (double)var4 + this.maxZ); -- } -- -+ /** -+ * When this method is called, your block should register all the icons it needs with the given IconRegister. This is -+ * the only chance you get to register icons. -+ */ -+ public void registerIcons(IconRegister par1IconRegister) { -+ this.blockIcon = par1IconRegister.registerIcon("snow"); -+ } -+ -+ /** -+ * Returns a bounding box from the pool of bounding boxes (this means this box can change after the pool has been -+ * cleared to be reused) -+ */ -+ public AxisAlignedBB getCollisionBoundingBoxFromPool(World par1World, int par2, int par3, int par4) { -+ int var5 = par1World.getBlockMetadata(par2, par3, par4) & 7; -+ float var6 = 0.125F; -+ return AxisAlignedBB.getAABBPool().getAABB((double)par2 + this.minX, (double)par3 + this.minY, (double)par4 + this.minZ, (double)par2 + this.maxX, (double)((float)par3 + (float)var5 * var6), (double)par4 + this.maxZ); -+ } -+ -+ /** -+ * Is this block (a) opaque and (b) a full 1m cube? This determines whether or not to render the shared face of two -+ * adjacent blocks and also whether the player can attach torches, redstone wire, etc to this block. -+ */ - public boolean isOpaqueCube() { - return false; - } - -+ /** -+ * If this block doesn't render as an ordinary block it will return False (examples: signs, buttons, stairs, etc) -+ */ - public boolean renderAsNormalBlock() { - return false; - } - -+ /** -+ * Sets the block's bounds for rendering it as an item -+ */ - public void setBlockBoundsForItemRender() { - this.setBlockBoundsForSnowDepth(0); - } - -- public void setBlockBoundsBasedOnState(IBlockAccess var1, int var2, int var3, int var4) { -- this.setBlockBoundsForSnowDepth(var1.getBlockMetadata(var2, var3, var4)); -+ /** -+ * Updates the blocks bounds based on its current state. Args: world, x, y, z -+ */ -+ public void setBlockBoundsBasedOnState(IBlockAccess par1IBlockAccess, int par2, int par3, int par4) { -+ this.setBlockBoundsForSnowDepth(par1IBlockAccess.getBlockMetadata(par2, par3, par4)); - } - -- protected void setBlockBoundsForSnowDepth(int var1) { -- int var2 = var1 & 7; -+ /** -+ * calls setBlockBounds based on the depth of the snow. Int is any values 0x0-0x7, usually this blocks metadata. -+ */ -+ protected void setBlockBoundsForSnowDepth(int par1) { -+ int var2 = par1 & 7; - float var3 = (float)(2 * (1 + var2)) / 16.0F; - this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, var3, 1.0F); - } - -- public boolean canPlaceBlockAt(World var1, int var2, int var3, int var4) { -- int var5 = var1.getBlockId(var2, var3 - 1, var4); -- return var5 == 0 ? false : (var5 == this.blockID && (var1.getBlockMetadata(var2, var3 - 1, var4) & 7) == 7 ? true : (var5 != Block.leaves.blockID && !Block.blocksList[var5].isOpaqueCube() ? false : var1.getBlockMaterial(var2, var3 - 1, var4).blocksMovement())); -- } -- -- public void onNeighborBlockChange(World var1, int var2, int var3, int var4, int var5) { -- this.canSnowStay(var1, var2, var3, var4); -- } -- -- private boolean canSnowStay(World var1, int var2, int var3, int var4) { -- if(!this.canPlaceBlockAt(var1, var2, var3, var4)) { -- this.dropBlockAsItem(var1, var2, var3, var4, var1.getBlockMetadata(var2, var3, var4), 0); -- var1.setBlockToAir(var2, var3, var4); -+ /** -+ * Checks to see if its valid to put this block at the specified coordinates. Args: world, x, y, z -+ */ -+ public boolean canPlaceBlockAt(World par1World, int par2, int par3, int par4) { -+ int var5 = par1World.getBlockId(par2, par3 - 1, par4); -+ return var5 == 0 ? false : (var5 == this.blockID && (par1World.getBlockMetadata(par2, par3 - 1, par4) & 7) == 7 ? true : (var5 != Block.leaves.blockID && !Block.blocksList[var5].isOpaqueCube() ? false : par1World.getBlockMaterial(par2, par3 - 1, par4).blocksMovement())); -+ } -+ -+ /** -+ * Lets the block know when one of its neighbor changes. Doesn't know which neighbor changed (coordinates passed are -+ * their own) Args: x, y, z, neighbor blockID -+ */ -+ public void onNeighborBlockChange(World par1World, int par2, int par3, int par4, int par5) { -+ this.canSnowStay(par1World, par2, par3, par4); -+ } -+ -+ /** -+ * Checks if this snow block can stay at this location. -+ */ -+ private boolean canSnowStay(World par1World, int par2, int par3, int par4) { -+ if (!this.canPlaceBlockAt(par1World, par2, par3, par4)) { -+ this.dropBlockAsItem(par1World, par2, par3, par4, par1World.getBlockMetadata(par2, par3, par4), 0); -+ par1World.setBlockToAir(par2, par3, par4); - return false; - } else { - return true; - } - } - -- public void harvestBlock(World var1, EntityPlayer var2, int var3, int var4, int var5, int var6) { -+ /** -+ * Called when the player destroys a block with an item that can harvest it. (i, j, k) are the coordinates of the block -+ * and l is the block's subtype/damage. -+ */ -+ public void harvestBlock(World par1World, EntityPlayer par2EntityPlayer, int par3, int par4, int par5, int par6) { - int var7 = Item.snowball.itemID; -- int var8 = var6 & 7; -- this.dropBlockAsItem_do(var1, var3, var4, var5, new ItemStack(var7, var8 + 1, 0)); -- var1.setBlockToAir(var3, var4, var5); -- var2.addStat(StatList.mineBlockStatArray[this.blockID], 1); -+ int var8 = par6 & 7; -+ this.dropBlockAsItem_do(par1World, par3, par4, par5, new ItemStack(var7, var8 + 1, 0)); -+ par1World.setBlockToAir(par3, par4, par5); -+ par2EntityPlayer.addStat(StatList.mineBlockStatArray[this.blockID], 1); - } - -- public int idDropped(int var1, Random var2, int var3) { -+ /** -+ * Returns the ID of the items to drop on destruction. -+ */ -+ public int idDropped(int par1, Random par2Random, int par3) { - return Item.snowball.itemID; - } - -- public int quantityDropped(Random var1) { -+ /** -+ * Returns the quantity of items to drop on block destruction. -+ */ -+ public int quantityDropped(Random par1Random) { - return 0; - } - -- public void updateTick(World var1, int var2, int var3, int var4, Random var5) { -- if(var1.getSavedLightValue(EnumSkyBlock.Block, var2, var3, var4) > 11) { -- this.dropBlockAsItem(var1, var2, var3, var4, var1.getBlockMetadata(var2, var3, var4), 0); -- var1.setBlockToAir(var2, var3, var4); -+ /** -+ * Ticks the block if it's been scheduled -+ */ -+ public void updateTick(World par1World, int par2, int par3, int par4, Random par5Random) { -+ if (par1World.getSavedLightValue(EnumSkyBlock.Block, par2, par3, par4) > 11) { -+ this.dropBlockAsItem(par1World, par2, par3, par4, par1World.getBlockMetadata(par2, par3, par4), 0); -+ par1World.setBlockToAir(par2, par3, par4); - } -- - } - -- public boolean shouldSideBeRendered(IBlockAccess var1, int var2, int var3, int var4, int var5) { -- return var5 == 1 ? true : super.shouldSideBeRendered(var1, var2, var3, var4, var5); -+ /** -+ * Returns true if the given side of this block type should be rendered, if the adjacent block is at the given -+ * coordinates. Args: blockAccess, x, y, z, side -+ */ -+ public boolean shouldSideBeRendered(IBlockAccess par1IBlockAccess, int par2, int par3, int par4, int par5) { -+ return par5 == 1 ? true : super.shouldSideBeRendered(par1IBlockAccess, par2, par3, par4, par5); - } - } ---- net/minecraft/src/FallbackResourceManager.java -+++ net/minecraft/src/FallbackResourceManager.java -@@ -10,65 +10,68 @@ - import java.util.Set; - - public class FallbackResourceManager implements ResourceManager { -- protected final List a = new ArrayList(); -+ public final List resourcePacks = new ArrayList(); - private final MetadataSerializer frmMetadataSerializer; - -- public FallbackResourceManager(MetadataSerializer var1) { -- this.frmMetadataSerializer = var1; -+ public FallbackResourceManager(MetadataSerializer par1MetadataSerializer) { -+ this.frmMetadataSerializer = par1MetadataSerializer; - } - -- public void addResourcePack(ResourcePack var1) { -- this.a.add(var1); -+ public void addResourcePack(ResourcePack par1ResourcePack) { -+ this.resourcePacks.add(par1ResourcePack); - } - - public Set getResourceDomains() { - return null; - } - -- public Resource getResource(ResourceLocation var1) throws IOException { -+ public Resource getResource(ResourceLocation par1ResourceLocation) throws IOException { - ResourcePack var2 = null; -- ResourceLocation var3 = getLocationMcmeta(var1); -- -- for(int var4 = this.a.size() - 1; var4 >= 0; --var4) { -- ResourcePack var5 = (ResourcePack)this.a.get(var4); -- if(var2 == null && var5.resourceExists(var3)) { -+ ResourceLocation var3 = getLocationMcmeta(par1ResourceLocation); -+ -+ for (int var4 = this.resourcePacks.size() - 1; var4 >= 0; --var4) { -+ ResourcePack var5 = (ResourcePack)this.resourcePacks.get(var4); -+ -+ if (var2 == null && var5.resourceExists(var3)) { - var2 = var5; - } - -- if(var5.resourceExists(var1)) { -+ if (var5.resourceExists(par1ResourceLocation)) { - InputStream var6 = null; -- if(var2 != null) { -+ -+ if (var2 != null) { - var6 = var2.getInputStream(var3); - } - -- return new SimpleResource(var1, var5.getInputStream(var1), var6, this.frmMetadataSerializer); -+ return new SimpleResource(par1ResourceLocation, var5.getInputStream(par1ResourceLocation), var6, this.frmMetadataSerializer); - } - } - -- throw new FileNotFoundException(var1.toString()); -+ throw new FileNotFoundException(par1ResourceLocation.toString()); - } - -- public List getAllResources(ResourceLocation var1) throws IOException { -+ public List getAllResources(ResourceLocation par1ResourceLocation) throws IOException { - ArrayList var2 = Lists.newArrayList(); -- ResourceLocation var3 = getLocationMcmeta(var1); -- Iterator var4 = this.a.iterator(); -+ ResourceLocation var3 = getLocationMcmeta(par1ResourceLocation); -+ Iterator var4 = this.resourcePacks.iterator(); - -- while(var4.hasNext()) { -+ while (var4.hasNext()) { - ResourcePack var5 = (ResourcePack)var4.next(); -- if(var5.resourceExists(var1)) { -+ -+ if (var5.resourceExists(par1ResourceLocation)) { - InputStream var6 = var5.resourceExists(var3) ? var5.getInputStream(var3) : null; -- var2.add(new SimpleResource(var1, var5.getInputStream(var1), var6, this.frmMetadataSerializer)); -+ var2.add(new SimpleResource(par1ResourceLocation, var5.getInputStream(par1ResourceLocation), var6, this.frmMetadataSerializer)); - } - } - -- if(var2.isEmpty()) { -- throw new FileNotFoundException(var1.toString()); -+ if (var2.isEmpty()) { -+ throw new FileNotFoundException(par1ResourceLocation.toString()); - } else { - return var2; - } - } - -- static ResourceLocation getLocationMcmeta(ResourceLocation var0) { -- return new ResourceLocation(var0.getResourceDomain(), var0.getResourcePath() + ".mcmeta"); -+ static ResourceLocation getLocationMcmeta(ResourceLocation par0ResourceLocation) { -+ return new ResourceLocation(par0ResourceLocation.getResourceDomain(), par0ResourceLocation.getResourcePath() + ".mcmeta"); - } - } ---- net/minecraft/src/EntityRenderer.java -+++ net/minecraft/src/EntityRenderer.java -@@ -3,83 +3,184 @@ - import java.nio.FloatBuffer; - import java.util.List; - import java.util.Random; -+ - import org.lwjgl.input.Mouse; - import org.lwjgl.opengl.Display; - import org.lwjgl.opengl.GL11; - import org.lwjgl.opengl.GLContext; --import org.lwjgl.opengl.NVFogDistance; --import org.lwjgl.util.glu.Project; -- -+import org.lwjgl.util.glu.GLU; -+import org.lwjgl.util.vector.*; -+ -+import com.prupe.mcpatcher.cc.ColorizeWorld; -+import com.prupe.mcpatcher.cc.Colorizer; -+import com.prupe.mcpatcher.cc.Lightmap; -+import com.prupe.mcpatcher.ctm.RenderPass; -+ -+import org.spoutcraft.client.config.Configuration; -+import org.spoutcraft.client.spoutworth.SpoutWorth; - public class EntityRenderer { - private static final ResourceLocation locationRainPng = new ResourceLocation("textures/environment/rain.png"); - private static final ResourceLocation locationSnowPng = new ResourceLocation("textures/environment/snow.png"); - public static boolean anaglyphEnable; -+ -+ /** Anaglyph field (0=R, 1=GB) */ - public static int anaglyphField; -+ -+ /** A reference to the Minecraft object. */ - private Minecraft mc; - private float farPlaneDistance; - public ItemRenderer itemRenderer; -+ -+ /** Entity renderer update count */ - private int rendererUpdateCount; -+ -+ /** Pointed entity */ - private Entity pointedEntity; - private MouseFilter mouseFilterXAxis = new MouseFilter(); - private MouseFilter mouseFilterYAxis = new MouseFilter(); -+ -+ /** Mouse filter dummy 1 */ - private MouseFilter mouseFilterDummy1 = new MouseFilter(); -+ -+ /** Mouse filter dummy 2 */ - private MouseFilter mouseFilterDummy2 = new MouseFilter(); -+ -+ /** Mouse filter dummy 3 */ - private MouseFilter mouseFilterDummy3 = new MouseFilter(); -+ -+ /** Mouse filter dummy 4 */ - private MouseFilter mouseFilterDummy4 = new MouseFilter(); - private float thirdPersonDistance = 4.0F; -+ -+ /** Third person distance temp */ - private float thirdPersonDistanceTemp = 4.0F; - private float debugCamYaw; - private float prevDebugCamYaw; - private float debugCamPitch; - private float prevDebugCamPitch; -+ -+ /** Smooth cam yaw */ - private float smoothCamYaw; -+ -+ /** Smooth cam pitch */ - private float smoothCamPitch; -+ -+ /** Smooth cam filter X */ - private float smoothCamFilterX; -+ -+ /** Smooth cam filter Y */ - private float smoothCamFilterY; -+ -+ /** Smooth cam partial ticks */ - private float smoothCamPartialTicks; - private float debugCamFOV; - private float prevDebugCamFOV; - private float camRoll; - private float prevCamRoll; -+ -+ /** -+ * The texture id of the blocklight/skylight texture used for lighting effects -+ */ - private final DynamicTexture lightmapTexture; -+ -+ /** -+ * Colors computed in updateLightmap() and loaded into the lightmap emptyTexture -+ */ - private final int[] lightmapColors; - private final ResourceLocation locationLightMap; -+ -+ /** FOV modifier hand */ - private float fovModifierHand; -+ -+ /** FOV modifier hand prev */ - private float fovModifierHandPrev; -+ -+ /** FOV multiplier temp */ - private float fovMultiplierTemp; - private float field_82831_U; - private float field_82832_V; -+ -+ /** Cloud fog mode */ - private boolean cloudFog; - private double cameraZoom = 1.0D; - private double cameraYaw; - private double cameraPitch; -+ -+ /** Previous frame time in milliseconds */ - private long prevFrameTime = Minecraft.getSystemTime(); -+ -+ /** End time of last render (ns) */ - private long renderEndNanoTime; -+ -+ /** -+ * Is set, updateCameraAndRender() calls updateLightmap(); set by updateTorchFlicker() -+ */ - private boolean lightmapUpdateNeeded; -- float torchFlickerX; -+ -+ /** Torch flicker X */ -+ public float torchFlickerX; -+ -+ /** Torch flicker DX */ - float torchFlickerDX; -+ -+ /** Torch flicker Y */ - float torchFlickerY; -+ -+ /** Torch flicker DY */ - float torchFlickerDY; -- private Random ae = new Random(); -+ private Random random = new Random(); -+ -+ /** Rain sound counter */ - private int rainSoundCounter; -+ -+ /** Rain X coords */ - float[] rainXCoords; -+ -+ /** Rain Y coords */ - float[] rainYCoords; -- FloatBuffer j = GLAllocation.createDirectFloatBuffer(16); -+ -+ /** Fog color buffer */ -+ FloatBuffer fogColorBuffer = GLAllocation.createDirectFloatBuffer(16); -+ -+ /** red component of the fog color */ - float fogColorRed; -+ -+ /** green component of the fog color */ - float fogColorGreen; -+ -+ /** blue component of the fog color */ - float fogColorBlue; -+ -+ /** Fog color 2 */ - private float fogColor2; -+ -+ /** Fog color 1 */ - private float fogColor1; -+ -+ /** -+ * Debug view direction (0=OFF, 1=Front, 2=Right, 3=Back, 4=Left, 5=TiltLeft, 6=TiltRight) -+ */ - public int debugViewDirection; - -- public EntityRenderer(Minecraft var1) { -- this.mc = var1; -- this.itemRenderer = new ItemRenderer(var1); -+ // Spout Start -+ private WorldProvider updatedWorldProvider = null; -+ private boolean showDebugInfo = false; -+ public static Matrix4f view = new Matrix4f(); -+ public static Matrix4f projection = new Matrix4f(); -+ public int betterGrassLoop; -+ // Spout End -+ -+ public EntityRenderer(Minecraft par1Minecraft) { -+ this.mc = par1Minecraft; -+ this.itemRenderer = new ItemRenderer(par1Minecraft); - this.lightmapTexture = new DynamicTexture(16, 16); -- this.locationLightMap = var1.getTextureManager().getDynamicTextureLocation("lightMap", this.lightmapTexture); -+ this.locationLightMap = par1Minecraft.getTextureManager().getDynamicTextureLocation("lightMap", this.lightmapTexture); - this.lightmapColors = this.lightmapTexture.getTextureData(); - } - -+ /** -+ * Updates the entity renderer -+ */ - public void updateRenderer() { - this.updateFovModifierHand(); - this.updateTorchFlicker(); -@@ -91,7 +192,8 @@ - this.prevCamRoll = this.camRoll; - float var1; - float var2; -- if(this.mc.gameSettings.smoothCamera) { -+ -+ if (this.mc.gameSettings.smoothCamera) { - var1 = this.mc.gameSettings.mouseSensitivity * 0.6F + 0.2F; - var2 = var1 * var1 * var1 * 8.0F; - this.smoothCamFilterX = this.mouseFilterXAxis.smooth(this.smoothCamYaw, 0.05F * var2); -@@ -101,7 +203,7 @@ - this.smoothCamPitch = 0.0F; - } - -- if(this.mc.renderViewEntity == null) { -+ if (this.mc.renderViewEntity == null) { - this.mc.renderViewEntity = this.mc.thePlayer; - } - -@@ -113,65 +215,73 @@ - this.itemRenderer.updateEquippedItem(); - this.addRainParticles(); - this.field_82832_V = this.field_82831_U; -- if(BossStatus.field_82825_d) { -+ -+ if (BossStatus.field_82825_d) { - this.field_82831_U += 0.05F; -- if(this.field_82831_U > 1.0F) { -+ -+ if (this.field_82831_U > 1.0F) { - this.field_82831_U = 1.0F; - } - - BossStatus.field_82825_d = false; -- } else if(this.field_82831_U > 0.0F) { -+ } else if (this.field_82831_U > 0.0F) { - this.field_82831_U -= 0.0125F; - } -- - } - -- public void getMouseOver(float var1) { -- if(this.mc.renderViewEntity != null) { -- if(this.mc.theWorld != null) { -+ /** -+ * Finds what block or object the mouse is over at the specified partial tick time. Args: partialTickTime -+ */ -+ public void getMouseOver(float par1) { -+ if (this.mc.renderViewEntity != null) { -+ if (this.mc.theWorld != null) { - this.mc.pointedEntityLiving = null; - double var2 = (double)this.mc.playerController.getBlockReachDistance(); -- this.mc.objectMouseOver = this.mc.renderViewEntity.rayTrace(var2, var1); -+ this.mc.objectMouseOver = this.mc.renderViewEntity.rayTrace(var2, par1); - double var4 = var2; -- Vec3 var6 = this.mc.renderViewEntity.getPosition(var1); -- if(this.mc.playerController.extendedReach()) { -+ Vec3 var6 = this.mc.renderViewEntity.getPosition(par1); -+ -+ if (this.mc.playerController.extendedReach()) { - var2 = 6.0D; -- var4 = var2; -+ var4 = 6.0D; - } else { -- if(var2 > 3.0D) { -+ if (var2 > 3.0D) { - var4 = 3.0D; - } - - var2 = var4; - } - -- if(this.mc.objectMouseOver != null) { -+ if (this.mc.objectMouseOver != null) { - var4 = this.mc.objectMouseOver.hitVec.distanceTo(var6); - } - -- Vec3 var7 = this.mc.renderViewEntity.getLook(var1); -+ Vec3 var7 = this.mc.renderViewEntity.getLook(par1); - Vec3 var8 = var6.addVector(var7.xCoord * var2, var7.yCoord * var2, var7.zCoord * var2); - this.pointedEntity = null; - float var9 = 1.0F; - List var10 = this.mc.theWorld.getEntitiesWithinAABBExcludingEntity(this.mc.renderViewEntity, this.mc.renderViewEntity.boundingBox.addCoord(var7.xCoord * var2, var7.yCoord * var2, var7.zCoord * var2).expand((double)var9, (double)var9, (double)var9)); - double var11 = var4; - -- for(int var13 = 0; var13 < var10.size(); ++var13) { -+ for (int var13 = 0; var13 < var10.size(); ++var13) { - Entity var14 = (Entity)var10.get(var13); -- if(var14.canBeCollidedWith()) { -+ -+ if (var14.canBeCollidedWith()) { - float var15 = var14.getCollisionBorderSize(); - AxisAlignedBB var16 = var14.boundingBox.expand((double)var15, (double)var15, (double)var15); - MovingObjectPosition var17 = var16.calculateIntercept(var6, var8); -- if(var16.isVecInside(var6)) { -- if(0.0D < var11 || var11 == 0.0D) { -+ -+ if (var16.isVecInside(var6)) { -+ if (0.0D < var11 || var11 == 0.0D) { - this.pointedEntity = var14; - var11 = 0.0D; - } -- } else if(var17 != null) { -+ } else if (var17 != null) { - double var18 = var6.distanceTo(var17.hitVec); -- if(var18 < var11 || var11 == 0.0D) { -- if(var14 == this.mc.renderViewEntity.ridingEntity) { -- if(var11 == 0.0D) { -+ -+ if (var18 < var11 || var11 == 0.0D) { -+ if (var14 == this.mc.renderViewEntity.ridingEntity) { -+ if (var11 == 0.0D) { - this.pointedEntity = var14; - } - } else { -@@ -183,67 +293,76 @@ - } - } - -- if(this.pointedEntity != null && (var11 < var4 || this.mc.objectMouseOver == null)) { -+ if (this.pointedEntity != null && (var11 < var4 || this.mc.objectMouseOver == null)) { - this.mc.objectMouseOver = new MovingObjectPosition(this.pointedEntity); -- if(this.pointedEntity instanceof EntityLivingBase) { -+ -+ if (this.pointedEntity instanceof EntityLivingBase) { - this.mc.pointedEntityLiving = (EntityLivingBase)this.pointedEntity; - } - } -- - } - } - } - -+ /** -+ * Update FOV modifier hand -+ */ - private void updateFovModifierHand() { - EntityPlayerSP var1 = (EntityPlayerSP)this.mc.renderViewEntity; - this.fovMultiplierTemp = var1.getFOVMultiplier(); - this.fovModifierHandPrev = this.fovModifierHand; - this.fovModifierHand += (this.fovMultiplierTemp - this.fovModifierHand) * 0.5F; -- if(this.fovModifierHand > 1.5F) { -+ -+ if (this.fovModifierHand > 1.5F) { - this.fovModifierHand = 1.5F; - } - -- if(this.fovModifierHand < 0.1F) { -+ if (this.fovModifierHand < 0.1F) { - this.fovModifierHand = 0.1F; - } -- - } - -- private float getFOVModifier(float var1, boolean var2) { -- if(this.debugViewDirection > 0) { -+ /** -+ * Changes the field of view of the player depending on if they are underwater or not -+ */ -+ private float getFOVModifier(float par1, boolean par2) { -+ if (this.debugViewDirection > 0) { - return 90.0F; - } else { - EntityPlayer var3 = (EntityPlayer)this.mc.renderViewEntity; - float var4 = 70.0F; -- if(var2) { -+ -+ if (par2) { - var4 += this.mc.gameSettings.fovSetting * 40.0F; -- var4 *= this.fovModifierHandPrev + (this.fovModifierHand - this.fovModifierHandPrev) * var1; -+ var4 *= this.fovModifierHandPrev + (this.fovModifierHand - this.fovModifierHandPrev) * par1; - } - -- if(var3.getHealth() <= 0.0F) { -- float var5 = (float)var3.deathTime + var1; -+ if (var3.getHealth() <= 0.0F) { -+ float var5 = (float)var3.deathTime + par1; - var4 /= (1.0F - 500.0F / (var5 + 500.0F)) * 2.0F + 1.0F; - } - -- int var6 = ActiveRenderInfo.getBlockIdAtEntityViewpoint(this.mc.theWorld, var3, var1); -- if(var6 != 0 && Block.blocksList[var6].blockMaterial == Material.water) { -+ int var6 = ActiveRenderInfo.getBlockIdAtEntityViewpoint(this.mc.theWorld, var3, par1); -+ -+ if (var6 != 0 && Block.blocksList[var6].blockMaterial == Material.water) { - var4 = var4 * 60.0F / 70.0F; - } - -- return var4 + this.prevDebugCamFOV + (this.debugCamFOV - this.prevDebugCamFOV) * var1; -+ return var4 + this.prevDebugCamFOV + (this.debugCamFOV - this.prevDebugCamFOV) * par1; - } - } - -- private void hurtCameraEffect(float var1) { -+ private void hurtCameraEffect(float par1) { - EntityLivingBase var2 = this.mc.renderViewEntity; -- float var3 = (float)var2.hurtTime - var1; -+ float var3 = (float)var2.hurtTime - par1; - float var4; -- if(var2.getHealth() <= 0.0F) { -- var4 = (float)var2.deathTime + var1; -+ -+ if (var2.getHealth() <= 0.0F) { -+ var4 = (float)var2.deathTime + par1; - GL11.glRotatef(40.0F - 8000.0F / (var4 + 200.0F), 0.0F, 0.0F, 1.0F); - } - -- if(var3 >= 0.0F) { -+ if (var3 >= 0.0F) { - var3 /= (float)var2.maxHurtTime; - var3 = MathHelper.sin(var3 * var3 * var3 * var3 * (float)Math.PI); - var4 = var2.attackedAtYaw; -@@ -253,13 +372,16 @@ - } - } - -- private void setupViewBobbing(float var1) { -- if(this.mc.renderViewEntity instanceof EntityPlayer) { -+ /** -+ * Setups all the GL settings for view bobbing. Args: partialTickTime -+ */ -+ private void setupViewBobbing(float par1) { -+ if (this.mc.renderViewEntity instanceof EntityPlayer) { - EntityPlayer var2 = (EntityPlayer)this.mc.renderViewEntity; - float var3 = var2.distanceWalkedModified - var2.prevDistanceWalkedModified; -- float var4 = -(var2.distanceWalkedModified + var3 * var1); -- float var5 = var2.prevCameraYaw + (var2.cameraYaw - var2.prevCameraYaw) * var1; -- float var6 = var2.prevCameraPitch + (var2.cameraPitch - var2.prevCameraPitch) * var1; -+ float var4 = -(var2.distanceWalkedModified + var3 * par1); -+ float var5 = var2.prevCameraYaw + (var2.cameraYaw - var2.prevCameraYaw) * par1; -+ float var6 = var2.prevCameraPitch + (var2.cameraPitch - var2.prevCameraPitch) * par1; - GL11.glTranslatef(MathHelper.sin(var4 * (float)Math.PI) * var5 * 0.5F, -Math.abs(MathHelper.cos(var4 * (float)Math.PI) * var5), 0.0F); - GL11.glRotatef(MathHelper.sin(var4 * (float)Math.PI) * var5 * 3.0F, 0.0F, 0.0F, 1.0F); - GL11.glRotatef(Math.abs(MathHelper.cos(var4 * (float)Math.PI - 0.2F) * var5) * 5.0F, 1.0F, 0.0F, 0.0F); -@@ -267,41 +389,49 @@ - } - } - -- private void orientCamera(float var1) { -+ /** -+ * sets up player's eye (or camera in third person mode) -+ */ -+ private void orientCamera(float par1) { - EntityLivingBase var2 = this.mc.renderViewEntity; - float var3 = var2.yOffset - 1.62F; -- double var4 = var2.prevPosX + (var2.posX - var2.prevPosX) * (double)var1; -- double var6 = var2.prevPosY + (var2.posY - var2.prevPosY) * (double)var1 - (double)var3; -- double var8 = var2.prevPosZ + (var2.posZ - var2.prevPosZ) * (double)var1; -- GL11.glRotatef(this.prevCamRoll + (this.camRoll - this.prevCamRoll) * var1, 0.0F, 0.0F, 1.0F); -- if(var2.isPlayerSleeping()) { -+ double var4 = var2.prevPosX + (var2.posX - var2.prevPosX) * (double)par1; -+ double var6 = var2.prevPosY + (var2.posY - var2.prevPosY) * (double)par1 - (double)var3; -+ double var8 = var2.prevPosZ + (var2.posZ - var2.prevPosZ) * (double)par1; -+ GL11.glRotatef(this.prevCamRoll + (this.camRoll - this.prevCamRoll) * par1, 0.0F, 0.0F, 1.0F); -+ -+ if (var2.isPlayerSleeping()) { - var3 = (float)((double)var3 + 1.0D); - GL11.glTranslatef(0.0F, 0.3F, 0.0F); -- if(!this.mc.gameSettings.debugCamEnable) { -+ -+ if (!this.mc.gameSettings.debugCamEnable) { - int var10 = this.mc.theWorld.getBlockId(MathHelper.floor_double(var2.posX), MathHelper.floor_double(var2.posY), MathHelper.floor_double(var2.posZ)); -- if(var10 == Block.bed.blockID) { -+ -+ if (var10 == Block.bed.blockID) { - int var11 = this.mc.theWorld.getBlockMetadata(MathHelper.floor_double(var2.posX), MathHelper.floor_double(var2.posY), MathHelper.floor_double(var2.posZ)); - int var12 = var11 & 3; - GL11.glRotatef((float)(var12 * 90), 0.0F, 1.0F, 0.0F); - } - -- GL11.glRotatef(var2.prevRotationYaw + (var2.rotationYaw - var2.prevRotationYaw) * var1 + 180.0F, 0.0F, -1.0F, 0.0F); -- GL11.glRotatef(var2.prevRotationPitch + (var2.rotationPitch - var2.prevRotationPitch) * var1, -1.0F, 0.0F, 0.0F); -+ GL11.glRotatef(var2.prevRotationYaw + (var2.rotationYaw - var2.prevRotationYaw) * par1 + 180.0F, 0.0F, -1.0F, 0.0F); -+ GL11.glRotatef(var2.prevRotationPitch + (var2.rotationPitch - var2.prevRotationPitch) * par1, -1.0F, 0.0F, 0.0F); - } -- } else if(this.mc.gameSettings.thirdPersonView > 0) { -- double var27 = (double)(this.thirdPersonDistanceTemp + (this.thirdPersonDistance - this.thirdPersonDistanceTemp) * var1); -+ } else if (this.mc.gameSettings.thirdPersonView > 0) { -+ double var27 = (double)(this.thirdPersonDistanceTemp + (this.thirdPersonDistance - this.thirdPersonDistanceTemp) * par1); - float var13; - float var28; -- if(this.mc.gameSettings.debugCamEnable) { -- var28 = this.prevDebugCamYaw + (this.debugCamYaw - this.prevDebugCamYaw) * var1; -- var13 = this.prevDebugCamPitch + (this.debugCamPitch - this.prevDebugCamPitch) * var1; -+ -+ if (this.mc.gameSettings.debugCamEnable) { -+ var28 = this.prevDebugCamYaw + (this.debugCamYaw - this.prevDebugCamYaw) * par1; -+ var13 = this.prevDebugCamPitch + (this.debugCamPitch - this.prevDebugCamPitch) * par1; - GL11.glTranslatef(0.0F, 0.0F, (float)(-var27)); - GL11.glRotatef(var13, 1.0F, 0.0F, 0.0F); - GL11.glRotatef(var28, 0.0F, 1.0F, 0.0F); - } else { - var28 = var2.rotationYaw; - var13 = var2.rotationPitch; -- if(this.mc.gameSettings.thirdPersonView == 2) { -+ -+ if (this.mc.gameSettings.thirdPersonView == 2) { - var13 += 180.0F; - } - -@@ -309,23 +439,25 @@ - double var16 = (double)(MathHelper.cos(var28 / 180.0F * (float)Math.PI) * MathHelper.cos(var13 / 180.0F * (float)Math.PI)) * var27; - double var18 = (double)(-MathHelper.sin(var13 / 180.0F * (float)Math.PI)) * var27; - -- for(int var20 = 0; var20 < 8; ++var20) { -+ for (int var20 = 0; var20 < 8; ++var20) { - float var21 = (float)((var20 & 1) * 2 - 1); - float var22 = (float)((var20 >> 1 & 1) * 2 - 1); - float var23 = (float)((var20 >> 2 & 1) * 2 - 1); - var21 *= 0.1F; - var22 *= 0.1F; - var23 *= 0.1F; -- MovingObjectPosition var24 = this.mc.theWorld.rayTraceBlocks(this.mc.theWorld.getWorldVec3Pool().getVecFromPool(var4 + (double)var21, var6 + (double)var22, var8 + (double)var23), this.mc.theWorld.getWorldVec3Pool().getVecFromPool(var4 - var14 + (double)var21 + (double)var23, var6 - var18 + (double)var22, var8 - var16 + (double)var23)); -- if(var24 != null) { -+ MovingObjectPosition var24 = this.mc.theWorld.clip(this.mc.theWorld.getWorldVec3Pool().getVecFromPool(var4 + (double)var21, var6 + (double)var22, var8 + (double)var23), this.mc.theWorld.getWorldVec3Pool().getVecFromPool(var4 - var14 + (double)var21 + (double)var23, var6 - var18 + (double)var22, var8 - var16 + (double)var23)); -+ -+ if (var24 != null) { - double var25 = var24.hitVec.distanceTo(this.mc.theWorld.getWorldVec3Pool().getVecFromPool(var4, var6, var8)); -- if(var25 < var27) { -+ -+ if (var25 < var27) { - var27 = var25; - } - } - } - -- if(this.mc.gameSettings.thirdPersonView == 2) { -+ if (this.mc.gameSettings.thirdPersonView == 2) { - GL11.glRotatef(180.0F, 0.0F, 1.0F, 0.0F); - } - -@@ -339,148 +471,186 @@ - GL11.glTranslatef(0.0F, 0.0F, -0.1F); - } - -- if(!this.mc.gameSettings.debugCamEnable) { -- GL11.glRotatef(var2.prevRotationPitch + (var2.rotationPitch - var2.prevRotationPitch) * var1, 1.0F, 0.0F, 0.0F); -- GL11.glRotatef(var2.prevRotationYaw + (var2.rotationYaw - var2.prevRotationYaw) * var1 + 180.0F, 0.0F, 1.0F, 0.0F); -+ if (!this.mc.gameSettings.debugCamEnable) { -+ GL11.glRotatef(var2.prevRotationPitch + (var2.rotationPitch - var2.prevRotationPitch) * par1, 1.0F, 0.0F, 0.0F); -+ GL11.glRotatef(var2.prevRotationYaw + (var2.rotationYaw - var2.prevRotationYaw) * par1 + 180.0F, 0.0F, 1.0F, 0.0F); - } - - GL11.glTranslatef(0.0F, var3, 0.0F); -- var4 = var2.prevPosX + (var2.posX - var2.prevPosX) * (double)var1; -- var6 = var2.prevPosY + (var2.posY - var2.prevPosY) * (double)var1 - (double)var3; -- var8 = var2.prevPosZ + (var2.posZ - var2.prevPosZ) * (double)var1; -- this.cloudFog = this.mc.renderGlobal.hasCloudFog(var4, var6, var8, var1); -+ var4 = var2.prevPosX + (var2.posX - var2.prevPosX) * (double)par1; -+ var6 = var2.prevPosY + (var2.posY - var2.prevPosY) * (double)par1 - (double)var3; -+ var8 = var2.prevPosZ + (var2.posZ - var2.prevPosZ) * (double)par1; -+ this.cloudFog = this.mc.renderGlobal.hasCloudFog(var4, var6, var8, par1); - } - -- private void setupCameraTransform(float var1, int var2) { -- this.farPlaneDistance = (float)(256 >> this.mc.gameSettings.renderDistance); -+ /** -+ * sets up projection, view effects, camera position/rotation -+ */ -+ private void setupCameraTransform(float par1, int par2) { -+ // Spout Start -+ this.farPlaneDistance = (float) (32 << 3 - this.mc.gameSettings.renderDistance); -+ if (Configuration.isFarView()) { -+ if (this.farPlaneDistance < 256.0F) { -+ this.farPlaneDistance *= 3.0F; -+ } else { -+ this.farPlaneDistance *= 2.0F; -+ } -+ } -+ -+ if (Configuration.isFancyFog()) { -+ this.farPlaneDistance *= 0.95F; -+ } else { -+ this.farPlaneDistance *= 0.83F; -+ } -+ // Spout End - GL11.glMatrixMode(GL11.GL_PROJECTION); - GL11.glLoadIdentity(); - float var3 = 0.07F; -- if(this.mc.gameSettings.anaglyph) { -- GL11.glTranslatef((float)(-(var2 * 2 - 1)) * var3, 0.0F, 0.0F); -+ -+ if (this.mc.gameSettings.anaglyph) { -+ GL11.glTranslatef((float)(-(par2 * 2 - 1)) * var3, 0.0F, 0.0F); - } - -- if(this.cameraZoom != 1.0D) { -+ if (this.cameraZoom != 1.0D) { - GL11.glTranslatef((float)this.cameraYaw, (float)(-this.cameraPitch), 0.0F); - GL11.glScaled(this.cameraZoom, this.cameraZoom, 1.0D); - } - -- Project.gluPerspective(this.getFOVModifier(var1, true), (float)this.mc.displayWidth / (float)this.mc.displayHeight, 0.05F, this.farPlaneDistance * 2.0F); -+ GLU.gluPerspective(this.getFOVModifier(par1, true), (float)this.mc.displayWidth / (float)this.mc.displayHeight, 0.05F, this.farPlaneDistance * 2.0F); - float var4; -- if(this.mc.playerController.enableEverythingIsScrewedUpMode()) { -- var4 = 2.0F / 3.0F; -+ -+ if (this.mc.playerController.enableEverythingIsScrewedUpMode()) { -+ var4 = 0.6666667F; - GL11.glScalef(1.0F, var4, 1.0F); - } - - GL11.glMatrixMode(GL11.GL_MODELVIEW); - GL11.glLoadIdentity(); -- if(this.mc.gameSettings.anaglyph) { -- GL11.glTranslatef((float)(var2 * 2 - 1) * 0.1F, 0.0F, 0.0F); -- } -- -- this.hurtCameraEffect(var1); -- if(this.mc.gameSettings.viewBobbing) { -- this.setupViewBobbing(var1); -- } -- -- var4 = this.mc.thePlayer.prevTimeInPortal + (this.mc.thePlayer.timeInPortal - this.mc.thePlayer.prevTimeInPortal) * var1; -- if(var4 > 0.0F) { -+ -+ if (this.mc.gameSettings.anaglyph) { -+ GL11.glTranslatef((float)(par2 * 2 - 1) * 0.1F, 0.0F, 0.0F); -+ } -+ -+ this.hurtCameraEffect(par1); -+ -+ if (this.mc.gameSettings.viewBobbing) { -+ this.setupViewBobbing(par1); -+ } -+ -+ var4 = this.mc.thePlayer.prevTimeInPortal + (this.mc.thePlayer.timeInPortal - this.mc.thePlayer.prevTimeInPortal) * par1; -+ -+ if (var4 > 0.0F) { - byte var5 = 20; -- if(this.mc.thePlayer.isPotionActive(Potion.confusion)) { -+ -+ if (this.mc.thePlayer.isPotionActive(Potion.confusion)) { - var5 = 7; - } - - float var6 = 5.0F / (var4 * var4 + 5.0F) - var4 * 0.04F; - var6 *= var6; -- GL11.glRotatef(((float)this.rendererUpdateCount + var1) * (float)var5, 0.0F, 1.0F, 1.0F); -+ GL11.glRotatef(((float)this.rendererUpdateCount + par1) * (float)var5, 0.0F, 1.0F, 1.0F); - GL11.glScalef(1.0F / var6, 1.0F, 1.0F); -- GL11.glRotatef(-((float)this.rendererUpdateCount + var1) * (float)var5, 0.0F, 1.0F, 1.0F); -+ GL11.glRotatef(-((float)this.rendererUpdateCount + par1) * (float)var5, 0.0F, 1.0F, 1.0F); - } - -- this.orientCamera(var1); -- if(this.debugViewDirection > 0) { -+ this.orientCamera(par1); -+ -+ if (this.debugViewDirection > 0) { - int var7 = this.debugViewDirection - 1; -- if(var7 == 1) { -+ -+ if (var7 == 1) { - GL11.glRotatef(90.0F, 0.0F, 1.0F, 0.0F); - } - -- if(var7 == 2) { -+ if (var7 == 2) { - GL11.glRotatef(180.0F, 0.0F, 1.0F, 0.0F); - } - -- if(var7 == 3) { -+ if (var7 == 3) { - GL11.glRotatef(-90.0F, 0.0F, 1.0F, 0.0F); - } - -- if(var7 == 4) { -+ if (var7 == 4) { - GL11.glRotatef(90.0F, 1.0F, 0.0F, 0.0F); - } - -- if(var7 == 5) { -+ if (var7 == 5) { - GL11.glRotatef(-90.0F, 1.0F, 0.0F, 0.0F); - } - } -- - } - -- private void renderHand(float var1, int var2) { -- if(this.debugViewDirection <= 0) { -+ /** -+ * Render player hand -+ */ -+ private void renderHand(float par1, int par2) { -+ if (this.debugViewDirection <= 0) { - GL11.glMatrixMode(GL11.GL_PROJECTION); - GL11.glLoadIdentity(); - float var3 = 0.07F; -- if(this.mc.gameSettings.anaglyph) { -- GL11.glTranslatef((float)(-(var2 * 2 - 1)) * var3, 0.0F, 0.0F); -+ -+ if (this.mc.gameSettings.anaglyph) { -+ GL11.glTranslatef((float)(-(par2 * 2 - 1)) * var3, 0.0F, 0.0F); - } - -- if(this.cameraZoom != 1.0D) { -+ if (this.cameraZoom != 1.0D) { - GL11.glTranslatef((float)this.cameraYaw, (float)(-this.cameraPitch), 0.0F); - GL11.glScaled(this.cameraZoom, this.cameraZoom, 1.0D); - } - -- Project.gluPerspective(this.getFOVModifier(var1, false), (float)this.mc.displayWidth / (float)this.mc.displayHeight, 0.05F, this.farPlaneDistance * 2.0F); -- if(this.mc.playerController.enableEverythingIsScrewedUpMode()) { -- float var4 = 2.0F / 3.0F; -+ GLU.gluPerspective(this.getFOVModifier(par1, false), (float)this.mc.displayWidth / (float)this.mc.displayHeight, 0.05F, this.farPlaneDistance * 2.0F); -+ -+ if (this.mc.playerController.enableEverythingIsScrewedUpMode()) { -+ float var4 = 0.6666667F; - GL11.glScalef(1.0F, var4, 1.0F); - } - - GL11.glMatrixMode(GL11.GL_MODELVIEW); - GL11.glLoadIdentity(); -- if(this.mc.gameSettings.anaglyph) { -- GL11.glTranslatef((float)(var2 * 2 - 1) * 0.1F, 0.0F, 0.0F); -+ -+ if (this.mc.gameSettings.anaglyph) { -+ GL11.glTranslatef((float)(par2 * 2 - 1) * 0.1F, 0.0F, 0.0F); - } - - GL11.glPushMatrix(); -- this.hurtCameraEffect(var1); -- if(this.mc.gameSettings.viewBobbing) { -- this.setupViewBobbing(var1); -+ this.hurtCameraEffect(par1); -+ -+ if (this.mc.gameSettings.viewBobbing) { -+ this.setupViewBobbing(par1); - } - -- if(this.mc.gameSettings.thirdPersonView == 0 && !this.mc.renderViewEntity.isPlayerSleeping() && !this.mc.gameSettings.hideGUI && !this.mc.playerController.enableEverythingIsScrewedUpMode()) { -- this.enableLightmap((double)var1); -- this.itemRenderer.renderItemInFirstPerson(var1); -- this.disableLightmap((double)var1); -+ if (this.mc.gameSettings.thirdPersonView == 0 && !this.mc.renderViewEntity.isPlayerSleeping() && !this.mc.gameSettings.hideGUI && !this.mc.playerController.enableEverythingIsScrewedUpMode()) { -+ this.enableLightmap((double)par1); -+ this.itemRenderer.renderItemInFirstPerson(par1); -+ this.disableLightmap((double)par1); - } - - GL11.glPopMatrix(); -- if(this.mc.gameSettings.thirdPersonView == 0 && !this.mc.renderViewEntity.isPlayerSleeping()) { -- this.itemRenderer.renderOverlays(var1); -- this.hurtCameraEffect(var1); -- } -- -- if(this.mc.gameSettings.viewBobbing) { -- this.setupViewBobbing(var1); -- } -- -+ -+ if (this.mc.gameSettings.thirdPersonView == 0 && !this.mc.renderViewEntity.isPlayerSleeping()) { -+ this.itemRenderer.renderOverlays(par1); -+ this.hurtCameraEffect(par1); -+ } -+ -+ if (this.mc.gameSettings.viewBobbing) { -+ this.setupViewBobbing(par1); -+ } - } - } - -- public void disableLightmap(double var1) { -+ /** -+ * Disable secondary texture unit used by lightmap -+ */ -+ public void disableLightmap(double par1) { - OpenGlHelper.setActiveTexture(OpenGlHelper.lightmapTexUnit); - GL11.glDisable(GL11.GL_TEXTURE_2D); - OpenGlHelper.setActiveTexture(OpenGlHelper.defaultTexUnit); - } - -- public void enableLightmap(double var1) { -+ /** -+ * Enable lightmap in secondary texture unit -+ */ -+ public void enableLightmap(double par1) { - OpenGlHelper.setActiveTexture(OpenGlHelper.lightmapTexUnit); - GL11.glMatrixMode(GL11.GL_TEXTURE); - GL11.glLoadIdentity(); -@@ -496,10 +666,13 @@ - GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_WRAP_S, GL11.GL_CLAMP); - GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_WRAP_T, GL11.GL_CLAMP); - GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); -- GL11.glEnable(GL11.GL_TEXTURE_2D); -+ GL11.glEnable(GL11.GL_TEXTURE_2D); - OpenGlHelper.setActiveTexture(OpenGlHelper.defaultTexUnit); - } - -+ /** -+ * Recompute a random value that is applied to block color in updateLightmap() -+ */ - private void updateTorchFlicker() { - this.torchFlickerDX = (float)((double)this.torchFlickerDX + (Math.random() - Math.random()) * Math.random() * Math.random()); - this.torchFlickerDY = (float)((double)this.torchFlickerDY + (Math.random() - Math.random()) * Math.random() * Math.random()); -@@ -510,14 +683,19 @@ - this.lightmapUpdateNeeded = true; - } - -- private void updateLightmap(float var1) { -+ private void updateLightmap(float par1) { - WorldClient var2 = this.mc.theWorld; -- if(var2 != null) { -- for(int var3 = 0; var3 < 256; ++var3) { -+ -+ if (Lightmap.computeLightmap(this, var2, this.lightmapColors, par1)) { -+ this.lightmapTexture.updateDynamicTexture(); -+ this.lightmapUpdateNeeded = false; -+ } else if (var2 != null) { -+ for (int var3 = 0; var3 < 256; ++var3) { - float var4 = var2.getSunBrightness(1.0F) * 0.95F + 0.05F; - float var5 = var2.provider.lightBrightnessTable[var3 / 16] * var4; - float var6 = var2.provider.lightBrightnessTable[var3 % 16] * (this.torchFlickerX * 0.1F + 1.5F); -- if(var2.lastLightningBolt > 0) { -+ -+ if (var2.lastLightningBolt > 0) { - var5 = var2.provider.lightBrightnessTable[var3 / 16]; - } - -@@ -532,28 +710,31 @@ - var14 = var14 * 0.96F + 0.03F; - var15 = var15 * 0.96F + 0.03F; - float var16; -- if(this.field_82831_U > 0.0F) { -- var16 = this.field_82832_V + (this.field_82831_U - this.field_82832_V) * var1; -+ -+ if (this.field_82831_U > 0.0F) { -+ var16 = this.field_82832_V + (this.field_82831_U - this.field_82832_V) * par1; - var13 = var13 * (1.0F - var16) + var13 * 0.7F * var16; - var14 = var14 * (1.0F - var16) + var14 * 0.6F * var16; - var15 = var15 * (1.0F - var16) + var15 * 0.6F * var16; - } - -- if(var2.provider.dimensionId == 1) { -- var13 = 0.22F + var6 * (12.0F / 16.0F); -- var14 = 0.28F + var11 * (12.0F / 16.0F); -- var15 = 0.25F + var12 * (12.0F / 16.0F); -+ if (var2.provider.dimensionId == 1) { -+ var13 = 0.22F + var6 * 0.75F; -+ var14 = 0.28F + var11 * 0.75F; -+ var15 = 0.25F + var12 * 0.75F; - } - - float var17; -- if(this.mc.thePlayer.isPotionActive(Potion.nightVision)) { -- var16 = this.getNightVisionBrightness(this.mc.thePlayer, var1); -+ -+ if (this.mc.thePlayer.isPotionActive(Potion.nightVision)) { -+ var16 = this.getNightVisionBrightness(this.mc.thePlayer, par1); - var17 = 1.0F / var13; -- if(var17 > 1.0F / var14) { -+ -+ if (var17 > 1.0F / var14) { - var17 = 1.0F / var14; - } - -- if(var17 > 1.0F / var15) { -+ if (var17 > 1.0F / var15) { - var17 = 1.0F / var15; - } - -@@ -562,15 +743,15 @@ - var15 = var15 * (1.0F - var16) + var15 * var17 * var16; - } - -- if(var13 > 1.0F) { -+ if (var13 > 1.0F) { - var13 = 1.0F; - } - -- if(var14 > 1.0F) { -+ if (var14 > 1.0F) { - var14 = 1.0F; - } - -- if(var15 > 1.0F) { -+ if (var15 > 1.0F) { - var15 = 1.0F; - } - -@@ -587,27 +768,28 @@ - var13 = var13 * 0.96F + 0.03F; - var14 = var14 * 0.96F + 0.03F; - var15 = var15 * 0.96F + 0.03F; -- if(var13 > 1.0F) { -+ -+ if (var13 > 1.0F) { - var13 = 1.0F; - } - -- if(var14 > 1.0F) { -+ if (var14 > 1.0F) { - var14 = 1.0F; - } - -- if(var15 > 1.0F) { -+ if (var15 > 1.0F) { - var15 = 1.0F; - } - -- if(var13 < 0.0F) { -+ if (var13 < 0.0F) { - var13 = 0.0F; - } - -- if(var14 < 0.0F) { -+ if (var14 < 0.0F) { - var14 = 0.0F; - } - -- if(var15 < 0.0F) { -+ if (var15 < 0.0F) { - var15 = 0.0F; - } - -@@ -623,21 +805,59 @@ - } - } - -- private float getNightVisionBrightness(EntityPlayer var1, float var2) { -- int var3 = var1.getActivePotionEffect(Potion.nightVision).getDuration(); -- return var3 > 200 ? 1.0F : 0.7F + MathHelper.sin(((float)var3 - var2) * (float)Math.PI * 0.2F) * 0.3F; -+ /** -+ * Gets the night vision brightness -+ */ -+ private float getNightVisionBrightness(EntityPlayer par1EntityPlayer, float par2) { -+ int var3 = par1EntityPlayer.getActivePotionEffect(Potion.nightVision).getDuration(); -+ return var3 > 200 ? 1.0F : 0.7F + MathHelper.sin(((float)var3 - par2) * (float)Math.PI * 0.2F) * 0.3F; - } - -- public void updateCameraAndRender(float var1) { -+ /** -+ * Will update any inputs that effect the camera angle (mouse) and then render the world and GUI -+ */ -+ public void updateCameraAndRender(float par1) { -+ // Spout Start -+ World world = this.mc.theWorld; -+ Block.leaves.setGraphicsLevel(Configuration.isFancyTrees()); -+ if (!Configuration.isWeather() && world != null && world.worldInfo != null) { -+ world.worldInfo.setRaining(false); -+ } -+ -+ if (world != null) { -+ long rawTime = world.getWorldTime(); -+ long time = rawTime % 24000L; -+ if (Configuration.getTime() == 2) { // Day -+ if (time <= 1000L) { -+ world.worldInfo.setWorldTime(rawTime - time + 1001L); -+ } -+ -+ if (time >= 11000L) { -+ world.worldInfo.setWorldTime(rawTime - time + 24001L); -+ } -+ } else if (Configuration.getTime() == 1) { // Night -+ if (time <= 14000L) { -+ world.worldInfo.setWorldTime(rawTime - time + 14001L); -+ } -+ -+ if (time >= 22000L) { -+ world.worldInfo.setWorldTime(rawTime - time + 24000L + 14001L); -+ } -+ } -+ } -+ // Spout End -+ - this.mc.mcProfiler.startSection("lightTex"); -- if(this.lightmapUpdateNeeded) { -- this.updateLightmap(var1); -+ -+ if (this.lightmapUpdateNeeded) { -+ this.updateLightmap(par1); - } - - this.mc.mcProfiler.endSection(); - boolean var2 = Display.isActive(); -- if(!var2 && this.mc.gameSettings.pauseOnLostFocus && (!this.mc.gameSettings.touchscreen || !Mouse.isButtonDown(1))) { -- if(Minecraft.getSystemTime() - this.prevFrameTime > 500L) { -+ -+ if (!var2 && this.mc.gameSettings.pauseOnLostFocus && (!this.mc.gameSettings.touchscreen || !Mouse.isButtonDown(1))) { -+ if (Minecraft.getSystemTime() - this.prevFrameTime > 500L) { - this.mc.displayInGameMenu(); - } - } else { -@@ -645,22 +865,24 @@ - } - - this.mc.mcProfiler.startSection("mouse"); -- if(this.mc.inGameHasFocus && var2) { -+ -+ if (this.mc.inGameHasFocus && var2) { - this.mc.mouseHelper.mouseXYChange(); - float var3 = this.mc.gameSettings.mouseSensitivity * 0.6F + 0.2F; - float var4 = var3 * var3 * var3 * 8.0F; - float var5 = (float)this.mc.mouseHelper.deltaX * var4; - float var6 = (float)this.mc.mouseHelper.deltaY * var4; - byte var7 = 1; -- if(this.mc.gameSettings.invertMouse) { -+ -+ if (this.mc.gameSettings.invertMouse) { - var7 = -1; - } - -- if(this.mc.gameSettings.smoothCamera) { -+ if (this.mc.gameSettings.smoothCamera) { - this.smoothCamYaw += var5; - this.smoothCamPitch += var6; -- float var8 = var1 - this.smoothCamPartialTicks; -- this.smoothCamPartialTicks = var1; -+ float var8 = par1 - this.smoothCamPartialTicks; -+ this.smoothCamPartialTicks = par1; - var5 = this.smoothCamFilterX * var8; - var6 = this.smoothCamFilterY * var8; - this.mc.thePlayer.setAngles(var5, var6 * (float)var7); -@@ -670,7 +892,8 @@ - } - - this.mc.mcProfiler.endSection(); -- if(!this.mc.skipRenderWorld) { -+ -+ if (!this.mc.skipRenderWorld) { - anaglyphEnable = this.mc.gameSettings.anaglyph; - ScaledResolution var13 = new ScaledResolution(this.mc.gameSettings, this.mc.displayWidth, this.mc.displayHeight); - int var14 = var13.getScaledWidth(); -@@ -678,18 +901,38 @@ - int var16 = Mouse.getX() * var14 / this.mc.displayWidth; - int var17 = var15 - Mouse.getY() * var15 / this.mc.displayHeight - 1; - int var18 = performanceToFps(this.mc.gameSettings.limitFramerate); -- if(this.mc.theWorld != null) { -+ -+ if (this.mc.theWorld != null) { - this.mc.mcProfiler.startSection("level"); -- if(this.mc.gameSettings.limitFramerate == 0) { -- this.renderWorld(var1, 0L); -+ -+ if (this.mc.gameSettings.limitFramerate == 0) { -+ this.renderWorld(par1, 0L); - } else { -- this.renderWorld(var1, this.renderEndNanoTime + (long)(1000000000 / var18)); -+ this.renderWorld(par1, this.renderEndNanoTime + (long)(1000000000 / var18)); - } - - this.renderEndNanoTime = System.nanoTime(); - this.mc.mcProfiler.endStartSection("gui"); -- if(!this.mc.gameSettings.hideGUI || this.mc.currentScreen != null) { -- this.mc.ingameGUI.renderGameOverlay(var1, this.mc.currentScreen != null, var16, var17); -+ -+ if (!this.mc.gameSettings.hideGUI || this.mc.currentScreen != null) { -+ // Spout Start -+ if (Configuration.getFastDebug() != 0) { -+ if (Minecraft.isDebugInfoEnabled()) { -+ this.showDebugInfo = !this.showDebugInfo; -+ } -+ -+ if (this.showDebugInfo) { -+ this.mc.gameSettings.showDebugInfo = true; -+ } -+ } -+ // Spout End -+ -+ this.mc.ingameGUI.renderGameOverlay(par1, this.mc.currentScreen != null, var16, var17); -+ // Spout Start -+ if (Configuration.getFastDebug() != 0) { -+ this.mc.gameSettings.showDebugInfo = false; -+ } -+ // Spout End - } - - this.mc.mcProfiler.endSection(); -@@ -703,11 +946,11 @@ - this.renderEndNanoTime = System.nanoTime(); - } - -- if(this.mc.currentScreen != null) { -+ if (this.mc.currentScreen != null) { - GL11.glClear(GL11.GL_DEPTH_BUFFER_BIT); - - try { -- this.mc.currentScreen.drawScreen(var16, var17, var1); -+ this.mc.currentScreen.drawScreen(var16, var17, par1); - } catch (Throwable var12) { - CrashReport var10 = CrashReport.makeCrashReport(var12, "Rendering screen"); - CrashReportCategory var11 = var10.makeCategory("Screen render details"); -@@ -716,37 +959,55 @@ - var11.addCrashSectionCallable("Screen size", new CallableScreenSize(this, var13)); - throw new ReportedException(var10); - } -+ -+ if (this.mc.currentScreen != null && this.mc.currentScreen.guiParticles != null) { -+ this.mc.currentScreen.guiParticles.draw(par1); -+ } -+ -+ if (this.mc.currentScreen!= null) { -+ this.mc.currentScreen.drawScreenPre(var16, var17, par1); -+ } else { -+ System.out.println("SpoutDebug: CurrentScreen was null prior to trying to drawScreenPre"); -+ } -+ -+ if (this.mc.currentScreen != null && this.mc.currentScreen.guiParticles != null) { -+ this.mc.currentScreen.guiParticles.draw(par1); -+ } - } -- - } - } - -- public void renderWorld(float var1, long var2) { -+ public void renderWorld(float par1, long par2) { - this.mc.mcProfiler.startSection("lightTex"); -- if(this.lightmapUpdateNeeded) { -- this.updateLightmap(var1); -+ -+ if (this.lightmapUpdateNeeded) { -+ this.updateLightmap(par1); - } - - GL11.glEnable(GL11.GL_CULL_FACE); - GL11.glEnable(GL11.GL_DEPTH_TEST); -- if(this.mc.renderViewEntity == null) { -+ -+ if (this.mc.renderViewEntity == null) { - this.mc.renderViewEntity = this.mc.thePlayer; - } - - this.mc.mcProfiler.endStartSection("pick"); -- this.getMouseOver(var1); -+ this.getMouseOver(par1); - EntityLivingBase var4 = this.mc.renderViewEntity; - RenderGlobal var5 = this.mc.renderGlobal; - EffectRenderer var6 = this.mc.effectRenderer; -- double var7 = var4.lastTickPosX + (var4.posX - var4.lastTickPosX) * (double)var1; -- double var9 = var4.lastTickPosY + (var4.posY - var4.lastTickPosY) * (double)var1; -- double var11 = var4.lastTickPosZ + (var4.posZ - var4.lastTickPosZ) * (double)var1; -+ double var7 = var4.lastTickPosX + (var4.posX - var4.lastTickPosX) * (double)par1; -+ double var9 = var4.lastTickPosY + (var4.posY - var4.lastTickPosY) * (double)par1; -+ double var11 = var4.lastTickPosZ + (var4.posZ - var4.lastTickPosZ) * (double)par1; - this.mc.mcProfiler.endStartSection("center"); - -- for(int var13 = 0; var13 < 2; ++var13) { -- if(this.mc.gameSettings.anaglyph) { -+ // Spout Start -+ for (int var13 = 0; var13 < (this.mc.gameSettings.anaglyph ? 2 : 1); ++var13) { -+ // Spout End -+ if (this.mc.gameSettings.anaglyph) { - anaglyphField = var13; -- if(anaglyphField == 0) { -+ -+ if (anaglyphField == 0) { - GL11.glColorMask(false, true, true, false); - } else { - GL11.glColorMask(true, false, false, false); -@@ -755,71 +1016,83 @@ - - this.mc.mcProfiler.endStartSection("clear"); - GL11.glViewport(0, 0, this.mc.displayWidth, this.mc.displayHeight); -- this.updateFogColor(var1); -- GL11.glClear(GL11.GL_DEPTH_BUFFER_BIT | GL11.GL_COLOR_BUFFER_BIT); -+ this.updateFogColor(par1); -+ GL11.glClear(GL11.GL_COLOR_BUFFER_BIT | GL11.GL_DEPTH_BUFFER_BIT); - GL11.glEnable(GL11.GL_CULL_FACE); - this.mc.mcProfiler.endStartSection("camera"); -- this.setupCameraTransform(var1, var13); -+ this.setupCameraTransform(par1, var13); - ActiveRenderInfo.updateRenderInfo(this.mc.thePlayer, this.mc.gameSettings.thirdPersonView == 2); - this.mc.mcProfiler.endStartSection("frustrum"); - ClippingHelperImpl.getInstance(); -- if(this.mc.gameSettings.renderDistance < 2) { -- this.setupFog(-1, var1); -+ -+ // Spout Start -+ if (this.mc.gameSettings.renderDistance < 2 || Configuration.isFarView()) { -+ // Spout End -+ this.setupFog(-1, par1); - this.mc.mcProfiler.endStartSection("sky"); -- var5.renderSky(var1); -+ var5.renderSky(par1); - } - - GL11.glEnable(GL11.GL_FOG); -- this.setupFog(1, var1); -- if(this.mc.gameSettings.ambientOcclusion != 0) { -+ this.setupFog(1, par1); -+ -+ // Spout Start -+ if (RenderPass.setAmbientOcclusion(this.mc.gameSettings.ambientOcclusion >= 2)) { -+ // Spout End - GL11.glShadeModel(GL11.GL_SMOOTH); - } - - this.mc.mcProfiler.endStartSection("culling"); - Frustrum var14 = new Frustrum(); - var14.setPosition(var7, var9, var11); -- this.mc.renderGlobal.clipRenderersByFrustum(var14, var1); -- if(var13 == 0) { -+ this.mc.renderGlobal.clipRenderersByFrustum(var14, par1); -+ -+ if (var13 == 0) { - this.mc.mcProfiler.endStartSection("updatechunks"); - -- while(!this.mc.renderGlobal.updateRenderers(var4, false) && var2 != 0L) { -- long var15 = var2 - System.nanoTime(); -- if(var15 < 0L || var15 > 1000000000L) { -+ while (!this.mc.renderGlobal.updateRenderers(var4, false) && par2 != 0L) { -+ long var15 = par2 - System.nanoTime(); -+ -+ if (var15 < 0L || var15 > 1000000000L) { - break; - } - } - } - -- if(var4.posY < 128.0D) { -- this.renderCloudsCheck(var5, var1); -+ if (var4.posY < 128.0D) { -+ this.renderCloudsCheck(var5, par1); - } -- - this.mc.mcProfiler.endStartSection("prepareterrain"); -- this.setupFog(0, var1); -+ this.setupFog(0, par1); - GL11.glEnable(GL11.GL_FOG); - this.mc.getTextureManager().bindTexture(TextureMap.locationBlocksTexture); - RenderHelper.disableStandardItemLighting(); - this.mc.mcProfiler.endStartSection("terrain"); -- var5.sortAndRender(var4, 0, (double)var1); -+ var5.sortAndRender(var4, 0, (double)par1); -+ // MCPatcher Start -+ RenderPass.doRenderPass(var5, var4, 2, (double)par1); -+ // MCPatcher End - GL11.glShadeModel(GL11.GL_FLAT); - EntityPlayer var17; -- if(this.debugViewDirection == 0) { -+ -+ if (this.debugViewDirection == 0) { - RenderHelper.enableStandardItemLighting(); - this.mc.mcProfiler.endStartSection("entities"); -- var5.renderEntities(var4.getPosition(var1), var14, var1); -- this.enableLightmap((double)var1); -+ var5.renderEntities(var4.getPosition(par1), var14, par1); -+ this.enableLightmap((double)par1); - this.mc.mcProfiler.endStartSection("litParticles"); -- var6.renderLitParticles(var4, var1); -+ var6.renderLitParticles(var4, par1); - RenderHelper.disableStandardItemLighting(); -- this.setupFog(0, var1); -+ this.setupFog(0, par1); - this.mc.mcProfiler.endStartSection("particles"); -- var6.renderParticles(var4, var1); -- this.disableLightmap((double)var1); -- if(this.mc.objectMouseOver != null && var4.isInsideOfMaterial(Material.water) && var4 instanceof EntityPlayer && !this.mc.gameSettings.hideGUI) { -+ var6.renderParticles(var4, par1); -+ this.disableLightmap((double)par1); -+ -+ if (this.mc.objectMouseOver != null && var4.isInsideOfMaterial(Material.water) && var4 instanceof EntityPlayer && !this.mc.gameSettings.hideGUI) { - var17 = (EntityPlayer)var4; - GL11.glDisable(GL11.GL_ALPHA_TEST); - this.mc.mcProfiler.endStartSection("outline"); -- var5.drawSelectionBox(var17, this.mc.objectMouseOver, 0, var1); -+ var5.drawSelectionBox(var17, this.mc.objectMouseOver, 0, par1); - GL11.glEnable(GL11.GL_ALPHA_TEST); - } - } -@@ -828,20 +1101,26 @@ - GL11.glEnable(GL11.GL_CULL_FACE); - GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); - GL11.glDepthMask(true); -- this.setupFog(0, var1); -+ this.setupFog(0, par1); - GL11.glEnable(GL11.GL_BLEND); - GL11.glDisable(GL11.GL_CULL_FACE); - this.mc.getTextureManager().bindTexture(TextureMap.locationBlocksTexture); -- if(this.mc.gameSettings.fancyGraphics) { -+ -+ if (this.mc.gameSettings.fancyGraphics) { - this.mc.mcProfiler.endStartSection("water"); -- if(this.mc.gameSettings.ambientOcclusion != 0) { -+ -+ -+ // Spout Start -+ if (RenderPass.setAmbientOcclusion(this.mc.gameSettings.ambientOcclusion >= 2)) { -+ // Spout End - GL11.glShadeModel(GL11.GL_SMOOTH); - } - - GL11.glColorMask(false, false, false, false); -- int var18 = var5.sortAndRender(var4, 1, (double)var1); -- if(this.mc.gameSettings.anaglyph) { -- if(anaglyphField == 0) { -+ int var18 = var5.sortAndRender(var4, 1, (double)par1); -+ -+ if (this.mc.gameSettings.anaglyph) { -+ if (anaglyphField == 0) { - GL11.glColorMask(false, true, true, true); - } else { - GL11.glColorMask(true, false, false, true); -@@ -850,46 +1129,53 @@ - GL11.glColorMask(true, true, true, true); - } - -- if(var18 > 0) { -- var5.renderAllRenderLists(1, (double)var1); -+ if (var18 > 0) { -+ var5.renderAllRenderLists(1, (double)par1); - } - - GL11.glShadeModel(GL11.GL_FLAT); - } else { - this.mc.mcProfiler.endStartSection("water"); -- var5.sortAndRender(var4, 1, (double)var1); -+ var5.sortAndRender(var4, 1, (double)par1); - } - -+ // MCPatcher Start -+ this.renderRainSnow(par1); -+ RenderPass.doRenderPass(var5, var4, 3, (double)par1); -+ // MCPatcher End - GL11.glDepthMask(true); - GL11.glEnable(GL11.GL_CULL_FACE); - GL11.glDisable(GL11.GL_BLEND); -- if(this.cameraZoom == 1.0D && var4 instanceof EntityPlayer && !this.mc.gameSettings.hideGUI && this.mc.objectMouseOver != null && !var4.isInsideOfMaterial(Material.water)) { -+ -+ if (this.cameraZoom == 1.0D && var4 instanceof EntityPlayer && !this.mc.gameSettings.hideGUI && this.mc.objectMouseOver != null && !var4.isInsideOfMaterial(Material.water)) { - var17 = (EntityPlayer)var4; - GL11.glDisable(GL11.GL_ALPHA_TEST); - this.mc.mcProfiler.endStartSection("outline"); -- var5.drawSelectionBox(var17, this.mc.objectMouseOver, 0, var1); -+ var5.drawSelectionBox(var17, this.mc.objectMouseOver, 0, par1); - GL11.glEnable(GL11.GL_ALPHA_TEST); - } - - this.mc.mcProfiler.endStartSection("destroyProgress"); - GL11.glEnable(GL11.GL_BLEND); - GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE); -- var5.drawBlockDamageTexture(Tessellator.instance, (EntityPlayer)var4, var1); -+ var5.drawBlockDamageTexture(Tessellator.instance, (EntityPlayer)var4, par1); - GL11.glDisable(GL11.GL_BLEND); - this.mc.mcProfiler.endStartSection("weather"); -- this.renderRainSnow(var1); -+ this.renderRainSnow(par1); - GL11.glDisable(GL11.GL_FOG); -- if(var4.posY >= 128.0D) { -- this.renderCloudsCheck(var5, var1); -+ -+ if (var4.posY >= 128.0D) { -+ this.renderCloudsCheck(var5, par1); - } - - this.mc.mcProfiler.endStartSection("hand"); -- if(this.cameraZoom == 1.0D) { -+ -+ if (this.cameraZoom == 1.0D) { - GL11.glClear(GL11.GL_DEPTH_BUFFER_BIT); -- this.renderHand(var1, var13); -+ this.renderHand(par1, var13); - } - -- if(!this.mc.gameSettings.anaglyph) { -+ if (!this.mc.gameSettings.anaglyph) { - this.mc.mcProfiler.endSection(); - return; - } -@@ -899,28 +1185,43 @@ - this.mc.mcProfiler.endSection(); - } - -- private void renderCloudsCheck(RenderGlobal var1, float var2) { -- if(this.mc.gameSettings.shouldRenderClouds()) { -+ /** -+ * Render clouds if enabled -+ */ -+ private void renderCloudsCheck(RenderGlobal par1RenderGlobal, float par2) { -+ if (this.mc.gameSettings.shouldRenderClouds()) { - this.mc.mcProfiler.endStartSection("clouds"); - GL11.glPushMatrix(); -- this.setupFog(0, var2); -+ this.setupFog(0, par2); - GL11.glEnable(GL11.GL_FOG); -- var1.renderClouds(var2); -+ par1RenderGlobal.renderClouds(par2); - GL11.glDisable(GL11.GL_FOG); -- this.setupFog(1, var2); -+ this.setupFog(1, par2); - GL11.glPopMatrix(); - } -- - } - - private void addRainParticles() { - float var1 = this.mc.theWorld.getRainStrength(1.0F); -- if(!this.mc.gameSettings.fancyGraphics) { -- var1 /= 2.0F; -- } -- -- if(var1 != 0.0F) { -- this.ae.setSeed((long)this.rendererUpdateCount * 312987231L); -+ -+ // Spout Start -+ if (!Configuration.isWeather()) { -+ return; -+ } -+ if (SpoutWorth.getInstance().isBelowIdeal()) { -+ var1 /= 4.0F; -+ } -+ if (!Configuration.isFancyWeather()) { -+ var1 /= 2.0F; -+ } -+ // Spout End -+ -+ if (!this.mc.gameSettings.fancyGraphics) { -+ var1 /= 2.0F; -+ } -+ -+ if (var1 != 0.0F) { -+ this.random.setSeed((long)this.rendererUpdateCount * 312987231L); - EntityLivingBase var2 = this.mc.renderViewEntity; - WorldClient var3 = this.mc.theWorld; - int var4 = MathHelper.floor_double(var2.posX); -@@ -932,27 +1233,31 @@ - double var12 = 0.0D; - int var14 = 0; - int var15 = (int)(100.0F * var1 * var1); -- if(this.mc.gameSettings.particleSetting == 1) { -+ -+ if (this.mc.gameSettings.particleSetting == 1) { - var15 >>= 1; -- } else if(this.mc.gameSettings.particleSetting == 2) { -+ } else if (this.mc.gameSettings.particleSetting == 2) { - var15 = 0; - } - -- for(int var16 = 0; var16 < var15; ++var16) { -- int var17 = var4 + this.ae.nextInt(var7) - this.ae.nextInt(var7); -- int var18 = var6 + this.ae.nextInt(var7) - this.ae.nextInt(var7); -+ for (int var16 = 0; var16 < var15; ++var16) { -+ int var17 = var4 + this.random.nextInt(var7) - this.random.nextInt(var7); -+ int var18 = var6 + this.random.nextInt(var7) - this.random.nextInt(var7); - int var19 = var3.getPrecipitationHeight(var17, var18); - int var20 = var3.getBlockId(var17, var19 - 1, var18); - BiomeGenBase var21 = var3.getBiomeGenForCoords(var17, var18); -- if(var19 <= var5 + var7 && var19 >= var5 - var7 && var21.canSpawnLightningBolt() && var21.getFloatTemperature() >= 0.2F) { -- float var22 = this.ae.nextFloat(); -- float var23 = this.ae.nextFloat(); -- if(var20 > 0) { -- if(Block.blocksList[var20].blockMaterial == Material.lava) { -+ -+ if (var19 <= var5 + var7 && var19 >= var5 - var7 && var21.canSpawnLightningBolt() && var21.getFloatTemperature() >= 0.2F) { -+ float var22 = this.random.nextFloat(); -+ float var23 = this.random.nextFloat(); -+ -+ if (var20 > 0) { -+ if (Block.blocksList[var20].blockMaterial == Material.lava) { - this.mc.effectRenderer.addEffect(new EntitySmokeFX(var3, (double)((float)var17 + var22), (double)((float)var19 + 0.1F) - Block.blocksList[var20].getBlockBoundsMinY(), (double)((float)var18 + var23), 0.0D, 0.0D, 0.0D)); - } else { - ++var14; -- if(this.ae.nextInt(var14) == 0) { -+ -+ if (this.random.nextInt(var14) == 0) { - var8 = (double)((float)var17 + var22); - var10 = (double)((float)var19 + 0.1F) - Block.blocksList[var20].getBlockBoundsMinY(); - var12 = (double)((float)var18 + var23); -@@ -964,28 +1269,38 @@ - } - } - -- if(var14 > 0 && this.ae.nextInt(3) < this.rainSoundCounter++) { -+ if (var14 > 0 && this.random.nextInt(3) < this.rainSoundCounter++) { - this.rainSoundCounter = 0; -- if(var10 > var2.posY + 1.0D && var3.getPrecipitationHeight(MathHelper.floor_double(var2.posX), MathHelper.floor_double(var2.posZ)) > MathHelper.floor_double(var2.posY)) { -+ -+ if (var10 > var2.posY + 1.0D && var3.getPrecipitationHeight(MathHelper.floor_double(var2.posX), MathHelper.floor_double(var2.posZ)) > MathHelper.floor_double(var2.posY)) { - this.mc.theWorld.playSound(var8, var10, var12, "ambient.weather.rain", 0.1F, 0.5F, false); - } else { - this.mc.theWorld.playSound(var8, var10, var12, "ambient.weather.rain", 0.2F, 1.0F, false); - } - } -- - } - } - -- protected void renderRainSnow(float var1) { -- float var2 = this.mc.theWorld.getRainStrength(var1); -- if(var2 > 0.0F) { -- this.enableLightmap((double)var1); -- if(this.rainXCoords == null) { -+ /** -+ * Render rain and snow -+ */ -+ protected void renderRainSnow(float par1) { -+ // Spout Start -+ if (!Configuration.isWeather()) { -+ return; -+ } -+ // Spout End -+ float var2 = this.mc.theWorld.getRainStrength(par1); -+ -+ if (var2 > 0.0F) { -+ this.enableLightmap((double)par1); -+ -+ if (this.rainXCoords == null) { - this.rainXCoords = new float[1024]; - this.rainYCoords = new float[1024]; - -- for(int var3 = 0; var3 < 32; ++var3) { -- for(int var4 = 0; var4 < 32; ++var4) { -+ for (int var3 = 0; var3 < 32; ++var3) { -+ for (int var4 = 0; var4 < 32; ++var4) { - float var5 = (float)(var4 - 16); - float var6 = (float)(var3 - 16); - float var7 = MathHelper.sqrt_float(var5 * var5 + var6 * var6); -@@ -1006,58 +1321,66 @@ - GL11.glEnable(GL11.GL_BLEND); - GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); - GL11.glAlphaFunc(GL11.GL_GREATER, 0.01F); -- this.mc.getTextureManager().bindTexture(locationSnowPng); -- double var9 = var41.lastTickPosX + (var41.posX - var41.lastTickPosX) * (double)var1; -- double var11 = var41.lastTickPosY + (var41.posY - var41.lastTickPosY) * (double)var1; -- double var13 = var41.lastTickPosZ + (var41.posZ - var41.lastTickPosZ) * (double)var1; -+ this.mc.getTextureManager().bindTexture(locationSnowPng); -+ double var9 = var41.lastTickPosX + (var41.posX - var41.lastTickPosX) * (double)par1; -+ double var11 = var41.lastTickPosY + (var41.posY - var41.lastTickPosY) * (double)par1; -+ double var13 = var41.lastTickPosZ + (var41.posZ - var41.lastTickPosZ) * (double)par1; - int var15 = MathHelper.floor_double(var11); - byte var16 = 5; -- if(this.mc.gameSettings.fancyGraphics) { -+ -+ // Spout Start -+ if (Configuration.isFancyWeather()) { -+ // Spout End - var16 = 10; - } - - boolean var17 = false; - byte var18 = -1; -- float var19 = (float)this.rendererUpdateCount + var1; -- if(this.mc.gameSettings.fancyGraphics) { -+ float var19 = (float)this.rendererUpdateCount + par1; -+ -+ if (this.mc.gameSettings.fancyGraphics) { - var16 = 10; - } - - GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - var17 = false; - -- for(int var20 = var45 - var16; var20 <= var45 + var16; ++var20) { -- for(int var21 = var43 - var16; var21 <= var43 + var16; ++var21) { -+ for (int var20 = var45 - var16; var20 <= var45 + var16; ++var20) { -+ for (int var21 = var43 - var16; var21 <= var43 + var16; ++var21) { - int var22 = (var20 - var45 + 16) * 32 + var21 - var43 + 16; - float var23 = this.rainXCoords[var22] * 0.5F; - float var24 = this.rainYCoords[var22] * 0.5F; - BiomeGenBase var25 = var42.getBiomeGenForCoords(var21, var20); -- if(var25.canSpawnLightningBolt() || var25.getEnableSnow()) { -+ -+ if (var25.canSpawnLightningBolt() || var25.getEnableSnow()) { - int var26 = var42.getPrecipitationHeight(var21, var20); - int var27 = var44 - var16; - int var28 = var44 + var16; -- if(var27 < var26) { -+ -+ if (var27 < var26) { - var27 = var26; - } - -- if(var28 < var26) { -+ if (var28 < var26) { - var28 = var26; - } - - float var29 = 1.0F; - int var30 = var26; -- if(var26 < var15) { -+ -+ if (var26 < var15) { - var30 = var15; - } - -- if(var27 != var28) { -- this.ae.setSeed((long)(var21 * var21 * 3121 + var21 * 45238971 ^ var20 * var20 * 418711 + var20 * 13761)); -+ if (var27 != var28) { -+ this.random.setSeed((long)(var21 * var21 * 3121 + var21 * 45238971 ^ var20 * var20 * 418711 + var20 * 13761)); - float var31 = var25.getFloatTemperature(); -- float var32; - double var35; -- if(var42.getWorldChunkManager().getTemperatureAtHeight(var31, var26) >= 0.15F) { -- if(var18 != 0) { -- if(var18 >= 0) { -+ float var32; -+ -+ if (var42.getWorldChunkManager().getTemperatureAtHeight(var31, var26) >= 0.15F) { -+ if (var18 != 0) { -+ if (var18 >= 0) { - var8.draw(); - } - -@@ -1066,7 +1389,7 @@ - var8.startDrawingQuads(); - } - -- var32 = ((float)(this.rendererUpdateCount + var21 * var21 * 3121 + var21 * 45238971 + var20 * var20 * 418711 + var20 * 13761 & 31) + var1) / 32.0F * (3.0F + this.ae.nextFloat()); -+ var32 = ((float)(this.rendererUpdateCount + var21 * var21 * 3121 + var21 * 45238971 + var20 * var20 * 418711 + var20 * 13761 & 31) + par1) / 32.0F * (3.0F + this.random.nextFloat()); - double var33 = (double)((float)var21 + 0.5F) - var41.posX; - var35 = (double)((float)var20 + 0.5F) - var41.posZ; - float var37 = MathHelper.sqrt_double(var33 * var33 + var35 * var35) / (float)var16; -@@ -1080,8 +1403,8 @@ - var8.addVertexWithUV((double)((float)var21 - var23) + 0.5D, (double)var28, (double)((float)var20 - var24) + 0.5D, (double)(0.0F * var29), (double)((float)var28 * var29 / 4.0F + var32 * var29)); - var8.setTranslation(0.0D, 0.0D, 0.0D); - } else { -- if(var18 != 1) { -- if(var18 >= 0) { -+ if (var18 != 1) { -+ if (var18 >= 0) { - var8.draw(); - } - -@@ -1090,9 +1413,9 @@ - var8.startDrawingQuads(); - } - -- var32 = ((float)(this.rendererUpdateCount & 511) + var1) / 512.0F; -- float var46 = this.ae.nextFloat() + var19 * 0.01F * (float)this.ae.nextGaussian(); -- float var34 = this.ae.nextFloat() + var19 * (float)this.ae.nextGaussian() * 0.001F; -+ var32 = ((float)(this.rendererUpdateCount & 511) + par1) / 512.0F; -+ float var46 = this.random.nextFloat() + var19 * 0.01F * (float)this.random.nextGaussian(); -+ float var34 = this.random.nextFloat() + var19 * (float)this.random.nextGaussian() * 0.001F; - var35 = (double)((float)var21 + 0.5F) - var41.posX; - double var47 = (double)((float)var20 + 0.5F) - var41.posZ; - float var39 = MathHelper.sqrt_double(var35 * var35 + var47 * var47) / (float)var16; -@@ -1111,17 +1434,20 @@ - } - } - -- if(var18 >= 0) { -+ if (var18 >= 0) { - var8.draw(); - } - - GL11.glEnable(GL11.GL_CULL_FACE); - GL11.glDisable(GL11.GL_BLEND); - GL11.glAlphaFunc(GL11.GL_GREATER, 0.1F); -- this.disableLightmap((double)var1); -+ this.disableLightmap((double)par1); - } - } - -+ /** -+ * Setup orthogonal projection for rendering GUI screen overlays -+ */ - public void setupOverlayRendering() { - ScaledResolution var1 = new ScaledResolution(this.mc.gameSettings, this.mc.displayWidth, this.mc.displayHeight); - GL11.glClear(GL11.GL_DEPTH_BUFFER_BIT); -@@ -1133,30 +1459,46 @@ - GL11.glTranslatef(0.0F, 0.0F, -2000.0F); - } - -- private void updateFogColor(float var1) { -+ /** -+ * calculates fog and calls glClearColor -+ */ -+ private void updateFogColor(float par1) { - WorldClient var2 = this.mc.theWorld; - EntityLivingBase var3 = this.mc.renderViewEntity; - float var4 = 1.0F / (float)(4 - this.mc.gameSettings.renderDistance); -+ // MCPatcher Start -+ ColorizeWorld.setupForFog(var3); -+ -+ if (ColorizeWorld.computeFogColor(var2, par1)) { -+ this.fogColorRed = Colorizer.setColor[0]; -+ this.fogColorGreen = Colorizer.setColor[1]; -+ this.fogColorBlue = Colorizer.setColor[2]; -+ } -+ // MCPatcher End -+ - var4 = 1.0F - (float)Math.pow((double)var4, 0.25D); -- Vec3 var5 = var2.getSkyColor(this.mc.renderViewEntity, var1); -+ Vec3 var5 = var2.getSkyColor(this.mc.renderViewEntity, par1); - float var6 = (float)var5.xCoord; - float var7 = (float)var5.yCoord; - float var8 = (float)var5.zCoord; -- Vec3 var9 = var2.getFogColor(var1); -+ Vec3 var9 = var2.getFogColor(par1); - this.fogColorRed = (float)var9.xCoord; - this.fogColorGreen = (float)var9.yCoord; - this.fogColorBlue = (float)var9.zCoord; - float var11; -- if(this.mc.gameSettings.renderDistance < 2) { -- Vec3 var10 = MathHelper.sin(var2.getCelestialAngleRadians(var1)) > 0.0F ? var2.getWorldVec3Pool().getVecFromPool(-1.0D, 0.0D, 0.0D) : var2.getWorldVec3Pool().getVecFromPool(1.0D, 0.0D, 0.0D); -- var11 = (float)var3.getLook(var1).dotProduct(var10); -- if(var11 < 0.0F) { -+ -+ if (this.mc.gameSettings.renderDistance < 2) { -+ Vec3 var10 = MathHelper.sin(var2.getCelestialAngleRadians(par1)) > 0.0F ? var2.getWorldVec3Pool().getVecFromPool(-1.0D, 0.0D, 0.0D) : var2.getWorldVec3Pool().getVecFromPool(1.0D, 0.0D, 0.0D); -+ var11 = (float)var3.getLook(par1).dotProduct(var10); -+ -+ if (var11 < 0.0F) { - var11 = 0.0F; - } - -- if(var11 > 0.0F) { -- float[] var12 = var2.provider.calcSunriseSunsetColors(var2.getCelestialAngle(var1), var1); -- if(var12 != null) { -+ if (var11 > 0.0F) { -+ float[] var12 = var2.provider.calcSunriseSunsetColors(var2.getCelestialAngle(par1), par1); -+ -+ if (var12 != null) { - var11 *= var12[3]; - this.fogColorRed = this.fogColorRed * (1.0F - var11) + var12[0] * var11; - this.fogColorGreen = this.fogColorGreen * (1.0F - var11) + var12[1] * var11; -@@ -1168,9 +1510,10 @@ - this.fogColorRed += (var6 - this.fogColorRed) * var4; - this.fogColorGreen += (var7 - this.fogColorGreen) * var4; - this.fogColorBlue += (var8 - this.fogColorBlue) * var4; -- float var19 = var2.getRainStrength(var1); -+ float var19 = var2.getRainStrength(par1); - float var20; -- if(var19 > 0.0F) { -+ -+ if (var19 > 0.0F) { - var11 = 1.0F - var19 * 0.5F; - var20 = 1.0F - var19 * 0.4F; - this.fogColorRed *= var11; -@@ -1178,48 +1521,58 @@ - this.fogColorBlue *= var20; - } - -- var11 = var2.getWeightedThunderStrength(var1); -- if(var11 > 0.0F) { -+ var11 = var2.getWeightedThunderStrength(par1); -+ -+ if (var11 > 0.0F) { - var20 = 1.0F - var11 * 0.5F; - this.fogColorRed *= var20; - this.fogColorGreen *= var20; - this.fogColorBlue *= var20; - } - -- int var21 = ActiveRenderInfo.getBlockIdAtEntityViewpoint(this.mc.theWorld, var3, var1); -+ int var21 = ActiveRenderInfo.getBlockIdAtEntityViewpoint(this.mc.theWorld, var3, par1); - float var22; -- if(this.cloudFog) { -- Vec3 var13 = var2.getCloudColour(var1); -+ -+ if (this.cloudFog) { -+ Vec3 var13 = var2.getCloudColour(par1); - this.fogColorRed = (float)var13.xCoord; - this.fogColorGreen = (float)var13.yCoord; - this.fogColorBlue = (float)var13.zCoord; -- } else if(var21 != 0 && Block.blocksList[var21].blockMaterial == Material.water) { -+ } else if (var21 != 0 && Block.blocksList[var21].blockMaterial == Material.water) { - var22 = (float)EnchantmentHelper.getRespiration(var3) * 0.2F; - this.fogColorRed = 0.02F + var22; - this.fogColorGreen = 0.02F + var22; - this.fogColorBlue = 0.2F + var22; -- } else if(var21 != 0 && Block.blocksList[var21].blockMaterial == Material.lava) { -+ -+ if (ColorizeWorld.computeFogColor(Colorizer.COLOR_MAP_UNDERWATER)) { -+ this.fogColorRed = Colorizer.setColor[0] + var22; -+ this.fogColorGreen = Colorizer.setColor[1] + var22; -+ this.fogColorBlue = Colorizer.setColor[2] + var22; -+ } -+ } else if (var21 != 0 && Block.blocksList[var21].blockMaterial == Material.lava) { - this.fogColorRed = 0.6F; - this.fogColorGreen = 0.1F; - this.fogColorBlue = 0.0F; - } - -- var22 = this.fogColor2 + (this.fogColor1 - this.fogColor2) * var1; -+ var22 = this.fogColor2 + (this.fogColor1 - this.fogColor2) * par1; - this.fogColorRed *= var22; - this.fogColorGreen *= var22; - this.fogColorBlue *= var22; -- double var14 = (var3.lastTickPosY + (var3.posY - var3.lastTickPosY) * (double)var1) * var2.provider.getVoidFogYFactor(); -- if(var3.isPotionActive(Potion.blindness)) { -+ double var14 = (var3.lastTickPosY + (var3.posY - var3.lastTickPosY) * (double)par1) * var2.provider.getVoidFogYFactor(); -+ -+ if (var3.isPotionActive(Potion.blindness)) { - int var16 = var3.getActivePotionEffect(Potion.blindness).getDuration(); -- if(var16 < 20) { -+ -+ if (var16 < 20) { - var14 *= (double)(1.0F - (float)var16 / 20.0F); - } else { - var14 = 0.0D; - } - } - -- if(var14 < 1.0D) { -- if(var14 < 0.0D) { -+ if (var14 < 1.0D) { -+ if (var14 < 0.0D) { - var14 = 0.0D; - } - -@@ -1230,22 +1583,25 @@ - } - - float var23; -- if(this.field_82831_U > 0.0F) { -- var23 = this.field_82832_V + (this.field_82831_U - this.field_82832_V) * var1; -+ -+ if (this.field_82831_U > 0.0F) { -+ var23 = this.field_82832_V + (this.field_82831_U - this.field_82832_V) * par1; - this.fogColorRed = this.fogColorRed * (1.0F - var23) + this.fogColorRed * 0.7F * var23; - this.fogColorGreen = this.fogColorGreen * (1.0F - var23) + this.fogColorGreen * 0.6F * var23; - this.fogColorBlue = this.fogColorBlue * (1.0F - var23) + this.fogColorBlue * 0.6F * var23; - } - - float var17; -- if(var3.isPotionActive(Potion.nightVision)) { -- var23 = this.getNightVisionBrightness(this.mc.thePlayer, var1); -+ -+ if (var3.isPotionActive(Potion.nightVision)) { -+ var23 = this.getNightVisionBrightness(this.mc.thePlayer, par1); - var17 = 1.0F / this.fogColorRed; -- if(var17 > 1.0F / this.fogColorGreen) { -+ -+ if (var17 > 1.0F / this.fogColorGreen) { - var17 = 1.0F / this.fogColorGreen; - } - -- if(var17 > 1.0F / this.fogColorBlue) { -+ if (var17 > 1.0F / this.fogColorBlue) { - var17 = 1.0F / this.fogColorBlue; - } - -@@ -1254,7 +1610,7 @@ - this.fogColorBlue = this.fogColorBlue * (1.0F - var23) + this.fogColorBlue * var17 * var23; - } - -- if(this.mc.gameSettings.anaglyph) { -+ if (this.mc.gameSettings.anaglyph) { - var23 = (this.fogColorRed * 30.0F + this.fogColorGreen * 59.0F + this.fogColorBlue * 11.0F) / 100.0F; - var17 = (this.fogColorRed * 30.0F + this.fogColorGreen * 70.0F) / 100.0F; - float var18 = (this.fogColorRed * 30.0F + this.fogColorBlue * 70.0F) / 100.0F; -@@ -1266,20 +1622,27 @@ - GL11.glClearColor(this.fogColorRed, this.fogColorGreen, this.fogColorBlue, 0.0F); - } - -- private void setupFog(int var1, float var2) { -+ /** -+ * Sets up the fog to be rendered. If the arg passed in is -1 the fog starts at 0 and goes to 80% of far plane distance -+ * and is used for sky rendering. -+ */ -+ -+ private void setupFog(int par1, float par2) { - EntityLivingBase var3 = this.mc.renderViewEntity; - boolean var4 = false; -- if(var3 instanceof EntityPlayer) { -+ -+ if (var3 instanceof EntityPlayer) { - var4 = ((EntityPlayer)var3).capabilities.isCreativeMode; - } - -- if(var1 == 999) { -+ if (par1 == 999) { - GL11.glFog(GL11.GL_FOG_COLOR, this.setFogColorBuffer(0.0F, 0.0F, 0.0F, 1.0F)); - GL11.glFogi(GL11.GL_FOG_MODE, GL11.GL_LINEAR); - GL11.glFogf(GL11.GL_FOG_START, 0.0F); - GL11.glFogf(GL11.GL_FOG_END, 8.0F); -- if(GLContext.getCapabilities().GL_NV_fog_distance) { -- GL11.glFogi(NVFogDistance.GL_FOG_DISTANCE_MODE_NV, NVFogDistance.GL_EYE_RADIAL_NV); -+ -+ if (GLContext.getCapabilities().GL_NV_fog_distance) { -+ GL11.glFogi(34138, 34139); - } - - GL11.glFogf(GL11.GL_FOG_START, 0.0F); -@@ -1287,17 +1650,20 @@ - GL11.glFog(GL11.GL_FOG_COLOR, this.setFogColorBuffer(this.fogColorRed, this.fogColorGreen, this.fogColorBlue, 1.0F)); - GL11.glNormal3f(0.0F, -1.0F, 0.0F); - GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); -- int var5 = ActiveRenderInfo.getBlockIdAtEntityViewpoint(this.mc.theWorld, var3, var2); -+ int var5 = ActiveRenderInfo.getBlockIdAtEntityViewpoint(this.mc.theWorld, var3, par2); - float var6; -- if(var3.isPotionActive(Potion.blindness)) { -+ -+ if (var3.isPotionActive(Potion.blindness)) { - var6 = 5.0F; - int var7 = var3.getActivePotionEffect(Potion.blindness).getDuration(); -- if(var7 < 20) { -+ -+ if (var7 < 20) { - var6 = 5.0F + (this.farPlaneDistance - 5.0F) * (1.0F - (float)var7 / 20.0F); - } - - GL11.glFogi(GL11.GL_FOG_MODE, GL11.GL_LINEAR); -- if(var1 < 0) { -+ -+ if (par1 < 0) { - GL11.glFogf(GL11.GL_FOG_START, 0.0F); - GL11.glFogf(GL11.GL_FOG_END, var6 * 0.8F); - } else { -@@ -1305,59 +1671,127 @@ - GL11.glFogf(GL11.GL_FOG_END, var6); - } - -- if(GLContext.getCapabilities().GL_NV_fog_distance) { -- GL11.glFogi(NVFogDistance.GL_FOG_DISTANCE_MODE_NV, NVFogDistance.GL_EYE_RADIAL_NV); -- } -- } else if(this.cloudFog) { -- GL11.glFogi(GL11.GL_FOG_MODE, GL11.GL_EXP); -- GL11.glFogf(GL11.GL_FOG_DENSITY, 0.1F); -- } else if(var5 > 0 && Block.blocksList[var5].blockMaterial == Material.water) { -- GL11.glFogi(GL11.GL_FOG_MODE, GL11.GL_EXP); -- if(var3.isPotionActive(Potion.waterBreathing)) { -- GL11.glFogf(GL11.GL_FOG_DENSITY, 0.05F); -- } else { -- GL11.glFogf(GL11.GL_FOG_DENSITY, 0.1F - (float)EnchantmentHelper.getRespiration(var3) * 0.03F); -- } -- } else if(var5 > 0 && Block.blocksList[var5].blockMaterial == Material.lava) { -- GL11.glFogi(GL11.GL_FOG_MODE, GL11.GL_EXP); -- GL11.glFogf(GL11.GL_FOG_DENSITY, 2.0F); -+ if (GLContext.getCapabilities().GL_NV_fog_distance) { -+ GL11.glFogi(34138, 34139); -+ } - } else { -- var6 = this.farPlaneDistance; -- if(this.mc.theWorld.provider.getWorldHasVoidParticles() && !var4) { -- double var10 = (double)((var3.getBrightnessForRender(var2) & 15728640) >> 20) / 16.0D + (var3.lastTickPosY + (var3.posY - var3.lastTickPosY) * (double)var2 + 4.0D) / 32.0D; -- if(var10 < 1.0D) { -- if(var10 < 0.0D) { -- var10 = 0.0D; -- } -- -- var10 *= var10; -- float var9 = 100.0F * (float)var10; -- if(var9 < 5.0F) { -- var9 = 5.0F; -- } -- -- if(var6 > var9) { -- var6 = var9; -- } -- } -- } -- -- GL11.glFogi(GL11.GL_FOG_MODE, GL11.GL_LINEAR); -- if(var1 < 0) { -- GL11.glFogf(GL11.GL_FOG_START, 0.0F); -- GL11.glFogf(GL11.GL_FOG_END, var6 * 0.8F); -+ float var8; -+ float var9; -+ float var10; -+ float var11; -+ float var12; -+ -+ if (this.cloudFog) { -+ GL11.glFogi(GL11.GL_FOG_MODE, GL11.GL_EXP); -+ // Spout Start -+ float density = 0.1F; -+ if (var3.isPotionActive(Potion.waterBreathing)) { -+ density = 0.05F; -+ } -+ if (Configuration.isClearWater()) { -+ density = 0.02F; -+ } -+ GL11.glFogf(GL11.GL_FOG_DENSITY, density); -+ // Spout End -+ GL11.glFogf(GL11.GL_FOG_DENSITY, 0.1F); -+ var6 = 1.0F; -+ var12 = 1.0F; -+ var8 = 1.0F; -+ -+ if (this.mc.gameSettings.anaglyph) { -+ var9 = (var6 * 30.0F + var12 * 59.0F + var8 * 11.0F) / 100.0F; -+ var10 = (var6 * 30.0F + var12 * 70.0F) / 100.0F; -+ var11 = (var6 * 30.0F + var8 * 70.0F) / 100.0F; -+ } -+ } else if (var5 > 0 && Block.blocksList[var5].blockMaterial == Material.water) { -+ GL11.glFogi(GL11.GL_FOG_MODE, GL11.GL_EXP); -+ // Spout Start -+ float density = 0.1F; -+ if (Configuration.isClearWater() || (var3.isPotionActive(Potion.waterBreathing))) { -+ density = 0.05F; -+ } else { -+ density = 0.1F; -+ } -+ GL11.glFogf(GL11.GL_FOG_DENSITY, density); -+ // Spout End -+ var6 = 0.4F; -+ var12 = 0.4F; -+ var8 = 0.9F; -+ -+ if (this.mc.gameSettings.anaglyph) { -+ var9 = (var6 * 30.0F + var12 * 59.0F + var8 * 11.0F) / 100.0F; -+ var10 = (var6 * 30.0F + var12 * 70.0F) / 100.0F; -+ var11 = (var6 * 30.0F + var8 * 70.0F) / 100.0F; -+ } -+ } else if (var5 > 0 && Block.blocksList[var5].blockMaterial == Material.lava) { -+ GL11.glFogi(GL11.GL_FOG_MODE, GL11.GL_EXP); -+ GL11.glFogf(GL11.GL_FOG_DENSITY, 2.0F); -+ var6 = 0.4F; -+ var12 = 0.3F; -+ var8 = 0.3F; -+ -+ if (this.mc.gameSettings.anaglyph) { -+ var9 = (var6 * 30.0F + var12 * 59.0F + var8 * 11.0F) / 100.0F; -+ var10 = (var6 * 30.0F + var12 * 70.0F) / 100.0F; -+ var11 = (var6 * 30.0F + var8 * 70.0F) / 100.0F; -+ } - } else { -- GL11.glFogf(GL11.GL_FOG_START, var6 * 0.25F); -- GL11.glFogf(GL11.GL_FOG_END, var6); -- } -- -- if(GLContext.getCapabilities().GL_NV_fog_distance) { -- GL11.glFogi(NVFogDistance.GL_FOG_DISTANCE_MODE_NV, NVFogDistance.GL_EYE_RADIAL_NV); -- } -- -- if(this.mc.theWorld.provider.doesXZShowFog((int)var3.posX, (int)var3.posZ)) { -- GL11.glFogf(GL11.GL_FOG_START, var6 * 0.05F); -- GL11.glFogf(GL11.GL_FOG_END, Math.min(var6, 192.0F) * 0.5F); -+ var6 = this.farPlaneDistance; -+ -+ if (this.mc.theWorld.provider.getWorldHasVoidParticles() && !var4) { -+ double var13 = (double)((var3.getBrightnessForRender(par2) & 15728640) >> 20) / 16.0D + (var3.lastTickPosY + (var3.posY - var3.lastTickPosY) * (double)par2 + 4.0D) / 32.0D; -+ -+ if (var13 < 1.0D) { -+ if (var13 < 0.0D) { -+ var13 = 0.0D; -+ } -+ -+ var13 *= var13; -+ var9 = 100.0F * (float)var13; -+ -+ if (var9 < 5.0F) { -+ var9 = 5.0F; -+ } -+ -+ if (var6 > var9) { -+ var6 = var9; -+ } -+ } -+ } -+ -+ // Spout Start -+ if (!Configuration.isVoidFog()) { -+ var6 = 0.8F * this.farPlaneDistance; -+ var12 = this.farPlaneDistance; -+ } -+ // Spout End -+ -+ GL11.glFogi(GL11.GL_FOG_MODE, GL11.GL_LINEAR); -+ -+ if (par1 < 0) { -+ GL11.glFogf(GL11.GL_FOG_START, 0.0F); -+ GL11.glFogf(GL11.GL_FOG_END, var6 * 0.8F); -+ } else { -+ GL11.glFogf(GL11.GL_FOG_START, var6 * 0.25F); -+ GL11.glFogf(GL11.GL_FOG_END, var6); -+ } -+ -+ if (GLContext.getCapabilities().GL_NV_fog_distance) { -+ // Spout Start -+ //TODO: Previous fog calculation may work better. -+ //GL11.glFogi(34138, 34139); -+ if (Configuration.isFancyFog()) { -+ GL11.glFogi('\u855a', '\u855b'); -+ } else { -+ GL11.glFogi('\u855a', '\u855c'); -+ } -+ // Spout End -+ } -+ -+ if (this.mc.theWorld.provider.doesXZShowFog((int)var3.posX, (int)var3.posZ)) { -+ GL11.glFogf(GL11.GL_FOG_START, var6 * 0.05F); -+ GL11.glFogf(GL11.GL_FOG_END, Math.min(var6, 192.0F) * 0.5F); -+ } - } - } - -@@ -1366,27 +1800,43 @@ - } - } - -- private FloatBuffer setFogColorBuffer(float var1, float var2, float var3, float var4) { -- this.j.clear(); -- this.j.put(var1).put(var2).put(var3).put(var4); -- this.j.flip(); -- return this.j; -+ /** -+ * Update and return fogColorBuffer with the RGBA values passed as arguments -+ */ -+ private FloatBuffer setFogColorBuffer(float par1, float par2, float par3, float par4) { -+ this.fogColorBuffer.clear(); -+ this.fogColorBuffer.put(par1).put(par2).put(par3).put(par4); -+ this.fogColorBuffer.flip(); -+ return this.fogColorBuffer; - } - -- public static int performanceToFps(int var0) { -+ /** -+ * Converts performance value (0-2) to FPS (35-200) -+ */ -+ public static int performanceToFps(int par0) { - short var1 = 200; -- if(var0 == 1) { -+ -+ if (par0 == 1) { - var1 = 120; - } - -- if(var0 == 2) { -+ if (par0 == 2) { - var1 = 35; - } - - return var1; - } - -- static Minecraft getRendererMinecraft(EntityRenderer var0) { -- return var0.mc; -- } -+ /** -+ * Get minecraft reference from the EntityRenderer -+ */ -+ static Minecraft getRendererMinecraft(EntityRenderer par0EntityRenderer) { -+ return par0EntityRenderer.mc; -+ } -+ -+ // MCPatcher Start -+ public float getNightVisionStrength(float var1) { -+ return this.mc.thePlayer.isPotionActive(Potion.nightVision) ? this.getNightVisionBrightness(this.mc.thePlayer, var1) : 0.0F; -+ } -+ // MCPatcher End - } ---- net/minecraft/src/CallableStructureType.java -+++ net/minecraft/src/CallableStructureType.java -@@ -5,8 +5,8 @@ - class CallableStructureType implements Callable { - final MapGenStructure theMapStructureGenerator; - -- CallableStructureType(MapGenStructure var1) { -- this.theMapStructureGenerator = var1; -+ CallableStructureType(MapGenStructure par1MapGenStructure) { -+ this.theMapStructureGenerator = par1MapGenStructure; - } - - public String callStructureType() { ---- /dev/null -+++ org/spoutcraft/client/gui/server/GuiServerInfo.java -@@ -1,0 +1,535 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.client.gui.server; -+ -+import java.io.BufferedReader; -+import java.io.IOException; -+import java.io.InputStreamReader; -+import java.io.UnsupportedEncodingException; -+import java.net.URL; -+import java.net.URLDecoder; -+import java.util.ArrayList; -+import java.util.List; -+import java.util.Map; -+ -+import org.yaml.snakeyaml.Yaml; -+ -+import net.minecraft.src.GuiScreen; -+ -+import org.spoutcraft.api.Spoutcraft; -+import org.spoutcraft.api.gui.Button; -+import org.spoutcraft.api.gui.Color; -+import org.spoutcraft.api.gui.GenericButton; -+import org.spoutcraft.api.gui.GenericLabel; -+import org.spoutcraft.api.gui.GenericScrollArea; -+import org.spoutcraft.api.gui.GenericTexture; -+import org.spoutcraft.api.gui.Orientation; -+import org.spoutcraft.api.gui.ScrollBarPolicy; -+import org.spoutcraft.api.gui.Texture; -+import org.spoutcraft.client.SpoutClient; -+import org.spoutcraft.client.gui.GuiSpoutScreen; -+import org.spoutcraft.client.gui.LinkButton; -+import org.spoutcraft.client.util.NetworkUtils; -+ -+public class GuiServerInfo extends GuiSpoutScreen { -+ private GenericButton buttonDone, buttonOpenBrowser, buttonRefresh, buttonAddFavorite, buttonJoin; -+ private GenericLabel labelTitle, labelAddressLabel, labelAddress, labelMotdLabel, labelMotd, labelDescription, -+ labelPlayersLabel, labelPlayers, labelSpoutcraftLabel, labelSpoutcraft, labelAccessLabel, labelAccess, -+ labelMCVersionLabel, labelMCVersion, labelCategoryLabel, labelCategory; -+ private LinkButton linkForum, linkSite; -+ private GenericScrollArea content; -+ private List labels = new ArrayList(); -+ int labelWidth = 0; -+ private GenericTexture textureIcon; -+ private List gallery = new ArrayList(); -+ private GenericLabel labelGalleryImageTitle, labelGalleryImageDesc, labelGalleryTitle; -+ private Texture textureGalleryImage; -+ private Button buttonGalleryPrev, buttonGalleryNext; -+ private int galleryCurrentImage = 0; -+ -+ static final int MAX_HEIGHT = 128; -+ -+ private GuiScreen back; -+ private ServerItem item; -+ private Thread loadThread; -+ -+ public GuiServerInfo(ServerItem item, GuiScreen back) { -+ this.back = back; -+ this.item = item; -+ } -+ -+ @Override -+ protected void createInstances() { -+ labels.clear(); -+ buttonDone = new GenericButton("Done"); -+ getScreen().attachWidget("Spoutcraft", buttonDone); -+ -+ buttonRefresh = new GenericButton(); -+ getScreen().attachWidget("Spoutcraft", buttonRefresh); -+ -+ buttonAddFavorite = new GenericButton("Add Favorite"); -+ getScreen().attachWidget("Spoutcraft", buttonAddFavorite); -+ -+ buttonJoin = new GenericButton("Join"); -+ getScreen().attachWidget("Spoutcraft", buttonJoin); -+ -+ content = new GenericScrollArea(); -+ content.setScrollBarPolicy(Orientation.HORIZONTAL, ScrollBarPolicy.SHOW_NEVER); -+ -+ getScreen().attachWidget("Spoutcraft", content); -+ -+ labelTitle = new GenericLabel(item.getTitle()); -+ getScreen().attachWidget("Spoutcraft", labelTitle); -+ -+ buttonOpenBrowser = new GenericButton("More Info..."); -+ getScreen().attachWidget("Spoutcraft", buttonOpenBrowser); -+ -+ labelCategoryLabel = new GenericLabel("Category"); -+ content.attachWidget("Spoutcraft", labelCategoryLabel); -+ labels.add(labelCategoryLabel); -+ -+ labelCategory = new GenericLabel("..."); -+ labelCategory.setTextColor(new Color(0xffaaaaaa)); -+ content.attachWidget("Spoutcraft", labelCategory); -+ -+ labelMCVersionLabel = new GenericLabel("Minecraft Version"); -+ content.attachWidget("Spoutcraft", labelMCVersionLabel); -+ labels.add(labelMCVersionLabel); -+ -+ labelMCVersion = new GenericLabel("..."); -+ labelMCVersion.setTextColor(new Color(0xffaaaaaa)); -+ content.attachWidget("Spoutcraft", labelMCVersion); -+ -+ labelAccessLabel = new GenericLabel("Access Type"); -+ content.attachWidget("Spoutcraft", labelAccessLabel); -+ labels.add(labelAccessLabel); -+ -+ String access = "Open"; -+ switch(item.accessType) { -+ case ServerItem.WHITELIST: -+ access = "Whitelist"; -+ break; -+ case ServerItem.GRAYLIST: -+ access = "Graylist"; -+ break; -+ case ServerItem.BLACKLIST: -+ access = "Blacklist"; -+ break; -+ } -+ labelAccess = new GenericLabel(access); -+ labelAccess.setTextColor(new Color(0xffaaaaaa)); -+ content.attachWidget("Spoutcraft", labelAccess); -+ -+ labelAddress = new GenericLabel(item.getIp() + (item.getPort() != ServerItem.DEFAULT_PORT ? item.getPort() : "")); -+ labelAddress.setTextColor(new Color(0xffaaaaaa)); -+ content.attachWidget("Spoutcraft", labelAddress); -+ -+ labelAddressLabel = new GenericLabel("Address"); -+ content.attachWidget("Spoutcraft", labelAddressLabel); -+ labels.add(labelAddressLabel); -+ -+ labelMotd = new GenericLabel(item.getMotd()); -+ content.attachWidget("Spoutcraft", labelMotd); -+ labelMotd.setTextColor(new Color(0xffaaaaaa)); -+ -+ labelMotdLabel = new GenericLabel("MOTD"); -+ content.attachWidget("Spoutcraft", labelMotdLabel); -+ labels.add(labelMotdLabel); -+ -+ labelDescription = new GenericLabel("..."); -+ content.attachWidget("Spoutcraft", labelDescription); -+ labelDescription.setTextColor(new Color(0xffaaaaaa)); -+ labelDescription.setWrapLines(true); -+ -+ labelPlayersLabel = new GenericLabel("Players"); -+ content.attachWidget("Spoutcraft", labelPlayersLabel); -+ labels.add(labelPlayersLabel); -+ -+ labelPlayers = new GenericLabel(); -+ labelPlayers.setTextColor(new Color(0xffaaaaaa)); -+ content.attachWidget("Spoutcraft", labelPlayers); -+ -+ linkForum = new LinkButton("Go to Forum", ""); -+ getScreen().attachWidget("Spoutcraft", linkForum); -+ linkSite = new LinkButton("Go to Website", ""); -+ getScreen().attachWidget("Spoutcraft", linkSite); -+ -+ labelSpoutcraftLabel = new GenericLabel("Spoutcraft"); -+ content.attachWidget("Spoutcraft", labelSpoutcraftLabel); -+ labels.add(labelSpoutcraftLabel); -+ -+ labelSpoutcraft = new GenericLabel("..."); -+ labelSpoutcraft.setTextColor(new Color(0xffaaaaaa)); -+ content.attachWidget("Spoutcraft", labelSpoutcraft); -+ textureIcon = new GenericTexture("http://cdn.spout.org/server/thumb/" + item.getDatabaseId() + ".png"); -+ textureIcon.setFinishDelegate(new ImageUpdate()); -+ textureIcon.setWidth(48).setHeight(48); -+ content.attachWidget("Spoutcraft", textureIcon); -+ -+ for (GenericLabel lbl:labels) { -+ labelWidth = (int) Math.max(labelWidth, lbl.getTextWidth()); -+ } -+ updateButtons(); -+ refresh(); -+ updateData(); -+ } -+ -+ public boolean hasGallery() { -+ return gallery.size() != 0; -+ } -+ -+ public void setupGallery() { -+ buttonGalleryNext = new GenericButton("->"); -+ buttonGalleryPrev = new GenericButton("<-"); -+ labelGalleryImageTitle = new GenericLabel(); -+ labelGalleryImageDesc = new GenericLabel(); -+ textureGalleryImage = new GenericTexture(""); -+ textureGalleryImage.setFinishDelegate(new ImageUpdate()); -+ labelGalleryTitle = new GenericLabel("Gallery"); -+ ((GenericLabel) labelGalleryImageDesc).setWrapLines(true); -+ content.attachWidgets("Spoutcraft", labelGalleryImageTitle, labelGalleryImageDesc, textureGalleryImage, buttonGalleryPrev, buttonGalleryNext, labelGalleryTitle); -+ layoutWidgets(); -+ setGalleryImage(0); -+ } -+ -+ public void setGalleryImage(int n) { -+ if (!hasGallery()) { -+ return; -+ } -+ if (gallery.size() - 1 < n) { -+ n = gallery.size() - 1; -+ } -+ if (n < 0) { -+ n = 0; -+ } -+ galleryCurrentImage = n; -+ GalleryImage image = gallery.get(n); -+ labelGalleryImageTitle.setText(image.getTitle()); -+ labelGalleryImageDesc.setText(image.getDesc()); -+ if (labelGalleryImageDesc.getWidth() > 0) { -+ labelGalleryImageDesc.recalculateLines(); -+ content.updateInnerSize(); -+ } -+ textureGalleryImage.setUrl("http://cdn.spout.org/server/gallery/" + item.getDatabaseId() + "_" + image.getHash() + ".png"); -+ textureGalleryImage.setFinishDelegate(new ImageUpdate()); -+ if (n == 0) { -+ buttonGalleryPrev.setEnabled(false); -+ } else { -+ buttonGalleryPrev.setEnabled(true); -+ } -+ if (n == gallery.size() - 1) { -+ buttonGalleryNext.setEnabled(false); -+ } else { -+ buttonGalleryNext.setEnabled(true); -+ } -+ layoutWidgets(); -+ } -+ -+ public void updateButtons() { -+ linkForum.setEnabled(!linkForum.getUrl().isEmpty()); -+ linkSite.setEnabled(!linkSite.getUrl().isEmpty()); -+ -+ boolean updating = loadThread != null; -+ buttonRefresh.setEnabled(!updating); -+ if (updating) { -+ buttonRefresh.setText("Loading..."); -+ } else { -+ buttonRefresh.setText("Refresh"); -+ } -+ -+ buttonAddFavorite.setEnabled(!SpoutClient.getInstance().getServerManager().getFavorites().containsSever(item)); -+ if (!buttonAddFavorite.isEnabled()) { -+ buttonAddFavorite.setTooltip("You already have this server in your favorites"); -+ } else { -+ buttonAddFavorite.setTooltip(""); -+ } -+ } -+ -+ @Override -+ protected void layoutWidgets() { -+ int w = Spoutcraft.getMinecraftFont().getTextWidth(labelTitle.getText()); -+ -+ int totalWidth = Math.min(width - 9, 200 * 3 + 10); -+ int cellWidth = (totalWidth - 10)/3; -+ int left = width / 2 - totalWidth / 2; -+ int center = left + cellWidth + 5; -+ int right = center + cellWidth + 5; -+ -+ labelTitle.setX(width / 2 - w / 2).setY(5 + 7).setWidth(w).setHeight(11); -+ -+ if (labelTitle.getX() + w > width - 110) { -+ labelTitle.setX(width - 110 - w); -+ } -+ -+ buttonRefresh.setX(width - 105).setY(5).setWidth(100).setHeight(20); -+ -+ content.setX(0).setY(5 + 7 + 11 + 5).setWidth(width).setHeight(height - 55 - (5 + 7 + 11 + 5)); -+ -+ int top = 5; -+ -+ textureIcon.setX(5).setY(top); -+ updateImageWidth(textureIcon, cellWidth, MAX_HEIGHT); -+ -+ int labelLeft = (int) (10 + textureIcon.getWidth()); -+ int valueLeft = labelLeft + 5 + labelWidth; -+ -+ top += 5; -+ -+ labelAddressLabel.setX(labelLeft).setY(top).setWidth(width - 10).setHeight(11); -+ labelAddress.setX(valueLeft).setY(top).setWidth(width - valueLeft - 5).setHeight(11); -+ -+ top += 16; -+ -+ labelMotdLabel.setX(labelLeft).setY(top).setWidth(width - 10).setHeight(11); -+ labelMotd.setX(valueLeft).setY(top).setWidth(width - valueLeft - 5).setHeight(11); -+ -+ labelMotd.setWrapLines(true); -+ labelMotd.recalculateLines(); -+ -+ if (labelMotd.getLines().length > 1) { -+ top += 10; -+ } -+ -+ top += 16; -+ -+ labelPlayersLabel.setX(labelLeft).setY(top).setWidth(width - 10).setHeight(11); -+ labelPlayers.setX(valueLeft).setY(top).setWidth(width - valueLeft - 5).setHeight(11); -+ -+ top += 16; -+ -+ labelSpoutcraftLabel.setX(labelLeft).setY(top).setWidth(width - 10).setHeight(11); -+ labelSpoutcraft.setX(valueLeft).setY(top).setWidth(width - valueLeft - 5).setHeight(11); -+ -+ top += 16; -+ -+ labelAccessLabel.setX(labelLeft).setY(top).setWidth(width - 10).setHeight(11); -+ labelAccess.setX(valueLeft).setY(top).setWidth(width - valueLeft - 5).setHeight(11); -+ -+ top += 16; -+ -+ labelMCVersionLabel.setX(labelLeft).setY(top).setWidth(width - 10).setHeight(11); -+ labelMCVersion.setX(valueLeft).setY(top).setWidth(width - valueLeft - 5).setHeight(11); -+ -+ top += 16; -+ -+ labelCategoryLabel.setX(labelLeft).setY(top).setWidth(width - 10).setHeight(11); -+ labelCategory.setX(valueLeft).setY(top).setWidth(width - valueLeft - 5).setHeight(11); -+ -+ top += 16; -+ -+ labelLeft = 5; -+ valueLeft = labelLeft + labelWidth + 5; -+ -+ top = (int) Math.max(top, 5 + textureIcon.getHeight() + 5); -+ -+ labelDescription.setX(5).setY(top).setWidth(totalWidth).setHeight(11); -+ labelDescription.recalculateLines(); -+ -+ top += labelDescription.getHeight() + 5; -+ -+ if (hasGallery()) { -+ labelGalleryTitle.setGeometry(labelLeft, top, totalWidth, 10); -+ top += 15; -+ -+ textureGalleryImage.setGeometry(labelLeft, top, totalWidth, 100); -+ updateImageWidth(textureGalleryImage, totalWidth, (int) (content.getHeight() - 50)); -+ w = (int) textureGalleryImage.getWidth(); -+ textureGalleryImage.setX(totalWidth / 2 - w / 2); -+ top += textureGalleryImage.getHeight() + 5; -+ -+ buttonGalleryPrev.setGeometry(labelLeft, top, 20, 20); -+ buttonGalleryNext.setGeometry(labelLeft + totalWidth - 20, top, 20, 20); -+ w = Spoutcraft.getRenderDelegate().getMinecraftFont().getTextWidth(labelGalleryImageTitle.getText()); -+ labelGalleryImageTitle.setGeometry(totalWidth / 2 - w / 2, top + 5, w, 10); -+ top += 25; -+ labelGalleryImageDesc.setGeometry(labelLeft, top, totalWidth, 11); -+ ((GenericLabel) labelGalleryImageDesc).recalculateLines(); -+ top += labelGalleryImageDesc.getHeight() + 5; -+ } -+ -+ linkForum.setX(left).setY(height - 50).setWidth(cellWidth).setHeight(20); -+ linkSite.setX(center).setY(height - 50).setWidth(cellWidth).setHeight(20); -+ buttonOpenBrowser.setX(right).setY(height - 50).setHeight(20).setWidth(cellWidth); -+ -+ buttonJoin.setX(left).setY(height - 25).setHeight(20).setWidth(cellWidth); -+ buttonAddFavorite.setX(center).setY(height - 25).setHeight(20).setWidth(cellWidth); -+ buttonDone.setX(right).setY(height - 25).setHeight(20).setWidth(cellWidth); -+ -+ content.updateInnerSize(); -+ } -+ -+ @Override -+ protected void buttonClicked(Button btn) { -+ if (btn == buttonDone) { -+ mc.displayGuiScreen(back); -+ } -+ if (btn == buttonOpenBrowser) { -+ NetworkUtils.openInBrowser("http://servers.spout.org/info/" + item.getDatabaseId()); -+ } -+ if (btn == buttonRefresh) { -+ refresh(); -+ } -+ if (btn == buttonAddFavorite) { -+ SpoutClient.getInstance().getServerManager().getFavorites().addServer(item); -+ SpoutClient.getInstance().getServerManager().getFavorites().save(); -+ updateButtons(); -+ } -+ if (btn == buttonJoin) { -+ item.onClick(-1, -1, true); -+ } -+ if (btn == buttonGalleryNext) { -+ setGalleryImage(galleryCurrentImage + 1); -+ } -+ if (btn == buttonGalleryPrev) { -+ setGalleryImage(galleryCurrentImage - 1); -+ } -+ } -+ -+ private void refresh() { -+ loadThread = new Thread() { -+ public void run() { -+ try { -+ URL url = new URL("http://servers.spout.org/api2.php?id=" + item.getDatabaseId()); -+ BufferedReader reader = new BufferedReader(new InputStreamReader(url.openStream())); -+ Yaml yaml = new Yaml(); -+ ArrayList> list = (ArrayList>) yaml.load(reader); -+ reader.close(); -+ parseYaml(list); -+ } catch(IOException e) { -+ e.printStackTrace(); -+ parseYaml(null); -+ } -+ } -+ }; -+ loadThread.start(); -+ updateButtons(); -+ } -+ -+ protected void parseYaml(ArrayList> list) { -+ loadThread = null; -+ updateButtons(); -+ try { -+ if (list != null && list.size() > 0) { -+ Map i = list.get(1); -+ labelDescription.setText(URLDecoder.decode((String) i.get("longdescription"), "UTF-8")); -+ linkSite.setUrl(URLDecoder.decode((String) i.get("site"), "UTF-8")); -+ linkForum.setUrl(URLDecoder.decode((String) i.get("forumurl"), "UTF-8")); -+ boolean spoutcraft = i.get("spoutcraft").equals("1"); -+ labelSpoutcraft.setText(spoutcraft ? "Required" : "Not Required"); -+ labelMCVersion.setText(URLDecoder.decode((String) i.get("mcversion"), "UTF-8")); -+ labelCategory.setText(URLDecoder.decode((String) i.get("category"), "UTF-8")); -+ if (i.containsKey("gallery")) { -+ System.out.println("Has gallery"); -+ List> gMap = (List>) i.get("gallery"); -+ gallery.clear(); -+ for (Map image:gMap) { -+ GalleryImage img = new GalleryImage(image.get("picid"), URLDecoder.decode((String) image.get("title"), "UTF-8"), URLDecoder.decode((String) image.get("desc"), "UTF-8")); -+ gallery.add(img); -+ } -+ if (buttonGalleryNext == null) { -+ setupGallery(); -+ } else { -+ setGalleryImage(0); -+ } -+ } -+ } -+ } catch(UnsupportedEncodingException e) {} -+ layoutWidgets(); -+ updateButtons(); -+ } -+ -+ @Override -+ public void updateScreen() { -+ if (loadThread != null) { -+ Color color = new Color(0, 1f, 0); -+ double darkness = 0; -+ long t = System.currentTimeMillis() % 1000; -+ darkness = Math.cos(t * 2 * Math.PI / 1000) * 0.2 + 0.2; -+ color.setGreen(1f - (float)darkness); -+ buttonRefresh.setDisabledColor(color); -+ } -+ super.updateScreen(); -+ } -+ -+ public void updateData() { -+ labelMotd.setText(item.getMotd()); -+ labelPlayers.setText(item.getPlayers() + " / " + item.getMaxPlayers()); -+ } -+ -+ private class ImageUpdate implements Runnable { -+ public void run() { -+ layoutWidgets(); -+ } -+ } -+ -+ public void updateImageWidth(Texture texture, int maxWidth, int maxHeight) { -+ int imgwidth, imgheight; -+ imgwidth = texture.getOriginalWidth(); -+ imgheight = texture.getOriginalHeight(); -+ -+ double ratio = (double) imgwidth / (double) imgheight; -+ -+ if (imgheight > maxHeight) { -+ imgheight = maxHeight; -+ imgwidth = (int) ((double) imgheight * ratio); -+ } -+ -+ if (imgwidth > maxWidth) { -+ imgwidth = maxWidth; -+ imgheight = (int) ((double) imgwidth * (1.0/ratio)); -+ } -+ -+ texture.setWidth(imgwidth).setHeight(imgheight); -+ } -+ -+ protected class GalleryImage { -+ private String hash, title, desc; -+ -+ public GalleryImage(String hash, String title, String desc) { -+ this.hash = hash; -+ this.title = title; -+ this.desc = desc; -+ } -+ -+ public String getHash() { -+ return hash; -+ } -+ -+ public void setHash(String hash) { -+ this.hash = hash; -+ } -+ -+ public String getTitle() { -+ return title; -+ } -+ -+ public void setTitle(String title) { -+ this.title = title; -+ } -+ -+ public String getDesc() { -+ return desc; -+ } -+ -+ public void setDesc(String desc) { -+ this.desc = desc; -+ } -+ } -+} ---- /dev/null -+++ org/spoutcraft/client/sound/QueuedSound.java -@@ -1,0 +1,71 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.client.sound; -+ -+import java.io.File; -+ -+import net.minecraft.src.SoundManager; -+ -+import org.spoutcraft.client.SpoutClient; -+ -+public class QueuedSound implements Runnable { -+ File song; -+ int x,y, z, volume, distance; -+ boolean soundEffect, notify; -+ public QueuedSound(File song, int x, int y, int z, int volume, int distance, boolean soundEffect) { -+ this.song = song; -+ this.x = x; -+ this.y = y; -+ this.z = z; -+ this.volume = volume; -+ this.distance = distance; -+ this.soundEffect = soundEffect; -+ } -+ -+ public void setNotify(boolean notify) { -+ this.notify = notify; -+ } -+ -+ public void run() { -+ play(); -+ } -+ -+ private boolean play() { -+ if (song.exists()) { -+ if (notify) { -+ SpoutClient.getInstance().getActivePlayer().showAchievement("Download Complete!", song.getName(), 2256); // Gold Record -+ } -+ SoundManager sndManager = SpoutClient.getHandle().sndManager; -+ if (!sndManager.hasSoundEffect(song.getName().toString(), 0) && soundEffect) { -+ sndManager.addCustomSoundEffect(song.getName().toString(), song); -+ } -+ if (!sndManager.hasMusic(song.getName().toString(), 0) && !soundEffect) { -+ sndManager.addCustomMusic(song.getName().toString(), song); -+ } -+ if (!soundEffect) { -+ sndManager.playMusic(song.getName().toString(), 0, x, y, z, volume / 100F, distance); -+ } else { -+ sndManager.playCustomSoundEffect(song.getName().toString(), x, y, z, volume / 100F, distance); -+ } -+ return true; -+ } -+ return false; -+ } -+} ---- net/minecraft/src/GuiDisconnected.java -+++ net/minecraft/src/GuiDisconnected.java -@@ -3,52 +3,80 @@ - import java.util.Iterator; - import java.util.List; - -+import org.spoutcraft.client.SpoutClient; -+import org.spoutcraft.client.gui.server.GuiFavorites; -+ - public class GuiDisconnected extends GuiScreen { -- private String a; -- private String b; -- private Object[] c; -- private List d; -+ -+ /** The error message. */ -+ private String errorMessage; -+ -+ /** The details about the error. */ -+ private String errorDetail; -+ private Object[] field_74247_c; -+ private List field_74245_d; - private final GuiScreen field_98095_n; - -- public GuiDisconnected(GuiScreen var1, String var2, String var3, Object... var4) { -- this.field_98095_n = var1; -- this.a = I18n.getString(var2); -- this.b = var3; -- this.c = var4; -- } -- -- protected void keyTyped(char var1, int var2) { -- } -- -- public void initGui() { -- this.i.clear(); -- this.i.add(new GuiButton(0, this.width / 2 - 100, this.height / 4 + 120 + 12, I18n.getString("gui.toMenu"))); -- if(this.c != null) { -- this.d = this.fontRenderer.listFormattedStringToWidth(I18n.getStringParams(this.b, this.c), this.width - 50); -+ public GuiDisconnected(GuiScreen par1GuiScreen, String par2Str, String par3Str, Object ... par4ArrayOfObj) { -+ this.field_98095_n = par1GuiScreen; -+ this.errorMessage = I18n.getString(par2Str); -+ this.errorDetail = par3Str; -+ this.field_74247_c = par4ArrayOfObj; -+ // Spout Start -+ org.spoutcraft.client.ReconnectManager.detectKick(par2Str, par3Str, par4ArrayOfObj); -+ // Spout End -+ } -+ -+ /** -+ * Fired when a key is typed. This is the equivalent of KeyListener.keyTyped(KeyEvent e). -+ */ -+ protected void keyTyped(char par1, int par2) {} -+ -+ /** -+ * Adds the buttons (and other controls) to the screen in question. -+ */ -+ public void initGui() { -+ this.buttonList.clear(); -+ // Spout Start -+ this.buttonList.add(new GuiButton(0, this.width / 2 - 100, this.height / 4 + 120 + 12, "Back to " + SpoutClient.getInstance().getServerManager().getJoinedFromName())); -+ -+ // Spout End -+ if (this.field_74247_c != null) { -+ this.field_74245_d = this.fontRenderer.listFormattedStringToWidth(I18n.getStringParams(this.errorDetail, this.field_74247_c), this.width - 50); - } else { -- this.d = this.fontRenderer.listFormattedStringToWidth(I18n.getString(this.b), this.width - 50); -- } -- -- } -- -- protected void actionPerformed(GuiButton var1) { -- if(var1.id == 0) { -- this.mc.displayGuiScreen(this.field_98095_n); -- } -- -- } -- -- public void drawScreen(int var1, int var2, float var3) { -+ this.field_74245_d = this.fontRenderer.listFormattedStringToWidth(I18n.getString(this.errorDetail), this.width - 50); -+ } -+ } -+ -+ /** -+ * Fired when a control is clicked. This is the equivalent of ActionListener.actionPerformed(ActionEvent e). -+ */ -+ protected void actionPerformed(GuiButton par1GuiButton) { -+ if (par1GuiButton.id == 0) { -+ // Spout Start -+ this.mc.displayGuiScreen(SpoutClient.getInstance().getServerManager().getJoinedFrom()); -+ // Spout End -+ } -+ } -+ -+ /** -+ * Draws the screen and all the components in it. -+ */ -+ public void drawScreen(int par1, int par2, float par3) { - this.drawDefaultBackground(); -- this.drawCenteredString(this.fontRenderer, this.a, this.width / 2, this.height / 2 - 50, 11184810); -+ this.drawCenteredString(this.fontRenderer, this.errorMessage, this.width / 2, this.height / 2 - 50, 11184810); - int var4 = this.height / 2 - 30; -- if(this.d != null) { -- for(Iterator var5 = this.d.iterator(); var5.hasNext(); var4 += this.fontRenderer.FONT_HEIGHT) { -+ -+ if (this.field_74245_d != null) { -+ for (Iterator var5 = this.field_74245_d.iterator(); var5.hasNext(); var4 += this.fontRenderer.FONT_HEIGHT) { - String var6 = (String)var5.next(); - this.drawCenteredString(this.fontRenderer, var6, this.width / 2, var4, 16777215); - } - } - -- super.drawScreen(var1, var2, var3); -+ super.drawScreen(par1, par2, par3); -+ // Spout Start -+ org.spoutcraft.client.ReconnectManager.teleport(this.mc); -+ // Spout End - } - } ---- /dev/null -+++ org/spoutcraft/client/player/accessories/Sunglasses.java -@@ -1,0 +1,82 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.client.player.accessories; -+ -+import net.minecraft.src.EntityPlayer; -+import net.minecraft.src.ModelBiped; -+import net.minecraft.src.ModelRenderer; -+ -+public class Sunglasses extends Accessory { -+ public ModelRenderer SunglassesFront; -+ public ModelRenderer SunglassesFront2; -+ public ModelRenderer SunglassesBridge; -+ public ModelRenderer RightSunglasses; -+ public ModelRenderer LeftSunglasses; -+ public ModelRenderer RightSunglassesBridge; -+ public ModelRenderer LeftSunglassesBridge; -+ -+ public Sunglasses(ModelBiped acs) { -+ super(acs); -+ SunglassesFront = new ModelRenderer(acs, 0, 0); -+ SunglassesFront.addBox(-3F, -4F, -5F, 2, 2, 1); -+ SunglassesFront2 = new ModelRenderer(acs, 6, 0); -+ SunglassesFront2.addBox(1F, -4F, -5F, 2, 2, 1); -+ SunglassesBridge = new ModelRenderer(acs, 0, 4); -+ SunglassesBridge.addBox(-1F, -4F, -5F, 2, 1, 1); -+ RightSunglasses = new ModelRenderer(acs, 0, 6); -+ RightSunglasses.addBox(4.0F, -4.0F, -4.0F, 1, 1, 4); -+ LeftSunglasses = new ModelRenderer(acs, 12, 0); -+ LeftSunglasses.addBox(-5.0F, -4.0F, -4.0F, 1, 1, 4); -+ LeftSunglassesBridge = new ModelRenderer(acs, 6, 5); -+ LeftSunglassesBridge.addBox(-5.0F, -4.0F, -5.0F, 2, 1, 1); -+ RightSunglassesBridge = new ModelRenderer(acs, 6, 7); -+ RightSunglassesBridge.addBox(3.0F, -4.0F, -5.0F, 2, 1, 1); -+ } -+ -+ @Override -+ public void render(EntityPlayer plr, float f) { -+ SunglassesFront.rotateAngleY = getModel().bipedHead.rotateAngleY; -+ SunglassesFront.rotateAngleX = getModel().bipedHead.rotateAngleX; -+ SunglassesFront.render(f); -+ SunglassesFront2.rotateAngleY = getModel().bipedHead.rotateAngleY; -+ SunglassesFront2.rotateAngleX = getModel().bipedHead.rotateAngleX; -+ SunglassesFront2.render(f); -+ SunglassesBridge.rotateAngleY = getModel().bipedHead.rotateAngleY; -+ SunglassesBridge.rotateAngleX = getModel().bipedHead.rotateAngleX; -+ SunglassesBridge.render(f); -+ RightSunglasses.rotateAngleY = getModel().bipedHead.rotateAngleY; -+ RightSunglasses.rotateAngleX = getModel().bipedHead.rotateAngleX; -+ RightSunglasses.render(f); -+ LeftSunglasses.rotateAngleY = getModel().bipedHead.rotateAngleY; -+ LeftSunglasses.rotateAngleX = getModel().bipedHead.rotateAngleX; -+ LeftSunglasses.render(f); -+ LeftSunglassesBridge.rotateAngleY = getModel().bipedHead.rotateAngleY; -+ LeftSunglassesBridge.rotateAngleX = getModel().bipedHead.rotateAngleX; -+ LeftSunglassesBridge.render(f); -+ RightSunglassesBridge.rotateAngleY = getModel().bipedHead.rotateAngleY; -+ RightSunglassesBridge.rotateAngleX = getModel().bipedHead.rotateAngleX; -+ RightSunglassesBridge.render(f); -+ } -+ -+ @Override -+ public AccessoryType getType() { -+ return AccessoryType.SUNGLASSES; -+ } -+} ---- net/minecraft/src/StatFileWriter.java -+++ net/minecraft/src/StatFileWriter.java -@@ -13,102 +13,105 @@ - import java.util.Map.Entry; - - public class StatFileWriter { -- private Map a = new HashMap(); -- private Map b = new HashMap(); -+ private Map field_77457_a = new HashMap(); -+ private Map field_77455_b = new HashMap(); - private boolean field_77456_c; - private StatsSyncher statsSyncher; - -- public StatFileWriter(Session var1, File var2) { -- File var3 = new File(var2, "stats"); -- if(!var3.exists()) { -+ public StatFileWriter(Session par1Session, File par2File) { -+ File var3 = new File(par2File, "stats"); -+ -+ if (!var3.exists()) { - var3.mkdir(); - } - -- File[] var4 = var2.listFiles(); -+ File[] var4 = par2File.listFiles(); - int var5 = var4.length; - -- for(int var6 = 0; var6 < var5; ++var6) { -+ for (int var6 = 0; var6 < var5; ++var6) { - File var7 = var4[var6]; -- if(var7.getName().startsWith("stats_") && var7.getName().endsWith(".dat")) { -+ -+ if (var7.getName().startsWith("stats_") && var7.getName().endsWith(".dat")) { - File var8 = new File(var3, var7.getName()); -- if(!var8.exists()) { -+ -+ if (!var8.exists()) { - System.out.println("Relocating " + var7.getName()); - var7.renameTo(var8); - } - } - } - -- this.statsSyncher = new StatsSyncher(var1, this, var3); -+ this.statsSyncher = new StatsSyncher(par1Session, this, var3); - } - -- public void readStat(StatBase var1, int var2) { -- this.writeStatToMap(this.b, var1, var2); -- this.writeStatToMap(this.a, var1, var2); -+ public void readStat(StatBase par1StatBase, int par2) { -+ this.writeStatToMap(this.field_77455_b, par1StatBase, par2); -+ this.writeStatToMap(this.field_77457_a, par1StatBase, par2); - this.field_77456_c = true; - } - -- private void writeStatToMap(Map var1, StatBase var2, int var3) { -- Integer var4 = (Integer)var1.get(var2); -+ private void writeStatToMap(Map par1Map, StatBase par2StatBase, int par3) { -+ Integer var4 = (Integer)par1Map.get(par2StatBase); - int var5 = var4 == null ? 0 : var4.intValue(); -- var1.put(var2, Integer.valueOf(var5 + var3)); -+ par1Map.put(par2StatBase, Integer.valueOf(var5 + par3)); - } - - public Map func_77445_b() { -- return new HashMap(this.b); -+ return new HashMap(this.field_77455_b); - } - -- public void writeStats(Map var1) { -- if(var1 != null) { -+ /** -+ * write a whole Map of stats to the statmap -+ */ -+ public void writeStats(Map par1Map) { -+ if (par1Map != null) { - this.field_77456_c = true; -- Iterator var2 = var1.keySet().iterator(); -+ Iterator var2 = par1Map.keySet().iterator(); - -- while(var2.hasNext()) { -+ while (var2.hasNext()) { - StatBase var3 = (StatBase)var2.next(); -- this.writeStatToMap(this.b, var3, ((Integer)var1.get(var3)).intValue()); -- this.writeStatToMap(this.a, var3, ((Integer)var1.get(var3)).intValue()); -+ this.writeStatToMap(this.field_77455_b, var3, ((Integer)par1Map.get(var3)).intValue()); -+ this.writeStatToMap(this.field_77457_a, var3, ((Integer)par1Map.get(var3)).intValue()); - } -- - } - } - -- public void func_77452_b(Map var1) { -- if(var1 != null) { -- Iterator var2 = var1.keySet().iterator(); -+ public void func_77452_b(Map par1Map) { -+ if (par1Map != null) { -+ Iterator var2 = par1Map.keySet().iterator(); - -- while(var2.hasNext()) { -+ while (var2.hasNext()) { - StatBase var3 = (StatBase)var2.next(); -- Integer var4 = (Integer)this.b.get(var3); -+ Integer var4 = (Integer)this.field_77455_b.get(var3); - int var5 = var4 == null ? 0 : var4.intValue(); -- this.a.put(var3, Integer.valueOf(((Integer)var1.get(var3)).intValue() + var5)); -+ this.field_77457_a.put(var3, Integer.valueOf(((Integer)par1Map.get(var3)).intValue() + var5)); - } -- - } - } - -- public void func_77448_c(Map var1) { -- if(var1 != null) { -+ public void func_77448_c(Map par1Map) { -+ if (par1Map != null) { - this.field_77456_c = true; -- Iterator var2 = var1.keySet().iterator(); -+ Iterator var2 = par1Map.keySet().iterator(); - -- while(var2.hasNext()) { -+ while (var2.hasNext()) { - StatBase var3 = (StatBase)var2.next(); -- this.writeStatToMap(this.b, var3, ((Integer)var1.get(var3)).intValue()); -+ this.writeStatToMap(this.field_77455_b, var3, ((Integer)par1Map.get(var3)).intValue()); - } -- - } - } - -- public static Map func_77453_b(String var0) { -+ public static Map func_77453_b(String par0Str) { - HashMap var1 = new HashMap(); - - try { - String var2 = "local"; - StringBuilder var3 = new StringBuilder(); -- JsonRootNode var4 = (new JdomParser()).parse(var0); -- List var5 = var4.getArrayNode(new Object[]{"stats-change"}); -+ JsonRootNode var4 = (new JdomParser()).parse(par0Str); -+ List var5 = var4.getArrayNode(new Object[] {"stats-change"}); - Iterator var6 = var5.iterator(); - -- while(var6.hasNext()) { -+ while (var6.hasNext()) { - JsonNode var7 = (JsonNode)var6.next(); - Map var8 = var7.getFields(); - Entry var9 = (Entry)var8.entrySet().iterator().next(); -@@ -116,21 +119,24 @@ - int var11 = Integer.parseInt(((JsonNode)var9.getValue()).getText()); - boolean var12 = true; - StatBase var13 = StatList.getOneShotStat(var10); -- if(var13 == null) { -+ -+ if (var13 == null) { - var12 = false; - var13 = (new StatPlaceholder(var10)).registerStat(); - } - -- var3.append(StatList.getOneShotStat(var10).g).append(","); -+ var3.append(StatList.getOneShotStat(var10).statGuid).append(","); - var3.append(var11).append(","); -- if(var12) { -+ -+ if (var12) { - var1.put(var13, Integer.valueOf(var11)); - } - } - - MD5String var15 = new MD5String(var2); - String var16 = var15.getMD5String(var3.toString()); -- if(!var16.equals(var4.getStringValue(new Object[]{"checksum"}))) { -+ -+ if (!var16.equals(var4.getStringValue(new Object[] {"checksum"}))) { - System.out.println("CHECKSUM MISMATCH"); - return null; - } -@@ -141,55 +147,63 @@ - return var1; - } - -- public static String func_77441_a(String var0, String var1, Map var2) { -+ public static String func_77441_a(String par0Str, String par1Str, Map par2Map) { - StringBuilder var3 = new StringBuilder(); - StringBuilder var4 = new StringBuilder(); - boolean var5 = true; - var3.append("{\r\n"); -- if(var0 != null && var1 != null) { -+ -+ if (par0Str != null && par1Str != null) { - var3.append(" \"user\":{\r\n"); -- var3.append(" \"name\":\"").append(var0).append("\",\r\n"); -- var3.append(" \"sessionid\":\"").append(var1).append("\"\r\n"); -+ var3.append(" \"name\":\"").append(par0Str).append("\",\r\n"); -+ var3.append(" \"sessionid\":\"").append(par1Str).append("\"\r\n"); - var3.append(" },\r\n"); - } - - var3.append(" \"stats-change\":["); -- Iterator var6 = var2.keySet().iterator(); -+ Iterator var6 = par2Map.keySet().iterator(); - -- while(var6.hasNext()) { -+ while (var6.hasNext()) { - StatBase var7 = (StatBase)var6.next(); -- if(var5) { -+ -+ if (var5) { - var5 = false; - } else { - var3.append("},"); - } - -- var3.append("\r\n {\"").append(var7.statId).append("\":").append(var2.get(var7)); -- var4.append(var7.g).append(","); -- var4.append(var2.get(var7)).append(","); -+ var3.append("\r\n {\"").append(var7.statId).append("\":").append(par2Map.get(var7)); -+ var4.append(var7.statGuid).append(","); -+ var4.append(par2Map.get(var7)).append(","); - } - -- if(!var5) { -+ if (!var5) { - var3.append("}"); - } - -- MD5String var8 = new MD5String(var1); -+ MD5String var8 = new MD5String(par1Str); - var3.append("\r\n ],\r\n"); - var3.append(" \"checksum\":\"").append(var8.getMD5String(var4.toString())).append("\"\r\n"); - var3.append("}"); - return var3.toString(); - } - -- public boolean hasAchievementUnlocked(Achievement var1) { -- return this.a.containsKey(var1); -- } -- -- public boolean canUnlockAchievement(Achievement var1) { -- return var1.parentAchievement == null || this.hasAchievementUnlocked(var1.parentAchievement); -- } -- -- public int writeStat(StatBase var1) { -- Integer var2 = (Integer)this.a.get(var1); -+ /** -+ * Returns true if the achievement has been unlocked. -+ */ -+ public boolean hasAchievementUnlocked(Achievement par1Achievement) { -+ return this.field_77457_a.containsKey(par1Achievement); -+ } -+ -+ /** -+ * Returns true if the parent has been unlocked, or there is no parent -+ */ -+ public boolean canUnlockAchievement(Achievement par1Achievement) { -+ return par1Achievement.parentAchievement == null || this.hasAchievementUnlocked(par1Achievement.parentAchievement); -+ } -+ -+ public int writeStat(StatBase par1StatBase) { -+ Integer var2 = (Integer)this.field_77457_a.get(par1StatBase); - return var2 == null ? 0 : var2.intValue(); - } - -@@ -198,7 +212,7 @@ - } - - public void func_77449_e() { -- if(this.field_77456_c && this.statsSyncher.func_77425_c()) { -+ if (this.field_77456_c && this.statsSyncher.func_77425_c()) { - this.statsSyncher.beginSendStats(this.func_77445_b()); - } - ---- net/minecraft/src/AnvilSaveHandler.java -+++ net/minecraft/src/AnvilSaveHandler.java -@@ -3,18 +3,22 @@ - import java.io.File; - - public class AnvilSaveHandler extends SaveHandler { -- public AnvilSaveHandler(File var1, String var2, boolean var3) { -- super(var1, var2, var3); -+ public AnvilSaveHandler(File par1File, String par2Str, boolean par3) { -+ super(par1File, par2Str, par3); - } - -- public IChunkLoader getChunkLoader(WorldProvider var1) { -+ /** -+ * Returns the chunk loader with the provided world provider -+ */ -+ public IChunkLoader getChunkLoader(WorldProvider par1WorldProvider) { - File var2 = this.getWorldDirectory(); - File var3; -- if(var1 instanceof WorldProviderHell) { -+ -+ if (par1WorldProvider instanceof WorldProviderHell) { - var3 = new File(var2, "DIM-1"); - var3.mkdirs(); - return new AnvilChunkLoader(var3); -- } else if(var1 instanceof WorldProviderEnd) { -+ } else if (par1WorldProvider instanceof WorldProviderEnd) { - var3 = new File(var2, "DIM1"); - var3.mkdirs(); - return new AnvilChunkLoader(var3); -@@ -23,11 +27,17 @@ - } - } - -- public void saveWorldInfoWithPlayer(WorldInfo var1, NBTTagCompound var2) { -- var1.setSaveVersion(19133); -- super.saveWorldInfoWithPlayer(var1, var2); -+ /** -+ * Saves the given World Info with the given NBTTagCompound as the Player. -+ */ -+ public void saveWorldInfoWithPlayer(WorldInfo par1WorldInfo, NBTTagCompound par2NBTTagCompound) { -+ par1WorldInfo.setSaveVersion(19133); -+ super.saveWorldInfoWithPlayer(par1WorldInfo, par2NBTTagCompound); - } - -+ /** -+ * Called to flush all changes to disk, waiting for them to complete. -+ */ - public void flush() { - try { - ThreadedFileIOBase.threadedIOInstance.waitForFinish(); ---- /dev/null -+++ org/spoutcraft/client/gui/minimap/ZoomModeButton.java -@@ -1,0 +1,42 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.client.gui.minimap; -+ -+import java.util.ArrayList; -+import java.util.List; -+ -+import org.spoutcraft.api.gui.GenericComboBox; -+ -+public class ZoomModeButton extends GenericComboBox { -+ public ZoomModeButton() { -+ setTooltip("Changes the zoom level of the minimap."); -+ List names = new ArrayList(2); -+ names.add("Zoom: 0"); -+ names.add("Zoom: 1"); -+ names.add("Zoom: 2"); -+ setItems(names); -+ setSelection(MinimapConfig.getInstance().getZoom()); -+ } -+ -+ @Override -+ public void onSelectionChanged(int i, String text) { -+ MinimapConfig.getInstance().setZoom(i); -+ } -+} ---- net/minecraft/src/StitchSlot.java -+++ net/minecraft/src/StitchSlot.java -@@ -9,14 +9,14 @@ - private final int originY; - private final int width; - private final int height; -- private List e; -+ private List subSlots; - private StitchHolder holder; - -- public StitchSlot(int var1, int var2, int var3, int var4) { -- this.originX = var1; -- this.originY = var2; -- this.width = var3; -- this.height = var4; -+ public StitchSlot(int par1, int par2, int par3, int par4) { -+ this.originX = par1; -+ this.originY = par2; -+ this.width = par3; -+ this.height = par4; - } - - public StitchHolder getStitchHolder() { -@@ -31,49 +31,52 @@ - return this.originY; - } - -- public boolean addSlot(StitchHolder var1) { -- if(this.holder != null) { -+ public boolean addSlot(StitchHolder par1StitchHolder) { -+ if (this.holder != null) { - return false; - } else { -- int var2 = var1.getWidth(); -- int var3 = var1.getHeight(); -- if(var2 <= this.width && var3 <= this.height) { -- if(var2 == this.width && var3 == this.height) { -- this.holder = var1; -+ int var2 = par1StitchHolder.getWidth(); -+ int var3 = par1StitchHolder.getHeight(); -+ -+ if (var2 <= this.width && var3 <= this.height) { -+ if (var2 == this.width && var3 == this.height) { -+ this.holder = par1StitchHolder; - return true; - } else { -- if(this.e == null) { -- this.e = new ArrayList(1); -- this.e.add(new StitchSlot(this.originX, this.originY, var2, var3)); -+ if (this.subSlots == null) { -+ this.subSlots = new ArrayList(1); -+ this.subSlots.add(new StitchSlot(this.originX, this.originY, var2, var3)); - int var4 = this.width - var2; - int var5 = this.height - var3; -- if(var5 > 0 && var4 > 0) { -+ -+ if (var5 > 0 && var4 > 0) { - int var6 = Math.max(this.height, var4); - int var7 = Math.max(this.width, var5); -- if(var6 >= var7) { -- this.e.add(new StitchSlot(this.originX, this.originY + var3, var2, var5)); -- this.e.add(new StitchSlot(this.originX + var2, this.originY, var4, this.height)); -+ -+ if (var6 >= var7) { -+ this.subSlots.add(new StitchSlot(this.originX, this.originY + var3, var2, var5)); -+ this.subSlots.add(new StitchSlot(this.originX + var2, this.originY, var4, this.height)); - } else { -- this.e.add(new StitchSlot(this.originX + var2, this.originY, var4, var3)); -- this.e.add(new StitchSlot(this.originX, this.originY + var3, this.width, var5)); -+ this.subSlots.add(new StitchSlot(this.originX + var2, this.originY, var4, var3)); -+ this.subSlots.add(new StitchSlot(this.originX, this.originY + var3, this.width, var5)); - } -- } else if(var4 == 0) { -- this.e.add(new StitchSlot(this.originX, this.originY + var3, var2, var5)); -- } else if(var5 == 0) { -- this.e.add(new StitchSlot(this.originX + var2, this.originY, var4, var3)); -+ } else if (var4 == 0) { -+ this.subSlots.add(new StitchSlot(this.originX, this.originY + var3, var2, var5)); -+ } else if (var5 == 0) { -+ this.subSlots.add(new StitchSlot(this.originX + var2, this.originY, var4, var3)); - } - } - -- Iterator var8 = this.e.iterator(); -- -+ Iterator var8 = this.subSlots.iterator(); - StitchSlot var9; -+ - do { -- if(!var8.hasNext()) { -+ if (!var8.hasNext()) { - return false; - } - - var9 = (StitchSlot)var8.next(); -- } while(!var9.addSlot(var1)); -+ } while (!var9.addSlot(par1StitchHolder)); - - return true; - } -@@ -83,21 +86,23 @@ - } - } - -- public void getAllStitchSlots(List var1) { -- if(this.holder != null) { -- var1.add(this); -- } else if(this.e != null) { -- Iterator var2 = this.e.iterator(); -+ /** -+ * Gets the slot and all its subslots -+ */ -+ public void getAllStitchSlots(List par1List) { -+ if (this.holder != null) { -+ par1List.add(this); -+ } else if (this.subSlots != null) { -+ Iterator var2 = this.subSlots.iterator(); - -- while(var2.hasNext()) { -+ while (var2.hasNext()) { - StitchSlot var3 = (StitchSlot)var2.next(); -- var3.getAllStitchSlots(var1); -+ var3.getAllStitchSlots(par1List); - } - } -- - } - - public String toString() { -- return "Slot{originX=" + this.originX + ", originY=" + this.originY + ", width=" + this.width + ", height=" + this.height + ", texture=" + this.holder + ", subSlots=" + this.e + '}'; -+ return "Slot{originX=" + this.originX + ", originY=" + this.originY + ", width=" + this.width + ", height=" + this.height + ", texture=" + this.holder + ", subSlots=" + this.subSlots + '}'; - } - } ---- net/minecraft/src/EntityLeashKnot.java -+++ net/minecraft/src/EntityLeashKnot.java -@@ -4,21 +4,20 @@ - import java.util.List; - - public class EntityLeashKnot extends EntityHanging { -- public EntityLeashKnot(World var1) { -- super(var1); -+ public EntityLeashKnot(World par1World) { -+ super(par1World); - } - -- public EntityLeashKnot(World var1, int var2, int var3, int var4) { -- super(var1, var2, var3, var4, 0); -- this.setPosition((double)var2 + 0.5D, (double)var3 + 0.5D, (double)var4 + 0.5D); -+ public EntityLeashKnot(World par1World, int par2, int par3, int par4) { -+ super(par1World, par2, par3, par4, 0); -+ this.setPosition((double)par2 + 0.5D, (double)par3 + 0.5D, (double)par4 + 0.5D); - } - - protected void entityInit() { - super.entityInit(); - } - -- public void setDirection(int var1) { -- } -+ public void setDirection(int par1) {} - - public int getWidthPixels() { - return 9; -@@ -28,39 +27,59 @@ - return 9; - } - -- public boolean isInRangeToRenderDist(double var1) { -- return var1 < 1024.0D; -- } -- -- public void onBroken(Entity var1) { -- } -- -- public boolean writeToNBTOptional(NBTTagCompound var1) { -+ /** -+ * Checks if the entity is in range to render by using the past in distance and comparing it to its average edge length -+ * * 64 * renderDistanceWeight Args: distance -+ */ -+ public boolean isInRangeToRenderDist(double par1) { -+ return par1 < 1024.0D; -+ } -+ -+ /** -+ * Called when this entity is broken. Entity parameter may be null. -+ */ -+ public void onBroken(Entity par1Entity) {} -+ -+ /** -+ * Either write this entity to the NBT tag given and return true, or return false without doing anything. If this -+ * returns false the entity is not saved on disk. Ridden entities return false here as they are saved with their rider. -+ */ -+ public boolean writeToNBTOptional(NBTTagCompound par1NBTTagCompound) { - return false; - } - -- public void writeEntityToNBT(NBTTagCompound var1) { -- } -- -- public void readEntityFromNBT(NBTTagCompound var1) { -- } -- -- public boolean interactFirst(EntityPlayer var1) { -- ItemStack var2 = var1.getHeldItem(); -+ /** -+ * (abstract) Protected helper method to write subclass entity data to NBT. -+ */ -+ public void writeEntityToNBT(NBTTagCompound par1NBTTagCompound) {} -+ -+ /** -+ * (abstract) Protected helper method to read subclass entity data from NBT. -+ */ -+ public void readEntityFromNBT(NBTTagCompound par1NBTTagCompound) {} -+ -+ /** -+ * First layer of player interaction -+ */ -+ public boolean interactFirst(EntityPlayer par1EntityPlayer) { -+ ItemStack var2 = par1EntityPlayer.getHeldItem(); - boolean var3 = false; - double var4; - List var6; - Iterator var7; - EntityLiving var8; -- if(var2 != null && var2.itemID == Item.leash.itemID && !this.worldObj.isRemote) { -+ -+ if (var2 != null && var2.itemID == Item.leash.itemID && !this.worldObj.isRemote) { - var4 = 7.0D; - var6 = this.worldObj.getEntitiesWithinAABB(EntityLiving.class, AxisAlignedBB.getAABBPool().getAABB(this.posX - var4, this.posY - var4, this.posZ - var4, this.posX + var4, this.posY + var4, this.posZ + var4)); -- if(var6 != null) { -+ -+ if (var6 != null) { - var7 = var6.iterator(); - -- while(var7.hasNext()) { -+ while (var7.hasNext()) { - var8 = (EntityLiving)var7.next(); -- if(var8.getLeashed() && var8.getLeashedToEntity() == var1) { -+ -+ if (var8.getLeashed() && var8.getLeashedToEntity() == par1EntityPlayer) { - var8.setLeashedToEntity(this, true); - var3 = true; - } -@@ -68,17 +87,20 @@ - } - } - -- if(!this.worldObj.isRemote && !var3) { -+ if (!this.worldObj.isRemote && !var3) { - this.setDead(); -- if(var1.capabilities.isCreativeMode) { -+ -+ if (par1EntityPlayer.capabilities.isCreativeMode) { - var4 = 7.0D; - var6 = this.worldObj.getEntitiesWithinAABB(EntityLiving.class, AxisAlignedBB.getAABBPool().getAABB(this.posX - var4, this.posY - var4, this.posZ - var4, this.posX + var4, this.posY + var4, this.posZ + var4)); -- if(var6 != null) { -+ -+ if (var6 != null) { - var7 = var6.iterator(); - -- while(var7.hasNext()) { -+ while (var7.hasNext()) { - var8 = (EntityLiving)var7.next(); -- if(var8.getLeashed() && var8.getLeashedToEntity() == this) { -+ -+ if (var8.getLeashed() && var8.getLeashedToEntity() == this) { - var8.clearLeashed(true, false); - } - } -@@ -89,27 +111,32 @@ - return true; - } - -+ /** -+ * checks to make sure painting can be placed there -+ */ - public boolean onValidSurface() { - int var1 = this.worldObj.getBlockId(this.xPosition, this.yPosition, this.zPosition); - return Block.blocksList[var1] != null && Block.blocksList[var1].getRenderType() == 11; - } - -- public static EntityLeashKnot func_110129_a(World var0, int var1, int var2, int var3) { -- EntityLeashKnot var4 = new EntityLeashKnot(var0, var1, var2, var3); -+ public static EntityLeashKnot func_110129_a(World par0World, int par1, int par2, int par3) { -+ EntityLeashKnot var4 = new EntityLeashKnot(par0World, par1, par2, par3); - var4.forceSpawn = true; -- var0.spawnEntityInWorld(var4); -+ par0World.spawnEntityInWorld(var4); - return var4; - } - -- public static EntityLeashKnot getKnotForBlock(World var0, int var1, int var2, int var3) { -- List var4 = var0.getEntitiesWithinAABB(EntityLeashKnot.class, AxisAlignedBB.getAABBPool().getAABB((double)var1 - 1.0D, (double)var2 - 1.0D, (double)var3 - 1.0D, (double)var1 + 1.0D, (double)var2 + 1.0D, (double)var3 + 1.0D)); -+ public static EntityLeashKnot getKnotForBlock(World par0World, int par1, int par2, int par3) { -+ List var4 = par0World.getEntitiesWithinAABB(EntityLeashKnot.class, AxisAlignedBB.getAABBPool().getAABB((double)par1 - 1.0D, (double)par2 - 1.0D, (double)par3 - 1.0D, (double)par1 + 1.0D, (double)par2 + 1.0D, (double)par3 + 1.0D)); - Object var5 = null; -- if(var4 != null) { -+ -+ if (var4 != null) { - Iterator var6 = var4.iterator(); - -- while(var6.hasNext()) { -+ while (var6.hasNext()) { - EntityLeashKnot var7 = (EntityLeashKnot)var6.next(); -- if(var7.xPosition == var1 && var7.yPosition == var2 && var7.zPosition == var3) { -+ -+ if (var7.xPosition == par1 && var7.yPosition == par2 && var7.zPosition == par3) { - return var7; - } - } ---- net/minecraft/src/CallableLaunchedVersion.java -+++ net/minecraft/src/CallableLaunchedVersion.java -@@ -3,10 +3,12 @@ - import java.util.concurrent.Callable; - - class CallableLaunchedVersion implements Callable { -+ -+ /** Reference to the Minecraft object. */ - final Minecraft mc; - -- CallableLaunchedVersion(Minecraft var1) { -- this.mc = var1; -+ CallableLaunchedVersion(Minecraft par1Minecraft) { -+ this.mc = par1Minecraft; - } - - public String getLWJGLVersion() { ---- net/minecraft/src/ItemFireball.java -+++ net/minecraft/src/ItemFireball.java -@@ -1,50 +1,55 @@ - package net.minecraft.src; - - public class ItemFireball extends Item { -- public ItemFireball(int var1) { -- super(var1); -+ public ItemFireball(int par1) { -+ super(par1); - this.setCreativeTab(CreativeTabs.tabMisc); - } - -- public boolean onItemUse(ItemStack var1, EntityPlayer var2, World var3, int var4, int var5, int var6, int var7, float var8, float var9, float var10) { -- if(var3.isRemote) { -+ /** -+ * Callback for item usage. If the item does something special on right clicking, he will have one of those. Return -+ * True if something happen and false if it don't. This is for ITEMS, not BLOCKS -+ */ -+ public boolean onItemUse(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, World par3World, int par4, int par5, int par6, int par7, float par8, float par9, float par10) { -+ if (par3World.isRemote) { - return true; - } else { -- if(var7 == 0) { -- --var5; -- } -- -- if(var7 == 1) { -- ++var5; -- } -- -- if(var7 == 2) { -- --var6; -- } -- -- if(var7 == 3) { -- ++var6; -- } -- -- if(var7 == 4) { -- --var4; -- } -- -- if(var7 == 5) { -- ++var4; -- } -- -- if(!var2.canPlayerEdit(var4, var5, var6, var7, var1)) { -+ if (par7 == 0) { -+ --par5; -+ } -+ -+ if (par7 == 1) { -+ ++par5; -+ } -+ -+ if (par7 == 2) { -+ --par6; -+ } -+ -+ if (par7 == 3) { -+ ++par6; -+ } -+ -+ if (par7 == 4) { -+ --par4; -+ } -+ -+ if (par7 == 5) { -+ ++par4; -+ } -+ -+ if (!par2EntityPlayer.canPlayerEdit(par4, par5, par6, par7, par1ItemStack)) { - return false; - } else { -- int var11 = var3.getBlockId(var4, var5, var6); -- if(var11 == 0) { -- var3.playSoundEffect((double)var4 + 0.5D, (double)var5 + 0.5D, (double)var6 + 0.5D, "fire.ignite", 1.0F, f.nextFloat() * 0.4F + 0.8F); -- var3.setBlock(var4, var5, var6, Block.fire.blockID); -+ int var11 = par3World.getBlockId(par4, par5, par6); -+ -+ if (var11 == 0) { -+ par3World.playSoundEffect((double)par4 + 0.5D, (double)par5 + 0.5D, (double)par6 + 0.5D, "fire.ignite", 1.0F, itemRand.nextFloat() * 0.4F + 0.8F); -+ par3World.setBlock(par4, par5, par6, Block.fire.blockID); - } - -- if(!var2.capabilities.isCreativeMode) { -- --var1.stackSize; -+ if (!par2EntityPlayer.capabilities.isCreativeMode) { -+ --par1ItemStack.stackSize; - } - - return true; ---- net/minecraft/src/EntityAIRestrictOpenDoor.java -+++ net/minecraft/src/EntityAIRestrictOpenDoor.java -@@ -4,16 +4,20 @@ - private EntityCreature entityObj; - private VillageDoorInfo frontDoor; - -- public EntityAIRestrictOpenDoor(EntityCreature var1) { -- this.entityObj = var1; -+ public EntityAIRestrictOpenDoor(EntityCreature par1EntityCreature) { -+ this.entityObj = par1EntityCreature; - } - -+ /** -+ * Returns whether the EntityAIBase should begin execution. -+ */ - public boolean shouldExecute() { -- if(this.entityObj.worldObj.isDaytime()) { -+ if (this.entityObj.worldObj.isDaytime()) { - return false; - } else { - Village var1 = this.entityObj.worldObj.villageCollectionObj.findNearestVillage(MathHelper.floor_double(this.entityObj.posX), MathHelper.floor_double(this.entityObj.posY), MathHelper.floor_double(this.entityObj.posZ), 16); -- if(var1 == null) { -+ -+ if (var1 == null) { - return false; - } else { - this.frontDoor = var1.findNearestDoor(MathHelper.floor_double(this.entityObj.posX), MathHelper.floor_double(this.entityObj.posY), MathHelper.floor_double(this.entityObj.posZ)); -@@ -22,21 +26,33 @@ - } - } - -+ /** -+ * Returns whether an in-progress EntityAIBase should continue executing -+ */ - public boolean continueExecuting() { - return this.entityObj.worldObj.isDaytime() ? false : !this.frontDoor.isDetachedFromVillageFlag && this.frontDoor.isInside(MathHelper.floor_double(this.entityObj.posX), MathHelper.floor_double(this.entityObj.posZ)); - } - -+ /** -+ * Execute a one shot task or start executing a continuous task -+ */ - public void startExecuting() { - this.entityObj.getNavigator().setBreakDoors(false); - this.entityObj.getNavigator().setEnterDoors(false); - } - -+ /** -+ * Resets the task -+ */ - public void resetTask() { - this.entityObj.getNavigator().setBreakDoors(true); - this.entityObj.getNavigator().setEnterDoors(true); - this.frontDoor = null; - } - -+ /** -+ * Updates the task -+ */ - public void updateTask() { - this.frontDoor.incrementDoorOpeningRestrictionCounter(); - } ---- net/minecraft/src/ItemCarrotOnAStick.java -+++ net/minecraft/src/ItemCarrotOnAStick.java -@@ -1,35 +1,46 @@ - package net.minecraft.src; - - public class ItemCarrotOnAStick extends Item { -- public ItemCarrotOnAStick(int var1) { -- super(var1); -+ public ItemCarrotOnAStick(int par1) { -+ super(par1); - this.setCreativeTab(CreativeTabs.tabTransport); - this.setMaxStackSize(1); - this.setMaxDamage(25); - } - -+ /** -+ * Returns True is the item is renderer in full 3D when hold. -+ */ - public boolean isFull3D() { - return true; - } - -+ /** -+ * Returns true if this item should be rotated by 180 degrees around the Y axis when being held in an entities hands. -+ */ - public boolean shouldRotateAroundWhenRendering() { - return true; - } - -- public ItemStack onItemRightClick(ItemStack var1, World var2, EntityPlayer var3) { -- if(var3.isRiding() && var3.ridingEntity instanceof EntityPig) { -- EntityPig var4 = (EntityPig)var3.ridingEntity; -- if(var4.getAIControlledByPlayer().isControlledByPlayer() && var1.getMaxDamage() - var1.getItemDamage() >= 7) { -+ /** -+ * Called whenever this item is equipped and the right mouse button is pressed. Args: itemStack, world, entityPlayer -+ */ -+ public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) { -+ if (par3EntityPlayer.isRiding() && par3EntityPlayer.ridingEntity instanceof EntityPig) { -+ EntityPig var4 = (EntityPig)par3EntityPlayer.ridingEntity; -+ -+ if (var4.getAIControlledByPlayer().isControlledByPlayer() && par1ItemStack.getMaxDamage() - par1ItemStack.getItemDamage() >= 7) { - var4.getAIControlledByPlayer().boostSpeed(); -- var1.damageItem(7, var3); -- if(var1.stackSize == 0) { -+ par1ItemStack.damageItem(7, par3EntityPlayer); -+ -+ if (par1ItemStack.stackSize == 0) { - ItemStack var5 = new ItemStack(Item.fishingRod); -- var5.setTagCompound(var1.stackTagCompound); -+ var5.setTagCompound(par1ItemStack.stackTagCompound); - return var5; - } - } - } - -- return var1; -+ return par1ItemStack; - } - } ---- net/minecraft/src/CallableBlockType.java -+++ net/minecraft/src/CallableBlockType.java -@@ -5,13 +5,13 @@ - final class CallableBlockType implements Callable { - final int blockID; - -- CallableBlockType(int var1) { -- this.blockID = var1; -+ CallableBlockType(int par1) { -+ this.blockID = par1; - } - - public String callBlockType() { - try { -- return String.format("ID #%d (%s // %s)", new Object[]{Integer.valueOf(this.blockID), Block.blocksList[this.blockID].getUnlocalizedName(), Block.blocksList[this.blockID].getClass().getCanonicalName()}); -+ return String.format("ID #%d (%s // %s)", new Object[] {Integer.valueOf(this.blockID), Block.blocksList[this.blockID].getUnlocalizedName(), Block.blocksList[this.blockID].getClass().getCanonicalName()}); - } catch (Throwable var2) { - return "ID #" + this.blockID; - } ---- /dev/null -+++ com/prupe/mcpatcher/Config$FileEntry.java -@@ -1,0 +1,13 @@ -+package com.prupe.mcpatcher; -+ -+class Config$FileEntry { -+ String from; -+ String to; -+ -+ private Config$FileEntry() {} -+ -+ Config$FileEntry(String from, String to) { -+ this.from = from; -+ this.to = to; -+ } -+} ---- /dev/null -+++ org/spoutcraft/client/player/accessories/Tail.java -@@ -1,0 +1,78 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.client.player.accessories; -+ -+import org.lwjgl.opengl.GL11; -+ -+import net.minecraft.src.EntityPlayer; -+import net.minecraft.src.MathHelper; -+import net.minecraft.src.ModelBiped; -+import net.minecraft.src.ModelRenderer; -+ -+public class Tail extends Accessory { -+ public ModelRenderer Tail; -+ -+ public Tail(ModelBiped mb) { -+ super(mb); -+ Tail = new ModelRenderer(mb, 0, 0); -+ Tail.addBox(0.0F, 0.0F, 0.0F, 1, 10, 1); -+ Tail.setRotationPoint(-0.5F, 0F, -1F); -+ } -+ -+ @Override -+ public void render(EntityPlayer par1EntityPlayer, float f, float par2) { -+ GL11.glPushMatrix(); -+ GL11.glTranslatef(0.0F, 0.75F, 0.125F); -+ double d = (par1EntityPlayer.field_71091_bM + (par1EntityPlayer.field_71094_bP - par1EntityPlayer.field_71091_bM) * (double) par2) - (par1EntityPlayer.prevPosX + (par1EntityPlayer.posX - par1EntityPlayer.prevPosX) * (double) par2); -+ double d1 = (par1EntityPlayer.field_71096_bN + (par1EntityPlayer.field_71095_bQ - par1EntityPlayer.field_71096_bN) * (double) par2) - (par1EntityPlayer.prevPosY + (par1EntityPlayer.posY - par1EntityPlayer.prevPosY) * (double) par2); -+ double d2 = (par1EntityPlayer.field_71097_bO + (par1EntityPlayer.field_71085_bR - par1EntityPlayer.field_71097_bO) * (double) par2) - (par1EntityPlayer.prevPosZ + (par1EntityPlayer.posZ - par1EntityPlayer.prevPosZ) * (double) par2); -+ float f8 = par1EntityPlayer.prevRenderYawOffset + (par1EntityPlayer.renderYawOffset - par1EntityPlayer.prevRenderYawOffset) * par2; -+ double d3 = MathHelper.sin((f8 * 3.141593F) / 180F); -+ double d4 = -MathHelper.cos((f8 * 3.141593F) / 180F); -+ float f9 = (float) d1 * 10F; -+ if (f9 < -6F) { -+ f9 = -6F; -+ } -+ if (f9 > 32F) { -+ f9 = 32F; -+ } -+ float f10 = (float) (d * d3 + d2 * d4) * 100F; -+ float f11 = (float) (d * d4 - d2 * d3) * 100F; -+ if (f10 < 0.0F) { -+ f10 = 0.0F; -+ } -+ float f12 = par1EntityPlayer.prevCameraYaw + (par1EntityPlayer.cameraYaw - par1EntityPlayer.prevCameraYaw) * par2; -+ f9 += MathHelper.sin((par1EntityPlayer.prevDistanceWalkedModified + (par1EntityPlayer.distanceWalkedModified - par1EntityPlayer.prevDistanceWalkedModified) * par2) * 6F) * 32F * f12; -+ if (par1EntityPlayer.isSneaking()) { -+ f9 += 25F; -+ } -+ GL11.glRotatef(6F + f10 / 2.0F + f9, 1.0F, 0.0F, 0.0F); -+ GL11.glRotatef(f11 / 2.0F, 0.0F, 0.0F, 1.0F); -+ GL11.glRotatef(-f11 / 2.0F, 0.0F, 0.0F, 0.0F); -+ GL11.glRotatef(180F, 0.0F, 1.0F, 0.0F); -+ Tail.render(f); -+ GL11.glPopMatrix(); -+ } -+ -+ @Override -+ public AccessoryType getType() { -+ return AccessoryType.TAIL; -+ } -+} ---- net/minecraft/src/EntityArrow.java -+++ net/minecraft/src/EntityArrow.java -@@ -9,154 +9,182 @@ - private int inTile; - private int inData; - private boolean inGround; -+ -+ /** 1 if the player can pick up the arrow */ - public int canBePickedUp; -+ -+ /** Seems to be some sort of timer for animating an arrow. */ - public int arrowShake; -+ -+ /** The owner of this arrow. */ - public Entity shootingEntity; - private int ticksInGround; - private int ticksInAir; - private double damage = 2.0D; -+ -+ /** The amount of knockback an arrow applies when it hits a mob. */ - private int knockbackStrength; - -- public EntityArrow(World var1) { -- super(var1); -+ public EntityArrow(World par1World) { -+ super(par1World); - this.renderDistanceWeight = 10.0D; - this.setSize(0.5F, 0.5F); - } - -- public EntityArrow(World var1, double var2, double var4, double var6) { -- super(var1); -+ public EntityArrow(World par1World, double par2, double par4, double par6) { -+ super(par1World); - this.renderDistanceWeight = 10.0D; - this.setSize(0.5F, 0.5F); -- this.setPosition(var2, var4, var6); -+ this.setPosition(par2, par4, par6); - this.yOffset = 0.0F; - } - -- public EntityArrow(World var1, EntityLivingBase var2, EntityLivingBase var3, float var4, float var5) { -- super(var1); -+ public EntityArrow(World par1World, EntityLivingBase par2EntityLivingBase, EntityLivingBase par3EntityLivingBase, float par4, float par5) { -+ super(par1World); - this.renderDistanceWeight = 10.0D; -- this.shootingEntity = var2; -- if(var2 instanceof EntityPlayer) { -+ this.shootingEntity = par2EntityLivingBase; -+ -+ if (par2EntityLivingBase instanceof EntityPlayer) { - this.canBePickedUp = 1; - } - -- this.posY = var2.posY + (double)var2.getEyeHeight() - (double)0.1F; -- double var6 = var3.posX - var2.posX; -- double var8 = var3.boundingBox.minY + (double)(var3.height / 3.0F) - this.posY; -- double var10 = var3.posZ - var2.posZ; -+ this.posY = par2EntityLivingBase.posY + (double)par2EntityLivingBase.getEyeHeight() - 0.10000000149011612D; -+ double var6 = par3EntityLivingBase.posX - par2EntityLivingBase.posX; -+ double var8 = par3EntityLivingBase.boundingBox.minY + (double)(par3EntityLivingBase.height / 3.0F) - this.posY; -+ double var10 = par3EntityLivingBase.posZ - par2EntityLivingBase.posZ; - double var12 = (double)MathHelper.sqrt_double(var6 * var6 + var10 * var10); -- if(var12 >= 1.0E-7D) { -- float var14 = (float)(Math.atan2(var10, var6) * 180.0D / (double)((float)Math.PI)) - 90.0F; -- float var15 = (float)(-(Math.atan2(var8, var12) * 180.0D / (double)((float)Math.PI))); -+ -+ if (var12 >= 1.0E-7D) { -+ float var14 = (float)(Math.atan2(var10, var6) * 180.0D / Math.PI) - 90.0F; -+ float var15 = (float)(-(Math.atan2(var8, var12) * 180.0D / Math.PI)); - double var16 = var6 / var12; - double var18 = var10 / var12; -- this.setLocationAndAngles(var2.posX + var16, this.posY, var2.posZ + var18, var14, var15); -+ this.setLocationAndAngles(par2EntityLivingBase.posX + var16, this.posY, par2EntityLivingBase.posZ + var18, var14, var15); - this.yOffset = 0.0F; - float var20 = (float)var12 * 0.2F; -- this.setThrowableHeading(var6, var8 + (double)var20, var10, var4, var5); -+ this.setThrowableHeading(var6, var8 + (double)var20, var10, par4, par5); - } - } - -- public EntityArrow(World var1, EntityLivingBase var2, float var3) { -- super(var1); -+ public EntityArrow(World par1World, EntityLivingBase par2EntityLivingBase, float par3) { -+ super(par1World); - this.renderDistanceWeight = 10.0D; -- this.shootingEntity = var2; -- if(var2 instanceof EntityPlayer) { -+ this.shootingEntity = par2EntityLivingBase; -+ -+ if (par2EntityLivingBase instanceof EntityPlayer) { - this.canBePickedUp = 1; - } - - this.setSize(0.5F, 0.5F); -- this.setLocationAndAngles(var2.posX, var2.posY + (double)var2.getEyeHeight(), var2.posZ, var2.rotationYaw, var2.rotationPitch); -+ this.setLocationAndAngles(par2EntityLivingBase.posX, par2EntityLivingBase.posY + (double)par2EntityLivingBase.getEyeHeight(), par2EntityLivingBase.posZ, par2EntityLivingBase.rotationYaw, par2EntityLivingBase.rotationPitch); - this.posX -= (double)(MathHelper.cos(this.rotationYaw / 180.0F * (float)Math.PI) * 0.16F); -- this.posY -= (double)0.1F; -+ this.posY -= 0.10000000149011612D; - this.posZ -= (double)(MathHelper.sin(this.rotationYaw / 180.0F * (float)Math.PI) * 0.16F); - this.setPosition(this.posX, this.posY, this.posZ); - this.yOffset = 0.0F; - this.motionX = (double)(-MathHelper.sin(this.rotationYaw / 180.0F * (float)Math.PI) * MathHelper.cos(this.rotationPitch / 180.0F * (float)Math.PI)); - this.motionZ = (double)(MathHelper.cos(this.rotationYaw / 180.0F * (float)Math.PI) * MathHelper.cos(this.rotationPitch / 180.0F * (float)Math.PI)); - this.motionY = (double)(-MathHelper.sin(this.rotationPitch / 180.0F * (float)Math.PI)); -- this.setThrowableHeading(this.motionX, this.motionY, this.motionZ, var3 * 1.5F, 1.0F); -+ this.setThrowableHeading(this.motionX, this.motionY, this.motionZ, par3 * 1.5F, 1.0F); - } - - protected void entityInit() { - this.dataWatcher.addObject(16, Byte.valueOf((byte)0)); - } - -- public void setThrowableHeading(double var1, double var3, double var5, float var7, float var8) { -- float var9 = MathHelper.sqrt_double(var1 * var1 + var3 * var3 + var5 * var5); -- var1 /= (double)var9; -- var3 /= (double)var9; -- var5 /= (double)var9; -- var1 += this.ab.nextGaussian() * (double)(this.ab.nextBoolean() ? -1 : 1) * (double)0.0075F * (double)var8; -- var3 += this.ab.nextGaussian() * (double)(this.ab.nextBoolean() ? -1 : 1) * (double)0.0075F * (double)var8; -- var5 += this.ab.nextGaussian() * (double)(this.ab.nextBoolean() ? -1 : 1) * (double)0.0075F * (double)var8; -- var1 *= (double)var7; -- var3 *= (double)var7; -- var5 *= (double)var7; -- this.motionX = var1; -- this.motionY = var3; -- this.motionZ = var5; -- float var10 = MathHelper.sqrt_double(var1 * var1 + var5 * var5); -- this.prevRotationYaw = this.rotationYaw = (float)(Math.atan2(var1, var5) * 180.0D / (double)((float)Math.PI)); -- this.prevRotationPitch = this.rotationPitch = (float)(Math.atan2(var3, (double)var10) * 180.0D / (double)((float)Math.PI)); -+ /** -+ * Similar to setArrowHeading, it's point the throwable entity to a x, y, z direction. -+ */ -+ public void setThrowableHeading(double par1, double par3, double par5, float par7, float par8) { -+ float var9 = MathHelper.sqrt_double(par1 * par1 + par3 * par3 + par5 * par5); -+ par1 /= (double)var9; -+ par3 /= (double)var9; -+ par5 /= (double)var9; -+ par1 += this.rand.nextGaussian() * (double)(this.rand.nextBoolean() ? -1 : 1) * 0.007499999832361937D * (double)par8; -+ par3 += this.rand.nextGaussian() * (double)(this.rand.nextBoolean() ? -1 : 1) * 0.007499999832361937D * (double)par8; -+ par5 += this.rand.nextGaussian() * (double)(this.rand.nextBoolean() ? -1 : 1) * 0.007499999832361937D * (double)par8; -+ par1 *= (double)par7; -+ par3 *= (double)par7; -+ par5 *= (double)par7; -+ this.motionX = par1; -+ this.motionY = par3; -+ this.motionZ = par5; -+ float var10 = MathHelper.sqrt_double(par1 * par1 + par5 * par5); -+ this.prevRotationYaw = this.rotationYaw = (float)(Math.atan2(par1, par5) * 180.0D / Math.PI); -+ this.prevRotationPitch = this.rotationPitch = (float)(Math.atan2(par3, (double)var10) * 180.0D / Math.PI); - this.ticksInGround = 0; - } - -- public void setPositionAndRotation2(double var1, double var3, double var5, float var7, float var8, int var9) { -- this.setPosition(var1, var3, var5); -- this.setRotation(var7, var8); -+ /** -+ * Sets the position and rotation. Only difference from the other one is no bounding on the rotation. Args: posX, posY, -+ * posZ, yaw, pitch -+ */ -+ public void setPositionAndRotation2(double par1, double par3, double par5, float par7, float par8, int par9) { -+ this.setPosition(par1, par3, par5); -+ this.setRotation(par7, par8); - } - -- public void setVelocity(double var1, double var3, double var5) { -- this.motionX = var1; -- this.motionY = var3; -- this.motionZ = var5; -- if(this.prevRotationPitch == 0.0F && this.prevRotationYaw == 0.0F) { -- float var7 = MathHelper.sqrt_double(var1 * var1 + var5 * var5); -- this.prevRotationYaw = this.rotationYaw = (float)(Math.atan2(var1, var5) * 180.0D / (double)((float)Math.PI)); -- this.prevRotationPitch = this.rotationPitch = (float)(Math.atan2(var3, (double)var7) * 180.0D / (double)((float)Math.PI)); -+ /** -+ * Sets the velocity to the args. Args: x, y, z -+ */ -+ public void setVelocity(double par1, double par3, double par5) { -+ this.motionX = par1; -+ this.motionY = par3; -+ this.motionZ = par5; -+ -+ if (this.prevRotationPitch == 0.0F && this.prevRotationYaw == 0.0F) { -+ float var7 = MathHelper.sqrt_double(par1 * par1 + par5 * par5); -+ this.prevRotationYaw = this.rotationYaw = (float)(Math.atan2(par1, par5) * 180.0D / Math.PI); -+ this.prevRotationPitch = this.rotationPitch = (float)(Math.atan2(par3, (double)var7) * 180.0D / Math.PI); - this.prevRotationPitch = this.rotationPitch; - this.prevRotationYaw = this.rotationYaw; - this.setLocationAndAngles(this.posX, this.posY, this.posZ, this.rotationYaw, this.rotationPitch); - this.ticksInGround = 0; - } -- - } - -+ /** -+ * Called to update the entity's position/logic. -+ */ - public void onUpdate() { - super.onUpdate(); -- if(this.prevRotationPitch == 0.0F && this.prevRotationYaw == 0.0F) { -+ -+ if (this.prevRotationPitch == 0.0F && this.prevRotationYaw == 0.0F) { - float var1 = MathHelper.sqrt_double(this.motionX * this.motionX + this.motionZ * this.motionZ); -- this.prevRotationYaw = this.rotationYaw = (float)(Math.atan2(this.motionX, this.motionZ) * 180.0D / (double)((float)Math.PI)); -- this.prevRotationPitch = this.rotationPitch = (float)(Math.atan2(this.motionY, (double)var1) * 180.0D / (double)((float)Math.PI)); -+ this.prevRotationYaw = this.rotationYaw = (float)(Math.atan2(this.motionX, this.motionZ) * 180.0D / Math.PI); -+ this.prevRotationPitch = this.rotationPitch = (float)(Math.atan2(this.motionY, (double)var1) * 180.0D / Math.PI); - } - - int var16 = this.worldObj.getBlockId(this.xTile, this.yTile, this.zTile); -- if(var16 > 0) { -+ -+ if (var16 > 0) { - Block.blocksList[var16].setBlockBoundsBasedOnState(this.worldObj, this.xTile, this.yTile, this.zTile); - AxisAlignedBB var2 = Block.blocksList[var16].getCollisionBoundingBoxFromPool(this.worldObj, this.xTile, this.yTile, this.zTile); -- if(var2 != null && var2.isVecInside(this.worldObj.getWorldVec3Pool().getVecFromPool(this.posX, this.posY, this.posZ))) { -+ -+ if (var2 != null && var2.isVecInside(this.worldObj.getWorldVec3Pool().getVecFromPool(this.posX, this.posY, this.posZ))) { - this.inGround = true; - } - } - -- if(this.arrowShake > 0) { -+ if (this.arrowShake > 0) { - --this.arrowShake; - } - -- if(this.inGround) { -+ if (this.inGround) { - int var18 = this.worldObj.getBlockId(this.xTile, this.yTile, this.zTile); - int var19 = this.worldObj.getBlockMetadata(this.xTile, this.yTile, this.zTile); -- if(var18 == this.inTile && var19 == this.inData) { -+ -+ if (var18 == this.inTile && var19 == this.inData) { - ++this.ticksInGround; -- if(this.ticksInGround == 1200) { -+ -+ if (this.ticksInGround == 1200) { - this.setDead(); - } -- - } else { - this.inGround = false; -- this.motionX *= (double)(this.ab.nextFloat() * 0.2F); -- this.motionY *= (double)(this.ab.nextFloat() * 0.2F); -- this.motionZ *= (double)(this.ab.nextFloat() * 0.2F); -+ this.motionX *= (double)(this.rand.nextFloat() * 0.2F); -+ this.motionY *= (double)(this.rand.nextFloat() * 0.2F); -+ this.motionZ *= (double)(this.rand.nextFloat() * 0.2F); - this.ticksInGround = 0; - this.ticksInAir = 0; - } -@@ -164,28 +192,32 @@ - ++this.ticksInAir; - Vec3 var17 = this.worldObj.getWorldVec3Pool().getVecFromPool(this.posX, this.posY, this.posZ); - Vec3 var3 = this.worldObj.getWorldVec3Pool().getVecFromPool(this.posX + this.motionX, this.posY + this.motionY, this.posZ + this.motionZ); -- MovingObjectPosition var4 = this.worldObj.rayTraceBlocks(var17, var3, false, true); -+ MovingObjectPosition var4 = this.worldObj.rayTraceBlocks_do_do(var17, var3, false, true); - var17 = this.worldObj.getWorldVec3Pool().getVecFromPool(this.posX, this.posY, this.posZ); - var3 = this.worldObj.getWorldVec3Pool().getVecFromPool(this.posX + this.motionX, this.posY + this.motionY, this.posZ + this.motionZ); -- if(var4 != null) { -+ -+ if (var4 != null) { - var3 = this.worldObj.getWorldVec3Pool().getVecFromPool(var4.hitVec.xCoord, var4.hitVec.yCoord, var4.hitVec.zCoord); - } - - Entity var5 = null; - List var6 = this.worldObj.getEntitiesWithinAABBExcludingEntity(this, this.boundingBox.addCoord(this.motionX, this.motionY, this.motionZ).expand(1.0D, 1.0D, 1.0D)); - double var7 = 0.0D; -- - int var9; - float var11; -- for(var9 = 0; var9 < var6.size(); ++var9) { -+ -+ for (var9 = 0; var9 < var6.size(); ++var9) { - Entity var10 = (Entity)var6.get(var9); -- if(var10.canBeCollidedWith() && (var10 != this.shootingEntity || this.ticksInAir >= 5)) { -+ -+ if (var10.canBeCollidedWith() && (var10 != this.shootingEntity || this.ticksInAir >= 5)) { - var11 = 0.3F; - AxisAlignedBB var12 = var10.boundingBox.expand((double)var11, (double)var11, (double)var11); - MovingObjectPosition var13 = var12.calculateIntercept(var17, var3); -- if(var13 != null) { -+ -+ if (var13 != null) { - double var14 = var17.distanceTo(var13.hitVec); -- if(var14 < var7 || var7 == 0.0D) { -+ -+ if (var14 < var7 || var7 == 0.0D) { - var5 = var10; - var7 = var14; - } -@@ -193,69 +225,76 @@ - } - } - -- if(var5 != null) { -+ if (var5 != null) { - var4 = new MovingObjectPosition(var5); - } - -- if(var4 != null && var4.entityHit != null && var4.entityHit instanceof EntityPlayer) { -+ if (var4 != null && var4.entityHit != null && var4.entityHit instanceof EntityPlayer) { - EntityPlayer var20 = (EntityPlayer)var4.entityHit; -- if(var20.capabilities.disableDamage || this.shootingEntity instanceof EntityPlayer && !((EntityPlayer)this.shootingEntity).canAttackPlayer(var20)) { -+ -+ if (var20.capabilities.disableDamage || this.shootingEntity instanceof EntityPlayer && !((EntityPlayer)this.shootingEntity).canAttackPlayer(var20)) { - var4 = null; - } - } - - float var21; - float var27; -- if(var4 != null) { -- if(var4.entityHit != null) { -+ -+ if (var4 != null) { -+ if (var4.entityHit != null) { - var21 = MathHelper.sqrt_double(this.motionX * this.motionX + this.motionY * this.motionY + this.motionZ * this.motionZ); - int var22 = MathHelper.ceiling_double_int((double)var21 * this.damage); -- if(this.getIsCritical()) { -- var22 += this.ab.nextInt(var22 / 2 + 2); -+ -+ if (this.getIsCritical()) { -+ var22 += this.rand.nextInt(var22 / 2 + 2); - } - - DamageSource var23 = null; -- if(this.shootingEntity == null) { -+ -+ if (this.shootingEntity == null) { - var23 = DamageSource.causeArrowDamage(this, this); - } else { - var23 = DamageSource.causeArrowDamage(this, this.shootingEntity); - } - -- if(this.isBurning() && !(var4.entityHit instanceof EntityEnderman)) { -+ if (this.isBurning() && !(var4.entityHit instanceof EntityEnderman)) { - var4.entityHit.setFire(5); - } - -- if(var4.entityHit.attackEntityFrom(var23, (float)var22)) { -- if(var4.entityHit instanceof EntityLivingBase) { -+ if (var4.entityHit.attackEntityFrom(var23, (float)var22)) { -+ if (var4.entityHit instanceof EntityLivingBase) { - EntityLivingBase var25 = (EntityLivingBase)var4.entityHit; -- if(!this.worldObj.isRemote) { -+ -+ if (!this.worldObj.isRemote) { - var25.setArrowCountInEntity(var25.getArrowCountInEntity() + 1); - } - -- if(this.knockbackStrength > 0) { -+ if (this.knockbackStrength > 0) { - var27 = MathHelper.sqrt_double(this.motionX * this.motionX + this.motionZ * this.motionZ); -- if(var27 > 0.0F) { -- var4.entityHit.addVelocity(this.motionX * (double)this.knockbackStrength * (double)0.6F / (double)var27, 0.1D, this.motionZ * (double)this.knockbackStrength * (double)0.6F / (double)var27); -+ -+ if (var27 > 0.0F) { -+ var4.entityHit.addVelocity(this.motionX * (double)this.knockbackStrength * 0.6000000238418579D / (double)var27, 0.1D, this.motionZ * (double)this.knockbackStrength * 0.6000000238418579D / (double)var27); - } - } - -- if(this.shootingEntity != null) { -- EnchantmentThorns.func_92096_a(this.shootingEntity, var25, this.ab); -+ if (this.shootingEntity != null) { -+ EnchantmentThorns.func_92096_a(this.shootingEntity, var25, this.rand); - } - -- if(this.shootingEntity != null && var4.entityHit != this.shootingEntity && var4.entityHit instanceof EntityPlayer && this.shootingEntity instanceof EntityPlayerMP) { -- ((EntityPlayerMP)this.shootingEntity).playerNetServerHandler.sendPacket(new Packet70GameEvent(6, 0)); -+ if (this.shootingEntity != null && var4.entityHit != this.shootingEntity && var4.entityHit instanceof EntityPlayer && this.shootingEntity instanceof EntityPlayerMP) { -+ ((EntityPlayerMP)this.shootingEntity).playerNetServerHandler.sendPacketToPlayer(new Packet70GameEvent(6, 0)); - } - } - -- this.playSound("random.bowhit", 1.0F, 1.2F / (this.ab.nextFloat() * 0.2F + 0.9F)); -- if(!(var4.entityHit instanceof EntityEnderman)) { -+ this.playSound("random.bowhit", 1.0F, 1.2F / (this.rand.nextFloat() * 0.2F + 0.9F)); -+ -+ if (!(var4.entityHit instanceof EntityEnderman)) { - this.setDead(); - } - } else { -- this.motionX *= (double)-0.1F; -- this.motionY *= (double)-0.1F; -- this.motionZ *= (double)-0.1F; -+ this.motionX *= -0.10000000149011612D; -+ this.motionY *= -0.10000000149011612D; -+ this.motionZ *= -0.10000000149011612D; - this.rotationYaw += 180.0F; - this.prevRotationYaw += 180.0F; - this.ticksInAir = 0; -@@ -270,21 +309,22 @@ - this.motionY = (double)((float)(var4.hitVec.yCoord - this.posY)); - this.motionZ = (double)((float)(var4.hitVec.zCoord - this.posZ)); - var21 = MathHelper.sqrt_double(this.motionX * this.motionX + this.motionY * this.motionY + this.motionZ * this.motionZ); -- this.posX -= this.motionX / (double)var21 * (double)0.05F; -- this.posY -= this.motionY / (double)var21 * (double)0.05F; -- this.posZ -= this.motionZ / (double)var21 * (double)0.05F; -- this.playSound("random.bowhit", 1.0F, 1.2F / (this.ab.nextFloat() * 0.2F + 0.9F)); -+ this.posX -= this.motionX / (double)var21 * 0.05000000074505806D; -+ this.posY -= this.motionY / (double)var21 * 0.05000000074505806D; -+ this.posZ -= this.motionZ / (double)var21 * 0.05000000074505806D; -+ this.playSound("random.bowhit", 1.0F, 1.2F / (this.rand.nextFloat() * 0.2F + 0.9F)); - this.inGround = true; - this.arrowShake = 7; - this.setIsCritical(false); -- if(this.inTile != 0) { -+ -+ if (this.inTile != 0) { - Block.blocksList[this.inTile].onEntityCollidedWithBlock(this.worldObj, this.xTile, this.yTile, this.zTile, this); - } - } - } - -- if(this.getIsCritical()) { -- for(var9 = 0; var9 < 4; ++var9) { -+ if (this.getIsCritical()) { -+ for (var9 = 0; var9 < 4; ++var9) { - this.worldObj.spawnParticle("crit", this.posX + this.motionX * (double)var9 / 4.0D, this.posY + this.motionY * (double)var9 / 4.0D, this.posZ + this.motionZ * (double)var9 / 4.0D, -this.motionX, -this.motionY + 0.2D, -this.motionZ); - } - } -@@ -293,20 +333,21 @@ - this.posY += this.motionY; - this.posZ += this.motionZ; - var21 = MathHelper.sqrt_double(this.motionX * this.motionX + this.motionZ * this.motionZ); -- this.rotationYaw = (float)(Math.atan2(this.motionX, this.motionZ) * 180.0D / (double)((float)Math.PI)); -+ this.rotationYaw = (float)(Math.atan2(this.motionX, this.motionZ) * 180.0D / Math.PI); - -- for(this.rotationPitch = (float)(Math.atan2(this.motionY, (double)var21) * 180.0D / (double)((float)Math.PI)); this.rotationPitch - this.prevRotationPitch < -180.0F; this.prevRotationPitch -= 360.0F) { -+ for (this.rotationPitch = (float)(Math.atan2(this.motionY, (double)var21) * 180.0D / Math.PI); this.rotationPitch - this.prevRotationPitch < -180.0F; this.prevRotationPitch -= 360.0F) { -+ ; - } - -- while(this.rotationPitch - this.prevRotationPitch >= 180.0F) { -+ while (this.rotationPitch - this.prevRotationPitch >= 180.0F) { - this.prevRotationPitch += 360.0F; - } - -- while(this.rotationYaw - this.prevRotationYaw < -180.0F) { -+ while (this.rotationYaw - this.prevRotationYaw < -180.0F) { - this.prevRotationYaw -= 360.0F; - } - -- while(this.rotationYaw - this.prevRotationYaw >= 180.0F) { -+ while (this.rotationYaw - this.prevRotationYaw >= 180.0F) { - this.prevRotationYaw += 360.0F; - } - -@@ -314,8 +355,9 @@ - this.rotationYaw = this.prevRotationYaw + (this.rotationYaw - this.prevRotationYaw) * 0.2F; - float var24 = 0.99F; - var11 = 0.05F; -- if(this.isInWater()) { -- for(int var26 = 0; var26 < 4; ++var26) { -+ -+ if (this.isInWater()) { -+ for (int var26 = 0; var26 < 4; ++var26) { - var27 = 0.25F; - this.worldObj.spawnParticle("bubble", this.posX - this.motionX * (double)var27, this.posY - this.motionY * (double)var27, this.posZ - this.motionZ * (double)var27, this.motionX, this.motionY, this.motionZ); - } -@@ -332,54 +374,67 @@ - } - } - -- public void writeEntityToNBT(NBTTagCompound var1) { -- var1.setShort("xTile", (short)this.xTile); -- var1.setShort("yTile", (short)this.yTile); -- var1.setShort("zTile", (short)this.zTile); -- var1.setByte("inTile", (byte)this.inTile); -- var1.setByte("inData", (byte)this.inData); -- var1.setByte("shake", (byte)this.arrowShake); -- var1.setByte("inGround", (byte)(this.inGround ? 1 : 0)); -- var1.setByte("pickup", (byte)this.canBePickedUp); -- var1.setDouble("damage", this.damage); -- } -- -- public void readEntityFromNBT(NBTTagCompound var1) { -- this.xTile = var1.getShort("xTile"); -- this.yTile = var1.getShort("yTile"); -- this.zTile = var1.getShort("zTile"); -- this.inTile = var1.getByte("inTile") & 255; -- this.inData = var1.getByte("inData") & 255; -- this.arrowShake = var1.getByte("shake") & 255; -- this.inGround = var1.getByte("inGround") == 1; -- if(var1.hasKey("damage")) { -- this.damage = var1.getDouble("damage"); -- } -- -- if(var1.hasKey("pickup")) { -- this.canBePickedUp = var1.getByte("pickup"); -- } else if(var1.hasKey("player")) { -- this.canBePickedUp = var1.getBoolean("player") ? 1 : 0; -- } -- -- } -- -- public void onCollideWithPlayer(EntityPlayer var1) { -- if(!this.worldObj.isRemote && this.inGround && this.arrowShake <= 0) { -- boolean var2 = this.canBePickedUp == 1 || this.canBePickedUp == 2 && var1.capabilities.isCreativeMode; -- if(this.canBePickedUp == 1 && !var1.inventory.addItemStackToInventory(new ItemStack(Item.arrow, 1))) { -+ /** -+ * (abstract) Protected helper method to write subclass entity data to NBT. -+ */ -+ public void writeEntityToNBT(NBTTagCompound par1NBTTagCompound) { -+ par1NBTTagCompound.setShort("xTile", (short)this.xTile); -+ par1NBTTagCompound.setShort("yTile", (short)this.yTile); -+ par1NBTTagCompound.setShort("zTile", (short)this.zTile); -+ par1NBTTagCompound.setByte("inTile", (byte)this.inTile); -+ par1NBTTagCompound.setByte("inData", (byte)this.inData); -+ par1NBTTagCompound.setByte("shake", (byte)this.arrowShake); -+ par1NBTTagCompound.setByte("inGround", (byte)(this.inGround ? 1 : 0)); -+ par1NBTTagCompound.setByte("pickup", (byte)this.canBePickedUp); -+ par1NBTTagCompound.setDouble("damage", this.damage); -+ } -+ -+ /** -+ * (abstract) Protected helper method to read subclass entity data from NBT. -+ */ -+ public void readEntityFromNBT(NBTTagCompound par1NBTTagCompound) { -+ this.xTile = par1NBTTagCompound.getShort("xTile"); -+ this.yTile = par1NBTTagCompound.getShort("yTile"); -+ this.zTile = par1NBTTagCompound.getShort("zTile"); -+ this.inTile = par1NBTTagCompound.getByte("inTile") & 255; -+ this.inData = par1NBTTagCompound.getByte("inData") & 255; -+ this.arrowShake = par1NBTTagCompound.getByte("shake") & 255; -+ this.inGround = par1NBTTagCompound.getByte("inGround") == 1; -+ -+ if (par1NBTTagCompound.hasKey("damage")) { -+ this.damage = par1NBTTagCompound.getDouble("damage"); -+ } -+ -+ if (par1NBTTagCompound.hasKey("pickup")) { -+ this.canBePickedUp = par1NBTTagCompound.getByte("pickup"); -+ } else if (par1NBTTagCompound.hasKey("player")) { -+ this.canBePickedUp = par1NBTTagCompound.getBoolean("player") ? 1 : 0; -+ } -+ } -+ -+ /** -+ * Called by a player entity when they collide with an entity -+ */ -+ public void onCollideWithPlayer(EntityPlayer par1EntityPlayer) { -+ if (!this.worldObj.isRemote && this.inGround && this.arrowShake <= 0) { -+ boolean var2 = this.canBePickedUp == 1 || this.canBePickedUp == 2 && par1EntityPlayer.capabilities.isCreativeMode; -+ -+ if (this.canBePickedUp == 1 && !par1EntityPlayer.inventory.addItemStackToInventory(new ItemStack(Item.arrow, 1))) { - var2 = false; - } - -- if(var2) { -- this.playSound("random.pop", 0.2F, ((this.ab.nextFloat() - this.ab.nextFloat()) * 0.7F + 1.0F) * 2.0F); -- var1.onItemPickup(this, 1); -+ if (var2) { -+ this.playSound("random.pop", 0.2F, ((this.rand.nextFloat() - this.rand.nextFloat()) * 0.7F + 1.0F) * 2.0F); -+ par1EntityPlayer.onItemPickup(this, 1); - this.setDead(); - } -- - } - } - -+ /** -+ * returns if this entity triggers Block.onEntityWalking on the blocks they walk on. used for spiders and wolves to -+ * prevent them from trampling crops -+ */ - protected boolean canTriggerWalking() { - return false; - } -@@ -388,32 +443,44 @@ - return 0.0F; - } - -- public void setDamage(double var1) { -- this.damage = var1; -+ public void setDamage(double par1) { -+ this.damage = par1; - } - - public double getDamage() { - return this.damage; - } - -- public void setKnockbackStrength(int var1) { -- this.knockbackStrength = var1; -+ /** -+ * Sets the amount of knockback the arrow applies when it hits a mob. -+ */ -+ public void setKnockbackStrength(int par1) { -+ this.knockbackStrength = par1; - } - -+ /** -+ * If returns false, the item will not inflict any damage against entities. -+ */ - public boolean canAttackWithItem() { - return false; - } - -- public void setIsCritical(boolean var1) { -+ /** -+ * Whether the arrow has a stream of critical hit particles flying behind it. -+ */ -+ public void setIsCritical(boolean par1) { - byte var2 = this.dataWatcher.getWatchableObjectByte(16); -- if(var1) { -+ -+ if (par1) { - this.dataWatcher.updateObject(16, Byte.valueOf((byte)(var2 | 1))); - } else { - this.dataWatcher.updateObject(16, Byte.valueOf((byte)(var2 & -2))); - } -- - } - -+ /** -+ * Whether the arrow has a stream of critical hit particles flying behind it. -+ */ - public boolean getIsCritical() { - byte var1 = this.dataWatcher.getWatchableObjectByte(16); - return (var1 & 1) != 0; ---- /dev/null -+++ org/spoutcraft/client/gui/settings/controls/FarViewButton.java -@@ -1,0 +1,42 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.client.gui.settings.controls; -+ -+import net.minecraft.src.Minecraft; -+ -+import org.spoutcraft.client.config.Configuration; -+ -+public class FarViewButton extends AutomatedCheckBox { -+ public FarViewButton() { -+ super("Far View"); -+ setChecked(Configuration.isFarView()); -+ setTooltip("Far View\nOFF - (default) standard view distance\nON - 3x view distance\nFar View is very resource demanding!\n3x view distance => 9x chunks to be loaded => FPS / 9\nStandard view distances: 32, 64, 128, 256\nFar view distances: 96, 192, 384, 512"); -+ } -+ -+ @Override -+ public void onButtonClick() { -+ Configuration.setFarView(!Configuration.isFarView()); -+ Configuration.write(); -+ -+ if (Minecraft.getMinecraft().theWorld != null) { -+ Minecraft.getMinecraft().renderGlobal.updateAllRenderers(); -+ } -+ } -+} ---- net/minecraft/src/BlockQuartz.java -+++ net/minecraft/src/BlockQuartz.java -@@ -3,91 +3,116 @@ - import java.util.List; - - public class BlockQuartz extends Block { -- public static final String[] a = new String[]{"default", "chiseled", "lines"}; -- private static final String[] b = new String[]{"side", "chiseled", "lines", null, null}; -+ public static final String[] quartzBlockTypes = new String[] {"default", "chiseled", "lines"}; -+ private static final String[] quartzBlockTextureTypes = new String[] {"side", "chiseled", "lines", null, null}; - private Icon[] quartzblockIcons; - private Icon quartzblock_chiseled_top; - private Icon quartzblock_lines_top; - private Icon quartzblock_top; - private Icon quartzblock_bottom; - -- public BlockQuartz(int var1) { -- super(var1, Material.rock); -+ public BlockQuartz(int par1) { -+ super(par1, Material.rock); - this.setCreativeTab(CreativeTabs.tabBlock); - } - -- public Icon getIcon(int var1, int var2) { -- if(var2 != 2 && var2 != 3 && var2 != 4) { -- if(var1 != 1 && (var1 != 0 || var2 != 1)) { -- if(var1 == 0) { -+ /** -+ * From the specified side and block metadata retrieves the blocks texture. Args: side, metadata -+ */ -+ public Icon getIcon(int par1, int par2) { -+ if (par2 != 2 && par2 != 3 && par2 != 4) { -+ if (par1 != 1 && (par1 != 0 || par2 != 1)) { -+ if (par1 == 0) { - return this.quartzblock_bottom; - } else { -- if(var2 < 0 || var2 >= this.quartzblockIcons.length) { -- var2 = 0; -+ if (par2 < 0 || par2 >= this.quartzblockIcons.length) { -+ par2 = 0; - } - -- return this.quartzblockIcons[var2]; -+ return this.quartzblockIcons[par2]; - } - } else { -- return var2 == 1 ? this.quartzblock_chiseled_top : this.quartzblock_top; -+ return par2 == 1 ? this.quartzblock_chiseled_top : this.quartzblock_top; - } - } else { -- return var2 != 2 || var1 != 1 && var1 != 0 ? (var2 != 3 || var1 != 5 && var1 != 4 ? (var2 != 4 || var1 != 2 && var1 != 3 ? this.quartzblockIcons[var2] : this.quartzblock_lines_top) : this.quartzblock_lines_top) : this.quartzblock_lines_top; -+ return par2 == 2 && (par1 == 1 || par1 == 0) ? this.quartzblock_lines_top : (par2 == 3 && (par1 == 5 || par1 == 4) ? this.quartzblock_lines_top : (par2 == 4 && (par1 == 2 || par1 == 3) ? this.quartzblock_lines_top : this.quartzblockIcons[par2])); - } - } - -- public int onBlockPlaced(World var1, int var2, int var3, int var4, int var5, float var6, float var7, float var8, int var9) { -- if(var9 == 2) { -- switch(var5) { -- case 0: -- case 1: -- var9 = 2; -- break; -- case 2: -- case 3: -- var9 = 4; -- break; -- case 4: -- case 5: -- var9 = 3; -+ /** -+ * Called when a block is placed using its ItemBlock. Args: World, X, Y, Z, side, hitX, hitY, hitZ, block metadata -+ */ -+ public int onBlockPlaced(World par1World, int par2, int par3, int par4, int par5, float par6, float par7, float par8, int par9) { -+ if (par9 == 2) { -+ switch (par5) { -+ case 0: -+ case 1: -+ par9 = 2; -+ break; -+ -+ case 2: -+ case 3: -+ par9 = 4; -+ break; -+ -+ case 4: -+ case 5: -+ par9 = 3; - } - } - -- return var9; -- } -- -- public int damageDropped(int var1) { -- return var1 != 3 && var1 != 4 ? var1 : 2; -- } -- -- protected ItemStack createStackedBlock(int var1) { -- return var1 != 3 && var1 != 4 ? super.createStackedBlock(var1) : new ItemStack(this.blockID, 1, 2); -- } -- -+ return par9; -+ } -+ -+ /** -+ * Determines the damage on the item the block drops. Used in cloth and wood. -+ */ -+ public int damageDropped(int par1) { -+ return par1 != 3 && par1 != 4 ? par1 : 2; -+ } -+ -+ /** -+ * Returns an item stack containing a single instance of the current block type. 'i' is the block's subtype/damage and -+ * is ignored for blocks which do not support subtypes. Blocks which cannot be harvested should return null. -+ */ -+ protected ItemStack createStackedBlock(int par1) { -+ return par1 != 3 && par1 != 4 ? super.createStackedBlock(par1) : new ItemStack(this.blockID, 1, 2); -+ } -+ -+ /** -+ * The type of render function that is called for this block -+ */ - public int getRenderType() { - return 39; - } - -- public void getSubBlocks(int var1, CreativeTabs var2, List var3) { -- var3.add(new ItemStack(var1, 1, 0)); -- var3.add(new ItemStack(var1, 1, 1)); -- var3.add(new ItemStack(var1, 1, 2)); -+ /** -+ * returns a list of blocks with the same ID, but different meta (eg: wood returns 4 blocks) -+ */ -+ public void getSubBlocks(int par1, CreativeTabs par2CreativeTabs, List par3List) { -+ par3List.add(new ItemStack(par1, 1, 0)); -+ par3List.add(new ItemStack(par1, 1, 1)); -+ par3List.add(new ItemStack(par1, 1, 2)); - } - -- public void registerIcons(IconRegister var1) { -- this.quartzblockIcons = new Icon[b.length]; -+ /** -+ * When this method is called, your block should register all the icons it needs with the given IconRegister. This is -+ * the only chance you get to register icons. -+ */ -+ public void registerIcons(IconRegister par1IconRegister) { -+ this.quartzblockIcons = new Icon[quartzBlockTextureTypes.length]; - -- for(int var2 = 0; var2 < this.quartzblockIcons.length; ++var2) { -- if(b[var2] == null) { -+ for (int var2 = 0; var2 < this.quartzblockIcons.length; ++var2) { -+ if (quartzBlockTextureTypes[var2] == null) { - this.quartzblockIcons[var2] = this.quartzblockIcons[var2 - 1]; - } else { -- this.quartzblockIcons[var2] = var1.registerIcon(this.getTextureName() + "_" + b[var2]); -+ this.quartzblockIcons[var2] = par1IconRegister.registerIcon(this.getTextureName() + "_" + quartzBlockTextureTypes[var2]); - } - } - -- this.quartzblock_top = var1.registerIcon(this.getTextureName() + "_" + "top"); -- this.quartzblock_chiseled_top = var1.registerIcon(this.getTextureName() + "_" + "chiseled_top"); -- this.quartzblock_lines_top = var1.registerIcon(this.getTextureName() + "_" + "lines_top"); -- this.quartzblock_bottom = var1.registerIcon(this.getTextureName() + "_" + "bottom"); -+ this.quartzblock_top = par1IconRegister.registerIcon(this.getTextureName() + "_" + "top"); -+ this.quartzblock_chiseled_top = par1IconRegister.registerIcon(this.getTextureName() + "_" + "chiseled_top"); -+ this.quartzblock_lines_top = par1IconRegister.registerIcon(this.getTextureName() + "_" + "lines_top"); -+ this.quartzblock_bottom = par1IconRegister.registerIcon(this.getTextureName() + "_" + "bottom"); - } - } ---- net/minecraft/src/PendingInvite.java -+++ net/minecraft/src/PendingInvite.java -@@ -3,18 +3,19 @@ - import argo.jdom.JsonNode; - - public class PendingInvite extends ValueObject { -- public String a; -- public String b; -- public String c; -+ public String field_130094_a; -+ public String field_130092_b; -+ public String field_130093_c; - -- public static PendingInvite func_130091_a(JsonNode var0) { -+ public static PendingInvite func_130091_a(JsonNode par0JsonNode) { - PendingInvite var1 = new PendingInvite(); - - try { -- var1.a = var0.getStringValue(new Object[]{"invitationId"}); -- var1.b = var0.getStringValue(new Object[]{"worldName"}); -- var1.c = var0.getStringValue(new Object[]{"worldOwnerName"}); -+ var1.field_130094_a = par0JsonNode.getStringValue(new Object[] {"invitationId"}); -+ var1.field_130092_b = par0JsonNode.getStringValue(new Object[] {"worldName"}); -+ var1.field_130093_c = par0JsonNode.getStringValue(new Object[] {"worldOwnerName"}); - } catch (Exception var3) { -+ ; - } - - return var1; ---- net/minecraft/src/ScoreComparator.java -+++ net/minecraft/src/ScoreComparator.java -@@ -3,11 +3,11 @@ - import java.util.Comparator; - - final class ScoreComparator implements Comparator { -- public int func_96659_a(Score var1, Score var2) { -- return var1.getScorePoints() > var2.getScorePoints() ? 1 : (var1.getScorePoints() < var2.getScorePoints() ? -1 : 0); -+ public int func_96659_a(Score par1Score, Score par2Score) { -+ return par1Score.getScorePoints() > par2Score.getScorePoints() ? 1 : (par1Score.getScorePoints() < par2Score.getScorePoints() ? -1 : 0); - } - -- public int compare(Object var1, Object var2) { -- return this.func_96659_a((Score)var1, (Score)var2); -+ public int compare(Object par1Obj, Object par2Obj) { -+ return this.func_96659_a((Score)par1Obj, (Score)par2Obj); - } - } ---- net/minecraft/src/Packet3Chat.java -+++ net/minecraft/src/Packet3Chat.java -@@ -5,51 +5,69 @@ - import java.io.IOException; - - public class Packet3Chat extends Packet { -- public String a; -+ -+ /** The message being sent. */ -+ public String message; - private boolean isServer; - - public Packet3Chat() { - this.isServer = true; - } - -- public Packet3Chat(ChatMessageComponent var1) { -- this(var1.toJson()); -- } -- -- public Packet3Chat(ChatMessageComponent var1, boolean var2) { -- this(var1.toJson(), var2); -- } -- -- public Packet3Chat(String var1) { -- this(var1, true); -- } -- -- public Packet3Chat(String var1, boolean var2) { -+ public Packet3Chat(ChatMessageComponent par1ChatMessageComponent) { -+ this(par1ChatMessageComponent.toJson()); -+ } -+ -+ public Packet3Chat(ChatMessageComponent par1ChatMessageComponent, boolean par2) { -+ this(par1ChatMessageComponent.toJson(), par2); -+ } -+ -+ public Packet3Chat(String par1Str) { -+ this(par1Str, true); -+ } -+ -+ public Packet3Chat(String par1Str, boolean par2) { - this.isServer = true; -- if(var1.length() > Short.MAX_VALUE) { -- var1 = var1.substring(0, Short.MAX_VALUE); -+ -+ if (par1Str.length() > 32767) { -+ par1Str = par1Str.substring(0, 32767); - } - -- this.a = var1; -- this.isServer = var2; -- } -- -- public void readPacketData(DataInput var1) throws IOException { -- this.a = readString(var1, Short.MAX_VALUE); -- } -- -- public void writePacketData(DataOutput var1) throws IOException { -- writeString(this.a, var1); -- } -- -- public void processPacket(NetHandler var1) { -- var1.handleChat(this); -- } -- -+ this.message = par1Str; -+ this.isServer = par2; -+ } -+ -+ /** -+ * Abstract. Reads the raw packet data from the data stream. -+ */ -+ public void readPacketData(DataInput par1DataInput) throws IOException { -+ this.message = readString(par1DataInput, 32767); -+ } -+ -+ /** -+ * Abstract. Writes the raw packet data to the data stream. -+ */ -+ public void writePacketData(DataOutput par1DataOutput) throws IOException { -+ writeString(this.message, par1DataOutput); -+ } -+ -+ /** -+ * Passes this Packet on to the NetHandler for processing. -+ */ -+ public void processPacket(NetHandler par1NetHandler) { -+ par1NetHandler.handleChat(this); -+ } -+ -+ /** -+ * Abstract. Return the size of the packet (not counting the header). -+ */ - public int getPacketSize() { -- return 2 + this.a.length() * 2; -+ return 2 + this.message.length() * 2; - } - -+ /** -+ * Get whether this is a server -+ */ - public boolean getIsServer() { - return this.isServer; - } ---- /dev/null -+++ org/spoutcraft/api/keyboard/KeyBindingManager.java -@@ -1,0 +1,34 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.api.keyboard; -+ -+public interface KeyBindingManager { -+ public void registerControl(KeyBinding binding); -+ -+ public void unregisterControl(KeyBinding binding); -+ -+ public abstract void load(); -+ -+ public abstract void save(); -+ -+ public void pressKey(int key, boolean keyReleased, int screen); -+ -+ public void summon(KeyBinding binding, int key, boolean keyReleased, int screen); -+} ---- net/minecraft/src/DispenserBehaviorPotion.java -+++ net/minecraft/src/DispenserBehaviorPotion.java -@@ -3,7 +3,10 @@ - final class DispenserBehaviorPotion implements IBehaviorDispenseItem { - private final BehaviorDefaultDispenseItem defaultDispenserItemBehavior = new BehaviorDefaultDispenseItem(); - -- public ItemStack dispense(IBlockSource var1, ItemStack var2) { -- return ItemPotion.isSplash(var2.getItemDamage()) ? (new DispenserBehaviorPotionProjectile(this, var2)).dispense(var1, var2) : this.defaultDispenserItemBehavior.dispense(var1, var2); -+ /** -+ * Dispenses the specified ItemStack from a dispenser. -+ */ -+ public ItemStack dispense(IBlockSource par1IBlockSource, ItemStack par2ItemStack) { -+ return ItemPotion.isSplash(par2ItemStack.getItemDamage()) ? (new DispenserBehaviorPotionProjectile(this, par2ItemStack)).dispense(par1IBlockSource, par2ItemStack) : this.defaultDispenserItemBehavior.dispense(par1IBlockSource, par2ItemStack); - } - } ---- net/minecraft/src/EntityWither.java -+++ net/minecraft/src/EntityWither.java -@@ -10,10 +10,12 @@ - private int[] field_82223_h = new int[2]; - private int[] field_82224_i = new int[2]; - private int field_82222_j; -+ -+ /** Selector used to determine the entities a wither boss should attack. */ - private static final IEntitySelector attackEntitySelector = new EntityWitherAttackFilter(); - -- public EntityWither(World var1) { -- super(var1); -+ public EntityWither(World par1World) { -+ super(par1World); - this.setHealth(this.getMaxHealth()); - this.setSize(0.9F, 4.0F); - this.isImmuneToFire = true; -@@ -36,80 +38,104 @@ - this.dataWatcher.addObject(20, new Integer(0)); - } - -- public void writeEntityToNBT(NBTTagCompound var1) { -- super.writeEntityToNBT(var1); -- var1.setInteger("Invul", this.func_82212_n()); -+ /** -+ * (abstract) Protected helper method to write subclass entity data to NBT. -+ */ -+ public void writeEntityToNBT(NBTTagCompound par1NBTTagCompound) { -+ super.writeEntityToNBT(par1NBTTagCompound); -+ par1NBTTagCompound.setInteger("Invul", this.func_82212_n()); - } - -- public void readEntityFromNBT(NBTTagCompound var1) { -- super.readEntityFromNBT(var1); -- this.func_82215_s(var1.getInteger("Invul")); -+ /** -+ * (abstract) Protected helper method to read subclass entity data from NBT. -+ */ -+ public void readEntityFromNBT(NBTTagCompound par1NBTTagCompound) { -+ super.readEntityFromNBT(par1NBTTagCompound); -+ this.func_82215_s(par1NBTTagCompound.getInteger("Invul")); - } - - public float getShadowSize() { - return this.height / 8.0F; - } - -+ /** -+ * Returns the sound this mob makes while it's alive. -+ */ - protected String getLivingSound() { - return "mob.wither.idle"; - } - -+ /** -+ * Returns the sound this mob makes when it is hurt. -+ */ - protected String getHurtSound() { - return "mob.wither.hurt"; - } - -+ /** -+ * Returns the sound this mob makes on death. -+ */ - protected String getDeathSound() { - return "mob.wither.death"; - } - -+ /** -+ * Called frequently so the entity can update its state every tick as required. For example, zombies and skeletons use -+ * this to react to sunlight and start to burn. -+ */ - public void onLivingUpdate() { -- this.motionY *= (double)0.6F; -+ this.motionY *= 0.6000000238418579D; - double var4; - double var6; - double var8; -- if(!this.worldObj.isRemote && this.getWatchedTargetId(0) > 0) { -+ -+ if (!this.worldObj.isRemote && this.getWatchedTargetId(0) > 0) { - Entity var1 = this.worldObj.getEntityByID(this.getWatchedTargetId(0)); -- if(var1 != null) { -- if(this.posY < var1.posY || !this.isArmored() && this.posY < var1.posY + 5.0D) { -- if(this.motionY < 0.0D) { -+ -+ if (var1 != null) { -+ if (this.posY < var1.posY || !this.isArmored() && this.posY < var1.posY + 5.0D) { -+ if (this.motionY < 0.0D) { - this.motionY = 0.0D; - } - -- this.motionY += (0.5D - this.motionY) * (double)0.6F; -+ this.motionY += (0.5D - this.motionY) * 0.6000000238418579D; - } - - double var2 = var1.posX - this.posX; - var4 = var1.posZ - this.posZ; - var6 = var2 * var2 + var4 * var4; -- if(var6 > 9.0D) { -+ -+ if (var6 > 9.0D) { - var8 = (double)MathHelper.sqrt_double(var6); -- this.motionX += (var2 / var8 * 0.5D - this.motionX) * (double)0.6F; -- this.motionZ += (var4 / var8 * 0.5D - this.motionZ) * (double)0.6F; -+ this.motionX += (var2 / var8 * 0.5D - this.motionX) * 0.6000000238418579D; -+ this.motionZ += (var4 / var8 * 0.5D - this.motionZ) * 0.6000000238418579D; - } - } - } - -- if(this.motionX * this.motionX + this.motionZ * this.motionZ > (double)0.05F) { -- this.rotationYaw = (float)Math.atan2(this.motionZ, this.motionX) * (180.0F / (float)Math.PI) - 90.0F; -+ if (this.motionX * this.motionX + this.motionZ * this.motionZ > 0.05000000074505806D) { -+ this.rotationYaw = (float)Math.atan2(this.motionZ, this.motionX) * (180F / (float)Math.PI) - 90.0F; - } - - super.onLivingUpdate(); -- - int var20; -- for(var20 = 0; var20 < 2; ++var20) { -+ -+ for (var20 = 0; var20 < 2; ++var20) { - this.field_82218_g[var20] = this.field_82221_e[var20]; - this.field_82217_f[var20] = this.field_82220_d[var20]; - } - - int var21; -- for(var20 = 0; var20 < 2; ++var20) { -+ -+ for (var20 = 0; var20 < 2; ++var20) { - var21 = this.getWatchedTargetId(var20 + 1); - Entity var3 = null; -- if(var21 > 0) { -+ -+ if (var21 > 0) { - var3 = this.worldObj.getEntityByID(var21); - } - -- if(var3 != null) { -+ if (var3 != null) { - var4 = this.func_82214_u(var20 + 1); - var6 = this.func_82208_v(var20 + 1); - var8 = this.func_82213_w(var20 + 1); -@@ -117,8 +143,8 @@ - double var12 = var3.posY + (double)var3.getEyeHeight() - var6; - double var14 = var3.posZ - var8; - double var16 = (double)MathHelper.sqrt_double(var10 * var10 + var14 * var14); -- float var18 = (float)(Math.atan2(var14, var10) * 180.0D / (double)((float)Math.PI)) - 90.0F; -- float var19 = (float)(-(Math.atan2(var12, var16) * 180.0D / (double)((float)Math.PI))); -+ float var18 = (float)(Math.atan2(var14, var10) * 180.0D / Math.PI) - 90.0F; -+ float var19 = (float)(-(Math.atan2(var12, var16) * 180.0D / Math.PI)); - this.field_82220_d[var20] = this.func_82204_b(this.field_82220_d[var20], var19, 40.0F); - this.field_82221_e[var20] = this.func_82204_b(this.field_82221_e[var20], var18, 10.0F); - } else { -@@ -128,66 +154,72 @@ - - boolean var22 = this.isArmored(); - -- for(var21 = 0; var21 < 3; ++var21) { -+ for (var21 = 0; var21 < 3; ++var21) { - double var23 = this.func_82214_u(var21); - double var5 = this.func_82208_v(var21); - double var7 = this.func_82213_w(var21); -- this.worldObj.spawnParticle("smoke", var23 + this.ab.nextGaussian() * (double)0.3F, var5 + this.ab.nextGaussian() * (double)0.3F, var7 + this.ab.nextGaussian() * (double)0.3F, 0.0D, 0.0D, 0.0D); -- if(var22 && this.worldObj.s.nextInt(4) == 0) { -- this.worldObj.spawnParticle("mobSpell", var23 + this.ab.nextGaussian() * (double)0.3F, var5 + this.ab.nextGaussian() * (double)0.3F, var7 + this.ab.nextGaussian() * (double)0.3F, (double)0.7F, (double)0.7F, 0.5D); -- } -- } -- -- if(this.func_82212_n() > 0) { -- for(var21 = 0; var21 < 3; ++var21) { -- this.worldObj.spawnParticle("mobSpell", this.posX + this.ab.nextGaussian() * 1.0D, this.posY + (double)(this.ab.nextFloat() * 3.3F), this.posZ + this.ab.nextGaussian() * 1.0D, (double)0.7F, (double)0.7F, (double)0.9F); -- } -- } -- -+ this.worldObj.spawnParticle("smoke", var23 + this.rand.nextGaussian() * 0.30000001192092896D, var5 + this.rand.nextGaussian() * 0.30000001192092896D, var7 + this.rand.nextGaussian() * 0.30000001192092896D, 0.0D, 0.0D, 0.0D); -+ -+ if (var22 && this.worldObj.rand.nextInt(4) == 0) { -+ this.worldObj.spawnParticle("mobSpell", var23 + this.rand.nextGaussian() * 0.30000001192092896D, var5 + this.rand.nextGaussian() * 0.30000001192092896D, var7 + this.rand.nextGaussian() * 0.30000001192092896D, 0.699999988079071D, 0.699999988079071D, 0.5D); -+ } -+ } -+ -+ if (this.func_82212_n() > 0) { -+ for (var21 = 0; var21 < 3; ++var21) { -+ this.worldObj.spawnParticle("mobSpell", this.posX + this.rand.nextGaussian() * 1.0D, this.posY + (double)(this.rand.nextFloat() * 3.3F), this.posZ + this.rand.nextGaussian() * 1.0D, 0.699999988079071D, 0.699999988079071D, 0.8999999761581421D); -+ } -+ } - } - - protected void updateAITasks() { - int var1; -- if(this.func_82212_n() > 0) { -+ -+ if (this.func_82212_n() > 0) { - var1 = this.func_82212_n() - 1; -- if(var1 <= 0) { -+ -+ if (var1 <= 0) { - this.worldObj.newExplosion(this, this.posX, this.posY + (double)this.getEyeHeight(), this.posZ, 7.0F, false, this.worldObj.getGameRules().getGameRuleBooleanValue("mobGriefing")); - this.worldObj.func_82739_e(1013, (int)this.posX, (int)this.posY, (int)this.posZ, 0); - } - - this.func_82215_s(var1); -- if(this.ticksExisted % 10 == 0) { -+ -+ if (this.ticksExisted % 10 == 0) { - this.heal(10.0F); - } -- - } else { - super.updateAITasks(); -- - int var12; -- for(var1 = 1; var1 < 3; ++var1) { -- if(this.ticksExisted >= this.field_82223_h[var1 - 1]) { -- this.field_82223_h[var1 - 1] = this.ticksExisted + 10 + this.ab.nextInt(10); -- if(this.worldObj.difficultySetting >= 2) { -+ -+ for (var1 = 1; var1 < 3; ++var1) { -+ if (this.ticksExisted >= this.field_82223_h[var1 - 1]) { -+ this.field_82223_h[var1 - 1] = this.ticksExisted + 10 + this.rand.nextInt(10); -+ -+ if (this.worldObj.difficultySetting >= 2) { - int var10001 = var1 - 1; - int var10003 = this.field_82224_i[var1 - 1]; - this.field_82224_i[var10001] = this.field_82224_i[var1 - 1] + 1; -- if(var10003 > 15) { -+ -+ if (var10003 > 15) { - float var2 = 10.0F; - float var3 = 5.0F; -- double var4 = MathHelper.getRandomDoubleInRange(this.ab, this.posX - (double)var2, this.posX + (double)var2); -- double var6 = MathHelper.getRandomDoubleInRange(this.ab, this.posY - (double)var3, this.posY + (double)var3); -- double var8 = MathHelper.getRandomDoubleInRange(this.ab, this.posZ - (double)var2, this.posZ + (double)var2); -+ double var4 = MathHelper.getRandomDoubleInRange(this.rand, this.posX - (double)var2, this.posX + (double)var2); -+ double var6 = MathHelper.getRandomDoubleInRange(this.rand, this.posY - (double)var3, this.posY + (double)var3); -+ double var8 = MathHelper.getRandomDoubleInRange(this.rand, this.posZ - (double)var2, this.posZ + (double)var2); - this.func_82209_a(var1 + 1, var4, var6, var8, true); - this.field_82224_i[var1 - 1] = 0; - } - } - - var12 = this.getWatchedTargetId(var1); -- if(var12 > 0) { -+ -+ if (var12 > 0) { - Entity var14 = this.worldObj.getEntityByID(var12); -- if(var14 != null && var14.isEntityAlive() && this.getDistanceSqToEntity(var14) <= 900.0D && this.canEntityBeSeen(var14)) { -+ -+ if (var14 != null && var14.isEntityAlive() && this.getDistanceSqToEntity(var14) <= 900.0D && this.canEntityBeSeen(var14)) { - this.func_82216_a(var1 + 1, (EntityLivingBase)var14); -- this.field_82223_h[var1 - 1] = this.ticksExisted + 40 + this.ab.nextInt(20); -+ this.field_82223_h[var1 - 1] = this.ticksExisted + 40 + this.rand.nextInt(20); - this.field_82224_i[var1 - 1] = 0; - } else { - this.func_82211_c(var1, 0); -@@ -195,16 +227,18 @@ - } else { - List var13 = this.worldObj.selectEntitiesWithinAABB(EntityLivingBase.class, this.boundingBox.expand(20.0D, 8.0D, 20.0D), attackEntitySelector); - -- for(int var16 = 0; var16 < 10 && !var13.isEmpty(); ++var16) { -- EntityLivingBase var5 = (EntityLivingBase)var13.get(this.ab.nextInt(var13.size())); -- if(var5 != this && var5.isEntityAlive() && this.canEntityBeSeen(var5)) { -- if(var5 instanceof EntityPlayer) { -- if(!((EntityPlayer)var5).capabilities.disableDamage) { -+ for (int var16 = 0; var16 < 10 && !var13.isEmpty(); ++var16) { -+ EntityLivingBase var5 = (EntityLivingBase)var13.get(this.rand.nextInt(var13.size())); -+ -+ if (var5 != this && var5.isEntityAlive() && this.canEntityBeSeen(var5)) { -+ if (var5 instanceof EntityPlayer) { -+ if (!((EntityPlayer)var5).capabilities.disableDamage) { - this.func_82211_c(var1, var5.entityId); - } - } else { - this.func_82211_c(var1, var5.entityId); - } -+ - break; - } - -@@ -214,44 +248,45 @@ - } - } - -- if(this.getAttackTarget() != null) { -+ if (this.getAttackTarget() != null) { - this.func_82211_c(0, this.getAttackTarget().entityId); - } else { - this.func_82211_c(0, 0); - } - -- if(this.field_82222_j > 0) { -+ if (this.field_82222_j > 0) { - --this.field_82222_j; -- if(this.field_82222_j == 0 && this.worldObj.getGameRules().getGameRuleBooleanValue("mobGriefing")) { -+ -+ if (this.field_82222_j == 0 && this.worldObj.getGameRules().getGameRuleBooleanValue("mobGriefing")) { - var1 = MathHelper.floor_double(this.posY); - var12 = MathHelper.floor_double(this.posX); - int var15 = MathHelper.floor_double(this.posZ); - boolean var17 = false; - -- for(int var18 = -1; var18 <= 1; ++var18) { -- for(int var19 = -1; var19 <= 1; ++var19) { -- for(int var7 = 0; var7 <= 3; ++var7) { -+ for (int var18 = -1; var18 <= 1; ++var18) { -+ for (int var19 = -1; var19 <= 1; ++var19) { -+ for (int var7 = 0; var7 <= 3; ++var7) { - int var20 = var12 + var18; - int var9 = var1 + var7; - int var10 = var15 + var19; - int var11 = this.worldObj.getBlockId(var20, var9, var10); -- if(var11 > 0 && var11 != Block.bedrock.blockID && var11 != Block.endPortal.blockID && var11 != Block.endPortalFrame.blockID) { -+ -+ if (var11 > 0 && var11 != Block.bedrock.blockID && var11 != Block.endPortal.blockID && var11 != Block.endPortalFrame.blockID) { - var17 = this.worldObj.destroyBlock(var20, var9, var10, true) || var17; - } - } - } - } - -- if(var17) { -+ if (var17) { - this.worldObj.playAuxSFXAtEntity((EntityPlayer)null, 1012, (int)this.posX, (int)this.posY, (int)this.posZ, 0); - } - } - } - -- if(this.ticksExisted % 20 == 0) { -+ if (this.ticksExisted % 20 == 0) { - this.heal(1.0F); - } -- - } - } - -@@ -260,64 +295,71 @@ - this.setHealth(this.getMaxHealth() / 3.0F); - } - -- public void setInWeb() { -- } -+ /** -+ * Sets the Entity inside a web block. -+ */ -+ public void setInWeb() {} - -+ /** -+ * Returns the current armor value as determined by a call to InventoryPlayer.getTotalArmorValue -+ */ - public int getTotalArmorValue() { - return 4; - } - -- private double func_82214_u(int var1) { -- if(var1 <= 0) { -+ private double func_82214_u(int par1) { -+ if (par1 <= 0) { - return this.posX; - } else { -- float var2 = (this.renderYawOffset + (float)(180 * (var1 - 1))) / 180.0F * (float)Math.PI; -+ float var2 = (this.renderYawOffset + (float)(180 * (par1 - 1))) / 180.0F * (float)Math.PI; - float var3 = MathHelper.cos(var2); - return this.posX + (double)var3 * 1.3D; - } - } - -- private double func_82208_v(int var1) { -- return var1 <= 0 ? this.posY + 3.0D : this.posY + 2.2D; -+ private double func_82208_v(int par1) { -+ return par1 <= 0 ? this.posY + 3.0D : this.posY + 2.2D; - } - -- private double func_82213_w(int var1) { -- if(var1 <= 0) { -+ private double func_82213_w(int par1) { -+ if (par1 <= 0) { - return this.posZ; - } else { -- float var2 = (this.renderYawOffset + (float)(180 * (var1 - 1))) / 180.0F * (float)Math.PI; -+ float var2 = (this.renderYawOffset + (float)(180 * (par1 - 1))) / 180.0F * (float)Math.PI; - float var3 = MathHelper.sin(var2); - return this.posZ + (double)var3 * 1.3D; - } - } - -- private float func_82204_b(float var1, float var2, float var3) { -- float var4 = MathHelper.wrapAngleTo180_float(var2 - var1); -- if(var4 > var3) { -- var4 = var3; -- } -- -- if(var4 < -var3) { -- var4 = -var3; -- } -- -- return var1 + var4; -- } -- -- private void func_82216_a(int var1, EntityLivingBase var2) { -- this.func_82209_a(var1, var2.posX, var2.posY + (double)var2.getEyeHeight() * 0.5D, var2.posZ, var1 == 0 && this.ab.nextFloat() < 0.001F); -- } -- -- private void func_82209_a(int var1, double var2, double var4, double var6, boolean var8) { -+ private float func_82204_b(float par1, float par2, float par3) { -+ float var4 = MathHelper.wrapAngleTo180_float(par2 - par1); -+ -+ if (var4 > par3) { -+ var4 = par3; -+ } -+ -+ if (var4 < -par3) { -+ var4 = -par3; -+ } -+ -+ return par1 + var4; -+ } -+ -+ private void func_82216_a(int par1, EntityLivingBase par2EntityLivingBase) { -+ this.func_82209_a(par1, par2EntityLivingBase.posX, par2EntityLivingBase.posY + (double)par2EntityLivingBase.getEyeHeight() * 0.5D, par2EntityLivingBase.posZ, par1 == 0 && this.rand.nextFloat() < 0.001F); -+ } -+ -+ private void func_82209_a(int par1, double par2, double par4, double par6, boolean par8) { - this.worldObj.playAuxSFXAtEntity((EntityPlayer)null, 1014, (int)this.posX, (int)this.posY, (int)this.posZ, 0); -- double var9 = this.func_82214_u(var1); -- double var11 = this.func_82208_v(var1); -- double var13 = this.func_82213_w(var1); -- double var15 = var2 - var9; -- double var17 = var4 - var11; -- double var19 = var6 - var13; -+ double var9 = this.func_82214_u(par1); -+ double var11 = this.func_82208_v(par1); -+ double var13 = this.func_82213_w(par1); -+ double var15 = par2 - var9; -+ double var17 = par4 - var11; -+ double var19 = par6 - var13; - EntityWitherSkull var21 = new EntityWitherSkull(this.worldObj, this, var15, var17, var19); -- if(var8) { -+ -+ if (par8) { - var21.setInvulnerable(true); - } - -@@ -327,65 +369,91 @@ - this.worldObj.spawnEntityInWorld(var21); - } - -- public void attackEntityWithRangedAttack(EntityLivingBase var1, float var2) { -- this.func_82216_a(0, var1); -+ /** -+ * Attack the specified entity using a ranged attack. -+ */ -+ public void attackEntityWithRangedAttack(EntityLivingBase par1EntityLivingBase, float par2) { -+ this.func_82216_a(0, par1EntityLivingBase); - } - -- public boolean attackEntityFrom(DamageSource var1, float var2) { -- if(this.isEntityInvulnerable()) { -- return false; -- } else if(var1 == DamageSource.drown) { -- return false; -- } else if(this.func_82212_n() > 0) { -+ /** -+ * Called when the entity is attacked. -+ */ -+ public boolean attackEntityFrom(DamageSource par1DamageSource, float par2) { -+ if (this.isEntityInvulnerable()) { -+ return false; -+ } else if (par1DamageSource == DamageSource.drown) { -+ return false; -+ } else if (this.func_82212_n() > 0) { - return false; - } else { - Entity var3; -- if(this.isArmored()) { -- var3 = var1.getSourceOfDamage(); -- if(var3 instanceof EntityArrow) { -+ -+ if (this.isArmored()) { -+ var3 = par1DamageSource.getSourceOfDamage(); -+ -+ if (var3 instanceof EntityArrow) { - return false; - } - } - -- var3 = var1.getEntity(); -- if(var3 != null && !(var3 instanceof EntityPlayer) && var3 instanceof EntityLivingBase && ((EntityLivingBase)var3).getCreatureAttribute() == this.getCreatureAttribute()) { -+ var3 = par1DamageSource.getEntity(); -+ -+ if (var3 != null && !(var3 instanceof EntityPlayer) && var3 instanceof EntityLivingBase && ((EntityLivingBase)var3).getCreatureAttribute() == this.getCreatureAttribute()) { - return false; - } else { -- if(this.field_82222_j <= 0) { -+ if (this.field_82222_j <= 0) { - this.field_82222_j = 20; - } - -- for(int var4 = 0; var4 < this.field_82224_i.length; ++var4) { -+ for (int var4 = 0; var4 < this.field_82224_i.length; ++var4) { - this.field_82224_i[var4] += 3; - } - -- return super.attackEntityFrom(var1, var2); -+ return super.attackEntityFrom(par1DamageSource, par2); - } - } - } - -- protected void dropFewItems(boolean var1, int var2) { -+ /** -+ * Drop 0-2 items of this living's type. @param par1 - Whether this entity has recently been hit by a player. @param -+ * par2 - Level of Looting used to kill this mob. -+ */ -+ protected void dropFewItems(boolean par1, int par2) { - this.dropItem(Item.netherStar.itemID, 1); - } - -+ /** -+ * Makes the entity despawn if requirements are reached -+ */ - protected void despawnEntity() { - this.entityAge = 0; - } - -- public int getBrightnessForRender(float var1) { -+ public int getBrightnessForRender(float par1) { - return 15728880; - } - -+ /** -+ * Returns true if other Entities should be prevented from moving through this Entity. -+ */ - public boolean canBeCollidedWith() { - return !this.isDead; - } - -- protected void fall(float var1) { -- } -- -- public void addPotionEffect(PotionEffect var1) { -- } -- -+ /** -+ * Called when the mob is falling. Calculates and applies fall damage. -+ */ -+ protected void fall(float par1) {} -+ -+ /** -+ * adds a PotionEffect to the entity -+ */ -+ public void addPotionEffect(PotionEffect par1PotionEffect) {} -+ -+ /** -+ * Returns true if the newer Entity AI code should be run -+ */ - protected boolean isAIEnabled() { - return true; - } -@@ -393,43 +461,56 @@ - protected void applyEntityAttributes() { - super.applyEntityAttributes(); - this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setAttribute(300.0D); -- this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setAttribute((double)0.6F); -+ this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setAttribute(0.6000000238418579D); - this.getEntityAttribute(SharedMonsterAttributes.followRange).setAttribute(40.0D); - } - -- public float func_82207_a(int var1) { -- return this.field_82221_e[var1]; -+ public float func_82207_a(int par1) { -+ return this.field_82221_e[par1]; - } - -- public float func_82210_r(int var1) { -- return this.field_82220_d[var1]; -+ public float func_82210_r(int par1) { -+ return this.field_82220_d[par1]; - } - - public int func_82212_n() { - return this.dataWatcher.getWatchableObjectInt(20); - } - -- public void func_82215_s(int var1) { -- this.dataWatcher.updateObject(20, Integer.valueOf(var1)); -- } -- -- public int getWatchedTargetId(int var1) { -- return this.dataWatcher.getWatchableObjectInt(17 + var1); -- } -- -- public void func_82211_c(int var1, int var2) { -- this.dataWatcher.updateObject(17 + var1, Integer.valueOf(var2)); -- } -- -+ public void func_82215_s(int par1) { -+ this.dataWatcher.updateObject(20, Integer.valueOf(par1)); -+ } -+ -+ /** -+ * Returns the target entity ID if present, or -1 if not @param par1 The target offset, should be from 0-2 -+ */ -+ public int getWatchedTargetId(int par1) { -+ return this.dataWatcher.getWatchableObjectInt(17 + par1); -+ } -+ -+ public void func_82211_c(int par1, int par2) { -+ this.dataWatcher.updateObject(17 + par1, Integer.valueOf(par2)); -+ } -+ -+ /** -+ * Returns whether the wither is armored with its boss armor or not by checking whether its health is below half of its -+ * maximum. -+ */ - public boolean isArmored() { - return this.getHealth() <= this.getMaxHealth() / 2.0F; - } - -+ /** -+ * Get this Entity's EnumCreatureAttribute -+ */ - public EnumCreatureAttribute getCreatureAttribute() { - return EnumCreatureAttribute.UNDEAD; - } - -- public void mountEntity(Entity var1) { -+ /** -+ * Called when a player mounts an entity. e.g. mounts a pig, mounts a boat. -+ */ -+ public void mountEntity(Entity par1Entity) { - this.ridingEntity = null; - } - } ---- /dev/null -+++ org/spoutcraft/api/material/Food.java -@@ -1,0 +1,24 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.api.material; -+ -+public interface Food extends Item { -+ public int getHungerRestored(); -+} ---- /dev/null -+++ org/spoutcraft/api/inventory/PlayerInventory.java -@@ -1,0 +1,120 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.api.inventory; -+ -+/** -+ * Includes interface to the 4 armor slots -+ */ -+public interface PlayerInventory extends Inventory { -+ /** -+ * Get all ItemStacks from the armor slots -+ * -+ * @return All the ItemStacks from the armor slots -+ */ -+ public ItemStack[] getArmorContents(); -+ -+ /** -+ * Return the ItemStack from the helmet slot -+ * -+ * @return The ItemStack in the helmet slot -+ */ -+ public ItemStack getHelmet(); -+ -+ /** -+ * Return the ItemStack from the chestplate slot -+ * -+ * @return The ItemStack in the chestplate slot -+ */ -+ public ItemStack getChestplate(); -+ -+ /** -+ * Return the ItemStack from the leg slot -+ * -+ * @return The ItemStack in the leg slot -+ */ -+ public ItemStack getLeggings(); -+ -+ /** -+ * Return the ItemStack from the boots slot -+ * -+ * @return The ItemStack in the boots slot -+ */ -+ public ItemStack getBoots(); -+ -+ /** -+ * Put the given ItemStacks into the armor slots -+ * -+ * @param items The ItemStacks to use as armour -+ */ -+ public void setArmorContents(ItemStack[] items); -+ -+ /** -+ * Put the given ItemStack into the helmet slot -+ * This does not check if the ItemStack is a helmet -+ * -+ * @param helmet The ItemStack to use as helmet -+ */ -+ public void setHelmet(ItemStack helmet); -+ -+ /** -+ * Put the given ItemStack into the chestplate slot -+ * This does not check if the ItemStack is a chestplate -+ * -+ * @param chestplate The ItemStack to use as chestplate -+ */ -+ public void setChestplate(ItemStack chestplate); -+ -+ /** -+ * Put the given ItemStack into the leg slot -+ * This does not check if the ItemStack is a pair of leggings -+ * -+ * @param leggings The ItemStack to use as leggings -+ */ -+ public void setLeggings(ItemStack leggings); -+ -+ /** -+ * Put the given ItemStack into the boots slot -+ * This does not check if the ItemStack is a boots -+ * -+ * @param boots The ItemStack to use as boots -+ */ -+ public void setBoots(ItemStack boots); -+ -+ /** -+ * Returns the ItemStack currently hold -+ * -+ * @return The currently held ItemStack -+ */ -+ public ItemStack getItemInHand(); -+ -+ /** -+ * Sets the item in hand -+ * -+ * @param stack Stack to set -+ */ -+ public void setItemInHand(ItemStack stack); -+ -+ /** -+ * Get the slot number of the currently held item -+ * -+ * @return Held item slot number -+ */ -+ public int getHeldItemSlot(); -+} ---- net/minecraft/src/Packet1Login.java -+++ net/minecraft/src/Packet1Login.java -@@ -4,70 +4,99 @@ - import java.io.DataOutput; - import java.io.IOException; - -+import org.spoutcraft.client.DataMiningThread; -+ - public class Packet1Login extends Packet { -+ -+ /** The player's entity ID */ - public int clientEntityId; - public WorldType terrainType; - public boolean hardcoreMode; - public EnumGameType gameType; -+ -+ /** -1: The Nether, 0: The Overworld, 1: The End */ - public int dimension; -+ -+ /** The difficulty setting byte. */ - public byte difficultySetting; -+ -+ /** Defaults to 128 */ - public byte worldHeight; -+ -+ /** The maximum players. */ - public byte maxPlayers; - -- public Packet1Login() { -- } -- -- public Packet1Login(int var1, WorldType var2, EnumGameType var3, boolean var4, int var5, int var6, int var7, int var8) { -- this.clientEntityId = var1; -- this.terrainType = var2; -- this.dimension = var5; -- this.difficultySetting = (byte)var6; -- this.gameType = var3; -- this.worldHeight = (byte)var7; -- this.maxPlayers = (byte)var8; -- this.hardcoreMode = var4; -- } -- -- public void readPacketData(DataInput var1) throws IOException { -- this.clientEntityId = var1.readInt(); -- String var2 = readString(var1, 16); -+ public Packet1Login() {} -+ -+ public Packet1Login(int par1, WorldType par2WorldType, EnumGameType par3EnumGameType, boolean par4, int par5, int par6, int par7, int par8) { -+ this.clientEntityId = par1; -+ this.terrainType = par2WorldType; -+ this.dimension = par5; -+ this.difficultySetting = (byte)par6; -+ this.gameType = par3EnumGameType; -+ this.worldHeight = (byte)par7; -+ this.maxPlayers = (byte)par8; -+ this.hardcoreMode = par4; -+ } -+ -+ /** -+ * Abstract. Reads the raw packet data from the data stream. -+ */ -+ public void readPacketData(DataInput par1DataInput) throws IOException { -+ this.clientEntityId = par1DataInput.readInt(); -+ String var2 = readString(par1DataInput, 16); - this.terrainType = WorldType.parseWorldType(var2); -- if(this.terrainType == null) { -+ -+ if (this.terrainType == null) { - this.terrainType = WorldType.DEFAULT; - } - -- byte var3 = var1.readByte(); -+ byte var3 = par1DataInput.readByte(); - this.hardcoreMode = (var3 & 8) == 8; - int var4 = var3 & -9; - this.gameType = EnumGameType.getByID(var4); -- this.dimension = var1.readByte(); -- this.difficultySetting = var1.readByte(); -- this.worldHeight = var1.readByte(); -- this.maxPlayers = var1.readByte(); -+ this.dimension = par1DataInput.readByte(); -+ this.difficultySetting = par1DataInput.readByte(); -+ this.worldHeight = par1DataInput.readByte(); -+ this.maxPlayers = par1DataInput.readByte(); - } - -- public void writePacketData(DataOutput var1) throws IOException { -- var1.writeInt(this.clientEntityId); -- writeString(this.terrainType == null ? "" : this.terrainType.getWorldTypeName(), var1); -+ /** -+ * Abstract. Writes the raw packet data to the data stream. -+ */ -+ public void writePacketData(DataOutput par1DataOutput) throws IOException { -+ par1DataOutput.writeInt(this.clientEntityId); -+ writeString(this.terrainType == null ? "" : this.terrainType.getWorldTypeName(), par1DataOutput); - int var2 = this.gameType.getID(); -- if(this.hardcoreMode) { -+ -+ if (this.hardcoreMode) { - var2 |= 8; - } - -- var1.writeByte(var2); -- var1.writeByte(this.dimension); -- var1.writeByte(this.difficultySetting); -- var1.writeByte(this.worldHeight); -- var1.writeByte(this.maxPlayers); -- } -- -- public void processPacket(NetHandler var1) { -- var1.handleLogin(this); -- } -- -+ par1DataOutput.writeByte(var2); -+ par1DataOutput.writeByte(this.dimension); -+ par1DataOutput.writeByte(this.difficultySetting); -+ par1DataOutput.writeByte(this.worldHeight); -+ par1DataOutput.writeByte(this.maxPlayers); -+ } -+ -+ /** -+ * Passes this Packet on to the NetHandler for processing. -+ */ -+ public void processPacket(NetHandler par1NetHandler) { -+ // Spout Start -+ DataMiningThread.getInstance().onLogin(); -+ // Spout End -+ par1NetHandler.handleLogin(this); -+ } -+ -+ /** -+ * Abstract. Return the size of the packet (not counting the header). -+ */ - public int getPacketSize() { - int var1 = 0; -- if(this.terrainType != null) { -+ -+ if (this.terrainType != null) { - var1 = this.terrainType.getWorldTypeName().length(); - } - ---- net/minecraft/src/CallableLvl3.java -+++ net/minecraft/src/CallableLvl3.java -@@ -3,12 +3,17 @@ - import java.util.concurrent.Callable; - - class CallableLvl3 implements Callable { -+ -+ /** Reference to the World object. */ - final World theWorld; - -- CallableLvl3(World var1) { -- this.theWorld = var1; -+ CallableLvl3(World par1World) { -+ this.theWorld = par1World; - } - -+ /** -+ * Returns the result of the ChunkProvider's makeString -+ */ - public String getChunkProvider() { - return this.theWorld.chunkProvider.makeString(); - } ---- net/minecraft/src/WorldRenderer.java -+++ net/minecraft/src/WorldRenderer.java -@@ -3,9 +3,31 @@ - import java.util.ArrayList; - import java.util.HashSet; - import java.util.List; -+ - import org.lwjgl.opengl.GL11; -+import org.newdawn.slick.opengl.Texture; -+ -+import com.prupe.mcpatcher.ctm.CTMUtils; -+import com.prupe.mcpatcher.ctm.RenderPass; -+ -+import net.minecraft.src.AxisAlignedBB; -+import net.minecraft.src.ICamera; -+import net.minecraft.src.Minecraft; -+import net.minecraft.src.ResourceLocation; -+import net.minecraft.src.TileEntity; -+ -+import org.spoutcraft.api.Spoutcraft; -+import org.spoutcraft.api.block.design.GenericBlockDesign; -+import org.spoutcraft.api.material.CustomBlock; -+import org.spoutcraft.api.material.MaterialData; -+import org.spoutcraft.client.SpoutClient; -+import org.spoutcraft.client.block.SpoutcraftChunk; -+import org.spoutcraft.client.io.CustomTextureManager; -+import org.spoutcraft.client.io.FileUtil; - - public class WorldRenderer { -+ -+ /** Reference to the World object. */ - public World worldObj; - private int glRenderList = -1; - private static Tessellator tessellator = Tessellator.instance; -@@ -13,56 +35,101 @@ - public int posX; - public int posY; - public int posZ; -+ -+ /** Pos X minus */ - public int posXMinus; -+ -+ /** Pos Y minus */ - public int posYMinus; -+ -+ /** Pos Z minus */ - public int posZMinus; -+ -+ /** Pos X clipped */ - public int posXClip; -+ -+ /** Pos Y clipped */ - public int posYClip; -+ -+ /** Pos Z clipped */ - public int posZClip; - public boolean isInFrustum; -- public boolean[] skipRenderPass = new boolean[2]; -+ -+ /** Should this renderer skip this render pass */ -+ // MCPatcher Start -+ public boolean[] skipRenderPass = new boolean[4]; -+ // MCPatcher End -+ -+ /** Pos X plus */ - public int posXPlus; -+ -+ /** Pos Y plus */ - public int posYPlus; -+ -+ /** Pos Z plus */ - public int posZPlus; -+ -+ /** Boolean for whether this renderer needs to be updated or not */ - public boolean needsUpdate; -+ -+ /** Axis aligned bounding box */ - public AxisAlignedBB rendererBoundingBox; -+ -+ /** Chunk index */ - public int chunkIndex; -+ -+ /** Is this renderer visible according to the occlusion query */ - public boolean isVisible = true; -+ -+ /** Is this renderer waiting on the result of the occlusion query */ - public boolean isWaitingOnOcclusionQuery; -+ -+ /** OpenGL occlusion query */ - public int glOcclusionQuery; -+ -+ /** Is the chunk lit */ - public boolean isChunkLit; - private boolean isInitialized; -- public List x = new ArrayList(); -- private List B; -+ -+ /** All the tile entities that have special rendering code for this chunk */ -+ public List tileEntityRenderers = new ArrayList(); -+ private List tileEntities; -+ -+ /** Bytes sent to the GPU */ - private int bytesDrawn; - -- public WorldRenderer(World var1, List var2, int var3, int var4, int var5, int var6) { -- this.worldObj = var1; -- this.B = var2; -- this.glRenderList = var6; -+ public WorldRenderer(World par1World, List par2List, int par3, int par4, int par5, int par6) { -+ this.worldObj = par1World; -+ this.tileEntities = par2List; -+ this.glRenderList = par6; - this.posX = -999; -- this.setPosition(var3, var4, var5); -+ this.setPosition(par3, par4, par5); - this.needsUpdate = false; - } - -- public void setPosition(int var1, int var2, int var3) { -- if(var1 != this.posX || var2 != this.posY || var3 != this.posZ) { -+ /** -+ * Sets a new position for the renderer and setting it up so it can be reloaded with the new data for that position -+ */ -+ public void setPosition(int par1, int par2, int par3) { -+ if (par1 != this.posX || par2 != this.posY || par3 != this.posZ) { - this.setDontDraw(); -- this.posX = var1; -- this.posY = var2; -- this.posZ = var3; -- this.posXPlus = var1 + 8; -- this.posYPlus = var2 + 8; -- this.posZPlus = var3 + 8; -- this.posXClip = var1 & 1023; -- this.posYClip = var2; -- this.posZClip = var3 & 1023; -- this.posXMinus = var1 - this.posXClip; -- this.posYMinus = var2 - this.posYClip; -- this.posZMinus = var3 - this.posZClip; -+ this.posX = par1; -+ this.posY = par2; -+ this.posZ = par3; -+ this.posXPlus = par1 + 8; -+ this.posYPlus = par2 + 8; -+ this.posZPlus = par3 + 8; -+ this.posXClip = par1 & 1023; -+ this.posYClip = par2; -+ this.posZClip = par3 & 1023; -+ this.posXMinus = par1 - this.posXClip; -+ this.posYMinus = par2 - this.posYClip; -+ this.posZMinus = par3 - this.posZClip; - float var4 = 6.0F; -- this.rendererBoundingBox = AxisAlignedBB.getBoundingBox((double)((float)var1 - var4), (double)((float)var2 - var4), (double)((float)var3 - var4), (double)((float)(var1 + 16) + var4), (double)((float)(var2 + 16) + var4), (double)((float)(var3 + 16) + var4)); -- GL11.glNewList(this.glRenderList + 2, GL11.GL_COMPILE); -+ this.rendererBoundingBox = AxisAlignedBB.getBoundingBox((double)((float)par1 - var4), (double)((float)par2 - var4), (double)((float)par3 - var4), (double)((float)(par1 + 16) + var4), (double)((float)(par2 + 16) + var4), (double)((float)(par3 + 16) + var4)); -+ // MCPatcher Start -+ GL11.glNewList(this.glRenderList + 4, GL11.GL_COMPILE); -+ // MCPatcher End - RenderItem.renderAABB(AxisAlignedBB.getAABBPool().getAABB((double)((float)this.posXClip - var4), (double)((float)this.posYClip - var4), (double)((float)this.posZClip - var4), (double)((float)(this.posXClip + 16) + var4), (double)((float)(this.posYClip + 16) + var4), (double)((float)(this.posZClip + 16) + var4))); - GL11.glEndList(); - this.markDirty(); -@@ -73,114 +140,240 @@ - GL11.glTranslatef((float)this.posXClip, (float)this.posYClip, (float)this.posZClip); - } - -+ // MCPatcher Start - public void updateRenderer() { -- if(this.needsUpdate) { -- this.needsUpdate = false; -- int var1 = this.posX; -- int var2 = this.posY; -- int var3 = this.posZ; -- int var4 = this.posX + 16; -- int var5 = this.posY + 16; -- int var6 = this.posZ + 16; -+ CTMUtils.start(); -+ if (!this.needsUpdate) { -+ CTMUtils.finish(); -+ } else { -+ int x = this.posX; -+ int y = this.posY; -+ int z = this.posZ; -+ int sizeXOffset = this.posX + 16; -+ int sizeYOffset = this.posY + 16; -+ int sizeZOffset = this.posZ + 16; - -- for(int var7 = 0; var7 < 2; ++var7) { -- this.skipRenderPass[var7] = true; -+ for (int renderPass = 0; renderPass < skipRenderPass.length; ++renderPass) { -+ this.skipRenderPass[renderPass] = true; - } - - Chunk.isLit = false; -- HashSet var21 = new HashSet(); -- var21.addAll(this.x); -- this.x.clear(); -- byte var8 = 1; -- ChunkCache var9 = new ChunkCache(this.worldObj, var1 - var8, var2 - var8, var3 - var8, var4 + var8, var5 + var8, var6 + var8, var8); -- if(!var9.extendedLevelsInChunkCache()) { -+ HashSet tileRenderers = new HashSet(); -+ tileRenderers.addAll(this.tileEntityRenderers); -+ this.tileEntityRenderers.clear(); -+ ChunkCache chunkCache = new ChunkCache(this.worldObj, x - 1, y - 1, z - 1, sizeXOffset + 1, sizeYOffset + 1, sizeZOffset + 1, 1); -+ -+ if (!chunkCache.extendedLevelsInChunkCache()) { - ++chunksUpdated; -- RenderBlocks var10 = new RenderBlocks(var9); -- this.bytesDrawn = 0; -- -- for(int var11 = 0; var11 < 2; ++var11) { -- boolean var12 = false; -- boolean var13 = false; -- boolean var14 = false; -- -- for(int var15 = var2; var15 < var5; ++var15) { -- for(int var16 = var3; var16 < var6; ++var16) { -- for(int var17 = var1; var17 < var4; ++var17) { -- int var18 = var9.getBlockId(var17, var15, var16); -- if(var18 > 0) { -- if(!var14) { -- var14 = true; -- GL11.glNewList(this.glRenderList + var11, GL11.GL_COMPILE); -- GL11.glPushMatrix(); -- this.setupGLTranslation(); -- float var19 = 1.000001F; -- GL11.glTranslatef(-8.0F, -8.0F, -8.0F); -- GL11.glScalef(var19, var19, var19); -- GL11.glTranslatef(8.0F, 8.0F, 8.0F); -- tessellator.startDrawingQuads(); -- tessellator.setTranslation((double)(-this.posX), (double)(-this.posY), (double)(-this.posZ)); -- } -- -- Block var23 = Block.blocksList[var18]; -- if(var23 != null) { -- if(var11 == 0 && var23.hasTileEntity()) { -- TileEntity var20 = var9.getBlockTileEntity(var17, var15, var16); -- if(TileEntityRenderer.instance.hasSpecialRenderer(var20)) { -- this.x.add(var20); -- } -- } -- -- int var24 = var23.getRenderBlockPass(); -- if(var24 != var11) { -- var12 = true; -- } else if(var24 == var11) { -- var13 |= var10.renderBlockByRenderType(var23, var17, var15, var16); -- } -- } -- } -- } -- } -- } -- -- if(var14) { -- this.bytesDrawn += tessellator.draw(); -+ RenderBlocks blockRenderer = new RenderBlocks(chunkCache); -+ -+ Minecraft game = SpoutClient.getHandle(); -+ int currentTexture = 0; -+ int limit = skipRenderPass.length; // MCPatcher 2.4.4 requires 4, anything less and things get missed. -+ int defaultTexture = Minecraft.getMinecraft().renderEngine.getTextureId(new ResourceLocation("textures/atlas/blocks.png")); -+ TextureUtil.bindTexture(defaultTexture); -+ -+ List hitTextures = new ArrayList(); -+ List hitTexturesPlugins = new ArrayList(); -+ hitTextures.add("/terrain.png"); -+ hitTexturesPlugins.add(""); -+ -+ SpoutcraftChunk sChunk = Spoutcraft.getChunkAt(worldObj, posX, posY, posZ); -+ short[] customBlockIds = sChunk.getCustomBlockIds(); -+ byte[] customBlockData = sChunk.getCustomBlockData(); -+ blockRenderer.customIds = customBlockIds; -+ -+ for (int renderPass = 0; renderPass < limit; ++renderPass) { -+ boolean skipRenderPass = false; -+ boolean rendered = false; -+ boolean drawBlock = false; -+ RenderPass.start(renderPass); -+ if (!drawBlock) { -+ drawBlock = true; -+ GL11.glNewList(this.glRenderList + renderPass, GL11.GL_COMPILE); -+ GL11.glPushMatrix(); -+ this.setupGLTranslation(); -+ GL11.glTranslatef(-8F, -8F, -8F); -+ GL11.glScalef(1F, 1F, 1F); -+ GL11.glTranslatef(8F, 8F, 8F); -+ tessellator.startDrawingQuads(); -+ tessellator.setTranslation((double)(-this.posX), (double)(-this.posY), (double)(-this.posZ)); -+ } -+ -+ TextureUtil.bindTexture(defaultTexture); -+ -+ for (currentTexture = 0; currentTexture < hitTextures.size(); currentTexture++) { -+ int texture = defaultTexture; -+ // First pass (currentTexture == 0) is for the default terrain.png texture. Subsquent passes are for custom textures -+ // This design is to avoid unnessecary glBindTexture calls. -+ if (currentTexture > 0) { -+ Texture customTexture = CustomTextureManager.getTextureFromUrl(hitTexturesPlugins.get(currentTexture), hitTextures.get(currentTexture)); -+ if (customTexture == null) { -+ customTexture = CustomTextureManager.getTextureFromPath(FileUtil.getAssetsDir().getPath()+"/block/spout.png"); -+ } -+ if (customTexture != null) { -+ texture = customTexture.getTextureID(); -+ TextureUtil.bindTexture(texture); -+ //game.renderEngine.bindTexture(texture); -+ if (texture <= 0) { -+ texture = defaultTexture; -+ } -+ } -+ } -+ -+ if (tessellator.texture != texture){ -+ tessellator.draw(); -+ tessellator.texture = texture; -+ tessellator.startDrawingQuads(); -+ } -+ -+ float[] oldBounds = new float[6]; -+ -+ // The x,y,z order is important, don't change! -+ for (int dx = x; dx < sizeXOffset; ++dx) { -+ for (int dz = z; dz < sizeZOffset; ++dz) { -+ for (int dy = y; dy < sizeYOffset; ++dy) { -+ int id = chunkCache.getBlockId(dx, dy, dz); -+ if (id > 0) { -+ String customTexture = null; -+ String customTextureAddon = null; -+ GenericBlockDesign design = null; -+ CustomBlock mat = null; -+ -+ if (customBlockIds != null) { -+ int key = ((dx & 0xF) << 12) | ((dz & 0xF) << 8) | (dy & 0xFF); -+ if (customBlockIds[key] != 0) { -+ mat = MaterialData.getCustomBlock(customBlockIds[key]); -+ if (mat != null) { -+ design = (GenericBlockDesign) mat.getBlockDesign(customBlockData == null ? 0 : customBlockData[key]); -+ } -+ } -+ } -+ -+ if (design != null) { -+ customTexture = design.getTextureURL(); -+ customTextureAddon = design.getTextureAddon(); -+ } -+ -+ if (customTexture != null){ -+ boolean found = false; -+ -+ // Search for the custom texture in our list -+ for(int i = 0; i < hitTextures.size(); i++){ -+ if(hitTextures.get(i).equals(customTexture) && hitTexturesPlugins.get(i).equals(customTextureAddon)) { -+ found = true; -+ break; -+ } -+ } -+ // If it is not already accounted for, add it so we do an additional pass for it. -+ if (!found) { -+ hitTextures.add(customTexture); -+ hitTexturesPlugins.add(customTextureAddon); -+ } -+ -+ // Do not render if we are using a different texture than the current one -+ if (!hitTextures.get(currentTexture).equals(customTexture) || !hitTexturesPlugins.get(currentTexture).equals(customTextureAddon)) { -+ continue; -+ } -+ // Do not render if we are not using the terrain.png and can't find a valid texture for this custom block -+ } else if (currentTexture != 0) { -+ continue; -+ } -+ -+ Block block = Block.blocksList[id]; -+ -+ if (block != null) { -+ if (renderPass == 0 && block.hasTileEntity()) { -+ TileEntity var20 = chunkCache.getBlockTileEntity(dx, dy, dz); -+ if (TileEntityRenderer.instance.hasSpecialRenderer(var20)) { -+ this.tileEntityRenderers.add(var20); -+ } -+ } -+ -+ // Determine which pass this block needs to be rendered on -+ int blockRenderPass = RenderPass.getBlockRenderPass(block); -+ -+ if (design != null) { -+ blockRenderPass = design.getRenderPass(); -+ } -+ -+ if (blockRenderPass != renderPass) { -+ skipRenderPass = true; -+ } else { -+ if (design != null) { -+ oldBounds[0] = (float) block.minX; -+ oldBounds[1] = (float) block.minY; -+ oldBounds[2] = (float) block.minZ; -+ oldBounds[3] = (float) block.maxX; -+ oldBounds[4] = (float) block.maxY; -+ oldBounds[5] = (float) block.maxZ; -+ block.setBlockBounds(design.getLowXBound(), design.getLowYBound(), design.getLowZBound(), design.getHighXBound(), design.getHighYBound(), design.getHighZBound()); -+ rendered |= design.renderBlock(mat, dx, dy, dz); -+ block.setBlockBounds(oldBounds[0], oldBounds[1], oldBounds[2], oldBounds[3], oldBounds[4], oldBounds[5]); -+ } else { -+ rendered |= blockRenderer.renderBlockByRenderType(block, dx, dy, dz); -+ } -+ } -+ } -+ } -+ } -+ } -+ } -+ } -+ -+ if (drawBlock) { -+ tessellator.draw(); -+ tessellator.texture = 0; - GL11.glPopMatrix(); - GL11.glEndList(); -+ TextureUtil.bindTexture(defaultTexture); -+ //game.renderEngine.bindTexture(defaultTexture); - tessellator.setTranslation(0.0D, 0.0D, 0.0D); - } else { -- var13 = false; -- } -- -- if(var13) { -- this.skipRenderPass[var11] = false; -- } -- -- if(!var12) { -+ rendered = false; -+ } -+ -+ if (rendered) { -+ this.skipRenderPass[renderPass] = false; -+ } -+ -+ if (!skipRenderPass) { - break; - } -+ blockRenderer.customIds = null; - } - } -- -- HashSet var22 = new HashSet(); -- var22.addAll(this.x); -- var22.removeAll(var21); -- this.B.addAll(var22); -- var21.removeAll(this.x); -- this.B.removeAll(var21); -+ HashSet var24 = new HashSet(); -+ var24.addAll(this.tileEntityRenderers); -+ var24.removeAll(tileRenderers); -+ this.tileEntities.addAll(var24); -+ tileRenderers.removeAll(this.tileEntityRenderers); -+ this.tileEntities.removeAll(tileRenderers); - this.isChunkLit = Chunk.isLit; - this.isInitialized = true; -+ CTMUtils.finish(); - } - } -+ // MCPatcher End - -- public float distanceToEntitySquared(Entity var1) { -- float var2 = (float)(var1.posX - (double)this.posXPlus); -- float var3 = (float)(var1.posY - (double)this.posYPlus); -- float var4 = (float)(var1.posZ - (double)this.posZPlus); -+ /** -+ * Returns the distance of this chunk renderer to the entity without performing the final normalizing square root, for -+ * performance reasons. -+ */ -+ public float distanceToEntitySquared(Entity par1Entity) { -+ float var2 = (float)(par1Entity.posX - (double)this.posXPlus); -+ float var3 = (float)(par1Entity.posY - (double)this.posYPlus); -+ float var4 = (float)(par1Entity.posZ - (double)this.posZPlus); - return var2 * var2 + var3 * var3 + var4 * var4; - } - -+ /** -+ * When called this renderer won't draw anymore until its gets initialized again -+ */ - public void setDontDraw() { -- for(int var1 = 0; var1 < 2; ++var1) { -+ // Spout Start -+ for (int var1 = 0; var1 < skipRenderPass.length; ++var1) { -+ // Spout End - this.skipRenderPass[var1] = true; - } - -@@ -193,22 +386,38 @@ - this.worldObj = null; - } - -- public int getGLCallListForPass(int var1) { -- return !this.isInFrustum ? -1 : (!this.skipRenderPass[var1] ? this.glRenderList + var1 : -1); -- } -- -- public void updateInFrustum(ICamera var1) { -- this.isInFrustum = var1.isBoundingBoxInFrustum(this.rendererBoundingBox); -- } -- -+ /** -+ * Takes in the pass the call list is being requested for. Args: renderPass -+ */ -+ public int getGLCallListForPass(int par1) { -+ return !this.isInFrustum ? -1 : (!this.skipRenderPass[par1] ? this.glRenderList + par1 : -1); -+ } -+ -+ public void updateInFrustum(ICamera par1ICamera) { -+ this.isInFrustum = par1ICamera.isBoundingBoxInFrustum(this.rendererBoundingBox); -+ } -+ -+ /** -+ * Renders the occlusion query GL List -+ */ - public void callOcclusionQueryList() { -- GL11.glCallList(this.glRenderList + 2); -+ // MCPatcher Start -+ GL11.glCallList(this.glRenderList + 4); -+ // MCPatcher End - } - -+ /** -+ * Checks if all render passes are to be skipped. Returns false if the renderer is not initialized -+ */ - public boolean skipAllRenderPasses() { -- return !this.isInitialized ? false : this.skipRenderPass[0] && this.skipRenderPass[1]; -+ // MCPatcher Start -+ return !this.isInitialized ? false : RenderPass.skipAllRenderPasses(this.skipRenderPass); -+ // MCPatcher End - } - -+ /** -+ * Marks the current renderer data as dirty and needing to be updated. -+ */ - public void markDirty() { - this.needsUpdate = true; - } ---- net/minecraft/src/SaveHandlerMP.java -+++ net/minecraft/src/SaveHandlerMP.java -@@ -3,34 +3,58 @@ - import java.io.File; - - public class SaveHandlerMP implements ISaveHandler { -+ -+ /** -+ * Loads and returns the world info -+ */ - public WorldInfo loadWorldInfo() { - return null; - } - -- public void checkSessionLock() throws MinecraftException { -- } -- -- public IChunkLoader getChunkLoader(WorldProvider var1) { -- return null; -- } -- -- public void saveWorldInfoWithPlayer(WorldInfo var1, NBTTagCompound var2) { -- } -- -- public void saveWorldInfo(WorldInfo var1) { -- } -- -- public IPlayerFileData getPlayerNBTManager() { -- return null; -- } -- -- public void flush() { -- } -- -- public File getMapFileFromName(String var1) { -- return null; -- } -- -+ /** -+ * Checks the session lock to prevent save collisions -+ */ -+ public void checkSessionLock() throws MinecraftException {} -+ -+ /** -+ * Returns the chunk loader with the provided world provider -+ */ -+ public IChunkLoader getChunkLoader(WorldProvider par1WorldProvider) { -+ return null; -+ } -+ -+ /** -+ * Saves the given World Info with the given NBTTagCompound as the Player. -+ */ -+ public void saveWorldInfoWithPlayer(WorldInfo par1WorldInfo, NBTTagCompound par2NBTTagCompound) {} -+ -+ /** -+ * Saves the passed in world info. -+ */ -+ public void saveWorldInfo(WorldInfo par1WorldInfo) {} -+ -+ /** -+ * returns null if no saveHandler is relevent (eg. SMP) -+ */ -+ public IPlayerFileData getSaveHandler() { -+ return null; -+ } -+ -+ /** -+ * Called to flush all changes to disk, waiting for them to complete. -+ */ -+ public void flush() {} -+ -+ /** -+ * Gets the file location of the given map -+ */ -+ public File getMapFileFromName(String par1Str) { -+ return null; -+ } -+ -+ /** -+ * Returns the name of the directory where world information is saved. -+ */ - public String getWorldDirectoryName() { - return "none"; - } ---- net/minecraft/src/GuiSlotServer.java -+++ net/minecraft/src/GuiSlotServer.java -@@ -3,40 +3,54 @@ - import org.lwjgl.opengl.GL11; - - class GuiSlotServer extends GuiSlot { -+ -+ /** Instance to the GUI this list is on. */ - final GuiMultiplayer parentGui; - -- public GuiSlotServer(GuiMultiplayer var1) { -- super(var1.mc, var1.width, var1.height, 32, var1.height - 64, 36); -- this.parentGui = var1; -+ public GuiSlotServer(GuiMultiplayer par1GuiMultiplayer) { -+ super(par1GuiMultiplayer.mc, par1GuiMultiplayer.width, par1GuiMultiplayer.height, 32, par1GuiMultiplayer.height - 64, 36); -+ this.parentGui = par1GuiMultiplayer; - } - -+ /** -+ * Gets the size of the current slot list. -+ */ - protected int getSize() { - return GuiMultiplayer.getInternetServerList(this.parentGui).countServers() + GuiMultiplayer.getListOfLanServers(this.parentGui).size() + 1; - } - -- protected void elementClicked(int var1, boolean var2) { -- if(var1 < GuiMultiplayer.getInternetServerList(this.parentGui).countServers() + GuiMultiplayer.getListOfLanServers(this.parentGui).size()) { -+ /** -+ * the element in the slot that was clicked, boolean for wether it was double clicked or not -+ */ -+ protected void elementClicked(int par1, boolean par2) { -+ if (par1 < GuiMultiplayer.getInternetServerList(this.parentGui).countServers() + GuiMultiplayer.getListOfLanServers(this.parentGui).size()) { - int var3 = GuiMultiplayer.getSelectedServer(this.parentGui); -- GuiMultiplayer.getAndSetSelectedServer(this.parentGui, var1); -- ServerData var4 = GuiMultiplayer.getInternetServerList(this.parentGui).countServers() > var1 ? GuiMultiplayer.getInternetServerList(this.parentGui).getServerData(var1) : null; -+ GuiMultiplayer.getAndSetSelectedServer(this.parentGui, par1); -+ ServerData var4 = GuiMultiplayer.getInternetServerList(this.parentGui).countServers() > par1 ? GuiMultiplayer.getInternetServerList(this.parentGui).getServerData(par1) : null; - boolean var5 = GuiMultiplayer.getSelectedServer(this.parentGui) >= 0 && GuiMultiplayer.getSelectedServer(this.parentGui) < this.getSize() && (var4 == null || var4.field_82821_f == 78); - boolean var6 = GuiMultiplayer.getSelectedServer(this.parentGui) < GuiMultiplayer.getInternetServerList(this.parentGui).countServers(); - GuiMultiplayer.getButtonSelect(this.parentGui).enabled = var5; - GuiMultiplayer.getButtonEdit(this.parentGui).enabled = var6; - GuiMultiplayer.getButtonDelete(this.parentGui).enabled = var6; -- if(var2 && var5) { -- GuiMultiplayer.func_74008_b(this.parentGui, var1); -- } else if(var6 && GuiScreen.isShiftKeyDown() && var3 >= 0 && var3 < GuiMultiplayer.getInternetServerList(this.parentGui).countServers()) { -+ -+ if (par2 && var5) { -+ GuiMultiplayer.func_74008_b(this.parentGui, par1); -+ } else if (var6 && GuiScreen.isShiftKeyDown() && var3 >= 0 && var3 < GuiMultiplayer.getInternetServerList(this.parentGui).countServers()) { - GuiMultiplayer.getInternetServerList(this.parentGui).swapServers(var3, GuiMultiplayer.getSelectedServer(this.parentGui)); - } -- - } - } - -- protected boolean isSelected(int var1) { -- return var1 == GuiMultiplayer.getSelectedServer(this.parentGui); -+ /** -+ * returns true if the element passed in is currently selected -+ */ -+ protected boolean isSelected(int par1) { -+ return par1 == GuiMultiplayer.getSelectedServer(this.parentGui); - } - -+ /** -+ * return the height of the content being scrolled -+ */ - protected int getContentHeight() { - return this.getSize() * 36; - } -@@ -45,123 +59,128 @@ - this.parentGui.drawDefaultBackground(); - } - -- protected void drawSlot(int var1, int var2, int var3, int var4, Tessellator var5) { -- if(var1 < GuiMultiplayer.getInternetServerList(this.parentGui).countServers()) { -- this.func_77247_d(var1, var2, var3, var4, var5); -- } else if(var1 < GuiMultiplayer.getInternetServerList(this.parentGui).countServers() + GuiMultiplayer.getListOfLanServers(this.parentGui).size()) { -- this.func_77248_b(var1, var2, var3, var4, var5); -- } else { -- this.func_77249_c(var1, var2, var3, var4, var5); -- } -- -- } -- -- private void func_77248_b(int var1, int var2, int var3, int var4, Tessellator var5) { -- LanServer var6 = (LanServer)GuiMultiplayer.getListOfLanServers(this.parentGui).get(var1 - GuiMultiplayer.getInternetServerList(this.parentGui).countServers()); -- this.parentGui.drawString(this.parentGui.fontRenderer, I18n.getString("lanServer.title"), var2 + 2, var3 + 1, 16777215); -- this.parentGui.drawString(this.parentGui.fontRenderer, var6.getServerMotd(), var2 + 2, var3 + 12, 8421504); -- if(this.parentGui.mc.gameSettings.hideServerAddress) { -- this.parentGui.drawString(this.parentGui.fontRenderer, I18n.getString("selectServer.hiddenAddress"), var2 + 2, var3 + 12 + 11, 3158064); -- } else { -- this.parentGui.drawString(this.parentGui.fontRenderer, var6.getServerIpPort(), var2 + 2, var3 + 12 + 11, 3158064); -- } -- -- } -- -- private void func_77249_c(int var1, int var2, int var3, int var4, Tessellator var5) { -- this.parentGui.drawCenteredString(this.parentGui.fontRenderer, I18n.getString("lanServer.scanning"), this.parentGui.width / 2, var3 + 1, 16777215); -+ protected void drawSlot(int par1, int par2, int par3, int par4, Tessellator par5Tessellator) { -+ if (par1 < GuiMultiplayer.getInternetServerList(this.parentGui).countServers()) { -+ this.func_77247_d(par1, par2, par3, par4, par5Tessellator); -+ } else if (par1 < GuiMultiplayer.getInternetServerList(this.parentGui).countServers() + GuiMultiplayer.getListOfLanServers(this.parentGui).size()) { -+ this.func_77248_b(par1, par2, par3, par4, par5Tessellator); -+ } else { -+ this.func_77249_c(par1, par2, par3, par4, par5Tessellator); -+ } -+ } -+ -+ private void func_77248_b(int par1, int par2, int par3, int par4, Tessellator par5Tessellator) { -+ LanServer var6 = (LanServer)GuiMultiplayer.getListOfLanServers(this.parentGui).get(par1 - GuiMultiplayer.getInternetServerList(this.parentGui).countServers()); -+ this.parentGui.drawString(this.parentGui.fontRenderer, I18n.getString("lanServer.title"), par2 + 2, par3 + 1, 16777215); -+ this.parentGui.drawString(this.parentGui.fontRenderer, var6.getServerMotd(), par2 + 2, par3 + 12, 8421504); -+ -+ if (this.parentGui.mc.gameSettings.hideServerAddress) { -+ this.parentGui.drawString(this.parentGui.fontRenderer, I18n.getString("selectServer.hiddenAddress"), par2 + 2, par3 + 12 + 11, 3158064); -+ } else { -+ this.parentGui.drawString(this.parentGui.fontRenderer, var6.getServerIpPort(), par2 + 2, par3 + 12 + 11, 3158064); -+ } -+ } -+ -+ private void func_77249_c(int par1, int par2, int par3, int par4, Tessellator par5Tessellator) { -+ this.parentGui.drawCenteredString(this.parentGui.fontRenderer, I18n.getString("lanServer.scanning"), this.parentGui.width / 2, par3 + 1, 16777215); - String var6; -- switch(GuiMultiplayer.getTicksOpened(this.parentGui) / 3 % 4) { -- case 0: -- default: -- var6 = "O o o"; -- break; -- case 1: -- case 3: -- var6 = "o O o"; -- break; -- case 2: -- var6 = "o o O"; -+ -+ switch (GuiMultiplayer.getTicksOpened(this.parentGui) / 3 % 4) { -+ case 0: -+ default: -+ var6 = "O o o"; -+ break; -+ -+ case 1: -+ case 3: -+ var6 = "o O o"; -+ break; -+ -+ case 2: -+ var6 = "o o O"; - } - -- this.parentGui.drawCenteredString(this.parentGui.fontRenderer, var6, this.parentGui.width / 2, var3 + 12, 8421504); -+ this.parentGui.drawCenteredString(this.parentGui.fontRenderer, var6, this.parentGui.width / 2, par3 + 12, 8421504); - } - -- private void func_77247_d(int var1, int var2, int var3, int var4, Tessellator var5) { -- ServerData var6 = GuiMultiplayer.getInternetServerList(this.parentGui).getServerData(var1); -- Object var7 = GuiMultiplayer.getLock(); -- synchronized(var7) { -- if(GuiMultiplayer.getThreadsPending() < 5 && !var6.field_78841_f) { -+ private void func_77247_d(int par1, int par2, int par3, int par4, Tessellator par5Tessellator) { -+ ServerData var6 = GuiMultiplayer.getInternetServerList(this.parentGui).getServerData(par1); -+ -+ synchronized (GuiMultiplayer.getLock()) { -+ if (GuiMultiplayer.getThreadsPending() < 5 && !var6.field_78841_f) { - var6.field_78841_f = true; - var6.pingToServer = -2L; -- var6.d = ""; -- var6.c = ""; -+ var6.serverMOTD = ""; -+ var6.populationInfo = ""; - GuiMultiplayer.increaseThreadsPending(); - (new ThreadPollServers(this, var6)).start(); - } - } - -- boolean var15 = var6.field_82821_f > 78; -+ boolean var7 = var6.field_82821_f > 78; - boolean var8 = var6.field_82821_f < 78; -- boolean var9 = var15 || var8; -- this.parentGui.drawString(this.parentGui.fontRenderer, var6.a, var2 + 2, var3 + 1, 16777215); -- this.parentGui.drawString(this.parentGui.fontRenderer, var6.d, var2 + 2, var3 + 12, 8421504); -- this.parentGui.drawString(this.parentGui.fontRenderer, var6.c, var2 + 215 - this.parentGui.fontRenderer.getStringWidth(var6.c), var3 + 12, 8421504); -- if(var9) { -- String var10 = EnumChatFormatting.DARK_RED + var6.g; -- this.parentGui.drawString(this.parentGui.fontRenderer, var10, var2 + 200 - this.parentGui.fontRenderer.getStringWidth(var10), var3 + 1, 8421504); -+ boolean var9 = var7 || var8; -+ this.parentGui.drawString(this.parentGui.fontRenderer, var6.serverName, par2 + 2, par3 + 1, 16777215); -+ this.parentGui.drawString(this.parentGui.fontRenderer, var6.serverMOTD, par2 + 2, par3 + 12, 8421504); -+ this.parentGui.drawString(this.parentGui.fontRenderer, var6.populationInfo, par2 + 215 - this.parentGui.fontRenderer.getStringWidth(var6.populationInfo), par3 + 12, 8421504); -+ -+ if (var9) { -+ String var10 = EnumChatFormatting.DARK_RED + var6.gameVersion; -+ this.parentGui.drawString(this.parentGui.fontRenderer, var10, par2 + 200 - this.parentGui.fontRenderer.getStringWidth(var10), par3 + 1, 8421504); - } - -- if(!this.parentGui.mc.gameSettings.hideServerAddress && !var6.isHidingAddress()) { -- this.parentGui.drawString(this.parentGui.fontRenderer, var6.b, var2 + 2, var3 + 12 + 11, 3158064); -+ if (!this.parentGui.mc.gameSettings.hideServerAddress && !var6.isHidingAddress()) { -+ this.parentGui.drawString(this.parentGui.fontRenderer, var6.serverIP, par2 + 2, par3 + 12 + 11, 3158064); - } else { -- this.parentGui.drawString(this.parentGui.fontRenderer, I18n.getString("selectServer.hiddenAddress"), var2 + 2, var3 + 12 + 11, 3158064); -+ this.parentGui.drawString(this.parentGui.fontRenderer, I18n.getString("selectServer.hiddenAddress"), par2 + 2, par3 + 12 + 11, 3158064); - } - - GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - this.parentGui.mc.getTextureManager().bindTexture(Gui.icons); -- byte var16 = 0; -+ byte var15 = 0; - boolean var11 = false; - String var12 = ""; -- int var17; -- if(var9) { -- var12 = var15 ? "Client out of date!" : "Server out of date!"; -- var17 = 5; -- } else if(var6.field_78841_f && var6.pingToServer != -2L) { -- if(var6.pingToServer < 0L) { -- var17 = 5; -- } else if(var6.pingToServer < 150L) { -- var17 = 0; -- } else if(var6.pingToServer < 300L) { -- var17 = 1; -- } else if(var6.pingToServer < 600L) { -- var17 = 2; -- } else if(var6.pingToServer < 1000L) { -- var17 = 3; -+ int var16; -+ -+ if (var9) { -+ var12 = var7 ? "Client out of date!" : "Server out of date!"; -+ var16 = 5; -+ } else if (var6.field_78841_f && var6.pingToServer != -2L) { -+ if (var6.pingToServer < 0L) { -+ var16 = 5; -+ } else if (var6.pingToServer < 150L) { -+ var16 = 0; -+ } else if (var6.pingToServer < 300L) { -+ var16 = 1; -+ } else if (var6.pingToServer < 600L) { -+ var16 = 2; -+ } else if (var6.pingToServer < 1000L) { -+ var16 = 3; - } else { -- var17 = 4; -+ var16 = 4; - } - -- if(var6.pingToServer < 0L) { -+ if (var6.pingToServer < 0L) { - var12 = "(no connection)"; - } else { - var12 = var6.pingToServer + "ms"; - } - } else { -- var16 = 1; -- var17 = (int)(Minecraft.getSystemTime() / 100L + (long)(var1 * 2) & 7L); -- if(var17 > 4) { -- var17 = 8 - var17; -+ var15 = 1; -+ var16 = (int)(Minecraft.getSystemTime() / 100L + (long)(par1 * 2) & 7L); -+ -+ if (var16 > 4) { -+ var16 = 8 - var16; - } - - var12 = "Polling.."; - } - -- this.parentGui.drawTexturedModalRect(var2 + 205, var3, 0 + var16 * 10, 176 + var17 * 8, 10, 8); -+ this.parentGui.drawTexturedModalRect(par2 + 205, par3, 0 + var15 * 10, 176 + var16 * 8, 10, 8); - byte var13 = 4; -- if(this.mouseX >= var2 + 205 - var13 && this.mouseY >= var3 - var13 && this.mouseX <= var2 + 205 + 10 + var13 && this.mouseY <= var3 + 8 + var13) { -+ -+ if (this.mouseX >= par2 + 205 - var13 && this.mouseY >= par3 - var13 && this.mouseX <= par2 + 205 + 10 + var13 && this.mouseY <= par3 + 8 + var13) { - GuiMultiplayer.getAndSetLagTooltip(this.parentGui, var12); - } -- - } - } ---- net/minecraft/src/EntityAILeapAtTarget.java -+++ net/minecraft/src/EntityAILeapAtTarget.java -@@ -1,19 +1,29 @@ - package net.minecraft.src; - - public class EntityAILeapAtTarget extends EntityAIBase { -+ -+ /** The entity that is leaping. */ - EntityLiving leaper; -+ -+ /** The entity that the leaper is leaping towards. */ - EntityLivingBase leapTarget; -+ -+ /** The entity's motionY after leaping. */ - float leapMotionY; - -- public EntityAILeapAtTarget(EntityLiving var1, float var2) { -- this.leaper = var1; -- this.leapMotionY = var2; -+ public EntityAILeapAtTarget(EntityLiving par1EntityLiving, float par2) { -+ this.leaper = par1EntityLiving; -+ this.leapMotionY = par2; - this.setMutexBits(5); - } - -+ /** -+ * Returns whether the EntityAIBase should begin execution. -+ */ - public boolean shouldExecute() { - this.leapTarget = this.leaper.getAttackTarget(); -- if(this.leapTarget == null) { -+ -+ if (this.leapTarget == null) { - return false; - } else { - double var1 = this.leaper.getDistanceSqToEntity(this.leapTarget); -@@ -21,16 +31,22 @@ - } - } - -+ /** -+ * Returns whether an in-progress EntityAIBase should continue executing -+ */ - public boolean continueExecuting() { - return !this.leaper.onGround; - } - -+ /** -+ * Execute a one shot task or start executing a continuous task -+ */ - public void startExecuting() { - double var1 = this.leapTarget.posX - this.leaper.posX; - double var3 = this.leapTarget.posZ - this.leaper.posZ; - float var5 = MathHelper.sqrt_double(var1 * var1 + var3 * var3); -- this.leaper.motionX += var1 / (double)var5 * 0.5D * (double)0.8F + this.leaper.motionX * (double)0.2F; -- this.leaper.motionZ += var3 / (double)var5 * 0.5D * (double)0.8F + this.leaper.motionZ * (double)0.2F; -+ this.leaper.motionX += var1 / (double)var5 * 0.5D * 0.800000011920929D + this.leaper.motionX * 0.20000000298023224D; -+ this.leaper.motionZ += var3 / (double)var5 * 0.5D * 0.800000011920929D + this.leaper.motionZ * 0.20000000298023224D; - this.leaper.motionY = (double)this.leapMotionY; - } - } ---- /dev/null -+++ org/spoutcraft/client/packet/PacketBiomeWeather.java -@@ -1,0 +1,109 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.client.packet; -+ -+import java.io.IOException; -+ -+import org.spoutcraft.api.io.SpoutInputStream; -+import org.spoutcraft.api.io.SpoutOutputStream; -+import org.spoutcraft.client.SpoutClient; -+ -+public class PacketBiomeWeather implements SpoutPacket { -+ public byte biome; -+ public byte weather; -+ -+ public int getNumBytes() { -+ return 2; -+ } -+ -+ public void readData(SpoutInputStream input) throws IOException { -+ biome = (byte) input.read(); -+ weather = (byte) input.read(); -+ } -+ -+ public void writeData(SpoutOutputStream output) throws IOException { -+ output.write(biome); -+ output.write(weather); -+ } -+ -+ public PacketType getPacketType() { -+ return PacketType.PacketBiomeWeather; -+ } -+ -+ public int getVersion() { -+ return 0; -+ } -+ -+ public void run(int PlayerId) { -+ String biomeString = ""; -+ -+ switch(biome) { -+ case 0: biomeString = "Rainforest"; break; -+ case 1: biomeString = "Swampland"; break; -+ case 2: biomeString = "Seasonal Forest"; break; -+ case 3: biomeString = "Forest"; break; -+ case 4: biomeString = "Savanna"; break; -+ case 5: biomeString = "Shrubland"; break; -+ case 6: biomeString = "Taiga"; break; -+ case 7: biomeString = "Desert"; break; -+ case 8: biomeString = "Plains"; break; -+ case 9: biomeString = "Ice Desert"; break; -+ case 10: biomeString = "Tundra"; break; -+ case 11: biomeString = "Hell"; break; -+ case 12: biomeString = "Sky"; break; -+ case 13: biomeString = "Ocean"; break; -+ case 14: biomeString = "River"; break; -+ case 15: biomeString = "Extreme Hills"; break; -+ case 16: biomeString = "FrozenOcean"; break; -+ case 17: biomeString = "FrozenRiver"; break; -+ case 18: biomeString = "Ice Plains"; break; -+ case 19: biomeString = "Ice Mountains"; break; -+ case 20: biomeString = "MushroomIsland"; break; -+ case 21: biomeString = "MushroomIslandShore"; break; -+ default: break; -+ } -+ -+ SpoutClient.getInstance().getBiomeManager().resetWeather(biomeString); -+ -+ switch(weather) { -+ case 0: -+ SpoutClient.getInstance().getBiomeManager().setSnowEnabled(biomeString, false); -+ SpoutClient.getInstance().getBiomeManager().setRainEnabled(biomeString, false); -+ break; -+ case 1: -+ SpoutClient.getInstance().getBiomeManager().setSnowEnabled(biomeString, false); -+ SpoutClient.getInstance().getBiomeManager().setRainEnabled(biomeString, true); -+ break; -+ case 2: -+ SpoutClient.getInstance().getBiomeManager().setSnowEnabled(biomeString, true); -+ SpoutClient.getInstance().getBiomeManager().setRainEnabled(biomeString, false); -+ break; -+ case 3: -+ SpoutClient.getInstance().getBiomeManager().resetWeather(biomeString); -+ break; -+ default: -+ SpoutClient.getInstance().getBiomeManager().resetWeather(biomeString); -+ break; -+ } -+ } -+ -+ public void failure(int playerId) { -+ } -+} ---- net/minecraft/src/TileEntityDispenser.java -+++ net/minecraft/src/TileEntityDispenser.java -@@ -4,29 +4,45 @@ - - public class TileEntityDispenser extends TileEntity implements IInventory { - private ItemStack[] dispenserContents = new ItemStack[9]; -- private Random c = new Random(); -- protected String a; -- -+ -+ /** -+ * random number generator for instance. Used in random item stack selection. -+ */ -+ private Random dispenserRandom = new Random(); -+ protected String customName; -+ -+ /** -+ * Returns the number of slots in the inventory. -+ */ - public int getSizeInventory() { - return 9; - } - -- public ItemStack getStackInSlot(int var1) { -- return this.dispenserContents[var1]; -+ /** -+ * Returns the stack in slot i -+ */ -+ public ItemStack getStackInSlot(int par1) { -+ return this.dispenserContents[par1]; - } - -- public ItemStack decrStackSize(int var1, int var2) { -- if(this.dispenserContents[var1] != null) { -+ /** -+ * Removes from an inventory slot (first arg) up to a specified number (second arg) of items and returns them in a new -+ * stack. -+ */ -+ public ItemStack decrStackSize(int par1, int par2) { -+ if (this.dispenserContents[par1] != null) { - ItemStack var3; -- if(this.dispenserContents[var1].stackSize <= var2) { -- var3 = this.dispenserContents[var1]; -- this.dispenserContents[var1] = null; -+ -+ if (this.dispenserContents[par1].stackSize <= par2) { -+ var3 = this.dispenserContents[par1]; -+ this.dispenserContents[par1] = null; - this.onInventoryChanged(); - return var3; - } else { -- var3 = this.dispenserContents[var1].splitStack(var2); -- if(this.dispenserContents[var1].stackSize == 0) { -- this.dispenserContents[var1] = null; -+ var3 = this.dispenserContents[par1].splitStack(par2); -+ -+ if (this.dispenserContents[par1].stackSize == 0) { -+ this.dispenserContents[par1] = null; - } - - this.onInventoryChanged(); -@@ -37,10 +53,14 @@ - } - } - -- public ItemStack getStackInSlotOnClosing(int var1) { -- if(this.dispenserContents[var1] != null) { -- ItemStack var2 = this.dispenserContents[var1]; -- this.dispenserContents[var1] = null; -+ /** -+ * When some containers are closed they call this on each slot, then drop whatever it returns as an EntityItem - like -+ * when you close a workbench GUI. -+ */ -+ public ItemStack getStackInSlotOnClosing(int par1) { -+ if (this.dispenserContents[par1] != null) { -+ ItemStack var2 = this.dispenserContents[par1]; -+ this.dispenserContents[par1] = null; - return var2; - } else { - return null; -@@ -51,8 +71,8 @@ - int var1 = -1; - int var2 = 1; - -- for(int var3 = 0; var3 < this.dispenserContents.length; ++var3) { -- if(this.dispenserContents[var3] != null && this.c.nextInt(var2++) == 0) { -+ for (int var3 = 0; var3 < this.dispenserContents.length; ++var3) { -+ if (this.dispenserContents[var3] != null && this.dispenserRandom.nextInt(var2++) == 0) { - var1 = var3; - } - } -@@ -60,19 +80,26 @@ - return var1; - } - -- public void setInventorySlotContents(int var1, ItemStack var2) { -- this.dispenserContents[var1] = var2; -- if(var2 != null && var2.stackSize > this.getInventoryStackLimit()) { -- var2.stackSize = this.getInventoryStackLimit(); -+ /** -+ * Sets the given item stack to the specified slot in the inventory (can be crafting or armor sections). -+ */ -+ public void setInventorySlotContents(int par1, ItemStack par2ItemStack) { -+ this.dispenserContents[par1] = par2ItemStack; -+ -+ if (par2ItemStack != null && par2ItemStack.stackSize > this.getInventoryStackLimit()) { -+ par2ItemStack.stackSize = this.getInventoryStackLimit(); - } - - this.onInventoryChanged(); - } - -- public int addItem(ItemStack var1) { -- for(int var2 = 0; var2 < this.dispenserContents.length; ++var2) { -- if(this.dispenserContents[var2] == null || this.dispenserContents[var2].itemID == 0) { -- this.setInventorySlotContents(var2, var1); -+ /** -+ * Add item stack in first available inventory slot -+ */ -+ public int addItem(ItemStack par1ItemStack) { -+ for (int var2 = 0; var2 < this.dispenserContents.length; ++var2) { -+ if (this.dispenserContents[var2] == null || this.dispenserContents[var2].itemID == 0) { -+ this.setInventorySlotContents(var2, par1ItemStack); - return var2; - } - } -@@ -80,43 +107,56 @@ - return -1; - } - -+ /** -+ * Returns the name of the inventory. -+ */ - public String getInvName() { -- return this.isInvNameLocalized() ? this.a : "container.dispenser"; -- } -- -- public void setCustomName(String var1) { -- this.a = var1; -- } -- -+ return this.isInvNameLocalized() ? this.customName : "container.dispenser"; -+ } -+ -+ public void setCustomName(String par1Str) { -+ this.customName = par1Str; -+ } -+ -+ /** -+ * If this returns false, the inventory name will be used as an unlocalized name, and translated into the player's -+ * language. Otherwise it will be used directly. -+ */ - public boolean isInvNameLocalized() { -- return this.a != null; -+ return this.customName != null; - } - -- public void readFromNBT(NBTTagCompound var1) { -- super.readFromNBT(var1); -- NBTTagList var2 = var1.getTagList("Items"); -+ /** -+ * Reads a tile entity from NBT. -+ */ -+ public void readFromNBT(NBTTagCompound par1NBTTagCompound) { -+ super.readFromNBT(par1NBTTagCompound); -+ NBTTagList var2 = par1NBTTagCompound.getTagList("Items"); - this.dispenserContents = new ItemStack[this.getSizeInventory()]; - -- for(int var3 = 0; var3 < var2.tagCount(); ++var3) { -+ for (int var3 = 0; var3 < var2.tagCount(); ++var3) { - NBTTagCompound var4 = (NBTTagCompound)var2.tagAt(var3); - int var5 = var4.getByte("Slot") & 255; -- if(var5 >= 0 && var5 < this.dispenserContents.length) { -+ -+ if (var5 >= 0 && var5 < this.dispenserContents.length) { - this.dispenserContents[var5] = ItemStack.loadItemStackFromNBT(var4); - } - } - -- if(var1.hasKey("CustomName")) { -- this.a = var1.getString("CustomName"); -+ if (par1NBTTagCompound.hasKey("CustomName")) { -+ this.customName = par1NBTTagCompound.getString("CustomName"); - } -- - } - -- public void writeToNBT(NBTTagCompound var1) { -- super.writeToNBT(var1); -+ /** -+ * Writes a tile entity to NBT. -+ */ -+ public void writeToNBT(NBTTagCompound par1NBTTagCompound) { -+ super.writeToNBT(par1NBTTagCompound); - NBTTagList var2 = new NBTTagList(); - -- for(int var3 = 0; var3 < this.dispenserContents.length; ++var3) { -- if(this.dispenserContents[var3] != null) { -+ for (int var3 = 0; var3 < this.dispenserContents.length; ++var3) { -+ if (this.dispenserContents[var3] != null) { - NBTTagCompound var4 = new NBTTagCompound(); - var4.setByte("Slot", (byte)var3); - this.dispenserContents[var3].writeToNBT(var4); -@@ -124,28 +164,36 @@ - } - } - -- var1.setTag("Items", var2); -- if(this.isInvNameLocalized()) { -- var1.setString("CustomName", this.a); -+ par1NBTTagCompound.setTag("Items", var2); -+ -+ if (this.isInvNameLocalized()) { -+ par1NBTTagCompound.setString("CustomName", this.customName); - } -- - } - -+ /** -+ * Returns the maximum stack size for a inventory slot. Seems to always be 64, possibly will be extended. *Isn't this -+ * more of a set than a get?* -+ */ - public int getInventoryStackLimit() { - return 64; - } - -- public boolean isUseableByPlayer(EntityPlayer var1) { -- return this.worldObj.getBlockTileEntity(this.xCoord, this.yCoord, this.zCoord) != this ? false : var1.getDistanceSq((double)this.xCoord + 0.5D, (double)this.yCoord + 0.5D, (double)this.zCoord + 0.5D) <= 64.0D; -- } -- -- public void openChest() { -- } -- -- public void closeChest() { -- } -- -- public boolean isItemValidForSlot(int var1, ItemStack var2) { -+ /** -+ * Do not make give this method the name canInteractWith because it clashes with Container -+ */ -+ public boolean isUseableByPlayer(EntityPlayer par1EntityPlayer) { -+ return this.worldObj.getBlockTileEntity(this.xCoord, this.yCoord, this.zCoord) != this ? false : par1EntityPlayer.getDistanceSq((double)this.xCoord + 0.5D, (double)this.yCoord + 0.5D, (double)this.zCoord + 0.5D) <= 64.0D; -+ } -+ -+ public void openChest() {} -+ -+ public void closeChest() {} -+ -+ /** -+ * Returns true if automation is allowed to insert the given stack (ignoring stack size) into the given slot. -+ */ -+ public boolean isItemValidForSlot(int par1, ItemStack par2ItemStack) { - return true; - } - } ---- net/minecraft/src/ItemPiston.java -+++ net/minecraft/src/ItemPiston.java -@@ -1,11 +1,14 @@ - package net.minecraft.src; - - public class ItemPiston extends ItemBlock { -- public ItemPiston(int var1) { -- super(var1); -+ public ItemPiston(int par1) { -+ super(par1); - } - -- public int getMetadata(int var1) { -+ /** -+ * Returns the metadata of the block which this Item (ItemBlock) can place -+ */ -+ public int getMetadata(int par1) { - return 7; - } - } ---- net/minecraft/src/CreativeTabTransport.java -+++ net/minecraft/src/CreativeTabTransport.java -@@ -1,10 +1,13 @@ - package net.minecraft.src; - - final class CreativeTabTransport extends CreativeTabs { -- CreativeTabTransport(int var1, String var2) { -- super(var1, var2); -+ CreativeTabTransport(int par1, String par2Str) { -+ super(par1, par2Str); - } - -+ /** -+ * the itemID for the item to be displayed on the tab -+ */ - public int getTabIconItemIndex() { - return Item.bucketLava.itemID; - } ---- net/minecraft/src/SaveFormatOld.java -+++ net/minecraft/src/SaveFormatOld.java -@@ -7,23 +7,28 @@ - import java.util.List; - - public class SaveFormatOld implements ISaveFormat { -- protected final File a; -- -- public SaveFormatOld(File var1) { -- if(!var1.exists()) { -- var1.mkdirs(); -+ -+ /** -+ * Reference to the File object representing the directory for the world saves -+ */ -+ protected final File savesDirectory; -+ -+ public SaveFormatOld(File par1File) { -+ if (!par1File.exists()) { -+ par1File.mkdirs(); - } - -- this.a = var1; -+ this.savesDirectory = par1File; - } - - public List getSaveList() throws AnvilConverterException { - ArrayList var1 = new ArrayList(); - -- for(int var2 = 0; var2 < 5; ++var2) { -+ for (int var2 = 0; var2 < 5; ++var2) { - String var3 = "World" + (var2 + 1); - WorldInfo var4 = this.getWorldInfo(var3); -- if(var4 != null) { -+ -+ if (var4 != null) { - var1.add(new SaveFormatComparator(var3, "", var4.getLastTimePlayed(), var4.getSizeOnDisk(), var4.getGameType(), false, var4.isHardcoreModeEnabled(), var4.areCommandsAllowed())); - } - } -@@ -31,18 +36,22 @@ - return var1; - } - -- public void flushCache() { -- } -- -- public WorldInfo getWorldInfo(String var1) { -- File var2 = new File(this.a, var1); -- if(!var2.exists()) { -+ public void flushCache() {} -+ -+ /** -+ * gets the world info -+ */ -+ public WorldInfo getWorldInfo(String par1Str) { -+ File var2 = new File(this.savesDirectory, par1Str); -+ -+ if (!var2.exists()) { - return null; - } else { - File var3 = new File(var2, "level.dat"); - NBTTagCompound var4; - NBTTagCompound var5; -- if(var3.exists()) { -+ -+ if (var3.exists()) { - try { - var4 = CompressedStreamTools.readCompressed(new FileInputStream(var3)); - var5 = var4.getCompoundTag("Data"); -@@ -53,7 +62,8 @@ - } - - var3 = new File(var2, "level.dat_old"); -- if(var3.exists()) { -+ -+ if (var3.exists()) { - try { - var4 = CompressedStreamTools.readCompressed(new FileInputStream(var3)); - var5 = var4.getCompoundTag("Data"); -@@ -67,42 +77,56 @@ - } - } - -- public void renameWorld(String var1, String var2) { -- File var3 = new File(this.a, var1); -- if(var3.exists()) { -+ /** -+ * @args: Takes two arguments - first the name of the directory containing the world and second the new name for that -+ * world. @desc: Renames the world by storing the new name in level.dat. It does *not* rename the directory containing -+ * the world data. -+ */ -+ public void renameWorld(String par1Str, String par2Str) { -+ File var3 = new File(this.savesDirectory, par1Str); -+ -+ if (var3.exists()) { - File var4 = new File(var3, "level.dat"); -- if(var4.exists()) { -+ -+ if (var4.exists()) { - try { - NBTTagCompound var5 = CompressedStreamTools.readCompressed(new FileInputStream(var4)); - NBTTagCompound var6 = var5.getCompoundTag("Data"); -- var6.setString("LevelName", var2); -+ var6.setString("LevelName", par2Str); - CompressedStreamTools.writeCompressed(var5, new FileOutputStream(var4)); - } catch (Exception var7) { - var7.printStackTrace(); - } - } -- - } - } - -- public boolean deleteWorldDirectory(String var1) { -- File var2 = new File(this.a, var1); -- if(!var2.exists()) { -+ /** -+ * @args: Takes one argument - the name of the directory of the world to delete. @desc: Delete the world by deleting -+ * the associated directory recursively. -+ */ -+ public boolean deleteWorldDirectory(String par1Str) { -+ File var2 = new File(this.savesDirectory, par1Str); -+ -+ if (!var2.exists()) { - return true; - } else { -- System.out.println("Deleting level " + var1); -+ System.out.println("Deleting level " + par1Str); - -- for(int var3 = 1; var3 <= 5; ++var3) { -+ for (int var3 = 1; var3 <= 5; ++var3) { - System.out.println("Attempt " + var3 + "..."); -- if(deleteFiles(var2.listFiles())) { -+ -+ if (deleteFiles(var2.listFiles())) { - break; - } - - System.out.println("Unsuccessful in deleting contents."); -- if(var3 < 5) { -+ -+ if (var3 < 5) { - try { - Thread.sleep(500L); - } catch (InterruptedException var5) { -+ ; - } - } - } -@@ -111,16 +135,21 @@ - } - } - -- protected static boolean deleteFiles(File[] var0) { -- for(int var1 = 0; var1 < var0.length; ++var1) { -- File var2 = var0[var1]; -+ /** -+ * @args: Takes one argument - the list of files and directories to delete. @desc: Deletes the files and directory -+ * listed in the list recursively. -+ */ -+ protected static boolean deleteFiles(File[] par0ArrayOfFile) { -+ for (int var1 = 0; var1 < par0ArrayOfFile.length; ++var1) { -+ File var2 = par0ArrayOfFile[var1]; - System.out.println("Deleting " + var2); -- if(var2.isDirectory() && !deleteFiles(var2.listFiles())) { -+ -+ if (var2.isDirectory() && !deleteFiles(var2.listFiles())) { - System.out.println("Couldn\'t delete directory " + var2); - return false; - } - -- if(!var2.delete()) { -+ if (!var2.delete()) { - System.out.println("Couldn\'t delete file " + var2); - return false; - } -@@ -129,20 +158,32 @@ - return true; - } - -- public ISaveHandler getSaveLoader(String var1, boolean var2) { -- return new SaveHandler(this.a, var1, var2); -- } -- -- public boolean isOldMapFormat(String var1) { -- return false; -- } -- -- public boolean convertMapFormat(String var1, IProgressUpdate var2) { -- return false; -- } -- -- public boolean canLoadWorld(String var1) { -- File var2 = new File(this.a, var1); -+ /** -+ * Returns back a loader for the specified save directory -+ */ -+ public ISaveHandler getSaveLoader(String par1Str, boolean par2) { -+ return new SaveHandler(this.savesDirectory, par1Str, par2); -+ } -+ -+ /** -+ * Checks if the save directory uses the old map format -+ */ -+ public boolean isOldMapFormat(String par1Str) { -+ return false; -+ } -+ -+ /** -+ * Converts the specified map to the new map format. Args: worldName, loadingScreen -+ */ -+ public boolean convertMapFormat(String par1Str, IProgressUpdate par2IProgressUpdate) { -+ return false; -+ } -+ -+ /** -+ * Return whether the given world can be loaded. -+ */ -+ public boolean canLoadWorld(String par1Str) { -+ File var2 = new File(this.savesDirectory, par1Str); - return var2.isDirectory(); - } - } ---- net/minecraft/src/StitcherException.java -+++ net/minecraft/src/StitcherException.java -@@ -3,8 +3,8 @@ - public class StitcherException extends RuntimeException { - private final StitchHolder field_98149_a; - -- public StitcherException(StitchHolder var1, String var2) { -- super(var2); -- this.field_98149_a = var1; -+ public StitcherException(StitchHolder par1StitchHolder, String par2Str) { -+ super(par2Str); -+ this.field_98149_a = par1StitchHolder; - } - } ---- net/minecraft/src/TcpMasterThread.java -+++ net/minecraft/src/TcpMasterThread.java -@@ -3,29 +3,32 @@ - class TcpMasterThread extends Thread { - final TcpConnection theTcpConnection; - -- TcpMasterThread(TcpConnection var1) { -- this.theTcpConnection = var1; -+ TcpMasterThread(TcpConnection par1TcpConnection) { -+ this.theTcpConnection = par1TcpConnection; - } - -+ @SuppressWarnings("deprecation") - public void run() { - try { - Thread.sleep(5000L); -- if(TcpConnection.getReadThread(this.theTcpConnection).isAlive()) { -+ -+ if (TcpConnection.getReadThread(this.theTcpConnection).isAlive()) { - try { - TcpConnection.getReadThread(this.theTcpConnection).stop(); - } catch (Throwable var3) { -+ ; - } - } - -- if(TcpConnection.getWriteThread(this.theTcpConnection).isAlive()) { -+ if (TcpConnection.getWriteThread(this.theTcpConnection).isAlive()) { - try { - TcpConnection.getWriteThread(this.theTcpConnection).stop(); - } catch (Throwable var2) { -+ ; - } - } - } catch (InterruptedException var4) { - var4.printStackTrace(); - } -- - } - } ---- net/minecraft/src/EntityAIWatchClosest.java -+++ net/minecraft/src/EntityAIWatchClosest.java -@@ -2,58 +2,77 @@ - - public class EntityAIWatchClosest extends EntityAIBase { - private EntityLiving theWatcher; -+ -+ /** The closest entity which is being watched by this one. */ - protected Entity closestEntity; -+ -+ /** This is the Maximum distance that the AI will look for the Entity */ - private float maxDistanceForPlayer; - private int lookTime; - private float field_75331_e; -- private Class f; -+ private Class watchedClass; - -- public EntityAIWatchClosest(EntityLiving var1, Class var2, float var3) { -- this.theWatcher = var1; -- this.f = var2; -- this.maxDistanceForPlayer = var3; -+ public EntityAIWatchClosest(EntityLiving par1EntityLiving, Class par2Class, float par3) { -+ this.theWatcher = par1EntityLiving; -+ this.watchedClass = par2Class; -+ this.maxDistanceForPlayer = par3; - this.field_75331_e = 0.02F; - this.setMutexBits(2); - } - -- public EntityAIWatchClosest(EntityLiving var1, Class var2, float var3, float var4) { -- this.theWatcher = var1; -- this.f = var2; -- this.maxDistanceForPlayer = var3; -- this.field_75331_e = var4; -+ public EntityAIWatchClosest(EntityLiving par1EntityLiving, Class par2Class, float par3, float par4) { -+ this.theWatcher = par1EntityLiving; -+ this.watchedClass = par2Class; -+ this.maxDistanceForPlayer = par3; -+ this.field_75331_e = par4; - this.setMutexBits(2); - } - -+ /** -+ * Returns whether the EntityAIBase should begin execution. -+ */ - public boolean shouldExecute() { -- if(this.theWatcher.getRNG().nextFloat() >= this.field_75331_e) { -+ if (this.theWatcher.getRNG().nextFloat() >= this.field_75331_e) { - return false; - } else { -- if(this.theWatcher.getAttackTarget() != null) { -+ if (this.theWatcher.getAttackTarget() != null) { - this.closestEntity = this.theWatcher.getAttackTarget(); - } - -- if(this.f == EntityPlayer.class) { -+ if (this.watchedClass == EntityPlayer.class) { - this.closestEntity = this.theWatcher.worldObj.getClosestPlayerToEntity(this.theWatcher, (double)this.maxDistanceForPlayer); - } else { -- this.closestEntity = this.theWatcher.worldObj.findNearestEntityWithinAABB(this.f, this.theWatcher.boundingBox.expand((double)this.maxDistanceForPlayer, 3.0D, (double)this.maxDistanceForPlayer), this.theWatcher); -+ this.closestEntity = this.theWatcher.worldObj.findNearestEntityWithinAABB(this.watchedClass, this.theWatcher.boundingBox.expand((double)this.maxDistanceForPlayer, 3.0D, (double)this.maxDistanceForPlayer), this.theWatcher); - } - - return this.closestEntity != null; - } - } - -+ /** -+ * Returns whether an in-progress EntityAIBase should continue executing -+ */ - public boolean continueExecuting() { - return !this.closestEntity.isEntityAlive() ? false : (this.theWatcher.getDistanceSqToEntity(this.closestEntity) > (double)(this.maxDistanceForPlayer * this.maxDistanceForPlayer) ? false : this.lookTime > 0); - } - -+ /** -+ * Execute a one shot task or start executing a continuous task -+ */ - public void startExecuting() { - this.lookTime = 40 + this.theWatcher.getRNG().nextInt(40); - } - -+ /** -+ * Resets the task -+ */ - public void resetTask() { - this.closestEntity = null; - } - -+ /** -+ * Updates the task -+ */ - public void updateTask() { - this.theWatcher.getLookHelper().setLookPosition(this.closestEntity.posX, this.closestEntity.posY + (double)this.closestEntity.getEyeHeight(), this.closestEntity.posZ, 10.0F, (float)this.theWatcher.getVerticalFaceSpeed()); - --this.lookTime; ---- net/minecraft/src/EntitySplashFX.java -+++ net/minecraft/src/EntitySplashFX.java -@@ -1,15 +1,27 @@ - package net.minecraft.src; - -+// MCPatcher Start -+import com.prupe.mcpatcher.cc.ColorizeBlock; -+// MCPatcher End -+ - public class EntitySplashFX extends EntityRainFX { -- public EntitySplashFX(World var1, double var2, double var4, double var6, double var8, double var10, double var12) { -- super(var1, var2, var4, var6); -+ public EntitySplashFX(World par1World, double par2, double par4, double par6, double par8, double par10, double par12) { -+ super(par1World, par2, par4, par6); - this.particleGravity = 0.04F; - this.nextTextureIndexX(); -- if(var10 == 0.0D && (var8 != 0.0D || var12 != 0.0D)) { -- this.motionX = var8; -- this.motionY = var10 + 0.1D; -- this.motionZ = var12; -- } -- -+ -+ if (par10 == 0.0D && (par8 != 0.0D || par12 != 0.0D)) { -+ this.motionX = par8; -+ this.motionY = par10 + 0.1D; -+ this.motionZ = par12; -+ } -+ -+ // MCPatcher Start -+ if (ColorizeBlock.computeWaterColor(this.posX, this.posY, this.posZ)) { -+ this.particleRed = ColorizeBlock.waterColor[0]; -+ this.particleGreen = ColorizeBlock.waterColor[1]; -+ this.particleBlue = ColorizeBlock.waterColor[2]; -+ } -+ // MCPatcher End - } - } ---- net/minecraft/src/SimpleTexture.java -+++ net/minecraft/src/SimpleTexture.java -@@ -1,5 +1,6 @@ - package net.minecraft.src; - -+import com.prupe.mcpatcher.hd.MipmapHelper; - import java.awt.image.BufferedImage; - import java.io.IOException; - import java.io.InputStream; -@@ -8,23 +9,25 @@ - public class SimpleTexture extends AbstractTexture { - private final ResourceLocation textureLocation; - -- public SimpleTexture(ResourceLocation var1) { -- this.textureLocation = var1; -+ public SimpleTexture(ResourceLocation par1ResourceLocation) { -+ this.textureLocation = par1ResourceLocation; - } - -- public void loadTexture(ResourceManager var1) throws IOException { -+ public void loadTexture(ResourceManager par1ResourceManager) throws IOException { - InputStream var2 = null; - - try { -- Resource var3 = var1.getResource(this.textureLocation); -+ Resource var3 = par1ResourceManager.getResource(this.textureLocation); - var2 = var3.getInputStream(); - BufferedImage var4 = ImageIO.read(var2); - boolean var5 = false; - boolean var6 = false; -- if(var3.hasMetadata()) { -+ -+ if (var3.hasMetadata()) { - try { - TextureMetadataSection var7 = (TextureMetadataSection)var3.getMetadata("texture"); -- if(var7 != null) { -+ -+ if (var7 != null) { - var5 = var7.getTextureBlur(); - var6 = var7.getTextureClamp(); - } -@@ -33,13 +36,11 @@ - } - } - -- TextureUtil.uploadTextureImageAllocate(this.getGlTextureId(), var4, var5, var6); -+ MipmapHelper.setupTexture(this.getGlTextureId(), var4, var5, var6, this.textureLocation); - } finally { -- if(var2 != null) { -+ if (var2 != null) { - var2.close(); - } -- - } -- - } - } ---- /dev/null -+++ com/prupe/mcpatcher/cc/ColorizeWorld.java -@@ -1,0 +1,205 @@ -+package com.prupe.mcpatcher.cc; -+ -+import com.prupe.mcpatcher.Config; -+import com.prupe.mcpatcher.MCLogger; -+import java.util.ArrayList; -+import java.util.HashMap; -+import java.util.Iterator; -+import java.util.List; -+import java.util.Map; -+import java.util.Properties; -+import java.util.Map.Entry; -+import net.minecraft.src.BiomeGenBase; -+import net.minecraft.src.Entity; -+import net.minecraft.src.World; -+ -+public class ColorizeWorld { -+ private static final MCLogger logger = MCLogger.getLogger("Custom Colors"); -+ private static final int fogBlendRadius = Config.getInt("Custom Colors", "fogBlendRadius", 7); -+ private static final String TEXT_KEY = "text."; -+ private static final String TEXT_CODE_KEY = "text.code."; -+ private static final int CLOUDS_DEFAULT = 0; -+ private static final int CLOUDS_FAST = 1; -+ private static final int CLOUDS_FANCY = 2; -+ private static int cloudType = 0; -+ private static final List biomes = new ArrayList(); -+ private static boolean biomesLogged; -+ private static Entity fogCamera; -+ private static final Map textColorMap = new HashMap(); -+ private static final int[] textCodeColors = new int[32]; -+ private static final boolean[] textCodeColorSet = new boolean[32]; -+ private static int signTextColor; -+ public static float[] netherFogColor; -+ public static float[] endFogColor; -+ public static int endSkyColor; -+ -+ static void reset() { -+ netherFogColor = new float[] {0.2F, 0.03F, 0.03F}; -+ endFogColor = new float[] {0.075F, 0.075F, 0.094F}; -+ endSkyColor = 1579032; -+ cloudType = 0; -+ textColorMap.clear(); -+ -+ for (int i = 0; i < textCodeColorSet.length; ++i) { -+ textCodeColorSet[i] = false; -+ } -+ -+ signTextColor = 0; -+ } -+ -+ static void reloadFogColors(Properties properties) { -+ Colorizer.loadFloatColor("fog.nether", netherFogColor); -+ Colorizer.loadFloatColor("fog.end", endFogColor); -+ endSkyColor = Colorizer.loadIntColor("sky.end", endSkyColor); -+ } -+ -+ static void reloadCloudType(Properties properties) { -+ String value = properties.getProperty("clouds", "").trim().toLowerCase(); -+ -+ if (value.equals("fast")) { -+ cloudType = 1; -+ } else if (value.equals("fancy")) { -+ cloudType = 2; -+ } -+ } -+ -+ static void reloadTextColors(Properties properties) { -+ for (int i$ = 0; i$ < textCodeColors.length; ++i$) { -+ textCodeColorSet[i$] = Colorizer.loadIntColor("text.code." + i$, textCodeColors, i$); -+ -+ if (textCodeColorSet[i$] && i$ + 16 < textCodeColors.length) { -+ textCodeColors[i$ + 16] = (textCodeColors[i$] & 16579836) >> 2; -+ textCodeColorSet[i$ + 16] = true; -+ } -+ } -+ -+ Iterator var8 = properties.entrySet().iterator(); -+ -+ while (var8.hasNext()) { -+ Entry entry = (Entry)var8.next(); -+ -+ if (entry.getKey() instanceof String && entry.getValue() instanceof String) { -+ String key = (String)entry.getKey(); -+ String value = (String)entry.getValue(); -+ -+ if (key.startsWith("text.") && !key.startsWith("text.code.")) { -+ key = key.substring("text.".length()).trim(); -+ -+ try { -+ int oldColor; -+ -+ if (key.equals("xpbar")) { -+ oldColor = 8453920; -+ } else if (key.equals("boss")) { -+ oldColor = 16711935; -+ } else { -+ oldColor = Integer.parseInt(key, 16); -+ } -+ -+ int e = Integer.parseInt(value, 16); -+ textColorMap.put(Integer.valueOf(oldColor), Integer.valueOf(e)); -+ } catch (NumberFormatException var7) { -+ ; -+ } -+ } -+ } -+ } -+ -+ signTextColor = Colorizer.loadIntColor("text.sign", 0); -+ } -+ -+ public static void setupBiome(BiomeGenBase biome) { -+ biomes.add(biome); -+ } -+ -+ public static void setupForFog(Entity entity) { -+ fogCamera = entity; -+ -+ if (!biomesLogged) { -+ biomesLogged = true; -+ Iterator i$ = biomes.iterator(); -+ -+ while (i$.hasNext()) { -+ BiomeGenBase biome = (BiomeGenBase)i$.next(); -+ int x = ColorMap.getX((double)biome.temperature, (double)biome.rainfall); -+ int y = ColorMap.getY((double)biome.temperature, (double)biome.rainfall); -+ logger.finer("setupBiome #%d \"%s\" %06x (%d,%d)", new Object[] {Integer.valueOf(biome.biomeID), biome.biomeName, Integer.valueOf(biome.waterColorMultiplier), Integer.valueOf(x), Integer.valueOf(y)}); -+ } -+ } -+ } -+ -+ public static boolean computeFogColor(int index) { -+ if (index >= 0 && index < Colorizer.fixedColorMaps.length && fogCamera != null && Colorizer.fixedColorMaps[index].isCustom()) { -+ int x = (int)fogCamera.posX; -+ int y = (int)fogCamera.posY; -+ int z = (int)fogCamera.posZ; -+ Colorizer.fixedColorMaps[index].colorizeWithBlending(x, y, z, fogBlendRadius, Colorizer.setColor); -+ return true; -+ } else { -+ return false; -+ } -+ } -+ -+ public static boolean computeFogColor(World world, float f) { -+ if (world.provider.dimensionId == 0 && computeFogColor(7)) { -+ computeLightningFlash(world, f); -+ return true; -+ } else { -+ return false; -+ } -+ } -+ -+ public static boolean computeSkyColor(World world, float f) { -+ if (world.provider.dimensionId == 0 && computeFogColor(8)) { -+ computeLightningFlash(world, f); -+ return true; -+ } else { -+ return false; -+ } -+ } -+ -+ private static void computeLightningFlash(World world, float f) { -+ if (world.lastLightningBolt > 0) { -+ f = 0.45F * Colorizer.clamp((float)world.lastLightningBolt - f); -+ Colorizer.setColor[0] = Colorizer.setColor[0] * (1.0F - f) + 0.8F * f; -+ Colorizer.setColor[1] = Colorizer.setColor[1] * (1.0F - f) + 0.8F * f; -+ Colorizer.setColor[2] = Colorizer.setColor[2] * (1.0F - f) + 0.8F * f; -+ } -+ } -+ -+ public static boolean drawFancyClouds(boolean fancyGraphics) { -+ switch (cloudType) { -+ case 1: -+ return false; -+ -+ case 2: -+ return true; -+ -+ default: -+ return fancyGraphics; -+ } -+ } -+ -+ public static int colorizeText(int defaultColor) { -+ int high = defaultColor & -16777216; -+ defaultColor &= 16777215; -+ Integer newColor = (Integer)textColorMap.get(Integer.valueOf(defaultColor)); -+ return newColor == null ? high | defaultColor : high | newColor.intValue(); -+ } -+ -+ public static int colorizeText(int defaultColor, int index) { -+ return index >= 0 && index < textCodeColors.length && textCodeColorSet[index] ? defaultColor & -16777216 | textCodeColors[index] : defaultColor; -+ } -+ -+ public static int colorizeSignText() { -+ return signTextColor; -+ } -+ -+ static { -+ try { -+ reset(); -+ } catch (Throwable var1) { -+ var1.printStackTrace(); -+ } -+ } -+} ---- net/minecraft/src/GuiConnecting.java -+++ net/minecraft/src/GuiConnecting.java -@@ -1,104 +1,140 @@ - package net.minecraft.src; - -+import org.spoutcraft.client.gui.mainmenu.MainMenu; -+ - public class GuiConnecting extends GuiScreen { -+ -+ /** A reference to the NetClientHandler. */ - private NetClientHandler clientHandler; -+ -+ /** True if the connection attempt has been cancelled. */ - private boolean cancelled; - private final GuiScreen field_98098_c; - -- public GuiConnecting(GuiScreen var1, Minecraft var2, ServerData var3) { -- this.mc = var2; -- this.field_98098_c = var1; -- ServerAddress var4 = ServerAddress.func_78860_a(var3.b); -- var2.loadWorld((WorldClient)null); -- var2.setServerData(var3); -+ public GuiConnecting(Minecraft par2Minecraft, ServerData par3ServerData) { -+ this(null, par2Minecraft, par3ServerData); -+ } -+ -+ public GuiConnecting(GuiScreen par1GuiScreen, Minecraft par2Minecraft, ServerData par3ServerData) { -+ this.mc = par2Minecraft; -+ this.field_98098_c = par1GuiScreen; -+ ServerAddress var4 = ServerAddress.func_78860_a(par3ServerData.serverIP); -+ par2Minecraft.loadWorld((WorldClient)null); -+ par2Minecraft.setServerData(par3ServerData); - this.spawnNewServerThread(var4.getIP(), var4.getPort()); - } - -- public GuiConnecting(GuiScreen var1, Minecraft var2, String var3, int var4) { -- this.mc = var2; -- this.field_98098_c = var1; -- var2.loadWorld((WorldClient)null); -- this.spawnNewServerThread(var3, var4); -- } -- -- private void spawnNewServerThread(String var1, int var2) { -- this.mc.getLogAgent().logInfo("Connecting to " + var1 + ", " + var2); -- (new ThreadConnectToServer(this, var1, var2)).start(); -- } -- -+ public GuiConnecting(Minecraft par2Minecraft, String par3Str, int par4) { -+ this(null, par2Minecraft, par3Str, par4); -+ } -+ -+ public GuiConnecting(GuiScreen par1GuiScreen, Minecraft par2Minecraft, String par3Str, int par4) { -+ this.mc = par2Minecraft; -+ this.field_98098_c = par1GuiScreen; -+ par2Minecraft.loadWorld((WorldClient)null); -+ this.spawnNewServerThread(par3Str, par4); -+ } -+ -+ private void spawnNewServerThread(String par1Str, int par2) { -+ this.mc.getLogAgent().logInfo("Connecting to " + par1Str + ", " + par2); -+ (new ThreadConnectToServer(this, par1Str, par2)).start(); -+ } -+ -+ /** -+ * Called from the main game loop to update the screen. -+ */ - public void updateScreen() { -- if(this.clientHandler != null) { -+ if (this.clientHandler != null) { - this.clientHandler.processReadPackets(); - } -- -- } -- -- protected void keyTyped(char var1, int var2) { -- } -- -+ } -+ -+ /** -+ * Fired when a key is typed. This is the equivalent of KeyListener.keyTyped(KeyEvent e). -+ */ -+ protected void keyTyped(char par1, int par2) {} -+ -+ /** -+ * Adds the buttons (and other controls) to the screen in question. -+ */ - public void initGui() { -- this.i.clear(); -- this.i.add(new GuiButton(0, this.width / 2 - 100, this.height / 4 + 120 + 12, I18n.getString("gui.cancel"))); -+ this.buttonList.clear(); -+ this.buttonList.add(new GuiButton(0, this.width / 2 - 100, this.height / 4 + 120 + 12, I18n.getString("gui.cancel"))); - } - -- protected void actionPerformed(GuiButton var1) { -- if(var1.id == 0) { -+ /** -+ * Fired when a control is clicked. This is the equivalent of ActionListener.actionPerformed(ActionEvent e). -+ */ -+ protected void actionPerformed(GuiButton par1GuiButton) { -+ if (par1GuiButton.id == 0) { - this.cancelled = true; -- if(this.clientHandler != null) { -+ -+ if (this.clientHandler != null) { - this.clientHandler.disconnect(); - } - -- this.mc.displayGuiScreen(this.field_98098_c); -+ // Spout Start -+ this.mc.displayGuiScreen(new MainMenu()); -+ // Spout End - } -- - } - -- public void drawScreen(int var1, int var2, float var3) { -+ /** -+ * Draws the screen and all the components in it. -+ */ -+ public void drawScreen(int par1, int par2, float par3) { - this.drawDefaultBackground(); -- if(this.clientHandler == null) { -+ -+ if (this.clientHandler == null) { - this.drawCenteredString(this.fontRenderer, I18n.getString("connect.connecting"), this.width / 2, this.height / 2 - 50, 16777215); - this.drawCenteredString(this.fontRenderer, "", this.width / 2, this.height / 2 - 10, 16777215); - } else { - this.drawCenteredString(this.fontRenderer, I18n.getString("connect.authorizing"), this.width / 2, this.height / 2 - 50, 16777215); -- this.drawCenteredString(this.fontRenderer, this.clientHandler.a, this.width / 2, this.height / 2 - 10, 16777215); -+ this.drawCenteredString(this.fontRenderer, this.clientHandler.field_72560_a, this.width / 2, this.height / 2 - 10, 16777215); - } - -- super.drawScreen(var1, var2, var3); -- } -- -- static NetClientHandler setNetClientHandler(GuiConnecting var0, NetClientHandler var1) { -- return var0.clientHandler = var1; -- } -- -- static Minecraft func_74256_a(GuiConnecting var0) { -- return var0.mc; -- } -- -- static boolean isCancelled(GuiConnecting var0) { -- return var0.cancelled; -- } -- -- static Minecraft func_74254_c(GuiConnecting var0) { -- return var0.mc; -- } -- -- static NetClientHandler getNetClientHandler(GuiConnecting var0) { -- return var0.clientHandler; -- } -- -- static GuiScreen func_98097_e(GuiConnecting var0) { -- return var0.field_98098_c; -- } -- -- static Minecraft func_74250_f(GuiConnecting var0) { -- return var0.mc; -- } -- -- static Minecraft func_74251_g(GuiConnecting var0) { -- return var0.mc; -- } -- -- static Minecraft func_98096_h(GuiConnecting var0) { -- return var0.mc; -+ super.drawScreen(par1, par2, par3); -+ } -+ -+ /** -+ * Sets the NetClientHandler. -+ */ -+ static NetClientHandler setNetClientHandler(GuiConnecting par0GuiConnecting, NetClientHandler par1NetClientHandler) { -+ return par0GuiConnecting.clientHandler = par1NetClientHandler; -+ } -+ -+ static Minecraft func_74256_a(GuiConnecting par0GuiConnecting) { -+ return par0GuiConnecting.mc; -+ } -+ -+ static boolean isCancelled(GuiConnecting par0GuiConnecting) { -+ return par0GuiConnecting.cancelled; -+ } -+ -+ static Minecraft func_74254_c(GuiConnecting par0GuiConnecting) { -+ return par0GuiConnecting.mc; -+ } -+ -+ /** -+ * Gets the NetClientHandler. -+ */ -+ static NetClientHandler getNetClientHandler(GuiConnecting par0GuiConnecting) { -+ return par0GuiConnecting.clientHandler; -+ } -+ -+ static GuiScreen func_98097_e(GuiConnecting par0GuiConnecting) { -+ return par0GuiConnecting.field_98098_c; -+ } -+ -+ static Minecraft func_74250_f(GuiConnecting par0GuiConnecting) { -+ return par0GuiConnecting.mc; -+ } -+ -+ static Minecraft func_74251_g(GuiConnecting par0GuiConnecting) { -+ return par0GuiConnecting.mc; -+ } -+ -+ static Minecraft func_98096_h(GuiConnecting par0GuiConnecting) { -+ return par0GuiConnecting.mc; - } - } ---- net/minecraft/src/BlockEndPortal.java -+++ net/minecraft/src/BlockEndPortal.java -@@ -4,76 +4,120 @@ - import java.util.Random; - - public class BlockEndPortal extends BlockContainer { -+ -+ /** -+ * true if the enderdragon has been killed - allows end portal blocks to be created in the end -+ */ - public static boolean bossDefeated; - -- protected BlockEndPortal(int var1, Material var2) { -- super(var1, var2); -+ protected BlockEndPortal(int par1, Material par2Material) { -+ super(par1, par2Material); - this.setLightValue(1.0F); - } - -- public TileEntity createNewTileEntity(World var1) { -+ /** -+ * Returns a new instance of a block's tile entity class. Called on placing the block. -+ */ -+ public TileEntity createNewTileEntity(World par1World) { - return new TileEntityEndPortal(); - } - -- public void setBlockBoundsBasedOnState(IBlockAccess var1, int var2, int var3, int var4) { -- float var5 = 1.0F / 16.0F; -+ /** -+ * Updates the blocks bounds based on its current state. Args: world, x, y, z -+ */ -+ public void setBlockBoundsBasedOnState(IBlockAccess par1IBlockAccess, int par2, int par3, int par4) { -+ float var5 = 0.0625F; - this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, var5, 1.0F); - } - -- public boolean shouldSideBeRendered(IBlockAccess var1, int var2, int var3, int var4, int var5) { -- return var5 != 0 ? false : super.shouldSideBeRendered(var1, var2, var3, var4, var5); -- } -- -- public void addCollisionBoxesToList(World var1, int var2, int var3, int var4, AxisAlignedBB var5, List var6, Entity var7) { -- } -- -+ /** -+ * Returns true if the given side of this block type should be rendered, if the adjacent block is at the given -+ * coordinates. Args: blockAccess, x, y, z, side -+ */ -+ public boolean shouldSideBeRendered(IBlockAccess par1IBlockAccess, int par2, int par3, int par4, int par5) { -+ return par5 != 0 ? false : super.shouldSideBeRendered(par1IBlockAccess, par2, par3, par4, par5); -+ } -+ -+ /** -+ * Adds all intersecting collision boxes to a list. (Be sure to only add boxes to the list if they intersect the mask.) -+ * Parameters: World, X, Y, Z, mask, list, colliding entity -+ */ -+ public void addCollisionBoxesToList(World par1World, int par2, int par3, int par4, AxisAlignedBB par5AxisAlignedBB, List par6List, Entity par7Entity) {} -+ -+ /** -+ * Is this block (a) opaque and (b) a full 1m cube? This determines whether or not to render the shared face of two -+ * adjacent blocks and also whether the player can attach torches, redstone wire, etc to this block. -+ */ - public boolean isOpaqueCube() { - return false; - } - -+ /** -+ * If this block doesn't render as an ordinary block it will return False (examples: signs, buttons, stairs, etc) -+ */ - public boolean renderAsNormalBlock() { - return false; - } - -- public int quantityDropped(Random var1) { -+ /** -+ * Returns the quantity of items to drop on block destruction. -+ */ -+ public int quantityDropped(Random par1Random) { - return 0; - } - -- public void onEntityCollidedWithBlock(World var1, int var2, int var3, int var4, Entity var5) { -- if(var5.ridingEntity == null && var5.riddenByEntity == null && !var1.isRemote) { -- var5.travelToDimension(1); -+ /** -+ * Triggered whenever an entity collides with this block (enters into the block). Args: world, x, y, z, entity -+ */ -+ public void onEntityCollidedWithBlock(World par1World, int par2, int par3, int par4, Entity par5Entity) { -+ if (par5Entity.ridingEntity == null && par5Entity.riddenByEntity == null && !par1World.isRemote) { -+ par5Entity.travelToDimension(1); - } -- - } - -- public void randomDisplayTick(World var1, int var2, int var3, int var4, Random var5) { -- double var6 = (double)((float)var2 + var5.nextFloat()); -- double var8 = (double)((float)var3 + 0.8F); -- double var10 = (double)((float)var4 + var5.nextFloat()); -+ /** -+ * A randomly called display update to be able to add particles or other items for display -+ */ -+ public void randomDisplayTick(World par1World, int par2, int par3, int par4, Random par5Random) { -+ double var6 = (double)((float)par2 + par5Random.nextFloat()); -+ double var8 = (double)((float)par3 + 0.8F); -+ double var10 = (double)((float)par4 + par5Random.nextFloat()); - double var12 = 0.0D; - double var14 = 0.0D; - double var16 = 0.0D; -- var1.spawnParticle("smoke", var6, var8, var10, var12, var14, var16); -+ par1World.spawnParticle("smoke", var6, var8, var10, var12, var14, var16); - } - -+ /** -+ * The type of render function that is called for this block -+ */ - public int getRenderType() { - return -1; - } - -- public void onBlockAdded(World var1, int var2, int var3, int var4) { -- if(!bossDefeated) { -- if(var1.provider.dimensionId != 0) { -- var1.setBlockToAir(var2, var3, var4); -+ /** -+ * Called whenever the block is added into the world. Args: world, x, y, z -+ */ -+ public void onBlockAdded(World par1World, int par2, int par3, int par4) { -+ if (!bossDefeated) { -+ if (par1World.provider.dimensionId != 0) { -+ par1World.setBlockToAir(par2, par3, par4); - } -- - } - } - -- public int idPicked(World var1, int var2, int var3, int var4) { -+ /** -+ * only called by clickMiddleMouseButton , and passed to inventory.setCurrentItem (along with isCreative) -+ */ -+ public int idPicked(World par1World, int par2, int par3, int par4) { - return 0; - } - -- public void registerIcons(IconRegister var1) { -- this.blockIcon = var1.registerIcon("portal"); -+ /** -+ * When this method is called, your block should register all the icons it needs with the given IconRegister. This is -+ * the only chance you get to register icons. -+ */ -+ public void registerIcons(IconRegister par1IconRegister) { -+ this.blockIcon = par1IconRegister.registerIcon("portal"); - } - } ---- net/minecraft/src/CallableEntityType.java -+++ net/minecraft/src/CallableEntityType.java -@@ -5,8 +5,8 @@ - class CallableEntityType implements Callable { - final Entity theEntity; - -- CallableEntityType(Entity var1) { -- this.theEntity = var1; -+ CallableEntityType(Entity par1Entity) { -+ this.theEntity = par1Entity; - } - - public String callEntityType() { ---- net/minecraft/src/BlockSkull.java -+++ net/minecraft/src/BlockSkull.java -@@ -3,201 +3,263 @@ - import java.util.Random; - - public class BlockSkull extends BlockContainer { -- protected BlockSkull(int var1) { -- super(var1, Material.circuits); -- this.setBlockBounds(0.25F, 0.0F, 0.25F, 12.0F / 16.0F, 0.5F, 12.0F / 16.0F); -+ protected BlockSkull(int par1) { -+ super(par1, Material.circuits); -+ this.setBlockBounds(0.25F, 0.0F, 0.25F, 0.75F, 0.5F, 0.75F); - } - -+ /** -+ * The type of render function that is called for this block -+ */ - public int getRenderType() { - return -1; - } - -+ /** -+ * Is this block (a) opaque and (b) a full 1m cube? This determines whether or not to render the shared face of two -+ * adjacent blocks and also whether the player can attach torches, redstone wire, etc to this block. -+ */ - public boolean isOpaqueCube() { - return false; - } - -+ /** -+ * If this block doesn't render as an ordinary block it will return False (examples: signs, buttons, stairs, etc) -+ */ - public boolean renderAsNormalBlock() { - return false; - } - -- public void setBlockBoundsBasedOnState(IBlockAccess var1, int var2, int var3, int var4) { -- int var5 = var1.getBlockMetadata(var2, var3, var4) & 7; -- switch(var5) { -- case 1: -- default: -- this.setBlockBounds(0.25F, 0.0F, 0.25F, 12.0F / 16.0F, 0.5F, 12.0F / 16.0F); -- break; -- case 2: -- this.setBlockBounds(0.25F, 0.25F, 0.5F, 12.0F / 16.0F, 12.0F / 16.0F, 1.0F); -- break; -- case 3: -- this.setBlockBounds(0.25F, 0.25F, 0.0F, 12.0F / 16.0F, 12.0F / 16.0F, 0.5F); -- break; -- case 4: -- this.setBlockBounds(0.5F, 0.25F, 0.25F, 1.0F, 12.0F / 16.0F, 12.0F / 16.0F); -- break; -- case 5: -- this.setBlockBounds(0.0F, 0.25F, 0.25F, 0.5F, 12.0F / 16.0F, 12.0F / 16.0F); -+ /** -+ * Updates the blocks bounds based on its current state. Args: world, x, y, z -+ */ -+ public void setBlockBoundsBasedOnState(IBlockAccess par1IBlockAccess, int par2, int par3, int par4) { -+ int var5 = par1IBlockAccess.getBlockMetadata(par2, par3, par4) & 7; -+ -+ switch (var5) { -+ case 1: -+ default: -+ this.setBlockBounds(0.25F, 0.0F, 0.25F, 0.75F, 0.5F, 0.75F); -+ break; -+ -+ case 2: -+ this.setBlockBounds(0.25F, 0.25F, 0.5F, 0.75F, 0.75F, 1.0F); -+ break; -+ -+ case 3: -+ this.setBlockBounds(0.25F, 0.25F, 0.0F, 0.75F, 0.75F, 0.5F); -+ break; -+ -+ case 4: -+ this.setBlockBounds(0.5F, 0.25F, 0.25F, 1.0F, 0.75F, 0.75F); -+ break; -+ -+ case 5: -+ this.setBlockBounds(0.0F, 0.25F, 0.25F, 0.5F, 0.75F, 0.75F); - } -- -- } -- -- public AxisAlignedBB getCollisionBoundingBoxFromPool(World var1, int var2, int var3, int var4) { -- this.setBlockBoundsBasedOnState(var1, var2, var3, var4); -- return super.getCollisionBoundingBoxFromPool(var1, var2, var3, var4); -- } -- -- public void onBlockPlacedBy(World var1, int var2, int var3, int var4, EntityLivingBase var5, ItemStack var6) { -- int var7 = MathHelper.floor_double((double)(var5.rotationYaw * 4.0F / 360.0F) + 2.5D) & 3; -- var1.setBlockMetadata(var2, var3, var4, var7, 2); -- } -- -- public TileEntity createNewTileEntity(World var1) { -+ } -+ -+ /** -+ * Returns a bounding box from the pool of bounding boxes (this means this box can change after the pool has been -+ * cleared to be reused) -+ */ -+ public AxisAlignedBB getCollisionBoundingBoxFromPool(World par1World, int par2, int par3, int par4) { -+ this.setBlockBoundsBasedOnState(par1World, par2, par3, par4); -+ return super.getCollisionBoundingBoxFromPool(par1World, par2, par3, par4); -+ } -+ -+ /** -+ * Called when the block is placed in the world. -+ */ -+ public void onBlockPlacedBy(World par1World, int par2, int par3, int par4, EntityLivingBase par5EntityLivingBase, ItemStack par6ItemStack) { -+ int var7 = MathHelper.floor_double((double)(par5EntityLivingBase.rotationYaw * 4.0F / 360.0F) + 2.5D) & 3; -+ par1World.setBlockMetadataWithNotify(par2, par3, par4, var7, 2); -+ } -+ -+ /** -+ * Returns a new instance of a block's tile entity class. Called on placing the block. -+ */ -+ public TileEntity createNewTileEntity(World par1World) { - return new TileEntitySkull(); - } - -- public int idPicked(World var1, int var2, int var3, int var4) { -+ /** -+ * only called by clickMiddleMouseButton , and passed to inventory.setCurrentItem (along with isCreative) -+ */ -+ public int idPicked(World par1World, int par2, int par3, int par4) { - return Item.skull.itemID; - } - -- public int getDamageValue(World var1, int var2, int var3, int var4) { -- TileEntity var5 = var1.getBlockTileEntity(var2, var3, var4); -- return var5 != null && var5 instanceof TileEntitySkull ? ((TileEntitySkull)var5).getSkullType() : super.getDamageValue(var1, var2, var3, var4); -- } -- -- public int damageDropped(int var1) { -- return var1; -- } -- -- public void dropBlockAsItemWithChance(World var1, int var2, int var3, int var4, int var5, float var6, int var7) { -- } -- -- public void onBlockHarvested(World var1, int var2, int var3, int var4, int var5, EntityPlayer var6) { -- if(var6.capabilities.isCreativeMode) { -- var5 |= 8; -- var1.setBlockMetadata(var2, var3, var4, var5, 4); -+ /** -+ * Get the block's damage value (for use with pick block). -+ */ -+ public int getDamageValue(World par1World, int par2, int par3, int par4) { -+ TileEntity var5 = par1World.getBlockTileEntity(par2, par3, par4); -+ return var5 != null && var5 instanceof TileEntitySkull ? ((TileEntitySkull)var5).getSkullType() : super.getDamageValue(par1World, par2, par3, par4); -+ } -+ -+ /** -+ * Determines the damage on the item the block drops. Used in cloth and wood. -+ */ -+ public int damageDropped(int par1) { -+ return par1; -+ } -+ -+ /** -+ * Drops the block items with a specified chance of dropping the specified items -+ */ -+ public void dropBlockAsItemWithChance(World par1World, int par2, int par3, int par4, int par5, float par6, int par7) {} -+ -+ /** -+ * Called when the block is attempted to be harvested -+ */ -+ public void onBlockHarvested(World par1World, int par2, int par3, int par4, int par5, EntityPlayer par6EntityPlayer) { -+ if (par6EntityPlayer.capabilities.isCreativeMode) { -+ par5 |= 8; -+ par1World.setBlockMetadataWithNotify(par2, par3, par4, par5, 4); - } - -- super.onBlockHarvested(var1, var2, var3, var4, var5, var6); -+ super.onBlockHarvested(par1World, par2, par3, par4, par5, par6EntityPlayer); - } - -- public void breakBlock(World var1, int var2, int var3, int var4, int var5, int var6) { -- if(!var1.isRemote) { -- if((var6 & 8) == 0) { -- ItemStack var7 = new ItemStack(Item.skull.itemID, 1, this.getDamageValue(var1, var2, var3, var4)); -- TileEntitySkull var8 = (TileEntitySkull)var1.getBlockTileEntity(var2, var3, var4); -- if(var8.getSkullType() == 3 && var8.getExtraType() != null && var8.getExtraType().length() > 0) { -+ /** -+ * Called on server worlds only when the block has been replaced by a different block ID, or the same block with a -+ * different metadata value, but before the new metadata value is set. Args: World, x, y, z, old block ID, old metadata -+ */ -+ public void breakBlock(World par1World, int par2, int par3, int par4, int par5, int par6) { -+ if (!par1World.isRemote) { -+ if ((par6 & 8) == 0) { -+ ItemStack var7 = new ItemStack(Item.skull.itemID, 1, this.getDamageValue(par1World, par2, par3, par4)); -+ TileEntitySkull var8 = (TileEntitySkull)par1World.getBlockTileEntity(par2, par3, par4); -+ -+ if (var8.getSkullType() == 3 && var8.getExtraType() != null && var8.getExtraType().length() > 0) { - var7.setTagCompound(new NBTTagCompound()); - var7.getTagCompound().setString("SkullOwner", var8.getExtraType()); - } - -- this.dropBlockAsItem_do(var1, var2, var3, var4, var7); -+ this.dropBlockAsItem_do(par1World, par2, par3, par4, var7); - } - -- super.breakBlock(var1, var2, var3, var4, var5, var6); -+ super.breakBlock(par1World, par2, par3, par4, par5, par6); - } - } - -- public int idDropped(int var1, Random var2, int var3) { -+ /** -+ * Returns the ID of the items to drop on destruction. -+ */ -+ public int idDropped(int par1, Random par2Random, int par3) { - return Item.skull.itemID; - } - -- public void makeWither(World var1, int var2, int var3, int var4, TileEntitySkull var5) { -- if(var5.getSkullType() == 1 && var3 >= 2 && var1.difficultySetting > 0 && !var1.isRemote) { -+ /** -+ * This method attempts to create a wither at the given location and skull -+ */ -+ public void makeWither(World par1World, int par2, int par3, int par4, TileEntitySkull par5TileEntitySkull) { -+ if (par5TileEntitySkull.getSkullType() == 1 && par3 >= 2 && par1World.difficultySetting > 0 && !par1World.isRemote) { - int var6 = Block.slowSand.blockID; -- - int var7; - EntityWither var8; - int var9; -- for(var7 = -2; var7 <= 0; ++var7) { -- if(var1.getBlockId(var2, var3 - 1, var4 + var7) == var6 && var1.getBlockId(var2, var3 - 1, var4 + var7 + 1) == var6 && var1.getBlockId(var2, var3 - 2, var4 + var7 + 1) == var6 && var1.getBlockId(var2, var3 - 1, var4 + var7 + 2) == var6 && this.func_82528_d(var1, var2, var3, var4 + var7, 1) && this.func_82528_d(var1, var2, var3, var4 + var7 + 1, 1) && this.func_82528_d(var1, var2, var3, var4 + var7 + 2, 1)) { -- var1.setBlockMetadata(var2, var3, var4 + var7, 8, 2); -- var1.setBlockMetadata(var2, var3, var4 + var7 + 1, 8, 2); -- var1.setBlockMetadata(var2, var3, var4 + var7 + 2, 8, 2); -- var1.setBlock(var2, var3, var4 + var7, 0, 0, 2); -- var1.setBlock(var2, var3, var4 + var7 + 1, 0, 0, 2); -- var1.setBlock(var2, var3, var4 + var7 + 2, 0, 0, 2); -- var1.setBlock(var2, var3 - 1, var4 + var7, 0, 0, 2); -- var1.setBlock(var2, var3 - 1, var4 + var7 + 1, 0, 0, 2); -- var1.setBlock(var2, var3 - 1, var4 + var7 + 2, 0, 0, 2); -- var1.setBlock(var2, var3 - 2, var4 + var7 + 1, 0, 0, 2); -- if(!var1.isRemote) { -- var8 = new EntityWither(var1); -- var8.setLocationAndAngles((double)var2 + 0.5D, (double)var3 - 1.45D, (double)(var4 + var7) + 1.5D, 90.0F, 0.0F); -+ -+ for (var7 = -2; var7 <= 0; ++var7) { -+ if (par1World.getBlockId(par2, par3 - 1, par4 + var7) == var6 && par1World.getBlockId(par2, par3 - 1, par4 + var7 + 1) == var6 && par1World.getBlockId(par2, par3 - 2, par4 + var7 + 1) == var6 && par1World.getBlockId(par2, par3 - 1, par4 + var7 + 2) == var6 && this.func_82528_d(par1World, par2, par3, par4 + var7, 1) && this.func_82528_d(par1World, par2, par3, par4 + var7 + 1, 1) && this.func_82528_d(par1World, par2, par3, par4 + var7 + 2, 1)) { -+ par1World.setBlockMetadataWithNotify(par2, par3, par4 + var7, 8, 2); -+ par1World.setBlockMetadataWithNotify(par2, par3, par4 + var7 + 1, 8, 2); -+ par1World.setBlockMetadataWithNotify(par2, par3, par4 + var7 + 2, 8, 2); -+ par1World.setBlock(par2, par3, par4 + var7, 0, 0, 2); -+ par1World.setBlock(par2, par3, par4 + var7 + 1, 0, 0, 2); -+ par1World.setBlock(par2, par3, par4 + var7 + 2, 0, 0, 2); -+ par1World.setBlock(par2, par3 - 1, par4 + var7, 0, 0, 2); -+ par1World.setBlock(par2, par3 - 1, par4 + var7 + 1, 0, 0, 2); -+ par1World.setBlock(par2, par3 - 1, par4 + var7 + 2, 0, 0, 2); -+ par1World.setBlock(par2, par3 - 2, par4 + var7 + 1, 0, 0, 2); -+ -+ if (!par1World.isRemote) { -+ var8 = new EntityWither(par1World); -+ var8.setLocationAndAngles((double)par2 + 0.5D, (double)par3 - 1.45D, (double)(par4 + var7) + 1.5D, 90.0F, 0.0F); - var8.renderYawOffset = 90.0F; - var8.func_82206_m(); -- var1.spawnEntityInWorld(var8); -- } -- -- for(var9 = 0; var9 < 120; ++var9) { -- var1.spawnParticle("snowballpoof", (double)var2 + var1.s.nextDouble(), (double)(var3 - 2) + var1.s.nextDouble() * 3.9D, (double)(var4 + var7 + 1) + var1.s.nextDouble(), 0.0D, 0.0D, 0.0D); -- } -- -- var1.notifyBlockChange(var2, var3, var4 + var7, 0); -- var1.notifyBlockChange(var2, var3, var4 + var7 + 1, 0); -- var1.notifyBlockChange(var2, var3, var4 + var7 + 2, 0); -- var1.notifyBlockChange(var2, var3 - 1, var4 + var7, 0); -- var1.notifyBlockChange(var2, var3 - 1, var4 + var7 + 1, 0); -- var1.notifyBlockChange(var2, var3 - 1, var4 + var7 + 2, 0); -- var1.notifyBlockChange(var2, var3 - 2, var4 + var7 + 1, 0); -+ par1World.spawnEntityInWorld(var8); -+ } -+ -+ for (var9 = 0; var9 < 120; ++var9) { -+ par1World.spawnParticle("snowballpoof", (double)par2 + par1World.rand.nextDouble(), (double)(par3 - 2) + par1World.rand.nextDouble() * 3.9D, (double)(par4 + var7 + 1) + par1World.rand.nextDouble(), 0.0D, 0.0D, 0.0D); -+ } -+ -+ par1World.notifyBlockChange(par2, par3, par4 + var7, 0); -+ par1World.notifyBlockChange(par2, par3, par4 + var7 + 1, 0); -+ par1World.notifyBlockChange(par2, par3, par4 + var7 + 2, 0); -+ par1World.notifyBlockChange(par2, par3 - 1, par4 + var7, 0); -+ par1World.notifyBlockChange(par2, par3 - 1, par4 + var7 + 1, 0); -+ par1World.notifyBlockChange(par2, par3 - 1, par4 + var7 + 2, 0); -+ par1World.notifyBlockChange(par2, par3 - 2, par4 + var7 + 1, 0); - return; - } - } - -- for(var7 = -2; var7 <= 0; ++var7) { -- if(var1.getBlockId(var2 + var7, var3 - 1, var4) == var6 && var1.getBlockId(var2 + var7 + 1, var3 - 1, var4) == var6 && var1.getBlockId(var2 + var7 + 1, var3 - 2, var4) == var6 && var1.getBlockId(var2 + var7 + 2, var3 - 1, var4) == var6 && this.func_82528_d(var1, var2 + var7, var3, var4, 1) && this.func_82528_d(var1, var2 + var7 + 1, var3, var4, 1) && this.func_82528_d(var1, var2 + var7 + 2, var3, var4, 1)) { -- var1.setBlockMetadata(var2 + var7, var3, var4, 8, 2); -- var1.setBlockMetadata(var2 + var7 + 1, var3, var4, 8, 2); -- var1.setBlockMetadata(var2 + var7 + 2, var3, var4, 8, 2); -- var1.setBlock(var2 + var7, var3, var4, 0, 0, 2); -- var1.setBlock(var2 + var7 + 1, var3, var4, 0, 0, 2); -- var1.setBlock(var2 + var7 + 2, var3, var4, 0, 0, 2); -- var1.setBlock(var2 + var7, var3 - 1, var4, 0, 0, 2); -- var1.setBlock(var2 + var7 + 1, var3 - 1, var4, 0, 0, 2); -- var1.setBlock(var2 + var7 + 2, var3 - 1, var4, 0, 0, 2); -- var1.setBlock(var2 + var7 + 1, var3 - 2, var4, 0, 0, 2); -- if(!var1.isRemote) { -- var8 = new EntityWither(var1); -- var8.setLocationAndAngles((double)(var2 + var7) + 1.5D, (double)var3 - 1.45D, (double)var4 + 0.5D, 0.0F, 0.0F); -+ for (var7 = -2; var7 <= 0; ++var7) { -+ if (par1World.getBlockId(par2 + var7, par3 - 1, par4) == var6 && par1World.getBlockId(par2 + var7 + 1, par3 - 1, par4) == var6 && par1World.getBlockId(par2 + var7 + 1, par3 - 2, par4) == var6 && par1World.getBlockId(par2 + var7 + 2, par3 - 1, par4) == var6 && this.func_82528_d(par1World, par2 + var7, par3, par4, 1) && this.func_82528_d(par1World, par2 + var7 + 1, par3, par4, 1) && this.func_82528_d(par1World, par2 + var7 + 2, par3, par4, 1)) { -+ par1World.setBlockMetadataWithNotify(par2 + var7, par3, par4, 8, 2); -+ par1World.setBlockMetadataWithNotify(par2 + var7 + 1, par3, par4, 8, 2); -+ par1World.setBlockMetadataWithNotify(par2 + var7 + 2, par3, par4, 8, 2); -+ par1World.setBlock(par2 + var7, par3, par4, 0, 0, 2); -+ par1World.setBlock(par2 + var7 + 1, par3, par4, 0, 0, 2); -+ par1World.setBlock(par2 + var7 + 2, par3, par4, 0, 0, 2); -+ par1World.setBlock(par2 + var7, par3 - 1, par4, 0, 0, 2); -+ par1World.setBlock(par2 + var7 + 1, par3 - 1, par4, 0, 0, 2); -+ par1World.setBlock(par2 + var7 + 2, par3 - 1, par4, 0, 0, 2); -+ par1World.setBlock(par2 + var7 + 1, par3 - 2, par4, 0, 0, 2); -+ -+ if (!par1World.isRemote) { -+ var8 = new EntityWither(par1World); -+ var8.setLocationAndAngles((double)(par2 + var7) + 1.5D, (double)par3 - 1.45D, (double)par4 + 0.5D, 0.0F, 0.0F); - var8.func_82206_m(); -- var1.spawnEntityInWorld(var8); -- } -- -- for(var9 = 0; var9 < 120; ++var9) { -- var1.spawnParticle("snowballpoof", (double)(var2 + var7 + 1) + var1.s.nextDouble(), (double)(var3 - 2) + var1.s.nextDouble() * 3.9D, (double)var4 + var1.s.nextDouble(), 0.0D, 0.0D, 0.0D); -- } -- -- var1.notifyBlockChange(var2 + var7, var3, var4, 0); -- var1.notifyBlockChange(var2 + var7 + 1, var3, var4, 0); -- var1.notifyBlockChange(var2 + var7 + 2, var3, var4, 0); -- var1.notifyBlockChange(var2 + var7, var3 - 1, var4, 0); -- var1.notifyBlockChange(var2 + var7 + 1, var3 - 1, var4, 0); -- var1.notifyBlockChange(var2 + var7 + 2, var3 - 1, var4, 0); -- var1.notifyBlockChange(var2 + var7 + 1, var3 - 2, var4, 0); -+ par1World.spawnEntityInWorld(var8); -+ } -+ -+ for (var9 = 0; var9 < 120; ++var9) { -+ par1World.spawnParticle("snowballpoof", (double)(par2 + var7 + 1) + par1World.rand.nextDouble(), (double)(par3 - 2) + par1World.rand.nextDouble() * 3.9D, (double)par4 + par1World.rand.nextDouble(), 0.0D, 0.0D, 0.0D); -+ } -+ -+ par1World.notifyBlockChange(par2 + var7, par3, par4, 0); -+ par1World.notifyBlockChange(par2 + var7 + 1, par3, par4, 0); -+ par1World.notifyBlockChange(par2 + var7 + 2, par3, par4, 0); -+ par1World.notifyBlockChange(par2 + var7, par3 - 1, par4, 0); -+ par1World.notifyBlockChange(par2 + var7 + 1, par3 - 1, par4, 0); -+ par1World.notifyBlockChange(par2 + var7 + 2, par3 - 1, par4, 0); -+ par1World.notifyBlockChange(par2 + var7 + 1, par3 - 2, par4, 0); - return; - } - } - } -- - } - -- private boolean func_82528_d(World var1, int var2, int var3, int var4, int var5) { -- if(var1.getBlockId(var2, var3, var4) != this.blockID) { -+ private boolean func_82528_d(World par1World, int par2, int par3, int par4, int par5) { -+ if (par1World.getBlockId(par2, par3, par4) != this.blockID) { - return false; - } else { -- TileEntity var6 = var1.getBlockTileEntity(var2, var3, var4); -- return var6 != null && var6 instanceof TileEntitySkull ? ((TileEntitySkull)var6).getSkullType() == var5 : false; -+ TileEntity var6 = par1World.getBlockTileEntity(par2, par3, par4); -+ return var6 != null && var6 instanceof TileEntitySkull ? ((TileEntitySkull)var6).getSkullType() == par5 : false; - } - } - -- public void registerIcons(IconRegister var1) { -- } -- -- public Icon getIcon(int var1, int var2) { -- return Block.slowSand.getBlockTextureFromSide(var1); -- } -- -+ /** -+ * When this method is called, your block should register all the icons it needs with the given IconRegister. This is -+ * the only chance you get to register icons. -+ */ -+ public void registerIcons(IconRegister par1IconRegister) {} -+ -+ /** -+ * From the specified side and block metadata retrieves the blocks texture. Args: side, metadata -+ */ -+ public Icon getIcon(int par1, int par2) { -+ return Block.slowSand.getBlockTextureFromSide(par1); -+ } -+ -+ /** -+ * Gets the icon name of the ItemBlock corresponding to this block. Used by hoppers. -+ */ - public String getItemIconName() { -- return this.getTextureName() + "_" + ItemSkull.a[0]; -+ return this.getTextureName() + "_" + ItemSkull.field_94587_a[0]; - } - } ---- /dev/null -+++ com/prupe/mcpatcher/hd/CustomAnimation$1.java -@@ -1,0 +1,48 @@ -+package com.prupe.mcpatcher.hd; -+ -+import com.prupe.mcpatcher.TexturePackAPI; -+import com.prupe.mcpatcher.TexturePackChangeHandler; -+import java.util.Iterator; -+import java.util.Properties; -+import net.minecraft.src.ResourceLocation; -+ -+final class CustomAnimation$1 extends TexturePackChangeHandler { -+ CustomAnimation$1(String x0, int x1) { -+ super(x0, x1); -+ } -+ -+ public void beforeChange() { -+ if (!CustomAnimation.access$000().isEmpty()) { -+ CustomAnimation.access$100().fine("%d animations were never registered:", new Object[] {Integer.valueOf(CustomAnimation.access$000().size())}); -+ Iterator i$ = CustomAnimation.access$000().keySet().iterator(); -+ -+ while (i$.hasNext()) { -+ ResourceLocation resource = (ResourceLocation)i$.next(); -+ CustomAnimation.access$100().fine(" %s", new Object[] {resource}); -+ } -+ -+ CustomAnimation.access$000().clear(); -+ } -+ -+ CustomAnimation.access$200().clear(); -+ MipmapHelper.reset(); -+ FancyDial.clearAll(); -+ } -+ -+ public void afterChange() { -+ if (CustomAnimation.access$300()) { -+ Iterator i$ = TexturePackAPI.listResources("mcpatcher/anim", ".properties", true, false, false).iterator(); -+ -+ while (i$.hasNext()) { -+ ResourceLocation resource = (ResourceLocation)i$.next(); -+ Properties properties = TexturePackAPI.getProperties(resource); -+ -+ if (properties != null) { -+ CustomAnimation.access$000().put(resource, properties); -+ } -+ } -+ } -+ -+ FancyDial.registerAnimations(); -+ } -+} ---- /dev/null -+++ com/prupe/mcpatcher/ctm/TileOverrideImpl$CTM.java -@@ -1,0 +1,45 @@ -+package com.prupe.mcpatcher.ctm; -+ -+import com.prupe.mcpatcher.TileLoader; -+import java.util.Properties; -+import net.minecraft.src.Block; -+import net.minecraft.src.IBlockAccess; -+import net.minecraft.src.Icon; -+import net.minecraft.src.ResourceLocation; -+ -+final class TileOverrideImpl$CTM extends TileOverride { -+ private static final int[] neighborMap = new int[] {0, 3, 0, 3, 12, 5, 12, 15, 0, 3, 0, 3, 12, 5, 12, 15, 1, 2, 1, 2, 4, 7, 4, 29, 1, 2, 1, 2, 13, 31, 13, 14, 0, 3, 0, 3, 12, 5, 12, 15, 0, 3, 0, 3, 12, 5, 12, 15, 1, 2, 1, 2, 4, 7, 4, 29, 1, 2, 1, 2, 13, 31, 13, 14, 36, 17, 36, 17, 24, 19, 24, 43, 36, 17, 36, 17, 24, 19, 24, 43, 16, 18, 16, 18, 6, 46, 6, 21, 16, 18, 16, 18, 28, 9, 28, 22, 36, 17, 36, 17, 24, 19, 24, 43, 36, 17, 36, 17, 24, 19, 24, 43, 37, 40, 37, 40, 30, 8, 30, 34, 37, 40, 37, 40, 25, 23, 25, 45, 0, 3, 0, 3, 12, 5, 12, 15, 0, 3, 0, 3, 12, 5, 12, 15, 1, 2, 1, 2, 4, 7, 4, 29, 1, 2, 1, 2, 13, 31, 13, 14, 0, 3, 0, 3, 12, 5, 12, 15, 0, 3, 0, 3, 12, 5, 12, 15, 1, 2, 1, 2, 4, 7, 4, 29, 1, 2, 1, 2, 13, 31, 13, 14, 36, 39, 36, 39, 24, 41, 24, 27, 36, 39, 36, 39, 24, 41, 24, 27, 16, 42, 16, 42, 6, 20, 6, 10, 16, 42, 16, 42, 28, 35, 28, 44, 36, 39, 36, 39, 24, 41, 24, 27, 36, 39, 36, 39, 24, 41, 24, 27, 37, 38, 37, 38, 30, 11, 30, 32, 37, 38, 37, 38, 25, 33, 25, 26}; -+ -+ TileOverrideImpl$CTM(ResourceLocation filePrefix, Properties properties, TileLoader tileLoader) { -+ super(filePrefix, properties, tileLoader); -+ } -+ -+ String getMethod() { -+ return "ctm"; -+ } -+ -+ String checkTileMap() { -+ return this.getNumberOfTiles() >= 47 ? null : "requires at least 47 tiles"; -+ } -+ -+ boolean requiresFace() { -+ return true; -+ } -+ -+ Icon getTileImpl(IBlockAccess blockAccess, Block block, Icon origIcon, int i, int j, int k, int face) { -+ int[][] offsets = NEIGHBOR_OFFSET[face]; -+ int neighborBits = 0; -+ -+ for (int bit = 0; bit < 8; ++bit) { -+ if (this.shouldConnect(blockAccess, block, origIcon, i, j, k, face, offsets[bit])) { -+ neighborBits |= 1 << bit; -+ } -+ } -+ -+ return this.icons[neighborMap[neighborBits]]; -+ } -+ -+ Icon getTileImpl(Block block, Icon origIcon, int face, int metadata) { -+ return this.icons[0]; -+ } -+} ---- /dev/null -+++ com/prupe/mcpatcher/ctm/TileOverrideImpl$Random1.java -@@ -1,0 +1,51 @@ -+package com.prupe.mcpatcher.ctm; -+ -+import com.prupe.mcpatcher.TileLoader; -+import com.prupe.mcpatcher.WeightedIndex; -+import java.util.Properties; -+import net.minecraft.src.Block; -+import net.minecraft.src.IBlockAccess; -+import net.minecraft.src.Icon; -+import net.minecraft.src.ResourceLocation; -+ -+final class TileOverrideImpl$Random1 extends TileOverride { -+ private final int symmetry; -+ private final WeightedIndex chooser; -+ -+ TileOverrideImpl$Random1(ResourceLocation filePrefix, Properties properties, TileLoader tileLoader) { -+ super(filePrefix, properties, tileLoader); -+ String sym = properties.getProperty("symmetry", "none"); -+ -+ if (sym.equals("all")) { -+ this.symmetry = 6; -+ } else if (sym.equals("opposite")) { -+ this.symmetry = 2; -+ } else { -+ this.symmetry = 1; -+ } -+ -+ this.chooser = WeightedIndex.create(this.getNumberOfTiles(), properties.getProperty("weights", "")); -+ -+ if (this.chooser == null) { -+ this.error("invalid weights", new Object[0]); -+ } -+ } -+ -+ String getMethod() { -+ return "random"; -+ } -+ -+ Icon getTileImpl(IBlockAccess blockAccess, Block block, Icon origIcon, int i, int j, int k, int face) { -+ if (face < 0) { -+ face = 0; -+ } -+ -+ long hash = WeightedIndex.hash128To64(i, j, k, this.reorient(face) / this.symmetry); -+ int index = this.chooser.choose(hash); -+ return this.icons[index]; -+ } -+ -+ Icon getTileImpl(Block block, Icon origIcon, int face, int metadata) { -+ return this.icons[0]; -+ } -+} ---- net/minecraft/src/CommandSetSpawnpoint.java -+++ net/minecraft/src/CommandSetSpawnpoint.java -@@ -8,44 +8,53 @@ - return "spawnpoint"; - } - -+ /** -+ * Return the required permission level for this command. -+ */ - public int getRequiredPermissionLevel() { - return 2; - } - -- public String getCommandUsage(ICommandSender var1) { -+ public String getCommandUsage(ICommandSender par1ICommandSender) { - return "commands.spawnpoint.usage"; - } - -- public void processCommand(ICommandSender var1, String[] var2) { -- EntityPlayerMP var3 = var2.length == 0 ? getCommandSenderAsPlayer(var1) : getPlayer(var1, var2[0]); -- if(var2.length == 4) { -- if(var3.worldObj != null) { -+ public void processCommand(ICommandSender par1ICommandSender, String[] par2ArrayOfStr) { -+ EntityPlayerMP var3 = par2ArrayOfStr.length == 0 ? getCommandSenderAsPlayer(par1ICommandSender) : getPlayer(par1ICommandSender, par2ArrayOfStr[0]); -+ -+ if (par2ArrayOfStr.length == 4) { -+ if (var3.worldObj != null) { - byte var4 = 1; - int var5 = 30000000; - int var9 = var4 + 1; -- int var6 = parseIntBounded(var1, var2[var4], -var5, var5); -- int var7 = parseIntBounded(var1, var2[var9++], 0, 256); -- int var8 = parseIntBounded(var1, var2[var9++], -var5, var5); -+ int var6 = parseIntBounded(par1ICommandSender, par2ArrayOfStr[var4], -var5, var5); -+ int var7 = parseIntBounded(par1ICommandSender, par2ArrayOfStr[var9++], 0, 256); -+ int var8 = parseIntBounded(par1ICommandSender, par2ArrayOfStr[var9++], -var5, var5); - var3.setSpawnChunk(new ChunkCoordinates(var6, var7, var8), true); -- notifyAdmins(var1, "commands.spawnpoint.success", new Object[]{var3.getEntityName(), Integer.valueOf(var6), Integer.valueOf(var7), Integer.valueOf(var8)}); -+ notifyAdmins(par1ICommandSender, "commands.spawnpoint.success", new Object[] {var3.getEntityName(), Integer.valueOf(var6), Integer.valueOf(var7), Integer.valueOf(var8)}); - } - } else { -- if(var2.length > 1) { -+ if (par2ArrayOfStr.length > 1) { - throw new WrongUsageException("commands.spawnpoint.usage", new Object[0]); - } - -- ChunkCoordinates var10 = var3.getCommandSenderPosition(); -+ ChunkCoordinates var10 = var3.getPlayerCoordinates(); - var3.setSpawnChunk(var10, true); -- notifyAdmins(var1, "commands.spawnpoint.success", new Object[]{var3.getEntityName(), Integer.valueOf(var10.posX), Integer.valueOf(var10.posY), Integer.valueOf(var10.posZ)}); -+ notifyAdmins(par1ICommandSender, "commands.spawnpoint.success", new Object[] {var3.getEntityName(), Integer.valueOf(var10.posX), Integer.valueOf(var10.posY), Integer.valueOf(var10.posZ)}); - } -- -- } -- -- public List addTabCompletionOptions(ICommandSender var1, String[] var2) { -- return var2.length != 1 && var2.length != 2 ? null : getListOfStringsMatchingLastWord(var2, MinecraftServer.getServer().getAllUsernames()); -- } -- -- public boolean isUsernameIndex(String[] var1, int var2) { -- return var2 == 0; -+ } -+ -+ /** -+ * Adds the strings available in this command to the given list of tab completion options. -+ */ -+ public List addTabCompletionOptions(ICommandSender par1ICommandSender, String[] par2ArrayOfStr) { -+ return par2ArrayOfStr.length != 1 && par2ArrayOfStr.length != 2 ? null : getListOfStringsMatchingLastWord(par2ArrayOfStr, MinecraftServer.getServer().getAllUsernames()); -+ } -+ -+ /** -+ * Return whether the specified command parameter index is a username parameter. -+ */ -+ public boolean isUsernameIndex(String[] par1ArrayOfStr, int par2) { -+ return par2 == 0; - } - } ---- net/minecraft/src/ContainerMerchant.java -+++ net/minecraft/src/ContainerMerchant.java -@@ -1,114 +1,138 @@ - package net.minecraft.src; - - public class ContainerMerchant extends Container { -+ -+ /** Instance of Merchant. */ - private IMerchant theMerchant; - private InventoryMerchant merchantInventory; -+ -+ /** Instance of World. */ - private final World theWorld; - -- public ContainerMerchant(InventoryPlayer var1, IMerchant var2, World var3) { -- this.theMerchant = var2; -- this.theWorld = var3; -- this.merchantInventory = new InventoryMerchant(var1.player, var2); -+ public ContainerMerchant(InventoryPlayer par1InventoryPlayer, IMerchant par2IMerchant, World par3World) { -+ this.theMerchant = par2IMerchant; -+ this.theWorld = par3World; -+ this.merchantInventory = new InventoryMerchant(par1InventoryPlayer.player, par2IMerchant); - this.addSlotToContainer(new Slot(this.merchantInventory, 0, 36, 53)); - this.addSlotToContainer(new Slot(this.merchantInventory, 1, 62, 53)); -- this.addSlotToContainer(new SlotMerchantResult(var1.player, var2, this.merchantInventory, 2, 120, 53)); -- -+ this.addSlotToContainer(new SlotMerchantResult(par1InventoryPlayer.player, par2IMerchant, this.merchantInventory, 2, 120, 53)); - int var4; -- for(var4 = 0; var4 < 3; ++var4) { -- for(int var5 = 0; var5 < 9; ++var5) { -- this.addSlotToContainer(new Slot(var1, var5 + var4 * 9 + 9, 8 + var5 * 18, 84 + var4 * 18)); -+ -+ for (var4 = 0; var4 < 3; ++var4) { -+ for (int var5 = 0; var5 < 9; ++var5) { -+ this.addSlotToContainer(new Slot(par1InventoryPlayer, var5 + var4 * 9 + 9, 8 + var5 * 18, 84 + var4 * 18)); - } - } - -- for(var4 = 0; var4 < 9; ++var4) { -- this.addSlotToContainer(new Slot(var1, var4, 8 + var4 * 18, 142)); -+ for (var4 = 0; var4 < 9; ++var4) { -+ this.addSlotToContainer(new Slot(par1InventoryPlayer, var4, 8 + var4 * 18, 142)); - } -- - } - - public InventoryMerchant getMerchantInventory() { - return this.merchantInventory; - } - -- public void onCraftGuiOpened(ICrafting var1) { -- super.onCraftGuiOpened(var1); -- } -- -+ public void addCraftingToCrafters(ICrafting par1ICrafting) { -+ super.addCraftingToCrafters(par1ICrafting); -+ } -+ -+ // Spout Start -+ public IInventory getIInventory() { -+ return merchantInventory; -+ } -+ // Spout End -+ -+ /** -+ * Looks for changes made in the container, sends them to every listener. -+ */ - public void detectAndSendChanges() { - super.detectAndSendChanges(); - } - -- public void onCraftMatrixChanged(IInventory var1) { -+ /** -+ * Callback for when the crafting matrix is changed. -+ */ -+ public void onCraftMatrixChanged(IInventory par1IInventory) { - this.merchantInventory.resetRecipeAndSlots(); -- super.onCraftMatrixChanged(var1); -- } -- -- public void setCurrentRecipeIndex(int var1) { -- this.merchantInventory.setCurrentRecipeIndex(var1); -- } -- -- public void updateProgressBar(int var1, int var2) { -- } -- -- public boolean canInteractWith(EntityPlayer var1) { -- return this.theMerchant.getCustomer() == var1; -- } -- -- public ItemStack transferStackInSlot(EntityPlayer var1, int var2) { -+ super.onCraftMatrixChanged(par1IInventory); -+ } -+ -+ public void setCurrentRecipeIndex(int par1) { -+ this.merchantInventory.setCurrentRecipeIndex(par1); -+ } -+ -+ public void updateProgressBar(int par1, int par2) {} -+ -+ public boolean canInteractWith(EntityPlayer par1EntityPlayer) { -+ return this.theMerchant.getCustomer() == par1EntityPlayer; -+ } -+ -+ /** -+ * Called when a player shift-clicks on a slot. You must override this or you will crash when someone does that. -+ */ -+ public ItemStack transferStackInSlot(EntityPlayer par1EntityPlayer, int par2) { - ItemStack var3 = null; -- Slot var4 = (Slot)this.c.get(var2); -- if(var4 != null && var4.getHasStack()) { -+ Slot var4 = (Slot)this.inventorySlots.get(par2); -+ -+ if (var4 != null && var4.getHasStack()) { - ItemStack var5 = var4.getStack(); - var3 = var5.copy(); -- if(var2 == 2) { -- if(!this.mergeItemStack(var5, 3, 39, true)) { -+ -+ if (par2 == 2) { -+ if (!this.mergeItemStack(var5, 3, 39, true)) { - return null; - } - - var4.onSlotChange(var5, var3); -- } else if(var2 != 0 && var2 != 1) { -- if(var2 >= 3 && var2 < 30) { -- if(!this.mergeItemStack(var5, 30, 39, false)) { -+ } else if (par2 != 0 && par2 != 1) { -+ if (par2 >= 3 && par2 < 30) { -+ if (!this.mergeItemStack(var5, 30, 39, false)) { - return null; - } -- } else if(var2 >= 30 && var2 < 39 && !this.mergeItemStack(var5, 3, 30, false)) { -+ } else if (par2 >= 30 && par2 < 39 && !this.mergeItemStack(var5, 3, 30, false)) { - return null; - } -- } else if(!this.mergeItemStack(var5, 3, 39, false)) { -+ } else if (!this.mergeItemStack(var5, 3, 39, false)) { - return null; - } - -- if(var5.stackSize == 0) { -+ if (var5.stackSize == 0) { - var4.putStack((ItemStack)null); - } else { - var4.onSlotChanged(); - } - -- if(var5.stackSize == var3.stackSize) { -+ if (var5.stackSize == var3.stackSize) { - return null; - } - -- var4.onPickupFromSlot(var1, var5); -+ var4.onPickupFromSlot(par1EntityPlayer, var5); - } - - return var3; - } - -- public void onContainerClosed(EntityPlayer var1) { -- super.onContainerClosed(var1); -+ /** -+ * Called when the container is closed. -+ */ -+ public void onContainerClosed(EntityPlayer par1EntityPlayer) { -+ super.onContainerClosed(par1EntityPlayer); - this.theMerchant.setCustomer((EntityPlayer)null); -- super.onContainerClosed(var1); -- if(!this.theWorld.isRemote) { -+ super.onContainerClosed(par1EntityPlayer); -+ -+ if (!this.theWorld.isRemote) { - ItemStack var2 = this.merchantInventory.getStackInSlotOnClosing(0); -- if(var2 != null) { -- var1.dropPlayerItem(var2); -+ -+ if (var2 != null) { -+ par1EntityPlayer.dropPlayerItem(var2); - } - - var2 = this.merchantInventory.getStackInSlotOnClosing(1); -- if(var2 != null) { -- var1.dropPlayerItem(var2); -- } - -+ if (var2 != null) { -+ par1EntityPlayer.dropPlayerItem(var2); -+ } - } - } - } ---- /dev/null -+++ org/spoutcraft/client/gui/minimap/GuiOverviewMap.java -@@ -1,0 +1,323 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.client.gui.minimap; -+ -+import org.apache.commons.lang3.ArrayUtils; -+ -+import org.lwjgl.input.Mouse; -+ -+import org.spoutcraft.api.Spoutcraft; -+import org.spoutcraft.api.gui.Button; -+import org.spoutcraft.api.gui.Color; -+import org.spoutcraft.api.gui.Control; -+import org.spoutcraft.api.gui.GenericButton; -+import org.spoutcraft.api.gui.GenericCheckBox; -+import org.spoutcraft.api.gui.GenericLabel; -+import org.spoutcraft.api.gui.GenericScrollArea; -+import org.spoutcraft.api.gui.Label; -+import org.spoutcraft.api.gui.Orientation; -+import org.spoutcraft.api.gui.Point; -+import org.spoutcraft.api.gui.RenderPriority; -+import org.spoutcraft.api.gui.Widget; -+import org.spoutcraft.client.SpoutClient; -+import org.spoutcraft.client.chunkcache.HeightMap; -+import org.spoutcraft.client.gui.GuiSpoutScreen; -+ -+public class GuiOverviewMap extends GuiSpoutScreen { -+ private MapWidget map; -+ private Boolean minimapEnabled; -+ private Label title, menuTitle, noRenderLabel; -+ private Button buttonDone, buttonWaypoint, buttonFocus, buttonCloseMenu, buttonZoomIn, buttonZoomOut, buttonShowPlayer, buttonReset, buttonSave, buttonDeathpoints; -+ private GenericScrollArea hoverMenu; -+ -+ private boolean dragging = false; -+ private int dragStartX = -1, dragStartY = -1; -+ Point coords = null; -+ int y = -1; -+ Waypoint clickedWaypoint = null; -+ private int focus_mode = -1; -+ private static final int FOCUS_SET = 1; -+ private static final int FOCUS_REMOVE = 3; -+ private int waypoint_mode = -1; -+ private static final int WAYPOINT_ADD = 1; -+ private static final int WAYPOINT_EDIT = 2; -+ -+ @Override -+ protected void createInstances() { -+ title = new GenericLabel("Overview Map"); -+ noRenderLabel = new GenericLabel("The overview map will not work until the minimap is enabled."); -+ minimapEnabled = MinimapConfig.getInstance().isEnabled(); -+ buttonDone = new GenericButton("Done"); -+ buttonZoomIn = new GenericButton("+"); -+ buttonZoomOut = new GenericButton("-"); -+ buttonShowPlayer = new GenericButton("Player"); -+ buttonReset = new GenericButton("Reset View"); -+ buttonSave = new GenericButton("Save to Desktop"); -+ buttonDeathpoints = new GenericCheckBox("Deathpoints"); -+ ((GenericCheckBox)buttonDeathpoints).setChecked(MinimapConfig.getInstance().isDeathpoints()); -+ map = new MapWidget(this); -+ map.setGeometry(0, 0, width, height); -+ map.scrollTo(map.getPlayerPosition(), false, 0); -+ -+ if (minimapEnabled == false) { -+ getScreen().attachWidgets("Spoutcraft", noRenderLabel, buttonDone); -+ } else { -+ getScreen().attachWidgets("Spoutcraft", map, title, buttonDone, buttonZoomIn, buttonZoomOut, buttonShowPlayer, buttonReset, buttonSave, buttonDeathpoints); -+ } -+ -+ hoverMenu = new GenericScrollArea(); -+ hoverMenu.setBackgroundColor(new Color(0x55ffffff)); -+ hoverMenu.setPriority(RenderPriority.Lowest); -+ menuTitle = new GenericLabel("What do you want to do?"); -+ buttonWaypoint = new GenericButton("Add Waypoint"); -+ buttonFocus = new GenericButton("Set Focus"); -+ buttonFocus.setTooltip("If a waypoint is in focus, the direction\nto it will be drawn on the minimap."); -+ buttonCloseMenu = new GenericButton("Close"); -+ hoverMenu.attachWidgets("Spoutcraft", buttonFocus, buttonWaypoint, buttonCloseMenu, menuTitle); -+ -+ setMenuVisible(false); -+ getScreen().attachWidget("Spoutcraft", hoverMenu); -+ } -+ -+ @Override -+ protected void layoutWidgets() { -+ title.setX(width / 2 - SpoutClient.getHandle().fontRenderer.getStringWidth(title.getText()) / 2); -+ title.setY(5); -+ -+ noRenderLabel.setX(width / 2 - SpoutClient.getHandle().fontRenderer.getStringWidth(noRenderLabel.getText()) / 2); -+ noRenderLabel.setY(height / 2); -+ -+ map.setGeometry(0, 0, width, height); -+ map.setPriority(RenderPriority.Highest); -+ -+ buttonZoomIn.setGeometry(5, height - 25, 20, 20); -+ buttonZoomOut.setGeometry(25, height - 25, 20, 20); -+ buttonDone.setGeometry(width - 55, height - 25, 50, 20); -+ buttonShowPlayer.setGeometry(50, height - 25, 50, 20); -+ buttonReset.setGeometry(105, height - 25, 75, 20); -+ buttonSave.setGeometry(185, height - 25, 100, 20); -+ buttonDeathpoints.setGeometry(290, height - 25, 75, 20); -+ -+ hoverMenu.setGeometry(width / 2 - 320 / 2, height / 2 - 46 / 2, 320, 46); -+ int w = SpoutClient.getHandle().fontRenderer.getStringWidth(menuTitle.getText()); -+ menuTitle.setGeometry(320 / 2 - w / 2, 5, w, 11); -+ buttonWaypoint.setGeometry(5, 21, 100, 20); -+ buttonFocus.setGeometry(110, 21, 100, 20); -+ buttonCloseMenu.setGeometry(215, 21, 100, 20); -+ } -+ -+ @Override -+ public void buttonClicked(Button btn) { -+ if (btn == buttonDone) { -+ mc.displayGuiScreen(null); -+ } -+ if (btn == buttonZoomIn) { -+ map.zoomBy(1.5); -+ } -+ if (btn == buttonZoomOut) { -+ map.zoomBy(1.0 / 1.5); -+ } -+ if (btn == buttonShowPlayer) { -+ map.showPlayer(500); -+ } -+ if (btn == buttonWaypoint) { -+ switch(waypoint_mode) { -+ case WAYPOINT_ADD: -+ int x = coords.getX(); -+ int z = coords.getY(); -+ SpoutClient.getHandle().displayGuiScreen(new GuiAddWaypoint(this, x, y, z)); -+ break; -+ case WAYPOINT_EDIT: -+ SpoutClient.getHandle().displayGuiScreen(new GuiAddWaypoint(this, clickedWaypoint)); -+ break; -+ } -+ setMenuVisible(false); -+ } -+ if (btn == buttonCloseMenu) { -+ setMenuVisible(false); -+ } -+ if (btn == buttonFocus) { -+ switch(focus_mode) { -+ case FOCUS_SET: -+ if (clickedWaypoint != null) { -+ MinimapConfig.getInstance().setFocussedWaypoint(clickedWaypoint); -+ } -+ break; -+ case FOCUS_REMOVE: -+ MinimapConfig.getInstance().setFocussedWaypoint(null); -+ break; -+ } -+ setMenuVisible(false); -+ } -+ if (btn == buttonReset) { -+ map.reset(); -+ } -+ if (btn == buttonSave) { -+ if (map.saveToDesktop()) { -+ Label label = new FadingLabel("Saved to Desktop!", 500).setTextColor(new Color(0x7FFF00)); -+ label.setGeometry(width / 2 - Spoutcraft.getMinecraftFont().getTextWidth(label.getText()) / 2, height / 2, 100, 12); -+ getScreen().attachWidgets("Spoutcraft", label); -+ } else { -+ Label label = new FadingLabel("Failed to save Minimap!", 500).setTextColor(new Color(0xEE0000)); -+ label.setGeometry(width / 2 - Spoutcraft.getMinecraftFont().getTextWidth(label.getText()) / 2, height / 2, 100, 12); -+ getScreen().attachWidgets("Spoutcraft", label); -+ } -+ } -+ if (btn == buttonDeathpoints) { -+ MinimapConfig.getInstance().setDeathpoints(!MinimapConfig.getInstance().isDeathpoints()); -+ } -+ } -+ -+ @Override -+ protected void mouseClicked(int x, int y, int button) { -+ if (button == 0 && isInBoundingRect(map, x, y) && !hitsWidget(x, y, map, title)) { -+ setMenuVisible(false); -+ dragStartX = x; -+ dragStartY = y; -+ } -+ super.mouseClicked(x, y, button); -+ } -+ -+ private boolean hitsWidget(int x, int y, Widget ...exclude) { -+ for (Widget widget:getScreen().getAttachedWidgets(true)) { -+ if (isInBoundingRect(widget, x, y)) { -+ if (ArrayUtils.contains(exclude, widget) || !widget.isVisible()) { -+ continue; -+ } -+ return true; -+ } -+ } -+ return false; -+ } -+ -+ private void setMenuVisible(boolean visible) { -+ hoverMenu.setVisible(visible); -+ for (Widget w:hoverMenu.getAttachedWidgets(true)) { -+ w.setVisible(visible); -+ if (w instanceof Control) { -+ ((Control) w).setEnabled(visible); -+ } -+ } -+ } -+ -+ private boolean withinManhattanLength(Point center, Point clicked, float length) { -+ int cx = center.getX(); -+ int cy = center.getY(); -+ int x = clicked.getX(); -+ int y = clicked.getY(); -+ return x >= cx - length && x <= cx + length && y >= cy - length && y <= cy + length; -+ } -+ -+ private Waypoint getClickedWaypoint(int x, int z) { -+ Point clicked = new Point(x,z); -+ for (Waypoint waypoint:MinimapConfig.getInstance().getAllWaypoints(MinimapUtils.getWorldName())) { -+ if (withinManhattanLength(new Point(waypoint.x, waypoint.z), clicked, (float) (2f/map.scale))) { -+ return waypoint; -+ } -+ } -+ return null; -+ } -+ -+ @Override -+ protected void mouseMovedOrUp(int x, int y, int button) { -+ if (button == 0 && !Mouse.isButtonDown(button)) { -+ if (dragStartX == x && dragStartY == y && !dragging) { -+ setMenuVisible(true); -+ coords = map.mapOutsideToCoords(new Point(x, y)); -+ clickedWaypoint = getClickedWaypoint(coords.getX(), coords.getY()); -+ focus_mode = -1; -+ if (withinManhattanLength(map.getPlayerPosition(), coords, 2)) { -+ coords = map.getPlayerPosition(); -+ this.y = (int) SpoutClient.getHandle().thePlayer.posY; -+ } else { -+ this.y = HeightMap.getHeightMap(MinimapUtils.getWorldName()).getHeight(coords.getX(), coords.getY()); -+ } -+ -+ if (clickedWaypoint == null) { -+ waypoint_mode = WAYPOINT_ADD; -+ buttonWaypoint.setText("Add Waypoint"); -+ } else { -+ waypoint_mode = WAYPOINT_EDIT; -+ buttonWaypoint.setText("Edit Waypoint"); -+ } -+ Waypoint waypoint = MinimapConfig.getInstance().getFocussedWaypoint(); -+ buttonFocus.setEnabled(true); -+ if ((clickedWaypoint == null || clickedWaypoint == waypoint) && waypoint != null) { -+ buttonFocus.setText("Remove Focus"); -+ focus_mode = FOCUS_REMOVE; -+ clickedWaypoint = waypoint; -+ } else if (clickedWaypoint != null) { -+ focus_mode = FOCUS_SET; -+ buttonFocus.setText("Set Focus"); -+ } else { -+ buttonFocus.setText("Set Focus"); -+ buttonFocus.setEnabled(false); -+ } -+ menuTitle.setText(SpoutClient.getInstance().isCoordsCheat() ? "Position (" + coords.getX() + ":" + this.y + ":" + coords.getY() + ")" : "Position not shown"); -+ } -+ dragging = false; -+ dragStartX = -1; -+ dragStartY = -1; -+ } -+ if (dragging || dragStartX != -1) { -+ dragging = true; -+ int mX = (int) map.getScrollPosition(Orientation.HORIZONTAL); -+ int mY = (int) map.getScrollPosition(Orientation.VERTICAL); -+ mX -= x - dragStartX; -+ mY -= y - dragStartY; -+ map.setScrollPosition(Orientation.HORIZONTAL, mX); -+ map.setScrollPosition(Orientation.VERTICAL, mY); -+ -+ dragStartX = x; -+ dragStartY = y; -+ } -+ super.mouseMovedOrUp(x, y, button); -+ } -+ -+ @Override -+ protected void handleScroll(int x, int y, int scroll) { -+ if (scroll > 0) { -+ map.zoomBy(1.8); -+ map.scrollTo(map.mapOutsideToCoords(new Point(x, y)), true, 200); -+ } else if (scroll < 0) { -+ map.zoomBy(1/1.8); -+ map.scrollTo(map.mapOutsideToCoords(new Point(x, y)), true, 200); -+ } -+ } -+} -+ -+class FadingLabel extends GenericLabel { -+ int ticks; -+ int ticksPassed = 0; -+ FadingLabel(String text, int ticks) { -+ super(text); -+ this.ticks = ticks; -+ } -+ -+ public void render() { -+ ticksPassed++; -+ float opacity = 1F - (float)ticksPassed / (float)ticks; -+ if (ticksPassed > ticks) { -+ setVisible(false); -+ } -+ this.setTextColor(getTextColor().setAlpha(opacity)); -+ super.render(); -+ } -+} ---- net/minecraft/src/DemoWorldManager.java -+++ net/minecraft/src/DemoWorldManager.java -@@ -6,8 +6,8 @@ - private int field_73104_e; - private int field_73102_f; - -- public DemoWorldManager(World var1) { -- super(var1); -+ public DemoWorldManager(World par1World) { -+ super(par1World); - } - - public void updateBlockRemoving() { -@@ -15,75 +15,92 @@ - ++this.field_73102_f; - long var1 = this.theWorld.getTotalWorldTime(); - long var3 = var1 / 24000L + 1L; -- if(!this.field_73105_c && this.field_73102_f > 20) { -+ -+ if (!this.field_73105_c && this.field_73102_f > 20) { - this.field_73105_c = true; -- this.thisPlayerMP.playerNetServerHandler.sendPacket(new Packet70GameEvent(5, 0)); -+ this.thisPlayerMP.playerNetServerHandler.sendPacketToPlayer(new Packet70GameEvent(5, 0)); - } - - this.demoTimeExpired = var1 > 120500L; -- if(this.demoTimeExpired) { -+ -+ if (this.demoTimeExpired) { - ++this.field_73104_e; - } - -- if(var1 % 24000L == 500L) { -- if(var3 <= 6L) { -+ if (var1 % 24000L == 500L) { -+ if (var3 <= 6L) { - this.thisPlayerMP.sendChatToPlayer(ChatMessageComponent.createFromTranslationKey("demo.day." + var3)); - } -- } else if(var3 == 1L) { -- if(var1 == 100L) { -- this.thisPlayerMP.playerNetServerHandler.sendPacket(new Packet70GameEvent(5, 101)); -- } else if(var1 == 175L) { -- this.thisPlayerMP.playerNetServerHandler.sendPacket(new Packet70GameEvent(5, 102)); -- } else if(var1 == 250L) { -- this.thisPlayerMP.playerNetServerHandler.sendPacket(new Packet70GameEvent(5, 103)); -+ } else if (var3 == 1L) { -+ if (var1 == 100L) { -+ this.thisPlayerMP.playerNetServerHandler.sendPacketToPlayer(new Packet70GameEvent(5, 101)); -+ } else if (var1 == 175L) { -+ this.thisPlayerMP.playerNetServerHandler.sendPacketToPlayer(new Packet70GameEvent(5, 102)); -+ } else if (var1 == 250L) { -+ this.thisPlayerMP.playerNetServerHandler.sendPacketToPlayer(new Packet70GameEvent(5, 103)); - } -- } else if(var3 == 5L && var1 % 24000L == 22000L) { -+ } else if (var3 == 5L && var1 % 24000L == 22000L) { - this.thisPlayerMP.sendChatToPlayer(ChatMessageComponent.createFromTranslationKey("demo.day.warning")); - } -- - } - -+ /** -+ * Sends a message to the player reminding them that this is the demo version -+ */ - private void sendDemoReminder() { -- if(this.field_73104_e > 100) { -+ if (this.field_73104_e > 100) { - this.thisPlayerMP.sendChatToPlayer(ChatMessageComponent.createFromTranslationKey("demo.reminder")); - this.field_73104_e = 0; - } -- -- } -- -- public void onBlockClicked(int var1, int var2, int var3, int var4) { -- if(this.demoTimeExpired) { -- this.sendDemoReminder(); -- } else { -- super.onBlockClicked(var1, var2, var3, var4); -- } -- } -- -- public void blockRemoving(int var1, int var2, int var3) { -- if(!this.demoTimeExpired) { -- super.blockRemoving(var1, var2, var3); -- } -- } -- -- public boolean tryHarvestBlock(int var1, int var2, int var3) { -- return this.demoTimeExpired ? false : super.tryHarvestBlock(var1, var2, var3); -- } -- -- public boolean tryUseItem(EntityPlayer var1, World var2, ItemStack var3) { -- if(this.demoTimeExpired) { -- this.sendDemoReminder(); -- return false; -- } else { -- return super.tryUseItem(var1, var2, var3); -- } -- } -- -- public boolean activateBlockOrUseItem(EntityPlayer var1, World var2, ItemStack var3, int var4, int var5, int var6, int var7, float var8, float var9, float var10) { -- if(this.demoTimeExpired) { -- this.sendDemoReminder(); -- return false; -- } else { -- return super.activateBlockOrUseItem(var1, var2, var3, var4, var5, var6, var7, var8, var9, var10); -+ } -+ -+ /** -+ * if not creative, it calls destroyBlockInWorldPartially untill the block is broken first. par4 is the specific side. -+ * tryHarvestBlock can also be the result of this call -+ */ -+ public void onBlockClicked(int par1, int par2, int par3, int par4) { -+ if (this.demoTimeExpired) { -+ this.sendDemoReminder(); -+ } else { -+ super.onBlockClicked(par1, par2, par3, par4); -+ } -+ } -+ -+ public void uncheckedTryHarvestBlock(int par1, int par2, int par3) { -+ if (!this.demoTimeExpired) { -+ super.uncheckedTryHarvestBlock(par1, par2, par3); -+ } -+ } -+ -+ /** -+ * Attempts to harvest a block at the given coordinate -+ */ -+ public boolean tryHarvestBlock(int par1, int par2, int par3) { -+ return this.demoTimeExpired ? false : super.tryHarvestBlock(par1, par2, par3); -+ } -+ -+ /** -+ * Attempts to right-click use an item by the given EntityPlayer in the given World -+ */ -+ public boolean tryUseItem(EntityPlayer par1EntityPlayer, World par2World, ItemStack par3ItemStack) { -+ if (this.demoTimeExpired) { -+ this.sendDemoReminder(); -+ return false; -+ } else { -+ return super.tryUseItem(par1EntityPlayer, par2World, par3ItemStack); -+ } -+ } -+ -+ /** -+ * Activate the clicked on block, otherwise use the held item. Args: player, world, itemStack, x, y, z, side, xOffset, -+ * yOffset, zOffset -+ */ -+ public boolean activateBlockOrUseItem(EntityPlayer par1EntityPlayer, World par2World, ItemStack par3ItemStack, int par4, int par5, int par6, int par7, float par8, float par9, float par10) { -+ if (this.demoTimeExpired) { -+ this.sendDemoReminder(); -+ return false; -+ } else { -+ return super.activateBlockOrUseItem(par1EntityPlayer, par2World, par3ItemStack, par4, par5, par6, par7, par8, par9, par10); - } - } - } ---- net/minecraft/src/CallableLevelSpawnLocation.java -+++ net/minecraft/src/CallableLevelSpawnLocation.java -@@ -5,8 +5,8 @@ - class CallableLevelSpawnLocation implements Callable { - final WorldInfo worldInfoInstance; - -- CallableLevelSpawnLocation(WorldInfo var1) { -- this.worldInfoInstance = var1; -+ CallableLevelSpawnLocation(WorldInfo par1WorldInfo) { -+ this.worldInfoInstance = par1WorldInfo; - } - - public String callLevelSpawnLocation() { ---- net/minecraft/src/IRangedAttackMob.java -+++ net/minecraft/src/IRangedAttackMob.java -@@ -1,5 +1,9 @@ - package net.minecraft.src; - - public interface IRangedAttackMob { -+ -+ /** -+ * Attack the specified entity using a ranged attack. -+ */ - void attackEntityWithRangedAttack(EntityLivingBase var1, float var2); - } ---- net/minecraft/src/BlockDeadBush.java -+++ net/minecraft/src/BlockDeadBush.java -@@ -3,27 +3,37 @@ - import java.util.Random; - - public class BlockDeadBush extends BlockFlower { -- protected BlockDeadBush(int var1) { -- super(var1, Material.vine); -+ protected BlockDeadBush(int par1) { -+ super(par1, Material.vine); - float var2 = 0.4F; - this.setBlockBounds(0.5F - var2, 0.0F, 0.5F - var2, 0.5F + var2, 0.8F, 0.5F + var2); - } - -- protected boolean canThisPlantGrowOnThisBlockID(int var1) { -- return var1 == Block.sand.blockID; -+ /** -+ * Gets passed in the blockID of the block below and supposed to return true if its allowed to grow on the type of -+ * blockID passed in. Args: blockID -+ */ -+ protected boolean canThisPlantGrowOnThisBlockID(int par1) { -+ return par1 == Block.sand.blockID; - } - -- public int idDropped(int var1, Random var2, int var3) { -+ /** -+ * Returns the ID of the items to drop on destruction. -+ */ -+ public int idDropped(int par1, Random par2Random, int par3) { - return -1; - } - -- public void harvestBlock(World var1, EntityPlayer var2, int var3, int var4, int var5, int var6) { -- if(!var1.isRemote && var2.getCurrentEquippedItem() != null && var2.getCurrentEquippedItem().itemID == Item.shears.itemID) { -- var2.addStat(StatList.mineBlockStatArray[this.blockID], 1); -- this.dropBlockAsItem_do(var1, var3, var4, var5, new ItemStack(Block.deadBush, 1, var6)); -+ /** -+ * Called when the player destroys a block with an item that can harvest it. (i, j, k) are the coordinates of the block -+ * and l is the block's subtype/damage. -+ */ -+ public void harvestBlock(World par1World, EntityPlayer par2EntityPlayer, int par3, int par4, int par5, int par6) { -+ if (!par1World.isRemote && par2EntityPlayer.getCurrentEquippedItem() != null && par2EntityPlayer.getCurrentEquippedItem().itemID == Item.shears.itemID) { -+ par2EntityPlayer.addStat(StatList.mineBlockStatArray[this.blockID], 1); -+ this.dropBlockAsItem_do(par1World, par3, par4, par5, new ItemStack(Block.deadBush, 1, par6)); - } else { -- super.harvestBlock(var1, var2, var3, var4, var5, var6); -+ super.harvestBlock(par1World, par2EntityPlayer, par3, par4, par5, par6); - } -- - } - } ---- net/minecraft/src/ChatClickData.java -+++ net/minecraft/src/ChatClickData.java -@@ -6,37 +6,48 @@ - import java.util.regex.Pattern; - - public class ChatClickData { -- public static final Pattern a = Pattern.compile("^(?:(https?)://)?([-\\w_\\.]{2,}\\.[a-z]{2,4})(/\\S*)?$"); -+ public static final Pattern pattern = Pattern.compile("^(?:(https?)://)?([-\\w_\\.]{2,}\\.[a-z]{2,4})(/\\S*)?$"); - private final FontRenderer fontR; - private final ChatLine line; - private final int field_78312_d; - private final int field_78313_e; -- private final String f; -- private final String g; -- -- public ChatClickData(FontRenderer var1, ChatLine var2, int var3, int var4) { -- this.fontR = var1; -- this.line = var2; -- this.field_78312_d = var3; -- this.field_78313_e = var4; -- this.f = var1.trimStringToWidth(var2.getChatLineString(), var3); -- this.g = this.findClickedUrl(); -+ private final String field_78310_f; -+ -+ /** The URL which was clicked on. */ -+ private final String clickedUrl; -+ -+ public ChatClickData(FontRenderer par1FontRenderer, ChatLine par2ChatLine, int par3, int par4) { -+ this.fontR = par1FontRenderer; -+ this.line = par2ChatLine; -+ this.field_78312_d = par3; -+ this.field_78313_e = par4; -+ this.field_78310_f = par1FontRenderer.trimStringToWidth(par2ChatLine.getChatLineString(), par3); -+ this.clickedUrl = this.findClickedUrl(); - } - -+ /** -+ * Gets the URL which was clicked on. -+ */ - public String getClickedUrl() { -- return this.g; -+ return this.clickedUrl; - } - -+ /** -+ * computes the URI from the clicked chat data object -+ */ - public URI getURI() { - String var1 = this.getClickedUrl(); -- if(var1 == null) { -+ -+ if (var1 == null) { - return null; - } else { -- Matcher var2 = a.matcher(var1); -- if(var2.matches()) { -+ Matcher var2 = pattern.matcher(var1); -+ -+ if (var2.matches()) { - try { - String var3 = var2.group(0); -- if(var2.group(1) == null) { -+ -+ if (var2.group(1) == null) { - var3 = "http://" + var3; - } - -@@ -51,13 +62,15 @@ - } - - private String findClickedUrl() { -- int var1 = this.f.lastIndexOf(" ", this.f.length()) + 1; -- if(var1 < 0) { -+ int var1 = this.field_78310_f.lastIndexOf(" ", this.field_78310_f.length()) + 1; -+ -+ if (var1 < 0) { - var1 = 0; - } - - int var2 = this.line.getChatLineString().indexOf(" ", var1); -- if(var2 < 0) { -+ -+ if (var2 < 0) { - var2 = this.line.getChatLineString().length(); - } - ---- /dev/null -+++ org/spoutcraft/api/gui/WidgetAnim.java -@@ -1,0 +1,89 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.api.gui; -+ -+import java.util.HashMap; -+ -+/** -+ * Types of animation, only one animation is permitted at a time, and note that -+ * some types are limited to certain widget types... -+ */ -+public enum WidgetAnim { -+ /** -+ * No animation (default). -+ */ -+ NONE(0), -+ /** -+ * Change the X by "value" pixels (any Widget). -+ */ -+ POS_X(1), -+ /** -+ * Change the Y by "value" pixels (any Widget). -+ */ -+ POS_Y(2), -+ /** -+ * Change the Width by "value" pixels (any Widget). -+ */ -+ WIDTH(3), -+ /** -+ * Change the Height by "value" pixels (any Widget). -+ */ -+ HEIGHT(4), -+ /** -+ * Change the Left offset by "value" pixels (Texture only). -+ */ -+ OFFSET_LEFT(5), -+ /** -+ * Change the Top offset by "value" pixels (Texture only). -+ */ -+ OFFSET_TOP(6); -+ private final int id; -+ -+ WidgetAnim(int id) { -+ this.id = id; -+ } -+ -+ public int getId() { -+ return id; -+ } -+ private static final HashMap lookupId = new HashMap(); -+ -+ static { -+ for (WidgetAnim t : values()) { -+ lookupId.put(t.getId(), t); -+ } -+ } -+ -+ public static WidgetAnim getAnimationFromId(int id) { -+ return lookupId.get(id); -+ } -+ -+ public boolean check(Widget widget) { -+ switch (this) { -+ case OFFSET_TOP: -+ case OFFSET_LEFT: -+ if (widget instanceof Texture) { -+ return true; -+ } -+ return false; -+ } -+ return true; -+ } -+} ---- net/minecraft/src/EntityDragon.java -+++ net/minecraft/src/EntityDragon.java -@@ -7,26 +7,55 @@ - public double targetX; - public double targetY; - public double targetZ; -+ -+ /** -+ * Ring buffer array for the last 64 Y-positions and yaw rotations. Used to calculate offsets for the animations. -+ */ - public double[][] ringBuffer = new double[64][3]; -+ -+ /** -+ * Index into the ring buffer. Incremented once per tick and restarts at 0 once it reaches the end of the buffer. -+ */ - public int ringBufferIndex = -1; -- public EntityDragonPart[] dragonPartArray = new EntityDragonPart[]{this.dragonPartHead = new EntityDragonPart(this, "head", 6.0F, 6.0F), this.dragonPartBody = new EntityDragonPart(this, "body", 8.0F, 8.0F), this.dragonPartTail1 = new EntityDragonPart(this, "tail", 4.0F, 4.0F), this.dragonPartTail2 = new EntityDragonPart(this, "tail", 4.0F, 4.0F), this.dragonPartTail3 = new EntityDragonPart(this, "tail", 4.0F, 4.0F), this.dragonPartWing1 = new EntityDragonPart(this, "wing", 4.0F, 4.0F), this.dragonPartWing2 = new EntityDragonPart(this, "wing", 4.0F, 4.0F)}; -+ -+ /** An array containing all body parts of this dragon */ -+ public EntityDragonPart[] dragonPartArray; -+ -+ /** The head bounding box of a dragon */ - public EntityDragonPart dragonPartHead; -+ -+ /** The body bounding box of a dragon */ - public EntityDragonPart dragonPartBody; - public EntityDragonPart dragonPartTail1; - public EntityDragonPart dragonPartTail2; - public EntityDragonPart dragonPartTail3; - public EntityDragonPart dragonPartWing1; - public EntityDragonPart dragonPartWing2; -+ -+ /** Animation time at previous tick. */ - public float prevAnimTime; -+ -+ /** -+ * Animation time, used to control the speed of the animation cycles (wings flapping, jaw opening, etc.) -+ */ - public float animTime; -+ -+ /** Force selecting a new flight target at next tick if set to true. */ - public boolean forceNewTarget; -+ -+ /** -+ * Activated if the dragon is flying though obsidian, white stone or bedrock. Slows movement and animation speed. -+ */ - public boolean slowed; - private Entity target; - public int deathTicks; -+ -+ /** The current endercrystal that is healing this dragon */ - public EntityEnderCrystal healingEnderCrystal; - -- public EntityDragon(World var1) { -- super(var1); -+ public EntityDragon(World par1World) { -+ super(par1World); -+ this.dragonPartArray = new EntityDragonPart[] {this.dragonPartHead = new EntityDragonPart(this, "head", 6.0F, 6.0F), this.dragonPartBody = new EntityDragonPart(this, "body", 8.0F, 8.0F), this.dragonPartTail1 = new EntityDragonPart(this, "tail", 4.0F, 4.0F), this.dragonPartTail2 = new EntityDragonPart(this, "tail", 4.0F, 4.0F), this.dragonPartTail3 = new EntityDragonPart(this, "tail", 4.0F, 4.0F), this.dragonPartWing1 = new EntityDragonPart(this, "wing", 4.0F, 4.0F), this.dragonPartWing2 = new EntityDragonPart(this, "wing", 4.0F, 4.0F)}; - this.setHealth(this.getMaxHealth()); - this.setSize(16.0F, 8.0F); - this.noClip = true; -@@ -44,62 +73,75 @@ - super.entityInit(); - } - -- public double[] getMovementOffsets(int var1, float var2) { -- if(this.getHealth() <= 0.0F) { -- var2 = 0.0F; -+ /** -+ * Returns a double[3] array with movement offsets, used to calculate trailing tail/neck positions. [0] = yaw offset, -+ * [1] = y offset, [2] = unused, always 0. Parameters: buffer index offset, partial ticks. -+ */ -+ public double[] getMovementOffsets(int par1, float par2) { -+ if (this.getHealth() <= 0.0F) { -+ par2 = 0.0F; - } - -- var2 = 1.0F - var2; -- int var3 = this.ringBufferIndex - var1 * 1 & 63; -- int var4 = this.ringBufferIndex - var1 * 1 - 1 & 63; -+ par2 = 1.0F - par2; -+ int var3 = this.ringBufferIndex - par1 * 1 & 63; -+ int var4 = this.ringBufferIndex - par1 * 1 - 1 & 63; - double[] var5 = new double[3]; - double var6 = this.ringBuffer[var3][0]; - double var8 = MathHelper.wrapAngleTo180_double(this.ringBuffer[var4][0] - var6); -- var5[0] = var6 + var8 * (double)var2; -+ var5[0] = var6 + var8 * (double)par2; - var6 = this.ringBuffer[var3][1]; - var8 = this.ringBuffer[var4][1] - var6; -- var5[1] = var6 + var8 * (double)var2; -- var5[2] = this.ringBuffer[var3][2] + (this.ringBuffer[var4][2] - this.ringBuffer[var3][2]) * (double)var2; -+ var5[1] = var6 + var8 * (double)par2; -+ var5[2] = this.ringBuffer[var3][2] + (this.ringBuffer[var4][2] - this.ringBuffer[var3][2]) * (double)par2; - return var5; - } - -+ /** -+ * Called frequently so the entity can update its state every tick as required. For example, zombies and skeletons use -+ * this to react to sunlight and start to burn. -+ */ - public void onLivingUpdate() { - float var1; - float var2; -- if(this.worldObj.isRemote) { -+ -+ if (this.worldObj.isRemote) { - var1 = MathHelper.cos(this.animTime * (float)Math.PI * 2.0F); - var2 = MathHelper.cos(this.prevAnimTime * (float)Math.PI * 2.0F); -- if(var2 <= -0.3F && var1 >= -0.3F) { -- this.worldObj.playSound(this.posX, this.posY, this.posZ, "mob.enderdragon.wings", 5.0F, 0.8F + this.ab.nextFloat() * 0.3F, false); -+ -+ if (var2 <= -0.3F && var1 >= -0.3F) { -+ this.worldObj.playSound(this.posX, this.posY, this.posZ, "mob.enderdragon.wings", 5.0F, 0.8F + this.rand.nextFloat() * 0.3F, false); - } - } - - this.prevAnimTime = this.animTime; - float var3; -- if(this.getHealth() <= 0.0F) { -- var1 = (this.ab.nextFloat() - 0.5F) * 8.0F; -- var2 = (this.ab.nextFloat() - 0.5F) * 4.0F; -- var3 = (this.ab.nextFloat() - 0.5F) * 8.0F; -+ -+ if (this.getHealth() <= 0.0F) { -+ var1 = (this.rand.nextFloat() - 0.5F) * 8.0F; -+ var2 = (this.rand.nextFloat() - 0.5F) * 4.0F; -+ var3 = (this.rand.nextFloat() - 0.5F) * 8.0F; - this.worldObj.spawnParticle("largeexplode", this.posX + (double)var1, this.posY + 2.0D + (double)var2, this.posZ + (double)var3, 0.0D, 0.0D, 0.0D); - } else { - this.updateDragonEnderCrystal(); - var1 = 0.2F / (MathHelper.sqrt_double(this.motionX * this.motionX + this.motionZ * this.motionZ) * 10.0F + 1.0F); - var1 *= (float)Math.pow(2.0D, this.motionY); -- if(this.slowed) { -+ -+ if (this.slowed) { - this.animTime += var1 * 0.5F; - } else { - this.animTime += var1; - } - - this.rotationYaw = MathHelper.wrapAngleTo180_float(this.rotationYaw); -- if(this.ringBufferIndex < 0) { -- for(int var25 = 0; var25 < this.ringBuffer.length; ++var25) { -+ -+ if (this.ringBufferIndex < 0) { -+ for (int var25 = 0; var25 < this.ringBuffer.length; ++var25) { - this.ringBuffer[var25][0] = (double)this.rotationYaw; - this.ringBuffer[var25][1] = this.posY; - } - } - -- if(++this.ringBufferIndex == this.ringBuffer.length) { -+ if (++this.ringBufferIndex == this.ringBuffer.length) { - this.ringBufferIndex = 0; - } - -@@ -110,8 +152,9 @@ - double var8; - double var26; - float var31; -- if(this.worldObj.isRemote) { -- if(this.newPosRotationIncrements > 0) { -+ -+ if (this.worldObj.isRemote) { -+ if (this.newPosRotationIncrements > 0) { - var26 = this.posX + (this.newPosX - this.posX) / (double)this.newPosRotationIncrements; - var4 = this.posY + (this.newPosY - this.posY) / (double)this.newPosRotationIncrements; - var6 = this.posZ + (this.newPosZ - this.posZ) / (double)this.newPosRotationIncrements; -@@ -127,70 +170,77 @@ - var4 = this.targetY - this.posY; - var6 = this.targetZ - this.posZ; - var8 = var26 * var26 + var4 * var4 + var6 * var6; -- if(this.target != null) { -+ -+ if (this.target != null) { - this.targetX = this.target.posX; - this.targetZ = this.target.posZ; - double var10 = this.targetX - this.posX; - double var12 = this.targetZ - this.posZ; - double var14 = Math.sqrt(var10 * var10 + var12 * var12); -- double var16 = (double)0.4F + var14 / 80.0D - 1.0D; -- if(var16 > 10.0D) { -+ double var16 = 0.4000000059604645D + var14 / 80.0D - 1.0D; -+ -+ if (var16 > 10.0D) { - var16 = 10.0D; - } - - this.targetY = this.target.boundingBox.minY + var16; - } else { -- this.targetX += this.ab.nextGaussian() * 2.0D; -- this.targetZ += this.ab.nextGaussian() * 2.0D; -+ this.targetX += this.rand.nextGaussian() * 2.0D; -+ this.targetZ += this.rand.nextGaussian() * 2.0D; - } - -- if(this.forceNewTarget || var8 < 100.0D || var8 > 22500.0D || this.isCollidedHorizontally || this.isCollidedVertically) { -+ if (this.forceNewTarget || var8 < 100.0D || var8 > 22500.0D || this.isCollidedHorizontally || this.isCollidedVertically) { - this.setNewTarget(); - } - - var4 /= (double)MathHelper.sqrt_double(var26 * var26 + var6 * var6); - var31 = 0.6F; -- if(var4 < (double)(-var31)) { -+ -+ if (var4 < (double)(-var31)) { - var4 = (double)(-var31); - } - -- if(var4 > (double)var31) { -+ if (var4 > (double)var31) { - var4 = (double)var31; - } - -- this.motionY += var4 * (double)0.1F; -+ this.motionY += var4 * 0.10000000149011612D; - this.rotationYaw = MathHelper.wrapAngleTo180_float(this.rotationYaw); -- double var11 = 180.0D - Math.atan2(var26, var6) * 180.0D / (double)((float)Math.PI); -+ double var11 = 180.0D - Math.atan2(var26, var6) * 180.0D / Math.PI; - double var13 = MathHelper.wrapAngleTo180_double(var11 - (double)this.rotationYaw); -- if(var13 > 50.0D) { -+ -+ if (var13 > 50.0D) { - var13 = 50.0D; - } - -- if(var13 < -50.0D) { -+ if (var13 < -50.0D) { - var13 = -50.0D; - } - - Vec3 var15 = this.worldObj.getWorldVec3Pool().getVecFromPool(this.targetX - this.posX, this.targetY - this.posY, this.targetZ - this.posZ).normalize(); - Vec3 var39 = this.worldObj.getWorldVec3Pool().getVecFromPool((double)MathHelper.sin(this.rotationYaw * (float)Math.PI / 180.0F), this.motionY, (double)(-MathHelper.cos(this.rotationYaw * (float)Math.PI / 180.0F))).normalize(); - float var17 = (float)(var39.dotProduct(var15) + 0.5D) / 1.5F; -- if(var17 < 0.0F) { -+ -+ if (var17 < 0.0F) { - var17 = 0.0F; - } - - this.randomYawVelocity *= 0.8F; - float var18 = MathHelper.sqrt_double(this.motionX * this.motionX + this.motionZ * this.motionZ) * 1.0F + 1.0F; - double var19 = Math.sqrt(this.motionX * this.motionX + this.motionZ * this.motionZ) * 1.0D + 1.0D; -- if(var19 > 40.0D) { -+ -+ if (var19 > 40.0D) { - var19 = 40.0D; - } - -- this.randomYawVelocity = (float)((double)this.randomYawVelocity + var13 * ((double)0.7F / var19 / (double)var18)); -+ this.randomYawVelocity = (float)((double)this.randomYawVelocity + var13 * (0.699999988079071D / var19 / (double)var18)); - this.rotationYaw += this.randomYawVelocity * 0.1F; - float var21 = (float)(2.0D / (var19 + 1.0D)); - float var22 = 0.06F; - this.moveFlying(0.0F, -1.0F, var22 * (var17 * var21 + (1.0F - var21))); -- if(this.slowed) { -- this.moveEntity(this.motionX * (double)0.8F, this.motionY * (double)0.8F, this.motionZ * (double)0.8F); -+ -+ if (this.slowed) { -+ this.moveEntity(this.motionX * 0.800000011920929D, this.motionY * 0.800000011920929D, this.motionZ * 0.800000011920929D); - } else { - this.moveEntity(this.motionX, this.motionY, this.motionZ); - } -@@ -200,7 +250,7 @@ - var24 = 0.8F + 0.15F * var24; - this.motionX *= (double)var24; - this.motionZ *= (double)var24; -- this.motionY *= (double)0.91F; -+ this.motionY *= 0.9100000262260437D; - } - - this.renderYawOffset = this.rotationYaw; -@@ -226,7 +276,8 @@ - this.dragonPartWing1.setLocationAndAngles(this.posX + (double)(var7 * 4.5F), this.posY + 2.0D, this.posZ + (double)(var28 * 4.5F), 0.0F, 0.0F); - this.dragonPartWing2.onUpdate(); - this.dragonPartWing2.setLocationAndAngles(this.posX - (double)(var7 * 4.5F), this.posY + 2.0D, this.posZ - (double)(var28 * 4.5F), 0.0F, 0.0F); -- if(!this.worldObj.isRemote && this.hurtTime == 0) { -+ -+ if (!this.worldObj.isRemote && this.hurtTime == 0) { - this.collideWithEntities(this.worldObj.getEntitiesWithinAABBExcludingEntity(this, this.dragonPartWing1.boundingBox.expand(4.0D, 2.0D, 4.0D).offset(0.0D, -2.0D, 0.0D))); - this.collideWithEntities(this.worldObj.getEntitiesWithinAABBExcludingEntity(this, this.dragonPartWing2.boundingBox.expand(4.0D, 2.0D, 4.0D).offset(0.0D, -2.0D, 0.0D))); - this.attackEntitiesInList(this.worldObj.getEntitiesWithinAABBExcludingEntity(this, this.dragonPartHead.boundingBox.expand(1.0D, 1.0D, 1.0D))); -@@ -239,17 +290,18 @@ - this.dragonPartHead.onUpdate(); - this.dragonPartHead.setLocationAndAngles(this.posX + (double)(var31 * 5.5F * var3), this.posY + (var9[1] - var29[1]) * 1.0D + (double)(var27 * 5.5F), this.posZ - (double)(var33 * 5.5F * var3), 0.0F, 0.0F); - -- for(int var30 = 0; var30 < 3; ++var30) { -+ for (int var30 = 0; var30 < 3; ++var30) { - EntityDragonPart var32 = null; -- if(var30 == 0) { -+ -+ if (var30 == 0) { - var32 = this.dragonPartTail1; - } - -- if(var30 == 1) { -+ if (var30 == 1) { - var32 = this.dragonPartTail2; - } - -- if(var30 == 2) { -+ if (var30 == 2) { - var32 = this.dragonPartTail3; - } - -@@ -263,37 +315,40 @@ - var32.setLocationAndAngles(this.posX - (double)((var28 * var38 + var37 * var40) * var3), this.posY + (var34[1] - var29[1]) * 1.0D - (double)((var40 + var38) * var27) + 1.5D, this.posZ + (double)((var7 * var38 + var36 * var40) * var3), 0.0F, 0.0F); - } - -- if(!this.worldObj.isRemote) { -+ if (!this.worldObj.isRemote) { - this.slowed = this.destroyBlocksInAABB(this.dragonPartHead.boundingBox) | this.destroyBlocksInAABB(this.dragonPartBody.boundingBox); - } -- - } - } - -+ /** -+ * Updates the state of the enderdragon's current endercrystal. -+ */ - private void updateDragonEnderCrystal() { -- if(this.healingEnderCrystal != null) { -- if(this.healingEnderCrystal.isDead) { -- if(!this.worldObj.isRemote) { -+ if (this.healingEnderCrystal != null) { -+ if (this.healingEnderCrystal.isDead) { -+ if (!this.worldObj.isRemote) { - this.attackEntityFromPart(this.dragonPartHead, DamageSource.setExplosionSource((Explosion)null), 10.0F); - } - - this.healingEnderCrystal = null; -- } else if(this.ticksExisted % 10 == 0 && this.getHealth() < this.getMaxHealth()) { -+ } else if (this.ticksExisted % 10 == 0 && this.getHealth() < this.getMaxHealth()) { - this.setHealth(this.getHealth() + 1.0F); - } - } - -- if(this.ab.nextInt(10) == 0) { -+ if (this.rand.nextInt(10) == 0) { - float var1 = 32.0F; - List var2 = this.worldObj.getEntitiesWithinAABB(EntityEnderCrystal.class, this.boundingBox.expand((double)var1, (double)var1, (double)var1)); - EntityEnderCrystal var3 = null; - double var4 = Double.MAX_VALUE; - Iterator var6 = var2.iterator(); - -- while(var6.hasNext()) { -+ while (var6.hasNext()) { - EntityEnderCrystal var7 = (EntityEnderCrystal)var6.next(); - double var8 = var7.getDistanceSqToEntity(this); -- if(var8 < var4) { -+ -+ if (var8 < var4) { - var4 = var8; - var3 = var7; - } -@@ -301,80 +356,95 @@ - - this.healingEnderCrystal = var3; - } -- - } - -- private void collideWithEntities(List var1) { -+ /** -+ * Pushes all entities inside the list away from the enderdragon. -+ */ -+ private void collideWithEntities(List par1List) { - double var2 = (this.dragonPartBody.boundingBox.minX + this.dragonPartBody.boundingBox.maxX) / 2.0D; - double var4 = (this.dragonPartBody.boundingBox.minZ + this.dragonPartBody.boundingBox.maxZ) / 2.0D; -- Iterator var6 = var1.iterator(); -+ Iterator var6 = par1List.iterator(); - -- while(var6.hasNext()) { -+ while (var6.hasNext()) { - Entity var7 = (Entity)var6.next(); -- if(var7 instanceof EntityLivingBase) { -+ -+ if (var7 instanceof EntityLivingBase) { - double var8 = var7.posX - var2; - double var10 = var7.posZ - var4; - double var12 = var8 * var8 + var10 * var10; -- var7.addVelocity(var8 / var12 * 4.0D, (double)0.2F, var10 / var12 * 4.0D); -+ var7.addVelocity(var8 / var12 * 4.0D, 0.20000000298023224D, var10 / var12 * 4.0D); - } - } -- - } - -- private void attackEntitiesInList(List var1) { -- for(int var2 = 0; var2 < var1.size(); ++var2) { -- Entity var3 = (Entity)var1.get(var2); -- if(var3 instanceof EntityLivingBase) { -+ /** -+ * Attacks all entities inside this list, dealing 5 hearts of damage. -+ */ -+ private void attackEntitiesInList(List par1List) { -+ for (int var2 = 0; var2 < par1List.size(); ++var2) { -+ Entity var3 = (Entity)par1List.get(var2); -+ -+ if (var3 instanceof EntityLivingBase) { - var3.attackEntityFrom(DamageSource.causeMobDamage(this), 10.0F); - } - } -- - } - -+ /** -+ * Sets a new target for the flight AI. It can be a random coordinate or a nearby player. -+ */ - private void setNewTarget() { - this.forceNewTarget = false; -- if(this.ab.nextInt(2) == 0 && !this.worldObj.h.isEmpty()) { -- this.target = (Entity)this.worldObj.h.get(this.ab.nextInt(this.worldObj.h.size())); -+ -+ if (this.rand.nextInt(2) == 0 && !this.worldObj.playerEntities.isEmpty()) { -+ this.target = (Entity)this.worldObj.playerEntities.get(this.rand.nextInt(this.worldObj.playerEntities.size())); - } else { - boolean var1 = false; - - do { - this.targetX = 0.0D; -- this.targetY = (double)(70.0F + this.ab.nextFloat() * 50.0F); -+ this.targetY = (double)(70.0F + this.rand.nextFloat() * 50.0F); - this.targetZ = 0.0D; -- this.targetX += (double)(this.ab.nextFloat() * 120.0F - 60.0F); -- this.targetZ += (double)(this.ab.nextFloat() * 120.0F - 60.0F); -+ this.targetX += (double)(this.rand.nextFloat() * 120.0F - 60.0F); -+ this.targetZ += (double)(this.rand.nextFloat() * 120.0F - 60.0F); - double var2 = this.posX - this.targetX; - double var4 = this.posY - this.targetY; - double var6 = this.posZ - this.targetZ; - var1 = var2 * var2 + var4 * var4 + var6 * var6 > 100.0D; -- } while(!var1); -+ } while (!var1); - - this.target = null; - } -- -- } -- -- private float simplifyAngle(double var1) { -- return (float)MathHelper.wrapAngleTo180_double(var1); -- } -- -- private boolean destroyBlocksInAABB(AxisAlignedBB var1) { -- int var2 = MathHelper.floor_double(var1.minX); -- int var3 = MathHelper.floor_double(var1.minY); -- int var4 = MathHelper.floor_double(var1.minZ); -- int var5 = MathHelper.floor_double(var1.maxX); -- int var6 = MathHelper.floor_double(var1.maxY); -- int var7 = MathHelper.floor_double(var1.maxZ); -+ } -+ -+ /** -+ * Simplifies the value of a number by adding/subtracting 180 to the point that the number is between -180 and 180. -+ */ -+ private float simplifyAngle(double par1) { -+ return (float)MathHelper.wrapAngleTo180_double(par1); -+ } -+ -+ /** -+ * Destroys all blocks that aren't associated with 'The End' inside the given bounding box. -+ */ -+ private boolean destroyBlocksInAABB(AxisAlignedBB par1AxisAlignedBB) { -+ int var2 = MathHelper.floor_double(par1AxisAlignedBB.minX); -+ int var3 = MathHelper.floor_double(par1AxisAlignedBB.minY); -+ int var4 = MathHelper.floor_double(par1AxisAlignedBB.minZ); -+ int var5 = MathHelper.floor_double(par1AxisAlignedBB.maxX); -+ int var6 = MathHelper.floor_double(par1AxisAlignedBB.maxY); -+ int var7 = MathHelper.floor_double(par1AxisAlignedBB.maxZ); - boolean var8 = false; - boolean var9 = false; - -- for(int var10 = var2; var10 <= var5; ++var10) { -- for(int var11 = var3; var11 <= var6; ++var11) { -- for(int var12 = var4; var12 <= var7; ++var12) { -+ for (int var10 = var2; var10 <= var5; ++var10) { -+ for (int var11 = var3; var11 <= var6; ++var11) { -+ for (int var12 = var4; var12 <= var7; ++var12) { - int var13 = this.worldObj.getBlockId(var10, var11, var12); -- if(var13 != 0) { -- if(var13 != Block.obsidian.blockID && var13 != Block.whiteStone.blockID && var13 != Block.bedrock.blockID && this.worldObj.getGameRules().getGameRuleBooleanValue("mobGriefing")) { -+ -+ if (var13 != 0) { -+ if (var13 != Block.obsidian.blockID && var13 != Block.whiteStone.blockID && var13 != Block.bedrock.blockID && this.worldObj.getGameRules().getGameRuleBooleanValue("mobGriefing")) { - var9 = this.worldObj.setBlockToAir(var10, var11, var12) || var9; - } else { - var8 = true; -@@ -384,76 +454,86 @@ - } - } - -- if(var9) { -- double var16 = var1.minX + (var1.maxX - var1.minX) * (double)this.ab.nextFloat(); -- double var17 = var1.minY + (var1.maxY - var1.minY) * (double)this.ab.nextFloat(); -- double var14 = var1.minZ + (var1.maxZ - var1.minZ) * (double)this.ab.nextFloat(); -+ if (var9) { -+ double var16 = par1AxisAlignedBB.minX + (par1AxisAlignedBB.maxX - par1AxisAlignedBB.minX) * (double)this.rand.nextFloat(); -+ double var17 = par1AxisAlignedBB.minY + (par1AxisAlignedBB.maxY - par1AxisAlignedBB.minY) * (double)this.rand.nextFloat(); -+ double var14 = par1AxisAlignedBB.minZ + (par1AxisAlignedBB.maxZ - par1AxisAlignedBB.minZ) * (double)this.rand.nextFloat(); - this.worldObj.spawnParticle("largeexplode", var16, var17, var14, 0.0D, 0.0D, 0.0D); - } - - return var8; - } - -- public boolean attackEntityFromPart(EntityDragonPart var1, DamageSource var2, float var3) { -- if(var1 != this.dragonPartHead) { -- var3 = var3 / 4.0F + 1.0F; -+ public boolean attackEntityFromPart(EntityDragonPart par1EntityDragonPart, DamageSource par2DamageSource, float par3) { -+ if (par1EntityDragonPart != this.dragonPartHead) { -+ par3 = par3 / 4.0F + 1.0F; - } - - float var4 = this.rotationYaw * (float)Math.PI / 180.0F; - float var5 = MathHelper.sin(var4); - float var6 = MathHelper.cos(var4); -- this.targetX = this.posX + (double)(var5 * 5.0F) + (double)((this.ab.nextFloat() - 0.5F) * 2.0F); -- this.targetY = this.posY + (double)(this.ab.nextFloat() * 3.0F) + 1.0D; -- this.targetZ = this.posZ - (double)(var6 * 5.0F) + (double)((this.ab.nextFloat() - 0.5F) * 2.0F); -+ this.targetX = this.posX + (double)(var5 * 5.0F) + (double)((this.rand.nextFloat() - 0.5F) * 2.0F); -+ this.targetY = this.posY + (double)(this.rand.nextFloat() * 3.0F) + 1.0D; -+ this.targetZ = this.posZ - (double)(var6 * 5.0F) + (double)((this.rand.nextFloat() - 0.5F) * 2.0F); - this.target = null; -- if(var2.getEntity() instanceof EntityPlayer || var2.isExplosion()) { -- this.func_82195_e(var2, var3); -+ -+ if (par2DamageSource.getEntity() instanceof EntityPlayer || par2DamageSource.isExplosion()) { -+ this.func_82195_e(par2DamageSource, par3); - } - - return true; - } - -- public boolean attackEntityFrom(DamageSource var1, float var2) { -+ /** -+ * Called when the entity is attacked. -+ */ -+ public boolean attackEntityFrom(DamageSource par1DamageSource, float par2) { - return false; - } - -- protected boolean func_82195_e(DamageSource var1, float var2) { -- return super.attackEntityFrom(var1, var2); -+ protected boolean func_82195_e(DamageSource par1DamageSource, float par2) { -+ return super.attackEntityFrom(par1DamageSource, par2); - } - -+ /** -+ * handles entity death timer, experience orb and particle creation -+ */ - protected void onDeathUpdate() { - ++this.deathTicks; -- if(this.deathTicks >= 180 && this.deathTicks <= 200) { -- float var1 = (this.ab.nextFloat() - 0.5F) * 8.0F; -- float var2 = (this.ab.nextFloat() - 0.5F) * 4.0F; -- float var3 = (this.ab.nextFloat() - 0.5F) * 8.0F; -+ -+ if (this.deathTicks >= 180 && this.deathTicks <= 200) { -+ float var1 = (this.rand.nextFloat() - 0.5F) * 8.0F; -+ float var2 = (this.rand.nextFloat() - 0.5F) * 4.0F; -+ float var3 = (this.rand.nextFloat() - 0.5F) * 8.0F; - this.worldObj.spawnParticle("hugeexplosion", this.posX + (double)var1, this.posY + 2.0D + (double)var2, this.posZ + (double)var3, 0.0D, 0.0D, 0.0D); - } - - int var4; - int var5; -- if(!this.worldObj.isRemote) { -- if(this.deathTicks > 150 && this.deathTicks % 5 == 0) { -+ -+ if (!this.worldObj.isRemote) { -+ if (this.deathTicks > 150 && this.deathTicks % 5 == 0) { - var4 = 1000; - -- while(var4 > 0) { -+ while (var4 > 0) { - var5 = EntityXPOrb.getXPSplit(var4); - var4 -= var5; - this.worldObj.spawnEntityInWorld(new EntityXPOrb(this.worldObj, this.posX, this.posY, this.posZ, var5)); - } - } - -- if(this.deathTicks == 1) { -+ if (this.deathTicks == 1) { - this.worldObj.func_82739_e(1018, (int)this.posX, (int)this.posY, (int)this.posZ, 0); - } - } - -- this.moveEntity(0.0D, (double)0.1F, 0.0D); -+ this.moveEntity(0.0D, 0.10000000149011612D, 0.0D); - this.renderYawOffset = this.rotationYaw += 20.0F; -- if(this.deathTicks == 200 && !this.worldObj.isRemote) { -+ -+ if (this.deathTicks == 200 && !this.worldObj.isRemote) { - var4 = 2000; - -- while(var4 > 0) { -+ while (var4 > 0) { - var5 = EntityXPOrb.getXPSplit(var4); - var4 -= var5; - this.worldObj.spawnEntityInWorld(new EntityXPOrb(this.worldObj, this.posX, this.posY, this.posZ, var5)); -@@ -462,28 +542,31 @@ - this.createEnderPortal(MathHelper.floor_double(this.posX), MathHelper.floor_double(this.posZ)); - this.setDead(); - } -- - } - -- private void createEnderPortal(int var1, int var2) { -+ /** -+ * Creates the ender portal leading back to the normal world after defeating the enderdragon. -+ */ -+ private void createEnderPortal(int par1, int par2) { - byte var3 = 64; - BlockEndPortal.bossDefeated = true; - byte var4 = 4; - -- for(int var5 = var3 - 1; var5 <= var3 + 32; ++var5) { -- for(int var6 = var1 - var4; var6 <= var1 + var4; ++var6) { -- for(int var7 = var2 - var4; var7 <= var2 + var4; ++var7) { -- double var8 = (double)(var6 - var1); -- double var10 = (double)(var7 - var2); -+ for (int var5 = var3 - 1; var5 <= var3 + 32; ++var5) { -+ for (int var6 = par1 - var4; var6 <= par1 + var4; ++var6) { -+ for (int var7 = par2 - var4; var7 <= par2 + var4; ++var7) { -+ double var8 = (double)(var6 - par1); -+ double var10 = (double)(var7 - par2); - double var12 = var8 * var8 + var10 * var10; -- if(var12 <= ((double)var4 - 0.5D) * ((double)var4 - 0.5D)) { -- if(var5 < var3) { -- if(var12 <= ((double)(var4 - 1) - 0.5D) * ((double)(var4 - 1) - 0.5D)) { -+ -+ if (var12 <= ((double)var4 - 0.5D) * ((double)var4 - 0.5D)) { -+ if (var5 < var3) { -+ if (var12 <= ((double)(var4 - 1) - 0.5D) * ((double)(var4 - 1) - 0.5D)) { - this.worldObj.setBlock(var6, var5, var7, Block.bedrock.blockID); - } -- } else if(var5 > var3) { -+ } else if (var5 > var3) { - this.worldObj.setBlock(var6, var5, var7, 0); -- } else if(var12 > ((double)(var4 - 1) - 0.5D) * ((double)(var4 - 1) - 0.5D)) { -+ } else if (var12 > ((double)(var4 - 1) - 0.5D) * ((double)(var4 - 1) - 0.5D)) { - this.worldObj.setBlock(var6, var5, var7, Block.bedrock.blockID); - } else { - this.worldObj.setBlock(var6, var5, var7, Block.endPortal.blockID); -@@ -493,25 +576,33 @@ - } - } - -- this.worldObj.setBlock(var1, var3 + 0, var2, Block.bedrock.blockID); -- this.worldObj.setBlock(var1, var3 + 1, var2, Block.bedrock.blockID); -- this.worldObj.setBlock(var1, var3 + 2, var2, Block.bedrock.blockID); -- this.worldObj.setBlock(var1 - 1, var3 + 2, var2, Block.torchWood.blockID); -- this.worldObj.setBlock(var1 + 1, var3 + 2, var2, Block.torchWood.blockID); -- this.worldObj.setBlock(var1, var3 + 2, var2 - 1, Block.torchWood.blockID); -- this.worldObj.setBlock(var1, var3 + 2, var2 + 1, Block.torchWood.blockID); -- this.worldObj.setBlock(var1, var3 + 3, var2, Block.bedrock.blockID); -- this.worldObj.setBlock(var1, var3 + 4, var2, Block.dragonEgg.blockID); -+ this.worldObj.setBlock(par1, var3 + 0, par2, Block.bedrock.blockID); -+ this.worldObj.setBlock(par1, var3 + 1, par2, Block.bedrock.blockID); -+ this.worldObj.setBlock(par1, var3 + 2, par2, Block.bedrock.blockID); -+ this.worldObj.setBlock(par1 - 1, var3 + 2, par2, Block.torchWood.blockID); -+ this.worldObj.setBlock(par1 + 1, var3 + 2, par2, Block.torchWood.blockID); -+ this.worldObj.setBlock(par1, var3 + 2, par2 - 1, Block.torchWood.blockID); -+ this.worldObj.setBlock(par1, var3 + 2, par2 + 1, Block.torchWood.blockID); -+ this.worldObj.setBlock(par1, var3 + 3, par2, Block.bedrock.blockID); -+ this.worldObj.setBlock(par1, var3 + 4, par2, Block.dragonEgg.blockID); - BlockEndPortal.bossDefeated = false; - } - -- protected void despawnEntity() { -- } -+ /** -+ * Makes the entity despawn if requirements are reached -+ */ -+ protected void despawnEntity() {} - -+ /** -+ * Return the Entity parts making up this Entity (currently only for dragons) -+ */ - public Entity[] getParts() { - return this.dragonPartArray; - } - -+ /** -+ * Returns true if other Entities should be prevented from moving through this Entity. -+ */ - public boolean canBeCollidedWith() { - return false; - } -@@ -520,14 +611,23 @@ - return this.worldObj; - } - -+ /** -+ * Returns the sound this mob makes while it's alive. -+ */ - protected String getLivingSound() { - return "mob.enderdragon.growl"; - } - -+ /** -+ * Returns the sound this mob makes when it is hurt. -+ */ - protected String getHurtSound() { - return "mob.enderdragon.hit"; - } - -+ /** -+ * Returns the volume for the sounds this mob makes. -+ */ - protected float getSoundVolume() { - return 5.0F; - } ---- net/minecraft/src/ComponentStrongholdStairsStraight.java -+++ net/minecraft/src/ComponentStrongholdStairsStraight.java -@@ -4,42 +4,49 @@ - import java.util.Random; - - public class ComponentStrongholdStairsStraight extends ComponentStronghold { -- public ComponentStrongholdStairsStraight() { -- } -- -- public ComponentStrongholdStairsStraight(int var1, Random var2, StructureBoundingBox var3, int var4) { -- super(var1); -- this.coordBaseMode = var4; -- this.field_143013_d = this.getRandomDoor(var2); -- this.boundingBox = var3; -- } -- -- public void buildComponent(StructureComponent var1, List var2, Random var3) { -- this.getNextComponentNormal((ComponentStrongholdStairs2)var1, var2, var3, 1, 1); -- } -- -- public static ComponentStrongholdStairsStraight findValidPlacement(List var0, Random var1, int var2, int var3, int var4, int var5, int var6) { -- StructureBoundingBox var7 = StructureBoundingBox.getComponentToAddBoundingBox(var2, var3, var4, -1, -7, 0, 5, 11, 8, var5); -- return canStrongholdGoDeeper(var7) && StructureComponent.findIntersecting(var0, var7) == null ? new ComponentStrongholdStairsStraight(var6, var1, var7, var5) : null; -- } -- -- public boolean addComponentParts(World var1, Random var2, StructureBoundingBox var3) { -- if(this.isLiquidInStructureBoundingBox(var1, var3)) { -+ public ComponentStrongholdStairsStraight() {} -+ -+ public ComponentStrongholdStairsStraight(int par1, Random par2Random, StructureBoundingBox par3StructureBoundingBox, int par4) { -+ super(par1); -+ this.coordBaseMode = par4; -+ this.field_143013_d = this.getRandomDoor(par2Random); -+ this.boundingBox = par3StructureBoundingBox; -+ } -+ -+ /** -+ * Initiates construction of the Structure Component picked, at the current Location of StructGen -+ */ -+ public void buildComponent(StructureComponent par1StructureComponent, List par2List, Random par3Random) { -+ this.getNextComponentNormal((ComponentStrongholdStairs2)par1StructureComponent, par2List, par3Random, 1, 1); -+ } -+ -+ public static ComponentStrongholdStairsStraight findValidPlacement(List par0List, Random par1Random, int par2, int par3, int par4, int par5, int par6) { -+ StructureBoundingBox var7 = StructureBoundingBox.getComponentToAddBoundingBox(par2, par3, par4, -1, -7, 0, 5, 11, 8, par5); -+ return canStrongholdGoDeeper(var7) && StructureComponent.findIntersecting(par0List, var7) == null ? new ComponentStrongholdStairsStraight(par6, par1Random, var7, par5) : null; -+ } -+ -+ /** -+ * second Part of Structure generating, this for example places Spiderwebs, Mob Spawners, it closes Mineshafts at the -+ * end, it adds Fences... -+ */ -+ public boolean addComponentParts(World par1World, Random par2Random, StructureBoundingBox par3StructureBoundingBox) { -+ if (this.isLiquidInStructureBoundingBox(par1World, par3StructureBoundingBox)) { - return false; - } else { -- this.fillWithRandomizedBlocks(var1, var3, 0, 0, 0, 4, 10, 7, true, var2, StructureStrongholdPieces.getStrongholdStones()); -- this.placeDoor(var1, var2, var3, this.field_143013_d, 1, 7, 0); -- this.placeDoor(var1, var2, var3, EnumDoor.OPENING, 1, 1, 7); -+ this.fillWithRandomizedBlocks(par1World, par3StructureBoundingBox, 0, 0, 0, 4, 10, 7, true, par2Random, StructureStrongholdPieces.getStrongholdStones()); -+ this.placeDoor(par1World, par2Random, par3StructureBoundingBox, this.field_143013_d, 1, 7, 0); -+ this.placeDoor(par1World, par2Random, par3StructureBoundingBox, EnumDoor.OPENING, 1, 1, 7); - int var4 = this.getMetadataWithOffset(Block.stairsCobblestone.blockID, 2); - -- for(int var5 = 0; var5 < 6; ++var5) { -- this.placeBlockAtCurrentPosition(var1, Block.stairsCobblestone.blockID, var4, 1, 6 - var5, 1 + var5, var3); -- this.placeBlockAtCurrentPosition(var1, Block.stairsCobblestone.blockID, var4, 2, 6 - var5, 1 + var5, var3); -- this.placeBlockAtCurrentPosition(var1, Block.stairsCobblestone.blockID, var4, 3, 6 - var5, 1 + var5, var3); -- if(var5 < 5) { -- this.placeBlockAtCurrentPosition(var1, Block.stoneBrick.blockID, 0, 1, 5 - var5, 1 + var5, var3); -- this.placeBlockAtCurrentPosition(var1, Block.stoneBrick.blockID, 0, 2, 5 - var5, 1 + var5, var3); -- this.placeBlockAtCurrentPosition(var1, Block.stoneBrick.blockID, 0, 3, 5 - var5, 1 + var5, var3); -+ for (int var5 = 0; var5 < 6; ++var5) { -+ this.placeBlockAtCurrentPosition(par1World, Block.stairsCobblestone.blockID, var4, 1, 6 - var5, 1 + var5, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.stairsCobblestone.blockID, var4, 2, 6 - var5, 1 + var5, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.stairsCobblestone.blockID, var4, 3, 6 - var5, 1 + var5, par3StructureBoundingBox); -+ -+ if (var5 < 5) { -+ this.placeBlockAtCurrentPosition(par1World, Block.stoneBrick.blockID, 0, 1, 5 - var5, 1 + var5, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.stoneBrick.blockID, 0, 2, 5 - var5, 1 + var5, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.stoneBrick.blockID, 0, 3, 5 - var5, 1 + var5, par3StructureBoundingBox); - } - } - ---- /dev/null -+++ org/spoutcraft/client/io/DownloadAssets.java -@@ -1,0 +1,158 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.client.io; -+ -+import java.io.File; -+import java.io.FileNotFoundException; -+import java.io.IOException; -+import java.net.HttpURLConnection; -+import java.net.URL; -+import java.net.URLDecoder; -+ -+import org.apache.commons.io.FileUtils; -+ -+import org.spoutcraft.client.io.CustomTextureManager; -+import org.spoutcraft.client.io.FileUtil; -+ -+public class DownloadAssets { -+ public static void getHttpAssets() { -+ // Get dynamic assets from web -+ downloadFile(FileUtil.getConfigDir(), "vip.yml", "http://solder.inspirenxe.org/resources/spoutcraft/vip.yml", true); -+ downloadFile(FileUtil.getConfigDir(), "servers.yml", "http://solder.inspirenxe.org/resources/spoutcraft/servers.yml", true); -+ downloadFile(FileUtil.getConfigDir(), "special.yml", "http://solder.inspirenxe.org/resources/spoutcraft/special.yml", false); -+ downloadFile(FileUtil.getConfigDir(), "splashes.txt", "http://solder.inspirenxe.org/resources/spoutcraft/splashes.txt", false); -+ } -+ -+ public static void importOldConfig() { -+ // This method must execute before constructores creates blank ones. -+ String pathToOldConfig; -+ File jar = new File(CustomTextureManager.class.getProtectionDomain().getCodeSource().getLocation().getFile()); -+ try { -+ pathToOldConfig = jar.getCanonicalPath(); -+ } catch (IOException e1) { -+ pathToOldConfig = jar.getAbsolutePath(); -+ } -+ try { -+ pathToOldConfig = URLDecoder.decode(pathToOldConfig, "UTF-8"); -+ } catch (java.io.UnsupportedEncodingException ignore) { } -+ -+ File relative = new File(pathToOldConfig + "/../../../../../.spoutcraft/config"); -+ -+ try { -+ pathToOldConfig = relative.getCanonicalPath(); -+ } catch (IOException e) { -+ pathToOldConfig = relative.getAbsolutePath(); -+ } -+ -+ try { -+ if (!(new File(FileUtil.getConfigDir() + "/bindings.yml").exists())) { -+ File newFile = new File(FileUtil.getConfigDir() + "/bindings.yml"); -+ File oldFile = new File(pathToOldConfig + "/bindings.yml"); -+ if (oldFile.exists()) { -+ FileUtils.moveFile(oldFile, newFile); -+ } -+ } -+ -+ if (!(new File(FileUtil.getConfigDir() + "/client.yml").exists())) { -+ File newFile = new File(FileUtil.getConfigDir() + "/client.yml"); -+ File oldFile = new File(pathToOldConfig + "/client.yml"); -+ if (oldFile.exists()) { -+ FileUtils.moveFile(oldFile, newFile); -+ } -+ } -+ -+ if (!(new File(FileUtil.getConfigDir() + "/favorites.yml").exists())) { -+ File newFile = new File(FileUtil.getConfigDir() + "/favorites.yml"); -+ File oldFile = new File(pathToOldConfig + "/favorites.yml"); -+ if (oldFile.exists()) { -+ FileUtils.moveFile(oldFile, newFile); -+ } -+ } -+ -+ if (!(new File(FileUtil.getConfigDir() + "/minimap.yml").exists())) { -+ File newFile = new File(FileUtil.getConfigDir() + "/minimap.yml"); -+ File oldFile = new File(pathToOldConfig + "/minimap.yml"); -+ if (oldFile.exists()) { -+ FileUtils.moveFile(oldFile, newFile); -+ } -+ } -+ -+ if (!(new File(FileUtil.getConfigDir() + "/shortcuts.yml").exists())) { -+ File newFile = new File(FileUtil.getConfigDir() + "/shortcuts.yml"); -+ File oldFile = new File(pathToOldConfig + "/shortcuts.yml"); -+ if (oldFile.exists()) { -+ FileUtils.copyFile(oldFile, newFile); -+ } -+ } -+ } catch (Exception e) { -+ e.printStackTrace(); -+ } -+ -+ relative = new File(pathToOldConfig + "/.."); -+ -+ -+ try { -+ pathToOldConfig = relative.getCanonicalPath(); -+ } catch (IOException e) { -+ pathToOldConfig = relative.getAbsolutePath(); -+ } -+ -+ try { -+ if (!(new File(FileUtil.getSpoutcraftBaseDir() + "/options.txt").exists())) { -+ File newFile = new File(FileUtil.getSpoutcraftBaseDir() + "/options.txt"); -+ File oldFile = new File(pathToOldConfig + "/options.txt"); -+ if (oldFile.exists()) { -+ FileUtils.copyFile(oldFile, newFile); -+ } -+ } -+ } catch (Exception e) { -+ e.printStackTrace(); -+ } -+ } -+ -+ public static void threadedDownloadFile(File destination, String filename, String url) { -+ Download download = new Download(filename, destination, url, null); -+ FileDownloadThread.getInstance().addToDownloadQueue(download); -+ } -+ -+ public static void downloadFile(File destination, String filename, String url, boolean forceOverwrite) { -+ File getFile = new File(destination, File.separator + filename); -+ // Refresh every day if file exists and not forced overwrite. -+ if (!getFile.exists() || forceOverwrite || (System.currentTimeMillis() - getFile.lastModified() > (1L * 24 * 60 * 60 * 1000))) { -+ try { -+ URL test = new URL(url); -+ HttpURLConnection urlConnect = (HttpURLConnection) test.openConnection(); -+ System.setProperty("http.agent", ""); -+ urlConnect.setRequestProperty("User-Agent", "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/535.19 (KHTML, like Gecko) Chrome/18.0.1025.162 Safari/535.19"); -+ File temp = new File(FileUtil.getConfigDir(), "getFile.temp"); -+ if (temp.exists()) { -+ temp.delete(); -+ } -+ -+ boolean deletedFile = getFile.delete(); -+ -+ FileUtils.copyInputStreamToFile(urlConnect.getInputStream(), temp); -+ FileUtils.moveFile(temp, getFile); -+ } catch (Exception e) { -+ e.printStackTrace(); -+ } -+ } -+ } -+} ---- net/minecraft/src/GuiScreenMcoWorldTemplateSelectionList.java -+++ net/minecraft/src/GuiScreenMcoWorldTemplateSelectionList.java -@@ -3,27 +3,36 @@ - class GuiScreenMcoWorldTemplateSelectionList extends GuiScreenSelectLocation { - final GuiScreenMcoWorldTemplate field_111245_a; - -- public GuiScreenMcoWorldTemplateSelectionList(GuiScreenMcoWorldTemplate var1) { -- super(GuiScreenMcoWorldTemplate.func_130066_c(var1), var1.width, var1.height, 32, var1.height - 64, 36); -- this.field_111245_a = var1; -+ public GuiScreenMcoWorldTemplateSelectionList(GuiScreenMcoWorldTemplate par1GuiScreenMcoWorldTemplate) { -+ super(GuiScreenMcoWorldTemplate.func_130066_c(par1GuiScreenMcoWorldTemplate), par1GuiScreenMcoWorldTemplate.width, par1GuiScreenMcoWorldTemplate.height, 32, par1GuiScreenMcoWorldTemplate.height - 64, 36); -+ this.field_111245_a = par1GuiScreenMcoWorldTemplate; - } - -+ /** -+ * Gets the size of the current slot list. -+ */ - protected int getSize() { - return GuiScreenMcoWorldTemplate.func_110395_c(this.field_111245_a).size() + 1; - } - -- protected void elementClicked(int var1, boolean var2) { -- if(var1 < GuiScreenMcoWorldTemplate.func_110395_c(this.field_111245_a).size()) { -- GuiScreenMcoWorldTemplate.func_130064_a(this.field_111245_a, var1); -+ /** -+ * the element in the slot that was clicked, boolean for wether it was double clicked or not -+ */ -+ protected void elementClicked(int par1, boolean par2) { -+ if (par1 < GuiScreenMcoWorldTemplate.func_110395_c(this.field_111245_a).size()) { -+ GuiScreenMcoWorldTemplate.func_130064_a(this.field_111245_a, par1); - GuiScreenMcoWorldTemplate.func_130065_a(this.field_111245_a, (WorldTemplate)null); - } - } - -- protected boolean isSelected(int var1) { -- return GuiScreenMcoWorldTemplate.func_110395_c(this.field_111245_a).size() == 0 ? false : (var1 >= GuiScreenMcoWorldTemplate.func_110395_c(this.field_111245_a).size() ? false : (GuiScreenMcoWorldTemplate.func_130067_e(this.field_111245_a) != null ? GuiScreenMcoWorldTemplate.func_130067_e(this.field_111245_a).b.equals(((WorldTemplate)GuiScreenMcoWorldTemplate.func_110395_c(this.field_111245_a).get(var1)).b) : var1 == GuiScreenMcoWorldTemplate.func_130062_f(this.field_111245_a))); -+ /** -+ * returns true if the element passed in is currently selected -+ */ -+ protected boolean isSelected(int par1) { -+ return GuiScreenMcoWorldTemplate.func_110395_c(this.field_111245_a).size() == 0 ? false : (par1 >= GuiScreenMcoWorldTemplate.func_110395_c(this.field_111245_a).size() ? false : (GuiScreenMcoWorldTemplate.func_130067_e(this.field_111245_a) != null ? GuiScreenMcoWorldTemplate.func_130067_e(this.field_111245_a).field_110732_b.equals(((WorldTemplate)GuiScreenMcoWorldTemplate.func_110395_c(this.field_111245_a).get(par1)).field_110732_b) : par1 == GuiScreenMcoWorldTemplate.func_130062_f(this.field_111245_a))); - } - -- protected boolean func_104086_b(int var1) { -+ protected boolean func_104086_b(int par1) { - return false; - } - -@@ -35,17 +44,16 @@ - this.field_111245_a.drawDefaultBackground(); - } - -- protected void drawSlot(int var1, int var2, int var3, int var4, Tessellator var5) { -- if(var1 < GuiScreenMcoWorldTemplate.func_110395_c(this.field_111245_a).size()) { -- this.func_111244_b(var1, var2, var3, var4, var5); -+ protected void drawSlot(int par1, int par2, int par3, int par4, Tessellator par5Tessellator) { -+ if (par1 < GuiScreenMcoWorldTemplate.func_110395_c(this.field_111245_a).size()) { -+ this.func_111244_b(par1, par2, par3, par4, par5Tessellator); - } -- - } - -- private void func_111244_b(int var1, int var2, int var3, int var4, Tessellator var5) { -- WorldTemplate var6 = (WorldTemplate)GuiScreenMcoWorldTemplate.func_110395_c(this.field_111245_a).get(var1); -- this.field_111245_a.drawString(GuiScreenMcoWorldTemplate.func_110389_g(this.field_111245_a), var6.b, var2 + 2, var3 + 1, 16777215); -- this.field_111245_a.drawString(GuiScreenMcoWorldTemplate.func_110387_h(this.field_111245_a), var6.d, var2 + 2, var3 + 12, 7105644); -- this.field_111245_a.drawString(GuiScreenMcoWorldTemplate.func_110384_i(this.field_111245_a), var6.c, var2 + 2 + 207 - GuiScreenMcoWorldTemplate.func_130063_j(this.field_111245_a).getStringWidth(var6.c), var3 + 1, 5000268); -+ private void func_111244_b(int par1, int par2, int par3, int par4, Tessellator par5Tessellator) { -+ WorldTemplate var6 = (WorldTemplate)GuiScreenMcoWorldTemplate.func_110395_c(this.field_111245_a).get(par1); -+ this.field_111245_a.drawString(GuiScreenMcoWorldTemplate.func_110389_g(this.field_111245_a), var6.field_110732_b, par2 + 2, par3 + 1, 16777215); -+ this.field_111245_a.drawString(GuiScreenMcoWorldTemplate.func_110387_h(this.field_111245_a), var6.field_110731_d, par2 + 2, par3 + 12, 7105644); -+ this.field_111245_a.drawString(GuiScreenMcoWorldTemplate.func_110384_i(this.field_111245_a), var6.field_110733_c, par2 + 2 + 207 - GuiScreenMcoWorldTemplate.func_130063_j(this.field_111245_a).getStringWidth(var6.field_110733_c), par3 + 1, 5000268); - } - } ---- net/minecraft/src/ItemHoe.java -+++ net/minecraft/src/ItemHoe.java -@@ -3,28 +3,34 @@ - public class ItemHoe extends Item { - protected EnumToolMaterial theToolMaterial; - -- public ItemHoe(int var1, EnumToolMaterial var2) { -- super(var1); -- this.theToolMaterial = var2; -+ public ItemHoe(int par1, EnumToolMaterial par2EnumToolMaterial) { -+ super(par1); -+ this.theToolMaterial = par2EnumToolMaterial; - this.maxStackSize = 1; -- this.setMaxDamage(var2.getMaxUses()); -+ this.setMaxDamage(par2EnumToolMaterial.getMaxUses()); - this.setCreativeTab(CreativeTabs.tabTools); - } - -- public boolean onItemUse(ItemStack var1, EntityPlayer var2, World var3, int var4, int var5, int var6, int var7, float var8, float var9, float var10) { -- if(!var2.canPlayerEdit(var4, var5, var6, var7, var1)) { -+ /** -+ * Callback for item usage. If the item does something special on right clicking, he will have one of those. Return -+ * True if something happen and false if it don't. This is for ITEMS, not BLOCKS -+ */ -+ public boolean onItemUse(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, World par3World, int par4, int par5, int par6, int par7, float par8, float par9, float par10) { -+ if (!par2EntityPlayer.canPlayerEdit(par4, par5, par6, par7, par1ItemStack)) { - return false; - } else { -- int var11 = var3.getBlockId(var4, var5, var6); -- int var12 = var3.getBlockId(var4, var5 + 1, var6); -- if(var7 != 0 && var12 == 0 && (var11 == Block.grass.blockID || var11 == Block.dirt.blockID)) { -+ int var11 = par3World.getBlockId(par4, par5, par6); -+ int var12 = par3World.getBlockId(par4, par5 + 1, par6); -+ -+ if (par7 != 0 && var12 == 0 && (var11 == Block.grass.blockID || var11 == Block.dirt.blockID)) { - Block var13 = Block.tilledField; -- var3.playSoundEffect((double)((float)var4 + 0.5F), (double)((float)var5 + 0.5F), (double)((float)var6 + 0.5F), var13.stepSound.getStepSound(), (var13.stepSound.getVolume() + 1.0F) / 2.0F, var13.stepSound.getPitch() * 0.8F); -- if(var3.isRemote) { -+ par3World.playSoundEffect((double)((float)par4 + 0.5F), (double)((float)par5 + 0.5F), (double)((float)par6 + 0.5F), var13.stepSound.getStepSound(), (var13.stepSound.getVolume() + 1.0F) / 2.0F, var13.stepSound.getPitch() * 0.8F); -+ -+ if (par3World.isRemote) { - return true; - } else { -- var3.setBlock(var4, var5, var6, var13.blockID); -- var1.damageItem(1, var2); -+ par3World.setBlock(par4, par5, par6, var13.blockID); -+ par1ItemStack.damageItem(1, par2EntityPlayer); - return true; - } - } else { -@@ -33,10 +39,17 @@ - } - } - -+ /** -+ * Returns True is the item is renderer in full 3D when hold. -+ */ - public boolean isFull3D() { - return true; - } - -+ /** -+ * Returns the name of the material this tool is made from as it is declared in EnumToolMaterial (meaning diamond would -+ * return "EMERALD") -+ */ - public String getMaterialName() { - return this.theToolMaterial.toString(); - } ---- net/minecraft/src/GenLayerFuzzyZoom.java -+++ net/minecraft/src/GenLayerFuzzyZoom.java -@@ -1,28 +1,32 @@ - package net.minecraft.src; - - public class GenLayerFuzzyZoom extends GenLayer { -- public GenLayerFuzzyZoom(long var1, GenLayer var3) { -- super(var1); -- super.parent = var3; -+ public GenLayerFuzzyZoom(long par1, GenLayer par3GenLayer) { -+ super(par1); -+ super.parent = par3GenLayer; - } - -- public int[] getInts(int var1, int var2, int var3, int var4) { -- int var5 = var1 >> 1; -- int var6 = var2 >> 1; -- int var7 = (var3 >> 1) + 3; -- int var8 = (var4 >> 1) + 3; -+ /** -+ * Returns a list of integer values generated by this layer. These may be interpreted as temperatures, rainfall -+ * amounts, or biomeList[] indices based on the particular GenLayer subclass. -+ */ -+ public int[] getInts(int par1, int par2, int par3, int par4) { -+ int var5 = par1 >> 1; -+ int var6 = par2 >> 1; -+ int var7 = (par3 >> 1) + 3; -+ int var8 = (par4 >> 1) + 3; - int[] var9 = this.parent.getInts(var5, var6, var7, var8); - int[] var10 = IntCache.getIntCache(var7 * 2 * var8 * 2); - int var11 = var7 << 1; -- - int var13; -- for(int var12 = 0; var12 < var8 - 1; ++var12) { -+ -+ for (int var12 = 0; var12 < var8 - 1; ++var12) { - var13 = var12 << 1; - int var14 = var13 * var11; - int var15 = var9[0 + (var12 + 0) * var7]; - int var16 = var9[0 + (var12 + 1) * var7]; - -- for(int var17 = 0; var17 < var7 - 1; ++var17) { -+ for (int var17 = 0; var17 < var7 - 1; ++var17) { - this.initChunkSeed((long)(var17 + var5 << 1), (long)(var12 + var6 << 1)); - int var18 = var9[var17 + 1 + (var12 + 0) * var7]; - int var19 = var9[var17 + 1 + (var12 + 1) * var7]; -@@ -35,21 +39,27 @@ - } - } - -- int[] var20 = IntCache.getIntCache(var3 * var4); -+ int[] var20 = IntCache.getIntCache(par3 * par4); - -- for(var13 = 0; var13 < var4; ++var13) { -- System.arraycopy(var10, (var13 + (var2 & 1)) * (var7 << 1) + (var1 & 1), var20, var13 * var3, var3); -+ for (var13 = 0; var13 < par4; ++var13) { -+ System.arraycopy(var10, (var13 + (par2 & 1)) * (var7 << 1) + (par1 & 1), var20, var13 * par3, par3); - } - - return var20; - } - -- protected int choose(int var1, int var2) { -- return this.nextInt(2) == 0 ? var1 : var2; -+ /** -+ * randomly choose between the two args -+ */ -+ protected int choose(int par1, int par2) { -+ return this.nextInt(2) == 0 ? par1 : par2; - } - -- protected int choose(int var1, int var2, int var3, int var4) { -+ /** -+ * randomly choose between the four args -+ */ -+ protected int choose(int par1, int par2, int par3, int par4) { - int var5 = this.nextInt(4); -- return var5 == 0 ? var1 : (var5 == 1 ? var2 : (var5 == 2 ? var3 : var4)); -+ return var5 == 0 ? par1 : (var5 == 1 ? par2 : (var5 == 2 ? par3 : par4)); - } - } ---- net/minecraft/src/AnvilConverterData.java -+++ net/minecraft/src/AnvilConverterData.java -@@ -14,8 +14,8 @@ - public final int x; - public final int z; - -- public AnvilConverterData(int var1, int var2) { -- this.x = var1; -- this.z = var2; -+ public AnvilConverterData(int par1, int par2) { -+ this.x = par1; -+ this.z = par2; - } - } ---- net/minecraft/src/GuiScreenResetWorld.java -+++ net/minecraft/src/GuiScreenResetWorld.java -@@ -12,69 +12,82 @@ - private WorldTemplate field_110359_q; - private GuiButton field_96154_o; - -- public GuiScreenResetWorld(GuiScreen var1, McoServer var2) { -- this.field_96152_a = var1; -- this.field_96150_b = var2; -+ public GuiScreenResetWorld(GuiScreen par1GuiScreen, McoServer par2McoServer) { -+ this.field_96152_a = par1GuiScreen; -+ this.field_96150_b = par2McoServer; - } - -+ /** -+ * Called from the main game loop to update the screen. -+ */ - public void updateScreen() { - this.field_96151_c.updateCursorCounter(); - } - -+ /** -+ * Adds the buttons (and other controls) to the screen in question. -+ */ - public void initGui() { - Keyboard.enableRepeatEvents(true); -- this.i.clear(); -- this.i.add(this.field_96154_o = new GuiButton(1, this.width / 2 - 100, this.height / 4 + 120 + 12, 97, 20, I18n.getString("mco.configure.world.buttons.reset"))); -- this.i.add(new GuiButton(2, this.width / 2 + 5, this.height / 4 + 120 + 12, 97, 20, I18n.getString("gui.cancel"))); -+ this.buttonList.clear(); -+ this.buttonList.add(this.field_96154_o = new GuiButton(1, this.width / 2 - 100, this.height / 4 + 120 + 12, 97, 20, I18n.getString("mco.configure.world.buttons.reset"))); -+ this.buttonList.add(new GuiButton(2, this.width / 2 + 5, this.height / 4 + 120 + 12, 97, 20, I18n.getString("gui.cancel"))); - this.field_96151_c = new GuiTextField(this.fontRenderer, this.width / 2 - 100, 99, 200, 20); - this.field_96151_c.setFocused(true); - this.field_96151_c.setMaxStringLength(32); - this.field_96151_c.setText(""); -- if(this.field_110359_q == null) { -- this.i.add(new GuiButton(field_110360_p, this.width / 2 - 100, 125, 200, 20, I18n.getString("mco.template.default.name"))); -+ -+ if (this.field_110359_q == null) { -+ this.buttonList.add(new GuiButton(field_110360_p, this.width / 2 - 100, 125, 200, 20, I18n.getString("mco.template.default.name"))); - } else { - this.field_96151_c.setText(""); - this.field_96151_c.setEnabled(false); - this.field_96151_c.setFocused(false); -- this.i.add(new GuiButton(field_110360_p, this.width / 2 - 100, 125, 200, 20, I18n.getString("mco.template.name") + ": " + this.field_110359_q.b)); -+ this.buttonList.add(new GuiButton(field_110360_p, this.width / 2 - 100, 125, 200, 20, I18n.getString("mco.template.name") + ": " + this.field_110359_q.field_110732_b)); - } -- - } - -+ /** -+ * Called when the screen is unloaded. Used to disable keyboard repeat events -+ */ - public void onGuiClosed() { - Keyboard.enableRepeatEvents(false); - } - -- protected void keyTyped(char var1, int var2) { -- this.field_96151_c.textboxKeyTyped(var1, var2); -- if(var2 == 28 || var2 == 156) { -+ /** -+ * Fired when a key is typed. This is the equivalent of KeyListener.keyTyped(KeyEvent e). -+ */ -+ protected void keyTyped(char par1, int par2) { -+ this.field_96151_c.textboxKeyTyped(par1, par2); -+ -+ if (par2 == 28 || par2 == 156) { - this.actionPerformed(this.field_96154_o); - } -- - } - -- protected void actionPerformed(GuiButton var1) { -- if(var1.enabled) { -- if(var1.id == 2) { -+ /** -+ * Fired when a control is clicked. This is the equivalent of ActionListener.actionPerformed(ActionEvent e). -+ */ -+ protected void actionPerformed(GuiButton par1GuiButton) { -+ if (par1GuiButton.enabled) { -+ if (par1GuiButton.id == 2) { - this.mc.displayGuiScreen(this.field_96152_a); -- } else if(var1.id == 1) { -+ } else if (par1GuiButton.id == 1) { - String var2 = I18n.getString("mco.configure.world.reset.question.line1"); - String var3 = I18n.getString("mco.configure.world.reset.question.line2"); - this.mc.displayGuiScreen(new GuiScreenConfirmation(this, GuiScreenConfirmationType.Warning, var2, var3, 1)); -- } else if(var1.id == field_110360_p) { -+ } else if (par1GuiButton.id == field_110360_p) { - this.mc.displayGuiScreen(new GuiScreenMcoWorldTemplate(this, this.field_110359_q)); - } -- - } - } - -- public void confirmClicked(boolean var1, int var2) { -- if(var1 && var2 == 1) { -+ public void confirmClicked(boolean par1, int par2) { -+ if (par1 && par2 == 1) { - this.func_140006_g(); - } else { - this.mc.displayGuiScreen(this); - } -- - } - - private void func_140006_g() { -@@ -84,41 +97,47 @@ - this.mc.displayGuiScreen(var2); - } - -- protected void mouseClicked(int var1, int var2, int var3) { -- super.mouseClicked(var1, var2, var3); -- this.field_96151_c.mouseClicked(var1, var2, var3); -+ /** -+ * Called when the mouse is clicked. -+ */ -+ protected void mouseClicked(int par1, int par2, int par3) { -+ super.mouseClicked(par1, par2, par3); -+ this.field_96151_c.mouseClicked(par1, par2, par3); - } - -- public void drawScreen(int var1, int var2, float var3) { -+ /** -+ * Draws the screen and all the components in it. -+ */ -+ public void drawScreen(int par1, int par2, float par3) { - this.drawDefaultBackground(); - this.drawCenteredString(this.fontRenderer, I18n.getString("mco.reset.world.title"), this.width / 2, 17, 16777215); - this.drawCenteredString(this.fontRenderer, I18n.getString("mco.reset.world.warning"), this.width / 2, 56, 16711680); - this.drawString(this.fontRenderer, I18n.getString("mco.reset.world.seed"), this.width / 2 - 100, 86, 10526880); - this.field_96151_c.drawTextBox(); -- super.drawScreen(var1, var2, var3); -- } -- -- void func_110358_a(WorldTemplate var1) { -- this.field_110359_q = var1; -- } -- -- void func_110354_a(Object var1) { -- this.func_110358_a((WorldTemplate)var1); -- } -- -- static GuiScreen func_96148_a(GuiScreenResetWorld var0) { -- return var0.field_96152_a; -- } -- -- static Minecraft func_96147_b(GuiScreenResetWorld var0) { -- return var0.mc; -- } -- -- static Minecraft func_130025_c(GuiScreenResetWorld var0) { -- return var0.mc; -- } -- -- static Minecraft func_130024_d(GuiScreenResetWorld var0) { -- return var0.mc; -+ super.drawScreen(par1, par2, par3); -+ } -+ -+ void func_110358_a(WorldTemplate par1WorldTemplate) { -+ this.field_110359_q = par1WorldTemplate; -+ } -+ -+ void func_110354_a(Object par1Obj) { -+ this.func_110358_a((WorldTemplate)par1Obj); -+ } -+ -+ static GuiScreen func_96148_a(GuiScreenResetWorld par0GuiScreenResetWorld) { -+ return par0GuiScreenResetWorld.field_96152_a; -+ } -+ -+ static Minecraft func_96147_b(GuiScreenResetWorld par0GuiScreenResetWorld) { -+ return par0GuiScreenResetWorld.mc; -+ } -+ -+ static Minecraft func_130025_c(GuiScreenResetWorld par0GuiScreenResetWorld) { -+ return par0GuiScreenResetWorld.mc; -+ } -+ -+ static Minecraft func_130024_d(GuiScreenResetWorld par0GuiScreenResetWorld) { -+ return par0GuiScreenResetWorld.mc; - } - } ---- net/minecraft/src/ComponentMineshaftRoom.java -+++ net/minecraft/src/ComponentMineshaftRoom.java -@@ -6,116 +6,132 @@ - import java.util.Random; - - public class ComponentMineshaftRoom extends StructureComponent { -- private List a = new LinkedList(); -- -- public ComponentMineshaftRoom() { -- } -- -- public ComponentMineshaftRoom(int var1, Random var2, int var3, int var4) { -- super(var1); -- this.boundingBox = new StructureBoundingBox(var3, 50, var4, var3 + 7 + var2.nextInt(6), 54 + var2.nextInt(6), var4 + 7 + var2.nextInt(6)); -- } -- -- public void buildComponent(StructureComponent var1, List var2, Random var3) { -+ -+ /** List of other Mineshaft components linked to this room. */ -+ private List roomsLinkedToTheRoom = new LinkedList(); -+ -+ public ComponentMineshaftRoom() {} -+ -+ public ComponentMineshaftRoom(int par1, Random par2Random, int par3, int par4) { -+ super(par1); -+ this.boundingBox = new StructureBoundingBox(par3, 50, par4, par3 + 7 + par2Random.nextInt(6), 54 + par2Random.nextInt(6), par4 + 7 + par2Random.nextInt(6)); -+ } -+ -+ /** -+ * Initiates construction of the Structure Component picked, at the current Location of StructGen -+ */ -+ public void buildComponent(StructureComponent par1StructureComponent, List par2List, Random par3Random) { - int var4 = this.getComponentType(); - int var6 = this.boundingBox.getYSize() - 3 - 1; -- if(var6 <= 0) { -+ -+ if (var6 <= 0) { - var6 = 1; - } - - int var5; - StructureComponent var7; - StructureBoundingBox var8; -- for(var5 = 0; var5 < this.boundingBox.getXSize(); var5 += 4) { -- var5 += var3.nextInt(this.boundingBox.getXSize()); -- if(var5 + 3 > this.boundingBox.getXSize()) { -- break; -- } -- -- var7 = StructureMineshaftPieces.getNextComponent(var1, var2, var3, this.boundingBox.minX + var5, this.boundingBox.minY + var3.nextInt(var6) + 1, this.boundingBox.minZ - 1, 2, var4); -- if(var7 != null) { -- var8 = var7.getBoundingBox(); -- this.a.add(new StructureBoundingBox(var8.minX, var8.minY, this.boundingBox.minZ, var8.maxX, var8.maxY, this.boundingBox.minZ + 1)); -- } -- } -- -- for(var5 = 0; var5 < this.boundingBox.getXSize(); var5 += 4) { -- var5 += var3.nextInt(this.boundingBox.getXSize()); -- if(var5 + 3 > this.boundingBox.getXSize()) { -- break; -- } -- -- var7 = StructureMineshaftPieces.getNextComponent(var1, var2, var3, this.boundingBox.minX + var5, this.boundingBox.minY + var3.nextInt(var6) + 1, this.boundingBox.maxZ + 1, 0, var4); -- if(var7 != null) { -- var8 = var7.getBoundingBox(); -- this.a.add(new StructureBoundingBox(var8.minX, var8.minY, this.boundingBox.maxZ - 1, var8.maxX, var8.maxY, this.boundingBox.maxZ)); -- } -- } -- -- for(var5 = 0; var5 < this.boundingBox.getZSize(); var5 += 4) { -- var5 += var3.nextInt(this.boundingBox.getZSize()); -- if(var5 + 3 > this.boundingBox.getZSize()) { -- break; -- } -- -- var7 = StructureMineshaftPieces.getNextComponent(var1, var2, var3, this.boundingBox.minX - 1, this.boundingBox.minY + var3.nextInt(var6) + 1, this.boundingBox.minZ + var5, 1, var4); -- if(var7 != null) { -- var8 = var7.getBoundingBox(); -- this.a.add(new StructureBoundingBox(this.boundingBox.minX, var8.minY, var8.minZ, this.boundingBox.minX + 1, var8.maxY, var8.maxZ)); -- } -- } -- -- for(var5 = 0; var5 < this.boundingBox.getZSize(); var5 += 4) { -- var5 += var3.nextInt(this.boundingBox.getZSize()); -- if(var5 + 3 > this.boundingBox.getZSize()) { -- break; -- } -- -- var7 = StructureMineshaftPieces.getNextComponent(var1, var2, var3, this.boundingBox.maxX + 1, this.boundingBox.minY + var3.nextInt(var6) + 1, this.boundingBox.minZ + var5, 3, var4); -- if(var7 != null) { -- var8 = var7.getBoundingBox(); -- this.a.add(new StructureBoundingBox(this.boundingBox.maxX - 1, var8.minY, var8.minZ, this.boundingBox.maxX, var8.maxY, var8.maxZ)); -- } -- } -- -+ -+ for (var5 = 0; var5 < this.boundingBox.getXSize(); var5 += 4) { -+ var5 += par3Random.nextInt(this.boundingBox.getXSize()); -+ -+ if (var5 + 3 > this.boundingBox.getXSize()) { -+ break; -+ } -+ -+ var7 = StructureMineshaftPieces.getNextComponent(par1StructureComponent, par2List, par3Random, this.boundingBox.minX + var5, this.boundingBox.minY + par3Random.nextInt(var6) + 1, this.boundingBox.minZ - 1, 2, var4); -+ -+ if (var7 != null) { -+ var8 = var7.getBoundingBox(); -+ this.roomsLinkedToTheRoom.add(new StructureBoundingBox(var8.minX, var8.minY, this.boundingBox.minZ, var8.maxX, var8.maxY, this.boundingBox.minZ + 1)); -+ } -+ } -+ -+ for (var5 = 0; var5 < this.boundingBox.getXSize(); var5 += 4) { -+ var5 += par3Random.nextInt(this.boundingBox.getXSize()); -+ -+ if (var5 + 3 > this.boundingBox.getXSize()) { -+ break; -+ } -+ -+ var7 = StructureMineshaftPieces.getNextComponent(par1StructureComponent, par2List, par3Random, this.boundingBox.minX + var5, this.boundingBox.minY + par3Random.nextInt(var6) + 1, this.boundingBox.maxZ + 1, 0, var4); -+ -+ if (var7 != null) { -+ var8 = var7.getBoundingBox(); -+ this.roomsLinkedToTheRoom.add(new StructureBoundingBox(var8.minX, var8.minY, this.boundingBox.maxZ - 1, var8.maxX, var8.maxY, this.boundingBox.maxZ)); -+ } -+ } -+ -+ for (var5 = 0; var5 < this.boundingBox.getZSize(); var5 += 4) { -+ var5 += par3Random.nextInt(this.boundingBox.getZSize()); -+ -+ if (var5 + 3 > this.boundingBox.getZSize()) { -+ break; -+ } -+ -+ var7 = StructureMineshaftPieces.getNextComponent(par1StructureComponent, par2List, par3Random, this.boundingBox.minX - 1, this.boundingBox.minY + par3Random.nextInt(var6) + 1, this.boundingBox.minZ + var5, 1, var4); -+ -+ if (var7 != null) { -+ var8 = var7.getBoundingBox(); -+ this.roomsLinkedToTheRoom.add(new StructureBoundingBox(this.boundingBox.minX, var8.minY, var8.minZ, this.boundingBox.minX + 1, var8.maxY, var8.maxZ)); -+ } -+ } -+ -+ for (var5 = 0; var5 < this.boundingBox.getZSize(); var5 += 4) { -+ var5 += par3Random.nextInt(this.boundingBox.getZSize()); -+ -+ if (var5 + 3 > this.boundingBox.getZSize()) { -+ break; -+ } -+ -+ var7 = StructureMineshaftPieces.getNextComponent(par1StructureComponent, par2List, par3Random, this.boundingBox.maxX + 1, this.boundingBox.minY + par3Random.nextInt(var6) + 1, this.boundingBox.minZ + var5, 3, var4); -+ -+ if (var7 != null) { -+ var8 = var7.getBoundingBox(); -+ this.roomsLinkedToTheRoom.add(new StructureBoundingBox(this.boundingBox.maxX - 1, var8.minY, var8.minZ, this.boundingBox.maxX, var8.maxY, var8.maxZ)); -+ } -+ } - } - -- public boolean addComponentParts(World var1, Random var2, StructureBoundingBox var3) { -- if(this.isLiquidInStructureBoundingBox(var1, var3)) { -+ /** -+ * second Part of Structure generating, this for example places Spiderwebs, Mob Spawners, it closes Mineshafts at the -+ * end, it adds Fences... -+ */ -+ public boolean addComponentParts(World par1World, Random par2Random, StructureBoundingBox par3StructureBoundingBox) { -+ if (this.isLiquidInStructureBoundingBox(par1World, par3StructureBoundingBox)) { - return false; - } else { -- this.fillWithBlocks(var1, var3, this.boundingBox.minX, this.boundingBox.minY, this.boundingBox.minZ, this.boundingBox.maxX, this.boundingBox.minY, this.boundingBox.maxZ, Block.dirt.blockID, 0, true); -- this.fillWithBlocks(var1, var3, this.boundingBox.minX, this.boundingBox.minY + 1, this.boundingBox.minZ, this.boundingBox.maxX, Math.min(this.boundingBox.minY + 3, this.boundingBox.maxY), this.boundingBox.maxZ, 0, 0, false); -- Iterator var4 = this.a.iterator(); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, this.boundingBox.minX, this.boundingBox.minY, this.boundingBox.minZ, this.boundingBox.maxX, this.boundingBox.minY, this.boundingBox.maxZ, Block.dirt.blockID, 0, true); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, this.boundingBox.minX, this.boundingBox.minY + 1, this.boundingBox.minZ, this.boundingBox.maxX, Math.min(this.boundingBox.minY + 3, this.boundingBox.maxY), this.boundingBox.maxZ, 0, 0, false); -+ Iterator var4 = this.roomsLinkedToTheRoom.iterator(); - -- while(var4.hasNext()) { -+ while (var4.hasNext()) { - StructureBoundingBox var5 = (StructureBoundingBox)var4.next(); -- this.fillWithBlocks(var1, var3, var5.minX, var5.maxY - 2, var5.minZ, var5.maxX, var5.maxY, var5.maxZ, 0, 0, false); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, var5.minX, var5.maxY - 2, var5.minZ, var5.maxX, var5.maxY, var5.maxZ, 0, 0, false); - } - -- this.randomlyRareFillWithBlocks(var1, var3, this.boundingBox.minX, this.boundingBox.minY + 4, this.boundingBox.minZ, this.boundingBox.maxX, this.boundingBox.maxY, this.boundingBox.maxZ, 0, false); -+ this.randomlyRareFillWithBlocks(par1World, par3StructureBoundingBox, this.boundingBox.minX, this.boundingBox.minY + 4, this.boundingBox.minZ, this.boundingBox.maxX, this.boundingBox.maxY, this.boundingBox.maxZ, 0, false); - return true; - } - } - -- protected void func_143012_a(NBTTagCompound var1) { -+ protected void func_143012_a(NBTTagCompound par1NBTTagCompound) { - NBTTagList var2 = new NBTTagList("Entrances"); -- Iterator var3 = this.a.iterator(); -+ Iterator var3 = this.roomsLinkedToTheRoom.iterator(); - -- while(var3.hasNext()) { -+ while (var3.hasNext()) { - StructureBoundingBox var4 = (StructureBoundingBox)var3.next(); - var2.appendTag(var4.func_143047_a("")); - } - -- var1.setTag("Entrances", var2); -+ par1NBTTagCompound.setTag("Entrances", var2); - } - -- protected void func_143011_b(NBTTagCompound var1) { -- NBTTagList var2 = var1.getTagList("Entrances"); -+ protected void func_143011_b(NBTTagCompound par1NBTTagCompound) { -+ NBTTagList var2 = par1NBTTagCompound.getTagList("Entrances"); - -- for(int var3 = 0; var3 < var2.tagCount(); ++var3) { -- this.a.add(new StructureBoundingBox(((NBTTagIntArray)var2.tagAt(var3)).intArray)); -+ for (int var3 = 0; var3 < var2.tagCount(); ++var3) { -+ this.roomsLinkedToTheRoom.add(new StructureBoundingBox(((NBTTagIntArray)var2.tagAt(var3)).intArray)); - } -- - } - } ---- net/minecraft/src/SlotEnchantmentTable.java -+++ net/minecraft/src/SlotEnchantmentTable.java -@@ -1,23 +1,35 @@ - package net.minecraft.src; - - class SlotEnchantmentTable extends InventoryBasic { -+ -+ /** The brewing stand this slot belongs to. */ - final ContainerEnchantment container; - -- SlotEnchantmentTable(ContainerEnchantment var1, String var2, boolean var3, int var4) { -- super(var2, var3, var4); -- this.container = var1; -+ SlotEnchantmentTable(ContainerEnchantment par1ContainerEnchantment, String par2Str, boolean par3, int par4) { -+ super(par2Str, par3, par4); -+ this.container = par1ContainerEnchantment; - } - -+ /** -+ * Returns the maximum stack size for a inventory slot. Seems to always be 64, possibly will be extended. *Isn't this -+ * more of a set than a get?* -+ */ - public int getInventoryStackLimit() { - return 1; - } - -+ /** -+ * Called when an the contents of an Inventory change, usually -+ */ - public void onInventoryChanged() { - super.onInventoryChanged(); - this.container.onCraftMatrixChanged(this); - } - -- public boolean isItemValidForSlot(int var1, ItemStack var2) { -+ /** -+ * Returns true if automation is allowed to insert the given stack (ignoring stack size) into the given slot. -+ */ -+ public boolean isItemValidForSlot(int par1, ItemStack par2ItemStack) { - return true; - } - } ---- net/minecraft/src/GuiScreenMcoWorldTemplateDownloadThread.java -+++ net/minecraft/src/GuiScreenMcoWorldTemplateDownloadThread.java -@@ -3,18 +3,17 @@ - class GuiScreenMcoWorldTemplateDownloadThread extends Thread { - final GuiScreenMcoWorldTemplate field_111256_a; - -- GuiScreenMcoWorldTemplateDownloadThread(GuiScreenMcoWorldTemplate var1) { -- this.field_111256_a = var1; -+ GuiScreenMcoWorldTemplateDownloadThread(GuiScreenMcoWorldTemplate par1GuiScreenMcoWorldTemplate) { -+ this.field_111256_a = par1GuiScreenMcoWorldTemplate; - } - - public void run() { - McoClient var1 = new McoClient(GuiScreenMcoWorldTemplate.func_110382_a(this.field_111256_a).getSession()); - - try { -- GuiScreenMcoWorldTemplate.func_110388_a(this.field_111256_a, var1.func_111231_d().a); -+ GuiScreenMcoWorldTemplate.func_110388_a(this.field_111256_a, var1.func_111231_d().field_110736_a); - } catch (ExceptionMcoService var3) { - GuiScreenMcoWorldTemplate.func_110392_b(this.field_111256_a).getLogAgent().logSevere(var3.toString()); - } -- - } - } ---- net/minecraft/src/TileEntitySign.java -+++ net/minecraft/src/TileEntitySign.java -@@ -1,35 +1,79 @@ - package net.minecraft.src; - - public class TileEntitySign extends TileEntity { -- public String[] a = new String[]{"", "", "", ""}; -+ -+ /** An array of four strings storing the lines of text on the sign. */ -+ public String[] signText = new String[] {"", "", "", ""}; -+ -+ /** -+ * The index of the line currently being edited. Only used on client side, but defined on both. Note this is only -+ * really used when the > < are going to be visible. -+ */ - public int lineBeingEdited = -1; -+ // Spout Start -+ public int columnBeingEdited; -+ // Spout End - private boolean isEditable = true; - private EntityPlayer field_142011_d; - -- public void writeToNBT(NBTTagCompound var1) { -- super.writeToNBT(var1); -- var1.setString("Text1", this.a[0]); -- var1.setString("Text2", this.a[1]); -- var1.setString("Text3", this.a[2]); -- var1.setString("Text4", this.a[3]); -- } -- -- public void readFromNBT(NBTTagCompound var1) { -+ // Spout Start -+ private byte text = -1; //-1 means invalid cache, 0 means false, 1 means true -+ -+ public boolean hasText() { -+ if (text != -1) { -+ return text != 0; -+ } -+ text = 0; -+ for (int i = 0; i < signText.length; i++) { -+ if (signText[i] != null && !signText[i].isEmpty()) { -+ text = 1; -+ break; -+ } -+ } -+ return text != 0; -+ } -+ -+ public void recalculateText() { -+ text = -1; -+ } -+ // Spout End -+ -+ /** -+ * Writes a tile entity to NBT. -+ */ -+ public void writeToNBT(NBTTagCompound par1NBTTagCompound) { -+ super.writeToNBT(par1NBTTagCompound); -+ par1NBTTagCompound.setString("Text1", this.signText[0]); -+ par1NBTTagCompound.setString("Text2", this.signText[1]); -+ par1NBTTagCompound.setString("Text3", this.signText[2]); -+ par1NBTTagCompound.setString("Text4", this.signText[3]); -+ } -+ -+ /** -+ * Reads a tile entity from NBT. -+ */ -+ public void readFromNBT(NBTTagCompound par1NBTTagCompound) { - this.isEditable = false; -- super.readFromNBT(var1); -- -- for(int var2 = 0; var2 < 4; ++var2) { -- this.a[var2] = var1.getString("Text" + (var2 + 1)); -- if(this.a[var2].length() > 15) { -- this.a[var2] = this.a[var2].substring(0, 15); -+ super.readFromNBT(par1NBTTagCompound); -+ -+ for (int var2 = 0; var2 < 4; ++var2) { -+ this.signText[var2] = par1NBTTagCompound.getString("Text" + (var2 + 1)); -+ -+ if (this.signText[var2].length() > 15) { -+ this.signText[var2] = this.signText[var2].substring(0, 15); - } - } -- -+ // Spout Start -+ recalculateText(); -+ // Spout End - } - -+ /** -+ * Overriden in a sign to provide the text. -+ */ - public Packet getDescriptionPacket() { - String[] var1 = new String[4]; -- System.arraycopy(this.a, 0, var1, 0, 4); -+ System.arraycopy(this.signText, 0, var1, 0, 4); - return new Packet130UpdateSign(this.xCoord, this.yCoord, this.zCoord, var1); - } - -@@ -37,16 +81,18 @@ - return this.isEditable; - } - -- public void setEditable(boolean var1) { -- this.isEditable = var1; -- if(!var1) { -+ /** -+ * Sets the sign's isEditable flag to the specified parameter. -+ */ -+ public void setEditable(boolean par1) { -+ this.isEditable = par1; -+ if (!par1) { - this.field_142011_d = null; - } -- - } - -- public void func_142010_a(EntityPlayer var1) { -- this.field_142011_d = var1; -+ public void func_142010_a(EntityPlayer par1EntityPlayer) { -+ this.field_142011_d = par1EntityPlayer; - } - - public EntityPlayer func_142009_b() { ---- net/minecraft/src/GuiBeaconButtonCancel.java -+++ net/minecraft/src/GuiBeaconButtonCancel.java -@@ -1,14 +1,16 @@ - package net.minecraft.src; - - class GuiBeaconButtonCancel extends GuiBeaconButton { -+ -+ /** Beacon GUI this button belongs to. */ - final GuiBeacon beaconGui; - -- public GuiBeaconButtonCancel(GuiBeacon var1, int var2, int var3, int var4) { -- super(var2, var3, var4, GuiBeacon.getBeaconGuiTextures(), 112, 220); -- this.beaconGui = var1; -+ public GuiBeaconButtonCancel(GuiBeacon par1GuiBeacon, int par2, int par3, int par4) { -+ super(par2, par3, par4, GuiBeacon.getBeaconGuiTextures(), 112, 220); -+ this.beaconGui = par1GuiBeacon; - } - -- public void func_82251_b(int var1, int var2) { -- this.beaconGui.drawCreativeTabHoveringText(I18n.getString("gui.cancel"), var1, var2); -+ public void func_82251_b(int par1, int par2) { -+ this.beaconGui.drawCreativeTabHoveringText(I18n.getString("gui.cancel"), par1, par2); - } - } ---- net/minecraft/src/BlockJukeBox.java -+++ net/minecraft/src/BlockJukeBox.java -@@ -3,83 +3,120 @@ - public class BlockJukeBox extends BlockContainer { - private Icon theIcon; - -- protected BlockJukeBox(int var1) { -- super(var1, Material.wood); -+ protected BlockJukeBox(int par1) { -+ super(par1, Material.wood); - this.setCreativeTab(CreativeTabs.tabDecorations); - } - -- public Icon getIcon(int var1, int var2) { -- return var1 == 1 ? this.theIcon : this.blockIcon; -+ /** -+ * From the specified side and block metadata retrieves the blocks texture. Args: side, metadata -+ */ -+ public Icon getIcon(int par1, int par2) { -+ return par1 == 1 ? this.theIcon : this.blockIcon; - } - -- public boolean onBlockActivated(World var1, int var2, int var3, int var4, EntityPlayer var5, int var6, float var7, float var8, float var9) { -- if(var1.getBlockMetadata(var2, var3, var4) == 0) { -+ /** -+ * Called upon block activation (right click on the block.) -+ */ -+ public boolean onBlockActivated(World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer, int par6, float par7, float par8, float par9) { -+ if (par1World.getBlockMetadata(par2, par3, par4) == 0) { - return false; - } else { -- this.ejectRecord(var1, var2, var3, var4); -+ this.ejectRecord(par1World, par2, par3, par4); - return true; - } - } - -- public void insertRecord(World var1, int var2, int var3, int var4, ItemStack var5) { -- if(!var1.isRemote) { -- TileEntityRecordPlayer var6 = (TileEntityRecordPlayer)var1.getBlockTileEntity(var2, var3, var4); -- if(var6 != null) { -- var6.func_96098_a(var5.copy()); -- var1.setBlockMetadata(var2, var3, var4, 1, 2); -+ /** -+ * Insert the specified music disc in the jukebox at the given coordinates -+ */ -+ public void insertRecord(World par1World, int par2, int par3, int par4, ItemStack par5ItemStack) { -+ if (!par1World.isRemote) { -+ TileEntityRecordPlayer var6 = (TileEntityRecordPlayer)par1World.getBlockTileEntity(par2, par3, par4); -+ -+ if (var6 != null) { -+ var6.func_96098_a(par5ItemStack.copy()); -+ par1World.setBlockMetadataWithNotify(par2, par3, par4, 1, 2); - } - } - } - -- public void ejectRecord(World var1, int var2, int var3, int var4) { -- if(!var1.isRemote) { -- TileEntityRecordPlayer var5 = (TileEntityRecordPlayer)var1.getBlockTileEntity(var2, var3, var4); -- if(var5 != null) { -+ /** -+ * Ejects the current record inside of the jukebox. -+ */ -+ public void ejectRecord(World par1World, int par2, int par3, int par4) { -+ if (!par1World.isRemote) { -+ TileEntityRecordPlayer var5 = (TileEntityRecordPlayer)par1World.getBlockTileEntity(par2, par3, par4); -+ -+ if (var5 != null) { - ItemStack var6 = var5.func_96097_a(); -- if(var6 != null) { -- var1.playAuxSFX(1005, var2, var3, var4, 0); -- var1.playRecord((String)null, var2, var3, var4); -+ -+ if (var6 != null) { -+ par1World.playAuxSFX(1005, par2, par3, par4, 0); -+ par1World.playRecord((String)null, par2, par3, par4); - var5.func_96098_a((ItemStack)null); -- var1.setBlockMetadata(var2, var3, var4, 0, 2); -+ par1World.setBlockMetadataWithNotify(par2, par3, par4, 0, 2); - float var7 = 0.7F; -- double var8 = (double)(var1.s.nextFloat() * var7) + (double)(1.0F - var7) * 0.5D; -- double var10 = (double)(var1.s.nextFloat() * var7) + (double)(1.0F - var7) * 0.2D + 0.6D; -- double var12 = (double)(var1.s.nextFloat() * var7) + (double)(1.0F - var7) * 0.5D; -+ double var8 = (double)(par1World.rand.nextFloat() * var7) + (double)(1.0F - var7) * 0.5D; -+ double var10 = (double)(par1World.rand.nextFloat() * var7) + (double)(1.0F - var7) * 0.2D + 0.6D; -+ double var12 = (double)(par1World.rand.nextFloat() * var7) + (double)(1.0F - var7) * 0.5D; - ItemStack var14 = var6.copy(); -- EntityItem var15 = new EntityItem(var1, (double)var2 + var8, (double)var3 + var10, (double)var4 + var12, var14); -+ EntityItem var15 = new EntityItem(par1World, (double)par2 + var8, (double)par3 + var10, (double)par4 + var12, var14); - var15.delayBeforeCanPickup = 10; -- var1.spawnEntityInWorld(var15); -+ par1World.spawnEntityInWorld(var15); - } - } - } - } - -- public void breakBlock(World var1, int var2, int var3, int var4, int var5, int var6) { -- this.ejectRecord(var1, var2, var3, var4); -- super.breakBlock(var1, var2, var3, var4, var5, var6); -+ /** -+ * Called on server worlds only when the block has been replaced by a different block ID, or the same block with a -+ * different metadata value, but before the new metadata value is set. Args: World, x, y, z, old block ID, old metadata -+ */ -+ public void breakBlock(World par1World, int par2, int par3, int par4, int par5, int par6) { -+ this.ejectRecord(par1World, par2, par3, par4); -+ super.breakBlock(par1World, par2, par3, par4, par5, par6); - } - -- public void dropBlockAsItemWithChance(World var1, int var2, int var3, int var4, int var5, float var6, int var7) { -- if(!var1.isRemote) { -- super.dropBlockAsItemWithChance(var1, var2, var3, var4, var5, var6, 0); -+ /** -+ * Drops the block items with a specified chance of dropping the specified items -+ */ -+ public void dropBlockAsItemWithChance(World par1World, int par2, int par3, int par4, int par5, float par6, int par7) { -+ if (!par1World.isRemote) { -+ super.dropBlockAsItemWithChance(par1World, par2, par3, par4, par5, par6, 0); - } - } - -- public TileEntity createNewTileEntity(World var1) { -+ /** -+ * Returns a new instance of a block's tile entity class. Called on placing the block. -+ */ -+ public TileEntity createNewTileEntity(World par1World) { - return new TileEntityRecordPlayer(); - } - -- public void registerIcons(IconRegister var1) { -- this.blockIcon = var1.registerIcon(this.getTextureName() + "_side"); -- this.theIcon = var1.registerIcon(this.getTextureName() + "_top"); -+ /** -+ * When this method is called, your block should register all the icons it needs with the given IconRegister. This is -+ * the only chance you get to register icons. -+ */ -+ public void registerIcons(IconRegister par1IconRegister) { -+ this.blockIcon = par1IconRegister.registerIcon(this.getTextureName() + "_side"); -+ this.theIcon = par1IconRegister.registerIcon(this.getTextureName() + "_top"); - } - -+ /** -+ * If this returns true, then comparators facing away from this block will use the value from -+ * getComparatorInputOverride instead of the actual redstone signal strength. -+ */ - public boolean hasComparatorInputOverride() { - return true; - } - -- public int getComparatorInputOverride(World var1, int var2, int var3, int var4, int var5) { -- ItemStack var6 = ((TileEntityRecordPlayer)var1.getBlockTileEntity(var2, var3, var4)).func_96097_a(); -+ /** -+ * If hasComparatorInputOverride returns true, the return value from this is used instead of the redstone signal -+ * strength when this block inputs to a comparator. -+ */ -+ public int getComparatorInputOverride(World par1World, int par2, int par3, int par4, int par5) { -+ ItemStack var6 = ((TileEntityRecordPlayer)par1World.getBlockTileEntity(par2, par3, par4)).func_96097_a(); - return var6 == null ? 0 : var6.itemID + 1 - Item.record13.itemID; - } - } ---- net/minecraft/src/CommandToggleDownfall.java -+++ net/minecraft/src/CommandToggleDownfall.java -@@ -7,21 +7,27 @@ - return "toggledownfall"; - } - -+ /** -+ * Return the required permission level for this command. -+ */ - public int getRequiredPermissionLevel() { - return 2; - } - -- public String getCommandUsage(ICommandSender var1) { -+ public String getCommandUsage(ICommandSender par1ICommandSender) { - return "commands.downfall.usage"; - } - -- public void processCommand(ICommandSender var1, String[] var2) { -+ public void processCommand(ICommandSender par1ICommandSender, String[] par2ArrayOfStr) { - this.toggleDownfall(); -- notifyAdmins(var1, "commands.downfall.success", new Object[0]); -+ notifyAdmins(par1ICommandSender, "commands.downfall.success", new Object[0]); - } - -+ /** -+ * Toggle rain and enable thundering. -+ */ - protected void toggleDownfall() { -- MinecraftServer.getServer().worldServers[0].commandToggleDownfall(); -+ MinecraftServer.getServer().worldServers[0].toggleRain(); - MinecraftServer.getServer().worldServers[0].getWorldInfo().setThundering(true); - } - } ---- /dev/null -+++ org/spoutcraft/client/gui/settings/controls/FancyParticlesButton.java -@@ -1,0 +1,41 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.client.gui.settings.controls; -+ -+import java.util.UUID; -+ -+import org.spoutcraft.client.config.Configuration; -+ -+public class FancyParticlesButton extends AutomatedCheckBox { -+ UUID fancyGraphics; -+ public FancyParticlesButton(UUID fancyGraphics) { -+ super("Fancy Particles"); -+ this.fancyGraphics = fancyGraphics; -+ setChecked(Configuration.isFancyParticles()); -+ setTooltip("Fancy Light\nFast - lower quality, faster\nFancy - higher quality, slower\nFast Particles renders fewer particles, and only those nearyby.\nFancy particles renders all particles."); -+ } -+ -+ @Override -+ public void onButtonClick() { -+ Configuration.setFancyParticles(!Configuration.isFancyParticles()); -+ Configuration.write(); -+ ((FancyGraphicsButton)getScreen().getWidget(fancyGraphics)).custom = true; -+ } -+} ---- net/minecraft/src/StructureVillagePieceWeight.java -+++ net/minecraft/src/StructureVillagePieceWeight.java -@@ -1,18 +1,20 @@ - package net.minecraft.src; - - public class StructureVillagePieceWeight { -- public Class a; -+ -+ /** The Class object for the represantation of this village piece. */ -+ public Class villagePieceClass; - public final int villagePieceWeight; - public int villagePiecesSpawned; - public int villagePiecesLimit; - -- public StructureVillagePieceWeight(Class var1, int var2, int var3) { -- this.a = var1; -- this.villagePieceWeight = var2; -- this.villagePiecesLimit = var3; -+ public StructureVillagePieceWeight(Class par1Class, int par2, int par3) { -+ this.villagePieceClass = par1Class; -+ this.villagePieceWeight = par2; -+ this.villagePiecesLimit = par3; - } - -- public boolean canSpawnMoreVillagePiecesOfType(int var1) { -+ public boolean canSpawnMoreVillagePiecesOfType(int par1) { - return this.villagePiecesLimit == 0 || this.villagePiecesSpawned < this.villagePiecesLimit; - } - ---- /dev/null -+++ org/spoutcraft/client/gui/settings/controls/SoundEffectsSlider.java -@@ -1,0 +1,43 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.client.gui.settings.controls; -+ -+import net.minecraft.src.Minecraft; -+ -+import org.spoutcraft.api.gui.GenericSlider; -+ -+public class SoundEffectsSlider extends GenericSlider { -+ public SoundEffectsSlider() { -+ super("Sound"); -+ setSliderPosition(Minecraft.getMinecraft().gameSettings.soundVolume); -+ setTooltip("Sound Volume\nControls the volume of all the sound effects in game."); -+ } -+ -+ @Override -+ public void onSliderDrag(float old, float newPos) { -+ Minecraft.getMinecraft().gameSettings.soundVolume = newPos; -+ Minecraft.getMinecraft().gameSettings.saveOptions(); -+ Minecraft.getMinecraft().sndManager.onSoundOptionsChanged(); -+ } -+ -+ public String getText() { -+ return "Sound: " + (this.getSliderPosition() > 0F ? (int)(this.getSliderPosition() * 100) + "%" : "OFF"); -+ } -+} ---- net/minecraft/src/TileEntitySkullRenderer.java -+++ net/minecraft/src/TileEntitySkullRenderer.java -@@ -12,75 +12,91 @@ - private ModelSkeletonHead field_82396_c = new ModelSkeletonHead(0, 0, 64, 32); - private ModelSkeletonHead field_82395_d = new ModelSkeletonHead(0, 0, 64, 64); - -- public void renderTileEntitySkullAt(TileEntitySkull var1, double var2, double var4, double var6, float var8) { -- this.func_82393_a((float)var2, (float)var4, (float)var6, var1.getBlockMetadata() & 7, (float)(var1.func_82119_b() * 360) / 16.0F, var1.getSkullType(), var1.getExtraType()); -+ /** -+ * Render a skull tile entity. -+ */ -+ public void renderTileEntitySkullAt(TileEntitySkull par1TileEntitySkull, double par2, double par4, double par6, float par8) { -+ this.func_82393_a((float)par2, (float)par4, (float)par6, par1TileEntitySkull.getBlockMetadata() & 7, (float)(par1TileEntitySkull.func_82119_b() * 360) / 16.0F, par1TileEntitySkull.getSkullType(), par1TileEntitySkull.getExtraType()); - } - -- public void setTileEntityRenderer(TileEntityRenderer var1) { -- super.setTileEntityRenderer(var1); -+ /** -+ * Associate a TileEntityRenderer with this TileEntitySpecialRenderer -+ */ -+ public void setTileEntityRenderer(TileEntityRenderer par1TileEntityRenderer) { -+ super.setTileEntityRenderer(par1TileEntityRenderer); - skullRenderer = this; - } - -- public void func_82393_a(float var1, float var2, float var3, int var4, float var5, int var6, String var7) { -+ public void func_82393_a(float par1, float par2, float par3, int par4, float par5, int par6, String par7Str) { - ModelSkeletonHead var8 = this.field_82396_c; -- switch(var6) { -- case 0: -- default: -- this.bindTexture(field_110642_c); -- break; -- case 1: -- this.bindTexture(field_110640_d); -- break; -- case 2: -- this.bindTexture(field_110641_e); -- var8 = this.field_82395_d; -- break; -- case 3: -- ResourceLocation var9 = AbstractClientPlayer.locationStevePng; -- if(var7 != null && var7.length() > 0) { -- var9 = AbstractClientPlayer.getLocationSkull(var7); -- AbstractClientPlayer.getDownloadImageSkin(var9, var7); -- } -- -- this.bindTexture(var9); -- break; -- case 4: -- this.bindTexture(field_110639_f); -- } -- -- GL11.glPushMatrix(); -- GL11.glDisable(GL11.GL_CULL_FACE); -- if(var4 != 1) { -- switch(var4) { -+ -+ switch (par6) { -+ case 0: -+ default: -+ this.bindTexture(field_110642_c); -+ break; -+ -+ case 1: -+ this.bindTexture(field_110640_d); -+ break; -+ - case 2: -- GL11.glTranslatef(var1 + 0.5F, var2 + 0.25F, var3 + 0.74F); -+ this.bindTexture(field_110641_e); -+ var8 = this.field_82395_d; - break; -+ - case 3: -- GL11.glTranslatef(var1 + 0.5F, var2 + 0.25F, var3 + 0.26F); -- var5 = 180.0F; -+ ResourceLocation var9 = AbstractClientPlayer.locationStevePng; -+ -+ if (par7Str != null && par7Str.length() > 0) { -+ var9 = AbstractClientPlayer.getLocationSkull(par7Str); -+ AbstractClientPlayer.getDownloadImageSkin(var9, par7Str); -+ } -+ -+ this.bindTexture(var9); - break; -+ - case 4: -- GL11.glTranslatef(var1 + 0.74F, var2 + 0.25F, var3 + 0.5F); -- var5 = 270.0F; -- break; -- case 5: -- default: -- GL11.glTranslatef(var1 + 0.26F, var2 + 0.25F, var3 + 0.5F); -- var5 = 90.0F; -+ this.bindTexture(field_110639_f); -+ } -+ -+ GL11.glPushMatrix(); -+ GL11.glDisable(GL11.GL_CULL_FACE); -+ -+ if (par4 != 1) { -+ switch (par4) { -+ case 2: -+ GL11.glTranslatef(par1 + 0.5F, par2 + 0.25F, par3 + 0.74F); -+ break; -+ -+ case 3: -+ GL11.glTranslatef(par1 + 0.5F, par2 + 0.25F, par3 + 0.26F); -+ par5 = 180.0F; -+ break; -+ -+ case 4: -+ GL11.glTranslatef(par1 + 0.74F, par2 + 0.25F, par3 + 0.5F); -+ par5 = 270.0F; -+ break; -+ -+ case 5: -+ default: -+ GL11.glTranslatef(par1 + 0.26F, par2 + 0.25F, par3 + 0.5F); -+ par5 = 90.0F; - } - } else { -- GL11.glTranslatef(var1 + 0.5F, var2, var3 + 0.5F); -+ GL11.glTranslatef(par1 + 0.5F, par2, par3 + 0.5F); - } - -- float var10 = 1.0F / 16.0F; -+ float var10 = 0.0625F; - GL11.glEnable(GL12.GL_RESCALE_NORMAL); - GL11.glScalef(-1.0F, -1.0F, 1.0F); - GL11.glEnable(GL11.GL_ALPHA_TEST); -- var8.render((Entity)null, 0.0F, 0.0F, 0.0F, var5, 0.0F, var10); -+ var8.render((Entity)null, 0.0F, 0.0F, 0.0F, par5, 0.0F, var10); - GL11.glPopMatrix(); - } - -- public void renderTileEntityAt(TileEntity var1, double var2, double var4, double var6, float var8) { -- this.renderTileEntitySkullAt((TileEntitySkull)var1, var2, var4, var6, var8); -+ public void renderTileEntityAt(TileEntity par1TileEntity, double par2, double par4, double par6, float par8) { -+ this.renderTileEntitySkullAt((TileEntitySkull)par1TileEntity, par2, par4, par6, par8); - } - } ---- net/minecraft/src/WorldGenSwamp.java -+++ net/minecraft/src/WorldGenSwamp.java -@@ -3,35 +3,41 @@ - import java.util.Random; - - public class WorldGenSwamp extends WorldGenerator { -- public boolean generate(World var1, Random var2, int var3, int var4, int var5) { -+ public boolean generate(World par1World, Random par2Random, int par3, int par4, int par5) { - int var6; -- for(var6 = var2.nextInt(4) + 5; var1.getBlockMaterial(var3, var4 - 1, var5) == Material.water; --var4) { -+ -+ for (var6 = par2Random.nextInt(4) + 5; par1World.getBlockMaterial(par3, par4 - 1, par5) == Material.water; --par4) { -+ ; - } - - boolean var7 = true; -- if(var4 >= 1 && var4 + var6 + 1 <= 128) { -+ -+ if (par4 >= 1 && par4 + var6 + 1 <= 128) { - int var8; - int var10; - int var11; - int var12; -- for(var8 = var4; var8 <= var4 + 1 + var6; ++var8) { -+ -+ for (var8 = par4; var8 <= par4 + 1 + var6; ++var8) { - byte var9 = 1; -- if(var8 == var4) { -+ -+ if (var8 == par4) { - var9 = 0; - } - -- if(var8 >= var4 + 1 + var6 - 2) { -+ if (var8 >= par4 + 1 + var6 - 2) { - var9 = 3; - } - -- for(var10 = var3 - var9; var10 <= var3 + var9 && var7; ++var10) { -- for(var11 = var5 - var9; var11 <= var5 + var9 && var7; ++var11) { -- if(var8 >= 0 && var8 < 128) { -- var12 = var1.getBlockId(var10, var8, var11); -- if(var12 != 0 && var12 != Block.leaves.blockID) { -- if(var12 != Block.waterStill.blockID && var12 != Block.waterMoving.blockID) { -+ for (var10 = par3 - var9; var10 <= par3 + var9 && var7; ++var10) { -+ for (var11 = par5 - var9; var11 <= par5 + var9 && var7; ++var11) { -+ if (var8 >= 0 && var8 < 128) { -+ var12 = par1World.getBlockId(var10, var8, var11); -+ -+ if (var12 != 0 && var12 != Block.leaves.blockID) { -+ if (var12 != Block.waterStill.blockID && var12 != Block.waterMoving.blockID) { - var7 = false; -- } else if(var8 > var4) { -+ } else if (var8 > par4) { - var7 = false; - } - } -@@ -42,59 +48,62 @@ - } - } - -- if(!var7) { -+ if (!var7) { - return false; - } else { -- var8 = var1.getBlockId(var3, var4 - 1, var5); -- if((var8 == Block.grass.blockID || var8 == Block.dirt.blockID) && var4 < 128 - var6 - 1) { -- this.setBlock(var1, var3, var4 - 1, var5, Block.dirt.blockID); -+ var8 = par1World.getBlockId(par3, par4 - 1, par5); - -+ if ((var8 == Block.grass.blockID || var8 == Block.dirt.blockID) && par4 < 128 - var6 - 1) { -+ this.setBlock(par1World, par3, par4 - 1, par5, Block.dirt.blockID); - int var13; - int var16; -- for(var16 = var4 - 3 + var6; var16 <= var4 + var6; ++var16) { -- var10 = var16 - (var4 + var6); -+ -+ for (var16 = par4 - 3 + var6; var16 <= par4 + var6; ++var16) { -+ var10 = var16 - (par4 + var6); - var11 = 2 - var10 / 2; - -- for(var12 = var3 - var11; var12 <= var3 + var11; ++var12) { -- var13 = var12 - var3; -- -- for(int var14 = var5 - var11; var14 <= var5 + var11; ++var14) { -- int var15 = var14 - var5; -- if((Math.abs(var13) != var11 || Math.abs(var15) != var11 || var2.nextInt(2) != 0 && var10 != 0) && !Block.opaqueCubeLookup[var1.getBlockId(var12, var16, var14)]) { -- this.setBlock(var1, var12, var16, var14, Block.leaves.blockID); -+ for (var12 = par3 - var11; var12 <= par3 + var11; ++var12) { -+ var13 = var12 - par3; -+ -+ for (int var14 = par5 - var11; var14 <= par5 + var11; ++var14) { -+ int var15 = var14 - par5; -+ -+ if ((Math.abs(var13) != var11 || Math.abs(var15) != var11 || par2Random.nextInt(2) != 0 && var10 != 0) && !Block.opaqueCubeLookup[par1World.getBlockId(var12, var16, var14)]) { -+ this.setBlock(par1World, var12, var16, var14, Block.leaves.blockID); - } - } - } - } - -- for(var16 = 0; var16 < var6; ++var16) { -- var10 = var1.getBlockId(var3, var4 + var16, var5); -- if(var10 == 0 || var10 == Block.leaves.blockID || var10 == Block.waterMoving.blockID || var10 == Block.waterStill.blockID) { -- this.setBlock(var1, var3, var4 + var16, var5, Block.wood.blockID); -+ for (var16 = 0; var16 < var6; ++var16) { -+ var10 = par1World.getBlockId(par3, par4 + var16, par5); -+ -+ if (var10 == 0 || var10 == Block.leaves.blockID || var10 == Block.waterMoving.blockID || var10 == Block.waterStill.blockID) { -+ this.setBlock(par1World, par3, par4 + var16, par5, Block.wood.blockID); - } - } - -- for(var16 = var4 - 3 + var6; var16 <= var4 + var6; ++var16) { -- var10 = var16 - (var4 + var6); -+ for (var16 = par4 - 3 + var6; var16 <= par4 + var6; ++var16) { -+ var10 = var16 - (par4 + var6); - var11 = 2 - var10 / 2; - -- for(var12 = var3 - var11; var12 <= var3 + var11; ++var12) { -- for(var13 = var5 - var11; var13 <= var5 + var11; ++var13) { -- if(var1.getBlockId(var12, var16, var13) == Block.leaves.blockID) { -- if(var2.nextInt(4) == 0 && var1.getBlockId(var12 - 1, var16, var13) == 0) { -- this.generateVines(var1, var12 - 1, var16, var13, 8); -- } -- -- if(var2.nextInt(4) == 0 && var1.getBlockId(var12 + 1, var16, var13) == 0) { -- this.generateVines(var1, var12 + 1, var16, var13, 2); -- } -- -- if(var2.nextInt(4) == 0 && var1.getBlockId(var12, var16, var13 - 1) == 0) { -- this.generateVines(var1, var12, var16, var13 - 1, 1); -- } -- -- if(var2.nextInt(4) == 0 && var1.getBlockId(var12, var16, var13 + 1) == 0) { -- this.generateVines(var1, var12, var16, var13 + 1, 4); -+ for (var12 = par3 - var11; var12 <= par3 + var11; ++var12) { -+ for (var13 = par5 - var11; var13 <= par5 + var11; ++var13) { -+ if (par1World.getBlockId(var12, var16, var13) == Block.leaves.blockID) { -+ if (par2Random.nextInt(4) == 0 && par1World.getBlockId(var12 - 1, var16, var13) == 0) { -+ this.generateVines(par1World, var12 - 1, var16, var13, 8); -+ } -+ -+ if (par2Random.nextInt(4) == 0 && par1World.getBlockId(var12 + 1, var16, var13) == 0) { -+ this.generateVines(par1World, var12 + 1, var16, var13, 2); -+ } -+ -+ if (par2Random.nextInt(4) == 0 && par1World.getBlockId(var12, var16, var13 - 1) == 0) { -+ this.generateVines(par1World, var12, var16, var13 - 1, 1); -+ } -+ -+ if (par2Random.nextInt(4) == 0 && par1World.getBlockId(var12, var16, var13 + 1) == 0) { -+ this.generateVines(par1World, var12, var16, var13 + 1, 4); - } - } - } -@@ -111,17 +120,21 @@ - } - } - -- private void generateVines(World var1, int var2, int var3, int var4, int var5) { -- this.setBlockAndMetadata(var1, var2, var3, var4, Block.vine.blockID, var5); -+ /** -+ * Generates vines at the given position until it hits a block. -+ */ -+ private void generateVines(World par1World, int par2, int par3, int par4, int par5) { -+ this.setBlockAndMetadata(par1World, par2, par3, par4, Block.vine.blockID, par5); - int var6 = 4; - -- while(true) { -- --var3; -- if(var1.getBlockId(var2, var3, var4) != 0 || var6 <= 0) { -+ while (true) { -+ --par3; -+ -+ if (par1World.getBlockId(par2, par3, par4) != 0 || var6 <= 0) { - return; - } - -- this.setBlockAndMetadata(var1, var2, var3, var4, Block.vine.blockID, var5); -+ this.setBlockAndMetadata(par1World, par2, par3, par4, Block.vine.blockID, par5); - --var6; - } - } ---- /dev/null -+++ org/spoutcraft/client/util/CacheMap.java -@@ -1,0 +1,96 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.client.util; -+ -+import java.lang.ref.Reference; -+import java.lang.ref.ReferenceQueue; -+import java.lang.ref.SoftReference; -+import java.util.HashMap; -+ -+public class CacheMap { -+ private HashMap> cache = new HashMap>(); -+ private final ReferenceQueue refQueue = new ReferenceQueue(); -+ -+ public V remove(K key) { -+ SoftKeyReference r = cache.remove(key); -+ if (r == null) { -+ return null; -+ } -+ return r.get(); -+ } -+ -+ public V put(K key, V value) { -+ processReferenceQueue(); -+ Reference old = cache.get(key); -+ V oldValue = old == null ? null : old.get(); -+ cache.put(key, new SoftKeyReference(key, value, refQueue)); -+ return oldValue; -+ } -+ -+ public boolean contains(K key) { -+ return get(key) != null; -+ } -+ -+ public V get(K key) { -+ processReferenceQueue(); -+ Reference current = cache.get(key); -+ return current == null ? null : current.get(); -+ } -+ -+ private void processReferenceQueue() { -+ Reference r; -+ while ((r = refQueue.poll()) != null) { -+ @SuppressWarnings("unchecked") -+ SoftKeyReference keyRef = (SoftKeyReference)r; -+ if (cache.get(keyRef.getKey()).equals(nullReference)) { -+ cache.remove(keyRef.getKey()); -+ } -+ } -+ } -+ -+ private final SoftKeyReference nullReference = new SoftKeyReference(null, null, null); -+ -+ private static class SoftKeyReference extends SoftReference { -+ private final Object key; -+ -+ SoftKeyReference(Object key, V value, ReferenceQueue q) { -+ super(value, q); -+ this.key = key; -+ } -+ -+ public Object getKey() { -+ return key; -+ } -+ -+ @Override -+ public boolean equals(Object o) { -+ if (o == this) { -+ return true; -+ } -+ if (!(o instanceof SoftKeyReference)) { -+ return false; -+ } -+ @SuppressWarnings("unchecked") -+ Reference s = (Reference)o; -+ -+ return s.get() == null && get() == null; -+ } -+ } -+} ---- net/minecraft/src/EntityAIWatchClosest2.java -+++ net/minecraft/src/EntityAIWatchClosest2.java -@@ -1,8 +1,8 @@ - package net.minecraft.src; - - public class EntityAIWatchClosest2 extends EntityAIWatchClosest { -- public EntityAIWatchClosest2(EntityLiving var1, Class var2, float var3, float var4) { -- super(var1, var2, var3, var4); -+ public EntityAIWatchClosest2(EntityLiving par1EntityLiving, Class par2Class, float par3, float par4) { -+ super(par1EntityLiving, par2Class, par3, par4); - this.setMutexBits(3); - } - } ---- net/minecraft/src/ContainerHopper.java -+++ net/minecraft/src/ContainerHopper.java -@@ -3,47 +3,51 @@ - public class ContainerHopper extends Container { - private final IInventory field_94538_a; - -- public ContainerHopper(InventoryPlayer var1, IInventory var2) { -- this.field_94538_a = var2; -- var2.openChest(); -+ public ContainerHopper(InventoryPlayer par1InventoryPlayer, IInventory par2IInventory) { -+ this.field_94538_a = par2IInventory; -+ par2IInventory.openChest(); - byte var3 = 51; -- - int var4; -- for(var4 = 0; var4 < var2.getSizeInventory(); ++var4) { -- this.addSlotToContainer(new Slot(var2, var4, 44 + var4 * 18, 20)); -+ -+ for (var4 = 0; var4 < par2IInventory.getSizeInventory(); ++var4) { -+ this.addSlotToContainer(new Slot(par2IInventory, var4, 44 + var4 * 18, 20)); - } - -- for(var4 = 0; var4 < 3; ++var4) { -- for(int var5 = 0; var5 < 9; ++var5) { -- this.addSlotToContainer(new Slot(var1, var5 + var4 * 9 + 9, 8 + var5 * 18, var4 * 18 + var3)); -+ for (var4 = 0; var4 < 3; ++var4) { -+ for (int var5 = 0; var5 < 9; ++var5) { -+ this.addSlotToContainer(new Slot(par1InventoryPlayer, var5 + var4 * 9 + 9, 8 + var5 * 18, var4 * 18 + var3)); - } - } - -- for(var4 = 0; var4 < 9; ++var4) { -- this.addSlotToContainer(new Slot(var1, var4, 8 + var4 * 18, 58 + var3)); -+ for (var4 = 0; var4 < 9; ++var4) { -+ this.addSlotToContainer(new Slot(par1InventoryPlayer, var4, 8 + var4 * 18, 58 + var3)); - } -- -- } -- -- public boolean canInteractWith(EntityPlayer var1) { -- return this.field_94538_a.isUseableByPlayer(var1); -- } -- -- public ItemStack transferStackInSlot(EntityPlayer var1, int var2) { -+ } -+ -+ public boolean canInteractWith(EntityPlayer par1EntityPlayer) { -+ return this.field_94538_a.isUseableByPlayer(par1EntityPlayer); -+ } -+ -+ /** -+ * Called when a player shift-clicks on a slot. You must override this or you will crash when someone does that. -+ */ -+ public ItemStack transferStackInSlot(EntityPlayer par1EntityPlayer, int par2) { - ItemStack var3 = null; -- Slot var4 = (Slot)this.c.get(var2); -- if(var4 != null && var4.getHasStack()) { -+ Slot var4 = (Slot)this.inventorySlots.get(par2); -+ -+ if (var4 != null && var4.getHasStack()) { - ItemStack var5 = var4.getStack(); - var3 = var5.copy(); -- if(var2 < this.field_94538_a.getSizeInventory()) { -- if(!this.mergeItemStack(var5, this.field_94538_a.getSizeInventory(), this.c.size(), true)) { -+ -+ if (par2 < this.field_94538_a.getSizeInventory()) { -+ if (!this.mergeItemStack(var5, this.field_94538_a.getSizeInventory(), this.inventorySlots.size(), true)) { - return null; - } -- } else if(!this.mergeItemStack(var5, 0, this.field_94538_a.getSizeInventory(), false)) { -+ } else if (!this.mergeItemStack(var5, 0, this.field_94538_a.getSizeInventory(), false)) { - return null; - } - -- if(var5.stackSize == 0) { -+ if (var5.stackSize == 0) { - var4.putStack((ItemStack)null); - } else { - var4.onSlotChanged(); -@@ -53,8 +57,11 @@ - return var3; - } - -- public void onContainerClosed(EntityPlayer var1) { -- super.onContainerClosed(var1); -+ /** -+ * Called when the container is closed. -+ */ -+ public void onContainerClosed(EntityPlayer par1EntityPlayer) { -+ super.onContainerClosed(par1EntityPlayer); - this.field_94538_a.closeChest(); - } - } ---- net/minecraft/src/EntitySpider.java -+++ net/minecraft/src/EntitySpider.java -@@ -1,8 +1,8 @@ - package net.minecraft.src; - - public class EntitySpider extends EntityMob { -- public EntitySpider(World var1) { -- super(var1); -+ public EntitySpider(World par1World) { -+ super(par1World); - this.setSize(1.4F, 0.9F); - } - -@@ -11,23 +11,31 @@ - this.dataWatcher.addObject(16, new Byte((byte)0)); - } - -+ /** -+ * Called to update the entity's position/logic. -+ */ - public void onUpdate() { - super.onUpdate(); -- if(!this.worldObj.isRemote) { -+ -+ if (!this.worldObj.isRemote) { - this.setBesideClimbableBlock(this.isCollidedHorizontally); - } -- - } - - protected void applyEntityAttributes() { - super.applyEntityAttributes(); - this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setAttribute(16.0D); -- this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setAttribute((double)0.8F); -+ this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setAttribute(0.800000011920929D); - } - -+ /** -+ * Finds the closest player within 16 blocks to attack, or null if this Entity isn't interested in attacking (Animals, -+ * Spiders at day, peaceful PigZombies). -+ */ - protected Entity findPlayerToAttack() { - float var1 = this.getBrightness(1.0F); -- if(var1 < 0.5F) { -+ -+ if (var1 < 0.5F) { - double var2 = 16.0D; - return this.worldObj.getClosestVulnerablePlayerToEntity(this, var2); - } else { -@@ -35,77 +43,116 @@ - } - } - -+ /** -+ * Returns the sound this mob makes while it's alive. -+ */ - protected String getLivingSound() { - return "mob.spider.say"; - } - -+ /** -+ * Returns the sound this mob makes when it is hurt. -+ */ - protected String getHurtSound() { - return "mob.spider.say"; - } - -+ /** -+ * Returns the sound this mob makes on death. -+ */ - protected String getDeathSound() { - return "mob.spider.death"; - } - -- protected void playStepSound(int var1, int var2, int var3, int var4) { -+ /** -+ * Plays step sound at given x, y, z for the entity -+ */ -+ protected void playStepSound(int par1, int par2, int par3, int par4) { - this.playSound("mob.spider.step", 0.15F, 1.0F); - } - -- protected void attackEntity(Entity var1, float var2) { -+ /** -+ * Basic mob attack. Default to touch of death in EntityCreature. Overridden by each mob to define their attack. -+ */ -+ protected void attackEntity(Entity par1Entity, float par2) { - float var3 = this.getBrightness(1.0F); -- if(var3 > 0.5F && this.ab.nextInt(100) == 0) { -+ -+ if (var3 > 0.5F && this.rand.nextInt(100) == 0) { - this.entityToAttack = null; - } else { -- if(var2 > 2.0F && var2 < 6.0F && this.ab.nextInt(10) == 0) { -- if(this.onGround) { -- double var4 = var1.posX - this.posX; -- double var6 = var1.posZ - this.posZ; -+ if (par2 > 2.0F && par2 < 6.0F && this.rand.nextInt(10) == 0) { -+ if (this.onGround) { -+ double var4 = par1Entity.posX - this.posX; -+ double var6 = par1Entity.posZ - this.posZ; - float var8 = MathHelper.sqrt_double(var4 * var4 + var6 * var6); -- this.motionX = var4 / (double)var8 * 0.5D * (double)0.8F + this.motionX * (double)0.2F; -- this.motionZ = var6 / (double)var8 * 0.5D * (double)0.8F + this.motionZ * (double)0.2F; -- this.motionY = (double)0.4F; -+ this.motionX = var4 / (double)var8 * 0.5D * 0.800000011920929D + this.motionX * 0.20000000298023224D; -+ this.motionZ = var6 / (double)var8 * 0.5D * 0.800000011920929D + this.motionZ * 0.20000000298023224D; -+ this.motionY = 0.4000000059604645D; - } - } else { -- super.attackEntity(var1, var2); -+ super.attackEntity(par1Entity, par2); - } -- - } - } - -+ /** -+ * Returns the item ID for the item the mob drops on death. -+ */ - protected int getDropItemId() { - return Item.silk.itemID; - } - -- protected void dropFewItems(boolean var1, int var2) { -- super.dropFewItems(var1, var2); -- if(var1 && (this.ab.nextInt(3) == 0 || this.ab.nextInt(1 + var2) > 0)) { -+ /** -+ * Drop 0-2 items of this living's type. @param par1 - Whether this entity has recently been hit by a player. @param -+ * par2 - Level of Looting used to kill this mob. -+ */ -+ protected void dropFewItems(boolean par1, int par2) { -+ super.dropFewItems(par1, par2); -+ -+ if (par1 && (this.rand.nextInt(3) == 0 || this.rand.nextInt(1 + par2) > 0)) { - this.dropItem(Item.spiderEye.itemID, 1); - } -- - } - -+ /** -+ * returns true if this entity is by a ladder, false otherwise -+ */ - public boolean isOnLadder() { - return this.isBesideClimbableBlock(); - } - -- public void setInWeb() { -- } -+ /** -+ * Sets the Entity inside a web block. -+ */ -+ public void setInWeb() {} - -+ /** -+ * Get this Entity's EnumCreatureAttribute -+ */ - public EnumCreatureAttribute getCreatureAttribute() { - return EnumCreatureAttribute.ARTHROPOD; - } - -- public boolean isPotionApplicable(PotionEffect var1) { -- return var1.getPotionID() == Potion.poison.id ? false : super.isPotionApplicable(var1); -+ public boolean isPotionApplicable(PotionEffect par1PotionEffect) { -+ return par1PotionEffect.getPotionID() == Potion.poison.id ? false : super.isPotionApplicable(par1PotionEffect); - } - -+ /** -+ * Returns true if the WatchableObject (Byte) is 0x01 otherwise returns false. The WatchableObject is updated using -+ * setBesideClimableBlock. -+ */ - public boolean isBesideClimbableBlock() { - return (this.dataWatcher.getWatchableObjectByte(16) & 1) != 0; - } - -- public void setBesideClimbableBlock(boolean var1) { -+ /** -+ * Updates the WatchableObject (Byte) created in entityInit(), setting it to 0x01 if par1 is true or 0x00 if it is -+ * false. -+ */ -+ public void setBesideClimbableBlock(boolean par1) { - byte var2 = this.dataWatcher.getWatchableObjectByte(16); -- if(var1) { -+ -+ if (par1) { - var2 = (byte)(var2 | 1); - } else { - var2 &= -2; -@@ -114,9 +161,10 @@ - this.dataWatcher.updateObject(16, Byte.valueOf(var2)); - } - -- public EntityLivingData onSpawnWithEgg(EntityLivingData var1) { -- Object var3 = super.onSpawnWithEgg(var1); -- if(this.worldObj.s.nextInt(100) == 0) { -+ public EntityLivingData onSpawnWithEgg(EntityLivingData par1EntityLivingData) { -+ Object par1EntityLivingData1 = super.onSpawnWithEgg(par1EntityLivingData); -+ -+ if (this.worldObj.rand.nextInt(100) == 0) { - EntitySkeleton var2 = new EntitySkeleton(this.worldObj); - var2.setLocationAndAngles(this.posX, this.posY, this.posZ, this.rotationYaw, 0.0F); - var2.onSpawnWithEgg((EntityLivingData)null); -@@ -124,20 +172,22 @@ - var2.mountEntity(this); - } - -- if(var3 == null) { -- var3 = new SpiderEffectsGroupData(); -- if(this.worldObj.difficultySetting > 2 && this.worldObj.s.nextFloat() < 0.1F * this.worldObj.getLocationTensionFactor(this.posX, this.posY, this.posZ)) { -- ((SpiderEffectsGroupData)var3).func_111104_a(this.worldObj.s); -+ if (par1EntityLivingData1 == null) { -+ par1EntityLivingData1 = new SpiderEffectsGroupData(); -+ -+ if (this.worldObj.difficultySetting > 2 && this.worldObj.rand.nextFloat() < 0.1F * this.worldObj.getLocationTensionFactor(this.posX, this.posY, this.posZ)) { -+ ((SpiderEffectsGroupData)par1EntityLivingData1).func_111104_a(this.worldObj.rand); - } - } - -- if(var3 instanceof SpiderEffectsGroupData) { -- int var4 = ((SpiderEffectsGroupData)var3).field_111105_a; -- if(var4 > 0 && Potion.potionTypes[var4] != null) { -+ if (par1EntityLivingData1 instanceof SpiderEffectsGroupData) { -+ int var4 = ((SpiderEffectsGroupData)par1EntityLivingData1).field_111105_a; -+ -+ if (var4 > 0 && Potion.potionTypes[var4] != null) { - this.addPotionEffect(new PotionEffect(var4, Integer.MAX_VALUE)); - } - } - -- return (EntityLivingData)var3; -+ return (EntityLivingData)par1EntityLivingData1; - } - } ---- net/minecraft/src/BlockPotato.java -+++ net/minecraft/src/BlockPotato.java -@@ -3,46 +3,61 @@ - public class BlockPotato extends BlockCrops { - private Icon[] iconArray; - -- public BlockPotato(int var1) { -- super(var1); -+ public BlockPotato(int par1) { -+ super(par1); - } - -- public Icon getIcon(int var1, int var2) { -- if(var2 < 7) { -- if(var2 == 6) { -- var2 = 5; -+ /** -+ * From the specified side and block metadata retrieves the blocks texture. Args: side, metadata -+ */ -+ public Icon getIcon(int par1, int par2) { -+ if (par2 < 7) { -+ if (par2 == 6) { -+ par2 = 5; - } - -- return this.iconArray[var2 >> 1]; -+ return this.iconArray[par2 >> 1]; - } else { - return this.iconArray[3]; - } - } - -+ /** -+ * Generate a seed ItemStack for this crop. -+ */ - protected int getSeedItem() { - return Item.potato.itemID; - } - -+ /** -+ * Generate a crop produce ItemStack for this crop. -+ */ - protected int getCropItem() { - return Item.potato.itemID; - } - -- public void dropBlockAsItemWithChance(World var1, int var2, int var3, int var4, int var5, float var6, int var7) { -- super.dropBlockAsItemWithChance(var1, var2, var3, var4, var5, var6, var7); -- if(!var1.isRemote) { -- if(var5 >= 7 && var1.s.nextInt(50) == 0) { -- this.dropBlockAsItem_do(var1, var2, var3, var4, new ItemStack(Item.poisonousPotato)); -+ /** -+ * Drops the block items with a specified chance of dropping the specified items -+ */ -+ public void dropBlockAsItemWithChance(World par1World, int par2, int par3, int par4, int par5, float par6, int par7) { -+ super.dropBlockAsItemWithChance(par1World, par2, par3, par4, par5, par6, par7); -+ -+ if (!par1World.isRemote) { -+ if (par5 >= 7 && par1World.rand.nextInt(50) == 0) { -+ this.dropBlockAsItem_do(par1World, par2, par3, par4, new ItemStack(Item.poisonousPotato)); - } -- - } - } - -- public void registerIcons(IconRegister var1) { -+ /** -+ * When this method is called, your block should register all the icons it needs with the given IconRegister. This is -+ * the only chance you get to register icons. -+ */ -+ public void registerIcons(IconRegister par1IconRegister) { - this.iconArray = new Icon[4]; - -- for(int var2 = 0; var2 < this.iconArray.length; ++var2) { -- this.iconArray[var2] = var1.registerIcon(this.getTextureName() + "_stage_" + var2); -+ for (int var2 = 0; var2 < this.iconArray.length; ++var2) { -+ this.iconArray[var2] = par1IconRegister.registerIcon(this.getTextureName() + "_stage_" + var2); - } -- - } - } ---- /dev/null -+++ org/spoutcraft/client/packet/PacketCustomBlockChunkOverride.java -@@ -1,0 +1,210 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.client.packet; -+ -+import java.io.IOException; -+import java.nio.ByteBuffer; -+import java.util.concurrent.LinkedBlockingDeque; -+import java.util.zip.DataFormatException; -+import java.util.zip.Deflater; -+import java.util.zip.Inflater; -+ -+import org.apache.commons.io.output.ByteArrayOutputStream; -+ -+import net.minecraft.src.EnumSkyBlock; -+import net.minecraft.src.World; -+ -+import org.spoutcraft.api.Spoutcraft; -+import org.spoutcraft.api.io.SpoutInputStream; -+import org.spoutcraft.api.io.SpoutOutputStream; -+import org.spoutcraft.api.material.CustomBlock; -+import org.spoutcraft.api.material.MaterialData; -+import org.spoutcraft.client.SpoutClient; -+import org.spoutcraft.client.packet.LightingThread.LightingData; -+ -+public class PacketCustomBlockChunkOverride implements CompressablePacket { -+ private static LightingThread thread; -+ private int chunkX; -+ private int chunkZ; -+ private boolean hasData = false; -+ private byte[] data; -+ private boolean compressed = true; -+ -+ public PacketCustomBlockChunkOverride() { -+ } -+ -+ public PacketCustomBlockChunkOverride(int x, int z) { -+ chunkX = x; -+ chunkZ = z; -+ compressed = false; -+ } -+ -+ public void readData(SpoutInputStream input) throws IOException { -+ chunkX = input.readInt(); -+ chunkZ = input.readInt(); -+ hasData = input.readBoolean(); -+ if (hasData) { -+ int size = input.readInt(); -+ data = new byte[size]; -+ input.read(data); -+ } -+ } -+ -+ public void writeData(SpoutOutputStream output) throws IOException { -+ output.writeInt(chunkX); -+ output.writeInt(chunkZ); -+ output.writeBoolean(hasData); -+ if (hasData) { -+ output.writeInt(data.length); -+ output.write(data); -+ } -+ } -+ -+ public void run(int playerId) { -+ if (hasData) { -+ if (!SpoutClient.getInstance().getRawWorld().chunkProvider.chunkExists(chunkX, chunkZ)) { -+ return; -+ } -+ -+ if (thread == null) { -+ thread = new LightingThread(); -+ thread.start(); -+ } -+ -+ ByteBuffer buffer = ByteBuffer.allocate(data.length); -+ buffer.put(data); -+ short[] customIds = new short[16*16*256]; -+ byte[] customData = new byte[16*16*256]; -+ for (int i = 0; i < customIds.length; i++) { -+ customIds[i] = buffer.getShort(i * 3); -+ customData[i] = buffer.get((i * 3) + 2); -+ } -+ Spoutcraft.getChunk(SpoutClient.getInstance().getRawWorld(), chunkX, chunkZ).setCustomBlockIds(customIds); -+ Spoutcraft.getChunk(SpoutClient.getInstance().getRawWorld(), chunkX, chunkZ).setCustomBlockData(customData); -+ thread.queue.add(new LightingData(chunkX, chunkZ, customIds)); -+ } -+ } -+ -+ public void failure(int playerId) { -+ } -+ -+ public PacketType getPacketType() { -+ return PacketType.PacketCustomBlockChunkOverride; -+ } -+ -+ public int getVersion() { -+ return 2; -+ } -+ -+ public void compress() { -+ if (!compressed && hasData) { -+ if (data != null) { -+ Deflater deflater = new Deflater(); -+ deflater.setInput(data); -+ deflater.setLevel(Deflater.BEST_COMPRESSION); -+ deflater.finish(); -+ ByteArrayOutputStream bos = new ByteArrayOutputStream(data.length); -+ byte[] buffer = new byte[1024]; -+ while (!deflater.finished()) { -+ int bytesCompressed = deflater.deflate(buffer); -+ bos.write(buffer, 0, bytesCompressed); -+ } -+ try { -+ bos.close(); -+ } catch (IOException e) { -+ e.printStackTrace(); -+ } -+ data = bos.toByteArray(); -+ } -+ compressed = true; -+ } -+ } -+ -+ public void decompress() { -+ if (compressed && hasData) { -+ Inflater decompressor = new Inflater(); -+ decompressor.setInput(data); -+ -+ ByteArrayOutputStream bos = new ByteArrayOutputStream(data.length); -+ -+ byte[] buf = new byte[1024]; -+ while (!decompressor.finished()) { -+ try { -+ int count = decompressor.inflate(buf); -+ bos.write(buf, 0, count); -+ } catch (DataFormatException e) { -+ } -+ } -+ try { -+ bos.close(); -+ } catch (IOException e) { -+ } -+ -+ data = bos.toByteArray(); -+ } -+ } -+ -+ public boolean isCompressed() { -+ return compressed; -+ } -+} -+ -+class LightingThread extends Thread { -+ final LinkedBlockingDeque queue = new LinkedBlockingDeque(); -+ final int[] lightingBlockList = new int[32768 * 4]; -+ LightingThread() { -+ super("Lighting Thread"); -+ setDaemon(true); -+ } -+ -+ @Override -+ public void run() { -+ while (!this.isInterrupted()) { -+ try { -+ LightingData data = queue.take(); -+ World world = SpoutClient.getHandle().theWorld; -+ if (world != null && world.chunkProvider.chunkExists(data.cx, data.cz)) { -+ for (int i = 0; i < data.ids.length; i++) { -+ CustomBlock cb = MaterialData.getCustomBlock(data.ids[i]); -+ if (cb != null && cb.getLightLevel() != 0) { -+ int bx = (i >> 12) & 0xF; -+ int by = i & 0xFF; -+ int bz = (i >> 8) & 0xF; -+ world.updateLightByType(lightingBlockList, EnumSkyBlock.Sky, data.cx * 16 + bx, by, data.cz * 16 + bz); -+ world.updateLightByType(lightingBlockList, EnumSkyBlock.Block, data.cx * 16 + bx, by, data.cz * 16 + bz); -+ } -+ } -+ } -+ } catch (InterruptedException e) { -+ return; -+ } -+ } -+ } -+ -+ static class LightingData{ -+ final int cx, cz; -+ final short[] ids; -+ LightingData(int cx, int cz, short[] ids) { -+ this.cx = cx; -+ this.cz = cz; -+ this.ids = ids; -+ } -+ } -+} ---- net/minecraft/src/ComponentVillageWell.java -+++ net/minecraft/src/ComponentVillageWell.java -@@ -4,60 +4,68 @@ - import java.util.Random; - - public class ComponentVillageWell extends ComponentVillage { -- public ComponentVillageWell() { -- } -- -- public ComponentVillageWell(ComponentVillageStartPiece var1, int var2, Random var3, int var4, int var5) { -- super(var1, var2); -- this.coordBaseMode = var3.nextInt(4); -- switch(this.coordBaseMode) { -- case 0: -- case 2: -- this.boundingBox = new StructureBoundingBox(var4, 64, var5, var4 + 6 - 1, 78, var5 + 6 - 1); -- break; -- default: -- this.boundingBox = new StructureBoundingBox(var4, 64, var5, var4 + 6 - 1, 78, var5 + 6 - 1); -+ public ComponentVillageWell() {} -+ -+ public ComponentVillageWell(ComponentVillageStartPiece par1ComponentVillageStartPiece, int par2, Random par3Random, int par4, int par5) { -+ super(par1ComponentVillageStartPiece, par2); -+ this.coordBaseMode = par3Random.nextInt(4); -+ -+ switch (this.coordBaseMode) { -+ case 0: -+ case 2: -+ this.boundingBox = new StructureBoundingBox(par4, 64, par5, par4 + 6 - 1, 78, par5 + 6 - 1); -+ break; -+ -+ default: -+ this.boundingBox = new StructureBoundingBox(par4, 64, par5, par4 + 6 - 1, 78, par5 + 6 - 1); - } -- -- } -- -- public void buildComponent(StructureComponent var1, List var2, Random var3) { -- StructureVillagePieces.getNextStructureComponentVillagePath((ComponentVillageStartPiece)var1, var2, var3, this.boundingBox.minX - 1, this.boundingBox.maxY - 4, this.boundingBox.minZ + 1, 1, this.getComponentType()); -- StructureVillagePieces.getNextStructureComponentVillagePath((ComponentVillageStartPiece)var1, var2, var3, this.boundingBox.maxX + 1, this.boundingBox.maxY - 4, this.boundingBox.minZ + 1, 3, this.getComponentType()); -- StructureVillagePieces.getNextStructureComponentVillagePath((ComponentVillageStartPiece)var1, var2, var3, this.boundingBox.minX + 1, this.boundingBox.maxY - 4, this.boundingBox.minZ - 1, 2, this.getComponentType()); -- StructureVillagePieces.getNextStructureComponentVillagePath((ComponentVillageStartPiece)var1, var2, var3, this.boundingBox.minX + 1, this.boundingBox.maxY - 4, this.boundingBox.maxZ + 1, 0, this.getComponentType()); -- } -- -- public boolean addComponentParts(World var1, Random var2, StructureBoundingBox var3) { -- if(this.field_143015_k < 0) { -- this.field_143015_k = this.getAverageGroundLevel(var1, var3); -- if(this.field_143015_k < 0) { -+ } -+ -+ /** -+ * Initiates construction of the Structure Component picked, at the current Location of StructGen -+ */ -+ public void buildComponent(StructureComponent par1StructureComponent, List par2List, Random par3Random) { -+ StructureVillagePieces.getNextStructureComponentVillagePath((ComponentVillageStartPiece)par1StructureComponent, par2List, par3Random, this.boundingBox.minX - 1, this.boundingBox.maxY - 4, this.boundingBox.minZ + 1, 1, this.getComponentType()); -+ StructureVillagePieces.getNextStructureComponentVillagePath((ComponentVillageStartPiece)par1StructureComponent, par2List, par3Random, this.boundingBox.maxX + 1, this.boundingBox.maxY - 4, this.boundingBox.minZ + 1, 3, this.getComponentType()); -+ StructureVillagePieces.getNextStructureComponentVillagePath((ComponentVillageStartPiece)par1StructureComponent, par2List, par3Random, this.boundingBox.minX + 1, this.boundingBox.maxY - 4, this.boundingBox.minZ - 1, 2, this.getComponentType()); -+ StructureVillagePieces.getNextStructureComponentVillagePath((ComponentVillageStartPiece)par1StructureComponent, par2List, par3Random, this.boundingBox.minX + 1, this.boundingBox.maxY - 4, this.boundingBox.maxZ + 1, 0, this.getComponentType()); -+ } -+ -+ /** -+ * second Part of Structure generating, this for example places Spiderwebs, Mob Spawners, it closes Mineshafts at the -+ * end, it adds Fences... -+ */ -+ public boolean addComponentParts(World par1World, Random par2Random, StructureBoundingBox par3StructureBoundingBox) { -+ if (this.field_143015_k < 0) { -+ this.field_143015_k = this.getAverageGroundLevel(par1World, par3StructureBoundingBox); -+ -+ if (this.field_143015_k < 0) { - return true; - } - - this.boundingBox.offset(0, this.field_143015_k - this.boundingBox.maxY + 3, 0); - } - -- this.fillWithBlocks(var1, var3, 1, 0, 1, 4, 12, 4, Block.cobblestone.blockID, Block.waterMoving.blockID, false); -- this.placeBlockAtCurrentPosition(var1, 0, 0, 2, 12, 2, var3); -- this.placeBlockAtCurrentPosition(var1, 0, 0, 3, 12, 2, var3); -- this.placeBlockAtCurrentPosition(var1, 0, 0, 2, 12, 3, var3); -- this.placeBlockAtCurrentPosition(var1, 0, 0, 3, 12, 3, var3); -- this.placeBlockAtCurrentPosition(var1, Block.fence.blockID, 0, 1, 13, 1, var3); -- this.placeBlockAtCurrentPosition(var1, Block.fence.blockID, 0, 1, 14, 1, var3); -- this.placeBlockAtCurrentPosition(var1, Block.fence.blockID, 0, 4, 13, 1, var3); -- this.placeBlockAtCurrentPosition(var1, Block.fence.blockID, 0, 4, 14, 1, var3); -- this.placeBlockAtCurrentPosition(var1, Block.fence.blockID, 0, 1, 13, 4, var3); -- this.placeBlockAtCurrentPosition(var1, Block.fence.blockID, 0, 1, 14, 4, var3); -- this.placeBlockAtCurrentPosition(var1, Block.fence.blockID, 0, 4, 13, 4, var3); -- this.placeBlockAtCurrentPosition(var1, Block.fence.blockID, 0, 4, 14, 4, var3); -- this.fillWithBlocks(var1, var3, 1, 15, 1, 4, 15, 4, Block.cobblestone.blockID, Block.cobblestone.blockID, false); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 1, 0, 1, 4, 12, 4, Block.cobblestone.blockID, Block.waterMoving.blockID, false); -+ this.placeBlockAtCurrentPosition(par1World, 0, 0, 2, 12, 2, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, 0, 0, 3, 12, 2, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, 0, 0, 2, 12, 3, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, 0, 0, 3, 12, 3, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.fence.blockID, 0, 1, 13, 1, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.fence.blockID, 0, 1, 14, 1, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.fence.blockID, 0, 4, 13, 1, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.fence.blockID, 0, 4, 14, 1, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.fence.blockID, 0, 1, 13, 4, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.fence.blockID, 0, 1, 14, 4, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.fence.blockID, 0, 4, 13, 4, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.fence.blockID, 0, 4, 14, 4, par3StructureBoundingBox); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 1, 15, 1, 4, 15, 4, Block.cobblestone.blockID, Block.cobblestone.blockID, false); - -- for(int var4 = 0; var4 <= 5; ++var4) { -- for(int var5 = 0; var5 <= 5; ++var5) { -- if(var5 == 0 || var5 == 5 || var4 == 0 || var4 == 5) { -- this.placeBlockAtCurrentPosition(var1, Block.gravel.blockID, 0, var5, 11, var4, var3); -- this.clearCurrentPositionBlocksUpwards(var1, var5, 12, var4, var3); -+ for (int var4 = 0; var4 <= 5; ++var4) { -+ for (int var5 = 0; var5 <= 5; ++var5) { -+ if (var5 == 0 || var5 == 5 || var4 == 0 || var4 == 5) { -+ this.placeBlockAtCurrentPosition(par1World, Block.gravel.blockID, 0, var5, 11, var4, par3StructureBoundingBox); -+ this.clearCurrentPositionBlocksUpwards(par1World, var5, 12, var4, par3StructureBoundingBox); - } - } - } ---- net/minecraft/src/BlockClay.java -+++ net/minecraft/src/BlockClay.java -@@ -3,16 +3,22 @@ - import java.util.Random; - - public class BlockClay extends Block { -- public BlockClay(int var1) { -- super(var1, Material.clay); -+ public BlockClay(int par1) { -+ super(par1, Material.clay); - this.setCreativeTab(CreativeTabs.tabBlock); - } - -- public int idDropped(int var1, Random var2, int var3) { -+ /** -+ * Returns the ID of the items to drop on destruction. -+ */ -+ public int idDropped(int par1, Random par2Random, int par3) { - return Item.clay.itemID; - } - -- public int quantityDropped(Random var1) { -+ /** -+ * Returns the quantity of items to drop on block destruction. -+ */ -+ public int quantityDropped(Random par1Random) { - return 4; - } - } ---- net/minecraft/src/ItemPotion.java -+++ net/minecraft/src/ItemPotion.java -@@ -10,147 +10,182 @@ - import java.util.Map.Entry; - - public class ItemPotion extends Item { -- private HashMap a = new HashMap(); -- private static final Map b = new LinkedHashMap(); -+ -+ /** maps potion damage values to lists of effect names */ -+ private HashMap effectCache = new HashMap(); -+ private static final Map field_77835_b = new LinkedHashMap(); - private Icon field_94591_c; - private Icon field_94590_d; - private Icon field_94592_ct; - -- public ItemPotion(int var1) { -- super(var1); -+ public ItemPotion(int par1) { -+ super(par1); - this.setMaxStackSize(1); - this.setHasSubtypes(true); - this.setMaxDamage(0); - this.setCreativeTab(CreativeTabs.tabBrewing); - } - -- public List getEffects(ItemStack var1) { -- if(var1.hasTagCompound() && var1.getTagCompound().hasKey("CustomPotionEffects")) { -+ /** -+ * Returns a list of potion effects for the specified itemstack. -+ */ -+ public List getEffects(ItemStack par1ItemStack) { -+ if (par1ItemStack.hasTagCompound() && par1ItemStack.getTagCompound().hasKey("CustomPotionEffects")) { - ArrayList var6 = new ArrayList(); -- NBTTagList var3 = var1.getTagCompound().getTagList("CustomPotionEffects"); -+ NBTTagList var3 = par1ItemStack.getTagCompound().getTagList("CustomPotionEffects"); - -- for(int var4 = 0; var4 < var3.tagCount(); ++var4) { -+ for (int var4 = 0; var4 < var3.tagCount(); ++var4) { - NBTTagCompound var5 = (NBTTagCompound)var3.tagAt(var4); - var6.add(PotionEffect.readCustomPotionEffectFromNBT(var5)); - } - - return var6; - } else { -- List var2 = (List)this.a.get(Integer.valueOf(var1.getItemDamage())); -- if(var2 == null) { -- var2 = PotionHelper.getPotionEffects(var1.getItemDamage(), false); -- this.a.put(Integer.valueOf(var1.getItemDamage()), var2); -+ List var2 = (List)this.effectCache.get(Integer.valueOf(par1ItemStack.getItemDamage())); -+ -+ if (var2 == null) { -+ var2 = PotionHelper.getPotionEffects(par1ItemStack.getItemDamage(), false); -+ this.effectCache.put(Integer.valueOf(par1ItemStack.getItemDamage()), var2); - } - - return var2; - } - } - -- public List getEffects(int var1) { -- List var2 = (List)this.a.get(Integer.valueOf(var1)); -- if(var2 == null) { -- var2 = PotionHelper.getPotionEffects(var1, false); -- this.a.put(Integer.valueOf(var1), var2); -+ /** -+ * Returns a list of effects for the specified potion damage value. -+ */ -+ public List getEffects(int par1) { -+ List var2 = (List)this.effectCache.get(Integer.valueOf(par1)); -+ -+ if (var2 == null) { -+ var2 = PotionHelper.getPotionEffects(par1, false); -+ this.effectCache.put(Integer.valueOf(par1), var2); - } - - return var2; - } - -- public ItemStack onEaten(ItemStack var1, World var2, EntityPlayer var3) { -- if(!var3.capabilities.isCreativeMode) { -- --var1.stackSize; -+ public ItemStack onEaten(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) { -+ if (!par3EntityPlayer.capabilities.isCreativeMode) { -+ --par1ItemStack.stackSize; - } - -- if(!var2.isRemote) { -- List var4 = this.getEffects(var1); -- if(var4 != null) { -+ if (!par2World.isRemote) { -+ List var4 = this.getEffects(par1ItemStack); -+ -+ if (var4 != null) { - Iterator var5 = var4.iterator(); - -- while(var5.hasNext()) { -+ while (var5.hasNext()) { - PotionEffect var6 = (PotionEffect)var5.next(); -- var3.addPotionEffect(new PotionEffect(var6)); -+ par3EntityPlayer.addPotionEffect(new PotionEffect(var6)); - } - } - } - -- if(!var3.capabilities.isCreativeMode) { -- if(var1.stackSize <= 0) { -+ if (!par3EntityPlayer.capabilities.isCreativeMode) { -+ if (par1ItemStack.stackSize <= 0) { - return new ItemStack(Item.glassBottle); - } - -- var3.inventory.addItemStackToInventory(new ItemStack(Item.glassBottle)); -+ par3EntityPlayer.inventory.addItemStackToInventory(new ItemStack(Item.glassBottle)); - } - -- return var1; -+ return par1ItemStack; - } - -- public int getMaxItemUseDuration(ItemStack var1) { -+ /** -+ * How long it takes to use or consume an item -+ */ -+ public int getMaxItemUseDuration(ItemStack par1ItemStack) { - return 32; - } - -- public EnumAction getItemUseAction(ItemStack var1) { -+ /** -+ * returns the action that specifies what animation to play when the items is being used -+ */ -+ public EnumAction getItemUseAction(ItemStack par1ItemStack) { - return EnumAction.drink; - } - -- public ItemStack onItemRightClick(ItemStack var1, World var2, EntityPlayer var3) { -- if(isSplash(var1.getItemDamage())) { -- if(!var3.capabilities.isCreativeMode) { -- --var1.stackSize; -- } -- -- var2.playSoundAtEntity(var3, "random.bow", 0.5F, 0.4F / (f.nextFloat() * 0.4F + 0.8F)); -- if(!var2.isRemote) { -- var2.spawnEntityInWorld(new EntityPotion(var2, var3, var1)); -- } -- -- return var1; -+ /** -+ * Called whenever this item is equipped and the right mouse button is pressed. Args: itemStack, world, entityPlayer -+ */ -+ public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) { -+ if (isSplash(par1ItemStack.getItemDamage())) { -+ if (!par3EntityPlayer.capabilities.isCreativeMode) { -+ --par1ItemStack.stackSize; -+ } -+ -+ par2World.playSoundAtEntity(par3EntityPlayer, "random.bow", 0.5F, 0.4F / (itemRand.nextFloat() * 0.4F + 0.8F)); -+ -+ if (!par2World.isRemote) { -+ par2World.spawnEntityInWorld(new EntityPotion(par2World, par3EntityPlayer, par1ItemStack)); -+ } -+ -+ return par1ItemStack; - } else { -- var3.setItemInUse(var1, this.getMaxItemUseDuration(var1)); -- return var1; -+ par3EntityPlayer.setItemInUse(par1ItemStack, this.getMaxItemUseDuration(par1ItemStack)); -+ return par1ItemStack; - } - } - -- public boolean onItemUse(ItemStack var1, EntityPlayer var2, World var3, int var4, int var5, int var6, int var7, float var8, float var9, float var10) { -+ /** -+ * Callback for item usage. If the item does something special on right clicking, he will have one of those. Return -+ * True if something happen and false if it don't. This is for ITEMS, not BLOCKS -+ */ -+ public boolean onItemUse(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, World par3World, int par4, int par5, int par6, int par7, float par8, float par9, float par10) { - return false; - } - -- public Icon getIconFromDamage(int var1) { -- return isSplash(var1) ? this.field_94591_c : this.field_94590_d; -- } -- -- public Icon getIconFromDamageForRenderPass(int var1, int var2) { -- return var2 == 0 ? this.field_94592_ct : super.getIconFromDamageForRenderPass(var1, var2); -- } -- -- public static boolean isSplash(int var0) { -- return (var0 & 16384) != 0; -- } -- -- public int getColorFromDamage(int var1) { -- return PotionHelper.func_77915_a(var1, false); -- } -- -- public int getColorFromItemStack(ItemStack var1, int var2) { -- return var2 > 0 ? 16777215 : this.getColorFromDamage(var1.getItemDamage()); -+ /** -+ * Gets an icon index based on an item's damage value -+ */ -+ public Icon getIconFromDamage(int par1) { -+ return isSplash(par1) ? this.field_94591_c : this.field_94590_d; -+ } -+ -+ /** -+ * Gets an icon index based on an item's damage value and the given render pass -+ */ -+ public Icon getIconFromDamageForRenderPass(int par1, int par2) { -+ return par2 == 0 ? this.field_94592_ct : super.getIconFromDamageForRenderPass(par1, par2); -+ } -+ -+ /** -+ * returns wether or not a potion is a throwable splash potion based on damage value -+ */ -+ public static boolean isSplash(int par0) { -+ return (par0 & 16384) != 0; -+ } -+ -+ public int getColorFromDamage(int par1) { -+ return PotionHelper.func_77915_a(par1, false); -+ } -+ -+ public int getColorFromItemStack(ItemStack par1ItemStack, int par2) { -+ return par2 > 0 ? 16777215 : this.getColorFromDamage(par1ItemStack.getItemDamage()); - } - - public boolean requiresMultipleRenderPasses() { - return true; - } - -- public boolean isEffectInstant(int var1) { -- List var2 = this.getEffects(var1); -- if(var2 != null && !var2.isEmpty()) { -+ public boolean isEffectInstant(int par1) { -+ List var2 = this.getEffects(par1); -+ -+ if (var2 != null && !var2.isEmpty()) { - Iterator var3 = var2.iterator(); -- - PotionEffect var4; -+ - do { -- if(!var3.hasNext()) { -+ if (!var3.hasNext()) { - return false; - } - - var4 = (PotionEffect)var3.next(); -- } while(!Potion.potionTypes[var4.getPotionID()].isInstant()); -+ } while (!Potion.potionTypes[var4.getPotionID()].isInstant()); - - return true; - } else { -@@ -158,45 +193,52 @@ - } - } - -- public String getItemDisplayName(ItemStack var1) { -- if(var1.getItemDamage() == 0) { -+ public String getItemDisplayName(ItemStack par1ItemStack) { -+ if (par1ItemStack.getItemDamage() == 0) { - return StatCollector.translateToLocal("item.emptyPotion.name").trim(); - } else { - String var2 = ""; -- if(isSplash(var1.getItemDamage())) { -+ -+ if (isSplash(par1ItemStack.getItemDamage())) { - var2 = StatCollector.translateToLocal("potion.prefix.grenade").trim() + " "; - } - -- List var3 = Item.potion.getEffects(var1); -+ List var3 = Item.potion.getEffects(par1ItemStack); - String var4; -- if(var3 != null && !var3.isEmpty()) { -+ -+ if (var3 != null && !var3.isEmpty()) { - var4 = ((PotionEffect)var3.get(0)).getEffectName(); - var4 = var4 + ".postfix"; - return var2 + StatCollector.translateToLocal(var4).trim(); - } else { -- var4 = PotionHelper.func_77905_c(var1.getItemDamage()); -- return StatCollector.translateToLocal(var4).trim() + " " + super.getItemDisplayName(var1); -+ var4 = PotionHelper.func_77905_c(par1ItemStack.getItemDamage()); -+ return StatCollector.translateToLocal(var4).trim() + " " + super.getItemDisplayName(par1ItemStack); - } - } - } - -- public void addInformation(ItemStack var1, EntityPlayer var2, List var3, boolean var4) { -- if(var1.getItemDamage() != 0) { -- List var5 = Item.potion.getEffects(var1); -+ /** -+ * allows items to add custom lines of information to the mouseover description -+ */ -+ public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4) { -+ if (par1ItemStack.getItemDamage() != 0) { -+ List var5 = Item.potion.getEffects(par1ItemStack); - HashMultimap var6 = HashMultimap.create(); - Iterator var16; -- if(var5 != null && !var5.isEmpty()) { -+ -+ if (var5 != null && !var5.isEmpty()) { - var16 = var5.iterator(); - -- while(var16.hasNext()) { -+ while (var16.hasNext()) { - PotionEffect var8 = (PotionEffect)var16.next(); - String var9 = StatCollector.translateToLocal(var8.getEffectName()).trim(); - Potion var10 = Potion.potionTypes[var8.getPotionID()]; - Map var11 = var10.func_111186_k(); -- if(var11 != null && var11.size() > 0) { -+ -+ if (var11 != null && var11.size() > 0) { - Iterator var12 = var11.entrySet().iterator(); - -- while(var12.hasNext()) { -+ while (var12.hasNext()) { - Entry var13 = (Entry)var12.next(); - AttributeModifier var14 = (AttributeModifier)var13.getValue(); - AttributeModifier var15 = new AttributeModifier(var14.getName(), var10.func_111183_a(var8.getAmplifier(), var14), var14.getOperation()); -@@ -204,106 +246,112 @@ - } - } - -- if(var8.getAmplifier() > 0) { -+ if (var8.getAmplifier() > 0) { - var9 = var9 + " " + StatCollector.translateToLocal("potion.potency." + var8.getAmplifier()).trim(); - } - -- if(var8.getDuration() > 20) { -+ if (var8.getDuration() > 20) { - var9 = var9 + " (" + Potion.getDurationString(var8) + ")"; - } - -- if(var10.isBadEffect()) { -- var3.add(EnumChatFormatting.RED + var9); -+ if (var10.isBadEffect()) { -+ par3List.add(EnumChatFormatting.RED + var9); - } else { -- var3.add(EnumChatFormatting.GRAY + var9); -+ par3List.add(EnumChatFormatting.GRAY + var9); - } - } - } else { - String var7 = StatCollector.translateToLocal("potion.empty").trim(); -- var3.add(EnumChatFormatting.GRAY + var7); -+ par3List.add(EnumChatFormatting.GRAY + var7); - } - -- if(!var6.isEmpty()) { -- var3.add(""); -- var3.add(EnumChatFormatting.DARK_PURPLE + StatCollector.translateToLocal("potion.effects.whenDrank")); -+ if (!var6.isEmpty()) { -+ par3List.add(""); -+ par3List.add(EnumChatFormatting.DARK_PURPLE + StatCollector.translateToLocal("potion.effects.whenDrank")); - var16 = var6.entries().iterator(); - -- while(var16.hasNext()) { -+ while (var16.hasNext()) { - Entry var17 = (Entry)var16.next(); - AttributeModifier var19 = (AttributeModifier)var17.getValue(); - double var18 = var19.getAmount(); - double var20; -- if(var19.getOperation() != 1 && var19.getOperation() != 2) { -+ -+ if (var19.getOperation() != 1 && var19.getOperation() != 2) { - var20 = var19.getAmount(); - } else { - var20 = var19.getAmount() * 100.0D; - } - -- if(var18 > 0.0D) { -- var3.add(EnumChatFormatting.BLUE + StatCollector.translateToLocalFormatted("attribute.modifier.plus." + var19.getOperation(), new Object[]{ItemStack.a.format(var20), StatCollector.translateToLocal("attribute.name." + (String)var17.getKey())})); -- } else if(var18 < 0.0D) { -+ if (var18 > 0.0D) { -+ par3List.add(EnumChatFormatting.BLUE + StatCollector.translateToLocalFormatted("attribute.modifier.plus." + var19.getOperation(), new Object[] {ItemStack.field_111284_a.format(var20), StatCollector.translateToLocal("attribute.name." + (String)var17.getKey())})); -+ } else if (var18 < 0.0D) { - var20 *= -1.0D; -- var3.add(EnumChatFormatting.RED + StatCollector.translateToLocalFormatted("attribute.modifier.take." + var19.getOperation(), new Object[]{ItemStack.a.format(var20), StatCollector.translateToLocal("attribute.name." + (String)var17.getKey())})); -+ par3List.add(EnumChatFormatting.RED + StatCollector.translateToLocalFormatted("attribute.modifier.take." + var19.getOperation(), new Object[] {ItemStack.field_111284_a.format(var20), StatCollector.translateToLocal("attribute.name." + (String)var17.getKey())})); - } - } - } -- - } - } - -- public boolean hasEffect(ItemStack var1) { -- List var2 = this.getEffects(var1); -+ public boolean hasEffect(ItemStack par1ItemStack) { -+ List var2 = this.getEffects(par1ItemStack); - return var2 != null && !var2.isEmpty(); - } - -- public void getSubItems(int var1, CreativeTabs var2, List var3) { -- super.getSubItems(var1, var2, var3); -+ /** -+ * returns a list of items with the same ID, but different meta (eg: dye returns 16 items) -+ */ -+ public void getSubItems(int par1, CreativeTabs par2CreativeTabs, List par3List) { -+ super.getSubItems(par1, par2CreativeTabs, par3List); - int var5; -- if(b.isEmpty()) { -- for(int var4 = 0; var4 <= 15; ++var4) { -- for(var5 = 0; var5 <= 1; ++var5) { -+ -+ if (field_77835_b.isEmpty()) { -+ for (int var4 = 0; var4 <= 15; ++var4) { -+ for (var5 = 0; var5 <= 1; ++var5) { - int var6; -- if(var5 == 0) { -+ -+ if (var5 == 0) { - var6 = var4 | 8192; - } else { - var6 = var4 | 16384; - } - -- for(int var7 = 0; var7 <= 2; ++var7) { -+ for (int var7 = 0; var7 <= 2; ++var7) { - int var8 = var6; -- if(var7 != 0) { -- if(var7 == 1) { -+ -+ if (var7 != 0) { -+ if (var7 == 1) { - var8 = var6 | 32; -- } else if(var7 == 2) { -+ } else if (var7 == 2) { - var8 = var6 | 64; - } - } - - List var9 = PotionHelper.getPotionEffects(var8, false); -- if(var9 != null && !var9.isEmpty()) { -- b.put(var9, Integer.valueOf(var8)); -+ -+ if (var9 != null && !var9.isEmpty()) { -+ field_77835_b.put(var9, Integer.valueOf(var8)); - } - } - } - } - } - -- Iterator var10 = b.values().iterator(); -+ Iterator var10 = field_77835_b.values().iterator(); - -- while(var10.hasNext()) { -+ while (var10.hasNext()) { - var5 = ((Integer)var10.next()).intValue(); -- var3.add(new ItemStack(var1, 1, var5)); -+ par3List.add(new ItemStack(par1, 1, var5)); - } -- -- } -- -- public void registerIcons(IconRegister var1) { -- this.field_94590_d = var1.registerIcon(this.getIconString() + "_" + "bottle_drinkable"); -- this.field_94591_c = var1.registerIcon(this.getIconString() + "_" + "bottle_splash"); -- this.field_94592_ct = var1.registerIcon(this.getIconString() + "_" + "overlay"); -- } -- -- public static Icon func_94589_d(String var0) { -- return var0.equals("bottle_drinkable") ? Item.potion.field_94590_d : (var0.equals("bottle_splash") ? Item.potion.field_94591_c : (var0.equals("overlay") ? Item.potion.field_94592_ct : null)); -+ } -+ -+ public void registerIcons(IconRegister par1IconRegister) { -+ this.field_94590_d = par1IconRegister.registerIcon(this.getIconString() + "_" + "bottle_drinkable"); -+ this.field_94591_c = par1IconRegister.registerIcon(this.getIconString() + "_" + "bottle_splash"); -+ this.field_94592_ct = par1IconRegister.registerIcon(this.getIconString() + "_" + "overlay"); -+ } -+ -+ public static Icon func_94589_d(String par0Str) { -+ return par0Str.equals("bottle_drinkable") ? Item.potion.field_94590_d : (par0Str.equals("bottle_splash") ? Item.potion.field_94591_c : (par0Str.equals("overlay") ? Item.potion.field_94592_ct : null)); - } - } ---- net/minecraft/src/ItemAppleGold.java -+++ net/minecraft/src/ItemAppleGold.java -@@ -3,38 +3,43 @@ - import java.util.List; - - public class ItemAppleGold extends ItemFood { -- public ItemAppleGold(int var1, int var2, float var3, boolean var4) { -- super(var1, var2, var3, var4); -+ public ItemAppleGold(int par1, int par2, float par3, boolean par4) { -+ super(par1, par2, par3, par4); - this.setHasSubtypes(true); - } - -- public boolean hasEffect(ItemStack var1) { -- return var1.getItemDamage() > 0; -- } -- -- public EnumRarity getRarity(ItemStack var1) { -- return var1.getItemDamage() == 0 ? EnumRarity.rare : EnumRarity.epic; -- } -- -- protected void onFoodEaten(ItemStack var1, World var2, EntityPlayer var3) { -- if(!var2.isRemote) { -- var3.addPotionEffect(new PotionEffect(Potion.field_76444_x.id, 2400, 0)); -+ public boolean hasEffect(ItemStack par1ItemStack) { -+ return par1ItemStack.getItemDamage() > 0; -+ } -+ -+ /** -+ * Return an item rarity from EnumRarity -+ */ -+ public EnumRarity getRarity(ItemStack par1ItemStack) { -+ return par1ItemStack.getItemDamage() == 0 ? EnumRarity.rare : EnumRarity.epic; -+ } -+ -+ protected void onFoodEaten(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) { -+ if (!par2World.isRemote) { -+ par3EntityPlayer.addPotionEffect(new PotionEffect(Potion.field_76444_x.id, 2400, 0)); - } - -- if(var1.getItemDamage() > 0) { -- if(!var2.isRemote) { -- var3.addPotionEffect(new PotionEffect(Potion.regeneration.id, 600, 4)); -- var3.addPotionEffect(new PotionEffect(Potion.resistance.id, 6000, 0)); -- var3.addPotionEffect(new PotionEffect(Potion.fireResistance.id, 6000, 0)); -+ if (par1ItemStack.getItemDamage() > 0) { -+ if (!par2World.isRemote) { -+ par3EntityPlayer.addPotionEffect(new PotionEffect(Potion.regeneration.id, 600, 4)); -+ par3EntityPlayer.addPotionEffect(new PotionEffect(Potion.resistance.id, 6000, 0)); -+ par3EntityPlayer.addPotionEffect(new PotionEffect(Potion.fireResistance.id, 6000, 0)); - } - } else { -- super.onFoodEaten(var1, var2, var3); -+ super.onFoodEaten(par1ItemStack, par2World, par3EntityPlayer); - } -- - } - -- public void getSubItems(int var1, CreativeTabs var2, List var3) { -- var3.add(new ItemStack(var1, 1, 0)); -- var3.add(new ItemStack(var1, 1, 1)); -+ /** -+ * returns a list of items with the same ID, but different meta (eg: dye returns 16 items) -+ */ -+ public void getSubItems(int par1, CreativeTabs par2CreativeTabs, List par3List) { -+ par3List.add(new ItemStack(par1, 1, 0)); -+ par3List.add(new ItemStack(par1, 1, 1)); - } - } ---- /dev/null -+++ org/spoutcraft/api/material/item/Dye.java -@@ -1,0 +1,27 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.api.material.item; -+ -+public class Dye extends GenericItem{ -+ public Dye(String name, int id, int data) { -+ super(name, id, data); -+ // TODO Auto-generated constructor stub -+ } -+} ---- /dev/null -+++ org/spoutcraft/client/packet/PacketGenericBlock.java -@@ -1,0 +1,55 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.client.packet; -+ -+import java.io.IOException; -+ -+import org.spoutcraft.api.inventory.ItemStack; -+import org.spoutcraft.api.io.SpoutInputStream; -+import org.spoutcraft.api.io.SpoutOutputStream; -+import org.spoutcraft.api.material.block.GenericCustomBlock; -+ -+public class PacketGenericBlock implements SpoutPacket { -+ GenericCustomBlock block = new GenericCustomBlock(); -+ public PacketGenericBlock() { -+ } -+ -+ public void readData(SpoutInputStream input) throws IOException { -+ block.readData(input); -+ } -+ -+ public void writeData(SpoutOutputStream output) throws IOException { -+ } -+ -+ public void run(int playerId) { -+ block.setItemDrop(new ItemStack(block, 1)); -+ } -+ -+ public void failure(int playerId) { -+ } -+ -+ public PacketType getPacketType() { -+ return PacketType.PacketGenericBlock; -+ } -+ -+ public int getVersion() { -+ return block.getVersion(); -+ } -+} ---- /dev/null -+++ org/spoutcraft/client/packet/PacketCacheDeleteFile.java -@@ -1,0 +1,66 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.client.packet; -+ -+import java.io.IOException; -+ -+import org.spoutcraft.api.io.SpoutInputStream; -+import org.spoutcraft.api.io.SpoutOutputStream; -+ -+public class PacketCacheDeleteFile implements SpoutPacket { -+ private String plugin; -+ private String fileName; -+ public PacketCacheDeleteFile() { -+ } -+ -+ public PacketCacheDeleteFile(String plugin, String fileName) { -+ this.plugin = plugin; -+ this.fileName = fileName; -+ } -+ -+ public void readData(SpoutInputStream input) throws IOException { -+ fileName = input.readString(); -+ plugin = input.readString(); -+ } -+ -+ public void writeData(SpoutOutputStream output) throws IOException { -+ output.writeString(fileName); -+ output.writeString(plugin); -+ } -+ -+ public void run(int playerId) { -+ // TODO Fix security vulnerability: http://pastie.org/private/qdmx5veidnood1ectllkcq -+ /*File file = FileUtil.findFile(plugin, fileName); -+ if (file != null) { -+ file.delete(); -+ }*/ -+ } -+ -+ public void failure(int playerId) { -+ } -+ -+ public PacketType getPacketType() { -+ return PacketType.PacketCacheDeleteFile; -+ } -+ -+ public int getVersion() { -+ return 0; -+ } -+} ---- net/minecraft/src/CommandKill.java -+++ net/minecraft/src/CommandKill.java -@@ -5,17 +5,20 @@ - return "kill"; - } - -+ /** -+ * Return the required permission level for this command. -+ */ - public int getRequiredPermissionLevel() { - return 0; - } - -- public String getCommandUsage(ICommandSender var1) { -+ public String getCommandUsage(ICommandSender par1ICommandSender) { - return "commands.kill.usage"; - } - -- public void processCommand(ICommandSender var1, String[] var2) { -- EntityPlayerMP var3 = getCommandSenderAsPlayer(var1); -+ public void processCommand(ICommandSender par1ICommandSender, String[] par2ArrayOfStr) { -+ EntityPlayerMP var3 = getCommandSenderAsPlayer(par1ICommandSender); - var3.attackEntityFrom(DamageSource.outOfWorld, Float.MAX_VALUE); -- var1.sendChatToPlayer(ChatMessageComponent.createFromTranslationKey("commands.kill.success")); -+ par1ICommandSender.sendChatToPlayer(ChatMessageComponent.createFromTranslationKey("commands.kill.success")); - } - } ---- net/minecraft/src/ComponentVillageWoodHut.java -+++ net/minecraft/src/ComponentVillageWoodHut.java -@@ -7,93 +7,100 @@ - private boolean isTallHouse; - private int tablePosition; - -- public ComponentVillageWoodHut() { -- } -- -- public ComponentVillageWoodHut(ComponentVillageStartPiece var1, int var2, Random var3, StructureBoundingBox var4, int var5) { -- super(var1, var2); -- this.coordBaseMode = var5; -- this.boundingBox = var4; -- this.isTallHouse = var3.nextBoolean(); -- this.tablePosition = var3.nextInt(3); -- } -- -- protected void func_143012_a(NBTTagCompound var1) { -- super.func_143012_a(var1); -- var1.setInteger("T", this.tablePosition); -- var1.setBoolean("C", this.isTallHouse); -- } -- -- protected void func_143011_b(NBTTagCompound var1) { -- super.func_143011_b(var1); -- this.tablePosition = var1.getInteger("T"); -- this.isTallHouse = var1.getBoolean("C"); -- } -- -- public static ComponentVillageWoodHut func_74908_a(ComponentVillageStartPiece var0, List var1, Random var2, int var3, int var4, int var5, int var6, int var7) { -- StructureBoundingBox var8 = StructureBoundingBox.getComponentToAddBoundingBox(var3, var4, var5, 0, 0, 0, 4, 6, 5, var6); -- return canVillageGoDeeper(var8) && StructureComponent.findIntersecting(var1, var8) == null ? new ComponentVillageWoodHut(var0, var7, var2, var8, var6) : null; -- } -- -- public boolean addComponentParts(World var1, Random var2, StructureBoundingBox var3) { -- if(this.field_143015_k < 0) { -- this.field_143015_k = this.getAverageGroundLevel(var1, var3); -- if(this.field_143015_k < 0) { -+ public ComponentVillageWoodHut() {} -+ -+ public ComponentVillageWoodHut(ComponentVillageStartPiece par1ComponentVillageStartPiece, int par2, Random par3Random, StructureBoundingBox par4StructureBoundingBox, int par5) { -+ super(par1ComponentVillageStartPiece, par2); -+ this.coordBaseMode = par5; -+ this.boundingBox = par4StructureBoundingBox; -+ this.isTallHouse = par3Random.nextBoolean(); -+ this.tablePosition = par3Random.nextInt(3); -+ } -+ -+ protected void func_143012_a(NBTTagCompound par1NBTTagCompound) { -+ super.func_143012_a(par1NBTTagCompound); -+ par1NBTTagCompound.setInteger("T", this.tablePosition); -+ par1NBTTagCompound.setBoolean("C", this.isTallHouse); -+ } -+ -+ protected void func_143011_b(NBTTagCompound par1NBTTagCompound) { -+ super.func_143011_b(par1NBTTagCompound); -+ this.tablePosition = par1NBTTagCompound.getInteger("T"); -+ this.isTallHouse = par1NBTTagCompound.getBoolean("C"); -+ } -+ -+ public static ComponentVillageWoodHut func_74908_a(ComponentVillageStartPiece par0ComponentVillageStartPiece, List par1List, Random par2Random, int par3, int par4, int par5, int par6, int par7) { -+ StructureBoundingBox var8 = StructureBoundingBox.getComponentToAddBoundingBox(par3, par4, par5, 0, 0, 0, 4, 6, 5, par6); -+ return canVillageGoDeeper(var8) && StructureComponent.findIntersecting(par1List, var8) == null ? new ComponentVillageWoodHut(par0ComponentVillageStartPiece, par7, par2Random, var8, par6) : null; -+ } -+ -+ /** -+ * second Part of Structure generating, this for example places Spiderwebs, Mob Spawners, it closes Mineshafts at the -+ * end, it adds Fences... -+ */ -+ public boolean addComponentParts(World par1World, Random par2Random, StructureBoundingBox par3StructureBoundingBox) { -+ if (this.field_143015_k < 0) { -+ this.field_143015_k = this.getAverageGroundLevel(par1World, par3StructureBoundingBox); -+ -+ if (this.field_143015_k < 0) { - return true; - } - - this.boundingBox.offset(0, this.field_143015_k - this.boundingBox.maxY + 6 - 1, 0); - } - -- this.fillWithBlocks(var1, var3, 1, 1, 1, 3, 5, 4, 0, 0, false); -- this.fillWithBlocks(var1, var3, 0, 0, 0, 3, 0, 4, Block.cobblestone.blockID, Block.cobblestone.blockID, false); -- this.fillWithBlocks(var1, var3, 1, 0, 1, 2, 0, 3, Block.dirt.blockID, Block.dirt.blockID, false); -- if(this.isTallHouse) { -- this.fillWithBlocks(var1, var3, 1, 4, 1, 2, 4, 3, Block.wood.blockID, Block.wood.blockID, false); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 1, 1, 1, 3, 5, 4, 0, 0, false); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 0, 0, 0, 3, 0, 4, Block.cobblestone.blockID, Block.cobblestone.blockID, false); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 1, 0, 1, 2, 0, 3, Block.dirt.blockID, Block.dirt.blockID, false); -+ -+ if (this.isTallHouse) { -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 1, 4, 1, 2, 4, 3, Block.wood.blockID, Block.wood.blockID, false); - } else { -- this.fillWithBlocks(var1, var3, 1, 5, 1, 2, 5, 3, Block.wood.blockID, Block.wood.blockID, false); -- } -- -- this.placeBlockAtCurrentPosition(var1, Block.wood.blockID, 0, 1, 4, 0, var3); -- this.placeBlockAtCurrentPosition(var1, Block.wood.blockID, 0, 2, 4, 0, var3); -- this.placeBlockAtCurrentPosition(var1, Block.wood.blockID, 0, 1, 4, 4, var3); -- this.placeBlockAtCurrentPosition(var1, Block.wood.blockID, 0, 2, 4, 4, var3); -- this.placeBlockAtCurrentPosition(var1, Block.wood.blockID, 0, 0, 4, 1, var3); -- this.placeBlockAtCurrentPosition(var1, Block.wood.blockID, 0, 0, 4, 2, var3); -- this.placeBlockAtCurrentPosition(var1, Block.wood.blockID, 0, 0, 4, 3, var3); -- this.placeBlockAtCurrentPosition(var1, Block.wood.blockID, 0, 3, 4, 1, var3); -- this.placeBlockAtCurrentPosition(var1, Block.wood.blockID, 0, 3, 4, 2, var3); -- this.placeBlockAtCurrentPosition(var1, Block.wood.blockID, 0, 3, 4, 3, var3); -- this.fillWithBlocks(var1, var3, 0, 1, 0, 0, 3, 0, Block.wood.blockID, Block.wood.blockID, false); -- this.fillWithBlocks(var1, var3, 3, 1, 0, 3, 3, 0, Block.wood.blockID, Block.wood.blockID, false); -- this.fillWithBlocks(var1, var3, 0, 1, 4, 0, 3, 4, Block.wood.blockID, Block.wood.blockID, false); -- this.fillWithBlocks(var1, var3, 3, 1, 4, 3, 3, 4, Block.wood.blockID, Block.wood.blockID, false); -- this.fillWithBlocks(var1, var3, 0, 1, 1, 0, 3, 3, Block.planks.blockID, Block.planks.blockID, false); -- this.fillWithBlocks(var1, var3, 3, 1, 1, 3, 3, 3, Block.planks.blockID, Block.planks.blockID, false); -- this.fillWithBlocks(var1, var3, 1, 1, 0, 2, 3, 0, Block.planks.blockID, Block.planks.blockID, false); -- this.fillWithBlocks(var1, var3, 1, 1, 4, 2, 3, 4, Block.planks.blockID, Block.planks.blockID, false); -- this.placeBlockAtCurrentPosition(var1, Block.thinGlass.blockID, 0, 0, 2, 2, var3); -- this.placeBlockAtCurrentPosition(var1, Block.thinGlass.blockID, 0, 3, 2, 2, var3); -- if(this.tablePosition > 0) { -- this.placeBlockAtCurrentPosition(var1, Block.fence.blockID, 0, this.tablePosition, 1, 3, var3); -- this.placeBlockAtCurrentPosition(var1, Block.pressurePlatePlanks.blockID, 0, this.tablePosition, 2, 3, var3); -- } -- -- this.placeBlockAtCurrentPosition(var1, 0, 0, 1, 1, 0, var3); -- this.placeBlockAtCurrentPosition(var1, 0, 0, 1, 2, 0, var3); -- this.placeDoorAtCurrentPosition(var1, var3, var2, 1, 1, 0, this.getMetadataWithOffset(Block.doorWood.blockID, 1)); -- if(this.getBlockIdAtCurrentPosition(var1, 1, 0, -1, var3) == 0 && this.getBlockIdAtCurrentPosition(var1, 1, -1, -1, var3) != 0) { -- this.placeBlockAtCurrentPosition(var1, Block.stairsCobblestone.blockID, this.getMetadataWithOffset(Block.stairsCobblestone.blockID, 3), 1, 0, -1, var3); -- } -- -- for(int var4 = 0; var4 < 5; ++var4) { -- for(int var5 = 0; var5 < 4; ++var5) { -- this.clearCurrentPositionBlocksUpwards(var1, var5, 6, var4, var3); -- this.fillCurrentPositionBlocksDownwards(var1, Block.cobblestone.blockID, 0, var5, -1, var4, var3); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 1, 5, 1, 2, 5, 3, Block.wood.blockID, Block.wood.blockID, false); -+ } -+ -+ this.placeBlockAtCurrentPosition(par1World, Block.wood.blockID, 0, 1, 4, 0, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.wood.blockID, 0, 2, 4, 0, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.wood.blockID, 0, 1, 4, 4, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.wood.blockID, 0, 2, 4, 4, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.wood.blockID, 0, 0, 4, 1, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.wood.blockID, 0, 0, 4, 2, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.wood.blockID, 0, 0, 4, 3, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.wood.blockID, 0, 3, 4, 1, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.wood.blockID, 0, 3, 4, 2, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.wood.blockID, 0, 3, 4, 3, par3StructureBoundingBox); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 0, 1, 0, 0, 3, 0, Block.wood.blockID, Block.wood.blockID, false); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 3, 1, 0, 3, 3, 0, Block.wood.blockID, Block.wood.blockID, false); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 0, 1, 4, 0, 3, 4, Block.wood.blockID, Block.wood.blockID, false); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 3, 1, 4, 3, 3, 4, Block.wood.blockID, Block.wood.blockID, false); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 0, 1, 1, 0, 3, 3, Block.planks.blockID, Block.planks.blockID, false); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 3, 1, 1, 3, 3, 3, Block.planks.blockID, Block.planks.blockID, false); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 1, 1, 0, 2, 3, 0, Block.planks.blockID, Block.planks.blockID, false); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 1, 1, 4, 2, 3, 4, Block.planks.blockID, Block.planks.blockID, false); -+ this.placeBlockAtCurrentPosition(par1World, Block.thinGlass.blockID, 0, 0, 2, 2, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.thinGlass.blockID, 0, 3, 2, 2, par3StructureBoundingBox); -+ -+ if (this.tablePosition > 0) { -+ this.placeBlockAtCurrentPosition(par1World, Block.fence.blockID, 0, this.tablePosition, 1, 3, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.pressurePlatePlanks.blockID, 0, this.tablePosition, 2, 3, par3StructureBoundingBox); -+ } -+ -+ this.placeBlockAtCurrentPosition(par1World, 0, 0, 1, 1, 0, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, 0, 0, 1, 2, 0, par3StructureBoundingBox); -+ this.placeDoorAtCurrentPosition(par1World, par3StructureBoundingBox, par2Random, 1, 1, 0, this.getMetadataWithOffset(Block.doorWood.blockID, 1)); -+ -+ if (this.getBlockIdAtCurrentPosition(par1World, 1, 0, -1, par3StructureBoundingBox) == 0 && this.getBlockIdAtCurrentPosition(par1World, 1, -1, -1, par3StructureBoundingBox) != 0) { -+ this.placeBlockAtCurrentPosition(par1World, Block.stairsCobblestone.blockID, this.getMetadataWithOffset(Block.stairsCobblestone.blockID, 3), 1, 0, -1, par3StructureBoundingBox); -+ } -+ -+ for (int var4 = 0; var4 < 5; ++var4) { -+ for (int var5 = 0; var5 < 4; ++var5) { -+ this.clearCurrentPositionBlocksUpwards(par1World, var5, 6, var4, par3StructureBoundingBox); -+ this.fillCurrentPositionBlocksDownwards(par1World, Block.cobblestone.blockID, 0, var5, -1, var4, par3StructureBoundingBox); - } - } - -- this.spawnVillagers(var1, var3, 1, 1, 2, 1); -+ this.spawnVillagers(par1World, par3StructureBoundingBox, 1, 1, 2, 1); - return true; - } - } ---- net/minecraft/src/WorldTemplate.java -+++ net/minecraft/src/WorldTemplate.java -@@ -3,20 +3,21 @@ - import argo.jdom.JsonNode; - - public class WorldTemplate extends ValueObject { -- public String a; -- public String b; -- public String c; -- public String d; -+ public String field_110734_a; -+ public String field_110732_b; -+ public String field_110733_c; -+ public String field_110731_d; - -- public static WorldTemplate func_110730_a(JsonNode var0) { -+ public static WorldTemplate func_110730_a(JsonNode par0JsonNode) { - WorldTemplate var1 = new WorldTemplate(); - - try { -- var1.a = var0.getNumberValue(new Object[]{"id"}); -- var1.b = var0.getStringValue(new Object[]{"name"}); -- var1.c = var0.getStringValue(new Object[]{"version"}); -- var1.d = var0.getStringValue(new Object[]{"author"}); -+ var1.field_110734_a = par0JsonNode.getNumberValue(new Object[] {"id"}); -+ var1.field_110732_b = par0JsonNode.getStringValue(new Object[] {"name"}); -+ var1.field_110733_c = par0JsonNode.getStringValue(new Object[] {"version"}); -+ var1.field_110731_d = par0JsonNode.getStringValue(new Object[] {"author"}); - } catch (IllegalArgumentException var3) { -+ ; - } - - return var1; ---- net/minecraft/src/MapGenScatteredFeature.java -+++ net/minecraft/src/MapGenScatteredFeature.java -@@ -9,60 +9,69 @@ - import java.util.Map.Entry; - - public class MapGenScatteredFeature extends MapGenStructure { -- private static List e = Arrays.asList(new BiomeGenBase[]{BiomeGenBase.desert, BiomeGenBase.desertHills, BiomeGenBase.jungle, BiomeGenBase.jungleHills, BiomeGenBase.swampland}); -- private List f; -+ private static List biomelist = Arrays.asList(new BiomeGenBase[] {BiomeGenBase.desert, BiomeGenBase.desertHills, BiomeGenBase.jungle, BiomeGenBase.jungleHills, BiomeGenBase.swampland}); -+ -+ /** contains possible spawns for scattered features */ -+ private List scatteredFeatureSpawnList; -+ -+ /** the maximum distance between scattered features */ - private int maxDistanceBetweenScatteredFeatures; -+ -+ /** the minimum distance between scattered features */ - private int minDistanceBetweenScatteredFeatures; - - public MapGenScatteredFeature() { -- this.f = new ArrayList(); -+ this.scatteredFeatureSpawnList = new ArrayList(); - this.maxDistanceBetweenScatteredFeatures = 32; - this.minDistanceBetweenScatteredFeatures = 8; -- this.f.add(new SpawnListEntry(EntityWitch.class, 1, 1, 1)); -+ this.scatteredFeatureSpawnList.add(new SpawnListEntry(EntityWitch.class, 1, 1, 1)); - } - -- public MapGenScatteredFeature(Map var1) { -+ public MapGenScatteredFeature(Map par1Map) { - this(); -- Iterator var2 = var1.entrySet().iterator(); -+ Iterator var2 = par1Map.entrySet().iterator(); - -- while(var2.hasNext()) { -+ while (var2.hasNext()) { - Entry var3 = (Entry)var2.next(); -- if(((String)var3.getKey()).equals("distance")) { -+ -+ if (((String)var3.getKey()).equals("distance")) { - this.maxDistanceBetweenScatteredFeatures = MathHelper.parseIntWithDefaultAndMax((String)var3.getValue(), this.maxDistanceBetweenScatteredFeatures, this.minDistanceBetweenScatteredFeatures + 1); - } - } -- - } - - public String func_143025_a() { - return "Temple"; - } - -- protected boolean canSpawnStructureAtCoords(int var1, int var2) { -- int var3 = var1; -- int var4 = var2; -- if(var1 < 0) { -- var1 -= this.maxDistanceBetweenScatteredFeatures - 1; -- } -- -- if(var2 < 0) { -- var2 -= this.maxDistanceBetweenScatteredFeatures - 1; -- } -- -- int var5 = var1 / this.maxDistanceBetweenScatteredFeatures; -- int var6 = var2 / this.maxDistanceBetweenScatteredFeatures; -+ protected boolean canSpawnStructureAtCoords(int par1, int par2) { -+ int var3 = par1; -+ int var4 = par2; -+ -+ if (par1 < 0) { -+ par1 -= this.maxDistanceBetweenScatteredFeatures - 1; -+ } -+ -+ if (par2 < 0) { -+ par2 -= this.maxDistanceBetweenScatteredFeatures - 1; -+ } -+ -+ int var5 = par1 / this.maxDistanceBetweenScatteredFeatures; -+ int var6 = par2 / this.maxDistanceBetweenScatteredFeatures; - Random var7 = this.worldObj.setRandomSeed(var5, var6, 14357617); - var5 *= this.maxDistanceBetweenScatteredFeatures; - var6 *= this.maxDistanceBetweenScatteredFeatures; - var5 += var7.nextInt(this.maxDistanceBetweenScatteredFeatures - this.minDistanceBetweenScatteredFeatures); - var6 += var7.nextInt(this.maxDistanceBetweenScatteredFeatures - this.minDistanceBetweenScatteredFeatures); -- if(var3 == var5 && var4 == var6) { -+ -+ if (var3 == var5 && var4 == var6) { - BiomeGenBase var8 = this.worldObj.getWorldChunkManager().getBiomeGenAt(var3 * 16 + 8, var4 * 16 + 8); -- Iterator var9 = e.iterator(); -+ Iterator var9 = biomelist.iterator(); - -- while(var9.hasNext()) { -+ while (var9.hasNext()) { - BiomeGenBase var10 = (BiomeGenBase)var9.next(); -- if(var8 == var10) { -+ -+ if (var8 == var10) { - return true; - } - } -@@ -71,21 +80,25 @@ - return false; - } - -- protected StructureStart getStructureStart(int var1, int var2) { -- return new StructureScatteredFeatureStart(this.worldObj, this.b, var1, var2); -+ protected StructureStart getStructureStart(int par1, int par2) { -+ return new StructureScatteredFeatureStart(this.worldObj, this.rand, par1, par2); - } - -- public boolean func_143030_a(int var1, int var2, int var3) { -- StructureStart var4 = this.func_143028_c(var1, var2, var3); -- if(var4 != null && var4 instanceof StructureScatteredFeatureStart && !var4.a.isEmpty()) { -- StructureComponent var5 = (StructureComponent)var4.a.getFirst(); -+ public boolean func_143030_a(int par1, int par2, int par3) { -+ StructureStart var4 = this.func_143028_c(par1, par2, par3); -+ -+ if (var4 != null && var4 instanceof StructureScatteredFeatureStart && !var4.components.isEmpty()) { -+ StructureComponent var5 = (StructureComponent)var4.components.getFirst(); - return var5 instanceof ComponentScatteredFeatureSwampHut; - } else { - return false; - } - } - -+ /** -+ * returns possible spawns for scattered features -+ */ - public List getScatteredFeatureSpawnList() { -- return this.f; -+ return this.scatteredFeatureSpawnList; - } - } ---- net/minecraft/src/BlockIce.java -+++ net/minecraft/src/BlockIce.java -@@ -3,62 +3,84 @@ - import java.util.Random; - - public class BlockIce extends BlockBreakable { -- public BlockIce(int var1) { -- super(var1, "ice", Material.ice, false); -+ public BlockIce(int par1) { -+ super(par1, "ice", Material.ice, false); - this.slipperiness = 0.98F; - this.setTickRandomly(true); - this.setCreativeTab(CreativeTabs.tabBlock); - } - -+ /** -+ * Returns which pass should this block be rendered on. 0 for solids and 1 for alpha -+ */ - public int getRenderBlockPass() { - return 1; - } - -- public boolean shouldSideBeRendered(IBlockAccess var1, int var2, int var3, int var4, int var5) { -- return super.shouldSideBeRendered(var1, var2, var3, var4, 1 - var5); -+ /** -+ * Returns true if the given side of this block type should be rendered, if the adjacent block is at the given -+ * coordinates. Args: blockAccess, x, y, z, side -+ */ -+ public boolean shouldSideBeRendered(IBlockAccess par1IBlockAccess, int par2, int par3, int par4, int par5) { -+ return super.shouldSideBeRendered(par1IBlockAccess, par2, par3, par4, 1 - par5); - } - -- public void harvestBlock(World var1, EntityPlayer var2, int var3, int var4, int var5, int var6) { -- var2.addStat(StatList.mineBlockStatArray[this.blockID], 1); -- var2.addExhaustion(0.025F); -- if(this.canSilkHarvest() && EnchantmentHelper.getSilkTouchModifier(var2)) { -- ItemStack var9 = this.createStackedBlock(var6); -- if(var9 != null) { -- this.dropBlockAsItem_do(var1, var3, var4, var5, var9); -+ /** -+ * Called when the player destroys a block with an item that can harvest it. (i, j, k) are the coordinates of the block -+ * and l is the block's subtype/damage. -+ */ -+ public void harvestBlock(World par1World, EntityPlayer par2EntityPlayer, int par3, int par4, int par5, int par6) { -+ par2EntityPlayer.addStat(StatList.mineBlockStatArray[this.blockID], 1); -+ par2EntityPlayer.addExhaustion(0.025F); -+ -+ if (this.canSilkHarvest() && EnchantmentHelper.getSilkTouchModifier(par2EntityPlayer)) { -+ ItemStack var9 = this.createStackedBlock(par6); -+ -+ if (var9 != null) { -+ this.dropBlockAsItem_do(par1World, par3, par4, par5, var9); - } - } else { -- if(var1.provider.isHellWorld) { -- var1.setBlockToAir(var3, var4, var5); -+ if (par1World.provider.isHellWorld) { -+ par1World.setBlockToAir(par3, par4, par5); - return; - } - -- int var7 = EnchantmentHelper.getFortuneModifier(var2); -- this.dropBlockAsItem(var1, var3, var4, var5, var6, var7); -- Material var8 = var1.getBlockMaterial(var3, var4 - 1, var5); -- if(var8.blocksMovement() || var8.isLiquid()) { -- var1.setBlock(var3, var4, var5, Block.waterMoving.blockID); -+ int var7 = EnchantmentHelper.getFortuneModifier(par2EntityPlayer); -+ this.dropBlockAsItem(par1World, par3, par4, par5, par6, var7); -+ Material var8 = par1World.getBlockMaterial(par3, par4 - 1, par5); -+ -+ if (var8.blocksMovement() || var8.isLiquid()) { -+ par1World.setBlock(par3, par4, par5, Block.waterMoving.blockID); - } - } -- - } - -- public int quantityDropped(Random var1) { -+ /** -+ * Returns the quantity of items to drop on block destruction. -+ */ -+ public int quantityDropped(Random par1Random) { - return 0; - } - -- public void updateTick(World var1, int var2, int var3, int var4, Random var5) { -- if(var1.getSavedLightValue(EnumSkyBlock.Block, var2, var3, var4) > 11 - Block.lightOpacity[this.blockID]) { -- if(var1.provider.isHellWorld) { -- var1.setBlockToAir(var2, var3, var4); -+ /** -+ * Ticks the block if it's been scheduled -+ */ -+ public void updateTick(World par1World, int par2, int par3, int par4, Random par5Random) { -+ if (par1World.getSavedLightValue(EnumSkyBlock.Block, par2, par3, par4) > 11 - Block.lightOpacity[this.blockID]) { -+ if (par1World.provider.isHellWorld) { -+ par1World.setBlockToAir(par2, par3, par4); - return; - } - -- this.dropBlockAsItem(var1, var2, var3, var4, var1.getBlockMetadata(var2, var3, var4), 0); -- var1.setBlock(var2, var3, var4, Block.waterStill.blockID); -+ this.dropBlockAsItem(par1World, par2, par3, par4, par1World.getBlockMetadata(par2, par3, par4), 0); -+ par1World.setBlock(par2, par3, par4, Block.waterStill.blockID); - } -- - } - -+ /** -+ * Returns the mobility information of the block, 0 = free, 1 = can't push but can move over, 2 = total immobility and -+ * stop pistons -+ */ - public int getMobilityFlag() { - return 0; - } ---- /dev/null -+++ org/spoutcraft/api/gui/ContainerType.java -@@ -1,0 +1,26 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.api.gui; -+ -+public enum ContainerType { -+ VERTICAL, -+ HORIZONTAL, -+ OVERLAY -+} ---- /dev/null -+++ com/prupe/mcpatcher/hd/FontUtils$1.java -@@ -1,0 +1,24 @@ -+package com.prupe.mcpatcher.hd; -+ -+import com.prupe.mcpatcher.TexturePackChangeHandler; -+import java.util.Iterator; -+import net.minecraft.src.FontRenderer; -+ -+final class FontUtils$1 extends TexturePackChangeHandler { -+ FontUtils$1(String x0, int x1) { -+ super(x0, x1); -+ } -+ -+ public void initialize() {} -+ -+ public void beforeChange() {} -+ -+ public void afterChange() { -+ Iterator i$ = FontUtils.access$000().iterator(); -+ -+ while (i$.hasNext()) { -+ FontRenderer renderer = (FontRenderer)i$.next(); -+ renderer.readFontTexture(); -+ } -+ } -+} ---- net/minecraft/src/Packet130UpdateSign.java -+++ net/minecraft/src/Packet130UpdateSign.java -@@ -8,52 +8,62 @@ - public int xPosition; - public int yPosition; - public int zPosition; -- public String[] d; -+ public String[] signLines; - - public Packet130UpdateSign() { - this.isChunkDataPacket = true; - } - -- public Packet130UpdateSign(int var1, int var2, int var3, String[] var4) { -+ public Packet130UpdateSign(int par1, int par2, int par3, String[] par4ArrayOfStr) { - this.isChunkDataPacket = true; -- this.xPosition = var1; -- this.yPosition = var2; -- this.zPosition = var3; -- this.d = new String[]{var4[0], var4[1], var4[2], var4[3]}; -- } -- -- public void readPacketData(DataInput var1) throws IOException { -- this.xPosition = var1.readInt(); -- this.yPosition = var1.readShort(); -- this.zPosition = var1.readInt(); -- this.d = new String[4]; -- -- for(int var2 = 0; var2 < 4; ++var2) { -- this.d[var2] = readString(var1, 15); -- } -- -- } -- -- public void writePacketData(DataOutput var1) throws IOException { -- var1.writeInt(this.xPosition); -- var1.writeShort(this.yPosition); -- var1.writeInt(this.zPosition); -- -- for(int var2 = 0; var2 < 4; ++var2) { -- writeString(this.d[var2], var1); -- } -- -- } -- -- public void processPacket(NetHandler var1) { -- var1.handleUpdateSign(this); -- } -- -+ this.xPosition = par1; -+ this.yPosition = par2; -+ this.zPosition = par3; -+ this.signLines = new String[] {par4ArrayOfStr[0], par4ArrayOfStr[1], par4ArrayOfStr[2], par4ArrayOfStr[3]}; -+ } -+ -+ /** -+ * Abstract. Reads the raw packet data from the data stream. -+ */ -+ public void readPacketData(DataInput par1DataInput) throws IOException { -+ this.xPosition = par1DataInput.readInt(); -+ this.yPosition = par1DataInput.readShort(); -+ this.zPosition = par1DataInput.readInt(); -+ this.signLines = new String[4]; -+ -+ for (int var2 = 0; var2 < 4; ++var2) { -+ this.signLines[var2] = readString(par1DataInput, 15); -+ } -+ } -+ -+ /** -+ * Abstract. Writes the raw packet data to the data stream. -+ */ -+ public void writePacketData(DataOutput par1DataOutput) throws IOException { -+ par1DataOutput.writeInt(this.xPosition); -+ par1DataOutput.writeShort(this.yPosition); -+ par1DataOutput.writeInt(this.zPosition); -+ -+ for (int var2 = 0; var2 < 4; ++var2) { -+ writeString(this.signLines[var2], par1DataOutput); -+ } -+ } -+ -+ /** -+ * Passes this Packet on to the NetHandler for processing. -+ */ -+ public void processPacket(NetHandler par1NetHandler) { -+ par1NetHandler.handleUpdateSign(this); -+ } -+ -+ /** -+ * Abstract. Return the size of the packet (not counting the header). -+ */ - public int getPacketSize() { - int var1 = 0; - -- for(int var2 = 0; var2 < 4; ++var2) { -- var1 += this.d[var2].length(); -+ for (int var2 = 0; var2 < 4; ++var2) { -+ var1 += this.signLines[var2].length(); - } - - return var1; ---- net/minecraft/src/EnchantmentDurability.java -+++ net/minecraft/src/EnchantmentDurability.java -@@ -3,28 +3,42 @@ - import java.util.Random; - - public class EnchantmentDurability extends Enchantment { -- protected EnchantmentDurability(int var1, int var2) { -- super(var1, var2, EnumEnchantmentType.digger); -+ protected EnchantmentDurability(int par1, int par2) { -+ super(par1, par2, EnumEnchantmentType.digger); - this.setName("durability"); - } - -- public int getMinEnchantability(int var1) { -- return 5 + (var1 - 1) * 8; -- } -- -- public int getMaxEnchantability(int var1) { -- return super.getMinEnchantability(var1) + 50; -- } -- -+ /** -+ * Returns the minimal value of enchantability needed on the enchantment level passed. -+ */ -+ public int getMinEnchantability(int par1) { -+ return 5 + (par1 - 1) * 8; -+ } -+ -+ /** -+ * Returns the maximum value of enchantability nedded on the enchantment level passed. -+ */ -+ public int getMaxEnchantability(int par1) { -+ return super.getMinEnchantability(par1) + 50; -+ } -+ -+ /** -+ * Returns the maximum level that the enchantment can have. -+ */ - public int getMaxLevel() { - return 3; - } - -- public boolean canApply(ItemStack var1) { -- return var1.isItemStackDamageable() ? true : super.canApply(var1); -+ public boolean canApply(ItemStack par1ItemStack) { -+ return par1ItemStack.isItemStackDamageable() ? true : super.canApply(par1ItemStack); - } - -- public static boolean negateDamage(ItemStack var0, int var1, Random var2) { -- return var0.getItem() instanceof ItemArmor && var2.nextFloat() < 0.6F ? false : var2.nextInt(var1 + 1) > 0; -+ /** -+ * Used by ItemStack.attemptDamageItem. Randomly determines if a point of damage should be negated using the -+ * enchantment level (par1). If the ItemStack is Armor then there is a flat 60% chance for damage to be negated no -+ * matter the enchantment level, otherwise there is a 1-(par/1) chance for damage to be negated. -+ */ -+ public static boolean negateDamage(ItemStack par0ItemStack, int par1, Random par2Random) { -+ return par0ItemStack.getItem() instanceof ItemArmor && par2Random.nextFloat() < 0.6F ? false : par2Random.nextInt(par1 + 1) > 0; - } - } ---- net/minecraft/src/Tuple.java -+++ net/minecraft/src/Tuple.java -@@ -1,19 +1,29 @@ - package net.minecraft.src; - - public class Tuple { -- private Object a; -- private Object b; -- -- public Tuple(Object var1, Object var2) { -- this.a = var1; -- this.b = var2; -+ -+ /** First Object in the Tuple */ -+ private Object first; -+ -+ /** Second Object in the Tuple */ -+ private Object second; -+ -+ public Tuple(Object par1Obj, Object par2Obj) { -+ this.first = par1Obj; -+ this.second = par2Obj; - } - -+ /** -+ * Get the first Object in the Tuple -+ */ - public Object getFirst() { -- return this.a; -+ return this.first; - } - -+ /** -+ * Get the second Object in the Tuple -+ */ - public Object getSecond() { -- return this.b; -+ return this.second; - } - } ---- net/minecraft/src/RenderItemFrame.java -+++ net/minecraft/src/RenderItemFrame.java -@@ -2,43 +2,48 @@ - - import org.lwjgl.opengl.GL11; - -+import org.spoutcraft.api.material.MaterialData; -+ - public class RenderItemFrame extends Render { - private static final ResourceLocation mapBackgroundTextures = new ResourceLocation("textures/map/map_background.png"); - private final RenderBlocks renderBlocksInstance = new RenderBlocks(); - private Icon field_94147_f; - -- public void updateIcons(IconRegister var1) { -- this.field_94147_f = var1.registerIcon("itemframe_background"); -+ public void updateIcons(IconRegister par1IconRegister) { -+ this.field_94147_f = par1IconRegister.registerIcon("itemframe_background"); - } - -- public void func_82404_a(EntityItemFrame var1, double var2, double var4, double var6, float var8, float var9) { -+ public void func_82404_a(EntityItemFrame par1EntityItemFrame, double par2, double par4, double par6, float par8, float par9) { - GL11.glPushMatrix(); -- float var10 = (float)(var1.posX - var2) - 0.5F; -- float var11 = (float)(var1.posY - var4) - 0.5F; -- float var12 = (float)(var1.posZ - var6) - 0.5F; -- int var13 = var1.xPosition + Direction.offsetX[var1.hangingDirection]; -- int var14 = var1.yPosition; -- int var15 = var1.zPosition + Direction.offsetZ[var1.hangingDirection]; -+ float var10 = (float)(par1EntityItemFrame.posX - par2) - 0.5F; -+ float var11 = (float)(par1EntityItemFrame.posY - par4) - 0.5F; -+ float var12 = (float)(par1EntityItemFrame.posZ - par6) - 0.5F; -+ int var13 = par1EntityItemFrame.xPosition + Direction.offsetX[par1EntityItemFrame.hangingDirection]; -+ int var14 = par1EntityItemFrame.yPosition; -+ int var15 = par1EntityItemFrame.zPosition + Direction.offsetZ[par1EntityItemFrame.hangingDirection]; - GL11.glTranslatef((float)var13 - var10, (float)var14 - var11, (float)var15 - var12); -- this.renderFrameItemAsBlock(var1); -- this.func_82402_b(var1); -+ this.renderFrameItemAsBlock(par1EntityItemFrame); -+ this.func_82402_b(par1EntityItemFrame); - GL11.glPopMatrix(); - } -- -- protected ResourceLocation func_110788_a(EntityItemFrame var1) { -+ -+ protected ResourceLocation func_110788_a(EntityItemFrame par1EntityItemFrame) { - return null; - } - -- private void renderFrameItemAsBlock(EntityItemFrame var1) { -+ /** -+ * Render the item frame's item as a block. -+ */ -+ private void renderFrameItemAsBlock(EntityItemFrame par1EntityItemFrame) { - GL11.glPushMatrix(); -- GL11.glRotatef(var1.rotationYaw, 0.0F, 1.0F, 0.0F); - this.renderManager.renderEngine.bindTexture(TextureMap.locationBlocksTexture); -+ GL11.glRotatef(par1EntityItemFrame.rotationYaw, 0.0F, 1.0F, 0.0F); - Block var2 = Block.planks; -- float var3 = 1.0F / 16.0F; -- float var4 = 12.0F / 16.0F; -+ float var3 = 0.0625F; -+ float var4 = 0.75F; - float var5 = var4 / 2.0F; - GL11.glPushMatrix(); -- this.renderBlocksInstance.overrideBlockBounds(0.0D, (double)(0.5F - var5 + 1.0F / 16.0F), (double)(0.5F - var5 + 1.0F / 16.0F), (double)(var3 * 0.5F), (double)(0.5F + var5 - 1.0F / 16.0F), (double)(0.5F + var5 - 1.0F / 16.0F)); -+ this.renderBlocksInstance.overrideBlockBounds(0.0D, (double)(0.5F - var5 + 0.0625F), (double)(0.5F - var5 + 0.0625F), (double)(var3 * 0.5F), (double)(0.5F + var5 - 0.0625F), (double)(0.5F + var5 - 0.0625F)); - this.renderBlocksInstance.setOverrideBlockTexture(this.field_94147_f); - this.renderBlocksInstance.renderBlockAsItem(var2, 0, 1.0F); - this.renderBlocksInstance.clearOverrideBlockTexture(); -@@ -66,28 +71,48 @@ - GL11.glPopMatrix(); - } - -- private void func_82402_b(EntityItemFrame var1) { -- ItemStack var2 = var1.getDisplayedItem(); -- if(var2 != null) { -- EntityItem var3 = new EntityItem(var1.worldObj, 0.0D, 0.0D, 0.0D, var2); -+ private void func_82402_b(EntityItemFrame par1EntityItemFrame) { -+ ItemStack var2 = par1EntityItemFrame.getDisplayedItem(); -+ -+ if (var2 != null) { -+ EntityItem var3 = new EntityItem(par1EntityItemFrame.worldObj, 0.0D, 0.0D, 0.0D, var2); - var3.getEntityItem().stackSize = 1; - var3.hoverStart = 0.0F; -+ // Spout Start -+ this.renderManager.renderEngine.bindTexture(TextureMap.locationBlocksTexture); - GL11.glPushMatrix(); -- GL11.glTranslatef(-0.453125F * (float)Direction.offsetX[var1.hangingDirection], -0.18F, -0.453125F * (float)Direction.offsetZ[var1.hangingDirection]); -- GL11.glRotatef(180.0F + var1.rotationYaw, 0.0F, 1.0F, 0.0F); -- GL11.glRotatef((float)(-90 * var1.getRotation()), 0.0F, 0.0F, 1.0F); -- switch(var1.getRotation()) { -- case 1: -- GL11.glTranslatef(-0.16F, -0.16F, 0.0F); -- break; -- case 2: -- GL11.glTranslatef(0.0F, -0.32F, 0.0F); -- break; -- case 3: -- GL11.glTranslatef(0.16F, -0.16F, 0.0F); -- } -- -- if(var3.getEntityItem().getItem() == Item.map) { -+ -+ if (var2.itemID == 318 && (MaterialData.getCustomBlock(var2.getItemDamage()) instanceof org.spoutcraft.api.material.Block)) { -+ if (par1EntityItemFrame.hangingDirection == 0) { -+ GL11.glTranslatef((-0.453125F * ((float)Direction.offsetX[par1EntityItemFrame.hangingDirection] + 0.25F)), -0.18F, -0.453125F * (float)Direction.offsetZ[par1EntityItemFrame.hangingDirection]); -+ } else if (par1EntityItemFrame.hangingDirection == 1) { -+ GL11.glTranslatef(-0.453125F * ((float)Direction.offsetX[par1EntityItemFrame.hangingDirection]), -0.18F, -0.453125F * ((float)Direction.offsetZ[par1EntityItemFrame.hangingDirection] + 0.25F)); -+ } else if (par1EntityItemFrame.hangingDirection == 2) { -+ GL11.glTranslatef((-0.453125F * ((float)Direction.offsetX[par1EntityItemFrame.hangingDirection] - 0.25F)), -0.18F, -0.453125F * (float)Direction.offsetZ[par1EntityItemFrame.hangingDirection]); -+ } else if (par1EntityItemFrame.hangingDirection == 3) { -+ GL11.glTranslatef((-0.453125F * (float)Direction.offsetX[par1EntityItemFrame.hangingDirection]), -0.18F, -0.453125F * ((float)Direction.offsetZ[par1EntityItemFrame.hangingDirection] - 0.25F)); -+ } -+ } else { -+ GL11.glTranslatef(-0.453125F * (float)Direction.offsetX[par1EntityItemFrame.hangingDirection], -0.18F, -0.453125F * (float)Direction.offsetZ[par1EntityItemFrame.hangingDirection]); -+ } -+ // Spout End -+ GL11.glRotatef(180.0F + par1EntityItemFrame.rotationYaw, 0.0F, 1.0F, 0.0F); -+ GL11.glRotatef((float)(-90 * par1EntityItemFrame.getRotation()), 0.0F, 0.0F, 1.0F); -+ -+ switch (par1EntityItemFrame.getRotation()) { -+ case 1: -+ GL11.glTranslatef(-0.16F, -0.16F, 0.0F); -+ break; -+ -+ case 2: -+ GL11.glTranslatef(0.0F, -0.32F, 0.0F); -+ break; -+ -+ case 3: -+ GL11.glTranslatef(0.16F, -0.16F, 0.0F); -+ } -+ -+ if (var3.getEntityItem().getItem() == Item.map) { - this.renderManager.renderEngine.bindTexture(mapBackgroundTextures); - Tessellator var4 = Tessellator.instance; - GL11.glRotatef(180.0F, 0.0F, 1.0F, 0.0F); -@@ -102,23 +127,25 @@ - var4.addVertexWithUV((double)(128 + var5), (double)(0 - var5), 0.0D, 1.0D, 0.0D); - var4.addVertexWithUV((double)(0 - var5), (double)(0 - var5), 0.0D, 0.0D, 0.0D); - var4.draw(); -- MapData var6 = Item.map.getMapData(var3.getEntityItem(), var1.worldObj); -+ MapData var6 = Item.map.getMapData(var3.getEntityItem(), par1EntityItemFrame.worldObj); - GL11.glTranslatef(0.0F, 0.0F, -1.0F); -- if(var6 != null) { -+ -+ if (var6 != null) { - this.renderManager.itemRenderer.mapItemRenderer.renderMap((EntityPlayer)null, this.renderManager.renderEngine, var6); - } - } else { -- if(var3.getEntityItem().getItem() == Item.compass) { -+ if (var3.getEntityItem().getItem() == Item.compass) { - TextureManager var11 = Minecraft.getMinecraft().getTextureManager(); - var11.bindTexture(TextureMap.locationItemsTexture); - TextureAtlasSprite var13 = ((TextureMap)var11.getTexture(TextureMap.locationItemsTexture)).getAtlasSprite(Item.compass.getIconIndex(var3.getEntityItem()).getIconName()); -- if(var13 instanceof TextureCompass) { -+ -+ if (var13 instanceof TextureCompass) { - TextureCompass var14 = (TextureCompass)var13; - double var7 = var14.currentAngle; - double var9 = var14.angleDelta; - var14.currentAngle = 0.0D; - var14.angleDelta = 0.0D; -- var14.updateCompass(var1.worldObj, var1.posX, var1.posZ, (double)MathHelper.wrapAngleTo180_float((float)(180 + var1.hangingDirection * 90)), false, true); -+ var14.updateCompass(par1EntityItemFrame.worldObj, par1EntityItemFrame.posX, par1EntityItemFrame.posZ, (double)MathHelper.wrapAngleTo180_float((float)(180 + par1EntityItemFrame.hangingDirection * 90)), false, true); - var14.currentAngle = var7; - var14.angleDelta = var9; - } -@@ -127,9 +154,11 @@ - RenderItem.renderInFrame = true; - RenderManager.instance.renderEntityWithPosYaw(var3, 0.0D, 0.0D, 0.0D, 0.0F, 0.0F); - RenderItem.renderInFrame = false; -- if(var3.getEntityItem().getItem() == Item.compass) { -+ -+ if (var3.getEntityItem().getItem() == Item.compass) { - TextureAtlasSprite var12 = ((TextureMap)Minecraft.getMinecraft().getTextureManager().getTexture(TextureMap.locationItemsTexture)).getAtlasSprite(Item.compass.getIconIndex(var3.getEntityItem()).getIconName()); -- if(var12.getFrameCount() > 0) { -+ -+ if (var12.getFrameCount() > 0) { - var12.updateAnimation(); - } - } -@@ -139,11 +168,20 @@ - } - } - -- protected ResourceLocation getEntityTexture(Entity var1) { -- return this.func_110788_a((EntityItemFrame)var1); -+ /** -+ * Returns the location of an entity's texture. Doesn't seem to be called unless you call Render.bindEntityTexture. -+ */ -+ protected ResourceLocation getEntityTexture(Entity par1Entity) { -+ return this.func_110788_a((EntityItemFrame)par1Entity); - } -- -- public void doRender(Entity var1, double var2, double var4, double var6, float var8, float var9) { -- this.func_82404_a((EntityItemFrame)var1, var2, var4, var6, var8, var9); -+ -+ /** -+ * Actually renders the given argument. This is a synthetic bridge method, always casting down its argument and then -+ * handing it off to a worker function which does the actual work. In all probabilty, the class Render is generic -+ * (Render 31) { -- throw new IllegalArgumentException("Data value id is too big with " + var1 + "! (Max is " + 31 + ")"); -- } else if(this.c.containsKey(Integer.valueOf(var1))) { -- throw new IllegalArgumentException("Duplicate id value for " + var1 + "!"); -+ private ReadWriteLock lock = new ReentrantReadWriteLock(); -+ -+ /** -+ * adds a new object to dataWatcher to watch, to update an already existing object see updateObject. Arguments: data -+ * Value Id, Object to add -+ */ -+ public void addObject(int par1, Object par2Obj) { -+ Integer var3 = (Integer)dataTypes.get(par2Obj.getClass()); -+ -+ if (var3 == null) { -+ throw new IllegalArgumentException("Unknown data type: " + par2Obj.getClass()); -+ } else if (par1 > 31) { -+ throw new IllegalArgumentException("Data value id is too big with " + par1 + "! (Max is " + 31 + ")"); -+ } else if (this.watchedObjects.containsKey(Integer.valueOf(par1))) { -+ throw new IllegalArgumentException("Duplicate id value for " + par1 + "!"); - } else { -- WatchableObject var4 = new WatchableObject(var3.intValue(), var1, var2); -- this.e.writeLock().lock(); -- this.c.put(Integer.valueOf(var1), var4); -- this.e.writeLock().unlock(); -+ WatchableObject var4 = new WatchableObject(var3.intValue(), par1, par2Obj); -+ this.lock.writeLock().lock(); -+ this.watchedObjects.put(Integer.valueOf(par1), var4); -+ this.lock.writeLock().unlock(); - this.isBlank = false; - } - } - -- public void addObjectByDataType(int var1, int var2) { -- WatchableObject var3 = new WatchableObject(var2, var1, (Object)null); -- this.e.writeLock().lock(); -- this.c.put(Integer.valueOf(var1), var3); -- this.e.writeLock().unlock(); -+ /** -+ * Add a new object for the DataWatcher to watch, using the specified data type. -+ */ -+ public void addObjectByDataType(int par1, int par2) { -+ WatchableObject var3 = new WatchableObject(par2, par1, (Object)null); -+ this.lock.writeLock().lock(); -+ this.watchedObjects.put(Integer.valueOf(par1), var3); -+ this.lock.writeLock().unlock(); - this.isBlank = false; - } - -- public byte getWatchableObjectByte(int var1) { -- return ((Byte)this.getWatchedObject(var1).getObject()).byteValue(); -- } -- -- public short getWatchableObjectShort(int var1) { -- return ((Short)this.getWatchedObject(var1).getObject()).shortValue(); -- } -- -- public int getWatchableObjectInt(int var1) { -- return ((Integer)this.getWatchedObject(var1).getObject()).intValue(); -- } -- -- public float getWatchableObjectFloat(int var1) { -- return ((Float)this.getWatchedObject(var1).getObject()).floatValue(); -- } -- -- public String getWatchableObjectString(int var1) { -- return (String)this.getWatchedObject(var1).getObject(); -- } -- -- public ItemStack getWatchableObjectItemStack(int var1) { -- return (ItemStack)this.getWatchedObject(var1).getObject(); -- } -- -- private WatchableObject getWatchedObject(int var1) { -- this.e.readLock().lock(); -- -+ /** -+ * gets the bytevalue of a watchable object -+ */ -+ public byte getWatchableObjectByte(int par1) { -+ return ((Byte)this.getWatchedObject(par1).getObject()).byteValue(); -+ } -+ -+ public short getWatchableObjectShort(int par1) { -+ return ((Short)this.getWatchedObject(par1).getObject()).shortValue(); -+ } -+ -+ /** -+ * gets a watchable object and returns it as a Integer -+ */ -+ public int getWatchableObjectInt(int par1) { -+ return ((Integer)this.getWatchedObject(par1).getObject()).intValue(); -+ } -+ -+ public float getWatchableObjectFloat(int par1) { -+ return ((Float)this.getWatchedObject(par1).getObject()).floatValue(); -+ } -+ -+ /** -+ * gets a watchable object and returns it as a String -+ */ -+ public String getWatchableObjectString(int par1) { -+ return (String)this.getWatchedObject(par1).getObject(); -+ } -+ -+ /** -+ * Get a watchable object as an ItemStack. -+ */ -+ public ItemStack getWatchableObjectItemStack(int par1) { -+ return (ItemStack)this.getWatchedObject(par1).getObject(); -+ } -+ -+ /** -+ * is threadsafe, unless it throws an exception, then -+ */ -+ private WatchableObject getWatchedObject(int par1) { -+ this.lock.readLock().lock(); - WatchableObject var2; -+ - try { -- var2 = (WatchableObject)this.c.get(Integer.valueOf(var1)); -+ var2 = (WatchableObject)this.watchedObjects.get(Integer.valueOf(par1)); - } catch (Throwable var6) { - CrashReport var4 = CrashReport.makeCrashReport(var6, "Getting synched entity data"); - CrashReportCategory var5 = var4.makeCategory("Synched entity data"); -- var5.addCrashSection("Data ID", Integer.valueOf(var1)); -+ var5.addCrashSection("Data ID", Integer.valueOf(par1)); - throw new ReportedException(var4); - } - -- this.e.readLock().unlock(); -+ this.lock.readLock().unlock(); - return var2; - } - -- public void updateObject(int var1, Object var2) { -- WatchableObject var3 = this.getWatchedObject(var1); -- if(!var2.equals(var3.getObject())) { -- var3.setObject(var2); -+ /** -+ * updates an already existing object -+ */ -+ public void updateObject(int par1, Object par2Obj) { -+ WatchableObject var3 = this.getWatchedObject(par1); -+ -+ if (!par2Obj.equals(var3.getObject())) { -+ var3.setObject(par2Obj); - var3.setWatched(true); - this.objectChanged = true; - } -- - } - -- public void setObjectWatched(int var1) { -- WatchableObject.setWatchableObjectWatched(this.getWatchedObject(var1), true); -+ public void setObjectWatched(int par1) { -+ WatchableObject.setWatchableObjectWatched(this.getWatchedObject(par1), true); - this.objectChanged = true; - } - -- public boolean hasObjectChanged() { -+ public boolean hasChanges() { - return this.objectChanged; - } - -- public static void writeObjectsInListToStream(List var0, DataOutput var1) throws IOException { -- if(var0 != null) { -- Iterator var2 = var0.iterator(); -+ /** -+ * writes every object in passed list to dataoutputstream, terminated by 0x7F -+ */ -+ public static void writeObjectsInListToStream(List par0List, DataOutput par1DataOutput) throws IOException { -+ if (par0List != null) { -+ Iterator var2 = par0List.iterator(); - -- while(var2.hasNext()) { -+ while (var2.hasNext()) { - WatchableObject var3 = (WatchableObject)var2.next(); -- writeWatchableObject(var1, var3); -+ writeWatchableObject(par1DataOutput, var3); - } - } - -- var1.writeByte(127); -+ par1DataOutput.writeByte(127); - } - - public List unwatchAndReturnAllWatched() { - ArrayList var1 = null; -- if(this.objectChanged) { -- this.e.readLock().lock(); -- Iterator var2 = this.c.values().iterator(); -- -- while(var2.hasNext()) { -+ -+ if (this.objectChanged) { -+ this.lock.readLock().lock(); -+ Iterator var2 = this.watchedObjects.values().iterator(); -+ -+ while (var2.hasNext()) { - WatchableObject var3 = (WatchableObject)var2.next(); -- if(var3.isWatched()) { -+ -+ if (var3.isWatched()) { - var3.setWatched(false); -- if(var1 == null) { -+ -+ if (var1 == null) { - var1 = new ArrayList(); - } - -@@ -134,109 +170,123 @@ - } - } - -- this.e.readLock().unlock(); -+ this.lock.readLock().unlock(); - } - - this.objectChanged = false; - return var1; - } - -- public void writeWatchableObjects(DataOutput var1) throws IOException { -- this.e.readLock().lock(); -- Iterator var2 = this.c.values().iterator(); -+ public void writeWatchableObjects(DataOutput par1DataOutput) throws IOException { -+ this.lock.readLock().lock(); -+ Iterator var2 = this.watchedObjects.values().iterator(); - -- while(var2.hasNext()) { -+ while (var2.hasNext()) { - WatchableObject var3 = (WatchableObject)var2.next(); -- writeWatchableObject(var1, var3); -+ writeWatchableObject(par1DataOutput, var3); - } - -- this.e.readLock().unlock(); -- var1.writeByte(127); -+ this.lock.readLock().unlock(); -+ par1DataOutput.writeByte(127); - } - - public List getAllWatched() { - ArrayList var1 = null; -- this.e.readLock().lock(); -- -+ this.lock.readLock().lock(); - WatchableObject var3; -- for(Iterator var2 = this.c.values().iterator(); var2.hasNext(); var1.add(var3)) { -+ -+ for (Iterator var2 = this.watchedObjects.values().iterator(); var2.hasNext(); var1.add(var3)) { - var3 = (WatchableObject)var2.next(); -- if(var1 == null) { -+ -+ if (var1 == null) { - var1 = new ArrayList(); - } - } - -- this.e.readLock().unlock(); -+ this.lock.readLock().unlock(); - return var1; - } - -- private static void writeWatchableObject(DataOutput var0, WatchableObject var1) throws IOException { -- int var2 = (var1.getObjectType() << 5 | var1.getDataValueId() & 31) & 255; -- var0.writeByte(var2); -- switch(var1.getObjectType()) { -- case 0: -- var0.writeByte(((Byte)var1.getObject()).byteValue()); -- break; -- case 1: -- var0.writeShort(((Short)var1.getObject()).shortValue()); -- break; -- case 2: -- var0.writeInt(((Integer)var1.getObject()).intValue()); -- break; -- case 3: -- var0.writeFloat(((Float)var1.getObject()).floatValue()); -- break; -- case 4: -- Packet.writeString((String)var1.getObject(), var0); -- break; -- case 5: -- ItemStack var4 = (ItemStack)var1.getObject(); -- Packet.writeItemStack(var4, var0); -- break; -- case 6: -- ChunkCoordinates var3 = (ChunkCoordinates)var1.getObject(); -- var0.writeInt(var3.posX); -- var0.writeInt(var3.posY); -- var0.writeInt(var3.posZ); -- } -- -- } -- -- public static List readWatchableObjects(DataInput var0) throws IOException { -- ArrayList var1 = null; -- -- for(byte var2 = var0.readByte(); var2 != 127; var2 = var0.readByte()) { -- if(var1 == null) { -- var1 = new ArrayList(); -- } -- -- int var3 = (var2 & 224) >> 5; -- int var4 = var2 & 31; -- WatchableObject var5 = null; -- switch(var3) { -+ private static void writeWatchableObject(DataOutput par0DataOutput, WatchableObject par1WatchableObject) throws IOException { -+ int var2 = (par1WatchableObject.getObjectType() << 5 | par1WatchableObject.getDataValueId() & 31) & 255; -+ par0DataOutput.writeByte(var2); -+ -+ switch (par1WatchableObject.getObjectType()) { - case 0: -- var5 = new WatchableObject(var3, var4, Byte.valueOf(var0.readByte())); -+ par0DataOutput.writeByte(((Byte)par1WatchableObject.getObject()).byteValue()); - break; -+ - case 1: -- var5 = new WatchableObject(var3, var4, Short.valueOf(var0.readShort())); -+ par0DataOutput.writeShort(((Short)par1WatchableObject.getObject()).shortValue()); - break; -+ - case 2: -- var5 = new WatchableObject(var3, var4, Integer.valueOf(var0.readInt())); -+ par0DataOutput.writeInt(((Integer)par1WatchableObject.getObject()).intValue()); - break; -+ - case 3: -- var5 = new WatchableObject(var3, var4, Float.valueOf(var0.readFloat())); -+ par0DataOutput.writeFloat(((Float)par1WatchableObject.getObject()).floatValue()); - break; -+ - case 4: -- var5 = new WatchableObject(var3, var4, Packet.readString(var0, 64)); -+ Packet.writeString((String)par1WatchableObject.getObject(), par0DataOutput); - break; -+ - case 5: -- var5 = new WatchableObject(var3, var4, Packet.readItemStack(var0)); -+ ItemStack var4 = (ItemStack)par1WatchableObject.getObject(); -+ Packet.writeItemStack(var4, par0DataOutput); - break; -+ - case 6: -- int var6 = var0.readInt(); -- int var7 = var0.readInt(); -- int var8 = var0.readInt(); -- var5 = new WatchableObject(var3, var4, new ChunkCoordinates(var6, var7, var8)); -+ ChunkCoordinates var3 = (ChunkCoordinates)par1WatchableObject.getObject(); -+ par0DataOutput.writeInt(var3.posX); -+ par0DataOutput.writeInt(var3.posY); -+ par0DataOutput.writeInt(var3.posZ); -+ } -+ } -+ -+ public static List readWatchableObjects(DataInput par0DataInput) throws IOException { -+ ArrayList var1 = null; -+ -+ for (byte var2 = par0DataInput.readByte(); var2 != 127; var2 = par0DataInput.readByte()) { -+ if (var1 == null) { -+ var1 = new ArrayList(); -+ } -+ -+ int var3 = (var2 & 224) >> 5; -+ int var4 = var2 & 31; -+ WatchableObject var5 = null; -+ -+ switch (var3) { -+ case 0: -+ var5 = new WatchableObject(var3, var4, Byte.valueOf(par0DataInput.readByte())); -+ break; -+ -+ case 1: -+ var5 = new WatchableObject(var3, var4, Short.valueOf(par0DataInput.readShort())); -+ break; -+ -+ case 2: -+ var5 = new WatchableObject(var3, var4, Integer.valueOf(par0DataInput.readInt())); -+ break; -+ -+ case 3: -+ var5 = new WatchableObject(var3, var4, Float.valueOf(par0DataInput.readFloat())); -+ break; -+ -+ case 4: -+ var5 = new WatchableObject(var3, var4, Packet.readString(par0DataInput, 64)); -+ break; -+ -+ case 5: -+ var5 = new WatchableObject(var3, var4, Packet.readItemStack(par0DataInput)); -+ break; -+ -+ case 6: -+ int var6 = par0DataInput.readInt(); -+ int var7 = par0DataInput.readInt(); -+ int var8 = par0DataInput.readInt(); -+ var5 = new WatchableObject(var3, var4, new ChunkCoordinates(var6, var7, var8)); - } - - var1.add(var5); -@@ -245,19 +295,20 @@ - return var1; - } - -- public void updateWatchedObjectsFromList(List var1) { -- this.e.writeLock().lock(); -- Iterator var2 = var1.iterator(); -+ public void updateWatchedObjectsFromList(List par1List) { -+ this.lock.writeLock().lock(); -+ Iterator var2 = par1List.iterator(); - -- while(var2.hasNext()) { -+ while (var2.hasNext()) { - WatchableObject var3 = (WatchableObject)var2.next(); -- WatchableObject var4 = (WatchableObject)this.c.get(Integer.valueOf(var3.getDataValueId())); -- if(var4 != null) { -+ WatchableObject var4 = (WatchableObject)this.watchedObjects.get(Integer.valueOf(var3.getDataValueId())); -+ -+ if (var4 != null) { - var4.setObject(var3.getObject()); - } - } - -- this.e.writeLock().unlock(); -+ this.lock.writeLock().unlock(); - this.objectChanged = true; - } - -@@ -270,12 +321,12 @@ - } - - static { -- b.put(Byte.class, Integer.valueOf(0)); -- b.put(Short.class, Integer.valueOf(1)); -- b.put(Integer.class, Integer.valueOf(2)); -- b.put(Float.class, Integer.valueOf(3)); -- b.put(String.class, Integer.valueOf(4)); -- b.put(ItemStack.class, Integer.valueOf(5)); -- b.put(ChunkCoordinates.class, Integer.valueOf(6)); -+ dataTypes.put(Byte.class, Integer.valueOf(0)); -+ dataTypes.put(Short.class, Integer.valueOf(1)); -+ dataTypes.put(Integer.class, Integer.valueOf(2)); -+ dataTypes.put(Float.class, Integer.valueOf(3)); -+ dataTypes.put(String.class, Integer.valueOf(4)); -+ dataTypes.put(ItemStack.class, Integer.valueOf(5)); -+ dataTypes.put(ChunkCoordinates.class, Integer.valueOf(6)); - } - } ---- /dev/null -+++ com/prupe/mcpatcher/BlendMethod.java -@@ -1,0 +1,109 @@ -+package com.prupe.mcpatcher; -+ -+import org.lwjgl.opengl.GL11; -+ -+public class BlendMethod { -+ public static final BlendMethod ALPHA = new BlendMethod("alpha", 770, 771, true, false, true); -+ public static final BlendMethod ADD = new BlendMethod("add", 770, 1, true, false, true); -+ public static final BlendMethod SUBTRACT = new BlendMethod("subtract", 775, 0, true, true, false); -+ public static final BlendMethod MULTIPLY = new BlendMethod("multiply", 774, 771, true, true, true); -+ public static final BlendMethod DODGE = new BlendMethod("dodge", 1, 1, true, true, false); -+ public static final BlendMethod BURN = new BlendMethod("burn", 0, 769, true, true, false); -+ public static final BlendMethod SCREEN = new BlendMethod("screen", 1, 769, true, true, false); -+ public static final BlendMethod OVERLAY = new BlendMethod("overlay", 774, 768, true, true, false); -+ public static final BlendMethod REPLACE = new BlendMethod("replace", 0, 0, false, false, true); -+ private final int srcBlend; -+ private final int dstBlend; -+ private final String name; -+ private final boolean blend; -+ private final boolean fadeRGB; -+ private final boolean fadeAlpha; -+ -+ public static BlendMethod parse(String text) { -+ text = text.toLowerCase().trim(); -+ -+ if (text.equals("alpha")) { -+ return ALPHA; -+ } else if (text.equals("add")) { -+ return ADD; -+ } else if (text.equals("subtract")) { -+ return SUBTRACT; -+ } else if (text.equals("multiply")) { -+ return MULTIPLY; -+ } else if (text.equals("dodge")) { -+ return DODGE; -+ } else if (text.equals("burn")) { -+ return BURN; -+ } else if (text.equals("screen")) { -+ return SCREEN; -+ } else if (!text.equals("overlay") && !text.equals("color")) { -+ if (text.equals("replace")) { -+ return REPLACE; -+ } else { -+ String[] tokens = text.split("\\s+"); -+ -+ if (tokens.length >= 2) { -+ try { -+ int e = Integer.parseInt(tokens[0]); -+ int dstBlend = Integer.parseInt(tokens[1]); -+ return new BlendMethod("custom(" + e + "," + dstBlend + ")", e, dstBlend, true, true, false); -+ } catch (NumberFormatException var4) { -+ ; -+ } -+ } -+ -+ return null; -+ } -+ } else { -+ return OVERLAY; -+ } -+ } -+ -+ private BlendMethod(String name, int srcBlend, int dstBlend, boolean blend, boolean fadeRGB, boolean fadeAlpha) { -+ this.name = name; -+ this.srcBlend = srcBlend; -+ this.dstBlend = dstBlend; -+ this.blend = blend; -+ this.fadeRGB = fadeRGB; -+ this.fadeAlpha = fadeAlpha; -+ } -+ -+ public String toString() { -+ return this.name; -+ } -+ -+ public void applyFade(float fade) { -+ if (this.fadeRGB && this.fadeAlpha) { -+ GL11.glColor4f(fade, fade, fade, fade); -+ } else if (this.fadeRGB) { -+ GL11.glColor4f(fade, fade, fade, 1.0F); -+ } else if (this.fadeAlpha) { -+ GL11.glColor4f(1.0F, 1.0F, 1.0F, fade); -+ } -+ } -+ -+ public void applyAlphaTest() { -+ if (this.blend) { -+ GL11.glDisable(GL11.GL_ALPHA_TEST); -+ } else { -+ GL11.glEnable(GL11.GL_ALPHA_TEST); -+ } -+ } -+ -+ public void applyBlending() { -+ if (this.blend) { -+ GL11.glEnable(GL11.GL_BLEND); -+ GL11.glBlendFunc(this.srcBlend, this.dstBlend); -+ } else { -+ GL11.glDisable(GL11.GL_BLEND); -+ } -+ } -+ -+ public boolean isColorBased() { -+ return this.fadeRGB; -+ } -+ -+ public boolean canFade() { -+ return this.blend && (this.fadeAlpha || this.fadeRGB); -+ } -+} ---- /dev/null -+++ org/spoutcraft/api/gui/GenericBitmap.java -@@ -1,0 +1,66 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.api.gui; -+ -+import java.nio.ByteBuffer; -+import java.nio.IntBuffer; -+ -+import org.spoutcraft.api.Spoutcraft; -+ -+public class GenericBitmap extends GenericTexture implements Bitmap { -+ protected final byte[] bitmap; -+ protected final ByteBuffer buffer; -+ protected final int bitmapWidth; -+ protected final int bitmapHeight; -+ -+ public GenericBitmap(int width, int height) { -+ bitmapWidth = width; -+ bitmapHeight = height; -+ bitmap = new byte[width * height * 4]; -+ buffer = ByteBuffer.wrap(bitmap); -+ super.setWidth(width); -+ super.setHeight(height); -+ } -+ -+ public byte[] getRawBitmap() { -+ return bitmap; -+ } -+ -+ public int getRawWidth() { -+ return bitmapWidth; -+ } -+ -+ public int getRawHeight() { -+ return bitmapHeight; -+ } -+ -+ public ByteBuffer getByteBuffer() { -+ return buffer; -+ } -+ -+ public IntBuffer getBuffer() { -+ return buffer.asIntBuffer(); -+ } -+ -+ @Override -+ public void render() { -+ Spoutcraft.getClient().getRenderDelegate().render(this); -+ } -+} ---- net/minecraft/src/GuiHopper.java -+++ net/minecraft/src/GuiHopper.java -@@ -7,20 +7,26 @@ - private IInventory field_94081_r; - private IInventory field_94080_s; - -- public GuiHopper(InventoryPlayer var1, IInventory var2) { -- super(new ContainerHopper(var1, var2)); -- this.field_94081_r = var1; -- this.field_94080_s = var2; -+ public GuiHopper(InventoryPlayer par1InventoryPlayer, IInventory par2IInventory) { -+ super(new ContainerHopper(par1InventoryPlayer, par2IInventory)); -+ this.field_94081_r = par1InventoryPlayer; -+ this.field_94080_s = par2IInventory; - this.allowUserInput = false; - this.ySize = 133; - } - -- protected void drawGuiContainerForegroundLayer(int var1, int var2) { -+ /** -+ * Draw the foreground layer for the GuiContainer (everything in front of the items) -+ */ -+ protected void drawGuiContainerForegroundLayer(int par1, int par2) { - this.fontRenderer.drawString(this.field_94080_s.isInvNameLocalized() ? this.field_94080_s.getInvName() : I18n.getString(this.field_94080_s.getInvName()), 8, 6, 4210752); - this.fontRenderer.drawString(this.field_94081_r.isInvNameLocalized() ? this.field_94081_r.getInvName() : I18n.getString(this.field_94081_r.getInvName()), 8, this.ySize - 96 + 2, 4210752); - } - -- protected void drawGuiContainerBackgroundLayer(float var1, int var2, int var3) { -+ /** -+ * Draw the background layer for the GuiContainer (everything behind the items) -+ */ -+ protected void drawGuiContainerBackgroundLayer(float par1, int par2, int par3) { - GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - this.mc.getTextureManager().bindTexture(hopperGuiTextures); - int var4 = (this.width - this.xSize) / 2; ---- /dev/null -+++ com/prupe/mcpatcher/ctm/RenderPassAPI.java -@@ -1,0 +1,21 @@ -+package com.prupe.mcpatcher.ctm; -+ -+import net.minecraft.src.Block; -+ -+class RenderPassAPI { -+ static RenderPassAPI instance = new RenderPassAPI(); -+ -+ boolean skipDefaultRendering(Block block) { -+ return false; -+ } -+ -+ boolean skipThisRenderPass(Block block, int pass) { -+ return pass > 2; -+ } -+ -+ void clear() {} -+ -+ void setRenderPassForBlock(Block block, int pass) {} -+ -+ void finish() {} -+} ---- /dev/null -+++ org/spoutcraft/client/PacketDecompressionThread.java -@@ -1,0 +1,102 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.client; -+ -+import java.util.Collections; -+import java.util.Iterator; -+import java.util.LinkedList; -+import java.util.List; -+import java.util.concurrent.LinkedBlockingDeque; -+ -+import org.spoutcraft.client.packet.CompressablePacket; -+import org.spoutcraft.client.packet.SpoutPacket; -+ -+public class PacketDecompressionThread extends Thread { -+ private static PacketDecompressionThread instance = null; -+ -+ private static final int QUEUE_CAPACITY = 1024 * 10; -+ private final LinkedBlockingDeque queue = new LinkedBlockingDeque(QUEUE_CAPACITY); -+ private final List decompressed = Collections.synchronizedList(new LinkedList()); -+ -+ private PacketDecompressionThread() { -+ } -+ -+ public static void startThread() { -+ instance = new PacketDecompressionThread(); -+ instance.start(); -+ } -+ -+ public static void endThread() { -+ if (instance == null) { -+ return; -+ } -+ instance.interrupt(); -+ try { -+ instance.join(); -+ } catch (InterruptedException ie) { -+ } -+ instance = null; -+ } -+ -+ public static PacketDecompressionThread getInstance() { -+ return instance; -+ } -+ -+ public static void add(CompressablePacket packet) { -+ if (instance != null) { -+ instance.queue.add(packet); -+ } -+ } -+ -+ public void run() { -+ while (!isInterrupted()) { -+ try { -+ CompressablePacket packet = queue.take(); -+ packet.decompress(); -+ synchronized(decompressed) { -+ decompressed.add(packet); -+ } -+ } catch (InterruptedException e) { -+ break; -+ } -+ } -+ } -+ -+ public static void onTick() { -+ synchronized(instance.decompressed) { -+ Iterator i = instance.decompressed.iterator(); -+ while (i.hasNext()) { -+ SpoutPacket packet = i.next(); -+ try { -+ SpoutClient.getHandle().mcProfiler.startSection(packet.getPacketType().name()); -+ packet.run(SpoutClient.getHandle().thePlayer.entityId); -+ i.remove(); -+ } catch (Exception e) { -+ System.out.println("------------------------"); -+ System.out.println("Unexpected Exception: " + packet.getPacketType()); -+ e.printStackTrace(); -+ System.out.println("------------------------"); -+ } finally { -+ SpoutClient.getHandle().mcProfiler.endSection(); -+ } -+ } -+ } -+ } -+} ---- net/minecraft/src/CallableScreenSize.java -+++ net/minecraft/src/CallableScreenSize.java -@@ -4,15 +4,16 @@ - - class CallableScreenSize implements Callable { - final ScaledResolution theScaledResolution; -+ - final EntityRenderer theEntityRenderer; - -- CallableScreenSize(EntityRenderer var1, ScaledResolution var2) { -- this.theEntityRenderer = var1; -- this.theScaledResolution = var2; -+ CallableScreenSize(EntityRenderer par1EntityRenderer, ScaledResolution par2ScaledResolution) { -+ this.theEntityRenderer = par1EntityRenderer; -+ this.theScaledResolution = par2ScaledResolution; - } - - public String callScreenSize() { -- return String.format("Scaled: (%d, %d). Absolute: (%d, %d). Scale factor of %d", new Object[]{Integer.valueOf(this.theScaledResolution.getScaledWidth()), Integer.valueOf(this.theScaledResolution.getScaledHeight()), Integer.valueOf(EntityRenderer.getRendererMinecraft(this.theEntityRenderer).displayWidth), Integer.valueOf(EntityRenderer.getRendererMinecraft(this.theEntityRenderer).displayHeight), Integer.valueOf(this.theScaledResolution.getScaleFactor())}); -+ return String.format("Scaled: (%d, %d). Absolute: (%d, %d). Scale factor of %d", new Object[] {Integer.valueOf(this.theScaledResolution.getScaledWidth()), Integer.valueOf(this.theScaledResolution.getScaledHeight()), Integer.valueOf(EntityRenderer.getRendererMinecraft(this.theEntityRenderer).displayWidth), Integer.valueOf(EntityRenderer.getRendererMinecraft(this.theEntityRenderer).displayHeight), Integer.valueOf(this.theScaledResolution.getScaleFactor())}); - } - - public Object call() { ---- net/minecraft/src/CallableLevelGeneratorOptions.java -+++ net/minecraft/src/CallableLevelGeneratorOptions.java -@@ -5,8 +5,8 @@ - class CallableLevelGeneratorOptions implements Callable { - final WorldInfo worldInfoInstance; - -- CallableLevelGeneratorOptions(WorldInfo var1) { -- this.worldInfoInstance = var1; -+ CallableLevelGeneratorOptions(WorldInfo par1WorldInfo) { -+ this.worldInfoInstance = par1WorldInfo; - } - - public String callLevelGeneratorOptions() { ---- net/minecraft/src/Packet60Explosion.java -+++ net/minecraft/src/Packet60Explosion.java -@@ -12,93 +12,119 @@ - public double explosionY; - public double explosionZ; - public float explosionSize; -- public List e; -+ public List chunkPositionRecords; -+ -+ /** X velocity of the player being pushed by the explosion */ - private float playerVelocityX; -+ -+ /** Y velocity of the player being pushed by the explosion */ - private float playerVelocityY; -+ -+ /** Z velocity of the player being pushed by the explosion */ - private float playerVelocityZ; - -- public Packet60Explosion() { -- } -- -- public Packet60Explosion(double var1, double var3, double var5, float var7, List var8, Vec3 var9) { -- this.explosionX = var1; -- this.explosionY = var3; -- this.explosionZ = var5; -- this.explosionSize = var7; -- this.e = new ArrayList(var8); -- if(var9 != null) { -- this.playerVelocityX = (float)var9.xCoord; -- this.playerVelocityY = (float)var9.yCoord; -- this.playerVelocityZ = (float)var9.zCoord; -+ public Packet60Explosion() {} -+ -+ public Packet60Explosion(double par1, double par3, double par5, float par7, List par8List, Vec3 par9Vec3) { -+ this.explosionX = par1; -+ this.explosionY = par3; -+ this.explosionZ = par5; -+ this.explosionSize = par7; -+ this.chunkPositionRecords = new ArrayList(par8List); -+ -+ if (par9Vec3 != null) { -+ this.playerVelocityX = (float)par9Vec3.xCoord; -+ this.playerVelocityY = (float)par9Vec3.yCoord; -+ this.playerVelocityZ = (float)par9Vec3.zCoord; - } -- - } - -- public void readPacketData(DataInput var1) throws IOException { -- this.explosionX = var1.readDouble(); -- this.explosionY = var1.readDouble(); -- this.explosionZ = var1.readDouble(); -- this.explosionSize = var1.readFloat(); -- int var2 = var1.readInt(); -- this.e = new ArrayList(var2); -+ /** -+ * Abstract. Reads the raw packet data from the data stream. -+ */ -+ public void readPacketData(DataInput par1DataInput) throws IOException { -+ this.explosionX = par1DataInput.readDouble(); -+ this.explosionY = par1DataInput.readDouble(); -+ this.explosionZ = par1DataInput.readDouble(); -+ this.explosionSize = par1DataInput.readFloat(); -+ int var2 = par1DataInput.readInt(); -+ this.chunkPositionRecords = new ArrayList(var2); - int var3 = (int)this.explosionX; - int var4 = (int)this.explosionY; - int var5 = (int)this.explosionZ; - -- for(int var6 = 0; var6 < var2; ++var6) { -- int var7 = var1.readByte() + var3; -- int var8 = var1.readByte() + var4; -- int var9 = var1.readByte() + var5; -- this.e.add(new ChunkPosition(var7, var8, var9)); -+ for (int var6 = 0; var6 < var2; ++var6) { -+ int var7 = par1DataInput.readByte() + var3; -+ int var8 = par1DataInput.readByte() + var4; -+ int var9 = par1DataInput.readByte() + var5; -+ this.chunkPositionRecords.add(new ChunkPosition(var7, var8, var9)); - } - -- this.playerVelocityX = var1.readFloat(); -- this.playerVelocityY = var1.readFloat(); -- this.playerVelocityZ = var1.readFloat(); -+ this.playerVelocityX = par1DataInput.readFloat(); -+ this.playerVelocityY = par1DataInput.readFloat(); -+ this.playerVelocityZ = par1DataInput.readFloat(); - } - -- public void writePacketData(DataOutput var1) throws IOException { -- var1.writeDouble(this.explosionX); -- var1.writeDouble(this.explosionY); -- var1.writeDouble(this.explosionZ); -- var1.writeFloat(this.explosionSize); -- var1.writeInt(this.e.size()); -+ /** -+ * Abstract. Writes the raw packet data to the data stream. -+ */ -+ public void writePacketData(DataOutput par1DataOutput) throws IOException { -+ par1DataOutput.writeDouble(this.explosionX); -+ par1DataOutput.writeDouble(this.explosionY); -+ par1DataOutput.writeDouble(this.explosionZ); -+ par1DataOutput.writeFloat(this.explosionSize); -+ par1DataOutput.writeInt(this.chunkPositionRecords.size()); - int var2 = (int)this.explosionX; - int var3 = (int)this.explosionY; - int var4 = (int)this.explosionZ; -- Iterator var5 = this.e.iterator(); -+ Iterator var5 = this.chunkPositionRecords.iterator(); - -- while(var5.hasNext()) { -+ while (var5.hasNext()) { - ChunkPosition var6 = (ChunkPosition)var5.next(); - int var7 = var6.x - var2; - int var8 = var6.y - var3; - int var9 = var6.z - var4; -- var1.writeByte(var7); -- var1.writeByte(var8); -- var1.writeByte(var9); -+ par1DataOutput.writeByte(var7); -+ par1DataOutput.writeByte(var8); -+ par1DataOutput.writeByte(var9); - } - -- var1.writeFloat(this.playerVelocityX); -- var1.writeFloat(this.playerVelocityY); -- var1.writeFloat(this.playerVelocityZ); -- } -- -- public void processPacket(NetHandler var1) { -- var1.handleExplosion(this); -- } -- -+ par1DataOutput.writeFloat(this.playerVelocityX); -+ par1DataOutput.writeFloat(this.playerVelocityY); -+ par1DataOutput.writeFloat(this.playerVelocityZ); -+ } -+ -+ /** -+ * Passes this Packet on to the NetHandler for processing. -+ */ -+ public void processPacket(NetHandler par1NetHandler) { -+ par1NetHandler.handleExplosion(this); -+ } -+ -+ /** -+ * Abstract. Return the size of the packet (not counting the header). -+ */ - public int getPacketSize() { -- return 32 + this.e.size() * 3 + 3; -+ return 32 + this.chunkPositionRecords.size() * 3 + 3; - } - -+ /** -+ * Gets the X velocity of the player being pushed by the explosion. -+ */ - public float getPlayerVelocityX() { - return this.playerVelocityX; - } - -+ /** -+ * Gets the Y velocity of the player being pushed by the explosion. -+ */ - public float getPlayerVelocityY() { - return this.playerVelocityY; - } - -+ /** -+ * Gets the Z velocity of the player being pushed by the explosion. -+ */ - public float getPlayerVelocityZ() { - return this.playerVelocityZ; - } ---- /dev/null -+++ org/spoutcraft/client/gui/minimap/MinimapConfig.java -@@ -1,0 +1,438 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.client.gui.minimap; -+ -+import java.io.File; -+import java.io.IOException; -+import java.util.ArrayList; -+import java.util.HashMap; -+import java.util.HashSet; -+import java.util.Iterator; -+import java.util.LinkedList; -+import java.util.List; -+import java.util.Map; -+import java.util.Map.Entry; -+ -+import net.minecraft.src.Entity; -+ -+import org.bukkit.util.config.Configuration; -+import org.bukkit.util.config.ConfigurationNode; -+ -+import org.spoutcraft.client.SpoutClient; -+import org.spoutcraft.client.io.FileUtil; -+ -+public class MinimapConfig { -+ private static volatile MinimapConfig instance; -+ private final Configuration config; -+ -+ private boolean enabled = false; -+ private boolean coords = true; -+ private int zoom = 1; -+ private boolean color = true; -+ private boolean square = false; -+ private boolean lightmap = false; -+ private boolean heightmap = true; -+ private boolean cavemap = false; -+ private boolean firstrun = true; -+ private boolean scale = false; -+ private float xAdjust = -5; -+ private float yAdjust = 5; -+ private float sizeAdjust = 1F; -+ private boolean directions = true; -+ private boolean deathpoints = true; -+ private boolean background = true; -+ private final Map> waypoints = new HashMap>(); -+ private final List serverWaypoints = new LinkedList(); -+ private Waypoint focussedWaypoint = null; -+ private int scanRadius = 3; -+ -+ private final HashSet> blockedEntities = new HashSet>(); -+ private boolean showEntities = true; -+ /* -+ * minimap: enabled: true ... waypoints: world1: home: x: 128 z: -82 -+ * enabled: 1 work: ... -+ */ -+ private MinimapConfig(boolean load) { -+ File file = new File(FileUtil.getConfigDir(), "minimap.yml"); -+ if (!file.exists()) { -+ try { -+ file.createNewFile(); -+ } catch (IOException e) { } -+ } -+ config = new Configuration(file); -+ if (load) { -+ config.load(); -+ enabled = config.getBoolean("minimap.visible", enabled); -+ coords = config.getBoolean("minimap.coords", coords); -+ zoom = config.getInt("minimap.zoom", zoom); -+ color = config.getBoolean("minimap.color", color); -+ square = config.getBoolean("minimap.square", square); -+ lightmap = config.getBoolean("minimap.lightmap", lightmap); -+ heightmap = config.getBoolean("minimap.heightmap", heightmap); -+ cavemap = config.getBoolean("minimap.cavemap", cavemap); -+ scale = config.getBoolean("minimap.scale", scale); -+ deathpoints = config.getBoolean("minimap.deathpoints", deathpoints); -+ background = config.getBoolean("minimap.background", background); -+ xAdjust = (float) config.getDouble("minimap.xAdjust", xAdjust); -+ yAdjust = (float) config.getDouble("minimap.yAdjust", yAdjust); -+ sizeAdjust = (float) config.getDouble("minimap.sizeAdjust", sizeAdjust); -+ directions = config.getBoolean("minimap.directions", directions); -+ scanRadius = config.getInt("minimap.scanRadius", scanRadius); -+ showEntities = config.getBoolean("minimap.showEntities", true); -+ } -+ firstrun = config.getBoolean("minimap.firstrun", firstrun); -+ Map worlds = config.getNodes("waypoints"); -+ if (worlds != null) { -+ Iterator i = worlds.entrySet().iterator(); -+ while (i.hasNext()) { -+ Object o = i.next(); -+ if (o instanceof Entry) { -+ @SuppressWarnings("rawtypes") -+ Entry e = (Entry) o; -+ if (e.getKey() instanceof String) { -+ try { -+ String world = (String) e.getKey(); -+ ConfigurationNode waypoints = (ConfigurationNode) e.getValue(); -+ for (String name:waypoints.getKeys()) { -+ Map locations = waypoints.getNode(name).getAll(); -+ int x, y = 64, z; -+ x = (Integer) locations.get("x"); -+ if (locations.containsKey("y")) { -+ y = (Integer) locations.get("y"); -+ } -+ z = (Integer) locations.get("z"); -+ boolean enabled = (Integer) locations.get("enabled") == 1; -+ -+ boolean deathpoint = false; -+ if (locations.containsKey("deathpoint")) { -+ deathpoint = (Integer) locations.get("deathpoint") == 1; -+ } -+ -+ Waypoint waypoint = new Waypoint(name, x, y, z, enabled); -+ waypoint.deathpoint = deathpoint; -+ addWaypoint(world, waypoint); -+ } -+ } catch (Exception ex) { -+ System.err.println("Error while reading waypoints: "); -+ ex.printStackTrace(); -+ } -+ } else { -+ System.out.println("Entry did not satisfy needs... key: " + e.getKey() + " value: " + e.getValue()); -+ } -+ } -+ } -+ } -+ List blocked = config.getStringList("blockedEntities", new ArrayList()); -+ if (blocked != null) { -+ Iterator i = blocked.iterator(); -+ while (i.hasNext()) { -+ try { -+ Class clazz = ClassLoader.getSystemClassLoader().loadClass(i.next()); -+ blockedEntities.add((Class) clazz); -+ } catch (ClassNotFoundException e) { -+ i.remove(); -+ } catch (ClassCastException e1) { -+ } -+ } -+ } -+ config.setProperty("blockedEntities", blocked); -+ config.save(); -+ } -+ -+ public static void initialize() { -+ instance = new MinimapConfig(true); -+ } -+ -+ public static void initialize(boolean load) { -+ instance = new MinimapConfig(load); -+ } -+ -+ public synchronized void save() { -+ config.setProperty("minimap.visible", enabled); -+ config.setProperty("minimap.coords", coords); -+ config.setProperty("minimap.zoom", zoom); -+ config.setProperty("minimap.color", color); -+ config.setProperty("minimap.square", square); -+ config.setProperty("minimap.lightmap", lightmap); -+ config.setProperty("minimap.heightmap", heightmap); -+ config.setProperty("minimap.cavemap", cavemap); -+ config.setProperty("minimap.firstrun", firstrun); -+ config.setProperty("minimap.scale", scale); -+ config.setProperty("minimap.deathpoints", deathpoints); -+ config.setProperty("minimap.background", background); -+ config.setProperty("minimap.xAdjust", xAdjust); -+ config.setProperty("minimap.yAdjust", yAdjust); -+ config.setProperty("minimap.sizeAdjust", sizeAdjust); -+ config.setProperty("minimap.directions", directions); -+ config.setProperty("minimap.scanRadius", scanRadius); -+ config.setProperty("minimap.showEntities", showEntities); -+ HashMap>> worlds = new HashMap>>(); -+ Iterator>> i = waypoints.entrySet().iterator(); -+ while (i.hasNext()) { -+ Entry> e = i.next(); -+ String world = e.getKey(); -+ HashMap> waypoints = new HashMap>(); -+ for (Waypoint waypoint : e.getValue()) { -+ if (!waypoint.server) { -+ HashMap values = new HashMap(); -+ values.put("x", waypoint.x); -+ values.put("y", waypoint.y); -+ values.put("z", waypoint.z); -+ values.put("enabled", waypoint.enabled ? 1 : 0); -+ values.put("deathpoint", waypoint.deathpoint ? 1 : 0); -+ waypoints.put(waypoint.name, values); -+ } -+ } -+ worlds.put(world, waypoints); -+ } -+ config.setProperty("waypoints", worlds); -+ -+ List blocked = new ArrayList(); -+ for (Class e:blockedEntities) { -+ blocked.add(e.getName()); -+ } -+ -+ config.save(); -+ } -+ -+ public static MinimapConfig getInstance() { -+ return instance; -+ } -+ -+ public boolean isEnabled() { -+ return enabled; -+ } -+ -+ public void setEnabled(boolean enabled) { -+ this.enabled = enabled; -+ } -+ -+ public boolean isCoords() { -+ return coords && SpoutClient.getInstance().isCoordsCheat(); -+ } -+ -+ public void setCoords(boolean coords) { -+ this.coords = coords; -+ } -+ -+ public int getZoom() { -+ return zoom; -+ } -+ -+ public void setZoom(int zoom) { -+ this.zoom = zoom; -+ } -+ -+ public boolean isColor() { -+ return color; -+ } -+ -+ public void setColor(boolean color) { -+ this.color = color; -+ } -+ -+ public boolean isSquare() { -+ return square; -+ } -+ -+ public void setSquare(boolean square) { -+ this.square = square; -+ } -+ -+ public boolean isLightmap() { -+ return lightmap; -+ } -+ -+ public void setLightmap(boolean lightmap) { -+ this.lightmap = lightmap; -+ } -+ -+ public boolean isHeightmap() { -+ return heightmap; -+ } -+ -+ public void setHeightmap(boolean heightmap) { -+ this.heightmap = heightmap; -+ } -+ -+ public boolean isCavemap() { -+ return cavemap; -+ } -+ -+ public void setCavemap(boolean cavemap) { -+ this.cavemap = cavemap; -+ } -+ -+ public boolean isFirstrun() { -+ return firstrun; -+ } -+ -+ public void setFirstrun(boolean firstrun) { -+ this.firstrun = firstrun; -+ } -+ -+ public synchronized List getWaypoints(String world) { -+ List list = waypoints.get(world); -+ if (list == null) { -+ list = new ArrayList(); -+ waypoints.put(world, list); -+ } -+ return list; -+ } -+ -+ public synchronized void removeWaypoint(String world, String name) { -+ Iterator i = getWaypoints(world).iterator(); -+ while (i.hasNext()) { -+ if (i.next().name.equalsIgnoreCase(name)) { -+ i.remove(); -+ } -+ } -+ } -+ -+ public synchronized void addWaypoint(String world, String name, int x, int y, int z, boolean enabled) { -+ getWaypoints(world).add(new Waypoint(name, x, y, z, enabled)); -+ } -+ -+ public synchronized void addServerWaypoint(double x, double y, double z, String name) { -+ serverWaypoints.add(new Waypoint(name, (int)x, (int)y, (int)z, true)); -+ } -+ -+ public synchronized List getServerWaypoints() { -+ return serverWaypoints; -+ } -+ -+ public synchronized List getAllWaypoints(String world) { -+ LinkedList list = new LinkedList(); -+ list.addAll(getWaypoints(world)); -+ list.addAll(getServerWaypoints()); -+ return list; -+ } -+ -+ public boolean isScale() { -+ return scale; -+ } -+ -+ public void setScale(boolean scale) { -+ this.scale = scale; -+ } -+ -+ public float getAdjustX() { -+ return xAdjust; -+ } -+ -+ public void setAdjustX(float xAdjust) { -+ this.xAdjust = xAdjust; -+ } -+ -+ public float getAdjustY() { -+ return yAdjust; -+ } -+ -+ public void setAdjustY(float yAdjust) { -+ this.yAdjust = yAdjust; -+ } -+ -+ public float getSizeAdjust() { -+ return sizeAdjust; -+ } -+ -+ public void setSizeAdjust(float sizeAdjust) { -+ this.sizeAdjust = sizeAdjust; -+ } -+ -+ public boolean isDirections() { -+ return directions; -+ } -+ -+ public void setDirections(boolean directions) { -+ this.directions = directions; -+ } -+ -+ public Waypoint getFocussedWaypoint() { -+ return focussedWaypoint; -+ } -+ -+ public void setFocussedWaypoint(Waypoint focussedWaypoint) { -+ this.focussedWaypoint = focussedWaypoint; -+ } -+ -+ public void removeWaypoint(Waypoint clickedWaypoint) { -+ for (List list:waypoints.values()) { -+ list.remove(clickedWaypoint); -+ } -+ } -+ -+ public void addWaypoint(Waypoint waypoint) { -+ addWaypoint(MinimapUtils.getWorldName(), waypoint); -+ } -+ -+ public void addWaypoint(String worldName, Waypoint waypoint) { -+ List list = waypoints.get(worldName); -+ if (list == null) { -+ list = new LinkedList(); -+ waypoints.put(worldName, list); -+ } -+ list.add(waypoint); -+ } -+ -+ public boolean isDeathpoints() { -+ return deathpoints; -+ } -+ -+ public void setDeathpoints(boolean deathpoints) { -+ this.deathpoints = deathpoints; -+ } -+ -+ public boolean isShowBackground() { -+ return background; -+ } -+ -+ public void setShowBackground(boolean background) { -+ this.background = background; -+ } -+ -+ public int getScanRadius() { -+ return scanRadius; -+ } -+ -+ public void setScanRadius(int radius) { -+ this.scanRadius = radius; -+ } -+ -+ public void setEntityVisible(Class clazz, boolean visible) { -+ if (visible) { -+ blockedEntities.remove(clazz); -+ } else { -+ blockedEntities.add(clazz); -+ } -+ } -+ -+ public boolean isEntityVisible(Class clazz) { -+ return !blockedEntities.contains(clazz); -+ } -+ -+ public boolean isShowingEntities() { -+ return showEntities; -+ } -+ -+ public void setShowEntities(boolean showEntities) { -+ this.showEntities = showEntities; -+ } -+} ---- net/minecraft/src/ContainerRepair.java -+++ net/minecraft/src/ContainerRepair.java -@@ -4,55 +4,73 @@ - import java.util.Map; - - public class ContainerRepair extends Container { -+ -+ /** Here comes out item you merged and/or renamed. */ - private IInventory outputSlot = new InventoryCraftResult(); -+ -+ /** -+ * The 2slots where you put your items in that you want to merge and/or rename. -+ */ - private IInventory inputSlots = new ContainerRepairINNER1(this, "Repair", true, 2); - private World theWorld; - private int field_82861_i; - private int field_82858_j; - private int field_82859_k; -+ -+ /** The maximum cost of repairing/renaming in the anvil. */ - public int maximumCost; -+ -+ /** determined by damage of input item and stackSize of repair materials */ - private int stackSizeToBeUsedInRepair; -- private String m; -+ private String repairedItemName; -+ -+ /** The player that has this container open. */ - private final EntityPlayer thePlayer; - -- public ContainerRepair(InventoryPlayer var1, World var2, int var3, int var4, int var5, EntityPlayer var6) { -- this.theWorld = var2; -- this.field_82861_i = var3; -- this.field_82858_j = var4; -- this.field_82859_k = var5; -- this.thePlayer = var6; -+ public ContainerRepair(InventoryPlayer par1InventoryPlayer, World par2World, int par3, int par4, int par5, EntityPlayer par6EntityPlayer) { -+ this.theWorld = par2World; -+ this.field_82861_i = par3; -+ this.field_82858_j = par4; -+ this.field_82859_k = par5; -+ this.thePlayer = par6EntityPlayer; - this.addSlotToContainer(new Slot(this.inputSlots, 0, 27, 47)); - this.addSlotToContainer(new Slot(this.inputSlots, 1, 76, 47)); -- this.addSlotToContainer(new ContainerRepairINNER2(this, this.outputSlot, 2, 134, 47, var2, var3, var4, var5)); -- -+ this.addSlotToContainer(new ContainerRepairINNER2(this, this.outputSlot, 2, 134, 47, par2World, par3, par4, par5)); - int var7; -- for(var7 = 0; var7 < 3; ++var7) { -- for(int var8 = 0; var8 < 9; ++var8) { -- this.addSlotToContainer(new Slot(var1, var8 + var7 * 9 + 9, 8 + var8 * 18, 84 + var7 * 18)); -+ -+ for (var7 = 0; var7 < 3; ++var7) { -+ for (int var8 = 0; var8 < 9; ++var8) { -+ this.addSlotToContainer(new Slot(par1InventoryPlayer, var8 + var7 * 9 + 9, 8 + var8 * 18, 84 + var7 * 18)); - } - } - -- for(var7 = 0; var7 < 9; ++var7) { -- this.addSlotToContainer(new Slot(var1, var7, 8 + var7 * 18, 142)); -+ for (var7 = 0; var7 < 9; ++var7) { -+ this.addSlotToContainer(new Slot(par1InventoryPlayer, var7, 8 + var7 * 18, 142)); - } -- - } - -- public void onCraftMatrixChanged(IInventory var1) { -- super.onCraftMatrixChanged(var1); -- if(var1 == this.inputSlots) { -+ /** -+ * Callback for when the crafting matrix is changed. -+ */ -+ public void onCraftMatrixChanged(IInventory par1IInventory) { -+ super.onCraftMatrixChanged(par1IInventory); -+ -+ if (par1IInventory == this.inputSlots) { - this.updateRepairOutput(); - } -- - } - -+ /** -+ * called when the Anvil Input Slot changes, calculates the new result and puts it in the output slot -+ */ - public void updateRepairOutput() { - ItemStack var1 = this.inputSlots.getStackInSlot(0); - this.maximumCost = 0; - int var2 = 0; - byte var3 = 0; - int var4 = 0; -- if(var1 == null) { -+ -+ if (var1 == null) { - this.outputSlot.setInventorySlotContents(0, (ItemStack)null); - this.maximumCost = 0; - } else { -@@ -69,17 +87,20 @@ - int var14; - Iterator var21; - Enchantment var22; -- if(var6 != null) { -+ -+ if (var6 != null) { - var8 = var6.itemID == Item.enchantedBook.itemID && Item.enchantedBook.func_92110_g(var6).tagCount() > 0; -- if(var5.isItemStackDamageable() && Item.itemsList[var5.itemID].getIsRepairable(var1, var6)) { -+ -+ if (var5.isItemStackDamageable() && Item.itemsList[var5.itemID].getIsRepairable(var1, var6)) { - var9 = Math.min(var5.getItemDamageForDisplay(), var5.getMaxDamage() / 4); -- if(var9 <= 0) { -+ -+ if (var9 <= 0) { - this.outputSlot.setInventorySlotContents(0, (ItemStack)null); - this.maximumCost = 0; - return; - } - -- for(var10 = 0; var9 > 0 && var10 < var6.stackSize; ++var10) { -+ for (var10 = 0; var9 > 0 && var10 < var6.stackSize; ++var10) { - var11 = var5.getItemDamageForDisplay() - var9; - var5.setItemDamage(var11); - var2 += Math.max(1, var9 / 100) + var7.size(); -@@ -88,23 +109,24 @@ - - this.stackSizeToBeUsedInRepair = var10; - } else { -- if(!var8 && (var5.itemID != var6.itemID || !var5.isItemStackDamageable())) { -+ if (!var8 && (var5.itemID != var6.itemID || !var5.isItemStackDamageable())) { - this.outputSlot.setInventorySlotContents(0, (ItemStack)null); - this.maximumCost = 0; - return; - } - -- if(var5.isItemStackDamageable() && !var8) { -+ if (var5.isItemStackDamageable() && !var8) { - var9 = var1.getMaxDamage() - var1.getItemDamageForDisplay(); - var10 = var6.getMaxDamage() - var6.getItemDamageForDisplay(); - var11 = var10 + var5.getMaxDamage() * 12 / 100; - int var12 = var9 + var11; - var13 = var5.getMaxDamage() - var12; -- if(var13 < 0) { -+ -+ if (var13 < 0) { - var13 = 0; - } - -- if(var13 < var5.getItemDamage()) { -+ if (var13 < var5.getItemDamage()) { - var5.setItemDamage(var13); - var2 += Math.max(1, var11 / 100); - } -@@ -113,13 +135,14 @@ - Map var20 = EnchantmentHelper.getEnchantments(var6); - var21 = var20.keySet().iterator(); - -- while(var21.hasNext()) { -+ while (var21.hasNext()) { - var11 = ((Integer)var21.next()).intValue(); - var22 = Enchantment.enchantmentsList[var11]; - var13 = var7.containsKey(Integer.valueOf(var11)) ? ((Integer)var7.get(Integer.valueOf(var11))).intValue() : 0; - var14 = ((Integer)var20.get(Integer.valueOf(var11))).intValue(); - int var10000; -- if(var13 == var14) { -+ -+ if (var13 == var14) { - ++var14; - var10000 = var14; - } else { -@@ -129,49 +152,56 @@ - var14 = var10000; - int var15 = var14 - var13; - boolean var16 = var22.canApply(var1); -- if(this.thePlayer.capabilities.isCreativeMode || var1.itemID == ItemEnchantedBook.enchantedBook.itemID) { -+ -+ if (this.thePlayer.capabilities.isCreativeMode || var1.itemID == ItemEnchantedBook.enchantedBook.itemID) { - var16 = true; - } - - Iterator var17 = var7.keySet().iterator(); - -- while(var17.hasNext()) { -+ while (var17.hasNext()) { - int var18 = ((Integer)var17.next()).intValue(); -- if(var18 != var11 && !var22.canApplyTogether(Enchantment.enchantmentsList[var18])) { -+ -+ if (var18 != var11 && !var22.canApplyTogether(Enchantment.enchantmentsList[var18])) { - var16 = false; - var2 += var15; - } - } - -- if(var16) { -- if(var14 > var22.getMaxLevel()) { -+ if (var16) { -+ if (var14 > var22.getMaxLevel()) { - var14 = var22.getMaxLevel(); - } - - var7.put(Integer.valueOf(var11), Integer.valueOf(var14)); - int var23 = 0; -- switch(var22.getWeight()) { -- case 1: -- var23 = 8; -- break; -- case 2: -- var23 = 4; -- case 3: -- case 4: -- case 6: -- case 7: -- case 8: -- case 9: -- default: -- break; -- case 5: -- var23 = 2; -- break; -- case 10: -- var23 = 1; -+ -+ switch (var22.getWeight()) { -+ case 1: -+ var23 = 8; -+ break; -+ -+ case 2: -+ var23 = 4; -+ -+ case 3: -+ case 4: -+ case 6: -+ case 7: -+ case 8: -+ case 9: -+ default: -+ break; -+ -+ case 5: -+ var23 = 2; -+ break; -+ -+ case 10: -+ var23 = 1; - } - -- if(var8) { -+ if (var8) { - var23 = Math.max(1, var23 / 2); - } - -@@ -181,84 +211,92 @@ - } - } - -- if(org.apache.commons.lang3.StringUtils.isBlank(this.m)) { -- if(var1.hasDisplayName()) { -+ if (org.apache.commons.lang3.StringUtils.isBlank(this.repairedItemName)) { -+ if (var1.hasDisplayName()) { - var4 = var1.isItemStackDamageable() ? 7 : var1.stackSize * 5; - var2 += var4; - var5.func_135074_t(); - } -- } else if(!this.m.equals(var1.getDisplayName())) { -+ } else if (!this.repairedItemName.equals(var1.getDisplayName())) { - var4 = var1.isItemStackDamageable() ? 7 : var1.stackSize * 5; - var2 += var4; -- if(var1.hasDisplayName()) { -+ -+ if (var1.hasDisplayName()) { - var19 += var4 / 2; - } - -- var5.setItemName(this.m); -+ var5.setItemName(this.repairedItemName); - } - - var9 = 0; - -- for(var21 = var7.keySet().iterator(); var21.hasNext(); var19 += var9 + var13 * var14) { -+ for (var21 = var7.keySet().iterator(); var21.hasNext(); var19 += var9 + var13 * var14) { - var11 = ((Integer)var21.next()).intValue(); - var22 = Enchantment.enchantmentsList[var11]; - var13 = ((Integer)var7.get(Integer.valueOf(var11))).intValue(); - var14 = 0; - ++var9; -- switch(var22.getWeight()) { -- case 1: -- var14 = 8; -- break; -- case 2: -- var14 = 4; -- case 3: -- case 4: -- case 6: -- case 7: -- case 8: -- case 9: -- default: -- break; -- case 5: -- var14 = 2; -- break; -- case 10: -- var14 = 1; -+ -+ switch (var22.getWeight()) { -+ case 1: -+ var14 = 8; -+ break; -+ -+ case 2: -+ var14 = 4; -+ -+ case 3: -+ case 4: -+ case 6: -+ case 7: -+ case 8: -+ case 9: -+ default: -+ break; -+ -+ case 5: -+ var14 = 2; -+ break; -+ -+ case 10: -+ var14 = 1; - } - -- if(var8) { -+ if (var8) { - var14 = Math.max(1, var14 / 2); - } - } - -- if(var8) { -+ if (var8) { - var19 = Math.max(1, var19 / 2); - } - - this.maximumCost = var19 + var2; -- if(var2 <= 0) { -+ -+ if (var2 <= 0) { - var5 = null; - } - -- if(var4 == var2 && var4 > 0 && this.maximumCost >= 40) { -+ if (var4 == var2 && var4 > 0 && this.maximumCost >= 40) { - this.maximumCost = 39; - } - -- if(this.maximumCost >= 40 && !this.thePlayer.capabilities.isCreativeMode) { -+ if (this.maximumCost >= 40 && !this.thePlayer.capabilities.isCreativeMode) { - var5 = null; - } - -- if(var5 != null) { -+ if (var5 != null) { - var10 = var5.getRepairCost(); -- if(var6 != null && var10 < var6.getRepairCost()) { -+ -+ if (var6 != null && var10 < var6.getRepairCost()) { - var10 = var6.getRepairCost(); - } - -- if(var5.hasDisplayName()) { -+ if (var5.hasDisplayName()) { - var10 -= 9; - } - -- if(var10 < 0) { -+ if (var10 < 0) { - var10 = 0; - } - -@@ -272,90 +310,103 @@ - } - } - -- public void onCraftGuiOpened(ICrafting var1) { -- super.onCraftGuiOpened(var1); -- var1.sendProgressBarUpdate(this, 0, this.maximumCost); -+ public void addCraftingToCrafters(ICrafting par1ICrafting) { -+ super.addCraftingToCrafters(par1ICrafting); -+ par1ICrafting.sendProgressBarUpdate(this, 0, this.maximumCost); - } - -- public void updateProgressBar(int var1, int var2) { -- if(var1 == 0) { -- this.maximumCost = var2; -+ public void updateProgressBar(int par1, int par2) { -+ if (par1 == 0) { -+ this.maximumCost = par2; - } -- - } - -- public void onContainerClosed(EntityPlayer var1) { -- super.onContainerClosed(var1); -- if(!this.theWorld.isRemote) { -- for(int var2 = 0; var2 < this.inputSlots.getSizeInventory(); ++var2) { -+ /** -+ * Called when the container is closed. -+ */ -+ public void onContainerClosed(EntityPlayer par1EntityPlayer) { -+ super.onContainerClosed(par1EntityPlayer); -+ -+ if (!this.theWorld.isRemote) { -+ for (int var2 = 0; var2 < this.inputSlots.getSizeInventory(); ++var2) { - ItemStack var3 = this.inputSlots.getStackInSlotOnClosing(var2); -- if(var3 != null) { -- var1.dropPlayerItem(var3); -+ -+ if (var3 != null) { -+ par1EntityPlayer.dropPlayerItem(var3); - } - } -- - } - } - -- public boolean canInteractWith(EntityPlayer var1) { -- return this.theWorld.getBlockId(this.field_82861_i, this.field_82858_j, this.field_82859_k) != Block.anvil.blockID ? false : var1.getDistanceSq((double)this.field_82861_i + 0.5D, (double)this.field_82858_j + 0.5D, (double)this.field_82859_k + 0.5D) <= 64.0D; -+ public boolean canInteractWith(EntityPlayer par1EntityPlayer) { -+ return this.theWorld.getBlockId(this.field_82861_i, this.field_82858_j, this.field_82859_k) != Block.anvil.blockID ? false : par1EntityPlayer.getDistanceSq((double)this.field_82861_i + 0.5D, (double)this.field_82858_j + 0.5D, (double)this.field_82859_k + 0.5D) <= 64.0D; - } - -- public ItemStack transferStackInSlot(EntityPlayer var1, int var2) { -+ /** -+ * Called when a player shift-clicks on a slot. You must override this or you will crash when someone does that. -+ */ -+ public ItemStack transferStackInSlot(EntityPlayer par1EntityPlayer, int par2) { - ItemStack var3 = null; -- Slot var4 = (Slot)this.c.get(var2); -- if(var4 != null && var4.getHasStack()) { -+ Slot var4 = (Slot)this.inventorySlots.get(par2); -+ -+ if (var4 != null && var4.getHasStack()) { - ItemStack var5 = var4.getStack(); - var3 = var5.copy(); -- if(var2 == 2) { -- if(!this.mergeItemStack(var5, 3, 39, true)) { -+ -+ if (par2 == 2) { -+ if (!this.mergeItemStack(var5, 3, 39, true)) { - return null; - } - - var4.onSlotChange(var5, var3); -- } else if(var2 != 0 && var2 != 1) { -- if(var2 >= 3 && var2 < 39 && !this.mergeItemStack(var5, 0, 2, false)) { -+ } else if (par2 != 0 && par2 != 1) { -+ if (par2 >= 3 && par2 < 39 && !this.mergeItemStack(var5, 0, 2, false)) { - return null; - } -- } else if(!this.mergeItemStack(var5, 3, 39, false)) { -+ } else if (!this.mergeItemStack(var5, 3, 39, false)) { - return null; - } - -- if(var5.stackSize == 0) { -+ if (var5.stackSize == 0) { - var4.putStack((ItemStack)null); - } else { - var4.onSlotChanged(); - } - -- if(var5.stackSize == var3.stackSize) { -+ if (var5.stackSize == var3.stackSize) { - return null; - } - -- var4.onPickupFromSlot(var1, var5); -+ var4.onPickupFromSlot(par1EntityPlayer, var5); - } - - return var3; - } - -- public void updateItemName(String var1) { -- this.m = var1; -- if(this.getSlot(2).getHasStack()) { -+ /** -+ * used by the Anvil GUI to update the Item Name being typed by the player -+ */ -+ public void updateItemName(String par1Str) { -+ this.repairedItemName = par1Str; -+ -+ if (this.getSlot(2).getHasStack()) { - ItemStack var2 = this.getSlot(2).getStack(); -- if(org.apache.commons.lang3.StringUtils.isBlank(var1)) { -+ -+ if (org.apache.commons.lang3.StringUtils.isBlank(par1Str)) { - var2.func_135074_t(); - } else { -- var2.setItemName(this.m); -+ var2.setItemName(this.repairedItemName); - } - } - - this.updateRepairOutput(); - } - -- static IInventory getRepairInputInventory(ContainerRepair var0) { -- return var0.inputSlots; -+ static IInventory getRepairInputInventory(ContainerRepair par0ContainerRepair) { -+ return par0ContainerRepair.inputSlots; - } - -- static int getStackSizeUsedInRepair(ContainerRepair var0) { -- return var0.stackSizeToBeUsedInRepair; -+ static int getStackSizeUsedInRepair(ContainerRepair par0ContainerRepair) { -+ return par0ContainerRepair.stackSizeToBeUsedInRepair; - } - } ---- /dev/null -+++ org/spoutcraft/client/gui/controls/GuiEditShortcut.java -@@ -1,0 +1,256 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.client.gui.controls; -+ -+import net.minecraft.src.GuiScreen; -+ -+import org.spoutcraft.api.gui.Button; -+import org.spoutcraft.api.gui.Color; -+import org.spoutcraft.api.gui.GenericButton; -+import org.spoutcraft.api.gui.GenericLabel; -+import org.spoutcraft.api.gui.GenericTextField; -+import org.spoutcraft.api.gui.GenericTextProcessor; -+import org.spoutcraft.api.gui.Label; -+import org.spoutcraft.api.gui.TextField; -+import org.spoutcraft.client.SpoutClient; -+import org.spoutcraft.client.controls.Shortcut; -+import org.spoutcraft.client.controls.SimpleKeyBindingManager; -+ -+public class GuiEditShortcut extends GuiScreen { -+ GuiControls parent; -+ Shortcut item; -+ Button recordButton, doneButton, addButton, editButton, removeButton; -+ Label titleLabel, recordLabel, commandLabel, typeNameHereLabel, typeCommandHereLabel, delayLabel; -+ TextField commandName, commandText, delayText; -+ GuiCommandsSlot slot; -+ int editingIndex = -1; -+ Color grey = new Color(0xC0C0C0); -+ -+ boolean recording = false; -+ public GuiEditShortcut(GuiControls guiControls, Shortcut item) { -+ this.parent = guiControls; -+ this.item = item; -+ } -+ -+ private static Color white = new Color(1f, 1f, 1f, 1f), red = new Color(1f, 0f, 0f, 1f); -+ -+ @Override -+ public void updateScreen() { -+ addButton.setEnabled(commandName.getText().length() != 0 && commandText.getText().length() != 0); -+ titleLabel.setTextColor(commandName.getText().length() == 0 ? red:white); -+ delayLabel.setTextColor(delayText.getText().length() == 0 ? red:white); -+ recordButton.setTextColor(item.getKey() <= 0 ? red:white); -+ commandLabel.setTextColor(item.getCommands().size() == 0 ? red:white); -+ super.updateScreen(); -+ } -+ -+ public void drawScreen(int var1, int var2, float var3) { -+ drawDefaultBackground(); -+ super.drawScreen(var1, var2, var3); -+ } -+ -+ protected void keyTyped(char c, int i) { -+ if (recording && !SimpleKeyBindingManager.isModifierKey(i)) { -+ item.setRawModifiers(SimpleKeyBindingManager.getPressedModifiers()); -+ item.setKey(i); -+ recording = false; -+ updateRecordButton(); -+ } else { -+ super.keyTyped(c, i); -+ } -+ } -+ -+ public void initGui() { -+ int labelWidth = 75; -+ int top = 10; -+ int left = 10; -+ int right = left + labelWidth + 10; -+ int labelHeight = 20; -+ -+ recordButton = new GenericButton(); -+ recordButton.setGeometry(width - 160, top - 3, 150, labelHeight); -+ getScreen().attachWidget("Spoutcraft", recordButton); -+ updateRecordButton(); -+ -+ titleLabel = new GenericLabel("Name:"); -+ titleLabel.setGeometry(left, top + 3, labelWidth, labelHeight); -+ getScreen().attachWidget("Spoutcraft", titleLabel); -+ -+ commandName = new GenericTextField(); -+ commandName.setGeometry(right, top - 1, (int) (width - right - recordButton.getWidth() - 20), 16); -+ commandName.setText(item.getTitle()); -+ commandName.setMaximumCharacters(0); -+ commandName.setPlaceholder("Enter a name here"); -+ getScreen().attachWidget("Spoutcraft", commandName); -+ -+ top += 23; -+ -+ commandLabel = new GenericLabel("Command:"); -+ commandLabel.setGeometry(left, top + 3, labelWidth, labelHeight); -+ getScreen().attachWidget("Spoutcraft", commandLabel); -+ -+ commandText = new GenericTextField(); -+ commandText.setGeometry(right, top - 1, width - right - 10, 16); -+ commandText.setMaximumCharacters(0); -+ commandText.setPlaceholder("Enter new command here, then click \"Add Command\""); -+ getScreen().attachWidget("Spoutcraft", commandText); -+ -+ top += 23; -+ -+ delayLabel = new GenericLabel("Delay (ms)"); -+ delayLabel.setGeometry(left, top + 3, labelWidth, labelHeight); -+ getScreen().attachWidget("Spoutcraft", delayLabel); -+ -+ delayText = new GenericTextField(); -+ delayText.setGeometry(right, top - 1, width - right - 10, 16); -+ delayText.setText(item.getDelay() + ""); -+ delayText.setTextProcessor(new GenericTextProcessor() { -+ protected boolean insert(char c) { -+ if (c >= '0' && c <= '9') { -+ return super.insert(c); -+ } -+ return false; -+ }; -+ -+ @Override -+ protected boolean insert(String s) { -+ for (int i = 0; i < s.length(); i++) { -+ char c = s.charAt(i); -+ if (!(c >= '0' && c <= '9')) { -+ return false; -+ } -+ } -+ return super.insert(s); -+ } -+ }); -+ getScreen().attachWidget("Spoutcraft", delayText); -+ -+ top += 23; -+ -+ slot = new GuiCommandsSlot(this); -+ slot.setGeometry(0, top, width, this.height - top - 30); -+ getScreen().attachWidget("Spoutcraft", slot); -+ -+ doneButton = new GenericButton("Done"); -+ doneButton.setHeight(20).setWidth(50); -+ doneButton.setX(10).setY(height - 25); -+ getScreen().attachWidget("Spoutcraft", doneButton); -+ -+ addButton = new GenericButton("Add Command"); -+ addButton.setHeight(20).setWidth(100); -+ addButton.setX(70).setY(height - 25); -+ getScreen().attachWidget("Spoutcraft", addButton); -+ -+ editButton = new GenericButton("Edit Command"); -+ editButton.setHeight(20).setWidth(100); -+ editButton.setX(180).setY(height - 25); -+ getScreen().attachWidget("Spoutcraft", editButton); -+ -+ removeButton = new GenericButton("Remove Command"); -+ removeButton.setHeight(20).setWidth(100); -+ removeButton.setX(290).setY(height - 25); -+ getScreen().attachWidget("Spoutcraft", removeButton); -+ -+ updateButtons(); -+ -+ commandName.setFocus(true); -+ } -+ -+ private void updateRecordButton() { -+ String keyname = recording ? "Press a key!" : "Click Here!"; -+ if ((item.getKey()>=0 || item.getKey()<-1 )&& !recording) { -+ keyname = "Key: " + item.toString(); -+ } -+ String name = (recording ? "> " : "") + keyname + (recording ? " <" : ""); -+ recordButton.setText(name); -+ } -+ -+ @Override -+ protected void buttonClicked(Button btn) { -+ if (btn.equals(recordButton)) { -+ recording = !recording; -+ updateRecordButton(); -+ } -+ if (btn.equals(doneButton)) { -+ item.setTitle(commandName.getText()); -+ item.setDelay(Integer.parseInt(delayText.getText())); -+ if (!item.getTitle().equals("") && item.getKey() != -1) { -+ SimpleKeyBindingManager manager = (SimpleKeyBindingManager) SpoutClient.getInstance().getKeyBindingManager(); -+ manager.unregisterShortcut(item); -+ manager.registerShortcut(item); -+ } -+ mc.displayGuiScreen(parent); -+ parent.getModel().refresh(); -+ } -+ if (btn.equals(addButton)) { -+ if (editingIndex != -1) { -+ addButton.setText("Add Command"); -+ item.setTitle(commandName.getText()); -+ item.getCommands().set(editingIndex, commandText.getText()); -+ editingIndex = -1; -+ } else { -+ item.addCommand(commandText.getText()); -+ } -+ -+ commandText.setText(""); -+ slot.updateItems(); -+ updateButtons(); -+ } -+ if (btn.equals(editButton)) { -+ editCommand(slot.getSelectedRow()); -+ updateButtons(); -+ } -+ if (btn.equals(removeButton)) { -+ item.removeCommand(slot.getSelectedRow()); -+ slot.updateItems(); -+ updateButtons(); -+ } -+ } -+ -+ public void editCommand(int index) { -+ if (index != -1) { -+ editingIndex = index; -+ commandText.setText(item.getCommands().get(index)); -+ addButton.setText("Finish Editing"); -+ } -+ } -+ -+ public void updateButtons() { -+ editButton.setEnabled(slot.getSelectedRow() != -1); -+ removeButton.setEnabled(slot.getSelectedRow() != -1 && editingIndex == -1); -+ } -+ -+ public Shortcut getShortcut() { -+ return item; -+ } -+ -+ @Override -+ protected void mouseClicked(int x, int y, int button) { -+ if (recording) { -+ System.out.println("Set mouse button to shortcut " + button); -+ item.setRawModifiers(SimpleKeyBindingManager.getPressedModifiers()); -+ item.setKey(button + SimpleKeyBindingManager.MOUSE_OFFSET); -+ recording = false; -+ updateRecordButton(); -+ } else { -+ super.mouseClicked(x, y, button); -+ } -+ } -+} ---- /dev/null -+++ org/spoutcraft/api/animation/AnimationProgress.java -@@ -1,0 +1,24 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.api.animation; -+ -+public interface AnimationProgress { -+ public double getValueAt(double progress); -+} ---- net/minecraft/src/Packet62LevelSound.java -+++ net/minecraft/src/Packet62LevelSound.java -@@ -5,53 +5,70 @@ - import java.io.IOException; - - public class Packet62LevelSound extends Packet { -- private String a; -+ -+ /** e.g. step.grass */ -+ private String soundName; -+ -+ /** Effect X multiplied by 8 */ - private int effectX; -+ -+ /** Effect Y multiplied by 8 */ - private int effectY = Integer.MAX_VALUE; -+ -+ /** Effect Z multiplied by 8 */ - private int effectZ; -+ -+ /** 1 is 100%. Can be more. */ - private float volume; -+ -+ /** 63 is 100%. Can be more. */ - private int pitch; - -- public Packet62LevelSound() { -- } -- -- public Packet62LevelSound(String var1, double var2, double var4, double var6, float var8, float var9) { -- this.a = var1; -- this.effectX = (int)(var2 * 8.0D); -- this.effectY = (int)(var4 * 8.0D); -- this.effectZ = (int)(var6 * 8.0D); -- this.volume = var8; -- this.pitch = (int)(var9 * 63.0F); -- if(this.pitch < 0) { -+ public Packet62LevelSound() {} -+ -+ public Packet62LevelSound(String par1Str, double par2, double par4, double par6, float par8, float par9) { -+ this.soundName = par1Str; -+ this.effectX = (int)(par2 * 8.0D); -+ this.effectY = (int)(par4 * 8.0D); -+ this.effectZ = (int)(par6 * 8.0D); -+ this.volume = par8; -+ this.pitch = (int)(par9 * 63.0F); -+ -+ if (this.pitch < 0) { - this.pitch = 0; - } - -- if(this.pitch > 255) { -+ if (this.pitch > 255) { - this.pitch = 255; - } -- -- } -- -- public void readPacketData(DataInput var1) throws IOException { -- this.a = readString(var1, 256); -- this.effectX = var1.readInt(); -- this.effectY = var1.readInt(); -- this.effectZ = var1.readInt(); -- this.volume = var1.readFloat(); -- this.pitch = var1.readUnsignedByte(); -- } -- -- public void writePacketData(DataOutput var1) throws IOException { -- writeString(this.a, var1); -- var1.writeInt(this.effectX); -- var1.writeInt(this.effectY); -- var1.writeInt(this.effectZ); -- var1.writeFloat(this.volume); -- var1.writeByte(this.pitch); -+ } -+ -+ /** -+ * Abstract. Reads the raw packet data from the data stream. -+ */ -+ public void readPacketData(DataInput par1DataInput) throws IOException { -+ this.soundName = readString(par1DataInput, 256); -+ this.effectX = par1DataInput.readInt(); -+ this.effectY = par1DataInput.readInt(); -+ this.effectZ = par1DataInput.readInt(); -+ this.volume = par1DataInput.readFloat(); -+ this.pitch = par1DataInput.readUnsignedByte(); -+ } -+ -+ /** -+ * Abstract. Writes the raw packet data to the data stream. -+ */ -+ public void writePacketData(DataOutput par1DataOutput) throws IOException { -+ writeString(this.soundName, par1DataOutput); -+ par1DataOutput.writeInt(this.effectX); -+ par1DataOutput.writeInt(this.effectY); -+ par1DataOutput.writeInt(this.effectZ); -+ par1DataOutput.writeFloat(this.volume); -+ par1DataOutput.writeByte(this.pitch); - } - - public String getSoundName() { -- return this.a; -+ return this.soundName; - } - - public double getEffectX() { -@@ -70,14 +87,23 @@ - return this.volume; - } - -+ /** -+ * Gets the pitch divided by 63 (63 is 100%) -+ */ - public float getPitch() { - return (float)this.pitch / 63.0F; - } - -- public void processPacket(NetHandler var1) { -- var1.handleLevelSound(this); -+ /** -+ * Passes this Packet on to the NetHandler for processing. -+ */ -+ public void processPacket(NetHandler par1NetHandler) { -+ par1NetHandler.handleLevelSound(this); - } - -+ /** -+ * Abstract. Return the size of the packet (not counting the header). -+ */ - public int getPacketSize() { - return 24; - } ---- net/minecraft/src/GuiEnchantment.java -+++ net/minecraft/src/GuiEnchantment.java -@@ -8,9 +8,13 @@ - public class GuiEnchantment extends GuiContainer { - private static final ResourceLocation enchantingTableGuiTextures = new ResourceLocation("textures/gui/container/enchanting_table.png"); - private static final ResourceLocation enchantingTableBookTextures = new ResourceLocation("textures/entity/enchanting_table_book.png"); -+ -+ /** The book model used on the GUI. */ - private static final ModelBook bookModel = new ModelBook(); -- private Random E = new Random(); -- private ContainerEnchantment containerEnchantment = (ContainerEnchantment)this.inventorySlots; -+ private Random rand = new Random(); -+ -+ /** ContainerEnchantment object associated with this gui */ -+ private ContainerEnchantment containerEnchantment; - public int field_74214_o; - public float field_74213_p; - public float field_74212_q; -@@ -19,39 +23,52 @@ - public float field_74209_t; - public float field_74208_u; - ItemStack theItemStack; -- private String G; -+ private String field_94079_C; - -- public GuiEnchantment(InventoryPlayer var1, World var2, int var3, int var4, int var5, String var6) { -- super(new ContainerEnchantment(var1, var2, var3, var4, var5)); -- this.G = var6; -+ public GuiEnchantment(InventoryPlayer par1InventoryPlayer, World par2World, int par3, int par4, int par5, String par6Str) { -+ super(new ContainerEnchantment(par1InventoryPlayer, par2World, par3, par4, par5)); -+ this.containerEnchantment = (ContainerEnchantment)this.inventorySlots; -+ this.field_94079_C = par6Str; - } - -- protected void drawGuiContainerForegroundLayer(int var1, int var2) { -- this.fontRenderer.drawString(this.G == null ? I18n.getString("container.enchant") : this.G, 12, 5, 4210752); -+ /** -+ * Draw the foreground layer for the GuiContainer (everything in front of the items) -+ */ -+ protected void drawGuiContainerForegroundLayer(int par1, int par2) { -+ this.fontRenderer.drawString(this.field_94079_C == null ? I18n.getString("container.enchant") : this.field_94079_C, 12, 5, 4210752); - this.fontRenderer.drawString(I18n.getString("container.inventory"), 8, this.ySize - 96 + 2, 4210752); - } - -+ /** -+ * Called from the main game loop to update the screen. -+ */ - public void updateScreen() { - super.updateScreen(); - this.func_74205_h(); - } - -- protected void mouseClicked(int var1, int var2, int var3) { -- super.mouseClicked(var1, var2, var3); -+ /** -+ * Called when the mouse is clicked. -+ */ -+ protected void mouseClicked(int par1, int par2, int par3) { -+ super.mouseClicked(par1, par2, par3); - int var4 = (this.width - this.xSize) / 2; - int var5 = (this.height - this.ySize) / 2; - -- for(int var6 = 0; var6 < 3; ++var6) { -- int var7 = var1 - (var4 + 60); -- int var8 = var2 - (var5 + 14 + 19 * var6); -- if(var7 >= 0 && var8 >= 0 && var7 < 108 && var8 < 19 && this.containerEnchantment.enchantItem(this.mc.thePlayer, var6)) { -+ for (int var6 = 0; var6 < 3; ++var6) { -+ int var7 = par1 - (var4 + 60); -+ int var8 = par2 - (var5 + 14 + 19 * var6); -+ -+ if (var7 >= 0 && var8 >= 0 && var7 < 108 && var8 < 19 && this.containerEnchantment.enchantItem(this.mc.thePlayer, var6)) { - this.mc.playerController.sendEnchantPacket(this.containerEnchantment.windowId, var6); - } - } -- - } - -- protected void drawGuiContainerBackgroundLayer(float var1, int var2, int var3) { -+ /** -+ * Draw the background layer for the GuiContainer (everything behind the items) -+ */ -+ protected void drawGuiContainerBackgroundLayer(float par1, int par2, int par3) { - GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - this.mc.getTextureManager().bindTexture(enchantingTableGuiTextures); - int var4 = (this.width - this.xSize) / 2; -@@ -64,7 +81,7 @@ - ScaledResolution var6 = new ScaledResolution(this.mc.gameSettings, this.mc.displayWidth, this.mc.displayHeight); - GL11.glViewport((var6.getScaledWidth() - 320) / 2 * var6.getScaleFactor(), (var6.getScaledHeight() - 240) / 2 * var6.getScaleFactor(), 320 * var6.getScaleFactor(), 240 * var6.getScaleFactor()); - GL11.glTranslatef(-0.34F, 0.23F, 0.0F); -- Project.gluPerspective(90.0F, 4.0F / 3.0F, 9.0F, 80.0F); -+ Project.gluPerspective(90.0F, 1.3333334F, 9.0F, 80.0F); - float var7 = 1.0F; - GL11.glMatrixMode(GL11.GL_MODELVIEW); - GL11.glLoadIdentity(); -@@ -76,32 +93,33 @@ - GL11.glRotatef(180.0F, 0.0F, 0.0F, 1.0F); - this.mc.getTextureManager().bindTexture(enchantingTableBookTextures); - GL11.glRotatef(20.0F, 1.0F, 0.0F, 0.0F); -- float var9 = this.field_74208_u + (this.field_74209_t - this.field_74208_u) * var1; -+ float var9 = this.field_74208_u + (this.field_74209_t - this.field_74208_u) * par1; - GL11.glTranslatef((1.0F - var9) * 0.2F, (1.0F - var9) * 0.1F, (1.0F - var9) * 0.25F); - GL11.glRotatef(-(1.0F - var9) * 90.0F - 90.0F, 0.0F, 1.0F, 0.0F); - GL11.glRotatef(180.0F, 1.0F, 0.0F, 0.0F); -- float var10 = this.field_74212_q + (this.field_74213_p - this.field_74212_q) * var1 + 0.25F; -- float var11 = this.field_74212_q + (this.field_74213_p - this.field_74212_q) * var1 + 12.0F / 16.0F; -+ float var10 = this.field_74212_q + (this.field_74213_p - this.field_74212_q) * par1 + 0.25F; -+ float var11 = this.field_74212_q + (this.field_74213_p - this.field_74212_q) * par1 + 0.75F; - var10 = (var10 - (float)MathHelper.truncateDoubleToInt((double)var10)) * 1.6F - 0.3F; - var11 = (var11 - (float)MathHelper.truncateDoubleToInt((double)var11)) * 1.6F - 0.3F; -- if(var10 < 0.0F) { -+ -+ if (var10 < 0.0F) { - var10 = 0.0F; - } - -- if(var11 < 0.0F) { -+ if (var11 < 0.0F) { - var11 = 0.0F; - } - -- if(var10 > 1.0F) { -+ if (var10 > 1.0F) { - var10 = 1.0F; - } - -- if(var11 > 1.0F) { -+ if (var11 > 1.0F) { - var11 = 1.0F; - } - - GL11.glEnable(GL12.GL_RESCALE_NORMAL); -- bookModel.render((Entity)null, 0.0F, var10, var11, var9, 0.0F, 1.0F / 16.0F); -+ bookModel.render((Entity)null, 0.0F, var10, var11, var9, 0.0F, 0.0625F); - GL11.glDisable(GL12.GL_RESCALE_NORMAL); - RenderHelper.disableStandardItemLighting(); - GL11.glMatrixMode(GL11.GL_PROJECTION); -@@ -113,28 +131,31 @@ - GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - EnchantmentNameParts.instance.setRandSeed(this.containerEnchantment.nameSeed); - -- for(int var12 = 0; var12 < 3; ++var12) { -+ for (int var12 = 0; var12 < 3; ++var12) { - String var13 = EnchantmentNameParts.instance.generateRandomEnchantName(); - this.zLevel = 0.0F; - this.mc.getTextureManager().bindTexture(enchantingTableGuiTextures); - int var14 = this.containerEnchantment.enchantLevels[var12]; - GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); -- if(var14 == 0) { -+ -+ if (var14 == 0) { - this.drawTexturedModalRect(var4 + 60, var5 + 14 + 19 * var12, 0, 185, 108, 19); - } else { - String var15 = "" + var14; - FontRenderer var16 = this.mc.standardGalacticFontRenderer; - int var17 = 6839882; -- if(this.mc.thePlayer.experienceLevel < var14 && !this.mc.thePlayer.capabilities.isCreativeMode) { -+ -+ if (this.mc.thePlayer.experienceLevel < var14 && !this.mc.thePlayer.capabilities.isCreativeMode) { - this.drawTexturedModalRect(var4 + 60, var5 + 14 + 19 * var12, 0, 185, 108, 19); - var16.drawSplitString(var13, var4 + 62, var5 + 16 + 19 * var12, 104, (var17 & 16711422) >> 1); - var16 = this.mc.fontRenderer; - var17 = 4226832; - var16.drawStringWithShadow(var15, var4 + 62 + 104 - var16.getStringWidth(var15), var5 + 16 + 19 * var12 + 7, var17); - } else { -- int var18 = var2 - (var4 + 60); -- int var19 = var3 - (var5 + 14 + 19 * var12); -- if(var18 >= 0 && var19 >= 0 && var18 < 108 && var19 < 19) { -+ int var18 = par2 - (var4 + 60); -+ int var19 = par3 - (var5 + 14 + 19 * var12); -+ -+ if (var18 >= 0 && var19 >= 0 && var18 < 108 && var19 < 19) { - this.drawTexturedModalRect(var4 + 60, var5 + 14 + 19 * var12, 0, 204, 108, 19); - var17 = 16777088; - } else { -@@ -148,17 +169,17 @@ - } - } - } -- - } - - public void func_74205_h() { - ItemStack var1 = this.inventorySlots.getSlot(0).getStack(); -- if(!ItemStack.areItemStacksEqual(var1, this.theItemStack)) { -+ -+ if (!ItemStack.areItemStacksEqual(var1, this.theItemStack)) { - this.theItemStack = var1; - - do { -- this.field_74211_r += (float)(this.E.nextInt(4) - this.E.nextInt(4)); -- } while(this.field_74213_p <= this.field_74211_r + 1.0F && this.field_74213_p >= this.field_74211_r - 1.0F); -+ this.field_74211_r += (float)(this.rand.nextInt(4) - this.rand.nextInt(4)); -+ } while (this.field_74213_p <= this.field_74211_r + 1.0F && this.field_74213_p >= this.field_74211_r - 1.0F); - } - - ++this.field_74214_o; -@@ -166,33 +187,34 @@ - this.field_74208_u = this.field_74209_t; - boolean var2 = false; - -- for(int var3 = 0; var3 < 3; ++var3) { -- if(this.containerEnchantment.enchantLevels[var3] != 0) { -+ for (int var3 = 0; var3 < 3; ++var3) { -+ if (this.containerEnchantment.enchantLevels[var3] != 0) { - var2 = true; - } - } - -- if(var2) { -+ if (var2) { - this.field_74209_t += 0.2F; - } else { - this.field_74209_t -= 0.2F; - } - -- if(this.field_74209_t < 0.0F) { -+ if (this.field_74209_t < 0.0F) { - this.field_74209_t = 0.0F; - } - -- if(this.field_74209_t > 1.0F) { -+ if (this.field_74209_t > 1.0F) { - this.field_74209_t = 1.0F; - } - - float var5 = (this.field_74211_r - this.field_74213_p) * 0.4F; - float var4 = 0.2F; -- if(var5 < -var4) { -+ -+ if (var5 < -var4) { - var5 = -var4; - } - -- if(var5 > var4) { -+ if (var5 > var4) { - var5 = var4; - } - ---- /dev/null -+++ org/spoutcraft/client/gui/FilterModel.java -@@ -1,0 +1,73 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.client.gui; -+ -+import java.util.ArrayList; -+ -+import org.spoutcraft.api.gui.AbstractListModel; -+import org.spoutcraft.api.gui.ListWidgetItem; -+ -+public abstract class FilterModel extends AbstractListModel { -+ protected ArrayList filteredItems = new ArrayList(); -+ protected ArrayList items = new ArrayList(); -+ private ArrayList filters = new ArrayList(); -+ -+ public ArrayList getFilters() { -+ return filters; -+ } -+ -+ public void refresh() { -+ items.clear(); -+ -+ refreshContents(); -+ -+ filteredItems.clear(); -+ -+ for (ListWidgetItem item:items) { -+ boolean matches = true; -+ for (FilterItem filter:filters) { -+ matches = filter.matches(item); -+ if (!matches) { -+ break; -+ } -+ } -+ if (matches) { -+ filteredItems.add(item); -+ } -+ } -+ -+ sizeChanged(); -+ } -+ -+ protected abstract void refreshContents(); -+ -+ @Override -+ public ListWidgetItem getItem(int row) { -+ if (row >= 0 && row < filteredItems.size()) { -+ return filteredItems.get(row); -+ } -+ return null; -+ } -+ -+ @Override -+ public int getSize() { -+ return filteredItems.size(); -+ } -+} ---- /dev/null -+++ org/spoutcraft/api/material/block/Grass.java -@@ -1,0 +1,40 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.api.material.block; -+ -+import org.spoutcraft.api.material.Plant; -+ -+public class Grass extends GenericBlock implements Plant{ -+ public Grass(String name) { -+ super(name, 2); -+ } -+ -+ public boolean isHasGrowthStages() { -+ return false; -+ } -+ -+ public int getNumGrowthStages() { -+ return 0; -+ } -+ -+ public int getMinimumLightToGrow() { -+ return 9; -+ } -+} ---- net/minecraft/src/BiomeGenRiver.java -+++ net/minecraft/src/BiomeGenRiver.java -@@ -1,8 +1,8 @@ - package net.minecraft.src; - - public class BiomeGenRiver extends BiomeGenBase { -- public BiomeGenRiver(int var1) { -- super(var1); -- this.K.clear(); -+ public BiomeGenRiver(int par1) { -+ super(par1); -+ this.spawnableCreatureList.clear(); - } - } ---- net/minecraft/src/TaskLongRunning.java -+++ net/minecraft/src/TaskLongRunning.java -@@ -1,18 +1,23 @@ - package net.minecraft.src; - - public abstract class TaskLongRunning implements Runnable { -+ -+ /** The GUI screen showing progress of this task. */ - protected GuiScreenLongRunningTask taskGUI; - -- public void setGUI(GuiScreenLongRunningTask var1) { -- this.taskGUI = var1; -- } -- -- public void setFailedMessage(String var1) { -- this.taskGUI.setFailedMessage(var1); -- } -- -- public void setMessage(String var1) { -- this.taskGUI.setMessage(var1); -+ public void setGUI(GuiScreenLongRunningTask par1GuiScreenLongRunningTask) { -+ this.taskGUI = par1GuiScreenLongRunningTask; -+ } -+ -+ /** -+ * Displays the given message in place of the progress bar, and adds a "Back" button. -+ */ -+ public void setFailedMessage(String par1Str) { -+ this.taskGUI.setFailedMessage(par1Str); -+ } -+ -+ public void setMessage(String par1Str) { -+ this.taskGUI.setMessage(par1Str); - } - - public Minecraft getMinecraft() { -@@ -23,12 +28,9 @@ - return this.taskGUI.wasScreenClosed(); - } - -- public void updateScreen() { -- } -- -- public void buttonClicked(GuiButton var1) { -- } -- -- public void initGUI() { -- } -+ public void updateScreen() {} -+ -+ public void buttonClicked(GuiButton par1GuiButton) {} -+ -+ public void initGUI() {} - } ---- net/minecraft/src/CallableTagCompound2.java -+++ net/minecraft/src/CallableTagCompound2.java -@@ -4,15 +4,16 @@ - - class CallableTagCompound2 implements Callable { - final int field_82588_a; -+ - final NBTTagCompound theNBTTagCompound; - -- CallableTagCompound2(NBTTagCompound var1, int var2) { -- this.theNBTTagCompound = var1; -- this.field_82588_a = var2; -+ CallableTagCompound2(NBTTagCompound par1NBTTagCompound, int par2) { -+ this.theNBTTagCompound = par1NBTTagCompound; -+ this.field_82588_a = par2; - } - - public String func_82586_a() { -- return NBTBase.b[this.field_82588_a]; -+ return NBTBase.NBTTypes[this.field_82588_a]; - } - - public Object call() { ---- /dev/null -+++ org/spoutcraft/client/gui/settings/controls/ManualSelectionButton.java -@@ -1,0 +1,50 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.client.gui.settings.controls; -+ -+import net.minecraft.src.GuiScreen; -+ -+import org.spoutcraft.api.gui.Color; -+import org.spoutcraft.api.gui.GenericRadioButton; -+import org.spoutcraft.api.gui.Label; -+import org.spoutcraft.client.SpoutClient; -+import org.spoutcraft.client.config.Configuration; -+import org.spoutcraft.client.gui.settings.GuiSimpleOptions; -+ -+public class ManualSelectionButton extends GenericRadioButton { -+ Label label; -+ GuiScreen parent; -+ public ManualSelectionButton(String title, Label label, GuiScreen parent) { -+ super(title); -+ this.label = label; -+ this.parent = parent; -+ } -+ -+ @Override -+ public void onButtonClick() { -+ Configuration.setAutomatePerformance(false); -+ if (!Configuration.isAdvancedOptions()) { -+ Configuration.setAdvancedOptions(true); -+ SpoutClient.getHandle().displayGuiScreen(GuiSimpleOptions.constructOptionsScreen(parent)); -+ } -+ Configuration.write(); -+ label.setTextColor(new Color(0.45F, 0.45F, 0.45F, 0.45F)); -+ } -+} ---- net/minecraft/src/TileEntityMobSpawnerLogic.java -+++ net/minecraft/src/TileEntityMobSpawnerLogic.java -@@ -1,14 +1,16 @@ - package net.minecraft.src; - - class TileEntityMobSpawnerLogic extends MobSpawnerBaseLogic { -+ -+ /** The mob spawner we deal with */ - final TileEntityMobSpawner mobSpawnerEntity; - -- TileEntityMobSpawnerLogic(TileEntityMobSpawner var1) { -- this.mobSpawnerEntity = var1; -+ TileEntityMobSpawnerLogic(TileEntityMobSpawner par1TileEntityMobSpawner) { -+ this.mobSpawnerEntity = par1TileEntityMobSpawner; - } - -- public void func_98267_a(int var1) { -- this.mobSpawnerEntity.worldObj.addBlockEvent(this.mobSpawnerEntity.xCoord, this.mobSpawnerEntity.yCoord, this.mobSpawnerEntity.zCoord, Block.mobSpawner.blockID, var1, 0); -+ public void func_98267_a(int par1) { -+ this.mobSpawnerEntity.worldObj.addBlockEvent(this.mobSpawnerEntity.xCoord, this.mobSpawnerEntity.yCoord, this.mobSpawnerEntity.zCoord, Block.mobSpawner.blockID, par1, 0); - } - - public World getSpawnerWorld() { -@@ -27,11 +29,11 @@ - return this.mobSpawnerEntity.zCoord; - } - -- public void setRandomMinecart(WeightedRandomMinecart var1) { -- super.setRandomMinecart(var1); -- if(this.getSpawnerWorld() != null) { -+ public void setRandomMinecart(WeightedRandomMinecart par1WeightedRandomMinecart) { -+ super.setRandomMinecart(par1WeightedRandomMinecart); -+ -+ if (this.getSpawnerWorld() != null) { - this.getSpawnerWorld().markBlockForUpdate(this.mobSpawnerEntity.xCoord, this.mobSpawnerEntity.yCoord, this.mobSpawnerEntity.zCoord); - } -- - } - } ---- net/minecraft/src/EntityExplodeFX.java -+++ net/minecraft/src/EntityExplodeFX.java -@@ -1,34 +1,38 @@ - package net.minecraft.src; - - public class EntityExplodeFX extends EntityFX { -- public EntityExplodeFX(World var1, double var2, double var4, double var6, double var8, double var10, double var12) { -- super(var1, var2, var4, var6, var8, var10, var12); -- this.motionX = var8 + (double)((float)(Math.random() * 2.0D - 1.0D) * 0.05F); -- this.motionY = var10 + (double)((float)(Math.random() * 2.0D - 1.0D) * 0.05F); -- this.motionZ = var12 + (double)((float)(Math.random() * 2.0D - 1.0D) * 0.05F); -- this.particleRed = this.particleGreen = this.particleBlue = this.ab.nextFloat() * 0.3F + 0.7F; -- this.particleScale = this.ab.nextFloat() * this.ab.nextFloat() * 6.0F + 1.0F; -- this.particleMaxAge = (int)(16.0D / ((double)this.ab.nextFloat() * 0.8D + 0.2D)) + 2; -+ public EntityExplodeFX(World par1World, double par2, double par4, double par6, double par8, double par10, double par12) { -+ super(par1World, par2, par4, par6, par8, par10, par12); -+ this.motionX = par8 + (double)((float)(Math.random() * 2.0D - 1.0D) * 0.05F); -+ this.motionY = par10 + (double)((float)(Math.random() * 2.0D - 1.0D) * 0.05F); -+ this.motionZ = par12 + (double)((float)(Math.random() * 2.0D - 1.0D) * 0.05F); -+ this.particleRed = this.particleGreen = this.particleBlue = this.rand.nextFloat() * 0.3F + 0.7F; -+ this.particleScale = this.rand.nextFloat() * this.rand.nextFloat() * 6.0F + 1.0F; -+ this.particleMaxAge = (int)(16.0D / ((double)this.rand.nextFloat() * 0.8D + 0.2D)) + 2; - } - -+ /** -+ * Called to update the entity's position/logic. -+ */ - public void onUpdate() { - this.prevPosX = this.posX; - this.prevPosY = this.posY; - this.prevPosZ = this.posZ; -- if(this.particleAge++ >= this.particleMaxAge) { -+ -+ if (this.particleAge++ >= this.particleMaxAge) { - this.setDead(); - } - - this.setParticleTextureIndex(7 - this.particleAge * 8 / this.particleMaxAge); - this.motionY += 0.004D; - this.moveEntity(this.motionX, this.motionY, this.motionZ); -- this.motionX *= (double)0.9F; -- this.motionY *= (double)0.9F; -- this.motionZ *= (double)0.9F; -- if(this.onGround) { -- this.motionX *= (double)0.7F; -- this.motionZ *= (double)0.7F; -- } -+ this.motionX *= 0.8999999761581421D; -+ this.motionY *= 0.8999999761581421D; -+ this.motionZ *= 0.8999999761581421D; - -+ if (this.onGround) { -+ this.motionX *= 0.699999988079071D; -+ this.motionZ *= 0.699999988079071D; -+ } - } - } ---- net/minecraft/src/AnvilConverterException.java -+++ net/minecraft/src/AnvilConverterException.java -@@ -1,7 +1,7 @@ - package net.minecraft.src; - - public class AnvilConverterException extends Exception { -- public AnvilConverterException(String var1) { -- super(var1); -+ public AnvilConverterException(String par1Str) { -+ super(par1Str); - } - } ---- /dev/null -+++ org/spoutcraft/client/gui/server/FavoritesModel.java -@@ -1,0 +1,240 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.client.gui.server; -+ -+import java.io.BufferedReader; -+import java.io.File; -+import java.io.FileNotFoundException; -+import java.io.FileReader; -+import java.io.FileWriter; -+import java.io.IOException; -+import java.util.ArrayList; -+import java.util.HashMap; -+ -+import org.yaml.snakeyaml.Yaml; -+ -+import org.spoutcraft.client.SpoutClient; -+import org.spoutcraft.client.io.FileUtil; -+ -+public class FavoritesModel extends ServerModel { -+ public FavoritesModel() { -+ } -+ -+ public void load() { -+ try { -+ if (!getFile().exists()) { -+ importVanilla(); -+ importLegacyTXT(); -+ save(); -+ } else { -+ Yaml yaml = new Yaml(); -+ -+ try { -+ ArrayList> list = (ArrayList>) yaml.load(new FileReader(getFile())); -+ for (HashMap item : list) { -+ String title = ""; -+ String ip = ""; -+ String country = ""; -+ int port = ServerItem.DEFAULT_PORT; -+ int databaseId = -1; -+ Boolean acceptsTextures = null; -+ if (item.containsKey("title")) { -+ title = (String) item.get("title"); -+ } -+ if (item.containsKey("ip")) { -+ ip = (String) item.get("ip"); -+ } -+ if (item.containsKey("port")) { -+ port = (Integer) item.get("port"); -+ } -+ if (item.containsKey("databaseid")) { -+ databaseId = (Integer) item.get("databaseid"); -+ } -+ if (item.containsKey("acceptsTextures")) { -+ acceptsTextures = (Boolean) item.get("acceptsTextures"); -+ } -+ -+ if (item.containsKey("country")) { -+ country = (String) item.get("country"); -+ } -+ -+ addServer(title, ip, port, databaseId, acceptsTextures, country); -+ } -+ } catch (FileNotFoundException e) { -+ e.printStackTrace(); -+ } -+ } -+ } catch (Exception e) { -+ e.printStackTrace(); -+ } -+ } -+ -+ private void importLegacyTXT() { -+ File favorites = new File(FileUtil.getCacheDir(), "favorites.txt"); -+ if (favorites.exists()) { -+ FileReader reader; -+ try { -+ reader = new FileReader(favorites); -+ -+ BufferedReader buffer = new BufferedReader(reader); -+ while (true) { -+ String line = buffer.readLine(); -+ if (line == null) { -+ break; -+ } -+ String args[] = line.split(">"); -+ if (args.length == 2) { -+ String title = args[0]; -+ String split[] = args[1].split(":"); -+ String ip = split[0]; -+ int port = split.length > 1 ? Integer.parseInt(split[1]) : ServerItem.DEFAULT_PORT; -+ addServer(title, ip, port); -+ } -+ if (args.length == 3) { -+ String title = args[1]; -+ String split[] = args[0].split(":"); -+ String ip = split[0]; -+ int port = split.length > 1 ? Integer.parseInt(split[1]) : ServerItem.DEFAULT_PORT; -+ int databaseId = Integer.parseInt(args[2]); -+ addServer(title, ip, port, databaseId); -+ } -+ } -+ buffer.close(); -+ } catch (FileNotFoundException e) { -+ // TODO Auto-generated catch block -+ e.printStackTrace(); -+ } catch (IOException e) { -+ // TODO Auto-generated catch block -+ e.printStackTrace(); -+ } -+ -+ //favorites.delete(); // TODO Check if that is working first... -+ } -+ } -+ -+ private void importVanilla() { -+ // TODO Auto-generated method stub -+ -+ } -+ -+ public void save() { -+ Yaml yaml = new Yaml(); -+ ArrayList list = new ArrayList(); -+ for (ServerItem item : items) { -+ HashMap data = new HashMap(); -+ data.put("title", item.getTitle()); -+ data.put("ip", item.getIp()); -+ data.put("port", item.getPort()); -+ data.put("databaseid", item.getDatabaseId()); -+ data.put("country", item.getCountry()); -+ item.showPing = true; -+ if (item.getAcceptsTextures() != null) { -+ data.put("acceptsTextures", item.getAcceptsTextures().booleanValue()); -+ } -+ list.add(data); -+ } -+ try { -+ yaml.dump(list, new FileWriter(getFile())); -+ } catch (IOException e) { -+ e.printStackTrace(); -+ } -+ } -+ -+ private File getFile() { -+ return new File(FileUtil.getConfigDir(), "favorites.yml"); -+ } -+ -+ public void addServer(String title, String ip, int port) { -+ ServerItem item = new ServerItem(title, ip, port, -1); -+ item.poll(); -+ items.add(item); -+ sizeChanged(); -+ if (gui != null) { -+ gui.updateButtons(); -+ } -+ } -+ -+ public void addServer(String title, String ip, int port, int databaseId) { -+ ServerItem item = new ServerItem(title, ip, port, databaseId); -+ item.setShowPing(true); -+ item.poll(); -+ items.add(item); -+ sizeChanged(); -+ if (gui != null) { -+ gui.updateButtons(); -+ } -+ } -+ -+ public void addServer(String title, String ip, int port, int databaseId, Boolean acceptsTextures) { -+ ServerItem item = new ServerItem(title, ip, port, databaseId); -+ item.setShowPing(true); -+ if (acceptsTextures != null) { -+ item.setAcceptsTextures(acceptsTextures); -+ } -+ item.poll(); -+ items.add(item); -+ sizeChanged(); -+ if (gui != null) { -+ gui.updateButtons(); -+ } -+ } -+ -+ public void addServer(String title, String ip, int port, int databaseId, Boolean acceptsTextures, String country) { -+ ServerItem item = new ServerItem(title, ip, port, databaseId); -+ item.setShowPing(true); -+ if (acceptsTextures != null) { -+ item.setAcceptsTextures(acceptsTextures); -+ } -+ item.poll(); -+ item.country = country; -+ items.add(item); -+ sizeChanged(); -+ if (gui != null) { -+ gui.updateButtons(); -+ } -+ } -+ -+ public void removeServer(ServerItem selectedItem) { -+ items.remove(selectedItem); -+ sizeChanged(); -+ } -+ -+ public void addServer(ServerItem item) { -+ items.add(item); -+ sizeChanged(); -+ } -+ -+ public void move(int selectedRow, int i) { -+ ServerItem item = items.get(selectedRow); -+ i = Math.max(0, i); -+ i = Math.min(i, getSize() - 1); -+ items.remove(selectedRow); -+ items.add(i, item); -+ } -+ -+ public boolean containsSever(ServerItem item) { -+ for (ServerItem obj : items) { -+ if (obj.getIp().equals(item.getIp()) && obj.getPort() == item.getPort()) { -+ return true; -+ } -+ } -+ return false; -+ } -+} ---- /dev/null -+++ com/prupe/mcpatcher/cc/ColorMap.java -@@ -1,0 +1,102 @@ -+package com.prupe.mcpatcher.cc; -+ -+import com.prupe.mcpatcher.MCLogger; -+import com.prupe.mcpatcher.MCPatcherUtils; -+import com.prupe.mcpatcher.TexturePackAPI; -+import java.util.Arrays; -+import net.minecraft.src.ResourceLocation; -+ -+final class ColorMap { -+ private static final MCLogger logger = MCLogger.getLogger("Custom Colors"); -+ private static final int COLORMAP_SIZE = 256; -+ private static final float COLORMAP_SCALE = 255.0F; -+ private int[] map; -+ private int mapDefault; -+ private int lastBlendI = Integer.MIN_VALUE; -+ private int lastBlendK = Integer.MAX_VALUE; -+ private final float[] lastBlendResult = new float[3]; -+ -+ static int getX(double temperature, double rainfall) { -+ return (int)(255.0D * (1.0D - Colorizer.clamp(temperature))); -+ } -+ -+ static int getY(double temperature, double rainfall) { -+ return (int)(255.0D * (1.0D - Colorizer.clamp(rainfall) * Colorizer.clamp(temperature))); -+ } -+ -+ static float getBlockMetaKey(int blockID, int metadata) { -+ return (float)blockID + (float)(metadata & 255) / 256.0F; -+ } -+ -+ ColorMap(int defaultColor) { -+ this.mapDefault = defaultColor; -+ } -+ -+ void loadColorMap(boolean useCustom, ResourceLocation resource) { -+ if (useCustom) { -+ this.map = MCPatcherUtils.getImageRGB(TexturePackAPI.getImage(resource)); -+ -+ if (this.map != null) { -+ if (this.map.length != 65536) { -+ logger.error("%s must be %dx%d", new Object[] {resource, Integer.valueOf(256), Integer.valueOf(256)}); -+ this.map = null; -+ } else { -+ this.mapDefault = this.colorize(16777215, 0.5D, 1.0D); -+ logger.fine("using %s, default color %06x", new Object[] {resource, Integer.valueOf(this.mapDefault)}); -+ } -+ } -+ } -+ } -+ -+ boolean isCustom() { -+ return this.map != null; -+ } -+ -+ void clear() { -+ this.map = null; -+ } -+ -+ int colorize() { -+ return this.mapDefault; -+ } -+ -+ int colorize(int defaultColor) { -+ return this.map == null ? defaultColor : this.mapDefault; -+ } -+ -+ int colorize(int defaultColor, double temperature, double rainfall) { -+ return this.map == null ? defaultColor : this.map[256 * getY(temperature, rainfall) + getX(temperature, rainfall)]; -+ } -+ -+ int colorize(int defaultColor, int i, int j, int k) { -+ return this.colorize(defaultColor, (double)BiomeHelper.getTemperature(i, j, k), (double)BiomeHelper.getRainfall(i, j, k)); -+ } -+ -+ void colorizeWithBlending(int i, int j, int k, int radius, float[] result) { -+ if (i == this.lastBlendI && k == this.lastBlendK) { -+ System.arraycopy(this.lastBlendResult, 0, result, 0, 3); -+ } else { -+ Arrays.fill(result, 0.0F); -+ int diameter; -+ -+ for (diameter = -radius; diameter <= radius; ++diameter) { -+ for (int scale = -radius; scale <= radius; ++scale) { -+ int rgb = this.colorize(this.mapDefault, i + diameter, j, k + scale); -+ Colorizer.intToFloat3(rgb, this.lastBlendResult); -+ result[0] += this.lastBlendResult[0]; -+ result[1] += this.lastBlendResult[1]; -+ result[2] += this.lastBlendResult[2]; -+ } -+ } -+ -+ diameter = 2 * radius + 1; -+ float var9 = 1.0F / (float)(diameter * diameter); -+ result[0] *= var9; -+ result[1] *= var9; -+ result[2] *= var9; -+ System.arraycopy(result, 0, this.lastBlendResult, 0, 3); -+ this.lastBlendI = i; -+ this.lastBlendK = k; -+ } -+ } -+} ---- /dev/null -+++ org/spoutcraft/client/io/FileDownloadThread.java -@@ -1,0 +1,169 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.client.io; -+ -+import java.io.BufferedOutputStream; -+import java.io.FileOutputStream; -+import java.io.InputStream; -+import java.net.URL; -+import java.net.URLConnection; -+import java.util.HashSet; -+import java.util.Iterator; -+import java.util.concurrent.ConcurrentLinkedQueue; -+import java.util.concurrent.atomic.AtomicLong; -+ -+public class FileDownloadThread extends Thread { -+ private static FileDownloadThread instance = null; -+ private final ConcurrentLinkedQueue downloads = new ConcurrentLinkedQueue(); -+ private final ConcurrentLinkedQueue actions = new ConcurrentLinkedQueue(); -+ private final HashSet failedUrls = new HashSet(); -+ private final byte[] buffer = new byte[1024*1024]; -+ private volatile String activeDownload = null; -+ private boolean spoutDebug = false; -+ public static AtomicLong preCacheCompleted = new AtomicLong(0L); -+ -+ protected FileDownloadThread() { -+ super("File Download Thread"); -+ } -+ -+ public static FileDownloadThread getInstance() { -+ if (instance == null) { -+ instance = new FileDownloadThread(); -+ instance.start(); -+ } -+ return instance; -+ } -+ -+ public void addToDownloadQueue(Download download) { -+ downloads.add(download); -+ } -+ -+ public boolean isDownloading(String url) { -+ Iterator i = downloads.iterator(); -+ while (i.hasNext()) { -+ Download download = i.next(); -+ if (download.getDownloadUrl().equals(url)) { -+ return true; -+ } -+ } -+ return false; -+ } -+ -+ public void onTick() { -+ if (!actions.isEmpty()) { -+ Iterator i = actions.iterator(); -+ while (i.hasNext()) { -+ Runnable action = i.next(); -+ try { -+ action.run(); -+ } catch(Exception e) { -+ System.out.println("Could not run Runnable for download finish:"); -+ e.printStackTrace(); -+ } -+ i.remove(); -+ } -+ } -+ } -+ -+ public void abort() { -+ this.interrupt(); -+ downloads.clear(); -+ actions.clear(); -+ failedUrls.clear(); -+ } -+ -+ public String getActiveDownload() { -+ return activeDownload; -+ } -+ -+ public int getDownloadsRemaining() { -+ return downloads.size(); -+ } -+ -+ public void run() { -+ while (true) { -+ Download next = downloads.poll(); -+ if (next != null && !failedUrls.contains(next.getDownloadUrl())) { -+ try { -+ if (!next.isDownloaded()) { -+ if (spoutDebug) { -+ System.out.println("Downloading File: " + next.getDownloadUrl()); -+ } -+ activeDownload = FileUtil.getFileName(next.getDownloadUrl()); -+ URL url = new URL(next.getDownloadUrl()); -+ URLConnection conn = url.openConnection(); -+ conn.setRequestProperty("User-Agent", "Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.4; en-US; rv:1.9.2.2) Gecko/20100316 Firefox/3.6.2"); -+ conn.setReadTimeout(10000); //10s timeout -+ InputStream in = conn.getInputStream(); -+ -+ FileOutputStream fos = new FileOutputStream(next.getTempFile()); -+ BufferedOutputStream bos = new BufferedOutputStream(fos); -+ -+ long length = conn.getContentLength(); -+ int bytes; -+ long totalBytes = 0; -+ long last = 0; -+ -+ long step = Math.max(1024*1024, length / 8); -+ -+ while ((bytes = in.read(buffer)) >= 0) { -+ bos.write(buffer, 0, bytes); -+ totalBytes += bytes; -+ next.setProgress((int) (((double)totalBytes / (double)length) * 100)); -+ if (length > 0 && totalBytes > (last + step)) { -+ last = totalBytes; -+ long mb = totalBytes/(1024*1024); -+ if (spoutDebug) { -+ System.out.println("Downloading: " + next.getDownloadUrl() + " " + mb + "MB/" + (length/(1024*1024))); -+ } -+ } -+ try { -+ Thread.sleep(25); -+ } catch (InterruptedException e) { -+ } -+ } -+ in.close(); -+ bos.close(); -+ next.move(); -+ if (spoutDebug) { -+ System.out.println("File moved to: " + next.directory.getCanonicalPath()); -+ } -+ try { -+ sleep(10); // Cool off after heavy network useage -+ } catch (InterruptedException e) {} -+ } -+ if (next.getCompletedAction() != null) { -+ actions.add(next.getCompletedAction()); -+ } -+ } catch (Exception e) { -+ failedUrls.add(next.getDownloadUrl()); -+ if (spoutDebug) { -+ System.out.println("Download of " + next.getDownloadUrl() + " Failed!"); -+ } -+ } -+ activeDownload = null; -+ } else { -+ try { -+ sleep(100); -+ } catch (InterruptedException e) {} -+ } -+ } -+ } -+} ---- net/minecraft/src/EntityAITargetNonTamed.java -+++ net/minecraft/src/EntityAITargetNonTamed.java -@@ -3,11 +3,14 @@ - public class EntityAITargetNonTamed extends EntityAINearestAttackableTarget { - private EntityTameable theTameable; - -- public EntityAITargetNonTamed(EntityTameable var1, Class var2, int var3, boolean var4) { -- super(var1, var2, var3, var4); -- this.theTameable = var1; -+ public EntityAITargetNonTamed(EntityTameable par1EntityTameable, Class par2Class, int par3, boolean par4) { -+ super(par1EntityTameable, par2Class, par3, par4); -+ this.theTameable = par1EntityTameable; - } - -+ /** -+ * Returns whether the EntityAIBase should begin execution. -+ */ - public boolean shouldExecute() { - return !this.theTameable.isTamed() && super.shouldExecute(); - } ---- /dev/null -+++ org/spoutcraft/api/gui/BubbleBar.java -@@ -1,0 +1,129 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.api.gui; -+ -+import java.io.IOException; -+import java.util.UUID; -+ -+import org.spoutcraft.api.Spoutcraft; -+import org.spoutcraft.api.UnsafeClass; -+import org.spoutcraft.api.io.SpoutInputStream; -+import org.spoutcraft.api.io.SpoutOutputStream; -+ -+@UnsafeClass -+public class BubbleBar extends GenericWidget implements Widget { -+ private int icons = 10; -+ private int iconOffset = 8; -+ -+ public BubbleBar() { -+ super(); -+ setX(427 / 2 + 82); // 295 -+ setY(191); -+ setAnchor(WidgetAnchor.BOTTOM_CENTER); -+ } -+ -+ @Override -+ public void readData(SpoutInputStream input) throws IOException { -+ super.readData(input); -+ setMaxNumBubbles(input.readInt()); -+ setIconOffset(input.readInt()); -+ } -+ -+ @Override -+ public void writeData(SpoutOutputStream output) throws IOException { -+ super.writeData(output); -+ output.writeInt(getMaxNumBubbles()); -+ output.writeInt(getIconOffset()); -+ } -+ -+ public WidgetType getType() { -+ return WidgetType.BubbleBar; -+ } -+ -+ public UUID getId() { -+ return new UUID(0, 1); -+ } -+ -+ @Override -+ public double getScreenX() { -+ double mid = getScreen() != null ? getScreen().getWidth() / 2 : 427 / 2D; -+ double diff = super.getScreenX() - mid - 376; -+ return getScreen() != null ? getScreen().getWidth() / 2D - diff : this.getX(); -+ } -+ -+ @Override -+ public double getScreenY() { -+ int diff = (int) (240 - this.getY()); -+ return getScreen() != null ? getScreen().getHeight() - diff : this.getY(); -+ } -+ -+ public void render() { -+ Spoutcraft.getClient().getRenderDelegate().render(this); -+ } -+ -+ /** -+ * Gets the maximum number of bubbles displayed on the HUD. -+ * -+ * Air is scaled to fit the number of bubbles appropriately. -+ * -+ * @return bubbles displayed -+ */ -+ public int getMaxNumBubbles() { -+ return icons; -+ } -+ -+ /** -+ * Sets the maximum number of bubbles displayed on the HUD. -+ * -+ * Air is scaled to fit the number of bubbles appropriately. -+ * -+ * @param bubbles to display -+ * @return this -+ */ -+ public BubbleBar setMaxNumBubbles(int bubbles) { -+ this.icons = bubbles; -+ return this; -+ } -+ -+ /** -+ * Gets the number of pixels each bubbles is offset when drawing the next bubble. -+ * -+ * @return pixel offset -+ */ -+ public int getIconOffset() { -+ return iconOffset; -+ } -+ -+ /** -+ * Sets the number of pixels each bubbles is offset when drawing the next bubble. -+ * -+ * @param offset when drawing hearts -+ * @return this -+ */ -+ public BubbleBar setIconOffset(int offset) { -+ iconOffset = offset; -+ return this; -+ } -+ -+ @Override -+ public int getVersion() { -+ return super.getVersion() + 1; -+ } -+} ---- /dev/null -+++ org/spoutcraft/client/gui/settings/controls/HotbarTextButton.java -@@ -1,0 +1,37 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.client.gui.settings.controls; -+ -+import org.spoutcraft.api.gui.GenericCheckBox; -+import org.spoutcraft.client.config.Configuration; -+ -+public class HotbarTextButton extends GenericCheckBox { -+ public HotbarTextButton() { -+ super("Hotbar Text"); -+ setChecked(Configuration.isShowingHotbarText()); -+ setTooltip("Displays the name of the currently selected hotbar item."); -+ } -+ -+ @Override -+ public void onButtonClick() { -+ Configuration.setShowingHotbarText(!Configuration.isShowingHotbarText()); -+ Configuration.write(); -+ } -+} ---- net/minecraft/src/EntityBat.java -+++ net/minecraft/src/EntityBat.java -@@ -3,10 +3,15 @@ - import java.util.Calendar; - - public class EntityBat extends EntityAmbientCreature { -- private ChunkCoordinates spawnPosition; -- -- public EntityBat(World var1) { -- super(var1); -+ -+ /** -+ * randomly selected ChunkCoordinates in a 7x6x7 box around the bat (y offset -2 to 4) towards which it will fly. upon -+ * getting close a new target will be selected -+ */ -+ private ChunkCoordinates currentFlightTarget; -+ -+ public EntityBat(World par1World) { -+ super(par1World); - this.setSize(0.5F, 0.9F); - this.setIsBatHanging(true); - } -@@ -16,35 +21,51 @@ - this.dataWatcher.addObject(16, new Byte((byte)0)); - } - -+ /** -+ * Returns the volume for the sounds this mob makes. -+ */ - protected float getSoundVolume() { - return 0.1F; - } - -+ /** -+ * Gets the pitch of living sounds in living entities. -+ */ - protected float getSoundPitch() { - return super.getSoundPitch() * 0.95F; - } - -+ /** -+ * Returns the sound this mob makes while it's alive. -+ */ - protected String getLivingSound() { -- return this.getIsBatHanging() && this.ab.nextInt(4) != 0 ? null : "mob.bat.idle"; -+ return this.getIsBatHanging() && this.rand.nextInt(4) != 0 ? null : "mob.bat.idle"; - } - -+ /** -+ * Returns the sound this mob makes when it is hurt. -+ */ - protected String getHurtSound() { - return "mob.bat.hurt"; - } - -+ /** -+ * Returns the sound this mob makes on death. -+ */ - protected String getDeathSound() { - return "mob.bat.death"; - } - -+ /** -+ * Returns true if this entity should push and be pushed by other entities when colliding. -+ */ - public boolean canBePushed() { - return false; - } - -- protected void collideWithEntity(Entity var1) { -- } -+ protected void collideWithEntity(Entity par1Entity) {} - -- protected void collideWithNearbyEntities() { -- } -+ protected void collideWithNearbyEntities() {} - - protected void applyEntityAttributes() { - super.applyEntityAttributes(); -@@ -55,112 +76,144 @@ - return (this.dataWatcher.getWatchableObjectByte(16) & 1) != 0; - } - -- public void setIsBatHanging(boolean var1) { -+ public void setIsBatHanging(boolean par1) { - byte var2 = this.dataWatcher.getWatchableObjectByte(16); -- if(var1) { -+ -+ if (par1) { - this.dataWatcher.updateObject(16, Byte.valueOf((byte)(var2 | 1))); - } else { - this.dataWatcher.updateObject(16, Byte.valueOf((byte)(var2 & -2))); - } -- - } - -+ /** -+ * Returns true if the newer Entity AI code should be run -+ */ - protected boolean isAIEnabled() { - return true; - } - -+ /** -+ * Called to update the entity's position/logic. -+ */ - public void onUpdate() { - super.onUpdate(); -- if(this.getIsBatHanging()) { -+ -+ if (this.getIsBatHanging()) { - this.motionX = this.motionY = this.motionZ = 0.0D; - this.posY = (double)MathHelper.floor_double(this.posY) + 1.0D - (double)this.height; - } else { -- this.motionY *= (double)0.6F; -+ this.motionY *= 0.6000000238418579D; - } -- - } - - protected void updateAITasks() { - super.updateAITasks(); -- if(this.getIsBatHanging()) { -- if(!this.worldObj.isBlockNormalCube(MathHelper.floor_double(this.posX), (int)this.posY + 1, MathHelper.floor_double(this.posZ))) { -+ -+ if (this.getIsBatHanging()) { -+ if (!this.worldObj.isBlockNormalCube(MathHelper.floor_double(this.posX), (int)this.posY + 1, MathHelper.floor_double(this.posZ))) { - this.setIsBatHanging(false); - this.worldObj.playAuxSFXAtEntity((EntityPlayer)null, 1015, (int)this.posX, (int)this.posY, (int)this.posZ, 0); - } else { -- if(this.ab.nextInt(200) == 0) { -- this.rotationYawHead = (float)this.ab.nextInt(360); -+ if (this.rand.nextInt(200) == 0) { -+ this.rotationYawHead = (float)this.rand.nextInt(360); - } - -- if(this.worldObj.getClosestPlayerToEntity(this, 4.0D) != null) { -+ if (this.worldObj.getClosestPlayerToEntity(this, 4.0D) != null) { - this.setIsBatHanging(false); - this.worldObj.playAuxSFXAtEntity((EntityPlayer)null, 1015, (int)this.posX, (int)this.posY, (int)this.posZ, 0); - } - } - } else { -- if(this.spawnPosition != null && (!this.worldObj.isAirBlock(this.spawnPosition.posX, this.spawnPosition.posY, this.spawnPosition.posZ) || this.spawnPosition.posY < 1)) { -- this.spawnPosition = null; -- } -- -- if(this.spawnPosition == null || this.ab.nextInt(30) == 0 || this.spawnPosition.getDistanceSquared((int)this.posX, (int)this.posY, (int)this.posZ) < 4.0F) { -- this.spawnPosition = new ChunkCoordinates((int)this.posX + this.ab.nextInt(7) - this.ab.nextInt(7), (int)this.posY + this.ab.nextInt(6) - 2, (int)this.posZ + this.ab.nextInt(7) - this.ab.nextInt(7)); -- } -- -- double var1 = (double)this.spawnPosition.posX + 0.5D - this.posX; -- double var3 = (double)this.spawnPosition.posY + 0.1D - this.posY; -- double var5 = (double)this.spawnPosition.posZ + 0.5D - this.posZ; -- this.motionX += (Math.signum(var1) * 0.5D - this.motionX) * (double)0.1F; -- this.motionY += (Math.signum(var3) * (double)0.7F - this.motionY) * (double)0.1F; -- this.motionZ += (Math.signum(var5) * 0.5D - this.motionZ) * (double)0.1F; -- float var7 = (float)(Math.atan2(this.motionZ, this.motionX) * 180.0D / (double)((float)Math.PI)) - 90.0F; -+ if (this.currentFlightTarget != null && (!this.worldObj.isAirBlock(this.currentFlightTarget.posX, this.currentFlightTarget.posY, this.currentFlightTarget.posZ) || this.currentFlightTarget.posY < 1)) { -+ this.currentFlightTarget = null; -+ } -+ -+ if (this.currentFlightTarget == null || this.rand.nextInt(30) == 0 || this.currentFlightTarget.getDistanceSquared((int)this.posX, (int)this.posY, (int)this.posZ) < 4.0F) { -+ this.currentFlightTarget = new ChunkCoordinates((int)this.posX + this.rand.nextInt(7) - this.rand.nextInt(7), (int)this.posY + this.rand.nextInt(6) - 2, (int)this.posZ + this.rand.nextInt(7) - this.rand.nextInt(7)); -+ } -+ -+ double var1 = (double)this.currentFlightTarget.posX + 0.5D - this.posX; -+ double var3 = (double)this.currentFlightTarget.posY + 0.1D - this.posY; -+ double var5 = (double)this.currentFlightTarget.posZ + 0.5D - this.posZ; -+ this.motionX += (Math.signum(var1) * 0.5D - this.motionX) * 0.10000000149011612D; -+ this.motionY += (Math.signum(var3) * 0.699999988079071D - this.motionY) * 0.10000000149011612D; -+ this.motionZ += (Math.signum(var5) * 0.5D - this.motionZ) * 0.10000000149011612D; -+ float var7 = (float)(Math.atan2(this.motionZ, this.motionX) * 180.0D / Math.PI) - 90.0F; - float var8 = MathHelper.wrapAngleTo180_float(var7 - this.rotationYaw); - this.moveForward = 0.5F; - this.rotationYaw += var8; -- if(this.ab.nextInt(100) == 0 && this.worldObj.isBlockNormalCube(MathHelper.floor_double(this.posX), (int)this.posY + 1, MathHelper.floor_double(this.posZ))) { -+ -+ if (this.rand.nextInt(100) == 0 && this.worldObj.isBlockNormalCube(MathHelper.floor_double(this.posX), (int)this.posY + 1, MathHelper.floor_double(this.posZ))) { - this.setIsBatHanging(true); - } - } -- - } - -+ /** -+ * returns if this entity triggers Block.onEntityWalking on the blocks they walk on. used for spiders and wolves to -+ * prevent them from trampling crops -+ */ - protected boolean canTriggerWalking() { - return false; - } - -- protected void fall(float var1) { -- } -- -- protected void updateFallState(double var1, boolean var3) { -- } -- -+ /** -+ * Called when the mob is falling. Calculates and applies fall damage. -+ */ -+ protected void fall(float par1) {} -+ -+ /** -+ * Takes in the distance the entity has fallen this tick and whether its on the ground to update the fall distance and -+ * deal fall damage if landing on the ground. Args: distanceFallenThisTick, onGround -+ */ -+ protected void updateFallState(double par1, boolean par3) {} -+ -+ /** -+ * Return whether this entity should NOT trigger a pressure plate or a tripwire. -+ */ - public boolean doesEntityNotTriggerPressurePlate() { - return true; - } - -- public boolean attackEntityFrom(DamageSource var1, float var2) { -- if(this.isEntityInvulnerable()) { -+ /** -+ * Called when the entity is attacked. -+ */ -+ public boolean attackEntityFrom(DamageSource par1DamageSource, float par2) { -+ if (this.isEntityInvulnerable()) { - return false; - } else { -- if(!this.worldObj.isRemote && this.getIsBatHanging()) { -+ if (!this.worldObj.isRemote && this.getIsBatHanging()) { - this.setIsBatHanging(false); - } - -- return super.attackEntityFrom(var1, var2); -+ return super.attackEntityFrom(par1DamageSource, par2); - } - } - -- public void readEntityFromNBT(NBTTagCompound var1) { -- super.readEntityFromNBT(var1); -- this.dataWatcher.updateObject(16, Byte.valueOf(var1.getByte("BatFlags"))); -- } -- -- public void writeEntityToNBT(NBTTagCompound var1) { -- super.writeEntityToNBT(var1); -- var1.setByte("BatFlags", this.dataWatcher.getWatchableObjectByte(16)); -- } -- -+ /** -+ * (abstract) Protected helper method to read subclass entity data from NBT. -+ */ -+ public void readEntityFromNBT(NBTTagCompound par1NBTTagCompound) { -+ super.readEntityFromNBT(par1NBTTagCompound); -+ this.dataWatcher.updateObject(16, Byte.valueOf(par1NBTTagCompound.getByte("BatFlags"))); -+ } -+ -+ /** -+ * (abstract) Protected helper method to write subclass entity data to NBT. -+ */ -+ public void writeEntityToNBT(NBTTagCompound par1NBTTagCompound) { -+ super.writeEntityToNBT(par1NBTTagCompound); -+ par1NBTTagCompound.setByte("BatFlags", this.dataWatcher.getWatchableObjectByte(16)); -+ } -+ -+ /** -+ * Checks if the entity's current position is a valid location to spawn this entity. -+ */ - public boolean getCanSpawnHere() { - int var1 = MathHelper.floor_double(this.boundingBox.minY); -- if(var1 >= 63) { -+ -+ if (var1 >= 63) { - return false; - } else { - int var2 = MathHelper.floor_double(this.posX); -@@ -168,15 +221,16 @@ - int var4 = this.worldObj.getBlockLightValue(var2, var1, var3); - byte var5 = 4; - Calendar var6 = this.worldObj.getCurrentDate(); -- if((var6.get(2) + 1 != 10 || var6.get(5) < 20) && (var6.get(2) + 1 != 11 || var6.get(5) > 3)) { -- if(this.ab.nextBoolean()) { -+ -+ if ((var6.get(2) + 1 != 10 || var6.get(5) < 20) && (var6.get(2) + 1 != 11 || var6.get(5) > 3)) { -+ if (this.rand.nextBoolean()) { - return false; - } - } else { - var5 = 7; - } - -- return var4 > this.ab.nextInt(var5) ? false : super.getCanSpawnHere(); -+ return var4 > this.rand.nextInt(var5) ? false : super.getCanSpawnHere(); - } - } - } ---- net/minecraft/src/TileEntity.java -+++ net/minecraft/src/TileEntity.java -@@ -5,102 +5,155 @@ - import net.minecraft.server.MinecraftServer; - - public class TileEntity { -- private static Map a = new HashMap(); -- private static Map b = new HashMap(); -+ -+ /** -+ * A HashMap storing string names of classes mapping to the actual java.lang.Class type. -+ */ -+ private static Map nameToClassMap = new HashMap(); -+ -+ /** -+ * A HashMap storing the classes and mapping to the string names (reverse of nameToClassMap). -+ */ -+ private static Map classToNameMap = new HashMap(); -+ -+ /** The reference to the world. */ - protected World worldObj; -+ -+ /** The x coordinate of the tile entity. */ - public int xCoord; -+ -+ /** The y coordinate of the tile entity. */ - public int yCoord; -+ -+ /** The z coordinate of the tile entity. */ - public int zCoord; - protected boolean tileEntityInvalid; - public int blockMetadata = -1; -+ -+ /** the Block type that this TileEntity is contained within */ - public Block blockType; - -- private static void addMapping(Class var0, String var1) { -- if(a.containsKey(var1)) { -- throw new IllegalArgumentException("Duplicate id: " + var1); -+ /** -+ * Adds a new two-way mapping between the class and its string name in both hashmaps. -+ */ -+ private static void addMapping(Class par0Class, String par1Str) { -+ if (nameToClassMap.containsKey(par1Str)) { -+ throw new IllegalArgumentException("Duplicate id: " + par1Str); - } else { -- a.put(var1, var0); -- b.put(var0, var1); -+ nameToClassMap.put(par1Str, par0Class); -+ classToNameMap.put(par0Class, par1Str); - } - } - -+ /** -+ * Returns the worldObj for this tileEntity. -+ */ - public World getWorldObj() { - return this.worldObj; - } - -- public void setWorldObj(World var1) { -- this.worldObj = var1; -+ /** -+ * Sets the worldObj for this tileEntity. -+ */ -+ public void setWorldObj(World par1World) { -+ this.worldObj = par1World; - } - -+ /** -+ * Returns true if the worldObj isn't null. -+ */ - public boolean hasWorldObj() { - return this.worldObj != null; - } - -- public void readFromNBT(NBTTagCompound var1) { -- this.xCoord = var1.getInteger("x"); -- this.yCoord = var1.getInteger("y"); -- this.zCoord = var1.getInteger("z"); -+ /** -+ * Reads a tile entity from NBT. -+ */ -+ public void readFromNBT(NBTTagCompound par1NBTTagCompound) { -+ this.xCoord = par1NBTTagCompound.getInteger("x"); -+ this.yCoord = par1NBTTagCompound.getInteger("y"); -+ this.zCoord = par1NBTTagCompound.getInteger("z"); - } - -- public void writeToNBT(NBTTagCompound var1) { -- String var2 = (String)b.get(this.getClass()); -- if(var2 == null) { -+ /** -+ * Writes a tile entity to NBT. -+ */ -+ public void writeToNBT(NBTTagCompound par1NBTTagCompound) { -+ String var2 = (String)classToNameMap.get(this.getClass()); -+ -+ if (var2 == null) { - throw new RuntimeException(this.getClass() + " is missing a mapping! This is a bug!"); - } else { -- var1.setString("id", var2); -- var1.setInteger("x", this.xCoord); -- var1.setInteger("y", this.yCoord); -- var1.setInteger("z", this.zCoord); -+ par1NBTTagCompound.setString("id", var2); -+ par1NBTTagCompound.setInteger("x", this.xCoord); -+ par1NBTTagCompound.setInteger("y", this.yCoord); -+ par1NBTTagCompound.setInteger("z", this.zCoord); - } - } - -- public void updateEntity() { -- } -+ /** -+ * Allows the entity to update its state. Overridden in most subclasses, e.g. the mob spawner uses this to count ticks -+ * and creates a new spawn inside its implementation. -+ */ -+ public void updateEntity() {} - -- public static TileEntity createAndLoadEntity(NBTTagCompound var0) { -+ /** -+ * Creates a new entity and loads its data from the specified NBT. -+ */ -+ public static TileEntity createAndLoadEntity(NBTTagCompound par0NBTTagCompound) { - TileEntity var1 = null; - - try { -- Class var2 = (Class)a.get(var0.getString("id")); -- if(var2 != null) { -+ Class var2 = (Class)nameToClassMap.get(par0NBTTagCompound.getString("id")); -+ -+ if (var2 != null) { - var1 = (TileEntity)var2.newInstance(); - } - } catch (Exception var3) { - var3.printStackTrace(); - } - -- if(var1 != null) { -- var1.readFromNBT(var0); -+ if (var1 != null) { -+ var1.readFromNBT(par0NBTTagCompound); - } else { -- MinecraftServer.getServer().getLogAgent().logWarning("Skipping TileEntity with id " + var0.getString("id")); -+ MinecraftServer.getServer().getLogAgent().logWarning("Skipping TileEntity with id " + par0NBTTagCompound.getString("id")); - } - - return var1; - } - -+ /** -+ * Returns block data at the location of this entity (client-only). -+ */ - public int getBlockMetadata() { -- if(this.blockMetadata == -1) { -+ if (this.blockMetadata == -1) { - this.blockMetadata = this.worldObj.getBlockMetadata(this.xCoord, this.yCoord, this.zCoord); - } - - return this.blockMetadata; - } - -+ /** -+ * Called when an the contents of an Inventory change, usually -+ */ - public void onInventoryChanged() { -- if(this.worldObj != null) { -+ if (this.worldObj != null) { - this.blockMetadata = this.worldObj.getBlockMetadata(this.xCoord, this.yCoord, this.zCoord); - this.worldObj.markTileEntityChunkModified(this.xCoord, this.yCoord, this.zCoord, this); -- if(this.getBlockType() != null) { -+ -+ if (this.getBlockType() != null) { - this.worldObj.func_96440_m(this.xCoord, this.yCoord, this.zCoord, this.getBlockType().blockID); - } - } -- - } - -- public double getDistanceFrom(double var1, double var3, double var5) { -- double var7 = (double)this.xCoord + 0.5D - var1; -- double var9 = (double)this.yCoord + 0.5D - var3; -- double var11 = (double)this.zCoord + 0.5D - var5; -+ /** -+ * Returns the square of the distance between this entity and the passed in coordinates. -+ */ -+ public double getDistanceFrom(double par1, double par3, double par5) { -+ double var7 = (double)this.xCoord + 0.5D - par1; -+ double var9 = (double)this.yCoord + 0.5D - par3; -+ double var11 = (double)this.zCoord + 0.5D - par5; - return var7 * var7 + var9 * var9 + var11 * var11; - } - -@@ -108,48 +161,70 @@ - return 4096.0D; - } - -+ /** -+ * Gets the block type at the location of this entity (client-only). -+ */ - public Block getBlockType() { -- if(this.blockType == null) { -+ if (this.blockType == null) { - this.blockType = Block.blocksList[this.worldObj.getBlockId(this.xCoord, this.yCoord, this.zCoord)]; - } - - return this.blockType; - } - -+ /** -+ * Overriden in a sign to provide the text. -+ */ - public Packet getDescriptionPacket() { - return null; - } - -+ /** -+ * returns true if tile entity is invalid, false otherwise -+ */ - public boolean isInvalid() { - return this.tileEntityInvalid; - } - -+ /** -+ * invalidates a tile entity -+ */ - public void invalidate() { - this.tileEntityInvalid = true; - } - -+ /** -+ * validates a tile entity -+ */ - public void validate() { - this.tileEntityInvalid = false; - } - -- public boolean receiveClientEvent(int var1, int var2) { -+ /** -+ * Called when a client event is received with the event number and argument, see World.sendClientEvent -+ */ -+ public boolean receiveClientEvent(int par1, int par2) { - return false; - } - -+ /** -+ * Causes the TileEntity to reset all it's cached values for it's container block, blockID, metaData and in the case of -+ * chests, the adjcacent chest check -+ */ - public void updateContainingBlockInfo() { - this.blockType = null; - this.blockMetadata = -1; - } - -- public void func_85027_a(CrashReportCategory var1) { -- var1.addCrashSectionCallable("Name", new CallableTileEntityName(this)); -- CrashReportCategory.addBlockCrashInfo(var1, this.xCoord, this.yCoord, this.zCoord, this.getBlockType().blockID, this.getBlockMetadata()); -- var1.addCrashSectionCallable("Actual block type", new CallableTileEntityID(this)); -- var1.addCrashSectionCallable("Actual block data value", new CallableTileEntityData(this)); -+ public void func_85027_a(CrashReportCategory par1CrashReportCategory) { -+ par1CrashReportCategory.addCrashSectionCallable("Name", new CallableTileEntityName(this)); -+ CrashReportCategory.addBlockCrashInfo(par1CrashReportCategory, this.xCoord, this.yCoord, this.zCoord, this.getBlockType().blockID, this.getBlockMetadata()); -+ par1CrashReportCategory.addCrashSectionCallable("Actual block type", new CallableTileEntityID(this)); -+ par1CrashReportCategory.addCrashSectionCallable("Actual block data value", new CallableTileEntityData(this)); - } - - static Map getClassToNameMap() { -- return b; -+ return classToNameMap; - } - - static { ---- net/minecraft/src/MemoryConnection.java -+++ net/minecraft/src/MemoryConnection.java -@@ -7,28 +7,36 @@ - import java.util.List; - - public class MemoryConnection implements INetworkManager { -- private static final SocketAddress a = new InetSocketAddress("127.0.0.1", 0); -- private final List b = Collections.synchronizedList(new ArrayList()); -+ private static final SocketAddress mySocketAddress = new InetSocketAddress("127.0.0.1", 0); -+ private final List readPacketCache = Collections.synchronizedList(new ArrayList()); - private final ILogAgent field_98214_c; - private MemoryConnection pairedConnection; - private NetHandler myNetHandler; -+ -+ /** set to true by {server,network}Shutdown */ - private boolean shuttingDown; -- private String g = ""; -- private Object[] h; -+ private String shutdownReason = ""; -+ private Object[] field_74439_g; - private boolean gamePaused; - -- public MemoryConnection(ILogAgent var1, NetHandler var2) { -- this.myNetHandler = var2; -- this.field_98214_c = var1; -- } -- -- public void setNetHandler(NetHandler var1) { -- this.myNetHandler = var1; -- } -- -- public void addToSendQueue(Packet var1) { -- if(!this.shuttingDown) { -- this.pairedConnection.processOrCachePacket(var1); -+ public MemoryConnection(ILogAgent par1ILogAgent, NetHandler par2NetHandler) { -+ this.myNetHandler = par2NetHandler; -+ this.field_98214_c = par1ILogAgent; -+ } -+ -+ /** -+ * Sets the NetHandler for this NetworkManager. Server-only. -+ */ -+ public void setNetHandler(NetHandler par1NetHandler) { -+ this.myNetHandler = par1NetHandler; -+ } -+ -+ /** -+ * Adds the packet to the correct send queue (chunk data packets go to a separate queue). -+ */ -+ public void addToSendQueue(Packet par1Packet) { -+ if (!this.shuttingDown) { -+ this.pairedConnection.processOrCachePacket(par1Packet); - } - } - -@@ -41,68 +49,87 @@ - return !this.shuttingDown && this.pairedConnection != null; - } - -- public void wakeThreads() { -- } -+ /** -+ * Wakes reader and writer threads -+ */ -+ public void wakeThreads() {} - -+ /** -+ * Checks timeouts and processes all pending read packets. -+ */ - public void processReadPackets() { - int var1 = 2500; - -- while(var1-- >= 0 && !this.b.isEmpty()) { -- Packet var2 = (Packet)this.b.remove(0); -+ while (var1-- >= 0 && !this.readPacketCache.isEmpty()) { -+ Packet var2 = (Packet)this.readPacketCache.remove(0); - var2.processPacket(this.myNetHandler); - } - -- if(this.b.size() > var1) { -- this.field_98214_c.logWarning("Memory connection overburdened; after processing 2500 packets, we still have " + this.b.size() + " to go!"); -- } -- -- if(this.shuttingDown && this.b.isEmpty()) { -- this.myNetHandler.handleErrorMessage(this.g, this.h); -- } -- -- } -- -- public SocketAddress getRemoteAddress() { -- return a; -- } -- -+ if (this.readPacketCache.size() > var1) { -+ this.field_98214_c.logWarning("Memory connection overburdened; after processing 2500 packets, we still have " + this.readPacketCache.size() + " to go!"); -+ } -+ -+ if (this.shuttingDown && this.readPacketCache.isEmpty()) { -+ this.myNetHandler.handleErrorMessage(this.shutdownReason, this.field_74439_g); -+ } -+ } -+ -+ /** -+ * Return the InetSocketAddress of the remote endpoint -+ */ -+ public SocketAddress getSocketAddress() { -+ return mySocketAddress; -+ } -+ -+ /** -+ * Shuts down the server. (Only actually used on the server) -+ */ - public void serverShutdown() { - this.shuttingDown = true; - } - -- public void networkShutdown(String var1, Object... var2) { -+ /** -+ * Shuts down the network with the specified reason. Closes all streams and sockets, spawns NetworkMasterThread to stop -+ * reading and writing threads. -+ */ -+ public void networkShutdown(String par1Str, Object ... par2ArrayOfObj) { - this.shuttingDown = true; -- this.g = var1; -- this.h = var2; -+ this.shutdownReason = par1Str; -+ this.field_74439_g = par2ArrayOfObj; - } - -- public int getNumChunkDataPackets() { -+ /** -+ * returns 0 for memoryConnections -+ */ -+ public int packetSize() { - return 0; - } - -- public void pairWith(MemoryConnection var1) { -- this.pairedConnection = var1; -- var1.pairedConnection = this; -+ public void pairWith(MemoryConnection par1MemoryConnection) { -+ this.pairedConnection = par1MemoryConnection; -+ par1MemoryConnection.pairedConnection = this; - } - - public boolean isGamePaused() { - return this.gamePaused; - } - -- public void setGamePaused(boolean var1) { -- this.gamePaused = var1; -+ public void setGamePaused(boolean par1) { -+ this.gamePaused = par1; - } - - public MemoryConnection getPairedConnection() { - return this.pairedConnection; - } - -- public void processOrCachePacket(Packet var1) { -- if(var1.canProcessAsync() && this.myNetHandler.canProcessPacketsAsync()) { -- var1.processPacket(this.myNetHandler); -+ /** -+ * acts immiditally if isWritePacket, otherwise adds it to the readCache to be processed next tick -+ */ -+ public void processOrCachePacket(Packet par1Packet) { -+ if (par1Packet.canProcessAsync() && this.myNetHandler.canProcessPacketsAsync()) { -+ par1Packet.processPacket(this.myNetHandler); - } else { -- this.b.add(var1); -+ this.readPacketCache.add(par1Packet); - } -- - } - } ---- net/minecraft/src/StructurePieceBlockSelector.java -+++ net/minecraft/src/StructurePieceBlockSelector.java -@@ -6,6 +6,9 @@ - protected int selectedBlockId; - protected int selectedBlockMetaData; - -+ /** -+ * picks Block Ids and Metadata (Silverfish) -+ */ - public abstract void selectBlocks(Random var1, int var2, int var3, int var4, boolean var5); - - public int getSelectedBlockId() { ---- net/minecraft/src/Vec3Pool.java -+++ net/minecraft/src/Vec3Pool.java -@@ -6,27 +6,33 @@ - public class Vec3Pool { - private final int truncateArrayResetThreshold; - private final int minimumSize; -- private final List c = new ArrayList(); -+ -+ /** items at and above nextFreeSpace are assumed to be available */ -+ private final List vec3Cache = new ArrayList(); - private int nextFreeSpace; - private int maximumSizeSinceLastTruncation; - private int resetCount; - -- public Vec3Pool(int var1, int var2) { -- this.truncateArrayResetThreshold = var1; -- this.minimumSize = var2; -+ public Vec3Pool(int par1, int par2) { -+ this.truncateArrayResetThreshold = par1; -+ this.minimumSize = par2; - } - -- public Vec3 getVecFromPool(double var1, double var3, double var5) { -- if(this.func_82589_e()) { -- return new Vec3(this, var1, var3, var5); -+ /** -+ * extends the pool if all vecs are currently "out" -+ */ -+ public Vec3 getVecFromPool(double par1, double par3, double par5) { -+ if (this.func_82589_e()) { -+ return new Vec3(this, par1, par3, par5); - } else { - Vec3 var7; -- if(this.nextFreeSpace >= this.c.size()) { -- var7 = new Vec3(this, var1, var3, var5); -- this.c.add(var7); -+ -+ if (this.nextFreeSpace >= this.vec3Cache.size()) { -+ var7 = new Vec3(this, par1, par3, par5); -+ this.vec3Cache.add(var7); - } else { -- var7 = (Vec3)this.c.get(this.nextFreeSpace); -- var7.setComponents(var1, var3, var5); -+ var7 = (Vec3)this.vec3Cache.get(this.nextFreeSpace); -+ var7.setComponents(par1, par3, par5); - } - - ++this.nextFreeSpace; -@@ -34,17 +40,20 @@ - } - } - -+ /** -+ * Will truncate the array everyN clears to the maximum size observed since the last truncation. -+ */ - public void clear() { -- if(!this.func_82589_e()) { -- if(this.nextFreeSpace > this.maximumSizeSinceLastTruncation) { -+ if (!this.func_82589_e()) { -+ if (this.nextFreeSpace > this.maximumSizeSinceLastTruncation) { - this.maximumSizeSinceLastTruncation = this.nextFreeSpace; - } - -- if(this.resetCount++ == this.truncateArrayResetThreshold) { -- int var1 = Math.max(this.maximumSizeSinceLastTruncation, this.c.size() - this.minimumSize); -+ if (this.resetCount++ == this.truncateArrayResetThreshold) { -+ int var1 = Math.max(this.maximumSizeSinceLastTruncation, this.vec3Cache.size() - this.minimumSize); - -- while(this.c.size() > var1) { -- this.c.remove(var1); -+ while (this.vec3Cache.size() > var1) { -+ this.vec3Cache.remove(var1); - } - - this.maximumSizeSinceLastTruncation = 0; -@@ -56,14 +65,14 @@ - } - - public void clearAndFreeCache() { -- if(!this.func_82589_e()) { -+ if (!this.func_82589_e()) { - this.nextFreeSpace = 0; -- this.c.clear(); -+ this.vec3Cache.clear(); - } - } - - public int getPoolSize() { -- return this.c.size(); -+ return this.vec3Cache.size(); - } - - public int func_82590_d() { ---- /dev/null -+++ org/spoutcraft/api/gui/ScrollArea.java -@@ -1,0 +1,28 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.api.gui; -+ -+public interface ScrollArea extends Scrollable, Screen { -+ /** -+ * Recalculates height and width for all widgets. -+ * This is useful when the size of a widget changed while it was already attached to the ScrollArea. -+ */ -+ public void updateInnerSize(); -+} ---- net/minecraft/src/ItemReed.java -+++ net/minecraft/src/ItemReed.java -@@ -1,59 +1,67 @@ - package net.minecraft.src; - - public class ItemReed extends Item { -+ -+ /** The ID of the block the reed will spawn when used from inventory bar. */ - private int spawnID; - -- public ItemReed(int var1, Block var2) { -- super(var1); -- this.spawnID = var2.blockID; -+ public ItemReed(int par1, Block par2Block) { -+ super(par1); -+ this.spawnID = par2Block.blockID; - } - -- public boolean onItemUse(ItemStack var1, EntityPlayer var2, World var3, int var4, int var5, int var6, int var7, float var8, float var9, float var10) { -- int var11 = var3.getBlockId(var4, var5, var6); -- if(var11 == Block.snow.blockID && (var3.getBlockMetadata(var4, var5, var6) & 7) < 1) { -- var7 = 1; -- } else if(var11 != Block.vine.blockID && var11 != Block.tallGrass.blockID && var11 != Block.deadBush.blockID) { -- if(var7 == 0) { -- --var5; -- } -- -- if(var7 == 1) { -- ++var5; -- } -- -- if(var7 == 2) { -- --var6; -- } -- -- if(var7 == 3) { -- ++var6; -- } -- -- if(var7 == 4) { -- --var4; -- } -- -- if(var7 == 5) { -- ++var4; -+ /** -+ * Callback for item usage. If the item does something special on right clicking, he will have one of those. Return -+ * True if something happen and false if it don't. This is for ITEMS, not BLOCKS -+ */ -+ public boolean onItemUse(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, World par3World, int par4, int par5, int par6, int par7, float par8, float par9, float par10) { -+ int var11 = par3World.getBlockId(par4, par5, par6); -+ -+ if (var11 == Block.snow.blockID && (par3World.getBlockMetadata(par4, par5, par6) & 7) < 1) { -+ par7 = 1; -+ } else if (var11 != Block.vine.blockID && var11 != Block.tallGrass.blockID && var11 != Block.deadBush.blockID) { -+ if (par7 == 0) { -+ --par5; -+ } -+ -+ if (par7 == 1) { -+ ++par5; -+ } -+ -+ if (par7 == 2) { -+ --par6; -+ } -+ -+ if (par7 == 3) { -+ ++par6; -+ } -+ -+ if (par7 == 4) { -+ --par4; -+ } -+ -+ if (par7 == 5) { -+ ++par4; - } - } - -- if(!var2.canPlayerEdit(var4, var5, var6, var7, var1)) { -+ if (!par2EntityPlayer.canPlayerEdit(par4, par5, par6, par7, par1ItemStack)) { - return false; -- } else if(var1.stackSize == 0) { -+ } else if (par1ItemStack.stackSize == 0) { - return false; - } else { -- if(var3.canPlaceEntityOnSide(this.spawnID, var4, var5, var6, false, var7, (Entity)null, var1)) { -+ if (par3World.canPlaceEntityOnSide(this.spawnID, par4, par5, par6, false, par7, (Entity)null, par1ItemStack)) { - Block var12 = Block.blocksList[this.spawnID]; -- int var13 = var12.onBlockPlaced(var3, var4, var5, var6, var7, var8, var9, var10, 0); -- if(var3.setBlock(var4, var5, var6, this.spawnID, var13, 3)) { -- if(var3.getBlockId(var4, var5, var6) == this.spawnID) { -- Block.blocksList[this.spawnID].onBlockPlacedBy(var3, var4, var5, var6, var2, var1); -- Block.blocksList[this.spawnID].onPostBlockPlaced(var3, var4, var5, var6, var13); -+ int var13 = var12.onBlockPlaced(par3World, par4, par5, par6, par7, par8, par9, par10, 0); -+ -+ if (par3World.setBlock(par4, par5, par6, this.spawnID, var13, 3)) { -+ if (par3World.getBlockId(par4, par5, par6) == this.spawnID) { -+ Block.blocksList[this.spawnID].onBlockPlacedBy(par3World, par4, par5, par6, par2EntityPlayer, par1ItemStack); -+ Block.blocksList[this.spawnID].onPostBlockPlaced(par3World, par4, par5, par6, var13); - } - -- var3.playSoundEffect((double)((float)var4 + 0.5F), (double)((float)var5 + 0.5F), (double)((float)var6 + 0.5F), var12.stepSound.getPlaceSound(), (var12.stepSound.getVolume() + 1.0F) / 2.0F, var12.stepSound.getPitch() * 0.8F); -- --var1.stackSize; -+ par3World.playSoundEffect((double)((float)par4 + 0.5F), (double)((float)par5 + 0.5F), (double)((float)par6 + 0.5F), var12.stepSound.getPlaceSound(), (var12.stepSound.getVolume() + 1.0F) / 2.0F, var12.stepSound.getPitch() * 0.8F); -+ --par1ItemStack.stackSize; - } - } - ---- net/minecraft/src/GuiScreenSelectLocation.java -+++ net/minecraft/src/GuiScreenSelectLocation.java -@@ -25,30 +25,39 @@ - private boolean field_104108_s; - private int field_104107_t; - -- public GuiScreenSelectLocation(Minecraft var1, int var2, int var3, int var4, int var5, int var6) { -- this.field_104092_f = var1; -- this.field_104093_g = var2; -- this.field_104105_h = var3; -- this.field_104098_a = var4; -- this.field_104096_b = var5; -- this.field_104097_c = var6; -- this.field_104103_j = 0; -- this.field_104106_i = var2; -- } -- -- public void func_104084_a(int var1, int var2, int var3, int var4) { -- this.field_104093_g = var1; -- this.field_104105_h = var2; -- this.field_104098_a = var3; -- this.field_104096_b = var4; -- this.field_104103_j = 0; -- this.field_104106_i = var1; -- } -- -+ public GuiScreenSelectLocation(Minecraft par1Minecraft, int par2, int par3, int par4, int par5, int par6) { -+ this.field_104092_f = par1Minecraft; -+ this.field_104093_g = par2; -+ this.field_104105_h = par3; -+ this.field_104098_a = par4; -+ this.field_104096_b = par5; -+ this.field_104097_c = par6; -+ this.field_104103_j = 0; -+ this.field_104106_i = par2; -+ } -+ -+ public void func_104084_a(int par1, int par2, int par3, int par4) { -+ this.field_104093_g = par1; -+ this.field_104105_h = par2; -+ this.field_104098_a = par3; -+ this.field_104096_b = par4; -+ this.field_104103_j = 0; -+ this.field_104106_i = par1; -+ } -+ -+ /** -+ * Gets the size of the current slot list. -+ */ - protected abstract int getSize(); - -+ /** -+ * the element in the slot that was clicked, boolean for wether it was double clicked or not -+ */ - protected abstract void elementClicked(int var1, boolean var2); - -+ /** -+ * returns true if the element passed in is currently selected -+ */ - protected abstract boolean isSelected(int var1); - - protected abstract boolean func_104086_b(int var1); -@@ -61,53 +70,55 @@ - - protected abstract void drawSlot(int var1, int var2, int var3, int var4, Tessellator var5); - -- protected void func_104088_a(int var1, int var2, Tessellator var3) { -- } -- -- protected void func_104089_a(int var1, int var2) { -- } -- -- protected void func_104087_b(int var1, int var2) { -- } -+ protected void func_104088_a(int par1, int par2, Tessellator par3Tessellator) {} -+ -+ protected void func_104089_a(int par1, int par2) {} -+ -+ protected void func_104087_b(int par1, int par2) {} - - private void func_104091_h() { - int var1 = this.func_104085_d(); -- if(var1 < 0) { -+ -+ if (var1 < 0) { - var1 /= 2; - } - -- if(this.field_104100_o < 0.0F) { -+ if (this.field_104100_o < 0.0F) { - this.field_104100_o = 0.0F; - } - -- if(this.field_104100_o > (float)var1) { -+ if (this.field_104100_o > (float)var1) { - this.field_104100_o = (float)var1; - } -- - } - - public int func_104085_d() { - return this.func_130003_b() - (this.field_104096_b - this.field_104098_a - 4); - } - -- public void actionPerformed(GuiButton var1) { -- if(var1.enabled) { -- if(var1.id == this.field_104104_k) { -+ /** -+ * Fired when a control is clicked. This is the equivalent of ActionListener.actionPerformed(ActionEvent e). -+ */ -+ public void actionPerformed(GuiButton par1GuiButton) { -+ if (par1GuiButton.enabled) { -+ if (par1GuiButton.id == this.field_104104_k) { - this.field_104100_o -= (float)(this.field_104097_c * 2 / 3); - this.field_104102_m = -2.0F; - this.func_104091_h(); -- } else if(var1.id == this.field_104101_l) { -+ } else if (par1GuiButton.id == this.field_104101_l) { - this.field_104100_o += (float)(this.field_104097_c * 2 / 3); - this.field_104102_m = -2.0F; - this.func_104091_h(); - } -- - } - } - -- public void drawScreen(int var1, int var2, float var3) { -- this.field_104094_d = var1; -- this.field_104095_e = var2; -+ /** -+ * Draws the screen and all the components in it. -+ */ -+ public void drawScreen(int par1, int par2, float par3) { -+ this.field_104094_d = par1; -+ this.field_104095_e = par2; - this.func_130004_c(); - int var4 = this.getSize(); - int var5 = this.func_104090_g(); -@@ -117,37 +128,42 @@ - int var11; - int var13; - int var20; -- if(Mouse.isButtonDown(0)) { -- if(this.field_104102_m == -1.0F) { -- boolean var16 = true; -- if(var2 >= this.field_104098_a && var2 <= this.field_104096_b) { -+ -+ if (Mouse.isButtonDown(0)) { -+ if (this.field_104102_m == -1.0F) { -+ boolean var7 = true; -+ -+ if (par2 >= this.field_104098_a && par2 <= this.field_104096_b) { - int var8 = this.field_104093_g / 2 - 110; - var9 = this.field_104093_g / 2 + 110; -- var10 = var2 - this.field_104098_a - this.field_104107_t + (int)this.field_104100_o - 4; -+ var10 = par2 - this.field_104098_a - this.field_104107_t + (int)this.field_104100_o - 4; - var11 = var10 / this.field_104097_c; -- if(var1 >= var8 && var1 <= var9 && var11 >= 0 && var10 >= 0 && var11 < var4) { -+ -+ if (par1 >= var8 && par1 <= var9 && var11 >= 0 && var10 >= 0 && var11 < var4) { - boolean var12 = var11 == this.field_104111_p && Minecraft.getSystemTime() - this.field_104110_q < 250L; - this.elementClicked(var11, var12); - this.field_104111_p = var11; - this.field_104110_q = Minecraft.getSystemTime(); -- } else if(var1 >= var8 && var1 <= var9 && var10 < 0) { -- this.func_104089_a(var1 - var8, var2 - this.field_104098_a + (int)this.field_104100_o - 4); -- var16 = false; -+ } else if (par1 >= var8 && par1 <= var9 && var10 < 0) { -+ this.func_104089_a(par1 - var8, par2 - this.field_104098_a + (int)this.field_104100_o - 4); -+ var7 = false; - } - -- if(var1 >= var5 && var1 <= var6) { -+ if (par1 >= var5 && par1 <= var6) { - this.field_104099_n = -1.0F; - var20 = this.func_104085_d(); -- if(var20 < 1) { -+ -+ if (var20 < 1) { - var20 = 1; - } - - var13 = (int)((float)((this.field_104096_b - this.field_104098_a) * (this.field_104096_b - this.field_104098_a)) / (float)this.func_130003_b()); -- if(var13 < 32) { -+ -+ if (var13 < 32) { - var13 = 32; - } - -- if(var13 > this.field_104096_b - this.field_104098_a - 8) { -+ if (var13 > this.field_104096_b - this.field_104098_a - 8) { - var13 = this.field_104096_b - this.field_104098_a - 8; - } - -@@ -156,36 +172,34 @@ - this.field_104099_n = 1.0F; - } - -- if(var16) { -- this.field_104102_m = (float)var2; -+ if (var7) { -+ this.field_104102_m = (float)par2; - } else { - this.field_104102_m = -2.0F; - } - } else { - this.field_104102_m = -2.0F; - } -- } else if(this.field_104102_m >= 0.0F) { -- this.field_104100_o -= ((float)var2 - this.field_104102_m) * this.field_104099_n; -- this.field_104102_m = (float)var2; -+ } else if (this.field_104102_m >= 0.0F) { -+ this.field_104100_o -= ((float)par2 - this.field_104102_m) * this.field_104099_n; -+ this.field_104102_m = (float)par2; - } - } else { -- while(true) { -- if(this.field_104092_f.gameSettings.touchscreen || !Mouse.next()) { -- this.field_104102_m = -1.0F; -- break; -- } -+ while (!this.field_104092_f.gameSettings.touchscreen && Mouse.next()) { -+ int var16 = Mouse.getEventDWheel(); - -- int var7 = Mouse.getEventDWheel(); -- if(var7 != 0) { -- if(var7 > 0) { -- var7 = -1; -- } else if(var7 < 0) { -- var7 = 1; -+ if (var16 != 0) { -+ if (var16 > 0) { -+ var16 = -1; -+ } else if (var16 < 0) { -+ var16 = 1; - } - -- this.field_104100_o += (float)(var7 * this.field_104097_c / 2); -+ this.field_104100_o += (float)(var16 * this.field_104097_c / 2); - } - } -+ -+ this.field_104102_m = -1.0F; - } - - this.func_104091_h(); -@@ -204,17 +218,21 @@ - var18.draw(); - var9 = this.field_104093_g / 2 - 92 - 16; - var10 = this.field_104098_a + 4 - (int)this.field_104100_o; -- if(this.field_104108_s) { -+ -+ if (this.field_104108_s) { - this.func_104088_a(var9, var10, var18); - } - - int var14; -- for(var11 = 0; var11 < var4; ++var11) { -+ -+ for (var11 = 0; var11 < var4; ++var11) { - var20 = var10 + var11 * this.field_104097_c + this.field_104107_t; - var13 = this.field_104097_c - 4; -- if(var20 <= this.field_104096_b && var20 + var13 >= this.field_104098_a) { -+ -+ if (var20 <= this.field_104096_b && var20 + var13 >= this.field_104098_a) { - int var15; -- if(this.field_104109_r && this.func_104086_b(var11)) { -+ -+ if (this.field_104109_r && this.func_104086_b(var11)) { - var14 = this.field_104093_g / 2 - 110; - var15 = this.field_104093_g / 2 + 110; - GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); -@@ -229,7 +247,7 @@ - GL11.glEnable(GL11.GL_TEXTURE_2D); - } - -- if(this.field_104109_r && this.isSelected(var11)) { -+ if (this.field_104109_r && this.isSelected(var11)) { - var14 = this.field_104093_g / 2 - 110; - var15 = this.field_104093_g / 2 + 110; - GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); -@@ -279,18 +297,21 @@ - var18.addVertexWithUV((double)this.field_104103_j, (double)(this.field_104096_b - var19), 0.0D, 0.0D, 0.0D); - var18.draw(); - var20 = this.func_104085_d(); -- if(var20 > 0) { -+ -+ if (var20 > 0) { - var13 = (this.field_104096_b - this.field_104098_a) * (this.field_104096_b - this.field_104098_a) / this.func_130003_b(); -- if(var13 < 32) { -+ -+ if (var13 < 32) { - var13 = 32; - } - -- if(var13 > this.field_104096_b - this.field_104098_a - 8) { -+ if (var13 > this.field_104096_b - this.field_104098_a - 8) { - var13 = this.field_104096_b - this.field_104098_a - 8; - } - - var14 = (int)this.field_104100_o * (this.field_104096_b - this.field_104098_a - var13) / var20 + this.field_104098_a; -- if(var14 < this.field_104098_a) { -+ -+ if (var14 < this.field_104098_a) { - var14 = this.field_104098_a; - } - -@@ -317,7 +338,7 @@ - var18.draw(); - } - -- this.func_104087_b(var1, var2); -+ this.func_104087_b(par1, par2); - GL11.glEnable(GL11.GL_TEXTURE_2D); - GL11.glShadeModel(GL11.GL_FLAT); - GL11.glEnable(GL11.GL_ALPHA_TEST); -@@ -328,18 +349,18 @@ - return this.field_104093_g / 2 + 124; - } - -- private void func_104083_b(int var1, int var2, int var3, int var4) { -+ private void func_104083_b(int par1, int par2, int par3, int par4) { - Tessellator var5 = Tessellator.instance; - this.field_104092_f.getTextureManager().bindTexture(Gui.optionsBackground); - GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - float var6 = 32.0F; - var5.startDrawingQuads(); -- var5.setColorRGBA_I(4210752, var4); -- var5.addVertexWithUV(0.0D, (double)var2, 0.0D, 0.0D, (double)((float)var2 / var6)); -- var5.addVertexWithUV((double)this.field_104093_g, (double)var2, 0.0D, (double)((float)this.field_104093_g / var6), (double)((float)var2 / var6)); -- var5.setColorRGBA_I(4210752, var3); -- var5.addVertexWithUV((double)this.field_104093_g, (double)var1, 0.0D, (double)((float)this.field_104093_g / var6), (double)((float)var1 / var6)); -- var5.addVertexWithUV(0.0D, (double)var1, 0.0D, 0.0D, (double)((float)var1 / var6)); -+ var5.setColorRGBA_I(4210752, par4); -+ var5.addVertexWithUV(0.0D, (double)par2, 0.0D, 0.0D, (double)((float)par2 / var6)); -+ var5.addVertexWithUV((double)this.field_104093_g, (double)par2, 0.0D, (double)((float)this.field_104093_g / var6), (double)((float)par2 / var6)); -+ var5.setColorRGBA_I(4210752, par3); -+ var5.addVertexWithUV((double)this.field_104093_g, (double)par1, 0.0D, (double)((float)this.field_104093_g / var6), (double)((float)par1 / var6)); -+ var5.addVertexWithUV(0.0D, (double)par1, 0.0D, 0.0D, (double)((float)par1 / var6)); - var5.draw(); - } - } ---- net/minecraft/src/ItemBucket.java -+++ net/minecraft/src/ItemBucket.java -@@ -1,131 +1,144 @@ - package net.minecraft.src; - - public class ItemBucket extends Item { -+ -+ /** field for checking if the bucket has been filled. */ - private int isFull; - -- public ItemBucket(int var1, int var2) { -- super(var1); -+ public ItemBucket(int par1, int par2) { -+ super(par1); - this.maxStackSize = 1; -- this.isFull = var2; -+ this.isFull = par2; - this.setCreativeTab(CreativeTabs.tabMisc); - } - -- public ItemStack onItemRightClick(ItemStack var1, World var2, EntityPlayer var3) { -+ /** -+ * Called whenever this item is equipped and the right mouse button is pressed. Args: itemStack, world, entityPlayer -+ */ -+ public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) { - boolean var4 = this.isFull == 0; -- MovingObjectPosition var5 = this.getMovingObjectPositionFromPlayer(var2, var3, var4); -- if(var5 == null) { -- return var1; -+ MovingObjectPosition var5 = this.getMovingObjectPositionFromPlayer(par2World, par3EntityPlayer, var4); -+ -+ if (var5 == null) { -+ return par1ItemStack; - } else { -- if(var5.typeOfHit == EnumMovingObjectType.TILE) { -+ if (var5.typeOfHit == EnumMovingObjectType.TILE) { - int var6 = var5.blockX; - int var7 = var5.blockY; - int var8 = var5.blockZ; -- if(!var2.canMineBlock(var3, var6, var7, var8)) { -- return var1; -+ -+ if (!par2World.canMineBlock(par3EntityPlayer, var6, var7, var8)) { -+ return par1ItemStack; - } - -- if(this.isFull == 0) { -- if(!var3.canPlayerEdit(var6, var7, var8, var5.sideHit, var1)) { -- return var1; -+ if (this.isFull == 0) { -+ if (!par3EntityPlayer.canPlayerEdit(var6, var7, var8, var5.sideHit, par1ItemStack)) { -+ return par1ItemStack; - } - -- if(var2.getBlockMaterial(var6, var7, var8) == Material.water && var2.getBlockMetadata(var6, var7, var8) == 0) { -- var2.setBlockToAir(var6, var7, var8); -- if(var3.capabilities.isCreativeMode) { -- return var1; -+ if (par2World.getBlockMaterial(var6, var7, var8) == Material.water && par2World.getBlockMetadata(var6, var7, var8) == 0) { -+ par2World.setBlockToAir(var6, var7, var8); -+ -+ if (par3EntityPlayer.capabilities.isCreativeMode) { -+ return par1ItemStack; - } - -- if(--var1.stackSize <= 0) { -+ if (--par1ItemStack.stackSize <= 0) { - return new ItemStack(Item.bucketWater); - } - -- if(!var3.inventory.addItemStackToInventory(new ItemStack(Item.bucketWater))) { -- var3.dropPlayerItem(new ItemStack(Item.bucketWater.itemID, 1, 0)); -+ if (!par3EntityPlayer.inventory.addItemStackToInventory(new ItemStack(Item.bucketWater))) { -+ par3EntityPlayer.dropPlayerItem(new ItemStack(Item.bucketWater.itemID, 1, 0)); - } - -- return var1; -+ return par1ItemStack; - } - -- if(var2.getBlockMaterial(var6, var7, var8) == Material.lava && var2.getBlockMetadata(var6, var7, var8) == 0) { -- var2.setBlockToAir(var6, var7, var8); -- if(var3.capabilities.isCreativeMode) { -- return var1; -+ if (par2World.getBlockMaterial(var6, var7, var8) == Material.lava && par2World.getBlockMetadata(var6, var7, var8) == 0) { -+ par2World.setBlockToAir(var6, var7, var8); -+ -+ if (par3EntityPlayer.capabilities.isCreativeMode) { -+ return par1ItemStack; - } - -- if(--var1.stackSize <= 0) { -+ if (--par1ItemStack.stackSize <= 0) { - return new ItemStack(Item.bucketLava); - } - -- if(!var3.inventory.addItemStackToInventory(new ItemStack(Item.bucketLava))) { -- var3.dropPlayerItem(new ItemStack(Item.bucketLava.itemID, 1, 0)); -+ if (!par3EntityPlayer.inventory.addItemStackToInventory(new ItemStack(Item.bucketLava))) { -+ par3EntityPlayer.dropPlayerItem(new ItemStack(Item.bucketLava.itemID, 1, 0)); - } - -- return var1; -+ return par1ItemStack; - } - } else { -- if(this.isFull < 0) { -+ if (this.isFull < 0) { - return new ItemStack(Item.bucketEmpty); - } - -- if(var5.sideHit == 0) { -+ if (var5.sideHit == 0) { - --var7; - } - -- if(var5.sideHit == 1) { -+ if (var5.sideHit == 1) { - ++var7; - } - -- if(var5.sideHit == 2) { -+ if (var5.sideHit == 2) { - --var8; - } - -- if(var5.sideHit == 3) { -+ if (var5.sideHit == 3) { - ++var8; - } - -- if(var5.sideHit == 4) { -+ if (var5.sideHit == 4) { - --var6; - } - -- if(var5.sideHit == 5) { -+ if (var5.sideHit == 5) { - ++var6; - } - -- if(!var3.canPlayerEdit(var6, var7, var8, var5.sideHit, var1)) { -- return var1; -+ if (!par3EntityPlayer.canPlayerEdit(var6, var7, var8, var5.sideHit, par1ItemStack)) { -+ return par1ItemStack; - } - -- if(this.tryPlaceContainedLiquid(var2, var6, var7, var8) && !var3.capabilities.isCreativeMode) { -+ if (this.tryPlaceContainedLiquid(par2World, var6, var7, var8) && !par3EntityPlayer.capabilities.isCreativeMode) { - return new ItemStack(Item.bucketEmpty); - } - } - } - -- return var1; -+ return par1ItemStack; - } - } - -- public boolean tryPlaceContainedLiquid(World var1, int var2, int var3, int var4) { -- if(this.isFull <= 0) { -+ /** -+ * Attempts to place the liquid contained inside the bucket. -+ */ -+ public boolean tryPlaceContainedLiquid(World par1World, int par2, int par3, int par4) { -+ if (this.isFull <= 0) { - return false; - } else { -- Material var5 = var1.getBlockMaterial(var2, var3, var4); -+ Material var5 = par1World.getBlockMaterial(par2, par3, par4); - boolean var6 = !var5.isSolid(); -- if(!var1.isAirBlock(var2, var3, var4) && !var6) { -+ -+ if (!par1World.isAirBlock(par2, par3, par4) && !var6) { - return false; - } else { -- if(var1.provider.isHellWorld && this.isFull == Block.waterMoving.blockID) { -- var1.playSoundEffect((double)((float)var2 + 0.5F), (double)((float)var3 + 0.5F), (double)((float)var4 + 0.5F), "random.fizz", 0.5F, 2.6F + (var1.s.nextFloat() - var1.s.nextFloat()) * 0.8F); -+ if (par1World.provider.isHellWorld && this.isFull == Block.waterMoving.blockID) { -+ par1World.playSoundEffect((double)((float)par2 + 0.5F), (double)((float)par3 + 0.5F), (double)((float)par4 + 0.5F), "random.fizz", 0.5F, 2.6F + (par1World.rand.nextFloat() - par1World.rand.nextFloat()) * 0.8F); - -- for(int var7 = 0; var7 < 8; ++var7) { -- var1.spawnParticle("largesmoke", (double)var2 + Math.random(), (double)var3 + Math.random(), (double)var4 + Math.random(), 0.0D, 0.0D, 0.0D); -+ for (int var7 = 0; var7 < 8; ++var7) { -+ par1World.spawnParticle("largesmoke", (double)par2 + Math.random(), (double)par3 + Math.random(), (double)par4 + Math.random(), 0.0D, 0.0D, 0.0D); - } - } else { -- if(!var1.isRemote && var6 && !var5.isLiquid()) { -- var1.destroyBlock(var2, var3, var4, true); -+ if (!par1World.isRemote && var6 && !var5.isLiquid()) { -+ par1World.destroyBlock(par2, par3, par4, true); - } - -- var1.setBlock(var2, var3, var4, this.isFull, 0, 3); -+ par1World.setBlock(par2, par3, par4, this.isFull, 0, 3); - } - - return true; ---- net/minecraft/src/PackMetadataSectionSerializer.java -+++ net/minecraft/src/PackMetadataSectionSerializer.java -@@ -8,29 +8,32 @@ - import java.lang.reflect.Type; - - public class PackMetadataSectionSerializer extends BaseMetadataSectionSerializer implements JsonSerializer { -- public PackMetadataSection func_110489_a(JsonElement var1, Type var2, JsonDeserializationContext var3) { -- JsonObject var4 = var1.getAsJsonObject(); -+ public PackMetadataSection func_110489_a(JsonElement par1JsonElement, Type par2Type, JsonDeserializationContext par3JsonDeserializationContext) { -+ JsonObject var4 = par1JsonElement.getAsJsonObject(); - String var5 = this.func_110486_a(var4.get("description"), "description", (String)null, 1, Integer.MAX_VALUE); - int var6 = this.func_110485_a(var4.get("pack_format"), "pack_format", (Integer)null, 1, Integer.MAX_VALUE); - return new PackMetadataSection(var5, var6); - } - -- public JsonElement func_110488_a(PackMetadataSection var1, Type var2, JsonSerializationContext var3) { -+ public JsonElement func_110488_a(PackMetadataSection par1PackMetadataSection, Type par2Type, JsonSerializationContext par3JsonSerializationContext) { - JsonObject var4 = new JsonObject(); -- var4.addProperty("pack_format", (Number)Integer.valueOf(var1.getPackFormat())); -- var4.addProperty("description", var1.getPackDescription()); -+ var4.addProperty("pack_format", Integer.valueOf(par1PackMetadataSection.getPackFormat())); -+ var4.addProperty("description", par1PackMetadataSection.getPackDescription()); - return var4; - } - -+ /** -+ * The name of this section type as it appears in JSON. -+ */ - public String getSectionName() { - return "pack"; - } - -- public Object deserialize(JsonElement var1, Type var2, JsonDeserializationContext var3) { -- return this.func_110489_a(var1, var2, var3); -+ public Object deserialize(JsonElement par1JsonElement, Type par2Type, JsonDeserializationContext par3JsonDeserializationContext) { -+ return this.func_110489_a(par1JsonElement, par2Type, par3JsonDeserializationContext); - } - -- public JsonElement serialize(Object var1, Type var2, JsonSerializationContext var3) { -- return this.func_110488_a((PackMetadataSection)var1, var2, var3); -+ public JsonElement serialize(Object par1Obj, Type par2Type, JsonSerializationContext par3JsonSerializationContext) { -+ return this.func_110488_a((PackMetadataSection)par1Obj, par2Type, par3JsonSerializationContext); - } - } ---- /dev/null -+++ org/spoutcraft/api/animation/InQuadAnimationProgress.java -@@ -1,0 +1,36 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.api.animation; -+ -+public class InQuadAnimationProgress implements AnimationProgress { -+ private int strength; -+ -+ public InQuadAnimationProgress() { -+ this(2); -+ } -+ -+ public InQuadAnimationProgress(int strength) { -+ this.strength = strength; -+ } -+ -+ public double getValueAt(double progress) { -+ return Math.pow(progress, strength); -+ } -+} ---- net/minecraft/src/CallableClientMemoryStats.java -+++ net/minecraft/src/CallableClientMemoryStats.java -@@ -5,8 +5,8 @@ - class CallableClientMemoryStats implements Callable { - final Minecraft theMinecraft; - -- CallableClientMemoryStats(Minecraft var1) { -- this.theMinecraft = var1; -+ CallableClientMemoryStats(Minecraft par1Minecraft) { -+ this.theMinecraft = par1Minecraft; - } - - public String callClientMemoryStats() { ---- net/minecraft/src/EnchantmentFireAspect.java -+++ net/minecraft/src/EnchantmentFireAspect.java -@@ -1,19 +1,28 @@ - package net.minecraft.src; - - public class EnchantmentFireAspect extends Enchantment { -- protected EnchantmentFireAspect(int var1, int var2) { -- super(var1, var2, EnumEnchantmentType.weapon); -+ protected EnchantmentFireAspect(int par1, int par2) { -+ super(par1, par2, EnumEnchantmentType.weapon); - this.setName("fire"); - } - -- public int getMinEnchantability(int var1) { -- return 10 + 20 * (var1 - 1); -- } -- -- public int getMaxEnchantability(int var1) { -- return super.getMinEnchantability(var1) + 50; -- } -- -+ /** -+ * Returns the minimal value of enchantability needed on the enchantment level passed. -+ */ -+ public int getMinEnchantability(int par1) { -+ return 10 + 20 * (par1 - 1); -+ } -+ -+ /** -+ * Returns the maximum value of enchantability nedded on the enchantment level passed. -+ */ -+ public int getMaxEnchantability(int par1) { -+ return super.getMinEnchantability(par1) + 50; -+ } -+ -+ /** -+ * Returns the maximum level that the enchantment can have. -+ */ - public int getMaxLevel() { - return 2; - } ---- net/minecraft/src/IBehaviorDispenseItem.java -+++ net/minecraft/src/IBehaviorDispenseItem.java -@@ -3,5 +3,8 @@ - public interface IBehaviorDispenseItem { - IBehaviorDispenseItem itemDispenseBehaviorProvider = new BehaviorDispenseItemProvider(); - -+ /** -+ * Dispenses the specified ItemStack from a dispenser. -+ */ - ItemStack dispense(IBlockSource var1, ItemStack var2); - } ---- /dev/null -+++ org/spoutcraft/client/util/MapEntry.java -@@ -1,0 +1,46 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.client.util; -+ -+import java.util.Map; -+ -+class MapEntry implements Map.Entry { -+ final private K key; -+ private V value; -+ -+ MapEntry(K key, V value) { -+ this.key = key; -+ this.value = value; -+ } -+ -+ public K getKey() { -+ return key; -+ } -+ -+ public V getValue() { -+ return value; -+ } -+ -+ public V setValue(V value) { -+ V old = this.value; -+ this.value = value; -+ return old; -+ } -+} ---- net/minecraft/src/IntHashMapEntry.java -+++ net/minecraft/src/IntHashMapEntry.java -@@ -1,37 +1,53 @@ - package net.minecraft.src; - - class IntHashMapEntry { -+ -+ /** The hash code of this entry */ - final int hashEntry; -- Object b; -+ -+ /** The object stored in this entry */ -+ Object valueEntry; -+ -+ /** The next entry in this slot */ - IntHashMapEntry nextEntry; -+ -+ /** The id of the hash slot computed from the hash */ - final int slotHash; - -- IntHashMapEntry(int var1, int var2, Object var3, IntHashMapEntry var4) { -- this.b = var3; -- this.nextEntry = var4; -- this.hashEntry = var2; -- this.slotHash = var1; -+ IntHashMapEntry(int par1, int par2, Object par3Obj, IntHashMapEntry par4IntHashMapEntry) { -+ this.valueEntry = par3Obj; -+ this.nextEntry = par4IntHashMapEntry; -+ this.hashEntry = par2; -+ this.slotHash = par1; - } - -+ /** -+ * Returns the hash code for this entry -+ */ - public final int getHash() { - return this.hashEntry; - } - -+ /** -+ * Returns the object stored in this entry -+ */ - public final Object getValue() { -- return this.b; -+ return this.valueEntry; - } - -- public final boolean equals(Object var1) { -- if(!(var1 instanceof IntHashMapEntry)) { -+ public final boolean equals(Object par1Obj) { -+ if (!(par1Obj instanceof IntHashMapEntry)) { - return false; - } else { -- IntHashMapEntry var2 = (IntHashMapEntry)var1; -+ IntHashMapEntry var2 = (IntHashMapEntry)par1Obj; - Integer var3 = Integer.valueOf(this.getHash()); - Integer var4 = Integer.valueOf(var2.getHash()); -- if(var3 == var4 || var3 != null && var3.equals(var4)) { -+ -+ if (var3 == var4 || var3 != null && var3.equals(var4)) { - Object var5 = this.getValue(); - Object var6 = var2.getValue(); -- if(var5 == var6 || var5 != null && var5.equals(var6)) { -+ -+ if (var5 == var6 || var5 != null && var5.equals(var6)) { - return true; - } - } ---- /dev/null -+++ org/spoutcraft/client/gui/RenderItemCustom.java -@@ -1,0 +1,64 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.client.gui; -+ -+import net.minecraft.src.Icon; -+import net.minecraft.src.RenderItem; -+import net.minecraft.src.Tessellator; -+ -+public class RenderItemCustom extends RenderItem { -+ private double width, height, depth; -+ -+ public RenderItemCustom() { -+ super(); -+ width = height = depth = 1; -+ } -+ public void setScale(double width, double height, double depth) { -+ this.width = width; -+ this.height = height; -+ this.depth = depth; -+ } -+ -+ @Override -+ public void renderIcon(int par1, int par2, Icon par3Icon, int par4, int par5) { -+ Tessellator var6 = Tessellator.instance; -+ var6.startDrawingQuads(); -+ var6.addVertexWithUV((double)(par1 + 0), (double)(par2 + par5) * height, (double)this.zLevel, (double)par3Icon.getMinU(), (double)par3Icon.getMaxV()); -+ var6.addVertexWithUV((double)(par1 + par4) * height, (double)(par2 + par5), (double)this.zLevel, (double)par3Icon.getMaxU(), (double)par3Icon.getMaxV()); -+ var6.addVertexWithUV((double)(par1 + par4) * height, (double)(par2 + 0), (double)this.zLevel, (double)par3Icon.getMaxU(), (double)par3Icon.getMinV()); -+ var6.addVertexWithUV((double)(par1 + 0), (double)(par2 + 0), (double)this.zLevel, (double)par3Icon.getMinU(), (double)par3Icon.getMinV()); -+ var6.draw(); -+ } -+ -+ /* -+ public void renderTexturedQuads(int var1, int var2, int var3, int var4, int var5, int var6) { -+ float var7 = 0.0F; -+ float var8 = 0.00390625F; -+ float var9 = 0.00390625F; -+ Tessellator var10 = Tessellator.instance; -+ var10.startDrawingQuads(); -+ var10.addVertexWithUV(var1, (var2 + var6) * height, var7, (float)(var3 * var8), (float)((var4 + var6) * var9)); -+ var10.addVertexWithUV((var1 + var5) * height, (var2 + var6) * width, var7, (float)((var3 + var5) * var8), (float)((var4 + var6) * var9)); -+ var10.addVertexWithUV((var1 + var5) * height, var2, var7, (float)((var3 + var5) * var8), (float)(var4* var9)); -+ var10.addVertexWithUV(var1, var2, var7, (float)(var3 * var8), (float)(var4 * var9)); -+ var10.draw(); -+ } -+ */ -+} ---- net/minecraft/src/EntityMinecartEmpty.java -+++ net/minecraft/src/EntityMinecartEmpty.java -@@ -1,22 +1,25 @@ - package net.minecraft.src; - - public class EntityMinecartEmpty extends EntityMinecart { -- public EntityMinecartEmpty(World var1) { -- super(var1); -- } -- -- public EntityMinecartEmpty(World var1, double var2, double var4, double var6) { -- super(var1, var2, var4, var6); -- } -- -- public boolean interactFirst(EntityPlayer var1) { -- if(this.riddenByEntity != null && this.riddenByEntity instanceof EntityPlayer && this.riddenByEntity != var1) { -+ public EntityMinecartEmpty(World par1World) { -+ super(par1World); -+ } -+ -+ public EntityMinecartEmpty(World par1World, double par2, double par4, double par6) { -+ super(par1World, par2, par4, par6); -+ } -+ -+ /** -+ * First layer of player interaction -+ */ -+ public boolean interactFirst(EntityPlayer par1EntityPlayer) { -+ if (this.riddenByEntity != null && this.riddenByEntity instanceof EntityPlayer && this.riddenByEntity != par1EntityPlayer) { - return true; -- } else if(this.riddenByEntity != null && this.riddenByEntity != var1) { -+ } else if (this.riddenByEntity != null && this.riddenByEntity != par1EntityPlayer) { - return false; - } else { -- if(!this.worldObj.isRemote) { -- var1.mountEntity(this); -+ if (!this.worldObj.isRemote) { -+ par1EntityPlayer.mountEntity(this); - } - - return true; ---- /dev/null -+++ com/prupe/mcpatcher/Config$ProfileEntry.java -@@ -1,0 +1,26 @@ -+package com.prupe.mcpatcher; -+ -+import com.prupe.mcpatcher.Config$VersionEntry; -+import java.util.LinkedHashMap; -+ -+class Config$ProfileEntry { -+ String original; -+ String version; -+ LinkedHashMap> config = new LinkedHashMap(); -+ LinkedHashMap versions = new LinkedHashMap(); -+ -+ private LinkedHashMap getModConfig(String mod) { -+ LinkedHashMap map = (LinkedHashMap)this.config.get(mod); -+ -+ if (map == null) { -+ map = new LinkedHashMap(); -+ this.config.put(mod, map); -+ } -+ -+ return map; -+ } -+ -+ static LinkedHashMap access$000(Config$ProfileEntry x0, String x1) { -+ return x0.getModConfig(x1); -+ } -+} ---- /dev/null -+++ org/spoutcraft/client/player/SpoutPlayer.java -@@ -1,0 +1,52 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.client.player; -+ -+import net.minecraft.src.Minecraft; -+import net.minecraft.src.EntityPlayer; -+ -+import org.spoutcraft.client.entity.CraftHumanEntity; -+ -+public class SpoutPlayer extends CraftHumanEntity { -+ public SpoutPlayer(net.minecraft.src.EntityPlayer handle) { -+ super(handle); -+ this.handle = handle; -+ } -+ -+ public EntityPlayer getMCPlayer() { -+ return (EntityPlayer)handle; -+ } -+ -+ public void setPlayer(EntityPlayer player) { -+ this.handle = player; -+ } -+ -+ public boolean isOnline() { -+ return Minecraft.getMinecraft().isMultiplayerWorld(); -+ } -+ -+ public boolean isSneaking() { -+ return getMCPlayer().isSneaking(); -+ } -+ -+ public void setSneaking(boolean sneak) { -+ getMCPlayer().setFlag(1, sneak); -+ } -+} ---- net/minecraft/src/CommandWeather.java -+++ net/minecraft/src/CommandWeather.java -@@ -9,49 +9,56 @@ - return "weather"; - } - -+ /** -+ * Return the required permission level for this command. -+ */ - public int getRequiredPermissionLevel() { - return 2; - } - -- public String getCommandUsage(ICommandSender var1) { -+ public String getCommandUsage(ICommandSender par1ICommandSender) { - return "commands.weather.usage"; - } - -- public void processCommand(ICommandSender var1, String[] var2) { -- if(var2.length >= 1 && var2.length <= 2) { -+ public void processCommand(ICommandSender par1ICommandSender, String[] par2ArrayOfStr) { -+ if (par2ArrayOfStr.length >= 1 && par2ArrayOfStr.length <= 2) { - int var3 = (300 + (new Random()).nextInt(600)) * 20; -- if(var2.length >= 2) { -- var3 = parseIntBounded(var1, var2[1], 1, 1000000) * 20; -+ -+ if (par2ArrayOfStr.length >= 2) { -+ var3 = parseIntBounded(par1ICommandSender, par2ArrayOfStr[1], 1, 1000000) * 20; - } - - WorldServer var4 = MinecraftServer.getServer().worldServers[0]; - WorldInfo var5 = var4.getWorldInfo(); - var5.setRainTime(var3); - var5.setThunderTime(var3); -- if("clear".equalsIgnoreCase(var2[0])) { -+ -+ if ("clear".equalsIgnoreCase(par2ArrayOfStr[0])) { - var5.setRaining(false); - var5.setThundering(false); -- notifyAdmins(var1, "commands.weather.clear", new Object[0]); -- } else if("rain".equalsIgnoreCase(var2[0])) { -+ notifyAdmins(par1ICommandSender, "commands.weather.clear", new Object[0]); -+ } else if ("rain".equalsIgnoreCase(par2ArrayOfStr[0])) { - var5.setRaining(true); - var5.setThundering(false); -- notifyAdmins(var1, "commands.weather.rain", new Object[0]); -+ notifyAdmins(par1ICommandSender, "commands.weather.rain", new Object[0]); - } else { -- if(!"thunder".equalsIgnoreCase(var2[0])) { -+ if (!"thunder".equalsIgnoreCase(par2ArrayOfStr[0])) { - throw new WrongUsageException("commands.weather.usage", new Object[0]); - } - - var5.setRaining(true); - var5.setThundering(true); -- notifyAdmins(var1, "commands.weather.thunder", new Object[0]); -+ notifyAdmins(par1ICommandSender, "commands.weather.thunder", new Object[0]); - } -- - } else { - throw new WrongUsageException("commands.weather.usage", new Object[0]); - } - } - -- public List addTabCompletionOptions(ICommandSender var1, String[] var2) { -- return var2.length == 1 ? getListOfStringsMatchingLastWord(var2, new String[]{"clear", "rain", "thunder"}) : null; -+ /** -+ * Adds the strings available in this command to the given list of tab completion options. -+ */ -+ public List addTabCompletionOptions(ICommandSender par1ICommandSender, String[] par2ArrayOfStr) { -+ return par2ArrayOfStr.length == 1 ? getListOfStringsMatchingLastWord(par2ArrayOfStr, new String[] {"clear", "rain", "thunder"}): null; - } - } ---- net/minecraft/src/TextureUtil.java -+++ net/minecraft/src/TextureUtil.java -@@ -3,12 +3,16 @@ - import java.awt.image.BufferedImage; - import java.io.IOException; - import java.nio.IntBuffer; -+ - import javax.imageio.ImageIO; -+ -+import net.minecraft.src.Minecraft; -+ - import org.lwjgl.opengl.GL11; - import org.lwjgl.opengl.GL12; - - public class TextureUtil { -- private static final IntBuffer c = GLAllocation.createDirectIntBuffer(4194304); -+ private static final IntBuffer dataBuffer = GLAllocation.createDirectIntBuffer(4194304); - public static final DynamicTexture missingTexture = new DynamicTexture(16, 16); - public static final int[] missingTextureData = missingTexture.getTextureData(); - -@@ -16,109 +20,116 @@ - return GL11.glGenTextures(); - } - -- public static int uploadTextureImage(int var0, BufferedImage var1) { -- return uploadTextureImageAllocate(var0, var1, false, false); -- } -- -- public static void uploadTexture(int var0, int[] var1, int var2, int var3) { -- bindTexture(var0); -- uploadTextureSub(var1, var2, var3, 0, 0, false, false); -- } -- -- public static void uploadTextureSub(int[] var0, int var1, int var2, int var3, int var4, boolean var5, boolean var6) { -- int var7 = 4194304 / var1; -- setTextureBlurred(var5); -- setTextureClamped(var6); -- -+ public static int uploadTextureImage(int par0, BufferedImage par1BufferedImage) { -+ return uploadTextureImageAllocate(par0, par1BufferedImage, false, false); -+ } -+ -+ public static void uploadTexture(int par0, int[] par1ArrayOfInteger, int par2, int par3) { -+ bindTexture(par0); -+ uploadTextureSub(par1ArrayOfInteger, par2, par3, 0, 0, false, false); -+ } -+ -+ public static void uploadTextureSub(int[] par0ArrayOfInteger, int par1, int par2, int par3, int par4, boolean par5, boolean par6) { -+ int var7 = 4194304 / par1; -+ setTextureBlurred(par5); -+ setTextureClamped(par6); - int var10; -- for(int var8 = 0; var8 < var1 * var2; var8 += var1 * var10) { -- int var9 = var8 / var1; -- var10 = Math.min(var7, var2 - var9); -- int var11 = var1 * var10; -- copyToBufferPos(var0, var8, var11); -- GL11.glTexSubImage2D(GL11.GL_TEXTURE_2D, 0, var3, var4 + var9, var1, var10, GL12.GL_BGRA, GL12.GL_UNSIGNED_INT_8_8_8_8_REV, (IntBuffer)c); -+ -+ for (int var8 = 0; var8 < par1 * par2; var8 += par1 * var10) { -+ int var9 = var8 / par1; -+ var10 = Math.min(var7, par2 - var9); -+ int var11 = par1 * var10; -+ copyToBufferPos(par0ArrayOfInteger, var8, var11); -+ GL11.glTexSubImage2D(GL11.GL_TEXTURE_2D, 0, par3, par4 + var9, par1, var10, GL12.GL_BGRA, GL12.GL_UNSIGNED_INT_8_8_8_8_REV, dataBuffer); - } -- -- } -- -- public static int uploadTextureImageAllocate(int var0, BufferedImage var1, boolean var2, boolean var3) { -- allocateTexture(var0, var1.getWidth(), var1.getHeight()); -- return uploadTextureImageSub(var0, var1, 0, 0, var2, var3); -- } -- -- public static void allocateTexture(int var0, int var1, int var2) { -- bindTexture(var0); -- GL11.glTexImage2D(GL11.GL_TEXTURE_2D, 0, GL11.GL_RGBA, var1, var2, 0, GL12.GL_BGRA, GL12.GL_UNSIGNED_INT_8_8_8_8_REV, (IntBuffer)((IntBuffer)null)); -- } -- -- public static int uploadTextureImageSub(int var0, BufferedImage var1, int var2, int var3, boolean var4, boolean var5) { -- bindTexture(var0); -- uploadTextureImageSubImpl(var1, var2, var3, var4, var5); -- return var0; -- } -- -- private static void uploadTextureImageSubImpl(BufferedImage var0, int var1, int var2, boolean var3, boolean var4) { -- int var5 = var0.getWidth(); -- int var6 = var0.getHeight(); -+ } -+ // Spout Start -+ public static int allocateAndSetupTexture(BufferedImage par1BufferedImage) { -+ int var2 = GL11.glGenTextures(); -+ uploadTextureImageAllocate(var2, par1BufferedImage, false, false); -+ return var2; -+ } -+ // Spout End -+ -+ public static int uploadTextureImageAllocate(int par0, BufferedImage par1BufferedImage, boolean par2, boolean par3) { -+ allocateTexture(par0, par1BufferedImage.getWidth(), par1BufferedImage.getHeight()); -+ return uploadTextureImageSub(par0, par1BufferedImage, 0, 0, par2, par3); -+ } -+ -+ public static void allocateTexture(int par0, int par1, int par2) { -+ bindTexture(par0); -+ GL11.glTexImage2D(GL11.GL_TEXTURE_2D, 0, GL11.GL_RGBA, par1, par2, 0, GL12.GL_BGRA, GL12.GL_UNSIGNED_INT_8_8_8_8_REV, (IntBuffer)null); -+ } -+ -+ public static int uploadTextureImageSub(int par0, BufferedImage par1BufferedImage, int par2, int par3, boolean par4, boolean par5) { -+ bindTexture(par0); -+ uploadTextureImageSubImpl(par1BufferedImage, par2, par3, par4, par5); -+ return par0; -+ } -+ -+ private static void uploadTextureImageSubImpl(BufferedImage par0BufferedImage, int par1, int par2, boolean par3, boolean par4) { -+ int var5 = par0BufferedImage.getWidth(); -+ int var6 = par0BufferedImage.getHeight(); - int var7 = 4194304 / var5; - int[] var8 = new int[var7 * var5]; -- setTextureBlurred(var3); -- setTextureClamped(var4); -+ setTextureBlurred(par3); -+ setTextureClamped(par4); - -- for(int var9 = 0; var9 < var5 * var6; var9 += var5 * var7) { -+ for (int var9 = 0; var9 < var5 * var6; var9 += var5 * var7) { - int var10 = var9 / var5; - int var11 = Math.min(var7, var6 - var10); - int var12 = var5 * var11; -- var0.getRGB(0, var10, var5, var11, var8, 0, var5); -+ par0BufferedImage.getRGB(0, var10, var5, var11, var8, 0, var5); - copyToBuffer(var8, var12); -- GL11.glTexSubImage2D(GL11.GL_TEXTURE_2D, 0, var1, var2 + var10, var5, var11, GL12.GL_BGRA, GL12.GL_UNSIGNED_INT_8_8_8_8_REV, (IntBuffer)c); -+ GL11.glTexSubImage2D(GL11.GL_TEXTURE_2D, 0, par1, par2 + var10, var5, var11, GL12.GL_BGRA, GL12.GL_UNSIGNED_INT_8_8_8_8_REV, dataBuffer); - } -- - } - -- private static void setTextureClamped(boolean var0) { -- if(var0) { -+ private static void setTextureClamped(boolean par0) { -+ if (par0) { - GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_WRAP_S, GL11.GL_CLAMP); - GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_WRAP_T, GL11.GL_CLAMP); - } else { - GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_WRAP_S, GL11.GL_REPEAT); - GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_WRAP_T, GL11.GL_REPEAT); - } -- - } - -- private static void setTextureBlurred(boolean var0) { -- if(var0) { -+ private static void setTextureBlurred(boolean par0) { -+ if (par0) { - GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MIN_FILTER, GL11.GL_LINEAR); - GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MAG_FILTER, GL11.GL_LINEAR); - } else { - GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MIN_FILTER, GL11.GL_NEAREST); - GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MAG_FILTER, GL11.GL_NEAREST); - } -- -- } -- -- private static void copyToBuffer(int[] var0, int var1) { -- copyToBufferPos(var0, 0, var1); -- } -- -- private static void copyToBufferPos(int[] var0, int var1, int var2) { -- int[] var3 = var0; -- if(Minecraft.getMinecraft().gameSettings.anaglyph) { -- var3 = updateAnaglyph(var0); -+ } -+ -+ private static void copyToBuffer(int[] par0ArrayOfInteger, int par1) { -+ copyToBufferPos(par0ArrayOfInteger, 0, par1); -+ } -+ -+ private static void copyToBufferPos(int[] par0ArrayOfInteger, int par1, int par2) { -+ int[] var3 = par0ArrayOfInteger; -+ -+ if (Minecraft.getMinecraft().gameSettings.anaglyph) { -+ var3 = updateAnaglyph(par0ArrayOfInteger); - } - -- c.clear(); -- c.put(var3, var1, var2); -- c.position(0).limit(var2); -- } -- -- static void bindTexture(int var0) { -- GL11.glBindTexture(GL11.GL_TEXTURE_2D, var0); -- } -- -- public static int[] readImageData(ResourceManager var0, ResourceLocation var1) throws IOException { -- BufferedImage var2 = ImageIO.read(var0.getResource(var1).getInputStream()); -+ dataBuffer.clear(); -+ dataBuffer.put(var3, par1, par2); -+ dataBuffer.position(0).limit(par2); -+ } -+ -+ public static void bindTexture(int texture) { -+ Minecraft.getMinecraft().getTextureManager().bindTexture(texture); -+ } -+ -+ // Spout End -+ -+ -+ public static int[] readImageData(ResourceManager par0ResourceManager, ResourceLocation par1ResourceLocation) throws IOException { -+ BufferedImage var2 = ImageIO.read(par0ResourceManager.getResource(par1ResourceLocation).getInputStream()); - int var3 = var2.getWidth(); - int var4 = var2.getHeight(); - int[] var5 = new int[var3 * var4]; -@@ -126,14 +137,14 @@ - return var5; - } - -- public static int[] updateAnaglyph(int[] var0) { -- int[] var1 = new int[var0.length]; -+ public static int[] updateAnaglyph(int[] par0ArrayOfInteger) { -+ int[] var1 = new int[par0ArrayOfInteger.length]; - -- for(int var2 = 0; var2 < var0.length; ++var2) { -- int var3 = var0[var2] >> 24 & 255; -- int var4 = var0[var2] >> 16 & 255; -- int var5 = var0[var2] >> 8 & 255; -- int var6 = var0[var2] & 255; -+ for (int var2 = 0; var2 < par0ArrayOfInteger.length; ++var2) { -+ int var3 = par0ArrayOfInteger[var2] >> 24 & 255; -+ int var4 = par0ArrayOfInteger[var2] >> 16 & 255; -+ int var5 = par0ArrayOfInteger[var2] >> 8 & 255; -+ int var6 = par0ArrayOfInteger[var2] & 255; - int var7 = (var4 * 30 + var5 * 59 + var6 * 11) / 100; - int var8 = (var4 * 30 + var5 * 70) / 100; - int var9 = (var4 * 30 + var6 * 70) / 100; -@@ -146,11 +157,11 @@ - static { - int var0 = -16777216; - int var1 = -524040; -- int[] var2 = new int[]{-524040, -524040, -524040, -524040, -524040, -524040, -524040, -524040}; -- int[] var3 = new int[]{-16777216, -16777216, -16777216, -16777216, -16777216, -16777216, -16777216, -16777216}; -+ int[] var2 = new int[] { -524040, -524040, -524040, -524040, -524040, -524040, -524040, -524040}; -+ int[] var3 = new int[] { -16777216, -16777216, -16777216, -16777216, -16777216, -16777216, -16777216, -16777216}; - int var4 = var2.length; - -- for(int var5 = 0; var5 < 16; ++var5) { -+ for (int var5 = 0; var5 < 16; ++var5) { - System.arraycopy(var5 < var4 ? var2 : var3, 0, missingTextureData, 16 * var5, var4); - System.arraycopy(var5 < var4 ? var3 : var2, 0, missingTextureData, 16 * var5 + var4, var4); - } ---- net/minecraft/src/EntityFireworkRocket.java -+++ net/minecraft/src/EntityFireworkRocket.java -@@ -1,11 +1,17 @@ - package net.minecraft.src; - - public class EntityFireworkRocket extends Entity { -+ -+ /** The age of the firework in ticks. */ - private int fireworkAge; -+ -+ /** -+ * The lifetime of the firework in ticks. When the age reaches the lifetime the firework explodes. -+ */ - private int lifetime; - -- public EntityFireworkRocket(World var1) { -- super(var1); -+ public EntityFireworkRocket(World par1World) { -+ super(par1World); - this.setSize(0.25F, 0.25F); - } - -@@ -13,44 +19,56 @@ - this.dataWatcher.addObjectByDataType(8, 5); - } - -- public boolean isInRangeToRenderDist(double var1) { -- return var1 < 4096.0D; -+ /** -+ * Checks if the entity is in range to render by using the past in distance and comparing it to its average edge length -+ * * 64 * renderDistanceWeight Args: distance -+ */ -+ public boolean isInRangeToRenderDist(double par1) { -+ return par1 < 4096.0D; - } - -- public EntityFireworkRocket(World var1, double var2, double var4, double var6, ItemStack var8) { -- super(var1); -+ public EntityFireworkRocket(World par1World, double par2, double par4, double par6, ItemStack par8ItemStack) { -+ super(par1World); - this.fireworkAge = 0; - this.setSize(0.25F, 0.25F); -- this.setPosition(var2, var4, var6); -+ this.setPosition(par2, par4, par6); - this.yOffset = 0.0F; - int var9 = 1; -- if(var8 != null && var8.hasTagCompound()) { -- this.dataWatcher.updateObject(8, var8); -- NBTTagCompound var10 = var8.getTagCompound(); -+ -+ if (par8ItemStack != null && par8ItemStack.hasTagCompound()) { -+ this.dataWatcher.updateObject(8, par8ItemStack); -+ NBTTagCompound var10 = par8ItemStack.getTagCompound(); - NBTTagCompound var11 = var10.getCompoundTag("Fireworks"); -- if(var11 != null) { -+ -+ if (var11 != null) { - var9 += var11.getByte("Flight"); - } - } - -- this.motionX = this.ab.nextGaussian() * 0.001D; -- this.motionZ = this.ab.nextGaussian() * 0.001D; -+ this.motionX = this.rand.nextGaussian() * 0.001D; -+ this.motionZ = this.rand.nextGaussian() * 0.001D; - this.motionY = 0.05D; -- this.lifetime = 10 * var9 + this.ab.nextInt(6) + this.ab.nextInt(7); -+ this.lifetime = 10 * var9 + this.rand.nextInt(6) + this.rand.nextInt(7); - } - -- public void setVelocity(double var1, double var3, double var5) { -- this.motionX = var1; -- this.motionY = var3; -- this.motionZ = var5; -- if(this.prevRotationPitch == 0.0F && this.prevRotationYaw == 0.0F) { -- float var7 = MathHelper.sqrt_double(var1 * var1 + var5 * var5); -- this.prevRotationYaw = this.rotationYaw = (float)(Math.atan2(var1, var5) * 180.0D / (double)((float)Math.PI)); -- this.prevRotationPitch = this.rotationPitch = (float)(Math.atan2(var3, (double)var7) * 180.0D / (double)((float)Math.PI)); -+ /** -+ * Sets the velocity to the args. Args: x, y, z -+ */ -+ public void setVelocity(double par1, double par3, double par5) { -+ this.motionX = par1; -+ this.motionY = par3; -+ this.motionZ = par5; -+ -+ if (this.prevRotationPitch == 0.0F && this.prevRotationYaw == 0.0F) { -+ float var7 = MathHelper.sqrt_double(par1 * par1 + par5 * par5); -+ this.prevRotationYaw = this.rotationYaw = (float)(Math.atan2(par1, par5) * 180.0D / Math.PI); -+ this.prevRotationPitch = this.rotationPitch = (float)(Math.atan2(par3, (double)var7) * 180.0D / Math.PI); - } -- - } - -+ /** -+ * Called to update the entity's position/logic. -+ */ - public void onUpdate() { - this.lastTickPosX = this.posX; - this.lastTickPosY = this.posY; -@@ -61,92 +79,108 @@ - this.motionY += 0.04D; - this.moveEntity(this.motionX, this.motionY, this.motionZ); - float var1 = MathHelper.sqrt_double(this.motionX * this.motionX + this.motionZ * this.motionZ); -- this.rotationYaw = (float)(Math.atan2(this.motionX, this.motionZ) * 180.0D / (double)((float)Math.PI)); -+ this.rotationYaw = (float)(Math.atan2(this.motionX, this.motionZ) * 180.0D / Math.PI); - -- for(this.rotationPitch = (float)(Math.atan2(this.motionY, (double)var1) * 180.0D / (double)((float)Math.PI)); this.rotationPitch - this.prevRotationPitch < -180.0F; this.prevRotationPitch -= 360.0F) { -+ for (this.rotationPitch = (float)(Math.atan2(this.motionY, (double)var1) * 180.0D / Math.PI); this.rotationPitch - this.prevRotationPitch < -180.0F; this.prevRotationPitch -= 360.0F) { -+ ; - } - -- while(this.rotationPitch - this.prevRotationPitch >= 180.0F) { -+ while (this.rotationPitch - this.prevRotationPitch >= 180.0F) { - this.prevRotationPitch += 360.0F; - } - -- while(this.rotationYaw - this.prevRotationYaw < -180.0F) { -+ while (this.rotationYaw - this.prevRotationYaw < -180.0F) { - this.prevRotationYaw -= 360.0F; - } - -- while(this.rotationYaw - this.prevRotationYaw >= 180.0F) { -+ while (this.rotationYaw - this.prevRotationYaw >= 180.0F) { - this.prevRotationYaw += 360.0F; - } - - this.rotationPitch = this.prevRotationPitch + (this.rotationPitch - this.prevRotationPitch) * 0.2F; - this.rotationYaw = this.prevRotationYaw + (this.rotationYaw - this.prevRotationYaw) * 0.2F; -- if(this.fireworkAge == 0) { -+ -+ if (this.fireworkAge == 0) { - this.worldObj.playSoundAtEntity(this, "fireworks.launch", 3.0F, 1.0F); - } - - ++this.fireworkAge; -- if(this.worldObj.isRemote && this.fireworkAge % 2 < 2) { -- this.worldObj.spawnParticle("fireworksSpark", this.posX, this.posY - 0.3D, this.posZ, this.ab.nextGaussian() * 0.05D, -this.motionY * 0.5D, this.ab.nextGaussian() * 0.05D); -+ -+ if (this.worldObj.isRemote && this.fireworkAge % 2 < 2) { -+ this.worldObj.spawnParticle("fireworksSpark", this.posX, this.posY - 0.3D, this.posZ, this.rand.nextGaussian() * 0.05D, -this.motionY * 0.5D, this.rand.nextGaussian() * 0.05D); - } - -- if(!this.worldObj.isRemote && this.fireworkAge > this.lifetime) { -+ if (!this.worldObj.isRemote && this.fireworkAge > this.lifetime) { - this.worldObj.setEntityState(this, (byte)17); - this.setDead(); - } -- - } - -- public void handleHealthUpdate(byte var1) { -- if(var1 == 17 && this.worldObj.isRemote) { -+ public void handleHealthUpdate(byte par1) { -+ if (par1 == 17 && this.worldObj.isRemote) { - ItemStack var2 = this.dataWatcher.getWatchableObjectItemStack(8); - NBTTagCompound var3 = null; -- if(var2 != null && var2.hasTagCompound()) { -+ -+ if (var2 != null && var2.hasTagCompound()) { - var3 = var2.getTagCompound().getCompoundTag("Fireworks"); - } - - this.worldObj.func_92088_a(this.posX, this.posY, this.posZ, this.motionX, this.motionY, this.motionZ, var3); - } - -- super.handleHealthUpdate(var1); -+ super.handleHealthUpdate(par1); - } - -- public void writeEntityToNBT(NBTTagCompound var1) { -- var1.setInteger("Life", this.fireworkAge); -- var1.setInteger("LifeTime", this.lifetime); -+ /** -+ * (abstract) Protected helper method to write subclass entity data to NBT. -+ */ -+ public void writeEntityToNBT(NBTTagCompound par1NBTTagCompound) { -+ par1NBTTagCompound.setInteger("Life", this.fireworkAge); -+ par1NBTTagCompound.setInteger("LifeTime", this.lifetime); - ItemStack var2 = this.dataWatcher.getWatchableObjectItemStack(8); -- if(var2 != null) { -+ -+ if (var2 != null) { - NBTTagCompound var3 = new NBTTagCompound(); - var2.writeToNBT(var3); -- var1.setCompoundTag("FireworksItem", var3); -+ par1NBTTagCompound.setCompoundTag("FireworksItem", var3); - } -- - } - -- public void readEntityFromNBT(NBTTagCompound var1) { -- this.fireworkAge = var1.getInteger("Life"); -- this.lifetime = var1.getInteger("LifeTime"); -- NBTTagCompound var2 = var1.getCompoundTag("FireworksItem"); -- if(var2 != null) { -+ /** -+ * (abstract) Protected helper method to read subclass entity data from NBT. -+ */ -+ public void readEntityFromNBT(NBTTagCompound par1NBTTagCompound) { -+ this.fireworkAge = par1NBTTagCompound.getInteger("Life"); -+ this.lifetime = par1NBTTagCompound.getInteger("LifeTime"); -+ NBTTagCompound var2 = par1NBTTagCompound.getCompoundTag("FireworksItem"); -+ -+ if (var2 != null) { - ItemStack var3 = ItemStack.loadItemStackFromNBT(var2); -- if(var3 != null) { -+ -+ if (var3 != null) { - this.dataWatcher.updateObject(8, var3); - } - } -- - } - - public float getShadowSize() { - return 0.0F; - } - -- public float getBrightness(float var1) { -- return super.getBrightness(var1); -- } -- -- public int getBrightnessForRender(float var1) { -- return super.getBrightnessForRender(var1); -- } -- -+ /** -+ * Gets how bright this entity is. -+ */ -+ public float getBrightness(float par1) { -+ return super.getBrightness(par1); -+ } -+ -+ public int getBrightnessForRender(float par1) { -+ return super.getBrightnessForRender(par1); -+ } -+ -+ /** -+ * If returns false, the item will not inflict any damage against entities. -+ */ - public boolean canAttackWithItem() { - return false; - } ---- /dev/null -+++ org/spoutcraft/api/util/FastVector.java -@@ -1,0 +1,106 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.api.util; -+ -+import org.apache.commons.lang3.builder.EqualsBuilder; -+import org.apache.commons.lang3.builder.HashCodeBuilder; -+ -+public class FastVector implements FixedVector { -+ public final int x; -+ public final int y; -+ public final int z; -+ -+ public FastVector(int x, int y, int z) { -+ this.x = x; -+ this.y = y; -+ this.z = z; -+ } -+ -+ public double getX() { -+ return x; -+ } -+ -+ public int getBlockX() { -+ return x; -+ } -+ -+ public double getY() { -+ return y; -+ } -+ -+ public int getBlockY() { -+ return y; -+ } -+ -+ public double getZ() { -+ return z; -+ } -+ -+ public int getBlockZ() { -+ return z; -+ } -+ -+ public double length() { -+ return Math.sqrt(lengthSquared()); -+ } -+ -+ public double lengthSquared() { -+ return x * x + y * y + z * z; -+ } -+ -+ public double distance(Vector other) { -+ return Math.sqrt(distanceSquared(other)); -+ } -+ -+ public double distanceSquared(Vector other) { -+ return (x - other.getX()) * (x - other.getX()) + (y - other.getY()) * (y - other.getY()) + (z - other.getZ()) * (z - other.getZ()); -+ } -+ -+ public float angle(Vector other) { -+ double dot = dot(other) / (length() * other.length()); -+ return (float) Math.acos(dot); -+ } -+ -+ public double dot(Vector other) { -+ return x * other.getX() + y * other.getY() + z * other.getZ(); -+ } -+ -+ public boolean isInAABB(Vector min, Vector max) { -+ return x >= min.getX() && x <= max.getX() && y >= min.getY() && y <= max.getY() && z >= min.getZ() && z <= max.getZ(); -+ } -+ -+ public boolean isInSphere(Vector origin, double radius) { -+ return (Math.pow(origin.getX() - x, 2) + Math.pow(origin.getY() - y, 2) + Math.pow(origin.getZ() - z, 2)) <= Math.pow(radius, 2); -+ } -+ -+ @Override -+ public boolean equals(Object obj) { -+ if (obj instanceof FastVector) { -+ FastVector other = (FastVector) obj; -+ return (new EqualsBuilder()).append(x, other.getX()).append(y, other.getY()).append(z, other.getZ()).isEquals(); -+ } -+ return false; -+ } -+ -+ @Override -+ public int hashCode() { -+ return (new HashCodeBuilder()).append(x).append(y).append(z).toHashCode(); -+ } -+} ---- /dev/null -+++ org/spoutcraft/client/chunkcache/SimpleFileCache.java -@@ -1,0 +1,506 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.client.chunkcache; -+ -+import java.io.DataInputStream; -+import java.io.DataOutputStream; -+import java.io.File; -+import java.io.FileInputStream; -+import java.io.FileOutputStream; -+import java.io.IOException; -+import java.lang.ref.Reference; -+import java.lang.ref.SoftReference; -+import java.util.ArrayList; -+import java.util.Arrays; -+import java.util.Comparator; -+import java.util.List; -+import java.util.concurrent.ConcurrentHashMap; -+import java.util.concurrent.ConcurrentLinkedQueue; -+import java.util.concurrent.atomic.AtomicInteger; -+import java.util.zip.GZIPInputStream; -+import java.util.zip.GZIPOutputStream; -+ -+public class SimpleFileCache { -+ private static final int VERSION = 2; -+ private static final String PREFIX = "SPC"; -+ -+ private final File dir; -+ private final Comparator fileCompare = new FileCompare(); -+ private final long limit; -+ private final int entries; -+ -+ private final ConcurrentHashMap FATMap = new ConcurrentHashMap(); -+ private final ConcurrentHashMap FATIMap = new ConcurrentHashMap(); -+ private final ConcurrentHashMap> cache = new ConcurrentHashMap>(); -+ private final ConcurrentLinkedQueue newHashQueue = new ConcurrentLinkedQueue(); -+ -+ private final AtomicInteger entriesPending = new AtomicInteger(); -+ private final AtomicInteger fileCount = new AtomicInteger(); -+ -+ public SimpleFileCache(File dir, int entries, long limit) throws IOException { -+ this.dir = dir; -+ this.limit = limit; -+ this.entries = entries; -+ this.entriesPending.set(this.entries); -+ -+ if (!dir.isDirectory()) { -+ if (dir.isFile()) { -+ throw new IOException("Unable to open cache directory"); -+ } else { -+ dir.mkdirs(); -+ } -+ } -+ -+ File[] files = dir.listFiles(); -+ Arrays.sort(files, fileCompare); -+ -+ prune(files); -+ -+ files = dir.listFiles(); -+ Arrays.sort(files, fileCompare); -+ -+ readFAT(files); -+ -+ Runtime.getRuntime().addShutdownHook(new Thread(new Runnable() { -+ public void run() { -+ writePending(true); -+ prune(); -+ } -+ })); -+ } -+ -+ private void prune() { -+ File[] files = dir.listFiles(); -+ Arrays.sort(files, fileCompare); -+ -+ prune(files); -+ } -+ -+ private void prune(File[] files) { -+ int size = 0; -+ -+ for (File file : files) { -+ if (file.isFile()) { -+ size += file.length(); -+ } -+ } -+ int cnt = 0; -+ -+ while (size > (limit << 10) && cnt < files.length) { -+ File current = files[cnt++]; -+ if (current.isFile()) { -+ size -= current.length(); -+ current.delete(); -+ } -+ } -+ } -+ -+ private void readFAT(File[] files) throws IOException { -+ for (File f : files) { -+ if (!isValid(f)) { -+ continue; -+ } -+ boolean delete = false; -+ int id = getIntFromName(f); -+ DataInputStream din = new DataInputStream(new FileInputStream(f)); -+ try { -+ int version = din.readInt(); -+ if (version < VERSION) { -+ System.out.println("File " + f.getAbsolutePath() + " has out of date version " + version + ", deleting"); -+ delete = true; -+ continue; -+ } else if (version > VERSION){ -+ System.out.println("File " + f.getAbsolutePath() + " has unknown version " + version); -+ continue; -+ } -+ int entries = din.readInt(); -+ if (entries > (this.entries * 2)) { -+ System.out.println("File " + f.getAbsolutePath() + " has to many entries " + entries + ", skipping"); -+ continue; -+ } -+ long[] hashArray = new long[entries]; -+ for (int i = 0; i < entries; i++) { -+ long hash = din.readLong(); -+ FATMap.put(hash, new FATEntry(id, i)); -+ hashArray[i] = hash; -+ } -+ FATIMap.put(id, hashArray); -+ } finally { -+ if (din != null) { -+ try { -+ din.close(); -+ } catch (IOException ioe) { -+ } -+ } -+ if (delete) { -+ f.delete(); -+ } -+ } -+ } -+ } -+ -+ private byte[] readFile(int id, long needle) throws IOException { -+ File f = getFileFromInt(id); -+ -+ if (!isValid(f)) { -+ return null; -+ } -+ -+ byte[] returnArray = null; -+ -+ DataInputStream din = new DataInputStream(new FileInputStream(f)); -+ try { -+ int version = din.readInt(); -+ if (version != VERSION) { -+ System.out.println("File " + f.getAbsolutePath() + " has out of date version " + version); -+ return null; -+ } -+ int entries = din.readInt(); -+ if (entries > (this.entries * 2)) { -+ System.out.println("File " + f.getAbsolutePath() + " has to many entries " + entries); -+ return null; -+ } -+ long[] hash = new long[entries]; -+ -+ for (int i = 0; i < entries; i++) { -+ hash[i] = din.readLong(); -+ } -+ -+ din = new DataInputStream(new GZIPInputStream(din)); -+ -+ for (int i = 0; i < entries; i++) { -+ byte[] array = new byte[2048]; -+ din.readFully(array); -+ long newHash = PartitionChunk.hash(array); -+ if (newHash == hash[i]) { -+ cache.put(hash[i], new SoftReference(array)); -+ if (hash[i] == needle) { -+ returnArray = array; -+ } -+ } else { -+ System.out.println("Hash in file " + f.getAbsolutePath() + " has hash data mismatch"); -+ } -+ } -+ } finally { -+ if (din != null) { -+ try { -+ din.close(); -+ } catch (IOException ioe) { -+ } -+ } -+ } -+ -+ return returnArray; -+ -+ } -+ -+ public long putData(byte[] data) { -+ MapEntry entry = new MapEntry(data); -+ -+ cache.put(entry.getHash(), new HardReference(entry.getData())); -+ newHashQueue.add(entry); -+ -+ entriesPending.decrementAndGet(); -+ -+ checkFileWrite(); -+ -+ return entry.getHash(); -+ } -+ -+ public byte[] getData(long hash) { -+ Reference ref = cache.get(hash); -+ -+ byte[] data = null; -+ -+ if (ref != null) { -+ data = ref.get(); -+ } -+ -+ if (data != null) { -+ return data; -+ } -+ -+ FATEntry entry = FATMap.get(hash); -+ -+ if (entry == null) { -+ return null; -+ } -+ -+ try { -+ data = readFile(entry.getId(), hash); -+ } catch (IOException e) { -+ File f = getFileFromInt(entry.getId()); -+ f.delete(); -+ FATMap.remove(hash); -+ long[] fileHashes = FATIMap.remove(entry.getId()); -+ for (long h : fileHashes) { -+ FATMap.remove(h); -+ } -+ System.out.println("Deleting corrupted chunk cache file " + entry.getId() + ", " + e.getMessage()); -+ e.printStackTrace(); -+ return null; -+ } -+ -+ return data; -+ } -+ -+ public long[] getNearby(long hash, int range) { -+ FATEntry entry = FATMap.get(hash); -+ -+ if (entry == null) { -+ return null; -+ } -+ -+ long[] fileHashes = FATIMap.get(entry.getId()); -+ -+ if (fileHashes == null) { -+ System.out.println("Cache FAT inverse map failure"); -+ return null; -+ } -+ -+ int index = entry.getIndex(); -+ -+ if (fileHashes[index] != hash) { -+ throw new IllegalStateException("FAT inverse map mismatch, expected " + hash + ", got " + fileHashes[index]); -+ } -+ -+ int start = index - range; -+ int end = index + range; -+ if (start < 0) { -+ start = 0; -+ } -+ if (end > fileHashes.length) { -+ end = fileHashes.length; -+ } -+ -+ long[] nearby = new long[end - start]; -+ -+ int i = index; -+ int j = index + 1; -+ int k = 0; -+ while (i >= start || j < end) { -+ if (i >= start) { -+ nearby[k++] = fileHashes[i--]; -+ } -+ if (j < end) { -+ nearby[k++] = fileHashes[j++]; -+ } -+ } -+ if (k != nearby.length) { -+ throw new IllegalStateException("File hash array length calculation error"); -+ } -+ return nearby; -+ } -+ -+ private void checkFileWrite() { -+ boolean success = false; -+ while (!success) { -+ int old = entriesPending.get(); -+ if (old > 0) { -+ success = true; -+ } else { -+ success = entriesPending.compareAndSet(old, old + entries); -+ if (success) { -+ writePending(false); -+ } -+ } -+ } -+ } -+ -+ private void writePending(boolean blocking) { -+ int id = fileCount.getAndIncrement(); -+ -+ ArrayList entryList = new ArrayList(entries << 1); -+ -+ MapEntry entry; -+ while ((entry = newHashQueue.poll()) != null) { -+ entryList.add(entry); -+ } -+ -+ if (entryList.size() > 0) { -+ Thread t = new DataWriteThread(id, entryList); -+ t.start(); -+ if (blocking) { -+ try { -+ t.join(); -+ } catch (InterruptedException ie) { -+ throw new RuntimeException(ie); -+ } -+ } -+ } -+ } -+ -+ private static boolean isValid(File file) { -+ if (file != null) { -+ String fileName = file.getName(); -+ if (!fileName.startsWith(PREFIX)) { -+ return false; -+ } -+ try { -+ Integer.parseInt(fileName.substring(3)); -+ } catch (NumberFormatException nfe) { -+ return false; -+ } -+ return true; -+ } -+ return false; -+ } -+ -+ public int getIntFromName(File file) { -+ try { -+ String fileName = file.getName(); -+ if (fileName == null || fileName.length() < 3) { -+ return 0; -+ } -+ int id = Integer.parseInt(file.getName().substring(3)); -+ boolean success = false; -+ while (!success) { -+ int oldId = fileCount.get(); -+ if (id < oldId) { -+ success = true; -+ } else { -+ success = fileCount.compareAndSet(oldId, id + 1); -+ } -+ } -+ return id; -+ } catch (NumberFormatException nfe) { -+ return 0; -+ } -+ } -+ -+ public File getFileFromInt(int id) { -+ return new File(dir, PREFIX + id); -+ } -+ -+ private class FileCompare implements Comparator { -+ public int compare(File f1, File f2) { -+ return getIntFromName(f1) - getIntFromName(f2); -+ } -+ -+ } -+ -+ private class DataWriteThread extends Thread { -+ private final List entryList; -+ private final int id; -+ -+ public DataWriteThread(int id, List entryList) { -+ super("SimpleFileCache file write thread, fileid " + id); -+ this.id = id; -+ this.entryList = entryList; -+ } -+ -+ public void run() { -+ File file = getFileFromInt(id); -+ -+ DataOutputStream dos = null; -+ -+ try { -+ dos = new DataOutputStream(new FileOutputStream(file)); -+ -+ dos.writeInt(VERSION); -+ dos.writeInt(entryList.size()); -+ for (MapEntry e : entryList) { -+ dos.writeLong(e.getHash()); -+ } -+ -+ dos = new DataOutputStream(new GZIPOutputStream(dos)); -+ -+ int i = 0; -+ for (MapEntry e : entryList) { -+ byte[] data = e.getData(); -+ dos.write(data, 0, data.length); -+ } -+ } catch (IOException ioe) { -+ throw new RuntimeException(ioe); -+ } finally { -+ if (dos != null) { -+ try { -+ dos.close(); -+ } catch (IOException ioe) { -+ } -+ } -+ } -+ -+ long[] hashArray = new long[entries]; -+ int i = 0; -+ for (MapEntry e : entryList) { -+ cache.put(e.getHash(), new SoftReference(e.getData())); -+ FATMap.put(e.getHash(), new FATEntry(id, i)); -+ hashArray[i++] = e.getHash(); -+ } -+ FATIMap.put(id, hashArray); -+ } -+ } -+ -+ private static class FATEntry { -+ private final int id; -+ private final int index; -+ -+ public FATEntry(int id, int index) { -+ this.id = id; -+ this.index = index; -+ } -+ -+ public int getId() { -+ return id; -+ } -+ -+ public int getIndex() { -+ return index; -+ } -+ -+ } -+ -+ private static class MapEntry { -+ private final long hash; -+ private final byte[] data; -+ -+ public MapEntry(byte[] data) { -+ if (data.length != 2048) { -+ throw new IllegalArgumentException("Data length must be 2048 bytes long"); -+ } -+ this.data = new byte[data.length]; -+ System.arraycopy(data, 0, this.data, 0, data.length); -+ this.hash = PartitionChunk.hash(this.data); -+ } -+ -+ public long getHash() { -+ return hash; -+ } -+ -+ public byte[] getData() { -+ return data; -+ } -+ } -+ -+ public class HardReference extends SoftReference { -+ private final T hard; -+ -+ @Override -+ public T get() { -+ return hard; -+ } -+ -+ HardReference(T ref) { -+ super(ref); -+ hard = ref; -+ } -+ } -+} ---- net/minecraft/src/CallableCrashMemoryReport.java -+++ net/minecraft/src/CallableCrashMemoryReport.java -@@ -5,10 +5,13 @@ - class CallableCrashMemoryReport implements Callable { - final CrashReport theCrashReport; - -- CallableCrashMemoryReport(CrashReport var1) { -- this.theCrashReport = var1; -+ CallableCrashMemoryReport(CrashReport par1CrashReport) { -+ this.theCrashReport = par1CrashReport; - } - -+ /** -+ * Returns a string with allocated and used memory. -+ */ - public String getMemoryReport() { - int var1 = AxisAlignedBB.getAABBPool().getlistAABBsize(); - int var2 = 56 * var1; ---- /dev/null -+++ org/spoutcraft/api/block/design/GenericCubeBlockDesign.java -@@ -1,0 +1,115 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.api.block.design; -+ -+public class GenericCubeBlockDesign extends GenericBlockDesign { -+ /** -+ * Creates a basic cube custom block model -+ * -+ * @param addon making this block -+ * @param texture to use -+ * @param textureId[6] Array of faces, give Id's for SubTexture locations -+ */ -+ public GenericCubeBlockDesign(String addon, Texture texture, int[] textureId) { -+ if (textureId.length != 6) { -+ throw new IllegalArgumentException("Invalid textureId Array length: " + textureId.length + ". Should be 6"); -+ } -+ -+ setBoundingBox(0, 0, 0, 1, 1, 1); -+ -+ setQuadNumber(6); -+ -+ setMinBrightness(0.0F).setMaxBrightness(1.0F).setTexture(addon, texture); -+ -+ Quad bottom = new Quad(0, texture.getSubTexture(textureId[0])); -+ bottom.addVertex(0, 0.0F, 0.0F, 0.0F); -+ bottom.addVertex(1, 1.0F, 0.0F, 0.0F); -+ bottom.addVertex(2, 1.0F, 0.0F, 1.0F); -+ bottom.addVertex(3, 0.0F, 0.0F, 1.0F); -+ setLightSource(0, 0, -1, 0); -+ -+ Quad face1 = new Quad(1, texture.getSubTexture(textureId[1])); -+ face1.addVertex(0, 0.0F, 0.0F, 0.0F); -+ face1.addVertex(1, 0.0F, 1.0F, 0.0F); -+ face1.addVertex(2, 1.0F, 1.0F, 0.0F); -+ face1.addVertex(3, 1.0F, 0.0F, 0.0F); -+ setLightSource(1, 0, 0, -1); -+ -+ Quad face2 = new Quad(2, texture.getSubTexture(textureId[2])); -+ face2.addVertex(0, 1.0F, 0.0F, 0.0F); -+ face2.addVertex(1, 1.0F, 1.0F, 0.0F); -+ face2.addVertex(2, 1.0F, 1.0F, 1.0F); -+ face2.addVertex(3, 1.0F, 0.0F, 1.0F); -+ setLightSource(2, 1, 0, 0); -+ -+ Quad face3 = new Quad(3, texture.getSubTexture(textureId[3])); -+ face3.addVertex(0, 1.0F, 0.0F, 1.0F); -+ face3.addVertex(1, 1.0F, 1.0F, 1.0F); -+ face3.addVertex(2, 0.0F, 1.0F, 1.0F); -+ face3.addVertex(3, 0.0F, 0.0F, 1.0F); -+ setLightSource(3, 0, 0, 1); -+ -+ Quad face4 = new Quad(4, texture.getSubTexture(textureId[4])); -+ face4.addVertex(0, 0.0F, 0.0F, 1.0F); -+ face4.addVertex(1, 0.0F, 1.0F, 1.0F); -+ face4.addVertex(2, 0.0F, 1.0F, 0.0F); -+ face4.addVertex(3, 0.0F, 0.0F, 0.0F); -+ setLightSource(4, -1, 0, 0); -+ -+ Quad top = new Quad(5, texture.getSubTexture(textureId[5])); -+ top.addVertex(0, 0.0F, 1.0F, 0.0F); -+ top.addVertex(1, 0.0F, 1.0F, 1.0F); -+ top.addVertex(2, 1.0F, 1.0F, 1.0F); -+ top.addVertex(3, 1.0F, 1.0F, 0.0F); -+ setLightSource(5, 0, 1, 0); -+ -+ setQuad(bottom).setQuad(face1).setQuad(face2).setQuad(face3).setQuad(face4).setQuad(top); -+ } -+ -+ /** -+ * Creates a basic cube custom block model with only one texture -+ * -+ * @param addon making this block -+ * @param texture to use -+ * @param textureId to get the SubTexture to use -+ */ -+ public GenericCubeBlockDesign(String addon, Texture texture, int textureId) { -+ this(addon, texture, getIdMap(textureId)); -+ } -+ -+ /** -+ * Creates a basic cube custom block model with only one texture -+ * -+ * @param addon making this block -+ * @param texture url to use - must be square -+ * @param textureSize size of the width/height of the texture in pixels -+ */ -+ public GenericCubeBlockDesign(String addon, String texture, int textureSize) { -+ this(addon, new Texture(addon, texture, textureSize, textureSize, textureSize), 0); -+ } -+ -+ private static int[] getIdMap(int textureId) { -+ int[] idMap = new int[6]; -+ for (int i = 0; i < 6; i++) { -+ idMap[i] = textureId; -+ } -+ return idMap; -+ } -+} ---- /dev/null -+++ org/spoutcraft/client/packet/PacketCustomBlockDesign.java -@@ -1,0 +1,69 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.client.packet; -+ -+import java.io.IOException; -+ -+import org.spoutcraft.api.block.design.GenericBlockDesign; -+import org.spoutcraft.api.io.SpoutInputStream; -+import org.spoutcraft.api.io.SpoutOutputStream; -+import org.spoutcraft.api.material.CustomBlock; -+import org.spoutcraft.api.material.MaterialData; -+ -+public class PacketCustomBlockDesign implements SpoutPacket { -+ private short customId; -+ private byte data; -+ private GenericBlockDesign design; -+ -+ public PacketCustomBlockDesign() { -+ } -+ -+ public void readData(SpoutInputStream input) throws IOException { -+ customId = input.readShort(); -+ data = (byte) input.read(); -+ design = new GenericBlockDesign(); -+ design.read(input); -+ if (design.isReset()) { -+ design = null; -+ } -+ } -+ -+ public void writeData(SpoutOutputStream output) throws IOException { -+ output.writeShort(customId); -+ } -+ -+ public void run(int id) { -+ CustomBlock block = MaterialData.getCustomBlock(customId); -+ if (block != null) { -+ block.setBlockDesign(design, data); -+ } -+ } -+ -+ public void failure(int id) { -+ } -+ -+ public PacketType getPacketType() { -+ return PacketType.PacketCustomBlockDesign; -+ } -+ -+ public int getVersion() { -+ return new GenericBlockDesign().getVersion() + 3; -+ } -+} ---- /dev/null -+++ org/spoutcraft/api/gui/GenericButton.java -@@ -1,0 +1,167 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.api.gui; -+ -+import java.io.IOException; -+ -+import org.spoutcraft.api.Spoutcraft; -+import org.spoutcraft.api.UnsafeClass; -+import org.spoutcraft.api.io.SpoutInputStream; -+import org.spoutcraft.api.io.SpoutOutputStream; -+ -+@UnsafeClass -+public class GenericButton extends GenericControl implements Button { -+ protected GenericLabel label = new GenericLabel(); -+ protected String disabledText = ""; -+ protected Color hoverColor = new Color(1f, 1f, 0.627F); -+ protected float scale = 1.0F; -+ protected int innerWidth = 0; -+ public GenericButton() { -+ label.setAlign(WidgetAnchor.TOP_CENTER); -+ } -+ -+ public GenericButton(String text) { -+ label.setAlign(WidgetAnchor.TOP_CENTER); -+ setText(text); -+ } -+ -+ public int getVersion() { -+ return super.getVersion() + 4; -+ } -+ -+ @Override -+ public void readData(SpoutInputStream input) throws IOException { -+ super.readData(input); -+ label.readData(input); -+ setDisabledText(input.readString()); -+ setHoverColor(input.readColor()); -+ scale = input.readFloat(); -+ } -+ -+ @Override -+ public void writeData(SpoutOutputStream output) throws IOException { -+ super.writeData(output); -+ label.writeData(output); -+ output.writeString(getDisabledText()); -+ output.writeColor(getHoverColor()); -+ output.writeFloat(scale); -+ } -+ -+ public String getText() { -+ return label.getText(); -+ } -+ -+ public Button setText(String text) { -+ label.setText(text); -+ return this; -+ } -+ -+ public WidgetAnchor getAlign() { -+ return label.getAlign(); -+ } -+ -+ public Button setAlign(WidgetAnchor pos) { -+ label.setAlign(pos); -+ return this; -+ } -+ -+ public Color getTextColor() { -+ return this.getColor(); -+ } -+ -+ public Button setTextColor(Color color) { -+ return (Button) this.setColor(color); -+ } -+ -+ public String getDisabledText() { -+ return disabledText; -+ } -+ -+ public Button setDisabledText(String text) { -+ disabledText = text; -+ return this; -+ } -+ -+ public Color getHoverColor() { -+ return hoverColor; -+ } -+ -+ public Button setHoverColor(Color color) { -+ this.hoverColor = color; -+ return this; -+ } -+ -+ public WidgetType getType() { -+ return WidgetType.Button; -+ } -+ -+ public void render() { -+ Spoutcraft.getClient().getRenderDelegate().render(this); -+ } -+ -+ public Button setInnerWidth(int width) { -+ innerWidth = width; -+ return this; -+ } -+ -+ public double getInnerWidth() { -+ return innerWidth; -+ } -+ -+ public Button setAuto(boolean auto) { -+ label.setAuto(auto); -+ return this; -+ } -+ -+ public boolean isAuto() { -+ return label.isAuto(); -+ } -+ -+ public Button copy() { -+ return ((Button)super.copy()).setDisabledText(getDisabledText()).setText(getText()).setAuto(isAuto()).setTextColor(getTextColor()).setHoverColor(getHoverColor()); -+ } -+ -+ public void onButtonClick() { -+ } -+ -+ public Label setScale(float scale) { -+ this.scale = scale; -+ return this; -+ } -+ -+ public float getScale() { -+ return scale; -+ } -+ -+ @Override -+ public Widget setWidth(int width) { -+ label.setWidth(width); -+ return super.setWidth(width); -+ } -+ -+ public Label setShadow(boolean shadow) { -+ label.setShadow(shadow); -+ return this; -+ } -+ -+ public boolean hasShadow() { -+ return label.hasShadow(); -+ } -+} ---- net/minecraft/src/CommandHelp.java -+++ net/minecraft/src/CommandHelp.java -@@ -11,54 +11,60 @@ - return "help"; - } - -+ /** -+ * Return the required permission level for this command. -+ */ - public int getRequiredPermissionLevel() { - return 0; - } - -- public String getCommandUsage(ICommandSender var1) { -+ public String getCommandUsage(ICommandSender par1ICommandSender) { - return "commands.help.usage"; - } - - public List getCommandAliases() { -- return Arrays.asList(new String[]{"?"}); -+ return Arrays.asList(new String[] {"?"}); - } - -- public void processCommand(ICommandSender var1, String[] var2) { -- List var3 = this.getSortedPossibleCommands(var1); -+ public void processCommand(ICommandSender par1ICommandSender, String[] par2ArrayOfStr) { -+ List var3 = this.getSortedPossibleCommands(par1ICommandSender); - byte var4 = 7; - int var5 = (var3.size() - 1) / var4; - boolean var6 = false; -- - ICommand var9; - int var11; -+ - try { -- var11 = var2.length == 0 ? 0 : parseIntBounded(var1, var2[0], 1, var5 + 1) - 1; -+ var11 = par2ArrayOfStr.length == 0 ? 0 : parseIntBounded(par1ICommandSender, par2ArrayOfStr[0], 1, var5 + 1) - 1; - } catch (NumberInvalidException var10) { - Map var8 = this.getCommands(); -- var9 = (ICommand)var8.get(var2[0]); -- if(var9 != null) { -- throw new WrongUsageException(var9.getCommandUsage(var1), new Object[0]); -+ var9 = (ICommand)var8.get(par2ArrayOfStr[0]); -+ -+ if (var9 != null) { -+ throw new WrongUsageException(var9.getCommandUsage(par1ICommandSender), new Object[0]); - } - - throw new CommandNotFoundException(); - } - - int var7 = Math.min((var11 + 1) * var4, var3.size()); -- var1.sendChatToPlayer(ChatMessageComponent.createFromTranslationWithSubstitutions("commands.help.header", new Object[]{Integer.valueOf(var11 + 1), Integer.valueOf(var5 + 1)}).setColor(EnumChatFormatting.DARK_GREEN)); -+ par1ICommandSender.sendChatToPlayer(ChatMessageComponent.createFromTranslationWithSubstitutions("commands.help.header", new Object[] {Integer.valueOf(var11 + 1), Integer.valueOf(var5 + 1)}).setColor(EnumChatFormatting.DARK_GREEN)); - -- for(int var12 = var11 * var4; var12 < var7; ++var12) { -+ for (int var12 = var11 * var4; var12 < var7; ++var12) { - var9 = (ICommand)var3.get(var12); -- var1.sendChatToPlayer(ChatMessageComponent.createFromTranslationKey(var9.getCommandUsage(var1))); -- } -- -- if(var11 == 0 && var1 instanceof EntityPlayer) { -- var1.sendChatToPlayer(ChatMessageComponent.createFromTranslationKey("commands.help.footer").setColor(EnumChatFormatting.GREEN)); -- } -- -+ par1ICommandSender.sendChatToPlayer(ChatMessageComponent.createFromTranslationKey(var9.getCommandUsage(par1ICommandSender))); -+ } -+ -+ if (var11 == 0 && par1ICommandSender instanceof EntityPlayer) { -+ par1ICommandSender.sendChatToPlayer(ChatMessageComponent.createFromTranslationKey("commands.help.footer").setColor(EnumChatFormatting.GREEN)); -+ } - } - -- protected List getSortedPossibleCommands(ICommandSender var1) { -- List var2 = MinecraftServer.getServer().getCommandManager().getPossibleCommands(var1); -+ /** -+ * Returns a sorted list of all possible commands for the given ICommandSender. -+ */ -+ protected List getSortedPossibleCommands(ICommandSender par1ICommandSender) { -+ List var2 = MinecraftServer.getServer().getCommandManager().getPossibleCommands(par1ICommandSender); - Collections.sort(var2); - return var2; - } ---- net/minecraft/src/ComponentNetherBridgeCrossing2.java -+++ net/minecraft/src/ComponentNetherBridgeCrossing2.java -@@ -4,38 +4,47 @@ - import java.util.Random; - - public class ComponentNetherBridgeCrossing2 extends ComponentNetherBridgePiece { -- public ComponentNetherBridgeCrossing2() { -- } -- -- public ComponentNetherBridgeCrossing2(int var1, Random var2, StructureBoundingBox var3, int var4) { -- super(var1); -- this.coordBaseMode = var4; -- this.boundingBox = var3; -- } -- -- public void buildComponent(StructureComponent var1, List var2, Random var3) { -- this.getNextComponentNormal((ComponentNetherBridgeStartPiece)var1, var2, var3, 1, 0, true); -- this.getNextComponentX((ComponentNetherBridgeStartPiece)var1, var2, var3, 0, 1, true); -- this.getNextComponentZ((ComponentNetherBridgeStartPiece)var1, var2, var3, 0, 1, true); -- } -- -- public static ComponentNetherBridgeCrossing2 createValidComponent(List var0, Random var1, int var2, int var3, int var4, int var5, int var6) { -- StructureBoundingBox var7 = StructureBoundingBox.getComponentToAddBoundingBox(var2, var3, var4, -1, 0, 0, 5, 7, 5, var5); -- return isAboveGround(var7) && StructureComponent.findIntersecting(var0, var7) == null ? new ComponentNetherBridgeCrossing2(var6, var1, var7, var5) : null; -- } -- -- public boolean addComponentParts(World var1, Random var2, StructureBoundingBox var3) { -- this.fillWithBlocks(var1, var3, 0, 0, 0, 4, 1, 4, Block.netherBrick.blockID, Block.netherBrick.blockID, false); -- this.fillWithBlocks(var1, var3, 0, 2, 0, 4, 5, 4, 0, 0, false); -- this.fillWithBlocks(var1, var3, 0, 2, 0, 0, 5, 0, Block.netherBrick.blockID, Block.netherBrick.blockID, false); -- this.fillWithBlocks(var1, var3, 4, 2, 0, 4, 5, 0, Block.netherBrick.blockID, Block.netherBrick.blockID, false); -- this.fillWithBlocks(var1, var3, 0, 2, 4, 0, 5, 4, Block.netherBrick.blockID, Block.netherBrick.blockID, false); -- this.fillWithBlocks(var1, var3, 4, 2, 4, 4, 5, 4, Block.netherBrick.blockID, Block.netherBrick.blockID, false); -- this.fillWithBlocks(var1, var3, 0, 6, 0, 4, 6, 4, Block.netherBrick.blockID, Block.netherBrick.blockID, false); -- -- for(int var4 = 0; var4 <= 4; ++var4) { -- for(int var5 = 0; var5 <= 4; ++var5) { -- this.fillCurrentPositionBlocksDownwards(var1, Block.netherBrick.blockID, 0, var4, -1, var5, var3); -+ public ComponentNetherBridgeCrossing2() {} -+ -+ public ComponentNetherBridgeCrossing2(int par1, Random par2Random, StructureBoundingBox par3StructureBoundingBox, int par4) { -+ super(par1); -+ this.coordBaseMode = par4; -+ this.boundingBox = par3StructureBoundingBox; -+ } -+ -+ /** -+ * Initiates construction of the Structure Component picked, at the current Location of StructGen -+ */ -+ public void buildComponent(StructureComponent par1StructureComponent, List par2List, Random par3Random) { -+ this.getNextComponentNormal((ComponentNetherBridgeStartPiece)par1StructureComponent, par2List, par3Random, 1, 0, true); -+ this.getNextComponentX((ComponentNetherBridgeStartPiece)par1StructureComponent, par2List, par3Random, 0, 1, true); -+ this.getNextComponentZ((ComponentNetherBridgeStartPiece)par1StructureComponent, par2List, par3Random, 0, 1, true); -+ } -+ -+ /** -+ * Creates and returns a new component piece. Or null if it could not find enough room to place it. -+ */ -+ public static ComponentNetherBridgeCrossing2 createValidComponent(List par0List, Random par1Random, int par2, int par3, int par4, int par5, int par6) { -+ StructureBoundingBox var7 = StructureBoundingBox.getComponentToAddBoundingBox(par2, par3, par4, -1, 0, 0, 5, 7, 5, par5); -+ return isAboveGround(var7) && StructureComponent.findIntersecting(par0List, var7) == null ? new ComponentNetherBridgeCrossing2(par6, par1Random, var7, par5) : null; -+ } -+ -+ /** -+ * second Part of Structure generating, this for example places Spiderwebs, Mob Spawners, it closes Mineshafts at the -+ * end, it adds Fences... -+ */ -+ public boolean addComponentParts(World par1World, Random par2Random, StructureBoundingBox par3StructureBoundingBox) { -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 0, 0, 0, 4, 1, 4, Block.netherBrick.blockID, Block.netherBrick.blockID, false); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 0, 2, 0, 4, 5, 4, 0, 0, false); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 0, 2, 0, 0, 5, 0, Block.netherBrick.blockID, Block.netherBrick.blockID, false); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 4, 2, 0, 4, 5, 0, Block.netherBrick.blockID, Block.netherBrick.blockID, false); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 0, 2, 4, 0, 5, 4, Block.netherBrick.blockID, Block.netherBrick.blockID, false); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 4, 2, 4, 4, 5, 4, Block.netherBrick.blockID, Block.netherBrick.blockID, false); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 0, 6, 0, 4, 6, 4, Block.netherBrick.blockID, Block.netherBrick.blockID, false); -+ -+ for (int var4 = 0; var4 <= 4; ++var4) { -+ for (int var5 = 0; var5 <= 4; ++var5) { -+ this.fillCurrentPositionBlocksDownwards(par1World, Block.netherBrick.blockID, 0, var4, -1, var5, par3StructureBoundingBox); - } - } - ---- /dev/null -+++ org/spoutcraft/client/gui/settings/controls/AdvancedOpenGLButton.java -@@ -1,0 +1,51 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.client.gui.settings.controls; -+ -+import net.minecraft.src.Minecraft; -+ -+import org.spoutcraft.client.config.Configuration; -+ -+public class AdvancedOpenGLButton extends AutomatedButton { -+ public AdvancedOpenGLButton() { -+ setTooltip("Detect and render only visible geometry\nOFF - all geometry is rendered (slower)\nFast - only visible geometry is rendered (fastest)\nFancy - conservative, avoids visual artifacts (faster)\nThe option is available only if it is supported by the\ngraphic card."); -+ } -+ -+ @Override -+ public String getText() { -+ switch (Configuration.getAdvancedOpenGL()) { -+ case 0: return "Advanced OpenGL: OFF"; -+ case 1: return "Advanced OpenGL: Fast"; -+ case 2: return "Advanced OpenGL: Fancy"; -+ } -+ return "Unknown State: " + Configuration.getAdvancedOpenGL(); -+ } -+ -+ @Override -+ public void onButtonClick() { -+ Configuration.setAdvancedOpenGL(Configuration.getAdvancedOpenGL() + 1); -+ if (Configuration.getAdvancedOpenGL() > 2) { -+ Configuration.setAdvancedOpenGL(0); -+ } -+ Configuration.write(); -+ Minecraft.getMinecraft().gameSettings.advancedOpengl = Configuration.getAdvancedOpenGL() != 0; -+ Minecraft.getMinecraft().renderGlobal.setAllRenderesVisible(); -+ } -+} ---- net/minecraft/src/BanList.java -+++ net/minecraft/src/BanList.java -@@ -15,76 +15,83 @@ - - public class BanList { - private final LowerStringMap theBanList = new LowerStringMap(); -- private final File b; -+ private final File fileName; -+ -+ /** set to true if not singlePlayer */ - private boolean listActive = true; - -- public BanList(File var1) { -- this.b = var1; -+ public BanList(File par1File) { -+ this.fileName = par1File; - } - - public boolean isListActive() { - return this.listActive; - } - -- public void setListActive(boolean var1) { -- this.listActive = var1; -+ public void setListActive(boolean par1) { -+ this.listActive = par1; - } - -+ /** -+ * removes expired Bans before returning -+ */ - public Map getBannedList() { - this.removeExpiredBans(); - return this.theBanList; - } - -- public boolean isBanned(String var1) { -- if(!this.isListActive()) { -+ public boolean isBanned(String par1Str) { -+ if (!this.isListActive()) { - return false; - } else { - this.removeExpiredBans(); -- return this.theBanList.containsKey(var1); -+ return this.theBanList.containsKey(par1Str); - } - } - -- public void put(BanEntry var1) { -- this.theBanList.putLower(var1.getBannedUsername(), var1); -+ public void put(BanEntry par1BanEntry) { -+ this.theBanList.putLower(par1BanEntry.getBannedUsername(), par1BanEntry); - this.saveToFileWithHeader(); - } - -- public void remove(String var1) { -- this.theBanList.remove(var1); -+ public void remove(String par1Str) { -+ this.theBanList.remove(par1Str); - this.saveToFileWithHeader(); - } - - public void removeExpiredBans() { - Iterator var1 = this.theBanList.values().iterator(); - -- while(var1.hasNext()) { -+ while (var1.hasNext()) { - BanEntry var2 = (BanEntry)var1.next(); -- if(var2.hasBanExpired()) { -+ -+ if (var2.hasBanExpired()) { - var1.remove(); - } - } -- - } - -+ /** -+ * Loads the ban list from the file (adds every entry, does not clear the current list). -+ */ - public void loadBanList() { -- if(this.b.isFile()) { -+ if (this.fileName.isFile()) { - BufferedReader var1; -+ - try { -- var1 = new BufferedReader(new FileReader(this.b)); -+ var1 = new BufferedReader(new FileReader(this.fileName)); - } catch (FileNotFoundException var4) { - throw new Error(); - } - -- try { -- while(true) { -- String var2 = var1.readLine(); -- if(var2 == null) { -- break; -- } -+ String var2; - -- if(!var2.startsWith("#")) { -+ try { -+ while ((var2 = var1.readLine()) != null) { -+ if (!var2.startsWith("#")) { - BanEntry var3 = BanEntry.parse(var2); -- if(var3 != null) { -+ -+ if (var3 != null) { - this.theBanList.putLower(var3.getBannedUsername(), var3); - } - } -@@ -92,7 +99,6 @@ - } catch (IOException var5) { - MinecraftServer.getServer().getLogAgent().logSevereException("Could not load ban list", var5); - } -- - } - } - -@@ -100,12 +106,16 @@ - this.saveToFile(true); - } - -- public void saveToFile(boolean var1) { -+ /** -+ * par1: include header -+ */ -+ public void saveToFile(boolean par1) { - this.removeExpiredBans(); - - try { -- PrintWriter var2 = new PrintWriter(new FileWriter(this.b, false)); -- if(var1) { -+ PrintWriter var2 = new PrintWriter(new FileWriter(this.fileName, false)); -+ -+ if (par1) { - var2.println("# Updated " + (new SimpleDateFormat()).format(new Date()) + " by Minecraft " + "1.6.4"); - var2.println("# victim name | ban date | banned by | banned until | reason"); - var2.println(); -@@ -113,7 +123,7 @@ - - Iterator var3 = this.theBanList.values().iterator(); - -- while(var3.hasNext()) { -+ while (var3.hasNext()) { - BanEntry var4 = (BanEntry)var3.next(); - var2.println(var4.buildBanString()); - } -@@ -122,6 +132,5 @@ - } catch (IOException var5) { - MinecraftServer.getServer().getLogAgent().logSevereException("Could not save ban list", var5); - } -- - } - } ---- net/minecraft/src/FoliageColorReloadListener.java -+++ net/minecraft/src/FoliageColorReloadListener.java -@@ -5,11 +5,11 @@ - public class FoliageColorReloadListener implements ResourceManagerReloadListener { - private static final ResourceLocation field_130079_a = new ResourceLocation("textures/colormap/foliage.png"); - -- public void onResourceManagerReload(ResourceManager var1) { -+ public void onResourceManagerReload(ResourceManager par1ResourceManager) { - try { -- ColorizerFoliage.setFoliageBiomeColorizer(TextureUtil.readImageData(var1, field_130079_a)); -+ ColorizerFoliage.setFoliageBiomeColorizer(TextureUtil.readImageData(par1ResourceManager, field_130079_a)); - } catch (IOException var3) { -+ ; - } -- - } - } ---- net/minecraft/src/SorterStatsItem.java -+++ net/minecraft/src/SorterStatsItem.java -@@ -4,41 +4,44 @@ - - class SorterStatsItem implements Comparator { - final GuiStats statsGUI; -+ - final GuiSlotStatsItem slotStatsItemGUI; - -- SorterStatsItem(GuiSlotStatsItem var1, GuiStats var2) { -- this.slotStatsItemGUI = var1; -- this.statsGUI = var2; -+ SorterStatsItem(GuiSlotStatsItem par1GuiSlotStatsItem, GuiStats par2GuiStats) { -+ this.slotStatsItemGUI = par1GuiSlotStatsItem; -+ this.statsGUI = par2GuiStats; - } - -- public int func_78337_a(StatCrafting var1, StatCrafting var2) { -- int var3 = var1.getItemID(); -- int var4 = var2.getItemID(); -+ public int func_78337_a(StatCrafting par1StatCrafting, StatCrafting par2StatCrafting) { -+ int var3 = par1StatCrafting.getItemID(); -+ int var4 = par2StatCrafting.getItemID(); - StatBase var5 = null; - StatBase var6 = null; -- if(this.slotStatsItemGUI.field_77264_j == 0) { -+ -+ if (this.slotStatsItemGUI.field_77264_j == 0) { - var5 = StatList.objectBreakStats[var3]; - var6 = StatList.objectBreakStats[var4]; -- } else if(this.slotStatsItemGUI.field_77264_j == 1) { -+ } else if (this.slotStatsItemGUI.field_77264_j == 1) { - var5 = StatList.objectCraftStats[var3]; - var6 = StatList.objectCraftStats[var4]; -- } else if(this.slotStatsItemGUI.field_77264_j == 2) { -+ } else if (this.slotStatsItemGUI.field_77264_j == 2) { - var5 = StatList.objectUseStats[var3]; - var6 = StatList.objectUseStats[var4]; - } - -- if(var5 != null || var6 != null) { -- if(var5 == null) { -+ if (var5 != null || var6 != null) { -+ if (var5 == null) { - return 1; - } - -- if(var6 == null) { -+ if (var6 == null) { - return -1; - } - - int var7 = GuiStats.getStatsFileWriter(this.slotStatsItemGUI.slotGuiStats).writeStat(var5); - int var8 = GuiStats.getStatsFileWriter(this.slotStatsItemGUI.slotGuiStats).writeStat(var6); -- if(var7 != var8) { -+ -+ if (var7 != var8) { - return (var7 - var8) * this.slotStatsItemGUI.field_77265_k; - } - } -@@ -46,7 +49,7 @@ - return var3 - var4; - } - -- public int compare(Object var1, Object var2) { -- return this.func_78337_a((StatCrafting)var1, (StatCrafting)var2); -+ public int compare(Object par1Obj, Object par2Obj) { -+ return this.func_78337_a((StatCrafting)par1Obj, (StatCrafting)par2Obj); - } - } ---- net/minecraft/src/EnchantmentArrowDamage.java -+++ net/minecraft/src/EnchantmentArrowDamage.java -@@ -1,19 +1,28 @@ - package net.minecraft.src; - - public class EnchantmentArrowDamage extends Enchantment { -- public EnchantmentArrowDamage(int var1, int var2) { -- super(var1, var2, EnumEnchantmentType.bow); -+ public EnchantmentArrowDamage(int par1, int par2) { -+ super(par1, par2, EnumEnchantmentType.bow); - this.setName("arrowDamage"); - } - -- public int getMinEnchantability(int var1) { -- return 1 + (var1 - 1) * 10; -- } -- -- public int getMaxEnchantability(int var1) { -- return this.getMinEnchantability(var1) + 15; -- } -- -+ /** -+ * Returns the minimal value of enchantability needed on the enchantment level passed. -+ */ -+ public int getMinEnchantability(int par1) { -+ return 1 + (par1 - 1) * 10; -+ } -+ -+ /** -+ * Returns the maximum value of enchantability nedded on the enchantment level passed. -+ */ -+ public int getMaxEnchantability(int par1) { -+ return this.getMinEnchantability(par1) + 15; -+ } -+ -+ /** -+ * Returns the maximum level that the enchantment can have. -+ */ - public int getMaxLevel() { - return 5; - } ---- net/minecraft/src/ITileEntityProvider.java -+++ net/minecraft/src/ITileEntityProvider.java -@@ -1,5 +1,9 @@ - package net.minecraft.src; - - public interface ITileEntityProvider { -+ -+ /** -+ * Returns a new instance of a block's tile entity class. Called on placing the block. -+ */ - TileEntity createNewTileEntity(World var1); - } ---- net/minecraft/src/CallableJavaInfo2.java -+++ net/minecraft/src/CallableJavaInfo2.java -@@ -3,12 +3,17 @@ - import java.util.concurrent.Callable; - - class CallableJavaInfo2 implements Callable { -+ -+ /** Reference to the CrashReport object. */ - final CrashReport theCrashReport; - -- CallableJavaInfo2(CrashReport var1) { -- this.theCrashReport = var1; -+ CallableJavaInfo2(CrashReport par1CrashReport) { -+ this.theCrashReport = par1CrashReport; - } - -+ /** -+ * Retuns the Java VM Information as a String. Includes the VM Name, VM Info and VM Vendor. -+ */ - public String getJavaVMInfoAsString() { - return System.getProperty("java.vm.name") + " (" + System.getProperty("java.vm.info") + "), " + System.getProperty("java.vm.vendor"); - } ---- /dev/null -+++ com/prupe/mcpatcher/ctm/TileOverrideImpl$VerticalHorizontal.java -@@ -1,0 +1,62 @@ -+package com.prupe.mcpatcher.ctm; -+ -+import com.prupe.mcpatcher.TileLoader; -+import com.prupe.mcpatcher.ctm.TileOverrideImpl$Vertical; -+import java.util.Properties; -+import net.minecraft.src.Block; -+import net.minecraft.src.IBlockAccess; -+import net.minecraft.src.Icon; -+import net.minecraft.src.ResourceLocation; -+ -+final class TileOverrideImpl$VerticalHorizontal extends TileOverrideImpl$Vertical { -+ private static final int[] neighborMap = new int[] {3, 6, 3, 3, 3, 6, 3, 3, 4, 5, 4, 4, 3, 6, 3, 3, 3, 6, 3, 3, 3, 6, 3, 3, 3, 6, 3, 3, 3, 6, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3}; -+ -+ TileOverrideImpl$VerticalHorizontal(ResourceLocation filePrefix, Properties properties, TileLoader tileLoader) { -+ super(filePrefix, properties, tileLoader); -+ } -+ -+ String getMethod() { -+ return "vertical+horizontal"; -+ } -+ -+ String checkTileMap() { -+ return this.getNumberOfTiles() == 7 ? null : "requires exactly 7 tiles"; -+ } -+ -+ Icon getTileImpl(IBlockAccess blockAccess, Block block, Icon origIcon, int i, int j, int k, int face) { -+ Icon icon = super.getTileImpl(blockAccess, block, origIcon, i, j, k, face); -+ -+ if (icon != this.icons[3]) { -+ return icon; -+ } else { -+ int[][] offsets = NEIGHBOR_OFFSET[face]; -+ int neighborBits = 0; -+ -+ if (this.shouldConnect(blockAccess, block, origIcon, i, j, k, face, offsets[this.rotateUV(0)])) { -+ neighborBits |= 1; -+ } -+ -+ if (this.shouldConnect(blockAccess, block, origIcon, i, j, k, face, offsets[this.rotateUV(1)])) { -+ neighborBits |= 2; -+ } -+ -+ if (this.shouldConnect(blockAccess, block, origIcon, i, j, k, face, offsets[this.rotateUV(3)])) { -+ neighborBits |= 4; -+ } -+ -+ if (this.shouldConnect(blockAccess, block, origIcon, i, j, k, face, offsets[this.rotateUV(4)])) { -+ neighborBits |= 8; -+ } -+ -+ if (this.shouldConnect(blockAccess, block, origIcon, i, j, k, face, offsets[this.rotateUV(5)])) { -+ neighborBits |= 16; -+ } -+ -+ if (this.shouldConnect(blockAccess, block, origIcon, i, j, k, face, offsets[this.rotateUV(7)])) { -+ neighborBits |= 32; -+ } -+ -+ return this.icons[neighborMap[neighborBits]]; -+ } -+ } -+} ---- net/minecraft/src/CallablePacketID.java -+++ net/minecraft/src/CallablePacketID.java -@@ -4,11 +4,12 @@ - - class CallablePacketID implements Callable { - final Packet thePacket; -+ - final NetServerHandler theNetServerHandler; - -- CallablePacketID(NetServerHandler var1, Packet var2) { -- this.theNetServerHandler = var1; -- this.thePacket = var2; -+ CallablePacketID(NetServerHandler par1NetServerHandler, Packet par2Packet) { -+ this.theNetServerHandler = par1NetServerHandler; -+ this.thePacket = par2Packet; - } - - public String callPacketID() { ---- net/minecraft/src/CommandServerDeop.java -+++ net/minecraft/src/CommandServerDeop.java -@@ -8,24 +8,30 @@ - return "deop"; - } - -+ /** -+ * Return the required permission level for this command. -+ */ - public int getRequiredPermissionLevel() { - return 3; - } - -- public String getCommandUsage(ICommandSender var1) { -+ public String getCommandUsage(ICommandSender par1ICommandSender) { - return "commands.deop.usage"; - } - -- public void processCommand(ICommandSender var1, String[] var2) { -- if(var2.length == 1 && var2[0].length() > 0) { -- MinecraftServer.getServer().getConfigurationManager().removeOp(var2[0]); -- notifyAdmins(var1, "commands.deop.success", new Object[]{var2[0]}); -+ public void processCommand(ICommandSender par1ICommandSender, String[] par2ArrayOfStr) { -+ if (par2ArrayOfStr.length == 1 && par2ArrayOfStr[0].length() > 0) { -+ MinecraftServer.getServer().getConfigurationManager().removeOp(par2ArrayOfStr[0]); -+ notifyAdmins(par1ICommandSender, "commands.deop.success", new Object[] {par2ArrayOfStr[0]}); - } else { - throw new WrongUsageException("commands.deop.usage", new Object[0]); - } - } - -- public List addTabCompletionOptions(ICommandSender var1, String[] var2) { -- return var2.length == 1 ? getListOfStringsFromIterableMatchingLastWord(var2, MinecraftServer.getServer().getConfigurationManager().getOps()) : null; -+ /** -+ * Adds the strings available in this command to the given list of tab completion options. -+ */ -+ public List addTabCompletionOptions(ICommandSender par1ICommandSender, String[] par2ArrayOfStr) { -+ return par2ArrayOfStr.length == 1 ? getListOfStringsFromIterableMatchingLastWord(par2ArrayOfStr, MinecraftServer.getServer().getConfigurationManager().getOps()) : null; - } - } ---- /dev/null -+++ org/spoutcraft/api/gui/HungerBar.java -@@ -1,0 +1,140 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.api.gui; -+ -+import java.io.IOException; -+import java.util.UUID; -+ -+import org.spoutcraft.api.Spoutcraft; -+import org.spoutcraft.api.UnsafeClass; -+import org.spoutcraft.api.io.SpoutInputStream; -+import org.spoutcraft.api.io.SpoutOutputStream; -+ -+@UnsafeClass -+public class HungerBar extends GenericWidget { -+ private int icons = 10; -+ private int iconOffset = 8; -+ private int updateCounter = 0; -+ -+ public HungerBar() { -+ super(); -+ setX(427 / 2 + 82); // 295 -+ setY(201); -+ setAnchor(WidgetAnchor.BOTTOM_CENTER); -+ } -+ -+ @Override -+ public void readData(SpoutInputStream input) throws IOException { -+ super.readData(input); -+ setNumOfIcons(input.readInt()); -+ setIconOffset(input.readInt()); -+ } -+ -+ @Override -+ public void writeData(SpoutOutputStream output) throws IOException { -+ super.writeData(output); -+ output.writeInt(getNumOfIcons()); -+ output.writeInt(getIconOffset()); -+ } -+ -+ @Override -+ public double getScreenX() { -+ double mid = getScreen() != null ? getScreen().getWidth() / 2 : 427 / 2D; -+ double diff = super.getScreenX() - mid - 376; -+ return getScreen() != null ? getScreen().getWidth() / 2D - diff : this.getX(); -+ } -+ -+ @Override -+ public double getScreenY() { -+ int diff = (int) (240 - this.getY()); -+ return getScreen() != null ? getScreen().getHeight() - diff : this.getY(); -+ } -+ -+ /** -+ * Gets the maximum number of food icons to display on the HUD. -+ * -+ * Hunger bar is scaled to fit the number of icons appropriately. -+ * -+ * @return icons displayed -+ */ -+ public int getNumOfIcons() { -+ return icons; -+ } -+ -+ /** -+ * Sets the maximum number of food icons to display on the HUD. -+ * -+ * Hunger bar is scaled to fit the number of icons appropriately. -+ * -+ * @param icons to display -+ * @return this -+ */ -+ public HungerBar setNumOfIcons(int icons) { -+ this.icons = icons; -+ return this; -+ } -+ -+ /** -+ * Gets the number of pixels each icon is offset when drawing the next icon. -+ * -+ * @return pixel offset -+ */ -+ public int getIconOffset() { -+ return iconOffset; -+ } -+ -+ /** -+ * Sets the number of pixels each icon is offset when drawing the next icon. -+ * -+ * @param iconOffset when drawing icons -+ * @return this -+ */ -+ public HungerBar setIconOffset(int iconOffset) { -+ this.iconOffset = iconOffset; -+ return this; -+ } -+ -+ @Override -+ public void onTick() { -+ super.onTick(); -+ updateCounter++; -+ } -+ -+ public int getUpdateCounter() { -+ return updateCounter; -+ } -+ -+ public WidgetType getType() { -+ return WidgetType.HungerBar; -+ } -+ -+ public UUID getId() { -+ return new UUID(0, 5); -+ } -+ -+ public void render() { -+ Spoutcraft.getClient().getRenderDelegate().render(this); -+ } -+ -+ @Override -+ public int getVersion() { -+ return super.getVersion() + 1; -+ } -+} ---- net/minecraft/src/CreativeTabCombat.java -+++ net/minecraft/src/CreativeTabCombat.java -@@ -1,10 +1,13 @@ - package net.minecraft.src; - - final class CreativeTabCombat extends CreativeTabs { -- CreativeTabCombat(int var1, String var2) { -- super(var1, var2); -+ CreativeTabCombat(int par1, String par2Str) { -+ super(par1, par2Str); - } - -+ /** -+ * the itemID for the item to be displayed on the tab -+ */ - public int getTabIconItemIndex() { - return Block.brick.blockID; - } ---- net/minecraft/src/EntityAIAvoidEntity.java -+++ net/minecraft/src/EntityAIAvoidEntity.java -@@ -4,38 +4,51 @@ - - public class EntityAIAvoidEntity extends EntityAIBase { - public final IEntitySelector field_98218_a = new EntityAIAvoidEntitySelector(this); -+ -+ /** The entity we are attached to */ - private EntityCreature theEntity; - private double farSpeed; - private double nearSpeed; - private Entity closestLivingEntity; - private float distanceFromEntity; -+ -+ /** The PathEntity of our entity */ - private PathEntity entityPathEntity; -+ -+ /** The PathNavigate of our entity */ - private PathNavigate entityPathNavigate; -- private Class i; -- -- public EntityAIAvoidEntity(EntityCreature var1, Class var2, float var3, double var4, double var6) { -- this.theEntity = var1; -- this.i = var2; -- this.distanceFromEntity = var3; -- this.farSpeed = var4; -- this.nearSpeed = var6; -- this.entityPathNavigate = var1.getNavigator(); -+ -+ /** The class of the entity we should avoid */ -+ private Class targetEntityClass; -+ -+ public EntityAIAvoidEntity(EntityCreature par1EntityCreature, Class par2Class, float par3, double par4, double par6) { -+ this.theEntity = par1EntityCreature; -+ this.targetEntityClass = par2Class; -+ this.distanceFromEntity = par3; -+ this.farSpeed = par4; -+ this.nearSpeed = par6; -+ this.entityPathNavigate = par1EntityCreature.getNavigator(); - this.setMutexBits(1); - } - -+ /** -+ * Returns whether the EntityAIBase should begin execution. -+ */ - public boolean shouldExecute() { -- if(this.i == EntityPlayer.class) { -- if(this.theEntity instanceof EntityTameable && ((EntityTameable)this.theEntity).isTamed()) { -+ if (this.targetEntityClass == EntityPlayer.class) { -+ if (this.theEntity instanceof EntityTameable && ((EntityTameable)this.theEntity).isTamed()) { - return false; - } - - this.closestLivingEntity = this.theEntity.worldObj.getClosestPlayerToEntity(this.theEntity, (double)this.distanceFromEntity); -- if(this.closestLivingEntity == null) { -+ -+ if (this.closestLivingEntity == null) { - return false; - } - } else { -- List var1 = this.theEntity.worldObj.selectEntitiesWithinAABB(this.i, this.theEntity.boundingBox.expand((double)this.distanceFromEntity, 3.0D, (double)this.distanceFromEntity), this.field_98218_a); -- if(var1.isEmpty()) { -+ List var1 = this.theEntity.worldObj.selectEntitiesWithinAABB(this.targetEntityClass, this.theEntity.boundingBox.expand((double)this.distanceFromEntity, 3.0D, (double)this.distanceFromEntity), this.field_98218_a); -+ -+ if (var1.isEmpty()) { - return false; - } - -@@ -43,9 +56,10 @@ - } - - Vec3 var2 = RandomPositionGenerator.findRandomTargetBlockAwayFrom(this.theEntity, 16, 7, this.theEntity.worldObj.getWorldVec3Pool().getVecFromPool(this.closestLivingEntity.posX, this.closestLivingEntity.posY, this.closestLivingEntity.posZ)); -- if(var2 == null) { -+ -+ if (var2 == null) { - return false; -- } else if(this.closestLivingEntity.getDistanceSq(var2.xCoord, var2.yCoord, var2.zCoord) < this.closestLivingEntity.getDistanceSqToEntity(this.theEntity)) { -+ } else if (this.closestLivingEntity.getDistanceSq(var2.xCoord, var2.yCoord, var2.zCoord) < this.closestLivingEntity.getDistanceSqToEntity(this.theEntity)) { - return false; - } else { - this.entityPathEntity = this.entityPathNavigate.getPathToXYZ(var2.xCoord, var2.yCoord, var2.zCoord); -@@ -53,28 +67,39 @@ - } - } - -+ /** -+ * Returns whether an in-progress EntityAIBase should continue executing -+ */ - public boolean continueExecuting() { - return !this.entityPathNavigate.noPath(); - } - -+ /** -+ * Execute a one shot task or start executing a continuous task -+ */ - public void startExecuting() { - this.entityPathNavigate.setPath(this.entityPathEntity, this.farSpeed); - } - -+ /** -+ * Resets the task -+ */ - public void resetTask() { - this.closestLivingEntity = null; - } - -+ /** -+ * Updates the task -+ */ - public void updateTask() { -- if(this.theEntity.getDistanceSqToEntity(this.closestLivingEntity) < 49.0D) { -+ if (this.theEntity.getDistanceSqToEntity(this.closestLivingEntity) < 49.0D) { - this.theEntity.getNavigator().setSpeed(this.nearSpeed); - } else { - this.theEntity.getNavigator().setSpeed(this.farSpeed); - } -- - } - -- static EntityCreature func_98217_a(EntityAIAvoidEntity var0) { -- return var0.theEntity; -+ static EntityCreature func_98217_a(EntityAIAvoidEntity par0EntityAIAvoidEntity) { -+ return par0EntityAIAvoidEntity.theEntity; - } - } ---- /dev/null -+++ org/spoutcraft/client/config/SettingsHandler.java -@@ -1,0 +1,522 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.client.config; -+ -+import java.io.BufferedReader; -+import java.io.BufferedWriter; -+import java.io.File; -+import java.io.FileNotFoundException; -+import java.io.FileOutputStream; -+import java.io.FileReader; -+import java.io.FileWriter; -+import java.io.IOException; -+import java.io.InputStream; -+import java.util.HashMap; -+ -+/** -+ * Settings Handler
-+ * A new better way of handling settings/configs without the complexity of -+ * YAML or using Bukkit's Configuration Class (If this is for a Bukkit plugin). -+ * @version 1.4 -+ */ -+public class SettingsHandler { -+ private File out; -+ private Boolean cached = false; -+ private String resource = null; -+ private HashMap cache; -+ private InputStream input = null; -+ -+ /** -+ * Constructor for the Settings/Config file. -+ * Note: The resource must be in the same package or sub package -+ * as this. If in a Sub directory the resource parameter -+ * is the path to it from this class file. -+ * @param String resource -+ * @param File out -+ */ -+ public SettingsHandler(String resource, String out) { -+ this.resource = resource; -+ this.out = new File(out); -+ } -+ -+ /** -+ * Constructor for the Settings/Config file. -+ * Note: The resource must be in the same package or sub package -+ * as this. If in a sub directory the resource parameter -+ * is the path to it from this class file. -+ * @param String resource -+ * @param File out -+ */ -+ public SettingsHandler(String resource, File out) { -+ this.resource = resource; -+ this.out = out; -+ } -+ -+ /** -+ * Constructor for the Settings/Config file. -+ * Note: I discourage the use of this constructor, as it is not a fully tested as it should be. -+ * @param InputStream input -+ * @param File out -+ */ -+ public SettingsHandler(InputStream input, File out) { -+ this.input = input; -+ this.out = out; -+ } -+ -+ /** -+ * Constructor for the Settings/Config file. -+ * Note: This file must exist. -+ * @param String out -+ * @throws FileNotFoundException -+ */ -+ public SettingsHandler(File out) throws FileNotFoundException { -+ if (!out.exists()) { -+ throw new FileNotFoundException("The out does not exist."); -+ } -+ this.out = out; -+ } -+ -+ /** -+ * Returns whether caching is enabled.
-+ * See {@link #setCached(Boolean) setCached(Boolean)} for more info on caching -+ * @return Boolean cached -+ */ -+ public Boolean isCached() { -+ return this.cached; -+ } -+ -+ /** -+ * -+ * @param Boolean cached -+ */ -+ public void setCached(Boolean cached) { -+ this.cached = cached; -+ if (this.cached = false) { -+ this.cache = null; -+ } -+ } -+ -+ /** -+ * Private method that takes the resource and writes it to the File out. -+ * @param String name -+ */ -+ private void create(String resource) { -+ InputStream input = getClass().getResourceAsStream(resource); -+ if (input != null) { -+ FileOutputStream output = null; -+ try { -+ //noinspection ResultOfMethodCallIgnored -+ out.getParentFile().mkdirs(); -+ output = new FileOutputStream(out); -+ byte[] buf = new byte[8192]; -+ int length; -+ -+ while ((length = input.read(buf)) > 0) { -+ output.write(buf, 0, length); -+ } -+ -+ } catch (Exception e) { -+ e.printStackTrace(); -+ } finally { -+ try { -+ input.close(); -+ } catch (Exception ignored) { -+ } -+ try { -+ if (output != null) { -+ output.close(); -+ } -+ } catch (Exception ignored) { -+ } -+ } -+ } -+ } -+ -+ /** -+ * Private method that takes the InputStream and it writes it to the File out -+ * @param InputStream input -+ */ -+ private void create(InputStream input) { -+ if (input != null) { -+ FileOutputStream output = null; -+ try { -+ output = new FileOutputStream(out); -+ byte[] buf = new byte[8192]; -+ int length; -+ -+ while ((length = input.read(buf)) > 0) { -+ output.write(buf, 0, length); -+ } -+ -+ } catch (Exception e) { -+ e.printStackTrace(); -+ } finally { -+ try { -+ input.close(); -+ } catch (Exception ignored) { -+ } -+ try { -+ if (output != null) { -+ output.close(); -+ } -+ } catch (Exception ignored) { -+ } -+ } -+ } -+ } -+ -+ /** -+ * Private method that loads the properties in a HashMap. -+ * @return HashMap result -+ */ -+ private HashMap loadHashMap() { -+ HashMap result = new HashMap(); -+ -+ try { -+ BufferedReader br = new BufferedReader(new FileReader(out)); -+ String line; -+ -+ while ((line = br.readLine()) != null) { -+ if ((line.isEmpty()) || (line.startsWith("#")) || (!line.contains(": "))) { -+ continue; -+ } -+ String[] args = line.split(": "); -+ if (args.length < 2) { -+ result.put(args[0], null); -+ continue; -+ } -+ result.put(args[0], args[1]); -+ } -+ br.close(); -+ } catch (IOException ex) { -+ ex.printStackTrace(); -+ } -+ -+ return result; -+ } -+ -+ /** -+ * Call this method before doing anything else with SettingsHandler. -+ * The only exception to this is {@link #setCached(Boolean) setCanced(Boolean)}. -+ * If caching is enabled then it will load the Properties into the cache. -+ */ -+ public void load() { -+ if (this.resource != null && !out.exists()) { -+ create(resource); -+ } -+ if (this.input != null && !out.exists()) { -+ create(input); -+ } -+ if (this.cached) { -+ this.cache = this.loadHashMap(); -+ } -+ -+ } -+ -+ /** -+ * Returns the value of a property as a String -+ * @param String property -+ * @return String value -+ */ -+ public String getPropertyString(String property) { -+ try { -+ if (this.cached) { -+ return this.cache.get(property); -+ } else { -+ HashMap contents = this.loadHashMap(); -+ return contents.get(property); -+ } -+ } catch (Exception e) { -+ e.printStackTrace(); -+ } -+ return null; -+ } -+ -+ /** -+ * Returns the value of a property as a Integer -+ * @param String property -+ * @return Integer value -+ */ -+ public Integer getPropertyInteger(String property) { -+ try { -+ if (this.cached) { -+ return Integer.parseInt(this.cache.get(property)); -+ } else { -+ HashMap contents = this.loadHashMap(); -+ return Integer.parseInt(contents.get(property)); -+ } -+ } catch (Exception e) { -+ e.printStackTrace(); -+ } -+ return null; -+ } -+ -+ /** -+ * Returns the value of a property as a Boolean -+ * @param String property -+ * @return Boolean value -+ */ -+ public Boolean getPropertyBoolean(String property) { -+ try { -+ String result; -+ if (this.cached) { -+ result = this.cache.get(property); -+ } else { -+ HashMap contents = this.loadHashMap(); -+ result = contents.get(property); -+ } -+ if (result == null) { -+ return false; -+ } -+ if (result.equalsIgnoreCase("true") || result.equalsIgnoreCase("false")) { -+ return Boolean.valueOf(result.toLowerCase()); -+ } else { -+ return false; -+ } -+ } catch (Exception e) { -+ e.printStackTrace(); -+ } -+ return null; -+ } -+ -+ /** -+ * Returns the value of a property as a Double -+ * @param String property -+ * @return Double value -+ */ -+ public Double getPropertyDouble(String property) { -+ try { -+ String result; -+ if (this.cached) { -+ result = this.cache.get(property); -+ } else { -+ HashMap contents = this.loadHashMap(); -+ result = contents.get(property); -+ } -+ if (!result.contains(".")) { -+ result += ".0"; -+ } -+ return Double.parseDouble(result); -+ } catch (Exception e) { -+ e.printStackTrace(); -+ } -+ return null; -+ } -+ -+ /** -+ * Returns true if a property exists -+ * @param String property -+ * @return Boolean check -+ */ -+ public Boolean checkProperty(String property) { -+ String check; -+ try { -+ if (this.cached) { -+ check = this.cache.get(property); -+ } else { -+ HashMap contents = this.loadHashMap(); -+ check = contents.get(property); -+ } -+ if (check != null) { -+ return true; -+ } -+ } catch (Exception e) { -+ return false; -+ } -+ -+ return false; -+ } -+ -+ // Editing the Settings/Config File Methods \\ -+ -+ /** -+ * Private method that writes out the new Settings/Config file after changes are made. -+ * If caching is enabled, it will call the -+ * {@link #load() load()} method. -+ * -+ * @param HashMap newContents -+ */ -+ private void flush(HashMap newContents) { -+ try { -+ this.delFile(out); -+ //noinspection ResultOfMethodCallIgnored -+ out.createNewFile(); -+ BufferedWriter writer = new BufferedWriter(new FileWriter(out)); -+ for (int i = 1; i <= newContents.size(); i ++) { -+ String line = newContents.get(i); -+ if (line == null) { -+ writer.append("\n"); -+ continue; -+ } -+ writer.append(line); -+ writer.append("\n"); -+ } -+ writer.flush(); -+ writer.close(); -+ if (cached) { -+ this.load(); -+ } -+ } catch (Exception e) { -+ e.printStackTrace(); -+ } -+ } -+ -+ /** -+ * Private method used by {@link #flush(HashMap) flush(HashMap)} to delete the old -+ * Settings/Config file. -+ * @param File file -+ */ -+ private void delFile(File file) { -+ if (file.exists()) { -+ //noinspection ResultOfMethodCallIgnored -+ file.delete(); -+ } -+ } -+ -+ /** -+ * Private method to get a HashMap of the contents of the Settings/Contents file. -+ * They are stored as lines indexed by the line number. -+ * @return HashMap contents -+ */ -+ private HashMap getAllFileContents() { -+ HashMap result = new HashMap(); -+ Integer i = 1; -+ try { -+ BufferedReader br = new BufferedReader(new FileReader(out)); -+ String line; -+ -+ while ((line = br.readLine()) != null) { -+ if (line.isEmpty()) { -+ result.put(i, null); -+ i ++; -+ continue; -+ } -+ -+ result.put(i, line); -+ i ++; -+ } -+ br.close(); -+ } catch (Exception ex) { -+ //ex.printStackTrace(); -+ } -+ -+ return result; -+ } -+ -+ /** -+ * Allows you to add a comment to the end of the end of the file. -+ * @param String comment -+ */ -+ public void insertComment(String comment) { -+ HashMap contents = this.getAllFileContents(); -+ contents.put(contents.size() + 1, "#" + comment); -+ this.flush(contents); -+ } -+ -+ /** -+ * Allows to add a comment at the line that you specify. -+ * @param String comment -+ * @param Integer line -+ */ -+ public void insertComment(String comment, Integer line) { -+ HashMap contents = this.getAllFileContents(); -+ if (line >= contents.size() + 1) { -+ return; -+ } -+ HashMap newContents = new HashMap(); -+ for (int i = 1; i < line; i ++) { -+ newContents.put(i, contents.get(i)); -+ } -+ newContents.put(line, "#" + comment); -+ for (int i = line; i <= contents.size(); i ++) { -+ newContents.put(i + 1, contents.get(i)); -+ } -+ this.flush(newContents); -+ } -+ -+ /** -+ * Allows you to add a property at the end of the file. -+ * @param String property -+ * @param Object obj -+ */ -+ public void put(String property, Object obj) { -+ HashMap contents = this.getAllFileContents(); -+ contents.put(contents.size() + 1, property + ": " + obj.toString()); -+ this.flush(contents); -+ } -+ -+ /** -+ * Allows you to add a property at the line that you specify -+ * @param String property -+ * @param Object obj -+ * @param Integer line -+ */ -+ public void put(String property, Object obj, Integer line) { -+ HashMap contents = this.getAllFileContents(); -+ if (line >= contents.size() + 1) { -+ return; -+ } -+ HashMap newContents = new HashMap(); -+ for (int i = 1; i < line; i ++) { -+ newContents.put(i, contents.get(i)); -+ } -+ newContents.put(line, property + ": " + obj.toString()); -+ for (int i = line; i <= contents.size(); i ++) { -+ newContents.put(i + 1, contents.get(i)); -+ } -+ this.flush(newContents); -+ } -+ -+ /** -+ * Allows you to change the value of a property. -+ * @param String property -+ * @param Object obj -+ */ -+ public void changeProperty(String property, Object obj) { -+ HashMap contents = this.getAllFileContents(); -+ if ((contents == null)) { -+ return; -+ } -+ for (int i = 1; i <= contents.size(); i ++) { -+ if (contents.get(i) == null) { -+ continue; -+ } -+ String check = contents.get(i); -+ if (check.startsWith(property)) { -+ check = check.replace(property, ""); -+ if (!(check.startsWith(": "))) { -+ continue; -+ } -+ contents.remove(i); -+ contents.put(i, property + ": " + obj.toString()); -+ } -+ } -+ this.flush(contents); -+ } -+ -+ /** -+ * Returns the amount of the lines in the file. It ignores the last line if it is empty. -+ * @return Integer lineCount -+ */ -+ public Integer getLineCount() { -+ HashMap contents = this.getAllFileContents(); -+ return contents.size(); -+ } -+} ---- net/minecraft/src/Packet106Transaction.java -+++ net/minecraft/src/Packet106Transaction.java -@@ -5,35 +5,48 @@ - import java.io.IOException; - - public class Packet106Transaction extends Packet { -+ -+ /** The id of the window that the action occurred in. */ - public int windowId; - public short shortWindowId; - public boolean accepted; - -- public Packet106Transaction() { -- } -- -- public Packet106Transaction(int var1, short var2, boolean var3) { -- this.windowId = var1; -- this.shortWindowId = var2; -- this.accepted = var3; -- } -- -- public void processPacket(NetHandler var1) { -- var1.handleTransaction(this); -- } -- -- public void readPacketData(DataInput var1) throws IOException { -- this.windowId = var1.readByte(); -- this.shortWindowId = var1.readShort(); -- this.accepted = var1.readByte() != 0; -- } -- -- public void writePacketData(DataOutput var1) throws IOException { -- var1.writeByte(this.windowId); -- var1.writeShort(this.shortWindowId); -- var1.writeByte(this.accepted ? 1 : 0); -- } -- -+ public Packet106Transaction() {} -+ -+ public Packet106Transaction(int par1, short par2, boolean par3) { -+ this.windowId = par1; -+ this.shortWindowId = par2; -+ this.accepted = par3; -+ } -+ -+ /** -+ * Passes this Packet on to the NetHandler for processing. -+ */ -+ public void processPacket(NetHandler par1NetHandler) { -+ par1NetHandler.handleTransaction(this); -+ } -+ -+ /** -+ * Abstract. Reads the raw packet data from the data stream. -+ */ -+ public void readPacketData(DataInput par1DataInput) throws IOException { -+ this.windowId = par1DataInput.readByte(); -+ this.shortWindowId = par1DataInput.readShort(); -+ this.accepted = par1DataInput.readByte() != 0; -+ } -+ -+ /** -+ * Abstract. Writes the raw packet data to the data stream. -+ */ -+ public void writePacketData(DataOutput par1DataOutput) throws IOException { -+ par1DataOutput.writeByte(this.windowId); -+ par1DataOutput.writeShort(this.shortWindowId); -+ par1DataOutput.writeByte(this.accepted ? 1 : 0); -+ } -+ -+ /** -+ * Abstract. Return the size of the packet (not counting the header). -+ */ - public int getPacketSize() { - return 4; - } ---- net/minecraft/src/GuiYesNo.java -+++ net/minecraft/src/GuiYesNo.java -@@ -1,44 +1,67 @@ - package net.minecraft.src; - - public class GuiYesNo extends GuiScreen { -+ -+ /** -+ * A reference to the screen object that created this. Used for navigating between screens. -+ */ - protected GuiScreen parentScreen; -- protected String b; -- private String p; -- protected String c; -- protected String d; -+ -+ /** First line of text. */ -+ protected String message1; -+ -+ /** Second line of text. */ -+ private String message2; -+ -+ /** The text shown for the first button in GuiYesNo */ -+ protected String buttonText1; -+ -+ /** The text shown for the second button in GuiYesNo */ -+ protected String buttonText2; -+ -+ /** World number to be deleted. */ - protected int worldNumber; - -- public GuiYesNo(GuiScreen var1, String var2, String var3, int var4) { -- this.parentScreen = var1; -- this.b = var2; -- this.p = var3; -- this.worldNumber = var4; -- this.c = I18n.getString("gui.yes"); -- this.d = I18n.getString("gui.no"); -- } -- -- public GuiYesNo(GuiScreen var1, String var2, String var3, String var4, String var5, int var6) { -- this.parentScreen = var1; -- this.b = var2; -- this.p = var3; -- this.c = var4; -- this.d = var5; -- this.worldNumber = var6; -- } -- -+ public GuiYesNo(GuiScreen par1GuiScreen, String par2Str, String par3Str, int par4) { -+ this.parentScreen = par1GuiScreen; -+ this.message1 = par2Str; -+ this.message2 = par3Str; -+ this.worldNumber = par4; -+ this.buttonText1 = I18n.getString("gui.yes"); -+ this.buttonText2 = I18n.getString("gui.no"); -+ } -+ -+ public GuiYesNo(GuiScreen par1GuiScreen, String par2Str, String par3Str, String par4Str, String par5Str, int par6) { -+ this.parentScreen = par1GuiScreen; -+ this.message1 = par2Str; -+ this.message2 = par3Str; -+ this.buttonText1 = par4Str; -+ this.buttonText2 = par5Str; -+ this.worldNumber = par6; -+ } -+ -+ /** -+ * Adds the buttons (and other controls) to the screen in question. -+ */ - public void initGui() { -- this.i.add(new GuiSmallButton(0, this.width / 2 - 155, this.height / 6 + 96, this.c)); -- this.i.add(new GuiSmallButton(1, this.width / 2 - 155 + 160, this.height / 6 + 96, this.d)); -- } -- -- protected void actionPerformed(GuiButton var1) { -- this.parentScreen.confirmClicked(var1.id == 0, this.worldNumber); -- } -- -- public void drawScreen(int var1, int var2, float var3) { -+ this.buttonList.add(new GuiSmallButton(0, this.width / 2 - 155, this.height / 6 + 96, this.buttonText1)); -+ this.buttonList.add(new GuiSmallButton(1, this.width / 2 - 155 + 160, this.height / 6 + 96, this.buttonText2)); -+ } -+ -+ /** -+ * Fired when a control is clicked. This is the equivalent of ActionListener.actionPerformed(ActionEvent e). -+ */ -+ protected void actionPerformed(GuiButton par1GuiButton) { -+ this.parentScreen.confirmClicked(par1GuiButton.id == 0, this.worldNumber); -+ } -+ -+ /** -+ * Draws the screen and all the components in it. -+ */ -+ public void drawScreen(int par1, int par2, float par3) { - this.drawDefaultBackground(); -- this.drawCenteredString(this.fontRenderer, this.b, this.width / 2, 70, 16777215); -- this.drawCenteredString(this.fontRenderer, this.p, this.width / 2, 90, 16777215); -- super.drawScreen(var1, var2, var3); -+ this.drawCenteredString(this.fontRenderer, this.message1, this.width / 2, 70, 16777215); -+ this.drawCenteredString(this.fontRenderer, this.message2, this.width / 2, 90, 16777215); -+ super.drawScreen(par1, par2, par3); - } - } ---- net/minecraft/src/SharedMonsterAttributes.java -+++ net/minecraft/src/SharedMonsterAttributes.java -@@ -8,14 +8,14 @@ - public static final Attribute maxHealth = (new RangedAttribute("generic.maxHealth", 20.0D, 0.0D, Double.MAX_VALUE)).func_111117_a("Max Health").setShouldWatch(true); - public static final Attribute followRange = (new RangedAttribute("generic.followRange", 32.0D, 0.0D, 2048.0D)).func_111117_a("Follow Range"); - public static final Attribute knockbackResistance = (new RangedAttribute("generic.knockbackResistance", 0.0D, 0.0D, 1.0D)).func_111117_a("Knockback Resistance"); -- public static final Attribute movementSpeed = (new RangedAttribute("generic.movementSpeed", (double)0.7F, 0.0D, Double.MAX_VALUE)).func_111117_a("Movement Speed").setShouldWatch(true); -+ public static final Attribute movementSpeed = (new RangedAttribute("generic.movementSpeed", 0.699999988079071D, 0.0D, Double.MAX_VALUE)).func_111117_a("Movement Speed").setShouldWatch(true); - public static final Attribute attackDamage = new RangedAttribute("generic.attackDamage", 2.0D, 0.0D, Double.MAX_VALUE); - -- public static NBTTagList func_111257_a(BaseAttributeMap var0) { -+ public static NBTTagList func_111257_a(BaseAttributeMap par0BaseAttributeMap) { - NBTTagList var1 = new NBTTagList(); -- Iterator var2 = var0.getAllAttributes().iterator(); -+ Iterator var2 = par0BaseAttributeMap.getAllAttributes().iterator(); - -- while(var2.hasNext()) { -+ while (var2.hasNext()) { - AttributeInstance var3 = (AttributeInstance)var2.next(); - var1.appendTag(func_111261_a(var3)); - } -@@ -23,19 +23,21 @@ - return var1; - } - -- private static NBTTagCompound func_111261_a(AttributeInstance var0) { -+ private static NBTTagCompound func_111261_a(AttributeInstance par0AttributeInstance) { - NBTTagCompound var1 = new NBTTagCompound(); -- Attribute var2 = var0.func_111123_a(); -+ Attribute var2 = par0AttributeInstance.func_111123_a(); - var1.setString("Name", var2.getAttributeUnlocalizedName()); -- var1.setDouble("Base", var0.getBaseValue()); -- Collection var3 = var0.func_111122_c(); -- if(var3 != null && !var3.isEmpty()) { -+ var1.setDouble("Base", par0AttributeInstance.getBaseValue()); -+ Collection var3 = par0AttributeInstance.func_111122_c(); -+ -+ if (var3 != null && !var3.isEmpty()) { - NBTTagList var4 = new NBTTagList(); - Iterator var5 = var3.iterator(); - -- while(var5.hasNext()) { -+ while (var5.hasNext()) { - AttributeModifier var6 = (AttributeModifier)var5.next(); -- if(var6.isSaved()) { -+ -+ if (var6.isSaved()) { - var4.appendTag(func_111262_a(var6)); - } - } -@@ -46,49 +48,50 @@ - return var1; - } - -- private static NBTTagCompound func_111262_a(AttributeModifier var0) { -+ private static NBTTagCompound func_111262_a(AttributeModifier par0AttributeModifier) { - NBTTagCompound var1 = new NBTTagCompound(); -- var1.setString("Name", var0.getName()); -- var1.setDouble("Amount", var0.getAmount()); -- var1.setInteger("Operation", var0.getOperation()); -- var1.setLong("UUIDMost", var0.getID().getMostSignificantBits()); -- var1.setLong("UUIDLeast", var0.getID().getLeastSignificantBits()); -+ var1.setString("Name", par0AttributeModifier.getName()); -+ var1.setDouble("Amount", par0AttributeModifier.getAmount()); -+ var1.setInteger("Operation", par0AttributeModifier.getOperation()); -+ var1.setLong("UUIDMost", par0AttributeModifier.getID().getMostSignificantBits()); -+ var1.setLong("UUIDLeast", par0AttributeModifier.getID().getLeastSignificantBits()); - return var1; - } - -- public static void func_111260_a(BaseAttributeMap var0, NBTTagList var1, ILogAgent var2) { -- for(int var3 = 0; var3 < var1.tagCount(); ++var3) { -- NBTTagCompound var4 = (NBTTagCompound)var1.tagAt(var3); -- AttributeInstance var5 = var0.getAttributeInstanceByName(var4.getString("Name")); -- if(var5 != null) { -+ public static void func_111260_a(BaseAttributeMap par0BaseAttributeMap, NBTTagList par1NBTTagList, ILogAgent par2ILogAgent) { -+ for (int var3 = 0; var3 < par1NBTTagList.tagCount(); ++var3) { -+ NBTTagCompound var4 = (NBTTagCompound)par1NBTTagList.tagAt(var3); -+ AttributeInstance var5 = par0BaseAttributeMap.getAttributeInstanceByName(var4.getString("Name")); -+ -+ if (var5 != null) { - func_111258_a(var5, var4); -- } else if(var2 != null) { -- var2.logWarning("Ignoring unknown attribute \'" + var4.getString("Name") + "\'"); -+ } else if (par2ILogAgent != null) { -+ par2ILogAgent.logWarning("Ignoring unknown attribute \'" + var4.getString("Name") + "\'"); - } - } -- - } - -- private static void func_111258_a(AttributeInstance var0, NBTTagCompound var1) { -- var0.setAttribute(var1.getDouble("Base")); -- if(var1.hasKey("Modifiers")) { -- NBTTagList var2 = var1.getTagList("Modifiers"); -- -- for(int var3 = 0; var3 < var2.tagCount(); ++var3) { -+ private static void func_111258_a(AttributeInstance par0AttributeInstance, NBTTagCompound par1NBTTagCompound) { -+ par0AttributeInstance.setAttribute(par1NBTTagCompound.getDouble("Base")); -+ -+ if (par1NBTTagCompound.hasKey("Modifiers")) { -+ NBTTagList var2 = par1NBTTagCompound.getTagList("Modifiers"); -+ -+ for (int var3 = 0; var3 < var2.tagCount(); ++var3) { - AttributeModifier var4 = func_111259_a((NBTTagCompound)var2.tagAt(var3)); -- AttributeModifier var5 = var0.getModifier(var4.getID()); -- if(var5 != null) { -- var0.removeModifier(var5); -+ AttributeModifier var5 = par0AttributeInstance.getModifier(var4.getID()); -+ -+ if (var5 != null) { -+ par0AttributeInstance.removeModifier(var5); - } - -- var0.applyModifier(var4); -+ par0AttributeInstance.applyModifier(var4); - } - } -- - } - -- public static AttributeModifier func_111259_a(NBTTagCompound var0) { -- UUID var1 = new UUID(var0.getLong("UUIDMost"), var0.getLong("UUIDLeast")); -- return new AttributeModifier(var1, var0.getString("Name"), var0.getDouble("Amount"), var0.getInteger("Operation")); -+ public static AttributeModifier func_111259_a(NBTTagCompound par0NBTTagCompound) { -+ UUID var1 = new UUID(par0NBTTagCompound.getLong("UUIDMost"), par0NBTTagCompound.getLong("UUIDLeast")); -+ return new AttributeModifier(var1, par0NBTTagCompound.getString("Name"), par0NBTTagCompound.getDouble("Amount"), par0NBTTagCompound.getInteger("Operation")); - } - } ---- net/minecraft/src/GuiMerchant.java -+++ net/minecraft/src/GuiMerchant.java -@@ -7,54 +7,69 @@ - - public class GuiMerchant extends GuiContainer { - private static final ResourceLocation merchantGuiTextures = new ResourceLocation("textures/gui/container/villager.png"); -+ -+ /** Instance of IMerchant interface. */ - private IMerchant theIMerchant; - private GuiButtonMerchant nextRecipeButtonIndex; - private GuiButtonMerchant previousRecipeButtonIndex; - private int currentRecipeIndex; -- private String y; -+ private String field_94082_v; - -- public GuiMerchant(InventoryPlayer var1, IMerchant var2, World var3, String var4) { -- super(new ContainerMerchant(var1, var2, var3)); -- this.theIMerchant = var2; -- this.y = var4 != null && var4.length() >= 1 ? var4 : I18n.getString("entity.Villager.name"); -+ public GuiMerchant(InventoryPlayer par1InventoryPlayer, IMerchant par2IMerchant, World par3World, String par4Str) { -+ super(new ContainerMerchant(par1InventoryPlayer, par2IMerchant, par3World)); -+ this.theIMerchant = par2IMerchant; -+ this.field_94082_v = par4Str != null && par4Str.length() >= 1 ? par4Str : I18n.getString("entity.Villager.name"); - } - -+ /** -+ * Adds the buttons (and other controls) to the screen in question. -+ */ - public void initGui() { - super.initGui(); - int var1 = (this.width - this.xSize) / 2; - int var2 = (this.height - this.ySize) / 2; -- this.i.add(this.nextRecipeButtonIndex = new GuiButtonMerchant(1, var1 + 120 + 27, var2 + 24 - 1, true)); -- this.i.add(this.previousRecipeButtonIndex = new GuiButtonMerchant(2, var1 + 36 - 19, var2 + 24 - 1, false)); -+ this.buttonList.add(this.nextRecipeButtonIndex = new GuiButtonMerchant(1, var1 + 120 + 27, var2 + 24 - 1, true)); -+ this.buttonList.add(this.previousRecipeButtonIndex = new GuiButtonMerchant(2, var1 + 36 - 19, var2 + 24 - 1, false)); - this.nextRecipeButtonIndex.enabled = false; - this.previousRecipeButtonIndex.enabled = false; - } - -- protected void drawGuiContainerForegroundLayer(int var1, int var2) { -- this.fontRenderer.drawString(this.y, this.xSize / 2 - this.fontRenderer.getStringWidth(this.y) / 2, 6, 4210752); -+ /** -+ * Draw the foreground layer for the GuiContainer (everything in front of the items) -+ */ -+ protected void drawGuiContainerForegroundLayer(int par1, int par2) { -+ this.fontRenderer.drawString(this.field_94082_v, this.xSize / 2 - this.fontRenderer.getStringWidth(this.field_94082_v) / 2, 6, 4210752); - this.fontRenderer.drawString(I18n.getString("container.inventory"), 8, this.ySize - 96 + 2, 4210752); - } - -+ /** -+ * Called from the main game loop to update the screen. -+ */ - public void updateScreen() { - super.updateScreen(); - MerchantRecipeList var1 = this.theIMerchant.getRecipes(this.mc.thePlayer); -- if(var1 != null) { -+ -+ if (var1 != null) { - this.nextRecipeButtonIndex.enabled = this.currentRecipeIndex < var1.size() - 1; - this.previousRecipeButtonIndex.enabled = this.currentRecipeIndex > 0; - } -- - } - -- protected void actionPerformed(GuiButton var1) { -+ /** -+ * Fired when a control is clicked. This is the equivalent of ActionListener.actionPerformed(ActionEvent e). -+ */ -+ protected void actionPerformed(GuiButton par1GuiButton) { - boolean var2 = false; -- if(var1 == this.nextRecipeButtonIndex) { -+ -+ if (par1GuiButton == this.nextRecipeButtonIndex) { - ++this.currentRecipeIndex; - var2 = true; -- } else if(var1 == this.previousRecipeButtonIndex) { -+ } else if (par1GuiButton == this.previousRecipeButtonIndex) { - --this.currentRecipeIndex; - var2 = true; - } - -- if(var2) { -+ if (var2) { - ((ContainerMerchant)this.inventorySlots).setCurrentRecipeIndex(this.currentRecipeIndex); - ByteArrayOutputStream var3 = new ByteArrayOutputStream(); - DataOutputStream var4 = new DataOutputStream(var3); -@@ -66,20 +81,24 @@ - var6.printStackTrace(); - } - } -- - } - -- protected void drawGuiContainerBackgroundLayer(float var1, int var2, int var3) { -+ /** -+ * Draw the background layer for the GuiContainer (everything behind the items) -+ */ -+ protected void drawGuiContainerBackgroundLayer(float par1, int par2, int par3) { - GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - this.mc.getTextureManager().bindTexture(merchantGuiTextures); - int var4 = (this.width - this.xSize) / 2; - int var5 = (this.height - this.ySize) / 2; - this.drawTexturedModalRect(var4, var5, 0, 0, this.xSize, this.ySize); - MerchantRecipeList var6 = this.theIMerchant.getRecipes(this.mc.thePlayer); -- if(var6 != null && !var6.isEmpty()) { -+ -+ if (var6 != null && !var6.isEmpty()) { - int var7 = this.currentRecipeIndex; - MerchantRecipe var8 = (MerchantRecipe)var6.get(var7); -- if(var8.func_82784_g()) { -+ -+ if (var8.func_82784_g()) { - this.mc.getTextureManager().bindTexture(merchantGuiTextures); - GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - GL11.glDisable(GL11.GL_LIGHTING); -@@ -87,13 +106,16 @@ - this.drawTexturedModalRect(this.guiLeft + 83, this.guiTop + 51, 212, 0, 28, 21); - } - } -- - } - -- public void drawScreen(int var1, int var2, float var3) { -- super.drawScreen(var1, var2, var3); -+ /** -+ * Draws the screen and all the components in it. -+ */ -+ public void drawScreen(int par1, int par2, float par3) { -+ super.drawScreen(par1, par2, par3); - MerchantRecipeList var4 = this.theIMerchant.getRecipes(this.mc.thePlayer); -- if(var4 != null && !var4.isEmpty()) { -+ -+ if (var4 != null && !var4.isEmpty()) { - int var5 = (this.width - this.xSize) / 2; - int var6 = (this.height - this.ySize) / 2; - int var7 = this.currentRecipeIndex; -@@ -110,7 +132,8 @@ - itemRenderer.zLevel = 100.0F; - itemRenderer.renderItemAndEffectIntoGUI(this.fontRenderer, this.mc.getTextureManager(), var9, var5 + 36, var6 + 24); - itemRenderer.renderItemOverlayIntoGUI(this.fontRenderer, this.mc.getTextureManager(), var9, var5 + 36, var6 + 24); -- if(var10 != null) { -+ -+ if (var10 != null) { - itemRenderer.renderItemAndEffectIntoGUI(this.fontRenderer, this.mc.getTextureManager(), var10, var5 + 62, var6 + 24); - itemRenderer.renderItemOverlayIntoGUI(this.fontRenderer, this.mc.getTextureManager(), var10, var5 + 62, var6 + 24); - } -@@ -119,12 +142,13 @@ - itemRenderer.renderItemOverlayIntoGUI(this.fontRenderer, this.mc.getTextureManager(), var11, var5 + 120, var6 + 24); - itemRenderer.zLevel = 0.0F; - GL11.glDisable(GL11.GL_LIGHTING); -- if(this.isPointInRegion(36, 24, 16, 16, var1, var2)) { -- this.drawItemStackTooltip(var9, var1, var2); -- } else if(var10 != null && this.isPointInRegion(62, 24, 16, 16, var1, var2)) { -- this.drawItemStackTooltip(var10, var1, var2); -- } else if(this.isPointInRegion(120, 24, 16, 16, var1, var2)) { -- this.drawItemStackTooltip(var11, var1, var2); -+ -+ if (this.isPointInRegion(36, 24, 16, 16, par1, par2)) { -+ this.drawItemStackTooltip(var9, par1, par2); -+ } else if (var10 != null && this.isPointInRegion(62, 24, 16, 16, par1, par2)) { -+ this.drawItemStackTooltip(var10, par1, par2); -+ } else if (this.isPointInRegion(120, 24, 16, 16, par1, par2)) { -+ this.drawItemStackTooltip(var11, par1, par2); - } - - GL11.glPopMatrix(); -@@ -132,9 +156,11 @@ - GL11.glEnable(GL11.GL_DEPTH_TEST); - RenderHelper.enableStandardItemLighting(); - } -- - } - -+ /** -+ * Gets the Instance of IMerchant interface. -+ */ - public IMerchant getIMerchant() { - return this.theIMerchant; - } ---- /dev/null -+++ org/spoutcraft/api/gui/ListWidget.java -@@ -1,0 +1,114 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.api.gui; -+ -+import org.spoutcraft.api.UnsafeClass; -+ -+@UnsafeClass -+public interface ListWidget extends Scrollable { -+ /** -+ * Get all the items from the list widget -+ * @return the assigned ListWidgetItems -+ */ -+ public ListWidgetItem[] getItems(); -+ -+ /** -+ * Returns the nth item from the listwidget -+ * @param n which item to get -+ * @return nth item from the list -+ */ -+ public ListWidgetItem getItem(int n); -+ -+ /** -+ * Adds an item to the list -+ * @param item the item to add. -+ * @return instance of the ListWidget -+ */ -+ public ListWidget addItem(ListWidgetItem item); -+ -+ /** -+ * Add items to the list -+ * @param items to add -+ * @return instance of the ListWidget -+ */ -+ public ListWidget addItems(ListWidgetItem... items); -+ -+ /** -+ * Removes an item from the list. -+ * @param item to remove -+ * @return if item was found. -+ */ -+ public boolean removeItem(ListWidgetItem item); -+ -+ /** -+ * Clears all attached items. -+ */ -+ public void clear(); -+ -+ /** -+ * @return the currently selected item. -+ * @returns null when no item is selected. -+ */ -+ public ListWidgetItem getSelectedItem(); -+ -+ /** -+ * @return the currently selected row. -+ */ -+ public int getSelectedRow(); -+ -+ /** -+ * Sets the selected item to be the nth in the list. -+ * @param n the number of the item or -1 to clear the selection -+ * @return instance of the ListWidget -+ */ -+ public ListWidget setSelection(int n); -+ -+ /** -+ * Clears the selection -+ * @return instance of the ListWidget -+ */ -+ public ListWidget clearSelection(); -+ -+ /** -+ * @param n item to check -+ * @returns if the nth item is selected -+ */ -+ public boolean isSelected(int n); -+ -+ /** -+ * @param item to check -+ * @returns if the item is selected -+ */ -+ boolean isSelected(ListWidgetItem item); -+ -+ /** -+ * Moves the selection up or down by n -+ * @param n -+ * @return -+ */ -+ public ListWidget shiftSelection(int n); -+ -+ /** -+ * Will be called on each selection change. -+ * @param item the number of the item that was clicked/selected by keypress. Can be -1 that means that no item is selected -+ * @param doubleClick if true, item has been doubleclicked. -+ */ -+ public void onSelected(int item, boolean doubleClick); -+} ---- net/minecraft/src/Packet101CloseWindow.java -+++ net/minecraft/src/Packet101CloseWindow.java -@@ -7,25 +7,36 @@ - public class Packet101CloseWindow extends Packet { - public int windowId; - -- public Packet101CloseWindow() { -- } -- -- public Packet101CloseWindow(int var1) { -- this.windowId = var1; -- } -- -- public void processPacket(NetHandler var1) { -- var1.handleCloseWindow(this); -- } -- -- public void readPacketData(DataInput var1) throws IOException { -- this.windowId = var1.readByte(); -- } -- -- public void writePacketData(DataOutput var1) throws IOException { -- var1.writeByte(this.windowId); -- } -- -+ public Packet101CloseWindow() {} -+ -+ public Packet101CloseWindow(int par1) { -+ this.windowId = par1; -+ } -+ -+ /** -+ * Passes this Packet on to the NetHandler for processing. -+ */ -+ public void processPacket(NetHandler par1NetHandler) { -+ par1NetHandler.handleCloseWindow(this); -+ } -+ -+ /** -+ * Abstract. Reads the raw packet data from the data stream. -+ */ -+ public void readPacketData(DataInput par1DataInput) throws IOException { -+ this.windowId = par1DataInput.readByte(); -+ } -+ -+ /** -+ * Abstract. Writes the raw packet data to the data stream. -+ */ -+ public void writePacketData(DataOutput par1DataOutput) throws IOException { -+ par1DataOutput.writeByte(this.windowId); -+ } -+ -+ /** -+ * Abstract. Return the size of the packet (not counting the header). -+ */ - public int getPacketSize() { - return 1; - } ---- /dev/null -+++ org/spoutcraft/api/inventory/ItemStack.java -@@ -1,0 +1,355 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.api.inventory; -+ -+import java.util.HashMap; -+import java.util.List; -+import java.util.Map.Entry; -+ -+import net.minecraft.src.Enchantment; -+import net.minecraft.src.NBTTagCompound; -+import net.minecraft.src.NBTTagList; -+import net.minecraft.src.NBTTagString; -+ -+import org.spoutcraft.api.material.CustomBlock; -+import org.spoutcraft.api.material.CustomItem; -+import org.spoutcraft.api.material.Material; -+import org.spoutcraft.api.material.MaterialData; -+ -+/** -+ * Represents a stack of items -+ */ -+public class ItemStack implements Cloneable{ -+ private int type; -+ private int amount = 0; -+ private short durability = 0; -+ -+ private String displayName = null; -+ private List lore = null; -+ private HashMap enchants = null; -+ -+ public ItemStack(final int type) { -+ this(type, 0); -+ } -+ -+ public ItemStack(final Material type) { -+ this(type, 0); -+ } -+ -+ public ItemStack(final int type, final int amount) { -+ this(type, amount, (short) 0); -+ } -+ -+ public ItemStack(final Material type, final int amount) { -+ this(type.getRawId(), amount); -+ } -+ -+ public ItemStack(final int type, final int amount, final short damage) { -+ this(type, amount, damage, null); -+ } -+ -+ public ItemStack(final Material type, final int amount, final short damage) { -+ this(type.getRawId(), amount, damage); -+ } -+ -+ public ItemStack(final int type, final int amount, final short damage, final Byte data) { -+ this.type = type; -+ this.amount = amount; -+ this.durability = damage; -+ if (data != null) { -+ this.durability = data; -+ } -+ } -+ -+ public ItemStack(final Material type, final int amount, final short damage, final Byte data) { -+ this(type.getRawId(), amount, damage, data); -+ } -+ -+ public ItemStack(CustomItem item) { -+ this(item.getRawId(), 1, (short)item.getRawData()); -+ } -+ -+ public ItemStack(CustomItem item, int amount) { -+ this(item.getRawId(), amount, (short)item.getRawData()); -+ } -+ -+ public ItemStack(CustomBlock block) { -+ this(block.getBlockItem()); -+ } -+ -+ public ItemStack(CustomBlock block, int amount) { -+ this(block.getBlockItem(), amount); -+ } -+ -+ /** -+ * Checks if this item has a custom display name -+ * @return - true if this item has a custom display name, false otherwise. -+ */ -+ public boolean hasDisplayName() { -+ if (displayName != null && !displayName.isEmpty()) { -+ return true; -+ } -+ return false; -+ } -+ -+ /** -+ * sets the custom display name for this item -+ * @param name - The custom name for this item -+ */ -+ public void setDisplayName(String name) { -+ this.displayName = name; -+ } -+ -+ /** -+ * gets the custom display name for this item -+ * @return - the custom display name. -+ */ -+ public String getDisplayName() { -+ return displayName; -+ } -+ -+ /** -+ * Checks if this item has enchantments. -+ * @return - true if this item has enchantments. -+ */ -+ public boolean hasEnchants() { -+ if (enchants != null && enchants.size() > 0){ -+ return true; -+ } -+ return false; -+ } -+ -+ /** -+ * sets the enchantments for this item. -+ * @param enchants - a hashmap of enchantments. -+ */ -+ public void setEnchants(HashMap enchants) { -+ this.enchants = enchants; -+ } -+ -+ /** -+ * gets this items enchantments -+ * @return - the hashmap of this items enchantments. -+ */ -+ public HashMap getEnchants() { -+ return enchants; -+ } -+ -+ /** -+ * Checks if this item has lore -+ * @return - true if this item has lore, false otherwise. -+ */ -+ public boolean hasLore() { -+ if (lore != null && lore.size() > 0) { -+ return true; -+ } -+ return false; -+ } -+ -+ /** -+ * Sets this item lore -+ * @param lore - a List of Strings representing the lore for this item. -+ */ -+ public void setLore(List lore) { -+ this.lore = lore; -+ } -+ -+ /** -+ * gets this items lore. -+ * @return - A list of Strings representing this item's lore. -+ */ -+ public List getLore() { -+ return lore; -+ } -+ -+ /** -+ * gets the net.minecraft.src.ItemStack version of this item -+ * @return - this itemstack in NMS form. -+ */ -+ public net.minecraft.src.ItemStack asNMSItenStack() { -+ net.minecraft.src.ItemStack itemstack = new net.minecraft.src.ItemStack(getTypeId(), getAmount(), getDurability()); -+ if (hasDisplayName()) { -+ itemstack.setItemName(getDisplayName()); -+ } -+ -+ if (hasEnchants()) { -+ for (Entry entry : getEnchants().entrySet()) { -+ itemstack.addEnchantment(entry.getKey(), entry.getValue()); -+ } -+ } -+ -+ if (hasLore()) { -+ if (itemstack.stackTagCompound == null) { -+ itemstack.stackTagCompound = new NBTTagCompound(); -+ } -+ if (!itemstack.stackTagCompound.hasKey("display")) { -+ itemstack.stackTagCompound.setCompoundTag("display", new NBTTagCompound()); -+ } -+ -+ NBTTagList loreTagList = new NBTTagList(); -+ -+ for (String l : getLore()) { -+ loreTagList.appendTag(new NBTTagString(l)); -+ } -+ -+ itemstack.stackTagCompound.getCompoundTag("display").setTag("Lore", loreTagList); -+ } -+ -+ return itemstack; -+ } -+ -+ /** -+ * Is true if the item is a custom item, not in the vanilla game -+ * @return true if custom item -+ */ -+ public boolean isCustomItem() { -+ return getType() instanceof CustomItem; -+ } -+ -+ /** -+ * Gets the type of this item -+ * -+ * @return Type of the items in this stack -+ */ -+ public Material getType() { -+ return MaterialData.getMaterial(type); -+ } -+ -+ /** -+ * Sets the type of this item
-+ *
-+ * Note that in doing so you will reset the MaterialData for this stack -+ * -+ * @param type New type to set the items in this stack to -+ */ -+ public void setType(Material type) { -+ setTypeId(type.getRawId()); -+ } -+ -+ /** -+ * Gets the type id of this item -+ * -+ * @return Type Id of the items in this stack -+ */ -+ public int getTypeId() { -+ return type; -+ } -+ -+ /** -+ * Sets the type id of this item
-+ *
-+ * Note that in doing so you will reset the MaterialData for this stack -+ * -+ * @param type New type id to set the items in this stack to -+ */ -+ public void setTypeId(int type) { -+ this.type = type; -+ } -+ -+ /** -+ * Gets the amount of items in this stack -+ * -+ * @return Amount of items in this stick -+ */ -+ public int getAmount() { -+ return amount; -+ } -+ -+ /** -+ * Sets the amount of items in this stack -+ * -+ * @param amount New amount of items in this stack -+ */ -+ public void setAmount(int amount) { -+ this.amount = amount; -+ } -+ -+ /** -+ * Sets the MaterialData for this stack of items -+ * -+ * @param amount New MaterialData for this item -+ */ -+ public void setData(Material data) { -+ setTypeId(data.getRawId()); -+ setDurability((short) data.getRawData()); -+ } -+ -+ /** -+ * Sets the durability of this item -+ * -+ * @param durability Durability of this item -+ */ -+ public void setDurability(final short durability) { -+ this.durability = durability; -+ } -+ -+ /** -+ * Gets the durability of this item -+ * -+ * @return Durability of this item -+ */ -+ public short getDurability() { -+ return durability; -+ } -+ -+ /** -+ * Get the maximum stacksize for the material hold in this ItemStack -+ * Returns -1 if it has no idea. -+ * -+ * @return The maximum you can stack this material to. -+ */ -+ public int getMaxStackSize() { -+ return -1; -+ } -+ -+ @Override -+ public String toString() { -+ return "ItemStack{" + getType().getName() + " x " + getAmount() + "}"; -+ } -+ -+ @Override -+ public boolean equals(Object obj) { -+ if (!(obj instanceof ItemStack)) { -+ return false; -+ } -+ -+ ItemStack item = (ItemStack) obj; -+ -+ return item.getAmount() == getAmount() && item.getTypeId() == getTypeId(); -+ } -+ -+ @Override -+ public ItemStack clone() { -+ ItemStack item = new ItemStack(type, amount, durability); -+ item.setDisplayName(displayName); -+ item.setEnchants(enchants); -+ item.setLore(lore); -+ return item; -+ } -+ -+ @Override -+ public int hashCode() { -+ int hash = 11; -+ -+ hash = hash * 19 + 7 * getTypeId(); // Overriding hashCode since equals is overridden, it's just -+ hash = hash * 7 + 23 * getAmount(); // too bad these are mutable values... Q_Q -+ return hash; -+ } -+} ---- net/minecraft/src/AbstractResourcePack.java -+++ net/minecraft/src/AbstractResourcePack.java -@@ -8,58 +8,57 @@ - import java.io.IOException; - import java.io.InputStream; - import java.io.InputStreamReader; --import java.io.Reader; - import javax.imageio.ImageIO; - import org.apache.commons.io.IOUtils; - - public abstract class AbstractResourcePack implements ResourcePack { - protected static final ILogAgent resourceLog = Minecraft.getMinecraft().getLogAgent(); -- protected final File b; -- -- public AbstractResourcePack(File var1) { -- this.b = var1; -- } -- -- private static String locationToName(ResourceLocation var0) { -- return String.format("%s/%s/%s", new Object[]{"assets", var0.getResourceDomain(), var0.getResourcePath()}); -- } -- -- protected static String getRelativeName(File var0, File var1) { -- return var0.toURI().relativize(var1.toURI()).getPath(); -- } -- -- public InputStream getInputStream(ResourceLocation var1) throws IOException { -- return this.getInputStreamByName(locationToName(var1)); -- } -- -- public boolean resourceExists(ResourceLocation var1) { -- return this.hasResourceName(locationToName(var1)); -+ public final File resourcePackFile; -+ -+ public AbstractResourcePack(File par1File) { -+ this.resourcePackFile = par1File; -+ } -+ -+ private static String locationToName(ResourceLocation par0ResourceLocation) { -+ return String.format("%s/%s/%s", new Object[] {"assets", par0ResourceLocation.getResourceDomain(), par0ResourceLocation.getResourcePath()}); -+ } -+ -+ protected static String getRelativeName(File par0File, File par1File) { -+ return par0File.toURI().relativize(par1File.toURI()).getPath(); -+ } -+ -+ public InputStream getInputStream(ResourceLocation par1ResourceLocation) throws IOException { -+ return this.getInputStreamByName(locationToName(par1ResourceLocation)); -+ } -+ -+ public boolean resourceExists(ResourceLocation par1ResourceLocation) { -+ return this.hasResourceName(locationToName(par1ResourceLocation)); - } - - protected abstract InputStream getInputStreamByName(String var1) throws IOException; - - protected abstract boolean hasResourceName(String var1); - -- protected void logNameNotLowercase(String var1) { -- resourceLog.logWarningFormatted("ResourcePack: ignored non-lowercase namespace: %s in %s", new Object[]{var1, this.b}); -- } -- -- public MetadataSection getPackMetadata(MetadataSerializer var1, String var2) throws IOException { -- return readMetadata(var1, this.getInputStreamByName("pack.mcmeta"), var2); -- } -- -- static MetadataSection readMetadata(MetadataSerializer var0, InputStream var1, String var2) { -+ protected void logNameNotLowercase(String par1Str) { -+ resourceLog.logWarningFormatted("ResourcePack: ignored non-lowercase namespace: %s in %s", new Object[] {par1Str, this.resourcePackFile}); -+ } -+ -+ public MetadataSection getPackMetadata(MetadataSerializer par1MetadataSerializer, String par2Str) throws IOException { -+ return readMetadata(par1MetadataSerializer, this.getInputStreamByName("pack.mcmeta"), par2Str); -+ } -+ -+ static MetadataSection readMetadata(MetadataSerializer par0MetadataSerializer, InputStream par1InputStream, String par2Str) { - JsonObject var3 = null; - BufferedReader var4 = null; - - try { -- var4 = new BufferedReader(new InputStreamReader(var1)); -- var3 = (new JsonParser()).parse((Reader)var4).getAsJsonObject(); -+ var4 = new BufferedReader(new InputStreamReader(par1InputStream)); -+ var3 = (new JsonParser()).parse(var4).getAsJsonObject(); - } finally { -- IOUtils.closeQuietly((Reader)var4); -+ IOUtils.closeQuietly(var4); - } - -- return var0.parseMetadataSection(var2, var3); -+ return par0MetadataSerializer.parseMetadataSection(par2Str, var3); - } - - public BufferedImage getPackImage() throws IOException { -@@ -67,6 +66,6 @@ - } - - public String getPackName() { -- return this.b.getName(); -+ return this.resourcePackFile.getName(); - } - } ---- /dev/null -+++ org/spoutcraft/api/BlockChangeDelegate.java -@@ -1,0 +1,66 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.api; -+ -+/** -+ * A delegate for handling block changes. This serves as a direct interface -+ * between generation algorithms in the client implementation and utilizing -+ * code. -+ */ -+public interface BlockChangeDelegate { -+ /** -+ * Set a block type at the specified coordinates. -+ * -+ * @param x X coordinate -+ * @param y Y coordinate -+ * @param z Z coordinate -+ * @param typeId New block ID -+ * @return true if the block was set successfully -+ */ -+ public boolean setRawTypeId(int x, int y, int z, int typeId); -+ -+ /** -+ * Set a block type and data at the specified coordinates. -+ * -+ * @param x X coordinate -+ * @param y Y coordinate -+ * @param z Z coordinate -+ * @param typeId New block ID -+ * @param data Block data -+ * @return true if the block was set successfully -+ */ -+ public boolean setRawTypeIdAndData(int x, int y, int z, int typeId, int data); -+ -+ /** -+ * Get the block type at the location. -+ * @param x X coordinate -+ * @param y Y coordinate -+ * @param z Z coordinate -+ * @return The block ID -+ */ -+ public int getTypeId(int x, int y, int z); -+ -+ /** -+ * Gets the height of the world. -+ * -+ * @return Height of the world -+ */ -+ public int getHeight(); -+} ---- net/minecraft/src/ComponentNetherBridgeStairs.java -+++ net/minecraft/src/ComponentNetherBridgeStairs.java -@@ -4,48 +4,57 @@ - import java.util.Random; - - public class ComponentNetherBridgeStairs extends ComponentNetherBridgePiece { -- public ComponentNetherBridgeStairs() { -- } -- -- public ComponentNetherBridgeStairs(int var1, Random var2, StructureBoundingBox var3, int var4) { -- super(var1); -- this.coordBaseMode = var4; -- this.boundingBox = var3; -- } -- -- public void buildComponent(StructureComponent var1, List var2, Random var3) { -- this.getNextComponentZ((ComponentNetherBridgeStartPiece)var1, var2, var3, 6, 2, false); -- } -- -- public static ComponentNetherBridgeStairs createValidComponent(List var0, Random var1, int var2, int var3, int var4, int var5, int var6) { -- StructureBoundingBox var7 = StructureBoundingBox.getComponentToAddBoundingBox(var2, var3, var4, -2, 0, 0, 7, 11, 7, var5); -- return isAboveGround(var7) && StructureComponent.findIntersecting(var0, var7) == null ? new ComponentNetherBridgeStairs(var6, var1, var7, var5) : null; -- } -- -- public boolean addComponentParts(World var1, Random var2, StructureBoundingBox var3) { -- this.fillWithBlocks(var1, var3, 0, 0, 0, 6, 1, 6, Block.netherBrick.blockID, Block.netherBrick.blockID, false); -- this.fillWithBlocks(var1, var3, 0, 2, 0, 6, 10, 6, 0, 0, false); -- this.fillWithBlocks(var1, var3, 0, 2, 0, 1, 8, 0, Block.netherBrick.blockID, Block.netherBrick.blockID, false); -- this.fillWithBlocks(var1, var3, 5, 2, 0, 6, 8, 0, Block.netherBrick.blockID, Block.netherBrick.blockID, false); -- this.fillWithBlocks(var1, var3, 0, 2, 1, 0, 8, 6, Block.netherBrick.blockID, Block.netherBrick.blockID, false); -- this.fillWithBlocks(var1, var3, 6, 2, 1, 6, 8, 6, Block.netherBrick.blockID, Block.netherBrick.blockID, false); -- this.fillWithBlocks(var1, var3, 1, 2, 6, 5, 8, 6, Block.netherBrick.blockID, Block.netherBrick.blockID, false); -- this.fillWithBlocks(var1, var3, 0, 3, 2, 0, 5, 4, Block.netherFence.blockID, Block.netherFence.blockID, false); -- this.fillWithBlocks(var1, var3, 6, 3, 2, 6, 5, 2, Block.netherFence.blockID, Block.netherFence.blockID, false); -- this.fillWithBlocks(var1, var3, 6, 3, 4, 6, 5, 4, Block.netherFence.blockID, Block.netherFence.blockID, false); -- this.placeBlockAtCurrentPosition(var1, Block.netherBrick.blockID, 0, 5, 2, 5, var3); -- this.fillWithBlocks(var1, var3, 4, 2, 5, 4, 3, 5, Block.netherBrick.blockID, Block.netherBrick.blockID, false); -- this.fillWithBlocks(var1, var3, 3, 2, 5, 3, 4, 5, Block.netherBrick.blockID, Block.netherBrick.blockID, false); -- this.fillWithBlocks(var1, var3, 2, 2, 5, 2, 5, 5, Block.netherBrick.blockID, Block.netherBrick.blockID, false); -- this.fillWithBlocks(var1, var3, 1, 2, 5, 1, 6, 5, Block.netherBrick.blockID, Block.netherBrick.blockID, false); -- this.fillWithBlocks(var1, var3, 1, 7, 1, 5, 7, 4, Block.netherBrick.blockID, Block.netherBrick.blockID, false); -- this.fillWithBlocks(var1, var3, 6, 8, 2, 6, 8, 4, 0, 0, false); -- this.fillWithBlocks(var1, var3, 2, 6, 0, 4, 8, 0, Block.netherBrick.blockID, Block.netherBrick.blockID, false); -- this.fillWithBlocks(var1, var3, 2, 5, 0, 4, 5, 0, Block.netherFence.blockID, Block.netherFence.blockID, false); -- -- for(int var4 = 0; var4 <= 6; ++var4) { -- for(int var5 = 0; var5 <= 6; ++var5) { -- this.fillCurrentPositionBlocksDownwards(var1, Block.netherBrick.blockID, 0, var4, -1, var5, var3); -+ public ComponentNetherBridgeStairs() {} -+ -+ public ComponentNetherBridgeStairs(int par1, Random par2Random, StructureBoundingBox par3StructureBoundingBox, int par4) { -+ super(par1); -+ this.coordBaseMode = par4; -+ this.boundingBox = par3StructureBoundingBox; -+ } -+ -+ /** -+ * Initiates construction of the Structure Component picked, at the current Location of StructGen -+ */ -+ public void buildComponent(StructureComponent par1StructureComponent, List par2List, Random par3Random) { -+ this.getNextComponentZ((ComponentNetherBridgeStartPiece)par1StructureComponent, par2List, par3Random, 6, 2, false); -+ } -+ -+ /** -+ * Creates and returns a new component piece. Or null if it could not find enough room to place it. -+ */ -+ public static ComponentNetherBridgeStairs createValidComponent(List par0List, Random par1Random, int par2, int par3, int par4, int par5, int par6) { -+ StructureBoundingBox var7 = StructureBoundingBox.getComponentToAddBoundingBox(par2, par3, par4, -2, 0, 0, 7, 11, 7, par5); -+ return isAboveGround(var7) && StructureComponent.findIntersecting(par0List, var7) == null ? new ComponentNetherBridgeStairs(par6, par1Random, var7, par5) : null; -+ } -+ -+ /** -+ * second Part of Structure generating, this for example places Spiderwebs, Mob Spawners, it closes Mineshafts at the -+ * end, it adds Fences... -+ */ -+ public boolean addComponentParts(World par1World, Random par2Random, StructureBoundingBox par3StructureBoundingBox) { -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 0, 0, 0, 6, 1, 6, Block.netherBrick.blockID, Block.netherBrick.blockID, false); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 0, 2, 0, 6, 10, 6, 0, 0, false); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 0, 2, 0, 1, 8, 0, Block.netherBrick.blockID, Block.netherBrick.blockID, false); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 5, 2, 0, 6, 8, 0, Block.netherBrick.blockID, Block.netherBrick.blockID, false); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 0, 2, 1, 0, 8, 6, Block.netherBrick.blockID, Block.netherBrick.blockID, false); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 6, 2, 1, 6, 8, 6, Block.netherBrick.blockID, Block.netherBrick.blockID, false); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 1, 2, 6, 5, 8, 6, Block.netherBrick.blockID, Block.netherBrick.blockID, false); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 0, 3, 2, 0, 5, 4, Block.netherFence.blockID, Block.netherFence.blockID, false); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 6, 3, 2, 6, 5, 2, Block.netherFence.blockID, Block.netherFence.blockID, false); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 6, 3, 4, 6, 5, 4, Block.netherFence.blockID, Block.netherFence.blockID, false); -+ this.placeBlockAtCurrentPosition(par1World, Block.netherBrick.blockID, 0, 5, 2, 5, par3StructureBoundingBox); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 4, 2, 5, 4, 3, 5, Block.netherBrick.blockID, Block.netherBrick.blockID, false); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 3, 2, 5, 3, 4, 5, Block.netherBrick.blockID, Block.netherBrick.blockID, false); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 2, 2, 5, 2, 5, 5, Block.netherBrick.blockID, Block.netherBrick.blockID, false); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 1, 2, 5, 1, 6, 5, Block.netherBrick.blockID, Block.netherBrick.blockID, false); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 1, 7, 1, 5, 7, 4, Block.netherBrick.blockID, Block.netherBrick.blockID, false); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 6, 8, 2, 6, 8, 4, 0, 0, false); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 2, 6, 0, 4, 8, 0, Block.netherBrick.blockID, Block.netherBrick.blockID, false); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 2, 5, 0, 4, 5, 0, Block.netherFence.blockID, Block.netherFence.blockID, false); -+ -+ for (int var4 = 0; var4 <= 6; ++var4) { -+ for (int var5 = 0; var5 <= 6; ++var5) { -+ this.fillCurrentPositionBlocksDownwards(par1World, Block.netherBrick.blockID, 0, var4, -1, var5, par3StructureBoundingBox); - } - } - ---- net/minecraft/src/RegistrySimple.java -+++ net/minecraft/src/RegistrySimple.java -@@ -5,17 +5,22 @@ - import java.util.Map; - - public class RegistrySimple implements IRegistry { -- protected final Map a = this.func_111054_a(); -+ -+ /** Objects registered on this registry. */ -+ protected final Map registryObjects = this.func_111054_a(); - - protected HashMap func_111054_a() { - return Maps.newHashMap(); - } - -- public Object getObject(Object var1) { -- return this.a.get(var1); -+ public Object getObject(Object par1Obj) { -+ return this.registryObjects.get(par1Obj); - } - -- public void putObject(Object var1, Object var2) { -- this.a.put(var1, var2); -+ /** -+ * Register an object on this registry. -+ */ -+ public void putObject(Object par1Obj, Object par2Obj) { -+ this.registryObjects.put(par1Obj, par2Obj); - } - } ---- net/minecraft/src/Chunk.java -+++ net/minecraft/src/Chunk.java -@@ -8,62 +8,133 @@ - import java.util.Map; - import java.util.Random; - -+import org.spoutcraft.client.block.SpoutcraftChunk; -+ - public class Chunk { -+ /** -+ * Determines if the chunk is lit or not at a light value greater than 0. -+ */ - public static boolean isLit; -+ -+ /** -+ * Used to store block IDs, block MSBs, Sky-light maps, Block-light maps, and metadata. Each entry corresponds to a -+ * logical segment of 16x16x16 blocks, stacked vertically. -+ */ - private ExtendedBlockStorage[] storageArrays; -+ -+ /** -+ * Contains a 16x16 mapping on the X/Z plane of the biome ID to which each colum belongs. -+ */ - private byte[] blockBiomeArray; -+ -+ /** -+ * A map, similar to heightMap, that tracks how far down precipitation can fall. -+ */ - public int[] precipitationHeightMap; -+ -+ /** Which columns need their skylightMaps updated. */ - public boolean[] updateSkylightColumns; -+ -+ /** Whether or not this Chunk is currently loaded into the World */ - public boolean isChunkLoaded; -+ -+ /** Reference to the World object. */ - public World worldObj; - public int[] heightMap; -+ -+ /** The x coordinate of the chunk. */ - public final int xPosition; -+ -+ /** The z coordinate of the chunk. */ - public final int zPosition; - private boolean isGapLightingUpdated; -- public Map i; -- public List[] j; -+ -+ /** A Map of ChunkPositions to TileEntities in this chunk */ -+ public Map chunkTileEntityMap; -+ -+ /** -+ * Array of Lists containing the entities in this Chunk. Each List represents a 16 block subchunk. -+ */ -+ public List[] entityLists; -+ -+ /** Boolean value indicating if the terrain is populated. */ - public boolean isTerrainPopulated; -+ -+ /** -+ * Set to true if the chunk has been modified and needs to be updated internally. -+ */ - public boolean isModified; -+ -+ /** -+ * Whether this Chunk has any Entities and thus requires saving on every tick -+ */ - public boolean hasEntities; -+ -+ /** The time according to World.worldTime when this chunk was last saved */ - public long lastSaveTime; -+ -+ /** -+ * Updates to this chunk will not be sent to clients if this is false. This field is set to true the first time the -+ * chunk is sent to a client, and never set to false. -+ */ - public boolean sendUpdates; -- public int heightMapMinimum; -+ -+ /** Lowest value in the heightmap. */ -+ public int heightMapMinimum; -+ -+ /** the cumulative number of ticks players have been in this chunk */ - public long inhabitedTime; -+ -+ /** -+ * Contains the current round-robin relight check index, and is implied as the relight check location as well. -+ */ - private int queuedLightChecks; -+ -+ // Spout Start -+ public SpoutcraftChunk spoutChunk; -+ int grassColorCache = -1; -+ int waterColorCache = -1; -+ public boolean canBeUnloaded = false; -+ // Spout End - -- public Chunk(World var1, int var2, int var3) { -+ public Chunk(World par1World, int par2, int par3) { - this.storageArrays = new ExtendedBlockStorage[16]; - this.blockBiomeArray = new byte[256]; - this.precipitationHeightMap = new int[256]; - this.updateSkylightColumns = new boolean[256]; -- this.i = new HashMap(); -+ this.chunkTileEntityMap = new HashMap(); - this.queuedLightChecks = 4096; -- this.j = new List[16]; -- this.worldObj = var1; -- this.xPosition = var2; -- this.zPosition = var3; -+ this.entityLists = new List[16]; -+ this.worldObj = par1World; -+ this.xPosition = par2; -+ this.zPosition = par3; - this.heightMap = new int[256]; -- -- for(int var4 = 0; var4 < this.j.length; ++var4) { -- this.j[var4] = new ArrayList(); -+ for (int var4 = 0; var4 < this.entityLists.length; ++var4) { -+ this.entityLists[var4] = new ArrayList(); - } - - Arrays.fill(this.precipitationHeightMap, -999); -- Arrays.fill(this.blockBiomeArray, (byte)-1); -+ Arrays.fill(this.blockBiomeArray, (byte) - 1); -+ -+ // Spout Start -+ spoutChunk = new SpoutcraftChunk(this); -+ // Spout End - } - -- public Chunk(World var1, byte[] var2, int var3, int var4) { -- this(var1, var3, var4); -- int var5 = var2.length / 256; -- -- for(int var6 = 0; var6 < 16; ++var6) { -- for(int var7 = 0; var7 < 16; ++var7) { -- for(int var8 = 0; var8 < var5; ++var8) { -- byte var9 = var2[var6 << 11 | var7 << 7 | var8]; -- if(var9 != 0) { -+ public Chunk(World par1World, byte[] par2ArrayOfByte, int par3, int par4) { -+ this(par1World, par3, par4); -+ int var5 = par2ArrayOfByte.length / 256; -+ -+ for (int var6 = 0; var6 < 16; ++var6) { -+ for (int var7 = 0; var7 < 16; ++var7) { -+ for (int var8 = 0; var8 < var5; ++var8) { -+ byte var9 = par2ArrayOfByte[var6 << 11 | var7 << 7 | var8]; -+ -+ if (var9 != 0) { - int var10 = var8 >> 4; -- if(this.storageArrays[var10] == null) { -- this.storageArrays[var10] = new ExtendedBlockStorage(var10 << 4, !var1.provider.hasNoSky); -+ -+ if (this.storageArrays[var10] == null) { -+ this.storageArrays[var10] = new ExtendedBlockStorage(var10 << 4, !par1World.provider.hasNoSky); - } - - this.storageArrays[var10].setExtBlockID(var6, var8 & 15, var7, var9); -@@ -71,20 +142,28 @@ - } - } - } -- -- } -- -- public boolean isAtLocation(int var1, int var2) { -- return var1 == this.xPosition && var2 == this.zPosition; -- } -- -- public int getHeightValue(int var1, int var2) { -- return this.heightMap[var2 << 4 | var1]; -- } -- -+ } -+ -+ /** -+ * Checks whether the chunk is at the X/Z location specified -+ */ -+ public boolean isAtLocation(int par1, int par2) { -+ return par1 == this.xPosition && par2 == this.zPosition; -+ } -+ -+ /** -+ * Returns the value in the height map at this x, z coordinate in the chunk -+ */ -+ public int getHeightValue(int par1, int par2) { -+ return this.heightMap[par2 << 4 | par1]; -+ } -+ -+ /** -+ * Returns the topmost ExtendedBlockStorage instance for this Chunk that actually contains a block. -+ */ - public int getTopFilledSegment() { -- for(int var1 = this.storageArrays.length - 1; var1 >= 0; --var1) { -- if(this.storageArrays[var1] != null) { -+ for (int var1 = this.storageArrays.length - 1; var1 >= 0; --var1) { -+ if (this.storageArrays[var1] != null) { - return this.storageArrays[var1].getYLocation(); - } - } -@@ -92,23 +171,40 @@ - return 0; - } - -+ /** -+ * Returns the ExtendedBlockStorage array for this Chunk. -+ */ - public ExtendedBlockStorage[] getBlockStorageArray() { - return this.storageArrays; - } - -+ /** -+ * Generates the height map for a chunk from scratch -+ */ - public void generateHeightMap() { - int var1 = this.getTopFilledSegment(); - -- for(int var2 = 0; var2 < 16; ++var2) { -- for(int var3 = 0; var3 < 16; ++var3) { -+ for (int var2 = 0; var2 < 16; ++var2) { -+ int var3 = 0; -+ -+ while (var3 < 16) { - this.precipitationHeightMap[var2 + (var3 << 4)] = -999; -- -- for(int var4 = var1 + 16 - 1; var4 > 0; --var4) { -- int var5 = this.getBlockID(var2, var4 - 1, var3); -- if(Block.lightOpacity[var5] != 0) { -+ int var4 = var1 + 16 - 1; -+ -+ while (true) { -+ if (var4 > 0) { -+ int var5 = this.getBlockID(var2, var4 - 1, var3); -+ -+ if (Block.lightOpacity[var5] == 0) { -+ --var4; -+ continue; -+ } -+ - this.heightMap[var3 << 4 | var2] = var4; -- break; - } -+ -+ ++var3; -+ break; - } - } - } -@@ -116,68 +212,89 @@ - this.isModified = true; - } - -+ /** -+ * Generates the initial skylight map for the chunk upon generation or load. -+ */ - public void generateSkylightMap() { - int var1 = this.getTopFilledSegment(); - this.heightMapMinimum = Integer.MAX_VALUE; -- - int var2; - int var3; -- for(var2 = 0; var2 < 16; ++var2) { -- for(var3 = 0; var3 < 16; ++var3) { -+ -+ for (var2 = 0; var2 < 16; ++var2) { -+ var3 = 0; -+ -+ while (var3 < 16) { - this.precipitationHeightMap[var2 + (var3 << 4)] = -999; -- -- int var4; -- for(var4 = var1 + 16 - 1; var4 > 0; --var4) { -- if(this.getBlockLightOpacity(var2, var4 - 1, var3) != 0) { -+ int var4 = var1 + 16 - 1; -+ -+ while (true) { -+ if (var4 > 0) { -+ if (this.getBlockLightOpacity(var2, var4 - 1, var3) == 0) { -+ --var4; -+ continue; -+ } -+ - this.heightMap[var3 << 4 | var2] = var4; -- if(var4 < this.heightMapMinimum) { -+ -+ if (var4 < this.heightMapMinimum) { - this.heightMapMinimum = var4; - } -- break; - } -- } -- -- if(!this.worldObj.provider.hasNoSky) { -- var4 = 15; -- int var5 = var1 + 16 - 1; -- -- do { -- var4 -= this.getBlockLightOpacity(var2, var5, var3); -- if(var4 > 0) { -- ExtendedBlockStorage var6 = this.storageArrays[var5 >> 4]; -- if(var6 != null) { -- var6.setExtSkylightValue(var2, var5 & 15, var3, var4); -- this.worldObj.markBlockForRenderUpdate((this.xPosition << 4) + var2, var5, (this.zPosition << 4) + var3); -+ -+ if (!this.worldObj.provider.hasNoSky) { -+ var4 = 15; -+ int var5 = var1 + 16 - 1; -+ -+ do { -+ var4 -= this.getBlockLightOpacity(var2, var5, var3); -+ -+ if (var4 > 0) { -+ ExtendedBlockStorage var6 = this.storageArrays[var5 >> 4]; -+ -+ if (var6 != null) { -+ var6.setExtSkylightValue(var2, var5 & 15, var3, var4); -+ this.worldObj.markBlockForRenderUpdate((this.xPosition << 4) + var2, var5, (this.zPosition << 4) + var3); -+ } - } -- } -- -- --var5; -- } while(var5 > 0 && var4 > 0); -+ -+ --var5; -+ } while (var5 > 0 && var4 > 0); -+ } -+ -+ ++var3; -+ break; - } - } - } - - this.isModified = true; - -- for(var2 = 0; var2 < 16; ++var2) { -- for(var3 = 0; var3 < 16; ++var3) { -+ for (var2 = 0; var2 < 16; ++var2) { -+ for (var3 = 0; var3 < 16; ++var3) { - this.propagateSkylightOcclusion(var2, var3); - } - } -- - } - -- private void propagateSkylightOcclusion(int var1, int var2) { -- this.updateSkylightColumns[var1 + var2 * 16] = true; -+ /** -+ * Propagates a given sky-visible block's light value downward and upward to neighboring blocks as necessary. -+ */ -+ private void propagateSkylightOcclusion(int par1, int par2) { -+ this.updateSkylightColumns[par1 + par2 * 16] = true; - this.isGapLightingUpdated = true; - } - -+ /** -+ * Runs delayed skylight updates. -+ */ - private void updateSkylight_do() { - this.worldObj.theProfiler.startSection("recheckGaps"); -- if(this.worldObj.doChunksNearChunkExist(this.xPosition * 16 + 8, 0, this.zPosition * 16 + 8, 16)) { -- for(int var1 = 0; var1 < 16; ++var1) { -- for(int var2 = 0; var2 < 16; ++var2) { -- if(this.updateSkylightColumns[var1 + var2 * 16]) { -+ -+ if (this.worldObj.doChunksNearChunkExist(this.xPosition * 16 + 8, 0, this.zPosition * 16 + 8, 16)) { -+ for (int var1 = 0; var1 < 16; ++var1) { -+ for (int var2 = 0; var2 < 16; ++var2) { -+ if (this.updateSkylightColumns[var1 + var2 * 16]) { - this.updateSkylightColumns[var1 + var2 * 16] = false; - int var3 = this.getHeightValue(var1, var2); - int var4 = this.xPosition * 16 + var1; -@@ -185,16 +302,17 @@ - int var6 = this.worldObj.getChunkHeightMapMinimum(var4 - 1, var5); - int var7 = this.worldObj.getChunkHeightMapMinimum(var4 + 1, var5); - int var8 = this.worldObj.getChunkHeightMapMinimum(var4, var5 - 1); -- int var9 = this.worldObj.getChunkHeightMapMinimum(var4, var5 + 1); -- if(var7 < var6) { -+ int var9 = this.worldObj.getChunkHeightMapMinimum(var4, var5 + 1); -+ -+ if (var7 < var6) { - var6 = var7; - } - -- if(var8 < var6) { -+ if (var8 < var6) { - var6 = var8; - } - -- if(var9 < var6) { -+ if (var9 < var6) { - var6 = var9; - } - -@@ -213,208 +331,240 @@ - this.worldObj.theProfiler.endSection(); - } - -- private void checkSkylightNeighborHeight(int var1, int var2, int var3) { -- int var4 = this.worldObj.getHeightValue(var1, var2); -- if(var4 > var3) { -- this.updateSkylightNeighborHeight(var1, var2, var3, var4 + 1); -- } else if(var4 < var3) { -- this.updateSkylightNeighborHeight(var1, var2, var4, var3 + 1); -+ /** -+ * Checks the height of a block next to a sky-visible block and schedules a lighting update as necessary. -+ */ -+ private void checkSkylightNeighborHeight(int par1, int par2, int par3) { -+ int var4 = this.worldObj.getHeightValue(par1, par2); -+ -+ if (var4 > par3) { -+ this.updateSkylightNeighborHeight(par1, par2, par3, var4 + 1); -+ } else if (var4 < par3) { -+ this.updateSkylightNeighborHeight(par1, par2, var4, par3 + 1); - } -- - } - -- private void updateSkylightNeighborHeight(int var1, int var2, int var3, int var4) { -- if(var4 > var3 && this.worldObj.doChunksNearChunkExist(var1, 0, var2, 16)) { -- for(int var5 = var3; var5 < var4; ++var5) { -- this.worldObj.updateLightByType(EnumSkyBlock.Sky, var1, var5, var2); -+ private void updateSkylightNeighborHeight(int par1, int par2, int par3, int par4) { -+ if (par4 > par3 && this.worldObj.doChunksNearChunkExist(par1, 0, par2, 16)) { -+ for (int var5 = par3; var5 < par4; ++var5) { -+ this.worldObj.updateLightByType(EnumSkyBlock.Sky, par1, var5, par2); - } - - this.isModified = true; - } -- - } - -- private void relightBlock(int var1, int var2, int var3) { -- int var4 = this.heightMap[var3 << 4 | var1] & 255; -+ /** -+ * Initiates the recalculation of both the block-light and sky-light for a given block inside a chunk. -+ */ -+ private void relightBlock(int par1, int par2, int par3) { -+ int var4 = this.heightMap[par3 << 4 | par1] & 255; - int var5 = var4; -- if(var2 > var4) { -- var5 = var2; -+ -+ if (par2 > var4) { -+ var5 = par2; - } - -- while(var5 > 0 && this.getBlockLightOpacity(var1, var5 - 1, var3) == 0) { -+ while (var5 > 0 && this.getBlockLightOpacity(par1, var5 - 1, par3) == 0) { - --var5; - } - -- if(var5 != var4) { -- this.worldObj.markBlocksDirtyVertical(var1 + this.xPosition * 16, var3 + this.zPosition * 16, var5, var4); -- this.heightMap[var3 << 4 | var1] = var5; -- int var6 = this.xPosition * 16 + var1; -- int var7 = this.zPosition * 16 + var3; -+ if (var5 != var4) { -+ this.worldObj.markBlocksDirtyVertical(par1 + this.xPosition * 16, par3 + this.zPosition * 16, var5, var4); -+ this.heightMap[par3 << 4 | par1] = var5; -+ int var6 = this.xPosition * 16 + par1; -+ int var7 = this.zPosition * 16 + par3; -+ int var13; - int var8; -- int var12; -- if(!this.worldObj.provider.hasNoSky) { -+ -+ if (!this.worldObj.provider.hasNoSky) { - ExtendedBlockStorage var9; -- if(var5 < var4) { -- for(var8 = var5; var8 < var4; ++var8) { -+ -+ if (var5 < var4) { -+ for (var8 = var5; var8 < var4; ++var8) { - var9 = this.storageArrays[var8 >> 4]; -- if(var9 != null) { -- var9.setExtSkylightValue(var1, var8 & 15, var3, 15); -- this.worldObj.markBlockForRenderUpdate((this.xPosition << 4) + var1, var8, (this.zPosition << 4) + var3); -+ -+ if (var9 != null) { -+ var9.setExtSkylightValue(par1, var8 & 15, par3, 15); -+ this.worldObj.markBlockForRenderUpdate((this.xPosition << 4) + par1, var8, (this.zPosition << 4) + par3); - } - } - } else { -- for(var8 = var4; var8 < var5; ++var8) { -+ for (var8 = var4; var8 < var5; ++var8) { - var9 = this.storageArrays[var8 >> 4]; -- if(var9 != null) { -- var9.setExtSkylightValue(var1, var8 & 15, var3, 0); -- this.worldObj.markBlockForRenderUpdate((this.xPosition << 4) + var1, var8, (this.zPosition << 4) + var3); -+ -+ if (var9 != null) { -+ var9.setExtSkylightValue(par1, var8 & 15, par3, 0); -+ this.worldObj.markBlockForRenderUpdate((this.xPosition << 4) + par1, var8, (this.zPosition << 4) + par3); - } - } - } - - var8 = 15; - -- while(var5 > 0 && var8 > 0) { -+ while (var5 > 0 && var8 > 0) { - --var5; -- var12 = this.getBlockLightOpacity(var1, var5, var3); -- if(var12 == 0) { -- var12 = 1; -+ var13 = this.getBlockLightOpacity(par1, var5, par3); -+ -+ if (var13 == 0) { -+ var13 = 1; - } - -- var8 -= var12; -- if(var8 < 0) { -+ var8 -= var13; -+ -+ if (var8 < 0) { - var8 = 0; - } - - ExtendedBlockStorage var10 = this.storageArrays[var5 >> 4]; -- if(var10 != null) { -- var10.setExtSkylightValue(var1, var5 & 15, var3, var8); -+ -+ if (var10 != null) { -+ var10.setExtSkylightValue(par1, var5 & 15, par3, var8); - } - } - } - -- var8 = this.heightMap[var3 << 4 | var1]; -- var12 = var4; -- int var13 = var8; -- if(var8 < var4) { -- var12 = var8; -- var13 = var4; -+ var8 = this.heightMap[par3 << 4 | par1]; -+ var13 = var4; -+ int var12 = var8; -+ -+ if (var8 < var4) { -+ var13 = var8; -+ var12 = var4; - } - -- if(var8 < this.heightMapMinimum) { -+ if (var8 < this.heightMapMinimum) { - this.heightMapMinimum = var8; - } - -- if(!this.worldObj.provider.hasNoSky) { -- this.updateSkylightNeighborHeight(var6 - 1, var7, var12, var13); -- this.updateSkylightNeighborHeight(var6 + 1, var7, var12, var13); -- this.updateSkylightNeighborHeight(var6, var7 - 1, var12, var13); -- this.updateSkylightNeighborHeight(var6, var7 + 1, var12, var13); -- this.updateSkylightNeighborHeight(var6, var7, var12, var13); -+ if (!this.worldObj.provider.hasNoSky) { -+ this.updateSkylightNeighborHeight(var6 - 1, var7, var13, var12); -+ this.updateSkylightNeighborHeight(var6 + 1, var7, var13, var12); -+ this.updateSkylightNeighborHeight(var6, var7 - 1, var13, var12); -+ this.updateSkylightNeighborHeight(var6, var7 + 1, var13, var12); -+ this.updateSkylightNeighborHeight(var6, var7, var13, var12); - } - - this.isModified = true; - } - } - -- public int getBlockLightOpacity(int var1, int var2, int var3) { -- return Block.lightOpacity[this.getBlockID(var1, var2, var3)]; -- } -- -- public int getBlockID(int var1, int var2, int var3) { -- if(var2 >> 4 >= this.storageArrays.length) { -- return 0; -- } else { -- ExtendedBlockStorage var4 = this.storageArrays[var2 >> 4]; -- return var4 != null ? var4.getExtBlockID(var1, var2 & 15, var3) : 0; -- } -- } -- -- public int getBlockMetadata(int var1, int var2, int var3) { -- if(var2 >> 4 >= this.storageArrays.length) { -- return 0; -- } else { -- ExtendedBlockStorage var4 = this.storageArrays[var2 >> 4]; -- return var4 != null ? var4.getExtBlockMetadata(var1, var2 & 15, var3) : 0; -- } -- } -- -- public boolean setBlockIDWithMetadata(int var1, int var2, int var3, int var4, int var5) { -- int var6 = var3 << 4 | var1; -- if(var2 >= this.precipitationHeightMap[var6] - 1) { -+ public int getBlockLightOpacity(int par1, int par2, int par3) { -+ return Block.lightOpacity[this.getBlockID(par1, par2, par3)]; -+ } -+ -+ /** -+ * Return the ID of a block in the chunk. -+ */ -+ public int getBlockID(int par1, int par2, int par3) { -+ if (par2 >> 4 >= this.storageArrays.length) { -+ return 0; -+ } else { -+ ExtendedBlockStorage var4 = this.storageArrays[par2 >> 4]; -+ return var4 != null ? var4.getExtBlockID(par1, par2 & 15, par3) : 0; -+ } -+ } -+ -+ /** -+ * Return the metadata corresponding to the given coordinates inside a chunk. -+ */ -+ public int getBlockMetadata(int par1, int par2, int par3) { -+ if (par2 >> 4 >= this.storageArrays.length) { -+ return 0; -+ } else { -+ ExtendedBlockStorage var4 = this.storageArrays[par2 >> 4]; -+ return var4 != null ? var4.getExtBlockMetadata(par1, par2 & 15, par3) : 0; -+ } -+ } -+ -+ /** -+ * Sets a blockID of a position within a chunk with metadata. Args: x, y, z, blockID, metadata -+ */ -+ public boolean setBlockIDWithMetadata(int par1, int par2, int par3, int par4, int par5) { -+ int var6 = par3 << 4 | par1; -+ -+ if (par2 >= this.precipitationHeightMap[var6] - 1) { - this.precipitationHeightMap[var6] = -999; - } - - int var7 = this.heightMap[var6]; -- int var8 = this.getBlockID(var1, var2, var3); -- int var9 = this.getBlockMetadata(var1, var2, var3); -- if(var8 == var4 && var9 == var5) { -+ int var8 = this.getBlockID(par1, par2, par3); -+ int var9 = this.getBlockMetadata(par1, par2, par3); -+ -+ if (var8 == par4 && var9 == par5) { - return false; - } else { -- ExtendedBlockStorage var10 = this.storageArrays[var2 >> 4]; -+ ExtendedBlockStorage var10 = this.storageArrays[par2 >> 4]; - boolean var11 = false; -- if(var10 == null) { -- if(var4 == 0) { -+ -+ if (var10 == null) { -+ if (par4 == 0) { - return false; - } - -- var10 = this.storageArrays[var2 >> 4] = new ExtendedBlockStorage(var2 >> 4 << 4, !this.worldObj.provider.hasNoSky); -- var11 = var2 >= var7; -- } -- -- int var12 = this.xPosition * 16 + var1; -- int var13 = this.zPosition * 16 + var3; -- if(var8 != 0 && !this.worldObj.isRemote) { -- Block.blocksList[var8].onBlockPreDestroy(this.worldObj, var12, var2, var13, var9); -- } -- -- var10.setExtBlockID(var1, var2 & 15, var3, var4); -- if(var8 != 0) { -- if(!this.worldObj.isRemote) { -- Block.blocksList[var8].breakBlock(this.worldObj, var12, var2, var13, var8, var9); -- } else if(Block.blocksList[var8] instanceof ITileEntityProvider && var8 != var4) { -- this.worldObj.removeBlockTileEntity(var12, var2, var13); -+ var10 = this.storageArrays[par2 >> 4] = new ExtendedBlockStorage(par2 >> 4 << 4, !this.worldObj.provider.hasNoSky); -+ var11 = par2 >= var7; -+ } -+ -+ int var12 = this.xPosition * 16 + par1; -+ int var13 = this.zPosition * 16 + par3; -+ -+ if (var8 != 0 && !this.worldObj.isRemote) { -+ Block.blocksList[var8].onBlockPreDestroy(this.worldObj, var12, par2, var13, var9); -+ } -+ -+ var10.setExtBlockID(par1, par2 & 15, par3, par4); -+ -+ if (var8 != 0) { -+ if (!this.worldObj.isRemote) { -+ Block.blocksList[var8].breakBlock(this.worldObj, var12, par2, var13, var8, var9); -+ } else if (Block.blocksList[var8] instanceof ITileEntityProvider && var8 != par4) { -+ this.worldObj.removeBlockTileEntity(var12, par2, var13); - } - } - -- if(var10.getExtBlockID(var1, var2 & 15, var3) != var4) { -+ if (var10.getExtBlockID(par1, par2 & 15, par3) != par4) { - return false; - } else { -- var10.setExtBlockMetadata(var1, var2 & 15, var3, var5); -- if(var11) { -+ var10.setExtBlockMetadata(par1, par2 & 15, par3, par5); -+ -+ if (var11) { - this.generateSkylightMap(); - } else { -- if(Block.lightOpacity[var4 & 4095] > 0) { -- if(var2 >= var7) { -- this.relightBlock(var1, var2 + 1, var3); -+ if (Block.lightOpacity[par4 & 4095] > 0) { -+ if (par2 >= var7) { -+ this.relightBlock(par1, par2 + 1, par3); - } -- } else if(var2 == var7 - 1) { -- this.relightBlock(var1, var2, var3); -+ } else if (par2 == var7 - 1) { -+ this.relightBlock(par1, par2, par3); - } - -- this.propagateSkylightOcclusion(var1, var3); -+ this.propagateSkylightOcclusion(par1, par3); - } - - TileEntity var14; -- if(var4 != 0) { -- if(!this.worldObj.isRemote) { -- Block.blocksList[var4].onBlockAdded(this.worldObj, var12, var2, var13); -+ -+ if (par4 != 0) { -+ if (!this.worldObj.isRemote) { -+ Block.blocksList[par4].onBlockAdded(this.worldObj, var12, par2, var13); - } - -- if(Block.blocksList[var4] instanceof ITileEntityProvider) { -- var14 = this.getChunkBlockTileEntity(var1, var2, var3); -- if(var14 == null) { -- var14 = ((ITileEntityProvider)Block.blocksList[var4]).createNewTileEntity(this.worldObj); -- this.worldObj.setBlockTileEntity(var12, var2, var13, var14); -+ if (Block.blocksList[par4] instanceof ITileEntityProvider) { -+ var14 = this.getChunkBlockTileEntity(par1, par2, par3); -+ -+ if (var14 == null) { -+ var14 = ((ITileEntityProvider)Block.blocksList[par4]).createNewTileEntity(this.worldObj); -+ this.worldObj.setBlockTileEntity(var12, par2, var13, var14); - } - -- if(var14 != null) { -+ if (var14 != null) { - var14.updateContainingBlockInfo(); - } - } -- } else if(var8 > 0 && Block.blocksList[var8] instanceof ITileEntityProvider) { -- var14 = this.getChunkBlockTileEntity(var1, var2, var3); -- if(var14 != null) { -+ } else if (var8 > 0 && Block.blocksList[var8] instanceof ITileEntityProvider) { -+ var14 = this.getChunkBlockTileEntity(par1, par2, par3); -+ -+ if (var14 != null) { - var14.updateContainingBlockInfo(); - } - } -@@ -425,23 +575,30 @@ - } - } - -- public boolean setBlockMetadata(int var1, int var2, int var3, int var4) { -- ExtendedBlockStorage var5 = this.storageArrays[var2 >> 4]; -- if(var5 == null) { -+ /** -+ * Set the metadata of a block in the chunk -+ */ -+ public boolean setBlockMetadata(int par1, int par2, int par3, int par4) { -+ ExtendedBlockStorage var5 = this.storageArrays[par2 >> 4]; -+ -+ if (var5 == null) { - return false; - } else { -- int var6 = var5.getExtBlockMetadata(var1, var2 & 15, var3); -- if(var6 == var4) { -+ int var6 = var5.getExtBlockMetadata(par1, par2 & 15, par3); -+ -+ if (var6 == par4) { - return false; - } else { - this.isModified = true; -- var5.setExtBlockMetadata(var1, var2 & 15, var3, var4); -- int var7 = var5.getExtBlockID(var1, var2 & 15, var3); -- if(var7 > 0 && Block.blocksList[var7] instanceof ITileEntityProvider) { -- TileEntity var8 = this.getChunkBlockTileEntity(var1, var2, var3); -- if(var8 != null) { -+ var5.setExtBlockMetadata(par1, par2 & 15, par3, par4); -+ int var7 = var5.getExtBlockID(par1, par2 & 15, par3); -+ -+ if (var7 > 0 && Block.blocksList[var7] instanceof ITileEntityProvider) { -+ TileEntity var8 = this.getChunkBlockTileEntity(par1, par2, par3); -+ -+ if (var8 != null) { - var8.updateContainingBlockInfo(); -- var8.blockMetadata = var4; -+ var8.blockMetadata = par4; - } - } - -@@ -450,42 +607,56 @@ - } - } - -- public int getSavedLightValue(EnumSkyBlock var1, int var2, int var3, int var4) { -- ExtendedBlockStorage var5 = this.storageArrays[var3 >> 4]; -- return var5 == null ? (this.canBlockSeeTheSky(var2, var3, var4) ? var1.defaultLightValue : 0) : (var1 == EnumSkyBlock.Sky ? (this.worldObj.provider.hasNoSky ? 0 : var5.getExtSkylightValue(var2, var3 & 15, var4)) : (var1 == EnumSkyBlock.Block ? var5.getExtBlocklightValue(var2, var3 & 15, var4) : var1.defaultLightValue)); -+ /** -+ * Gets the amount of light saved in this block (doesn't adjust for daylight) -+ */ -+ public int getSavedLightValue(EnumSkyBlock par1EnumSkyBlock, int par2, int par3, int par4) { -+ ExtendedBlockStorage var5 = this.storageArrays[par3 >> 4]; -+ return var5 == null ? (this.canBlockSeeTheSky(par2, par3, par4) ? par1EnumSkyBlock.defaultLightValue : 0) : (par1EnumSkyBlock == EnumSkyBlock.Sky ? (this.worldObj.provider.hasNoSky ? 0 : var5.getExtSkylightValue(par2, par3 & 15, par4)) : (par1EnumSkyBlock == EnumSkyBlock.Block ? var5.getExtBlocklightValue(par2, par3 & 15, par4) : par1EnumSkyBlock.defaultLightValue)); - } - -- public void setLightValue(EnumSkyBlock var1, int var2, int var3, int var4, int var5) { -- ExtendedBlockStorage var6 = this.storageArrays[var3 >> 4]; -- if(var6 == null) { -- var6 = this.storageArrays[var3 >> 4] = new ExtendedBlockStorage(var3 >> 4 << 4, !this.worldObj.provider.hasNoSky); -+ /** -+ * Sets the light value at the coordinate. If enumskyblock is set to sky it sets it in the skylightmap and if its a -+ * block then into the blocklightmap. Args enumSkyBlock, x, y, z, lightValue -+ */ -+ public void setLightValue(EnumSkyBlock par1EnumSkyBlock, int par2, int par3, int par4, int par5) { -+ ExtendedBlockStorage var6 = this.storageArrays[par3 >> 4]; -+ -+ if (var6 == null) { -+ var6 = this.storageArrays[par3 >> 4] = new ExtendedBlockStorage(par3 >> 4 << 4, !this.worldObj.provider.hasNoSky); - this.generateSkylightMap(); - } - - this.isModified = true; -- if(var1 == EnumSkyBlock.Sky) { -- if(!this.worldObj.provider.hasNoSky) { -- var6.setExtSkylightValue(var2, var3 & 15, var4, var5); -+ -+ if (par1EnumSkyBlock == EnumSkyBlock.Sky) { -+ if (!this.worldObj.provider.hasNoSky) { -+ var6.setExtSkylightValue(par2, par3 & 15, par4, par5); - } -- } else if(var1 == EnumSkyBlock.Block) { -- var6.setExtBlocklightValue(var2, var3 & 15, var4, var5); -+ } else if (par1EnumSkyBlock == EnumSkyBlock.Block) { -+ var6.setExtBlocklightValue(par2, par3 & 15, par4, par5); - } -- - } - -- public int getBlockLightValue(int var1, int var2, int var3, int var4) { -- ExtendedBlockStorage var5 = this.storageArrays[var2 >> 4]; -- if(var5 == null) { -- return !this.worldObj.provider.hasNoSky && var4 < EnumSkyBlock.Sky.defaultLightValue ? EnumSkyBlock.Sky.defaultLightValue - var4 : 0; -+ /** -+ * Gets the amount of light on a block taking into account sunlight -+ */ -+ public int getBlockLightValue(int par1, int par2, int par3, int par4) { -+ ExtendedBlockStorage var5 = this.storageArrays[par2 >> 4]; -+ -+ if (var5 == null) { -+ return !this.worldObj.provider.hasNoSky && par4 < EnumSkyBlock.Sky.defaultLightValue ? EnumSkyBlock.Sky.defaultLightValue - par4 : 0; - } else { -- int var6 = this.worldObj.provider.hasNoSky ? 0 : var5.getExtSkylightValue(var1, var2 & 15, var3); -- if(var6 > 0) { -+ int var6 = this.worldObj.provider.hasNoSky ? 0 : var5.getExtSkylightValue(par1, par2 & 15, par3); -+ -+ if (var6 > 0) { - isLit = true; - } - -- var6 -= var4; -- int var7 = var5.getExtBlocklightValue(var1, var2 & 15, var3); -- if(var7 > var6) { -+ var6 -= par4; -+ int var7 = var5.getExtBlocklightValue(par1, par2 & 15, par3); -+ -+ if (var7 > var6) { - var6 = var7; - } - -@@ -493,301 +664,370 @@ - } - } - -- public void addEntity(Entity var1) { -+ /** -+ * Adds an entity to the chunk. Args: entity -+ */ -+ public void addEntity(Entity par1Entity) { - this.hasEntities = true; -- int var2 = MathHelper.floor_double(var1.posX / 16.0D); -- int var3 = MathHelper.floor_double(var1.posZ / 16.0D); -- if(var2 != this.xPosition || var3 != this.zPosition) { -- this.worldObj.getWorldLogAgent().logSevere("Wrong location! " + var1); -+ int var2 = MathHelper.floor_double(par1Entity.posX / 16.0D); -+ int var3 = MathHelper.floor_double(par1Entity.posZ / 16.0D); -+ -+ if (var2 != this.xPosition || var3 != this.zPosition) { -+ this.worldObj.getWorldLogAgent().logSevere("Wrong location! " + par1Entity); - Thread.dumpStack(); - } - -- int var4 = MathHelper.floor_double(var1.posY / 16.0D); -- if(var4 < 0) { -+ int var4 = MathHelper.floor_double(par1Entity.posY / 16.0D); -+ -+ if (var4 < 0) { - var4 = 0; - } - -- if(var4 >= this.j.length) { -- var4 = this.j.length - 1; -- } -- -- var1.addedToChunk = true; -- var1.chunkCoordX = this.xPosition; -- var1.chunkCoordY = var4; -- var1.chunkCoordZ = this.zPosition; -- this.j[var4].add(var1); -- } -- -- public void removeEntity(Entity var1) { -- this.removeEntityAtIndex(var1, var1.chunkCoordY); -- } -- -- public void removeEntityAtIndex(Entity var1, int var2) { -- if(var2 < 0) { -- var2 = 0; -- } -- -- if(var2 >= this.j.length) { -- var2 = this.j.length - 1; -- } -- -- this.j[var2].remove(var1); -- } -- -- public boolean canBlockSeeTheSky(int var1, int var2, int var3) { -- return var2 >= this.heightMap[var3 << 4 | var1]; -- } -- -- public TileEntity getChunkBlockTileEntity(int var1, int var2, int var3) { -- ChunkPosition var4 = new ChunkPosition(var1, var2, var3); -- TileEntity var5 = (TileEntity)this.i.get(var4); -- if(var5 == null) { -- int var6 = this.getBlockID(var1, var2, var3); -- if(var6 <= 0 || !Block.blocksList[var6].hasTileEntity()) { -+ if (var4 >= this.entityLists.length) { -+ var4 = this.entityLists.length - 1; -+ } -+ -+ par1Entity.addedToChunk = true; -+ par1Entity.chunkCoordX = this.xPosition; -+ par1Entity.chunkCoordY = var4; -+ par1Entity.chunkCoordZ = this.zPosition; -+ this.entityLists[var4].add(par1Entity); -+ } -+ -+ /** -+ * removes entity using its y chunk coordinate as its index -+ */ -+ public void removeEntity(Entity par1Entity) { -+ this.removeEntityAtIndex(par1Entity, par1Entity.chunkCoordY); -+ } -+ -+ /** -+ * Removes entity at the specified index from the entity array. -+ */ -+ public void removeEntityAtIndex(Entity par1Entity, int par2) { -+ if (par2 < 0) { -+ par2 = 0; -+ } -+ -+ if (par2 >= this.entityLists.length) { -+ par2 = this.entityLists.length - 1; -+ } -+ -+ this.entityLists[par2].remove(par1Entity); -+ } -+ -+ /** -+ * Returns whether is not a block above this one blocking sight to the sky (done via checking against the heightmap) -+ */ -+ public boolean canBlockSeeTheSky(int par1, int par2, int par3) { -+ return par2 >= this.heightMap[par3 << 4 | par1]; -+ } -+ -+ /** -+ * Gets the TileEntity for a given block in this chunk -+ */ -+ public TileEntity getChunkBlockTileEntity(int par1, int par2, int par3) { -+ ChunkPosition var4 = new ChunkPosition(par1, par2, par3); -+ TileEntity var5 = (TileEntity)this.chunkTileEntityMap.get(var4); -+ -+ if (var5 == null) { -+ int var6 = this.getBlockID(par1, par2, par3); -+ -+ if (var6 <= 0 || !Block.blocksList[var6].hasTileEntity()) { - return null; - } - -- if(var5 == null) { -+ if (var5 == null) { - var5 = ((ITileEntityProvider)Block.blocksList[var6]).createNewTileEntity(this.worldObj); -- this.worldObj.setBlockTileEntity(this.xPosition * 16 + var1, var2, this.zPosition * 16 + var3, var5); -+ this.worldObj.setBlockTileEntity(this.xPosition * 16 + par1, par2, this.zPosition * 16 + par3, var5); - } - -- var5 = (TileEntity)this.i.get(var4); -+ var5 = (TileEntity)this.chunkTileEntityMap.get(var4); - } - -- if(var5 != null && var5.isInvalid()) { -- this.i.remove(var4); -+ if (var5 != null && var5.isInvalid()) { -+ this.chunkTileEntityMap.remove(var4); - return null; - } else { - return var5; - } - } - -- public void addTileEntity(TileEntity var1) { -- int var2 = var1.xCoord - this.xPosition * 16; -- int var3 = var1.yCoord; -- int var4 = var1.zCoord - this.zPosition * 16; -- this.setChunkBlockTileEntity(var2, var3, var4, var1); -- if(this.isChunkLoaded) { -- this.worldObj.g.add(var1); -+ /** -+ * Adds a TileEntity to a chunk -+ */ -+ public void addTileEntity(TileEntity par1TileEntity) { -+ int var2 = par1TileEntity.xCoord - this.xPosition * 16; -+ int var3 = par1TileEntity.yCoord; -+ int var4 = par1TileEntity.zCoord - this.zPosition * 16; -+ this.setChunkBlockTileEntity(var2, var3, var4, par1TileEntity); -+ -+ if (this.isChunkLoaded) { -+ this.worldObj.loadedTileEntityList.add(par1TileEntity); - } -- - } - -- public void setChunkBlockTileEntity(int var1, int var2, int var3, TileEntity var4) { -- ChunkPosition var5 = new ChunkPosition(var1, var2, var3); -- var4.setWorldObj(this.worldObj); -- var4.xCoord = this.xPosition * 16 + var1; -- var4.yCoord = var2; -- var4.zCoord = this.zPosition * 16 + var3; -- if(this.getBlockID(var1, var2, var3) != 0 && Block.blocksList[this.getBlockID(var1, var2, var3)] instanceof ITileEntityProvider) { -- if(this.i.containsKey(var5)) { -- ((TileEntity)this.i.get(var5)).invalidate(); -+ /** -+ * Sets the TileEntity for a given block in this chunk -+ */ -+ public void setChunkBlockTileEntity(int par1, int par2, int par3, TileEntity par4TileEntity) { -+ ChunkPosition var5 = new ChunkPosition(par1, par2, par3); -+ par4TileEntity.setWorldObj(this.worldObj); -+ par4TileEntity.xCoord = this.xPosition * 16 + par1; -+ par4TileEntity.yCoord = par2; -+ par4TileEntity.zCoord = this.zPosition * 16 + par3; -+ -+ if (this.getBlockID(par1, par2, par3) != 0 && Block.blocksList[this.getBlockID(par1, par2, par3)] instanceof ITileEntityProvider) { -+ if (this.chunkTileEntityMap.containsKey(var5)) { -+ ((TileEntity)this.chunkTileEntityMap.get(var5)).invalidate(); - } - -- var4.validate(); -- this.i.put(var5, var4); -+ par4TileEntity.validate(); -+ this.chunkTileEntityMap.put(var5, par4TileEntity); - } - } - -- public void removeChunkBlockTileEntity(int var1, int var2, int var3) { -- ChunkPosition var4 = new ChunkPosition(var1, var2, var3); -- if(this.isChunkLoaded) { -- TileEntity var5 = (TileEntity)this.i.remove(var4); -- if(var5 != null) { -+ /** -+ * Removes the TileEntity for a given block in this chunk -+ */ -+ public void removeChunkBlockTileEntity(int par1, int par2, int par3) { -+ ChunkPosition var4 = new ChunkPosition(par1, par2, par3); -+ -+ if (this.isChunkLoaded) { -+ TileEntity var5 = (TileEntity)this.chunkTileEntityMap.remove(var4); -+ -+ if (var5 != null) { - var5.invalidate(); - } - } -- - } - -+ /** -+ * Called when this Chunk is loaded by the ChunkProvider -+ */ - public void onChunkLoad() { - this.isChunkLoaded = true; -- this.worldObj.addTileEntity(this.i.values()); -- -- for(int var1 = 0; var1 < this.j.length; ++var1) { -- Iterator var2 = this.j[var1].iterator(); -- -- while(var2.hasNext()) { -+ this.worldObj.addTileEntity(this.chunkTileEntityMap.values()); -+ -+ for (int var1 = 0; var1 < this.entityLists.length; ++var1) { -+ Iterator var2 = this.entityLists[var1].iterator(); -+ -+ while (var2.hasNext()) { - Entity var3 = (Entity)var2.next(); - var3.onChunkLoad(); - } -- -- this.worldObj.addLoadedEntities(this.j[var1]); -+ this.worldObj.addLoadedEntities(this.entityLists[var1]); - } - -+ // Spout Start - onChunkLoad is only called in SP -+ SpoutcraftChunk.loadedChunks.add(spoutChunk); -+ // Spout End - } - -+ /** -+ * Called when this Chunk is unloaded by the ChunkProvider -+ */ - public void onChunkUnload() { - this.isChunkLoaded = false; -- Iterator var1 = this.i.values().iterator(); -+ Iterator var1 = this.chunkTileEntityMap.values().iterator(); - -- while(var1.hasNext()) { -+ while (var1.hasNext()) { - TileEntity var2 = (TileEntity)var1.next(); - this.worldObj.markTileEntityForDespawn(var2); - } - -- for(int var3 = 0; var3 < this.j.length; ++var3) { -- this.worldObj.unloadEntities(this.j[var3]); -+ for (int var3 = 0; var3 < this.entityLists.length; ++var3) { -+ this.worldObj.unloadEntities(this.entityLists[var3]); - } - -+ // Spout Start -+ SpoutcraftChunk.loadedChunks.remove(spoutChunk); -+ // Spout End - } - -+ /** -+ * Sets the isModified flag for this Chunk -+ */ - public void setChunkModified() { - this.isModified = true; - } - -- public void getEntitiesWithinAABBForEntity(Entity var1, AxisAlignedBB var2, List var3, IEntitySelector var4) { -- int var5 = MathHelper.floor_double((var2.minY - 2.0D) / 16.0D); -- int var6 = MathHelper.floor_double((var2.maxY + 2.0D) / 16.0D); -- if(var5 < 0) { -+ /** -+ * Fills the given list of all entities that intersect within the given bounding box that aren't the passed entity -+ * Args: entity, aabb, listToFill -+ */ -+ public void getEntitiesWithinAABBForEntity(Entity par1Entity, AxisAlignedBB par2AxisAlignedBB, List par3List, IEntitySelector par4IEntitySelector) { -+ int var5 = MathHelper.floor_double((par2AxisAlignedBB.minY - 2.0D) / 16.0D); -+ int var6 = MathHelper.floor_double((par2AxisAlignedBB.maxY + 2.0D) / 16.0D); -+ -+ if (var5 < 0) { - var5 = 0; - var6 = Math.max(var5, var6); - } - -- if(var6 >= this.j.length) { -- var6 = this.j.length - 1; -+ if (var6 >= this.entityLists.length) { -+ var6 = this.entityLists.length - 1; - var5 = Math.min(var5, var6); - } - -- for(int var7 = var5; var7 <= var6; ++var7) { -- List var8 = this.j[var7]; -+ for (int var7 = var5; var7 <= var6; ++var7) { -+ List var8 = this.entityLists[var7]; - -- for(int var9 = 0; var9 < var8.size(); ++var9) { -+ for (int var9 = 0; var9 < var8.size(); ++var9) { - Entity var10 = (Entity)var8.get(var9); -- if(var10 != var1 && var10.boundingBox.intersectsWith(var2) && (var4 == null || var4.isEntityApplicable(var10))) { -- var3.add(var10); -+ -+ if (var10 != par1Entity && var10.boundingBox.intersectsWith(par2AxisAlignedBB) && (par4IEntitySelector == null || par4IEntitySelector.isEntityApplicable(var10))) { -+ par3List.add(var10); - Entity[] var11 = var10.getParts(); -- if(var11 != null) { -- for(int var12 = 0; var12 < var11.length; ++var12) { -+ -+ if (var11 != null) { -+ for (int var12 = 0; var12 < var11.length; ++var12) { - var10 = var11[var12]; -- if(var10 != var1 && var10.boundingBox.intersectsWith(var2) && (var4 == null || var4.isEntityApplicable(var10))) { -- var3.add(var10); -+ -+ if (var10 != par1Entity && var10.boundingBox.intersectsWith(par2AxisAlignedBB) && (par4IEntitySelector == null || par4IEntitySelector.isEntityApplicable(var10))) { -+ par3List.add(var10); - } - } - } - } - } - } -- - } - -- public void getEntitiesOfTypeWithinAAAB(Class var1, AxisAlignedBB var2, List var3, IEntitySelector var4) { -- int var5 = MathHelper.floor_double((var2.minY - 2.0D) / 16.0D); -- int var6 = MathHelper.floor_double((var2.maxY + 2.0D) / 16.0D); -- if(var5 < 0) { -+ /** -+ * Gets all entities that can be assigned to the specified class. Args: entityClass, aabb, listToFill -+ */ -+ public void getEntitiesOfTypeWithinAAAB(Class par1Class, AxisAlignedBB par2AxisAlignedBB, List par3List, IEntitySelector par4IEntitySelector) { -+ int var5 = MathHelper.floor_double((par2AxisAlignedBB.minY - 2.0D) / 16.0D); -+ int var6 = MathHelper.floor_double((par2AxisAlignedBB.maxY + 2.0D) / 16.0D); -+ -+ if (var5 < 0) { - var5 = 0; -- } else if(var5 >= this.j.length) { -- var5 = this.j.length - 1; -+ } else if (var5 >= this.entityLists.length) { -+ var5 = this.entityLists.length - 1; - } - -- if(var6 >= this.j.length) { -- var6 = this.j.length - 1; -- } else if(var6 < 0) { -+ if (var6 >= this.entityLists.length) { -+ var6 = this.entityLists.length - 1; -+ } else if (var6 < 0) { - var6 = 0; - } - -- for(int var7 = var5; var7 <= var6; ++var7) { -- List var8 = this.j[var7]; -+ for (int var7 = var5; var7 <= var6; ++var7) { -+ List var8 = this.entityLists[var7]; - -- for(int var9 = 0; var9 < var8.size(); ++var9) { -+ for (int var9 = 0; var9 < var8.size(); ++var9) { - Entity var10 = (Entity)var8.get(var9); -- if(var1.isAssignableFrom(var10.getClass()) && var10.boundingBox.intersectsWith(var2) && (var4 == null || var4.isEntityApplicable(var10))) { -- var3.add(var10); -+ -+ if (par1Class.isAssignableFrom(var10.getClass()) && var10.boundingBox.intersectsWith(par2AxisAlignedBB) && (par4IEntitySelector == null || par4IEntitySelector.isEntityApplicable(var10))) { -+ par3List.add(var10); - } - } - } -- - } - -- public boolean needsSaving(boolean var1) { -- if(var1) { -- if(this.hasEntities && this.worldObj.getTotalWorldTime() != this.lastSaveTime || this.isModified) { -+ /** -+ * Returns true if this Chunk needs to be saved -+ */ -+ public boolean needsSaving(boolean par1) { -+ if (par1) { -+ if (this.hasEntities && this.worldObj.getTotalWorldTime() != this.lastSaveTime || this.isModified) { - return true; - } -- } else if(this.hasEntities && this.worldObj.getTotalWorldTime() >= this.lastSaveTime + 600L) { -+ } else if (this.hasEntities && this.worldObj.getTotalWorldTime() >= this.lastSaveTime + 600L) { - return true; - } - - return this.isModified; - } - -- public Random getRandomWithSeed(long var1) { -- 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) ^ var1); -+ public Random getRandomWithSeed(long par1) { -+ 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) ^ par1); - } - - public boolean isEmpty() { - return false; - } - -- public void populateChunk(IChunkProvider var1, IChunkProvider var2, int var3, int var4) { -- if(!this.isTerrainPopulated && var1.chunkExists(var3 + 1, var4 + 1) && var1.chunkExists(var3, var4 + 1) && var1.chunkExists(var3 + 1, var4)) { -- var1.populate(var2, var3, var4); -- } -- -- if(var1.chunkExists(var3 - 1, var4) && !var1.provideChunk(var3 - 1, var4).isTerrainPopulated && var1.chunkExists(var3 - 1, var4 + 1) && var1.chunkExists(var3, var4 + 1) && var1.chunkExists(var3 - 1, var4 + 1)) { -- var1.populate(var2, var3 - 1, var4); -- } -- -- if(var1.chunkExists(var3, var4 - 1) && !var1.provideChunk(var3, var4 - 1).isTerrainPopulated && var1.chunkExists(var3 + 1, var4 - 1) && var1.chunkExists(var3 + 1, var4 - 1) && var1.chunkExists(var3 + 1, var4)) { -- var1.populate(var2, var3, var4 - 1); -- } -- -- if(var1.chunkExists(var3 - 1, var4 - 1) && !var1.provideChunk(var3 - 1, var4 - 1).isTerrainPopulated && var1.chunkExists(var3, var4 - 1) && var1.chunkExists(var3 - 1, var4)) { -- var1.populate(var2, var3 - 1, var4 - 1); -- } -- -+ public void populateChunk(IChunkProvider par1IChunkProvider, IChunkProvider par2IChunkProvider, int par3, int par4) { -+ if (!this.isTerrainPopulated && par1IChunkProvider.chunkExists(par3 + 1, par4 + 1) && par1IChunkProvider.chunkExists(par3, par4 + 1) && par1IChunkProvider.chunkExists(par3 + 1, par4)) { -+ par1IChunkProvider.populate(par2IChunkProvider, par3, par4); -+ } -+ -+ if (par1IChunkProvider.chunkExists(par3 - 1, par4) && !par1IChunkProvider.provideChunk(par3 - 1, par4).isTerrainPopulated && par1IChunkProvider.chunkExists(par3 - 1, par4 + 1) && par1IChunkProvider.chunkExists(par3, par4 + 1) && par1IChunkProvider.chunkExists(par3 - 1, par4 + 1)) { -+ par1IChunkProvider.populate(par2IChunkProvider, par3 - 1, par4); -+ } -+ -+ if (par1IChunkProvider.chunkExists(par3, par4 - 1) && !par1IChunkProvider.provideChunk(par3, par4 - 1).isTerrainPopulated && par1IChunkProvider.chunkExists(par3 + 1, par4 - 1) && par1IChunkProvider.chunkExists(par3 + 1, par4 - 1) && par1IChunkProvider.chunkExists(par3 + 1, par4)) { -+ par1IChunkProvider.populate(par2IChunkProvider, par3, par4 - 1); -+ } -+ -+ if (par1IChunkProvider.chunkExists(par3 - 1, par4 - 1) && !par1IChunkProvider.provideChunk(par3 - 1, par4 - 1).isTerrainPopulated && par1IChunkProvider.chunkExists(par3, par4 - 1) && par1IChunkProvider.chunkExists(par3 - 1, par4)) { -+ par1IChunkProvider.populate(par2IChunkProvider, par3 - 1, par4 - 1); -+ } - } - -- public int getPrecipitationHeight(int var1, int var2) { -- int var3 = var1 | var2 << 4; -+ /** -+ * Gets the height to which rain/snow will fall. Calculates it if not already stored. -+ */ -+ public int getPrecipitationHeight(int par1, int par2) { -+ int var3 = par1 | par2 << 4; - int var4 = this.precipitationHeightMap[var3]; -- if(var4 == -999) { -+ -+ if (var4 == -999) { - int var5 = this.getTopFilledSegment() + 15; - var4 = -1; - -- while(true) { -- while(var5 > 0 && var4 == -1) { -- int var6 = this.getBlockID(var1, var5, var2); -- Material var7 = var6 == 0 ? Material.air : Block.blocksList[var6].blockMaterial; -- if(!var7.blocksMovement() && !var7.isLiquid()) { -- --var5; -- } else { -- var4 = var5 + 1; -- } -+ while (var5 > 0 && var4 == -1) { -+ int var6 = this.getBlockID(par1, var5, par2); -+ Material var7 = var6 == 0 ? Material.air : Block.blocksList[var6].blockMaterial; -+ -+ if (!var7.blocksMovement() && !var7.isLiquid()) { -+ --var5; -+ } else { -+ var4 = var5 + 1; - } -- -- this.precipitationHeightMap[var3] = var4; -- break; - } -+ -+ this.precipitationHeightMap[var3] = var4; - } - - return var4; - } - -+ /** -+ * Checks whether skylight needs updated; if it does, calls updateSkylight_do -+ */ - public void updateSkylight() { -- if(this.isGapLightingUpdated && !this.worldObj.provider.hasNoSky) { -+ if (this.isGapLightingUpdated && !this.worldObj.provider.hasNoSky) { - this.updateSkylight_do(); - } -- - } - -+ /** -+ * Gets a ChunkCoordIntPair representing the Chunk's position. -+ */ - public ChunkCoordIntPair getChunkCoordIntPair() { - return new ChunkCoordIntPair(this.xPosition, this.zPosition); - } - -- public boolean getAreLevelsEmpty(int var1, int var2) { -- if(var1 < 0) { -- var1 = 0; -- } -- -- if(var2 >= 256) { -- var2 = 255; -- } -- -- for(int var3 = var1; var3 <= var2; var3 += 16) { -+ /** -+ * Returns whether the ExtendedBlockStorages containing levels (in blocks) from arg 1 to arg 2 are fully empty (true) -+ * or not (false). -+ */ -+ public boolean getAreLevelsEmpty(int par1, int par2) { -+ if (par1 < 0) { -+ par1 = 0; -+ } -+ -+ if (par2 >= 256) { -+ par2 = 255; -+ } -+ -+ for (int var3 = par1; var3 <= par2; var3 += 16) { - ExtendedBlockStorage var4 = this.storageArrays[var3 >> 4]; -- if(var4 != null && !var4.isEmpty()) { -+ -+ if (var4 != null && !var4.isEmpty()) { - return false; - } - } -@@ -795,121 +1035,145 @@ - return true; - } - -- public void setStorageArrays(ExtendedBlockStorage[] var1) { -- this.storageArrays = var1; -+ public void setStorageArrays(ExtendedBlockStorage[] par1ArrayOfExtendedBlockStorage) { -+ this.storageArrays = par1ArrayOfExtendedBlockStorage; - } - -- public void fillChunk(byte[] var1, int var2, int var3, boolean var4) { -+ /** -+ * Initialise this chunk with new binary data -+ */ -+ public void fillChunk(byte[] par1ArrayOfByte, int par2, int par3, boolean par4) { - int var5 = 0; - boolean var6 = !this.worldObj.provider.hasNoSky; -- - int var7; -- for(var7 = 0; var7 < this.storageArrays.length; ++var7) { -- if((var2 & 1 << var7) != 0) { -- if(this.storageArrays[var7] == null) { -+ -+ for (var7 = 0; var7 < this.storageArrays.length; ++var7) { -+ if ((par2 & 1 << var7) != 0) { -+ if (this.storageArrays[var7] == null) { - this.storageArrays[var7] = new ExtendedBlockStorage(var7 << 4, var6); - } - - byte[] var8 = this.storageArrays[var7].getBlockLSBArray(); -- System.arraycopy(var1, var5, var8, 0, var8.length); -+ System.arraycopy(par1ArrayOfByte, var5, var8, 0, var8.length); - var5 += var8.length; -- } else if(var4 && this.storageArrays[var7] != null) { -+ } else if (par4 && this.storageArrays[var7] != null) { - this.storageArrays[var7] = null; - } - } - - NibbleArray var9; -- for(var7 = 0; var7 < this.storageArrays.length; ++var7) { -- if((var2 & 1 << var7) != 0 && this.storageArrays[var7] != null) { -+ -+ for (var7 = 0; var7 < this.storageArrays.length; ++var7) { -+ if ((par2 & 1 << var7) != 0 && this.storageArrays[var7] != null) { - var9 = this.storageArrays[var7].getMetadataArray(); -- System.arraycopy(var1, var5, var9.data, 0, var9.data.length); -+ System.arraycopy(par1ArrayOfByte, var5, var9.data, 0, var9.data.length); - var5 += var9.data.length; - } - } - -- for(var7 = 0; var7 < this.storageArrays.length; ++var7) { -- if((var2 & 1 << var7) != 0 && this.storageArrays[var7] != null) { -+ for (var7 = 0; var7 < this.storageArrays.length; ++var7) { -+ if ((par2 & 1 << var7) != 0 && this.storageArrays[var7] != null) { - var9 = this.storageArrays[var7].getBlocklightArray(); -- System.arraycopy(var1, var5, var9.data, 0, var9.data.length); -+ System.arraycopy(par1ArrayOfByte, var5, var9.data, 0, var9.data.length); - var5 += var9.data.length; - } - } - -- if(var6) { -- for(var7 = 0; var7 < this.storageArrays.length; ++var7) { -- if((var2 & 1 << var7) != 0 && this.storageArrays[var7] != null) { -+ if (var6) { -+ for (var7 = 0; var7 < this.storageArrays.length; ++var7) { -+ if ((par2 & 1 << var7) != 0 && this.storageArrays[var7] != null) { - var9 = this.storageArrays[var7].getSkylightArray(); -- System.arraycopy(var1, var5, var9.data, 0, var9.data.length); -+ System.arraycopy(par1ArrayOfByte, var5, var9.data, 0, var9.data.length); - var5 += var9.data.length; - } - } - } - -- for(var7 = 0; var7 < this.storageArrays.length; ++var7) { -- if((var3 & 1 << var7) != 0) { -- if(this.storageArrays[var7] == null) { -+ for (var7 = 0; var7 < this.storageArrays.length; ++var7) { -+ if ((par3 & 1 << var7) != 0) { -+ if (this.storageArrays[var7] == null) { - var5 += 2048; - } else { - var9 = this.storageArrays[var7].getBlockMSBArray(); -- if(var9 == null) { -+ -+ if (var9 == null) { - var9 = this.storageArrays[var7].createBlockMSBArray(); - } - -- System.arraycopy(var1, var5, var9.data, 0, var9.data.length); -+ System.arraycopy(par1ArrayOfByte, var5, var9.data, 0, var9.data.length); - var5 += var9.data.length; - } -- } else if(var4 && this.storageArrays[var7] != null && this.storageArrays[var7].getBlockMSBArray() != null) { -+ } else if (par4 && this.storageArrays[var7] != null && this.storageArrays[var7].getBlockMSBArray() != null) { - this.storageArrays[var7].clearMSBArray(); - } - } - -- if(var4) { -- System.arraycopy(var1, var5, this.blockBiomeArray, 0, this.blockBiomeArray.length); -+ if (par4) { -+ System.arraycopy(par1ArrayOfByte, var5, this.blockBiomeArray, 0, this.blockBiomeArray.length); - int var10000 = var5 + this.blockBiomeArray.length; - } - -- for(var7 = 0; var7 < this.storageArrays.length; ++var7) { -- if(this.storageArrays[var7] != null && (var2 & 1 << var7) != 0) { -+ for (var7 = 0; var7 < this.storageArrays.length; ++var7) { -+ if (this.storageArrays[var7] != null && (par2 & 1 << var7) != 0) { - this.storageArrays[var7].removeInvalidBlocks(); - } - } - - this.generateHeightMap(); -- Iterator var11 = this.i.values().iterator(); -+ Iterator var11 = this.chunkTileEntityMap.values().iterator(); - -- while(var11.hasNext()) { -+ while (var11.hasNext()) { - TileEntity var10 = (TileEntity)var11.next(); - var10.updateContainingBlockInfo(); - } -- - } - -- public BiomeGenBase getBiomeGenForWorldCoords(int var1, int var2, WorldChunkManager var3) { -- int var4 = this.blockBiomeArray[var2 << 4 | var1] & 255; -- if(var4 == 255) { -- BiomeGenBase var5 = var3.getBiomeGenAt((this.xPosition << 4) + var1, (this.zPosition << 4) + var2); -+ /** -+ * This method retrieves the biome at a set of coordinates -+ */ -+ public BiomeGenBase getBiomeGenForWorldCoords(int par1, int par2, WorldChunkManager par3WorldChunkManager) { -+ int var4 = this.blockBiomeArray[par2 << 4 | par1] & 255; -+ -+ if (var4 == 255) { -+ BiomeGenBase var5 = par3WorldChunkManager.getBiomeGenAt((this.xPosition << 4) + par1, (this.zPosition << 4) + par2); - var4 = var5.biomeID; -- this.blockBiomeArray[var2 << 4 | var1] = (byte)(var4 & 255); -+ this.blockBiomeArray[par2 << 4 | par1] = (byte)(var4 & 255); - } - - return BiomeGenBase.biomeList[var4] == null ? BiomeGenBase.plains : BiomeGenBase.biomeList[var4]; - } - -+ /** -+ * Returns an array containing a 16x16 mapping on the X/Z of block positions in this Chunk to biome IDs. -+ */ - public byte[] getBiomeArray() { - return this.blockBiomeArray; - } - -- public void setBiomeArray(byte[] var1) { -- this.blockBiomeArray = var1; -+ /** -+ * Accepts a 256-entry array that contains a 16x16 mapping on the X/Z plane of block positions in this Chunk to biome -+ * IDs. -+ */ -+ public void setBiomeArray(byte[] par1ArrayOfByte) { -+ this.blockBiomeArray = par1ArrayOfByte; - } - -+ /** -+ * Resets the relight check index to 0 for this Chunk. -+ */ - public void resetRelightChecks() { - this.queuedLightChecks = 0; - } - -+ /** -+ * Called once-per-chunk-per-tick, and advances the round-robin relight check index per-storage-block by up to 8 blocks -+ * at a time. In a worst-case scenario, can potentially take up to 1.6 seconds, calculated via (4096/(8*16))/20, to re- -+ * check all blocks in a chunk, which could explain both lagging light updates in certain cases as well as Nether -+ * relight -+ */ - public void enqueueRelightChecks() { -- for(int var1 = 0; var1 < 8; ++var1) { -- if(this.queuedLightChecks >= 4096) { -+ for (int var1 = 0; var1 < 8; ++var1) { -+ if (this.queuedLightChecks >= 4096) { - return; - } - -@@ -920,30 +1184,31 @@ - int var5 = (this.xPosition << 4) + var3; - int var6 = (this.zPosition << 4) + var4; - -- for(int var7 = 0; var7 < 16; ++var7) { -+ for (int var7 = 0; var7 < 16; ++var7) { - int var8 = (var2 << 4) + var7; -- if(this.storageArrays[var2] == null && (var7 == 0 || var7 == 15 || var3 == 0 || var3 == 15 || var4 == 0 || var4 == 15) || this.storageArrays[var2] != null && this.storageArrays[var2].getExtBlockID(var3, var7, var4) == 0) { -- if(Block.lightValue[this.worldObj.getBlockId(var5, var8 - 1, var6)] > 0) { -+ -+ if (this.storageArrays[var2] == null && (var7 == 0 || var7 == 15 || var3 == 0 || var3 == 15 || var4 == 0 || var4 == 15) || this.storageArrays[var2] != null && this.storageArrays[var2].getExtBlockID(var3, var7, var4) == 0) { -+ if (Block.lightValue[this.worldObj.getBlockId(var5, var8 - 1, var6)] > 0) { - this.worldObj.updateAllLightTypes(var5, var8 - 1, var6); - } - -- if(Block.lightValue[this.worldObj.getBlockId(var5, var8 + 1, var6)] > 0) { -+ if (Block.lightValue[this.worldObj.getBlockId(var5, var8 + 1, var6)] > 0) { - this.worldObj.updateAllLightTypes(var5, var8 + 1, var6); - } - -- if(Block.lightValue[this.worldObj.getBlockId(var5 - 1, var8, var6)] > 0) { -+ if (Block.lightValue[this.worldObj.getBlockId(var5 - 1, var8, var6)] > 0) { - this.worldObj.updateAllLightTypes(var5 - 1, var8, var6); - } - -- if(Block.lightValue[this.worldObj.getBlockId(var5 + 1, var8, var6)] > 0) { -+ if (Block.lightValue[this.worldObj.getBlockId(var5 + 1, var8, var6)] > 0) { - this.worldObj.updateAllLightTypes(var5 + 1, var8, var6); - } - -- if(Block.lightValue[this.worldObj.getBlockId(var5, var8, var6 - 1)] > 0) { -+ if (Block.lightValue[this.worldObj.getBlockId(var5, var8, var6 - 1)] > 0) { - this.worldObj.updateAllLightTypes(var5, var8, var6 - 1); - } - -- if(Block.lightValue[this.worldObj.getBlockId(var5, var8, var6 + 1)] > 0) { -+ if (Block.lightValue[this.worldObj.getBlockId(var5, var8, var6 + 1)] > 0) { - this.worldObj.updateAllLightTypes(var5, var8, var6 + 1); - } - -@@ -951,6 +1216,5 @@ - } - } - } -- - } - } ---- net/minecraft/src/ModelSkeletonHead.java -+++ net/minecraft/src/ModelSkeletonHead.java -@@ -7,22 +7,30 @@ - this(0, 35, 64, 64); - } - -- public ModelSkeletonHead(int var1, int var2, int var3, int var4) { -- this.textureWidth = var3; -- this.textureHeight = var4; -- this.skeletonHead = new ModelRenderer(this, var1, var2); -+ public ModelSkeletonHead(int par1, int par2, int par3, int par4) { -+ this.textureWidth = par3; -+ this.textureHeight = par4; -+ this.skeletonHead = new ModelRenderer(this, par1, par2); - this.skeletonHead.addBox(-4.0F, -8.0F, -4.0F, 8, 8, 8, 0.0F); - this.skeletonHead.setRotationPoint(0.0F, 0.0F, 0.0F); - } - -- public void render(Entity var1, float var2, float var3, float var4, float var5, float var6, float var7) { -- this.setRotationAngles(var2, var3, var4, var5, var6, var7, var1); -- this.skeletonHead.render(var7); -+ /** -+ * Sets the models various rotation angles then renders the model. -+ */ -+ public void render(Entity par1Entity, float par2, float par3, float par4, float par5, float par6, float par7) { -+ this.setRotationAngles(par2, par3, par4, par5, par6, par7, par1Entity); -+ this.skeletonHead.render(par7); - } - -- public void setRotationAngles(float var1, float var2, float var3, float var4, float var5, float var6, Entity var7) { -- super.setRotationAngles(var1, var2, var3, var4, var5, var6, var7); -- this.skeletonHead.rotateAngleY = var4 / (180.0F / (float)Math.PI); -- this.skeletonHead.rotateAngleX = var5 / (180.0F / (float)Math.PI); -+ /** -+ * Sets the model's various rotation angles. For bipeds, par1 and par2 are used for animating the movement of arms and -+ * legs, where par1 represents the time(so that arms and legs swing back and forth) and par2 represents how "far" arms -+ * and legs can swing at most. -+ */ -+ public void setRotationAngles(float par1, float par2, float par3, float par4, float par5, float par6, Entity par7Entity) { -+ super.setRotationAngles(par1, par2, par3, par4, par5, par6, par7Entity); -+ this.skeletonHead.rotateAngleY = par4 / (180F / (float)Math.PI); -+ this.skeletonHead.rotateAngleX = par5 / (180F / (float)Math.PI); - } - } ---- net/minecraft/src/PlayerPositionComparator.java -+++ net/minecraft/src/PlayerPositionComparator.java -@@ -5,17 +5,20 @@ - public class PlayerPositionComparator implements Comparator { - private final ChunkCoordinates theChunkCoordinates; - -- public PlayerPositionComparator(ChunkCoordinates var1) { -- this.theChunkCoordinates = var1; -+ public PlayerPositionComparator(ChunkCoordinates par1ChunkCoordinates) { -+ this.theChunkCoordinates = par1ChunkCoordinates; - } - -- public int comparePlayers(EntityPlayerMP var1, EntityPlayerMP var2) { -- double var3 = var1.getDistanceSq((double)this.theChunkCoordinates.posX, (double)this.theChunkCoordinates.posY, (double)this.theChunkCoordinates.posZ); -- double var5 = var2.getDistanceSq((double)this.theChunkCoordinates.posX, (double)this.theChunkCoordinates.posY, (double)this.theChunkCoordinates.posZ); -+ /** -+ * Compare the position of two players. -+ */ -+ public int comparePlayers(EntityPlayerMP par1EntityPlayerMP, EntityPlayerMP par2EntityPlayerMP) { -+ double var3 = par1EntityPlayerMP.getDistanceSq((double)this.theChunkCoordinates.posX, (double)this.theChunkCoordinates.posY, (double)this.theChunkCoordinates.posZ); -+ double var5 = par2EntityPlayerMP.getDistanceSq((double)this.theChunkCoordinates.posX, (double)this.theChunkCoordinates.posY, (double)this.theChunkCoordinates.posZ); - return var3 < var5 ? -1 : (var3 > var5 ? 1 : 0); - } - -- public int compare(Object var1, Object var2) { -- return this.comparePlayers((EntityPlayerMP)var1, (EntityPlayerMP)var2); -+ public int compare(Object par1Obj, Object par2Obj) { -+ return this.comparePlayers((EntityPlayerMP)par1Obj, (EntityPlayerMP)par2Obj); - } - } ---- /dev/null -+++ org/spoutcraft/client/gui/database/RandomButton.java -@@ -1,0 +1,43 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.client.gui.database; -+ -+import java.util.Random; -+ -+public class RandomButton extends SortButton { -+ Random rand = new Random(); -+ long seed = rand.nextLong(); -+ -+ public RandomButton(AbstractAPIModel model) { -+ super("Random", "random", model); -+ setAllowSorting(false); -+ } -+ -+ @Override -+ public void onButtonClick() { -+ seed = rand.nextLong(); -+ super.onButtonClick(); -+ } -+ -+ @Override -+ public String getUrlPart() { -+ return "random&seed=" + seed; -+ } -+} ---- net/minecraft/src/ComponentStrongholdCorridor.java -+++ net/minecraft/src/ComponentStrongholdCorridor.java -@@ -6,38 +6,39 @@ - public class ComponentStrongholdCorridor extends ComponentStronghold { - private int field_74993_a; - -- public ComponentStrongholdCorridor() { -- } -- -- public ComponentStrongholdCorridor(int var1, Random var2, StructureBoundingBox var3, int var4) { -- super(var1); -- this.coordBaseMode = var4; -- this.boundingBox = var3; -- this.field_74993_a = var4 != 2 && var4 != 0 ? var3.getXSize() : var3.getZSize(); -- } -- -- protected void func_143012_a(NBTTagCompound var1) { -- super.func_143012_a(var1); -- var1.setInteger("Steps", this.field_74993_a); -- } -- -- protected void func_143011_b(NBTTagCompound var1) { -- super.func_143011_b(var1); -- this.field_74993_a = var1.getInteger("Steps"); -- } -- -- public static StructureBoundingBox func_74992_a(List var0, Random var1, int var2, int var3, int var4, int var5) { -+ public ComponentStrongholdCorridor() {} -+ -+ public ComponentStrongholdCorridor(int par1, Random par2Random, StructureBoundingBox par3StructureBoundingBox, int par4) { -+ super(par1); -+ this.coordBaseMode = par4; -+ this.boundingBox = par3StructureBoundingBox; -+ this.field_74993_a = par4 != 2 && par4 != 0 ? par3StructureBoundingBox.getXSize() : par3StructureBoundingBox.getZSize(); -+ } -+ -+ protected void func_143012_a(NBTTagCompound par1NBTTagCompound) { -+ super.func_143012_a(par1NBTTagCompound); -+ par1NBTTagCompound.setInteger("Steps", this.field_74993_a); -+ } -+ -+ protected void func_143011_b(NBTTagCompound par1NBTTagCompound) { -+ super.func_143011_b(par1NBTTagCompound); -+ this.field_74993_a = par1NBTTagCompound.getInteger("Steps"); -+ } -+ -+ public static StructureBoundingBox func_74992_a(List par0List, Random par1Random, int par2, int par3, int par4, int par5) { - boolean var6 = true; -- StructureBoundingBox var7 = StructureBoundingBox.getComponentToAddBoundingBox(var2, var3, var4, -1, -1, 0, 5, 5, 4, var5); -- StructureComponent var8 = StructureComponent.findIntersecting(var0, var7); -- if(var8 == null) { -+ StructureBoundingBox var7 = StructureBoundingBox.getComponentToAddBoundingBox(par2, par3, par4, -1, -1, 0, 5, 5, 4, par5); -+ StructureComponent var8 = StructureComponent.findIntersecting(par0List, var7); -+ -+ if (var8 == null) { - return null; - } else { -- if(var8.getBoundingBox().minY == var7.minY) { -- for(int var9 = 3; var9 >= 1; --var9) { -- var7 = StructureBoundingBox.getComponentToAddBoundingBox(var2, var3, var4, -1, -1, 0, 5, 5, var9 - 1, var5); -- if(!var8.getBoundingBox().intersectsWith(var7)) { -- return StructureBoundingBox.getComponentToAddBoundingBox(var2, var3, var4, -1, -1, 0, 5, 5, var9, var5); -+ if (var8.getBoundingBox().minY == var7.minY) { -+ for (int var9 = 3; var9 >= 1; --var9) { -+ var7 = StructureBoundingBox.getComponentToAddBoundingBox(par2, par3, par4, -1, -1, 0, 5, 5, var9 - 1, par5); -+ -+ if (!var8.getBoundingBox().intersectsWith(var7)) { -+ return StructureBoundingBox.getComponentToAddBoundingBox(par2, par3, par4, -1, -1, 0, 5, 5, var9, par5); - } - } - } -@@ -46,30 +47,34 @@ - } - } - -- public boolean addComponentParts(World var1, Random var2, StructureBoundingBox var3) { -- if(this.isLiquidInStructureBoundingBox(var1, var3)) { -+ /** -+ * second Part of Structure generating, this for example places Spiderwebs, Mob Spawners, it closes Mineshafts at the -+ * end, it adds Fences... -+ */ -+ public boolean addComponentParts(World par1World, Random par2Random, StructureBoundingBox par3StructureBoundingBox) { -+ if (this.isLiquidInStructureBoundingBox(par1World, par3StructureBoundingBox)) { - return false; - } else { -- for(int var4 = 0; var4 < this.field_74993_a; ++var4) { -- this.placeBlockAtCurrentPosition(var1, Block.stoneBrick.blockID, 0, 0, 0, var4, var3); -- this.placeBlockAtCurrentPosition(var1, Block.stoneBrick.blockID, 0, 1, 0, var4, var3); -- this.placeBlockAtCurrentPosition(var1, Block.stoneBrick.blockID, 0, 2, 0, var4, var3); -- this.placeBlockAtCurrentPosition(var1, Block.stoneBrick.blockID, 0, 3, 0, var4, var3); -- this.placeBlockAtCurrentPosition(var1, Block.stoneBrick.blockID, 0, 4, 0, var4, var3); -+ for (int var4 = 0; var4 < this.field_74993_a; ++var4) { -+ this.placeBlockAtCurrentPosition(par1World, Block.stoneBrick.blockID, 0, 0, 0, var4, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.stoneBrick.blockID, 0, 1, 0, var4, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.stoneBrick.blockID, 0, 2, 0, var4, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.stoneBrick.blockID, 0, 3, 0, var4, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.stoneBrick.blockID, 0, 4, 0, var4, par3StructureBoundingBox); - -- for(int var5 = 1; var5 <= 3; ++var5) { -- this.placeBlockAtCurrentPosition(var1, Block.stoneBrick.blockID, 0, 0, var5, var4, var3); -- this.placeBlockAtCurrentPosition(var1, 0, 0, 1, var5, var4, var3); -- this.placeBlockAtCurrentPosition(var1, 0, 0, 2, var5, var4, var3); -- this.placeBlockAtCurrentPosition(var1, 0, 0, 3, var5, var4, var3); -- this.placeBlockAtCurrentPosition(var1, Block.stoneBrick.blockID, 0, 4, var5, var4, var3); -+ for (int var5 = 1; var5 <= 3; ++var5) { -+ this.placeBlockAtCurrentPosition(par1World, Block.stoneBrick.blockID, 0, 0, var5, var4, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, 0, 0, 1, var5, var4, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, 0, 0, 2, var5, var4, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, 0, 0, 3, var5, var4, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.stoneBrick.blockID, 0, 4, var5, var4, par3StructureBoundingBox); - } - -- this.placeBlockAtCurrentPosition(var1, Block.stoneBrick.blockID, 0, 0, 4, var4, var3); -- this.placeBlockAtCurrentPosition(var1, Block.stoneBrick.blockID, 0, 1, 4, var4, var3); -- this.placeBlockAtCurrentPosition(var1, Block.stoneBrick.blockID, 0, 2, 4, var4, var3); -- this.placeBlockAtCurrentPosition(var1, Block.stoneBrick.blockID, 0, 3, 4, var4, var3); -- this.placeBlockAtCurrentPosition(var1, Block.stoneBrick.blockID, 0, 4, 4, var4, var3); -+ this.placeBlockAtCurrentPosition(par1World, Block.stoneBrick.blockID, 0, 0, 4, var4, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.stoneBrick.blockID, 0, 1, 4, var4, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.stoneBrick.blockID, 0, 2, 4, var4, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.stoneBrick.blockID, 0, 3, 4, var4, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.stoneBrick.blockID, 0, 4, 4, var4, par3StructureBoundingBox); - } - - return true; ---- net/minecraft/src/AxisAlignedBB.java -+++ net/minecraft/src/AxisAlignedBB.java -@@ -1,7 +1,9 @@ - package net.minecraft.src; - - public class AxisAlignedBB { -- private static final ThreadLocal g = new AABBLocalPool(); -+ -+ /** ThreadLocal AABBPool */ -+ private static final ThreadLocal theAABBLocalPool = new AABBLocalPool(); - public double minX; - public double minY; - public double minZ; -@@ -9,190 +11,247 @@ - public double maxY; - public double maxZ; - -- public static AxisAlignedBB getBoundingBox(double var0, double var2, double var4, double var6, double var8, double var10) { -- return new AxisAlignedBB(var0, var2, var4, var6, var8, var10); -+ /** -+ * Returns a bounding box with the specified bounds. Args: minX, minY, minZ, maxX, maxY, maxZ -+ */ -+ public static AxisAlignedBB getBoundingBox(double par0, double par2, double par4, double par6, double par8, double par10) { -+ return new AxisAlignedBB(par0, par2, par4, par6, par8, par10); - } - -+ /** -+ * Gets the ThreadLocal AABBPool -+ */ - public static AABBPool getAABBPool() { -- return (AABBPool)g.get(); -- } -- -- protected AxisAlignedBB(double var1, double var3, double var5, double var7, double var9, double var11) { -- this.minX = var1; -- this.minY = var3; -- this.minZ = var5; -- this.maxX = var7; -- this.maxY = var9; -- this.maxZ = var11; -- } -- -- public AxisAlignedBB setBounds(double var1, double var3, double var5, double var7, double var9, double var11) { -- this.minX = var1; -- this.minY = var3; -- this.minZ = var5; -- this.maxX = var7; -- this.maxY = var9; -- this.maxZ = var11; -+ return (AABBPool)theAABBLocalPool.get(); -+ } -+ -+ protected AxisAlignedBB(double par1, double par3, double par5, double par7, double par9, double par11) { -+ this.minX = par1; -+ this.minY = par3; -+ this.minZ = par5; -+ this.maxX = par7; -+ this.maxY = par9; -+ this.maxZ = par11; -+ } -+ -+ /** -+ * Sets the bounds of the bounding box. Args: minX, minY, minZ, maxX, maxY, maxZ -+ */ -+ public AxisAlignedBB setBounds(double par1, double par3, double par5, double par7, double par9, double par11) { -+ this.minX = par1; -+ this.minY = par3; -+ this.minZ = par5; -+ this.maxX = par7; -+ this.maxY = par9; -+ this.maxZ = par11; - return this; - } - -- public AxisAlignedBB addCoord(double var1, double var3, double var5) { -+ /** -+ * Adds the coordinates to the bounding box extending it if the point lies outside the current ranges. Args: x, y, z -+ */ -+ public AxisAlignedBB addCoord(double par1, double par3, double par5) { - double var7 = this.minX; - double var9 = this.minY; - double var11 = this.minZ; - double var13 = this.maxX; - double var15 = this.maxY; - double var17 = this.maxZ; -- if(var1 < 0.0D) { -- var7 += var1; -- } -- -- if(var1 > 0.0D) { -- var13 += var1; -- } -- -- if(var3 < 0.0D) { -- var9 += var3; -- } -- -- if(var3 > 0.0D) { -- var15 += var3; -- } -- -- if(var5 < 0.0D) { -- var11 += var5; -- } -- -- if(var5 > 0.0D) { -- var17 += var5; -- } -- -- return getAABBPool().getAABB(var7, var9, var11, var13, var15, var17); -- } -- -- public AxisAlignedBB expand(double var1, double var3, double var5) { -- double var7 = this.minX - var1; -- double var9 = this.minY - var3; -- double var11 = this.minZ - var5; -- double var13 = this.maxX + var1; -- double var15 = this.maxY + var3; -- double var17 = this.maxZ + var5; -- return getAABBPool().getAABB(var7, var9, var11, var13, var15, var17); -- } -- -- public AxisAlignedBB func_111270_a(AxisAlignedBB var1) { -- double var2 = Math.min(this.minX, var1.minX); -- double var4 = Math.min(this.minY, var1.minY); -- double var6 = Math.min(this.minZ, var1.minZ); -- double var8 = Math.max(this.maxX, var1.maxX); -- double var10 = Math.max(this.maxY, var1.maxY); -- double var12 = Math.max(this.maxZ, var1.maxZ); -+ -+ if (par1 < 0.0D) { -+ var7 += par1; -+ } -+ -+ if (par1 > 0.0D) { -+ var13 += par1; -+ } -+ -+ if (par3 < 0.0D) { -+ var9 += par3; -+ } -+ -+ if (par3 > 0.0D) { -+ var15 += par3; -+ } -+ -+ if (par5 < 0.0D) { -+ var11 += par5; -+ } -+ -+ if (par5 > 0.0D) { -+ var17 += par5; -+ } -+ -+ return getAABBPool().getAABB(var7, var9, var11, var13, var15, var17); -+ } -+ -+ /** -+ * Returns a bounding box expanded by the specified vector (if negative numbers are given it will shrink). Args: x, y, -+ * z -+ */ -+ public AxisAlignedBB expand(double par1, double par3, double par5) { -+ double var7 = this.minX - par1; -+ double var9 = this.minY - par3; -+ double var11 = this.minZ - par5; -+ double var13 = this.maxX + par1; -+ double var15 = this.maxY + par3; -+ double var17 = this.maxZ + par5; -+ return getAABBPool().getAABB(var7, var9, var11, var13, var15, var17); -+ } -+ -+ public AxisAlignedBB func_111270_a(AxisAlignedBB par1AxisAlignedBB) { -+ double var2 = Math.min(this.minX, par1AxisAlignedBB.minX); -+ double var4 = Math.min(this.minY, par1AxisAlignedBB.minY); -+ double var6 = Math.min(this.minZ, par1AxisAlignedBB.minZ); -+ double var8 = Math.max(this.maxX, par1AxisAlignedBB.maxX); -+ double var10 = Math.max(this.maxY, par1AxisAlignedBB.maxY); -+ double var12 = Math.max(this.maxZ, par1AxisAlignedBB.maxZ); - return getAABBPool().getAABB(var2, var4, var6, var8, var10, var12); - } - -- public AxisAlignedBB getOffsetBoundingBox(double var1, double var3, double var5) { -- return getAABBPool().getAABB(this.minX + var1, this.minY + var3, this.minZ + var5, this.maxX + var1, this.maxY + var3, this.maxZ + var5); -- } -- -- public double calculateXOffset(AxisAlignedBB var1, double var2) { -- if(var1.maxY > this.minY && var1.minY < this.maxY) { -- if(var1.maxZ > this.minZ && var1.minZ < this.maxZ) { -- double var4; -- if(var2 > 0.0D && var1.maxX <= this.minX) { -- var4 = this.minX - var1.maxX; -- if(var4 < var2) { -- var2 = var4; -- } -- } -- -- if(var2 < 0.0D && var1.minX >= this.maxX) { -- var4 = this.maxX - var1.minX; -- if(var4 > var2) { -- var2 = var4; -- } -- } -- -- return var2; -- } else { -- return var2; -- } -- } else { -- return var2; -- } -- } -- -- public double calculateYOffset(AxisAlignedBB var1, double var2) { -- if(var1.maxX > this.minX && var1.minX < this.maxX) { -- if(var1.maxZ > this.minZ && var1.minZ < this.maxZ) { -- double var4; -- if(var2 > 0.0D && var1.maxY <= this.minY) { -- var4 = this.minY - var1.maxY; -- if(var4 < var2) { -- var2 = var4; -- } -- } -- -- if(var2 < 0.0D && var1.minY >= this.maxY) { -- var4 = this.maxY - var1.minY; -- if(var4 > var2) { -- var2 = var4; -- } -- } -- -- return var2; -- } else { -- return var2; -- } -- } else { -- return var2; -- } -- } -- -- public double calculateZOffset(AxisAlignedBB var1, double var2) { -- if(var1.maxX > this.minX && var1.minX < this.maxX) { -- if(var1.maxY > this.minY && var1.minY < this.maxY) { -- double var4; -- if(var2 > 0.0D && var1.maxZ <= this.minZ) { -- var4 = this.minZ - var1.maxZ; -- if(var4 < var2) { -- var2 = var4; -- } -- } -- -- if(var2 < 0.0D && var1.minZ >= this.maxZ) { -- var4 = this.maxZ - var1.minZ; -- if(var4 > var2) { -- var2 = var4; -- } -- } -- -- return var2; -- } else { -- return var2; -- } -- } else { -- return var2; -- } -- } -- -- public boolean intersectsWith(AxisAlignedBB var1) { -- return var1.maxX > this.minX && var1.minX < this.maxX ? (var1.maxY > this.minY && var1.minY < this.maxY ? var1.maxZ > this.minZ && var1.minZ < this.maxZ : false) : false; -- } -- -- public AxisAlignedBB offset(double var1, double var3, double var5) { -- this.minX += var1; -- this.minY += var3; -- this.minZ += var5; -- this.maxX += var1; -- this.maxY += var3; -- this.maxZ += var5; -+ /** -+ * Returns a bounding box offseted by the specified vector (if negative numbers are given it will shrink). Args: x, y, -+ * z -+ */ -+ public AxisAlignedBB getOffsetBoundingBox(double par1, double par3, double par5) { -+ return getAABBPool().getAABB(this.minX + par1, this.minY + par3, this.minZ + par5, this.maxX + par1, this.maxY + par3, this.maxZ + par5); -+ } -+ -+ /** -+ * if instance and the argument bounding boxes overlap in the Y and Z dimensions, calculate the offset between them in -+ * the X dimension. return var2 if the bounding boxes do not overlap or if var2 is closer to 0 then the calculated -+ * offset. Otherwise return the calculated offset. -+ */ -+ public double calculateXOffset(AxisAlignedBB par1AxisAlignedBB, double par2) { -+ if (par1AxisAlignedBB.maxY > this.minY && par1AxisAlignedBB.minY < this.maxY) { -+ if (par1AxisAlignedBB.maxZ > this.minZ && par1AxisAlignedBB.minZ < this.maxZ) { -+ double var4; -+ -+ if (par2 > 0.0D && par1AxisAlignedBB.maxX <= this.minX) { -+ var4 = this.minX - par1AxisAlignedBB.maxX; -+ -+ if (var4 < par2) { -+ par2 = var4; -+ } -+ } -+ -+ if (par2 < 0.0D && par1AxisAlignedBB.minX >= this.maxX) { -+ var4 = this.maxX - par1AxisAlignedBB.minX; -+ -+ if (var4 > par2) { -+ par2 = var4; -+ } -+ } -+ -+ return par2; -+ } else { -+ return par2; -+ } -+ } else { -+ return par2; -+ } -+ } -+ -+ /** -+ * if instance and the argument bounding boxes overlap in the X and Z dimensions, calculate the offset between them in -+ * the Y dimension. return var2 if the bounding boxes do not overlap or if var2 is closer to 0 then the calculated -+ * offset. Otherwise return the calculated offset. -+ */ -+ public double calculateYOffset(AxisAlignedBB par1AxisAlignedBB, double par2) { -+ if (par1AxisAlignedBB.maxX > this.minX && par1AxisAlignedBB.minX < this.maxX) { -+ if (par1AxisAlignedBB.maxZ > this.minZ && par1AxisAlignedBB.minZ < this.maxZ) { -+ double var4; -+ -+ if (par2 > 0.0D && par1AxisAlignedBB.maxY <= this.minY) { -+ var4 = this.minY - par1AxisAlignedBB.maxY; -+ -+ if (var4 < par2) { -+ par2 = var4; -+ } -+ } -+ -+ if (par2 < 0.0D && par1AxisAlignedBB.minY >= this.maxY) { -+ var4 = this.maxY - par1AxisAlignedBB.minY; -+ -+ if (var4 > par2) { -+ par2 = var4; -+ } -+ } -+ -+ return par2; -+ } else { -+ return par2; -+ } -+ } else { -+ return par2; -+ } -+ } -+ -+ /** -+ * if instance and the argument bounding boxes overlap in the Y and X dimensions, calculate the offset between them in -+ * the Z dimension. return var2 if the bounding boxes do not overlap or if var2 is closer to 0 then the calculated -+ * offset. Otherwise return the calculated offset. -+ */ -+ public double calculateZOffset(AxisAlignedBB par1AxisAlignedBB, double par2) { -+ if (par1AxisAlignedBB.maxX > this.minX && par1AxisAlignedBB.minX < this.maxX) { -+ if (par1AxisAlignedBB.maxY > this.minY && par1AxisAlignedBB.minY < this.maxY) { -+ double var4; -+ -+ if (par2 > 0.0D && par1AxisAlignedBB.maxZ <= this.minZ) { -+ var4 = this.minZ - par1AxisAlignedBB.maxZ; -+ -+ if (var4 < par2) { -+ par2 = var4; -+ } -+ } -+ -+ if (par2 < 0.0D && par1AxisAlignedBB.minZ >= this.maxZ) { -+ var4 = this.maxZ - par1AxisAlignedBB.minZ; -+ -+ if (var4 > par2) { -+ par2 = var4; -+ } -+ } -+ -+ return par2; -+ } else { -+ return par2; -+ } -+ } else { -+ return par2; -+ } -+ } -+ -+ /** -+ * Returns whether the given bounding box intersects with this one. Args: axisAlignedBB -+ */ -+ public boolean intersectsWith(AxisAlignedBB par1AxisAlignedBB) { -+ return par1AxisAlignedBB.maxX > this.minX && par1AxisAlignedBB.minX < this.maxX ? (par1AxisAlignedBB.maxY > this.minY && par1AxisAlignedBB.minY < this.maxY ? par1AxisAlignedBB.maxZ > this.minZ && par1AxisAlignedBB.minZ < this.maxZ : false) : false; -+ } -+ -+ /** -+ * Offsets the current bounding box by the specified coordinates. Args: x, y, z -+ */ -+ public AxisAlignedBB offset(double par1, double par3, double par5) { -+ this.minX += par1; -+ this.minY += par3; -+ this.minZ += par5; -+ this.maxX += par1; -+ this.maxY += par3; -+ this.maxZ += par5; - return this; - } - -- public boolean isVecInside(Vec3 var1) { -- return var1.xCoord > this.minX && var1.xCoord < this.maxX ? (var1.yCoord > this.minY && var1.yCoord < this.maxY ? var1.zCoord > this.minZ && var1.zCoord < this.maxZ : false) : false; -+ /** -+ * Returns if the supplied Vec3D is completely inside the bounding box -+ */ -+ public boolean isVecInside(Vec3 par1Vec3) { -+ return par1Vec3.xCoord > this.minX && par1Vec3.xCoord < this.maxX ? (par1Vec3.yCoord > this.minY && par1Vec3.yCoord < this.maxY ? par1Vec3.zCoord > this.minZ && par1Vec3.zCoord < this.maxZ : false) : false; - } - -+ /** -+ * Returns the average length of the edges of the bounding box. -+ */ - public double getAverageEdgeLength() { - double var1 = this.maxX - this.minX; - double var3 = this.maxY - this.minY; -@@ -200,101 +259,110 @@ - return (var1 + var3 + var5) / 3.0D; - } - -- public AxisAlignedBB contract(double var1, double var3, double var5) { -- double var7 = this.minX + var1; -- double var9 = this.minY + var3; -- double var11 = this.minZ + var5; -- double var13 = this.maxX - var1; -- double var15 = this.maxY - var3; -- double var17 = this.maxZ - var5; -+ /** -+ * Returns a bounding box that is inset by the specified amounts -+ */ -+ public AxisAlignedBB contract(double par1, double par3, double par5) { -+ double var7 = this.minX + par1; -+ double var9 = this.minY + par3; -+ double var11 = this.minZ + par5; -+ double var13 = this.maxX - par1; -+ double var15 = this.maxY - par3; -+ double var17 = this.maxZ - par5; - return getAABBPool().getAABB(var7, var9, var11, var13, var15, var17); - } - -+ /** -+ * Returns a copy of the bounding box. -+ */ - public AxisAlignedBB copy() { - return getAABBPool().getAABB(this.minX, this.minY, this.minZ, this.maxX, this.maxY, this.maxZ); - } - -- public MovingObjectPosition calculateIntercept(Vec3 var1, Vec3 var2) { -- Vec3 var3 = var1.getIntermediateWithXValue(var2, this.minX); -- Vec3 var4 = var1.getIntermediateWithXValue(var2, this.maxX); -- Vec3 var5 = var1.getIntermediateWithYValue(var2, this.minY); -- Vec3 var6 = var1.getIntermediateWithYValue(var2, this.maxY); -- Vec3 var7 = var1.getIntermediateWithZValue(var2, this.minZ); -- Vec3 var8 = var1.getIntermediateWithZValue(var2, this.maxZ); -- if(!this.isVecInYZ(var3)) { -+ public MovingObjectPosition calculateIntercept(Vec3 par1Vec3, Vec3 par2Vec3) { -+ Vec3 var3 = par1Vec3.getIntermediateWithXValue(par2Vec3, this.minX); -+ Vec3 var4 = par1Vec3.getIntermediateWithXValue(par2Vec3, this.maxX); -+ Vec3 var5 = par1Vec3.getIntermediateWithYValue(par2Vec3, this.minY); -+ Vec3 var6 = par1Vec3.getIntermediateWithYValue(par2Vec3, this.maxY); -+ Vec3 var7 = par1Vec3.getIntermediateWithZValue(par2Vec3, this.minZ); -+ Vec3 var8 = par1Vec3.getIntermediateWithZValue(par2Vec3, this.maxZ); -+ -+ if (!this.isVecInYZ(var3)) { - var3 = null; - } - -- if(!this.isVecInYZ(var4)) { -+ if (!this.isVecInYZ(var4)) { - var4 = null; - } - -- if(!this.isVecInXZ(var5)) { -+ if (!this.isVecInXZ(var5)) { - var5 = null; - } - -- if(!this.isVecInXZ(var6)) { -+ if (!this.isVecInXZ(var6)) { - var6 = null; - } - -- if(!this.isVecInXY(var7)) { -+ if (!this.isVecInXY(var7)) { - var7 = null; - } - -- if(!this.isVecInXY(var8)) { -+ if (!this.isVecInXY(var8)) { - var8 = null; - } - - Vec3 var9 = null; -- if(var3 != null && (var9 == null || var1.squareDistanceTo(var3) < var1.squareDistanceTo(var9))) { -+ -+ if (var3 != null && (var9 == null || par1Vec3.squareDistanceTo(var3) < par1Vec3.squareDistanceTo(var9))) { - var9 = var3; - } - -- if(var4 != null && (var9 == null || var1.squareDistanceTo(var4) < var1.squareDistanceTo(var9))) { -+ if (var4 != null && (var9 == null || par1Vec3.squareDistanceTo(var4) < par1Vec3.squareDistanceTo(var9))) { - var9 = var4; - } - -- if(var5 != null && (var9 == null || var1.squareDistanceTo(var5) < var1.squareDistanceTo(var9))) { -+ if (var5 != null && (var9 == null || par1Vec3.squareDistanceTo(var5) < par1Vec3.squareDistanceTo(var9))) { - var9 = var5; - } - -- if(var6 != null && (var9 == null || var1.squareDistanceTo(var6) < var1.squareDistanceTo(var9))) { -+ if (var6 != null && (var9 == null || par1Vec3.squareDistanceTo(var6) < par1Vec3.squareDistanceTo(var9))) { - var9 = var6; - } - -- if(var7 != null && (var9 == null || var1.squareDistanceTo(var7) < var1.squareDistanceTo(var9))) { -+ if (var7 != null && (var9 == null || par1Vec3.squareDistanceTo(var7) < par1Vec3.squareDistanceTo(var9))) { - var9 = var7; - } - -- if(var8 != null && (var9 == null || var1.squareDistanceTo(var8) < var1.squareDistanceTo(var9))) { -+ if (var8 != null && (var9 == null || par1Vec3.squareDistanceTo(var8) < par1Vec3.squareDistanceTo(var9))) { - var9 = var8; - } - -- if(var9 == null) { -+ if (var9 == null) { - return null; - } else { - byte var10 = -1; -- if(var9 == var3) { -+ -+ if (var9 == var3) { - var10 = 4; - } - -- if(var9 == var4) { -+ if (var9 == var4) { - var10 = 5; - } - -- if(var9 == var5) { -+ if (var9 == var5) { - var10 = 0; - } - -- if(var9 == var6) { -+ if (var9 == var6) { - var10 = 1; - } - -- if(var9 == var7) { -+ if (var9 == var7) { - var10 = 2; - } - -- if(var9 == var8) { -+ if (var9 == var8) { - var10 = 3; - } - -@@ -302,25 +370,37 @@ - } - } - -- private boolean isVecInYZ(Vec3 var1) { -- return var1 == null ? false : var1.yCoord >= this.minY && var1.yCoord <= this.maxY && var1.zCoord >= this.minZ && var1.zCoord <= this.maxZ; -- } -- -- private boolean isVecInXZ(Vec3 var1) { -- return var1 == null ? false : var1.xCoord >= this.minX && var1.xCoord <= this.maxX && var1.zCoord >= this.minZ && var1.zCoord <= this.maxZ; -- } -- -- private boolean isVecInXY(Vec3 var1) { -- return var1 == null ? false : var1.xCoord >= this.minX && var1.xCoord <= this.maxX && var1.yCoord >= this.minY && var1.yCoord <= this.maxY; -- } -- -- public void setBB(AxisAlignedBB var1) { -- this.minX = var1.minX; -- this.minY = var1.minY; -- this.minZ = var1.minZ; -- this.maxX = var1.maxX; -- this.maxY = var1.maxY; -- this.maxZ = var1.maxZ; -+ /** -+ * Checks if the specified vector is within the YZ dimensions of the bounding box. Args: Vec3D -+ */ -+ private boolean isVecInYZ(Vec3 par1Vec3) { -+ return par1Vec3 == null ? false : par1Vec3.yCoord >= this.minY && par1Vec3.yCoord <= this.maxY && par1Vec3.zCoord >= this.minZ && par1Vec3.zCoord <= this.maxZ; -+ } -+ -+ /** -+ * Checks if the specified vector is within the XZ dimensions of the bounding box. Args: Vec3D -+ */ -+ private boolean isVecInXZ(Vec3 par1Vec3) { -+ return par1Vec3 == null ? false : par1Vec3.xCoord >= this.minX && par1Vec3.xCoord <= this.maxX && par1Vec3.zCoord >= this.minZ && par1Vec3.zCoord <= this.maxZ; -+ } -+ -+ /** -+ * Checks if the specified vector is within the XY dimensions of the bounding box. Args: Vec3D -+ */ -+ private boolean isVecInXY(Vec3 par1Vec3) { -+ return par1Vec3 == null ? false : par1Vec3.xCoord >= this.minX && par1Vec3.xCoord <= this.maxX && par1Vec3.yCoord >= this.minY && par1Vec3.yCoord <= this.maxY; -+ } -+ -+ /** -+ * Sets the bounding box to the same bounds as the bounding box passed in. Args: axisAlignedBB -+ */ -+ public void setBB(AxisAlignedBB par1AxisAlignedBB) { -+ this.minX = par1AxisAlignedBB.minX; -+ this.minY = par1AxisAlignedBB.minY; -+ this.minZ = par1AxisAlignedBB.minZ; -+ this.maxX = par1AxisAlignedBB.maxX; -+ this.maxY = par1AxisAlignedBB.maxY; -+ this.maxZ = par1AxisAlignedBB.maxZ; - } - - public String toString() { ---- net/minecraft/src/RenderCaveSpider.java -+++ net/minecraft/src/RenderCaveSpider.java -@@ -9,23 +9,30 @@ - this.shadowSize *= 0.7F; - } - -- protected void scaleSpider(EntityCaveSpider var1, float var2) { -+ protected void scaleSpider(EntityCaveSpider par1EntityCaveSpider, float par2) { - GL11.glScalef(0.7F, 0.7F, 0.7F); - } - -- protected ResourceLocation getCaveSpiderTextures(EntityCaveSpider var1) { -+ protected ResourceLocation getCaveSpiderTextures(EntityCaveSpider par1EntityCaveSpider) { - return caveSpiderTextures; - } - -- protected ResourceLocation getSpiderTextures(EntitySpider var1) { -- return this.getCaveSpiderTextures((EntityCaveSpider)var1); -- } -- -- protected void preRenderCallback(EntityLivingBase var1, float var2) { -- this.scaleSpider((EntityCaveSpider)var1, var2); -- } -- -- protected ResourceLocation getEntityTexture(Entity var1) { -- return this.getCaveSpiderTextures((EntityCaveSpider)var1); -+ protected ResourceLocation getSpiderTextures(EntitySpider par1EntitySpider) { -+ return this.getCaveSpiderTextures((EntityCaveSpider)par1EntitySpider); -+ } -+ -+ /** -+ * Allows the render to do any OpenGL state modifications necessary before the model is rendered. Args: entityLiving, -+ * partialTickTime -+ */ -+ protected void preRenderCallback(EntityLivingBase par1EntityLivingBase, float par2) { -+ this.scaleSpider((EntityCaveSpider)par1EntityLivingBase, par2); -+ } -+ -+ /** -+ * Returns the location of an entity's texture. Doesn't seem to be called unless you call Render.bindEntityTexture. -+ */ -+ protected ResourceLocation getEntityTexture(Entity par1Entity) { -+ return this.getCaveSpiderTextures((EntityCaveSpider)par1Entity); - } - } ---- net/minecraft/src/Locale.java -+++ net/minecraft/src/Locale.java -@@ -14,26 +14,32 @@ - import org.apache.commons.io.IOUtils; - - public class Locale { -- private static final Splitter b = Splitter.on('=').limit(2); -- private static final Pattern c = Pattern.compile("%(\\d+\\$)?[\\d\\.]*[df]"); -- Map a = Maps.newHashMap(); -+ -+ /** Splits on "=" */ -+ private static final Splitter splitter = Splitter.on('=').limit(2); -+ private static final Pattern field_135031_c = Pattern.compile("%(\\d+\\$)?[\\d\\.]*[df]"); -+ Map field_135032_a = Maps.newHashMap(); - private boolean field_135029_d; - -- public synchronized void loadLocaleDataFiles(ResourceManager var1, List var2) { -- this.a.clear(); -- Iterator var3 = var2.iterator(); -+ /** -+ * par2 is a list of languages. For each language $L and domain $D, attempts to load the resource $D:lang/$L.lang -+ */ -+ public synchronized void loadLocaleDataFiles(ResourceManager par1ResourceManager, List par2List) { -+ this.field_135032_a.clear(); -+ Iterator var3 = par2List.iterator(); - -- while(var3.hasNext()) { -+ while (var3.hasNext()) { - String var4 = (String)var3.next(); -- String var5 = String.format("lang/%s.lang", new Object[]{var4}); -- Iterator var6 = var1.getResourceDomains().iterator(); -+ String var5 = String.format("lang/%s.lang", new Object[] {var4}); -+ Iterator var6 = par1ResourceManager.getResourceDomains().iterator(); - -- while(var6.hasNext()) { -+ while (var6.hasNext()) { - String var7 = (String)var6.next(); - - try { -- this.loadLocaleData(var1.getAllResources(new ResourceLocation(var7, var5))); -+ this.loadLocaleData(par1ResourceManager.getAllResources(new ResourceLocation(var7, var5))); - } catch (IOException var9) { -+ ; - } - } - } -@@ -47,65 +53,73 @@ - - private void checkUnicode() { - this.field_135029_d = false; -- Iterator var1 = this.a.values().iterator(); -- -- while(true) { -- while(var1.hasNext()) { -- String var2 = (String)var1.next(); -- -- for(int var3 = 0; var3 < var2.length(); ++var3) { -- if(var2.charAt(var3) >= 256) { -- this.field_135029_d = true; -- break; -- } -+ Iterator var1 = this.field_135032_a.values().iterator(); -+ -+ while (var1.hasNext()) { -+ String var2 = (String)var1.next(); -+ -+ for (int var3 = 0; var3 < var2.length(); ++var3) { -+ if (var2.charAt(var3) >= 256) { -+ this.field_135029_d = true; -+ break; - } - } -- -- return; - } - } - -- private void loadLocaleData(List var1) throws IOException { -- Iterator var2 = var1.iterator(); -+ /** -+ * par1 is a list of Resources -+ */ -+ private void loadLocaleData(List par1List) throws IOException { -+ Iterator var2 = par1List.iterator(); - -- while(var2.hasNext()) { -+ while (var2.hasNext()) { - Resource var3 = (Resource)var2.next(); - this.loadLocaleData(var3.getInputStream()); - } -- - } - -- private void loadLocaleData(InputStream var1) throws IOException { -- Iterator var2 = IOUtils.readLines(var1, Charsets.UTF_8).iterator(); -+ private void loadLocaleData(InputStream par1InputStream) throws IOException { -+ Iterator var2 = IOUtils.readLines(par1InputStream, Charsets.UTF_8).iterator(); - -- while(var2.hasNext()) { -+ while (var2.hasNext()) { - String var3 = (String)var2.next(); -- if(!var3.isEmpty() && var3.charAt(0) != 35) { -- String[] var4 = (String[])Iterables.toArray(b.split(var3), String.class); -- if(var4 != null && var4.length == 2) { -+ -+ if (!var3.isEmpty() && var3.charAt(0) != 35) { -+ String[] var4 = (String[])Iterables.toArray(splitter.split(var3), String.class); -+ -+ if (var4 != null && var4.length == 2) { - String var5 = var4[0]; -- String var6 = c.matcher(var4[1]).replaceAll("%$1s"); -- this.a.put(var5, var6); -+ String var6 = field_135031_c.matcher(var4[1]).replaceAll("%$1s"); -+ this.field_135032_a.put(var5, var6); - } - } - } -- -- } -- -- private String translateKeyPrivate(String var1) { -- String var2 = (String)this.a.get(var1); -- return var2 == null ? var1 : var2; -- } -- -- public String translateKey(String var1) { -- return this.translateKeyPrivate(var1); -- } -- -- public String formatMessage(String var1, Object[] var2) { -- String var3 = this.translateKeyPrivate(var1); -+ } -+ -+ /** -+ * Returns the translation, or the key itself if the key could not be translated. -+ */ -+ private String translateKeyPrivate(String par1Str) { -+ String var2 = (String)this.field_135032_a.get(par1Str); -+ return var2 == null ? par1Str : var2; -+ } -+ -+ /** -+ * Returns the translation, or the key itself if the key could not be translated. -+ */ -+ public String translateKey(String par1Str) { -+ return this.translateKeyPrivate(par1Str); -+ } -+ -+ /** -+ * Calls String.format(translateKey(key), params) -+ */ -+ public String formatMessage(String par1Str, Object[] par2ArrayOfObj) { -+ String var3 = this.translateKeyPrivate(par1Str); - - try { -- return String.format(var3, var2); -+ return String.format(var3, par2ArrayOfObj); - } catch (IllegalFormatException var5) { - return "Format error: " + var3; - } ---- net/minecraft/src/Packet34EntityTeleport.java -+++ net/minecraft/src/Packet34EntityTeleport.java -@@ -5,66 +5,96 @@ - import java.io.IOException; - - public class Packet34EntityTeleport extends Packet { -+ -+ /** ID of the entity. */ - public int entityId; -+ -+ /** X position of the entity. */ - public int xPosition; -+ -+ /** Y position of the entity. */ - public int yPosition; -+ -+ /** Z position of the entity. */ - public int zPosition; -+ -+ /** Yaw of the entity. */ - public byte yaw; -+ -+ /** Pitch of the entity. */ - public byte pitch; - -- public Packet34EntityTeleport() { -- } -- -- public Packet34EntityTeleport(Entity var1) { -- this.entityId = var1.entityId; -- this.xPosition = MathHelper.floor_double(var1.posX * 32.0D); -- this.yPosition = MathHelper.floor_double(var1.posY * 32.0D); -- this.zPosition = MathHelper.floor_double(var1.posZ * 32.0D); -- this.yaw = (byte)((int)(var1.rotationYaw * 256.0F / 360.0F)); -- this.pitch = (byte)((int)(var1.rotationPitch * 256.0F / 360.0F)); -- } -- -- public Packet34EntityTeleport(int var1, int var2, int var3, int var4, byte var5, byte var6) { -- this.entityId = var1; -- this.xPosition = var2; -- this.yPosition = var3; -- this.zPosition = var4; -- this.yaw = var5; -- this.pitch = var6; -- } -- -- public void readPacketData(DataInput var1) throws IOException { -- this.entityId = var1.readInt(); -- this.xPosition = var1.readInt(); -- this.yPosition = var1.readInt(); -- this.zPosition = var1.readInt(); -- this.yaw = var1.readByte(); -- this.pitch = var1.readByte(); -- } -- -- public void writePacketData(DataOutput var1) throws IOException { -- var1.writeInt(this.entityId); -- var1.writeInt(this.xPosition); -- var1.writeInt(this.yPosition); -- var1.writeInt(this.zPosition); -- var1.write(this.yaw); -- var1.write(this.pitch); -- } -- -- public void processPacket(NetHandler var1) { -- var1.handleEntityTeleport(this); -- } -- -+ public Packet34EntityTeleport() {} -+ -+ public Packet34EntityTeleport(Entity par1Entity) { -+ this.entityId = par1Entity.entityId; -+ this.xPosition = MathHelper.floor_double(par1Entity.posX * 32.0D); -+ this.yPosition = MathHelper.floor_double(par1Entity.posY * 32.0D); -+ this.zPosition = MathHelper.floor_double(par1Entity.posZ * 32.0D); -+ this.yaw = (byte)((int)(par1Entity.rotationYaw * 256.0F / 360.0F)); -+ this.pitch = (byte)((int)(par1Entity.rotationPitch * 256.0F / 360.0F)); -+ } -+ -+ public Packet34EntityTeleport(int par1, int par2, int par3, int par4, byte par5, byte par6) { -+ this.entityId = par1; -+ this.xPosition = par2; -+ this.yPosition = par3; -+ this.zPosition = par4; -+ this.yaw = par5; -+ this.pitch = par6; -+ } -+ -+ /** -+ * Abstract. Reads the raw packet data from the data stream. -+ */ -+ public void readPacketData(DataInput par1DataInput) throws IOException { -+ this.entityId = par1DataInput.readInt(); -+ this.xPosition = par1DataInput.readInt(); -+ this.yPosition = par1DataInput.readInt(); -+ this.zPosition = par1DataInput.readInt(); -+ this.yaw = par1DataInput.readByte(); -+ this.pitch = par1DataInput.readByte(); -+ } -+ -+ /** -+ * Abstract. Writes the raw packet data to the data stream. -+ */ -+ public void writePacketData(DataOutput par1DataOutput) throws IOException { -+ par1DataOutput.writeInt(this.entityId); -+ par1DataOutput.writeInt(this.xPosition); -+ par1DataOutput.writeInt(this.yPosition); -+ par1DataOutput.writeInt(this.zPosition); -+ par1DataOutput.write(this.yaw); -+ par1DataOutput.write(this.pitch); -+ } -+ -+ /** -+ * Passes this Packet on to the NetHandler for processing. -+ */ -+ public void processPacket(NetHandler par1NetHandler) { -+ par1NetHandler.handleEntityTeleport(this); -+ } -+ -+ /** -+ * Abstract. Return the size of the packet (not counting the header). -+ */ - public int getPacketSize() { - return 34; - } - -+ /** -+ * only false for the abstract Packet class, all real packets return true -+ */ - public boolean isRealPacket() { - return true; - } - -- public boolean containsSameEntityIDAs(Packet var1) { -- Packet34EntityTeleport var2 = (Packet34EntityTeleport)var1; -+ /** -+ * eg return packet30entity.entityId == entityId; WARNING : will throw if you compare a packet to a different packet -+ * class -+ */ -+ public boolean containsSameEntityIDAs(Packet par1Packet) { -+ Packet34EntityTeleport var2 = (Packet34EntityTeleport)par1Packet; - return var2.entityId == this.entityId; - } - } ---- /dev/null -+++ org/spoutcraft/api/player/RenderDistance.java -@@ -1,0 +1,50 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.api.player; -+ -+public enum RenderDistance { -+ FAR(0), -+ NORMAL(1), -+ SHORT(2), -+ TINY(3); -+ -+ private final int value; -+ -+ RenderDistance(final int i) { -+ value = i; -+ } -+ -+ public final int getValue() { -+ return value; -+ } -+ -+ public String toString() { -+ return name().charAt(0) + name().substring(1).toLowerCase(); -+ } -+ -+ public static RenderDistance getRenderDistanceFromValue(int value) { -+ for (RenderDistance rd : values()) { -+ if (rd.getValue() == value) { -+ return rd; -+ } -+ } -+ return null; -+ } -+} ---- /dev/null -+++ org/spoutcraft/api/gui/CheckBox.java -@@ -1,0 +1,38 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.api.gui; -+ -+import org.spoutcraft.api.UnsafeClass; -+ -+@UnsafeClass -+public interface CheckBox extends Button { -+ /** -+ * Is true if the checkbox is checked -+ * @return checked -+ */ -+ public boolean isChecked(); -+ -+ /** -+ * Sets the checked state of the checkbox -+ * @param checked -+ * @return this -+ */ -+ public CheckBox setChecked(boolean checked); -+} ---- /dev/null -+++ com/prupe/mcpatcher/ctm/CTMUtils$2.java -@@ -1,0 +1,31 @@ -+package com.prupe.mcpatcher.ctm; -+ -+import com.prupe.mcpatcher.ctm.CTMUtils$TileOverrideIterator; -+import net.minecraft.src.Block; -+import net.minecraft.src.IBlockAccess; -+import net.minecraft.src.Icon; -+ -+final class CTMUtils$2 extends CTMUtils$TileOverrideIterator { -+ final IBlockAccess val$blockAccess; -+ -+ final int val$i; -+ -+ final int val$j; -+ -+ final int val$k; -+ -+ final int val$face; -+ -+ CTMUtils$2(Block x0, Icon x1, IBlockAccess var3, int var4, int var5, int var6, int var7) { -+ super(x0, x1); -+ this.val$blockAccess = var3; -+ this.val$i = var4; -+ this.val$j = var5; -+ this.val$k = var6; -+ this.val$face = var7; -+ } -+ -+ Icon getTile(ITileOverride override, Block block, Icon currentIcon) { -+ return override.getTile(this.val$blockAccess, block, currentIcon, this.val$i, this.val$j, this.val$k, this.val$face); -+ } -+} ---- net/minecraft/src/BlockFlowerPot.java -+++ net/minecraft/src/BlockFlowerPot.java -@@ -3,41 +3,60 @@ - import java.util.Random; - - public class BlockFlowerPot extends Block { -- public BlockFlowerPot(int var1) { -- super(var1, Material.circuits); -+ public BlockFlowerPot(int par1) { -+ super(par1, Material.circuits); - this.setBlockBoundsForItemRender(); - } - -+ /** -+ * Sets the block's bounds for rendering it as an item -+ */ - public void setBlockBoundsForItemRender() { -- float var1 = 6.0F / 16.0F; -+ float var1 = 0.375F; - float var2 = var1 / 2.0F; - this.setBlockBounds(0.5F - var2, 0.0F, 0.5F - var2, 0.5F + var2, var1, 0.5F + var2); - } - -+ /** -+ * Is this block (a) opaque and (b) a full 1m cube? This determines whether or not to render the shared face of two -+ * adjacent blocks and also whether the player can attach torches, redstone wire, etc to this block. -+ */ - public boolean isOpaqueCube() { - return false; - } - -+ /** -+ * The type of render function that is called for this block -+ */ - public int getRenderType() { - return 33; - } - -+ /** -+ * If this block doesn't render as an ordinary block it will return False (examples: signs, buttons, stairs, etc) -+ */ - public boolean renderAsNormalBlock() { - return false; - } - -- public boolean onBlockActivated(World var1, int var2, int var3, int var4, EntityPlayer var5, int var6, float var7, float var8, float var9) { -- ItemStack var10 = var5.inventory.getCurrentItem(); -- if(var10 == null) { -+ /** -+ * Called upon block activation (right click on the block.) -+ */ -+ public boolean onBlockActivated(World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer, int par6, float par7, float par8, float par9) { -+ ItemStack var10 = par5EntityPlayer.inventory.getCurrentItem(); -+ -+ if (var10 == null) { - return false; -- } else if(var1.getBlockMetadata(var2, var3, var4) != 0) { -+ } else if (par1World.getBlockMetadata(par2, par3, par4) != 0) { - return false; - } else { - int var11 = getMetaForPlant(var10); -- if(var11 > 0) { -- var1.setBlockMetadata(var2, var3, var4, var11, 2); -- if(!var5.capabilities.isCreativeMode && --var10.stackSize <= 0) { -- var5.inventory.setInventorySlotContents(var5.inventory.currentItem, (ItemStack)null); -+ -+ if (var11 > 0) { -+ par1World.setBlockMetadataWithNotify(par2, par3, par4, var11, 2); -+ -+ if (!par5EntityPlayer.capabilities.isCreativeMode && --var10.stackSize <= 0) { -+ par5EntityPlayer.inventory.setInventorySlotContents(par5EntityPlayer.inventory.currentItem, (ItemStack)null); - } - - return true; -@@ -47,108 +66,151 @@ - } - } - -- public int idPicked(World var1, int var2, int var3, int var4) { -- ItemStack var5 = getPlantForMeta(var1.getBlockMetadata(var2, var3, var4)); -+ /** -+ * only called by clickMiddleMouseButton , and passed to inventory.setCurrentItem (along with isCreative) -+ */ -+ public int idPicked(World par1World, int par2, int par3, int par4) { -+ ItemStack var5 = getPlantForMeta(par1World.getBlockMetadata(par2, par3, par4)); - return var5 == null ? Item.flowerPot.itemID : var5.itemID; - } - -- public int getDamageValue(World var1, int var2, int var3, int var4) { -- ItemStack var5 = getPlantForMeta(var1.getBlockMetadata(var2, var3, var4)); -+ /** -+ * Get the block's damage value (for use with pick block). -+ */ -+ public int getDamageValue(World par1World, int par2, int par3, int par4) { -+ ItemStack var5 = getPlantForMeta(par1World.getBlockMetadata(par2, par3, par4)); - return var5 == null ? Item.flowerPot.itemID : var5.getItemDamage(); - } - -+ /** -+ * Returns true only if block is flowerPot -+ */ - public boolean isFlowerPot() { - return true; - } - -- public boolean canPlaceBlockAt(World var1, int var2, int var3, int var4) { -- return super.canPlaceBlockAt(var1, var2, var3, var4) && var1.doesBlockHaveSolidTopSurface(var2, var3 - 1, var4); -+ /** -+ * Checks to see if its valid to put this block at the specified coordinates. Args: world, x, y, z -+ */ -+ public boolean canPlaceBlockAt(World par1World, int par2, int par3, int par4) { -+ return super.canPlaceBlockAt(par1World, par2, par3, par4) && par1World.doesBlockHaveSolidTopSurface(par2, par3 - 1, par4); - } - -- public void onNeighborBlockChange(World var1, int var2, int var3, int var4, int var5) { -- if(!var1.doesBlockHaveSolidTopSurface(var2, var3 - 1, var4)) { -- this.dropBlockAsItem(var1, var2, var3, var4, var1.getBlockMetadata(var2, var3, var4), 0); -- var1.setBlockToAir(var2, var3, var4); -+ /** -+ * Lets the block know when one of its neighbor changes. Doesn't know which neighbor changed (coordinates passed are -+ * their own) Args: x, y, z, neighbor blockID -+ */ -+ public void onNeighborBlockChange(World par1World, int par2, int par3, int par4, int par5) { -+ if (!par1World.doesBlockHaveSolidTopSurface(par2, par3 - 1, par4)) { -+ this.dropBlockAsItem(par1World, par2, par3, par4, par1World.getBlockMetadata(par2, par3, par4), 0); -+ par1World.setBlockToAir(par2, par3, par4); - } -- - } - -- public void dropBlockAsItemWithChance(World var1, int var2, int var3, int var4, int var5, float var6, int var7) { -- super.dropBlockAsItemWithChance(var1, var2, var3, var4, var5, var6, var7); -- if(var5 > 0) { -- ItemStack var8 = getPlantForMeta(var5); -- if(var8 != null) { -- this.dropBlockAsItem_do(var1, var2, var3, var4, var8); -+ /** -+ * Drops the block items with a specified chance of dropping the specified items -+ */ -+ public void dropBlockAsItemWithChance(World par1World, int par2, int par3, int par4, int par5, float par6, int par7) { -+ super.dropBlockAsItemWithChance(par1World, par2, par3, par4, par5, par6, par7); -+ -+ if (par5 > 0) { -+ ItemStack var8 = getPlantForMeta(par5); -+ -+ if (var8 != null) { -+ this.dropBlockAsItem_do(par1World, par2, par3, par4, var8); - } - } -- - } - -- public int idDropped(int var1, Random var2, int var3) { -+ /** -+ * Returns the ID of the items to drop on destruction. -+ */ -+ public int idDropped(int par1, Random par2Random, int par3) { - return Item.flowerPot.itemID; - } - -- public static ItemStack getPlantForMeta(int var0) { -- switch(var0) { -- case 1: -- return new ItemStack(Block.plantRed); -- case 2: -- return new ItemStack(Block.plantYellow); -- case 3: -- return new ItemStack(Block.sapling, 1, 0); -- case 4: -- return new ItemStack(Block.sapling, 1, 1); -- case 5: -- return new ItemStack(Block.sapling, 1, 2); -- case 6: -- return new ItemStack(Block.sapling, 1, 3); -- case 7: -- return new ItemStack(Block.mushroomRed); -- case 8: -- return new ItemStack(Block.mushroomBrown); -- case 9: -- return new ItemStack(Block.cactus); -- case 10: -- return new ItemStack(Block.deadBush); -- case 11: -- return new ItemStack(Block.tallGrass, 1, 2); -- default: -- return null; -+ /** -+ * Return the item associated with the specified flower pot metadata value. -+ */ -+ public static ItemStack getPlantForMeta(int par0) { -+ switch (par0) { -+ case 1: -+ return new ItemStack(Block.plantRed); -+ -+ case 2: -+ return new ItemStack(Block.plantYellow); -+ -+ case 3: -+ return new ItemStack(Block.sapling, 1, 0); -+ -+ case 4: -+ return new ItemStack(Block.sapling, 1, 1); -+ -+ case 5: -+ return new ItemStack(Block.sapling, 1, 2); -+ -+ case 6: -+ return new ItemStack(Block.sapling, 1, 3); -+ -+ case 7: -+ return new ItemStack(Block.mushroomRed); -+ -+ case 8: -+ return new ItemStack(Block.mushroomBrown); -+ -+ case 9: -+ return new ItemStack(Block.cactus); -+ -+ case 10: -+ return new ItemStack(Block.deadBush); -+ -+ case 11: -+ return new ItemStack(Block.tallGrass, 1, 2); -+ -+ default: -+ return null; - } - } - -- public static int getMetaForPlant(ItemStack var0) { -- int var1 = var0.getItem().itemID; -- if(var1 == Block.plantRed.blockID) { -+ /** -+ * Return the flower pot metadata value associated with the specified item. -+ */ -+ public static int getMetaForPlant(ItemStack par0ItemStack) { -+ int var1 = par0ItemStack.getItem().itemID; -+ -+ if (var1 == Block.plantRed.blockID) { - return 1; -- } else if(var1 == Block.plantYellow.blockID) { -+ } else if (var1 == Block.plantYellow.blockID) { - return 2; -- } else if(var1 == Block.cactus.blockID) { -+ } else if (var1 == Block.cactus.blockID) { - return 9; -- } else if(var1 == Block.mushroomBrown.blockID) { -+ } else if (var1 == Block.mushroomBrown.blockID) { - return 8; -- } else if(var1 == Block.mushroomRed.blockID) { -+ } else if (var1 == Block.mushroomRed.blockID) { - return 7; -- } else if(var1 == Block.deadBush.blockID) { -+ } else if (var1 == Block.deadBush.blockID) { - return 10; - } else { -- if(var1 == Block.sapling.blockID) { -- switch(var0.getItemDamage()) { -- case 0: -- return 3; -- case 1: -- return 4; -- case 2: -- return 5; -- case 3: -- return 6; -+ if (var1 == Block.sapling.blockID) { -+ switch (par0ItemStack.getItemDamage()) { -+ case 0: -+ return 3; -+ -+ case 1: -+ return 4; -+ -+ case 2: -+ return 5; -+ -+ case 3: -+ return 6; - } - } - -- if(var1 == Block.tallGrass.blockID) { -- switch(var0.getItemDamage()) { -- case 2: -- return 11; -+ if (var1 == Block.tallGrass.blockID) { -+ switch (par0ItemStack.getItemDamage()) { -+ case 2: -+ return 11; - } - } - ---- /dev/null -+++ org/spoutcraft/api/property/PropertyInterface.java -@@ -1,0 +1,28 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.api.property; -+ -+public interface PropertyInterface { -+ public Object getProperty(String name); -+ -+ public void setProperty(String name, Object value); -+ -+ public Property getPropertyDelegate(String name); -+} ---- net/minecraft/src/StructureScatteredFeatureStones.java -+++ net/minecraft/src/StructureScatteredFeatureStones.java -@@ -3,19 +3,20 @@ - import java.util.Random; - - class StructureScatteredFeatureStones extends StructurePieceBlockSelector { -- private StructureScatteredFeatureStones() { -- } -+ private StructureScatteredFeatureStones() {} - -- public void selectBlocks(Random var1, int var2, int var3, int var4, boolean var5) { -- if(var1.nextFloat() < 0.4F) { -+ /** -+ * picks Block Ids and Metadata (Silverfish) -+ */ -+ public void selectBlocks(Random par1Random, int par2, int par3, int par4, boolean par5) { -+ if (par1Random.nextFloat() < 0.4F) { - this.selectedBlockId = Block.cobblestone.blockID; - } else { - this.selectedBlockId = Block.cobblestoneMossy.blockID; - } -- - } - -- StructureScatteredFeatureStones(ComponentScatteredFeaturePieces2 var1) { -+ StructureScatteredFeatureStones(ComponentScatteredFeaturePieces2 par1ComponentScatteredFeaturePieces2) { - this(); - } - } ---- net/minecraft/src/ModelQuadruped.java -+++ net/minecraft/src/ModelQuadruped.java -@@ -12,62 +12,70 @@ - protected float field_78145_g = 8.0F; - protected float field_78151_h = 4.0F; - -- public ModelQuadruped(int var1, float var2) { -- this.head.addBox(-4.0F, -4.0F, -8.0F, 8, 8, 8, var2); -- this.head.setRotationPoint(0.0F, (float)(18 - var1), -6.0F); -+ public ModelQuadruped(int par1, float par2) { -+ this.head.addBox(-4.0F, -4.0F, -8.0F, 8, 8, 8, par2); -+ this.head.setRotationPoint(0.0F, (float)(18 - par1), -6.0F); - this.body = new ModelRenderer(this, 28, 8); -- this.body.addBox(-5.0F, -10.0F, -7.0F, 10, 16, 8, var2); -- this.body.setRotationPoint(0.0F, (float)(17 - var1), 2.0F); -+ this.body.addBox(-5.0F, -10.0F, -7.0F, 10, 16, 8, par2); -+ this.body.setRotationPoint(0.0F, (float)(17 - par1), 2.0F); - this.leg1 = new ModelRenderer(this, 0, 16); -- this.leg1.addBox(-2.0F, 0.0F, -2.0F, 4, var1, 4, var2); -- this.leg1.setRotationPoint(-3.0F, (float)(24 - var1), 7.0F); -+ this.leg1.addBox(-2.0F, 0.0F, -2.0F, 4, par1, 4, par2); -+ this.leg1.setRotationPoint(-3.0F, (float)(24 - par1), 7.0F); - this.leg2 = new ModelRenderer(this, 0, 16); -- this.leg2.addBox(-2.0F, 0.0F, -2.0F, 4, var1, 4, var2); -- this.leg2.setRotationPoint(3.0F, (float)(24 - var1), 7.0F); -+ this.leg2.addBox(-2.0F, 0.0F, -2.0F, 4, par1, 4, par2); -+ this.leg2.setRotationPoint(3.0F, (float)(24 - par1), 7.0F); - this.leg3 = new ModelRenderer(this, 0, 16); -- this.leg3.addBox(-2.0F, 0.0F, -2.0F, 4, var1, 4, var2); -- this.leg3.setRotationPoint(-3.0F, (float)(24 - var1), -5.0F); -+ this.leg3.addBox(-2.0F, 0.0F, -2.0F, 4, par1, 4, par2); -+ this.leg3.setRotationPoint(-3.0F, (float)(24 - par1), -5.0F); - this.leg4 = new ModelRenderer(this, 0, 16); -- this.leg4.addBox(-2.0F, 0.0F, -2.0F, 4, var1, 4, var2); -- this.leg4.setRotationPoint(3.0F, (float)(24 - var1), -5.0F); -+ this.leg4.addBox(-2.0F, 0.0F, -2.0F, 4, par1, 4, par2); -+ this.leg4.setRotationPoint(3.0F, (float)(24 - par1), -5.0F); - } - -- public void render(Entity var1, float var2, float var3, float var4, float var5, float var6, float var7) { -- this.setRotationAngles(var2, var3, var4, var5, var6, var7, var1); -- if(this.isChild) { -+ /** -+ * Sets the models various rotation angles then renders the model. -+ */ -+ public void render(Entity par1Entity, float par2, float par3, float par4, float par5, float par6, float par7) { -+ this.setRotationAngles(par2, par3, par4, par5, par6, par7, par1Entity); -+ -+ if (this.isChild) { - float var8 = 2.0F; - GL11.glPushMatrix(); -- GL11.glTranslatef(0.0F, this.field_78145_g * var7, this.field_78151_h * var7); -- this.head.render(var7); -+ GL11.glTranslatef(0.0F, this.field_78145_g * par7, this.field_78151_h * par7); -+ this.head.render(par7); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glScalef(1.0F / var8, 1.0F / var8, 1.0F / var8); -- GL11.glTranslatef(0.0F, 24.0F * var7, 0.0F); -- this.body.render(var7); -- this.leg1.render(var7); -- this.leg2.render(var7); -- this.leg3.render(var7); -- this.leg4.render(var7); -+ GL11.glTranslatef(0.0F, 24.0F * par7, 0.0F); -+ this.body.render(par7); -+ this.leg1.render(par7); -+ this.leg2.render(par7); -+ this.leg3.render(par7); -+ this.leg4.render(par7); - GL11.glPopMatrix(); - } else { -- this.head.render(var7); -- this.body.render(var7); -- this.leg1.render(var7); -- this.leg2.render(var7); -- this.leg3.render(var7); -- this.leg4.render(var7); -+ this.head.render(par7); -+ this.body.render(par7); -+ this.leg1.render(par7); -+ this.leg2.render(par7); -+ this.leg3.render(par7); -+ this.leg4.render(par7); - } -- - } - -- public void setRotationAngles(float var1, float var2, float var3, float var4, float var5, float var6, Entity var7) { -- float var8 = 180.0F / (float)Math.PI; -- this.head.rotateAngleX = var5 / (180.0F / (float)Math.PI); -- this.head.rotateAngleY = var4 / (180.0F / (float)Math.PI); -- this.body.rotateAngleX = (float)Math.PI * 0.5F; -- this.leg1.rotateAngleX = MathHelper.cos(var1 * 0.6662F) * 1.4F * var2; -- this.leg2.rotateAngleX = MathHelper.cos(var1 * 0.6662F + (float)Math.PI) * 1.4F * var2; -- this.leg3.rotateAngleX = MathHelper.cos(var1 * 0.6662F + (float)Math.PI) * 1.4F * var2; -- this.leg4.rotateAngleX = MathHelper.cos(var1 * 0.6662F) * 1.4F * var2; -+ /** -+ * Sets the model's various rotation angles. For bipeds, par1 and par2 are used for animating the movement of arms and -+ * legs, where par1 represents the time(so that arms and legs swing back and forth) and par2 represents how "far" arms -+ * and legs can swing at most. -+ */ -+ public void setRotationAngles(float par1, float par2, float par3, float par4, float par5, float par6, Entity par7Entity) { -+ float var8 = (180F / (float)Math.PI); -+ this.head.rotateAngleX = par5 / (180F / (float)Math.PI); -+ this.head.rotateAngleY = par4 / (180F / (float)Math.PI); -+ this.body.rotateAngleX = ((float)Math.PI / 2F); -+ this.leg1.rotateAngleX = MathHelper.cos(par1 * 0.6662F) * 1.4F * par2; -+ this.leg2.rotateAngleX = MathHelper.cos(par1 * 0.6662F + (float)Math.PI) * 1.4F * par2; -+ this.leg3.rotateAngleX = MathHelper.cos(par1 * 0.6662F + (float)Math.PI) * 1.4F * par2; -+ this.leg4.rotateAngleX = MathHelper.cos(par1 * 0.6662F) * 1.4F * par2; - } - } ---- net/minecraft/src/BlockStoneBrick.java -+++ net/minecraft/src/BlockStoneBrick.java -@@ -3,45 +3,57 @@ - import java.util.List; - - public class BlockStoneBrick extends Block { -- public static final String[] a = new String[]{"default", "mossy", "cracked", "chiseled"}; -- public static final String[] b = new String[]{null, "mossy", "cracked", "carved"}; -+ public static final String[] STONE_BRICK_TYPES = new String[] {"default", "mossy", "cracked", "chiseled"}; -+ public static final String[] field_94407_b = new String[] {null, "mossy", "cracked", "carved"}; - private Icon[] field_94408_c; - -- public BlockStoneBrick(int var1) { -- super(var1, Material.rock); -+ public BlockStoneBrick(int par1) { -+ super(par1, Material.rock); - this.setCreativeTab(CreativeTabs.tabBlock); - } - -- public Icon getIcon(int var1, int var2) { -- if(var2 < 0 || var2 >= b.length) { -- var2 = 0; -- } -- -- return this.field_94408_c[var2]; -- } -- -- public int damageDropped(int var1) { -- return var1; -- } -- -- public void getSubBlocks(int var1, CreativeTabs var2, List var3) { -- for(int var4 = 0; var4 < 4; ++var4) { -- var3.add(new ItemStack(var1, 1, var4)); -- } -- -- } -- -- public void registerIcons(IconRegister var1) { -- this.field_94408_c = new Icon[b.length]; -- -- for(int var2 = 0; var2 < this.field_94408_c.length; ++var2) { -+ /** -+ * From the specified side and block metadata retrieves the blocks texture. Args: side, metadata -+ */ -+ public Icon getIcon(int par1, int par2) { -+ if (par2 < 0 || par2 >= field_94407_b.length) { -+ par2 = 0; -+ } -+ -+ return this.field_94408_c[par2]; -+ } -+ -+ /** -+ * Determines the damage on the item the block drops. Used in cloth and wood. -+ */ -+ public int damageDropped(int par1) { -+ return par1; -+ } -+ -+ /** -+ * returns a list of blocks with the same ID, but different meta (eg: wood returns 4 blocks) -+ */ -+ public void getSubBlocks(int par1, CreativeTabs par2CreativeTabs, List par3List) { -+ for (int var4 = 0; var4 < 4; ++var4) { -+ par3List.add(new ItemStack(par1, 1, var4)); -+ } -+ } -+ -+ /** -+ * When this method is called, your block should register all the icons it needs with the given IconRegister. This is -+ * the only chance you get to register icons. -+ */ -+ public void registerIcons(IconRegister par1IconRegister) { -+ this.field_94408_c = new Icon[field_94407_b.length]; -+ -+ for (int var2 = 0; var2 < this.field_94408_c.length; ++var2) { - String var3 = this.getTextureName(); -- if(b[var2] != null) { -- var3 = var3 + "_" + b[var2]; -+ -+ if (field_94407_b[var2] != null) { -+ var3 = var3 + "_" + field_94407_b[var2]; - } - -- this.field_94408_c[var2] = var1.registerIcon(var3); -+ this.field_94408_c[var2] = par1IconRegister.registerIcon(var3); - } -- - } - } ---- /dev/null -+++ org/spoutcraft/api/material/item/GenericCustomFood.java -@@ -1,0 +1,53 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.api.material.item; -+ -+import java.io.IOException; -+ -+import org.spoutcraft.api.io.SpoutInputStream; -+import org.spoutcraft.api.io.SpoutOutputStream; -+import org.spoutcraft.api.material.Food; -+ -+public class GenericCustomFood extends GenericCustomItem implements Food{ -+ private int hunger; -+ public GenericCustomFood(String addon, String name, String texture, int hungerRestored) { -+ super(addon, name, texture); -+ hunger = hungerRestored; -+ } -+ -+ public GenericCustomFood() { -+ } -+ -+ public int getHungerRestored() { -+ return hunger; -+ } -+ -+ @Override -+ public void readData(SpoutInputStream input) throws IOException { -+ super.readData(input); -+ hunger = input.read(); -+ } -+ -+ @Override -+ public void writeData(SpoutOutputStream output) throws IOException { -+ super.writeData(output); -+ output.write(getHungerRestored()); -+ } -+} ---- net/minecraft/src/EntityWitherSkull.java -+++ net/minecraft/src/EntityWitherSkull.java -@@ -1,61 +1,76 @@ - package net.minecraft.src; - - public class EntityWitherSkull extends EntityFireball { -- public EntityWitherSkull(World var1) { -- super(var1); -- this.setSize(5.0F / 16.0F, 5.0F / 16.0F); -- } -- -- public EntityWitherSkull(World var1, EntityLivingBase var2, double var3, double var5, double var7) { -- super(var1, var2, var3, var5, var7); -- this.setSize(5.0F / 16.0F, 5.0F / 16.0F); -- } -- -+ public EntityWitherSkull(World par1World) { -+ super(par1World); -+ this.setSize(0.3125F, 0.3125F); -+ } -+ -+ public EntityWitherSkull(World par1World, EntityLivingBase par2EntityLivingBase, double par3, double par5, double par7) { -+ super(par1World, par2EntityLivingBase, par3, par5, par7); -+ this.setSize(0.3125F, 0.3125F); -+ } -+ -+ /** -+ * Return the motion factor for this projectile. The factor is multiplied by the original motion. -+ */ - protected float getMotionFactor() { - return this.isInvulnerable() ? 0.73F : super.getMotionFactor(); - } - -- public EntityWitherSkull(World var1, double var2, double var4, double var6, double var8, double var10, double var12) { -- super(var1, var2, var4, var6, var8, var10, var12); -- this.setSize(5.0F / 16.0F, 5.0F / 16.0F); -+ public EntityWitherSkull(World par1World, double par2, double par4, double par6, double par8, double par10, double par12) { -+ super(par1World, par2, par4, par6, par8, par10, par12); -+ this.setSize(0.3125F, 0.3125F); - } - -+ /** -+ * Returns true if the entity is on fire. Used by render to add the fire effect on rendering. -+ */ - public boolean isBurning() { - return false; - } - -- public float getBlockExplosionResistance(Explosion var1, World var2, int var3, int var4, int var5, Block var6) { -- float var7 = super.getBlockExplosionResistance(var1, var2, var3, var4, var5, var6); -- if(this.isInvulnerable() && var6 != Block.bedrock && var6 != Block.endPortal && var6 != Block.endPortalFrame) { -+ /** -+ * Gets a block's resistance to this entity's explosion. Used to make rails immune to TNT minecarts' explosions and -+ * Wither skulls more destructive. -+ */ -+ public float getBlockExplosionResistance(Explosion par1Explosion, World par2World, int par3, int par4, int par5, Block par6Block) { -+ float var7 = super.getBlockExplosionResistance(par1Explosion, par2World, par3, par4, par5, par6Block); -+ -+ if (this.isInvulnerable() && par6Block != Block.bedrock && par6Block != Block.endPortal && par6Block != Block.endPortalFrame) { - var7 = Math.min(0.8F, var7); - } - - return var7; - } - -- protected void onImpact(MovingObjectPosition var1) { -- if(!this.worldObj.isRemote) { -- if(var1.entityHit != null) { -- if(this.shootingEntity != null) { -- if(var1.entityHit.attackEntityFrom(DamageSource.causeMobDamage(this.shootingEntity), 8.0F) && !var1.entityHit.isEntityAlive()) { -+ /** -+ * Called when this EntityFireball hits a block or entity. -+ */ -+ protected void onImpact(MovingObjectPosition par1MovingObjectPosition) { -+ if (!this.worldObj.isRemote) { -+ if (par1MovingObjectPosition.entityHit != null) { -+ if (this.shootingEntity != null) { -+ if (par1MovingObjectPosition.entityHit.attackEntityFrom(DamageSource.causeMobDamage(this.shootingEntity), 8.0F) && !par1MovingObjectPosition.entityHit.isEntityAlive()) { - this.shootingEntity.heal(5.0F); - } - } else { -- var1.entityHit.attackEntityFrom(DamageSource.magic, 5.0F); -+ par1MovingObjectPosition.entityHit.attackEntityFrom(DamageSource.magic, 5.0F); - } - -- if(var1.entityHit instanceof EntityLivingBase) { -+ if (par1MovingObjectPosition.entityHit instanceof EntityLivingBase) { - byte var2 = 0; -- if(this.worldObj.difficultySetting > 1) { -- if(this.worldObj.difficultySetting == 2) { -+ -+ if (this.worldObj.difficultySetting > 1) { -+ if (this.worldObj.difficultySetting == 2) { - var2 = 10; -- } else if(this.worldObj.difficultySetting == 3) { -+ } else if (this.worldObj.difficultySetting == 3) { - var2 = 40; - } - } - -- if(var2 > 0) { -- ((EntityLivingBase)var1.entityHit).addPotionEffect(new PotionEffect(Potion.wither.id, 20 * var2, 1)); -+ if (var2 > 0) { -+ ((EntityLivingBase)par1MovingObjectPosition.entityHit).addPotionEffect(new PotionEffect(Potion.wither.id, 20 * var2, 1)); - } - } - } -@@ -63,14 +78,19 @@ - this.worldObj.newExplosion(this, this.posX, this.posY, this.posZ, 1.0F, false, this.worldObj.getGameRules().getGameRuleBooleanValue("mobGriefing")); - this.setDead(); - } -- - } - -+ /** -+ * Returns true if other Entities should be prevented from moving through this Entity. -+ */ - public boolean canBeCollidedWith() { - return false; - } - -- public boolean attackEntityFrom(DamageSource var1, float var2) { -+ /** -+ * Called when the entity is attacked. -+ */ -+ public boolean attackEntityFrom(DamageSource par1DamageSource, float par2) { - return false; - } - -@@ -78,11 +98,17 @@ - this.dataWatcher.addObject(10, Byte.valueOf((byte)0)); - } - -+ /** -+ * Return whether this skull comes from an invulnerable (aura) wither boss. -+ */ - public boolean isInvulnerable() { - return this.dataWatcher.getWatchableObjectByte(10) == 1; - } - -- public void setInvulnerable(boolean var1) { -- this.dataWatcher.updateObject(10, Byte.valueOf((byte)(var1 ? 1 : 0))); -+ /** -+ * Set whether this skull comes from an invulnerable (aura) wither boss. -+ */ -+ public void setInvulnerable(boolean par1) { -+ this.dataWatcher.updateObject(10, Byte.valueOf((byte)(par1 ? 1 : 0))); - } - } ---- net/minecraft/src/RegionFileChunkBuffer.java -+++ net/minecraft/src/RegionFileChunkBuffer.java -@@ -6,13 +6,14 @@ - class RegionFileChunkBuffer extends ByteArrayOutputStream { - private int chunkX; - private int chunkZ; -+ - final RegionFile regionFile; - -- public RegionFileChunkBuffer(RegionFile var1, int var2, int var3) { -+ public RegionFileChunkBuffer(RegionFile par1RegionFile, int par2, int par3) { - super(8096); -- this.regionFile = var1; -- this.chunkX = var2; -- this.chunkZ = var3; -+ this.regionFile = par1RegionFile; -+ this.chunkX = par2; -+ this.chunkZ = par3; - } - - public void close() throws IOException { ---- net/minecraft/src/NumberInvalidException.java -+++ net/minecraft/src/NumberInvalidException.java -@@ -5,7 +5,7 @@ - this("commands.generic.num.invalid", new Object[0]); - } - -- public NumberInvalidException(String var1, Object... var2) { -- super(var1, var2); -+ public NumberInvalidException(String par1Str, Object ... par2ArrayOfObj) { -+ super(par1Str, par2ArrayOfObj); - } - } ---- /dev/null -+++ org/spoutcraft/client/gui/minimap/MapWidget.java -@@ -1,0 +1,478 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.client.gui.minimap; -+ -+import java.awt.image.BufferedImage; -+import java.awt.image.Raster; -+import java.io.File; -+import java.text.DateFormat; -+import java.text.SimpleDateFormat; -+import java.util.Date; -+import java.util.Random; -+import javax.imageio.ImageIO; -+ -+import gnu.trove.map.hash.TIntObjectHashMap; -+ -+import org.lwjgl.opengl.GL11; -+ -+import net.minecraft.src.Minecraft; -+import net.minecraft.src.GuiScreen; -+ -+import org.spoutcraft.api.Spoutcraft; -+import org.spoutcraft.api.animation.PropertyAnimation; -+import org.spoutcraft.api.gui.GenericScrollable; -+import org.spoutcraft.api.gui.MinecraftTessellator; -+import org.spoutcraft.api.gui.Orientation; -+import org.spoutcraft.api.gui.Point; -+import org.spoutcraft.api.gui.RenderUtil; -+import org.spoutcraft.api.gui.ScrollBarPolicy; -+import org.spoutcraft.api.gui.WidgetType; -+import org.spoutcraft.api.property.Property; -+import org.spoutcraft.api.util.map.TIntPairObjectHashMap; -+import org.spoutcraft.client.SpoutClient; -+import org.spoutcraft.client.chunkcache.HeightMap; -+ -+public class MapWidget extends GenericScrollable { -+ static TIntObjectHashMap> chunks = new TIntObjectHashMap>(250); -+ static int levelOfDetail = 1; -+ static final int MIN_LOD = 1; -+ static HeightMap heightMap; -+ static Map blankMap = new Map(1); // Singleton instance used to indicate no pixels to draw in a chunk -+ double scale = 1f; -+ boolean dirty = true; -+ GuiScreen parent = null; -+ BufferedImage imageBuffer = null; -+ -+ private static MapWidgetRenderer renderer = null; -+ -+ private Point lastPlayerPos = new Point((int) Minecraft.getMinecraft().thePlayer.posX, (int) Minecraft.getMinecraft().thePlayer.posZ); -+ private static Random random = new Random(); -+ -+ public MapWidget(GuiScreen parent) { -+ if (renderer == null) { -+ renderer = new MapWidgetRenderer(); -+ renderer.start(); -+ } -+ levelOfDetail = 1; -+ this.parent = parent; -+ HeightMap newheightMap = HeightMap.getHeightMap(MinimapUtils.getWorldName()); -+ if (newheightMap != heightMap) { -+ chunks.clear(); -+ heightMap = newheightMap; -+ } -+ -+ addProperty("scale", new Property() { -+ @Override -+ public void set(Object value) { -+ setScale((double)(Double) value); -+ } -+ -+ @Override -+ public Object get() { -+ return getScale(); -+ } -+ }); -+ -+ addProperty("scrollpos", new Property() { -+ @Override -+ public void set(Object value) { -+ Point p = (Point) value; -+ scrollTo(p, false, 0); -+ } -+ -+ @Override -+ public Object get() { -+ return mapOutsideToCoords(new Point(0,0)); -+ } -+ }); -+ -+ setScrollBarPolicy(Orientation.HORIZONTAL, ScrollBarPolicy.SHOW_NEVER); -+ setScrollBarPolicy(Orientation.VERTICAL, ScrollBarPolicy.SHOW_NEVER); -+ } -+ -+ private void updateLOD() { -+ int newlod = levelOfDetail; -+ newlod = (int) (1 / scale); -+ if (newlod < MIN_LOD) { -+ newlod = MIN_LOD; -+ } -+ if (newlod != levelOfDetail) { -+ renderer.renderQueue.clear(); -+ } -+ levelOfDetail = newlod; -+ } -+ -+ @Override -+ public int getInnerSize(Orientation axis) { -+ if (axis == Orientation.HORIZONTAL) { -+ return (int) ((double) (heightMap.getMaxX() - heightMap.getMinX() + 1) * scale * 16d); -+ } else { -+ return (int) ((double) (heightMap.getMaxZ() - heightMap.getMinZ() + 1) * scale * 16d) + 30; -+ } -+ } -+ -+ public static Map drawChunk(int x, int z, boolean force) { -+ synchronized(chunks) { -+ Map map = chunks.get(levelOfDetail).get(x, z); -+ if (map == null || (force && map == blankMap)) { -+ map = new Map(16); -+ map.originOffsetX = 0; -+ map.originOffsetY = 0; -+ map.renderSize = 16; -+ } else if (!force) { -+ return map; -+ } -+ boolean pixelSet = false; -+ try { -+ for (int cx = 0; cx < 16; cx++) { -+ for (int cz = 0; cz < 16; cz++) { -+ int aX = x * 16 + cx * levelOfDetail; -+ int aZ = z * 16 + cz * levelOfDetail; -+ -+ short height = heightMap.getHeight(aX, aZ); -+ int id = heightMap.getBlockId(aX, aZ); -+ byte data = heightMap.getData(aX, aZ); -+ if (id < 0) { -+ id = 256 + id; -+ } -+ if (id == -1 || height == -1) { -+ continue; -+ } else { -+ pixelSet = true; -+ } -+ -+ if (levelOfDetail <= 2) { -+ short reference = heightMap.getHeight(aX + levelOfDetail, aZ + levelOfDetail); -+ int color = MapCalculator.getHeightColor(height, reference); -+ map.heightimg.setARGB(cx, cz, color); -+ } -+ -+ map.setColorPixel(cz, cx, BlockColor.getBlockColor(id, data).color | 0xff000000); -+ } -+ } -+ } -+ catch (Exception e) { -+ pixelSet = false; -+ } -+ if (pixelSet) { -+ getChunkMap(levelOfDetail).put(x, z, map); -+ } else { -+ getChunkMap(levelOfDetail).put(x, z, blankMap); -+ } -+ return map; -+ } -+ } -+ -+ public static TIntPairObjectHashMap getChunkMap(int levelOfDetail) { -+ TIntPairObjectHashMap chunkmap = chunks.get(levelOfDetail); -+ if (chunkmap == null) { -+ chunkmap = new TIntPairObjectHashMap(500); -+ chunks.put(levelOfDetail, chunkmap); -+ } -+ return chunkmap; -+ } -+ -+ public Point mapOutsideToCoords(Point outside) { -+ int x = outside.getX() + scrollX; -+ int y = outside.getY() + scrollY; -+ x /= scale; -+ y /= scale; -+ x += heightMap.getMinX() * 16; -+ y += heightMap.getMinZ() * 16; -+ return new Point(x,y); -+ } -+ -+ public Point mapCoordsToOutside(Point coords) { -+ int x = coords.getX(); -+ int y = coords.getY(); -+ x -= heightMap.getMinX() * 16; -+ y -= heightMap.getMinZ() * 16; -+ x *= scale; -+ y *= scale; -+ return new Point(x, y); -+ } -+ -+ public void reset() { -+ setScale(1f, true, 500); -+ showPlayer(500); -+ } -+ -+ public void showPlayer(int duration) { -+ scrollTo(getPlayerPosition(), duration != 0, duration); -+ } -+ -+ public void scrollTo(Point p, boolean animated, int duration) { -+ scrollTo(p.getX(), p.getY(), animated, duration); -+ } -+ -+ public void scrollTo(Point p) { -+ scrollTo(p, false, 0); -+ } -+ -+ public void scrollTo(int x, int z) { -+ scrollTo(x,z, false, 0); -+ } -+ -+ public void scrollTo(int x, int z, boolean animated, int duration) { -+ if (!animated) { -+ Point p = mapCoordsToOutside(new Point(x,z)); -+ int scrollX = p.getX(), scrollZ = p.getY(); -+ setScrollPosition(Orientation.HORIZONTAL, scrollX - (int) (getWidth() / 2)); -+ setScrollPosition(Orientation.VERTICAL, scrollZ - (int) (getHeight() / 2)); -+ } else { -+ Point start = getCenterCoord(); -+ Point end = new Point(x, z); -+ PropertyAnimation ani = new PropertyAnimation(this, "scrollpos"); -+ ani.setStartValue(start); -+ ani.setEndValue(end); -+ ani.setDuration(duration); -+ ani.start(); -+ } -+ } -+ -+ public Point getCenterCoord() { -+ return mapOutsideToCoords(new Point((int) (getWidth() / 2), (int) (getHeight() / 2))); -+ } -+ -+ public BufferedImage renderFullImage() { -+ int scrollX = (int) (getScrollPosition(Orientation.HORIZONTAL) / scale); -+ int scrollY = (int) (getScrollPosition(Orientation.VERTICAL) / scale); -+ -+ int minChunkX = heightMap.getMinX() + scrollX / 16, -+ minChunkZ = heightMap.getMinZ() + scrollY / 16, -+ maxChunkX = 0, -+ maxChunkZ = 0; -+ int horiz = (int) (getWidth() / 16 / scale) + 1; -+ int vert = (int) (getHeight() / 16 / scale) + 1; -+ maxChunkX = minChunkX + horiz; -+ maxChunkZ = minChunkZ + vert; -+ -+ minChunkX++; -+ minChunkZ++; -+ BufferedImage fullImage = new BufferedImage((maxChunkX - minChunkX) * 16 + 32, (maxChunkZ - minChunkZ) * 16 + 32, BufferedImage.TYPE_INT_ARGB); -+ for (int chunkX = minChunkX; chunkX <= maxChunkX; chunkX++) { -+ for (int chunkZ = minChunkZ; chunkZ <= maxChunkZ; chunkZ++) { -+ Map map = drawChunk(chunkX, chunkZ, dirty); -+ if (map != null && map != blankMap) { -+ Raster raster = map.getColorRaster(); -+ int startX = (chunkX - minChunkX) * 16; -+ int startZ = (chunkZ - minChunkZ) * 16; -+ java.awt.image.DataBufferInt buf = (java.awt.image.DataBufferInt)raster.getDataBuffer(); -+ int[] srcbuf = buf.getData(); -+ fullImage.setRGB(startX, startZ, 16, 16, srcbuf, 0, 16); -+ } -+ } -+ } -+ return fullImage; -+ } -+ -+ public boolean saveToDesktop() { -+ try { -+ BufferedImage fullImage = renderFullImage(); -+ -+ // Creates a file named 'minimap 3-29-2012.png' in the desktop, if possible -+ // Otherwise saves to screenshots. Appends "(1)", etc as needed to avoid overwriting existing files -+ DateFormat df = new SimpleDateFormat("dd-MM-yyyy"); -+ String fileName = "minimap " + df.format(new Date()); -+ File desktop = new File(System.getProperty("user.home"), "Desktop"); -+ if (!desktop.exists()) { -+ desktop = new File(Minecraft.getMinecraft().mcDataDir, "screenshots"); -+ } -+ String fullFileName = fileName; -+ int duplicate = 0; -+ while (true) { -+ if (!fileExists(desktop, fullFileName, ".png")) { -+ break; -+ } -+ duplicate++; -+ fullFileName = fileName + " (" + duplicate + ")"; -+ } -+ ImageIO.write(fullImage, "png", new File(desktop, fullFileName + ".png")); -+ return true; -+ } -+ catch (Exception e) { -+ e.printStackTrace(); -+ } -+ return false; -+ } -+ -+ private boolean fileExists(File dir, String name, String ext) { -+ name += ext; -+ for (File f : dir.listFiles()) { -+ if (f.getName().equalsIgnoreCase(name)) { -+ return true; -+ } -+ } -+ return false; -+ } -+ -+ @Override -+ public void renderContents() { -+ GL11.glDisable(2929); -+ GL11.glEnable(3042); -+ GL11.glDepthMask(false); -+ GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); -+ -+ int scrollX = (int) (getScrollPosition(Orientation.HORIZONTAL) / scale); -+ int scrollY = (int) (getScrollPosition(Orientation.VERTICAL) / scale); -+ -+ GL11.glScaled(scale, scale, scale); -+ GL11.glTranslatef(-heightMap.getMinX() * 16, -heightMap.getMinZ() * 16, 0); -+ -+ int minChunkX = heightMap.getMinX() + scrollX / 16, -+ minChunkZ = heightMap.getMinZ() + scrollY / 16, -+ maxChunkX = 0, -+ maxChunkZ = 0; -+ int horiz = (int) (getWidth() / 16 / scale) + 1; -+ int vert = (int) (getHeight() / 16 / scale) + 1; -+ maxChunkX = minChunkX + horiz; -+ maxChunkZ = minChunkZ + vert; -+ -+ minChunkX = Math.max(minChunkX, heightMap.getMinX()); -+ minChunkZ = Math.max(minChunkZ, heightMap.getMinZ()); -+ maxChunkX = Math.min(maxChunkX, heightMap.getMaxX()); -+ maxChunkZ = Math.min(maxChunkZ, heightMap.getMaxZ()); -+ -+ GL11.glPushMatrix(); -+ synchronized(chunks) { -+ for (int chunkX = minChunkX; chunkX <= maxChunkX; chunkX+=levelOfDetail) { -+ for (int chunkZ = minChunkZ; chunkZ <= maxChunkZ; chunkZ+=levelOfDetail) { -+ Map map = getChunkMap(levelOfDetail).get(chunkX, chunkZ); -+ if (dirty || map == null || random .nextInt(10000) == 0) { -+ renderer.renderQueue.add(new Point(chunkX, chunkZ)); -+ } -+ if (map != null && map != blankMap) { -+ GL11.glPushMatrix(); -+ int x = chunkX * 16; -+ int y = chunkZ * 16; -+ int width = x + 16 * levelOfDetail; -+ int height = y + 16 * levelOfDetail; -+ map.loadColorImage(); -+ MinecraftTessellator tessellator = Spoutcraft.getTessellator(); -+ tessellator.startDrawingQuads(); -+ tessellator.addVertexWithUV((double) width, (double) height, -90, 1, 1); -+ tessellator.addVertexWithUV((double) width, (double) y, -90, 1, 0); -+ tessellator.addVertexWithUV((double) x, (double) y, -90, 0, 0); -+ tessellator.addVertexWithUV((double) x, (double) height, -90, 0, 1); -+ tessellator.draw(); -+ // GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); -+ // RenderUtil.drawRectangle(x, y, width, height, 0x88ffffff); -+ if (MinimapConfig.getInstance().isHeightmap()) { -+ GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_DST_COLOR); -+ map.loadHeightImage(); -+ tessellator.startDrawingQuads(); -+ tessellator.addVertexWithUV((double) width, (double) height, -90, 1, 1); -+ tessellator.addVertexWithUV((double) width, (double) y, -90, 1, 0); -+ tessellator.addVertexWithUV((double) x, (double) y, -90, 0, 0); -+ tessellator.addVertexWithUV((double) x, (double) height, -90, 0, 1); -+ tessellator.draw(); -+ } -+ GL11.glPopMatrix(); -+ } -+ } -+ } -+ } -+ int x = (int) SpoutClient.getHandle().thePlayer.posX; -+ int z = (int) SpoutClient.getHandle().thePlayer.posZ; -+ -+ drawPOI("You", x, z, 0xffff0000); -+ -+ for (Waypoint waypoint : MinimapConfig.getInstance().getAllWaypoints(MinimapUtils.getWorldName())) { -+ if (!waypoint.deathpoint || MinimapConfig.getInstance().isDeathpoints()) { -+ drawPOI(waypoint.name, waypoint.x, waypoint.z, 0xff00ff00); -+ } -+ } -+ -+ if (MinimapConfig.getInstance().getFocussedWaypoint() != null) { -+ Waypoint pos = MinimapConfig.getInstance().getFocussedWaypoint(); -+ drawPOI("Marker", pos.x, pos.z, 0xff00ffff); -+ } -+ -+ GL11.glPopMatrix(); -+ GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); -+ -+ GL11.glEnable(2929); -+ GL11.glDisable(3042); -+ dirty = false; -+ -+ Point newpos = getPlayerPosition(); -+ if (lastPlayerPos.getX() != newpos.getX() || lastPlayerPos.getY() != newpos.getY()) { -+ showPlayer(0); -+ lastPlayerPos = newpos; -+ } -+ } -+ -+ private void drawPOI(String name, int x, int z, int color) { -+ int mouseX = (int) ((getScreen().getMouseX() - getX() + scrollX) / scale + heightMap.getMinX() * 16); -+ int mouseY = (int) ((getScreen().getMouseY() - getY() + scrollY) / scale + heightMap.getMinZ() * 16); -+ int radius = (int) (2f / scale); -+ if (radius <= 0) { -+ radius = 2; -+ } -+ int mouseRadius = radius * 2; -+ if (parent.isInBoundingRect(x - mouseRadius, z - mouseRadius, mouseRadius * 2, mouseRadius * 2, mouseX, mouseY)) { -+ color = 0xff0000ff; -+ parent.drawTooltip(name, x, z); -+ } -+ RenderUtil.drawRectangle(x - radius, z - radius, x + radius, z + radius, color); -+ } -+ -+ @Override -+ public WidgetType getType() { -+ return WidgetType.ScrollArea; -+ } -+ -+ public double getScale() { -+ return scale; -+ } -+ -+ public void setScale(double value) { -+ setScale(value, false, 0); -+ } -+ -+ public void setScale(double newscale, boolean animated, int duration) { -+ if (!animated) { -+ Point center = getCenterCoord(); -+ this.scale = newscale; -+ scrollTo(center); -+ updateLOD(); -+ } else { -+ PropertyAnimation ani = new PropertyAnimation(this, "scale"); -+ ani.setStartNumber(this.scale); -+ ani.setEndNumber(newscale); -+ ani.setDuration(duration); -+ ani.start(); -+ } -+ } -+ -+ public void zoomBy(double d) { -+ double newscale = scale * d; -+ if (newscale <= 0) { -+ newscale = 0.0000001; -+ } -+ setScale(newscale, true, 100); -+ } -+ -+ public Point getPlayerPosition() { -+ int x = (int) SpoutClient.getHandle().thePlayer.posX; -+ int z = (int) SpoutClient.getHandle().thePlayer.posZ; -+ return new Point(x, z); -+ } -+} ---- /dev/null -+++ org/spoutcraft/client/entity/RenderText.java -@@ -1,0 +1,49 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.client.entity; -+ -+import org.lwjgl.opengl.GL11; -+ -+import net.minecraft.src.Entity; -+import net.minecraft.src.RenderEntity; -+import net.minecraft.src.RenderHelper; -+ -+import org.spoutcraft.client.SpoutClient; -+ -+public class RenderText extends RenderEntity { -+ @Override -+ public void doRender(Entity entity, double x, double y, double z, float yaw, float pitch) { -+ EntityText entitytext = (EntityText)entity; -+ String text = entitytext.getText(); -+ yaw = entitytext.isRotateWithPlayer()?this.renderManager.playerViewY:yaw; -+ RenderHelper.disableStandardItemLighting(); -+ GL11.glPushMatrix(); -+ float scale = entitytext.getScale() * 0.124f; -+ GL11.glTranslated(x, y + 1, z); -+ GL11.glScalef(scale, scale, scale); -+ GL11.glRotatef(180f, 0, 0f, 1f); -+ int stringwidth = SpoutClient.getInstance().getRenderDelegate().getMinecraftFont().getTextWidth(text); -+ GL11.glRotatef(yaw, 0, 1f, 0); -+ GL11.glTranslated(-stringwidth / 2d, 0, 0); -+ SpoutClient.getHandle().fontRenderer.drawString(text, 0, 0, 0xffffffff); -+ GL11.glPopMatrix(); -+ RenderHelper.enableStandardItemLighting(); -+ } -+} ---- net/minecraft/src/EntityBodyHelper.java -+++ net/minecraft/src/EntityBodyHelper.java -@@ -1,31 +1,36 @@ - package net.minecraft.src; - - public class EntityBodyHelper { -+ -+ /** Instance of EntityLiving. */ - private EntityLivingBase theLiving; - private int field_75666_b; - private float field_75667_c; - -- public EntityBodyHelper(EntityLivingBase var1) { -- this.theLiving = var1; -+ public EntityBodyHelper(EntityLivingBase par1EntityLivingBase) { -+ this.theLiving = par1EntityLivingBase; - } - - public void func_75664_a() { - double var1 = this.theLiving.posX - this.theLiving.prevPosX; - double var3 = this.theLiving.posZ - this.theLiving.prevPosZ; -- if(var1 * var1 + var3 * var3 > (double)2.5000003E-7F) { -+ -+ if (var1 * var1 + var3 * var3 > 2.500000277905201E-7D) { - this.theLiving.renderYawOffset = this.theLiving.rotationYaw; - this.theLiving.rotationYawHead = this.func_75665_a(this.theLiving.renderYawOffset, this.theLiving.rotationYawHead, 75.0F); - this.field_75667_c = this.theLiving.rotationYawHead; - this.field_75666_b = 0; - } else { - float var5 = 75.0F; -- if(Math.abs(this.theLiving.rotationYawHead - this.field_75667_c) > 15.0F) { -+ -+ if (Math.abs(this.theLiving.rotationYawHead - this.field_75667_c) > 15.0F) { - this.field_75666_b = 0; - this.field_75667_c = this.theLiving.rotationYawHead; - } else { - ++this.field_75666_b; - boolean var6 = true; -- if(this.field_75666_b > 10) { -+ -+ if (this.field_75666_b > 10) { - var5 = Math.max(1.0F - (float)(this.field_75666_b - 10) / 10.0F, 0.0F) * 75.0F; - } - } -@@ -34,16 +39,17 @@ - } - } - -- private float func_75665_a(float var1, float var2, float var3) { -- float var4 = MathHelper.wrapAngleTo180_float(var1 - var2); -- if(var4 < -var3) { -- var4 = -var3; -- } -- -- if(var4 >= var3) { -- var4 = var3; -- } -- -- return var1 - var4; -+ private float func_75665_a(float par1, float par2, float par3) { -+ float var4 = MathHelper.wrapAngleTo180_float(par1 - par2); -+ -+ if (var4 < -par3) { -+ var4 = -par3; -+ } -+ -+ if (var4 >= par3) { -+ var4 = par3; -+ } -+ -+ return par1 - var4; - } - } ---- net/minecraft/src/WorldGenDeadBush.java -+++ net/minecraft/src/WorldGenDeadBush.java -@@ -3,31 +3,31 @@ - import java.util.Random; - - public class WorldGenDeadBush extends WorldGenerator { -+ -+ /** stores the ID for WorldGenDeadBush */ - private int deadBushID; - -- public WorldGenDeadBush(int var1) { -- this.deadBushID = var1; -+ public WorldGenDeadBush(int par1) { -+ this.deadBushID = par1; - } - -- public boolean generate(World var1, Random var2, int var3, int var4, int var5) { -- boolean var6 = false; -- -- while(true) { -- int var11 = var1.getBlockId(var3, var4, var5); -- if(var11 != 0 && var11 != Block.leaves.blockID || var4 <= 0) { -- for(int var7 = 0; var7 < 4; ++var7) { -- int var8 = var3 + var2.nextInt(8) - var2.nextInt(8); -- int var9 = var4 + var2.nextInt(4) - var2.nextInt(4); -- int var10 = var5 + var2.nextInt(8) - var2.nextInt(8); -- if(var1.isAirBlock(var8, var9, var10) && Block.blocksList[this.deadBushID].canBlockStay(var1, var8, var9, var10)) { -- var1.setBlock(var8, var9, var10, this.deadBushID, 0, 2); -- } -- } -- -- return true; -+ public boolean generate(World par1World, Random par2Random, int par3, int par4, int par5) { -+ int var11; -+ -+ for (boolean var6 = false; ((var11 = par1World.getBlockId(par3, par4, par5)) == 0 || var11 == Block.leaves.blockID) && par4 > 0; --par4) { -+ ; -+ } -+ -+ for (int var7 = 0; var7 < 4; ++var7) { -+ int var8 = par3 + par2Random.nextInt(8) - par2Random.nextInt(8); -+ int var9 = par4 + par2Random.nextInt(4) - par2Random.nextInt(4); -+ int var10 = par5 + par2Random.nextInt(8) - par2Random.nextInt(8); -+ -+ if (par1World.isAirBlock(var8, var9, var10) && Block.blocksList[this.deadBushID].canBlockStay(par1World, var8, var9, var10)) { -+ par1World.setBlock(var8, var9, var10, this.deadBushID, 0, 2); - } -- -- --var4; - } -+ -+ return true; - } - } ---- net/minecraft/src/Packet39AttachEntity.java -+++ net/minecraft/src/Packet39AttachEntity.java -@@ -5,45 +5,65 @@ - import java.io.IOException; - - public class Packet39AttachEntity extends Packet { -+ -+ /** 0 for riding, 1 for leashed. */ - public int attachState; - public int ridingEntityId; - public int vehicleEntityId; - -- public Packet39AttachEntity() { -- } -- -- public Packet39AttachEntity(int var1, Entity var2, Entity var3) { -- this.attachState = var1; -- this.ridingEntityId = var2.entityId; -- this.vehicleEntityId = var3 != null ? var3.entityId : -1; -- } -- -+ public Packet39AttachEntity() {} -+ -+ public Packet39AttachEntity(int par1, Entity par2Entity, Entity par3Entity) { -+ this.attachState = par1; -+ this.ridingEntityId = par2Entity.entityId; -+ this.vehicleEntityId = par3Entity != null ? par3Entity.entityId : -1; -+ } -+ -+ /** -+ * Abstract. Return the size of the packet (not counting the header). -+ */ - public int getPacketSize() { - return 8; - } - -- public void readPacketData(DataInput var1) throws IOException { -- this.ridingEntityId = var1.readInt(); -- this.vehicleEntityId = var1.readInt(); -- this.attachState = var1.readUnsignedByte(); -- } -- -- public void writePacketData(DataOutput var1) throws IOException { -- var1.writeInt(this.ridingEntityId); -- var1.writeInt(this.vehicleEntityId); -- var1.writeByte(this.attachState); -- } -- -- public void processPacket(NetHandler var1) { -- var1.handleAttachEntity(this); -- } -- -+ /** -+ * Abstract. Reads the raw packet data from the data stream. -+ */ -+ public void readPacketData(DataInput par1DataInput) throws IOException { -+ this.ridingEntityId = par1DataInput.readInt(); -+ this.vehicleEntityId = par1DataInput.readInt(); -+ this.attachState = par1DataInput.readUnsignedByte(); -+ } -+ -+ /** -+ * Abstract. Writes the raw packet data to the data stream. -+ */ -+ public void writePacketData(DataOutput par1DataOutput) throws IOException { -+ par1DataOutput.writeInt(this.ridingEntityId); -+ par1DataOutput.writeInt(this.vehicleEntityId); -+ par1DataOutput.writeByte(this.attachState); -+ } -+ -+ /** -+ * Passes this Packet on to the NetHandler for processing. -+ */ -+ public void processPacket(NetHandler par1NetHandler) { -+ par1NetHandler.handleAttachEntity(this); -+ } -+ -+ /** -+ * only false for the abstract Packet class, all real packets return true -+ */ - public boolean isRealPacket() { - return true; - } - -- public boolean containsSameEntityIDAs(Packet var1) { -- Packet39AttachEntity var2 = (Packet39AttachEntity)var1; -+ /** -+ * eg return packet30entity.entityId == entityId; WARNING : will throw if you compare a packet to a different packet -+ * class -+ */ -+ public boolean containsSameEntityIDAs(Packet par1Packet) { -+ Packet39AttachEntity var2 = (Packet39AttachEntity)par1Packet; - return var2.ridingEntityId == this.ridingEntityId; - } - } ---- /dev/null -+++ org/spoutcraft/api/block/design/BlockDesign.java -@@ -1,0 +1,239 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.api.block.design; -+ -+import java.io.IOException; -+import java.util.Random; -+ -+import org.spoutcraft.api.io.SpoutInputStream; -+import org.spoutcraft.api.material.Block; -+import org.spoutcraft.api.util.Vector; -+ -+public interface BlockDesign { -+ /** -+ * Sets the maximum brightness of the block -+ * -+ * @param maxBrightness to set -+ * @return this -+ */ -+ public BlockDesign setMaxBrightness(float maxBrightness); -+ -+ /** -+ * Sets the minimum brightness of the block -+ * -+ * @param minBrightness to set -+ * @return this -+ */ -+ public BlockDesign setMinBrightness(float minBrightness); -+ -+ /** -+ * Sets the fixed brightness of the block -+ * -+ * @param brightness to set -+ * @return this -+ */ -+ public BlockDesign setBrightness(float brightness); -+ -+ /** -+ * Sets the number of render passes of the block -+ * -+ * @param renderPass to set -+ * @return this -+ */ -+ public BlockDesign setRenderPass(int renderPass); -+ -+ /** -+ * Gets the render pass for this design -+ * A render pass of 0 will be rendered in line with standard blocks -+ * A render pass of 1 will be rendered after standard blocks -+ * @return render pass -+ */ -+ public int getRenderPass(); -+ -+ /** -+ * The version of this design. Used for serialization. -+ * @return bytes -+ */ -+ public int getVersion(); -+ -+ /** -+ * Inflates this design with data from a packet. -+ * @param input -+ * @throws IOException -+ */ -+ public void read(SpoutInputStream input) throws IOException; -+ -+ /** -+ * Sets the specified Texture for this BlockDesign -+ * -+ * @param addon associated with the texture -+ * @param texture to set -+ * @return this -+ */ -+ public BlockDesign setTexture(String addon, Texture texture); -+ -+ /** -+ * Sets the bounding box for this block -+ * -+ * @param lowX of the first corner -+ * @param lowY of the first corner -+ * @param lowZ of the first corner -+ * @param highX of the second corner -+ * @param highY of the second corner -+ * @param highZ of the second corner -+ * @return this -+ */ -+ public BlockDesign setBoundingBox(float lowX, float lowY, float lowZ, float highX, float highY, float highZ); -+ -+ /** -+ * Sets the number of quads or faces for this block -+ * -+ * @param quads to set -+ * @return this -+ */ -+ public BlockDesign setQuadNumber(int quads); -+ -+ /** -+ * Manually specify a quad for this block -+ * -+ * @param quadNumber to set -+ * @param x1 first vertex value -+ * @param y1 first vertex value -+ * @param z1 first vertex value -+ * @param tx1 first vertex texture x -+ * @param ty1 first vertex texture y -+ * @param x2 second vertex value -+ * @param y2 second vertex value -+ * @param z2 second vertex value -+ * @param tx2 second vertex texture x -+ * @param ty2 second vertex texture y -+ * @param x3 third vertex value -+ * @param y3 third vertex value -+ * @param z3 third vertex value -+ * @param tx3 third vertex texture x -+ * @param ty3 third vertex texture y -+ * @param x4 fourth vertex value -+ * @param y4 fourth vertex value -+ * @param z4 fourth vertex value -+ * @param tx4 fourth vertex texture x -+ * @param ty4 fourth vertex texture y -+ * @param textureSizeX total width of the texture -+ * @param textureSizeY total height of the texture -+ * @return this -+ */ -+ public BlockDesign setQuad(int quadNumber, float x1, float y1, float z1, int tx1, int ty1, float x2, float y2, float z2, int tx2, int ty2, float x3, float y3, float z3, int tx3, int ty3, float x4, float y4, float z4, int tx4, int ty4, int textureSizeX, int textureSizeY); -+ -+ /** -+ * Sets the specified quad or face -+ * -+ * @param number of the quad to set -+ * @param quad to set there -+ * @return this -+ */ -+ public BlockDesign setQuad(Quad quad); -+ -+ /** -+ * Manually specified a vertex for this block -+ * -+ * @param quadNumber of the vertex -+ * @param vertexNumber in the quad -+ * @param x value -+ * @param y value -+ * @param z value -+ * @param tx texture x value -+ * @param ty texture y value -+ * @param textureSizeX total width of the texture -+ * @param textureSizeY total height of the texture -+ * @return this -+ */ -+ public BlockDesign setVertex(int quadNumber, int vertexNumber, float x, float y, float z, int tx, int ty, int textureSizeX, int textureSizeY); -+ -+ /** -+ * Sets a vertex -+ * -+ * @param vertex to set -+ * @return this -+ */ -+ public BlockDesign setVertex(Vertex vertex); -+ -+ /** -+ * Gets the texture URL associated with this block -+ * @return texture URL -+ */ -+ public String getTextureURL(); -+ -+ /** -+ * Gets the name of the addon associated with this blocks texture -+ * @return name of the addon -+ */ -+ public String getTextureAddon(); -+ -+ /** -+ * True if this design has been reset. -+ * @return -+ */ -+ public boolean isReset(); -+ -+ /** -+ * Sets the light source for the specified quad -+ * -+ * @param quad to set -+ * @param x offset from this block -+ * @param y offset from this block -+ * @param z offset from this block -+ * @return this -+ */ -+ public BlockDesign setLightSource(int quad, int x, int y, int z); -+ -+ /** -+ * Gets the light source for the specified quad -+ * -+ * @param quad to get -+ * @param x offset from this block -+ * @param y offset from this block -+ * @param z offset from this block -+ * @return Vector -+ */ -+ public Vector getLightSource(int quad, int x, int y, int z); -+ -+ /** -+ * Gets the Texture associated with this BlockDesign -+ * -+ * @return the texture -+ */ -+ public Texture getTexture(); -+ -+ /** -+ * Renders this block into the world -+ * @param block material being rendered -+ * @param x location -+ * @param y location -+ * @param z location -+ */ -+ public boolean renderBlock(Block block, int x, int y, int z); -+ -+ /** -+ * Renders this design as an item in the world -+ * @param block material being rendered -+ */ -+ public boolean renderItemstack(net.minecraft.src.ItemStack item, float x, float y, float depth, float rotation, float scale, Random rand); -+ -+ public boolean renderItemOnHUD(float x, float y, float depth); -+} ---- net/minecraft/src/EntitySilverfish.java -+++ net/minecraft/src/EntitySilverfish.java -@@ -1,69 +1,104 @@ - package net.minecraft.src; - - public class EntitySilverfish extends EntityMob { -+ -+ /** -+ * A cooldown before this entity will search for another Silverfish to join them in battle. -+ */ - private int allySummonCooldown; - -- public EntitySilverfish(World var1) { -- super(var1); -+ public EntitySilverfish(World par1World) { -+ super(par1World); - this.setSize(0.3F, 0.7F); - } - - protected void applyEntityAttributes() { - super.applyEntityAttributes(); - this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setAttribute(8.0D); -- this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setAttribute((double)0.6F); -+ this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setAttribute(0.6000000238418579D); - this.getEntityAttribute(SharedMonsterAttributes.attackDamage).setAttribute(1.0D); - } - -+ /** -+ * returns if this entity triggers Block.onEntityWalking on the blocks they walk on. used for spiders and wolves to -+ * prevent them from trampling crops -+ */ - protected boolean canTriggerWalking() { - return false; - } - -+ /** -+ * Finds the closest player within 16 blocks to attack, or null if this Entity isn't interested in attacking (Animals, -+ * Spiders at day, peaceful PigZombies). -+ */ - protected Entity findPlayerToAttack() { - double var1 = 8.0D; - return this.worldObj.getClosestVulnerablePlayerToEntity(this, var1); - } - -+ /** -+ * Returns the sound this mob makes while it's alive. -+ */ - protected String getLivingSound() { - return "mob.silverfish.say"; - } - -+ /** -+ * Returns the sound this mob makes when it is hurt. -+ */ - protected String getHurtSound() { - return "mob.silverfish.hit"; - } - -+ /** -+ * Returns the sound this mob makes on death. -+ */ - protected String getDeathSound() { - return "mob.silverfish.kill"; - } - -- public boolean attackEntityFrom(DamageSource var1, float var2) { -- if(this.isEntityInvulnerable()) { -+ /** -+ * Called when the entity is attacked. -+ */ -+ public boolean attackEntityFrom(DamageSource par1DamageSource, float par2) { -+ if (this.isEntityInvulnerable()) { - return false; - } else { -- if(this.allySummonCooldown <= 0 && (var1 instanceof EntityDamageSource || var1 == DamageSource.magic)) { -+ if (this.allySummonCooldown <= 0 && (par1DamageSource instanceof EntityDamageSource || par1DamageSource == DamageSource.magic)) { - this.allySummonCooldown = 20; - } - -- return super.attackEntityFrom(var1, var2); -+ return super.attackEntityFrom(par1DamageSource, par2); - } - } - -- protected void attackEntity(Entity var1, float var2) { -- if(this.attackTime <= 0 && var2 < 1.2F && var1.boundingBox.maxY > this.boundingBox.minY && var1.boundingBox.minY < this.boundingBox.maxY) { -+ /** -+ * Basic mob attack. Default to touch of death in EntityCreature. Overridden by each mob to define their attack. -+ */ -+ protected void attackEntity(Entity par1Entity, float par2) { -+ if (this.attackTime <= 0 && par2 < 1.2F && par1Entity.boundingBox.maxY > this.boundingBox.minY && par1Entity.boundingBox.minY < this.boundingBox.maxY) { - this.attackTime = 20; -- this.attackEntityAsMob(var1); -+ this.attackEntityAsMob(par1Entity); - } -- - } - -- protected void playStepSound(int var1, int var2, int var3, int var4) { -+ /** -+ * Plays step sound at given x, y, z for the entity -+ */ -+ protected void playStepSound(int par1, int par2, int par3, int par4) { - this.playSound("mob.silverfish.step", 0.15F, 1.0F); - } - -+ /** -+ * Returns the item ID for the item the mob drops on death. -+ */ - protected int getDropItemId() { - return 0; - } - -+ /** -+ * Called to update the entity's position/logic. -+ */ - public void onUpdate() { - this.renderYawOffset = this.rotationYaw; - super.onUpdate(); -@@ -71,32 +106,37 @@ - - protected void updateEntityActionState() { - super.updateEntityActionState(); -- if(!this.worldObj.isRemote) { -+ -+ if (!this.worldObj.isRemote) { - int var1; - int var2; - int var3; - int var5; -- if(this.allySummonCooldown > 0) { -+ -+ if (this.allySummonCooldown > 0) { - --this.allySummonCooldown; -- if(this.allySummonCooldown == 0) { -+ -+ if (this.allySummonCooldown == 0) { - var1 = MathHelper.floor_double(this.posX); - var2 = MathHelper.floor_double(this.posY); - var3 = MathHelper.floor_double(this.posZ); - boolean var4 = false; - -- for(var5 = 0; !var4 && var5 <= 5 && var5 >= -5; var5 = var5 <= 0 ? 1 - var5 : 0 - var5) { -- for(int var6 = 0; !var4 && var6 <= 10 && var6 >= -10; var6 = var6 <= 0 ? 1 - var6 : 0 - var6) { -- for(int var7 = 0; !var4 && var7 <= 10 && var7 >= -10; var7 = var7 <= 0 ? 1 - var7 : 0 - var7) { -+ for (var5 = 0; !var4 && var5 <= 5 && var5 >= -5; var5 = var5 <= 0 ? 1 - var5 : 0 - var5) { -+ for (int var6 = 0; !var4 && var6 <= 10 && var6 >= -10; var6 = var6 <= 0 ? 1 - var6 : 0 - var6) { -+ for (int var7 = 0; !var4 && var7 <= 10 && var7 >= -10; var7 = var7 <= 0 ? 1 - var7 : 0 - var7) { - int var8 = this.worldObj.getBlockId(var1 + var6, var2 + var5, var3 + var7); -- if(var8 == Block.silverfish.blockID) { -- if(!this.worldObj.getGameRules().getGameRuleBooleanValue("mobGriefing")) { -+ -+ if (var8 == Block.silverfish.blockID) { -+ if (!this.worldObj.getGameRules().getGameRuleBooleanValue("mobGriefing")) { - int var9 = this.worldObj.getBlockMetadata(var1 + var6, var2 + var5, var3 + var7); - Block var10 = Block.stone; -- if(var9 == 1) { -+ -+ if (var9 == 1) { - var10 = Block.cobblestone; - } - -- if(var9 == 2) { -+ if (var9 == 2) { - var10 = Block.stoneBrick; - } - -@@ -106,7 +146,8 @@ - } - - Block.silverfish.onBlockDestroyedByPlayer(this.worldObj, var1 + var6, var2 + var5, var3 + var7, 0); -- if(this.ab.nextBoolean()) { -+ -+ if (this.rand.nextBoolean()) { - var4 = true; - break; - } -@@ -117,36 +158,46 @@ - } - } - -- if(this.entityToAttack == null && !this.hasPath()) { -+ if (this.entityToAttack == null && !this.hasPath()) { - var1 = MathHelper.floor_double(this.posX); - var2 = MathHelper.floor_double(this.posY + 0.5D); - var3 = MathHelper.floor_double(this.posZ); -- int var11 = this.ab.nextInt(6); -+ int var11 = this.rand.nextInt(6); - var5 = this.worldObj.getBlockId(var1 + Facing.offsetsXForSide[var11], var2 + Facing.offsetsYForSide[var11], var3 + Facing.offsetsZForSide[var11]); -- if(BlockSilverfish.getPosingIdByMetadata(var5)) { -+ -+ if (BlockSilverfish.getPosingIdByMetadata(var5)) { - this.worldObj.setBlock(var1 + Facing.offsetsXForSide[var11], var2 + Facing.offsetsYForSide[var11], var3 + Facing.offsetsZForSide[var11], Block.silverfish.blockID, BlockSilverfish.getMetadataForBlockType(var5), 3); - this.spawnExplosionParticle(); - this.setDead(); - } else { - this.updateWanderPath(); - } -- } else if(this.entityToAttack != null && !this.hasPath()) { -+ } else if (this.entityToAttack != null && !this.hasPath()) { - this.entityToAttack = null; - } -- - } - } - -- public float getBlockPathWeight(int var1, int var2, int var3) { -- return this.worldObj.getBlockId(var1, var2 - 1, var3) == Block.stone.blockID ? 10.0F : super.getBlockPathWeight(var1, var2, var3); -+ /** -+ * Takes a coordinate in and returns a weight to determine how likely this creature will try to path to the block. -+ * Args: x, y, z -+ */ -+ public float getBlockPathWeight(int par1, int par2, int par3) { -+ return this.worldObj.getBlockId(par1, par2 - 1, par3) == Block.stone.blockID ? 10.0F : super.getBlockPathWeight(par1, par2, par3); - } - -+ /** -+ * Checks to make sure the light is not too bright where the mob is spawning -+ */ - protected boolean isValidLightLevel() { - return true; - } - -+ /** -+ * Checks if the entity's current position is a valid location to spawn this entity. -+ */ - public boolean getCanSpawnHere() { -- if(super.getCanSpawnHere()) { -+ if (super.getCanSpawnHere()) { - EntityPlayer var1 = this.worldObj.getClosestPlayerToEntity(this, 5.0D); - return var1 == null; - } else { -@@ -154,6 +205,9 @@ - } - } - -+ /** -+ * Get this Entity's EnumCreatureAttribute -+ */ - public EnumCreatureAttribute getCreatureAttribute() { - return EnumCreatureAttribute.ARTHROPOD; - } ---- net/minecraft/src/GuiButtonNextPage.java -+++ net/minecraft/src/GuiButtonNextPage.java -@@ -3,25 +3,33 @@ - import org.lwjgl.opengl.GL11; - - class GuiButtonNextPage extends GuiButton { -+ -+ /** -+ * True for pointing right (next page), false for pointing left (previous page). -+ */ - private final boolean nextPage; - -- public GuiButtonNextPage(int var1, int var2, int var3, boolean var4) { -- super(var1, var2, var3, 23, 13, ""); -- this.nextPage = var4; -+ public GuiButtonNextPage(int par1, int par2, int par3, boolean par4) { -+ super(par1, par2, par3, 23, 13, ""); -+ this.nextPage = par4; - } - -- public void drawButton(Minecraft var1, int var2, int var3) { -- if(this.drawButton) { -- boolean var4 = var2 >= this.xPosition && var3 >= this.yPosition && var2 < this.xPosition + this.width && var3 < this.yPosition + this.height; -+ /** -+ * Draws this button to the screen. -+ */ -+ public void drawButton(Minecraft par1Minecraft, int par2, int par3) { -+ if (this.drawButton) { -+ boolean var4 = par2 >= this.xPosition && par3 >= this.yPosition && par2 < this.xPosition + this.width && par3 < this.yPosition + this.height; - GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); -- var1.getTextureManager().bindTexture(GuiScreenBook.func_110404_g()); -+ par1Minecraft.getTextureManager().bindTexture(GuiScreenBook.func_110404_g()); - int var5 = 0; - int var6 = 192; -- if(var4) { -+ -+ if (var4) { - var5 += 23; - } - -- if(!this.nextPage) { -+ if (!this.nextPage) { - var6 += 13; - } - ---- net/minecraft/src/BiomeGenSwamp.java -+++ net/minecraft/src/BiomeGenSwamp.java -@@ -2,9 +2,12 @@ - - import java.util.Random; - -+import com.prupe.mcpatcher.cc.ColorizeBlock; -+import com.prupe.mcpatcher.cc.Colorizer; -+ - public class BiomeGenSwamp extends BiomeGenBase { -- protected BiomeGenSwamp(int var1) { -- super(var1); -+ protected BiomeGenSwamp(int par1) { -+ super(par1); - this.theBiomeDecorator.treesPerChunk = 2; - this.theBiomeDecorator.flowersPerChunk = -999; - this.theBiomeDecorator.deadBushPerChunk = 1; -@@ -13,22 +16,35 @@ - this.theBiomeDecorator.clayPerChunk = 1; - this.theBiomeDecorator.waterlilyPerChunk = 4; - this.waterColorMultiplier = 14745518; -- this.J.add(new SpawnListEntry(EntitySlime.class, 1, 1, 1)); -+ this.spawnableMonsterList.add(new SpawnListEntry(EntitySlime.class, 1, 1, 1)); - } - -- public WorldGenerator getRandomWorldGenForTrees(Random var1) { -+ /** -+ * Gets a WorldGen appropriate for this biome. -+ */ -+ public WorldGenerator getRandomWorldGenForTrees(Random par1Random) { - return this.worldGeneratorSwamp; - } - -+ /** -+ * Provides the basic grass color based on the biome temperature and rainfall -+ */ - public int getBiomeGrassColor() { - double var1 = (double)this.getFloatTemperature(); - double var3 = (double)this.getFloatRainfall(); -- return ((ColorizerGrass.getGrassColor(var1, var3) & 16711422) + 5115470) / 2; -+ // MCPatcher Start -+ return ColorizeBlock.colorizeBiome(((ColorizerGrass.getGrassColor(var1, var3) & 16711422) + 5115470) / 2, Colorizer.COLOR_MAP_SWAMP_GRASS, var1, var3); -+ // MCPatcher End - } - -+ /** -+ * Provides the basic foliage color based on the biome temperature and rainfall -+ */ - public int getBiomeFoliageColor() { - double var1 = (double)this.getFloatTemperature(); - double var3 = (double)this.getFloatRainfall(); -- return ((ColorizerFoliage.getFoliageColor(var1, var3) & 16711422) + 5115470) / 2; -+ // MCPatcher Start -+ return ColorizeBlock.colorizeBiome(((ColorizerFoliage.getFoliageColor(var1, var3) & 16711422) + 5115470) / 2, Colorizer.COLOR_MAP_SWAMP_FOLIAGE, var1, var3); -+ // MCPatcher End - } - } ---- /dev/null -+++ org/spoutcraft/api/gui/Orientation.java -@@ -1,0 +1,67 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.api.gui; -+ -+import java.util.HashMap; -+ -+/** -+ * This is used to define the orientation for Scrollable widgets. -+ */ -+public enum Orientation { -+ /** -+ * Horizontal axis (left-right) -+ */ -+ HORIZONTAL(0), -+ /** -+ * Vertical axis (top-bottom) -+ */ -+ VERTICAL(1); -+ -+ private final int id; -+ Orientation(int id) { -+ this.id = id; -+ } -+ -+ public int getId() { -+ return id; -+ } -+ -+ private static final HashMap lookupId = new HashMap(); -+ -+ static { -+ for (Orientation t : values()) { -+ lookupId.put(t.getId(), t); -+ } -+ } -+ -+ public static Orientation getOrientationFromId(int id) { -+ return lookupId.get(id); -+ } -+ -+ public Orientation getOther() { -+ switch(this) { -+ case HORIZONTAL: -+ return VERTICAL; -+ case VERTICAL: -+ return HORIZONTAL; -+ } -+ return null; -+ } -+} ---- net/minecraft/src/RenderWitherSkull.java -+++ net/minecraft/src/RenderWitherSkull.java -@@ -6,44 +6,57 @@ - public class RenderWitherSkull extends Render { - private static final ResourceLocation invulnerableWitherTextures = new ResourceLocation("textures/entity/wither/wither_invulnerable.png"); - private static final ResourceLocation witherTextures = new ResourceLocation("textures/entity/wither/wither.png"); -+ -+ /** The Skeleton's head model. */ - private final ModelSkeletonHead skeletonHeadModel = new ModelSkeletonHead(); - -- private float func_82400_a(float var1, float var2, float var3) { -+ private float func_82400_a(float par1, float par2, float par3) { - float var4; -- for(var4 = var2 - var1; var4 < -180.0F; var4 += 360.0F) { -+ -+ for (var4 = par2 - par1; var4 < -180.0F; var4 += 360.0F) { -+ ; - } - -- while(var4 >= 180.0F) { -+ while (var4 >= 180.0F) { - var4 -= 360.0F; - } - -- return var1 + var3 * var4; -+ return par1 + par3 * var4; - } - -- public void func_82399_a(EntityWitherSkull var1, double var2, double var4, double var6, float var8, float var9) { -+ public void func_82399_a(EntityWitherSkull par1EntityWitherSkull, double par2, double par4, double par6, float par8, float par9) { - GL11.glPushMatrix(); - GL11.glDisable(GL11.GL_CULL_FACE); -- float var10 = this.func_82400_a(var1.prevRotationYaw, var1.rotationYaw, var9); -- float var11 = var1.prevRotationPitch + (var1.rotationPitch - var1.prevRotationPitch) * var9; -- GL11.glTranslatef((float)var2, (float)var4, (float)var6); -- float var12 = 1.0F / 16.0F; -+ float var10 = this.func_82400_a(par1EntityWitherSkull.prevRotationYaw, par1EntityWitherSkull.rotationYaw, par9); -+ float var11 = par1EntityWitherSkull.prevRotationPitch + (par1EntityWitherSkull.rotationPitch - par1EntityWitherSkull.prevRotationPitch) * par9; -+ GL11.glTranslatef((float)par2, (float)par4, (float)par6); -+ float var12 = 0.0625F; - GL11.glEnable(GL12.GL_RESCALE_NORMAL); - GL11.glScalef(-1.0F, -1.0F, 1.0F); - GL11.glEnable(GL11.GL_ALPHA_TEST); -- this.bindEntityTexture(var1); -- this.skeletonHeadModel.render(var1, 0.0F, 0.0F, 0.0F, var10, var11, var12); -+ this.bindEntityTexture(par1EntityWitherSkull); -+ this.skeletonHeadModel.render(par1EntityWitherSkull, 0.0F, 0.0F, 0.0F, var10, var11, var12); - GL11.glPopMatrix(); - } - -- protected ResourceLocation func_110809_a(EntityWitherSkull var1) { -- return var1.isInvulnerable() ? invulnerableWitherTextures : witherTextures; -- } -- -- protected ResourceLocation getEntityTexture(Entity var1) { -- return this.func_110809_a((EntityWitherSkull)var1); -- } -- -- public void doRender(Entity var1, double var2, double var4, double var6, float var8, float var9) { -- this.func_82399_a((EntityWitherSkull)var1, var2, var4, var6, var8, var9); -+ protected ResourceLocation func_110809_a(EntityWitherSkull par1EntityWitherSkull) { -+ return par1EntityWitherSkull.isInvulnerable() ? invulnerableWitherTextures : witherTextures; -+ } -+ -+ /** -+ * Returns the location of an entity's texture. Doesn't seem to be called unless you call Render.bindEntityTexture. -+ */ -+ protected ResourceLocation getEntityTexture(Entity par1Entity) { -+ return this.func_110809_a((EntityWitherSkull)par1Entity); -+ } -+ -+ /** -+ * Actually renders the given argument. This is a synthetic bridge method, always casting down its argument and then -+ * handing it off to a worker function which does the actual work. In all probabilty, the class Render is generic -+ * (Render -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.client.gui; -+ -+import org.spoutcraft.api.gui.Control; -+import org.spoutcraft.api.gui.Widget; -+import org.spoutcraft.api.gui.WidgetManager; -+import org.spoutcraft.client.SpoutClient; -+import org.spoutcraft.client.packet.PacketFocusUpdate; -+import org.spoutcraft.client.packet.PacketWidget; -+ -+public class SimpleWidgetManager implements WidgetManager { -+ public void sendWidgetUpdate(Widget widget) { -+ if (widget.getScreen() == null) { -+ return; -+ } -+ PacketWidget update = new PacketWidget(widget, widget.getScreen().getId()); -+ SpoutClient.getInstance().getPacketManager().sendSpoutPacket(update); -+ } -+ -+ public void sendFocusUpdate(Control control, boolean focus) { -+ PacketFocusUpdate update = new PacketFocusUpdate(control, focus); -+ SpoutClient.getInstance().getPacketManager().sendSpoutPacket(update); -+ } -+} ---- net/minecraft/src/CombatTracker.java -+++ net/minecraft/src/CombatTracker.java -@@ -5,74 +5,81 @@ - import java.util.List; - - public class CombatTracker { -- private final List a = new ArrayList(); -+ private final List field_94556_a = new ArrayList(); -+ -+ /** The entity tracked. */ - private final EntityLivingBase fighter; - private int field_94555_c; - private boolean field_94552_d; - private boolean field_94553_e; -- private String f; -+ private String field_94551_f; - -- public CombatTracker(EntityLivingBase var1) { -- this.fighter = var1; -+ public CombatTracker(EntityLivingBase par1EntityLivingBase) { -+ this.fighter = par1EntityLivingBase; - } - - public void func_94545_a() { - this.func_94542_g(); -- if(this.fighter.isOnLadder()) { -+ -+ if (this.fighter.isOnLadder()) { - int var1 = this.fighter.worldObj.getBlockId(MathHelper.floor_double(this.fighter.posX), MathHelper.floor_double(this.fighter.boundingBox.minY), MathHelper.floor_double(this.fighter.posZ)); -- if(var1 == Block.ladder.blockID) { -- this.f = "ladder"; -- } else if(var1 == Block.vine.blockID) { -- this.f = "vines"; -+ -+ if (var1 == Block.ladder.blockID) { -+ this.field_94551_f = "ladder"; -+ } else if (var1 == Block.vine.blockID) { -+ this.field_94551_f = "vines"; - } -- } else if(this.fighter.isInWater()) { -- this.f = "water"; -+ } else if (this.fighter.isInWater()) { -+ this.field_94551_f = "water"; - } -- - } - -- public void func_94547_a(DamageSource var1, float var2, float var3) { -+ public void func_94547_a(DamageSource par1DamageSource, float par2, float par3) { - this.func_94549_h(); - this.func_94545_a(); -- CombatEntry var4 = new CombatEntry(var1, this.fighter.ticksExisted, var2, var3, this.f, this.fighter.fallDistance); -- this.a.add(var4); -+ CombatEntry var4 = new CombatEntry(par1DamageSource, this.fighter.ticksExisted, par2, par3, this.field_94551_f, this.fighter.fallDistance); -+ this.field_94556_a.add(var4); - this.field_94555_c = this.fighter.ticksExisted; - this.field_94553_e = true; - this.field_94552_d |= var4.func_94559_f(); - } - - public ChatMessageComponent func_94546_b() { -- if(this.a.size() == 0) { -- return ChatMessageComponent.createFromTranslationWithSubstitutions("death.attack.generic", new Object[]{this.fighter.getTranslatedEntityName()}); -+ if (this.field_94556_a.size() == 0) { -+ return ChatMessageComponent.createFromTranslationWithSubstitutions("death.attack.generic", new Object[] {this.fighter.getTranslatedEntityName()}); - } else { - CombatEntry var1 = this.func_94544_f(); -- CombatEntry var2 = (CombatEntry)this.a.get(this.a.size() - 1); -+ CombatEntry var2 = (CombatEntry)this.field_94556_a.get(this.field_94556_a.size() - 1); - String var4 = var2.func_94558_h(); - Entity var5 = var2.getDamageSrc().getEntity(); - ChatMessageComponent var3; -- if(var1 != null && var2.getDamageSrc() == DamageSource.fall) { -+ -+ if (var1 != null && var2.getDamageSrc() == DamageSource.fall) { - String var6 = var1.func_94558_h(); -- if(var1.getDamageSrc() != DamageSource.fall && var1.getDamageSrc() != DamageSource.outOfWorld) { -- if(var6 != null && (var4 == null || !var6.equals(var4))) { -+ -+ if (var1.getDamageSrc() != DamageSource.fall && var1.getDamageSrc() != DamageSource.outOfWorld) { -+ if (var6 != null && (var4 == null || !var6.equals(var4))) { - Entity var9 = var1.getDamageSrc().getEntity(); - ItemStack var8 = var9 instanceof EntityLivingBase ? ((EntityLivingBase)var9).getHeldItem() : null; -- if(var8 != null && var8.hasDisplayName()) { -- var3 = ChatMessageComponent.createFromTranslationWithSubstitutions("death.fell.assist.item", new Object[]{this.fighter.getTranslatedEntityName(), var6, var8.getDisplayName()}); -+ -+ if (var8 != null && var8.hasDisplayName()) { -+ var3 = ChatMessageComponent.createFromTranslationWithSubstitutions("death.fell.assist.item", new Object[] {this.fighter.getTranslatedEntityName(), var6, var8.getDisplayName()}); - } else { -- var3 = ChatMessageComponent.createFromTranslationWithSubstitutions("death.fell.assist", new Object[]{this.fighter.getTranslatedEntityName(), var6}); -+ var3 = ChatMessageComponent.createFromTranslationWithSubstitutions("death.fell.assist", new Object[] {this.fighter.getTranslatedEntityName(), var6}); - } -- } else if(var4 != null) { -+ } else if (var4 != null) { - ItemStack var7 = var5 instanceof EntityLivingBase ? ((EntityLivingBase)var5).getHeldItem() : null; -- if(var7 != null && var7.hasDisplayName()) { -- var3 = ChatMessageComponent.createFromTranslationWithSubstitutions("death.fell.finish.item", new Object[]{this.fighter.getTranslatedEntityName(), var4, var7.getDisplayName()}); -+ -+ if (var7 != null && var7.hasDisplayName()) { -+ var3 = ChatMessageComponent.createFromTranslationWithSubstitutions("death.fell.finish.item", new Object[] {this.fighter.getTranslatedEntityName(), var4, var7.getDisplayName()}); - } else { -- var3 = ChatMessageComponent.createFromTranslationWithSubstitutions("death.fell.finish", new Object[]{this.fighter.getTranslatedEntityName(), var4}); -+ var3 = ChatMessageComponent.createFromTranslationWithSubstitutions("death.fell.finish", new Object[] {this.fighter.getTranslatedEntityName(), var4}); - } - } else { -- var3 = ChatMessageComponent.createFromTranslationWithSubstitutions("death.fell.killer", new Object[]{this.fighter.getTranslatedEntityName()}); -+ var3 = ChatMessageComponent.createFromTranslationWithSubstitutions("death.fell.killer", new Object[] {this.fighter.getTranslatedEntityName()}); - } - } else { -- var3 = ChatMessageComponent.createFromTranslationWithSubstitutions("death.fell.accident." + this.func_94548_b(var1), new Object[]{this.fighter.getTranslatedEntityName()}); -+ var3 = ChatMessageComponent.createFromTranslationWithSubstitutions("death.fell.accident." + this.func_94548_b(var1), new Object[] {this.fighter.getTranslatedEntityName()}); - } - } else { - var3 = var2.getDamageSrc().getDeathMessage(this.fighter); -@@ -87,30 +94,26 @@ - EntityPlayer var2 = null; - float var3 = 0.0F; - float var4 = 0.0F; -- Iterator var5 = this.a.iterator(); -- -- while(true) { -- CombatEntry var6; -- do { -- do { -- if(!var5.hasNext()) { -- if(var2 != null && var4 >= var3 / 3.0F) { -- return var2; -- } -- -- return var1; -- } -- -- var6 = (CombatEntry)var5.next(); -- if(var6.getDamageSrc().getEntity() instanceof EntityPlayer && (var2 == null || var6.func_94563_c() > var4)) { -- var4 = var6.func_94563_c(); -- var2 = (EntityPlayer)var6.getDamageSrc().getEntity(); -- } -- } while(!(var6.getDamageSrc().getEntity() instanceof EntityLivingBase)); -- } while(var1 != null && var6.func_94563_c() <= var3); -- -- var3 = var6.func_94563_c(); -- var1 = (EntityLivingBase)var6.getDamageSrc().getEntity(); -+ Iterator var5 = this.field_94556_a.iterator(); -+ -+ while (var5.hasNext()) { -+ CombatEntry var6 = (CombatEntry)var5.next(); -+ -+ if (var6.getDamageSrc().getEntity() instanceof EntityPlayer && (var2 == null || var6.func_94563_c() > var4)) { -+ var4 = var6.func_94563_c(); -+ var2 = (EntityPlayer)var6.getDamageSrc().getEntity(); -+ } -+ -+ if (var6.getDamageSrc().getEntity() instanceof EntityLivingBase && (var1 == null || var6.func_94563_c() > var3)) { -+ var3 = var6.func_94563_c(); -+ var1 = (EntityLivingBase)var6.getDamageSrc().getEntity(); -+ } -+ } -+ -+ if (var2 != null && var4 >= var3 / 3.0F) { -+ return var2; -+ } else { -+ return var1; - } - } - -@@ -120,11 +123,12 @@ - byte var3 = 0; - float var4 = 0.0F; - -- for(int var5 = 0; var5 < this.a.size(); ++var5) { -- CombatEntry var6 = (CombatEntry)this.a.get(var5); -- CombatEntry var7 = var5 > 0 ? (CombatEntry)this.a.get(var5 - 1) : null; -- if((var6.getDamageSrc() == DamageSource.fall || var6.getDamageSrc() == DamageSource.outOfWorld) && var6.func_94561_i() > 0.0F && (var1 == null || var6.func_94561_i() > var4)) { -- if(var5 > 0) { -+ for (int var5 = 0; var5 < this.field_94556_a.size(); ++var5) { -+ CombatEntry var6 = (CombatEntry)this.field_94556_a.get(var5); -+ CombatEntry var7 = var5 > 0 ? (CombatEntry)this.field_94556_a.get(var5 - 1) : null; -+ -+ if ((var6.getDamageSrc() == DamageSource.fall || var6.getDamageSrc() == DamageSource.outOfWorld) && var6.func_94561_i() > 0.0F && (var1 == null || var6.func_94561_i() > var4)) { -+ if (var5 > 0) { - var1 = var7; - } else { - var1 = var6; -@@ -133,35 +137,35 @@ - var4 = var6.func_94561_i(); - } - -- if(var6.func_94562_g() != null && (var2 == null || var6.func_94563_c() > (float)var3)) { -+ if (var6.func_94562_g() != null && (var2 == null || var6.func_94563_c() > (float)var3)) { - var2 = var6; - } - } - -- if(var4 > 5.0F && var1 != null) { -+ if (var4 > 5.0F && var1 != null) { - return var1; -- } else if(var3 > 5 && var2 != null) { -+ } else if (var3 > 5 && var2 != null) { - return var2; - } else { - return null; - } - } - -- private String func_94548_b(CombatEntry var1) { -- return var1.func_94562_g() == null ? "generic" : var1.func_94562_g(); -+ private String func_94548_b(CombatEntry par1CombatEntry) { -+ return par1CombatEntry.func_94562_g() == null ? "generic" : par1CombatEntry.func_94562_g(); - } - - private void func_94542_g() { -- this.f = null; -+ this.field_94551_f = null; - } - - private void func_94549_h() { - int var1 = this.field_94552_d ? 300 : 100; -- if(this.field_94553_e && this.fighter.ticksExisted - this.field_94555_c > var1) { -- this.a.clear(); -+ -+ if (this.field_94553_e && this.fighter.ticksExisted - this.field_94555_c > var1) { -+ this.field_94556_a.clear(); - this.field_94553_e = false; - this.field_94552_d = false; - } -- - } - } ---- net/minecraft/src/ComponentStrongholdLibrary.java -+++ net/minecraft/src/ComponentStrongholdLibrary.java -@@ -4,133 +4,144 @@ - import java.util.Random; - - public class ComponentStrongholdLibrary extends ComponentStronghold { -- private static final WeightedRandomChestContent[] strongholdLibraryChestContents = new WeightedRandomChestContent[]{new WeightedRandomChestContent(Item.book.itemID, 0, 1, 3, 20), new WeightedRandomChestContent(Item.paper.itemID, 0, 2, 7, 20), new WeightedRandomChestContent(Item.emptyMap.itemID, 0, 1, 1, 1), new WeightedRandomChestContent(Item.compass.itemID, 0, 1, 1, 1)}; -+ -+ /** List of items that Stronghold Library chests can contain. */ -+ private static final WeightedRandomChestContent[] strongholdLibraryChestContents = new WeightedRandomChestContent[] {new WeightedRandomChestContent(Item.book.itemID, 0, 1, 3, 20), new WeightedRandomChestContent(Item.paper.itemID, 0, 2, 7, 20), new WeightedRandomChestContent(Item.emptyMap.itemID, 0, 1, 1, 1), new WeightedRandomChestContent(Item.compass.itemID, 0, 1, 1, 1)}; - private boolean isLargeRoom; - -- public ComponentStrongholdLibrary() { -- } -- -- public ComponentStrongholdLibrary(int var1, Random var2, StructureBoundingBox var3, int var4) { -- super(var1); -- this.coordBaseMode = var4; -- this.field_143013_d = this.getRandomDoor(var2); -- this.boundingBox = var3; -- this.isLargeRoom = var3.getYSize() > 6; -- } -- -- protected void func_143012_a(NBTTagCompound var1) { -- super.func_143012_a(var1); -- var1.setBoolean("Tall", this.isLargeRoom); -- } -- -- protected void func_143011_b(NBTTagCompound var1) { -- super.func_143011_b(var1); -- this.isLargeRoom = var1.getBoolean("Tall"); -- } -- -- public static ComponentStrongholdLibrary findValidPlacement(List var0, Random var1, int var2, int var3, int var4, int var5, int var6) { -- StructureBoundingBox var7 = StructureBoundingBox.getComponentToAddBoundingBox(var2, var3, var4, -4, -1, 0, 14, 11, 15, var5); -- if(!canStrongholdGoDeeper(var7) || StructureComponent.findIntersecting(var0, var7) != null) { -- var7 = StructureBoundingBox.getComponentToAddBoundingBox(var2, var3, var4, -4, -1, 0, 14, 6, 15, var5); -- if(!canStrongholdGoDeeper(var7) || StructureComponent.findIntersecting(var0, var7) != null) { -+ public ComponentStrongholdLibrary() {} -+ -+ public ComponentStrongholdLibrary(int par1, Random par2Random, StructureBoundingBox par3StructureBoundingBox, int par4) { -+ super(par1); -+ this.coordBaseMode = par4; -+ this.field_143013_d = this.getRandomDoor(par2Random); -+ this.boundingBox = par3StructureBoundingBox; -+ this.isLargeRoom = par3StructureBoundingBox.getYSize() > 6; -+ } -+ -+ protected void func_143012_a(NBTTagCompound par1NBTTagCompound) { -+ super.func_143012_a(par1NBTTagCompound); -+ par1NBTTagCompound.setBoolean("Tall", this.isLargeRoom); -+ } -+ -+ protected void func_143011_b(NBTTagCompound par1NBTTagCompound) { -+ super.func_143011_b(par1NBTTagCompound); -+ this.isLargeRoom = par1NBTTagCompound.getBoolean("Tall"); -+ } -+ -+ public static ComponentStrongholdLibrary findValidPlacement(List par0List, Random par1Random, int par2, int par3, int par4, int par5, int par6) { -+ StructureBoundingBox var7 = StructureBoundingBox.getComponentToAddBoundingBox(par2, par3, par4, -4, -1, 0, 14, 11, 15, par5); -+ -+ if (!canStrongholdGoDeeper(var7) || StructureComponent.findIntersecting(par0List, var7) != null) { -+ var7 = StructureBoundingBox.getComponentToAddBoundingBox(par2, par3, par4, -4, -1, 0, 14, 6, 15, par5); -+ -+ if (!canStrongholdGoDeeper(var7) || StructureComponent.findIntersecting(par0List, var7) != null) { - return null; - } - } - -- return new ComponentStrongholdLibrary(var6, var1, var7, var5); -+ return new ComponentStrongholdLibrary(par6, par1Random, var7, par5); - } - -- public boolean addComponentParts(World var1, Random var2, StructureBoundingBox var3) { -- if(this.isLiquidInStructureBoundingBox(var1, var3)) { -+ /** -+ * second Part of Structure generating, this for example places Spiderwebs, Mob Spawners, it closes Mineshafts at the -+ * end, it adds Fences... -+ */ -+ public boolean addComponentParts(World par1World, Random par2Random, StructureBoundingBox par3StructureBoundingBox) { -+ if (this.isLiquidInStructureBoundingBox(par1World, par3StructureBoundingBox)) { - return false; - } else { - byte var4 = 11; -- if(!this.isLargeRoom) { -+ -+ if (!this.isLargeRoom) { - var4 = 6; - } - -- this.fillWithRandomizedBlocks(var1, var3, 0, 0, 0, 13, var4 - 1, 14, true, var2, StructureStrongholdPieces.getStrongholdStones()); -- this.placeDoor(var1, var2, var3, this.field_143013_d, 4, 1, 0); -- this.randomlyFillWithBlocks(var1, var3, var2, 0.07F, 2, 1, 1, 11, 4, 13, Block.web.blockID, Block.web.blockID, false); -+ this.fillWithRandomizedBlocks(par1World, par3StructureBoundingBox, 0, 0, 0, 13, var4 - 1, 14, true, par2Random, StructureStrongholdPieces.getStrongholdStones()); -+ this.placeDoor(par1World, par2Random, par3StructureBoundingBox, this.field_143013_d, 4, 1, 0); -+ this.randomlyFillWithBlocks(par1World, par3StructureBoundingBox, par2Random, 0.07F, 2, 1, 1, 11, 4, 13, Block.web.blockID, Block.web.blockID, false); - boolean var5 = true; - boolean var6 = true; -- - int var7; -- for(var7 = 1; var7 <= 13; ++var7) { -- if((var7 - 1) % 4 == 0) { -- this.fillWithBlocks(var1, var3, 1, 1, var7, 1, 4, var7, Block.planks.blockID, Block.planks.blockID, false); -- this.fillWithBlocks(var1, var3, 12, 1, var7, 12, 4, var7, Block.planks.blockID, Block.planks.blockID, false); -- this.placeBlockAtCurrentPosition(var1, Block.torchWood.blockID, 0, 2, 3, var7, var3); -- this.placeBlockAtCurrentPosition(var1, Block.torchWood.blockID, 0, 11, 3, var7, var3); -- if(this.isLargeRoom) { -- this.fillWithBlocks(var1, var3, 1, 6, var7, 1, 9, var7, Block.planks.blockID, Block.planks.blockID, false); -- this.fillWithBlocks(var1, var3, 12, 6, var7, 12, 9, var7, Block.planks.blockID, Block.planks.blockID, false); -+ -+ for (var7 = 1; var7 <= 13; ++var7) { -+ if ((var7 - 1) % 4 == 0) { -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 1, 1, var7, 1, 4, var7, Block.planks.blockID, Block.planks.blockID, false); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 12, 1, var7, 12, 4, var7, Block.planks.blockID, Block.planks.blockID, false); -+ this.placeBlockAtCurrentPosition(par1World, Block.torchWood.blockID, 0, 2, 3, var7, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.torchWood.blockID, 0, 11, 3, var7, par3StructureBoundingBox); -+ -+ if (this.isLargeRoom) { -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 1, 6, var7, 1, 9, var7, Block.planks.blockID, Block.planks.blockID, false); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 12, 6, var7, 12, 9, var7, Block.planks.blockID, Block.planks.blockID, false); - } - } else { -- this.fillWithBlocks(var1, var3, 1, 1, var7, 1, 4, var7, Block.bookShelf.blockID, Block.bookShelf.blockID, false); -- this.fillWithBlocks(var1, var3, 12, 1, var7, 12, 4, var7, Block.bookShelf.blockID, Block.bookShelf.blockID, false); -- if(this.isLargeRoom) { -- this.fillWithBlocks(var1, var3, 1, 6, var7, 1, 9, var7, Block.bookShelf.blockID, Block.bookShelf.blockID, false); -- this.fillWithBlocks(var1, var3, 12, 6, var7, 12, 9, var7, Block.bookShelf.blockID, Block.bookShelf.blockID, false); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 1, 1, var7, 1, 4, var7, Block.bookShelf.blockID, Block.bookShelf.blockID, false); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 12, 1, var7, 12, 4, var7, Block.bookShelf.blockID, Block.bookShelf.blockID, false); -+ -+ if (this.isLargeRoom) { -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 1, 6, var7, 1, 9, var7, Block.bookShelf.blockID, Block.bookShelf.blockID, false); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 12, 6, var7, 12, 9, var7, Block.bookShelf.blockID, Block.bookShelf.blockID, false); - } - } - } - -- for(var7 = 3; var7 < 12; var7 += 2) { -- this.fillWithBlocks(var1, var3, 3, 1, var7, 4, 3, var7, Block.bookShelf.blockID, Block.bookShelf.blockID, false); -- this.fillWithBlocks(var1, var3, 6, 1, var7, 7, 3, var7, Block.bookShelf.blockID, Block.bookShelf.blockID, false); -- this.fillWithBlocks(var1, var3, 9, 1, var7, 10, 3, var7, Block.bookShelf.blockID, Block.bookShelf.blockID, false); -+ for (var7 = 3; var7 < 12; var7 += 2) { -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 3, 1, var7, 4, 3, var7, Block.bookShelf.blockID, Block.bookShelf.blockID, false); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 6, 1, var7, 7, 3, var7, Block.bookShelf.blockID, Block.bookShelf.blockID, false); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 9, 1, var7, 10, 3, var7, Block.bookShelf.blockID, Block.bookShelf.blockID, false); - } - -- if(this.isLargeRoom) { -- this.fillWithBlocks(var1, var3, 1, 5, 1, 3, 5, 13, Block.planks.blockID, Block.planks.blockID, false); -- this.fillWithBlocks(var1, var3, 10, 5, 1, 12, 5, 13, Block.planks.blockID, Block.planks.blockID, false); -- this.fillWithBlocks(var1, var3, 4, 5, 1, 9, 5, 2, Block.planks.blockID, Block.planks.blockID, false); -- this.fillWithBlocks(var1, var3, 4, 5, 12, 9, 5, 13, Block.planks.blockID, Block.planks.blockID, false); -- this.placeBlockAtCurrentPosition(var1, Block.planks.blockID, 0, 9, 5, 11, var3); -- this.placeBlockAtCurrentPosition(var1, Block.planks.blockID, 0, 8, 5, 11, var3); -- this.placeBlockAtCurrentPosition(var1, Block.planks.blockID, 0, 9, 5, 10, var3); -- this.fillWithBlocks(var1, var3, 3, 6, 2, 3, 6, 12, Block.fence.blockID, Block.fence.blockID, false); -- this.fillWithBlocks(var1, var3, 10, 6, 2, 10, 6, 10, Block.fence.blockID, Block.fence.blockID, false); -- this.fillWithBlocks(var1, var3, 4, 6, 2, 9, 6, 2, Block.fence.blockID, Block.fence.blockID, false); -- this.fillWithBlocks(var1, var3, 4, 6, 12, 8, 6, 12, Block.fence.blockID, Block.fence.blockID, false); -- this.placeBlockAtCurrentPosition(var1, Block.fence.blockID, 0, 9, 6, 11, var3); -- this.placeBlockAtCurrentPosition(var1, Block.fence.blockID, 0, 8, 6, 11, var3); -- this.placeBlockAtCurrentPosition(var1, Block.fence.blockID, 0, 9, 6, 10, var3); -+ if (this.isLargeRoom) { -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 1, 5, 1, 3, 5, 13, Block.planks.blockID, Block.planks.blockID, false); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 10, 5, 1, 12, 5, 13, Block.planks.blockID, Block.planks.blockID, false); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 4, 5, 1, 9, 5, 2, Block.planks.blockID, Block.planks.blockID, false); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 4, 5, 12, 9, 5, 13, Block.planks.blockID, Block.planks.blockID, false); -+ this.placeBlockAtCurrentPosition(par1World, Block.planks.blockID, 0, 9, 5, 11, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.planks.blockID, 0, 8, 5, 11, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.planks.blockID, 0, 9, 5, 10, par3StructureBoundingBox); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 3, 6, 2, 3, 6, 12, Block.fence.blockID, Block.fence.blockID, false); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 10, 6, 2, 10, 6, 10, Block.fence.blockID, Block.fence.blockID, false); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 4, 6, 2, 9, 6, 2, Block.fence.blockID, Block.fence.blockID, false); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 4, 6, 12, 8, 6, 12, Block.fence.blockID, Block.fence.blockID, false); -+ this.placeBlockAtCurrentPosition(par1World, Block.fence.blockID, 0, 9, 6, 11, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.fence.blockID, 0, 8, 6, 11, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.fence.blockID, 0, 9, 6, 10, par3StructureBoundingBox); - var7 = this.getMetadataWithOffset(Block.ladder.blockID, 3); -- this.placeBlockAtCurrentPosition(var1, Block.ladder.blockID, var7, 10, 1, 13, var3); -- this.placeBlockAtCurrentPosition(var1, Block.ladder.blockID, var7, 10, 2, 13, var3); -- this.placeBlockAtCurrentPosition(var1, Block.ladder.blockID, var7, 10, 3, 13, var3); -- this.placeBlockAtCurrentPosition(var1, Block.ladder.blockID, var7, 10, 4, 13, var3); -- this.placeBlockAtCurrentPosition(var1, Block.ladder.blockID, var7, 10, 5, 13, var3); -- this.placeBlockAtCurrentPosition(var1, Block.ladder.blockID, var7, 10, 6, 13, var3); -- this.placeBlockAtCurrentPosition(var1, Block.ladder.blockID, var7, 10, 7, 13, var3); -+ this.placeBlockAtCurrentPosition(par1World, Block.ladder.blockID, var7, 10, 1, 13, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.ladder.blockID, var7, 10, 2, 13, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.ladder.blockID, var7, 10, 3, 13, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.ladder.blockID, var7, 10, 4, 13, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.ladder.blockID, var7, 10, 5, 13, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.ladder.blockID, var7, 10, 6, 13, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.ladder.blockID, var7, 10, 7, 13, par3StructureBoundingBox); - byte var8 = 7; - byte var9 = 7; -- this.placeBlockAtCurrentPosition(var1, Block.fence.blockID, 0, var8 - 1, 9, var9, var3); -- this.placeBlockAtCurrentPosition(var1, Block.fence.blockID, 0, var8, 9, var9, var3); -- this.placeBlockAtCurrentPosition(var1, Block.fence.blockID, 0, var8 - 1, 8, var9, var3); -- this.placeBlockAtCurrentPosition(var1, Block.fence.blockID, 0, var8, 8, var9, var3); -- this.placeBlockAtCurrentPosition(var1, Block.fence.blockID, 0, var8 - 1, 7, var9, var3); -- this.placeBlockAtCurrentPosition(var1, Block.fence.blockID, 0, var8, 7, var9, var3); -- this.placeBlockAtCurrentPosition(var1, Block.fence.blockID, 0, var8 - 2, 7, var9, var3); -- this.placeBlockAtCurrentPosition(var1, Block.fence.blockID, 0, var8 + 1, 7, var9, var3); -- this.placeBlockAtCurrentPosition(var1, Block.fence.blockID, 0, var8 - 1, 7, var9 - 1, var3); -- this.placeBlockAtCurrentPosition(var1, Block.fence.blockID, 0, var8 - 1, 7, var9 + 1, var3); -- this.placeBlockAtCurrentPosition(var1, Block.fence.blockID, 0, var8, 7, var9 - 1, var3); -- this.placeBlockAtCurrentPosition(var1, Block.fence.blockID, 0, var8, 7, var9 + 1, var3); -- this.placeBlockAtCurrentPosition(var1, Block.torchWood.blockID, 0, var8 - 2, 8, var9, var3); -- this.placeBlockAtCurrentPosition(var1, Block.torchWood.blockID, 0, var8 + 1, 8, var9, var3); -- this.placeBlockAtCurrentPosition(var1, Block.torchWood.blockID, 0, var8 - 1, 8, var9 - 1, var3); -- this.placeBlockAtCurrentPosition(var1, Block.torchWood.blockID, 0, var8 - 1, 8, var9 + 1, var3); -- this.placeBlockAtCurrentPosition(var1, Block.torchWood.blockID, 0, var8, 8, var9 - 1, var3); -- this.placeBlockAtCurrentPosition(var1, Block.torchWood.blockID, 0, var8, 8, var9 + 1, var3); -+ this.placeBlockAtCurrentPosition(par1World, Block.fence.blockID, 0, var8 - 1, 9, var9, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.fence.blockID, 0, var8, 9, var9, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.fence.blockID, 0, var8 - 1, 8, var9, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.fence.blockID, 0, var8, 8, var9, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.fence.blockID, 0, var8 - 1, 7, var9, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.fence.blockID, 0, var8, 7, var9, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.fence.blockID, 0, var8 - 2, 7, var9, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.fence.blockID, 0, var8 + 1, 7, var9, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.fence.blockID, 0, var8 - 1, 7, var9 - 1, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.fence.blockID, 0, var8 - 1, 7, var9 + 1, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.fence.blockID, 0, var8, 7, var9 - 1, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.fence.blockID, 0, var8, 7, var9 + 1, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.torchWood.blockID, 0, var8 - 2, 8, var9, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.torchWood.blockID, 0, var8 + 1, 8, var9, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.torchWood.blockID, 0, var8 - 1, 8, var9 - 1, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.torchWood.blockID, 0, var8 - 1, 8, var9 + 1, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.torchWood.blockID, 0, var8, 8, var9 - 1, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.torchWood.blockID, 0, var8, 8, var9 + 1, par3StructureBoundingBox); - } - -- this.generateStructureChestContents(var1, var3, var2, 3, 3, 5, WeightedRandomChestContent.func_92080_a(strongholdLibraryChestContents, new WeightedRandomChestContent[]{Item.enchantedBook.func_92112_a(var2, 1, 5, 2)}), 1 + var2.nextInt(4)); -- if(this.isLargeRoom) { -- this.placeBlockAtCurrentPosition(var1, 0, 0, 12, 9, 1, var3); -- this.generateStructureChestContents(var1, var3, var2, 12, 8, 1, WeightedRandomChestContent.func_92080_a(strongholdLibraryChestContents, new WeightedRandomChestContent[]{Item.enchantedBook.func_92112_a(var2, 1, 5, 2)}), 1 + var2.nextInt(4)); -+ this.generateStructureChestContents(par1World, par3StructureBoundingBox, par2Random, 3, 3, 5, WeightedRandomChestContent.func_92080_a(strongholdLibraryChestContents, new WeightedRandomChestContent[] {Item.enchantedBook.func_92112_a(par2Random, 1, 5, 2)}), 1 + par2Random.nextInt(4)); -+ -+ if (this.isLargeRoom) { -+ this.placeBlockAtCurrentPosition(par1World, 0, 0, 12, 9, 1, par3StructureBoundingBox); -+ this.generateStructureChestContents(par1World, par3StructureBoundingBox, par2Random, 12, 8, 1, WeightedRandomChestContent.func_92080_a(strongholdLibraryChestContents, new WeightedRandomChestContent[] {Item.enchantedBook.func_92112_a(par2Random, 1, 5, 2)}), 1 + par2Random.nextInt(4)); - } - - return true; ---- net/minecraft/src/TileEntityDropper.java -+++ net/minecraft/src/TileEntityDropper.java -@@ -1,7 +1,11 @@ - package net.minecraft.src; - - public class TileEntityDropper extends TileEntityDispenser { -+ -+ /** -+ * Returns the name of the inventory. -+ */ - public String getInvName() { -- return this.isInvNameLocalized() ? this.a : "container.dropper"; -+ return this.isInvNameLocalized() ? this.customName : "container.dropper"; - } - } ---- /dev/null -+++ org/spoutcraft/api/gui/GenericTexture.java -@@ -1,0 +1,160 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.api.gui; -+ -+import java.io.IOException; -+ -+import org.spoutcraft.api.Spoutcraft; -+import org.spoutcraft.api.UnsafeClass; -+import org.spoutcraft.api.io.SpoutInputStream; -+import org.spoutcraft.api.io.SpoutOutputStream; -+ -+@UnsafeClass -+public class GenericTexture extends GenericWidget implements Texture { -+ protected String url = null; -+ protected boolean drawAlpha = false; -+ protected int top = -1; -+ protected int left = -1; -+ protected Runnable finishDelegate = null; -+ protected int originalWidth = -1, originalHeight = -1; -+ protected boolean local = false; -+ -+ public GenericTexture() { -+ } -+ -+ public GenericTexture(String url) { -+ setUrl(url); -+ } -+ -+ public WidgetType getType() { -+ return WidgetType.Texture; -+ } -+ -+ @Override -+ public int getVersion() { -+ return super.getVersion() + 3; -+ } -+ -+ @Override -+ public void readData(SpoutInputStream input) throws IOException { -+ super.readData(input); -+ this.setUrl(input.readString()); -+ this.setDrawAlphaChannel(input.readBoolean()); -+ setTop(input.readShort()); -+ setLeft(input.readShort()); -+ } -+ -+ @Override -+ public void writeData(SpoutOutputStream output) throws IOException { -+ super.writeData(output); -+ output.writeString(getUrl()); -+ output.writeBoolean(isDrawingAlphaChannel()); -+ output.writeShort((short) top); -+ output.writeShort((short) left); -+ } -+ -+ public void render() { -+ Spoutcraft.getClient().getRenderDelegate().render(this); -+ } -+ -+ public String getUrl() { -+ return url; -+ } -+ -+ public Texture setUrl(String url) { -+ this.url = url; -+ if (getUrl() != null) { -+ Spoutcraft.getClient().getRenderDelegate().downloadTexture(getAddon(), getUrl()); -+ } -+ return this; -+ } -+ -+ @Override -+ public Texture copy() { -+ return ((Texture)super.copy()).setUrl(getUrl()).setTop(getTop()).setLeft(getLeft()); -+ } -+ -+ public boolean isDrawingAlphaChannel() { -+ return drawAlpha; -+ } -+ -+ public Texture setDrawAlphaChannel(boolean draw) { -+ this.drawAlpha = draw; -+ return this; -+ } -+ -+ public Texture setTop(int top) { -+ if (getTop() != top) { -+ this.top = top; -+ } -+ return this; -+ } -+ -+ public int getTop() { -+ return top; -+ } -+ -+ public Texture setLeft(int left) { -+ if (getLeft() != left) { -+ this.left = left; -+ } -+ return this; -+ } -+ -+ public int getLeft() { -+ return left; -+ } -+ -+ public Runnable getFinishDelegate() { -+ return finishDelegate; -+ } -+ -+ public GenericTexture setFinishDelegate(Runnable finishDelegate) { -+ this.finishDelegate = finishDelegate; -+ return this; -+ } -+ -+ public int getOriginalWidth() { -+ return originalWidth; -+ } -+ -+ public GenericTexture setOriginalWidth(int originalWidth) { -+ this.originalWidth = originalWidth; -+ return this; -+ } -+ -+ public int getOriginalHeight() { -+ return originalHeight; -+ } -+ -+ public GenericTexture setOriginalHeight(int originalHeight) { -+ this.originalHeight = originalHeight; -+ return this; -+ } -+ -+ public boolean isLocal() { -+ return local; -+ } -+ -+ public GenericTexture setLocal(boolean value) { -+ local = value; -+ return this; -+ } -+} ---- net/minecraft/src/WorldGeneratorBonusChest.java -+++ net/minecraft/src/WorldGeneratorBonusChest.java -@@ -3,61 +3,68 @@ - import java.util.Random; - - public class WorldGeneratorBonusChest extends WorldGenerator { -+ -+ /** -+ * Instance of WeightedRandomChestContent what will randomly generate items into the Bonus Chest. -+ */ - private final WeightedRandomChestContent[] theBonusChestGenerator; -+ -+ /** -+ * Value of this int will determine how much items gonna generate in Bonus Chest. -+ */ - private final int itemsToGenerateInBonusChest; - -- public WorldGeneratorBonusChest(WeightedRandomChestContent[] var1, int var2) { -- this.theBonusChestGenerator = var1; -- this.itemsToGenerateInBonusChest = var2; -+ public WorldGeneratorBonusChest(WeightedRandomChestContent[] par1ArrayOfWeightedRandomChestContent, int par2) { -+ this.theBonusChestGenerator = par1ArrayOfWeightedRandomChestContent; -+ this.itemsToGenerateInBonusChest = par2; - } - -- public boolean generate(World var1, Random var2, int var3, int var4, int var5) { -- boolean var6 = false; -- -- while(true) { -- int var12 = var1.getBlockId(var3, var4, var5); -- if(var12 != 0 && var12 != Block.leaves.blockID || var4 <= 1) { -- if(var4 < 1) { -- return false; -- } else { -- ++var4; -- -- for(int var7 = 0; var7 < 4; ++var7) { -- int var8 = var3 + var2.nextInt(4) - var2.nextInt(4); -- int var9 = var4 + var2.nextInt(3) - var2.nextInt(3); -- int var10 = var5 + var2.nextInt(4) - var2.nextInt(4); -- if(var1.isAirBlock(var8, var9, var10) && var1.doesBlockHaveSolidTopSurface(var8, var9 - 1, var10)) { -- var1.setBlock(var8, var9, var10, Block.chest.blockID, 0, 2); -- TileEntityChest var11 = (TileEntityChest)var1.getBlockTileEntity(var8, var9, var10); -- if(var11 != null && var11 != null) { -- WeightedRandomChestContent.generateChestContents(var2, this.theBonusChestGenerator, var11, this.itemsToGenerateInBonusChest); -- } -- -- if(var1.isAirBlock(var8 - 1, var9, var10) && var1.doesBlockHaveSolidTopSurface(var8 - 1, var9 - 1, var10)) { -- var1.setBlock(var8 - 1, var9, var10, Block.torchWood.blockID, 0, 2); -- } -- -- if(var1.isAirBlock(var8 + 1, var9, var10) && var1.doesBlockHaveSolidTopSurface(var8 - 1, var9 - 1, var10)) { -- var1.setBlock(var8 + 1, var9, var10, Block.torchWood.blockID, 0, 2); -- } -- -- if(var1.isAirBlock(var8, var9, var10 - 1) && var1.doesBlockHaveSolidTopSurface(var8 - 1, var9 - 1, var10)) { -- var1.setBlock(var8, var9, var10 - 1, Block.torchWood.blockID, 0, 2); -- } -- -- if(var1.isAirBlock(var8, var9, var10 + 1) && var1.doesBlockHaveSolidTopSurface(var8 - 1, var9 - 1, var10)) { -- var1.setBlock(var8, var9, var10 + 1, Block.torchWood.blockID, 0, 2); -- } -- -- return true; -- } -- } -- -- return false; -+ public boolean generate(World par1World, Random par2Random, int par3, int par4, int par5) { -+ int var12; -+ -+ for (boolean var6 = false; ((var12 = par1World.getBlockId(par3, par4, par5)) == 0 || var12 == Block.leaves.blockID) && par4 > 1; --par4) { -+ ; -+ } -+ -+ if (par4 < 1) { -+ return false; -+ } else { -+ ++par4; -+ -+ for (int var7 = 0; var7 < 4; ++var7) { -+ int var8 = par3 + par2Random.nextInt(4) - par2Random.nextInt(4); -+ int var9 = par4 + par2Random.nextInt(3) - par2Random.nextInt(3); -+ int var10 = par5 + par2Random.nextInt(4) - par2Random.nextInt(4); -+ -+ if (par1World.isAirBlock(var8, var9, var10) && par1World.doesBlockHaveSolidTopSurface(var8, var9 - 1, var10)) { -+ par1World.setBlock(var8, var9, var10, Block.chest.blockID, 0, 2); -+ TileEntityChest var11 = (TileEntityChest)par1World.getBlockTileEntity(var8, var9, var10); -+ -+ if (var11 != null && var11 != null) { -+ WeightedRandomChestContent.generateChestContents(par2Random, this.theBonusChestGenerator, var11, this.itemsToGenerateInBonusChest); -+ } -+ -+ if (par1World.isAirBlock(var8 - 1, var9, var10) && par1World.doesBlockHaveSolidTopSurface(var8 - 1, var9 - 1, var10)) { -+ par1World.setBlock(var8 - 1, var9, var10, Block.torchWood.blockID, 0, 2); -+ } -+ -+ if (par1World.isAirBlock(var8 + 1, var9, var10) && par1World.doesBlockHaveSolidTopSurface(var8 - 1, var9 - 1, var10)) { -+ par1World.setBlock(var8 + 1, var9, var10, Block.torchWood.blockID, 0, 2); -+ } -+ -+ if (par1World.isAirBlock(var8, var9, var10 - 1) && par1World.doesBlockHaveSolidTopSurface(var8 - 1, var9 - 1, var10)) { -+ par1World.setBlock(var8, var9, var10 - 1, Block.torchWood.blockID, 0, 2); -+ } -+ -+ if (par1World.isAirBlock(var8, var9, var10 + 1) && par1World.doesBlockHaveSolidTopSurface(var8 - 1, var9 - 1, var10)) { -+ par1World.setBlock(var8, var9, var10 + 1, Block.torchWood.blockID, 0, 2); -+ } -+ -+ return true; - } - } - -- --var4; -+ return false; - } - } - } ---- net/minecraft/src/IntegratedPlayerList.java -+++ net/minecraft/src/IntegratedPlayerList.java -@@ -4,30 +4,46 @@ - import net.minecraft.server.MinecraftServer; - - public class IntegratedPlayerList extends ServerConfigurationManager { -+ -+ /** -+ * Holds the NBT data for the host player's save file, so this can be written to level.dat. -+ */ - private NBTTagCompound hostPlayerData; - -- public IntegratedPlayerList(IntegratedServer var1) { -- super(var1); -+ public IntegratedPlayerList(IntegratedServer par1IntegratedServer) { -+ super(par1IntegratedServer); - this.viewDistance = 10; - } - -- protected void writePlayerData(EntityPlayerMP var1) { -- if(var1.getCommandSenderName().equals(this.getIntegratedServer().getServerOwner())) { -+ /** -+ * also stores the NBTTags if this is an intergratedPlayerList -+ */ -+ protected void writePlayerData(EntityPlayerMP par1EntityPlayerMP) { -+ if (par1EntityPlayerMP.getCommandSenderName().equals(this.getIntegratedServer().getServerOwner())) { - this.hostPlayerData = new NBTTagCompound(); -- var1.writeToNBT(this.hostPlayerData); -+ par1EntityPlayerMP.writeToNBT(this.hostPlayerData); - } - -- super.writePlayerData(var1); -- } -- -- public String allowUserToConnect(SocketAddress var1, String var2) { -- return var2.equalsIgnoreCase(this.getIntegratedServer().getServerOwner()) ? "That name is already taken." : super.allowUserToConnect(var1, var2); -- } -- -+ super.writePlayerData(par1EntityPlayerMP); -+ } -+ -+ /** -+ * checks ban-lists, then white-lists, then space for the server. Returns null on success, or an error message -+ */ -+ public String allowUserToConnect(SocketAddress par1SocketAddress, String par2Str) { -+ return par2Str.equalsIgnoreCase(this.getIntegratedServer().getServerOwner()) ? "That name is already taken." : super.allowUserToConnect(par1SocketAddress, par2Str); -+ } -+ -+ /** -+ * get the associated Integrated Server -+ */ - public IntegratedServer getIntegratedServer() { - return (IntegratedServer)super.getServerInstance(); - } - -+ /** -+ * On integrated servers, returns the host's player data to be written to level.dat. -+ */ - public NBTTagCompound getHostPlayerData() { - return this.hostPlayerData; - } ---- net/minecraft/src/RenderTntMinecart.java -+++ net/minecraft/src/RenderTntMinecart.java -@@ -3,15 +3,17 @@ - import org.lwjgl.opengl.GL11; - - public class RenderTntMinecart extends RenderMinecart { -- protected void func_94146_a(EntityMinecartTNT var1, float var2, Block var3, int var4) { -- int var5 = var1.func_94104_d(); -- if(var5 > -1 && (float)var5 - var2 + 1.0F < 10.0F) { -- float var6 = 1.0F - ((float)var5 - var2 + 1.0F) / 10.0F; -- if(var6 < 0.0F) { -+ protected void func_94146_a(EntityMinecartTNT par1EntityMinecartTNT, float par2, Block par3Block, int par4) { -+ int var5 = par1EntityMinecartTNT.func_94104_d(); -+ -+ if (var5 > -1 && (float)var5 - par2 + 1.0F < 10.0F) { -+ float var6 = 1.0F - ((float)var5 - par2 + 1.0F) / 10.0F; -+ -+ if (var6 < 0.0F) { - var6 = 0.0F; - } - -- if(var6 > 1.0F) { -+ if (var6 > 1.0F) { - var6 = 1.0F; - } - -@@ -21,13 +23,14 @@ - GL11.glScalef(var7, var7, var7); - } - -- super.renderBlockInMinecart(var1, var2, var3, var4); -- if(var5 > -1 && var5 / 5 % 2 == 0) { -+ super.renderBlockInMinecart(par1EntityMinecartTNT, par2, par3Block, par4); -+ -+ if (var5 > -1 && var5 / 5 % 2 == 0) { - GL11.glDisable(GL11.GL_TEXTURE_2D); - GL11.glDisable(GL11.GL_LIGHTING); - GL11.glEnable(GL11.GL_BLEND); - GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_DST_ALPHA); -- GL11.glColor4f(1.0F, 1.0F, 1.0F, (1.0F - ((float)var5 - var2 + 1.0F) / 100.0F) * 0.8F); -+ GL11.glColor4f(1.0F, 1.0F, 1.0F, (1.0F - ((float)var5 - par2 + 1.0F) / 100.0F) * 0.8F); - GL11.glPushMatrix(); - this.field_94145_f.renderBlockAsItem(Block.tnt, 0, 1.0F); - GL11.glPopMatrix(); -@@ -36,10 +39,12 @@ - GL11.glEnable(GL11.GL_LIGHTING); - GL11.glEnable(GL11.GL_TEXTURE_2D); - } -- - } - -- protected void renderBlockInMinecart(EntityMinecart var1, float var2, Block var3, int var4) { -- this.func_94146_a((EntityMinecartTNT)var1, var2, var3, var4); -+ /** -+ * Renders the block that is inside the minecart. -+ */ -+ protected void renderBlockInMinecart(EntityMinecart par1EntityMinecart, float par2, Block par3Block, int par4) { -+ this.func_94146_a((EntityMinecartTNT)par1EntityMinecart, par2, par3Block, par4); - } - } ---- net/minecraft/src/PortalPosition.java -+++ net/minecraft/src/PortalPosition.java -@@ -1,12 +1,16 @@ - package net.minecraft.src; - - public class PortalPosition extends ChunkCoordinates { -+ -+ /** The worldtime at which this PortalPosition was last verified */ - public long lastUpdateTime; -+ -+ /** The teleporter to which this PortalPosition applies */ - final Teleporter teleporterInstance; - -- public PortalPosition(Teleporter var1, int var2, int var3, int var4, long var5) { -- super(var2, var3, var4); -- this.teleporterInstance = var1; -- this.lastUpdateTime = var5; -+ public PortalPosition(Teleporter par1Teleporter, int par2, int par3, int par4, long par5) { -+ super(par2, par3, par4); -+ this.teleporterInstance = par1Teleporter; -+ this.lastUpdateTime = par5; - } - } ---- /dev/null -+++ org/spoutcraft/client/gui/settings/controls/DisplayCustomParticlesButton.java -@@ -1,0 +1,38 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.client.gui.settings.controls; -+ -+import net.minecraft.src.Minecraft; -+ -+import org.spoutcraft.client.config.Configuration; -+ -+public class DisplayCustomParticlesButton extends AutomatedCheckBox { -+ public DisplayCustomParticlesButton() { -+ super("Display Custom Particles"); -+ setChecked(Configuration.isDisplayCustomParticles()); -+ setTooltip("Displays the particles when breaking custom blocks or items!\nNot working 100% correctly yet..."); -+ } -+ -+ @Override -+ public void onButtonClick() { -+ Configuration.setDisplayCustomParticles(!Configuration.isDisplayCustomParticles()); -+ Configuration.write(); -+ } -+} ---- net/minecraft/src/AchievementMap.java -+++ net/minecraft/src/AchievementMap.java -@@ -6,31 +6,34 @@ - import java.util.Map; - - public class AchievementMap { -+ -+ /** Holds the singleton instance of AchievementMap. */ - public static AchievementMap instance = new AchievementMap(); -- private Map b = new HashMap(); -+ -+ /** Maps a achievement id with it's unique GUID. */ -+ private Map guidMap = new HashMap(); - - private AchievementMap() { - try { - BufferedReader var1 = new BufferedReader(new InputStreamReader(AchievementMap.class.getResourceAsStream("/achievement/map.txt"))); -- -- while(true) { -- String var2 = var1.readLine(); -- if(var2 == null) { -- var1.close(); -- break; -- } -- -+ String var2; -+ -+ while ((var2 = var1.readLine()) != null) { - String[] var3 = var2.split(","); - int var4 = Integer.parseInt(var3[0]); -- this.b.put(Integer.valueOf(var4), var3[1]); -+ this.guidMap.put(Integer.valueOf(var4), var3[1]); - } -+ -+ var1.close(); - } catch (Exception var5) { - var5.printStackTrace(); - } -- - } - -- public static String getGuid(int var0) { -- return (String)instance.b.get(Integer.valueOf(var0)); -+ /** -+ * Returns the unique GUID of a achievement id. -+ */ -+ public static String getGuid(int par0) { -+ return (String)instance.guidMap.get(Integer.valueOf(par0)); - } - } ---- /dev/null -+++ org/spoutcraft/client/packet/PacketGenericFood.java -@@ -1,0 +1,52 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.client.packet; -+ -+import java.io.IOException; -+ -+import org.spoutcraft.api.io.SpoutInputStream; -+import org.spoutcraft.api.io.SpoutOutputStream; -+import org.spoutcraft.api.material.item.GenericCustomFood; -+ -+public class PacketGenericFood implements SpoutPacket { -+ GenericCustomFood item = new GenericCustomFood(); -+ -+ public void readData(SpoutInputStream input) throws IOException { -+ item.readData(input); -+ } -+ -+ public void writeData(SpoutOutputStream output) throws IOException { -+ item.writeData(output); -+ } -+ -+ public void run(int playerId) { -+ } -+ -+ public void failure(int playerId) { -+ } -+ -+ public PacketType getPacketType() { -+ return PacketType.PacketGenericFood; -+ } -+ -+ public int getVersion() { -+ return item.getVersion(); -+ } -+} ---- net/minecraft/src/Packet.java -+++ net/minecraft/src/Packet.java -@@ -9,157 +9,232 @@ - import java.util.HashSet; - import java.util.Map; - import java.util.Set; -+ - import net.minecraft.server.MinecraftServer; - - public abstract class Packet { -+ -+ /** Maps packet id to packet class */ - public static IntHashMap packetIdToClassMap = new IntHashMap(); -- private static Map a = new HashMap(); -- private static Set b = new HashSet(); -- private static Set c = new HashSet(); -+ -+ /** Maps packet class to packet id */ -+ private static Map packetClassToIdMap = new HashMap(); -+ -+ /** List of the client's packet IDs. */ -+ private static Set clientPacketIdList = new HashSet(); -+ -+ /** List of the server's packet IDs. */ -+ private static Set serverPacketIdList = new HashSet(); - protected ILogAgent field_98193_m; -- public final long creationTimeMillis = MinecraftServer.getCurrentTimeMillis(); -+ -+ /** the system time in milliseconds when this packet was created. */ -+ public final long creationTimeMillis = MinecraftServer.getSystemTimeMillis(); - public static long receivedID; - public static long receivedSize; -+ -+ /** Assumed to be sequential by the profiler. */ - public static long sentID; - public static long sentSize; -+ -+ /** -+ * Only true for Packet51MapChunk, Packet52MultiBlockChange, Packet53BlockChange and Packet59ComplexEntity. Used to -+ * separate them into a different send queue. -+ */ - public boolean isChunkDataPacket; - -- static void addIdClassMapping(int var0, boolean var1, boolean var2, Class var3) { -- if(packetIdToClassMap.containsItem(var0)) { -- throw new IllegalArgumentException("Duplicate packet id:" + var0); -- } else if(a.containsKey(var3)) { -- throw new IllegalArgumentException("Duplicate packet class:" + var3); -+ /** -+ * Adds a two way mapping between the packet ID and packet class. -+ */ -+ // Spout Start - static to public static -+ public static void addIdClassMapping(int par0, boolean par1, boolean par2, Class par3Class) { -+ // Spout End -+ if (packetIdToClassMap.containsItem(par0)) { -+ throw new IllegalArgumentException("Duplicate packet id:" + par0); -+ } else if (packetClassToIdMap.containsKey(par3Class)) { -+ throw new IllegalArgumentException("Duplicate packet class:" + par3Class); - } else { -- packetIdToClassMap.addKey(var0, var3); -- a.put(var3, Integer.valueOf(var0)); -- if(var1) { -- b.add(Integer.valueOf(var0)); -- } -- -- if(var2) { -- c.add(Integer.valueOf(var0)); -- } -- -+ packetIdToClassMap.addKey(par0, par3Class); -+ packetClassToIdMap.put(par3Class, Integer.valueOf(par0)); -+ -+ if (par1) { -+ clientPacketIdList.add(Integer.valueOf(par0)); -+ } -+ -+ if (par2) { -+ serverPacketIdList.add(Integer.valueOf(par0)); -+ } - } - } - -- public static Packet getNewPacket(ILogAgent var0, int var1) { -+ /** -+ * Returns a new instance of the specified Packet class. -+ */ -+ public static Packet getNewPacket(ILogAgent par0ILogAgent, int par1) { - try { -- Class var2 = (Class)packetIdToClassMap.lookup(var1); -+ Class var2 = (Class)packetIdToClassMap.lookup(par1); - return var2 == null ? null : (Packet)var2.newInstance(); - } catch (Exception var3) { - var3.printStackTrace(); -- var0.logSevere("Skipping packet with id " + var1); -+ par0ILogAgent.logSevere("Skipping packet with id " + par1); - return null; - } - } - -- public static void writeByteArray(DataOutput var0, byte[] var1) throws IOException { -- var0.writeShort(var1.length); -- var0.write(var1); -+ /** -+ * Writes a byte array to the DataOutputStream -+ */ -+ public static void writeByteArray(DataOutput par0DataOutput, byte[] par1ArrayOfByte) throws IOException { -+ par0DataOutput.writeShort(par1ArrayOfByte.length); -+ par0DataOutput.write(par1ArrayOfByte); - } - -- public static byte[] readBytesFromStream(DataInput var0) throws IOException { -- short var1 = var0.readShort(); -- if(var1 < 0) { -+ /** -+ * the first short in the stream indicates the number of bytes to read -+ */ -+ public static byte[] readBytesFromStream(DataInput par0DataInput) throws IOException { -+ short var1 = par0DataInput.readShort(); -+ -+ if (var1 < 0) { - throw new IOException("Key was smaller than nothing! Weird key!"); - } else { - byte[] var2 = new byte[var1]; -- var0.readFully(var2); -+ par0DataInput.readFully(var2); - return var2; - } - } - -+ /** -+ * Returns the ID of this packet. -+ */ - public final int getPacketId() { -- return ((Integer)a.get(this.getClass())).intValue(); -+ return ((Integer)packetClassToIdMap.get(this.getClass())).intValue(); - } - -- public static Packet readPacket(ILogAgent var0, DataInput var1, boolean var2, Socket var3) throws IOException { -+ /** -+ * Read a packet, prefixed by its ID, from the data stream. -+ */ -+ public static Packet readPacket(ILogAgent par0ILogAgent, DataInput par1DataInput, boolean par2, Socket par3Socket) throws IOException { - boolean var4 = false; - Packet var5 = null; -- int var6 = var3.getSoTimeout(); -- -+ int var6 = par3Socket.getSoTimeout(); - int var9; -+ - try { -- var9 = var1.readUnsignedByte(); -- if(var2 && !c.contains(Integer.valueOf(var9)) || !var2 && !b.contains(Integer.valueOf(var9))) { -- throw new IOException("Bad packet id " + var9); -- } -- -- var5 = getNewPacket(var0, var9); -- if(var5 == null) { -- throw new IOException("Bad packet id " + var9); -- } -- -- var5.field_98193_m = var0; -- if(var5 instanceof Packet254ServerPing) { -- var3.setSoTimeout(1500); -- } -- -- var5.readPacketData(var1); -+ var9 = par1DataInput.readUnsignedByte(); -+ -+ if (par2 && !serverPacketIdList.contains(Integer.valueOf(var9)) || !par2 && !clientPacketIdList.contains(Integer.valueOf(var9))) { -+ throw new IOException("Bad packet id " + var9); -+ } -+ -+ var5 = getNewPacket(par0ILogAgent, var9); -+ -+ if (var5 == null) { -+ throw new IOException("Bad packet id " + var9); -+ } -+ -+ var5.field_98193_m = par0ILogAgent; -+ -+ if (var5 instanceof Packet254ServerPing) { -+ par3Socket.setSoTimeout(1500); -+ } -+ -+ var5.readPacketData(par1DataInput); - ++receivedID; - receivedSize += (long)var5.getPacketSize(); - } catch (EOFException var8) { -- var0.logSevere("Reached end of stream for " + var3.getInetAddress()); -+ par0ILogAgent.logSevere("Reached end of stream for " + par3Socket.getInetAddress()); - return null; - } - - PacketCount.countPacket(var9, (long)var5.getPacketSize()); - ++receivedID; - receivedSize += (long)var5.getPacketSize(); -- var3.setSoTimeout(var6); -+ par3Socket.setSoTimeout(var6); - return var5; - } - -- public static void writePacket(Packet var0, DataOutput var1) throws IOException { -- var1.write(var0.getPacketId()); -- var0.writePacketData(var1); -+ /** -+ * Writes a packet, prefixed by its ID, to the data stream. -+ */ -+ public static void writePacket(Packet par0Packet, DataOutput par1DataOutput) throws IOException { -+ par1DataOutput.write(par0Packet.getPacketId()); -+ par0Packet.writePacketData(par1DataOutput); - ++sentID; -- sentSize += (long)var0.getPacketSize(); -+ sentSize += (long)par0Packet.getPacketSize(); - } - -- public static void writeString(String var0, DataOutput var1) throws IOException { -- if(var0.length() > Short.MAX_VALUE) { -+ /** -+ * Writes a String to the DataOutputStream -+ */ -+ public static void writeString(String par0Str, DataOutput par1DataOutput) throws IOException { -+ if (par0Str.length() > 32767) { - throw new IOException("String too big"); - } else { -- var1.writeShort(var0.length()); -- var1.writeChars(var0); -+ par1DataOutput.writeShort(par0Str.length()); -+ par1DataOutput.writeChars(par0Str); - } - } - -- public static String readString(DataInput var0, int var1) throws IOException { -- short var2 = var0.readShort(); -- if(var2 > var1) { -- throw new IOException("Received string length longer than maximum allowed (" + var2 + " > " + var1 + ")"); -- } else if(var2 < 0) { -+ /** -+ * Reads a string from a packet -+ */ -+ public static String readString(DataInput par0DataInput, int par1) throws IOException { -+ short var2 = par0DataInput.readShort(); -+ -+ if (var2 > par1) { -+ throw new IOException("Received string length longer than maximum allowed (" + var2 + " > " + par1 + ")"); -+ } else if (var2 < 0) { - throw new IOException("Received string length is less than zero! Weird string!"); - } else { - StringBuilder var3 = new StringBuilder(); - -- for(int var4 = 0; var4 < var2; ++var4) { -- var3.append(var0.readChar()); -+ for (int var4 = 0; var4 < var2; ++var4) { -+ var3.append(par0DataInput.readChar()); - } - - return var3.toString(); - } - } - -+ /** -+ * Abstract. Reads the raw packet data from the data stream. -+ */ - public abstract void readPacketData(DataInput var1) throws IOException; - -+ /** -+ * Abstract. Writes the raw packet data to the data stream. -+ */ - public abstract void writePacketData(DataOutput var1) throws IOException; - -+ /** -+ * Passes this Packet on to the NetHandler for processing. -+ */ - public abstract void processPacket(NetHandler var1); - -+ /** -+ * Abstract. Return the size of the packet (not counting the header). -+ */ - public abstract int getPacketSize(); - -+ /** -+ * only false for the abstract Packet class, all real packets return true -+ */ - public boolean isRealPacket() { - return false; - } - -- public boolean containsSameEntityIDAs(Packet var1) { -+ /** -+ * eg return packet30entity.entityId == entityId; WARNING : will throw if you compare a packet to a different packet -+ * class -+ */ -+ public boolean containsSameEntityIDAs(Packet par1Packet) { - return false; - } - -+ /** -+ * If this returns true, the packet may be processed on any thread; otherwise it is queued for the main thread to -+ * handle. -+ */ - public boolean canProcessAsync() { - return false; - } -@@ -169,56 +244,69 @@ - return var1; - } - -- public static ItemStack readItemStack(DataInput var0) throws IOException { -+ /** -+ * Reads a ItemStack from the InputStream -+ */ -+ public static ItemStack readItemStack(DataInput par0DataInput) throws IOException { - ItemStack var1 = null; -- short var2 = var0.readShort(); -- if(var2 >= 0) { -- byte var3 = var0.readByte(); -- short var4 = var0.readShort(); -+ short var2 = par0DataInput.readShort(); -+ -+ if (var2 >= 0) { -+ byte var3 = par0DataInput.readByte(); -+ short var4 = par0DataInput.readShort(); - var1 = new ItemStack(var2, var3, var4); -- var1.stackTagCompound = readNBTTagCompound(var0); -+ var1.stackTagCompound = readNBTTagCompound(par0DataInput); - } - - return var1; - } - -- public static void writeItemStack(ItemStack var0, DataOutput var1) throws IOException { -- if(var0 == null) { -- var1.writeShort(-1); -+ /** -+ * Writes the ItemStack's ID (short), then size (byte), then damage. (short) -+ */ -+ public static void writeItemStack(ItemStack par0ItemStack, DataOutput par1DataOutput) throws IOException { -+ if (par0ItemStack == null) { -+ par1DataOutput.writeShort(-1); - } else { -- var1.writeShort(var0.itemID); -- var1.writeByte(var0.stackSize); -- var1.writeShort(var0.getItemDamage()); -+ par1DataOutput.writeShort(par0ItemStack.itemID); -+ par1DataOutput.writeByte(par0ItemStack.stackSize); -+ par1DataOutput.writeShort(par0ItemStack.getItemDamage()); - NBTTagCompound var2 = null; -- if(var0.getItem().isDamageable() || var0.getItem().getShareTag()) { -- var2 = var0.stackTagCompound; -+ -+ if (par0ItemStack.getItem().isDamageable() || par0ItemStack.getItem().getShareTag()) { -+ var2 = par0ItemStack.stackTagCompound; - } - -- writeNBTTagCompound(var2, var1); -+ writeNBTTagCompound(var2, par1DataOutput); - } -- - } - -- public static NBTTagCompound readNBTTagCompound(DataInput var0) throws IOException { -- short var1 = var0.readShort(); -- if(var1 < 0) { -+ /** -+ * Reads a compressed NBTTagCompound from the InputStream -+ */ -+ public static NBTTagCompound readNBTTagCompound(DataInput par0DataInput) throws IOException { -+ short var1 = par0DataInput.readShort(); -+ -+ if (var1 < 0) { - return null; - } else { - byte[] var2 = new byte[var1]; -- var0.readFully(var2); -+ par0DataInput.readFully(var2); - return CompressedStreamTools.decompress(var2); - } - } - -- protected static void writeNBTTagCompound(NBTTagCompound var0, DataOutput var1) throws IOException { -- if(var0 == null) { -- var1.writeShort(-1); -+ /** -+ * Writes a compressed NBTTagCompound to the OutputStream -+ */ -+ protected static void writeNBTTagCompound(NBTTagCompound par0NBTTagCompound, DataOutput par1DataOutput) throws IOException { -+ if (par0NBTTagCompound == null) { -+ par1DataOutput.writeShort(-1); - } else { -- byte[] var2 = CompressedStreamTools.compress(var0); -- var1.writeShort((short)var2.length); -- var1.write(var2); -+ byte[] var2 = CompressedStreamTools.compress(par0NBTTagCompound); -+ par1DataOutput.writeShort((short)var2.length); -+ par1DataOutput.write(var2); - } -- - } - - static { ---- net/minecraft/src/GuiScreenBackupSelectionList.java -+++ net/minecraft/src/GuiScreenBackupSelectionList.java -@@ -7,26 +7,35 @@ - class GuiScreenBackupSelectionList extends GuiScreenSelectLocation { - final GuiScreenBackup field_111249_a; - -- public GuiScreenBackupSelectionList(GuiScreenBackup var1) { -- super(GuiScreenBackup.func_130036_f(var1), var1.width, var1.height, 32, var1.height - 64, 36); -- this.field_111249_a = var1; -+ public GuiScreenBackupSelectionList(GuiScreenBackup par1GuiScreenBackup) { -+ super(GuiScreenBackup.func_130036_f(par1GuiScreenBackup), par1GuiScreenBackup.width, par1GuiScreenBackup.height, 32, par1GuiScreenBackup.height - 64, 36); -+ this.field_111249_a = par1GuiScreenBackup; - } - -+ /** -+ * Gets the size of the current slot list. -+ */ - protected int getSize() { - return GuiScreenBackup.func_110370_e(this.field_111249_a).size() + 1; - } - -- protected void elementClicked(int var1, boolean var2) { -- if(var1 < GuiScreenBackup.func_110370_e(this.field_111249_a).size()) { -- GuiScreenBackup.func_130029_a(this.field_111249_a, var1); -+ /** -+ * the element in the slot that was clicked, boolean for wether it was double clicked or not -+ */ -+ protected void elementClicked(int par1, boolean par2) { -+ if (par1 < GuiScreenBackup.func_110370_e(this.field_111249_a).size()) { -+ GuiScreenBackup.func_130029_a(this.field_111249_a, par1); - } - } - -- protected boolean isSelected(int var1) { -- return var1 == GuiScreenBackup.func_130034_h(this.field_111249_a); -+ /** -+ * returns true if the element passed in is currently selected -+ */ -+ protected boolean isSelected(int par1) { -+ return par1 == GuiScreenBackup.func_130034_h(this.field_111249_a); - } - -- protected boolean func_104086_b(int var1) { -+ protected boolean func_104086_b(int par1) { - return false; - } - -@@ -38,36 +47,37 @@ - this.field_111249_a.drawDefaultBackground(); - } - -- protected void drawSlot(int var1, int var2, int var3, int var4, Tessellator var5) { -- if(var1 < GuiScreenBackup.func_110370_e(this.field_111249_a).size()) { -- this.func_111246_b(var1, var2, var3, var4, var5); -+ protected void drawSlot(int par1, int par2, int par3, int par4, Tessellator par5Tessellator) { -+ if (par1 < GuiScreenBackup.func_110370_e(this.field_111249_a).size()) { -+ this.func_111246_b(par1, par2, par3, par4, par5Tessellator); - } -- -- } -- -- private void func_111246_b(int var1, int var2, int var3, int var4, Tessellator var5) { -- Backup var6 = (Backup)GuiScreenBackup.func_110370_e(this.field_111249_a).get(var1); -- this.field_111249_a.drawString(GuiScreenBackup.func_130032_i(this.field_111249_a), "Backup (" + this.func_111248_a(Long.valueOf(MinecraftServer.getCurrentTimeMillis() - var6.b.getTime())) + ")", var2 + 2, var3 + 1, 16777215); -- this.field_111249_a.drawString(GuiScreenBackup.func_130033_j(this.field_111249_a), this.func_111247_a(var6.b), var2 + 2, var3 + 12, 7105644); -- } -- -- private String func_111247_a(Date var1) { -- return DateFormat.getDateTimeInstance(3, 3).format(var1); -- } -- -- private String func_111248_a(Long var1) { -- if(var1.longValue() < 0L) { -+ } -+ -+ private void func_111246_b(int par1, int par2, int par3, int par4, Tessellator par5Tessellator) { -+ Backup var6 = (Backup)GuiScreenBackup.func_110370_e(this.field_111249_a).get(par1); -+ this.field_111249_a.drawString(GuiScreenBackup.func_130032_i(this.field_111249_a), "Backup (" + this.func_111248_a(Long.valueOf(MinecraftServer.getSystemTimeMillis() - var6.field_110725_b.getTime())) + ")", par2 + 2, par3 + 1, 16777215); -+ this.field_111249_a.drawString(GuiScreenBackup.func_130033_j(this.field_111249_a), this.func_111247_a(var6.field_110725_b), par2 + 2, par3 + 12, 7105644); -+ } -+ -+ private String func_111247_a(Date par1Date) { -+ return DateFormat.getDateTimeInstance(3, 3).format(par1Date); -+ } -+ -+ private String func_111248_a(Long par1) { -+ if (par1.longValue() < 0L) { - return "right now"; - } else { -- long var2 = var1.longValue() / 1000L; -- if(var2 < 60L) { -+ long var2 = par1.longValue() / 1000L; -+ -+ if (var2 < 60L) { - return (var2 == 1L ? "1 second" : var2 + " seconds") + " ago"; - } else { - long var4; -- if(var2 < 3600L) { -+ -+ if (var2 < 3600L) { - var4 = var2 / 60L; - return (var4 == 1L ? "1 minute" : var4 + " minutes") + " ago"; -- } else if(var2 < 86400L) { -+ } else if (var2 < 86400L) { - var4 = var2 / 3600L; - return (var4 == 1L ? "1 hour" : var4 + " hours") + " ago"; - } else { ---- /dev/null -+++ net/minecraft/src/GameWindowListener.java -@@ -1,0 +1,20 @@ -+package net.minecraft.src; -+ -+import java.awt.event.WindowAdapter; -+import java.awt.event.WindowEvent; -+ -+import org.spoutcraft.client.SpoutClient; -+ -+public final class GameWindowListener extends WindowAdapter { -+ public void windowClosing(WindowEvent par1WindowEvent) { -+ // Spout Start -+ SpoutClient.getHandle().shutdown(); -+ -+ try { -+ SpoutClient.getHandle().mainThread.join(10000L); -+ } catch (InterruptedException var4) { -+ } -+ System.exit(0); -+ // Spout End -+ } -+} ---- net/minecraft/src/ItemSeeds.java -+++ net/minecraft/src/ItemSeeds.java -@@ -1,24 +1,35 @@ - package net.minecraft.src; - - public class ItemSeeds extends Item { -+ -+ /** -+ * The type of block this seed turns into (wheat or pumpkin stems for instance) -+ */ - private int blockType; -+ -+ /** BlockID of the block the seeds can be planted on. */ - private int soilBlockID; - -- public ItemSeeds(int var1, int var2, int var3) { -- super(var1); -- this.blockType = var2; -- this.soilBlockID = var3; -+ public ItemSeeds(int par1, int par2, int par3) { -+ super(par1); -+ this.blockType = par2; -+ this.soilBlockID = par3; - this.setCreativeTab(CreativeTabs.tabMaterials); - } - -- public boolean onItemUse(ItemStack var1, EntityPlayer var2, World var3, int var4, int var5, int var6, int var7, float var8, float var9, float var10) { -- if(var7 != 1) { -+ /** -+ * Callback for item usage. If the item does something special on right clicking, he will have one of those. Return -+ * True if something happen and false if it don't. This is for ITEMS, not BLOCKS -+ */ -+ public boolean onItemUse(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, World par3World, int par4, int par5, int par6, int par7, float par8, float par9, float par10) { -+ if (par7 != 1) { - return false; -- } else if(var2.canPlayerEdit(var4, var5, var6, var7, var1) && var2.canPlayerEdit(var4, var5 + 1, var6, var7, var1)) { -- int var11 = var3.getBlockId(var4, var5, var6); -- if(var11 == this.soilBlockID && var3.isAirBlock(var4, var5 + 1, var6)) { -- var3.setBlock(var4, var5 + 1, var6, this.blockType); -- --var1.stackSize; -+ } else if (par2EntityPlayer.canPlayerEdit(par4, par5, par6, par7, par1ItemStack) && par2EntityPlayer.canPlayerEdit(par4, par5 + 1, par6, par7, par1ItemStack)) { -+ int var11 = par3World.getBlockId(par4, par5, par6); -+ -+ if (var11 == this.soilBlockID && par3World.isAirBlock(par4, par5 + 1, par6)) { -+ par3World.setBlock(par4, par5 + 1, par6, this.blockType); -+ --par1ItemStack.stackSize; - return true; - } else { - return false; ---- net/minecraft/src/TaskOnlineConnect.java -+++ net/minecraft/src/TaskOnlineConnect.java -@@ -7,9 +7,9 @@ - private final McoServer field_96585_c; - private final GuiScreen field_96584_d; - -- public TaskOnlineConnect(GuiScreen var1, McoServer var2) { -- this.field_96584_d = var1; -- this.field_96585_c = var2; -+ public TaskOnlineConnect(GuiScreen par1GuiScreen, McoServer par2McoServer) { -+ this.field_96584_d = par1GuiScreen; -+ this.field_96585_c = par2McoServer; - } - - public void run() { -@@ -20,7 +20,7 @@ - int var4 = 5; - McoServerAddress var5 = null; - -- for(int var6 = 0; var6 < 10 && !this.wasScreenClosed(); ++var6) { -+ for (int var6 = 0; var6 < 10 && !this.wasScreenClosed(); ++var6) { - try { - var5 = var1.func_96374_a(this.field_96585_c.field_96408_a); - var2 = true; -@@ -38,53 +38,50 @@ - this.setFailedMessage(var11.getLocalizedMessage()); - } - -- if(var2) { -+ if (var2) { - break; - } - - this.func_111251_a(var4); - } - -- if(!this.wasScreenClosed() && !var3) { -- if(var2) { -- ServerAddress var12 = ServerAddress.func_78860_a(var5.a); -+ if (!this.wasScreenClosed() && !var3) { -+ if (var2) { -+ ServerAddress var12 = ServerAddress.func_78860_a(var5.field_96417_a); - this.func_96582_a(var12.getIP(), var12.getPort()); - } else { - this.getMinecraft().displayGuiScreen(this.field_96584_d); - } - } -- - } - -- private void func_111251_a(int var1) { -+ private void func_111251_a(int par1) { - try { -- Thread.sleep((long)(var1 * 1000)); -+ Thread.sleep((long)(par1 * 1000)); - } catch (InterruptedException var3) { - Minecraft.getMinecraft().getLogAgent().logWarning(var3.getLocalizedMessage()); - } -- - } - -- private void func_96582_a(String var1, int var2) { -- (new ThreadOnlineConnect(this, var1, var2)).start(); -+ private void func_96582_a(String par1Str, int par2) { -+ (new ThreadOnlineConnect(this, par1Str, par2)).start(); - } - - public void updateScreen() { -- if(this.field_96586_a != null) { -+ if (this.field_96586_a != null) { - this.field_96586_a.processReadPackets(); - } -- -- } -- -- static NetClientHandler func_96583_a(TaskOnlineConnect var0, NetClientHandler var1) { -- return var0.field_96586_a = var1; -- } -- -- static GuiScreen func_98172_a(TaskOnlineConnect var0) { -- return var0.field_96584_d; -- } -- -- static NetClientHandler func_96580_a(TaskOnlineConnect var0) { -- return var0.field_96586_a; -+ } -+ -+ static NetClientHandler func_96583_a(TaskOnlineConnect par0TaskOnlineConnect, NetClientHandler par1NetClientHandler) { -+ return par0TaskOnlineConnect.field_96586_a = par1NetClientHandler; -+ } -+ -+ static GuiScreen func_98172_a(TaskOnlineConnect par0TaskOnlineConnect) { -+ return par0TaskOnlineConnect.field_96584_d; -+ } -+ -+ static NetClientHandler func_96580_a(TaskOnlineConnect par0TaskOnlineConnect) { -+ return par0TaskOnlineConnect.field_96586_a; - } - } ---- net/minecraft/src/EnumChatFormatting.java -+++ net/minecraft/src/EnumChatFormatting.java -@@ -29,22 +29,21 @@ - UNDERLINE('n', true), - ITALIC('o', true), - RESET('r'); -- -- private static final Map w = new HashMap(); -- private static final Map x = new HashMap(); -- private static final Pattern y = Pattern.compile("(?i)" + String.valueOf('\u00a7') + "[0-9A-FK-OR]"); -+ private static final Map field_96321_w = new HashMap(); -+ private static final Map field_96331_x = new HashMap(); -+ private static final Pattern field_96330_y = Pattern.compile("(?i)" + String.valueOf('\u00a7') + "[0-9A-FK-OR]"); - private final char field_96329_z; - private final boolean field_96303_A; -- private final String B; -+ private final String field_96304_B; - -- private EnumChatFormatting(char var3) { -- this(var3, false); -+ private EnumChatFormatting(char par3) { -+ this(par3, false); - } - -- private EnumChatFormatting(char var3, boolean var4) { -- this.field_96329_z = var3; -- this.field_96303_A = var4; -- this.B = "\u00a7" + var3; -+ private EnumChatFormatting(char par3, boolean par4) { -+ this.field_96329_z = par3; -+ this.field_96303_A = par4; -+ this.field_96304_B = "\u00a7" + par3; - } - - public char func_96298_a() { -@@ -55,7 +54,10 @@ - return this.field_96303_A; - } - -- public boolean Checks() { -+ /** -+ * Checks if typo is a color. -+ */ -+ public boolean isColor() { - return !this.field_96303_A && this != RESET; - } - -@@ -64,25 +66,26 @@ - } - - public String toString() { -- return this.B; -- } -- -- public static String func_110646_a(String var0) { -- return var0 == null ? null : y.matcher(var0).replaceAll(""); -- } -- -- public static EnumChatFormatting func_96300_b(String var0) { -- return var0 == null ? null : (EnumChatFormatting)x.get(var0.toLowerCase()); -- } -- -- public static Collection func_96296_a(boolean var0, boolean var1) { -+ return this.field_96304_B; -+ } -+ -+ public static String func_110646_a(String par0Str) { -+ return par0Str == null ? null : field_96330_y.matcher(par0Str).replaceAll(""); -+ } -+ -+ public static EnumChatFormatting func_96300_b(String par0Str) { -+ return par0Str == null ? null : (EnumChatFormatting)field_96331_x.get(par0Str.toLowerCase()); -+ } -+ -+ public static Collection func_96296_a(boolean par0, boolean par1) { - ArrayList var2 = new ArrayList(); - EnumChatFormatting[] var3 = values(); - int var4 = var3.length; - -- for(int var5 = 0; var5 < var4; ++var5) { -+ for (int var5 = 0; var5 < var4; ++var5) { - EnumChatFormatting var6 = var3[var5]; -- if((!var6.Checks() || var0) && (!var6.func_96301_b() || var1)) { -+ -+ if ((!var6.isColor() || par0) && (!var6.func_96301_b() || par1)) { - var2.add(var6.func_96297_d()); - } - } -@@ -94,11 +97,10 @@ - EnumChatFormatting[] var0 = values(); - int var1 = var0.length; - -- for(int var2 = 0; var2 < var1; ++var2) { -+ for (int var2 = 0; var2 < var1; ++var2) { - EnumChatFormatting var3 = var0[var2]; -- w.put(Character.valueOf(var3.func_96298_a()), var3); -- x.put(var3.func_96297_d(), var3); -+ field_96321_w.put(Character.valueOf(var3.func_96298_a()), var3); -+ field_96331_x.put(var3.func_96297_d(), var3); - } -- - } - } ---- /dev/null -+++ org/spoutcraft/api/player/BiomeManager.java -@@ -1,0 +1,36 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.api.player; -+ -+public interface BiomeManager { -+ public void setSnowEnabled(String biome, boolean bool); -+ -+ public void setRainEnabled(String biome, boolean bool); -+ -+ public boolean getSnowChanged(String biome); -+ -+ public boolean getRainChanged(String biome); -+ -+ public boolean getSnowEnabled(String biome); -+ -+ public boolean getRainEnabled(String biome); -+ -+ public void resetWeather(String biome); -+} ---- net/minecraft/src/RenderGlobal.java -+++ net/minecraft/src/RenderGlobal.java -@@ -9,76 +9,195 @@ - import java.util.List; - import java.util.Map; - import java.util.Random; -+ - import org.lwjgl.opengl.ARBOcclusionQuery; - import org.lwjgl.opengl.GL11; --import org.lwjgl.opengl.GL15; -+ -+import org.newdawn.slick.opengl.Texture; -+ -+import com.prupe.mcpatcher.cc.ColorizeWorld; -+import com.prupe.mcpatcher.ctm.RenderPass; -+import com.prupe.mcpatcher.sky.SkyRenderer; -+ -+//Spout Start -+import org.spoutcraft.api.gui.Color; -+import org.spoutcraft.client.SpoutClient; -+import org.spoutcraft.client.TileEntityComparator; -+import org.spoutcraft.client.config.Configuration; -+import org.spoutcraft.client.io.CustomTextureManager; -+import org.spoutcraft.client.spoutworth.SpoutWorth; -+// Spout End - - public class RenderGlobal implements IWorldAccess { - private static final ResourceLocation locationMoonPhasesPng = new ResourceLocation("textures/environment/moon_phases.png"); - private static final ResourceLocation locationSunPng = new ResourceLocation("textures/environment/sun.png"); - private static final ResourceLocation locationCloudsPng = new ResourceLocation("textures/environment/clouds.png"); - private static final ResourceLocation locationEndSkyPng = new ResourceLocation("textures/environment/end_sky.png"); -- public List a = new ArrayList(); -+ public List tileEntities = new ArrayList(); - private WorldClient theWorld; -+ -+ /** The RenderEngine instance used by RenderGlobal */ - private final TextureManager renderEngine; -- private List m = new ArrayList(); -+ private List worldRenderersToUpdate = new ArrayList(); - private WorldRenderer[] sortedWorldRenderers; -- private WorldRenderer[] worldRenderers; -+ // Spout Start - private to public -+ public WorldRenderer[] worldRenderers; -+ // Spout End - private int renderChunksWide; - private int renderChunksTall; - private int renderChunksDeep; -+ -+ /** OpenGL render lists base */ - private int glRenderListBase; -+ -+ /** A reference to the Minecraft object. */ - private Minecraft mc; -+ -+ /** Global render blocks */ - private RenderBlocks globalRenderBlocks; -- private IntBuffer v; -+ -+ /** OpenGL occlusion query base */ -+ private IntBuffer glOcclusionQueryBase; -+ -+ /** Is occlusion testing enabled */ - private boolean occlusionEnabled; -+ -+ /** -+ * counts the cloud render updates. Used with mod to stagger some updates -+ */ - private int cloudTickCounter; -+ -+ /** The star GL Call list */ - private int starGLCallList; -+ -+ /** OpenGL sky list */ - private int glSkyList; -+ -+ /** OpenGL sky list 2 */ - private int glSkyList2; -+ -+ /** Minimum block X */ - private int minBlockX; -+ -+ /** Minimum block Y */ - private int minBlockY; -+ -+ /** Minimum block Z */ - private int minBlockZ; -+ -+ /** Maximum block X */ - private int maxBlockX; -+ -+ /** Maximum block Y */ - private int maxBlockY; -+ -+ /** Maximum block Z */ - private int maxBlockZ; -- private Map H = new HashMap(); -+ -+ /** -+ * Stores blocks currently being broken. Key is entity ID of the thing doing the breaking. Value is a -+ * DestroyBlockProgress -+ */ -+ private Map damagedBlocks = new HashMap(); - private Icon[] destroyBlockIcons; - private int renderDistance = -1; -+ -+ /** Render entities startup counter (init value=2) */ - private int renderEntitiesStartupCounter = 2; -+ -+ /** Count entities total */ - private int countEntitiesTotal; -+ -+ /** Count entities rendered */ - private int countEntitiesRendered; -+ -+ /** Count entities hidden */ - private int countEntitiesHidden; -- IntBuffer b = GLAllocation.createDirectIntBuffer(64); -+ -+ /** Occlusion query result */ -+ IntBuffer occlusionResult = GLAllocation.createDirectIntBuffer(64); -+ -+ /** How many renderers are loaded this frame that try to be rendered */ - private int renderersLoaded; -+ -+ /** How many renderers are being clipped by the frustrum this frame */ - private int renderersBeingClipped; -+ -+ /** How many renderers are being occluded this frame */ - private int renderersBeingOccluded; -+ -+ /** How many renderers are actually being rendered this frame */ - private int renderersBeingRendered; -+ -+ /** -+ * How many renderers are skipping rendering due to not having a render pass this frame -+ */ - private int renderersSkippingRenderPass; -+ -+ /** Dummy render int */ - private int dummyRenderInt; -+ -+ /** World renderers check index */ - private int worldRenderersCheckIndex; -- private List V = new ArrayList(); -- private RenderList[] allRenderLists = new RenderList[]{new RenderList(), new RenderList(), new RenderList(), new RenderList()}; -+ -+ /** List of OpenGL lists for the current render pass */ -+ private List glRenderLists = new ArrayList(); -+ -+ /** All render lists (fixed length 4) */ -+ private RenderList[] allRenderLists = new RenderList[] {new RenderList(), new RenderList(), new RenderList(), new RenderList()}; -+ -+ /** -+ * Previous x position when the renderers were sorted. (Once the distance moves more than 4 units they will be -+ * resorted) -+ */ - double prevSortX = -9999.0D; -+ -+ /** -+ * Previous y position when the renderers were sorted. (Once the distance moves more than 4 units they will be -+ * resorted) -+ */ - double prevSortY = -9999.0D; -+ -+ /** -+ * Previous Z position when the renderers were sorted. (Once the distance moves more than 4 units they will be -+ * resorted) -+ */ - double prevSortZ = -9999.0D; -- int frustumCheckOffset; -- -- public RenderGlobal(Minecraft var1) { -- this.mc = var1; -- this.renderEngine = var1.getTextureManager(); -- byte var2 = 34; -- byte var3 = 32; -- this.glRenderListBase = GLAllocation.generateDisplayLists(var2 * var2 * var3 * 3); -+ -+ /** -+ * The offset used to determine if a renderer is one of the sixteenth that are being updated this frame -+ */ -+ int frustumCheckOffset = 0; -+ -+ // Spout Start -+ private long lastMovedTime = System.currentTimeMillis(); -+ private long frameCount; -+ public static int renderersToUpdateLastTick; -+ // Spout End -+ -+ public RenderGlobal(Minecraft par1Minecraft) { -+ this.mc = par1Minecraft; -+ this.renderEngine = par1Minecraft.getTextureManager(); -+ // Spout Start -+ byte var2 = 64; -+ byte var3 = 64; -+ this.glRenderListBase = GLAllocation.generateDisplayLists(var2 * var2 * var3 * 5); -+ // Spout End - this.occlusionEnabled = OpenGlCapsChecker.checkARBOcclusion(); -- if(this.occlusionEnabled) { -- this.b.clear(); -- this.v = GLAllocation.createDirectIntBuffer(var2 * var2 * var3); -- this.v.clear(); -- this.v.position(0); -- this.v.limit(var2 * var2 * var3); -- ARBOcclusionQuery.glGenQueriesARB(this.v); -+ // Spout Start -+ if (this.occlusionEnabled && Configuration.ambientOcclusion) { -+ // Spout End -+ this.occlusionResult.clear(); -+ this.glOcclusionQueryBase = GLAllocation.createDirectIntBuffer(var2 * var2 * var3); -+ this.glOcclusionQueryBase.clear(); -+ this.glOcclusionQueryBase.position(0); -+ this.glOcclusionQueryBase.limit(var2 * var2 * var3); -+ ARBOcclusionQuery.glGenQueriesARB(this.glOcclusionQueryBase); - } -+ -+ // Spout Start -+ refreshStars(); -+ // Spout End - - this.starGLCallList = GLAllocation.generateDisplayLists(3); - GL11.glPushMatrix(); -@@ -92,11 +211,11 @@ - byte var6 = 64; - int var7 = 256 / var6 + 2; - float var5 = 16.0F; -- - int var8; - int var9; -- for(var8 = -var6 * var7; var8 <= var6 * var7; var8 += var6) { -- for(var9 = -var6 * var7; var9 <= var6 * var7; var9 += var6) { -+ -+ for (var8 = -var6 * var7; var8 <= var6 * var7; var8 += var6) { -+ for (var9 = -var6 * var7; var9 <= var6 * var7; var9 += var6) { - var4.startDrawingQuads(); - var4.addVertex((double)(var8 + 0), (double)var5, (double)(var9 + 0)); - var4.addVertex((double)(var8 + var6), (double)var5, (double)(var9 + 0)); -@@ -112,8 +231,8 @@ - var5 = -16.0F; - var4.startDrawingQuads(); - -- for(var8 = -var6 * var7; var8 <= var6 * var7; var8 += var6) { -- for(var9 = -var6 * var7; var9 <= var6 * var7; var9 += var6) { -+ for (var8 = -var6 * var7; var8 <= var6 * var7; var8 += var6) { -+ for (var9 = -var6 * var7; var9 <= var6 * var7; var9 += var6) { - var4.addVertex((double)(var8 + var6), (double)var5, (double)(var9 + 0)); - var4.addVertex((double)(var8 + 0), (double)var5, (double)(var9 + 0)); - var4.addVertex((double)(var8 + 0), (double)var5, (double)(var9 + var6)); -@@ -125,18 +244,73 @@ - GL11.glEndList(); - } - -+ // Spout Start -+ public void refreshStars() { -+ this.starGLCallList = GLAllocation.generateDisplayLists(3); -+ GL11.glPushMatrix(); -+ GL11.glNewList(this.starGLCallList, GL11.GL_COMPILE); -+ this.renderStars(); -+ GL11.glEndList(); -+ GL11.glPopMatrix(); -+ Tessellator var5 = Tessellator.instance; -+ this.glSkyList = this.starGLCallList + 1; -+ GL11.glNewList(this.glSkyList, GL11.GL_COMPILE); -+ byte var7 = 64; -+ int var8 = 256 / var7 + 2; -+ float var6 = 16.0F; -+ int var9; -+ int var10; -+ -+ for (var9 = -var7 * var8; var9 <= var7 * var8; var9 += var7) { -+ for (var10 = -var7 * var8; var10 <= var7 * var8; var10 += var7) { -+ var5.startDrawingQuads(); -+ var5.addVertex((double)(var9 + 0), (double)var6, (double)(var10 + 0)); -+ var5.addVertex((double)(var9 + var7), (double)var6, (double)(var10 + 0)); -+ var5.addVertex((double)(var9 + var7), (double)var6, (double)(var10 + var7)); -+ var5.addVertex((double)(var9 + 0), (double)var6, (double)(var10 + var7)); -+ var5.draw(); -+ } -+ } -+ -+ GL11.glEndList(); -+ this.glSkyList2 = this.starGLCallList + 2; -+ GL11.glNewList(this.glSkyList2, GL11.GL_COMPILE); -+ var6 = -16.0F; -+ var5.startDrawingQuads(); -+ -+ for (var9 = -var7 * var8; var9 <= var7 * var8; var9 += var7) { -+ for (var10 = -var7 * var8; var10 <= var7 * var8; var10 += var7) { -+ var5.addVertex((double)(var9 + var7), (double)var6, (double)(var10 + 0)); -+ var5.addVertex((double)(var9 + 0), (double)var6, (double)(var10 + 0)); -+ var5.addVertex((double)(var9 + 0), (double)var6, (double)(var10 + var7)); -+ var5.addVertex((double)(var9 + var7), (double)var6, (double)(var10 + var7)); -+ } -+ } -+ -+ var5.draw(); -+ GL11.glEndList(); -+ } -+ // Spout End - private void renderStars() { -+ // Spout Start -+ if (!SpoutClient.getInstance().getSkyManager().isStarsVisible()) { -+ return; -+ } -+ // Spout End - Random var1 = new Random(10842L); - Tessellator var2 = Tessellator.instance; - var2.startDrawingQuads(); - -- for(int var3 = 0; var3 < 1500; ++var3) { -+ // Spout Start -+ for (int var3 = 0; var3 < SpoutClient.getInstance().getSkyManager().getStarFrequency(); ++var3) { -+ // Spout End - double var4 = (double)(var1.nextFloat() * 2.0F - 1.0F); - double var6 = (double)(var1.nextFloat() * 2.0F - 1.0F); - double var8 = (double)(var1.nextFloat() * 2.0F - 1.0F); - double var10 = (double)(0.15F + var1.nextFloat() * 0.1F); - double var12 = var4 * var4 + var6 * var6 + var8 * var8; -- if(var12 < 1.0D && var12 > 0.01D) { -+ -+ if (var12 < 1.0D && var12 > 0.01D) { - var12 = 1.0D / Math.sqrt(var12); - var4 *= var12; - var6 *= var12; -@@ -154,7 +328,7 @@ - double var34 = Math.sin(var32); - double var36 = Math.cos(var32); - -- for(int var38 = 0; var38 < 4; ++var38) { -+ for (int var38 = 0; var38 < 4; ++var38) { - double var39 = 0.0D; - double var41 = (double)((var38 & 2) - 1) * var10; - double var43 = (double)((var38 + 1 & 2) - 1) * var10; -@@ -172,37 +346,51 @@ - var2.draw(); - } - -- public void setWorldAndLoadRenderers(WorldClient var1) { -- if(this.theWorld != null) { -+ /** -+ * set null to clear -+ */ -+ public void setWorldAndLoadRenderers(WorldClient par1WorldClient) { -+ if (this.theWorld != null) { - this.theWorld.removeWorldAccess(this); - } - - this.prevSortX = -9999.0D; - this.prevSortY = -9999.0D; - this.prevSortZ = -9999.0D; -- RenderManager.instance.set(var1); -- this.theWorld = var1; -- this.globalRenderBlocks = new RenderBlocks(var1); -- if(var1 != null) { -- var1.addWorldAccess(this); -+ RenderManager.instance.set(par1WorldClient); -+ this.theWorld = par1WorldClient; -+ this.globalRenderBlocks = new RenderBlocks(par1WorldClient); -+ -+ if (par1WorldClient != null) { -+ par1WorldClient.addWorldAccess(this); - this.loadRenderers(); - } -- - } - -+ /** -+ * Loads all the renderers and sets up the basic settings usage -+ */ - public void loadRenderers() { -- if(this.theWorld != null) { -- Block.leaves.setGraphicsLevel(this.mc.gameSettings.fancyGraphics); -+ if (this.theWorld != null) { -+ // Spout Start -+ Block.leaves.setGraphicsLevel(Configuration.isFancyTrees()); -+ // Spout End - this.renderDistance = this.mc.gameSettings.renderDistance; - int var1; -- if(this.worldRenderers != null) { -- for(var1 = 0; var1 < this.worldRenderers.length; ++var1) { -+ -+ if (this.worldRenderers != null) { -+ for (var1 = 0; var1 < this.worldRenderers.length; ++var1) { - this.worldRenderers[var1].stopRendering(); - } - } - - var1 = 64 << 3 - this.renderDistance; -- if(var1 > 400) { -+ -+ // Spout Start -+ if (Configuration.isFarView()) { -+ var1 = 512; -+ } else if (var1 > 400) { -+ // Spout End - var1 = 400; - } - -@@ -219,38 +407,43 @@ - this.maxBlockX = this.renderChunksWide; - this.maxBlockY = this.renderChunksTall; - this.maxBlockZ = this.renderChunksDeep; -- - int var4; -- for(var4 = 0; var4 < this.m.size(); ++var4) { -- ((WorldRenderer)this.m.get(var4)).needsUpdate = false; -+ -+ for (var4 = 0; var4 < this.worldRenderersToUpdate.size(); ++var4) { -+ ((WorldRenderer)this.worldRenderersToUpdate.get(var4)).needsUpdate = false; - } - -- this.m.clear(); -- this.a.clear(); -- -- for(var4 = 0; var4 < this.renderChunksWide; ++var4) { -- for(int var5 = 0; var5 < this.renderChunksTall; ++var5) { -- for(int var6 = 0; var6 < this.renderChunksDeep; ++var6) { -- this.worldRenderers[(var6 * this.renderChunksTall + var5) * this.renderChunksWide + var4] = new WorldRenderer(this.theWorld, this.a, var4 * 16, var5 * 16, var6 * 16, this.glRenderListBase + var2); -- if(this.occlusionEnabled) { -- this.worldRenderers[(var6 * this.renderChunksTall + var5) * this.renderChunksWide + var4].glOcclusionQuery = this.v.get(var3); -+ this.worldRenderersToUpdate.clear(); -+ this.tileEntities.clear(); -+ -+ for (var4 = 0; var4 < this.renderChunksWide; ++var4) { -+ for (int var5 = 0; var5 < this.renderChunksTall; ++var5) { -+ for (int var6 = 0; var6 < this.renderChunksDeep; ++var6) { -+ this.worldRenderers[(var6 * this.renderChunksTall + var5) * this.renderChunksWide + var4] = new WorldRenderer(this.theWorld, this.tileEntities, var4 * 16, var5 * 16, var6 * 16, this.glRenderListBase + var2); -+ -+ // Spout Start -+ if (this.occlusionEnabled && Configuration.ambientOcclusion && this.glOcclusionQueryBase != null) { -+ this.worldRenderers[(var6 * this.renderChunksTall + var5) * this.renderChunksWide + var4].glOcclusionQuery = this.glOcclusionQueryBase.get(var3); - } -- -+ // Spout End - this.worldRenderers[(var6 * this.renderChunksTall + var5) * this.renderChunksWide + var4].isWaitingOnOcclusionQuery = false; - this.worldRenderers[(var6 * this.renderChunksTall + var5) * this.renderChunksWide + var4].isVisible = true; - this.worldRenderers[(var6 * this.renderChunksTall + var5) * this.renderChunksWide + var4].isInFrustum = true; - this.worldRenderers[(var6 * this.renderChunksTall + var5) * this.renderChunksWide + var4].chunkIndex = var3++; - this.worldRenderers[(var6 * this.renderChunksTall + var5) * this.renderChunksWide + var4].markDirty(); - this.sortedWorldRenderers[(var6 * this.renderChunksTall + var5) * this.renderChunksWide + var4] = this.worldRenderers[(var6 * this.renderChunksTall + var5) * this.renderChunksWide + var4]; -- this.m.add(this.worldRenderers[(var6 * this.renderChunksTall + var5) * this.renderChunksWide + var4]); -- var2 += 3; -+ this.worldRenderersToUpdate.add(this.worldRenderers[(var6 * this.renderChunksTall + var5) * this.renderChunksWide + var4]); -+ // Spout Start - 3 to 5 -+ var2 += 5; -+ // Spout End - } - } - } - -- if(this.theWorld != null) { -+ if (this.theWorld != null) { - EntityLivingBase var7 = this.mc.renderViewEntity; -- if(var7 != null) { -+ -+ if (var7 != null) { - this.markRenderersForNewPosition(MathHelper.floor_double(var7.posX), MathHelper.floor_double(var7.posY), MathHelper.floor_double(var7.posZ)); - Arrays.sort(this.sortedWorldRenderers, new EntitySorter(var7)); - } -@@ -260,81 +453,116 @@ - } - } - -- public void renderEntities(Vec3 var1, ICamera var2, float var3) { -- if(this.renderEntitiesStartupCounter > 0) { -+ /** -+ * Renders all entities within range and within the frustrum. Args: pos, frustrum, partialTickTime -+ */ -+ public void renderEntities(Vec3 par1Vec3, ICamera par2ICamera, float par3) { -+ if (this.renderEntitiesStartupCounter > 0) { - --this.renderEntitiesStartupCounter; - } else { - this.theWorld.theProfiler.startSection("prepare"); -- TileEntityRenderer.instance.cacheActiveRenderInfo(this.theWorld, this.mc.getTextureManager(), this.mc.fontRenderer, this.mc.renderViewEntity, var3); -- RenderManager.instance.cacheActiveRenderInfo(this.theWorld, this.mc.getTextureManager(), this.mc.fontRenderer, this.mc.renderViewEntity, this.mc.pointedEntityLiving, this.mc.gameSettings, var3); -+ TileEntityRenderer.instance.cacheActiveRenderInfo(this.theWorld, this.mc.getTextureManager(), this.mc.fontRenderer, this.mc.renderViewEntity, par3); -+ RenderManager.instance.cacheActiveRenderInfo(this.theWorld, this.mc.getTextureManager(), this.mc.fontRenderer, this.mc.renderViewEntity, this.mc.pointedEntityLiving, this.mc.gameSettings, par3); - this.countEntitiesTotal = 0; - this.countEntitiesRendered = 0; - this.countEntitiesHidden = 0; - EntityLivingBase var4 = this.mc.renderViewEntity; -- RenderManager.renderPosX = var4.lastTickPosX + (var4.posX - var4.lastTickPosX) * (double)var3; -- RenderManager.renderPosY = var4.lastTickPosY + (var4.posY - var4.lastTickPosY) * (double)var3; -- RenderManager.renderPosZ = var4.lastTickPosZ + (var4.posZ - var4.lastTickPosZ) * (double)var3; -- TileEntityRenderer.staticPlayerX = var4.lastTickPosX + (var4.posX - var4.lastTickPosX) * (double)var3; -- TileEntityRenderer.staticPlayerY = var4.lastTickPosY + (var4.posY - var4.lastTickPosY) * (double)var3; -- TileEntityRenderer.staticPlayerZ = var4.lastTickPosZ + (var4.posZ - var4.lastTickPosZ) * (double)var3; -- this.mc.entityRenderer.enableLightmap((double)var3); -+ RenderManager.renderPosX = var4.lastTickPosX + (var4.posX - var4.lastTickPosX) * (double)par3; -+ RenderManager.renderPosY = var4.lastTickPosY + (var4.posY - var4.lastTickPosY) * (double)par3; -+ RenderManager.renderPosZ = var4.lastTickPosZ + (var4.posZ - var4.lastTickPosZ) * (double)par3; -+ TileEntityRenderer.staticPlayerX = var4.lastTickPosX + (var4.posX - var4.lastTickPosX) * (double)par3; -+ TileEntityRenderer.staticPlayerY = var4.lastTickPosY + (var4.posY - var4.lastTickPosY) * (double)par3; -+ TileEntityRenderer.staticPlayerZ = var4.lastTickPosZ + (var4.posZ - var4.lastTickPosZ) * (double)par3; -+ this.mc.entityRenderer.enableLightmap((double)par3); - this.theWorld.theProfiler.endStartSection("global"); - List var5 = this.theWorld.getLoadedEntityList(); - this.countEntitiesTotal = var5.size(); -- - int var6; - Entity var7; -- for(var6 = 0; var6 < this.theWorld.i.size(); ++var6) { -- var7 = (Entity)this.theWorld.i.get(var6); -+ -+ for (var6 = 0; var6 < this.theWorld.weatherEffects.size(); ++var6) { -+ var7 = (Entity)this.theWorld.weatherEffects.get(var6); - ++this.countEntitiesRendered; -- if(var7.isInRangeToRenderVec3D(var1)) { -- RenderManager.instance.renderEntity(var7, var3); -+ -+ if (var7.isInRangeToRenderVec3D(par1Vec3)) { -+ RenderManager.instance.renderEntity(var7, par3); - } - } - - this.theWorld.theProfiler.endStartSection("entities"); - -- for(var6 = 0; var6 < var5.size(); ++var6) { -+ for (var6 = 0; var6 < var5.size(); ++var6) { - var7 = (Entity)var5.get(var6); -- boolean var8 = var7.isInRangeToRenderVec3D(var1) && (var7.ignoreFrustumCheck || var2.isBoundingBoxInFrustum(var7.boundingBox) || var7.riddenByEntity == this.mc.thePlayer); -- if(!var8 && var7 instanceof EntityLiving) { -+ boolean var8 = var7.isInRangeToRenderVec3D(par1Vec3) && (var7.ignoreFrustumCheck || par2ICamera.isBoundingBoxInFrustum(var7.boundingBox) || var7.riddenByEntity == this.mc.thePlayer); -+ -+ if (!var8 && var7 instanceof EntityLiving) { - EntityLiving var9 = (EntityLiving)var7; -- if(var9.getLeashed() && var9.getLeashedToEntity() != null) { -+ -+ if (var9.getLeashed() && var9.getLeashedToEntity() != null) { - Entity var10 = var9.getLeashedToEntity(); -- var8 = var2.isBoundingBoxInFrustum(var10.boundingBox); -+ var8 = par2ICamera.isBoundingBoxInFrustum(var10.boundingBox); - } - } - -- if(var8 && (var7 != this.mc.renderViewEntity || this.mc.gameSettings.thirdPersonView != 0 || this.mc.renderViewEntity.isPlayerSleeping()) && this.theWorld.blockExists(MathHelper.floor_double(var7.posX), 0, MathHelper.floor_double(var7.posZ))) { -+ if (var8 && (var7 != this.mc.renderViewEntity || this.mc.gameSettings.thirdPersonView != 0 || this.mc.renderViewEntity.isPlayerSleeping()) && this.theWorld.blockExists(MathHelper.floor_double(var7.posX), 0, MathHelper.floor_double(var7.posZ))) { - ++this.countEntitiesRendered; -- RenderManager.instance.renderEntity(var7, var3); -+ RenderManager.instance.renderEntity(var7, par3); - } - } - - this.theWorld.theProfiler.endStartSection("tileentities"); - RenderHelper.enableStandardItemLighting(); - -- for(var6 = 0; var6 < this.a.size(); ++var6) { -- TileEntityRenderer.instance.renderTileEntity((TileEntity)this.a.get(var6), var3); -- } -- -- this.mc.entityRenderer.disableLightmap((double)var3); -+ // Spout Start -+ int max = tileEntities.size(); -+ int threshold = (int) Math.min(1000, (Math.max(100, (SpoutWorth.getInstance().getAverageFPS() * 8)))); -+ if (tileEntities.size() > threshold) { -+ Collections.sort((List)tileEntities, new TileEntityComparator()); -+ max = threshold / 2; -+ } -+ Iterator var8 = this.tileEntities.iterator(); -+ -+ int i = 0; -+ while (var8.hasNext() && (i < max)) { -+ i++; -+ TileEntity var9 = (TileEntity)var8.next(); -+ if (!var9.isInvalid()) { -+ TileEntityRenderer.instance.renderTileEntity(var9, par3); -+ } -+ } -+ // Spout End -+ -+ for (var6 = 0; var6 < this.tileEntities.size(); ++var6) { -+ TileEntityRenderer.instance.renderTileEntity((TileEntity)this.tileEntities.get(var6), par3); -+ } -+ -+ this.mc.entityRenderer.disableLightmap((double)par3); - this.theWorld.theProfiler.endSection(); - } - } - -+ /** -+ * Gets the render info for use on the Debug screen -+ */ - public String getDebugInfoRenders() { - return "C: " + this.renderersBeingRendered + "/" + this.renderersLoaded + ". F: " + this.renderersBeingClipped + ", O: " + this.renderersBeingOccluded + ", E: " + this.renderersSkippingRenderPass; - } - -+ /** -+ * Gets the entities info for use on the Debug screen -+ */ - public String getDebugInfoEntities() { - return "E: " + this.countEntitiesRendered + "/" + this.countEntitiesTotal + ". B: " + this.countEntitiesHidden + ", I: " + (this.countEntitiesTotal - this.countEntitiesHidden - this.countEntitiesRendered); - } - -- private void markRenderersForNewPosition(int var1, int var2, int var3) { -- var1 -= 8; -- var2 -= 8; -- var3 -= 8; -+ /** -+ * Goes through all the renderers setting new positions on them and those that have their position changed are adding -+ * to be updated -+ */ -+ private void markRenderersForNewPosition(int par1, int par2, int par3) { -+ par1 -= 8; -+ par2 -= 8; -+ par3 -= 8; - this.minBlockX = Integer.MAX_VALUE; - this.minBlockY = Integer.MAX_VALUE; - this.minBlockZ = Integer.MAX_VALUE; -@@ -344,78 +572,87 @@ - int var4 = this.renderChunksWide * 16; - int var5 = var4 / 2; - -- for(int var6 = 0; var6 < this.renderChunksWide; ++var6) { -+ for (int var6 = 0; var6 < this.renderChunksWide; ++var6) { - int var7 = var6 * 16; -- int var8 = var7 + var5 - var1; -- if(var8 < 0) { -+ int var8 = var7 + var5 - par1; -+ -+ if (var8 < 0) { - var8 -= var4 - 1; - } - - var8 /= var4; - var7 -= var8 * var4; -- if(var7 < this.minBlockX) { -+ -+ if (var7 < this.minBlockX) { - this.minBlockX = var7; - } - -- if(var7 > this.maxBlockX) { -+ if (var7 > this.maxBlockX) { - this.maxBlockX = var7; - } - -- for(int var9 = 0; var9 < this.renderChunksDeep; ++var9) { -+ for (int var9 = 0; var9 < this.renderChunksDeep; ++var9) { - int var10 = var9 * 16; -- int var11 = var10 + var5 - var3; -- if(var11 < 0) { -+ int var11 = var10 + var5 - par3; -+ -+ if (var11 < 0) { - var11 -= var4 - 1; - } - - var11 /= var4; - var10 -= var11 * var4; -- if(var10 < this.minBlockZ) { -+ -+ if (var10 < this.minBlockZ) { - this.minBlockZ = var10; - } - -- if(var10 > this.maxBlockZ) { -+ if (var10 > this.maxBlockZ) { - this.maxBlockZ = var10; - } - -- for(int var12 = 0; var12 < this.renderChunksTall; ++var12) { -+ for (int var12 = 0; var12 < this.renderChunksTall; ++var12) { - int var13 = var12 * 16; -- if(var13 < this.minBlockY) { -+ -+ if (var13 < this.minBlockY) { - this.minBlockY = var13; - } - -- if(var13 > this.maxBlockY) { -+ if (var13 > this.maxBlockY) { - this.maxBlockY = var13; - } - - WorldRenderer var14 = this.worldRenderers[(var9 * this.renderChunksTall + var12) * this.renderChunksWide + var6]; - boolean var15 = var14.needsUpdate; - var14.setPosition(var7, var13, var10); -- if(!var15 && var14.needsUpdate) { -- this.m.add(var14); -+ -+ if (!var15 && var14.needsUpdate) { -+ this.worldRenderersToUpdate.add(var14); - } - } - } - } -- - } - -- public int sortAndRender(EntityLivingBase var1, int var2, double var3) { -+ /** -+ * Sorts all renderers based on the passed in entity. Args: entityLiving, renderPass, partialTickTime -+ */ -+ public int sortAndRender(EntityLivingBase par1EntityLivingBase, int par2, double par3) { - this.theWorld.theProfiler.startSection("sortchunks"); - -- for(int var5 = 0; var5 < 10; ++var5) { -+ for (int var5 = 0; var5 < 10; ++var5) { - this.worldRenderersCheckIndex = (this.worldRenderersCheckIndex + 1) % this.worldRenderers.length; - WorldRenderer var6 = this.worldRenderers[this.worldRenderersCheckIndex]; -- if(var6.needsUpdate && !this.m.contains(var6)) { -- this.m.add(var6); -+ -+ if (var6.needsUpdate && !this.worldRenderersToUpdate.contains(var6)) { -+ this.worldRenderersToUpdate.add(var6); - } - } - -- if(this.mc.gameSettings.renderDistance != this.renderDistance) { -+ if (this.mc.gameSettings.renderDistance != this.renderDistance) { - this.loadRenderers(); - } - -- if(var2 == 0) { -+ if (par2 == 0) { - this.renderersLoaded = 0; - this.dummyRenderInt = 0; - this.renderersBeingClipped = 0; -@@ -424,40 +661,45 @@ - this.renderersSkippingRenderPass = 0; - } - -- double var33 = var1.lastTickPosX + (var1.posX - var1.lastTickPosX) * var3; -- double var7 = var1.lastTickPosY + (var1.posY - var1.lastTickPosY) * var3; -- double var9 = var1.lastTickPosZ + (var1.posZ - var1.lastTickPosZ) * var3; -- double var11 = var1.posX - this.prevSortX; -- double var13 = var1.posY - this.prevSortY; -- double var15 = var1.posZ - this.prevSortZ; -- if(var11 * var11 + var13 * var13 + var15 * var15 > 16.0D) { -- this.prevSortX = var1.posX; -- this.prevSortY = var1.posY; -- this.prevSortZ = var1.posZ; -- this.markRenderersForNewPosition(MathHelper.floor_double(var1.posX), MathHelper.floor_double(var1.posY), MathHelper.floor_double(var1.posZ)); -- Arrays.sort(this.sortedWorldRenderers, new EntitySorter(var1)); -+ double var33 = par1EntityLivingBase.lastTickPosX + (par1EntityLivingBase.posX - par1EntityLivingBase.lastTickPosX) * par3; -+ double var7 = par1EntityLivingBase.lastTickPosY + (par1EntityLivingBase.posY - par1EntityLivingBase.lastTickPosY) * par3; -+ double var9 = par1EntityLivingBase.lastTickPosZ + (par1EntityLivingBase.posZ - par1EntityLivingBase.lastTickPosZ) * par3; -+ double var11 = par1EntityLivingBase.posX - this.prevSortX; -+ double var13 = par1EntityLivingBase.posY - this.prevSortY; -+ double var15 = par1EntityLivingBase.posZ - this.prevSortZ; -+ -+ if (var11 * var11 + var13 * var13 + var15 * var15 > 16.0D) { -+ this.prevSortX = par1EntityLivingBase.posX; -+ this.prevSortY = par1EntityLivingBase.posY; -+ this.prevSortZ = par1EntityLivingBase.posZ; -+ this.markRenderersForNewPosition(MathHelper.floor_double(par1EntityLivingBase.posX), MathHelper.floor_double(par1EntityLivingBase.posY), MathHelper.floor_double(par1EntityLivingBase.posZ)); -+ Arrays.sort(this.sortedWorldRenderers, new EntitySorter(par1EntityLivingBase)); - } - - RenderHelper.disableStandardItemLighting(); - byte var17 = 0; - int var34; -- if(this.occlusionEnabled && this.mc.gameSettings.advancedOpengl && !this.mc.gameSettings.anaglyph && var2 == 0) { -+ -+ // Spout Start -+ if (this.occlusionEnabled && Configuration.ambientOcclusion && this.mc.gameSettings.advancedOpengl && !this.mc.gameSettings.anaglyph && par2 == 0) { -+ // Spout End - byte var18 = 0; - int var19 = 16; - this.checkOcclusionQueryResult(var18, var19); - -- for(int var20 = var18; var20 < var19; ++var20) { -+ for (int var20 = var18; var20 < var19; ++var20) { - this.sortedWorldRenderers[var20].isVisible = true; - } - - this.theWorld.theProfiler.endStartSection("render"); -- var34 = var17 + this.renderSortedRenderers(var18, var19, var2, var3); -+ var34 = var17 + this.renderSortedRenderers(var18, var19, par2, par3); - - do { - this.theWorld.theProfiler.endStartSection("occ"); - int var35 = var19; - var19 *= 2; -- if(var19 > this.sortedWorldRenderers.length) { -+ -+ if (var19 > this.sortedWorldRenderers.length) { - var19 = this.sortedWorldRenderers.length; - } - -@@ -475,18 +717,19 @@ - float var21 = 0.0F; - float var22 = 0.0F; - -- for(int var23 = var35; var23 < var19; ++var23) { -- if(this.sortedWorldRenderers[var23].skipAllRenderPasses()) { -+ for (int var23 = var35; var23 < var19; ++var23) { -+ if (this.sortedWorldRenderers[var23].skipAllRenderPasses()) { - this.sortedWorldRenderers[var23].isInFrustum = false; - } else { -- if(!this.sortedWorldRenderers[var23].isInFrustum) { -+ if (!this.sortedWorldRenderers[var23].isInFrustum) { - this.sortedWorldRenderers[var23].isVisible = true; - } - -- if(this.sortedWorldRenderers[var23].isInFrustum && !this.sortedWorldRenderers[var23].isWaitingOnOcclusionQuery) { -- float var24 = MathHelper.sqrt_float(this.sortedWorldRenderers[var23].distanceToEntitySquared(var1)); -+ if (this.sortedWorldRenderers[var23].isInFrustum && !this.sortedWorldRenderers[var23].isWaitingOnOcclusionQuery) { -+ float var24 = MathHelper.sqrt_float(this.sortedWorldRenderers[var23].distanceToEntitySquared(par1EntityLivingBase)); - int var25 = (int)(1.0F + var24 / 128.0F); -- if(this.cloudTickCounter % var25 == var23 % var25) { -+ -+ if (this.cloudTickCounter % var25 == var23 % var25) { - WorldRenderer var26 = this.sortedWorldRenderers[var23]; - float var27 = (float)((double)var26.posXMinus - var33); - float var28 = (float)((double)var26.posYMinus - var7); -@@ -494,7 +737,8 @@ - float var30 = var27 - var36; - float var31 = var28 - var21; - float var32 = var29 - var22; -- if(var30 != 0.0F || var31 != 0.0F || var32 != 0.0F) { -+ -+ if (var30 != 0.0F || var31 != 0.0F || var32 != 0.0F) { - GL11.glTranslatef(var30, var31, var32); - var36 += var30; - var21 += var31; -@@ -502,9 +746,9 @@ - } - - this.theWorld.theProfiler.startSection("bb"); -- ARBOcclusionQuery.glBeginQueryARB(GL15.GL_SAMPLES_PASSED, this.sortedWorldRenderers[var23].glOcclusionQuery); -+ ARBOcclusionQuery.glBeginQueryARB(ARBOcclusionQuery.GL_SAMPLES_PASSED_ARB, this.sortedWorldRenderers[var23].glOcclusionQuery); - this.sortedWorldRenderers[var23].callOcclusionQueryList(); -- ARBOcclusionQuery.glEndQueryARB(GL15.GL_SAMPLES_PASSED); -+ ARBOcclusionQuery.glEndQueryARB(ARBOcclusionQuery.GL_SAMPLES_PASSED_ARB); - this.theWorld.theProfiler.endSection(); - this.sortedWorldRenderers[var23].isWaitingOnOcclusionQuery = true; - } -@@ -513,8 +757,9 @@ - } - - GL11.glPopMatrix(); -- if(this.mc.gameSettings.anaglyph) { -- if(EntityRenderer.anaglyphField == 0) { -+ -+ if (this.mc.gameSettings.anaglyph) { -+ if (EntityRenderer.anaglyphField == 0) { - GL11.glColorMask(false, true, true, true); - } else { - GL11.glColorMask(true, false, false, true); -@@ -528,121 +773,142 @@ - GL11.glEnable(GL11.GL_ALPHA_TEST); - GL11.glEnable(GL11.GL_FOG); - this.theWorld.theProfiler.endStartSection("render"); -- var34 += this.renderSortedRenderers(var35, var19, var2, var3); -- } while(var19 < this.sortedWorldRenderers.length); -+ var34 += this.renderSortedRenderers(var35, var19, par2, par3); -+ } while (var19 < this.sortedWorldRenderers.length); - } else { - this.theWorld.theProfiler.endStartSection("render"); -- var34 = var17 + this.renderSortedRenderers(0, this.sortedWorldRenderers.length, var2, var3); -+ var34 = var17 + this.renderSortedRenderers(0, this.sortedWorldRenderers.length, par2, par3); - } - - this.theWorld.theProfiler.endSection(); - return var34; - } - -- private void checkOcclusionQueryResult(int var1, int var2) { -- for(int var3 = var1; var3 < var2; ++var3) { -- if(this.sortedWorldRenderers[var3].isWaitingOnOcclusionQuery) { -- this.b.clear(); -- ARBOcclusionQuery.glGetQueryObjectuARB(this.sortedWorldRenderers[var3].glOcclusionQuery, GL15.GL_QUERY_RESULT_AVAILABLE, this.b); -- if(this.b.get(0) != 0) { -+ private void checkOcclusionQueryResult(int par1, int par2) { -+ for (int var3 = par1; var3 < par2; ++var3) { -+ if (this.sortedWorldRenderers[var3].isWaitingOnOcclusionQuery) { -+ this.occlusionResult.clear(); -+ ARBOcclusionQuery.glGetQueryObjectuARB(this.sortedWorldRenderers[var3].glOcclusionQuery, ARBOcclusionQuery.GL_QUERY_RESULT_AVAILABLE_ARB, this.occlusionResult); -+ -+ if (this.occlusionResult.get(0) != 0) { - this.sortedWorldRenderers[var3].isWaitingOnOcclusionQuery = false; -- this.b.clear(); -- ARBOcclusionQuery.glGetQueryObjectuARB(this.sortedWorldRenderers[var3].glOcclusionQuery, GL15.GL_QUERY_RESULT, this.b); -- this.sortedWorldRenderers[var3].isVisible = this.b.get(0) != 0; -+ this.occlusionResult.clear(); -+ ARBOcclusionQuery.glGetQueryObjectuARB(this.sortedWorldRenderers[var3].glOcclusionQuery, ARBOcclusionQuery.GL_QUERY_RESULT_ARB, this.occlusionResult); -+ this.sortedWorldRenderers[var3].isVisible = this.occlusionResult.get(0) != 0; - } - } - } -- - } - -- private int renderSortedRenderers(int var1, int var2, int var3, double var4) { -- this.V.clear(); -+ /** -+ * Renders the sorted renders for the specified render pass. Args: startRenderer, numRenderers, renderPass, -+ * partialTickTime -+ */ -+ private int renderSortedRenderers(int par1, int par2, int par3, double par4) { -+ this.glRenderLists.clear(); - int var6 = 0; - -- for(int var7 = var1; var7 < var2; ++var7) { -- if(var3 == 0) { -+ for (int var7 = par1; var7 < par2; ++var7) { -+ if (par3 == 0) { - ++this.renderersLoaded; -- if(this.sortedWorldRenderers[var7].skipRenderPass[var3]) { -+ -+ if (this.sortedWorldRenderers[var7].skipRenderPass[par3]) { - ++this.renderersSkippingRenderPass; -- } else if(!this.sortedWorldRenderers[var7].isInFrustum) { -+ } else if (!this.sortedWorldRenderers[var7].isInFrustum) { - ++this.renderersBeingClipped; -- } else if(this.occlusionEnabled && !this.sortedWorldRenderers[var7].isVisible) { -+ // Spout Start -+ } else if (this.occlusionEnabled && Configuration.ambientOcclusion && !this.sortedWorldRenderers[var7].isVisible) { -+ // Spout End - ++this.renderersBeingOccluded; - } else { - ++this.renderersBeingRendered; - } - } - -- if(!this.sortedWorldRenderers[var7].skipRenderPass[var3] && this.sortedWorldRenderers[var7].isInFrustum && (!this.occlusionEnabled || this.sortedWorldRenderers[var7].isVisible)) { -- int var8 = this.sortedWorldRenderers[var7].getGLCallListForPass(var3); -- if(var8 >= 0) { -- this.V.add(this.sortedWorldRenderers[var7]); -+ // Spout Start -+ if (!this.sortedWorldRenderers[var7].skipRenderPass[par3] && this.sortedWorldRenderers[var7].isInFrustum && (!this.occlusionEnabled && !Configuration.ambientOcclusion || this.sortedWorldRenderers[var7].isVisible)) { -+ // Spout End -+ int var8 = this.sortedWorldRenderers[var7].getGLCallListForPass(par3); -+ -+ if (var8 >= 0) { -+ this.glRenderLists.add(this.sortedWorldRenderers[var7]); - ++var6; - } - } - } - - EntityLivingBase var19 = this.mc.renderViewEntity; -- double var20 = var19.lastTickPosX + (var19.posX - var19.lastTickPosX) * var4; -- double var10 = var19.lastTickPosY + (var19.posY - var19.lastTickPosY) * var4; -- double var12 = var19.lastTickPosZ + (var19.posZ - var19.lastTickPosZ) * var4; -+ double var20 = var19.lastTickPosX + (var19.posX - var19.lastTickPosX) * par4; -+ double var10 = var19.lastTickPosY + (var19.posY - var19.lastTickPosY) * par4; -+ double var12 = var19.lastTickPosZ + (var19.posZ - var19.lastTickPosZ) * par4; - int var14 = 0; -- - int var15; -- for(var15 = 0; var15 < this.allRenderLists.length; ++var15) { -+ -+ for (var15 = 0; var15 < this.allRenderLists.length; ++var15) { - this.allRenderLists[var15].func_78421_b(); - } - -- for(var15 = 0; var15 < this.V.size(); ++var15) { -- WorldRenderer var16 = (WorldRenderer)this.V.get(var15); -+ for (var15 = 0; var15 < this.glRenderLists.size(); ++var15) { -+ WorldRenderer var16 = (WorldRenderer)this.glRenderLists.get(var15); - int var17 = -1; - -- for(int var18 = 0; var18 < var14; ++var18) { -- if(this.allRenderLists[var18].func_78418_a(var16.posXMinus, var16.posYMinus, var16.posZMinus)) { -+ for (int var18 = 0; var18 < var14; ++var18) { -+ if (this.allRenderLists[var18].func_78418_a(var16.posXMinus, var16.posYMinus, var16.posZMinus)) { - var17 = var18; - } - } - -- if(var17 < 0) { -+ if (var17 < 0) { - var17 = var14++; - this.allRenderLists[var17].func_78422_a(var16.posXMinus, var16.posYMinus, var16.posZMinus, var20, var10, var12); - } - -- this.allRenderLists[var17].func_78420_a(var16.getGLCallListForPass(var3)); -+ this.allRenderLists[var17].func_78420_a(var16.getGLCallListForPass(par3)); - } - -- this.renderAllRenderLists(var3, var4); -+ this.renderAllRenderLists(par3, par4); - return var6; - } - -- public void renderAllRenderLists(int var1, double var2) { -- this.mc.entityRenderer.enableLightmap(var2); -+ /** -+ * Render all render lists -+ */ -+ public void renderAllRenderLists(int par1, double par2) { -+ // Spout Start -+ RenderPass.enableDisableLightmap(this.mc.entityRenderer, par2, par1); -+ // Spout End - -- for(int var4 = 0; var4 < this.allRenderLists.length; ++var4) { -+ for (int var4 = 0; var4 < this.allRenderLists.length; ++var4) { - this.allRenderLists[var4].func_78419_a(); - } - -- this.mc.entityRenderer.disableLightmap(var2); -+ this.mc.entityRenderer.disableLightmap(par2); - } - - public void updateClouds() { - ++this.cloudTickCounter; -- if(this.cloudTickCounter % 20 == 0) { -- Iterator var1 = this.H.values().iterator(); -- -- while(var1.hasNext()) { -+ -+ if (this.cloudTickCounter % 20 == 0) { -+ Iterator var1 = this.damagedBlocks.values().iterator(); -+ -+ while (var1.hasNext()) { - DestroyBlockProgress var2 = (DestroyBlockProgress)var1.next(); - int var3 = var2.getCreationCloudUpdateTick(); -- if(this.cloudTickCounter - var3 > 400) { -+ -+ if (this.cloudTickCounter - var3 > 400) { - var1.remove(); - } - } - } -- - } - -- public void renderSky(float var1) { -- if(this.mc.theWorld.provider.dimensionId == 1) { -+ /** -+ * Renders the sky with the partial tick time. Args: partialTickTime -+ */ -+ public void renderSky(float par1) { -+ SkyRenderer.setup(this.theWorld, par1, this.theWorld.getCelestialAngle(par1)); -+ -+ if (this.mc.theWorld.provider.dimensionId == 1) { - GL11.glDisable(GL11.GL_FOG); - GL11.glDisable(GL11.GL_ALPHA_TEST); - GL11.glEnable(GL11.GL_BLEND); -@@ -652,30 +918,33 @@ - this.renderEngine.bindTexture(locationEndSkyPng); - Tessellator var21 = Tessellator.instance; - -- for(int var22 = 0; var22 < 6; ++var22) { -+ for (int var22 = 0; var22 < 6; ++var22) { - GL11.glPushMatrix(); -- if(var22 == 1) { -+ -+ if (var22 == 1) { - GL11.glRotatef(90.0F, 1.0F, 0.0F, 0.0F); - } - -- if(var22 == 2) { -+ if (var22 == 2) { - GL11.glRotatef(-90.0F, 1.0F, 0.0F, 0.0F); - } - -- if(var22 == 3) { -+ if (var22 == 3) { - GL11.glRotatef(180.0F, 1.0F, 0.0F, 0.0F); - } - -- if(var22 == 4) { -+ if (var22 == 4) { - GL11.glRotatef(90.0F, 0.0F, 0.0F, 1.0F); - } - -- if(var22 == 5) { -+ if (var22 == 5) { - GL11.glRotatef(-90.0F, 0.0F, 0.0F, 1.0F); - } - - var21.startDrawingQuads(); -- var21.setColorOpaque_I(2631720); -+ // MCPatcher Start -+ var21.setColorOpaque_I(ColorizeWorld.endSkyColor); -+ // MCPatcher End - var21.addVertexWithUV(-100.0D, -100.0D, -100.0D, 0.0D, 0.0D); - var21.addVertexWithUV(-100.0D, -100.0D, 100.0D, 0.0D, 16.0D); - var21.addVertexWithUV(100.0D, -100.0D, 100.0D, 16.0D, 16.0D); -@@ -687,14 +956,25 @@ - GL11.glDepthMask(true); - GL11.glEnable(GL11.GL_TEXTURE_2D); - GL11.glEnable(GL11.GL_ALPHA_TEST); -- } else if(this.mc.theWorld.provider.isSurfaceWorld()) { -+ } else if (this.mc.theWorld.provider.isSurfaceWorld()) { - GL11.glDisable(GL11.GL_TEXTURE_2D); -- Vec3 var2 = this.theWorld.getSkyColor(this.mc.renderViewEntity, var1); -+ Vec3 var2 = this.theWorld.getSkyColor(this.mc.renderViewEntity, par1); - float var3 = (float)var2.xCoord; - float var4 = (float)var2.yCoord; - float var5 = (float)var2.zCoord; -+ -+ // Spout Start -+ Color skyColor = SpoutClient.getInstance().getSkyManager().getSkyColor(); -+ if (skyColor != null) { -+ var3 = skyColor.getRedF(); -+ var4 = skyColor.getGreenF(); -+ var5 = skyColor.getBlueF(); -+ } -+ // Spout End -+ - float var8; -- if(this.mc.gameSettings.anaglyph) { -+ -+ if (this.mc.gameSettings.anaglyph) { - float var6 = (var3 * 30.0F + var4 * 59.0F + var5 * 11.0F) / 100.0F; - float var7 = (var3 * 30.0F + var4 * 70.0F) / 100.0F; - var8 = (var3 * 30.0F + var5 * 70.0F) / 100.0F; -@@ -708,29 +988,37 @@ - GL11.glDepthMask(false); - GL11.glEnable(GL11.GL_FOG); - GL11.glColor3f(var3, var4, var5); -+ // Spout Start -+ if (Configuration.isSky()) { - GL11.glCallList(this.glSkyList); -+ } -+ // Spout End - GL11.glDisable(GL11.GL_FOG); - GL11.glDisable(GL11.GL_ALPHA_TEST); - GL11.glEnable(GL11.GL_BLEND); - GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); - RenderHelper.disableStandardItemLighting(); -- float[] var24 = this.theWorld.provider.calcSunriseSunsetColors(this.theWorld.getCelestialAngle(var1), var1); -+ float[] var24 = this.theWorld.provider.calcSunriseSunsetColors(this.theWorld.getCelestialAngle(par1), par1); - float var9; - float var10; - float var11; - float var12; -- if(var24 != null) { -+ -+ // MCPatcher Start -+ if (var24 != null && Configuration.isSky()) { -+ // MCPatcher End - GL11.glDisable(GL11.GL_TEXTURE_2D); - GL11.glShadeModel(GL11.GL_SMOOTH); - GL11.glPushMatrix(); - GL11.glRotatef(90.0F, 1.0F, 0.0F, 0.0F); -- GL11.glRotatef(MathHelper.sin(this.theWorld.getCelestialAngleRadians(var1)) < 0.0F ? 180.0F : 0.0F, 0.0F, 0.0F, 1.0F); -+ GL11.glRotatef(MathHelper.sin(this.theWorld.getCelestialAngleRadians(par1)) < 0.0F ? 180.0F : 0.0F, 0.0F, 0.0F, 1.0F); - GL11.glRotatef(90.0F, 0.0F, 0.0F, 1.0F); - var8 = var24[0]; - var9 = var24[1]; - var10 = var24[2]; - float var13; -- if(this.mc.gameSettings.anaglyph) { -+ -+ if (this.mc.gameSettings.anaglyph) { - var11 = (var8 * 30.0F + var9 * 59.0F + var10 * 11.0F) / 100.0F; - var12 = (var8 * 30.0F + var9 * 70.0F) / 100.0F; - var13 = (var8 * 30.0F + var10 * 70.0F) / 100.0F; -@@ -745,7 +1033,7 @@ - byte var26 = 16; - var23.setColorRGBA_F(var24[0], var24[1], var24[2], 0.0F); - -- for(int var27 = 0; var27 <= var26; ++var27) { -+ for (int var27 = 0; var27 <= var26; ++var27) { - var13 = (float)var27 * (float)Math.PI * 2.0F / (float)var26; - float var14 = MathHelper.sin(var13); - float var15 = MathHelper.cos(var13); -@@ -760,40 +1048,64 @@ - GL11.glEnable(GL11.GL_TEXTURE_2D); - GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE); - GL11.glPushMatrix(); -- var8 = 1.0F - this.theWorld.getRainStrength(var1); -+ var8 = 1.0F - this.theWorld.getRainStrength(par1); - var9 = 0.0F; - var10 = 0.0F; - var11 = 0.0F; - GL11.glColor4f(1.0F, 1.0F, 1.0F, var8); - GL11.glTranslatef(var9, var10, var11); -- GL11.glRotatef(-90.0F, 0.0F, 1.0F, 0.0F); -- GL11.glRotatef(this.theWorld.getCelestialAngle(var1) * 360.0F, 1.0F, 0.0F, 0.0F); -+ GL11.glRotatef(-90.0F, 0.0F, 1.0F, 0.0F); -+ SkyRenderer.renderAll(); -+ GL11.glRotatef(this.theWorld.getCelestialAngle(par1) * 360.0F, 1.0F, 0.0F, 0.0F); - var12 = 30.0F; -- this.renderEngine.bindTexture(locationSunPng); -+ // Spout Start -+ if (SpoutClient.getInstance().getSkyManager().isSunVisible()) { -+ if (SpoutClient.getInstance().getSkyManager().getSunTextureUrl() == null || CustomTextureManager.getTexturePathFromUrl(SpoutClient.getInstance().getSkyManager().getSunTextureUrl()) == null) { -+ this.renderEngine.bindTexture(SkyRenderer.setupCelestialObject(locationSunPng)); -+ } else { -+ //ToDo: Spoutcraft API get image needs to be fixed. -+ //GL11.glBindTexture(GL11.GL_TEXTURE_2D, this.renderEngine.getTexture(CustomTextureManager.getTexturePathFromUrl(SpoutClient.getInstance().getSkyManager().getSunTextureUrl()))); -+ } -+ double multiplier = (SpoutClient.getInstance().getSkyManager().getSunSizePercent() / 100D); -+ // Spout End - var23.startDrawingQuads(); -- var23.addVertexWithUV((double)(-var12), 100.0D, (double)(-var12), 0.0D, 0.0D); -- var23.addVertexWithUV((double)var12, 100.0D, (double)(-var12), 1.0D, 0.0D); -- var23.addVertexWithUV((double)var12, 100.0D, (double)var12, 1.0D, 1.0D); -- var23.addVertexWithUV((double)(-var12), 100.0D, (double)var12, 0.0D, 1.0D); -+ // Spout Start -+ var23.addVertexWithUV((double)(-var12), 100.0D / multiplier, (double)(-var12), 0.0D, 0.0D); -+ var23.addVertexWithUV((double)var12, 100.0D / multiplier, (double)(-var12), 1.0D, 0.0D); -+ var23.addVertexWithUV((double)var12, 100.0D / multiplier, (double)var12, 1.0D, 1.0D); -+ var23.addVertexWithUV((double)(-var12), 100.0D / multiplier, (double)var12, 0.0D, 1.0D); - var23.draw(); -+ } -+ // Spout End - var12 = 20.0F; -- this.renderEngine.bindTexture(locationMoonPhasesPng); -- int var28 = this.theWorld.getMoonPhase(); -- int var29 = var28 % 4; -- int var30 = var28 / 4 % 2; -- float var16 = (float)(var29 + 0) / 4.0F; -- float var17 = (float)(var30 + 0) / 2.0F; -- float var18 = (float)(var29 + 1) / 4.0F; -- float var19 = (float)(var30 + 1) / 2.0F; -+ // Spout Start -+ if (SpoutClient.getInstance().getSkyManager().isMoonVisible()) { -+ if (SpoutClient.getInstance().getSkyManager().getMoonTextureUrl() == null || CustomTextureManager.getTexturePathFromUrl(SpoutClient.getInstance().getSkyManager().getMoonTextureUrl()) == null) { -+ this.renderEngine.bindTexture(SkyRenderer.setupCelestialObject(locationMoonPhasesPng)); -+ } else { -+ // ToDo: Spoutcraft API get image needs to be fixed. -+ //GL11.glBindTexture(GL11.GL_TEXTURE_2D, this.renderEngine.getTexture(CustomTextureManager.getTexturePathFromUrl(SpoutClient.getInstance().getSkyManager().getMoonTextureUrl()))); -+ } -+ int var26 = this.theWorld.getMoonPhase(); -+ int var27 = var26 % 4; -+ int var28 = var26 / 4 % 2; -+ float var16 = (float)(var27 + 0) / 4.0F; -+ float var17 = (float)(var28 + 0) / 2.0F; -+ float var18 = (float)(var27 + 1) / 4.0F; -+ float var19 = (float)(var28 + 1) / 2.0F; - var23.startDrawingQuads(); -+ double multiplier = (SpoutClient.getInstance().getSkyManager().getMoonSizePercent() / 100D); - var23.addVertexWithUV((double)(-var12), -100.0D, (double)var12, (double)var18, (double)var19); - var23.addVertexWithUV((double)var12, -100.0D, (double)var12, (double)var16, (double)var19); - var23.addVertexWithUV((double)var12, -100.0D, (double)(-var12), (double)var16, (double)var17); - var23.addVertexWithUV((double)(-var12), -100.0D, (double)(-var12), (double)var18, (double)var17); - var23.draw(); -+ } -+ // Spout End - GL11.glDisable(GL11.GL_TEXTURE_2D); -- float var20 = this.theWorld.getStarBrightness(var1) * var8; -- if(var20 > 0.0F) { -+ float var20 = this.theWorld.getStarBrightness(par1) * var8; -+ -+ if (var20 > 0.0F && !SkyRenderer.active) { - GL11.glColor4f(var20, var20, var20, var20); - GL11.glCallList(this.starGLCallList); - } -@@ -805,8 +1117,11 @@ - GL11.glPopMatrix(); - GL11.glDisable(GL11.GL_TEXTURE_2D); - GL11.glColor3f(0.0F, 0.0F, 0.0F); -- double var25 = this.mc.thePlayer.getPosition(var1).yCoord - this.theWorld.getHorizon(); -- if(var25 < 0.0D) { -+ double var25 = this.mc.thePlayer.getPosition(par1).yCoord - this.theWorld.getHorizon(); -+ -+ // Spout Start - Added stars condition -+ if (var25 < 0.0D && Configuration.isStars()) { -+ // Spout End - GL11.glPushMatrix(); - GL11.glTranslatef(0.0F, 12.0F, 0.0F); - GL11.glCallList(this.glSkyList2); -@@ -839,7 +1154,7 @@ - var23.draw(); - } - -- if(this.theWorld.provider.isSkyColored()) { -+ if (this.theWorld.provider.isSkyColored()) { - GL11.glColor3f(var3 * 0.2F + 0.04F, var4 * 0.2F + 0.04F, var5 * 0.6F + 0.1F); - } else { - GL11.glColor3f(var3, var4, var5); -@@ -847,32 +1162,42 @@ - - GL11.glPushMatrix(); - GL11.glTranslatef(0.0F, -((float)(var25 - 16.0D)), 0.0F); -+ // Spout Start -+ if (Configuration.isSky()) { - GL11.glCallList(this.glSkyList2); -+ } -+ // Spout End - GL11.glPopMatrix(); - GL11.glEnable(GL11.GL_TEXTURE_2D); - GL11.glDepthMask(true); - } - } - -- public void renderClouds(float var1) { -- if(this.mc.theWorld.provider.isSurfaceWorld()) { -- if(this.mc.gameSettings.fancyGraphics) { -- this.renderCloudsFancy(var1); -+ public void renderClouds(float par1) { -+ // Spout Start -+ if (!SpoutClient.getInstance().getSkyManager().isCloudsVisible() || !Configuration.isSky()) { -+ return; -+ } -+ if (this.mc.theWorld.provider.isSurfaceWorld()) { -+ if (ColorizeWorld.drawFancyClouds(Configuration.fancyClouds)) { -+ // Spout End -+ this.renderCloudsFancy(par1); - } else { - GL11.glDisable(GL11.GL_CULL_FACE); -- float var2 = (float)(this.mc.renderViewEntity.lastTickPosY + (this.mc.renderViewEntity.posY - this.mc.renderViewEntity.lastTickPosY) * (double)var1); -+ float var2 = (float)(this.mc.renderViewEntity.lastTickPosY + (this.mc.renderViewEntity.posY - this.mc.renderViewEntity.lastTickPosY) * (double)par1); - byte var3 = 32; - int var4 = 256 / var3; - Tessellator var5 = Tessellator.instance; - this.renderEngine.bindTexture(locationCloudsPng); - GL11.glEnable(GL11.GL_BLEND); - GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); -- Vec3 var6 = this.theWorld.getCloudColour(var1); -+ Vec3 var6 = this.theWorld.getCloudColour(par1); - float var7 = (float)var6.xCoord; - float var8 = (float)var6.yCoord; - float var9 = (float)var6.zCoord; - float var10; -- if(this.mc.gameSettings.anaglyph) { -+ -+ if (this.mc.gameSettings.anaglyph) { - var10 = (var7 * 30.0F + var8 * 59.0F + var9 * 11.0F) / 100.0F; - float var11 = (var7 * 30.0F + var8 * 70.0F) / 100.0F; - float var12 = (var7 * 30.0F + var9 * 70.0F) / 100.0F; -@@ -881,22 +1206,24 @@ - var9 = var12; - } - -- var10 = 0.5F / 1024.0F; -- double var24 = (double)((float)this.cloudTickCounter + var1); -- double var13 = this.mc.renderViewEntity.prevPosX + (this.mc.renderViewEntity.posX - this.mc.renderViewEntity.prevPosX) * (double)var1 + var24 * (double)0.03F; -- double var15 = this.mc.renderViewEntity.prevPosZ + (this.mc.renderViewEntity.posZ - this.mc.renderViewEntity.prevPosZ) * (double)var1; -+ var10 = 4.8828125E-4F; -+ double var24 = (double)((float)this.cloudTickCounter + par1); -+ double var13 = this.mc.renderViewEntity.prevPosX + (this.mc.renderViewEntity.posX - this.mc.renderViewEntity.prevPosX) * (double)par1 + var24 * 0.029999999329447746D; -+ double var15 = this.mc.renderViewEntity.prevPosZ + (this.mc.renderViewEntity.posZ - this.mc.renderViewEntity.prevPosZ) * (double)par1; - int var17 = MathHelper.floor_double(var13 / 2048.0D); - int var18 = MathHelper.floor_double(var15 / 2048.0D); - var13 -= (double)(var17 * 2048); - var15 -= (double)(var18 * 2048); -- float var19 = this.theWorld.provider.getCloudHeight() - var2 + 0.33F; -+ // Spout Start -+ float var19 = SpoutClient.getInstance().getSkyManager().getCloudHeight() - var2 + 0.33F; -+ // Spout End - float var20 = (float)(var13 * (double)var10); - float var21 = (float)(var15 * (double)var10); - var5.startDrawingQuads(); - var5.setColorRGBA_F(var7, var8, var9, 0.8F); - -- for(int var22 = -var3 * var4; var22 < var3 * var4; var22 += var3) { -- for(int var23 = -var3 * var4; var23 < var3 * var4; var23 += var3) { -+ for (int var22 = -var3 * var4; var22 < var3 * var4; var22 += var3) { -+ for (int var23 = -var3 * var4; var23 < var3 * var4; var23 += var3) { - var5.addVertexWithUV((double)(var22 + 0), (double)var19, (double)(var23 + var3), (double)((float)(var22 + 0) * var10 + var20), (double)((float)(var23 + var3) * var10 + var21)); - var5.addVertexWithUV((double)(var22 + var3), (double)var19, (double)(var23 + var3), (double)((float)(var22 + var3) * var10 + var20), (double)((float)(var23 + var3) * var10 + var21)); - var5.addVertexWithUV((double)(var22 + var3), (double)var19, (double)(var23 + 0), (double)((float)(var22 + var3) * var10 + var20), (double)((float)(var23 + 0) * var10 + var21)); -@@ -912,20 +1239,28 @@ - } - } - -- public boolean hasCloudFog(double var1, double var3, double var5, float var7) { -+ /** -+ * Checks if the given position is to be rendered with cloud fog -+ */ -+ public boolean hasCloudFog(double par1, double par3, double par5, float par7) { - return false; - } - -- public void renderCloudsFancy(float var1) { -+ /** -+ * Renders the 3d fancy clouds -+ */ -+ public void renderCloudsFancy(float par1) { - GL11.glDisable(GL11.GL_CULL_FACE); -- float var2 = (float)(this.mc.renderViewEntity.lastTickPosY + (this.mc.renderViewEntity.posY - this.mc.renderViewEntity.lastTickPosY) * (double)var1); -+ float var2 = (float)(this.mc.renderViewEntity.lastTickPosY + (this.mc.renderViewEntity.posY - this.mc.renderViewEntity.lastTickPosY) * (double)par1); - Tessellator var3 = Tessellator.instance; - float var4 = 12.0F; - float var5 = 4.0F; -- double var6 = (double)((float)this.cloudTickCounter + var1); -- double var8 = (this.mc.renderViewEntity.prevPosX + (this.mc.renderViewEntity.posX - this.mc.renderViewEntity.prevPosX) * (double)var1 + var6 * (double)0.03F) / (double)var4; -- double var10 = (this.mc.renderViewEntity.prevPosZ + (this.mc.renderViewEntity.posZ - this.mc.renderViewEntity.prevPosZ) * (double)var1) / (double)var4 + (double)0.33F; -- float var12 = this.theWorld.provider.getCloudHeight() - var2 + 0.33F; -+ double var6 = (double)((float)this.cloudTickCounter + par1); -+ double var8 = (this.mc.renderViewEntity.prevPosX + (this.mc.renderViewEntity.posX - this.mc.renderViewEntity.prevPosX) * (double)par1 + var6 * 0.029999999329447746D) / (double)var4; -+ double var10 = (this.mc.renderViewEntity.prevPosZ + (this.mc.renderViewEntity.posZ - this.mc.renderViewEntity.prevPosZ) * (double)par1) / (double)var4 + 0.33000001311302185D; -+ // Spout Start -+ float var12 = SpoutClient.getInstance().getSkyManager().getCloudHeight() - var2 + 0.33F; -+ // Spout End - int var13 = MathHelper.floor_double(var8 / 2048.0D); - int var14 = MathHelper.floor_double(var10 / 2048.0D); - var8 -= (double)(var13 * 2048); -@@ -933,14 +1268,23 @@ - this.renderEngine.bindTexture(locationCloudsPng); - GL11.glEnable(GL11.GL_BLEND); - GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); -- Vec3 var15 = this.theWorld.getCloudColour(var1); -+ Vec3 var15 = this.theWorld.getCloudColour(par1); - float var16 = (float)var15.xCoord; - float var17 = (float)var15.yCoord; - float var18 = (float)var15.zCoord; -+ // Spout Start -+ Color cloudColor = SpoutClient.getInstance().getSkyManager().getCloudColor(); -+ if (cloudColor != null) { -+ var16 = cloudColor.getRedF(); -+ var17 = cloudColor.getGreenF(); -+ var18 = cloudColor.getBlueF(); -+ } -+ // Spout End - float var19; -- float var20; - float var21; -- if(this.mc.gameSettings.anaglyph) { -+ float var20; -+ -+ if (this.mc.gameSettings.anaglyph) { - var19 = (var16 * 30.0F + var17 * 59.0F + var18 * 11.0F) / 100.0F; - var20 = (var16 * 30.0F + var17 * 70.0F) / 100.0F; - var21 = (var16 * 30.0F + var18 * 70.0F) / 100.0F; -@@ -958,14 +1302,14 @@ - float var23 = (float)(var10 - (double)MathHelper.floor_double(var10)); - byte var24 = 8; - byte var25 = 4; -- float var26 = 1.0F / 1024.0F; -+ float var26 = 9.765625E-4F; - GL11.glScalef(var4, 1.0F, var4); - -- for(int var27 = 0; var27 < 2; ++var27) { -- if(var27 == 0) { -+ for (int var27 = 0; var27 < 2; ++var27) { -+ if (var27 == 0) { - GL11.glColorMask(false, false, false, false); -- } else if(this.mc.gameSettings.anaglyph) { -- if(EntityRenderer.anaglyphField == 0) { -+ } else if (this.mc.gameSettings.anaglyph) { -+ if (EntityRenderer.anaglyphField == 0) { - GL11.glColorMask(false, true, true, true); - } else { - GL11.glColorMask(true, false, false, true); -@@ -974,14 +1318,15 @@ - GL11.glColorMask(true, true, true, true); - } - -- for(int var28 = -var25 + 1; var28 <= var25; ++var28) { -- for(int var29 = -var25 + 1; var29 <= var25; ++var29) { -+ for (int var28 = -var25 + 1; var28 <= var25; ++var28) { -+ for (int var29 = -var25 + 1; var29 <= var25; ++var29) { - var3.startDrawingQuads(); - float var30 = (float)(var28 * var24); - float var31 = (float)(var29 * var24); - float var32 = var30 - var22; - float var33 = var31 - var23; -- if(var12 > -var5 - 1.0F) { -+ -+ if (var12 > -var5 - 1.0F) { - var3.setColorRGBA_F(var16 * 0.7F, var17 * 0.7F, var18 * 0.7F, 0.8F); - var3.setNormal(0.0F, -1.0F, 0.0F); - var3.addVertexWithUV((double)(var32 + 0.0F), (double)(var12 + 0.0F), (double)(var33 + (float)var24), (double)((var30 + 0.0F) * var21 + var19), (double)((var31 + (float)var24) * var21 + var20)); -@@ -990,7 +1335,7 @@ - var3.addVertexWithUV((double)(var32 + 0.0F), (double)(var12 + 0.0F), (double)(var33 + 0.0F), (double)((var30 + 0.0F) * var21 + var19), (double)((var31 + 0.0F) * var21 + var20)); - } - -- if(var12 <= var5 + 1.0F) { -+ if (var12 <= var5 + 1.0F) { - var3.setColorRGBA_F(var16, var17, var18, 0.8F); - var3.setNormal(0.0F, 1.0F, 0.0F); - var3.addVertexWithUV((double)(var32 + 0.0F), (double)(var12 + var5 - var26), (double)(var33 + (float)var24), (double)((var30 + 0.0F) * var21 + var19), (double)((var31 + (float)var24) * var21 + var20)); -@@ -1001,10 +1346,11 @@ - - var3.setColorRGBA_F(var16 * 0.9F, var17 * 0.9F, var18 * 0.9F, 0.8F); - int var34; -- if(var28 > -1) { -+ -+ if (var28 > -1) { - var3.setNormal(-1.0F, 0.0F, 0.0F); - -- for(var34 = 0; var34 < var24; ++var34) { -+ for (var34 = 0; var34 < var24; ++var34) { - var3.addVertexWithUV((double)(var32 + (float)var34 + 0.0F), (double)(var12 + 0.0F), (double)(var33 + (float)var24), (double)((var30 + (float)var34 + 0.5F) * var21 + var19), (double)((var31 + (float)var24) * var21 + var20)); - var3.addVertexWithUV((double)(var32 + (float)var34 + 0.0F), (double)(var12 + var5), (double)(var33 + (float)var24), (double)((var30 + (float)var34 + 0.5F) * var21 + var19), (double)((var31 + (float)var24) * var21 + var20)); - var3.addVertexWithUV((double)(var32 + (float)var34 + 0.0F), (double)(var12 + var5), (double)(var33 + 0.0F), (double)((var30 + (float)var34 + 0.5F) * var21 + var19), (double)((var31 + 0.0F) * var21 + var20)); -@@ -1012,10 +1358,10 @@ - } - } - -- if(var28 <= 1) { -+ if (var28 <= 1) { - var3.setNormal(1.0F, 0.0F, 0.0F); - -- for(var34 = 0; var34 < var24; ++var34) { -+ for (var34 = 0; var34 < var24; ++var34) { - var3.addVertexWithUV((double)(var32 + (float)var34 + 1.0F - var26), (double)(var12 + 0.0F), (double)(var33 + (float)var24), (double)((var30 + (float)var34 + 0.5F) * var21 + var19), (double)((var31 + (float)var24) * var21 + var20)); - var3.addVertexWithUV((double)(var32 + (float)var34 + 1.0F - var26), (double)(var12 + var5), (double)(var33 + (float)var24), (double)((var30 + (float)var34 + 0.5F) * var21 + var19), (double)((var31 + (float)var24) * var21 + var20)); - var3.addVertexWithUV((double)(var32 + (float)var34 + 1.0F - var26), (double)(var12 + var5), (double)(var33 + 0.0F), (double)((var30 + (float)var34 + 0.5F) * var21 + var19), (double)((var31 + 0.0F) * var21 + var20)); -@@ -1024,10 +1370,11 @@ - } - - var3.setColorRGBA_F(var16 * 0.8F, var17 * 0.8F, var18 * 0.8F, 0.8F); -- if(var29 > -1) { -+ -+ if (var29 > -1) { - var3.setNormal(0.0F, 0.0F, -1.0F); - -- for(var34 = 0; var34 < var24; ++var34) { -+ for (var34 = 0; var34 < var24; ++var34) { - var3.addVertexWithUV((double)(var32 + 0.0F), (double)(var12 + var5), (double)(var33 + (float)var34 + 0.0F), (double)((var30 + 0.0F) * var21 + var19), (double)((var31 + (float)var34 + 0.5F) * var21 + var20)); - var3.addVertexWithUV((double)(var32 + (float)var24), (double)(var12 + var5), (double)(var33 + (float)var34 + 0.0F), (double)((var30 + (float)var24) * var21 + var19), (double)((var31 + (float)var34 + 0.5F) * var21 + var20)); - var3.addVertexWithUV((double)(var32 + (float)var24), (double)(var12 + 0.0F), (double)(var33 + (float)var34 + 0.0F), (double)((var30 + (float)var24) * var21 + var19), (double)((var31 + (float)var34 + 0.5F) * var21 + var20)); -@@ -1035,10 +1382,10 @@ - } - } - -- if(var29 <= 1) { -+ if (var29 <= 1) { - var3.setNormal(0.0F, 0.0F, 1.0F); - -- for(var34 = 0; var34 < var24; ++var34) { -+ for (var34 = 0; var34 < var24; ++var34) { - var3.addVertexWithUV((double)(var32 + 0.0F), (double)(var12 + var5), (double)(var33 + (float)var34 + 1.0F - var26), (double)((var30 + 0.0F) * var21 + var19), (double)((var31 + (float)var34 + 0.5F) * var21 + var20)); - var3.addVertexWithUV((double)(var32 + (float)var24), (double)(var12 + var5), (double)(var33 + (float)var34 + 1.0F - var26), (double)((var30 + (float)var24) * var21 + var19), (double)((var31 + (float)var34 + 0.5F) * var21 + var20)); - var3.addVertexWithUV((double)(var32 + (float)var24), (double)(var12 + 0.0F), (double)(var33 + (float)var34 + 1.0F - var26), (double)((var30 + (float)var24) * var21 + var19), (double)((var31 + (float)var34 + 0.5F) * var21 + var20)); -@@ -1056,67 +1403,75 @@ - GL11.glEnable(GL11.GL_CULL_FACE); - } - -- public boolean updateRenderers(EntityLivingBase var1, boolean var2) { -+ /** -+ * Updates some of the renderers sorted by distance from the player -+ */ -+ public boolean updateRenderers(EntityLivingBase par1EntityLivingBase, boolean par2) { - byte var3 = 2; -- RenderSorter var4 = new RenderSorter(var1); -+ RenderSorter var4 = new RenderSorter(par1EntityLivingBase); - WorldRenderer[] var5 = new WorldRenderer[var3]; - ArrayList var6 = null; -- int var7 = this.m.size(); -+ int var7 = this.worldRenderersToUpdate.size(); - int var8 = 0; - this.theWorld.theProfiler.startSection("nearChunksSearch"); -- - int var9; - WorldRenderer var10; - int var11; - int var12; -- label140: -- for(var9 = 0; var9 < var7; ++var9) { -- var10 = (WorldRenderer)this.m.get(var9); -- if(var10 != null) { -- if(!var2) { -- if(var10.distanceToEntitySquared(var1) > 256.0F) { -- for(var11 = 0; var11 < var3 && (var5[var11] == null || var4.doCompare(var5[var11], var10) <= 0); ++var11) { -+ label136: -+ -+ for (var9 = 0; var9 < var7; ++var9) { -+ var10 = (WorldRenderer)this.worldRenderersToUpdate.get(var9); -+ -+ if (var10 != null) { -+ if (!par2) { -+ if (var10.distanceToEntitySquared(par1EntityLivingBase) > 256.0F) { -+ for (var11 = 0; var11 < var3 && (var5[var11] == null || var4.doCompare(var5[var11], var10) <= 0); ++var11) { -+ ; - } - - --var11; -- if(var11 <= 0) { -- continue; -- } -- -- var12 = var11; -- -- while(true) { -- --var12; -- if(var12 == 0) { -- var5[var11] = var10; -- continue label140; -+ -+ if (var11 > 0) { -+ var12 = var11; -+ -+ while (true) { -+ --var12; -+ -+ if (var12 == 0) { -+ var5[var11] = var10; -+ continue label136; -+ } -+ -+ var5[var12 - 1] = var5[var12]; - } -- -- var5[var12 - 1] = var5[var12]; - } -+ -+ continue; - } -- } else if(!var10.isInFrustum) { -+ } else if (!var10.isInFrustum) { - continue; - } - -- if(var6 == null) { -+ if (var6 == null) { - var6 = new ArrayList(); - } - - ++var8; - var6.add(var10); -- this.m.set(var9, (Object)null); -+ this.worldRenderersToUpdate.set(var9, (Object)null); - } - } - - this.theWorld.theProfiler.endSection(); - this.theWorld.theProfiler.startSection("sort"); -- if(var6 != null) { -- if(var6.size() > 1) { -+ -+ if (var6 != null) { -+ if (var6.size() > 1) { - Collections.sort(var6, var4); - } - -- for(var9 = var6.size() - 1; var9 >= 0; --var9) { -+ for (var9 = var6.size() - 1; var9 >= 0; --var9) { - var10 = (WorldRenderer)var6.get(var9); - var10.updateRenderer(); - var10.needsUpdate = false; -@@ -1126,12 +1481,13 @@ - this.theWorld.theProfiler.endSection(); - var9 = 0; - this.theWorld.theProfiler.startSection("rebuild"); -- - int var16; -- for(var16 = var3 - 1; var16 >= 0; --var16) { -+ -+ for (var16 = var3 - 1; var16 >= 0; --var16) { - WorldRenderer var17 = var5[var16]; -- if(var17 != null) { -- if(!var17.isInFrustum && var16 != var3 - 1) { -+ -+ if (var17 != null) { -+ if (!var17.isInFrustum && var16 != var3 - 1) { - var5[var16] = null; - var5[0] = null; - break; -@@ -1148,20 +1504,21 @@ - var16 = 0; - var11 = 0; - -- for(var12 = this.m.size(); var16 != var12; ++var16) { -- WorldRenderer var13 = (WorldRenderer)this.m.get(var16); -- if(var13 != null) { -+ for (var12 = this.worldRenderersToUpdate.size(); var16 != var12; ++var16) { -+ WorldRenderer var13 = (WorldRenderer)this.worldRenderersToUpdate.get(var16); -+ -+ if (var13 != null) { - boolean var14 = false; - -- for(int var15 = 0; var15 < var3 && !var14; ++var15) { -- if(var13 == var5[var15]) { -+ for (int var15 = 0; var15 < var3 && !var14; ++var15) { -+ if (var13 == var5[var15]) { - var14 = true; - } - } - -- if(!var14) { -- if(var11 != var16) { -- this.m.set(var11, var13); -+ if (!var14) { -+ if (var11 != var16) { -+ this.worldRenderersToUpdate.set(var11, var13); - } - - ++var11; -@@ -1172,22 +1529,25 @@ - this.theWorld.theProfiler.endSection(); - this.theWorld.theProfiler.startSection("trim"); - -- while(true) { -+ while (true) { - --var16; -- if(var16 < var11) { -+ -+ if (var16 < var11) { - this.theWorld.theProfiler.endSection(); - return var7 == var8 + var9; - } - -- this.m.remove(var16); -+ this.worldRenderersToUpdate.remove(var16); - } - } - -- public void drawBlockDamageTexture(Tessellator var1, EntityPlayer var2, float var3) { -- double var4 = var2.lastTickPosX + (var2.posX - var2.lastTickPosX) * (double)var3; -- double var6 = var2.lastTickPosY + (var2.posY - var2.lastTickPosY) * (double)var3; -- double var8 = var2.lastTickPosZ + (var2.posZ - var2.lastTickPosZ) * (double)var3; -- if(!this.H.isEmpty()) { -+ // ToDO: this is where texture needs to be changed for breaking images for custom blocks -+ public void drawBlockDamageTexture(Tessellator par1Tessellator, EntityPlayer par2EntityPlayer, float par3) { -+ double var4 = par2EntityPlayer.lastTickPosX + (par2EntityPlayer.posX - par2EntityPlayer.lastTickPosX) * (double)par3; -+ double var6 = par2EntityPlayer.lastTickPosY + (par2EntityPlayer.posY - par2EntityPlayer.lastTickPosY) * (double)par3; -+ double var8 = par2EntityPlayer.lastTickPosZ + (par2EntityPlayer.posZ - par2EntityPlayer.lastTickPosZ) * (double)par3; -+ -+ if (!this.damagedBlocks.isEmpty()) { - GL11.glBlendFunc(GL11.GL_DST_COLOR, GL11.GL_SRC_COLOR); - this.renderEngine.bindTexture(TextureMap.locationBlocksTexture); - GL11.glColor4f(1.0F, 1.0F, 1.0F, 0.5F); -@@ -1196,22 +1556,24 @@ - GL11.glPolygonOffset(-3.0F, -3.0F); - GL11.glEnable(GL11.GL_POLYGON_OFFSET_FILL); - GL11.glEnable(GL11.GL_ALPHA_TEST); -- var1.startDrawingQuads(); -- var1.setTranslation(-var4, -var6, -var8); -- var1.disableColor(); -- Iterator var10 = this.H.values().iterator(); -+ par1Tessellator.startDrawingQuads(); -+ par1Tessellator.setTranslation(-var4, -var6, -var8); -+ par1Tessellator.disableColor(); -+ Iterator var10 = this.damagedBlocks.values().iterator(); - -- while(var10.hasNext()) { -+ while (var10.hasNext()) { - DestroyBlockProgress var11 = (DestroyBlockProgress)var10.next(); - double var12 = (double)var11.getPartialBlockX() - var4; - double var14 = (double)var11.getPartialBlockY() - var6; - double var16 = (double)var11.getPartialBlockZ() - var8; -- if(var12 * var12 + var14 * var14 + var16 * var16 > 1024.0D) { -+ -+ if (var12 * var12 + var14 * var14 + var16 * var16 > 1024.0D) { - var10.remove(); - } else { - int var18 = this.theWorld.getBlockId(var11.getPartialBlockX(), var11.getPartialBlockY(), var11.getPartialBlockZ()); - Block var19 = var18 > 0 ? Block.blocksList[var18] : null; -- if(var19 == null) { -+ -+ if (var19 == null) { - var19 = Block.stone; - } - -@@ -1219,8 +1581,8 @@ - } - } - -- var1.draw(); -- var1.setTranslation(0.0D, 0.0D, 0.0D); -+ par1Tessellator.draw(); -+ par1Tessellator.setTranslation(0.0D, 0.0D, 0.0D); - GL11.glDisable(GL11.GL_ALPHA_TEST); - GL11.glPolygonOffset(0.0F, 0.0F); - GL11.glDisable(GL11.GL_POLYGON_OFFSET_FILL); -@@ -1228,11 +1590,13 @@ - GL11.glDepthMask(true); - GL11.glPopMatrix(); - } -- - } - -- public void drawSelectionBox(EntityPlayer var1, MovingObjectPosition var2, int var3, float var4) { -- if(var3 == 0 && var2.typeOfHit == EnumMovingObjectType.TILE) { -+ /** -+ * Draws the selection box for the player. Args: entityPlayer, rayTraceHit, i, itemStack, partialTickTime -+ */ -+ public void drawSelectionBox(EntityPlayer par1EntityPlayer, MovingObjectPosition par2MovingObjectPosition, int par3, float par4) { -+ if (par3 == 0 && par2MovingObjectPosition.typeOfHit == EnumMovingObjectType.TILE) { - GL11.glEnable(GL11.GL_BLEND); - GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); - GL11.glColor4f(0.0F, 0.0F, 0.0F, 0.4F); -@@ -1240,269 +1604,326 @@ - GL11.glDisable(GL11.GL_TEXTURE_2D); - GL11.glDepthMask(false); - float var5 = 0.002F; -- int var6 = this.theWorld.getBlockId(var2.blockX, var2.blockY, var2.blockZ); -- if(var6 > 0) { -- Block.blocksList[var6].setBlockBoundsBasedOnState(this.theWorld, var2.blockX, var2.blockY, var2.blockZ); -- double var7 = var1.lastTickPosX + (var1.posX - var1.lastTickPosX) * (double)var4; -- double var9 = var1.lastTickPosY + (var1.posY - var1.lastTickPosY) * (double)var4; -- double var11 = var1.lastTickPosZ + (var1.posZ - var1.lastTickPosZ) * (double)var4; -- this.drawOutlinedBoundingBox(Block.blocksList[var6].getSelectedBoundingBoxFromPool(this.theWorld, var2.blockX, var2.blockY, var2.blockZ).expand((double)var5, (double)var5, (double)var5).getOffsetBoundingBox(-var7, -var9, -var11)); -+ int var6 = this.theWorld.getBlockId(par2MovingObjectPosition.blockX, par2MovingObjectPosition.blockY, par2MovingObjectPosition.blockZ); -+ -+ if (var6 > 0) { -+ Block.blocksList[var6].setBlockBoundsBasedOnState(this.theWorld, par2MovingObjectPosition.blockX, par2MovingObjectPosition.blockY, par2MovingObjectPosition.blockZ); -+ double var7 = par1EntityPlayer.lastTickPosX + (par1EntityPlayer.posX - par1EntityPlayer.lastTickPosX) * (double)par4; -+ double var9 = par1EntityPlayer.lastTickPosY + (par1EntityPlayer.posY - par1EntityPlayer.lastTickPosY) * (double)par4; -+ double var11 = par1EntityPlayer.lastTickPosZ + (par1EntityPlayer.posZ - par1EntityPlayer.lastTickPosZ) * (double)par4; -+ this.drawOutlinedBoundingBox(Block.blocksList[var6].getSelectedBoundingBoxFromPool(this.theWorld, par2MovingObjectPosition.blockX, par2MovingObjectPosition.blockY, par2MovingObjectPosition.blockZ).expand((double)var5, (double)var5, (double)var5).getOffsetBoundingBox(-var7, -var9, -var11)); - } - - GL11.glDepthMask(true); - GL11.glEnable(GL11.GL_TEXTURE_2D); - GL11.glDisable(GL11.GL_BLEND); - } -- - } - -- private void drawOutlinedBoundingBox(AxisAlignedBB var1) { -+ /** -+ * Draws lines for the edges of the bounding box. -+ */ -+ private void drawOutlinedBoundingBox(AxisAlignedBB par1AxisAlignedBB) { - Tessellator var2 = Tessellator.instance; - var2.startDrawing(3); -- var2.addVertex(var1.minX, var1.minY, var1.minZ); -- var2.addVertex(var1.maxX, var1.minY, var1.minZ); -- var2.addVertex(var1.maxX, var1.minY, var1.maxZ); -- var2.addVertex(var1.minX, var1.minY, var1.maxZ); -- var2.addVertex(var1.minX, var1.minY, var1.minZ); -+ var2.addVertex(par1AxisAlignedBB.minX, par1AxisAlignedBB.minY, par1AxisAlignedBB.minZ); -+ var2.addVertex(par1AxisAlignedBB.maxX, par1AxisAlignedBB.minY, par1AxisAlignedBB.minZ); -+ var2.addVertex(par1AxisAlignedBB.maxX, par1AxisAlignedBB.minY, par1AxisAlignedBB.maxZ); -+ var2.addVertex(par1AxisAlignedBB.minX, par1AxisAlignedBB.minY, par1AxisAlignedBB.maxZ); -+ var2.addVertex(par1AxisAlignedBB.minX, par1AxisAlignedBB.minY, par1AxisAlignedBB.minZ); - var2.draw(); - var2.startDrawing(3); -- var2.addVertex(var1.minX, var1.maxY, var1.minZ); -- var2.addVertex(var1.maxX, var1.maxY, var1.minZ); -- var2.addVertex(var1.maxX, var1.maxY, var1.maxZ); -- var2.addVertex(var1.minX, var1.maxY, var1.maxZ); -- var2.addVertex(var1.minX, var1.maxY, var1.minZ); -+ var2.addVertex(par1AxisAlignedBB.minX, par1AxisAlignedBB.maxY, par1AxisAlignedBB.minZ); -+ var2.addVertex(par1AxisAlignedBB.maxX, par1AxisAlignedBB.maxY, par1AxisAlignedBB.minZ); -+ var2.addVertex(par1AxisAlignedBB.maxX, par1AxisAlignedBB.maxY, par1AxisAlignedBB.maxZ); -+ var2.addVertex(par1AxisAlignedBB.minX, par1AxisAlignedBB.maxY, par1AxisAlignedBB.maxZ); -+ var2.addVertex(par1AxisAlignedBB.minX, par1AxisAlignedBB.maxY, par1AxisAlignedBB.minZ); - var2.draw(); - var2.startDrawing(1); -- var2.addVertex(var1.minX, var1.minY, var1.minZ); -- var2.addVertex(var1.minX, var1.maxY, var1.minZ); -- var2.addVertex(var1.maxX, var1.minY, var1.minZ); -- var2.addVertex(var1.maxX, var1.maxY, var1.minZ); -- var2.addVertex(var1.maxX, var1.minY, var1.maxZ); -- var2.addVertex(var1.maxX, var1.maxY, var1.maxZ); -- var2.addVertex(var1.minX, var1.minY, var1.maxZ); -- var2.addVertex(var1.minX, var1.maxY, var1.maxZ); -+ var2.addVertex(par1AxisAlignedBB.minX, par1AxisAlignedBB.minY, par1AxisAlignedBB.minZ); -+ var2.addVertex(par1AxisAlignedBB.minX, par1AxisAlignedBB.maxY, par1AxisAlignedBB.minZ); -+ var2.addVertex(par1AxisAlignedBB.maxX, par1AxisAlignedBB.minY, par1AxisAlignedBB.minZ); -+ var2.addVertex(par1AxisAlignedBB.maxX, par1AxisAlignedBB.maxY, par1AxisAlignedBB.minZ); -+ var2.addVertex(par1AxisAlignedBB.maxX, par1AxisAlignedBB.minY, par1AxisAlignedBB.maxZ); -+ var2.addVertex(par1AxisAlignedBB.maxX, par1AxisAlignedBB.maxY, par1AxisAlignedBB.maxZ); -+ var2.addVertex(par1AxisAlignedBB.minX, par1AxisAlignedBB.minY, par1AxisAlignedBB.maxZ); -+ var2.addVertex(par1AxisAlignedBB.minX, par1AxisAlignedBB.maxY, par1AxisAlignedBB.maxZ); - var2.draw(); - } - -- public void markBlocksForUpdate(int var1, int var2, int var3, int var4, int var5, int var6) { -- int var7 = MathHelper.bucketInt(var1, 16); -- int var8 = MathHelper.bucketInt(var2, 16); -- int var9 = MathHelper.bucketInt(var3, 16); -- int var10 = MathHelper.bucketInt(var4, 16); -- int var11 = MathHelper.bucketInt(var5, 16); -- int var12 = MathHelper.bucketInt(var6, 16); -+ /** -+ * Marks the blocks in the given range for update -+ */ -+ public void markBlocksForUpdate(int par1, int par2, int par3, int par4, int par5, int par6) { -+ int var7 = MathHelper.bucketInt(par1, 16); -+ int var8 = MathHelper.bucketInt(par2, 16); -+ int var9 = MathHelper.bucketInt(par3, 16); -+ int var10 = MathHelper.bucketInt(par4, 16); -+ int var11 = MathHelper.bucketInt(par5, 16); -+ int var12 = MathHelper.bucketInt(par6, 16); - -- for(int var13 = var7; var13 <= var10; ++var13) { -+ for (int var13 = var7; var13 <= var10; ++var13) { - int var14 = var13 % this.renderChunksWide; -- if(var14 < 0) { -+ -+ if (var14 < 0) { - var14 += this.renderChunksWide; - } - -- for(int var15 = var8; var15 <= var11; ++var15) { -+ for (int var15 = var8; var15 <= var11; ++var15) { - int var16 = var15 % this.renderChunksTall; -- if(var16 < 0) { -+ -+ if (var16 < 0) { - var16 += this.renderChunksTall; - } - -- for(int var17 = var9; var17 <= var12; ++var17) { -+ for (int var17 = var9; var17 <= var12; ++var17) { - int var18 = var17 % this.renderChunksDeep; -- if(var18 < 0) { -+ -+ if (var18 < 0) { - var18 += this.renderChunksDeep; - } - - int var19 = (var18 * this.renderChunksTall + var16) * this.renderChunksWide + var14; - WorldRenderer var20 = this.worldRenderers[var19]; -- if(var20 != null && !var20.needsUpdate) { -- this.m.add(var20); -+ -+ if (var20 != null && !var20.needsUpdate) { -+ this.worldRenderersToUpdate.add(var20); - var20.markDirty(); - } - } - } - } -- -- } -- -- public void markBlockForUpdate(int var1, int var2, int var3) { -- this.markBlocksForUpdate(var1 - 1, var2 - 1, var3 - 1, var1 + 1, var2 + 1, var3 + 1); -- } -- -- public void markBlockForRenderUpdate(int var1, int var2, int var3) { -- this.markBlocksForUpdate(var1 - 1, var2 - 1, var3 - 1, var1 + 1, var2 + 1, var3 + 1); -- } -- -- public void markBlockRangeForRenderUpdate(int var1, int var2, int var3, int var4, int var5, int var6) { -- this.markBlocksForUpdate(var1 - 1, var2 - 1, var3 - 1, var4 + 1, var5 + 1, var6 + 1); -- } -- -- public void clipRenderersByFrustum(ICamera var1, float var2) { -- for(int var3 = 0; var3 < this.worldRenderers.length; ++var3) { -- if(!this.worldRenderers[var3].skipAllRenderPasses() && (!this.worldRenderers[var3].isInFrustum || (var3 + this.frustumCheckOffset & 15) == 0)) { -- this.worldRenderers[var3].updateInFrustum(var1); -+ } -+ -+ /** -+ * On the client, re-renders the block. On the server, sends the block to the client (which will re-render it), -+ * including the tile entity description packet if applicable. Args: x, y, z -+ */ -+ public void markBlockForUpdate(int par1, int par2, int par3) { -+ this.markBlocksForUpdate(par1 - 1, par2 - 1, par3 - 1, par1 + 1, par2 + 1, par3 + 1); -+ } -+ -+ /** -+ * On the client, re-renders this block. On the server, does nothing. Used for lighting updates. -+ */ -+ public void markBlockForRenderUpdate(int par1, int par2, int par3) { -+ this.markBlocksForUpdate(par1 - 1, par2 - 1, par3 - 1, par1 + 1, par2 + 1, par3 + 1); -+ } -+ -+ /** -+ * On the client, re-renders all blocks in this range, inclusive. On the server, does nothing. Args: min x, min y, min -+ * z, max x, max y, max z -+ */ -+ public void markBlockRangeForRenderUpdate(int par1, int par2, int par3, int par4, int par5, int par6) { -+ this.markBlocksForUpdate(par1 - 1, par2 - 1, par3 - 1, par4 + 1, par5 + 1, par6 + 1); -+ } -+ -+ /** -+ * Checks all renderers that previously weren't in the frustum and 1/16th of those that previously were in the frustum -+ * for frustum clipping Args: frustum, partialTickTime -+ */ -+ public void clipRenderersByFrustum(ICamera par1ICamera, float par2) { -+ for (int var3 = 0; var3 < this.worldRenderers.length; ++var3) { -+ if (!this.worldRenderers[var3].skipAllRenderPasses() && (!this.worldRenderers[var3].isInFrustum || (var3 + this.frustumCheckOffset & 15) == 0)) { -+ this.worldRenderers[var3].updateInFrustum(par1ICamera); - } - } - - ++this.frustumCheckOffset; - } - -- public void playRecord(String var1, int var2, int var3, int var4) { -- ItemRecord var5 = ItemRecord.getRecord(var1); -- if(var1 != null && var5 != null) { -+ /** -+ * Plays the specified record. Arg: recordName, x, y, z -+ */ -+ public void playRecord(String par1Str, int par2, int par3, int par4) { -+ ItemRecord var5 = ItemRecord.getRecord(par1Str); -+ -+ if (par1Str != null && var5 != null) { - this.mc.ingameGUI.setRecordPlayingMessage(var5.getRecordTitle()); - } - -- this.mc.sndManager.playStreaming(var1, (float)var2, (float)var3, (float)var4); -- } -- -- public void playSound(String var1, double var2, double var4, double var6, float var8, float var9) { -- } -- -- public void playSoundToNearExcept(EntityPlayer var1, String var2, double var3, double var5, double var7, float var9, float var10) { -- } -- -- public void spawnParticle(String var1, double var2, double var4, double var6, double var8, double var10, double var12) { -+ this.mc.sndManager.playStreaming(par1Str, (float)par2, (float)par3, (float)par4); -+ } -+ -+ /** -+ * Plays the specified sound. Arg: soundName, x, y, z, volume, pitch -+ */ -+ public void playSound(String par1Str, double par2, double par4, double par6, float par8, float par9) {} -+ -+ /** -+ * Plays sound to all near players except the player reference given -+ */ -+ public void playSoundToNearExcept(EntityPlayer par1EntityPlayer, String par2Str, double par3, double par5, double par7, float par9, float par10) {} -+ -+ /** -+ * Spawns a particle. Arg: particleType, x, y, z, velX, velY, velZ -+ */ -+ public void spawnParticle(String par1Str, double par2, double par4, double par6, double par8, double par10, double par12) { -+ spawnParticle(par1Str, par2, par4, par6, par8, par10, par12, null); -+ } -+ -+ public void spawnParticle(String par1Str, double par2, double par4, double par6, double par8, double par10, double par12, Texture texture) { -+ // Spout Start -+ if (mc == null || theWorld == null || mc.renderViewEntity == null) { -+ return; -+ } -+ // Spout End - try { -- this.doSpawnParticle(var1, var2, var4, var6, var8, var10, var12); -+ this.doSpawnParticle(par1Str, par2, par4, par6, par8, par10, par12, texture); - } catch (Throwable var17) { - CrashReport var15 = CrashReport.makeCrashReport(var17, "Exception while adding particle"); - CrashReportCategory var16 = var15.makeCategory("Particle being added"); -- var16.addCrashSection("Name", var1); -- var16.addCrashSectionCallable("Position", new CallableParticlePositionInfo(this, var2, var4, var6)); -+ var16.addCrashSection("Name", par1Str); -+ var16.addCrashSectionCallable("Position", new CallableParticlePositionInfo(this, par2, par4, par6)); - throw new ReportedException(var15); - } - } - -- public EntityFX doSpawnParticle(String var1, double var2, double var4, double var6, double var8, double var10, double var12) { -- if(this.mc != null && this.mc.renderViewEntity != null && this.mc.effectRenderer != null) { -+ // Spout Start -+ public EntityFX doSpawnParticle(String par1Str, double par2, double par4, double par6, double par8, double par10, double par12) { -+ return doSpawnParticle(par1Str, par2, par4, par6, par8, par10, par12, null); -+ } -+ // Spout End -+ -+ /** -+ * Spawns a particle. Arg: particleType, x, y, z, velX, velY, velZ -+ */ -+ // Spout Start > Modified Particle Spawner -+ public EntityFX doSpawnParticle(String par1Str, double par2, double par4, double par6, double par8, double par10, double par12, Texture texture) { -+ if (this.mc != null && this.mc.renderViewEntity != null && this.mc.effectRenderer != null) { - int var14 = this.mc.gameSettings.particleSetting; -- if(var14 == 1 && this.theWorld.s.nextInt(3) == 0) { -+ if (var14 == 1 && this.theWorld.rand.nextInt(3) == 0) { - var14 = 2; - } - -- double var15 = this.mc.renderViewEntity.posX - var2; -- double var17 = this.mc.renderViewEntity.posY - var4; -- double var19 = this.mc.renderViewEntity.posZ - var6; -- Object var21 = null; -- EffectRenderer var10000; -- if(var1.equals("hugeexplosion")) { -- var10000 = this.mc.effectRenderer; -- var21 = new EntityHugeExplodeFX(this.theWorld, var2, var4, var6, var8, var10, var12); -- var10000.addEffect((EntityFX)var21); -- } else if(var1.equals("largeexplode")) { -- var10000 = this.mc.effectRenderer; -- var21 = new EntityLargeExplodeFX(this.renderEngine, this.theWorld, var2, var4, var6, var8, var10, var12); -- var10000.addEffect((EntityFX)var21); -- } else if(var1.equals("fireworksSpark")) { -- var10000 = this.mc.effectRenderer; -- var21 = new EntityFireworkSparkFX(this.theWorld, var2, var4, var6, var8, var10, var12, this.mc.effectRenderer); -- var10000.addEffect((EntityFX)var21); -+ double var15 = this.mc.renderViewEntity.posX - par2; -+ double var17 = this.mc.renderViewEntity.posY - par4; -+ double var19 = this.mc.renderViewEntity.posZ - par6; -+ EntityFX var21 = null; -+ -+ if (par1Str.equals("hugeexplosion")) { -+ this.mc.effectRenderer.addEffect(var21 = new EntityHugeExplodeFX(this.theWorld, par2, par4, par6, par8, par10, par12)); -+ } else if (par1Str.equals("largeexplode")) { -+ this.mc.effectRenderer.addEffect(var21 = new EntityLargeExplodeFX(this.renderEngine, this.theWorld, par2, par4, par6, par8, par10, par12)); -+ } else if (par1Str.equals("fireworksSpark")) { -+ this.mc.effectRenderer.addEffect(var21 = new EntityFireworkSparkFX(this.theWorld, par2, par4, par6, par8, par10, par12, this.mc.effectRenderer)); - } - -- if(var21 != null) { -+ if (var21 != null) { - return (EntityFX)var21; - } else { -- double var22 = 16.0D; -- if(var15 * var15 + var17 * var17 + var19 * var19 > var22 * var22) { -+ // Spout Start -+ double var22 = 6D; -+ if (!org.spoutcraft.client.config.Configuration.isFancyParticles()) { -+ var22 = 16.0D; -+ } -+ // Spout End -+ -+ if (var15 * var15 + var17 * var17 + var19 * var19 > var22 * var22) { - return null; -- } else if(var14 > 1) { -+ } else if (var14 > 1) { - return null; - } else { -- if(var1.equals("bubble")) { -- var21 = new EntityBubbleFX(this.theWorld, var2, var4, var6, var8, var10, var12); -- } else if(var1.equals("suspended")) { -- var21 = new EntitySuspendFX(this.theWorld, var2, var4, var6, var8, var10, var12); -- } else if(var1.equals("depthsuspend")) { -- var21 = new EntityAuraFX(this.theWorld, var2, var4, var6, var8, var10, var12); -- } else if(var1.equals("townaura")) { -- var21 = new EntityAuraFX(this.theWorld, var2, var4, var6, var8, var10, var12); -- } else if(var1.equals("crit")) { -- var21 = new EntityCritFX(this.theWorld, var2, var4, var6, var8, var10, var12); -- } else if(var1.equals("magicCrit")) { -- var21 = new EntityCritFX(this.theWorld, var2, var4, var6, var8, var10, var12); -+ if (par1Str.equals("bubble")) { -+ var21 = new EntityBubbleFX(this.theWorld, par2, par4, par6, par8, par10, par12); -+ } else if (par1Str.equals("suspended")) { -+ var21 = new EntitySuspendFX(this.theWorld, par2, par4, par6, par8, par10, par12); -+ } else if (par1Str.equals("depthsuspend")) { -+ var21 = new EntityAuraFX(this.theWorld, par2, par4, par6, par8, par10, par12); -+ } else if (par1Str.equals("townaura")) { -+ // MCPatcher Start -+ var21 = (new EntityAuraFX(this.theWorld, par2, par4, par6, par8, par10, par12)).colorize(); -+ // MCPatcher End -+ } else if (par1Str.equals("crit")) { -+ var21 = new EntityCritFX(this.theWorld, par2, par4, par6, par8, par10, par12); -+ } else if (par1Str.equals("magicCrit")) { -+ var21 = new EntityCritFX(this.theWorld, par2, par4, par6, par8, par10, par12); - ((EntityFX)var21).setRBGColorF(((EntityFX)var21).getRedColorF() * 0.3F, ((EntityFX)var21).getGreenColorF() * 0.8F, ((EntityFX)var21).getBlueColorF()); - ((EntityFX)var21).nextTextureIndexX(); -- } else if(var1.equals("smoke")) { -- var21 = new EntitySmokeFX(this.theWorld, var2, var4, var6, var8, var10, var12); -- } else if(var1.equals("mobSpell")) { -- var21 = new EntitySpellParticleFX(this.theWorld, var2, var4, var6, 0.0D, 0.0D, 0.0D); -- ((EntityFX)var21).setRBGColorF((float)var8, (float)var10, (float)var12); -- } else if(var1.equals("mobSpellAmbient")) { -- var21 = new EntitySpellParticleFX(this.theWorld, var2, var4, var6, 0.0D, 0.0D, 0.0D); -+ } else if (par1Str.equals("smoke")) { -+ var21 = new EntitySmokeFX(this.theWorld, par2, par4, par6, par8, par10, par12); -+ } else if (par1Str.equals("mobSpell")) { -+ var21 = new EntitySpellParticleFX(this.theWorld, par2, par4, par6, 0.0D, 0.0D, 0.0D); -+ ((EntityFX)var21).setRBGColorF((float)par8, (float)par10, (float)par12); -+ } else if (par1Str.equals("mobSpellAmbient")) { -+ var21 = new EntitySpellParticleFX(this.theWorld, par2, par4, par6, 0.0D, 0.0D, 0.0D); - ((EntityFX)var21).setAlphaF(0.15F); -- ((EntityFX)var21).setRBGColorF((float)var8, (float)var10, (float)var12); -- } else if(var1.equals("spell")) { -- var21 = new EntitySpellParticleFX(this.theWorld, var2, var4, var6, var8, var10, var12); -- } else if(var1.equals("instantSpell")) { -- var21 = new EntitySpellParticleFX(this.theWorld, var2, var4, var6, var8, var10, var12); -- ((EntitySpellParticleFX)var21).setBaseSpellTextureIndex(144); -- } else if(var1.equals("witchMagic")) { -- var21 = new EntitySpellParticleFX(this.theWorld, var2, var4, var6, var8, var10, var12); -- ((EntitySpellParticleFX)var21).setBaseSpellTextureIndex(144); -- float var24 = this.theWorld.s.nextFloat() * 0.5F + 0.35F; -+ ((EntityFX)var21).setRBGColorF((float)par8, (float)par10, (float)par12); -+ } else if (par1Str.equals("spell")) { -+ var21 = new EntitySpellParticleFX(this.theWorld, par2, par4, par6, par8, par10, par12); -+ } else if (par1Str.equals("instantSpell")) { -+ var21 = new EntitySpellParticleFX(this.theWorld, par2, par4, par6, par8, par10, par12); -+ ((EntitySpellParticleFX)var21).setBaseSpellTextureIndex(144); -+ } else if (par1Str.equals("witchMagic")) { -+ var21 = new EntitySpellParticleFX(this.theWorld, par2, par4, par6, par8, par10, par12); -+ ((EntitySpellParticleFX)var21).setBaseSpellTextureIndex(144); -+ float var24 = this.theWorld.rand.nextFloat() * 0.5F + 0.35F; - ((EntityFX)var21).setRBGColorF(1.0F * var24, 0.0F * var24, 1.0F * var24); -- } else if(var1.equals("note")) { -- var21 = new EntityNoteFX(this.theWorld, var2, var4, var6, var8, var10, var12); -- } else if(var1.equals("portal")) { -- var21 = new EntityPortalFX(this.theWorld, var2, var4, var6, var8, var10, var12); -- } else if(var1.equals("enchantmenttable")) { -- var21 = new EntityEnchantmentTableParticleFX(this.theWorld, var2, var4, var6, var8, var10, var12); -- } else if(var1.equals("explode")) { -- var21 = new EntityExplodeFX(this.theWorld, var2, var4, var6, var8, var10, var12); -- } else if(var1.equals("flame")) { -- var21 = new EntityFlameFX(this.theWorld, var2, var4, var6, var8, var10, var12); -- } else if(var1.equals("lava")) { -- var21 = new EntityLavaFX(this.theWorld, var2, var4, var6); -- } else if(var1.equals("footstep")) { -- var21 = new EntityFootStepFX(this.renderEngine, this.theWorld, var2, var4, var6); -- } else if(var1.equals("splash")) { -- var21 = new EntitySplashFX(this.theWorld, var2, var4, var6, var8, var10, var12); -- } else if(var1.equals("largesmoke")) { -- var21 = new EntitySmokeFX(this.theWorld, var2, var4, var6, var8, var10, var12, 2.5F); -- } else if(var1.equals("cloud")) { -- var21 = new EntityCloudFX(this.theWorld, var2, var4, var6, var8, var10, var12); -- } else if(var1.equals("reddust")) { -- var21 = new EntityReddustFX(this.theWorld, var2, var4, var6, (float)var8, (float)var10, (float)var12); -- } else if(var1.equals("snowballpoof")) { -- var21 = new EntityBreakingFX(this.theWorld, var2, var4, var6, Item.snowball); -- } else if(var1.equals("dripWater")) { -- var21 = new EntityDropParticleFX(this.theWorld, var2, var4, var6, Material.water); -- } else if(var1.equals("dripLava")) { -- var21 = new EntityDropParticleFX(this.theWorld, var2, var4, var6, Material.lava); -- } else if(var1.equals("snowshovel")) { -- var21 = new EntitySnowShovelFX(this.theWorld, var2, var4, var6, var8, var10, var12); -- } else if(var1.equals("slime")) { -- var21 = new EntityBreakingFX(this.theWorld, var2, var4, var6, Item.slimeBall); -- } else if(var1.equals("heart")) { -- var21 = new EntityHeartFX(this.theWorld, var2, var4, var6, var8, var10, var12); -- } else if(var1.equals("angryVillager")) { -- var21 = new EntityHeartFX(this.theWorld, var2, var4 + 0.5D, var6, var8, var10, var12); -+ } else if (par1Str.equals("note")) { -+ var21 = new EntityNoteFX(this.theWorld, par2, par4, par6, par8, par10, par12); -+ } else if (par1Str.equals("portal")) { -+ var21 = new EntityPortalFX(this.theWorld, par2, par4, par6, par8, par10, par12); -+ } else if (par1Str.equals("enchantmenttable")) { -+ var21 = new EntityEnchantmentTableParticleFX(this.theWorld, par2, par4, par6, par8, par10, par12); -+ } else if (par1Str.equals("explode")) { -+ var21 = new EntityExplodeFX(this.theWorld, par2, par4, par6, par8, par10, par12); -+ } else if (par1Str.equals("flame")) { -+ var21 = new EntityFlameFX(this.theWorld, par2, par4, par6, par8, par10, par12); -+ } else if (par1Str.equals("lava")) { -+ var21 = new EntityLavaFX(this.theWorld, par2, par4, par6); -+ } else if (par1Str.equals("footstep")) { -+ var21 = new EntityFootStepFX(this.renderEngine, this.theWorld, par2, par4, par6); -+ } else if (par1Str.equals("splash")) { -+ var21 = new EntitySplashFX(this.theWorld, par2, par4, par6, par8, par10, par12); -+ } else if (par1Str.equals("largesmoke")) { -+ var21 = new EntitySmokeFX(this.theWorld, par2, par4, par6, par8, par10, par12, 2.5F); -+ } else if (par1Str.equals("cloud")) { -+ var21 = new EntityCloudFX(this.theWorld, par2, par4, par6, par8, par10, par12); -+ } else if (par1Str.equals("reddust")) { -+ var21 = new EntityReddustFX(this.theWorld, par2, par4, par6, (float)par8, (float)par10, (float)par12); -+ } else if (par1Str.equals("snowballpoof")) { -+ var21 = new EntityBreakingFX(this.theWorld, par2, par4, par6, Item.snowball); -+ } else if (par1Str.equals("dripWater")) { -+ var21 = new EntityDropParticleFX(this.theWorld, par2, par4, par6, Material.water); -+ } else if (par1Str.equals("dripLava")) { -+ var21 = new EntityDropParticleFX(this.theWorld, par2, par4, par6, Material.lava); -+ } else if (par1Str.equals("snowshovel")) { -+ var21 = new EntitySnowShovelFX(this.theWorld, par2, par4, par6, par8, par10, par12); -+ } else if (par1Str.equals("slime")) { -+ var21 = new EntityBreakingFX(this.theWorld, par2, par4, par6, Item.slimeBall); -+ } else if (par1Str.equals("heart")) { -+ var21 = new EntityHeartFX(this.theWorld, par2, par4, par6, par8, par10, par12); -+ } else if (par1Str.equals("angryVillager")) { -+ var21 = new EntityHeartFX(this.theWorld, par2, par4 + 0.5D, par6, par8, par10, par12); - ((EntityFX)var21).setParticleTextureIndex(81); - ((EntityFX)var21).setRBGColorF(1.0F, 1.0F, 1.0F); -- } else if(var1.equals("happyVillager")) { -- var21 = new EntityAuraFX(this.theWorld, var2, var4, var6, var8, var10, var12); -+ } else if (par1Str.equals("happyVillager")) { -+ var21 = new EntityAuraFX(this.theWorld, par2, par4, par6, par8, par10, par12); - ((EntityFX)var21).setParticleTextureIndex(82); - ((EntityFX)var21).setRBGColorF(1.0F, 1.0F, 1.0F); - } else { - int var25; -- int var26; - String[] var27; -- if(var1.startsWith("iconcrack_")) { -- var27 = var1.split("_", 3); -+ int var26; -+ -+ if (par1Str.startsWith("iconcrack_")) { -+ var27 = par1Str.split("_", 3); - var25 = Integer.parseInt(var27[1]); -- if(var27.length > 2) { -+ if (var27.length > 2) { - var26 = Integer.parseInt(var27[2]); -- var21 = new EntityBreakingFX(this.theWorld, var2, var4, var6, var8, var10, var12, Item.itemsList[var25], var26); -+ var21 = new EntityBreakingFX(this.theWorld, par2, par4, par6, par8, par10, par12, Item.itemsList[var25], var26, texture); - } else { -- var21 = new EntityBreakingFX(this.theWorld, var2, var4, var6, var8, var10, var12, Item.itemsList[var25], 0); -+ var21 = new EntityBreakingFX(this.theWorld, par2, par4, par6, par8, par10, par12, Item.itemsList[var25], 0, texture); - } -- } else if(var1.startsWith("tilecrack_")) { -- var27 = var1.split("_", 3); -+ } else if (par1Str.startsWith("tilecrack_")) { -+ var27 = par1Str.split("_", 3); - var25 = Integer.parseInt(var27[1]); - var26 = Integer.parseInt(var27[2]); -- var21 = (new EntityDiggingFX(this.theWorld, var2, var4, var6, var8, var10, var12, Block.blocksList[var25], var26)).applyRenderColor(var26); -+ var21 = (new EntityDiggingFX(this.theWorld, par2, par4, par6, par8, par10, par12, Block.blocksList[var25], var26, texture)).applyRenderColor(var26); - } - } - -- if(var21 != null) { -+ if (var21 != null) { - this.mc.effectRenderer.addEffect((EntityFX)var21); - } - -@@ -1514,47 +1935,95 @@ - } - } - -- public void onEntityCreate(Entity var1) { -- } -- -- public void onEntityDestroy(Entity var1) { -- } -- -+ /** -+ * Called on all IWorldAccesses when an entity is created or loaded. On client worlds, starts downloading any necessary -+ * textures. On server worlds, adds the entity to the entity tracker. -+ */ -+ public void onEntityCreate(Entity par1Entity) { -+ //ToDo: this needs to be fixed up, the below calls are no longer valid. -+ /* -+ par1Entity.updateCloak(); -+ -+ if (par1Entity.skinUrl != null) { -+ // Spout Start -+ this.renderEngine.obtainImageData(par1Entity.skinUrl, new HDImageBufferDownload()); -+ // Spout End -+ } -+ -+ if (par1Entity.cloakUrl != null) { -+ // Spout Start -+ this.renderEngine.obtainImageData(par1Entity.cloakUrl, new HDImageBufferDownload()); -+ // Spout End -+ } -+ */ -+ } -+ -+ /** -+ * Called on all IWorldAccesses when an entity is unloaded or destroyed. On client worlds, releases any downloaded -+ * textures. On server worlds, removes the entity from the entity tracker. -+ */ -+ public void onEntityDestroy(Entity par1Entity) { -+ //ToDo: this needs to be fixed up, the below calls are no longer valid. -+ /* -+ if (par1Entity.skinUrl != null) { -+ this.renderEngine.releaseImageData(par1Entity.skinUrl); -+ } -+ -+ if (par1Entity.cloakUrl != null) { -+ this.renderEngine.releaseImageData(par1Entity.cloakUrl); -+ } -+ */ -+ } -+ -+ /** -+ * Deletes all display lists -+ */ - public void deleteAllDisplayLists() { - GLAllocation.deleteDisplayLists(this.glRenderListBase); - } - -- public void broadcastSound(int var1, int var2, int var3, int var4, int var5) { -- Random var6 = this.theWorld.s; -- switch(var1) { -- case 1013: -- case 1018: -- if(this.mc.renderViewEntity != null) { -- double var7 = (double)var2 - this.mc.renderViewEntity.posX; -- double var9 = (double)var3 - this.mc.renderViewEntity.posY; -- double var11 = (double)var4 - this.mc.renderViewEntity.posZ; -- double var13 = Math.sqrt(var7 * var7 + var9 * var9 + var11 * var11); -- double var15 = this.mc.renderViewEntity.posX; -- double var17 = this.mc.renderViewEntity.posY; -- double var19 = this.mc.renderViewEntity.posZ; -- if(var13 > 0.0D) { -- var15 += var7 / var13 * 2.0D; -- var17 += var9 / var13 * 2.0D; -- var19 += var11 / var13 * 2.0D; -- } -- -- if(var1 == 1013) { -- this.theWorld.playSound(var15, var17, var19, "mob.wither.spawn", 1.0F, 1.0F, false); -- } else if(var1 == 1018) { -- this.theWorld.playSound(var15, var17, var19, "mob.enderdragon.end", 5.0F, 1.0F, false); -- } -- } -- default: -+ public void broadcastSound(int par1, int par2, int par3, int par4, int par5) { -+ Random var6 = this.theWorld.rand; -+ -+ switch (par1) { -+ case 1013: -+ case 1018: -+ if (this.mc.renderViewEntity != null) { -+ double var7 = (double)par2 - this.mc.renderViewEntity.posX; -+ double var9 = (double)par3 - this.mc.renderViewEntity.posY; -+ double var11 = (double)par4 - this.mc.renderViewEntity.posZ; -+ double var13 = Math.sqrt(var7 * var7 + var9 * var9 + var11 * var11); -+ double var15 = this.mc.renderViewEntity.posX; -+ double var17 = this.mc.renderViewEntity.posY; -+ double var19 = this.mc.renderViewEntity.posZ; -+ -+ if (var13 > 0.0D) { -+ var15 += var7 / var13 * 2.0D; -+ var17 += var9 / var13 * 2.0D; -+ var19 += var11 / var13 * 2.0D; -+ } -+ -+ if (par1 == 1013) { -+ this.theWorld.playSound(var15, var17, var19, "mob.wither.spawn", 1.0F, 1.0F, false); -+ } else if (par1 == 1018) { -+ this.theWorld.playSound(var15, var17, var19, "mob.enderdragon.end", 5.0F, 1.0F, false); -+ } -+ } -+ -+ default: - } - } - -- public void playAuxSFX(EntityPlayer var1, int var2, int var3, int var4, int var5, int var6) { -- Random var7 = this.theWorld.s; -+ /** -+ * Plays a pre-canned sound effect along with potentially auxiliary data-driven one-shot behaviour (particles, etc). -+ */ -+ public void playAuxSFX(EntityPlayer par1EntityPlayer, int par2, int par3, int par4, int par5, int par6) { -+ // Spout Start -+ if (mc == null || theWorld == null || mc.renderViewEntity == null) { -+ return; -+ } -+ // Spout End -+ Random var7 = this.theWorld.rand; - double var8; - double var10; - double var12; -@@ -1566,189 +2035,303 @@ - double var27; - double var29; - double var39; -- switch(var2) { -- case 1000: -- this.theWorld.playSound((double)var3, (double)var4, (double)var5, "random.click", 1.0F, 1.0F, false); -- break; -- case 1001: -- this.theWorld.playSound((double)var3, (double)var4, (double)var5, "random.click", 1.0F, 1.2F, false); -- break; -- case 1002: -- this.theWorld.playSound((double)var3, (double)var4, (double)var5, "random.bow", 1.0F, 1.2F, false); -- break; -- case 1003: -- if(Math.random() < 0.5D) { -- this.theWorld.playSound((double)var3 + 0.5D, (double)var4 + 0.5D, (double)var5 + 0.5D, "random.door_open", 1.0F, this.theWorld.s.nextFloat() * 0.1F + 0.9F, false); -- } else { -- this.theWorld.playSound((double)var3 + 0.5D, (double)var4 + 0.5D, (double)var5 + 0.5D, "random.door_close", 1.0F, this.theWorld.s.nextFloat() * 0.1F + 0.9F, false); -- } -- break; -- case 1004: -- this.theWorld.playSound((double)((float)var3 + 0.5F), (double)((float)var4 + 0.5F), (double)((float)var5 + 0.5F), "random.fizz", 0.5F, 2.6F + (var7.nextFloat() - var7.nextFloat()) * 0.8F, false); -- break; -- case 1005: -- if(Item.itemsList[var6] instanceof ItemRecord) { -- this.theWorld.playRecord(((ItemRecord)Item.itemsList[var6]).a, var3, var4, var5); -- } else { -- this.theWorld.playRecord((String)null, var3, var4, var5); -- } -- break; -- case 1007: -- this.theWorld.playSound((double)var3 + 0.5D, (double)var4 + 0.5D, (double)var5 + 0.5D, "mob.ghast.charge", 10.0F, (var7.nextFloat() - var7.nextFloat()) * 0.2F + 1.0F, false); -- break; -- case 1008: -- this.theWorld.playSound((double)var3 + 0.5D, (double)var4 + 0.5D, (double)var5 + 0.5D, "mob.ghast.fireball", 10.0F, (var7.nextFloat() - var7.nextFloat()) * 0.2F + 1.0F, false); -- break; -- case 1009: -- this.theWorld.playSound((double)var3 + 0.5D, (double)var4 + 0.5D, (double)var5 + 0.5D, "mob.ghast.fireball", 2.0F, (var7.nextFloat() - var7.nextFloat()) * 0.2F + 1.0F, false); -- break; -- case 1010: -- this.theWorld.playSound((double)var3 + 0.5D, (double)var4 + 0.5D, (double)var5 + 0.5D, "mob.zombie.wood", 2.0F, (var7.nextFloat() - var7.nextFloat()) * 0.2F + 1.0F, false); -- break; -- case 1011: -- this.theWorld.playSound((double)var3 + 0.5D, (double)var4 + 0.5D, (double)var5 + 0.5D, "mob.zombie.metal", 2.0F, (var7.nextFloat() - var7.nextFloat()) * 0.2F + 1.0F, false); -- break; -- case 1012: -- this.theWorld.playSound((double)var3 + 0.5D, (double)var4 + 0.5D, (double)var5 + 0.5D, "mob.zombie.woodbreak", 2.0F, (var7.nextFloat() - var7.nextFloat()) * 0.2F + 1.0F, false); -- break; -- case 1014: -- this.theWorld.playSound((double)var3 + 0.5D, (double)var4 + 0.5D, (double)var5 + 0.5D, "mob.wither.shoot", 2.0F, (var7.nextFloat() - var7.nextFloat()) * 0.2F + 1.0F, false); -- break; -- case 1015: -- this.theWorld.playSound((double)var3 + 0.5D, (double)var4 + 0.5D, (double)var5 + 0.5D, "mob.bat.takeoff", 0.05F, (var7.nextFloat() - var7.nextFloat()) * 0.2F + 1.0F, false); -- break; -- case 1016: -- this.theWorld.playSound((double)var3 + 0.5D, (double)var4 + 0.5D, (double)var5 + 0.5D, "mob.zombie.infect", 2.0F, (var7.nextFloat() - var7.nextFloat()) * 0.2F + 1.0F, false); -- break; -- case 1017: -- this.theWorld.playSound((double)var3 + 0.5D, (double)var4 + 0.5D, (double)var5 + 0.5D, "mob.zombie.unfect", 2.0F, (var7.nextFloat() - var7.nextFloat()) * 0.2F + 1.0F, false); -- break; -- case 1020: -- this.theWorld.playSound((double)((float)var3 + 0.5F), (double)((float)var4 + 0.5F), (double)((float)var5 + 0.5F), "random.anvil_break", 1.0F, this.theWorld.s.nextFloat() * 0.1F + 0.9F, false); -- break; -- case 1021: -- this.theWorld.playSound((double)((float)var3 + 0.5F), (double)((float)var4 + 0.5F), (double)((float)var5 + 0.5F), "random.anvil_use", 1.0F, this.theWorld.s.nextFloat() * 0.1F + 0.9F, false); -- break; -- case 1022: -- this.theWorld.playSound((double)((float)var3 + 0.5F), (double)((float)var4 + 0.5F), (double)((float)var5 + 0.5F), "random.anvil_land", 0.3F, this.theWorld.s.nextFloat() * 0.1F + 0.9F, false); -- break; -- case 2000: -- int var33 = var6 % 3 - 1; -- int var9 = var6 / 3 % 3 - 1; -- var10 = (double)var3 + (double)var33 * 0.6D + 0.5D; -- var12 = (double)var4 + 0.5D; -- double var34 = (double)var5 + (double)var9 * 0.6D + 0.5D; -- -- for(int var36 = 0; var36 < 10; ++var36) { -- double var37 = var7.nextDouble() * 0.2D + 0.01D; -- double var38 = var10 + (double)var33 * 0.01D + (var7.nextDouble() - 0.5D) * (double)var9 * 0.5D; -- var39 = var12 + (var7.nextDouble() - 0.5D) * 0.5D; -- var23 = var34 + (double)var9 * 0.01D + (var7.nextDouble() - 0.5D) * (double)var33 * 0.5D; -- var25 = (double)var33 * var37 + var7.nextGaussian() * 0.01D; -- var27 = -0.03D + var7.nextGaussian() * 0.01D; -- var29 = (double)var9 * var37 + var7.nextGaussian() * 0.01D; -- this.spawnParticle("smoke", var38, var39, var23, var25, var27, var29); -- } -- -- return; -- case 2001: -- var20 = var6 & 4095; -- if(var20 > 0) { -- Block var40 = Block.blocksList[var20]; -- this.mc.sndManager.playSound(var40.stepSound.getBreakSound(), (float)var3 + 0.5F, (float)var4 + 0.5F, (float)var5 + 0.5F, (var40.stepSound.getVolume() + 1.0F) / 2.0F, var40.stepSound.getPitch() * 0.8F); -- } -- -- this.mc.effectRenderer.addBlockDestroyEffects(var3, var4, var5, var6 & 4095, var6 >> 12 & 255); -- break; -- case 2002: -- var8 = (double)var3; -- var10 = (double)var4; -- var12 = (double)var5; -- var14 = "iconcrack_" + Item.potion.itemID + "_" + var6; -- -- for(var15 = 0; var15 < 8; ++var15) { -- this.spawnParticle(var14, var8, var10, var12, var7.nextGaussian() * 0.15D, var7.nextDouble() * 0.2D, var7.nextGaussian() * 0.15D); -- } -- -- var15 = Item.potion.getColorFromDamage(var6); -- float var16 = (float)(var15 >> 16 & 255) / 255.0F; -- float var17 = (float)(var15 >> 8 & 255) / 255.0F; -- float var18 = (float)(var15 >> 0 & 255) / 255.0F; -- String var19 = "spell"; -- if(Item.potion.isEffectInstant(var6)) { -- var19 = "instantSpell"; -- } -- -- for(var20 = 0; var20 < 100; ++var20) { -- var39 = var7.nextDouble() * 4.0D; -- var23 = var7.nextDouble() * Math.PI * 2.0D; -- var25 = Math.cos(var23) * var39; -- var27 = 0.01D + var7.nextDouble() * 0.5D; -- var29 = Math.sin(var23) * var39; -- EntityFX var31 = this.doSpawnParticle(var19, var8 + var25 * 0.1D, var10 + 0.3D, var12 + var29 * 0.1D, var25, var27, var29); -- if(var31 != null) { -- float var32 = 12.0F / 16.0F + var7.nextFloat() * 0.25F; -- var31.setRBGColorF(var16 * var32, var17 * var32, var18 * var32); -- var31.multiplyVelocity((float)var39); -- } -- } -- -- this.theWorld.playSound((double)var3 + 0.5D, (double)var4 + 0.5D, (double)var5 + 0.5D, "random.glass", 1.0F, this.theWorld.s.nextFloat() * 0.1F + 0.9F, false); -- break; -- case 2003: -- var8 = (double)var3 + 0.5D; -- var10 = (double)var4; -- var12 = (double)var5 + 0.5D; -- var14 = "iconcrack_" + Item.eyeOfEnder.itemID; -- -- for(var15 = 0; var15 < 8; ++var15) { -- this.spawnParticle(var14, var8, var10, var12, var7.nextGaussian() * 0.15D, var7.nextDouble() * 0.2D, var7.nextGaussian() * 0.15D); -- } -- -- for(double var35 = 0.0D; var35 < Math.PI * 2.0D; var35 += Math.PI * 0.05D) { -- this.spawnParticle("portal", var8 + Math.cos(var35) * 5.0D, var10 - 0.4D, var12 + Math.sin(var35) * 5.0D, Math.cos(var35) * -5.0D, 0.0D, Math.sin(var35) * -5.0D); -- this.spawnParticle("portal", var8 + Math.cos(var35) * 5.0D, var10 - 0.4D, var12 + Math.sin(var35) * 5.0D, Math.cos(var35) * -7.0D, 0.0D, Math.sin(var35) * -7.0D); -- } -- -- return; -- case 2004: -- for(int var21 = 0; var21 < 20; ++var21) { -- double var22 = (double)var3 + 0.5D + ((double)this.theWorld.s.nextFloat() - 0.5D) * 2.0D; -- double var24 = (double)var4 + 0.5D + ((double)this.theWorld.s.nextFloat() - 0.5D) * 2.0D; -- double var26 = (double)var5 + 0.5D + ((double)this.theWorld.s.nextFloat() - 0.5D) * 2.0D; -- this.theWorld.spawnParticle("smoke", var22, var24, var26, 0.0D, 0.0D, 0.0D); -- this.theWorld.spawnParticle("flame", var22, var24, var26, 0.0D, 0.0D, 0.0D); -- } -- -- return; -- case 2005: -- ItemDye.func_96603_a(this.theWorld, var3, var4, var5, var6); -+ -+ switch (par2) { -+ case 1000: -+ this.theWorld.playSound((double)par3, (double)par4, (double)par5, "random.click", 1.0F, 1.0F, false); -+ break; -+ -+ case 1001: -+ this.theWorld.playSound((double)par3, (double)par4, (double)par5, "random.click", 1.0F, 1.2F, false); -+ break; -+ -+ case 1002: -+ this.theWorld.playSound((double)par3, (double)par4, (double)par5, "random.bow", 1.0F, 1.2F, false); -+ break; -+ -+ case 1003: -+ if (Math.random() < 0.5D) { -+ this.theWorld.playSound((double)par3 + 0.5D, (double)par4 + 0.5D, (double)par5 + 0.5D, "random.door_open", 1.0F, this.theWorld.rand.nextFloat() * 0.1F + 0.9F, false); -+ } else { -+ this.theWorld.playSound((double)par3 + 0.5D, (double)par4 + 0.5D, (double)par5 + 0.5D, "random.door_close", 1.0F, this.theWorld.rand.nextFloat() * 0.1F + 0.9F, false); -+ } -+ -+ break; -+ -+ case 1004: -+ this.theWorld.playSound((double)((float)par3 + 0.5F), (double)((float)par4 + 0.5F), (double)((float)par5 + 0.5F), "random.fizz", 0.5F, 2.6F + (var7.nextFloat() - var7.nextFloat()) * 0.8F, false); -+ break; -+ -+ case 1005: -+ if (Item.itemsList[par6] instanceof ItemRecord) { -+ this.theWorld.playRecord(((ItemRecord)Item.itemsList[par6]).recordName, par3, par4, par5); -+ } else { -+ this.theWorld.playRecord((String)null, par3, par4, par5); -+ } -+ -+ break; -+ -+ case 1007: -+ this.theWorld.playSound((double)par3 + 0.5D, (double)par4 + 0.5D, (double)par5 + 0.5D, "mob.ghast.charge", 10.0F, (var7.nextFloat() - var7.nextFloat()) * 0.2F + 1.0F, false); -+ break; -+ -+ case 1008: -+ this.theWorld.playSound((double)par3 + 0.5D, (double)par4 + 0.5D, (double)par5 + 0.5D, "mob.ghast.fireball", 10.0F, (var7.nextFloat() - var7.nextFloat()) * 0.2F + 1.0F, false); -+ break; -+ -+ case 1009: -+ this.theWorld.playSound((double)par3 + 0.5D, (double)par4 + 0.5D, (double)par5 + 0.5D, "mob.ghast.fireball", 2.0F, (var7.nextFloat() - var7.nextFloat()) * 0.2F + 1.0F, false); -+ break; -+ -+ case 1010: -+ this.theWorld.playSound((double)par3 + 0.5D, (double)par4 + 0.5D, (double)par5 + 0.5D, "mob.zombie.wood", 2.0F, (var7.nextFloat() - var7.nextFloat()) * 0.2F + 1.0F, false); -+ break; -+ -+ case 1011: -+ this.theWorld.playSound((double)par3 + 0.5D, (double)par4 + 0.5D, (double)par5 + 0.5D, "mob.zombie.metal", 2.0F, (var7.nextFloat() - var7.nextFloat()) * 0.2F + 1.0F, false); -+ break; -+ -+ case 1012: -+ this.theWorld.playSound((double)par3 + 0.5D, (double)par4 + 0.5D, (double)par5 + 0.5D, "mob.zombie.woodbreak", 2.0F, (var7.nextFloat() - var7.nextFloat()) * 0.2F + 1.0F, false); -+ break; -+ -+ case 1014: -+ this.theWorld.playSound((double)par3 + 0.5D, (double)par4 + 0.5D, (double)par5 + 0.5D, "mob.wither.shoot", 2.0F, (var7.nextFloat() - var7.nextFloat()) * 0.2F + 1.0F, false); -+ break; -+ -+ case 1015: -+ this.theWorld.playSound((double)par3 + 0.5D, (double)par4 + 0.5D, (double)par5 + 0.5D, "mob.bat.takeoff", 0.05F, (var7.nextFloat() - var7.nextFloat()) * 0.2F + 1.0F, false); -+ break; -+ -+ case 1016: -+ this.theWorld.playSound((double)par3 + 0.5D, (double)par4 + 0.5D, (double)par5 + 0.5D, "mob.zombie.infect", 2.0F, (var7.nextFloat() - var7.nextFloat()) * 0.2F + 1.0F, false); -+ break; -+ -+ case 1017: -+ this.theWorld.playSound((double)par3 + 0.5D, (double)par4 + 0.5D, (double)par5 + 0.5D, "mob.zombie.unfect", 2.0F, (var7.nextFloat() - var7.nextFloat()) * 0.2F + 1.0F, false); -+ break; -+ -+ case 1020: -+ this.theWorld.playSound((double)((float)par3 + 0.5F), (double)((float)par4 + 0.5F), (double)((float)par5 + 0.5F), "random.anvil_break", 1.0F, this.theWorld.rand.nextFloat() * 0.1F + 0.9F, false); -+ break; -+ -+ case 1021: -+ this.theWorld.playSound((double)((float)par3 + 0.5F), (double)((float)par4 + 0.5F), (double)((float)par5 + 0.5F), "random.anvil_use", 1.0F, this.theWorld.rand.nextFloat() * 0.1F + 0.9F, false); -+ break; -+ -+ case 1022: -+ this.theWorld.playSound((double)((float)par3 + 0.5F), (double)((float)par4 + 0.5F), (double)((float)par5 + 0.5F), "random.anvil_land", 0.3F, this.theWorld.rand.nextFloat() * 0.1F + 0.9F, false); -+ break; -+ -+ case 2000: -+ int var33 = par6 % 3 - 1; -+ int var9 = par6 / 3 % 3 - 1; -+ var10 = (double)par3 + (double)var33 * 0.6D + 0.5D; -+ var12 = (double)par4 + 0.5D; -+ double var34 = (double)par5 + (double)var9 * 0.6D + 0.5D; -+ -+ for (int var35 = 0; var35 < 10; ++var35) { -+ double var37 = var7.nextDouble() * 0.2D + 0.01D; -+ double var38 = var10 + (double)var33 * 0.01D + (var7.nextDouble() - 0.5D) * (double)var9 * 0.5D; -+ var39 = var12 + (var7.nextDouble() - 0.5D) * 0.5D; -+ var23 = var34 + (double)var9 * 0.01D + (var7.nextDouble() - 0.5D) * (double)var33 * 0.5D; -+ var25 = (double)var33 * var37 + var7.nextGaussian() * 0.01D; -+ var27 = -0.03D + var7.nextGaussian() * 0.01D; -+ var29 = (double)var9 * var37 + var7.nextGaussian() * 0.01D; -+ this.spawnParticle("smoke", var38, var39, var23, var25, var27, var29); -+ } -+ -+ return; -+ -+ case 2001: -+ var20 = par6 & 4095; -+ -+ if (var20 > 0) { -+ Block var40 = Block.blocksList[var20]; -+ this.mc.sndManager.playSound(var40.stepSound.getBreakSound(), (float)par3 + 0.5F, (float)par4 + 0.5F, (float)par5 + 0.5F, (var40.stepSound.getVolume() + 1.0F) / 2.0F, var40.stepSound.getPitch() * 0.8F); -+ } -+ this.mc.effectRenderer.addBlockDestroyEffects(par3, par4, par5, par6 & 4095, par6 >> 12 & 255); -+ break; -+ -+ case 2002: -+ var8 = (double)par3; -+ var10 = (double)par4; -+ var12 = (double)par5; -+ var14 = "iconcrack_" + Item.potion.itemID + "_" + par6; -+ -+ for (var15 = 0; var15 < 8; ++var15) { -+ this.spawnParticle(var14, var8, var10, var12, var7.nextGaussian() * 0.15D, var7.nextDouble() * 0.2D, var7.nextGaussian() * 0.15D); -+ } -+ -+ var15 = Item.potion.getColorFromDamage(par6); -+ float var16 = (float)(var15 >> 16 & 255) / 255.0F; -+ float var17 = (float)(var15 >> 8 & 255) / 255.0F; -+ float var18 = (float)(var15 >> 0 & 255) / 255.0F; -+ String var19 = "spell"; -+ -+ if (Item.potion.isEffectInstant(par6)) { -+ var19 = "instantSpell"; -+ } -+ -+ for (var20 = 0; var20 < 100; ++var20) { -+ var39 = var7.nextDouble() * 4.0D; -+ var23 = var7.nextDouble() * Math.PI * 2.0D; -+ var25 = Math.cos(var23) * var39; -+ var27 = 0.01D + var7.nextDouble() * 0.5D; -+ var29 = Math.sin(var23) * var39; -+ EntityFX var31 = this.doSpawnParticle(var19, var8 + var25 * 0.1D, var10 + 0.3D, var12 + var29 * 0.1D, var25, var27, var29); -+ -+ if (var31 != null) { -+ float var32 = 0.75F + var7.nextFloat() * 0.25F; -+ var31.setRBGColorF(var16 * var32, var17 * var32, var18 * var32); -+ var31.multiplyVelocity((float)var39); -+ } -+ } -+ -+ this.theWorld.playSound((double)par3 + 0.5D, (double)par4 + 0.5D, (double)par5 + 0.5D, "random.glass", 1.0F, this.theWorld.rand.nextFloat() * 0.1F + 0.9F, false); -+ break; -+ -+ case 2003: -+ var8 = (double)par3 + 0.5D; -+ var10 = (double)par4; -+ var12 = (double)par5 + 0.5D; -+ var14 = "iconcrack_" + Item.eyeOfEnder.itemID; -+ -+ for (var15 = 0; var15 < 8; ++var15) { -+ this.spawnParticle(var14, var8, var10, var12, var7.nextGaussian() * 0.15D, var7.nextDouble() * 0.2D, var7.nextGaussian() * 0.15D); -+ } -+ -+ for (double var36 = 0.0D; var36 < (Math.PI * 2D); var36 += 0.15707963267948966D) { -+ this.spawnParticle("portal", var8 + Math.cos(var36) * 5.0D, var10 - 0.4D, var12 + Math.sin(var36) * 5.0D, Math.cos(var36) * -5.0D, 0.0D, Math.sin(var36) * -5.0D); -+ this.spawnParticle("portal", var8 + Math.cos(var36) * 5.0D, var10 - 0.4D, var12 + Math.sin(var36) * 5.0D, Math.cos(var36) * -7.0D, 0.0D, Math.sin(var36) * -7.0D); -+ } -+ -+ return; -+ -+ case 2004: -+ for (int var21 = 0; var21 < 20; ++var21) { -+ double var22 = (double)par3 + 0.5D + ((double)this.theWorld.rand.nextFloat() - 0.5D) * 2.0D; -+ double var24 = (double)par4 + 0.5D + ((double)this.theWorld.rand.nextFloat() - 0.5D) * 2.0D; -+ double var26 = (double)par5 + 0.5D + ((double)this.theWorld.rand.nextFloat() - 0.5D) * 2.0D; -+ this.theWorld.spawnParticle("smoke", var22, var24, var26, 0.0D, 0.0D, 0.0D); -+ this.theWorld.spawnParticle("flame", var22, var24, var26, 0.0D, 0.0D, 0.0D); -+ } -+ -+ return; -+ -+ case 2005: -+ ItemDye.func_96603_a(this.theWorld, par3, par4, par5, par6); - } -- - } - -- public void destroyBlockPartially(int var1, int var2, int var3, int var4, int var5) { -- if(var5 >= 0 && var5 < 10) { -- DestroyBlockProgress var6 = (DestroyBlockProgress)this.H.get(Integer.valueOf(var1)); -- if(var6 == null || var6.getPartialBlockX() != var2 || var6.getPartialBlockY() != var3 || var6.getPartialBlockZ() != var4) { -- var6 = new DestroyBlockProgress(var1, var2, var3, var4); -- this.H.put(Integer.valueOf(var1), var6); -+ /** -+ * Starts (or continues) destroying a block with given ID at the given coordinates for the given partially destroyed -+ * value -+ */ -+ public void destroyBlockPartially(int par1, int par2, int par3, int par4, int par5) { -+ if (par5 >= 0 && par5 < 10) { -+ DestroyBlockProgress var6 = (DestroyBlockProgress)this.damagedBlocks.get(Integer.valueOf(par1)); -+ -+ if (var6 == null || var6.getPartialBlockX() != par2 || var6.getPartialBlockY() != par3 || var6.getPartialBlockZ() != par4) { -+ var6 = new DestroyBlockProgress(par1, par2, par3, par4); -+ this.damagedBlocks.put(Integer.valueOf(par1), var6); - } - -- var6.setPartialBlockDamage(var5); -+ var6.setPartialBlockDamage(par5); - var6.setCloudUpdateTick(this.cloudTickCounter); - } else { -- this.H.remove(Integer.valueOf(var1)); -+ this.damagedBlocks.remove(Integer.valueOf(par1)); - } -- - } - -- public void registerDestroyBlockIcons(IconRegister var1) { -+ public void registerDestroyBlockIcons(IconRegister par1IconRegister) { - this.destroyBlockIcons = new Icon[10]; - -- for(int var2 = 0; var2 < this.destroyBlockIcons.length; ++var2) { -- this.destroyBlockIcons[var2] = var1.registerIcon("destroy_stage_" + var2); -- } -- -- } -+ for (int var2 = 0; var2 < this.destroyBlockIcons.length; ++var2) { -+ this.destroyBlockIcons[var2] = par1IconRegister.registerIcon("destroy_stage_" + var2); -+ } -+ } -+ -+ // Spout Start -+ // TODO: Some methods here may not be called. -+ public int renderAllSortedRenderers(int var1, double var2) { -+ return this.renderSortedRenderers(0, this.sortedWorldRenderers.length, var1, var2); -+ } -+ -+ public void updateAllRenderers() { -+ if (this.worldRenderers != null) { -+ for (int var1 = 0; var1 < this.worldRenderers.length; ++var1) { -+ if (/*this.worldRenderers[var1].isChunkLit && */!this.worldRenderers[var1].needsUpdate) { -+ this.worldRenderersToUpdate.add(this.worldRenderers[var1]); -+ this.worldRenderers[var1].markDirty(); -+ } -+ } -+ } -+ } -+ -+ public void setAllRenderesVisible() { -+ if (this.worldRenderers != null) { -+ for (int var1 = 0; var1 < this.worldRenderers.length; ++var1) { -+ this.worldRenderers[var1].isVisible = true; -+ } -+ -+ } -+ } -+ -+ private boolean isMoving(EntityLiving entity, long time) { -+ if (this.isMovingNow(entity)) { -+ this.lastMovedTime = System.currentTimeMillis(); -+ return true; -+ } else { -+ return System.currentTimeMillis() - this.lastMovedTime < time; -+ } -+ } -+ -+ private boolean isMovingNow(EntityLiving var1) { -+ double var2 = 0.0010D; -+ return var1.isJumping?true:(var1.isSneaking()?true:((double)var1.prevSwingProgress > var2?true:(this.mc.mouseHelper.deltaX != 0?true:(this.mc.mouseHelper.deltaY != 0?true:(Math.abs(var1.posX - var1.prevPosX) > var2?true:(Math.abs(var1.posY - var1.prevPosY) > var2?true:Math.abs(var1.posZ - var1.prevPosZ) > var2)))))); -+ } -+ -+ public void updateRenderer(int x, int y, int z) { -+ int chunkX = MathHelper.bucketInt(x, 16); -+ int chunkY = MathHelper.bucketInt(y, 16); -+ int chunkZ = MathHelper.bucketInt(z, 16); -+ -+ int cx = chunkX % this.renderChunksWide; -+ if (cx < 0) { -+ cx += this.renderChunksWide; -+ } -+ -+ int cy = chunkY % this.renderChunksTall; -+ if (cy < 0) { -+ cy += this.renderChunksTall; -+ } -+ -+ int cz = chunkZ % this.renderChunksDeep; -+ if (cz < 0) { -+ cz += this.renderChunksDeep; -+ } -+ -+ int index = (cz * this.renderChunksTall + cy) * this.renderChunksWide + cx; -+ WorldRenderer renderer = this.worldRenderers[index]; -+ if (renderer.needsUpdate) { -+ renderer.updateRenderer(); -+ renderer.needsUpdate = false; -+ } -+ -+ } -+ -+ public void prepareAO() { -+ if (this.occlusionEnabled && Configuration.ambientOcclusion) { -+ byte var3 = 64; -+ byte var4 = 64; -+ this.occlusionResult.clear(); -+ this.glOcclusionQueryBase = GLAllocation.createDirectIntBuffer(var3 * var3 * var4); -+ this.glOcclusionQueryBase.clear(); -+ this.glOcclusionQueryBase.position(0); -+ this.glOcclusionQueryBase.limit(var3 * var3 * var4); -+ ARBOcclusionQuery.glGenQueriesARB(this.glOcclusionQueryBase); -+ } -+ } -+ // Spout End - } ---- net/minecraft/src/BlockWorkbench.java -+++ net/minecraft/src/BlockWorkbench.java -@@ -4,26 +4,36 @@ - private Icon workbenchIconTop; - private Icon workbenchIconFront; - -- protected BlockWorkbench(int var1) { -- super(var1, Material.wood); -+ protected BlockWorkbench(int par1) { -+ super(par1, Material.wood); - this.setCreativeTab(CreativeTabs.tabDecorations); - } - -- public Icon getIcon(int var1, int var2) { -- return var1 == 1 ? this.workbenchIconTop : (var1 == 0 ? Block.planks.getBlockTextureFromSide(var1) : (var1 != 2 && var1 != 4 ? this.blockIcon : this.workbenchIconFront)); -- } -- -- public void registerIcons(IconRegister var1) { -- this.blockIcon = var1.registerIcon(this.getTextureName() + "_side"); -- this.workbenchIconTop = var1.registerIcon(this.getTextureName() + "_top"); -- this.workbenchIconFront = var1.registerIcon(this.getTextureName() + "_front"); -- } -- -- public boolean onBlockActivated(World var1, int var2, int var3, int var4, EntityPlayer var5, int var6, float var7, float var8, float var9) { -- if(var1.isRemote) { -+ /** -+ * From the specified side and block metadata retrieves the blocks texture. Args: side, metadata -+ */ -+ public Icon getIcon(int par1, int par2) { -+ return par1 == 1 ? this.workbenchIconTop : (par1 == 0 ? Block.planks.getBlockTextureFromSide(par1) : (par1 != 2 && par1 != 4 ? this.blockIcon : this.workbenchIconFront)); -+ } -+ -+ /** -+ * When this method is called, your block should register all the icons it needs with the given IconRegister. This is -+ * the only chance you get to register icons. -+ */ -+ public void registerIcons(IconRegister par1IconRegister) { -+ this.blockIcon = par1IconRegister.registerIcon(this.getTextureName() + "_side"); -+ this.workbenchIconTop = par1IconRegister.registerIcon(this.getTextureName() + "_top"); -+ this.workbenchIconFront = par1IconRegister.registerIcon(this.getTextureName() + "_front"); -+ } -+ -+ /** -+ * Called upon block activation (right click on the block.) -+ */ -+ public boolean onBlockActivated(World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer, int par6, float par7, float par8, float par9) { -+ if (par1World.isRemote) { - return true; - } else { -- var5.displayGUIWorkbench(var2, var3, var4); -+ par5EntityPlayer.displayGUIWorkbench(par2, par3, par4); - return true; - } - } ---- net/minecraft/src/CreativeTabBrewing.java -+++ net/minecraft/src/CreativeTabBrewing.java -@@ -1,10 +1,13 @@ - package net.minecraft.src; - - final class CreativeTabBrewing extends CreativeTabs { -- CreativeTabBrewing(int var1, String var2) { -- super(var1, var2); -+ CreativeTabBrewing(int par1, String par2Str) { -+ super(par1, par2Str); - } - -+ /** -+ * the itemID for the item to be displayed on the tab -+ */ - public int getTabIconItemIndex() { - return Item.potion.itemID; - } ---- /dev/null -+++ org/spoutcraft/api/animation/LogarithmicAnimationProgress.java -@@ -1,0 +1,38 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.api.animation; -+ -+public class LogarithmicAnimationProgress implements AnimationProgress { -+ private int strength; -+ private double slog; -+ -+ public LogarithmicAnimationProgress() { -+ this(20); -+ } -+ -+ public LogarithmicAnimationProgress(int strength) { -+ this.strength = strength; -+ this.slog = Math.log(strength + 1); -+ } -+ -+ public double getValueAt(double progress) { -+ return Math.log(progress * strength + 1) / slog; -+ } -+} ---- /dev/null -+++ org/spoutcraft/client/entity/EntityCamera.java -@@ -1,0 +1,60 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.client.entity; -+ -+import net.minecraft.src.DamageSource; -+import net.minecraft.src.EntityPlayerSP; -+ -+import org.spoutcraft.client.SpoutClient; -+ -+public class EntityCamera extends EntityPlayerSP { -+ public EntityCamera(CraftCameraEntity spoutEntity) { -+ super(SpoutClient.getHandle(), SpoutClient.getHandle().theWorld, SpoutClient.getHandle().session, SpoutClient.getHandle().thePlayer.dimension); -+ yOffset = 1.62F; -+ this.spoutEnty = spoutEntity; -+ } -+ -+ @Override -+ public boolean canBePushed() { -+ return false; -+ } -+ -+ @Override -+ public void onEntityUpdate() { } -+ -+ @Override -+ public void onDeath(DamageSource source) { } -+ -+ @Override -+ public boolean isEntityAlive() { -+ return true; -+ } -+ -+ public void setRotation(float yaw, float pitch) { -+ lastTickPosX = posX; -+ lastTickPosY = posY; -+ lastTickPosZ = posZ; -+ -+ prevRotationYaw = rotationYaw; -+ prevRotationPitch = rotationPitch; -+ rotationYaw = yaw; -+ rotationPitch = pitch; -+ } -+} ---- /dev/null -+++ org/spoutcraft/api/io/SpoutInputStream.java -@@ -1,0 +1,149 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.api.io; -+ -+import java.io.InputStream; -+import java.nio.ByteBuffer; -+import java.util.UUID; -+ -+import org.spoutcraft.api.gui.Color; -+import org.spoutcraft.api.inventory.ItemStack; -+import org.spoutcraft.api.material.Material; -+import org.spoutcraft.api.material.MaterialData; -+import org.spoutcraft.api.util.Location; -+import org.spoutcraft.api.util.MutableLocation; -+import org.spoutcraft.api.util.MutableVector; -+import org.spoutcraft.api.util.Vector; -+ -+public class SpoutInputStream extends InputStream{ -+ ByteBuffer buffer; -+ public SpoutInputStream(ByteBuffer buffer) { -+ this.buffer = buffer; -+ } -+ -+ @SuppressWarnings("unused") -+ public Location readLocation() { -+ double x = readDouble(); -+ double y = readDouble(); -+ double z = readDouble(); -+ float pitch = readFloat(); -+ float yaw = readFloat(); -+ long lsb = readLong(); -+ long msb = readLong(); -+ return new MutableLocation(x, y, z, yaw, pitch); -+ } -+ -+ public Vector readVector() { -+ double x = readDouble(); -+ double y = readDouble(); -+ double z = readDouble(); -+ return new MutableVector(x,y,z); -+ } -+ -+ public ItemStack readItemStack(ItemStack item) { -+ int id = readInt(); -+ short dura = readShort(); -+ short amt = readShort(); -+ return new ItemStack(id, amt, dura); -+ } -+ -+ public Material readMaterial() { -+ int id = readInt(); -+ short dura = readShort(); -+ return MaterialData.getMaterial(id, dura); -+ } -+ -+ public UUID readUUID() { -+ long lsb = readLong(); -+ long msb = readLong(); -+ return new UUID(msb, lsb); -+ } -+ -+ @Override -+ public int read() { -+ return buffer.get(); -+ } -+ -+ @Override -+ public int read(byte[] b, int len, int off) { -+ buffer.get(b, len, off); -+ return b.length; -+ } -+ -+ public int read(byte[] b) { -+ buffer.get(b); -+ return b.length; -+ } -+ -+ public short readShort() { -+ return buffer.getShort(); -+ } -+ -+ public int readInt() { -+ return buffer.getInt(); -+ } -+ -+ public long readLong() { -+ return buffer.getLong(); -+ } -+ -+ public float readFloat() { -+ return buffer.getFloat(); -+ } -+ -+ public double readDouble() { -+ return buffer.getDouble(); -+ } -+ -+ public char readChar() { -+ return buffer.getChar(); -+ } -+ -+ public boolean readBoolean() { -+ return buffer.get() != 0; -+ } -+ -+ public String readString() { -+ short size = buffer.getShort(); -+ StringBuilder builder = new StringBuilder(size); -+ for (int i = 0; i < size; i++) { -+ builder.append(buffer.getChar()); -+ } -+ return builder.toString(); -+ } -+ -+ public static final byte FLAG_COLORINVALID = 1; -+ public static final byte FLAG_COLOROVERRIDE = 2; -+ public Color readColor() { -+ int flags = read(); -+ int argb = readInt(); -+ if ((flags & FLAG_COLORINVALID) > 0) { -+ return Color.invalid(); -+ } -+ if ((flags & FLAG_COLOROVERRIDE) > 0) { -+ return Color.override(); -+ } -+ return new Color(argb); -+ } -+ -+ public ByteBuffer getRawBuffer() { -+ return buffer; -+ } -+} ---- /dev/null -+++ org/spoutcraft/api/AnimatableLocation.java -@@ -1,0 +1,48 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.api; -+ -+import org.spoutcraft.api.animation.Animatable; -+import org.spoutcraft.api.util.Location; -+import org.spoutcraft.api.util.MutableLocation; -+ -+public class AnimatableLocation extends MutableLocation implements Animatable, Location { -+ public AnimatableLocation(double x, double y, double z) { -+ super(x, y, z, 0, 0); -+ } -+ -+ public AnimatableLocation(double x, double y, double z, double yaw, double pitch) { -+ super(x, y, z, yaw, pitch); -+ } -+ -+ public Animatable getValueAt(double p, Animatable startValue, Animatable endValue) { -+ Location p1 = (Location) startValue; -+ Location p2 = (Location) endValue; -+ double x = p1.getX(), y = p1.getY(), z = p1.getZ(); -+ double yaw = p1.getYaw(), pitch = p1.getPitch(); -+ x += (p1.getX() - p2.getX()) * p; -+ y += (p1.getY() - p2.getY()) * p; -+ z += (p1.getZ() - p2.getZ()) * p; -+ yaw += (p1.getYaw() - p2.getYaw()) * p; -+ pitch += (p1.getPitch() - p2.getPitch()) * p; -+ -+ return new AnimatableLocation(x, y, z, yaw, pitch); -+ } -+} ---- net/minecraft/src/EntityAILookAtVillager.java -+++ net/minecraft/src/EntityAILookAtVillager.java -@@ -5,15 +5,18 @@ - private EntityVillager theVillager; - private int lookTime; - -- public EntityAILookAtVillager(EntityIronGolem var1) { -- this.theGolem = var1; -+ public EntityAILookAtVillager(EntityIronGolem par1EntityIronGolem) { -+ this.theGolem = par1EntityIronGolem; - this.setMutexBits(3); - } - -+ /** -+ * Returns whether the EntityAIBase should begin execution. -+ */ - public boolean shouldExecute() { -- if(!this.theGolem.worldObj.isDaytime()) { -+ if (!this.theGolem.worldObj.isDaytime()) { - return false; -- } else if(this.theGolem.getRNG().nextInt(8000) != 0) { -+ } else if (this.theGolem.getRNG().nextInt(8000) != 0) { - return false; - } else { - this.theVillager = (EntityVillager)this.theGolem.worldObj.findNearestEntityWithinAABB(EntityVillager.class, this.theGolem.boundingBox.expand(6.0D, 2.0D, 6.0D), this.theGolem); -@@ -21,20 +24,32 @@ - } - } - -+ /** -+ * Returns whether an in-progress EntityAIBase should continue executing -+ */ - public boolean continueExecuting() { - return this.lookTime > 0; - } - -+ /** -+ * Execute a one shot task or start executing a continuous task -+ */ - public void startExecuting() { - this.lookTime = 400; - this.theGolem.setHoldingRose(true); - } - -+ /** -+ * Resets the task -+ */ - public void resetTask() { - this.theGolem.setHoldingRose(false); - this.theVillager = null; - } - -+ /** -+ * Updates the task -+ */ - public void updateTask() { - this.theGolem.getLookHelper().setLookPositionWithEntity(this.theVillager, 30.0F, 30.0F); - --this.lookTime; ---- /dev/null -+++ org/spoutcraft/api/material/Tool.java -@@ -1,0 +1,32 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.api.material; -+ -+public interface Tool extends Item { -+ public short getDurability(); -+ -+ public Tool setDurability(short durability); -+ -+ public float getStrengthModifier(Block block); -+ -+ public Tool setStrengthModifier(Block block, float modifier); -+ -+ public Block[] getStrengthModifiedBlocks(); -+} ---- net/minecraft/src/FurnaceRecipes.java -+++ net/minecraft/src/FurnaceRecipes.java -@@ -5,9 +5,14 @@ - - public class FurnaceRecipes { - private static final FurnaceRecipes smeltingBase = new FurnaceRecipes(); -- private Map b = new HashMap(); -- private Map c = new HashMap(); -- -+ -+ /** The list of smelting results. */ -+ private Map smeltingList = new HashMap(); -+ private Map experienceList = new HashMap(); -+ -+ /** -+ * Used to call methods addSmelting and getSmeltingResult. -+ */ - public static final FurnaceRecipes smelting() { - return smeltingBase; - } -@@ -35,20 +40,26 @@ - this.addSmelting(Block.oreNetherQuartz.blockID, new ItemStack(Item.netherQuartz), 0.2F); - } - -- public void addSmelting(int var1, ItemStack var2, float var3) { -- this.b.put(Integer.valueOf(var1), var2); -- this.c.put(Integer.valueOf(var2.itemID), Float.valueOf(var3)); -+ /** -+ * Adds a smelting recipe. -+ */ -+ public void addSmelting(int par1, ItemStack par2ItemStack, float par3) { -+ this.smeltingList.put(Integer.valueOf(par1), par2ItemStack); -+ this.experienceList.put(Integer.valueOf(par2ItemStack.itemID), Float.valueOf(par3)); - } - -- public ItemStack getSmeltingResult(int var1) { -- return (ItemStack)this.b.get(Integer.valueOf(var1)); -+ /** -+ * Returns the smelting result of an item. -+ */ -+ public ItemStack getSmeltingResult(int par1) { -+ return (ItemStack)this.smeltingList.get(Integer.valueOf(par1)); - } - - public Map getSmeltingList() { -- return this.b; -+ return this.smeltingList; - } - -- public float getExperience(int var1) { -- return this.c.containsKey(Integer.valueOf(var1)) ? ((Float)this.c.get(Integer.valueOf(var1))).floatValue() : 0.0F; -+ public float getExperience(int par1) { -+ return this.experienceList.containsKey(Integer.valueOf(par1)) ? ((Float)this.experienceList.get(Integer.valueOf(par1))).floatValue() : 0.0F; - } - } ---- net/minecraft/src/GuiLanguage.java -+++ net/minecraft/src/GuiLanguage.java -@@ -1,55 +1,79 @@ - package net.minecraft.src; - - public class GuiLanguage extends GuiScreen { -+ -+ /** This GUI's parent GUI. */ - protected GuiScreen parentGui; -+ -+ /** This GUI's language list. */ - private GuiSlotLanguage languageList; -+ -+ /** For saving the user's language selection to disk. */ - private final GameSettings theGameSettings; - private final LanguageManager field_135014_d; -+ -+ /** This GUI's 'Done' button. */ - private GuiSmallButton doneButton; - -- public GuiLanguage(GuiScreen var1, GameSettings var2, LanguageManager var3) { -- this.parentGui = var1; -- this.theGameSettings = var2; -- this.field_135014_d = var3; -+ public GuiLanguage(GuiScreen par1GuiScreen, GameSettings par2GameSettings, LanguageManager par3LanguageManager) { -+ this.parentGui = par1GuiScreen; -+ this.theGameSettings = par2GameSettings; -+ this.field_135014_d = par3LanguageManager; - } - -+ /** -+ * Adds the buttons (and other controls) to the screen in question. -+ */ - public void initGui() { -- this.i.add(this.doneButton = new GuiSmallButton(6, this.width / 2 - 75, this.height - 38, I18n.getString("gui.done"))); -+ this.buttonList.add(this.doneButton = new GuiSmallButton(6, this.width / 2 - 75, this.height - 38, I18n.getString("gui.done"))); - this.languageList = new GuiSlotLanguage(this); - this.languageList.registerScrollButtons(7, 8); - } - -- protected void actionPerformed(GuiButton var1) { -- if(var1.enabled) { -- switch(var1.id) { -- case 5: -- break; -- case 6: -- this.mc.displayGuiScreen(this.parentGui); -- break; -- default: -- this.languageList.actionPerformed(var1); -+ /** -+ * Fired when a control is clicked. This is the equivalent of ActionListener.actionPerformed(ActionEvent e). -+ */ -+ protected void actionPerformed(GuiButton par1GuiButton) { -+ if (par1GuiButton.enabled) { -+ switch (par1GuiButton.id) { -+ case 5: -+ break; -+ -+ case 6: -+ this.mc.displayGuiScreen(this.parentGui); -+ break; -+ -+ default: -+ this.languageList.actionPerformed(par1GuiButton); - } -- - } - } - -- public void drawScreen(int var1, int var2, float var3) { -- this.languageList.drawScreen(var1, var2, var3); -+ /** -+ * Draws the screen and all the components in it. -+ */ -+ public void drawScreen(int par1, int par2, float par3) { -+ this.languageList.drawScreen(par1, par2, par3); - this.drawCenteredString(this.fontRenderer, I18n.getString("options.language"), this.width / 2, 16, 16777215); - this.drawCenteredString(this.fontRenderer, "(" + I18n.getString("options.languageWarning") + ")", this.width / 2, this.height - 56, 8421504); -- super.drawScreen(var1, var2, var3); -- } -- -- static LanguageManager func_135011_a(GuiLanguage var0) { -- return var0.field_135014_d; -- } -- -- static GameSettings getGameSettings(GuiLanguage var0) { -- return var0.theGameSettings; -- } -- -- static GuiSmallButton getDoneButton(GuiLanguage var0) { -- return var0.doneButton; -+ super.drawScreen(par1, par2, par3); -+ } -+ -+ static LanguageManager func_135011_a(GuiLanguage par0GuiLanguage) { -+ return par0GuiLanguage.field_135014_d; -+ } -+ -+ /** -+ * Gets the relevant instance of GameSettings. Synthetic method for use in GuiSlotLanguage -+ */ -+ static GameSettings getGameSettings(GuiLanguage par0GuiLanguage) { -+ return par0GuiLanguage.theGameSettings; -+ } -+ -+ /** -+ * Returns the private doneButton field. -+ */ -+ static GuiSmallButton getDoneButton(GuiLanguage par0GuiLanguage) { -+ return par0GuiLanguage.doneButton; - } - } ---- /dev/null -+++ org/spoutcraft/client/gui/minimap/MapRenderer.java -@@ -1,0 +1,577 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.client.gui.minimap; -+ -+import org.lwjgl.opengl.GL11; -+import org.newdawn.slick.opengl.Texture; -+ -+import net.minecraft.src.Minecraft; -+import net.minecraft.src.Entity; -+import net.minecraft.src.MathHelper; -+import net.minecraft.src.Tessellator; -+ -+import org.spoutcraft.api.Spoutcraft; -+import org.spoutcraft.api.gui.RenderUtil; -+ -+public class MapRenderer { -+ /** Direction you're facing */ -+ public float direction = 0.0f; -+ -+ /** Last direction you were facing */ -+ public float oldDir = 0.0f; -+ -+ private Map map; -+ private TextureManager texman; -+ -+ private double distanceToFocus; -+ -+ /** -+ * @param minimap -+ * minimap instance to init with -+ */ -+ public MapRenderer(ZanMinimap minimap) { -+ map = minimap.map; -+ texman = minimap.texman; -+ } -+ -+ /** -+ * Do rendering -+ * -+ * @param scWidth -+ * screen width -+ * @param scHeight -+ * screen height -+ */ -+ public void onRenderTick(int scWidth, int scHeight) { -+ if (this.oldDir != Minecraft.getMinecraft().thePlayer.rotationYaw) { -+ this.direction += this.oldDir - Minecraft.getMinecraft().thePlayer.rotationYaw; -+ this.oldDir = Minecraft.getMinecraft().thePlayer.rotationYaw; -+ } -+ -+ if (this.direction >= 360.0f) -+ this.direction %= 360.0f; -+ -+ if (this.direction < 0.0f) { -+ while (this.direction < 0.0f) -+ this.direction += 360.0f; -+ } -+ -+ GL11.glPushMatrix(); -+ GL11.glTranslatef(scWidth, 0.0f, 0.0f); -+ GL11.glTranslatef(MinimapConfig.getInstance().getAdjustX(), MinimapConfig.getInstance().getAdjustY(), 0); -+ GL11.glScalef(MinimapConfig.getInstance().getSizeAdjust(), MinimapConfig.getInstance().getSizeAdjust(), 1F); -+ if (!MinimapConfig.getInstance().isScale()) { -+ float scaleFactor = Math.max(scWidth / 427, scHeight / 240F); -+ GL11.glScalef(scaleFactor, scaleFactor, 1); -+ } -+ renderMap(); -+ if (MinimapConfig.getInstance().isCavemap()) -+ renderMapFull(0, scHeight); -+ -+ GL11.glDepthMask(true); -+ GL11.glDisable(3042); -+ GL11.glEnable(2929); -+ GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); -+ -+ showCoords(0); -+ GL11.glPopMatrix(); -+ } -+ -+ private void renderMap() { -+ GL11.glDisable(2929); -+ GL11.glEnable(3042); -+ GL11.glDepthMask(false); -+ GL11.glBlendFunc(770, 0); -+ GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); -+ -+ if (MinimapConfig.getInstance().isEnabled()) { -+ if (MinimapConfig.getInstance().isSquare()) { -+ // Scale -+ GL11.glPushMatrix(); -+ GL11.glTranslatef(-34.0f, 30.0F, 0.0F); -+ GL11.glRotatef(-90F, 0.0F, 0.0F, 1.0F); -+ GL11.glTranslatef(32.0F, -(32.0F), 0.0F); -+ switch (MinimapConfig.getInstance().getZoom()) { -+ case 0: -+ GL11.glScalef(8F, 8F, 1F); -+ GL11.glTranslatef(56, 0, 0F); -+ break; -+ case 1: -+ GL11.glScalef(4F, 4F, 1F); -+ GL11.glTranslatef(48, 0, 0F); -+ break; -+ case 2: -+ GL11.glScalef(2F, 2F, 1F); -+ GL11.glTranslatef(32, 0, 0F); -+ break; -+ } -+ -+ map.loadColorImage(); -+ -+ drawOnMap(); -+ -+ if (MinimapConfig.getInstance().isHeightmap()) { -+ GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_DST_COLOR); -+ -+ map.loadHeightImage(); -+ -+ drawOnMap(); -+ GL11.glRotatef(90f, 0.0f, 0.0f, 1.0f); -+ } -+ GL11.glPopMatrix(); -+ -+ GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); -+ renderEntities(); -+ -+ try { -+ GL11.glPushMatrix(); -+ GL11.glScalef(1.8f, 1.8f, 1.0f); -+ GL11.glTranslatef(27, -1, 0F); // don't ask -+ if (MinimapConfig.getInstance().isShowBackground()) { -+ texman.loadMinimap(); -+ } else { -+ GL11.glScalef(138F / 256F, 138F / 256F, 1F); -+ GL11.glTranslatef(-55, 3, 0); -+ texman.loadWhiteMinimap(); -+ } -+ drawOnMap(); -+ } catch (Exception e) { -+// System.err.println("error: minimap overlay not found!"); -+// e.printStackTrace(); -+ } finally { -+ GL11.glPopMatrix(); -+ } -+ -+ renderWaypoints(); -+ -+ try { -+ GL11.glPushMatrix(); -+ texman.loadMMArrow(); -+ if (MinimapConfig.getInstance().isShowBackground()) { -+ GL11.glTranslatef(-34.0F, 30.0F, 0.0F); -+ } else { -+ GL11.glTranslatef(-36.0F, 32.0F, 0.0F); -+ } -+ GL11.glRotatef(-this.direction, 0.0F, 0.0F, 1.0F); -+ GL11.glTranslatef(32.0F, -(32.0F), 0.0F); -+ drawOnMap(); -+ } catch (Exception e) { -+// System.err.println("Error: minimap arrow not found!"); -+ e.printStackTrace(); -+ } finally { -+ GL11.glPopMatrix(); -+ } -+ -+ GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); -+ -+ GL11.glPushMatrix(); -+ GL11.glTranslatef(-2, 2, 0.0F); // Lines up compass directions when rendering on square map -+ drawDirections(); -+ drawFocusSquare(); -+ GL11.glPopMatrix(); -+ -+ } else { -+ GL11.glPushMatrix(); -+ -+ map.loadColorImage(); -+ -+ GL11.glTranslatef(-32.0f, 32.0F, 0.0F); -+ GL11.glRotatef(-90.0F, 0.0F, 0.0F, 1.0F); -+ GL11.glTranslatef(32.0F, -(32.0F), 0.0F); -+ -+ switch (MinimapConfig.getInstance().getZoom()) { -+ case 0: -+ GL11.glScalef(8F, 8F, 1F); -+ GL11.glTranslatef(56.25F, 0.25F, 0F); -+ break; -+ case 1: -+ GL11.glScalef(4F, 4F, 1F); -+ GL11.glTranslatef(48.5F, 0.5F, 0F); -+ break; -+ case 2: -+ GL11.glScalef(2F, 2F, 1F); -+ GL11.glTranslatef(33F, 1F, 0F); -+ break; -+ } -+ -+ drawOnMap(); -+ -+ if (MinimapConfig.getInstance().isHeightmap()) { -+ GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_DST_COLOR); -+ -+ map.loadHeightImage(); -+ -+ drawOnMap(); -+ } -+ -+ GL11.glPopMatrix(); -+ GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); -+ -+ renderWaypoints(); -+ renderEntities(); -+ drawRound(); -+ -+ try { -+ GL11.glPushMatrix(); -+ texman.loadMMArrow(); -+ if (MinimapConfig.getInstance().isShowBackground()) { -+ GL11.glTranslatef(-32.0f, 32.0F, 0.0F); -+ } else { -+ GL11.glTranslatef(-31.0f, 31.0F, 0.0F); -+ } -+ GL11.glRotatef(-this.direction, 0.0F, 0.0F, 1.0F); -+ GL11.glTranslatef(32.0F, -(32.0F), 0.0F); -+ drawOnMap(); -+ } catch (Exception e) { -+// System.err.println("Error: minimap arrow not found!"); -+ e.printStackTrace(); -+ } finally { -+ GL11.glPopMatrix(); -+ } -+ -+ drawDirections(); -+ GL11.glPushMatrix(); -+ drawFocusRound(); -+ GL11.glPopMatrix(); -+ } -+ } -+ } -+ -+ private void renderEntities() { -+ if (!Spoutcraft.hasPermission("spout.plugin.minimap.showentities")) { -+ return; -+ } -+ if (!MinimapConfig.getInstance().isShowingEntities()) { -+ return; -+ } -+ boolean isSquare = MinimapConfig.getInstance().isSquare(); -+ boolean isShowBackground = MinimapConfig.getInstance().isShowBackground(); -+ double playerX = map.getPlayerX(); -+ double playerZ = map.getPlayerZ(); -+ -+ synchronized (map.watchedEntities) { -+ for (WatchedEntity w:map.watchedEntities) { -+ Entity e = w.entity; -+ double entityX = e.posX - playerX; -+ double entityZ = e.posZ - playerZ; -+ boolean render = false; -+ -+ int circleX = MathHelper.floor_double(playerX); -+ int circleY = MathHelper.floor_double(playerZ); -+ -+ if (isSquare) { -+ render = Math.abs(playerX - (int) e.posX) < (map.renderSize / 2) - 6 && Math.abs(playerZ - (int) e.posZ) < (map.renderSize / 2) - 6; -+ } else { -+ render = MinimapUtils.insideCircle(circleX, circleY, (map.renderSize / 2) - 4, (int) e.posX, (int) e.posZ); -+ } -+ Texture tex = w.getTexture(); -+ if (render && tex != null) { -+ GL11.glPushMatrix(); -+ if (isSquare && isShowBackground) { // Square Map with ancient-style texture -+ GL11.glTranslatef(-34.0f, 30.0f, 0.0f); -+ } else if (isSquare) { // Square Map with basic texture -+ GL11.glTranslatef(-36.0f, 32.0f, 0.0f); -+ } else if (isShowBackground) { // Round Map with ancient-style texture -+ GL11.glTranslatef(-32.0f, 32.0f, 0.0f); -+ } else { // Round Map with basic texture -+ GL11.glTranslatef(-31.0f, 31.0f, 0.0f); -+ } -+ GL11.glRotatef(-90.0F, 0.0F, 0.0F, 1.0F); -+ switch (MinimapConfig.getInstance().getZoom()) { -+ case 0: -+ GL11.glTranslated(-entityZ, entityX, 0F); -+ break; -+ case 1: -+ GL11.glTranslated(-entityZ * 0.45F, entityX * 0.45F, 0F); -+ break; -+ case 2: -+ GL11.glTranslated(-entityZ * 0.25F, entityX * 0.28F, 0F); -+ break; -+ } -+ GL11.glScaled(0.05, 0.05, 0.05); -+ if (MinimapConfig.getInstance().isSquare()) { -+ GL11.glTranslated(-34f, -30f, 0); // Handles entity face offset for the square map -+ } else { -+ GL11.glTranslated(-32f, -32f, 0); // Handles entity face offset for the round map -+ } -+ GL11.glRotatef(-90, 0, 0, 1); // Handles entity face orientation -+ tex.bind(); -+ drawOnMap(); -+ GL11.glPopMatrix(); -+ } -+ } -+ } -+ } -+ -+ private void drawFocusRound() { -+ Waypoint focus = MinimapConfig.getInstance().getFocussedWaypoint(); -+ if (focus != null) { -+ GL11.glTranslated(-map.renderSize / 4d, map.renderSize / 4d, 0); -+ GL11.glPushMatrix(); -+ GL11.glRotatef(this.direction - 180f, 0f, 0f, 1f); -+ double px = Minecraft.getMinecraft().thePlayer.posX; -+ double pz = Minecraft.getMinecraft().thePlayer.posZ; -+ int x = focus.x; -+ int z = focus.z; -+ -+ int radius = map.renderSize / 4 - 4; -+ double dx = x - px; -+ double dz = z - pz; -+ double l = Math.sqrt(dx * dx + dz * dz); -+ this.distanceToFocus = l; -+ if (l > radius * 2) { -+ double f = radius / l; -+ int fx = (int) (f * dx); -+ int fz = (int) (f * dz); -+ RenderUtil.drawRectangle(fx - 1, fz - 1, fx + 1, fz + 1, 0xff00ffff); -+ } -+ GL11.glPopMatrix(); -+ } -+ } -+ -+ private void drawFocusSquare() { -+ Waypoint focus = MinimapConfig.getInstance().getFocussedWaypoint(); -+ if (focus != null) { -+ GL11.glTranslated(-map.renderSize / 4d, map.renderSize / 4d - 4, 0); -+ GL11.glRotatef(90f, 0, 0, 1f); -+ RenderUtil.drawRectangle(map.renderSize / 4, 0, map.renderSize / 4 + 2, 2, 0xff0000); -+ double px = Minecraft.getMinecraft().thePlayer.posX; -+ double pz = Minecraft.getMinecraft().thePlayer.posZ; -+ double x = focus.x; -+ double z = focus.z; -+ -+ double dx = x - px; -+ double dz = z - pz; -+ -+ double alpha = 0; -+ if (dx == 0) { -+ alpha = 0d; -+ } else { -+ alpha = Math.atan(dz / dx); -+ } -+ double l = Math.sqrt(dx * dx + dz * dz); -+ this.distanceToFocus = l; -+ if (true) { -+ int fx; -+ int fz; -+ if (Math.abs(dx) > Math.abs(dz)) { -+ if (dx > 0) { -+ fx = map.renderSize / 4; -+ } else { -+ fx = -map.renderSize / 4; -+ } -+ fz = (int) (Math.tan(alpha) * fx); -+ } else { -+ if (dz > 0) { -+ fz = map.renderSize / 4; -+ } else { -+ fz = -map.renderSize / 4; -+ } -+ fx = (int) (1 / Math.tan(alpha) * fz); -+ } -+ if (Math.abs(dx) >= (map.renderSize - 5) / 2 || Math.abs(dz) >= (map.renderSize - 5) / 2) { -+ RenderUtil.drawRectangle(fx - 1, fz - 1, fx + 1, fz + 1, 0xff00ffff); -+ } -+ } -+ } -+ } -+ -+ private void renderWaypoints() { -+ double playerX = Minecraft.getMinecraft().thePlayer.posX; -+ double playerZ = Minecraft.getMinecraft().thePlayer.posZ; -+ for (Waypoint pt : MinimapConfig.getInstance().getWaypoints(MinimapUtils.getWorldName())) { -+ if (pt.enabled) { -+ double wayX = playerX - pt.x; -+ double wayY = playerZ - pt.z; -+ -+ int circleX = MathHelper.floor_double(playerX); -+ int circleY = MathHelper.floor_double(playerZ); -+ -+ boolean render = false; -+ if (MinimapConfig.getInstance().isSquare()) { -+ render = Math.abs(playerX - pt.x) < map.renderSize && Math.abs(playerZ - pt.z) < map.renderSize; -+ } else { -+ render = MinimapUtils.insideCircle(circleX, circleY, map.renderSize / 2, pt.x, pt.z); -+ } -+ -+ if (render) { -+ GL11.glPushMatrix(); -+ -+ GL11.glTranslatef(32.0f, -32.0F, 0.0F); -+ GL11.glRotatef(-(this.direction + 90.0F), 0.0F, 0.0F, 1.0F); -+ GL11.glTranslatef(-32.0F, -32.0F, 0.0F); -+ -+ GL11.glTranslatef(-33F, 29F, 0F); -+ switch (MinimapConfig.getInstance().getZoom()) { -+ case 0: -+ GL11.glTranslated(wayY, -wayX, 0F); -+ break; -+ case 1: -+ GL11.glTranslated(wayY * 0.45F, -wayX * 0.45F, 0F); -+ break; -+ case 2: -+ GL11.glTranslated(wayY * 0.25F, -wayX * 0.28F, 0F); -+ break; -+ } -+ GL11.glScalef(0.25F, 0.25F, 1F); -+ -+ GL11.glPopMatrix(); -+ } -+ } -+ } -+ GL11.glColor3f(1f, 1f, 1f); -+ } -+ -+ private void renderMapFull(int scWidth, int scHeight) { -+ map.loadColorImage(); -+ Tessellator.instance.startDrawingQuads(); -+ Tessellator.instance.addVertexWithUV((scWidth) / 2 - 128, (scHeight) / 2 + 128, 1.0D, 0.0D, 1.0D); -+ Tessellator.instance.addVertexWithUV((scWidth) / 2 + 128, (scHeight) / 2 + 128, 1.0D, 1.0D, 1.0D); -+ Tessellator.instance.addVertexWithUV((scWidth) / 2 + 128, (scHeight) / 2 - 128, 1.0D, 1.0D, 0.0D); -+ Tessellator.instance.addVertexWithUV((scWidth) / 2 - 128, (scHeight) / 2 - 128, 1.0D, 0.0D, 0.0D); -+ Tessellator.instance.draw(); -+ -+ try { -+ GL11.glPushMatrix(); -+ texman.loadMMArrow(); -+ GL11.glTranslatef((scWidth) / 2, (scHeight) / 2, 0.0F); -+ GL11.glRotatef(-this.direction - 90.0F, 0.0F, 0.0F, 1.0F); -+ GL11.glTranslatef(-((scWidth) / 2), -((scHeight) / 2), 0.0F); -+ Tessellator.instance.startDrawingQuads(); -+ Tessellator.instance.addVertexWithUV((scWidth) / 2 - 32, (scHeight) / 2 + 32, 1.0D, 0.0D, 1.0D); -+ Tessellator.instance.addVertexWithUV((scWidth) / 2 + 32, (scHeight) / 2 + 32, 1.0D, 1.0D, 1.0D); -+ Tessellator.instance.addVertexWithUV((scWidth) / 2 + 32, (scHeight) / 2 - 32, 1.0D, 1.0D, 0.0D); -+ Tessellator.instance.addVertexWithUV((scWidth) / 2 - 32, (scHeight) / 2 - 32, 1.0D, 0.0D, 0.0D); -+ Tessellator.instance.draw(); -+ } catch (Exception e) { -+// System.err.println("Error: minimap arrow not found!"); -+ e.printStackTrace(); -+ } finally { -+ GL11.glPopMatrix(); -+ } -+ } -+ -+ private void showCoords(int scWidth) { -+ if (MinimapConfig.getInstance().isCoords()) { -+ GL11.glPushMatrix(); -+ GL11.glScalef(0.5f, 0.5f, 1.0f); -+ String xy = ((int) Minecraft.getMinecraft().thePlayer.posX) + ", " + ((int) Minecraft.getMinecraft().thePlayer.posZ); -+ int m = Minecraft.getMinecraft().fontRenderer.getStringWidth(xy) / 2; -+ Minecraft.getMinecraft().fontRenderer.drawString(xy, scWidth * 2 - 32 * 2 - m, 146, 0xffffff); -+ xy = Integer.toString((int) (Minecraft.getMinecraft().thePlayer.posY - 1.620d)); // Substract eyes pos -+ m = Minecraft.getMinecraft().fontRenderer.getStringWidth(xy) / 2; -+ Minecraft.getMinecraft().fontRenderer.drawString(xy, scWidth * 2 - 32 * 2 - m, 156, 0xffffff); -+ if (MinimapConfig.getInstance().getFocussedWaypoint() != null) { -+ String text = (int) distanceToFocus + "m"; -+ int y = MinimapConfig.getInstance().getFocussedWaypoint().y; -+ if (distanceToFocus < 10) { -+ double py = Minecraft.getMinecraft().thePlayer.posY; -+ if (y < py - 3) { -+ text = "\\/ " + text; -+ } -+ if (y > py + 3) { -+ text = "/\\ " + text; -+ } -+ } -+ m = Minecraft.getMinecraft().fontRenderer.getStringWidth(text); -+ Minecraft.getMinecraft().fontRenderer.drawString(text, scWidth * 2 - 32 * 2 - m / 2, 166, 0xffffff); -+ } -+ GL11.glPopMatrix(); -+ } -+ } -+ -+ private void drawRound() { -+ try { -+ GL11.glPushMatrix(); -+ if (MinimapConfig.getInstance().isShowBackground()) { -+ texman.loadRoundmap(); -+ } else { -+ GL11.glScaled(0.97F, 0.97F, 1F); -+ GL11.glTranslatef(-0.50F, 0.50F, 0); -+ texman.loadWhiteRoundmap(); -+ } -+ drawOnMap(); -+ } catch (Exception localException) { -+// System.err.println("Error: minimap overlay not found!"); -+ } finally { -+ GL11.glPopMatrix(); -+ } -+ } -+ -+ private void drawOnMap() { -+ Tessellator.instance.startDrawingQuads(); -+ Tessellator.instance.addVertexWithUV(-64.0D, 64.0D, 1.0D, 0.0D, 1.0D); -+ Tessellator.instance.addVertexWithUV(0, 64.0D, 1.0D, 1.0D, 1.0D); -+ Tessellator.instance.addVertexWithUV(0, 0, 1.0D, 1.0D, 0.0D); -+ Tessellator.instance.addVertexWithUV(-64.0D, 0, 1.0D, 0.0D, 0.0D); -+ Tessellator.instance.draw(); -+ } -+ -+ private void drawDirections() { -+ if (!MinimapConfig.getInstance().isDirections()) { -+ return; -+ } -+ float dir = -180; -+ int xPosition; -+ int yPosition; -+ boolean isSquare = MinimapConfig.getInstance().isSquare(); -+ boolean isShowBackground = MinimapConfig.getInstance().isShowBackground(); -+ -+ if (isSquare && isShowBackground) { // Square Map with ancient-style texture -+ xPosition = -66; -+ yPosition = 54; -+ } else if (isSquare) { // Square Map with basic texture -+ xPosition = -70; -+ yPosition = 57; -+ } else { // Round Map -+ xPosition = -66; -+ yPosition = 60; -+ } -+ GL11.glPushMatrix(); -+ GL11.glScalef(0.5f, 0.5f, 1.0f); -+ GL11.glTranslated((64.0D * Math.sin(Math.toRadians(-(dir)))), (64.0D * Math.cos(Math.toRadians(-(dir)))), 0.0D); -+ Minecraft.getMinecraft().fontRenderer.drawString("N", xPosition, yPosition, 0xffffff); -+ GL11.glPopMatrix(); -+ -+ dir += 90; -+ -+ GL11.glPushMatrix(); -+ GL11.glScalef(0.5f, 0.5f, 1.0f); -+ GL11.glTranslated((64.0D * Math.sin(Math.toRadians(-(dir)))), (64.0D * Math.cos(Math.toRadians(-(dir)))), 0.0D); -+ Minecraft.getMinecraft().fontRenderer.drawString("E", xPosition, yPosition, 0xffffff); -+ GL11.glPopMatrix(); -+ -+ dir += 90; -+ -+ GL11.glPushMatrix(); -+ GL11.glScalef(0.5f, 0.5f, 1.0f); -+ GL11.glTranslated((64.0D * Math.sin(Math.toRadians(-(dir)))), (64.0D * Math.cos(Math.toRadians(-(dir)))), 0.0D); -+ Minecraft.getMinecraft().fontRenderer.drawString("S", xPosition, yPosition, 0xffffff); -+ GL11.glPopMatrix(); -+ -+ dir += 90; -+ -+ GL11.glPushMatrix(); -+ GL11.glScalef(0.5f, 0.5f, 1.0f); -+ GL11.glTranslated((64.0D * Math.sin(Math.toRadians(-(dir)))), (64.0D * Math.cos(Math.toRadians(-(dir)))), 0.0D); -+ Minecraft.getMinecraft().fontRenderer.drawString("W", xPosition, yPosition, 0xffffff); -+ GL11.glPopMatrix(); -+ } -+} ---- /dev/null -+++ com/prupe/mcpatcher/sky/SkyRenderer$Layer.java -@@ -1,0 +1,264 @@ -+package com.prupe.mcpatcher.sky; -+ -+import com.prupe.mcpatcher.BlendMethod; -+import com.prupe.mcpatcher.MCPatcherUtils; -+import com.prupe.mcpatcher.TexturePackAPI; -+import java.util.Properties; -+import net.minecraft.src.ResourceLocation; -+import net.minecraft.src.Tessellator; -+import org.lwjgl.opengl.GL11; -+ -+class SkyRenderer$Layer { -+ private static final int SECS_PER_DAY = 86400; -+ private static final int TICKS_PER_DAY = 24000; -+ private static final double TOD_OFFSET = -0.25D; -+ private static final double SKY_DISTANCE = 100.0D; -+ private final ResourceLocation propertiesName; -+ private final Properties properties; -+ private ResourceLocation texture; -+ private boolean fade; -+ private boolean rotate; -+ private float[] axis; -+ private float speed; -+ private BlendMethod blendMethod; -+ private double a; -+ private double b; -+ private double c; -+ boolean valid; -+ float brightness; -+ -+ static SkyRenderer$Layer create(ResourceLocation resource) { -+ Properties properties = TexturePackAPI.getProperties(resource); -+ return properties == null ? null : new SkyRenderer$Layer(resource, properties); -+ } -+ -+ SkyRenderer$Layer(ResourceLocation propertiesName, Properties properties) { -+ this.propertiesName = propertiesName; -+ this.properties = properties; -+ this.valid = true; -+ this.valid = this.readTexture() && this.readRotation() & this.readBlendingMethod() && this.readFadeTimers(); -+ } -+ -+ private boolean readTexture() { -+ this.texture = TexturePackAPI.parseResourceLocation(this.propertiesName, this.properties.getProperty("source", this.propertiesName.getResourcePath().replaceFirst("\\.properties$", ".png"))); -+ return TexturePackAPI.hasResource(this.texture) ? true : this.addError("source texture %s not found", new Object[] {this.texture}); -+ } -+ -+ private boolean readRotation() { -+ this.rotate = MCPatcherUtils.getBooleanProperty(this.properties, "rotate", true); -+ -+ if (this.rotate) { -+ try { -+ this.speed = Float.parseFloat(this.properties.getProperty("speed", "1.0")); -+ } catch (NumberFormatException var8) { -+ return this.addError("invalid rotation speed", new Object[0]); -+ } -+ -+ String value = this.properties.getProperty("axis", "0.0 0.0 1.0").trim().toLowerCase(); -+ String[] tokens = value.split("\\s+"); -+ -+ if (tokens.length != 3) { -+ return this.addError("invalid rotate value %s", new Object[] {value}); -+ } -+ -+ float x; -+ float y; -+ float z; -+ -+ try { -+ x = Float.parseFloat(tokens[0]); -+ y = Float.parseFloat(tokens[1]); -+ z = Float.parseFloat(tokens[2]); -+ } catch (NumberFormatException var7) { -+ return this.addError("invalid rotation axis", new Object[0]); -+ } -+ -+ if (x * x + y * y + z * z == 0.0F) { -+ return this.addError("rotation axis cannot be 0", new Object[0]); -+ } -+ -+ this.axis = new float[] {z, y, -x}; -+ } -+ -+ return true; -+ } -+ -+ private boolean readBlendingMethod() { -+ String value = this.properties.getProperty("blend", "add"); -+ this.blendMethod = BlendMethod.parse(value); -+ return this.blendMethod == null ? this.addError("unknown blend method %s", new Object[] {value}): true; -+ } -+ -+ private boolean readFadeTimers() { -+ this.fade = Boolean.parseBoolean(this.properties.getProperty("fade", "true")); -+ -+ if (!this.fade) { -+ return true; -+ } else { -+ int startFadeIn = this.parseTime(this.properties, "startFadeIn"); -+ int endFadeIn = this.parseTime(this.properties, "endFadeIn"); -+ int endFadeOut = this.parseTime(this.properties, "endFadeOut"); -+ -+ if (!this.valid) { -+ return false; -+ } else { -+ while (endFadeIn <= startFadeIn) { -+ endFadeIn += 86400; -+ } -+ -+ while (endFadeOut <= endFadeIn) { -+ endFadeOut += 86400; -+ } -+ -+ if (endFadeOut - startFadeIn >= 86400) { -+ return this.addError("fade times must fall within a 24 hour period", new Object[0]); -+ } else { -+ int startFadeOut = startFadeIn + endFadeOut - endFadeIn; -+ double s0 = normalize((double)startFadeIn, 86400, -0.25D); -+ double s1 = normalize((double)endFadeIn, 86400, -0.25D); -+ double e0 = normalize((double)startFadeOut, 86400, -0.25D); -+ double e1 = normalize((double)endFadeOut, 86400, -0.25D); -+ double det = Math.cos(s0) * Math.sin(s1) + Math.cos(e1) * Math.sin(s0) + Math.cos(s1) * Math.sin(e1) - Math.cos(s0) * Math.sin(e1) - Math.cos(s1) * Math.sin(s0) - Math.cos(e1) * Math.sin(s1); -+ -+ if (det == 0.0D) { -+ return this.addError("determinant is 0", new Object[0]); -+ } else { -+ this.a = (Math.sin(e1) - Math.sin(s0)) / det; -+ this.b = (Math.cos(s0) - Math.cos(e1)) / det; -+ this.c = (Math.cos(e1) * Math.sin(s0) - Math.cos(s0) * Math.sin(e1)) / det; -+ SkyRenderer.access$400().finer("%s: y = %f cos x + %f sin x + %f", new Object[] {this.propertiesName, Double.valueOf(this.a), Double.valueOf(this.b), Double.valueOf(this.c)}); -+ SkyRenderer.access$400().finer(" at %f: %f", new Object[] {Double.valueOf(s0), Double.valueOf(this.f(s0))}); -+ SkyRenderer.access$400().finer(" at %f: %f", new Object[] {Double.valueOf(s1), Double.valueOf(this.f(s1))}); -+ SkyRenderer.access$400().finer(" at %f: %f", new Object[] {Double.valueOf(e0), Double.valueOf(this.f(e0))}); -+ SkyRenderer.access$400().finer(" at %f: %f", new Object[] {Double.valueOf(e1), Double.valueOf(this.f(e1))}); -+ return true; -+ } -+ } -+ } -+ } -+ } -+ -+ private boolean addError(String format, Object ... params) { -+ SkyRenderer.access$400().error("" + this.propertiesName + ": " + format, params); -+ this.valid = false; -+ return false; -+ } -+ -+ private int parseTime(Properties properties, String key) { -+ String s = properties.getProperty(key, "").trim(); -+ -+ if ("".equals(s)) { -+ this.addError("missing value for %s", new Object[] {key}); -+ return -1; -+ } else { -+ String[] t = s.split(":"); -+ -+ if (t.length >= 2) { -+ try { -+ int e = Integer.parseInt(t[0].trim()); -+ int mm = Integer.parseInt(t[1].trim()); -+ int ss; -+ -+ if (t.length >= 3) { -+ ss = Integer.parseInt(t[2].trim()); -+ } else { -+ ss = 0; -+ } -+ -+ return (3600 * e + 60 * mm + ss) % 86400; -+ } catch (NumberFormatException var8) { -+ ; -+ } -+ } -+ -+ this.addError("invalid %s time %s", new Object[] {key, s}); -+ return -1; -+ } -+ } -+ -+ private static double normalize(double time, int period, double offset) { -+ return (Math.PI * 2D) * (time / (double)period + offset); -+ } -+ -+ private double f(double x) { -+ return this.a * Math.cos(x) + this.b * Math.sin(x) + this.c; -+ } -+ -+ boolean prepare() { -+ this.brightness = SkyRenderer.access$500(); -+ -+ if (this.fade) { -+ double x = normalize(SkyRenderer.access$600(), 24000, 0.0D); -+ this.brightness *= (float)this.f(x); -+ } -+ -+ if (this.brightness <= 0.0F) { -+ return false; -+ } else { -+ if (this.brightness > 1.0F) { -+ this.brightness = 1.0F; -+ } -+ -+ return true; -+ } -+ } -+ -+ boolean render(Tessellator tessellator) { -+ TexturePackAPI.bindTexture(this.texture); -+ this.setBlendingMethod(this.brightness); -+ GL11.glPushMatrix(); -+ -+ if (this.rotate) { -+ GL11.glRotatef(SkyRenderer.access$700() * 360.0F * this.speed, this.axis[0], this.axis[1], this.axis[2]); -+ } -+ -+ GL11.glRotatef(90.0F, 1.0F, 0.0F, 0.0F); -+ GL11.glRotatef(-90.0F, 0.0F, 0.0F, 1.0F); -+ drawTile(tessellator, 4); -+ GL11.glPushMatrix(); -+ GL11.glRotatef(90.0F, 1.0F, 0.0F, 0.0F); -+ drawTile(tessellator, 1); -+ GL11.glPopMatrix(); -+ GL11.glPushMatrix(); -+ GL11.glRotatef(-90.0F, 1.0F, 0.0F, 0.0F); -+ drawTile(tessellator, 0); -+ GL11.glPopMatrix(); -+ GL11.glRotatef(90.0F, 0.0F, 0.0F, 1.0F); -+ drawTile(tessellator, 5); -+ GL11.glRotatef(90.0F, 0.0F, 0.0F, 1.0F); -+ drawTile(tessellator, 2); -+ GL11.glRotatef(90.0F, 0.0F, 0.0F, 1.0F); -+ drawTile(tessellator, 3); -+ GL11.glPopMatrix(); -+ return true; -+ } -+ -+ private static void drawTile(Tessellator tessellator, int tile) { -+ double tileX = (double)(tile % 3) / 3.0D; -+ double tileY = (double)(tile / 3) / 2.0D; -+ tessellator.startDrawingQuads(); -+ tessellator.addVertexWithUV(-100.0D, -100.0D, -100.0D, tileX, tileY); -+ tessellator.addVertexWithUV(-100.0D, -100.0D, 100.0D, tileX, tileY + 0.5D); -+ tessellator.addVertexWithUV(100.0D, -100.0D, 100.0D, tileX + 0.3333333333333333D, tileY + 0.5D); -+ tessellator.addVertexWithUV(100.0D, -100.0D, -100.0D, tileX + 0.3333333333333333D, tileY); -+ tessellator.draw(); -+ } -+ -+ void setBlendingMethod(float brightness) { -+ this.blendMethod.applyFade(brightness); -+ this.blendMethod.applyAlphaTest(); -+ this.blendMethod.applyBlending(); -+ GL11.glEnable(GL11.GL_TEXTURE_2D); -+ } -+ -+ static void clearBlendingMethod() { -+ GL11.glDisable(GL11.GL_ALPHA_TEST); -+ GL11.glEnable(GL11.GL_BLEND); -+ GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE); -+ GL11.glColor4f(1.0F, 1.0F, 1.0F, SkyRenderer.access$500()); -+ } -+ -+ static ResourceLocation access$300(SkyRenderer$Layer x0) { -+ return x0.texture; -+ } -+} ---- /dev/null -+++ org/spoutcraft/client/config/Configuration.java -@@ -1,0 +1,819 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.client.config; -+ -+import java.io.File; -+import java.lang.reflect.Field; -+import java.lang.reflect.Modifier; -+import java.util.HashMap; -+import java.util.Map; -+ -+import org.lwjgl.opengl.GL11; -+ -+import net.minecraft.src.Minecraft; -+ -+import org.spoutcraft.client.io.FileUtil; -+ -+public class Configuration { -+ // Client settings -+ private static int advancedOpenGL = 0; -+ private static boolean anaglyph3D = false; -+ private static int autosave = 0; -+ public static int betterGrass = 0; -+ private static boolean fancyBiomeColors = false; -+ private static boolean waterBiomeColors = true; -+ private static float brightnessSlider = 1F; -+ public static boolean chatColorAssist = false; -+ public static boolean fancyClouds = false; -+ private static boolean fancyFog = false; -+ private static boolean fancyGraphics = false; -+ public static boolean fancyGrass = false; -+ private static boolean fancyTrees = false; -+ private static boolean fancyWater = false; -+ private static boolean fancyWeather = false; -+ private static boolean farView = false; -+ public static boolean fancyLight = false; -+ private static boolean fancyParticles = false; -+ private static int fastDebug = 0; -+ private static int guiScale = 0; -+ private static int performance = 0; -+ private static int chunkRenderPasses = 2; -+ private static int renderDistance = 0; -+ public static int signDistance = 16; -+ public static boolean cheatsky = true; -+ private static boolean forcesky = false; -+ private static boolean showsky = true; -+ public static boolean cheatclearWater = false; -+ private static boolean forceclearWater = false; -+ private static boolean showclearWater = false; -+ public static boolean cheatvoidFog = false; -+ private static boolean forcevoidFog = false; -+ private static boolean showvoidFog = true; -+ public static boolean cheatweather = true; -+ private static boolean forceweather = false; -+ private static boolean showweather = true; -+ public static boolean cheatstars = true; -+ private static boolean forcestars = false; -+ private static boolean showstars = true; -+ private static boolean smoothFPS = false; -+ public static float smoothLighting = 1F; -+ private static int time = 0; -+ private static boolean viewBobbing = false; -+ private static boolean delayedTooltips = true; -+ private static float mipmapsPercent = 0F; -+ private static boolean automatePerformance = true; -+ private static int automateMode = 0; -+ private static boolean clientLight = false; -+ private static float flightSpeedFactor = 1.0F; -+ private static boolean replaceTools = false; -+ private static boolean replaceBlocks = false; -+ private static boolean hotbarQuickKeysEnabled = true; -+ private static boolean resizeScreenshots = false; -+ private static float chatOpacity = 0.5f; -+ private static int mainMenuState = defaultMenuState(); -+ private static boolean connectedTextures = false; -+ private static boolean advancedOptions = false; -+ private static boolean randomMobTextures = true; -+ public static boolean ambientOcclusion = false; -+ private static boolean serverTexturePromptsEnabled = true; -+ public static boolean showHotbarText = true; -+ public static int aaSampling = 0; -+ public static boolean optimizedLightingUpdates = false; -+ public static boolean displayCustomParticles = false; -+ public static boolean displayEntityNamesinRange = false; -+ public static boolean displayPlayerNames3rdPerson = true; -+ public static boolean displayAnimalHeatinColor = false; -+ public static boolean fancyItems = true; -+ -+ // Config specific -+ private static transient Map defaultSettings = new HashMap(); -+ private static transient boolean dirty = false; -+ private static transient boolean vsync = false; -+ -+ public static synchronized void read() { -+ // Cleanup old -+ File old = new File(FileUtil.getConfigDir(), "spoutcraft.properties"); -+ old.delete(); -+ -+ File configFile = new File(FileUtil.getConfigDir(), "client.yml"); -+ try { -+ if (!configFile.exists()) { -+ configFile.createNewFile(); -+ } -+ org.bukkit.util.config.Configuration config = new org.bukkit.util.config.Configuration(configFile); -+ config.load(); -+ -+ Field[] fields = Configuration.class.getDeclaredFields(); -+ for (int i = 0; i < fields.length; i++) { -+ Field f = fields[i]; -+ if (Modifier.isStatic(f.getModifiers()) && !Modifier.isTransient(f.getModifiers())) { -+ f.setAccessible(true); -+ Object value = f.get(null); -+ defaultSettings.put(f.getName(), value); -+ -+ if (value instanceof Boolean) { -+ f.set(null, config.getBoolean(f.getName(), (Boolean)value)); -+ } else if (value instanceof Integer) { -+ f.set(null, config.getInt(f.getName(), (Integer)value)); -+ } else if (value instanceof Float) { -+ f.set(null, (float)config.getDouble(f.getName(), (Float)value)); -+ } else if (value instanceof Double) { -+ f.set(null, config.getDouble(f.getName(), (Double)value)); -+ } else if (value instanceof String) { -+ f.set(null, config.getString(f.getName(), (String)value)); -+ } -+ } -+ } -+ } catch (Exception e) { -+ e.printStackTrace(); -+ } -+ updateMCConfig(); -+ } -+ -+ public static synchronized void write() { -+ dirty = false; -+ File configFile = new File(FileUtil.getConfigDir(), "client.yml"); -+ try { -+ if (!configFile.exists()) { -+ configFile.createNewFile(); -+ } -+ org.bukkit.util.config.Configuration config = new org.bukkit.util.config.Configuration(configFile); -+ config.load(); -+ Field[] fields = Configuration.class.getDeclaredFields(); -+ for (Field f : fields) { -+ if (Modifier.isStatic(f.getModifiers()) && !Modifier.isTransient(f.getModifiers())) { -+ Object value = f.get(null); -+ config.setProperty(f.getName(), value); -+ } -+ } -+ config.save(); -+ } catch (Exception e) { -+ e.printStackTrace(); -+ } -+ } -+ -+ private static void updateMCConfig() { -+ Minecraft.getMinecraft().gameSettings.ambientOcclusion = Configuration.isAmbientOcclusion() ? 2 : 0; -+ Minecraft.getMinecraft().gameSettings.anaglyph = Configuration.isAnaglyph3D(); -+ Minecraft.getMinecraft().gameSettings.renderDistance = Configuration.getRenderDistance(); -+ Minecraft.getMinecraft().gameSettings.fancyGraphics = Configuration.isFancyGraphics(); -+ Minecraft.getMinecraft().gameSettings.advancedOpengl = Configuration.getAdvancedOpenGL() !=0; -+ Minecraft.getMinecraft().gameSettings.guiScale = Configuration.getGuiScale(); -+ Minecraft.getMinecraft().gameSettings.viewBobbing = Configuration.isViewBobbing(); -+ Minecraft.getMinecraft().gameSettings.gammaSetting = Configuration.getBrightnessSlider(); -+ -+ Minecraft.getMinecraft().gameSettings.limitFramerate = Configuration.getPerformance(); -+ if (vsync != (Configuration.getPerformance() == 3)) { -+ vsync = Configuration.getPerformance() == 3; -+ org.lwjgl.opengl.Display.setVSyncEnabled(vsync); -+ } -+ -+ if (Configuration.getSignDistance() < 8) { -+ signDistance = 8; -+ } else if (Configuration.getSignDistance() >= 128 && Configuration.getSignDistance() != Integer.MAX_VALUE) { -+ signDistance = Integer.MAX_VALUE; -+ } -+ } -+ -+ public static int defaultMenuState() { -+ if (isOpenGL(3)) { -+ return 1; -+ } -+ if (isOpenGL(2)) { -+ return 2; -+ } -+ return 3; -+ } -+ -+ public static boolean isOpenGL(int v) { -+ try { -+ String version = GL11.glGetString(GL11.GL_VERSION); -+ return Integer.parseInt(String.valueOf(version.charAt(0))) >= v; -+ } -+ catch (Exception e) { -+ return false; -+ } -+ } -+ -+ public static synchronized void restoreDefaults() { -+ Field[] fields = Configuration.class.getDeclaredFields(); -+ for (int i = 0; i < fields.length; i++) { -+ Field f = fields[i]; -+ Object value = defaultSettings.get(f.getName()); -+ if (value != null && f != null) { -+ try { -+ f.setAccessible(true); -+ f.set(null, value); -+ } catch (Exception e) { -+ e.printStackTrace(); -+ } -+ } -+ } -+ write(); -+ updateMCConfig(); -+ } -+ -+ public static synchronized int getAdvancedOpenGL() { -+ return advancedOpenGL; -+ } -+ -+ public static synchronized void setAdvancedOpenGL(int advancedOpenGL) { -+ Configuration.advancedOpenGL = advancedOpenGL; -+ onPropertyChange(); -+ } -+ -+ public static synchronized boolean isAnaglyph3D() { -+ return anaglyph3D; -+ } -+ -+ public static synchronized void setAnaglyph3D(boolean anaglyph3D) { -+ Configuration.anaglyph3D = anaglyph3D; -+ onPropertyChange(); -+ } -+ -+ public static synchronized int getAutosave() { -+ return autosave; -+ } -+ -+ public static synchronized void setAutosave(int autosave) { -+ Configuration.autosave = autosave; -+ onPropertyChange(); -+ } -+ -+ public static synchronized int getBetterGrass() { -+ return betterGrass; -+ } -+ -+ public static synchronized void setBetterGrass(int betterGrass) { -+ Configuration.betterGrass = betterGrass; -+ onPropertyChange(); -+ } -+ -+ public static synchronized boolean isFancyBiomeColors() { -+ return fancyBiomeColors; -+ } -+ -+ public static synchronized void setFancyBiomeColors(boolean fancyBiomeColors) { -+ Configuration.fancyBiomeColors = fancyBiomeColors; -+ onPropertyChange(); -+ } -+ -+ public static synchronized boolean isWaterBiomeColors() { -+ return waterBiomeColors; -+ } -+ -+ public static synchronized void setWaterBiomeColors(boolean waterBiomeColors) { -+ Configuration.waterBiomeColors = waterBiomeColors; -+ onPropertyChange(); -+ } -+ -+ public static synchronized float getBrightnessSlider() { -+ return brightnessSlider; -+ } -+ -+ public static synchronized void setBrightnessSlider(float brightnessSlider) { -+ Configuration.brightnessSlider = brightnessSlider; -+ onPropertyChange(); -+ } -+ -+ public static synchronized boolean isClearWater() { -+ return showclearWater; -+ } -+ -+ public static synchronized void setClearWater(boolean showclearWater) { -+ Configuration.showclearWater = showclearWater; -+ onPropertyChange(); -+ } -+ -+ public static synchronized boolean isFancyClouds() { -+ return fancyClouds; -+ } -+ -+ public static synchronized void setFancyClouds(boolean fancyClouds) { -+ Configuration.fancyClouds = fancyClouds; -+ onPropertyChange(); -+ } -+ -+ public static synchronized boolean isFancyFog() { -+ return fancyFog; -+ } -+ -+ public static synchronized void setFancyFog(boolean fancyFog) { -+ Configuration.fancyFog = fancyFog; -+ onPropertyChange(); -+ } -+ -+ public static synchronized boolean isFancyGraphics() { -+ return fancyGraphics; -+ } -+ -+ public static synchronized void setFancyGraphics(boolean fancyGraphics) { -+ Configuration.fancyGraphics = fancyGraphics; -+ onPropertyChange(); -+ } -+ -+ public static synchronized boolean isFancyGrass() { -+ return fancyGrass; -+ } -+ -+ public static synchronized void setFancyGrass(boolean fancyGrass) { -+ Configuration.fancyGrass = fancyGrass; -+ onPropertyChange(); -+ } -+ -+ public static synchronized boolean isFancyTrees() { -+ return fancyTrees; -+ } -+ -+ public static synchronized void setFancyTrees(boolean fancyTrees) { -+ Configuration.fancyTrees = fancyTrees; -+ onPropertyChange(); -+ } -+ -+ public static synchronized boolean isFancyWater() { -+ return fancyWater; -+ } -+ -+ public static synchronized void setFancyWater(boolean fancyWater) { -+ Configuration.fancyWater = fancyWater; -+ onPropertyChange(); -+ } -+ -+ public static synchronized boolean isFancyWeather() { -+ return fancyWeather; -+ } -+ -+ public static synchronized void setFancyWeather(boolean fancyWeather) { -+ Configuration.fancyWeather = fancyWeather; -+ onPropertyChange(); -+ } -+ -+ public static synchronized boolean isFarView() { -+ return farView; -+ } -+ -+ public static synchronized void setFarView(boolean farView) { -+ Configuration.farView = farView; -+ onPropertyChange(); -+ } -+ -+ public static synchronized boolean isFancyParticles() { -+ return fancyParticles; -+ } -+ -+ public static synchronized void setFancyParticles(boolean fancyParticles) { -+ Configuration.fancyParticles = fancyParticles; -+ onPropertyChange(); -+ } -+ -+ public static synchronized boolean isFancyLight() { -+ return fancyLight; -+ } -+ -+ public static synchronized void setFancyLight(boolean fancyLight) { -+ Configuration.fancyLight = fancyLight; -+ onPropertyChange(); -+ } -+ -+ public static synchronized int getFastDebug() { -+ return fastDebug; -+ } -+ -+ public static synchronized void setFastDebug(int fastDebug) { -+ Configuration.fastDebug = fastDebug; -+ onPropertyChange(); -+ } -+ -+ public static synchronized int getGuiScale() { -+ return guiScale; -+ } -+ -+ public static synchronized void setGuiScale(int guiScale) { -+ Configuration.guiScale = guiScale; -+ onPropertyChange(); -+ } -+ -+ public static synchronized int getPerformance() { -+ return performance; -+ } -+ -+ public static synchronized void setPerformance(int performance) { -+ Configuration.performance = performance; -+ onPropertyChange(); -+ } -+ -+ public static synchronized int getChunkRenderPasses() { -+ return chunkRenderPasses; -+ } -+ -+ public static synchronized void setChunkRenderPasses(int chunkRenderPasses) { -+ Configuration.chunkRenderPasses = chunkRenderPasses; -+ onPropertyChange(); -+ } -+ -+ public static synchronized int getRenderDistance() { -+ return renderDistance; -+ } -+ -+ public static synchronized void setRenderDistance(int renderDistance) { -+ Configuration.renderDistance = renderDistance; -+ onPropertyChange(); -+ } -+ -+ public static synchronized int getSignDistance() { -+ return signDistance; -+ } -+ -+ public static synchronized void setSignDistance(int signDistance) { -+ Configuration.signDistance = signDistance; -+ onPropertyChange(); -+ } -+ -+ public static synchronized boolean isCheatSky() { -+ return cheatsky; -+ } -+ -+ public static synchronized boolean isForceSky() { -+ return forcesky; -+ } -+ -+ public static synchronized boolean isSky() { -+ return showsky; -+ } -+ -+ public static synchronized void setSky(boolean showsky) { -+ Configuration.showsky = showsky; -+ onPropertyChange(); -+ } -+ -+ public static synchronized boolean isSmoothFPS() { -+ return smoothFPS; -+ } -+ -+ public static synchronized void setSmoothFPS(boolean smoothFPS) { -+ Configuration.smoothFPS = smoothFPS; -+ onPropertyChange(); -+ } -+ -+ public static synchronized float getSmoothLighting() { -+ return smoothLighting; -+ } -+ -+ public static synchronized void setSmoothLighting(float smoothLighting) { -+ Configuration.smoothLighting = smoothLighting; -+ onPropertyChange(); -+ } -+ -+ public static synchronized boolean isCheatStars() { -+ return cheatstars; -+ } -+ -+ public static synchronized boolean isForceStars() { -+ return forcestars; -+ } -+ -+ public static synchronized boolean isStars() { -+ return showstars; -+ } -+ -+ public static synchronized void setStars(boolean showstars) { -+ Configuration.showstars = showstars; -+ onPropertyChange(); -+ } -+ -+ public static synchronized int getTime() { -+ return time; -+ } -+ -+ public static synchronized void setTime(int time) { -+ Configuration.time = time; -+ onPropertyChange(); -+ } -+ -+ public static synchronized boolean isViewBobbing() { -+ return viewBobbing; -+ } -+ -+ public static synchronized void setViewBobbing(boolean viewBobbing) { -+ Configuration.viewBobbing = viewBobbing; -+ onPropertyChange(); -+ } -+ -+ public static synchronized boolean isCheatVoidFog() { -+ return cheatvoidFog; -+ } -+ -+ public static synchronized boolean isForceVoidFog() { -+ return forcevoidFog; -+ } -+ -+ public static synchronized boolean isVoidFog() { -+ return showvoidFog; -+ } -+ -+ public static synchronized void setVoidFog(boolean showvoidFog) { -+ Configuration.showvoidFog = showvoidFog; -+ onPropertyChange(); -+ } -+ -+ public static synchronized boolean isCheatWeather() { -+ return cheatweather; -+ } -+ -+ public static synchronized boolean isForceWeather() { -+ return forceweather; -+ } -+ -+ public static synchronized boolean isWeather() { -+ return showweather; -+ } -+ -+ public static synchronized void setWeather(boolean showweather) { -+ Configuration.showweather = showweather; -+ onPropertyChange(); -+ } -+ -+ public static synchronized boolean isDelayedTooltips() { -+ return delayedTooltips; -+ } -+ -+ public static synchronized void setDelayedTooltips(boolean delayedTooltips) { -+ Configuration.delayedTooltips = delayedTooltips; -+ onPropertyChange(); -+ } -+ -+ public static synchronized float getMipmapsPercent() { -+ return mipmapsPercent; -+ } -+ -+ public static synchronized void setMipmapsPercent(float mipmapsPercent) { -+ Configuration.mipmapsPercent = mipmapsPercent; -+ onPropertyChange(); -+ } -+ -+ public static synchronized boolean isAutomatePerformance() { -+ return automatePerformance; -+ } -+ -+ public static synchronized void setAutomatePerformance(boolean automatePerformance) { -+ Configuration.automatePerformance = automatePerformance; -+ onPropertyChange(); -+ } -+ -+ public static synchronized int getAutomateMode() { -+ return automateMode; -+ } -+ -+ public static synchronized void setAutomateMode(int automateMode) { -+ Configuration.automateMode = automateMode; -+ onPropertyChange(); -+ } -+ -+ public static synchronized boolean isClientLight() { -+ return clientLight; -+ } -+ -+ public static synchronized void setClientLight(boolean clientLight) { -+ Configuration.clientLight = clientLight; -+ onPropertyChange(); -+ } -+ -+ public static synchronized float getFlightSpeedFactor() { -+ return flightSpeedFactor; -+ } -+ -+ public static synchronized void setFlightSpeedFactor(float flightSpeedFactor) { -+ Configuration.flightSpeedFactor = flightSpeedFactor; -+ onPropertyChange(); -+ } -+ -+ public static synchronized boolean isReplaceTools() { -+ return replaceTools; -+ } -+ -+ public static synchronized void setReplaceTools(boolean replaceTools) { -+ Configuration.replaceTools = replaceTools; -+ onPropertyChange(); -+ } -+ -+ public static synchronized boolean isReplaceBlocks() { -+ return replaceBlocks; -+ } -+ -+ public static synchronized void setReplaceBlocks(boolean replaceBlocks) { -+ Configuration.replaceBlocks = replaceBlocks; -+ onPropertyChange(); -+ } -+ -+ public static synchronized boolean isHotbarQuickKeysEnabled() { -+ return hotbarQuickKeysEnabled; -+ } -+ -+ public static synchronized void setHotbarQuickKeysEnabled(boolean hotbarQuickKeysEnabled) { -+ Configuration.hotbarQuickKeysEnabled = hotbarQuickKeysEnabled; -+ onPropertyChange(); -+ } -+ -+ public static synchronized boolean isResizeScreenshots() { -+ return resizeScreenshots; -+ } -+ -+ public static synchronized void setResizeScreenshots(boolean resizeScreenshots) { -+ Configuration.resizeScreenshots = resizeScreenshots; -+ onPropertyChange(); -+ } -+ -+ public static synchronized float getChatOpacity() { -+ return chatOpacity; -+ } -+ -+ public static synchronized void setChatOpacity(float chatOpacity) { -+ Configuration.chatOpacity = chatOpacity; -+ onPropertyChange(); -+ } -+ -+ public static synchronized int getMainMenuState() { -+ return mainMenuState; -+ } -+ -+ public static synchronized void setMainMenuState(int mainMenuState) { -+ Configuration.mainMenuState = mainMenuState; -+ onPropertyChange(); -+ } -+ -+ public static synchronized boolean isConnectedTextures() { -+ return connectedTextures; -+ } -+ -+ public static synchronized void setConnectedTextures(boolean connectedTextures) { -+ Configuration.connectedTextures = connectedTextures; -+ onPropertyChange(); -+ } -+ -+ public static synchronized boolean isRandomMobTextures() { -+ return randomMobTextures; -+ } -+ -+ public static synchronized void setRandomMobTextures(boolean randomMobTextures) { -+ Configuration.randomMobTextures = randomMobTextures; -+ onPropertyChange(); -+ } -+ -+ public static synchronized boolean isAdvancedOptions() { -+ return advancedOptions; -+ } -+ -+ public static synchronized void setAdvancedOptions(boolean advancedOptions) { -+ Configuration.advancedOptions = advancedOptions; -+ onPropertyChange(); -+ } -+ -+ public static synchronized void setAmbientOcclusion(boolean ambientOcclusion) { -+ Configuration.ambientOcclusion = ambientOcclusion; -+ onPropertyChange(); -+ } -+ -+ public static synchronized boolean isAmbientOcclusion() { -+ return ambientOcclusion; -+ } -+ -+ public static synchronized boolean isServerTexturePromptsEnabled() { -+ return serverTexturePromptsEnabled; -+ } -+ -+ public static synchronized void setServerTexturePromptsEnabled(boolean serverTexturePromptsEnabled) { -+ Configuration.serverTexturePromptsEnabled = serverTexturePromptsEnabled; -+ onPropertyChange(); -+ } -+ -+ private static synchronized void onPropertyChange() { -+ updateMCConfig(); -+ dirty = true; -+ } -+ -+ public static void onTick() { -+ if (dirty) { -+ write(); -+ } -+ } -+ -+ public static void setAASampling() { -+ if (aaSampling == 0) { -+ aaSampling = 2; -+ return; -+ } -+ -+ if (aaSampling == 2) { -+ aaSampling = 4; -+ return; -+ } -+ -+ if (aaSampling == 4) { -+ aaSampling = 6; -+ return; -+ } -+ -+ if (aaSampling == 6) { -+ aaSampling = 8; -+ return; -+ } -+ -+ if (aaSampling == 8) { -+ aaSampling = 0; -+ return; -+ } -+ } -+ -+ public static int getAASampling() { -+ return aaSampling; -+ } -+ -+ public static boolean isShowingChatColorAssist() { -+ return chatColorAssist; -+ } -+ -+ public static synchronized void setChatColorAssist(boolean chatColorAssist) { -+ Configuration.chatColorAssist = chatColorAssist; -+ onPropertyChange(); -+ } -+ -+ public static synchronized boolean isShowingHotbarText() { -+ return showHotbarText; -+ } -+ -+ public static synchronized void setShowingHotbarText(boolean showingHotbarText) { -+ Configuration.showHotbarText = showingHotbarText; -+ onPropertyChange(); -+ } -+ -+ public static synchronized boolean isOptimizedLightingUpdates() { -+ return optimizedLightingUpdates; -+ } -+ -+ public static synchronized void setOptimizedLightingUpdates(boolean optimizedLightingUpdates) { -+ Configuration.optimizedLightingUpdates = optimizedLightingUpdates; -+ onPropertyChange(); -+ } -+ -+ public static synchronized boolean isDisplayCustomParticles() { -+ return displayCustomParticles; -+ } -+ -+ public static synchronized void setDisplayCustomParticles(boolean displayCustomParticles) { -+ Configuration.displayCustomParticles = displayCustomParticles; -+ onPropertyChange(); -+ } -+ -+ public static synchronized boolean isDisplayEntityNamesinRange() { -+ return displayEntityNamesinRange; -+ } -+ -+ public static synchronized void setDisplayEntityNamesinRange(boolean var1) { -+ Configuration.displayEntityNamesinRange = var1; -+ onPropertyChange(); -+ } -+ -+ public static synchronized boolean isDisplayAnimalHeatinColor() { -+ return displayAnimalHeatinColor; -+ } -+ -+ public static synchronized void setDisplayAnimalHeatinColor(boolean var1) { -+ Configuration.displayAnimalHeatinColor = var1; -+ onPropertyChange(); -+ } -+ -+ public static synchronized boolean isDisplayPlayerNames3rdPerson() { -+ return displayPlayerNames3rdPerson; -+ } -+ -+ public static synchronized void setDisplayPlayerNames3rdPerson(boolean var1) { -+ Configuration.displayPlayerNames3rdPerson = var1; -+ onPropertyChange(); -+ } -+ -+ public static synchronized boolean isFancyItems() { -+ return fancyItems; -+ } -+ -+ public static synchronized void setFancyItems(boolean var1) { -+ Configuration.fancyItems = var1; -+ onPropertyChange(); -+ } -+} ---- net/minecraft/src/BlockSnowBlock.java -+++ net/minecraft/src/BlockSnowBlock.java -@@ -3,25 +3,33 @@ - import java.util.Random; - - public class BlockSnowBlock extends Block { -- protected BlockSnowBlock(int var1) { -- super(var1, Material.craftedSnow); -+ protected BlockSnowBlock(int par1) { -+ super(par1, Material.craftedSnow); - this.setTickRandomly(true); - this.setCreativeTab(CreativeTabs.tabBlock); - } - -- public int idDropped(int var1, Random var2, int var3) { -+ /** -+ * Returns the ID of the items to drop on destruction. -+ */ -+ public int idDropped(int par1, Random par2Random, int par3) { - return Item.snowball.itemID; - } - -- public int quantityDropped(Random var1) { -+ /** -+ * Returns the quantity of items to drop on block destruction. -+ */ -+ public int quantityDropped(Random par1Random) { - return 4; - } - -- public void updateTick(World var1, int var2, int var3, int var4, Random var5) { -- if(var1.getSavedLightValue(EnumSkyBlock.Block, var2, var3, var4) > 11) { -- this.dropBlockAsItem(var1, var2, var3, var4, var1.getBlockMetadata(var2, var3, var4), 0); -- var1.setBlockToAir(var2, var3, var4); -+ /** -+ * Ticks the block if it's been scheduled -+ */ -+ public void updateTick(World par1World, int par2, int par3, int par4, Random par5Random) { -+ if (par1World.getSavedLightValue(EnumSkyBlock.Block, par2, par3, par4) > 11) { -+ this.dropBlockAsItem(par1World, par2, par3, par4, par1World.getBlockMetadata(par2, par3, par4), 0); -+ par1World.setBlockToAir(par2, par3, par4); - } -- - } - } ---- net/minecraft/src/RecipesTools.java -+++ net/minecraft/src/RecipesTools.java -@@ -1,19 +1,26 @@ - package net.minecraft.src; - - public class RecipesTools { -- private String[][] a = new String[][]{{"XXX", " # ", " # "}, {"X", "#", "#"}, {"XX", "X#", " #"}, {"XX", " #", " #"}}; -- private Object[][] b = new Object[][]{{Block.planks, Block.cobblestone, Item.ingotIron, Item.diamond, Item.ingotGold}, {Item.pickaxeWood, Item.pickaxeStone, Item.pickaxeIron, Item.pickaxeDiamond, Item.pickaxeGold}, {Item.shovelWood, Item.shovelStone, Item.shovelIron, Item.shovelDiamond, Item.shovelGold}, {Item.axeWood, Item.axeStone, Item.axeIron, Item.axeDiamond, Item.axeGold}, {Item.hoeWood, Item.hoeStone, Item.hoeIron, Item.hoeDiamond, Item.hoeGold}}; -- -- public void addRecipes(CraftingManager var1) { -- for(int var2 = 0; var2 < this.b[0].length; ++var2) { -- Object var3 = this.b[0][var2]; -- -- for(int var4 = 0; var4 < this.b.length - 1; ++var4) { -- Item var5 = (Item)this.b[var4 + 1][var2]; -- var1.addRecipe(new ItemStack(var5), new Object[]{this.a[var4], Character.valueOf('#'), Item.stick, Character.valueOf('X'), var3}); -+ private String[][] recipePatterns = new String[][] {{"XXX", " # ", " # "}, {"X", "#", "#"}, {"XX", "X#", " #"}, {"XX", " #", " #"}}; -+ private Object[][] recipeItems; -+ -+ public RecipesTools() { -+ this.recipeItems = new Object[][] {{Block.planks, Block.cobblestone, Item.ingotIron, Item.diamond, Item.ingotGold}, {Item.pickaxeWood, Item.pickaxeStone, Item.pickaxeIron, Item.pickaxeDiamond, Item.pickaxeGold}, {Item.shovelWood, Item.shovelStone, Item.shovelIron, Item.shovelDiamond, Item.shovelGold}, {Item.axeWood, Item.axeStone, Item.axeIron, Item.axeDiamond, Item.axeGold}, {Item.hoeWood, Item.hoeStone, Item.hoeIron, Item.hoeDiamond, Item.hoeGold}}; -+ } -+ -+ /** -+ * Adds the tool recipes to the CraftingManager. -+ */ -+ public void addRecipes(CraftingManager par1CraftingManager) { -+ for (int var2 = 0; var2 < this.recipeItems[0].length; ++var2) { -+ Object var3 = this.recipeItems[0][var2]; -+ -+ for (int var4 = 0; var4 < this.recipeItems.length - 1; ++var4) { -+ Item var5 = (Item)this.recipeItems[var4 + 1][var2]; -+ par1CraftingManager.addRecipe(new ItemStack(var5), new Object[] {this.recipePatterns[var4], '#', Item.stick, 'X', var3}); - } - } - -- var1.addRecipe(new ItemStack(Item.shears), new Object[]{" #", "# ", Character.valueOf('#'), Item.ingotIron}); -+ par1CraftingManager.addRecipe(new ItemStack(Item.shears), new Object[] {" #", "# ", '#', Item.ingotIron}); - } - } ---- net/minecraft/src/BlockStep.java -+++ net/minecraft/src/BlockStep.java -@@ -4,52 +4,74 @@ - import java.util.Random; - - public class BlockStep extends BlockHalfSlab { -- public static final String[] b = new String[]{"stone", "sand", "wood", "cobble", "brick", "smoothStoneBrick", "netherBrick", "quartz"}; -+ -+ /** The list of the types of step blocks. */ -+ public static final String[] blockStepTypes = new String[] {"stone", "sand", "wood", "cobble", "brick", "smoothStoneBrick", "netherBrick", "quartz"}; - private Icon theIcon; - -- public BlockStep(int var1, boolean var2) { -- super(var1, var2, Material.rock); -+ public BlockStep(int par1, boolean par2) { -+ super(par1, par2, Material.rock); - this.setCreativeTab(CreativeTabs.tabBlock); - } - -- public Icon getIcon(int var1, int var2) { -- int var3 = var2 & 7; -- if(this.isDoubleSlab && (var2 & 8) != 0) { -- var1 = 1; -+ /** -+ * From the specified side and block metadata retrieves the blocks texture. Args: side, metadata -+ */ -+ public Icon getIcon(int par1, int par2) { -+ int var3 = par2 & 7; -+ -+ if (this.isDoubleSlab && (par2 & 8) != 0) { -+ par1 = 1; - } - -- return var3 == 0 ? (var1 != 1 && var1 != 0 ? this.theIcon : this.blockIcon) : (var3 == 1 ? Block.sandStone.getBlockTextureFromSide(var1) : (var3 == 2 ? Block.planks.getBlockTextureFromSide(var1) : (var3 == 3 ? Block.cobblestone.getBlockTextureFromSide(var1) : (var3 == 4 ? Block.brick.getBlockTextureFromSide(var1) : (var3 == 5 ? Block.stoneBrick.getIcon(var1, 0) : (var3 == 6 ? Block.netherBrick.getBlockTextureFromSide(1) : (var3 == 7 ? Block.blockNetherQuartz.getBlockTextureFromSide(var1) : this.blockIcon))))))); -- } -- -- public void registerIcons(IconRegister var1) { -- this.blockIcon = var1.registerIcon("stone_slab_top"); -- this.theIcon = var1.registerIcon("stone_slab_side"); -- } -- -- public int idDropped(int var1, Random var2, int var3) { -+ return var3 == 0 ? (par1 != 1 && par1 != 0 ? this.theIcon : this.blockIcon) : (var3 == 1 ? Block.sandStone.getBlockTextureFromSide(par1) : (var3 == 2 ? Block.planks.getBlockTextureFromSide(par1) : (var3 == 3 ? Block.cobblestone.getBlockTextureFromSide(par1) : (var3 == 4 ? Block.brick.getBlockTextureFromSide(par1) : (var3 == 5 ? Block.stoneBrick.getIcon(par1, 0) : (var3 == 6 ? Block.netherBrick.getBlockTextureFromSide(1) : (var3 == 7 ? Block.blockNetherQuartz.getBlockTextureFromSide(par1) : this.blockIcon))))))); -+ } -+ -+ /** -+ * When this method is called, your block should register all the icons it needs with the given IconRegister. This is -+ * the only chance you get to register icons. -+ */ -+ public void registerIcons(IconRegister par1IconRegister) { -+ this.blockIcon = par1IconRegister.registerIcon("stone_slab_top"); -+ this.theIcon = par1IconRegister.registerIcon("stone_slab_side"); -+ } -+ -+ /** -+ * Returns the ID of the items to drop on destruction. -+ */ -+ public int idDropped(int par1, Random par2Random, int par3) { - return Block.stoneSingleSlab.blockID; - } - -- protected ItemStack createStackedBlock(int var1) { -- return new ItemStack(Block.stoneSingleSlab.blockID, 2, var1 & 7); -+ /** -+ * Returns an item stack containing a single instance of the current block type. 'i' is the block's subtype/damage and -+ * is ignored for blocks which do not support subtypes. Blocks which cannot be harvested should return null. -+ */ -+ protected ItemStack createStackedBlock(int par1) { -+ return new ItemStack(Block.stoneSingleSlab.blockID, 2, par1 & 7); - } - -- public String getFullSlabName(int var1) { -- if(var1 < 0 || var1 >= b.length) { -- var1 = 0; -+ /** -+ * Returns the slab block name with step type. -+ */ -+ public String getFullSlabName(int par1) { -+ if (par1 < 0 || par1 >= blockStepTypes.length) { -+ par1 = 0; - } - -- return super.getUnlocalizedName() + "." + b[var1]; -+ return super.getUnlocalizedName() + "." + blockStepTypes[par1]; - } - -- public void getSubBlocks(int var1, CreativeTabs var2, List var3) { -- if(var1 != Block.stoneDoubleSlab.blockID) { -- for(int var4 = 0; var4 <= 7; ++var4) { -- if(var4 != 2) { -- var3.add(new ItemStack(var1, 1, var4)); -+ /** -+ * returns a list of blocks with the same ID, but different meta (eg: wood returns 4 blocks) -+ */ -+ public void getSubBlocks(int par1, CreativeTabs par2CreativeTabs, List par3List) { -+ if (par1 != Block.stoneDoubleSlab.blockID) { -+ for (int var4 = 0; var4 <= 7; ++var4) { -+ if (var4 != 2) { -+ par3List.add(new ItemStack(par1, 1, var4)); - } - } -- - } - } - } ---- net/minecraft/src/Material.java -+++ net/minecraft/src/Material.java -@@ -2,6 +2,8 @@ - - public class Material { - public static final Material air = new MaterialTransparent(MapColor.airColor); -+ -+ /** The material used by BlockGrass. */ - public static final Material grass = new Material(MapColor.grassColor); - public static final Material ground = new Material(MapColor.dirtColor); - public static final Material wood = (new Material(MapColor.woodColor)).setBurning(); -@@ -25,27 +27,62 @@ - public static final Material coral = (new Material(MapColor.foliageColor)).setNoPushMobility(); - public static final Material ice = (new Material(MapColor.iceColor)).setTranslucent().setAdventureModeExempt(); - public static final Material snow = (new MaterialLogic(MapColor.snowColor)).setReplaceable().setTranslucent().setRequiresTool().setNoPushMobility(); -+ -+ /** The material for crafted snow. */ - public static final Material craftedSnow = (new Material(MapColor.snowColor)).setRequiresTool(); - public static final Material cactus = (new Material(MapColor.foliageColor)).setTranslucent().setNoPushMobility(); - public static final Material clay = new Material(MapColor.clayColor); -+ -+ /** pumpkin */ - public static final Material pumpkin = (new Material(MapColor.foliageColor)).setNoPushMobility(); - public static final Material dragonEgg = (new Material(MapColor.foliageColor)).setNoPushMobility(); -+ -+ /** Material used for portals */ - public static final Material portal = (new MaterialPortal(MapColor.airColor)).setImmovableMobility(); -+ -+ /** Cake's material, see BlockCake */ - public static final Material cake = (new Material(MapColor.airColor)).setNoPushMobility(); -+ -+ /** Web's material. */ - public static final Material web = (new MaterialWeb(MapColor.clothColor)).setRequiresTool().setNoPushMobility(); -+ -+ /** Pistons' material. */ - public static final Material piston = (new Material(MapColor.stoneColor)).setImmovableMobility(); -+ -+ /** Bool defining if the block can burn or not. */ - private boolean canBurn; -+ -+ /** -+ * Determines whether blocks with this material can be "overwritten" by other blocks when placed - eg snow, vines and -+ * tall grass. -+ */ - private boolean replaceable; -+ -+ /** Indicates if the material is translucent */ - private boolean isTranslucent; -+ -+ /** The color index used to draw the blocks of this material on maps. */ - public final MapColor materialMapColor; -+ -+ /** -+ * Determines if the material can be harvested without a tool (or with the wrong tool) -+ */ - private boolean requiresNoTool = true; -+ -+ /** -+ * Mobility information flag. 0 indicates that this block is normal, 1 indicates that it can't push other blocks, 2 -+ * indicates that it can't be pushed. -+ */ - private int mobilityFlag; - private boolean isAdventureModeExempt; - -- public Material(MapColor var1) { -- this.materialMapColor = var1; -+ public Material(MapColor par1MapColor) { -+ this.materialMapColor = par1MapColor; - } - -+ /** -+ * Returns if blocks of these materials are liquids. -+ */ - public boolean isLiquid() { - return false; - } -@@ -54,69 +91,115 @@ - return true; - } - -+ /** -+ * Will prevent grass from growing on dirt underneath and kill any grass below it if it returns true -+ */ - public boolean getCanBlockGrass() { - return true; - } - -+ /** -+ * Returns if this material is considered solid or not -+ */ - public boolean blocksMovement() { - return true; - } - -+ /** -+ * Marks the material as translucent -+ */ - private Material setTranslucent() { - this.isTranslucent = true; - return this; - } - -+ /** -+ * Makes blocks with this material require the correct tool to be harvested. -+ */ - protected Material setRequiresTool() { - this.requiresNoTool = false; - return this; - } - -+ /** -+ * Set the canBurn bool to True and return the current object. -+ */ - protected Material setBurning() { - this.canBurn = true; - return this; - } - -+ /** -+ * Returns if the block can burn or not. -+ */ - public boolean getCanBurn() { - return this.canBurn; - } - -+ /** -+ * Sets {@link #replaceable} to true. -+ */ - public Material setReplaceable() { - this.replaceable = true; - return this; - } - -+ /** -+ * Returns whether the material can be replaced by other blocks when placed - eg snow, vines and tall grass. -+ */ - public boolean isReplaceable() { - return this.replaceable; - } - -+ /** -+ * Indicate if the material is opaque -+ */ - public boolean isOpaque() { - return this.isTranslucent ? false : this.blocksMovement(); - } - -+ /** -+ * Returns true if the material can be harvested without a tool (or with the wrong tool) -+ */ - public boolean isToolNotRequired() { - return this.requiresNoTool; - } - -+ /** -+ * Returns the mobility information of the material, 0 = free, 1 = can't push but can move over, 2 = total immobility -+ * and stop pistons. -+ */ - public int getMaterialMobility() { - return this.mobilityFlag; - } - -+ /** -+ * This type of material can't be pushed, but pistons can move over it. -+ */ - protected Material setNoPushMobility() { - this.mobilityFlag = 1; - return this; - } - -+ /** -+ * This type of material can't be pushed, and pistons are blocked to move. -+ */ - protected Material setImmovableMobility() { - this.mobilityFlag = 2; - return this; - } - -+ /** -+ * @see #isAdventureModeExempt() -+ */ - protected Material setAdventureModeExempt() { - this.isAdventureModeExempt = true; - return this; - } - -+ /** -+ * Returns true if blocks with this material can always be mined in adventure mode. -+ */ - public boolean isAdventureModeExempt() { - return this.isAdventureModeExempt; - } ---- net/minecraft/src/SoundPoolEntry.java -+++ net/minecraft/src/SoundPoolEntry.java -@@ -3,19 +3,21 @@ - import java.net.URL; - - public class SoundPoolEntry { -- private final String a; -- private final URL b; -+ // Spout Start -+ public String soundName; -+ public URL soundUrl; -+ // Spout End - -- public SoundPoolEntry(String var1, URL var2) { -- this.a = var1; -- this.b = var2; -+ public SoundPoolEntry(String par1Str, URL par2URL) { -+ this.soundName = par1Str; -+ this.soundUrl = par2URL; - } - - public String getSoundName() { -- return this.a; -+ return this.soundName; - } - - public URL getSoundUrl() { -- return this.b; -+ return this.soundUrl; - } - } ---- /dev/null -+++ org/spoutcraft/client/gui/CustomScreen.java -@@ -1,0 +1,62 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.client.gui; -+ -+import net.minecraft.src.GuiScreen; -+import net.minecraft.src.Minecraft; -+ -+import org.spoutcraft.api.gui.GenericGradient; -+import org.spoutcraft.api.gui.PopupScreen; -+import org.spoutcraft.client.SpoutClient; -+ -+public class CustomScreen extends GuiScreen { -+ public CustomScreen(PopupScreen screen) { -+ update(screen); -+ this.setWorldAndResolution(SpoutClient.getHandle(), (int) screen.getWidth(), (int) screen.getHeight()); -+ this.allowUserInput = true; -+ } -+ -+ @Override -+ public void setWorldAndResolution(Minecraft var1, int var2, int var3) { -+ //ToDo: broken -+ //this.guiParticles = new GuiParticle(var1); -+ this.mc = var1; -+ this.fontRenderer = var1.fontRenderer; -+ this.width = var2; -+ this.height = var3; -+ bg = (GenericGradient) new GenericGradient().setHeight(this.height).setWidth(this.width); -+ this.initGui(); -+ } -+ -+ public void drawScreen(int x, int y, float z) { -+ if (screen instanceof PopupScreen) { -+ if (!((PopupScreen)screen).isTransparent()) { -+ this.drawDefaultBackground(); -+ } -+ } -+ bg.setVisible(screen.isBgVisible()); -+ drawWidgets(x, y, z); -+ } -+ -+ @Override -+ public boolean doesGuiPauseGame() { -+ return ((PopupScreen) getScreen()).isPausingGame(); -+ } -+} ---- /dev/null -+++ org/spoutcraft/client/gui/controls/ControlsCheckBox.java -@@ -1,0 +1,37 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.client.gui.controls; -+ -+import org.spoutcraft.api.gui.GenericCheckBox; -+ -+public class ControlsCheckBox extends GenericCheckBox { -+ private GuiControls gui; -+ -+ public ControlsCheckBox(GuiControls gui, String text) { -+ this.gui = gui; -+ setText(text); -+ setChecked(true); -+ } -+ -+ @Override -+ public void onButtonClick() { -+ gui.getModel().refresh(); -+ } -+} ---- net/minecraft/src/ScreenShotHelper.java -+++ net/minecraft/src/ScreenShotHelper.java -@@ -2,64 +2,128 @@ - - import java.awt.image.BufferedImage; - import java.io.File; --import java.nio.IntBuffer; -+import java.nio.ByteBuffer; - import java.text.DateFormat; - import java.text.SimpleDateFormat; - import java.util.Date; - import javax.imageio.ImageIO; -+ - import org.lwjgl.BufferUtils; - import org.lwjgl.opengl.GL11; --import org.lwjgl.opengl.GL12; -+ -+//Spout Start - Unused import -+//import java.nio.IntBuffer; -+//Spout End -+// Spout Start -+//import org.lwjgl.opengl.GL12; // Unused import -+// Spout End - - public class ScreenShotHelper { -- private static final DateFormat a = new SimpleDateFormat("yyyy-MM-dd_HH.mm.ss"); -- private static IntBuffer b; -+ private static final DateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd_HH.mm.ss"); -+ // Spout Start - Moved to local variables -+ /* -+ private static IntBuffer field_74293_b; - private static int[] field_74294_c; -+ */ -+ // Spout End - -- public static String saveScreenshot(File var0, int var1, int var2) { -- return func_74292_a(var0, (String)null, var1, var2); -+ /** -+ * Takes a screenshot and saves it to the screenshots directory. Returns the filename of the screenshot. -+ */ -+ public static String saveScreenshot(File par0File, int par1, int par2) { -+ return saveScreenshot(par0File, (String)null, par1, par2); - } - -- public static String func_74292_a(File var0, String var1, int var2, int var3) { -+ // Spout Start - Method renamed from func_74292_a to saveScreenshot -+ public static String saveScreenshot(File file, String imageFileName, int screenWidth, int screenHeight) { -+ ByteBuffer buffer = BufferUtils.createByteBuffer(screenWidth * screenHeight * 3); -+ byte[] pixelData = new byte[screenWidth * screenHeight * 3]; -+ int[] imageData = new int[screenWidth * screenHeight]; - try { -- File var4 = new File(var0, "screenshots"); -- var4.mkdir(); -- int var5 = var2 * var3; -- if(b == null || b.capacity() < var5) { -- b = BufferUtils.createIntBuffer(var5); -- field_74294_c = new int[var5]; -- } -- -+ // Spout Start - Renamed from file1 -+ File screenshotsDir = new File(file, "screenshots"); -+ screenshotsDir.mkdir(); -+ // Just intialise it up there! -+ /*if (buffer == null || buffer.capacity() < i * j) { -+ buffer = BufferUtils.createByteBuffer(i * j * 3); -+ } -+ if (imageData == null || imageData.length < i * j * 3) { -+ pixelData = new byte[i * j * 3]; -+ imageData = new int[i * j]; -+ }*/ -+ // Use constants instead of magic numbers - GL11.glPixelStorei(GL11.GL_PACK_ALIGNMENT, 1); - GL11.glPixelStorei(GL11.GL_UNPACK_ALIGNMENT, 1); -- b.clear(); -- GL11.glReadPixels(0, 0, var2, var3, GL12.GL_BGRA, GL12.GL_UNSIGNED_INT_8_8_8_8_REV, (IntBuffer)b); -- b.get(field_74294_c); -- func_74289_a(field_74294_c, var2, var3); -- BufferedImage var6 = new BufferedImage(var2, var3, 1); -- var6.setRGB(0, 0, var2, var3, field_74294_c, 0, var2); -- File var7; -- if(var1 == null) { -- var7 = func_74290_a(var4); -+ buffer.clear(); -+ GL11.glReadPixels(0, 0, screenWidth, screenHeight, GL11.GL_RGB, GL11.GL_UNSIGNED_BYTE, buffer); -+ // Spout End -+ buffer.clear(); -+ String s1 = (new StringBuilder()).append("").append(dateFormat.format(new Date())).toString(); -+ File file2; -+ if (imageFileName == null) { -+ for (int k = 1; (file2 = new File(screenshotsDir, (new StringBuilder()).append(s1).append(k != 1 ? (new StringBuilder()).append("_").append(k).toString() : "").append(".png").toString())).exists(); k++) { -+ } - } else { -- var7 = new File(var4, var1); -- } -- -- ImageIO.write(var6, "png", var7); -- return "Saved screenshot as " + var7.getName(); -- } catch (Exception var8) { -- var8.printStackTrace(); -- return "Failed to save: " + var8; -- } -- } -- -- private static File func_74290_a(File var0) { -- String var2 = a.format(new Date()).toString(); -+ file2 = new File(screenshotsDir, imageFileName); -+ } -+ buffer.get(pixelData); -+ for (int l = 0; l < screenWidth; l++) { -+ for (int i1 = 0; i1 < screenHeight; i1++) { -+ int j1 = l + (screenHeight - i1 - 1) * screenWidth; -+ int k1 = pixelData[j1 * 3 + 0] & 0xff; -+ int l1 = pixelData[j1 * 3 + 1] & 0xff; -+ int i2 = pixelData[j1 * 3 + 2] & 0xff; -+ int j2 = 0xff000000 | k1 << 16 | l1 << 8 | i2; -+ imageData[l + i1 * screenWidth] = j2; -+ } -+ -+ } -+ -+ BufferedImage bufferedimage = new BufferedImage(screenWidth, screenHeight, 1); -+ bufferedimage.setRGB(0, 0, screenWidth, screenHeight, imageData, 0, screenWidth); -+ ImageIO.write(bufferedimage, "png", file2); -+ return (new StringBuilder()).append("Saved screenshot as ").append(file2.getName()).toString(); -+ } catch (Exception exception) { -+ exception.printStackTrace(); -+ return (new StringBuilder()).append("Failed to save: ").append(exception).toString(); -+ } -+ } -+ -+ // Spout Start - New method -+ public static BufferedImage getScreenshot(int screenWidth, int screenHeight) { -+ ByteBuffer buffer = BufferUtils.createByteBuffer(screenWidth * screenHeight * 3); -+ byte[] pixelData = new byte[screenWidth * screenHeight * 3]; -+ int[] imageData = new int[screenWidth * screenHeight]; -+ GL11.glPixelStorei(GL11.GL_PACK_ALIGNMENT, 1); -+ GL11.glPixelStorei(GL11.GL_UNPACK_ALIGNMENT, 1); -+ buffer.clear(); -+ GL11.glReadPixels(0, 0, screenWidth, screenHeight, GL11.GL_RGB, GL11.GL_UNSIGNED_BYTE, buffer); -+ buffer.clear(); -+ buffer.get(pixelData); -+ for (int l = 0; l < screenWidth; l++) { -+ for (int i1 = 0; i1 < screenHeight; i1++) { -+ int j1 = l + (screenHeight - i1 - 1) * screenWidth; -+ int k1 = pixelData[j1 * 3 + 0] & 0xff; -+ int l1 = pixelData[j1 * 3 + 1] & 0xff; -+ int i2 = pixelData[j1 * 3 + 2] & 0xff; -+ int j2 = 0xff000000 | k1 << 16 | l1 << 8 | i2; -+ imageData[l + i1 * screenWidth] = j2; -+ } -+ } -+ BufferedImage bufferedimage = new BufferedImage(screenWidth, screenHeight, 1); -+ bufferedimage.setRGB(0, 0, screenWidth, screenHeight, imageData, 0, screenWidth); -+ return bufferedimage; -+ } -+ // Spout End -+ -+ private static File func_74290_a(File par0File) { -+ String var2 = dateFormat.format(new Date()).toString(); - int var3 = 1; - -- while(true) { -- File var1 = new File(var0, var2 + (var3 == 1 ? "" : "_" + var3) + ".png"); -- if(!var1.exists()) { -+ while (true) { -+ File var1 = new File(par0File, var2 + (var3 == 1 ? "" : "_" + var3) + ".png"); -+ -+ if (!var1.exists()) { - return var1; - } - -@@ -67,15 +131,40 @@ - } - } - -- private static void func_74289_a(int[] var0, int var1, int var2) { -- int[] var3 = new int[var1]; -- int var4 = var2 / 2; -- -- for(int var5 = 0; var5 < var4; ++var5) { -- System.arraycopy(var0, var5 * var1, var3, 0, var1); -- System.arraycopy(var0, (var2 - 1 - var5) * var1, var0, var5 * var1, var1); -- System.arraycopy(var3, 0, var0, (var2 - 1 - var5) * var1, var1); -- } -- -- } -+ private static void func_74289_a(int[] par0ArrayOfInteger, int par1, int par2) { -+ int[] var3 = new int[par1]; -+ int var4 = par2 / 2; -+ -+ for (int var5 = 0; var5 < var4; ++var5) { -+ System.arraycopy(par0ArrayOfInteger, var5 * par1, var3, 0, par1); -+ System.arraycopy(par0ArrayOfInteger, (par2 - 1 - var5) * par1, par0ArrayOfInteger, var5 * par1, par1); -+ System.arraycopy(var3, 0, par0ArrayOfInteger, (par2 - 1 - var5) * par1, par1); -+ } -+ } -+ -+ // Spout Start -+ public static BufferedImage getScreenshot(int texture, int screenWidth, int screenHeight) { -+ ByteBuffer buffer = BufferUtils.createByteBuffer(screenWidth * screenHeight * 3); -+ byte[] pixelData = new byte[screenWidth * screenHeight * 3]; -+ int[] imageData = new int[screenWidth * screenHeight]; -+ buffer.clear(); -+ GL11.glBindTexture(GL11.GL_TEXTURE_2D, texture); -+ GL11.glGetTexImage(GL11.GL_TEXTURE_2D, 0, GL11.GL_RGB, GL11.GL_UNSIGNED_BYTE, buffer); -+ buffer.clear(); -+ buffer.get(pixelData); -+ for (int l = 0; l < screenWidth; l++) { -+ for (int i1 = 0; i1 < screenHeight; i1++) { -+ int j1 = l + (screenHeight - i1 - 1) * screenWidth; -+ int k1 = pixelData[j1 * 3 + 0] & 0xff; -+ int l1 = pixelData[j1 * 3 + 1] & 0xff; -+ int i2 = pixelData[j1 * 3 + 2] & 0xff; -+ int j2 = 0xff000000 | k1 << 16 | l1 << 8 | i2; -+ imageData[l + i1 * screenWidth] = j2; -+ } -+ } -+ BufferedImage bufferedimage = new BufferedImage(screenWidth, screenHeight, 1); -+ bufferedimage.setRGB(0, 0, screenWidth, screenHeight, imageData, 0, screenWidth); -+ return bufferedimage; -+ } -+ // Spout End - } ---- net/minecraft/src/BiomeGenHell.java -+++ net/minecraft/src/BiomeGenHell.java -@@ -1,14 +1,14 @@ - package net.minecraft.src; - - public class BiomeGenHell extends BiomeGenBase { -- public BiomeGenHell(int var1) { -- super(var1); -- this.J.clear(); -- this.K.clear(); -- this.L.clear(); -- this.M.clear(); -- this.J.add(new SpawnListEntry(EntityGhast.class, 50, 4, 4)); -- this.J.add(new SpawnListEntry(EntityPigZombie.class, 100, 4, 4)); -- this.J.add(new SpawnListEntry(EntityMagmaCube.class, 1, 4, 4)); -+ public BiomeGenHell(int par1) { -+ super(par1); -+ this.spawnableMonsterList.clear(); -+ this.spawnableCreatureList.clear(); -+ this.spawnableWaterCreatureList.clear(); -+ this.spawnableCaveCreatureList.clear(); -+ this.spawnableMonsterList.add(new SpawnListEntry(EntityGhast.class, 50, 4, 4)); -+ this.spawnableMonsterList.add(new SpawnListEntry(EntityPigZombie.class, 100, 4, 4)); -+ this.spawnableMonsterList.add(new SpawnListEntry(EntityMagmaCube.class, 1, 4, 4)); - } - } ---- net/minecraft/src/IChunkProvider.java -+++ net/minecraft/src/IChunkProvider.java -@@ -3,29 +3,66 @@ - import java.util.List; - - public interface IChunkProvider { -+ -+ /** -+ * Checks to see if a chunk exists at x, y -+ */ - boolean chunkExists(int var1, int var2); - -+ /** -+ * Will return back a chunk, if it doesn't exist and its not a MP client it will generates all the blocks for the -+ * specified chunk from the map seed and chunk seed -+ */ - Chunk provideChunk(int var1, int var2); - -+ /** -+ * loads or generates the chunk at the chunk location specified -+ */ - Chunk loadChunk(int var1, int var2); - -+ /** -+ * Populates chunk with ores etc etc -+ */ - void populate(IChunkProvider var1, int var2, int var3); - -+ /** -+ * Two modes of operation: if passed true, save all Chunks in one go. If passed false, save up to two chunks. Return -+ * true if all chunks have been saved. -+ */ - boolean saveChunks(boolean var1, IProgressUpdate var2); - -+ /** -+ * Unloads chunks that are marked to be unloaded. This is not guaranteed to unload every such chunk. -+ */ - boolean unloadQueuedChunks(); - -+ /** -+ * Returns if the IChunkProvider supports saving. -+ */ - boolean canSave(); - -+ /** -+ * Converts the instance data to a readable string. -+ */ - String makeString(); - -+ /** -+ * Returns a list of creatures of the specified type that can spawn at the given location. -+ */ - List getPossibleCreatures(EnumCreatureType var1, int var2, int var3, int var4); - -+ /** -+ * Returns the location of the closest structure of the specified type. If not found returns null. -+ */ - ChunkPosition findClosestStructure(World var1, String var2, int var3, int var4, int var5); - - int getLoadedChunkCount(); - - void recreateStructures(int var1, int var2); - -+ /** -+ * Save extra data not associated with any Chunk. Not saved during autosave, only during world unload. Currently -+ * unimplemented. -+ */ - void saveExtraData(); - } ---- net/minecraft/src/MainProxyAuthenticator.java -+++ net/minecraft/src/MainProxyAuthenticator.java -@@ -4,15 +4,16 @@ - import java.net.PasswordAuthentication; - - public final class MainProxyAuthenticator extends Authenticator { -- final String a; -- final String b; -- -- public MainProxyAuthenticator(String var1, String var2) { -- this.a = var1; -- this.b = var2; -+ final String field_111237_a; -+ -+ final String field_111236_b; -+ -+ public MainProxyAuthenticator(String par1Str, String par2Str) { -+ this.field_111237_a = par1Str; -+ this.field_111236_b = par2Str; - } - - protected PasswordAuthentication getPasswordAuthentication() { -- return new PasswordAuthentication(this.a, this.b.toCharArray()); -+ return new PasswordAuthentication(this.field_111237_a, this.field_111236_b.toCharArray()); - } - } ---- net/minecraft/src/LongHashMap.java -+++ net/minecraft/src/LongHashMap.java -@@ -1,50 +1,76 @@ - package net.minecraft.src; - - public class LongHashMap { -+ -+ /** the array of all elements in the hash */ - private transient LongHashMapEntry[] hashArray = new LongHashMapEntry[16]; -+ -+ /** the number of elements in the hash array */ - private transient int numHashElements; -+ -+ /** -+ * the maximum amount of elements in the hash (probably 3/4 the size due to meh hashing function) -+ */ - private int capacity = 12; -- private final float percentUseable = 12.0F / 16.0F; -+ -+ /** -+ * percent of the hasharray that can be used without hash colliding probably -+ */ -+ private final float percentUseable = 0.75F; -+ -+ /** count of times elements have been added/removed */ - private transient volatile int modCount; - -- private static int getHashedKey(long var0) { -- return hash((int)(var0 ^ var0 >>> 32)); -- } -- -- private static int hash(int var0) { -- var0 ^= var0 >>> 20 ^ var0 >>> 12; -- return var0 ^ var0 >>> 7 ^ var0 >>> 4; -- } -- -- private static int getHashIndex(int var0, int var1) { -- return var0 & var1 - 1; -+ /** -+ * returns the hashed key given the original key -+ */ -+ private static int getHashedKey(long par0) { -+ return hash((int)(par0 ^ par0 >>> 32)); -+ } -+ -+ /** -+ * the hash function -+ */ -+ private static int hash(int par0) { -+ par0 ^= par0 >>> 20 ^ par0 >>> 12; -+ return par0 ^ par0 >>> 7 ^ par0 >>> 4; -+ } -+ -+ /** -+ * gets the index in the hash given the array length and the hashed key -+ */ -+ private static int getHashIndex(int par0, int par1) { -+ return par0 & par1 - 1; - } - - public int getNumHashElements() { - return this.numHashElements; - } - -- public Object getValueByKey(long var1) { -- int var3 = getHashedKey(var1); -+ /** -+ * get the value from the map given the key -+ */ -+ public Object getValueByKey(long par1) { -+ int var3 = getHashedKey(par1); - -- for(LongHashMapEntry var4 = this.hashArray[getHashIndex(var3, this.hashArray.length)]; var4 != null; var4 = var4.nextEntry) { -- if(var4.key == var1) { -- return var4.b; -+ for (LongHashMapEntry var4 = this.hashArray[getHashIndex(var3, this.hashArray.length)]; var4 != null; var4 = var4.nextEntry) { -+ if (var4.key == par1) { -+ return var4.value; - } - } - - return null; - } - -- public boolean containsItem(long var1) { -- return this.getEntry(var1) != null; -+ public boolean containsItem(long par1) { -+ return this.getEntry(par1) != null; - } - -- final LongHashMapEntry getEntry(long var1) { -- int var3 = getHashedKey(var1); -+ final LongHashMapEntry getEntry(long par1) { -+ int var3 = getHashedKey(par1); - -- for(LongHashMapEntry var4 = this.hashArray[getHashIndex(var3, this.hashArray.length)]; var4 != null; var4 = var4.nextEntry) { -- if(var4.key == var1) { -+ for (LongHashMapEntry var4 = this.hashArray[getHashIndex(var3, this.hashArray.length)]; var4 != null; var4 = var4.nextEntry) { -+ if (var4.key == par1) { - return var4; - } - } -@@ -52,74 +78,92 @@ - return null; - } - -- public void add(long var1, Object var3) { -- int var4 = getHashedKey(var1); -+ /** -+ * Add a key-value pair. -+ */ -+ public void add(long par1, Object par3Obj) { -+ int var4 = getHashedKey(par1); - int var5 = getHashIndex(var4, this.hashArray.length); - -- for(LongHashMapEntry var6 = this.hashArray[var5]; var6 != null; var6 = var6.nextEntry) { -- if(var6.key == var1) { -- var6.b = var3; -+ for (LongHashMapEntry var6 = this.hashArray[var5]; var6 != null; var6 = var6.nextEntry) { -+ if (var6.key == par1) { -+ var6.value = par3Obj; - return; - } - } - - ++this.modCount; -- this.createKey(var4, var1, var3, var5); -+ this.createKey(var4, par1, par3Obj, var5); - } - -- private void resizeTable(int var1) { -+ /** -+ * resizes the table -+ */ -+ private void resizeTable(int par1) { - LongHashMapEntry[] var2 = this.hashArray; - int var3 = var2.length; -- if(var3 == 1073741824) { -+ -+ if (var3 == 1073741824) { - this.capacity = Integer.MAX_VALUE; - } else { -- LongHashMapEntry[] var4 = new LongHashMapEntry[var1]; -+ LongHashMapEntry[] var4 = new LongHashMapEntry[par1]; - this.copyHashTableTo(var4); - this.hashArray = var4; -- this.capacity = (int)((float)var1 * this.percentUseable); -+ this.capacity = (int)((float)par1 * this.percentUseable); - } - } - -- private void copyHashTableTo(LongHashMapEntry[] var1) { -+ /** -+ * copies the hash table to the specified array -+ */ -+ private void copyHashTableTo(LongHashMapEntry[] par1ArrayOfLongHashMapEntry) { - LongHashMapEntry[] var2 = this.hashArray; -- int var3 = var1.length; -+ int var3 = par1ArrayOfLongHashMapEntry.length; - -- for(int var4 = 0; var4 < var2.length; ++var4) { -+ for (int var4 = 0; var4 < var2.length; ++var4) { - LongHashMapEntry var5 = var2[var4]; -- if(var5 != null) { -+ -+ if (var5 != null) { - var2[var4] = null; -- - LongHashMapEntry var6; -+ - do { - var6 = var5.nextEntry; - int var7 = getHashIndex(var5.hash, var3); -- var5.nextEntry = var1[var7]; -- var1[var7] = var5; -+ var5.nextEntry = par1ArrayOfLongHashMapEntry[var7]; -+ par1ArrayOfLongHashMapEntry[var7] = var5; - var5 = var6; -- } while(var6 != null); -+ } while (var6 != null); - } - } -- -- } -- -- public Object remove(long var1) { -- LongHashMapEntry var3 = this.removeKey(var1); -- return var3 == null ? null : var3.b; -- } -- -- final LongHashMapEntry removeKey(long var1) { -- int var3 = getHashedKey(var1); -+ } -+ -+ /** -+ * calls the removeKey method and returns removed object -+ */ -+ public Object remove(long par1) { -+ LongHashMapEntry var3 = this.removeKey(par1); -+ return var3 == null ? null : var3.value; -+ } -+ -+ /** -+ * removes the key from the hash linked list -+ */ -+ final LongHashMapEntry removeKey(long par1) { -+ int var3 = getHashedKey(par1); - int var4 = getHashIndex(var3, this.hashArray.length); - LongHashMapEntry var5 = this.hashArray[var4]; -- - LongHashMapEntry var6; - LongHashMapEntry var7; -- for(var6 = var5; var6 != null; var6 = var7) { -+ -+ for (var6 = var5; var6 != null; var6 = var7) { - var7 = var6.nextEntry; -- if(var6.key == var1) { -+ -+ if (var6.key == par1) { - ++this.modCount; - --this.numHashElements; -- if(var5 == var6) { -+ -+ if (var5 == var6) { - this.hashArray[var4] = var7; - } else { - var5.nextEntry = var7; -@@ -134,16 +178,22 @@ - return var6; - } - -- private void createKey(int var1, long var2, Object var4, int var5) { -- LongHashMapEntry var6 = this.hashArray[var5]; -- this.hashArray[var5] = new LongHashMapEntry(var1, var2, var4, var6); -- if(this.numHashElements++ >= this.capacity) { -+ /** -+ * creates the key in the hash table -+ */ -+ private void createKey(int par1, long par2, Object par4Obj, int par5) { -+ LongHashMapEntry var6 = this.hashArray[par5]; -+ this.hashArray[par5] = new LongHashMapEntry(par1, par2, par4Obj, var6); -+ -+ if (this.numHashElements++ >= this.capacity) { - this.resizeTable(2 * this.hashArray.length); - } -- - } - -- static int getHashCode(long var0) { -- return getHashedKey(var0); -+ /** -+ * public method to get the hashed key(hashCode) -+ */ -+ static int getHashCode(long par0) { -+ return getHashedKey(par0); - } - } ---- /dev/null -+++ org/spoutcraft/client/packet/PacketFullVersion.java -@@ -1,0 +1,57 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.client.packet; -+ -+import java.io.IOException; -+ -+import org.spoutcraft.api.io.SpoutInputStream; -+import org.spoutcraft.api.io.SpoutOutputStream; -+ -+public class PacketFullVersion implements SpoutPacket { -+ private String version; -+ -+ public PacketFullVersion() { -+ } -+ -+ public PacketFullVersion(String versionString) { -+ version = versionString; -+ } -+ -+ public void readData(SpoutInputStream input) throws IOException { -+ } -+ -+ public void writeData(SpoutOutputStream output) throws IOException { -+ output.writeString(version); -+ } -+ -+ public void run(int playerId) { -+ } -+ -+ public void failure(int playerId) { -+ } -+ -+ public PacketType getPacketType() { -+ return PacketType.PacketFullVersion; -+ } -+ -+ public int getVersion() { -+ return 0; -+ } -+} ---- /dev/null -+++ org/spoutcraft/client/ChunkComparator.java -@@ -1,0 +1,41 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.client; -+ -+import java.util.Comparator; -+ -+import net.minecraft.src.Minecraft; -+import net.minecraft.src.Chunk; -+import net.minecraft.src.MathHelper; -+ -+public class ChunkComparator implements Comparator{ -+ private int playerX = MathHelper.floor_double(Minecraft.getMinecraft().thePlayer.posX / 16.0D); -+ private int playerZ = MathHelper.floor_double(Minecraft.getMinecraft().thePlayer.posZ / 16.0D); -+ -+ @Override -+ public int compare(Chunk o1, Chunk o2) { -+ int x1 = (o1.xPosition - playerX) * (o1.xPosition - playerX); -+ int z1 = (o1.zPosition - playerZ) * (o1.zPosition - playerZ); -+ -+ int x2 = (o2.xPosition - playerX) * (o2.xPosition - playerX); -+ int z2 = (o2.zPosition - playerZ) * (o2.zPosition - playerZ); -+ return (x2 + z2) - (x1 + z1); -+ } -+} ---- /dev/null -+++ org/spoutcraft/client/gui/settings/GuiAdvancedOptions.java -@@ -1,0 +1,655 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.client.gui.settings; -+ -+import java.util.ArrayList; -+import java.util.UUID; -+ -+import net.minecraft.src.Minecraft; -+import net.minecraft.src.GuiScreen; -+ -+import org.spoutcraft.api.Spoutcraft; -+import org.spoutcraft.api.gui.Button; -+import org.spoutcraft.api.gui.CheckBox; -+import org.spoutcraft.api.gui.Color; -+import org.spoutcraft.api.gui.Control; -+import org.spoutcraft.api.gui.GenericButton; -+import org.spoutcraft.api.gui.GenericCheckBox; -+import org.spoutcraft.api.gui.GenericGradient; -+import org.spoutcraft.api.gui.GenericLabel; -+import org.spoutcraft.api.gui.GenericScrollArea; -+import org.spoutcraft.api.gui.Gradient; -+import org.spoutcraft.api.gui.Label; -+import org.spoutcraft.api.gui.Orientation; -+import org.spoutcraft.api.gui.RadioButton; -+import org.spoutcraft.api.gui.RenderPriority; -+import org.spoutcraft.api.gui.WidgetAnchor; -+import org.spoutcraft.client.SpoutClient; -+import org.spoutcraft.client.config.Configuration; -+import org.spoutcraft.client.gui.settings.controls.AdvancedOpenGLButton; -+import org.spoutcraft.client.gui.settings.controls.AmbientOcclusionButton; -+import org.spoutcraft.client.gui.settings.controls.Anaglyph3DButton; -+import org.spoutcraft.client.gui.settings.controls.AntiAliasingButton; -+import org.spoutcraft.client.gui.settings.controls.AutosaveButton; -+import org.spoutcraft.client.gui.settings.controls.BetterGrassButton; -+import org.spoutcraft.client.gui.settings.controls.BiomeColorsButton; -+import org.spoutcraft.client.gui.settings.controls.BrightnessSlider; -+import org.spoutcraft.client.gui.settings.controls.ChatButton; -+import org.spoutcraft.client.gui.settings.controls.ChatColorAssistButton; -+import org.spoutcraft.client.gui.settings.controls.ChunkRenderSpeed; -+import org.spoutcraft.client.gui.settings.controls.ClearWaterToggleButton; -+import org.spoutcraft.client.gui.settings.controls.ConnectedTexturesButton; -+import org.spoutcraft.client.gui.settings.controls.ControlsButton; -+import org.spoutcraft.client.gui.settings.controls.DelayedTooltipCheckbox; -+import org.spoutcraft.client.gui.settings.controls.DifficultyButton; -+import org.spoutcraft.client.gui.settings.controls.DisplayAnimalHeatinColorButton; -+import org.spoutcraft.client.gui.settings.controls.DisplayCustomParticlesButton; -+import org.spoutcraft.client.gui.settings.controls.DisplayPlayerNames3rdPersonButton; -+import org.spoutcraft.client.gui.settings.controls.DisplayEntityNamesinRangeButton; -+import org.spoutcraft.client.gui.settings.controls.FancyCloudsButton; -+import org.spoutcraft.client.gui.settings.controls.FancyFogButton; -+import org.spoutcraft.client.gui.settings.controls.FancyGraphicsButton; -+import org.spoutcraft.client.gui.settings.controls.FancyGrassButton; -+import org.spoutcraft.client.gui.settings.controls.FancyItemsButton; -+import org.spoutcraft.client.gui.settings.controls.FancyLightingButton; -+import org.spoutcraft.client.gui.settings.controls.FancyParticlesButton; -+import org.spoutcraft.client.gui.settings.controls.FancyTreesButton; -+import org.spoutcraft.client.gui.settings.controls.FancyWaterButton; -+import org.spoutcraft.client.gui.settings.controls.FancyWeatherButton; -+import org.spoutcraft.client.gui.settings.controls.FarViewButton; -+import org.spoutcraft.client.gui.settings.controls.FastDebugInfoButton; -+import org.spoutcraft.client.gui.settings.controls.FavorAppearanceButton; -+import org.spoutcraft.client.gui.settings.controls.FavorPerformanceButton; -+import org.spoutcraft.client.gui.settings.controls.FieldOfViewSlider; -+import org.spoutcraft.client.gui.settings.controls.FlightSpeedSlider; -+import org.spoutcraft.client.gui.settings.controls.GuiScaleButton; -+import org.spoutcraft.client.gui.settings.controls.HotbarQuickKeysButton; -+import org.spoutcraft.client.gui.settings.controls.HotbarTextButton; -+import org.spoutcraft.client.gui.settings.controls.InvertMouseButton; -+import org.spoutcraft.client.gui.settings.controls.LanguagesButton; -+import org.spoutcraft.client.gui.settings.controls.ManualSelectionButton; -+import org.spoutcraft.client.gui.settings.controls.MinimapButton; -+import org.spoutcraft.client.gui.settings.controls.MipMapSlider; -+import org.spoutcraft.client.gui.settings.controls.MusicSlider; -+import org.spoutcraft.client.gui.settings.controls.OptimalGameplayButton; -+import org.spoutcraft.client.gui.settings.controls.OptimizedLightingUpdatesButton; -+import org.spoutcraft.client.gui.settings.controls.PerformanceButton; -+import org.spoutcraft.client.gui.settings.controls.RandomMobTextureButton; -+import org.spoutcraft.client.gui.settings.controls.RenderDistanceButton; -+import org.spoutcraft.client.gui.settings.controls.ReplaceBlocksButton; -+import org.spoutcraft.client.gui.settings.controls.ReplaceToolsButton; -+import org.spoutcraft.client.gui.settings.controls.ResetButton; -+import org.spoutcraft.client.gui.settings.controls.SensitivitySlider; -+import org.spoutcraft.client.gui.settings.controls.ServerLightButton; -+import org.spoutcraft.client.gui.settings.controls.ServerTexturesButton; -+import org.spoutcraft.client.gui.settings.controls.SignDistanceButton; -+import org.spoutcraft.client.gui.settings.controls.SkyToggleButton; -+import org.spoutcraft.client.gui.settings.controls.SmoothFPSButton; -+import org.spoutcraft.client.gui.settings.controls.SmoothLightingSlider; -+import org.spoutcraft.client.gui.settings.controls.SnooperButton; -+import org.spoutcraft.client.gui.settings.controls.SoundEffectsSlider; -+import org.spoutcraft.client.gui.settings.controls.StarsToggleButton; -+import org.spoutcraft.client.gui.settings.controls.TexturesButton; -+import org.spoutcraft.client.gui.settings.controls.TimeButton; -+import org.spoutcraft.client.gui.settings.controls.ViewBobbingButton; -+import org.spoutcraft.client.gui.settings.controls.VoidFogButton; -+import org.spoutcraft.client.gui.settings.controls.WaterBiomeColorsButton; -+import org.spoutcraft.client.gui.settings.controls.WeatherToggleButton; -+ -+public class GuiAdvancedOptions extends GuiScreen { -+ private Button doneButton = null; -+ private CheckBox switchToSimpleCheck; -+ public final GuiScreen parent; -+ private GenericScrollArea scrollArea; -+ -+ public GuiAdvancedOptions(GuiScreen parent) { -+ this.parent = parent; -+ } -+ -+ public void setWorldAndResolution(Minecraft mc, int width, int height) { -+ int scroll = scrollArea == null ? 0 : scrollArea.getScrollPosition(Orientation.VERTICAL); -+ super.setWorldAndResolution(mc, width, height); -+ scrollArea.setScrollPosition(Orientation.VERTICAL, scroll); -+ } -+ -+ public void initGui() { -+ Control control; -+ -+ GenericScrollArea screen = new GenericScrollArea(); -+ scrollArea = screen; -+ screen.setHeight(height - 24 - 30).setWidth(width).setY(24).setX(0); -+ getScreen().attachWidget("Spoutcraft", screen); -+ -+ GenericLabel label = new GenericLabel("Game Settings"); -+ int size = Spoutcraft.getMinecraftFont().getTextWidth(label.getText()); -+ label.setX((int) (width / 2 - size / 2)).setY(10); -+ label.setFixed(true).setPriority(RenderPriority.Lowest); -+ getScreen().attachWidget("Spoutcraft", label); -+ -+ int left = (int)(width / 2 - 155); -+ int right = (int)(width / 2 + 5); -+ int center = (int)(width / 2 - 75); -+ -+ control = new ResetButton(parent).setAlign(WidgetAnchor.TOP_CENTER); -+ control.setWidth(150).setHeight(20).setX(left).setY(height - 25); -+ getScreen().attachWidget("Spoutcraft", control); -+ -+ switchToSimpleCheck = new GenericCheckBox("Advanced"); -+ switchToSimpleCheck.setChecked(true); -+ switchToSimpleCheck.setAlign(WidgetAnchor.CENTER_CENTER); -+ switchToSimpleCheck.setX(5).setY(3).setWidth(100).setHeight(20); -+ switchToSimpleCheck.setPriority(RenderPriority.Low); -+ getScreen().attachWidget("Spoutcraft", switchToSimpleCheck); -+ -+ doneButton = new GenericButton("Done"); -+ doneButton.setAlign(WidgetAnchor.CENTER_CENTER); -+ doneButton.setX(right).setY(height - 25); -+ doneButton.setHeight(20).setWidth(150); -+ getScreen().attachWidget("Spoutcraft", doneButton); -+ -+ int top = 5; -+ -+ Color grey = new Color(0.80F, 0.80F, 0.80F, 0.65F); -+ -+ // Controls and audio -+ label = new GenericLabel("Controls and Audio Settings"); -+ size = Spoutcraft.getMinecraftFont().getTextWidth(label.getText()); -+ label.setX((int) (width / 2 - size / 2)).setY(top); -+ label.setTextColor(grey); -+ screen.attachWidget("Spoutcraft", label); -+ top += 11; -+ -+ Gradient linebreak = new GenericGradient(); -+ linebreak.setBottomColor(grey); -+ linebreak.setTopColor(grey); -+ linebreak.setX(width/2 - 318 / 2).setY(top).setHeight(3).setWidth(318); -+ screen.attachWidget("Spoutcraft", linebreak); -+ top += 6; -+ -+ control = new MusicSlider().setAlign(WidgetAnchor.TOP_CENTER); -+ control.setWidth(150).setHeight(20).setX(left).setY(top); -+ screen.attachWidget("Spoutcraft", control); -+ -+ control = new SoundEffectsSlider().setAlign(WidgetAnchor.TOP_CENTER); -+ control.setWidth(150).setHeight(20).setX(right).setY(top); -+ screen.attachWidget("Spoutcraft", control); -+ top += 22; -+ -+ control = new FieldOfViewSlider().setAlign(WidgetAnchor.TOP_CENTER); -+ control.setWidth(150).setHeight(20).setX(left).setY(top); -+ screen.attachWidget("Spoutcraft", control); -+ -+ control = new SensitivitySlider().setAlign(WidgetAnchor.TOP_CENTER); -+ control.setWidth(150).setHeight(20).setX(right).setY(top); -+ screen.attachWidget("Spoutcraft", control); -+ top += 22; -+ -+ control = new InvertMouseButton().setAlign(WidgetAnchor.TOP_CENTER); -+ control.setWidth(150).setHeight(20).setX(left).setY(top); -+ screen.attachWidget("Spoutcraft", control); -+ -+ control = new DifficultyButton().setAlign(WidgetAnchor.TOP_CENTER); -+ control.setWidth(150).setHeight(20).setX(right).setY(top); -+ screen.attachWidget("Spoutcraft", control); -+ top += 22; -+ -+ control = new TexturesButton(this).setAlign(WidgetAnchor.TOP_CENTER); -+ control.setWidth(150).setHeight(20).setX(center).setY(top); -+ screen.attachWidget("Spoutcraft", control); -+ top += 22; -+ -+ control = new ControlsButton(this).setAlign(WidgetAnchor.TOP_CENTER); -+ control.setWidth(150).setHeight(20).setX(left).setY(top); -+ screen.attachWidget("Spoutcraft", control); -+ -+ control = new LanguagesButton(this).setAlign(WidgetAnchor.TOP_CENTER); -+ control.setWidth(150).setHeight(20).setX(right).setY(top); -+ screen.attachWidget("Spoutcraft", control); -+ top += 22; -+ -+ control = new ChatButton(this).setAlign(WidgetAnchor.TOP_CENTER); -+ control.setWidth(150).setHeight(20).setX(left).setY(top); -+ screen.attachWidget("Spoutcraft", control); -+ -+ control = new MinimapButton(this).setAlign(WidgetAnchor.TOP_CENTER); -+ control.setWidth(150).setHeight(20).setX(right).setY(top); -+ screen.attachWidget("Spoutcraft", control); -+ -+ top += 22; -+ -+ // Graphics -+ label = new GenericLabel("Graphical Settings"); -+ size = Spoutcraft.getMinecraftFont().getTextWidth(label.getText()); -+ label.setX((int) (width / 2 - size / 2)).setY(top); -+ label.setTextColor(grey); -+ screen.attachWidget("Spoutcraft", label); -+ top += 11; -+ -+ linebreak = new GenericGradient(); -+ linebreak.setBottomColor(grey); -+ linebreak.setTopColor(grey); -+ linebreak.setX(width/2 - 318 / 2).setY(top).setHeight(3).setWidth(318); -+ screen.attachWidget("Spoutcraft", linebreak); -+ top += 6; -+ -+ // TODO Clean up references to Spoutworth and remove message -+ Label message = new GenericLabel(""); -+ message.setWidth(150).setHeight(20).setX(left).setY(top); -+ -+ if (Configuration.isAutomatePerformance()) { -+ screen.attachWidget("Spoutcraft", message); -+ -+ //top += 47; -+ } -+ -+ RadioButton button; -+ button = (RadioButton) new FavorPerformanceButton("Favor Performance", message).setGroup(1).setAlign(WidgetAnchor.TOP_CENTER); -+ button.setWidth(150).setHeight(20).setX(left).setY(top); -+ button.setTooltip("Spoutcraft will attempt to provide smooth framerates, potentially at the cost of appearance."); -+ screen.attachWidget("Spoutcraft", button); -+ button.setSelected(Configuration.isAutomatePerformance() && Configuration.getAutomateMode() == 0); -+ -+ button = (RadioButton) new OptimalGameplayButton("Balanced Gameplay", message).setGroup(1).setAlign(WidgetAnchor.TOP_CENTER); -+ button.setWidth(150).setHeight(20).setX(right).setY(top); -+ button.setTooltip("Spoutcraft will attempt to provide reasonable framerates and appearance."); -+ screen.attachWidget("Spoutcraft", button); -+ button.setSelected(Configuration.isAutomatePerformance() && Configuration.getAutomateMode() == 1); -+ -+ top += 22; -+ -+ button = (RadioButton) new FavorAppearanceButton("Favor Appearance", message).setGroup(1).setAlign(WidgetAnchor.TOP_CENTER); -+ button.setWidth(150).setHeight(20).setX(left).setY(top); -+ button.setTooltip("Spoutcraft will attempt to provide the best appearance, but potentially at the cost of framerates."); -+ screen.attachWidget("Spoutcraft", button); -+ button.setSelected(Configuration.isAutomatePerformance() && Configuration.getAutomateMode() == 2); -+ -+ button = (RadioButton) new ManualSelectionButton("Manual Selection", message, parent).setGroup(1).setAlign(WidgetAnchor.TOP_CENTER); -+ button.setWidth(150).setHeight(20).setX(right).setY(top); -+ button.setTooltip("Disable automatic performance settings and adjust the settings manually."); -+ screen.attachWidget("Spoutcraft", button); -+ button.setSelected(!Configuration.isAutomatePerformance()); -+ -+ top += 22; -+ -+ linebreak = new GenericGradient(); -+ linebreak.setBottomColor(grey); -+ linebreak.setTopColor(grey); -+ linebreak.setX(width/2 - 318 / 2).setY(top).setHeight(3).setWidth(318); -+ screen.attachWidget("Spoutcraft", linebreak); -+ top += 6; -+ -+ ArrayList graphicCheckboxes = new ArrayList(); -+ -+ control = new FancyGraphicsButton().setAlign(WidgetAnchor.TOP_CENTER); -+ control.setWidth(150).setHeight(20).setX((int) (width / 2 - size / 2) - 75/2).setY(top); -+ screen.attachWidget("Spoutcraft", control); -+ UUID fancyGraphics = control.getId(); -+ top+=20; -+ -+ control = new FancyGrassButton(fancyGraphics).setAlign(WidgetAnchor.TOP_CENTER); -+ control.setWidth(150).setHeight(20).setX(left).setY(top); -+ screen.attachWidget("Spoutcraft", control); -+ graphicCheckboxes.add((CheckBox) control); -+ -+ control = new FancyCloudsButton(fancyGraphics).setAlign(WidgetAnchor.TOP_CENTER); -+ control.setWidth(150).setHeight(20).setX(right).setY(top); -+ screen.attachWidget("Spoutcraft", control); -+ graphicCheckboxes.add((CheckBox) control); -+ -+ top += 22; -+ -+ control = new BiomeColorsButton(fancyGraphics).setAlign(WidgetAnchor.TOP_CENTER); -+ control.setWidth(150).setHeight(20).setX(left).setY(top); -+ screen.attachWidget("Spoutcraft", control); -+ graphicCheckboxes.add((CheckBox) control); -+ -+ control = new FancyFogButton(fancyGraphics).setAlign(WidgetAnchor.TOP_CENTER); -+ control.setWidth(150).setHeight(20).setX(right).setY(top); -+ screen.attachWidget("Spoutcraft", control); -+ graphicCheckboxes.add((CheckBox) control); -+ -+ top += 22; -+ -+ control = new FancyWaterButton(fancyGraphics).setAlign(WidgetAnchor.TOP_CENTER); -+ control.setWidth(150).setHeight(20).setX(left).setY(top); -+ screen.attachWidget("Spoutcraft", control); -+ graphicCheckboxes.add((CheckBox) control); -+ -+ control = new FancyTreesButton(fancyGraphics).setAlign(WidgetAnchor.TOP_CENTER); -+ control.setWidth(150).setHeight(20).setX(right).setY(top); -+ screen.attachWidget("Spoutcraft", control); -+ graphicCheckboxes.add((CheckBox) control); -+ -+ top += 22; -+ -+ control = new FancyLightingButton(fancyGraphics).setAlign(WidgetAnchor.TOP_CENTER); -+ control.setWidth(150).setHeight(20).setX(left).setY(top); -+ screen.attachWidget("Spoutcraft", control); -+ graphicCheckboxes.add((CheckBox) control); -+ -+ control = new FancyWeatherButton(fancyGraphics).setAlign(WidgetAnchor.TOP_CENTER); -+ control.setWidth(150).setHeight(20).setX(right).setY(top); -+ screen.attachWidget("Spoutcraft", control); -+ graphicCheckboxes.add((CheckBox) control); -+ -+ top += 22; -+ -+ control = new SmoothFPSButton().setAlign(WidgetAnchor.TOP_CENTER); -+ control.setWidth(150).setHeight(20).setX(left).setY(top); -+ screen.attachWidget("Spoutcraft", control); -+ -+ control = new FancyParticlesButton(fancyGraphics).setAlign(WidgetAnchor.TOP_CENTER); -+ control.setWidth(150).setHeight(20).setX(right).setY(top); -+ screen.attachWidget("Spoutcraft", control); -+ graphicCheckboxes.add((CheckBox) control); -+ -+ ((FancyGraphicsButton)screen.getWidget(fancyGraphics)).setLinkedButtons(graphicCheckboxes); -+ -+ top += 22; -+ -+ control = new ConnectedTexturesButton().setAlign(WidgetAnchor.TOP_CENTER); -+ control.setWidth(150).setHeight(20).setX(left).setY(top); -+ screen.attachWidget("Spoutcraft", control); -+ -+ control = new FancyItemsButton(fancyGraphics).setAlign(WidgetAnchor.TOP_CENTER); -+ control.setWidth(150).setHeight(20).setX(right).setY(top); -+ screen.attachWidget("Spoutcraft", control); -+ graphicCheckboxes.add((CheckBox) control); -+ -+ top += 22; -+ -+ control = new RandomMobTextureButton().setAlign(WidgetAnchor.TOP_CENTER); -+ control.setWidth(150).setHeight(20).setX(left).setY(top); -+ screen.attachWidget("Spoutcraft", control); -+ -+ control = new DisplayAnimalHeatinColorButton().setAlign(WidgetAnchor.TOP_CENTER); -+ control.setWidth(150).setHeight(20).setX(right).setY(top); -+ screen.attachWidget("Spoutcraft", control); -+ -+ top += 22; -+ -+ control = new OptimizedLightingUpdatesButton().setAlign(WidgetAnchor.TOP_CENTER); -+ control.setWidth(150).setHeight(20).setX(left).setY(top); -+ screen.attachWidget("Spoutcraft", control); -+ -+ control = new DisplayCustomParticlesButton().setAlign(WidgetAnchor.TOP_CENTER); -+ control.setWidth(150).setHeight(20).setX(right).setY(top); -+ screen.attachWidget("Spoutcraft", control); -+ -+ top += 22; -+ control = new ServerLightButton().setAlign(WidgetAnchor.TOP_CENTER); -+ control.setWidth(150).setHeight(20).setX(left).setY(top); -+ screen.attachWidget("Spoutcraft", control); -+ -+ control = new DisplayEntityNamesinRangeButton().setAlign(WidgetAnchor.TOP_CENTER); -+ control.setWidth(150).setHeight(20).setX(right).setY(top); -+ screen.attachWidget("Spoutcraft", control); -+ -+ top += 22; -+ control = new AmbientOcclusionButton().setAlign(WidgetAnchor.TOP_CENTER); -+ control.setWidth(150).setHeight(20).setX(left).setY(top); -+ screen.attachWidget("Spoutcraft", control); -+ -+ control = new DisplayPlayerNames3rdPersonButton().setAlign(WidgetAnchor.TOP_CENTER); -+ control.setWidth(150).setHeight(20).setX(right).setY(top); -+ screen.attachWidget("Spoutcraft", control); -+ -+ top += 22; -+ -+ control = new RenderDistanceButton().setAlign(WidgetAnchor.TOP_CENTER); -+ control.setWidth(150).setHeight(20).setX(left).setY(top); -+ screen.attachWidget("Spoutcraft", control); -+ -+ control = new BetterGrassButton().setAlign(WidgetAnchor.TOP_CENTER); -+ control.setWidth(150).setHeight(20).setX(right).setY(top); -+ screen.attachWidget("Spoutcraft", control); -+ top += 22; -+ -+ top += 5; -+ -+ // Performance -+ label = new GenericLabel("Performance Settings"); -+ size = Spoutcraft.getMinecraftFont().getTextWidth(label.getText()); -+ label.setX((int) (width / 2 - size / 2)).setY(top); -+ label.setTextColor(grey); -+ screen.attachWidget("Spoutcraft", label); -+ top += 11; -+ -+ linebreak = new GenericGradient(); -+ linebreak.setBottomColor(grey); -+ linebreak.setTopColor(grey); -+ linebreak.setX(width/2 - 318 / 2).setY(top).setHeight(3).setWidth(318); -+ screen.attachWidget("Spoutcraft", linebreak); -+ top += 6; -+ -+ control = new ChunkRenderSpeed().setAlign(WidgetAnchor.TOP_CENTER); -+ control.setWidth(150).setHeight(20).setX(left).setY(top); -+ screen.attachWidget("Spoutcraft", control); -+ -+ control = new FarViewButton().setAlign(WidgetAnchor.TOP_CENTER); -+ control.setWidth(150).setHeight(20).setX(right).setY(top); -+ screen.attachWidget("Spoutcraft", control); -+ -+ top += 22; -+ -+ control = new PerformanceButton().setAlign(WidgetAnchor.TOP_CENTER); -+ control.setWidth(150).setHeight(20).setX(left).setY(top); -+ screen.attachWidget("Spoutcraft", control); -+ -+ control = new AutosaveButton().setAlign(WidgetAnchor.TOP_CENTER); -+ control.setWidth(150).setHeight(20).setX(right).setY(top); -+ screen.attachWidget("Spoutcraft", control); -+ top += 22; -+ -+ control = new AdvancedOpenGLButton().setAlign(WidgetAnchor.TOP_CENTER); -+ control.setWidth(150).setHeight(20).setX(left).setY(top); -+ screen.attachWidget("Spoutcraft", control); -+ -+ control = new SignDistanceButton().setAlign(WidgetAnchor.TOP_CENTER); -+ control.setWidth(150).setHeight(20).setX(right).setY(top); -+ screen.attachWidget("Spoutcraft", control); -+ -+ top +=22; -+ control = new AntiAliasingButton().setAlign(WidgetAnchor.TOP_CENTER); -+ control.setWidth(150).setHeight(20).setX(center).setY(top); -+ screen.attachWidget("Spoutcraft", control); -+ -+ top += 22; -+ -+ top += 5; -+ -+ // Appearance -+ label = new GenericLabel("Appearance Settings"); -+ size = Spoutcraft.getMinecraftFont().getTextWidth(label.getText()); -+ label.setX((int) (width / 2 - size / 2)).setY(top); -+ label.setTextColor(grey); -+ screen.attachWidget("Spoutcraft", label); -+ top += 11; -+ -+ linebreak = new GenericGradient(); -+ linebreak.setBottomColor(grey); -+ linebreak.setTopColor(grey); -+ linebreak.setX(width/2 - 318 / 2).setY(top).setHeight(3).setWidth(318); -+ screen.attachWidget("Spoutcraft", linebreak); -+ top += 6; -+ -+ control = new TimeButton().setAlign(WidgetAnchor.TOP_CENTER); -+ control.setWidth(150).setHeight(20).setX(left).setY(top); -+ screen.attachWidget("Spoutcraft", control); -+ -+ control = new FastDebugInfoButton().setAlign(WidgetAnchor.TOP_CENTER); -+ control.setWidth(150).setHeight(20).setX(right).setY(top); -+ screen.attachWidget("Spoutcraft", control); -+ top += 22; -+ -+ control = new SkyToggleButton().setAlign(WidgetAnchor.TOP_CENTER); -+ control.setWidth(150).setHeight(20).setX(left).setY(top); -+ screen.attachWidget("Spoutcraft", control); -+ -+ control = new WeatherToggleButton().setAlign(WidgetAnchor.TOP_CENTER); -+ control.setWidth(150).setHeight(20).setX(right).setY(top); -+ screen.attachWidget("Spoutcraft", control); -+ top += 22; -+ -+ control = new StarsToggleButton().setAlign(WidgetAnchor.TOP_CENTER); -+ control.setWidth(150).setHeight(20).setX(left).setY(top); -+ screen.attachWidget("Spoutcraft", control); -+ -+ control = new ClearWaterToggleButton().setAlign(WidgetAnchor.TOP_CENTER); -+ control.setWidth(150).setHeight(20).setX(right).setY(top); -+ screen.attachWidget("Spoutcraft", control); -+ top += 22; -+ -+ control = new ViewBobbingButton().setAlign(WidgetAnchor.TOP_CENTER); -+ control.setWidth(150).setHeight(20).setX(left).setY(top); -+ screen.attachWidget("Spoutcraft", control); -+ -+ control = new VoidFogButton().setAlign(WidgetAnchor.TOP_CENTER); -+ control.setWidth(150).setHeight(20).setX(right).setY(top); -+ screen.attachWidget("Spoutcraft", control); -+ top += 22; -+ -+ control = new DelayedTooltipCheckbox().setAlign(WidgetAnchor.TOP_CENTER); -+ control.setWidth(150).setHeight(20).setX(left).setY(top); -+ screen.attachWidget("Spoutcraft", control); -+ -+ control = new WaterBiomeColorsButton().setAlign(WidgetAnchor.TOP_CENTER); -+ control.setWidth(150).setHeight(20).setX(right).setY(top); -+ screen.attachWidget("Spoutcraft", control); -+ -+ top += 22; -+ -+ control = new Anaglyph3DButton().setAlign(WidgetAnchor.TOP_CENTER); -+ control.setWidth(150).setHeight(20).setX(left).setY(top); -+ screen.attachWidget("Spoutcraft", control); -+ -+ control = new ServerTexturesButton().setAlign(WidgetAnchor.TOP_CENTER); -+ control.setWidth(150).setHeight(20).setX(right).setY(top); -+ screen.attachWidget("Spoutcraft", control); -+ -+ top +=22; -+ -+ control = new HotbarTextButton().setAlign(WidgetAnchor.TOP_CENTER); -+ control.setWidth(150).setHeight(20).setX(left).setY(top); -+ screen.attachWidget("Spoutcraft", control); -+ -+ control = new ChatColorAssistButton().setAlign(WidgetAnchor.TOP_CENTER); -+ control.setWidth(150).setHeight(20).setX(right).setY(top); -+ screen.attachWidget("Spoutcraft", control); -+ -+ top += 22; -+ -+ control = new SmoothLightingSlider().setAlign(WidgetAnchor.TOP_CENTER); -+ control.setWidth(150).setHeight(20).setX(left).setY(top); -+ screen.attachWidget("Spoutcraft", control); -+ -+ control = new BrightnessSlider().setAlign(WidgetAnchor.TOP_CENTER); -+ control.setWidth(150).setHeight(20).setX(right).setY(top); -+ screen.attachWidget("Spoutcraft", control); -+ -+ top += 22; -+ -+ control = new MipMapSlider().setAlign(WidgetAnchor.TOP_CENTER); -+ control.setWidth(150).setHeight(20).setX(left).setY(top); -+ screen.attachWidget("Spoutcraft", control); -+ -+ control = new FlightSpeedSlider().setAlign(WidgetAnchor.TOP_CENTER); -+ control.setWidth(150).setHeight(20).setX(right).setY(top); -+ screen.attachWidget("Spoutcraft", control); -+ -+ top += 22; -+ -+ control = new HotbarQuickKeysButton().setAlign(WidgetAnchor.TOP_CENTER); -+ control.setWidth(150).setHeight(20).setX(left).setY(top); -+ screen.attachWidget("Spoutcraft", control); -+ -+ control = new GuiScaleButton(this).setAlign(WidgetAnchor.TOP_CENTER); -+ control.setWidth(150).setHeight(20).setX(right).setY(top); -+ screen.attachWidget("Spoutcraft", control); -+ -+ top += 22; -+ -+ top += 5; -+ -+ // Inventory -+ label = new GenericLabel("Inventory Settings"); -+ size = Spoutcraft.getMinecraftFont().getTextWidth(label.getText()); -+ label.setX((int) (width / 2 - size / 2)).setY(top); -+ label.setTextColor(grey); -+ screen.attachWidget("Spoutcraft", label); -+ top += 11; -+ -+ linebreak = new GenericGradient(); -+ linebreak.setBottomColor(grey); -+ linebreak.setTopColor(grey); -+ linebreak.setX(width/2 - 318 / 2).setY(top).setHeight(3).setWidth(318); -+ screen.attachWidget("Spoutcraft", linebreak); -+ top += 6; -+ -+ control = new ReplaceToolsButton().setAlign(WidgetAnchor.TOP_CENTER); -+ control.setWidth(150).setHeight(20).setX(left).setY(top); -+ screen.attachWidget("Spoutcraft", control); -+ -+ control = new ReplaceBlocksButton().setAlign(WidgetAnchor.TOP_CENTER); -+ control.setWidth(150).setHeight(20).setX(right).setY(top); -+ screen.attachWidget("Spoutcraft", control); -+ top += 22; -+ -+ top += 5; -+ -+ // Miscellaneous -+ label = new GenericLabel("Miscellaneous Settings"); -+ size = Spoutcraft.getMinecraftFont().getTextWidth(label.getText()); -+ label.setX((int) (width / 2 - size / 2)).setY(top); -+ label.setTextColor(grey); -+ screen.attachWidget("Spoutcraft", label); -+ top += 11; -+ -+ linebreak = new GenericGradient(); -+ linebreak.setBottomColor(grey); -+ linebreak.setTopColor(grey); -+ linebreak.setX(width/2 - 318 / 2).setY(top).setHeight(3).setWidth(318); -+ screen.attachWidget("Spoutcraft", linebreak); -+ top += 6; -+ -+ control = new SnooperButton(this).setAlign(WidgetAnchor.TOP_CENTER); -+ control.setWidth(150).setHeight(20).setX(center).setY(top); -+ screen.attachWidget("Spoutcraft", control); -+ top += 22; -+ top += 5; -+ } -+ -+ @Override -+ public void drawScreen(int var1, int var2, float var3) { -+ drawDefaultBackground(); -+ } -+ -+ @Override -+ protected void buttonClicked(Button btn) { -+ if (btn.equals(doneButton)) { -+ SpoutClient.getHandle().displayGuiScreen(parent); -+ } -+ -+ if (btn.equals(switchToSimpleCheck)) { -+ Configuration.setAdvancedOptions(false); -+ SpoutClient.getHandle().displayGuiScreen(new GuiSimpleOptions(parent)); -+ } -+ } -+} ---- net/minecraft/src/BehaviorProjectileDispense.java -+++ net/minecraft/src/BehaviorProjectileDispense.java -@@ -1,21 +1,31 @@ - package net.minecraft.src; - - public abstract class BehaviorProjectileDispense extends BehaviorDefaultDispenseItem { -- public ItemStack dispenseStack(IBlockSource var1, ItemStack var2) { -- World var3 = var1.getWorld(); -- IPosition var4 = BlockDispenser.getIPositionFromBlockSource(var1); -- EnumFacing var5 = BlockDispenser.getFacing(var1.getBlockMetadata()); -+ -+ /** -+ * Dispense the specified stack, play the dispense sound and spawn particles. -+ */ -+ public ItemStack dispenseStack(IBlockSource par1IBlockSource, ItemStack par2ItemStack) { -+ World var3 = par1IBlockSource.getWorld(); -+ IPosition var4 = BlockDispenser.getIPositionFromBlockSource(par1IBlockSource); -+ EnumFacing var5 = BlockDispenser.getFacing(par1IBlockSource.getBlockMetadata()); - IProjectile var6 = this.getProjectileEntity(var3, var4); - var6.setThrowableHeading((double)var5.getFrontOffsetX(), (double)((float)var5.getFrontOffsetY() + 0.1F), (double)var5.getFrontOffsetZ(), this.func_82500_b(), this.func_82498_a()); - var3.spawnEntityInWorld((Entity)var6); -- var2.splitStack(1); -- return var2; -- } -- -- protected void playDispenseSound(IBlockSource var1) { -- var1.getWorld().playAuxSFX(1002, var1.getXInt(), var1.getYInt(), var1.getZInt(), 0); -- } -- -+ par2ItemStack.splitStack(1); -+ return par2ItemStack; -+ } -+ -+ /** -+ * Play the dispense sound from the specified block. -+ */ -+ protected void playDispenseSound(IBlockSource par1IBlockSource) { -+ par1IBlockSource.getWorld().playAuxSFX(1002, par1IBlockSource.getXInt(), par1IBlockSource.getYInt(), par1IBlockSource.getZInt(), 0); -+ } -+ -+ /** -+ * Return the projectile entity spawned by this dispense behavior. -+ */ - protected abstract IProjectile getProjectileEntity(World var1, IPosition var2); - - protected float func_82498_a() { ---- /dev/null -+++ com/prupe/mcpatcher/ctm/TileOverrideImpl$Top.java -@@ -1,0 +1,37 @@ -+package com.prupe.mcpatcher.ctm; -+ -+import com.prupe.mcpatcher.TileLoader; -+import java.util.Properties; -+import net.minecraft.src.Block; -+import net.minecraft.src.IBlockAccess; -+import net.minecraft.src.Icon; -+import net.minecraft.src.ResourceLocation; -+ -+final class TileOverrideImpl$Top extends TileOverride { -+ TileOverrideImpl$Top(ResourceLocation filePrefix, Properties properties, TileLoader tileLoader) { -+ super(filePrefix, properties, tileLoader); -+ } -+ -+ String getMethod() { -+ return "top"; -+ } -+ -+ String checkTileMap() { -+ return this.getNumberOfTiles() == 1 ? null : "requires exactly 1 tile"; -+ } -+ -+ Icon getTileImpl(IBlockAccess blockAccess, Block block, Icon origIcon, int i, int j, int k, int face) { -+ if (face < 0) { -+ face = 2; -+ } else if (this.reorient(face) <= 1) { -+ return null; -+ } -+ -+ int[][] offsets = NEIGHBOR_OFFSET[face]; -+ return this.shouldConnect(blockAccess, block, origIcon, i, j, k, face, offsets[this.rotateUV(6)]) ? this.icons[0] : null; -+ } -+ -+ Icon getTileImpl(Block block, Icon origIcon, int face, int metadata) { -+ return null; -+ } -+} ---- net/minecraft/src/InventoryBasic.java -+++ net/minecraft/src/InventoryBasic.java -@@ -4,47 +4,56 @@ - import java.util.List; - - public class InventoryBasic implements IInventory { -- private String a; -+ private String inventoryTitle; - private int slotsCount; - private ItemStack[] inventoryContents; -- private List d; -+ private List field_70480_d; - private boolean field_94051_e; - -- public InventoryBasic(String var1, boolean var2, int var3) { -- this.a = var1; -- this.field_94051_e = var2; -- this.slotsCount = var3; -- this.inventoryContents = new ItemStack[var3]; -+ public InventoryBasic(String par1Str, boolean par2, int par3) { -+ this.inventoryTitle = par1Str; -+ this.field_94051_e = par2; -+ this.slotsCount = par3; -+ this.inventoryContents = new ItemStack[par3]; - } - -- public void func_110134_a(IInvBasic var1) { -- if(this.d == null) { -- this.d = new ArrayList(); -+ public void func_110134_a(IInvBasic par1IInvBasic) { -+ if (this.field_70480_d == null) { -+ this.field_70480_d = new ArrayList(); - } - -- this.d.add(var1); -- } -- -- public void func_110132_b(IInvBasic var1) { -- this.d.remove(var1); -- } -- -- public ItemStack getStackInSlot(int var1) { -- return this.inventoryContents[var1]; -- } -- -- public ItemStack decrStackSize(int var1, int var2) { -- if(this.inventoryContents[var1] != null) { -+ this.field_70480_d.add(par1IInvBasic); -+ } -+ -+ public void func_110132_b(IInvBasic par1IInvBasic) { -+ this.field_70480_d.remove(par1IInvBasic); -+ } -+ -+ /** -+ * Returns the stack in slot i -+ */ -+ public ItemStack getStackInSlot(int par1) { -+ return this.inventoryContents[par1]; -+ } -+ -+ /** -+ * Removes from an inventory slot (first arg) up to a specified number (second arg) of items and returns them in a new -+ * stack. -+ */ -+ public ItemStack decrStackSize(int par1, int par2) { -+ if (this.inventoryContents[par1] != null) { - ItemStack var3; -- if(this.inventoryContents[var1].stackSize <= var2) { -- var3 = this.inventoryContents[var1]; -- this.inventoryContents[var1] = null; -+ -+ if (this.inventoryContents[par1].stackSize <= par2) { -+ var3 = this.inventoryContents[par1]; -+ this.inventoryContents[par1] = null; - this.onInventoryChanged(); - return var3; - } else { -- var3 = this.inventoryContents[var1].splitStack(var2); -- if(this.inventoryContents[var1].stackSize == 0) { -- this.inventoryContents[var1] = null; -+ var3 = this.inventoryContents[par1].splitStack(par2); -+ -+ if (this.inventoryContents[par1].stackSize == 0) { -+ this.inventoryContents[par1] = null; - } - - this.onInventoryChanged(); -@@ -55,66 +64,94 @@ - } - } - -- public ItemStack getStackInSlotOnClosing(int var1) { -- if(this.inventoryContents[var1] != null) { -- ItemStack var2 = this.inventoryContents[var1]; -- this.inventoryContents[var1] = null; -+ /** -+ * When some containers are closed they call this on each slot, then drop whatever it returns as an EntityItem - like -+ * when you close a workbench GUI. -+ */ -+ public ItemStack getStackInSlotOnClosing(int par1) { -+ if (this.inventoryContents[par1] != null) { -+ ItemStack var2 = this.inventoryContents[par1]; -+ this.inventoryContents[par1] = null; - return var2; - } else { - return null; - } - } - -- public void setInventorySlotContents(int var1, ItemStack var2) { -- this.inventoryContents[var1] = var2; -- if(var2 != null && var2.stackSize > this.getInventoryStackLimit()) { -- var2.stackSize = this.getInventoryStackLimit(); -+ /** -+ * Sets the given item stack to the specified slot in the inventory (can be crafting or armor sections). -+ */ -+ public void setInventorySlotContents(int par1, ItemStack par2ItemStack) { -+ this.inventoryContents[par1] = par2ItemStack; -+ -+ if (par2ItemStack != null && par2ItemStack.stackSize > this.getInventoryStackLimit()) { -+ par2ItemStack.stackSize = this.getInventoryStackLimit(); - } - - this.onInventoryChanged(); - } - -+ /** -+ * Returns the number of slots in the inventory. -+ */ - public int getSizeInventory() { - return this.slotsCount; - } - -+ /** -+ * Returns the name of the inventory. -+ */ - public String getInvName() { -- return this.a; -+ return this.inventoryTitle; - } - -+ /** -+ * If this returns false, the inventory name will be used as an unlocalized name, and translated into the player's -+ * language. Otherwise it will be used directly. -+ */ - public boolean isInvNameLocalized() { - return this.field_94051_e; - } - -- public void func_110133_a(String var1) { -+ public void func_110133_a(String par1Str) { - this.field_94051_e = true; -- this.a = var1; -+ this.inventoryTitle = par1Str; - } - -+ /** -+ * Returns the maximum stack size for a inventory slot. Seems to always be 64, possibly will be extended. *Isn't this -+ * more of a set than a get?* -+ */ - public int getInventoryStackLimit() { - return 64; - } - -+ /** -+ * Called when an the contents of an Inventory change, usually -+ */ - public void onInventoryChanged() { -- if(this.d != null) { -- for(int var1 = 0; var1 < this.d.size(); ++var1) { -- ((IInvBasic)this.d.get(var1)).onInventoryChanged(this); -+ if (this.field_70480_d != null) { -+ for (int var1 = 0; var1 < this.field_70480_d.size(); ++var1) { -+ ((IInvBasic)this.field_70480_d.get(var1)).onInventoryChanged(this); - } - } -- - } - -- public boolean isUseableByPlayer(EntityPlayer var1) { -+ /** -+ * Do not make give this method the name canInteractWith because it clashes with Container -+ */ -+ public boolean isUseableByPlayer(EntityPlayer par1EntityPlayer) { - return true; - } - -- public void openChest() { -- } -- -- public void closeChest() { -- } -- -- public boolean isItemValidForSlot(int var1, ItemStack var2) { -+ public void openChest() {} -+ -+ public void closeChest() {} -+ -+ /** -+ * Returns true if automation is allowed to insert the given stack (ignoring stack size) into the given slot. -+ */ -+ public boolean isItemValidForSlot(int par1, ItemStack par2ItemStack) { - return true; - } - } ---- net/minecraft/src/GuiAchievements.java -+++ net/minecraft/src/GuiAchievements.java -@@ -6,89 +6,119 @@ - import org.lwjgl.opengl.GL12; - - public class GuiAchievements extends GuiScreen { -+ -+ /** The top x coordinate of the achievement map */ - private static final int guiMapTop = AchievementList.minDisplayColumn * 24 - 112; -+ -+ /** The left y coordinate of the achievement map */ - private static final int guiMapLeft = AchievementList.minDisplayRow * 24 - 112; -+ -+ /** The bottom x coordinate of the achievement map */ - private static final int guiMapBottom = AchievementList.maxDisplayColumn * 24 - 77; -+ -+ /** The right y coordinate of the achievement map */ - private static final int guiMapRight = AchievementList.maxDisplayRow * 24 - 77; - private static final ResourceLocation achievementTextures = new ResourceLocation("textures/gui/achievement/achievement_background.png"); - protected int achievementsPaneWidth = 256; - protected int achievementsPaneHeight = 202; -+ -+ /** The current mouse x coordinate */ - protected int mouseX; -+ -+ /** The current mouse y coordinate */ - protected int mouseY; - protected double field_74117_m; - protected double field_74115_n; -+ -+ /** The x position of the achievement map */ - protected double guiMapX; -+ -+ /** The y position of the achievement map */ - protected double guiMapY; - protected double field_74124_q; - protected double field_74123_r; -+ -+ /** Whether the Mouse Button is down or not */ - private int isMouseButtonDown; - private StatFileWriter statFileWriter; - -- public GuiAchievements(StatFileWriter var1) { -- this.statFileWriter = var1; -+ public GuiAchievements(StatFileWriter par1StatFileWriter) { -+ this.statFileWriter = par1StatFileWriter; - short var2 = 141; - short var3 = 141; - this.field_74117_m = this.guiMapX = this.field_74124_q = (double)(AchievementList.openInventory.displayColumn * 24 - var2 / 2 - 12); - this.field_74115_n = this.guiMapY = this.field_74123_r = (double)(AchievementList.openInventory.displayRow * 24 - var3 / 2); - } - -+ /** -+ * Adds the buttons (and other controls) to the screen in question. -+ */ - public void initGui() { -- this.i.clear(); -- this.i.add(new GuiSmallButton(1, this.width / 2 + 24, this.height / 2 + 74, 80, 20, I18n.getString("gui.done"))); -+ this.buttonList.clear(); -+ this.buttonList.add(new GuiSmallButton(1, this.width / 2 + 24, this.height / 2 + 74, 80, 20, I18n.getString("gui.done"))); - } - -- protected void actionPerformed(GuiButton var1) { -- if(var1.id == 1) { -+ /** -+ * Fired when a control is clicked. This is the equivalent of ActionListener.actionPerformed(ActionEvent e). -+ */ -+ protected void actionPerformed(GuiButton par1GuiButton) { -+ if (par1GuiButton.id == 1) { - this.mc.displayGuiScreen((GuiScreen)null); - this.mc.setIngameFocus(); - } - -- super.actionPerformed(var1); -+ super.actionPerformed(par1GuiButton); - } - -- protected void keyTyped(char var1, int var2) { -- if(var2 == this.mc.gameSettings.keyBindInventory.keyCode) { -+ /** -+ * Fired when a key is typed. This is the equivalent of KeyListener.keyTyped(KeyEvent e). -+ */ -+ protected void keyTyped(char par1, int par2) { -+ if (par2 == this.mc.gameSettings.keyBindInventory.keyCode) { - this.mc.displayGuiScreen((GuiScreen)null); - this.mc.setIngameFocus(); - } else { -- super.keyTyped(var1, var2); -+ super.keyTyped(par1, par2); - } -- - } - -- public void drawScreen(int var1, int var2, float var3) { -- if(Mouse.isButtonDown(0)) { -+ /** -+ * Draws the screen and all the components in it. -+ */ -+ public void drawScreen(int par1, int par2, float par3) { -+ if (Mouse.isButtonDown(0)) { - int var4 = (this.width - this.achievementsPaneWidth) / 2; - int var5 = (this.height - this.achievementsPaneHeight) / 2; - int var6 = var4 + 8; - int var7 = var5 + 17; -- if((this.isMouseButtonDown == 0 || this.isMouseButtonDown == 1) && var1 >= var6 && var1 < var6 + 224 && var2 >= var7 && var2 < var7 + 155) { -- if(this.isMouseButtonDown == 0) { -+ -+ if ((this.isMouseButtonDown == 0 || this.isMouseButtonDown == 1) && par1 >= var6 && par1 < var6 + 224 && par2 >= var7 && par2 < var7 + 155) { -+ if (this.isMouseButtonDown == 0) { - this.isMouseButtonDown = 1; - } else { -- this.guiMapX -= (double)(var1 - this.mouseX); -- this.guiMapY -= (double)(var2 - this.mouseY); -+ this.guiMapX -= (double)(par1 - this.mouseX); -+ this.guiMapY -= (double)(par2 - this.mouseY); - this.field_74124_q = this.field_74117_m = this.guiMapX; - this.field_74123_r = this.field_74115_n = this.guiMapY; - } - -- this.mouseX = var1; -- this.mouseY = var2; -+ this.mouseX = par1; -+ this.mouseY = par2; - } - -- if(this.field_74124_q < (double)guiMapTop) { -+ if (this.field_74124_q < (double)guiMapTop) { - this.field_74124_q = (double)guiMapTop; - } - -- if(this.field_74123_r < (double)guiMapLeft) { -+ if (this.field_74123_r < (double)guiMapLeft) { - this.field_74123_r = (double)guiMapLeft; - } - -- if(this.field_74124_q >= (double)guiMapBottom) { -+ if (this.field_74124_q >= (double)guiMapBottom) { - this.field_74124_q = (double)(guiMapBottom - 1); - } - -- if(this.field_74123_r >= (double)guiMapRight) { -+ if (this.field_74123_r >= (double)guiMapRight) { - this.field_74123_r = (double)(guiMapRight - 1); - } - } else { -@@ -96,7 +126,7 @@ - } - - this.drawDefaultBackground(); -- this.genAchievementBackground(var1, var2, var3); -+ this.genAchievementBackground(par1, par2, par3); - GL11.glDisable(GL11.GL_LIGHTING); - GL11.glDisable(GL11.GL_DEPTH_TEST); - this.drawTitle(); -@@ -104,43 +134,50 @@ - GL11.glEnable(GL11.GL_DEPTH_TEST); - } - -+ /** -+ * Called from the main game loop to update the screen. -+ */ - public void updateScreen() { - this.field_74117_m = this.guiMapX; - this.field_74115_n = this.guiMapY; - double var1 = this.field_74124_q - this.guiMapX; - double var3 = this.field_74123_r - this.guiMapY; -- if(var1 * var1 + var3 * var3 < 4.0D) { -+ -+ if (var1 * var1 + var3 * var3 < 4.0D) { - this.guiMapX += var1; - this.guiMapY += var3; - } else { - this.guiMapX += var1 * 0.85D; - this.guiMapY += var3 * 0.85D; - } -- - } - -+ /** -+ * Draws the "Achievements" title at the top of the GUI. -+ */ - protected void drawTitle() { - int var1 = (this.width - this.achievementsPaneWidth) / 2; - int var2 = (this.height - this.achievementsPaneHeight) / 2; - this.fontRenderer.drawString("Achievements", var1 + 15, var2 + 5, 4210752); - } - -- protected void genAchievementBackground(int var1, int var2, float var3) { -- int var4 = MathHelper.floor_double(this.field_74117_m + (this.guiMapX - this.field_74117_m) * (double)var3); -- int var5 = MathHelper.floor_double(this.field_74115_n + (this.guiMapY - this.field_74115_n) * (double)var3); -- if(var4 < guiMapTop) { -+ protected void genAchievementBackground(int par1, int par2, float par3) { -+ int var4 = MathHelper.floor_double(this.field_74117_m + (this.guiMapX - this.field_74117_m) * (double)par3); -+ int var5 = MathHelper.floor_double(this.field_74115_n + (this.guiMapY - this.field_74115_n) * (double)par3); -+ -+ if (var4 < guiMapTop) { - var4 = guiMapTop; - } - -- if(var5 < guiMapLeft) { -+ if (var5 < guiMapLeft) { - var5 = guiMapLeft; - } - -- if(var4 >= guiMapBottom) { -+ if (var4 >= guiMapBottom) { - var4 = guiMapBottom - 1; - } - -- if(var5 >= guiMapRight) { -+ if (var5 >= guiMapRight) { - var5 = guiMapRight - 1; - } - -@@ -166,33 +203,34 @@ - boolean var17 = true; - boolean var18 = true; - Random var19 = new Random(); -- - int var20; -- int var22; - int var23; -- for(var20 = 0; var20 * 16 - var13 < 155; ++var20) { -+ int var22; -+ -+ for (var20 = 0; var20 * 16 - var13 < 155; ++var20) { - float var21 = 0.6F - (float)(var11 + var20) / 25.0F * 0.3F; - GL11.glColor4f(var21, var21, var21, 1.0F); - -- for(var22 = 0; var22 * 16 - var12 < 224; ++var22) { -+ for (var22 = 0; var22 * 16 - var12 < 224; ++var22) { - var19.setSeed((long)(1234 + var10 + var22)); - var19.nextInt(); - var23 = var19.nextInt(1 + var11 + var20) + (var11 + var20) / 2; - Icon var24 = Block.sand.getIcon(0, 0); -- if(var23 <= 37 && var11 + var20 != 35) { -- if(var23 == 22) { -- if(var19.nextInt(2) == 0) { -+ -+ if (var23 <= 37 && var11 + var20 != 35) { -+ if (var23 == 22) { -+ if (var19.nextInt(2) == 0) { - var24 = Block.oreDiamond.getIcon(0, 0); - } else { - var24 = Block.oreRedstone.getIcon(0, 0); - } -- } else if(var23 == 10) { -+ } else if (var23 == 10) { - var24 = Block.oreIron.getIcon(0, 0); -- } else if(var23 == 8) { -+ } else if (var23 == 8) { - var24 = Block.oreCoal.getIcon(0, 0); -- } else if(var23 > 4) { -+ } else if (var23 > 4) { - var24 = Block.stone.getIcon(0, 0); -- } else if(var23 > 0) { -+ } else if (var23 > 0) { - var24 = Block.dirt.getIcon(0, 0); - } - } else { -@@ -207,29 +245,31 @@ - GL11.glEnable(GL11.GL_DEPTH_TEST); - GL11.glDepthFunc(GL11.GL_LEQUAL); - GL11.glDisable(GL11.GL_TEXTURE_2D); -- - int var25; - int var28; -- int var37; -- for(var20 = 0; var20 < AchievementList.e.size(); ++var20) { -- Achievement var31 = (Achievement)AchievementList.e.get(var20); -- if(var31.parentAchievement != null) { -+ int var41; -+ -+ for (var20 = 0; var20 < AchievementList.achievementList.size(); ++var20) { -+ Achievement var31 = (Achievement)AchievementList.achievementList.get(var20); -+ -+ if (var31.parentAchievement != null) { - var22 = var31.displayColumn * 24 - var4 + 11 + var8; - var23 = var31.displayRow * 24 - var5 + 11 + var9; -- var37 = var31.parentAchievement.displayColumn * 24 - var4 + 11 + var8; -+ var41 = var31.parentAchievement.displayColumn * 24 - var4 + 11 + var8; - var25 = var31.parentAchievement.displayRow * 24 - var5 + 11 + var9; - boolean var26 = this.statFileWriter.hasAchievementUnlocked(var31); - boolean var27 = this.statFileWriter.canUnlockAchievement(var31); - var28 = Math.sin((double)(Minecraft.getSystemTime() % 600L) / 600.0D * Math.PI * 2.0D) > 0.6D ? 255 : 130; - int var29 = -16777216; -- if(var26) { -+ -+ if (var26) { - var29 = -9408400; -- } else if(var27) { -- var29 = '\uff00' + (var28 << 24); -+ } else if (var27) { -+ var29 = 65280 + (var28 << 24); - } - -- this.drawHorizontalLine(var22, var37, var23, var29); -- this.drawVerticalLine(var37, var23, var25, var29); -+ this.drawHorizontalLine(var22, var41, var23, var29); -+ this.drawVerticalLine(var41, var23, var25, var29); - } - } - -@@ -239,52 +279,57 @@ - GL11.glDisable(GL11.GL_LIGHTING); - GL11.glEnable(GL12.GL_RESCALE_NORMAL); - GL11.glEnable(GL11.GL_COLOR_MATERIAL); -- -- int var38; - int var39; -- for(var22 = 0; var22 < AchievementList.e.size(); ++var22) { -- Achievement var33 = (Achievement)AchievementList.e.get(var22); -- var37 = var33.displayColumn * 24 - var4; -- var25 = var33.displayRow * 24 - var5; -- if(var37 >= -24 && var25 >= -24 && var37 <= 224 && var25 <= 155) { -- float var36; -- if(this.statFileWriter.hasAchievementUnlocked(var33)) { -- var36 = 1.0F; -- GL11.glColor4f(var36, var36, var36, 1.0F); -- } else if(this.statFileWriter.canUnlockAchievement(var33)) { -- var36 = Math.sin((double)(Minecraft.getSystemTime() % 600L) / 600.0D * Math.PI * 2.0D) < 0.6D ? 0.6F : 0.8F; -- GL11.glColor4f(var36, var36, var36, 1.0F); -+ int var40; -+ -+ for (var22 = 0; var22 < AchievementList.achievementList.size(); ++var22) { -+ Achievement var34 = (Achievement)AchievementList.achievementList.get(var22); -+ var41 = var34.displayColumn * 24 - var4; -+ var25 = var34.displayRow * 24 - var5; -+ -+ if (var41 >= -24 && var25 >= -24 && var41 <= 224 && var25 <= 155) { -+ float var38; -+ -+ if (this.statFileWriter.hasAchievementUnlocked(var34)) { -+ var38 = 1.0F; -+ GL11.glColor4f(var38, var38, var38, 1.0F); -+ } else if (this.statFileWriter.canUnlockAchievement(var34)) { -+ var38 = Math.sin((double)(Minecraft.getSystemTime() % 600L) / 600.0D * Math.PI * 2.0D) < 0.6D ? 0.6F : 0.8F; -+ GL11.glColor4f(var38, var38, var38, 1.0F); - } else { -- var36 = 0.3F; -- GL11.glColor4f(var36, var36, var36, 1.0F); -+ var38 = 0.3F; -+ GL11.glColor4f(var38, var38, var38, 1.0F); - } - - this.mc.getTextureManager().bindTexture(achievementTextures); -- var38 = var8 + var37; -+ var40 = var8 + var41; - var39 = var9 + var25; -- if(var33.getSpecial()) { -- this.drawTexturedModalRect(var38 - 2, var39 - 2, 26, 202, 26, 26); -+ -+ if (var34.getSpecial()) { -+ this.drawTexturedModalRect(var40 - 2, var39 - 2, 26, 202, 26, 26); - } else { -- this.drawTexturedModalRect(var38 - 2, var39 - 2, 0, 202, 26, 26); -+ this.drawTexturedModalRect(var40 - 2, var39 - 2, 0, 202, 26, 26); - } - -- if(!this.statFileWriter.canUnlockAchievement(var33)) { -- float var40 = 0.1F; -- GL11.glColor4f(var40, var40, var40, 1.0F); -+ if (!this.statFileWriter.canUnlockAchievement(var34)) { -+ float var37 = 0.1F; -+ GL11.glColor4f(var37, var37, var37, 1.0F); - var32.renderWithColor = false; - } - - GL11.glEnable(GL11.GL_LIGHTING); - GL11.glEnable(GL11.GL_CULL_FACE); -- var32.renderItemAndEffectIntoGUI(this.mc.fontRenderer, this.mc.getTextureManager(), var33.theItemStack, var38 + 3, var39 + 3); -+ var32.renderItemAndEffectIntoGUI(this.mc.fontRenderer, this.mc.getTextureManager(), var34.theItemStack, var40 + 3, var39 + 3); - GL11.glDisable(GL11.GL_LIGHTING); -- if(!this.statFileWriter.canUnlockAchievement(var33)) { -+ -+ if (!this.statFileWriter.canUnlockAchievement(var34)) { - var32.renderWithColor = true; - } - - GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); -- if(var1 >= var8 && var2 >= var9 && var1 < var8 + 224 && var2 < var9 + 155 && var1 >= var38 && var1 <= var38 + 22 && var2 >= var39 && var2 <= var39 + 22) { -- var30 = var33; -+ -+ if (par1 >= var8 && par2 >= var9 && par1 < var8 + 224 && par2 < var9 + 155 && par1 >= var40 && par1 <= var40 + 22 && par2 >= var39 && par2 <= var39 + 22) { -+ var30 = var34; - } - } - } -@@ -299,40 +344,48 @@ - GL11.glDepthFunc(GL11.GL_LEQUAL); - GL11.glDisable(GL11.GL_DEPTH_TEST); - GL11.glEnable(GL11.GL_TEXTURE_2D); -- super.drawScreen(var1, var2, var3); -- if(var30 != null) { -- String var34 = I18n.getString(var30.getName()); -+ super.drawScreen(par1, par2, par3); -+ -+ if (var30 != null) { -+ String var33 = I18n.getString(var30.getName()); - String var35 = var30.getDescription(); -- var37 = var1 + 12; -- var25 = var2 - 4; -- if(this.statFileWriter.canUnlockAchievement(var30)) { -- var38 = Math.max(this.fontRenderer.getStringWidth(var34), 120); -- var39 = this.fontRenderer.splitStringWidth(var35, var38); -- if(this.statFileWriter.hasAchievementUnlocked(var30)) { -+ var41 = par1 + 12; -+ var25 = par2 - 4; -+ -+ if (this.statFileWriter.canUnlockAchievement(var30)) { -+ var40 = Math.max(this.fontRenderer.getStringWidth(var33), 120); -+ var39 = this.fontRenderer.splitStringWidth(var35, var40); -+ -+ if (this.statFileWriter.hasAchievementUnlocked(var30)) { - var39 += 12; - } - -- this.drawGradientRect(var37 - 3, var25 - 3, var37 + var38 + 3, var25 + var39 + 3 + 12, -1073741824, -1073741824); -- this.fontRenderer.drawSplitString(var35, var37, var25 + 12, var38, -6250336); -- if(this.statFileWriter.hasAchievementUnlocked(var30)) { -- this.fontRenderer.drawStringWithShadow(I18n.getString("achievement.taken"), var37, var25 + var39 + 4, -7302913); -+ this.drawGradientRect(var41 - 3, var25 - 3, var41 + var40 + 3, var25 + var39 + 3 + 12, -1073741824, -1073741824); -+ this.fontRenderer.drawSplitString(var35, var41, var25 + 12, var40, -6250336); -+ -+ if (this.statFileWriter.hasAchievementUnlocked(var30)) { -+ this.fontRenderer.drawStringWithShadow(I18n.getString("achievement.taken"), var41, var25 + var39 + 4, -7302913); - } - } else { -- var38 = Math.max(this.fontRenderer.getStringWidth(var34), 120); -- String var41 = I18n.getStringParams("achievement.requires", new Object[]{I18n.getString(var30.parentAchievement.getName())}); -- var28 = this.fontRenderer.splitStringWidth(var41, var38); -- this.drawGradientRect(var37 - 3, var25 - 3, var37 + var38 + 3, var25 + var28 + 12 + 3, -1073741824, -1073741824); -- this.fontRenderer.drawSplitString(var41, var37, var25 + 12, var38, -9416624); -+ var40 = Math.max(this.fontRenderer.getStringWidth(var33), 120); -+ String var36 = I18n.getStringParams("achievement.requires", new Object[] {I18n.getString(var30.parentAchievement.getName())}); -+ var28 = this.fontRenderer.splitStringWidth(var36, var40); -+ this.drawGradientRect(var41 - 3, var25 - 3, var41 + var40 + 3, var25 + var28 + 12 + 3, -1073741824, -1073741824); -+ this.fontRenderer.drawSplitString(var36, var41, var25 + 12, var40, -9416624); - } - -- this.fontRenderer.drawStringWithShadow(var34, var37, var25, this.statFileWriter.canUnlockAchievement(var30) ? (var30.getSpecial() ? -128 : -1) : (var30.getSpecial() ? -8355776 : -8355712)); -+ this.fontRenderer.drawStringWithShadow(var33, var41, var25, this.statFileWriter.canUnlockAchievement(var30) ? (var30.getSpecial() ? -128 : -1) : (var30.getSpecial() ? -8355776 : -8355712)); - } - - GL11.glEnable(GL11.GL_DEPTH_TEST); - GL11.glEnable(GL11.GL_LIGHTING); -- RenderHelper.disableStandardItemLighting(); -+ // Spout Removed - This is how you fix stuff by implementing stupidity. -+ //RenderHelper.disableStandardItemLighting(); - } - -+ /** -+ * Returns true if this GUI should pause the game when it is displayed in single-player -+ */ - public boolean doesGuiPauseGame() { - return true; - } ---- net/minecraft/src/EffectRenderer.java -+++ net/minecraft/src/EffectRenderer.java -@@ -3,70 +3,96 @@ - import java.util.ArrayList; - import java.util.List; - import java.util.Random; -+ - import org.lwjgl.opengl.GL11; - -+import com.prupe.mcpatcher.sky.FireworksHelper; -+ -+import org.newdawn.slick.opengl.Texture; -+ -+//Spout Start -+import org.spoutcraft.api.block.design.BlockDesign; -+import org.spoutcraft.api.Spoutcraft; -+import org.spoutcraft.api.material.CustomBlock; -+import org.spoutcraft.api.material.MaterialData; -+import org.spoutcraft.client.io.CustomTextureManager; -+import org.spoutcraft.client.SpoutClient; -+import org.spoutcraft.client.block.SpoutcraftChunk; -+import org.spoutcraft.client.config.Configuration; -+//Spout End -+ - public class EffectRenderer { - private static final ResourceLocation particleTextures = new ResourceLocation("textures/particle/particles.png"); -- protected World worldObj; -- private List[] c = new List[4]; -+ /** Reference to the World object. */ -+ // MCPatcher Start - protected to public -+ public World worldObj; -+ // MCPatcher End -+ private List[] fxLayers = new List[5]; - private TextureManager renderer; -- private Random e = new Random(); -- -- public EffectRenderer(World var1, TextureManager var2) { -- if(var1 != null) { -- this.worldObj = var1; -- } -- -- this.renderer = var2; -- -- for(int var3 = 0; var3 < 4; ++var3) { -- this.c[var3] = new ArrayList(); -- } -- -+ -+ /** RNG. */ -+ private Random rand = new Random(); -+ -+ public EffectRenderer(World par1World, TextureManager par2TextureManager) { -+ if (par1World != null) { -+ this.worldObj = par1World; -+ } -+ -+ this.renderer = par2TextureManager; -+ -+ for (int var3 = 0; var3 < 5; ++var3) { -+ this.fxLayers[var3] = new ArrayList(); -+ } - } -+ -+ public void addEffect(EntityFX par1EntityFX) { -+ int var2 = FireworksHelper.getFXLayer(par1EntityFX); - -- public void addEffect(EntityFX var1) { -- int var2 = var1.getFXLayer(); -- if(this.c[var2].size() >= 4000) { -- this.c[var2].remove(0); -+ if (this.fxLayers[var2].size() >= 4000) { -+ this.fxLayers[var2].remove(0); - } - -- this.c[var2].add(var1); -+ this.fxLayers[var2].add(par1EntityFX); - } - - public void updateEffects() { -- for(int var1 = 0; var1 < 4; ++var1) { -- for(int var2 = 0; var2 < this.c[var1].size(); ++var2) { -- EntityFX var3 = (EntityFX)this.c[var1].get(var2); -+ for (int var1 = 0; var1 < 5; ++var1) { -+ for (int var2 = 0; var2 < this.fxLayers[var1].size(); ++var2) { -+ EntityFX var3 = (EntityFX)this.fxLayers[var1].get(var2); - var3.onUpdate(); -- if(var3.isDead) { -- this.c[var1].remove(var2--); -+ -+ if (var3.isDead) { -+ this.fxLayers[var1].remove(var2--); - } - } - } -- - } - -- public void renderParticles(Entity var1, float var2) { -+ /** -+ * Renders all current particles. Args player, partialTickTime -+ */ -+ public void renderParticles(Entity par1Entity, float par2) { - float var3 = ActiveRenderInfo.rotationX; - float var4 = ActiveRenderInfo.rotationZ; - float var5 = ActiveRenderInfo.rotationYZ; - float var6 = ActiveRenderInfo.rotationXY; - float var7 = ActiveRenderInfo.rotationXZ; -- EntityFX.interpPosX = var1.lastTickPosX + (var1.posX - var1.lastTickPosX) * (double)var2; -- EntityFX.interpPosY = var1.lastTickPosY + (var1.posY - var1.lastTickPosY) * (double)var2; -- EntityFX.interpPosZ = var1.lastTickPosZ + (var1.posZ - var1.lastTickPosZ) * (double)var2; -+ EntityFX.interpPosX = par1Entity.lastTickPosX + (par1Entity.posX - par1Entity.lastTickPosX) * (double)par2; -+ EntityFX.interpPosY = par1Entity.lastTickPosY + (par1Entity.posY - par1Entity.lastTickPosY) * (double)par2; -+ EntityFX.interpPosZ = par1Entity.lastTickPosZ + (par1Entity.posZ - par1Entity.lastTickPosZ) * (double)par2; - -- for(int var8 = 0; var8 < 3; ++var8) { -- if(!this.c[var8].isEmpty()) { -- switch(var8) { -+ for (int var8 = 0; var8 < 5; ++var8) { -+ if (!FireworksHelper.skipThisLayer(this.fxLayers[var8].isEmpty(), var8)) { -+ switch (var8) { - case 0: - default: - this.renderer.bindTexture(particleTextures); - break; -+ - case 1: - this.renderer.bindTexture(TextureMap.locationBlocksTexture); - break; -+ - case 2: - this.renderer.bindTexture(TextureMap.locationItemsTexture); - } -@@ -74,15 +100,15 @@ - GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - GL11.glDepthMask(false); - GL11.glEnable(GL11.GL_BLEND); -- GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); -+ FireworksHelper.setParticleBlendMethod(var8); - GL11.glAlphaFunc(GL11.GL_GREATER, 0.003921569F); - Tessellator var9 = Tessellator.instance; - var9.startDrawingQuads(); - -- for(int var10 = 0; var10 < this.c[var8].size(); ++var10) { -- EntityFX var11 = (EntityFX)this.c[var8].get(var10); -- var9.setBrightness(var11.getBrightnessForRender(var2)); -- var11.renderParticle(var9, var2, var3, var7, var4, var5, var6); -+ for (int var10 = 0; var10 < this.fxLayers[var8].size(); ++var10) { -+ EntityFX var11 = (EntityFX)this.fxLayers[var8].get(var10); -+ var9.setBrightness(var11.getBrightnessForRender(par2)); -+ var11.renderParticle(var9, par2, var3, var7, var4, var5, var6); - } - - var9.draw(); -@@ -91,95 +117,148 @@ - GL11.glAlphaFunc(GL11.GL_GREATER, 0.1F); - } - } -- - } - -- public void renderLitParticles(Entity var1, float var2) { -- float var3 = (float)Math.PI / 180.0F; -- float var4 = MathHelper.cos(var1.rotationYaw * ((float)Math.PI / 180.0F)); -- float var5 = MathHelper.sin(var1.rotationYaw * ((float)Math.PI / 180.0F)); -- float var6 = -var5 * MathHelper.sin(var1.rotationPitch * ((float)Math.PI / 180.0F)); -- float var7 = var4 * MathHelper.sin(var1.rotationPitch * ((float)Math.PI / 180.0F)); -- float var8 = MathHelper.cos(var1.rotationPitch * ((float)Math.PI / 180.0F)); -+ public void renderLitParticles(Entity par1Entity, float par2) { -+ float var3 = 0.017453292F; -+ float var4 = MathHelper.cos(par1Entity.rotationYaw * 0.017453292F); -+ float var5 = MathHelper.sin(par1Entity.rotationYaw * 0.017453292F); -+ float var6 = -var5 * MathHelper.sin(par1Entity.rotationPitch * 0.017453292F); -+ float var7 = var4 * MathHelper.sin(par1Entity.rotationPitch * 0.017453292F); -+ float var8 = MathHelper.cos(par1Entity.rotationPitch * 0.017453292F); - byte var9 = 3; -- List var10 = this.c[var9]; -- if(!var10.isEmpty()) { -+ List var10 = this.fxLayers[var9]; -+ -+ if (!var10.isEmpty()) { - Tessellator var11 = Tessellator.instance; - -- for(int var12 = 0; var12 < var10.size(); ++var12) { -+ for (int var12 = 0; var12 < var10.size(); ++var12) { - EntityFX var13 = (EntityFX)var10.get(var12); -- var11.setBrightness(var13.getBrightnessForRender(var2)); -- var13.renderParticle(var11, var2, var4, var8, var5, var6, var7); -- } -- -- } -- } -- -- public void clearEffects(World var1) { -- this.worldObj = var1; -- -- for(int var2 = 0; var2 < 4; ++var2) { -- this.c[var2].clear(); -- } -- -- } -- -- public void addBlockDestroyEffects(int var1, int var2, int var3, int var4, int var5) { -- if(var4 != 0) { -- Block var6 = Block.blocksList[var4]; -+ var11.setBrightness(var13.getBrightnessForRender(par2)); -+ var13.renderParticle(var11, par2, var4, var8, var5, var6, var7); -+ } -+ } -+ } -+ -+ public void clearEffects(World par1World) { -+ this.worldObj = par1World; -+ -+ for (int var2 = 0; var2 < 5; ++var2) { -+ this.fxLayers[var2].clear(); -+ } -+ } -+ -+ public void addBlockDestroyEffects(int par1, int par2, int par3, int par4, int par5) { -+ if (par4 != 0) { -+ Block var6 = Block.blocksList[par4]; -+ // Spout Start -+ Texture texture = null; -+ short customId = 0; -+ if (SpoutClient.getInstance().getRawWorld() != null) { -+ SpoutcraftChunk sChunk = Spoutcraft.getChunkAt(SpoutClient.getInstance().getRawWorld(), par1, par2, par3); -+ customId = sChunk.getCustomBlockId(par1, par2, par3); -+ short[] customBlockIds = sChunk.getCustomBlockIds(); -+ byte[] customBlockData = sChunk.getCustomBlockData(); -+ if (customId > 0) { -+ if (Configuration.displayCustomParticles) { -+ CustomBlock block = MaterialData.getCustomBlock(customId); -+ if (block != null) { -+ BlockDesign design = block.getBlockDesign(customBlockData[customId]); -+ if (design != null) { -+ texture = CustomTextureManager.getTextureFromUrl(block.getAddon(), design.getTextureURL()); -+ } -+ } -+ } else { -+ return; -+ } -+ } -+ } -+ // Spout End - byte var7 = 4; - -- for(int var8 = 0; var8 < var7; ++var8) { -- for(int var9 = 0; var9 < var7; ++var9) { -- for(int var10 = 0; var10 < var7; ++var10) { -- double var11 = (double)var1 + ((double)var8 + 0.5D) / (double)var7; -- double var13 = (double)var2 + ((double)var9 + 0.5D) / (double)var7; -- double var15 = (double)var3 + ((double)var10 + 0.5D) / (double)var7; -- this.addEffect((new EntityDiggingFX(this.worldObj, var11, var13, var15, var11 - (double)var1 - 0.5D, var13 - (double)var2 - 0.5D, var15 - (double)var3 - 0.5D, var6, var5)).applyColourMultiplier(var1, var2, var3)); -+ for (int var8 = 0; var8 < var7; ++var8) { -+ for (int var9 = 0; var9 < var7; ++var9) { -+ for (int var10 = 0; var10 < var7; ++var10) { -+ double var11 = (double)par1 + ((double)var8 + 0.5D) / (double)var7; -+ double var13 = (double)par2 + ((double)var9 + 0.5D) / (double)var7; -+ double var15 = (double)par3 + ((double)var10 + 0.5D) / (double)var7; -+ this.addEffect((new EntityDiggingFX(this.worldObj, var11, var13, var15, var11 - (double)par1 - 0.5D, var13 - (double)par2 - 0.5D, var15 - (double)par3 - 0.5D, var6, par5, texture)).applyColourMultiplier(par1, par2, par3)); - } - } - } -- - } - } - -- public void addBlockHitEffects(int var1, int var2, int var3, int var4) { -- int var5 = this.worldObj.getBlockId(var1, var2, var3); -- if(var5 != 0) { -+ /** -+ * Adds block hit particles for the specified block. Args: x, y, z, sideHit -+ */ -+ public void addBlockHitEffects(int par1, int par2, int par3, int par4) { -+ int var5 = this.worldObj.getBlockId(par1, par2, par3); -+ -+ if (var5 != 0) { - Block var6 = Block.blocksList[var5]; -+ -+ // Spout Start -+ Texture texture = null; -+ -+ short customId = 0; -+ if (SpoutClient.getInstance().getRawWorld() != null) { -+ SpoutcraftChunk sChunk = Spoutcraft.getChunkAt(SpoutClient.getInstance().getRawWorld(), par1, par2, par3); -+ customId = sChunk.getCustomBlockId(par1, par2, par3); -+ short[] customBlockIds = sChunk.getCustomBlockIds(); -+ byte[] customBlockData = sChunk.getCustomBlockData(); -+ -+ if (customId > 0) { -+ if (Configuration.displayCustomParticles) { -+ CustomBlock block = MaterialData.getCustomBlock(customId); -+ if (block != null) { -+ BlockDesign design = block.getBlockDesign(customBlockData[customId]); -+ if (design != null) { -+ texture = CustomTextureManager.getTextureFromUrl(block.getAddon(), design.getTextureURL()); -+ } -+ } -+ } else { -+ return; -+ } -+ } -+ -+ } -+ // Spout End -+ - float var7 = 0.1F; -- double var8 = (double)var1 + this.e.nextDouble() * (var6.getBlockBoundsMaxX() - var6.getMinX() - (double)(var7 * 2.0F)) + (double)var7 + var6.getMinX(); -- double var10 = (double)var2 + this.e.nextDouble() * (var6.getBlockBoundsMaxY() - var6.getBlockBoundsMinY() - (double)(var7 * 2.0F)) + (double)var7 + var6.getBlockBoundsMinY(); -- double var12 = (double)var3 + this.e.nextDouble() * (var6.getBlockBoundsMaxZ() - var6.getBlockBoundsMinZ() - (double)(var7 * 2.0F)) + (double)var7 + var6.getBlockBoundsMinZ(); -- if(var4 == 0) { -- var10 = (double)var2 + var6.getBlockBoundsMinY() - (double)var7; -- } -- -- if(var4 == 1) { -- var10 = (double)var2 + var6.getBlockBoundsMaxY() + (double)var7; -- } -- -- if(var4 == 2) { -- var12 = (double)var3 + var6.getBlockBoundsMinZ() - (double)var7; -- } -- -- if(var4 == 3) { -- var12 = (double)var3 + var6.getBlockBoundsMaxZ() + (double)var7; -- } -- -- if(var4 == 4) { -- var8 = (double)var1 + var6.getMinX() - (double)var7; -- } -- -- if(var4 == 5) { -- var8 = (double)var1 + var6.getBlockBoundsMaxX() + (double)var7; -- } -- -- this.addEffect((new EntityDiggingFX(this.worldObj, var8, var10, var12, 0.0D, 0.0D, 0.0D, var6, this.worldObj.getBlockMetadata(var1, var2, var3))).applyColourMultiplier(var1, var2, var3).multiplyVelocity(0.2F).multipleParticleScaleBy(0.6F)); -+ double var8 = (double)par1 + this.rand.nextDouble() * (var6.getBlockBoundsMaxX() - var6.getBlockBoundsMinX() - (double)(var7 * 2.0F)) + (double)var7 + var6.getBlockBoundsMinX(); -+ double var10 = (double)par2 + this.rand.nextDouble() * (var6.getBlockBoundsMaxY() - var6.getBlockBoundsMinY() - (double)(var7 * 2.0F)) + (double)var7 + var6.getBlockBoundsMinY(); -+ double var12 = (double)par3 + this.rand.nextDouble() * (var6.getBlockBoundsMaxZ() - var6.getBlockBoundsMinZ() - (double)(var7 * 2.0F)) + (double)var7 + var6.getBlockBoundsMinZ(); -+ -+ if (par4 == 0) { -+ var10 = (double)par2 + var6.getBlockBoundsMinY() - (double)var7; -+ } -+ -+ if (par4 == 1) { -+ var10 = (double)par2 + var6.getBlockBoundsMaxY() + (double)var7; -+ } -+ -+ if (par4 == 2) { -+ var12 = (double)par3 + var6.getBlockBoundsMinZ() - (double)var7; -+ } -+ -+ if (par4 == 3) { -+ var12 = (double)par3 + var6.getBlockBoundsMaxZ() + (double)var7; -+ } -+ -+ if (par4 == 4) { -+ var8 = (double)par1 + var6.getBlockBoundsMinX() - (double)var7; -+ } -+ -+ if (par4 == 5) { -+ var8 = (double)par1 + var6.getBlockBoundsMaxX() + (double)var7; -+ } -+ -+ this.addEffect((new EntityDiggingFX(this.worldObj, var8, var10, var12, 0.0D, 0.0D, 0.0D, var6, this.worldObj.getBlockMetadata(par1, par2, par3), texture)).applyColourMultiplier(par1, par2, par3).multiplyVelocity(0.2F).multipleParticleScaleBy(0.6F)); - } - } - - public String getStatistics() { -- return "" + (this.c[0].size() + this.c[1].size() + this.c[2].size()); -+ return "" + (this.fxLayers[0].size() + this.fxLayers[1].size() + this.fxLayers[2].size()); - } - } ---- net/minecraft/src/IStatType.java -+++ net/minecraft/src/IStatType.java -@@ -1,5 +1,9 @@ - package net.minecraft.src; - - public interface IStatType { -+ -+ /** -+ * Formats a given stat for human consumption. -+ */ - String format(int var1); - } ---- /dev/null -+++ org/spoutcraft/client/packet/PacketMovementModifiers.java -@@ -1,0 +1,81 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.client.packet; -+ -+import java.io.IOException; -+ -+import net.minecraft.src.Minecraft; -+ -+import org.spoutcraft.api.io.SpoutInputStream; -+import org.spoutcraft.api.io.SpoutOutputStream; -+ -+public class PacketMovementModifiers implements SpoutPacket { -+ double gravityMod = 1; -+ double walkingMod = 1; -+ double swimmingMod = 1; -+ double jumpingMod = 1; -+ double airspeedMod = 1; -+ -+ public PacketMovementModifiers() { -+ } -+ -+ public PacketMovementModifiers(double gravity, double walking, double swimming, double jumping, double airspeed) { -+ this.gravityMod = gravity; -+ this.walkingMod = walking; -+ this.swimmingMod = swimming; -+ this.jumpingMod = jumping; -+ this.airspeedMod = airspeed; -+ } -+ -+ public void readData(SpoutInputStream input) throws IOException { -+ gravityMod = input.readDouble(); -+ walkingMod = input.readDouble(); -+ swimmingMod = input.readDouble(); -+ jumpingMod = input.readDouble(); -+ airspeedMod = input.readDouble(); -+ } -+ -+ public void writeData(SpoutOutputStream output) throws IOException { -+ output.writeDouble(gravityMod); -+ output.writeDouble(walkingMod); -+ output.writeDouble(swimmingMod); -+ output.writeDouble(jumpingMod); -+ output.writeDouble(airspeedMod); -+ } -+ -+ public void run(int playerId) { -+ Minecraft.getMinecraft().thePlayer.getData().setGravityMod(gravityMod); -+ Minecraft.getMinecraft().thePlayer.getData().setWalkingMod(walkingMod); -+ Minecraft.getMinecraft().thePlayer.getData().setSwimmingMod(swimmingMod); -+ Minecraft.getMinecraft().thePlayer.getData().setJumpingMod(jumpingMod); -+ Minecraft.getMinecraft().thePlayer.getData().setAirspeedMod(airspeedMod); -+ } -+ -+ public void failure(int playerId) { -+ } -+ -+ public PacketType getPacketType() { -+ return PacketType.PacketMovementModifiers; -+ } -+ -+ public int getVersion() { -+ return 2; -+ } -+} ---- net/minecraft/src/ChunkPosition.java -+++ net/minecraft/src/ChunkPosition.java -@@ -1,25 +1,31 @@ - package net.minecraft.src; - - public class ChunkPosition { -+ -+ /** The x coordinate of this ChunkPosition */ - public final int x; -+ -+ /** The y coordinate of this ChunkPosition */ - public final int y; -+ -+ /** The z coordinate of this ChunkPosition */ - public final int z; - -- public ChunkPosition(int var1, int var2, int var3) { -- this.x = var1; -- this.y = var2; -- this.z = var3; -- } -- -- public ChunkPosition(Vec3 var1) { -- this(MathHelper.floor_double(var1.xCoord), MathHelper.floor_double(var1.yCoord), MathHelper.floor_double(var1.zCoord)); -- } -- -- public boolean equals(Object var1) { -- if(!(var1 instanceof ChunkPosition)) { -+ public ChunkPosition(int par1, int par2, int par3) { -+ this.x = par1; -+ this.y = par2; -+ this.z = par3; -+ } -+ -+ public ChunkPosition(Vec3 par1Vec3) { -+ this(MathHelper.floor_double(par1Vec3.xCoord), MathHelper.floor_double(par1Vec3.yCoord), MathHelper.floor_double(par1Vec3.zCoord)); -+ } -+ -+ public boolean equals(Object par1Obj) { -+ if (!(par1Obj instanceof ChunkPosition)) { - return false; - } else { -- ChunkPosition var2 = (ChunkPosition)var1; -+ ChunkPosition var2 = (ChunkPosition)par1Obj; - return var2.x == this.x && var2.y == this.y && var2.z == this.z; - } - } ---- net/minecraft/src/GuiRepair.java -+++ net/minecraft/src/GuiRepair.java -@@ -1,21 +1,32 @@ - package net.minecraft.src; - - import java.util.List; -+ -+import net.minecraft.src.ItemStack; -+ - import org.lwjgl.input.Keyboard; - import org.lwjgl.opengl.GL11; - -+// Spout -+import org.spoutcraft.api.Spoutcraft; -+import org.spoutcraft.client.inventory.CraftItemStack; -+// End Spout -+ - public class GuiRepair extends GuiContainer implements ICrafting { - private static final ResourceLocation anvilGuiTextures = new ResourceLocation("textures/gui/container/anvil.png"); - private ContainerRepair repairContainer; - private GuiTextField itemNameField; - private InventoryPlayer field_82325_q; - -- public GuiRepair(InventoryPlayer var1, World var2, int var3, int var4, int var5) { -- super(new ContainerRepair(var1, var2, var3, var4, var5, Minecraft.getMinecraft().thePlayer)); -- this.field_82325_q = var1; -+ public GuiRepair(InventoryPlayer par1InventoryPlayer, World par2World, int par3, int par4, int par5) { -+ super(new ContainerRepair(par1InventoryPlayer, par2World, par3, par4, par5, Minecraft.getMinecraft().thePlayer)); -+ this.field_82325_q = par1InventoryPlayer; - this.repairContainer = (ContainerRepair)this.inventorySlots; - } - -+ /** -+ * Adds the buttons (and other controls) to the screen in question. -+ */ - public void initGui() { - super.initGui(); - Keyboard.enableRepeatEvents(true); -@@ -27,36 +38,45 @@ - this.itemNameField.setEnableBackgroundDrawing(false); - this.itemNameField.setMaxStringLength(40); - this.inventorySlots.removeCraftingFromCrafters(this); -- this.inventorySlots.onCraftGuiOpened(this); -+ this.inventorySlots.addCraftingToCrafters(this); - } - -+ /** -+ * Called when the screen is unloaded. Used to disable keyboard repeat events -+ */ - public void onGuiClosed() { - super.onGuiClosed(); - Keyboard.enableRepeatEvents(false); - this.inventorySlots.removeCraftingFromCrafters(this); - } - -- protected void drawGuiContainerForegroundLayer(int var1, int var2) { -+ /** -+ * Draw the foreground layer for the GuiContainer (everything in front of the items) -+ */ -+ protected void drawGuiContainerForegroundLayer(int par1, int par2) { - GL11.glDisable(GL11.GL_LIGHTING); - this.fontRenderer.drawString(I18n.getString("container.repair"), 60, 6, 4210752); -- if(this.repairContainer.maximumCost > 0) { -+ -+ if (this.repairContainer.maximumCost > 0) { - int var3 = 8453920; - boolean var4 = true; -- String var5 = I18n.getStringParams("container.repair.cost", new Object[]{Integer.valueOf(this.repairContainer.maximumCost)}); -- if(this.repairContainer.maximumCost >= 40 && !this.mc.thePlayer.capabilities.isCreativeMode) { -+ String var5 = I18n.getStringParams("container.repair.cost", new Object[] {Integer.valueOf(this.repairContainer.maximumCost)}); -+ -+ if (this.repairContainer.maximumCost >= 40 && !this.mc.thePlayer.capabilities.isCreativeMode) { - var5 = I18n.getString("container.repair.expensive"); - var3 = 16736352; -- } else if(!this.repairContainer.getSlot(2).getHasStack()) { -+ } else if (!this.repairContainer.getSlot(2).getHasStack()) { - var4 = false; -- } else if(!this.repairContainer.getSlot(2).canTakeStack(this.field_82325_q.player)) { -+ } else if (!this.repairContainer.getSlot(2).canTakeStack(this.field_82325_q.player)) { - var3 = 16736352; - } - -- if(var4) { -+ if (var4) { - int var6 = -16777216 | (var3 & 16579836) >> 2 | var3 & -16777216; - int var7 = this.xSize - 8 - this.fontRenderer.getStringWidth(var5); - byte var8 = 67; -- if(this.fontRenderer.getUnicodeFlag()) { -+ -+ if (this.fontRenderer.getUnicodeFlag()) { - drawRect(var7 - 3, var8 - 2, this.xSize - 7, var8 + 10, -16777216); - drawRect(var7 - 2, var8 - 1, this.xSize - 8, var8 + 9, -12895429); - } else { -@@ -72,19 +92,22 @@ - GL11.glEnable(GL11.GL_LIGHTING); - } - -- protected void keyTyped(char var1, int var2) { -- if(this.itemNameField.textboxKeyTyped(var1, var2)) { -+ /** -+ * Fired when a key is typed. This is the equivalent of KeyListener.keyTyped(KeyEvent e). -+ */ -+ protected void keyTyped(char par1, int par2) { -+ if (this.itemNameField.textboxKeyTyped(par1, par2)) { - this.func_135015_g(); - } else { -- super.keyTyped(var1, var2); -+ super.keyTyped(par1, par2); - } -- - } - - private void func_135015_g() { - String var1 = this.itemNameField.getText(); - Slot var2 = this.repairContainer.getSlot(0); -- if(var2 != null && var2.getHasStack() && !var2.getStack().hasDisplayName() && var1.equals(var2.getStack().getDisplayName())) { -+ -+ if (var2 != null && var2.getHasStack() && !var2.getStack().hasDisplayName() && var1.equals(var2.getStack().getDisplayName())) { - var1 = ""; - } - -@@ -92,45 +115,76 @@ - this.mc.thePlayer.sendQueue.addToSendQueue(new Packet250CustomPayload("MC|ItemName", var1.getBytes())); - } - -- protected void mouseClicked(int var1, int var2, int var3) { -- super.mouseClicked(var1, var2, var3); -- this.itemNameField.mouseClicked(var1, var2, var3); -+ /** -+ * Called when the mouse is clicked. -+ */ -+ protected void mouseClicked(int par1, int par2, int par3) { -+ super.mouseClicked(par1, par2, par3); -+ this.itemNameField.mouseClicked(par1, par2, par3); - } - -- public void drawScreen(int var1, int var2, float var3) { -- super.drawScreen(var1, var2, var3); -+ /** -+ * Draws the screen and all the components in it. -+ */ -+ public void drawScreen(int par1, int par2, float par3) { -+ super.drawScreen(par1, par2, par3); - GL11.glDisable(GL11.GL_LIGHTING); - this.itemNameField.drawTextBox(); - } - -- protected void drawGuiContainerBackgroundLayer(float var1, int var2, int var3) { -+ /** -+ * Draw the background layer for the GuiContainer (everything behind the items) -+ */ -+ protected void drawGuiContainerBackgroundLayer(float par1, int par2, int par3) { - GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - this.mc.getTextureManager().bindTexture(anvilGuiTextures); - int var4 = (this.width - this.xSize) / 2; - int var5 = (this.height - this.ySize) / 2; - this.drawTexturedModalRect(var4, var5, 0, 0, this.xSize, this.ySize); - this.drawTexturedModalRect(var4 + 59, var5 + 20, 0, this.ySize + (this.repairContainer.getSlot(0).getHasStack() ? 0 : 16), 110, 16); -- if((this.repairContainer.getSlot(0).getHasStack() || this.repairContainer.getSlot(1).getHasStack()) && !this.repairContainer.getSlot(2).getHasStack()) { -+ -+ if ((this.repairContainer.getSlot(0).getHasStack() || this.repairContainer.getSlot(1).getHasStack()) && !this.repairContainer.getSlot(2).getHasStack()) { - this.drawTexturedModalRect(var4 + 99, var5 + 45, this.xSize, 0, 28, 21); - } -- -- } -- -- public void updateCraftingInventory(Container var1, List var2) { -- this.sendSlotContents(var1, 0, var1.getSlot(0).getStack()); -- } -- -- public void sendSlotContents(Container var1, int var2, ItemStack var3) { -- if(var2 == 0) { -- this.itemNameField.setText(var3 == null ? "" : var3.getDisplayName()); -- this.itemNameField.setEnabled(var3 != null); -- if(var3 != null) { -+ } -+ -+ public void sendContainerAndContentsToPlayer(Container par1Container, List par2List) { -+ this.sendSlotContents(par1Container, 0, par1Container.getSlot(0).getStack()); -+ } -+ -+ /** -+ * Sends the contents of an inventory slot to the client-side Container. This doesn't have to match the actual contents -+ * of that slot. Args: Container, slot number, slot contents -+ */ -+ public void sendSlotContents(Container par1Container, int par2, ItemStack par3ItemStack) { -+ if (par2 == 0) { -+ this.itemNameField.setText(par3ItemStack == null ? "" : par3ItemStack.getDisplayName()); -+ this.itemNameField.setEnabled(par3ItemStack != null); -+ -+ // Spout -+ if (par3ItemStack != null && par3ItemStack.itemID != 318) { - this.func_135015_g(); - } -+ -+ if (par3ItemStack != null && par3ItemStack.itemID == 318) { -+ String custom, customName; -+ custom = Spoutcraft.getMaterialManager().getToolTip(new CraftItemStack(par3ItemStack)); -+ if (custom != null) { -+ String[] split = custom.split("\n"); -+ customName = split[0]; -+ this.itemNameField.setText(customName); -+ } else { -+ this.itemNameField.setText("Spout Custom Item"); -+ } -+ } -+ // End Spout - } -- -- } -- -- public void sendProgressBarUpdate(Container var1, int var2, int var3) { -- } -+ } -+ -+ /** -+ * Sends two ints to the client-side Container. Used for furnace burning time, smelting progress, brewing progress, and -+ * enchanting level. Normally the first int identifies which variable to update, and the second contains the new value. -+ * Both are truncated to shorts in non-local SMP. -+ */ -+ public void sendProgressBarUpdate(Container par1Container, int par2, int par3) {} - } ---- net/minecraft/src/PlayerSelector.java -+++ net/minecraft/src/PlayerSelector.java -@@ -10,21 +10,40 @@ - import net.minecraft.server.MinecraftServer; - - public class PlayerSelector { -- private static final Pattern a = Pattern.compile("^@([parf])(?:\\[([\\w=,!-]*)\\])?$"); -- private static final Pattern b = Pattern.compile("\\G([-!]?[\\w-]*)(?:$|,)"); -- private static final Pattern c = Pattern.compile("\\G(\\w+)=([-!]?[\\w-]*)(?:$|,)"); -- -- public static EntityPlayerMP matchOnePlayer(ICommandSender var0, String var1) { -- EntityPlayerMP[] var2 = matchPlayers(var0, var1); -+ -+ /** -+ * This matches the at-tokens introduced for command blocks, including their arguments, if any. -+ */ -+ private static final Pattern tokenPattern = Pattern.compile("^@([parf])(?:\\[([\\w=,!-]*)\\])?$"); -+ -+ /** -+ * This matches things like "-1,,4", and is used for getting x,y,z,range from the token's argument list. -+ */ -+ private static final Pattern intListPattern = Pattern.compile("\\G([-!]?[\\w-]*)(?:$|,)"); -+ -+ /** -+ * This matches things like "rm=4,c=2" and is used for handling named token arguments. -+ */ -+ private static final Pattern keyValueListPattern = Pattern.compile("\\G(\\w+)=([-!]?[\\w-]*)(?:$|,)"); -+ -+ /** -+ * Returns the one player that matches the given at-token. Returns null if more than one player matches. -+ */ -+ public static EntityPlayerMP matchOnePlayer(ICommandSender par0ICommandSender, String par1Str) { -+ EntityPlayerMP[] var2 = matchPlayers(par0ICommandSender, par1Str); - return var2 != null && var2.length == 1 ? var2[0] : null; - } - -- public static String matchPlayersAsString(ICommandSender var0, String var1) { -- EntityPlayerMP[] var2 = matchPlayers(var0, var1); -- if(var2 != null && var2.length != 0) { -+ /** -+ * Returns a nicely-formatted string listing the matching players. -+ */ -+ public static String matchPlayersAsString(ICommandSender par0ICommandSender, String par1Str) { -+ EntityPlayerMP[] var2 = matchPlayers(par0ICommandSender, par1Str); -+ -+ if (var2 != null && var2.length != 0) { - String[] var3 = new String[var2.length]; - -- for(int var4 = 0; var4 < var3.length; ++var4) { -+ for (int var4 = 0; var4 < var3.length; ++var4) { - var3[var4] = var2[var4].getTranslatedEntityName(); - } - -@@ -34,9 +53,13 @@ - } - } - -- public static EntityPlayerMP[] matchPlayers(ICommandSender var0, String var1) { -- Matcher var2 = a.matcher(var1); -- if(!var2.matches()) { -+ /** -+ * Returns an array of all players matched by the given at-token. -+ */ -+ public static EntityPlayerMP[] matchPlayers(ICommandSender par0ICommandSender, String par1Str) { -+ Matcher var2 = tokenPattern.matcher(par1Str); -+ -+ if (!var2.matches()) { - return null; - } else { - Map var3 = getArgumentMap(var2.group(2)); -@@ -47,64 +70,66 @@ - int var8 = getDefaultMaximumLevel(var4); - int var9 = getDefaultCount(var4); - int var10 = EnumGameType.NOT_SET.getID(); -- ChunkCoordinates var11 = var0.getCommandSenderPosition(); -+ ChunkCoordinates var11 = par0ICommandSender.getPlayerCoordinates(); - Map var12 = func_96560_a(var3); - String var13 = null; - String var14 = null; - boolean var15 = false; -- if(var3.containsKey("rm")) { -+ -+ if (var3.containsKey("rm")) { - var5 = MathHelper.parseIntWithDefault((String)var3.get("rm"), var5); - var15 = true; - } - -- if(var3.containsKey("r")) { -+ if (var3.containsKey("r")) { - var6 = MathHelper.parseIntWithDefault((String)var3.get("r"), var6); - var15 = true; - } - -- if(var3.containsKey("lm")) { -+ if (var3.containsKey("lm")) { - var7 = MathHelper.parseIntWithDefault((String)var3.get("lm"), var7); - } - -- if(var3.containsKey("l")) { -+ if (var3.containsKey("l")) { - var8 = MathHelper.parseIntWithDefault((String)var3.get("l"), var8); - } - -- if(var3.containsKey("x")) { -+ if (var3.containsKey("x")) { - var11.posX = MathHelper.parseIntWithDefault((String)var3.get("x"), var11.posX); - var15 = true; - } - -- if(var3.containsKey("y")) { -+ if (var3.containsKey("y")) { - var11.posY = MathHelper.parseIntWithDefault((String)var3.get("y"), var11.posY); - var15 = true; - } - -- if(var3.containsKey("z")) { -+ if (var3.containsKey("z")) { - var11.posZ = MathHelper.parseIntWithDefault((String)var3.get("z"), var11.posZ); - var15 = true; - } - -- if(var3.containsKey("m")) { -+ if (var3.containsKey("m")) { - var10 = MathHelper.parseIntWithDefault((String)var3.get("m"), var10); - } - -- if(var3.containsKey("c")) { -+ if (var3.containsKey("c")) { - var9 = MathHelper.parseIntWithDefault((String)var3.get("c"), var9); - } - -- if(var3.containsKey("team")) { -+ if (var3.containsKey("team")) { - var14 = (String)var3.get("team"); - } - -- if(var3.containsKey("name")) { -+ if (var3.containsKey("name")) { - var13 = (String)var3.get("name"); - } - -- World var16 = var15 ? var0.getEntityWorld() : null; -+ World var16 = var15 ? par0ICommandSender.getEntityWorld() : null; - List var17; -- if(!var4.equals("p") && !var4.equals("a")) { -- if(!var4.equals("r")) { -+ -+ if (!var4.equals("p") && !var4.equals("a")) { -+ if (!var4.equals("r")) { - return null; - } else { - var17 = MinecraftServer.getServer().getConfigurationManager().findPlayers(var11, var5, var6, 0, var10, var7, var8, var12, var13, var14, var16); -@@ -119,28 +144,34 @@ - } - } - -- public static Map func_96560_a(Map var0) { -+ public static Map func_96560_a(Map par0Map) { - HashMap var1 = new HashMap(); -- Iterator var2 = var0.keySet().iterator(); -+ Iterator var2 = par0Map.keySet().iterator(); - -- while(var2.hasNext()) { -+ while (var2.hasNext()) { - String var3 = (String)var2.next(); -- if(var3.startsWith("score_") && var3.length() > "score_".length()) { -+ -+ if (var3.startsWith("score_") && var3.length() > "score_".length()) { - String var4 = var3.substring("score_".length()); -- var1.put(var4, Integer.valueOf(MathHelper.parseIntWithDefault((String)var0.get(var3), 1))); -+ var1.put(var4, Integer.valueOf(MathHelper.parseIntWithDefault((String)par0Map.get(var3), 1))); - } - } - - return var1; - } - -- public static boolean matchesMultiplePlayers(String var0) { -- Matcher var1 = a.matcher(var0); -- if(var1.matches()) { -+ /** -+ * Returns whether the given pattern can match more than one player. -+ */ -+ public static boolean matchesMultiplePlayers(String par0Str) { -+ Matcher var1 = tokenPattern.matcher(par0Str); -+ -+ if (var1.matches()) { - Map var2 = getArgumentMap(var1.group(2)); - String var3 = var1.group(1); - int var4 = getDefaultCount(var3); -- if(var2.containsKey("c")) { -+ -+ if (var2.containsKey("c")) { - var4 = MathHelper.parseIntWithDefault((String)var2.get("c"), var4); - } - -@@ -150,74 +181,104 @@ - } - } - -- public static boolean hasTheseArguments(String var0, String var1) { -- Matcher var2 = a.matcher(var0); -- if(var2.matches()) { -+ /** -+ * Returns whether the given token (parameter 1) has exactly the given arguments (parameter 2). -+ */ -+ public static boolean hasTheseArguments(String par0Str, String par1Str) { -+ Matcher var2 = tokenPattern.matcher(par0Str); -+ -+ if (var2.matches()) { - String var3 = var2.group(1); -- return var1 == null || var1.equals(var3); -+ return par1Str == null || par1Str.equals(var3); - } else { - return false; - } - } - -- public static boolean hasArguments(String var0) { -- return hasTheseArguments(var0, (String)null); -- } -- -- private static final int getDefaultMinimumRange(String var0) { -- return 0; -- } -- -- private static final int getDefaultMaximumRange(String var0) { -- return 0; -- } -- -- private static final int getDefaultMaximumLevel(String var0) { -+ /** -+ * Returns whether the given token has any arguments set. -+ */ -+ public static boolean hasArguments(String par0Str) { -+ return hasTheseArguments(par0Str, (String)null); -+ } -+ -+ /** -+ * Gets the default minimum range (argument rm). -+ */ -+ private static final int getDefaultMinimumRange(String par0Str) { -+ return 0; -+ } -+ -+ /** -+ * Gets the default maximum range (argument r). -+ */ -+ private static final int getDefaultMaximumRange(String par0Str) { -+ return 0; -+ } -+ -+ /** -+ * Gets the default maximum experience level (argument l) -+ */ -+ private static final int getDefaultMaximumLevel(String par0Str) { - return Integer.MAX_VALUE; - } - -- private static final int getDefaultMinimumLevel(String var0) { -+ /** -+ * Gets the default minimum experience level (argument lm) -+ */ -+ private static final int getDefaultMinimumLevel(String par0Str) { - return 0; - } - -- private static final int getDefaultCount(String var0) { -- return var0.equals("a") ? 0 : 1; -+ /** -+ * Gets the default number of players to return (argument c, 0 for infinite) -+ */ -+ private static final int getDefaultCount(String par0Str) { -+ return par0Str.equals("a") ? 0 : 1; - } - -- private static Map getArgumentMap(String var0) { -+ /** -+ * Parses the given argument string, turning it into a HashMap<String, String> of name->value. -+ */ -+ private static Map getArgumentMap(String par0Str) { - HashMap var1 = new HashMap(); -- if(var0 == null) { -+ -+ if (par0Str == null) { - return var1; - } else { -- Matcher var2 = b.matcher(var0); -+ Matcher var2 = intListPattern.matcher(par0Str); - int var3 = 0; -- - int var4; -- for(var4 = -1; var2.find(); var4 = var2.end()) { -+ -+ for (var4 = -1; var2.find(); var4 = var2.end()) { - String var5 = null; -- switch(var3++) { -- case 0: -- var5 = "x"; -- break; -- case 1: -- var5 = "y"; -- break; -- case 2: -- var5 = "z"; -- break; -- case 3: -- var5 = "r"; -+ -+ switch (var3++) { -+ case 0: -+ var5 = "x"; -+ break; -+ -+ case 1: -+ var5 = "y"; -+ break; -+ -+ case 2: -+ var5 = "z"; -+ break; -+ -+ case 3: -+ var5 = "r"; - } - -- if(var5 != null && var2.group(1).length() > 0) { -+ if (var5 != null && var2.group(1).length() > 0) { - var1.put(var5, var2.group(1)); - } - } - -- if(var4 < var0.length()) { -- var2 = c.matcher(var4 == -1 ? var0 : var0.substring(var4)); -+ if (var4 < par0Str.length()) { -+ var2 = keyValueListPattern.matcher(var4 == -1 ? par0Str : par0Str.substring(var4)); - -- while(var2.find()) { -+ while (var2.find()) { - var1.put(var2.group(1), var2.group(2)); - } - } ---- net/minecraft/src/EntityCrit2FX.java -+++ net/minecraft/src/EntityCrit2FX.java -@@ -1,44 +1,49 @@ - package net.minecraft.src; - - public class EntityCrit2FX extends EntityFX { -+ -+ /** Entity that had been hit and done the Critical hit on. */ - private Entity theEntity; - private int currentLife; - private int maximumLife; -- private String aD; -+ private String particleName; - -- public EntityCrit2FX(World var1, Entity var2) { -- this(var1, var2, "crit"); -+ public EntityCrit2FX(World par1World, Entity par2Entity) { -+ this(par1World, par2Entity, "crit"); - } - -- public EntityCrit2FX(World var1, Entity var2, String var3) { -- super(var1, var2.posX, var2.boundingBox.minY + (double)(var2.height / 2.0F), var2.posZ, var2.motionX, var2.motionY, var2.motionZ); -- this.theEntity = var2; -+ public EntityCrit2FX(World par1World, Entity par2Entity, String par3Str) { -+ super(par1World, par2Entity.posX, par2Entity.boundingBox.minY + (double)(par2Entity.height / 2.0F), par2Entity.posZ, par2Entity.motionX, par2Entity.motionY, par2Entity.motionZ); -+ this.theEntity = par2Entity; - this.maximumLife = 3; -- this.aD = var3; -+ this.particleName = par3Str; - this.onUpdate(); - } - -- public void renderParticle(Tessellator var1, float var2, float var3, float var4, float var5, float var6, float var7) { -- } -+ public void renderParticle(Tessellator par1Tessellator, float par2, float par3, float par4, float par5, float par6, float par7) {} - -+ /** -+ * Called to update the entity's position/logic. -+ */ - public void onUpdate() { -- for(int var1 = 0; var1 < 16; ++var1) { -- double var2 = (double)(this.ab.nextFloat() * 2.0F - 1.0F); -- double var4 = (double)(this.ab.nextFloat() * 2.0F - 1.0F); -- double var6 = (double)(this.ab.nextFloat() * 2.0F - 1.0F); -- if(var2 * var2 + var4 * var4 + var6 * var6 <= 1.0D) { -+ for (int var1 = 0; var1 < 16; ++var1) { -+ double var2 = (double)(this.rand.nextFloat() * 2.0F - 1.0F); -+ double var4 = (double)(this.rand.nextFloat() * 2.0F - 1.0F); -+ double var6 = (double)(this.rand.nextFloat() * 2.0F - 1.0F); -+ -+ if (var2 * var2 + var4 * var4 + var6 * var6 <= 1.0D) { - double var8 = this.theEntity.posX + var2 * (double)this.theEntity.width / 4.0D; - double var10 = this.theEntity.boundingBox.minY + (double)(this.theEntity.height / 2.0F) + var4 * (double)this.theEntity.height / 4.0D; - double var12 = this.theEntity.posZ + var6 * (double)this.theEntity.width / 4.0D; -- this.worldObj.spawnParticle(this.aD, var8, var10, var12, var2, var4 + 0.2D, var6); -+ this.worldObj.spawnParticle(this.particleName, var8, var10, var12, var2, var4 + 0.2D, var6); - } - } - - ++this.currentLife; -- if(this.currentLife >= this.maximumLife) { -+ -+ if (this.currentLife >= this.maximumLife) { - this.setDead(); - } -- - } - - public int getFXLayer() { ---- net/minecraft/src/McoServerListUpdateTaskComparator.java -+++ net/minecraft/src/McoServerListUpdateTaskComparator.java -@@ -3,41 +3,42 @@ - import java.util.Comparator; - - class McoServerListUpdateTaskComparator implements Comparator { -- private final String b; -+ private final String field_140069_b; -+ - final McoServerListUpdateTask field_140070_a; - -- private McoServerListUpdateTaskComparator(McoServerListUpdateTask var1, String var2) { -- this.field_140070_a = var1; -- this.b = var2; -+ private McoServerListUpdateTaskComparator(McoServerListUpdateTask par1McoServerListUpdateTask, String par2Str) { -+ this.field_140070_a = par1McoServerListUpdateTask; -+ this.field_140069_b = par2Str; - } - -- public int func_140068_a(McoServer var1, McoServer var2) { -- if(var1.e.equals(var2.e)) { -- return var1.field_96408_a < var2.field_96408_a ? 1 : (var1.field_96408_a > var2.field_96408_a ? -1 : 0); -- } else if(var1.e.equals(this.b)) { -+ public int func_140068_a(McoServer par1McoServer, McoServer par2McoServer) { -+ if (par1McoServer.field_96405_e.equals(par2McoServer.field_96405_e)) { -+ return par1McoServer.field_96408_a < par2McoServer.field_96408_a ? 1 : (par1McoServer.field_96408_a > par2McoServer.field_96408_a ? -1 : 0); -+ } else if (par1McoServer.field_96405_e.equals(this.field_140069_b)) { - return -1; -- } else if(var2.e.equals(this.b)) { -+ } else if (par2McoServer.field_96405_e.equals(this.field_140069_b)) { - return 1; - } else { -- if(var1.d.equals("CLOSED") || var2.d.equals("CLOSED")) { -- if(var1.d.equals("CLOSED")) { -+ if (par1McoServer.field_96404_d.equals("CLOSED") || par2McoServer.field_96404_d.equals("CLOSED")) { -+ if (par1McoServer.field_96404_d.equals("CLOSED")) { - return 1; - } - -- if(var2.d.equals("CLOSED")) { -+ if (par2McoServer.field_96404_d.equals("CLOSED")) { - return 0; - } - } - -- return var1.field_96408_a < var2.field_96408_a ? 1 : (var1.field_96408_a > var2.field_96408_a ? -1 : 0); -+ return par1McoServer.field_96408_a < par2McoServer.field_96408_a ? 1 : (par1McoServer.field_96408_a > par2McoServer.field_96408_a ? -1 : 0); - } - } - -- public int compare(Object var1, Object var2) { -- return this.func_140068_a((McoServer)var1, (McoServer)var2); -+ public int compare(Object par1Obj, Object par2Obj) { -+ return this.func_140068_a((McoServer)par1Obj, (McoServer)par2Obj); - } - -- McoServerListUpdateTaskComparator(McoServerListUpdateTask var1, String var2, McoServerListEmptyAnon var3) { -- this(var1, var2); -+ McoServerListUpdateTaskComparator(McoServerListUpdateTask par1McoServerListUpdateTask, String par2Str, McoServerListEmptyAnon par3McoServerListEmptyAnon) { -+ this(par1McoServerListUpdateTask, par2Str); - } - } ---- /dev/null -+++ org/spoutcraft/api/material/block/GenericCustomBlock.java -@@ -1,0 +1,236 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.api.material.block; -+ -+import java.io.IOException; -+ -+import org.spoutcraft.api.block.design.BlockDesign; -+import org.spoutcraft.api.block.design.GenericBlockDesign; -+import org.spoutcraft.api.inventory.ItemStack; -+import org.spoutcraft.api.io.SpoutInputStream; -+import org.spoutcraft.api.material.Block; -+import org.spoutcraft.api.material.CustomBlock; -+import org.spoutcraft.api.material.CustomItem; -+import org.spoutcraft.api.material.MaterialData; -+import org.spoutcraft.api.material.item.GenericCustomItem; -+ -+public class GenericCustomBlock implements CustomBlock { -+ public BlockDesign design[] = new GenericBlockDesign[256]; -+ private ItemStack drop = null; -+ private String name; -+ private String fullName; -+ private int customId; -+ private String addon; -+ private CustomItem item; -+ private int blockId; -+ private boolean opaque; -+ private float hardness = 1.5F; -+ private float friction = 0.6F; -+ private int lightLevel = 0; -+ -+ /** -+ * Creates a GenericCustomBlock with no values, used for serialization purposes only. -+ */ -+ public GenericCustomBlock() { -+ } -+ -+ /** -+ * Creates a GenericCustomBlock with no model yet. -+ * -+ * @param addon creating the block -+ * @param name of the block -+ * @param isOpaque true if you want the block solid -+ */ -+ public GenericCustomBlock(String addon, String name, boolean isOpaque) { -+ this(addon, name, isOpaque, new GenericCustomItem(addon, name)); -+ } -+ -+ /** -+ * Creates a GenericCustomBlock with a specified Design and metadata -+ * -+ * @param addon creating the block -+ * @param name of the block -+ * @param isOpaque true if you want the block solid -+ * @param item to use for the block -+ */ -+ public GenericCustomBlock(String addon, String name, boolean isOpaque, CustomItem item) { -+ opaque = isOpaque; -+ this.blockId = isOpaque ? 1 :20; -+ this.addon = addon; -+ this.item = item; -+ this.name = item.getName(); -+ this.fullName = item.getFullName(); -+ this.customId = item.getCustomId(); -+ MaterialData.addCustomBlock(this); -+ this.setItemDrop(new ItemStack(this, 1)); -+ } -+ -+ /** -+ * Creates a GenericCustomBlock with a specified Design and metadata -+ * -+ * @param addon creating the block -+ * @param name of the block -+ * @param isOpaque true if you want the block solid -+ * @param design to use for the block -+ */ -+ public GenericCustomBlock(String addon, String name, boolean isOpaque, BlockDesign design) { -+ this(addon, name, isOpaque); -+ setBlockDesign(design); -+ } -+ -+ /** -+ * Creates a basic GenericCustomblock with no design that is opaque/solid. -+ * -+ * @param plugin creating the block -+ * @param name of the block -+ */ -+ public GenericCustomBlock(String addon, String name) { -+ this(addon, name, true); -+ } -+ -+ public String getName() { -+ return name; -+ } -+ -+ public void setName(String name) { -+ this.name = name; -+ if (item != null) { -+ item.setName(name); -+ } -+ } -+ -+ public BlockDesign getBlockDesign() { -+ return getBlockDesign(0); -+ } -+ -+ public CustomBlock setBlockDesign(BlockDesign design) { -+ return setBlockDesign(design, 0); -+ } -+ -+ public BlockDesign getBlockDesign(int id) { -+ return design[id + 128]; -+ } -+ -+ public CustomBlock setBlockDesign(BlockDesign design, int id) { -+ this.design[id + 128] = design; -+ return this; -+ } -+ -+ public boolean isOpaque() { -+ return opaque; -+ } -+ -+ public Block setOpaque(boolean opaque) { -+ this.opaque = opaque; -+ return this; -+ } -+ -+ public boolean hasSubtypes() { -+ return true; -+ } -+ -+ public int getCustomId() { -+ return customId; -+ } -+ -+ public String getFullName() { -+ return fullName; -+ } -+ -+ public String getNotchianName() { -+ return getName(); -+ } -+ -+ public String getAddon() { -+ return addon; -+ } -+ -+ public CustomItem getBlockItem() { -+ return item; -+ } -+ -+ public int getRawId() { -+ return this.item.getRawId(); -+ } -+ -+ public int getRawData() { -+ return this.item.getCustomId(); -+ } -+ -+ public int getBlockId() { -+ return this.blockId; -+ } -+ -+ public ItemStack getItemDrop() { -+ return drop.clone(); -+ } -+ -+ public CustomBlock setItemDrop(ItemStack item) { -+ drop = item != null ? item.clone() : null; -+ return this; -+ } -+ -+ public float getHardness() { -+ return hardness; -+ } -+ -+ public CustomBlock setHardness(float hardness) { -+ this.hardness = hardness; -+ return this; -+ } -+ -+ public float getFriction() { -+ return friction; -+ } -+ -+ public CustomBlock setFriction(float friction) { -+ this.friction = friction; -+ return this; -+ } -+ -+ public int getLightLevel() { -+ return lightLevel; -+ } -+ -+ public CustomBlock setLightLevel(int level) { -+ lightLevel = level; -+ return this; -+ } -+ -+ public void readData(SpoutInputStream input) throws IOException { -+ customId = input.readInt(); -+ setName(input.readString()); -+ String addonName = input.readString(); -+ addon = addonName; -+ fullName = addonName + "." + getName(); -+ opaque = input.readBoolean(); -+ setFriction(input.readFloat()); -+ setHardness(input.readFloat()); -+ setLightLevel(input.readInt()); -+ item = new GenericCustomItem(addon, name, customId); -+ MaterialData.addCustomBlock(this); -+ this.setItemDrop(new ItemStack(this, 1)); -+ this.blockId = isOpaque() ? 1 :20; -+ } -+ -+ public int getVersion() { -+ return 0; -+ } -+} ---- net/minecraft/src/EntitySmokeFX.java -+++ net/minecraft/src/EntitySmokeFX.java -@@ -3,64 +3,70 @@ - public class EntitySmokeFX extends EntityFX { - float smokeParticleScale; - -- public EntitySmokeFX(World var1, double var2, double var4, double var6, double var8, double var10, double var12) { -- this(var1, var2, var4, var6, var8, var10, var12, 1.0F); -+ public EntitySmokeFX(World par1World, double par2, double par4, double par6, double par8, double par10, double par12) { -+ this(par1World, par2, par4, par6, par8, par10, par12, 1.0F); - } - -- public EntitySmokeFX(World var1, double var2, double var4, double var6, double var8, double var10, double var12, float var14) { -- super(var1, var2, var4, var6, 0.0D, 0.0D, 0.0D); -- this.motionX *= (double)0.1F; -- this.motionY *= (double)0.1F; -- this.motionZ *= (double)0.1F; -- this.motionX += var8; -- this.motionY += var10; -- this.motionZ += var12; -- this.particleRed = this.particleGreen = this.particleBlue = (float)(Math.random() * (double)0.3F); -- this.particleScale *= 12.0F / 16.0F; -- this.particleScale *= var14; -+ public EntitySmokeFX(World par1World, double par2, double par4, double par6, double par8, double par10, double par12, float par14) { -+ super(par1World, par2, par4, par6, 0.0D, 0.0D, 0.0D); -+ this.motionX *= 0.10000000149011612D; -+ this.motionY *= 0.10000000149011612D; -+ this.motionZ *= 0.10000000149011612D; -+ this.motionX += par8; -+ this.motionY += par10; -+ this.motionZ += par12; -+ this.particleRed = this.particleGreen = this.particleBlue = (float)(Math.random() * 0.30000001192092896D); -+ this.particleScale *= 0.75F; -+ this.particleScale *= par14; - this.smokeParticleScale = this.particleScale; - this.particleMaxAge = (int)(8.0D / (Math.random() * 0.8D + 0.2D)); -- this.particleMaxAge = (int)((float)this.particleMaxAge * var14); -+ this.particleMaxAge = (int)((float)this.particleMaxAge * par14); - this.noClip = false; - } - -- public void renderParticle(Tessellator var1, float var2, float var3, float var4, float var5, float var6, float var7) { -- float var8 = ((float)this.particleAge + var2) / (float)this.particleMaxAge * 32.0F; -- if(var8 < 0.0F) { -+ public void renderParticle(Tessellator par1Tessellator, float par2, float par3, float par4, float par5, float par6, float par7) { -+ float var8 = ((float)this.particleAge + par2) / (float)this.particleMaxAge * 32.0F; -+ -+ if (var8 < 0.0F) { - var8 = 0.0F; - } - -- if(var8 > 1.0F) { -+ if (var8 > 1.0F) { - var8 = 1.0F; - } - - this.particleScale = this.smokeParticleScale * var8; -- super.renderParticle(var1, var2, var3, var4, var5, var6, var7); -+ super.renderParticle(par1Tessellator, par2, par3, par4, par5, par6, par7); - } - -+ /** -+ * Called to update the entity's position/logic. -+ */ - public void onUpdate() { - this.prevPosX = this.posX; - this.prevPosY = this.posY; - this.prevPosZ = this.posZ; -- if(this.particleAge++ >= this.particleMaxAge) { -+ -+ if (this.particleAge++ >= this.particleMaxAge) { - this.setDead(); - } - - this.setParticleTextureIndex(7 - this.particleAge * 8 / this.particleMaxAge); - this.motionY += 0.004D; - this.moveEntity(this.motionX, this.motionY, this.motionZ); -- if(this.posY == this.prevPosY) { -+ -+ if (this.posY == this.prevPosY) { - this.motionX *= 1.1D; - this.motionZ *= 1.1D; - } - -- this.motionX *= (double)0.96F; -- this.motionY *= (double)0.96F; -- this.motionZ *= (double)0.96F; -- if(this.onGround) { -- this.motionX *= (double)0.7F; -- this.motionZ *= (double)0.7F; -- } -+ this.motionX *= 0.9599999785423279D; -+ this.motionY *= 0.9599999785423279D; -+ this.motionZ *= 0.9599999785423279D; - -+ if (this.onGround) { -+ this.motionX *= 0.699999988079071D; -+ this.motionZ *= 0.699999988079071D; -+ } - } - } ---- /dev/null -+++ org/spoutcraft/client/packet/PacketCacheFile.java -@@ -1,0 +1,160 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.client.packet; -+ -+import java.io.File; -+import java.io.IOException; -+import java.util.zip.DataFormatException; -+import java.util.zip.Deflater; -+import java.util.zip.Inflater; -+ -+import org.apache.commons.io.FileUtils; -+import org.apache.commons.io.output.ByteArrayOutputStream; -+ -+import net.minecraft.src.EntityClientPlayerMP; -+import net.minecraft.src.Minecraft; -+import net.minecraft.src.Packet0KeepAlive; -+ -+import org.spoutcraft.api.io.SpoutInputStream; -+import org.spoutcraft.api.io.SpoutOutputStream; -+import org.spoutcraft.client.io.CustomTextureManager; -+import org.spoutcraft.client.io.FileUtil; -+ -+public class PacketCacheFile implements CompressablePacket { -+ private String plugin; -+ private byte[] fileData; -+ private String fileName; -+ private boolean compressed = false; -+ -+ public PacketCacheFile() { -+ } -+ -+ public PacketCacheFile(String plugin, File file) { -+ this.plugin = plugin; -+ try { -+ this.fileData = FileUtils.readFileToByteArray(file); -+ } catch (IOException e) { -+ e.printStackTrace(); -+ } -+ this.fileName = FileUtil.getFileName(file.getPath()); -+ } -+ -+ // TODO move to separate thread? -+ public void compress() { -+ if (!compressed) { -+ Deflater deflater = new Deflater(); -+ deflater.setInput(fileData); -+ deflater.setLevel(Deflater.BEST_COMPRESSION); -+ deflater.finish(); -+ ByteArrayOutputStream bos = new ByteArrayOutputStream(fileData.length); -+ byte[] buffer = new byte[1024]; -+ while (!deflater.finished()) { -+ int bytesCompressed = deflater.deflate(buffer); -+ bos.write(buffer, 0, bytesCompressed); -+ } -+ try { -+ bos.close(); -+ } catch (IOException e) { -+ e.printStackTrace(); -+ } -+ fileData = bos.toByteArray(); -+ compressed = true; -+ } -+ } -+ -+ public boolean isCompressed() { -+ return compressed; -+ } -+ -+ public void decompress() { -+ if (compressed) { -+ Inflater decompressor = new Inflater(); -+ decompressor.setInput(fileData); -+ -+ ByteArrayOutputStream bos = new ByteArrayOutputStream(fileData.length); -+ -+ byte[] buf = new byte[1024]; -+ while (!decompressor.finished()) { -+ try { -+ int count = decompressor.inflate(buf); -+ bos.write(buf, 0, count); -+ } catch (DataFormatException e) { -+ } -+ } -+ try { -+ bos.close(); -+ } catch (IOException e) { -+ } -+ -+ fileData = bos.toByteArray(); -+ } -+ } -+ -+ public void readData(SpoutInputStream input) throws IOException { -+ this.fileName = input.readString(); -+ this.plugin = input.readString(); -+ compressed = input.readBoolean(); -+ int size = input.readInt(); -+ this.fileData = new byte[size]; -+ input.read(fileData); -+ } -+ -+ public void writeData(SpoutOutputStream output) throws IOException { -+ output.writeString(fileName); -+ output.writeString(plugin); -+ output.writeBoolean(compressed); -+ output.writeInt(fileData.length); -+ output.write(fileData); -+ } -+ -+ public void run(int playerId) { -+ this.fileName = FileUtil.getFileName(this.fileName); -+ if (!FileUtil.canCache(fileName)) { -+ System.out.println("WARNING, " + plugin + " tried to cache an invalid file type: " + fileName); -+ return; -+ } -+ File directory = new File(FileUtil.getCacheDir(), plugin); -+ if (!directory.exists()) { -+ directory.mkdir(); -+ } -+ File cache = new File(directory, fileName); -+ try { -+ FileUtils.writeByteArrayToFile(cache, fileData); -+ } catch (IOException e) { -+ e.printStackTrace(); -+ } -+ if (cache.exists() && FileUtil.isImageFile(fileName)) { -+ CustomTextureManager.getTextureFromUrl(plugin, fileName); -+ } -+ ((EntityClientPlayerMP)Minecraft.getMinecraft().thePlayer).sendQueue.addToSendQueue(new Packet0KeepAlive()); -+ } -+ -+ public void failure(int playerId) { -+ // TODO Auto-generated method stub -+ } -+ -+ public PacketType getPacketType() { -+ return PacketType.PacketCacheFile; -+ } -+ -+ public int getVersion() { -+ return 1; -+ } -+} ---- net/minecraft/src/EntityZombieGroupData.java -+++ net/minecraft/src/EntityZombieGroupData.java -@@ -3,17 +3,18 @@ - class EntityZombieGroupData implements EntityLivingData { - public boolean field_142048_a; - public boolean field_142046_b; -+ - final EntityZombie field_142047_c; - -- private EntityZombieGroupData(EntityZombie var1, boolean var2, boolean var3) { -- this.field_142047_c = var1; -+ private EntityZombieGroupData(EntityZombie par1EntityZombie, boolean par2, boolean par3) { -+ this.field_142047_c = par1EntityZombie; - this.field_142048_a = false; - this.field_142046_b = false; -- this.field_142048_a = var2; -- this.field_142046_b = var3; -+ this.field_142048_a = par2; -+ this.field_142046_b = par3; - } - -- EntityZombieGroupData(EntityZombie var1, boolean var2, boolean var3, EntityZombieINNER1 var4) { -- this(var1, var2, var3); -+ EntityZombieGroupData(EntityZombie par1EntityZombie, boolean par2, boolean par3, EntityZombieINNER1 par4EntityZombieINNER1) { -+ this(par1EntityZombie, par2, par3); - } - } ---- net/minecraft/src/ModelSlime.java -+++ net/minecraft/src/ModelSlime.java -@@ -1,16 +1,25 @@ - package net.minecraft.src; - - public class ModelSlime extends ModelBase { -+ -+ /** The slime's bodies, both the inside box and the outside box */ - ModelRenderer slimeBodies; -+ -+ /** The slime's right eye */ - ModelRenderer slimeRightEye; -+ -+ /** The slime's left eye */ - ModelRenderer slimeLeftEye; -+ -+ /** The slime's mouth */ - ModelRenderer slimeMouth; - -- public ModelSlime(int var1) { -- this.slimeBodies = new ModelRenderer(this, 0, var1); -+ public ModelSlime(int par1) { -+ this.slimeBodies = new ModelRenderer(this, 0, par1); - this.slimeBodies.addBox(-4.0F, 16.0F, -4.0F, 8, 8, 8); -- if(var1 > 0) { -- this.slimeBodies = new ModelRenderer(this, 0, var1); -+ -+ if (par1 > 0) { -+ this.slimeBodies = new ModelRenderer(this, 0, par1); - this.slimeBodies.addBox(-3.0F, 17.0F, -3.0F, 6, 6, 6); - this.slimeRightEye = new ModelRenderer(this, 32, 0); - this.slimeRightEye.addBox(-3.25F, 18.0F, -3.5F, 2, 2, 2); -@@ -19,17 +28,19 @@ - this.slimeMouth = new ModelRenderer(this, 32, 8); - this.slimeMouth.addBox(0.0F, 21.0F, -3.5F, 1, 1, 1); - } -- - } - -- public void render(Entity var1, float var2, float var3, float var4, float var5, float var6, float var7) { -- this.setRotationAngles(var2, var3, var4, var5, var6, var7, var1); -- this.slimeBodies.render(var7); -- if(this.slimeRightEye != null) { -- this.slimeRightEye.render(var7); -- this.slimeLeftEye.render(var7); -- this.slimeMouth.render(var7); -- } -+ /** -+ * Sets the models various rotation angles then renders the model. -+ */ -+ public void render(Entity par1Entity, float par2, float par3, float par4, float par5, float par6, float par7) { -+ this.setRotationAngles(par2, par3, par4, par5, par6, par7, par1Entity); -+ this.slimeBodies.render(par7); - -+ if (this.slimeRightEye != null) { -+ this.slimeRightEye.render(par7); -+ this.slimeLeftEye.render(par7); -+ this.slimeMouth.render(par7); -+ } - } - } ---- net/minecraft/src/LongHashMapEntry.java -+++ net/minecraft/src/LongHashMapEntry.java -@@ -1,16 +1,24 @@ - package net.minecraft.src; - - class LongHashMapEntry { -+ -+ /** -+ * the key as a long (for playerInstances it is the x in the most significant 32 bits and then y) -+ */ - final long key; -- Object b; -+ -+ /** the value held by the hash at the specified key */ -+ Object value; -+ -+ /** the next hashentry in the table */ - LongHashMapEntry nextEntry; - final int hash; - -- LongHashMapEntry(int var1, long var2, Object var4, LongHashMapEntry var5) { -- this.b = var4; -- this.nextEntry = var5; -- this.key = var2; -- this.hash = var1; -+ LongHashMapEntry(int par1, long par2, Object par4Obj, LongHashMapEntry par5LongHashMapEntry) { -+ this.value = par4Obj; -+ this.nextEntry = par5LongHashMapEntry; -+ this.key = par2; -+ this.hash = par1; - } - - public final long getKey() { -@@ -18,20 +26,22 @@ - } - - public final Object getValue() { -- return this.b; -+ return this.value; - } - -- public final boolean equals(Object var1) { -- if(!(var1 instanceof LongHashMapEntry)) { -+ public final boolean equals(Object par1Obj) { -+ if (!(par1Obj instanceof LongHashMapEntry)) { - return false; - } else { -- LongHashMapEntry var2 = (LongHashMapEntry)var1; -+ LongHashMapEntry var2 = (LongHashMapEntry)par1Obj; - Long var3 = Long.valueOf(this.getKey()); - Long var4 = Long.valueOf(var2.getKey()); -- if(var3 == var4 || var3 != null && var3.equals(var4)) { -+ -+ if (var3 == var4 || var3 != null && var3.equals(var4)) { - Object var5 = this.getValue(); - Object var6 = var2.getValue(); -- if(var5 == var6 || var5 != null && var5.equals(var6)) { -+ -+ if (var5 == var6 || var5 != null && var5.equals(var6)) { - return true; - } - } ---- /dev/null -+++ com/prupe/mcpatcher/ctm/TileOverrideImpl$HorizontalVertical.java -@@ -1,0 +1,62 @@ -+package com.prupe.mcpatcher.ctm; -+ -+import com.prupe.mcpatcher.TileLoader; -+import com.prupe.mcpatcher.ctm.TileOverrideImpl$Horizontal; -+import java.util.Properties; -+import net.minecraft.src.Block; -+import net.minecraft.src.IBlockAccess; -+import net.minecraft.src.Icon; -+import net.minecraft.src.ResourceLocation; -+ -+final class TileOverrideImpl$HorizontalVertical extends TileOverrideImpl$Horizontal { -+ private static final int[] neighborMap = new int[] {3, 3, 6, 3, 3, 3, 3, 3, 3, 3, 6, 3, 3, 3, 3, 3, 4, 4, 5, 4, 4, 4, 4, 4, 3, 3, 6, 3, 3, 3, 3, 3, 3, 3, 6, 3, 3, 3, 3, 3, 3, 3, 6, 3, 3, 3, 3, 3, 3, 3, 6, 3, 3, 3, 3, 3, 3, 3, 6, 3, 3, 3, 3, 3}; -+ -+ TileOverrideImpl$HorizontalVertical(ResourceLocation filePrefix, Properties properties, TileLoader tileLoader) { -+ super(filePrefix, properties, tileLoader); -+ } -+ -+ String getMethod() { -+ return "horizontal+vertical"; -+ } -+ -+ String checkTileMap() { -+ return this.getNumberOfTiles() == 7 ? null : "requires exactly 7 tiles"; -+ } -+ -+ Icon getTileImpl(IBlockAccess blockAccess, Block block, Icon origIcon, int i, int j, int k, int face) { -+ Icon icon = super.getTileImpl(blockAccess, block, origIcon, i, j, k, face); -+ -+ if (icon != this.icons[3]) { -+ return icon; -+ } else { -+ int[][] offsets = NEIGHBOR_OFFSET[face]; -+ int neighborBits = 0; -+ -+ if (this.shouldConnect(blockAccess, block, origIcon, i, j, k, face, offsets[this.rotateUV(1)])) { -+ neighborBits |= 1; -+ } -+ -+ if (this.shouldConnect(blockAccess, block, origIcon, i, j, k, face, offsets[this.rotateUV(2)])) { -+ neighborBits |= 2; -+ } -+ -+ if (this.shouldConnect(blockAccess, block, origIcon, i, j, k, face, offsets[this.rotateUV(3)])) { -+ neighborBits |= 4; -+ } -+ -+ if (this.shouldConnect(blockAccess, block, origIcon, i, j, k, face, offsets[this.rotateUV(5)])) { -+ neighborBits |= 8; -+ } -+ -+ if (this.shouldConnect(blockAccess, block, origIcon, i, j, k, face, offsets[this.rotateUV(6)])) { -+ neighborBits |= 16; -+ } -+ -+ if (this.shouldConnect(blockAccess, block, origIcon, i, j, k, face, offsets[this.rotateUV(7)])) { -+ neighborBits |= 32; -+ } -+ -+ return this.icons[neighborMap[neighborBits]]; -+ } -+ } -+} ---- /dev/null -+++ org/bukkit/ChatColor.java -@@ -1,0 +1,252 @@ -+package org.bukkit; -+ -+import java.util.HashMap; -+import java.util.Map; -+import java.util.regex.Pattern; -+ -+/** -+ * All supported color values for chat -+ */ -+public enum ChatColor { -+ /** -+ * Represents black -+ */ -+ BLACK('0', 0x00), -+ /** -+ * Represents dark blue -+ */ -+ DARK_BLUE('1', 0x1), -+ /** -+ * Represents dark green -+ */ -+ DARK_GREEN('2', 0x2), -+ /** -+ * Represents dark blue (aqua) -+ */ -+ DARK_AQUA('3', 0x3), -+ /** -+ * Represents dark red -+ */ -+ DARK_RED('4', 0x4), -+ /** -+ * Represents dark purple -+ */ -+ DARK_PURPLE('5', 0x5), -+ /** -+ * Represents gold -+ */ -+ GOLD('6', 0x6), -+ /** -+ * Represents gray -+ */ -+ GRAY('7', 0x7), -+ /** -+ * Represents dark gray -+ */ -+ DARK_GRAY('8', 0x8), -+ /** -+ * Represents blue -+ */ -+ BLUE('9', 0x9), -+ /** -+ * Represents green -+ */ -+ GREEN('a', 0xA), -+ /** -+ * Represents aqua -+ */ -+ AQUA('b', 0xB), -+ /** -+ * Represents red -+ */ -+ RED('c', 0xC), -+ /** -+ * Represents light purple -+ */ -+ LIGHT_PURPLE('d', 0xD), -+ /** -+ * Represents yellow -+ */ -+ YELLOW('e', 0xE), -+ /** -+ * Represents white -+ */ -+ WHITE('f', 0xF), -+ /** -+ * Represents magical characters that change around randomly -+ */ -+ MAGIC('k', 0x10, true), -+ /** -+ * Makes the text bold. -+ */ -+ BOLD('l', 0x11, true), -+ /** -+ * Makes a line appear through the text. -+ */ -+ STRIKETHROUGH('m', 0x12, true), -+ /** -+ * Makes the text appear underlined. -+ */ -+ UNDERLINE('n', 0x13, true), -+ /** -+ * Makes the text italic. -+ */ -+ ITALIC('o', 0x14, true), -+ /** -+ * Resets all previous chat colors or formats. -+ */ -+ RESET('r', 0x15); -+ -+ /** -+ * The special character which prefixes all chat colour codes. Use this if you need to dynamically -+ * convert colour codes from your custom format. -+ */ -+ public static final char COLOR_CHAR = '\u00A7'; -+ private static final Pattern STRIP_COLOR_PATTERN = Pattern.compile("(?i)" + String.valueOf(COLOR_CHAR) + "[0-9A-FK-OR]"); -+ -+ private final int intCode; -+ private final char code; -+ private final boolean isFormat; -+ private final String toString; -+ private final static Map BY_ID = new HashMap(); -+ private final static Map BY_CHAR = new HashMap(); -+ -+ private ChatColor(char code, int intCode) { -+ this(code, intCode, false); -+ } -+ -+ private ChatColor(char code, int intCode, boolean isFormat) { -+ this.code = code; -+ this.intCode = intCode; -+ this.isFormat = isFormat; -+ this.toString = new String(new char[] {COLOR_CHAR, code}); -+ } -+ -+ /** -+ * Gets the char value associated with this color -+ * -+ * @return A char value of this color code -+ */ -+ public char getChar() { -+ return code; -+ } -+ -+ @Override -+ public String toString() { -+ return toString; -+ } -+ -+ /** -+ * Checks if this code is a format code as opposed to a color code. -+ */ -+ public boolean isFormat() { -+ return isFormat; -+ } -+ -+ /** -+ * Checks if this code is a color code as opposed to a format code. -+ */ -+ public boolean isColor() { -+ return !isFormat && this != RESET; -+ } -+ -+ /** -+ * Gets the color represented by the specified color code -+ * -+ * @param code Code to check -+ * @return Associative {@link org.bukkit.ChatColor} with the given code, or null if it doesn't exist -+ */ -+ public static ChatColor getByChar(char code) { -+ return BY_CHAR.get(code); -+ } -+ -+ /** -+ * Gets the color represented by the specified color code -+ * -+ * @param code Code to check -+ * @return Associative {@link org.bukkit.ChatColor} with the given code, or null if it doesn't exist -+ */ -+ public static ChatColor getByChar(String code) { -+ return BY_CHAR.get(code.charAt(0)); -+ } -+ -+ /** -+ * Strips the given message of all color codes -+ * -+ * @param input String to strip of color -+ * @return A copy of the input string, without any coloring -+ */ -+ public static String stripColor(final String input) { -+ if (input == null) { -+ return null; -+ } -+ -+ return STRIP_COLOR_PATTERN.matcher(input).replaceAll(""); -+ } -+ -+ /** -+ * Gets the color represented by the specified color code -+ * -+ * @param code Code to check -+ * @return Associative color with the given code, or null if it doesn't exist -+ */ -+ public static ChatColor getByCode(final int code) { -+ return BY_ID.get(code); -+ } -+ -+ /** -+ * Translates a string using an alternate color code character into a string that uses the internal -+ * ChatColor.COLOR_CODE color code character. The alternate color code character will only be replaced -+ * if it is immediately followed by 0-9, A-F, or a-f. -+ * -+ * @param altColorChar The alternate color code character to replace. Ex: & -+ * @param textToTranslate Text containing the alternate color code character. -+ * @return Text containing the ChatColor.COLOR_CODE color code character. -+ */ -+ public static String translateAlternateColorCodes(char altColorChar, String textToTranslate) { -+ char[] b = textToTranslate.toCharArray(); -+ for (int i = 0; i < b.length - 1; i++) { -+ if (b[i] == altColorChar && "0123456789AaBbCcDdEeFfKkLlMmNnOoRr".indexOf(b[i+1]) > -1) { -+ b[i] = ChatColor.COLOR_CHAR; -+ b[i+1] = Character.toLowerCase(b[i+1]); -+ } -+ } -+ return new String(b); -+ } -+ -+ /** -+ * Gets the ChatColors used at the end of the given input string. -+ * -+ * @param input Input string to retrieve the colors from. -+ * @return Any remaining ChatColors to pass onto the next line. -+ */ -+ public static String getLastColors(String input) { -+ String result = ""; -+ int lastIndex = -1; -+ int length = input.length(); -+ -+ while ((lastIndex = input.indexOf(COLOR_CHAR, lastIndex + 1)) != -1) { -+ if (lastIndex < length - 1) { -+ char c = input.charAt(lastIndex + 1); -+ ChatColor col = getByChar(c); -+ -+ if (col != null) { -+ if (col.isColor()) { -+ result = col.toString(); -+ } else if (col.isFormat()) { -+ result += col.toString(); -+ } -+ } -+ } -+ } -+ -+ return result; -+ } -+ -+ static { -+ for (ChatColor color : values()) { -+ BY_ID.put(color.intCode, color); -+ BY_CHAR.put(color.code, color); -+ } -+ } -+} ---- /dev/null -+++ org/spoutcraft/api/gui/GenericComboBox.java -@@ -1,0 +1,379 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.api.gui; -+ -+import java.io.IOException; -+import java.util.ArrayList; -+import java.util.Collections; -+import java.util.List; -+ -+import org.apache.commons.lang3.StringUtils; -+ -+import org.spoutcraft.api.Spoutcraft; -+import org.spoutcraft.api.io.SpoutInputStream; -+ -+public class GenericComboBox extends GenericButton implements ComboBox { -+ private List items = new ArrayList(); -+ private ComboBoxModel model; -+ private final GenericListView view; -+ private Screen screen; -+ private boolean open = false; -+ private String format = "%text%: %selected%"; -+ -+ public GenericComboBox() { -+ model = new ComboBoxModel(); -+ view = new ComboBoxView(model, this); -+ view.setSelection(0); -+ view.setVisible(false); -+ } -+ -+ public GenericComboBox(ComboBoxModel model) { -+ this.model = model; -+ view = new ComboBoxView(model, this); -+ view.setSelection(0); -+ view.setVisible(false); -+ } -+ -+ public WidgetType getType() { -+ return WidgetType.ComboBox; -+ } -+ -+ public void render() { -+ setAlign(WidgetAnchor.TOP_LEFT); -+ Spoutcraft.getRenderDelegate().render(this); -+ } -+ -+ public ComboBox setItems(List items) { -+ this.items = items; -+ model.setList(items); -+ setSelection(0); -+ return this; -+ } -+ -+ public List getItems() { -+ return Collections.unmodifiableList(items); -+ } -+ -+ public ComboBox openList() { -+ if (open) { -+ return this; -+ } -+ open = true; -+ screen = getScreen(); -+ while (!(screen instanceof GenericScreen)) { -+ if (screen.getScreen() != null) { -+ screen = screen.getScreen(); -+ } else { -+ break; -+ } -+ } -+ -+ screen.attachWidget(getAddon(), view); -+ view.setVisible(true); -+ view.setPriority(RenderPriority.Lowest); // Makes it the top-most widget -+ view.setFocus(true); -+ view.setSelection(view.getSelectedRow()); -+ return this; -+ } -+ -+ public ComboBox closeList() { -+ if (!open) { -+ return this; -+ } -+ open = false; -+ view.setVisible(false); -+ screen.removeWidget(view); -+ return this; -+ } -+ -+ public boolean isOpen() { -+ return open; -+ } -+ -+ public String getSelectedItem() { -+ ComboBoxItem item = model.getItem(view.getSelectedRow()); -+ return item == null ? "" : item.getText(); -+ } -+ -+ public int getSelectedRow() { -+ return view.getSelectedRow(); -+ } -+ -+ public void onSelectionChanged(int i, String text) {} -+ -+ @Override -+ public String getText() { -+ if (StringUtils.isEmpty(super.getText())) { -+ return getSelectedItem(); -+ } else { -+ String text = format.replaceAll("%text%", super.getText()).replaceAll("%selected%", getSelectedItem()); -+ return text; -+ } -+ } -+ -+ @Override -+ public void onButtonClick() { -+ setOpen(!isOpen()); -+ super.onButtonClick(); -+ } -+ -+ public ComboBox setSelection(int row) { -+ view.setSelection(row); -+ return this; -+ } -+ -+ @Override -+ public Widget setScreen(String addon, Screen screen) { -+ super.setScreen(addon, screen); -+ if (screen == null) { -+ return this; -+ } -+ -+ screen = getScreen(); -+ while (!(screen instanceof GenericScreen)) { -+ if (screen.getScreen() != null) { -+ screen = screen.getScreen(); -+ } else { -+ break; -+ } -+ } -+ -+ screen.attachWidget(addon, view); -+ -+ return this; -+ } -+ -+ @Override -+ public Widget setScreen(Screen screen) { -+ return setScreen(null, screen); -+ } -+ -+ @Override -+ public void readData(SpoutInputStream input) throws IOException { -+ super.readData(input); -+ view.setSelection(input.readInt()); -+ int count = input.readInt(); -+ items.clear(); -+ for (int i = 0; i < count; i++) { -+ String item = input.readString(); -+ items.add(item); -+ } -+ model.setList(items); -+ format = input.readString(); -+ } -+ -+ @Override -+ public int getVersion() { -+ return super.getVersion() + 1; -+ } -+ -+ protected class ComboBoxModel extends AbstractListModel { -+ List list = new ArrayList(); -+ List items = new ArrayList(); -+ -+ public void setList(List list) { -+ this.list = list; -+ updateItems(); -+ } -+ -+ private void updateItems() { -+ items.clear(); -+ for (String l:list) { -+ ComboBoxItem item = new ComboBoxItem(this); -+ item.setTitle(l); -+ items.add(item); -+ } -+ } -+ -+ @Override -+ public ComboBoxItem getItem(int row) { -+ if (row < 0 || row >= getSize()) { -+ return null; -+ } -+ return items.get(row); -+ } -+ -+ @Override -+ public int getSize() { -+ return items.size(); -+ } -+ -+ @Override -+ public void onSelected(int item, boolean doubleClick) { -+ } -+ -+ public void handleClick(ComboBoxItem comboBoxItem) { -+ int i = items.indexOf(comboBoxItem); -+ onSelectionChanged(i, getItem(i).getText()); -+ closeList(); -+ } -+ -+ public boolean isLast(ComboBoxItem comboBoxItem) { -+ return items.indexOf(comboBoxItem) == items.size() - 1; -+ } -+ } -+ -+ public class ComboBoxItem implements ListWidgetItem { -+ private String text; -+ private ListWidget widget; -+ private ComboBoxModel model; -+ private GenericGradient gradient = new GenericGradient(); -+ -+ public ComboBoxItem(ComboBoxModel model) { -+ this.model = model; -+ } -+ -+ public void setListWidget(ListWidget widget) { -+ this.widget = widget; -+ } -+ -+ public ListWidget getListWidget() { -+ return widget; -+ } -+ -+ public int getHeight() { -+ return 11; -+ } -+ -+ public void render(int x, int y, int width, int height) { -+ gradient.setX(x).setY(y).setWidth(width).setHeight(height); -+ gradient.setTopColor(new Color(0.6f,0.6f,0.6f,0.5f)).setBottomColor(new Color(0.6f,0.6f,0.6f,0f)); -+ gradient.setOrientation(Orientation.VERTICAL); -+ Spoutcraft.getRenderDelegate().render(gradient); -+ Spoutcraft.getRenderDelegate().getMinecraftFont().drawString(text, x+2, y+2, 0xffffffff); -+ } -+ -+ public void onClick(int x, int y, boolean doubleClick) { -+ if (x != -1) { -+ model.handleClick(this); -+ } else if (doubleClick) { -+ model.handleClick(this); -+ } -+ } -+ -+ public String getText() { -+ return text; -+ } -+ -+ public void setTitle(String title) { -+ this.text = title; -+ } -+ } -+ -+ public class ComboBoxView extends GenericListView { -+ GenericComboBox combo; -+ public ComboBoxView(AbstractListModel model, GenericComboBox box) { -+ super(model); -+ combo = box; -+ setBackgroundColor(new Color(0.5f,0.5f,0.5f,0.9f)); -+ } -+ -+ @Override -+ public String getTooltip() { -+ if (!super.getTooltip().equals("")) { -+ return super.getTooltip(); -+ } -+ return null; -+ } -+ -+ @Override -+ public double getWidth() { -+ setWidth((int) combo.getWidth()); -+ return combo.getWidth(); -+ } -+ -+ @Override -+ public double getHeight() { -+ int a = getAvailableHeight(false) - 5; -+ if (a < 30) { -+ a = getAvailableHeight(true) - 5; -+ } -+ double res = Math.min(a, getInnerSize(Orientation.VERTICAL)); -+ setHeight((int) res); -+ return res; -+ } -+ -+ @Override -+ public int getX() { -+ return (int) combo.getActualX(); -+ } -+ -+ @Override -+ public int getY() { -+ int h = (int) getHeight(); -+ int a = getAvailableHeight(false); -+ if (a < 30) { -+ return (int) (combo.getActualY()-h); -+ } else { -+ return (int) (combo.getActualY() + combo.getHeight()); -+ } -+ } -+ -+ @Override -+ public double getActualX() { -+ setX(getX()); -+ return super.getActualX(); -+ } -+ -+ @Override -+ public double getActualY() { -+ setY(getY()); -+ return super.getActualY(); -+ } -+ -+ protected int getAvailableHeight(boolean top) { -+ if (!top) { -+ return (int) (Spoutcraft.getClient().getRenderDelegate().getScreenHeight() - combo.getActualY() - combo.getHeight() - 5); -+ } else { -+ return (int) (combo.getActualY() - 5); -+ } -+ } -+ -+ public GenericComboBox getComboBox() { -+ return combo; -+ } -+ } -+ -+ public ComboBox setOpen(boolean open) { -+ if (open) { -+ openList(); -+ } else { -+ closeList(); -+ } -+ return this; -+ } -+ -+ @Override -+ public Control setFocus(boolean focus) { -+ if (!focus && !view.isFocus() && isOpen()) { -+ closeList(); -+ } -+ return super.setFocus(focus); -+ } -+ -+ public String getFormat() { -+ return format; -+ } -+ -+ public ComboBox setFormat(String format) { -+ this.format = format; -+ return this; -+ } -+} ---- /dev/null -+++ net/minecraft/src/Particle.java -@@ -1,0 +1,59 @@ -+package net.minecraft.src; -+ -+import java.util.Random; -+ -+public class Particle { -+ private static Random rand = new Random(); -+ public double posX; -+ public double posY; -+ public double prevPosX; -+ public double prevPosY; -+ public double velocityX; -+ public double velocityY; -+ public double accelScale; -+ public boolean isDead; -+ public int timeTick; -+ public int timeLimit; -+ public double tintRed; -+ public double tintGreen; -+ public double tintBlue; -+ public double tintAlpha; -+ public double prevTintRed; -+ public double prevTintGreen; -+ public double prevTintBlue; -+ public double prevTintAlpha; -+ -+ public void update(GuiParticle par1GuiParticle) { -+ this.posX += this.velocityX; -+ this.posY += this.velocityY; -+ this.velocityX *= this.accelScale; -+ this.velocityY *= this.accelScale; -+ this.velocityY += 0.1D; -+ -+ if (++this.timeTick > this.timeLimit) { -+ this.setDead(); -+ } -+ -+ this.tintAlpha = 2.0D - (double)this.timeTick / (double)this.timeLimit * 2.0D; -+ -+ if (this.tintAlpha > 1.0D) { -+ this.tintAlpha = 1.0D; -+ } -+ -+ this.tintAlpha *= this.tintAlpha; -+ this.tintAlpha *= 0.5D; -+ } -+ -+ public void preUpdate() { -+ this.prevTintRed = this.tintRed; -+ this.prevTintGreen = this.tintGreen; -+ this.prevTintBlue = this.tintBlue; -+ this.prevTintAlpha = this.tintAlpha; -+ this.prevPosX = this.posX; -+ this.prevPosY = this.posY; -+ } -+ -+ public void setDead() { -+ this.isDead = true; -+ } -+} ---- /dev/null -+++ org/spoutcraft/api/animation/Animation.java -@@ -1,0 +1,253 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.api.animation; -+ -+import java.util.Timer; -+import java.util.TimerTask; -+ -+public class Animation { -+ public enum Direction { -+ FORWARD(1), -+ BACKWARD(-1); -+ -+ public final double modifier; -+ -+ private Direction(double mod) { -+ this.modifier = mod; -+ } -+ } -+ -+ public enum State { -+ STOPPED, -+ PAUSED, -+ RUNNING; -+ } -+ -+ private Animatable startValue = null, endValue = null; -+ private Number startNumber = null, endNumber = null; -+ -+ private int duration; -+ -+ int currentTime; -+ private Direction direction = Direction.FORWARD; -+ private State state = State.STOPPED; -+ private AnimationProgress animationProgress = new LinearAnimationProgress(); -+ private ValueSetDelegate property; -+ private static Timer timer = new Timer(); -+ private int delay = 1000 / 60; -+ -+ private AnimationRunnable animator = new AnimationRunnable(this); -+ -+ public State getState() { -+ return state; -+ } -+ -+ public Animatable getStartValue() { -+ return startValue; -+ } -+ -+ public void setStartValue(Animatable startValue) { -+ this.startValue = startValue; -+ } -+ -+ public Animatable getEndValue() { -+ return endValue; -+ } -+ -+ public void setEndValue(Animatable endValue) { -+ this.endValue = endValue; -+ } -+ -+ public int getDuration() { -+ return duration; -+ } -+ -+ public void setDuration(int duration) { -+ this.duration = duration; -+ } -+ -+ public int getCurrentTime() { -+ return currentTime; -+ } -+ -+ public void setCurrentTime(int currentTime) { -+ this.currentTime = currentTime; -+ } -+ -+ public Direction getDirection() { -+ return direction; -+ } -+ -+ public void setDirection(Direction direction) { -+ this.direction = direction; -+ } -+ -+ public void setAnimationProgress(AnimationProgress animationProgress) { -+ this.animationProgress = animationProgress; -+ } -+ -+ public AnimationProgress getAnimationProgress() { -+ return animationProgress; -+ } -+ -+ public void start() { -+ this.state = State.RUNNING; -+ switch (direction) { -+ case FORWARD: -+ currentTime = 0; -+ break; -+ case BACKWARD: -+ currentTime = duration; -+ break; -+ } -+ timer.schedule(animator, delay, delay); -+ } -+ -+ public void pause() { -+ this.state = State.PAUSED; -+ animator.cancel(); -+ } -+ -+ public void resume() { -+ if (this.state == State.PAUSED) { -+ this.state = State.RUNNING; -+ timer.schedule(animator, delay, delay); -+ } -+ } -+ -+ public void stop() { -+ this.state = State.STOPPED; -+ switch (direction) { -+ case FORWARD: -+ this.currentTime = duration; -+ break; -+ case BACKWARD: -+ this.currentTime = 0; -+ break; -+ } -+ animator.cancel(); -+ if (startValue != null) { -+ property.set(getCurrentValue()); -+ } else { -+ property.set(getCurrentValueNumber()); -+ } -+ } -+ -+ public Animatable getCurrentValue() { -+ return startValue.getValueAt(getAnimationProgress().getValueAt((double) currentTime / (double) duration), startValue, endValue); -+ } -+ -+ public void setValueDelegate(ValueSetDelegate property) { -+ this.property = property; -+ } -+ -+ public ValueSetDelegate getValueDelegate() { -+ return property; -+ } -+ -+ public void setStartNumber(Number startNumber) { -+ this.startNumber = startNumber; -+ } -+ -+ public Number getStartNumber() { -+ return startNumber; -+ } -+ -+ public void setEndNumber(Number endNumber) { -+ this.endNumber = endNumber; -+ } -+ -+ public Number getEndNumber() { -+ return endNumber; -+ } -+ -+ public void setFramesPerSecond(int fps) { -+ delay = 1000 / fps; -+ } -+ -+ private class AnimationRunnable extends TimerTask { -+ public Animation animation; -+ -+ public AnimationRunnable(Animation ani) { -+ animation = ani; -+ } -+ -+ @Override -+ public void run() { -+ try { -+ if (animation.getState() != Animation.State.RUNNING) { -+ cancel(); -+ return; -+ } -+ int time = animation.getCurrentTime(); -+ time += delay * animation.getDirection().modifier; // For the direction -+ if (time >= animation.getDuration() && animation.getDirection() == Direction.FORWARD) { -+ animation.stop(); -+ time = animation.getDuration(); -+ } -+ if (time <= 0 && animation.getDirection() == Direction.BACKWARD) { -+ animation.stop(); -+ time = 0; -+ } -+ animation.setCurrentTime(time); -+ if (startNumber == null) { -+ Animatable value = animation.getCurrentValue(); -+ animation.getValueDelegate().set(value); -+ } else { -+ Number value = animation.getCurrentValueNumber(); -+ animation.getValueDelegate().set(value); -+ } -+ } catch (Exception e) { -+ e.printStackTrace(); -+ animation.state = Animation.State.STOPPED; -+ cancel(); -+ } -+ } -+ } -+ -+ public Number getCurrentValueNumber() { -+ double p = (double) currentTime / (double) duration; -+ if (startNumber instanceof Integer) { -+ int p1 = (Integer) startNumber, p2 = (Integer) endNumber; -+ return (int) (p1 + (p2 - p1)*p); -+ } -+ if (startNumber instanceof Double) { -+ double p1 = (Double) startNumber, p2 = (Double) endNumber; -+ return p1 + (p2 - p1)*p; -+ } -+ if (startNumber instanceof Long) { -+ long p1 = (Long) startNumber, p2 = (Long) endNumber; -+ return (long) (p1 + (p2 - p1)*p); -+ } -+ if (startNumber instanceof Float) { -+ float p1 = (Float) startNumber, p2 = (Float) endNumber; -+ return (float) (p1 + (p2 - p1)*p); -+ } -+ if (startNumber instanceof Short) { -+ short p1 = (Short) startNumber, p2 = (Short) endNumber; -+ return (short) (p1 + (p2 - p1)*p); -+ } -+ if (startNumber instanceof Byte) { -+ byte p1 = (Byte) startNumber, p2 = (Byte) endNumber; -+ return (byte) (p1 + (p2 - p1)*p); -+ } -+ throw new IllegalStateException("Numbers of type " + startNumber.getClass().getSimpleName() + " cannot be used."); -+ } -+} ---- net/minecraft/src/CallableLevelWeather.java -+++ net/minecraft/src/CallableLevelWeather.java -@@ -5,12 +5,12 @@ - class CallableLevelWeather implements Callable { - final WorldInfo worldInfoInstance; - -- CallableLevelWeather(WorldInfo var1) { -- this.worldInfoInstance = var1; -+ CallableLevelWeather(WorldInfo par1WorldInfo) { -+ this.worldInfoInstance = par1WorldInfo; - } - - public String callLevelWeatherInfo() { -- return String.format("Rain time: %d (now: %b), thunder time: %d (now: %b)", new Object[]{Integer.valueOf(WorldInfo.getRainTime(this.worldInfoInstance)), Boolean.valueOf(WorldInfo.getRaining(this.worldInfoInstance)), Integer.valueOf(WorldInfo.getThunderTime(this.worldInfoInstance)), Boolean.valueOf(WorldInfo.getThundering(this.worldInfoInstance))}); -+ return String.format("Rain time: %d (now: %b), thunder time: %d (now: %b)", new Object[] {Integer.valueOf(WorldInfo.getRainTime(this.worldInfoInstance)), Boolean.valueOf(WorldInfo.getRaining(this.worldInfoInstance)), Integer.valueOf(WorldInfo.getThunderTime(this.worldInfoInstance)), Boolean.valueOf(WorldInfo.getThundering(this.worldInfoInstance))}); - } - - public Object call() { ---- /dev/null -+++ org/spoutcraft/client/gui/settings/controls/FavorAppearanceButton.java -@@ -1,0 +1,41 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.client.gui.settings.controls; -+ -+import org.spoutcraft.api.gui.Color; -+import org.spoutcraft.api.gui.GenericRadioButton; -+import org.spoutcraft.api.gui.Label; -+import org.spoutcraft.client.config.Configuration; -+ -+public class FavorAppearanceButton extends GenericRadioButton { -+ Label label; -+ public FavorAppearanceButton(String title, Label label) { -+ super(title); -+ this.label = label; -+ } -+ -+ @Override -+ public void onButtonClick() { -+ Configuration.setAutomatePerformance(true); -+ Configuration.setAutomateMode(2); -+ Configuration.write(); -+ label.setTextColor(new Color(1F, 1F, 1F, 1F)); -+ } -+} ---- net/minecraft/src/MapGenMineshaft.java -+++ net/minecraft/src/MapGenMineshaft.java -@@ -7,30 +7,29 @@ - public class MapGenMineshaft extends MapGenStructure { - private double field_82673_e = 0.01D; - -- public MapGenMineshaft() { -- } -+ public MapGenMineshaft() {} - - public String func_143025_a() { - return "Mineshaft"; - } - -- public MapGenMineshaft(Map var1) { -- Iterator var2 = var1.entrySet().iterator(); -+ public MapGenMineshaft(Map par1Map) { -+ Iterator var2 = par1Map.entrySet().iterator(); - -- while(var2.hasNext()) { -+ while (var2.hasNext()) { - Entry var3 = (Entry)var2.next(); -- if(((String)var3.getKey()).equals("chance")) { -+ -+ if (((String)var3.getKey()).equals("chance")) { - this.field_82673_e = MathHelper.parseDoubleWithDefault((String)var3.getValue(), this.field_82673_e); - } - } -- -- } -- -- protected boolean canSpawnStructureAtCoords(int var1, int var2) { -- return this.b.nextDouble() < this.field_82673_e && this.b.nextInt(80) < Math.max(Math.abs(var1), Math.abs(var2)); -- } -- -- protected StructureStart getStructureStart(int var1, int var2) { -- return new StructureMineshaftStart(this.worldObj, this.b, var1, var2); -+ } -+ -+ protected boolean canSpawnStructureAtCoords(int par1, int par2) { -+ return this.rand.nextDouble() < this.field_82673_e && this.rand.nextInt(80) < Math.max(Math.abs(par1), Math.abs(par2)); -+ } -+ -+ protected StructureStart getStructureStart(int par1, int par2) { -+ return new StructureMineshaftStart(this.worldObj, this.rand, par1, par2); - } - } ---- net/minecraft/src/LayeredTexture.java -+++ net/minecraft/src/LayeredTexture.java -@@ -10,24 +10,26 @@ - import javax.imageio.ImageIO; - - public class LayeredTexture extends AbstractTexture { -- public final List b; -+ public final List layeredTextureNames; - -- public LayeredTexture(String... var1) { -- this.b = Lists.newArrayList((Object[])var1); -+ public LayeredTexture(String ... par1ArrayOfStr) { -+ this.layeredTextureNames = Lists.newArrayList(par1ArrayOfStr); - } - -- public void loadTexture(ResourceManager var1) throws IOException { -+ public void loadTexture(ResourceManager par1ResourceManager) throws IOException { - BufferedImage var2 = null; - - try { -- Iterator var3 = this.b.iterator(); -+ Iterator var3 = this.layeredTextureNames.iterator(); - -- while(var3.hasNext()) { -+ while (var3.hasNext()) { - String var4 = (String)var3.next(); -- if(var4 != null) { -- InputStream var5 = var1.getResource(new ResourceLocation(var4)).getInputStream(); -+ -+ if (var4 != null) { -+ InputStream var5 = par1ResourceManager.getResource(new ResourceLocation(var4)).getInputStream(); - BufferedImage var6 = ImageIO.read(var5); -- if(var2 == null) { -+ -+ if (var2 == null) { - var2 = new BufferedImage(var6.getWidth(), var6.getHeight(), 2); - } - ---- /dev/null -+++ com/prupe/mcpatcher/mob/MobRandomizer$ExtraInfo.java -@@ -1,0 +1,186 @@ -+package com.prupe.mcpatcher.mob; -+ -+import java.lang.ref.Reference; -+import java.lang.ref.ReferenceQueue; -+import java.lang.ref.WeakReference; -+import java.util.HashMap; -+import java.util.HashSet; -+import java.util.Iterator; -+import net.minecraft.src.EntityLivingBase; -+import net.minecraft.src.NBTTagCompound; -+ -+public final class MobRandomizer$ExtraInfo { -+ private static final String SKIN_TAG = "randomMobsSkin"; -+ private static final String ORIG_X_TAG = "origX"; -+ private static final String ORIG_Y_TAG = "origY"; -+ private static final String ORIG_Z_TAG = "origZ"; -+ private static final long MULTIPLIER = 25214903917L; -+ private static final long ADDEND = 11L; -+ private static final long MASK = 281474976710655L; -+ private static final HashMap allInfo = new HashMap(); -+ private static final HashMap, MobRandomizer$ExtraInfo> allRefs = new HashMap(); -+ private static final ReferenceQueue refQueue = new ReferenceQueue(); -+ private final int entityId; -+ private final HashSet> references; -+ private final long skin; -+ private final int origX; -+ private final int origY; -+ private final int origZ; -+ private Integer origBiome; -+ -+ MobRandomizer$ExtraInfo(EntityLivingBase entity) { -+ this(entity, getSkinId(entity.entityId), (int)entity.posX, (int)entity.posY, (int)entity.posZ); -+ } -+ -+ MobRandomizer$ExtraInfo(EntityLivingBase entity, long skin, int origX, int origY, int origZ) { -+ this.entityId = entity.entityId; -+ this.references = new HashSet(); -+ this.skin = skin; -+ this.origX = origX; -+ this.origY = origY; -+ this.origZ = origZ; -+ } -+ -+ private void setBiome() { -+ if (this.origBiome == null && MobRuleList.getBiomeIDAt != null) { -+ try { -+ this.origBiome = (Integer)MobRuleList.getBiomeIDAt.invoke((Object)null, new Object[] {Integer.valueOf(this.origX), Integer.valueOf(this.origY), Integer.valueOf(this.origZ)}); -+ } catch (Throwable var2) { -+ MobRuleList.getBiomeIDAt = null; -+ var2.printStackTrace(); -+ } -+ } -+ } -+ -+ public String toString() { -+ return String.format("%s{%d, %d, %d, %d, %d, %s}", new Object[] {this.getClass().getSimpleName(), Integer.valueOf(this.entityId), Long.valueOf(this.skin), Integer.valueOf(this.origX), Integer.valueOf(this.origY), Integer.valueOf(this.origZ), this.origBiome}); -+ } -+ -+ private static void clearUnusedReferences() { -+ HashMap var0 = allInfo; -+ -+ synchronized (allInfo) { -+ Reference ref; -+ -+ for (; (ref = refQueue.poll()) != null; allRefs.remove(ref)) { -+ MobRandomizer$ExtraInfo info = (MobRandomizer$ExtraInfo)allRefs.get(ref); -+ -+ if (info != null) { -+ info.references.remove(ref); -+ -+ if (info.references.isEmpty()) { -+ MobRandomizer.access$600().finest("removing unused ref %d", new Object[] {Integer.valueOf(info.entityId)}); -+ allInfo.remove(Integer.valueOf(info.entityId)); -+ } -+ } -+ } -+ } -+ } -+ -+ static MobRandomizer$ExtraInfo getInfo(EntityLivingBase entity) { -+ HashMap var2 = allInfo; -+ -+ synchronized (allInfo) { -+ clearUnusedReferences(); -+ MobRandomizer$ExtraInfo info = (MobRandomizer$ExtraInfo)allInfo.get(Integer.valueOf(entity.entityId)); -+ -+ if (info == null) { -+ info = new MobRandomizer$ExtraInfo(entity); -+ putInfo(entity, info); -+ } -+ -+ boolean found = false; -+ Iterator reference = info.references.iterator(); -+ -+ while (reference.hasNext()) { -+ WeakReference ref = (WeakReference)reference.next(); -+ -+ if (ref.get() == entity) { -+ found = true; -+ break; -+ } -+ } -+ -+ if (!found) { -+ WeakReference reference1 = new WeakReference(entity, refQueue); -+ info.references.add(reference1); -+ allRefs.put(reference1, info); -+ MobRandomizer.access$600().finest("added ref #%d for %d (%d entities)", new Object[] {Integer.valueOf(info.references.size()), Integer.valueOf(entity.entityId), Integer.valueOf(allInfo.size())}); -+ } -+ -+ info.setBiome(); -+ return info; -+ } -+ } -+ -+ static void putInfo(EntityLivingBase entity, MobRandomizer$ExtraInfo info) { -+ HashMap var2 = allInfo; -+ -+ synchronized (allInfo) { -+ allInfo.put(Integer.valueOf(entity.entityId), info); -+ } -+ } -+ -+ static void clearInfo() { -+ HashMap var0 = allInfo; -+ -+ synchronized (allInfo) { -+ allInfo.clear(); -+ } -+ } -+ -+ private static long getSkinId(int entityId) { -+ long n = (long)entityId; -+ n = n ^ n << 16 ^ n << 32 ^ n << 48; -+ n = 25214903917L * n + 11L; -+ n = 25214903917L * n + 11L; -+ n &= 281474976710655L; -+ return n >> 32 ^ n; -+ } -+ -+ public static void readFromNBT(EntityLivingBase entity, NBTTagCompound nbt) { -+ long skin = nbt.getLong("randomMobsSkin"); -+ -+ if (skin != 0L) { -+ int x = nbt.getInteger("origX"); -+ int y = nbt.getInteger("origY"); -+ int z = nbt.getInteger("origZ"); -+ putInfo(entity, new MobRandomizer$ExtraInfo(entity, skin, x, y, z)); -+ } -+ } -+ -+ public static void writeToNBT(EntityLivingBase entity, NBTTagCompound nbt) { -+ HashMap var2 = allInfo; -+ -+ synchronized (allInfo) { -+ MobRandomizer$ExtraInfo info = (MobRandomizer$ExtraInfo)allInfo.get(Integer.valueOf(entity.entityId)); -+ -+ if (info != null) { -+ nbt.setLong("randomMobsSkin", info.skin); -+ nbt.setInteger("origX", info.origX); -+ nbt.setInteger("origY", info.origY); -+ nbt.setInteger("origZ", info.origZ); -+ } -+ } -+ } -+ -+ static long access$100(MobRandomizer$ExtraInfo x0) { -+ return x0.skin; -+ } -+ -+ static int access$200(MobRandomizer$ExtraInfo x0) { -+ return x0.origX; -+ } -+ -+ static int access$300(MobRandomizer$ExtraInfo x0) { -+ return x0.origY; -+ } -+ -+ static int access$400(MobRandomizer$ExtraInfo x0) { -+ return x0.origZ; -+ } -+ -+ static Integer access$500(MobRandomizer$ExtraInfo x0) { -+ return x0.origBiome; -+ } -+} ---- /dev/null -+++ org/spoutcraft/client/gui/settings/controls/OptimalGameplayButton.java -@@ -1,0 +1,41 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.client.gui.settings.controls; -+ -+import org.spoutcraft.api.gui.Color; -+import org.spoutcraft.api.gui.GenericRadioButton; -+import org.spoutcraft.api.gui.Label; -+import org.spoutcraft.client.config.Configuration; -+ -+public class OptimalGameplayButton extends GenericRadioButton { -+ Label label; -+ public OptimalGameplayButton(String title, Label label) { -+ super(title); -+ this.label = label; -+ } -+ -+ @Override -+ public void onButtonClick() { -+ Configuration.setAutomatePerformance(true); -+ Configuration.setAutomateMode(1); -+ Configuration.write(); -+ label.setTextColor(new Color(1F, 1F, 1F, 1F)); -+ } -+} ---- net/minecraft/src/ModelMinecart.java -+++ net/minecraft/src/ModelMinecart.java -@@ -26,19 +26,21 @@ - this.sideModels[3].setRotationPoint(0.0F, (float)var4, (float)(-var3 / 2 + 1)); - this.sideModels[4].addBox((float)(-var1 / 2 + 2), (float)(-var2 - 1), -1.0F, var1 - 4, var2, 2, 0.0F); - this.sideModels[4].setRotationPoint(0.0F, (float)var4, (float)(var3 / 2 - 1)); -- this.sideModels[0].rotateAngleX = (float)Math.PI * 0.5F; -- this.sideModels[1].rotateAngleY = (float)Math.PI * 3.0F / 2.0F; -- this.sideModels[2].rotateAngleY = (float)Math.PI * 0.5F; -+ this.sideModels[0].rotateAngleX = ((float)Math.PI / 2F); -+ this.sideModels[1].rotateAngleY = ((float)Math.PI * 3F / 2F); -+ this.sideModels[2].rotateAngleY = ((float)Math.PI / 2F); - this.sideModels[3].rotateAngleY = (float)Math.PI; -- this.sideModels[5].rotateAngleX = (float)Math.PI * -0.5F; -+ this.sideModels[5].rotateAngleX = -((float)Math.PI / 2F); - } - -- public void render(Entity var1, float var2, float var3, float var4, float var5, float var6, float var7) { -- this.sideModels[5].rotationPointY = 4.0F - var4; -+ /** -+ * Sets the models various rotation angles then renders the model. -+ */ -+ public void render(Entity par1Entity, float par2, float par3, float par4, float par5, float par6, float par7) { -+ this.sideModels[5].rotationPointY = 4.0F - par4; - -- for(int var8 = 0; var8 < 6; ++var8) { -- this.sideModels[var8].render(var7); -+ for (int var8 = 0; var8 < 6; ++var8) { -+ this.sideModels[var8].render(par7); - } -- - } - } ---- net/minecraft/src/TileEntityRenderer.java -+++ net/minecraft/src/TileEntityRenderer.java -@@ -3,114 +3,159 @@ - import java.util.HashMap; - import java.util.Iterator; - import java.util.Map; -+ - import org.lwjgl.opengl.GL11; - - public class TileEntityRenderer { -- private Map m = new HashMap(); -+ -+ /** -+ * A mapping of TileEntitySpecialRenderers used for each TileEntity that has one -+ */ -+ private Map specialRendererMap = new HashMap(); -+ -+ /** The static instance of TileEntityRenderer */ - public static TileEntityRenderer instance = new TileEntityRenderer(); -+ -+ /** The FontRenderer instance used by the TileEntityRenderer */ - private FontRenderer fontRenderer; -+ -+ /** The player's current X position (same as playerX) */ - public static double staticPlayerX; -+ -+ /** The player's current Y position (same as playerY) */ - public static double staticPlayerY; -+ -+ /** The player's current Z position (same as playerZ) */ - public static double staticPlayerZ; -+ -+ /** The RenderEngine instance used by the TileEntityRenderer */ - public TextureManager renderEngine; -+ -+ /** Reference to the World object. */ - public World worldObj; - public EntityLivingBase entityLivingPlayer; - public float playerYaw; - public float playerPitch; -+ -+ /** The player's X position in this rendering context */ - public double playerX; -+ -+ /** The player's Y position in this rendering context */ - public double playerY; -+ -+ /** The player's Z position in this rendering context */ - public double playerZ; - - private TileEntityRenderer() { -- this.m.put(TileEntitySign.class, new TileEntitySignRenderer()); -- this.m.put(TileEntityMobSpawner.class, new TileEntityMobSpawnerRenderer()); -- this.m.put(TileEntityPiston.class, new TileEntityRendererPiston()); -- this.m.put(TileEntityChest.class, new TileEntityChestRenderer()); -- this.m.put(TileEntityEnderChest.class, new TileEntityEnderChestRenderer()); -- this.m.put(TileEntityEnchantmentTable.class, new RenderEnchantmentTable()); -- this.m.put(TileEntityEndPortal.class, new RenderEndPortal()); -- this.m.put(TileEntityBeacon.class, new TileEntityBeaconRenderer()); -- this.m.put(TileEntitySkull.class, new TileEntitySkullRenderer()); -- Iterator var1 = this.m.values().iterator(); -+ this.specialRendererMap.put(TileEntitySign.class, new TileEntitySignRenderer()); -+ this.specialRendererMap.put(TileEntityMobSpawner.class, new TileEntityMobSpawnerRenderer()); -+ this.specialRendererMap.put(TileEntityPiston.class, new TileEntityRendererPiston()); -+ this.specialRendererMap.put(TileEntityChest.class, new TileEntityChestRenderer()); -+ this.specialRendererMap.put(TileEntityEnderChest.class, new TileEntityEnderChestRenderer()); -+ this.specialRendererMap.put(TileEntityEnchantmentTable.class, new RenderEnchantmentTable()); -+ this.specialRendererMap.put(TileEntityEndPortal.class, new RenderEndPortal()); -+ this.specialRendererMap.put(TileEntityBeacon.class, new TileEntityBeaconRenderer()); -+ this.specialRendererMap.put(TileEntitySkull.class, new TileEntitySkullRenderer()); -+ Iterator var1 = this.specialRendererMap.values().iterator(); - -- while(var1.hasNext()) { -+ while (var1.hasNext()) { - TileEntitySpecialRenderer var2 = (TileEntitySpecialRenderer)var1.next(); - var2.setTileEntityRenderer(this); - } -- - } - -- public TileEntitySpecialRenderer getSpecialRendererForClass(Class var1) { -- TileEntitySpecialRenderer var2 = (TileEntitySpecialRenderer)this.m.get(var1); -- if(var2 == null && var1 != TileEntity.class) { -- var2 = this.getSpecialRendererForClass(var1.getSuperclass()); -- this.m.put(var1, var2); -+ /** -+ * Returns the TileEntitySpecialRenderer used to render this TileEntity class, or null if it has no special renderer -+ */ -+ public TileEntitySpecialRenderer getSpecialRendererForClass(Class par1Class) { -+ TileEntitySpecialRenderer var2 = (TileEntitySpecialRenderer)this.specialRendererMap.get(par1Class); -+ -+ if (var2 == null && par1Class != TileEntity.class) { -+ var2 = this.getSpecialRendererForClass(par1Class.getSuperclass()); -+ this.specialRendererMap.put(par1Class, var2); - } - - return var2; - } - -- public boolean hasSpecialRenderer(TileEntity var1) { -- return this.getSpecialRendererForEntity(var1) != null; -- } -- -- public TileEntitySpecialRenderer getSpecialRendererForEntity(TileEntity var1) { -- return var1 == null ? null : this.getSpecialRendererForClass(var1.getClass()); -- } -- -- public void cacheActiveRenderInfo(World var1, TextureManager var2, FontRenderer var3, EntityLivingBase var4, float var5) { -- if(this.worldObj != var1) { -- this.setWorld(var1); -+ /** -+ * Returns true if this TileEntity instance has a TileEntitySpecialRenderer associated with it, false otherwise. -+ */ -+ public boolean hasSpecialRenderer(TileEntity par1TileEntity) { -+ return this.getSpecialRendererForEntity(par1TileEntity) != null; -+ } -+ -+ /** -+ * Returns the TileEntitySpecialRenderer used to render this TileEntity instance, or null if it has no special renderer -+ */ -+ public TileEntitySpecialRenderer getSpecialRendererForEntity(TileEntity par1TileEntity) { -+ return par1TileEntity == null ? null : this.getSpecialRendererForClass(par1TileEntity.getClass()); -+ } -+ -+ /** -+ * Caches several render-related references, including the active World, RenderEngine, FontRenderer, and the camera- -+ * bound EntityLiving's interpolated pitch, yaw and position. Args: world, renderengine, fontrenderer, entityliving, -+ * partialTickTime -+ */ -+ public void cacheActiveRenderInfo(World par1World, TextureManager par2TextureManager, FontRenderer par3FontRenderer, EntityLivingBase par4EntityLivingBase, float par5) { -+ if (this.worldObj != par1World) { -+ this.setWorld(par1World); - } - -- this.renderEngine = var2; -- this.entityLivingPlayer = var4; -- this.fontRenderer = var3; -- this.playerYaw = var4.prevRotationYaw + (var4.rotationYaw - var4.prevRotationYaw) * var5; -- this.playerPitch = var4.prevRotationPitch + (var4.rotationPitch - var4.prevRotationPitch) * var5; -- this.playerX = var4.lastTickPosX + (var4.posX - var4.lastTickPosX) * (double)var5; -- this.playerY = var4.lastTickPosY + (var4.posY - var4.lastTickPosY) * (double)var5; -- this.playerZ = var4.lastTickPosZ + (var4.posZ - var4.lastTickPosZ) * (double)var5; -+ this.renderEngine = par2TextureManager; -+ this.entityLivingPlayer = par4EntityLivingBase; -+ this.fontRenderer = par3FontRenderer; -+ this.playerYaw = par4EntityLivingBase.prevRotationYaw + (par4EntityLivingBase.rotationYaw - par4EntityLivingBase.prevRotationYaw) * par5; -+ this.playerPitch = par4EntityLivingBase.prevRotationPitch + (par4EntityLivingBase.rotationPitch - par4EntityLivingBase.prevRotationPitch) * par5; -+ this.playerX = par4EntityLivingBase.lastTickPosX + (par4EntityLivingBase.posX - par4EntityLivingBase.lastTickPosX) * (double)par5; -+ this.playerY = par4EntityLivingBase.lastTickPosY + (par4EntityLivingBase.posY - par4EntityLivingBase.lastTickPosY) * (double)par5; -+ this.playerZ = par4EntityLivingBase.lastTickPosZ + (par4EntityLivingBase.posZ - par4EntityLivingBase.lastTickPosZ) * (double)par5; - } - -- public void renderTileEntity(TileEntity var1, float var2) { -- if(var1.getDistanceFrom(this.playerX, this.playerY, this.playerZ) < var1.getMaxRenderDistanceSquared()) { -- int var3 = this.worldObj.getLightBrightnessForSkyBlocks(var1.xCoord, var1.yCoord, var1.zCoord, 0); -+ /** -+ * Render this TileEntity at its current position from the player -+ */ -+ public void renderTileEntity(TileEntity par1TileEntity, float par2) { -+ if (par1TileEntity.getDistanceFrom(this.playerX, this.playerY, this.playerZ) < par1TileEntity.getMaxRenderDistanceSquared()) { -+ int var3 = this.worldObj.getLightBrightnessForSkyBlocks(par1TileEntity.xCoord, par1TileEntity.yCoord, par1TileEntity.zCoord, 0); - int var4 = var3 % 65536; - int var5 = var3 / 65536; - OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, (float)var4 / 1.0F, (float)var5 / 1.0F); - GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); -- this.renderTileEntityAt(var1, (double)var1.xCoord - staticPlayerX, (double)var1.yCoord - staticPlayerY, (double)var1.zCoord - staticPlayerZ, var2); -+ this.renderTileEntityAt(par1TileEntity, (double)par1TileEntity.xCoord - staticPlayerX, (double)par1TileEntity.yCoord - staticPlayerY, (double)par1TileEntity.zCoord - staticPlayerZ, par2); - } -- - } - -- public void renderTileEntityAt(TileEntity var1, double var2, double var4, double var6, float var8) { -- TileEntitySpecialRenderer var9 = this.getSpecialRendererForEntity(var1); -- if(var9 != null) { -+ /** -+ * Render this TileEntity at a given set of coordinates -+ */ -+ public void renderTileEntityAt(TileEntity par1TileEntity, double par2, double par4, double par6, float par8) { -+ TileEntitySpecialRenderer var9 = this.getSpecialRendererForEntity(par1TileEntity); -+ -+ if (var9 != null) { - try { -- var9.renderTileEntityAt(var1, var2, var4, var6, var8); -- } catch (Throwable var13) { -- CrashReport var11 = CrashReport.makeCrashReport(var13, "Rendering Tile Entity"); -- CrashReportCategory var12 = var11.makeCategory("Tile Entity Details"); -- var1.func_85027_a(var12); -- throw new ReportedException(var11); -+ var9.renderTileEntityAt(par1TileEntity, par2, par4, par6, par8); -+ // Spout Start -+ } catch (ClassCastException ignore) { - } -+ // Spout End - } -- - } - -- public void setWorld(World var1) { -- this.worldObj = var1; -- Iterator var2 = this.m.values().iterator(); -+ /** -+ * Sets the world used by all TileEntitySpecialRender instances and notifies them of this change. -+ */ -+ public void setWorld(World par1World) { -+ this.worldObj = par1World; -+ Iterator var2 = this.specialRendererMap.values().iterator(); - -- while(var2.hasNext()) { -+ while (var2.hasNext()) { - TileEntitySpecialRenderer var3 = (TileEntitySpecialRenderer)var2.next(); -- if(var3 != null) { -- var3.onWorldChange(var1); -+ -+ if (var3 != null) { -+ var3.onWorldChange(par1World); - } - } -- - } - - public FontRenderer getFontRenderer() { ---- net/minecraft/src/BiomeGenBase.java -+++ net/minecraft/src/BiomeGenBase.java -@@ -5,7 +5,11 @@ - import java.util.List; - import java.util.Random; - -+import com.prupe.mcpatcher.cc.ColorizeWorld; -+ - public abstract class BiomeGenBase { -+ -+ /** An array of all the biomes, indexed by biome id. */ - public static final BiomeGenBase[] biomeList = new BiomeGenBase[256]; - public static final BiomeGenBase ocean = (new BiomeGenOcean(0)).setColor(112).setBiomeName("Ocean").setMinMaxHeight(-1.0F, 0.4F); - public static final BiomeGenBase plains = (new BiomeGenPlains(1)).setColor(9286496).setBiomeName("Plains").setTemperatureRainfall(0.8F, 0.4F); -@@ -16,6 +20,8 @@ - public static final BiomeGenBase swampland = (new BiomeGenSwamp(6)).setColor(522674).setBiomeName("Swampland").func_76733_a(9154376).setMinMaxHeight(-0.2F, 0.1F).setTemperatureRainfall(0.8F, 0.9F); - public static final BiomeGenBase river = (new BiomeGenRiver(7)).setColor(255).setBiomeName("River").setMinMaxHeight(-0.5F, 0.0F); - public static final BiomeGenBase hell = (new BiomeGenHell(8)).setColor(16711680).setBiomeName("Hell").setDisableRain().setTemperatureRainfall(2.0F, 0.0F); -+ -+ /** Is the biome used for sky world. */ - public static final BiomeGenBase sky = (new BiomeGenEnd(9)).setColor(8421631).setBiomeName("Sky").setDisableRain(); - public static final BiomeGenBase frozenOcean = (new BiomeGenOcean(10)).setColor(9474208).setBiomeName("FrozenOcean").setEnableSnow().setMinMaxHeight(-1.0F, 0.5F).setTemperatureRainfall(0.0F, 0.5F); - public static final BiomeGenBase frozenRiver = (new BiomeGenRiver(11)).setColor(10526975).setBiomeName("FrozenRiver").setEnableSnow().setMinMaxHeight(-0.5F, 0.0F).setTemperatureRainfall(0.0F, 0.5F); -@@ -23,166 +29,300 @@ - public static final BiomeGenBase iceMountains = (new BiomeGenSnow(13)).setColor(10526880).setBiomeName("Ice Mountains").setEnableSnow().setMinMaxHeight(0.3F, 1.3F).setTemperatureRainfall(0.0F, 0.5F); - public static final BiomeGenBase mushroomIsland = (new BiomeGenMushroomIsland(14)).setColor(16711935).setBiomeName("MushroomIsland").setTemperatureRainfall(0.9F, 1.0F).setMinMaxHeight(0.2F, 1.0F); - public static final BiomeGenBase mushroomIslandShore = (new BiomeGenMushroomIsland(15)).setColor(10486015).setBiomeName("MushroomIslandShore").setTemperatureRainfall(0.9F, 1.0F).setMinMaxHeight(-1.0F, 0.1F); -+ -+ /** Beach biome. */ - public static final BiomeGenBase beach = (new BiomeGenBeach(16)).setColor(16440917).setBiomeName("Beach").setTemperatureRainfall(0.8F, 0.4F).setMinMaxHeight(0.0F, 0.1F); -+ -+ /** Desert Hills biome. */ - public static final BiomeGenBase desertHills = (new BiomeGenDesert(17)).setColor(13786898).setBiomeName("DesertHills").setDisableRain().setTemperatureRainfall(2.0F, 0.0F).setMinMaxHeight(0.3F, 0.8F); -+ -+ /** Forest Hills biome. */ - public static final BiomeGenBase forestHills = (new BiomeGenForest(18)).setColor(2250012).setBiomeName("ForestHills").func_76733_a(5159473).setTemperatureRainfall(0.7F, 0.8F).setMinMaxHeight(0.3F, 0.7F); -+ -+ /** Taiga Hills biome. */ - public static final BiomeGenBase taigaHills = (new BiomeGenTaiga(19)).setColor(1456435).setBiomeName("TaigaHills").setEnableSnow().func_76733_a(5159473).setTemperatureRainfall(0.05F, 0.8F).setMinMaxHeight(0.3F, 0.8F); -+ -+ /** Extreme Hills Edge biome. */ - public static final BiomeGenBase extremeHillsEdge = (new BiomeGenHills(20)).setColor(7501978).setBiomeName("Extreme Hills Edge").setMinMaxHeight(0.2F, 0.8F).setTemperatureRainfall(0.2F, 0.3F); -+ -+ /** Jungle biome identifier */ - public static final BiomeGenBase jungle = (new BiomeGenJungle(21)).setColor(5470985).setBiomeName("Jungle").func_76733_a(5470985).setTemperatureRainfall(1.2F, 0.9F).setMinMaxHeight(0.2F, 0.4F); - public static final BiomeGenBase jungleHills = (new BiomeGenJungle(22)).setColor(2900485).setBiomeName("JungleHills").func_76733_a(5470985).setTemperatureRainfall(1.2F, 0.9F).setMinMaxHeight(1.8F, 0.5F); -- public String y; -+ public String biomeName; - public int color; -- public byte topBlock = (byte)Block.grass.blockID; -- public byte fillerBlock = (byte)Block.dirt.blockID; -- public int field_76754_C = 5169201; -- public float minHeight = 0.1F; -- public float maxHeight = 0.3F; -- public float temperature = 0.5F; -- public float rainfall = 0.5F; -- public int waterColorMultiplier = 16777215; -+ -+ /** The block expected to be on the top of this biome */ -+ public byte topBlock; -+ -+ /** The block to fill spots in when not on the top */ -+ public byte fillerBlock; -+ public int field_76754_C; -+ -+ /** The minimum height of this biome. Default 0.1. */ -+ public float minHeight; -+ -+ /** The maximum height of this biome. Default 0.3. */ -+ public float maxHeight; -+ -+ /** The temperature of this biome. */ -+ public float temperature; -+ -+ /** The rainfall in this biome. */ -+ public float rainfall; -+ -+ /** Color tint applied to water depending on biome */ -+ public int waterColorMultiplier; -+ -+ /** The biome decorator. */ - public BiomeDecorator theBiomeDecorator; -- protected List J = new ArrayList(); -- protected List K = new ArrayList(); -- protected List L = new ArrayList(); -- protected List M = new ArrayList(); -+ -+ /** -+ * Holds the classes of IMobs (hostile mobs) that can be spawned in the biome. -+ */ -+ protected List spawnableMonsterList; -+ -+ /** -+ * Holds the classes of any creature that can be spawned in the biome as friendly creature. -+ */ -+ protected List spawnableCreatureList; -+ -+ /** -+ * Holds the classes of any aquatic creature that can be spawned in the water of the biome. -+ */ -+ protected List spawnableWaterCreatureList; -+ protected List spawnableCaveCreatureList; -+ -+ /** Set to true if snow is enabled for this biome. */ - private boolean enableSnow; -- private boolean enableRain = true; -+ -+ /** -+ * Is true (default) if the biome support rain (desert and nether can't have rain) -+ */ -+ private boolean enableRain; -+ -+ /** The id number to this biome, and its index in the biomeList array. */ - public final int biomeID; -- protected WorldGenTrees worldGeneratorTrees = new WorldGenTrees(false); -- protected WorldGenBigTree worldGeneratorBigTree = new WorldGenBigTree(false); -- protected WorldGenForest worldGeneratorForest = new WorldGenForest(false); -- protected WorldGenSwamp worldGeneratorSwamp = new WorldGenSwamp(); -- -- protected BiomeGenBase(int var1) { -- this.biomeID = var1; -- biomeList[var1] = this; -+ -+ /** The tree generator. */ -+ protected WorldGenTrees worldGeneratorTrees; -+ -+ /** The big tree generator. */ -+ protected WorldGenBigTree worldGeneratorBigTree; -+ -+ /** The forest generator. */ -+ protected WorldGenForest worldGeneratorForest; -+ -+ /** The swamp tree generator. */ -+ protected WorldGenSwamp worldGeneratorSwamp; -+ -+ protected BiomeGenBase(int par1) { -+ this.topBlock = (byte)Block.grass.blockID; -+ this.fillerBlock = (byte)Block.dirt.blockID; -+ this.field_76754_C = 5169201; -+ this.minHeight = 0.1F; -+ this.maxHeight = 0.3F; -+ this.temperature = 0.5F; -+ this.rainfall = 0.5F; -+ this.waterColorMultiplier = 16777215; -+ this.spawnableMonsterList = new ArrayList(); -+ this.spawnableCreatureList = new ArrayList(); -+ this.spawnableWaterCreatureList = new ArrayList(); -+ this.spawnableCaveCreatureList = new ArrayList(); -+ this.enableRain = true; -+ this.worldGeneratorTrees = new WorldGenTrees(false); -+ this.worldGeneratorBigTree = new WorldGenBigTree(false); -+ this.worldGeneratorForest = new WorldGenForest(false); -+ this.worldGeneratorSwamp = new WorldGenSwamp(); -+ this.biomeID = par1; -+ biomeList[par1] = this; - this.theBiomeDecorator = this.createBiomeDecorator(); -- this.K.add(new SpawnListEntry(EntitySheep.class, 12, 4, 4)); -- this.K.add(new SpawnListEntry(EntityPig.class, 10, 4, 4)); -- this.K.add(new SpawnListEntry(EntityChicken.class, 10, 4, 4)); -- this.K.add(new SpawnListEntry(EntityCow.class, 8, 4, 4)); -- this.J.add(new SpawnListEntry(EntitySpider.class, 10, 4, 4)); -- this.J.add(new SpawnListEntry(EntityZombie.class, 10, 4, 4)); -- this.J.add(new SpawnListEntry(EntitySkeleton.class, 10, 4, 4)); -- this.J.add(new SpawnListEntry(EntityCreeper.class, 10, 4, 4)); -- this.J.add(new SpawnListEntry(EntitySlime.class, 10, 4, 4)); -- this.J.add(new SpawnListEntry(EntityEnderman.class, 1, 1, 4)); -- this.L.add(new SpawnListEntry(EntitySquid.class, 10, 4, 4)); -- this.M.add(new SpawnListEntry(EntityBat.class, 10, 8, 8)); -+ this.spawnableCreatureList.add(new SpawnListEntry(EntitySheep.class, 12, 4, 4)); -+ this.spawnableCreatureList.add(new SpawnListEntry(EntityPig.class, 10, 4, 4)); -+ this.spawnableCreatureList.add(new SpawnListEntry(EntityChicken.class, 10, 4, 4)); -+ this.spawnableCreatureList.add(new SpawnListEntry(EntityCow.class, 8, 4, 4)); -+ this.spawnableMonsterList.add(new SpawnListEntry(EntitySpider.class, 10, 4, 4)); -+ this.spawnableMonsterList.add(new SpawnListEntry(EntityZombie.class, 10, 4, 4)); -+ this.spawnableMonsterList.add(new SpawnListEntry(EntitySkeleton.class, 10, 4, 4)); -+ this.spawnableMonsterList.add(new SpawnListEntry(EntityCreeper.class, 10, 4, 4)); -+ this.spawnableMonsterList.add(new SpawnListEntry(EntitySlime.class, 10, 4, 4)); -+ this.spawnableMonsterList.add(new SpawnListEntry(EntityEnderman.class, 1, 1, 4)); -+ this.spawnableWaterCreatureList.add(new SpawnListEntry(EntitySquid.class, 10, 4, 4)); -+ this.spawnableCaveCreatureList.add(new SpawnListEntry(EntityBat.class, 10, 8, 8)); - } - -+ /** -+ * Allocate a new BiomeDecorator for this BiomeGenBase -+ */ - protected BiomeDecorator createBiomeDecorator() { - return new BiomeDecorator(this); - } - -- private BiomeGenBase setTemperatureRainfall(float var1, float var2) { -- if(var1 > 0.1F && var1 < 0.2F) { -+ /** -+ * Sets the temperature and rainfall of this biome. -+ */ -+ private BiomeGenBase setTemperatureRainfall(float par1, float par2) { -+ if (par1 > 0.1F && par1 < 0.2F) { - throw new IllegalArgumentException("Please avoid temperatures in the range 0.1 - 0.2 because of snow"); - } else { -- this.temperature = var1; -- this.rainfall = var2; -+ this.temperature = par1; -+ this.rainfall = par2; - return this; - } - } - -- private BiomeGenBase setMinMaxHeight(float var1, float var2) { -- this.minHeight = var1; -- this.maxHeight = var2; -+ /** -+ * Sets the minimum and maximum height of this biome. Seems to go from -2.0 to 2.0. -+ */ -+ private BiomeGenBase setMinMaxHeight(float par1, float par2) { -+ this.minHeight = par1; -+ this.maxHeight = par2; - return this; - } - -+ /** -+ * Disable the rain for the biome. -+ */ - private BiomeGenBase setDisableRain() { - this.enableRain = false; - return this; - } - -- public WorldGenerator getRandomWorldGenForTrees(Random var1) { -- return (WorldGenerator)(var1.nextInt(10) == 0 ? this.worldGeneratorBigTree : this.worldGeneratorTrees); -+ /** -+ * Gets a WorldGen appropriate for this biome. -+ */ -+ public WorldGenerator getRandomWorldGenForTrees(Random par1Random) { -+ return (WorldGenerator)(par1Random.nextInt(10) == 0 ? this.worldGeneratorBigTree : this.worldGeneratorTrees); - } - -- public WorldGenerator getRandomWorldGenForGrass(Random var1) { -+ /** -+ * Gets a WorldGen appropriate for this biome. -+ */ -+ public WorldGenerator getRandomWorldGenForGrass(Random par1Random) { - return new WorldGenTallGrass(Block.tallGrass.blockID, 1); - } - -+ /** -+ * sets enableSnow to true during biome initialization. returns BiomeGenBase. -+ */ - protected BiomeGenBase setEnableSnow() { - this.enableSnow = true; - return this; - } - -- protected BiomeGenBase setBiomeName(String var1) { -- this.y = var1; -- return this; -- } -- -- protected BiomeGenBase func_76733_a(int var1) { -- this.field_76754_C = var1; -- return this; -- } -- -- protected BiomeGenBase setColor(int var1) { -- this.color = var1; -- return this; -- } -- -- public int getSkyColorByTemp(float var1) { -- var1 /= 3.0F; -- if(var1 < -1.0F) { -- var1 = -1.0F; -- } -- -- if(var1 > 1.0F) { -- var1 = 1.0F; -- } -- -- return Color.getHSBColor(224.0F / 360.0F - var1 * 0.05F, 0.5F + var1 * 0.1F, 1.0F).getRGB(); -- } -- -- public List getSpawnableList(EnumCreatureType var1) { -- return var1 == EnumCreatureType.monster ? this.J : (var1 == EnumCreatureType.creature ? this.K : (var1 == EnumCreatureType.waterCreature ? this.L : (var1 == EnumCreatureType.ambient ? this.M : null))); -- } -- -+ protected BiomeGenBase setBiomeName(String par1Str) { -+ this.biomeName = par1Str; -+ // MCPatcher Start -+ ColorizeWorld.setupBiome(this); -+ // MCPatcher End -+ return this; -+ } -+ -+ protected BiomeGenBase func_76733_a(int par1) { -+ this.field_76754_C = par1; -+ return this; -+ } -+ -+ protected BiomeGenBase setColor(int par1) { -+ this.color = par1; -+ return this; -+ } -+ -+ /** -+ * takes temperature, returns color -+ */ -+ public int getSkyColorByTemp(float par1) { -+ par1 /= 3.0F; -+ -+ if (par1 < -1.0F) { -+ par1 = -1.0F; -+ } -+ -+ if (par1 > 1.0F) { -+ par1 = 1.0F; -+ } -+ -+ return Color.getHSBColor(0.62222224F - par1 * 0.05F, 0.5F + par1 * 0.1F, 1.0F).getRGB(); -+ } -+ -+ /** -+ * Returns the correspondent list of the EnumCreatureType informed. -+ */ -+ public List getSpawnableList(EnumCreatureType par1EnumCreatureType) { -+ return par1EnumCreatureType == EnumCreatureType.monster ? this.spawnableMonsterList : (par1EnumCreatureType == EnumCreatureType.creature ? this.spawnableCreatureList : (par1EnumCreatureType == EnumCreatureType.waterCreature ? this.spawnableWaterCreatureList : (par1EnumCreatureType == EnumCreatureType.ambient ? this.spawnableCaveCreatureList : null))); -+ } -+ -+ /** -+ * Returns true if the biome have snowfall instead a normal rain. -+ */ - public boolean getEnableSnow() { - return this.enableSnow; - } - -+ /** -+ * Return true if the biome supports lightning bolt spawn, either by have the bolts enabled and have rain enabled. -+ */ - public boolean canSpawnLightningBolt() { - return this.enableSnow ? false : this.enableRain; - } - -+ /** -+ * Checks to see if the rainfall level of the biome is extremely high -+ */ - public boolean isHighHumidity() { - return this.rainfall > 0.85F; - } - -+ /** -+ * returns the chance a creature has to spawn. -+ */ - public float getSpawningChance() { - return 0.1F; - } - -+ /** -+ * Gets an integer representation of this biome's rainfall -+ */ - public final int getIntRainfall() { - return (int)(this.rainfall * 65536.0F); - } - -+ /** -+ * Gets an integer representation of this biome's temperature -+ */ - public final int getIntTemperature() { - return (int)(this.temperature * 65536.0F); - } - -+ /** -+ * Gets a floating point representation of this biome's rainfall -+ */ - public final float getFloatRainfall() { - return this.rainfall; - } - -+ /** -+ * Gets a floating point representation of this biome's temperature -+ */ - public final float getFloatTemperature() { - return this.temperature; - } - -- public void decorate(World var1, Random var2, int var3, int var4) { -- this.theBiomeDecorator.decorate(var1, var2, var3, var4); -+ public void decorate(World par1World, Random par2Random, int par3, int par4) { -+ this.theBiomeDecorator.decorate(par1World, par2Random, par3, par4); - } - -+ /** -+ * Provides the basic grass color based on the biome temperature and rainfall -+ */ - public int getBiomeGrassColor() { - double var1 = (double)MathHelper.clamp_float(this.getFloatTemperature(), 0.0F, 1.0F); - double var3 = (double)MathHelper.clamp_float(this.getFloatRainfall(), 0.0F, 1.0F); - return ColorizerGrass.getGrassColor(var1, var3); - } - -+ /** -+ * Provides the basic foliage color based on the biome temperature and rainfall -+ */ - public int getBiomeFoliageColor() { - double var1 = (double)MathHelper.clamp_float(this.getFloatTemperature(), 0.0F, 1.0F); - double var3 = (double)MathHelper.clamp_float(this.getFloatRainfall(), 0.0F, 1.0F); ---- /dev/null -+++ org/spoutcraft/client/gui/settings/controls/RandomMobTextureButton.java -@@ -1,0 +1,45 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.client.gui.settings.controls; -+ -+import com.prupe.mcpatcher.TexturePackChangeHandler; -+ -+import net.minecraft.src.Minecraft; -+ -+import org.spoutcraft.client.config.Configuration; -+ -+public class RandomMobTextureButton extends AutomatedCheckBox { -+ public RandomMobTextureButton() { -+ super("Random Mob Textures"); -+ setChecked(Configuration.isRandomMobTextures()); -+ setTooltip("Applies Random Textures to Mobs and Animals.\n\nOnly supported by certain texture packs."); -+ } -+ -+ @Override -+ public void onButtonClick() { -+ Configuration.setRandomMobTextures(!Configuration.isRandomMobTextures()); -+ Configuration.write(); -+ -+ TexturePackChangeHandler.scheduleTexturePackRefresh(); -+ if (Minecraft.getMinecraft().theWorld != null) { -+ Minecraft.getMinecraft().renderGlobal.updateAllRenderers(); -+ } -+ } -+} ---- net/minecraft/src/EntityDamageSourceIndirect.java -+++ net/minecraft/src/EntityDamageSourceIndirect.java -@@ -3,9 +3,9 @@ - public class EntityDamageSourceIndirect extends EntityDamageSource { - private Entity indirectEntity; - -- public EntityDamageSourceIndirect(String var1, Entity var2, Entity var3) { -- super(var1, var2); -- this.indirectEntity = var3; -+ public EntityDamageSourceIndirect(String par1Str, Entity par2Entity, Entity par3Entity) { -+ super(par1Str, par2Entity); -+ this.indirectEntity = par3Entity; - } - - public Entity getSourceOfDamage() { -@@ -16,11 +16,14 @@ - return this.indirectEntity; - } - -- public ChatMessageComponent getDeathMessage(EntityLivingBase var1) { -+ /** -+ * Returns the message to be displayed on player death. -+ */ -+ public ChatMessageComponent getDeathMessage(EntityLivingBase par1EntityLivingBase) { - String var2 = this.indirectEntity == null ? this.damageSourceEntity.getTranslatedEntityName() : this.indirectEntity.getTranslatedEntityName(); - ItemStack var3 = this.indirectEntity instanceof EntityLivingBase ? ((EntityLivingBase)this.indirectEntity).getHeldItem() : null; -- String var4 = "death.attack." + this.o; -+ String var4 = "death.attack." + this.damageType; - String var5 = var4 + ".item"; -- return var3 != null && var3.hasDisplayName() && StatCollector.func_94522_b(var5) ? ChatMessageComponent.createFromTranslationWithSubstitutions(var5, new Object[]{var1.getTranslatedEntityName(), var2, var3.getDisplayName()}) : ChatMessageComponent.createFromTranslationWithSubstitutions(var4, new Object[]{var1.getTranslatedEntityName(), var2}); -+ return var3 != null && var3.hasDisplayName() && StatCollector.func_94522_b(var5) ? ChatMessageComponent.createFromTranslationWithSubstitutions(var5, new Object[] {par1EntityLivingBase.getTranslatedEntityName(), var2, var3.getDisplayName()}): ChatMessageComponent.createFromTranslationWithSubstitutions(var4, new Object[] {par1EntityLivingBase.getTranslatedEntityName(), var2}); - } - } ---- net/minecraft/src/TcpWriterThread.java -+++ net/minecraft/src/TcpWriterThread.java -@@ -5,26 +5,28 @@ - class TcpWriterThread extends Thread { - final TcpConnection theTcpConnection; - -- TcpWriterThread(TcpConnection var1, String var2) { -- super(var2); -- this.theTcpConnection = var1; -+ TcpWriterThread(TcpConnection par1TcpConnection, String par2Str) { -+ super(par2Str); -+ this.theTcpConnection = par1TcpConnection; - } - - public void run() { -- TcpConnection.b.getAndIncrement(); -+ TcpConnection.field_74469_b.getAndIncrement(); - - try { -- while(TcpConnection.isRunning(this.theTcpConnection)) { -+ while (TcpConnection.isRunning(this.theTcpConnection)) { - boolean var1; -- for(var1 = false; TcpConnection.sendNetworkPacket(this.theTcpConnection); var1 = true) { -+ -+ for (var1 = false; TcpConnection.sendNetworkPacket(this.theTcpConnection); var1 = true) { -+ ; - } - - try { -- if(var1 && TcpConnection.getOutputStream(this.theTcpConnection) != null) { -+ if (var1 && TcpConnection.getOutputStream(this.theTcpConnection) != null) { - TcpConnection.getOutputStream(this.theTcpConnection).flush(); - } - } catch (IOException var8) { -- if(!TcpConnection.isTerminating(this.theTcpConnection)) { -+ if (!TcpConnection.isTerminating(this.theTcpConnection)) { - TcpConnection.sendError(this.theTcpConnection, var8); - } - -@@ -34,11 +36,11 @@ - try { - sleep(2L); - } catch (InterruptedException var7) { -+ ; - } - } - } finally { -- TcpConnection.b.getAndDecrement(); -+ TcpConnection.field_74469_b.getAndDecrement(); - } -- - } - } ---- /dev/null -+++ org/spoutcraft/api/gui/DirtBackground.java -@@ -1,0 +1,52 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.api.gui; -+ -+import net.minecraft.src.Minecraft; -+ -+import org.lwjgl.opengl.GL11; -+ -+import net.minecraft.src.ResourceLocation; -+ -+import org.spoutcraft.api.Spoutcraft; -+import org.spoutcraft.api.UnsafeClass; -+import org.spoutcraft.client.SpoutClient; -+ -+@UnsafeClass -+public class DirtBackground extends GenericWidget{ -+ public WidgetType getType() { -+ return WidgetType.DirtBackground; -+ } -+ -+ public void render() { -+ GL11.glDisable(2896 /*GL_LIGHTING*/); -+ GL11.glDisable(2912 /*GL_FOG*/); -+ Minecraft.getMinecraft().getTextureManager().bindTexture(new ResourceLocation("textures/gui/container/creative_inventory/tabs.png")); -+ GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); -+ float var3 = 32.0F; -+ Spoutcraft.getTessellator().startDrawingQuads(); -+ Spoutcraft.getTessellator().setColorOpaqueInt(4210752); -+ Spoutcraft.getTessellator().addVertexWithUV(0.0D, this.getHeight(), 0.0D, 0.0D, this.getHeight() / var3); -+ Spoutcraft.getTessellator().addVertexWithUV(this.getWidth(), this.getHeight(), 0.0D, this.getWidth() / var3, this.getHeight() / var3); -+ Spoutcraft.getTessellator().addVertexWithUV(this.getWidth(), 0.0D, 0.0D, this.getWidth() / var3, 0.0D); -+ Spoutcraft.getTessellator().addVertexWithUV(0.0D, 0.0D, 0.0D, 0.0D, 0.0D); -+ Spoutcraft.getTessellator().draw(); -+ } -+} ---- net/minecraft/src/CommandServerSaveAll.java -+++ net/minecraft/src/CommandServerSaveAll.java -@@ -7,18 +7,22 @@ - return "save-all"; - } - -+ /** -+ * Return the required permission level for this command. -+ */ - public int getRequiredPermissionLevel() { - return 4; - } - -- public String getCommandUsage(ICommandSender var1) { -+ public String getCommandUsage(ICommandSender par1ICommandSender) { - return "commands.save.usage"; - } - -- public void processCommand(ICommandSender var1, String[] var2) { -+ public void processCommand(ICommandSender par1ICommandSender, String[] par2ArrayOfStr) { - MinecraftServer var3 = MinecraftServer.getServer(); -- var1.sendChatToPlayer(ChatMessageComponent.createFromTranslationKey("commands.save.start")); -- if(var3.getConfigurationManager() != null) { -+ par1ICommandSender.sendChatToPlayer(ChatMessageComponent.createFromTranslationKey("commands.save.start")); -+ -+ if (var3.getConfigurationManager() != null) { - var3.getConfigurationManager().saveAllPlayerData(); - } - -@@ -26,36 +30,37 @@ - int var4; - WorldServer var5; - boolean var6; -- for(var4 = 0; var4 < var3.worldServers.length; ++var4) { -- if(var3.worldServers[var4] != null) { -+ -+ for (var4 = 0; var4 < var3.worldServers.length; ++var4) { -+ if (var3.worldServers[var4] != null) { - var5 = var3.worldServers[var4]; -- var6 = var5.levelSaving; -- var5.levelSaving = false; -+ var6 = var5.canNotSave; -+ var5.canNotSave = false; - var5.saveAllChunks(true, (IProgressUpdate)null); -- var5.levelSaving = var6; -+ var5.canNotSave = var6; - } - } - -- if(var2.length > 0 && "flush".equals(var2[0])) { -- var1.sendChatToPlayer(ChatMessageComponent.createFromTranslationKey("commands.save.flushStart")); -+ if (par2ArrayOfStr.length > 0 && "flush".equals(par2ArrayOfStr[0])) { -+ par1ICommandSender.sendChatToPlayer(ChatMessageComponent.createFromTranslationKey("commands.save.flushStart")); - -- for(var4 = 0; var4 < var3.worldServers.length; ++var4) { -- if(var3.worldServers[var4] != null) { -+ for (var4 = 0; var4 < var3.worldServers.length; ++var4) { -+ if (var3.worldServers[var4] != null) { - var5 = var3.worldServers[var4]; -- var6 = var5.levelSaving; -- var5.levelSaving = false; -+ var6 = var5.canNotSave; -+ var5.canNotSave = false; - var5.saveChunkData(); -- var5.levelSaving = var6; -+ var5.canNotSave = var6; - } - } - -- var1.sendChatToPlayer(ChatMessageComponent.createFromTranslationKey("commands.save.flushEnd")); -+ par1ICommandSender.sendChatToPlayer(ChatMessageComponent.createFromTranslationKey("commands.save.flushEnd")); - } - } catch (MinecraftException var7) { -- notifyAdmins(var1, "commands.save.failed", new Object[]{var7.getMessage()}); -+ notifyAdmins(par1ICommandSender, "commands.save.failed", new Object[] {var7.getMessage()}); - return; - } - -- notifyAdmins(var1, "commands.save.success", new Object[0]); -+ notifyAdmins(par1ICommandSender, "commands.save.success", new Object[0]); - } - } ---- net/minecraft/src/ModelOcelot.java -+++ net/minecraft/src/ModelOcelot.java -@@ -3,13 +3,29 @@ - import org.lwjgl.opengl.GL11; - - public class ModelOcelot extends ModelBase { -+ -+ /** The back left leg model for the Ocelot. */ - ModelRenderer ocelotBackLeftLeg; -+ -+ /** The back right leg model for the Ocelot. */ - ModelRenderer ocelotBackRightLeg; -+ -+ /** The front left leg model for the Ocelot. */ - ModelRenderer ocelotFrontLeftLeg; -+ -+ /** The front right leg model for the Ocelot. */ - ModelRenderer ocelotFrontRightLeg; -+ -+ /** The tail model for the Ocelot. */ - ModelRenderer ocelotTail; -+ -+ /** The second part of tail model for the Ocelot. */ - ModelRenderer ocelotTail2; -+ -+ /** The head model for the Ocelot. */ - ModelRenderer ocelotHead; -+ -+ /** The body model for the Ocelot. */ - ModelRenderer ocelotBody; - int field_78163_i = 1; - -@@ -48,67 +64,81 @@ - this.ocelotFrontRightLeg.setRotationPoint(-1.2F, 13.8F, -5.0F); - } - -- public void render(Entity var1, float var2, float var3, float var4, float var5, float var6, float var7) { -- this.setRotationAngles(var2, var3, var4, var5, var6, var7, var1); -- if(this.isChild) { -+ /** -+ * Sets the models various rotation angles then renders the model. -+ */ -+ public void render(Entity par1Entity, float par2, float par3, float par4, float par5, float par6, float par7) { -+ this.setRotationAngles(par2, par3, par4, par5, par6, par7, par1Entity); -+ -+ if (this.isChild) { - float var8 = 2.0F; - GL11.glPushMatrix(); - GL11.glScalef(1.5F / var8, 1.5F / var8, 1.5F / var8); -- GL11.glTranslatef(0.0F, 10.0F * var7, 4.0F * var7); -- this.ocelotHead.render(var7); -+ GL11.glTranslatef(0.0F, 10.0F * par7, 4.0F * par7); -+ this.ocelotHead.render(par7); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glScalef(1.0F / var8, 1.0F / var8, 1.0F / var8); -- GL11.glTranslatef(0.0F, 24.0F * var7, 0.0F); -- this.ocelotBody.render(var7); -- this.ocelotBackLeftLeg.render(var7); -- this.ocelotBackRightLeg.render(var7); -- this.ocelotFrontLeftLeg.render(var7); -- this.ocelotFrontRightLeg.render(var7); -- this.ocelotTail.render(var7); -- this.ocelotTail2.render(var7); -+ GL11.glTranslatef(0.0F, 24.0F * par7, 0.0F); -+ this.ocelotBody.render(par7); -+ this.ocelotBackLeftLeg.render(par7); -+ this.ocelotBackRightLeg.render(par7); -+ this.ocelotFrontLeftLeg.render(par7); -+ this.ocelotFrontRightLeg.render(par7); -+ this.ocelotTail.render(par7); -+ this.ocelotTail2.render(par7); - GL11.glPopMatrix(); - } else { -- this.ocelotHead.render(var7); -- this.ocelotBody.render(var7); -- this.ocelotTail.render(var7); -- this.ocelotTail2.render(var7); -- this.ocelotBackLeftLeg.render(var7); -- this.ocelotBackRightLeg.render(var7); -- this.ocelotFrontLeftLeg.render(var7); -- this.ocelotFrontRightLeg.render(var7); -+ this.ocelotHead.render(par7); -+ this.ocelotBody.render(par7); -+ this.ocelotTail.render(par7); -+ this.ocelotTail2.render(par7); -+ this.ocelotBackLeftLeg.render(par7); -+ this.ocelotBackRightLeg.render(par7); -+ this.ocelotFrontLeftLeg.render(par7); -+ this.ocelotFrontRightLeg.render(par7); - } -- - } - -- public void setRotationAngles(float var1, float var2, float var3, float var4, float var5, float var6, Entity var7) { -- this.ocelotHead.rotateAngleX = var5 / (180.0F / (float)Math.PI); -- this.ocelotHead.rotateAngleY = var4 / (180.0F / (float)Math.PI); -- if(this.field_78163_i != 3) { -- this.ocelotBody.rotateAngleX = (float)Math.PI * 0.5F; -- if(this.field_78163_i == 2) { -- this.ocelotBackLeftLeg.rotateAngleX = MathHelper.cos(var1 * 0.6662F) * 1.0F * var2; -- this.ocelotBackRightLeg.rotateAngleX = MathHelper.cos(var1 * 0.6662F + 0.3F) * 1.0F * var2; -- this.ocelotFrontLeftLeg.rotateAngleX = MathHelper.cos(var1 * 0.6662F + (float)Math.PI + 0.3F) * 1.0F * var2; -- this.ocelotFrontRightLeg.rotateAngleX = MathHelper.cos(var1 * 0.6662F + (float)Math.PI) * 1.0F * var2; -- this.ocelotTail2.rotateAngleX = (float)Math.PI * 0.55F + (float)Math.PI * 0.1F * MathHelper.cos(var1) * var2; -+ /** -+ * Sets the model's various rotation angles. For bipeds, par1 and par2 are used for animating the movement of arms and -+ * legs, where par1 represents the time(so that arms and legs swing back and forth) and par2 represents how "far" arms -+ * and legs can swing at most. -+ */ -+ public void setRotationAngles(float par1, float par2, float par3, float par4, float par5, float par6, Entity par7Entity) { -+ this.ocelotHead.rotateAngleX = par5 / (180F / (float)Math.PI); -+ this.ocelotHead.rotateAngleY = par4 / (180F / (float)Math.PI); -+ -+ if (this.field_78163_i != 3) { -+ this.ocelotBody.rotateAngleX = ((float)Math.PI / 2F); -+ -+ if (this.field_78163_i == 2) { -+ this.ocelotBackLeftLeg.rotateAngleX = MathHelper.cos(par1 * 0.6662F) * 1.0F * par2; -+ this.ocelotBackRightLeg.rotateAngleX = MathHelper.cos(par1 * 0.6662F + 0.3F) * 1.0F * par2; -+ this.ocelotFrontLeftLeg.rotateAngleX = MathHelper.cos(par1 * 0.6662F + (float)Math.PI + 0.3F) * 1.0F * par2; -+ this.ocelotFrontRightLeg.rotateAngleX = MathHelper.cos(par1 * 0.6662F + (float)Math.PI) * 1.0F * par2; -+ this.ocelotTail2.rotateAngleX = 1.7278761F + ((float)Math.PI / 10F) * MathHelper.cos(par1) * par2; - } else { -- this.ocelotBackLeftLeg.rotateAngleX = MathHelper.cos(var1 * 0.6662F) * 1.0F * var2; -- this.ocelotBackRightLeg.rotateAngleX = MathHelper.cos(var1 * 0.6662F + (float)Math.PI) * 1.0F * var2; -- this.ocelotFrontLeftLeg.rotateAngleX = MathHelper.cos(var1 * 0.6662F + (float)Math.PI) * 1.0F * var2; -- this.ocelotFrontRightLeg.rotateAngleX = MathHelper.cos(var1 * 0.6662F) * 1.0F * var2; -- if(this.field_78163_i == 1) { -- this.ocelotTail2.rotateAngleX = (float)Math.PI * 0.55F + (float)Math.PI * 0.25F * MathHelper.cos(var1) * var2; -+ this.ocelotBackLeftLeg.rotateAngleX = MathHelper.cos(par1 * 0.6662F) * 1.0F * par2; -+ this.ocelotBackRightLeg.rotateAngleX = MathHelper.cos(par1 * 0.6662F + (float)Math.PI) * 1.0F * par2; -+ this.ocelotFrontLeftLeg.rotateAngleX = MathHelper.cos(par1 * 0.6662F + (float)Math.PI) * 1.0F * par2; -+ this.ocelotFrontRightLeg.rotateAngleX = MathHelper.cos(par1 * 0.6662F) * 1.0F * par2; -+ -+ if (this.field_78163_i == 1) { -+ this.ocelotTail2.rotateAngleX = 1.7278761F + ((float)Math.PI / 4F) * MathHelper.cos(par1) * par2; - } else { -- this.ocelotTail2.rotateAngleX = (float)Math.PI * 0.55F + (float)Math.PI * 0.15F * MathHelper.cos(var1) * var2; -+ this.ocelotTail2.rotateAngleX = 1.7278761F + 0.47123894F * MathHelper.cos(par1) * par2; - } - } - } -- - } - -- public void setLivingAnimations(EntityLivingBase var1, float var2, float var3, float var4) { -- EntityOcelot var5 = (EntityOcelot)var1; -+ /** -+ * Used for easily adding entity-dependent animations. The second and third float params here are the same second and -+ * third as in the setRotationAngles method. -+ */ -+ public void setLivingAnimations(EntityLivingBase par1EntityLivingBase, float par2, float par3, float par4) { -+ EntityOcelot var5 = (EntityOcelot)par1EntityLivingBase; - this.ocelotBody.rotationPointY = 12.0F; - this.ocelotBody.rotationPointZ = -10.0F; - this.ocelotHead.rotationPointY = 15.0F; -@@ -122,23 +152,24 @@ - this.ocelotBackLeftLeg.rotationPointY = this.ocelotBackRightLeg.rotationPointY = 18.0F; - this.ocelotBackLeftLeg.rotationPointZ = this.ocelotBackRightLeg.rotationPointZ = 5.0F; - this.ocelotTail.rotateAngleX = 0.9F; -- if(var5.isSneaking()) { -+ -+ if (var5.isSneaking()) { - ++this.ocelotBody.rotationPointY; - this.ocelotHead.rotationPointY += 2.0F; - ++this.ocelotTail.rotationPointY; - this.ocelotTail2.rotationPointY += -4.0F; - this.ocelotTail2.rotationPointZ += 2.0F; -- this.ocelotTail.rotateAngleX = (float)Math.PI * 0.5F; -- this.ocelotTail2.rotateAngleX = (float)Math.PI * 0.5F; -+ this.ocelotTail.rotateAngleX = ((float)Math.PI / 2F); -+ this.ocelotTail2.rotateAngleX = ((float)Math.PI / 2F); - this.field_78163_i = 0; -- } else if(var5.isSprinting()) { -+ } else if (var5.isSprinting()) { - this.ocelotTail2.rotationPointY = this.ocelotTail.rotationPointY; - this.ocelotTail2.rotationPointZ += 2.0F; -- this.ocelotTail.rotateAngleX = (float)Math.PI * 0.5F; -- this.ocelotTail2.rotateAngleX = (float)Math.PI * 0.5F; -+ this.ocelotTail.rotateAngleX = ((float)Math.PI / 2F); -+ this.ocelotTail2.rotateAngleX = ((float)Math.PI / 2F); - this.field_78163_i = 2; -- } else if(var5.isSitting()) { -- this.ocelotBody.rotateAngleX = (float)Math.PI * 0.25F; -+ } else if (var5.isSitting()) { -+ this.ocelotBody.rotateAngleX = ((float)Math.PI / 4F); - this.ocelotBody.rotationPointY += -4.0F; - this.ocelotBody.rotationPointZ += 5.0F; - this.ocelotHead.rotationPointY += -3.3F; -@@ -147,18 +178,17 @@ - this.ocelotTail.rotationPointZ += -2.0F; - this.ocelotTail2.rotationPointY += 2.0F; - this.ocelotTail2.rotationPointZ += -0.8F; -- this.ocelotTail.rotateAngleX = (float)Math.PI * 0.55F; -- this.ocelotTail2.rotateAngleX = (float)Math.PI * 0.85F; -- this.ocelotFrontLeftLeg.rotateAngleX = this.ocelotFrontRightLeg.rotateAngleX = (float)Math.PI * -0.05F; -+ this.ocelotTail.rotateAngleX = 1.7278761F; -+ this.ocelotTail2.rotateAngleX = 2.670354F; -+ this.ocelotFrontLeftLeg.rotateAngleX = this.ocelotFrontRightLeg.rotateAngleX = -0.15707964F; - this.ocelotFrontLeftLeg.rotationPointY = this.ocelotFrontRightLeg.rotationPointY = 15.8F; - this.ocelotFrontLeftLeg.rotationPointZ = this.ocelotFrontRightLeg.rotationPointZ = -7.0F; -- this.ocelotBackLeftLeg.rotateAngleX = this.ocelotBackRightLeg.rotateAngleX = (float)Math.PI * -0.5F; -+ this.ocelotBackLeftLeg.rotateAngleX = this.ocelotBackRightLeg.rotateAngleX = -((float)Math.PI / 2F); - this.ocelotBackLeftLeg.rotationPointY = this.ocelotBackRightLeg.rotationPointY = 21.0F; - this.ocelotBackLeftLeg.rotationPointZ = this.ocelotBackRightLeg.rotationPointZ = 1.0F; - this.field_78163_i = 3; - } else { - this.field_78163_i = 1; - } -- - } - } ---- net/minecraft/src/BlockFire.java -+++ net/minecraft/src/BlockFire.java -@@ -3,15 +3,26 @@ - import java.util.Random; - - public class BlockFire extends Block { -+ -+ /** The chance this block will encourage nearby blocks to catch on fire */ - private int[] chanceToEncourageFire = new int[256]; -+ -+ /** -+ * This is an array indexed by block ID the larger the number in the array the more likely a block type will catch -+ * fires -+ */ - private int[] abilityToCatchFire = new int[256]; - private Icon[] iconArray; - -- protected BlockFire(int var1) { -- super(var1, Material.fire); -+ protected BlockFire(int par1) { -+ super(par1, Material.fire); - this.setTickRandomly(true); - } - -+ /** -+ * This method is called on a block after all other blocks gets already created. You can use it to reference and -+ * configure something on the block that needs the others ones. -+ */ - public void initializeBlock() { - this.setBurnRate(Block.planks.blockID, 5, 20); - this.setBurnRate(Block.woodDoubleSlab.blockID, 5, 20); -@@ -32,107 +43,141 @@ - this.setBurnRate(Block.hay.blockID, 60, 20); - } - -- private void setBurnRate(int var1, int var2, int var3) { -- this.chanceToEncourageFire[var1] = var2; -- this.abilityToCatchFire[var1] = var3; -+ /** -+ * Sets the burn rate for a block. The larger abilityToCatchFire the more easily it will catch. The larger -+ * chanceToEncourageFire the faster it will burn and spread to other blocks. Args: blockID, chanceToEncourageFire, -+ * abilityToCatchFire -+ */ -+ private void setBurnRate(int par1, int par2, int par3) { -+ this.chanceToEncourageFire[par1] = par2; -+ this.abilityToCatchFire[par1] = par3; - } - -- public AxisAlignedBB getCollisionBoundingBoxFromPool(World var1, int var2, int var3, int var4) { -+ /** -+ * Returns a bounding box from the pool of bounding boxes (this means this box can change after the pool has been -+ * cleared to be reused) -+ */ -+ public AxisAlignedBB getCollisionBoundingBoxFromPool(World par1World, int par2, int par3, int par4) { - return null; - } - -+ /** -+ * Is this block (a) opaque and (b) a full 1m cube? This determines whether or not to render the shared face of two -+ * adjacent blocks and also whether the player can attach torches, redstone wire, etc to this block. -+ */ - public boolean isOpaqueCube() { - return false; - } - -+ /** -+ * If this block doesn't render as an ordinary block it will return False (examples: signs, buttons, stairs, etc) -+ */ - public boolean renderAsNormalBlock() { - return false; - } - -+ /** -+ * The type of render function that is called for this block -+ */ - public int getRenderType() { - return 3; - } - -- public int quantityDropped(Random var1) { -+ /** -+ * Returns the quantity of items to drop on block destruction. -+ */ -+ public int quantityDropped(Random par1Random) { - return 0; - } - -- public int tickRate(World var1) { -+ /** -+ * How many world ticks before ticking -+ */ -+ public int tickRate(World par1World) { - return 30; - } - -- public void updateTick(World var1, int var2, int var3, int var4, Random var5) { -- if(var1.getGameRules().getGameRuleBooleanValue("doFireTick")) { -- boolean var6 = var1.getBlockId(var2, var3 - 1, var4) == Block.netherrack.blockID; -- if(var1.provider instanceof WorldProviderEnd && var1.getBlockId(var2, var3 - 1, var4) == Block.bedrock.blockID) { -+ /** -+ * Ticks the block if it's been scheduled -+ */ -+ public void updateTick(World par1World, int par2, int par3, int par4, Random par5Random) { -+ if (par1World.getGameRules().getGameRuleBooleanValue("doFireTick")) { -+ boolean var6 = par1World.getBlockId(par2, par3 - 1, par4) == Block.netherrack.blockID; -+ -+ if (par1World.provider instanceof WorldProviderEnd && par1World.getBlockId(par2, par3 - 1, par4) == Block.bedrock.blockID) { - var6 = true; - } - -- if(!this.canPlaceBlockAt(var1, var2, var3, var4)) { -- var1.setBlockToAir(var2, var3, var4); -+ if (!this.canPlaceBlockAt(par1World, par2, par3, par4)) { -+ par1World.setBlockToAir(par2, par3, par4); - } - -- if(var6 || !var1.isRaining() || !var1.canLightningStrikeAt(var2, var3, var4) && !var1.canLightningStrikeAt(var2 - 1, var3, var4) && !var1.canLightningStrikeAt(var2 + 1, var3, var4) && !var1.canLightningStrikeAt(var2, var3, var4 - 1) && !var1.canLightningStrikeAt(var2, var3, var4 + 1)) { -- int var7 = var1.getBlockMetadata(var2, var3, var4); -- if(var7 < 15) { -- var1.setBlockMetadata(var2, var3, var4, var7 + var5.nextInt(3) / 2, 4); -+ if (!var6 && par1World.isRaining() && (par1World.canLightningStrikeAt(par2, par3, par4) || par1World.canLightningStrikeAt(par2 - 1, par3, par4) || par1World.canLightningStrikeAt(par2 + 1, par3, par4) || par1World.canLightningStrikeAt(par2, par3, par4 - 1) || par1World.canLightningStrikeAt(par2, par3, par4 + 1))) { -+ par1World.setBlockToAir(par2, par3, par4); -+ } else { -+ int var7 = par1World.getBlockMetadata(par2, par3, par4); -+ -+ if (var7 < 15) { -+ par1World.setBlockMetadataWithNotify(par2, par3, par4, var7 + par5Random.nextInt(3) / 2, 4); - } - -- var1.scheduleBlockUpdate(var2, var3, var4, this.blockID, this.tickRate(var1) + var5.nextInt(10)); -- if(!var6 && !this.canNeighborBurn(var1, var2, var3, var4)) { -- if(!var1.doesBlockHaveSolidTopSurface(var2, var3 - 1, var4) || var7 > 3) { -- var1.setBlockToAir(var2, var3, var4); -+ par1World.scheduleBlockUpdate(par2, par3, par4, this.blockID, this.tickRate(par1World) + par5Random.nextInt(10)); -+ -+ if (!var6 && !this.canNeighborBurn(par1World, par2, par3, par4)) { -+ if (!par1World.doesBlockHaveSolidTopSurface(par2, par3 - 1, par4) || var7 > 3) { -+ par1World.setBlockToAir(par2, par3, par4); - } -- -- } else if(!var6 && !this.canBlockCatchFire(var1, var2, var3 - 1, var4) && var7 == 15 && var5.nextInt(4) == 0) { -- var1.setBlockToAir(var2, var3, var4); -+ } else if (!var6 && !this.canBlockCatchFire(par1World, par2, par3 - 1, par4) && var7 == 15 && par5Random.nextInt(4) == 0) { -+ par1World.setBlockToAir(par2, par3, par4); - } else { -- boolean var8 = var1.isBlockHighHumidity(var2, var3, var4); -+ boolean var8 = par1World.isBlockHighHumidity(par2, par3, par4); - byte var9 = 0; -- if(var8) { -+ -+ if (var8) { - var9 = -50; - } - -- this.tryToCatchBlockOnFire(var1, var2 + 1, var3, var4, 300 + var9, var5, var7); -- this.tryToCatchBlockOnFire(var1, var2 - 1, var3, var4, 300 + var9, var5, var7); -- this.tryToCatchBlockOnFire(var1, var2, var3 - 1, var4, 250 + var9, var5, var7); -- this.tryToCatchBlockOnFire(var1, var2, var3 + 1, var4, 250 + var9, var5, var7); -- this.tryToCatchBlockOnFire(var1, var2, var3, var4 - 1, 300 + var9, var5, var7); -- this.tryToCatchBlockOnFire(var1, var2, var3, var4 + 1, 300 + var9, var5, var7); -+ this.tryToCatchBlockOnFire(par1World, par2 + 1, par3, par4, 300 + var9, par5Random, var7); -+ this.tryToCatchBlockOnFire(par1World, par2 - 1, par3, par4, 300 + var9, par5Random, var7); -+ this.tryToCatchBlockOnFire(par1World, par2, par3 - 1, par4, 250 + var9, par5Random, var7); -+ this.tryToCatchBlockOnFire(par1World, par2, par3 + 1, par4, 250 + var9, par5Random, var7); -+ this.tryToCatchBlockOnFire(par1World, par2, par3, par4 - 1, 300 + var9, par5Random, var7); -+ this.tryToCatchBlockOnFire(par1World, par2, par3, par4 + 1, 300 + var9, par5Random, var7); - -- for(int var10 = var2 - 1; var10 <= var2 + 1; ++var10) { -- for(int var11 = var4 - 1; var11 <= var4 + 1; ++var11) { -- for(int var12 = var3 - 1; var12 <= var3 + 4; ++var12) { -- if(var10 != var2 || var12 != var3 || var11 != var4) { -+ for (int var10 = par2 - 1; var10 <= par2 + 1; ++var10) { -+ for (int var11 = par4 - 1; var11 <= par4 + 1; ++var11) { -+ for (int var12 = par3 - 1; var12 <= par3 + 4; ++var12) { -+ if (var10 != par2 || var12 != par3 || var11 != par4) { - int var13 = 100; -- if(var12 > var3 + 1) { -- var13 += (var12 - (var3 + 1)) * 100; -+ -+ if (var12 > par3 + 1) { -+ var13 += (var12 - (par3 + 1)) * 100; - } - -- int var14 = this.getChanceOfNeighborsEncouragingFire(var1, var10, var12, var11); -- if(var14 > 0) { -- int var15 = (var14 + 40 + var1.difficultySetting * 7) / (var7 + 30); -- if(var8) { -+ int var14 = this.getChanceOfNeighborsEncouragingFire(par1World, var10, var12, var11); -+ -+ if (var14 > 0) { -+ int var15 = (var14 + 40 + par1World.difficultySetting * 7) / (var7 + 30); -+ -+ if (var8) { - var15 /= 2; - } - -- if(var15 > 0 && var5.nextInt(var13) <= var15 && (!var1.isRaining() || !var1.canLightningStrikeAt(var10, var12, var11)) && !var1.canLightningStrikeAt(var10 - 1, var12, var4) && !var1.canLightningStrikeAt(var10 + 1, var12, var11) && !var1.canLightningStrikeAt(var10, var12, var11 - 1) && !var1.canLightningStrikeAt(var10, var12, var11 + 1)) { -- int var16 = var7 + var5.nextInt(5) / 4; -- if(var16 > 15) { -+ if (var15 > 0 && par5Random.nextInt(var13) <= var15 && (!par1World.isRaining() || !par1World.canLightningStrikeAt(var10, var12, var11)) && !par1World.canLightningStrikeAt(var10 - 1, var12, par4) && !par1World.canLightningStrikeAt(var10 + 1, var12, var11) && !par1World.canLightningStrikeAt(var10, var12, var11 - 1) && !par1World.canLightningStrikeAt(var10, var12, var11 + 1)) { -+ int var16 = var7 + par5Random.nextInt(5) / 4; -+ -+ if (var16 > 15) { - var16 = 15; - } - -- var1.setBlock(var10, var12, var11, this.blockID, var16, 3); -+ par1World.setBlock(var10, var12, var11, this.blockID, var16, 3); - } - } - } - } - } - } -- - } -- } else { -- var1.setBlockToAir(var2, var3, var4); - } - } - } -@@ -141,155 +186,194 @@ - return false; - } - -- private void tryToCatchBlockOnFire(World var1, int var2, int var3, int var4, int var5, Random var6, int var7) { -- int var8 = this.abilityToCatchFire[var1.getBlockId(var2, var3, var4)]; -- if(var6.nextInt(var5) < var8) { -- boolean var9 = var1.getBlockId(var2, var3, var4) == Block.tnt.blockID; -- if(var6.nextInt(var7 + 10) < 5 && !var1.canLightningStrikeAt(var2, var3, var4)) { -- int var10 = var7 + var6.nextInt(5) / 4; -- if(var10 > 15) { -+ private void tryToCatchBlockOnFire(World par1World, int par2, int par3, int par4, int par5, Random par6Random, int par7) { -+ int var8 = this.abilityToCatchFire[par1World.getBlockId(par2, par3, par4)]; -+ -+ if (par6Random.nextInt(par5) < var8) { -+ boolean var9 = par1World.getBlockId(par2, par3, par4) == Block.tnt.blockID; -+ -+ if (par6Random.nextInt(par7 + 10) < 5 && !par1World.canLightningStrikeAt(par2, par3, par4)) { -+ int var10 = par7 + par6Random.nextInt(5) / 4; -+ -+ if (var10 > 15) { - var10 = 15; - } - -- var1.setBlock(var2, var3, var4, this.blockID, var10, 3); -+ par1World.setBlock(par2, par3, par4, this.blockID, var10, 3); - } else { -- var1.setBlockToAir(var2, var3, var4); -+ par1World.setBlockToAir(par2, par3, par4); - } - -- if(var9) { -- Block.tnt.onBlockDestroyedByPlayer(var1, var2, var3, var4, 1); -+ if (var9) { -+ Block.tnt.onBlockDestroyedByPlayer(par1World, par2, par3, par4, 1); - } - } -- -- } -- -- private boolean canNeighborBurn(World var1, int var2, int var3, int var4) { -- return this.canBlockCatchFire(var1, var2 + 1, var3, var4) ? true : (this.canBlockCatchFire(var1, var2 - 1, var3, var4) ? true : (this.canBlockCatchFire(var1, var2, var3 - 1, var4) ? true : (this.canBlockCatchFire(var1, var2, var3 + 1, var4) ? true : (this.canBlockCatchFire(var1, var2, var3, var4 - 1) ? true : this.canBlockCatchFire(var1, var2, var3, var4 + 1))))); -- } -- -- private int getChanceOfNeighborsEncouragingFire(World var1, int var2, int var3, int var4) { -+ } -+ -+ /** -+ * Returns true if at least one block next to this one can burn. -+ */ -+ private boolean canNeighborBurn(World par1World, int par2, int par3, int par4) { -+ return this.canBlockCatchFire(par1World, par2 + 1, par3, par4) ? true : (this.canBlockCatchFire(par1World, par2 - 1, par3, par4) ? true : (this.canBlockCatchFire(par1World, par2, par3 - 1, par4) ? true : (this.canBlockCatchFire(par1World, par2, par3 + 1, par4) ? true : (this.canBlockCatchFire(par1World, par2, par3, par4 - 1) ? true : this.canBlockCatchFire(par1World, par2, par3, par4 + 1))))); -+ } -+ -+ /** -+ * Gets the highest chance of a neighbor block encouraging this block to catch fire -+ */ -+ private int getChanceOfNeighborsEncouragingFire(World par1World, int par2, int par3, int par4) { - byte var5 = 0; -- if(!var1.isAirBlock(var2, var3, var4)) { -+ -+ if (!par1World.isAirBlock(par2, par3, par4)) { - return 0; - } else { -- int var6 = this.getChanceToEncourageFire(var1, var2 + 1, var3, var4, var5); -- var6 = this.getChanceToEncourageFire(var1, var2 - 1, var3, var4, var6); -- var6 = this.getChanceToEncourageFire(var1, var2, var3 - 1, var4, var6); -- var6 = this.getChanceToEncourageFire(var1, var2, var3 + 1, var4, var6); -- var6 = this.getChanceToEncourageFire(var1, var2, var3, var4 - 1, var6); -- var6 = this.getChanceToEncourageFire(var1, var2, var3, var4 + 1, var6); -+ int var6 = this.getChanceToEncourageFire(par1World, par2 + 1, par3, par4, var5); -+ var6 = this.getChanceToEncourageFire(par1World, par2 - 1, par3, par4, var6); -+ var6 = this.getChanceToEncourageFire(par1World, par2, par3 - 1, par4, var6); -+ var6 = this.getChanceToEncourageFire(par1World, par2, par3 + 1, par4, var6); -+ var6 = this.getChanceToEncourageFire(par1World, par2, par3, par4 - 1, var6); -+ var6 = this.getChanceToEncourageFire(par1World, par2, par3, par4 + 1, var6); - return var6; - } - } - -+ /** -+ * Returns if this block is collidable (only used by Fire). Args: x, y, z -+ */ - public boolean isCollidable() { - return false; - } - -- public boolean canBlockCatchFire(IBlockAccess var1, int var2, int var3, int var4) { -- return this.chanceToEncourageFire[var1.getBlockId(var2, var3, var4)] > 0; -- } -- -- public int getChanceToEncourageFire(World var1, int var2, int var3, int var4, int var5) { -- int var6 = this.chanceToEncourageFire[var1.getBlockId(var2, var3, var4)]; -- return var6 > var5 ? var6 : var5; -- } -- -- public boolean canPlaceBlockAt(World var1, int var2, int var3, int var4) { -- return var1.doesBlockHaveSolidTopSurface(var2, var3 - 1, var4) || this.canNeighborBurn(var1, var2, var3, var4); -- } -- -- public void onNeighborBlockChange(World var1, int var2, int var3, int var4, int var5) { -- if(!var1.doesBlockHaveSolidTopSurface(var2, var3 - 1, var4) && !this.canNeighborBurn(var1, var2, var3, var4)) { -- var1.setBlockToAir(var2, var3, var4); -+ /** -+ * Checks the specified block coordinate to see if it can catch fire. Args: blockAccess, x, y, z -+ */ -+ public boolean canBlockCatchFire(IBlockAccess par1IBlockAccess, int par2, int par3, int par4) { -+ return this.chanceToEncourageFire[par1IBlockAccess.getBlockId(par2, par3, par4)] > 0; -+ } -+ -+ /** -+ * Retrieves a specified block's chance to encourage their neighbors to burn and if the number is greater than the -+ * current number passed in it will return its number instead of the passed in one. Args: world, x, y, z, -+ * curChanceToEncourageFire -+ */ -+ public int getChanceToEncourageFire(World par1World, int par2, int par3, int par4, int par5) { -+ int var6 = this.chanceToEncourageFire[par1World.getBlockId(par2, par3, par4)]; -+ return var6 > par5 ? var6 : par5; -+ } -+ -+ /** -+ * Checks to see if its valid to put this block at the specified coordinates. Args: world, x, y, z -+ */ -+ public boolean canPlaceBlockAt(World par1World, int par2, int par3, int par4) { -+ return par1World.doesBlockHaveSolidTopSurface(par2, par3 - 1, par4) || this.canNeighborBurn(par1World, par2, par3, par4); -+ } -+ -+ /** -+ * Lets the block know when one of its neighbor changes. Doesn't know which neighbor changed (coordinates passed are -+ * their own) Args: x, y, z, neighbor blockID -+ */ -+ public void onNeighborBlockChange(World par1World, int par2, int par3, int par4, int par5) { -+ if (!par1World.doesBlockHaveSolidTopSurface(par2, par3 - 1, par4) && !this.canNeighborBurn(par1World, par2, par3, par4)) { -+ par1World.setBlockToAir(par2, par3, par4); - } -- - } - -- public void onBlockAdded(World var1, int var2, int var3, int var4) { -- if(var1.provider.dimensionId > 0 || var1.getBlockId(var2, var3 - 1, var4) != Block.obsidian.blockID || !Block.portal.tryToCreatePortal(var1, var2, var3, var4)) { -- if(!var1.doesBlockHaveSolidTopSurface(var2, var3 - 1, var4) && !this.canNeighborBurn(var1, var2, var3, var4)) { -- var1.setBlockToAir(var2, var3, var4); -+ /** -+ * Called whenever the block is added into the world. Args: world, x, y, z -+ */ -+ public void onBlockAdded(World par1World, int par2, int par3, int par4) { -+ if (par1World.provider.dimensionId > 0 || par1World.getBlockId(par2, par3 - 1, par4) != Block.obsidian.blockID || !Block.portal.tryToCreatePortal(par1World, par2, par3, par4)) { -+ if (!par1World.doesBlockHaveSolidTopSurface(par2, par3 - 1, par4) && !this.canNeighborBurn(par1World, par2, par3, par4)) { -+ par1World.setBlockToAir(par2, par3, par4); - } else { -- var1.scheduleBlockUpdate(var2, var3, var4, this.blockID, this.tickRate(var1) + var1.s.nextInt(10)); -+ par1World.scheduleBlockUpdate(par2, par3, par4, this.blockID, this.tickRate(par1World) + par1World.rand.nextInt(10)); - } - } - } - -- public void randomDisplayTick(World var1, int var2, int var3, int var4, Random var5) { -- if(var5.nextInt(24) == 0) { -- var1.playSound((double)((float)var2 + 0.5F), (double)((float)var3 + 0.5F), (double)((float)var4 + 0.5F), "fire.fire", 1.0F + var5.nextFloat(), var5.nextFloat() * 0.7F + 0.3F, false); -+ /** -+ * A randomly called display update to be able to add particles or other items for display -+ */ -+ public void randomDisplayTick(World par1World, int par2, int par3, int par4, Random par5Random) { -+ if (par5Random.nextInt(24) == 0) { -+ par1World.playSound((double)((float)par2 + 0.5F), (double)((float)par3 + 0.5F), (double)((float)par4 + 0.5F), "fire.fire", 1.0F + par5Random.nextFloat(), par5Random.nextFloat() * 0.7F + 0.3F, false); - } - - int var6; - float var7; - float var8; - float var9; -- if(!var1.doesBlockHaveSolidTopSurface(var2, var3 - 1, var4) && !Block.fire.canBlockCatchFire(var1, var2, var3 - 1, var4)) { -- if(Block.fire.canBlockCatchFire(var1, var2 - 1, var3, var4)) { -- for(var6 = 0; var6 < 2; ++var6) { -- var7 = (float)var2 + var5.nextFloat() * 0.1F; -- var8 = (float)var3 + var5.nextFloat(); -- var9 = (float)var4 + var5.nextFloat(); -- var1.spawnParticle("largesmoke", (double)var7, (double)var8, (double)var9, 0.0D, 0.0D, 0.0D); -- } -- } -- -- if(Block.fire.canBlockCatchFire(var1, var2 + 1, var3, var4)) { -- for(var6 = 0; var6 < 2; ++var6) { -- var7 = (float)(var2 + 1) - var5.nextFloat() * 0.1F; -- var8 = (float)var3 + var5.nextFloat(); -- var9 = (float)var4 + var5.nextFloat(); -- var1.spawnParticle("largesmoke", (double)var7, (double)var8, (double)var9, 0.0D, 0.0D, 0.0D); -- } -- } -- -- if(Block.fire.canBlockCatchFire(var1, var2, var3, var4 - 1)) { -- for(var6 = 0; var6 < 2; ++var6) { -- var7 = (float)var2 + var5.nextFloat(); -- var8 = (float)var3 + var5.nextFloat(); -- var9 = (float)var4 + var5.nextFloat() * 0.1F; -- var1.spawnParticle("largesmoke", (double)var7, (double)var8, (double)var9, 0.0D, 0.0D, 0.0D); -- } -- } -- -- if(Block.fire.canBlockCatchFire(var1, var2, var3, var4 + 1)) { -- for(var6 = 0; var6 < 2; ++var6) { -- var7 = (float)var2 + var5.nextFloat(); -- var8 = (float)var3 + var5.nextFloat(); -- var9 = (float)(var4 + 1) - var5.nextFloat() * 0.1F; -- var1.spawnParticle("largesmoke", (double)var7, (double)var8, (double)var9, 0.0D, 0.0D, 0.0D); -- } -- } -- -- if(Block.fire.canBlockCatchFire(var1, var2, var3 + 1, var4)) { -- for(var6 = 0; var6 < 2; ++var6) { -- var7 = (float)var2 + var5.nextFloat(); -- var8 = (float)(var3 + 1) - var5.nextFloat() * 0.1F; -- var9 = (float)var4 + var5.nextFloat(); -- var1.spawnParticle("largesmoke", (double)var7, (double)var8, (double)var9, 0.0D, 0.0D, 0.0D); -+ -+ if (!par1World.doesBlockHaveSolidTopSurface(par2, par3 - 1, par4) && !Block.fire.canBlockCatchFire(par1World, par2, par3 - 1, par4)) { -+ if (Block.fire.canBlockCatchFire(par1World, par2 - 1, par3, par4)) { -+ for (var6 = 0; var6 < 2; ++var6) { -+ var7 = (float)par2 + par5Random.nextFloat() * 0.1F; -+ var8 = (float)par3 + par5Random.nextFloat(); -+ var9 = (float)par4 + par5Random.nextFloat(); -+ par1World.spawnParticle("largesmoke", (double)var7, (double)var8, (double)var9, 0.0D, 0.0D, 0.0D); -+ } -+ } -+ -+ if (Block.fire.canBlockCatchFire(par1World, par2 + 1, par3, par4)) { -+ for (var6 = 0; var6 < 2; ++var6) { -+ var7 = (float)(par2 + 1) - par5Random.nextFloat() * 0.1F; -+ var8 = (float)par3 + par5Random.nextFloat(); -+ var9 = (float)par4 + par5Random.nextFloat(); -+ par1World.spawnParticle("largesmoke", (double)var7, (double)var8, (double)var9, 0.0D, 0.0D, 0.0D); -+ } -+ } -+ -+ if (Block.fire.canBlockCatchFire(par1World, par2, par3, par4 - 1)) { -+ for (var6 = 0; var6 < 2; ++var6) { -+ var7 = (float)par2 + par5Random.nextFloat(); -+ var8 = (float)par3 + par5Random.nextFloat(); -+ var9 = (float)par4 + par5Random.nextFloat() * 0.1F; -+ par1World.spawnParticle("largesmoke", (double)var7, (double)var8, (double)var9, 0.0D, 0.0D, 0.0D); -+ } -+ } -+ -+ if (Block.fire.canBlockCatchFire(par1World, par2, par3, par4 + 1)) { -+ for (var6 = 0; var6 < 2; ++var6) { -+ var7 = (float)par2 + par5Random.nextFloat(); -+ var8 = (float)par3 + par5Random.nextFloat(); -+ var9 = (float)(par4 + 1) - par5Random.nextFloat() * 0.1F; -+ par1World.spawnParticle("largesmoke", (double)var7, (double)var8, (double)var9, 0.0D, 0.0D, 0.0D); -+ } -+ } -+ -+ if (Block.fire.canBlockCatchFire(par1World, par2, par3 + 1, par4)) { -+ for (var6 = 0; var6 < 2; ++var6) { -+ var7 = (float)par2 + par5Random.nextFloat(); -+ var8 = (float)(par3 + 1) - par5Random.nextFloat() * 0.1F; -+ var9 = (float)par4 + par5Random.nextFloat(); -+ par1World.spawnParticle("largesmoke", (double)var7, (double)var8, (double)var9, 0.0D, 0.0D, 0.0D); - } - } - } else { -- for(var6 = 0; var6 < 3; ++var6) { -- var7 = (float)var2 + var5.nextFloat(); -- var8 = (float)var3 + var5.nextFloat() * 0.5F + 0.5F; -- var9 = (float)var4 + var5.nextFloat(); -- var1.spawnParticle("largesmoke", (double)var7, (double)var8, (double)var9, 0.0D, 0.0D, 0.0D); -+ for (var6 = 0; var6 < 3; ++var6) { -+ var7 = (float)par2 + par5Random.nextFloat(); -+ var8 = (float)par3 + par5Random.nextFloat() * 0.5F + 0.5F; -+ var9 = (float)par4 + par5Random.nextFloat(); -+ par1World.spawnParticle("largesmoke", (double)var7, (double)var8, (double)var9, 0.0D, 0.0D, 0.0D); - } - } -- -- } -- -- public void registerIcons(IconRegister var1) { -- this.iconArray = new Icon[]{var1.registerIcon(this.getTextureName() + "_layer_0"), var1.registerIcon(this.getTextureName() + "_layer_1")}; -- } -- -- public Icon getFireIcon(int var1) { -- return this.iconArray[var1]; -- } -- -- public Icon getIcon(int var1, int var2) { -+ } -+ -+ /** -+ * When this method is called, your block should register all the icons it needs with the given IconRegister. This is -+ * the only chance you get to register icons. -+ */ -+ public void registerIcons(IconRegister par1IconRegister) { -+ this.iconArray = new Icon[] {par1IconRegister.registerIcon(this.getTextureName() + "_layer_0"), par1IconRegister.registerIcon(this.getTextureName() + "_layer_1")}; -+ } -+ -+ public Icon getFireIcon(int par1) { -+ return this.iconArray[par1]; -+ } -+ -+ /** -+ * From the specified side and block metadata retrieves the blocks texture. Args: side, metadata -+ */ -+ public Icon getIcon(int par1, int par2) { - return this.iconArray[0]; - } - } ---- net/minecraft/src/WorldGenShrub.java -+++ net/minecraft/src/WorldGenShrub.java -@@ -6,43 +6,42 @@ - private int field_76527_a; - private int field_76526_b; - -- public WorldGenShrub(int var1, int var2) { -- this.field_76526_b = var1; -- this.field_76527_a = var2; -+ public WorldGenShrub(int par1, int par2) { -+ this.field_76526_b = par1; -+ this.field_76527_a = par2; - } - -- public boolean generate(World var1, Random var2, int var3, int var4, int var5) { -- boolean var6 = false; -- -- while(true) { -- int var15 = var1.getBlockId(var3, var4, var5); -- if(var15 != 0 && var15 != Block.leaves.blockID || var4 <= 0) { -- int var7 = var1.getBlockId(var3, var4, var5); -- if(var7 == Block.dirt.blockID || var7 == Block.grass.blockID) { -- ++var4; -- this.setBlockAndMetadata(var1, var3, var4, var5, Block.wood.blockID, this.field_76526_b); -- -- for(int var8 = var4; var8 <= var4 + 2; ++var8) { -- int var9 = var8 - var4; -- int var10 = 2 - var9; -- -- for(int var11 = var3 - var10; var11 <= var3 + var10; ++var11) { -- int var12 = var11 - var3; -- -- for(int var13 = var5 - var10; var13 <= var5 + var10; ++var13) { -- int var14 = var13 - var5; -- if((Math.abs(var12) != var10 || Math.abs(var14) != var10 || var2.nextInt(2) != 0) && !Block.opaqueCubeLookup[var1.getBlockId(var11, var8, var13)]) { -- this.setBlockAndMetadata(var1, var11, var8, var13, Block.leaves.blockID, this.field_76527_a); -- } -- } -+ public boolean generate(World par1World, Random par2Random, int par3, int par4, int par5) { -+ int var15; -+ -+ for (boolean var6 = false; ((var15 = par1World.getBlockId(par3, par4, par5)) == 0 || var15 == Block.leaves.blockID) && par4 > 0; --par4) { -+ ; -+ } -+ -+ int var7 = par1World.getBlockId(par3, par4, par5); -+ -+ if (var7 == Block.dirt.blockID || var7 == Block.grass.blockID) { -+ ++par4; -+ this.setBlockAndMetadata(par1World, par3, par4, par5, Block.wood.blockID, this.field_76526_b); -+ -+ for (int var8 = par4; var8 <= par4 + 2; ++var8) { -+ int var9 = var8 - par4; -+ int var10 = 2 - var9; -+ -+ for (int var11 = par3 - var10; var11 <= par3 + var10; ++var11) { -+ int var12 = var11 - par3; -+ -+ for (int var13 = par5 - var10; var13 <= par5 + var10; ++var13) { -+ int var14 = var13 - par5; -+ -+ if ((Math.abs(var12) != var10 || Math.abs(var14) != var10 || par2Random.nextInt(2) != 0) && !Block.opaqueCubeLookup[par1World.getBlockId(var11, var8, var13)]) { -+ this.setBlockAndMetadata(par1World, var11, var8, var13, Block.leaves.blockID, this.field_76527_a); - } - } - } -- -- return true; - } -- -- --var4; - } -+ -+ return true; - } - } ---- net/minecraft/src/WorldType.java -+++ net/minecraft/src/WorldType.java -@@ -1,66 +1,106 @@ - package net.minecraft.src; - - public class WorldType { -+ -+ /** List of world types. */ - public static final WorldType[] worldTypes = new WorldType[16]; -+ -+ /** Default world type. */ - public static final WorldType DEFAULT = (new WorldType(0, "default", 1)).setVersioned(); -+ -+ /** Flat world type. */ - public static final WorldType FLAT = new WorldType(1, "flat"); -+ -+ /** Large Biome world Type. */ - public static final WorldType LARGE_BIOMES = new WorldType(2, "largeBiomes"); -+ -+ /** Default (1.1) world type. */ - public static final WorldType DEFAULT_1_1 = (new WorldType(8, "default_1_1", 0)).setCanBeCreated(false); -+ -+ /** ID for this world type. */ - private final int worldTypeId; -- private final String g; -+ -+ /** 'default' or 'flat' */ -+ private final String worldType; -+ -+ /** The int version of the ChunkProvider that generated this world. */ - private final int generatorVersion; -+ -+ /** -+ * Whether this world type can be generated. Normally true; set to false for out-of-date generator versions. -+ */ - private boolean canBeCreated; -+ -+ /** Whether this WorldType has a version or not. */ - private boolean isWorldTypeVersioned; - -- private WorldType(int var1, String var2) { -- this(var1, var2, 0); -+ private WorldType(int par1, String par2Str) { -+ this(par1, par2Str, 0); - } - -- private WorldType(int var1, String var2, int var3) { -- this.g = var2; -- this.generatorVersion = var3; -+ private WorldType(int par1, String par2Str, int par3) { -+ this.worldType = par2Str; -+ this.generatorVersion = par3; - this.canBeCreated = true; -- this.worldTypeId = var1; -- worldTypes[var1] = this; -+ this.worldTypeId = par1; -+ worldTypes[par1] = this; - } - - public String getWorldTypeName() { -- return this.g; -+ return this.worldType; - } - -+ /** -+ * Gets the translation key for the name of this world type. -+ */ - public String getTranslateName() { -- return "generator." + this.g; -+ return "generator." + this.worldType; - } - -+ /** -+ * Returns generatorVersion. -+ */ - public int getGeneratorVersion() { - return this.generatorVersion; - } - -- public WorldType getWorldTypeForGeneratorVersion(int var1) { -- return this == DEFAULT && var1 == 0 ? DEFAULT_1_1 : this; -+ public WorldType getWorldTypeForGeneratorVersion(int par1) { -+ return this == DEFAULT && par1 == 0 ? DEFAULT_1_1 : this; - } - -- private WorldType setCanBeCreated(boolean var1) { -- this.canBeCreated = var1; -+ /** -+ * Sets canBeCreated to the provided value, and returns this. -+ */ -+ private WorldType setCanBeCreated(boolean par1) { -+ this.canBeCreated = par1; - return this; - } - -+ /** -+ * Gets whether this WorldType can be used to generate a new world. -+ */ - public boolean getCanBeCreated() { - return this.canBeCreated; - } - -+ /** -+ * Flags this world type as having an associated version. -+ */ - private WorldType setVersioned() { - this.isWorldTypeVersioned = true; - return this; - } - -+ /** -+ * Returns true if this world Type has a version associated with it. -+ */ - public boolean isVersioned() { - return this.isWorldTypeVersioned; - } - -- public static WorldType parseWorldType(String var0) { -- for(int var1 = 0; var1 < worldTypes.length; ++var1) { -- if(worldTypes[var1] != null && worldTypes[var1].g.equalsIgnoreCase(var0)) { -+ public static WorldType parseWorldType(String par0Str) { -+ for (int var1 = 0; var1 < worldTypes.length; ++var1) { -+ if (worldTypes[var1] != null && worldTypes[var1].worldType.equalsIgnoreCase(par0Str)) { - return worldTypes[var1]; - } - } ---- net/minecraft/client/main/Main.java -+++ net/minecraft/client/main/Main.java -@@ -6,18 +6,22 @@ - import java.net.Proxy; - import java.net.Proxy.Type; - import java.util.List; -+ - import joptsimple.ArgumentAcceptingOptionSpec; - import joptsimple.NonOptionArgumentSpec; - import joptsimple.OptionParser; - import joptsimple.OptionSet; --import joptsimple.OptionSpec; -+import net.minecraft.src.GameWindowListener; - import net.minecraft.src.MainProxyAuthenticator; - import net.minecraft.src.MainShutdownHook; - import net.minecraft.src.Minecraft; - import net.minecraft.src.Session; - -+import org.spoutcraft.client.SpoutClient; -+import org.spoutcraft.client.io.DownloadAssets; -+ - public class Main { -- public static void main(String[] var0) { -+ public static void main(String[] par0ArrayOfStr) { - System.setProperty("java.net.preferIPv4Stack", "true"); - OptionParser var1 = new OptionParser(); - var1.allowsUnrecognizedOptions(); -@@ -33,53 +37,59 @@ - ArgumentAcceptingOptionSpec var9 = var1.accepts("proxyUser").withRequiredArg(); - ArgumentAcceptingOptionSpec var10 = var1.accepts("proxyPass").withRequiredArg(); - ArgumentAcceptingOptionSpec var11 = var1.accepts("username").withRequiredArg().defaultsTo("Player" + Minecraft.getSystemTime() % 1000L, new String[0]); -- ArgumentAcceptingOptionSpec var12 = var1.accepts("session").withRequiredArg(); -+ ArgumentAcceptingOptionSpec var12 = var1.accepts("session").withRequiredArg().defaultsTo("Invalid Session ID", new String[0]); - ArgumentAcceptingOptionSpec var13 = var1.accepts("version").withRequiredArg().required(); - ArgumentAcceptingOptionSpec var14 = var1.accepts("width").withRequiredArg().ofType(Integer.class).defaultsTo(Integer.valueOf(854), new Integer[0]); - ArgumentAcceptingOptionSpec var15 = var1.accepts("height").withRequiredArg().ofType(Integer.class).defaultsTo(Integer.valueOf(480), new Integer[0]); - NonOptionArgumentSpec var16 = var1.nonOptions(); -- OptionSet var17 = var1.parse(var0); -- List var18 = var17.valuesOf((OptionSpec)var16); -- String var19 = (String)var17.valueOf((OptionSpec)var7); -+ OptionSet var17 = var1.parse(par0ArrayOfStr); -+ List var18 = var17.valuesOf(var16); -+ String var19 = (String)var17.valueOf(var7); - Proxy var20 = Proxy.NO_PROXY; -- if(var19 != null) { -+ -+ if (var19 != null) { - try { -- var20 = new Proxy(Type.SOCKS, new InetSocketAddress(var19, ((Integer)var17.valueOf((OptionSpec)var8)).intValue())); -+ var20 = new Proxy(Type.SOCKS, new InetSocketAddress(var19, ((Integer)var17.valueOf(var8)).intValue())); - } catch (Exception var34) { -+ ; - } - } - -- String var21 = (String)var17.valueOf((OptionSpec)var9); -- String var22 = (String)var17.valueOf((OptionSpec)var10); -- if(!var20.equals(Proxy.NO_PROXY) && func_110121_a(var21) && func_110121_a(var22)) { -+ String var21 = (String)var17.valueOf(var9); -+ String var22 = (String)var17.valueOf(var10); -+ -+ if (!var20.equals(Proxy.NO_PROXY) && func_110121_a(var21) && func_110121_a(var22)) { - Authenticator.setDefault(new MainProxyAuthenticator(var21, var22)); - } - -- int var23 = ((Integer)var17.valueOf((OptionSpec)var14)).intValue(); -- int var24 = ((Integer)var17.valueOf((OptionSpec)var15)).intValue(); -+ int var23 = ((Integer)var17.valueOf(var14)).intValue(); -+ int var24 = ((Integer)var17.valueOf(var15)).intValue(); - boolean var25 = var17.has("fullscreen"); - boolean var26 = var17.has("demo"); -- String var27 = (String)var17.valueOf((OptionSpec)var13); -- File var28 = (File)var17.valueOf((OptionSpec)var4); -- File var29 = var17.has((OptionSpec)var5) ? (File)var17.valueOf((OptionSpec)var5) : new File(var28, "assets/"); -- File var30 = var17.has((OptionSpec)var6) ? (File)var17.valueOf((OptionSpec)var6) : new File(var28, "resourcepacks/"); -+ String var27 = (String)var17.valueOf(var13); -+ File var28 = (File)var17.valueOf(var4); -+ File var29 = var17.has(var5) ? (File)var17.valueOf(var5) : new File(var28, "assets/"); -+ File var30 = var17.has(var6) ? (File)var17.valueOf(var6) : new File(var28, "resourcepacks/"); - Session var31 = new Session((String)var11.value(var17), (String)var12.value(var17)); -- Minecraft var32 = new Minecraft(var31, var23, var24, var25, var26, var28, var29, var30, var20, var27); -- String var33 = (String)var17.valueOf((OptionSpec)var2); -- if(var33 != null) { -- var32.setServer(var33, ((Integer)var17.valueOf((OptionSpec)var3)).intValue()); -+ Minecraft var32 = new Minecraft(var31, var23, var24, var25, var26, var28, var29, var30, var20, var27); -+ String var33 = (String)var17.valueOf(var2); -+ -+ if (var33 != null) { -+ var32.setServer(var33, ((Integer)var17.valueOf(var3)).intValue()); - } - - Runtime.getRuntime().addShutdownHook(new MainShutdownHook()); -- if(!var18.isEmpty()) { -+ -+ if (!var18.isEmpty()) { - System.out.println("Completely ignored arguments: " + var18); - } - - Thread.currentThread().setName("Minecraft main thread"); -+ DownloadAssets.importOldConfig(); - var32.run(); - } - -- private static boolean func_110121_a(String var0) { -- return var0 != null && !var0.isEmpty(); -+ private static boolean func_110121_a(String par0Str) { -+ return par0Str != null && !par0Str.isEmpty(); - } - } ---- net/minecraft/src/WorldGenBigTree.java -+++ net/minecraft/src/WorldGenBigTree.java -@@ -3,10 +3,19 @@ - import java.util.Random; - - public class WorldGenBigTree extends WorldGenerator { -- static final byte[] otherCoordPairs = new byte[]{(byte)2, (byte)0, (byte)0, (byte)1, (byte)2, (byte)1}; -- Random b = new Random(); -+ -+ /** -+ * Contains three sets of two values that provide complimentary indices for a given 'major' index - 1 and 2 for 0, 0 -+ * and 2 for 1, and 0 and 1 for 2. -+ */ -+ static final byte[] otherCoordPairs = new byte[] {(byte)2, (byte)0, (byte)0, (byte)1, (byte)2, (byte)1}; -+ -+ /** random seed for GenBigTree */ -+ Random rand = new Random(); -+ -+ /** Reference to the World object. */ - World worldObj; -- int[] basePos = new int[]{0, 0, 0}; -+ int[] basePos = new int[] {0, 0, 0}; - int heightLimit; - int height; - double heightAttenuation = 0.618D; -@@ -14,23 +23,42 @@ - double branchSlope = 0.381D; - double scaleWidth = 1.0D; - double leafDensity = 1.0D; -+ -+ /** -+ * Currently always 1, can be set to 2 in the class constructor to generate a double-sized tree trunk for big trees. -+ */ - int trunkSize = 1; -+ -+ /** -+ * Sets the limit of the random value used to initialize the height limit. -+ */ - int heightLimitLimit = 12; -+ -+ /** -+ * Sets the distance limit for how far away the generator will populate leaves from the base leaf node. -+ */ - int leafDistanceLimit = 4; -+ -+ /** Contains a list of a points at which to generate groups of leaves. */ - int[][] leafNodes; - -- public WorldGenBigTree(boolean var1) { -- super(var1); -+ public WorldGenBigTree(boolean par1) { -+ super(par1); - } - -+ /** -+ * Generates a list of leaf nodes for the tree, to be populated by generateLeaves. -+ */ - void generateLeafNodeList() { - this.height = (int)((double)this.heightLimit * this.heightAttenuation); -- if(this.height >= this.heightLimit) { -+ -+ if (this.height >= this.heightLimit) { - this.height = this.heightLimit - 1; - } - - int var1 = (int)(1.382D + Math.pow(this.leafDensity * (double)this.heightLimit / 13.0D, 2.0D)); -- if(var1 < 1) { -+ -+ if (var1 < 1) { - var1 = 1; - } - -@@ -45,101 +73,99 @@ - var2[0][3] = var5; - --var3; - -- while(true) { -- while(var6 >= 0) { -- int var7 = 0; -- float var8 = this.layerSize(var6); -- if(var8 < 0.0F) { -- --var3; -- --var6; -- } else { -- for(double var9 = 0.5D; var7 < var1; ++var7) { -- double var11 = this.scaleWidth * (double)var8 * ((double)this.b.nextFloat() + 0.328D); -- double var13 = (double)this.b.nextFloat() * 2.0D * 3.14159D; -- int var15 = MathHelper.floor_double(var11 * Math.sin(var13) + (double)this.basePos[0] + var9); -- int var16 = MathHelper.floor_double(var11 * Math.cos(var13) + (double)this.basePos[2] + var9); -- int[] var17 = new int[]{var15, var3, var16}; -- int[] var18 = new int[]{var15, var3 + this.leafDistanceLimit, var16}; -- if(this.checkBlockLine(var17, var18) == -1) { -- int[] var19 = new int[]{this.basePos[0], this.basePos[1], this.basePos[2]}; -- double var20 = Math.sqrt(Math.pow((double)Math.abs(this.basePos[0] - var17[0]), 2.0D) + Math.pow((double)Math.abs(this.basePos[2] - var17[2]), 2.0D)); -- double var22 = var20 * this.branchSlope; -- if((double)var17[1] - var22 > (double)var5) { -- var19[1] = var5; -- } else { -- var19[1] = (int)((double)var17[1] - var22); -- } -- -- if(this.checkBlockLine(var19, var17) == -1) { -- var2[var4][0] = var15; -- var2[var4][1] = var3; -- var2[var4][2] = var16; -- var2[var4][3] = var19[1]; -- ++var4; -- } -+ while (var6 >= 0) { -+ int var7 = 0; -+ float var8 = this.layerSize(var6); -+ -+ if (var8 < 0.0F) { -+ --var3; -+ --var6; -+ } else { -+ for (double var9 = 0.5D; var7 < var1; ++var7) { -+ double var11 = this.scaleWidth * (double)var8 * ((double)this.rand.nextFloat() + 0.328D); -+ double var13 = (double)this.rand.nextFloat() * 2.0D * Math.PI; -+ int var15 = MathHelper.floor_double(var11 * Math.sin(var13) + (double)this.basePos[0] + var9); -+ int var16 = MathHelper.floor_double(var11 * Math.cos(var13) + (double)this.basePos[2] + var9); -+ int[] var17 = new int[] {var15, var3, var16}; -+ int[] var18 = new int[] {var15, var3 + this.leafDistanceLimit, var16}; -+ -+ if (this.checkBlockLine(var17, var18) == -1) { -+ int[] var19 = new int[] {this.basePos[0], this.basePos[1], this.basePos[2]}; -+ double var20 = Math.sqrt(Math.pow((double)Math.abs(this.basePos[0] - var17[0]), 2.0D) + Math.pow((double)Math.abs(this.basePos[2] - var17[2]), 2.0D)); -+ double var22 = var20 * this.branchSlope; -+ -+ if ((double)var17[1] - var22 > (double)var5) { -+ var19[1] = var5; -+ } else { -+ var19[1] = (int)((double)var17[1] - var22); -+ } -+ -+ if (this.checkBlockLine(var19, var17) == -1) { -+ var2[var4][0] = var15; -+ var2[var4][1] = var3; -+ var2[var4][2] = var16; -+ var2[var4][3] = var19[1]; -+ ++var4; - } - } -- -- --var3; -- --var6; - } -+ -+ --var3; -+ --var6; - } -- -- this.leafNodes = new int[var4][4]; -- System.arraycopy(var2, 0, this.leafNodes, 0, var4); -- return; - } -+ -+ this.leafNodes = new int[var4][4]; -+ System.arraycopy(var2, 0, this.leafNodes, 0, var4); - } - -- void genTreeLayer(int var1, int var2, int var3, float var4, byte var5, int var6) { -- int var7 = (int)((double)var4 + 0.618D); -- byte var8 = otherCoordPairs[var5]; -- byte var9 = otherCoordPairs[var5 + 3]; -- int[] var10 = new int[]{var1, var2, var3}; -- int[] var11 = new int[]{0, 0, 0}; -+ void genTreeLayer(int par1, int par2, int par3, float par4, byte par5, int par6) { -+ int var7 = (int)((double)par4 + 0.618D); -+ byte var8 = otherCoordPairs[par5]; -+ byte var9 = otherCoordPairs[par5 + 3]; -+ int[] var10 = new int[] {par1, par2, par3}; -+ int[] var11 = new int[] {0, 0, 0}; - int var12 = -var7; - int var13 = -var7; - -- label32: -- for(var11[var5] = var10[var5]; var12 <= var7; ++var12) { -+ for (var11[par5] = var10[par5]; var12 <= var7; ++var12) { - var11[var8] = var10[var8] + var12; - var13 = -var7; - -- while(true) { -- while(true) { -- if(var13 > var7) { -- continue label32; -- } -- -- double var15 = Math.pow((double)Math.abs(var12) + 0.5D, 2.0D) + Math.pow((double)Math.abs(var13) + 0.5D, 2.0D); -- if(var15 > (double)(var4 * var4)) { -+ while (var13 <= var7) { -+ double var15 = Math.pow((double)Math.abs(var12) + 0.5D, 2.0D) + Math.pow((double)Math.abs(var13) + 0.5D, 2.0D); -+ -+ if (var15 > (double)(par4 * par4)) { -+ ++var13; -+ } else { -+ var11[var9] = var10[var9] + var13; -+ int var14 = this.worldObj.getBlockId(var11[0], var11[1], var11[2]); -+ -+ if (var14 != 0 && var14 != Block.leaves.blockID) { - ++var13; - } else { -- var11[var9] = var10[var9] + var13; -- int var14 = this.worldObj.getBlockId(var11[0], var11[1], var11[2]); -- if(var14 != 0 && var14 != Block.leaves.blockID) { -- ++var13; -- } else { -- this.setBlockAndMetadata(this.worldObj, var11[0], var11[1], var11[2], var6, 0); -- ++var13; -- } -+ this.setBlockAndMetadata(this.worldObj, var11[0], var11[1], var11[2], par6, 0); -+ ++var13; - } - } - } - } -- - } - -- float layerSize(int var1) { -- if((double)var1 < (double)((float)this.heightLimit) * 0.3D) { -+ /** -+ * Gets the rough size of a layer of the tree. -+ */ -+ float layerSize(int par1) { -+ if ((double)par1 < (double)((float)this.heightLimit) * 0.3D) { - return -1.618F; - } else { - float var2 = (float)this.heightLimit / 2.0F; -- float var3 = (float)this.heightLimit / 2.0F - (float)var1; -+ float var3 = (float)this.heightLimit / 2.0F - (float)par1; - float var4; -- if(var3 == 0.0F) { -+ -+ if (var3 == 0.0F) { - var4 = var2; -- } else if(Math.abs(var3) >= var2) { -+ } else if (Math.abs(var3) >= var2) { - var4 = 0.0F; - } else { - var4 = (float)Math.sqrt(Math.pow((double)Math.abs(var2), 2.0D) - Math.pow((double)Math.abs(var3), 2.0D)); -@@ -150,37 +176,44 @@ - } - } - -- float leafSize(int var1) { -- return var1 >= 0 && var1 < this.leafDistanceLimit ? (var1 != 0 && var1 != this.leafDistanceLimit - 1 ? 3.0F : 2.0F) : -1.0F; -+ float leafSize(int par1) { -+ return par1 >= 0 && par1 < this.leafDistanceLimit ? (par1 != 0 && par1 != this.leafDistanceLimit - 1 ? 3.0F : 2.0F) : -1.0F; - } - -- void generateLeafNode(int var1, int var2, int var3) { -- int var4 = var2; -+ /** -+ * Generates the leaves surrounding an individual entry in the leafNodes list. -+ */ -+ void generateLeafNode(int par1, int par2, int par3) { -+ int var4 = par2; - -- for(int var5 = var2 + this.leafDistanceLimit; var4 < var5; ++var4) { -- float var6 = this.leafSize(var4 - var2); -- this.genTreeLayer(var1, var4, var3, var6, (byte)1, Block.leaves.blockID); -+ for (int var5 = par2 + this.leafDistanceLimit; var4 < var5; ++var4) { -+ float var6 = this.leafSize(var4 - par2); -+ this.genTreeLayer(par1, var4, par3, var6, (byte)1, Block.leaves.blockID); - } -- - } - -- void placeBlockLine(int[] var1, int[] var2, int var3) { -- int[] var4 = new int[]{0, 0, 0}; -+ /** -+ * Places a line of the specified block ID into the world from the first coordinate triplet to the second. -+ */ -+ void placeBlockLine(int[] par1ArrayOfInteger, int[] par2ArrayOfInteger, int par3) { -+ int[] var4 = new int[] {0, 0, 0}; - byte var5 = 0; -- - byte var6; -- for(var6 = 0; var5 < 3; ++var5) { -- var4[var5] = var2[var5] - var1[var5]; -- if(Math.abs(var4[var5]) > Math.abs(var4[var6])) { -+ -+ for (var6 = 0; var5 < 3; ++var5) { -+ var4[var5] = par2ArrayOfInteger[var5] - par1ArrayOfInteger[var5]; -+ -+ if (Math.abs(var4[var5]) > Math.abs(var4[var6])) { - var6 = var5; - } - } - -- if(var4[var6] != 0) { -+ if (var4[var6] != 0) { - byte var7 = otherCoordPairs[var6]; - byte var8 = otherCoordPairs[var6 + 3]; - byte var9; -- if(var4[var6] > 0) { -+ -+ if (var4[var6] > 0) { - var9 = 1; - } else { - var9 = -1; -@@ -188,56 +221,66 @@ - - double var10 = (double)var4[var7] / (double)var4[var6]; - double var12 = (double)var4[var8] / (double)var4[var6]; -- int[] var14 = new int[]{0, 0, 0}; -+ int[] var14 = new int[] {0, 0, 0}; - int var15 = 0; - -- for(int var16 = var4[var6] + var9; var15 != var16; var15 += var9) { -- var14[var6] = MathHelper.floor_double((double)(var1[var6] + var15) + 0.5D); -- var14[var7] = MathHelper.floor_double((double)var1[var7] + (double)var15 * var10 + 0.5D); -- var14[var8] = MathHelper.floor_double((double)var1[var8] + (double)var15 * var12 + 0.5D); -+ for (int var16 = var4[var6] + var9; var15 != var16; var15 += var9) { -+ var14[var6] = MathHelper.floor_double((double)(par1ArrayOfInteger[var6] + var15) + 0.5D); -+ var14[var7] = MathHelper.floor_double((double)par1ArrayOfInteger[var7] + (double)var15 * var10 + 0.5D); -+ var14[var8] = MathHelper.floor_double((double)par1ArrayOfInteger[var8] + (double)var15 * var12 + 0.5D); - byte var17 = 0; -- int var18 = Math.abs(var14[0] - var1[0]); -- int var19 = Math.abs(var14[2] - var1[2]); -+ int var18 = Math.abs(var14[0] - par1ArrayOfInteger[0]); -+ int var19 = Math.abs(var14[2] - par1ArrayOfInteger[2]); - int var20 = Math.max(var18, var19); -- if(var20 > 0) { -- if(var18 == var20) { -+ -+ if (var20 > 0) { -+ if (var18 == var20) { - var17 = 4; -- } else if(var19 == var20) { -+ } else if (var19 == var20) { - var17 = 8; - } - } - -- this.setBlockAndMetadata(this.worldObj, var14[0], var14[1], var14[2], var3, var17); -+ this.setBlockAndMetadata(this.worldObj, var14[0], var14[1], var14[2], par3, var17); - } -- - } - } - -+ /** -+ * Generates the leaf portion of the tree as specified by the leafNodes list. -+ */ - void generateLeaves() { - int var1 = 0; - -- for(int var2 = this.leafNodes.length; var1 < var2; ++var1) { -+ for (int var2 = this.leafNodes.length; var1 < var2; ++var1) { - int var3 = this.leafNodes[var1][0]; - int var4 = this.leafNodes[var1][1]; - int var5 = this.leafNodes[var1][2]; - this.generateLeafNode(var3, var4, var5); - } -- -- } -- -- boolean leafNodeNeedsBase(int var1) { -- return (double)var1 >= (double)this.heightLimit * 0.2D; -- } -- -+ } -+ -+ /** -+ * Indicates whether or not a leaf node requires additional wood to be added to preserve integrity. -+ */ -+ boolean leafNodeNeedsBase(int par1) { -+ return (double)par1 >= (double)this.heightLimit * 0.2D; -+ } -+ -+ /** -+ * Places the trunk for the big tree that is being generated. Able to generate double-sized trunks by changing a field -+ * that is always 1 to 2. -+ */ - void generateTrunk() { - int var1 = this.basePos[0]; - int var2 = this.basePos[1]; - int var3 = this.basePos[1] + this.height; - int var4 = this.basePos[2]; -- int[] var5 = new int[]{var1, var2, var4}; -- int[] var6 = new int[]{var1, var3, var4}; -+ int[] var5 = new int[] {var1, var2, var4}; -+ int[] var6 = new int[] {var1, var3, var4}; - this.placeBlockLine(var5, var6, Block.wood.blockID); -- if(this.trunkSize == 2) { -+ -+ if (this.trunkSize == 2) { - ++var5[0]; - ++var6[0]; - this.placeBlockLine(var5, var6, Block.wood.blockID); -@@ -248,44 +291,52 @@ - var6[0] += -1; - this.placeBlockLine(var5, var6, Block.wood.blockID); - } -- - } - -+ /** -+ * Generates additional wood blocks to fill out the bases of different leaf nodes that would otherwise degrade. -+ */ - void generateLeafNodeBases() { - int var1 = 0; - int var2 = this.leafNodes.length; - -- for(int[] var3 = new int[]{this.basePos[0], this.basePos[1], this.basePos[2]}; var1 < var2; ++var1) { -+ for (int[] var3 = new int[] {this.basePos[0], this.basePos[1], this.basePos[2]}; var1 < var2; ++var1) { - int[] var4 = this.leafNodes[var1]; -- int[] var5 = new int[]{var4[0], var4[1], var4[2]}; -+ int[] var5 = new int[] {var4[0], var4[1], var4[2]}; - var3[1] = var4[3]; - int var6 = var3[1] - this.basePos[1]; -- if(this.leafNodeNeedsBase(var6)) { -+ -+ if (this.leafNodeNeedsBase(var6)) { - this.placeBlockLine(var3, var5, (byte)Block.wood.blockID); - } - } -- - } - -- int checkBlockLine(int[] var1, int[] var2) { -- int[] var3 = new int[]{0, 0, 0}; -+ /** -+ * Checks a line of blocks in the world from the first coordinate to triplet to the second, returning the distance (in -+ * blocks) before a non-air, non-leaf block is encountered and/or the end is encountered. -+ */ -+ int checkBlockLine(int[] par1ArrayOfInteger, int[] par2ArrayOfInteger) { -+ int[] var3 = new int[] {0, 0, 0}; - byte var4 = 0; -- - byte var5; -- for(var5 = 0; var4 < 3; ++var4) { -- var3[var4] = var2[var4] - var1[var4]; -- if(Math.abs(var3[var4]) > Math.abs(var3[var5])) { -+ -+ for (var5 = 0; var4 < 3; ++var4) { -+ var3[var4] = par2ArrayOfInteger[var4] - par1ArrayOfInteger[var4]; -+ -+ if (Math.abs(var3[var4]) > Math.abs(var3[var5])) { - var5 = var4; - } - } - -- if(var3[var5] == 0) { -+ if (var3[var5] == 0) { - return -1; - } else { - byte var6 = otherCoordPairs[var5]; - byte var7 = otherCoordPairs[var5 + 3]; - byte var8; -- if(var3[var5] > 0) { -+ -+ if (var3[var5] > 0) { - var8 = 1; - } else { - var8 = -1; -@@ -293,16 +344,17 @@ - - double var9 = (double)var3[var6] / (double)var3[var5]; - double var11 = (double)var3[var7] / (double)var3[var5]; -- int[] var13 = new int[]{0, 0, 0}; -+ int[] var13 = new int[] {0, 0, 0}; - int var14 = 0; -- - int var15; -- for(var15 = var3[var5] + var8; var14 != var15; var14 += var8) { -- var13[var5] = var1[var5] + var14; -- var13[var6] = MathHelper.floor_double((double)var1[var6] + (double)var14 * var9); -- var13[var7] = MathHelper.floor_double((double)var1[var7] + (double)var14 * var11); -+ -+ for (var15 = var3[var5] + var8; var14 != var15; var14 += var8) { -+ var13[var5] = par1ArrayOfInteger[var5] + var14; -+ var13[var6] = MathHelper.floor_double((double)par1ArrayOfInteger[var6] + (double)var14 * var9); -+ var13[var7] = MathHelper.floor_double((double)par1ArrayOfInteger[var7] + (double)var14 * var11); - int var16 = this.worldObj.getBlockId(var13[0], var13[1], var13[2]); -- if(var16 != 0 && var16 != Block.leaves.blockID) { -+ -+ if (var16 != 0 && var16 != Block.leaves.blockID) { - break; - } - } -@@ -311,17 +363,23 @@ - } - } - -+ /** -+ * Returns a boolean indicating whether or not the current location for the tree, spanning basePos to to the height -+ * limit, is valid. -+ */ - boolean validTreeLocation() { -- int[] var1 = new int[]{this.basePos[0], this.basePos[1], this.basePos[2]}; -- int[] var2 = new int[]{this.basePos[0], this.basePos[1] + this.heightLimit - 1, this.basePos[2]}; -+ int[] var1 = new int[] {this.basePos[0], this.basePos[1], this.basePos[2]}; -+ int[] var2 = new int[] {this.basePos[0], this.basePos[1] + this.heightLimit - 1, this.basePos[2]}; - int var3 = this.worldObj.getBlockId(this.basePos[0], this.basePos[1] - 1, this.basePos[2]); -- if(var3 != 2 && var3 != 3) { -+ -+ if (var3 != 2 && var3 != 3) { - return false; - } else { - int var4 = this.checkBlockLine(var1, var2); -- if(var4 == -1) { -+ -+ if (var4 == -1) { - return true; -- } else if(var4 < 6) { -+ } else if (var4 < 6) { - return false; - } else { - this.heightLimit = var4; -@@ -330,28 +388,33 @@ - } - } - -- public void setScale(double var1, double var3, double var5) { -- this.heightLimitLimit = (int)(var1 * 12.0D); -- if(var1 > 0.5D) { -+ /** -+ * Rescales the generator settings, only used in WorldGenBigTree -+ */ -+ public void setScale(double par1, double par3, double par5) { -+ this.heightLimitLimit = (int)(par1 * 12.0D); -+ -+ if (par1 > 0.5D) { - this.leafDistanceLimit = 5; - } - -- this.scaleWidth = var3; -- this.leafDensity = var5; -+ this.scaleWidth = par3; -+ this.leafDensity = par5; - } - -- public boolean generate(World var1, Random var2, int var3, int var4, int var5) { -- this.worldObj = var1; -- long var6 = var2.nextLong(); -- this.b.setSeed(var6); -- this.basePos[0] = var3; -- this.basePos[1] = var4; -- this.basePos[2] = var5; -- if(this.heightLimit == 0) { -- this.heightLimit = 5 + this.b.nextInt(this.heightLimitLimit); -+ public boolean generate(World par1World, Random par2Random, int par3, int par4, int par5) { -+ this.worldObj = par1World; -+ long var6 = par2Random.nextLong(); -+ this.rand.setSeed(var6); -+ this.basePos[0] = par3; -+ this.basePos[1] = par4; -+ this.basePos[2] = par5; -+ -+ if (this.heightLimit == 0) { -+ this.heightLimit = 5 + this.rand.nextInt(this.heightLimitLimit); - } - -- if(!this.validTreeLocation()) { -+ if (!this.validTreeLocation()) { - return false; - } else { - this.generateLeafNodeList(); ---- net/minecraft/src/Packet28EntityVelocity.java -+++ net/minecraft/src/Packet28EntityVelocity.java -@@ -10,73 +10,92 @@ - public int motionY; - public int motionZ; - -- public Packet28EntityVelocity() { -- } -- -- public Packet28EntityVelocity(Entity var1) { -- this(var1.entityId, var1.motionX, var1.motionY, var1.motionZ); -- } -- -- public Packet28EntityVelocity(int var1, double var2, double var4, double var6) { -- this.entityId = var1; -+ public Packet28EntityVelocity() {} -+ -+ public Packet28EntityVelocity(Entity par1Entity) { -+ this(par1Entity.entityId, par1Entity.motionX, par1Entity.motionY, par1Entity.motionZ); -+ } -+ -+ public Packet28EntityVelocity(int par1, double par2, double par4, double par6) { -+ this.entityId = par1; - double var8 = 3.9D; -- if(var2 < -var8) { -- var2 = -var8; -- } -- -- if(var4 < -var8) { -- var4 = -var8; -- } -- -- if(var6 < -var8) { -- var6 = -var8; -- } -- -- if(var2 > var8) { -- var2 = var8; -- } -- -- if(var4 > var8) { -- var4 = var8; -- } -- -- if(var6 > var8) { -- var6 = var8; -- } -- -- this.motionX = (int)(var2 * 8000.0D); -- this.motionY = (int)(var4 * 8000.0D); -- this.motionZ = (int)(var6 * 8000.0D); -- } -- -- public void readPacketData(DataInput var1) throws IOException { -- this.entityId = var1.readInt(); -- this.motionX = var1.readShort(); -- this.motionY = var1.readShort(); -- this.motionZ = var1.readShort(); -- } -- -- public void writePacketData(DataOutput var1) throws IOException { -- var1.writeInt(this.entityId); -- var1.writeShort(this.motionX); -- var1.writeShort(this.motionY); -- var1.writeShort(this.motionZ); -- } -- -- public void processPacket(NetHandler var1) { -- var1.handleEntityVelocity(this); -- } -- -+ -+ if (par2 < -var8) { -+ par2 = -var8; -+ } -+ -+ if (par4 < -var8) { -+ par4 = -var8; -+ } -+ -+ if (par6 < -var8) { -+ par6 = -var8; -+ } -+ -+ if (par2 > var8) { -+ par2 = var8; -+ } -+ -+ if (par4 > var8) { -+ par4 = var8; -+ } -+ -+ if (par6 > var8) { -+ par6 = var8; -+ } -+ -+ this.motionX = (int)(par2 * 8000.0D); -+ this.motionY = (int)(par4 * 8000.0D); -+ this.motionZ = (int)(par6 * 8000.0D); -+ } -+ -+ /** -+ * Abstract. Reads the raw packet data from the data stream. -+ */ -+ public void readPacketData(DataInput par1DataInput) throws IOException { -+ this.entityId = par1DataInput.readInt(); -+ this.motionX = par1DataInput.readShort(); -+ this.motionY = par1DataInput.readShort(); -+ this.motionZ = par1DataInput.readShort(); -+ } -+ -+ /** -+ * Abstract. Writes the raw packet data to the data stream. -+ */ -+ public void writePacketData(DataOutput par1DataOutput) throws IOException { -+ par1DataOutput.writeInt(this.entityId); -+ par1DataOutput.writeShort(this.motionX); -+ par1DataOutput.writeShort(this.motionY); -+ par1DataOutput.writeShort(this.motionZ); -+ } -+ -+ /** -+ * Passes this Packet on to the NetHandler for processing. -+ */ -+ public void processPacket(NetHandler par1NetHandler) { -+ par1NetHandler.handleEntityVelocity(this); -+ } -+ -+ /** -+ * Abstract. Return the size of the packet (not counting the header). -+ */ - public int getPacketSize() { - return 10; - } - -+ /** -+ * only false for the abstract Packet class, all real packets return true -+ */ - public boolean isRealPacket() { - return true; - } - -- public boolean containsSameEntityIDAs(Packet var1) { -- Packet28EntityVelocity var2 = (Packet28EntityVelocity)var1; -+ /** -+ * eg return packet30entity.entityId == entityId; WARNING : will throw if you compare a packet to a different packet -+ * class -+ */ -+ public boolean containsSameEntityIDAs(Packet par1Packet) { -+ Packet28EntityVelocity var2 = (Packet28EntityVelocity)par1Packet; - return var2.entityId == this.entityId; - } - } ---- net/minecraft/src/WorldGenLakes.java -+++ net/minecraft/src/WorldGenLakes.java -@@ -5,40 +5,42 @@ - public class WorldGenLakes extends WorldGenerator { - private int blockIndex; - -- public WorldGenLakes(int var1) { -- this.blockIndex = var1; -+ public WorldGenLakes(int par1) { -+ this.blockIndex = par1; - } - -- public boolean generate(World var1, Random var2, int var3, int var4, int var5) { -- var3 -= 8; -+ public boolean generate(World par1World, Random par2Random, int par3, int par4, int par5) { -+ par3 -= 8; - -- for(var5 -= 8; var4 > 5 && var1.isAirBlock(var3, var4, var5); --var4) { -+ for (par5 -= 8; par4 > 5 && par1World.isAirBlock(par3, par4, par5); --par4) { -+ ; - } - -- if(var4 <= 4) { -+ if (par4 <= 4) { - return false; - } else { -- var4 -= 4; -+ par4 -= 4; - boolean[] var6 = new boolean[2048]; -- int var7 = var2.nextInt(4) + 4; -- -+ int var7 = par2Random.nextInt(4) + 4; - int var8; -- for(var8 = 0; var8 < var7; ++var8) { -- double var9 = var2.nextDouble() * 6.0D + 3.0D; -- double var11 = var2.nextDouble() * 4.0D + 2.0D; -- double var13 = var2.nextDouble() * 6.0D + 3.0D; -- double var15 = var2.nextDouble() * (16.0D - var9 - 2.0D) + 1.0D + var9 / 2.0D; -- double var17 = var2.nextDouble() * (8.0D - var11 - 4.0D) + 2.0D + var11 / 2.0D; -- double var19 = var2.nextDouble() * (16.0D - var13 - 2.0D) + 1.0D + var13 / 2.0D; -- -- for(int var21 = 1; var21 < 15; ++var21) { -- for(int var22 = 1; var22 < 15; ++var22) { -- for(int var23 = 1; var23 < 7; ++var23) { -+ -+ for (var8 = 0; var8 < var7; ++var8) { -+ double var9 = par2Random.nextDouble() * 6.0D + 3.0D; -+ double var11 = par2Random.nextDouble() * 4.0D + 2.0D; -+ double var13 = par2Random.nextDouble() * 6.0D + 3.0D; -+ double var15 = par2Random.nextDouble() * (16.0D - var9 - 2.0D) + 1.0D + var9 / 2.0D; -+ double var17 = par2Random.nextDouble() * (8.0D - var11 - 4.0D) + 2.0D + var11 / 2.0D; -+ double var19 = par2Random.nextDouble() * (16.0D - var13 - 2.0D) + 1.0D + var13 / 2.0D; -+ -+ for (int var21 = 1; var21 < 15; ++var21) { -+ for (int var22 = 1; var22 < 15; ++var22) { -+ for (int var23 = 1; var23 < 7; ++var23) { - double var24 = ((double)var21 - var15) / (var9 / 2.0D); - double var26 = ((double)var23 - var17) / (var11 / 2.0D); - double var28 = ((double)var22 - var19) / (var13 / 2.0D); - double var30 = var24 * var24 + var26 * var26 + var28 * var28; -- if(var30 < 1.0D) { -+ -+ if (var30 < 1.0D) { - var6[(var21 * 16 + var22) * 8 + var23] = true; - } - } -@@ -49,68 +51,74 @@ - int var10; - int var32; - boolean var33; -- for(var8 = 0; var8 < 16; ++var8) { -- for(var32 = 0; var32 < 16; ++var32) { -- for(var10 = 0; var10 < 8; ++var10) { -+ -+ for (var8 = 0; var8 < 16; ++var8) { -+ for (var32 = 0; var32 < 16; ++var32) { -+ for (var10 = 0; var10 < 8; ++var10) { - var33 = !var6[(var8 * 16 + var32) * 8 + var10] && (var8 < 15 && var6[((var8 + 1) * 16 + var32) * 8 + var10] || var8 > 0 && var6[((var8 - 1) * 16 + var32) * 8 + var10] || var32 < 15 && var6[(var8 * 16 + var32 + 1) * 8 + var10] || var32 > 0 && var6[(var8 * 16 + (var32 - 1)) * 8 + var10] || var10 < 7 && var6[(var8 * 16 + var32) * 8 + var10 + 1] || var10 > 0 && var6[(var8 * 16 + var32) * 8 + (var10 - 1)]); -- if(var33) { -- Material var12 = var1.getBlockMaterial(var3 + var8, var4 + var10, var5 + var32); -- if(var10 >= 4 && var12.isLiquid()) { -- return false; -- } -- -- if(var10 < 4 && !var12.isSolid() && var1.getBlockId(var3 + var8, var4 + var10, var5 + var32) != this.blockIndex) { -- return false; -- } -- } -- } -- } -- } -- -- for(var8 = 0; var8 < 16; ++var8) { -- for(var32 = 0; var32 < 16; ++var32) { -- for(var10 = 0; var10 < 8; ++var10) { -- if(var6[(var8 * 16 + var32) * 8 + var10]) { -- var1.setBlock(var3 + var8, var4 + var10, var5 + var32, var10 >= 4 ? 0 : this.blockIndex, 0, 2); -- } -- } -- } -- } -- -- for(var8 = 0; var8 < 16; ++var8) { -- for(var32 = 0; var32 < 16; ++var32) { -- for(var10 = 4; var10 < 8; ++var10) { -- if(var6[(var8 * 16 + var32) * 8 + var10] && var1.getBlockId(var3 + var8, var4 + var10 - 1, var5 + var32) == Block.dirt.blockID && var1.getSavedLightValue(EnumSkyBlock.Sky, var3 + var8, var4 + var10, var5 + var32) > 0) { -- BiomeGenBase var34 = var1.getBiomeGenForCoords(var3 + var8, var5 + var32); -- if(var34.topBlock == Block.mycelium.blockID) { -- var1.setBlock(var3 + var8, var4 + var10 - 1, var5 + var32, Block.mycelium.blockID, 0, 2); -+ -+ if (var33) { -+ Material var12 = par1World.getBlockMaterial(par3 + var8, par4 + var10, par5 + var32); -+ -+ if (var10 >= 4 && var12.isLiquid()) { -+ return false; -+ } -+ -+ if (var10 < 4 && !var12.isSolid() && par1World.getBlockId(par3 + var8, par4 + var10, par5 + var32) != this.blockIndex) { -+ return false; -+ } -+ } -+ } -+ } -+ } -+ -+ for (var8 = 0; var8 < 16; ++var8) { -+ for (var32 = 0; var32 < 16; ++var32) { -+ for (var10 = 0; var10 < 8; ++var10) { -+ if (var6[(var8 * 16 + var32) * 8 + var10]) { -+ par1World.setBlock(par3 + var8, par4 + var10, par5 + var32, var10 >= 4 ? 0 : this.blockIndex, 0, 2); -+ } -+ } -+ } -+ } -+ -+ for (var8 = 0; var8 < 16; ++var8) { -+ for (var32 = 0; var32 < 16; ++var32) { -+ for (var10 = 4; var10 < 8; ++var10) { -+ if (var6[(var8 * 16 + var32) * 8 + var10] && par1World.getBlockId(par3 + var8, par4 + var10 - 1, par5 + var32) == Block.dirt.blockID && par1World.getSavedLightValue(EnumSkyBlock.Sky, par3 + var8, par4 + var10, par5 + var32) > 0) { -+ BiomeGenBase var34 = par1World.getBiomeGenForCoords(par3 + var8, par5 + var32); -+ -+ if (var34.topBlock == Block.mycelium.blockID) { -+ par1World.setBlock(par3 + var8, par4 + var10 - 1, par5 + var32, Block.mycelium.blockID, 0, 2); - } else { -- var1.setBlock(var3 + var8, var4 + var10 - 1, var5 + var32, Block.grass.blockID, 0, 2); -+ par1World.setBlock(par3 + var8, par4 + var10 - 1, par5 + var32, Block.grass.blockID, 0, 2); - } - } - } - } - } - -- if(Block.blocksList[this.blockIndex].blockMaterial == Material.lava) { -- for(var8 = 0; var8 < 16; ++var8) { -- for(var32 = 0; var32 < 16; ++var32) { -- for(var10 = 0; var10 < 8; ++var10) { -+ if (Block.blocksList[this.blockIndex].blockMaterial == Material.lava) { -+ for (var8 = 0; var8 < 16; ++var8) { -+ for (var32 = 0; var32 < 16; ++var32) { -+ for (var10 = 0; var10 < 8; ++var10) { - var33 = !var6[(var8 * 16 + var32) * 8 + var10] && (var8 < 15 && var6[((var8 + 1) * 16 + var32) * 8 + var10] || var8 > 0 && var6[((var8 - 1) * 16 + var32) * 8 + var10] || var32 < 15 && var6[(var8 * 16 + var32 + 1) * 8 + var10] || var32 > 0 && var6[(var8 * 16 + (var32 - 1)) * 8 + var10] || var10 < 7 && var6[(var8 * 16 + var32) * 8 + var10 + 1] || var10 > 0 && var6[(var8 * 16 + var32) * 8 + (var10 - 1)]); -- if(var33 && (var10 < 4 || var2.nextInt(2) != 0) && var1.getBlockMaterial(var3 + var8, var4 + var10, var5 + var32).isSolid()) { -- var1.setBlock(var3 + var8, var4 + var10, var5 + var32, Block.stone.blockID, 0, 2); -+ -+ if (var33 && (var10 < 4 || par2Random.nextInt(2) != 0) && par1World.getBlockMaterial(par3 + var8, par4 + var10, par5 + var32).isSolid()) { -+ par1World.setBlock(par3 + var8, par4 + var10, par5 + var32, Block.stone.blockID, 0, 2); - } - } - } - } - } - -- if(Block.blocksList[this.blockIndex].blockMaterial == Material.water) { -- for(var8 = 0; var8 < 16; ++var8) { -- for(var32 = 0; var32 < 16; ++var32) { -+ if (Block.blocksList[this.blockIndex].blockMaterial == Material.water) { -+ for (var8 = 0; var8 < 16; ++var8) { -+ for (var32 = 0; var32 < 16; ++var32) { - byte var35 = 4; -- if(var1.isBlockFreezable(var3 + var8, var4 + var35, var5 + var32)) { -- var1.setBlock(var3 + var8, var4 + var35, var5 + var32, Block.ice.blockID, 0, 2); -+ -+ if (par1World.isBlockFreezable(par3 + var8, par4 + var35, par5 + var32)) { -+ par1World.setBlock(par3 + var8, par4 + var35, par5 + var32, Block.ice.blockID, 0, 2); - } - } - } ---- net/minecraft/src/DispenserBehaviorEmptyBucket.java -+++ net/minecraft/src/DispenserBehaviorEmptyBucket.java -@@ -3,33 +3,38 @@ - final class DispenserBehaviorEmptyBucket extends BehaviorDefaultDispenseItem { - private final BehaviorDefaultDispenseItem defaultDispenserItemBehavior = new BehaviorDefaultDispenseItem(); - -- public ItemStack dispenseStack(IBlockSource var1, ItemStack var2) { -- EnumFacing var3 = BlockDispenser.getFacing(var1.getBlockMetadata()); -- World var4 = var1.getWorld(); -- int var5 = var1.getXInt() + var3.getFrontOffsetX(); -- int var6 = var1.getYInt() + var3.getFrontOffsetY(); -- int var7 = var1.getZInt() + var3.getFrontOffsetZ(); -+ /** -+ * Dispense the specified stack, play the dispense sound and spawn particles. -+ */ -+ public ItemStack dispenseStack(IBlockSource par1IBlockSource, ItemStack par2ItemStack) { -+ EnumFacing var3 = BlockDispenser.getFacing(par1IBlockSource.getBlockMetadata()); -+ World var4 = par1IBlockSource.getWorld(); -+ int var5 = par1IBlockSource.getXInt() + var3.getFrontOffsetX(); -+ int var6 = par1IBlockSource.getYInt() + var3.getFrontOffsetY(); -+ int var7 = par1IBlockSource.getZInt() + var3.getFrontOffsetZ(); - Material var8 = var4.getBlockMaterial(var5, var6, var7); - int var9 = var4.getBlockMetadata(var5, var6, var7); - Item var10; -- if(Material.water.equals(var8) && var9 == 0) { -+ -+ if (Material.water.equals(var8) && var9 == 0) { - var10 = Item.bucketWater; - } else { -- if(!Material.lava.equals(var8) || var9 != 0) { -- return super.dispenseStack(var1, var2); -+ if (!Material.lava.equals(var8) || var9 != 0) { -+ return super.dispenseStack(par1IBlockSource, par2ItemStack); - } - - var10 = Item.bucketLava; - } - - var4.setBlockToAir(var5, var6, var7); -- if(--var2.stackSize == 0) { -- var2.itemID = var10.itemID; -- var2.stackSize = 1; -- } else if(((TileEntityDispenser)var1.getBlockTileEntity()).addItem(new ItemStack(var10)) < 0) { -- this.defaultDispenserItemBehavior.dispense(var1, new ItemStack(var10)); -+ -+ if (--par2ItemStack.stackSize == 0) { -+ par2ItemStack.itemID = var10.itemID; -+ par2ItemStack.stackSize = 1; -+ } else if (((TileEntityDispenser)par1IBlockSource.getBlockTileEntity()).addItem(new ItemStack(var10)) < 0) { -+ this.defaultDispenserItemBehavior.dispense(par1IBlockSource, new ItemStack(var10)); - } - -- return var2; -+ return par2ItemStack; - } - } ---- net/minecraft/src/ResourcePackRepositoryFilter.java -+++ net/minecraft/src/ResourcePackRepositoryFilter.java -@@ -4,9 +4,9 @@ - import java.io.FileFilter; - - final class ResourcePackRepositoryFilter implements FileFilter { -- public boolean accept(File var1) { -- boolean var2 = var1.isFile() && var1.getName().endsWith(".zip"); -- boolean var3 = var1.isDirectory() && (new File(var1, "pack.mcmeta")).isFile(); -+ public boolean accept(File par1File) { -+ boolean var2 = par1File.isFile() && par1File.getName().endsWith(".zip"); -+ boolean var3 = par1File.isDirectory() && (new File(par1File, "pack.mcmeta")).isFile(); - return var2 || var3; - } - } ---- /dev/null -+++ org/spoutcraft/client/io/CRCManager.java -@@ -1,0 +1,42 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.client.io; -+ -+import java.util.HashMap; -+ -+public class CRCManager { -+ private static HashMap fileNameToCRC = new HashMap(); -+ -+ public static long getCRC(String fileName) { -+ Long result = fileNameToCRC.get(fileName); -+ if (result == null) { -+ return -1; -+ } -+ return result; -+ } -+ -+ public static void setCRC(String fileName, long crc) { -+ fileNameToCRC.put(fileName, crc); -+ } -+ -+ public static void clear() { -+ fileNameToCRC.clear(); -+ } -+} ---- /dev/null -+++ org/spoutcraft/client/gui/mainmenu/MainMenu.java -@@ -1,0 +1,436 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.client.gui.mainmenu; -+ -+import java.io.BufferedReader; -+import java.io.File; -+import java.io.FileReader; -+import java.net.HttpURLConnection; -+import java.net.URL; -+import java.util.ArrayList; -+import java.util.Calendar; -+import java.util.List; -+import java.util.Random; -+ -+import org.apache.commons.io.FileUtils; -+ -+import org.lwjgl.input.Keyboard; -+import org.lwjgl.input.Mouse; -+import org.lwjgl.opengl.GL11; -+ -+import net.minecraft.src.GuiIngameMenu; -+import net.minecraft.src.GuiScreen; -+import net.minecraft.src.GuiSelectWorld; -+import net.minecraft.src.GuiScreenTemporaryResourcePackSelect; -+import net.minecraft.src.StringTranslate; -+ -+import org.bukkit.ChatColor; -+ -+import org.spoutcraft.api.Spoutcraft; -+import org.spoutcraft.api.gui.Button; -+import org.spoutcraft.api.gui.Color; -+import org.spoutcraft.api.gui.GenericButton; -+import org.spoutcraft.api.gui.GenericLabel; -+import org.spoutcraft.api.gui.GenericTexture; -+import org.spoutcraft.api.gui.Label; -+import org.spoutcraft.api.gui.RenderPriority; -+import org.spoutcraft.api.gui.RenderUtil; -+import org.spoutcraft.api.gui.Texture; -+import org.spoutcraft.api.gui.WidgetAnchor; -+import org.spoutcraft.client.SpoutClient; -+import org.spoutcraft.client.config.Configuration; -+import org.spoutcraft.client.gui.MCRenderDelegate; -+import org.spoutcraft.client.gui.settings.GuiSimpleOptions; -+import org.spoutcraft.client.gui.server.GuiFavorites; -+import org.spoutcraft.client.io.CustomTextureManager; -+import org.spoutcraft.client.io.FileUtil; -+import org.spoutcraft.client.special.Holiday; -+import org.spoutcraft.client.special.Resources; -+ -+public class MainMenu extends GuiScreen { -+ public static String mcVersion = "1.6.4"; -+ final static List splashes = new ArrayList(1000); -+ public static boolean hasLoaded = false; -+ Button singleplayer, multiplayer, resources, about, options, quit, language; -+ Texture background, logo; -+ Label splashText, buildNumber, animate, debugText; -+ static String timeOfDay = ""; -+ final static List backgrounds = new ArrayList(); -+ // Animate click delay -+ private static final int CLICK_DELAY = 50; -+ int clickDelay = 0; -+ // Debug -+ long lastTime = System.currentTimeMillis(); -+ int lastFPS = 0; -+ int fpsDelay = 1; -+ int poorFPSCount = 0; -+ -+ public MainMenu() { -+ splashText = new GenericLabel(getSplashText()); -+ updateBackgrounds(); -+ -+ Holiday holiday = Resources.getHoliday(); -+ if (holiday != null) { -+ splashText.setText(holiday.getSplash()); -+ } -+ -+ // Randomize background order -+ Random rand = new Random(); -+ // Randomize by swapping the first background with a random background in the list -+ // Repeat sufficient times -+ for (int i = 0; i < backgrounds.size() * 2; i++) { -+ int newIndex = rand.nextInt(backgrounds.size()); -+ String temp = backgrounds.get(0); -+ backgrounds.set(0, backgrounds.get(newIndex)); -+ backgrounds.set(newIndex, temp); -+ } -+ -+ if (backgrounds.size() == 0) { -+ System.out.println("Failed to find any backgrounds for " + timeOfDay); -+ backgrounds.add("/res/background/day/day1.jpg"); -+ } -+ -+ background = new BackgroundTexture(backgrounds); -+ } -+ -+ private static void updateBackgrounds() { -+ if (!timeOfDay.equals(getTimeFolder())) { -+ timeOfDay = getTimeFolder(); -+ } else { -+ return; -+ } -+ -+ int picture = 1; -+ int pass = 0; -+ StringBuilder builder = new StringBuilder(); -+ backgrounds.clear(); -+ while (true) { -+ builder.append(FileUtil.getAssetsDir().getPath()); -+ builder.append("/background/"); -+ builder.append(timeOfDay); -+ builder.append("/"); -+ builder.append(timeOfDay); -+ builder.append(picture); -+ builder.append(pass == 0 ? ".png" : ".jpg"); -+ if (CustomTextureManager.getTextureFromPath(builder.toString()) != null) { -+ backgrounds.add(builder.toString()); -+ picture++; -+ pass = 0; -+ } else if (pass == 0) { -+ pass++; -+ } else { -+ break; -+ } -+ builder.setLength(0); // Reset -+ } -+ } -+ -+ private static String getSplashText() { -+ BufferedReader br = null; -+ try { -+ if (splashes.isEmpty()) { -+ File splashTextFile = new File(FileUtil.getConfigDir(), "splashes.txt"); -+ br = new BufferedReader(new FileReader(splashTextFile)); -+ String line; -+ splashes.clear(); -+ while ((line = br.readLine()) != null) { -+ splashes.add(new String(line.getBytes(), "UTF-8")); -+ } -+ br.close(); -+ } -+ return splashes.get((new Random()).nextInt(splashes.size())); -+ } catch (Exception e) { -+ e.printStackTrace(); -+ return "I <3 Spout's " + e.getMessage(); -+ } finally { -+ if (br != null) { -+ try { -+ br.close(); -+ } catch (Exception ignore) { -+ } -+ } -+ } -+ } -+ -+ private static String getTimeFolder() { -+ int hours = Calendar.getInstance().get(Calendar.HOUR_OF_DAY); -+ if (hours < 6) { -+ return "night"; -+ } -+ if (hours < 12) { -+ return "day"; -+ } -+ if (hours < 20) { -+ return "evening"; -+ } -+ return "night"; -+ } -+ -+ public void initGui() { -+ int textWidth; -+ -+ StringTranslate translate = StringTranslate.getInstance(); -+ -+ singleplayer = new GenericButton(translate.translateKey("menu.singleplayer")); -+ singleplayer.setGeometry(width - 110, height - 155, 100, 20); -+ -+ multiplayer = new GenericButton(translate.translateKey("menu.multiplayer")); -+ multiplayer.setGeometry(width - 110, height - 130, 100, 20); -+ -+ resources = new GenericButton(translate.translateKey("options.resourcepack")); -+ resources.setGeometry(width - 110, height - 105, 100, 20); -+ -+ buildNumber = new GenericLabel(SpoutClient.getSpoutcraftVersion() + SpoutClient.getSpoutcraftBuild()); -+ textWidth = Spoutcraft.getRenderDelegate().getMinecraftFont().getTextWidth(buildNumber.getText()); -+ buildNumber.setTextColor(new Color(0x6CC0DC)); -+ buildNumber.setGeometry(Math.min(90 - textWidth, width - 296 - textWidth), height - 99, 75, 20); -+ -+ about = new GenericButton("About"); -+ about.setGeometry(Math.min(98, width - 288), height - 105, 51, 20); -+ -+ options = new GenericButton(translate.translateKey("menu.options")); -+ options.setGeometry(Math.min(159, width - 227), height - 105, 51, 20); -+ -+ quit = new GenericButton(translate.translateKey("menu.quit")); -+ quit.setGeometry(Math.min(220, width - 166), height - 105, 61, 20); -+ -+ background.setGeometry(0, 0, width, height); -+ background.setPriority(RenderPriority.Highest); -+ background.setAnchor(WidgetAnchor.TOP_LEFT); -+ background.setLocal(true); -+ -+ splashText.setGeometry(Math.min(100, width - 245), height - 135, 200, 12); -+ splashText.setTextColor(new Color(0x6CC0DC)); -+ textWidth = Spoutcraft.getRenderDelegate().getMinecraftFont().getTextWidth(splashText.getText()); -+ float scale = ((width - 225F) / textWidth); -+ splashText.setScale(Math.min(1.5F, scale)); -+ -+ logo = new ScaledTexture(FileUtil.getAssetsDir().getPath()+"/logo/spoutcraft.png"); -+ ((ScaledTexture) logo).setScale(Math.min(1F, (width - 135F) / 256F)); -+ logo.setGeometry(15, height - 185, 256, 64); -+ logo.setLocal(true); -+ logo.setDrawAlphaChannel(true); -+ -+ animate = new GenericLabel(ChatColor.ITALIC + "Animate"); -+ textWidth = Spoutcraft.getRenderDelegate().getMinecraftFont().getTextWidth(animate.getText()); -+ textWidth *= 75; -+ textWidth /= 100; -+ animate.setGeometry(width - textWidth - 2, height - 8, textWidth, 10); -+ animate.setScale(0.75F); -+ switch (Configuration.getMainMenuState()) { -+ case 1: -+ animate.setTextColor(new Color(0x00EE00)); -+ break; -+ case 2: -+ animate.setTextColor(new Color(0xFFFF00)); -+ break; -+ case 3: -+ animate.setTextColor(new Color(0xFF0000)); -+ break; -+ } -+ -+ debugText = new GenericLabel(); -+ debugText.setTextColor(new Color(0xFFE303)); -+ debugText.setGeometry(1, 1, 12, 100); -+ debugText.setVisible(false); -+ this.getScreen().attachWidgets("Spoutcraft", singleplayer, multiplayer, resources, buildNumber, background, splashText, about, options, logo, quit, animate, debugText); -+ } -+ -+ @Override -+ public void buttonClicked(Button btn) { -+ hasLoaded = true; -+ if (singleplayer == btn) { -+ mc.displayGuiScreen(new GuiSelectWorld(this)); -+ } -+ if (multiplayer == btn) { -+ mc.displayGuiScreen(new GuiFavorites(this)); -+ } -+ if (resources == btn) { -+ this.mc.displayGuiScreen(new GuiScreenTemporaryResourcePackSelect(this, this.mc.gameSettings)); -+ } -+ if (about == btn) { -+ this.mc.displayGuiScreen(new org.spoutcraft.client.gui.about.GuiNewAbout(this)); -+ } -+ if (options == btn) { -+ mc.displayGuiScreen(GuiSimpleOptions.constructOptionsScreen(this)); -+ } -+ if (quit == btn) { -+ mc.shutdownMinecraftApplet(); -+ } -+ } -+ -+ @Override -+ public void drawScreen(int mouseX, int mouseY, float scroll) { -+ super.drawScreen(mouseX, mouseY, scroll); -+ if (Keyboard.isKeyDown(Keyboard.KEY_M)) { -+ //mc.displayGuiScreen(new GuiFavorites(this)); -+ } else if (Keyboard.isKeyDown(Keyboard.KEY_S)) { -+ mc.displayGuiScreen(new GuiSelectWorld(this)); -+ } else if (Keyboard.isKeyDown(Keyboard.KEY_T)) { -+ //mc.displayGuiScreen(new GuiScreenTemporaryResourcePackSelect()); -+ } else if (Keyboard.isKeyDown(Keyboard.KEY_O)) { -+ mc.displayGuiScreen(GuiSimpleOptions.constructOptionsScreen(new GuiIngameMenu())); -+ } -+ -+ long time = System.currentTimeMillis(); -+ if (fpsDelay > 0) { -+ fpsDelay--; -+ } else { -+ long diff = time - lastTime; -+ int fps = (int) (1000 / Math.max(1, diff)); -+ lastFPS = fps; -+ fpsDelay = CLICK_DELAY; -+ if (fps < 10) { -+ poorFPSCount++; -+ } else { -+ poorFPSCount = 0; -+ } -+ if (poorFPSCount > 3) { -+ Configuration.setMainMenuState(3); -+ } -+ } -+ lastTime = time; -+ -+ debugText.setVisible(false); -+ if (Keyboard.isKeyDown(Keyboard.KEY_F3)) { -+ debugText.setVisible(true); -+ debugText.setText("FPS: " + lastFPS); -+ } -+ -+ if (clickDelay > 0) { -+ clickDelay--; -+ } -+ if (Mouse.isButtonDown(0) && this.isInBoundingRect(animate, mouseX, mouseY) && clickDelay == 0) { -+ Configuration.setMainMenuState(Configuration.getMainMenuState() + 1); -+ if (Configuration.getMainMenuState() > 3) { -+ Configuration.setMainMenuState(1); -+ } -+ Configuration.write(); -+ switch (Configuration.getMainMenuState()) { -+ case 1: -+ animate.setTextColor(new Color(0x00EE00)); -+ break; -+ case 2: -+ animate.setTextColor(new Color(0xFFFF00)); -+ break; -+ case 3: -+ animate.setTextColor(new Color(0xFF0000)); -+ break; -+ } -+ clickDelay = CLICK_DELAY; -+ } -+ -+ GL11.glEnable(GL11.GL_BLEND); -+ } -+} -+ -+class ScaledTexture extends GenericTexture { -+ float scale; -+ -+ ScaledTexture(String path) { -+ super(path); -+ } -+ -+ public ScaledTexture setScale(float scale) { -+ this.scale = scale; -+ return this; -+ } -+ -+ @Override -+ public void render() { -+ GL11.glPushMatrix(); -+ GL11.glScalef(scale, 1F, 1F); -+ super.render(); -+ GL11.glPopMatrix(); -+ } -+} -+ -+class BackgroundTexture extends GenericTexture { -+ static final int PAN_TIME = 600; -+ static final int EXTRA_PAN_TIME = 150; -+ static final int HEIGHT_PERCENT = 70; -+ static final int WIDTH_PERCENT = 75; -+ final List backgrounds; -+ final Random rand = new Random(); -+ int maxPanTime = PAN_TIME; -+ int panTime = PAN_TIME; -+ int picture = -1; -+ boolean zoomIn = false; -+ -+ BackgroundTexture(List backgrounds) { -+ super(backgrounds.get(0)); -+ this.backgrounds = backgrounds; -+ cycleBackground(); -+ } -+ -+ public void cycleBackground() { -+ picture++; -+ if (picture >= backgrounds.size()) { -+ picture = 0; -+ } -+ setUrl(backgrounds.get(picture)); -+ maxPanTime = PAN_TIME + rand.nextInt(EXTRA_PAN_TIME); -+ zoomIn = rand.nextBoolean(); -+ panTime = zoomIn ? 0 : maxPanTime; -+ } -+ -+ @Override -+ public void render() { -+ org.newdawn.slick.opengl.Texture tex = CustomTextureManager.getTextureFromPath(getUrl()); -+ GL11.glPushMatrix(); -+ if (tex != null) { -+ if (Configuration.getMainMenuState() != 3) { -+ animate(tex); -+ } else { -+ ((MCRenderDelegate) Spoutcraft.getRenderDelegate()).drawTexture(tex, (int) this.getActualWidth(), (int) this.getActualHeight(), white, false, -1, -1, false, GL11.GL_LINEAR); -+ } -+ } else { -+ RenderUtil.drawRectangle(0, 0, (int) getWidth(), (int) getHeight(), 0xff000000); -+ } -+ GL11.glPopMatrix(); -+ } -+ private static final Color white = new Color(1.0F, 1.0F, 1.0F); -+ -+ private void animate(org.newdawn.slick.opengl.Texture tex) { -+ int adjustedX = ((100 - HEIGHT_PERCENT) / 2) * tex.getImageHeight() * panTime; -+ adjustedX /= maxPanTime; -+ adjustedX /= 100; -+ -+ int adjustedY = ((100 - WIDTH_PERCENT) / 2) * tex.getImageWidth() * panTime; -+ adjustedY /= maxPanTime; -+ adjustedY /= 100; -+ -+ int adjustedHeight = tex.getImageHeight() - adjustedX; -+ -+ int adjustedWidth = tex.getImageWidth() - adjustedY; -+ -+ GL11.glScaled(this.getActualWidth() / (adjustedWidth - adjustedX), this.getActualHeight() / (adjustedHeight - adjustedY), 1D); -+ GL11.glTranslatef(-adjustedX, -adjustedY, 0F); -+ ((MCRenderDelegate) Spoutcraft.getRenderDelegate()).drawTexture(tex, adjustedWidth, adjustedHeight, white, false, -1, -1, Configuration.getMainMenuState() == 1, GL11.GL_NEAREST); -+ -+ if (zoomIn && panTime < maxPanTime) { -+ panTime++; -+ } else if (!zoomIn && panTime > 0) { -+ panTime--; -+ } else { -+ cycleBackground(); -+ } -+ } -+} ---- net/minecraft/src/Packet40EntityMetadata.java -+++ net/minecraft/src/Packet40EntityMetadata.java -@@ -7,40 +7,51 @@ - - public class Packet40EntityMetadata extends Packet { - public int entityId; -- private List b; -- -- public Packet40EntityMetadata() { -- } -- -- public Packet40EntityMetadata(int var1, DataWatcher var2, boolean var3) { -- this.entityId = var1; -- if(var3) { -- this.b = var2.getAllWatched(); -+ private List metadata; -+ -+ public Packet40EntityMetadata() {} -+ -+ public Packet40EntityMetadata(int par1, DataWatcher par2DataWatcher, boolean par3) { -+ this.entityId = par1; -+ -+ if (par3) { -+ this.metadata = par2DataWatcher.getAllWatched(); - } else { -- this.b = var2.unwatchAndReturnAllWatched(); -+ this.metadata = par2DataWatcher.unwatchAndReturnAllWatched(); - } -- -- } -- -- public void readPacketData(DataInput var1) throws IOException { -- this.entityId = var1.readInt(); -- this.b = DataWatcher.readWatchableObjects(var1); -- } -- -- public void writePacketData(DataOutput var1) throws IOException { -- var1.writeInt(this.entityId); -- DataWatcher.writeObjectsInListToStream(this.b, var1); -- } -- -- public void processPacket(NetHandler var1) { -- var1.handleEntityMetadata(this); -- } -- -+ } -+ -+ /** -+ * Abstract. Reads the raw packet data from the data stream. -+ */ -+ public void readPacketData(DataInput par1DataInput) throws IOException { -+ this.entityId = par1DataInput.readInt(); -+ this.metadata = DataWatcher.readWatchableObjects(par1DataInput); -+ } -+ -+ /** -+ * Abstract. Writes the raw packet data to the data stream. -+ */ -+ public void writePacketData(DataOutput par1DataOutput) throws IOException { -+ par1DataOutput.writeInt(this.entityId); -+ DataWatcher.writeObjectsInListToStream(this.metadata, par1DataOutput); -+ } -+ -+ /** -+ * Passes this Packet on to the NetHandler for processing. -+ */ -+ public void processPacket(NetHandler par1NetHandler) { -+ par1NetHandler.handleEntityMetadata(this); -+ } -+ -+ /** -+ * Abstract. Return the size of the packet (not counting the header). -+ */ - public int getPacketSize() { - return 5; - } - - public List getMetadata() { -- return this.b; -+ return this.metadata; - } - } ---- net/minecraft/src/EntityAIAttackOnCollide.java -+++ net/minecraft/src/EntityAIAttackOnCollide.java -@@ -3,33 +3,47 @@ - public class EntityAIAttackOnCollide extends EntityAIBase { - World worldObj; - EntityCreature attacker; -+ -+ /** -+ * An amount of decrementing ticks that allows the entity to attack once the tick reaches 0. -+ */ - int attackTick; -- double speedTowardsTarget; -+ double field_75440_e; -+ -+ /** -+ * When true, the mob will continue chasing its target, even if it can't find a path to them right now. -+ */ - boolean longMemory; -+ -+ /** The PathEntity of our entity. */ - PathEntity entityPathEntity; -- Class g; -+ Class classTarget; - private int field_75445_i; - -- public EntityAIAttackOnCollide(EntityCreature var1, Class var2, double var3, boolean var5) { -- this(var1, var3, var5); -- this.g = var2; -+ public EntityAIAttackOnCollide(EntityCreature par1EntityCreature, Class par2Class, double par3, boolean par5) { -+ this(par1EntityCreature, par3, par5); -+ this.classTarget = par2Class; - } - -- public EntityAIAttackOnCollide(EntityCreature var1, double var2, boolean var4) { -- this.attacker = var1; -- this.worldObj = var1.worldObj; -- this.speedTowardsTarget = var2; -- this.longMemory = var4; -+ public EntityAIAttackOnCollide(EntityCreature par1EntityCreature, double par2, boolean par4) { -+ this.attacker = par1EntityCreature; -+ this.worldObj = par1EntityCreature.worldObj; -+ this.field_75440_e = par2; -+ this.longMemory = par4; - this.setMutexBits(3); - } - -+ /** -+ * Returns whether the EntityAIBase should begin execution. -+ */ - public boolean shouldExecute() { - EntityLivingBase var1 = this.attacker.getAttackTarget(); -- if(var1 == null) { -- return false; -- } else if(!var1.isEntityAlive()) { -- return false; -- } else if(this.g != null && !this.g.isAssignableFrom(var1.getClass())) { -+ -+ if (var1 == null) { -+ return false; -+ } else if (!var1.isEntityAlive()) { -+ return false; -+ } else if (this.classTarget != null && !this.classTarget.isAssignableFrom(var1.getClass())) { - return false; - } else { - this.entityPathEntity = this.attacker.getNavigator().getPathToEntityLiving(var1); -@@ -37,34 +51,49 @@ - } - } - -+ /** -+ * Returns whether an in-progress EntityAIBase should continue executing -+ */ - public boolean continueExecuting() { - EntityLivingBase var1 = this.attacker.getAttackTarget(); - return var1 == null ? false : (!var1.isEntityAlive() ? false : (!this.longMemory ? !this.attacker.getNavigator().noPath() : this.attacker.func_110176_b(MathHelper.floor_double(var1.posX), MathHelper.floor_double(var1.posY), MathHelper.floor_double(var1.posZ)))); - } - -+ /** -+ * Execute a one shot task or start executing a continuous task -+ */ - public void startExecuting() { -- this.attacker.getNavigator().setPath(this.entityPathEntity, this.speedTowardsTarget); -+ this.attacker.getNavigator().setPath(this.entityPathEntity, this.field_75440_e); - this.field_75445_i = 0; - } - -+ /** -+ * Resets the task -+ */ - public void resetTask() { - this.attacker.getNavigator().clearPathEntity(); - } - -+ /** -+ * Updates the task -+ */ - public void updateTask() { - EntityLivingBase var1 = this.attacker.getAttackTarget(); - this.attacker.getLookHelper().setLookPositionWithEntity(var1, 30.0F, 30.0F); -- if((this.longMemory || this.attacker.getEntitySenses().canSee(var1)) && --this.field_75445_i <= 0) { -+ -+ if ((this.longMemory || this.attacker.getEntitySenses().canSee(var1)) && --this.field_75445_i <= 0) { - this.field_75445_i = 4 + this.attacker.getRNG().nextInt(7); -- this.attacker.getNavigator().tryMoveToEntityLiving(var1, this.speedTowardsTarget); -+ this.attacker.getNavigator().tryMoveToEntityLiving(var1, this.field_75440_e); - } - - this.attackTick = Math.max(this.attackTick - 1, 0); - double var2 = (double)(this.attacker.width * 2.0F * this.attacker.width * 2.0F + var1.width); -- if(this.attacker.getDistanceSq(var1.posX, var1.boundingBox.minY, var1.posZ) <= var2) { -- if(this.attackTick <= 0) { -+ -+ if (this.attacker.getDistanceSq(var1.posX, var1.boundingBox.minY, var1.posZ) <= var2) { -+ if (this.attackTick <= 0) { - this.attackTick = 20; -- if(this.attacker.getHeldItem() != null) { -+ -+ if (this.attacker.getHeldItem() != null) { - this.attacker.swingItem(); - } - ---- net/minecraft/src/Packet208SetDisplayObjective.java -+++ net/minecraft/src/Packet208SetDisplayObjective.java -@@ -5,37 +5,52 @@ - import java.io.IOException; - - public class Packet208SetDisplayObjective extends Packet { -+ -+ /** The position of the scoreboard. 0 = list, 1 = sidebar, 2 = belowName. */ - public int scoreboardPosition; -- public String b; -- -- public Packet208SetDisplayObjective() { -- } -- -- public Packet208SetDisplayObjective(int var1, ScoreObjective var2) { -- this.scoreboardPosition = var1; -- if(var2 == null) { -- this.b = ""; -+ -+ /** The unique name for the scoreboard to be displayed. */ -+ public String scoreName; -+ -+ public Packet208SetDisplayObjective() {} -+ -+ public Packet208SetDisplayObjective(int par1, ScoreObjective par2ScoreObjective) { -+ this.scoreboardPosition = par1; -+ -+ if (par2ScoreObjective == null) { -+ this.scoreName = ""; - } else { -- this.b = var2.getName(); -+ this.scoreName = par2ScoreObjective.getName(); - } -- -- } -- -- public void readPacketData(DataInput var1) throws IOException { -- this.scoreboardPosition = var1.readByte(); -- this.b = readString(var1, 16); -- } -- -- public void writePacketData(DataOutput var1) throws IOException { -- var1.writeByte(this.scoreboardPosition); -- writeString(this.b, var1); -- } -- -- public void processPacket(NetHandler var1) { -- var1.handleSetDisplayObjective(this); -- } -- -+ } -+ -+ /** -+ * Abstract. Reads the raw packet data from the data stream. -+ */ -+ public void readPacketData(DataInput par1DataInput) throws IOException { -+ this.scoreboardPosition = par1DataInput.readByte(); -+ this.scoreName = readString(par1DataInput, 16); -+ } -+ -+ /** -+ * Abstract. Writes the raw packet data to the data stream. -+ */ -+ public void writePacketData(DataOutput par1DataOutput) throws IOException { -+ par1DataOutput.writeByte(this.scoreboardPosition); -+ writeString(this.scoreName, par1DataOutput); -+ } -+ -+ /** -+ * Passes this Packet on to the NetHandler for processing. -+ */ -+ public void processPacket(NetHandler par1NetHandler) { -+ par1NetHandler.handleSetDisplayObjective(this); -+ } -+ -+ /** -+ * Abstract. Return the size of the packet (not counting the header). -+ */ - public int getPacketSize() { -- return 3 + this.b.length(); -+ return 3 + this.scoreName.length(); - } - } ---- net/minecraft/src/WorldGenFire.java -+++ net/minecraft/src/WorldGenFire.java -@@ -3,13 +3,14 @@ - import java.util.Random; - - public class WorldGenFire extends WorldGenerator { -- public boolean generate(World var1, Random var2, int var3, int var4, int var5) { -- for(int var6 = 0; var6 < 64; ++var6) { -- int var7 = var3 + var2.nextInt(8) - var2.nextInt(8); -- int var8 = var4 + var2.nextInt(4) - var2.nextInt(4); -- int var9 = var5 + var2.nextInt(8) - var2.nextInt(8); -- if(var1.isAirBlock(var7, var8, var9) && var1.getBlockId(var7, var8 - 1, var9) == Block.netherrack.blockID) { -- var1.setBlock(var7, var8, var9, Block.fire.blockID, 0, 2); -+ public boolean generate(World par1World, Random par2Random, int par3, int par4, int par5) { -+ for (int var6 = 0; var6 < 64; ++var6) { -+ int var7 = par3 + par2Random.nextInt(8) - par2Random.nextInt(8); -+ int var8 = par4 + par2Random.nextInt(4) - par2Random.nextInt(4); -+ int var9 = par5 + par2Random.nextInt(8) - par2Random.nextInt(8); -+ -+ if (par1World.isAirBlock(var7, var8, var9) && par1World.getBlockId(var7, var8 - 1, var9) == Block.netherrack.blockID) { -+ par1World.setBlock(var7, var8, var9, Block.fire.blockID, 0, 2); - } - } - ---- net/minecraft/src/WorldGenClay.java -+++ net/minecraft/src/WorldGenClay.java -@@ -3,29 +3,36 @@ - import java.util.Random; - - public class WorldGenClay extends WorldGenerator { -- private int clayBlockId = Block.blockClay.blockID; -+ -+ /** The block ID for clay. */ -+ private int clayBlockId; -+ -+ /** The number of blocks to generate. */ - private int numberOfBlocks; - -- public WorldGenClay(int var1) { -- this.numberOfBlocks = var1; -+ public WorldGenClay(int par1) { -+ this.clayBlockId = Block.blockClay.blockID; -+ this.numberOfBlocks = par1; - } - -- public boolean generate(World var1, Random var2, int var3, int var4, int var5) { -- if(var1.getBlockMaterial(var3, var4, var5) != Material.water) { -+ public boolean generate(World par1World, Random par2Random, int par3, int par4, int par5) { -+ if (par1World.getBlockMaterial(par3, par4, par5) != Material.water) { - return false; - } else { -- int var6 = var2.nextInt(this.numberOfBlocks - 2) + 2; -+ int var6 = par2Random.nextInt(this.numberOfBlocks - 2) + 2; - byte var7 = 1; - -- for(int var8 = var3 - var6; var8 <= var3 + var6; ++var8) { -- for(int var9 = var5 - var6; var9 <= var5 + var6; ++var9) { -- int var10 = var8 - var3; -- int var11 = var9 - var5; -- if(var10 * var10 + var11 * var11 <= var6 * var6) { -- for(int var12 = var4 - var7; var12 <= var4 + var7; ++var12) { -- int var13 = var1.getBlockId(var8, var12, var9); -- if(var13 == Block.dirt.blockID || var13 == Block.blockClay.blockID) { -- var1.setBlock(var8, var12, var9, this.clayBlockId, 0, 2); -+ for (int var8 = par3 - var6; var8 <= par3 + var6; ++var8) { -+ for (int var9 = par5 - var6; var9 <= par5 + var6; ++var9) { -+ int var10 = var8 - par3; -+ int var11 = var9 - par5; -+ -+ if (var10 * var10 + var11 * var11 <= var6 * var6) { -+ for (int var12 = par4 - var7; var12 <= par4 + var7; ++var12) { -+ int var13 = par1World.getBlockId(var8, var12, var9); -+ -+ if (var13 == Block.dirt.blockID || var13 == Block.blockClay.blockID) { -+ par1World.setBlock(var8, var12, var9, this.clayBlockId, 0, 2); - } - } - } ---- net/minecraft/src/ServerList.java -+++ net/minecraft/src/ServerList.java -@@ -6,72 +6,98 @@ - import java.util.List; - - public class ServerList { -+ -+ /** The Minecraft instance. */ - private final Minecraft mc; -- private final List b = new ArrayList(); -- -- public ServerList(Minecraft var1) { -- this.mc = var1; -+ -+ /** List of ServerData instances. */ -+ private final List servers = new ArrayList(); -+ -+ public ServerList(Minecraft par1Minecraft) { -+ this.mc = par1Minecraft; - this.loadServerList(); - } - -+ /** -+ * Loads a list of servers from servers.dat, by running ServerData.getServerDataFromNBTCompound on each NBT compound -+ * found in the "servers" tag list. -+ */ - public void loadServerList() { - try { -- this.b.clear(); -- NBTTagCompound var1 = CompressedStreamTools.read(new File(this.mc.x, "servers.dat")); -- if(var1 == null) { -+ this.servers.clear(); -+ NBTTagCompound var1 = CompressedStreamTools.read(new File(this.mc.mcDataDir, "servers.dat")); -+ -+ if (var1 == null) { - return; - } - - NBTTagList var2 = var1.getTagList("servers"); - -- for(int var3 = 0; var3 < var2.tagCount(); ++var3) { -- this.b.add(ServerData.getServerDataFromNBTCompound((NBTTagCompound)var2.tagAt(var3))); -+ for (int var3 = 0; var3 < var2.tagCount(); ++var3) { -+ this.servers.add(ServerData.getServerDataFromNBTCompound((NBTTagCompound)var2.tagAt(var3))); - } - } catch (Exception var4) { - var4.printStackTrace(); - } -- - } - -+ /** -+ * Runs getNBTCompound on each ServerData instance, puts everything into a "servers" NBT list and writes it to -+ * servers.dat. -+ */ - public void saveServerList() { - try { - NBTTagList var1 = new NBTTagList(); -- Iterator var2 = this.b.iterator(); -+ Iterator var2 = this.servers.iterator(); - -- while(var2.hasNext()) { -+ while (var2.hasNext()) { - ServerData var3 = (ServerData)var2.next(); - var1.appendTag(var3.getNBTCompound()); - } - - NBTTagCompound var5 = new NBTTagCompound(); - var5.setTag("servers", var1); -- CompressedStreamTools.safeWrite(var5, new File(this.mc.x, "servers.dat")); -+ CompressedStreamTools.safeWrite(var5, new File(this.mc.mcDataDir, "servers.dat")); - } catch (Exception var4) { - var4.printStackTrace(); - } -- -- } -- -- public ServerData getServerData(int var1) { -- return (ServerData)this.b.get(var1); -- } -- -- public void removeServerData(int var1) { -- this.b.remove(var1); -- } -- -- public void addServerData(ServerData var1) { -- this.b.add(var1); -- } -- -+ } -+ -+ /** -+ * Gets the ServerData instance stored for the given index in the list. -+ */ -+ public ServerData getServerData(int par1) { -+ return (ServerData)this.servers.get(par1); -+ } -+ -+ /** -+ * Removes the ServerData instance stored for the given index in the list. -+ */ -+ public void removeServerData(int par1) { -+ this.servers.remove(par1); -+ } -+ -+ /** -+ * Adds the given ServerData instance to the list. -+ */ -+ public void addServerData(ServerData par1ServerData) { -+ this.servers.add(par1ServerData); -+ } -+ -+ /** -+ * Counts the number of ServerData instances in the list. -+ */ - public int countServers() { -- return this.b.size(); -+ return this.servers.size(); - } - -- public void swapServers(int var1, int var2) { -- ServerData var3 = this.getServerData(var1); -- this.b.set(var1, this.getServerData(var2)); -- this.b.set(var2, var3); -+ /** -+ * Takes two list indexes, and swaps their order around. -+ */ -+ public void swapServers(int par1, int par2) { -+ ServerData var3 = this.getServerData(par1); -+ this.servers.set(par1, this.getServerData(par2)); -+ this.servers.set(par2, var3); - this.saveServerList(); - } - } ---- /dev/null -+++ com/prupe/mcpatcher/hd/FancyDial.java -@@ -1,0 +1,624 @@ -+package com.prupe.mcpatcher.hd; -+ -+import com.prupe.mcpatcher.BlendMethod; -+import com.prupe.mcpatcher.Config; -+import com.prupe.mcpatcher.InputHandler; -+import com.prupe.mcpatcher.MCLogger; -+import com.prupe.mcpatcher.MCPatcherUtils; -+import com.prupe.mcpatcher.TexturePackAPI; -+import com.prupe.mcpatcher.hd.FancyDial$Layer; -+import java.awt.image.BufferedImage; -+import java.io.File; -+import java.nio.ByteBuffer; -+import java.nio.IntBuffer; -+import java.util.ArrayList; -+import java.util.Arrays; -+import java.util.Iterator; -+import java.util.List; -+import java.util.Map; -+import java.util.Properties; -+import java.util.TreeMap; -+import java.util.WeakHashMap; -+import javax.imageio.ImageIO; -+import net.minecraft.src.Icon; -+import net.minecraft.src.ResourceLocation; -+import net.minecraft.src.TextureAtlasSprite; -+import net.minecraft.src.TextureClock; -+import net.minecraft.src.TextureCompass; -+import net.minecraft.src.TextureMap; -+import net.minecraft.src.TextureObject; -+import org.lwjgl.opengl.EXTFramebufferObject; -+import org.lwjgl.opengl.GL11; -+import org.lwjgl.opengl.GL13; -+import org.lwjgl.opengl.GLContext; -+import org.lwjgl.util.glu.GLU; -+ -+public class FancyDial { -+ private static final MCLogger logger = MCLogger.getLogger("Custom Animations", "Animation"); -+ private static final ResourceLocation ITEMS_PNG = new ResourceLocation("textures/atlas/items.png"); -+ private static final double ANGLE_UNSET = Double.MAX_VALUE; -+ private static final int NUM_SCRATCH_TEXTURES = 3; -+ private static final boolean fboSupported = GLContext.getCapabilities().GL_EXT_framebuffer_object; -+ private static final boolean gl13Supported = GLContext.getCapabilities().OpenGL13; -+ private static final boolean enableCompass = Config.getBoolean("Extended HD", "fancyCompass", true); -+ private static final boolean enableClock = Config.getBoolean("Extended HD", "fancyClock", true); -+ private static final boolean useGL13 = gl13Supported && Config.getBoolean("Extended HD", "useGL13", true); -+ private static final boolean useScratchTexture = Config.getBoolean("Extended HD", "useScratchTexture", true); -+ private static final int glAttributes; -+ private static boolean initialized; -+ private static final int drawList = GL11.glGenLists(1); -+ private static final Map setupInfo = new WeakHashMap(); -+ private static final Map instances = new WeakHashMap(); -+ private final TextureAtlasSprite icon; -+ private final ResourceLocation resource; -+ private final String name; -+ private final int x0; -+ private final int y0; -+ private final int width; -+ private final int height; -+ private final int itemsTexture; -+ private final int[] scratchTexture = new int[4]; -+ private final ByteBuffer scratchBuffer; -+ private final int[] frameBuffer = new int[4]; -+ private int scratchIndex; -+ private Map itemFrames = new TreeMap(); -+ private int outputFrames; -+ private boolean ok; -+ private double lastAngle = Double.MAX_VALUE; -+ private boolean lastItemFrameRenderer; -+ private final List layers = new ArrayList(); -+ private InputHandler keyboard; -+ private static final float STEP = 0.01F; -+ private float scaleXDelta; -+ private float scaleYDelta; -+ private float offsetXDelta; -+ private float offsetYDelta; -+ -+ public static void setup(TextureAtlasSprite icon) { -+ if (fboSupported) { -+ String name = icon.getIconName(); -+ -+ if ("compass".equals(icon.getIconName())) { -+ if (!enableCompass) { -+ return; -+ } -+ } else { -+ if (!"clock".equals(icon.getIconName())) { -+ logger.warning("ignoring custom animation for %s not compass or clock", new Object[] {icon.getIconName()}); -+ return; -+ } -+ -+ if (!enableClock) { -+ return; -+ } -+ } -+ -+ ResourceLocation resource = TexturePackAPI.newMCPatcherResourceLocation("dial/" + name + ".properties"); -+ -+ if (TexturePackAPI.hasResource(resource)) { -+ logger.fine("found custom %s (%s)", new Object[] {name, resource}); -+ setupInfo.put(icon, resource); -+ } -+ } -+ } -+ -+ public static boolean update(TextureAtlasSprite icon, boolean itemFrameRenderer) { -+ if (!initialized) { -+ logger.finer("deferring %s update until initialization finishes", new Object[] {icon.getIconName()}); -+ return false; -+ } else { -+ FancyDial instance = (FancyDial)instances.get(icon); -+ -+ if (instance == null) { -+ instance = getInstance(icon); -+ -+ if (instance == null) { -+ return false; -+ } -+ } -+ -+ return instance.render(itemFrameRenderer); -+ } -+ } -+ -+ static void clearAll() { -+ logger.finer("FancyDial.clearAll", new Object[0]); -+ Iterator i$ = instances.values().iterator(); -+ -+ while (i$.hasNext()) { -+ FancyDial instance = (FancyDial)i$.next(); -+ -+ if (instance != null) { -+ instance.finish(); -+ } -+ } -+ -+ instances.clear(); -+ initialized = true; -+ } -+ -+ static void registerAnimations() { -+ TextureObject texture = TexturePackAPI.getTextureObject(ITEMS_PNG); -+ -+ if (texture instanceof TextureMap) { -+ List animations = ((TextureMap)texture).listAnimatedSprites; -+ Iterator i$ = instances.values().iterator(); -+ -+ while (i$.hasNext()) { -+ FancyDial instance = (FancyDial)i$.next(); -+ instance.registerAnimation(animations); -+ } -+ } -+ } -+ -+ void registerAnimation(List animations) { -+ if (!animations.contains(this.icon)) { -+ animations.add(this.icon); -+ -+ if (this.icon.framesTextureData == null) { -+ this.icon.framesTextureData = new ArrayList(); -+ } -+ -+ if (this.icon.framesTextureData.isEmpty()) { -+ int[] dummyRGB = new int[this.width * this.height]; -+ Arrays.fill(dummyRGB, -65281); -+ this.icon.framesTextureData.add(dummyRGB); -+ } -+ -+ logger.fine("registered %s animation", new Object[] {this.name}); -+ } -+ } -+ -+ private static FancyDial getInstance(TextureAtlasSprite icon) { -+ ResourceLocation resource = (ResourceLocation)setupInfo.get(icon); -+ Properties properties = TexturePackAPI.getProperties(resource); -+ setupInfo.remove(icon); -+ -+ if (properties == null) { -+ return null; -+ } else { -+ try { -+ FancyDial e = new FancyDial(icon, resource, properties); -+ -+ if (e.ok) { -+ instances.put(icon, e); -+ return e; -+ } -+ -+ e.finish(); -+ } catch (Throwable var4) { -+ var4.printStackTrace(); -+ } -+ -+ return null; -+ } -+ } -+ -+ private FancyDial(TextureAtlasSprite icon, ResourceLocation resource, Properties properties) { -+ this.icon = icon; -+ this.resource = resource; -+ this.name = icon.getIconName(); -+ this.x0 = icon.getOriginX(); -+ this.y0 = icon.getOriginY(); -+ this.width = icon.getIconWidth(); -+ this.height = icon.getIconHeight(); -+ this.scratchBuffer = ByteBuffer.allocateDirect(4 * this.width * this.height); -+ this.itemsTexture = TexturePackAPI.getTextureIfLoaded(ITEMS_PNG); -+ -+ if (this.itemsTexture < 0) { -+ logger.severe("could not get items texture", new Object[0]); -+ } else { -+ if (useScratchTexture) { -+ logger.fine("rendering %s to %dx%d scratch texture", new Object[] {this.name, Integer.valueOf(this.width), Integer.valueOf(this.height)}); -+ } else { -+ logger.fine("rendering %s directly to %s", new Object[] {this.name, ITEMS_PNG}); -+ } -+ -+ for (int debug = 0; debug < this.scratchTexture.length; ++debug) { -+ this.scratchTexture[debug] = debug == 3 ? this.itemsTexture : this.setupScratchTexture(debug); -+ this.frameBuffer[debug] = this.setupFrameBuffer(this.scratchTexture[debug]); -+ } -+ -+ boolean var7 = false; -+ int glError = 0; -+ -+ while (true) { -+ FancyDial$Layer layer = this.newLayer(resource, properties, "." + glError); -+ -+ if (layer == null) { -+ if (glError > 0) { -+ this.keyboard = new InputHandler(this.name, var7); -+ -+ if (this.layers.size() < 2) { -+ logger.error("custom %s needs at least two layers defined", new Object[] {this.name}); -+ return; -+ } -+ -+ this.outputFrames = MCPatcherUtils.getIntProperty(properties, "outputFrames", 0); -+ glError = GL11.glGetError(); -+ -+ if (glError != 0) { -+ logger.severe("%s during %s setup", new Object[] {GLU.gluErrorString(glError), this.name}); -+ return; -+ } -+ -+ this.ok = true; -+ return; -+ } -+ } else { -+ this.layers.add(layer); -+ var7 |= layer.debug; -+ logger.fine(" new %s", new Object[] {layer}); -+ } -+ -+ ++glError; -+ } -+ } -+ } -+ -+ private int setupScratchTexture(int i) { -+ int targetTexture; -+ -+ if (useScratchTexture) { -+ targetTexture = GL11.glGenTextures(); -+ MipmapHelper.setupTexture(targetTexture, this.width, this.height, TexturePackAPI.transformResourceLocation(this.resource, ".properties", "_scratch" + i).getResourcePath()); -+ } else { -+ targetTexture = -1; -+ } -+ -+ return targetTexture; -+ } -+ -+ private int setupFrameBuffer(int texture) { -+ if (texture < 0) { -+ return -1; -+ } else { -+ int frameBuffer = EXTFramebufferObject.glGenFramebuffersEXT(); -+ -+ if (frameBuffer < 0) { -+ logger.severe("could not get framebuffer object", new Object[0]); -+ this.ok = false; -+ return -1; -+ } else { -+ EXTFramebufferObject.glBindFramebufferEXT(36160, frameBuffer); -+ EXTFramebufferObject.glFramebufferTexture2DEXT(36160, 36064, 3553, texture, 0); -+ EXTFramebufferObject.glBindFramebufferEXT(36160, 0); -+ return frameBuffer; -+ } -+ } -+ } -+ -+ private boolean render(boolean itemFrameRenderer) { -+ if (!this.ok) { -+ return false; -+ } else { -+ if (!itemFrameRenderer) { -+ boolean angle = true; -+ -+ if (!this.keyboard.isEnabled()) { -+ angle = false; -+ } else if (this.keyboard.isKeyPressed(80)) { -+ this.scaleYDelta -= 0.01F; -+ } else if (this.keyboard.isKeyPressed(72)) { -+ this.scaleYDelta += 0.01F; -+ } else if (this.keyboard.isKeyPressed(75)) { -+ this.scaleXDelta -= 0.01F; -+ } else if (this.keyboard.isKeyPressed(77)) { -+ this.scaleXDelta += 0.01F; -+ } else if (this.keyboard.isKeyPressed(208)) { -+ this.offsetYDelta += 0.01F; -+ } else if (this.keyboard.isKeyPressed(200)) { -+ this.offsetYDelta -= 0.01F; -+ } else if (this.keyboard.isKeyPressed(203)) { -+ this.offsetXDelta -= 0.01F; -+ } else if (this.keyboard.isKeyPressed(205)) { -+ this.offsetXDelta += 0.01F; -+ } else if (this.keyboard.isKeyPressed(55)) { -+ this.scaleXDelta = this.scaleYDelta = this.offsetXDelta = this.offsetYDelta = 0.0F; -+ } else { -+ angle = false; -+ } -+ -+ if (angle) { -+ logger.info("", new Object[0]); -+ logger.info("scaleX %+f", new Object[] {Float.valueOf(this.scaleXDelta)}); -+ logger.info("scaleY %+f", new Object[] {Float.valueOf(this.scaleYDelta)}); -+ logger.info("offsetX %+f", new Object[] {Float.valueOf(this.offsetXDelta)}); -+ logger.info("offsetY %+f", new Object[] {Float.valueOf(this.offsetYDelta)}); -+ this.lastAngle = Double.MAX_VALUE; -+ } -+ -+ if (this.outputFrames > 0) { -+ this.writeCustomImage(); -+ this.outputFrames = 0; -+ } -+ } -+ -+ double var5 = getAngle(this.icon); -+ int var6; -+ -+ if (!useScratchTexture) { -+ if (var5 != this.lastAngle) { -+ this.renderToItems(var5); -+ this.lastAngle = var5; -+ } -+ } else if (itemFrameRenderer) { -+ ByteBuffer glError = (ByteBuffer)this.itemFrames.get(Double.valueOf(var5)); -+ -+ if (glError == null) { -+ logger.fine("rendering %s at angle %f for item frame", new Object[] {this.name, Double.valueOf(var5)}); -+ glError = ByteBuffer.allocateDirect(this.width * this.height * 4); -+ this.renderToItems(var5); -+ this.readTextureToBuffer(glError); -+ this.itemFrames.put(Double.valueOf(var5), glError); -+ } else { -+ this.copyBufferToItemsTexture(glError); -+ } -+ -+ this.lastItemFrameRenderer = true; -+ } else if (this.lastAngle == Double.MAX_VALUE) { -+ for (var6 = 0; var6 < 3; ++var6) { -+ this.renderToFB(var5, this.frameBuffer[var6]); -+ } -+ -+ this.readTextureToBuffer(this.scratchTexture[0], this.scratchBuffer); -+ this.copyBufferToItemsTexture(this.scratchBuffer); -+ this.lastAngle = var5; -+ this.scratchIndex = 0; -+ } else if (this.lastItemFrameRenderer || var5 != this.lastAngle) { -+ var6 = (this.scratchIndex + 1) % 3; -+ -+ if (var5 != this.lastAngle) { -+ this.renderToFB(var5, this.frameBuffer[var6]); -+ this.readTextureToBuffer(this.scratchTexture[this.scratchIndex], this.scratchBuffer); -+ } -+ -+ this.copyBufferToItemsTexture(this.scratchBuffer); -+ this.lastAngle = var5; -+ this.scratchIndex = var6; -+ this.lastItemFrameRenderer = false; -+ } -+ -+ var6 = GL11.glGetError(); -+ -+ if (var6 != 0) { -+ logger.severe("%s during %s update", new Object[] {GLU.gluErrorString(var6), this.name}); -+ this.ok = false; -+ } -+ -+ return this.ok; -+ } -+ } -+ -+ private void writeCustomImage() { -+ try { -+ BufferedImage e = new BufferedImage(this.width, this.outputFrames * this.height, 2); -+ IntBuffer intBuffer = this.scratchBuffer.asIntBuffer(); -+ int[] argb = new int[this.width * this.height]; -+ File path = MCPatcherUtils.getGamePath(new String[] {"custom_" + this.name + ".png"}); -+ logger.info("generating %d %s frames", new Object[] {Integer.valueOf(this.outputFrames), this.name}); -+ -+ for (int i = 0; i < this.outputFrames; ++i) { -+ this.renderToItems((double)i * (360.0D / (double)this.outputFrames)); -+ this.readTextureToBuffer(this.scratchBuffer); -+ intBuffer.position(0); -+ -+ for (int j = 0; j < argb.length; ++j) { -+ argb[j] = Integer.rotateRight(intBuffer.get(j), 8); -+ } -+ -+ e.setRGB(0, i * this.height, this.width, this.height, argb, 0, this.width); -+ } -+ -+ ImageIO.write(e, "png", path); -+ logger.info("wrote %dx%d %s", new Object[] {Integer.valueOf(e.getWidth()), Integer.valueOf(e.getHeight()), path.getPath()}); -+ } catch (Throwable var7) { -+ var7.printStackTrace(); -+ } -+ } -+ -+ private void renderToItems(double angle) { -+ GL11.glPushAttrib(glAttributes); -+ GL11.glViewport(this.x0, this.y0, this.width, this.height); -+ GL11.glEnable(GL11.GL_SCISSOR_TEST); -+ GL11.glScissor(this.x0, this.y0, this.width, this.height); -+ EXTFramebufferObject.glBindFramebufferEXT(36160, this.frameBuffer[3]); -+ this.renderImpl(angle); -+ } -+ -+ private void renderToFB(double angle, int bindFB) { -+ GL11.glPushAttrib(glAttributes); -+ GL11.glViewport(0, 0, this.width, this.height); -+ EXTFramebufferObject.glBindFramebufferEXT(36160, bindFB); -+ this.renderImpl(angle); -+ } -+ -+ private void renderImpl(double angle) { -+ boolean lightmapEnabled = false; -+ -+ if (gl13Supported) { -+ GL13.glActiveTexture(GL13.GL_TEXTURE1); -+ lightmapEnabled = GL11.glIsEnabled(GL11.GL_TEXTURE_2D); -+ -+ if (lightmapEnabled) { -+ GL11.glDisable(GL11.GL_TEXTURE_2D); -+ } -+ -+ GL13.glActiveTexture(GL13.GL_TEXTURE0); -+ } -+ -+ GL11.glEnable(GL11.GL_TEXTURE_2D); -+ GL11.glDisable(GL11.GL_DEPTH_TEST); -+ GL11.glBindTexture(GL11.GL_TEXTURE_2D, 0); -+ GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); -+ GL11.glDisable(GL11.GL_LIGHTING); -+ -+ if (useGL13) { -+ GL11.glDisable(GL13.GL_MULTISAMPLE); -+ } -+ -+ GL11.glClearColor(0.0F, 0.0F, 0.0F, 0.0F); -+ GL11.glClear(16384); -+ GL11.glMatrixMode(GL11.GL_PROJECTION); -+ GL11.glPushMatrix(); -+ GL11.glLoadIdentity(); -+ GL11.glOrtho(-1.0D, 1.0D, -1.0D, 1.0D, -1.0D, 1.0D); -+ GL11.glMatrixMode(GL11.GL_MODELVIEW); -+ GL11.glPushMatrix(); -+ GL11.glLoadIdentity(); -+ Iterator i$ = this.layers.iterator(); -+ -+ while (i$.hasNext()) { -+ FancyDial$Layer layer = (FancyDial$Layer)i$.next(); -+ layer.blendMethod.applyBlending(); -+ GL11.glPushMatrix(); -+ TexturePackAPI.bindTexture(layer.textureName); -+ float offsetX = layer.offsetX; -+ float offsetY = layer.offsetY; -+ float scaleX = layer.scaleX; -+ float scaleY = layer.scaleY; -+ -+ if (layer.debug) { -+ offsetX += this.offsetXDelta; -+ offsetY += this.offsetYDelta; -+ scaleX += this.scaleXDelta; -+ scaleY += this.scaleYDelta; -+ } -+ -+ GL11.glTranslatef(offsetX, offsetY, 0.0F); -+ GL11.glScalef(scaleX, scaleY, 1.0F); -+ float layerAngle = (float)(angle * (double)layer.rotationMultiplier + (double)layer.rotationOffset); -+ GL11.glRotatef(layerAngle, 0.0F, 0.0F, 1.0F); -+ GL11.glCallList(drawList); -+ GL11.glPopMatrix(); -+ } -+ -+ EXTFramebufferObject.glBindFramebufferEXT(36160, 0); -+ GL11.glPopAttrib(); -+ GL11.glMatrixMode(GL11.GL_PROJECTION); -+ GL11.glPopMatrix(); -+ GL11.glMatrixMode(GL11.GL_MODELVIEW); -+ GL11.glPopMatrix(); -+ -+ if (lightmapEnabled) { -+ GL13.glActiveTexture(GL13.GL_TEXTURE1); -+ GL11.glEnable(GL11.GL_TEXTURE_2D); -+ GL13.glActiveTexture(GL13.GL_TEXTURE0); -+ } -+ -+ GL11.glEnable(GL11.GL_BLEND); -+ GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); -+ } -+ -+ private void readTextureToBuffer(int texture, ByteBuffer buffer) { -+ TexturePackAPI.bindTexture(texture); -+ buffer.position(0); -+ GL11.glGetTexImage(GL11.GL_TEXTURE_2D, 0, GL11.GL_RGBA, GL11.GL_UNSIGNED_BYTE, buffer); -+ } -+ -+ private void readTextureToBuffer(ByteBuffer buffer) { -+ EXTFramebufferObject.glBindFramebufferEXT(36160, this.frameBuffer[3]); -+ buffer.position(0); -+ GL11.glReadPixels(this.x0, this.y0, this.width, this.height, GL11.GL_RGBA, GL11.GL_UNSIGNED_BYTE, buffer); -+ EXTFramebufferObject.glBindFramebufferEXT(36160, 0); -+ } -+ -+ private void copyBufferToItemsTexture(ByteBuffer buffer) { -+ TexturePackAPI.bindTexture(this.itemsTexture); -+ buffer.position(0); -+ GL11.glTexSubImage2D(GL11.GL_TEXTURE_2D, 0, this.x0, this.y0, this.width, this.height, GL11.GL_RGBA, GL11.GL_UNSIGNED_BYTE, buffer); -+ } -+ -+ private static void drawBox() { -+ GL11.glBegin(GL11.GL_QUADS); -+ GL11.glTexCoord2f(0.0F, 0.0F); -+ GL11.glVertex3f(-1.0F, -1.0F, 0.0F); -+ GL11.glTexCoord2f(1.0F, 0.0F); -+ GL11.glVertex3f(1.0F, -1.0F, 0.0F); -+ GL11.glTexCoord2f(1.0F, 1.0F); -+ GL11.glVertex3f(1.0F, 1.0F, 0.0F); -+ GL11.glTexCoord2f(0.0F, 1.0F); -+ GL11.glVertex3f(-1.0F, 1.0F, 0.0F); -+ GL11.glEnd(); -+ } -+ -+ private void finish() { -+ for (int i = 0; i < this.frameBuffer.length; ++i) { -+ if (this.frameBuffer[i] >= 0) { -+ EXTFramebufferObject.glDeleteFramebuffersEXT(this.frameBuffer[i]); -+ this.frameBuffer[i] = -1; -+ } -+ -+ if (i < 3 && this.scratchTexture[i] >= 0) { -+ TexturePackAPI.deleteTexture(this.scratchTexture[i]); -+ this.scratchTexture[i] = -1; -+ } -+ } -+ -+ this.itemFrames.clear(); -+ this.layers.clear(); -+ this.ok = false; -+ } -+ -+ public String toString() { -+ return String.format("FancyDial{%s, %dx%d @ %d,%d}", new Object[] {this.name, Integer.valueOf(this.width), Integer.valueOf(this.height), Integer.valueOf(this.x0), Integer.valueOf(this.y0)}); -+ } -+ -+ protected void finalize() throws Throwable { -+ this.finish(); -+ super.finalize(); -+ } -+ -+ private static double getAngle(Icon icon) { -+ return icon instanceof TextureCompass ? ((TextureCompass)icon).currentAngle * 180.0D / Math.PI : (icon instanceof TextureClock ? ((TextureClock)icon).field_94239_h * 360.0D : 0.0D); -+ } -+ -+ FancyDial$Layer newLayer(ResourceLocation resource, Properties properties, String suffix) { -+ String textureName = MCPatcherUtils.getStringProperty(properties, "source" + suffix, ""); -+ -+ if (textureName.isEmpty()) { -+ return null; -+ } else { -+ ResourceLocation textureResource = TexturePackAPI.parseResourceLocation(resource, textureName); -+ -+ if (textureResource == null) { -+ return null; -+ } else if (!TexturePackAPI.hasResource(textureResource)) { -+ logger.error("%s: could not read %s", new Object[] {resource, textureResource}); -+ return null; -+ } else { -+ float scaleX = MCPatcherUtils.getFloatProperty(properties, "scaleX" + suffix, 1.0F); -+ float scaleY = MCPatcherUtils.getFloatProperty(properties, "scaleY" + suffix, 1.0F); -+ float offsetX = MCPatcherUtils.getFloatProperty(properties, "offsetX" + suffix, 0.0F); -+ float offsetY = MCPatcherUtils.getFloatProperty(properties, "offsetY" + suffix, 0.0F); -+ float angleMultiplier = MCPatcherUtils.getFloatProperty(properties, "rotationSpeed" + suffix, 0.0F); -+ float angleOffset = MCPatcherUtils.getFloatProperty(properties, "rotationOffset" + suffix, 0.0F); -+ String blend = MCPatcherUtils.getStringProperty(properties, "blend" + suffix, "alpha"); -+ BlendMethod blendMethod = BlendMethod.parse(blend); -+ -+ if (blendMethod == null) { -+ logger.error("%s: unknown blend method %s", new Object[] {resource, blend}); -+ return null; -+ } else { -+ boolean debug = MCPatcherUtils.getBooleanProperty(properties, "debug" + suffix, false); -+ return new FancyDial$Layer(this, textureResource, scaleX, scaleY, offsetX, offsetY, angleMultiplier, angleOffset, blendMethod, debug); -+ } -+ } -+ } -+ } -+ -+ static { -+ logger.config("fbo: supported=%s", new Object[] {Boolean.valueOf(fboSupported)}); -+ logger.config("GL13: supported=%s, enabled=%s", new Object[] {Boolean.valueOf(gl13Supported), Boolean.valueOf(useGL13)}); -+ int bits = 527702; -+ -+ if (useGL13) { -+ bits |= 536870912; -+ } -+ -+ glAttributes = bits; -+ GL11.glNewList(drawList, GL11.GL_COMPILE); -+ drawBox(); -+ GL11.glEndList(); -+ } -+} ---- /dev/null -+++ org/spoutcraft/client/gui/settings/controls/ResetButton.java -@@ -1,0 +1,45 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.client.gui.settings.controls; -+ -+import net.minecraft.src.GuiScreen; -+ -+import org.spoutcraft.client.SpoutClient; -+import org.spoutcraft.client.config.Configuration; -+import org.spoutcraft.client.gui.SafeButton; -+import org.spoutcraft.client.gui.settings.GuiSimpleOptions; -+ -+public class ResetButton extends SafeButton { -+ GuiScreen parent; -+ -+ public ResetButton(GuiScreen parent) { -+ setText("Reset to Default"); -+ setTooltip("Resets all options to default settings."); -+ this.parent = parent; -+ } -+ -+ @Override -+ protected void executeAction() { -+ Configuration.restoreDefaults(); -+ Configuration.write(); -+ -+ SpoutClient.getHandle().displayGuiScreen(GuiSimpleOptions.constructOptionsScreen(parent)); -+ } -+} ---- net/minecraft/src/BlockLadder.java -+++ net/minecraft/src/BlockLadder.java -@@ -3,110 +3,148 @@ - import java.util.Random; - - public class BlockLadder extends Block { -- protected BlockLadder(int var1) { -- super(var1, Material.circuits); -+ protected BlockLadder(int par1) { -+ super(par1, Material.circuits); - this.setCreativeTab(CreativeTabs.tabDecorations); - } - -- public AxisAlignedBB getCollisionBoundingBoxFromPool(World var1, int var2, int var3, int var4) { -- this.setBlockBoundsBasedOnState(var1, var2, var3, var4); -- return super.getCollisionBoundingBoxFromPool(var1, var2, var3, var4); -- } -- -- public AxisAlignedBB getSelectedBoundingBoxFromPool(World var1, int var2, int var3, int var4) { -- this.setBlockBoundsBasedOnState(var1, var2, var3, var4); -- return super.getSelectedBoundingBoxFromPool(var1, var2, var3, var4); -- } -- -- public void setBlockBoundsBasedOnState(IBlockAccess var1, int var2, int var3, int var4) { -- this.updateLadderBounds(var1.getBlockMetadata(var2, var3, var4)); -- } -- -- public void updateLadderBounds(int var1) { -- float var3 = 2.0F / 16.0F; -- if(var1 == 2) { -+ /** -+ * Returns a bounding box from the pool of bounding boxes (this means this box can change after the pool has been -+ * cleared to be reused) -+ */ -+ public AxisAlignedBB getCollisionBoundingBoxFromPool(World par1World, int par2, int par3, int par4) { -+ this.setBlockBoundsBasedOnState(par1World, par2, par3, par4); -+ return super.getCollisionBoundingBoxFromPool(par1World, par2, par3, par4); -+ } -+ -+ /** -+ * Returns the bounding box of the wired rectangular prism to render. -+ */ -+ public AxisAlignedBB getSelectedBoundingBoxFromPool(World par1World, int par2, int par3, int par4) { -+ this.setBlockBoundsBasedOnState(par1World, par2, par3, par4); -+ return super.getSelectedBoundingBoxFromPool(par1World, par2, par3, par4); -+ } -+ -+ /** -+ * Updates the blocks bounds based on its current state. Args: world, x, y, z -+ */ -+ public void setBlockBoundsBasedOnState(IBlockAccess par1IBlockAccess, int par2, int par3, int par4) { -+ this.updateLadderBounds(par1IBlockAccess.getBlockMetadata(par2, par3, par4)); -+ } -+ -+ /** -+ * Update the ladder block bounds based on the given metadata value. -+ */ -+ public void updateLadderBounds(int par1) { -+ float var3 = 0.125F; -+ -+ if (par1 == 2) { - this.setBlockBounds(0.0F, 0.0F, 1.0F - var3, 1.0F, 1.0F, 1.0F); - } - -- if(var1 == 3) { -+ if (par1 == 3) { - this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, var3); - } - -- if(var1 == 4) { -+ if (par1 == 4) { - this.setBlockBounds(1.0F - var3, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F); - } - -- if(var1 == 5) { -+ if (par1 == 5) { - this.setBlockBounds(0.0F, 0.0F, 0.0F, var3, 1.0F, 1.0F); - } -- - } - -+ /** -+ * Is this block (a) opaque and (b) a full 1m cube? This determines whether or not to render the shared face of two -+ * adjacent blocks and also whether the player can attach torches, redstone wire, etc to this block. -+ */ - public boolean isOpaqueCube() { - return false; - } - -+ /** -+ * If this block doesn't render as an ordinary block it will return False (examples: signs, buttons, stairs, etc) -+ */ - public boolean renderAsNormalBlock() { - return false; - } - -+ /** -+ * The type of render function that is called for this block -+ */ - public int getRenderType() { - return 8; - } - -- public boolean canPlaceBlockAt(World var1, int var2, int var3, int var4) { -- return var1.isBlockNormalCube(var2 - 1, var3, var4) ? true : (var1.isBlockNormalCube(var2 + 1, var3, var4) ? true : (var1.isBlockNormalCube(var2, var3, var4 - 1) ? true : var1.isBlockNormalCube(var2, var3, var4 + 1))); -+ /** -+ * Checks to see if its valid to put this block at the specified coordinates. Args: world, x, y, z -+ */ -+ public boolean canPlaceBlockAt(World par1World, int par2, int par3, int par4) { -+ return par1World.isBlockNormalCube(par2 - 1, par3, par4) ? true : (par1World.isBlockNormalCube(par2 + 1, par3, par4) ? true : (par1World.isBlockNormalCube(par2, par3, par4 - 1) ? true : par1World.isBlockNormalCube(par2, par3, par4 + 1))); - } - -- public int onBlockPlaced(World var1, int var2, int var3, int var4, int var5, float var6, float var7, float var8, int var9) { -- int var10 = var9; -- if((var9 == 0 || var5 == 2) && var1.isBlockNormalCube(var2, var3, var4 + 1)) { -+ /** -+ * Called when a block is placed using its ItemBlock. Args: World, X, Y, Z, side, hitX, hitY, hitZ, block metadata -+ */ -+ public int onBlockPlaced(World par1World, int par2, int par3, int par4, int par5, float par6, float par7, float par8, int par9) { -+ int var10 = par9; -+ -+ if ((par9 == 0 || par5 == 2) && par1World.isBlockNormalCube(par2, par3, par4 + 1)) { - var10 = 2; - } - -- if((var10 == 0 || var5 == 3) && var1.isBlockNormalCube(var2, var3, var4 - 1)) { -+ if ((var10 == 0 || par5 == 3) && par1World.isBlockNormalCube(par2, par3, par4 - 1)) { - var10 = 3; - } - -- if((var10 == 0 || var5 == 4) && var1.isBlockNormalCube(var2 + 1, var3, var4)) { -+ if ((var10 == 0 || par5 == 4) && par1World.isBlockNormalCube(par2 + 1, par3, par4)) { - var10 = 4; - } - -- if((var10 == 0 || var5 == 5) && var1.isBlockNormalCube(var2 - 1, var3, var4)) { -+ if ((var10 == 0 || par5 == 5) && par1World.isBlockNormalCube(par2 - 1, par3, par4)) { - var10 = 5; - } - - return var10; - } - -- public void onNeighborBlockChange(World var1, int var2, int var3, int var4, int var5) { -- int var6 = var1.getBlockMetadata(var2, var3, var4); -+ /** -+ * Lets the block know when one of its neighbor changes. Doesn't know which neighbor changed (coordinates passed are -+ * their own) Args: x, y, z, neighbor blockID -+ */ -+ public void onNeighborBlockChange(World par1World, int par2, int par3, int par4, int par5) { -+ int var6 = par1World.getBlockMetadata(par2, par3, par4); - boolean var7 = false; -- if(var6 == 2 && var1.isBlockNormalCube(var2, var3, var4 + 1)) { -- var7 = true; -- } -- -- if(var6 == 3 && var1.isBlockNormalCube(var2, var3, var4 - 1)) { -- var7 = true; -- } -- -- if(var6 == 4 && var1.isBlockNormalCube(var2 + 1, var3, var4)) { -- var7 = true; -- } -- -- if(var6 == 5 && var1.isBlockNormalCube(var2 - 1, var3, var4)) { -- var7 = true; -- } -- -- if(!var7) { -- this.dropBlockAsItem(var1, var2, var3, var4, var6, 0); -- var1.setBlockToAir(var2, var3, var4); -- } -- -- super.onNeighborBlockChange(var1, var2, var3, var4, var5); -+ -+ if (var6 == 2 && par1World.isBlockNormalCube(par2, par3, par4 + 1)) { -+ var7 = true; -+ } -+ -+ if (var6 == 3 && par1World.isBlockNormalCube(par2, par3, par4 - 1)) { -+ var7 = true; -+ } -+ -+ if (var6 == 4 && par1World.isBlockNormalCube(par2 + 1, par3, par4)) { -+ var7 = true; -+ } -+ -+ if (var6 == 5 && par1World.isBlockNormalCube(par2 - 1, par3, par4)) { -+ var7 = true; -+ } -+ -+ if (!var7) { -+ this.dropBlockAsItem(par1World, par2, par3, par4, var6, 0); -+ par1World.setBlockToAir(par2, par3, par4); -+ } -+ -+ super.onNeighborBlockChange(par1World, par2, par3, par4, par5); - } - -- public int quantityDropped(Random var1) { -+ /** -+ * Returns the quantity of items to drop on block destruction. -+ */ -+ public int quantityDropped(Random par1Random) { - return 1; - } - } ---- net/minecraft/src/Gui.java -+++ net/minecraft/src/Gui.java -@@ -8,68 +8,75 @@ - public static final ResourceLocation icons = new ResourceLocation("textures/gui/icons.png"); - protected float zLevel; - -- protected void drawHorizontalLine(int var1, int var2, int var3, int var4) { -- if(var2 < var1) { -- int var5 = var1; -- var1 = var2; -- var2 = var5; -- } -- -- drawRect(var1, var3, var2 + 1, var3 + 1, var4); -- } -- -- protected void drawVerticalLine(int var1, int var2, int var3, int var4) { -- if(var3 < var2) { -- int var5 = var2; -- var2 = var3; -- var3 = var5; -- } -- -- drawRect(var1, var2 + 1, var1 + 1, var3, var4); -- } -- -- public static void drawRect(int var0, int var1, int var2, int var3, int var4) { -+ protected void drawHorizontalLine(int par1, int par2, int par3, int par4) { -+ if (par2 < par1) { -+ int var5 = par1; -+ par1 = par2; -+ par2 = var5; -+ } -+ -+ drawRect(par1, par3, par2 + 1, par3 + 1, par4); -+ } -+ -+ protected void drawVerticalLine(int par1, int par2, int par3, int par4) { -+ if (par3 < par2) { -+ int var5 = par2; -+ par2 = par3; -+ par3 = var5; -+ } -+ -+ drawRect(par1, par2 + 1, par1 + 1, par3, par4); -+ } -+ -+ /** -+ * Draws a solid color rectangle with the specified coordinates and color. Args: x1, y1, x2, y2, color -+ */ -+ public static void drawRect(int par0, int par1, int par2, int par3, int par4) { - int var5; -- if(var0 < var2) { -- var5 = var0; -- var0 = var2; -- var2 = var5; -- } -- -- if(var1 < var3) { -- var5 = var1; -- var1 = var3; -- var3 = var5; -- } -- -- float var10 = (float)(var4 >> 24 & 255) / 255.0F; -- float var6 = (float)(var4 >> 16 & 255) / 255.0F; -- float var7 = (float)(var4 >> 8 & 255) / 255.0F; -- float var8 = (float)(var4 & 255) / 255.0F; -+ -+ if (par0 < par2) { -+ var5 = par0; -+ par0 = par2; -+ par2 = var5; -+ } -+ -+ if (par1 < par3) { -+ var5 = par1; -+ par1 = par3; -+ par3 = var5; -+ } -+ -+ float var10 = (float)(par4 >> 24 & 255) / 255.0F; -+ float var6 = (float)(par4 >> 16 & 255) / 255.0F; -+ float var7 = (float)(par4 >> 8 & 255) / 255.0F; -+ float var8 = (float)(par4 & 255) / 255.0F; - Tessellator var9 = Tessellator.instance; - GL11.glEnable(GL11.GL_BLEND); - GL11.glDisable(GL11.GL_TEXTURE_2D); - GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); - GL11.glColor4f(var6, var7, var8, var10); - var9.startDrawingQuads(); -- var9.addVertex((double)var0, (double)var3, 0.0D); -- var9.addVertex((double)var2, (double)var3, 0.0D); -- var9.addVertex((double)var2, (double)var1, 0.0D); -- var9.addVertex((double)var0, (double)var1, 0.0D); -+ var9.addVertex((double)par0, (double)par3, 0.0D); -+ var9.addVertex((double)par2, (double)par3, 0.0D); -+ var9.addVertex((double)par2, (double)par1, 0.0D); -+ var9.addVertex((double)par0, (double)par1, 0.0D); - var9.draw(); - GL11.glEnable(GL11.GL_TEXTURE_2D); - GL11.glDisable(GL11.GL_BLEND); - } - -- protected void drawGradientRect(int var1, int var2, int var3, int var4, int var5, int var6) { -- float var7 = (float)(var5 >> 24 & 255) / 255.0F; -- float var8 = (float)(var5 >> 16 & 255) / 255.0F; -- float var9 = (float)(var5 >> 8 & 255) / 255.0F; -- float var10 = (float)(var5 & 255) / 255.0F; -- float var11 = (float)(var6 >> 24 & 255) / 255.0F; -- float var12 = (float)(var6 >> 16 & 255) / 255.0F; -- float var13 = (float)(var6 >> 8 & 255) / 255.0F; -- float var14 = (float)(var6 & 255) / 255.0F; -+ /** -+ * Draws a rectangle with a vertical gradient between the specified colors. -+ */ -+ protected void drawGradientRect(int par1, int par2, int par3, int par4, int par5, int par6) { -+ float var7 = (float)(par5 >> 24 & 255) / 255.0F; -+ float var8 = (float)(par5 >> 16 & 255) / 255.0F; -+ float var9 = (float)(par5 >> 8 & 255) / 255.0F; -+ float var10 = (float)(par5 & 255) / 255.0F; -+ float var11 = (float)(par6 >> 24 & 255) / 255.0F; -+ float var12 = (float)(par6 >> 16 & 255) / 255.0F; -+ float var13 = (float)(par6 >> 8 & 255) / 255.0F; -+ float var14 = (float)(par6 & 255) / 255.0F; - GL11.glDisable(GL11.GL_TEXTURE_2D); - GL11.glEnable(GL11.GL_BLEND); - GL11.glDisable(GL11.GL_ALPHA_TEST); -@@ -78,11 +85,11 @@ - Tessellator var15 = Tessellator.instance; - var15.startDrawingQuads(); - var15.setColorRGBA_F(var8, var9, var10, var7); -- var15.addVertex((double)var3, (double)var2, (double)this.zLevel); -- var15.addVertex((double)var1, (double)var2, (double)this.zLevel); -+ var15.addVertex((double)par3, (double)par2, (double)this.zLevel); -+ var15.addVertex((double)par1, (double)par2, (double)this.zLevel); - var15.setColorRGBA_F(var12, var13, var14, var11); -- var15.addVertex((double)var1, (double)var4, (double)this.zLevel); -- var15.addVertex((double)var3, (double)var4, (double)this.zLevel); -+ var15.addVertex((double)par1, (double)par4, (double)this.zLevel); -+ var15.addVertex((double)par3, (double)par4, (double)this.zLevel); - var15.draw(); - GL11.glShadeModel(GL11.GL_FLAT); - GL11.glDisable(GL11.GL_BLEND); -@@ -90,33 +97,42 @@ - GL11.glEnable(GL11.GL_TEXTURE_2D); - } - -- public void drawCenteredString(FontRenderer var1, String var2, int var3, int var4, int var5) { -- var1.drawStringWithShadow(var2, var3 - var1.getStringWidth(var2) / 2, var4, var5); -- } -- -- public void drawString(FontRenderer var1, String var2, int var3, int var4, int var5) { -- var1.drawStringWithShadow(var2, var3, var4, var5); -- } -- -- public void drawTexturedModalRect(int var1, int var2, int var3, int var4, int var5, int var6) { -+ /** -+ * Renders the specified text to the screen, center-aligned. -+ */ -+ public void drawCenteredString(FontRenderer par1FontRenderer, String par2Str, int par3, int par4, int par5) { -+ par1FontRenderer.drawStringWithShadow(par2Str, par3 - par1FontRenderer.getStringWidth(par2Str) / 2, par4, par5); -+ } -+ -+ /** -+ * Renders the specified text to the screen. -+ */ -+ public void drawString(FontRenderer par1FontRenderer, String par2Str, int par3, int par4, int par5) { -+ par1FontRenderer.drawStringWithShadow(par2Str, par3, par4, par5); -+ } -+ -+ /** -+ * Draws a textured rectangle at the stored z-value. Args: x, y, u, v, width, height -+ */ -+ public void drawTexturedModalRect(int par1, int par2, int par3, int par4, int par5, int par6) { - float var7 = 0.00390625F; - float var8 = 0.00390625F; - Tessellator var9 = Tessellator.instance; - var9.startDrawingQuads(); -- var9.addVertexWithUV((double)(var1 + 0), (double)(var2 + var6), (double)this.zLevel, (double)((float)(var3 + 0) * var7), (double)((float)(var4 + var6) * var8)); -- var9.addVertexWithUV((double)(var1 + var5), (double)(var2 + var6), (double)this.zLevel, (double)((float)(var3 + var5) * var7), (double)((float)(var4 + var6) * var8)); -- var9.addVertexWithUV((double)(var1 + var5), (double)(var2 + 0), (double)this.zLevel, (double)((float)(var3 + var5) * var7), (double)((float)(var4 + 0) * var8)); -- var9.addVertexWithUV((double)(var1 + 0), (double)(var2 + 0), (double)this.zLevel, (double)((float)(var3 + 0) * var7), (double)((float)(var4 + 0) * var8)); -+ var9.addVertexWithUV((double)(par1 + 0), (double)(par2 + par6), (double)this.zLevel, (double)((float)(par3 + 0) * var7), (double)((float)(par4 + par6) * var8)); -+ var9.addVertexWithUV((double)(par1 + par5), (double)(par2 + par6), (double)this.zLevel, (double)((float)(par3 + par5) * var7), (double)((float)(par4 + par6) * var8)); -+ var9.addVertexWithUV((double)(par1 + par5), (double)(par2 + 0), (double)this.zLevel, (double)((float)(par3 + par5) * var7), (double)((float)(par4 + 0) * var8)); -+ var9.addVertexWithUV((double)(par1 + 0), (double)(par2 + 0), (double)this.zLevel, (double)((float)(par3 + 0) * var7), (double)((float)(par4 + 0) * var8)); - var9.draw(); - } - -- public void drawTexturedModelRectFromIcon(int var1, int var2, Icon var3, int var4, int var5) { -+ public void drawTexturedModelRectFromIcon(int par1, int par2, Icon par3Icon, int par4, int par5) { - Tessellator var6 = Tessellator.instance; - var6.startDrawingQuads(); -- var6.addVertexWithUV((double)(var1 + 0), (double)(var2 + var5), (double)this.zLevel, (double)var3.getMinU(), (double)var3.getMaxV()); -- var6.addVertexWithUV((double)(var1 + var4), (double)(var2 + var5), (double)this.zLevel, (double)var3.getMaxU(), (double)var3.getMaxV()); -- var6.addVertexWithUV((double)(var1 + var4), (double)(var2 + 0), (double)this.zLevel, (double)var3.getMaxU(), (double)var3.getMinV()); -- var6.addVertexWithUV((double)(var1 + 0), (double)(var2 + 0), (double)this.zLevel, (double)var3.getMinU(), (double)var3.getMinV()); -+ var6.addVertexWithUV((double)(par1 + 0), (double)(par2 + par5), (double)this.zLevel, (double)par3Icon.getMinU(), (double)par3Icon.getMaxV()); -+ var6.addVertexWithUV((double)(par1 + par4), (double)(par2 + par5), (double)this.zLevel, (double)par3Icon.getMaxU(), (double)par3Icon.getMaxV()); -+ var6.addVertexWithUV((double)(par1 + par4), (double)(par2 + 0), (double)this.zLevel, (double)par3Icon.getMaxU(), (double)par3Icon.getMinV()); -+ var6.addVertexWithUV((double)(par1 + 0), (double)(par2 + 0), (double)this.zLevel, (double)par3Icon.getMinU(), (double)par3Icon.getMinV()); - var6.draw(); - } - } ---- net/minecraft/src/WorldGenForest.java -+++ net/minecraft/src/WorldGenForest.java -@@ -3,33 +3,37 @@ - import java.util.Random; - - public class WorldGenForest extends WorldGenerator { -- public WorldGenForest(boolean var1) { -- super(var1); -+ public WorldGenForest(boolean par1) { -+ super(par1); - } - -- public boolean generate(World var1, Random var2, int var3, int var4, int var5) { -- int var6 = var2.nextInt(3) + 5; -+ public boolean generate(World par1World, Random par2Random, int par3, int par4, int par5) { -+ int var6 = par2Random.nextInt(3) + 5; - boolean var7 = true; -- if(var4 >= 1 && var4 + var6 + 1 <= 256) { -+ -+ if (par4 >= 1 && par4 + var6 + 1 <= 256) { - int var8; - int var10; - int var11; - int var12; -- for(var8 = var4; var8 <= var4 + 1 + var6; ++var8) { -+ -+ for (var8 = par4; var8 <= par4 + 1 + var6; ++var8) { - byte var9 = 1; -- if(var8 == var4) { -+ -+ if (var8 == par4) { - var9 = 0; - } - -- if(var8 >= var4 + 1 + var6 - 2) { -+ if (var8 >= par4 + 1 + var6 - 2) { - var9 = 2; - } - -- for(var10 = var3 - var9; var10 <= var3 + var9 && var7; ++var10) { -- for(var11 = var5 - var9; var11 <= var5 + var9 && var7; ++var11) { -- if(var8 >= 0 && var8 < 256) { -- var12 = var1.getBlockId(var10, var8, var11); -- if(var12 != 0 && var12 != Block.leaves.blockID) { -+ for (var10 = par3 - var9; var10 <= par3 + var9 && var7; ++var10) { -+ for (var11 = par5 - var9; var11 <= par5 + var9 && var7; ++var11) { -+ if (var8 >= 0 && var8 < 256) { -+ var12 = par1World.getBlockId(var10, var8, var11); -+ -+ if (var12 != 0 && var12 != Block.leaves.blockID) { - var7 = false; - } - } else { -@@ -39,37 +43,41 @@ - } - } - -- if(!var7) { -+ if (!var7) { - return false; - } else { -- var8 = var1.getBlockId(var3, var4 - 1, var5); -- if((var8 == Block.grass.blockID || var8 == Block.dirt.blockID) && var4 < 256 - var6 - 1) { -- this.setBlock(var1, var3, var4 - 1, var5, Block.dirt.blockID); -+ var8 = par1World.getBlockId(par3, par4 - 1, par5); - -+ if ((var8 == Block.grass.blockID || var8 == Block.dirt.blockID) && par4 < 256 - var6 - 1) { -+ this.setBlock(par1World, par3, par4 - 1, par5, Block.dirt.blockID); - int var17; -- for(var17 = var4 - 3 + var6; var17 <= var4 + var6; ++var17) { -- var10 = var17 - (var4 + var6); -+ -+ for (var17 = par4 - 3 + var6; var17 <= par4 + var6; ++var17) { -+ var10 = var17 - (par4 + var6); - var11 = 1 - var10 / 2; - -- for(var12 = var3 - var11; var12 <= var3 + var11; ++var12) { -- int var13 = var12 - var3; -- -- for(int var14 = var5 - var11; var14 <= var5 + var11; ++var14) { -- int var15 = var14 - var5; -- if(Math.abs(var13) != var11 || Math.abs(var15) != var11 || var2.nextInt(2) != 0 && var10 != 0) { -- int var16 = var1.getBlockId(var12, var17, var14); -- if(var16 == 0 || var16 == Block.leaves.blockID) { -- this.setBlockAndMetadata(var1, var12, var17, var14, Block.leaves.blockID, 2); -+ for (var12 = par3 - var11; var12 <= par3 + var11; ++var12) { -+ int var13 = var12 - par3; -+ -+ for (int var14 = par5 - var11; var14 <= par5 + var11; ++var14) { -+ int var15 = var14 - par5; -+ -+ if (Math.abs(var13) != var11 || Math.abs(var15) != var11 || par2Random.nextInt(2) != 0 && var10 != 0) { -+ int var16 = par1World.getBlockId(var12, var17, var14); -+ -+ if (var16 == 0 || var16 == Block.leaves.blockID) { -+ this.setBlockAndMetadata(par1World, var12, var17, var14, Block.leaves.blockID, 2); - } - } - } - } - } - -- for(var17 = 0; var17 < var6; ++var17) { -- var10 = var1.getBlockId(var3, var4 + var17, var5); -- if(var10 == 0 || var10 == Block.leaves.blockID) { -- this.setBlockAndMetadata(var1, var3, var4 + var17, var5, Block.wood.blockID, 2); -+ for (var17 = 0; var17 < var6; ++var17) { -+ var10 = par1World.getBlockId(par3, par4 + var17, par5); -+ -+ if (var10 == 0 || var10 == Block.leaves.blockID) { -+ this.setBlockAndMetadata(par1World, par3, par4 + var17, par5, Block.wood.blockID, 2); - } - } - ---- /dev/null -+++ org/spoutcraft/client/player/accessories/AccessoryType.java -@@ -1,0 +1,54 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.client.player.accessories; -+ -+import java.util.HashMap; -+import java.util.Map; -+ -+public enum AccessoryType { -+ TOPHAT(1), -+ NOTCHHAT(2), -+ BRACELET(3), -+ WINGS(4), -+ EARS(5), -+ SUNGLASSES(6), -+ TAIL(7), -+ WIZARDHAT(8); -+ private final int id; -+ private static Map types = new HashMap(); -+ -+ static { -+ for (AccessoryType type : AccessoryType.values()) { -+ types.put(type.getId(), type); -+ } -+ } -+ -+ private AccessoryType(int id) { -+ this.id = id; -+ } -+ -+ public int getId() { -+ return id; -+ } -+ -+ public static AccessoryType get(int id) { -+ return types.get(id); -+ } -+} ---- /dev/null -+++ com/prupe/mcpatcher/ProfilerAPI.java -@@ -1,0 +1,25 @@ -+package com.prupe.mcpatcher; -+ -+import net.minecraft.src.Minecraft; -+ -+public class ProfilerAPI { -+ private static final boolean enable = Config.getInstance().extraProfiling; -+ -+ public static void startSection(String name) { -+ if (enable) { -+ Minecraft.getMinecraft().mcProfiler.startSection(name); -+ } -+ } -+ -+ public static void endStartSection(String name) { -+ if (enable) { -+ Minecraft.getMinecraft().mcProfiler.endStartSection(name); -+ } -+ } -+ -+ public static void endSection() { -+ if (enable) { -+ Minecraft.getMinecraft().mcProfiler.endSection(); -+ } -+ } -+} ---- net/minecraft/src/DedicatedServerSleepThread.java -+++ net/minecraft/src/DedicatedServerSleepThread.java -@@ -1,19 +1,24 @@ - package net.minecraft.src; - - class DedicatedServerSleepThread extends Thread { -+ -+ /** Instance of the DecitatedServer. */ - final DedicatedServer theDecitatedServer; - -- DedicatedServerSleepThread(DedicatedServer var1) { -- this.theDecitatedServer = var1; -+ DedicatedServerSleepThread(DedicatedServer par1DedicatedServer) { -+ this.theDecitatedServer = par1DedicatedServer; - this.setDaemon(true); - this.start(); - } - - public void run() { -- while(true) { -+ while (true) { - try { -- Thread.sleep(2147483647L); -+ while (true) { -+ Thread.sleep(2147483647L); -+ } - } catch (InterruptedException var2) { -+ ; - } - } - } ---- /dev/null -+++ org/spoutcraft/api/util/map/TIntPairIntHashMap.java -@@ -1,0 +1,101 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.api.util.map; -+ -+import gnu.trove.TIntCollection; -+import gnu.trove.iterator.TLongIntIterator; -+import gnu.trove.map.hash.TLongIntHashMap; -+import gnu.trove.set.TLongSet; -+ -+/** -+ * A simplistic map that supports a pair of integers for keys, using a trove long int hashmap in the backend. -+ */ -+public class TIntPairIntHashMap { -+ private TLongIntHashMap map; -+ -+ public TIntPairIntHashMap() { -+ map = new TLongIntHashMap(100); -+ } -+ -+ public TIntPairIntHashMap(int capacity) { -+ map = new TLongIntHashMap(capacity); -+ } -+ -+ public int put(int key1, int key2, int value) { -+ long key = (((long)key1)<<32) | (((long)key2) & 0xFFFFFFFFL); -+ return map.put(key, value); -+ } -+ -+ public int get(int key1, int key2) { -+ long key = (((long)key1)<<32) | (((long)key2) & 0xFFFFFFFFL); -+ return map.get(key); -+ } -+ -+ public boolean containsKey(int key1, int key2) { -+ long key = (((long)key1)<<32) | (((long)key2) & 0xFFFFFFFFL); -+ return map.containsKey(key); -+ } -+ -+ public void clear() { -+ map.clear(); -+ } -+ -+ public boolean containsValue(int val) { -+ return map.containsValue(val); -+ } -+ -+ public boolean increment(int key1, int key2) { -+ long key = (((long)key1)<<32) | (((long)key2) & 0xFFFFFFFFL); -+ return map.increment(key); -+ } -+ -+ public boolean isEmpty() { -+ return map.isEmpty(); -+ } -+ -+ public TLongIntIterator iterator() { -+ return map.iterator(); -+ } -+ -+ public TLongSet keySet() { -+ return map.keySet(); -+ } -+ -+ public long[] keys() { -+ return map.keys(); -+ } -+ -+ public int remove(int key1, int key2) { -+ long key = (((long)key1)<<32) | (((long)key2) & 0xFFFFFFFFL); -+ return map.remove(key); -+ } -+ -+ public int size() { -+ return map.size(); -+ } -+ -+ public TIntCollection valueCollection() { -+ return map.valueCollection(); -+ } -+ -+ public int[] values() { -+ return map.values(); -+ } -+} ---- net/minecraft/src/McoServerList.java -+++ net/minecraft/src/McoServerList.java -@@ -9,28 +9,28 @@ - public class McoServerList { - private volatile boolean field_98259_a; - private McoServerListUpdateTask field_98257_b = new McoServerListUpdateTask(this, (McoServerListEmptyAnon)null); -- private java.util.Timer c = new java.util.Timer(); -- private Set d = Sets.newHashSet(); -- private List e = Lists.newArrayList(); -+ private java.util.Timer field_98258_c = new java.util.Timer(); -+ private Set field_140060_d = Sets.newHashSet(); -+ private List field_98255_d = Lists.newArrayList(); - private int field_130130_e; - private boolean field_140059_g; - private Session field_98254_f; - private int field_140061_i; - - public McoServerList() { -- this.c.schedule(this.field_98257_b, 0L, 10000L); -+ this.field_98258_c.schedule(this.field_98257_b, 0L, 10000L); - this.field_98254_f = Minecraft.getMinecraft().getSession(); - } - -- public synchronized void func_130129_a(Session var1) { -- this.field_98254_f = var1; -- if(this.field_98259_a) { -+ public synchronized void func_130129_a(Session par1Session) { -+ this.field_98254_f = par1Session; -+ -+ if (this.field_98259_a) { - this.field_98259_a = false; - this.field_98257_b = new McoServerListUpdateTask(this, (McoServerListEmptyAnon)null); -- this.c = new java.util.Timer(); -- this.c.schedule(this.field_98257_b, 0L, 10000L); -+ this.field_98258_c = new java.util.Timer(); -+ this.field_98258_c.schedule(this.field_98257_b, 0L, 10000L); - } -- - } - - public synchronized boolean func_130127_a() { -@@ -42,7 +42,7 @@ - } - - public synchronized List func_98252_c() { -- return Lists.newArrayList((Iterable)this.e); -+ return Lists.newArrayList(this.field_98255_d); - } - - public int func_130124_d() { -@@ -56,54 +56,55 @@ - public synchronized void func_98248_d() { - this.field_98259_a = true; - this.field_98257_b.cancel(); -- this.c.cancel(); -+ this.field_98258_c.cancel(); - } - -- private synchronized void func_96426_a(List var1) { -+ private synchronized void func_96426_a(List par1List) { - int var2 = 0; -- Iterator var3 = this.d.iterator(); -+ Iterator var3 = this.field_140060_d.iterator(); - -- while(var3.hasNext()) { -+ while (var3.hasNext()) { - McoServer var4 = (McoServer)var3.next(); -- if(var1.remove(var4)) { -+ -+ if (par1List.remove(var4)) { - ++var2; - } - } - -- if(var2 == 0) { -- this.d.clear(); -+ if (var2 == 0) { -+ this.field_140060_d.clear(); - } - -- this.e = var1; -+ this.field_98255_d = par1List; - this.field_140059_g = true; - } - -- public synchronized void func_140058_a(McoServer var1) { -- this.e.remove(var1); -- this.d.add(var1); -- } -- -- private void func_130123_a(int var1) { -- this.field_130130_e = var1; -- } -- -- static boolean func_98249_b(McoServerList var0) { -- return var0.field_98259_a; -- } -- -- static Session func_100014_a(McoServerList var0) { -- return var0.field_98254_f; -- } -- -- static void func_98247_a(McoServerList var0, List var1) { -- var0.func_96426_a(var1); -- } -- -- static void func_130122_a(McoServerList var0, int var1) { -- var0.func_130123_a(var1); -- } -- -- static int func_140057_b(McoServerList var0, int var1) { -- return var0.field_140061_i = var1; -+ public synchronized void func_140058_a(McoServer par1McoServer) { -+ this.field_98255_d.remove(par1McoServer); -+ this.field_140060_d.add(par1McoServer); -+ } -+ -+ private void func_130123_a(int par1) { -+ this.field_130130_e = par1; -+ } -+ -+ static boolean func_98249_b(McoServerList par0McoServerList) { -+ return par0McoServerList.field_98259_a; -+ } -+ -+ static Session func_100014_a(McoServerList par0McoServerList) { -+ return par0McoServerList.field_98254_f; -+ } -+ -+ static void func_98247_a(McoServerList par0McoServerList, List par1List) { -+ par0McoServerList.func_96426_a(par1List); -+ } -+ -+ static void func_130122_a(McoServerList par0McoServerList, int par1) { -+ par0McoServerList.func_130123_a(par1); -+ } -+ -+ static int func_140057_b(McoServerList par0McoServerList, int par1) { -+ return par0McoServerList.field_140061_i = par1; - } - } ---- net/minecraft/src/ILogAgent.java -+++ net/minecraft/src/ILogAgent.java -@@ -5,7 +5,7 @@ - - void logWarning(String var1); - -- void logWarningFormatted(String var1, Object... var2); -+ void logWarningFormatted(String var1, Object ... var2); - - void logWarningException(String var1, Throwable var2); - ---- /dev/null -+++ org/spoutcraft/client/gui/minimap/BlockColor.java -@@ -1,0 +1,490 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.client.gui.minimap; -+ -+/** -+ * Represents a block color. -+ */ -+public class BlockColor { -+ /** -+ * Block color array - contains 256 (blocks) * 16 (metadata) color slots. -+ * @see getBlockColor -+ * @see blockColorID -+ */ -+ private static final BlockColor[] blockColors = new BlockColor[4096]; -+ -+ /** -+ * turn a block ID and a metadata value into an index in blockColors -+ * @param blockid block ID -+ * @param meta metadata value -+ * @return index in blockColors -+ * @see blockColors -+ * @see getBlockColor -+ */ -+ -+ public static int blockColorID(int blockid, int meta) { -+ return (blockid) | (meta << 8); -+ } -+ -+ /** -+ * Retrieve the BlockColor object for a block ID and block metadata. -+ * @param blockid block ID -+ * @param meta metadata value -+ * @return BlockColor retrieved -+ */ -+ -+ public static BlockColor getBlockColor(int blockid, int meta) { -+ try { -+ BlockColor col = blockColors[blockColorID(blockid, meta)]; -+ if (col != null) return col; -+ col = blockColors[blockColorID(blockid, 0)]; -+ if (col != null) return col; -+ col = blockColors[0]; -+ if (col != null) return col; -+ } -+ catch (ArrayIndexOutOfBoundsException e) { -+ System.err.println("BlockID: " + blockid + " - Meta: " + meta); -+ throw e; -+ } -+ System.err.println("Unable to find a block color for blockid: " + blockid + " blockmeta: " + meta); -+ return new BlockColor(0, 0xff, TintType.NONE); -+ } -+ -+ /** -+ * Initialize the default colors in the block color array -+ */ -+ -+ public static void initDefaultColors() { -+ for (int i = 0; i < blockColors.length; i++) { -+ blockColors[i] = null; -+ } -+ setDefaultColor(0, 0, 0); -+ setDefaultColor(1, 0, -9934744); -+ setDefaultColor(2, 0, -12096451); -+ setDefaultColor(3, 0, -8825542); -+ setDefaultColor(4, 0, -6974059); -+ setDefaultColor(5, 0, -4417438); -+ setDefaultColor(6, 0, 1816358162); -+ setDefaultColor(6, 1, 1412577569); -+ setDefaultColor(6, 2, 1819645267); -+ setDefaultColor(7, 0, -13421773); -+ setDefaultColor(8, 0, -1960157441); -+ setDefaultColor(9, 0, -1960157441); -+ setDefaultColor(10, 0, -2530028); -+ setDefaultColor(11, 0, -2530028); -+ setDefaultColor(12, 0, -2238560); -+ setDefaultColor(13, 0, -7766146); -+ setDefaultColor(14, 0, -7304324); -+ setDefaultColor(15, 0, -7830913); -+ setDefaultColor(16, 0, -9145485); -+ setDefaultColor(17, 0, -10006222); -+ setDefaultColor(17, 1, -13358823); -+ setDefaultColor(17, 2, -3620193); -+ setDefaultColor(18, 0, -1708107227); -+ setDefaultColor(18, 1, -1522906074); -+ setDefaultColor(18, 2, -1707912909); -+ setDefaultColor(18, 3, -1707912909); -+ setDefaultColor(18, 4, -1708107227); -+ setDefaultColor(18, 5, -1522906074); -+ setDefaultColor(18, 6, -1707912909); -+ setDefaultColor(18, 7, -1707912909); -+ setDefaultColor(19, 0, -1710770); -+ setDefaultColor(20, 0, 1090519039); -+ setDefaultColor(21, 0, -9998201); -+ setDefaultColor(22, 0, -14858330); -+ setDefaultColor(23, 0, -10987432); -+ setDefaultColor(24, 0, -2370913); -+ setDefaultColor(25, 0, -10206158); -+ setDefaultColor(26, 0, -6339259); -+ setDefaultColor(26, 1, -6339259); -+ setDefaultColor(26, 2, -6339259); -+ setDefaultColor(26, 3, -6339259); -+ setDefaultColor(26, 4, -6339259); -+ setDefaultColor(26, 5, -6339259); -+ setDefaultColor(26, 6, -6339259); -+ setDefaultColor(26, 7, -6339259); -+ setDefaultColor(26, 8, -6397599); -+ setDefaultColor(26, 9, -6397599); -+ setDefaultColor(26, 10, -6397599); -+ setDefaultColor(26, 11, -6397599); -+ setDefaultColor(26, 12, -6397599); -+ setDefaultColor(26, 13, -6397599); -+ setDefaultColor(26, 14, -6397599); -+ setDefaultColor(26, 15, -6397599); -+ setDefaultColor(27, 0, -528457632); -+ setDefaultColor(27, 1, -528457632); -+ setDefaultColor(27, 2, -528457632); -+ setDefaultColor(27, 3, -528457632); -+ setDefaultColor(27, 4, -528457632); -+ setDefaultColor(27, 5, -528457632); -+ setDefaultColor(27, 6, -528457632); -+ setDefaultColor(27, 7, -528457632); -+ setDefaultColor(27, 8, -523214752); -+ setDefaultColor(27, 9, -523214752); -+ setDefaultColor(27, 10, -523214752); -+ setDefaultColor(27, 11, -523214752); -+ setDefaultColor(27, 12, -523214752); -+ setDefaultColor(27, 13, -523214752); -+ setDefaultColor(27, 14, -523214752); -+ setDefaultColor(27, 15, -523214752); -+ setDefaultColor(28, 0, -8952744); -+ setDefaultColor(29, 0, -9605779); -+ setDefaultColor(29, 1, -7499421); -+ setDefaultColor(29, 2, -9804194); -+ setDefaultColor(29, 3, -9804194); -+ setDefaultColor(29, 4, -9804194); -+ setDefaultColor(29, 5, -9804194); -+ setDefaultColor(29, 8, -9605779); -+ setDefaultColor(29, 9, -7499421); -+ setDefaultColor(29, 10, -9804194); -+ setDefaultColor(29, 11, -9804194); -+ setDefaultColor(29, 12, -9804194); -+ setDefaultColor(29, 13, -9804194); -+ setDefaultColor(30, 0, 1775884761); -+ setDefaultColor(31, 0, 1383747097); -+ setDefaultColor(31, 1, -1571782606); -+ setDefaultColor(31, 2, 1330675762); -+ setDefaultColor(32, 0, 1383747097); -+ setDefaultColor(33, 0, -9605779); -+ setDefaultColor(33, 1, -6717094); -+ setDefaultColor(33, 2, -9804194); -+ setDefaultColor(33, 3, -9804194); -+ setDefaultColor(33, 4, -9804194); -+ setDefaultColor(33, 5, -9804194); -+ setDefaultColor(33, 8, -9605779); -+ setDefaultColor(33, 9, -6717094); -+ setDefaultColor(33, 10, -9804194); -+ setDefaultColor(33, 11, -9804194); -+ setDefaultColor(33, 12, -9804194); -+ setDefaultColor(33, 13, -9804194); -+ setDefaultColor(34, 0, -6717094); -+ setDefaultColor(34, 1, -6717094); -+ setDefaultColor(34, 2, -2137423526); -+ setDefaultColor(34, 3, -2137423526); -+ setDefaultColor(34, 4, -2137423526); -+ setDefaultColor(34, 5, -2137423526); -+ setDefaultColor(34, 8, -6717094); -+ setDefaultColor(34, 9, -7499421); -+ setDefaultColor(34, 10, -2137423526); -+ setDefaultColor(34, 11, -2137423526); -+ setDefaultColor(34, 12, -2137423526); -+ setDefaultColor(34, 13, -2137423526); -+ setDefaultColor(35, 0, -2236963); -+ setDefaultColor(35, 1, -1475018); -+ setDefaultColor(35, 2, -4370744); -+ setDefaultColor(35, 3, -9991469); -+ setDefaultColor(35, 4, -4082660); -+ setDefaultColor(35, 5, -12928209); -+ setDefaultColor(35, 6, -2588006); -+ setDefaultColor(35, 7, -12434878); -+ setDefaultColor(35, 8, -6445916); -+ setDefaultColor(35, 9, -14191468); -+ setDefaultColor(35, 10, -8374846); -+ setDefaultColor(35, 11, -14273895); -+ setDefaultColor(35, 12, -11193573); -+ setDefaultColor(35, 13, -13153256); -+ setDefaultColor(35, 14, -6083544); -+ setDefaultColor(35, 15, -15067369); -+ setDefaultColor(37, 0, -1057883902); -+ setDefaultColor(38, 0, -1057552625); -+ setDefaultColor(39, 0, -1064211115); -+ setDefaultColor(40, 0, -1063643364); -+ setDefaultColor(41, 0, -66723); -+ setDefaultColor(42, 0, -1447447); -+ setDefaultColor(43, 0, -5723992); -+ setDefaultColor(43, 1, -1712721); -+ setDefaultColor(43, 2, -7046838); -+ setDefaultColor(43, 3, -8224126); -+ setDefaultColor(43, 4, -6591135); -+ setDefaultColor(43, 5, -8750470); -+ setDefaultColor(44, 0, -5723992); -+ setDefaultColor(44, 1, -1712721); -+ setDefaultColor(44, 2, -7046838); -+ setDefaultColor(44, 3, -8224126); -+ setDefaultColor(44, 4, -6591135); -+ setDefaultColor(44, 5, -8750470); -+ setDefaultColor(45, 0, -6591135); -+ setDefaultColor(46, 0, -2407398); -+ setDefaultColor(47, 0, -4943782); -+ setDefaultColor(48, 0, -14727393); -+ setDefaultColor(49, 0, -15527395); -+ setDefaultColor(50, 0, 1627379712); -+ setDefaultColor(51, 0, -4171263); -+ setDefaultColor(52, 0, -14262393); -+ setDefaultColor(53, 0, -4417438); -+ setDefaultColor(54, 0, -7378659); -+ setDefaultColor(55, 0, 1827466476); -+ setDefaultColor(56, 0, -8287089); -+ setDefaultColor(57, 0, -10428192); -+ setDefaultColor(58, 0, -8038091); -+ setDefaultColor(59, 0, 302029071); -+ setDefaultColor(59, 1, 957524751); -+ setDefaultColor(59, 2, 1444710667); -+ setDefaultColor(59, 3, -1708815608); -+ setDefaultColor(59, 4, -835813369); -+ setDefaultColor(59, 5, -532579833); -+ setDefaultColor(59, 6, -531663353); -+ setDefaultColor(59, 7, -531208953); -+ setDefaultColor(60, 0, -9221331); -+ setDefaultColor(60, 1, -9550295); -+ setDefaultColor(60, 2, -9879003); -+ setDefaultColor(60, 3, -10207967); -+ setDefaultColor(60, 4, -10536675); -+ setDefaultColor(60, 5, -10865383); -+ setDefaultColor(60, 6, -11194347); -+ setDefaultColor(60, 7, -11523055); -+ setDefaultColor(60, 8, -11786226); -+ setDefaultColor(61, 0, -9145228); -+ setDefaultColor(62, 0, -8355712); -+ setDefaultColor(63, 0, -1598779307); -+ setDefaultColor(64, 0, -1064934094); -+ setDefaultColor(65, 0, -2139595212); -+ setDefaultColor(66, 0, -8951211); -+ setDefaultColor(67, 0, -6381922); -+ setDefaultColor(68, 0, -1598779307); -+ setDefaultColor(69, 0, -1603709901); -+ setDefaultColor(70, 0, -7368817); -+ setDefaultColor(71, 0, -1061043775); -+ setDefaultColor(72, 0, -4417438); -+ setDefaultColor(73, 0, -6981535); -+ setDefaultColor(74, 0, -6981535); -+ setDefaultColor(75, 0, -2141709038); -+ setDefaultColor(76, 0, -2136923117); -+ setDefaultColor(77, 0, -2139851660); -+ setDefaultColor(78, 0, -1314833); -+ setDefaultColor(79, 0, -1619219203); -+ setDefaultColor(80, 0, -986896); -+ setDefaultColor(81, 0, -15695840); -+ setDefaultColor(82, 0, -6380624); -+ setDefaultColor(83, 0, -7094428); -+ setDefaultColor(84, 0, -9811658); -+ setDefaultColor(85, 0, -4417438); -+ setDefaultColor(86, 0, -4229867); -+ setDefaultColor(87, 0, -9751501); -+ setDefaultColor(88, 0, -11255757); -+ setDefaultColor(89, 0, -4157626); -+ setDefaultColor(90, 0, -9231226); -+ setDefaultColor(91, 0, -3893474); -+ setDefaultColor(92, 0, -1848115); -+ setDefaultColor(93, 0, -6843501); -+ setDefaultColor(94, 0, -4156525); -+ setDefaultColor(95, 0, -7378659); -+ setDefaultColor(96, 0, -8495827); -+ setDefaultColor(96, 1, -8495827); -+ setDefaultColor(96, 2, -8495827); -+ setDefaultColor(96, 3, -8495827); -+ setDefaultColor(96, 4, 545152301); -+ setDefaultColor(96, 5, 545152301); -+ setDefaultColor(96, 6, 545152301); -+ setDefaultColor(96, 7, 545152301); -+ -+ setDefaultColor(97, 0, -9934744); -+ setDefaultColor(97, 1, -6974059); -+ setDefaultColor(97, 2, -8750470); -+ -+ setDefaultColor(98, 0, -8750470); -+ setDefaultColor(98, 1, -9275542); -+ setDefaultColor(98, 2, -9013642); -+ -+ setDefaultColor(99, 0, -3495048); -+ setDefaultColor(99, 1, -7509421); -+ setDefaultColor(99, 2, -7509421); -+ setDefaultColor(99, 3, -7509421); -+ setDefaultColor(99, 4, -7509421); -+ setDefaultColor(99, 5, -7509421); -+ setDefaultColor(99, 6, -7509421); -+ setDefaultColor(99, 7, -7509421); -+ setDefaultColor(99, 8, -7509421); -+ setDefaultColor(99, 9, -7509421); -+ setDefaultColor(99, 10, -3495048); -+ -+ setDefaultColor(100, 0, -3495048); -+ setDefaultColor(100, 1, -4840156); -+ setDefaultColor(100, 2, -4840156); -+ setDefaultColor(100, 3, -4840156); -+ setDefaultColor(100, 4, -4840156); -+ setDefaultColor(100, 5, -4840156); -+ setDefaultColor(100, 6, -4840156); -+ setDefaultColor(100, 7, -4840156); -+ setDefaultColor(100, 8, -4840156); -+ setDefaultColor(100, 9, -4840156); -+ setDefaultColor(100, 10, -3495048); -+ -+ setDefaultColor(101, 0, -2140312470); -+ setDefaultColor(102, 0, 1627389951); -+ setDefaultColor(103, 0, -6842076); -+ setDefaultColor(104, 0, 1073780992); -+ setDefaultColor(104, 1, 1209242626); -+ setDefaultColor(104, 2, 1344704516); -+ setDefaultColor(104, 3, 1480166151); -+ setDefaultColor(104, 4, 1615693321); -+ setDefaultColor(104, 5, 1751154956); -+ setDefaultColor(104, 6, 1886616590); -+ setDefaultColor(104, 7, 2022144016); -+ setDefaultColor(105, 0, 1073780992); -+ setDefaultColor(105, 1, 1209242626); -+ setDefaultColor(105, 2, 1344704516); -+ setDefaultColor(105, 3, 1480166151); -+ setDefaultColor(105, 4, 1615693321); -+ setDefaultColor(105, 5, 1751154956); -+ setDefaultColor(105, 6, 1886616590); -+ setDefaultColor(105, 7, 2022144016); -+ setDefaultColor(106, 0, -2145432054); -+ setDefaultColor(107, 0, -1061382046); -+ setDefaultColor(108, 0, -6591135); -+ setDefaultColor(109, 0, -8750470); -+ -+ setDefaultColor(110, 0, 0xAB8790, 0xFF); -+ setDefaultColor(111, 0, 0x158003, 0xFF); -+ setDefaultColor(112, 0, 0x40002F, 0xFF); -+ setDefaultColor(113, 0, 0x40002F, 0xFF); -+ setDefaultColor(114, 0, 0x40002F, 0xFF); -+ setDefaultColor(115, 0, 0xA30321, 0xFF); -+ setDefaultColor(116, 0, 0xF0DDE0, 0xFF); -+ setDefaultColor(117, 0, -9934744); -+ setDefaultColor(118, 0, -9934744); -+ setDefaultColor(119, 0, 0x000000, 0xFF); -+ setDefaultColor(120, 0, 0x376319, 0xFF); -+ setDefaultColor(121, 0, 0xE4E8B5, 0xFF); -+ setDefaultColor(122, 0, 0x24031E, 0xFF); -+ setDefaultColor(123, 0, 0x784C10, 0xFF); -+ setDefaultColor(124, 0, 0xE3DE54, 0xFF); -+ setDefaultColor(125, 0, 0x9F824B); -+ setDefaultColor(126, 0, 0x9F824B); -+ setDefaultColor(127, 0, 0xAE6616); -+ setDefaultColor(128, 0, 0xCBC594); -+ setDefaultColor(129, 0, 0x46A56A); -+ setDefaultColor(130, 0, 0x283A3C); -+ setDefaultColor(131, 0, 0xAC8B54); -+ setDefaultColor(132, 0, 0xD5D5D5); -+ setDefaultColor(133, 0, 0x4CD473); -+ setDefaultColor(134, 0, 0x6E512C); -+ setDefaultColor(135, 0, 0xC4B87B); -+ setDefaultColor(136, 0, 0x986C46); -+ setDefaultColor(137, 0, 0xAD9D8F); -+ setDefaultColor(138, 0, 0x64A6A2); -+ setDefaultColor(139, 0, 0x929292); -+ setDefaultColor(140, 0, 0x3A2017); -+ setDefaultColor(141, 0, 0xC28600); -+ setDefaultColor(142, 0, 0x9C931D); -+ setDefaultColor(143, 0, 0xA4864F); -+ -+ // New 9/8/13 -+ //setDefaultColor(144, 0, 0xA4864F); // skull -+ //setDefaultColor(145, 0, 0xA4864F); // anvil -+ setDefaultColor(146, 0, -7378659); // trap chest -+ setDefaultColor(147, 0, -66723); // gold plate -+ setDefaultColor(148, 0, -1447447); // iron plate -+ //setDefaultColor(149, 0, 0xA4864F); // redstone compare -+ //setDefaultColor(150, 0, 0xA4864F); // redstone compare -+ //setDefaultColor(151, 0, 0xA4864F); // daylight sensor -+ //setDefaultColor(152, 0, 0xA4864F); // block of redstone -+ setDefaultColor(153, 0, 0x6D001C); // netherquartz ore -+ //setDefaultColor(154, 0, 0xA4864F); // hopper -+ setDefaultColor(155, 0, 0xE9F1B6); // quartz block -+ setDefaultColor(155, 1, 0xE9F1B6); // quartz column -+ setDefaultColor(155, 2, 0xE9F1B6); // quartz column 2 -+ setDefaultColor(156, 0, 0xADB388); // quartz stairs -+ -+ // New on 11/15/13 -+ //setDefaultColor(157, 0, 0xADB388); // activator rail -+ setDefaultColor(158, 0, 0x8F8F8F); // dropper -+ setDefaultColor(159, 0, 0xD1B1A1); // white stained clay -+ setDefaultColor(159, 1, 0xA75929); // orange stained clay -+ setDefaultColor(159, 2, 0x95576C); // magenta stained clay -+ setDefaultColor(159, 3, 0x726E8A); // lite blue stained clay -+ setDefaultColor(159, 4, 0xBC8726); // yellow stained clay -+ setDefaultColor(159, 5, 0x647332); // lime stained clay -+ setDefaultColor(159, 6, 0xA04E4D); // pink stained clay -+ setDefaultColor(159, 7, 0x3A2A23); // gray stained clay -+ setDefaultColor(159, 8, 0x856960); // light gray stained clay -+ setDefaultColor(159, 9, 0x55585A); // cyan stained clay -+ setDefaultColor(159, 10, 0x764656); // purple stained clay -+ setDefaultColor(159, 11, 0x333366); // blue stained clay -+ setDefaultColor(159, 12, 0x4C3121); // brown stained clay -+ setDefaultColor(159, 13, 0x4E552C); // green stained clay -+ setDefaultColor(159, 14, 0x993333); // red stained clay -+ setDefaultColor(159, 15, 0x100A07); // block stained clay -+ setDefaultColor(170, 0, 0x846C0E); // hay bale -+ setDefaultColor(171, 0, 0xFFFFFF); // white carpet -+ setDefaultColor(171, 1, 0xDA8836); // orange carpet -+ setDefaultColor(171, 2, 0xBC60C4); // magenta carpet -+ setDefaultColor(171, 3, 0x859FD3); // light blue carpet -+ setDefaultColor(171, 4, 0xBFB32B); // yellow carpet -+ setDefaultColor(171, 5, 0x50C244); // lime carpet -+ setDefaultColor(171, 6, 0xDA9EAD); // pink carpet -+ setDefaultColor(171, 7, 0x424242); // gray carpet -+ setDefaultColor(171, 8, 0x979D9D); // light gray carpet -+ setDefaultColor(171, 9, 0x2E6F8A); // cyan carpet -+ setDefaultColor(171, 10, 0x8946C2); // purple carpet -+ setDefaultColor(171, 11, 0x28327E); // blue carpet -+ setDefaultColor(171, 12, 0x4C301E); // brown carpet -+ setDefaultColor(171, 13, 0x3D5220); // green carpet -+ setDefaultColor(171, 14, 0xA53A35); // red carpet -+ setDefaultColor(171, 15, 0x1D1B1B); // black carpet -+ setDefaultColor(172, 0, 0x965E45); // hardened clay -+ setDefaultColor(173, 0, 0x0D0D0D); // block of coal -+ } -+ -+ private static BlockColor instance(int argb, TintType tint) { -+ return new BlockColor(argb & 0xFFFFFF, (argb >> 24) & 0xFF, tint); -+ } -+ -+ private static void setDefaultColor(int id, int meta, int rgb, int alpha) { -+ setDefaultColor(id, meta, alpha << 24 | rgb); -+ } -+ -+ private static void setDefaultColor(int id, int meta, int argb) { -+ TintType tint = TintType.NONE; -+ switch (id) { -+ case 2: -+ case 106: -+ tint = TintType.GRASS; -+ break; -+ case 8: -+ case 9: -+ case 79: -+ tint = TintType.WATER; -+ break; -+ case 18: -+ int m = meta & 0x3; -+ if (m == 0) tint = TintType.FOLIAGE; -+ if (m == 1) tint = TintType.PINE; -+ if (m == 2) tint = TintType.BIRCH; -+ if (m != 3) break; tint = TintType.FOLIAGE; break; -+ case 20: -+ tint = TintType.GLASS; -+ break; -+ case 31: -+ if ((meta != 1) && (meta != 2)) break; tint = TintType.TALL_GRASS; -+ } -+ -+ blockColors[blockColorID(id, meta)] = instance(argb, tint); -+ } -+ -+ public final int color; -+ public final short alpha; -+ public final TintType tintType; -+ public BlockColor(int color, int alpha, TintType tintType) { -+ this.color=color; -+ this.alpha=(short)alpha; -+ this.tintType=tintType; -+ } -+} ---- net/minecraft/src/EnchantmentModifierLiving.java -+++ net/minecraft/src/EnchantmentModifierLiving.java -@@ -1,17 +1,27 @@ - package net.minecraft.src; - - final class EnchantmentModifierLiving implements IEnchantmentModifier { -+ -+ /** -+ * Used to calculate the (magic) extra damage based on enchantments of current equipped player item. -+ */ - public float livingModifier; -+ -+ /** -+ * Used as parameter to calculate the (magic) extra damage based on enchantments of current equipped player item. -+ */ - public EntityLivingBase entityLiving; - -- private EnchantmentModifierLiving() { -- } -- -- public void calculateModifier(Enchantment var1, int var2) { -- this.livingModifier += var1.calcModifierLiving(var2, this.entityLiving); -- } -- -- EnchantmentModifierLiving(Empty3 var1) { -+ private EnchantmentModifierLiving() {} -+ -+ /** -+ * Generic method use to calculate modifiers of offensive or defensive enchantment values. -+ */ -+ public void calculateModifier(Enchantment par1Enchantment, int par2) { -+ this.livingModifier += par1Enchantment.calcModifierLiving(par2, this.entityLiving); -+ } -+ -+ EnchantmentModifierLiving(Empty3 par1Empty3) { - this(); - } - } ---- net/minecraft/src/GuiSnooper.java -+++ net/minecraft/src/GuiSnooper.java -@@ -7,97 +7,111 @@ - import java.util.Map.Entry; - - public class GuiSnooper extends GuiScreen { -+ -+ /** Instance of GuiScreen. */ - private final GuiScreen snooperGuiScreen; -+ -+ /** Instance of GameSettings. */ - private final GameSettings snooperGameSettings; -- private final List c = new ArrayList(); -- private final List d = new ArrayList(); -- private String e; -- private String[] p; -+ private final List field_74098_c = new ArrayList(); -+ private final List field_74096_d = new ArrayList(); -+ -+ /** The Snooper title. */ -+ private String snooperTitle; -+ private String[] field_74101_n; - private GuiSnooperList snooperList; - private GuiButton buttonAllowSnooping; - -- public GuiSnooper(GuiScreen var1, GameSettings var2) { -- this.snooperGuiScreen = var1; -- this.snooperGameSettings = var2; -+ public GuiSnooper(GuiScreen par1GuiScreen, GameSettings par2GameSettings) { -+ this.snooperGuiScreen = par1GuiScreen; -+ this.snooperGameSettings = par2GameSettings; - } - -+ /** -+ * Adds the buttons (and other controls) to the screen in question. -+ */ - public void initGui() { -- this.e = I18n.getString("options.snooper.title"); -+ this.snooperTitle = I18n.getString("options.snooper.title"); - String var1 = I18n.getString("options.snooper.desc"); - ArrayList var2 = new ArrayList(); - Iterator var3 = this.fontRenderer.listFormattedStringToWidth(var1, this.width - 30).iterator(); - -- while(var3.hasNext()) { -+ while (var3.hasNext()) { - String var4 = (String)var3.next(); - var2.add(var4); - } - -- this.p = (String[])var2.toArray(new String[0]); -- this.c.clear(); -- this.d.clear(); -- this.i.add(this.buttonAllowSnooping = new GuiButton(1, this.width / 2 - 152, this.height - 30, 150, 20, this.snooperGameSettings.getKeyBinding(EnumOptions.SNOOPER_ENABLED))); -- this.i.add(new GuiButton(2, this.width / 2 + 2, this.height - 30, 150, 20, I18n.getString("gui.done"))); -+ this.field_74101_n = (String[])var2.toArray(new String[0]); -+ this.field_74098_c.clear(); -+ this.field_74096_d.clear(); -+ this.buttonList.add(this.buttonAllowSnooping = new GuiButton(1, this.width / 2 - 152, this.height - 30, 150, 20, this.snooperGameSettings.getKeyBinding(EnumOptions.SNOOPER_ENABLED))); -+ this.buttonList.add(new GuiButton(2, this.width / 2 + 2, this.height - 30, 150, 20, I18n.getString("gui.done"))); - boolean var6 = this.mc.getIntegratedServer() != null && this.mc.getIntegratedServer().getPlayerUsageSnooper() != null; - Iterator var7 = (new TreeMap(this.mc.getPlayerUsageSnooper().getCurrentStats())).entrySet().iterator(); -- - Entry var5; -- while(var7.hasNext()) { -+ -+ while (var7.hasNext()) { - var5 = (Entry)var7.next(); -- this.c.add((var6 ? "C " : "") + (String)var5.getKey()); -- this.d.add(this.fontRenderer.trimStringToWidth((String)var5.getValue(), this.width - 220)); -+ this.field_74098_c.add((var6 ? "C " : "") + (String)var5.getKey()); -+ this.field_74096_d.add(this.fontRenderer.trimStringToWidth((String)var5.getValue(), this.width - 220)); - } - -- if(var6) { -+ if (var6) { - var7 = (new TreeMap(this.mc.getIntegratedServer().getPlayerUsageSnooper().getCurrentStats())).entrySet().iterator(); - -- while(var7.hasNext()) { -+ while (var7.hasNext()) { - var5 = (Entry)var7.next(); -- this.c.add("S " + (String)var5.getKey()); -- this.d.add(this.fontRenderer.trimStringToWidth((String)var5.getValue(), this.width - 220)); -+ this.field_74098_c.add("S " + (String)var5.getKey()); -+ this.field_74096_d.add(this.fontRenderer.trimStringToWidth((String)var5.getValue(), this.width - 220)); - } - } - - this.snooperList = new GuiSnooperList(this); - } - -- protected void actionPerformed(GuiButton var1) { -- if(var1.enabled) { -- if(var1.id == 2) { -+ /** -+ * Fired when a control is clicked. This is the equivalent of ActionListener.actionPerformed(ActionEvent e). -+ */ -+ protected void actionPerformed(GuiButton par1GuiButton) { -+ if (par1GuiButton.enabled) { -+ if (par1GuiButton.id == 2) { - this.snooperGameSettings.saveOptions(); - this.snooperGameSettings.saveOptions(); - this.mc.displayGuiScreen(this.snooperGuiScreen); - } - -- if(var1.id == 1) { -+ if (par1GuiButton.id == 1) { - this.snooperGameSettings.setOptionValue(EnumOptions.SNOOPER_ENABLED, 1); -- this.buttonAllowSnooping.f = this.snooperGameSettings.getKeyBinding(EnumOptions.SNOOPER_ENABLED); -+ this.buttonAllowSnooping.displayString = this.snooperGameSettings.getKeyBinding(EnumOptions.SNOOPER_ENABLED); - } -- - } - } - -- public void drawScreen(int var1, int var2, float var3) { -+ /** -+ * Draws the screen and all the components in it. -+ */ -+ public void drawScreen(int par1, int par2, float par3) { - this.drawDefaultBackground(); -- this.snooperList.drawScreen(var1, var2, var3); -- this.drawCenteredString(this.fontRenderer, this.e, this.width / 2, 8, 16777215); -+ this.snooperList.drawScreen(par1, par2, par3); -+ this.drawCenteredString(this.fontRenderer, this.snooperTitle, this.width / 2, 8, 16777215); - int var4 = 22; -- String[] var5 = this.p; -+ String[] var5 = this.field_74101_n; - int var6 = var5.length; - -- for(int var7 = 0; var7 < var6; ++var7) { -+ for (int var7 = 0; var7 < var6; ++var7) { - String var8 = var5[var7]; - this.drawCenteredString(this.fontRenderer, var8, this.width / 2, var4, 8421504); - var4 += this.fontRenderer.FONT_HEIGHT; - } - -- super.drawScreen(var1, var2, var3); -- } -- -- static List func_74095_a(GuiSnooper var0) { -- return var0.c; -- } -- -- static List func_74094_b(GuiSnooper var0) { -- return var0.d; -+ super.drawScreen(par1, par2, par3); -+ } -+ -+ static List func_74095_a(GuiSnooper par0GuiSnooper) { -+ return par0GuiSnooper.field_74098_c; -+ } -+ -+ static List func_74094_b(GuiSnooper par0GuiSnooper) { -+ return par0GuiSnooper.field_74096_d; - } - } ---- net/minecraft/src/WeightedRandomChestContent.java -+++ net/minecraft/src/WeightedRandomChestContent.java -@@ -3,74 +3,86 @@ - import java.util.Random; - - public class WeightedRandomChestContent extends WeightedRandomItem { -+ -+ /** The Item/Block ID to generate in the Chest. */ - private ItemStack theItemId; -+ -+ /** The minimum chance of item generating. */ - private int theMinimumChanceToGenerateItem; -+ -+ /** The maximum chance of item generating. */ - private int theMaximumChanceToGenerateItem; - -- public WeightedRandomChestContent(int var1, int var2, int var3, int var4, int var5) { -- super(var5); -- this.theItemId = new ItemStack(var1, 1, var2); -- this.theMinimumChanceToGenerateItem = var3; -- this.theMaximumChanceToGenerateItem = var4; -- } -- -- public WeightedRandomChestContent(ItemStack var1, int var2, int var3, int var4) { -- super(var4); -- this.theItemId = var1; -- this.theMinimumChanceToGenerateItem = var2; -- this.theMaximumChanceToGenerateItem = var3; -- } -- -- public static void generateChestContents(Random var0, WeightedRandomChestContent[] var1, IInventory var2, int var3) { -- for(int var4 = 0; var4 < var3; ++var4) { -- WeightedRandomChestContent var5 = (WeightedRandomChestContent)WeightedRandom.getRandomItem(var0, (WeightedRandomItem[])var1); -- int var6 = var5.theMinimumChanceToGenerateItem + var0.nextInt(var5.theMaximumChanceToGenerateItem - var5.theMinimumChanceToGenerateItem + 1); -- if(var5.theItemId.getMaxStackSize() >= var6) { -- ItemStack var9 = var5.theItemId.copy(); -- var9.stackSize = var6; -- var2.setInventorySlotContents(var0.nextInt(var2.getSizeInventory()), var9); -- } else { -- for(int var7 = 0; var7 < var6; ++var7) { -- ItemStack var8 = var5.theItemId.copy(); -- var8.stackSize = 1; -- var2.setInventorySlotContents(var0.nextInt(var2.getSizeInventory()), var8); -- } -- } -- } -- -- } -- -- public static void generateDispenserContents(Random var0, WeightedRandomChestContent[] var1, TileEntityDispenser var2, int var3) { -- for(int var4 = 0; var4 < var3; ++var4) { -- WeightedRandomChestContent var5 = (WeightedRandomChestContent)WeightedRandom.getRandomItem(var0, (WeightedRandomItem[])var1); -- int var6 = var5.theMinimumChanceToGenerateItem + var0.nextInt(var5.theMaximumChanceToGenerateItem - var5.theMinimumChanceToGenerateItem + 1); -- if(var5.theItemId.getMaxStackSize() >= var6) { -- ItemStack var9 = var5.theItemId.copy(); -- var9.stackSize = var6; -- var2.setInventorySlotContents(var0.nextInt(var2.getSizeInventory()), var9); -- } else { -- for(int var7 = 0; var7 < var6; ++var7) { -- ItemStack var8 = var5.theItemId.copy(); -- var8.stackSize = 1; -- var2.setInventorySlotContents(var0.nextInt(var2.getSizeInventory()), var8); -- } -- } -- } -- -- } -- -- public static WeightedRandomChestContent[] func_92080_a(WeightedRandomChestContent[] var0, WeightedRandomChestContent... var1) { -- WeightedRandomChestContent[] var2 = new WeightedRandomChestContent[var0.length + var1.length]; -+ public WeightedRandomChestContent(int par1, int par2, int par3, int par4, int par5) { -+ super(par5); -+ this.theItemId = new ItemStack(par1, 1, par2); -+ this.theMinimumChanceToGenerateItem = par3; -+ this.theMaximumChanceToGenerateItem = par4; -+ } -+ -+ public WeightedRandomChestContent(ItemStack par1ItemStack, int par2, int par3, int par4) { -+ super(par4); -+ this.theItemId = par1ItemStack; -+ this.theMinimumChanceToGenerateItem = par2; -+ this.theMaximumChanceToGenerateItem = par3; -+ } -+ -+ /** -+ * Generates the Chest contents. -+ */ -+ public static void generateChestContents(Random par0Random, WeightedRandomChestContent[] par1ArrayOfWeightedRandomChestContent, IInventory par2IInventory, int par3) { -+ for (int var4 = 0; var4 < par3; ++var4) { -+ WeightedRandomChestContent var5 = (WeightedRandomChestContent)WeightedRandom.getRandomItem(par0Random, par1ArrayOfWeightedRandomChestContent); -+ int var6 = var5.theMinimumChanceToGenerateItem + par0Random.nextInt(var5.theMaximumChanceToGenerateItem - var5.theMinimumChanceToGenerateItem + 1); -+ -+ if (var5.theItemId.getMaxStackSize() >= var6) { -+ ItemStack var7 = var5.theItemId.copy(); -+ var7.stackSize = var6; -+ par2IInventory.setInventorySlotContents(par0Random.nextInt(par2IInventory.getSizeInventory()), var7); -+ } else { -+ for (int var9 = 0; var9 < var6; ++var9) { -+ ItemStack var8 = var5.theItemId.copy(); -+ var8.stackSize = 1; -+ par2IInventory.setInventorySlotContents(par0Random.nextInt(par2IInventory.getSizeInventory()), var8); -+ } -+ } -+ } -+ } -+ -+ /** -+ * Generates the Dispenser contents. -+ */ -+ public static void generateDispenserContents(Random par0Random, WeightedRandomChestContent[] par1ArrayOfWeightedRandomChestContent, TileEntityDispenser par2TileEntityDispenser, int par3) { -+ for (int var4 = 0; var4 < par3; ++var4) { -+ WeightedRandomChestContent var5 = (WeightedRandomChestContent)WeightedRandom.getRandomItem(par0Random, par1ArrayOfWeightedRandomChestContent); -+ int var6 = var5.theMinimumChanceToGenerateItem + par0Random.nextInt(var5.theMaximumChanceToGenerateItem - var5.theMinimumChanceToGenerateItem + 1); -+ -+ if (var5.theItemId.getMaxStackSize() >= var6) { -+ ItemStack var7 = var5.theItemId.copy(); -+ var7.stackSize = var6; -+ par2TileEntityDispenser.setInventorySlotContents(par0Random.nextInt(par2TileEntityDispenser.getSizeInventory()), var7); -+ } else { -+ for (int var9 = 0; var9 < var6; ++var9) { -+ ItemStack var8 = var5.theItemId.copy(); -+ var8.stackSize = 1; -+ par2TileEntityDispenser.setInventorySlotContents(par0Random.nextInt(par2TileEntityDispenser.getSizeInventory()), var8); -+ } -+ } -+ } -+ } -+ -+ public static WeightedRandomChestContent[] func_92080_a(WeightedRandomChestContent[] par0ArrayOfWeightedRandomChestContent, WeightedRandomChestContent ... par1ArrayOfWeightedRandomChestContent) { -+ WeightedRandomChestContent[] var2 = new WeightedRandomChestContent[par0ArrayOfWeightedRandomChestContent.length + par1ArrayOfWeightedRandomChestContent.length]; - int var3 = 0; - -- for(int var4 = 0; var4 < var0.length; ++var4) { -- var2[var3++] = var0[var4]; -+ for (int var4 = 0; var4 < par0ArrayOfWeightedRandomChestContent.length; ++var4) { -+ var2[var3++] = par0ArrayOfWeightedRandomChestContent[var4]; - } - -- WeightedRandomChestContent[] var8 = var1; -- int var5 = var1.length; -+ WeightedRandomChestContent[] var8 = par1ArrayOfWeightedRandomChestContent; -+ int var5 = par1ArrayOfWeightedRandomChestContent.length; - -- for(int var6 = 0; var6 < var5; ++var6) { -+ for (int var6 = 0; var6 < var5; ++var6) { - WeightedRandomChestContent var7 = var8[var6]; - var2[var3++] = var7; - } ---- net/minecraft/src/BlockBookshelf.java -+++ net/minecraft/src/BlockBookshelf.java -@@ -3,20 +3,29 @@ - import java.util.Random; - - public class BlockBookshelf extends Block { -- public BlockBookshelf(int var1) { -- super(var1, Material.wood); -+ public BlockBookshelf(int par1) { -+ super(par1, Material.wood); - this.setCreativeTab(CreativeTabs.tabBlock); - } - -- public Icon getIcon(int var1, int var2) { -- return var1 != 1 && var1 != 0 ? super.getIcon(var1, var2) : Block.planks.getBlockTextureFromSide(var1); -+ /** -+ * From the specified side and block metadata retrieves the blocks texture. Args: side, metadata -+ */ -+ public Icon getIcon(int par1, int par2) { -+ return par1 != 1 && par1 != 0 ? super.getIcon(par1, par2) : Block.planks.getBlockTextureFromSide(par1); - } - -- public int quantityDropped(Random var1) { -+ /** -+ * Returns the quantity of items to drop on block destruction. -+ */ -+ public int quantityDropped(Random par1Random) { - return 3; - } - -- public int idDropped(int var1, Random var2, int var3) { -+ /** -+ * Returns the ID of the items to drop on destruction. -+ */ -+ public int idDropped(int par1, Random par2Random, int par3) { - return Item.book.itemID; - } - } ---- /dev/null -+++ org/spoutcraft/client/packet/PacketParticle.java -@@ -1,0 +1,104 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.client.packet; -+ -+import java.io.IOException; -+import java.util.Random; -+ -+import net.minecraft.src.Minecraft; -+import net.minecraft.src.EntityFX; -+ -+import org.spoutcraft.api.io.SpoutInputStream; -+import org.spoutcraft.api.io.SpoutOutputStream; -+import org.spoutcraft.api.util.Location; -+import org.spoutcraft.api.util.Vector; -+ -+public class PacketParticle implements SpoutPacket { -+ String name; -+ Location location; -+ Vector motion; -+ float scale, gravity, particleRed, particleBlue, particleGreen; -+ int maxAge, amount; -+ -+ @Override -+ public void readData(SpoutInputStream input) throws IOException { -+ name = input.readString(); -+ location = input.readLocation(); -+ motion = input.readVector(); -+ scale = input.readFloat(); -+ gravity = input.readFloat(); -+ particleRed = input.readFloat(); -+ particleBlue = input.readFloat(); -+ particleGreen = input.readFloat(); -+ maxAge = input.readInt(); -+ amount = Math.min(1000, input.readInt()); -+ } -+ -+ @Override -+ public void writeData(SpoutOutputStream output) throws IOException { -+ } -+ -+ @Override -+ public void run(int playerId) { -+ Random r = new Random(); -+ for (int i = 0; i < amount; i++) { -+ double x = location.getX(); -+ double y = location.getY(); -+ double z = location.getZ(); -+ if (amount > 1) { -+ x += (r.nextBoolean() ? 2 : -2) * r.nextFloat(); -+ y += (r.nextBoolean() ? 2 : -2) * r.nextFloat(); -+ z += (r.nextBoolean() ? 2 : -2) * r.nextFloat(); -+ } -+ -+ EntityFX particle = Minecraft.getMinecraft().renderGlobal.doSpawnParticle(name, x, y, z, motion.getX(), motion.getY(), motion.getZ()); -+ if (particle != null) { -+ if (scale > 0) { -+ particle.particleScale = scale; -+ } -+ particle.particleGravity = gravity; -+ if (particleRed >= 0F && particleRed <= 1F) { -+ particle.particleRed = particleRed; -+ } -+ if (particleBlue >= 0F && particleBlue <= 1F) { -+ particle.particleBlue = particleBlue; -+ } -+ if (particleGreen >= 0F && particleGreen <= 1F) { -+ particle.particleGreen = particleGreen; -+ } -+ particle.particleMaxAge = maxAge; -+ } -+ } -+ } -+ -+ @Override -+ public void failure(int playerId) { -+ } -+ -+ @Override -+ public PacketType getPacketType() { -+ return PacketType.PacketParticle; -+ } -+ -+ @Override -+ public int getVersion() { -+ return 0; -+ } -+} ---- net/minecraft/src/GuiSlot.java -+++ net/minecraft/src/GuiSlot.java -@@ -5,65 +5,114 @@ - - public abstract class GuiSlot { - private final Minecraft mc; -+ -+ /** -+ * The width of the GuiScreen. Affects the container rendering, but not the overlays. -+ */ - private int width; -+ -+ /** -+ * The height of the GuiScreen. Affects the container rendering, but not the overlays or the scrolling. -+ */ - private int height; -+ -+ /** The top of the slot container. Affects the overlays and scrolling. */ - protected int top; -+ -+ /** The bottom of the slot container. Affects the overlays and scrolling. */ - protected int bottom; - private int right; - private int left; -+ -+ /** The height of a slot. */ - protected final int slotHeight; -+ -+ /** button id of the button used to scroll up */ - private int scrollUpButtonID; -+ -+ /** the buttonID of the button used to scroll down */ - private int scrollDownButtonID; -+ -+ /** X axis position of the mouse */ - protected int mouseX; -+ -+ /** Y axis position of the mouse */ - protected int mouseY; -+ -+ /** where the mouse was in the window when you first clicked to scroll */ - private float initialClickY = -2.0F; -+ -+ /** -+ * what to multiply the amount you moved your mouse by(used for slowing down scrolling when over the items and no on -+ * scroll bar) -+ */ - private float scrollMultiplier; -+ -+ /** how far down this slot has been scrolled */ - private float amountScrolled; -+ -+ /** the element in the list that was selected */ - private int selectedElement = -1; -+ -+ /** the time when this button was last clicked. */ - private long lastClicked; -+ -+ /** true if a selected element in this gui will show an outline box */ - private boolean showSelectionBox = true; - private boolean field_77243_s; - private int field_77242_t; - -- public GuiSlot(Minecraft var1, int var2, int var3, int var4, int var5, int var6) { -- this.mc = var1; -- this.width = var2; -- this.height = var3; -- this.top = var4; -- this.bottom = var5; -- this.slotHeight = var6; -- this.left = 0; -- this.right = var2; -- } -- -- public void func_77207_a(int var1, int var2, int var3, int var4) { -- this.width = var1; -- this.height = var2; -- this.top = var3; -- this.bottom = var4; -- this.left = 0; -- this.right = var1; -- } -- -- public void setShowSelectionBox(boolean var1) { -- this.showSelectionBox = var1; -- } -- -- protected void func_77223_a(boolean var1, int var2) { -- this.field_77243_s = var1; -- this.field_77242_t = var2; -- if(!var1) { -+ public GuiSlot(Minecraft par1Minecraft, int par2, int par3, int par4, int par5, int par6) { -+ this.mc = par1Minecraft; -+ this.width = par2; -+ this.height = par3; -+ this.top = par4; -+ this.bottom = par5; -+ this.slotHeight = par6; -+ this.left = 0; -+ this.right = par2; -+ } -+ -+ public void func_77207_a(int par1, int par2, int par3, int par4) { -+ this.width = par1; -+ this.height = par2; -+ this.top = par3; -+ this.bottom = par4; -+ this.left = 0; -+ this.right = par1; -+ } -+ -+ public void setShowSelectionBox(boolean par1) { -+ this.showSelectionBox = par1; -+ } -+ -+ protected void func_77223_a(boolean par1, int par2) { -+ this.field_77243_s = par1; -+ this.field_77242_t = par2; -+ -+ if (!par1) { - this.field_77242_t = 0; - } -- - } - -+ /** -+ * Gets the size of the current slot list. -+ */ - protected abstract int getSize(); - -+ /** -+ * the element in the slot that was clicked, boolean for wether it was double clicked or not -+ */ - protected abstract void elementClicked(int var1, boolean var2); - -+ /** -+ * returns true if the element passed in is currently selected -+ */ - protected abstract boolean isSelected(int var1); - -+ /** -+ * return the height of the content being scrolled -+ */ - protected int getContentHeight() { - return this.getSize() * this.slotHeight + this.field_77242_t; - } -@@ -72,72 +121,77 @@ - - protected abstract void drawSlot(int var1, int var2, int var3, int var4, Tessellator var5); - -- protected void func_77222_a(int var1, int var2, Tessellator var3) { -- } -- -- protected void func_77224_a(int var1, int var2) { -- } -- -- protected void func_77215_b(int var1, int var2) { -- } -- -- public int func_77210_c(int var1, int var2) { -+ protected void func_77222_a(int par1, int par2, Tessellator par3Tessellator) {} -+ -+ protected void func_77224_a(int par1, int par2) {} -+ -+ protected void func_77215_b(int par1, int par2) {} -+ -+ public int func_77210_c(int par1, int par2) { - int var3 = this.width / 2 - 110; - int var4 = this.width / 2 + 110; -- int var5 = var2 - this.top - this.field_77242_t + (int)this.amountScrolled - 4; -+ int var5 = par2 - this.top - this.field_77242_t + (int)this.amountScrolled - 4; - int var6 = var5 / this.slotHeight; -- return var1 >= var3 && var1 <= var4 && var6 >= 0 && var5 >= 0 && var6 < this.getSize() ? var6 : -1; -- } -- -- public void registerScrollButtons(int var1, int var2) { -- this.scrollUpButtonID = var1; -- this.scrollDownButtonID = var2; -- } -- -+ return par1 >= var3 && par1 <= var4 && var6 >= 0 && var5 >= 0 && var6 < this.getSize() ? var6 : -1; -+ } -+ -+ /** -+ * Registers the IDs that can be used for the scrollbar's buttons. -+ */ -+ public void registerScrollButtons(int par1, int par2) { -+ this.scrollUpButtonID = par1; -+ this.scrollDownButtonID = par2; -+ } -+ -+ /** -+ * stop the thing from scrolling out of bounds -+ */ - private void bindAmountScrolled() { - int var1 = this.func_77209_d(); -- if(var1 < 0) { -+ -+ if (var1 < 0) { - var1 /= 2; - } - -- if(this.amountScrolled < 0.0F) { -+ if (this.amountScrolled < 0.0F) { - this.amountScrolled = 0.0F; - } - -- if(this.amountScrolled > (float)var1) { -+ if (this.amountScrolled > (float)var1) { - this.amountScrolled = (float)var1; - } -- - } - - public int func_77209_d() { - return this.getContentHeight() - (this.bottom - this.top - 4); - } - -- public void func_77208_b(int var1) { -- this.amountScrolled += (float)var1; -+ public void func_77208_b(int par1) { -+ this.amountScrolled += (float)par1; - this.bindAmountScrolled(); - this.initialClickY = -2.0F; - } - -- public void actionPerformed(GuiButton var1) { -- if(var1.enabled) { -- if(var1.id == this.scrollUpButtonID) { -+ public void actionPerformed(GuiButton par1GuiButton) { -+ if (par1GuiButton.enabled) { -+ if (par1GuiButton.id == this.scrollUpButtonID) { - this.amountScrolled -= (float)(this.slotHeight * 2 / 3); - this.initialClickY = -2.0F; - this.bindAmountScrolled(); -- } else if(var1.id == this.scrollDownButtonID) { -+ } else if (par1GuiButton.id == this.scrollDownButtonID) { - this.amountScrolled += (float)(this.slotHeight * 2 / 3); - this.initialClickY = -2.0F; - this.bindAmountScrolled(); - } -- - } - } - -- public void drawScreen(int var1, int var2, float var3) { -- this.mouseX = var1; -- this.mouseY = var2; -+ /** -+ * draws the slot to the screen, pass in mouse's current x and y and partial ticks -+ */ -+ public void drawScreen(int par1, int par2, float par3) { -+ this.mouseX = par1; -+ this.mouseY = par2; - this.drawBackground(); - int var4 = this.getSize(); - int var5 = this.getScrollBarX(); -@@ -146,76 +200,79 @@ - int var10; - int var11; - int var13; -- int var20; -- if(Mouse.isButtonDown(0)) { -- if(this.initialClickY == -1.0F) { -- boolean var16 = true; -- if(var2 >= this.top && var2 <= this.bottom) { -+ int var19; -+ -+ if (Mouse.isButtonDown(0)) { -+ if (this.initialClickY == -1.0F) { -+ boolean var7 = true; -+ -+ if (par2 >= this.top && par2 <= this.bottom) { - int var8 = this.width / 2 - 110; - var9 = this.width / 2 + 110; -- var10 = var2 - this.top - this.field_77242_t + (int)this.amountScrolled - 4; -+ var10 = par2 - this.top - this.field_77242_t + (int)this.amountScrolled - 4; - var11 = var10 / this.slotHeight; -- if(var1 >= var8 && var1 <= var9 && var11 >= 0 && var10 >= 0 && var11 < var4) { -+ -+ if (par1 >= var8 && par1 <= var9 && var11 >= 0 && var10 >= 0 && var11 < var4) { - boolean var12 = var11 == this.selectedElement && Minecraft.getSystemTime() - this.lastClicked < 250L; - this.elementClicked(var11, var12); - this.selectedElement = var11; - this.lastClicked = Minecraft.getSystemTime(); -- } else if(var1 >= var8 && var1 <= var9 && var10 < 0) { -- this.func_77224_a(var1 - var8, var2 - this.top + (int)this.amountScrolled - 4); -- var16 = false; -+ } else if (par1 >= var8 && par1 <= var9 && var10 < 0) { -+ this.func_77224_a(par1 - var8, par2 - this.top + (int)this.amountScrolled - 4); -+ var7 = false; - } - -- if(var1 >= var5 && var1 <= var6) { -+ if (par1 >= var5 && par1 <= var6) { - this.scrollMultiplier = -1.0F; -- var20 = this.func_77209_d(); -- if(var20 < 1) { -- var20 = 1; -+ var19 = this.func_77209_d(); -+ -+ if (var19 < 1) { -+ var19 = 1; - } - - var13 = (int)((float)((this.bottom - this.top) * (this.bottom - this.top)) / (float)this.getContentHeight()); -- if(var13 < 32) { -+ -+ if (var13 < 32) { - var13 = 32; - } - -- if(var13 > this.bottom - this.top - 8) { -+ if (var13 > this.bottom - this.top - 8) { - var13 = this.bottom - this.top - 8; - } - -- this.scrollMultiplier /= (float)(this.bottom - this.top - var13) / (float)var20; -+ this.scrollMultiplier /= (float)(this.bottom - this.top - var13) / (float)var19; - } else { - this.scrollMultiplier = 1.0F; - } - -- if(var16) { -- this.initialClickY = (float)var2; -+ if (var7) { -+ this.initialClickY = (float)par2; - } else { - this.initialClickY = -2.0F; - } - } else { - this.initialClickY = -2.0F; - } -- } else if(this.initialClickY >= 0.0F) { -- this.amountScrolled -= ((float)var2 - this.initialClickY) * this.scrollMultiplier; -- this.initialClickY = (float)var2; -+ } else if (this.initialClickY >= 0.0F) { -+ this.amountScrolled -= ((float)par2 - this.initialClickY) * this.scrollMultiplier; -+ this.initialClickY = (float)par2; - } - } else { -- while(true) { -- if(this.mc.gameSettings.touchscreen || !Mouse.next()) { -- this.initialClickY = -1.0F; -- break; -- } -+ while (!this.mc.gameSettings.touchscreen && Mouse.next()) { -+ int var16 = Mouse.getEventDWheel(); - -- int var7 = Mouse.getEventDWheel(); -- if(var7 != 0) { -- if(var7 > 0) { -- var7 = -1; -- } else if(var7 < 0) { -- var7 = 1; -+ if (var16 != 0) { -+ if (var16 > 0) { -+ var16 = -1; -+ } else if (var16 < 0) { -+ var16 = 1; - } - -- this.amountScrolled += (float)(var7 * this.slotHeight / 2); -+ this.amountScrolled += (float)(var16 * this.slotHeight / 2); - } - } -+ -+ this.initialClickY = -1.0F; - } - - this.bindAmountScrolled(); -@@ -234,41 +291,44 @@ - var18.draw(); - var9 = this.width / 2 - 92 - 16; - var10 = this.top + 4 - (int)this.amountScrolled; -- if(this.field_77243_s) { -+ -+ if (this.field_77243_s) { - this.func_77222_a(var9, var10, var18); - } - - int var14; -- for(var11 = 0; var11 < var4; ++var11) { -- var20 = var10 + var11 * this.slotHeight + this.field_77242_t; -+ -+ for (var11 = 0; var11 < var4; ++var11) { -+ var19 = var10 + var11 * this.slotHeight + this.field_77242_t; - var13 = this.slotHeight - 4; -- if(var20 <= this.bottom && var20 + var13 >= this.top) { -- if(this.showSelectionBox && this.isSelected(var11)) { -+ -+ if (var19 <= this.bottom && var19 + var13 >= this.top) { -+ if (this.showSelectionBox && this.isSelected(var11)) { - var14 = this.width / 2 - 110; - int var15 = this.width / 2 + 110; - GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - GL11.glDisable(GL11.GL_TEXTURE_2D); - var18.startDrawingQuads(); - var18.setColorOpaque_I(8421504); -- var18.addVertexWithUV((double)var14, (double)(var20 + var13 + 2), 0.0D, 0.0D, 1.0D); -- var18.addVertexWithUV((double)var15, (double)(var20 + var13 + 2), 0.0D, 1.0D, 1.0D); -- var18.addVertexWithUV((double)var15, (double)(var20 - 2), 0.0D, 1.0D, 0.0D); -- var18.addVertexWithUV((double)var14, (double)(var20 - 2), 0.0D, 0.0D, 0.0D); -+ var18.addVertexWithUV((double)var14, (double)(var19 + var13 + 2), 0.0D, 0.0D, 1.0D); -+ var18.addVertexWithUV((double)var15, (double)(var19 + var13 + 2), 0.0D, 1.0D, 1.0D); -+ var18.addVertexWithUV((double)var15, (double)(var19 - 2), 0.0D, 1.0D, 0.0D); -+ var18.addVertexWithUV((double)var14, (double)(var19 - 2), 0.0D, 0.0D, 0.0D); - var18.setColorOpaque_I(0); -- var18.addVertexWithUV((double)(var14 + 1), (double)(var20 + var13 + 1), 0.0D, 0.0D, 1.0D); -- var18.addVertexWithUV((double)(var15 - 1), (double)(var20 + var13 + 1), 0.0D, 1.0D, 1.0D); -- var18.addVertexWithUV((double)(var15 - 1), (double)(var20 - 1), 0.0D, 1.0D, 0.0D); -- var18.addVertexWithUV((double)(var14 + 1), (double)(var20 - 1), 0.0D, 0.0D, 0.0D); -+ var18.addVertexWithUV((double)(var14 + 1), (double)(var19 + var13 + 1), 0.0D, 0.0D, 1.0D); -+ var18.addVertexWithUV((double)(var15 - 1), (double)(var19 + var13 + 1), 0.0D, 1.0D, 1.0D); -+ var18.addVertexWithUV((double)(var15 - 1), (double)(var19 - 1), 0.0D, 1.0D, 0.0D); -+ var18.addVertexWithUV((double)(var14 + 1), (double)(var19 - 1), 0.0D, 0.0D, 0.0D); - var18.draw(); - GL11.glEnable(GL11.GL_TEXTURE_2D); - } - -- this.drawSlot(var11, var9, var20, var13, var18); -+ this.drawSlot(var11, var9, var19, var13, var18); - } - } - - GL11.glDisable(GL11.GL_DEPTH_TEST); -- byte var19 = 4; -+ byte var20 = 4; - this.overlayBackground(0, this.top, 255, 255); - this.overlayBackground(this.bottom, this.height, 255, 255); - GL11.glEnable(GL11.GL_BLEND); -@@ -278,8 +338,8 @@ - GL11.glDisable(GL11.GL_TEXTURE_2D); - var18.startDrawingQuads(); - var18.setColorRGBA_I(0, 0); -- var18.addVertexWithUV((double)this.left, (double)(this.top + var19), 0.0D, 0.0D, 1.0D); -- var18.addVertexWithUV((double)this.right, (double)(this.top + var19), 0.0D, 1.0D, 1.0D); -+ var18.addVertexWithUV((double)this.left, (double)(this.top + var20), 0.0D, 0.0D, 1.0D); -+ var18.addVertexWithUV((double)this.right, (double)(this.top + var20), 0.0D, 1.0D, 1.0D); - var18.setColorRGBA_I(0, 255); - var18.addVertexWithUV((double)this.right, (double)this.top, 0.0D, 1.0D, 0.0D); - var18.addVertexWithUV((double)this.left, (double)this.top, 0.0D, 0.0D, 0.0D); -@@ -289,22 +349,25 @@ - var18.addVertexWithUV((double)this.left, (double)this.bottom, 0.0D, 0.0D, 1.0D); - var18.addVertexWithUV((double)this.right, (double)this.bottom, 0.0D, 1.0D, 1.0D); - var18.setColorRGBA_I(0, 0); -- var18.addVertexWithUV((double)this.right, (double)(this.bottom - var19), 0.0D, 1.0D, 0.0D); -- var18.addVertexWithUV((double)this.left, (double)(this.bottom - var19), 0.0D, 0.0D, 0.0D); -+ var18.addVertexWithUV((double)this.right, (double)(this.bottom - var20), 0.0D, 1.0D, 0.0D); -+ var18.addVertexWithUV((double)this.left, (double)(this.bottom - var20), 0.0D, 0.0D, 0.0D); - var18.draw(); -- var20 = this.func_77209_d(); -- if(var20 > 0) { -+ var19 = this.func_77209_d(); -+ -+ if (var19 > 0) { - var13 = (this.bottom - this.top) * (this.bottom - this.top) / this.getContentHeight(); -- if(var13 < 32) { -+ -+ if (var13 < 32) { - var13 = 32; - } - -- if(var13 > this.bottom - this.top - 8) { -+ if (var13 > this.bottom - this.top - 8) { - var13 = this.bottom - this.top - 8; - } - -- var14 = (int)this.amountScrolled * (this.bottom - this.top - var13) / var20 + this.top; -- if(var14 < this.top) { -+ var14 = (int)this.amountScrolled * (this.bottom - this.top - var13) / var19 + this.top; -+ -+ if (var14 < this.top) { - var14 = this.top; - } - -@@ -331,7 +394,7 @@ - var18.draw(); - } - -- this.func_77215_b(var1, var2); -+ this.func_77215_b(par1, par2); - GL11.glEnable(GL11.GL_TEXTURE_2D); - GL11.glShadeModel(GL11.GL_FLAT); - GL11.glEnable(GL11.GL_ALPHA_TEST); -@@ -342,18 +405,30 @@ - return this.width / 2 + 124; - } - -- private void overlayBackground(int var1, int var2, int var3, int var4) { -+ /** -+ * Overlays the background to hide scrolled items -+ */ -+ private void overlayBackground(int par1, int par2, int par3, int par4) { -+ // Spout Start -+ GL11.glPushMatrix(); -+ // Spout End - Tessellator var5 = Tessellator.instance; - this.mc.getTextureManager().bindTexture(Gui.optionsBackground); - GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); -+ // Spout Start -+ GL11.glTranslatef(0, 0, -0.1f); -+ // Spout End - float var6 = 32.0F; - var5.startDrawingQuads(); -- var5.setColorRGBA_I(4210752, var4); -- var5.addVertexWithUV(0.0D, (double)var2, 0.0D, 0.0D, (double)((float)var2 / var6)); -- var5.addVertexWithUV((double)this.width, (double)var2, 0.0D, (double)((float)this.width / var6), (double)((float)var2 / var6)); -- var5.setColorRGBA_I(4210752, var3); -- var5.addVertexWithUV((double)this.width, (double)var1, 0.0D, (double)((float)this.width / var6), (double)((float)var1 / var6)); -- var5.addVertexWithUV(0.0D, (double)var1, 0.0D, 0.0D, (double)((float)var1 / var6)); -+ var5.setColorRGBA_I(4210752, par4); -+ var5.addVertexWithUV(0.0D, (double)par2, 0.0D, 0.0D, (double)((float)par2 / var6)); -+ var5.addVertexWithUV((double)this.width, (double)par2, 0.0D, (double)((float)this.width / var6), (double)((float)par2 / var6)); -+ var5.setColorRGBA_I(4210752, par3); -+ var5.addVertexWithUV((double)this.width, (double)par1, 0.0D, (double)((float)this.width / var6), (double)((float)par1 / var6)); -+ var5.addVertexWithUV(0.0D, (double)par1, 0.0D, 0.0D, (double)((float)par1 / var6)); - var5.draw(); -+ // Spout Start -+ GL11.glPopMatrix(); -+ // Spout End - } - } ---- /dev/null -+++ org/spoutcraft/api/gui/GenericRectangle.java -@@ -1,0 +1,48 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.api.gui; -+ -+import org.spoutcraft.api.UnsafeClass; -+ -+@UnsafeClass -+public class GenericRectangle extends GenericGradient{ -+ public GenericRectangle() { -+ } -+ -+ public GenericRectangle(Color color) { -+ setColor(color); -+ } -+ -+ public GenericRectangle setColor(Color color) { -+ super.setTopColor(color); -+ super.setBottomColor(color); -+ return this; -+ } -+ -+ @Override -+ public GenericGradient setTopColor(Color color) { -+ return setColor(color); -+ } -+ -+ @Override -+ public GenericGradient setBottomColor(Color color) { -+ return setColor(color); -+ } -+} ---- /dev/null -+++ org/spoutcraft/api/gui/GenericListWidgetItem.java -@@ -1,0 +1,129 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.api.gui; -+ -+import org.apache.commons.lang3.builder.EqualsBuilder; -+import org.apache.commons.lang3.builder.HashCodeBuilder; -+ -+import org.spoutcraft.api.Spoutcraft; -+import org.spoutcraft.api.UnsafeClass; -+import org.spoutcraft.api.property.Property; -+import org.spoutcraft.api.property.PropertyInterface; -+import org.spoutcraft.api.property.PropertyObject; -+ -+@UnsafeClass -+public class GenericListWidgetItem extends PropertyObject implements PropertyInterface, ListWidgetItem { -+ private String title = null, text = null, iconUrl = null; -+ private ListWidget parent; -+ -+ public GenericListWidgetItem(String title, String text, String iconUrl) { -+ initProperties(); -+ setTitle(title); -+ setText(text); -+ setIconUrl(iconUrl); -+ } -+ -+ private void initProperties() { -+ addProperty("title", new Property() { -+ public void set(Object value) { -+ setTitle((String) value); -+ } -+ -+ public Object get() { -+ return getTitle(); -+ } -+ }); -+ addProperty("text", new Property() { -+ public void set(Object value) { -+ setText((String) value); -+ } -+ -+ public Object get() { -+ return getText(); -+ } -+ }); -+ addProperty("iconurl", new Property() { -+ public void set(Object value) { -+ setIconUrl((String) value); -+ } -+ -+ public Object get() { -+ return getIconUrl(); -+ } -+ }); -+ } -+ -+ public String getTitle() { -+ return title; -+ } -+ -+ public void setTitle(String title) { -+ this.title = title; -+ } -+ -+ public String getText() { -+ return text; -+ } -+ -+ public void setText(String text) { -+ this.text = text; -+ } -+ -+ public String getIconUrl() { -+ return iconUrl; -+ } -+ -+ public void setIconUrl(String iconUrl) { -+ this.iconUrl = iconUrl; -+ } -+ -+ @Override -+ public boolean equals(Object other) { -+ if (!(other instanceof GenericListWidgetItem)) { -+ return false; -+ } -+ GenericListWidgetItem li = (GenericListWidgetItem) other; -+ return (new EqualsBuilder()).append(this.text, li.text).append(this.title, li.title).append(this.iconUrl, li.iconUrl).isEquals(); -+ } -+ -+ @Override -+ public int hashCode() { -+ return (new HashCodeBuilder()).append(text).append(title).append(iconUrl).toHashCode(); -+ } -+ -+ public int getHeight() { -+ return 20; -+ } -+ -+ public void render(int x, int y, int width, int height) { -+ Spoutcraft.getRenderDelegate().render(this, x, y, width, height); -+ } -+ -+ public void setListWidget(ListWidget widget) { -+ parent = widget; -+ } -+ -+ public ListWidget getListWidget() { -+ return parent; -+ } -+ -+ public void onClick(int x, int y, boolean d) { -+ } -+} ---- net/minecraft/src/VillageAgressor.java -+++ net/minecraft/src/VillageAgressor.java -@@ -3,11 +3,12 @@ - class VillageAgressor { - public EntityLivingBase agressor; - public int agressionTime; -+ - final Village villageObj; - -- VillageAgressor(Village var1, EntityLivingBase var2, int var3) { -- this.villageObj = var1; -- this.agressor = var2; -- this.agressionTime = var3; -+ VillageAgressor(Village par1Village, EntityLivingBase par2EntityLivingBase, int par3) { -+ this.villageObj = par1Village; -+ this.agressor = par2EntityLivingBase; -+ this.agressionTime = par3; - } - } ---- net/minecraft/src/EntityThrowable.java -+++ net/minecraft/src/EntityThrowable.java -@@ -9,32 +9,41 @@ - private int inTile; - protected boolean inGround; - public int throwableShake; -- private EntityLivingBase thrower; -- private String h; -+ -+ /** -+ * Is the entity that throws this 'thing' (snowball, ender pearl, eye of ender or potion) -+ */ -+ // Spout Start - private to public -+ public EntityLivingBase thrower; -+ // Spout End -+ private String throwerName; - private int ticksInGround; - private int ticksInAir; - -- public EntityThrowable(World var1) { -- super(var1); -+ public EntityThrowable(World par1World) { -+ super(par1World); - this.setSize(0.25F, 0.25F); - } - -- protected void entityInit() { -- } -+ protected void entityInit() {} - -- public boolean isInRangeToRenderDist(double var1) { -+ /** -+ * Checks if the entity is in range to render by using the past in distance and comparing it to its average edge length -+ * * 64 * renderDistanceWeight Args: distance -+ */ -+ public boolean isInRangeToRenderDist(double par1) { - double var3 = this.boundingBox.getAverageEdgeLength() * 4.0D; - var3 *= 64.0D; -- return var1 < var3 * var3; -+ return par1 < var3 * var3; - } - -- public EntityThrowable(World var1, EntityLivingBase var2) { -- super(var1); -- this.thrower = var2; -+ public EntityThrowable(World par1World, EntityLivingBase par2EntityLivingBase) { -+ super(par1World); -+ this.thrower = par2EntityLivingBase; - this.setSize(0.25F, 0.25F); -- this.setLocationAndAngles(var2.posX, var2.posY + (double)var2.getEyeHeight(), var2.posZ, var2.rotationYaw, var2.rotationPitch); -+ this.setLocationAndAngles(par2EntityLivingBase.posX, par2EntityLivingBase.posY + (double)par2EntityLivingBase.getEyeHeight(), par2EntityLivingBase.posZ, par2EntityLivingBase.rotationYaw, par2EntityLivingBase.rotationPitch); - this.posX -= (double)(MathHelper.cos(this.rotationYaw / 180.0F * (float)Math.PI) * 0.16F); -- this.posY -= (double)0.1F; -+ this.posY -= 0.10000000149011612D; - this.posZ -= (double)(MathHelper.sin(this.rotationYaw / 180.0F * (float)Math.PI) * 0.16F); - this.setPosition(this.posX, this.posY, this.posZ); - this.yOffset = 0.0F; -@@ -45,11 +54,11 @@ - this.setThrowableHeading(this.motionX, this.motionY, this.motionZ, this.func_70182_d(), 1.0F); - } - -- public EntityThrowable(World var1, double var2, double var4, double var6) { -- super(var1); -+ public EntityThrowable(World par1World, double par2, double par4, double par6) { -+ super(par1World); - this.ticksInGround = 0; - this.setSize(0.25F, 0.25F); -- this.setPosition(var2, var4, var6); -+ this.setPosition(par2, par4, par6); - this.yOffset = 0.0F; - } - -@@ -61,52 +70,64 @@ - return 0.0F; - } - -- public void setThrowableHeading(double var1, double var3, double var5, float var7, float var8) { -- float var9 = MathHelper.sqrt_double(var1 * var1 + var3 * var3 + var5 * var5); -- var1 /= (double)var9; -- var3 /= (double)var9; -- var5 /= (double)var9; -- var1 += this.ab.nextGaussian() * (double)0.0075F * (double)var8; -- var3 += this.ab.nextGaussian() * (double)0.0075F * (double)var8; -- var5 += this.ab.nextGaussian() * (double)0.0075F * (double)var8; -- var1 *= (double)var7; -- var3 *= (double)var7; -- var5 *= (double)var7; -- this.motionX = var1; -- this.motionY = var3; -- this.motionZ = var5; -- float var10 = MathHelper.sqrt_double(var1 * var1 + var5 * var5); -- this.prevRotationYaw = this.rotationYaw = (float)(Math.atan2(var1, var5) * 180.0D / (double)((float)Math.PI)); -- this.prevRotationPitch = this.rotationPitch = (float)(Math.atan2(var3, (double)var10) * 180.0D / (double)((float)Math.PI)); -+ /** -+ * Similar to setArrowHeading, it's point the throwable entity to a x, y, z direction. -+ */ -+ public void setThrowableHeading(double par1, double par3, double par5, float par7, float par8) { -+ float var9 = MathHelper.sqrt_double(par1 * par1 + par3 * par3 + par5 * par5); -+ par1 /= (double)var9; -+ par3 /= (double)var9; -+ par5 /= (double)var9; -+ par1 += this.rand.nextGaussian() * 0.007499999832361937D * (double)par8; -+ par3 += this.rand.nextGaussian() * 0.007499999832361937D * (double)par8; -+ par5 += this.rand.nextGaussian() * 0.007499999832361937D * (double)par8; -+ par1 *= (double)par7; -+ par3 *= (double)par7; -+ par5 *= (double)par7; -+ this.motionX = par1; -+ this.motionY = par3; -+ this.motionZ = par5; -+ float var10 = MathHelper.sqrt_double(par1 * par1 + par5 * par5); -+ this.prevRotationYaw = this.rotationYaw = (float)(Math.atan2(par1, par5) * 180.0D / Math.PI); -+ this.prevRotationPitch = this.rotationPitch = (float)(Math.atan2(par3, (double)var10) * 180.0D / Math.PI); - this.ticksInGround = 0; - } - -- public void setVelocity(double var1, double var3, double var5) { -- this.motionX = var1; -- this.motionY = var3; -- this.motionZ = var5; -- if(this.prevRotationPitch == 0.0F && this.prevRotationYaw == 0.0F) { -- float var7 = MathHelper.sqrt_double(var1 * var1 + var5 * var5); -- this.prevRotationYaw = this.rotationYaw = (float)(Math.atan2(var1, var5) * 180.0D / (double)((float)Math.PI)); -- this.prevRotationPitch = this.rotationPitch = (float)(Math.atan2(var3, (double)var7) * 180.0D / (double)((float)Math.PI)); -+ /** -+ * Sets the velocity to the args. Args: x, y, z -+ */ -+ public void setVelocity(double par1, double par3, double par5) { -+ this.motionX = par1; -+ this.motionY = par3; -+ this.motionZ = par5; -+ -+ if (this.prevRotationPitch == 0.0F && this.prevRotationYaw == 0.0F) { -+ float var7 = MathHelper.sqrt_double(par1 * par1 + par5 * par5); -+ this.prevRotationYaw = this.rotationYaw = (float)(Math.atan2(par1, par5) * 180.0D / Math.PI); -+ this.prevRotationPitch = this.rotationPitch = (float)(Math.atan2(par3, (double)var7) * 180.0D / Math.PI); - } -- - } - -+ /** -+ * Called to update the entity's position/logic. -+ */ - public void onUpdate() { - this.lastTickPosX = this.posX; - this.lastTickPosY = this.posY; - this.lastTickPosZ = this.posZ; - super.onUpdate(); -- if(this.throwableShake > 0) { -+ -+ if (this.throwableShake > 0) { - --this.throwableShake; - } - -- if(this.inGround) { -+ if (this.inGround) { - int var1 = this.worldObj.getBlockId(this.xTile, this.yTile, this.zTile); -- if(var1 == this.inTile) { -+ -+ if (var1 == this.inTile) { - ++this.ticksInGround; -- if(this.ticksInGround == 1200) { -+ -+ if (this.ticksInGround == 1200) { - this.setDead(); - } - -@@ -114,39 +135,43 @@ - } - - this.inGround = false; -- this.motionX *= (double)(this.ab.nextFloat() * 0.2F); -- this.motionY *= (double)(this.ab.nextFloat() * 0.2F); -- this.motionZ *= (double)(this.ab.nextFloat() * 0.2F); -+ this.motionX *= (double)(this.rand.nextFloat() * 0.2F); -+ this.motionY *= (double)(this.rand.nextFloat() * 0.2F); -+ this.motionZ *= (double)(this.rand.nextFloat() * 0.2F); - this.ticksInGround = 0; - this.ticksInAir = 0; - } else { - ++this.ticksInAir; - } - -- Vec3 var16 = this.worldObj.getWorldVec3Pool().getVecFromPool(this.posX, this.posY, this.posZ); -+ Vec3 var17 = this.worldObj.getWorldVec3Pool().getVecFromPool(this.posX, this.posY, this.posZ); - Vec3 var2 = this.worldObj.getWorldVec3Pool().getVecFromPool(this.posX + this.motionX, this.posY + this.motionY, this.posZ + this.motionZ); -- MovingObjectPosition var3 = this.worldObj.rayTraceBlocks(var16, var2); -- var16 = this.worldObj.getWorldVec3Pool().getVecFromPool(this.posX, this.posY, this.posZ); -+ MovingObjectPosition var3 = this.worldObj.clip(var17, var2); -+ var17 = this.worldObj.getWorldVec3Pool().getVecFromPool(this.posX, this.posY, this.posZ); - var2 = this.worldObj.getWorldVec3Pool().getVecFromPool(this.posX + this.motionX, this.posY + this.motionY, this.posZ + this.motionZ); -- if(var3 != null) { -+ -+ if (var3 != null) { - var2 = this.worldObj.getWorldVec3Pool().getVecFromPool(var3.hitVec.xCoord, var3.hitVec.yCoord, var3.hitVec.zCoord); - } - -- if(!this.worldObj.isRemote) { -+ if (!this.worldObj.isRemote) { - Entity var4 = null; - List var5 = this.worldObj.getEntitiesWithinAABBExcludingEntity(this, this.boundingBox.addCoord(this.motionX, this.motionY, this.motionZ).expand(1.0D, 1.0D, 1.0D)); - double var6 = 0.0D; - EntityLivingBase var8 = this.getThrower(); - -- for(int var9 = 0; var9 < var5.size(); ++var9) { -+ for (int var9 = 0; var9 < var5.size(); ++var9) { - Entity var10 = (Entity)var5.get(var9); -- if(var10.canBeCollidedWith() && (var10 != var8 || this.ticksInAir >= 5)) { -+ -+ if (var10.canBeCollidedWith() && (var10 != var8 || this.ticksInAir >= 5)) { - float var11 = 0.3F; - AxisAlignedBB var12 = var10.boundingBox.expand((double)var11, (double)var11, (double)var11); -- MovingObjectPosition var13 = var12.calculateIntercept(var16, var2); -- if(var13 != null) { -- double var14 = var16.distanceTo(var13.hitVec); -- if(var14 < var6 || var6 == 0.0D) { -+ MovingObjectPosition var13 = var12.calculateIntercept(var17, var2); -+ -+ if (var13 != null) { -+ double var14 = var17.distanceTo(var13.hitVec); -+ -+ if (var14 < var6 || var6 == 0.0D) { - var4 = var10; - var6 = var14; - } -@@ -154,13 +179,13 @@ - } - } - -- if(var4 != null) { -+ if (var4 != null) { - var3 = new MovingObjectPosition(var4); - } - } - -- if(var3 != null) { -- if(var3.typeOfHit == EnumMovingObjectType.TILE && this.worldObj.getBlockId(var3.blockX, var3.blockY, var3.blockZ) == Block.portal.blockID) { -+ if (var3 != null) { -+ if (var3.typeOfHit == EnumMovingObjectType.TILE && this.worldObj.getBlockId(var3.blockX, var3.blockY, var3.blockZ) == Block.portal.blockID) { - this.setInPortal(); - } else { - this.onImpact(var3); -@@ -170,76 +195,91 @@ - this.posX += this.motionX; - this.posY += this.motionY; - this.posZ += this.motionZ; -- float var17 = MathHelper.sqrt_double(this.motionX * this.motionX + this.motionZ * this.motionZ); -- this.rotationYaw = (float)(Math.atan2(this.motionX, this.motionZ) * 180.0D / (double)((float)Math.PI)); -+ float var16 = MathHelper.sqrt_double(this.motionX * this.motionX + this.motionZ * this.motionZ); -+ this.rotationYaw = (float)(Math.atan2(this.motionX, this.motionZ) * 180.0D / Math.PI); - -- for(this.rotationPitch = (float)(Math.atan2(this.motionY, (double)var17) * 180.0D / (double)((float)Math.PI)); this.rotationPitch - this.prevRotationPitch < -180.0F; this.prevRotationPitch -= 360.0F) { -+ for (this.rotationPitch = (float)(Math.atan2(this.motionY, (double)var16) * 180.0D / Math.PI); this.rotationPitch - this.prevRotationPitch < -180.0F; this.prevRotationPitch -= 360.0F) { -+ ; - } - -- while(this.rotationPitch - this.prevRotationPitch >= 180.0F) { -+ while (this.rotationPitch - this.prevRotationPitch >= 180.0F) { - this.prevRotationPitch += 360.0F; - } - -- while(this.rotationYaw - this.prevRotationYaw < -180.0F) { -+ while (this.rotationYaw - this.prevRotationYaw < -180.0F) { - this.prevRotationYaw -= 360.0F; - } - -- while(this.rotationYaw - this.prevRotationYaw >= 180.0F) { -+ while (this.rotationYaw - this.prevRotationYaw >= 180.0F) { - this.prevRotationYaw += 360.0F; - } - - this.rotationPitch = this.prevRotationPitch + (this.rotationPitch - this.prevRotationPitch) * 0.2F; - this.rotationYaw = this.prevRotationYaw + (this.rotationYaw - this.prevRotationYaw) * 0.2F; -- float var18 = 0.99F; -- float var19 = this.getGravityVelocity(); -- if(this.isInWater()) { -- for(int var7 = 0; var7 < 4; ++var7) { -- float var20 = 0.25F; -- this.worldObj.spawnParticle("bubble", this.posX - this.motionX * (double)var20, this.posY - this.motionY * (double)var20, this.posZ - this.motionZ * (double)var20, this.motionX, this.motionY, this.motionZ); -+ float var19 = 0.99F; -+ float var20 = this.getGravityVelocity(); -+ -+ if (this.isInWater()) { -+ for (int var7 = 0; var7 < 4; ++var7) { -+ float var18 = 0.25F; -+ this.worldObj.spawnParticle("bubble", this.posX - this.motionX * (double)var18, this.posY - this.motionY * (double)var18, this.posZ - this.motionZ * (double)var18, this.motionX, this.motionY, this.motionZ); - } - -- var18 = 0.8F; -+ var19 = 0.8F; - } - -- this.motionX *= (double)var18; -- this.motionY *= (double)var18; -- this.motionZ *= (double)var18; -- this.motionY -= (double)var19; -+ this.motionX *= (double)var19; -+ this.motionY *= (double)var19; -+ this.motionZ *= (double)var19; -+ this.motionY -= (double)var20; - this.setPosition(this.posX, this.posY, this.posZ); - } - -+ /** -+ * Gets the amount of gravity to apply to the thrown entity with each tick. -+ */ - protected float getGravityVelocity() { - return 0.03F; - } - -+ /** -+ * Called when this EntityThrowable hits a block or entity. -+ */ - protected abstract void onImpact(MovingObjectPosition var1); - -- public void writeEntityToNBT(NBTTagCompound var1) { -- var1.setShort("xTile", (short)this.xTile); -- var1.setShort("yTile", (short)this.yTile); -- var1.setShort("zTile", (short)this.zTile); -- var1.setByte("inTile", (byte)this.inTile); -- var1.setByte("shake", (byte)this.throwableShake); -- var1.setByte("inGround", (byte)(this.inGround ? 1 : 0)); -- if((this.h == null || this.h.length() == 0) && this.thrower != null && this.thrower instanceof EntityPlayer) { -- this.h = this.thrower.getEntityName(); -+ /** -+ * (abstract) Protected helper method to write subclass entity data to NBT. -+ */ -+ public void writeEntityToNBT(NBTTagCompound par1NBTTagCompound) { -+ par1NBTTagCompound.setShort("xTile", (short)this.xTile); -+ par1NBTTagCompound.setShort("yTile", (short)this.yTile); -+ par1NBTTagCompound.setShort("zTile", (short)this.zTile); -+ par1NBTTagCompound.setByte("inTile", (byte)this.inTile); -+ par1NBTTagCompound.setByte("shake", (byte)this.throwableShake); -+ par1NBTTagCompound.setByte("inGround", (byte)(this.inGround ? 1 : 0)); -+ -+ if ((this.throwerName == null || this.throwerName.length() == 0) && this.thrower != null && this.thrower instanceof EntityPlayer) { -+ this.throwerName = this.thrower.getEntityName(); - } - -- var1.setString("ownerName", this.h == null ? "" : this.h); -+ par1NBTTagCompound.setString("ownerName", this.throwerName == null ? "" : this.throwerName); - } - -- public void readEntityFromNBT(NBTTagCompound var1) { -- this.xTile = var1.getShort("xTile"); -- this.yTile = var1.getShort("yTile"); -- this.zTile = var1.getShort("zTile"); -- this.inTile = var1.getByte("inTile") & 255; -- this.throwableShake = var1.getByte("shake") & 255; -- this.inGround = var1.getByte("inGround") == 1; -- this.h = var1.getString("ownerName"); -- if(this.h != null && this.h.length() == 0) { -- this.h = null; -- } -+ /** -+ * (abstract) Protected helper method to read subclass entity data from NBT. -+ */ -+ public void readEntityFromNBT(NBTTagCompound par1NBTTagCompound) { -+ this.xTile = par1NBTTagCompound.getShort("xTile"); -+ this.yTile = par1NBTTagCompound.getShort("yTile"); -+ this.zTile = par1NBTTagCompound.getShort("zTile"); -+ this.inTile = par1NBTTagCompound.getByte("inTile") & 255; -+ this.throwableShake = par1NBTTagCompound.getByte("shake") & 255; -+ this.inGround = par1NBTTagCompound.getByte("inGround") == 1; -+ this.throwerName = par1NBTTagCompound.getString("ownerName"); - -+ if (this.throwerName != null && this.throwerName.length() == 0) { -+ this.throwerName = null; -+ } - } - - public float getShadowSize() { -@@ -247,8 +287,8 @@ - } - - public EntityLivingBase getThrower() { -- if(this.thrower == null && this.h != null && this.h.length() > 0) { -- this.thrower = this.worldObj.getPlayerEntityByName(this.h); -+ if (this.thrower == null && this.throwerName != null && this.throwerName.length() > 0) { -+ this.thrower = this.worldObj.getPlayerEntityByName(this.throwerName); - } - - return this.thrower; ---- net/minecraft/src/RangedAttribute.java -+++ net/minecraft/src/RangedAttribute.java -@@ -3,39 +3,40 @@ - public class RangedAttribute extends BaseAttribute { - private final double minimumValue; - private final double maximumValue; -- private String c; -- -- public RangedAttribute(String var1, double var2, double var4, double var6) { -- super(var1, var2); -- this.minimumValue = var4; -- this.maximumValue = var6; -- if(var4 > var6) { -+ private String field_111119_c; -+ -+ public RangedAttribute(String par1Str, double par2, double par4, double par6) { -+ super(par1Str, par2); -+ this.minimumValue = par4; -+ this.maximumValue = par6; -+ -+ if (par4 > par6) { - throw new IllegalArgumentException("Minimum value cannot be bigger than maximum value!"); -- } else if(var2 < var4) { -+ } else if (par2 < par4) { - throw new IllegalArgumentException("Default value cannot be lower than minimum value!"); -- } else if(var2 > var6) { -+ } else if (par2 > par6) { - throw new IllegalArgumentException("Default value cannot be bigger than maximum value!"); - } - } - -- public RangedAttribute func_111117_a(String var1) { -- this.c = var1; -+ public RangedAttribute func_111117_a(String par1Str) { -+ this.field_111119_c = par1Str; - return this; - } - - public String func_111116_f() { -- return this.c; -+ return this.field_111119_c; - } - -- public double clampValue(double var1) { -- if(var1 < this.minimumValue) { -- var1 = this.minimumValue; -- } -- -- if(var1 > this.maximumValue) { -- var1 = this.maximumValue; -- } -- -- return var1; -+ public double clampValue(double par1) { -+ if (par1 < this.minimumValue) { -+ par1 = this.minimumValue; -+ } -+ -+ if (par1 > this.maximumValue) { -+ par1 = this.maximumValue; -+ } -+ -+ return par1; - } - } ---- net/minecraft/src/Packet30Entity.java -+++ net/minecraft/src/Packet30Entity.java -@@ -5,33 +5,58 @@ - import java.io.IOException; - - public class Packet30Entity extends Packet { -+ -+ /** The ID of this entity. */ - public int entityId; -+ -+ /** The X axis relative movement. */ - public byte xPosition; -+ -+ /** The Y axis relative movement. */ - public byte yPosition; -+ -+ /** The Z axis relative movement. */ - public byte zPosition; -+ -+ /** The X axis rotation. */ - public byte yaw; -+ -+ /** The Y axis rotation. */ - public byte pitch; -+ -+ /** Boolean set to true if the entity is rotating. */ - public boolean rotating; - -- public Packet30Entity() { -- } -- -- public Packet30Entity(int var1) { -- this.entityId = var1; -- } -- -- public void readPacketData(DataInput var1) throws IOException { -- this.entityId = var1.readInt(); -- } -- -- public void writePacketData(DataOutput var1) throws IOException { -- var1.writeInt(this.entityId); -- } -- -- public void processPacket(NetHandler var1) { -- var1.handleEntity(this); -- } -- -+ public Packet30Entity() {} -+ -+ public Packet30Entity(int par1) { -+ this.entityId = par1; -+ } -+ -+ /** -+ * Abstract. Reads the raw packet data from the data stream. -+ */ -+ public void readPacketData(DataInput par1DataInput) throws IOException { -+ this.entityId = par1DataInput.readInt(); -+ } -+ -+ /** -+ * Abstract. Writes the raw packet data to the data stream. -+ */ -+ public void writePacketData(DataOutput par1DataOutput) throws IOException { -+ par1DataOutput.writeInt(this.entityId); -+ } -+ -+ /** -+ * Passes this Packet on to the NetHandler for processing. -+ */ -+ public void processPacket(NetHandler par1NetHandler) { -+ par1NetHandler.handleEntity(this); -+ } -+ -+ /** -+ * Abstract. Return the size of the packet (not counting the header). -+ */ - public int getPacketSize() { - return 4; - } -@@ -40,12 +65,19 @@ - return "Entity_" + super.toString(); - } - -+ /** -+ * only false for the abstract Packet class, all real packets return true -+ */ - public boolean isRealPacket() { - return true; - } - -- public boolean containsSameEntityIDAs(Packet var1) { -- Packet30Entity var2 = (Packet30Entity)var1; -+ /** -+ * eg return packet30entity.entityId == entityId; WARNING : will throw if you compare a packet to a different packet -+ * class -+ */ -+ public boolean containsSameEntityIDAs(Packet par1Packet) { -+ Packet30Entity var2 = (Packet30Entity)par1Packet; - return var2.entityId == this.entityId; - } - } ---- net/minecraft/src/WorldGenVines.java -+++ net/minecraft/src/WorldGenVines.java -@@ -3,20 +3,20 @@ - import java.util.Random; - - public class WorldGenVines extends WorldGenerator { -- public boolean generate(World var1, Random var2, int var3, int var4, int var5) { -- int var6 = var3; -+ public boolean generate(World par1World, Random par2Random, int par3, int par4, int par5) { -+ int var6 = par3; - -- for(int var7 = var5; var4 < 128; ++var4) { -- if(var1.isAirBlock(var3, var4, var5)) { -- for(int var8 = 2; var8 <= 5; ++var8) { -- if(Block.vine.canPlaceBlockOnSide(var1, var3, var4, var5, var8)) { -- var1.setBlock(var3, var4, var5, Block.vine.blockID, 1 << Direction.facingToDirection[Facing.oppositeSide[var8]], 2); -+ for (int var7 = par5; par4 < 128; ++par4) { -+ if (par1World.isAirBlock(par3, par4, par5)) { -+ for (int var8 = 2; var8 <= 5; ++var8) { -+ if (Block.vine.canPlaceBlockOnSide(par1World, par3, par4, par5, var8)) { -+ par1World.setBlock(par3, par4, par5, Block.vine.blockID, 1 << Direction.facingToDirection[Facing.oppositeSide[var8]], 2); - break; - } - } - } else { -- var3 = var6 + var2.nextInt(4) - var2.nextInt(4); -- var5 = var7 + var2.nextInt(4) - var2.nextInt(4); -+ par3 = var6 + par2Random.nextInt(4) - par2Random.nextInt(4); -+ par5 = var7 + par2Random.nextInt(4) - par2Random.nextInt(4); - } - } - ---- net/minecraft/src/CallableLevelSeed.java -+++ net/minecraft/src/CallableLevelSeed.java -@@ -5,8 +5,8 @@ - class CallableLevelSeed implements Callable { - final WorldInfo worldInfoInstance; - -- CallableLevelSeed(WorldInfo var1) { -- this.worldInfoInstance = var1; -+ CallableLevelSeed(WorldInfo par1WorldInfo) { -+ this.worldInfoInstance = par1WorldInfo; - } - - public String callLevelSeed() { ---- net/minecraft/src/CreativeTabSearch.java -+++ net/minecraft/src/CreativeTabSearch.java -@@ -1,10 +1,13 @@ - package net.minecraft.src; - - final class CreativeTabSearch extends CreativeTabs { -- CreativeTabSearch(int var1, String var2) { -- super(var1, var2); -+ CreativeTabSearch(int par1, String par2Str) { -+ super(par1, par2Str); - } - -+ /** -+ * the itemID for the item to be displayed on the tab -+ */ - public int getTabIconItemIndex() { - return Item.appleRed.itemID; - } ---- net/minecraft/src/ComponentScatteredFeatureDesertPyramid.java -+++ net/minecraft/src/ComponentScatteredFeatureDesertPyramid.java -@@ -4,44 +4,50 @@ - - public class ComponentScatteredFeatureDesertPyramid extends ComponentScatteredFeature { - private boolean[] field_74940_h = new boolean[4]; -- private static final WeightedRandomChestContent[] itemsToGenerateInTemple = new WeightedRandomChestContent[]{new WeightedRandomChestContent(Item.diamond.itemID, 0, 1, 3, 3), new WeightedRandomChestContent(Item.ingotIron.itemID, 0, 1, 5, 10), new WeightedRandomChestContent(Item.ingotGold.itemID, 0, 2, 7, 15), new WeightedRandomChestContent(Item.emerald.itemID, 0, 1, 3, 2), new WeightedRandomChestContent(Item.bone.itemID, 0, 4, 6, 20), new WeightedRandomChestContent(Item.rottenFlesh.itemID, 0, 3, 7, 16), new WeightedRandomChestContent(Item.saddle.itemID, 0, 1, 1, 3), new WeightedRandomChestContent(Item.horseArmorIron.itemID, 0, 1, 1, 1), new WeightedRandomChestContent(Item.horseArmorGold.itemID, 0, 1, 1, 1), new WeightedRandomChestContent(Item.horseArmorDiamond.itemID, 0, 1, 1, 1)}; -- -- public ComponentScatteredFeatureDesertPyramid() { -- } -- -- public ComponentScatteredFeatureDesertPyramid(Random var1, int var2, int var3) { -- super(var1, var2, 64, var3, 21, 15, 21); -- } -- -- protected void func_143012_a(NBTTagCompound var1) { -- super.func_143012_a(var1); -- var1.setBoolean("hasPlacedChest0", this.field_74940_h[0]); -- var1.setBoolean("hasPlacedChest1", this.field_74940_h[1]); -- var1.setBoolean("hasPlacedChest2", this.field_74940_h[2]); -- var1.setBoolean("hasPlacedChest3", this.field_74940_h[3]); -- } -- -- protected void func_143011_b(NBTTagCompound var1) { -- super.func_143011_b(var1); -- this.field_74940_h[0] = var1.getBoolean("hasPlacedChest0"); -- this.field_74940_h[1] = var1.getBoolean("hasPlacedChest1"); -- this.field_74940_h[2] = var1.getBoolean("hasPlacedChest2"); -- this.field_74940_h[3] = var1.getBoolean("hasPlacedChest3"); -- } -- -- public boolean addComponentParts(World var1, Random var2, StructureBoundingBox var3) { -- this.fillWithBlocks(var1, var3, 0, -4, 0, this.scatteredFeatureSizeX - 1, 0, this.scatteredFeatureSizeZ - 1, Block.sandStone.blockID, Block.sandStone.blockID, false); -- -+ -+ /** List of items to generate in chests of Temples. */ -+ private static final WeightedRandomChestContent[] itemsToGenerateInTemple = new WeightedRandomChestContent[] {new WeightedRandomChestContent(Item.diamond.itemID, 0, 1, 3, 3), new WeightedRandomChestContent(Item.ingotIron.itemID, 0, 1, 5, 10), new WeightedRandomChestContent(Item.ingotGold.itemID, 0, 2, 7, 15), new WeightedRandomChestContent(Item.emerald.itemID, 0, 1, 3, 2), new WeightedRandomChestContent(Item.bone.itemID, 0, 4, 6, 20), new WeightedRandomChestContent(Item.rottenFlesh.itemID, 0, 3, 7, 16), new WeightedRandomChestContent(Item.saddle.itemID, 0, 1, 1, 3), new WeightedRandomChestContent(Item.horseArmorIron.itemID, 0, 1, 1, 1), new WeightedRandomChestContent(Item.horseArmorGold.itemID, 0, 1, 1, 1), new WeightedRandomChestContent(Item.horseArmorDiamond.itemID, 0, 1, 1, 1)}; -+ -+ public ComponentScatteredFeatureDesertPyramid() {} -+ -+ public ComponentScatteredFeatureDesertPyramid(Random par1Random, int par2, int par3) { -+ super(par1Random, par2, 64, par3, 21, 15, 21); -+ } -+ -+ protected void func_143012_a(NBTTagCompound par1NBTTagCompound) { -+ super.func_143012_a(par1NBTTagCompound); -+ par1NBTTagCompound.setBoolean("hasPlacedChest0", this.field_74940_h[0]); -+ par1NBTTagCompound.setBoolean("hasPlacedChest1", this.field_74940_h[1]); -+ par1NBTTagCompound.setBoolean("hasPlacedChest2", this.field_74940_h[2]); -+ par1NBTTagCompound.setBoolean("hasPlacedChest3", this.field_74940_h[3]); -+ } -+ -+ protected void func_143011_b(NBTTagCompound par1NBTTagCompound) { -+ super.func_143011_b(par1NBTTagCompound); -+ this.field_74940_h[0] = par1NBTTagCompound.getBoolean("hasPlacedChest0"); -+ this.field_74940_h[1] = par1NBTTagCompound.getBoolean("hasPlacedChest1"); -+ this.field_74940_h[2] = par1NBTTagCompound.getBoolean("hasPlacedChest2"); -+ this.field_74940_h[3] = par1NBTTagCompound.getBoolean("hasPlacedChest3"); -+ } -+ -+ /** -+ * second Part of Structure generating, this for example places Spiderwebs, Mob Spawners, it closes Mineshafts at the -+ * end, it adds Fences... -+ */ -+ public boolean addComponentParts(World par1World, Random par2Random, StructureBoundingBox par3StructureBoundingBox) { -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 0, -4, 0, this.scatteredFeatureSizeX - 1, 0, this.scatteredFeatureSizeZ - 1, Block.sandStone.blockID, Block.sandStone.blockID, false); - int var4; -- for(var4 = 1; var4 <= 9; ++var4) { -- this.fillWithBlocks(var1, var3, var4, var4, var4, this.scatteredFeatureSizeX - 1 - var4, var4, this.scatteredFeatureSizeZ - 1 - var4, Block.sandStone.blockID, Block.sandStone.blockID, false); -- this.fillWithBlocks(var1, var3, var4 + 1, var4, var4 + 1, this.scatteredFeatureSizeX - 2 - var4, var4, this.scatteredFeatureSizeZ - 2 - var4, 0, 0, false); -+ -+ for (var4 = 1; var4 <= 9; ++var4) { -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, var4, var4, var4, this.scatteredFeatureSizeX - 1 - var4, var4, this.scatteredFeatureSizeZ - 1 - var4, Block.sandStone.blockID, Block.sandStone.blockID, false); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, var4 + 1, var4, var4 + 1, this.scatteredFeatureSizeX - 2 - var4, var4, this.scatteredFeatureSizeZ - 2 - var4, 0, 0, false); - } - - int var5; -- for(var4 = 0; var4 < this.scatteredFeatureSizeX; ++var4) { -- for(var5 = 0; var5 < this.scatteredFeatureSizeZ; ++var5) { -- this.fillCurrentPositionBlocksDownwards(var1, Block.sandStone.blockID, 0, var4, -5, var5, var3); -+ -+ for (var4 = 0; var4 < this.scatteredFeatureSizeX; ++var4) { -+ for (var5 = 0; var5 < this.scatteredFeatureSizeZ; ++var5) { -+ this.fillCurrentPositionBlocksDownwards(par1World, Block.sandStone.blockID, 0, var4, -5, var5, par3StructureBoundingBox); - } - } - -@@ -51,173 +57,173 @@ - int var7 = this.getMetadataWithOffset(Block.stairsSandStone.blockID, 1); - byte var8 = 1; - byte var9 = 11; -- this.fillWithBlocks(var1, var3, 0, 0, 0, 4, 9, 4, Block.sandStone.blockID, 0, false); -- this.fillWithBlocks(var1, var3, 1, 10, 1, 3, 10, 3, Block.sandStone.blockID, Block.sandStone.blockID, false); -- this.placeBlockAtCurrentPosition(var1, Block.stairsSandStone.blockID, var4, 2, 10, 0, var3); -- this.placeBlockAtCurrentPosition(var1, Block.stairsSandStone.blockID, var5, 2, 10, 4, var3); -- this.placeBlockAtCurrentPosition(var1, Block.stairsSandStone.blockID, var6, 0, 10, 2, var3); -- this.placeBlockAtCurrentPosition(var1, Block.stairsSandStone.blockID, var7, 4, 10, 2, var3); -- this.fillWithBlocks(var1, var3, this.scatteredFeatureSizeX - 5, 0, 0, this.scatteredFeatureSizeX - 1, 9, 4, Block.sandStone.blockID, 0, false); -- this.fillWithBlocks(var1, var3, this.scatteredFeatureSizeX - 4, 10, 1, this.scatteredFeatureSizeX - 2, 10, 3, Block.sandStone.blockID, Block.sandStone.blockID, false); -- this.placeBlockAtCurrentPosition(var1, Block.stairsSandStone.blockID, var4, this.scatteredFeatureSizeX - 3, 10, 0, var3); -- this.placeBlockAtCurrentPosition(var1, Block.stairsSandStone.blockID, var5, this.scatteredFeatureSizeX - 3, 10, 4, var3); -- this.placeBlockAtCurrentPosition(var1, Block.stairsSandStone.blockID, var6, this.scatteredFeatureSizeX - 5, 10, 2, var3); -- this.placeBlockAtCurrentPosition(var1, Block.stairsSandStone.blockID, var7, this.scatteredFeatureSizeX - 1, 10, 2, var3); -- this.fillWithBlocks(var1, var3, 8, 0, 0, 12, 4, 4, Block.sandStone.blockID, 0, false); -- this.fillWithBlocks(var1, var3, 9, 1, 0, 11, 3, 4, 0, 0, false); -- this.placeBlockAtCurrentPosition(var1, Block.sandStone.blockID, 2, 9, 1, 1, var3); -- this.placeBlockAtCurrentPosition(var1, Block.sandStone.blockID, 2, 9, 2, 1, var3); -- this.placeBlockAtCurrentPosition(var1, Block.sandStone.blockID, 2, 9, 3, 1, var3); -- this.placeBlockAtCurrentPosition(var1, Block.sandStone.blockID, 2, 10, 3, 1, var3); -- this.placeBlockAtCurrentPosition(var1, Block.sandStone.blockID, 2, 11, 3, 1, var3); -- this.placeBlockAtCurrentPosition(var1, Block.sandStone.blockID, 2, 11, 2, 1, var3); -- this.placeBlockAtCurrentPosition(var1, Block.sandStone.blockID, 2, 11, 1, 1, var3); -- this.fillWithBlocks(var1, var3, 4, 1, 1, 8, 3, 3, Block.sandStone.blockID, 0, false); -- this.fillWithBlocks(var1, var3, 4, 1, 2, 8, 2, 2, 0, 0, false); -- this.fillWithBlocks(var1, var3, 12, 1, 1, 16, 3, 3, Block.sandStone.blockID, 0, false); -- this.fillWithBlocks(var1, var3, 12, 1, 2, 16, 2, 2, 0, 0, false); -- this.fillWithBlocks(var1, var3, 5, 4, 5, this.scatteredFeatureSizeX - 6, 4, this.scatteredFeatureSizeZ - 6, Block.sandStone.blockID, Block.sandStone.blockID, false); -- this.fillWithBlocks(var1, var3, 9, 4, 9, 11, 4, 11, 0, 0, false); -- this.fillWithMetadataBlocks(var1, var3, 8, 1, 8, 8, 3, 8, Block.sandStone.blockID, 2, Block.sandStone.blockID, 2, false); -- this.fillWithMetadataBlocks(var1, var3, 12, 1, 8, 12, 3, 8, Block.sandStone.blockID, 2, Block.sandStone.blockID, 2, false); -- this.fillWithMetadataBlocks(var1, var3, 8, 1, 12, 8, 3, 12, Block.sandStone.blockID, 2, Block.sandStone.blockID, 2, false); -- this.fillWithMetadataBlocks(var1, var3, 12, 1, 12, 12, 3, 12, Block.sandStone.blockID, 2, Block.sandStone.blockID, 2, false); -- this.fillWithBlocks(var1, var3, 1, 1, 5, 4, 4, 11, Block.sandStone.blockID, Block.sandStone.blockID, false); -- this.fillWithBlocks(var1, var3, this.scatteredFeatureSizeX - 5, 1, 5, this.scatteredFeatureSizeX - 2, 4, 11, Block.sandStone.blockID, Block.sandStone.blockID, false); -- this.fillWithBlocks(var1, var3, 6, 7, 9, 6, 7, 11, Block.sandStone.blockID, Block.sandStone.blockID, false); -- this.fillWithBlocks(var1, var3, this.scatteredFeatureSizeX - 7, 7, 9, this.scatteredFeatureSizeX - 7, 7, 11, Block.sandStone.blockID, Block.sandStone.blockID, false); -- this.fillWithMetadataBlocks(var1, var3, 5, 5, 9, 5, 7, 11, Block.sandStone.blockID, 2, Block.sandStone.blockID, 2, false); -- this.fillWithMetadataBlocks(var1, var3, this.scatteredFeatureSizeX - 6, 5, 9, this.scatteredFeatureSizeX - 6, 7, 11, Block.sandStone.blockID, 2, Block.sandStone.blockID, 2, false); -- this.placeBlockAtCurrentPosition(var1, 0, 0, 5, 5, 10, var3); -- this.placeBlockAtCurrentPosition(var1, 0, 0, 5, 6, 10, var3); -- this.placeBlockAtCurrentPosition(var1, 0, 0, 6, 6, 10, var3); -- this.placeBlockAtCurrentPosition(var1, 0, 0, this.scatteredFeatureSizeX - 6, 5, 10, var3); -- this.placeBlockAtCurrentPosition(var1, 0, 0, this.scatteredFeatureSizeX - 6, 6, 10, var3); -- this.placeBlockAtCurrentPosition(var1, 0, 0, this.scatteredFeatureSizeX - 7, 6, 10, var3); -- this.fillWithBlocks(var1, var3, 2, 4, 4, 2, 6, 4, 0, 0, false); -- this.fillWithBlocks(var1, var3, this.scatteredFeatureSizeX - 3, 4, 4, this.scatteredFeatureSizeX - 3, 6, 4, 0, 0, false); -- this.placeBlockAtCurrentPosition(var1, Block.stairsSandStone.blockID, var4, 2, 4, 5, var3); -- this.placeBlockAtCurrentPosition(var1, Block.stairsSandStone.blockID, var4, 2, 3, 4, var3); -- this.placeBlockAtCurrentPosition(var1, Block.stairsSandStone.blockID, var4, this.scatteredFeatureSizeX - 3, 4, 5, var3); -- this.placeBlockAtCurrentPosition(var1, Block.stairsSandStone.blockID, var4, this.scatteredFeatureSizeX - 3, 3, 4, var3); -- this.fillWithBlocks(var1, var3, 1, 1, 3, 2, 2, 3, Block.sandStone.blockID, Block.sandStone.blockID, false); -- this.fillWithBlocks(var1, var3, this.scatteredFeatureSizeX - 3, 1, 3, this.scatteredFeatureSizeX - 2, 2, 3, Block.sandStone.blockID, Block.sandStone.blockID, false); -- this.placeBlockAtCurrentPosition(var1, Block.stairsSandStone.blockID, 0, 1, 1, 2, var3); -- this.placeBlockAtCurrentPosition(var1, Block.stairsSandStone.blockID, 0, this.scatteredFeatureSizeX - 2, 1, 2, var3); -- this.placeBlockAtCurrentPosition(var1, Block.stoneSingleSlab.blockID, 1, 1, 2, 2, var3); -- this.placeBlockAtCurrentPosition(var1, Block.stoneSingleSlab.blockID, 1, this.scatteredFeatureSizeX - 2, 2, 2, var3); -- this.placeBlockAtCurrentPosition(var1, Block.stairsSandStone.blockID, var7, 2, 1, 2, var3); -- this.placeBlockAtCurrentPosition(var1, Block.stairsSandStone.blockID, var6, this.scatteredFeatureSizeX - 3, 1, 2, var3); -- this.fillWithBlocks(var1, var3, 4, 3, 5, 4, 3, 18, Block.sandStone.blockID, Block.sandStone.blockID, false); -- this.fillWithBlocks(var1, var3, this.scatteredFeatureSizeX - 5, 3, 5, this.scatteredFeatureSizeX - 5, 3, 17, Block.sandStone.blockID, Block.sandStone.blockID, false); -- this.fillWithBlocks(var1, var3, 3, 1, 5, 4, 2, 16, 0, 0, false); -- this.fillWithBlocks(var1, var3, this.scatteredFeatureSizeX - 6, 1, 5, this.scatteredFeatureSizeX - 5, 2, 16, 0, 0, false); -- -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 0, 0, 0, 4, 9, 4, Block.sandStone.blockID, 0, false); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 1, 10, 1, 3, 10, 3, Block.sandStone.blockID, Block.sandStone.blockID, false); -+ this.placeBlockAtCurrentPosition(par1World, Block.stairsSandStone.blockID, var4, 2, 10, 0, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.stairsSandStone.blockID, var5, 2, 10, 4, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.stairsSandStone.blockID, var6, 0, 10, 2, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.stairsSandStone.blockID, var7, 4, 10, 2, par3StructureBoundingBox); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, this.scatteredFeatureSizeX - 5, 0, 0, this.scatteredFeatureSizeX - 1, 9, 4, Block.sandStone.blockID, 0, false); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, this.scatteredFeatureSizeX - 4, 10, 1, this.scatteredFeatureSizeX - 2, 10, 3, Block.sandStone.blockID, Block.sandStone.blockID, false); -+ this.placeBlockAtCurrentPosition(par1World, Block.stairsSandStone.blockID, var4, this.scatteredFeatureSizeX - 3, 10, 0, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.stairsSandStone.blockID, var5, this.scatteredFeatureSizeX - 3, 10, 4, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.stairsSandStone.blockID, var6, this.scatteredFeatureSizeX - 5, 10, 2, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.stairsSandStone.blockID, var7, this.scatteredFeatureSizeX - 1, 10, 2, par3StructureBoundingBox); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 8, 0, 0, 12, 4, 4, Block.sandStone.blockID, 0, false); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 9, 1, 0, 11, 3, 4, 0, 0, false); -+ this.placeBlockAtCurrentPosition(par1World, Block.sandStone.blockID, 2, 9, 1, 1, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.sandStone.blockID, 2, 9, 2, 1, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.sandStone.blockID, 2, 9, 3, 1, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.sandStone.blockID, 2, 10, 3, 1, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.sandStone.blockID, 2, 11, 3, 1, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.sandStone.blockID, 2, 11, 2, 1, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.sandStone.blockID, 2, 11, 1, 1, par3StructureBoundingBox); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 4, 1, 1, 8, 3, 3, Block.sandStone.blockID, 0, false); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 4, 1, 2, 8, 2, 2, 0, 0, false); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 12, 1, 1, 16, 3, 3, Block.sandStone.blockID, 0, false); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 12, 1, 2, 16, 2, 2, 0, 0, false); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 5, 4, 5, this.scatteredFeatureSizeX - 6, 4, this.scatteredFeatureSizeZ - 6, Block.sandStone.blockID, Block.sandStone.blockID, false); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 9, 4, 9, 11, 4, 11, 0, 0, false); -+ this.fillWithMetadataBlocks(par1World, par3StructureBoundingBox, 8, 1, 8, 8, 3, 8, Block.sandStone.blockID, 2, Block.sandStone.blockID, 2, false); -+ this.fillWithMetadataBlocks(par1World, par3StructureBoundingBox, 12, 1, 8, 12, 3, 8, Block.sandStone.blockID, 2, Block.sandStone.blockID, 2, false); -+ this.fillWithMetadataBlocks(par1World, par3StructureBoundingBox, 8, 1, 12, 8, 3, 12, Block.sandStone.blockID, 2, Block.sandStone.blockID, 2, false); -+ this.fillWithMetadataBlocks(par1World, par3StructureBoundingBox, 12, 1, 12, 12, 3, 12, Block.sandStone.blockID, 2, Block.sandStone.blockID, 2, false); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 1, 1, 5, 4, 4, 11, Block.sandStone.blockID, Block.sandStone.blockID, false); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, this.scatteredFeatureSizeX - 5, 1, 5, this.scatteredFeatureSizeX - 2, 4, 11, Block.sandStone.blockID, Block.sandStone.blockID, false); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 6, 7, 9, 6, 7, 11, Block.sandStone.blockID, Block.sandStone.blockID, false); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, this.scatteredFeatureSizeX - 7, 7, 9, this.scatteredFeatureSizeX - 7, 7, 11, Block.sandStone.blockID, Block.sandStone.blockID, false); -+ this.fillWithMetadataBlocks(par1World, par3StructureBoundingBox, 5, 5, 9, 5, 7, 11, Block.sandStone.blockID, 2, Block.sandStone.blockID, 2, false); -+ this.fillWithMetadataBlocks(par1World, par3StructureBoundingBox, this.scatteredFeatureSizeX - 6, 5, 9, this.scatteredFeatureSizeX - 6, 7, 11, Block.sandStone.blockID, 2, Block.sandStone.blockID, 2, false); -+ this.placeBlockAtCurrentPosition(par1World, 0, 0, 5, 5, 10, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, 0, 0, 5, 6, 10, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, 0, 0, 6, 6, 10, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, 0, 0, this.scatteredFeatureSizeX - 6, 5, 10, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, 0, 0, this.scatteredFeatureSizeX - 6, 6, 10, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, 0, 0, this.scatteredFeatureSizeX - 7, 6, 10, par3StructureBoundingBox); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 2, 4, 4, 2, 6, 4, 0, 0, false); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, this.scatteredFeatureSizeX - 3, 4, 4, this.scatteredFeatureSizeX - 3, 6, 4, 0, 0, false); -+ this.placeBlockAtCurrentPosition(par1World, Block.stairsSandStone.blockID, var4, 2, 4, 5, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.stairsSandStone.blockID, var4, 2, 3, 4, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.stairsSandStone.blockID, var4, this.scatteredFeatureSizeX - 3, 4, 5, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.stairsSandStone.blockID, var4, this.scatteredFeatureSizeX - 3, 3, 4, par3StructureBoundingBox); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 1, 1, 3, 2, 2, 3, Block.sandStone.blockID, Block.sandStone.blockID, false); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, this.scatteredFeatureSizeX - 3, 1, 3, this.scatteredFeatureSizeX - 2, 2, 3, Block.sandStone.blockID, Block.sandStone.blockID, false); -+ this.placeBlockAtCurrentPosition(par1World, Block.stairsSandStone.blockID, 0, 1, 1, 2, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.stairsSandStone.blockID, 0, this.scatteredFeatureSizeX - 2, 1, 2, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.stoneSingleSlab.blockID, 1, 1, 2, 2, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.stoneSingleSlab.blockID, 1, this.scatteredFeatureSizeX - 2, 2, 2, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.stairsSandStone.blockID, var7, 2, 1, 2, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.stairsSandStone.blockID, var6, this.scatteredFeatureSizeX - 3, 1, 2, par3StructureBoundingBox); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 4, 3, 5, 4, 3, 18, Block.sandStone.blockID, Block.sandStone.blockID, false); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, this.scatteredFeatureSizeX - 5, 3, 5, this.scatteredFeatureSizeX - 5, 3, 17, Block.sandStone.blockID, Block.sandStone.blockID, false); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 3, 1, 5, 4, 2, 16, 0, 0, false); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, this.scatteredFeatureSizeX - 6, 1, 5, this.scatteredFeatureSizeX - 5, 2, 16, 0, 0, false); - int var10; -- for(var10 = 5; var10 <= 17; var10 += 2) { -- this.placeBlockAtCurrentPosition(var1, Block.sandStone.blockID, 2, 4, 1, var10, var3); -- this.placeBlockAtCurrentPosition(var1, Block.sandStone.blockID, 1, 4, 2, var10, var3); -- this.placeBlockAtCurrentPosition(var1, Block.sandStone.blockID, 2, this.scatteredFeatureSizeX - 5, 1, var10, var3); -- this.placeBlockAtCurrentPosition(var1, Block.sandStone.blockID, 1, this.scatteredFeatureSizeX - 5, 2, var10, var3); -- } -- -- this.placeBlockAtCurrentPosition(var1, Block.cloth.blockID, var8, 10, 0, 7, var3); -- this.placeBlockAtCurrentPosition(var1, Block.cloth.blockID, var8, 10, 0, 8, var3); -- this.placeBlockAtCurrentPosition(var1, Block.cloth.blockID, var8, 9, 0, 9, var3); -- this.placeBlockAtCurrentPosition(var1, Block.cloth.blockID, var8, 11, 0, 9, var3); -- this.placeBlockAtCurrentPosition(var1, Block.cloth.blockID, var8, 8, 0, 10, var3); -- this.placeBlockAtCurrentPosition(var1, Block.cloth.blockID, var8, 12, 0, 10, var3); -- this.placeBlockAtCurrentPosition(var1, Block.cloth.blockID, var8, 7, 0, 10, var3); -- this.placeBlockAtCurrentPosition(var1, Block.cloth.blockID, var8, 13, 0, 10, var3); -- this.placeBlockAtCurrentPosition(var1, Block.cloth.blockID, var8, 9, 0, 11, var3); -- this.placeBlockAtCurrentPosition(var1, Block.cloth.blockID, var8, 11, 0, 11, var3); -- this.placeBlockAtCurrentPosition(var1, Block.cloth.blockID, var8, 10, 0, 12, var3); -- this.placeBlockAtCurrentPosition(var1, Block.cloth.blockID, var8, 10, 0, 13, var3); -- this.placeBlockAtCurrentPosition(var1, Block.cloth.blockID, var9, 10, 0, 10, var3); -- -- for(var10 = 0; var10 <= this.scatteredFeatureSizeX - 1; var10 += this.scatteredFeatureSizeX - 1) { -- this.placeBlockAtCurrentPosition(var1, Block.sandStone.blockID, 2, var10, 2, 1, var3); -- this.placeBlockAtCurrentPosition(var1, Block.cloth.blockID, var8, var10, 2, 2, var3); -- this.placeBlockAtCurrentPosition(var1, Block.sandStone.blockID, 2, var10, 2, 3, var3); -- this.placeBlockAtCurrentPosition(var1, Block.sandStone.blockID, 2, var10, 3, 1, var3); -- this.placeBlockAtCurrentPosition(var1, Block.cloth.blockID, var8, var10, 3, 2, var3); -- this.placeBlockAtCurrentPosition(var1, Block.sandStone.blockID, 2, var10, 3, 3, var3); -- this.placeBlockAtCurrentPosition(var1, Block.cloth.blockID, var8, var10, 4, 1, var3); -- this.placeBlockAtCurrentPosition(var1, Block.sandStone.blockID, 1, var10, 4, 2, var3); -- this.placeBlockAtCurrentPosition(var1, Block.cloth.blockID, var8, var10, 4, 3, var3); -- this.placeBlockAtCurrentPosition(var1, Block.sandStone.blockID, 2, var10, 5, 1, var3); -- this.placeBlockAtCurrentPosition(var1, Block.cloth.blockID, var8, var10, 5, 2, var3); -- this.placeBlockAtCurrentPosition(var1, Block.sandStone.blockID, 2, var10, 5, 3, var3); -- this.placeBlockAtCurrentPosition(var1, Block.cloth.blockID, var8, var10, 6, 1, var3); -- this.placeBlockAtCurrentPosition(var1, Block.sandStone.blockID, 1, var10, 6, 2, var3); -- this.placeBlockAtCurrentPosition(var1, Block.cloth.blockID, var8, var10, 6, 3, var3); -- this.placeBlockAtCurrentPosition(var1, Block.cloth.blockID, var8, var10, 7, 1, var3); -- this.placeBlockAtCurrentPosition(var1, Block.cloth.blockID, var8, var10, 7, 2, var3); -- this.placeBlockAtCurrentPosition(var1, Block.cloth.blockID, var8, var10, 7, 3, var3); -- this.placeBlockAtCurrentPosition(var1, Block.sandStone.blockID, 2, var10, 8, 1, var3); -- this.placeBlockAtCurrentPosition(var1, Block.sandStone.blockID, 2, var10, 8, 2, var3); -- this.placeBlockAtCurrentPosition(var1, Block.sandStone.blockID, 2, var10, 8, 3, var3); -- } -- -- for(var10 = 2; var10 <= this.scatteredFeatureSizeX - 3; var10 += this.scatteredFeatureSizeX - 3 - 2) { -- this.placeBlockAtCurrentPosition(var1, Block.sandStone.blockID, 2, var10 - 1, 2, 0, var3); -- this.placeBlockAtCurrentPosition(var1, Block.cloth.blockID, var8, var10, 2, 0, var3); -- this.placeBlockAtCurrentPosition(var1, Block.sandStone.blockID, 2, var10 + 1, 2, 0, var3); -- this.placeBlockAtCurrentPosition(var1, Block.sandStone.blockID, 2, var10 - 1, 3, 0, var3); -- this.placeBlockAtCurrentPosition(var1, Block.cloth.blockID, var8, var10, 3, 0, var3); -- this.placeBlockAtCurrentPosition(var1, Block.sandStone.blockID, 2, var10 + 1, 3, 0, var3); -- this.placeBlockAtCurrentPosition(var1, Block.cloth.blockID, var8, var10 - 1, 4, 0, var3); -- this.placeBlockAtCurrentPosition(var1, Block.sandStone.blockID, 1, var10, 4, 0, var3); -- this.placeBlockAtCurrentPosition(var1, Block.cloth.blockID, var8, var10 + 1, 4, 0, var3); -- this.placeBlockAtCurrentPosition(var1, Block.sandStone.blockID, 2, var10 - 1, 5, 0, var3); -- this.placeBlockAtCurrentPosition(var1, Block.cloth.blockID, var8, var10, 5, 0, var3); -- this.placeBlockAtCurrentPosition(var1, Block.sandStone.blockID, 2, var10 + 1, 5, 0, var3); -- this.placeBlockAtCurrentPosition(var1, Block.cloth.blockID, var8, var10 - 1, 6, 0, var3); -- this.placeBlockAtCurrentPosition(var1, Block.sandStone.blockID, 1, var10, 6, 0, var3); -- this.placeBlockAtCurrentPosition(var1, Block.cloth.blockID, var8, var10 + 1, 6, 0, var3); -- this.placeBlockAtCurrentPosition(var1, Block.cloth.blockID, var8, var10 - 1, 7, 0, var3); -- this.placeBlockAtCurrentPosition(var1, Block.cloth.blockID, var8, var10, 7, 0, var3); -- this.placeBlockAtCurrentPosition(var1, Block.cloth.blockID, var8, var10 + 1, 7, 0, var3); -- this.placeBlockAtCurrentPosition(var1, Block.sandStone.blockID, 2, var10 - 1, 8, 0, var3); -- this.placeBlockAtCurrentPosition(var1, Block.sandStone.blockID, 2, var10, 8, 0, var3); -- this.placeBlockAtCurrentPosition(var1, Block.sandStone.blockID, 2, var10 + 1, 8, 0, var3); -- } -- -- this.fillWithMetadataBlocks(var1, var3, 8, 4, 0, 12, 6, 0, Block.sandStone.blockID, 2, Block.sandStone.blockID, 2, false); -- this.placeBlockAtCurrentPosition(var1, 0, 0, 8, 6, 0, var3); -- this.placeBlockAtCurrentPosition(var1, 0, 0, 12, 6, 0, var3); -- this.placeBlockAtCurrentPosition(var1, Block.cloth.blockID, var8, 9, 5, 0, var3); -- this.placeBlockAtCurrentPosition(var1, Block.sandStone.blockID, 1, 10, 5, 0, var3); -- this.placeBlockAtCurrentPosition(var1, Block.cloth.blockID, var8, 11, 5, 0, var3); -- this.fillWithMetadataBlocks(var1, var3, 8, -14, 8, 12, -11, 12, Block.sandStone.blockID, 2, Block.sandStone.blockID, 2, false); -- this.fillWithMetadataBlocks(var1, var3, 8, -10, 8, 12, -10, 12, Block.sandStone.blockID, 1, Block.sandStone.blockID, 1, false); -- this.fillWithMetadataBlocks(var1, var3, 8, -9, 8, 12, -9, 12, Block.sandStone.blockID, 2, Block.sandStone.blockID, 2, false); -- this.fillWithBlocks(var1, var3, 8, -8, 8, 12, -1, 12, Block.sandStone.blockID, Block.sandStone.blockID, false); -- this.fillWithBlocks(var1, var3, 9, -11, 9, 11, -1, 11, 0, 0, false); -- this.placeBlockAtCurrentPosition(var1, Block.pressurePlateStone.blockID, 0, 10, -11, 10, var3); -- this.fillWithBlocks(var1, var3, 9, -13, 9, 11, -13, 11, Block.tnt.blockID, 0, false); -- this.placeBlockAtCurrentPosition(var1, 0, 0, 8, -11, 10, var3); -- this.placeBlockAtCurrentPosition(var1, 0, 0, 8, -10, 10, var3); -- this.placeBlockAtCurrentPosition(var1, Block.sandStone.blockID, 1, 7, -10, 10, var3); -- this.placeBlockAtCurrentPosition(var1, Block.sandStone.blockID, 2, 7, -11, 10, var3); -- this.placeBlockAtCurrentPosition(var1, 0, 0, 12, -11, 10, var3); -- this.placeBlockAtCurrentPosition(var1, 0, 0, 12, -10, 10, var3); -- this.placeBlockAtCurrentPosition(var1, Block.sandStone.blockID, 1, 13, -10, 10, var3); -- this.placeBlockAtCurrentPosition(var1, Block.sandStone.blockID, 2, 13, -11, 10, var3); -- this.placeBlockAtCurrentPosition(var1, 0, 0, 10, -11, 8, var3); -- this.placeBlockAtCurrentPosition(var1, 0, 0, 10, -10, 8, var3); -- this.placeBlockAtCurrentPosition(var1, Block.sandStone.blockID, 1, 10, -10, 7, var3); -- this.placeBlockAtCurrentPosition(var1, Block.sandStone.blockID, 2, 10, -11, 7, var3); -- this.placeBlockAtCurrentPosition(var1, 0, 0, 10, -11, 12, var3); -- this.placeBlockAtCurrentPosition(var1, 0, 0, 10, -10, 12, var3); -- this.placeBlockAtCurrentPosition(var1, Block.sandStone.blockID, 1, 10, -10, 13, var3); -- this.placeBlockAtCurrentPosition(var1, Block.sandStone.blockID, 2, 10, -11, 13, var3); -- -- for(var10 = 0; var10 < 4; ++var10) { -- if(!this.field_74940_h[var10]) { -+ -+ for (var10 = 5; var10 <= 17; var10 += 2) { -+ this.placeBlockAtCurrentPosition(par1World, Block.sandStone.blockID, 2, 4, 1, var10, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.sandStone.blockID, 1, 4, 2, var10, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.sandStone.blockID, 2, this.scatteredFeatureSizeX - 5, 1, var10, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.sandStone.blockID, 1, this.scatteredFeatureSizeX - 5, 2, var10, par3StructureBoundingBox); -+ } -+ -+ this.placeBlockAtCurrentPosition(par1World, Block.cloth.blockID, var8, 10, 0, 7, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.cloth.blockID, var8, 10, 0, 8, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.cloth.blockID, var8, 9, 0, 9, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.cloth.blockID, var8, 11, 0, 9, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.cloth.blockID, var8, 8, 0, 10, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.cloth.blockID, var8, 12, 0, 10, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.cloth.blockID, var8, 7, 0, 10, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.cloth.blockID, var8, 13, 0, 10, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.cloth.blockID, var8, 9, 0, 11, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.cloth.blockID, var8, 11, 0, 11, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.cloth.blockID, var8, 10, 0, 12, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.cloth.blockID, var8, 10, 0, 13, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.cloth.blockID, var9, 10, 0, 10, par3StructureBoundingBox); -+ -+ for (var10 = 0; var10 <= this.scatteredFeatureSizeX - 1; var10 += this.scatteredFeatureSizeX - 1) { -+ this.placeBlockAtCurrentPosition(par1World, Block.sandStone.blockID, 2, var10, 2, 1, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.cloth.blockID, var8, var10, 2, 2, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.sandStone.blockID, 2, var10, 2, 3, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.sandStone.blockID, 2, var10, 3, 1, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.cloth.blockID, var8, var10, 3, 2, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.sandStone.blockID, 2, var10, 3, 3, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.cloth.blockID, var8, var10, 4, 1, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.sandStone.blockID, 1, var10, 4, 2, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.cloth.blockID, var8, var10, 4, 3, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.sandStone.blockID, 2, var10, 5, 1, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.cloth.blockID, var8, var10, 5, 2, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.sandStone.blockID, 2, var10, 5, 3, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.cloth.blockID, var8, var10, 6, 1, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.sandStone.blockID, 1, var10, 6, 2, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.cloth.blockID, var8, var10, 6, 3, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.cloth.blockID, var8, var10, 7, 1, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.cloth.blockID, var8, var10, 7, 2, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.cloth.blockID, var8, var10, 7, 3, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.sandStone.blockID, 2, var10, 8, 1, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.sandStone.blockID, 2, var10, 8, 2, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.sandStone.blockID, 2, var10, 8, 3, par3StructureBoundingBox); -+ } -+ -+ for (var10 = 2; var10 <= this.scatteredFeatureSizeX - 3; var10 += this.scatteredFeatureSizeX - 3 - 2) { -+ this.placeBlockAtCurrentPosition(par1World, Block.sandStone.blockID, 2, var10 - 1, 2, 0, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.cloth.blockID, var8, var10, 2, 0, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.sandStone.blockID, 2, var10 + 1, 2, 0, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.sandStone.blockID, 2, var10 - 1, 3, 0, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.cloth.blockID, var8, var10, 3, 0, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.sandStone.blockID, 2, var10 + 1, 3, 0, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.cloth.blockID, var8, var10 - 1, 4, 0, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.sandStone.blockID, 1, var10, 4, 0, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.cloth.blockID, var8, var10 + 1, 4, 0, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.sandStone.blockID, 2, var10 - 1, 5, 0, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.cloth.blockID, var8, var10, 5, 0, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.sandStone.blockID, 2, var10 + 1, 5, 0, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.cloth.blockID, var8, var10 - 1, 6, 0, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.sandStone.blockID, 1, var10, 6, 0, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.cloth.blockID, var8, var10 + 1, 6, 0, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.cloth.blockID, var8, var10 - 1, 7, 0, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.cloth.blockID, var8, var10, 7, 0, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.cloth.blockID, var8, var10 + 1, 7, 0, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.sandStone.blockID, 2, var10 - 1, 8, 0, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.sandStone.blockID, 2, var10, 8, 0, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.sandStone.blockID, 2, var10 + 1, 8, 0, par3StructureBoundingBox); -+ } -+ -+ this.fillWithMetadataBlocks(par1World, par3StructureBoundingBox, 8, 4, 0, 12, 6, 0, Block.sandStone.blockID, 2, Block.sandStone.blockID, 2, false); -+ this.placeBlockAtCurrentPosition(par1World, 0, 0, 8, 6, 0, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, 0, 0, 12, 6, 0, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.cloth.blockID, var8, 9, 5, 0, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.sandStone.blockID, 1, 10, 5, 0, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.cloth.blockID, var8, 11, 5, 0, par3StructureBoundingBox); -+ this.fillWithMetadataBlocks(par1World, par3StructureBoundingBox, 8, -14, 8, 12, -11, 12, Block.sandStone.blockID, 2, Block.sandStone.blockID, 2, false); -+ this.fillWithMetadataBlocks(par1World, par3StructureBoundingBox, 8, -10, 8, 12, -10, 12, Block.sandStone.blockID, 1, Block.sandStone.blockID, 1, false); -+ this.fillWithMetadataBlocks(par1World, par3StructureBoundingBox, 8, -9, 8, 12, -9, 12, Block.sandStone.blockID, 2, Block.sandStone.blockID, 2, false); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 8, -8, 8, 12, -1, 12, Block.sandStone.blockID, Block.sandStone.blockID, false); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 9, -11, 9, 11, -1, 11, 0, 0, false); -+ this.placeBlockAtCurrentPosition(par1World, Block.pressurePlateStone.blockID, 0, 10, -11, 10, par3StructureBoundingBox); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 9, -13, 9, 11, -13, 11, Block.tnt.blockID, 0, false); -+ this.placeBlockAtCurrentPosition(par1World, 0, 0, 8, -11, 10, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, 0, 0, 8, -10, 10, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.sandStone.blockID, 1, 7, -10, 10, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.sandStone.blockID, 2, 7, -11, 10, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, 0, 0, 12, -11, 10, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, 0, 0, 12, -10, 10, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.sandStone.blockID, 1, 13, -10, 10, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.sandStone.blockID, 2, 13, -11, 10, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, 0, 0, 10, -11, 8, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, 0, 0, 10, -10, 8, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.sandStone.blockID, 1, 10, -10, 7, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.sandStone.blockID, 2, 10, -11, 7, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, 0, 0, 10, -11, 12, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, 0, 0, 10, -10, 12, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.sandStone.blockID, 1, 10, -10, 13, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.sandStone.blockID, 2, 10, -11, 13, par3StructureBoundingBox); -+ -+ for (var10 = 0; var10 < 4; ++var10) { -+ if (!this.field_74940_h[var10]) { - int var11 = Direction.offsetX[var10] * 2; - int var12 = Direction.offsetZ[var10] * 2; -- this.field_74940_h[var10] = this.generateStructureChestContents(var1, var3, var2, 10 + var11, -11, 10 + var12, WeightedRandomChestContent.func_92080_a(itemsToGenerateInTemple, new WeightedRandomChestContent[]{Item.enchantedBook.func_92114_b(var2)}), 2 + var2.nextInt(5)); -+ this.field_74940_h[var10] = this.generateStructureChestContents(par1World, par3StructureBoundingBox, par2Random, 10 + var11, -11, 10 + var12, WeightedRandomChestContent.func_92080_a(itemsToGenerateInTemple, new WeightedRandomChestContent[] {Item.enchantedBook.func_92114_b(par2Random)}), 2 + par2Random.nextInt(5)); - } - } - ---- /dev/null -+++ org/spoutcraft/client/packet/PacketChunkRefresh.java -@@ -1,0 +1,66 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.client.packet; -+ -+import java.io.IOException; -+ -+import org.spoutcraft.api.io.SpoutInputStream; -+import org.spoutcraft.api.io.SpoutOutputStream; -+ -+public class PacketChunkRefresh implements SpoutPacket { -+ private int cx; -+ private int cz; -+ -+ public PacketChunkRefresh() { -+ } -+ -+ public PacketChunkRefresh(int cx, int cz) { -+ this.cx = cx; -+ this.cz = cz; -+ } -+ -+ public int getNumBytes() { -+ return 8; -+ } -+ -+ public void readData(SpoutInputStream input) throws IOException { -+ this.cx = input.readInt(); -+ this.cz = input.readInt(); -+ } -+ -+ public void writeData(SpoutOutputStream output) throws IOException { -+ output.writeInt(this.cx); -+ output.writeInt(this.cz); -+ } -+ -+ public void run(int id) { -+ } -+ -+ public PacketType getPacketType() { -+ return PacketType.PacketChunkRefresh; -+ } -+ -+ public int getVersion() { -+ return 0; -+ } -+ -+ public void failure(int playerId) { -+ } -+} ---- net/minecraft/src/RedstoneUpdateInfo.java -+++ net/minecraft/src/RedstoneUpdateInfo.java -@@ -6,10 +6,10 @@ - int z; - long updateTime; - -- public RedstoneUpdateInfo(int var1, int var2, int var3, long var4) { -- this.x = var1; -- this.y = var2; -- this.z = var3; -- this.updateTime = var4; -+ public RedstoneUpdateInfo(int par1, int par2, int par3, long par4) { -+ this.x = par1; -+ this.y = par2; -+ this.z = par3; -+ this.updateTime = par4; - } - } ---- net/minecraft/src/ServerConfigurationManager.java -+++ net/minecraft/src/ServerConfigurationManager.java -@@ -15,411 +15,497 @@ - import net.minecraft.server.MinecraftServer; - - public abstract class ServerConfigurationManager { -- private static final SimpleDateFormat d = new SimpleDateFormat("yyyy-MM-dd \'at\' HH:mm:ss z"); -- private final MinecraftServer e; -- public final List a = new ArrayList(); -+ private static final SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd \'at\' HH:mm:ss z"); -+ -+ /** Reference to the MinecraftServer object. */ -+ private final MinecraftServer mcServer; -+ -+ /** A list of player entities that exist on this server. */ -+ public final List playerEntityList = new ArrayList(); - private final BanList bannedPlayers = new BanList(new File("banned-players.txt")); - private final BanList bannedIPs = new BanList(new File("banned-ips.txt")); -- private Set h = new HashSet(); -- private Set i = new HashSet(); -+ -+ /** A set containing the OPs. */ -+ private Set ops = new HashSet(); -+ -+ /** The Set of all whitelisted players. */ -+ private Set whiteListedPlayers = new HashSet(); -+ -+ /** Reference to the PlayerNBTManager object. */ - private IPlayerFileData playerNBTManagerObj; -+ -+ /** -+ * Server setting to only allow OPs and whitelisted players to join the server. -+ */ - private boolean whiteListEnforced; -+ -+ /** The maximum number of players that can be connected at a time. */ - protected int maxPlayers; - protected int viewDistance; - private EnumGameType gameType; -+ -+ /** True if all players are allowed to use commands (cheats). */ - private boolean commandsAllowedForAll; -+ -+ /** -+ * index into playerEntities of player to ping, updated every tick; currently hardcoded to max at 200 players -+ */ - private int playerPingIndex; - -- public ServerConfigurationManager(MinecraftServer var1) { -- this.e = var1; -+ public ServerConfigurationManager(MinecraftServer par1MinecraftServer) { -+ this.mcServer = par1MinecraftServer; - this.bannedPlayers.setListActive(false); - this.bannedIPs.setListActive(false); - this.maxPlayers = 8; - } - -- public void initializeConnectionToPlayer(INetworkManager var1, EntityPlayerMP var2) { -- NBTTagCompound var3 = this.readPlayerDataFromFile(var2); -- var2.setWorld(this.e.worldServerForDimension(var2.dimension)); -- var2.theItemInWorldManager.setWorld((WorldServer)var2.worldObj); -+ public void initializeConnectionToPlayer(INetworkManager par1INetworkManager, EntityPlayerMP par2EntityPlayerMP) { -+ NBTTagCompound var3 = this.readPlayerDataFromFile(par2EntityPlayerMP); -+ par2EntityPlayerMP.setWorld(this.mcServer.worldServerForDimension(par2EntityPlayerMP.dimension)); -+ par2EntityPlayerMP.theItemInWorldManager.setWorld((WorldServer)par2EntityPlayerMP.worldObj); - String var4 = "local"; -- if(var1.getRemoteAddress() != null) { -- var4 = var1.getRemoteAddress().toString(); -+ -+ if (par1INetworkManager.getSocketAddress() != null) { -+ var4 = par1INetworkManager.getSocketAddress().toString(); - } - -- this.e.getLogAgent().logInfo(var2.getCommandSenderName() + "[" + var4 + "] logged in with entity id " + var2.entityId + " at (" + var2.posX + ", " + var2.posY + ", " + var2.posZ + ")"); -- WorldServer var5 = this.e.worldServerForDimension(var2.dimension); -+ this.mcServer.getLogAgent().logInfo(par2EntityPlayerMP.getCommandSenderName() + "[" + var4 + "] logged in with entity id " + par2EntityPlayerMP.entityId + " at (" + par2EntityPlayerMP.posX + ", " + par2EntityPlayerMP.posY + ", " + par2EntityPlayerMP.posZ + ")"); -+ WorldServer var5 = this.mcServer.worldServerForDimension(par2EntityPlayerMP.dimension); - ChunkCoordinates var6 = var5.getSpawnPoint(); -- this.func_72381_a(var2, (EntityPlayerMP)null, var5); -- NetServerHandler var7 = new NetServerHandler(this.e, var1, var2); -- var7.sendPacket(new Packet1Login(var2.entityId, var5.getWorldInfo().getTerrainType(), var2.theItemInWorldManager.getGameType(), var5.getWorldInfo().isHardcoreModeEnabled(), var5.provider.dimensionId, var5.difficultySetting, var5.getHeight(), this.getMaxPlayers())); -- var7.sendPacket(new Packet250CustomPayload("MC|Brand", this.getServerInstance().getServerModName().getBytes(Charsets.UTF_8))); -- var7.sendPacket(new Packet6SpawnPosition(var6.posX, var6.posY, var6.posZ)); -- var7.sendPacket(new Packet202PlayerAbilities(var2.capabilities)); -- var7.sendPacket(new Packet16BlockItemSwitch(var2.inventory.currentItem)); -- this.func_96456_a((ServerScoreboard)var5.getScoreboard(), var2); -- this.updateTimeAndWeatherForPlayer(var2, var5); -- this.sendChatMsg(ChatMessageComponent.createFromTranslationWithSubstitutions("multiplayer.player.joined", new Object[]{var2.getTranslatedEntityName()}).setColor(EnumChatFormatting.YELLOW)); -- this.playerLoggedIn(var2); -- var7.setPlayerLocation(var2.posX, var2.posY, var2.posZ, var2.rotationYaw, var2.rotationPitch); -- this.e.getNetworkThread().addPlayer(var7); -- var7.sendPacket(new Packet4UpdateTime(var5.getTotalWorldTime(), var5.getWorldTime(), var5.getGameRules().getGameRuleBooleanValue("doDaylightCycle"))); -- if(this.e.getTexturePack().length() > 0) { -- var2.requestTexturePackLoad(this.e.getTexturePack(), this.e.textureSize()); -+ this.func_72381_a(par2EntityPlayerMP, (EntityPlayerMP)null, var5); -+ NetServerHandler var7 = new NetServerHandler(this.mcServer, par1INetworkManager, par2EntityPlayerMP); -+ var7.sendPacketToPlayer(new Packet1Login(par2EntityPlayerMP.entityId, var5.getWorldInfo().getTerrainType(), par2EntityPlayerMP.theItemInWorldManager.getGameType(), var5.getWorldInfo().isHardcoreModeEnabled(), var5.provider.dimensionId, var5.difficultySetting, var5.getHeight(), this.getMaxPlayers())); -+ var7.sendPacketToPlayer(new Packet250CustomPayload("MC|Brand", this.getServerInstance().getServerModName().getBytes(Charsets.UTF_8))); -+ var7.sendPacketToPlayer(new Packet6SpawnPosition(var6.posX, var6.posY, var6.posZ)); -+ var7.sendPacketToPlayer(new Packet202PlayerAbilities(par2EntityPlayerMP.capabilities)); -+ var7.sendPacketToPlayer(new Packet16BlockItemSwitch(par2EntityPlayerMP.inventory.currentItem)); -+ this.func_96456_a((ServerScoreboard)var5.getScoreboard(), par2EntityPlayerMP); -+ this.updateTimeAndWeatherForPlayer(par2EntityPlayerMP, var5); -+ this.sendChatMsg(ChatMessageComponent.createFromTranslationWithSubstitutions("multiplayer.player.joined", new Object[] {par2EntityPlayerMP.getTranslatedEntityName()}).setColor(EnumChatFormatting.YELLOW)); -+ this.playerLoggedIn(par2EntityPlayerMP); -+ var7.setPlayerLocation(par2EntityPlayerMP.posX, par2EntityPlayerMP.posY, par2EntityPlayerMP.posZ, par2EntityPlayerMP.rotationYaw, par2EntityPlayerMP.rotationPitch); -+ this.mcServer.getNetworkThread().addPlayer(var7); -+ var7.sendPacketToPlayer(new Packet4UpdateTime(var5.getTotalWorldTime(), var5.getWorldTime(), var5.getGameRules().getGameRuleBooleanValue("doDaylightCycle"))); -+ -+ if (this.mcServer.getTexturePack().length() > 0) { -+ par2EntityPlayerMP.requestTexturePackLoad(this.mcServer.getTexturePack(), this.mcServer.textureSize()); - } - -- Iterator var8 = var2.getActivePotionEffects().iterator(); -+ Iterator var8 = par2EntityPlayerMP.getActivePotionEffects().iterator(); - -- while(var8.hasNext()) { -+ while (var8.hasNext()) { - PotionEffect var9 = (PotionEffect)var8.next(); -- var7.sendPacket(new Packet41EntityEffect(var2.entityId, var9)); -+ var7.sendPacketToPlayer(new Packet41EntityEffect(par2EntityPlayerMP.entityId, var9)); - } - -- var2.addSelfToInternalCraftingInventory(); -- if(var3 != null && var3.hasKey("Riding")) { -+ par2EntityPlayerMP.addSelfToInternalCraftingInventory(); -+ -+ if (var3 != null && var3.hasKey("Riding")) { - Entity var10 = EntityList.createEntityFromNBT(var3.getCompoundTag("Riding"), var5); -- if(var10 != null) { -+ -+ if (var10 != null) { - var10.forceSpawn = true; - var5.spawnEntityInWorld(var10); -- var2.mountEntity(var10); -+ par2EntityPlayerMP.mountEntity(var10); - var10.forceSpawn = false; - } - } -- - } - -- protected void func_96456_a(ServerScoreboard var1, EntityPlayerMP var2) { -+ protected void func_96456_a(ServerScoreboard par1ServerScoreboard, EntityPlayerMP par2EntityPlayerMP) { - HashSet var3 = new HashSet(); -- Iterator var4 = var1.func_96525_g().iterator(); -+ Iterator var4 = par1ServerScoreboard.func_96525_g().iterator(); - -- while(var4.hasNext()) { -+ while (var4.hasNext()) { - ScorePlayerTeam var5 = (ScorePlayerTeam)var4.next(); -- var2.playerNetServerHandler.sendPacket(new Packet209SetPlayerTeam(var5, 0)); -+ par2EntityPlayerMP.playerNetServerHandler.sendPacketToPlayer(new Packet209SetPlayerTeam(var5, 0)); - } - -- for(int var9 = 0; var9 < 3; ++var9) { -- ScoreObjective var10 = var1.func_96539_a(var9); -- if(var10 != null && !var3.contains(var10)) { -- List var6 = var1.func_96550_d(var10); -+ for (int var9 = 0; var9 < 3; ++var9) { -+ ScoreObjective var10 = par1ServerScoreboard.func_96539_a(var9); -+ -+ if (var10 != null && !var3.contains(var10)) { -+ List var6 = par1ServerScoreboard.func_96550_d(var10); - Iterator var7 = var6.iterator(); - -- while(var7.hasNext()) { -+ while (var7.hasNext()) { - Packet var8 = (Packet)var7.next(); -- var2.playerNetServerHandler.sendPacket(var8); -+ par2EntityPlayerMP.playerNetServerHandler.sendPacketToPlayer(var8); - } - - var3.add(var10); - } - } -- -- } -- -- public void setPlayerManager(WorldServer[] var1) { -- this.playerNBTManagerObj = var1[0].getSaveHandler().getPlayerNBTManager(); -- } -- -- public void func_72375_a(EntityPlayerMP var1, WorldServer var2) { -- WorldServer var3 = var1.getServerForPlayer(); -- if(var2 != null) { -- var2.getPlayerManager().removePlayer(var1); -+ } -+ -+ /** -+ * Sets the NBT manager to the one for the WorldServer given. -+ */ -+ public void setPlayerManager(WorldServer[] par1ArrayOfWorldServer) { -+ this.playerNBTManagerObj = par1ArrayOfWorldServer[0].getSaveHandler().getSaveHandler(); -+ } -+ -+ public void func_72375_a(EntityPlayerMP par1EntityPlayerMP, WorldServer par2WorldServer) { -+ WorldServer var3 = par1EntityPlayerMP.getServerForPlayer(); -+ -+ if (par2WorldServer != null) { -+ par2WorldServer.getPlayerManager().removePlayer(par1EntityPlayerMP); - } - -- var3.getPlayerManager().addPlayer(var1); -- var3.theChunkProviderServer.loadChunk((int)var1.posX >> 4, (int)var1.posZ >> 4); -+ var3.getPlayerManager().addPlayer(par1EntityPlayerMP); -+ var3.theChunkProviderServer.loadChunk((int)par1EntityPlayerMP.posX >> 4, (int)par1EntityPlayerMP.posZ >> 4); - } - - public int getEntityViewDistance() { - return PlayerManager.getFurthestViewableBlock(this.getViewDistance()); - } - -- public NBTTagCompound readPlayerDataFromFile(EntityPlayerMP var1) { -- NBTTagCompound var2 = this.e.worldServers[0].getWorldInfo().getPlayerNBTTagCompound(); -+ /** -+ * called during player login. reads the player information from disk. -+ */ -+ public NBTTagCompound readPlayerDataFromFile(EntityPlayerMP par1EntityPlayerMP) { -+ NBTTagCompound var2 = this.mcServer.worldServers[0].getWorldInfo().getPlayerNBTTagCompound(); - NBTTagCompound var3; -- if(var1.getCommandSenderName().equals(this.e.getServerOwner()) && var2 != null) { -- var1.readFromNBT(var2); -+ -+ if (par1EntityPlayerMP.getCommandSenderName().equals(this.mcServer.getServerOwner()) && var2 != null) { -+ par1EntityPlayerMP.readFromNBT(var2); - var3 = var2; - System.out.println("loading single player"); - } else { -- var3 = this.playerNBTManagerObj.readPlayerData(var1); -+ var3 = this.playerNBTManagerObj.readPlayerData(par1EntityPlayerMP); - } - - return var3; - } - -- protected void writePlayerData(EntityPlayerMP var1) { -- this.playerNBTManagerObj.writePlayerData(var1); -+ /** -+ * also stores the NBTTags if this is an intergratedPlayerList -+ */ -+ protected void writePlayerData(EntityPlayerMP par1EntityPlayerMP) { -+ this.playerNBTManagerObj.writePlayerData(par1EntityPlayerMP); - } - -- public void playerLoggedIn(EntityPlayerMP var1) { -- this.sendPacketToAllPlayers(new Packet201PlayerInfo(var1.getCommandSenderName(), true, 1000)); -- this.a.add(var1); -- WorldServer var2 = this.e.worldServerForDimension(var1.dimension); -- var2.spawnEntityInWorld(var1); -- this.func_72375_a(var1, (WorldServer)null); -+ /** -+ * Called when a player successfully logs in. Reads player data from disk and inserts the player into the world. -+ */ -+ public void playerLoggedIn(EntityPlayerMP par1EntityPlayerMP) { -+ this.sendPacketToAllPlayers(new Packet201PlayerInfo(par1EntityPlayerMP.getCommandSenderName(), true, 1000)); -+ this.playerEntityList.add(par1EntityPlayerMP); -+ WorldServer var2 = this.mcServer.worldServerForDimension(par1EntityPlayerMP.dimension); -+ var2.spawnEntityInWorld(par1EntityPlayerMP); -+ this.func_72375_a(par1EntityPlayerMP, (WorldServer)null); - -- for(int var3 = 0; var3 < this.a.size(); ++var3) { -- EntityPlayerMP var4 = (EntityPlayerMP)this.a.get(var3); -- var1.playerNetServerHandler.sendPacket(new Packet201PlayerInfo(var4.getCommandSenderName(), true, var4.ping)); -+ for (int var3 = 0; var3 < this.playerEntityList.size(); ++var3) { -+ EntityPlayerMP var4 = (EntityPlayerMP)this.playerEntityList.get(var3); -+ par1EntityPlayerMP.playerNetServerHandler.sendPacketToPlayer(new Packet201PlayerInfo(var4.getCommandSenderName(), true, var4.ping)); - } -- -- } -- -- public void serverUpdateMountedMovingPlayer(EntityPlayerMP var1) { -- var1.getServerForPlayer().getPlayerManager().updateMountedMovingPlayer(var1); -- } -- -- public void playerLoggedOut(EntityPlayerMP var1) { -- this.writePlayerData(var1); -- WorldServer var2 = var1.getServerForPlayer(); -- if(var1.ridingEntity != null) { -- var2.removePlayerEntityDangerously(var1.ridingEntity); -+ } -+ -+ /** -+ * using player's dimension, update their movement when in a vehicle (e.g. cart, boat) -+ */ -+ public void serverUpdateMountedMovingPlayer(EntityPlayerMP par1EntityPlayerMP) { -+ par1EntityPlayerMP.getServerForPlayer().getPlayerManager().updateMountedMovingPlayer(par1EntityPlayerMP); -+ } -+ -+ /** -+ * Called when a player disconnects from the game. Writes player data to disk and removes them from the world. -+ */ -+ public void playerLoggedOut(EntityPlayerMP par1EntityPlayerMP) { -+ this.writePlayerData(par1EntityPlayerMP); -+ WorldServer var2 = par1EntityPlayerMP.getServerForPlayer(); -+ -+ if (par1EntityPlayerMP.ridingEntity != null) { -+ var2.removePlayerEntityDangerously(par1EntityPlayerMP.ridingEntity); - System.out.println("removing player mount"); - } - -- var2.removeEntity(var1); -- var2.getPlayerManager().removePlayer(var1); -- this.a.remove(var1); -- this.sendPacketToAllPlayers(new Packet201PlayerInfo(var1.getCommandSenderName(), false, 9999)); -+ var2.removeEntity(par1EntityPlayerMP); -+ var2.getPlayerManager().removePlayer(par1EntityPlayerMP); -+ this.playerEntityList.remove(par1EntityPlayerMP); -+ this.sendPacketToAllPlayers(new Packet201PlayerInfo(par1EntityPlayerMP.getCommandSenderName(), false, 9999)); - } - -- public String allowUserToConnect(SocketAddress var1, String var2) { -- if(this.bannedPlayers.isBanned(var2)) { -- BanEntry var6 = (BanEntry)this.bannedPlayers.getBannedList().get(var2); -+ /** -+ * checks ban-lists, then white-lists, then space for the server. Returns null on success, or an error message -+ */ -+ public String allowUserToConnect(SocketAddress par1SocketAddress, String par2Str) { -+ if (this.bannedPlayers.isBanned(par2Str)) { -+ BanEntry var6 = (BanEntry)this.bannedPlayers.getBannedList().get(par2Str); - String var7 = "You are banned from this server!\nReason: " + var6.getBanReason(); -- if(var6.getBanEndDate() != null) { -- var7 = var7 + "\nYour ban will be removed on " + d.format(var6.getBanEndDate()); -+ -+ if (var6.getBanEndDate() != null) { -+ var7 = var7 + "\nYour ban will be removed on " + dateFormat.format(var6.getBanEndDate()); - } - - return var7; -- } else if(!this.isAllowedToLogin(var2)) { -+ } else if (!this.isAllowedToLogin(par2Str)) { - return "You are not white-listed on this server!"; - } else { -- String var3 = var1.toString(); -+ String var3 = par1SocketAddress.toString(); - var3 = var3.substring(var3.indexOf("/") + 1); - var3 = var3.substring(0, var3.indexOf(":")); -- if(this.bannedIPs.isBanned(var3)) { -+ -+ if (this.bannedIPs.isBanned(var3)) { - BanEntry var4 = (BanEntry)this.bannedIPs.getBannedList().get(var3); - String var5 = "Your IP address is banned from this server!\nReason: " + var4.getBanReason(); -- if(var4.getBanEndDate() != null) { -- var5 = var5 + "\nYour ban will be removed on " + d.format(var4.getBanEndDate()); -+ -+ if (var4.getBanEndDate() != null) { -+ var5 = var5 + "\nYour ban will be removed on " + dateFormat.format(var4.getBanEndDate()); - } - - return var5; - } else { -- return this.a.size() >= this.maxPlayers ? "The server is full!" : null; -+ return this.playerEntityList.size() >= this.maxPlayers ? "The server is full!" : null; - } - } - } - -- public EntityPlayerMP createPlayerForUser(String var1) { -+ /** -+ * also checks for multiple logins -+ */ -+ public EntityPlayerMP createPlayerForUser(String par1Str) { - ArrayList var2 = new ArrayList(); -- - EntityPlayerMP var4; -- for(int var3 = 0; var3 < this.a.size(); ++var3) { -- var4 = (EntityPlayerMP)this.a.get(var3); -- if(var4.getCommandSenderName().equalsIgnoreCase(var1)) { -+ -+ for (int var3 = 0; var3 < this.playerEntityList.size(); ++var3) { -+ var4 = (EntityPlayerMP)this.playerEntityList.get(var3); -+ -+ if (var4.getCommandSenderName().equalsIgnoreCase(par1Str)) { - var2.add(var4); - } - } - - Iterator var5 = var2.iterator(); - -- while(var5.hasNext()) { -+ while (var5.hasNext()) { - var4 = (EntityPlayerMP)var5.next(); -- var4.playerNetServerHandler.kickPlayer("You logged in from another location"); -+ var4.playerNetServerHandler.kickPlayerFromServer("You logged in from another location"); - } - - Object var6; -- if(this.e.isDemo()) { -- var6 = new DemoWorldManager(this.e.worldServerForDimension(0)); -+ -+ if (this.mcServer.isDemo()) { -+ var6 = new DemoWorldManager(this.mcServer.worldServerForDimension(0)); - } else { -- var6 = new ItemInWorldManager(this.e.worldServerForDimension(0)); -+ var6 = new ItemInWorldManager(this.mcServer.worldServerForDimension(0)); - } - -- return new EntityPlayerMP(this.e, this.e.worldServerForDimension(0), var1, (ItemInWorldManager)var6); -+ return new EntityPlayerMP(this.mcServer, this.mcServer.worldServerForDimension(0), par1Str, (ItemInWorldManager)var6); - } - -- public EntityPlayerMP recreatePlayerEntity(EntityPlayerMP var1, int var2, boolean var3) { -- var1.getServerForPlayer().getEntityTracker().removePlayerFromTrackers(var1); -- var1.getServerForPlayer().getEntityTracker().untrackEntity(var1); -- var1.getServerForPlayer().getPlayerManager().removePlayer(var1); -- this.a.remove(var1); -- this.e.worldServerForDimension(var1.dimension).removePlayerEntityDangerously(var1); -- ChunkCoordinates var4 = var1.getBedLocation(); -- boolean var5 = var1.isSpawnForced(); -- var1.dimension = var2; -+ /** -+ * creates and returns a respawned player based on the provided PlayerEntity. Args are the PlayerEntityMP to respawn, -+ * an INT for the dimension to respawn into (usually 0), and a boolean value that is true if the player beat the game -+ * rather than dying -+ */ -+ public EntityPlayerMP respawnPlayer(EntityPlayerMP par1EntityPlayerMP, int par2, boolean par3) { -+ par1EntityPlayerMP.getServerForPlayer().getEntityTracker().removePlayerFromTrackers(par1EntityPlayerMP); -+ par1EntityPlayerMP.getServerForPlayer().getEntityTracker().removeEntityFromAllTrackingPlayers(par1EntityPlayerMP); -+ par1EntityPlayerMP.getServerForPlayer().getPlayerManager().removePlayer(par1EntityPlayerMP); -+ this.playerEntityList.remove(par1EntityPlayerMP); -+ this.mcServer.worldServerForDimension(par1EntityPlayerMP.dimension).removePlayerEntityDangerously(par1EntityPlayerMP); -+ ChunkCoordinates var4 = par1EntityPlayerMP.getBedLocation(); -+ boolean var5 = par1EntityPlayerMP.isSpawnForced(); -+ par1EntityPlayerMP.dimension = par2; - Object var6; -- if(this.e.isDemo()) { -- var6 = new DemoWorldManager(this.e.worldServerForDimension(var1.dimension)); -+ -+ if (this.mcServer.isDemo()) { -+ var6 = new DemoWorldManager(this.mcServer.worldServerForDimension(par1EntityPlayerMP.dimension)); - } else { -- var6 = new ItemInWorldManager(this.e.worldServerForDimension(var1.dimension)); -+ var6 = new ItemInWorldManager(this.mcServer.worldServerForDimension(par1EntityPlayerMP.dimension)); - } - -- EntityPlayerMP var7 = new EntityPlayerMP(this.e, this.e.worldServerForDimension(var1.dimension), var1.getCommandSenderName(), (ItemInWorldManager)var6); -- var7.playerNetServerHandler = var1.playerNetServerHandler; -- var7.clonePlayer(var1, var3); -- var7.entityId = var1.entityId; -- WorldServer var8 = this.e.worldServerForDimension(var1.dimension); -- this.func_72381_a(var7, var1, var8); -+ EntityPlayerMP var7 = new EntityPlayerMP(this.mcServer, this.mcServer.worldServerForDimension(par1EntityPlayerMP.dimension), par1EntityPlayerMP.getCommandSenderName(), (ItemInWorldManager)var6); -+ var7.playerNetServerHandler = par1EntityPlayerMP.playerNetServerHandler; -+ var7.clonePlayer(par1EntityPlayerMP, par3); -+ var7.entityId = par1EntityPlayerMP.entityId; -+ WorldServer var8 = this.mcServer.worldServerForDimension(par1EntityPlayerMP.dimension); -+ this.func_72381_a(var7, par1EntityPlayerMP, var8); - ChunkCoordinates var9; -- if(var4 != null) { -- var9 = EntityPlayer.verifyRespawnCoordinates(this.e.worldServerForDimension(var1.dimension), var4, var5); -- if(var9 != null) { -+ -+ if (var4 != null) { -+ var9 = EntityPlayer.verifyRespawnCoordinates(this.mcServer.worldServerForDimension(par1EntityPlayerMP.dimension), var4, var5); -+ -+ if (var9 != null) { - var7.setLocationAndAngles((double)((float)var9.posX + 0.5F), (double)((float)var9.posY + 0.1F), (double)((float)var9.posZ + 0.5F), 0.0F, 0.0F); - var7.setSpawnChunk(var4, var5); - } else { -- var7.playerNetServerHandler.sendPacket(new Packet70GameEvent(0, 0)); -+ var7.playerNetServerHandler.sendPacketToPlayer(new Packet70GameEvent(0, 0)); - } - } - - var8.theChunkProviderServer.loadChunk((int)var7.posX >> 4, (int)var7.posZ >> 4); - -- while(!var8.getCollidingBoundingBoxes(var7, var7.boundingBox).isEmpty()) { -+ while (!var8.getCollidingBoundingBoxes(var7, var7.boundingBox).isEmpty()) { - var7.setPosition(var7.posX, var7.posY + 1.0D, var7.posZ); - } - -- var7.playerNetServerHandler.sendPacket(new Packet9Respawn(var7.dimension, (byte)var7.worldObj.difficultySetting, var7.worldObj.getWorldInfo().getTerrainType(), var7.worldObj.getHeight(), var7.theItemInWorldManager.getGameType())); -+ var7.playerNetServerHandler.sendPacketToPlayer(new Packet9Respawn(var7.dimension, (byte)var7.worldObj.difficultySetting, var7.worldObj.getWorldInfo().getTerrainType(), var7.worldObj.getHeight(), var7.theItemInWorldManager.getGameType())); - var9 = var8.getSpawnPoint(); - var7.playerNetServerHandler.setPlayerLocation(var7.posX, var7.posY, var7.posZ, var7.rotationYaw, var7.rotationPitch); -- var7.playerNetServerHandler.sendPacket(new Packet6SpawnPosition(var9.posX, var9.posY, var9.posZ)); -- var7.playerNetServerHandler.sendPacket(new Packet43Experience(var7.experience, var7.experienceTotal, var7.experienceLevel)); -+ var7.playerNetServerHandler.sendPacketToPlayer(new Packet6SpawnPosition(var9.posX, var9.posY, var9.posZ)); -+ var7.playerNetServerHandler.sendPacketToPlayer(new Packet43Experience(var7.experience, var7.experienceTotal, var7.experienceLevel)); - this.updateTimeAndWeatherForPlayer(var7, var8); - var8.getPlayerManager().addPlayer(var7); - var8.spawnEntityInWorld(var7); -- this.a.add(var7); -+ this.playerEntityList.add(var7); - var7.addSelfToInternalCraftingInventory(); - var7.setHealth(var7.getHealth()); - return var7; - } - -- public void transferPlayerToDimension(EntityPlayerMP var1, int var2) { -- int var3 = var1.dimension; -- WorldServer var4 = this.e.worldServerForDimension(var1.dimension); -- var1.dimension = var2; -- WorldServer var5 = this.e.worldServerForDimension(var1.dimension); -- var1.playerNetServerHandler.sendPacket(new Packet9Respawn(var1.dimension, (byte)var1.worldObj.difficultySetting, var5.getWorldInfo().getTerrainType(), var5.getHeight(), var1.theItemInWorldManager.getGameType())); -- var4.removePlayerEntityDangerously(var1); -- var1.isDead = false; -- this.transferEntityToWorld(var1, var3, var4, var5); -- this.func_72375_a(var1, var4); -- var1.playerNetServerHandler.setPlayerLocation(var1.posX, var1.posY, var1.posZ, var1.rotationYaw, var1.rotationPitch); -- var1.theItemInWorldManager.setWorld(var5); -- this.updateTimeAndWeatherForPlayer(var1, var5); -- this.syncPlayerInventory(var1); -- Iterator var6 = var1.getActivePotionEffects().iterator(); -+ public void transferPlayerToDimension(EntityPlayerMP par1EntityPlayerMP, int par2) { -+ int var3 = par1EntityPlayerMP.dimension; -+ WorldServer var4 = this.mcServer.worldServerForDimension(par1EntityPlayerMP.dimension); -+ par1EntityPlayerMP.dimension = par2; -+ WorldServer var5 = this.mcServer.worldServerForDimension(par1EntityPlayerMP.dimension); -+ par1EntityPlayerMP.playerNetServerHandler.sendPacketToPlayer(new Packet9Respawn(par1EntityPlayerMP.dimension, (byte)par1EntityPlayerMP.worldObj.difficultySetting, var5.getWorldInfo().getTerrainType(), var5.getHeight(), par1EntityPlayerMP.theItemInWorldManager.getGameType())); -+ var4.removePlayerEntityDangerously(par1EntityPlayerMP); -+ par1EntityPlayerMP.isDead = false; -+ this.transferEntityToWorld(par1EntityPlayerMP, var3, var4, var5); -+ this.func_72375_a(par1EntityPlayerMP, var4); -+ par1EntityPlayerMP.playerNetServerHandler.setPlayerLocation(par1EntityPlayerMP.posX, par1EntityPlayerMP.posY, par1EntityPlayerMP.posZ, par1EntityPlayerMP.rotationYaw, par1EntityPlayerMP.rotationPitch); -+ par1EntityPlayerMP.theItemInWorldManager.setWorld(var5); -+ this.updateTimeAndWeatherForPlayer(par1EntityPlayerMP, var5); -+ this.syncPlayerInventory(par1EntityPlayerMP); -+ Iterator var6 = par1EntityPlayerMP.getActivePotionEffects().iterator(); - -- while(var6.hasNext()) { -+ while (var6.hasNext()) { - PotionEffect var7 = (PotionEffect)var6.next(); -- var1.playerNetServerHandler.sendPacket(new Packet41EntityEffect(var1.entityId, var7)); -+ par1EntityPlayerMP.playerNetServerHandler.sendPacketToPlayer(new Packet41EntityEffect(par1EntityPlayerMP.entityId, var7)); - } -- - } - -- public void transferEntityToWorld(Entity var1, int var2, WorldServer var3, WorldServer var4) { -- double var5 = var1.posX; -- double var7 = var1.posZ; -+ /** -+ * Transfers an entity from a world to another world. -+ */ -+ public void transferEntityToWorld(Entity par1Entity, int par2, WorldServer par3WorldServer, WorldServer par4WorldServer) { -+ double var5 = par1Entity.posX; -+ double var7 = par1Entity.posZ; - double var9 = 8.0D; -- double var11 = var1.posX; -- double var13 = var1.posY; -- double var15 = var1.posZ; -- float var17 = var1.rotationYaw; -- var3.theProfiler.startSection("moving"); -- if(var1.dimension == -1) { -+ double var11 = par1Entity.posX; -+ double var13 = par1Entity.posY; -+ double var15 = par1Entity.posZ; -+ float var17 = par1Entity.rotationYaw; -+ par3WorldServer.theProfiler.startSection("moving"); -+ -+ if (par1Entity.dimension == -1) { - var5 /= var9; - var7 /= var9; -- var1.setLocationAndAngles(var5, var1.posY, var7, var1.rotationYaw, var1.rotationPitch); -- if(var1.isEntityAlive()) { -- var3.updateEntityWithOptionalForce(var1, false); -+ par1Entity.setLocationAndAngles(var5, par1Entity.posY, var7, par1Entity.rotationYaw, par1Entity.rotationPitch); -+ -+ if (par1Entity.isEntityAlive()) { -+ par3WorldServer.updateEntityWithOptionalForce(par1Entity, false); - } -- } else if(var1.dimension == 0) { -+ } else if (par1Entity.dimension == 0) { - var5 *= var9; - var7 *= var9; -- var1.setLocationAndAngles(var5, var1.posY, var7, var1.rotationYaw, var1.rotationPitch); -- if(var1.isEntityAlive()) { -- var3.updateEntityWithOptionalForce(var1, false); -+ par1Entity.setLocationAndAngles(var5, par1Entity.posY, var7, par1Entity.rotationYaw, par1Entity.rotationPitch); -+ -+ if (par1Entity.isEntityAlive()) { -+ par3WorldServer.updateEntityWithOptionalForce(par1Entity, false); - } - } else { - ChunkCoordinates var18; -- if(var2 == 1) { -- var18 = var4.getSpawnPoint(); -+ -+ if (par2 == 1) { -+ var18 = par4WorldServer.getSpawnPoint(); - } else { -- var18 = var4.getEntrancePortalLocation(); -+ var18 = par4WorldServer.getEntrancePortalLocation(); - } - - var5 = (double)var18.posX; -- var1.posY = (double)var18.posY; -+ par1Entity.posY = (double)var18.posY; - var7 = (double)var18.posZ; -- var1.setLocationAndAngles(var5, var1.posY, var7, 90.0F, 0.0F); -- if(var1.isEntityAlive()) { -- var3.updateEntityWithOptionalForce(var1, false); -+ par1Entity.setLocationAndAngles(var5, par1Entity.posY, var7, 90.0F, 0.0F); -+ -+ if (par1Entity.isEntityAlive()) { -+ par3WorldServer.updateEntityWithOptionalForce(par1Entity, false); - } - } - -- var3.theProfiler.endSection(); -- if(var2 != 1) { -- var3.theProfiler.startSection("placing"); -+ par3WorldServer.theProfiler.endSection(); -+ -+ if (par2 != 1) { -+ par3WorldServer.theProfiler.startSection("placing"); - var5 = (double)MathHelper.clamp_int((int)var5, -29999872, 29999872); - var7 = (double)MathHelper.clamp_int((int)var7, -29999872, 29999872); -- if(var1.isEntityAlive()) { -- var4.spawnEntityInWorld(var1); -- var1.setLocationAndAngles(var5, var1.posY, var7, var1.rotationYaw, var1.rotationPitch); -- var4.updateEntityWithOptionalForce(var1, false); -- var4.getDefaultTeleporter().placeInPortal(var1, var11, var13, var15, var17); -+ -+ if (par1Entity.isEntityAlive()) { -+ par4WorldServer.spawnEntityInWorld(par1Entity); -+ par1Entity.setLocationAndAngles(var5, par1Entity.posY, var7, par1Entity.rotationYaw, par1Entity.rotationPitch); -+ par4WorldServer.updateEntityWithOptionalForce(par1Entity, false); -+ par4WorldServer.getDefaultTeleporter().placeInPortal(par1Entity, var11, var13, var15, var17); - } - -- var3.theProfiler.endSection(); -+ par3WorldServer.theProfiler.endSection(); - } - -- var1.setWorld(var4); -+ par1Entity.setWorld(par4WorldServer); - } - -- public void onTick() { -- if(++this.playerPingIndex > 600) { -+ /** -+ * sends 1 player per tick, but only sends a player once every 600 ticks -+ */ -+ public void sendPlayerInfoToAllPlayers() { -+ if (++this.playerPingIndex > 600) { - this.playerPingIndex = 0; - } - -- if(this.playerPingIndex < this.a.size()) { -- EntityPlayerMP var1 = (EntityPlayerMP)this.a.get(this.playerPingIndex); -+ if (this.playerPingIndex < this.playerEntityList.size()) { -+ EntityPlayerMP var1 = (EntityPlayerMP)this.playerEntityList.get(this.playerPingIndex); - this.sendPacketToAllPlayers(new Packet201PlayerInfo(var1.getCommandSenderName(), true, var1.ping)); - } -- - } - -- public void sendPacketToAllPlayers(Packet var1) { -- for(int var2 = 0; var2 < this.a.size(); ++var2) { -- ((EntityPlayerMP)this.a.get(var2)).playerNetServerHandler.sendPacket(var1); -+ /** -+ * sends a packet to all players -+ */ -+ public void sendPacketToAllPlayers(Packet par1Packet) { -+ for (int var2 = 0; var2 < this.playerEntityList.size(); ++var2) { -+ ((EntityPlayerMP)this.playerEntityList.get(var2)).playerNetServerHandler.sendPacketToPlayer(par1Packet); - } -- - } - -- public void sendPacketToAllPlayersInDimension(Packet var1, int var2) { -- for(int var3 = 0; var3 < this.a.size(); ++var3) { -- EntityPlayerMP var4 = (EntityPlayerMP)this.a.get(var3); -- if(var4.dimension == var2) { -- var4.playerNetServerHandler.sendPacket(var1); -+ /** -+ * Sends a packet to all players in the specified Dimension -+ */ -+ public void sendPacketToAllPlayersInDimension(Packet par1Packet, int par2) { -+ for (int var3 = 0; var3 < this.playerEntityList.size(); ++var3) { -+ EntityPlayerMP var4 = (EntityPlayerMP)this.playerEntityList.get(var3); -+ -+ if (var4.dimension == par2) { -+ var4.playerNetServerHandler.sendPacketToPlayer(par1Packet); - } - } -- - } - -+ /** -+ * returns a string containing a comma-seperated list of player names -+ */ - public String getPlayerListAsString() { - String var1 = ""; - -- for(int var2 = 0; var2 < this.a.size(); ++var2) { -- if(var2 > 0) { -+ for (int var2 = 0; var2 < this.playerEntityList.size(); ++var2) { -+ if (var2 > 0) { - var1 = var1 + ", "; - } - -- var1 = var1 + ((EntityPlayerMP)this.a.get(var2)).getCommandSenderName(); -+ var1 = var1 + ((EntityPlayerMP)this.playerEntityList.get(var2)).getCommandSenderName(); - } - - return var1; - } - -+ /** -+ * Returns an array of the usernames of all the connected players. -+ */ - public String[] getAllUsernames() { -- String[] var1 = new String[this.a.size()]; -+ String[] var1 = new String[this.playerEntityList.size()]; - -- for(int var2 = 0; var2 < this.a.size(); ++var2) { -- var1[var2] = ((EntityPlayerMP)this.a.get(var2)).getCommandSenderName(); -+ for (int var2 = 0; var2 < this.playerEntityList.size(); ++var2) { -+ var1[var2] = ((EntityPlayerMP)this.playerEntityList.get(var2)).getCommandSenderName(); - } - - return var1; -@@ -433,129 +519,151 @@ - return this.bannedIPs; - } - -- public void addOp(String var1) { -- this.h.add(var1.toLowerCase()); -- } -- -- public void removeOp(String var1) { -- this.h.remove(var1.toLowerCase()); -- } -- -- public boolean isAllowedToLogin(String var1) { -- var1 = var1.trim().toLowerCase(); -- return !this.whiteListEnforced || this.h.contains(var1) || this.i.contains(var1); -- } -- -- public boolean isPlayerOpped(String var1) { -- return this.h.contains(var1.trim().toLowerCase()) || this.e.isSinglePlayer() && this.e.worldServers[0].getWorldInfo().areCommandsAllowed() && this.e.getServerOwner().equalsIgnoreCase(var1) || this.commandsAllowedForAll; -- } -- -- public EntityPlayerMP getPlayerEntity(String var1) { -- Iterator var2 = this.a.iterator(); -- -+ /** -+ * This adds a username to the ops list, then saves the op list -+ */ -+ public void addOp(String par1Str) { -+ this.ops.add(par1Str.toLowerCase()); -+ } -+ -+ /** -+ * This removes a username from the ops list, then saves the op list -+ */ -+ public void removeOp(String par1Str) { -+ this.ops.remove(par1Str.toLowerCase()); -+ } -+ -+ /** -+ * Determine if the player is allowed to connect based on current server settings. -+ */ -+ public boolean isAllowedToLogin(String par1Str) { -+ par1Str = par1Str.trim().toLowerCase(); -+ return !this.whiteListEnforced || this.ops.contains(par1Str) || this.whiteListedPlayers.contains(par1Str); -+ } -+ -+ /** -+ * Returns true if the specified player is opped, even if they're currently offline. -+ */ -+ public boolean isPlayerOpped(String par1Str) { -+ return this.ops.contains(par1Str.trim().toLowerCase()) || this.mcServer.isSinglePlayer() && this.mcServer.worldServers[0].getWorldInfo().areCommandsAllowed() && this.mcServer.getServerOwner().equalsIgnoreCase(par1Str) || this.commandsAllowedForAll; -+ } -+ -+ public EntityPlayerMP getPlayerForUsername(String par1Str) { -+ Iterator var2 = this.playerEntityList.iterator(); - EntityPlayerMP var3; -+ - do { -- if(!var2.hasNext()) { -+ if (!var2.hasNext()) { - return null; - } - - var3 = (EntityPlayerMP)var2.next(); -- } while(!var3.getCommandSenderName().equalsIgnoreCase(var1)); -+ } while (!var3.getCommandSenderName().equalsIgnoreCase(par1Str)); - - return var3; - } - -- public List findPlayers(ChunkCoordinates var1, int var2, int var3, int var4, int var5, int var6, int var7, Map var8, String var9, String var10, World var11) { -- if(this.a.isEmpty()) { -+ /** -+ * Find all players in a specified range and narrowing down by other parameters -+ */ -+ public List findPlayers(ChunkCoordinates par1ChunkCoordinates, int par2, int par3, int par4, int par5, int par6, int par7, Map par8Map, String par9Str, String par10Str, World par11World) { -+ if (this.playerEntityList.isEmpty()) { - return null; - } else { - Object var12 = new ArrayList(); -- boolean var13 = var4 < 0; -- boolean var14 = var9 != null && var9.startsWith("!"); -- boolean var15 = var10 != null && var10.startsWith("!"); -- int var16 = var2 * var2; -- int var17 = var3 * var3; -- var4 = MathHelper.abs_int(var4); -- if(var14) { -- var9 = var9.substring(1); -- } -- -- if(var15) { -- var10 = var10.substring(1); -- } -- -- for(int var18 = 0; var18 < this.a.size(); ++var18) { -- EntityPlayerMP var19 = (EntityPlayerMP)this.a.get(var18); -- if((var11 == null || var19.worldObj == var11) && (var9 == null || var14 != var9.equalsIgnoreCase(var19.getEntityName()))) { -- if(var10 != null) { -+ boolean var13 = par4 < 0; -+ boolean var14 = par9Str != null && par9Str.startsWith("!"); -+ boolean var15 = par10Str != null && par10Str.startsWith("!"); -+ int var16 = par2 * par2; -+ int var17 = par3 * par3; -+ par4 = MathHelper.abs_int(par4); -+ -+ if (var14) { -+ par9Str = par9Str.substring(1); -+ } -+ -+ if (var15) { -+ par10Str = par10Str.substring(1); -+ } -+ -+ for (int var18 = 0; var18 < this.playerEntityList.size(); ++var18) { -+ EntityPlayerMP var19 = (EntityPlayerMP)this.playerEntityList.get(var18); -+ -+ if ((par11World == null || var19.worldObj == par11World) && (par9Str == null || var14 != par9Str.equalsIgnoreCase(var19.getEntityName()))) { -+ if (par10Str != null) { - Team var20 = var19.getTeam(); - String var21 = var20 == null ? "" : var20.func_96661_b(); -- if(var15 == var10.equalsIgnoreCase(var21)) { -- continue; -- } -- } -- -- if(var1 != null && (var2 > 0 || var3 > 0)) { -- float var22 = var1.getDistanceSquaredToChunkCoordinates(var19.getCommandSenderPosition()); -- if(var2 > 0 && var22 < (float)var16 || var3 > 0 && var22 > (float)var17) { -- continue; -- } -- } -- -- if(this.func_96457_a(var19, var8) && (var5 == EnumGameType.NOT_SET.getID() || var5 == var19.theItemInWorldManager.getGameType().getID()) && (var6 <= 0 || var19.experienceLevel >= var6) && var19.experienceLevel <= var7) { -+ -+ if (var15 == par10Str.equalsIgnoreCase(var21)) { -+ continue; -+ } -+ } -+ -+ if (par1ChunkCoordinates != null && (par2 > 0 || par3 > 0)) { -+ float var22 = par1ChunkCoordinates.getDistanceSquaredToChunkCoordinates(var19.getPlayerCoordinates()); -+ -+ if (par2 > 0 && var22 < (float)var16 || par3 > 0 && var22 > (float)var17) { -+ continue; -+ } -+ } -+ -+ if (this.func_96457_a(var19, par8Map) && (par5 == EnumGameType.NOT_SET.getID() || par5 == var19.theItemInWorldManager.getGameType().getID()) && (par6 <= 0 || var19.experienceLevel >= par6) && var19.experienceLevel <= par7) { - ((List)var12).add(var19); - } - } - } - -- if(var1 != null) { -- Collections.sort((List)var12, new PlayerPositionComparator(var1)); -+ if (par1ChunkCoordinates != null) { -+ Collections.sort((List)var12, new PlayerPositionComparator(par1ChunkCoordinates)); - } - -- if(var13) { -+ if (var13) { - Collections.reverse((List)var12); - } - -- if(var4 > 0) { -- var12 = ((List)var12).subList(0, Math.min(var4, ((List)var12).size())); -+ if (par4 > 0) { -+ var12 = ((List)var12).subList(0, Math.min(par4, ((List)var12).size())); - } - - return (List)var12; - } - } - -- private boolean func_96457_a(EntityPlayer var1, Map var2) { -- if(var2 != null && var2.size() != 0) { -- Iterator var3 = var2.entrySet().iterator(); -- -+ private boolean func_96457_a(EntityPlayer par1EntityPlayer, Map par2Map) { -+ if (par2Map != null && par2Map.size() != 0) { -+ Iterator var3 = par2Map.entrySet().iterator(); - Entry var4; - boolean var6; - int var10; -+ - do { -- if(!var3.hasNext()) { -+ if (!var3.hasNext()) { - return true; - } - - var4 = (Entry)var3.next(); - String var5 = (String)var4.getKey(); - var6 = false; -- if(var5.endsWith("_min") && var5.length() > 4) { -+ -+ if (var5.endsWith("_min") && var5.length() > 4) { - var6 = true; - var5 = var5.substring(0, var5.length() - 4); - } - -- Scoreboard var7 = var1.getWorldScoreboard(); -+ Scoreboard var7 = par1EntityPlayer.getWorldScoreboard(); - ScoreObjective var8 = var7.getObjective(var5); -- if(var8 == null) { -+ -+ if (var8 == null) { - return false; - } - -- Score var9 = var1.getWorldScoreboard().func_96529_a(var1.getEntityName(), var8); -+ Score var9 = par1EntityPlayer.getWorldScoreboard().func_96529_a(par1EntityPlayer.getEntityName(), var8); - var10 = var9.getScorePoints(); -- if(var10 < ((Integer)var4.getValue()).intValue() && var6) { -+ -+ if (var10 < ((Integer)var4.getValue()).intValue() && var6) { - return false; - } -- } while(var10 <= ((Integer)var4.getValue()).intValue() || var6); -+ } while (var10 <= ((Integer)var4.getValue()).intValue() || var6); - - return false; - } else { -@@ -563,92 +671,129 @@ - } - } - -- public void sendPacketToPlayersAroundPoint(double var1, double var3, double var5, double var7, int var9, Packet var10) { -- this.sendToAllNearExcept((EntityPlayer)null, var1, var3, var5, var7, var9, var10); -+ /** -+ * params: x,y,z,d,dimension. The packet is sent to all players within d distance of x,y,z (d^2 0) { -- MinecraftServer.getServer().getConfigurationManager().getBannedPlayers().remove(var2[0]); -- notifyAdmins(var1, "commands.unban.success", new Object[]{var2[0]}); -+ public void processCommand(ICommandSender par1ICommandSender, String[] par2ArrayOfStr) { -+ if (par2ArrayOfStr.length == 1 && par2ArrayOfStr[0].length() > 0) { -+ MinecraftServer.getServer().getConfigurationManager().getBannedPlayers().remove(par2ArrayOfStr[0]); -+ notifyAdmins(par1ICommandSender, "commands.unban.success", new Object[] {par2ArrayOfStr[0]}); - } else { - throw new WrongUsageException("commands.unban.usage", new Object[0]); - } - } - -- public List addTabCompletionOptions(ICommandSender var1, String[] var2) { -- return var2.length == 1 ? getListOfStringsFromIterableMatchingLastWord(var2, MinecraftServer.getServer().getConfigurationManager().getBannedPlayers().getBannedList().keySet()) : null; -+ /** -+ * Adds the strings available in this command to the given list of tab completion options. -+ */ -+ public List addTabCompletionOptions(ICommandSender par1ICommandSender, String[] par2ArrayOfStr) { -+ return par2ArrayOfStr.length == 1 ? getListOfStringsFromIterableMatchingLastWord(par2ArrayOfStr, MinecraftServer.getServer().getConfigurationManager().getBannedPlayers().getBannedList().keySet()) : null; - } - } ---- /dev/null -+++ org/spoutcraft/client/packet/PacketOpenScreen.java -@@ -1,0 +1,56 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.client.packet; -+ -+import java.io.IOException; -+ -+import org.spoutcraft.api.gui.ScreenType; -+import org.spoutcraft.api.io.SpoutInputStream; -+import org.spoutcraft.api.io.SpoutOutputStream; -+import org.spoutcraft.client.gui.ScreenUtil; -+ -+public class PacketOpenScreen implements SpoutPacket { -+ ScreenType type = null; -+ public PacketOpenScreen() { -+ } -+ -+ public void readData(SpoutInputStream input) throws IOException { -+ type = ScreenType.getType(input.readInt()); -+ } -+ -+ public void writeData(SpoutOutputStream output) throws IOException { -+ output.writeInt(type.getCode()); -+ } -+ -+ public void run(int playerId) { -+ ScreenUtil.open(type); -+ } -+ -+ public void failure(int playerId) { -+ } -+ -+ public PacketType getPacketType() { -+ return PacketType.PacketOpenScreen; -+ } -+ -+ public int getVersion() { -+ return 0; -+ } -+} ---- net/minecraft/src/EntityEnderEye.java -+++ net/minecraft/src/EntityEnderEye.java -@@ -1,64 +1,84 @@ - package net.minecraft.src; - - public class EntityEnderEye extends Entity { -+ -+ /** 'x' location the eye should float towards. */ - private double targetX; -+ -+ /** 'y' location the eye should float towards. */ - private double targetY; -+ -+ /** 'z' location the eye should float towards. */ - private double targetZ; - private int despawnTimer; - private boolean shatterOrDrop; - -- public EntityEnderEye(World var1) { -- super(var1); -+ public EntityEnderEye(World par1World) { -+ super(par1World); - this.setSize(0.25F, 0.25F); - } - -- protected void entityInit() { -- } -+ protected void entityInit() {} - -- public boolean isInRangeToRenderDist(double var1) { -+ /** -+ * Checks if the entity is in range to render by using the past in distance and comparing it to its average edge length -+ * * 64 * renderDistanceWeight Args: distance -+ */ -+ public boolean isInRangeToRenderDist(double par1) { - double var3 = this.boundingBox.getAverageEdgeLength() * 4.0D; - var3 *= 64.0D; -- return var1 < var3 * var3; -+ return par1 < var3 * var3; - } - -- public EntityEnderEye(World var1, double var2, double var4, double var6) { -- super(var1); -+ public EntityEnderEye(World par1World, double par2, double par4, double par6) { -+ super(par1World); - this.despawnTimer = 0; - this.setSize(0.25F, 0.25F); -- this.setPosition(var2, var4, var6); -+ this.setPosition(par2, par4, par6); - this.yOffset = 0.0F; - } - -- public void moveTowards(double var1, int var3, double var4) { -- double var6 = var1 - this.posX; -- double var8 = var4 - this.posZ; -+ /** -+ * The location the eye should float/move towards. Currently used for moving towards the nearest stronghold. Args: -+ * strongholdX, strongholdY, strongholdZ -+ */ -+ public void moveTowards(double par1, int par3, double par4) { -+ double var6 = par1 - this.posX; -+ double var8 = par4 - this.posZ; - float var10 = MathHelper.sqrt_double(var6 * var6 + var8 * var8); -- if(var10 > 12.0F) { -+ -+ if (var10 > 12.0F) { - this.targetX = this.posX + var6 / (double)var10 * 12.0D; - this.targetZ = this.posZ + var8 / (double)var10 * 12.0D; - this.targetY = this.posY + 8.0D; - } else { -- this.targetX = var1; -- this.targetY = (double)var3; -- this.targetZ = var4; -+ this.targetX = par1; -+ this.targetY = (double)par3; -+ this.targetZ = par4; - } - - this.despawnTimer = 0; -- this.shatterOrDrop = this.ab.nextInt(5) > 0; -+ this.shatterOrDrop = this.rand.nextInt(5) > 0; - } - -- public void setVelocity(double var1, double var3, double var5) { -- this.motionX = var1; -- this.motionY = var3; -- this.motionZ = var5; -- if(this.prevRotationPitch == 0.0F && this.prevRotationYaw == 0.0F) { -- float var7 = MathHelper.sqrt_double(var1 * var1 + var5 * var5); -- this.prevRotationYaw = this.rotationYaw = (float)(Math.atan2(var1, var5) * 180.0D / (double)((float)Math.PI)); -- this.prevRotationPitch = this.rotationPitch = (float)(Math.atan2(var3, (double)var7) * 180.0D / (double)((float)Math.PI)); -+ /** -+ * Sets the velocity to the args. Args: x, y, z -+ */ -+ public void setVelocity(double par1, double par3, double par5) { -+ this.motionX = par1; -+ this.motionY = par3; -+ this.motionZ = par5; -+ -+ if (this.prevRotationPitch == 0.0F && this.prevRotationYaw == 0.0F) { -+ float var7 = MathHelper.sqrt_double(par1 * par1 + par5 * par5); -+ this.prevRotationYaw = this.rotationYaw = (float)(Math.atan2(par1, par5) * 180.0D / Math.PI); -+ this.prevRotationPitch = this.rotationPitch = (float)(Math.atan2(par3, (double)var7) * 180.0D / Math.PI); - } -- - } - -+ /** -+ * Called to update the entity's position/logic. -+ */ - public void onUpdate() { - this.lastTickPosX = this.posX; - this.lastTickPosY = this.posY; -@@ -68,87 +88,103 @@ - this.posY += this.motionY; - this.posZ += this.motionZ; - float var1 = MathHelper.sqrt_double(this.motionX * this.motionX + this.motionZ * this.motionZ); -- this.rotationYaw = (float)(Math.atan2(this.motionX, this.motionZ) * 180.0D / (double)((float)Math.PI)); -+ this.rotationYaw = (float)(Math.atan2(this.motionX, this.motionZ) * 180.0D / Math.PI); - -- for(this.rotationPitch = (float)(Math.atan2(this.motionY, (double)var1) * 180.0D / (double)((float)Math.PI)); this.rotationPitch - this.prevRotationPitch < -180.0F; this.prevRotationPitch -= 360.0F) { -+ for (this.rotationPitch = (float)(Math.atan2(this.motionY, (double)var1) * 180.0D / Math.PI); this.rotationPitch - this.prevRotationPitch < -180.0F; this.prevRotationPitch -= 360.0F) { -+ ; - } - -- while(this.rotationPitch - this.prevRotationPitch >= 180.0F) { -+ while (this.rotationPitch - this.prevRotationPitch >= 180.0F) { - this.prevRotationPitch += 360.0F; - } - -- while(this.rotationYaw - this.prevRotationYaw < -180.0F) { -+ while (this.rotationYaw - this.prevRotationYaw < -180.0F) { - this.prevRotationYaw -= 360.0F; - } - -- while(this.rotationYaw - this.prevRotationYaw >= 180.0F) { -+ while (this.rotationYaw - this.prevRotationYaw >= 180.0F) { - this.prevRotationYaw += 360.0F; - } - - this.rotationPitch = this.prevRotationPitch + (this.rotationPitch - this.prevRotationPitch) * 0.2F; - this.rotationYaw = this.prevRotationYaw + (this.rotationYaw - this.prevRotationYaw) * 0.2F; -- if(!this.worldObj.isRemote) { -+ -+ if (!this.worldObj.isRemote) { - double var2 = this.targetX - this.posX; - double var4 = this.targetZ - this.posZ; - float var6 = (float)Math.sqrt(var2 * var2 + var4 * var4); - float var7 = (float)Math.atan2(var4, var2); - double var8 = (double)var1 + (double)(var6 - var1) * 0.0025D; -- if(var6 < 1.0F) { -+ -+ if (var6 < 1.0F) { - var8 *= 0.8D; - this.motionY *= 0.8D; - } - - this.motionX = Math.cos((double)var7) * var8; - this.motionZ = Math.sin((double)var7) * var8; -- if(this.posY < this.targetY) { -- this.motionY += (1.0D - this.motionY) * (double)0.015F; -+ -+ if (this.posY < this.targetY) { -+ this.motionY += (1.0D - this.motionY) * 0.014999999664723873D; - } else { -- this.motionY += (-1.0D - this.motionY) * (double)0.015F; -+ this.motionY += (-1.0D - this.motionY) * 0.014999999664723873D; - } - } - - float var10 = 0.25F; -- if(this.isInWater()) { -- for(int var3 = 0; var3 < 4; ++var3) { -+ -+ if (this.isInWater()) { -+ for (int var3 = 0; var3 < 4; ++var3) { - this.worldObj.spawnParticle("bubble", this.posX - this.motionX * (double)var10, this.posY - this.motionY * (double)var10, this.posZ - this.motionZ * (double)var10, this.motionX, this.motionY, this.motionZ); - } - } else { -- this.worldObj.spawnParticle("portal", this.posX - this.motionX * (double)var10 + this.ab.nextDouble() * 0.6D - 0.3D, this.posY - this.motionY * (double)var10 - 0.5D, this.posZ - this.motionZ * (double)var10 + this.ab.nextDouble() * 0.6D - 0.3D, this.motionX, this.motionY, this.motionZ); -+ this.worldObj.spawnParticle("portal", this.posX - this.motionX * (double)var10 + this.rand.nextDouble() * 0.6D - 0.3D, this.posY - this.motionY * (double)var10 - 0.5D, this.posZ - this.motionZ * (double)var10 + this.rand.nextDouble() * 0.6D - 0.3D, this.motionX, this.motionY, this.motionZ); - } - -- if(!this.worldObj.isRemote) { -+ if (!this.worldObj.isRemote) { - this.setPosition(this.posX, this.posY, this.posZ); - ++this.despawnTimer; -- if(this.despawnTimer > 80 && !this.worldObj.isRemote) { -+ -+ if (this.despawnTimer > 80 && !this.worldObj.isRemote) { - this.setDead(); -- if(this.shatterOrDrop) { -+ -+ if (this.shatterOrDrop) { - this.worldObj.spawnEntityInWorld(new EntityItem(this.worldObj, this.posX, this.posY, this.posZ, new ItemStack(Item.eyeOfEnder))); - } else { - this.worldObj.playAuxSFX(2003, (int)Math.round(this.posX), (int)Math.round(this.posY), (int)Math.round(this.posZ), 0); - } - } - } -- -- } -- -- public void writeEntityToNBT(NBTTagCompound var1) { -- } -- -- public void readEntityFromNBT(NBTTagCompound var1) { -- } -+ } -+ -+ /** -+ * (abstract) Protected helper method to write subclass entity data to NBT. -+ */ -+ public void writeEntityToNBT(NBTTagCompound par1NBTTagCompound) {} -+ -+ /** -+ * (abstract) Protected helper method to read subclass entity data from NBT. -+ */ -+ public void readEntityFromNBT(NBTTagCompound par1NBTTagCompound) {} - - public float getShadowSize() { - return 0.0F; - } - -- public float getBrightness(float var1) { -+ /** -+ * Gets how bright this entity is. -+ */ -+ public float getBrightness(float par1) { - return 1.0F; - } - -- public int getBrightnessForRender(float var1) { -+ public int getBrightnessForRender(float par1) { - return 15728880; - } - -+ /** -+ * If returns false, the item will not inflict any damage against entities. -+ */ - public boolean canAttackWithItem() { - return false; - } ---- /dev/null -+++ org/spoutcraft/api/gui/GenericLabel.java -@@ -1,0 +1,213 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.api.gui; -+ -+import java.io.IOException; -+import java.util.ArrayList; -+ -+import org.apache.commons.lang3.StringUtils; -+ -+import org.spoutcraft.api.Spoutcraft; -+import org.spoutcraft.api.UnsafeClass; -+import org.spoutcraft.api.io.SpoutInputStream; -+import org.spoutcraft.api.io.SpoutOutputStream; -+ -+@UnsafeClass -+public class GenericLabel extends GenericWidget implements BasicLabel { -+ protected String text = ""; -+ protected WidgetAnchor align = WidgetAnchor.TOP_LEFT; -+ protected Color color = new Color(1f, 1f, 1f); -+ protected boolean auto = true; -+ protected boolean wrapLines = false; -+ protected float scale = 1.0F; -+ protected String[] lines = new String[0]; -+ protected boolean shadow = true; -+ -+ public GenericLabel() { -+ } -+ -+ public int getVersion() { -+ return super.getVersion() + 6; -+ } -+ -+ public GenericLabel(String text) { -+ setText(text); -+ } -+ -+ public WidgetType getType() { -+ return WidgetType.Label; -+ } -+ -+ @Override -+ public void readData(SpoutInputStream input) throws IOException { -+ super.readData(input); -+ this.setText(input.readString()); -+ this.setAlign(WidgetAnchor.getAnchorFromId(input.read())); -+ this.setAuto(input.readBoolean()); -+ this.setTextColor(input.readColor()); -+ this.setScale(input.readFloat()); -+ this.setShadow(input.readBoolean()); -+ } -+ -+ @Override -+ public void writeData(SpoutOutputStream output) throws IOException { -+ super.writeData(output); -+ output.writeString(getText()); -+ output.write(align.getId()); -+ output.writeBoolean(isAuto()); -+ output.writeColor(getTextColor()); -+ output.writeFloat(scale); -+ output.writeBoolean(shadow); -+ } -+ -+ public String getText() { -+ return text; -+ } -+ -+ public Label setText(String text) { -+ this.text = text; -+ recalculateLines(); -+ return this; -+ } -+ -+ public boolean isAuto() { -+ return auto; -+ } -+ -+ public Label setAuto(boolean auto) { -+ this.auto = auto; -+ return this; -+ } -+ -+ public WidgetAnchor getAlign() { -+ return align; -+ } -+ -+ public Label setAlign(WidgetAnchor pos) { -+ this.align = pos; -+ return this; -+ } -+ -+ public Color getTextColor() { -+ return color; -+ } -+ -+ public Label setTextColor(Color color) { -+ this.color = color; -+ return this; -+ } -+ -+ public Label setScale(float scale) { -+ this.scale = scale; -+ return this; -+ } -+ -+ public float getScale() { -+ return scale; -+ } -+ -+ @Override -+ public double getActualWidth() { -+ return auto && !wrapLines ? getTextWidth() : super.getActualWidth(); -+ } -+ -+ public double getTextWidth() { -+ double swidth = 0; -+ String lines[] = getText().split("\\n"); -+ MinecraftFont font = Spoutcraft.getClient().getRenderDelegate().getMinecraftFont(); -+ for (int i = 0; i < lines.length; i++) { -+ swidth = font.getTextWidth(lines[i]) > swidth ? font.getTextWidth(lines[i]) : swidth; -+ } -+ return swidth; -+ } -+ -+ @Override -+ public double getActualHeight() { -+ return auto && !wrapLines ? getTextHeight() : super.getActualHeight(); -+ } -+ -+ public double getTextHeight() { -+ return getText().split("\\n").length * 10; -+ } -+ -+ public boolean isWrapLines() { -+ return wrapLines; -+ } -+ -+ public GenericLabel setWrapLines(boolean wrapLines) { -+ this.wrapLines = wrapLines; -+ return this; -+ } -+ -+ public void render() { -+ Spoutcraft.getClient().getRenderDelegate().render(this); -+ } -+ -+ public String [] getLines() { -+ return lines; -+ } -+ -+ public void recalculateLines() { -+ lines = text.split("\\n"); -+ -+ if (isWrapLines()) { -+ ArrayList linesTmp = new ArrayList(lines.length); -+ for (String line:lines) { -+ linesTmp.add(line); -+ } -+ for (int i = 0; i < linesTmp.size(); i++) { -+ boolean wrapForSpace = true; -+ String line = linesTmp.get(i); -+ String lineTmp = new String(line); -+ int brk = -1; -+ while (Spoutcraft.getMinecraftFont().getTextWidth(lineTmp) > super.getWidth() && super.getWidth() >= 5 && !lineTmp.isEmpty()) { -+ brk = lineTmp.lastIndexOf(" "); -+ if (brk == -1) { -+ brk = lineTmp.length() - 2; -+ wrapForSpace = false; -+ } -+ lineTmp = lineTmp.substring(0, brk); -+ } -+ if (brk != -1) { -+ linesTmp.set(i, lineTmp); -+ String otherLine = line.substring(brk + (wrapForSpace?1:0), line.length()); -+ if (!StringUtils.isEmpty(otherLine.trim())) { -+ linesTmp.add(i + 1, otherLine); -+ } -+ } -+ } -+ -+ lines = linesTmp.toArray(new String[0]); -+ -+ if (isAuto()) { -+ setHeight(lines.length * 11); -+ } -+ } -+ } -+ -+ public Label setShadow(boolean shadow) { -+ this.shadow = shadow; -+ return this; -+ } -+ -+ public boolean hasShadow() { -+ return shadow; -+ } -+} ---- net/minecraft/src/FontMetadataSectionSerializer.java -+++ net/minecraft/src/FontMetadataSectionSerializer.java -@@ -7,45 +7,48 @@ - import java.lang.reflect.Type; - - public class FontMetadataSectionSerializer extends BaseMetadataSectionSerializer { -- public FontMetadataSection func_110490_a(JsonElement var1, Type var2, JsonDeserializationContext var3) { -- JsonObject var4 = var1.getAsJsonObject(); -+ public FontMetadataSection func_110490_a(JsonElement par1JsonElement, Type par2Type, JsonDeserializationContext par3JsonDeserializationContext) { -+ JsonObject var4 = par1JsonElement.getAsJsonObject(); - float[] var5 = new float[256]; - float[] var6 = new float[256]; - float[] var7 = new float[256]; - float var8 = 1.0F; - float var9 = 0.0F; - float var10 = 0.0F; -- if(var4.has("characters")) { -- if(!var4.get("characters").isJsonObject()) { -+ -+ if (var4.has("characters")) { -+ if (!var4.get("characters").isJsonObject()) { - throw new JsonParseException("Invalid font->characters: expected object, was " + var4.get("characters")); - } - - JsonObject var11 = var4.getAsJsonObject("characters"); -- if(var11.has("default")) { -- if(!var11.get("default").isJsonObject()) { -+ -+ if (var11.has("default")) { -+ if (!var11.get("default").isJsonObject()) { - throw new JsonParseException("Invalid font->characters->default: expected object, was " + var11.get("default")); - } - - JsonObject var12 = var11.getAsJsonObject("default"); -- var8 = this.func_110487_a(var12.get("width"), "characters->default->width", Float.valueOf(var8), 0.0F, 2.14748365E9F); -- var9 = this.func_110487_a(var12.get("spacing"), "characters->default->spacing", Float.valueOf(var9), 0.0F, 2.14748365E9F); -- var10 = this.func_110487_a(var12.get("left"), "characters->default->left", Float.valueOf(var10), 0.0F, 2.14748365E9F); -+ var8 = this.func_110487_a(var12.get("width"), "characters->default->width", Float.valueOf(var8), 0.0F, 2.1474836E9F); -+ var9 = this.func_110487_a(var12.get("spacing"), "characters->default->spacing", Float.valueOf(var9), 0.0F, 2.1474836E9F); -+ var10 = this.func_110487_a(var12.get("left"), "characters->default->left", Float.valueOf(var10), 0.0F, 2.1474836E9F); - } - -- for(int var18 = 0; var18 < 256; ++var18) { -+ for (int var18 = 0; var18 < 256; ++var18) { - JsonElement var13 = var11.get(Integer.toString(var18)); - float var14 = var8; - float var15 = var9; - float var16 = var10; -- if(var13 != null) { -- if(!var13.isJsonObject()) { -+ -+ if (var13 != null) { -+ if (!var13.isJsonObject()) { - throw new JsonParseException("Invalid font->characters->" + var18 + ": expected object, was " + var13); - } - - JsonObject var17 = var13.getAsJsonObject(); -- var14 = this.func_110487_a(var17.get("width"), "characters->" + var18 + "->width", Float.valueOf(var8), 0.0F, 2.14748365E9F); -- var15 = this.func_110487_a(var17.get("spacing"), "characters->" + var18 + "->spacing", Float.valueOf(var9), 0.0F, 2.14748365E9F); -- var16 = this.func_110487_a(var17.get("left"), "characters->" + var18 + "->left", Float.valueOf(var10), 0.0F, 2.14748365E9F); -+ var14 = this.func_110487_a(var17.get("width"), "characters->" + var18 + "->width", Float.valueOf(var8), 0.0F, 2.1474836E9F); -+ var15 = this.func_110487_a(var17.get("spacing"), "characters->" + var18 + "->spacing", Float.valueOf(var9), 0.0F, 2.1474836E9F); -+ var16 = this.func_110487_a(var17.get("left"), "characters->" + var18 + "->left", Float.valueOf(var10), 0.0F, 2.1474836E9F); - } - - var5[var18] = var14; -@@ -57,11 +60,14 @@ - return new FontMetadataSection(var5, var7, var6); - } - -+ /** -+ * The name of this section type as it appears in JSON. -+ */ - public String getSectionName() { - return "font"; - } - -- public Object deserialize(JsonElement var1, Type var2, JsonDeserializationContext var3) { -- return this.func_110490_a(var1, var2, var3); -+ public Object deserialize(JsonElement par1JsonElement, Type par2Type, JsonDeserializationContext par3JsonDeserializationContext) { -+ return this.func_110490_a(par1JsonElement, par2Type, par3JsonDeserializationContext); - } - } ---- net/minecraft/src/GuiButtonLink.java -+++ net/minecraft/src/GuiButtonLink.java -@@ -3,19 +3,18 @@ - import java.net.URI; - - public class GuiButtonLink extends GuiButton { -- public GuiButtonLink(int var1, int var2, int var3, int var4, int var5, String var6) { -- super(var1, var2, var3, var4, var5, var6); -+ public GuiButtonLink(int par1, int par2, int par3, int par4, int par5, String par6Str) { -+ super(par1, par2, par3, par4, par5, par6Str); - } - -- public void func_96135_a(String var1) { -+ public void func_96135_a(String par1Str) { - try { -- URI var2 = new URI(var1); -+ URI var2 = new URI(par1Str); - Class var3 = Class.forName("java.awt.Desktop"); - Object var4 = var3.getMethod("getDesktop", new Class[0]).invoke((Object)null, new Object[0]); -- var3.getMethod("browse", new Class[]{URI.class}).invoke(var4, new Object[]{var2}); -+ var3.getMethod("browse", new Class[] {URI.class}).invoke(var4, new Object[] {var2}); - } catch (Throwable var5) { - var5.printStackTrace(); - } -- - } - } ---- /dev/null -+++ com/prupe/mcpatcher/WeightedIndex$1.java -@@ -1,0 +1,15 @@ -+package com.prupe.mcpatcher; -+ -+final class WeightedIndex$1 extends WeightedIndex { -+ WeightedIndex$1(int x0) { -+ super(x0); -+ } -+ -+ public int choose(long key) { -+ return this.mod(key, this.size); -+ } -+ -+ public String toString() { -+ return "unweighted"; -+ } -+} ---- net/minecraft/src/EntityAIOwnerHurtByTarget.java -+++ net/minecraft/src/EntityAIOwnerHurtByTarget.java -@@ -5,18 +5,22 @@ - EntityLivingBase theOwnerAttacker; - private int field_142051_e; - -- public EntityAIOwnerHurtByTarget(EntityTameable var1) { -- super(var1, false); -- this.theDefendingTameable = var1; -+ public EntityAIOwnerHurtByTarget(EntityTameable par1EntityTameable) { -+ super(par1EntityTameable, false); -+ this.theDefendingTameable = par1EntityTameable; - this.setMutexBits(1); - } - -+ /** -+ * Returns whether the EntityAIBase should begin execution. -+ */ - public boolean shouldExecute() { -- if(!this.theDefendingTameable.isTamed()) { -+ if (!this.theDefendingTameable.isTamed()) { - return false; - } else { - EntityLivingBase var1 = this.theDefendingTameable.func_130012_q(); -- if(var1 == null) { -+ -+ if (var1 == null) { - return false; - } else { - this.theOwnerAttacker = var1.getAITarget(); -@@ -26,10 +30,14 @@ - } - } - -+ /** -+ * Execute a one shot task or start executing a continuous task -+ */ - public void startExecuting() { - this.taskOwner.setAttackTarget(this.theOwnerAttacker); - EntityLivingBase var1 = this.theDefendingTameable.func_130012_q(); -- if(var1 != null) { -+ -+ if (var1 != null) { - this.field_142051_e = var1.func_142015_aE(); - } - ---- /dev/null -+++ org/spoutcraft/client/gui/settings/controls/OptimizedLightingUpdatesButton.java -@@ -1,0 +1,38 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.client.gui.settings.controls; -+ -+import net.minecraft.src.Minecraft; -+ -+import org.spoutcraft.client.config.Configuration; -+ -+public class OptimizedLightingUpdatesButton extends AutomatedCheckBox { -+ public OptimizedLightingUpdatesButton() { -+ super("Reduced CPU Lighting"); -+ setChecked(Configuration.isOptimizedLightingUpdates()); -+ setTooltip("Reduces the amount of lighting updates per tick.\nTurn on to improve FPS.\nThis Setting Requires Restart!"); -+ } -+ -+ @Override -+ public void onButtonClick() { -+ Configuration.setOptimizedLightingUpdates(!Configuration.isOptimizedLightingUpdates()); -+ Configuration.write(); -+ } -+} ---- /dev/null -+++ org/spoutcraft/api/GameMode.java -@@ -1,0 +1,70 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.api; -+ -+import java.util.HashMap; -+import java.util.Map; -+ -+/** -+ * Represents the various type of game modes that {@link HumanEntity}s may have -+ */ -+public enum GameMode { -+ /** -+ * Creative mode may fly, build instantly, become invulnerable and create free items -+ */ -+ CREATIVE(1), -+ -+ /** -+ * Survival mode is the "normal" gameplay type, with no special features. -+ */ -+ SURVIVAL(0); -+ -+ private final int value; -+ private final static Map modes = new HashMap(); -+ -+ private GameMode(final int value) { -+ this.value = value; -+ } -+ -+ /** -+ * Gets the mode value associated with this GameMode -+ * -+ * @return An integer value of this gamemode -+ */ -+ public int getValue() { -+ return value; -+ } -+ -+ /** -+ * Gets the GameMode represented by the specified value -+ * -+ * @param value Value to check -+ * @return Associative {@link GameMode} with the given value, or null if it doesn't exist -+ */ -+ public static GameMode getByValue(final int value) { -+ return modes.get(value); -+ } -+ -+ static { -+ for (GameMode mode : GameMode.values()) { -+ modes.put(mode.getValue(), mode); -+ } -+ } -+} ---- net/minecraft/src/INetworkManager.java -+++ net/minecraft/src/INetworkManager.java -@@ -3,21 +3,47 @@ - import java.net.SocketAddress; - - public interface INetworkManager { -+ -+ /** -+ * Sets the NetHandler for this NetworkManager. Server-only. -+ */ - void setNetHandler(NetHandler var1); - -+ /** -+ * Adds the packet to the correct send queue (chunk data packets go to a separate queue). -+ */ - void addToSendQueue(Packet var1); - -+ /** -+ * Wakes reader and writer threads -+ */ - void wakeThreads(); - -+ /** -+ * Checks timeouts and processes all pending read packets. -+ */ - void processReadPackets(); - -- SocketAddress getRemoteAddress(); -+ /** -+ * Return the InetSocketAddress of the remote endpoint -+ */ -+ SocketAddress getSocketAddress(); - -+ /** -+ * Shuts down the server. (Only actually used on the server) -+ */ - void serverShutdown(); - -- int getNumChunkDataPackets(); -+ /** -+ * returns 0 for memoryConnections -+ */ -+ int packetSize(); - -- void networkShutdown(String var1, Object... var2); -+ /** -+ * Shuts down the network with the specified reason. Closes all streams and sockets, spawns NetworkMasterThread to stop -+ * reading and writing threads. -+ */ -+ void networkShutdown(String var1, Object ... var2); - - void closeConnections(); - } ---- net/minecraft/src/Render.java -+++ net/minecraft/src/Render.java -@@ -2,38 +2,58 @@ - - import org.lwjgl.opengl.GL11; - -+import com.prupe.mcpatcher.mob.MobRandomizer; -+ - public abstract class Render { - private static final ResourceLocation shadowTextures = new ResourceLocation("textures/misc/shadow.png"); - protected RenderManager renderManager; - protected RenderBlocks renderBlocks = new RenderBlocks(); - protected float shadowSize; -+ -+ /** -+ * Determines the darkness of the object's shadow. Higher value makes a darker shadow. -+ */ - protected float shadowOpaque = 1.0F; - -+ /** -+ * Actually renders the given argument. This is a synthetic bridge method, always casting down its argument and then -+ * handing it off to a worker function which does the actual work. In all probabilty, the class Render is generic -+ * (Render Public -+ public void bindTexture(ResourceLocation par1ResourceLocation) { -+ this.renderManager.renderEngine.bindTexture(par1ResourceLocation); -+ } -+ // Spout End -+ -+ /** -+ * Renders fire on top of the entity. Args: entity, x, y, z, partialTickTime -+ */ -+ private void renderEntityOnFire(Entity par1Entity, double par2, double par4, double par6, float par8) { - GL11.glDisable(GL11.GL_LIGHTING); - Icon var9 = Block.fire.getFireIcon(0); - Icon var10 = Block.fire.getFireIcon(1); - GL11.glPushMatrix(); -- GL11.glTranslatef((float)var2, (float)var4, (float)var6); -- float var11 = var1.width * 1.4F; -- GL11.glScalef(var11, var11, var11); -+ GL11.glTranslatef((float)par2, (float)par4, (float)par6); -+ float var11 = par1Entity.width * 1.4F; -+ GL11.glScalef(var11, var11, var11); - Tessellator var12 = Tessellator.instance; - float var13 = 0.5F; - float var14 = 0.0F; -- float var15 = var1.height / var11; -- float var16 = (float)(var1.posY - var1.boundingBox.minY); -+ float var15 = par1Entity.height / var11; -+ float var16 = (float)(par1Entity.posY - par1Entity.boundingBox.minY); - GL11.glRotatef(-this.renderManager.playerViewY, 0.0F, 1.0F, 0.0F); - GL11.glTranslatef(0.0F, 0.0F, -0.3F + (float)((int)var15) * 0.02F); - GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); -@@ -41,14 +61,15 @@ - int var18 = 0; - var12.startDrawingQuads(); - -- while(var15 > 0.0F) { -+ while (var15 > 0.0F) { - Icon var19 = var18 % 2 == 0 ? var9 : var10; - this.bindTexture(TextureMap.locationBlocksTexture); - float var20 = var19.getMinU(); - float var21 = var19.getMinV(); - float var22 = var19.getMaxU(); - float var23 = var19.getMaxV(); -- if(var18 / 2 % 2 == 0) { -+ -+ if (var18 / 2 % 2 == 0) { - float var24 = var22; - var22 = var20; - var20 = var24; -@@ -70,42 +91,49 @@ - GL11.glEnable(GL11.GL_LIGHTING); - } - -- private void renderShadow(Entity var1, double var2, double var4, double var6, float var8, float var9) { -+ /** -+ * Renders the entity shadows at the position, shadow alpha and partialTickTime. Args: entity, x, y, z, shadowAlpha, -+ * partialTickTime -+ */ -+ private void renderShadow(Entity par1Entity, double par2, double par4, double par6, float par8, float par9) { - GL11.glEnable(GL11.GL_BLEND); - GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); - this.renderManager.renderEngine.bindTexture(shadowTextures); - World var10 = this.getWorldFromRenderManager(); - GL11.glDepthMask(false); - float var11 = this.shadowSize; -- if(var1 instanceof EntityLiving) { -- EntityLiving var12 = (EntityLiving)var1; -+ -+ if (par1Entity instanceof EntityLiving) { -+ EntityLiving var12 = (EntityLiving)par1Entity; - var11 *= var12.getRenderSizeModifier(); -- if(var12.isChild()) { -+ -+ if (var12.isChild()) { - var11 *= 0.5F; - } - } - -- double var35 = var1.lastTickPosX + (var1.posX - var1.lastTickPosX) * (double)var9; -- double var14 = var1.lastTickPosY + (var1.posY - var1.lastTickPosY) * (double)var9 + (double)var1.getShadowSize(); -- double var16 = var1.lastTickPosZ + (var1.posZ - var1.lastTickPosZ) * (double)var9; -+ double var35 = par1Entity.lastTickPosX + (par1Entity.posX - par1Entity.lastTickPosX) * (double)par9; -+ double var14 = par1Entity.lastTickPosY + (par1Entity.posY - par1Entity.lastTickPosY) * (double)par9 + (double)par1Entity.getShadowSize(); -+ double var16 = par1Entity.lastTickPosZ + (par1Entity.posZ - par1Entity.lastTickPosZ) * (double)par9; - int var18 = MathHelper.floor_double(var35 - (double)var11); - int var19 = MathHelper.floor_double(var35 + (double)var11); - int var20 = MathHelper.floor_double(var14 - (double)var11); - int var21 = MathHelper.floor_double(var14); - int var22 = MathHelper.floor_double(var16 - (double)var11); - int var23 = MathHelper.floor_double(var16 + (double)var11); -- double var24 = var2 - var35; -- double var26 = var4 - var14; -- double var28 = var6 - var16; -+ double var24 = par2 - var35; -+ double var26 = par4 - var14; -+ double var28 = par6 - var16; - Tessellator var30 = Tessellator.instance; - var30.startDrawingQuads(); - -- for(int var31 = var18; var31 <= var19; ++var31) { -- for(int var32 = var20; var32 <= var21; ++var32) { -- for(int var33 = var22; var33 <= var23; ++var33) { -+ for (int var31 = var18; var31 <= var19; ++var31) { -+ for (int var32 = var20; var32 <= var21; ++var32) { -+ for (int var33 = var22; var33 <= var23; ++var33) { - int var34 = var10.getBlockId(var31, var32 - 1, var33); -- if(var34 > 0 && var10.getBlockLightValue(var31, var32, var33) > 3) { -- this.renderShadowOnBlock(Block.blocksList[var34], var2, var4 + (double)var1.getShadowSize(), var6, var31, var32, var33, var8, var11, var24, var26 + (double)var1.getShadowSize(), var28); -+ -+ if (var34 > 0 && var10.getBlockLightValue(var31, var32, var33) > 3) { -+ this.renderShadowOnBlock(Block.blocksList[var34], par2, par4 + (double)par1Entity.getShadowSize(), par6, var31, var32, var33, par8, var11, var24, var26 + (double)par1Entity.getShadowSize(), var28); - } - } - } -@@ -117,29 +145,39 @@ - GL11.glDepthMask(true); - } - -+ /** -+ * Returns the render manager's world object -+ */ - private World getWorldFromRenderManager() { - return this.renderManager.worldObj; - } - -- private void renderShadowOnBlock(Block var1, double var2, double var4, double var6, int var8, int var9, int var10, float var11, float var12, double var13, double var15, double var17) { -+ /** -+ * Renders a shadow projected down onto the specified block. Brightness of the block plus how far away on the Y axis -+ * determines the alpha of the shadow. Args: block, centerX, centerY, centerZ, blockX, blockY, blockZ, baseAlpha, -+ * shadowSize, xOffset, yOffset, zOffset -+ */ -+ private void renderShadowOnBlock(Block par1Block, double par2, double par4, double par6, int par8, int par9, int par10, float par11, float par12, double par13, double par15, double par17) { - Tessellator var19 = Tessellator.instance; -- if(var1.renderAsNormalBlock()) { -- double var20 = ((double)var11 - (var4 - ((double)var9 + var15)) / 2.0D) * 0.5D * (double)this.getWorldFromRenderManager().getLightBrightness(var8, var9, var10); -- if(var20 >= 0.0D) { -- if(var20 > 1.0D) { -+ -+ if (par1Block.renderAsNormalBlock()) { -+ double var20 = ((double)par11 - (par4 - ((double)par9 + par15)) / 2.0D) * 0.5D * (double)this.getWorldFromRenderManager().getLightBrightness(par8, par9, par10); -+ -+ if (var20 >= 0.0D) { -+ if (var20 > 1.0D) { - var20 = 1.0D; - } - - var19.setColorRGBA_F(1.0F, 1.0F, 1.0F, (float)var20); -- double var22 = (double)var8 + var1.getMinX() + var13; -- double var24 = (double)var8 + var1.getBlockBoundsMaxX() + var13; -- double var26 = (double)var9 + var1.getBlockBoundsMinY() + var15 + 1.0D / 64.0D; -- double var28 = (double)var10 + var1.getBlockBoundsMinZ() + var17; -- double var30 = (double)var10 + var1.getBlockBoundsMaxZ() + var17; -- float var32 = (float)((var2 - var22) / 2.0D / (double)var12 + 0.5D); -- float var33 = (float)((var2 - var24) / 2.0D / (double)var12 + 0.5D); -- float var34 = (float)((var6 - var28) / 2.0D / (double)var12 + 0.5D); -- float var35 = (float)((var6 - var30) / 2.0D / (double)var12 + 0.5D); -+ double var22 = (double)par8 + par1Block.getBlockBoundsMinX() + par13; -+ double var24 = (double)par8 + par1Block.getBlockBoundsMaxX() + par13; -+ double var26 = (double)par9 + par1Block.getBlockBoundsMinY() + par15 + 0.015625D; -+ double var28 = (double)par10 + par1Block.getBlockBoundsMinZ() + par17; -+ double var30 = (double)par10 + par1Block.getBlockBoundsMaxZ() + par17; -+ float var32 = (float)((par2 - var22) / 2.0D / (double)par12 + 0.5D); -+ float var33 = (float)((par2 - var24) / 2.0D / (double)par12 + 0.5D); -+ float var34 = (float)((par6 - var28) / 2.0D / (double)par12 + 0.5D); -+ float var35 = (float)((par6 - var30) / 2.0D / (double)par12 + 0.5D); - var19.addVertexWithUV(var22, var26, var28, (double)var32, (double)var34); - var19.addVertexWithUV(var22, var26, var30, (double)var32, (double)var35); - var19.addVertexWithUV(var24, var26, var30, (double)var33, (double)var35); -@@ -148,100 +186,114 @@ - } - } - -- public static void renderOffsetAABB(AxisAlignedBB var0, double var1, double var3, double var5) { -+ /** -+ * Renders a white box with the bounds of the AABB translated by the offset. Args: aabb, x, y, z -+ */ -+ public static void renderOffsetAABB(AxisAlignedBB par0AxisAlignedBB, double par1, double par3, double par5) { - GL11.glDisable(GL11.GL_TEXTURE_2D); - Tessellator var7 = Tessellator.instance; - GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - var7.startDrawingQuads(); -- var7.setTranslation(var1, var3, var5); -+ var7.setTranslation(par1, par3, par5); - var7.setNormal(0.0F, 0.0F, -1.0F); -- var7.addVertex(var0.minX, var0.maxY, var0.minZ); -- var7.addVertex(var0.maxX, var0.maxY, var0.minZ); -- var7.addVertex(var0.maxX, var0.minY, var0.minZ); -- var7.addVertex(var0.minX, var0.minY, var0.minZ); -+ var7.addVertex(par0AxisAlignedBB.minX, par0AxisAlignedBB.maxY, par0AxisAlignedBB.minZ); -+ var7.addVertex(par0AxisAlignedBB.maxX, par0AxisAlignedBB.maxY, par0AxisAlignedBB.minZ); -+ var7.addVertex(par0AxisAlignedBB.maxX, par0AxisAlignedBB.minY, par0AxisAlignedBB.minZ); -+ var7.addVertex(par0AxisAlignedBB.minX, par0AxisAlignedBB.minY, par0AxisAlignedBB.minZ); - var7.setNormal(0.0F, 0.0F, 1.0F); -- var7.addVertex(var0.minX, var0.minY, var0.maxZ); -- var7.addVertex(var0.maxX, var0.minY, var0.maxZ); -- var7.addVertex(var0.maxX, var0.maxY, var0.maxZ); -- var7.addVertex(var0.minX, var0.maxY, var0.maxZ); -+ var7.addVertex(par0AxisAlignedBB.minX, par0AxisAlignedBB.minY, par0AxisAlignedBB.maxZ); -+ var7.addVertex(par0AxisAlignedBB.maxX, par0AxisAlignedBB.minY, par0AxisAlignedBB.maxZ); -+ var7.addVertex(par0AxisAlignedBB.maxX, par0AxisAlignedBB.maxY, par0AxisAlignedBB.maxZ); -+ var7.addVertex(par0AxisAlignedBB.minX, par0AxisAlignedBB.maxY, par0AxisAlignedBB.maxZ); - var7.setNormal(0.0F, -1.0F, 0.0F); -- var7.addVertex(var0.minX, var0.minY, var0.minZ); -- var7.addVertex(var0.maxX, var0.minY, var0.minZ); -- var7.addVertex(var0.maxX, var0.minY, var0.maxZ); -- var7.addVertex(var0.minX, var0.minY, var0.maxZ); -+ var7.addVertex(par0AxisAlignedBB.minX, par0AxisAlignedBB.minY, par0AxisAlignedBB.minZ); -+ var7.addVertex(par0AxisAlignedBB.maxX, par0AxisAlignedBB.minY, par0AxisAlignedBB.minZ); -+ var7.addVertex(par0AxisAlignedBB.maxX, par0AxisAlignedBB.minY, par0AxisAlignedBB.maxZ); -+ var7.addVertex(par0AxisAlignedBB.minX, par0AxisAlignedBB.minY, par0AxisAlignedBB.maxZ); - var7.setNormal(0.0F, 1.0F, 0.0F); -- var7.addVertex(var0.minX, var0.maxY, var0.maxZ); -- var7.addVertex(var0.maxX, var0.maxY, var0.maxZ); -- var7.addVertex(var0.maxX, var0.maxY, var0.minZ); -- var7.addVertex(var0.minX, var0.maxY, var0.minZ); -+ var7.addVertex(par0AxisAlignedBB.minX, par0AxisAlignedBB.maxY, par0AxisAlignedBB.maxZ); -+ var7.addVertex(par0AxisAlignedBB.maxX, par0AxisAlignedBB.maxY, par0AxisAlignedBB.maxZ); -+ var7.addVertex(par0AxisAlignedBB.maxX, par0AxisAlignedBB.maxY, par0AxisAlignedBB.minZ); -+ var7.addVertex(par0AxisAlignedBB.minX, par0AxisAlignedBB.maxY, par0AxisAlignedBB.minZ); - var7.setNormal(-1.0F, 0.0F, 0.0F); -- var7.addVertex(var0.minX, var0.minY, var0.maxZ); -- var7.addVertex(var0.minX, var0.maxY, var0.maxZ); -- var7.addVertex(var0.minX, var0.maxY, var0.minZ); -- var7.addVertex(var0.minX, var0.minY, var0.minZ); -+ var7.addVertex(par0AxisAlignedBB.minX, par0AxisAlignedBB.minY, par0AxisAlignedBB.maxZ); -+ var7.addVertex(par0AxisAlignedBB.minX, par0AxisAlignedBB.maxY, par0AxisAlignedBB.maxZ); -+ var7.addVertex(par0AxisAlignedBB.minX, par0AxisAlignedBB.maxY, par0AxisAlignedBB.minZ); -+ var7.addVertex(par0AxisAlignedBB.minX, par0AxisAlignedBB.minY, par0AxisAlignedBB.minZ); - var7.setNormal(1.0F, 0.0F, 0.0F); -- var7.addVertex(var0.maxX, var0.minY, var0.minZ); -- var7.addVertex(var0.maxX, var0.maxY, var0.minZ); -- var7.addVertex(var0.maxX, var0.maxY, var0.maxZ); -- var7.addVertex(var0.maxX, var0.minY, var0.maxZ); -+ var7.addVertex(par0AxisAlignedBB.maxX, par0AxisAlignedBB.minY, par0AxisAlignedBB.minZ); -+ var7.addVertex(par0AxisAlignedBB.maxX, par0AxisAlignedBB.maxY, par0AxisAlignedBB.minZ); -+ var7.addVertex(par0AxisAlignedBB.maxX, par0AxisAlignedBB.maxY, par0AxisAlignedBB.maxZ); -+ var7.addVertex(par0AxisAlignedBB.maxX, par0AxisAlignedBB.minY, par0AxisAlignedBB.maxZ); - var7.setTranslation(0.0D, 0.0D, 0.0D); - var7.draw(); - GL11.glEnable(GL11.GL_TEXTURE_2D); - } - -- public static void renderAABB(AxisAlignedBB var0) { -+ /** -+ * Adds to the tesselator a box using the aabb for the bounds. Args: aabb -+ */ -+ public static void renderAABB(AxisAlignedBB par0AxisAlignedBB) { - Tessellator var1 = Tessellator.instance; - var1.startDrawingQuads(); -- var1.addVertex(var0.minX, var0.maxY, var0.minZ); -- var1.addVertex(var0.maxX, var0.maxY, var0.minZ); -- var1.addVertex(var0.maxX, var0.minY, var0.minZ); -- var1.addVertex(var0.minX, var0.minY, var0.minZ); -- var1.addVertex(var0.minX, var0.minY, var0.maxZ); -- var1.addVertex(var0.maxX, var0.minY, var0.maxZ); -- var1.addVertex(var0.maxX, var0.maxY, var0.maxZ); -- var1.addVertex(var0.minX, var0.maxY, var0.maxZ); -- var1.addVertex(var0.minX, var0.minY, var0.minZ); -- var1.addVertex(var0.maxX, var0.minY, var0.minZ); -- var1.addVertex(var0.maxX, var0.minY, var0.maxZ); -- var1.addVertex(var0.minX, var0.minY, var0.maxZ); -- var1.addVertex(var0.minX, var0.maxY, var0.maxZ); -- var1.addVertex(var0.maxX, var0.maxY, var0.maxZ); -- var1.addVertex(var0.maxX, var0.maxY, var0.minZ); -- var1.addVertex(var0.minX, var0.maxY, var0.minZ); -- var1.addVertex(var0.minX, var0.minY, var0.maxZ); -- var1.addVertex(var0.minX, var0.maxY, var0.maxZ); -- var1.addVertex(var0.minX, var0.maxY, var0.minZ); -- var1.addVertex(var0.minX, var0.minY, var0.minZ); -- var1.addVertex(var0.maxX, var0.minY, var0.minZ); -- var1.addVertex(var0.maxX, var0.maxY, var0.minZ); -- var1.addVertex(var0.maxX, var0.maxY, var0.maxZ); -- var1.addVertex(var0.maxX, var0.minY, var0.maxZ); -+ var1.addVertex(par0AxisAlignedBB.minX, par0AxisAlignedBB.maxY, par0AxisAlignedBB.minZ); -+ var1.addVertex(par0AxisAlignedBB.maxX, par0AxisAlignedBB.maxY, par0AxisAlignedBB.minZ); -+ var1.addVertex(par0AxisAlignedBB.maxX, par0AxisAlignedBB.minY, par0AxisAlignedBB.minZ); -+ var1.addVertex(par0AxisAlignedBB.minX, par0AxisAlignedBB.minY, par0AxisAlignedBB.minZ); -+ var1.addVertex(par0AxisAlignedBB.minX, par0AxisAlignedBB.minY, par0AxisAlignedBB.maxZ); -+ var1.addVertex(par0AxisAlignedBB.maxX, par0AxisAlignedBB.minY, par0AxisAlignedBB.maxZ); -+ var1.addVertex(par0AxisAlignedBB.maxX, par0AxisAlignedBB.maxY, par0AxisAlignedBB.maxZ); -+ var1.addVertex(par0AxisAlignedBB.minX, par0AxisAlignedBB.maxY, par0AxisAlignedBB.maxZ); -+ var1.addVertex(par0AxisAlignedBB.minX, par0AxisAlignedBB.minY, par0AxisAlignedBB.minZ); -+ var1.addVertex(par0AxisAlignedBB.maxX, par0AxisAlignedBB.minY, par0AxisAlignedBB.minZ); -+ var1.addVertex(par0AxisAlignedBB.maxX, par0AxisAlignedBB.minY, par0AxisAlignedBB.maxZ); -+ var1.addVertex(par0AxisAlignedBB.minX, par0AxisAlignedBB.minY, par0AxisAlignedBB.maxZ); -+ var1.addVertex(par0AxisAlignedBB.minX, par0AxisAlignedBB.maxY, par0AxisAlignedBB.maxZ); -+ var1.addVertex(par0AxisAlignedBB.maxX, par0AxisAlignedBB.maxY, par0AxisAlignedBB.maxZ); -+ var1.addVertex(par0AxisAlignedBB.maxX, par0AxisAlignedBB.maxY, par0AxisAlignedBB.minZ); -+ var1.addVertex(par0AxisAlignedBB.minX, par0AxisAlignedBB.maxY, par0AxisAlignedBB.minZ); -+ var1.addVertex(par0AxisAlignedBB.minX, par0AxisAlignedBB.minY, par0AxisAlignedBB.maxZ); -+ var1.addVertex(par0AxisAlignedBB.minX, par0AxisAlignedBB.maxY, par0AxisAlignedBB.maxZ); -+ var1.addVertex(par0AxisAlignedBB.minX, par0AxisAlignedBB.maxY, par0AxisAlignedBB.minZ); -+ var1.addVertex(par0AxisAlignedBB.minX, par0AxisAlignedBB.minY, par0AxisAlignedBB.minZ); -+ var1.addVertex(par0AxisAlignedBB.maxX, par0AxisAlignedBB.minY, par0AxisAlignedBB.minZ); -+ var1.addVertex(par0AxisAlignedBB.maxX, par0AxisAlignedBB.maxY, par0AxisAlignedBB.minZ); -+ var1.addVertex(par0AxisAlignedBB.maxX, par0AxisAlignedBB.maxY, par0AxisAlignedBB.maxZ); -+ var1.addVertex(par0AxisAlignedBB.maxX, par0AxisAlignedBB.minY, par0AxisAlignedBB.maxZ); - var1.draw(); - } - -- public void setRenderManager(RenderManager var1) { -- this.renderManager = var1; -+ /** -+ * Sets the RenderManager. -+ */ -+ public void setRenderManager(RenderManager par1RenderManager) { -+ this.renderManager = par1RenderManager; - } - -- public void doRenderShadowAndFire(Entity var1, double var2, double var4, double var6, float var8, float var9) { -- if(this.renderManager.options.fancyGraphics && this.shadowSize > 0.0F && !var1.isInvisible()) { -- double var10 = this.renderManager.getDistanceToCamera(var1.posX, var1.posY, var1.posZ); -+ /** -+ * Renders the entity's shadow and fire (if its on fire). Args: entity, x, y, z, yaw, partialTickTime -+ */ -+ public void doRenderShadowAndFire(Entity par1Entity, double par2, double par4, double par6, float par8, float par9) { -+ if (this.renderManager.options.fancyGraphics && this.shadowSize > 0.0F && !par1Entity.isInvisible()) { -+ double var10 = this.renderManager.getDistanceToCamera(par1Entity.posX, par1Entity.posY, par1Entity.posZ); - float var12 = (float)((1.0D - var10 / 256.0D) * (double)this.shadowOpaque); -- if(var12 > 0.0F) { -- this.renderShadow(var1, var2, var4, var6, var12, var9); -+ -+ if (var12 > 0.0F) { -+ this.renderShadow(par1Entity, par2, par4, par6, var12, par9); - } - } - -- if(var1.canRenderOnFire()) { -- this.renderEntityOnFire(var1, var2, var4, var6, var9); -+ if (par1Entity.canRenderOnFire()) { -+ this.renderEntityOnFire(par1Entity, par2, par4, par6, par9); - } -- - } - -+ /** -+ * Returns the font renderer from the set render manager -+ */ - public FontRenderer getFontRendererFromRenderManager() { - return this.renderManager.getFontRenderer(); - } - -- public void updateIcons(IconRegister var1) { -- } -+ public void updateIcons(IconRegister par1IconRegister) {} - } ---- /dev/null -+++ org/spoutcraft/client/packet/CustomPacket.java -@@ -1,0 +1,166 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.client.packet; -+ -+import java.io.DataInput; -+import java.io.DataInputStream; -+import java.io.DataOutput; -+import java.io.DataOutputStream; -+import java.io.IOException; -+import java.nio.ByteBuffer; -+ -+import net.minecraft.src.NetHandler; -+import net.minecraft.src.Packet; -+ -+import org.spoutcraft.api.io.SpoutInputStream; -+import org.spoutcraft.api.io.SpoutOutputStream; -+import org.spoutcraft.client.PacketDecompressionThread; -+import org.spoutcraft.client.SpoutClient; -+ -+public class CustomPacket extends Packet { -+ public SpoutPacket packet; -+ private boolean success = false; -+ private static final int[] nags; -+ protected static final int NAG_MSG_AMT = 10; -+ protected static boolean outdated = false; -+ -+ static { -+ int packets = PacketType.values()[PacketType.values().length - 1].getId(); -+ nags = new int[packets]; -+ for (int i = 0; i < packets; i++) { -+ nags[i] = NAG_MSG_AMT; -+ } -+ } -+ -+ public CustomPacket() { -+ } -+ -+ public CustomPacket(SpoutPacket packet) { -+ this.packet = packet; -+ } -+ -+ public int getPacketSize() { -+ //if (packet == null) { -+ return 8; -+ //} else { -+ // return packet.getNumBytes() + 8; -+ //} -+ } -+ -+ @Override -+ public void readPacketData(DataInput var1) throws IOException { -+ SpoutClient.getInstance().setSpoutActive(true); -+ final boolean prevOutdated = outdated; -+ int packetId; -+ packetId = var1.readShort(); -+ int version = var1.readShort(); // Packet version -+ int length = var1.readInt(); // Packet size -+ //System.out.println("Reading Packet: " + PacketType.getPacketFromId(packetId) + " Size: " + length + " bytes, version: " + version); -+ if (packetId > -1 && version > -1) { -+ try { -+ this.packet = PacketType.getPacketFromId(packetId).getPacketClass().newInstance(); -+ } catch (Exception e) { -+ System.out.println("Failed to identify packet ID: " + packetId); -+ //e.printStackTrace(); -+ } -+ } -+ try { -+ if (this.packet == null) { -+ var1.skipBytes(length); -+ System.out.println("Unknown packet " + packetId + ". Skipping contents."); -+ return; -+ } else if (packet.getVersion() != version) { -+ var1.skipBytes(length); -+ // Keep server admins from going insane -+ if (nags[packetId]-- > 0) { -+ System.out.println("Invalid Packet ID: " + packetId + ". Current v: " + packet.getVersion() + " Receieved v: " + version + " Skipping contents."); -+ } -+ outdated = outdated || version > packet.getVersion(); -+ } else { -+ byte[] data = new byte[length]; -+ var1.readFully(data); -+ -+ SpoutInputStream stream = new SpoutInputStream(ByteBuffer.wrap(data)); -+ packet.readData(stream); -+ success = true; -+ } -+ } catch (Exception e) { -+ System.out.println("------------------------"); -+ System.out.println("Unexpected Exception: " + PacketType.getPacketFromId(packetId) + ", " + packetId); -+ e.printStackTrace(); -+ System.out.println("------------------------"); -+ } -+ if (prevOutdated != outdated) { -+ SpoutClient.getInstance().getActivePlayer().showAchievement("Update Available!", "New Spoutcraft update!", 323 /*Sign*/); -+ } -+ } -+ -+ @Override -+ public void writePacketData(DataOutput var1) throws IOException { -+ if (packet == null) { -+ var1.writeShort(-1); -+ var1.writeShort(-1); -+ var1.writeInt(0); -+ return; -+ } -+ //System.out.println("Writing Packet Data for " + packet.getPacketType()); -+ var1.writeShort(packet.getPacketType().getId()); -+ var1.writeShort(packet.getVersion()); -+ final SpoutOutputStream stream = new SpoutOutputStream(); -+ packet.writeData(stream); -+ ByteBuffer buffer = stream.getRawBuffer(); -+ byte[] data = new byte[buffer.capacity() - buffer.remaining()]; -+ System.arraycopy(buffer.array(), 0, data, 0, data.length); -+ -+ var1.writeInt(data.length); -+ var1.write(data, 0, data.length); -+ } -+ -+ @Override -+ public void processPacket(NetHandler netHandler) { -+ if (packet != null) { -+ if (success) { -+ if (packet instanceof CompressablePacket) { -+ PacketDecompressionThread.add((CompressablePacket)packet); -+ } else { -+ SpoutClient.getHandle().mcProfiler.startSection("spoutpacket_" + packet.getClass().getSimpleName()); -+ try { -+ packet.run(SpoutClient.getHandle().thePlayer.entityId); -+ } catch (Exception e) { -+ System.out.println("------------------------"); -+ System.out.println("Unexpected Exception: " + packet.getPacketType()); -+ e.printStackTrace(); -+ System.out.println("------------------------"); -+ } -+ SpoutClient.getHandle().mcProfiler.endSection(); -+ } -+ } else { -+ try { -+ packet.failure(SpoutClient.getHandle().thePlayer.entityId); -+ } catch (Exception e) { -+ System.out.println("------------------------"); -+ System.out.println("Unexpected Exception: " + packet.getPacketType()); -+ e.printStackTrace(); -+ System.out.println("------------------------"); -+ } -+ } -+ } -+ } -+} ---- /dev/null -+++ org/spoutcraft/client/util/UniqueItemStringMap.java -@@ -1,0 +1,157 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.client.util; -+ -+import java.util.Set; -+import java.util.concurrent.ConcurrentHashMap; -+import java.util.concurrent.atomic.AtomicInteger; -+ -+public class UniqueItemStringMap { -+ private static final ConcurrentHashMap reverse = new ConcurrentHashMap(); -+ private static final ConcurrentHashMap reverseStable = new ConcurrentHashMap(); -+ private static final ConcurrentHashMap forward = new ConcurrentHashMap(); -+ -+ private static final AtomicInteger idCounter = new AtomicInteger(1024); -+ -+// private static Configuration config; -+ -+// public static void setConfigFile(Configuration config) { -+// UniqueItemStringMap.config = config; -+// List keys = config.getKeys(); -+// -+// for (String key : keys) { -+// Integer id = getIdFromFile(decodeKey(key)); -+// if (id != null) { -+// forward.put(key, id); -+// reverse.put(id, key); -+// reverseStable.put(id, key); -+// } -+// } -+// } -+ -+// private static Integer getIdFromFile(String key) { -+// -+// synchronized(config) { -+// key = encodeKey(key); -+// if (config.getProperty(key) == null) { -+// return null; -+// } else { -+// int id = config.getInt(key, -1); -+// if (id == -1) { -+// config.removeProperty(key); -+// return null; -+// } else { -+// return id; -+// } -+// } -+// } -+// -+// } -+ -+// private static void setIdInFile(String key, int id) { -+// -+// synchronized(config) { -+// key = encodeKey(key); -+// config.setProperty(key, id); -+// config.save(); -+// } -+// -+// } -+ -+ private static String encodeKey(String key) { -+ key = key.replace("*", "-*-"); -+ return key.replace(".", "**"); -+ } -+ -+ private static String decodeKey(String key) { -+ key = key.replace("**", "."); -+ return key.replace("-*-", "*"); -+ } -+ -+ public static Set getIds() { -+ return reverse.keySet(); -+ } -+ -+ /** -+ * Associates a unique id for each string -+ * -+ * These associations persist over reloads and server restarts -+ * -+ * @param string the string to be associated -+ * @return the id associated with the string. -+ */ -+ public static int getId(String string) { -+ string = encodeKey(string); -+ -+ Integer id = null; -+ -+ boolean success = false; -+ int testId = idCounter.incrementAndGet() & 0x0FFFF; -+ -+ while (!success || id == null) { -+ id = forward.get(string); -+ if (id != null) { -+ return id; -+ } -+ -+ if (reverse.containsKey(testId)) { // id already in use -+ testId = idCounter.incrementAndGet() & 0x0FFFF; -+ if (testId == 65535 || testId < 1024) { -+ throw new RuntimeException("[Spout] Out of custom item IDs"); -+ } -+ continue; -+ } -+ -+ String oldString = reverse.putIfAbsent(testId, string); -+ -+ if (oldString == null) { // reverse link success -+ Integer oldId = forward.putIfAbsent(string, testId); -+ if (oldId != null) { // forward link failed -+ reverse.remove(testId, string); // remove reverse link -+ continue; -+ } -+ id = testId; -+ } else { // reverse link failed -+ continue; -+ } -+ -+ reverseStable.put(testId, string); -+ -+// setIdInFile(decodeKey(string), id); -+ -+ success = true; -+ } -+ return id; -+ } -+ -+ /** -+ * Returns the id associated with a string -+ * -+ * These associations persist over reloads and server restarts -+ * -+ * Note: . characters are replaced with * characters -+ * -+ * @param id the id -+ * @return the string associated with the id, or null if no string is associated -+ */ -+ public static String getString(int id) { -+ return decodeKey(reverseStable.get(id)); -+ } -+} ---- net/minecraft/src/Item.java -+++ net/minecraft/src/Item.java -@@ -1,15 +1,22 @@ - package net.minecraft.src; - --import com.google.common.collect.HashMultimap; --import com.google.common.collect.Multimap; - import java.util.List; - import java.util.Random; - import java.util.UUID; - -+import com.google.common.collect.HashMultimap; -+import com.google.common.collect.Multimap; -+ -+import org.spoutcraft.client.item.SpoutItem; -+ - public class Item { -- protected static final UUID e = UUID.fromString("CB3F55D3-645C-4F38-A497-9C13A33DB5CF"); -- private CreativeTabs tabToDisplayOn; -- protected static Random f = new Random(); -+ protected static final UUID field_111210_e = UUID.fromString("CB3F55D3-645C-4F38-A497-9C13A33DB5CF"); -+ private CreativeTabs tabToDisplayOn; -+ -+ /** The RNG used by the Item subclasses. */ -+ protected static Random itemRand = new Random(); -+ -+ /** A 32000 elements Item array. */ - public static Item[] itemsList = new Item[32000]; - public static Item shovelIron = (new ItemSpade(0, EnumToolMaterial.IRON)).setUnlocalizedName("shovelIron").setTextureName("iron_shovel"); - public static Item pickaxeIron = (new ItemPickaxe(1, EnumToolMaterial.IRON)).setUnlocalizedName("pickaxeIron").setTextureName("iron_pickaxe"); -@@ -44,7 +51,7 @@ - public static Item axeGold = (new ItemAxe(30, EnumToolMaterial.GOLD)).setUnlocalizedName("hatchetGold").setTextureName("gold_axe"); - public static Item silk = (new ItemReed(31, Block.tripWire)).setUnlocalizedName("string").setCreativeTab(CreativeTabs.tabMaterials).setTextureName("string"); - public static Item feather = (new Item(32)).setUnlocalizedName("feather").setCreativeTab(CreativeTabs.tabMaterials).setTextureName("feather"); -- public static Item gunpowder = (new Item(33)).setUnlocalizedName("sulphur").setPotionEffect(PotionHelper.k).setCreativeTab(CreativeTabs.tabMaterials).setTextureName("gunpowder"); -+ public static Item gunpowder = (new Item(33)).setUnlocalizedName("sulphur").setPotionEffect(PotionHelper.gunpowderEffect).setCreativeTab(CreativeTabs.tabMaterials).setTextureName("gunpowder"); - public static Item hoeWood = (new ItemHoe(34, EnumToolMaterial.WOOD)).setUnlocalizedName("hoeWood").setTextureName("wood_hoe"); - public static Item hoeStone = (new ItemHoe(35, EnumToolMaterial.STONE)).setUnlocalizedName("hoeStone").setTextureName("stone_hoe"); - public static Item hoeIron = (new ItemHoe(36, EnumToolMaterial.IRON)).setUnlocalizedName("hoeIron").setTextureName("iron_hoe"); -@@ -73,7 +80,11 @@ - public static ItemArmor plateGold = (ItemArmor)(new ItemArmor(59, EnumArmorMaterial.GOLD, 4, 1)).setUnlocalizedName("chestplateGold").setTextureName("gold_chestplate"); - public static ItemArmor legsGold = (ItemArmor)(new ItemArmor(60, EnumArmorMaterial.GOLD, 4, 2)).setUnlocalizedName("leggingsGold").setTextureName("gold_leggings"); - public static ItemArmor bootsGold = (ItemArmor)(new ItemArmor(61, EnumArmorMaterial.GOLD, 4, 3)).setUnlocalizedName("bootsGold").setTextureName("gold_boots"); -- public static Item flint = (new Item(62)).setUnlocalizedName("flint").setCreativeTab(CreativeTabs.tabMaterials).setTextureName("flint"); -+ -+ // Spout Start - Changed to SpoutItemBlock -+ public static Item flint = (new SpoutItem(62)).setUnlocalizedName("flint").setCreativeTab(CreativeTabs.tabMaterials).setTextureName("flint"); -+ // Spout End -+ - public static Item porkRaw = (new ItemFood(63, 3, 0.3F, true)).setUnlocalizedName("porkchopRaw").setTextureName("porkchop_raw"); - public static Item porkCooked = (new ItemFood(64, 8, 0.8F, true)).setUnlocalizedName("porkchopCooked").setTextureName("porkchop_cooked"); - public static Item painting = (new ItemHangingEntity(65, EntityPainting.class)).setUnlocalizedName("painting").setTextureName("painting"); -@@ -86,7 +97,7 @@ - public static Item minecartEmpty = (new ItemMinecart(72, 0)).setUnlocalizedName("minecart").setTextureName("minecart_normal"); - public static Item saddle = (new ItemSaddle(73)).setUnlocalizedName("saddle").setTextureName("saddle"); - public static Item doorIron = (new ItemDoor(74, Material.iron)).setUnlocalizedName("doorIron").setTextureName("door_iron"); -- public static Item redstone = (new ItemRedstone(75)).setUnlocalizedName("redstone").setPotionEffect(PotionHelper.i).setTextureName("redstone_dust"); -+ public static Item redstone = (new ItemRedstone(75)).setUnlocalizedName("redstone").setPotionEffect(PotionHelper.redstoneEffect).setTextureName("redstone_dust"); - public static Item snowball = (new ItemSnowball(76)).setUnlocalizedName("snowball").setTextureName("snowball"); - public static Item boat = (new ItemBoat(77)).setUnlocalizedName("boat").setTextureName("boat"); - public static Item leather = (new Item(78)).setUnlocalizedName("leather").setCreativeTab(CreativeTabs.tabMaterials).setTextureName("leather"); -@@ -103,17 +114,21 @@ - public static Item compass = (new Item(89)).setUnlocalizedName("compass").setCreativeTab(CreativeTabs.tabTools).setTextureName("compass"); - public static ItemFishingRod fishingRod = (ItemFishingRod)(new ItemFishingRod(90)).setUnlocalizedName("fishingRod").setTextureName("fishing_rod"); - public static Item pocketSundial = (new Item(91)).setUnlocalizedName("clock").setCreativeTab(CreativeTabs.tabTools).setTextureName("clock"); -- public static Item glowstone = (new Item(92)).setUnlocalizedName("yellowDust").setPotionEffect(PotionHelper.j).setCreativeTab(CreativeTabs.tabMaterials).setTextureName("glowstone_dust"); -+ public static Item glowstone = (new Item(92)).setUnlocalizedName("yellowDust").setPotionEffect(PotionHelper.glowstoneEffect).setCreativeTab(CreativeTabs.tabMaterials).setTextureName("glowstone_dust"); - public static Item fishRaw = (new ItemFood(93, 2, 0.3F, false)).setUnlocalizedName("fishRaw").setTextureName("fish_raw"); - public static Item fishCooked = (new ItemFood(94, 5, 0.6F, false)).setUnlocalizedName("fishCooked").setTextureName("fish_cooked"); - public static Item dyePowder = (new ItemDye(95)).setUnlocalizedName("dyePowder").setTextureName("dye_powder"); - public static Item bone = (new Item(96)).setUnlocalizedName("bone").setFull3D().setCreativeTab(CreativeTabs.tabMisc).setTextureName("bone"); -- public static Item sugar = (new Item(97)).setUnlocalizedName("sugar").setPotionEffect(PotionHelper.b).setCreativeTab(CreativeTabs.tabMaterials).setTextureName("sugar"); -+ public static Item sugar = (new Item(97)).setUnlocalizedName("sugar").setPotionEffect(PotionHelper.sugarEffect).setCreativeTab(CreativeTabs.tabMaterials).setTextureName("sugar"); - public static Item cake = (new ItemReed(98, Block.cake)).setMaxStackSize(1).setUnlocalizedName("cake").setCreativeTab(CreativeTabs.tabFood).setTextureName("cake"); - public static Item bed = (new ItemBed(99)).setMaxStackSize(1).setUnlocalizedName("bed").setTextureName("bed"); - public static Item redstoneRepeater = (new ItemReed(100, Block.redstoneRepeaterIdle)).setUnlocalizedName("diode").setCreativeTab(CreativeTabs.tabRedstone).setTextureName("repeater"); - public static Item cookie = (new ItemFood(101, 2, 0.1F, false)).setUnlocalizedName("cookie").setTextureName("cookie"); - public static ItemMap map = (ItemMap)(new ItemMap(102)).setUnlocalizedName("map").setTextureName("map_filled"); -+ -+ /** -+ * Item introduced on 1.7 version, is a shear to cut leaves (you can keep the block) or get wool from sheeps. -+ */ - public static ItemShears shears = (ItemShears)(new ItemShears(103)).setUnlocalizedName("shears").setTextureName("shears"); - public static Item melon = (new ItemFood(104, 2, 0.3F, false)).setUnlocalizedName("melon").setTextureName("melon"); - public static Item pumpkinSeeds = (new ItemSeeds(105, Block.pumpkinStem.blockID, Block.tilledField.blockID)).setUnlocalizedName("seeds_pumpkin").setTextureName("seeds_pumpkin"); -@@ -125,21 +140,29 @@ - public static Item rottenFlesh = (new ItemFood(111, 4, 0.1F, true)).setPotionEffect(Potion.hunger.id, 30, 0, 0.8F).setUnlocalizedName("rottenFlesh").setTextureName("rotten_flesh"); - public static Item enderPearl = (new ItemEnderPearl(112)).setUnlocalizedName("enderPearl").setTextureName("ender_pearl"); - public static Item blazeRod = (new Item(113)).setUnlocalizedName("blazeRod").setCreativeTab(CreativeTabs.tabMaterials).setTextureName("blaze_rod"); -- public static Item ghastTear = (new Item(114)).setUnlocalizedName("ghastTear").setPotionEffect(PotionHelper.c).setCreativeTab(CreativeTabs.tabBrewing).setTextureName("ghast_tear"); -+ public static Item ghastTear = (new Item(114)).setUnlocalizedName("ghastTear").setPotionEffect(PotionHelper.ghastTearEffect).setCreativeTab(CreativeTabs.tabBrewing).setTextureName("ghast_tear"); - public static Item goldNugget = (new Item(115)).setUnlocalizedName("goldNugget").setCreativeTab(CreativeTabs.tabMaterials).setTextureName("gold_nugget"); - public static Item netherStalkSeeds = (new ItemSeeds(116, Block.netherStalk.blockID, Block.slowSand.blockID)).setUnlocalizedName("netherStalkSeeds").setPotionEffect("+4").setTextureName("nether_wart"); - public static ItemPotion potion = (ItemPotion)(new ItemPotion(117)).setUnlocalizedName("potion").setTextureName("potion"); - public static Item glassBottle = (new ItemGlassBottle(118)).setUnlocalizedName("glassBottle").setTextureName("potion_bottle_empty"); -- public static Item spiderEye = (new ItemFood(119, 2, 0.8F, false)).setPotionEffect(Potion.poison.id, 5, 0, 1.0F).setUnlocalizedName("spiderEye").setPotionEffect(PotionHelper.d).setTextureName("spider_eye"); -- public static Item fermentedSpiderEye = (new Item(120)).setUnlocalizedName("fermentedSpiderEye").setPotionEffect(PotionHelper.e).setCreativeTab(CreativeTabs.tabBrewing).setTextureName("spider_eye_fermented"); -- public static Item blazePowder = (new Item(121)).setUnlocalizedName("blazePowder").setPotionEffect(PotionHelper.g).setCreativeTab(CreativeTabs.tabBrewing).setTextureName("blaze_powder"); -- public static Item magmaCream = (new Item(122)).setUnlocalizedName("magmaCream").setPotionEffect(PotionHelper.h).setCreativeTab(CreativeTabs.tabBrewing).setTextureName("magma_cream"); -+ public static Item spiderEye = (new ItemFood(119, 2, 0.8F, false)).setPotionEffect(Potion.poison.id, 5, 0, 1.0F).setUnlocalizedName("spiderEye").setPotionEffect(PotionHelper.spiderEyeEffect).setTextureName("spider_eye"); -+ public static Item fermentedSpiderEye = (new Item(120)).setUnlocalizedName("fermentedSpiderEye").setPotionEffect(PotionHelper.fermentedSpiderEyeEffect).setCreativeTab(CreativeTabs.tabBrewing).setTextureName("spider_eye_fermented"); -+ public static Item blazePowder = (new Item(121)).setUnlocalizedName("blazePowder").setPotionEffect(PotionHelper.blazePowderEffect).setCreativeTab(CreativeTabs.tabBrewing).setTextureName("blaze_powder"); -+ public static Item magmaCream = (new Item(122)).setUnlocalizedName("magmaCream").setPotionEffect(PotionHelper.magmaCreamEffect).setCreativeTab(CreativeTabs.tabBrewing).setTextureName("magma_cream"); - public static Item brewingStand = (new ItemReed(123, Block.brewingStand)).setUnlocalizedName("brewingStand").setCreativeTab(CreativeTabs.tabBrewing).setTextureName("brewing_stand"); - public static Item cauldron = (new ItemReed(124, Block.cauldron)).setUnlocalizedName("cauldron").setCreativeTab(CreativeTabs.tabBrewing).setTextureName("cauldron"); - public static Item eyeOfEnder = (new ItemEnderEye(125)).setUnlocalizedName("eyeOfEnder").setTextureName("ender_eye"); -- public static Item speckledMelon = (new Item(126)).setUnlocalizedName("speckledMelon").setPotionEffect(PotionHelper.f).setCreativeTab(CreativeTabs.tabBrewing).setTextureName("melon_speckled"); -+ public static Item speckledMelon = (new Item(126)).setUnlocalizedName("speckledMelon").setPotionEffect(PotionHelper.speckledMelonEffect).setCreativeTab(CreativeTabs.tabBrewing).setTextureName("melon_speckled"); - public static Item monsterPlacer = (new ItemMonsterPlacer(127)).setUnlocalizedName("monsterPlacer").setTextureName("spawn_egg"); -+ -+ /** -+ * Bottle o' Enchanting. Drops between 1 and 3 experience orbs when thrown. -+ */ - public static Item expBottle = (new ItemExpBottle(128)).setUnlocalizedName("expBottle").setTextureName("experience_bottle"); -+ -+ /** -+ * Fire Charge. When used in a dispenser it fires a fireball similiar to a Ghast's. -+ */ - public static Item fireballCharge = (new ItemFireball(129)).setUnlocalizedName("fireball").setTextureName("fireball"); - public static Item writableBook = (new ItemWritableBook(130)).setUnlocalizedName("writingBook").setCreativeTab(CreativeTabs.tabMisc).setTextureName("book_writable"); - public static Item writtenBook = (new ItemEditableBook(131)).setUnlocalizedName("writtenBook").setTextureName("book_written"); -@@ -151,7 +174,7 @@ - public static Item bakedPotato = (new ItemFood(137, 6, 0.6F, false)).setUnlocalizedName("potatoBaked").setTextureName("potato_baked"); - public static Item poisonousPotato = (new ItemFood(138, 2, 0.3F, false)).setPotionEffect(Potion.poison.id, 5, 0, 0.6F).setUnlocalizedName("potatoPoisonous").setTextureName("potato_poisonous"); - public static ItemEmptyMap emptyMap = (ItemEmptyMap)(new ItemEmptyMap(139)).setUnlocalizedName("emptyMap").setTextureName("map_empty"); -- public static Item goldenCarrot = (new ItemFood(140, 6, 1.2F, false)).setUnlocalizedName("carrotGolden").setPotionEffect(PotionHelper.l).setTextureName("carrot_golden"); -+ public static Item goldenCarrot = (new ItemFood(140, 6, 1.2F, false)).setUnlocalizedName("carrotGolden").setPotionEffect(PotionHelper.goldenCarrotEffect).setTextureName("carrot_golden"); - public static Item skull = (new ItemSkull(141)).setUnlocalizedName("skull").setTextureName("skull"); - public static Item carrotOnAStick = (new ItemCarrotOnAStick(142)).setUnlocalizedName("carrotOnAStick").setTextureName("carrot_on_a_stick"); - public static Item netherStar = (new ItemSimpleFoiled(143)).setUnlocalizedName("netherStar").setCreativeTab(CreativeTabs.tabMaterials).setTextureName("nether_star"); -@@ -162,7 +185,7 @@ - public static Item comparator = (new ItemReed(148, Block.redstoneComparatorIdle)).setUnlocalizedName("comparator").setCreativeTab(CreativeTabs.tabRedstone).setTextureName("comparator"); - public static Item netherrackBrick = (new Item(149)).setUnlocalizedName("netherbrick").setCreativeTab(CreativeTabs.tabMaterials).setTextureName("netherbrick"); - public static Item netherQuartz = (new Item(150)).setUnlocalizedName("netherquartz").setCreativeTab(CreativeTabs.tabMaterials).setTextureName("quartz"); -- public static Item tntMinecart = (new ItemMinecart(151, 3)).setUnlocalizedName("minecartTnt").setTextureName("minecart_tnt"); -+ public static Item minecartTnt = (new ItemMinecart(151, 3)).setUnlocalizedName("minecartTnt").setTextureName("minecart_tnt"); - public static Item minecartHopper = (new ItemMinecart(152, 5)).setUnlocalizedName("minecartHopper").setTextureName("minecart_hopper"); - public static Item horseArmorIron = (new Item(161)).setUnlocalizedName("horsearmormetal").setMaxStackSize(1).setCreativeTab(CreativeTabs.tabMisc).setTextureName("iron_horse_armor"); - public static Item horseArmorGold = (new Item(162)).setUnlocalizedName("horsearmorgold").setMaxStackSize(1).setCreativeTab(CreativeTabs.tabMisc).setTextureName("gold_horse_armor"); -@@ -181,64 +204,109 @@ - public static Item recordWard = (new ItemRecord(2009, "ward")).setUnlocalizedName("record").setTextureName("record_ward"); - public static Item record11 = (new ItemRecord(2010, "11")).setUnlocalizedName("record").setTextureName("record_11"); - public static Item recordWait = (new ItemRecord(2011, "wait")).setUnlocalizedName("record").setTextureName("record_wait"); -+ -+ /** The ID of this item. */ - public final int itemID; -+ -+ /** Maximum size of the stack. */ - protected int maxStackSize = 64; -+ -+ /** Maximum damage an item can handle. */ - private int maxDamage; -+ -+ /** If true, render the object in full 3D, like weapons and tools. */ - protected boolean bFull3D; -+ -+ /** -+ * Some items (like dyes) have multiple subtypes on same item, this is field define this behavior -+ */ - protected boolean hasSubtypes; - private Item containerItem; -- private String d; -- private String cB; -+ private String potionEffect; -+ -+ /** The unlocalized name of this item. */ -+ private String unlocalizedName; -+ -+ /** Icon index in the icons table. */ - protected Icon itemIcon; -- protected String cA; -- -- protected Item(int var1) { -- this.itemID = 256 + var1; -- if(itemsList[256 + var1] != null) { -- System.out.println("CONFLICT @ " + var1); -+ -+ /** The string associated with this Item's Icon. */ -+ protected String iconString; -+ -+ protected Item(int par1) { -+ this.itemID = 256 + par1; -+ -+ if (itemsList[256 + par1] != null) { -+ System.out.println("CONFLICT @ " + par1); - } - -- itemsList[256 + var1] = this; -+ itemsList[256 + par1] = this; - } - -- public Item setMaxStackSize(int var1) { -- this.maxStackSize = var1; -+ public Item setMaxStackSize(int par1) { -+ this.maxStackSize = par1; - return this; - } - -+ /** -+ * Returns 0 for /terrain.png, 1 for /gui/items.png -+ */ - public int getSpriteNumber() { - return 1; - } - -- public Icon getIconFromDamage(int var1) { -+ /** -+ * Gets an icon index based on an item's damage value -+ */ -+ public Icon getIconFromDamage(int par1) { - return this.itemIcon; - } - -- public final Icon getIconIndex(ItemStack var1) { -- return this.getIconFromDamage(var1.getItemDamage()); -+ /** -+ * Returns the icon index of the stack given as argument. -+ */ -+ public final Icon getIconIndex(ItemStack par1ItemStack) { -+ return this.getIconFromDamage(par1ItemStack.getItemDamage()); - } - -- public boolean onItemUse(ItemStack var1, EntityPlayer var2, World var3, int var4, int var5, int var6, int var7, float var8, float var9, float var10) { -+ /** -+ * Callback for item usage. If the item does something special on right clicking, he will have one of those. Return -+ * True if something happen and false if it don't. This is for ITEMS, not BLOCKS -+ */ -+ public boolean onItemUse(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, World par3World, int par4, int par5, int par6, int par7, float par8, float par9, float par10) { - return false; - } - -- public float getStrVsBlock(ItemStack var1, Block var2) { -+ /** -+ * Returns the strength of the stack against a given block. 1.0F base, (Quality+1)*2 if correct blocktype, 1.5F if -+ * sword -+ */ -+ public float getStrVsBlock(ItemStack par1ItemStack, Block par2Block) { - return 1.0F; - } - -- public ItemStack onItemRightClick(ItemStack var1, World var2, EntityPlayer var3) { -- return var1; -- } -- -- public ItemStack onEaten(ItemStack var1, World var2, EntityPlayer var3) { -- return var1; -- } -- -+ /** -+ * Called whenever this item is equipped and the right mouse button is pressed. Args: itemStack, world, entityPlayer -+ */ -+ public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) { -+ return par1ItemStack; -+ } -+ -+ public ItemStack onEaten(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) { -+ return par1ItemStack; -+ } -+ -+ /** -+ * Returns the maximum size of the stack for a specific item. *Isn't this more a Set than a Get?* -+ */ - public int getItemStackLimit() { - return this.maxStackSize; - } - -- public int getMetadata(int var1) { -+ /** -+ * Returns the metadata of the block which this Item (ItemBlock) can place -+ */ -+ public int getMetadata(int par1) { - return 0; - } - -@@ -246,17 +314,23 @@ - return this.hasSubtypes; - } - -- protected Item setHasSubtypes(boolean var1) { -- this.hasSubtypes = var1; -+ protected Item setHasSubtypes(boolean par1) { -+ this.hasSubtypes = par1; - return this; - } - -+ /** -+ * Returns the maximum damage an item can take. -+ */ - public int getMaxDamage() { - return this.maxDamage; - } - -- protected Item setMaxDamage(int var1) { -- this.maxDamage = var1; -+ /** -+ * set max damage of an Item -+ */ -+ protected Item setMaxDamage(int par1) { -+ this.maxDamage = par1; - return this; - } - -@@ -264,62 +338,102 @@ - return this.maxDamage > 0 && !this.hasSubtypes; - } - -- public boolean hitEntity(ItemStack var1, EntityLivingBase var2, EntityLivingBase var3) { -- return false; -- } -- -- public boolean onBlockDestroyed(ItemStack var1, World var2, int var3, int var4, int var5, int var6, EntityLivingBase var7) { -- return false; -- } -- -- public boolean canHarvestBlock(Block var1) { -- return false; -- } -- -- public boolean itemInteractionForEntity(ItemStack var1, EntityPlayer var2, EntityLivingBase var3) { -- return false; -- } -- -+ /** -+ * Current implementations of this method in child classes do not use the entry argument beside ev. They just raise the -+ * damage on the stack. -+ */ -+ public boolean hitEntity(ItemStack par1ItemStack, EntityLivingBase par2EntityLivingBase, EntityLivingBase par3EntityLivingBase) { -+ return false; -+ } -+ -+ public boolean onBlockDestroyed(ItemStack par1ItemStack, World par2World, int par3, int par4, int par5, int par6, EntityLivingBase par7EntityLivingBase) { -+ return false; -+ } -+ -+ /** -+ * Returns if the item (tool) can harvest results from the block type. -+ */ -+ public boolean canHarvestBlock(Block par1Block) { -+ return false; -+ } -+ -+ /** -+ * Returns true if the item can be used on the given entity, e.g. shears on sheep. -+ */ -+ public boolean itemInteractionForEntity(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, EntityLivingBase par3EntityLivingBase) { -+ return false; -+ } -+ -+ /** -+ * Sets bFull3D to True and return the object. -+ */ - public Item setFull3D() { - this.bFull3D = true; - return this; - } - -+ /** -+ * Returns True is the item is renderer in full 3D when hold. -+ */ - public boolean isFull3D() { - return this.bFull3D; - } - -+ /** -+ * Returns true if this item should be rotated by 180 degrees around the Y axis when being held in an entities hands. -+ */ - public boolean shouldRotateAroundWhenRendering() { - return false; - } - -- public Item setUnlocalizedName(String var1) { -- this.cB = var1; -+ /** -+ * Sets the unlocalized name of this item to the string passed as the parameter, prefixed by "item." -+ */ -+ public Item setUnlocalizedName(String par1Str) { -+ this.unlocalizedName = par1Str; - return this; - } - -- public String getUnlocalizedNameInefficiently(ItemStack var1) { -- String var2 = this.getUnlocalizedName(var1); -+ /** -+ * Translates the unlocalized name of this item, but without the .name suffix, so the translation fails and the -+ * unlocalized name itself is returned. -+ */ -+ public String getUnlocalizedNameInefficiently(ItemStack par1ItemStack) { -+ String var2 = this.getUnlocalizedName(par1ItemStack); - return var2 == null ? "" : StatCollector.translateToLocal(var2); - } - -+ /** -+ * Returns the unlocalized name of this item. -+ */ - public String getUnlocalizedName() { -- return "item." + this.cB; -- } -- -- public String getUnlocalizedName(ItemStack var1) { -- return "item." + this.cB; -- } -- -- public Item setContainerItem(Item var1) { -- this.containerItem = var1; -+ return "item." + this.unlocalizedName; -+ } -+ -+ /** -+ * Returns the unlocalized name of this item. This version accepts an ItemStack so different stacks can have different -+ * names based on their damage or NBT. -+ */ -+ public String getUnlocalizedName(ItemStack par1ItemStack) { -+ return "item." + this.unlocalizedName; -+ } -+ -+ public Item setContainerItem(Item par1Item) { -+ this.containerItem = par1Item; - return this; - } - -- public boolean doesContainerItemLeaveCraftingGrid(ItemStack var1) { -+ /** -+ * If this returns true, after a recipe involving this item is crafted the container item will be added to the player's -+ * inventory instead of remaining in the crafting grid. -+ */ -+ public boolean doesContainerItemLeaveCraftingGrid(ItemStack par1ItemStack) { - return true; - } - -+ /** -+ * If this function returns true (or the item is damageable), the ItemStack's NBT tag will be sent to the client. -+ */ - public boolean getShareTag() { - return true; - } -@@ -328,6 +442,9 @@ - return this.containerItem; - } - -+ /** -+ * True if this Item has a container item (a.k.a. crafting result) -+ */ - public boolean hasContainerItem() { - return this.containerItem != null; - } -@@ -336,86 +453,122 @@ - return StatCollector.translateToLocal(this.getUnlocalizedName() + ".name"); - } - -- public String getItemStackDisplayName(ItemStack var1) { -- return StatCollector.translateToLocal(this.getUnlocalizedName(var1) + ".name"); -+ public String getItemStackDisplayName(ItemStack par1ItemStack) { -+ return StatCollector.translateToLocal(this.getUnlocalizedName(par1ItemStack) + ".name"); - } - -- public int getColorFromItemStack(ItemStack var1, int var2) { -+ public int getColorFromItemStack(ItemStack par1ItemStack, int par2) { - return 16777215; - } - -- public void onUpdate(ItemStack var1, World var2, Entity var3, int var4, boolean var5) { -- } -- -- public void onCreated(ItemStack var1, World var2, EntityPlayer var3) { -- } -- -+ /** -+ * Called each tick as long the item is on a player inventory. Uses by maps to check if is on a player hand and update -+ * it's contents. -+ */ -+ public void onUpdate(ItemStack par1ItemStack, World par2World, Entity par3Entity, int par4, boolean par5) {} -+ -+ /** -+ * Called when item is crafted/smelted. Used only by maps so far. -+ */ -+ public void onCreated(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) {} -+ -+ /** -+ * false for all Items except sub-classes of ItemMapBase -+ */ - public boolean isMap() { - return false; - } - -- public EnumAction getItemUseAction(ItemStack var1) { -+ /** -+ * returns the action that specifies what animation to play when the items is being used -+ */ -+ public EnumAction getItemUseAction(ItemStack par1ItemStack) { - return EnumAction.none; - } - -- public int getMaxItemUseDuration(ItemStack var1) { -+ /** -+ * How long it takes to use or consume an item -+ */ -+ public int getMaxItemUseDuration(ItemStack par1ItemStack) { - return 0; - } - -- public void onPlayerStoppedUsing(ItemStack var1, World var2, EntityPlayer var3, int var4) { -- } -+ /** -+ * called when the player releases the use item button. Args: itemstack, world, entityplayer, itemInUseCount -+ */ -+ public void onPlayerStoppedUsing(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer, int par4) {} - -- protected Item setPotionEffect(String var1) { -- this.d = var1; -+ /** -+ * Sets the string representing this item's effect on a potion when used as an ingredient. -+ */ -+ protected Item setPotionEffect(String par1Str) { -+ this.potionEffect = par1Str; - return this; - } - -+ /** -+ * Returns a string representing what this item does to a potion. -+ */ - public String getPotionEffect() { -- return this.d; -+ return this.potionEffect; - } - -+ /** -+ * Returns true if this item serves as a potion ingredient (its ingredient information is not null). -+ */ - public boolean isPotionIngredient() { -- return this.d != null; -- } -- -- public void addInformation(ItemStack var1, EntityPlayer var2, List var3, boolean var4) { -- } -- -- public String getItemDisplayName(ItemStack var1) { -- return ("" + StatCollector.translateToLocal(this.getUnlocalizedNameInefficiently(var1) + ".name")).trim(); -- } -- -- public boolean hasEffect(ItemStack var1) { -- return var1.isItemEnchanted(); -- } -- -- public EnumRarity getRarity(ItemStack var1) { -- return var1.isItemEnchanted() ? EnumRarity.rare : EnumRarity.common; -- } -- -- public boolean isItemTool(ItemStack var1) { -+ return this.potionEffect != null; -+ } -+ -+ /** -+ * allows items to add custom lines of information to the mouseover description -+ */ -+ public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4) {} -+ -+ public String getItemDisplayName(ItemStack par1ItemStack) { -+ return ("" + StatCollector.translateToLocal(this.getUnlocalizedNameInefficiently(par1ItemStack) + ".name")).trim(); -+ } -+ -+ public boolean hasEffect(ItemStack par1ItemStack) { -+ return par1ItemStack.isItemEnchanted(); -+ } -+ -+ /** -+ * Return an item rarity from EnumRarity -+ */ -+ public EnumRarity getRarity(ItemStack par1ItemStack) { -+ return par1ItemStack.isItemEnchanted() ? EnumRarity.rare : EnumRarity.common; -+ } -+ -+ /** -+ * Checks isDamagable and if it cannot be stacked -+ */ -+ public boolean isItemTool(ItemStack par1ItemStack) { - return this.getItemStackLimit() == 1 && this.isDamageable(); - } - -- protected MovingObjectPosition getMovingObjectPositionFromPlayer(World var1, EntityPlayer var2, boolean var3) { -+ protected MovingObjectPosition getMovingObjectPositionFromPlayer(World par1World, EntityPlayer par2EntityPlayer, boolean par3) { - float var4 = 1.0F; -- float var5 = var2.prevRotationPitch + (var2.rotationPitch - var2.prevRotationPitch) * var4; -- float var6 = var2.prevRotationYaw + (var2.rotationYaw - var2.prevRotationYaw) * var4; -- double var7 = var2.prevPosX + (var2.posX - var2.prevPosX) * (double)var4; -- double var9 = var2.prevPosY + (var2.posY - var2.prevPosY) * (double)var4 + 1.62D - (double)var2.yOffset; -- double var11 = var2.prevPosZ + (var2.posZ - var2.prevPosZ) * (double)var4; -- Vec3 var13 = var1.getWorldVec3Pool().getVecFromPool(var7, var9, var11); -- float var14 = MathHelper.cos(-var6 * ((float)Math.PI / 180.0F) - (float)Math.PI); -- float var15 = MathHelper.sin(-var6 * ((float)Math.PI / 180.0F) - (float)Math.PI); -- float var16 = -MathHelper.cos(-var5 * ((float)Math.PI / 180.0F)); -- float var17 = MathHelper.sin(-var5 * ((float)Math.PI / 180.0F)); -+ float var5 = par2EntityPlayer.prevRotationPitch + (par2EntityPlayer.rotationPitch - par2EntityPlayer.prevRotationPitch) * var4; -+ float var6 = par2EntityPlayer.prevRotationYaw + (par2EntityPlayer.rotationYaw - par2EntityPlayer.prevRotationYaw) * var4; -+ double var7 = par2EntityPlayer.prevPosX + (par2EntityPlayer.posX - par2EntityPlayer.prevPosX) * (double)var4; -+ double var9 = par2EntityPlayer.prevPosY + (par2EntityPlayer.posY - par2EntityPlayer.prevPosY) * (double)var4 + 1.62D - (double)par2EntityPlayer.yOffset; -+ double var11 = par2EntityPlayer.prevPosZ + (par2EntityPlayer.posZ - par2EntityPlayer.prevPosZ) * (double)var4; -+ Vec3 var13 = par1World.getWorldVec3Pool().getVecFromPool(var7, var9, var11); -+ float var14 = MathHelper.cos(-var6 * 0.017453292F - (float)Math.PI); -+ float var15 = MathHelper.sin(-var6 * 0.017453292F - (float)Math.PI); -+ float var16 = -MathHelper.cos(-var5 * 0.017453292F); -+ float var17 = MathHelper.sin(-var5 * 0.017453292F); - float var18 = var15 * var16; - float var20 = var14 * var16; - double var21 = 5.0D; - Vec3 var23 = var13.addVector((double)var18 * var21, (double)var17 * var21, (double)var20 * var21); -- return var1.rayTraceBlocks(var13, var23, var3, !var3); -+ return par1World.rayTraceBlocks_do_do(var13, var23, par3, !par3); - } - -+ /** -+ * Return the enchantability factor of the item, most of the time is based on material. -+ */ - public int getItemEnchantability() { - return 0; - } -@@ -424,46 +577,71 @@ - return false; - } - -- public Icon getIconFromDamageForRenderPass(int var1, int var2) { -- return this.getIconFromDamage(var1); -- } -- -- public void getSubItems(int var1, CreativeTabs var2, List var3) { -- var3.add(new ItemStack(var1, 1, 0)); -- } -- -+ /** -+ * Gets an icon index based on an item's damage value and the given render pass -+ */ -+ public Icon getIconFromDamageForRenderPass(int par1, int par2) { -+ return this.getIconFromDamage(par1); -+ } -+ -+ /** -+ * returns a list of items with the same ID, but different meta (eg: dye returns 16 items) -+ */ -+ public void getSubItems(int par1, CreativeTabs par2CreativeTabs, List par3List) { -+ par3List.add(new ItemStack(par1, 1, 0)); -+ } -+ -+ /** -+ * gets the CreativeTab this item is displayed on -+ */ - public CreativeTabs getCreativeTab() { - return this.tabToDisplayOn; - } - -- public Item setCreativeTab(CreativeTabs var1) { -- this.tabToDisplayOn = var1; -+ /** -+ * returns this; -+ */ -+ public Item setCreativeTab(CreativeTabs par1CreativeTabs) { -+ this.tabToDisplayOn = par1CreativeTabs; - return this; - } - -+ /** -+ * Returns true if players can use this item to affect the world (e.g. placing blocks, placing ender eyes in portal) -+ * when not in creative -+ */ - public boolean canItemEditBlocks() { - return true; - } - -- public boolean getIsRepairable(ItemStack var1, ItemStack var2) { -+ /** -+ * Return whether this item is repairable in an anvil. -+ */ -+ public boolean getIsRepairable(ItemStack par1ItemStack, ItemStack par2ItemStack) { - return false; - } - -- public void registerIcons(IconRegister var1) { -- this.itemIcon = var1.registerIcon(this.getIconString()); -+ public void registerIcons(IconRegister par1IconRegister) { -+ this.itemIcon = par1IconRegister.registerIcon(this.getIconString()); - } - -+ /** -+ * Gets a map of item attribute modifiers, used by ItemSword to increase hit damage. -+ */ - public Multimap getItemAttributeModifiers() { - return HashMultimap.create(); - } - -- protected Item setTextureName(String var1) { -- this.cA = var1; -+ protected Item setTextureName(String par1Str) { -+ this.iconString = par1Str; - return this; - } - -+ /** -+ * Returns the string associated with this Item's Icon. -+ */ - protected String getIconString() { -- return this.cA == null ? "MISSING_ICON_ITEM_" + this.itemID + "_" + this.cB : this.cA; -+ return this.iconString == null ? "MISSING_ICON_ITEM_" + this.itemID + "_" + this.unlocalizedName : this.iconString; - } - - static { ---- net/minecraft/src/BlockCarrot.java -+++ net/minecraft/src/BlockCarrot.java -@@ -3,36 +3,48 @@ - public class BlockCarrot extends BlockCrops { - private Icon[] iconArray; - -- public BlockCarrot(int var1) { -- super(var1); -+ public BlockCarrot(int par1) { -+ super(par1); - } - -- public Icon getIcon(int var1, int var2) { -- if(var2 < 7) { -- if(var2 == 6) { -- var2 = 5; -+ /** -+ * From the specified side and block metadata retrieves the blocks texture. Args: side, metadata -+ */ -+ public Icon getIcon(int par1, int par2) { -+ if (par2 < 7) { -+ if (par2 == 6) { -+ par2 = 5; - } - -- return this.iconArray[var2 >> 1]; -+ return this.iconArray[par2 >> 1]; - } else { - return this.iconArray[3]; - } - } - -+ /** -+ * Generate a seed ItemStack for this crop. -+ */ - protected int getSeedItem() { - return Item.carrot.itemID; - } - -+ /** -+ * Generate a crop produce ItemStack for this crop. -+ */ - protected int getCropItem() { - return Item.carrot.itemID; - } - -- public void registerIcons(IconRegister var1) { -+ /** -+ * When this method is called, your block should register all the icons it needs with the given IconRegister. This is -+ * the only chance you get to register icons. -+ */ -+ public void registerIcons(IconRegister par1IconRegister) { - this.iconArray = new Icon[4]; - -- for(int var2 = 0; var2 < this.iconArray.length; ++var2) { -- this.iconArray[var2] = var1.registerIcon(this.getTextureName() + "_stage_" + var2); -+ for (int var2 = 0; var2 < this.iconArray.length; ++var2) { -+ this.iconArray[var2] = par1IconRegister.registerIcon(this.getTextureName() + "_stage_" + var2); - } -- - } - } ---- net/minecraft/src/ComponentVillageHall.java -+++ net/minecraft/src/ComponentVillageHall.java -@@ -4,108 +4,116 @@ - import java.util.Random; - - public class ComponentVillageHall extends ComponentVillage { -- public ComponentVillageHall() { -- } -- -- public ComponentVillageHall(ComponentVillageStartPiece var1, int var2, Random var3, StructureBoundingBox var4, int var5) { -- super(var1, var2); -- this.coordBaseMode = var5; -- this.boundingBox = var4; -- } -- -- public static ComponentVillageHall func_74906_a(ComponentVillageStartPiece var0, List var1, Random var2, int var3, int var4, int var5, int var6, int var7) { -- StructureBoundingBox var8 = StructureBoundingBox.getComponentToAddBoundingBox(var3, var4, var5, 0, 0, 0, 9, 7, 11, var6); -- return canVillageGoDeeper(var8) && StructureComponent.findIntersecting(var1, var8) == null ? new ComponentVillageHall(var0, var7, var2, var8, var6) : null; -- } -- -- public boolean addComponentParts(World var1, Random var2, StructureBoundingBox var3) { -- if(this.field_143015_k < 0) { -- this.field_143015_k = this.getAverageGroundLevel(var1, var3); -- if(this.field_143015_k < 0) { -+ public ComponentVillageHall() {} -+ -+ public ComponentVillageHall(ComponentVillageStartPiece par1ComponentVillageStartPiece, int par2, Random par3Random, StructureBoundingBox par4StructureBoundingBox, int par5) { -+ super(par1ComponentVillageStartPiece, par2); -+ this.coordBaseMode = par5; -+ this.boundingBox = par4StructureBoundingBox; -+ } -+ -+ public static ComponentVillageHall func_74906_a(ComponentVillageStartPiece par0ComponentVillageStartPiece, List par1List, Random par2Random, int par3, int par4, int par5, int par6, int par7) { -+ StructureBoundingBox var8 = StructureBoundingBox.getComponentToAddBoundingBox(par3, par4, par5, 0, 0, 0, 9, 7, 11, par6); -+ return canVillageGoDeeper(var8) && StructureComponent.findIntersecting(par1List, var8) == null ? new ComponentVillageHall(par0ComponentVillageStartPiece, par7, par2Random, var8, par6) : null; -+ } -+ -+ /** -+ * second Part of Structure generating, this for example places Spiderwebs, Mob Spawners, it closes Mineshafts at the -+ * end, it adds Fences... -+ */ -+ public boolean addComponentParts(World par1World, Random par2Random, StructureBoundingBox par3StructureBoundingBox) { -+ if (this.field_143015_k < 0) { -+ this.field_143015_k = this.getAverageGroundLevel(par1World, par3StructureBoundingBox); -+ -+ if (this.field_143015_k < 0) { - return true; - } - - this.boundingBox.offset(0, this.field_143015_k - this.boundingBox.maxY + 7 - 1, 0); - } - -- this.fillWithBlocks(var1, var3, 1, 1, 1, 7, 4, 4, 0, 0, false); -- this.fillWithBlocks(var1, var3, 2, 1, 6, 8, 4, 10, 0, 0, false); -- this.fillWithBlocks(var1, var3, 2, 0, 6, 8, 0, 10, Block.dirt.blockID, Block.dirt.blockID, false); -- this.placeBlockAtCurrentPosition(var1, Block.cobblestone.blockID, 0, 6, 0, 6, var3); -- this.fillWithBlocks(var1, var3, 2, 1, 6, 2, 1, 10, Block.fence.blockID, Block.fence.blockID, false); -- this.fillWithBlocks(var1, var3, 8, 1, 6, 8, 1, 10, Block.fence.blockID, Block.fence.blockID, false); -- this.fillWithBlocks(var1, var3, 3, 1, 10, 7, 1, 10, Block.fence.blockID, Block.fence.blockID, false); -- this.fillWithBlocks(var1, var3, 1, 0, 1, 7, 0, 4, Block.planks.blockID, Block.planks.blockID, false); -- this.fillWithBlocks(var1, var3, 0, 0, 0, 0, 3, 5, Block.cobblestone.blockID, Block.cobblestone.blockID, false); -- this.fillWithBlocks(var1, var3, 8, 0, 0, 8, 3, 5, Block.cobblestone.blockID, Block.cobblestone.blockID, false); -- this.fillWithBlocks(var1, var3, 1, 0, 0, 7, 1, 0, Block.cobblestone.blockID, Block.cobblestone.blockID, false); -- this.fillWithBlocks(var1, var3, 1, 0, 5, 7, 1, 5, Block.cobblestone.blockID, Block.cobblestone.blockID, false); -- this.fillWithBlocks(var1, var3, 1, 2, 0, 7, 3, 0, Block.planks.blockID, Block.planks.blockID, false); -- this.fillWithBlocks(var1, var3, 1, 2, 5, 7, 3, 5, Block.planks.blockID, Block.planks.blockID, false); -- this.fillWithBlocks(var1, var3, 0, 4, 1, 8, 4, 1, Block.planks.blockID, Block.planks.blockID, false); -- this.fillWithBlocks(var1, var3, 0, 4, 4, 8, 4, 4, Block.planks.blockID, Block.planks.blockID, false); -- this.fillWithBlocks(var1, var3, 0, 5, 2, 8, 5, 3, Block.planks.blockID, Block.planks.blockID, false); -- this.placeBlockAtCurrentPosition(var1, Block.planks.blockID, 0, 0, 4, 2, var3); -- this.placeBlockAtCurrentPosition(var1, Block.planks.blockID, 0, 0, 4, 3, var3); -- this.placeBlockAtCurrentPosition(var1, Block.planks.blockID, 0, 8, 4, 2, var3); -- this.placeBlockAtCurrentPosition(var1, Block.planks.blockID, 0, 8, 4, 3, var3); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 1, 1, 1, 7, 4, 4, 0, 0, false); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 2, 1, 6, 8, 4, 10, 0, 0, false); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 2, 0, 6, 8, 0, 10, Block.dirt.blockID, Block.dirt.blockID, false); -+ this.placeBlockAtCurrentPosition(par1World, Block.cobblestone.blockID, 0, 6, 0, 6, par3StructureBoundingBox); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 2, 1, 6, 2, 1, 10, Block.fence.blockID, Block.fence.blockID, false); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 8, 1, 6, 8, 1, 10, Block.fence.blockID, Block.fence.blockID, false); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 3, 1, 10, 7, 1, 10, Block.fence.blockID, Block.fence.blockID, false); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 1, 0, 1, 7, 0, 4, Block.planks.blockID, Block.planks.blockID, false); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 0, 0, 0, 0, 3, 5, Block.cobblestone.blockID, Block.cobblestone.blockID, false); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 8, 0, 0, 8, 3, 5, Block.cobblestone.blockID, Block.cobblestone.blockID, false); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 1, 0, 0, 7, 1, 0, Block.cobblestone.blockID, Block.cobblestone.blockID, false); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 1, 0, 5, 7, 1, 5, Block.cobblestone.blockID, Block.cobblestone.blockID, false); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 1, 2, 0, 7, 3, 0, Block.planks.blockID, Block.planks.blockID, false); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 1, 2, 5, 7, 3, 5, Block.planks.blockID, Block.planks.blockID, false); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 0, 4, 1, 8, 4, 1, Block.planks.blockID, Block.planks.blockID, false); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 0, 4, 4, 8, 4, 4, Block.planks.blockID, Block.planks.blockID, false); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 0, 5, 2, 8, 5, 3, Block.planks.blockID, Block.planks.blockID, false); -+ this.placeBlockAtCurrentPosition(par1World, Block.planks.blockID, 0, 0, 4, 2, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.planks.blockID, 0, 0, 4, 3, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.planks.blockID, 0, 8, 4, 2, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.planks.blockID, 0, 8, 4, 3, par3StructureBoundingBox); - int var4 = this.getMetadataWithOffset(Block.stairsWoodOak.blockID, 3); - int var5 = this.getMetadataWithOffset(Block.stairsWoodOak.blockID, 2); -- - int var6; - int var7; -- for(var6 = -1; var6 <= 2; ++var6) { -- for(var7 = 0; var7 <= 8; ++var7) { -- this.placeBlockAtCurrentPosition(var1, Block.stairsWoodOak.blockID, var4, var7, 4 + var6, var6, var3); -- this.placeBlockAtCurrentPosition(var1, Block.stairsWoodOak.blockID, var5, var7, 4 + var6, 5 - var6, var3); -- } -- } -- -- this.placeBlockAtCurrentPosition(var1, Block.wood.blockID, 0, 0, 2, 1, var3); -- this.placeBlockAtCurrentPosition(var1, Block.wood.blockID, 0, 0, 2, 4, var3); -- this.placeBlockAtCurrentPosition(var1, Block.wood.blockID, 0, 8, 2, 1, var3); -- this.placeBlockAtCurrentPosition(var1, Block.wood.blockID, 0, 8, 2, 4, var3); -- this.placeBlockAtCurrentPosition(var1, Block.thinGlass.blockID, 0, 0, 2, 2, var3); -- this.placeBlockAtCurrentPosition(var1, Block.thinGlass.blockID, 0, 0, 2, 3, var3); -- this.placeBlockAtCurrentPosition(var1, Block.thinGlass.blockID, 0, 8, 2, 2, var3); -- this.placeBlockAtCurrentPosition(var1, Block.thinGlass.blockID, 0, 8, 2, 3, var3); -- this.placeBlockAtCurrentPosition(var1, Block.thinGlass.blockID, 0, 2, 2, 5, var3); -- this.placeBlockAtCurrentPosition(var1, Block.thinGlass.blockID, 0, 3, 2, 5, var3); -- this.placeBlockAtCurrentPosition(var1, Block.thinGlass.blockID, 0, 5, 2, 0, var3); -- this.placeBlockAtCurrentPosition(var1, Block.thinGlass.blockID, 0, 6, 2, 5, var3); -- this.placeBlockAtCurrentPosition(var1, Block.fence.blockID, 0, 2, 1, 3, var3); -- this.placeBlockAtCurrentPosition(var1, Block.pressurePlatePlanks.blockID, 0, 2, 2, 3, var3); -- this.placeBlockAtCurrentPosition(var1, Block.planks.blockID, 0, 1, 1, 4, var3); -- this.placeBlockAtCurrentPosition(var1, Block.stairsWoodOak.blockID, this.getMetadataWithOffset(Block.stairsWoodOak.blockID, 3), 2, 1, 4, var3); -- this.placeBlockAtCurrentPosition(var1, Block.stairsWoodOak.blockID, this.getMetadataWithOffset(Block.stairsWoodOak.blockID, 1), 1, 1, 3, var3); -- this.fillWithBlocks(var1, var3, 5, 0, 1, 7, 0, 3, Block.stoneDoubleSlab.blockID, Block.stoneDoubleSlab.blockID, false); -- this.placeBlockAtCurrentPosition(var1, Block.stoneDoubleSlab.blockID, 0, 6, 1, 1, var3); -- this.placeBlockAtCurrentPosition(var1, Block.stoneDoubleSlab.blockID, 0, 6, 1, 2, var3); -- this.placeBlockAtCurrentPosition(var1, 0, 0, 2, 1, 0, var3); -- this.placeBlockAtCurrentPosition(var1, 0, 0, 2, 2, 0, var3); -- this.placeBlockAtCurrentPosition(var1, Block.torchWood.blockID, 0, 2, 3, 1, var3); -- this.placeDoorAtCurrentPosition(var1, var3, var2, 2, 1, 0, this.getMetadataWithOffset(Block.doorWood.blockID, 1)); -- if(this.getBlockIdAtCurrentPosition(var1, 2, 0, -1, var3) == 0 && this.getBlockIdAtCurrentPosition(var1, 2, -1, -1, var3) != 0) { -- this.placeBlockAtCurrentPosition(var1, Block.stairsCobblestone.blockID, this.getMetadataWithOffset(Block.stairsCobblestone.blockID, 3), 2, 0, -1, var3); -- } -- -- this.placeBlockAtCurrentPosition(var1, 0, 0, 6, 1, 5, var3); -- this.placeBlockAtCurrentPosition(var1, 0, 0, 6, 2, 5, var3); -- this.placeBlockAtCurrentPosition(var1, Block.torchWood.blockID, 0, 6, 3, 4, var3); -- this.placeDoorAtCurrentPosition(var1, var3, var2, 6, 1, 5, this.getMetadataWithOffset(Block.doorWood.blockID, 1)); -- -- for(var6 = 0; var6 < 5; ++var6) { -- for(var7 = 0; var7 < 9; ++var7) { -- this.clearCurrentPositionBlocksUpwards(var1, var7, 7, var6, var3); -- this.fillCurrentPositionBlocksDownwards(var1, Block.cobblestone.blockID, 0, var7, -1, var6, var3); -- } -- } -- -- this.spawnVillagers(var1, var3, 4, 1, 2, 2); -+ -+ for (var6 = -1; var6 <= 2; ++var6) { -+ for (var7 = 0; var7 <= 8; ++var7) { -+ this.placeBlockAtCurrentPosition(par1World, Block.stairsWoodOak.blockID, var4, var7, 4 + var6, var6, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.stairsWoodOak.blockID, var5, var7, 4 + var6, 5 - var6, par3StructureBoundingBox); -+ } -+ } -+ -+ this.placeBlockAtCurrentPosition(par1World, Block.wood.blockID, 0, 0, 2, 1, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.wood.blockID, 0, 0, 2, 4, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.wood.blockID, 0, 8, 2, 1, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.wood.blockID, 0, 8, 2, 4, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.thinGlass.blockID, 0, 0, 2, 2, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.thinGlass.blockID, 0, 0, 2, 3, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.thinGlass.blockID, 0, 8, 2, 2, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.thinGlass.blockID, 0, 8, 2, 3, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.thinGlass.blockID, 0, 2, 2, 5, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.thinGlass.blockID, 0, 3, 2, 5, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.thinGlass.blockID, 0, 5, 2, 0, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.thinGlass.blockID, 0, 6, 2, 5, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.fence.blockID, 0, 2, 1, 3, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.pressurePlatePlanks.blockID, 0, 2, 2, 3, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.planks.blockID, 0, 1, 1, 4, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.stairsWoodOak.blockID, this.getMetadataWithOffset(Block.stairsWoodOak.blockID, 3), 2, 1, 4, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.stairsWoodOak.blockID, this.getMetadataWithOffset(Block.stairsWoodOak.blockID, 1), 1, 1, 3, par3StructureBoundingBox); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 5, 0, 1, 7, 0, 3, Block.stoneDoubleSlab.blockID, Block.stoneDoubleSlab.blockID, false); -+ this.placeBlockAtCurrentPosition(par1World, Block.stoneDoubleSlab.blockID, 0, 6, 1, 1, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.stoneDoubleSlab.blockID, 0, 6, 1, 2, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, 0, 0, 2, 1, 0, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, 0, 0, 2, 2, 0, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.torchWood.blockID, 0, 2, 3, 1, par3StructureBoundingBox); -+ this.placeDoorAtCurrentPosition(par1World, par3StructureBoundingBox, par2Random, 2, 1, 0, this.getMetadataWithOffset(Block.doorWood.blockID, 1)); -+ -+ if (this.getBlockIdAtCurrentPosition(par1World, 2, 0, -1, par3StructureBoundingBox) == 0 && this.getBlockIdAtCurrentPosition(par1World, 2, -1, -1, par3StructureBoundingBox) != 0) { -+ this.placeBlockAtCurrentPosition(par1World, Block.stairsCobblestone.blockID, this.getMetadataWithOffset(Block.stairsCobblestone.blockID, 3), 2, 0, -1, par3StructureBoundingBox); -+ } -+ -+ this.placeBlockAtCurrentPosition(par1World, 0, 0, 6, 1, 5, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, 0, 0, 6, 2, 5, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.torchWood.blockID, 0, 6, 3, 4, par3StructureBoundingBox); -+ this.placeDoorAtCurrentPosition(par1World, par3StructureBoundingBox, par2Random, 6, 1, 5, this.getMetadataWithOffset(Block.doorWood.blockID, 1)); -+ -+ for (var6 = 0; var6 < 5; ++var6) { -+ for (var7 = 0; var7 < 9; ++var7) { -+ this.clearCurrentPositionBlocksUpwards(par1World, var7, 7, var6, par3StructureBoundingBox); -+ this.fillCurrentPositionBlocksDownwards(par1World, Block.cobblestone.blockID, 0, var7, -1, var6, par3StructureBoundingBox); -+ } -+ } -+ -+ this.spawnVillagers(par1World, par3StructureBoundingBox, 4, 1, 2, 2); - return true; - } - -- protected int getVillagerType(int var1) { -- return var1 == 0 ? 4 : 0; -+ /** -+ * Returns the villager type to spawn in this component, based on the number of villagers already spawned. -+ */ -+ protected int getVillagerType(int par1) { -+ return par1 == 0 ? 4 : 0; - } - } ---- net/minecraft/src/CallableTileEntityData.java -+++ net/minecraft/src/CallableTileEntityData.java -@@ -5,17 +5,18 @@ - class CallableTileEntityData implements Callable { - final TileEntity theTileEntity; - -- CallableTileEntityData(TileEntity var1) { -- this.theTileEntity = var1; -+ CallableTileEntityData(TileEntity par1TileEntity) { -+ this.theTileEntity = par1TileEntity; - } - - public String callTileEntityDataInfo() { - int var1 = this.theTileEntity.worldObj.getBlockMetadata(this.theTileEntity.xCoord, this.theTileEntity.yCoord, this.theTileEntity.zCoord); -- if(var1 < 0) { -+ -+ if (var1 < 0) { - return "Unknown? (Got " + var1 + ")"; - } else { -- String var2 = String.format("%4s", new Object[]{Integer.toBinaryString(var1)}).replace(" ", "0"); -- return String.format("%1$d / 0x%1$X / 0b%2$s", new Object[]{Integer.valueOf(var1), var2}); -+ String var2 = String.format("%4s", new Object[] {Integer.toBinaryString(var1)}).replace(" ", "0"); -+ return String.format("%1$d / 0x%1$X / 0b%2$s", new Object[] {Integer.valueOf(var1), var2}); - } - } - ---- net/minecraft/src/CallableLevelTime.java -+++ net/minecraft/src/CallableLevelTime.java -@@ -5,12 +5,12 @@ - class CallableLevelTime implements Callable { - final WorldInfo worldInfoInstance; - -- CallableLevelTime(WorldInfo var1) { -- this.worldInfoInstance = var1; -+ CallableLevelTime(WorldInfo par1WorldInfo) { -+ this.worldInfoInstance = par1WorldInfo; - } - - public String callLevelTime() { -- return String.format("%d game time, %d day time", new Object[]{Long.valueOf(WorldInfo.func_85126_g(this.worldInfoInstance)), Long.valueOf(WorldInfo.getWorldTime(this.worldInfoInstance))}); -+ return String.format("%d game time, %d day time", new Object[] {Long.valueOf(WorldInfo.func_85126_g(this.worldInfoInstance)), Long.valueOf(WorldInfo.getWorldTime(this.worldInfoInstance))}); - } - - public Object call() { ---- net/minecraft/src/MapInfo.java -+++ net/minecraft/src/MapInfo.java -@@ -3,55 +3,73 @@ - import java.util.Iterator; - - public class MapInfo { -+ -+ /** Reference for EntityPlayer object in MapInfo */ - public final EntityPlayer entityplayerObj; - public int[] field_76209_b; - public int[] field_76210_c; -+ -+ /** -+ * updated by x = mod(x*11,128) +1 x-1 is used to index field_76209_b and field_76210_c -+ */ - private int currentRandomNumber; - private int ticksUntilPlayerLocationMapUpdate; -+ -+ /** -+ * a cache of the result from getPlayersOnMap so that it is not resent when nothing changes -+ */ - private byte[] lastPlayerLocationOnMap; - public int field_82569_d; - private boolean field_82570_i; -+ -+ /** reference in MapInfo to MapData object */ - final MapData mapDataObj; - -- public MapInfo(MapData var1, EntityPlayer var2) { -- this.mapDataObj = var1; -+ public MapInfo(MapData par1MapData, EntityPlayer par2EntityPlayer) { -+ this.mapDataObj = par1MapData; - this.field_76209_b = new int[128]; - this.field_76210_c = new int[128]; -- this.entityplayerObj = var2; -+ this.entityplayerObj = par2EntityPlayer; - -- for(int var3 = 0; var3 < this.field_76209_b.length; ++var3) { -+ for (int var3 = 0; var3 < this.field_76209_b.length; ++var3) { - this.field_76209_b[var3] = 0; - this.field_76210_c[var3] = 127; - } -- - } - -- public byte[] getPlayersOnMap(ItemStack var1) { -+ /** -+ * returns a 1+players*3 array, of x,y, and color . the name of this function may be partially wrong, as there is a -+ * second branch to the code here -+ */ -+ public byte[] getPlayersOnMap(ItemStack par1ItemStack) { - byte[] var2; -- if(!this.field_82570_i) { -- var2 = new byte[]{(byte)2, this.mapDataObj.scale}; -+ -+ if (!this.field_82570_i) { -+ var2 = new byte[] {(byte)2, this.mapDataObj.scale}; - this.field_82570_i = true; - return var2; - } else { - int var3; - int var10; -- if(--this.ticksUntilPlayerLocationMapUpdate < 0) { -+ -+ if (--this.ticksUntilPlayerLocationMapUpdate < 0) { - this.ticksUntilPlayerLocationMapUpdate = 4; -- var2 = new byte[this.mapDataObj.g.size() * 3 + 1]; -+ var2 = new byte[this.mapDataObj.playersVisibleOnMap.size() * 3 + 1]; - var2[0] = 1; - var3 = 0; - -- for(Iterator var4 = this.mapDataObj.g.values().iterator(); var4.hasNext(); ++var3) { -+ for (Iterator var4 = this.mapDataObj.playersVisibleOnMap.values().iterator(); var4.hasNext(); ++var3) { - MapCoord var5 = (MapCoord)var4.next(); - var2[var3 * 3 + 1] = (byte)(var5.iconSize << 4 | var5.iconRotation & 15); - var2[var3 * 3 + 2] = var5.centerX; - var2[var3 * 3 + 3] = var5.centerZ; - } - -- boolean var9 = !var1.isOnItemFrame(); -- if(this.lastPlayerLocationOnMap != null && this.lastPlayerLocationOnMap.length == var2.length) { -- for(var10 = 0; var10 < var2.length; ++var10) { -- if(var2[var10] != this.lastPlayerLocationOnMap[var10]) { -+ boolean var9 = !par1ItemStack.isOnItemFrame(); -+ -+ if (this.lastPlayerLocationOnMap != null && this.lastPlayerLocationOnMap.length == var2.length) { -+ for (var10 = 0; var10 < var2.length; ++var10) { -+ if (var2[var10] != this.lastPlayerLocationOnMap[var10]) { - var9 = false; - break; - } -@@ -60,15 +78,16 @@ - var9 = false; - } - -- if(!var9) { -+ if (!var9) { - this.lastPlayerLocationOnMap = var2; - return var2; - } - } - -- for(int var8 = 0; var8 < 1; ++var8) { -+ for (int var8 = 0; var8 < 1; ++var8) { - var3 = this.currentRandomNumber++ * 11 % 128; -- if(this.field_76209_b[var3] >= 0) { -+ -+ if (this.field_76209_b[var3] >= 0) { - int var11 = this.field_76210_c[var3] - this.field_76209_b[var3] + 1; - var10 = this.field_76209_b[var3]; - byte[] var6 = new byte[var11 + 3]; -@@ -76,7 +95,7 @@ - var6[1] = (byte)var3; - var6[2] = (byte)var10; - -- for(int var7 = 0; var7 < var6.length - 3; ++var7) { -+ for (int var7 = 0; var7 < var6.length - 3; ++var7) { - var6[var7 + 3] = this.mapDataObj.colors[(var7 + var10) * 128 + var3]; - } - ---- net/minecraft/src/ModelBiped.java -+++ net/minecraft/src/ModelBiped.java -@@ -12,117 +12,137 @@ - public ModelRenderer bipedLeftLeg; - public ModelRenderer bipedEars; - public ModelRenderer bipedCloak; -+ -+ /** -+ * Records whether the model should be rendered holding an item in the left hand, and if that item is a block. -+ */ - public int heldItemLeft; -+ -+ /** -+ * Records whether the model should be rendered holding an item in the right hand, and if that item is a block. -+ */ - public int heldItemRight; - public boolean isSneak; -+ -+ /** Records whether the model should be rendered aiming a bow. */ - public boolean aimedBow; - - public ModelBiped() { - this(0.0F); - } - -- public ModelBiped(float var1) { -- this(var1, 0.0F, 64, 32); -+ public ModelBiped(float par1) { -+ this(par1, 0.0F, 64, 32); - } - -- public ModelBiped(float var1, float var2, int var3, int var4) { -- this.textureWidth = var3; -- this.textureHeight = var4; -+ public ModelBiped(float par1, float par2, int par3, int par4) { -+ this.textureWidth = par3; -+ this.textureHeight = par4; - this.bipedCloak = new ModelRenderer(this, 0, 0); -- this.bipedCloak.addBox(-5.0F, 0.0F, -1.0F, 10, 16, 1, var1); -+ this.bipedCloak.addBox(-5.0F, 0.0F, -1.0F, 10, 16, 1, par1); - this.bipedEars = new ModelRenderer(this, 24, 0); -- this.bipedEars.addBox(-3.0F, -6.0F, -1.0F, 6, 6, 1, var1); -+ this.bipedEars.addBox(-3.0F, -6.0F, -1.0F, 6, 6, 1, par1); - this.bipedHead = new ModelRenderer(this, 0, 0); -- this.bipedHead.addBox(-4.0F, -8.0F, -4.0F, 8, 8, 8, var1); -- this.bipedHead.setRotationPoint(0.0F, 0.0F + var2, 0.0F); -+ this.bipedHead.addBox(-4.0F, -8.0F, -4.0F, 8, 8, 8, par1); -+ this.bipedHead.setRotationPoint(0.0F, 0.0F + par2, 0.0F); - this.bipedHeadwear = new ModelRenderer(this, 32, 0); -- this.bipedHeadwear.addBox(-4.0F, -8.0F, -4.0F, 8, 8, 8, var1 + 0.5F); -- this.bipedHeadwear.setRotationPoint(0.0F, 0.0F + var2, 0.0F); -+ this.bipedHeadwear.addBox(-4.0F, -8.0F, -4.0F, 8, 8, 8, par1 + 0.5F); -+ this.bipedHeadwear.setRotationPoint(0.0F, 0.0F + par2, 0.0F); - this.bipedBody = new ModelRenderer(this, 16, 16); -- this.bipedBody.addBox(-4.0F, 0.0F, -2.0F, 8, 12, 4, var1); -- this.bipedBody.setRotationPoint(0.0F, 0.0F + var2, 0.0F); -+ this.bipedBody.addBox(-4.0F, 0.0F, -2.0F, 8, 12, 4, par1); -+ this.bipedBody.setRotationPoint(0.0F, 0.0F + par2, 0.0F); - this.bipedRightArm = new ModelRenderer(this, 40, 16); -- this.bipedRightArm.addBox(-3.0F, -2.0F, -2.0F, 4, 12, 4, var1); -- this.bipedRightArm.setRotationPoint(-5.0F, 2.0F + var2, 0.0F); -+ this.bipedRightArm.addBox(-3.0F, -2.0F, -2.0F, 4, 12, 4, par1); -+ this.bipedRightArm.setRotationPoint(-5.0F, 2.0F + par2, 0.0F); - this.bipedLeftArm = new ModelRenderer(this, 40, 16); - this.bipedLeftArm.mirror = true; -- this.bipedLeftArm.addBox(-1.0F, -2.0F, -2.0F, 4, 12, 4, var1); -- this.bipedLeftArm.setRotationPoint(5.0F, 2.0F + var2, 0.0F); -+ this.bipedLeftArm.addBox(-1.0F, -2.0F, -2.0F, 4, 12, 4, par1); -+ this.bipedLeftArm.setRotationPoint(5.0F, 2.0F + par2, 0.0F); - this.bipedRightLeg = new ModelRenderer(this, 0, 16); -- this.bipedRightLeg.addBox(-2.0F, 0.0F, -2.0F, 4, 12, 4, var1); -- this.bipedRightLeg.setRotationPoint(-1.9F, 12.0F + var2, 0.0F); -+ this.bipedRightLeg.addBox(-2.0F, 0.0F, -2.0F, 4, 12, 4, par1); -+ this.bipedRightLeg.setRotationPoint(-1.9F, 12.0F + par2, 0.0F); - this.bipedLeftLeg = new ModelRenderer(this, 0, 16); - this.bipedLeftLeg.mirror = true; -- this.bipedLeftLeg.addBox(-2.0F, 0.0F, -2.0F, 4, 12, 4, var1); -- this.bipedLeftLeg.setRotationPoint(1.9F, 12.0F + var2, 0.0F); -+ this.bipedLeftLeg.addBox(-2.0F, 0.0F, -2.0F, 4, 12, 4, par1); -+ this.bipedLeftLeg.setRotationPoint(1.9F, 12.0F + par2, 0.0F); - } - -- public void render(Entity var1, float var2, float var3, float var4, float var5, float var6, float var7) { -- this.setRotationAngles(var2, var3, var4, var5, var6, var7, var1); -- if(this.isChild) { -+ /** -+ * Sets the models various rotation angles then renders the model. -+ */ -+ public void render(Entity par1Entity, float par2, float par3, float par4, float par5, float par6, float par7) { -+ this.setRotationAngles(par2, par3, par4, par5, par6, par7, par1Entity); -+ -+ if (this.isChild) { - float var8 = 2.0F; - GL11.glPushMatrix(); - GL11.glScalef(1.5F / var8, 1.5F / var8, 1.5F / var8); -- GL11.glTranslatef(0.0F, 16.0F * var7, 0.0F); -- this.bipedHead.render(var7); -+ GL11.glTranslatef(0.0F, 16.0F * par7, 0.0F); -+ this.bipedHead.render(par7); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glScalef(1.0F / var8, 1.0F / var8, 1.0F / var8); -- GL11.glTranslatef(0.0F, 24.0F * var7, 0.0F); -- this.bipedBody.render(var7); -- this.bipedRightArm.render(var7); -- this.bipedLeftArm.render(var7); -- this.bipedRightLeg.render(var7); -- this.bipedLeftLeg.render(var7); -- this.bipedHeadwear.render(var7); -+ GL11.glTranslatef(0.0F, 24.0F * par7, 0.0F); -+ this.bipedBody.render(par7); -+ this.bipedRightArm.render(par7); -+ this.bipedLeftArm.render(par7); -+ this.bipedRightLeg.render(par7); -+ this.bipedLeftLeg.render(par7); -+ this.bipedHeadwear.render(par7); - GL11.glPopMatrix(); - } else { -- this.bipedHead.render(var7); -- this.bipedBody.render(var7); -- this.bipedRightArm.render(var7); -- this.bipedLeftArm.render(var7); -- this.bipedRightLeg.render(var7); -- this.bipedLeftLeg.render(var7); -- this.bipedHeadwear.render(var7); -+ this.bipedHead.render(par7); -+ this.bipedBody.render(par7); -+ this.bipedRightArm.render(par7); -+ this.bipedLeftArm.render(par7); -+ this.bipedRightLeg.render(par7); -+ this.bipedLeftLeg.render(par7); -+ this.bipedHeadwear.render(par7); - } -- - } - -- public void setRotationAngles(float var1, float var2, float var3, float var4, float var5, float var6, Entity var7) { -- this.bipedHead.rotateAngleY = var4 / (180.0F / (float)Math.PI); -- this.bipedHead.rotateAngleX = var5 / (180.0F / (float)Math.PI); -+ /** -+ * Sets the model's various rotation angles. For bipeds, par1 and par2 are used for animating the movement of arms and -+ * legs, where par1 represents the time(so that arms and legs swing back and forth) and par2 represents how "far" arms -+ * and legs can swing at most. -+ */ -+ public void setRotationAngles(float par1, float par2, float par3, float par4, float par5, float par6, Entity par7Entity) { -+ this.bipedHead.rotateAngleY = par4 / (180F / (float)Math.PI); -+ this.bipedHead.rotateAngleX = par5 / (180F / (float)Math.PI); - this.bipedHeadwear.rotateAngleY = this.bipedHead.rotateAngleY; - this.bipedHeadwear.rotateAngleX = this.bipedHead.rotateAngleX; -- this.bipedRightArm.rotateAngleX = MathHelper.cos(var1 * 0.6662F + (float)Math.PI) * 2.0F * var2 * 0.5F; -- this.bipedLeftArm.rotateAngleX = MathHelper.cos(var1 * 0.6662F) * 2.0F * var2 * 0.5F; -+ this.bipedRightArm.rotateAngleX = MathHelper.cos(par1 * 0.6662F + (float)Math.PI) * 2.0F * par2 * 0.5F; -+ this.bipedLeftArm.rotateAngleX = MathHelper.cos(par1 * 0.6662F) * 2.0F * par2 * 0.5F; - this.bipedRightArm.rotateAngleZ = 0.0F; - this.bipedLeftArm.rotateAngleZ = 0.0F; -- this.bipedRightLeg.rotateAngleX = MathHelper.cos(var1 * 0.6662F) * 1.4F * var2; -- this.bipedLeftLeg.rotateAngleX = MathHelper.cos(var1 * 0.6662F + (float)Math.PI) * 1.4F * var2; -+ this.bipedRightLeg.rotateAngleX = MathHelper.cos(par1 * 0.6662F) * 1.4F * par2; -+ this.bipedLeftLeg.rotateAngleX = MathHelper.cos(par1 * 0.6662F + (float)Math.PI) * 1.4F * par2; - this.bipedRightLeg.rotateAngleY = 0.0F; - this.bipedLeftLeg.rotateAngleY = 0.0F; -- if(this.isRiding) { -- this.bipedRightArm.rotateAngleX += (float)Math.PI * -0.2F; -- this.bipedLeftArm.rotateAngleX += (float)Math.PI * -0.2F; -- this.bipedRightLeg.rotateAngleX = (float)Math.PI * -0.4F; -- this.bipedLeftLeg.rotateAngleX = (float)Math.PI * -0.4F; -- this.bipedRightLeg.rotateAngleY = (float)Math.PI * 0.1F; -- this.bipedLeftLeg.rotateAngleY = (float)Math.PI * -0.1F; -- } -- -- if(this.heldItemLeft != 0) { -- this.bipedLeftArm.rotateAngleX = this.bipedLeftArm.rotateAngleX * 0.5F - (float)Math.PI * 0.1F * (float)this.heldItemLeft; -- } -- -- if(this.heldItemRight != 0) { -- this.bipedRightArm.rotateAngleX = this.bipedRightArm.rotateAngleX * 0.5F - (float)Math.PI * 0.1F * (float)this.heldItemRight; -+ -+ if (this.isRiding) { -+ this.bipedRightArm.rotateAngleX += -((float)Math.PI / 5F); -+ this.bipedLeftArm.rotateAngleX += -((float)Math.PI / 5F); -+ this.bipedRightLeg.rotateAngleX = -((float)Math.PI * 2F / 5F); -+ this.bipedLeftLeg.rotateAngleX = -((float)Math.PI * 2F / 5F); -+ this.bipedRightLeg.rotateAngleY = ((float)Math.PI / 10F); -+ this.bipedLeftLeg.rotateAngleY = -((float)Math.PI / 10F); -+ } -+ -+ if (this.heldItemLeft != 0) { -+ this.bipedLeftArm.rotateAngleX = this.bipedLeftArm.rotateAngleX * 0.5F - ((float)Math.PI / 10F) * (float)this.heldItemLeft; -+ } -+ -+ if (this.heldItemRight != 0) { -+ this.bipedRightArm.rotateAngleX = this.bipedRightArm.rotateAngleX * 0.5F - ((float)Math.PI / 10F) * (float)this.heldItemRight; - } - - this.bipedRightArm.rotateAngleY = 0.0F; - this.bipedLeftArm.rotateAngleY = 0.0F; - float var8; - float var9; -- if(this.onGround > -9990.0F) { -+ -+ if (this.onGround > -9990.0F) { - var8 = this.onGround; - this.bipedBody.rotateAngleY = MathHelper.sin(MathHelper.sqrt_float(var8) * (float)Math.PI * 2.0F) * 0.2F; - this.bipedRightArm.rotationPointZ = MathHelper.sin(this.bipedBody.rotateAngleY) * 5.0F; -@@ -137,13 +157,13 @@ - var8 *= var8; - var8 = 1.0F - var8; - var9 = MathHelper.sin(var8 * (float)Math.PI); -- float var10 = MathHelper.sin(this.onGround * (float)Math.PI) * -(this.bipedHead.rotateAngleX - 0.7F) * (12.0F / 16.0F); -+ float var10 = MathHelper.sin(this.onGround * (float)Math.PI) * -(this.bipedHead.rotateAngleX - 0.7F) * 0.75F; - this.bipedRightArm.rotateAngleX = (float)((double)this.bipedRightArm.rotateAngleX - ((double)var9 * 1.2D + (double)var10)); - this.bipedRightArm.rotateAngleY += this.bipedBody.rotateAngleY * 2.0F; - this.bipedRightArm.rotateAngleZ = MathHelper.sin(this.onGround * (float)Math.PI) * -0.4F; - } - -- if(this.isSneak) { -+ if (this.isSneak) { - this.bipedBody.rotateAngleX = 0.5F; - this.bipedRightArm.rotateAngleX += 0.4F; - this.bipedLeftArm.rotateAngleX += 0.4F; -@@ -163,38 +183,44 @@ - this.bipedHeadwear.rotationPointY = 0.0F; - } - -- this.bipedRightArm.rotateAngleZ += MathHelper.cos(var3 * 0.09F) * 0.05F + 0.05F; -- this.bipedLeftArm.rotateAngleZ -= MathHelper.cos(var3 * 0.09F) * 0.05F + 0.05F; -- this.bipedRightArm.rotateAngleX += MathHelper.sin(var3 * 0.067F) * 0.05F; -- this.bipedLeftArm.rotateAngleX -= MathHelper.sin(var3 * 0.067F) * 0.05F; -- if(this.aimedBow) { -+ this.bipedRightArm.rotateAngleZ += MathHelper.cos(par3 * 0.09F) * 0.05F + 0.05F; -+ this.bipedLeftArm.rotateAngleZ -= MathHelper.cos(par3 * 0.09F) * 0.05F + 0.05F; -+ this.bipedRightArm.rotateAngleX += MathHelper.sin(par3 * 0.067F) * 0.05F; -+ this.bipedLeftArm.rotateAngleX -= MathHelper.sin(par3 * 0.067F) * 0.05F; -+ -+ if (this.aimedBow) { - var8 = 0.0F; - var9 = 0.0F; - this.bipedRightArm.rotateAngleZ = 0.0F; - this.bipedLeftArm.rotateAngleZ = 0.0F; - this.bipedRightArm.rotateAngleY = -(0.1F - var8 * 0.6F) + this.bipedHead.rotateAngleY; - this.bipedLeftArm.rotateAngleY = 0.1F - var8 * 0.6F + this.bipedHead.rotateAngleY + 0.4F; -- this.bipedRightArm.rotateAngleX = (float)Math.PI * -0.5F + this.bipedHead.rotateAngleX; -- this.bipedLeftArm.rotateAngleX = (float)Math.PI * -0.5F + this.bipedHead.rotateAngleX; -+ this.bipedRightArm.rotateAngleX = -((float)Math.PI / 2F) + this.bipedHead.rotateAngleX; -+ this.bipedLeftArm.rotateAngleX = -((float)Math.PI / 2F) + this.bipedHead.rotateAngleX; - this.bipedRightArm.rotateAngleX -= var8 * 1.2F - var9 * 0.4F; - this.bipedLeftArm.rotateAngleX -= var8 * 1.2F - var9 * 0.4F; -- this.bipedRightArm.rotateAngleZ += MathHelper.cos(var3 * 0.09F) * 0.05F + 0.05F; -- this.bipedLeftArm.rotateAngleZ -= MathHelper.cos(var3 * 0.09F) * 0.05F + 0.05F; -- this.bipedRightArm.rotateAngleX += MathHelper.sin(var3 * 0.067F) * 0.05F; -- this.bipedLeftArm.rotateAngleX -= MathHelper.sin(var3 * 0.067F) * 0.05F; -+ this.bipedRightArm.rotateAngleZ += MathHelper.cos(par3 * 0.09F) * 0.05F + 0.05F; -+ this.bipedLeftArm.rotateAngleZ -= MathHelper.cos(par3 * 0.09F) * 0.05F + 0.05F; -+ this.bipedRightArm.rotateAngleX += MathHelper.sin(par3 * 0.067F) * 0.05F; -+ this.bipedLeftArm.rotateAngleX -= MathHelper.sin(par3 * 0.067F) * 0.05F; - } -- - } - -- public void renderEars(float var1) { -+ /** -+ * renders the ears (specifically, deadmau5's) -+ */ -+ public void renderEars(float par1) { - this.bipedEars.rotateAngleY = this.bipedHead.rotateAngleY; - this.bipedEars.rotateAngleX = this.bipedHead.rotateAngleX; - this.bipedEars.rotationPointX = 0.0F; - this.bipedEars.rotationPointY = 0.0F; -- this.bipedEars.render(var1); -+ this.bipedEars.render(par1); - } - -- public void renderCloak(float var1) { -- this.bipedCloak.render(var1); -+ /** -+ * Renders the cloak of the current biped (in most cases, it's a player) -+ */ -+ public void renderCloak(float par1) { -+ this.bipedCloak.render(par1); - } - } ---- net/minecraft/src/EntityFlying.java -+++ net/minecraft/src/EntityFlying.java -@@ -1,46 +1,58 @@ - package net.minecraft.src; - - public abstract class EntityFlying extends EntityLiving { -- public EntityFlying(World var1) { -- super(var1); -- } -- -- protected void fall(float var1) { -- } -- -- protected void updateFallState(double var1, boolean var3) { -- } -- -- public void moveEntityWithHeading(float var1, float var2) { -- if(this.isInWater()) { -- this.moveFlying(var1, var2, 0.02F); -+ public EntityFlying(World par1World) { -+ super(par1World); -+ } -+ -+ /** -+ * Called when the mob is falling. Calculates and applies fall damage. -+ */ -+ protected void fall(float par1) {} -+ -+ /** -+ * Takes in the distance the entity has fallen this tick and whether its on the ground to update the fall distance and -+ * deal fall damage if landing on the ground. Args: distanceFallenThisTick, onGround -+ */ -+ protected void updateFallState(double par1, boolean par3) {} -+ -+ /** -+ * Moves the entity based on the specified heading. Args: strafe, forward -+ */ -+ public void moveEntityWithHeading(float par1, float par2) { -+ if (this.isInWater()) { -+ this.moveFlying(par1, par2, 0.02F); - this.moveEntity(this.motionX, this.motionY, this.motionZ); -- this.motionX *= (double)0.8F; -- this.motionY *= (double)0.8F; -- this.motionZ *= (double)0.8F; -- } else if(this.handleLavaMovement()) { -- this.moveFlying(var1, var2, 0.02F); -+ this.motionX *= 0.800000011920929D; -+ this.motionY *= 0.800000011920929D; -+ this.motionZ *= 0.800000011920929D; -+ } else if (this.handleLavaMovement()) { -+ this.moveFlying(par1, par2, 0.02F); - this.moveEntity(this.motionX, this.motionY, this.motionZ); - this.motionX *= 0.5D; - this.motionY *= 0.5D; - this.motionZ *= 0.5D; - } else { - float var3 = 0.91F; -- if(this.onGround) { -- var3 = 546.0F * 0.1F * 0.1F * 0.1F; -+ -+ if (this.onGround) { -+ var3 = 0.54600006F; - int var4 = this.worldObj.getBlockId(MathHelper.floor_double(this.posX), MathHelper.floor_double(this.boundingBox.minY) - 1, MathHelper.floor_double(this.posZ)); -- if(var4 > 0) { -+ -+ if (var4 > 0) { - var3 = Block.blocksList[var4].slipperiness * 0.91F; - } - } - - float var8 = 0.16277136F / (var3 * var3 * var3); -- this.moveFlying(var1, var2, this.onGround ? 0.1F * var8 : 0.02F); -+ this.moveFlying(par1, par2, this.onGround ? 0.1F * var8 : 0.02F); - var3 = 0.91F; -- if(this.onGround) { -- var3 = 546.0F * 0.1F * 0.1F * 0.1F; -+ -+ if (this.onGround) { -+ var3 = 0.54600006F; - int var5 = this.worldObj.getBlockId(MathHelper.floor_double(this.posX), MathHelper.floor_double(this.boundingBox.minY) - 1, MathHelper.floor_double(this.posZ)); -- if(var5 > 0) { -+ -+ if (var5 > 0) { - var3 = Block.blocksList[var5].slipperiness * 0.91F; - } - } -@@ -55,7 +67,8 @@ - double var10 = this.posX - this.prevPosX; - double var9 = this.posZ - this.prevPosZ; - float var7 = MathHelper.sqrt_double(var10 * var10 + var9 * var9) * 4.0F; -- if(var7 > 1.0F) { -+ -+ if (var7 > 1.0F) { - var7 = 1.0F; - } - -@@ -63,6 +76,9 @@ - this.limbSwing += this.limbSwingAmount; - } - -+ /** -+ * returns true if this entity is by a ladder, false otherwise -+ */ - public boolean isOnLadder() { - return false; - } ---- /dev/null -+++ org/spoutcraft/client/VersionFile.java -@@ -1,0 +1,48 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.client; -+ -+import java.io.BufferedWriter; -+import java.io.File; -+import java.io.FileWriter; -+import java.io.IOException; -+ -+import org.spoutcraft.client.io.FileUtil; -+ -+public class VersionFile { -+ private String version; -+ -+ public VersionFile(String version) { -+ this.version = version; -+ } -+ -+ public boolean create() { -+ File vFile = new File(FileUtil.getCacheDir(), "version"); -+ try { -+ BufferedWriter out = new BufferedWriter(new FileWriter(vFile)); -+ out.write(this.version); -+ out.close(); -+ } catch (IOException e) { -+ e.printStackTrace(); -+ return false; -+ } -+ return true; -+ } -+} ---- net/minecraft/src/TileEntityEnchantmentTable.java -+++ net/minecraft/src/TileEntityEnchantmentTable.java -@@ -3,87 +3,112 @@ - import java.util.Random; - - public class TileEntityEnchantmentTable extends TileEntity { -+ -+ /** Used by the render to make the book 'bounce' */ - public int tickCount; -+ -+ /** Value used for determining how the page flip should look. */ - public float pageFlip; -+ -+ /** The last tick's pageFlip value. */ - public float pageFlipPrev; - public float field_70373_d; - public float field_70374_e; -+ -+ /** The amount that the book is open. */ - public float bookSpread; -+ -+ /** The amount that the book is open. */ - public float bookSpreadPrev; - public float bookRotation2; - public float bookRotationPrev; - public float bookRotation; -- private static Random r = new Random(); -- private String s; -- -- public void writeToNBT(NBTTagCompound var1) { -- super.writeToNBT(var1); -- if(this.func_94135_b()) { -- var1.setString("CustomName", this.s); -- } -- -- } -- -- public void readFromNBT(NBTTagCompound var1) { -- super.readFromNBT(var1); -- if(var1.hasKey("CustomName")) { -- this.s = var1.getString("CustomName"); -- } -- -- } -- -+ private static Random rand = new Random(); -+ private String field_94136_s; -+ -+ /** -+ * Writes a tile entity to NBT. -+ */ -+ public void writeToNBT(NBTTagCompound par1NBTTagCompound) { -+ super.writeToNBT(par1NBTTagCompound); -+ -+ if (this.func_94135_b()) { -+ par1NBTTagCompound.setString("CustomName", this.field_94136_s); -+ } -+ } -+ -+ /** -+ * Reads a tile entity from NBT. -+ */ -+ public void readFromNBT(NBTTagCompound par1NBTTagCompound) { -+ super.readFromNBT(par1NBTTagCompound); -+ -+ if (par1NBTTagCompound.hasKey("CustomName")) { -+ this.field_94136_s = par1NBTTagCompound.getString("CustomName"); -+ } -+ } -+ -+ /** -+ * Allows the entity to update its state. Overridden in most subclasses, e.g. the mob spawner uses this to count ticks -+ * and creates a new spawn inside its implementation. -+ */ - public void updateEntity() { - super.updateEntity(); - this.bookSpreadPrev = this.bookSpread; - this.bookRotationPrev = this.bookRotation2; - EntityPlayer var1 = this.worldObj.getClosestPlayer((double)((float)this.xCoord + 0.5F), (double)((float)this.yCoord + 0.5F), (double)((float)this.zCoord + 0.5F), 3.0D); -- if(var1 != null) { -+ -+ if (var1 != null) { - double var2 = var1.posX - (double)((float)this.xCoord + 0.5F); - double var4 = var1.posZ - (double)((float)this.zCoord + 0.5F); - this.bookRotation = (float)Math.atan2(var4, var2); - this.bookSpread += 0.1F; -- if(this.bookSpread < 0.5F || r.nextInt(40) == 0) { -+ -+ if (this.bookSpread < 0.5F || rand.nextInt(40) == 0) { - float var6 = this.field_70373_d; - - do { -- this.field_70373_d += (float)(r.nextInt(4) - r.nextInt(4)); -- } while(var6 == this.field_70373_d); -+ this.field_70373_d += (float)(rand.nextInt(4) - rand.nextInt(4)); -+ } while (var6 == this.field_70373_d); - } - } else { - this.bookRotation += 0.02F; - this.bookSpread -= 0.1F; - } - -- while(this.bookRotation2 >= (float)Math.PI) { -- this.bookRotation2 -= (float)Math.PI * 2.0F; -- } -- -- while(this.bookRotation2 < -((float)Math.PI)) { -- this.bookRotation2 += (float)Math.PI * 2.0F; -- } -- -- while(this.bookRotation >= (float)Math.PI) { -- this.bookRotation -= (float)Math.PI * 2.0F; -- } -- -- while(this.bookRotation < -((float)Math.PI)) { -- this.bookRotation += (float)Math.PI * 2.0F; -+ while (this.bookRotation2 >= (float)Math.PI) { -+ this.bookRotation2 -= ((float)Math.PI * 2F); -+ } -+ -+ while (this.bookRotation2 < -(float)Math.PI) { -+ this.bookRotation2 += ((float)Math.PI * 2F); -+ } -+ -+ while (this.bookRotation >= (float)Math.PI) { -+ this.bookRotation -= ((float)Math.PI * 2F); -+ } -+ -+ while (this.bookRotation < -(float)Math.PI) { -+ this.bookRotation += ((float)Math.PI * 2F); - } - - float var7; -- for(var7 = this.bookRotation - this.bookRotation2; var7 >= (float)Math.PI; var7 -= (float)Math.PI * 2.0F) { -+ -+ for (var7 = this.bookRotation - this.bookRotation2; var7 >= (float)Math.PI; var7 -= ((float)Math.PI * 2F)) { -+ ; - } - -- while(var7 < -((float)Math.PI)) { -- var7 += (float)Math.PI * 2.0F; -+ while (var7 < -(float)Math.PI) { -+ var7 += ((float)Math.PI * 2F); - } - - this.bookRotation2 += var7 * 0.4F; -- if(this.bookSpread < 0.0F) { -+ -+ if (this.bookSpread < 0.0F) { - this.bookSpread = 0.0F; - } - -- if(this.bookSpread > 1.0F) { -+ if (this.bookSpread > 1.0F) { - this.bookSpread = 1.0F; - } - -@@ -91,11 +116,12 @@ - this.pageFlipPrev = this.pageFlip; - float var3 = (this.field_70373_d - this.pageFlip) * 0.4F; - float var8 = 0.2F; -- if(var3 < -var8) { -+ -+ if (var3 < -var8) { - var3 = -var8; - } - -- if(var3 > var8) { -+ if (var3 > var8) { - var3 = var8; - } - -@@ -104,14 +130,14 @@ - } - - public String func_94133_a() { -- return this.func_94135_b() ? this.s : "container.enchant"; -+ return this.func_94135_b() ? this.field_94136_s : "container.enchant"; - } - - public boolean func_94135_b() { -- return this.s != null && this.s.length() > 0; -+ return this.field_94136_s != null && this.field_94136_s.length() > 0; - } - -- public void func_94134_a(String var1) { -- this.s = var1; -+ public void func_94134_a(String par1Str) { -+ this.field_94136_s = par1Str; - } - } ---- /dev/null -+++ com/prupe/mcpatcher/ctm/RenderPass.java -@@ -1,0 +1,146 @@ -+package com.prupe.mcpatcher.ctm; -+ -+import com.prupe.mcpatcher.BlendMethod; -+import com.prupe.mcpatcher.MCLogger; -+import com.prupe.mcpatcher.TexturePackAPI; -+import com.prupe.mcpatcher.TexturePackChangeHandler; -+import com.prupe.mcpatcher.ctm.RenderPass$1; -+import com.prupe.mcpatcher.ctm.RenderPass$2; -+import net.minecraft.src.Block; -+import net.minecraft.src.EntityLivingBase; -+import net.minecraft.src.EntityRenderer; -+import net.minecraft.src.IBlockAccess; -+import net.minecraft.src.RenderGlobal; -+import net.minecraft.src.ResourceLocation; -+import org.lwjgl.opengl.GL11; -+ -+public class RenderPass { -+ private static final MCLogger logger = MCLogger.getLogger("Better Glass"); -+ private static final ResourceLocation RENDERPASS_PROPERTIES = TexturePackAPI.newMCPatcherResourceLocation("renderpass.properties"); -+ private static final int[] baseRenderPass = new int[Block.blocksList.length]; -+ private static final int[] extraRenderPass = new int[Block.blocksList.length]; -+ private static BlendMethod blendMethod; -+ private static boolean enableLightmap; -+ private static int renderPass = -1; -+ private static int maxRenderPass = 1; -+ private static boolean ambientOcclusion; -+ -+ public static void start(int pass) { -+ finish(); -+ renderPass = pass; -+ } -+ -+ public static void finish() { -+ renderPass = -1; -+ } -+ -+ public static boolean skipAllRenderPasses(boolean[] skipRenderPass) { -+ return skipRenderPass[0] && skipRenderPass[1] && skipRenderPass[2] && skipRenderPass[3]; -+ } -+ -+ public static int getBlockRenderPass(Block block) { -+ return renderPass <= 2 ? baseRenderPass[block.blockID] : extraRenderPass[block.blockID]; -+ } -+ -+ public static boolean canRenderInPass(Block block, int pass, boolean renderThis) { -+ return baseRenderPass[block.blockID] < 2 && extraRenderPass[block.blockID] < 2 ? renderThis : pass == getBlockRenderPass(block); -+ } -+ -+ public static boolean shouldSideBeRendered(Block block, IBlockAccess blockAccess, int i, int j, int k, int face) { -+ return block.shouldSideBeRendered(blockAccess, i, j, k, face) ? true : extraRenderPass[blockAccess.getBlockId(i, j, k)] >= 0 && extraRenderPass[block.blockID] < 0; -+ } -+ -+ public static boolean setAmbientOcclusion(boolean ambientOcclusion) { -+ ambientOcclusion = ambientOcclusion; -+ return ambientOcclusion; -+ } -+ -+ public static float getAOBaseMultiplier(float multiplier) { -+ return renderPass > 2 && !enableLightmap ? 1.0F : multiplier; -+ } -+ -+ public static void doRenderPass(RenderGlobal renderer, EntityLivingBase camera, int pass, double partialTick) { -+ if (pass <= maxRenderPass) { -+ switch (pass) { -+ case 2: -+ GL11.glDisable(GL11.GL_CULL_FACE); -+ renderer.sortAndRender(camera, pass, partialTick); -+ GL11.glEnable(GL11.GL_CULL_FACE); -+ break; -+ -+ case 3: -+ GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); -+ GL11.glPolygonOffset(-2.0F, -2.0F); -+ GL11.glEnable(GL11.GL_POLYGON_OFFSET_FILL); -+ GL11.glEnable(GL11.GL_CULL_FACE); -+ -+ if (ambientOcclusion) { -+ GL11.glShadeModel(GL11.GL_SMOOTH); -+ } -+ -+ blendMethod.applyBlending(); -+ renderer.sortAndRender(camera, pass, partialTick); -+ GL11.glPolygonOffset(0.0F, 0.0F); -+ GL11.glDisable(GL11.GL_POLYGON_OFFSET_FILL); -+ GL11.glDisable(GL11.GL_BLEND); -+ GL11.glShadeModel(GL11.GL_FLAT); -+ } -+ } -+ } -+ -+ public static void enableDisableLightmap(EntityRenderer renderer, double partialTick, int pass) { -+ if (!enableLightmap && pass == 3) { -+ renderer.disableLightmap(partialTick); -+ } else { -+ renderer.enableLightmap(partialTick); -+ } -+ } -+ -+ static int access$000() { -+ return renderPass; -+ } -+ -+ static int access$102(int x0) { -+ maxRenderPass = x0; -+ return x0; -+ } -+ -+ static int[] access$200() { -+ return baseRenderPass; -+ } -+ -+ static int[] access$300() { -+ return extraRenderPass; -+ } -+ -+ static int access$100() { -+ return maxRenderPass; -+ } -+ -+ static BlendMethod access$402(BlendMethod x0) { -+ blendMethod = x0; -+ return x0; -+ } -+ -+ static boolean access$502(boolean x0) { -+ enableLightmap = x0; -+ return x0; -+ } -+ -+ static ResourceLocation access$600() { -+ return RENDERPASS_PROPERTIES; -+ } -+ -+ static BlendMethod access$400() { -+ return blendMethod; -+ } -+ -+ static MCLogger access$700() { -+ return logger; -+ } -+ -+ static { -+ RenderPassAPI.instance = new RenderPass$1(); -+ TexturePackChangeHandler.register(new RenderPass$2("Better Glass", 4)); -+ } -+} ---- /dev/null -+++ org/spoutcraft/client/gui/settings/controls/FastDebugInfoButton.java -@@ -1,0 +1,48 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.client.gui.settings.controls; -+ -+import org.spoutcraft.api.gui.GenericButton; -+import org.spoutcraft.client.config.Configuration; -+ -+public class FastDebugInfoButton extends GenericButton { -+ public FastDebugInfoButton() { -+ setTooltip("Fast Debug Info\nFancy - default debug info screen, slower\nFast - debug info screen without lagometer, faster\nFPS Only - Shows only the frames per second, hiding debug information."); -+ } -+ -+ @Override -+ public String getText() { -+ switch (Configuration.getFastDebug()) { -+ case 0: return "Debug Info: Fancy"; -+ case 1: return "Debug Info: Fast"; -+ case 2: return "Debug Info: FPS Only"; -+ } -+ return "Unknown State: " + Configuration.getFastDebug(); -+ } -+ -+ @Override -+ public void onButtonClick() { -+ Configuration.setFastDebug(Configuration.getFastDebug() + 1); -+ if (Configuration.getFastDebug() > 2) { -+ Configuration.setFastDebug(0); -+ } -+ Configuration.write(); -+ } -+} ---- net/minecraft/src/ISaveFormat.java -+++ net/minecraft/src/ISaveFormat.java -@@ -3,21 +3,46 @@ - import java.util.List; - - public interface ISaveFormat { -+ -+ /** -+ * Returns back a loader for the specified save directory -+ */ - ISaveHandler getSaveLoader(String var1, boolean var2); - - List getSaveList() throws AnvilConverterException; - - void flushCache(); - -+ /** -+ * gets the world info -+ */ - WorldInfo getWorldInfo(String var1); - -+ /** -+ * @args: Takes one argument - the name of the directory of the world to delete. @desc: Delete the world by deleting -+ * the associated directory recursively. -+ */ - boolean deleteWorldDirectory(String var1); - -+ /** -+ * @args: Takes two arguments - first the name of the directory containing the world and second the new name for that -+ * world. @desc: Renames the world by storing the new name in level.dat. It does *not* rename the directory containing -+ * the world data. -+ */ - void renameWorld(String var1, String var2); - -+ /** -+ * Checks if the save directory uses the old map format -+ */ - boolean isOldMapFormat(String var1); - -+ /** -+ * Converts the specified map to the new map format. Args: worldName, loadingScreen -+ */ - boolean convertMapFormat(String var1, IProgressUpdate var2); - -+ /** -+ * Return whether the given world can be loaded. -+ */ - boolean canLoadWorld(String var1); - } ---- net/minecraft/src/GuiCrafting.java -+++ net/minecraft/src/GuiCrafting.java -@@ -5,16 +5,22 @@ - public class GuiCrafting extends GuiContainer { - private static final ResourceLocation craftingTableGuiTextures = new ResourceLocation("textures/gui/container/crafting_table.png"); - -- public GuiCrafting(InventoryPlayer var1, World var2, int var3, int var4, int var5) { -- super(new ContainerWorkbench(var1, var2, var3, var4, var5)); -+ public GuiCrafting(InventoryPlayer par1InventoryPlayer, World par2World, int par3, int par4, int par5) { -+ super(new ContainerWorkbench(par1InventoryPlayer, par2World, par3, par4, par5)); - } - -- protected void drawGuiContainerForegroundLayer(int var1, int var2) { -+ /** -+ * Draw the foreground layer for the GuiContainer (everything in front of the items) -+ */ -+ protected void drawGuiContainerForegroundLayer(int par1, int par2) { - this.fontRenderer.drawString(I18n.getString("container.crafting"), 28, 6, 4210752); - this.fontRenderer.drawString(I18n.getString("container.inventory"), 8, this.ySize - 96 + 2, 4210752); - } - -- protected void drawGuiContainerBackgroundLayer(float var1, int var2, int var3) { -+ /** -+ * Draw the background layer for the GuiContainer (everything behind the items) -+ */ -+ protected void drawGuiContainerBackgroundLayer(float par1, int par2, int par3) { - GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - this.mc.getTextureManager().bindTexture(craftingTableGuiTextures); - int var4 = (this.width - this.xSize) / 2; ---- net/minecraft/src/OpenGlCapsChecker.java -+++ net/minecraft/src/OpenGlCapsChecker.java -@@ -3,6 +3,10 @@ - import org.lwjgl.opengl.GLContext; - - public class OpenGlCapsChecker { -+ -+ /** -+ * Checks if we support OpenGL occlusion. -+ */ - public static boolean checkARBOcclusion() { - return GLContext.getCapabilities().GL_ARB_occlusion_query; - } ---- net/minecraft/src/EntityFireworkSparkFX.java -+++ net/minecraft/src/EntityFireworkSparkFX.java -@@ -10,66 +10,76 @@ - private float fadeColourBlue; - private boolean hasFadeColour; - -- public EntityFireworkSparkFX(World var1, double var2, double var4, double var6, double var8, double var10, double var12, EffectRenderer var14) { -- super(var1, var2, var4, var6); -- this.motionX = var8; -- this.motionY = var10; -- this.motionZ = var12; -- this.field_92047_az = var14; -- this.particleScale *= 12.0F / 16.0F; -- this.particleMaxAge = 48 + this.ab.nextInt(12); -+ public EntityFireworkSparkFX(World par1World, double par2, double par4, double par6, double par8, double par10, double par12, EffectRenderer par14EffectRenderer) { -+ super(par1World, par2, par4, par6); -+ this.motionX = par8; -+ this.motionY = par10; -+ this.motionZ = par12; -+ this.field_92047_az = par14EffectRenderer; -+ this.particleScale *= 0.75F; -+ this.particleMaxAge = 48 + this.rand.nextInt(12); - this.noClip = false; - } - -- public void setTrail(boolean var1) { -- this.field_92054_ax = var1; -- } -- -- public void setTwinkle(boolean var1) { -- this.field_92048_ay = var1; -- } -- -- public void setColour(int var1) { -- float var2 = (float)((var1 & 16711680) >> 16) / 255.0F; -- float var3 = (float)((var1 & '\uff00') >> 8) / 255.0F; -- float var4 = (float)((var1 & 255) >> 0) / 255.0F; -+ public void setTrail(boolean par1) { -+ this.field_92054_ax = par1; -+ } -+ -+ public void setTwinkle(boolean par1) { -+ this.field_92048_ay = par1; -+ } -+ -+ public void setColour(int par1) { -+ float var2 = (float)((par1 & 16711680) >> 16) / 255.0F; -+ float var3 = (float)((par1 & 65280) >> 8) / 255.0F; -+ float var4 = (float)((par1 & 255) >> 0) / 255.0F; - float var5 = 1.0F; - this.setRBGColorF(var2 * var5, var3 * var5, var4 * var5); - } - -- public void setFadeColour(int var1) { -- this.fadeColourRed = (float)((var1 & 16711680) >> 16) / 255.0F; -- this.fadeColourGreen = (float)((var1 & '\uff00') >> 8) / 255.0F; -- this.fadeColourBlue = (float)((var1 & 255) >> 0) / 255.0F; -+ public void setFadeColour(int par1) { -+ this.fadeColourRed = (float)((par1 & 16711680) >> 16) / 255.0F; -+ this.fadeColourGreen = (float)((par1 & 65280) >> 8) / 255.0F; -+ this.fadeColourBlue = (float)((par1 & 255) >> 0) / 255.0F; - this.hasFadeColour = true; - } - -+ /** -+ * returns the bounding box for this entity -+ */ - public AxisAlignedBB getBoundingBox() { - return null; - } - -+ /** -+ * Returns true if this entity should push and be pushed by other entities when colliding. -+ */ - public boolean canBePushed() { - return false; - } - -- public void renderParticle(Tessellator var1, float var2, float var3, float var4, float var5, float var6, float var7) { -- if(!this.field_92048_ay || this.particleAge < this.particleMaxAge / 3 || (this.particleAge + this.particleMaxAge) / 3 % 2 == 0) { -- super.renderParticle(var1, var2, var3, var4, var5, var6, var7); -+ public void renderParticle(Tessellator par1Tessellator, float par2, float par3, float par4, float par5, float par6, float par7) { -+ if (!this.field_92048_ay || this.particleAge < this.particleMaxAge / 3 || (this.particleAge + this.particleMaxAge) / 3 % 2 == 0) { -+ super.renderParticle(par1Tessellator, par2, par3, par4, par5, par6, par7); - } -- - } - -+ /** -+ * Called to update the entity's position/logic. -+ */ - public void onUpdate() { - this.prevPosX = this.posX; - this.prevPosY = this.posY; - this.prevPosZ = this.posZ; -- if(this.particleAge++ >= this.particleMaxAge) { -+ -+ if (this.particleAge++ >= this.particleMaxAge) { - this.setDead(); - } - -- if(this.particleAge > this.particleMaxAge / 2) { -+ if (this.particleAge > this.particleMaxAge / 2) { - this.setAlphaF(1.0F - ((float)this.particleAge - (float)(this.particleMaxAge / 2)) / (float)this.particleMaxAge); -- if(this.hasFadeColour) { -+ -+ if (this.hasFadeColour) { - this.particleRed += (this.fadeColourRed - this.particleRed) * 0.2F; - this.particleGreen += (this.fadeColourGreen - this.particleGreen) * 0.2F; - this.particleBlue += (this.fadeColourBlue - this.particleBlue) * 0.2F; -@@ -79,19 +89,21 @@ - this.setParticleTextureIndex(this.baseTextureIndex + (7 - this.particleAge * 8 / this.particleMaxAge)); - this.motionY -= 0.004D; - this.moveEntity(this.motionX, this.motionY, this.motionZ); -- this.motionX *= (double)0.91F; -- this.motionY *= (double)0.91F; -- this.motionZ *= (double)0.91F; -- if(this.onGround) { -- this.motionX *= (double)0.7F; -- this.motionZ *= (double)0.7F; -+ this.motionX *= 0.9100000262260437D; -+ this.motionY *= 0.9100000262260437D; -+ this.motionZ *= 0.9100000262260437D; -+ -+ if (this.onGround) { -+ this.motionX *= 0.699999988079071D; -+ this.motionZ *= 0.699999988079071D; - } - -- if(this.field_92054_ax && this.particleAge < this.particleMaxAge / 2 && (this.particleAge + this.particleMaxAge) % 2 == 0) { -+ if (this.field_92054_ax && this.particleAge < this.particleMaxAge / 2 && (this.particleAge + this.particleMaxAge) % 2 == 0) { - EntityFireworkSparkFX var1 = new EntityFireworkSparkFX(this.worldObj, this.posX, this.posY, this.posZ, 0.0D, 0.0D, 0.0D, this.field_92047_az); - var1.setRBGColorF(this.particleRed, this.particleGreen, this.particleBlue); - var1.particleAge = var1.particleMaxAge / 2; -- if(this.hasFadeColour) { -+ -+ if (this.hasFadeColour) { - var1.hasFadeColour = true; - var1.fadeColourRed = this.fadeColourRed; - var1.fadeColourGreen = this.fadeColourGreen; -@@ -101,14 +113,16 @@ - var1.field_92048_ay = this.field_92048_ay; - this.field_92047_az.addEffect(var1); - } -- - } - -- public int getBrightnessForRender(float var1) { -+ public int getBrightnessForRender(float par1) { - return 15728880; - } - -- public float getBrightness(float var1) { -+ /** -+ * Gets how bright this entity is. -+ */ -+ public float getBrightness(float par1) { - return 1.0F; - } - } ---- /dev/null -+++ org/spoutcraft/api/gui/GenericCheckBox.java -@@ -1,0 +1,71 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.api.gui; -+ -+import java.io.IOException; -+ -+import org.spoutcraft.api.Spoutcraft; -+import org.spoutcraft.api.UnsafeClass; -+import org.spoutcraft.api.io.SpoutInputStream; -+import org.spoutcraft.api.io.SpoutOutputStream; -+ -+@UnsafeClass -+public class GenericCheckBox extends GenericButton implements CheckBox { -+ boolean checked = false; -+ -+ public GenericCheckBox() { -+ super(); -+ } -+ -+ public GenericCheckBox(String text) { -+ super(text); -+ } -+ -+ @Override -+ public void readData(SpoutInputStream input) throws IOException { -+ super.readData(input); -+ checked = input.readBoolean(); -+ } -+ -+ @Override -+ public void writeData(SpoutOutputStream output) throws IOException { -+ super.writeData(output); -+ output.writeBoolean(checked); -+ } -+ -+ @Override -+ public WidgetType getType() { -+ return WidgetType.CheckBox; -+ } -+ -+ @Override -+ public void render() { -+ Spoutcraft.getClient().getRenderDelegate().render((GenericCheckBox)this); -+ } -+ -+ public boolean isChecked() { -+ return checked; -+ } -+ -+ public CheckBox setChecked(boolean checked) { -+ this.checked = checked; -+ return this; -+ } -+} ---- net/minecraft/src/BlockFenceGate.java -+++ net/minecraft/src/BlockFenceGate.java -@@ -1,98 +1,143 @@ - package net.minecraft.src; - - public class BlockFenceGate extends BlockDirectional { -- public BlockFenceGate(int var1) { -- super(var1, Material.wood); -+ public BlockFenceGate(int par1) { -+ super(par1, Material.wood); - this.setCreativeTab(CreativeTabs.tabRedstone); - } - -- public Icon getIcon(int var1, int var2) { -- return Block.planks.getBlockTextureFromSide(var1); -- } -- -- public boolean canPlaceBlockAt(World var1, int var2, int var3, int var4) { -- return !var1.getBlockMaterial(var2, var3 - 1, var4).isSolid() ? false : super.canPlaceBlockAt(var1, var2, var3, var4); -- } -- -- public AxisAlignedBB getCollisionBoundingBoxFromPool(World var1, int var2, int var3, int var4) { -- int var5 = var1.getBlockMetadata(var2, var3, var4); -- return isFenceGateOpen(var5) ? null : (var5 != 2 && var5 != 0 ? AxisAlignedBB.getAABBPool().getAABB((double)((float)var2 + 6.0F / 16.0F), (double)var3, (double)var4, (double)((float)var2 + 10.0F / 16.0F), (double)((float)var3 + 1.5F), (double)(var4 + 1)) : AxisAlignedBB.getAABBPool().getAABB((double)var2, (double)var3, (double)((float)var4 + 6.0F / 16.0F), (double)(var2 + 1), (double)((float)var3 + 1.5F), (double)((float)var4 + 10.0F / 16.0F))); -- } -- -- public void setBlockBoundsBasedOnState(IBlockAccess var1, int var2, int var3, int var4) { -- int var5 = getDirection(var1.getBlockMetadata(var2, var3, var4)); -- if(var5 != 2 && var5 != 0) { -- this.setBlockBounds(6.0F / 16.0F, 0.0F, 0.0F, 10.0F / 16.0F, 1.0F, 1.0F); -+ /** -+ * From the specified side and block metadata retrieves the blocks texture. Args: side, metadata -+ */ -+ public Icon getIcon(int par1, int par2) { -+ return Block.planks.getBlockTextureFromSide(par1); -+ } -+ -+ /** -+ * Checks to see if its valid to put this block at the specified coordinates. Args: world, x, y, z -+ */ -+ public boolean canPlaceBlockAt(World par1World, int par2, int par3, int par4) { -+ return !par1World.getBlockMaterial(par2, par3 - 1, par4).isSolid() ? false : super.canPlaceBlockAt(par1World, par2, par3, par4); -+ } -+ -+ /** -+ * Returns a bounding box from the pool of bounding boxes (this means this box can change after the pool has been -+ * cleared to be reused) -+ */ -+ public AxisAlignedBB getCollisionBoundingBoxFromPool(World par1World, int par2, int par3, int par4) { -+ int var5 = par1World.getBlockMetadata(par2, par3, par4); -+ return isFenceGateOpen(var5) ? null : (var5 != 2 && var5 != 0 ? AxisAlignedBB.getAABBPool().getAABB((double)((float)par2 + 0.375F), (double)par3, (double)par4, (double)((float)par2 + 0.625F), (double)((float)par3 + 1.5F), (double)(par4 + 1)) : AxisAlignedBB.getAABBPool().getAABB((double)par2, (double)par3, (double)((float)par4 + 0.375F), (double)(par2 + 1), (double)((float)par3 + 1.5F), (double)((float)par4 + 0.625F))); -+ } -+ -+ /** -+ * Updates the blocks bounds based on its current state. Args: world, x, y, z -+ */ -+ public void setBlockBoundsBasedOnState(IBlockAccess par1IBlockAccess, int par2, int par3, int par4) { -+ int var5 = getDirection(par1IBlockAccess.getBlockMetadata(par2, par3, par4)); -+ -+ if (var5 != 2 && var5 != 0) { -+ this.setBlockBounds(0.375F, 0.0F, 0.0F, 0.625F, 1.0F, 1.0F); - } else { -- this.setBlockBounds(0.0F, 0.0F, 6.0F / 16.0F, 1.0F, 1.0F, 10.0F / 16.0F); -+ this.setBlockBounds(0.0F, 0.0F, 0.375F, 1.0F, 1.0F, 0.625F); - } -- - } - -+ /** -+ * Is this block (a) opaque and (b) a full 1m cube? This determines whether or not to render the shared face of two -+ * adjacent blocks and also whether the player can attach torches, redstone wire, etc to this block. -+ */ - public boolean isOpaqueCube() { - return false; - } - -+ /** -+ * If this block doesn't render as an ordinary block it will return False (examples: signs, buttons, stairs, etc) -+ */ - public boolean renderAsNormalBlock() { - return false; - } - -- public boolean getBlocksMovement(IBlockAccess var1, int var2, int var3, int var4) { -- return isFenceGateOpen(var1.getBlockMetadata(var2, var3, var4)); -+ public boolean getBlocksMovement(IBlockAccess par1IBlockAccess, int par2, int par3, int par4) { -+ return isFenceGateOpen(par1IBlockAccess.getBlockMetadata(par2, par3, par4)); - } - -+ /** -+ * The type of render function that is called for this block -+ */ - public int getRenderType() { - return 21; - } - -- public void onBlockPlacedBy(World var1, int var2, int var3, int var4, EntityLivingBase var5, ItemStack var6) { -- int var7 = (MathHelper.floor_double((double)(var5.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3) % 4; -- var1.setBlockMetadata(var2, var3, var4, var7, 2); -+ /** -+ * Called when the block is placed in the world. -+ */ -+ public void onBlockPlacedBy(World par1World, int par2, int par3, int par4, EntityLivingBase par5EntityLivingBase, ItemStack par6ItemStack) { -+ int var7 = (MathHelper.floor_double((double)(par5EntityLivingBase.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3) % 4; -+ par1World.setBlockMetadataWithNotify(par2, par3, par4, var7, 2); - } - -- public boolean onBlockActivated(World var1, int var2, int var3, int var4, EntityPlayer var5, int var6, float var7, float var8, float var9) { -- int var10 = var1.getBlockMetadata(var2, var3, var4); -- if(isFenceGateOpen(var10)) { -- var1.setBlockMetadata(var2, var3, var4, var10 & -5, 2); -+ /** -+ * Called upon block activation (right click on the block.) -+ */ -+ public boolean onBlockActivated(World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer, int par6, float par7, float par8, float par9) { -+ int var10 = par1World.getBlockMetadata(par2, par3, par4); -+ -+ if (isFenceGateOpen(var10)) { -+ par1World.setBlockMetadataWithNotify(par2, par3, par4, var10 & -5, 2); - } else { -- int var11 = (MathHelper.floor_double((double)(var5.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3) % 4; -+ int var11 = (MathHelper.floor_double((double)(par5EntityPlayer.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3) % 4; - int var12 = getDirection(var10); -- if(var12 == (var11 + 2) % 4) { -+ -+ if (var12 == (var11 + 2) % 4) { - var10 = var11; - } - -- var1.setBlockMetadata(var2, var3, var4, var10 | 4, 2); -+ par1World.setBlockMetadataWithNotify(par2, par3, par4, var10 | 4, 2); - } - -- var1.playAuxSFXAtEntity(var5, 1003, var2, var3, var4, 0); -+ par1World.playAuxSFXAtEntity(par5EntityPlayer, 1003, par2, par3, par4, 0); - return true; - } - -- public void onNeighborBlockChange(World var1, int var2, int var3, int var4, int var5) { -- if(!var1.isRemote) { -- int var6 = var1.getBlockMetadata(var2, var3, var4); -- boolean var7 = var1.isBlockIndirectlyGettingPowered(var2, var3, var4); -- if(var7 || var5 > 0 && Block.blocksList[var5].canProvidePower()) { -- if(var7 && !isFenceGateOpen(var6)) { -- var1.setBlockMetadata(var2, var3, var4, var6 | 4, 2); -- var1.playAuxSFXAtEntity((EntityPlayer)null, 1003, var2, var3, var4, 0); -- } else if(!var7 && isFenceGateOpen(var6)) { -- var1.setBlockMetadata(var2, var3, var4, var6 & -5, 2); -- var1.playAuxSFXAtEntity((EntityPlayer)null, 1003, var2, var3, var4, 0); -+ /** -+ * Lets the block know when one of its neighbor changes. Doesn't know which neighbor changed (coordinates passed are -+ * their own) Args: x, y, z, neighbor blockID -+ */ -+ public void onNeighborBlockChange(World par1World, int par2, int par3, int par4, int par5) { -+ if (!par1World.isRemote) { -+ int var6 = par1World.getBlockMetadata(par2, par3, par4); -+ boolean var7 = par1World.isBlockIndirectlyGettingPowered(par2, par3, par4); -+ -+ if (var7 || par5 > 0 && Block.blocksList[par5].canProvidePower()) { -+ if (var7 && !isFenceGateOpen(var6)) { -+ par1World.setBlockMetadataWithNotify(par2, par3, par4, var6 | 4, 2); -+ par1World.playAuxSFXAtEntity((EntityPlayer)null, 1003, par2, par3, par4, 0); -+ } else if (!var7 && isFenceGateOpen(var6)) { -+ par1World.setBlockMetadataWithNotify(par2, par3, par4, var6 & -5, 2); -+ par1World.playAuxSFXAtEntity((EntityPlayer)null, 1003, par2, par3, par4, 0); - } - } -- - } - } - -- public static boolean isFenceGateOpen(int var0) { -- return (var0 & 4) != 0; -+ /** -+ * Returns if the fence gate is open according to its metadata. -+ */ -+ public static boolean isFenceGateOpen(int par0) { -+ return (par0 & 4) != 0; - } - -- public boolean shouldSideBeRendered(IBlockAccess var1, int var2, int var3, int var4, int var5) { -+ /** -+ * Returns true if the given side of this block type should be rendered, if the adjacent block is at the given -+ * coordinates. Args: blockAccess, x, y, z, side -+ */ -+ public boolean shouldSideBeRendered(IBlockAccess par1IBlockAccess, int par2, int par3, int par4, int par5) { - return true; - } - -- public void registerIcons(IconRegister var1) { -- } -+ /** -+ * When this method is called, your block should register all the icons it needs with the given IconRegister. This is -+ * the only chance you get to register icons. -+ */ -+ public void registerIcons(IconRegister par1IconRegister) {} - } ---- net/minecraft/src/GuiScreenPendingInvitationINNER2.java -+++ net/minecraft/src/GuiScreenPendingInvitationINNER2.java -@@ -3,18 +3,17 @@ - class GuiScreenPendingInvitationINNER2 extends Thread { - final GuiScreenPendingInvitation field_130132_a; - -- GuiScreenPendingInvitationINNER2(GuiScreenPendingInvitation var1) { -- this.field_130132_a = var1; -+ GuiScreenPendingInvitationINNER2(GuiScreenPendingInvitation par1GuiScreenPendingInvitation) { -+ this.field_130132_a = par1GuiScreenPendingInvitation; - } - - public void run() { - try { - McoClient var1 = new McoClient(GuiScreenPendingInvitation.func_130041_c(this.field_130132_a).getSession()); -- var1.func_130109_b(((PendingInvite)GuiScreenPendingInvitation.func_130042_e(this.field_130132_a).get(GuiScreenPendingInvitation.func_130049_d(this.field_130132_a))).a); -+ var1.func_130109_b(((PendingInvite)GuiScreenPendingInvitation.func_130042_e(this.field_130132_a).get(GuiScreenPendingInvitation.func_130049_d(this.field_130132_a))).field_130094_a); - GuiScreenPendingInvitation.func_130040_f(this.field_130132_a); - } catch (ExceptionMcoService var2) { - GuiScreenPendingInvitation.func_130056_g(this.field_130132_a).getLogAgent().logSevere(var2.toString()); - } -- - } - } ---- net/minecraft/src/RenderPainting.java -+++ net/minecraft/src/RenderPainting.java -@@ -6,52 +6,52 @@ - public class RenderPainting extends Render { - private static final ResourceLocation field_110807_a = new ResourceLocation("textures/painting/paintings_kristoffer_zetterstrand.png"); - -- public void renderThePainting(EntityPainting var1, double var2, double var4, double var6, float var8, float var9) { -+ public void renderThePainting(EntityPainting par1EntityPainting, double par2, double par4, double par6, float par8, float par9) { - GL11.glPushMatrix(); -- GL11.glTranslatef((float)var2, (float)var4, (float)var6); -- GL11.glRotatef(var8, 0.0F, 1.0F, 0.0F); -+ GL11.glTranslatef((float)par2, (float)par4, (float)par6); -+ GL11.glRotatef(par8, 0.0F, 1.0F, 0.0F); - GL11.glEnable(GL12.GL_RESCALE_NORMAL); -- this.bindEntityTexture(var1); -- EnumArt var10 = var1.art; -- float var11 = 1.0F / 16.0F; -+ this.bindEntityTexture(par1EntityPainting); -+ EnumArt var10 = par1EntityPainting.art; -+ float var11 = 0.0625F; - GL11.glScalef(var11, var11, var11); -- this.func_77010_a(var1, var10.sizeX, var10.sizeY, var10.offsetX, var10.offsetY); -+ this.func_77010_a(par1EntityPainting, var10.sizeX, var10.sizeY, var10.offsetX, var10.offsetY); - GL11.glDisable(GL12.GL_RESCALE_NORMAL); - GL11.glPopMatrix(); - } - -- protected ResourceLocation func_110806_a(EntityPainting var1) { -+ protected ResourceLocation func_110806_a(EntityPainting par1EntityPainting) { - return field_110807_a; - } - -- private void func_77010_a(EntityPainting var1, int var2, int var3, int var4, int var5) { -- float var6 = (float)(-var2) / 2.0F; -- float var7 = (float)(-var3) / 2.0F; -+ private void func_77010_a(EntityPainting par1EntityPainting, int par2, int par3, int par4, int par5) { -+ float var6 = (float)(-par2) / 2.0F; -+ float var7 = (float)(-par3) / 2.0F; - float var8 = 0.5F; -- float var9 = 12.0F / 16.0F; -- float var10 = 13.0F / 16.0F; -+ float var9 = 0.75F; -+ float var10 = 0.8125F; - float var11 = 0.0F; -- float var12 = 1.0F / 16.0F; -- float var13 = 12.0F / 16.0F; -- float var14 = 13.0F / 16.0F; -+ float var12 = 0.0625F; -+ float var13 = 0.75F; -+ float var14 = 0.8125F; - float var15 = 0.001953125F; - float var16 = 0.001953125F; -- float var17 = 385.0F / 512.0F; -- float var18 = 385.0F / 512.0F; -+ float var17 = 0.7519531F; -+ float var18 = 0.7519531F; - float var19 = 0.0F; -- float var20 = 1.0F / 16.0F; -+ float var20 = 0.0625F; - -- for(int var21 = 0; var21 < var2 / 16; ++var21) { -- for(int var22 = 0; var22 < var3 / 16; ++var22) { -+ for (int var21 = 0; var21 < par2 / 16; ++var21) { -+ for (int var22 = 0; var22 < par3 / 16; ++var22) { - float var23 = var6 + (float)((var21 + 1) * 16); - float var24 = var6 + (float)(var21 * 16); - float var25 = var7 + (float)((var22 + 1) * 16); - float var26 = var7 + (float)(var22 * 16); -- this.func_77008_a(var1, (var23 + var24) / 2.0F, (var25 + var26) / 2.0F); -- float var27 = (float)(var4 + var2 - var21 * 16) / 256.0F; -- float var28 = (float)(var4 + var2 - (var21 + 1) * 16) / 256.0F; -- float var29 = (float)(var5 + var3 - var22 * 16) / 256.0F; -- float var30 = (float)(var5 + var3 - (var22 + 1) * 16) / 256.0F; -+ this.func_77008_a(par1EntityPainting, (var23 + var24) / 2.0F, (var25 + var26) / 2.0F); -+ float var27 = (float)(par4 + par2 - var21 * 16) / 256.0F; -+ float var28 = (float)(par4 + par2 - (var21 + 1) * 16) / 256.0F; -+ float var29 = (float)(par5 + par3 - var22 * 16) / 256.0F; -+ float var30 = (float)(par5 + par3 - (var22 + 1) * 16) / 256.0F; - Tessellator var31 = Tessellator.instance; - var31.startDrawingQuads(); - var31.setNormal(0.0F, 0.0F, -1.0F); -@@ -87,27 +87,27 @@ - var31.draw(); - } - } -- - } - -- private void func_77008_a(EntityPainting var1, float var2, float var3) { -- int var4 = MathHelper.floor_double(var1.posX); -- int var5 = MathHelper.floor_double(var1.posY + (double)(var3 / 16.0F)); -- int var6 = MathHelper.floor_double(var1.posZ); -- if(var1.hangingDirection == 2) { -- var4 = MathHelper.floor_double(var1.posX + (double)(var2 / 16.0F)); -- } -- -- if(var1.hangingDirection == 1) { -- var6 = MathHelper.floor_double(var1.posZ - (double)(var2 / 16.0F)); -- } -- -- if(var1.hangingDirection == 0) { -- var4 = MathHelper.floor_double(var1.posX - (double)(var2 / 16.0F)); -- } -- -- if(var1.hangingDirection == 3) { -- var6 = MathHelper.floor_double(var1.posZ + (double)(var2 / 16.0F)); -+ private void func_77008_a(EntityPainting par1EntityPainting, float par2, float par3) { -+ int var4 = MathHelper.floor_double(par1EntityPainting.posX); -+ int var5 = MathHelper.floor_double(par1EntityPainting.posY + (double)(par3 / 16.0F)); -+ int var6 = MathHelper.floor_double(par1EntityPainting.posZ); -+ -+ if (par1EntityPainting.hangingDirection == 2) { -+ var4 = MathHelper.floor_double(par1EntityPainting.posX + (double)(par2 / 16.0F)); -+ } -+ -+ if (par1EntityPainting.hangingDirection == 1) { -+ var6 = MathHelper.floor_double(par1EntityPainting.posZ - (double)(par2 / 16.0F)); -+ } -+ -+ if (par1EntityPainting.hangingDirection == 0) { -+ var4 = MathHelper.floor_double(par1EntityPainting.posX - (double)(par2 / 16.0F)); -+ } -+ -+ if (par1EntityPainting.hangingDirection == 3) { -+ var6 = MathHelper.floor_double(par1EntityPainting.posZ + (double)(par2 / 16.0F)); - } - - int var7 = this.renderManager.worldObj.getLightBrightnessForSkyBlocks(var4, var5, var6, 0); -@@ -117,11 +117,20 @@ - GL11.glColor3f(1.0F, 1.0F, 1.0F); - } - -- protected ResourceLocation getEntityTexture(Entity var1) { -- return this.func_110806_a((EntityPainting)var1); -+ /** -+ * Returns the location of an entity's texture. Doesn't seem to be called unless you call Render.bindEntityTexture. -+ */ -+ protected ResourceLocation getEntityTexture(Entity par1Entity) { -+ return this.func_110806_a((EntityPainting)par1Entity); - } - -- public void doRender(Entity var1, double var2, double var4, double var6, float var8, float var9) { -- this.renderThePainting((EntityPainting)var1, var2, var4, var6, var8, var9); -+ /** -+ * Actually renders the given argument. This is a synthetic bridge method, always casting down its argument and then -+ * handing it off to a worker function which does the actual work. In all probabilty, the class Render is generic -+ * (Render intCacheSize) { -- intCacheSize = var0; -- d.clear(); -- e.clear(); -+ } else if (par0 > intCacheSize) { -+ intCacheSize = par0; -+ freeLargeArrays.clear(); -+ inUseLargeArrays.clear(); - var1 = new int[intCacheSize]; -- e.add(var1); -+ inUseLargeArrays.add(var1); - return var1; -- } else if(d.isEmpty()) { -+ } else if (freeLargeArrays.isEmpty()) { - var1 = new int[intCacheSize]; -- e.add(var1); -+ inUseLargeArrays.add(var1); - return var1; - } else { -- var1 = (int[])d.remove(d.size() - 1); -- e.add(var1); -+ var1 = (int[])freeLargeArrays.remove(freeLargeArrays.size() - 1); -+ inUseLargeArrays.add(var1); - return var1; - } - } - -+ /** -+ * Mark all pre-allocated arrays as available for re-use by moving them to the appropriate free lists. -+ */ - public static synchronized void resetIntCache() { -- if(!d.isEmpty()) { -- d.remove(d.size() - 1); -- } -- -- if(!b.isEmpty()) { -- b.remove(b.size() - 1); -- } -- -- d.addAll(e); -- b.addAll(c); -- e.clear(); -- c.clear(); -+ if (!freeLargeArrays.isEmpty()) { -+ freeLargeArrays.remove(freeLargeArrays.size() - 1); -+ } -+ -+ if (!freeSmallArrays.isEmpty()) { -+ freeSmallArrays.remove(freeSmallArrays.size() - 1); -+ } -+ -+ freeLargeArrays.addAll(inUseLargeArrays); -+ freeSmallArrays.addAll(inUseSmallArrays); -+ inUseLargeArrays.clear(); -+ inUseSmallArrays.clear(); - } - - public static synchronized String func_85144_b() { -- return "cache: " + d.size() + ", tcache: " + b.size() + ", allocated: " + e.size() + ", tallocated: " + c.size(); -+ return "cache: " + freeLargeArrays.size() + ", tcache: " + freeSmallArrays.size() + ", allocated: " + inUseLargeArrays.size() + ", tallocated: " + inUseSmallArrays.size(); - } - } ---- /dev/null -+++ org/spoutcraft/client/packet/PacketWaypoint.java -@@ -1,0 +1,74 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.client.packet; -+ -+import java.io.IOException; -+import java.text.SimpleDateFormat; -+import java.util.Date; -+ -+import org.spoutcraft.api.io.SpoutInputStream; -+import org.spoutcraft.api.io.SpoutOutputStream; -+import org.spoutcraft.client.gui.minimap.MinimapConfig; -+import org.spoutcraft.client.gui.minimap.Waypoint; -+ -+public class PacketWaypoint implements SpoutPacket { -+ private double x, y, z; -+ private String name; -+ private boolean death = false; -+ -+ public PacketWaypoint() { } -+ -+ public void readData(SpoutInputStream input) throws IOException { -+ x = input.readDouble(); -+ y = input.readDouble(); -+ z = input.readDouble(); -+ name = input.readString(); -+ death = input.readBoolean(); -+ } -+ -+ public void writeData(SpoutOutputStream output) throws IOException { -+ output.writeDouble(x); -+ output.writeDouble(y); -+ output.writeDouble(z); -+ output.writeString(name); -+ output.writeBoolean(death); -+ } -+ -+ public void run(int playerId) { -+ if (!death) { -+ MinimapConfig.getInstance().addServerWaypoint(x, y, z, name); -+ } else { -+ Waypoint point = new Waypoint("Death " + new SimpleDateFormat("dd-MM-yyyy").format(new Date()), (int)x, (int)y, (int)z, true); -+ point.deathpoint = true; -+ MinimapConfig.getInstance().addWaypoint(point); -+ } -+ } -+ -+ public void failure(int playerId) { -+ } -+ -+ public PacketType getPacketType() { -+ return PacketType.PacketWaypoint; -+ } -+ -+ public int getVersion() { -+ return 0; -+ } -+} ---- net/minecraft/src/StepSound.java -+++ net/minecraft/src/StepSound.java -@@ -1,14 +1,14 @@ - package net.minecraft.src; - - public class StepSound { -- public final String a; -+ public final String stepSoundName; - public final float stepSoundVolume; - public final float stepSoundPitch; - -- public StepSound(String var1, float var2, float var3) { -- this.a = var1; -- this.stepSoundVolume = var2; -- this.stepSoundPitch = var3; -+ public StepSound(String par1Str, float par2, float par3) { -+ this.stepSoundName = par1Str; -+ this.stepSoundVolume = par2; -+ this.stepSoundPitch = par3; - } - - public float getVolume() { -@@ -19,14 +19,23 @@ - return this.stepSoundPitch; - } - -+ /** -+ * Used when a block breaks, EXA: Player break, Shep eating grass, etc.. -+ */ - public String getBreakSound() { -- return "dig." + this.a; -+ return "dig." + this.stepSoundName; - } - -+ /** -+ * Used when a entity walks over, or otherwise interacts with the block. -+ */ - public String getStepSound() { -- return "step." + this.a; -+ return "step." + this.stepSoundName; - } - -+ /** -+ * Used when a player places a block. -+ */ - public String getPlaceSound() { - return this.getBreakSound(); - } ---- /dev/null -+++ org/spoutcraft/client/special/Resources.java -@@ -1,0 +1,122 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.client.special; -+ -+import java.io.File; -+import java.util.ArrayList; -+import java.util.List; -+import java.util.Map; -+import java.util.concurrent.ConcurrentHashMap; -+ -+import org.bukkit.util.config.Configuration; -+ -+import org.spoutcraft.client.io.FileUtil; -+ -+public enum Resources implements YAMLResource { -+ Special (new File(FileUtil.getConfigDir(), "special.yml")), -+ VIP (new File(FileUtil.getConfigDir(), "vip.yml")), -+ ; -+ -+ final BaseYAMLResource resource; -+ private Resources(File directory) { -+ this.resource = new BaseYAMLResource(directory); -+ } -+ -+ public Configuration getYAML() { -+ return resource.getYAML(); -+ } -+ -+ public boolean updateYAML() { -+ return resource.updateYAML(); -+ } -+ -+ private static List holidays = null; -+ public static synchronized Holiday getHoliday() { -+ if (holidays == null) { -+ holidays = new ArrayList(); -+ try { -+ Configuration config = Special.getYAML(); -+ for (String key : config.getKeys()) { -+ try { -+ @SuppressWarnings("unchecked") -+ Map values = (Map) config.getProperty(key); -+ long start = (Long) values.get("start"); -+ long end = (Long) values.get("end"); -+ String cape = (String) values.get("cape"); -+ String splash = (String) values.get("splash"); -+ boolean particles = (Boolean) values.get("particles"); -+ Holiday holiday = new Holiday(key, start, end, cape, splash, particles); -+ holidays.add(holiday); -+ } catch (Exception e) { -+ //e.printStackTrace(); -+ } -+ } -+ } catch (Exception e) { -+ e.printStackTrace(); -+ } -+ } -+ -+ long time = System.currentTimeMillis() / 1000; -+ for (Holiday holiday : holidays) { -+ if (time > holiday.getStart() && time < holiday.getEnd()) { -+ return holiday; -+ } -+ } -+ return null; -+ } -+ -+ private static Map vips; -+ @SuppressWarnings("unchecked") -+ public static VIP getVIP(String username) { -+ if (vips == null) { -+ vips = new ConcurrentHashMap(); -+ Configuration config = VIP.getYAML(); -+ for (String key : config.getKeys()) { -+ try { -+ Map values = (Map) config.getProperty(key); -+ key = key.toLowerCase(); -+ String title = (String) values.get("title"); -+ title = formatChatColors(title); -+ String cape = (String) values.get("cape"); -+ String armor = (String) values.get("armor"); -+ float scale = 1f; -+ if (values.containsKey("scale")) { -+ scale = ((Number) values.get("scale")).floatValue(); -+ } -+ Map particles = (Map) values.get("particles"); -+ Map acs = (Map) values.get("accessories"); -+ VIP vip = new VIP(key, title, cape, particles, acs, armor, scale); -+ vips.put(key, vip); -+ } catch (Exception e) { -+ e.printStackTrace(); -+ } -+ } -+ } -+ -+ return vips.get(username.toLowerCase()); -+ } -+ -+ public static String formatChatColors(String message) { -+ message = message.replaceAll("(&([a-fA-F0-9]))", "\u00A7$2"); -+ message = message.replaceAll("(&([k-oK-O0-9]))", "\u00A7$2"); -+ message = message.replaceAll("(&([r|R]))", "\u00A7$2"); -+ return message; -+ } -+} ---- net/minecraft/src/BlockTNT.java -+++ net/minecraft/src/BlockTNT.java -@@ -6,88 +6,121 @@ - private Icon field_94393_a; - private Icon field_94392_b; - -- public BlockTNT(int var1) { -- super(var1, Material.tnt); -+ public BlockTNT(int par1) { -+ super(par1, Material.tnt); - this.setCreativeTab(CreativeTabs.tabRedstone); - } - -- public Icon getIcon(int var1, int var2) { -- return var1 == 0 ? this.field_94392_b : (var1 == 1 ? this.field_94393_a : this.blockIcon); -- } -- -- public void onBlockAdded(World var1, int var2, int var3, int var4) { -- super.onBlockAdded(var1, var2, var3, var4); -- if(var1.isBlockIndirectlyGettingPowered(var2, var3, var4)) { -- this.onBlockDestroyedByPlayer(var1, var2, var3, var4, 1); -- var1.setBlockToAir(var2, var3, var4); -- } -- -- } -- -- public void onNeighborBlockChange(World var1, int var2, int var3, int var4, int var5) { -- if(var1.isBlockIndirectlyGettingPowered(var2, var3, var4)) { -- this.onBlockDestroyedByPlayer(var1, var2, var3, var4, 1); -- var1.setBlockToAir(var2, var3, var4); -- } -- -- } -- -- public int quantityDropped(Random var1) { -+ /** -+ * From the specified side and block metadata retrieves the blocks texture. Args: side, metadata -+ */ -+ public Icon getIcon(int par1, int par2) { -+ return par1 == 0 ? this.field_94392_b : (par1 == 1 ? this.field_94393_a : this.blockIcon); -+ } -+ -+ /** -+ * Called whenever the block is added into the world. Args: world, x, y, z -+ */ -+ public void onBlockAdded(World par1World, int par2, int par3, int par4) { -+ super.onBlockAdded(par1World, par2, par3, par4); -+ -+ if (par1World.isBlockIndirectlyGettingPowered(par2, par3, par4)) { -+ this.onBlockDestroyedByPlayer(par1World, par2, par3, par4, 1); -+ par1World.setBlockToAir(par2, par3, par4); -+ } -+ } -+ -+ /** -+ * Lets the block know when one of its neighbor changes. Doesn't know which neighbor changed (coordinates passed are -+ * their own) Args: x, y, z, neighbor blockID -+ */ -+ public void onNeighborBlockChange(World par1World, int par2, int par3, int par4, int par5) { -+ if (par1World.isBlockIndirectlyGettingPowered(par2, par3, par4)) { -+ this.onBlockDestroyedByPlayer(par1World, par2, par3, par4, 1); -+ par1World.setBlockToAir(par2, par3, par4); -+ } -+ } -+ -+ /** -+ * Returns the quantity of items to drop on block destruction. -+ */ -+ public int quantityDropped(Random par1Random) { - return 1; - } - -- public void onBlockDestroyedByExplosion(World var1, int var2, int var3, int var4, Explosion var5) { -- if(!var1.isRemote) { -- EntityTNTPrimed var6 = new EntityTNTPrimed(var1, (double)((float)var2 + 0.5F), (double)((float)var3 + 0.5F), (double)((float)var4 + 0.5F), var5.getExplosivePlacedBy()); -- var6.fuse = var1.s.nextInt(var6.fuse / 4) + var6.fuse / 8; -- var1.spawnEntityInWorld(var6); -+ /** -+ * Called upon the block being destroyed by an explosion -+ */ -+ public void onBlockDestroyedByExplosion(World par1World, int par2, int par3, int par4, Explosion par5Explosion) { -+ if (!par1World.isRemote) { -+ EntityTNTPrimed var6 = new EntityTNTPrimed(par1World, (double)((float)par2 + 0.5F), (double)((float)par3 + 0.5F), (double)((float)par4 + 0.5F), par5Explosion.getExplosivePlacedBy()); -+ var6.fuse = par1World.rand.nextInt(var6.fuse / 4) + var6.fuse / 8; -+ par1World.spawnEntityInWorld(var6); - } - } - -- public void onBlockDestroyedByPlayer(World var1, int var2, int var3, int var4, int var5) { -- this.primeTnt(var1, var2, var3, var4, var5, (EntityLivingBase)null); -+ /** -+ * Called right before the block is destroyed by a player. Args: world, x, y, z, metaData -+ */ -+ public void onBlockDestroyedByPlayer(World par1World, int par2, int par3, int par4, int par5) { -+ this.primeTnt(par1World, par2, par3, par4, par5, (EntityLivingBase)null); - } - -- public void primeTnt(World var1, int var2, int var3, int var4, int var5, EntityLivingBase var6) { -- if(!var1.isRemote) { -- if((var5 & 1) == 1) { -- EntityTNTPrimed var7 = new EntityTNTPrimed(var1, (double)((float)var2 + 0.5F), (double)((float)var3 + 0.5F), (double)((float)var4 + 0.5F), var6); -- var1.spawnEntityInWorld(var7); -- var1.playSoundAtEntity(var7, "random.fuse", 1.0F, 1.0F); -+ /** -+ * spawns the primed tnt and plays the fuse sound. -+ */ -+ public void primeTnt(World par1World, int par2, int par3, int par4, int par5, EntityLivingBase par6EntityLivingBase) { -+ if (!par1World.isRemote) { -+ if ((par5 & 1) == 1) { -+ EntityTNTPrimed var7 = new EntityTNTPrimed(par1World, (double)((float)par2 + 0.5F), (double)((float)par3 + 0.5F), (double)((float)par4 + 0.5F), par6EntityLivingBase); -+ par1World.spawnEntityInWorld(var7); -+ par1World.playSoundAtEntity(var7, "random.fuse", 1.0F, 1.0F); - } -- - } - } - -- public boolean onBlockActivated(World var1, int var2, int var3, int var4, EntityPlayer var5, int var6, float var7, float var8, float var9) { -- if(var5.getCurrentEquippedItem() != null && var5.getCurrentEquippedItem().itemID == Item.flintAndSteel.itemID) { -- this.primeTnt(var1, var2, var3, var4, 1, var5); -- var1.setBlockToAir(var2, var3, var4); -- var5.getCurrentEquippedItem().damageItem(1, var5); -+ /** -+ * Called upon block activation (right click on the block.) -+ */ -+ public boolean onBlockActivated(World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer, int par6, float par7, float par8, float par9) { -+ if (par5EntityPlayer.getCurrentEquippedItem() != null && par5EntityPlayer.getCurrentEquippedItem().itemID == Item.flintAndSteel.itemID) { -+ this.primeTnt(par1World, par2, par3, par4, 1, par5EntityPlayer); -+ par1World.setBlockToAir(par2, par3, par4); -+ par5EntityPlayer.getCurrentEquippedItem().damageItem(1, par5EntityPlayer); - return true; - } else { -- return super.onBlockActivated(var1, var2, var3, var4, var5, var6, var7, var8, var9); -+ return super.onBlockActivated(par1World, par2, par3, par4, par5EntityPlayer, par6, par7, par8, par9); - } - } - -- public void onEntityCollidedWithBlock(World var1, int var2, int var3, int var4, Entity var5) { -- if(var5 instanceof EntityArrow && !var1.isRemote) { -- EntityArrow var6 = (EntityArrow)var5; -- if(var6.isBurning()) { -- this.primeTnt(var1, var2, var3, var4, 1, var6.shootingEntity instanceof EntityLivingBase ? (EntityLivingBase)var6.shootingEntity : null); -- var1.setBlockToAir(var2, var3, var4); -+ /** -+ * Triggered whenever an entity collides with this block (enters into the block). Args: world, x, y, z, entity -+ */ -+ public void onEntityCollidedWithBlock(World par1World, int par2, int par3, int par4, Entity par5Entity) { -+ if (par5Entity instanceof EntityArrow && !par1World.isRemote) { -+ EntityArrow var6 = (EntityArrow)par5Entity; -+ -+ if (var6.isBurning()) { -+ this.primeTnt(par1World, par2, par3, par4, 1, var6.shootingEntity instanceof EntityLivingBase ? (EntityLivingBase)var6.shootingEntity : null); -+ par1World.setBlockToAir(par2, par3, par4); - } - } -- - } - -- public boolean canDropFromExplosion(Explosion var1) { -+ /** -+ * Return whether this block can drop from an explosion. -+ */ -+ public boolean canDropFromExplosion(Explosion par1Explosion) { - return false; - } - -- public void registerIcons(IconRegister var1) { -- this.blockIcon = var1.registerIcon(this.getTextureName() + "_side"); -- this.field_94393_a = var1.registerIcon(this.getTextureName() + "_top"); -- this.field_94392_b = var1.registerIcon(this.getTextureName() + "_bottom"); -+ /** -+ * When this method is called, your block should register all the icons it needs with the given IconRegister. This is -+ * the only chance you get to register icons. -+ */ -+ public void registerIcons(IconRegister par1IconRegister) { -+ this.blockIcon = par1IconRegister.registerIcon(this.getTextureName() + "_side"); -+ this.field_94393_a = par1IconRegister.registerIcon(this.getTextureName() + "_top"); -+ this.field_94392_b = par1IconRegister.registerIcon(this.getTextureName() + "_bottom"); - } - } ---- net/minecraft/src/EntityAIOcelotSit.java -+++ net/minecraft/src/EntityAIOcelotSit.java -@@ -3,27 +3,46 @@ - public class EntityAIOcelotSit extends EntityAIBase { - private final EntityOcelot theOcelot; - private final double field_75404_b; -+ -+ /** Tracks for how long the task has been executing */ - private int currentTick; - private int field_75402_d; -+ -+ /** For how long the Ocelot should be sitting */ - private int maxSittingTicks; -+ -+ /** X Coordinate of a nearby sitable block */ - private int sitableBlockX; -+ -+ /** Y Coordinate of a nearby sitable block */ - private int sitableBlockY; -+ -+ /** Z Coordinate of a nearby sitable block */ - private int sitableBlockZ; - -- public EntityAIOcelotSit(EntityOcelot var1, double var2) { -- this.theOcelot = var1; -- this.field_75404_b = var2; -+ public EntityAIOcelotSit(EntityOcelot par1EntityOcelot, double par2) { -+ this.theOcelot = par1EntityOcelot; -+ this.field_75404_b = par2; - this.setMutexBits(5); - } - -+ /** -+ * Returns whether the EntityAIBase should begin execution. -+ */ - public boolean shouldExecute() { -- return this.theOcelot.isTamed() && !this.theOcelot.isSitting() && this.theOcelot.getRNG().nextDouble() <= (double)0.0065F && this.getNearbySitableBlockDistance(); -+ return this.theOcelot.isTamed() && !this.theOcelot.isSitting() && this.theOcelot.getRNG().nextDouble() <= 0.006500000134110451D && this.getNearbySitableBlockDistance(); - } - -+ /** -+ * Returns whether an in-progress EntityAIBase should continue executing -+ */ - public boolean continueExecuting() { - return this.currentTick <= this.maxSittingTicks && this.field_75402_d <= 60 && this.isSittableBlock(this.theOcelot.worldObj, this.sitableBlockX, this.sitableBlockY, this.sitableBlockZ); - } - -+ /** -+ * Execute a one shot task or start executing a continuous task -+ */ - public void startExecuting() { - this.theOcelot.getNavigator().tryMoveToXYZ((double)((float)this.sitableBlockX) + 0.5D, (double)(this.sitableBlockY + 1), (double)((float)this.sitableBlockZ) + 0.5D, this.field_75404_b); - this.currentTick = 0; -@@ -32,34 +51,44 @@ - this.theOcelot.func_70907_r().setSitting(false); - } - -+ /** -+ * Resets the task -+ */ - public void resetTask() { - this.theOcelot.setSitting(false); - } - -+ /** -+ * Updates the task -+ */ - public void updateTask() { - ++this.currentTick; - this.theOcelot.func_70907_r().setSitting(false); -- if(this.theOcelot.getDistanceSq((double)this.sitableBlockX, (double)(this.sitableBlockY + 1), (double)this.sitableBlockZ) > 1.0D) { -+ -+ if (this.theOcelot.getDistanceSq((double)this.sitableBlockX, (double)(this.sitableBlockY + 1), (double)this.sitableBlockZ) > 1.0D) { - this.theOcelot.setSitting(false); - this.theOcelot.getNavigator().tryMoveToXYZ((double)((float)this.sitableBlockX) + 0.5D, (double)(this.sitableBlockY + 1), (double)((float)this.sitableBlockZ) + 0.5D, this.field_75404_b); - ++this.field_75402_d; -- } else if(!this.theOcelot.isSitting()) { -+ } else if (!this.theOcelot.isSitting()) { - this.theOcelot.setSitting(true); - } else { - --this.field_75402_d; - } -- - } - -+ /** -+ * Searches for a block to sit on within a 8 block range, returns 0 if none found -+ */ - private boolean getNearbySitableBlockDistance() { - int var1 = (int)this.theOcelot.posY; -- double var2 = (double)Integer.MAX_VALUE; -+ double var2 = 2.147483647E9D; - -- for(int var4 = (int)this.theOcelot.posX - 8; (double)var4 < this.theOcelot.posX + 8.0D; ++var4) { -- for(int var5 = (int)this.theOcelot.posZ - 8; (double)var5 < this.theOcelot.posZ + 8.0D; ++var5) { -- if(this.isSittableBlock(this.theOcelot.worldObj, var4, var1, var5) && this.theOcelot.worldObj.isAirBlock(var4, var1 + 1, var5)) { -+ for (int var4 = (int)this.theOcelot.posX - 8; (double)var4 < this.theOcelot.posX + 8.0D; ++var4) { -+ for (int var5 = (int)this.theOcelot.posZ - 8; (double)var5 < this.theOcelot.posZ + 8.0D; ++var5) { -+ if (this.isSittableBlock(this.theOcelot.worldObj, var4, var1, var5) && this.theOcelot.worldObj.isAirBlock(var4, var1 + 1, var5)) { - double var6 = this.theOcelot.getDistanceSq((double)var4, (double)var1, (double)var5); -- if(var6 < var2) { -+ -+ if (var6 < var2) { - this.sitableBlockX = var4; - this.sitableBlockY = var1; - this.sitableBlockZ = var5; -@@ -69,23 +98,28 @@ - } - } - -- return var2 < (double)Integer.MAX_VALUE; -+ return var2 < 2.147483647E9D; - } - -- private boolean isSittableBlock(World var1, int var2, int var3, int var4) { -- int var5 = var1.getBlockId(var2, var3, var4); -- int var6 = var1.getBlockMetadata(var2, var3, var4); -- if(var5 == Block.chest.blockID) { -- TileEntityChest var7 = (TileEntityChest)var1.getBlockTileEntity(var2, var3, var4); -- if(var7.numUsingPlayers < 1) { -+ /** -+ * Determines whether the Ocelot wants to sit on the block at given coordinate -+ */ -+ private boolean isSittableBlock(World par1World, int par2, int par3, int par4) { -+ int var5 = par1World.getBlockId(par2, par3, par4); -+ int var6 = par1World.getBlockMetadata(par2, par3, par4); -+ -+ if (var5 == Block.chest.blockID) { -+ TileEntityChest var7 = (TileEntityChest)par1World.getBlockTileEntity(par2, par3, par4); -+ -+ if (var7.numUsingPlayers < 1) { - return true; - } - } else { -- if(var5 == Block.furnaceBurning.blockID) { -+ if (var5 == Block.furnaceBurning.blockID) { - return true; - } - -- if(var5 == Block.bed.blockID && !BlockBed.isBlockHeadOfBed(var6)) { -+ if (var5 == Block.bed.blockID && !BlockBed.isBlockHeadOfBed(var6)) { - return true; - } - } ---- net/minecraft/src/MapGenStructure.java -+++ net/minecraft/src/MapGenStructure.java -@@ -8,45 +8,58 @@ - - public abstract class MapGenStructure extends MapGenBase { - private MapGenStructureData field_143029_e; -- protected Map d = new HashMap(); -+ -+ /** -+ * Used to store a list of all structures that have been recursively generated. Used so that during recursive -+ * generation, the structure generator can avoid generating structures that intersect ones that have already been -+ * placed. -+ */ -+ protected Map structureMap = new HashMap(); - - public abstract String func_143025_a(); - -- protected final void recursiveGenerate(World var1, int var2, int var3, int var4, int var5, byte[] var6) { -- this.func_143027_a(var1); -- if(!this.d.containsKey(Long.valueOf(ChunkCoordIntPair.chunkXZ2Int(var2, var3)))) { -- this.b.nextInt(); -+ /** -+ * Recursively called by generate() (generate) and optionally by itself. -+ */ -+ protected final void recursiveGenerate(World par1World, int par2, int par3, int par4, int par5, byte[] par6ArrayOfByte) { -+ this.func_143027_a(par1World); -+ -+ if (!this.structureMap.containsKey(Long.valueOf(ChunkCoordIntPair.chunkXZ2Int(par2, par3)))) { -+ this.rand.nextInt(); - - try { -- if(this.canSpawnStructureAtCoords(var2, var3)) { -- StructureStart var7 = this.getStructureStart(var2, var3); -- this.d.put(Long.valueOf(ChunkCoordIntPair.chunkXZ2Int(var2, var3)), var7); -- this.func_143026_a(var2, var3, var7); -+ if (this.canSpawnStructureAtCoords(par2, par3)) { -+ StructureStart var7 = this.getStructureStart(par2, par3); -+ this.structureMap.put(Long.valueOf(ChunkCoordIntPair.chunkXZ2Int(par2, par3)), var7); -+ this.func_143026_a(par2, par3, var7); - } -- - } catch (Throwable var10) { - CrashReport var8 = CrashReport.makeCrashReport(var10, "Exception preparing structure feature"); - CrashReportCategory var9 = var8.makeCategory("Feature being prepared"); -- var9.addCrashSectionCallable("Is feature chunk", new CallableIsFeatureChunk(this, var2, var3)); -- var9.addCrashSection("Chunk location", String.format("%d,%d", new Object[]{Integer.valueOf(var2), Integer.valueOf(var3)})); -- var9.addCrashSectionCallable("Chunk pos hash", new CallableChunkPosHash(this, var2, var3)); -+ var9.addCrashSectionCallable("Is feature chunk", new CallableIsFeatureChunk(this, par2, par3)); -+ var9.addCrashSection("Chunk location", String.format("%d,%d", new Object[] {Integer.valueOf(par2), Integer.valueOf(par3)})); -+ var9.addCrashSectionCallable("Chunk pos hash", new CallableChunkPosHash(this, par2, par3)); - var9.addCrashSectionCallable("Structure type", new CallableStructureType(this)); - throw new ReportedException(var8); - } - } - } - -- public boolean generateStructuresInChunk(World var1, Random var2, int var3, int var4) { -- this.func_143027_a(var1); -- int var5 = (var3 << 4) + 8; -- int var6 = (var4 << 4) + 8; -+ /** -+ * Generates structures in specified chunk next to existing structures. Does *not* generate StructureStarts. -+ */ -+ public boolean generateStructuresInChunk(World par1World, Random par2Random, int par3, int par4) { -+ this.func_143027_a(par1World); -+ int var5 = (par3 << 4) + 8; -+ int var6 = (par4 << 4) + 8; - boolean var7 = false; -- Iterator var8 = this.d.values().iterator(); -+ Iterator var8 = this.structureMap.values().iterator(); - -- while(var8.hasNext()) { -+ while (var8.hasNext()) { - StructureStart var9 = (StructureStart)var8.next(); -- if(var9.isSizeableStructure() && var9.getBoundingBox().intersectsWith(var5, var6, var5 + 15, var6 + 15)) { -- var9.generateStructure(var1, var2, new StructureBoundingBox(var5, var6, var5 + 15, var6 + 15)); -+ -+ if (var9.isSizeableStructure() && var9.getBoundingBox().intersectsWith(var5, var6, var5 + 15, var6 + 15)) { -+ var9.generateStructure(par1World, par2Random, new StructureBoundingBox(var5, var6, var5 + 15, var6 + 15)); - var7 = true; - this.func_143026_a(var9.func_143019_e(), var9.func_143018_f(), var9); - } -@@ -55,103 +68,106 @@ - return var7; - } - -- public boolean hasStructureAt(int var1, int var2, int var3) { -+ /** -+ * Returns true if the structure generator has generated a structure located at the given position tuple. -+ */ -+ public boolean hasStructureAt(int par1, int par2, int par3) { - this.func_143027_a(this.worldObj); -- return this.func_143028_c(var1, var2, var3) != null; -+ return this.func_143028_c(par1, par2, par3) != null; - } - -- protected StructureStart func_143028_c(int var1, int var2, int var3) { -- Iterator var4 = this.d.values().iterator(); -- -- while(true) { -- StructureStart var5; -- do { -- do { -- if(!var4.hasNext()) { -- return null; -+ protected StructureStart func_143028_c(int par1, int par2, int par3) { -+ Iterator var4 = this.structureMap.values().iterator(); -+ -+ while (var4.hasNext()) { -+ StructureStart var5 = (StructureStart)var4.next(); -+ -+ if (var5.isSizeableStructure() && var5.getBoundingBox().intersectsWith(par1, par3, par1, par3)) { -+ Iterator var6 = var5.getComponents().iterator(); -+ -+ while (var6.hasNext()) { -+ StructureComponent var7 = (StructureComponent)var6.next(); -+ -+ if (var7.getBoundingBox().isVecInside(par1, par2, par3)) { -+ return var5; - } -- -- var5 = (StructureStart)var4.next(); -- } while(!var5.isSizeableStructure()); -- } while(!var5.getBoundingBox().intersectsWith(var1, var3, var1, var3)); -- -- Iterator var6 = var5.getComponents().iterator(); -- -- while(var6.hasNext()) { -- StructureComponent var7 = (StructureComponent)var6.next(); -- if(var7.getBoundingBox().isVecInside(var1, var2, var3)) { -- return var5; - } - } - } -+ -+ return null; - } - -- public boolean func_142038_b(int var1, int var2, int var3) { -+ public boolean func_142038_b(int par1, int par2, int par3) { - this.func_143027_a(this.worldObj); -- Iterator var4 = this.d.values().iterator(); -- -+ Iterator var4 = this.structureMap.values().iterator(); - StructureStart var5; -+ - do { -- if(!var4.hasNext()) { -+ if (!var4.hasNext()) { - return false; - } - - var5 = (StructureStart)var4.next(); -- } while(!var5.isSizeableStructure()); -+ } while (!var5.isSizeableStructure()); - -- return var5.getBoundingBox().intersectsWith(var1, var3, var1, var3); -+ return var5.getBoundingBox().intersectsWith(par1, par3, par1, par3); - } - -- public ChunkPosition getNearestInstance(World var1, int var2, int var3, int var4) { -- this.worldObj = var1; -- this.func_143027_a(var1); -- this.b.setSeed(var1.getSeed()); -- long var5 = this.b.nextLong(); -- long var7 = this.b.nextLong(); -- long var9 = (long)(var2 >> 4) * var5; -- long var11 = (long)(var4 >> 4) * var7; -- this.b.setSeed(var9 ^ var11 ^ var1.getSeed()); -- this.recursiveGenerate(var1, var2 >> 4, var4 >> 4, 0, 0, (byte[])null); -+ public ChunkPosition getNearestInstance(World par1World, int par2, int par3, int par4) { -+ this.worldObj = par1World; -+ this.func_143027_a(par1World); -+ this.rand.setSeed(par1World.getSeed()); -+ long var5 = this.rand.nextLong(); -+ long var7 = this.rand.nextLong(); -+ long var9 = (long)(par2 >> 4) * var5; -+ long var11 = (long)(par4 >> 4) * var7; -+ this.rand.setSeed(var9 ^ var11 ^ par1World.getSeed()); -+ this.recursiveGenerate(par1World, par2 >> 4, par4 >> 4, 0, 0, (byte[])null); - double var13 = Double.MAX_VALUE; - ChunkPosition var15 = null; -- Iterator var16 = this.d.values().iterator(); -- -+ Iterator var16 = this.structureMap.values().iterator(); - ChunkPosition var19; - int var20; - int var21; - int var22; - double var23; -- while(var16.hasNext()) { -+ -+ while (var16.hasNext()) { - StructureStart var17 = (StructureStart)var16.next(); -- if(var17.isSizeableStructure()) { -+ -+ if (var17.isSizeableStructure()) { - StructureComponent var18 = (StructureComponent)var17.getComponents().get(0); - var19 = var18.getCenter(); -- var20 = var19.x - var2; -- var21 = var19.y - var3; -- var22 = var19.z - var4; -+ var20 = var19.x - par2; -+ var21 = var19.y - par3; -+ var22 = var19.z - par4; - var23 = (double)(var20 * var20 + var21 * var21 + var22 * var22); -- if(var23 < var13) { -+ -+ if (var23 < var13) { - var13 = var23; - var15 = var19; - } - } - } - -- if(var15 != null) { -+ if (var15 != null) { - return var15; - } else { - List var25 = this.getCoordList(); -- if(var25 != null) { -+ -+ if (var25 != null) { - ChunkPosition var26 = null; - Iterator var27 = var25.iterator(); - -- while(var27.hasNext()) { -+ while (var27.hasNext()) { - var19 = (ChunkPosition)var27.next(); -- var20 = var19.x - var2; -- var21 = var19.y - var3; -- var22 = var19.z - var4; -+ var20 = var19.x - par2; -+ var21 = var19.y - par3; -+ var22 = var19.z - par4; - var23 = (double)(var20 * var20 + var21 * var21 + var22 * var22); -- if(var23 < var13) { -+ -+ if (var23 < var13) { - var13 = var23; - var26 = var19; - } -@@ -164,39 +180,45 @@ - } - } - -+ /** -+ * Returns a list of other locations at which the structure generation has been run, or null if not relevant to this -+ * structure generator. -+ */ - protected List getCoordList() { - return null; - } - -- private void func_143027_a(World var1) { -- if(this.field_143029_e == null) { -- this.field_143029_e = (MapGenStructureData)var1.loadItemData(MapGenStructureData.class, this.func_143025_a()); -- if(this.field_143029_e == null) { -+ private void func_143027_a(World par1World) { -+ if (this.field_143029_e == null) { -+ this.field_143029_e = (MapGenStructureData)par1World.loadItemData(MapGenStructureData.class, this.func_143025_a()); -+ -+ if (this.field_143029_e == null) { - this.field_143029_e = new MapGenStructureData(this.func_143025_a()); -- var1.setItemData(this.func_143025_a(), this.field_143029_e); -+ par1World.setItemData(this.func_143025_a(), this.field_143029_e); - } else { - NBTTagCompound var2 = this.field_143029_e.func_143041_a(); - Iterator var3 = var2.getTags().iterator(); - -- while(var3.hasNext()) { -+ while (var3.hasNext()) { - NBTBase var4 = (NBTBase)var3.next(); -- if(var4.getId() == 10) { -+ -+ if (var4.getId() == 10) { - NBTTagCompound var5 = (NBTTagCompound)var4; -- if(var5.hasKey("ChunkX") && var5.hasKey("ChunkZ")) { -+ -+ if (var5.hasKey("ChunkX") && var5.hasKey("ChunkZ")) { - int var6 = var5.getInteger("ChunkX"); - int var7 = var5.getInteger("ChunkZ"); -- StructureStart var8 = MapGenStructureIO.func_143035_a(var5, var1); -- this.d.put(Long.valueOf(ChunkCoordIntPair.chunkXZ2Int(var6, var7)), var8); -+ StructureStart var8 = MapGenStructureIO.func_143035_a(var5, par1World); -+ this.structureMap.put(Long.valueOf(ChunkCoordIntPair.chunkXZ2Int(var6, var7)), var8); - } - } - } - } - } -- - } - -- private void func_143026_a(int var1, int var2, StructureStart var3) { -- this.field_143029_e.func_143043_a(var3.func_143021_a(var1, var2), var1, var2); -+ private void func_143026_a(int par1, int par2, StructureStart par3StructureStart) { -+ this.field_143029_e.func_143043_a(par3StructureStart.func_143021_a(par1, par2), par1, par2); - this.field_143029_e.markDirty(); - } - ---- net/minecraft/src/EntityTNTPrimed.java -+++ net/minecraft/src/EntityTNTPrimed.java -@@ -1,65 +1,77 @@ - package net.minecraft.src; - - public class EntityTNTPrimed extends Entity { -+ -+ /** How long the fuse is */ - public int fuse; - private EntityLivingBase tntPlacedBy; - -- public EntityTNTPrimed(World var1) { -- super(var1); -+ public EntityTNTPrimed(World par1World) { -+ super(par1World); - this.preventEntitySpawning = true; - this.setSize(0.98F, 0.98F); - this.yOffset = this.height / 2.0F; - } - -- public EntityTNTPrimed(World var1, double var2, double var4, double var6, EntityLivingBase var8) { -- this(var1); -- this.setPosition(var2, var4, var6); -- float var9 = (float)(Math.random() * (double)((float)Math.PI) * 2.0D); -+ public EntityTNTPrimed(World par1World, double par2, double par4, double par6, EntityLivingBase par8EntityLivingBase) { -+ this(par1World); -+ this.setPosition(par2, par4, par6); -+ float var9 = (float)(Math.random() * Math.PI * 2.0D); - this.motionX = (double)(-((float)Math.sin((double)var9)) * 0.02F); -- this.motionY = (double)0.2F; -+ this.motionY = 0.20000000298023224D; - this.motionZ = (double)(-((float)Math.cos((double)var9)) * 0.02F); - this.fuse = 80; -- this.prevPosX = var2; -- this.prevPosY = var4; -- this.prevPosZ = var6; -- this.tntPlacedBy = var8; -- } -- -- protected void entityInit() { -- } -- -+ this.prevPosX = par2; -+ this.prevPosY = par4; -+ this.prevPosZ = par6; -+ this.tntPlacedBy = par8EntityLivingBase; -+ } -+ -+ protected void entityInit() {} -+ -+ /** -+ * returns if this entity triggers Block.onEntityWalking on the blocks they walk on. used for spiders and wolves to -+ * prevent them from trampling crops -+ */ - protected boolean canTriggerWalking() { - return false; - } - -+ /** -+ * Returns true if other Entities should be prevented from moving through this Entity. -+ */ - public boolean canBeCollidedWith() { - return !this.isDead; - } - -+ /** -+ * Called to update the entity's position/logic. -+ */ - public void onUpdate() { - this.prevPosX = this.posX; - this.prevPosY = this.posY; - this.prevPosZ = this.posZ; -- this.motionY -= (double)0.04F; -+ this.motionY -= 0.03999999910593033D; - this.moveEntity(this.motionX, this.motionY, this.motionZ); -- this.motionX *= (double)0.98F; -- this.motionY *= (double)0.98F; -- this.motionZ *= (double)0.98F; -- if(this.onGround) { -- this.motionX *= (double)0.7F; -- this.motionZ *= (double)0.7F; -+ this.motionX *= 0.9800000190734863D; -+ this.motionY *= 0.9800000190734863D; -+ this.motionZ *= 0.9800000190734863D; -+ -+ if (this.onGround) { -+ this.motionX *= 0.699999988079071D; -+ this.motionZ *= 0.699999988079071D; - this.motionY *= -0.5D; - } - -- if(this.fuse-- <= 0) { -+ if (this.fuse-- <= 0) { - this.setDead(); -- if(!this.worldObj.isRemote) { -+ -+ if (!this.worldObj.isRemote) { - this.explode(); - } - } else { - this.worldObj.spawnParticle("smoke", this.posX, this.posY + 0.5D, this.posZ, 0.0D, 0.0D, 0.0D); - } -- - } - - private void explode() { -@@ -67,18 +79,27 @@ - this.worldObj.createExplosion(this, this.posX, this.posY, this.posZ, var1, true); - } - -- protected void writeEntityToNBT(NBTTagCompound var1) { -- var1.setByte("Fuse", (byte)this.fuse); -+ /** -+ * (abstract) Protected helper method to write subclass entity data to NBT. -+ */ -+ protected void writeEntityToNBT(NBTTagCompound par1NBTTagCompound) { -+ par1NBTTagCompound.setByte("Fuse", (byte)this.fuse); - } - -- protected void readEntityFromNBT(NBTTagCompound var1) { -- this.fuse = var1.getByte("Fuse"); -+ /** -+ * (abstract) Protected helper method to read subclass entity data from NBT. -+ */ -+ protected void readEntityFromNBT(NBTTagCompound par1NBTTagCompound) { -+ this.fuse = par1NBTTagCompound.getByte("Fuse"); - } - - public float getShadowSize() { - return 0.0F; - } - -+ /** -+ * returns null or the entityliving it was placed or ignited by -+ */ - public EntityLivingBase getTntPlacedBy() { - return this.tntPlacedBy; - } ---- /dev/null -+++ org/spoutcraft/client/gui/server/ServerModel.java -@@ -1,0 +1,86 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.client.gui.server; -+ -+import java.util.ArrayList; -+import java.util.List; -+ -+import org.spoutcraft.api.gui.AbstractListModel; -+import org.spoutcraft.api.gui.ListWidgetItem; -+ -+public class ServerModel extends AbstractListModel { -+ protected List items = new ArrayList(); -+ protected GuiFavorites gui; -+ protected GuiStaticServerList servergui; -+ private boolean polling = false; -+ -+ @Override -+ public ListWidgetItem getItem(int row) { -+ if (row >= 0 && row < getSize()) { -+ return items.get(row); -+ } -+ return null; -+ } -+ -+ @Override -+ public int getSize() { -+ return items.size(); -+ } -+ -+ public void onSelected(int item, boolean doubleClick) { -+ if (gui != null) { -+ gui.updateButtons(); -+ } -+ if (servergui != null) { -+ servergui.updateButtons(); -+ } -+ } -+ -+ public synchronized boolean isPolling() { -+ return polling; -+ } -+ -+ public synchronized void setPolling(boolean poll) { -+ polling = poll; -+ if (gui != null) { -+ gui.updateButtons(); -+ } -+ -+ if (servergui != null) { -+ servergui.updateButtons(); -+ } -+ } -+ -+ public void setCurrentGUI(GuiFavorites gui) { -+ this.gui = gui; -+ } -+ -+ public GuiFavorites getCurrentGui() { -+ return gui; -+ } -+ -+ public void setStaticServerGUI(GuiStaticServerList gui) { -+ this.servergui = gui; -+ } -+ -+ public GuiStaticServerList getStaticServerGui() { -+ return servergui; -+ } -+} ---- /dev/null -+++ org/spoutcraft/client/gui/ClientTexture.java -@@ -1,0 +1,57 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.client.gui; -+ -+import org.lwjgl.opengl.GL11; -+import org.newdawn.slick.opengl.Texture; -+ -+import org.spoutcraft.api.Spoutcraft; -+import org.spoutcraft.api.gui.GenericTexture; -+import org.spoutcraft.client.io.CustomTextureManager; -+ -+public class ClientTexture extends GenericTexture { -+ public ClientTexture(String path) { -+ super(path); -+ } -+ -+ public ClientTexture() { -+ super(); -+ } -+ -+ @Override -+ public void render() { -+ GL11.glTranslatef(getX(), getY(), 0); -+ Texture t = CustomTextureManager.getTextureFromPath(getUrl()); -+ if (t != null) { -+ MCRenderDelegate d = (MCRenderDelegate) Spoutcraft.getRenderDelegate(); -+ d.drawTexture(t, (int) getWidth(), (int) getHeight(), isDrawingAlphaChannel()); -+ } -+ } -+ -+ @Override -+ public org.spoutcraft.api.gui.Texture setUrl(String url) { -+ Texture t = CustomTextureManager.getTextureFromPath(url); -+ if (t != null) { -+ setOriginalHeight(t.getImageHeight()); -+ setOriginalWidth(t.getImageWidth()); -+ } -+ return super.setUrl(url); -+ } -+} ---- /dev/null -+++ org/spoutcraft/client/packet/SpoutPacket.java -@@ -1,0 +1,71 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.client.packet; -+ -+import java.io.IOException; -+ -+import org.spoutcraft.api.io.SpoutInputStream; -+import org.spoutcraft.api.io.SpoutOutputStream; -+ -+public interface SpoutPacket { -+ /** -+ * Reads the data from an input stream into member variables. -+ * The number of bytes read must be equal to the result of {@link #getNumBytes()}. -+ * @param input stream to read from -+ * @throws IOException -+ */ -+ public void readData(SpoutInputStream input) throws IOException; -+ -+ /** -+ * Writes the data from the packet to the output stream, to be serialized and sent to a player. -+ * The number of bytes written must be equal to the result of {@link #getNumBytes()}. -+ * @param output stream to write to -+ * @throws IOException -+ */ -+ public void writeData(SpoutOutputStream output) throws IOException; -+ -+ /** -+ * Performs any tasks for the packet after data has been successfully read into the packet. -+ * @param playerId for the packet -+ */ -+ public void run(int playerId); -+ -+ /** -+ * Performs any tasks for the packet after the data has NOT been successfully read into the packet. -+ * All values will be at defaults (0, null, etc) and are unsafe. -+ * failure is run when the packet versions mismatch and data could not be safely read. It may not be called for all cases of failure. -+ * @param playerId -+ */ -+ public void failure(int playerId); -+ -+ /** -+ * The type of packet represented. Used to rebuild the correct packet on the client. -+ * @return packet type. -+ */ -+ public PacketType getPacketType(); -+ -+ /** -+ * Version of the packet this represents. Version numbers should start with 0. -+ * Versions should be incremented any time the member variables or serialization of the packet changes, to prevent crashing. -+ * Mismatched packet versions are discarded, and {@link #failure(int)} is called. -+ * @return -+ */ -+ public int getVersion(); -+} ---- net/minecraft/src/ComponentVillageHouse1.java -+++ net/minecraft/src/ComponentVillageHouse1.java -@@ -4,111 +4,119 @@ - import java.util.Random; - - public class ComponentVillageHouse1 extends ComponentVillage { -- public ComponentVillageHouse1() { -- } -- -- public ComponentVillageHouse1(ComponentVillageStartPiece var1, int var2, Random var3, StructureBoundingBox var4, int var5) { -- super(var1, var2); -- this.coordBaseMode = var5; -- this.boundingBox = var4; -- } -- -- public static ComponentVillageHouse1 func_74898_a(ComponentVillageStartPiece var0, List var1, Random var2, int var3, int var4, int var5, int var6, int var7) { -- StructureBoundingBox var8 = StructureBoundingBox.getComponentToAddBoundingBox(var3, var4, var5, 0, 0, 0, 9, 9, 6, var6); -- return canVillageGoDeeper(var8) && StructureComponent.findIntersecting(var1, var8) == null ? new ComponentVillageHouse1(var0, var7, var2, var8, var6) : null; -- } -- -- public boolean addComponentParts(World var1, Random var2, StructureBoundingBox var3) { -- if(this.field_143015_k < 0) { -- this.field_143015_k = this.getAverageGroundLevel(var1, var3); -- if(this.field_143015_k < 0) { -+ public ComponentVillageHouse1() {} -+ -+ public ComponentVillageHouse1(ComponentVillageStartPiece par1ComponentVillageStartPiece, int par2, Random par3Random, StructureBoundingBox par4StructureBoundingBox, int par5) { -+ super(par1ComponentVillageStartPiece, par2); -+ this.coordBaseMode = par5; -+ this.boundingBox = par4StructureBoundingBox; -+ } -+ -+ public static ComponentVillageHouse1 func_74898_a(ComponentVillageStartPiece par0ComponentVillageStartPiece, List par1List, Random par2Random, int par3, int par4, int par5, int par6, int par7) { -+ StructureBoundingBox var8 = StructureBoundingBox.getComponentToAddBoundingBox(par3, par4, par5, 0, 0, 0, 9, 9, 6, par6); -+ return canVillageGoDeeper(var8) && StructureComponent.findIntersecting(par1List, var8) == null ? new ComponentVillageHouse1(par0ComponentVillageStartPiece, par7, par2Random, var8, par6) : null; -+ } -+ -+ /** -+ * second Part of Structure generating, this for example places Spiderwebs, Mob Spawners, it closes Mineshafts at the -+ * end, it adds Fences... -+ */ -+ public boolean addComponentParts(World par1World, Random par2Random, StructureBoundingBox par3StructureBoundingBox) { -+ if (this.field_143015_k < 0) { -+ this.field_143015_k = this.getAverageGroundLevel(par1World, par3StructureBoundingBox); -+ -+ if (this.field_143015_k < 0) { - return true; - } - - this.boundingBox.offset(0, this.field_143015_k - this.boundingBox.maxY + 9 - 1, 0); - } - -- this.fillWithBlocks(var1, var3, 1, 1, 1, 7, 5, 4, 0, 0, false); -- this.fillWithBlocks(var1, var3, 0, 0, 0, 8, 0, 5, Block.cobblestone.blockID, Block.cobblestone.blockID, false); -- this.fillWithBlocks(var1, var3, 0, 5, 0, 8, 5, 5, Block.cobblestone.blockID, Block.cobblestone.blockID, false); -- this.fillWithBlocks(var1, var3, 0, 6, 1, 8, 6, 4, Block.cobblestone.blockID, Block.cobblestone.blockID, false); -- this.fillWithBlocks(var1, var3, 0, 7, 2, 8, 7, 3, Block.cobblestone.blockID, Block.cobblestone.blockID, false); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 1, 1, 1, 7, 5, 4, 0, 0, false); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 0, 0, 0, 8, 0, 5, Block.cobblestone.blockID, Block.cobblestone.blockID, false); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 0, 5, 0, 8, 5, 5, Block.cobblestone.blockID, Block.cobblestone.blockID, false); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 0, 6, 1, 8, 6, 4, Block.cobblestone.blockID, Block.cobblestone.blockID, false); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 0, 7, 2, 8, 7, 3, Block.cobblestone.blockID, Block.cobblestone.blockID, false); - int var4 = this.getMetadataWithOffset(Block.stairsWoodOak.blockID, 3); - int var5 = this.getMetadataWithOffset(Block.stairsWoodOak.blockID, 2); -- - int var6; - int var7; -- for(var6 = -1; var6 <= 2; ++var6) { -- for(var7 = 0; var7 <= 8; ++var7) { -- this.placeBlockAtCurrentPosition(var1, Block.stairsWoodOak.blockID, var4, var7, 6 + var6, var6, var3); -- this.placeBlockAtCurrentPosition(var1, Block.stairsWoodOak.blockID, var5, var7, 6 + var6, 5 - var6, var3); -+ -+ for (var6 = -1; var6 <= 2; ++var6) { -+ for (var7 = 0; var7 <= 8; ++var7) { -+ this.placeBlockAtCurrentPosition(par1World, Block.stairsWoodOak.blockID, var4, var7, 6 + var6, var6, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.stairsWoodOak.blockID, var5, var7, 6 + var6, 5 - var6, par3StructureBoundingBox); - } - } - -- this.fillWithBlocks(var1, var3, 0, 1, 0, 0, 1, 5, Block.cobblestone.blockID, Block.cobblestone.blockID, false); -- this.fillWithBlocks(var1, var3, 1, 1, 5, 8, 1, 5, Block.cobblestone.blockID, Block.cobblestone.blockID, false); -- this.fillWithBlocks(var1, var3, 8, 1, 0, 8, 1, 4, Block.cobblestone.blockID, Block.cobblestone.blockID, false); -- this.fillWithBlocks(var1, var3, 2, 1, 0, 7, 1, 0, Block.cobblestone.blockID, Block.cobblestone.blockID, false); -- this.fillWithBlocks(var1, var3, 0, 2, 0, 0, 4, 0, Block.cobblestone.blockID, Block.cobblestone.blockID, false); -- this.fillWithBlocks(var1, var3, 0, 2, 5, 0, 4, 5, Block.cobblestone.blockID, Block.cobblestone.blockID, false); -- this.fillWithBlocks(var1, var3, 8, 2, 5, 8, 4, 5, Block.cobblestone.blockID, Block.cobblestone.blockID, false); -- this.fillWithBlocks(var1, var3, 8, 2, 0, 8, 4, 0, Block.cobblestone.blockID, Block.cobblestone.blockID, false); -- this.fillWithBlocks(var1, var3, 0, 2, 1, 0, 4, 4, Block.planks.blockID, Block.planks.blockID, false); -- this.fillWithBlocks(var1, var3, 1, 2, 5, 7, 4, 5, Block.planks.blockID, Block.planks.blockID, false); -- this.fillWithBlocks(var1, var3, 8, 2, 1, 8, 4, 4, Block.planks.blockID, Block.planks.blockID, false); -- this.fillWithBlocks(var1, var3, 1, 2, 0, 7, 4, 0, Block.planks.blockID, Block.planks.blockID, false); -- this.placeBlockAtCurrentPosition(var1, Block.thinGlass.blockID, 0, 4, 2, 0, var3); -- this.placeBlockAtCurrentPosition(var1, Block.thinGlass.blockID, 0, 5, 2, 0, var3); -- this.placeBlockAtCurrentPosition(var1, Block.thinGlass.blockID, 0, 6, 2, 0, var3); -- this.placeBlockAtCurrentPosition(var1, Block.thinGlass.blockID, 0, 4, 3, 0, var3); -- this.placeBlockAtCurrentPosition(var1, Block.thinGlass.blockID, 0, 5, 3, 0, var3); -- this.placeBlockAtCurrentPosition(var1, Block.thinGlass.blockID, 0, 6, 3, 0, var3); -- this.placeBlockAtCurrentPosition(var1, Block.thinGlass.blockID, 0, 0, 2, 2, var3); -- this.placeBlockAtCurrentPosition(var1, Block.thinGlass.blockID, 0, 0, 2, 3, var3); -- this.placeBlockAtCurrentPosition(var1, Block.thinGlass.blockID, 0, 0, 3, 2, var3); -- this.placeBlockAtCurrentPosition(var1, Block.thinGlass.blockID, 0, 0, 3, 3, var3); -- this.placeBlockAtCurrentPosition(var1, Block.thinGlass.blockID, 0, 8, 2, 2, var3); -- this.placeBlockAtCurrentPosition(var1, Block.thinGlass.blockID, 0, 8, 2, 3, var3); -- this.placeBlockAtCurrentPosition(var1, Block.thinGlass.blockID, 0, 8, 3, 2, var3); -- this.placeBlockAtCurrentPosition(var1, Block.thinGlass.blockID, 0, 8, 3, 3, var3); -- this.placeBlockAtCurrentPosition(var1, Block.thinGlass.blockID, 0, 2, 2, 5, var3); -- this.placeBlockAtCurrentPosition(var1, Block.thinGlass.blockID, 0, 3, 2, 5, var3); -- this.placeBlockAtCurrentPosition(var1, Block.thinGlass.blockID, 0, 5, 2, 5, var3); -- this.placeBlockAtCurrentPosition(var1, Block.thinGlass.blockID, 0, 6, 2, 5, var3); -- this.fillWithBlocks(var1, var3, 1, 4, 1, 7, 4, 1, Block.planks.blockID, Block.planks.blockID, false); -- this.fillWithBlocks(var1, var3, 1, 4, 4, 7, 4, 4, Block.planks.blockID, Block.planks.blockID, false); -- this.fillWithBlocks(var1, var3, 1, 3, 4, 7, 3, 4, Block.bookShelf.blockID, Block.bookShelf.blockID, false); -- this.placeBlockAtCurrentPosition(var1, Block.planks.blockID, 0, 7, 1, 4, var3); -- this.placeBlockAtCurrentPosition(var1, Block.stairsWoodOak.blockID, this.getMetadataWithOffset(Block.stairsWoodOak.blockID, 0), 7, 1, 3, var3); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 0, 1, 0, 0, 1, 5, Block.cobblestone.blockID, Block.cobblestone.blockID, false); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 1, 1, 5, 8, 1, 5, Block.cobblestone.blockID, Block.cobblestone.blockID, false); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 8, 1, 0, 8, 1, 4, Block.cobblestone.blockID, Block.cobblestone.blockID, false); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 2, 1, 0, 7, 1, 0, Block.cobblestone.blockID, Block.cobblestone.blockID, false); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 0, 2, 0, 0, 4, 0, Block.cobblestone.blockID, Block.cobblestone.blockID, false); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 0, 2, 5, 0, 4, 5, Block.cobblestone.blockID, Block.cobblestone.blockID, false); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 8, 2, 5, 8, 4, 5, Block.cobblestone.blockID, Block.cobblestone.blockID, false); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 8, 2, 0, 8, 4, 0, Block.cobblestone.blockID, Block.cobblestone.blockID, false); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 0, 2, 1, 0, 4, 4, Block.planks.blockID, Block.planks.blockID, false); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 1, 2, 5, 7, 4, 5, Block.planks.blockID, Block.planks.blockID, false); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 8, 2, 1, 8, 4, 4, Block.planks.blockID, Block.planks.blockID, false); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 1, 2, 0, 7, 4, 0, Block.planks.blockID, Block.planks.blockID, false); -+ this.placeBlockAtCurrentPosition(par1World, Block.thinGlass.blockID, 0, 4, 2, 0, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.thinGlass.blockID, 0, 5, 2, 0, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.thinGlass.blockID, 0, 6, 2, 0, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.thinGlass.blockID, 0, 4, 3, 0, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.thinGlass.blockID, 0, 5, 3, 0, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.thinGlass.blockID, 0, 6, 3, 0, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.thinGlass.blockID, 0, 0, 2, 2, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.thinGlass.blockID, 0, 0, 2, 3, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.thinGlass.blockID, 0, 0, 3, 2, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.thinGlass.blockID, 0, 0, 3, 3, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.thinGlass.blockID, 0, 8, 2, 2, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.thinGlass.blockID, 0, 8, 2, 3, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.thinGlass.blockID, 0, 8, 3, 2, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.thinGlass.blockID, 0, 8, 3, 3, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.thinGlass.blockID, 0, 2, 2, 5, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.thinGlass.blockID, 0, 3, 2, 5, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.thinGlass.blockID, 0, 5, 2, 5, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.thinGlass.blockID, 0, 6, 2, 5, par3StructureBoundingBox); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 1, 4, 1, 7, 4, 1, Block.planks.blockID, Block.planks.blockID, false); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 1, 4, 4, 7, 4, 4, Block.planks.blockID, Block.planks.blockID, false); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 1, 3, 4, 7, 3, 4, Block.bookShelf.blockID, Block.bookShelf.blockID, false); -+ this.placeBlockAtCurrentPosition(par1World, Block.planks.blockID, 0, 7, 1, 4, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.stairsWoodOak.blockID, this.getMetadataWithOffset(Block.stairsWoodOak.blockID, 0), 7, 1, 3, par3StructureBoundingBox); - var6 = this.getMetadataWithOffset(Block.stairsWoodOak.blockID, 3); -- this.placeBlockAtCurrentPosition(var1, Block.stairsWoodOak.blockID, var6, 6, 1, 4, var3); -- this.placeBlockAtCurrentPosition(var1, Block.stairsWoodOak.blockID, var6, 5, 1, 4, var3); -- this.placeBlockAtCurrentPosition(var1, Block.stairsWoodOak.blockID, var6, 4, 1, 4, var3); -- this.placeBlockAtCurrentPosition(var1, Block.stairsWoodOak.blockID, var6, 3, 1, 4, var3); -- this.placeBlockAtCurrentPosition(var1, Block.fence.blockID, 0, 6, 1, 3, var3); -- this.placeBlockAtCurrentPosition(var1, Block.pressurePlatePlanks.blockID, 0, 6, 2, 3, var3); -- this.placeBlockAtCurrentPosition(var1, Block.fence.blockID, 0, 4, 1, 3, var3); -- this.placeBlockAtCurrentPosition(var1, Block.pressurePlatePlanks.blockID, 0, 4, 2, 3, var3); -- this.placeBlockAtCurrentPosition(var1, Block.workbench.blockID, 0, 7, 1, 1, var3); -- this.placeBlockAtCurrentPosition(var1, 0, 0, 1, 1, 0, var3); -- this.placeBlockAtCurrentPosition(var1, 0, 0, 1, 2, 0, var3); -- this.placeDoorAtCurrentPosition(var1, var3, var2, 1, 1, 0, this.getMetadataWithOffset(Block.doorWood.blockID, 1)); -- if(this.getBlockIdAtCurrentPosition(var1, 1, 0, -1, var3) == 0 && this.getBlockIdAtCurrentPosition(var1, 1, -1, -1, var3) != 0) { -- this.placeBlockAtCurrentPosition(var1, Block.stairsCobblestone.blockID, this.getMetadataWithOffset(Block.stairsCobblestone.blockID, 3), 1, 0, -1, var3); -+ this.placeBlockAtCurrentPosition(par1World, Block.stairsWoodOak.blockID, var6, 6, 1, 4, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.stairsWoodOak.blockID, var6, 5, 1, 4, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.stairsWoodOak.blockID, var6, 4, 1, 4, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.stairsWoodOak.blockID, var6, 3, 1, 4, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.fence.blockID, 0, 6, 1, 3, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.pressurePlatePlanks.blockID, 0, 6, 2, 3, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.fence.blockID, 0, 4, 1, 3, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.pressurePlatePlanks.blockID, 0, 4, 2, 3, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.workbench.blockID, 0, 7, 1, 1, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, 0, 0, 1, 1, 0, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, 0, 0, 1, 2, 0, par3StructureBoundingBox); -+ this.placeDoorAtCurrentPosition(par1World, par3StructureBoundingBox, par2Random, 1, 1, 0, this.getMetadataWithOffset(Block.doorWood.blockID, 1)); -+ -+ if (this.getBlockIdAtCurrentPosition(par1World, 1, 0, -1, par3StructureBoundingBox) == 0 && this.getBlockIdAtCurrentPosition(par1World, 1, -1, -1, par3StructureBoundingBox) != 0) { -+ this.placeBlockAtCurrentPosition(par1World, Block.stairsCobblestone.blockID, this.getMetadataWithOffset(Block.stairsCobblestone.blockID, 3), 1, 0, -1, par3StructureBoundingBox); - } - -- for(var7 = 0; var7 < 6; ++var7) { -- for(int var8 = 0; var8 < 9; ++var8) { -- this.clearCurrentPositionBlocksUpwards(var1, var8, 9, var7, var3); -- this.fillCurrentPositionBlocksDownwards(var1, Block.cobblestone.blockID, 0, var8, -1, var7, var3); -+ for (var7 = 0; var7 < 6; ++var7) { -+ for (int var8 = 0; var8 < 9; ++var8) { -+ this.clearCurrentPositionBlocksUpwards(par1World, var8, 9, var7, par3StructureBoundingBox); -+ this.fillCurrentPositionBlocksDownwards(par1World, Block.cobblestone.blockID, 0, var8, -1, var7, par3StructureBoundingBox); - } - } - -- this.spawnVillagers(var1, var3, 2, 1, 2, 1); -+ this.spawnVillagers(par1World, par3StructureBoundingBox, 2, 1, 2, 1); - return true; - } - -- protected int getVillagerType(int var1) { -+ /** -+ * Returns the villager type to spawn in this component, based on the number of villagers already spawned. -+ */ -+ protected int getVillagerType(int par1) { - return 1; - } - } ---- /dev/null -+++ org/spoutcraft/client/packet/PacketSkinURL.java -@@ -1,0 +1,114 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.client.packet; -+ -+import java.io.IOException; -+ -+import net.minecraft.src.AbstractClientPlayer; -+ -+import org.spoutcraft.api.io.SpoutInputStream; -+import org.spoutcraft.api.io.SpoutOutputStream; -+import org.spoutcraft.client.SpoutClient; -+ -+public class PacketSkinURL implements SpoutPacket { -+ public int entityId; -+ public String skinURL; -+ public String cloakURL; -+ public boolean release = true; -+ public PacketSkinURL() { -+ } -+ -+ public PacketSkinURL(int id, String skinURL, String cloakURL) { -+ this.entityId = id; -+ this.skinURL = skinURL; -+ this.cloakURL = cloakURL; -+ release = false; -+ } -+ -+ public PacketSkinURL(int id, String skinURL) { -+ this.entityId = id; -+ this.skinURL = skinURL; -+ this.cloakURL = "none"; -+ } -+ -+ public PacketSkinURL(String cloakURL, int id) { -+ this.entityId = id; -+ this.skinURL = "none"; -+ this.cloakURL = cloakURL; -+ } -+ -+ public void readData(SpoutInputStream input) throws IOException { -+ entityId = input.readInt(); -+ skinURL = input.readString(); -+ cloakURL = input.readString(); -+ release = input.readBoolean(); -+ } -+ -+ public void writeData(SpoutOutputStream output) throws IOException { -+ output.writeInt(entityId); -+ output.writeString(skinURL); -+ output.writeString(cloakURL); -+ output.writeBoolean(release); -+ } -+ -+ public void run(int PlayerId) { -+ AbstractClientPlayer e = SpoutClient.getInstance().getAbstractPlayerFromId(entityId); -+ if (e != null) { -+ // Check if these are the Minecraft skin/cape, if so, use defaults instead -+ String mcSkin = "http://s3.amazonaws.com/MinecraftSkins/" + e.username + ".png"; -+ String mcCape = "http://s3.amazonaws.com/MinecraftCloaks/" + e.username + ".png"; -+ if (!"none".equals(this.skinURL)) { -+ //System.out.println(e.username + " is going to be sent skinURL: " + skinURL + " from SpoutPlugin's API."); -+ } -+ if (this.skinURL.equalsIgnoreCase(mcSkin)) { -+ this.skinURL = "http://skins.minecraft.net/MinecraftSkins/" + e.username + ".png"; -+ } -+ if (this.cloakURL.equalsIgnoreCase(mcCape)) { -+ if (e.vip != null && e.vip.getCape() != null) { -+ this.cloakURL = e.vip.getCape(); -+ } else { -+ this.cloakURL = "http://skins.minecraft.net/MinecraftCloaks/" + e.username + ".png"; -+ } -+ } -+ -+ if (!"none".equals(this.skinURL)) { -+ e.customSkinUrl = this.skinURL; -+ e.forceUpdate = true; -+ } -+ if (!"none".equals(this.cloakURL)) { -+ e.customCapeUrl = this.cloakURL; -+ } -+ -+ e.setupCustomSkin(); -+ -+ } -+ } -+ -+ public PacketType getPacketType() { -+ return PacketType.PacketSkinURL; -+ } -+ -+ public int getVersion() { -+ return 1; -+ } -+ -+ public void failure(int playerId) { -+ } -+} ---- net/minecraft/src/ComponentNetherBridgeStartPiece.java -+++ net/minecraft/src/ComponentNetherBridgeStartPiece.java -@@ -5,45 +5,53 @@ - import java.util.Random; - - public class ComponentNetherBridgeStartPiece extends ComponentNetherBridgeCrossing3 { -+ -+ /** Instance of StructureNetherBridgePieceWeight. */ - public StructureNetherBridgePieceWeight theNetherBridgePieceWeight; -- public List c; -- public List d; -- public ArrayList e = new ArrayList(); -- -- public ComponentNetherBridgeStartPiece() { -- } -- -- public ComponentNetherBridgeStartPiece(Random var1, int var2, int var3) { -- super(var1, var2, var3); -- this.c = new ArrayList(); -+ -+ /** -+ * Contains the list of valid piece weights for the set of nether bridge structure pieces. -+ */ -+ public List primaryWeights; -+ -+ /** -+ * Contains the list of valid piece weights for the secondary set of nether bridge structure pieces. -+ */ -+ public List secondaryWeights; -+ public ArrayList field_74967_d = new ArrayList(); -+ -+ public ComponentNetherBridgeStartPiece() {} -+ -+ public ComponentNetherBridgeStartPiece(Random par1Random, int par2, int par3) { -+ super(par1Random, par2, par3); -+ this.primaryWeights = new ArrayList(); - StructureNetherBridgePieceWeight[] var4 = StructureNetherBridgePieces.getPrimaryComponents(); - int var5 = var4.length; -- - int var6; - StructureNetherBridgePieceWeight var7; -- for(var6 = 0; var6 < var5; ++var6) { -+ -+ for (var6 = 0; var6 < var5; ++var6) { - var7 = var4[var6]; - var7.field_78827_c = 0; -- this.c.add(var7); -+ this.primaryWeights.add(var7); - } - -- this.d = new ArrayList(); -+ this.secondaryWeights = new ArrayList(); - var4 = StructureNetherBridgePieces.getSecondaryComponents(); - var5 = var4.length; - -- for(var6 = 0; var6 < var5; ++var6) { -+ for (var6 = 0; var6 < var5; ++var6) { - var7 = var4[var6]; - var7.field_78827_c = 0; -- this.d.add(var7); -+ this.secondaryWeights.add(var7); - } -- -- } -- -- protected void func_143011_b(NBTTagCompound var1) { -- super.func_143011_b(var1); -- } -- -- protected void func_143012_a(NBTTagCompound var1) { -- super.func_143012_a(var1); -+ } -+ -+ protected void func_143011_b(NBTTagCompound par1NBTTagCompound) { -+ super.func_143011_b(par1NBTTagCompound); -+ } -+ -+ protected void func_143012_a(NBTTagCompound par1NBTTagCompound) { -+ super.func_143012_a(par1NBTTagCompound); - } - } ---- net/minecraft/src/EntityAIBreakDoor.java -+++ net/minecraft/src/EntityAIBreakDoor.java -@@ -4,47 +4,63 @@ - private int breakingTime; - private int field_75358_j = -1; - -- public EntityAIBreakDoor(EntityLiving var1) { -- super(var1); -+ public EntityAIBreakDoor(EntityLiving par1EntityLiving) { -+ super(par1EntityLiving); - } - -+ /** -+ * Returns whether the EntityAIBase should begin execution. -+ */ - public boolean shouldExecute() { - return !super.shouldExecute() ? false : (!this.theEntity.worldObj.getGameRules().getGameRuleBooleanValue("mobGriefing") ? false : !this.targetDoor.isDoorOpen(this.theEntity.worldObj, this.entityPosX, this.entityPosY, this.entityPosZ)); - } - -+ /** -+ * Execute a one shot task or start executing a continuous task -+ */ - public void startExecuting() { - super.startExecuting(); - this.breakingTime = 0; - } - -+ /** -+ * Returns whether an in-progress EntityAIBase should continue executing -+ */ - public boolean continueExecuting() { - double var1 = this.theEntity.getDistanceSq((double)this.entityPosX, (double)this.entityPosY, (double)this.entityPosZ); - return this.breakingTime <= 240 && !this.targetDoor.isDoorOpen(this.theEntity.worldObj, this.entityPosX, this.entityPosY, this.entityPosZ) && var1 < 4.0D; - } - -+ /** -+ * Resets the task -+ */ - public void resetTask() { - super.resetTask(); - this.theEntity.worldObj.destroyBlockInWorldPartially(this.theEntity.entityId, this.entityPosX, this.entityPosY, this.entityPosZ, -1); - } - -+ /** -+ * Updates the task -+ */ - public void updateTask() { - super.updateTask(); -- if(this.theEntity.getRNG().nextInt(20) == 0) { -+ -+ if (this.theEntity.getRNG().nextInt(20) == 0) { - this.theEntity.worldObj.playAuxSFX(1010, this.entityPosX, this.entityPosY, this.entityPosZ, 0); - } - - ++this.breakingTime; - int var1 = (int)((float)this.breakingTime / 240.0F * 10.0F); -- if(var1 != this.field_75358_j) { -+ -+ if (var1 != this.field_75358_j) { - this.theEntity.worldObj.destroyBlockInWorldPartially(this.theEntity.entityId, this.entityPosX, this.entityPosY, this.entityPosZ, var1); - this.field_75358_j = var1; - } - -- if(this.breakingTime == 240 && this.theEntity.worldObj.difficultySetting == 3) { -+ if (this.breakingTime == 240 && this.theEntity.worldObj.difficultySetting == 3) { - this.theEntity.worldObj.setBlockToAir(this.entityPosX, this.entityPosY, this.entityPosZ); - this.theEntity.worldObj.playAuxSFX(1012, this.entityPosX, this.entityPosY, this.entityPosZ, 0); - this.theEntity.worldObj.playAuxSFX(2001, this.entityPosX, this.entityPosY, this.entityPosZ, this.targetDoor.blockID); - } -- - } - } ---- net/minecraft/src/Packet205ClientCommand.java -+++ net/minecraft/src/Packet205ClientCommand.java -@@ -5,27 +5,42 @@ - import java.io.IOException; - - public class Packet205ClientCommand extends Packet { -+ -+ /** -+ * 0 sent to a netLoginHandler starts the server, 1 sent to NetServerHandler forces a respawn -+ */ - public int forceRespawn; - -- public Packet205ClientCommand() { -- } -- -- public Packet205ClientCommand(int var1) { -- this.forceRespawn = var1; -- } -- -- public void readPacketData(DataInput var1) throws IOException { -- this.forceRespawn = var1.readByte(); -- } -- -- public void writePacketData(DataOutput var1) throws IOException { -- var1.writeByte(this.forceRespawn & 255); -- } -- -- public void processPacket(NetHandler var1) { -- var1.handleClientCommand(this); -- } -- -+ public Packet205ClientCommand() {} -+ -+ public Packet205ClientCommand(int par1) { -+ this.forceRespawn = par1; -+ } -+ -+ /** -+ * Abstract. Reads the raw packet data from the data stream. -+ */ -+ public void readPacketData(DataInput par1DataInput) throws IOException { -+ this.forceRespawn = par1DataInput.readByte(); -+ } -+ -+ /** -+ * Abstract. Writes the raw packet data to the data stream. -+ */ -+ public void writePacketData(DataOutput par1DataOutput) throws IOException { -+ par1DataOutput.writeByte(this.forceRespawn & 255); -+ } -+ -+ /** -+ * Passes this Packet on to the NetHandler for processing. -+ */ -+ public void processPacket(NetHandler par1NetHandler) { -+ par1NetHandler.handleClientCommand(this); -+ } -+ -+ /** -+ * Abstract. Return the size of the packet (not counting the header). -+ */ - public int getPacketSize() { - return 1; - } ---- net/minecraft/src/ItemSaddle.java -+++ net/minecraft/src/ItemSaddle.java -@@ -1,18 +1,22 @@ - package net.minecraft.src; - - public class ItemSaddle extends Item { -- public ItemSaddle(int var1) { -- super(var1); -+ public ItemSaddle(int par1) { -+ super(par1); - this.maxStackSize = 1; - this.setCreativeTab(CreativeTabs.tabTransport); - } - -- public boolean itemInteractionForEntity(ItemStack var1, EntityPlayer var2, EntityLivingBase var3) { -- if(var3 instanceof EntityPig) { -- EntityPig var4 = (EntityPig)var3; -- if(!var4.getSaddled() && !var4.isChild()) { -+ /** -+ * Returns true if the item can be used on the given entity, e.g. shears on sheep. -+ */ -+ public boolean itemInteractionForEntity(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, EntityLivingBase par3EntityLivingBase) { -+ if (par3EntityLivingBase instanceof EntityPig) { -+ EntityPig var4 = (EntityPig)par3EntityLivingBase; -+ -+ if (!var4.getSaddled() && !var4.isChild()) { - var4.setSaddled(true); -- --var1.stackSize; -+ --par1ItemStack.stackSize; - } - - return true; -@@ -21,8 +25,12 @@ - } - } - -- public boolean hitEntity(ItemStack var1, EntityLivingBase var2, EntityLivingBase var3) { -- this.itemInteractionForEntity(var1, (EntityPlayer)null, var2); -+ /** -+ * Current implementations of this method in child classes do not use the entry argument beside ev. They just raise the -+ * damage on the stack. -+ */ -+ public boolean hitEntity(ItemStack par1ItemStack, EntityLivingBase par2EntityLivingBase, EntityLivingBase par3EntityLivingBase) { -+ this.itemInteractionForEntity(par1ItemStack, (EntityPlayer)null, par2EntityLivingBase); - return true; - } - } ---- net/minecraft/src/SaveFormatComparator.java -+++ net/minecraft/src/SaveFormatComparator.java -@@ -1,32 +1,44 @@ - package net.minecraft.src; - - public class SaveFormatComparator implements Comparable { -- private final String a; -- private final String b; -+ -+ /** the file name of this save */ -+ private final String fileName; -+ -+ /** the displayed name of this save file */ -+ private final String displayName; - private final long lastTimePlayed; - private final long sizeOnDisk; - private final boolean requiresConversion; -+ -+ /** Instance of EnumGameType. */ - private final EnumGameType theEnumGameType; - private final boolean hardcore; - private final boolean cheatsEnabled; - -- public SaveFormatComparator(String var1, String var2, long var3, long var5, EnumGameType var7, boolean var8, boolean var9, boolean var10) { -- this.a = var1; -- this.b = var2; -- this.lastTimePlayed = var3; -- this.sizeOnDisk = var5; -- this.theEnumGameType = var7; -- this.requiresConversion = var8; -- this.hardcore = var9; -- this.cheatsEnabled = var10; -+ public SaveFormatComparator(String par1Str, String par2Str, long par3, long par5, EnumGameType par7EnumGameType, boolean par8, boolean par9, boolean par10) { -+ this.fileName = par1Str; -+ this.displayName = par2Str; -+ this.lastTimePlayed = par3; -+ this.sizeOnDisk = par5; -+ this.theEnumGameType = par7EnumGameType; -+ this.requiresConversion = par8; -+ this.hardcore = par9; -+ this.cheatsEnabled = par10; - } - -+ /** -+ * return the file name -+ */ - public String getFileName() { -- return this.a; -+ return this.fileName; - } - -+ /** -+ * return the display name of the save -+ */ - public String getDisplayName() { -- return this.b; -+ return this.displayName; - } - - public boolean requiresConversion() { -@@ -37,10 +49,13 @@ - return this.lastTimePlayed; - } - -- public int compareTo(SaveFormatComparator var1) { -- return this.lastTimePlayed < var1.lastTimePlayed ? 1 : (this.lastTimePlayed > var1.lastTimePlayed ? -1 : this.a.compareTo(var1.a)); -+ public int compareTo(SaveFormatComparator par1SaveFormatComparator) { -+ return this.lastTimePlayed < par1SaveFormatComparator.lastTimePlayed ? 1 : (this.lastTimePlayed > par1SaveFormatComparator.lastTimePlayed ? -1 : this.fileName.compareTo(par1SaveFormatComparator.fileName)); - } - -+ /** -+ * Gets the EnumGameType. -+ */ - public EnumGameType getEnumGameType() { - return this.theEnumGameType; - } -@@ -49,11 +64,14 @@ - return this.hardcore; - } - -+ /** -+ * @return {@code true} if cheats are enabled for this world -+ */ - public boolean getCheatsEnabled() { - return this.cheatsEnabled; - } - -- public int compareTo(Object var1) { -- return this.compareTo((SaveFormatComparator)var1); -+ public int compareTo(Object par1Obj) { -+ return this.compareTo((SaveFormatComparator)par1Obj); - } - } ---- net/minecraft/src/ICommand.java -+++ net/minecraft/src/ICommand.java -@@ -11,9 +11,18 @@ - - void processCommand(ICommandSender var1, String[] var2); - -+ /** -+ * Returns true if the given command sender is allowed to use this command. -+ */ - boolean canCommandSenderUseCommand(ICommandSender var1); - -+ /** -+ * Adds the strings available in this command to the given list of tab completion options. -+ */ - List addTabCompletionOptions(ICommandSender var1, String[] var2); - -+ /** -+ * Return whether the specified command parameter index is a username parameter. -+ */ - boolean isUsernameIndex(String[] var1, int var2); - } ---- net/minecraft/src/MetadataSectionSerializer.java -+++ net/minecraft/src/MetadataSectionSerializer.java -@@ -3,5 +3,9 @@ - import com.google.gson.JsonDeserializer; - - public interface MetadataSectionSerializer extends JsonDeserializer { -+ -+ /** -+ * The name of this section type as it appears in JSON. -+ */ - String getSectionName(); - } ---- net/minecraft/src/AbstractClientPlayer.java -+++ net/minecraft/src/AbstractClientPlayer.java -@@ -1,24 +1,38 @@ - package net.minecraft.src; - -+import net.minecraft.src.Minecraft; -+import net.minecraft.src.StringUtils; -+ -+import org.bukkit.ChatColor; -+import org.spoutcraft.client.SpoutClient; -+import org.spoutcraft.client.config.Configuration; -+import org.spoutcraft.client.special.Holiday; -+import org.spoutcraft.client.special.Resources; -+import org.spoutcraft.client.special.VIP; -+ - public abstract class AbstractClientPlayer extends EntityPlayer { - public static final ResourceLocation locationStevePng = new ResourceLocation("textures/entity/steve.png"); - private ThreadDownloadImageData downloadImageSkin; - private ThreadDownloadImageData downloadImageCape; - private ResourceLocation locationSkin; - private ResourceLocation locationCape; -- -- public AbstractClientPlayer(World var1, String var2) { -- super(var1, var2); -+ public String customCapeUrl; -+ public String customSkinUrl; -+ public static boolean forceUpdate = false; -+ -+ public AbstractClientPlayer(World par1World, String par2Str) { -+ super(par1World, par2Str); - this.setupCustomSkin(); - } - -- protected void setupCustomSkin() { -- System.out.println("Setting up custom skins"); -- if(this.bu != null && !this.bu.isEmpty()) { -- this.locationSkin = getLocationSkin(this.bu); -- this.locationCape = getLocationCape(this.bu); -- this.downloadImageSkin = getDownloadImageSkin(this.locationSkin, this.bu); -- this.downloadImageCape = getDownloadImageCape(this.locationCape, this.bu); -+ public void setupCustomSkin() { -+ if (this.username != null && !this.username.isEmpty()) { -+ this.locationSkin = getLocationSkin(this.username); -+ this.locationCape = getLocationCape(this.username); -+ forceUpdate = true; -+ this.downloadImageSkin = getDownloadImageSkin(this.locationSkin, this.username, this.customSkinUrl); -+ forceUpdate = true; -+ this.downloadImageCape = getDownloadImageCape(this.locationCape, this.username, this.customCapeUrl); - } - } - -@@ -37,43 +51,74 @@ - public ResourceLocation getLocationCape() { - return this.locationCape; - } -- -- public static ThreadDownloadImageData getDownloadImageSkin(ResourceLocation var0, String var1) { -- return getDownloadImage(var0, getSkinUrl(var1), locationStevePng, new ImageBufferDownload()); -- } -- -- public static ThreadDownloadImageData getDownloadImageCape(ResourceLocation var0, String var1) { -- return getDownloadImage(var0, getCapeUrl(var1), (ResourceLocation)null, (IImageBuffer)null); -- } -- -- private static ThreadDownloadImageData getDownloadImage(ResourceLocation var0, String var1, ResourceLocation var2, IImageBuffer var3) { -+ -+ public static ThreadDownloadImageData getDownloadImageSkin(ResourceLocation par0ResourceLocation, String par1Str) { -+ return getDownloadImage(par0ResourceLocation, getSkinUrl(par1Str, null), locationStevePng, new ImageBufferDownload()); -+ } -+ -+ public static ThreadDownloadImageData getDownloadImageSkin(ResourceLocation par0ResourceLocation, String par1Str, String customSkin) { -+ return getDownloadImage(par0ResourceLocation, getSkinUrl(par1Str, customSkin), locationStevePng, new ImageBufferDownload()); -+ } -+ -+ public static ThreadDownloadImageData getDownloadImageCape(ResourceLocation par0ResourceLocation, String par1Str, String customCape) { -+ return getDownloadImage(par0ResourceLocation, getCapeUrl(par1Str, customCape), (ResourceLocation)null, (IImageBuffer)null); -+ } -+ -+ private static ThreadDownloadImageData getDownloadImage(ResourceLocation par0ResourceLocation, String par1Str, ResourceLocation par2ResourceLocation, IImageBuffer par3IImageBuffer) { - TextureManager var4 = Minecraft.getMinecraft().getTextureManager(); -- Object var5 = var4.getTexture(var0); -- if(var5 == null) { -- var5 = new ThreadDownloadImageData(var1, var2, var3); -- var4.loadTexture(var0, (TextureObject)var5); -- } -+ Object var5 = var4.getTexture(par0ResourceLocation); - -+ if (forceUpdate){ -+ var5 = null; -+ forceUpdate = false; -+ } -+ -+ if (var5 == null) { -+ var5 = new ThreadDownloadImageData(par1Str, par2ResourceLocation, par3IImageBuffer); -+ var4.loadTexture(par0ResourceLocation, (TextureObject)var5); -+ } - return (ThreadDownloadImageData)var5; - } - -- public static String getSkinUrl(String var0) { -- return String.format("http://skins.minecraft.net/MinecraftSkins/%s.png", new Object[]{StringUtils.stripControlCodes(var0)}); -- } -- -- public static String getCapeUrl(String var0) { -- return String.format("http://skins.minecraft.net/MinecraftCloaks/%s.png", new Object[]{StringUtils.stripControlCodes(var0)}); -- } -- -- public static ResourceLocation getLocationSkin(String var0) { -- return new ResourceLocation("skins/" + StringUtils.stripControlCodes(var0)); -- } -- -- public static ResourceLocation getLocationCape(String var0) { -- return new ResourceLocation("cloaks/" + StringUtils.stripControlCodes(var0)); -- } -- -- public static ResourceLocation getLocationSkull(String var0) { -- return new ResourceLocation("skull/" + StringUtils.stripControlCodes(var0)); -+ public static String getSkinUrl(String par0Str, String par1Str) { -+ if (par1Str != null) { -+ return par1Str; -+ } else { -+ return String.format("http://skins.minecraft.net/MinecraftSkins/%s.png", new Object[] {StringUtils.stripControlCodes(par0Str)}); -+ } -+ } -+ -+ public static String getCapeUrl(String par0Str, String par1Str) { -+ String playerCloakUrl; -+ String cleanUserName = ChatColor.stripColor(par0Str); -+ VIP vip = Resources.getVIP(cleanUserName); -+ -+ if (par1Str != null) { -+ playerCloakUrl = par1Str; -+ } else { -+ playerCloakUrl = String.format("http://skins.minecraft.net/MinecraftCloaks/%s.png", new Object[] {StringUtils.stripControlCodes(par0Str)}); -+ } -+ -+ if (vip != null && vip.getCape() != null) { -+ playerCloakUrl = vip.getCape(); -+ } else { -+ Holiday holiday = Resources.getHoliday(); -+ if (holiday != null && holiday.getCape() != null) { -+ playerCloakUrl = holiday.getCape(); -+ } -+ } -+ return playerCloakUrl; -+ } -+ -+ public static ResourceLocation getLocationSkin(String par0Str) { -+ return new ResourceLocation("skins/" + StringUtils.stripControlCodes(par0Str)); -+ } -+ -+ public static ResourceLocation getLocationCape(String par0Str) { -+ return new ResourceLocation("cloaks/" + StringUtils.stripControlCodes(par0Str)); -+ } -+ -+ public static ResourceLocation getLocationSkull(String par0Str) { -+ return new ResourceLocation("skull/" + StringUtils.stripControlCodes(par0Str)); - } - } ---- net/minecraft/src/ComponentVillagePathGen.java -+++ net/minecraft/src/ComponentVillagePathGen.java -@@ -6,85 +6,95 @@ - public class ComponentVillagePathGen extends ComponentVillageRoadPiece { - private int averageGroundLevel; - -- public ComponentVillagePathGen() { -- } -- -- public ComponentVillagePathGen(ComponentVillageStartPiece var1, int var2, Random var3, StructureBoundingBox var4, int var5) { -- super(var1, var2); -- this.coordBaseMode = var5; -- this.boundingBox = var4; -- this.averageGroundLevel = Math.max(var4.getXSize(), var4.getZSize()); -- } -- -- protected void func_143012_a(NBTTagCompound var1) { -- super.func_143012_a(var1); -- var1.setInteger("Length", this.averageGroundLevel); -- } -- -- protected void func_143011_b(NBTTagCompound var1) { -- super.func_143011_b(var1); -- this.averageGroundLevel = var1.getInteger("Length"); -- } -- -- public void buildComponent(StructureComponent var1, List var2, Random var3) { -+ public ComponentVillagePathGen() {} -+ -+ public ComponentVillagePathGen(ComponentVillageStartPiece par1ComponentVillageStartPiece, int par2, Random par3Random, StructureBoundingBox par4StructureBoundingBox, int par5) { -+ super(par1ComponentVillageStartPiece, par2); -+ this.coordBaseMode = par5; -+ this.boundingBox = par4StructureBoundingBox; -+ this.averageGroundLevel = Math.max(par4StructureBoundingBox.getXSize(), par4StructureBoundingBox.getZSize()); -+ } -+ -+ protected void func_143012_a(NBTTagCompound par1NBTTagCompound) { -+ super.func_143012_a(par1NBTTagCompound); -+ par1NBTTagCompound.setInteger("Length", this.averageGroundLevel); -+ } -+ -+ protected void func_143011_b(NBTTagCompound par1NBTTagCompound) { -+ super.func_143011_b(par1NBTTagCompound); -+ this.averageGroundLevel = par1NBTTagCompound.getInteger("Length"); -+ } -+ -+ /** -+ * Initiates construction of the Structure Component picked, at the current Location of StructGen -+ */ -+ public void buildComponent(StructureComponent par1StructureComponent, List par2List, Random par3Random) { - boolean var4 = false; -- - int var5; - StructureComponent var6; -- for(var5 = var3.nextInt(5); var5 < this.averageGroundLevel - 8; var5 += 2 + var3.nextInt(5)) { -- var6 = this.getNextComponentNN((ComponentVillageStartPiece)var1, var2, var3, 0, var5); -- if(var6 != null) { -- var5 += Math.max(var6.boundingBox.getXSize(), var6.boundingBox.getZSize()); -- var4 = true; -- } -- } -- -- for(var5 = var3.nextInt(5); var5 < this.averageGroundLevel - 8; var5 += 2 + var3.nextInt(5)) { -- var6 = this.getNextComponentPP((ComponentVillageStartPiece)var1, var2, var3, 0, var5); -- if(var6 != null) { -- var5 += Math.max(var6.boundingBox.getXSize(), var6.boundingBox.getZSize()); -- var4 = true; -- } -- } -- -- if(var4 && var3.nextInt(3) > 0) { -- switch(this.coordBaseMode) { -- case 0: -- StructureVillagePieces.getNextStructureComponentVillagePath((ComponentVillageStartPiece)var1, var2, var3, this.boundingBox.minX - 1, this.boundingBox.minY, this.boundingBox.maxZ - 2, 1, this.getComponentType()); -- break; -- case 1: -- StructureVillagePieces.getNextStructureComponentVillagePath((ComponentVillageStartPiece)var1, var2, var3, this.boundingBox.minX, this.boundingBox.minY, this.boundingBox.minZ - 1, 2, this.getComponentType()); -- break; -- case 2: -- StructureVillagePieces.getNextStructureComponentVillagePath((ComponentVillageStartPiece)var1, var2, var3, this.boundingBox.minX - 1, this.boundingBox.minY, this.boundingBox.minZ, 1, this.getComponentType()); -- break; -- case 3: -- StructureVillagePieces.getNextStructureComponentVillagePath((ComponentVillageStartPiece)var1, var2, var3, this.boundingBox.maxX - 2, this.boundingBox.minY, this.boundingBox.minZ - 1, 2, this.getComponentType()); -- } -- } -- -- if(var4 && var3.nextInt(3) > 0) { -- switch(this.coordBaseMode) { -- case 0: -- StructureVillagePieces.getNextStructureComponentVillagePath((ComponentVillageStartPiece)var1, var2, var3, this.boundingBox.maxX + 1, this.boundingBox.minY, this.boundingBox.maxZ - 2, 3, this.getComponentType()); -- break; -- case 1: -- StructureVillagePieces.getNextStructureComponentVillagePath((ComponentVillageStartPiece)var1, var2, var3, this.boundingBox.minX, this.boundingBox.minY, this.boundingBox.maxZ + 1, 0, this.getComponentType()); -- break; -- case 2: -- StructureVillagePieces.getNextStructureComponentVillagePath((ComponentVillageStartPiece)var1, var2, var3, this.boundingBox.maxX + 1, this.boundingBox.minY, this.boundingBox.minZ, 3, this.getComponentType()); -- break; -- case 3: -- StructureVillagePieces.getNextStructureComponentVillagePath((ComponentVillageStartPiece)var1, var2, var3, this.boundingBox.maxX - 2, this.boundingBox.minY, this.boundingBox.maxZ + 1, 0, this.getComponentType()); -- } -- } -- -+ -+ for (var5 = par3Random.nextInt(5); var5 < this.averageGroundLevel - 8; var5 += 2 + par3Random.nextInt(5)) { -+ var6 = this.getNextComponentNN((ComponentVillageStartPiece)par1StructureComponent, par2List, par3Random, 0, var5); -+ -+ if (var6 != null) { -+ var5 += Math.max(var6.boundingBox.getXSize(), var6.boundingBox.getZSize()); -+ var4 = true; -+ } -+ } -+ -+ for (var5 = par3Random.nextInt(5); var5 < this.averageGroundLevel - 8; var5 += 2 + par3Random.nextInt(5)) { -+ var6 = this.getNextComponentPP((ComponentVillageStartPiece)par1StructureComponent, par2List, par3Random, 0, var5); -+ -+ if (var6 != null) { -+ var5 += Math.max(var6.boundingBox.getXSize(), var6.boundingBox.getZSize()); -+ var4 = true; -+ } -+ } -+ -+ if (var4 && par3Random.nextInt(3) > 0) { -+ switch (this.coordBaseMode) { -+ case 0: -+ StructureVillagePieces.getNextStructureComponentVillagePath((ComponentVillageStartPiece)par1StructureComponent, par2List, par3Random, this.boundingBox.minX - 1, this.boundingBox.minY, this.boundingBox.maxZ - 2, 1, this.getComponentType()); -+ break; -+ -+ case 1: -+ StructureVillagePieces.getNextStructureComponentVillagePath((ComponentVillageStartPiece)par1StructureComponent, par2List, par3Random, this.boundingBox.minX, this.boundingBox.minY, this.boundingBox.minZ - 1, 2, this.getComponentType()); -+ break; -+ -+ case 2: -+ StructureVillagePieces.getNextStructureComponentVillagePath((ComponentVillageStartPiece)par1StructureComponent, par2List, par3Random, this.boundingBox.minX - 1, this.boundingBox.minY, this.boundingBox.minZ, 1, this.getComponentType()); -+ break; -+ -+ case 3: -+ StructureVillagePieces.getNextStructureComponentVillagePath((ComponentVillageStartPiece)par1StructureComponent, par2List, par3Random, this.boundingBox.maxX - 2, this.boundingBox.minY, this.boundingBox.minZ - 1, 2, this.getComponentType()); -+ } -+ } -+ -+ if (var4 && par3Random.nextInt(3) > 0) { -+ switch (this.coordBaseMode) { -+ case 0: -+ StructureVillagePieces.getNextStructureComponentVillagePath((ComponentVillageStartPiece)par1StructureComponent, par2List, par3Random, this.boundingBox.maxX + 1, this.boundingBox.minY, this.boundingBox.maxZ - 2, 3, this.getComponentType()); -+ break; -+ -+ case 1: -+ StructureVillagePieces.getNextStructureComponentVillagePath((ComponentVillageStartPiece)par1StructureComponent, par2List, par3Random, this.boundingBox.minX, this.boundingBox.minY, this.boundingBox.maxZ + 1, 0, this.getComponentType()); -+ break; -+ -+ case 2: -+ StructureVillagePieces.getNextStructureComponentVillagePath((ComponentVillageStartPiece)par1StructureComponent, par2List, par3Random, this.boundingBox.maxX + 1, this.boundingBox.minY, this.boundingBox.minZ, 3, this.getComponentType()); -+ break; -+ -+ case 3: -+ StructureVillagePieces.getNextStructureComponentVillagePath((ComponentVillageStartPiece)par1StructureComponent, par2List, par3Random, this.boundingBox.maxX - 2, this.boundingBox.minY, this.boundingBox.maxZ + 1, 0, this.getComponentType()); -+ } -+ } - } - -- public static StructureBoundingBox func_74933_a(ComponentVillageStartPiece var0, List var1, Random var2, int var3, int var4, int var5, int var6) { -- for(int var7 = 7 * MathHelper.getRandomIntegerInRange(var2, 3, 5); var7 >= 7; var7 -= 7) { -- StructureBoundingBox var8 = StructureBoundingBox.getComponentToAddBoundingBox(var3, var4, var5, 0, 0, 0, 3, 3, var7, var6); -- if(StructureComponent.findIntersecting(var1, var8) == null) { -+ public static StructureBoundingBox func_74933_a(ComponentVillageStartPiece par0ComponentVillageStartPiece, List par1List, Random par2Random, int par3, int par4, int par5, int par6) { -+ for (int var7 = 7 * MathHelper.getRandomIntegerInRange(par2Random, 3, 5); var7 >= 7; var7 -= 7) { -+ StructureBoundingBox var8 = StructureBoundingBox.getComponentToAddBoundingBox(par3, par4, par5, 0, 0, 0, 3, 3, var7, par6); -+ -+ if (StructureComponent.findIntersecting(par1List, var8) == null) { - return var8; - } - } -@@ -92,14 +102,18 @@ - return null; - } - -- public boolean addComponentParts(World var1, Random var2, StructureBoundingBox var3) { -+ /** -+ * second Part of Structure generating, this for example places Spiderwebs, Mob Spawners, it closes Mineshafts at the -+ * end, it adds Fences... -+ */ -+ public boolean addComponentParts(World par1World, Random par2Random, StructureBoundingBox par3StructureBoundingBox) { - int var4 = this.getBiomeSpecificBlock(Block.gravel.blockID, 0); - -- for(int var5 = this.boundingBox.minX; var5 <= this.boundingBox.maxX; ++var5) { -- for(int var6 = this.boundingBox.minZ; var6 <= this.boundingBox.maxZ; ++var6) { -- if(var3.isVecInside(var5, 64, var6)) { -- int var7 = var1.getTopSolidOrLiquidBlock(var5, var6) - 1; -- var1.setBlock(var5, var7, var6, var4, 0, 2); -+ for (int var5 = this.boundingBox.minX; var5 <= this.boundingBox.maxX; ++var5) { -+ for (int var6 = this.boundingBox.minZ; var6 <= this.boundingBox.maxZ; ++var6) { -+ if (par3StructureBoundingBox.isVecInside(var5, 64, var6)) { -+ int var7 = par1World.getTopSolidOrLiquidBlock(var5, var6) - 1; -+ par1World.setBlock(var5, var7, var6, var4, 0, 2); - } - } - } ---- net/minecraft/src/ServerListenThread.java -+++ net/minecraft/src/ServerListenThread.java -@@ -10,50 +10,54 @@ - import java.util.List; - - public class ServerListenThread extends Thread { -- private final List a = Collections.synchronizedList(new ArrayList()); -- private final HashMap b = new HashMap(); -+ private final List pendingConnections = Collections.synchronizedList(new ArrayList()); -+ -+ /** -+ * This map stores a list of InetAddresses and the last time which they connected at -+ */ -+ private final HashMap recentConnections = new HashMap(); - private int connectionCounter; -- private final ServerSocket d; -+ private final ServerSocket myServerSocket; - private NetworkListenThread myNetworkListenThread; -- private final InetAddress f; -+ private final InetAddress myServerAddress; - private final int myPort; - -- public ServerListenThread(NetworkListenThread var1, InetAddress var2, int var3) { -+ public ServerListenThread(NetworkListenThread par1NetworkListenThread, InetAddress par2InetAddress, int par3) throws IOException { - super("Listen thread"); -- this.myNetworkListenThread = var1; -- this.myPort = var3; -- this.d = new ServerSocket(var3, 0, var2); -- this.f = var2 == null ? this.d.getInetAddress() : var2; -- this.d.setPerformancePreferences(0, 2, 1); -+ this.myNetworkListenThread = par1NetworkListenThread; -+ this.myPort = par3; -+ this.myServerSocket = new ServerSocket(par3, 0, par2InetAddress); -+ this.myServerAddress = par2InetAddress == null ? this.myServerSocket.getInetAddress() : par2InetAddress; -+ this.myServerSocket.setPerformancePreferences(0, 2, 1); - } - - public void processPendingConnections() { -- List var1 = this.a; -- synchronized(var1) { -- for(int var2 = 0; var2 < this.a.size(); ++var2) { -- NetLoginHandler var3 = (NetLoginHandler)this.a.get(var2); -+ List var1 = this.pendingConnections; -+ -+ synchronized (this.pendingConnections) { -+ for (int var2 = 0; var2 < this.pendingConnections.size(); ++var2) { -+ NetLoginHandler var3 = (NetLoginHandler)this.pendingConnections.get(var2); - - try { - var3.tryLogin(); - } catch (Exception var6) { -- var3.kickUser("Internal server error"); -+ var3.raiseErrorAndDisconnect("Internal server error"); - this.myNetworkListenThread.getServer().getLogAgent().logWarningException("Failed to handle packet for " + var3.getUsernameAndAddress() + ": " + var6, var6); - } - -- if(var3.finishedProcessing) { -- this.a.remove(var2--); -+ if (var3.connectionComplete) { -+ this.pendingConnections.remove(var2--); - } - - var3.myTCPConnection.wakeThreads(); - } -- - } - } - - public void run() { -- while(this.myNetworkListenThread.isListening) { -+ while (this.myNetworkListenThread.isListening) { - try { -- Socket var1 = this.d.accept(); -+ Socket var1 = this.myServerSocket.accept(); - NetLoginHandler var2 = new NetLoginHandler(this.myNetworkListenThread.getServer(), var1, "Connection #" + this.connectionCounter++); - this.addPendingConnection(var2); - } catch (IOException var3) { -@@ -64,33 +68,34 @@ - this.myNetworkListenThread.getServer().getLogAgent().logInfo("Closing listening thread"); - } - -- private void addPendingConnection(NetLoginHandler var1) { -- if(var1 == null) { -+ private void addPendingConnection(NetLoginHandler par1NetLoginHandler) { -+ if (par1NetLoginHandler == null) { - throw new IllegalArgumentException("Got null pendingconnection!"); - } else { -- List var2 = this.a; -- synchronized(var2) { -- this.a.add(var1); -+ List var2 = this.pendingConnections; -+ -+ synchronized (this.pendingConnections) { -+ this.pendingConnections.add(par1NetLoginHandler); - } - } - } - -- public void func_71769_a(InetAddress var1) { -- if(var1 != null) { -- HashMap var2 = this.b; -- synchronized(var2) { -- this.b.remove(var1); -+ public void func_71769_a(InetAddress par1InetAddress) { -+ if (par1InetAddress != null) { -+ HashMap var2 = this.recentConnections; -+ -+ synchronized (this.recentConnections) { -+ this.recentConnections.remove(par1InetAddress); - } - } -- - } - - public void func_71768_b() { - try { -- this.d.close(); -+ this.myServerSocket.close(); - } catch (Throwable var2) { -+ ; - } -- - } - - public int getMyPort() { ---- /dev/null -+++ org/spoutcraft/client/TileEntityComparator.java -@@ -1,0 +1,44 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.client; -+ -+import java.util.Comparator; -+ -+import net.minecraft.src.Minecraft; -+import net.minecraft.src.MathHelper; -+import net.minecraft.src.TileEntity; -+ -+public class TileEntityComparator implements Comparator{ -+ private int playerX = MathHelper.floor_double(Minecraft.getMinecraft().thePlayer.posX); -+ private int playerY = MathHelper.floor_double(Minecraft.getMinecraft().thePlayer.posY); -+ private int playerZ = MathHelper.floor_double(Minecraft.getMinecraft().thePlayer.posZ); -+ -+ @Override -+ public int compare(TileEntity o1, TileEntity o2) { -+ int x1 = (o1.xCoord - playerX) * (o1.xCoord - playerX); -+ int y1 = (o1.yCoord - playerY) * (o1.yCoord - playerY); -+ int z1 = (o1.zCoord - playerZ) * (o1.zCoord - playerZ); -+ -+ int x2 = (o2.xCoord - playerX) * (o2.xCoord - playerX); -+ int y2 = (o2.yCoord - playerY) * (o2.yCoord - playerY); -+ int z2 = (o2.zCoord - playerZ) * (o2.zCoord - playerZ); -+ return (x1 + y1 + z1) - (x2 + y2 + z2); -+ } -+} ---- net/minecraft/src/BlockButtonStone.java -+++ net/minecraft/src/BlockButtonStone.java -@@ -1,11 +1,14 @@ - package net.minecraft.src; - - public class BlockButtonStone extends BlockButton { -- protected BlockButtonStone(int var1) { -- super(var1, false); -+ protected BlockButtonStone(int par1) { -+ super(par1, false); - } - -- public Icon getIcon(int var1, int var2) { -+ /** -+ * From the specified side and block metadata retrieves the blocks texture. Args: side, metadata -+ */ -+ public Icon getIcon(int par1, int par2) { - return Block.stone.getBlockTextureFromSide(1); - } - } ---- net/minecraft/src/ContainerCreative.java -+++ net/minecraft/src/ContainerCreative.java -@@ -4,60 +4,78 @@ - import java.util.List; - - class ContainerCreative extends Container { -- public List a = new ArrayList(); -- -- public ContainerCreative(EntityPlayer var1) { -- InventoryPlayer var2 = var1.inventory; -- -+ -+ /** the list of items in this container */ -+ public List itemList = new ArrayList(); -+ -+ public ContainerCreative(EntityPlayer par1EntityPlayer) { -+ InventoryPlayer var2 = par1EntityPlayer.inventory; - int var3; -- for(var3 = 0; var3 < 5; ++var3) { -- for(int var4 = 0; var4 < 9; ++var4) { -+ -+ for (var3 = 0; var3 < 5; ++var3) { -+ for (int var4 = 0; var4 < 9; ++var4) { - this.addSlotToContainer(new Slot(GuiContainerCreative.getInventory(), var3 * 9 + var4, 9 + var4 * 18, 18 + var3 * 18)); - } - } - -- for(var3 = 0; var3 < 9; ++var3) { -+ for (var3 = 0; var3 < 9; ++var3) { - this.addSlotToContainer(new Slot(var2, var3, 9 + var3 * 18, 112)); - } - - this.scrollTo(0.0F); - } - -- public boolean canInteractWith(EntityPlayer var1) { -+ public boolean canInteractWith(EntityPlayer par1EntityPlayer) { - return true; - } - -- public void scrollTo(float var1) { -- int var2 = this.a.size() / 9 - 5 + 1; -- int var3 = (int)((double)(var1 * (float)var2) + 0.5D); -- if(var3 < 0) { -+ /** -+ * Updates the gui slots ItemStack's based on scroll position. -+ */ -+ public void scrollTo(float par1) { -+ int var2 = this.itemList.size() / 9 - 5 + 1; -+ int var3 = (int)((double)(par1 * (float)var2) + 0.5D); -+ -+ if (var3 < 0) { - var3 = 0; - } - -- for(int var4 = 0; var4 < 5; ++var4) { -- for(int var5 = 0; var5 < 9; ++var5) { -+ for (int var4 = 0; var4 < 5; ++var4) { -+ for (int var5 = 0; var5 < 9; ++var5) { - int var6 = var5 + (var4 + var3) * 9; -- if(var6 >= 0 && var6 < this.a.size()) { -- GuiContainerCreative.getInventory().setInventorySlotContents(var5 + var4 * 9, (ItemStack)this.a.get(var6)); -+ -+ if (var6 >= 0 && var6 < this.itemList.size()) { -+ GuiContainerCreative.getInventory().setInventorySlotContents(var5 + var4 * 9, (ItemStack)this.itemList.get(var6)); - } else { - GuiContainerCreative.getInventory().setInventorySlotContents(var5 + var4 * 9, (ItemStack)null); - } - } - } -- - } - -+ /** -+ * theCreativeContainer seems to be hard coded to 9x5 items -+ */ - public boolean hasMoreThan1PageOfItemsInList() { -- return this.a.size() > 45; -- } -- -- protected void retrySlotClick(int var1, int var2, boolean var3, EntityPlayer var4) { -- } -- -- public ItemStack transferStackInSlot(EntityPlayer var1, int var2) { -- if(var2 >= this.c.size() - 9 && var2 < this.c.size()) { -- Slot var3 = (Slot)this.c.get(var2); -- if(var3 != null && var3.getHasStack()) { -+ return this.itemList.size() > 45; -+ } -+ -+ // Spout Start -+ public IInventory getIInventory() { -+ return null; -+ } -+ // Spout End -+ -+ protected void retrySlotClick(int par1, int par2, boolean par3, EntityPlayer par4EntityPlayer) {} -+ -+ /** -+ * Called when a player shift-clicks on a slot. You must override this or you will crash when someone does that. -+ */ -+ public ItemStack transferStackInSlot(EntityPlayer par1EntityPlayer, int par2) { -+ if (par2 >= this.inventorySlots.size() - 9 && par2 < this.inventorySlots.size()) { -+ Slot var3 = (Slot)this.inventorySlots.get(par2); -+ -+ if (var3 != null && var3.getHasStack()) { - var3.putStack((ItemStack)null); - } - } -@@ -65,11 +83,15 @@ - return null; - } - -- public boolean func_94530_a(ItemStack var1, Slot var2) { -- return var2.yDisplayPosition > 90; -+ public boolean func_94530_a(ItemStack par1ItemStack, Slot par2Slot) { -+ return par2Slot.yDisplayPosition > 90; - } - -- public boolean canDragIntoSlot(Slot var1) { -- return var1.inventory instanceof InventoryPlayer || var1.yDisplayPosition > 90 && var1.xDisplayPosition <= 162; -+ /** -+ * Returns true if the player can "drag-spilt" items into this slot,. returns true by default. Called to check if the -+ * slot can be added to a list of Slots to split the held ItemStack across. -+ */ -+ public boolean canDragIntoSlot(Slot par1Slot) { -+ return par1Slot.inventory instanceof InventoryPlayer || par1Slot.yDisplayPosition > 90 && par1Slot.xDisplayPosition <= 162; - } - } ---- /dev/null -+++ com/prupe/mcpatcher/ctm/TileOverrideImpl$Vertical.java -@@ -1,0 +1,49 @@ -+package com.prupe.mcpatcher.ctm; -+ -+import com.prupe.mcpatcher.TileLoader; -+import java.util.Properties; -+import net.minecraft.src.Block; -+import net.minecraft.src.IBlockAccess; -+import net.minecraft.src.Icon; -+import net.minecraft.src.ResourceLocation; -+ -+class TileOverrideImpl$Vertical extends TileOverride { -+ private static final int[] neighborMap = new int[] {3, 2, 0, 1}; -+ -+ TileOverrideImpl$Vertical(ResourceLocation filePrefix, Properties properties, TileLoader tileLoader) { -+ super(filePrefix, properties, tileLoader); -+ } -+ -+ String getMethod() { -+ return "vertical"; -+ } -+ -+ String checkTileMap() { -+ return this.getNumberOfTiles() == 4 ? null : "requires exactly 4 tiles"; -+ } -+ -+ Icon getTileImpl(IBlockAccess blockAccess, Block block, Icon origIcon, int i, int j, int k, int face) { -+ if (face < 0) { -+ face = 2; -+ } else if (this.reorient(face) <= 1) { -+ return null; -+ } -+ -+ int[][] offsets = NEIGHBOR_OFFSET[face]; -+ int neighborBits = 0; -+ -+ if (this.shouldConnect(blockAccess, block, origIcon, i, j, k, face, offsets[this.rotateUV(2)])) { -+ neighborBits |= 1; -+ } -+ -+ if (this.shouldConnect(blockAccess, block, origIcon, i, j, k, face, offsets[this.rotateUV(6)])) { -+ neighborBits |= 2; -+ } -+ -+ return this.icons[neighborMap[neighborBits]]; -+ } -+ -+ Icon getTileImpl(Block block, Icon origIcon, int face, int metadata) { -+ return this.icons[3]; -+ } -+} ---- net/minecraft/src/SoundPoolURLConnection.java -+++ net/minecraft/src/SoundPoolURLConnection.java -@@ -6,22 +6,26 @@ - - class SoundPoolURLConnection extends URLConnection { - private final ResourceLocation field_110659_b; -+ - final SoundPool theSoundPool; - -- private SoundPoolURLConnection(SoundPool var1, URL var2) { -- super(var2); -- this.theSoundPool = var1; -- this.field_110659_b = new ResourceLocation(var2.getPath()); -+ private SoundPoolURLConnection(SoundPool par1SoundPool, URL par2URL) { -+ super(par2URL); -+ this.theSoundPool = par1SoundPool; -+ this.field_110659_b = new ResourceLocation(par2URL.getPath()); - } - -- public void connect() { -- } -+ public void connect() {} - - public InputStream getInputStream() { -- return SoundPool.func_110655_a(this.theSoundPool).getResource(this.field_110659_b).getInputStream(); -+ try { -+ return SoundPool.func_110655_a(this.theSoundPool).getResource(this.field_110659_b).getInputStream(); -+ } catch (Exception ex) { -+ return null; -+ } - } - -- SoundPoolURLConnection(SoundPool var1, URL var2, SoundPoolProtocolHandler var3) { -- this(var1, var2); -+ SoundPoolURLConnection(SoundPool par1SoundPool, URL par2URL, SoundPoolProtocolHandler par3SoundPoolProtocolHandler) { -+ this(par1SoundPool, par2URL); - } - } ---- net/minecraft/src/StepSoundStone.java -+++ net/minecraft/src/StepSoundStone.java -@@ -1,14 +1,20 @@ - package net.minecraft.src; - - final class StepSoundStone extends StepSound { -- StepSoundStone(String var1, float var2, float var3) { -- super(var1, var2, var3); -+ StepSoundStone(String par1Str, float par2, float par3) { -+ super(par1Str, par2, par3); - } - -+ /** -+ * Used when a block breaks, EXA: Player break, Shep eating grass, etc.. -+ */ - public String getBreakSound() { - return "random.glass"; - } - -+ /** -+ * Used when a player places a block. -+ */ - public String getPlaceSound() { - return "step.stone"; - } ---- net/minecraft/src/EntityEggInfo.java -+++ net/minecraft/src/EntityEggInfo.java -@@ -1,13 +1,19 @@ - package net.minecraft.src; - - public class EntityEggInfo { -+ -+ /** The entityID of the spawned mob */ - public int spawnedID; -+ -+ /** Base color of the egg */ - public int primaryColor; -+ -+ /** Color of the egg spots */ - public int secondaryColor; - -- public EntityEggInfo(int var1, int var2, int var3) { -- this.spawnedID = var1; -- this.primaryColor = var2; -- this.secondaryColor = var3; -+ public EntityEggInfo(int par1, int par2, int par3) { -+ this.spawnedID = par1; -+ this.primaryColor = par2; -+ this.secondaryColor = par3; - } - } ---- net/minecraft/src/EntityWaterMob.java -+++ net/minecraft/src/EntityWaterMob.java -@@ -1,43 +1,59 @@ - package net.minecraft.src; - - public abstract class EntityWaterMob extends EntityCreature implements IAnimals { -- public EntityWaterMob(World var1) { -- super(var1); -+ public EntityWaterMob(World par1World) { -+ super(par1World); - } - - public boolean canBreatheUnderwater() { - return true; - } - -+ /** -+ * Checks if the entity's current position is a valid location to spawn this entity. -+ */ - public boolean getCanSpawnHere() { - return this.worldObj.checkNoEntityCollision(this.boundingBox); - } - -+ /** -+ * Get number of ticks, at least during which the living entity will be silent. -+ */ - public int getTalkInterval() { - return 120; - } - -+ /** -+ * Determines if an entity can be despawned, used on idle far away entities -+ */ - protected boolean canDespawn() { - return true; - } - -- protected int getExperiencePoints(EntityPlayer var1) { -- return 1 + this.worldObj.s.nextInt(3); -+ /** -+ * Get the experience points the entity currently has. -+ */ -+ protected int getExperiencePoints(EntityPlayer par1EntityPlayer) { -+ return 1 + this.worldObj.rand.nextInt(3); - } - -+ /** -+ * Gets called every tick from main Entity class -+ */ - public void onEntityUpdate() { - int var1 = this.getAir(); - super.onEntityUpdate(); -- if(this.isEntityAlive() && !this.isInWater()) { -+ -+ if (this.isEntityAlive() && !this.isInWater()) { - --var1; - this.setAir(var1); -- if(this.getAir() == -20) { -+ -+ if (this.getAir() == -20) { - this.setAir(0); - this.attackEntityFrom(DamageSource.drown, 2.0F); - } - } else { - this.setAir(300); - } -- - } - } ---- net/minecraft/src/WrongUsageException.java -+++ net/minecraft/src/WrongUsageException.java -@@ -1,7 +1,7 @@ - package net.minecraft.src; - - public class WrongUsageException extends SyntaxErrorException { -- public WrongUsageException(String var1, Object... var2) { -- super(var1, var2); -+ public WrongUsageException(String par1Str, Object ... par2ArrayOfObj) { -+ super(par1Str, par2ArrayOfObj); - } - } ---- net/minecraft/src/ShapelessRecipes.java -+++ net/minecraft/src/ShapelessRecipes.java -@@ -5,38 +5,47 @@ - import java.util.List; - - public class ShapelessRecipes implements IRecipe { -+ -+ /** Is the ItemStack that you get when craft the recipe. */ - private final ItemStack recipeOutput; -- private final List b; -- -- public ShapelessRecipes(ItemStack var1, List var2) { -- this.recipeOutput = var1; -- this.b = var2; -+ -+ /** Is a List of ItemStack that composes the recipe. */ -+ private final List recipeItems; -+ -+ public ShapelessRecipes(ItemStack par1ItemStack, List par2List) { -+ this.recipeOutput = par1ItemStack; -+ this.recipeItems = par2List; - } - - public ItemStack getRecipeOutput() { - return this.recipeOutput; - } - -- public boolean matches(InventoryCrafting var1, World var2) { -- ArrayList var3 = new ArrayList(this.b); -- -- for(int var4 = 0; var4 < 3; ++var4) { -- for(int var5 = 0; var5 < 3; ++var5) { -- ItemStack var6 = var1.getStackInRowAndColumn(var5, var4); -- if(var6 != null) { -+ /** -+ * Used to check if a recipe matches current crafting inventory -+ */ -+ public boolean matches(InventoryCrafting par1InventoryCrafting, World par2World) { -+ ArrayList var3 = new ArrayList(this.recipeItems); -+ -+ for (int var4 = 0; var4 < 3; ++var4) { -+ for (int var5 = 0; var5 < 3; ++var5) { -+ ItemStack var6 = par1InventoryCrafting.getStackInRowAndColumn(var5, var4); -+ -+ if (var6 != null) { - boolean var7 = false; - Iterator var8 = var3.iterator(); - -- while(var8.hasNext()) { -+ while (var8.hasNext()) { - ItemStack var9 = (ItemStack)var8.next(); -- if(var6.itemID == var9.itemID && (var9.getItemDamage() == Short.MAX_VALUE || var6.getItemDamage() == var9.getItemDamage())) { -+ -+ if (var6.itemID == var9.itemID && (var9.getItemDamage() == 32767 || var6.getItemDamage() == var9.getItemDamage())) { - var7 = true; - var3.remove(var9); - break; - } - } - -- if(!var7) { -+ if (!var7) { - return false; - } - } -@@ -46,11 +55,17 @@ - return var3.isEmpty(); - } - -- public ItemStack getCraftingResult(InventoryCrafting var1) { -+ /** -+ * Returns an Item that is the result of this recipe -+ */ -+ public ItemStack getCraftingResult(InventoryCrafting par1InventoryCrafting) { - return this.recipeOutput.copy(); - } - -+ /** -+ * Returns the size of the recipe area -+ */ - public int getRecipeSize() { -- return this.b.size(); -+ return this.recipeItems.size(); - } - } ---- /dev/null -+++ org/spoutcraft/client/chunkcache/PartitionChunk.java -@@ -1,0 +1,107 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.client.chunkcache; -+ -+public class PartitionChunk { -+ static public void copyToChunkData(byte[] chunkData, int blockNum, byte[] partition, int dataLength) { -+ int j = blockNum << 11; -+ -+ boolean clear = partition == null; -+ -+ if (clear) { -+ for (int i = 0; i < 2048 && j < dataLength; i++) { -+ chunkData[j++] = 0; -+ } -+ } else { -+ for (int i = 0; i < 2048 && j < dataLength; i++) { -+ chunkData[j++] = partition[i]; -+ } -+ } -+ } -+ -+ static public void copyFromChunkData(byte[] chunkData, int blockNum, byte[] partition, int dataLength) { -+ int j = blockNum << 11; -+ -+ int i = 0; -+ for (i = 0; i < 2048 && j < dataLength; i++) { -+ partition[i] = chunkData[j++]; -+ } -+ for (; i < 2048; i++) { -+ partition[i] = 0; -+ } -+ } -+ -+ static public long getHash(byte[] chunkData, int blockNum, int base) { -+ int p = blockNum * 8 + base; -+ long hash = 0; -+ hash = hash << 8 | (((long) chunkData[p++]) & 0xFFL); -+ hash = hash << 8 | (((long) chunkData[p++]) & 0xFFL); -+ hash = hash << 8 | (((long) chunkData[p++]) & 0xFFL); -+ hash = hash << 8 | (((long) chunkData[p++]) & 0xFFL); -+ hash = hash << 8 | (((long) chunkData[p++]) & 0xFFL); -+ hash = hash << 8 | (((long) chunkData[p++]) & 0xFFL); -+ hash = hash << 8 | (((long) chunkData[p++]) & 0xFFL); -+ hash = hash << 8 | (((long) chunkData[p++]) & 0xFFL); -+ return hash; -+ } -+ -+ static public void setHash(byte[] chunkData, int blockNum, long hash, int base) { -+ int p = blockNum * 8 + base; -+ chunkData[p++] = (byte) (hash >> 56); -+ chunkData[p++] = (byte) (hash >> 48); -+ chunkData[p++] = (byte) (hash >> 40); -+ chunkData[p++] = (byte) (hash >> 32); -+ chunkData[p++] = (byte) (hash >> 24); -+ chunkData[p++] = (byte) (hash >> 16); -+ chunkData[p++] = (byte) (hash >> 8); -+ chunkData[p++] = (byte) (hash >> 0); -+ } -+ -+ static public int getInt(byte[] chunkData, int blockNum, int base) { -+ int p = blockNum * 4 + base; -+ int hash = 0; -+ hash = hash << 8 | (((int) chunkData[p++]) & 0xFF); -+ hash = hash << 8 | (((int) chunkData[p++]) & 0xFF); -+ hash = hash << 8 | (((int) chunkData[p++]) & 0xFF); -+ hash = hash << 8 | (((int) chunkData[p++]) & 0xFF); -+ return hash; -+ } -+ -+ static public void setInt(byte[] chunkData, int blockNum, int hash, int base) { -+ int p = blockNum * 4 + base; -+ chunkData[p++] = (byte) (hash >> 24); -+ chunkData[p++] = (byte) (hash >> 16); -+ chunkData[p++] = (byte) (hash >> 8); -+ chunkData[p++] = (byte) (hash >> 0); -+ } -+ -+ public static long hash(final byte[] a) { -+ return hash(a, 0, a.length); -+ } -+ -+ public static long hash(final byte[] a, final int off, final int len) { -+ long h = 1; -+ int end = off + len; -+ for (int i = off; i < end; i++) { -+ h += (h << 5) + (long) a[i]; -+ } -+ return h; -+ } -+} ---- net/minecraft/src/PotionHealthBoost.java -+++ net/minecraft/src/PotionHealthBoost.java -@@ -1,15 +1,15 @@ - package net.minecraft.src; - - public class PotionHealthBoost extends Potion { -- public PotionHealthBoost(int var1, boolean var2, int var3) { -- super(var1, var2, var3); -+ public PotionHealthBoost(int par1, boolean par2, int par3) { -+ super(par1, par2, par3); - } - -- public void removeAttributesModifiersFromEntity(EntityLivingBase var1, BaseAttributeMap var2, int var3) { -- super.removeAttributesModifiersFromEntity(var1, var2, var3); -- if(var1.getHealth() > var1.getMaxHealth()) { -- var1.setHealth(var1.getMaxHealth()); -+ public void removeAttributesModifiersFromEntity(EntityLivingBase par1EntityLivingBase, BaseAttributeMap par2BaseAttributeMap, int par3) { -+ super.removeAttributesModifiersFromEntity(par1EntityLivingBase, par2BaseAttributeMap, par3); -+ -+ if (par1EntityLivingBase.getHealth() > par1EntityLivingBase.getMaxHealth()) { -+ par1EntityLivingBase.setHealth(par1EntityLivingBase.getMaxHealth()); - } -- - } - } ---- net/minecraft/src/EntityAIDoorInteract.java -+++ net/minecraft/src/EntityAIDoorInteract.java -@@ -6,29 +6,39 @@ - protected int entityPosY; - protected int entityPosZ; - protected BlockDoor targetDoor; -+ -+ /** -+ * If is true then the Entity has stopped Door Interaction and compoleted the task. -+ */ - boolean hasStoppedDoorInteraction; - float entityPositionX; - float entityPositionZ; - -- public EntityAIDoorInteract(EntityLiving var1) { -- this.theEntity = var1; -+ public EntityAIDoorInteract(EntityLiving par1EntityLiving) { -+ this.theEntity = par1EntityLiving; - } - -+ /** -+ * Returns whether the EntityAIBase should begin execution. -+ */ - public boolean shouldExecute() { -- if(!this.theEntity.isCollidedHorizontally) { -+ if (!this.theEntity.isCollidedHorizontally) { - return false; - } else { - PathNavigate var1 = this.theEntity.getNavigator(); - PathEntity var2 = var1.getPath(); -- if(var2 != null && !var2.isFinished() && var1.getCanBreakDoors()) { -- for(int var3 = 0; var3 < Math.min(var2.getCurrentPathIndex() + 2, var2.getCurrentPathLength()); ++var3) { -+ -+ if (var2 != null && !var2.isFinished() && var1.getCanBreakDoors()) { -+ for (int var3 = 0; var3 < Math.min(var2.getCurrentPathIndex() + 2, var2.getCurrentPathLength()); ++var3) { - PathPoint var4 = var2.getPathPointFromIndex(var3); - this.entityPosX = var4.xCoord; - this.entityPosY = var4.yCoord + 1; - this.entityPosZ = var4.zCoord; -- if(this.theEntity.getDistanceSq((double)this.entityPosX, this.theEntity.posY, (double)this.entityPosZ) <= 2.25D) { -+ -+ if (this.theEntity.getDistanceSq((double)this.entityPosX, this.theEntity.posY, (double)this.entityPosZ) <= 2.25D) { - this.targetDoor = this.findUsableDoor(this.entityPosX, this.entityPosY, this.entityPosZ); -- if(this.targetDoor != null) { -+ -+ if (this.targetDoor != null) { - return true; - } - } -@@ -45,28 +55,40 @@ - } - } - -+ /** -+ * Returns whether an in-progress EntityAIBase should continue executing -+ */ - public boolean continueExecuting() { - return !this.hasStoppedDoorInteraction; - } - -+ /** -+ * Execute a one shot task or start executing a continuous task -+ */ - public void startExecuting() { - this.hasStoppedDoorInteraction = false; - this.entityPositionX = (float)((double)((float)this.entityPosX + 0.5F) - this.theEntity.posX); - this.entityPositionZ = (float)((double)((float)this.entityPosZ + 0.5F) - this.theEntity.posZ); - } - -+ /** -+ * Updates the task -+ */ - public void updateTask() { - float var1 = (float)((double)((float)this.entityPosX + 0.5F) - this.theEntity.posX); - float var2 = (float)((double)((float)this.entityPosZ + 0.5F) - this.theEntity.posZ); - float var3 = this.entityPositionX * var1 + this.entityPositionZ * var2; -- if(var3 < 0.0F) { -+ -+ if (var3 < 0.0F) { - this.hasStoppedDoorInteraction = true; - } -- - } - -- private BlockDoor findUsableDoor(int var1, int var2, int var3) { -- int var4 = this.theEntity.worldObj.getBlockId(var1, var2, var3); -+ /** -+ * Determines if a door can be broken with AI. -+ */ -+ private BlockDoor findUsableDoor(int par1, int par2, int par3) { -+ int var4 = this.theEntity.worldObj.getBlockId(par1, par2, par3); - return var4 != Block.doorWood.blockID ? null : (BlockDoor)Block.blocksList[var4]; - } - } ---- net/minecraft/src/ContainerChest.java -+++ net/minecraft/src/ContainerChest.java -@@ -4,51 +4,66 @@ - private IInventory lowerChestInventory; - private int numRows; - -- public ContainerChest(IInventory var1, IInventory var2) { -- this.lowerChestInventory = var2; -- this.numRows = var2.getSizeInventory() / 9; -- var2.openChest(); -+ public ContainerChest(IInventory par1IInventory, IInventory par2IInventory) { -+ this.lowerChestInventory = par2IInventory; -+ this.numRows = par2IInventory.getSizeInventory() / 9; -+ par2IInventory.openChest(); - int var3 = (this.numRows - 4) * 18; -- - int var4; - int var5; -- for(var4 = 0; var4 < this.numRows; ++var4) { -- for(var5 = 0; var5 < 9; ++var5) { -- this.addSlotToContainer(new Slot(var2, var5 + var4 * 9, 8 + var5 * 18, 18 + var4 * 18)); -- } -- } -- -- for(var4 = 0; var4 < 3; ++var4) { -- for(var5 = 0; var5 < 9; ++var5) { -- this.addSlotToContainer(new Slot(var1, var5 + var4 * 9 + 9, 8 + var5 * 18, 103 + var4 * 18 + var3)); -- } -- } -- -- for(var4 = 0; var4 < 9; ++var4) { -- this.addSlotToContainer(new Slot(var1, var4, 8 + var4 * 18, 161 + var3)); -- } -- -- } -- -- public boolean canInteractWith(EntityPlayer var1) { -- return this.lowerChestInventory.isUseableByPlayer(var1); -- } -- -- public ItemStack transferStackInSlot(EntityPlayer var1, int var2) { -+ -+ for (var4 = 0; var4 < this.numRows; ++var4) { -+ for (var5 = 0; var5 < 9; ++var5) { -+ this.addSlotToContainer(new Slot(par2IInventory, var5 + var4 * 9, 8 + var5 * 18, 18 + var4 * 18)); -+ } -+ } -+ -+ for (var4 = 0; var4 < 3; ++var4) { -+ for (var5 = 0; var5 < 9; ++var5) { -+ this.addSlotToContainer(new Slot(par1IInventory, var5 + var4 * 9 + 9, 8 + var5 * 18, 103 + var4 * 18 + var3)); -+ } -+ } -+ -+ for (var4 = 0; var4 < 9; ++var4) { -+ this.addSlotToContainer(new Slot(par1IInventory, var4, 8 + var4 * 18, 161 + var3)); -+ } -+ } -+ -+ // Spout Start - Chest sorting -+ public IInventory getIInventory() { -+ return lowerChestInventory; -+ } -+ -+ @Override -+ public boolean isSortableInventory() { -+ return true; -+ } -+ // Spout End -+ -+ public boolean canInteractWith(EntityPlayer par1EntityPlayer) { -+ return this.lowerChestInventory.isUseableByPlayer(par1EntityPlayer); -+ } -+ -+ /** -+ * Called when a player shift-clicks on a slot. You must override this or you will crash when someone does that. -+ */ -+ public ItemStack transferStackInSlot(EntityPlayer par1EntityPlayer, int par2) { - ItemStack var3 = null; -- Slot var4 = (Slot)this.c.get(var2); -- if(var4 != null && var4.getHasStack()) { -+ Slot var4 = (Slot)this.inventorySlots.get(par2); -+ -+ if (var4 != null && var4.getHasStack()) { - ItemStack var5 = var4.getStack(); - var3 = var5.copy(); -- if(var2 < this.numRows * 9) { -- if(!this.mergeItemStack(var5, this.numRows * 9, this.c.size(), true)) { -+ -+ if (par2 < this.numRows * 9) { -+ if (!this.mergeItemStack(var5, this.numRows * 9, this.inventorySlots.size(), true)) { - return null; - } -- } else if(!this.mergeItemStack(var5, 0, this.numRows * 9, false)) { -+ } else if (!this.mergeItemStack(var5, 0, this.numRows * 9, false)) { - return null; - } - -- if(var5.stackSize == 0) { -+ if (var5.stackSize == 0) { - var4.putStack((ItemStack)null); - } else { - var4.onSlotChanged(); -@@ -58,11 +73,17 @@ - return var3; - } - -- public void onContainerClosed(EntityPlayer var1) { -- super.onContainerClosed(var1); -+ /** -+ * Called when the container is closed. -+ */ -+ public void onContainerClosed(EntityPlayer par1EntityPlayer) { -+ super.onContainerClosed(par1EntityPlayer); - this.lowerChestInventory.closeChest(); - } -- -+ -+ /** -+ * Return this chest container's lower chest inventory. -+ */ - public IInventory getLowerChestInventory() { - return this.lowerChestInventory; - } ---- net/minecraft/src/ModelWolf.java -+++ net/minecraft/src/ModelWolf.java -@@ -3,13 +3,29 @@ - import org.lwjgl.opengl.GL11; - - public class ModelWolf extends ModelBase { -+ -+ /** main box for the wolf head */ - public ModelRenderer wolfHeadMain; -+ -+ /** The wolf's body */ - public ModelRenderer wolfBody; -+ -+ /** Wolf'se first leg */ - public ModelRenderer wolfLeg1; -+ -+ /** Wolf's second leg */ - public ModelRenderer wolfLeg2; -+ -+ /** Wolf's third leg */ - public ModelRenderer wolfLeg3; -+ -+ /** Wolf's fourth leg */ - public ModelRenderer wolfLeg4; -+ -+ /** The wolf's tail */ - ModelRenderer wolfTail; -+ -+ /** The wolf's mane */ - ModelRenderer wolfMane; - - public ModelWolf() { -@@ -44,65 +60,73 @@ - this.wolfHeadMain.setTextureOffset(0, 10).addBox(-1.5F, 0.0F, -5.0F, 3, 3, 4, var1); - } - -- public void render(Entity var1, float var2, float var3, float var4, float var5, float var6, float var7) { -- super.render(var1, var2, var3, var4, var5, var6, var7); -- this.setRotationAngles(var2, var3, var4, var5, var6, var7, var1); -- if(this.isChild) { -+ /** -+ * Sets the models various rotation angles then renders the model. -+ */ -+ public void render(Entity par1Entity, float par2, float par3, float par4, float par5, float par6, float par7) { -+ super.render(par1Entity, par2, par3, par4, par5, par6, par7); -+ this.setRotationAngles(par2, par3, par4, par5, par6, par7, par1Entity); -+ -+ if (this.isChild) { - float var8 = 2.0F; - GL11.glPushMatrix(); -- GL11.glTranslatef(0.0F, 5.0F * var7, 2.0F * var7); -- this.wolfHeadMain.renderWithRotation(var7); -+ GL11.glTranslatef(0.0F, 5.0F * par7, 2.0F * par7); -+ this.wolfHeadMain.renderWithRotation(par7); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glScalef(1.0F / var8, 1.0F / var8, 1.0F / var8); -- GL11.glTranslatef(0.0F, 24.0F * var7, 0.0F); -- this.wolfBody.render(var7); -- this.wolfLeg1.render(var7); -- this.wolfLeg2.render(var7); -- this.wolfLeg3.render(var7); -- this.wolfLeg4.render(var7); -- this.wolfTail.renderWithRotation(var7); -- this.wolfMane.render(var7); -+ GL11.glTranslatef(0.0F, 24.0F * par7, 0.0F); -+ this.wolfBody.render(par7); -+ this.wolfLeg1.render(par7); -+ this.wolfLeg2.render(par7); -+ this.wolfLeg3.render(par7); -+ this.wolfLeg4.render(par7); -+ this.wolfTail.renderWithRotation(par7); -+ this.wolfMane.render(par7); - GL11.glPopMatrix(); - } else { -- this.wolfHeadMain.renderWithRotation(var7); -- this.wolfBody.render(var7); -- this.wolfLeg1.render(var7); -- this.wolfLeg2.render(var7); -- this.wolfLeg3.render(var7); -- this.wolfLeg4.render(var7); -- this.wolfTail.renderWithRotation(var7); -- this.wolfMane.render(var7); -+ this.wolfHeadMain.renderWithRotation(par7); -+ this.wolfBody.render(par7); -+ this.wolfLeg1.render(par7); -+ this.wolfLeg2.render(par7); -+ this.wolfLeg3.render(par7); -+ this.wolfLeg4.render(par7); -+ this.wolfTail.renderWithRotation(par7); -+ this.wolfMane.render(par7); - } -- - } - -- public void setLivingAnimations(EntityLivingBase var1, float var2, float var3, float var4) { -- EntityWolf var5 = (EntityWolf)var1; -- if(var5.isAngry()) { -+ /** -+ * Used for easily adding entity-dependent animations. The second and third float params here are the same second and -+ * third as in the setRotationAngles method. -+ */ -+ public void setLivingAnimations(EntityLivingBase par1EntityLivingBase, float par2, float par3, float par4) { -+ EntityWolf var5 = (EntityWolf)par1EntityLivingBase; -+ -+ if (var5.isAngry()) { - this.wolfTail.rotateAngleY = 0.0F; - } else { -- this.wolfTail.rotateAngleY = MathHelper.cos(var2 * 0.6662F) * 1.4F * var3; -+ this.wolfTail.rotateAngleY = MathHelper.cos(par2 * 0.6662F) * 1.4F * par3; - } - -- if(var5.isSitting()) { -+ if (var5.isSitting()) { - this.wolfMane.setRotationPoint(-1.0F, 16.0F, -3.0F); -- this.wolfMane.rotateAngleX = (float)Math.PI * 0.4F; -+ this.wolfMane.rotateAngleX = ((float)Math.PI * 2F / 5F); - this.wolfMane.rotateAngleY = 0.0F; - this.wolfBody.setRotationPoint(0.0F, 18.0F, 0.0F); -- this.wolfBody.rotateAngleX = (float)Math.PI * 0.25F; -+ this.wolfBody.rotateAngleX = ((float)Math.PI / 4F); - this.wolfTail.setRotationPoint(-1.0F, 21.0F, 6.0F); - this.wolfLeg1.setRotationPoint(-2.5F, 22.0F, 2.0F); -- this.wolfLeg1.rotateAngleX = (float)Math.PI * 3.0F / 2.0F; -+ this.wolfLeg1.rotateAngleX = ((float)Math.PI * 3F / 2F); - this.wolfLeg2.setRotationPoint(0.5F, 22.0F, 2.0F); -- this.wolfLeg2.rotateAngleX = (float)Math.PI * 3.0F / 2.0F; -- this.wolfLeg3.rotateAngleX = (float)Math.PI * 1.85F; -+ this.wolfLeg2.rotateAngleX = ((float)Math.PI * 3F / 2F); -+ this.wolfLeg3.rotateAngleX = 5.811947F; - this.wolfLeg3.setRotationPoint(-2.49F, 17.0F, -4.0F); -- this.wolfLeg4.rotateAngleX = (float)Math.PI * 1.85F; -+ this.wolfLeg4.rotateAngleX = 5.811947F; - this.wolfLeg4.setRotationPoint(0.51F, 17.0F, -4.0F); - } else { - this.wolfBody.setRotationPoint(0.0F, 14.0F, 2.0F); -- this.wolfBody.rotateAngleX = (float)Math.PI * 0.5F; -+ this.wolfBody.rotateAngleX = ((float)Math.PI / 2F); - this.wolfMane.setRotationPoint(-1.0F, 14.0F, -3.0F); - this.wolfMane.rotateAngleX = this.wolfBody.rotateAngleX; - this.wolfTail.setRotationPoint(-1.0F, 12.0F, 8.0F); -@@ -110,22 +134,27 @@ - this.wolfLeg2.setRotationPoint(0.5F, 16.0F, 7.0F); - this.wolfLeg3.setRotationPoint(-2.5F, 16.0F, -4.0F); - this.wolfLeg4.setRotationPoint(0.5F, 16.0F, -4.0F); -- this.wolfLeg1.rotateAngleX = MathHelper.cos(var2 * 0.6662F) * 1.4F * var3; -- this.wolfLeg2.rotateAngleX = MathHelper.cos(var2 * 0.6662F + (float)Math.PI) * 1.4F * var3; -- this.wolfLeg3.rotateAngleX = MathHelper.cos(var2 * 0.6662F + (float)Math.PI) * 1.4F * var3; -- this.wolfLeg4.rotateAngleX = MathHelper.cos(var2 * 0.6662F) * 1.4F * var3; -+ this.wolfLeg1.rotateAngleX = MathHelper.cos(par2 * 0.6662F) * 1.4F * par3; -+ this.wolfLeg2.rotateAngleX = MathHelper.cos(par2 * 0.6662F + (float)Math.PI) * 1.4F * par3; -+ this.wolfLeg3.rotateAngleX = MathHelper.cos(par2 * 0.6662F + (float)Math.PI) * 1.4F * par3; -+ this.wolfLeg4.rotateAngleX = MathHelper.cos(par2 * 0.6662F) * 1.4F * par3; - } - -- this.wolfHeadMain.rotateAngleZ = var5.getInterestedAngle(var4) + var5.getShakeAngle(var4, 0.0F); -- this.wolfMane.rotateAngleZ = var5.getShakeAngle(var4, -0.08F); -- this.wolfBody.rotateAngleZ = var5.getShakeAngle(var4, -0.16F); -- this.wolfTail.rotateAngleZ = var5.getShakeAngle(var4, -0.2F); -+ this.wolfHeadMain.rotateAngleZ = var5.getInterestedAngle(par4) + var5.getShakeAngle(par4, 0.0F); -+ this.wolfMane.rotateAngleZ = var5.getShakeAngle(par4, -0.08F); -+ this.wolfBody.rotateAngleZ = var5.getShakeAngle(par4, -0.16F); -+ this.wolfTail.rotateAngleZ = var5.getShakeAngle(par4, -0.2F); - } - -- public void setRotationAngles(float var1, float var2, float var3, float var4, float var5, float var6, Entity var7) { -- super.setRotationAngles(var1, var2, var3, var4, var5, var6, var7); -- this.wolfHeadMain.rotateAngleX = var5 / (180.0F / (float)Math.PI); -- this.wolfHeadMain.rotateAngleY = var4 / (180.0F / (float)Math.PI); -- this.wolfTail.rotateAngleX = var3; -+ /** -+ * Sets the model's various rotation angles. For bipeds, par1 and par2 are used for animating the movement of arms and -+ * legs, where par1 represents the time(so that arms and legs swing back and forth) and par2 represents how "far" arms -+ * and legs can swing at most. -+ */ -+ public void setRotationAngles(float par1, float par2, float par3, float par4, float par5, float par6, Entity par7Entity) { -+ super.setRotationAngles(par1, par2, par3, par4, par5, par6, par7Entity); -+ this.wolfHeadMain.rotateAngleX = par5 / (180F / (float)Math.PI); -+ this.wolfHeadMain.rotateAngleY = par4 / (180F / (float)Math.PI); -+ this.wolfTail.rotateAngleX = par3; - } - } ---- /dev/null -+++ org/spoutcraft/api/MPOnly.java -@@ -1,0 +1,34 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.api; -+ -+import java.lang.annotation.Documented; -+import java.lang.annotation.Retention; -+import java.lang.annotation.RetentionPolicy; -+ -+@Documented -+@Retention(value = RetentionPolicy.RUNTIME) -+public @interface MPOnly { -+ public String author() default "SpoutDev"; -+ -+ public String version() default "1.0"; -+ -+ public String shortDescription() default "Indicates that the function or event only is used or runs when the client is in Multiplayer"; -+} ---- net/minecraft/src/EntityAITasks.java -+++ net/minecraft/src/EntityAITasks.java -@@ -5,76 +5,80 @@ - import java.util.List; - - public class EntityAITasks { -- private List a = new ArrayList(); -- private List b = new ArrayList(); -+ -+ /** A list of EntityAITaskEntrys in EntityAITasks. */ -+ private List taskEntries = new ArrayList(); -+ -+ /** A list of EntityAITaskEntrys that are currently being executed. */ -+ private List executingTaskEntries = new ArrayList(); -+ -+ /** Instance of Profiler. */ - private final Profiler theProfiler; - private int tickCount; - private int tickRate = 3; - -- public EntityAITasks(Profiler var1) { -- this.theProfiler = var1; -- } -- -- public void addTask(int var1, EntityAIBase var2) { -- this.a.add(new EntityAITaskEntry(this, var1, var2)); -- } -- -- public void removeTask(EntityAIBase var1) { -- Iterator var2 = this.a.iterator(); -- -- while(var2.hasNext()) { -+ public EntityAITasks(Profiler par1Profiler) { -+ this.theProfiler = par1Profiler; -+ } -+ -+ public void addTask(int par1, EntityAIBase par2EntityAIBase) { -+ this.taskEntries.add(new EntityAITaskEntry(this, par1, par2EntityAIBase)); -+ } -+ -+ /** -+ * removes the indicated task from the entity's AI tasks. -+ */ -+ public void removeTask(EntityAIBase par1EntityAIBase) { -+ Iterator var2 = this.taskEntries.iterator(); -+ -+ while (var2.hasNext()) { - EntityAITaskEntry var3 = (EntityAITaskEntry)var2.next(); - EntityAIBase var4 = var3.action; -- if(var4 == var1) { -- if(this.b.contains(var3)) { -+ -+ if (var4 == par1EntityAIBase) { -+ if (this.executingTaskEntries.contains(var3)) { - var4.resetTask(); -- this.b.remove(var3); -+ this.executingTaskEntries.remove(var3); - } - - var2.remove(); - } - } -- - } - - public void onUpdateTasks() { - ArrayList var1 = new ArrayList(); - Iterator var2; - EntityAITaskEntry var3; -- if(this.tickCount++ % this.tickRate == 0) { -- var2 = this.a.iterator(); -- -- label59: -- while(true) { -- while(true) { -- if(!var2.hasNext()) { -- break label59; -- } -- -- var3 = (EntityAITaskEntry)var2.next(); -- boolean var4 = this.b.contains(var3); -- if(!var4) { -- break; -- } -- -- if(!this.canUse(var3) || !this.canContinue(var3)) { -- var3.action.resetTask(); -- this.b.remove(var3); -- break; -- } -+ -+ if (this.tickCount++ % this.tickRate == 0) { -+ var2 = this.taskEntries.iterator(); -+ -+ while (var2.hasNext()) { -+ var3 = (EntityAITaskEntry)var2.next(); -+ boolean var4 = this.executingTaskEntries.contains(var3); -+ -+ if (var4) { -+ if (this.canUse(var3) && this.canContinue(var3)) { -+ continue; -+ } -+ -+ var3.action.resetTask(); -+ this.executingTaskEntries.remove(var3); - } - -- if(this.canUse(var3) && var3.action.shouldExecute()) { -+ if (this.canUse(var3) && var3.action.shouldExecute()) { - var1.add(var3); -- this.b.add(var3); -+ this.executingTaskEntries.add(var3); - } - } - } else { -- var2 = this.b.iterator(); -+ var2 = this.executingTaskEntries.iterator(); - -- while(var2.hasNext()) { -+ while (var2.hasNext()) { - var3 = (EntityAITaskEntry)var2.next(); -- if(!var3.action.continueExecuting()) { -+ -+ if (!var3.action.continueExecuting()) { - var3.action.resetTask(); - var2.remove(); - } -@@ -84,7 +88,7 @@ - this.theProfiler.startSection("goalStart"); - var2 = var1.iterator(); - -- while(var2.hasNext()) { -+ while (var2.hasNext()) { - var3 = (EntityAITaskEntry)var2.next(); - this.theProfiler.startSection(var3.action.getClass().getSimpleName()); - var3.action.startExecuting(); -@@ -93,9 +97,9 @@ - - this.theProfiler.endSection(); - this.theProfiler.startSection("goalTick"); -- var2 = this.b.iterator(); -+ var2 = this.executingTaskEntries.iterator(); - -- while(var2.hasNext()) { -+ while (var2.hasNext()) { - var3 = (EntityAITaskEntry)var2.next(); - var3.action.updateTask(); - } -@@ -103,26 +107,34 @@ - this.theProfiler.endSection(); - } - -- private boolean canContinue(EntityAITaskEntry var1) { -+ /** -+ * Determine if a specific AI Task should continue being executed. -+ */ -+ private boolean canContinue(EntityAITaskEntry par1EntityAITaskEntry) { - this.theProfiler.startSection("canContinue"); -- boolean var2 = var1.action.continueExecuting(); -+ boolean var2 = par1EntityAITaskEntry.action.continueExecuting(); - this.theProfiler.endSection(); - return var2; - } - -- private boolean canUse(EntityAITaskEntry var1) { -+ /** -+ * Determine if a specific AI Task can be executed, which means that all running higher (= lower int value) priority -+ * tasks are compatible with it or all lower priority tasks can be interrupted. -+ */ -+ private boolean canUse(EntityAITaskEntry par1EntityAITaskEntry) { - this.theProfiler.startSection("canUse"); -- Iterator var2 = this.a.iterator(); -+ Iterator var2 = this.taskEntries.iterator(); - -- while(var2.hasNext()) { -+ while (var2.hasNext()) { - EntityAITaskEntry var3 = (EntityAITaskEntry)var2.next(); -- if(var3 != var1) { -- if(var1.priority >= var3.priority) { -- if(this.b.contains(var3) && !this.areTasksCompatible(var1, var3)) { -+ -+ if (var3 != par1EntityAITaskEntry) { -+ if (par1EntityAITaskEntry.priority >= var3.priority) { -+ if (this.executingTaskEntries.contains(var3) && !this.areTasksCompatible(par1EntityAITaskEntry, var3)) { - this.theProfiler.endSection(); - return false; - } -- } else if(this.b.contains(var3) && !var3.action.isContinuous()) { -+ } else if (this.executingTaskEntries.contains(var3) && !var3.action.isInterruptible()) { - this.theProfiler.endSection(); - return false; - } -@@ -133,7 +145,10 @@ - return true; - } - -- private boolean areTasksCompatible(EntityAITaskEntry var1, EntityAITaskEntry var2) { -- return (var1.action.getMutexBits() & var2.action.getMutexBits()) == 0; -+ /** -+ * Returns whether two EntityAITaskEntries can be executed concurrently -+ */ -+ private boolean areTasksCompatible(EntityAITaskEntry par1EntityAITaskEntry, EntityAITaskEntry par2EntityAITaskEntry) { -+ return (par1EntityAITaskEntry.action.getMutexBits() & par2EntityAITaskEntry.action.getMutexBits()) == 0; - } - } ---- /dev/null -+++ org/spoutcraft/client/inventory/CraftItemStack.java -@@ -1,0 +1,145 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.client.inventory; -+ -+import org.spoutcraft.api.inventory.ItemStack; -+import org.spoutcraft.api.material.Material; -+ -+public class CraftItemStack extends ItemStack { -+ protected net.minecraft.src.ItemStack item; -+ -+ public CraftItemStack(net.minecraft.src.ItemStack item) { -+ super( -+ item != null ? item.itemID: 0, -+ item != null ? item.stackSize : 0, -+ (short)(item != null ? item.getItemDamage() : 0) -+ ); -+ this.item = item; -+ } -+ -+ /* 'Overwritten' constructors from ItemStack, yay for Java sucking */ -+ public CraftItemStack(final int type) { -+ this(type, 0); -+ } -+ -+ public CraftItemStack(final Material type) { -+ this(type, 0); -+ } -+ -+ public CraftItemStack(final int type, final int amount) { -+ this(type, amount, (byte) 0); -+ } -+ -+ public CraftItemStack(final Material type, final int amount) { -+ this(type.getRawId(), amount); -+ } -+ -+ public CraftItemStack(final int type, final int amount, final short damage) { -+ this(type, amount, damage, null); -+ } -+ -+ public CraftItemStack(final Material type, final int amount, final short damage) { -+ this(type.getRawId(), amount, damage); -+ } -+ -+ public CraftItemStack(final Material type, final int amount, final short damage, final Byte data) { -+ this(type.getRawId(), amount, damage, data); -+ } -+ -+ public CraftItemStack(int type, int amount, short damage, Byte data) { -+ this(new net.minecraft.src.ItemStack(type, amount, data != null ? data : damage)); -+ } -+ -+ /* -+ * Unsure if we have to sync before each of these calls the values in 'item' -+ * are all public. -+ */ -+ -+ @Override -+ public Material getType() { -+ super.setTypeId(item != null ? item.itemID : 0); // sync, needed? -+ return super.getType(); -+ } -+ -+ @Override -+ public int getTypeId() { -+ super.setTypeId(item != null ? item.itemID : 0); // sync, needed? -+ return item != null ? item.itemID : 0; -+ } -+ -+ @Override -+ public void setTypeId(int type) { -+ if (type == 0) { -+ super.setTypeId(0); -+ super.setAmount(0); -+ item = null; -+ } else { -+ if (item == null) { -+ item = new net.minecraft.src.ItemStack(type, 1, 0); -+ super.setAmount(1); -+ } else { -+ item.itemID = type; -+ super.setTypeId(item.itemID); -+ } -+ } -+ } -+ -+ @Override -+ public int getAmount() { -+ super.setAmount(item != null ? item.stackSize : 0); // sync, needed? -+ return (item != null ? item.stackSize : 0); -+ } -+ -+ @Override -+ public void setAmount(int amount) { -+ if (amount == 0) { -+ super.setTypeId(0); -+ super.setAmount(0); -+ item = null; -+ } else { -+ super.setAmount(amount); -+ item.stackSize = amount; -+ } -+ } -+ -+ @Override -+ public void setDurability(final short durability) { -+ // Ignore damage if item is null -+ if (item != null) { -+ super.setDurability(durability); -+ item.setItemDamage(durability); -+ } -+ } -+ -+ @Override -+ public short getDurability() { -+ if (item != null) { -+ super.setDurability((short) item.getItemDamage()); // sync, needed? -+ return (short) item.getItemDamage(); -+ } else { -+ return -1; -+ } -+ } -+ -+ @Override -+ public int getMaxStackSize() { -+ return item.getItem().getItemStackLimit(); -+ } -+} ---- net/minecraft/src/FlatLayerInfo.java -+++ net/minecraft/src/FlatLayerInfo.java -@@ -1,49 +1,71 @@ - package net.minecraft.src; - - public class FlatLayerInfo { -+ -+ /** Amount of layers for this set of layers. */ - private int layerCount; -+ -+ /** Block type used on this set of layers. */ - private int layerFillBlock; -+ -+ /** Block metadata used on this set of laeyrs. */ - private int layerFillBlockMeta; - private int layerMinimumY; - -- public FlatLayerInfo(int var1, int var2) { -+ public FlatLayerInfo(int par1, int par2) { - this.layerCount = 1; -- this.layerCount = var1; -- this.layerFillBlock = var2; -- } -- -- public FlatLayerInfo(int var1, int var2, int var3) { -- this(var1, var2); -- this.layerFillBlockMeta = var3; -- } -- -+ this.layerCount = par1; -+ this.layerFillBlock = par2; -+ } -+ -+ public FlatLayerInfo(int par1, int par2, int par3) { -+ this(par1, par2); -+ this.layerFillBlockMeta = par3; -+ } -+ -+ /** -+ * Return the amount of layers for this set of layers. -+ */ - public int getLayerCount() { - return this.layerCount; - } - -+ /** -+ * Return the block type used on this set of layers. -+ */ - public int getFillBlock() { - return this.layerFillBlock; - } - -+ /** -+ * Return the block metadata used on this set of layers. -+ */ - public int getFillBlockMeta() { - return this.layerFillBlockMeta; - } - -+ /** -+ * Return the minimum Y coordinate for this layer, set during generation. -+ */ - public int getMinY() { - return this.layerMinimumY; - } - -- public void setMinY(int var1) { -- this.layerMinimumY = var1; -+ /** -+ * Set the minimum Y coordinate for this layer. -+ */ -+ public void setMinY(int par1) { -+ this.layerMinimumY = par1; - } - - public String toString() { - String var1 = Integer.toString(this.layerFillBlock); -- if(this.layerCount > 1) { -+ -+ if (this.layerCount > 1) { - var1 = this.layerCount + "x" + var1; - } - -- if(this.layerFillBlockMeta > 0) { -+ if (this.layerFillBlockMeta > 0) { - var1 = var1 + ":" + this.layerFillBlockMeta; - } - ---- /dev/null -+++ org/spoutcraft/api/util/FastLocation.java -@@ -1,0 +1,59 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.api.util; -+ -+public class FastLocation extends FastVector implements FixedLocation { -+ private final double yaw; -+ private final double pitch; -+ -+ public FastLocation(int x, int y, int z, double yaw, double pitch) { -+ super(x, y, z); -+ this.yaw = yaw; -+ this.pitch = pitch; -+ } -+ -+ public double getYaw() { -+ return yaw; -+ } -+ -+ public double getPitch() { -+ return pitch; -+ } -+ -+ public Vector getDirection() { -+ Vector vector = new MutableVector(); -+ -+ double rotX = this.getYaw(); -+ double rotY = this.getPitch(); -+ -+ vector.setY(-Math.sin(Math.toRadians(rotY))); -+ -+ double h = Math.cos(Math.toRadians(rotY)); -+ -+ vector.setX(-h * Math.sin(Math.toRadians(rotX))); -+ vector.setZ(h * Math.cos(Math.toRadians(rotX))); -+ -+ return vector; -+ } -+ -+ public Vector toVector() { -+ return new MutableVector(x, y, z); -+ } -+} ---- net/minecraft/src/RenderMinecartMobSpawner.java -+++ net/minecraft/src/RenderMinecartMobSpawner.java -@@ -1,15 +1,18 @@ - package net.minecraft.src; - - public class RenderMinecartMobSpawner extends RenderMinecart { -- protected void func_98192_a(EntityMinecartMobSpawner var1, float var2, Block var3, int var4) { -- super.renderBlockInMinecart(var1, var2, var3, var4); -- if(var3 == Block.mobSpawner) { -- TileEntityMobSpawnerRenderer.func_98144_a(var1.func_98039_d(), var1.posX, var1.posY, var1.posZ, var2); -+ protected void func_98192_a(EntityMinecartMobSpawner par1EntityMinecartMobSpawner, float par2, Block par3Block, int par4) { -+ super.renderBlockInMinecart(par1EntityMinecartMobSpawner, par2, par3Block, par4); -+ -+ if (par3Block == Block.mobSpawner) { -+ TileEntityMobSpawnerRenderer.func_98144_a(par1EntityMinecartMobSpawner.func_98039_d(), par1EntityMinecartMobSpawner.posX, par1EntityMinecartMobSpawner.posY, par1EntityMinecartMobSpawner.posZ, par2); - } -- - } - -- protected void renderBlockInMinecart(EntityMinecart var1, float var2, Block var3, int var4) { -- this.func_98192_a((EntityMinecartMobSpawner)var1, var2, var3, var4); -+ /** -+ * Renders the block that is inside the minecart. -+ */ -+ protected void renderBlockInMinecart(EntityMinecart par1EntityMinecart, float par2, Block par3Block, int par4) { -+ this.func_98192_a((EntityMinecartMobSpawner)par1EntityMinecart, par2, par3Block, par4); - } - } ---- net/minecraft/src/GenLayerZoom.java -+++ net/minecraft/src/GenLayerZoom.java -@@ -1,28 +1,32 @@ - package net.minecraft.src; - - public class GenLayerZoom extends GenLayer { -- public GenLayerZoom(long var1, GenLayer var3) { -- super(var1); -- super.parent = var3; -+ public GenLayerZoom(long par1, GenLayer par3GenLayer) { -+ super(par1); -+ super.parent = par3GenLayer; - } - -- public int[] getInts(int var1, int var2, int var3, int var4) { -- int var5 = var1 >> 1; -- int var6 = var2 >> 1; -- int var7 = (var3 >> 1) + 3; -- int var8 = (var4 >> 1) + 3; -+ /** -+ * Returns a list of integer values generated by this layer. These may be interpreted as temperatures, rainfall -+ * amounts, or biomeList[] indices based on the particular GenLayer subclass. -+ */ -+ public int[] getInts(int par1, int par2, int par3, int par4) { -+ int var5 = par1 >> 1; -+ int var6 = par2 >> 1; -+ int var7 = (par3 >> 1) + 3; -+ int var8 = (par4 >> 1) + 3; - int[] var9 = this.parent.getInts(var5, var6, var7, var8); - int[] var10 = IntCache.getIntCache(var7 * 2 * var8 * 2); - int var11 = var7 << 1; -- - int var13; -- for(int var12 = 0; var12 < var8 - 1; ++var12) { -+ -+ for (int var12 = 0; var12 < var8 - 1; ++var12) { - var13 = var12 << 1; - int var14 = var13 * var11; - int var15 = var9[0 + (var12 + 0) * var7]; - int var16 = var9[0 + (var12 + 1) * var7]; - -- for(int var17 = 0; var17 < var7 - 1; ++var17) { -+ for (int var17 = 0; var17 < var7 - 1; ++var17) { - this.initChunkSeed((long)(var17 + var5 << 1), (long)(var12 + var6 << 1)); - int var18 = var9[var17 + 1 + (var12 + 0) * var7]; - int var19 = var9[var17 + 1 + (var12 + 1) * var7]; -@@ -35,63 +39,72 @@ - } - } - -- int[] var20 = IntCache.getIntCache(var3 * var4); -+ int[] var20 = IntCache.getIntCache(par3 * par4); - -- for(var13 = 0; var13 < var4; ++var13) { -- System.arraycopy(var10, (var13 + (var2 & 1)) * (var7 << 1) + (var1 & 1), var20, var13 * var3, var3); -+ for (var13 = 0; var13 < par4; ++var13) { -+ System.arraycopy(var10, (var13 + (par2 & 1)) * (var7 << 1) + (par1 & 1), var20, var13 * par3, par3); - } - - return var20; - } - -- protected int choose(int var1, int var2) { -- return this.nextInt(2) == 0 ? var1 : var2; -+ /** -+ * Chooses one of the two inputs randomly. -+ */ -+ protected int choose(int par1, int par2) { -+ return this.nextInt(2) == 0 ? par1 : par2; - } - -- protected int modeOrRandom(int var1, int var2, int var3, int var4) { -- if(var2 == var3 && var3 == var4) { -- return var2; -- } else if(var1 == var2 && var1 == var3) { -- return var1; -- } else if(var1 == var2 && var1 == var4) { -- return var1; -- } else if(var1 == var3 && var1 == var4) { -- return var1; -- } else if(var1 == var2 && var3 != var4) { -- return var1; -- } else if(var1 == var3 && var2 != var4) { -- return var1; -- } else if(var1 == var4 && var2 != var3) { -- return var1; -- } else if(var2 == var1 && var3 != var4) { -- return var2; -- } else if(var2 == var3 && var1 != var4) { -- return var2; -- } else if(var2 == var4 && var1 != var3) { -- return var2; -- } else if(var3 == var1 && var2 != var4) { -- return var3; -- } else if(var3 == var2 && var1 != var4) { -- return var3; -- } else if(var3 == var4 && var1 != var2) { -- return var3; -- } else if(var4 == var1 && var2 != var3) { -- return var3; -- } else if(var4 == var2 && var1 != var3) { -- return var3; -- } else if(var4 == var3 && var1 != var2) { -- return var3; -+ /** -+ * returns the mode (most frequently occuring number) or a random number from the 4 integers provided -+ */ -+ protected int modeOrRandom(int par1, int par2, int par3, int par4) { -+ if (par2 == par3 && par3 == par4) { -+ return par2; -+ } else if (par1 == par2 && par1 == par3) { -+ return par1; -+ } else if (par1 == par2 && par1 == par4) { -+ return par1; -+ } else if (par1 == par3 && par1 == par4) { -+ return par1; -+ } else if (par1 == par2 && par3 != par4) { -+ return par1; -+ } else if (par1 == par3 && par2 != par4) { -+ return par1; -+ } else if (par1 == par4 && par2 != par3) { -+ return par1; -+ } else if (par2 == par1 && par3 != par4) { -+ return par2; -+ } else if (par2 == par3 && par1 != par4) { -+ return par2; -+ } else if (par2 == par4 && par1 != par3) { -+ return par2; -+ } else if (par3 == par1 && par2 != par4) { -+ return par3; -+ } else if (par3 == par2 && par1 != par4) { -+ return par3; -+ } else if (par3 == par4 && par1 != par2) { -+ return par3; -+ } else if (par4 == par1 && par2 != par3) { -+ return par3; -+ } else if (par4 == par2 && par1 != par3) { -+ return par3; -+ } else if (par4 == par3 && par1 != par2) { -+ return par3; - } else { - int var5 = this.nextInt(4); -- return var5 == 0 ? var1 : (var5 == 1 ? var2 : (var5 == 2 ? var3 : var4)); -+ return var5 == 0 ? par1 : (var5 == 1 ? par2 : (var5 == 2 ? par3 : par4)); - } - } - -- public static GenLayer magnify(long var0, GenLayer var2, int var3) { -- Object var4 = var2; -+ /** -+ * Magnify a layer. Parms are seed adjustment, layer, number of times to magnify -+ */ -+ public static GenLayer magnify(long par0, GenLayer par2GenLayer, int par3) { -+ Object var4 = par2GenLayer; - -- for(int var5 = 0; var5 < var3; ++var5) { -- var4 = new GenLayerZoom(var0 + (long)var5, (GenLayer)var4); -+ for (int var5 = 0; var5 < par3; ++var5) { -+ var4 = new GenLayerZoom(par0 + (long)var5, (GenLayer)var4); - } - - return (GenLayer)var4; ---- net/minecraft/src/GuiGameOver.java -+++ net/minecraft/src/GuiGameOver.java -@@ -1,52 +1,74 @@ - package net.minecraft.src; - - import java.util.Iterator; -+ - import org.lwjgl.opengl.GL11; - -+import org.spoutcraft.client.gui.mainmenu.MainMenu; -+ - public class GuiGameOver extends GuiScreen { -+ -+ /** -+ * The cooldown timer for the buttons, increases every tick and enables all buttons when reaching 20. -+ */ - private int cooldownTimer; - -+ /** -+ * Adds the buttons (and other controls) to the screen in question. -+ */ - public void initGui() { -- this.i.clear(); -- if(this.mc.theWorld.getWorldInfo().isHardcoreModeEnabled()) { -- if(this.mc.isIntegratedServerRunning()) { -- this.i.add(new GuiButton(1, this.width / 2 - 100, this.height / 4 + 96, I18n.getString("deathScreen.deleteWorld"))); -+ this.buttonList.clear(); -+ -+ if (this.mc.theWorld.getWorldInfo().isHardcoreModeEnabled()) { -+ if (this.mc.isIntegratedServerRunning()) { -+ this.buttonList.add(new GuiButton(1, this.width / 2 - 100, this.height / 4 + 96, I18n.getString("deathScreen.deleteWorld"))); - } else { -- this.i.add(new GuiButton(1, this.width / 2 - 100, this.height / 4 + 96, I18n.getString("deathScreen.leaveServer"))); -+ this.buttonList.add(new GuiButton(1, this.width / 2 - 100, this.height / 4 + 96, I18n.getString("deathScreen.leaveServer"))); - } - } else { -- this.i.add(new GuiButton(1, this.width / 2 - 100, this.height / 4 + 72, I18n.getString("deathScreen.respawn"))); -- this.i.add(new GuiButton(2, this.width / 2 - 100, this.height / 4 + 96, I18n.getString("deathScreen.titleScreen"))); -- if(this.mc.getSession() == null) { -- ((GuiButton)this.i.get(1)).enabled = false; -+ this.buttonList.add(new GuiButton(1, this.width / 2 - 100, this.height / 4 + 72, I18n.getString("deathScreen.respawn"))); -+ this.buttonList.add(new GuiButton(2, this.width / 2 - 100, this.height / 4 + 96, I18n.getString("deathScreen.titleScreen"))); -+ -+ if (this.mc.getSession() == null) { -+ ((GuiButton)this.buttonList.get(1)).enabled = false; - } - } - - GuiButton var2; -- for(Iterator var1 = this.i.iterator(); var1.hasNext(); var2.enabled = false) { -+ -+ for (Iterator var1 = this.buttonList.iterator(); var1.hasNext(); var2.enabled = false) { - var2 = (GuiButton)var1.next(); - } -- -- } -- -- protected void keyTyped(char var1, int var2) { -- } -- -- protected void actionPerformed(GuiButton var1) { -- switch(var1.id) { -- case 1: -- this.mc.thePlayer.respawnPlayer(); -- this.mc.displayGuiScreen((GuiScreen)null); -- break; -- case 2: -- this.mc.theWorld.sendQuittingDisconnectingPacket(); -- this.mc.loadWorld((WorldClient)null); -- this.mc.displayGuiScreen(new GuiMainMenu()); -+ } -+ -+ /** -+ * Fired when a key is typed. This is the equivalent of KeyListener.keyTyped(KeyEvent e). -+ */ -+ protected void keyTyped(char par1, int par2) {} -+ -+ /** -+ * Fired when a control is clicked. This is the equivalent of ActionListener.actionPerformed(ActionEvent e). -+ */ -+ protected void actionPerformed(GuiButton par1GuiButton) { -+ switch (par1GuiButton.id) { -+ case 1: -+ this.mc.thePlayer.respawnPlayer(); -+ this.mc.displayGuiScreen((GuiScreen)null); -+ break; -+ -+ case 2: -+ this.mc.theWorld.sendQuittingDisconnectingPacket(); -+ this.mc.loadWorld((WorldClient)null); -+ // Spout Start -+ this.mc.displayGuiScreen(new MainMenu()); -+ // Spout End - } -- - } - -- public void drawScreen(int var1, int var2, float var3) { -+ /** -+ * Draws the screen and all the components in it. -+ */ -+ public void drawScreen(int par1, int par2, float par3) { - this.drawGradientRect(0, 0, this.width, this.height, 1615855616, -1602211792); - GL11.glPushMatrix(); - GL11.glScalef(2.0F, 2.0F, 2.0F); -@@ -54,27 +76,34 @@ - String var5 = var4 ? I18n.getString("deathScreen.title.hardcore") : I18n.getString("deathScreen.title"); - this.drawCenteredString(this.fontRenderer, var5, this.width / 2 / 2, 30, 16777215); - GL11.glPopMatrix(); -- if(var4) { -+ -+ if (var4) { - this.drawCenteredString(this.fontRenderer, I18n.getString("deathScreen.hardcoreInfo"), this.width / 2, 144, 16777215); - } - - this.drawCenteredString(this.fontRenderer, I18n.getString("deathScreen.score") + ": " + EnumChatFormatting.YELLOW + this.mc.thePlayer.getScore(), this.width / 2, 100, 16777215); -- super.drawScreen(var1, var2, var3); -+ super.drawScreen(par1, par2, par3); - } - -+ /** -+ * Returns true if this GUI should pause the game when it is displayed in single-player -+ */ - public boolean doesGuiPauseGame() { - return false; - } - -+ /** -+ * Called from the main game loop to update the screen. -+ */ - public void updateScreen() { - super.updateScreen(); - ++this.cooldownTimer; - GuiButton var2; -- if(this.cooldownTimer == 20) { -- for(Iterator var1 = this.i.iterator(); var1.hasNext(); var2.enabled = true) { -+ -+ if (this.cooldownTimer == 20) { -+ for (Iterator var1 = this.buttonList.iterator(); var1.hasNext(); var2.enabled = true) { - var2 = (GuiButton)var1.next(); - } - } -- - } - } ---- net/minecraft/src/EntityAgeable.java -+++ net/minecraft/src/EntityAgeable.java -@@ -4,31 +4,39 @@ - private float field_98056_d = -1.0F; - private float field_98057_e; - -- public EntityAgeable(World var1) { -- super(var1); -+ public EntityAgeable(World par1World) { -+ super(par1World); - } - - public abstract EntityAgeable createChild(EntityAgeable var1); - -- public boolean interact(EntityPlayer var1) { -- ItemStack var2 = var1.inventory.getCurrentItem(); -- if(var2 != null && var2.itemID == Item.monsterPlacer.itemID) { -- if(!this.worldObj.isRemote) { -+ /** -+ * Called when a player interacts with a mob. e.g. gets milk from a cow, gets into the saddle on a pig. -+ */ -+ public boolean interact(EntityPlayer par1EntityPlayer) { -+ ItemStack var2 = par1EntityPlayer.inventory.getCurrentItem(); -+ -+ if (var2 != null && var2.itemID == Item.monsterPlacer.itemID) { -+ if (!this.worldObj.isRemote) { - Class var3 = EntityList.getClassFromID(var2.getItemDamage()); -- if(var3 != null && var3.isAssignableFrom(this.getClass())) { -+ -+ if (var3 != null && var3.isAssignableFrom(this.getClass())) { - EntityAgeable var4 = this.createChild(this); -- if(var4 != null) { -+ -+ if (var4 != null) { - var4.setGrowingAge(-24000); - var4.setLocationAndAngles(this.posX, this.posY, this.posZ, 0.0F, 0.0F); - this.worldObj.spawnEntityInWorld(var4); -- if(var2.hasDisplayName()) { -+ -+ if (var2.hasDisplayName()) { - var4.setCustomNameTag(var2.getDisplayName()); - } - -- if(!var1.capabilities.isCreativeMode) { -+ if (!par1EntityPlayer.capabilities.isCreativeMode) { - --var2.stackSize; -- if(var2.stackSize <= 0) { -- var1.inventory.setInventorySlotContents(var1.inventory.currentItem, (ItemStack)null); -+ -+ if (var2.stackSize <= 0) { -+ par1EntityPlayer.inventory.setInventorySlotContents(par1EntityPlayer.inventory.currentItem, (ItemStack)null); - } - } - } -@@ -46,71 +54,105 @@ - this.dataWatcher.addObject(12, new Integer(0)); - } - -+ /** -+ * The age value may be negative or positive or zero. If it's negative, it get's incremented on each tick, if it's -+ * positive, it get's decremented each tick. Don't confuse this with EntityLiving.getAge. With a negative value the -+ * Entity is considered a child. -+ */ - public int getGrowingAge() { - return this.dataWatcher.getWatchableObjectInt(12); - } - -- public void addGrowth(int var1) { -+ /** -+ * "Adds the value of the parameter times 20 to the age of this entity. If the entity is an adult (if the entity's age -+ * is greater than 0), it will have no effect." -+ */ -+ public void addGrowth(int par1) { - int var2 = this.getGrowingAge(); -- var2 += var1 * 20; -- if(var2 > 0) { -+ var2 += par1 * 20; -+ -+ if (var2 > 0) { - var2 = 0; - } - - this.setGrowingAge(var2); - } - -- public void setGrowingAge(int var1) { -- this.dataWatcher.updateObject(12, Integer.valueOf(var1)); -+ /** -+ * The age value may be negative or positive or zero. If it's negative, it get's incremented on each tick, if it's -+ * positive, it get's decremented each tick. With a negative value the Entity is considered a child. -+ */ -+ public void setGrowingAge(int par1) { -+ this.dataWatcher.updateObject(12, Integer.valueOf(par1)); - this.setScaleForAge(this.isChild()); - } - -- public void writeEntityToNBT(NBTTagCompound var1) { -- super.writeEntityToNBT(var1); -- var1.setInteger("Age", this.getGrowingAge()); -- } -- -- public void readEntityFromNBT(NBTTagCompound var1) { -- super.readEntityFromNBT(var1); -- this.setGrowingAge(var1.getInteger("Age")); -- } -- -+ /** -+ * (abstract) Protected helper method to write subclass entity data to NBT. -+ */ -+ public void writeEntityToNBT(NBTTagCompound par1NBTTagCompound) { -+ super.writeEntityToNBT(par1NBTTagCompound); -+ par1NBTTagCompound.setInteger("Age", this.getGrowingAge()); -+ } -+ -+ /** -+ * (abstract) Protected helper method to read subclass entity data from NBT. -+ */ -+ public void readEntityFromNBT(NBTTagCompound par1NBTTagCompound) { -+ super.readEntityFromNBT(par1NBTTagCompound); -+ this.setGrowingAge(par1NBTTagCompound.getInteger("Age")); -+ } -+ -+ /** -+ * Called frequently so the entity can update its state every tick as required. For example, zombies and skeletons use -+ * this to react to sunlight and start to burn. -+ */ - public void onLivingUpdate() { - super.onLivingUpdate(); -- if(this.worldObj.isRemote) { -+ -+ if (this.worldObj.isRemote) { - this.setScaleForAge(this.isChild()); - } else { - int var1 = this.getGrowingAge(); -- if(var1 < 0) { -+ -+ if (var1 < 0) { - ++var1; - this.setGrowingAge(var1); -- } else if(var1 > 0) { -+ } else if (var1 > 0) { - --var1; - this.setGrowingAge(var1); - } - } -- - } - -+ /** -+ * If Animal, checks if the age timer is negative -+ */ - public boolean isChild() { - return this.getGrowingAge() < 0; - } - -- public void setScaleForAge(boolean var1) { -- this.setScale(var1 ? 0.5F : 1.0F); -+ /** -+ * "Sets the scale for an ageable entity according to the boolean parameter, which says if it's a child." -+ */ -+ public void setScaleForAge(boolean par1) { -+ this.setScale(par1 ? 0.5F : 1.0F); - } - -- protected final void setSize(float var1, float var2) { -+ /** -+ * Sets the width and height of the entity. Args: width, height -+ */ -+ protected final void setSize(float par1, float par2) { - boolean var3 = this.field_98056_d > 0.0F; -- this.field_98056_d = var1; -- this.field_98057_e = var2; -- if(!var3) { -+ this.field_98056_d = par1; -+ this.field_98057_e = par2; -+ -+ if (!var3) { - this.setScale(1.0F); - } -- - } - -- protected final void setScale(float var1) { -- super.setSize(this.field_98056_d * var1, this.field_98057_e * var1); -+ protected final void setScale(float par1) { -+ super.setSize(this.field_98056_d * par1, this.field_98057_e * par1); - } - } ---- net/minecraft/src/HttpUtil.java -+++ net/minecraft/src/HttpUtil.java -@@ -18,13 +18,18 @@ - import net.minecraft.server.MinecraftServer; - - public class HttpUtil { -- public static String buildPostString(Map var0) { -+ -+ /** -+ * Builds an encoded HTTP POST content string from a string map -+ */ -+ public static String buildPostString(Map par0Map) { - StringBuilder var1 = new StringBuilder(); -- Iterator var2 = var0.entrySet().iterator(); -+ Iterator var2 = par0Map.entrySet().iterator(); - -- while(var2.hasNext()) { -+ while (var2.hasNext()) { - Entry var3 = (Entry)var2.next(); -- if(var1.length() > 0) { -+ -+ if (var1.length() > 0) { - var1.append('&'); - } - -@@ -34,7 +39,7 @@ - var6.printStackTrace(); - } - -- if(var3.getValue() != null) { -+ if (var3.getValue() != null) { - var1.append('='); - - try { -@@ -48,48 +53,53 @@ - return var1.toString(); - } - -- public static String sendPost(ILogAgent var0, URL var1, Map var2, boolean var3) { -- return sendPost(var0, var1, buildPostString(var2), var3); -+ /** -+ * Sends a HTTP POST request to the given URL with data from a map -+ */ -+ public static String sendPost(ILogAgent par0ILogAgent, URL par1URL, Map par2Map, boolean par3) { -+ return sendPost(par0ILogAgent, par1URL, buildPostString(par2Map), par3); - } - -- private static String sendPost(ILogAgent var0, URL var1, String var2, boolean var3) { -+ /** -+ * Sends a HTTP POST request to the given URL with data from a string -+ */ -+ private static String sendPost(ILogAgent par0ILogAgent, URL par1URL, String par2Str, boolean par3) { - try { - Proxy var4 = MinecraftServer.getServer() == null ? null : MinecraftServer.getServer().getServerProxy(); -- if(var4 == null) { -+ -+ if (var4 == null) { - var4 = Proxy.NO_PROXY; - } - -- HttpURLConnection var5 = (HttpURLConnection)var1.openConnection(var4); -+ HttpURLConnection var5 = (HttpURLConnection)par1URL.openConnection(var4); - var5.setRequestMethod("POST"); - var5.setRequestProperty("Content-Type", "application/x-www-form-urlencoded"); -- var5.setRequestProperty("Content-Length", "" + var2.getBytes().length); -+ var5.setRequestProperty("Content-Length", "" + par2Str.getBytes().length); - var5.setRequestProperty("Content-Language", "en-US"); - var5.setUseCaches(false); - var5.setDoInput(true); - var5.setDoOutput(true); - DataOutputStream var6 = new DataOutputStream(var5.getOutputStream()); -- var6.writeBytes(var2); -+ var6.writeBytes(par2Str); - var6.flush(); - var6.close(); - BufferedReader var7 = new BufferedReader(new InputStreamReader(var5.getInputStream())); - StringBuffer var9 = new StringBuffer(); -- -- while(true) { -- String var8 = var7.readLine(); -- if(var8 == null) { -- var7.close(); -- return var9.toString(); -- } -- -+ String var8; -+ -+ while ((var8 = var7.readLine()) != null) { - var9.append(var8); - var9.append('\r'); - } -+ -+ var7.close(); -+ return var9.toString(); - } catch (Exception var10) { -- if(!var3) { -- if(var0 != null) { -- var0.logSevereException("Could not post to " + var1, var10); -+ if (!par3) { -+ if (par0ILogAgent != null) { -+ par0ILogAgent.logSevereException("Could not post to " + par1URL, var10); - } else { -- Logger.getAnonymousLogger().log(Level.SEVERE, "Could not post to " + var1, var10); -+ Logger.getAnonymousLogger().log(Level.SEVERE, "Could not post to " + par1URL, var10); - } - } - -@@ -100,19 +110,19 @@ - public static int func_76181_a() throws IOException { - ServerSocket var0 = null; - boolean var1 = true; -- - int var10; -+ - try { - var0 = new ServerSocket(0); - var10 = var0.getLocalPort(); - } finally { - try { -- if(var0 != null) { -+ if (var0 != null) { - var0.close(); - } - } catch (IOException var8) { -+ ; - } -- - } - - return var10; ---- net/minecraft/src/BackupList.java -+++ net/minecraft/src/BackupList.java -@@ -9,24 +9,27 @@ - import java.util.List; - - public class BackupList { -- public List a; -+ public List field_111223_a; - -- public static BackupList func_111222_a(String var0) { -+ public static BackupList func_111222_a(String par0Str) { - BackupList var1 = new BackupList(); -- var1.a = new ArrayList(); -+ var1.field_111223_a = new ArrayList(); - - try { -- JsonRootNode var2 = (new JdomParser()).parse(var0); -- if(var2.isArrayNode(new Object[]{"backups"})) { -- Iterator var3 = var2.getArrayNode(new Object[]{"backups"}).iterator(); -- -- while(var3.hasNext()) { -+ JsonRootNode var2 = (new JdomParser()).parse(par0Str); -+ -+ if (var2.isArrayNode(new Object[] {"backups"})) { -+ Iterator var3 = var2.getArrayNode(new Object[] {"backups"}).iterator(); -+ -+ while (var3.hasNext()) { - JsonNode var4 = (JsonNode)var3.next(); -- var1.a.add(Backup.func_110724_a(var4)); -+ var1.field_111223_a.add(Backup.func_110724_a(var4)); - } - } - } catch (InvalidSyntaxException var5) { -+ ; - } catch (IllegalArgumentException var6) { -+ ; - } - - return var1; ---- net/minecraft/src/BiomeCache.java -+++ net/minecraft/src/BiomeCache.java -@@ -5,58 +5,85 @@ - import net.minecraft.server.MinecraftServer; - - public class BiomeCache { -+ -+ /** Reference to the WorldChunkManager */ - private final WorldChunkManager chunkManager; -+ -+ /** The last time this BiomeCache was cleaned, in milliseconds. */ - private long lastCleanupTime; -+ -+ /** -+ * The map of keys to BiomeCacheBlocks. Keys are based on the chunk x, z coordinates as (x | z << 32). -+ */ - private LongHashMap cacheMap = new LongHashMap(); -- private List d = new ArrayList(); -- -- public BiomeCache(WorldChunkManager var1) { -- this.chunkManager = var1; -+ -+ /** The list of cached BiomeCacheBlocks */ -+ private List cache = new ArrayList(); -+ -+ public BiomeCache(WorldChunkManager par1WorldChunkManager) { -+ this.chunkManager = par1WorldChunkManager; - } - -- public BiomeCacheBlock getBiomeCacheBlock(int var1, int var2) { -- var1 >>= 4; -- var2 >>= 4; -- long var3 = (long)var1 & 4294967295L | ((long)var2 & 4294967295L) << 32; -+ /** -+ * Returns a biome cache block at location specified. -+ */ -+ public BiomeCacheBlock getBiomeCacheBlock(int par1, int par2) { -+ par1 >>= 4; -+ par2 >>= 4; -+ long var3 = (long)par1 & 4294967295L | ((long)par2 & 4294967295L) << 32; - BiomeCacheBlock var5 = (BiomeCacheBlock)this.cacheMap.getValueByKey(var3); -- if(var5 == null) { -- var5 = new BiomeCacheBlock(this, var1, var2); -+ -+ if (var5 == null) { -+ var5 = new BiomeCacheBlock(this, par1, par2); - this.cacheMap.add(var3, var5); -- this.d.add(var5); -+ this.cache.add(var5); - } - -- var5.lastAccessTime = MinecraftServer.getCurrentTimeMillis(); -+ var5.lastAccessTime = MinecraftServer.getSystemTimeMillis(); - return var5; - } - -- public BiomeGenBase getBiomeGenAt(int var1, int var2) { -- return this.getBiomeCacheBlock(var1, var2).getBiomeGenAt(var1, var2); -+ /** -+ * Returns the BiomeGenBase related to the x, z position from the cache. -+ */ -+ public BiomeGenBase getBiomeGenAt(int par1, int par2) { -+ return this.getBiomeCacheBlock(par1, par2).getBiomeGenAt(par1, par2); - } - -+ /** -+ * Removes BiomeCacheBlocks from this cache that haven't been accessed in at least 30 seconds. -+ */ - public void cleanupCache() { -- long var1 = MinecraftServer.getCurrentTimeMillis(); -+ long var1 = MinecraftServer.getSystemTimeMillis(); - long var3 = var1 - this.lastCleanupTime; -- if(var3 > 7500L || var3 < 0L) { -+ -+ if (var3 > 7500L || var3 < 0L) { - this.lastCleanupTime = var1; - -- for(int var5 = 0; var5 < this.d.size(); ++var5) { -- BiomeCacheBlock var6 = (BiomeCacheBlock)this.d.get(var5); -+ for (int var5 = 0; var5 < this.cache.size(); ++var5) { -+ BiomeCacheBlock var6 = (BiomeCacheBlock)this.cache.get(var5); - long var7 = var1 - var6.lastAccessTime; -- if(var7 > 30000L || var7 < 0L) { -- this.d.remove(var5--); -+ -+ if (var7 > 30000L || var7 < 0L) { -+ this.cache.remove(var5--); - long var9 = (long)var6.xPosition & 4294967295L | ((long)var6.zPosition & 4294967295L) << 32; - this.cacheMap.remove(var9); - } - } - } -- -- } -- -- public BiomeGenBase[] getCachedBiomes(int var1, int var2) { -- return this.getBiomeCacheBlock(var1, var2).biomes; -- } -- -- static WorldChunkManager getChunkManager(BiomeCache var0) { -- return var0.chunkManager; -+ } -+ -+ /** -+ * Returns the array of cached biome types in the BiomeCacheBlock at the given location. -+ */ -+ public BiomeGenBase[] getCachedBiomes(int par1, int par2) { -+ return this.getBiomeCacheBlock(par1, par2).biomes; -+ } -+ -+ /** -+ * Get the world chunk manager object for a biome list. -+ */ -+ static WorldChunkManager getChunkManager(BiomeCache par0BiomeCache) { -+ return par0BiomeCache.chunkManager; - } - } ---- net/minecraft/src/GuiSnooperList.java -+++ net/minecraft/src/GuiSnooperList.java -@@ -3,28 +3,35 @@ - class GuiSnooperList extends GuiSlot { - final GuiSnooper snooperGui; - -- public GuiSnooperList(GuiSnooper var1) { -- super(var1.mc, var1.width, var1.height, 80, var1.height - 40, var1.fontRenderer.FONT_HEIGHT + 1); -- this.snooperGui = var1; -+ public GuiSnooperList(GuiSnooper par1GuiSnooper) { -+ super(par1GuiSnooper.mc, par1GuiSnooper.width, par1GuiSnooper.height, 80, par1GuiSnooper.height - 40, par1GuiSnooper.fontRenderer.FONT_HEIGHT + 1); -+ this.snooperGui = par1GuiSnooper; - } - -+ /** -+ * Gets the size of the current slot list. -+ */ - protected int getSize() { - return GuiSnooper.func_74095_a(this.snooperGui).size(); - } - -- protected void elementClicked(int var1, boolean var2) { -- } -+ /** -+ * the element in the slot that was clicked, boolean for wether it was double clicked or not -+ */ -+ protected void elementClicked(int par1, boolean par2) {} - -- protected boolean isSelected(int var1) { -+ /** -+ * returns true if the element passed in is currently selected -+ */ -+ protected boolean isSelected(int par1) { - return false; - } - -- protected void drawBackground() { -- } -+ protected void drawBackground() {} - -- protected void drawSlot(int var1, int var2, int var3, int var4, Tessellator var5) { -- this.snooperGui.fontRenderer.drawString((String)GuiSnooper.func_74095_a(this.snooperGui).get(var1), 10, var3, 16777215); -- this.snooperGui.fontRenderer.drawString((String)GuiSnooper.func_74094_b(this.snooperGui).get(var1), 230, var3, 16777215); -+ protected void drawSlot(int par1, int par2, int par3, int par4, Tessellator par5Tessellator) { -+ this.snooperGui.fontRenderer.drawString((String)GuiSnooper.func_74095_a(this.snooperGui).get(par1), 10, par3, 16777215); -+ this.snooperGui.fontRenderer.drawString((String)GuiSnooper.func_74094_b(this.snooperGui).get(par1), 230, par3, 16777215); - } - - protected int getScrollBarX() { ---- net/minecraft/src/BlockCake.java -+++ net/minecraft/src/BlockCake.java -@@ -7,106 +7,160 @@ - private Icon cakeBottomIcon; - private Icon field_94382_c; - -- protected BlockCake(int var1) { -- super(var1, Material.cake); -+ protected BlockCake(int par1) { -+ super(par1, Material.cake); - this.setTickRandomly(true); - } - -- public void setBlockBoundsBasedOnState(IBlockAccess var1, int var2, int var3, int var4) { -- int var5 = var1.getBlockMetadata(var2, var3, var4); -- float var6 = 1.0F / 16.0F; -+ /** -+ * Updates the blocks bounds based on its current state. Args: world, x, y, z -+ */ -+ public void setBlockBoundsBasedOnState(IBlockAccess par1IBlockAccess, int par2, int par3, int par4) { -+ int var5 = par1IBlockAccess.getBlockMetadata(par2, par3, par4); -+ float var6 = 0.0625F; - float var7 = (float)(1 + var5 * 2) / 16.0F; - float var8 = 0.5F; - this.setBlockBounds(var7, 0.0F, var6, 1.0F - var6, var8, 1.0F - var6); - } - -+ /** -+ * Sets the block's bounds for rendering it as an item -+ */ - public void setBlockBoundsForItemRender() { -- float var1 = 1.0F / 16.0F; -+ float var1 = 0.0625F; - float var2 = 0.5F; - this.setBlockBounds(var1, 0.0F, var1, 1.0F - var1, var2, 1.0F - var1); - } - -- public AxisAlignedBB getCollisionBoundingBoxFromPool(World var1, int var2, int var3, int var4) { -- int var5 = var1.getBlockMetadata(var2, var3, var4); -- float var6 = 1.0F / 16.0F; -- float var7 = (float)(1 + var5 * 2) / 16.0F; -- float var8 = 0.5F; -- return AxisAlignedBB.getAABBPool().getAABB((double)((float)var2 + var7), (double)var3, (double)((float)var4 + var6), (double)((float)(var2 + 1) - var6), (double)((float)var3 + var8 - var6), (double)((float)(var4 + 1) - var6)); -- } -- -- public AxisAlignedBB getSelectedBoundingBoxFromPool(World var1, int var2, int var3, int var4) { -- int var5 = var1.getBlockMetadata(var2, var3, var4); -- float var6 = 1.0F / 16.0F; -- float var7 = (float)(1 + var5 * 2) / 16.0F; -- float var8 = 0.5F; -- return AxisAlignedBB.getAABBPool().getAABB((double)((float)var2 + var7), (double)var3, (double)((float)var4 + var6), (double)((float)(var2 + 1) - var6), (double)((float)var3 + var8), (double)((float)(var4 + 1) - var6)); -- } -- -- public Icon getIcon(int var1, int var2) { -- return var1 == 1 ? this.cakeTopIcon : (var1 == 0 ? this.cakeBottomIcon : (var2 > 0 && var1 == 4 ? this.field_94382_c : this.blockIcon)); -- } -- -- public void registerIcons(IconRegister var1) { -- this.blockIcon = var1.registerIcon(this.getTextureName() + "_side"); -- this.field_94382_c = var1.registerIcon(this.getTextureName() + "_inner"); -- this.cakeTopIcon = var1.registerIcon(this.getTextureName() + "_top"); -- this.cakeBottomIcon = var1.registerIcon(this.getTextureName() + "_bottom"); -- } -- -+ /** -+ * Returns a bounding box from the pool of bounding boxes (this means this box can change after the pool has been -+ * cleared to be reused) -+ */ -+ public AxisAlignedBB getCollisionBoundingBoxFromPool(World par1World, int par2, int par3, int par4) { -+ int var5 = par1World.getBlockMetadata(par2, par3, par4); -+ float var6 = 0.0625F; -+ float var7 = (float)(1 + var5 * 2) / 16.0F; -+ float var8 = 0.5F; -+ return AxisAlignedBB.getAABBPool().getAABB((double)((float)par2 + var7), (double)par3, (double)((float)par4 + var6), (double)((float)(par2 + 1) - var6), (double)((float)par3 + var8 - var6), (double)((float)(par4 + 1) - var6)); -+ } -+ -+ /** -+ * Returns the bounding box of the wired rectangular prism to render. -+ */ -+ public AxisAlignedBB getSelectedBoundingBoxFromPool(World par1World, int par2, int par3, int par4) { -+ int var5 = par1World.getBlockMetadata(par2, par3, par4); -+ float var6 = 0.0625F; -+ float var7 = (float)(1 + var5 * 2) / 16.0F; -+ float var8 = 0.5F; -+ return AxisAlignedBB.getAABBPool().getAABB((double)((float)par2 + var7), (double)par3, (double)((float)par4 + var6), (double)((float)(par2 + 1) - var6), (double)((float)par3 + var8), (double)((float)(par4 + 1) - var6)); -+ } -+ -+ /** -+ * From the specified side and block metadata retrieves the blocks texture. Args: side, metadata -+ */ -+ public Icon getIcon(int par1, int par2) { -+ return par1 == 1 ? this.cakeTopIcon : (par1 == 0 ? this.cakeBottomIcon : (par2 > 0 && par1 == 4 ? this.field_94382_c : this.blockIcon)); -+ } -+ -+ /** -+ * When this method is called, your block should register all the icons it needs with the given IconRegister. This is -+ * the only chance you get to register icons. -+ */ -+ public void registerIcons(IconRegister par1IconRegister) { -+ this.blockIcon = par1IconRegister.registerIcon(this.getTextureName() + "_side"); -+ this.field_94382_c = par1IconRegister.registerIcon(this.getTextureName() + "_inner"); -+ this.cakeTopIcon = par1IconRegister.registerIcon(this.getTextureName() + "_top"); -+ this.cakeBottomIcon = par1IconRegister.registerIcon(this.getTextureName() + "_bottom"); -+ } -+ -+ /** -+ * If this block doesn't render as an ordinary block it will return False (examples: signs, buttons, stairs, etc) -+ */ - public boolean renderAsNormalBlock() { - return false; - } - -+ /** -+ * Is this block (a) opaque and (b) a full 1m cube? This determines whether or not to render the shared face of two -+ * adjacent blocks and also whether the player can attach torches, redstone wire, etc to this block. -+ */ - public boolean isOpaqueCube() { - return false; - } - -- public boolean onBlockActivated(World var1, int var2, int var3, int var4, EntityPlayer var5, int var6, float var7, float var8, float var9) { -- this.eatCakeSlice(var1, var2, var3, var4, var5); -+ /** -+ * Called upon block activation (right click on the block.) -+ */ -+ public boolean onBlockActivated(World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer, int par6, float par7, float par8, float par9) { -+ this.eatCakeSlice(par1World, par2, par3, par4, par5EntityPlayer); - return true; - } - -- public void onBlockClicked(World var1, int var2, int var3, int var4, EntityPlayer var5) { -- this.eatCakeSlice(var1, var2, var3, var4, var5); -+ /** -+ * Called when the block is clicked by a player. Args: x, y, z, entityPlayer -+ */ -+ public void onBlockClicked(World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer) { -+ this.eatCakeSlice(par1World, par2, par3, par4, par5EntityPlayer); - } - -- private void eatCakeSlice(World var1, int var2, int var3, int var4, EntityPlayer var5) { -- if(var5.canEat(false)) { -- var5.getFoodStats().addStats(2, 0.1F); -- int var6 = var1.getBlockMetadata(var2, var3, var4) + 1; -- if(var6 >= 6) { -- var1.setBlockToAir(var2, var3, var4); -+ /** -+ * Heals the player and removes a slice from the cake. -+ */ -+ private void eatCakeSlice(World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer) { -+ if (par5EntityPlayer.canEat(false)) { -+ par5EntityPlayer.getFoodStats().addStats(2, 0.1F); -+ int var6 = par1World.getBlockMetadata(par2, par3, par4) + 1; -+ -+ if (var6 >= 6) { -+ par1World.setBlockToAir(par2, par3, par4); - } else { -- var1.setBlockMetadata(var2, var3, var4, var6, 2); -+ par1World.setBlockMetadataWithNotify(par2, par3, par4, var6, 2); - } - } -- -- } -- -- public boolean canPlaceBlockAt(World var1, int var2, int var3, int var4) { -- return !super.canPlaceBlockAt(var1, var2, var3, var4) ? false : this.canBlockStay(var1, var2, var3, var4); -- } -- -- public void onNeighborBlockChange(World var1, int var2, int var3, int var4, int var5) { -- if(!this.canBlockStay(var1, var2, var3, var4)) { -- var1.setBlockToAir(var2, var3, var4); -+ } -+ -+ /** -+ * Checks to see if its valid to put this block at the specified coordinates. Args: world, x, y, z -+ */ -+ public boolean canPlaceBlockAt(World par1World, int par2, int par3, int par4) { -+ return !super.canPlaceBlockAt(par1World, par2, par3, par4) ? false : this.canBlockStay(par1World, par2, par3, par4); -+ } -+ -+ /** -+ * Lets the block know when one of its neighbor changes. Doesn't know which neighbor changed (coordinates passed are -+ * their own) Args: x, y, z, neighbor blockID -+ */ -+ public void onNeighborBlockChange(World par1World, int par2, int par3, int par4, int par5) { -+ if (!this.canBlockStay(par1World, par2, par3, par4)) { -+ par1World.setBlockToAir(par2, par3, par4); - } -- -- } -- -- public boolean canBlockStay(World var1, int var2, int var3, int var4) { -- return var1.getBlockMaterial(var2, var3 - 1, var4).isSolid(); -- } -- -- public int quantityDropped(Random var1) { -- return 0; -- } -- -- public int idDropped(int var1, Random var2, int var3) { -- return 0; -- } -- -- public int idPicked(World var1, int var2, int var3, int var4) { -+ } -+ -+ /** -+ * Can this block stay at this position. Similar to canPlaceBlockAt except gets checked often with plants. -+ */ -+ public boolean canBlockStay(World par1World, int par2, int par3, int par4) { -+ return par1World.getBlockMaterial(par2, par3 - 1, par4).isSolid(); -+ } -+ -+ /** -+ * Returns the quantity of items to drop on block destruction. -+ */ -+ public int quantityDropped(Random par1Random) { -+ return 0; -+ } -+ -+ /** -+ * Returns the ID of the items to drop on destruction. -+ */ -+ public int idDropped(int par1, Random par2Random, int par3) { -+ return 0; -+ } -+ -+ /** -+ * only called by clickMiddleMouseButton , and passed to inventory.setCurrentItem (along with isCreative) -+ */ -+ public int idPicked(World par1World, int par2, int par3, int par4) { - return Item.cake.itemID; - } - } ---- net/minecraft/src/EntityAmbientCreature.java -+++ net/minecraft/src/EntityAmbientCreature.java -@@ -1,15 +1,18 @@ - package net.minecraft.src; - - public abstract class EntityAmbientCreature extends EntityLiving implements IAnimals { -- public EntityAmbientCreature(World var1) { -- super(var1); -+ public EntityAmbientCreature(World par1World) { -+ super(par1World); - } - - public boolean allowLeashing() { - return false; - } - -- protected boolean interact(EntityPlayer var1) { -+ /** -+ * Called when a player interacts with a mob. e.g. gets milk from a cow, gets into the saddle on a pig. -+ */ -+ protected boolean interact(EntityPlayer par1EntityPlayer) { - return false; - } - } ---- net/minecraft/src/CallableServerMemoryStats.java -+++ net/minecraft/src/CallableServerMemoryStats.java -@@ -4,14 +4,16 @@ - import net.minecraft.server.MinecraftServer; - - public class CallableServerMemoryStats implements Callable { -- final MinecraftServer a; -- -- public CallableServerMemoryStats(MinecraftServer var1) { -- this.a = var1; -+ -+ /** Reference to the MinecraftServer object. */ -+ final MinecraftServer mcServer; -+ -+ public CallableServerMemoryStats(MinecraftServer par1MinecraftServer) { -+ this.mcServer = par1MinecraftServer; - } - - public String callServerMemoryStats() { -- return MinecraftServer.getServerConfigurationManager(this.a).getCurrentPlayerCount() + " / " + MinecraftServer.getServerConfigurationManager(this.a).getMaxPlayers() + "; " + MinecraftServer.getServerConfigurationManager(this.a).a; -+ return MinecraftServer.getServerConfigurationManager(this.mcServer).getCurrentPlayerCount() + " / " + MinecraftServer.getServerConfigurationManager(this.mcServer).getMaxPlayers() + "; " + MinecraftServer.getServerConfigurationManager(this.mcServer).playerEntityList; - } - - public Object call() { ---- net/minecraft/src/RenderGhast.java -+++ net/minecraft/src/RenderGhast.java -@@ -10,13 +10,17 @@ - super(new ModelGhast(), 0.5F); - } - -- protected ResourceLocation func_110867_a(EntityGhast var1) { -- return var1.func_110182_bF() ? ghastShootingTextures : ghastTextures; -+ protected ResourceLocation func_110867_a(EntityGhast par1EntityGhast) { -+ return par1EntityGhast.func_110182_bF() ? ghastShootingTextures : ghastTextures; - } - -- protected void preRenderGhast(EntityGhast var1, float var2) { -- float var4 = ((float)var1.prevAttackCounter + (float)(var1.attackCounter - var1.prevAttackCounter) * var2) / 20.0F; -- if(var4 < 0.0F) { -+ /** -+ * Pre-Renders the Ghast. -+ */ -+ protected void preRenderGhast(EntityGhast par1EntityGhast, float par2) { -+ float var4 = ((float)par1EntityGhast.prevAttackCounter + (float)(par1EntityGhast.attackCounter - par1EntityGhast.prevAttackCounter) * par2) / 20.0F; -+ -+ if (var4 < 0.0F) { - var4 = 0.0F; - } - -@@ -27,11 +31,18 @@ - GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - } - -- protected void preRenderCallback(EntityLivingBase var1, float var2) { -- this.preRenderGhast((EntityGhast)var1, var2); -+ /** -+ * Allows the render to do any OpenGL state modifications necessary before the model is rendered. Args: entityLiving, -+ * partialTickTime -+ */ -+ protected void preRenderCallback(EntityLivingBase par1EntityLivingBase, float par2) { -+ this.preRenderGhast((EntityGhast)par1EntityLivingBase, par2); - } - -- protected ResourceLocation getEntityTexture(Entity var1) { -- return this.func_110867_a((EntityGhast)var1); -+ /** -+ * Returns the location of an entity's texture. Doesn't seem to be called unless you call Render.bindEntityTexture. -+ */ -+ protected ResourceLocation getEntityTexture(Entity par1Entity) { -+ return this.func_110867_a((EntityGhast)par1Entity); - } - } ---- net/minecraft/src/MouseFilter.java -+++ net/minecraft/src/MouseFilter.java -@@ -5,15 +5,19 @@ - private float field_76334_b; - private float field_76335_c; - -- public float smooth(float var1, float var2) { -- this.field_76336_a += var1; -- var1 = (this.field_76336_a - this.field_76334_b) * var2; -- this.field_76335_c += (var1 - this.field_76335_c) * 0.5F; -- if(var1 > 0.0F && var1 > this.field_76335_c || var1 < 0.0F && var1 < this.field_76335_c) { -- var1 = this.field_76335_c; -+ /** -+ * Smooths mouse input -+ */ -+ public float smooth(float par1, float par2) { -+ this.field_76336_a += par1; -+ par1 = (this.field_76336_a - this.field_76334_b) * par2; -+ this.field_76335_c += (par1 - this.field_76335_c) * 0.5F; -+ -+ if (par1 > 0.0F && par1 > this.field_76335_c || par1 < 0.0F && par1 < this.field_76335_c) { -+ par1 = this.field_76335_c; - } - -- this.field_76334_b += var1; -- return var1; -+ this.field_76334_b += par1; -+ return par1; - } - } ---- net/minecraft/src/TexturedQuad.java -+++ net/minecraft/src/TexturedQuad.java -@@ -5,47 +5,48 @@ - public int nVertices; - private boolean invertNormal; - -- public TexturedQuad(PositionTextureVertex[] var1) { -- this.vertexPositions = var1; -- this.nVertices = var1.length; -+ public TexturedQuad(PositionTextureVertex[] par1ArrayOfPositionTextureVertex) { -+ this.vertexPositions = par1ArrayOfPositionTextureVertex; -+ this.nVertices = par1ArrayOfPositionTextureVertex.length; - } - -- public TexturedQuad(PositionTextureVertex[] var1, int var2, int var3, int var4, int var5, float var6, float var7) { -- this(var1); -- float var8 = 0.0F / var6; -- float var9 = 0.0F / var7; -- var1[0] = var1[0].setTexturePosition((float)var4 / var6 - var8, (float)var3 / var7 + var9); -- var1[1] = var1[1].setTexturePosition((float)var2 / var6 + var8, (float)var3 / var7 + var9); -- var1[2] = var1[2].setTexturePosition((float)var2 / var6 + var8, (float)var5 / var7 - var9); -- var1[3] = var1[3].setTexturePosition((float)var4 / var6 - var8, (float)var5 / var7 - var9); -+ public TexturedQuad(PositionTextureVertex[] par1ArrayOfPositionTextureVertex, int par2, int par3, int par4, int par5, float par6, float par7) { -+ this(par1ArrayOfPositionTextureVertex); -+ float var8 = 0.0F / par6; -+ float var9 = 0.0F / par7; -+ par1ArrayOfPositionTextureVertex[0] = par1ArrayOfPositionTextureVertex[0].setTexturePosition((float)par4 / par6 - var8, (float)par3 / par7 + var9); -+ par1ArrayOfPositionTextureVertex[1] = par1ArrayOfPositionTextureVertex[1].setTexturePosition((float)par2 / par6 + var8, (float)par3 / par7 + var9); -+ par1ArrayOfPositionTextureVertex[2] = par1ArrayOfPositionTextureVertex[2].setTexturePosition((float)par2 / par6 + var8, (float)par5 / par7 - var9); -+ par1ArrayOfPositionTextureVertex[3] = par1ArrayOfPositionTextureVertex[3].setTexturePosition((float)par4 / par6 - var8, (float)par5 / par7 - var9); - } - - public void flipFace() { - PositionTextureVertex[] var1 = new PositionTextureVertex[this.vertexPositions.length]; - -- for(int var2 = 0; var2 < this.vertexPositions.length; ++var2) { -+ for (int var2 = 0; var2 < this.vertexPositions.length; ++var2) { - var1[var2] = this.vertexPositions[this.vertexPositions.length - var2 - 1]; - } - - this.vertexPositions = var1; - } - -- public void draw(Tessellator var1, float var2) { -+ public void draw(Tessellator par1Tessellator, float par2) { - Vec3 var3 = this.vertexPositions[1].vector3D.subtract(this.vertexPositions[0].vector3D); - Vec3 var4 = this.vertexPositions[1].vector3D.subtract(this.vertexPositions[2].vector3D); - Vec3 var5 = var4.crossProduct(var3).normalize(); -- var1.startDrawingQuads(); -- if(this.invertNormal) { -- var1.setNormal(-((float)var5.xCoord), -((float)var5.yCoord), -((float)var5.zCoord)); -+ par1Tessellator.startDrawingQuads(); -+ -+ if (this.invertNormal) { -+ par1Tessellator.setNormal(-((float)var5.xCoord), -((float)var5.yCoord), -((float)var5.zCoord)); - } else { -- var1.setNormal((float)var5.xCoord, (float)var5.yCoord, (float)var5.zCoord); -+ par1Tessellator.setNormal((float)var5.xCoord, (float)var5.yCoord, (float)var5.zCoord); - } - -- for(int var6 = 0; var6 < 4; ++var6) { -+ for (int var6 = 0; var6 < 4; ++var6) { - PositionTextureVertex var7 = this.vertexPositions[var6]; -- var1.addVertexWithUV((double)((float)var7.vector3D.xCoord * var2), (double)((float)var7.vector3D.yCoord * var2), (double)((float)var7.vector3D.zCoord * var2), (double)var7.texturePositionX, (double)var7.texturePositionY); -+ par1Tessellator.addVertexWithUV((double)((float)var7.vector3D.xCoord * par2), (double)((float)var7.vector3D.yCoord * par2), (double)((float)var7.vector3D.zCoord * par2), (double)var7.texturePositionX, (double)var7.texturePositionY); - } - -- var1.draw(); -+ par1Tessellator.draw(); - } - } ---- net/minecraft/src/PathPoint.java -+++ net/minecraft/src/PathPoint.java -@@ -1,47 +1,70 @@ - package net.minecraft.src; - - public class PathPoint { -+ -+ /** The x coordinate of this point */ - public final int xCoord; -+ -+ /** The y coordinate of this point */ - public final int yCoord; -+ -+ /** The z coordinate of this point */ - public final int zCoord; -+ -+ /** A hash of the coordinates used to identify this point */ - private final int hash; -+ -+ /** The index of this point in its assigned path */ - int index = -1; -+ -+ /** The distance along the path to this point */ - float totalPathDistance; -+ -+ /** The linear distance to the next point */ - float distanceToNext; -+ -+ /** The distance to the target */ - float distanceToTarget; -+ -+ /** The point preceding this in its assigned path */ - PathPoint previous; -+ -+ /** Indicates this is the origin */ - public boolean isFirst; - -- public PathPoint(int var1, int var2, int var3) { -- this.xCoord = var1; -- this.yCoord = var2; -- this.zCoord = var3; -- this.hash = makeHash(var1, var2, var3); -- } -- -- public static int makeHash(int var0, int var1, int var2) { -- return var1 & 255 | (var0 & Short.MAX_VALUE) << 8 | (var2 & Short.MAX_VALUE) << 24 | (var0 < 0 ? Integer.MIN_VALUE : 0) | (var2 < 0 ? -Short.MIN_VALUE : 0); -- } -- -- public float distanceTo(PathPoint var1) { -- float var2 = (float)(var1.xCoord - this.xCoord); -- float var3 = (float)(var1.yCoord - this.yCoord); -- float var4 = (float)(var1.zCoord - this.zCoord); -+ public PathPoint(int par1, int par2, int par3) { -+ this.xCoord = par1; -+ this.yCoord = par2; -+ this.zCoord = par3; -+ this.hash = makeHash(par1, par2, par3); -+ } -+ -+ public static int makeHash(int par0, int par1, int par2) { -+ return par1 & 255 | (par0 & 32767) << 8 | (par2 & 32767) << 24 | (par0 < 0 ? Integer.MIN_VALUE : 0) | (par2 < 0 ? 32768 : 0); -+ } -+ -+ /** -+ * Returns the linear distance to another path point -+ */ -+ public float distanceTo(PathPoint par1PathPoint) { -+ float var2 = (float)(par1PathPoint.xCoord - this.xCoord); -+ float var3 = (float)(par1PathPoint.yCoord - this.yCoord); -+ float var4 = (float)(par1PathPoint.zCoord - this.zCoord); - return MathHelper.sqrt_float(var2 * var2 + var3 * var3 + var4 * var4); - } - -- public float func_75832_b(PathPoint var1) { -- float var2 = (float)(var1.xCoord - this.xCoord); -- float var3 = (float)(var1.yCoord - this.yCoord); -- float var4 = (float)(var1.zCoord - this.zCoord); -+ public float func_75832_b(PathPoint par1PathPoint) { -+ float var2 = (float)(par1PathPoint.xCoord - this.xCoord); -+ float var3 = (float)(par1PathPoint.yCoord - this.yCoord); -+ float var4 = (float)(par1PathPoint.zCoord - this.zCoord); - return var2 * var2 + var3 * var3 + var4 * var4; - } - -- public boolean equals(Object var1) { -- if(!(var1 instanceof PathPoint)) { -+ public boolean equals(Object par1Obj) { -+ if (!(par1Obj instanceof PathPoint)) { - return false; - } else { -- PathPoint var2 = (PathPoint)var1; -+ PathPoint var2 = (PathPoint)par1Obj; - return this.hash == var2.hash && this.xCoord == var2.xCoord && this.yCoord == var2.yCoord && this.zCoord == var2.zCoord; - } - } -@@ -50,6 +73,9 @@ - return this.hash; - } - -+ /** -+ * Returns true if this point has already been assigned to a path -+ */ - public boolean isAssigned() { - return this.index >= 0; - } ---- net/minecraft/src/LoadingScreenRenderer.java -+++ net/minecraft/src/LoadingScreenRenderer.java -@@ -4,30 +4,44 @@ - import org.lwjgl.opengl.GL11; - - public class LoadingScreenRenderer implements IProgressUpdate { -- private String a = ""; -+ private String field_73727_a = ""; -+ -+ /** A reference to the Minecraft object. */ - private Minecraft mc; -- private String c = ""; -+ -+ /** -+ * The text currently displayed (i.e. the argument to the last call to printText or func_73722_d) -+ */ -+ private String currentlyDisplayedText = ""; - private long field_73723_d = Minecraft.getSystemTime(); - private boolean field_73724_e; - -- public LoadingScreenRenderer(Minecraft var1) { -- this.mc = var1; -+ public LoadingScreenRenderer(Minecraft par1Minecraft) { -+ this.mc = par1Minecraft; - } - -- public void resetProgressAndMessage(String var1) { -+ /** -+ * this string, followed by "working..." and then the "% complete" are the 3 lines shown. This resets progress to 0, -+ * and the WorkingString to "working...". -+ */ -+ public void resetProgressAndMessage(String par1Str) { - this.field_73724_e = false; -- this.func_73722_d(var1); -+ this.func_73722_d(par1Str); - } - -- public void displaySavingString(String var1) { -+ /** -+ * "Saving level", or the loading,or downloading equivelent -+ */ -+ public void displayProgressMessage(String par1Str) { - this.field_73724_e = true; -- this.func_73722_d(var1); -+ this.func_73722_d(par1Str); - } - -- public void func_73722_d(String var1) { -- this.c = var1; -- if(!this.mc.running) { -- if(!this.field_73724_e) { -+ public void func_73722_d(String par1Str) { -+ this.currentlyDisplayedText = par1Str; -+ -+ if (!this.mc.running) { -+ if (!this.field_73724_e) { - throw new MinecraftError(); - } - } else { -@@ -42,27 +56,34 @@ - } - } - -- public void displayLoadingString(String var1) { -- if(!this.mc.running) { -- if(!this.field_73724_e) { -+ /** -+ * This is called with "Working..." by resetProgressAndMessage -+ */ -+ public void resetProgresAndWorkingMessage(String par1Str) { -+ if (!this.mc.running) { -+ if (!this.field_73724_e) { - throw new MinecraftError(); - } - } else { - this.field_73723_d = 0L; -- this.a = var1; -+ this.field_73727_a = par1Str; - this.setLoadingProgress(-1); - this.field_73723_d = 0L; - } - } - -- public void setLoadingProgress(int var1) { -- if(!this.mc.running) { -- if(!this.field_73724_e) { -+ /** -+ * Updates the progress bar on the loading screen to the specified amount. Args: loadProgress -+ */ -+ public void setLoadingProgress(int par1) { -+ if (!this.mc.running) { -+ if (!this.field_73724_e) { - throw new MinecraftError(); - } - } else { - long var2 = Minecraft.getSystemTime(); -- if(var2 - this.field_73723_d >= 100L) { -+ -+ if (var2 - this.field_73723_d >= 100L) { - this.field_73723_d = var2; - ScaledResolution var4 = new ScaledResolution(this.mc.gameSettings, this.mc.displayWidth, this.mc.displayHeight); - int var5 = var4.getScaledWidth(); -@@ -74,7 +95,7 @@ - GL11.glMatrixMode(GL11.GL_MODELVIEW); - GL11.glLoadIdentity(); - GL11.glTranslatef(0.0F, 0.0F, -200.0F); -- GL11.glClear(GL11.GL_DEPTH_BUFFER_BIT | GL11.GL_COLOR_BUFFER_BIT); -+ GL11.glClear(GL11.GL_COLOR_BUFFER_BIT | GL11.GL_DEPTH_BUFFER_BIT); - Tessellator var7 = Tessellator.instance; - this.mc.getTextureManager().bindTexture(Gui.optionsBackground); - float var8 = 32.0F; -@@ -85,7 +106,8 @@ - var7.addVertexWithUV((double)var5, 0.0D, 0.0D, (double)((float)var5 / var8), 0.0D); - var7.addVertexWithUV(0.0D, 0.0D, 0.0D, 0.0D, 0.0D); - var7.draw(); -- if(var1 >= 0) { -+ -+ if (par1 >= 0) { - byte var9 = 100; - byte var10 = 2; - int var11 = var5 / 2 - var9 / 2; -@@ -100,22 +122,26 @@ - var7.setColorOpaque_I(8454016); - var7.addVertex((double)var11, (double)var12, 0.0D); - var7.addVertex((double)var11, (double)(var12 + var10), 0.0D); -- var7.addVertex((double)(var11 + var1), (double)(var12 + var10), 0.0D); -- var7.addVertex((double)(var11 + var1), (double)var12, 0.0D); -+ var7.addVertex((double)(var11 + par1), (double)(var12 + var10), 0.0D); -+ var7.addVertex((double)(var11 + par1), (double)var12, 0.0D); - var7.draw(); - GL11.glEnable(GL11.GL_TEXTURE_2D); -+ // Spout Start -+ } else { -+ GL11.glEnable(GL11.GL_TEXTURE_2D); -+ // Spout End - } - -- this.mc.fontRenderer.drawStringWithShadow(this.c, (var5 - this.mc.fontRenderer.getStringWidth(this.c)) / 2, var6 / 2 - 4 - 16, 16777215); -- this.mc.fontRenderer.drawStringWithShadow(this.a, (var5 - this.mc.fontRenderer.getStringWidth(this.a)) / 2, var6 / 2 - 4 + 8, 16777215); -+ this.mc.fontRenderer.drawStringWithShadow(this.currentlyDisplayedText, (var5 - this.mc.fontRenderer.getStringWidth(this.currentlyDisplayedText)) / 2, var6 / 2 - 4 - 16, 16777215); -+ this.mc.fontRenderer.drawStringWithShadow(this.field_73727_a, (var5 - this.mc.fontRenderer.getStringWidth(this.field_73727_a)) / 2, var6 / 2 - 4 + 8, 16777215); - Display.update(); - - try { - Thread.yield(); - } catch (Exception var13) { -+ ; - } -- - } - } -- } -+ } - } ---- /dev/null -+++ org/spoutcraft/api/gui/GenericTextProcessor.java -@@ -1,0 +1,443 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.api.gui; -+ -+import java.awt.Toolkit; -+import java.awt.datatransfer.DataFlavor; -+import java.awt.datatransfer.Transferable; -+import java.util.ArrayList; -+import java.util.Iterator; -+import java.util.StringTokenizer; -+ -+import org.spoutcraft.api.Spoutcraft; -+import org.spoutcraft.api.UnsafeClass; -+ -+@UnsafeClass -+public class GenericTextProcessor implements TextProcessor { -+ protected static final int AVERAGE_CHAR_WIDTH = 6; -+ protected static final char CHAR_NULL = '\0'; -+ protected static final char CHAR_SPACE = ' '; -+ protected static final char CHAR_NEWLINE = '\n'; -+ protected static final String STR_SPACE = String.valueOf(CHAR_SPACE); -+ protected static final String STR_NEWLINE = String.valueOf(CHAR_NEWLINE); -+ -+ protected int charLimit = 16; -+ protected int lineLimit = 1; -+ protected int width = 0; -+ protected int cursor = 0; -+ protected StringBuffer textBuffer = new StringBuffer(); -+ protected ArrayList formattedText = new ArrayList(); -+ protected ArrayList lineBreaks = new ArrayList(); -+ protected MinecraftFont font = Spoutcraft.getClient().getRenderDelegate().getMinecraftFont(); -+ -+ public GenericTextProcessor() { -+ } -+ -+ protected boolean cursorUp() { -+ int line = getCursorLine(); -+ if (line > 0) { -+ int start = (line == 1) ? 0 : lineBreaks.get(line - 2); -+ cursor = start + Math.min(lineBreaks.get(line - 1) - start - 1, cursor - lineBreaks.get(line - 1)); -+ } else { -+ cursor = 0; -+ } -+ return true; -+ } -+ -+ protected boolean cursorDown() { -+ int line = getCursorLine(); -+ if (line + 1 < lineBreaks.size()) { -+ int start = (line == 0) ? 0 : lineBreaks.get(line - 1); -+ cursor = lineBreaks.get(line) + Math.min(lineBreaks.get(line + 1) - lineBreaks.get(line) - 1, cursor - start); -+ } else { -+ cursor = textBuffer.length(); -+ } -+ return true; -+ } -+ -+ protected boolean cursorLeft() { -+ if (cursor > 0) -+ --cursor; -+ return true; -+ } -+ -+ protected boolean cursorRight() { -+ if (cursor < textBuffer.length()) -+ ++cursor; -+ return true; -+ } -+ -+ public int getCursor() { -+ return cursor; -+ } -+ -+ public void setCursor(int cursor) { -+ this.cursor = cursor; -+ correctCursor(); -+ } -+ -+ public int[] getCursor2D() { -+ int[] c = new int[2]; -+ c[0] = getCursorLine(); -+ c[1] = getCursorOffset(c[0]); -+ return c; -+ } -+ -+ protected void correctCursor() { -+ cursor = Math.max(0, Math.min(cursor, textBuffer.length())); -+ } -+ -+ protected int getCursorLine() { -+ for (int i = 0; i < lineBreaks.size(); ++i) -+ if (cursor < lineBreaks.get(i)) { -+ return i; -+ } -+ -+ if (cursor == textBuffer.length() && getCharAt(cursor - 1) == CHAR_NEWLINE) { -+ return lineBreaks.size(); -+ } -+ return Math.max(0, lineBreaks.size() - 1); -+ } -+ -+ protected int getCursorOffset(int line) { -+ int start = (line < 1) ? 0 : lineBreaks.get(line - 1); -+ return cursor - start; -+ } -+ -+ protected int getPreviousWordPosition(int offset) { -+ int i = Math.max(textBuffer.lastIndexOf(STR_SPACE, offset - 1), textBuffer.lastIndexOf(STR_NEWLINE, offset - 1)); -+ return Math.max(0, i); -+ } -+ -+ protected int getNextWordPosition(int offset) { -+ int i = textBuffer.indexOf(STR_SPACE, offset) + 1; -+ if (i == 0) { -+ i = textBuffer.indexOf(STR_NEWLINE, offset) + 1; -+ } -+ if (i == 0) { -+ i = textBuffer.length(); -+ } -+ return i; -+ } -+ -+ protected boolean isIndexValid(int index) { -+ return index > -1 && index < textBuffer.length(); -+ } -+ -+ protected boolean isRangeValid(int start, int end) { -+ return start >= 0 && end <= textBuffer.length() && start < end; -+ } -+ -+ protected boolean isCursorValid() { -+ return isIndexValid(cursor); -+ } -+ -+ protected char getChar() { -+ return getCharAt(cursor); -+ } -+ -+ protected char getCharAt(int position) { -+ return (isIndexValid(position)) ? textBuffer.charAt(position) : CHAR_NULL; -+ } -+ -+ protected boolean deleteChar() { -+ return deleteChar(cursor); -+ } -+ -+ protected boolean deleteChar(int position) { -+ if (isRangeValid(position, position + 1)) { -+ textBuffer.delete(position, position + 1); -+ return formatText(); -+ } -+ return false; -+ } -+ -+ protected boolean deleteLine() { -+ return deleteLine(getCursorLine()); -+ } -+ -+ protected boolean deleteLine(int line) { -+ if (line > -1 && lineBreaks.size() > line) { -+ int start = (line > 0) ? lineBreaks.get(line - 1) : 0; -+ return delete(start, lineBreaks.get(line), start); -+ } -+ return false; -+ } -+ -+ protected boolean delete(int start, int end, int cursorPos) { -+ if (isRangeValid(start, end)) { -+ textBuffer.delete(start, end); -+ cursor = cursorPos; -+ correctCursor(); -+ return formatText(); -+ } -+ return false; -+ } -+ -+ public void clear() { -+ lineBreaks.clear(); -+ formattedText.clear(); -+ textBuffer.delete(0, textBuffer.length()); -+ cursor = 0; -+ } -+ -+ protected boolean insert(char c) { -+ if (charLimit > 0 && textBuffer.length() >= charLimit) { -+ return false; -+ } -+ textBuffer.insert(cursor++, c); -+ if (!formatText()) { // If function call wasn't successful, revert changes -+ deleteChar(--cursor); -+ return false; -+ } -+ return true; -+ } -+ -+ protected boolean insert(String s) { -+ if (s == null || (charLimit > 0 && textBuffer.length() + s.length() >= charLimit)) { -+ return false; -+ } -+ -+ textBuffer.insert(cursor, s); -+ if (!formatText()) { // If function call wasn't successful, revert changes -+ textBuffer.delete(cursor, cursor + s.length()); -+ formatText(); -+ return false; -+ } -+ cursor += s.length(); -+ return true; -+ } -+ -+ public Iterator iterator() { -+ return formattedText.iterator(); -+ } -+ -+ public void setText(String str) { -+ clear(); -+ if (str.length() > 0) { -+ if (charLimit > 0 && str.length() > charLimit) { -+ str = str.substring(0, charLimit); -+ } -+ -+ textBuffer.append(str); -+ cursor = str.length(); -+ formatText(); -+ } -+ } -+ -+ protected boolean formatText() { -+ StringTokenizer st = new StringTokenizer(textBuffer.toString(), STR_NEWLINE + STR_SPACE, true); -+ String word = null; -+ int wordWidth = 0; -+ int lineWidth = 0; -+ int position = 0; -+ int positionOld = 0; -+ boolean previousSpace = false; -+ boolean skipIterator = false; -+ final int spaceCharWidth = font.getTextWidth(STR_SPACE); -+ -+ // Virtually split text in parts that don't exceed the line width -+ lineBreaks.clear(); -+ while (st.hasMoreTokens() || skipIterator) { -+ // Get word and its length -+ if (!skipIterator) { -+ word = st.nextToken(); -+ } -+ skipIterator = false; -+ wordWidth = font.getTextWidth(word); -+ position += word.length(); -+ -+ // If word is a newline directive, add a linebreak -+ if (word.equals(STR_NEWLINE)) { -+ lineWidth = 0; -+ lineBreaks.add(position); -+ continue; -+ // Allow one whitespace not to be handled as part of the previous word (word-wrapping) -+ } else if (!previousSpace && word.equals(STR_SPACE)) { -+ lineWidth += spaceCharWidth; -+ previousSpace = true; -+ continue; -+ } -+ -+ // Split very long words -+ if (wordWidth > width) { -+ int i = word.length(); -+ while (i > 0 && wordWidth > width) -+ wordWidth -= font.getTextWidth(String.valueOf(word.charAt(--i))); -+ position = position - word.length() + i; -+ lineBreaks.add(position); -+ lineWidth = 0; -+ word = word.substring(i); -+ skipIterator = true; -+ // Check if this word would exceed the max-width of the line -+ } else if (lineWidth + wordWidth > width) { -+ if (lineBreaks.size() + 1 < lineLimit) { -+ lineBreaks.add(position - word.length()); -+ lineWidth = wordWidth; -+ } else -+ return false; -+ } else { -+ lineWidth += wordWidth; -+ } -+ previousSpace = false; -+ } -+ // Check if we're at line limit -+ if (lineBreaks.size() >= lineLimit) { -+ return false; -+ } -+ -+ // Create a line break at the end (–> indizes easier) -+ if (!lineBreaks.contains(textBuffer.length())) { -+ lineBreaks.add(textBuffer.length()); -+ } -+ -+ // Split text into parts using the virtual line breaks -+ formattedText.clear(); -+ for (int i = 0; i < lineBreaks.size() && i < lineLimit; ++i) { -+ position = lineBreaks.get(i); -+ String buffer = textBuffer.substring(positionOld, position); -+ buffer = buffer.replaceAll(STR_NEWLINE, ""); -+ formattedText.add(buffer); -+ positionOld = position; -+ } -+ return true; -+ } -+ -+ public String getText() { -+ return textBuffer.toString(); -+ } -+ -+ public int getMaximumCharacters() { -+ return charLimit; -+ } -+ -+ public void setMaximumCharacters(int max) { -+ this.charLimit = max; -+ } -+ -+ public int getMaximumLines() { -+ return lineLimit; -+ } -+ -+ public void setMaximumLines(int max) { -+ this.lineLimit = max; -+ } -+ -+ public int getWidth() { -+ return width; -+ } -+ -+ public void setWidth(int width) { -+ this.width = width; -+ if (!formatText()) { -+ clear(); -+ } -+ } -+ -+ public boolean handleInput(char key, int keyId) { -+ boolean ctrl = Keyboard.isKeyDown(Keyboard.KEY_LCONTROL) || Keyboard.isKeyDown(Keyboard.KEY_RCONTROL); -+ if (keyId == Keyboard.KEY_RETURN.getKeyCode()) { -+ insert(CHAR_NEWLINE); -+ return true; -+ } -+ if (keyId == Keyboard.KEY_BACK.getKeyCode()) { -+ if (ctrl) { -+ int p = getPreviousWordPosition(cursor); -+ return delete(p, cursor, p); -+ } else if (cursor > 0) { -+ return deleteChar(--cursor); -+ } -+ return false; -+ } -+ if (keyId == Keyboard.KEY_DELETE.getKeyCode()) { -+ if (ctrl) { -+ return delete(cursor, getNextWordPosition(cursor), cursor); -+ } else { -+ return deleteChar(); -+ } -+ } -+ if (keyId == Keyboard.KEY_LEFT.getKeyCode()) { -+ if (ctrl) { -+ cursor = getPreviousWordPosition(cursor - 1); -+ } else { -+ cursorLeft(); -+ } -+ return false; -+ } -+ if (keyId == Keyboard.KEY_RIGHT.getKeyCode()) { -+ if (ctrl) { -+ cursor = getNextWordPosition(cursor + 1); -+ } else { -+ cursorRight(); -+ } -+ return false; -+ } -+ if (keyId == Keyboard.KEY_UP.getKeyCode()) { -+ cursorUp(); -+ return false; -+ } -+ if (keyId == Keyboard.KEY_DOWN.getKeyCode()) { -+ cursorDown(); -+ return false; -+ } -+ if (keyId == Keyboard.KEY_HOME.getKeyCode()) { -+ cursor = 0; -+ return false; -+ } -+ if (keyId == Keyboard.KEY_END.getKeyCode()) { -+ cursor = textBuffer.length(); -+ return false; -+ } -+ if (keyId == Keyboard.KEY_V.getKeyCode()) { -+ if (ctrl) { -+ return insert(getClipboardString()); -+ } -+ } -+ if (keyId == Keyboard.KEY_C.getKeyCode()) { -+ if (ctrl) { -+ clear(); -+ return true; -+ } -+ } -+ if (keyId == Keyboard.KEY_D.getKeyCode()) { -+ if (ctrl) { -+ return deleteLine(); -+ } -+ } -+ if (font.isAllowedChar(key)) { -+ return insert(key); -+ } -+ return false; -+ } -+ -+ private static String getClipboardString() { -+ try { -+ Transferable transfer = Toolkit.getDefaultToolkit().getSystemClipboard().getContents((Object) null); -+ if (transfer != null && transfer.isDataFlavorSupported(DataFlavor.stringFlavor)) { -+ String var1 = (String) transfer.getTransferData(DataFlavor.stringFlavor); -+ return var1; -+ } -+ } catch (Exception var2) { -+ ; -+ } -+ -+ return null; -+ } -+} ---- net/minecraft/src/BlockLockedChest.java -+++ net/minecraft/src/BlockLockedChest.java -@@ -3,18 +3,27 @@ - import java.util.Random; - - public class BlockLockedChest extends Block { -- protected BlockLockedChest(int var1) { -- super(var1, Material.wood); -+ protected BlockLockedChest(int par1) { -+ super(par1, Material.wood); - } - -- public boolean canPlaceBlockAt(World var1, int var2, int var3, int var4) { -+ /** -+ * Checks to see if its valid to put this block at the specified coordinates. Args: world, x, y, z -+ */ -+ public boolean canPlaceBlockAt(World par1World, int par2, int par3, int par4) { - return true; - } - -- public void updateTick(World var1, int var2, int var3, int var4, Random var5) { -- var1.setBlockToAir(var2, var3, var4); -+ /** -+ * Ticks the block if it's been scheduled -+ */ -+ public void updateTick(World par1World, int par2, int par3, int par4, Random par5Random) { -+ par1World.setBlockToAir(par2, par3, par4); - } - -- public void registerIcons(IconRegister var1) { -- } -+ /** -+ * When this method is called, your block should register all the icons it needs with the given IconRegister. This is -+ * the only chance you get to register icons. -+ */ -+ public void registerIcons(IconRegister par1IconRegister) {} - } ---- /dev/null -+++ org/spoutcraft/client/gui/minimap/ImageManager.java -@@ -1,0 +1,82 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.client.gui.minimap; -+ -+import java.awt.image.BufferedImage; -+ -+import org.lwjgl.opengl.GL11; -+ -+import net.minecraft.src.Minecraft; -+import net.minecraft.src.TextureUtil; -+ -+import org.spoutcraft.client.SpoutClient; -+ -+public class ImageManager { -+ protected final BufferedImage image; -+ -+ private int glImage = 0; -+ -+ private volatile boolean hasGLImage = false; -+ -+ private volatile boolean hasChanged = true; -+ -+ /** -+ * @param imageSize -+ * @param imageSize2 -+ * @param type -+ */ -+ public ImageManager(int sizeX, int sizeY, int type) { -+ image = new BufferedImage(sizeX, sizeY, type); -+ } -+ -+ public void setRGB(int X, int Y, int color) { -+ synchronized(image) { -+ image.setRGB(X, Y, 0xff000000 | color); -+ hasChanged = true; -+ } -+ } -+ -+ public void setARGB(int X, int Y, int color) { -+ synchronized(image) { -+ image.setRGB(X, Y, color); -+ hasChanged = true; -+ } -+ } -+ -+ public void loadGLImage() { -+ synchronized (image) { -+ if (hasGLImage && hasChanged) { -+ Minecraft.getMinecraft().renderEngine.deleteTexture(glImage); -+ GL11.glPushMatrix(); -+ glImage = TextureUtil.allocateAndSetupTexture(image); -+ GL11.glPopMatrix(); -+ hasChanged = false; -+ } else if (!hasGLImage) { -+ GL11.glPushMatrix(); -+ glImage = TextureUtil.allocateAndSetupTexture(image); -+ GL11.glPopMatrix(); -+ hasGLImage = true; -+ hasChanged = false; -+ } else if (glImage > 0) { -+ SpoutClient.getHandle().renderEngine.bindTexture(glImage); -+ } -+ } -+ } -+} ---- net/minecraft/src/RecipesCrafting.java -+++ net/minecraft/src/RecipesCrafting.java -@@ -1,22 +1,26 @@ - package net.minecraft.src; - - public class RecipesCrafting { -- public void addRecipes(CraftingManager var1) { -- var1.addRecipe(new ItemStack(Block.chest), new Object[]{"###", "# #", "###", Character.valueOf('#'), Block.planks}); -- var1.addRecipe(new ItemStack(Block.chestTrapped), new Object[]{"#-", Character.valueOf('#'), Block.chest, Character.valueOf('-'), Block.tripWireSource}); -- var1.addRecipe(new ItemStack(Block.enderChest), new Object[]{"###", "#E#", "###", Character.valueOf('#'), Block.obsidian, Character.valueOf('E'), Item.eyeOfEnder}); -- var1.addRecipe(new ItemStack(Block.furnaceIdle), new Object[]{"###", "# #", "###", Character.valueOf('#'), Block.cobblestone}); -- var1.addRecipe(new ItemStack(Block.workbench), new Object[]{"##", "##", Character.valueOf('#'), Block.planks}); -- var1.addRecipe(new ItemStack(Block.sandStone), new Object[]{"##", "##", Character.valueOf('#'), Block.sand}); -- var1.addRecipe(new ItemStack(Block.sandStone, 4, 2), new Object[]{"##", "##", Character.valueOf('#'), Block.sandStone}); -- var1.addRecipe(new ItemStack(Block.sandStone, 1, 1), new Object[]{"#", "#", Character.valueOf('#'), new ItemStack(Block.stoneSingleSlab, 1, 1)}); -- var1.addRecipe(new ItemStack(Block.blockNetherQuartz, 1, 1), new Object[]{"#", "#", Character.valueOf('#'), new ItemStack(Block.stoneSingleSlab, 1, 7)}); -- var1.addRecipe(new ItemStack(Block.blockNetherQuartz, 2, 2), new Object[]{"#", "#", Character.valueOf('#'), new ItemStack(Block.blockNetherQuartz, 1, 0)}); -- var1.addRecipe(new ItemStack(Block.stoneBrick, 4), new Object[]{"##", "##", Character.valueOf('#'), Block.stone}); -- var1.addRecipe(new ItemStack(Block.fenceIron, 16), new Object[]{"###", "###", Character.valueOf('#'), Item.ingotIron}); -- var1.addRecipe(new ItemStack(Block.thinGlass, 16), new Object[]{"###", "###", Character.valueOf('#'), Block.glass}); -- var1.addRecipe(new ItemStack(Block.redstoneLampIdle, 1), new Object[]{" R ", "RGR", " R ", Character.valueOf('R'), Item.redstone, Character.valueOf('G'), Block.glowStone}); -- var1.addRecipe(new ItemStack(Block.beacon, 1), new Object[]{"GGG", "GSG", "OOO", Character.valueOf('G'), Block.glass, Character.valueOf('S'), Item.netherStar, Character.valueOf('O'), Block.obsidian}); -- var1.addRecipe(new ItemStack(Block.netherBrick, 1), new Object[]{"NN", "NN", Character.valueOf('N'), Item.netherrackBrick}); -+ -+ /** -+ * Adds the crafting recipes to the CraftingManager. -+ */ -+ public void addRecipes(CraftingManager par1CraftingManager) { -+ par1CraftingManager.addRecipe(new ItemStack(Block.chest), new Object[] {"###", "# #", "###", '#', Block.planks}); -+ par1CraftingManager.addRecipe(new ItemStack(Block.chestTrapped), new Object[] {"#-", '#', Block.chest, '-', Block.tripWireSource}); -+ par1CraftingManager.addRecipe(new ItemStack(Block.enderChest), new Object[] {"###", "#E#", "###", '#', Block.obsidian, 'E', Item.eyeOfEnder}); -+ par1CraftingManager.addRecipe(new ItemStack(Block.furnaceIdle), new Object[] {"###", "# #", "###", '#', Block.cobblestone}); -+ par1CraftingManager.addRecipe(new ItemStack(Block.workbench), new Object[] {"##", "##", '#', Block.planks}); -+ par1CraftingManager.addRecipe(new ItemStack(Block.sandStone), new Object[] {"##", "##", '#', Block.sand}); -+ par1CraftingManager.addRecipe(new ItemStack(Block.sandStone, 4, 2), new Object[] {"##", "##", '#', Block.sandStone}); -+ par1CraftingManager.addRecipe(new ItemStack(Block.sandStone, 1, 1), new Object[] {"#", "#", '#', new ItemStack(Block.stoneSingleSlab, 1, 1)}); -+ par1CraftingManager.addRecipe(new ItemStack(Block.blockNetherQuartz, 1, 1), new Object[] {"#", "#", '#', new ItemStack(Block.stoneSingleSlab, 1, 7)}); -+ par1CraftingManager.addRecipe(new ItemStack(Block.blockNetherQuartz, 2, 2), new Object[] {"#", "#", '#', new ItemStack(Block.blockNetherQuartz, 1, 0)}); -+ par1CraftingManager.addRecipe(new ItemStack(Block.stoneBrick, 4), new Object[] {"##", "##", '#', Block.stone}); -+ par1CraftingManager.addRecipe(new ItemStack(Block.fenceIron, 16), new Object[] {"###", "###", '#', Item.ingotIron}); -+ par1CraftingManager.addRecipe(new ItemStack(Block.thinGlass, 16), new Object[] {"###", "###", '#', Block.glass}); -+ par1CraftingManager.addRecipe(new ItemStack(Block.redstoneLampIdle, 1), new Object[] {" R ", "RGR", " R ", 'R', Item.redstone, 'G', Block.glowStone}); -+ par1CraftingManager.addRecipe(new ItemStack(Block.beacon, 1), new Object[] {"GGG", "GSG", "OOO", 'G', Block.glass, 'S', Item.netherStar, 'O', Block.obsidian}); -+ par1CraftingManager.addRecipe(new ItemStack(Block.netherBrick, 1), new Object[] {"NN", "NN", 'N', Item.netherrackBrick}); - } - } ---- net/minecraft/src/EntityFishHook.java -+++ net/minecraft/src/EntityFishHook.java -@@ -3,8 +3,14 @@ - import java.util.List; - - public class EntityFishHook extends Entity { -+ -+ /** The tile this entity is on, X position */ - private int xTile; -+ -+ /** The tile this entity is on, Y position */ - private int yTile; -+ -+ /** The tile this entity is on, Z position */ - private int zTile; - private int inTile; - private boolean inGround; -@@ -12,7 +18,14 @@ - public EntityPlayer angler; - private int ticksInGround; - private int ticksInAir; -+ -+ /** the number of ticks remaining until this fish can no longer be caught */ - private int ticksCatchable; -+ -+ /** -+ * The entity that the fishing rod is connected to, if any. When you right click on the fishing rod and the hook falls -+ * on to an entity, this it that entity. -+ */ - public Entity bobber; - private int fishPosRotationIncrements; - private double fishX; -@@ -24,8 +37,8 @@ - private double velocityY; - private double velocityZ; - -- public EntityFishHook(World var1) { -- super(var1); -+ public EntityFishHook(World par1World) { -+ super(par1World); - this.xTile = -1; - this.yTile = -1; - this.zTile = -1; -@@ -33,26 +46,26 @@ - this.ignoreFrustumCheck = true; - } - -- public EntityFishHook(World var1, double var2, double var4, double var6, EntityPlayer var8) { -- this(var1); -- this.setPosition(var2, var4, var6); -+ public EntityFishHook(World par1World, double par2, double par4, double par6, EntityPlayer par8EntityPlayer) { -+ this(par1World); -+ this.setPosition(par2, par4, par6); - this.ignoreFrustumCheck = true; -- this.angler = var8; -- var8.fishEntity = this; -+ this.angler = par8EntityPlayer; -+ par8EntityPlayer.fishEntity = this; - } - -- public EntityFishHook(World var1, EntityPlayer var2) { -- super(var1); -+ public EntityFishHook(World par1World, EntityPlayer par2EntityPlayer) { -+ super(par1World); - this.xTile = -1; - this.yTile = -1; - this.zTile = -1; - this.ignoreFrustumCheck = true; -- this.angler = var2; -+ this.angler = par2EntityPlayer; - this.angler.fishEntity = this; - this.setSize(0.25F, 0.25F); -- this.setLocationAndAngles(var2.posX, var2.posY + 1.62D - (double)var2.yOffset, var2.posZ, var2.rotationYaw, var2.rotationPitch); -+ this.setLocationAndAngles(par2EntityPlayer.posX, par2EntityPlayer.posY + 1.62D - (double)par2EntityPlayer.yOffset, par2EntityPlayer.posZ, par2EntityPlayer.rotationYaw, par2EntityPlayer.rotationPitch); - this.posX -= (double)(MathHelper.cos(this.rotationYaw / 180.0F * (float)Math.PI) * 0.16F); -- this.posY -= (double)0.1F; -+ this.posY -= 0.10000000149011612D; - this.posZ -= (double)(MathHelper.sin(this.rotationYaw / 180.0F * (float)Math.PI) * 0.16F); - this.setPosition(this.posX, this.posY, this.posZ); - this.yOffset = 0.0F; -@@ -63,56 +76,70 @@ - this.calculateVelocity(this.motionX, this.motionY, this.motionZ, 1.5F, 1.0F); - } - -- protected void entityInit() { -- } -+ protected void entityInit() {} - -- public boolean isInRangeToRenderDist(double var1) { -+ /** -+ * Checks if the entity is in range to render by using the past in distance and comparing it to its average edge length -+ * * 64 * renderDistanceWeight Args: distance -+ */ -+ public boolean isInRangeToRenderDist(double par1) { - double var3 = this.boundingBox.getAverageEdgeLength() * 4.0D; - var3 *= 64.0D; -- return var1 < var3 * var3; -+ return par1 < var3 * var3; - } - -- public void calculateVelocity(double var1, double var3, double var5, float var7, float var8) { -- float var9 = MathHelper.sqrt_double(var1 * var1 + var3 * var3 + var5 * var5); -- var1 /= (double)var9; -- var3 /= (double)var9; -- var5 /= (double)var9; -- var1 += this.ab.nextGaussian() * (double)0.0075F * (double)var8; -- var3 += this.ab.nextGaussian() * (double)0.0075F * (double)var8; -- var5 += this.ab.nextGaussian() * (double)0.0075F * (double)var8; -- var1 *= (double)var7; -- var3 *= (double)var7; -- var5 *= (double)var7; -- this.motionX = var1; -- this.motionY = var3; -- this.motionZ = var5; -- float var10 = MathHelper.sqrt_double(var1 * var1 + var5 * var5); -- this.prevRotationYaw = this.rotationYaw = (float)(Math.atan2(var1, var5) * 180.0D / (double)((float)Math.PI)); -- this.prevRotationPitch = this.rotationPitch = (float)(Math.atan2(var3, (double)var10) * 180.0D / (double)((float)Math.PI)); -+ public void calculateVelocity(double par1, double par3, double par5, float par7, float par8) { -+ float var9 = MathHelper.sqrt_double(par1 * par1 + par3 * par3 + par5 * par5); -+ par1 /= (double)var9; -+ par3 /= (double)var9; -+ par5 /= (double)var9; -+ par1 += this.rand.nextGaussian() * 0.007499999832361937D * (double)par8; -+ par3 += this.rand.nextGaussian() * 0.007499999832361937D * (double)par8; -+ par5 += this.rand.nextGaussian() * 0.007499999832361937D * (double)par8; -+ par1 *= (double)par7; -+ par3 *= (double)par7; -+ par5 *= (double)par7; -+ this.motionX = par1; -+ this.motionY = par3; -+ this.motionZ = par5; -+ float var10 = MathHelper.sqrt_double(par1 * par1 + par5 * par5); -+ this.prevRotationYaw = this.rotationYaw = (float)(Math.atan2(par1, par5) * 180.0D / Math.PI); -+ this.prevRotationPitch = this.rotationPitch = (float)(Math.atan2(par3, (double)var10) * 180.0D / Math.PI); - this.ticksInGround = 0; - } - -- public void setPositionAndRotation2(double var1, double var3, double var5, float var7, float var8, int var9) { -- this.fishX = var1; -- this.fishY = var3; -- this.fishZ = var5; -- this.fishYaw = (double)var7; -- this.fishPitch = (double)var8; -- this.fishPosRotationIncrements = var9; -+ /** -+ * Sets the position and rotation. Only difference from the other one is no bounding on the rotation. Args: posX, posY, -+ * posZ, yaw, pitch -+ */ -+ public void setPositionAndRotation2(double par1, double par3, double par5, float par7, float par8, int par9) { -+ this.fishX = par1; -+ this.fishY = par3; -+ this.fishZ = par5; -+ this.fishYaw = (double)par7; -+ this.fishPitch = (double)par8; -+ this.fishPosRotationIncrements = par9; - this.motionX = this.velocityX; - this.motionY = this.velocityY; - this.motionZ = this.velocityZ; - } - -- public void setVelocity(double var1, double var3, double var5) { -- this.velocityX = this.motionX = var1; -- this.velocityY = this.motionY = var3; -- this.velocityZ = this.motionZ = var5; -+ /** -+ * Sets the velocity to the args. Args: x, y, z -+ */ -+ public void setVelocity(double par1, double par3, double par5) { -+ this.velocityX = this.motionX = par1; -+ this.velocityY = this.motionY = par3; -+ this.velocityZ = this.motionZ = par5; - } - -+ /** -+ * Called to update the entity's position/logic. -+ */ - public void onUpdate() { - super.onUpdate(); -- if(this.fishPosRotationIncrements > 0) { -+ -+ if (this.fishPosRotationIncrements > 0) { - double var21 = this.posX + (this.fishX - this.posX) / (double)this.fishPosRotationIncrements; - double var22 = this.posY + (this.fishY - this.posY) / (double)this.fishPosRotationIncrements; - double var23 = this.posZ + (this.fishZ - this.posZ) / (double)this.fishPosRotationIncrements; -@@ -123,16 +150,17 @@ - this.setPosition(var21, var22, var23); - this.setRotation(this.rotationYaw, this.rotationPitch); - } else { -- if(!this.worldObj.isRemote) { -+ if (!this.worldObj.isRemote) { - ItemStack var1 = this.angler.getCurrentEquippedItem(); -- if(this.angler.isDead || !this.angler.isEntityAlive() || var1 == null || var1.getItem() != Item.fishingRod || this.getDistanceSqToEntity(this.angler) > 1024.0D) { -+ -+ if (this.angler.isDead || !this.angler.isEntityAlive() || var1 == null || var1.getItem() != Item.fishingRod || this.getDistanceSqToEntity(this.angler) > 1024.0D) { - this.setDead(); - this.angler.fishEntity = null; - return; - } - -- if(this.bobber != null) { -- if(!this.bobber.isDead) { -+ if (this.bobber != null) { -+ if (!this.bobber.isDead) { - this.posX = this.bobber.posX; - this.posY = this.bobber.boundingBox.minY + (double)this.bobber.height * 0.8D; - this.posZ = this.bobber.posZ; -@@ -143,15 +171,17 @@ - } - } - -- if(this.shake > 0) { -+ if (this.shake > 0) { - --this.shake; - } - -- if(this.inGround) { -+ if (this.inGround) { - int var19 = this.worldObj.getBlockId(this.xTile, this.yTile, this.zTile); -- if(var19 == this.inTile) { -+ -+ if (var19 == this.inTile) { - ++this.ticksInGround; -- if(this.ticksInGround == 1200) { -+ -+ if (this.ticksInGround == 1200) { - this.setDead(); - } - -@@ -159,9 +189,9 @@ - } - - this.inGround = false; -- this.motionX *= (double)(this.ab.nextFloat() * 0.2F); -- this.motionY *= (double)(this.ab.nextFloat() * 0.2F); -- this.motionZ *= (double)(this.ab.nextFloat() * 0.2F); -+ this.motionX *= (double)(this.rand.nextFloat() * 0.2F); -+ this.motionY *= (double)(this.rand.nextFloat() * 0.2F); -+ this.motionZ *= (double)(this.rand.nextFloat() * 0.2F); - this.ticksInGround = 0; - this.ticksInAir = 0; - } else { -@@ -170,27 +200,31 @@ - - Vec3 var20 = this.worldObj.getWorldVec3Pool().getVecFromPool(this.posX, this.posY, this.posZ); - Vec3 var2 = this.worldObj.getWorldVec3Pool().getVecFromPool(this.posX + this.motionX, this.posY + this.motionY, this.posZ + this.motionZ); -- MovingObjectPosition var3 = this.worldObj.rayTraceBlocks(var20, var2); -+ MovingObjectPosition var3 = this.worldObj.clip(var20, var2); - var20 = this.worldObj.getWorldVec3Pool().getVecFromPool(this.posX, this.posY, this.posZ); - var2 = this.worldObj.getWorldVec3Pool().getVecFromPool(this.posX + this.motionX, this.posY + this.motionY, this.posZ + this.motionZ); -- if(var3 != null) { -+ -+ if (var3 != null) { - var2 = this.worldObj.getWorldVec3Pool().getVecFromPool(var3.hitVec.xCoord, var3.hitVec.yCoord, var3.hitVec.zCoord); - } - - Entity var4 = null; - List var5 = this.worldObj.getEntitiesWithinAABBExcludingEntity(this, this.boundingBox.addCoord(this.motionX, this.motionY, this.motionZ).expand(1.0D, 1.0D, 1.0D)); - double var6 = 0.0D; -- - double var13; -- for(int var8 = 0; var8 < var5.size(); ++var8) { -+ -+ for (int var8 = 0; var8 < var5.size(); ++var8) { - Entity var9 = (Entity)var5.get(var8); -- if(var9.canBeCollidedWith() && (var9 != this.angler || this.ticksInAir >= 5)) { -+ -+ if (var9.canBeCollidedWith() && (var9 != this.angler || this.ticksInAir >= 5)) { - float var10 = 0.3F; - AxisAlignedBB var11 = var9.boundingBox.expand((double)var10, (double)var10, (double)var10); - MovingObjectPosition var12 = var11.calculateIntercept(var20, var2); -- if(var12 != null) { -+ -+ if (var12 != null) { - var13 = var20.distanceTo(var12.hitVec); -- if(var13 < var6 || var6 == 0.0D) { -+ -+ if (var13 < var6 || var6 == 0.0D) { - var4 = var9; - var6 = var13; - } -@@ -198,13 +232,13 @@ - } - } - -- if(var4 != null) { -+ if (var4 != null) { - var3 = new MovingObjectPosition(var4); - } - -- if(var3 != null) { -- if(var3.entityHit != null) { -- if(var3.entityHit.attackEntityFrom(DamageSource.causeThrownDamage(this, this.angler), 0.0F)) { -+ if (var3 != null) { -+ if (var3.entityHit != null) { -+ if (var3.entityHit.attackEntityFrom(DamageSource.causeThrownDamage(this, this.angler), 0.0F)) { - this.bobber = var3.entityHit; - } - } else { -@@ -212,85 +246,90 @@ - } - } - -- if(!this.inGround) { -+ if (!this.inGround) { - this.moveEntity(this.motionX, this.motionY, this.motionZ); - float var24 = MathHelper.sqrt_double(this.motionX * this.motionX + this.motionZ * this.motionZ); -- this.rotationYaw = (float)(Math.atan2(this.motionX, this.motionZ) * 180.0D / (double)((float)Math.PI)); -+ this.rotationYaw = (float)(Math.atan2(this.motionX, this.motionZ) * 180.0D / Math.PI); - -- for(this.rotationPitch = (float)(Math.atan2(this.motionY, (double)var24) * 180.0D / (double)((float)Math.PI)); this.rotationPitch - this.prevRotationPitch < -180.0F; this.prevRotationPitch -= 360.0F) { -+ for (this.rotationPitch = (float)(Math.atan2(this.motionY, (double)var24) * 180.0D / Math.PI); this.rotationPitch - this.prevRotationPitch < -180.0F; this.prevRotationPitch -= 360.0F) { -+ ; - } - -- while(this.rotationPitch - this.prevRotationPitch >= 180.0F) { -+ while (this.rotationPitch - this.prevRotationPitch >= 180.0F) { - this.prevRotationPitch += 360.0F; - } - -- while(this.rotationYaw - this.prevRotationYaw < -180.0F) { -+ while (this.rotationYaw - this.prevRotationYaw < -180.0F) { - this.prevRotationYaw -= 360.0F; - } - -- while(this.rotationYaw - this.prevRotationYaw >= 180.0F) { -+ while (this.rotationYaw - this.prevRotationYaw >= 180.0F) { - this.prevRotationYaw += 360.0F; - } - - this.rotationPitch = this.prevRotationPitch + (this.rotationPitch - this.prevRotationPitch) * 0.2F; - this.rotationYaw = this.prevRotationYaw + (this.rotationYaw - this.prevRotationYaw) * 0.2F; - float var25 = 0.92F; -- if(this.onGround || this.isCollidedHorizontally) { -+ -+ if (this.onGround || this.isCollidedHorizontally) { - var25 = 0.5F; - } - - byte var26 = 5; - double var27 = 0.0D; - -- for(int var28 = 0; var28 < var26; ++var28) { -+ for (int var28 = 0; var28 < var26; ++var28) { - double var14 = this.boundingBox.minY + (this.boundingBox.maxY - this.boundingBox.minY) * (double)(var28 + 0) / (double)var26 - 0.125D + 0.125D; - double var16 = this.boundingBox.minY + (this.boundingBox.maxY - this.boundingBox.minY) * (double)(var28 + 1) / (double)var26 - 0.125D + 0.125D; - AxisAlignedBB var18 = AxisAlignedBB.getAABBPool().getAABB(this.boundingBox.minX, var14, this.boundingBox.minZ, this.boundingBox.maxX, var16, this.boundingBox.maxZ); -- if(this.worldObj.isAABBInMaterial(var18, Material.water)) { -+ -+ if (this.worldObj.isAABBInMaterial(var18, Material.water)) { - var27 += 1.0D / (double)var26; - } - } - -- if(var27 > 0.0D) { -- if(this.ticksCatchable > 0) { -+ if (var27 > 0.0D) { -+ if (this.ticksCatchable > 0) { - --this.ticksCatchable; - } else { - short var29 = 500; -- if(this.worldObj.canLightningStrikeAt(MathHelper.floor_double(this.posX), MathHelper.floor_double(this.posY) + 1, MathHelper.floor_double(this.posZ))) { -+ -+ if (this.worldObj.canLightningStrikeAt(MathHelper.floor_double(this.posX), MathHelper.floor_double(this.posY) + 1, MathHelper.floor_double(this.posZ))) { - var29 = 300; - } - -- if(this.ab.nextInt(var29) == 0) { -- this.ticksCatchable = this.ab.nextInt(30) + 10; -- this.motionY -= (double)0.2F; -- this.playSound("random.splash", 0.25F, 1.0F + (this.ab.nextFloat() - this.ab.nextFloat()) * 0.4F); -+ if (this.rand.nextInt(var29) == 0) { -+ this.ticksCatchable = this.rand.nextInt(30) + 10; -+ this.motionY -= 0.20000000298023224D; -+ this.playSound("random.splash", 0.25F, 1.0F + (this.rand.nextFloat() - this.rand.nextFloat()) * 0.4F); - float var30 = (float)MathHelper.floor_double(this.boundingBox.minY); -- - int var15; - float var17; - float var31; -- for(var15 = 0; (float)var15 < 1.0F + this.width * 20.0F; ++var15) { -- var31 = (this.ab.nextFloat() * 2.0F - 1.0F) * this.width; -- var17 = (this.ab.nextFloat() * 2.0F - 1.0F) * this.width; -- this.worldObj.spawnParticle("bubble", this.posX + (double)var31, (double)(var30 + 1.0F), this.posZ + (double)var17, this.motionX, this.motionY - (double)(this.ab.nextFloat() * 0.2F), this.motionZ); -+ -+ for (var15 = 0; (float)var15 < 1.0F + this.width * 20.0F; ++var15) { -+ var31 = (this.rand.nextFloat() * 2.0F - 1.0F) * this.width; -+ var17 = (this.rand.nextFloat() * 2.0F - 1.0F) * this.width; -+ this.worldObj.spawnParticle("bubble", this.posX + (double)var31, (double)(var30 + 1.0F), this.posZ + (double)var17, this.motionX, this.motionY - (double)(this.rand.nextFloat() * 0.2F), this.motionZ); - } - -- for(var15 = 0; (float)var15 < 1.0F + this.width * 20.0F; ++var15) { -- var31 = (this.ab.nextFloat() * 2.0F - 1.0F) * this.width; -- var17 = (this.ab.nextFloat() * 2.0F - 1.0F) * this.width; -+ for (var15 = 0; (float)var15 < 1.0F + this.width * 20.0F; ++var15) { -+ var31 = (this.rand.nextFloat() * 2.0F - 1.0F) * this.width; -+ var17 = (this.rand.nextFloat() * 2.0F - 1.0F) * this.width; - this.worldObj.spawnParticle("splash", this.posX + (double)var31, (double)(var30 + 1.0F), this.posZ + (double)var17, this.motionX, this.motionY, this.motionZ); - } - } - } - } - -- if(this.ticksCatchable > 0) { -- this.motionY -= (double)(this.ab.nextFloat() * this.ab.nextFloat() * this.ab.nextFloat()) * 0.2D; -+ if (this.ticksCatchable > 0) { -+ this.motionY -= (double)(this.rand.nextFloat() * this.rand.nextFloat() * this.rand.nextFloat()) * 0.2D; - } - - var13 = var27 * 2.0D - 1.0D; -- this.motionY += (double)0.04F * var13; -- if(var27 > 0.0D) { -+ this.motionY += 0.03999999910593033D * var13; -+ -+ if (var27 > 0.0D) { - var25 = (float)((double)var25 * 0.9D); - this.motionY *= 0.8D; - } -@@ -303,22 +342,28 @@ - } - } - -- public void writeEntityToNBT(NBTTagCompound var1) { -- var1.setShort("xTile", (short)this.xTile); -- var1.setShort("yTile", (short)this.yTile); -- var1.setShort("zTile", (short)this.zTile); -- var1.setByte("inTile", (byte)this.inTile); -- var1.setByte("shake", (byte)this.shake); -- var1.setByte("inGround", (byte)(this.inGround ? 1 : 0)); -+ /** -+ * (abstract) Protected helper method to write subclass entity data to NBT. -+ */ -+ public void writeEntityToNBT(NBTTagCompound par1NBTTagCompound) { -+ par1NBTTagCompound.setShort("xTile", (short)this.xTile); -+ par1NBTTagCompound.setShort("yTile", (short)this.yTile); -+ par1NBTTagCompound.setShort("zTile", (short)this.zTile); -+ par1NBTTagCompound.setByte("inTile", (byte)this.inTile); -+ par1NBTTagCompound.setByte("shake", (byte)this.shake); -+ par1NBTTagCompound.setByte("inGround", (byte)(this.inGround ? 1 : 0)); - } - -- public void readEntityFromNBT(NBTTagCompound var1) { -- this.xTile = var1.getShort("xTile"); -- this.yTile = var1.getShort("yTile"); -- this.zTile = var1.getShort("zTile"); -- this.inTile = var1.getByte("inTile") & 255; -- this.shake = var1.getByte("shake") & 255; -- this.inGround = var1.getByte("inGround") == 1; -+ /** -+ * (abstract) Protected helper method to read subclass entity data from NBT. -+ */ -+ public void readEntityFromNBT(NBTTagCompound par1NBTTagCompound) { -+ this.xTile = par1NBTTagCompound.getShort("xTile"); -+ this.yTile = par1NBTTagCompound.getShort("yTile"); -+ this.zTile = par1NBTTagCompound.getShort("zTile"); -+ this.inTile = par1NBTTagCompound.getByte("inTile") & 255; -+ this.shake = par1NBTTagCompound.getByte("shake") & 255; -+ this.inGround = par1NBTTagCompound.getByte("inGround") == 1; - } - - public float getShadowSize() { -@@ -326,11 +371,12 @@ - } - - public int catchFish() { -- if(this.worldObj.isRemote) { -+ if (this.worldObj.isRemote) { - return 0; - } else { - byte var1 = 0; -- if(this.bobber != null) { -+ -+ if (this.bobber != null) { - double var2 = this.angler.posX - this.posX; - double var4 = this.angler.posY - this.posY; - double var6 = this.angler.posZ - this.posZ; -@@ -340,7 +386,7 @@ - this.bobber.motionY += var4 * var10 + (double)MathHelper.sqrt_double(var8) * 0.08D; - this.bobber.motionZ += var6 * var10; - var1 = 3; -- } else if(this.ticksCatchable > 0) { -+ } else if (this.ticksCatchable > 0) { - EntityItem var13 = new EntityItem(this.worldObj, this.posX, this.posY, this.posZ, new ItemStack(Item.fishRaw)); - double var3 = this.angler.posX - this.posX; - double var5 = this.angler.posY - this.posY; -@@ -352,11 +398,11 @@ - var13.motionZ = var7 * var11; - this.worldObj.spawnEntityInWorld(var13); - this.angler.addStat(StatList.fishCaughtStat, 1); -- this.angler.worldObj.spawnEntityInWorld(new EntityXPOrb(this.angler.worldObj, this.angler.posX, this.angler.posY + 0.5D, this.angler.posZ + 0.5D, this.ab.nextInt(6) + 1)); -+ this.angler.worldObj.spawnEntityInWorld(new EntityXPOrb(this.angler.worldObj, this.angler.posX, this.angler.posY + 0.5D, this.angler.posZ + 0.5D, this.rand.nextInt(6) + 1)); - var1 = 1; - } - -- if(this.inGround) { -+ if (this.inGround) { - var1 = 2; - } - -@@ -366,11 +412,14 @@ - } - } - -+ /** -+ * Will get destroyed next tick. -+ */ - public void setDead() { - super.setDead(); -- if(this.angler != null) { -+ -+ if (this.angler != null) { - this.angler.fishEntity = null; - } -- - } - } ---- net/minecraft/src/Packet44UpdateAttributesSnapshot.java -+++ net/minecraft/src/Packet44UpdateAttributesSnapshot.java -@@ -3,20 +3,21 @@ - import java.util.Collection; - - public class Packet44UpdateAttributesSnapshot { -- private final String b; -+ private final String field_142043_b; - private final double field_142044_c; -- private final Collection d; -+ private final Collection field_142042_d; -+ - final Packet44UpdateAttributes field_142045_a; - -- public Packet44UpdateAttributesSnapshot(Packet44UpdateAttributes var1, String var2, double var3, Collection var5) { -- this.field_142045_a = var1; -- this.b = var2; -- this.field_142044_c = var3; -- this.d = var5; -+ public Packet44UpdateAttributesSnapshot(Packet44UpdateAttributes par1Packet44UpdateAttributes, String par2Str, double par3, Collection par5Collection) { -+ this.field_142045_a = par1Packet44UpdateAttributes; -+ this.field_142043_b = par2Str; -+ this.field_142044_c = par3; -+ this.field_142042_d = par5Collection; - } - - public String func_142040_a() { -- return this.b; -+ return this.field_142043_b; - } - - public double func_142041_b() { -@@ -24,6 +25,6 @@ - } - - public Collection func_142039_c() { -- return this.d; -+ return this.field_142042_d; - } - } ---- net/minecraft/src/DispenserBehaviorFireworks.java -+++ net/minecraft/src/DispenserBehaviorFireworks.java -@@ -1,18 +1,25 @@ - package net.minecraft.src; - - final class DispenserBehaviorFireworks extends BehaviorDefaultDispenseItem { -- public ItemStack dispenseStack(IBlockSource var1, ItemStack var2) { -- EnumFacing var3 = BlockDispenser.getFacing(var1.getBlockMetadata()); -- double var4 = var1.getX() + (double)var3.getFrontOffsetX(); -- double var6 = (double)((float)var1.getYInt() + 0.2F); -- double var8 = var1.getZ() + (double)var3.getFrontOffsetZ(); -- EntityFireworkRocket var10 = new EntityFireworkRocket(var1.getWorld(), var4, var6, var8, var2); -- var1.getWorld().spawnEntityInWorld(var10); -- var2.splitStack(1); -- return var2; -+ -+ /** -+ * Dispense the specified stack, play the dispense sound and spawn particles. -+ */ -+ public ItemStack dispenseStack(IBlockSource par1IBlockSource, ItemStack par2ItemStack) { -+ EnumFacing var3 = BlockDispenser.getFacing(par1IBlockSource.getBlockMetadata()); -+ double var4 = par1IBlockSource.getX() + (double)var3.getFrontOffsetX(); -+ double var6 = (double)((float)par1IBlockSource.getYInt() + 0.2F); -+ double var8 = par1IBlockSource.getZ() + (double)var3.getFrontOffsetZ(); -+ EntityFireworkRocket var10 = new EntityFireworkRocket(par1IBlockSource.getWorld(), var4, var6, var8, par2ItemStack); -+ par1IBlockSource.getWorld().spawnEntityInWorld(var10); -+ par2ItemStack.splitStack(1); -+ return par2ItemStack; - } - -- protected void playDispenseSound(IBlockSource var1) { -- var1.getWorld().playAuxSFX(1002, var1.getXInt(), var1.getYInt(), var1.getZInt(), 0); -+ /** -+ * Play the dispense sound from the specified block. -+ */ -+ protected void playDispenseSound(IBlockSource par1IBlockSource) { -+ par1IBlockSource.getWorld().playAuxSFX(1002, par1IBlockSource.getXInt(), par1IBlockSource.getYInt(), par1IBlockSource.getZInt(), 0); - } - } ---- /dev/null -+++ org/spoutcraft/api/property/Property.java -@@ -1,0 +1,37 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.api.property; -+ -+import org.spoutcraft.api.animation.Animatable; -+ -+public abstract class Property { -+ public abstract Object get(); -+ -+ public abstract void set(Object value); -+ -+ public Animatable getAnimatableValue() { -+ Object value = get(); -+ if (value instanceof Animatable) { -+ return (Animatable) value; -+ } -+ -+ return null; -+ } -+} ---- net/minecraft/src/IntHashMap.java -+++ net/minecraft/src/IntHashMap.java -@@ -4,43 +4,70 @@ - import java.util.Set; - - public class IntHashMap { -+ -+ /** An array of HashEntries representing the heads of hash slot lists */ - private transient IntHashMapEntry[] slots = new IntHashMapEntry[16]; -+ -+ /** The number of items stored in this map */ - private transient int count; -+ -+ /** The grow threshold */ - private int threshold = 12; -- private final float growFactor = 12.0F / 16.0F; -+ -+ /** The scale factor used to determine when to grow the table */ -+ private final float growFactor = 0.75F; -+ -+ /** A serial stamp used to mark changes */ - private transient volatile int versionStamp; -- private Set f = new HashSet(); -- -- private static int computeHash(int var0) { -- var0 ^= var0 >>> 20 ^ var0 >>> 12; -- return var0 ^ var0 >>> 7 ^ var0 >>> 4; -- } -- -- private static int getSlotIndex(int var0, int var1) { -- return var0 & var1 - 1; -- } -- -- public Object lookup(int var1) { -- int var2 = computeHash(var1); -- -- for(IntHashMapEntry var3 = this.slots[getSlotIndex(var2, this.slots.length)]; var3 != null; var3 = var3.nextEntry) { -- if(var3.hashEntry == var1) { -- return var3.b; -+ -+ /** The set of all the keys stored in this MCHash object */ -+ private Set keySet = new HashSet(); -+ -+ /** -+ * Makes the passed in integer suitable for hashing by a number of shifts -+ */ -+ private static int computeHash(int par0) { -+ par0 ^= par0 >>> 20 ^ par0 >>> 12; -+ return par0 ^ par0 >>> 7 ^ par0 >>> 4; -+ } -+ -+ /** -+ * Computes the index of the slot for the hash and slot count passed in. -+ */ -+ private static int getSlotIndex(int par0, int par1) { -+ return par0 & par1 - 1; -+ } -+ -+ /** -+ * Returns the object associated to a key -+ */ -+ public Object lookup(int par1) { -+ int var2 = computeHash(par1); -+ -+ for (IntHashMapEntry var3 = this.slots[getSlotIndex(var2, this.slots.length)]; var3 != null; var3 = var3.nextEntry) { -+ if (var3.hashEntry == par1) { -+ return var3.valueEntry; - } - } - - return null; - } - -- public boolean containsItem(int var1) { -- return this.lookupEntry(var1) != null; -+ /** -+ * Return true if an object is associated with the given key -+ */ -+ public boolean containsItem(int par1) { -+ return this.lookupEntry(par1) != null; - } - -- final IntHashMapEntry lookupEntry(int var1) { -- int var2 = computeHash(var1); -+ /** -+ * Returns the key/object mapping for a given key as a MCHashEntry -+ */ -+ final IntHashMapEntry lookupEntry(int par1) { -+ int var2 = computeHash(par1); - -- for(IntHashMapEntry var3 = this.slots[getSlotIndex(var2, this.slots.length)]; var3 != null; var3 = var3.nextEntry) { -- if(var3.hashEntry == var1) { -+ for (IntHashMapEntry var3 = this.slots[getSlotIndex(var2, this.slots.length)]; var3 != null; var3 = var3.nextEntry) { -+ if (var3.hashEntry == par1) { - return var3; - } - } -@@ -48,76 +75,94 @@ - return null; - } - -- public void addKey(int var1, Object var2) { -- this.f.add(Integer.valueOf(var1)); -- int var3 = computeHash(var1); -+ /** -+ * Adds a key and associated value to this map -+ */ -+ public void addKey(int par1, Object par2Obj) { -+ this.keySet.add(Integer.valueOf(par1)); -+ int var3 = computeHash(par1); - int var4 = getSlotIndex(var3, this.slots.length); - -- for(IntHashMapEntry var5 = this.slots[var4]; var5 != null; var5 = var5.nextEntry) { -- if(var5.hashEntry == var1) { -- var5.b = var2; -+ for (IntHashMapEntry var5 = this.slots[var4]; var5 != null; var5 = var5.nextEntry) { -+ if (var5.hashEntry == par1) { -+ var5.valueEntry = par2Obj; - return; - } - } - - ++this.versionStamp; -- this.insert(var3, var1, var2, var4); -+ this.insert(var3, par1, par2Obj, var4); - } - -- private void grow(int var1) { -+ /** -+ * Increases the number of hash slots -+ */ -+ private void grow(int par1) { - IntHashMapEntry[] var2 = this.slots; - int var3 = var2.length; -- if(var3 == 1073741824) { -+ -+ if (var3 == 1073741824) { - this.threshold = Integer.MAX_VALUE; - } else { -- IntHashMapEntry[] var4 = new IntHashMapEntry[var1]; -+ IntHashMapEntry[] var4 = new IntHashMapEntry[par1]; - this.copyTo(var4); - this.slots = var4; -- this.threshold = (int)((float)var1 * this.growFactor); -+ this.threshold = (int)((float)par1 * this.growFactor); - } - } - -- private void copyTo(IntHashMapEntry[] var1) { -+ /** -+ * Copies the hash slots to a new array -+ */ -+ private void copyTo(IntHashMapEntry[] par1ArrayOfIntHashMapEntry) { - IntHashMapEntry[] var2 = this.slots; -- int var3 = var1.length; -+ int var3 = par1ArrayOfIntHashMapEntry.length; - -- for(int var4 = 0; var4 < var2.length; ++var4) { -+ for (int var4 = 0; var4 < var2.length; ++var4) { - IntHashMapEntry var5 = var2[var4]; -- if(var5 != null) { -+ -+ if (var5 != null) { - var2[var4] = null; -- - IntHashMapEntry var6; -+ - do { - var6 = var5.nextEntry; - int var7 = getSlotIndex(var5.slotHash, var3); -- var5.nextEntry = var1[var7]; -- var1[var7] = var5; -+ var5.nextEntry = par1ArrayOfIntHashMapEntry[var7]; -+ par1ArrayOfIntHashMapEntry[var7] = var5; - var5 = var6; -- } while(var6 != null); -+ } while (var6 != null); - } - } -- -- } -- -- public Object removeObject(int var1) { -- this.f.remove(Integer.valueOf(var1)); -- IntHashMapEntry var2 = this.removeEntry(var1); -- return var2 == null ? null : var2.b; -- } -- -- final IntHashMapEntry removeEntry(int var1) { -- int var2 = computeHash(var1); -+ } -+ -+ /** -+ * Removes the specified object from the map and returns it -+ */ -+ public Object removeObject(int par1) { -+ this.keySet.remove(Integer.valueOf(par1)); -+ IntHashMapEntry var2 = this.removeEntry(par1); -+ return var2 == null ? null : var2.valueEntry; -+ } -+ -+ /** -+ * Removes the specified entry from the map and returns it -+ */ -+ final IntHashMapEntry removeEntry(int par1) { -+ int var2 = computeHash(par1); - int var3 = getSlotIndex(var2, this.slots.length); - IntHashMapEntry var4 = this.slots[var3]; -- - IntHashMapEntry var5; - IntHashMapEntry var6; -- for(var5 = var4; var5 != null; var5 = var6) { -+ -+ for (var5 = var4; var5 != null; var5 = var6) { - var6 = var5.nextEntry; -- if(var5.hashEntry == var1) { -+ -+ if (var5.hashEntry == par1) { - ++this.versionStamp; - --this.count; -- if(var4 == var5) { -+ -+ if (var4 == var5) { - this.slots[var3] = var6; - } else { - var4.nextEntry = var6; -@@ -132,27 +177,36 @@ - return var5; - } - -+ /** -+ * Removes all entries from the map -+ */ - public void clearMap() { - ++this.versionStamp; - IntHashMapEntry[] var1 = this.slots; - -- for(int var2 = 0; var2 < var1.length; ++var2) { -+ for (int var2 = 0; var2 < var1.length; ++var2) { - var1[var2] = null; - } - - this.count = 0; - } - -- private void insert(int var1, int var2, Object var3, int var4) { -- IntHashMapEntry var5 = this.slots[var4]; -- this.slots[var4] = new IntHashMapEntry(var1, var2, var3, var5); -- if(this.count++ >= this.threshold) { -+ /** -+ * Adds an object to a slot -+ */ -+ private void insert(int par1, int par2, Object par3Obj, int par4) { -+ IntHashMapEntry var5 = this.slots[par4]; -+ this.slots[par4] = new IntHashMapEntry(par1, par2, par3Obj, var5); -+ -+ if (this.count++ >= this.threshold) { - this.grow(2 * this.slots.length); - } -- - } - -- static int getHash(int var0) { -- return computeHash(var0); -+ /** -+ * Returns the hash code for a key -+ */ -+ static int getHash(int par0) { -+ return computeHash(par0); - } - } ---- net/minecraft/src/BlockSoulSand.java -+++ net/minecraft/src/BlockSoulSand.java -@@ -1,18 +1,25 @@ - package net.minecraft.src; - - public class BlockSoulSand extends Block { -- public BlockSoulSand(int var1) { -- super(var1, Material.sand); -+ public BlockSoulSand(int par1) { -+ super(par1, Material.sand); - this.setCreativeTab(CreativeTabs.tabBlock); - } - -- public AxisAlignedBB getCollisionBoundingBoxFromPool(World var1, int var2, int var3, int var4) { -- float var5 = 2.0F / 16.0F; -- return AxisAlignedBB.getAABBPool().getAABB((double)var2, (double)var3, (double)var4, (double)(var2 + 1), (double)((float)(var3 + 1) - var5), (double)(var4 + 1)); -+ /** -+ * Returns a bounding box from the pool of bounding boxes (this means this box can change after the pool has been -+ * cleared to be reused) -+ */ -+ public AxisAlignedBB getCollisionBoundingBoxFromPool(World par1World, int par2, int par3, int par4) { -+ float var5 = 0.125F; -+ return AxisAlignedBB.getAABBPool().getAABB((double)par2, (double)par3, (double)par4, (double)(par2 + 1), (double)((float)(par3 + 1) - var5), (double)(par4 + 1)); - } - -- public void onEntityCollidedWithBlock(World var1, int var2, int var3, int var4, Entity var5) { -- var5.motionX *= 0.4D; -- var5.motionZ *= 0.4D; -+ /** -+ * Triggered whenever an entity collides with this block (enters into the block). Args: world, x, y, z, entity -+ */ -+ public void onEntityCollidedWithBlock(World par1World, int par2, int par3, int par4, Entity par5Entity) { -+ par5Entity.motionX *= 0.4D; -+ par5Entity.motionZ *= 0.4D; - } - } ---- net/minecraft/src/ModelBlaze.java -+++ net/minecraft/src/ModelBlaze.java -@@ -1,11 +1,13 @@ - package net.minecraft.src; - - public class ModelBlaze extends ModelBase { -+ -+ /** The sticks that fly around the Blaze. */ - private ModelRenderer[] blazeSticks = new ModelRenderer[12]; - private ModelRenderer blazeHead; - - public ModelBlaze() { -- for(int var1 = 0; var1 < this.blazeSticks.length; ++var1) { -+ for (int var1 = 0; var1 < this.blazeSticks.length; ++var1) { - this.blazeSticks[var1] = new ModelRenderer(this, 0, 16); - this.blazeSticks[var1].addBox(0.0F, 0.0F, 0.0F, 2, 8, 2); - } -@@ -18,46 +20,53 @@ - return 8; - } - -- public void render(Entity var1, float var2, float var3, float var4, float var5, float var6, float var7) { -- this.setRotationAngles(var2, var3, var4, var5, var6, var7, var1); -- this.blazeHead.render(var7); -+ /** -+ * Sets the models various rotation angles then renders the model. -+ */ -+ public void render(Entity par1Entity, float par2, float par3, float par4, float par5, float par6, float par7) { -+ this.setRotationAngles(par2, par3, par4, par5, par6, par7, par1Entity); -+ this.blazeHead.render(par7); - -- for(int var8 = 0; var8 < this.blazeSticks.length; ++var8) { -- this.blazeSticks[var8].render(var7); -+ for (int var8 = 0; var8 < this.blazeSticks.length; ++var8) { -+ this.blazeSticks[var8].render(par7); - } -- - } - -- public void setRotationAngles(float var1, float var2, float var3, float var4, float var5, float var6, Entity var7) { -- float var8 = var3 * (float)Math.PI * -0.1F; -- -+ /** -+ * Sets the model's various rotation angles. For bipeds, par1 and par2 are used for animating the movement of arms and -+ * legs, where par1 represents the time(so that arms and legs swing back and forth) and par2 represents how "far" arms -+ * and legs can swing at most. -+ */ -+ public void setRotationAngles(float par1, float par2, float par3, float par4, float par5, float par6, Entity par7Entity) { -+ float var8 = par3 * (float)Math.PI * -0.1F; - int var9; -- for(var9 = 0; var9 < 4; ++var9) { -- this.blazeSticks[var9].rotationPointY = -2.0F + MathHelper.cos(((float)(var9 * 2) + var3) * 0.25F); -+ -+ for (var9 = 0; var9 < 4; ++var9) { -+ this.blazeSticks[var9].rotationPointY = -2.0F + MathHelper.cos(((float)(var9 * 2) + par3) * 0.25F); - this.blazeSticks[var9].rotationPointX = MathHelper.cos(var8) * 9.0F; - this.blazeSticks[var9].rotationPointZ = MathHelper.sin(var8) * 9.0F; -- var8 += (float)Math.PI * 0.5F; -+ ++var8; - } - -- var8 = (float)Math.PI * 0.25F + var3 * (float)Math.PI * 0.03F; -+ var8 = ((float)Math.PI / 4F) + par3 * (float)Math.PI * 0.03F; - -- for(var9 = 4; var9 < 8; ++var9) { -- this.blazeSticks[var9].rotationPointY = 2.0F + MathHelper.cos(((float)(var9 * 2) + var3) * 0.25F); -+ for (var9 = 4; var9 < 8; ++var9) { -+ this.blazeSticks[var9].rotationPointY = 2.0F + MathHelper.cos(((float)(var9 * 2) + par3) * 0.25F); - this.blazeSticks[var9].rotationPointX = MathHelper.cos(var8) * 7.0F; - this.blazeSticks[var9].rotationPointZ = MathHelper.sin(var8) * 7.0F; -- var8 += (float)Math.PI * 0.5F; -+ ++var8; - } - -- var8 = (float)Math.PI * 0.15F + var3 * (float)Math.PI * -0.05F; -+ var8 = 0.47123894F + par3 * (float)Math.PI * -0.05F; - -- for(var9 = 8; var9 < 12; ++var9) { -- this.blazeSticks[var9].rotationPointY = 11.0F + MathHelper.cos(((float)var9 * 1.5F + var3) * 0.5F); -+ for (var9 = 8; var9 < 12; ++var9) { -+ this.blazeSticks[var9].rotationPointY = 11.0F + MathHelper.cos(((float)var9 * 1.5F + par3) * 0.5F); - this.blazeSticks[var9].rotationPointX = MathHelper.cos(var8) * 5.0F; - this.blazeSticks[var9].rotationPointZ = MathHelper.sin(var8) * 5.0F; -- var8 += (float)Math.PI * 0.5F; -+ ++var8; - } - -- this.blazeHead.rotateAngleY = var4 / (180.0F / (float)Math.PI); -- this.blazeHead.rotateAngleX = var5 / (180.0F / (float)Math.PI); -+ this.blazeHead.rotateAngleY = par4 / (180F / (float)Math.PI); -+ this.blazeHead.rotateAngleX = par5 / (180F / (float)Math.PI); - } - } ---- net/minecraft/src/BlockMushroomCap.java -+++ net/minecraft/src/BlockMushroomCap.java -@@ -3,46 +3,65 @@ - import java.util.Random; - - public class BlockMushroomCap extends Block { -- private static final String[] a = new String[]{"skin_brown", "skin_red"}; -+ private static final String[] field_94429_a = new String[] {"skin_brown", "skin_red"}; -+ -+ /** The mushroom type. 0 for brown, 1 for red. */ - private final int mushroomType; - private Icon[] iconArray; - private Icon field_94426_cO; - private Icon field_94427_cP; - -- public BlockMushroomCap(int var1, Material var2, int var3) { -- super(var1, var2); -- this.mushroomType = var3; -- } -- -- public Icon getIcon(int var1, int var2) { -- return var2 == 10 && var1 > 1 ? this.field_94426_cO : (var2 >= 1 && var2 <= 9 && var1 == 1 ? this.iconArray[this.mushroomType] : (var2 >= 1 && var2 <= 3 && var1 == 2 ? this.iconArray[this.mushroomType] : (var2 >= 7 && var2 <= 9 && var1 == 3 ? this.iconArray[this.mushroomType] : ((var2 == 1 || var2 == 4 || var2 == 7) && var1 == 4 ? this.iconArray[this.mushroomType] : ((var2 == 3 || var2 == 6 || var2 == 9) && var1 == 5 ? this.iconArray[this.mushroomType] : (var2 == 14 ? this.iconArray[this.mushroomType] : (var2 == 15 ? this.field_94426_cO : this.field_94427_cP))))))); -- } -- -- public int quantityDropped(Random var1) { -- int var2 = var1.nextInt(10) - 7; -- if(var2 < 0) { -+ public BlockMushroomCap(int par1, Material par2Material, int par3) { -+ super(par1, par2Material); -+ this.mushroomType = par3; -+ } -+ -+ /** -+ * From the specified side and block metadata retrieves the blocks texture. Args: side, metadata -+ */ -+ public Icon getIcon(int par1, int par2) { -+ return par2 == 10 && par1 > 1 ? this.field_94426_cO : (par2 >= 1 && par2 <= 9 && par1 == 1 ? this.iconArray[this.mushroomType] : (par2 >= 1 && par2 <= 3 && par1 == 2 ? this.iconArray[this.mushroomType] : (par2 >= 7 && par2 <= 9 && par1 == 3 ? this.iconArray[this.mushroomType] : ((par2 == 1 || par2 == 4 || par2 == 7) && par1 == 4 ? this.iconArray[this.mushroomType] : ((par2 == 3 || par2 == 6 || par2 == 9) && par1 == 5 ? this.iconArray[this.mushroomType] : (par2 == 14 ? this.iconArray[this.mushroomType] : (par2 == 15 ? this.field_94426_cO : this.field_94427_cP))))))); -+ } -+ -+ /** -+ * Returns the quantity of items to drop on block destruction. -+ */ -+ public int quantityDropped(Random par1Random) { -+ int var2 = par1Random.nextInt(10) - 7; -+ -+ if (var2 < 0) { - var2 = 0; - } - - return var2; - } - -- public int idDropped(int var1, Random var2, int var3) { -- return Block.mushroomBrown.blockID + this.mushroomType; -- } -- -- public int idPicked(World var1, int var2, int var3, int var4) { -- return Block.mushroomBrown.blockID + this.mushroomType; -- } -- -- public void registerIcons(IconRegister var1) { -- this.iconArray = new Icon[a.length]; -- -- for(int var2 = 0; var2 < this.iconArray.length; ++var2) { -- this.iconArray[var2] = var1.registerIcon(this.getTextureName() + "_" + a[var2]); -+ /** -+ * Returns the ID of the items to drop on destruction. -+ */ -+ public int idDropped(int par1, Random par2Random, int par3) { -+ return Block.mushroomBrown.blockID + this.mushroomType; -+ } -+ -+ /** -+ * only called by clickMiddleMouseButton , and passed to inventory.setCurrentItem (along with isCreative) -+ */ -+ public int idPicked(World par1World, int par2, int par3, int par4) { -+ return Block.mushroomBrown.blockID + this.mushroomType; -+ } -+ -+ /** -+ * When this method is called, your block should register all the icons it needs with the given IconRegister. This is -+ * the only chance you get to register icons. -+ */ -+ public void registerIcons(IconRegister par1IconRegister) { -+ this.iconArray = new Icon[field_94429_a.length]; -+ -+ for (int var2 = 0; var2 < this.iconArray.length; ++var2) { -+ this.iconArray[var2] = par1IconRegister.registerIcon(this.getTextureName() + "_" + field_94429_a[var2]); - } - -- this.field_94427_cP = var1.registerIcon(this.getTextureName() + "_" + "inside"); -- this.field_94426_cO = var1.registerIcon(this.getTextureName() + "_" + "skin_stem"); -+ this.field_94427_cP = par1IconRegister.registerIcon(this.getTextureName() + "_" + "inside"); -+ this.field_94426_cO = par1IconRegister.registerIcon(this.getTextureName() + "_" + "skin_stem"); - } - } ---- net/minecraft/src/EntityMooshroom.java -+++ net/minecraft/src/EntityMooshroom.java -@@ -1,55 +1,63 @@ - package net.minecraft.src; - - public class EntityMooshroom extends EntityCow { -- public EntityMooshroom(World var1) { -- super(var1); -+ public EntityMooshroom(World par1World) { -+ super(par1World); - this.setSize(0.9F, 1.3F); - } - -- public boolean interact(EntityPlayer var1) { -- ItemStack var2 = var1.inventory.getCurrentItem(); -- if(var2 != null && var2.itemID == Item.bowlEmpty.itemID && this.getGrowingAge() >= 0) { -- if(var2.stackSize == 1) { -- var1.inventory.setInventorySlotContents(var1.inventory.currentItem, new ItemStack(Item.bowlSoup)); -+ /** -+ * Called when a player interacts with a mob. e.g. gets milk from a cow, gets into the saddle on a pig. -+ */ -+ public boolean interact(EntityPlayer par1EntityPlayer) { -+ ItemStack var2 = par1EntityPlayer.inventory.getCurrentItem(); -+ -+ if (var2 != null && var2.itemID == Item.bowlEmpty.itemID && this.getGrowingAge() >= 0) { -+ if (var2.stackSize == 1) { -+ par1EntityPlayer.inventory.setInventorySlotContents(par1EntityPlayer.inventory.currentItem, new ItemStack(Item.bowlSoup)); - return true; - } - -- if(var1.inventory.addItemStackToInventory(new ItemStack(Item.bowlSoup)) && !var1.capabilities.isCreativeMode) { -- var1.inventory.decrStackSize(var1.inventory.currentItem, 1); -+ if (par1EntityPlayer.inventory.addItemStackToInventory(new ItemStack(Item.bowlSoup)) && !par1EntityPlayer.capabilities.isCreativeMode) { -+ par1EntityPlayer.inventory.decrStackSize(par1EntityPlayer.inventory.currentItem, 1); - return true; - } - } - -- if(var2 != null && var2.itemID == Item.shears.itemID && this.getGrowingAge() >= 0) { -+ if (var2 != null && var2.itemID == Item.shears.itemID && this.getGrowingAge() >= 0) { - this.setDead(); - this.worldObj.spawnParticle("largeexplode", this.posX, this.posY + (double)(this.height / 2.0F), this.posZ, 0.0D, 0.0D, 0.0D); -- if(!this.worldObj.isRemote) { -+ -+ if (!this.worldObj.isRemote) { - EntityCow var3 = new EntityCow(this.worldObj); - var3.setLocationAndAngles(this.posX, this.posY, this.posZ, this.rotationYaw, this.rotationPitch); - var3.setHealth(this.getHealth()); - var3.renderYawOffset = this.renderYawOffset; - this.worldObj.spawnEntityInWorld(var3); - -- for(int var4 = 0; var4 < 5; ++var4) { -+ for (int var4 = 0; var4 < 5; ++var4) { - this.worldObj.spawnEntityInWorld(new EntityItem(this.worldObj, this.posX, this.posY + (double)this.height, this.posZ, new ItemStack(Block.mushroomRed))); - } - } - - return true; - } else { -- return super.interact(var1); -+ return super.interact(par1EntityPlayer); - } - } - -- public EntityMooshroom func_94900_c(EntityAgeable var1) { -+ public EntityMooshroom func_94900_c(EntityAgeable par1EntityAgeable) { - return new EntityMooshroom(this.worldObj); - } - -- public EntityCow spawnBabyAnimal(EntityAgeable var1) { -- return this.func_94900_c(var1); -+ /** -+ * This function is used when two same-species animals in 'love mode' breed to generate the new baby animal. -+ */ -+ public EntityCow spawnBabyAnimal(EntityAgeable par1EntityAgeable) { -+ return this.func_94900_c(par1EntityAgeable); - } - -- public EntityAgeable createChild(EntityAgeable var1) { -- return this.func_94900_c(var1); -+ public EntityAgeable createChild(EntityAgeable par1EntityAgeable) { -+ return this.func_94900_c(par1EntityAgeable); - } - } ---- net/minecraft/src/BlockStem.java -+++ net/minecraft/src/BlockStem.java -@@ -2,113 +2,131 @@ - - import java.util.Random; - -+import com.prupe.mcpatcher.cc.ColorizeBlock; -+ - public class BlockStem extends BlockFlower { -+ -+ /** Defines if it is a Melon or a Pumpkin that the stem is producing. */ - private final Block fruitType; - private Icon theIcon; - -- protected BlockStem(int var1, Block var2) { -- super(var1); -- this.fruitType = var2; -+ protected BlockStem(int par1, Block par2Block) { -+ super(par1); -+ this.fruitType = par2Block; - this.setTickRandomly(true); -- float var3 = 2.0F / 16.0F; -+ float var3 = 0.125F; - this.setBlockBounds(0.5F - var3, 0.0F, 0.5F - var3, 0.5F + var3, 0.25F, 0.5F + var3); - this.setCreativeTab((CreativeTabs)null); - } - -- protected boolean canThisPlantGrowOnThisBlockID(int var1) { -- return var1 == Block.tilledField.blockID; -+ /** -+ * Gets passed in the blockID of the block below and supposed to return true if its allowed to grow on the type of -+ * blockID passed in. Args: blockID -+ */ -+ protected boolean canThisPlantGrowOnThisBlockID(int par1) { -+ return par1 == Block.tilledField.blockID; - } - -- public void updateTick(World var1, int var2, int var3, int var4, Random var5) { -- super.updateTick(var1, var2, var3, var4, var5); -- if(var1.getBlockLightValue(var2, var3 + 1, var4) >= 9) { -- float var6 = this.getGrowthModifier(var1, var2, var3, var4); -- if(var5.nextInt((int)(25.0F / var6) + 1) == 0) { -- int var7 = var1.getBlockMetadata(var2, var3, var4); -- if(var7 < 7) { -+ /** -+ * Ticks the block if it's been scheduled -+ */ -+ public void updateTick(World par1World, int par2, int par3, int par4, Random par5Random) { -+ super.updateTick(par1World, par2, par3, par4, par5Random); -+ -+ if (par1World.getBlockLightValue(par2, par3 + 1, par4) >= 9) { -+ float var6 = this.getGrowthModifier(par1World, par2, par3, par4); -+ -+ if (par5Random.nextInt((int)(25.0F / var6) + 1) == 0) { -+ int var7 = par1World.getBlockMetadata(par2, par3, par4); -+ -+ if (var7 < 7) { - ++var7; -- var1.setBlockMetadata(var2, var3, var4, var7, 2); -+ par1World.setBlockMetadataWithNotify(par2, par3, par4, var7, 2); - } else { -- if(var1.getBlockId(var2 - 1, var3, var4) == this.fruitType.blockID) { -- return; -- } -- -- if(var1.getBlockId(var2 + 1, var3, var4) == this.fruitType.blockID) { -- return; -- } -- -- if(var1.getBlockId(var2, var3, var4 - 1) == this.fruitType.blockID) { -- return; -- } -- -- if(var1.getBlockId(var2, var3, var4 + 1) == this.fruitType.blockID) { -- return; -- } -- -- int var8 = var5.nextInt(4); -- int var9 = var2; -- int var10 = var4; -- if(var8 == 0) { -- var9 = var2 - 1; -- } -- -- if(var8 == 1) { -+ if (par1World.getBlockId(par2 - 1, par3, par4) == this.fruitType.blockID) { -+ return; -+ } -+ -+ if (par1World.getBlockId(par2 + 1, par3, par4) == this.fruitType.blockID) { -+ return; -+ } -+ -+ if (par1World.getBlockId(par2, par3, par4 - 1) == this.fruitType.blockID) { -+ return; -+ } -+ -+ if (par1World.getBlockId(par2, par3, par4 + 1) == this.fruitType.blockID) { -+ return; -+ } -+ -+ int var8 = par5Random.nextInt(4); -+ int var9 = par2; -+ int var10 = par4; -+ -+ if (var8 == 0) { -+ var9 = par2 - 1; -+ } -+ -+ if (var8 == 1) { - ++var9; - } - -- if(var8 == 2) { -- var10 = var4 - 1; -+ if (var8 == 2) { -+ var10 = par4 - 1; - } - -- if(var8 == 3) { -+ if (var8 == 3) { - ++var10; - } - -- int var11 = var1.getBlockId(var9, var3 - 1, var10); -- if(var1.getBlockId(var9, var3, var10) == 0 && (var11 == Block.tilledField.blockID || var11 == Block.dirt.blockID || var11 == Block.grass.blockID)) { -- var1.setBlock(var9, var3, var10, this.fruitType.blockID); -+ int var11 = par1World.getBlockId(var9, par3 - 1, var10); -+ -+ if (par1World.getBlockId(var9, par3, var10) == 0 && (var11 == Block.tilledField.blockID || var11 == Block.dirt.blockID || var11 == Block.grass.blockID)) { -+ par1World.setBlock(var9, par3, var10, this.fruitType.blockID); - } - } - } - } -- - } - -- public void fertilizeStem(World var1, int var2, int var3, int var4) { -- int var5 = var1.getBlockMetadata(var2, var3, var4) + MathHelper.getRandomIntegerInRange(var1.s, 2, 5); -- if(var5 > 7) { -+ public void fertilizeStem(World par1World, int par2, int par3, int par4) { -+ int var5 = par1World.getBlockMetadata(par2, par3, par4) + MathHelper.getRandomIntegerInRange(par1World.rand, 2, 5); -+ -+ if (var5 > 7) { - var5 = 7; - } - -- var1.setBlockMetadata(var2, var3, var4, var5, 2); -+ par1World.setBlockMetadataWithNotify(par2, par3, par4, var5, 2); - } - -- private float getGrowthModifier(World var1, int var2, int var3, int var4) { -+ private float getGrowthModifier(World par1World, int par2, int par3, int par4) { - float var5 = 1.0F; -- int var6 = var1.getBlockId(var2, var3, var4 - 1); -- int var7 = var1.getBlockId(var2, var3, var4 + 1); -- int var8 = var1.getBlockId(var2 - 1, var3, var4); -- int var9 = var1.getBlockId(var2 + 1, var3, var4); -- int var10 = var1.getBlockId(var2 - 1, var3, var4 - 1); -- int var11 = var1.getBlockId(var2 + 1, var3, var4 - 1); -- int var12 = var1.getBlockId(var2 + 1, var3, var4 + 1); -- int var13 = var1.getBlockId(var2 - 1, var3, var4 + 1); -+ int var6 = par1World.getBlockId(par2, par3, par4 - 1); -+ int var7 = par1World.getBlockId(par2, par3, par4 + 1); -+ int var8 = par1World.getBlockId(par2 - 1, par3, par4); -+ int var9 = par1World.getBlockId(par2 + 1, par3, par4); -+ int var10 = par1World.getBlockId(par2 - 1, par3, par4 - 1); -+ int var11 = par1World.getBlockId(par2 + 1, par3, par4 - 1); -+ int var12 = par1World.getBlockId(par2 + 1, par3, par4 + 1); -+ int var13 = par1World.getBlockId(par2 - 1, par3, par4 + 1); - boolean var14 = var8 == this.blockID || var9 == this.blockID; - boolean var15 = var6 == this.blockID || var7 == this.blockID; - boolean var16 = var10 == this.blockID || var11 == this.blockID || var12 == this.blockID || var13 == this.blockID; - -- for(int var17 = var2 - 1; var17 <= var2 + 1; ++var17) { -- for(int var18 = var4 - 1; var18 <= var4 + 1; ++var18) { -- int var19 = var1.getBlockId(var17, var3 - 1, var18); -+ for (int var17 = par2 - 1; var17 <= par2 + 1; ++var17) { -+ for (int var18 = par4 - 1; var18 <= par4 + 1; ++var18) { -+ int var19 = par1World.getBlockId(var17, par3 - 1, var18); - float var20 = 0.0F; -- if(var19 == Block.tilledField.blockID) { -+ -+ if (var19 == Block.tilledField.blockID) { - var20 = 1.0F; -- if(var1.getBlockMetadata(var17, var3 - 1, var18) > 0) { -+ -+ if (par1World.getBlockMetadata(var17, par3 - 1, var18) > 0) { - var20 = 3.0F; - } - } - -- if(var17 != var2 || var18 != var4) { -+ if (var17 != par2 || var18 != par4) { - var20 /= 4.0F; - } - -@@ -116,80 +134,119 @@ - } - } - -- if(var16 || var14 && var15) { -+ if (var16 || var14 && var15) { - var5 /= 2.0F; - } - - return var5; - } - -- public int getRenderColor(int var1) { -- int var2 = var1 * 32; -- int var3 = 255 - var1 * 8; -- int var4 = var1 * 4; -- return var2 << 16 | var3 << 8 | var4; -- } -- -- public int colorMultiplier(IBlockAccess var1, int var2, int var3, int var4) { -- return this.getRenderColor(var1.getBlockMetadata(var2, var3, var4)); -- } -- -+ /** -+ * Returns the color this block should be rendered. Used by leaves. -+ */ -+ public int getRenderColor(int par1) { -+ int var2 = par1 * 32; -+ int var3 = 255 - par1 * 8; -+ int var4 = par1 * 4; -+ // MCPatcher Start -+ return ColorizeBlock.colorizeStem(var2 << 16 | var3 << 8 | var4, this, par1); -+ // MCPatcher End -+ } -+ -+ /** -+ * Returns a integer with hex for 0xrrggbb with this color multiplied against the blocks color. Note only called when -+ * first determining what to render. -+ */ -+ public int colorMultiplier(IBlockAccess par1IBlockAccess, int par2, int par3, int par4) { -+ return this.getRenderColor(par1IBlockAccess.getBlockMetadata(par2, par3, par4)); -+ } -+ -+ /** -+ * Sets the block's bounds for rendering it as an item -+ */ - public void setBlockBoundsForItemRender() { -- float var1 = 2.0F / 16.0F; -+ float var1 = 0.125F; - this.setBlockBounds(0.5F - var1, 0.0F, 0.5F - var1, 0.5F + var1, 0.25F, 0.5F + var1); - } - -- public void setBlockBoundsBasedOnState(IBlockAccess var1, int var2, int var3, int var4) { -- this.maxY = (double)((float)(var1.getBlockMetadata(var2, var3, var4) * 2 + 2) / 16.0F); -- float var5 = 2.0F / 16.0F; -+ /** -+ * Updates the blocks bounds based on its current state. Args: world, x, y, z -+ */ -+ public void setBlockBoundsBasedOnState(IBlockAccess par1IBlockAccess, int par2, int par3, int par4) { -+ this.maxY = (double)((float)(par1IBlockAccess.getBlockMetadata(par2, par3, par4) * 2 + 2) / 16.0F); -+ float var5 = 0.125F; - this.setBlockBounds(0.5F - var5, 0.0F, 0.5F - var5, 0.5F + var5, (float)this.maxY, 0.5F + var5); - } - -+ /** -+ * The type of render function that is called for this block -+ */ - public int getRenderType() { - return 19; - } - -- public int getState(IBlockAccess var1, int var2, int var3, int var4) { -- int var5 = var1.getBlockMetadata(var2, var3, var4); -- return var5 < 7 ? -1 : (var1.getBlockId(var2 - 1, var3, var4) == this.fruitType.blockID ? 0 : (var1.getBlockId(var2 + 1, var3, var4) == this.fruitType.blockID ? 1 : (var1.getBlockId(var2, var3, var4 - 1) == this.fruitType.blockID ? 2 : (var1.getBlockId(var2, var3, var4 + 1) == this.fruitType.blockID ? 3 : -1)))); -+ /** -+ * Returns the current state of the stem. Returns -1 if the stem is not fully grown, or a value between 0 and 3 based -+ * on the direction the stem is facing. -+ */ -+ public int getState(IBlockAccess par1IBlockAccess, int par2, int par3, int par4) { -+ int var5 = par1IBlockAccess.getBlockMetadata(par2, par3, par4); -+ return var5 < 7 ? -1 : (par1IBlockAccess.getBlockId(par2 - 1, par3, par4) == this.fruitType.blockID ? 0 : (par1IBlockAccess.getBlockId(par2 + 1, par3, par4) == this.fruitType.blockID ? 1 : (par1IBlockAccess.getBlockId(par2, par3, par4 - 1) == this.fruitType.blockID ? 2 : (par1IBlockAccess.getBlockId(par2, par3, par4 + 1) == this.fruitType.blockID ? 3 : -1)))); - } - -- public void dropBlockAsItemWithChance(World var1, int var2, int var3, int var4, int var5, float var6, int var7) { -- super.dropBlockAsItemWithChance(var1, var2, var3, var4, var5, var6, var7); -- if(!var1.isRemote) { -+ /** -+ * Drops the block items with a specified chance of dropping the specified items -+ */ -+ public void dropBlockAsItemWithChance(World par1World, int par2, int par3, int par4, int par5, float par6, int par7) { -+ super.dropBlockAsItemWithChance(par1World, par2, par3, par4, par5, par6, par7); -+ -+ if (!par1World.isRemote) { - Item var8 = null; -- if(this.fruitType == Block.pumpkin) { -+ -+ if (this.fruitType == Block.pumpkin) { - var8 = Item.pumpkinSeeds; - } - -- if(this.fruitType == Block.melon) { -+ if (this.fruitType == Block.melon) { - var8 = Item.melonSeeds; - } - -- for(int var9 = 0; var9 < 3; ++var9) { -- if(var1.s.nextInt(15) <= var5) { -- this.dropBlockAsItem_do(var1, var2, var3, var4, new ItemStack(var8)); -+ for (int var9 = 0; var9 < 3; ++var9) { -+ if (par1World.rand.nextInt(15) <= par5) { -+ this.dropBlockAsItem_do(par1World, par2, par3, par4, new ItemStack(var8)); - } - } -- - } - } - -- public int idDropped(int var1, Random var2, int var3) { -+ /** -+ * Returns the ID of the items to drop on destruction. -+ */ -+ public int idDropped(int par1, Random par2Random, int par3) { - return -1; - } - -- public int quantityDropped(Random var1) { -+ /** -+ * Returns the quantity of items to drop on block destruction. -+ */ -+ public int quantityDropped(Random par1Random) { - return 1; - } - -- public int idPicked(World var1, int var2, int var3, int var4) { -+ /** -+ * only called by clickMiddleMouseButton , and passed to inventory.setCurrentItem (along with isCreative) -+ */ -+ public int idPicked(World par1World, int par2, int par3, int par4) { - return this.fruitType == Block.pumpkin ? Item.pumpkinSeeds.itemID : (this.fruitType == Block.melon ? Item.melonSeeds.itemID : 0); - } - -- public void registerIcons(IconRegister var1) { -- this.blockIcon = var1.registerIcon(this.getTextureName() + "_disconnected"); -- this.theIcon = var1.registerIcon(this.getTextureName() + "_connected"); -+ /** -+ * When this method is called, your block should register all the icons it needs with the given IconRegister. This is -+ * the only chance you get to register icons. -+ */ -+ public void registerIcons(IconRegister par1IconRegister) { -+ this.blockIcon = par1IconRegister.registerIcon(this.getTextureName() + "_disconnected"); -+ this.theIcon = par1IconRegister.registerIcon(this.getTextureName() + "_connected"); - } - - public Icon getStemIcon() { ---- net/minecraft/src/ComponentNetherBridgeNetherStalkRoom.java -+++ net/minecraft/src/ComponentNetherBridgeNetherStalkRoom.java -@@ -4,133 +4,142 @@ - import java.util.Random; - - public class ComponentNetherBridgeNetherStalkRoom extends ComponentNetherBridgePiece { -- public ComponentNetherBridgeNetherStalkRoom() { -- } -- -- public ComponentNetherBridgeNetherStalkRoom(int var1, Random var2, StructureBoundingBox var3, int var4) { -- super(var1); -- this.coordBaseMode = var4; -- this.boundingBox = var3; -- } -- -- public void buildComponent(StructureComponent var1, List var2, Random var3) { -- this.getNextComponentNormal((ComponentNetherBridgeStartPiece)var1, var2, var3, 5, 3, true); -- this.getNextComponentNormal((ComponentNetherBridgeStartPiece)var1, var2, var3, 5, 11, true); -- } -- -- public static ComponentNetherBridgeNetherStalkRoom createValidComponent(List var0, Random var1, int var2, int var3, int var4, int var5, int var6) { -- StructureBoundingBox var7 = StructureBoundingBox.getComponentToAddBoundingBox(var2, var3, var4, -5, -3, 0, 13, 14, 13, var5); -- return isAboveGround(var7) && StructureComponent.findIntersecting(var0, var7) == null ? new ComponentNetherBridgeNetherStalkRoom(var6, var1, var7, var5) : null; -- } -- -- public boolean addComponentParts(World var1, Random var2, StructureBoundingBox var3) { -- this.fillWithBlocks(var1, var3, 0, 3, 0, 12, 4, 12, Block.netherBrick.blockID, Block.netherBrick.blockID, false); -- this.fillWithBlocks(var1, var3, 0, 5, 0, 12, 13, 12, 0, 0, false); -- this.fillWithBlocks(var1, var3, 0, 5, 0, 1, 12, 12, Block.netherBrick.blockID, Block.netherBrick.blockID, false); -- this.fillWithBlocks(var1, var3, 11, 5, 0, 12, 12, 12, Block.netherBrick.blockID, Block.netherBrick.blockID, false); -- this.fillWithBlocks(var1, var3, 2, 5, 11, 4, 12, 12, Block.netherBrick.blockID, Block.netherBrick.blockID, false); -- this.fillWithBlocks(var1, var3, 8, 5, 11, 10, 12, 12, Block.netherBrick.blockID, Block.netherBrick.blockID, false); -- this.fillWithBlocks(var1, var3, 5, 9, 11, 7, 12, 12, Block.netherBrick.blockID, Block.netherBrick.blockID, false); -- this.fillWithBlocks(var1, var3, 2, 5, 0, 4, 12, 1, Block.netherBrick.blockID, Block.netherBrick.blockID, false); -- this.fillWithBlocks(var1, var3, 8, 5, 0, 10, 12, 1, Block.netherBrick.blockID, Block.netherBrick.blockID, false); -- this.fillWithBlocks(var1, var3, 5, 9, 0, 7, 12, 1, Block.netherBrick.blockID, Block.netherBrick.blockID, false); -- this.fillWithBlocks(var1, var3, 2, 11, 2, 10, 12, 10, Block.netherBrick.blockID, Block.netherBrick.blockID, false); -- -+ public ComponentNetherBridgeNetherStalkRoom() {} -+ -+ public ComponentNetherBridgeNetherStalkRoom(int par1, Random par2Random, StructureBoundingBox par3StructureBoundingBox, int par4) { -+ super(par1); -+ this.coordBaseMode = par4; -+ this.boundingBox = par3StructureBoundingBox; -+ } -+ -+ /** -+ * Initiates construction of the Structure Component picked, at the current Location of StructGen -+ */ -+ public void buildComponent(StructureComponent par1StructureComponent, List par2List, Random par3Random) { -+ this.getNextComponentNormal((ComponentNetherBridgeStartPiece)par1StructureComponent, par2List, par3Random, 5, 3, true); -+ this.getNextComponentNormal((ComponentNetherBridgeStartPiece)par1StructureComponent, par2List, par3Random, 5, 11, true); -+ } -+ -+ /** -+ * Creates and returns a new component piece. Or null if it could not find enough room to place it. -+ */ -+ public static ComponentNetherBridgeNetherStalkRoom createValidComponent(List par0List, Random par1Random, int par2, int par3, int par4, int par5, int par6) { -+ StructureBoundingBox var7 = StructureBoundingBox.getComponentToAddBoundingBox(par2, par3, par4, -5, -3, 0, 13, 14, 13, par5); -+ return isAboveGround(var7) && StructureComponent.findIntersecting(par0List, var7) == null ? new ComponentNetherBridgeNetherStalkRoom(par6, par1Random, var7, par5) : null; -+ } -+ -+ /** -+ * second Part of Structure generating, this for example places Spiderwebs, Mob Spawners, it closes Mineshafts at the -+ * end, it adds Fences... -+ */ -+ public boolean addComponentParts(World par1World, Random par2Random, StructureBoundingBox par3StructureBoundingBox) { -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 0, 3, 0, 12, 4, 12, Block.netherBrick.blockID, Block.netherBrick.blockID, false); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 0, 5, 0, 12, 13, 12, 0, 0, false); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 0, 5, 0, 1, 12, 12, Block.netherBrick.blockID, Block.netherBrick.blockID, false); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 11, 5, 0, 12, 12, 12, Block.netherBrick.blockID, Block.netherBrick.blockID, false); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 2, 5, 11, 4, 12, 12, Block.netherBrick.blockID, Block.netherBrick.blockID, false); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 8, 5, 11, 10, 12, 12, Block.netherBrick.blockID, Block.netherBrick.blockID, false); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 5, 9, 11, 7, 12, 12, Block.netherBrick.blockID, Block.netherBrick.blockID, false); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 2, 5, 0, 4, 12, 1, Block.netherBrick.blockID, Block.netherBrick.blockID, false); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 8, 5, 0, 10, 12, 1, Block.netherBrick.blockID, Block.netherBrick.blockID, false); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 5, 9, 0, 7, 12, 1, Block.netherBrick.blockID, Block.netherBrick.blockID, false); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 2, 11, 2, 10, 12, 10, Block.netherBrick.blockID, Block.netherBrick.blockID, false); - int var4; -- for(var4 = 1; var4 <= 11; var4 += 2) { -- this.fillWithBlocks(var1, var3, var4, 10, 0, var4, 11, 0, Block.netherFence.blockID, Block.netherFence.blockID, false); -- this.fillWithBlocks(var1, var3, var4, 10, 12, var4, 11, 12, Block.netherFence.blockID, Block.netherFence.blockID, false); -- this.fillWithBlocks(var1, var3, 0, 10, var4, 0, 11, var4, Block.netherFence.blockID, Block.netherFence.blockID, false); -- this.fillWithBlocks(var1, var3, 12, 10, var4, 12, 11, var4, Block.netherFence.blockID, Block.netherFence.blockID, false); -- this.placeBlockAtCurrentPosition(var1, Block.netherBrick.blockID, 0, var4, 13, 0, var3); -- this.placeBlockAtCurrentPosition(var1, Block.netherBrick.blockID, 0, var4, 13, 12, var3); -- this.placeBlockAtCurrentPosition(var1, Block.netherBrick.blockID, 0, 0, 13, var4, var3); -- this.placeBlockAtCurrentPosition(var1, Block.netherBrick.blockID, 0, 12, 13, var4, var3); -- this.placeBlockAtCurrentPosition(var1, Block.netherFence.blockID, 0, var4 + 1, 13, 0, var3); -- this.placeBlockAtCurrentPosition(var1, Block.netherFence.blockID, 0, var4 + 1, 13, 12, var3); -- this.placeBlockAtCurrentPosition(var1, Block.netherFence.blockID, 0, 0, 13, var4 + 1, var3); -- this.placeBlockAtCurrentPosition(var1, Block.netherFence.blockID, 0, 12, 13, var4 + 1, var3); -+ -+ for (var4 = 1; var4 <= 11; var4 += 2) { -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, var4, 10, 0, var4, 11, 0, Block.netherFence.blockID, Block.netherFence.blockID, false); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, var4, 10, 12, var4, 11, 12, Block.netherFence.blockID, Block.netherFence.blockID, false); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 0, 10, var4, 0, 11, var4, Block.netherFence.blockID, Block.netherFence.blockID, false); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 12, 10, var4, 12, 11, var4, Block.netherFence.blockID, Block.netherFence.blockID, false); -+ this.placeBlockAtCurrentPosition(par1World, Block.netherBrick.blockID, 0, var4, 13, 0, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.netherBrick.blockID, 0, var4, 13, 12, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.netherBrick.blockID, 0, 0, 13, var4, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.netherBrick.blockID, 0, 12, 13, var4, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.netherFence.blockID, 0, var4 + 1, 13, 0, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.netherFence.blockID, 0, var4 + 1, 13, 12, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.netherFence.blockID, 0, 0, 13, var4 + 1, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.netherFence.blockID, 0, 12, 13, var4 + 1, par3StructureBoundingBox); - } - -- this.placeBlockAtCurrentPosition(var1, Block.netherFence.blockID, 0, 0, 13, 0, var3); -- this.placeBlockAtCurrentPosition(var1, Block.netherFence.blockID, 0, 0, 13, 12, var3); -- this.placeBlockAtCurrentPosition(var1, Block.netherFence.blockID, 0, 0, 13, 0, var3); -- this.placeBlockAtCurrentPosition(var1, Block.netherFence.blockID, 0, 12, 13, 0, var3); -+ this.placeBlockAtCurrentPosition(par1World, Block.netherFence.blockID, 0, 0, 13, 0, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.netherFence.blockID, 0, 0, 13, 12, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.netherFence.blockID, 0, 0, 13, 0, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.netherFence.blockID, 0, 12, 13, 0, par3StructureBoundingBox); - -- for(var4 = 3; var4 <= 9; var4 += 2) { -- this.fillWithBlocks(var1, var3, 1, 7, var4, 1, 8, var4, Block.netherFence.blockID, Block.netherFence.blockID, false); -- this.fillWithBlocks(var1, var3, 11, 7, var4, 11, 8, var4, Block.netherFence.blockID, Block.netherFence.blockID, false); -+ for (var4 = 3; var4 <= 9; var4 += 2) { -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 1, 7, var4, 1, 8, var4, Block.netherFence.blockID, Block.netherFence.blockID, false); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 11, 7, var4, 11, 8, var4, Block.netherFence.blockID, Block.netherFence.blockID, false); - } - - var4 = this.getMetadataWithOffset(Block.stairsNetherBrick.blockID, 3); -- - int var5; - int var6; - int var7; -- for(var5 = 0; var5 <= 6; ++var5) { -+ -+ for (var5 = 0; var5 <= 6; ++var5) { - var6 = var5 + 4; - -- for(var7 = 5; var7 <= 7; ++var7) { -- this.placeBlockAtCurrentPosition(var1, Block.stairsNetherBrick.blockID, var4, var7, 5 + var5, var6, var3); -- } -- -- if(var6 >= 5 && var6 <= 8) { -- this.fillWithBlocks(var1, var3, 5, 5, var6, 7, var5 + 4, var6, Block.netherBrick.blockID, Block.netherBrick.blockID, false); -- } else if(var6 >= 9 && var6 <= 10) { -- this.fillWithBlocks(var1, var3, 5, 8, var6, 7, var5 + 4, var6, Block.netherBrick.blockID, Block.netherBrick.blockID, false); -- } -- -- if(var5 >= 1) { -- this.fillWithBlocks(var1, var3, 5, 6 + var5, var6, 7, 9 + var5, var6, 0, 0, false); -- } -- } -- -- for(var5 = 5; var5 <= 7; ++var5) { -- this.placeBlockAtCurrentPosition(var1, Block.stairsNetherBrick.blockID, var4, var5, 12, 11, var3); -- } -- -- this.fillWithBlocks(var1, var3, 5, 6, 7, 5, 7, 7, Block.netherFence.blockID, Block.netherFence.blockID, false); -- this.fillWithBlocks(var1, var3, 7, 6, 7, 7, 7, 7, Block.netherFence.blockID, Block.netherFence.blockID, false); -- this.fillWithBlocks(var1, var3, 5, 13, 12, 7, 13, 12, 0, 0, false); -- this.fillWithBlocks(var1, var3, 2, 5, 2, 3, 5, 3, Block.netherBrick.blockID, Block.netherBrick.blockID, false); -- this.fillWithBlocks(var1, var3, 2, 5, 9, 3, 5, 10, Block.netherBrick.blockID, Block.netherBrick.blockID, false); -- this.fillWithBlocks(var1, var3, 2, 5, 4, 2, 5, 8, Block.netherBrick.blockID, Block.netherBrick.blockID, false); -- this.fillWithBlocks(var1, var3, 9, 5, 2, 10, 5, 3, Block.netherBrick.blockID, Block.netherBrick.blockID, false); -- this.fillWithBlocks(var1, var3, 9, 5, 9, 10, 5, 10, Block.netherBrick.blockID, Block.netherBrick.blockID, false); -- this.fillWithBlocks(var1, var3, 10, 5, 4, 10, 5, 8, Block.netherBrick.blockID, Block.netherBrick.blockID, false); -+ for (var7 = 5; var7 <= 7; ++var7) { -+ this.placeBlockAtCurrentPosition(par1World, Block.stairsNetherBrick.blockID, var4, var7, 5 + var5, var6, par3StructureBoundingBox); -+ } -+ -+ if (var6 >= 5 && var6 <= 8) { -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 5, 5, var6, 7, var5 + 4, var6, Block.netherBrick.blockID, Block.netherBrick.blockID, false); -+ } else if (var6 >= 9 && var6 <= 10) { -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 5, 8, var6, 7, var5 + 4, var6, Block.netherBrick.blockID, Block.netherBrick.blockID, false); -+ } -+ -+ if (var5 >= 1) { -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 5, 6 + var5, var6, 7, 9 + var5, var6, 0, 0, false); -+ } -+ } -+ -+ for (var5 = 5; var5 <= 7; ++var5) { -+ this.placeBlockAtCurrentPosition(par1World, Block.stairsNetherBrick.blockID, var4, var5, 12, 11, par3StructureBoundingBox); -+ } -+ -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 5, 6, 7, 5, 7, 7, Block.netherFence.blockID, Block.netherFence.blockID, false); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 7, 6, 7, 7, 7, 7, Block.netherFence.blockID, Block.netherFence.blockID, false); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 5, 13, 12, 7, 13, 12, 0, 0, false); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 2, 5, 2, 3, 5, 3, Block.netherBrick.blockID, Block.netherBrick.blockID, false); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 2, 5, 9, 3, 5, 10, Block.netherBrick.blockID, Block.netherBrick.blockID, false); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 2, 5, 4, 2, 5, 8, Block.netherBrick.blockID, Block.netherBrick.blockID, false); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 9, 5, 2, 10, 5, 3, Block.netherBrick.blockID, Block.netherBrick.blockID, false); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 9, 5, 9, 10, 5, 10, Block.netherBrick.blockID, Block.netherBrick.blockID, false); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 10, 5, 4, 10, 5, 8, Block.netherBrick.blockID, Block.netherBrick.blockID, false); - var5 = this.getMetadataWithOffset(Block.stairsNetherBrick.blockID, 0); - var6 = this.getMetadataWithOffset(Block.stairsNetherBrick.blockID, 1); -- this.placeBlockAtCurrentPosition(var1, Block.stairsNetherBrick.blockID, var6, 4, 5, 2, var3); -- this.placeBlockAtCurrentPosition(var1, Block.stairsNetherBrick.blockID, var6, 4, 5, 3, var3); -- this.placeBlockAtCurrentPosition(var1, Block.stairsNetherBrick.blockID, var6, 4, 5, 9, var3); -- this.placeBlockAtCurrentPosition(var1, Block.stairsNetherBrick.blockID, var6, 4, 5, 10, var3); -- this.placeBlockAtCurrentPosition(var1, Block.stairsNetherBrick.blockID, var5, 8, 5, 2, var3); -- this.placeBlockAtCurrentPosition(var1, Block.stairsNetherBrick.blockID, var5, 8, 5, 3, var3); -- this.placeBlockAtCurrentPosition(var1, Block.stairsNetherBrick.blockID, var5, 8, 5, 9, var3); -- this.placeBlockAtCurrentPosition(var1, Block.stairsNetherBrick.blockID, var5, 8, 5, 10, var3); -- this.fillWithBlocks(var1, var3, 3, 4, 4, 4, 4, 8, Block.slowSand.blockID, Block.slowSand.blockID, false); -- this.fillWithBlocks(var1, var3, 8, 4, 4, 9, 4, 8, Block.slowSand.blockID, Block.slowSand.blockID, false); -- this.fillWithBlocks(var1, var3, 3, 5, 4, 4, 5, 8, Block.netherStalk.blockID, Block.netherStalk.blockID, false); -- this.fillWithBlocks(var1, var3, 8, 5, 4, 9, 5, 8, Block.netherStalk.blockID, Block.netherStalk.blockID, false); -- this.fillWithBlocks(var1, var3, 4, 2, 0, 8, 2, 12, Block.netherBrick.blockID, Block.netherBrick.blockID, false); -- this.fillWithBlocks(var1, var3, 0, 2, 4, 12, 2, 8, Block.netherBrick.blockID, Block.netherBrick.blockID, false); -- this.fillWithBlocks(var1, var3, 4, 0, 0, 8, 1, 3, Block.netherBrick.blockID, Block.netherBrick.blockID, false); -- this.fillWithBlocks(var1, var3, 4, 0, 9, 8, 1, 12, Block.netherBrick.blockID, Block.netherBrick.blockID, false); -- this.fillWithBlocks(var1, var3, 0, 0, 4, 3, 1, 8, Block.netherBrick.blockID, Block.netherBrick.blockID, false); -- this.fillWithBlocks(var1, var3, 9, 0, 4, 12, 1, 8, Block.netherBrick.blockID, Block.netherBrick.blockID, false); -- -+ this.placeBlockAtCurrentPosition(par1World, Block.stairsNetherBrick.blockID, var6, 4, 5, 2, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.stairsNetherBrick.blockID, var6, 4, 5, 3, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.stairsNetherBrick.blockID, var6, 4, 5, 9, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.stairsNetherBrick.blockID, var6, 4, 5, 10, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.stairsNetherBrick.blockID, var5, 8, 5, 2, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.stairsNetherBrick.blockID, var5, 8, 5, 3, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.stairsNetherBrick.blockID, var5, 8, 5, 9, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.stairsNetherBrick.blockID, var5, 8, 5, 10, par3StructureBoundingBox); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 3, 4, 4, 4, 4, 8, Block.slowSand.blockID, Block.slowSand.blockID, false); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 8, 4, 4, 9, 4, 8, Block.slowSand.blockID, Block.slowSand.blockID, false); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 3, 5, 4, 4, 5, 8, Block.netherStalk.blockID, Block.netherStalk.blockID, false); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 8, 5, 4, 9, 5, 8, Block.netherStalk.blockID, Block.netherStalk.blockID, false); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 4, 2, 0, 8, 2, 12, Block.netherBrick.blockID, Block.netherBrick.blockID, false); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 0, 2, 4, 12, 2, 8, Block.netherBrick.blockID, Block.netherBrick.blockID, false); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 4, 0, 0, 8, 1, 3, Block.netherBrick.blockID, Block.netherBrick.blockID, false); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 4, 0, 9, 8, 1, 12, Block.netherBrick.blockID, Block.netherBrick.blockID, false); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 0, 0, 4, 3, 1, 8, Block.netherBrick.blockID, Block.netherBrick.blockID, false); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 9, 0, 4, 12, 1, 8, Block.netherBrick.blockID, Block.netherBrick.blockID, false); - int var8; -- for(var7 = 4; var7 <= 8; ++var7) { -- for(var8 = 0; var8 <= 2; ++var8) { -- this.fillCurrentPositionBlocksDownwards(var1, Block.netherBrick.blockID, 0, var7, -1, var8, var3); -- this.fillCurrentPositionBlocksDownwards(var1, Block.netherBrick.blockID, 0, var7, -1, 12 - var8, var3); -+ -+ for (var7 = 4; var7 <= 8; ++var7) { -+ for (var8 = 0; var8 <= 2; ++var8) { -+ this.fillCurrentPositionBlocksDownwards(par1World, Block.netherBrick.blockID, 0, var7, -1, var8, par3StructureBoundingBox); -+ this.fillCurrentPositionBlocksDownwards(par1World, Block.netherBrick.blockID, 0, var7, -1, 12 - var8, par3StructureBoundingBox); - } - } - -- for(var7 = 0; var7 <= 2; ++var7) { -- for(var8 = 4; var8 <= 8; ++var8) { -- this.fillCurrentPositionBlocksDownwards(var1, Block.netherBrick.blockID, 0, var7, -1, var8, var3); -- this.fillCurrentPositionBlocksDownwards(var1, Block.netherBrick.blockID, 0, 12 - var7, -1, var8, var3); -+ for (var7 = 0; var7 <= 2; ++var7) { -+ for (var8 = 4; var8 <= 8; ++var8) { -+ this.fillCurrentPositionBlocksDownwards(par1World, Block.netherBrick.blockID, 0, var7, -1, var8, par3StructureBoundingBox); -+ this.fillCurrentPositionBlocksDownwards(par1World, Block.netherBrick.blockID, 0, 12 - var7, -1, var8, par3StructureBoundingBox); - } - } - ---- /dev/null -+++ org/spoutcraft/client/gui/minimap/TintType.java -@@ -1,0 +1,42 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.client.gui.minimap; -+ -+import java.util.HashMap; -+ -+/** -+ * Represents the possible types of tint available for block colors -+ */ -+public enum TintType { -+ // Redstone is actually based on the metadata... -+ NONE, GRASS, TALL_GRASS, FOLIAGE, PINE, BIRCH, REDSTONE, GLASS, WATER, COLORMULT; -+ public static final HashMap map; -+ -+ public static TintType get(String name) { -+ return map.get(name); -+ } -+ -+ static { -+ map = new HashMap(); -+ for (TintType t : TintType.values()) { -+ map.put(t.name(), t); -+ } -+ } -+} ---- net/minecraft/src/EntitySuspendFX.java -+++ net/minecraft/src/EntitySuspendFX.java -@@ -1,32 +1,43 @@ - package net.minecraft.src; - -+// MCPatcher Start -+import com.prupe.mcpatcher.cc.ColorizeBlock; -+import com.prupe.mcpatcher.cc.Colorizer; -+// MCPatcher End -+ - public class EntitySuspendFX extends EntityFX { -- public EntitySuspendFX(World var1, double var2, double var4, double var6, double var8, double var10, double var12) { -- super(var1, var2, var4 - 0.125D, var6, var8, var10, var12); -- this.particleRed = 0.4F; -- this.particleGreen = 0.4F; -- this.particleBlue = 0.7F; -+ public EntitySuspendFX(World par1World, double par2, double par4, double par6, double par8, double par10, double par12) { -+ super(par1World, par2, par4 - 0.125D, par6, par8, par10, par12); -+ // MCPatcher Start -+ Colorizer.setColorF(ColorizeBlock.colorizeBiome(6710962, Colorizer.COLOR_MAP_UNDERWATER, (int)par2, (int)par4, (int)par6)); -+ this.particleRed = Colorizer.setColor[0]; -+ this.particleGreen = Colorizer.setColor[1]; -+ this.particleBlue = Colorizer.setColor[2]; -+ // MCPatcher End - this.setParticleTextureIndex(0); - this.setSize(0.01F, 0.01F); -- this.particleScale *= this.ab.nextFloat() * 0.6F + 0.2F; -- this.motionX = var8 * 0.0D; -- this.motionY = var10 * 0.0D; -- this.motionZ = var12 * 0.0D; -+ this.particleScale *= this.rand.nextFloat() * 0.6F + 0.2F; -+ this.motionX = par8 * 0.0D; -+ this.motionY = par10 * 0.0D; -+ this.motionZ = par12 * 0.0D; - this.particleMaxAge = (int)(16.0D / (Math.random() * 0.8D + 0.2D)); - } - -+ /** -+ * Called to update the entity's position/logic. -+ */ - public void onUpdate() { - this.prevPosX = this.posX; - this.prevPosY = this.posY; - this.prevPosZ = this.posZ; - this.moveEntity(this.motionX, this.motionY, this.motionZ); -- if(this.worldObj.getBlockMaterial(MathHelper.floor_double(this.posX), MathHelper.floor_double(this.posY), MathHelper.floor_double(this.posZ)) != Material.water) { -- this.setDead(); -- } -- -- if(this.particleMaxAge-- <= 0) { -- this.setDead(); -- } -- -+ -+ if (this.worldObj.getBlockMaterial(MathHelper.floor_double(this.posX), MathHelper.floor_double(this.posY), MathHelper.floor_double(this.posZ)) != Material.water) { -+ this.setDead(); -+ } -+ -+ if (this.particleMaxAge-- <= 0) { -+ this.setDead(); -+ } - } - } ---- net/minecraft/src/BlockColored.java -+++ net/minecraft/src/BlockColored.java -@@ -5,40 +5,57 @@ - public class BlockColored extends Block { - private Icon[] iconArray; - -- public BlockColored(int var1, Material var2) { -- super(var1, var2); -+ public BlockColored(int par1, Material par2Material) { -+ super(par1, par2Material); - this.setCreativeTab(CreativeTabs.tabBlock); - } - -- public Icon getIcon(int var1, int var2) { -- return this.iconArray[var2 % this.iconArray.length]; -- } -- -- public int damageDropped(int var1) { -- return var1; -- } -- -- public static int getBlockFromDye(int var0) { -- return ~var0 & 15; -- } -- -- public static int getDyeFromBlock(int var0) { -- return ~var0 & 15; -- } -- -- public void getSubBlocks(int var1, CreativeTabs var2, List var3) { -- for(int var4 = 0; var4 < 16; ++var4) { -- var3.add(new ItemStack(var1, 1, var4)); -+ /** -+ * From the specified side and block metadata retrieves the blocks texture. Args: side, metadata -+ */ -+ public Icon getIcon(int par1, int par2) { -+ return this.iconArray[par2 % this.iconArray.length]; -+ } -+ -+ /** -+ * Determines the damage on the item the block drops. Used in cloth and wood. -+ */ -+ public int damageDropped(int par1) { -+ return par1; -+ } -+ -+ /** -+ * Takes a dye damage value and returns the block damage value to match -+ */ -+ public static int getBlockFromDye(int par0) { -+ return ~par0 & 15; -+ } -+ -+ /** -+ * Takes a block damage value and returns the dye damage value to match -+ */ -+ public static int getDyeFromBlock(int par0) { -+ return ~par0 & 15; -+ } -+ -+ /** -+ * returns a list of blocks with the same ID, but different meta (eg: wood returns 4 blocks) -+ */ -+ public void getSubBlocks(int par1, CreativeTabs par2CreativeTabs, List par3List) { -+ for (int var4 = 0; var4 < 16; ++var4) { -+ par3List.add(new ItemStack(par1, 1, var4)); - } -- - } - -- public void registerIcons(IconRegister var1) { -+ /** -+ * When this method is called, your block should register all the icons it needs with the given IconRegister. This is -+ * the only chance you get to register icons. -+ */ -+ public void registerIcons(IconRegister par1IconRegister) { - this.iconArray = new Icon[16]; - -- for(int var2 = 0; var2 < this.iconArray.length; ++var2) { -- this.iconArray[var2] = var1.registerIcon(this.getTextureName() + "_" + ItemDye.b[getDyeFromBlock(var2)]); -+ for (int var2 = 0; var2 < this.iconArray.length; ++var2) { -+ this.iconArray[var2] = par1IconRegister.registerIcon(this.getTextureName() + "_" + ItemDye.dyeItemNames[getDyeFromBlock(var2)]); - } -- - } - } ---- /dev/null -+++ org/spoutcraft/api/ChatColor.java -@@ -1,0 +1,92 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.api; -+ -+import java.util.HashMap; -+import java.util.Map; -+ -+@SuppressWarnings({ "rawtypes", "unchecked" }) -+public enum ChatColor { -+ BLACK(0), -+ -+ DARK_BLUE(1), -+ -+ DARK_GREEN(2), -+ -+ DARK_AQUA(3), -+ -+ DARK_RED(4), -+ -+ DARK_PURPLE(5), -+ -+ GOLD(6), -+ -+ GRAY(7), -+ -+ DARK_GRAY(8), -+ -+ BLUE(9), -+ -+ GREEN(10), -+ -+ AQUA(11), -+ -+ RED(12), -+ -+ LIGHT_PURPLE(13), -+ -+ YELLOW(14), -+ -+ WHITE(15); -+ -+ private final int code; -+ private static final Map colors; -+ -+ private ChatColor(int code) { -+ this.code = code; -+ } -+ -+ public int getCode() { -+ return this.code; -+ } -+ -+ public String toString() { -+ return String.format("\u00A7%x", new Object[] { Integer.valueOf(this.code) }); -+ } -+ -+ public static ChatColor getByCode(int code) { -+ return (ChatColor) colors.get(Integer.valueOf(code)); -+ } -+ -+ public static String stripColor(String input) { -+ if (input == null) { -+ return null; -+ } -+ -+ return input.replaceAll("(?i)\u00A7[0-F]", ""); -+ } -+ -+ static { -+ colors = new HashMap(); -+ -+ for (ChatColor color : values()) -+ colors.put(Integer.valueOf(color.getCode()), color); -+ } -+} ---- net/minecraft/src/GenLayerBiome.java -+++ net/minecraft/src/GenLayerBiome.java -@@ -1,37 +1,46 @@ - package net.minecraft.src; - - public class GenLayerBiome extends GenLayer { -- private BiomeGenBase[] allowedBiomes = new BiomeGenBase[]{BiomeGenBase.desert, BiomeGenBase.forest, BiomeGenBase.extremeHills, BiomeGenBase.swampland, BiomeGenBase.plains, BiomeGenBase.taiga, BiomeGenBase.jungle}; -- -- public GenLayerBiome(long var1, GenLayer var3, WorldType var4) { -- super(var1); -- this.parent = var3; -- if(var4 == WorldType.DEFAULT_1_1) { -- this.allowedBiomes = new BiomeGenBase[]{BiomeGenBase.desert, BiomeGenBase.forest, BiomeGenBase.extremeHills, BiomeGenBase.swampland, BiomeGenBase.plains, BiomeGenBase.taiga}; -+ -+ /** this sets all the biomes that are allowed to appear in the overworld */ -+ private BiomeGenBase[] allowedBiomes; -+ -+ public GenLayerBiome(long par1, GenLayer par3GenLayer, WorldType par4WorldType) { -+ super(par1); -+ this.allowedBiomes = new BiomeGenBase[] {BiomeGenBase.desert, BiomeGenBase.forest, BiomeGenBase.extremeHills, BiomeGenBase.swampland, BiomeGenBase.plains, BiomeGenBase.taiga, BiomeGenBase.jungle}; -+ this.parent = par3GenLayer; -+ -+ if (par4WorldType == WorldType.DEFAULT_1_1) { -+ this.allowedBiomes = new BiomeGenBase[] {BiomeGenBase.desert, BiomeGenBase.forest, BiomeGenBase.extremeHills, BiomeGenBase.swampland, BiomeGenBase.plains, BiomeGenBase.taiga}; - } -- - } - -- public int[] getInts(int var1, int var2, int var3, int var4) { -- int[] var5 = this.parent.getInts(var1, var2, var3, var4); -- int[] var6 = IntCache.getIntCache(var3 * var4); -- -- for(int var7 = 0; var7 < var4; ++var7) { -- for(int var8 = 0; var8 < var3; ++var8) { -- this.initChunkSeed((long)(var8 + var1), (long)(var7 + var2)); -- int var9 = var5[var8 + var7 * var3]; -- if(var9 == 0) { -- var6[var8 + var7 * var3] = 0; -- } else if(var9 == BiomeGenBase.mushroomIsland.biomeID) { -- var6[var8 + var7 * var3] = var9; -- } else if(var9 == 1) { -- var6[var8 + var7 * var3] = this.allowedBiomes[this.nextInt(this.allowedBiomes.length)].biomeID; -+ /** -+ * Returns a list of integer values generated by this layer. These may be interpreted as temperatures, rainfall -+ * amounts, or biomeList[] indices based on the particular GenLayer subclass. -+ */ -+ public int[] getInts(int par1, int par2, int par3, int par4) { -+ int[] var5 = this.parent.getInts(par1, par2, par3, par4); -+ int[] var6 = IntCache.getIntCache(par3 * par4); -+ -+ for (int var7 = 0; var7 < par4; ++var7) { -+ for (int var8 = 0; var8 < par3; ++var8) { -+ this.initChunkSeed((long)(var8 + par1), (long)(var7 + par2)); -+ int var9 = var5[var8 + var7 * par3]; -+ -+ if (var9 == 0) { -+ var6[var8 + var7 * par3] = 0; -+ } else if (var9 == BiomeGenBase.mushroomIsland.biomeID) { -+ var6[var8 + var7 * par3] = var9; -+ } else if (var9 == 1) { -+ var6[var8 + var7 * par3] = this.allowedBiomes[this.nextInt(this.allowedBiomes.length)].biomeID; - } else { - int var10 = this.allowedBiomes[this.nextInt(this.allowedBiomes.length)].biomeID; -- if(var10 == BiomeGenBase.taiga.biomeID) { -- var6[var8 + var7 * var3] = var10; -+ -+ if (var10 == BiomeGenBase.taiga.biomeID) { -+ var6[var8 + var7 * par3] = var10; - } else { -- var6[var8 + var7 * var3] = BiomeGenBase.icePlains.biomeID; -+ var6[var8 + var7 * par3] = BiomeGenBase.icePlains.biomeID; - } - } - } ---- net/minecraft/src/EntityMinecart.java -+++ net/minecraft/src/EntityMinecart.java -@@ -6,8 +6,12 @@ - public abstract class EntityMinecart extends Entity { - private boolean isInReverse; - private final IUpdatePlayerListBox field_82344_g; -- private String c; -- private static final int[][][] matrix = new int[][][]{{{0, 0, -1}, {0, 0, 1}}, {{-1, 0, 0}, {1, 0, 0}}, {{-1, -1, 0}, {1, 0, 0}}, {{-1, 0, 0}, {1, -1, 0}}, {{0, 0, -1}, {0, -1, 1}}, {{0, -1, -1}, {0, 0, 1}}, {{0, 0, 1}, {1, 0, 0}}, {{0, 0, 1}, {-1, 0, 0}}, {{0, 0, -1}, {-1, 0, 0}}, {{0, 0, -1}, {1, 0, 0}}}; -+ private String entityName; -+ -+ /** Minecart rotational logic matrix */ -+ private static final int[][][] matrix = new int[][][] {{{0, 0, -1}, {0, 0, 1}}, {{ -1, 0, 0}, {1, 0, 0}}, {{ -1, -1, 0}, {1, 0, 0}}, {{ -1, 0, 0}, {1, -1, 0}}, {{0, 0, -1}, {0, -1, 1}}, {{0, -1, -1}, {0, 0, 1}}, {{0, 0, 1}, {1, 0, 0}}, {{0, 0, 1}, { -1, 0, 0}}, {{0, 0, -1}, { -1, 0, 0}}, {{0, 0, -1}, {1, 0, 0}}}; -+ -+ /** appears to be the progress of the turn */ - private int turnProgress; - private double minecartX; - private double minecartY; -@@ -18,31 +22,46 @@ - private double velocityY; - private double velocityZ; - -- public EntityMinecart(World var1) { -- super(var1); -+ public EntityMinecart(World par1World) { -+ super(par1World); - this.preventEntitySpawning = true; - this.setSize(0.98F, 0.7F); - this.yOffset = this.height / 2.0F; -- this.field_82344_g = var1 != null ? var1.getMinecartSoundUpdater(this) : null; -+ this.field_82344_g = par1World != null ? par1World.getMinecartSoundUpdater(this) : null; - } - -- public static EntityMinecart createMinecart(World var0, double var1, double var3, double var5, int var7) { -- switch(var7) { -- case 1: -- return new EntityMinecartChest(var0, var1, var3, var5); -- case 2: -- return new EntityMinecartFurnace(var0, var1, var3, var5); -- case 3: -- return new EntityMinecartTNT(var0, var1, var3, var5); -- case 4: -- return new EntityMinecartMobSpawner(var0, var1, var3, var5); -- case 5: -- return new EntityMinecartHopper(var0, var1, var3, var5); -- default: -- return new EntityMinecartEmpty(var0, var1, var3, var5); -+ /** -+ * Creates a new minecart of the specified type in the specified location in the given world. par0World - world to -+ * create the minecart in, double par1,par3,par5 represent x,y,z respectively. int par7 specifies the type: 1 for -+ * MinecartChest, 2 for MinecartFurnace, 3 for MinecartTNT, 4 for MinecartMobSpawner, 5 for MinecartHopper and 0 for a -+ * standard empty minecart -+ */ -+ public static EntityMinecart createMinecart(World par0World, double par1, double par3, double par5, int par7) { -+ switch (par7) { -+ case 1: -+ return new EntityMinecartChest(par0World, par1, par3, par5); -+ -+ case 2: -+ return new EntityMinecartFurnace(par0World, par1, par3, par5); -+ -+ case 3: -+ return new EntityMinecartTNT(par0World, par1, par3, par5); -+ -+ case 4: -+ return new EntityMinecartMobSpawner(par0World, par1, par3, par5); -+ -+ case 5: -+ return new EntityMinecartHopper(par0World, par1, par3, par5); -+ -+ default: -+ return new EntityMinecartEmpty(par0World, par1, par3, par5); - } - } - -+ /** -+ * returns if this entity triggers Block.onEntityWalking on the blocks they walk on. used for spiders and wolves to -+ * prevent them from trampling crops -+ */ - protected boolean canTriggerWalking() { - return false; - } -@@ -56,52 +75,69 @@ - this.dataWatcher.addObject(22, Byte.valueOf((byte)0)); - } - -- public AxisAlignedBB getCollisionBox(Entity var1) { -- return var1.canBePushed() ? var1.boundingBox : null; -+ /** -+ * Returns a boundingBox used to collide the entity with other entities and blocks. This enables the entity to be -+ * pushable on contact, like boats or minecarts. -+ */ -+ public AxisAlignedBB getCollisionBox(Entity par1Entity) { -+ return par1Entity.canBePushed() ? par1Entity.boundingBox : null; - } - -+ /** -+ * returns the bounding box for this entity -+ */ - public AxisAlignedBB getBoundingBox() { - return null; - } - -+ /** -+ * Returns true if this entity should push and be pushed by other entities when colliding. -+ */ - public boolean canBePushed() { - return true; - } - -- public EntityMinecart(World var1, double var2, double var4, double var6) { -- this(var1); -- this.setPosition(var2, var4, var6); -+ public EntityMinecart(World par1World, double par2, double par4, double par6) { -+ this(par1World); -+ this.setPosition(par2, par4, par6); - this.motionX = 0.0D; - this.motionY = 0.0D; - this.motionZ = 0.0D; -- this.prevPosX = var2; -- this.prevPosY = var4; -- this.prevPosZ = var6; -+ this.prevPosX = par2; -+ this.prevPosY = par4; -+ this.prevPosZ = par6; - } - -+ /** -+ * Returns the Y offset from the entity's position for any entity riding this one. -+ */ - public double getMountedYOffset() { -- return (double)this.height * 0.0D - (double)0.3F; -+ return (double)this.height * 0.0D - 0.30000001192092896D; - } - -- public boolean attackEntityFrom(DamageSource var1, float var2) { -- if(!this.worldObj.isRemote && !this.isDead) { -- if(this.isEntityInvulnerable()) { -+ /** -+ * Called when the entity is attacked. -+ */ -+ public boolean attackEntityFrom(DamageSource par1DamageSource, float par2) { -+ if (!this.worldObj.isRemote && !this.isDead) { -+ if (this.isEntityInvulnerable()) { - return false; - } else { - this.setRollingDirection(-this.getRollingDirection()); - this.setRollingAmplitude(10); - this.setBeenAttacked(); -- this.setDamage(this.getDamage() + var2 * 10.0F); -- boolean var3 = var1.getEntity() instanceof EntityPlayer && ((EntityPlayer)var1.getEntity()).capabilities.isCreativeMode; -- if(var3 || this.getDamage() > 40.0F) { -- if(this.riddenByEntity != null) { -+ this.setDamage(this.getDamage() + par2 * 10.0F); -+ boolean var3 = par1DamageSource.getEntity() instanceof EntityPlayer && ((EntityPlayer)par1DamageSource.getEntity()).capabilities.isCreativeMode; -+ -+ if (var3 || this.getDamage() > 40.0F) { -+ if (this.riddenByEntity != null) { - this.riddenByEntity.mountEntity(this); - } - -- if(var3 && !this.isInvNameLocalized()) { -+ if (var3 && !this.isInvNameLocalized()) { - this.setDead(); - } else { -- this.killMinecart(var1); -+ this.killMinecart(par1DamageSource); - } - } - -@@ -112,63 +148,79 @@ - } - } - -- public void killMinecart(DamageSource var1) { -+ public void killMinecart(DamageSource par1DamageSource) { - this.setDead(); - ItemStack var2 = new ItemStack(Item.minecartEmpty, 1); -- if(this.c != null) { -- var2.setItemName(this.c); -+ -+ if (this.entityName != null) { -+ var2.setItemName(this.entityName); - } - - this.entityDropItem(var2, 0.0F); - } - -+ /** -+ * Setups the entity to do the hurt animation. Only used by packets in multiplayer. -+ */ - public void performHurtAnimation() { - this.setRollingDirection(-this.getRollingDirection()); - this.setRollingAmplitude(10); - this.setDamage(this.getDamage() + this.getDamage() * 10.0F); - } - -+ /** -+ * Returns true if other Entities should be prevented from moving through this Entity. -+ */ - public boolean canBeCollidedWith() { - return !this.isDead; - } - -+ /** -+ * Will get destroyed next tick. -+ */ - public void setDead() { - super.setDead(); -- if(this.field_82344_g != null) { -+ -+ if (this.field_82344_g != null) { - this.field_82344_g.update(); - } -- - } - -+ /** -+ * Called to update the entity's position/logic. -+ */ - public void onUpdate() { -- if(this.field_82344_g != null) { -+ if (this.field_82344_g != null) { - this.field_82344_g.update(); - } - -- if(this.getRollingAmplitude() > 0) { -+ if (this.getRollingAmplitude() > 0) { - this.setRollingAmplitude(this.getRollingAmplitude() - 1); - } - -- if(this.getDamage() > 0.0F) { -+ if (this.getDamage() > 0.0F) { - this.setDamage(this.getDamage() - 1.0F); - } - -- if(this.posY < -64.0D) { -+ if (this.posY < -64.0D) { - this.kill(); - } - - int var2; -- if(!this.worldObj.isRemote && this.worldObj instanceof WorldServer) { -+ -+ if (!this.worldObj.isRemote && this.worldObj instanceof WorldServer) { - this.worldObj.theProfiler.startSection("portal"); - MinecraftServer var1 = ((WorldServer)this.worldObj).getMinecraftServer(); - var2 = this.getMaxInPortalTime(); -- if(this.inPortal) { -- if(var1.getAllowNether()) { -- if(this.ridingEntity == null && this.portalCounter++ >= var2) { -+ -+ if (this.inPortal) { -+ if (var1.getAllowNether()) { -+ if (this.ridingEntity == null && this.portalCounter++ >= var2) { - this.portalCounter = var2; - this.timeUntilPortal = this.getPortalCooldown(); - byte var3; -- if(this.worldObj.provider.dimensionId == -1) { -+ -+ if (this.worldObj.provider.dimensionId == -1) { - var3 = 0; - } else { - var3 = -1; -@@ -180,24 +232,24 @@ - this.inPortal = false; - } - } else { -- if(this.portalCounter > 0) { -+ if (this.portalCounter > 0) { - this.portalCounter -= 4; - } - -- if(this.portalCounter < 0) { -+ if (this.portalCounter < 0) { - this.portalCounter = 0; - } - } - -- if(this.timeUntilPortal > 0) { -+ if (this.timeUntilPortal > 0) { - --this.timeUntilPortal; - } - - this.worldObj.theProfiler.endSection(); - } - -- if(this.worldObj.isRemote) { -- if(this.turnProgress > 0) { -+ if (this.worldObj.isRemote) { -+ if (this.turnProgress > 0) { - double var19 = this.posX + (this.minecartX - this.posX) / (double)this.turnProgress; - double var21 = this.posY + (this.minecartY - this.posY) / (double)this.turnProgress; - double var5 = this.posZ + (this.minecartZ - this.posZ) / (double)this.turnProgress; -@@ -211,26 +263,28 @@ - this.setPosition(this.posX, this.posY, this.posZ); - this.setRotation(this.rotationYaw, this.rotationPitch); - } -- - } else { - this.prevPosX = this.posX; - this.prevPosY = this.posY; - this.prevPosZ = this.posZ; -- this.motionY -= (double)0.04F; -+ this.motionY -= 0.03999999910593033D; - int var18 = MathHelper.floor_double(this.posX); - var2 = MathHelper.floor_double(this.posY); - int var20 = MathHelper.floor_double(this.posZ); -- if(BlockRailBase.isRailBlockAt(this.worldObj, var18, var2 - 1, var20)) { -+ -+ if (BlockRailBase.isRailBlockAt(this.worldObj, var18, var2 - 1, var20)) { - --var2; - } - - double var4 = 0.4D; -- double var6 = 1.0D / 128.0D; -+ double var6 = 0.0078125D; - int var8 = this.worldObj.getBlockId(var18, var2, var20); -- if(BlockRailBase.isRailBlock(var8)) { -+ -+ if (BlockRailBase.isRailBlock(var8)) { - int var9 = this.worldObj.getBlockMetadata(var18, var2, var20); - this.updateOnTrack(var18, var2, var20, var4, var6, var8, var9); -- if(var8 == Block.railActivator.blockID) { -+ -+ if (var8 == Block.railActivator.blockID) { - this.onActivatorRailPass(var18, var2, var20, (var9 & 8) != 0); - } - } else { -@@ -241,123 +295,132 @@ - this.rotationPitch = 0.0F; - double var22 = this.prevPosX - this.posX; - double var11 = this.prevPosZ - this.posZ; -- if(var22 * var22 + var11 * var11 > 0.001D) { -+ -+ if (var22 * var22 + var11 * var11 > 0.001D) { - this.rotationYaw = (float)(Math.atan2(var11, var22) * 180.0D / Math.PI); -- if(this.isInReverse) { -+ -+ if (this.isInReverse) { - this.rotationYaw += 180.0F; - } - } - - double var13 = (double)MathHelper.wrapAngleTo180_float(this.rotationYaw - this.prevRotationYaw); -- if(var13 < -170.0D || var13 >= 170.0D) { -+ -+ if (var13 < -170.0D || var13 >= 170.0D) { - this.rotationYaw += 180.0F; - this.isInReverse = !this.isInReverse; - } - - this.setRotation(this.rotationYaw, this.rotationPitch); -- List var15 = this.worldObj.getEntitiesWithinAABBExcludingEntity(this, this.boundingBox.expand((double)0.2F, 0.0D, (double)0.2F)); -- if(var15 != null && !var15.isEmpty()) { -- for(int var16 = 0; var16 < var15.size(); ++var16) { -+ List var15 = this.worldObj.getEntitiesWithinAABBExcludingEntity(this, this.boundingBox.expand(0.20000000298023224D, 0.0D, 0.20000000298023224D)); -+ -+ if (var15 != null && !var15.isEmpty()) { -+ for (int var16 = 0; var16 < var15.size(); ++var16) { - Entity var17 = (Entity)var15.get(var16); -- if(var17 != this.riddenByEntity && var17.canBePushed() && var17 instanceof EntityMinecart) { -+ -+ if (var17 != this.riddenByEntity && var17.canBePushed() && var17 instanceof EntityMinecart) { - var17.applyEntityCollision(this); - } - } - } - -- if(this.riddenByEntity != null && this.riddenByEntity.isDead) { -- if(this.riddenByEntity.ridingEntity == this) { -+ if (this.riddenByEntity != null && this.riddenByEntity.isDead) { -+ if (this.riddenByEntity.ridingEntity == this) { - this.riddenByEntity.ridingEntity = null; - } - - this.riddenByEntity = null; - } -- -- } -- } -- -- public void onActivatorRailPass(int var1, int var2, int var3, boolean var4) { -- } -- -- protected void func_94088_b(double var1) { -- if(this.motionX < -var1) { -- this.motionX = -var1; -- } -- -- if(this.motionX > var1) { -- this.motionX = var1; -- } -- -- if(this.motionZ < -var1) { -- this.motionZ = -var1; -- } -- -- if(this.motionZ > var1) { -- this.motionZ = var1; -- } -- -- if(this.onGround) { -+ } -+ } -+ -+ /** -+ * Called every tick the minecart is on an activator rail. -+ */ -+ public void onActivatorRailPass(int par1, int par2, int par3, boolean par4) {} -+ -+ protected void func_94088_b(double par1) { -+ if (this.motionX < -par1) { -+ this.motionX = -par1; -+ } -+ -+ if (this.motionX > par1) { -+ this.motionX = par1; -+ } -+ -+ if (this.motionZ < -par1) { -+ this.motionZ = -par1; -+ } -+ -+ if (this.motionZ > par1) { -+ this.motionZ = par1; -+ } -+ -+ if (this.onGround) { - this.motionX *= 0.5D; - this.motionY *= 0.5D; - this.motionZ *= 0.5D; - } - - this.moveEntity(this.motionX, this.motionY, this.motionZ); -- if(!this.onGround) { -- this.motionX *= (double)0.95F; -- this.motionY *= (double)0.95F; -- this.motionZ *= (double)0.95F; -+ -+ if (!this.onGround) { -+ this.motionX *= 0.949999988079071D; -+ this.motionY *= 0.949999988079071D; -+ this.motionZ *= 0.949999988079071D; - } -- - } - -- protected void updateOnTrack(int var1, int var2, int var3, double var4, double var6, int var8, int var9) { -+ protected void updateOnTrack(int par1, int par2, int par3, double par4, double par6, int par8, int par9) { - this.fallDistance = 0.0F; - Vec3 var10 = this.func_70489_a(this.posX, this.posY, this.posZ); -- this.posY = (double)var2; -+ this.posY = (double)par2; - boolean var11 = false; - boolean var12 = false; -- if(var8 == Block.railPowered.blockID) { -- var11 = (var9 & 8) != 0; -+ -+ if (par8 == Block.railPowered.blockID) { -+ var11 = (par9 & 8) != 0; - var12 = !var11; - } - -- if(((BlockRailBase)Block.blocksList[var8]).isPowered()) { -- var9 &= 7; -- } -- -- if(var9 >= 2 && var9 <= 5) { -- this.posY = (double)(var2 + 1); -- } -- -- if(var9 == 2) { -- this.motionX -= var6; -- } -- -- if(var9 == 3) { -- this.motionX += var6; -- } -- -- if(var9 == 4) { -- this.motionZ += var6; -- } -- -- if(var9 == 5) { -- this.motionZ -= var6; -- } -- -- int[][] var13 = matrix[var9]; -+ if (((BlockRailBase)Block.blocksList[par8]).isPowered()) { -+ par9 &= 7; -+ } -+ -+ if (par9 >= 2 && par9 <= 5) { -+ this.posY = (double)(par2 + 1); -+ } -+ -+ if (par9 == 2) { -+ this.motionX -= par6; -+ } -+ -+ if (par9 == 3) { -+ this.motionX += par6; -+ } -+ -+ if (par9 == 4) { -+ this.motionZ += par6; -+ } -+ -+ if (par9 == 5) { -+ this.motionZ -= par6; -+ } -+ -+ int[][] var13 = matrix[par9]; - double var14 = (double)(var13[1][0] - var13[0][0]); - double var16 = (double)(var13[1][2] - var13[0][2]); - double var18 = Math.sqrt(var14 * var14 + var16 * var16); - double var20 = this.motionX * var14 + this.motionZ * var16; -- if(var20 < 0.0D) { -+ -+ if (var20 < 0.0D) { - var14 = -var14; - var16 = -var16; - } - - double var22 = Math.sqrt(this.motionX * this.motionX + this.motionZ * this.motionZ); -- if(var22 > 2.0D) { -+ -+ if (var22 > 2.0D) { - var22 = 2.0D; - } - -@@ -367,13 +430,16 @@ - double var26; - double var28; - double var30; -- if(this.riddenByEntity != null && this.riddenByEntity instanceof EntityLivingBase) { -+ -+ if (this.riddenByEntity != null && this.riddenByEntity instanceof EntityLivingBase) { - var24 = (double)((EntityLivingBase)this.riddenByEntity).moveForward; -- if(var24 > 0.0D) { -+ -+ if (var24 > 0.0D) { - var26 = -Math.sin((double)(this.riddenByEntity.rotationYaw * (float)Math.PI / 180.0F)); - var28 = Math.cos((double)(this.riddenByEntity.rotationYaw * (float)Math.PI / 180.0F)); - var30 = this.motionX * this.motionX + this.motionZ * this.motionZ; -- if(var30 < 0.01D) { -+ -+ if (var30 < 0.01D) { - this.motionX += var26 * 0.1D; - this.motionZ += var28 * 0.1D; - var12 = false; -@@ -381,9 +447,10 @@ - } - } - -- if(var12) { -+ if (var12) { - var24 = Math.sqrt(this.motionX * this.motionX + this.motionZ * this.motionZ); -- if(var24 < 0.03D) { -+ -+ if (var24 < 0.03D) { - this.motionX *= 0.0D; - this.motionY *= 0.0D; - this.motionZ *= 0.0D; -@@ -395,20 +462,21 @@ - } - - var24 = 0.0D; -- var26 = (double)var1 + 0.5D + (double)var13[0][0] * 0.5D; -- var28 = (double)var3 + 0.5D + (double)var13[0][2] * 0.5D; -- var30 = (double)var1 + 0.5D + (double)var13[1][0] * 0.5D; -- double var32 = (double)var3 + 0.5D + (double)var13[1][2] * 0.5D; -+ var26 = (double)par1 + 0.5D + (double)var13[0][0] * 0.5D; -+ var28 = (double)par3 + 0.5D + (double)var13[0][2] * 0.5D; -+ var30 = (double)par1 + 0.5D + (double)var13[1][0] * 0.5D; -+ double var32 = (double)par3 + 0.5D + (double)var13[1][2] * 0.5D; - var14 = var30 - var26; - var16 = var32 - var28; - double var34; - double var36; -- if(var14 == 0.0D) { -- this.posX = (double)var1 + 0.5D; -- var24 = this.posZ - (double)var3; -- } else if(var16 == 0.0D) { -- this.posZ = (double)var3 + 0.5D; -- var24 = this.posX - (double)var1; -+ -+ if (var14 == 0.0D) { -+ this.posX = (double)par1 + 0.5D; -+ var24 = this.posZ - (double)par3; -+ } else if (var16 == 0.0D) { -+ this.posZ = (double)par3 + 0.5D; -+ var24 = this.posX - (double)par1; - } else { - var34 = this.posX - var26; - var36 = this.posZ - var28; -@@ -420,40 +488,44 @@ - this.setPosition(this.posX, this.posY + (double)this.yOffset, this.posZ); - var34 = this.motionX; - var36 = this.motionZ; -- if(this.riddenByEntity != null) { -+ -+ if (this.riddenByEntity != null) { - var34 *= 0.75D; - var36 *= 0.75D; - } - -- if(var34 < -var4) { -- var34 = -var4; -- } -- -- if(var34 > var4) { -- var34 = var4; -- } -- -- if(var36 < -var4) { -- var36 = -var4; -- } -- -- if(var36 > var4) { -- var36 = var4; -+ if (var34 < -par4) { -+ var34 = -par4; -+ } -+ -+ if (var34 > par4) { -+ var34 = par4; -+ } -+ -+ if (var36 < -par4) { -+ var36 = -par4; -+ } -+ -+ if (var36 > par4) { -+ var36 = par4; - } - - this.moveEntity(var34, 0.0D, var36); -- if(var13[0][1] != 0 && MathHelper.floor_double(this.posX) - var1 == var13[0][0] && MathHelper.floor_double(this.posZ) - var3 == var13[0][2]) { -+ -+ if (var13[0][1] != 0 && MathHelper.floor_double(this.posX) - par1 == var13[0][0] && MathHelper.floor_double(this.posZ) - par3 == var13[0][2]) { - this.setPosition(this.posX, this.posY + (double)var13[0][1], this.posZ); -- } else if(var13[1][1] != 0 && MathHelper.floor_double(this.posX) - var1 == var13[1][0] && MathHelper.floor_double(this.posZ) - var3 == var13[1][2]) { -+ } else if (var13[1][1] != 0 && MathHelper.floor_double(this.posX) - par1 == var13[1][0] && MathHelper.floor_double(this.posZ) - par3 == var13[1][2]) { - this.setPosition(this.posX, this.posY + (double)var13[1][1], this.posZ); - } - - this.applyDrag(); - Vec3 var38 = this.func_70489_a(this.posX, this.posY, this.posZ); -- if(var38 != null && var10 != null) { -+ -+ if (var38 != null && var10 != null) { - double var39 = (var10.yCoord - var38.yCoord) * 0.05D; - var22 = Math.sqrt(this.motionX * this.motionX + this.motionZ * this.motionZ); -- if(var22 > 0.0D) { -+ -+ if (var22 > 0.0D) { - this.motionX = this.motionX / var22 * (var22 + var39); - this.motionZ = this.motionZ / var22 * (var22 + var39); - } -@@ -463,68 +535,72 @@ - - int var45 = MathHelper.floor_double(this.posX); - int var40 = MathHelper.floor_double(this.posZ); -- if(var45 != var1 || var40 != var3) { -+ -+ if (var45 != par1 || var40 != par3) { - var22 = Math.sqrt(this.motionX * this.motionX + this.motionZ * this.motionZ); -- this.motionX = var22 * (double)(var45 - var1); -- this.motionZ = var22 * (double)(var40 - var3); -+ this.motionX = var22 * (double)(var45 - par1); -+ this.motionZ = var22 * (double)(var40 - par3); - } - -- if(var11) { -+ if (var11) { - double var41 = Math.sqrt(this.motionX * this.motionX + this.motionZ * this.motionZ); -- if(var41 > 0.01D) { -+ -+ if (var41 > 0.01D) { - double var43 = 0.06D; - this.motionX += this.motionX / var41 * var43; - this.motionZ += this.motionZ / var41 * var43; -- } else if(var9 == 1) { -- if(this.worldObj.isBlockNormalCube(var1 - 1, var2, var3)) { -+ } else if (par9 == 1) { -+ if (this.worldObj.isBlockNormalCube(par1 - 1, par2, par3)) { - this.motionX = 0.02D; -- } else if(this.worldObj.isBlockNormalCube(var1 + 1, var2, var3)) { -+ } else if (this.worldObj.isBlockNormalCube(par1 + 1, par2, par3)) { - this.motionX = -0.02D; - } -- } else if(var9 == 0) { -- if(this.worldObj.isBlockNormalCube(var1, var2, var3 - 1)) { -+ } else if (par9 == 0) { -+ if (this.worldObj.isBlockNormalCube(par1, par2, par3 - 1)) { - this.motionZ = 0.02D; -- } else if(this.worldObj.isBlockNormalCube(var1, var2, var3 + 1)) { -+ } else if (this.worldObj.isBlockNormalCube(par1, par2, par3 + 1)) { - this.motionZ = -0.02D; - } - } - } -- - } - - protected void applyDrag() { -- if(this.riddenByEntity != null) { -- this.motionX *= (double)0.997F; -+ if (this.riddenByEntity != null) { -+ this.motionX *= 0.996999979019165D; - this.motionY *= 0.0D; -- this.motionZ *= (double)0.997F; -+ this.motionZ *= 0.996999979019165D; - } else { -- this.motionX *= (double)0.96F; -+ this.motionX *= 0.9599999785423279D; - this.motionY *= 0.0D; -- this.motionZ *= (double)0.96F; -+ this.motionZ *= 0.9599999785423279D; - } -- - } - -- public Vec3 func_70495_a(double var1, double var3, double var5, double var7) { -- int var9 = MathHelper.floor_double(var1); -- int var10 = MathHelper.floor_double(var3); -- int var11 = MathHelper.floor_double(var5); -- if(BlockRailBase.isRailBlockAt(this.worldObj, var9, var10 - 1, var11)) { -+ public Vec3 func_70495_a(double par1, double par3, double par5, double par7) { -+ int var9 = MathHelper.floor_double(par1); -+ int var10 = MathHelper.floor_double(par3); -+ int var11 = MathHelper.floor_double(par5); -+ -+ if (BlockRailBase.isRailBlockAt(this.worldObj, var9, var10 - 1, var11)) { - --var10; - } - - int var12 = this.worldObj.getBlockId(var9, var10, var11); -- if(!BlockRailBase.isRailBlock(var12)) { -+ -+ if (!BlockRailBase.isRailBlock(var12)) { - return null; - } else { - int var13 = this.worldObj.getBlockMetadata(var9, var10, var11); -- if(((BlockRailBase)Block.blocksList[var12]).isPowered()) { -+ -+ if (((BlockRailBase)Block.blocksList[var12]).isPowered()) { - var13 &= 7; - } - -- var3 = (double)var10; -- if(var13 >= 2 && var13 <= 5) { -- var3 = (double)(var10 + 1); -+ par3 = (double)var10; -+ -+ if (var13 >= 2 && var13 <= 5) { -+ par3 = (double)(var10 + 1); - } - - int[][] var14 = matrix[var13]; -@@ -533,36 +609,40 @@ - double var19 = Math.sqrt(var15 * var15 + var17 * var17); - var15 /= var19; - var17 /= var19; -- var1 += var15 * var7; -- var5 += var17 * var7; -- if(var14[0][1] != 0 && MathHelper.floor_double(var1) - var9 == var14[0][0] && MathHelper.floor_double(var5) - var11 == var14[0][2]) { -- var3 += (double)var14[0][1]; -- } else if(var14[1][1] != 0 && MathHelper.floor_double(var1) - var9 == var14[1][0] && MathHelper.floor_double(var5) - var11 == var14[1][2]) { -- var3 += (double)var14[1][1]; -+ par1 += var15 * par7; -+ par5 += var17 * par7; -+ -+ if (var14[0][1] != 0 && MathHelper.floor_double(par1) - var9 == var14[0][0] && MathHelper.floor_double(par5) - var11 == var14[0][2]) { -+ par3 += (double)var14[0][1]; -+ } else if (var14[1][1] != 0 && MathHelper.floor_double(par1) - var9 == var14[1][0] && MathHelper.floor_double(par5) - var11 == var14[1][2]) { -+ par3 += (double)var14[1][1]; - } - -- return this.func_70489_a(var1, var3, var5); -+ return this.func_70489_a(par1, par3, par5); - } - } - -- public Vec3 func_70489_a(double var1, double var3, double var5) { -- int var7 = MathHelper.floor_double(var1); -- int var8 = MathHelper.floor_double(var3); -- int var9 = MathHelper.floor_double(var5); -- if(BlockRailBase.isRailBlockAt(this.worldObj, var7, var8 - 1, var9)) { -+ public Vec3 func_70489_a(double par1, double par3, double par5) { -+ int var7 = MathHelper.floor_double(par1); -+ int var8 = MathHelper.floor_double(par3); -+ int var9 = MathHelper.floor_double(par5); -+ -+ if (BlockRailBase.isRailBlockAt(this.worldObj, var7, var8 - 1, var9)) { - --var8; - } - - int var10 = this.worldObj.getBlockId(var7, var8, var9); -- if(BlockRailBase.isRailBlock(var10)) { -+ -+ if (BlockRailBase.isRailBlock(var10)) { - int var11 = this.worldObj.getBlockMetadata(var7, var8, var9); -- var3 = (double)var8; -- if(((BlockRailBase)Block.blocksList[var10]).isPowered()) { -+ par3 = (double)var8; -+ -+ if (((BlockRailBase)Block.blocksList[var10]).isPowered()) { - var11 &= 7; - } - -- if(var11 >= 2 && var11 <= 5) { -- var3 = (double)(var8 + 1); -+ if (var11 >= 2 && var11 <= 5) { -+ par3 = (double)(var8 + 1); - } - - int[][] var12 = matrix[var11]; -@@ -576,175 +656,213 @@ - double var27 = var21 - var15; - double var29 = (var23 - var17) * 2.0D; - double var31 = var25 - var19; -- if(var27 == 0.0D) { -- var1 = (double)var7 + 0.5D; -- var13 = var5 - (double)var9; -- } else if(var31 == 0.0D) { -- var5 = (double)var9 + 0.5D; -- var13 = var1 - (double)var7; -+ -+ if (var27 == 0.0D) { -+ par1 = (double)var7 + 0.5D; -+ var13 = par5 - (double)var9; -+ } else if (var31 == 0.0D) { -+ par5 = (double)var9 + 0.5D; -+ var13 = par1 - (double)var7; - } else { -- double var33 = var1 - var15; -- double var35 = var5 - var19; -+ double var33 = par1 - var15; -+ double var35 = par5 - var19; - var13 = (var33 * var27 + var35 * var31) * 2.0D; - } - -- var1 = var15 + var27 * var13; -- var3 = var17 + var29 * var13; -- var5 = var19 + var31 * var13; -- if(var29 < 0.0D) { -- ++var3; -- } -- -- if(var29 > 0.0D) { -- var3 += 0.5D; -- } -- -- return this.worldObj.getWorldVec3Pool().getVecFromPool(var1, var3, var5); -+ par1 = var15 + var27 * var13; -+ par3 = var17 + var29 * var13; -+ par5 = var19 + var31 * var13; -+ -+ if (var29 < 0.0D) { -+ ++par3; -+ } -+ -+ if (var29 > 0.0D) { -+ par3 += 0.5D; -+ } -+ -+ return this.worldObj.getWorldVec3Pool().getVecFromPool(par1, par3, par5); - } else { - return null; - } - } - -- protected void readEntityFromNBT(NBTTagCompound var1) { -- if(var1.getBoolean("CustomDisplayTile")) { -- this.setDisplayTile(var1.getInteger("DisplayTile")); -- this.setDisplayTileData(var1.getInteger("DisplayData")); -- this.setDisplayTileOffset(var1.getInteger("DisplayOffset")); -- } -- -- if(var1.hasKey("CustomName") && var1.getString("CustomName").length() > 0) { -- this.c = var1.getString("CustomName"); -- } -- -+ /** -+ * (abstract) Protected helper method to read subclass entity data from NBT. -+ */ -+ protected void readEntityFromNBT(NBTTagCompound par1NBTTagCompound) { -+ if (par1NBTTagCompound.getBoolean("CustomDisplayTile")) { -+ this.setDisplayTile(par1NBTTagCompound.getInteger("DisplayTile")); -+ this.setDisplayTileData(par1NBTTagCompound.getInteger("DisplayData")); -+ this.setDisplayTileOffset(par1NBTTagCompound.getInteger("DisplayOffset")); -+ } -+ -+ if (par1NBTTagCompound.hasKey("CustomName") && par1NBTTagCompound.getString("CustomName").length() > 0) { -+ this.entityName = par1NBTTagCompound.getString("CustomName"); -+ } - } - -- protected void writeEntityToNBT(NBTTagCompound var1) { -- if(this.hasDisplayTile()) { -- var1.setBoolean("CustomDisplayTile", true); -- var1.setInteger("DisplayTile", this.getDisplayTile() == null ? 0 : this.getDisplayTile().blockID); -- var1.setInteger("DisplayData", this.getDisplayTileData()); -- var1.setInteger("DisplayOffset", this.getDisplayTileOffset()); -- } -- -- if(this.c != null && this.c.length() > 0) { -- var1.setString("CustomName", this.c); -- } -- -+ /** -+ * (abstract) Protected helper method to write subclass entity data to NBT. -+ */ -+ protected void writeEntityToNBT(NBTTagCompound par1NBTTagCompound) { -+ if (this.hasDisplayTile()) { -+ par1NBTTagCompound.setBoolean("CustomDisplayTile", true); -+ par1NBTTagCompound.setInteger("DisplayTile", this.getDisplayTile() == null ? 0 : this.getDisplayTile().blockID); -+ par1NBTTagCompound.setInteger("DisplayData", this.getDisplayTileData()); -+ par1NBTTagCompound.setInteger("DisplayOffset", this.getDisplayTileOffset()); -+ } -+ -+ if (this.entityName != null && this.entityName.length() > 0) { -+ par1NBTTagCompound.setString("CustomName", this.entityName); -+ } - } - - public float getShadowSize() { - return 0.0F; - } - -- public void applyEntityCollision(Entity var1) { -- if(!this.worldObj.isRemote) { -- if(var1 != this.riddenByEntity) { -- if(var1 instanceof EntityLivingBase && !(var1 instanceof EntityPlayer) && !(var1 instanceof EntityIronGolem) && this.getMinecartType() == 0 && this.motionX * this.motionX + this.motionZ * this.motionZ > 0.01D && this.riddenByEntity == null && var1.ridingEntity == null) { -- var1.mountEntity(this); -+ /** -+ * Applies a velocity to each of the entities pushing them away from each other. Args: entity -+ */ -+ public void applyEntityCollision(Entity par1Entity) { -+ if (!this.worldObj.isRemote) { -+ if (par1Entity != this.riddenByEntity) { -+ if (par1Entity instanceof EntityLivingBase && !(par1Entity instanceof EntityPlayer) && !(par1Entity instanceof EntityIronGolem) && this.getMinecartType() == 0 && this.motionX * this.motionX + this.motionZ * this.motionZ > 0.01D && this.riddenByEntity == null && par1Entity.ridingEntity == null) { -+ par1Entity.mountEntity(this); - } - -- double var2 = var1.posX - this.posX; -- double var4 = var1.posZ - this.posZ; -+ double var2 = par1Entity.posX - this.posX; -+ double var4 = par1Entity.posZ - this.posZ; - double var6 = var2 * var2 + var4 * var4; -- if(var6 >= (double)1.0E-4F) { -+ -+ if (var6 >= 9.999999747378752E-5D) { - var6 = (double)MathHelper.sqrt_double(var6); - var2 /= var6; - var4 /= var6; - double var8 = 1.0D / var6; -- if(var8 > 1.0D) { -+ -+ if (var8 > 1.0D) { - var8 = 1.0D; - } - - var2 *= var8; - var4 *= var8; -- var2 *= (double)0.1F; -- var4 *= (double)0.1F; -+ var2 *= 0.10000000149011612D; -+ var4 *= 0.10000000149011612D; - var2 *= (double)(1.0F - this.entityCollisionReduction); - var4 *= (double)(1.0F - this.entityCollisionReduction); - var2 *= 0.5D; - var4 *= 0.5D; -- if(var1 instanceof EntityMinecart) { -- double var10 = var1.posX - this.posX; -- double var12 = var1.posZ - this.posZ; -+ -+ if (par1Entity instanceof EntityMinecart) { -+ double var10 = par1Entity.posX - this.posX; -+ double var12 = par1Entity.posZ - this.posZ; - Vec3 var14 = this.worldObj.getWorldVec3Pool().getVecFromPool(var10, 0.0D, var12).normalize(); - Vec3 var15 = this.worldObj.getWorldVec3Pool().getVecFromPool((double)MathHelper.cos(this.rotationYaw * (float)Math.PI / 180.0F), 0.0D, (double)MathHelper.sin(this.rotationYaw * (float)Math.PI / 180.0F)).normalize(); - double var16 = Math.abs(var14.dotProduct(var15)); -- if(var16 < (double)0.8F) { -+ -+ if (var16 < 0.800000011920929D) { - return; - } - -- double var18 = var1.motionX + this.motionX; -- double var20 = var1.motionZ + this.motionZ; -- if(((EntityMinecart)var1).getMinecartType() == 2 && this.getMinecartType() != 2) { -- this.motionX *= (double)0.2F; -- this.motionZ *= (double)0.2F; -- this.addVelocity(var1.motionX - var2, 0.0D, var1.motionZ - var4); -- var1.motionX *= (double)0.95F; -- var1.motionZ *= (double)0.95F; -- } else if(((EntityMinecart)var1).getMinecartType() != 2 && this.getMinecartType() == 2) { -- var1.motionX *= (double)0.2F; -- var1.motionZ *= (double)0.2F; -- var1.addVelocity(this.motionX + var2, 0.0D, this.motionZ + var4); -- this.motionX *= (double)0.95F; -- this.motionZ *= (double)0.95F; -+ double var18 = par1Entity.motionX + this.motionX; -+ double var20 = par1Entity.motionZ + this.motionZ; -+ -+ if (((EntityMinecart)par1Entity).getMinecartType() == 2 && this.getMinecartType() != 2) { -+ this.motionX *= 0.20000000298023224D; -+ this.motionZ *= 0.20000000298023224D; -+ this.addVelocity(par1Entity.motionX - var2, 0.0D, par1Entity.motionZ - var4); -+ par1Entity.motionX *= 0.949999988079071D; -+ par1Entity.motionZ *= 0.949999988079071D; -+ } else if (((EntityMinecart)par1Entity).getMinecartType() != 2 && this.getMinecartType() == 2) { -+ par1Entity.motionX *= 0.20000000298023224D; -+ par1Entity.motionZ *= 0.20000000298023224D; -+ par1Entity.addVelocity(this.motionX + var2, 0.0D, this.motionZ + var4); -+ this.motionX *= 0.949999988079071D; -+ this.motionZ *= 0.949999988079071D; - } else { - var18 /= 2.0D; - var20 /= 2.0D; -- this.motionX *= (double)0.2F; -- this.motionZ *= (double)0.2F; -+ this.motionX *= 0.20000000298023224D; -+ this.motionZ *= 0.20000000298023224D; - this.addVelocity(var18 - var2, 0.0D, var20 - var4); -- var1.motionX *= (double)0.2F; -- var1.motionZ *= (double)0.2F; -- var1.addVelocity(var18 + var2, 0.0D, var20 + var4); -+ par1Entity.motionX *= 0.20000000298023224D; -+ par1Entity.motionZ *= 0.20000000298023224D; -+ par1Entity.addVelocity(var18 + var2, 0.0D, var20 + var4); - } - } else { - this.addVelocity(-var2, 0.0D, -var4); -- var1.addVelocity(var2 / 4.0D, 0.0D, var4 / 4.0D); -+ par1Entity.addVelocity(var2 / 4.0D, 0.0D, var4 / 4.0D); - } - } -- - } - } - } - -- public void setPositionAndRotation2(double var1, double var3, double var5, float var7, float var8, int var9) { -- this.minecartX = var1; -- this.minecartY = var3; -- this.minecartZ = var5; -- this.minecartYaw = (double)var7; -- this.minecartPitch = (double)var8; -- this.turnProgress = var9 + 2; -+ /** -+ * Sets the position and rotation. Only difference from the other one is no bounding on the rotation. Args: posX, posY, -+ * posZ, yaw, pitch -+ */ -+ public void setPositionAndRotation2(double par1, double par3, double par5, float par7, float par8, int par9) { -+ this.minecartX = par1; -+ this.minecartY = par3; -+ this.minecartZ = par5; -+ this.minecartYaw = (double)par7; -+ this.minecartPitch = (double)par8; -+ this.turnProgress = par9 + 2; - this.motionX = this.velocityX; - this.motionY = this.velocityY; - this.motionZ = this.velocityZ; - } - -- public void setVelocity(double var1, double var3, double var5) { -- this.velocityX = this.motionX = var1; -- this.velocityY = this.motionY = var3; -- this.velocityZ = this.motionZ = var5; -- } -- -- public void setDamage(float var1) { -- this.dataWatcher.updateObject(19, Float.valueOf(var1)); -- } -- -+ /** -+ * Sets the velocity to the args. Args: x, y, z -+ */ -+ public void setVelocity(double par1, double par3, double par5) { -+ this.velocityX = this.motionX = par1; -+ this.velocityY = this.motionY = par3; -+ this.velocityZ = this.motionZ = par5; -+ } -+ -+ /** -+ * Sets the current amount of damage the minecart has taken. Decreases over time. The cart breaks when this is over 40. -+ */ -+ public void setDamage(float par1) { -+ this.dataWatcher.updateObject(19, Float.valueOf(par1)); -+ } -+ -+ /** -+ * Gets the current amount of damage the minecart has taken. Decreases over time. The cart breaks when this is over 40. -+ */ - public float getDamage() { - return this.dataWatcher.getWatchableObjectFloat(19); - } - -- public void setRollingAmplitude(int var1) { -- this.dataWatcher.updateObject(17, Integer.valueOf(var1)); -+ /** -+ * Sets the rolling amplitude the cart rolls while being attacked. -+ */ -+ public void setRollingAmplitude(int par1) { -+ this.dataWatcher.updateObject(17, Integer.valueOf(par1)); - } - -+ /** -+ * Gets the rolling amplitude the cart rolls while being attacked. -+ */ - public int getRollingAmplitude() { - return this.dataWatcher.getWatchableObjectInt(17); - } - -- public void setRollingDirection(int var1) { -- this.dataWatcher.updateObject(18, Integer.valueOf(var1)); -+ /** -+ * Sets the rolling direction the cart rolls while being attacked. Can be 1 or -1. -+ */ -+ public void setRollingDirection(int par1) { -+ this.dataWatcher.updateObject(18, Integer.valueOf(par1)); - } - -+ /** -+ * Gets the rolling direction the cart rolls while being attacked. Can be 1 or -1. -+ */ - public int getRollingDirection() { - return this.dataWatcher.getWatchableObjectInt(18); - } -@@ -752,10 +870,10 @@ - public abstract int getMinecartType(); - - public Block getDisplayTile() { -- if(!this.hasDisplayTile()) { -+ if (!this.hasDisplayTile()) { - return this.getDefaultDisplayTile(); - } else { -- int var1 = this.getDataWatcher().getWatchableObjectInt(20) & '\uffff'; -+ int var1 = this.getDataWatcher().getWatchableObjectInt(20) & 65535; - return var1 > 0 && var1 < Block.blocksList.length ? Block.blocksList[var1] : null; - } - } -@@ -780,20 +898,20 @@ - return 6; - } - -- public void setDisplayTile(int var1) { -- this.getDataWatcher().updateObject(20, Integer.valueOf(var1 & '\uffff' | this.getDisplayTileData() << 16)); -+ public void setDisplayTile(int par1) { -+ this.getDataWatcher().updateObject(20, Integer.valueOf(par1 & 65535 | this.getDisplayTileData() << 16)); - this.setHasDisplayTile(true); - } - -- public void setDisplayTileData(int var1) { -+ public void setDisplayTileData(int par1) { - Block var2 = this.getDisplayTile(); - int var3 = var2 == null ? 0 : var2.blockID; -- this.getDataWatcher().updateObject(20, Integer.valueOf(var3 & '\uffff' | var1 << 16)); -+ this.getDataWatcher().updateObject(20, Integer.valueOf(var3 & 65535 | par1 << 16)); - this.setHasDisplayTile(true); - } - -- public void setDisplayTileOffset(int var1) { -- this.getDataWatcher().updateObject(21, Integer.valueOf(var1)); -+ public void setDisplayTileOffset(int par1) { -+ this.getDataWatcher().updateObject(21, Integer.valueOf(par1)); - this.setHasDisplayTile(true); - } - -@@ -801,23 +919,33 @@ - return this.getDataWatcher().getWatchableObjectByte(22) == 1; - } - -- public void setHasDisplayTile(boolean var1) { -- this.getDataWatcher().updateObject(22, Byte.valueOf((byte)(var1 ? 1 : 0))); -- } -- -- public void setMinecartName(String var1) { -- this.c = var1; -- } -- -+ public void setHasDisplayTile(boolean par1) { -+ this.getDataWatcher().updateObject(22, Byte.valueOf((byte)(par1 ? 1 : 0))); -+ } -+ -+ /** -+ * Sets the minecart's name. -+ */ -+ public void setMinecartName(String par1Str) { -+ this.entityName = par1Str; -+ } -+ -+ /** -+ * Gets the username of the entity. -+ */ - public String getEntityName() { -- return this.c != null ? this.c : super.getEntityName(); -+ return this.entityName != null ? this.entityName : super.getEntityName(); - } - -+ /** -+ * If this returns false, the inventory name will be used as an unlocalized name, and translated into the player's -+ * language. Otherwise it will be used directly. -+ */ - public boolean isInvNameLocalized() { -- return this.c != null; -+ return this.entityName != null; - } - - public String func_95999_t() { -- return this.c; -+ return this.entityName; - } - } ---- net/minecraft/src/ContainerFurnace.java -+++ net/minecraft/src/ContainerFurnace.java -@@ -6,46 +6,55 @@ - private int lastBurnTime; - private int lastItemBurnTime; - -- public ContainerFurnace(InventoryPlayer var1, TileEntityFurnace var2) { -- this.furnace = var2; -- this.addSlotToContainer(new Slot(var2, 0, 56, 17)); -- this.addSlotToContainer(new Slot(var2, 1, 56, 53)); -- this.addSlotToContainer(new SlotFurnace(var1.player, var2, 2, 116, 35)); -- -+ public ContainerFurnace(InventoryPlayer par1InventoryPlayer, TileEntityFurnace par2TileEntityFurnace) { -+ this.furnace = par2TileEntityFurnace; -+ this.addSlotToContainer(new Slot(par2TileEntityFurnace, 0, 56, 17)); -+ this.addSlotToContainer(new Slot(par2TileEntityFurnace, 1, 56, 53)); -+ this.addSlotToContainer(new SlotFurnace(par1InventoryPlayer.player, par2TileEntityFurnace, 2, 116, 35)); - int var3; -- for(var3 = 0; var3 < 3; ++var3) { -- for(int var4 = 0; var4 < 9; ++var4) { -- this.addSlotToContainer(new Slot(var1, var4 + var3 * 9 + 9, 8 + var4 * 18, 84 + var3 * 18)); -+ -+ for (var3 = 0; var3 < 3; ++var3) { -+ for (int var4 = 0; var4 < 9; ++var4) { -+ this.addSlotToContainer(new Slot(par1InventoryPlayer, var4 + var3 * 9 + 9, 8 + var4 * 18, 84 + var3 * 18)); - } - } - -- for(var3 = 0; var3 < 9; ++var3) { -- this.addSlotToContainer(new Slot(var1, var3, 8 + var3 * 18, 142)); -+ for (var3 = 0; var3 < 9; ++var3) { -+ this.addSlotToContainer(new Slot(par1InventoryPlayer, var3, 8 + var3 * 18, 142)); - } -- -- } -- -- public void onCraftGuiOpened(ICrafting var1) { -- super.onCraftGuiOpened(var1); -- var1.sendProgressBarUpdate(this, 0, this.furnace.furnaceCookTime); -- var1.sendProgressBarUpdate(this, 1, this.furnace.furnaceBurnTime); -- var1.sendProgressBarUpdate(this, 2, this.furnace.currentItemBurnTime); -- } -- -+ } -+ -+ // Spout Start -+ public IInventory getIInventory() { -+ return furnace; -+ } -+ // Spout End -+ -+ public void addCraftingToCrafters(ICrafting par1ICrafting) { -+ super.addCraftingToCrafters(par1ICrafting); -+ par1ICrafting.sendProgressBarUpdate(this, 0, this.furnace.furnaceCookTime); -+ par1ICrafting.sendProgressBarUpdate(this, 1, this.furnace.furnaceBurnTime); -+ par1ICrafting.sendProgressBarUpdate(this, 2, this.furnace.currentItemBurnTime); -+ } -+ -+ /** -+ * Looks for changes made in the container, sends them to every listener. -+ */ - public void detectAndSendChanges() { - super.detectAndSendChanges(); - -- for(int var1 = 0; var1 < this.e.size(); ++var1) { -- ICrafting var2 = (ICrafting)this.e.get(var1); -- if(this.lastCookTime != this.furnace.furnaceCookTime) { -+ for (int var1 = 0; var1 < this.crafters.size(); ++var1) { -+ ICrafting var2 = (ICrafting)this.crafters.get(var1); -+ -+ if (this.lastCookTime != this.furnace.furnaceCookTime) { - var2.sendProgressBarUpdate(this, 0, this.furnace.furnaceCookTime); - } - -- if(this.lastBurnTime != this.furnace.furnaceBurnTime) { -+ if (this.lastBurnTime != this.furnace.furnaceBurnTime) { - var2.sendProgressBarUpdate(this, 1, this.furnace.furnaceBurnTime); - } - -- if(this.lastItemBurnTime != this.furnace.currentItemBurnTime) { -+ if (this.lastItemBurnTime != this.furnace.currentItemBurnTime) { - var2.sendProgressBarUpdate(this, 2, this.furnace.currentItemBurnTime); - } - } -@@ -55,68 +64,72 @@ - this.lastItemBurnTime = this.furnace.currentItemBurnTime; - } - -- public void updateProgressBar(int var1, int var2) { -- if(var1 == 0) { -- this.furnace.furnaceCookTime = var2; -- } -- -- if(var1 == 1) { -- this.furnace.furnaceBurnTime = var2; -- } -- -- if(var1 == 2) { -- this.furnace.currentItemBurnTime = var2; -- } -- -- } -- -- public boolean canInteractWith(EntityPlayer var1) { -- return this.furnace.isUseableByPlayer(var1); -- } -- -- public ItemStack transferStackInSlot(EntityPlayer var1, int var2) { -+ public void updateProgressBar(int par1, int par2) { -+ if (par1 == 0) { -+ this.furnace.furnaceCookTime = par2; -+ } -+ -+ if (par1 == 1) { -+ this.furnace.furnaceBurnTime = par2; -+ } -+ -+ if (par1 == 2) { -+ this.furnace.currentItemBurnTime = par2; -+ } -+ } -+ -+ public boolean canInteractWith(EntityPlayer par1EntityPlayer) { -+ return this.furnace.isUseableByPlayer(par1EntityPlayer); -+ } -+ -+ /** -+ * Called when a player shift-clicks on a slot. You must override this or you will crash when someone does that. -+ */ -+ public ItemStack transferStackInSlot(EntityPlayer par1EntityPlayer, int par2) { - ItemStack var3 = null; -- Slot var4 = (Slot)this.c.get(var2); -- if(var4 != null && var4.getHasStack()) { -+ Slot var4 = (Slot)this.inventorySlots.get(par2); -+ -+ if (var4 != null && var4.getHasStack()) { - ItemStack var5 = var4.getStack(); - var3 = var5.copy(); -- if(var2 == 2) { -- if(!this.mergeItemStack(var5, 3, 39, true)) { -+ -+ if (par2 == 2) { -+ if (!this.mergeItemStack(var5, 3, 39, true)) { - return null; - } - - var4.onSlotChange(var5, var3); -- } else if(var2 != 1 && var2 != 0) { -- if(FurnaceRecipes.smelting().getSmeltingResult(var5.getItem().itemID) != null) { -- if(!this.mergeItemStack(var5, 0, 1, false)) { -- return null; -- } -- } else if(TileEntityFurnace.isItemFuel(var5)) { -- if(!this.mergeItemStack(var5, 1, 2, false)) { -- return null; -- } -- } else if(var2 >= 3 && var2 < 30) { -- if(!this.mergeItemStack(var5, 30, 39, false)) { -- return null; -- } -- } else if(var2 >= 30 && var2 < 39 && !this.mergeItemStack(var5, 3, 30, false)) { -+ } else if (par2 != 1 && par2 != 0) { -+ if (FurnaceRecipes.smelting().getSmeltingResult(var5.getItem().itemID) != null) { -+ if (!this.mergeItemStack(var5, 0, 1, false)) { -+ return null; -+ } -+ } else if (TileEntityFurnace.isItemFuel(var5)) { -+ if (!this.mergeItemStack(var5, 1, 2, false)) { -+ return null; -+ } -+ } else if (par2 >= 3 && par2 < 30) { -+ if (!this.mergeItemStack(var5, 30, 39, false)) { -+ return null; -+ } -+ } else if (par2 >= 30 && par2 < 39 && !this.mergeItemStack(var5, 3, 30, false)) { - return null; - } -- } else if(!this.mergeItemStack(var5, 3, 39, false)) { -+ } else if (!this.mergeItemStack(var5, 3, 39, false)) { - return null; - } - -- if(var5.stackSize == 0) { -+ if (var5.stackSize == 0) { - var4.putStack((ItemStack)null); - } else { - var4.onSlotChanged(); - } - -- if(var5.stackSize == var3.stackSize) { -+ if (var5.stackSize == var3.stackSize) { - return null; - } - -- var4.onPickupFromSlot(var1, var5); -+ var4.onPickupFromSlot(par1EntityPlayer, var5); - } - - return var3; ---- net/minecraft/src/PlayerCapabilities.java -+++ net/minecraft/src/PlayerCapabilities.java -@@ -1,15 +1,27 @@ - package net.minecraft.src; - - public class PlayerCapabilities { -+ -+ /** Disables player damage. */ - public boolean disableDamage; -+ -+ /** Sets/indicates whether the player is flying. */ - public boolean isFlying; -+ -+ /** whether or not to allow the player to fly when they double jump. */ - public boolean allowFlying; -+ -+ /** -+ * Used to determine if creative mode is enabled, and therefore if items should be depleted on usage -+ */ - public boolean isCreativeMode; -+ -+ /** Indicates whether the player is allowed to modify the surroundings */ - public boolean allowEdit = true; - private float flySpeed = 0.05F; - private float walkSpeed = 0.1F; - -- public void writeCapabilitiesToNBT(NBTTagCompound var1) { -+ public void writeCapabilitiesToNBT(NBTTagCompound par1NBTTagCompound) { - NBTTagCompound var2 = new NBTTagCompound(); - var2.setBoolean("invulnerable", this.disableDamage); - var2.setBoolean("flying", this.isFlying); -@@ -18,41 +30,41 @@ - var2.setBoolean("mayBuild", this.allowEdit); - var2.setFloat("flySpeed", this.flySpeed); - var2.setFloat("walkSpeed", this.walkSpeed); -- var1.setTag("abilities", var2); -+ par1NBTTagCompound.setTag("abilities", var2); - } - -- public void readCapabilitiesFromNBT(NBTTagCompound var1) { -- if(var1.hasKey("abilities")) { -- NBTTagCompound var2 = var1.getCompoundTag("abilities"); -+ public void readCapabilitiesFromNBT(NBTTagCompound par1NBTTagCompound) { -+ if (par1NBTTagCompound.hasKey("abilities")) { -+ NBTTagCompound var2 = par1NBTTagCompound.getCompoundTag("abilities"); - this.disableDamage = var2.getBoolean("invulnerable"); - this.isFlying = var2.getBoolean("flying"); - this.allowFlying = var2.getBoolean("mayfly"); - this.isCreativeMode = var2.getBoolean("instabuild"); -- if(var2.hasKey("flySpeed")) { -+ -+ if (var2.hasKey("flySpeed")) { - this.flySpeed = var2.getFloat("flySpeed"); - this.walkSpeed = var2.getFloat("walkSpeed"); - } - -- if(var2.hasKey("mayBuild")) { -+ if (var2.hasKey("mayBuild")) { - this.allowEdit = var2.getBoolean("mayBuild"); - } - } -- - } - - public float getFlySpeed() { - return this.flySpeed; - } - -- public void setFlySpeed(float var1) { -- this.flySpeed = var1; -+ public void setFlySpeed(float par1) { -+ this.flySpeed = par1; - } - - public float getWalkSpeed() { - return this.walkSpeed; - } - -- public void setPlayerWalkSpeed(float var1) { -- this.walkSpeed = var1; -+ public void setPlayerWalkSpeed(float par1) { -+ this.walkSpeed = par1; - } - } ---- net/minecraft/src/MaterialWeb.java -+++ net/minecraft/src/MaterialWeb.java -@@ -1,10 +1,13 @@ - package net.minecraft.src; - - final class MaterialWeb extends Material { -- MaterialWeb(MapColor var1) { -- super(var1); -+ MaterialWeb(MapColor par1MapColor) { -+ super(par1MapColor); - } - -+ /** -+ * Returns if this material is considered solid or not -+ */ - public boolean blocksMovement() { - return false; - } ---- /dev/null -+++ org/spoutcraft/client/io/CustomTextureManager.java -@@ -1,0 +1,255 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.client.io; -+ -+import java.io.File; -+import java.io.FileInputStream; -+import java.io.IOException; -+import java.io.InputStream; -+import java.net.URLDecoder; -+import java.util.HashMap; -+ -+import org.lwjgl.opengl.GL11; -+import org.newdawn.slick.opengl.Texture; -+import org.newdawn.slick.opengl.TextureLoader; -+ -+import net.minecraft.src.Minecraft; -+import net.minecraft.src.ItemStack; -+import net.minecraft.src.World; -+ -+import org.spoutcraft.api.block.design.BlockDesign; -+import org.spoutcraft.api.Spoutcraft; -+import org.spoutcraft.api.material.CustomBlock; -+import org.spoutcraft.api.material.CustomItem; -+import org.spoutcraft.api.material.MaterialData; -+import org.spoutcraft.client.SpoutClient; -+import org.spoutcraft.client.block.SpoutcraftChunk; -+import org.spoutcraft.client.gui.minimap.ZanMinimap; -+import org.spoutcraft.client.SpoutcraftWorld; -+ -+public class CustomTextureManager { -+ static HashMap textures = new HashMap(); -+ static HashMap cacheTextureFiles = new HashMap(); -+ -+ public static void downloadTexture(String url) { -+ downloadTexture(null, url, false); -+ } -+ -+ public static void downloadTexture(String url, boolean ignoreEnding) { -+ downloadTexture(null, url, ignoreEnding); -+ } -+ -+ public static void downloadTexture(String plugin, String url, boolean ignoreEnding) { -+ String fileName = FileUtil.getFileName(url); -+ if (!ignoreEnding && !FileUtil.isImageFile(fileName)) { -+ System.out.println("Rejecting download of invalid texture: " + fileName); -+ } else if (!isTextureDownloading(url) && !isTextureDownloaded(plugin, url)) { -+ File dir = FileUtil.getTempDir(); -+ if (plugin != null) { -+ dir = new File(FileUtil.getCacheDir(), plugin); -+ dir.mkdir(); -+ } -+ Download download = new Download(fileName, dir, url, null); -+ FileDownloadThread.getInstance().addToDownloadQueue(download); -+ } -+ } -+ -+ public static void downloadTexture(String plugin, String url) { -+ downloadTexture(plugin, url, false); -+ } -+ -+ public static boolean isTextureDownloading(String url) { -+ return FileDownloadThread.getInstance().isDownloading(url); -+ } -+ -+ public static boolean isTextureDownloaded(String url) { -+ return getTextureFile(null, url).exists(); -+ } -+ -+ public static boolean isTextureDownloaded(String addon, String url) { -+ return getTextureFile(addon, url).exists(); -+ } -+ -+ public static File getTextureFile(String plugin, String url) { -+ String fileName = FileUtil.getFileName(url); -+ File cache = cacheTextureFiles.get(plugin + File.separator + fileName); -+ if (cache != null) { -+ return cache; -+ } -+ if (plugin != null) { -+ File file = FileUtil.findFile(plugin, fileName); -+ if (file != null) { -+ cacheTextureFiles.put(plugin + File.separator + fileName, file); -+ return file; -+ } -+ } -+ return new File(FileUtil.getTempDir(), fileName); -+ } -+ -+ public static Texture getTextureFromPath(String path) { -+ if (textures.containsKey(path)) { -+ return textures.get(path); -+ } -+ Texture texture = null; -+ try { -+ FileInputStream stream = new FileInputStream(path); -+ if (stream.available() > 0) { -+ texture = TextureLoader.getTexture(path.toLowerCase().endsWith(".png") ? "PNG" : "JPG", stream, true, GL11.GL_NEAREST); -+ } -+ stream.close(); -+ } catch (IOException e) { -+ } -+ -+ if (texture != null) { -+ textures.put(path, texture); -+ } -+ return texture; -+ } -+ -+ public static Texture getTextureFromJar(String path) { -+ if (textures.containsKey(path)) { -+ return textures.get(path); -+ } -+ -+ Texture texture = null; -+ // Check inside jar -+ try { -+ InputStream stream = Minecraft.class.getResourceAsStream(path); -+ texture = TextureLoader.getTexture(path.toLowerCase().endsWith(".png") ? "PNG" : "JPG", stream, true, GL11.GL_NEAREST); -+ stream.close(); -+ } catch (Exception e) { } -+ // Check MCP/Eclipse Path -+ if (texture == null) { -+ String pathToJar; -+ File jar = new File(CustomTextureManager.class.getProtectionDomain().getCodeSource().getLocation().getFile()); -+ try { -+ pathToJar = jar.getCanonicalPath(); -+ } catch (IOException e1) { -+ pathToJar = jar.getAbsolutePath(); -+ } -+ try { -+ pathToJar = URLDecoder.decode(pathToJar, "UTF-8"); -+ } catch (java.io.UnsupportedEncodingException ignore) { } -+ -+ File relative = new File(pathToJar + "/../../src/main/resources" + path.substring(4)); -+ -+ try { -+ pathToJar = relative.getCanonicalPath(); -+ } catch (IOException e) { -+ pathToJar = relative.getAbsolutePath(); -+ } -+ -+ texture = getTextureFromPath(pathToJar); -+ } -+ -+ if (texture != null) { -+ textures.put(path, texture); -+ } -+ -+ return texture; -+ } -+ -+ public static void resetTextures() { -+ for (Texture texture : textures.values()) { -+ texture.release(); -+ } -+ cacheTextureFiles.clear(); -+ textures.clear(); -+ ZanMinimap.instance.texman.reset(); -+ } -+ -+ public static Texture getTextureFromUrl(String url) { -+ Texture tex = getTextureFromUrl(null, url); -+ if (tex == null) { -+ CustomTextureManager.downloadTexture(url, true); -+ tex = CustomTextureManager.getTextureFromPath(FileUtil.getAssetsDir().getPath()+"/block/spout.png"); -+ } -+ return tex; -+ } -+ -+ public static Texture getTextureFromUrl(String plugin, String url) { -+ File texture = getTextureFile(plugin, url); -+ try { -+ return getTextureFromPath(texture.getCanonicalPath()); -+ } catch (IOException e) { -+ e.printStackTrace(); -+ return null; -+ } -+ } -+ -+ public static String getTexturePathFromUrl(String url) { // Only used for sky, null checks not needed! -+ return getTexturePathFromUrl(null, url); -+ } -+ -+ public static String getTexturePathFromUrl(String plugin, String url) { // Only used above! -+ if (!isTextureDownloaded(plugin, url)) { -+ return null; -+ } -+ File download = new File(FileUtil.getTempDir(), FileUtil.getFileName(url)); -+ try { -+ return download.getCanonicalPath(); -+ } catch (IOException e) { -+ e.printStackTrace(); -+ } -+ return null; -+ } -+ -+ // Don't call this method, for future use. -+ protected Texture getTextureFromCoords(World world, int x, int y, int z) { -+ short customId = 0; -+ Texture texture = null; -+ if (SpoutClient.getInstance().getRawWorld() != null) { -+ SpoutcraftChunk sChunk = Spoutcraft.getChunkAt(SpoutClient.getInstance().getRawWorld(), x, y, z); -+ customId = sChunk.getCustomBlockId(x, y, z); -+ short[] customBlockIds = sChunk.getCustomBlockIds(); -+ byte[] customBlockData = sChunk.getCustomBlockData(); -+ -+ if (customId > 0) { -+ CustomBlock block = MaterialData.getCustomBlock(customId); -+ if (block != null) { -+ BlockDesign design = block.getBlockDesign(customBlockData[customId]); -+ if (design != null) { -+ texture = getTextureFromUrl(block.getAddon(), design.getTextureURL()); -+ } -+ } -+ } -+ } -+ return texture; -+ } -+ -+ // Don't call this method, for future use. -+ protected Texture getTextureFromItemStack(ItemStack itemStack) { -+ BlockDesign design = null; -+ Texture texture = null; -+ org.spoutcraft.api.material.CustomItem item = MaterialData.getCustomItem(itemStack.getItemDamage()); -+ if (item != null) { -+ String textureURI = item.getTexture(); -+ if (textureURI == null) { -+ org.spoutcraft.api.material.CustomBlock block = MaterialData.getCustomBlock(itemStack.getItemDamage()); -+ design = block != null ? block.getBlockDesign() : null; -+ textureURI = design != null ? design.getTextureURL() : null; -+ } -+ if (textureURI != null) { -+ texture = CustomTextureManager.getTextureFromUrl(item.getAddon(), textureURI); -+ } -+ } -+ return texture; -+ } -+} ---- net/minecraft/src/BlockMushroom.java -+++ net/minecraft/src/BlockMushroom.java -@@ -3,27 +3,31 @@ - import java.util.Random; - - public class BlockMushroom extends BlockFlower { -- protected BlockMushroom(int var1) { -- super(var1); -+ protected BlockMushroom(int par1) { -+ super(par1); - float var2 = 0.2F; - this.setBlockBounds(0.5F - var2, 0.0F, 0.5F - var2, 0.5F + var2, var2 * 2.0F, 0.5F + var2); - this.setTickRandomly(true); - } - -- public void updateTick(World var1, int var2, int var3, int var4, Random var5) { -- if(var5.nextInt(25) == 0) { -+ /** -+ * Ticks the block if it's been scheduled -+ */ -+ public void updateTick(World par1World, int par2, int par3, int par4, Random par5Random) { -+ if (par5Random.nextInt(25) == 0) { - byte var6 = 4; - int var7 = 5; -- - int var8; - int var9; - int var10; -- for(var8 = var2 - var6; var8 <= var2 + var6; ++var8) { -- for(var9 = var4 - var6; var9 <= var4 + var6; ++var9) { -- for(var10 = var3 - 1; var10 <= var3 + 1; ++var10) { -- if(var1.getBlockId(var8, var10, var9) == this.blockID) { -+ -+ for (var8 = par2 - var6; var8 <= par2 + var6; ++var8) { -+ for (var9 = par4 - var6; var9 <= par4 + var6; ++var9) { -+ for (var10 = par3 - 1; var10 <= par3 + 1; ++var10) { -+ if (par1World.getBlockId(var8, var10, var9) == this.blockID) { - --var7; -- if(var7 <= 0) { -+ -+ if (var7 <= 0) { - return; - } - } -@@ -31,60 +35,73 @@ - } - } - -- var8 = var2 + var5.nextInt(3) - 1; -- var9 = var3 + var5.nextInt(2) - var5.nextInt(2); -- var10 = var4 + var5.nextInt(3) - 1; -+ var8 = par2 + par5Random.nextInt(3) - 1; -+ var9 = par3 + par5Random.nextInt(2) - par5Random.nextInt(2); -+ var10 = par4 + par5Random.nextInt(3) - 1; - -- for(int var11 = 0; var11 < 4; ++var11) { -- if(var1.isAirBlock(var8, var9, var10) && this.canBlockStay(var1, var8, var9, var10)) { -- var2 = var8; -- var3 = var9; -- var4 = var10; -+ for (int var11 = 0; var11 < 4; ++var11) { -+ if (par1World.isAirBlock(var8, var9, var10) && this.canBlockStay(par1World, var8, var9, var10)) { -+ par2 = var8; -+ par3 = var9; -+ par4 = var10; - } - -- var8 = var2 + var5.nextInt(3) - 1; -- var9 = var3 + var5.nextInt(2) - var5.nextInt(2); -- var10 = var4 + var5.nextInt(3) - 1; -+ var8 = par2 + par5Random.nextInt(3) - 1; -+ var9 = par3 + par5Random.nextInt(2) - par5Random.nextInt(2); -+ var10 = par4 + par5Random.nextInt(3) - 1; - } - -- if(var1.isAirBlock(var8, var9, var10) && this.canBlockStay(var1, var8, var9, var10)) { -- var1.setBlock(var8, var9, var10, this.blockID, 0, 2); -+ if (par1World.isAirBlock(var8, var9, var10) && this.canBlockStay(par1World, var8, var9, var10)) { -+ par1World.setBlock(var8, var9, var10, this.blockID, 0, 2); - } - } -- -- } -- -- public boolean canPlaceBlockAt(World var1, int var2, int var3, int var4) { -- return super.canPlaceBlockAt(var1, var2, var3, var4) && this.canBlockStay(var1, var2, var3, var4); -- } -- -- protected boolean canThisPlantGrowOnThisBlockID(int var1) { -- return Block.opaqueCubeLookup[var1]; -- } -- -- public boolean canBlockStay(World var1, int var2, int var3, int var4) { -- if(var3 >= 0 && var3 < 256) { -- int var5 = var1.getBlockId(var2, var3 - 1, var4); -- return var5 == Block.mycelium.blockID || var1.getFullBlockLightValue(var2, var3, var4) < 13 && this.canThisPlantGrowOnThisBlockID(var5); -+ } -+ -+ /** -+ * Checks to see if its valid to put this block at the specified coordinates. Args: world, x, y, z -+ */ -+ public boolean canPlaceBlockAt(World par1World, int par2, int par3, int par4) { -+ return super.canPlaceBlockAt(par1World, par2, par3, par4) && this.canBlockStay(par1World, par2, par3, par4); -+ } -+ -+ /** -+ * Gets passed in the blockID of the block below and supposed to return true if its allowed to grow on the type of -+ * blockID passed in. Args: blockID -+ */ -+ protected boolean canThisPlantGrowOnThisBlockID(int par1) { -+ return Block.opaqueCubeLookup[par1]; -+ } -+ -+ /** -+ * Can this block stay at this position. Similar to canPlaceBlockAt except gets checked often with plants. -+ */ -+ public boolean canBlockStay(World par1World, int par2, int par3, int par4) { -+ if (par3 >= 0 && par3 < 256) { -+ int var5 = par1World.getBlockId(par2, par3 - 1, par4); -+ return var5 == Block.mycelium.blockID || par1World.getFullBlockLightValue(par2, par3, par4) < 13 && this.canThisPlantGrowOnThisBlockID(var5); - } else { - return false; - } - } - -- public boolean fertilizeMushroom(World var1, int var2, int var3, int var4, Random var5) { -- int var6 = var1.getBlockMetadata(var2, var3, var4); -- var1.setBlockToAir(var2, var3, var4); -+ /** -+ * Fertilize the mushroom. -+ */ -+ public boolean fertilizeMushroom(World par1World, int par2, int par3, int par4, Random par5Random) { -+ int var6 = par1World.getBlockMetadata(par2, par3, par4); -+ par1World.setBlockToAir(par2, par3, par4); - WorldGenBigMushroom var7 = null; -- if(this.blockID == Block.mushroomBrown.blockID) { -+ -+ if (this.blockID == Block.mushroomBrown.blockID) { - var7 = new WorldGenBigMushroom(0); -- } else if(this.blockID == Block.mushroomRed.blockID) { -+ } else if (this.blockID == Block.mushroomRed.blockID) { - var7 = new WorldGenBigMushroom(1); - } - -- if(var7 != null && var7.generate(var1, var5, var2, var3, var4)) { -+ if (var7 != null && var7.generate(par1World, par5Random, par2, par3, par4)) { - return true; - } else { -- var1.setBlock(var2, var3, var4, this.blockID, var6, 3); -+ par1World.setBlock(par2, par3, par4, this.blockID, var6, 3); - return false; - } - } ---- net/minecraft/src/ModelBook.java -+++ net/minecraft/src/ModelBook.java -@@ -1,39 +1,61 @@ - package net.minecraft.src; - - public class ModelBook extends ModelBase { -+ -+ /** Right cover renderer (when facing the book) */ - public ModelRenderer coverRight = (new ModelRenderer(this)).setTextureOffset(0, 0).addBox(-6.0F, -5.0F, 0.0F, 6, 10, 0); -+ -+ /** Left cover renderer (when facing the book) */ - public ModelRenderer coverLeft = (new ModelRenderer(this)).setTextureOffset(16, 0).addBox(0.0F, -5.0F, 0.0F, 6, 10, 0); -+ -+ /** The right pages renderer (when facing the book) */ - public ModelRenderer pagesRight = (new ModelRenderer(this)).setTextureOffset(0, 10).addBox(0.0F, -4.0F, -0.99F, 5, 8, 1); -+ -+ /** The left pages renderer (when facing the book) */ - public ModelRenderer pagesLeft = (new ModelRenderer(this)).setTextureOffset(12, 10).addBox(0.0F, -4.0F, -0.01F, 5, 8, 1); -+ -+ /** Right cover renderer (when facing the book) */ - public ModelRenderer flippingPageRight = (new ModelRenderer(this)).setTextureOffset(24, 10).addBox(0.0F, -4.0F, 0.0F, 5, 8, 0); -+ -+ /** Right cover renderer (when facing the book) */ - public ModelRenderer flippingPageLeft = (new ModelRenderer(this)).setTextureOffset(24, 10).addBox(0.0F, -4.0F, 0.0F, 5, 8, 0); -+ -+ /** The renderer of spine of the book */ - public ModelRenderer bookSpine = (new ModelRenderer(this)).setTextureOffset(12, 0).addBox(-1.0F, -5.0F, 0.0F, 2, 10, 0); - - public ModelBook() { - this.coverRight.setRotationPoint(0.0F, 0.0F, -1.0F); - this.coverLeft.setRotationPoint(0.0F, 0.0F, 1.0F); -- this.bookSpine.rotateAngleY = (float)Math.PI * 0.5F; -- } -- -- public void render(Entity var1, float var2, float var3, float var4, float var5, float var6, float var7) { -- this.setRotationAngles(var2, var3, var4, var5, var6, var7, var1); -- this.coverRight.render(var7); -- this.coverLeft.render(var7); -- this.bookSpine.render(var7); -- this.pagesRight.render(var7); -- this.pagesLeft.render(var7); -- this.flippingPageRight.render(var7); -- this.flippingPageLeft.render(var7); -- } -- -- public void setRotationAngles(float var1, float var2, float var3, float var4, float var5, float var6, Entity var7) { -- float var8 = (MathHelper.sin(var1 * 0.02F) * 0.1F + 1.25F) * var4; -+ this.bookSpine.rotateAngleY = ((float)Math.PI / 2F); -+ } -+ -+ /** -+ * Sets the models various rotation angles then renders the model. -+ */ -+ public void render(Entity par1Entity, float par2, float par3, float par4, float par5, float par6, float par7) { -+ this.setRotationAngles(par2, par3, par4, par5, par6, par7, par1Entity); -+ this.coverRight.render(par7); -+ this.coverLeft.render(par7); -+ this.bookSpine.render(par7); -+ this.pagesRight.render(par7); -+ this.pagesLeft.render(par7); -+ this.flippingPageRight.render(par7); -+ this.flippingPageLeft.render(par7); -+ } -+ -+ /** -+ * Sets the model's various rotation angles. For bipeds, par1 and par2 are used for animating the movement of arms and -+ * legs, where par1 represents the time(so that arms and legs swing back and forth) and par2 represents how "far" arms -+ * and legs can swing at most. -+ */ -+ public void setRotationAngles(float par1, float par2, float par3, float par4, float par5, float par6, Entity par7Entity) { -+ float var8 = (MathHelper.sin(par1 * 0.02F) * 0.1F + 1.25F) * par4; - this.coverRight.rotateAngleY = (float)Math.PI + var8; - this.coverLeft.rotateAngleY = -var8; - this.pagesRight.rotateAngleY = var8; - this.pagesLeft.rotateAngleY = -var8; -- this.flippingPageRight.rotateAngleY = var8 - var8 * 2.0F * var2; -- this.flippingPageLeft.rotateAngleY = var8 - var8 * 2.0F * var3; -+ this.flippingPageRight.rotateAngleY = var8 - var8 * 2.0F * par2; -+ this.flippingPageLeft.rotateAngleY = var8 - var8 * 2.0F * par3; - this.pagesRight.rotationPointX = MathHelper.sin(var8); - this.pagesLeft.rotationPointX = MathHelper.sin(var8); - this.flippingPageRight.rotationPointX = MathHelper.sin(var8); ---- /dev/null -+++ org/spoutcraft/client/gui/settings/controls/SensitivitySlider.java -@@ -1,0 +1,42 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.client.gui.settings.controls; -+ -+import net.minecraft.src.Minecraft; -+ -+import org.spoutcraft.api.gui.GenericSlider; -+ -+public class SensitivitySlider extends GenericSlider { -+ public SensitivitySlider() { -+ super("Sensitivity"); -+ setSliderPosition(Minecraft.getMinecraft().gameSettings.mouseSensitivity); -+ setTooltip("Sensitivity\nAdjusts the sensitivity of the mouse in game."); -+ } -+ -+ @Override -+ public void onSliderDrag(float old, float newPos) { -+ Minecraft.getMinecraft().gameSettings.mouseSensitivity = newPos; -+ Minecraft.getMinecraft().gameSettings.saveOptions(); -+ } -+ -+ public String getText() { -+ return "Sensitivity: " + (int)(this.getSliderPosition() * 200) + "%"; -+ } -+} ---- net/minecraft/src/BlockCactus.java -+++ net/minecraft/src/BlockCactus.java -@@ -6,91 +6,132 @@ - private Icon cactusTopIcon; - private Icon cactusBottomIcon; - -- protected BlockCactus(int var1) { -- super(var1, Material.cactus); -+ protected BlockCactus(int par1) { -+ super(par1, Material.cactus); - this.setTickRandomly(true); - this.setCreativeTab(CreativeTabs.tabDecorations); - } - -- public void updateTick(World var1, int var2, int var3, int var4, Random var5) { -- if(var1.isAirBlock(var2, var3 + 1, var4)) { -+ /** -+ * Ticks the block if it's been scheduled -+ */ -+ public void updateTick(World par1World, int par2, int par3, int par4, Random par5Random) { -+ if (par1World.isAirBlock(par2, par3 + 1, par4)) { - int var6; -- for(var6 = 1; var1.getBlockId(var2, var3 - var6, var4) == this.blockID; ++var6) { -+ -+ for (var6 = 1; par1World.getBlockId(par2, par3 - var6, par4) == this.blockID; ++var6) { -+ ; - } - -- if(var6 < 3) { -- int var7 = var1.getBlockMetadata(var2, var3, var4); -- if(var7 == 15) { -- var1.setBlock(var2, var3 + 1, var4, this.blockID); -- var1.setBlockMetadata(var2, var3, var4, 0, 4); -- this.onNeighborBlockChange(var1, var2, var3 + 1, var4, this.blockID); -+ if (var6 < 3) { -+ int var7 = par1World.getBlockMetadata(par2, par3, par4); -+ -+ if (var7 == 15) { -+ par1World.setBlock(par2, par3 + 1, par4, this.blockID); -+ par1World.setBlockMetadataWithNotify(par2, par3, par4, 0, 4); -+ this.onNeighborBlockChange(par1World, par2, par3 + 1, par4, this.blockID); - } else { -- var1.setBlockMetadata(var2, var3, var4, var7 + 1, 4); -+ par1World.setBlockMetadataWithNotify(par2, par3, par4, var7 + 1, 4); - } - } - } -- -- } -- -- public AxisAlignedBB getCollisionBoundingBoxFromPool(World var1, int var2, int var3, int var4) { -- float var5 = 1.0F / 16.0F; -- return AxisAlignedBB.getAABBPool().getAABB((double)((float)var2 + var5), (double)var3, (double)((float)var4 + var5), (double)((float)(var2 + 1) - var5), (double)((float)(var3 + 1) - var5), (double)((float)(var4 + 1) - var5)); -- } -- -- public AxisAlignedBB getSelectedBoundingBoxFromPool(World var1, int var2, int var3, int var4) { -- float var5 = 1.0F / 16.0F; -- return AxisAlignedBB.getAABBPool().getAABB((double)((float)var2 + var5), (double)var3, (double)((float)var4 + var5), (double)((float)(var2 + 1) - var5), (double)(var3 + 1), (double)((float)(var4 + 1) - var5)); -- } -- -- public Icon getIcon(int var1, int var2) { -- return var1 == 1 ? this.cactusTopIcon : (var1 == 0 ? this.cactusBottomIcon : this.blockIcon); -- } -- -+ } -+ -+ /** -+ * Returns a bounding box from the pool of bounding boxes (this means this box can change after the pool has been -+ * cleared to be reused) -+ */ -+ public AxisAlignedBB getCollisionBoundingBoxFromPool(World par1World, int par2, int par3, int par4) { -+ float var5 = 0.0625F; -+ return AxisAlignedBB.getAABBPool().getAABB((double)((float)par2 + var5), (double)par3, (double)((float)par4 + var5), (double)((float)(par2 + 1) - var5), (double)((float)(par3 + 1) - var5), (double)((float)(par4 + 1) - var5)); -+ } -+ -+ /** -+ * Returns the bounding box of the wired rectangular prism to render. -+ */ -+ public AxisAlignedBB getSelectedBoundingBoxFromPool(World par1World, int par2, int par3, int par4) { -+ float var5 = 0.0625F; -+ return AxisAlignedBB.getAABBPool().getAABB((double)((float)par2 + var5), (double)par3, (double)((float)par4 + var5), (double)((float)(par2 + 1) - var5), (double)(par3 + 1), (double)((float)(par4 + 1) - var5)); -+ } -+ -+ /** -+ * From the specified side and block metadata retrieves the blocks texture. Args: side, metadata -+ */ -+ public Icon getIcon(int par1, int par2) { -+ return par1 == 1 ? this.cactusTopIcon : (par1 == 0 ? this.cactusBottomIcon : this.blockIcon); -+ } -+ -+ /** -+ * If this block doesn't render as an ordinary block it will return False (examples: signs, buttons, stairs, etc) -+ */ - public boolean renderAsNormalBlock() { - return false; - } - -+ /** -+ * Is this block (a) opaque and (b) a full 1m cube? This determines whether or not to render the shared face of two -+ * adjacent blocks and also whether the player can attach torches, redstone wire, etc to this block. -+ */ - public boolean isOpaqueCube() { - return false; - } - -+ /** -+ * The type of render function that is called for this block -+ */ - public int getRenderType() { - return 13; - } - -- public boolean canPlaceBlockAt(World var1, int var2, int var3, int var4) { -- return !super.canPlaceBlockAt(var1, var2, var3, var4) ? false : this.canBlockStay(var1, var2, var3, var4); -+ /** -+ * Checks to see if its valid to put this block at the specified coordinates. Args: world, x, y, z -+ */ -+ public boolean canPlaceBlockAt(World par1World, int par2, int par3, int par4) { -+ return !super.canPlaceBlockAt(par1World, par2, par3, par4) ? false : this.canBlockStay(par1World, par2, par3, par4); - } - -- public void onNeighborBlockChange(World var1, int var2, int var3, int var4, int var5) { -- if(!this.canBlockStay(var1, var2, var3, var4)) { -- var1.destroyBlock(var2, var3, var4, true); -+ /** -+ * Lets the block know when one of its neighbor changes. Doesn't know which neighbor changed (coordinates passed are -+ * their own) Args: x, y, z, neighbor blockID -+ */ -+ public void onNeighborBlockChange(World par1World, int par2, int par3, int par4, int par5) { -+ if (!this.canBlockStay(par1World, par2, par3, par4)) { -+ par1World.destroyBlock(par2, par3, par4, true); - } -- - } - -- public boolean canBlockStay(World var1, int var2, int var3, int var4) { -- if(var1.getBlockMaterial(var2 - 1, var3, var4).isSolid()) { -- return false; -- } else if(var1.getBlockMaterial(var2 + 1, var3, var4).isSolid()) { -- return false; -- } else if(var1.getBlockMaterial(var2, var3, var4 - 1).isSolid()) { -- return false; -- } else if(var1.getBlockMaterial(var2, var3, var4 + 1).isSolid()) { -+ /** -+ * Can this block stay at this position. Similar to canPlaceBlockAt except gets checked often with plants. -+ */ -+ public boolean canBlockStay(World par1World, int par2, int par3, int par4) { -+ if (par1World.getBlockMaterial(par2 - 1, par3, par4).isSolid()) { -+ return false; -+ } else if (par1World.getBlockMaterial(par2 + 1, par3, par4).isSolid()) { -+ return false; -+ } else if (par1World.getBlockMaterial(par2, par3, par4 - 1).isSolid()) { -+ return false; -+ } else if (par1World.getBlockMaterial(par2, par3, par4 + 1).isSolid()) { - return false; - } else { -- int var5 = var1.getBlockId(var2, var3 - 1, var4); -+ int var5 = par1World.getBlockId(par2, par3 - 1, par4); - return var5 == Block.cactus.blockID || var5 == Block.sand.blockID; - } - } - -- public void onEntityCollidedWithBlock(World var1, int var2, int var3, int var4, Entity var5) { -- var5.attackEntityFrom(DamageSource.cactus, 1.0F); -+ /** -+ * Triggered whenever an entity collides with this block (enters into the block). Args: world, x, y, z, entity -+ */ -+ public void onEntityCollidedWithBlock(World par1World, int par2, int par3, int par4, Entity par5Entity) { -+ par5Entity.attackEntityFrom(DamageSource.cactus, 1.0F); - } - -- public void registerIcons(IconRegister var1) { -- this.blockIcon = var1.registerIcon(this.getTextureName() + "_side"); -- this.cactusTopIcon = var1.registerIcon(this.getTextureName() + "_top"); -- this.cactusBottomIcon = var1.registerIcon(this.getTextureName() + "_bottom"); -+ /** -+ * When this method is called, your block should register all the icons it needs with the given IconRegister. This is -+ * the only chance you get to register icons. -+ */ -+ public void registerIcons(IconRegister par1IconRegister) { -+ this.blockIcon = par1IconRegister.registerIcon(this.getTextureName() + "_side"); -+ this.cactusTopIcon = par1IconRegister.registerIcon(this.getTextureName() + "_top"); -+ this.cactusBottomIcon = par1IconRegister.registerIcon(this.getTextureName() + "_bottom"); - } - } ---- /dev/null -+++ org/spoutcraft/client/entity/EntityData.java -@@ -1,0 +1,84 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.client.entity; -+ -+import java.util.HashMap; -+ -+public class EntityData { -+ private HashMap customTextures = new HashMap(); -+ private byte textureToRender = 0; -+ private double gravityMod = 1D; -+ private double walkingMod = 1D; -+ private double swimmingMod = 1D; -+ private double jumpingMod = 1D; -+ private double airspeedMod = 1D; -+ -+ public byte getTextureToRender() { -+ return textureToRender; -+ } -+ -+ public void setTextureToRender(byte textureToRender) { -+ this.textureToRender = textureToRender; -+ } -+ -+ public HashMap getCustomTextures() { -+ return customTextures; -+ } -+ -+ public double getWalkingMod() { -+ return walkingMod; -+ } -+ -+ public void setWalkingMod(double walkingMod) { -+ this.walkingMod = walkingMod; -+ } -+ -+ public double getGravityMod() { -+ return gravityMod; -+ } -+ -+ public void setGravityMod(double gravityMod) { -+ this.gravityMod = gravityMod; -+ } -+ -+ public double getSwimmingMod() { -+ return swimmingMod; -+ } -+ -+ public void setSwimmingMod(double swimmingMod) { -+ this.swimmingMod = swimmingMod; -+ } -+ -+ public double getJumpingMod() { -+ return jumpingMod; -+ } -+ -+ public void setJumpingMod(double jumpingMod) { -+ this.jumpingMod = jumpingMod; -+ } -+ -+ public double getAirspeedMod() { -+ return airspeedMod; -+ } -+ -+ public void setAirspeedMod(double airspeedMod) { -+ this.airspeedMod = airspeedMod; -+ } -+} ---- net/minecraft/src/AnimationFrame.java -+++ net/minecraft/src/AnimationFrame.java -@@ -4,13 +4,13 @@ - private final int frameIndex; - private final int frameTime; - -- public AnimationFrame(int var1) { -- this(var1, -1); -+ public AnimationFrame(int par1) { -+ this(par1, -1); - } - -- public AnimationFrame(int var1, int var2) { -- this.frameIndex = var1; -- this.frameTime = var2; -+ public AnimationFrame(int par1, int par2) { -+ this.frameIndex = par1; -+ this.frameTime = par2; - } - - public boolean hasNoTime() { ---- net/minecraft/src/BlockAnvil.java -+++ net/minecraft/src/BlockAnvil.java -@@ -3,109 +3,152 @@ - import java.util.List; - - public class BlockAnvil extends BlockSand { -- public static final String[] a = new String[]{"intact", "slightlyDamaged", "veryDamaged"}; -- private static final String[] d = new String[]{"anvil_top_damaged_0", "anvil_top_damaged_1", "anvil_top_damaged_2"}; -+ -+ /** List of types/statues the Anvil can be in. */ -+ public static final String[] statuses = new String[] {"intact", "slightlyDamaged", "veryDamaged"}; -+ private static final String[] anvilIconNames = new String[] {"anvil_top_damaged_0", "anvil_top_damaged_1", "anvil_top_damaged_2"}; - public int field_82521_b; - private Icon[] iconArray; - -- protected BlockAnvil(int var1) { -- super(var1, Material.anvil); -+ protected BlockAnvil(int par1) { -+ super(par1, Material.anvil); - this.setLightOpacity(0); - this.setCreativeTab(CreativeTabs.tabDecorations); - } - -+ /** -+ * If this block doesn't render as an ordinary block it will return False (examples: signs, buttons, stairs, etc) -+ */ - public boolean renderAsNormalBlock() { - return false; - } - -+ /** -+ * Is this block (a) opaque and (b) a full 1m cube? This determines whether or not to render the shared face of two -+ * adjacent blocks and also whether the player can attach torches, redstone wire, etc to this block. -+ */ - public boolean isOpaqueCube() { - return false; - } - -- public Icon getIcon(int var1, int var2) { -- if(this.field_82521_b == 3 && var1 == 1) { -- int var3 = (var2 >> 2) % this.iconArray.length; -+ /** -+ * From the specified side and block metadata retrieves the blocks texture. Args: side, metadata -+ */ -+ public Icon getIcon(int par1, int par2) { -+ if (this.field_82521_b == 3 && par1 == 1) { -+ int var3 = (par2 >> 2) % this.iconArray.length; - return this.iconArray[var3]; - } else { - return this.blockIcon; - } - } - -- public void registerIcons(IconRegister var1) { -- this.blockIcon = var1.registerIcon("anvil_base"); -- this.iconArray = new Icon[d.length]; -+ /** -+ * When this method is called, your block should register all the icons it needs with the given IconRegister. This is -+ * the only chance you get to register icons. -+ */ -+ public void registerIcons(IconRegister par1IconRegister) { -+ this.blockIcon = par1IconRegister.registerIcon("anvil_base"); -+ this.iconArray = new Icon[anvilIconNames.length]; - -- for(int var2 = 0; var2 < this.iconArray.length; ++var2) { -- this.iconArray[var2] = var1.registerIcon(d[var2]); -+ for (int var2 = 0; var2 < this.iconArray.length; ++var2) { -+ this.iconArray[var2] = par1IconRegister.registerIcon(anvilIconNames[var2]); - } -- - } - -- public void onBlockPlacedBy(World var1, int var2, int var3, int var4, EntityLivingBase var5, ItemStack var6) { -- int var7 = MathHelper.floor_double((double)(var5.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3; -- int var8 = var1.getBlockMetadata(var2, var3, var4) >> 2; -+ /** -+ * Called when the block is placed in the world. -+ */ -+ public void onBlockPlacedBy(World par1World, int par2, int par3, int par4, EntityLivingBase par5EntityLivingBase, ItemStack par6ItemStack) { -+ int var7 = MathHelper.floor_double((double)(par5EntityLivingBase.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3; -+ int var8 = par1World.getBlockMetadata(par2, par3, par4) >> 2; - ++var7; - var7 %= 4; -- if(var7 == 0) { -- var1.setBlockMetadata(var2, var3, var4, 2 | var8 << 2, 2); -- } -- -- if(var7 == 1) { -- var1.setBlockMetadata(var2, var3, var4, 3 | var8 << 2, 2); -- } -- -- if(var7 == 2) { -- var1.setBlockMetadata(var2, var3, var4, 0 | var8 << 2, 2); -- } -- -- if(var7 == 3) { -- var1.setBlockMetadata(var2, var3, var4, 1 | var8 << 2, 2); -- } -- -+ -+ if (var7 == 0) { -+ par1World.setBlockMetadataWithNotify(par2, par3, par4, 2 | var8 << 2, 2); -+ } -+ -+ if (var7 == 1) { -+ par1World.setBlockMetadataWithNotify(par2, par3, par4, 3 | var8 << 2, 2); -+ } -+ -+ if (var7 == 2) { -+ par1World.setBlockMetadataWithNotify(par2, par3, par4, 0 | var8 << 2, 2); -+ } -+ -+ if (var7 == 3) { -+ par1World.setBlockMetadataWithNotify(par2, par3, par4, 1 | var8 << 2, 2); -+ } - } - -- public boolean onBlockActivated(World var1, int var2, int var3, int var4, EntityPlayer var5, int var6, float var7, float var8, float var9) { -- if(var1.isRemote) { -+ /** -+ * Called upon block activation (right click on the block.) -+ */ -+ public boolean onBlockActivated(World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer, int par6, float par7, float par8, float par9) { -+ if (par1World.isRemote) { - return true; - } else { -- var5.displayGUIAnvil(var2, var3, var4); -+ par5EntityPlayer.displayGUIAnvil(par2, par3, par4); - return true; - } - } - -+ /** -+ * The type of render function that is called for this block -+ */ - public int getRenderType() { - return 35; - } - -- public int damageDropped(int var1) { -- return var1 >> 2; -+ /** -+ * Determines the damage on the item the block drops. Used in cloth and wood. -+ */ -+ public int damageDropped(int par1) { -+ return par1 >> 2; - } - -- public void setBlockBoundsBasedOnState(IBlockAccess var1, int var2, int var3, int var4) { -- int var5 = var1.getBlockMetadata(var2, var3, var4) & 3; -- if(var5 != 3 && var5 != 1) { -- this.setBlockBounds(2.0F / 16.0F, 0.0F, 0.0F, 14.0F / 16.0F, 1.0F, 1.0F); -+ /** -+ * Updates the blocks bounds based on its current state. Args: world, x, y, z -+ */ -+ public void setBlockBoundsBasedOnState(IBlockAccess par1IBlockAccess, int par2, int par3, int par4) { -+ int var5 = par1IBlockAccess.getBlockMetadata(par2, par3, par4) & 3; -+ -+ if (var5 != 3 && var5 != 1) { -+ this.setBlockBounds(0.125F, 0.0F, 0.0F, 0.875F, 1.0F, 1.0F); - } else { -- this.setBlockBounds(0.0F, 0.0F, 2.0F / 16.0F, 1.0F, 1.0F, 14.0F / 16.0F); -+ this.setBlockBounds(0.0F, 0.0F, 0.125F, 1.0F, 1.0F, 0.875F); - } -- -- } -- -- public void getSubBlocks(int var1, CreativeTabs var2, List var3) { -- var3.add(new ItemStack(var1, 1, 0)); -- var3.add(new ItemStack(var1, 1, 1)); -- var3.add(new ItemStack(var1, 1, 2)); -- } -- -- protected void onStartFalling(EntityFallingSand var1) { -- var1.setIsAnvil(true); -- } -- -- public void onFinishFalling(World var1, int var2, int var3, int var4, int var5) { -- var1.playAuxSFX(1022, var2, var3, var4, 0); -- } -- -- public boolean shouldSideBeRendered(IBlockAccess var1, int var2, int var3, int var4, int var5) { -+ } -+ -+ /** -+ * returns a list of blocks with the same ID, but different meta (eg: wood returns 4 blocks) -+ */ -+ public void getSubBlocks(int par1, CreativeTabs par2CreativeTabs, List par3List) { -+ par3List.add(new ItemStack(par1, 1, 0)); -+ par3List.add(new ItemStack(par1, 1, 1)); -+ par3List.add(new ItemStack(par1, 1, 2)); -+ } -+ -+ /** -+ * Called when the falling block entity for this block is created -+ */ -+ protected void onStartFalling(EntityFallingSand par1EntityFallingSand) { -+ par1EntityFallingSand.setIsAnvil(true); -+ } -+ -+ /** -+ * Called when the falling block entity for this block hits the ground and turns back into a block -+ */ -+ public void onFinishFalling(World par1World, int par2, int par3, int par4, int par5) { -+ par1World.playAuxSFX(1022, par2, par3, par4, 0); -+ } -+ -+ /** -+ * Returns true if the given side of this block type should be rendered, if the adjacent block is at the given -+ * coordinates. Args: blockAccess, x, y, z, side -+ */ -+ public boolean shouldSideBeRendered(IBlockAccess par1IBlockAccess, int par2, int par3, int par4, int par5) { - return true; - } - } ---- net/minecraft/src/BlockCrops.java -+++ net/minecraft/src/BlockCrops.java -@@ -5,8 +5,8 @@ - public class BlockCrops extends BlockFlower { - private Icon[] iconArray; - -- protected BlockCrops(int var1) { -- super(var1); -+ protected BlockCrops(int par1) { -+ super(par1); - this.setTickRandomly(true); - float var2 = 0.5F; - this.setBlockBounds(0.5F - var2, 0.0F, 0.5F - var2, 0.5F + var2, 0.25F, 0.5F + var2); -@@ -16,60 +16,80 @@ - this.disableStats(); - } - -- protected boolean canThisPlantGrowOnThisBlockID(int var1) { -- return var1 == Block.tilledField.blockID; -+ /** -+ * Gets passed in the blockID of the block below and supposed to return true if its allowed to grow on the type of -+ * blockID passed in. Args: blockID -+ */ -+ protected boolean canThisPlantGrowOnThisBlockID(int par1) { -+ return par1 == Block.tilledField.blockID; - } - -- public void updateTick(World var1, int var2, int var3, int var4, Random var5) { -- super.updateTick(var1, var2, var3, var4, var5); -- if(var1.getBlockLightValue(var2, var3 + 1, var4) >= 9) { -- int var6 = var1.getBlockMetadata(var2, var3, var4); -- if(var6 < 7) { -- float var7 = this.getGrowthRate(var1, var2, var3, var4); -- if(var5.nextInt((int)(25.0F / var7) + 1) == 0) { -+ /** -+ * Ticks the block if it's been scheduled -+ */ -+ public void updateTick(World par1World, int par2, int par3, int par4, Random par5Random) { -+ super.updateTick(par1World, par2, par3, par4, par5Random); -+ -+ if (par1World.getBlockLightValue(par2, par3 + 1, par4) >= 9) { -+ int var6 = par1World.getBlockMetadata(par2, par3, par4); -+ -+ if (var6 < 7) { -+ float var7 = this.getGrowthRate(par1World, par2, par3, par4); -+ -+ if (par5Random.nextInt((int)(25.0F / var7) + 1) == 0) { - ++var6; -- var1.setBlockMetadata(var2, var3, var4, var6, 2); -+ par1World.setBlockMetadataWithNotify(par2, par3, par4, var6, 2); - } - } - } -- - } - -- public void fertilize(World var1, int var2, int var3, int var4) { -- int var5 = var1.getBlockMetadata(var2, var3, var4) + MathHelper.getRandomIntegerInRange(var1.s, 2, 5); -- if(var5 > 7) { -+ /** -+ * Apply bonemeal to the crops. -+ */ -+ public void fertilize(World par1World, int par2, int par3, int par4) { -+ int var5 = par1World.getBlockMetadata(par2, par3, par4) + MathHelper.getRandomIntegerInRange(par1World.rand, 2, 5); -+ -+ if (var5 > 7) { - var5 = 7; - } - -- var1.setBlockMetadata(var2, var3, var4, var5, 2); -+ par1World.setBlockMetadataWithNotify(par2, par3, par4, var5, 2); - } - -- private float getGrowthRate(World var1, int var2, int var3, int var4) { -+ /** -+ * Gets the growth rate for the crop. Setup to encourage rows by halving growth rate if there is diagonals, crops on -+ * different sides that aren't opposing, and by adding growth for every crop next to this one (and for crop below this -+ * one). Args: x, y, z -+ */ -+ private float getGrowthRate(World par1World, int par2, int par3, int par4) { - float var5 = 1.0F; -- int var6 = var1.getBlockId(var2, var3, var4 - 1); -- int var7 = var1.getBlockId(var2, var3, var4 + 1); -- int var8 = var1.getBlockId(var2 - 1, var3, var4); -- int var9 = var1.getBlockId(var2 + 1, var3, var4); -- int var10 = var1.getBlockId(var2 - 1, var3, var4 - 1); -- int var11 = var1.getBlockId(var2 + 1, var3, var4 - 1); -- int var12 = var1.getBlockId(var2 + 1, var3, var4 + 1); -- int var13 = var1.getBlockId(var2 - 1, var3, var4 + 1); -+ int var6 = par1World.getBlockId(par2, par3, par4 - 1); -+ int var7 = par1World.getBlockId(par2, par3, par4 + 1); -+ int var8 = par1World.getBlockId(par2 - 1, par3, par4); -+ int var9 = par1World.getBlockId(par2 + 1, par3, par4); -+ int var10 = par1World.getBlockId(par2 - 1, par3, par4 - 1); -+ int var11 = par1World.getBlockId(par2 + 1, par3, par4 - 1); -+ int var12 = par1World.getBlockId(par2 + 1, par3, par4 + 1); -+ int var13 = par1World.getBlockId(par2 - 1, par3, par4 + 1); - boolean var14 = var8 == this.blockID || var9 == this.blockID; - boolean var15 = var6 == this.blockID || var7 == this.blockID; - boolean var16 = var10 == this.blockID || var11 == this.blockID || var12 == this.blockID || var13 == this.blockID; - -- for(int var17 = var2 - 1; var17 <= var2 + 1; ++var17) { -- for(int var18 = var4 - 1; var18 <= var4 + 1; ++var18) { -- int var19 = var1.getBlockId(var17, var3 - 1, var18); -+ for (int var17 = par2 - 1; var17 <= par2 + 1; ++var17) { -+ for (int var18 = par4 - 1; var18 <= par4 + 1; ++var18) { -+ int var19 = par1World.getBlockId(var17, par3 - 1, var18); - float var20 = 0.0F; -- if(var19 == Block.tilledField.blockID) { -+ -+ if (var19 == Block.tilledField.blockID) { - var20 = 1.0F; -- if(var1.getBlockMetadata(var17, var3 - 1, var18) > 0) { -+ -+ if (par1World.getBlockMetadata(var17, par3 - 1, var18) > 0) { - var20 = 3.0F; - } - } - -- if(var17 != var2 || var18 != var4) { -+ if (var17 != par2 || var18 != par4) { - var20 /= 4.0F; - } - -@@ -77,67 +97,94 @@ - } - } - -- if(var16 || var14 && var15) { -+ if (var16 || var14 && var15) { - var5 /= 2.0F; - } - - return var5; - } - -- public Icon getIcon(int var1, int var2) { -- if(var2 < 0 || var2 > 7) { -- var2 = 7; -+ /** -+ * From the specified side and block metadata retrieves the blocks texture. Args: side, metadata -+ */ -+ public Icon getIcon(int par1, int par2) { -+ if (par2 < 0 || par2 > 7) { -+ par2 = 7; - } - -- return this.iconArray[var2]; -+ return this.iconArray[par2]; - } - -+ /** -+ * The type of render function that is called for this block -+ */ - public int getRenderType() { - return 6; - } - -+ /** -+ * Generate a seed ItemStack for this crop. -+ */ - protected int getSeedItem() { - return Item.seeds.itemID; - } - -+ /** -+ * Generate a crop produce ItemStack for this crop. -+ */ - protected int getCropItem() { - return Item.wheat.itemID; - } - -- public void dropBlockAsItemWithChance(World var1, int var2, int var3, int var4, int var5, float var6, int var7) { -- super.dropBlockAsItemWithChance(var1, var2, var3, var4, var5, var6, 0); -- if(!var1.isRemote) { -- if(var5 >= 7) { -- int var8 = 3 + var7; -- -- for(int var9 = 0; var9 < var8; ++var9) { -- if(var1.s.nextInt(15) <= var5) { -- this.dropBlockAsItem_do(var1, var2, var3, var4, new ItemStack(this.getSeedItem(), 1, 0)); -+ /** -+ * Drops the block items with a specified chance of dropping the specified items -+ */ -+ public void dropBlockAsItemWithChance(World par1World, int par2, int par3, int par4, int par5, float par6, int par7) { -+ super.dropBlockAsItemWithChance(par1World, par2, par3, par4, par5, par6, 0); -+ -+ if (!par1World.isRemote) { -+ if (par5 >= 7) { -+ int var8 = 3 + par7; -+ -+ for (int var9 = 0; var9 < var8; ++var9) { -+ if (par1World.rand.nextInt(15) <= par5) { -+ this.dropBlockAsItem_do(par1World, par2, par3, par4, new ItemStack(this.getSeedItem(), 1, 0)); - } - } - } -- - } - } - -- public int idDropped(int var1, Random var2, int var3) { -- return var1 == 7 ? this.getCropItem() : this.getSeedItem(); -+ /** -+ * Returns the ID of the items to drop on destruction. -+ */ -+ public int idDropped(int par1, Random par2Random, int par3) { -+ return par1 == 7 ? this.getCropItem() : this.getSeedItem(); - } - -- public int quantityDropped(Random var1) { -+ /** -+ * Returns the quantity of items to drop on block destruction. -+ */ -+ public int quantityDropped(Random par1Random) { - return 1; - } - -- public int idPicked(World var1, int var2, int var3, int var4) { -+ /** -+ * only called by clickMiddleMouseButton , and passed to inventory.setCurrentItem (along with isCreative) -+ */ -+ public int idPicked(World par1World, int par2, int par3, int par4) { - return this.getSeedItem(); - } - -- public void registerIcons(IconRegister var1) { -+ /** -+ * When this method is called, your block should register all the icons it needs with the given IconRegister. This is -+ * the only chance you get to register icons. -+ */ -+ public void registerIcons(IconRegister par1IconRegister) { - this.iconArray = new Icon[8]; - -- for(int var2 = 0; var2 < this.iconArray.length; ++var2) { -- this.iconArray[var2] = var1.registerIcon(this.getTextureName() + "_stage_" + var2); -+ for (int var2 = 0; var2 < this.iconArray.length; ++var2) { -+ this.iconArray[var2] = par1IconRegister.registerIcon(this.getTextureName() + "_stage_" + var2); - } -- - } - } ---- net/minecraft/src/ActiveRenderInfo.java -+++ net/minecraft/src/ActiveRenderInfo.java -@@ -2,36 +2,76 @@ - - import java.nio.FloatBuffer; - import java.nio.IntBuffer; -+ - import org.lwjgl.opengl.GL11; - import org.lwjgl.util.glu.GLU; - - public class ActiveRenderInfo { -+ -+ /** The calculated view object X coordinate */ - public static float objectX; -+ -+ /** The calculated view object Y coordinate */ - public static float objectY; -+ -+ /** The calculated view object Z coordinate */ - public static float objectZ; -- private static IntBuffer i = GLAllocation.createDirectIntBuffer(16); -- private static FloatBuffer j = GLAllocation.createDirectFloatBuffer(16); -- private static FloatBuffer k = GLAllocation.createDirectFloatBuffer(16); -- private static FloatBuffer l = GLAllocation.createDirectFloatBuffer(3); -+ -+ /** The current GL viewport */ -+ private static IntBuffer viewport = GLAllocation.createDirectIntBuffer(16); -+ -+ /** The current GL modelview matrix */ -+ private static FloatBuffer modelview = GLAllocation.createDirectFloatBuffer(16); -+ -+ /** The current GL projection matrix */ -+ private static FloatBuffer projection = GLAllocation.createDirectFloatBuffer(16); -+ -+ /** The computed view object coordinates */ -+ private static FloatBuffer objectCoords = GLAllocation.createDirectFloatBuffer(3); -+ -+ /** The X component of the entity's yaw rotation */ - public static float rotationX; -+ -+ /** The combined X and Z components of the entity's pitch rotation */ - public static float rotationXZ; -+ -+ /** The Z component of the entity's yaw rotation */ - public static float rotationZ; -+ -+ /** -+ * The Y component (scaled along the Z axis) of the entity's pitch rotation -+ */ - public static float rotationYZ; -+ -+ /** -+ * The Y component (scaled along the X axis) of the entity's pitch rotation -+ */ - public static float rotationXY; -+ // Spout Start -+ public static FloatBuffer modelMatrix; -+ public static FloatBuffer projectionMatrix; -+ // Spout End - -- public static void updateRenderInfo(EntityPlayer var0, boolean var1) { -- GL11.glGetFloat(GL11.GL_MODELVIEW_MATRIX, j); -- GL11.glGetFloat(GL11.GL_PROJECTION_MATRIX, k); -- GL11.glGetInteger(GL11.GL_VIEWPORT, i); -- float var2 = (float)((i.get(0) + i.get(2)) / 2); -- float var3 = (float)((i.get(1) + i.get(3)) / 2); -- GLU.gluUnProject(var2, var3, 0.0F, j, k, i, l); -- objectX = l.get(0); -- objectY = l.get(1); -- objectZ = l.get(2); -- int var4 = var1 ? 1 : 0; -- float var5 = var0.rotationPitch; -- float var6 = var0.rotationYaw; -+ /** -+ * Updates the current render info and camera location based on entity look angles and 1st/3rd person view mode -+ */ -+ public static void updateRenderInfo(EntityPlayer par0EntityPlayer, boolean par1) { -+ GL11.glGetFloat(GL11.GL_MODELVIEW_MATRIX, modelview); -+ GL11.glGetFloat(GL11.GL_PROJECTION_MATRIX, projection); -+ // Spout Start -+ modelMatrix = modelview.duplicate(); -+ projectionMatrix = projection.duplicate(); -+ // Spout End -+ GL11.glGetInteger(GL11.GL_VIEWPORT, viewport); -+ float var2 = (float)((viewport.get(0) + viewport.get(2)) / 2); -+ float var3 = (float)((viewport.get(1) + viewport.get(3)) / 2); -+ GLU.gluUnProject(var2, var3, 0.0F, modelview, projection, viewport, objectCoords); -+ objectX = objectCoords.get(0); -+ objectY = objectCoords.get(1); -+ objectZ = objectCoords.get(2); -+ int var4 = par1 ? 1 : 0; -+ float var5 = par0EntityPlayer.rotationPitch; -+ float var6 = par0EntityPlayer.rotationYaw; - rotationX = MathHelper.cos(var6 * (float)Math.PI / 180.0F) * (float)(1 - var4 * 2); - rotationZ = MathHelper.sin(var6 * (float)Math.PI / 180.0F) * (float)(1 - var4 * 2); - rotationYZ = -rotationZ * MathHelper.sin(var5 * (float)Math.PI / 180.0F) * (float)(1 - var4 * 2); -@@ -39,25 +79,34 @@ - rotationXZ = MathHelper.cos(var5 * (float)Math.PI / 180.0F); - } - -- public static Vec3 projectViewFromEntity(EntityLivingBase var0, double var1) { -- double var3 = var0.prevPosX + (var0.posX - var0.prevPosX) * var1; -- double var5 = var0.prevPosY + (var0.posY - var0.prevPosY) * var1 + (double)var0.getEyeHeight(); -- double var7 = var0.prevPosZ + (var0.posZ - var0.prevPosZ) * var1; -+ /** -+ * Returns a vector representing the projection along the given entity's view for the given distance -+ */ -+ public static Vec3 projectViewFromEntity(EntityLivingBase par0EntityLivingBase, double par1) { -+ double var3 = par0EntityLivingBase.prevPosX + (par0EntityLivingBase.posX - par0EntityLivingBase.prevPosX) * par1; -+ double var5 = par0EntityLivingBase.prevPosY + (par0EntityLivingBase.posY - par0EntityLivingBase.prevPosY) * par1 + (double)par0EntityLivingBase.getEyeHeight(); -+ double var7 = par0EntityLivingBase.prevPosZ + (par0EntityLivingBase.posZ - par0EntityLivingBase.prevPosZ) * par1; - double var9 = var3 + (double)(objectX * 1.0F); - double var11 = var5 + (double)(objectY * 1.0F); - double var13 = var7 + (double)(objectZ * 1.0F); -- return var0.worldObj.getWorldVec3Pool().getVecFromPool(var9, var11, var13); -+ return par0EntityLivingBase.worldObj.getWorldVec3Pool().getVecFromPool(var9, var11, var13); - } - -- public static int getBlockIdAtEntityViewpoint(World var0, EntityLivingBase var1, float var2) { -- Vec3 var3 = projectViewFromEntity(var1, (double)var2); -+ /** -+ * Returns the block ID at the current camera location (either air or fluid), taking into account the height of fluid -+ * blocks -+ */ -+ public static int getBlockIdAtEntityViewpoint(World par0World, EntityLivingBase par1EntityLivingBase, float par2) { -+ Vec3 var3 = projectViewFromEntity(par1EntityLivingBase, (double)par2); - ChunkPosition var4 = new ChunkPosition(var3); -- int var5 = var0.getBlockId(var4.x, var4.y, var4.z); -- if(var5 != 0 && Block.blocksList[var5].blockMaterial.isLiquid()) { -- float var6 = BlockFluid.getFluidHeightPercent(var0.getBlockMetadata(var4.x, var4.y, var4.z)) - 1.0F / 9.0F; -+ int var5 = par0World.getBlockId(var4.x, var4.y, var4.z); -+ -+ if (var5 != 0 && Block.blocksList[var5].blockMaterial.isLiquid()) { -+ float var6 = BlockFluid.getFluidHeightPercent(par0World.getBlockMetadata(var4.x, var4.y, var4.z)) - 0.11111111F; - float var7 = (float)(var4.y + 1) - var6; -- if(var3.yCoord >= (double)var7) { -- var5 = var0.getBlockId(var4.x, var4.y + 1, var4.z); -+ -+ if (var3.yCoord >= (double)var7) { -+ var5 = par0World.getBlockId(var4.x, var4.y + 1, var4.z); - } - } - ---- net/minecraft/src/CallableMemoryInfo.java -+++ net/minecraft/src/CallableMemoryInfo.java -@@ -3,12 +3,18 @@ - import java.util.concurrent.Callable; - - class CallableMemoryInfo implements Callable { -+ -+ /** Reference to the CrashReport object. */ - final CrashReport theCrashReport; - -- CallableMemoryInfo(CrashReport var1) { -- this.theCrashReport = var1; -+ CallableMemoryInfo(CrashReport par1CrashReport) { -+ this.theCrashReport = par1CrashReport; - } - -+ /** -+ * Returns the memory information as a String. Includes the Free Memory in bytes and MB, Total Memory in bytes and MB, -+ * and Max Memory in Bytes and MB. -+ */ - public String getMemoryInfoAsString() { - Runtime var1 = Runtime.getRuntime(); - long var2 = var1.maxMemory(); ---- net/minecraft/src/GuiBeaconButton.java -+++ net/minecraft/src/GuiBeaconButton.java -@@ -3,36 +3,43 @@ - import org.lwjgl.opengl.GL11; - - class GuiBeaconButton extends GuiButton { -+ -+ /** Texture for this button. */ - private final ResourceLocation buttonTexture; - private final int field_82257_l; - private final int field_82258_m; - private boolean field_82256_n; - -- protected GuiBeaconButton(int var1, int var2, int var3, ResourceLocation var4, int var5, int var6) { -- super(var1, var2, var3, 22, 22, ""); -- this.buttonTexture = var4; -- this.field_82257_l = var5; -- this.field_82258_m = var6; -+ protected GuiBeaconButton(int par1, int par2, int par3, ResourceLocation par4ResourceLocation, int par5, int par6) { -+ super(par1, par2, par3, 22, 22, ""); -+ this.buttonTexture = par4ResourceLocation; -+ this.field_82257_l = par5; -+ this.field_82258_m = par6; - } - -- public void drawButton(Minecraft var1, int var2, int var3) { -- if(this.drawButton) { -- var1.getTextureManager().bindTexture(GuiBeacon.getBeaconGuiTextures()); -+ /** -+ * Draws this button to the screen. -+ */ -+ public void drawButton(Minecraft par1Minecraft, int par2, int par3) { -+ if (this.drawButton) { -+ par1Minecraft.getTextureManager().bindTexture(GuiBeacon.getBeaconGuiTextures()); - GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); -- this.field_82253_i = var2 >= this.xPosition && var3 >= this.yPosition && var2 < this.xPosition + this.width && var3 < this.yPosition + this.height; -+ this.field_82253_i = par2 >= this.xPosition && par3 >= this.yPosition && par2 < this.xPosition + this.width && par3 < this.yPosition + this.height; - short var4 = 219; - int var5 = 0; -- if(!this.enabled) { -+ -+ if (!this.enabled) { - var5 += this.width * 2; -- } else if(this.field_82256_n) { -+ } else if (this.field_82256_n) { - var5 += this.width * 1; -- } else if(this.field_82253_i) { -+ } else if (this.field_82253_i) { - var5 += this.width * 3; - } - - this.drawTexturedModalRect(this.xPosition, this.yPosition, var5, var4, this.width, this.height); -- if(!GuiBeacon.getBeaconGuiTextures().equals(this.buttonTexture)) { -- var1.getTextureManager().bindTexture(this.buttonTexture); -+ -+ if (!GuiBeacon.getBeaconGuiTextures().equals(this.buttonTexture)) { -+ par1Minecraft.getTextureManager().bindTexture(this.buttonTexture); - } - - this.drawTexturedModalRect(this.xPosition + 2, this.yPosition + 2, this.field_82257_l, this.field_82258_m, 18, 18); -@@ -43,7 +50,7 @@ - return this.field_82256_n; - } - -- public void func_82254_b(boolean var1) { -- this.field_82256_n = var1; -+ public void func_82254_b(boolean par1) { -+ this.field_82256_n = par1; - } - } ---- /dev/null -+++ org/spoutcraft/client/io/FileUtil.java -@@ -1,0 +1,287 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.client.io; -+ -+import java.io.*; -+import java.net.URISyntaxException; -+import java.net.URL; -+import java.nio.file.*; -+import java.util.HashMap; -+ -+import net.minecraft.src.ILogAgent; -+import org.apache.commons.io.FileUtils; -+import org.apache.commons.io.FilenameUtils; -+ -+import net.minecraft.src.Minecraft; -+ -+import org.apache.commons.lang3.exception.ExceptionUtils; -+import org.spoutcraft.client.SpoutClient; -+ -+public class FileUtil { -+ private static final String[] validExtensions = {"txt", "yml", "xml", "png", "jpg", "ogg", "midi", "wav", "zip"}; -+ private static final HashMap fileNameCache = new HashMap(); -+ public static File getSpoutcraftBaseDir() { -+ return Minecraft.getMinecraft().mcDataDir; -+ } -+ -+ public static File getAssetsDir() { -+ File directory = new File(Minecraft.getMinecraft().mcDataDir, "assets"); -+ if (!directory.exists()) { -+ try { -+ copyFromJar("/org/spoutcraft/resources/assets", directory.toPath().getParent()); -+ } catch(Exception e) { // Catching all exceptions because I don't want assets to prevent the game from launching -+ ILogAgent logAgent = Minecraft.getMinecraft().getLogAgent(); -+ logAgent.logWarning("Unable to copy Spoutcraft assets: " + ExceptionUtils.getStackTrace(e)); -+ } -+ } -+ return directory; -+ } -+ -+ public static File getCacheDir() { -+ File directory = new File(Minecraft.getMinecraft().mcDataDir, "cache"); -+ if (!directory.exists()) { -+ directory.mkdir(); -+ } -+ return directory; -+ } -+ -+ public static File getConfigDir() { -+ File directory = new File(Minecraft.getMinecraft().mcDataDir, "config"); -+ if (!directory.exists()) { -+ directory.mkdir(); -+ } -+ return directory; -+ } -+ -+ public static File getTempDir() { -+ File directory = new File(getCacheDir(), "temp"); -+ if (!directory.exists()) { -+ directory.mkdir(); -+ } -+ return directory; -+ } -+ -+ public static File getStatsDir() { -+ File directory = new File(Minecraft.getMinecraft().mcDataDir, "stats"); -+ if (!directory.exists()) { -+ directory.mkdir(); -+ } -+ return directory; -+ } -+ -+ public static void migrateOldFiles() { -+ File directory = new File(Minecraft.getMinecraft().mcDataDir, "spout"); -+ if (directory.exists()) { -+ try { -+ FileUtils.copyDirectory(directory, getCacheDir(), true); -+ FileUtils.deleteDirectory(getTempDir()); -+ } -+ catch (Exception e) {} -+ } -+ } -+ -+ public static void deleteTempDirectory() { -+ try { -+ FileUtils.deleteDirectory(getTempDir()); -+ } -+ catch (Exception e) {} -+ } -+ -+ public static File findFile(String plugin, String fileName) { -+ File result = null; -+ result = matchFile(new File(SpoutClient.getInstance().getAddonFolder(), plugin), fileName); -+ if (result != null) { -+ return result; -+ } -+ -+ result = matchFile(new File(getCacheDir(), plugin), fileName); -+ if (result != null) { -+ return result; -+ } -+ -+ return null; -+ } -+ -+ private static File matchFile(File directory, String fileName) { -+ if (directory.isDirectory() && directory.exists()) { -+ File file = new File(directory + "/" + fileName); -+ boolean exists = file.exists(); -+ if (exists) { -+ return file; -+ } else { -+ return null; -+ } -+ } -+ return null; -+ } -+ -+ public static File getTexturePackDir() { -+ File directory = new File(Minecraft.getMinecraft().mcDataDir, "texturepacks"); -+ if (!directory.exists()) { -+ directory.mkdir(); -+ } -+ return directory; -+ } -+ -+ public static String getFileName(String url) { -+ if (fileNameCache.containsKey(url)) { -+ return fileNameCache.get(url); -+ } -+ int end = url.lastIndexOf("?"); -+ int lastDot = url.lastIndexOf('.'); -+ int slash = url.lastIndexOf('/'); -+ int forwardSlash = url.lastIndexOf("\\"); -+ slash = slash > forwardSlash ? slash : forwardSlash; -+ end = end == -1 || lastDot > end ? url.length() : end; -+ String result = url.substring(slash + 1, end).replaceAll("%20", " "); -+ if (url.contains("?")) { -+ // Use hashcode instead -+ String ext = FilenameUtils.getExtension(result); -+ result = url.hashCode() + (!ext.isEmpty()?"." + ext:""); -+ } -+ fileNameCache.put(url, result); -+ return result; -+ } -+ -+ public static boolean isAudioFile(String file) { -+ String extension = FilenameUtils.getExtension(file); -+ if (extension != null) { -+ return extension.equalsIgnoreCase("ogg") || extension.equalsIgnoreCase("wav") || extension.equalsIgnoreCase("mp3") || extension.matches(".*[mM][iI][dD][iI]?$"); -+ } -+ return false; -+ } -+ -+ public static boolean isImageFile(String file) { -+ String extension = FilenameUtils.getExtension(file); -+ if (extension != null) { -+ return extension.equalsIgnoreCase("png") || extension.equalsIgnoreCase("jpg"); -+ } -+ return false; -+ } -+ -+ public static boolean isZippedFile(String file) { -+ String extension = FilenameUtils.getExtension(file); -+ if (extension != null) { -+ return extension.equalsIgnoreCase("zip"); -+ } -+ return false; -+ } -+ -+ public static long getCRC(File file, byte[] buffer) { -+ FileInputStream in = null; -+ -+ try { -+ in = new FileInputStream(file); -+ return getCRC(in, buffer); -+ } catch (FileNotFoundException e) { -+ return 0; -+ } finally { -+ if (in != null) { -+ try { -+ in.close(); -+ } catch (IOException e) { -+ } -+ } -+ } -+ } -+ -+ public static long getCRC(URL url, byte[] buffer) { -+ InputStream in = null; -+ -+ try { -+ in = url.openStream(); -+ return getCRC(in, buffer); -+ } catch (IOException e) { -+ return 0; -+ } finally { -+ if (in != null) { -+ try { -+ in.close(); -+ } catch (IOException e) { -+ } -+ } -+ } -+ -+ } -+ -+ public static long getCRC(InputStream in, byte[] buffer) { -+ long hash = 1; -+ -+ int read = 0; -+ int i; -+ while (read >= 0) { -+ try { -+ read = in.read(buffer); -+ for (i=0; i < read; i++) { -+ hash += (hash << 5) + (long)buffer[i]; -+ } -+ } catch (IOException ioe) { -+ return 0; -+ } -+ } -+ -+ return hash; -+ } -+ -+ public static boolean canCache(File file) { -+ String filename = FileUtil.getFileName(file.getPath()); -+ return FilenameUtils.isExtension(filename, validExtensions); -+ } -+ -+ public static boolean canCache(String fileUrl) { -+ String filename = FileUtil.getFileName(fileUrl); -+ return FilenameUtils.isExtension(filename, validExtensions); -+ } -+ -+ public static boolean deleteDirectory(File path) { -+ if (path.exists()) { -+ File[] files = path.listFiles(); -+ for (int i = 0; i < files.length; i++) { -+ if (files[i].isDirectory()) { -+ deleteDirectory(files[i]); -+ } else { -+ files[i].delete(); -+ } -+ } -+ } -+ return path.delete(); -+ } -+ -+ public static void copyFromJar(String source, final Path target) throws URISyntaxException, IOException { -+ URL resourceUrl = System.class.getResource(source); -+ if(resourceUrl == null) { -+ throw new IllegalArgumentException("Source doesn't exist!"); -+ } -+ File sourceFile = new File(resourceUrl.toURI()); -+ copyFromJar(sourceFile, target); -+ -+ } -+ -+ private static void copyFromJar(File source, final Path target) throws IOException { -+ target.toFile().mkdirs(); -+ if(source.isDirectory()) { -+ for (File child : source.listFiles()) { -+ copyFromJar(child, target.resolve(source.getName())); -+ } -+ return; -+ } -+ Files.copy(source.toPath(), target.resolve(source.getName())); -+ } -+} ---- net/minecraft/src/MerchantRecipeList.java -+++ net/minecraft/src/MerchantRecipeList.java -@@ -6,21 +6,24 @@ - import java.util.ArrayList; - - public class MerchantRecipeList extends ArrayList { -- public MerchantRecipeList() { -- } -- -- public MerchantRecipeList(NBTTagCompound var1) { -- this.readRecipiesFromTags(var1); -- } -- -- public MerchantRecipe canRecipeBeUsed(ItemStack var1, ItemStack var2, int var3) { -- if(var3 > 0 && var3 < this.size()) { -- MerchantRecipe var6 = (MerchantRecipe)this.get(var3); -- return var1.itemID != var6.getItemToBuy().itemID || (var2 != null || var6.hasSecondItemToBuy()) && (!var6.hasSecondItemToBuy() || var2 == null || var6.getSecondItemToBuy().itemID != var2.itemID) || var1.stackSize < var6.getItemToBuy().stackSize || var6.hasSecondItemToBuy() && var2.stackSize < var6.getSecondItemToBuy().stackSize ? null : var6; -+ public MerchantRecipeList() {} -+ -+ public MerchantRecipeList(NBTTagCompound par1NBTTagCompound) { -+ this.readRecipiesFromTags(par1NBTTagCompound); -+ } -+ -+ /** -+ * can par1,par2 be used to in crafting recipe par3 -+ */ -+ public MerchantRecipe canRecipeBeUsed(ItemStack par1ItemStack, ItemStack par2ItemStack, int par3) { -+ if (par3 > 0 && par3 < this.size()) { -+ MerchantRecipe var6 = (MerchantRecipe)this.get(par3); -+ return par1ItemStack.itemID == var6.getItemToBuy().itemID && (par2ItemStack == null && !var6.hasSecondItemToBuy() || var6.hasSecondItemToBuy() && par2ItemStack != null && var6.getSecondItemToBuy().itemID == par2ItemStack.itemID) && par1ItemStack.stackSize >= var6.getItemToBuy().stackSize && (!var6.hasSecondItemToBuy() || par2ItemStack.stackSize >= var6.getSecondItemToBuy().stackSize) ? var6 : null; - } else { -- for(int var4 = 0; var4 < this.size(); ++var4) { -+ for (int var4 = 0; var4 < this.size(); ++var4) { - MerchantRecipe var5 = (MerchantRecipe)this.get(var4); -- if(var1.itemID == var5.getItemToBuy().itemID && var1.stackSize >= var5.getItemToBuy().stackSize && (!var5.hasSecondItemToBuy() && var2 == null || var5.hasSecondItemToBuy() && var2 != null && var5.getSecondItemToBuy().itemID == var2.itemID && var2.stackSize >= var5.getSecondItemToBuy().stackSize)) { -+ -+ if (par1ItemStack.itemID == var5.getItemToBuy().itemID && par1ItemStack.stackSize >= var5.getItemToBuy().stackSize && (!var5.hasSecondItemToBuy() && par2ItemStack == null || var5.hasSecondItemToBuy() && par2ItemStack != null && var5.getSecondItemToBuy().itemID == par2ItemStack.itemID && par2ItemStack.stackSize >= var5.getSecondItemToBuy().stackSize)) { - return var5; - } - } -@@ -29,54 +32,60 @@ - } - } - -- public void addToListWithCheck(MerchantRecipe var1) { -- for(int var2 = 0; var2 < this.size(); ++var2) { -+ /** -+ * checks if there is a recipie for the same ingredients already on the list, and replaces it. otherwise, adds it -+ */ -+ public void addToListWithCheck(MerchantRecipe par1MerchantRecipe) { -+ for (int var2 = 0; var2 < this.size(); ++var2) { - MerchantRecipe var3 = (MerchantRecipe)this.get(var2); -- if(var1.hasSameIDsAs(var3)) { -- if(var1.hasSameItemsAs(var3)) { -- this.set(var2, var1); -+ -+ if (par1MerchantRecipe.hasSameIDsAs(var3)) { -+ if (par1MerchantRecipe.hasSameItemsAs(var3)) { -+ this.set(var2, par1MerchantRecipe); - } - - return; - } - } - -- this.add(var1); -+ this.add(par1MerchantRecipe); - } - -- public void writeRecipiesToStream(DataOutputStream var1) throws IOException { -- var1.writeByte((byte)(this.size() & 255)); -+ public void writeRecipiesToStream(DataOutputStream par1DataOutputStream) throws IOException { -+ par1DataOutputStream.writeByte((byte)(this.size() & 255)); - -- for(int var2 = 0; var2 < this.size(); ++var2) { -+ for (int var2 = 0; var2 < this.size(); ++var2) { - MerchantRecipe var3 = (MerchantRecipe)this.get(var2); -- Packet.writeItemStack(var3.getItemToBuy(), var1); -- Packet.writeItemStack(var3.getItemToSell(), var1); -+ Packet.writeItemStack(var3.getItemToBuy(), par1DataOutputStream); -+ Packet.writeItemStack(var3.getItemToSell(), par1DataOutputStream); - ItemStack var4 = var3.getSecondItemToBuy(); -- var1.writeBoolean(var4 != null); -- if(var4 != null) { -- Packet.writeItemStack(var4, var1); -+ par1DataOutputStream.writeBoolean(var4 != null); -+ -+ if (var4 != null) { -+ Packet.writeItemStack(var4, par1DataOutputStream); - } - -- var1.writeBoolean(var3.func_82784_g()); -+ par1DataOutputStream.writeBoolean(var3.func_82784_g()); - } -- - } - -- public static MerchantRecipeList readRecipiesFromStream(DataInputStream var0) throws IOException { -+ public static MerchantRecipeList readRecipiesFromStream(DataInputStream par0DataInputStream) throws IOException { - MerchantRecipeList var1 = new MerchantRecipeList(); -- int var2 = var0.readByte() & 255; -+ int var2 = par0DataInputStream.readByte() & 255; - -- for(int var3 = 0; var3 < var2; ++var3) { -- ItemStack var4 = Packet.readItemStack(var0); -- ItemStack var5 = Packet.readItemStack(var0); -+ for (int var3 = 0; var3 < var2; ++var3) { -+ ItemStack var4 = Packet.readItemStack(par0DataInputStream); -+ ItemStack var5 = Packet.readItemStack(par0DataInputStream); - ItemStack var6 = null; -- if(var0.readBoolean()) { -- var6 = Packet.readItemStack(var0); -+ -+ if (par0DataInputStream.readBoolean()) { -+ var6 = Packet.readItemStack(par0DataInputStream); - } - -- boolean var7 = var0.readBoolean(); -+ boolean var7 = par0DataInputStream.readBoolean(); - MerchantRecipe var8 = new MerchantRecipe(var4, var6, var5); -- if(var7) { -+ -+ if (var7) { - var8.func_82785_h(); - } - -@@ -86,21 +95,20 @@ - return var1; - } - -- public void readRecipiesFromTags(NBTTagCompound var1) { -- NBTTagList var2 = var1.getTagList("Recipes"); -+ public void readRecipiesFromTags(NBTTagCompound par1NBTTagCompound) { -+ NBTTagList var2 = par1NBTTagCompound.getTagList("Recipes"); - -- for(int var3 = 0; var3 < var2.tagCount(); ++var3) { -+ for (int var3 = 0; var3 < var2.tagCount(); ++var3) { - NBTTagCompound var4 = (NBTTagCompound)var2.tagAt(var3); - this.add(new MerchantRecipe(var4)); - } -- - } - - public NBTTagCompound getRecipiesAsTags() { - NBTTagCompound var1 = new NBTTagCompound(); - NBTTagList var2 = new NBTTagList("Recipes"); - -- for(int var3 = 0; var3 < this.size(); ++var3) { -+ for (int var3 = 0; var3 < this.size(); ++var3) { - MerchantRecipe var4 = (MerchantRecipe)this.get(var3); - var2.appendTag(var4.writeToTags()); - } ---- net/minecraft/src/ModelBase.java -+++ net/minecraft/src/ModelBase.java -@@ -9,30 +9,45 @@ - public abstract class ModelBase { - public float onGround; - public boolean isRiding; -- public List r = new ArrayList(); -+ -+ /** -+ * This is a list of all the boxes (ModelRenderer.class) in the current model. -+ */ -+ public List boxList = new ArrayList(); - public boolean isChild = true; -- private Map a = new HashMap(); -+ -+ /** A mapping for all texture offsets */ -+ private Map modelTextureMap = new HashMap(); - public int textureWidth = 64; - public int textureHeight = 32; - -- public void render(Entity var1, float var2, float var3, float var4, float var5, float var6, float var7) { -- } -- -- public void setRotationAngles(float var1, float var2, float var3, float var4, float var5, float var6, Entity var7) { -- } -- -- public void setLivingAnimations(EntityLivingBase var1, float var2, float var3, float var4) { -- } -- -- public ModelRenderer getRandomModelBox(Random var1) { -- return (ModelRenderer)this.r.get(var1.nextInt(this.r.size())); -- } -- -- protected void setTextureOffset(String var1, int var2, int var3) { -- this.a.put(var1, new TextureOffset(var2, var3)); -- } -- -- public TextureOffset getTextureOffset(String var1) { -- return (TextureOffset)this.a.get(var1); -+ /** -+ * Sets the models various rotation angles then renders the model. -+ */ -+ public void render(Entity par1Entity, float par2, float par3, float par4, float par5, float par6, float par7) {} -+ -+ /** -+ * Sets the model's various rotation angles. For bipeds, par1 and par2 are used for animating the movement of arms and -+ * legs, where par1 represents the time(so that arms and legs swing back and forth) and par2 represents how "far" arms -+ * and legs can swing at most. -+ */ -+ public void setRotationAngles(float par1, float par2, float par3, float par4, float par5, float par6, Entity par7Entity) {} -+ -+ /** -+ * Used for easily adding entity-dependent animations. The second and third float params here are the same second and -+ * third as in the setRotationAngles method. -+ */ -+ public void setLivingAnimations(EntityLivingBase par1EntityLivingBase, float par2, float par3, float par4) {} -+ -+ public ModelRenderer getRandomModelBox(Random par1Random) { -+ return (ModelRenderer)this.boxList.get(par1Random.nextInt(this.boxList.size())); -+ } -+ -+ protected void setTextureOffset(String par1Str, int par2, int par3) { -+ this.modelTextureMap.put(par1Str, new TextureOffset(par2, par3)); -+ } -+ -+ public TextureOffset getTextureOffset(String par1Str) { -+ return (TextureOffset)this.modelTextureMap.get(par1Str); - } - } ---- /dev/null -+++ org/spoutcraft/api/entity/EntitySkinType.java -@@ -1,0 +1,50 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.api.entity; -+ -+public enum EntitySkinType { -+ DEFAULT(0), -+ SPIDER_EYES(1), -+ SHEEP_FUR(2), -+ WOLF_ANGRY(3), -+ WOLF_TAMED(4), -+ PIG_SADDLE(5), -+ GHAST_MOUTH(6), -+ ENDERMAN_EYES(7), -+ ; -+ -+ private final byte id; -+ private EntitySkinType(int id) { -+ this.id = (byte)id; -+ } -+ -+ public byte getId() { -+ return id; -+ } -+ -+ public static EntitySkinType getType(byte id) { -+ for (EntitySkinType type : values()) { -+ if (type.id == id) { -+ return type; -+ } -+ } -+ return null; -+ } -+} ---- net/minecraft/src/ColorizerGrass.java -+++ net/minecraft/src/ColorizerGrass.java -@@ -1,16 +1,23 @@ - package net.minecraft.src; - - public class ColorizerGrass { -- private static int[] grassBuffer = new int[65536]; -- -- public static void setGrassBiomeColorizer(int[] var0) { -- grassBuffer = var0; -+ -+ /** Color buffer for grass */ -+ // MCPatcher Start - private -> public -+ public static int[] grassBuffer = new int[65536]; -+ // MCPatcher End -+ -+ public static void setGrassBiomeColorizer(int[] par0ArrayOfInteger) { -+ grassBuffer = par0ArrayOfInteger; - } - -- public static int getGrassColor(double var0, double var2) { -- var2 *= var0; -- int var4 = (int)((1.0D - var0) * 255.0D); -- int var5 = (int)((1.0D - var2) * 255.0D); -+ /** -+ * Gets grass color from temperature and humidity. Args: temperature, humidity -+ */ -+ public static int getGrassColor(double par0, double par2) { -+ par2 *= par0; -+ int var4 = (int)((1.0D - par0) * 255.0D); -+ int var5 = (int)((1.0D - par2) * 255.0D); - return grassBuffer[var5 << 8 | var4]; - } - } ---- net/minecraft/src/BlockGlass.java -+++ net/minecraft/src/BlockGlass.java -@@ -3,27 +3,43 @@ - import java.util.Random; - - public class BlockGlass extends BlockBreakable { -- public BlockGlass(int var1, Material var2, boolean var3) { -- super(var1, "glass", var2, var3); -+ public BlockGlass(int par1, Material par2Material, boolean par3) { -+ super(par1, "glass", par2Material, par3); - this.setCreativeTab(CreativeTabs.tabBlock); - } - -- public int quantityDropped(Random var1) { -+ /** -+ * Returns the quantity of items to drop on block destruction. -+ */ -+ public int quantityDropped(Random par1Random) { - return 0; - } - -+ /** -+ * Returns which pass should this block be rendered on. 0 for solids and 1 for alpha -+ */ - public int getRenderBlockPass() { - return 0; - } - -+ /** -+ * Is this block (a) opaque and (b) a full 1m cube? This determines whether or not to render the shared face of two -+ * adjacent blocks and also whether the player can attach torches, redstone wire, etc to this block. -+ */ - public boolean isOpaqueCube() { - return false; - } - -+ /** -+ * If this block doesn't render as an ordinary block it will return False (examples: signs, buttons, stairs, etc) -+ */ - public boolean renderAsNormalBlock() { - return false; - } - -+ /** -+ * Return true if a player with Silk Touch can harvest this block directly, and not its normal drops. -+ */ - protected boolean canSilkHarvest() { - return true; - } ---- net/minecraft/src/EnumDoorHelper.java -+++ net/minecraft/src/EnumDoorHelper.java -@@ -7,22 +7,25 @@ - try { - doorEnum[EnumDoor.OPENING.ordinal()] = 1; - } catch (NoSuchFieldError var4) { -+ ; - } - - try { - doorEnum[EnumDoor.WOOD_DOOR.ordinal()] = 2; - } catch (NoSuchFieldError var3) { -+ ; - } - - try { - doorEnum[EnumDoor.GRATES.ordinal()] = 3; - } catch (NoSuchFieldError var2) { -+ ; - } - - try { - doorEnum[EnumDoor.IRON_DOOR.ordinal()] = 4; - } catch (NoSuchFieldError var1) { -+ ; - } -- - } - } ---- net/minecraft/src/RenderList.java -+++ net/minecraft/src/RenderList.java -@@ -10,47 +10,46 @@ - private double field_78425_d; - private double field_78426_e; - private double field_78423_f; -- private IntBuffer g = GLAllocation.createDirectIntBuffer(65536); -+ private IntBuffer field_78424_g = GLAllocation.createDirectIntBuffer(65536); - private boolean field_78430_h; - private boolean field_78431_i; - -- public void func_78422_a(int var1, int var2, int var3, double var4, double var6, double var8) { -+ public void func_78422_a(int par1, int par2, int par3, double par4, double par6, double par8) { - this.field_78430_h = true; -- this.g.clear(); -- this.field_78429_a = var1; -- this.field_78427_b = var2; -- this.field_78428_c = var3; -- this.field_78425_d = var4; -- this.field_78426_e = var6; -- this.field_78423_f = var8; -- } -- -- public boolean func_78418_a(int var1, int var2, int var3) { -- return !this.field_78430_h ? false : var1 == this.field_78429_a && var2 == this.field_78427_b && var3 == this.field_78428_c; -- } -- -- public void func_78420_a(int var1) { -- this.g.put(var1); -- if(this.g.remaining() == 0) { -+ this.field_78424_g.clear(); -+ this.field_78429_a = par1; -+ this.field_78427_b = par2; -+ this.field_78428_c = par3; -+ this.field_78425_d = par4; -+ this.field_78426_e = par6; -+ this.field_78423_f = par8; -+ } -+ -+ public boolean func_78418_a(int par1, int par2, int par3) { -+ return !this.field_78430_h ? false : par1 == this.field_78429_a && par2 == this.field_78427_b && par3 == this.field_78428_c; -+ } -+ -+ public void func_78420_a(int par1) { -+ this.field_78424_g.put(par1); -+ -+ if (this.field_78424_g.remaining() == 0) { - this.func_78419_a(); - } -- - } - - public void func_78419_a() { -- if(this.field_78430_h) { -- if(!this.field_78431_i) { -- this.g.flip(); -+ if (this.field_78430_h) { -+ if (!this.field_78431_i) { -+ this.field_78424_g.flip(); - this.field_78431_i = true; - } - -- if(this.g.remaining() > 0) { -+ if (this.field_78424_g.remaining() > 0) { - GL11.glPushMatrix(); - GL11.glTranslatef((float)((double)this.field_78429_a - this.field_78425_d), (float)((double)this.field_78427_b - this.field_78426_e), (float)((double)this.field_78428_c - this.field_78423_f)); -- GL11.glCallLists(this.g); -+ GL11.glCallLists(this.field_78424_g); - GL11.glPopMatrix(); - } -- - } - } - ---- net/minecraft/src/EntityAISwimming.java -+++ net/minecraft/src/EntityAISwimming.java -@@ -3,20 +3,25 @@ - public class EntityAISwimming extends EntityAIBase { - private EntityLiving theEntity; - -- public EntityAISwimming(EntityLiving var1) { -- this.theEntity = var1; -+ public EntityAISwimming(EntityLiving par1EntityLiving) { -+ this.theEntity = par1EntityLiving; - this.setMutexBits(4); -- var1.getNavigator().setCanSwim(true); -+ par1EntityLiving.getNavigator().setCanSwim(true); - } - -+ /** -+ * Returns whether the EntityAIBase should begin execution. -+ */ - public boolean shouldExecute() { - return this.theEntity.isInWater() || this.theEntity.handleLavaMovement(); - } - -+ /** -+ * Updates the task -+ */ - public void updateTask() { -- if(this.theEntity.getRNG().nextFloat() < 0.8F) { -+ if (this.theEntity.getRNG().nextFloat() < 0.8F) { - this.theEntity.getJumpHelper().setJumping(); - } -- - } - } ---- net/minecraft/src/EntityPortalFX.java -+++ net/minecraft/src/EntityPortalFX.java -@@ -1,60 +1,76 @@ - package net.minecraft.src; - -+// MCPatcher Start -+import com.prupe.mcpatcher.cc.ColorizeEntity; -+// MCPatcher End -+ - public class EntityPortalFX extends EntityFX { - private float portalParticleScale; - private double portalPosX; - private double portalPosY; - private double portalPosZ; - -- public EntityPortalFX(World var1, double var2, double var4, double var6, double var8, double var10, double var12) { -- super(var1, var2, var4, var6, var8, var10, var12); -- this.motionX = var8; -- this.motionY = var10; -- this.motionZ = var12; -- this.portalPosX = this.posX = var2; -- this.portalPosY = this.posY = var4; -- this.portalPosZ = this.posZ = var6; -- float var14 = this.ab.nextFloat() * 0.6F + 0.4F; -- this.portalParticleScale = this.particleScale = this.ab.nextFloat() * 0.2F + 0.5F; -+ public EntityPortalFX(World par1World, double par2, double par4, double par6, double par8, double par10, double par12) { -+ super(par1World, par2, par4, par6, par8, par10, par12); -+ this.motionX = par8; -+ this.motionY = par10; -+ this.motionZ = par12; -+ this.portalPosX = this.posX = par2; -+ this.portalPosY = this.posY = par4; -+ this.portalPosZ = this.posZ = par6; -+ float var14 = this.rand.nextFloat() * 0.6F + 0.4F; -+ this.portalParticleScale = this.particleScale = this.rand.nextFloat() * 0.2F + 0.5F; - this.particleRed = this.particleGreen = this.particleBlue = 1.0F * var14; -- this.particleGreen *= 0.3F; -- this.particleRed *= 0.9F; -+ // MCPatcher Start -+ this.particleGreen *= ColorizeEntity.portalColor[1]; -+ this.particleRed *= ColorizeEntity.portalColor[0]; -+ // MCPatcher End - this.particleMaxAge = (int)(Math.random() * 10.0D) + 40; - this.noClip = true; - this.setParticleTextureIndex((int)(Math.random() * 8.0D)); -+ // MCPatcher Start -+ this.particleBlue = ColorizeEntity.portalColor[2]; -+ // MCPatcher End - } - -- public void renderParticle(Tessellator var1, float var2, float var3, float var4, float var5, float var6, float var7) { -- float var8 = ((float)this.particleAge + var2) / (float)this.particleMaxAge; -+ public void renderParticle(Tessellator par1Tessellator, float par2, float par3, float par4, float par5, float par6, float par7) { -+ float var8 = ((float)this.particleAge + par2) / (float)this.particleMaxAge; - var8 = 1.0F - var8; - var8 *= var8; - var8 = 1.0F - var8; - this.particleScale = this.portalParticleScale * var8; -- super.renderParticle(var1, var2, var3, var4, var5, var6, var7); -+ super.renderParticle(par1Tessellator, par2, par3, par4, par5, par6, par7); - } - -- public int getBrightnessForRender(float var1) { -- int var2 = super.getBrightnessForRender(var1); -+ public int getBrightnessForRender(float par1) { -+ int var2 = super.getBrightnessForRender(par1); - float var3 = (float)this.particleAge / (float)this.particleMaxAge; - var3 *= var3; - var3 *= var3; - int var4 = var2 & 255; - int var5 = var2 >> 16 & 255; - var5 += (int)(var3 * 15.0F * 16.0F); -- if(var5 > 240) { -+ -+ if (var5 > 240) { - var5 = 240; - } - - return var4 | var5 << 16; - } - -- public float getBrightness(float var1) { -- float var2 = super.getBrightness(var1); -+ /** -+ * Gets how bright this entity is. -+ */ -+ public float getBrightness(float par1) { -+ float var2 = super.getBrightness(par1); - float var3 = (float)this.particleAge / (float)this.particleMaxAge; - var3 = var3 * var3 * var3 * var3; - return var2 * (1.0F - var3) + var3; - } - -+ /** -+ * Called to update the entity's position/logic. -+ */ - public void onUpdate() { - this.prevPosX = this.posX; - this.prevPosY = this.posY; -@@ -66,9 +82,9 @@ - this.posX = this.portalPosX + this.motionX * (double)var1; - this.posY = this.portalPosY + this.motionY * (double)var1 + (double)(1.0F - var2); - this.posZ = this.portalPosZ + this.motionZ * (double)var1; -- if(this.particleAge++ >= this.particleMaxAge) { -+ -+ if (this.particleAge++ >= this.particleMaxAge) { - this.setDead(); - } -- - } - } ---- net/minecraft/src/I18n.java -+++ net/minecraft/src/I18n.java -@@ -3,15 +3,15 @@ - public class I18n { - private static Locale i18nLocale; - -- static void setLocale(Locale var0) { -- i18nLocale = var0; -- } -- -- public static String getString(String var0) { -- return i18nLocale.translateKey(var0); -- } -- -- public static String getStringParams(String var0, Object... var1) { -- return i18nLocale.formatMessage(var0, var1); -+ static void setLocale(Locale par0Locale) { -+ i18nLocale = par0Locale; -+ } -+ -+ public static String getString(String par0Str) { -+ return i18nLocale.translateKey(par0Str); -+ } -+ -+ public static String getStringParams(String par0Str, Object ... par1ArrayOfObj) { -+ return i18nLocale.formatMessage(par0Str, par1ArrayOfObj); - } - } ---- /dev/null -+++ org/spoutcraft/api/gui/Bitmap.java -@@ -1,0 +1,54 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.api.gui; -+ -+import java.nio.IntBuffer; -+ -+/** -+ * You must specify the width and height of the background bitmap to be used in -+ * the constructor! -+ */ -+public interface Bitmap { -+ /** -+ * Get the raw RGBA array used to create the texture. -+ * @return an array of width * height * 4 bytes -+ */ -+ public byte[] getRawBitmap(); -+ -+ /** -+ * Get the raw width of the bitmap (the widget itself can be scaled to a -+ * different size like normal). -+ * @return bitmap size -+ */ -+ public int getRawWidth(); -+ -+ /** -+ * Get the raw height of the bitmap (the widget itself can be scaled to a -+ * different size like normal). -+ * @return bitmap size -+ */ -+ public int getRawHeight(); -+ -+ /** -+ * Get an IntBuffer to use for setting individual pixels in single calls. -+ * @return the buffer -+ */ -+ public IntBuffer getBuffer(); -+} ---- net/minecraft/src/GuiSlotStatsBlock.java -+++ net/minecraft/src/GuiSlotStatsBlock.java -@@ -4,66 +4,69 @@ - import java.util.Iterator; - - class GuiSlotStatsBlock extends GuiSlotStats { -+ -+ /** Instance of GuiStats. */ - final GuiStats theStats; - -- public GuiSlotStatsBlock(GuiStats var1) { -- super(var1); -- this.theStats = var1; -- this.h = new ArrayList(); -- Iterator var2 = StatList.e.iterator(); -+ public GuiSlotStatsBlock(GuiStats par1GuiStats) { -+ super(par1GuiStats); -+ this.theStats = par1GuiStats; -+ this.field_77266_h = new ArrayList(); -+ Iterator var2 = StatList.objectMineStats.iterator(); - -- while(var2.hasNext()) { -+ while (var2.hasNext()) { - StatCrafting var3 = (StatCrafting)var2.next(); - boolean var4 = false; - int var5 = var3.getItemID(); -- if(GuiStats.getStatsFileWriter(var1).writeStat(var3) > 0) { -- var4 = true; -- } else if(StatList.objectUseStats[var5] != null && GuiStats.getStatsFileWriter(var1).writeStat(StatList.objectUseStats[var5]) > 0) { -- var4 = true; -- } else if(StatList.objectCraftStats[var5] != null && GuiStats.getStatsFileWriter(var1).writeStat(StatList.objectCraftStats[var5]) > 0) { -- var4 = true; -- } -- -- if(var4) { -- this.h.add(var3); -- } -- } -- -- this.i = new SorterStatsBlock(this, var1); -- } -- -- protected void func_77222_a(int var1, int var2, Tessellator var3) { -- super.func_77222_a(var1, var2, var3); -- if(this.field_77262_g == 0) { -- GuiStats.drawSprite(this.theStats, var1 + 115 - 18 + 1, var2 + 1 + 1, 18, 18); -- } else { -- GuiStats.drawSprite(this.theStats, var1 + 115 - 18, var2 + 1, 18, 18); -- } -- -- if(this.field_77262_g == 1) { -- GuiStats.drawSprite(this.theStats, var1 + 165 - 18 + 1, var2 + 1 + 1, 36, 18); -- } else { -- GuiStats.drawSprite(this.theStats, var1 + 165 - 18, var2 + 1, 36, 18); -- } -- -- if(this.field_77262_g == 2) { -- GuiStats.drawSprite(this.theStats, var1 + 215 - 18 + 1, var2 + 1 + 1, 54, 18); -- } else { -- GuiStats.drawSprite(this.theStats, var1 + 215 - 18, var2 + 1, 54, 18); -- } -- -- } -- -- protected void drawSlot(int var1, int var2, int var3, int var4, Tessellator var5) { -- StatCrafting var6 = this.func_77257_d(var1); -+ -+ if (GuiStats.getStatsFileWriter(par1GuiStats).writeStat(var3) > 0) { -+ var4 = true; -+ } else if (StatList.objectUseStats[var5] != null && GuiStats.getStatsFileWriter(par1GuiStats).writeStat(StatList.objectUseStats[var5]) > 0) { -+ var4 = true; -+ } else if (StatList.objectCraftStats[var5] != null && GuiStats.getStatsFileWriter(par1GuiStats).writeStat(StatList.objectCraftStats[var5]) > 0) { -+ var4 = true; -+ } -+ -+ if (var4) { -+ this.field_77266_h.add(var3); -+ } -+ } -+ -+ this.field_77267_i = new SorterStatsBlock(this, par1GuiStats); -+ } -+ -+ protected void func_77222_a(int par1, int par2, Tessellator par3Tessellator) { -+ super.func_77222_a(par1, par2, par3Tessellator); -+ -+ if (this.field_77262_g == 0) { -+ GuiStats.drawSprite(this.theStats, par1 + 115 - 18 + 1, par2 + 1 + 1, 18, 18); -+ } else { -+ GuiStats.drawSprite(this.theStats, par1 + 115 - 18, par2 + 1, 18, 18); -+ } -+ -+ if (this.field_77262_g == 1) { -+ GuiStats.drawSprite(this.theStats, par1 + 165 - 18 + 1, par2 + 1 + 1, 36, 18); -+ } else { -+ GuiStats.drawSprite(this.theStats, par1 + 165 - 18, par2 + 1, 36, 18); -+ } -+ -+ if (this.field_77262_g == 2) { -+ GuiStats.drawSprite(this.theStats, par1 + 215 - 18 + 1, par2 + 1 + 1, 54, 18); -+ } else { -+ GuiStats.drawSprite(this.theStats, par1 + 215 - 18, par2 + 1, 54, 18); -+ } -+ } -+ -+ protected void drawSlot(int par1, int par2, int par3, int par4, Tessellator par5Tessellator) { -+ StatCrafting var6 = this.func_77257_d(par1); - int var7 = var6.getItemID(); -- GuiStats.drawItemSprite(this.theStats, var2 + 40, var3, var7); -- this.func_77260_a((StatCrafting)StatList.objectCraftStats[var7], var2 + 115, var3, var1 % 2 == 0); -- this.func_77260_a((StatCrafting)StatList.objectUseStats[var7], var2 + 165, var3, var1 % 2 == 0); -- this.func_77260_a(var6, var2 + 215, var3, var1 % 2 == 0); -+ GuiStats.drawItemSprite(this.theStats, par2 + 40, par3, var7); -+ this.func_77260_a((StatCrafting)StatList.objectCraftStats[var7], par2 + 115, par3, par1 % 2 == 0); -+ this.func_77260_a((StatCrafting)StatList.objectUseStats[var7], par2 + 165, par3, par1 % 2 == 0); -+ this.func_77260_a(var6, par2 + 215, par3, par1 % 2 == 0); - } - -- protected String func_77258_c(int var1) { -- return var1 == 0 ? "stat.crafted" : (var1 == 1 ? "stat.used" : "stat.mined"); -+ protected String func_77258_c(int par1) { -+ return par1 == 0 ? "stat.crafted" : (par1 == 1 ? "stat.used" : "stat.mined"); - } - } ---- net/minecraft/src/Packet209SetPlayerTeam.java -+++ net/minecraft/src/Packet209SetPlayerTeam.java -@@ -8,92 +8,124 @@ - import java.util.Iterator; - - public class Packet209SetPlayerTeam extends Packet { -- public String a = ""; -- public String b = ""; -- public String c = ""; -- public String d = ""; -- public Collection e = new ArrayList(); -+ -+ /** A unique name for the team. */ -+ public String teamName = ""; -+ -+ /** Only if mode = 0 or 2. */ -+ public String teamDisplayName = ""; -+ -+ /** -+ * Only if mode = 0 or 2. Displayed before the players' name that are part of this team. -+ */ -+ public String teamPrefix = ""; -+ -+ /** -+ * Only if mode = 0 or 2. Displayed after the players' name that are part of this team. -+ */ -+ public String teamSuffix = ""; -+ -+ /** Only if mode = 0 or 3 or 4. Players to be added/remove from the team. */ -+ public Collection playerNames = new ArrayList(); -+ -+ /** -+ * If 0 then the team is created. If 1 then the team is removed. If 2 the team team information is updated. If 3 then -+ * new players are added to the team. If 4 then players are removed from the team. -+ */ - public int mode; -+ -+ /** Only if mode = 0 or 2. */ - public int friendlyFire; - -- public Packet209SetPlayerTeam() { -- } -- -- public Packet209SetPlayerTeam(ScorePlayerTeam var1, int var2) { -- this.a = var1.func_96661_b(); -- this.mode = var2; -- if(var2 == 0 || var2 == 2) { -- this.b = var1.func_96669_c(); -- this.c = var1.getColorPrefix(); -- this.d = var1.getColorSuffix(); -- this.friendlyFire = var1.func_98299_i(); -- } -- -- if(var2 == 0) { -- this.e.addAll(var1.getMembershipCollection()); -- } -- -- } -- -- public Packet209SetPlayerTeam(ScorePlayerTeam var1, Collection var2, int var3) { -- if(var3 != 3 && var3 != 4) { -+ public Packet209SetPlayerTeam() {} -+ -+ public Packet209SetPlayerTeam(ScorePlayerTeam par1ScorePlayerTeam, int par2) { -+ this.teamName = par1ScorePlayerTeam.func_96661_b(); -+ this.mode = par2; -+ -+ if (par2 == 0 || par2 == 2) { -+ this.teamDisplayName = par1ScorePlayerTeam.func_96669_c(); -+ this.teamPrefix = par1ScorePlayerTeam.getColorPrefix(); -+ this.teamSuffix = par1ScorePlayerTeam.getColorSuffix(); -+ this.friendlyFire = par1ScorePlayerTeam.func_98299_i(); -+ } -+ -+ if (par2 == 0) { -+ this.playerNames.addAll(par1ScorePlayerTeam.getMembershipCollection()); -+ } -+ } -+ -+ public Packet209SetPlayerTeam(ScorePlayerTeam par1ScorePlayerTeam, Collection par2Collection, int par3) { -+ if (par3 != 3 && par3 != 4) { - throw new IllegalArgumentException("Method must be join or leave for player constructor"); -- } else if(var2 != null && !var2.isEmpty()) { -- this.mode = var3; -- this.a = var1.func_96661_b(); -- this.e.addAll(var2); -+ } else if (par2Collection != null && !par2Collection.isEmpty()) { -+ this.mode = par3; -+ this.teamName = par1ScorePlayerTeam.func_96661_b(); -+ this.playerNames.addAll(par2Collection); - } else { - throw new IllegalArgumentException("Players cannot be null/empty"); - } - } - -- public void readPacketData(DataInput var1) throws IOException { -- this.a = readString(var1, 16); -- this.mode = var1.readByte(); -- if(this.mode == 0 || this.mode == 2) { -- this.b = readString(var1, 32); -- this.c = readString(var1, 16); -- this.d = readString(var1, 16); -- this.friendlyFire = var1.readByte(); -+ /** -+ * Abstract. Reads the raw packet data from the data stream. -+ */ -+ public void readPacketData(DataInput par1DataInput) throws IOException { -+ this.teamName = readString(par1DataInput, 16); -+ this.mode = par1DataInput.readByte(); -+ -+ if (this.mode == 0 || this.mode == 2) { -+ this.teamDisplayName = readString(par1DataInput, 32); -+ this.teamPrefix = readString(par1DataInput, 16); -+ this.teamSuffix = readString(par1DataInput, 16); -+ this.friendlyFire = par1DataInput.readByte(); - } - -- if(this.mode == 0 || this.mode == 3 || this.mode == 4) { -- short var2 = var1.readShort(); -+ if (this.mode == 0 || this.mode == 3 || this.mode == 4) { -+ short var2 = par1DataInput.readShort(); - -- for(int var3 = 0; var3 < var2; ++var3) { -- this.e.add(readString(var1, 16)); -+ for (int var3 = 0; var3 < var2; ++var3) { -+ this.playerNames.add(readString(par1DataInput, 16)); - } - } -- - } - -- public void writePacketData(DataOutput var1) throws IOException { -- writeString(this.a, var1); -- var1.writeByte(this.mode); -- if(this.mode == 0 || this.mode == 2) { -- writeString(this.b, var1); -- writeString(this.c, var1); -- writeString(this.d, var1); -- var1.writeByte(this.friendlyFire); -+ /** -+ * Abstract. Writes the raw packet data to the data stream. -+ */ -+ public void writePacketData(DataOutput par1DataOutput) throws IOException { -+ writeString(this.teamName, par1DataOutput); -+ par1DataOutput.writeByte(this.mode); -+ -+ if (this.mode == 0 || this.mode == 2) { -+ writeString(this.teamDisplayName, par1DataOutput); -+ writeString(this.teamPrefix, par1DataOutput); -+ writeString(this.teamSuffix, par1DataOutput); -+ par1DataOutput.writeByte(this.friendlyFire); - } - -- if(this.mode == 0 || this.mode == 3 || this.mode == 4) { -- var1.writeShort(this.e.size()); -- Iterator var2 = this.e.iterator(); -+ if (this.mode == 0 || this.mode == 3 || this.mode == 4) { -+ par1DataOutput.writeShort(this.playerNames.size()); -+ Iterator var2 = this.playerNames.iterator(); - -- while(var2.hasNext()) { -+ while (var2.hasNext()) { - String var3 = (String)var2.next(); -- writeString(var3, var1); -+ writeString(var3, par1DataOutput); - } - } -- -- } -- -- public void processPacket(NetHandler var1) { -- var1.handleSetPlayerTeam(this); -- } -- -+ } -+ -+ /** -+ * Passes this Packet on to the NetHandler for processing. -+ */ -+ public void processPacket(NetHandler par1NetHandler) { -+ par1NetHandler.handleSetPlayerTeam(this); -+ } -+ -+ /** -+ * Abstract. Return the size of the packet (not counting the header). -+ */ - public int getPacketSize() { -- return 3 + this.a.length(); -+ return 3 + this.teamName.length(); - } - } ---- net/minecraft/src/GuiScreenOnlineServers.java -+++ net/minecraft/src/GuiScreenOnlineServers.java -@@ -16,29 +16,33 @@ - private GuiScreen field_96188_a; - private GuiSlotOnlineServerList field_96186_b; - private static int field_96187_c; -- private static final Object e = new Object(); -+ private static final Object field_96185_d = new Object(); - private long field_96189_n = -1L; - private GuiButton field_96190_o; - private GuiButton field_96198_p; - private GuiButtonLink field_96197_q; - private GuiButton field_96196_r; -- private String u; -+ private String field_96195_s; - private static McoServerList field_96194_t = new McoServerList(); - private boolean field_96193_u; -- private List x = Lists.newArrayList(); -+ private List field_96192_v = Lists.newArrayList(); - private volatile int field_96199_x = 0; -- private Long z; -+ private Long field_102019_y; - private int field_104044_y; - -- public GuiScreenOnlineServers(GuiScreen var1) { -- this.field_96188_a = var1; -+ public GuiScreenOnlineServers(GuiScreen par1GuiScreen) { -+ this.field_96188_a = par1GuiScreen; - } - -+ /** -+ * Adds the buttons (and other controls) to the screen in question. -+ */ - public void initGui() { - Keyboard.enableRepeatEvents(true); -- this.i.clear(); -+ this.buttonList.clear(); - field_96194_t.func_130129_a(this.mc.getSession()); -- if(!this.field_96193_u) { -+ -+ if (!this.field_96193_u) { - this.field_96193_u = true; - this.field_96186_b = new GuiSlotOnlineServerList(this); - } else { -@@ -49,86 +53,97 @@ - } - - public void func_96178_g() { -- this.i.add(this.field_96196_r = new GuiButton(1, this.width / 2 - 154, this.height - 52, 100, 20, I18n.getString("mco.selectServer.play"))); -- this.i.add(this.field_96198_p = new GuiButton(2, this.width / 2 - 48, this.height - 52, 100, 20, I18n.getString("mco.selectServer.create"))); -- this.i.add(this.field_96190_o = new GuiButton(3, this.width / 2 + 58, this.height - 52, 100, 20, I18n.getString("mco.selectServer.configure"))); -- this.i.add(this.field_96197_q = new GuiButtonLink(4, this.width / 2 - 154, this.height - 28, 154, 20, I18n.getString("mco.selectServer.moreinfo"))); -- this.i.add(new GuiButton(0, this.width / 2 + 6, this.height - 28, 153, 20, I18n.getString("gui.cancel"))); -+ this.buttonList.add(this.field_96196_r = new GuiButton(1, this.width / 2 - 154, this.height - 52, 100, 20, I18n.getString("mco.selectServer.play"))); -+ this.buttonList.add(this.field_96198_p = new GuiButton(2, this.width / 2 - 48, this.height - 52, 100, 20, I18n.getString("mco.selectServer.create"))); -+ this.buttonList.add(this.field_96190_o = new GuiButton(3, this.width / 2 + 58, this.height - 52, 100, 20, I18n.getString("mco.selectServer.configure"))); -+ this.buttonList.add(this.field_96197_q = new GuiButtonLink(4, this.width / 2 - 154, this.height - 28, 154, 20, I18n.getString("mco.selectServer.moreinfo"))); -+ this.buttonList.add(new GuiButton(0, this.width / 2 + 6, this.height - 28, 153, 20, I18n.getString("gui.cancel"))); - McoServer var1 = this.func_140030_b(this.field_96189_n); -- this.field_96196_r.enabled = var1 != null && var1.d.equals("OPEN") && !var1.field_98166_h; -+ this.field_96196_r.enabled = var1 != null && var1.field_96404_d.equals("OPEN") && !var1.field_98166_h; - this.field_96198_p.enabled = this.field_96199_x > 0; -- if(var1 != null && !var1.e.equals(this.mc.getSession().getUsername())) { -- this.field_96190_o.f = I18n.getString("mco.selectServer.leave"); -+ -+ if (var1 != null && !var1.field_96405_e.equals(this.mc.getSession().getUsername())) { -+ this.field_96190_o.displayString = I18n.getString("mco.selectServer.leave"); - } -- - } - -+ /** -+ * Called from the main game loop to update the screen. -+ */ - public void updateScreen() { - super.updateScreen(); - ++this.field_104044_y; -- if(field_96194_t.func_130127_a()) { -+ -+ if (field_96194_t.func_130127_a()) { - List var1 = field_96194_t.func_98252_c(); - Iterator var2 = var1.iterator(); - -- while(true) { -- while(var2.hasNext()) { -- McoServer var3 = (McoServer)var2.next(); -- Iterator var4 = this.x.iterator(); -- -- while(var4.hasNext()) { -- McoServer var5 = (McoServer)var4.next(); -- if(var3.field_96408_a == var5.field_96408_a) { -- var3.func_96401_a(var5); -- if(this.z != null && this.z.longValue() == var3.field_96408_a) { -- this.z = null; -- var3.field_96411_l = false; -- } -- break; -+ while (var2.hasNext()) { -+ McoServer var3 = (McoServer)var2.next(); -+ Iterator var4 = this.field_96192_v.iterator(); -+ -+ while (var4.hasNext()) { -+ McoServer var5 = (McoServer)var4.next(); -+ -+ if (var3.field_96408_a == var5.field_96408_a) { -+ var3.func_96401_a(var5); -+ -+ if (this.field_102019_y != null && this.field_102019_y.longValue() == var3.field_96408_a) { -+ this.field_102019_y = null; -+ var3.field_96411_l = false; - } -+ -+ break; - } - } -- -- this.field_96199_x = field_96194_t.func_140056_e(); -- this.x = var1; -- field_96194_t.func_98250_b(); -- break; - } -+ -+ this.field_96199_x = field_96194_t.func_140056_e(); -+ this.field_96192_v = var1; -+ field_96194_t.func_98250_b(); - } - - this.field_96198_p.enabled = this.field_96199_x > 0; - } - -+ /** -+ * Called when the screen is unloaded. Used to disable keyboard repeat events -+ */ - public void onGuiClosed() { - Keyboard.enableRepeatEvents(false); - } - -- protected void actionPerformed(GuiButton var1) { -- if(var1.enabled) { -- if(var1.id == 1) { -+ /** -+ * Fired when a control is clicked. This is the equivalent of ActionListener.actionPerformed(ActionEvent e). -+ */ -+ protected void actionPerformed(GuiButton par1GuiButton) { -+ if (par1GuiButton.enabled) { -+ if (par1GuiButton.id == 1) { - this.func_140032_e(this.field_96189_n); -- } else if(var1.id == 3) { -+ } else if (par1GuiButton.id == 3) { - this.func_140019_s(); -- } else if(var1.id == 0) { -+ } else if (par1GuiButton.id == 0) { - field_96194_t.func_98248_d(); - this.mc.displayGuiScreen(this.field_96188_a); -- } else if(var1.id == 2) { -+ } else if (par1GuiButton.id == 2) { - field_96194_t.func_98248_d(); - this.mc.displayGuiScreen(new GuiScreenCreateOnlineWorld(this)); -- } else if(var1.id == 4) { -+ } else if (par1GuiButton.id == 4) { - this.field_96197_q.func_96135_a("http://realms.minecraft.net/"); - } else { -- this.field_96186_b.actionPerformed(var1); -+ this.field_96186_b.actionPerformed(par1GuiButton); - } -- - } - } - - private void func_140019_s() { - McoServer var1 = this.func_140030_b(this.field_96189_n); -- if(var1 != null) { -- if(this.mc.getSession().getUsername().equals(var1.e)) { -+ -+ if (var1 != null) { -+ if (this.mc.getSession().getUsername().equals(var1.field_96405_e)) { - McoServer var2 = this.func_98086_a(var1.field_96408_a); -- if(var2 != null) { -+ -+ if (var2 != null) { - field_96194_t.func_98248_d(); - this.mc.displayGuiScreen(new GuiScreenConfigureWorld(this, var2)); - } -@@ -138,27 +153,26 @@ - this.mc.displayGuiScreen(new GuiScreenConfirmation(this, GuiScreenConfirmationType.Info, var4, var3, 3)); - } - } -- - } - -- private McoServer func_140030_b(long var1) { -- Iterator var3 = this.x.iterator(); -- -+ private McoServer func_140030_b(long par1) { -+ Iterator var3 = this.field_96192_v.iterator(); - McoServer var4; -+ - do { -- if(!var3.hasNext()) { -+ if (!var3.hasNext()) { - return null; - } - - var4 = (McoServer)var3.next(); -- } while(var4.field_96408_a != var1); -+ } while (var4.field_96408_a != par1); - - return var4; - } - -- private int func_140009_c(long var1) { -- for(int var3 = 0; var3 < this.x.size(); ++var3) { -- if(((McoServer)this.x.get(var3)).field_96408_a == var1) { -+ private int func_140009_c(long par1) { -+ for (int var3 = 0; var3 < this.field_96192_v.size(); ++var3) { -+ if (((McoServer)this.field_96192_v.get(var3)).field_96408_a == par1) { - return var3; - } - } -@@ -166,8 +180,8 @@ - return -1; - } - -- public void confirmClicked(boolean var1, int var2) { -- if(var2 == 3 && var1) { -+ public void confirmClicked(boolean par1, int par2) { -+ if (par2 == 3 && par1) { - (new ThreadOnlineScreen(this)).start(); - } - -@@ -176,30 +190,30 @@ - - private void func_140012_t() { - int var1 = this.func_140009_c(this.field_96189_n); -- if(this.x.size() - 1 == var1) { -+ -+ if (this.field_96192_v.size() - 1 == var1) { - --var1; - } - -- if(this.x.size() == 0) { -+ if (this.field_96192_v.size() == 0) { - var1 = -1; - } - -- if(var1 >= 0 && var1 < this.x.size()) { -- this.field_96189_n = ((McoServer)this.x.get(var1)).field_96408_a; -+ if (var1 >= 0 && var1 < this.field_96192_v.size()) { -+ this.field_96189_n = ((McoServer)this.field_96192_v.get(var1)).field_96408_a; - } -- - } - -- public void func_102018_a(long var1) { -+ public void func_102018_a(long par1) { - this.field_96189_n = -1L; -- this.z = Long.valueOf(var1); -+ this.field_102019_y = Long.valueOf(par1); - } - -- private McoServer func_98086_a(long var1) { -+ private McoServer func_98086_a(long par1) { - McoClient var3 = new McoClient(this.mc.getSession()); - - try { -- return var3.func_98176_a(var1); -+ return var3.func_98176_a(par1); - } catch (ExceptionMcoService var5) { - this.mc.getLogAgent().logSevere(var5.toString()); - } catch (IOException var6) { -@@ -209,45 +223,54 @@ - return null; - } - -- protected void keyTyped(char var1, int var2) { -- if(var2 == 59) { -+ /** -+ * Fired when a key is typed. This is the equivalent of KeyListener.keyTyped(KeyEvent e). -+ */ -+ protected void keyTyped(char par1, int par2) { -+ if (par2 == 59) { - this.mc.gameSettings.hideServerAddress = !this.mc.gameSettings.hideServerAddress; - this.mc.gameSettings.saveOptions(); - } else { -- if(var2 != 28 && var2 != 156) { -- super.keyTyped(var1, var2); -+ if (par2 != 28 && par2 != 156) { -+ super.keyTyped(par1, par2); - } else { -- this.actionPerformed((GuiButton)this.i.get(0)); -+ this.actionPerformed((GuiButton)this.buttonList.get(0)); - } -- - } - } - -- public void drawScreen(int var1, int var2, float var3) { -- this.u = null; -+ /** -+ * Draws the screen and all the components in it. -+ */ -+ public void drawScreen(int par1, int par2, float par3) { -+ this.field_96195_s = null; - this.drawDefaultBackground(); -- this.field_96186_b.drawScreen(var1, var2, var3); -+ this.field_96186_b.drawScreen(par1, par2, par3); - this.drawCenteredString(this.fontRenderer, I18n.getString("mco.title"), this.width / 2, 20, 16777215); -- super.drawScreen(var1, var2, var3); -- if(this.u != null) { -- this.func_96165_a(this.u, var1, var2); -+ super.drawScreen(par1, par2, par3); -+ -+ if (this.field_96195_s != null) { -+ this.func_96165_a(this.field_96195_s, par1, par2); - } - -- this.func_130038_b(var1, var2); -+ this.func_130038_b(par1, par2); - } - -- protected void mouseClicked(int var1, int var2, int var3) { -- super.mouseClicked(var1, var2, var3); -- if(this.func_130037_c(var1, var2) && field_96194_t.func_130124_d() != 0) { -+ /** -+ * Called when the mouse is clicked. -+ */ -+ protected void mouseClicked(int par1, int par2, int par3) { -+ super.mouseClicked(par1, par2, par3); -+ -+ if (this.func_130037_c(par1, par2) && field_96194_t.func_130124_d() != 0) { - GuiScreenPendingInvitation var4 = new GuiScreenPendingInvitation(this); - this.mc.displayGuiScreen(var4); - } -- - } - -- private void func_130038_b(int var1, int var2) { -+ private void func_130038_b(int par1, int par2) { - int var3 = field_96194_t.func_130124_d(); -- boolean var4 = this.func_130037_c(var1, var2); -+ boolean var4 = this.func_130037_c(par1, par2); - this.mc.getTextureManager().bindTexture(field_130039_a); - GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - GL11.glPushMatrix(); -@@ -255,7 +278,8 @@ - GL11.glPopMatrix(); - int var5; - int var6; -- if(var3 != 0) { -+ -+ if (var3 != 0) { - var5 = 198 + (Math.min(var3, 6) - 1) * 8; - var6 = (int)(Math.max(0.0F, Math.max(MathHelper.sin((float)(10 + this.field_104044_y) * 0.57F), MathHelper.cos((float)this.field_104044_y * 0.35F))) * -6.0F); - this.mc.getTextureManager().bindTexture(field_130039_a); -@@ -265,114 +289,112 @@ - GL11.glPopMatrix(); - } - -- if(var4 && var3 != 0) { -- var5 = var1 + 12; -- var6 = var2 - 12; -+ if (var4 && var3 != 0) { -+ var5 = par1 + 12; -+ var6 = par2 - 12; - String var7 = I18n.getString("mco.invites.pending"); - int var8 = this.fontRenderer.getStringWidth(var7); - this.drawGradientRect(var5 - 3, var6 - 3, var5 + var8 + 3, var6 + 8 + 3, -1073741824, -1073741824); - this.fontRenderer.drawStringWithShadow(var7, var5, var6, -1); - } -- - } - -- private boolean func_130037_c(int var1, int var2) { -+ private boolean func_130037_c(int par1, int par2) { - int var3 = this.width / 2 + 56; - int var4 = this.width / 2 + 78; - byte var5 = 13; - byte var6 = 27; -- return var3 <= var1 && var1 <= var4 && var5 <= var2 && var2 <= var6; -+ return var3 <= par1 && par1 <= var4 && var5 <= par2 && par2 <= var6; - } - -- private void func_140032_e(long var1) { -- McoServer var3 = this.func_140030_b(var1); -- if(var3 != null) { -+ private void func_140032_e(long par1) { -+ McoServer var3 = this.func_140030_b(par1); -+ -+ if (var3 != null) { - field_96194_t.func_98248_d(); - GuiScreenLongRunningTask var4 = new GuiScreenLongRunningTask(this.mc, this, new TaskOnlineConnect(this, var3)); - var4.func_98117_g(); - this.mc.displayGuiScreen(var4); - } -- - } - -- private void func_101008_c(int var1, int var2, int var3, int var4) { -+ private void func_101008_c(int par1, int par2, int par3, int par4) { - this.mc.getTextureManager().bindTexture(field_130039_a); - GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - GL11.glPushMatrix(); - GL11.glScalef(0.5F, 0.5F, 0.5F); -- this.drawTexturedModalRect(var1 * 2, var2 * 2, 191, 0, 16, 15); -+ this.drawTexturedModalRect(par1 * 2, par2 * 2, 191, 0, 16, 15); - GL11.glPopMatrix(); -- if(var3 >= var1 && var3 <= var1 + 9 && var4 >= var2 && var4 <= var2 + 9) { -- this.u = I18n.getString("mco.selectServer.expired"); -+ -+ if (par3 >= par1 && par3 <= par1 + 9 && par4 >= par2 && par4 <= par2 + 9) { -+ this.field_96195_s = I18n.getString("mco.selectServer.expired"); - } -- - } - -- private void func_104039_b(int var1, int var2, int var3, int var4, int var5) { -- if(this.field_104044_y % 20 < 10) { -+ private void func_104039_b(int par1, int par2, int par3, int par4, int par5) { -+ if (this.field_104044_y % 20 < 10) { - this.mc.getTextureManager().bindTexture(field_130039_a); - GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - GL11.glPushMatrix(); - GL11.glScalef(0.5F, 0.5F, 0.5F); -- this.drawTexturedModalRect(var1 * 2, var2 * 2, 207, 0, 16, 15); -+ this.drawTexturedModalRect(par1 * 2, par2 * 2, 207, 0, 16, 15); - GL11.glPopMatrix(); - } - -- if(var3 >= var1 && var3 <= var1 + 9 && var4 >= var2 && var4 <= var2 + 9) { -- if(var5 == 0) { -- this.u = I18n.getString("mco.selectServer.expires.soon"); -- } else if(var5 == 1) { -- this.u = I18n.getString("mco.selectServer.expires.day"); -+ if (par3 >= par1 && par3 <= par1 + 9 && par4 >= par2 && par4 <= par2 + 9) { -+ if (par5 == 0) { -+ this.field_96195_s = I18n.getString("mco.selectServer.expires.soon"); -+ } else if (par5 == 1) { -+ this.field_96195_s = I18n.getString("mco.selectServer.expires.day"); - } else { -- this.u = I18n.getStringParams("mco.selectServer.expires.days", new Object[]{Integer.valueOf(var5)}); -+ this.field_96195_s = I18n.getStringParams("mco.selectServer.expires.days", new Object[] {Integer.valueOf(par5)}); - } - } -- -- } -- -- private void func_101006_d(int var1, int var2, int var3, int var4) { -- this.mc.getTextureManager().bindTexture(field_130039_a); -- GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); -- GL11.glPushMatrix(); -- GL11.glScalef(0.5F, 0.5F, 0.5F); -- this.drawTexturedModalRect(var1 * 2, var2 * 2, 207, 0, 16, 15); -- GL11.glPopMatrix(); -- if(var3 >= var1 && var3 <= var1 + 9 && var4 >= var2 && var4 <= var2 + 9) { -- this.u = I18n.getString("mco.selectServer.open"); -- } -- -- } -- -- private void func_101001_e(int var1, int var2, int var3, int var4) { -- this.mc.getTextureManager().bindTexture(field_130039_a); -- GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); -- GL11.glPushMatrix(); -- GL11.glScalef(0.5F, 0.5F, 0.5F); -- this.drawTexturedModalRect(var1 * 2, var2 * 2, 223, 0, 16, 15); -- GL11.glPopMatrix(); -- if(var3 >= var1 && var3 <= var1 + 9 && var4 >= var2 && var4 <= var2 + 9) { -- this.u = I18n.getString("mco.selectServer.closed"); -- } -- -- } -- -- protected void func_96165_a(String var1, int var2, int var3) { -- if(var1 != null) { -- int var4 = var2 + 12; -- int var5 = var3 - 12; -- int var6 = this.fontRenderer.getStringWidth(var1); -+ } -+ -+ private void func_101006_d(int par1, int par2, int par3, int par4) { -+ this.mc.getTextureManager().bindTexture(field_130039_a); -+ GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); -+ GL11.glPushMatrix(); -+ GL11.glScalef(0.5F, 0.5F, 0.5F); -+ this.drawTexturedModalRect(par1 * 2, par2 * 2, 207, 0, 16, 15); -+ GL11.glPopMatrix(); -+ -+ if (par3 >= par1 && par3 <= par1 + 9 && par4 >= par2 && par4 <= par2 + 9) { -+ this.field_96195_s = I18n.getString("mco.selectServer.open"); -+ } -+ } -+ -+ private void func_101001_e(int par1, int par2, int par3, int par4) { -+ this.mc.getTextureManager().bindTexture(field_130039_a); -+ GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); -+ GL11.glPushMatrix(); -+ GL11.glScalef(0.5F, 0.5F, 0.5F); -+ this.drawTexturedModalRect(par1 * 2, par2 * 2, 223, 0, 16, 15); -+ GL11.glPopMatrix(); -+ -+ if (par3 >= par1 && par3 <= par1 + 9 && par4 >= par2 && par4 <= par2 + 9) { -+ this.field_96195_s = I18n.getString("mco.selectServer.closed"); -+ } -+ } -+ -+ protected void func_96165_a(String par1Str, int par2, int par3) { -+ if (par1Str != null) { -+ int var4 = par2 + 12; -+ int var5 = par3 - 12; -+ int var6 = this.fontRenderer.getStringWidth(par1Str); - this.drawGradientRect(var4 - 3, var5 - 3, var4 + var6 + 3, var5 + 8 + 3, -1073741824, -1073741824); -- this.fontRenderer.drawStringWithShadow(var1, var4, var5, -1); -+ this.fontRenderer.drawStringWithShadow(par1Str, var4, var5, -1); - } - } - -- private void func_96174_a(McoServer var1) throws IOException { -- if(var1.m.equals("")) { -- var1.m = EnumChatFormatting.GRAY + "" + 0; -+ private void func_96174_a(McoServer par1McoServer) throws IOException { -+ if (par1McoServer.field_96414_k.equals("")) { -+ par1McoServer.field_96414_k = EnumChatFormatting.GRAY + "" + 0; - } - -- var1.field_96415_h = 78; -- ServerAddress var2 = ServerAddress.func_78860_a(var1.g); -+ par1McoServer.field_96415_h = 78; -+ ServerAddress var2 = ServerAddress.func_78860_a(par1McoServer.field_96403_g); - Socket var3 = null; - DataInputStream var4 = null; - DataOutputStream var5 = null; -@@ -387,15 +409,16 @@ - var5 = new DataOutputStream(var3.getOutputStream()); - var5.write(254); - var5.write(1); -- if(var4.read() != 255) { -+ -+ if (var4.read() != 255) { - throw new IOException("Bad message"); - } - - String var6 = Packet.readString(var4, 256); - char[] var7 = var6.toCharArray(); - -- for(int var8 = 0; var8 < var7.length; ++var8) { -- if(var7[var8] != 167 && var7[var8] != 0 && ChatAllowedCharacters.a.indexOf(var7[var8]) < 0) { -+ for (int var8 = 0; var8 < var7.length; ++var8) { -+ if (var7[var8] != 167 && var7[var8] != 0 && ChatAllowedCharacters.allowedCharacters.indexOf(var7[var8]) < 0) { - var7[var8] = 63; - } - } -@@ -404,20 +427,23 @@ - int var9; - int var10; - String[] var27; -- if(var6.startsWith("\u00a7") && var6.length() > 1) { -+ -+ if (var6.startsWith("\u00a7") && var6.length() > 1) { - var27 = var6.substring(1).split("\u0000"); -- if(MathHelper.parseIntWithDefault(var27[0], 0) == 1) { -- var1.field_96415_h = MathHelper.parseIntWithDefault(var27[1], var1.field_96415_h); -+ -+ if (MathHelper.parseIntWithDefault(var27[0], 0) == 1) { -+ par1McoServer.field_96415_h = MathHelper.parseIntWithDefault(var27[1], par1McoServer.field_96415_h); - var9 = MathHelper.parseIntWithDefault(var27[4], 0); - var10 = MathHelper.parseIntWithDefault(var27[5], 0); -- if(var9 >= 0 && var10 >= 0) { -- var1.m = EnumChatFormatting.GRAY + "" + var9; -+ -+ if (var9 >= 0 && var10 >= 0) { -+ par1McoServer.field_96414_k = EnumChatFormatting.GRAY + "" + var9; - } else { -- var1.m = "" + EnumChatFormatting.DARK_GRAY + "???"; -+ par1McoServer.field_96414_k = "" + EnumChatFormatting.DARK_GRAY + "???"; - } - } else { -- var1.field_96415_h = 79; -- var1.m = "" + EnumChatFormatting.DARK_GRAY + "???"; -+ par1McoServer.field_96415_h = 79; -+ par1McoServer.field_96414_k = "" + EnumChatFormatting.DARK_GRAY + "???"; - } - } else { - var27 = var6.split("\u00a7"); -@@ -429,137 +455,140 @@ - var9 = Integer.parseInt(var27[1]); - var10 = Integer.parseInt(var27[2]); - } catch (Exception var25) { -+ ; - } - -- var1.c = EnumChatFormatting.GRAY + var6; -- if(var9 >= 0 && var10 > 0) { -- var1.m = EnumChatFormatting.GRAY + "" + var9; -+ par1McoServer.field_96407_c = EnumChatFormatting.GRAY + var6; -+ -+ if (var9 >= 0 && var10 > 0) { -+ par1McoServer.field_96414_k = EnumChatFormatting.GRAY + "" + var9; - } else { -- var1.m = "" + EnumChatFormatting.DARK_GRAY + "???"; -+ par1McoServer.field_96414_k = "" + EnumChatFormatting.DARK_GRAY + "???"; - } - -- var1.field_96415_h = 77; -+ par1McoServer.field_96415_h = 77; - } - } finally { - try { -- if(var4 != null) { -+ if (var4 != null) { - var4.close(); - } - } catch (Throwable var24) { -+ ; - } - - try { -- if(var5 != null) { -+ if (var5 != null) { - var5.close(); - } - } catch (Throwable var23) { -+ ; - } - - try { -- if(var3 != null) { -+ if (var3 != null) { - var3.close(); - } - } catch (Throwable var22) { -+ ; - } -- - } -- -- } -- -- static long func_140041_a(GuiScreenOnlineServers var0) { -- return var0.field_96189_n; -- } -- -- static McoServer func_140011_a(GuiScreenOnlineServers var0, long var1) { -- return var0.func_140030_b(var1); -- } -- -- static Minecraft func_98075_b(GuiScreenOnlineServers var0) { -- return var0.mc; -+ } -+ -+ static long func_140041_a(GuiScreenOnlineServers par0GuiScreenOnlineServers) { -+ return par0GuiScreenOnlineServers.field_96189_n; -+ } -+ -+ static McoServer func_140011_a(GuiScreenOnlineServers par0GuiScreenOnlineServers, long par1) { -+ return par0GuiScreenOnlineServers.func_140030_b(par1); -+ } -+ -+ static Minecraft func_98075_b(GuiScreenOnlineServers par0GuiScreenOnlineServers) { -+ return par0GuiScreenOnlineServers.mc; - } - - static McoServerList func_140040_h() { - return field_96194_t; - } - -- static List func_140013_c(GuiScreenOnlineServers var0) { -- return var0.x; -- } -- -- static void func_140017_d(GuiScreenOnlineServers var0) { -- var0.func_140012_t(); -- } -- -- static Minecraft func_98076_f(GuiScreenOnlineServers var0) { -- return var0.mc; -- } -- -- static Minecraft func_140037_f(GuiScreenOnlineServers var0) { -- return var0.mc; -- } -- -- static long func_140036_b(GuiScreenOnlineServers var0, long var1) { -- return var0.field_96189_n = var1; -- } -- -- static Minecraft func_140015_g(GuiScreenOnlineServers var0) { -- return var0.mc; -- } -- -- static GuiButton func_140038_h(GuiScreenOnlineServers var0) { -- return var0.field_96190_o; -- } -- -- static GuiButton func_140033_i(GuiScreenOnlineServers var0) { -- return var0.field_96196_r; -- } -- -- static void func_140008_c(GuiScreenOnlineServers var0, long var1) { -- var0.func_140032_e(var1); -- } -- -- static int func_140027_d(GuiScreenOnlineServers var0, long var1) { -- return var0.func_140009_c(var1); -- } -- -- static Minecraft func_104032_j(GuiScreenOnlineServers var0) { -- return var0.mc; -- } -- -- static FontRenderer func_140023_k(GuiScreenOnlineServers var0) { -- return var0.fontRenderer; -- } -- -- static void func_104031_c(GuiScreenOnlineServers var0, int var1, int var2, int var3, int var4) { -- var0.func_101008_c(var1, var2, var3, var4); -- } -- -- static void func_140035_b(GuiScreenOnlineServers var0, int var1, int var2, int var3, int var4) { -- var0.func_101001_e(var1, var2, var3, var4); -- } -- -- static Minecraft func_140014_l(GuiScreenOnlineServers var0) { -- return var0.mc; -- } -- -- static void func_140031_a(GuiScreenOnlineServers var0, int var1, int var2, int var3, int var4, int var5) { -- var0.func_104039_b(var1, var2, var3, var4, var5); -- } -- -- static void func_140020_c(GuiScreenOnlineServers var0, int var1, int var2, int var3, int var4) { -- var0.func_101006_d(var1, var2, var3, var4); -- } -- -- static FontRenderer func_140039_m(GuiScreenOnlineServers var0) { -- return var0.fontRenderer; -- } -- -- static FontRenderer func_98079_k(GuiScreenOnlineServers var0) { -- return var0.fontRenderer; -+ static List func_140013_c(GuiScreenOnlineServers par0GuiScreenOnlineServers) { -+ return par0GuiScreenOnlineServers.field_96192_v; -+ } -+ -+ static void func_140017_d(GuiScreenOnlineServers par0GuiScreenOnlineServers) { -+ par0GuiScreenOnlineServers.func_140012_t(); -+ } -+ -+ static Minecraft func_98076_f(GuiScreenOnlineServers par0GuiScreenOnlineServers) { -+ return par0GuiScreenOnlineServers.mc; -+ } -+ -+ static Minecraft func_140037_f(GuiScreenOnlineServers par0GuiScreenOnlineServers) { -+ return par0GuiScreenOnlineServers.mc; -+ } -+ -+ static long func_140036_b(GuiScreenOnlineServers par0GuiScreenOnlineServers, long par1) { -+ return par0GuiScreenOnlineServers.field_96189_n = par1; -+ } -+ -+ static Minecraft func_140015_g(GuiScreenOnlineServers par0GuiScreenOnlineServers) { -+ return par0GuiScreenOnlineServers.mc; -+ } -+ -+ static GuiButton func_140038_h(GuiScreenOnlineServers par0GuiScreenOnlineServers) { -+ return par0GuiScreenOnlineServers.field_96190_o; -+ } -+ -+ static GuiButton func_140033_i(GuiScreenOnlineServers par0GuiScreenOnlineServers) { -+ return par0GuiScreenOnlineServers.field_96196_r; -+ } -+ -+ static void func_140008_c(GuiScreenOnlineServers par0GuiScreenOnlineServers, long par1) { -+ par0GuiScreenOnlineServers.func_140032_e(par1); -+ } -+ -+ static int func_140027_d(GuiScreenOnlineServers par0GuiScreenOnlineServers, long par1) { -+ return par0GuiScreenOnlineServers.func_140009_c(par1); -+ } -+ -+ static Minecraft func_104032_j(GuiScreenOnlineServers par0GuiScreenOnlineServers) { -+ return par0GuiScreenOnlineServers.mc; -+ } -+ -+ static FontRenderer func_140023_k(GuiScreenOnlineServers par0GuiScreenOnlineServers) { -+ return par0GuiScreenOnlineServers.fontRenderer; -+ } -+ -+ static void func_104031_c(GuiScreenOnlineServers par0GuiScreenOnlineServers, int par1, int par2, int par3, int par4) { -+ par0GuiScreenOnlineServers.func_101008_c(par1, par2, par3, par4); -+ } -+ -+ static void func_140035_b(GuiScreenOnlineServers par0GuiScreenOnlineServers, int par1, int par2, int par3, int par4) { -+ par0GuiScreenOnlineServers.func_101001_e(par1, par2, par3, par4); -+ } -+ -+ static Minecraft func_140014_l(GuiScreenOnlineServers par0GuiScreenOnlineServers) { -+ return par0GuiScreenOnlineServers.mc; -+ } -+ -+ static void func_140031_a(GuiScreenOnlineServers par0GuiScreenOnlineServers, int par1, int par2, int par3, int par4, int par5) { -+ par0GuiScreenOnlineServers.func_104039_b(par1, par2, par3, par4, par5); -+ } -+ -+ static void func_140020_c(GuiScreenOnlineServers par0GuiScreenOnlineServers, int par1, int par2, int par3, int par4) { -+ par0GuiScreenOnlineServers.func_101006_d(par1, par2, par3, par4); -+ } -+ -+ static FontRenderer func_140039_m(GuiScreenOnlineServers par0GuiScreenOnlineServers) { -+ return par0GuiScreenOnlineServers.fontRenderer; -+ } -+ -+ static FontRenderer func_98079_k(GuiScreenOnlineServers par0GuiScreenOnlineServers) { -+ return par0GuiScreenOnlineServers.fontRenderer; - } - - static Object func_140029_i() { -- return e; -+ return field_96185_d; - } - - static int func_140018_j() { -@@ -570,23 +599,23 @@ - return field_96187_c++; - } - -- static void func_140024_a(GuiScreenOnlineServers var0, McoServer var1) throws IOException { -- var0.func_96174_a(var1); -+ static void func_140024_a(GuiScreenOnlineServers par0GuiScreenOnlineServers, McoServer par1McoServer) throws IOException { -+ par0GuiScreenOnlineServers.func_96174_a(par1McoServer); - } - - static int func_140021_r() { - return field_96187_c--; - } - -- static FontRenderer func_110402_q(GuiScreenOnlineServers var0) { -- return var0.fontRenderer; -- } -- -- static FontRenderer func_140010_p(GuiScreenOnlineServers var0) { -- return var0.fontRenderer; -- } -- -- static Minecraft func_142023_q(GuiScreenOnlineServers var0) { -- return var0.mc; -+ static FontRenderer func_110402_q(GuiScreenOnlineServers par0GuiScreenOnlineServers) { -+ return par0GuiScreenOnlineServers.fontRenderer; -+ } -+ -+ static FontRenderer func_140010_p(GuiScreenOnlineServers par0GuiScreenOnlineServers) { -+ return par0GuiScreenOnlineServers.fontRenderer; -+ } -+ -+ static Minecraft func_142023_q(GuiScreenOnlineServers par0GuiScreenOnlineServers) { -+ return par0GuiScreenOnlineServers.mc; - } - } ---- net/minecraft/src/DestroyBlockProgress.java -+++ net/minecraft/src/DestroyBlockProgress.java -@@ -1,18 +1,31 @@ - package net.minecraft.src; - - public class DestroyBlockProgress { -+ -+ /** -+ * entity ID of the player associated with this partially destroyed Block. Used to identify the Blocks in the client -+ * Renderer, max 1 per player on a server -+ */ - private final int miningPlayerEntId; - private final int partialBlockX; - private final int partialBlockY; - private final int partialBlockZ; -+ -+ /** -+ * damage ranges from 1 to 10. -1 causes the client to delete the partial block renderer. -+ */ - private int partialBlockProgress; -+ -+ /** -+ * keeps track of how many ticks this PartiallyDestroyedBlock already exists -+ */ - private int createdAtCloudUpdateTick; - -- public DestroyBlockProgress(int var1, int var2, int var3, int var4) { -- this.miningPlayerEntId = var1; -- this.partialBlockX = var2; -- this.partialBlockY = var3; -- this.partialBlockZ = var4; -+ public DestroyBlockProgress(int par1, int par2, int par3, int par4) { -+ this.miningPlayerEntId = par1; -+ this.partialBlockX = par2; -+ this.partialBlockY = par3; -+ this.partialBlockZ = par4; - } - - public int getPartialBlockX() { -@@ -27,22 +40,32 @@ - return this.partialBlockZ; - } - -- public void setPartialBlockDamage(int var1) { -- if(var1 > 10) { -- var1 = 10; -+ /** -+ * inserts damage value into this partially destroyed Block. -1 causes client renderer to delete it, otherwise ranges -+ * from 1 to 10 -+ */ -+ public void setPartialBlockDamage(int par1) { -+ if (par1 > 10) { -+ par1 = 10; - } - -- this.partialBlockProgress = var1; -+ this.partialBlockProgress = par1; - } - - public int getPartialBlockDamage() { - return this.partialBlockProgress; - } - -- public void setCloudUpdateTick(int var1) { -- this.createdAtCloudUpdateTick = var1; -+ /** -+ * saves the current Cloud update tick into the PartiallyDestroyedBlock -+ */ -+ public void setCloudUpdateTick(int par1) { -+ this.createdAtCloudUpdateTick = par1; - } - -+ /** -+ * retrieves the 'date' at which the PartiallyDestroyedBlock was created -+ */ - public int getCreationCloudUpdateTick() { - return this.createdAtCloudUpdateTick; - } ---- net/minecraft/src/GuiIngameMenu.java -+++ net/minecraft/src/GuiIngameMenu.java -@@ -1,71 +1,112 @@ - package net.minecraft.src; - --import java.util.List; -+// Spout Start -+ -+import org.spoutcraft.client.chunkcache.HeightMapAgent; -+import org.spoutcraft.client.gui.settings.GuiSimpleOptions; -+// Spout End - - public class GuiIngameMenu extends GuiScreen { -+ -+ /** Also counts the number of updates, not certain as to why yet. */ - private int updateCounter2; -+ -+ /** Counts the number of screen updates. */ - private int updateCounter; -+ -+ // Spout Start -+ private boolean fromSingle; - -+ /** -+ * Adds the buttons (and other controls) to the screen in question. -+ */ - public void initGui() { - this.updateCounter2 = 0; -- this.i.clear(); -+ this.buttonList.clear(); - byte var1 = -16; - boolean var2 = true; -- this.i.add(new GuiButton(1, this.width / 2 - 100, this.height / 4 + 120 + var1, I18n.getString("menu.returnToMenu"))); -- if(!this.mc.isIntegratedServerRunning()) { -- ((GuiButton)this.i.get(0)).f = I18n.getString("menu.disconnect"); -+ this.buttonList.add(new GuiButton(1, this.width / 2 - 100, this.height / 4 + 120 + var1, I18n.getString("menu.returnToMenu"))); -+ -+ if (!this.mc.isIntegratedServerRunning()) { -+ ((GuiButton)this.buttonList.get(0)).displayString = I18n.getString("menu.disconnect"); - } - -- this.i.add(new GuiButton(4, this.width / 2 - 100, this.height / 4 + 24 + var1, I18n.getString("menu.returnToGame"))); -- this.i.add(new GuiButton(0, this.width / 2 - 100, this.height / 4 + 96 + var1, 98, 20, I18n.getString("menu.options"))); -- List var10000 = this.i; -- GuiButton var3 = new GuiButton(7, this.width / 2 + 2, this.height / 4 + 96 + var1, 98, 20, I18n.getString("menu.shareToLan")); -- var10000.add(var3); -- this.i.add(new GuiButton(5, this.width / 2 - 100, this.height / 4 + 48 + var1, 98, 20, I18n.getString("gui.achievements"))); -- this.i.add(new GuiButton(6, this.width / 2 + 2, this.height / 4 + 48 + var1, 98, 20, I18n.getString("gui.stats"))); -+ this.buttonList.add(new GuiButton(4, this.width / 2 - 100, this.height / 4 + 24 + var1, I18n.getString("menu.returnToGame"))); -+ this.buttonList.add(new GuiButton(0, this.width / 2 - 100, this.height / 4 + 96 + var1, 98, 20, I18n.getString("menu.options"))); -+ GuiButton var3; -+ this.buttonList.add(var3 = new GuiButton(7, this.width / 2 + 2, this.height / 4 + 96 + var1, 98, 20, I18n.getString("menu.shareToLan"))); -+ this.buttonList.add(new GuiButton(5, this.width / 2 - 100, this.height / 4 + 48 + var1, 98, 20, I18n.getString("gui.achievements"))); -+ this.buttonList.add(new GuiButton(6, this.width / 2 + 2, this.height / 4 + 48 + var1, 98, 20, I18n.getString("gui.stats"))); - var3.enabled = this.mc.isSingleplayer() && !this.mc.getIntegratedServer().getPublic(); - } - -- protected void actionPerformed(GuiButton var1) { -- switch(var1.id) { -- case 0: -- this.mc.displayGuiScreen(new GuiOptions(this, this.mc.gameSettings)); -- break; -- case 1: -- var1.enabled = false; -- this.mc.statFileWriter.readStat(StatList.leaveGameStat, 1); -- this.mc.theWorld.sendQuittingDisconnectingPacket(); -- this.mc.loadWorld((WorldClient)null); -- this.mc.displayGuiScreen(new GuiMainMenu()); -- case 2: -- case 3: -- default: -- break; -- case 4: -- this.mc.displayGuiScreen((GuiScreen)null); -- this.mc.setIngameFocus(); -- this.mc.sndManager.resumeAllSounds(); -- break; -- case 5: -- this.mc.displayGuiScreen(new GuiAchievements(this.mc.statFileWriter)); -- break; -- case 6: -- this.mc.displayGuiScreen(new GuiStats(this, this.mc.statFileWriter)); -- break; -- case 7: -- this.mc.displayGuiScreen(new GuiShareToLan(this)); -+ /** -+ * Fired when a control is clicked. This is the equivalent of ActionListener.actionPerformed(ActionEvent e). -+ */ -+ protected void actionPerformed(GuiButton par1GuiButton) { -+ switch (par1GuiButton.id) { -+ case 0: -+ // Spout Start -+ this.mc.displayGuiScreen(GuiSimpleOptions.constructOptionsScreen(this)); -+ // Spout End -+ break; -+ -+ case 1: -+ // Spout Start -+ if (this.mc.isIntegratedServerRunning()) { -+ fromSingle = true; -+ } -+ HeightMapAgent.save(); -+ // Spout End -+ par1GuiButton.enabled = false; -+ this.mc.statFileWriter.readStat(StatList.leaveGameStat, 1); -+ this.mc.theWorld.sendQuittingDisconnectingPacket(); -+ this.mc.loadWorld((WorldClient)null); -+ // Spout Start -+ if (fromSingle) { -+ this.mc.displayGuiScreen(new GuiSelectWorld(this)); -+ } else { -+ this.mc.displayGuiScreen(new org.spoutcraft.client.gui.server.GuiFavorites(this)); -+ } -+ // Spout End -+ case 2: -+ case 3: -+ default: -+ break; -+ -+ case 4: -+ this.mc.displayGuiScreen((GuiScreen)null); -+ this.mc.setIngameFocus(); -+ this.mc.sndManager.resumeAllSounds(); -+ break; -+ -+ case 5: -+ this.mc.displayGuiScreen(new GuiAchievements(this.mc.statFileWriter)); -+ break; -+ -+ case 6: -+ this.mc.displayGuiScreen(new GuiStats(this, this.mc.statFileWriter)); -+ break; -+ -+ case 7: -+ this.mc.displayGuiScreen(new GuiShareToLan(this)); - } -- - } - -+ /** -+ * Called from the main game loop to update the screen. -+ */ - public void updateScreen() { - super.updateScreen(); - ++this.updateCounter; - } - -- public void drawScreen(int var1, int var2, float var3) { -+ /** -+ * Draws the screen and all the components in it. -+ */ -+ public void drawScreen(int par1, int par2, float par3) { - this.drawDefaultBackground(); - this.drawCenteredString(this.fontRenderer, "Game menu", this.width / 2, 40, 16777215); -- super.drawScreen(var1, var2, var3); -+ super.drawScreen(par1, par2, par3); - } - } ---- net/minecraft/src/WorldGenBigMushroom.java -+++ net/minecraft/src/WorldGenBigMushroom.java -@@ -3,41 +3,48 @@ - import java.util.Random; - - public class WorldGenBigMushroom extends WorldGenerator { -+ -+ /** The mushroom type. 0 for brown, 1 for red. */ - private int mushroomType = -1; - -- public WorldGenBigMushroom(int var1) { -+ public WorldGenBigMushroom(int par1) { - super(true); -- this.mushroomType = var1; -+ this.mushroomType = par1; - } - - public WorldGenBigMushroom() { - super(false); - } - -- public boolean generate(World var1, Random var2, int var3, int var4, int var5) { -- int var6 = var2.nextInt(2); -- if(this.mushroomType >= 0) { -+ public boolean generate(World par1World, Random par2Random, int par3, int par4, int par5) { -+ int var6 = par2Random.nextInt(2); -+ -+ if (this.mushroomType >= 0) { - var6 = this.mushroomType; - } - -- int var7 = var2.nextInt(3) + 4; -+ int var7 = par2Random.nextInt(3) + 4; - boolean var8 = true; -- if(var4 >= 1 && var4 + var7 + 1 < 256) { -+ -+ if (par4 >= 1 && par4 + var7 + 1 < 256) { - int var9; - int var11; - int var12; - int var13; -- for(var9 = var4; var9 <= var4 + 1 + var7; ++var9) { -+ -+ for (var9 = par4; var9 <= par4 + 1 + var7; ++var9) { - byte var10 = 3; -- if(var9 <= var4 + 3) { -+ -+ if (var9 <= par4 + 3) { - var10 = 0; - } - -- for(var11 = var3 - var10; var11 <= var3 + var10 && var8; ++var11) { -- for(var12 = var5 - var10; var12 <= var5 + var10 && var8; ++var12) { -- if(var9 >= 0 && var9 < 256) { -- var13 = var1.getBlockId(var11, var9, var12); -- if(var13 != 0 && var13 != Block.leaves.blockID) { -+ for (var11 = par3 - var10; var11 <= par3 + var10 && var8; ++var11) { -+ for (var12 = par5 - var10; var12 <= par5 + var10 && var8; ++var12) { -+ if (var9 >= 0 && var9 < 256) { -+ var13 = par1World.getBlockId(var11, var9, var12); -+ -+ if (var13 != 0 && var13 != Block.leaves.blockID) { - var8 = false; - } - } else { -@@ -47,100 +54,105 @@ - } - } - -- if(!var8) { -+ if (!var8) { - return false; - } else { -- var9 = var1.getBlockId(var3, var4 - 1, var5); -- if(var9 != Block.dirt.blockID && var9 != Block.grass.blockID && var9 != Block.mycelium.blockID) { -+ var9 = par1World.getBlockId(par3, par4 - 1, par5); -+ -+ if (var9 != Block.dirt.blockID && var9 != Block.grass.blockID && var9 != Block.mycelium.blockID) { - return false; - } else { -- int var16 = var4 + var7; -- if(var6 == 1) { -- var16 = var4 + var7 - 3; -+ int var16 = par4 + var7; -+ -+ if (var6 == 1) { -+ var16 = par4 + var7 - 3; - } - -- for(var11 = var16; var11 <= var4 + var7; ++var11) { -+ for (var11 = var16; var11 <= par4 + var7; ++var11) { - var12 = 1; -- if(var11 < var4 + var7) { -+ -+ if (var11 < par4 + var7) { - ++var12; - } - -- if(var6 == 0) { -+ if (var6 == 0) { - var12 = 3; - } - -- for(var13 = var3 - var12; var13 <= var3 + var12; ++var13) { -- for(int var14 = var5 - var12; var14 <= var5 + var12; ++var14) { -+ for (var13 = par3 - var12; var13 <= par3 + var12; ++var13) { -+ for (int var14 = par5 - var12; var14 <= par5 + var12; ++var14) { - int var15 = 5; -- if(var13 == var3 - var12) { -+ -+ if (var13 == par3 - var12) { - --var15; - } - -- if(var13 == var3 + var12) { -+ if (var13 == par3 + var12) { - ++var15; - } - -- if(var14 == var5 - var12) { -+ if (var14 == par5 - var12) { - var15 -= 3; - } - -- if(var14 == var5 + var12) { -+ if (var14 == par5 + var12) { - var15 += 3; - } - -- if(var6 == 0 || var11 < var4 + var7) { -- if((var13 == var3 - var12 || var13 == var3 + var12) && (var14 == var5 - var12 || var14 == var5 + var12)) { -+ if (var6 == 0 || var11 < par4 + var7) { -+ if ((var13 == par3 - var12 || var13 == par3 + var12) && (var14 == par5 - var12 || var14 == par5 + var12)) { - continue; - } - -- if(var13 == var3 - (var12 - 1) && var14 == var5 - var12) { -- var15 = 1; -- } -- -- if(var13 == var3 - var12 && var14 == var5 - (var12 - 1)) { -- var15 = 1; -- } -- -- if(var13 == var3 + (var12 - 1) && var14 == var5 - var12) { -- var15 = 3; -- } -- -- if(var13 == var3 + var12 && var14 == var5 - (var12 - 1)) { -- var15 = 3; -- } -- -- if(var13 == var3 - (var12 - 1) && var14 == var5 + var12) { -- var15 = 7; -- } -- -- if(var13 == var3 - var12 && var14 == var5 + (var12 - 1)) { -- var15 = 7; -- } -- -- if(var13 == var3 + (var12 - 1) && var14 == var5 + var12) { -+ if (var13 == par3 - (var12 - 1) && var14 == par5 - var12) { -+ var15 = 1; -+ } -+ -+ if (var13 == par3 - var12 && var14 == par5 - (var12 - 1)) { -+ var15 = 1; -+ } -+ -+ if (var13 == par3 + (var12 - 1) && var14 == par5 - var12) { -+ var15 = 3; -+ } -+ -+ if (var13 == par3 + var12 && var14 == par5 - (var12 - 1)) { -+ var15 = 3; -+ } -+ -+ if (var13 == par3 - (var12 - 1) && var14 == par5 + var12) { -+ var15 = 7; -+ } -+ -+ if (var13 == par3 - var12 && var14 == par5 + (var12 - 1)) { -+ var15 = 7; -+ } -+ -+ if (var13 == par3 + (var12 - 1) && var14 == par5 + var12) { - var15 = 9; - } - -- if(var13 == var3 + var12 && var14 == var5 + (var12 - 1)) { -+ if (var13 == par3 + var12 && var14 == par5 + (var12 - 1)) { - var15 = 9; - } - } - -- if(var15 == 5 && var11 < var4 + var7) { -+ if (var15 == 5 && var11 < par4 + var7) { - var15 = 0; - } - -- if((var15 != 0 || var4 >= var4 + var7 - 1) && !Block.opaqueCubeLookup[var1.getBlockId(var13, var11, var14)]) { -- this.setBlockAndMetadata(var1, var13, var11, var14, Block.mushroomCapBrown.blockID + var6, var15); -+ if ((var15 != 0 || par4 >= par4 + var7 - 1) && !Block.opaqueCubeLookup[par1World.getBlockId(var13, var11, var14)]) { -+ this.setBlockAndMetadata(par1World, var13, var11, var14, Block.mushroomCapBrown.blockID + var6, var15); - } - } - } - } - -- for(var11 = 0; var11 < var7; ++var11) { -- var12 = var1.getBlockId(var3, var4 + var11, var5); -- if(!Block.opaqueCubeLookup[var12]) { -- this.setBlockAndMetadata(var1, var3, var4 + var11, var5, Block.mushroomCapBrown.blockID + var6, 10); -+ for (var11 = 0; var11 < var7; ++var11) { -+ var12 = par1World.getBlockId(par3, par4 + var11, par5); -+ -+ if (!Block.opaqueCubeLookup[var12]) { -+ this.setBlockAndMetadata(par1World, par3, par4 + var11, par5, Block.mushroomCapBrown.blockID + var6, 10); - } - } - ---- net/minecraft/src/ThreadConnectToServer.java -+++ net/minecraft/src/ThreadConnectToServer.java -@@ -4,44 +4,73 @@ - import java.net.UnknownHostException; - - class ThreadConnectToServer extends Thread { -- final String a; -+ -+ /** The IP address or domain used to connect. */ -+ final String ip; -+ -+ /** The port used to connect. */ - final int port; -+ -+ /** A reference to the GuiConnecting object. */ - final GuiConnecting connectingGui; - -- ThreadConnectToServer(GuiConnecting var1, String var2, int var3) { -- this.connectingGui = var1; -- this.a = var2; -- this.port = var3; -+ ThreadConnectToServer(GuiConnecting par1GuiConnecting, String par2Str, int par3) { -+ this.connectingGui = par1GuiConnecting; -+ this.ip = par2Str; -+ this.port = par3; - } - - public void run() { - try { -- GuiConnecting.setNetClientHandler(this.connectingGui, new NetClientHandler(GuiConnecting.func_74256_a(this.connectingGui), this.a, this.port)); -- if(GuiConnecting.isCancelled(this.connectingGui)) { -+ GuiConnecting.setNetClientHandler(this.connectingGui, new NetClientHandler(GuiConnecting.func_74256_a(this.connectingGui), this.ip, this.port)); -+ -+ if (GuiConnecting.isCancelled(this.connectingGui)) { - return; - } - -- GuiConnecting.getNetClientHandler(this.connectingGui).addToSendQueue(new Packet2ClientProtocol(78, GuiConnecting.func_74254_c(this.connectingGui).getSession().getUsername(), this.a, this.port)); -+ // Spout Start -+ GuiConnecting.getNetClientHandler(this.connectingGui).addToSendQueue(new Packet250CustomPayload("REGISTER", "AutoProto:HShake".getBytes())); -+ GuiConnecting.getNetClientHandler(this.connectingGui).addToSendQueue(new Packet250CustomPayload("REGISTER", "ChkCache:setHash".getBytes())); -+ GuiConnecting.getNetClientHandler(this.connectingGui).addToSendQueue(new Packet250CustomPayload("AutoProto:HShake", "VanillaProtocol".getBytes())); -+ // Spout End -+ GuiConnecting.getNetClientHandler(this.connectingGui).addToSendQueue(new Packet2ClientProtocol(78, GuiConnecting.func_74254_c(this.connectingGui).getSession().getUsername(), this.ip, this.port)); - } catch (UnknownHostException var2) { -- if(GuiConnecting.isCancelled(this.connectingGui)) { -+ if (GuiConnecting.isCancelled(this.connectingGui)) { - return; - } - -- GuiConnecting.func_74250_f(this.connectingGui).displayGuiScreen(new GuiDisconnected(GuiConnecting.func_98097_e(this.connectingGui), "connect.failed", "disconnect.genericReason", new Object[]{"Unknown host \'" + this.a + "\'"})); -+ // Spout Start -+ displayConnectionIssue(ip, port, "Unknown host \'" + this.ip + "\'"); -+ // Spout End - } catch (ConnectException var3) { -- if(GuiConnecting.isCancelled(this.connectingGui)) { -+ if (GuiConnecting.isCancelled(this.connectingGui)) { - return; - } - -- GuiConnecting.func_74251_g(this.connectingGui).displayGuiScreen(new GuiDisconnected(GuiConnecting.func_98097_e(this.connectingGui), "connect.failed", "disconnect.genericReason", new Object[]{var3.getMessage()})); -+ // Spout Start -+ if (var3.getMessage().toLowerCase().contains("connection refused")) { -+ displayConnectionIssue(ip, port, "The server is not currently online!"); -+ } else { -+ displayConnectionIssue(ip, port, var3.getMessage()); -+ } -+ // Spout End - } catch (Exception var4) { -- if(GuiConnecting.isCancelled(this.connectingGui)) { -+ if (GuiConnecting.isCancelled(this.connectingGui)) { - return; - } - - var4.printStackTrace(); -- GuiConnecting.func_98096_h(this.connectingGui).displayGuiScreen(new GuiDisconnected(GuiConnecting.func_98097_e(this.connectingGui), "connect.failed", "disconnect.genericReason", new Object[]{var4.toString()})); -+ // Spout Start -+ displayConnectionIssue(ip, port, var4.toString()); -+ // Spout End - } -+ } - -+ // Spout Start -+ private void displayConnectionIssue(String ip, int port, String message) { -+ org.spoutcraft.client.gui.error.GuiConnectionLost.lastServerIp = ip; -+ org.spoutcraft.client.gui.error.GuiConnectionLost.lastServerPort = port; -+ Minecraft.getMinecraft().displayGuiScreen(new org.spoutcraft.client.gui.error.GuiConnectionLost(message)); - } -+ // Spout End - } ---- net/minecraft/src/BiomeGenBeach.java -+++ net/minecraft/src/BiomeGenBeach.java -@@ -1,9 +1,9 @@ - package net.minecraft.src; - - public class BiomeGenBeach extends BiomeGenBase { -- public BiomeGenBeach(int var1) { -- super(var1); -- this.K.clear(); -+ public BiomeGenBeach(int par1) { -+ super(par1); -+ this.spawnableCreatureList.clear(); - this.topBlock = (byte)Block.sand.blockID; - this.fillerBlock = (byte)Block.sand.blockID; - this.theBiomeDecorator.treesPerChunk = -999; ---- /dev/null -+++ org/spoutcraft/client/packet/PacketComboBox.java -@@ -1,0 +1,83 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.client.packet; -+ -+import java.io.IOException; -+import java.util.UUID; -+ -+import org.spoutcraft.api.gui.GenericComboBox; -+import org.spoutcraft.api.gui.Widget; -+import org.spoutcraft.api.io.SpoutInputStream; -+import org.spoutcraft.api.io.SpoutOutputStream; -+import org.spoutcraft.client.SpoutClient; -+ -+public class PacketComboBox implements SpoutPacket { -+ private GenericComboBox box; -+ private UUID uuid; -+ private boolean open; -+ private int selection; -+ -+ public PacketComboBox() { -+ } -+ -+ public PacketComboBox(GenericComboBox box) { -+ this.box = box; -+ this.uuid = box.getId(); -+ this.open = box.isOpen(); -+ this.selection = box.getSelectedRow(); -+ } -+ -+ public int getNumBytes() { -+ return 8 + 8 + 1 + 4; -+ } -+ public void readData(SpoutInputStream input) throws IOException { -+ uuid = new UUID(input.readLong(), input.readLong()); -+ open = input.readBoolean(); -+ selection = input.readInt(); -+ } -+ -+ public void writeData(SpoutOutputStream output) throws IOException { -+ output.writeLong(uuid.getMostSignificantBits()); -+ output.writeLong(uuid.getLeastSignificantBits()); -+ output.writeBoolean(open); -+ output.writeInt(selection); -+ } -+ -+ public void run(int playerId) { -+ if (SpoutClient.getInstance().getActivePlayer().getMainScreen().getActivePopup() != null) { -+ Widget w = SpoutClient.getInstance().getActivePlayer().getMainScreen().getActivePopup().getWidget(uuid); -+ if (w != null && w instanceof GenericComboBox) { -+ box = (GenericComboBox) w; -+ box.setOpen(open); -+ box.setSelection(selection); -+ } -+ } -+ } -+ -+ public void failure(int playerId) {} -+ -+ public PacketType getPacketType() { -+ return PacketType.PacketComboBox; -+ } -+ -+ public int getVersion() { -+ return 0; -+ } -+} ---- net/minecraft/src/EntityReddustFX.java -+++ net/minecraft/src/EntityReddustFX.java -@@ -1,69 +1,89 @@ - package net.minecraft.src; - -+// MCPatcher Start -+import com.prupe.mcpatcher.cc.ColorizeBlock; -+import com.prupe.mcpatcher.cc.Colorizer; -+// MCPatcher End -+ - public class EntityReddustFX extends EntityFX { - float reddustParticleScale; - -- public EntityReddustFX(World var1, double var2, double var4, double var6, float var8, float var9, float var10) { -- this(var1, var2, var4, var6, 1.0F, var8, var9, var10); -+ public EntityReddustFX(World par1World, double par2, double par4, double par6, float par8, float par9, float par10) { -+ this(par1World, par2, par4, par6, 1.0F, par8, par9, par10); - } - -- public EntityReddustFX(World var1, double var2, double var4, double var6, float var8, float var9, float var10, float var11) { -- super(var1, var2, var4, var6, 0.0D, 0.0D, 0.0D); -- this.motionX *= (double)0.1F; -- this.motionY *= (double)0.1F; -- this.motionZ *= (double)0.1F; -- if(var9 == 0.0F) { -- var9 = 1.0F; -+ public EntityReddustFX(World par1World, double par2, double par4, double par6, float par8, float par9, float par10, float par11) { -+ super(par1World, par2, par4, par6, 0.0D, 0.0D, 0.0D); -+ this.motionX *= 0.10000000149011612D; -+ this.motionY *= 0.10000000149011612D; -+ this.motionZ *= 0.10000000149011612D; -+ -+ if (par9 == 0.0F) { -+ par9 = 1.0F; -+ -+ // MCPatcher Start -+ if (ColorizeBlock.computeRedstoneWireColor(15)) { -+ par9 = Colorizer.setColor[0]; -+ par10 = Colorizer.setColor[1]; -+ par11 = Colorizer.setColor[2]; -+ } -+ // MCPatcher End - } - - float var12 = (float)Math.random() * 0.4F + 0.6F; -- this.particleRed = ((float)(Math.random() * (double)0.2F) + 0.8F) * var9 * var12; -- this.particleGreen = ((float)(Math.random() * (double)0.2F) + 0.8F) * var10 * var12; -- this.particleBlue = ((float)(Math.random() * (double)0.2F) + 0.8F) * var11 * var12; -- this.particleScale *= 12.0F / 16.0F; -- this.particleScale *= var8; -+ this.particleRed = ((float)(Math.random() * 0.20000000298023224D) + 0.8F) * par9 * var12; -+ this.particleGreen = ((float)(Math.random() * 0.20000000298023224D) + 0.8F) * par10 * var12; -+ this.particleBlue = ((float)(Math.random() * 0.20000000298023224D) + 0.8F) * par11 * var12; -+ this.particleScale *= 0.75F; -+ this.particleScale *= par8; - this.reddustParticleScale = this.particleScale; - this.particleMaxAge = (int)(8.0D / (Math.random() * 0.8D + 0.2D)); -- this.particleMaxAge = (int)((float)this.particleMaxAge * var8); -+ this.particleMaxAge = (int)((float)this.particleMaxAge * par8); - this.noClip = false; - } - -- public void renderParticle(Tessellator var1, float var2, float var3, float var4, float var5, float var6, float var7) { -- float var8 = ((float)this.particleAge + var2) / (float)this.particleMaxAge * 32.0F; -- if(var8 < 0.0F) { -+ public void renderParticle(Tessellator par1Tessellator, float par2, float par3, float par4, float par5, float par6, float par7) { -+ float var8 = ((float)this.particleAge + par2) / (float)this.particleMaxAge * 32.0F; -+ -+ if (var8 < 0.0F) { - var8 = 0.0F; - } - -- if(var8 > 1.0F) { -+ if (var8 > 1.0F) { - var8 = 1.0F; - } - - this.particleScale = this.reddustParticleScale * var8; -- super.renderParticle(var1, var2, var3, var4, var5, var6, var7); -+ super.renderParticle(par1Tessellator, par2, par3, par4, par5, par6, par7); - } - -+ /** -+ * Called to update the entity's position/logic. -+ */ - public void onUpdate() { - this.prevPosX = this.posX; - this.prevPosY = this.posY; - this.prevPosZ = this.posZ; -- if(this.particleAge++ >= this.particleMaxAge) { -+ -+ if (this.particleAge++ >= this.particleMaxAge) { - this.setDead(); - } - - this.setParticleTextureIndex(7 - this.particleAge * 8 / this.particleMaxAge); - this.moveEntity(this.motionX, this.motionY, this.motionZ); -- if(this.posY == this.prevPosY) { -+ -+ if (this.posY == this.prevPosY) { - this.motionX *= 1.1D; - this.motionZ *= 1.1D; - } - -- this.motionX *= (double)0.96F; -- this.motionY *= (double)0.96F; -- this.motionZ *= (double)0.96F; -- if(this.onGround) { -- this.motionX *= (double)0.7F; -- this.motionZ *= (double)0.7F; -- } -+ this.motionX *= 0.9599999785423279D; -+ this.motionY *= 0.9599999785423279D; -+ this.motionZ *= 0.9599999785423279D; - -+ if (this.onGround) { -+ this.motionX *= 0.699999988079071D; -+ this.motionZ *= 0.699999988079071D; -+ } - } - } ---- /dev/null -+++ org/spoutcraft/api/material/item/GenericItem.java -@@ -1,0 +1,72 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.api.material.item; -+ -+import org.spoutcraft.api.material.Item; -+ -+public class GenericItem implements Item { -+ private final int id; -+ private final int data; -+ private final boolean subtypes; -+ private final String name; -+ private String customName; -+ -+ public GenericItem(String name, int id, int data, boolean subtypes) { -+ this.name = name; -+ this.id = id; -+ this.data = data; -+ this.subtypes = subtypes; -+ } -+ -+ public GenericItem(String name, int id, int data) { -+ this(name, id, data, false); -+ } -+ -+ public GenericItem(String name, int id) { -+ this(name, id, 0, false); -+ } -+ -+ public int getRawId() { -+ return id; -+ } -+ -+ public int getRawData() { -+ return data; -+ } -+ -+ public boolean hasSubtypes() { -+ return subtypes; -+ } -+ -+ public String getName() { -+ if (customName != null) { -+ return customName; -+ } -+ return name; -+ } -+ -+ public String getNotchianName() { -+ return name; -+ } -+ -+ public void setName(String name) { -+ this.customName = name; -+ } -+} ---- net/minecraft/src/IconFlipped.java -+++ net/minecraft/src/IconFlipped.java -@@ -5,44 +5,68 @@ - private final boolean flipU; - private final boolean flipV; - -- public IconFlipped(Icon var1, boolean var2, boolean var3) { -- this.baseIcon = var1; -- this.flipU = var2; -- this.flipV = var3; -+ public IconFlipped(Icon par1Icon, boolean par2, boolean par3) { -+ this.baseIcon = par1Icon; -+ this.flipU = par2; -+ this.flipV = par3; - } - -+ /** -+ * Returns the width of the icon, in pixels. -+ */ - public int getIconWidth() { - return this.baseIcon.getIconWidth(); - } - -+ /** -+ * Returns the height of the icon, in pixels. -+ */ - public int getIconHeight() { - return this.baseIcon.getIconHeight(); - } - -+ /** -+ * Returns the minimum U coordinate to use when rendering with this icon. -+ */ - public float getMinU() { - return this.flipU ? this.baseIcon.getMaxU() : this.baseIcon.getMinU(); - } - -+ /** -+ * Returns the maximum U coordinate to use when rendering with this icon. -+ */ - public float getMaxU() { - return this.flipU ? this.baseIcon.getMinU() : this.baseIcon.getMaxU(); - } - -- public float getInterpolatedU(double var1) { -+ /** -+ * Gets a U coordinate on the icon. 0 returns uMin and 16 returns uMax. Other arguments return in-between values. -+ */ -+ public float getInterpolatedU(double par1) { - float var3 = this.getMaxU() - this.getMinU(); -- return this.getMinU() + var3 * ((float)var1 / 16.0F); -+ return this.getMinU() + var3 * ((float)par1 / 16.0F); - } - -+ /** -+ * Returns the minimum V coordinate to use when rendering with this icon. -+ */ - public float getMinV() { - return this.flipV ? this.baseIcon.getMinV() : this.baseIcon.getMinV(); - } - -+ /** -+ * Returns the maximum V coordinate to use when rendering with this icon. -+ */ - public float getMaxV() { - return this.flipV ? this.baseIcon.getMinV() : this.baseIcon.getMaxV(); - } - -- public float getInterpolatedV(double var1) { -+ /** -+ * Gets a V coordinate on the icon. 0 returns vMin and 16 returns vMax. Other arguments return in-between values. -+ */ -+ public float getInterpolatedV(double par1) { - float var3 = this.getMaxV() - this.getMinV(); -- return this.getMinV() + var3 * ((float)var1 / 16.0F); -+ return this.getMinV() + var3 * ((float)par1 / 16.0F); - } - - public String getIconName() { ---- net/minecraft/src/ModelBat.java -+++ net/minecraft/src/ModelBat.java -@@ -2,10 +2,20 @@ - - public class ModelBat extends ModelBase { - private ModelRenderer batHead; -+ -+ /** The body box of the bat model. */ - private ModelRenderer batBody; -+ -+ /** The inner right wing box of the bat model. */ - private ModelRenderer batRightWing; -+ -+ /** The inner left wing box of the bat model. */ - private ModelRenderer batLeftWing; -+ -+ /** The outer right wing box of the bat model. */ - private ModelRenderer batOuterRightWing; -+ -+ /** The outer left wing box of the bat model. */ - private ModelRenderer batOuterLeftWing; - - public ModelBat() { -@@ -41,45 +51,53 @@ - this.batLeftWing.addChild(this.batOuterLeftWing); - } - -+ /** -+ * not actually sure this is size, is not used as of now, but the model would be recreated if the value changed and it -+ * seems a good match for a bats size -+ */ - public int getBatSize() { - return 36; - } - -- public void render(Entity var1, float var2, float var3, float var4, float var5, float var6, float var7) { -- EntityBat var8 = (EntityBat)var1; -+ /** -+ * Sets the models various rotation angles then renders the model. -+ */ -+ public void render(Entity par1Entity, float par2, float par3, float par4, float par5, float par6, float par7) { -+ EntityBat var8 = (EntityBat)par1Entity; - float var9; -- if(var8.getIsBatHanging()) { -- var9 = 180.0F / (float)Math.PI; -- this.batHead.rotateAngleX = var6 / (180.0F / (float)Math.PI); -- this.batHead.rotateAngleY = (float)Math.PI - var5 / (180.0F / (float)Math.PI); -+ -+ if (var8.getIsBatHanging()) { -+ var9 = (180F / (float)Math.PI); -+ this.batHead.rotateAngleX = par6 / (180F / (float)Math.PI); -+ this.batHead.rotateAngleY = (float)Math.PI - par5 / (180F / (float)Math.PI); - this.batHead.rotateAngleZ = (float)Math.PI; - this.batHead.setRotationPoint(0.0F, -2.0F, 0.0F); - this.batRightWing.setRotationPoint(-3.0F, 0.0F, 3.0F); - this.batLeftWing.setRotationPoint(3.0F, 0.0F, 3.0F); - this.batBody.rotateAngleX = (float)Math.PI; -- this.batRightWing.rotateAngleX = (float)Math.PI * -0.05F; -- this.batRightWing.rotateAngleY = (float)Math.PI * -0.4F; -- this.batOuterRightWing.rotateAngleY = (float)Math.PI * -0.55F; -+ this.batRightWing.rotateAngleX = -0.15707964F; -+ this.batRightWing.rotateAngleY = -((float)Math.PI * 2F / 5F); -+ this.batOuterRightWing.rotateAngleY = -1.7278761F; - this.batLeftWing.rotateAngleX = this.batRightWing.rotateAngleX; - this.batLeftWing.rotateAngleY = -this.batRightWing.rotateAngleY; - this.batOuterLeftWing.rotateAngleY = -this.batOuterRightWing.rotateAngleY; - } else { -- var9 = 180.0F / (float)Math.PI; -- this.batHead.rotateAngleX = var6 / (180.0F / (float)Math.PI); -- this.batHead.rotateAngleY = var5 / (180.0F / (float)Math.PI); -+ var9 = (180F / (float)Math.PI); -+ this.batHead.rotateAngleX = par6 / (180F / (float)Math.PI); -+ this.batHead.rotateAngleY = par5 / (180F / (float)Math.PI); - this.batHead.rotateAngleZ = 0.0F; - this.batHead.setRotationPoint(0.0F, 0.0F, 0.0F); - this.batRightWing.setRotationPoint(0.0F, 0.0F, 0.0F); - this.batLeftWing.setRotationPoint(0.0F, 0.0F, 0.0F); -- this.batBody.rotateAngleX = (float)Math.PI * 0.25F + MathHelper.cos(var4 * 0.1F) * 0.15F; -+ this.batBody.rotateAngleX = ((float)Math.PI / 4F) + MathHelper.cos(par4 * 0.1F) * 0.15F; - this.batBody.rotateAngleY = 0.0F; -- this.batRightWing.rotateAngleY = MathHelper.cos(var4 * 1.3F) * (float)Math.PI * 0.25F; -+ this.batRightWing.rotateAngleY = MathHelper.cos(par4 * 1.3F) * (float)Math.PI * 0.25F; - this.batLeftWing.rotateAngleY = -this.batRightWing.rotateAngleY; - this.batOuterRightWing.rotateAngleY = this.batRightWing.rotateAngleY * 0.5F; - this.batOuterLeftWing.rotateAngleY = -this.batRightWing.rotateAngleY * 0.5F; - } - -- this.batHead.render(var7); -- this.batBody.render(var7); -+ this.batHead.render(par7); -+ this.batBody.render(par7); - } - } ---- net/minecraft/src/DispenserBehaviorFireball.java -+++ net/minecraft/src/DispenserBehaviorFireball.java -@@ -3,23 +3,30 @@ - import java.util.Random; - - final class DispenserBehaviorFireball extends BehaviorDefaultDispenseItem { -- public ItemStack dispenseStack(IBlockSource var1, ItemStack var2) { -- EnumFacing var3 = BlockDispenser.getFacing(var1.getBlockMetadata()); -- IPosition var4 = BlockDispenser.getIPositionFromBlockSource(var1); -+ -+ /** -+ * Dispense the specified stack, play the dispense sound and spawn particles. -+ */ -+ public ItemStack dispenseStack(IBlockSource par1IBlockSource, ItemStack par2ItemStack) { -+ EnumFacing var3 = BlockDispenser.getFacing(par1IBlockSource.getBlockMetadata()); -+ IPosition var4 = BlockDispenser.getIPositionFromBlockSource(par1IBlockSource); - double var5 = var4.getX() + (double)((float)var3.getFrontOffsetX() * 0.3F); - double var7 = var4.getY() + (double)((float)var3.getFrontOffsetX() * 0.3F); - double var9 = var4.getZ() + (double)((float)var3.getFrontOffsetZ() * 0.3F); -- World var11 = var1.getWorld(); -- Random var12 = var11.s; -+ World var11 = par1IBlockSource.getWorld(); -+ Random var12 = var11.rand; - double var13 = var12.nextGaussian() * 0.05D + (double)var3.getFrontOffsetX(); - double var15 = var12.nextGaussian() * 0.05D + (double)var3.getFrontOffsetY(); - double var17 = var12.nextGaussian() * 0.05D + (double)var3.getFrontOffsetZ(); - var11.spawnEntityInWorld(new EntitySmallFireball(var11, var5, var7, var9, var13, var15, var17)); -- var2.splitStack(1); -- return var2; -+ par2ItemStack.splitStack(1); -+ return par2ItemStack; - } - -- protected void playDispenseSound(IBlockSource var1) { -- var1.getWorld().playAuxSFX(1009, var1.getXInt(), var1.getYInt(), var1.getZInt(), 0); -+ /** -+ * Play the dispense sound from the specified block. -+ */ -+ protected void playDispenseSound(IBlockSource par1IBlockSource) { -+ par1IBlockSource.getWorld().playAuxSFX(1009, par1IBlockSource.getXInt(), par1IBlockSource.getYInt(), par1IBlockSource.getZInt(), 0); - } - } ---- net/minecraft/src/BiomeGenSnow.java -+++ net/minecraft/src/BiomeGenSnow.java -@@ -1,7 +1,7 @@ - package net.minecraft.src; - - public class BiomeGenSnow extends BiomeGenBase { -- public BiomeGenSnow(int var1) { -- super(var1); -+ public BiomeGenSnow(int par1) { -+ super(par1); - } - } ---- net/minecraft/src/ScreenChatOptions.java -+++ net/minecraft/src/ScreenChatOptions.java -@@ -1,40 +1,50 @@ - package net.minecraft.src; - - public class ScreenChatOptions extends GuiScreen { -- private static final EnumOptions[] allScreenChatOptions = new EnumOptions[]{EnumOptions.CHAT_VISIBILITY, EnumOptions.CHAT_COLOR, EnumOptions.CHAT_LINKS, EnumOptions.CHAT_OPACITY, EnumOptions.CHAT_LINKS_PROMPT, EnumOptions.CHAT_SCALE, EnumOptions.CHAT_HEIGHT_FOCUSED, EnumOptions.CHAT_HEIGHT_UNFOCUSED, EnumOptions.CHAT_WIDTH}; -- private static final EnumOptions[] allMultiplayerOptions = new EnumOptions[]{EnumOptions.SHOW_CAPE}; -+ -+ /** An array of all EnumOptions which are to do with chat. */ -+ private static final EnumOptions[] allScreenChatOptions = new EnumOptions[] {EnumOptions.CHAT_VISIBILITY, EnumOptions.CHAT_COLOR, EnumOptions.CHAT_LINKS, EnumOptions.CHAT_OPACITY, EnumOptions.CHAT_LINKS_PROMPT, EnumOptions.CHAT_SCALE, EnumOptions.CHAT_HEIGHT_FOCUSED, EnumOptions.CHAT_HEIGHT_UNFOCUSED, EnumOptions.CHAT_WIDTH}; -+ private static final EnumOptions[] allMultiplayerOptions = new EnumOptions[] {EnumOptions.SHOW_CAPE}; -+ -+ /** Instance of GuiScreen. */ - private final GuiScreen theGuiScreen; -+ -+ /** Instance of GameSettings file. */ - private final GameSettings theSettings; -- private String e; -- private String p; -+ private String theChatOptions; -+ private String field_82268_n; - private int field_82269_o; - -- public ScreenChatOptions(GuiScreen var1, GameSettings var2) { -- this.theGuiScreen = var1; -- this.theSettings = var2; -+ public ScreenChatOptions(GuiScreen par1GuiScreen, GameSettings par2GameSettings) { -+ this.theGuiScreen = par1GuiScreen; -+ this.theSettings = par2GameSettings; - } - -+ /** -+ * Adds the buttons (and other controls) to the screen in question. -+ */ - public void initGui() { - int var1 = 0; -- this.e = I18n.getString("options.chat.title"); -- this.p = I18n.getString("options.multiplayer.title"); -+ this.theChatOptions = I18n.getString("options.chat.title"); -+ this.field_82268_n = I18n.getString("options.multiplayer.title"); - EnumOptions[] var2 = allScreenChatOptions; - int var3 = var2.length; -- - int var4; - EnumOptions var5; -- for(var4 = 0; var4 < var3; ++var4) { -+ -+ for (var4 = 0; var4 < var3; ++var4) { - var5 = var2[var4]; -- if(var5.getEnumFloat()) { -- this.i.add(new GuiSlider(var5.returnEnumOrdinal(), this.width / 2 - 155 + var1 % 2 * 160, this.height / 6 + 24 * (var1 >> 1), var5, this.theSettings.getKeyBinding(var5), this.theSettings.getOptionFloatValue(var5))); -+ -+ if (var5.getEnumFloat()) { -+ this.buttonList.add(new GuiSlider(var5.returnEnumOrdinal(), this.width / 2 - 155 + var1 % 2 * 160, this.height / 6 + 24 * (var1 >> 1), var5, this.theSettings.getKeyBinding(var5), this.theSettings.getOptionFloatValue(var5))); - } else { -- this.i.add(new GuiSmallButton(var5.returnEnumOrdinal(), this.width / 2 - 155 + var1 % 2 * 160, this.height / 6 + 24 * (var1 >> 1), var5, this.theSettings.getKeyBinding(var5))); -+ this.buttonList.add(new GuiSmallButton(var5.returnEnumOrdinal(), this.width / 2 - 155 + var1 % 2 * 160, this.height / 6 + 24 * (var1 >> 1), var5, this.theSettings.getKeyBinding(var5))); - } - - ++var1; - } - -- if(var1 % 2 == 1) { -+ if (var1 % 2 == 1) { - ++var1; - } - -@@ -43,39 +53,45 @@ - var2 = allMultiplayerOptions; - var3 = var2.length; - -- for(var4 = 0; var4 < var3; ++var4) { -+ for (var4 = 0; var4 < var3; ++var4) { - var5 = var2[var4]; -- if(var5.getEnumFloat()) { -- this.i.add(new GuiSlider(var5.returnEnumOrdinal(), this.width / 2 - 155 + var1 % 2 * 160, this.height / 6 + 24 * (var1 >> 1), var5, this.theSettings.getKeyBinding(var5), this.theSettings.getOptionFloatValue(var5))); -+ -+ if (var5.getEnumFloat()) { -+ this.buttonList.add(new GuiSlider(var5.returnEnumOrdinal(), this.width / 2 - 155 + var1 % 2 * 160, this.height / 6 + 24 * (var1 >> 1), var5, this.theSettings.getKeyBinding(var5), this.theSettings.getOptionFloatValue(var5))); - } else { -- this.i.add(new GuiSmallButton(var5.returnEnumOrdinal(), this.width / 2 - 155 + var1 % 2 * 160, this.height / 6 + 24 * (var1 >> 1), var5, this.theSettings.getKeyBinding(var5))); -+ this.buttonList.add(new GuiSmallButton(var5.returnEnumOrdinal(), this.width / 2 - 155 + var1 % 2 * 160, this.height / 6 + 24 * (var1 >> 1), var5, this.theSettings.getKeyBinding(var5))); - } - - ++var1; - } - -- this.i.add(new GuiButton(200, this.width / 2 - 100, this.height / 6 + 168, I18n.getString("gui.done"))); -+ this.buttonList.add(new GuiButton(200, this.width / 2 - 100, this.height / 6 + 168, I18n.getString("gui.done"))); - } - -- protected void actionPerformed(GuiButton var1) { -- if(var1.enabled) { -- if(var1.id < 100 && var1 instanceof GuiSmallButton) { -- this.theSettings.setOptionValue(((GuiSmallButton)var1).returnEnumOptions(), 1); -- var1.f = this.theSettings.getKeyBinding(EnumOptions.getEnumOptions(var1.id)); -+ /** -+ * Fired when a control is clicked. This is the equivalent of ActionListener.actionPerformed(ActionEvent e). -+ */ -+ protected void actionPerformed(GuiButton par1GuiButton) { -+ if (par1GuiButton.enabled) { -+ if (par1GuiButton.id < 100 && par1GuiButton instanceof GuiSmallButton) { -+ this.theSettings.setOptionValue(((GuiSmallButton)par1GuiButton).returnEnumOptions(), 1); -+ par1GuiButton.displayString = this.theSettings.getKeyBinding(EnumOptions.getEnumOptions(par1GuiButton.id)); - } - -- if(var1.id == 200) { -+ if (par1GuiButton.id == 200) { - this.mc.gameSettings.saveOptions(); - this.mc.displayGuiScreen(this.theGuiScreen); - } -- - } - } - -- public void drawScreen(int var1, int var2, float var3) { -+ /** -+ * Draws the screen and all the components in it. -+ */ -+ public void drawScreen(int par1, int par2, float par3) { - this.drawDefaultBackground(); -- this.drawCenteredString(this.fontRenderer, this.e, this.width / 2, 20, 16777215); -- this.drawCenteredString(this.fontRenderer, this.p, this.width / 2, this.field_82269_o + 7, 16777215); -- super.drawScreen(var1, var2, var3); -+ this.drawCenteredString(this.fontRenderer, this.theChatOptions, this.width / 2, 20, 16777215); -+ this.drawCenteredString(this.fontRenderer, this.field_82268_n, this.width / 2, this.field_82269_o + 7, 16777215); -+ super.drawScreen(par1, par2, par3); - } - } ---- net/minecraft/src/EntityLargeExplodeFX.java -+++ net/minecraft/src/EntityLargeExplodeFX.java -@@ -6,59 +6,65 @@ - private static final ResourceLocation field_110127_a = new ResourceLocation("textures/entity/explosion.png"); - private int field_70581_a; - private int field_70584_aq; -+ -+ /** The Rendering Engine. */ - private TextureManager theRenderEngine; - private float field_70582_as; - -- public EntityLargeExplodeFX(TextureManager var1, World var2, double var3, double var5, double var7, double var9, double var11, double var13) { -- super(var2, var3, var5, var7, 0.0D, 0.0D, 0.0D); -- this.theRenderEngine = var1; -- this.field_70584_aq = 6 + this.ab.nextInt(4); -- this.particleRed = this.particleGreen = this.particleBlue = this.ab.nextFloat() * 0.6F + 0.4F; -- this.field_70582_as = 1.0F - (float)var9 * 0.5F; -+ public EntityLargeExplodeFX(TextureManager par1TextureManager, World par2World, double par3, double par5, double par7, double par9, double par11, double par13) { -+ super(par2World, par3, par5, par7, 0.0D, 0.0D, 0.0D); -+ this.theRenderEngine = par1TextureManager; -+ this.field_70584_aq = 6 + this.rand.nextInt(4); -+ this.particleRed = this.particleGreen = this.particleBlue = this.rand.nextFloat() * 0.6F + 0.4F; -+ this.field_70582_as = 1.0F - (float)par9 * 0.5F; - } - -- public void renderParticle(Tessellator var1, float var2, float var3, float var4, float var5, float var6, float var7) { -- int var8 = (int)(((float)this.field_70581_a + var2) * 15.0F / (float)this.field_70584_aq); -- if(var8 <= 15) { -+ public void renderParticle(Tessellator par1Tessellator, float par2, float par3, float par4, float par5, float par6, float par7) { -+ int var8 = (int)(((float)this.field_70581_a + par2) * 15.0F / (float)this.field_70584_aq); -+ -+ if (var8 <= 15) { - this.theRenderEngine.bindTexture(field_110127_a); - float var9 = (float)(var8 % 4) / 4.0F; -- float var10 = var9 + 0.999F / 4.0F; -+ float var10 = var9 + 0.24975F; - float var11 = (float)(var8 / 4) / 4.0F; -- float var12 = var11 + 0.999F / 4.0F; -+ float var12 = var11 + 0.24975F; - float var13 = 2.0F * this.field_70582_as; -- float var14 = (float)(this.prevPosX + (this.posX - this.prevPosX) * (double)var2 - interpPosX); -- float var15 = (float)(this.prevPosY + (this.posY - this.prevPosY) * (double)var2 - interpPosY); -- float var16 = (float)(this.prevPosZ + (this.posZ - this.prevPosZ) * (double)var2 - interpPosZ); -+ float var14 = (float)(this.prevPosX + (this.posX - this.prevPosX) * (double)par2 - interpPosX); -+ float var15 = (float)(this.prevPosY + (this.posY - this.prevPosY) * (double)par2 - interpPosY); -+ float var16 = (float)(this.prevPosZ + (this.posZ - this.prevPosZ) * (double)par2 - interpPosZ); - GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - GL11.glDisable(GL11.GL_LIGHTING); - RenderHelper.disableStandardItemLighting(); -- var1.startDrawingQuads(); -- var1.setColorRGBA_F(this.particleRed, this.particleGreen, this.particleBlue, 1.0F); -- var1.setNormal(0.0F, 1.0F, 0.0F); -- var1.setBrightness(240); -- var1.addVertexWithUV((double)(var14 - var3 * var13 - var6 * var13), (double)(var15 - var4 * var13), (double)(var16 - var5 * var13 - var7 * var13), (double)var10, (double)var12); -- var1.addVertexWithUV((double)(var14 - var3 * var13 + var6 * var13), (double)(var15 + var4 * var13), (double)(var16 - var5 * var13 + var7 * var13), (double)var10, (double)var11); -- var1.addVertexWithUV((double)(var14 + var3 * var13 + var6 * var13), (double)(var15 + var4 * var13), (double)(var16 + var5 * var13 + var7 * var13), (double)var9, (double)var11); -- var1.addVertexWithUV((double)(var14 + var3 * var13 - var6 * var13), (double)(var15 - var4 * var13), (double)(var16 + var5 * var13 - var7 * var13), (double)var9, (double)var12); -- var1.draw(); -+ par1Tessellator.startDrawingQuads(); -+ par1Tessellator.setColorRGBA_F(this.particleRed, this.particleGreen, this.particleBlue, 1.0F); -+ par1Tessellator.setNormal(0.0F, 1.0F, 0.0F); -+ par1Tessellator.setBrightness(240); -+ par1Tessellator.addVertexWithUV((double)(var14 - par3 * var13 - par6 * var13), (double)(var15 - par4 * var13), (double)(var16 - par5 * var13 - par7 * var13), (double)var10, (double)var12); -+ par1Tessellator.addVertexWithUV((double)(var14 - par3 * var13 + par6 * var13), (double)(var15 + par4 * var13), (double)(var16 - par5 * var13 + par7 * var13), (double)var10, (double)var11); -+ par1Tessellator.addVertexWithUV((double)(var14 + par3 * var13 + par6 * var13), (double)(var15 + par4 * var13), (double)(var16 + par5 * var13 + par7 * var13), (double)var9, (double)var11); -+ par1Tessellator.addVertexWithUV((double)(var14 + par3 * var13 - par6 * var13), (double)(var15 - par4 * var13), (double)(var16 + par5 * var13 - par7 * var13), (double)var9, (double)var12); -+ par1Tessellator.draw(); - GL11.glPolygonOffset(0.0F, 0.0F); - GL11.glEnable(GL11.GL_LIGHTING); - } - } - -- public int getBrightnessForRender(float var1) { -- return '\uf0f0'; -+ public int getBrightnessForRender(float par1) { -+ return 61680; - } - -+ /** -+ * Called to update the entity's position/logic. -+ */ - public void onUpdate() { - this.prevPosX = this.posX; - this.prevPosY = this.posY; - this.prevPosZ = this.posZ; - ++this.field_70581_a; -- if(this.field_70581_a == this.field_70584_aq) { -+ -+ if (this.field_70581_a == this.field_70584_aq) { - this.setDead(); - } -- - } - - public int getFXLayer() { ---- net/minecraft/src/GuiSlider.java -+++ net/minecraft/src/GuiSlider.java -@@ -3,34 +3,48 @@ - import org.lwjgl.opengl.GL11; - - public class GuiSlider extends GuiButton { -+ -+ /** The value of this slider control. */ - public float sliderValue = 1.0F; -+ -+ /** Is this slider control being dragged. */ - public boolean dragging; -+ -+ /** Additional ID for this slider control. */ - private EnumOptions idFloat; - -- public GuiSlider(int var1, int var2, int var3, EnumOptions var4, String var5, float var6) { -- super(var1, var2, var3, 150, 20, var5); -- this.idFloat = var4; -- this.sliderValue = var6; -+ public GuiSlider(int par1, int par2, int par3, EnumOptions par4EnumOptions, String par5Str, float par6) { -+ super(par1, par2, par3, 150, 20, par5Str); -+ this.idFloat = par4EnumOptions; -+ this.sliderValue = par6; - } - -- protected int getHoverState(boolean var1) { -+ /** -+ * Returns 0 if the button is disabled, 1 if the mouse is NOT hovering over this button and 2 if it IS hovering over -+ * this button. -+ */ -+ protected int getHoverState(boolean par1) { - return 0; - } - -- protected void mouseDragged(Minecraft var1, int var2, int var3) { -- if(this.drawButton) { -- if(this.dragging) { -- this.sliderValue = (float)(var2 - (this.xPosition + 4)) / (float)(this.width - 8); -- if(this.sliderValue < 0.0F) { -+ /** -+ * Fired when the mouse button is dragged. Equivalent of MouseListener.mouseDragged(MouseEvent e). -+ */ -+ protected void mouseDragged(Minecraft par1Minecraft, int par2, int par3) { -+ if (this.drawButton) { -+ if (this.dragging) { -+ this.sliderValue = (float)(par2 - (this.xPosition + 4)) / (float)(this.width - 8); -+ -+ if (this.sliderValue < 0.0F) { - this.sliderValue = 0.0F; - } - -- if(this.sliderValue > 1.0F) { -+ if (this.sliderValue > 1.0F) { - this.sliderValue = 1.0F; - } - -- var1.gameSettings.setOptionFloatValue(this.idFloat, this.sliderValue); -- this.f = var1.gameSettings.getKeyBinding(this.idFloat); -+ par1Minecraft.gameSettings.setOptionFloatValue(this.idFloat, this.sliderValue); -+ this.displayString = par1Minecraft.gameSettings.getKeyBinding(this.idFloat); - } - - GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); -@@ -39,19 +53,23 @@ - } - } - -- public boolean mousePressed(Minecraft var1, int var2, int var3) { -- if(super.mousePressed(var1, var2, var3)) { -- this.sliderValue = (float)(var2 - (this.xPosition + 4)) / (float)(this.width - 8); -- if(this.sliderValue < 0.0F) { -+ /** -+ * Returns true if the mouse has been pressed on this control. Equivalent of MouseListener.mousePressed(MouseEvent e). -+ */ -+ public boolean mousePressed(Minecraft par1Minecraft, int par2, int par3) { -+ if (super.mousePressed(par1Minecraft, par2, par3)) { -+ this.sliderValue = (float)(par2 - (this.xPosition + 4)) / (float)(this.width - 8); -+ -+ if (this.sliderValue < 0.0F) { - this.sliderValue = 0.0F; - } - -- if(this.sliderValue > 1.0F) { -+ if (this.sliderValue > 1.0F) { - this.sliderValue = 1.0F; - } - -- var1.gameSettings.setOptionFloatValue(this.idFloat, this.sliderValue); -- this.f = var1.gameSettings.getKeyBinding(this.idFloat); -+ par1Minecraft.gameSettings.setOptionFloatValue(this.idFloat, this.sliderValue); -+ this.displayString = par1Minecraft.gameSettings.getKeyBinding(this.idFloat); - this.dragging = true; - return true; - } else { -@@ -59,7 +77,10 @@ - } - } - -- public void mouseReleased(int var1, int var2) { -+ /** -+ * Fired when the mouse button is released. Equivalent of MouseListener.mouseReleased(MouseEvent e). -+ */ -+ public void mouseReleased(int par1, int par2) { - this.dragging = false; - } - } ---- net/minecraft/src/StatsSyncher.java -+++ net/minecraft/src/StatsSyncher.java -@@ -10,113 +10,133 @@ - - public class StatsSyncher { - private volatile boolean isBusy; -- private volatile Map b; -- private volatile Map c; -+ private volatile Map field_77430_b; -+ private volatile Map field_77431_c; -+ -+ /** -+ * The StatFileWriter object, presumably used to write to the statistics files -+ */ - private StatFileWriter statFileWriter; -- private File e; -- private File f; -- private File g; -- private File h; -- private File i; -- private File j; -+ -+ /** A file named 'stats_' [lower case username] '_unsent.dat' */ -+ private File unsentDataFile; -+ -+ /** A file named 'stats_' [lower case username] '.dat' */ -+ private File dataFile; -+ -+ /** A file named 'stats_' [lower case username] '_unsent.tmp' */ -+ private File unsentTempFile; -+ -+ /** A file named 'stats_' [lower case username] '.tmp' */ -+ private File tempFile; -+ -+ /** A file named 'stats_' [lower case username] '_unsent.old' */ -+ private File unsentOldFile; -+ -+ /** A file named 'stats_' [lower case username] '.old' */ -+ private File oldFile; -+ -+ /** The Session object */ - private Session theSession; - private int field_77433_l; - private int field_77434_m; - -- public StatsSyncher(Session var1, StatFileWriter var2, File var3) { -- String var4 = var1.getUsername(); -+ public StatsSyncher(Session par1Session, StatFileWriter par2StatFileWriter, File par3File) { -+ String var4 = par1Session.getUsername(); - String var5 = var4.toLowerCase(); -- this.e = new File(var3, "stats_" + var5 + "_unsent.dat"); -- this.f = new File(var3, "stats_" + var5 + ".dat"); -- this.i = new File(var3, "stats_" + var5 + "_unsent.old"); -- this.j = new File(var3, "stats_" + var5 + ".old"); -- this.g = new File(var3, "stats_" + var5 + "_unsent.tmp"); -- this.h = new File(var3, "stats_" + var5 + ".tmp"); -- if(!var5.equals(var4)) { -- this.func_77412_a(var3, "stats_" + var4 + "_unsent.dat", this.e); -- this.func_77412_a(var3, "stats_" + var4 + ".dat", this.f); -- this.func_77412_a(var3, "stats_" + var4 + "_unsent.old", this.i); -- this.func_77412_a(var3, "stats_" + var4 + ".old", this.j); -- this.func_77412_a(var3, "stats_" + var4 + "_unsent.tmp", this.g); -- this.func_77412_a(var3, "stats_" + var4 + ".tmp", this.h); -+ this.unsentDataFile = new File(par3File, "stats_" + var5 + "_unsent.dat"); -+ this.dataFile = new File(par3File, "stats_" + var5 + ".dat"); -+ this.unsentOldFile = new File(par3File, "stats_" + var5 + "_unsent.old"); -+ this.oldFile = new File(par3File, "stats_" + var5 + ".old"); -+ this.unsentTempFile = new File(par3File, "stats_" + var5 + "_unsent.tmp"); -+ this.tempFile = new File(par3File, "stats_" + var5 + ".tmp"); -+ -+ if (!var5.equals(var4)) { -+ this.func_77412_a(par3File, "stats_" + var4 + "_unsent.dat", this.unsentDataFile); -+ this.func_77412_a(par3File, "stats_" + var4 + ".dat", this.dataFile); -+ this.func_77412_a(par3File, "stats_" + var4 + "_unsent.old", this.unsentOldFile); -+ this.func_77412_a(par3File, "stats_" + var4 + ".old", this.oldFile); -+ this.func_77412_a(par3File, "stats_" + var4 + "_unsent.tmp", this.unsentTempFile); -+ this.func_77412_a(par3File, "stats_" + var4 + ".tmp", this.tempFile); - } - -- this.statFileWriter = var2; -- this.theSession = var1; -- if(this.e.exists()) { -- var2.writeStats(this.func_77417_a(this.e, this.g, this.i)); -+ this.statFileWriter = par2StatFileWriter; -+ this.theSession = par1Session; -+ -+ if (this.unsentDataFile.exists()) { -+ par2StatFileWriter.writeStats(this.func_77417_a(this.unsentDataFile, this.unsentTempFile, this.unsentOldFile)); - } - - this.beginReceiveStats(); - } - -- private void func_77412_a(File var1, String var2, File var3) { -- File var4 = new File(var1, var2); -- if(var4.exists() && !var4.isDirectory() && !var3.exists()) { -- var4.renameTo(var3); -+ private void func_77412_a(File par1File, String par2Str, File par3File) { -+ File var4 = new File(par1File, par2Str); -+ -+ if (var4.exists() && !var4.isDirectory() && !par3File.exists()) { -+ var4.renameTo(par3File); - } -- -- } -- -- private Map func_77417_a(File var1, File var2, File var3) { -- return var1.exists() ? this.func_77413_a(var1) : (var3.exists() ? this.func_77413_a(var3) : (var2.exists() ? this.func_77413_a(var2) : null)); -- } -- -- private Map func_77413_a(File var1) { -+ } -+ -+ private Map func_77417_a(File par1File, File par2File, File par3File) { -+ return par1File.exists() ? this.func_77413_a(par1File) : (par3File.exists() ? this.func_77413_a(par3File) : (par2File.exists() ? this.func_77413_a(par2File) : null)); -+ } -+ -+ private Map func_77413_a(File par1File) { - BufferedReader var2 = null; - - try { -- var2 = new BufferedReader(new FileReader(var1)); -+ var2 = new BufferedReader(new FileReader(par1File)); - String var3 = ""; - StringBuilder var4 = new StringBuilder(); - -- while(true) { -- var3 = var2.readLine(); -- if(var3 == null) { -- Map var5 = StatFileWriter.func_77453_b(var4.toString()); -- return var5; -- } -- -+ while ((var3 = var2.readLine()) != null) { - var4.append(var3); - } -+ -+ Map var5 = StatFileWriter.func_77453_b(var4.toString()); -+ return var5; - } catch (Exception var15) { - var15.printStackTrace(); - } finally { -- if(var2 != null) { -+ if (var2 != null) { - try { - var2.close(); - } catch (Exception var14) { - var14.printStackTrace(); - } - } -- - } - - return null; - } - -- private void func_77421_a(Map var1, File var2, File var3, File var4) throws IOException { -- PrintWriter var5 = new PrintWriter(new FileWriter(var3, false)); -+ private void func_77421_a(Map par1Map, File par2File, File par3File, File par4File) throws IOException { -+ PrintWriter var5 = new PrintWriter(new FileWriter(par3File, false)); - - try { -- var5.print(StatFileWriter.func_77441_a(this.theSession.getUsername(), "local", var1)); -+ var5.print(StatFileWriter.func_77441_a(this.theSession.getUsername(), "local", par1Map)); - } finally { - var5.close(); - } - -- if(var4.exists()) { -- var4.delete(); -- } -- -- if(var2.exists()) { -- var2.renameTo(var4); -- } -- -- var3.renameTo(var2); -+ if (par4File.exists()) { -+ par4File.delete(); -+ } -+ -+ if (par2File.exists()) { -+ par2File.renameTo(par4File); -+ } -+ -+ par3File.renameTo(par2File); - } - -+ /** -+ * Attempts to begin receiving stats from the server. Will throw an IllegalStateException if the syncher is already -+ * busy. -+ */ - public void beginReceiveStats() { -- if(this.isBusy) { -+ if (this.isBusy) { - throw new IllegalStateException("Can\'t get stats from server while StatsSyncher is busy!"); - } else { - this.field_77433_l = 100; -@@ -125,22 +145,26 @@ - } - } - -- public void beginSendStats(Map var1) { -- if(this.isBusy) { -+ /** -+ * Attempts to begin sending stats to the server. Will throw an IllegalStateException if the syncher is already busy. -+ */ -+ public void beginSendStats(Map par1Map) { -+ if (this.isBusy) { - throw new IllegalStateException("Can\'t save stats while StatsSyncher is busy!"); - } else { - this.field_77433_l = 100; - this.isBusy = true; -- (new ThreadStatSyncherSend(this, var1)).start(); -+ (new ThreadStatSyncherSend(this, par1Map)).start(); - } - } - -- public void syncStatsFileWithMap(Map var1) { -+ public void syncStatsFileWithMap(Map par1Map) { - int var2 = 30; - -- while(this.isBusy) { -+ while (this.isBusy) { - --var2; -- if(var2 <= 0) { -+ -+ if (var2 <= 0) { - break; - } - -@@ -154,81 +178,79 @@ - this.isBusy = true; - - try { -- this.func_77421_a(var1, this.e, this.g, this.i); -+ this.func_77421_a(par1Map, this.unsentDataFile, this.unsentTempFile, this.unsentOldFile); - } catch (Exception var8) { - var8.printStackTrace(); - } finally { - this.isBusy = false; - } -- - } - - public boolean func_77425_c() { -- return this.field_77433_l <= 0 && !this.isBusy && this.c == null; -+ return this.field_77433_l <= 0 && !this.isBusy && this.field_77431_c == null; - } - - public void func_77422_e() { -- if(this.field_77433_l > 0) { -+ if (this.field_77433_l > 0) { - --this.field_77433_l; - } - -- if(this.field_77434_m > 0) { -+ if (this.field_77434_m > 0) { - --this.field_77434_m; - } - -- if(this.c != null) { -- this.statFileWriter.func_77448_c(this.c); -- this.c = null; -- } -- -- if(this.b != null) { -- this.statFileWriter.func_77452_b(this.b); -- this.b = null; -- } -- -- } -- -- static Map func_77419_a(StatsSyncher var0) { -- return var0.b; -- } -- -- static File func_77408_b(StatsSyncher var0) { -- return var0.f; -- } -- -- static File func_77407_c(StatsSyncher var0) { -- return var0.h; -- } -- -- static File func_77411_d(StatsSyncher var0) { -- return var0.j; -- } -- -- static void func_77414_a(StatsSyncher var0, Map var1, File var2, File var3, File var4) throws IOException { -- var0.func_77421_a(var1, var2, var3, var4); -- } -- -- static Map func_77416_a(StatsSyncher var0, Map var1) { -- return var0.b = var1; -- } -- -- static Map func_77410_a(StatsSyncher var0, File var1, File var2, File var3) { -- return var0.func_77417_a(var1, var2, var3); -- } -- -- static boolean setBusy(StatsSyncher var0, boolean var1) { -- return var0.isBusy = var1; -- } -- -- static File getUnsentDataFile(StatsSyncher var0) { -- return var0.e; -- } -- -- static File getUnsentTempFile(StatsSyncher var0) { -- return var0.g; -- } -- -- static File getUnsentOldFile(StatsSyncher var0) { -- return var0.i; -+ if (this.field_77431_c != null) { -+ this.statFileWriter.func_77448_c(this.field_77431_c); -+ this.field_77431_c = null; -+ } -+ -+ if (this.field_77430_b != null) { -+ this.statFileWriter.func_77452_b(this.field_77430_b); -+ this.field_77430_b = null; -+ } -+ } -+ -+ static Map func_77419_a(StatsSyncher par0StatsSyncher) { -+ return par0StatsSyncher.field_77430_b; -+ } -+ -+ static File func_77408_b(StatsSyncher par0StatsSyncher) { -+ return par0StatsSyncher.dataFile; -+ } -+ -+ static File func_77407_c(StatsSyncher par0StatsSyncher) { -+ return par0StatsSyncher.tempFile; -+ } -+ -+ static File func_77411_d(StatsSyncher par0StatsSyncher) { -+ return par0StatsSyncher.oldFile; -+ } -+ -+ static void func_77414_a(StatsSyncher par0StatsSyncher, Map par1Map, File par2File, File par3File, File par4File) throws IOException { -+ par0StatsSyncher.func_77421_a(par1Map, par2File, par3File, par4File); -+ } -+ -+ static Map func_77416_a(StatsSyncher par0StatsSyncher, Map par1Map) { -+ return par0StatsSyncher.field_77430_b = par1Map; -+ } -+ -+ static Map func_77410_a(StatsSyncher par0StatsSyncher, File par1File, File par2File, File par3File) { -+ return par0StatsSyncher.func_77417_a(par1File, par2File, par3File); -+ } -+ -+ static boolean setBusy(StatsSyncher par0StatsSyncher, boolean par1) { -+ return par0StatsSyncher.isBusy = par1; -+ } -+ -+ static File getUnsentDataFile(StatsSyncher par0StatsSyncher) { -+ return par0StatsSyncher.unsentDataFile; -+ } -+ -+ static File getUnsentTempFile(StatsSyncher par0StatsSyncher) { -+ return par0StatsSyncher.unsentTempFile; -+ } -+ -+ static File getUnsentOldFile(StatsSyncher par0StatsSyncher) { -+ return par0StatsSyncher.unsentOldFile; - } - } ---- net/minecraft/src/StatTypeFloat.java -+++ net/minecraft/src/StatTypeFloat.java -@@ -1,7 +1,11 @@ - package net.minecraft.src; - - final class StatTypeFloat implements IStatType { -- public String format(int var1) { -- return StatBase.getDecimalFormat().format((double)var1 * 0.1D); -+ -+ /** -+ * Formats a given stat for human consumption. -+ */ -+ public String format(int par1) { -+ return StatBase.getDecimalFormat().format((double)par1 * 0.1D); - } - } ---- net/minecraft/src/LogFormatter.java -+++ net/minecraft/src/LogFormatter.java -@@ -7,26 +7,29 @@ - import java.util.logging.LogRecord; - - class LogFormatter extends Formatter { -- private SimpleDateFormat b; -+ private SimpleDateFormat field_98228_b; -+ - final LogAgent field_98229_a; - -- private LogFormatter(LogAgent var1) { -- this.field_98229_a = var1; -- this.b = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); -+ private LogFormatter(LogAgent par1LogAgent) { -+ this.field_98229_a = par1LogAgent; -+ this.field_98228_b = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); - } - -- public String format(LogRecord var1) { -+ public String format(LogRecord par1LogRecord) { - StringBuilder var2 = new StringBuilder(); -- var2.append(this.b.format(Long.valueOf(var1.getMillis()))); -- if(LogAgent.func_98237_a(this.field_98229_a) != null) { -+ var2.append(this.field_98228_b.format(Long.valueOf(par1LogRecord.getMillis()))); -+ -+ if (LogAgent.func_98237_a(this.field_98229_a) != null) { - var2.append(LogAgent.func_98237_a(this.field_98229_a)); - } - -- var2.append(" [").append(var1.getLevel().getName()).append("] "); -- var2.append(this.formatMessage(var1)); -+ var2.append(" [").append(par1LogRecord.getLevel().getName()).append("] "); -+ var2.append(this.formatMessage(par1LogRecord)); - var2.append('\n'); -- Throwable var3 = var1.getThrown(); -- if(var3 != null) { -+ Throwable var3 = par1LogRecord.getThrown(); -+ -+ if (var3 != null) { - StringWriter var4 = new StringWriter(); - var3.printStackTrace(new PrintWriter(var4)); - var2.append(var4.toString()); -@@ -35,7 +38,7 @@ - return var2.toString(); - } - -- LogFormatter(LogAgent var1, LogAgentEmptyAnon var2) { -- this(var1); -+ LogFormatter(LogAgent par1LogAgent, LogAgentEmptyAnon par2LogAgentEmptyAnon) { -+ this(par1LogAgent); - } - } ---- /dev/null -+++ org/spoutcraft/client/gui/SimpleKeyManager.java -@@ -1,0 +1,37 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.client.gui; -+ -+import org.spoutcraft.api.gui.KeyManager; -+import org.spoutcraft.api.gui.Keyboard; -+ -+public class SimpleKeyManager implements KeyManager { -+ public boolean isKeyDown(Keyboard key) { -+ return org.lwjgl.input.Keyboard.isKeyDown(key.getKeyCode()); -+ } -+ -+ public boolean isRepeatingEvents() { -+ return org.lwjgl.input.Keyboard.isRepeatEvent(); -+ } -+ -+ public void setRepeatingEvents(boolean repeat) { -+ org.lwjgl.input.Keyboard.enableRepeatEvents(repeat); -+ } -+} ---- /dev/null -+++ org/spoutcraft/client/gui/settings/controls/DifficultyButton.java -@@ -1,0 +1,84 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.client.gui.settings.controls; -+ -+import net.minecraft.src.Minecraft; -+ -+import org.spoutcraft.api.gui.GenericButton; -+ -+public class DifficultyButton extends GenericButton { -+ public DifficultyButton() { -+ super("Difficulty"); -+ setTooltip("Difficulty\nControls the difficulty of the game."); -+ } -+ -+ @Override -+ public String getText() { -+ if (Minecraft.getMinecraft().theWorld != null && Minecraft.getMinecraft().theWorld.getWorldInfo().isHardcoreModeEnabled()) { -+ return "Difficulty: Hardcore"; -+ } -+ String difficulty; -+ switch(Minecraft.getMinecraft().gameSettings.difficulty) { -+ case 0: difficulty = "Peaceful"; break; -+ case 1: difficulty = "Easy"; break; -+ case 2: difficulty = "Normal"; break; -+ case 3: difficulty = "Hard"; break; -+ default: difficulty = "Unknown"; break; -+ } -+ return "Difficulty: " + difficulty; -+ } -+ -+ @Override -+ public String getTooltip() { -+ if (Minecraft.getMinecraft().theWorld == null) { -+ return "Can not change difficulty outside of the game"; -+ } -+ if (!Minecraft.getMinecraft().isSingleplayer()) { -+ return "Can not change difficulty in multiplayer"; -+ } -+ if (Minecraft.getMinecraft().theWorld.getWorldInfo().isHardcoreModeEnabled()) { -+ return "Can not change difficulty in hardcore mode"; -+ } -+ return super.getTooltip(); -+ } -+ -+ @Override -+ public boolean isEnabled() { -+ if (Minecraft.getMinecraft().theWorld == null) { -+ return false; -+ } -+ if (!Minecraft.getMinecraft().isSingleplayer()) { -+ return false; -+ } -+ if (Minecraft.getMinecraft().theWorld.getWorldInfo().isHardcoreModeEnabled()) { -+ return false; -+ } -+ return true; -+ } -+ -+ @Override -+ public void onButtonClick() { -+ Minecraft.getMinecraft().gameSettings.difficulty++; -+ if (Minecraft.getMinecraft().gameSettings.difficulty > 3) { -+ Minecraft.getMinecraft().gameSettings.difficulty = 0; -+ } -+ Minecraft.getMinecraft().gameSettings.saveOptions(); -+ } -+} ---- net/minecraft/src/NetLoginHandler.java -+++ net/minecraft/src/NetLoginHandler.java -@@ -1,5 +1,6 @@ - package net.minecraft.src; - -+import java.io.IOException; - import java.io.Serializable; - import java.net.InetAddress; - import java.net.Socket; -@@ -13,137 +14,160 @@ - import net.minecraft.server.MinecraftServer; - - public class NetLoginHandler extends NetHandler { -- private static Random c = new Random(); -+ -+ /** The Random object used to generate serverId hex strings. */ -+ private static Random rand = new Random(); -+ -+ /** The 4 byte verify token read from a Packet252SharedKey */ - private byte[] verifyToken; -- private final MinecraftServer e; -+ -+ /** Reference to the MinecraftServer object. */ -+ private final MinecraftServer mcServer; - public final TcpConnection myTCPConnection; -- public boolean finishedProcessing; -- private int loginTimer; -- private String g; -+ public boolean connectionComplete; -+ private int connectionTimer; -+ private String clientUsername; - private volatile boolean field_72544_i; -- private String i = ""; -+ -+ /** server ID that is randomly generated by this login handler. */ -+ private String loginServerId = ""; - private boolean field_92079_k; -- private SecretKey k; -- -- public NetLoginHandler(MinecraftServer var1, Socket var2, String var3) { -- this.e = var1; -- this.myTCPConnection = new TcpConnection(var1.getLogAgent(), var2, var3, this, var1.getKeyPair().getPrivate()); -+ -+ /** Secret AES key obtained from the client's Packet252SharedKey */ -+ private SecretKey sharedKey; -+ -+ public NetLoginHandler(MinecraftServer par1MinecraftServer, Socket par2Socket, String par3Str) throws IOException { -+ this.mcServer = par1MinecraftServer; -+ this.myTCPConnection = new TcpConnection(par1MinecraftServer.getLogAgent(), par2Socket, par3Str, this, par1MinecraftServer.getKeyPair().getPrivate()); - this.myTCPConnection.field_74468_e = 0; - } - -+ /** -+ * Logs the user in if a login packet is found, otherwise keeps processing network packets unless the timeout has -+ * occurred. -+ */ - public void tryLogin() { -- if(this.field_72544_i) { -+ if (this.field_72544_i) { - this.initializePlayerConnection(); - } - -- if(this.loginTimer++ == 600) { -- this.kickUser("Took too long to log in"); -+ if (this.connectionTimer++ == 600) { -+ this.raiseErrorAndDisconnect("Took too long to log in"); - } else { - this.myTCPConnection.processReadPackets(); - } -- - } - -- public void kickUser(String var1) { -+ public void raiseErrorAndDisconnect(String par1Str) { - try { -- this.e.getLogAgent().logInfo("Disconnecting " + this.getUsernameAndAddress() + ": " + var1); -- this.myTCPConnection.addToSendQueue(new Packet255KickDisconnect(var1)); -+ this.mcServer.getLogAgent().logInfo("Disconnecting " + this.getUsernameAndAddress() + ": " + par1Str); -+ this.myTCPConnection.addToSendQueue(new Packet255KickDisconnect(par1Str)); - this.myTCPConnection.serverShutdown(); -- this.finishedProcessing = true; -+ this.connectionComplete = true; - } catch (Exception var3) { - var3.printStackTrace(); - } -- - } - -- public void handleClientProtocol(Packet2ClientProtocol var1) { -- if(this.g != null) { -- this.kickUser("Quit repeating yourself!"); -+ public void handleClientProtocol(Packet2ClientProtocol par1Packet2ClientProtocol) { -+ if (this.clientUsername != null) { -+ this.raiseErrorAndDisconnect("Quit repeating yourself!"); - } else { -- this.g = var1.getUsername(); -- if(!this.g.equals(StringUtils.stripControlCodes(this.g))) { -- this.kickUser("Invalid username!"); -+ this.clientUsername = par1Packet2ClientProtocol.getUsername(); -+ -+ if (!this.clientUsername.equals(StringUtils.stripControlCodes(this.clientUsername))) { -+ this.raiseErrorAndDisconnect("Invalid username!"); - } else { -- PublicKey var2 = this.e.getKeyPair().getPublic(); -- if(var1.getProtocolVersion() != 78) { -- if(var1.getProtocolVersion() > 78) { -- this.kickUser("Outdated server!"); -+ PublicKey var2 = this.mcServer.getKeyPair().getPublic(); -+ -+ if (par1Packet2ClientProtocol.getProtocolVersion() != 78) { -+ if (par1Packet2ClientProtocol.getProtocolVersion() > 78) { -+ this.raiseErrorAndDisconnect("Outdated server!"); - } else { -- this.kickUser("Outdated client!"); -+ this.raiseErrorAndDisconnect("Outdated client!"); - } -- - } else { -- this.i = this.e.isServerInOnlineMode() ? Long.toString(c.nextLong(), 16) : "-"; -+ this.loginServerId = this.mcServer.isServerInOnlineMode() ? Long.toString(rand.nextLong(), 16) : "-"; - this.verifyToken = new byte[4]; -- c.nextBytes(this.verifyToken); -- this.myTCPConnection.addToSendQueue(new Packet253ServerAuthData(this.i, var2, this.verifyToken)); -+ rand.nextBytes(this.verifyToken); -+ this.myTCPConnection.addToSendQueue(new Packet253ServerAuthData(this.loginServerId, var2, this.verifyToken)); - } - } - } - } - -- public void handleSharedKey(Packet252SharedKey var1) { -- PrivateKey var2 = this.e.getKeyPair().getPrivate(); -- this.k = var1.getSharedKey(var2); -- if(!Arrays.equals(this.verifyToken, var1.getVerifyToken(var2))) { -- this.kickUser("Invalid client reply"); -+ public void handleSharedKey(Packet252SharedKey par1Packet252SharedKey) { -+ PrivateKey var2 = this.mcServer.getKeyPair().getPrivate(); -+ this.sharedKey = par1Packet252SharedKey.getSharedKey(var2); -+ -+ if (!Arrays.equals(this.verifyToken, par1Packet252SharedKey.getVerifyToken(var2))) { -+ this.raiseErrorAndDisconnect("Invalid client reply"); - } - - this.myTCPConnection.addToSendQueue(new Packet252SharedKey()); - } - -- public void handleClientCommand(Packet205ClientCommand var1) { -- if(var1.forceRespawn == 0) { -- if(this.field_92079_k) { -- this.kickUser("Duplicate login"); -+ public void handleClientCommand(Packet205ClientCommand par1Packet205ClientCommand) { -+ if (par1Packet205ClientCommand.forceRespawn == 0) { -+ if (this.field_92079_k) { -+ this.raiseErrorAndDisconnect("Duplicate login"); - return; - } - - this.field_92079_k = true; -- if(this.e.isServerInOnlineMode()) { -+ -+ if (this.mcServer.isServerInOnlineMode()) { - (new ThreadLoginVerifier(this)).start(); - } else { - this.field_72544_i = true; - } - } -- -- } -- -- public void handleLogin(Packet1Login var1) { -- } -- -+ } -+ -+ public void handleLogin(Packet1Login par1Packet1Login) {} -+ -+ /** -+ * on success the specified username is connected to the minecraftInstance, otherwise they are packet255'd -+ */ - public void initializePlayerConnection() { -- String var1 = this.e.getConfigurationManager().allowUserToConnect(this.myTCPConnection.getRemoteAddress(), this.g); -- if(var1 != null) { -- this.kickUser(var1); -+ String var1 = this.mcServer.getConfigurationManager().allowUserToConnect(this.myTCPConnection.getSocketAddress(), this.clientUsername); -+ -+ if (var1 != null) { -+ this.raiseErrorAndDisconnect(var1); - } else { -- EntityPlayerMP var2 = this.e.getConfigurationManager().createPlayerForUser(this.g); -- if(var2 != null) { -- this.e.getConfigurationManager().initializeConnectionToPlayer(this.myTCPConnection, var2); -+ EntityPlayerMP var2 = this.mcServer.getConfigurationManager().createPlayerForUser(this.clientUsername); -+ -+ if (var2 != null) { -+ this.mcServer.getConfigurationManager().initializeConnectionToPlayer(this.myTCPConnection, var2); - } - } - -- this.finishedProcessing = true; -- } -- -- public void handleErrorMessage(String var1, Object[] var2) { -- this.e.getLogAgent().logInfo(this.getUsernameAndAddress() + " lost connection"); -- this.finishedProcessing = true; -- } -- -- public void handleServerPing(Packet254ServerPing var1) { -+ this.connectionComplete = true; -+ } -+ -+ public void handleErrorMessage(String par1Str, Object[] par2ArrayOfObj) { -+ this.mcServer.getLogAgent().logInfo(this.getUsernameAndAddress() + " lost connection"); -+ this.connectionComplete = true; -+ } -+ -+ /** -+ * Handle a server ping packet. -+ */ -+ public void handleServerPing(Packet254ServerPing par1Packet254ServerPing) { - try { -- ServerConfigurationManager var2 = this.e.getConfigurationManager(); -+ ServerConfigurationManager var2 = this.mcServer.getConfigurationManager(); - String var3 = null; -- if(var1.func_140050_d()) { -- var3 = this.e.getMOTD() + "\u00a7" + var2.getCurrentPlayerCount() + "\u00a7" + var2.getMaxPlayers(); -- } else { -- List var4 = Arrays.asList(new Serializable[]{Integer.valueOf(1), Integer.valueOf(78), this.e.getMinecraftVersion(), this.e.getMOTD(), Integer.valueOf(var2.getCurrentPlayerCount()), Integer.valueOf(var2.getMaxPlayers())}); - -+ if (par1Packet254ServerPing.func_140050_d()) { -+ var3 = this.mcServer.getMOTD() + "\u00a7" + var2.getCurrentPlayerCount() + "\u00a7" + var2.getMaxPlayers(); -+ } else { -+ List var4 = Arrays.asList(new Serializable[] {Integer.valueOf(1), Integer.valueOf(78), this.mcServer.getMinecraftVersion(), this.mcServer.getMOTD(), Integer.valueOf(var2.getCurrentPlayerCount()), Integer.valueOf(var2.getMaxPlayers())}); - Object var6; -- for(Iterator var5 = var4.iterator(); var5.hasNext(); var3 = var3 + var6.toString().replaceAll("\u0000", "")) { -+ -+ for (Iterator var5 = var4.iterator(); var5.hasNext(); var3 = var3 + var6.toString().replaceAll("\u0000", "")) { - var6 = var5.next(); -- if(var3 == null) { -+ -+ if (var3 == null) { - var3 = "\u00a7"; - } else { - var3 = var3 + "\u0000"; -@@ -152,56 +176,75 @@ - } - - InetAddress var8 = null; -- if(this.myTCPConnection.getSocket() != null) { -+ -+ if (this.myTCPConnection.getSocket() != null) { - var8 = this.myTCPConnection.getSocket().getInetAddress(); - } - - this.myTCPConnection.addToSendQueue(new Packet255KickDisconnect(var3)); - this.myTCPConnection.serverShutdown(); -- if(var8 != null && this.e.getNetworkThread() instanceof DedicatedServerListenThread) { -- ((DedicatedServerListenThread)this.e.getNetworkThread()).func_71761_a(var8); -+ -+ if (var8 != null && this.mcServer.getNetworkThread() instanceof DedicatedServerListenThread) { -+ ((DedicatedServerListenThread)this.mcServer.getNetworkThread()).func_71761_a(var8); - } - -- this.finishedProcessing = true; -+ this.connectionComplete = true; - } catch (Exception var7) { - var7.printStackTrace(); - } -- - } - -- public void unexpectedPacket(Packet var1) { -- this.kickUser("Protocol error"); -+ /** -+ * Default handler called for packets that don't have their own handlers in NetClientHandler; currentlly does nothing. -+ */ -+ public void unexpectedPacket(Packet par1Packet) { -+ this.raiseErrorAndDisconnect("Protocol error"); - } - - public String getUsernameAndAddress() { -- return this.g != null ? this.g + " [" + this.myTCPConnection.getRemoteAddress().toString() + "]" : this.myTCPConnection.getRemoteAddress().toString(); -+ return this.clientUsername != null ? this.clientUsername + " [" + this.myTCPConnection.getSocketAddress().toString() + "]" : this.myTCPConnection.getSocketAddress().toString(); - } - -+ /** -+ * determine if it is a server handler -+ */ - public boolean isServerHandler() { - return true; - } - - public boolean isConnectionClosed() { -- return this.finishedProcessing; -- } -- -- static String getServerId(NetLoginHandler var0) { -- return var0.i; -- } -- -- static MinecraftServer getLoginMinecraftServer(NetLoginHandler var0) { -- return var0.e; -- } -- -- static SecretKey getSharedKey(NetLoginHandler var0) { -- return var0.k; -- } -- -- static String getClientUsername(NetLoginHandler var0) { -- return var0.g; -- } -- -- static boolean func_72531_a(NetLoginHandler var0, boolean var1) { -- return var0.field_72544_i = var1; -+ return this.connectionComplete; -+ } -+ -+ /** -+ * Returns the server Id randomly generated by this login handler. -+ */ -+ static String getServerId(NetLoginHandler par0NetLoginHandler) { -+ return par0NetLoginHandler.loginServerId; -+ } -+ -+ /** -+ * Returns the reference to Minecraft Server. -+ */ -+ static MinecraftServer getLoginMinecraftServer(NetLoginHandler par0NetLoginHandler) { -+ return par0NetLoginHandler.mcServer; -+ } -+ -+ /** -+ * Return the secret AES sharedKey -+ */ -+ static SecretKey getSharedKey(NetLoginHandler par0NetLoginHandler) { -+ return par0NetLoginHandler.sharedKey; -+ } -+ -+ /** -+ * Returns the connecting client username. -+ */ -+ static String getClientUsername(NetLoginHandler par0NetLoginHandler) { -+ return par0NetLoginHandler.clientUsername; -+ } -+ -+ static boolean func_72531_a(NetLoginHandler par0NetLoginHandler, boolean par1) { -+ return par0NetLoginHandler.field_72544_i = par1; - } - } ---- /dev/null -+++ com/prupe/mcpatcher/WeightedIndex.java -@@ -1,0 +1,79 @@ -+package com.prupe.mcpatcher; -+ -+import com.prupe.mcpatcher.WeightedIndex$1; -+import com.prupe.mcpatcher.WeightedIndex$2; -+ -+public abstract class WeightedIndex { -+ private static final long K1 = -5435081209227447693L; -+ private static final long KMUL = -7070675565921424023L; -+ final int size; -+ -+ public static WeightedIndex create(int size) { -+ return size <= 0 ? null : new WeightedIndex$1(size); -+ } -+ -+ public static WeightedIndex create(int size, String weightList) { -+ if (size > 0 && weightList != null) { -+ int[] weights = new int[size]; -+ int sum1 = 0; -+ boolean useWeight = false; -+ String[] list = weightList.trim().split("\\s+"); -+ -+ for (int sum = 0; sum < size; ++sum) { -+ if (sum < list.length && list[sum].matches("^\\d+$")) { -+ weights[sum] = Math.max(Integer.parseInt(list[sum]), 0); -+ } else { -+ weights[sum] = 1; -+ } -+ -+ if (sum > 0 && weights[sum] != weights[0]) { -+ useWeight = true; -+ } -+ -+ sum1 += weights[sum]; -+ } -+ -+ if (useWeight && sum1 > 0) { -+ return new WeightedIndex$2(size, sum1, weights); -+ } else { -+ return create(size); -+ } -+ } else { -+ return create(size); -+ } -+ } -+ -+ protected WeightedIndex(int size) { -+ this.size = size; -+ } -+ -+ protected final int mod(long n, int modulus) { -+ return (int)((n >> 32 ^ n) & 2147483647L) % modulus; -+ } -+ -+ public abstract int choose(long var1); -+ -+ public static long hash128To64(int i, int j, int k, int l) { -+ return hash128To64((long)i << 32 | (long)j, (long)k << 32 | (long)l); -+ } -+ -+ public static long hash128To64(long a, long b) { -+ a = shiftMix(a * -5435081209227447693L) * -5435081209227447693L; -+ long c = b * -5435081209227447693L + mix128to64(a, b); -+ long d = shiftMix(a + b); -+ a = mix128to64(a, c); -+ b = mix128to64(d, b); -+ return a ^ b ^ mix128to64(b, a); -+ } -+ -+ private static long shiftMix(long val) { -+ return val ^ val >>> 47; -+ } -+ -+ private static long mix128to64(long u, long v) { -+ long a = shiftMix((u ^ v) * -7070675565921424023L); -+ long b = shiftMix((u ^ a) * -7070675565921424023L); -+ b *= -7070675565921424023L; -+ return b; -+ } -+} ---- net/minecraft/src/IPlayerFileData.java -+++ net/minecraft/src/IPlayerFileData.java -@@ -1,9 +1,19 @@ - package net.minecraft.src; - - public interface IPlayerFileData { -+ -+ /** -+ * Writes the player data to disk from the specified PlayerEntityMP. -+ */ - void writePlayerData(EntityPlayer var1); - -+ /** -+ * Reads the player data from disk into the specified PlayerEntityMP. -+ */ - NBTTagCompound readPlayerData(EntityPlayer var1); - -+ /** -+ * Returns an array of usernames for which player.dat exists for. -+ */ - String[] getAvailablePlayerDat(); - } ---- net/minecraft/src/RecipesFood.java -+++ net/minecraft/src/RecipesFood.java -@@ -1,15 +1,19 @@ - package net.minecraft.src; - - public class RecipesFood { -- public void addRecipes(CraftingManager var1) { -- var1.addShapelessRecipe(new ItemStack(Item.bowlSoup), new Object[]{Block.mushroomBrown, Block.mushroomRed, Item.bowlEmpty}); -- var1.addRecipe(new ItemStack(Item.cookie, 8), new Object[]{"#X#", Character.valueOf('X'), new ItemStack(Item.dyePowder, 1, 3), Character.valueOf('#'), Item.wheat}); -- var1.addRecipe(new ItemStack(Block.melon), new Object[]{"MMM", "MMM", "MMM", Character.valueOf('M'), Item.melon}); -- var1.addRecipe(new ItemStack(Item.melonSeeds), new Object[]{"M", Character.valueOf('M'), Item.melon}); -- var1.addRecipe(new ItemStack(Item.pumpkinSeeds, 4), new Object[]{"M", Character.valueOf('M'), Block.pumpkin}); -- var1.addShapelessRecipe(new ItemStack(Item.pumpkinPie), new Object[]{Block.pumpkin, Item.sugar, Item.egg}); -- var1.addShapelessRecipe(new ItemStack(Item.fermentedSpiderEye), new Object[]{Item.spiderEye, Block.mushroomBrown, Item.sugar}); -- var1.addShapelessRecipe(new ItemStack(Item.blazePowder, 2), new Object[]{Item.blazeRod}); -- var1.addShapelessRecipe(new ItemStack(Item.magmaCream), new Object[]{Item.blazePowder, Item.slimeBall}); -+ -+ /** -+ * Adds the food recipes to the CraftingManager. -+ */ -+ public void addRecipes(CraftingManager par1CraftingManager) { -+ par1CraftingManager.addShapelessRecipe(new ItemStack(Item.bowlSoup), new Object[] {Block.mushroomBrown, Block.mushroomRed, Item.bowlEmpty}); -+ par1CraftingManager.addRecipe(new ItemStack(Item.cookie, 8), new Object[] {"#X#", 'X', new ItemStack(Item.dyePowder, 1, 3), '#', Item.wheat}); -+ par1CraftingManager.addRecipe(new ItemStack(Block.melon), new Object[] {"MMM", "MMM", "MMM", 'M', Item.melon}); -+ par1CraftingManager.addRecipe(new ItemStack(Item.melonSeeds), new Object[] {"M", 'M', Item.melon}); -+ par1CraftingManager.addRecipe(new ItemStack(Item.pumpkinSeeds, 4), new Object[] {"M", 'M', Block.pumpkin}); -+ par1CraftingManager.addShapelessRecipe(new ItemStack(Item.pumpkinPie), new Object[] {Block.pumpkin, Item.sugar, Item.egg}); -+ par1CraftingManager.addShapelessRecipe(new ItemStack(Item.fermentedSpiderEye), new Object[] {Item.spiderEye, Block.mushroomBrown, Item.sugar}); -+ par1CraftingManager.addShapelessRecipe(new ItemStack(Item.blazePowder, 2), new Object[] {Item.blazeRod}); -+ par1CraftingManager.addShapelessRecipe(new ItemStack(Item.magmaCream), new Object[] {Item.blazePowder, Item.slimeBall}); - } - } ---- net/minecraft/src/BlockLeavesBase.java -+++ net/minecraft/src/BlockLeavesBase.java -@@ -1,19 +1,32 @@ - package net.minecraft.src; - - public class BlockLeavesBase extends Block { -+ -+ /** -+ * Used to determine how to display leaves based on the graphics level. May also be used in rendering for transparency, -+ * not sure. -+ */ - protected boolean graphicsLevel; - -- protected BlockLeavesBase(int var1, Material var2, boolean var3) { -- super(var1, var2); -- this.graphicsLevel = var3; -+ protected BlockLeavesBase(int par1, Material par2Material, boolean par3) { -+ super(par1, par2Material); -+ this.graphicsLevel = par3; - } - -+ /** -+ * Is this block (a) opaque and (b) a full 1m cube? This determines whether or not to render the shared face of two -+ * adjacent blocks and also whether the player can attach torches, redstone wire, etc to this block. -+ */ - public boolean isOpaqueCube() { - return false; - } - -- public boolean shouldSideBeRendered(IBlockAccess var1, int var2, int var3, int var4, int var5) { -- int var6 = var1.getBlockId(var2, var3, var4); -- return !this.graphicsLevel && var6 == this.blockID ? false : super.shouldSideBeRendered(var1, var2, var3, var4, var5); -+ /** -+ * Returns true if the given side of this block type should be rendered, if the adjacent block is at the given -+ * coordinates. Args: blockAccess, x, y, z, side -+ */ -+ public boolean shouldSideBeRendered(IBlockAccess par1IBlockAccess, int par2, int par3, int par4, int par5) { -+ int var6 = par1IBlockAccess.getBlockId(par2, par3, par4); -+ return !this.graphicsLevel && var6 == this.blockID ? false : super.shouldSideBeRendered(par1IBlockAccess, par2, par3, par4, par5); - } - } ---- net/minecraft/src/RenderBoat.java -+++ net/minecraft/src/RenderBoat.java -@@ -4,6 +4,8 @@ - - public class RenderBoat extends Render { - private static final ResourceLocation boatTextures = new ResourceLocation("textures/entity/boat.png"); -+ -+ /** instance of ModelBoat for rendering */ - protected ModelBase modelBoat; - - public RenderBoat() { -@@ -11,38 +13,51 @@ - this.modelBoat = new ModelBoat(); - } - -- public void renderBoat(EntityBoat var1, double var2, double var4, double var6, float var8, float var9) { -+ /** -+ * The render method used in RenderBoat that renders the boat model. -+ */ -+ public void renderBoat(EntityBoat par1EntityBoat, double par2, double par4, double par6, float par8, float par9) { - GL11.glPushMatrix(); -- GL11.glTranslatef((float)var2, (float)var4, (float)var6); -- GL11.glRotatef(180.0F - var8, 0.0F, 1.0F, 0.0F); -- float var10 = (float)var1.getTimeSinceHit() - var9; -- float var11 = var1.getDamageTaken() - var9; -- if(var11 < 0.0F) { -+ GL11.glTranslatef((float)par2, (float)par4, (float)par6); -+ GL11.glRotatef(180.0F - par8, 0.0F, 1.0F, 0.0F); -+ float var10 = (float)par1EntityBoat.getTimeSinceHit() - par9; -+ float var11 = par1EntityBoat.getDamageTaken() - par9; -+ -+ if (var11 < 0.0F) { - var11 = 0.0F; - } - -- if(var10 > 0.0F) { -- GL11.glRotatef(MathHelper.sin(var10) * var10 * var11 / 10.0F * (float)var1.getForwardDirection(), 1.0F, 0.0F, 0.0F); -+ if (var10 > 0.0F) { -+ GL11.glRotatef(MathHelper.sin(var10) * var10 * var11 / 10.0F * (float)par1EntityBoat.getForwardDirection(), 1.0F, 0.0F, 0.0F); - } - -- float var12 = 12.0F / 16.0F; -+ float var12 = 0.75F; - GL11.glScalef(var12, var12, var12); - GL11.glScalef(1.0F / var12, 1.0F / var12, 1.0F / var12); -- this.bindEntityTexture(var1); -+ this.bindEntityTexture(par1EntityBoat); - GL11.glScalef(-1.0F, -1.0F, 1.0F); -- this.modelBoat.render(var1, 0.0F, 0.0F, -0.1F, 0.0F, 0.0F, 1.0F / 16.0F); -+ this.modelBoat.render(par1EntityBoat, 0.0F, 0.0F, -0.1F, 0.0F, 0.0F, 0.0625F); - GL11.glPopMatrix(); - } - -- protected ResourceLocation getBoatTextures(EntityBoat var1) { -+ protected ResourceLocation getBoatTextures(EntityBoat par1EntityBoat) { - return boatTextures; - } - -- protected ResourceLocation getEntityTexture(Entity var1) { -- return this.getBoatTextures((EntityBoat)var1); -+ /** -+ * Returns the location of an entity's texture. Doesn't seem to be called unless you call Render.bindEntityTexture. -+ */ -+ protected ResourceLocation getEntityTexture(Entity par1Entity) { -+ return this.getBoatTextures((EntityBoat)par1Entity); - } - -- public void doRender(Entity var1, double var2, double var4, double var6, float var8, float var9) { -- this.renderBoat((EntityBoat)var1, var2, var4, var6, var8, var9); -+ /** -+ * Actually renders the given argument. This is a synthetic bridge method, always casting down its argument and then -+ * handing it off to a worker function which does the actual work. In all probabilty, the class Render is generic -+ * (Render -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.api.gui; -+ -+import java.io.IOException; -+import java.util.HashMap; -+import java.util.HashSet; -+import java.util.Set; -+import java.util.UUID; -+ -+import org.lwjgl.opengl.GL11; -+ -+import org.spoutcraft.api.Spoutcraft; -+import org.spoutcraft.api.UnsafeClass; -+import org.spoutcraft.api.io.SpoutInputStream; -+import org.spoutcraft.api.io.SpoutOutputStream; -+ -+@UnsafeClass -+public abstract class GenericScreen extends GenericWidget implements Screen { -+ protected HashMap widgets = new HashMap(); -+ protected int playerId; -+ protected boolean bgvis; -+ protected int mouseX = -1, mouseY = -1; -+ private String spoutcraft = "Spoutcraft"; -+ -+ public GenericScreen() { -+ screenWidth = Spoutcraft.getClient().getRenderDelegate().getScreenWidth(); -+ screenHeight = Spoutcraft.getClient().getRenderDelegate().getScreenHeight(); -+ } -+ -+ public GenericScreen(int playerId) { -+ this.playerId = playerId; -+ } -+ -+ @Override -+ public int getVersion() { -+ return super.getVersion() + 0; -+ } -+ -+ public Widget[] getAttachedWidgets() { -+ return getAttachedWidgets(false); -+ } -+ -+ public Widget[] getAttachedWidgets(boolean recursive) { -+ Widget[] list = new Widget[widgets.size()]; -+ Set allwidgets = new HashSet(); -+ allwidgets.addAll(widgets.keySet()); -+ if (recursive) { -+ for (Widget w:widgets.keySet()) { -+ if (w instanceof Screen) { -+ allwidgets.addAll(((Screen)w).getAttachedWidgetsAsSet(true)); -+ } -+ } -+ } -+ list = allwidgets.toArray(list); -+ -+ // TODO Why is this happening? -+ for (Widget w : list) { -+ if (w.getScreen() == null) { -+ w.setScreen(this); -+ } -+ } -+ return list; -+ } -+ -+ @Deprecated -+ public Screen attachWidget(Widget widget) { -+ return attachWidget(null, widget); -+ } -+ -+ public Screen attachWidget(String addon, Widget widget) { -+ if (addon == null) { -+ addon = spoutcraft; -+ } -+ widgets.put(widget, addon); -+ widget.setAddon(addon); -+ widget.setScreen(this); -+ return this; -+ } -+ -+ public Screen attachWidgets(String addon, Widget ...widgets) { -+ for (Widget widget:widgets) { -+ attachWidget(addon, widget); -+ } -+ return this; -+ } -+ -+ public Screen removeWidget(Widget widget) { -+ widgets.remove(widget); -+ widget.setScreen(null); -+ return this; -+ } -+ -+ public Screen removeWidgets(String addon) { -+ for (Widget i : getAttachedWidgets()) { -+ if (widgets.get(i) != null && widgets.get(i).equals(addon)) { -+ removeWidget(i); -+ } -+ } -+ return this; -+ } -+ -+ public boolean containsWidget(Widget widget) { -+ return containsWidget(widget.getId()); -+ } -+ -+ public boolean containsWidget(UUID id) { -+ return getWidget(id) != null; -+ } -+ -+ public Widget getWidget(UUID id) { -+ for (Widget w : widgets.keySet()) { -+ if (w.getId().equals(id)) { -+ return w; -+ } -+ } -+ return null; -+ } -+ -+ public boolean updateWidget(Widget widget) { -+ if (widgets.containsKey(widget)) { -+ String addon = widgets.get(widget); -+ widgets.remove(widget); -+ widgets.put(widget, addon); -+ widget.setScreen(this); -+ return true; -+ } -+ return false; -+ } -+ -+ @Override -+ public void onTick() { -+ int width = Spoutcraft.getClient().getRenderDelegate().getScreenWidth(); -+ int height = Spoutcraft.getClient().getRenderDelegate().getScreenHeight(); -+ if (width != screenWidth || height != screenHeight) { -+ onScreenResized(screenWidth, screenHeight, width, height); -+ } -+ screenWidth = width; -+ screenHeight = height; -+ for (Widget widget : new HashSet(widgets.keySet())) { -+ try { -+ widget.onTick(); -+ } catch (Exception e) { -+ e.printStackTrace(); -+ } -+ } -+ for (Widget widget : widgets.keySet()) { -+ try { -+ widget.onAnimate(); -+ } catch (Exception e) { -+ e.printStackTrace(); -+ } -+ } -+ } -+ -+ private int screenHeight, screenWidth; -+ -+ @Override -+ public double getHeight() { -+ return screenHeight > 0 ? screenHeight : 240; -+ } -+ -+ @Override -+ public double getWidth() { -+ return screenWidth > 0 ? screenWidth : 427; -+ } -+ -+ public GenericScreen setBgVisible(boolean enable) { -+ bgvis = enable; -+ return this; -+ } -+ -+ public boolean isBgVisible() { -+ return bgvis; -+ } -+ -+ @Override -+ public void readData(SpoutInputStream input) throws IOException { -+ super.readData(input); -+ setBgVisible(input.readBoolean()); -+ } -+ -+ @Override -+ public void writeData(SpoutOutputStream output) throws IOException { -+ super.writeData(output); -+ output.writeBoolean(isBgVisible()); -+ } -+ -+ protected boolean canRender(Widget widget) { -+ return widget.isVisible(); -+ } -+ -+ RenderPriority[] rvalues = RenderPriority.values(); -+ -+ public void render() { -+ for (RenderPriority priority : rvalues) { -+ for (Widget widget : widgets.keySet()) { -+ if (widget.getPriority() == priority && canRender(widget)) { -+ try { -+ GL11.glPushMatrix(); -+ widget.render(); -+ } finally { -+ GL11.glPopMatrix(); -+ } -+ } -+ } -+ } -+ } -+ -+ public Screen setMouseX(int mouseX) { -+ this.mouseX = mouseX; -+ return this; -+ } -+ -+ public Screen setMouseY(int mouseY) { -+ this.mouseY = mouseY; -+ return this; -+ } -+ -+ public int getMouseX() { -+ return mouseX; -+ } -+ -+ public int getMouseY() { -+ return mouseY; -+ } -+ -+ @Override -+ public Widget copy() { -+ throw new UnsupportedOperationException("You can not create a copy of a screen"); -+ } -+ -+ public Set getAttachedWidgetsAsSet() { -+ return getAttachedWidgetsAsSet(false); -+ } -+ -+ public Set getAttachedWidgetsAsSet(boolean recursive) { -+ Set set = new HashSet(); -+ set.addAll(widgets.keySet()); -+ if (recursive) { -+ for (Widget w:widgets.keySet()) { -+ if (w instanceof Screen) { -+ set.addAll(((Screen)w).getAttachedWidgetsAsSet(true)); -+ } -+ } -+ } -+ return set; -+ } -+ -+ protected void onScreenResized(int oldWidth, int oldHeight, int newWidth, int newHeight) { -+ // STUB -+ } -+} ---- net/minecraft/src/CommandServerPublishLocal.java -+++ net/minecraft/src/CommandServerPublishLocal.java -@@ -7,21 +7,24 @@ - return "publish"; - } - -+ /** -+ * Return the required permission level for this command. -+ */ - public int getRequiredPermissionLevel() { - return 4; - } - -- public String getCommandUsage(ICommandSender var1) { -+ public String getCommandUsage(ICommandSender par1ICommandSender) { - return "commands.publish.usage"; - } - -- public void processCommand(ICommandSender var1, String[] var2) { -+ public void processCommand(ICommandSender par1ICommandSender, String[] par2ArrayOfStr) { - String var3 = MinecraftServer.getServer().shareToLAN(EnumGameType.SURVIVAL, false); -- if(var3 != null) { -- notifyAdmins(var1, "commands.publish.started", new Object[]{var3}); -+ -+ if (var3 != null) { -+ notifyAdmins(par1ICommandSender, "commands.publish.started", new Object[] {var3}); - } else { -- notifyAdmins(var1, "commands.publish.failed", new Object[0]); -+ notifyAdmins(par1ICommandSender, "commands.publish.failed", new Object[0]); - } -- - } - } ---- /dev/null -+++ org/spoutcraft/client/gui/settings/controls/DisplayAnimalHeatinColorButton.java -@@ -1,0 +1,38 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.client.gui.settings.controls; -+ -+import net.minecraft.src.Minecraft; -+ -+import org.spoutcraft.client.config.Configuration; -+ -+public class DisplayAnimalHeatinColorButton extends AutomatedCheckBox { -+ public DisplayAnimalHeatinColorButton() { -+ super("Display Animals Heat in Color"); -+ setChecked(Configuration.isDisplayAnimalHeatinColor()); -+ setTooltip("Displays the name of the entity in dark aqua when animal in heat."); -+ } -+ -+ @Override -+ public void onButtonClick() { -+ Configuration.setDisplayAnimalHeatinColor(!Configuration.isDisplayAnimalHeatinColor()); -+ Configuration.write(); -+ } -+} ---- net/minecraft/src/NBTTagList.java -+++ net/minecraft/src/NBTTagList.java -@@ -8,94 +8,126 @@ - import java.util.List; - - public class NBTTagList extends NBTBase { -- private List a = new ArrayList(); -+ -+ /** The array list containing the tags encapsulated in this list. */ -+ // Spout Start - private to public -+ public List tagList = new ArrayList(); -+ // Spout End -+ -+ /** -+ * The type byte for the tags in the list - they must all be of the same type. -+ */ - private byte tagType; - - public NBTTagList() { - super(""); - } - -- public NBTTagList(String var1) { -- super(var1); -+ public NBTTagList(String par1Str) { -+ super(par1Str); - } - -- void write(DataOutput var1) throws IOException { -- if(!this.a.isEmpty()) { -- this.tagType = ((NBTBase)this.a.get(0)).getId(); -+ /** -+ * Write the actual data contents of the tag, implemented in NBT extension classes -+ */ -+ void write(DataOutput par1DataOutput) throws IOException { -+ if (!this.tagList.isEmpty()) { -+ this.tagType = ((NBTBase)this.tagList.get(0)).getId(); - } else { - this.tagType = 1; - } - -- var1.writeByte(this.tagType); -- var1.writeInt(this.a.size()); -+ par1DataOutput.writeByte(this.tagType); -+ par1DataOutput.writeInt(this.tagList.size()); - -- for(int var2 = 0; var2 < this.a.size(); ++var2) { -- ((NBTBase)this.a.get(var2)).write(var1); -+ for (int var2 = 0; var2 < this.tagList.size(); ++var2) { -+ ((NBTBase)this.tagList.get(var2)).write(par1DataOutput); - } -- - } - -- void load(DataInput var1, int var2) throws IOException { -- if(var2 > 512) { -+ /** -+ * Read the actual data contents of the tag, implemented in NBT extension classes -+ */ -+ void load(DataInput par1DataInput, int par2) throws IOException { -+ if (par2 > 512) { - throw new RuntimeException("Tried to read NBT tag with too high complexity, depth > 512"); - } else { -- this.tagType = var1.readByte(); -- int var3 = var1.readInt(); -- this.a = new ArrayList(); -+ this.tagType = par1DataInput.readByte(); -+ int var3 = par1DataInput.readInt(); -+ this.tagList = new ArrayList(); - -- for(int var4 = 0; var4 < var3; ++var4) { -+ for (int var4 = 0; var4 < var3; ++var4) { - NBTBase var5 = NBTBase.newTag(this.tagType, (String)null); -- var5.load(var1, var2 + 1); -- this.a.add(var5); -+ var5.load(par1DataInput, par2 + 1); -+ this.tagList.add(var5); - } -- - } - } - -+ /** -+ * Gets the type byte for the tag. -+ */ - public byte getId() { - return (byte)9; - } - - public String toString() { -- return "" + this.a.size() + " entries of type " + NBTBase.getTagName(this.tagType); -- } -- -- public void appendTag(NBTBase var1) { -- this.tagType = var1.getId(); -- this.a.add(var1); -- } -- -- public NBTBase removeTag(int var1) { -- return (NBTBase)this.a.remove(var1); -- } -- -- public NBTBase tagAt(int var1) { -- return (NBTBase)this.a.get(var1); -- } -- -+ return "" + this.tagList.size() + " entries of type " + NBTBase.getTagName(this.tagType); -+ } -+ -+ /** -+ * Adds the provided tag to the end of the list. There is no check to verify this tag is of the same type as any -+ * previous tag. -+ */ -+ public void appendTag(NBTBase par1NBTBase) { -+ this.tagType = par1NBTBase.getId(); -+ this.tagList.add(par1NBTBase); -+ } -+ -+ /** -+ * Removes a tag at the given index. -+ */ -+ public NBTBase removeTag(int par1) { -+ return (NBTBase)this.tagList.remove(par1); -+ } -+ -+ /** -+ * Retrieves the tag at the specified index from the list. -+ */ -+ public NBTBase tagAt(int par1) { -+ return (NBTBase)this.tagList.get(par1); -+ } -+ -+ /** -+ * Returns the number of tags in the list. -+ */ - public int tagCount() { -- return this.a.size(); -+ return this.tagList.size(); - } - -+ /** -+ * Creates a clone of the tag. -+ */ - public NBTBase copy() { - NBTTagList var1 = new NBTTagList(this.getName()); - var1.tagType = this.tagType; -- Iterator var2 = this.a.iterator(); -+ Iterator var2 = this.tagList.iterator(); - -- while(var2.hasNext()) { -+ while (var2.hasNext()) { - NBTBase var3 = (NBTBase)var2.next(); - NBTBase var4 = var3.copy(); -- var1.a.add(var4); -+ var1.tagList.add(var4); - } - - return var1; - } - -- public boolean equals(Object var1) { -- if(super.equals(var1)) { -- NBTTagList var2 = (NBTTagList)var1; -- if(this.tagType == var2.tagType) { -- return this.a.equals(var2.a); -+ public boolean equals(Object par1Obj) { -+ if (super.equals(par1Obj)) { -+ NBTTagList var2 = (NBTTagList)par1Obj; -+ -+ if (this.tagType == var2.tagType) { -+ return this.tagList.equals(var2.tagList); - } - } - -@@ -103,6 +135,6 @@ - } - - public int hashCode() { -- return super.hashCode() ^ this.a.hashCode(); -+ return super.hashCode() ^ this.tagList.hashCode(); - } - } ---- net/minecraft/src/EnchantmentUntouching.java -+++ net/minecraft/src/EnchantmentUntouching.java -@@ -1,28 +1,40 @@ - package net.minecraft.src; - - public class EnchantmentUntouching extends Enchantment { -- protected EnchantmentUntouching(int var1, int var2) { -- super(var1, var2, EnumEnchantmentType.digger); -+ protected EnchantmentUntouching(int par1, int par2) { -+ super(par1, par2, EnumEnchantmentType.digger); - this.setName("untouching"); - } - -- public int getMinEnchantability(int var1) { -+ /** -+ * Returns the minimal value of enchantability needed on the enchantment level passed. -+ */ -+ public int getMinEnchantability(int par1) { - return 15; - } - -- public int getMaxEnchantability(int var1) { -- return super.getMinEnchantability(var1) + 50; -+ /** -+ * Returns the maximum value of enchantability nedded on the enchantment level passed. -+ */ -+ public int getMaxEnchantability(int par1) { -+ return super.getMinEnchantability(par1) + 50; - } - -+ /** -+ * Returns the maximum level that the enchantment can have. -+ */ - public int getMaxLevel() { - return 1; - } - -- public boolean canApplyTogether(Enchantment var1) { -- return super.canApplyTogether(var1) && var1.effectId != fortune.effectId; -+ /** -+ * Determines if the enchantment passed can be applyied together with this enchantment. -+ */ -+ public boolean canApplyTogether(Enchantment par1Enchantment) { -+ return super.canApplyTogether(par1Enchantment) && par1Enchantment.effectId != fortune.effectId; - } - -- public boolean canApply(ItemStack var1) { -- return var1.getItem().itemID == Item.shears.itemID ? true : super.canApply(var1); -+ public boolean canApply(ItemStack par1ItemStack) { -+ return par1ItemStack.getItem().itemID == Item.shears.itemID ? true : super.canApply(par1ItemStack); - } - } ---- net/minecraft/src/DedicatedServer.java -+++ net/minecraft/src/DedicatedServer.java -@@ -10,7 +10,7 @@ - import net.minecraft.server.MinecraftServer; - - public class DedicatedServer extends MinecraftServer implements IServer { -- private final List l = Collections.synchronizedList(new ArrayList()); -+ private final List pendingCommandList = Collections.synchronizedList(new ArrayList()); - private final ILogAgent field_98131_l; - private RConThreadQuery theRConThreadQuery; - private RConThreadMain theRConThreadMain; -@@ -20,41 +20,47 @@ - private NetworkListenThread networkThread; - private boolean guiIsEnabled; - -- public DedicatedServer(File var1) { -- super(var1); -- this.field_98131_l = new LogAgent("Minecraft-Server", (String)null, (new File(var1, "server.log")).getAbsolutePath()); -+ public DedicatedServer(File par1File) { -+ super(par1File); -+ this.field_98131_l = new LogAgent("Minecraft-Server", (String)null, (new File(par1File, "server.log")).getAbsolutePath()); - new DedicatedServerSleepThread(this); - } - -+ /** -+ * Initialises the server and starts it. -+ */ - protected boolean startServer() throws IOException { - DedicatedServerCommandThread var1 = new DedicatedServerCommandThread(this); - var1.setDaemon(true); - var1.start(); - this.getLogAgent().logInfo("Starting minecraft server version 1.6.4"); -- if(Runtime.getRuntime().maxMemory() / 1024L / 1024L < 512L) { -+ -+ if (Runtime.getRuntime().maxMemory() / 1024L / 1024L < 512L) { - this.getLogAgent().logWarning("To start the server with more ram, launch it as \"java -Xmx1024M -Xms1024M -jar minecraft_server.jar\""); - } - - this.getLogAgent().logInfo("Loading properties"); - this.settings = new PropertyManager(new File("server.properties"), this.getLogAgent()); -- if(this.isSinglePlayer()) { -+ -+ if (this.isSinglePlayer()) { - this.setHostname("127.0.0.1"); - } else { - this.setOnlineMode(this.settings.getBooleanProperty("online-mode", true)); -- this.setHostname(this.settings.getStringProperty("server-ip", "")); -+ this.setHostname(this.settings.getProperty("server-ip", "")); - } - - this.setCanSpawnAnimals(this.settings.getBooleanProperty("spawn-animals", true)); - this.setCanSpawnNPCs(this.settings.getBooleanProperty("spawn-npcs", true)); - this.setAllowPvp(this.settings.getBooleanProperty("pvp", true)); - this.setAllowFlight(this.settings.getBooleanProperty("allow-flight", false)); -- this.setTexturePack(this.settings.getStringProperty("texture-pack", "")); -- this.setMOTD(this.settings.getStringProperty("motd", "A Minecraft Server")); -+ this.setTexturePack(this.settings.getProperty("texture-pack", "")); -+ this.setMOTD(this.settings.getProperty("motd", "A Minecraft Server")); - this.setForceGamemode(this.settings.getBooleanProperty("force-gamemode", false)); - this.func_143006_e(this.settings.getIntProperty("player-idle-timeout", 0)); -- if(this.settings.getIntProperty("difficulty", 1) < 0) { -+ -+ if (this.settings.getIntProperty("difficulty", 1) < 0) { - this.settings.setProperty("difficulty", Integer.valueOf(0)); -- } else if(this.settings.getIntProperty("difficulty", 1) > 3) { -+ } else if (this.settings.getIntProperty("difficulty", 1) > 3) { - this.settings.setProperty("difficulty", Integer.valueOf(3)); - } - -@@ -63,28 +69,29 @@ - this.gameType = WorldSettings.getGameTypeById(var2); - this.getLogAgent().logInfo("Default game type: " + this.gameType); - InetAddress var3 = null; -- if(this.getServerHostname().length() > 0) { -+ -+ if (this.getServerHostname().length() > 0) { - var3 = InetAddress.getByName(this.getServerHostname()); - } - -- if(this.getServerPort() < 0) { -+ if (this.getServerPort() < 0) { - this.setServerPort(this.settings.getIntProperty("server-port", 25565)); - } - - this.getLogAgent().logInfo("Generating keypair"); -- this.setKeyPair(CryptManager.generateKeyPair()); -+ this.setKeyPair(CryptManager.createNewKeyPair()); - this.getLogAgent().logInfo("Starting Minecraft server on " + (this.getServerHostname().length() == 0 ? "*" : this.getServerHostname()) + ":" + this.getServerPort()); - - try { - this.networkThread = new DedicatedServerListenThread(this, var3, this.getServerPort()); - } catch (IOException var16) { - this.getLogAgent().logWarning("**** FAILED TO BIND TO PORT!"); -- this.getLogAgent().logWarningFormatted("The exception was: {0}", new Object[]{var16.toString()}); -+ this.getLogAgent().logWarningFormatted("The exception was: {0}", new Object[] {var16.toString()}); - this.getLogAgent().logWarning("Perhaps a server is already running on that port?"); - return false; - } - -- if(!this.isServerInOnlineMode()) { -+ if (!this.isServerInOnlineMode()) { - this.getLogAgent().logWarning("**** SERVER IS RUNNING IN OFFLINE/INSECURE MODE!"); - this.getLogAgent().logWarning("The server will make no attempt to authenticate usernames. Beware."); - this.getLogAgent().logWarning("While this makes the game possible to play without internet access, it also opens up the ability for hackers to connect with any username they choose."); -@@ -93,18 +100,21 @@ - - this.setConfigurationManager(new DedicatedPlayerList(this)); - long var4 = System.nanoTime(); -- if(this.getFolderName() == null) { -- this.setFolderName(this.settings.getStringProperty("level-name", "world")); -+ -+ if (this.getFolderName() == null) { -+ this.setFolderName(this.settings.getProperty("level-name", "world")); - } - -- String var6 = this.settings.getStringProperty("level-seed", ""); -- String var7 = this.settings.getStringProperty("level-type", "DEFAULT"); -- String var8 = this.settings.getStringProperty("generator-settings", ""); -+ String var6 = this.settings.getProperty("level-seed", ""); -+ String var7 = this.settings.getProperty("level-type", "DEFAULT"); -+ String var8 = this.settings.getProperty("generator-settings", ""); - long var9 = (new Random()).nextLong(); -- if(var6.length() > 0) { -+ -+ if (var6.length() > 0) { - try { - long var11 = Long.parseLong(var6); -- if(var11 != 0L) { -+ -+ if (var11 != 0L) { - var9 = var11; - } - } catch (NumberFormatException var15) { -@@ -113,7 +123,8 @@ - } - - WorldType var17 = WorldType.parseWorldType(var7); -- if(var17 == null) { -+ -+ if (var17 == null) { - var17 = WorldType.DEFAULT; - } - -@@ -124,15 +135,16 @@ - this.getLogAgent().logInfo("Preparing level \"" + this.getFolderName() + "\""); - this.loadAllWorlds(this.getFolderName(), this.getFolderName(), var9, var17, var8); - long var12 = System.nanoTime() - var4; -- String var14 = String.format("%.3fs", new Object[]{Double.valueOf((double)var12 / 1.0E9D)}); -+ String var14 = String.format("%.3fs", new Object[] {Double.valueOf((double)var12 / 1.0E9D)}); - this.getLogAgent().logInfo("Done (" + var14 + ")! For help, type \"help\" or \"?\""); -- if(this.settings.getBooleanProperty("enable-query", false)) { -+ -+ if (this.settings.getBooleanProperty("enable-query", false)) { - this.getLogAgent().logInfo("Starting GS4 status listener"); - this.theRConThreadQuery = new RConThreadQuery(this); - this.theRConThreadQuery.startThread(); - } - -- if(this.settings.getBooleanProperty("enable-rcon", false)) { -+ if (this.settings.getBooleanProperty("enable-rcon", false)) { - this.getLogAgent().logInfo("Starting remote control listener"); - this.theRConThreadMain = new RConThreadMain(this); - this.theRConThreadMain.startThread(); -@@ -149,16 +161,25 @@ - return this.gameType; - } - -+ /** -+ * Defaults to "1" (Easy) for the dedicated server, defaults to "2" (Normal) on the client. -+ */ - public int getDifficulty() { - return this.settings.getIntProperty("difficulty", 1); - } - -+ /** -+ * Defaults to false. -+ */ - public boolean isHardcore() { - return this.settings.getBooleanProperty("hardcore", false); - } - -- protected void finalTick(CrashReport var1) { -- while(this.isServerRunning()) { -+ /** -+ * Called on exit from the main run() loop. -+ */ -+ protected void finalTick(CrashReport par1CrashReport) { -+ while (this.isServerRunning()) { - this.executePendingCommands(); - - try { -@@ -167,21 +188,26 @@ - var3.printStackTrace(); - } - } -- -- } -- -- public CrashReport addServerInfoToCrashReport(CrashReport var1) { -- var1 = super.addServerInfoToCrashReport(var1); -- var1.getCategory().addCrashSectionCallable("Is Modded", new CallableType(this)); -- var1.getCategory().addCrashSectionCallable("Type", new CallableServerType(this)); -- return var1; -- } -- -+ } -+ -+ /** -+ * Adds the server info, including from theWorldServer, to the crash report. -+ */ -+ public CrashReport addServerInfoToCrashReport(CrashReport par1CrashReport) { -+ par1CrashReport = super.addServerInfoToCrashReport(par1CrashReport); -+ par1CrashReport.getCategory().addCrashSectionCallable("Is Modded", new CallableType(this)); -+ par1CrashReport.getCategory().addCrashSectionCallable("Type", new CallableServerType(this)); -+ return par1CrashReport; -+ } -+ -+ /** -+ * Directly calls System.exit(0), instantly killing the program. -+ */ - protected void systemExitNow() { - System.exit(0); - } - -- protected void updateTimeLightAndEntities() { -+ public void updateTimeLightAndEntities() { - super.updateTimeLightAndEntities(); - this.executePendingCommands(); - } -@@ -194,26 +220,28 @@ - return this.settings.getBooleanProperty("spawn-monsters", true); - } - -- public void addServerStatsToSnooper(PlayerUsageSnooper var1) { -- var1.addData("whitelist_enabled", Boolean.valueOf(this.getDedicatedPlayerList().isWhiteListEnabled())); -- var1.addData("whitelist_count", Integer.valueOf(this.getDedicatedPlayerList().getWhiteListedPlayers().size())); -- super.addServerStatsToSnooper(var1); -+ public void addServerStatsToSnooper(PlayerUsageSnooper par1PlayerUsageSnooper) { -+ par1PlayerUsageSnooper.addData("whitelist_enabled", Boolean.valueOf(this.getDedicatedPlayerList().isWhiteListEnabled())); -+ par1PlayerUsageSnooper.addData("whitelist_count", Integer.valueOf(this.getDedicatedPlayerList().getWhiteListedPlayers().size())); -+ super.addServerStatsToSnooper(par1PlayerUsageSnooper); - } - -+ /** -+ * Returns whether snooping is enabled or not. -+ */ - public boolean isSnooperEnabled() { - return this.settings.getBooleanProperty("snooper-enabled", true); - } - -- public void addPendingCommand(String var1, ICommandSender var2) { -- this.l.add(new ServerCommand(var1, var2)); -+ public void addPendingCommand(String par1Str, ICommandSender par2ICommandSender) { -+ this.pendingCommandList.add(new ServerCommand(par1Str, par2ICommandSender)); - } - - public void executePendingCommands() { -- while(!this.l.isEmpty()) { -- ServerCommand var1 = (ServerCommand)this.l.remove(0); -- this.getCommandManager().executeCommand(var1.sender, var1.a); -+ while (!this.pendingCommandList.isEmpty()) { -+ ServerCommand var1 = (ServerCommand)this.pendingCommandList.remove(0); -+ this.getCommandManager().executeCommand(var1.sender, var1.command); - } -- - } - - public boolean isDedicatedServer() { -@@ -228,26 +256,44 @@ - return this.networkThread; - } - -- public int getIntProperty(String var1, int var2) { -- return this.settings.getIntProperty(var1, var2); -- } -- -- public String getStringProperty(String var1, String var2) { -- return this.settings.getStringProperty(var1, var2); -- } -- -- public boolean getBooleanProperty(String var1, boolean var2) { -- return this.settings.getBooleanProperty(var1, var2); -- } -- -- public void setProperty(String var1, Object var2) { -- this.settings.setProperty(var1, var2); -- } -- -+ /** -+ * Gets an integer property. If it does not exist, set it to the specified value. -+ */ -+ public int getIntProperty(String par1Str, int par2) { -+ return this.settings.getIntProperty(par1Str, par2); -+ } -+ -+ /** -+ * Gets a string property. If it does not exist, set it to the specified value. -+ */ -+ public String getStringProperty(String par1Str, String par2Str) { -+ return this.settings.getProperty(par1Str, par2Str); -+ } -+ -+ /** -+ * Gets a boolean property. If it does not exist, set it to the specified value. -+ */ -+ public boolean getBooleanProperty(String par1Str, boolean par2) { -+ return this.settings.getBooleanProperty(par1Str, par2); -+ } -+ -+ /** -+ * Saves an Object with the given property name. -+ */ -+ public void setProperty(String par1Str, Object par2Obj) { -+ this.settings.setProperty(par1Str, par2Obj); -+ } -+ -+ /** -+ * Saves all of the server properties to the properties file. -+ */ - public void saveProperties() { - this.settings.saveProperties(); - } - -+ /** -+ * Returns the filename where server properties are stored -+ */ - public String getSettingsFilename() { - File var1 = this.settings.getPropertiesFile(); - return var1 != null ? var1.getAbsolutePath() : "No settings file"; -@@ -257,31 +303,43 @@ - return this.guiIsEnabled; - } - -- public String shareToLAN(EnumGameType var1, boolean var2) { -+ /** -+ * On dedicated does nothing. On integrated, sets commandsAllowedForAll, gameType and allows external connections. -+ */ -+ public String shareToLAN(EnumGameType par1EnumGameType, boolean par2) { - return ""; - } - -+ /** -+ * Return whether command blocks are enabled. -+ */ - public boolean isCommandBlockEnabled() { - return this.settings.getBooleanProperty("enable-command-block", false); - } - -+ /** -+ * Return the spawn protection area's size. -+ */ - public int getSpawnProtectionSize() { - return this.settings.getIntProperty("spawn-protection", super.getSpawnProtectionSize()); - } - -- public boolean isBlockProtected(World var1, int var2, int var3, int var4, EntityPlayer var5) { -- if(var1.provider.dimensionId != 0) { -- return false; -- } else if(this.getDedicatedPlayerList().getOps().isEmpty()) { -- return false; -- } else if(this.getDedicatedPlayerList().isPlayerOpped(var5.getCommandSenderName())) { -- return false; -- } else if(this.getSpawnProtectionSize() <= 0) { -+ /** -+ * Returns true if a player does not have permission to edit the block at the given coordinates. -+ */ -+ public boolean isBlockProtected(World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer) { -+ if (par1World.provider.dimensionId != 0) { -+ return false; -+ } else if (this.getDedicatedPlayerList().getOps().isEmpty()) { -+ return false; -+ } else if (this.getDedicatedPlayerList().isPlayerOpped(par5EntityPlayer.getCommandSenderName())) { -+ return false; -+ } else if (this.getSpawnProtectionSize() <= 0) { - return false; - } else { -- ChunkCoordinates var6 = var1.getSpawnPoint(); -- int var7 = MathHelper.abs_int(var2 - var6.posX); -- int var8 = MathHelper.abs_int(var4 - var6.posZ); -+ ChunkCoordinates var6 = par1World.getSpawnPoint(); -+ int var7 = MathHelper.abs_int(par2 - var6.posX); -+ int var8 = MathHelper.abs_int(par4 - var6.posZ); - int var9 = Math.max(var7, var8); - return var9 <= this.getSpawnProtectionSize(); - } -@@ -295,9 +353,9 @@ - return this.settings.getIntProperty("op-permission-level", 4); - } - -- public void func_143006_e(int var1) { -- super.func_143006_e(var1); -- this.settings.setProperty("player-idle-timeout", Integer.valueOf(var1)); -+ public void func_143006_e(int par1) { -+ super.func_143006_e(par1); -+ this.settings.setProperty("player-idle-timeout", Integer.valueOf(par1)); - this.saveProperties(); - } - ---- net/minecraft/src/KeyBinding.java -+++ net/minecraft/src/KeyBinding.java -@@ -5,59 +5,83 @@ - import java.util.List; - - public class KeyBinding { -- public static List a = new ArrayList(); -+ public static List keybindArray = new ArrayList(); - public static IntHashMap hash = new IntHashMap(); -- public String c; -+ public String keyDescription; - public int keyCode; -+ -+ /** because _303 wanted me to call it that(Caironater) */ - public boolean pressed; - public int pressTime; - -- public static void onTick(int var0) { -- KeyBinding var1 = (KeyBinding)hash.lookup(var0); -- if(var1 != null) { -+ public static void onTick(int par0) { -+ // Spout Start -+ /* -+ KeyBinding var1 = (KeyBinding)hash.lookup(par0); -+ -+ if (var1 != null) { - ++var1.pressTime; - } -+ */ -+ Iterator i = keybindArray.iterator(); - -+ while (i.hasNext()) { -+ KeyBinding key = (KeyBinding)i.next(); -+ if (key.keyCode == par0) { -+ key.pressTime++; -+ } -+ } -+ // Spout End - } - -- public static void setKeyBindState(int var0, boolean var1) { -- KeyBinding var2 = (KeyBinding)hash.lookup(var0); -- if(var2 != null) { -- var2.pressed = var1; -- } -- -+ public static void setKeyBindState(int par0, boolean par1) { -+ // Spout Start -+ /* -+ KeyBinding var2 = (KeyBinding)hash.lookup(par0); -+ -+ if (var2 != null) { -+ var2.pressed = par1; -+ } -+ */ -+ Iterator i = keybindArray.iterator(); -+ -+ while (i.hasNext()) { -+ KeyBinding key = (KeyBinding)i.next(); -+ if (key.keyCode == par0) { -+ key.pressed = par1; -+ } -+ } -+ // Spout End - } - - public static void unPressAllKeys() { -- Iterator var0 = a.iterator(); -+ Iterator var0 = keybindArray.iterator(); - -- while(var0.hasNext()) { -+ while (var0.hasNext()) { - KeyBinding var1 = (KeyBinding)var0.next(); - var1.unpressKey(); - } -- - } - - public static void resetKeyBindingArrayAndHash() { - hash.clearMap(); -- Iterator var0 = a.iterator(); -+ Iterator var0 = keybindArray.iterator(); - -- while(var0.hasNext()) { -+ while (var0.hasNext()) { - KeyBinding var1 = (KeyBinding)var0.next(); - hash.addKey(var1.keyCode, var1); - } -- - } - -- public KeyBinding(String var1, int var2) { -- this.c = var1; -- this.keyCode = var2; -- a.add(this); -- hash.addKey(var2, this); -+ public KeyBinding(String par1Str, int par2) { -+ this.keyDescription = par1Str; -+ this.keyCode = par2; -+ keybindArray.add(this); -+ hash.addKey(par2, this); - } - - public boolean isPressed() { -- if(this.pressTime == 0) { -+ if (this.pressTime == 0) { - return false; - } else { - --this.pressTime; ---- net/minecraft/src/ModelDragon.java -+++ net/minecraft/src/ModelDragon.java -@@ -3,21 +3,45 @@ - import org.lwjgl.opengl.GL11; - - public class ModelDragon extends ModelBase { -+ -+ /** The head Model renderer of the dragon */ - private ModelRenderer head; -+ -+ /** The spine Model renderer of the dragon */ - private ModelRenderer spine; -+ -+ /** The jaw Model renderer of the dragon */ - private ModelRenderer jaw; -+ -+ /** The body Model renderer of the dragon */ - private ModelRenderer body; -+ -+ /** The rear leg Model renderer of the dragon */ - private ModelRenderer rearLeg; -+ -+ /** The front leg Model renderer of the dragon */ - private ModelRenderer frontLeg; -+ -+ /** The rear leg tip Model renderer of the dragon */ - private ModelRenderer rearLegTip; -+ -+ /** The front leg tip Model renderer of the dragon */ - private ModelRenderer frontLegTip; -+ -+ /** The rear foot Model renderer of the dragon */ - private ModelRenderer rearFoot; -+ -+ /** The front foot Model renderer of the dragon */ - private ModelRenderer frontFoot; -+ -+ /** The wing Model renderer of the dragon */ - private ModelRenderer wing; -+ -+ /** The wing tip Model renderer of the dragon */ - private ModelRenderer wingTip; - private float partialTicks; - -- public ModelDragon(float var1) { -+ public ModelDragon(float par1) { - this.textureWidth = 256; - this.textureHeight = 256; - this.setTextureOffset("body.body", 0, 0); -@@ -95,13 +119,20 @@ - this.rearLegTip.addChild(this.rearFoot); - } - -- public void setLivingAnimations(EntityLivingBase var1, float var2, float var3, float var4) { -- this.partialTicks = var4; -+ /** -+ * Used for easily adding entity-dependent animations. The second and third float params here are the same second and -+ * third as in the setRotationAngles method. -+ */ -+ public void setLivingAnimations(EntityLivingBase par1EntityLivingBase, float par2, float par3, float par4) { -+ this.partialTicks = par4; - } - -- public void render(Entity var1, float var2, float var3, float var4, float var5, float var6, float var7) { -+ /** -+ * Sets the models various rotation angles then renders the model. -+ */ -+ public void render(Entity par1Entity, float par2, float par3, float par4, float par5, float par6, float par7) { - GL11.glPushMatrix(); -- EntityDragon var8 = (EntityDragon)var1; -+ EntityDragon var8 = (EntityDragon)par1Entity; - float var9 = var8.prevAnimTime + (var8.animTime - var8.prevAnimTime) * this.partialTicks; - this.jaw.rotateAngleX = (float)(Math.sin((double)(var9 * (float)Math.PI * 2.0F)) + 1.0D) * 0.2F; - float var10 = (float)(Math.sin((double)(var9 * (float)Math.PI * 2.0F - 1.0F)) + 1.0D); -@@ -118,9 +149,9 @@ - float var18 = var9 * (float)Math.PI * 2.0F; - var11 = 20.0F; - float var12 = -12.0F; -- - float var21; -- for(int var19 = 0; var19 < 5; ++var19) { -+ -+ for (int var19 = 0; var19 < 5; ++var19) { - double[] var20 = var8.getMovementOffsets(5 - var19, this.partialTicks); - var21 = (float)Math.cos((double)((float)var19 * 0.45F + var18)) * 0.15F; - this.spine.rotateAngleY = this.updateRotations(var20[0] - var15[0]) * (float)Math.PI / 180.0F * var14; -@@ -132,7 +163,7 @@ - var11 = (float)((double)var11 + Math.sin((double)this.spine.rotateAngleX) * 10.0D); - var12 = (float)((double)var12 - Math.cos((double)this.spine.rotateAngleY) * Math.cos((double)this.spine.rotateAngleX) * 10.0D); - var13 = (float)((double)var13 - Math.sin((double)this.spine.rotateAngleY) * Math.cos((double)this.spine.rotateAngleX) * 10.0D); -- this.spine.render(var7); -+ this.spine.render(par7); - } - - this.head.rotationPointY = var11; -@@ -141,32 +172,33 @@ - double[] var22 = var8.getMovementOffsets(0, this.partialTicks); - this.head.rotateAngleY = this.updateRotations(var22[0] - var15[0]) * (float)Math.PI / 180.0F * 1.0F; - this.head.rotateAngleZ = -this.updateRotations(var22[0] - (double)var17) * (float)Math.PI / 180.0F * 1.0F; -- this.head.render(var7); -+ this.head.render(par7); - GL11.glPushMatrix(); - GL11.glTranslatef(0.0F, 1.0F, 0.0F); - GL11.glRotatef(-var16 * var14 * 1.0F, 0.0F, 0.0F, 1.0F); - GL11.glTranslatef(0.0F, -1.0F, 0.0F); - this.body.rotateAngleZ = 0.0F; -- this.body.render(var7); -+ this.body.render(par7); - -- for(int var23 = 0; var23 < 2; ++var23) { -+ for (int var23 = 0; var23 < 2; ++var23) { - GL11.glEnable(GL11.GL_CULL_FACE); - var21 = var9 * (float)Math.PI * 2.0F; -- this.wing.rotateAngleX = 2.0F / 16.0F - (float)Math.cos((double)var21) * 0.2F; -+ this.wing.rotateAngleX = 0.125F - (float)Math.cos((double)var21) * 0.2F; - this.wing.rotateAngleY = 0.25F; - this.wing.rotateAngleZ = (float)(Math.sin((double)var21) + 0.125D) * 0.8F; -- this.wingTip.rotateAngleZ = -((float)(Math.sin((double)(var21 + 2.0F)) + 0.5D)) * (12.0F / 16.0F); -+ this.wingTip.rotateAngleZ = -((float)(Math.sin((double)(var21 + 2.0F)) + 0.5D)) * 0.75F; - this.rearLeg.rotateAngleX = 1.0F + var10 * 0.1F; - this.rearLegTip.rotateAngleX = 0.5F + var10 * 0.1F; -- this.rearFoot.rotateAngleX = 12.0F / 16.0F + var10 * 0.1F; -+ this.rearFoot.rotateAngleX = 0.75F + var10 * 0.1F; - this.frontLeg.rotateAngleX = 1.3F + var10 * 0.1F; - this.frontLegTip.rotateAngleX = -0.5F - var10 * 0.1F; -- this.frontFoot.rotateAngleX = 12.0F / 16.0F + var10 * 0.1F; -- this.wing.render(var7); -- this.frontLeg.render(var7); -- this.rearLeg.render(var7); -+ this.frontFoot.rotateAngleX = 0.75F + var10 * 0.1F; -+ this.wing.render(par7); -+ this.frontLeg.render(par7); -+ this.rearLeg.render(par7); - GL11.glScalef(-1.0F, 1.0F, 1.0F); -- if(var23 == 0) { -+ -+ if (var23 == 0) { - GL11.glCullFace(GL11.GL_FRONT); - } - } -@@ -181,9 +213,9 @@ - var13 = 0.0F; - var15 = var8.getMovementOffsets(11, this.partialTicks); - -- for(int var25 = 0; var25 < 12; ++var25) { -+ for (int var25 = 0; var25 < 12; ++var25) { - var22 = var8.getMovementOffsets(12 + var25, this.partialTicks); -- var24 = (float)((double)var24 + Math.sin((double)((float)var25 * 0.45F + var18)) * (double)0.05F); -+ var24 = (float)((double)var24 + Math.sin((double)((float)var25 * 0.45F + var18)) * 0.05000000074505806D); - this.spine.rotateAngleY = (this.updateRotations(var22[0] - var15[0]) * var14 + 180.0F) * (float)Math.PI / 180.0F; - this.spine.rotateAngleX = var24 + (float)(var22[1] - var15[1]) * (float)Math.PI / 180.0F * var14 * 5.0F; - this.spine.rotateAngleZ = this.updateRotations(var22[0] - (double)var17) * (float)Math.PI / 180.0F * var14; -@@ -193,21 +225,26 @@ - var11 = (float)((double)var11 + Math.sin((double)this.spine.rotateAngleX) * 10.0D); - var12 = (float)((double)var12 - Math.cos((double)this.spine.rotateAngleY) * Math.cos((double)this.spine.rotateAngleX) * 10.0D); - var13 = (float)((double)var13 - Math.sin((double)this.spine.rotateAngleY) * Math.cos((double)this.spine.rotateAngleX) * 10.0D); -- this.spine.render(var7); -+ this.spine.render(par7); - } - - GL11.glPopMatrix(); - } - -- private float updateRotations(double var1) { -- while(var1 >= 180.0D) { -- var1 -= 360.0D; -- } -- -- while(var1 < -180.0D) { -- var1 += 360.0D; -- } -- -- return (float)var1; -+ /** -+ * Updates the rotations in the parameters for rotations greater than 180 degrees or less than -180 degrees. It adds or -+ * subtracts 360 degrees, so that the appearance is the same, although the numbers are then simplified to range -180 to -+ * 180 -+ */ -+ private float updateRotations(double par1) { -+ while (par1 >= 180.0D) { -+ par1 -= 360.0D; -+ } -+ -+ while (par1 < -180.0D) { -+ par1 += 360.0D; -+ } -+ -+ return (float)par1; - } - } ---- net/minecraft/src/CallableBlockLocation.java -+++ net/minecraft/src/CallableBlockLocation.java -@@ -4,13 +4,15 @@ - - final class CallableBlockLocation implements Callable { - final int blockXCoord; -+ - final int blockYCoord; -+ - final int blockZCoord; - -- CallableBlockLocation(int var1, int var2, int var3) { -- this.blockXCoord = var1; -- this.blockYCoord = var2; -- this.blockZCoord = var3; -+ CallableBlockLocation(int par1, int par2, int par3) { -+ this.blockXCoord = par1; -+ this.blockYCoord = par2; -+ this.blockZCoord = par3; - } - - public String callBlockLocationInfo() { ---- /dev/null -+++ com/prupe/mcpatcher/ctm/TileOverrideImpl$Repeat.java -@@ -1,0 +1,106 @@ -+package com.prupe.mcpatcher.ctm; -+ -+import com.prupe.mcpatcher.MCPatcherUtils; -+import com.prupe.mcpatcher.TileLoader; -+import java.util.Properties; -+import net.minecraft.src.Block; -+import net.minecraft.src.IBlockAccess; -+import net.minecraft.src.Icon; -+import net.minecraft.src.ResourceLocation; -+ -+final class TileOverrideImpl$Repeat extends TileOverride { -+ private final int width; -+ private final int height; -+ private final int symmetry; -+ -+ TileOverrideImpl$Repeat(ResourceLocation filePrefix, Properties properties, TileLoader tileLoader) { -+ super(filePrefix, properties, tileLoader); -+ this.width = MCPatcherUtils.getIntProperty(properties, "width", 0); -+ this.height = MCPatcherUtils.getIntProperty(properties, "height", 0); -+ -+ if (this.width <= 0 || this.height <= 0) { -+ this.error("invalid width and height (%dx%d)", new Object[] {Integer.valueOf(this.width), Integer.valueOf(this.height)}); -+ } -+ -+ String sym = properties.getProperty("symmetry", "none"); -+ -+ if (sym.equals("opposite")) { -+ this.symmetry = -2; -+ } else { -+ this.symmetry = -1; -+ } -+ } -+ -+ String getMethod() { -+ return "repeat"; -+ } -+ -+ String checkTileMap() { -+ return this.getNumberOfTiles() == this.width * this.height ? null : String.format("requires exactly %dx%d tiles", new Object[] {Integer.valueOf(this.width), Integer.valueOf(this.height)}); -+ } -+ -+ Icon getTileImpl(IBlockAccess blockAccess, Block block, Icon origIcon, int i, int j, int k, int face) { -+ if (face < 0) { -+ face = 0; -+ } -+ -+ face &= this.symmetry; -+ int x; -+ int y; -+ -+ switch (face) { -+ case 0: -+ case 1: -+ if (this.rotateTop) { -+ x = k; -+ y = i; -+ } else { -+ x = i; -+ y = k; -+ } -+ -+ break; -+ -+ case 2: -+ x = -i - 1; -+ y = -j; -+ break; -+ -+ case 3: -+ x = i; -+ y = -j; -+ break; -+ -+ case 4: -+ x = k; -+ y = -j; -+ break; -+ -+ case 5: -+ x = -k - 1; -+ y = -j; -+ break; -+ -+ default: -+ return null; -+ } -+ -+ x %= this.width; -+ -+ if (x < 0) { -+ x += this.width; -+ } -+ -+ y %= this.height; -+ -+ if (y < 0) { -+ y += this.height; -+ } -+ -+ return this.icons[this.width * y + x]; -+ } -+ -+ Icon getTileImpl(Block block, Icon origIcon, int face, int metadata) { -+ return this.icons[0]; -+ } -+} ---- net/minecraft/src/GuiInventory.java -+++ net/minecraft/src/GuiInventory.java -@@ -4,43 +4,65 @@ - import org.lwjgl.opengl.GL12; - - public class GuiInventory extends InventoryEffectRenderer { -+ -+ /** -+ * x size of the inventory window in pixels. Defined as float, passed as int -+ */ - private float xSize_lo; -+ -+ /** -+ * y size of the inventory window in pixels. Defined as float, passed as int. -+ */ - private float ySize_lo; - -- public GuiInventory(EntityPlayer var1) { -- super(var1.inventoryContainer); -+ public GuiInventory(EntityPlayer par1EntityPlayer) { -+ super(par1EntityPlayer.inventoryContainer); - this.allowUserInput = true; -- var1.addStat(AchievementList.openInventory, 1); -+ par1EntityPlayer.addStat(AchievementList.openInventory, 1); - } - -+ /** -+ * Called from the main game loop to update the screen. -+ */ - public void updateScreen() { -- if(this.mc.playerController.isInCreativeMode()) { -+ if (this.mc.playerController.isInCreativeMode()) { - this.mc.displayGuiScreen(new GuiContainerCreative(this.mc.thePlayer)); - } -- - } - -+ /** -+ * Adds the buttons (and other controls) to the screen in question. -+ */ - public void initGui() { -- this.i.clear(); -- if(this.mc.playerController.isInCreativeMode()) { -+ this.buttonList.clear(); -+ -+ if (this.mc.playerController.isInCreativeMode()) { - this.mc.displayGuiScreen(new GuiContainerCreative(this.mc.thePlayer)); - } else { - super.initGui(); - } -- - } - -- protected void drawGuiContainerForegroundLayer(int var1, int var2) { -+ /** -+ * Draw the foreground layer for the GuiContainer (everything in front of the items) -+ */ -+ protected void drawGuiContainerForegroundLayer(int par1, int par2) { - this.fontRenderer.drawString(I18n.getString("container.crafting"), 86, 16, 4210752); - } - -- public void drawScreen(int var1, int var2, float var3) { -- super.drawScreen(var1, var2, var3); -- this.xSize_lo = (float)var1; -- this.ySize_lo = (float)var2; -+ /** -+ * Draws the screen and all the components in it. -+ */ -+ public void drawScreen(int par1, int par2, float par3) { -+ super.drawScreen(par1, par2, par3); -+ this.xSize_lo = (float)par1; -+ this.ySize_lo = (float)par2; - } - -- protected void drawGuiContainerBackgroundLayer(float var1, int var2, int var3) { -+ /** -+ * Draw the background layer for the GuiContainer (everything behind the items) -+ */ -+ protected void drawGuiContainerBackgroundLayer(float par1, int par2, int par3) { - GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - this.mc.getTextureManager().bindTexture(field_110408_a); - int var4 = this.guiLeft; -@@ -49,34 +71,34 @@ - func_110423_a(var4 + 51, var5 + 75, 30, (float)(var4 + 51) - this.xSize_lo, (float)(var5 + 75 - 50) - this.ySize_lo, this.mc.thePlayer); - } - -- public static void func_110423_a(int var0, int var1, int var2, float var3, float var4, EntityLivingBase var5) { -+ public static void func_110423_a(int par0, int par1, int par2, float par3, float par4, EntityLivingBase par5EntityLivingBase) { - GL11.glEnable(GL11.GL_COLOR_MATERIAL); - GL11.glPushMatrix(); -- GL11.glTranslatef((float)var0, (float)var1, 50.0F); -- GL11.glScalef((float)(-var2), (float)var2, (float)var2); -+ GL11.glTranslatef((float)par0, (float)par1, 50.0F); -+ GL11.glScalef((float)(-par2), (float)par2, (float)par2); - GL11.glRotatef(180.0F, 0.0F, 0.0F, 1.0F); -- float var6 = var5.renderYawOffset; -- float var7 = var5.rotationYaw; -- float var8 = var5.rotationPitch; -- float var9 = var5.prevRotationYawHead; -- float var10 = var5.rotationYawHead; -+ float var6 = par5EntityLivingBase.renderYawOffset; -+ float var7 = par5EntityLivingBase.rotationYaw; -+ float var8 = par5EntityLivingBase.rotationPitch; -+ float var9 = par5EntityLivingBase.prevRotationYawHead; -+ float var10 = par5EntityLivingBase.rotationYawHead; - GL11.glRotatef(135.0F, 0.0F, 1.0F, 0.0F); - RenderHelper.enableStandardItemLighting(); - GL11.glRotatef(-135.0F, 0.0F, 1.0F, 0.0F); -- GL11.glRotatef(-((float)Math.atan((double)(var4 / 40.0F))) * 20.0F, 1.0F, 0.0F, 0.0F); -- var5.renderYawOffset = (float)Math.atan((double)(var3 / 40.0F)) * 20.0F; -- var5.rotationYaw = (float)Math.atan((double)(var3 / 40.0F)) * 40.0F; -- var5.rotationPitch = -((float)Math.atan((double)(var4 / 40.0F))) * 20.0F; -- var5.rotationYawHead = var5.rotationYaw; -- var5.prevRotationYawHead = var5.rotationYaw; -- GL11.glTranslatef(0.0F, var5.yOffset, 0.0F); -+ GL11.glRotatef(-((float)Math.atan((double)(par4 / 40.0F))) * 20.0F, 1.0F, 0.0F, 0.0F); -+ par5EntityLivingBase.renderYawOffset = (float)Math.atan((double)(par3 / 40.0F)) * 20.0F; -+ par5EntityLivingBase.rotationYaw = (float)Math.atan((double)(par3 / 40.0F)) * 40.0F; -+ par5EntityLivingBase.rotationPitch = -((float)Math.atan((double)(par4 / 40.0F))) * 20.0F; -+ par5EntityLivingBase.rotationYawHead = par5EntityLivingBase.rotationYaw; -+ par5EntityLivingBase.prevRotationYawHead = par5EntityLivingBase.rotationYaw; -+ GL11.glTranslatef(0.0F, par5EntityLivingBase.yOffset, 0.0F); - RenderManager.instance.playerViewY = 180.0F; -- RenderManager.instance.renderEntityWithPosYaw(var5, 0.0D, 0.0D, 0.0D, 0.0F, 1.0F); -- var5.renderYawOffset = var6; -- var5.rotationYaw = var7; -- var5.rotationPitch = var8; -- var5.prevRotationYawHead = var9; -- var5.rotationYawHead = var10; -+ RenderManager.instance.renderEntityWithPosYaw(par5EntityLivingBase, 0.0D, 0.0D, 0.0D, 0.0F, 1.0F); -+ par5EntityLivingBase.renderYawOffset = var6; -+ par5EntityLivingBase.rotationYaw = var7; -+ par5EntityLivingBase.rotationPitch = var8; -+ par5EntityLivingBase.prevRotationYawHead = var9; -+ par5EntityLivingBase.rotationYawHead = var10; - GL11.glPopMatrix(); - RenderHelper.disableStandardItemLighting(); - GL11.glDisable(GL12.GL_RESCALE_NORMAL); -@@ -85,14 +107,16 @@ - OpenGlHelper.setActiveTexture(OpenGlHelper.defaultTexUnit); - } - -- protected void actionPerformed(GuiButton var1) { -- if(var1.id == 0) { -+ /** -+ * Fired when a control is clicked. This is the equivalent of ActionListener.actionPerformed(ActionEvent e). -+ */ -+ protected void actionPerformed(GuiButton par1GuiButton) { -+ if (par1GuiButton.id == 0) { - this.mc.displayGuiScreen(new GuiAchievements(this.mc.statFileWriter)); - } - -- if(var1.id == 1) { -+ if (par1GuiButton.id == 1) { - this.mc.displayGuiScreen(new GuiStats(this, this.mc.statFileWriter)); - } -- - } - } ---- net/minecraft/src/ISaveHandler.java -+++ net/minecraft/src/ISaveHandler.java -@@ -3,21 +3,49 @@ - import java.io.File; - - public interface ISaveHandler { -+ -+ /** -+ * Loads and returns the world info -+ */ - WorldInfo loadWorldInfo(); - -+ /** -+ * Checks the session lock to prevent save collisions -+ */ - void checkSessionLock() throws MinecraftException; - -+ /** -+ * Returns the chunk loader with the provided world provider -+ */ - IChunkLoader getChunkLoader(WorldProvider var1); - -+ /** -+ * Saves the given World Info with the given NBTTagCompound as the Player. -+ */ - void saveWorldInfoWithPlayer(WorldInfo var1, NBTTagCompound var2); - -+ /** -+ * Saves the passed in world info. -+ */ - void saveWorldInfo(WorldInfo var1); - -- IPlayerFileData getPlayerNBTManager(); -+ /** -+ * returns null if no saveHandler is relevent (eg. SMP) -+ */ -+ IPlayerFileData getSaveHandler(); - -+ /** -+ * Called to flush all changes to disk, waiting for them to complete. -+ */ - void flush(); - -+ /** -+ * Gets the file location of the given map -+ */ - File getMapFileFromName(String var1); - -+ /** -+ * Returns the name of the directory where world information is saved. -+ */ - String getWorldDirectoryName(); - } ---- net/minecraft/src/GenLayerRiverMix.java -+++ net/minecraft/src/GenLayerRiverMix.java -@@ -4,30 +4,38 @@ - private GenLayer biomePatternGeneratorChain; - private GenLayer riverPatternGeneratorChain; - -- public GenLayerRiverMix(long var1, GenLayer var3, GenLayer var4) { -- super(var1); -- this.biomePatternGeneratorChain = var3; -- this.riverPatternGeneratorChain = var4; -- } -- -- public void initWorldGenSeed(long var1) { -- this.biomePatternGeneratorChain.initWorldGenSeed(var1); -- this.riverPatternGeneratorChain.initWorldGenSeed(var1); -- super.initWorldGenSeed(var1); -- } -- -- public int[] getInts(int var1, int var2, int var3, int var4) { -- int[] var5 = this.biomePatternGeneratorChain.getInts(var1, var2, var3, var4); -- int[] var6 = this.riverPatternGeneratorChain.getInts(var1, var2, var3, var4); -- int[] var7 = IntCache.getIntCache(var3 * var4); -- -- for(int var8 = 0; var8 < var3 * var4; ++var8) { -- if(var5[var8] == BiomeGenBase.ocean.biomeID) { -+ public GenLayerRiverMix(long par1, GenLayer par3GenLayer, GenLayer par4GenLayer) { -+ super(par1); -+ this.biomePatternGeneratorChain = par3GenLayer; -+ this.riverPatternGeneratorChain = par4GenLayer; -+ } -+ -+ /** -+ * Initialize layer's local worldGenSeed based on its own baseSeed and the world's global seed (passed in as an -+ * argument). -+ */ -+ public void initWorldGenSeed(long par1) { -+ this.biomePatternGeneratorChain.initWorldGenSeed(par1); -+ this.riverPatternGeneratorChain.initWorldGenSeed(par1); -+ super.initWorldGenSeed(par1); -+ } -+ -+ /** -+ * Returns a list of integer values generated by this layer. These may be interpreted as temperatures, rainfall -+ * amounts, or biomeList[] indices based on the particular GenLayer subclass. -+ */ -+ public int[] getInts(int par1, int par2, int par3, int par4) { -+ int[] var5 = this.biomePatternGeneratorChain.getInts(par1, par2, par3, par4); -+ int[] var6 = this.riverPatternGeneratorChain.getInts(par1, par2, par3, par4); -+ int[] var7 = IntCache.getIntCache(par3 * par4); -+ -+ for (int var8 = 0; var8 < par3 * par4; ++var8) { -+ if (var5[var8] == BiomeGenBase.ocean.biomeID) { - var7[var8] = var5[var8]; -- } else if(var6[var8] >= 0) { -- if(var5[var8] == BiomeGenBase.icePlains.biomeID) { -+ } else if (var6[var8] >= 0) { -+ if (var5[var8] == BiomeGenBase.icePlains.biomeID) { - var7[var8] = BiomeGenBase.frozenRiver.biomeID; -- } else if(var5[var8] != BiomeGenBase.mushroomIsland.biomeID && var5[var8] != BiomeGenBase.mushroomIslandShore.biomeID) { -+ } else if (var5[var8] != BiomeGenBase.mushroomIsland.biomeID && var5[var8] != BiomeGenBase.mushroomIslandShore.biomeID) { - var7[var8] = var6[var8]; - } else { - var7[var8] = BiomeGenBase.mushroomIslandShore.biomeID; ---- net/minecraft/src/ServerAddress.java -+++ net/minecraft/src/ServerAddress.java -@@ -5,48 +5,52 @@ - import javax.naming.directory.InitialDirContext; - - public class ServerAddress { -- private final String a; -+ private final String ipAddress; - private final int serverPort; - -- private ServerAddress(String var1, int var2) { -- this.a = var1; -- this.serverPort = var2; -+ private ServerAddress(String par1Str, int par2) { -+ this.ipAddress = par1Str; -+ this.serverPort = par2; - } - - public String getIP() { -- return this.a; -+ return this.ipAddress; - } - - public int getPort() { - return this.serverPort; - } - -- public static ServerAddress func_78860_a(String var0) { -- if(var0 == null) { -+ public static ServerAddress func_78860_a(String par0Str) { -+ if (par0Str == null) { - return null; - } else { -- String[] var1 = var0.split(":"); -- if(var0.startsWith("[")) { -- int var2 = var0.indexOf("]"); -- if(var2 > 0) { -- String var3 = var0.substring(1, var2); -- String var4 = var0.substring(var2 + 1).trim(); -- if(var4.startsWith(":") && var4.length() > 0) { -+ String[] var1 = par0Str.split(":"); -+ -+ if (par0Str.startsWith("[")) { -+ int var2 = par0Str.indexOf("]"); -+ -+ if (var2 > 0) { -+ String var3 = par0Str.substring(1, var2); -+ String var4 = par0Str.substring(var2 + 1).trim(); -+ -+ if (var4.startsWith(":") && var4.length() > 0) { - var4 = var4.substring(1); -- var1 = new String[]{var3, var4}; -+ var1 = new String[] {var3, var4}; - } else { -- var1 = new String[]{var3}; -+ var1 = new String[] {var3}; - } - } - } - -- if(var1.length > 2) { -- var1 = new String[]{var0}; -+ if (var1.length > 2) { -+ var1 = new String[] {par0Str}; - } - - String var5 = var1[0]; - int var6 = var1.length > 1 ? parseIntWithDefault(var1[1], 25565) : 25565; -- if(var6 == 25565) { -+ -+ if (var6 == 25565) { - String[] var7 = getServerAddress(var5); - var5 = var7[0]; - var6 = parseIntWithDefault(var7[1], 25565); -@@ -56,7 +60,10 @@ - } - } - -- private static String[] getServerAddress(String var0) { -+ /** -+ * Returns a server's address and port for the specified hostname, looking up the SRV record if possible -+ */ -+ private static String[] getServerAddress(String par0Str) { - try { - String var1 = "com.sun.jndi.dns.DnsContextFactory"; - Class.forName("com.sun.jndi.dns.DnsContextFactory"); -@@ -65,19 +72,19 @@ - var2.put("java.naming.provider.url", "dns:"); - var2.put("com.sun.jndi.dns.timeout.retries", "1"); - InitialDirContext var3 = new InitialDirContext(var2); -- Attributes var4 = var3.getAttributes("_minecraft._tcp." + var0, new String[]{"SRV"}); -+ Attributes var4 = var3.getAttributes("_minecraft._tcp." + par0Str, new String[] {"SRV"}); - String[] var5 = var4.get("srv").get().toString().split(" ", 4); -- return new String[]{var5[3], var5[2]}; -+ return new String[] {var5[3], var5[2]}; - } catch (Throwable var6) { -- return new String[]{var0, Integer.toString(25565)}; -+ return new String[] {par0Str, Integer.toString(25565)}; - } - } - -- private static int parseIntWithDefault(String var0, int var1) { -+ private static int parseIntWithDefault(String par0Str, int par1) { - try { -- return Integer.parseInt(var0.trim()); -+ return Integer.parseInt(par0Str.trim()); - } catch (Exception var3) { -- return var1; -+ return par1; - } - } - } ---- net/minecraft/src/CommandEnchant.java -+++ net/minecraft/src/CommandEnchant.java -@@ -8,44 +8,52 @@ - return "enchant"; - } - -+ /** -+ * Return the required permission level for this command. -+ */ - public int getRequiredPermissionLevel() { - return 2; - } - -- public String getCommandUsage(ICommandSender var1) { -+ public String getCommandUsage(ICommandSender par1ICommandSender) { - return "commands.enchant.usage"; - } - -- public void processCommand(ICommandSender var1, String[] var2) { -- if(var2.length < 2) { -+ public void processCommand(ICommandSender par1ICommandSender, String[] par2ArrayOfStr) { -+ if (par2ArrayOfStr.length < 2) { - throw new WrongUsageException("commands.enchant.usage", new Object[0]); - } else { -- EntityPlayerMP var3 = getPlayer(var1, var2[0]); -- int var4 = parseIntBounded(var1, var2[1], 0, Enchantment.enchantmentsList.length - 1); -+ EntityPlayerMP var3 = getPlayer(par1ICommandSender, par2ArrayOfStr[0]); -+ int var4 = parseIntBounded(par1ICommandSender, par2ArrayOfStr[1], 0, Enchantment.enchantmentsList.length - 1); - int var5 = 1; - ItemStack var6 = var3.getCurrentEquippedItem(); -- if(var6 == null) { -+ -+ if (var6 == null) { - throw new CommandException("commands.enchant.noItem", new Object[0]); - } else { - Enchantment var7 = Enchantment.enchantmentsList[var4]; -- if(var7 == null) { -- throw new NumberInvalidException("commands.enchant.notFound", new Object[]{Integer.valueOf(var4)}); -- } else if(!var7.canApply(var6)) { -+ -+ if (var7 == null) { -+ throw new NumberInvalidException("commands.enchant.notFound", new Object[] {Integer.valueOf(var4)}); -+ } else if (!var7.canApply(var6)) { - throw new CommandException("commands.enchant.cantEnchant", new Object[0]); - } else { -- if(var2.length >= 3) { -- var5 = parseIntBounded(var1, var2[2], var7.getMinLevel(), var7.getMaxLevel()); -+ if (par2ArrayOfStr.length >= 3) { -+ var5 = parseIntBounded(par1ICommandSender, par2ArrayOfStr[2], var7.getMinLevel(), var7.getMaxLevel()); - } - -- if(var6.hasTagCompound()) { -+ if (var6.hasTagCompound()) { - NBTTagList var8 = var6.getEnchantmentTagList(); -- if(var8 != null) { -- for(int var9 = 0; var9 < var8.tagCount(); ++var9) { -+ -+ if (var8 != null) { -+ for (int var9 = 0; var9 < var8.tagCount(); ++var9) { - short var10 = ((NBTTagCompound)var8.tagAt(var9)).getShort("id"); -- if(Enchantment.enchantmentsList[var10] != null) { -+ -+ if (Enchantment.enchantmentsList[var10] != null) { - Enchantment var11 = Enchantment.enchantmentsList[var10]; -- if(!var11.canApplyTogether(var7)) { -- throw new CommandException("commands.enchant.cantCombine", new Object[]{var7.getTranslatedName(var5), var11.getTranslatedName(((NBTTagCompound)var8.tagAt(var9)).getShort("lvl"))}); -+ -+ if (!var11.canApplyTogether(var7)) { -+ throw new CommandException("commands.enchant.cantCombine", new Object[] {var7.getTranslatedName(var5), var11.getTranslatedName(((NBTTagCompound)var8.tagAt(var9)).getShort("lvl"))}); - } - } - } -@@ -53,21 +61,27 @@ - } - - var6.addEnchantment(var7, var5); -- notifyAdmins(var1, "commands.enchant.success", new Object[0]); -+ notifyAdmins(par1ICommandSender, "commands.enchant.success", new Object[0]); - } - } - } - } - -- public List addTabCompletionOptions(ICommandSender var1, String[] var2) { -- return var2.length == 1 ? getListOfStringsMatchingLastWord(var2, this.getListOfPlayers()) : null; -+ /** -+ * Adds the strings available in this command to the given list of tab completion options. -+ */ -+ public List addTabCompletionOptions(ICommandSender par1ICommandSender, String[] par2ArrayOfStr) { -+ return par2ArrayOfStr.length == 1 ? getListOfStringsMatchingLastWord(par2ArrayOfStr, this.getListOfPlayers()) : null; - } - - protected String[] getListOfPlayers() { - return MinecraftServer.getServer().getAllUsernames(); - } - -- public boolean isUsernameIndex(String[] var1, int var2) { -- return var2 == 0; -+ /** -+ * Return whether the specified command parameter index is a username parameter. -+ */ -+ public boolean isUsernameIndex(String[] par1ArrayOfStr, int par2) { -+ return par2 == 0; - } - } ---- net/minecraft/src/WatchableObject.java -+++ net/minecraft/src/WatchableObject.java -@@ -2,14 +2,16 @@ - - public class WatchableObject { - private final int objectType; -+ -+ /** id of max 31 */ - private final int dataValueId; -- private Object c; -+ private Object watchedObject; - private boolean watched; - -- public WatchableObject(int var1, int var2, Object var3) { -- this.dataValueId = var2; -- this.c = var3; -- this.objectType = var1; -+ public WatchableObject(int par1, int par2, Object par3Obj) { -+ this.dataValueId = par2; -+ this.watchedObject = par3Obj; -+ this.objectType = par1; - this.watched = true; - } - -@@ -17,12 +19,12 @@ - return this.dataValueId; - } - -- public void setObject(Object var1) { -- this.c = var1; -+ public void setObject(Object par1Obj) { -+ this.watchedObject = par1Obj; - } - - public Object getObject() { -- return this.c; -+ return this.watchedObject; - } - - public int getObjectType() { -@@ -33,11 +35,14 @@ - return this.watched; - } - -- public void setWatched(boolean var1) { -- this.watched = var1; -+ public void setWatched(boolean par1) { -+ this.watched = par1; - } - -- static boolean setWatchableObjectWatched(WatchableObject var0, boolean var1) { -- return var0.watched = var1; -+ /** -+ * Set whether the specified watchable object is being watched. -+ */ -+ static boolean setWatchableObjectWatched(WatchableObject par0WatchableObject, boolean par1) { -+ return par0WatchableObject.watched = par1; - } - } ---- net/minecraft/src/WorldGenDungeons.java -+++ net/minecraft/src/WorldGenDungeons.java -@@ -3,96 +3,116 @@ - import java.util.Random; - - public class WorldGenDungeons extends WorldGenerator { -- private static final WeightedRandomChestContent[] field_111189_a = new WeightedRandomChestContent[]{new WeightedRandomChestContent(Item.saddle.itemID, 0, 1, 1, 10), new WeightedRandomChestContent(Item.ingotIron.itemID, 0, 1, 4, 10), new WeightedRandomChestContent(Item.bread.itemID, 0, 1, 1, 10), new WeightedRandomChestContent(Item.wheat.itemID, 0, 1, 4, 10), new WeightedRandomChestContent(Item.gunpowder.itemID, 0, 1, 4, 10), new WeightedRandomChestContent(Item.silk.itemID, 0, 1, 4, 10), new WeightedRandomChestContent(Item.bucketEmpty.itemID, 0, 1, 1, 10), new WeightedRandomChestContent(Item.appleGold.itemID, 0, 1, 1, 1), new WeightedRandomChestContent(Item.redstone.itemID, 0, 1, 4, 10), new WeightedRandomChestContent(Item.record13.itemID, 0, 1, 1, 10), new WeightedRandomChestContent(Item.recordCat.itemID, 0, 1, 1, 10), new WeightedRandomChestContent(Item.nameTag.itemID, 0, 1, 1, 10), new WeightedRandomChestContent(Item.horseArmorGold.itemID, 0, 1, 1, 2), new WeightedRandomChestContent(Item.horseArmorIron.itemID, 0, 1, 1, 5), new WeightedRandomChestContent(Item.horseArmorDiamond.itemID, 0, 1, 1, 1)}; -+ private static final WeightedRandomChestContent[] field_111189_a = new WeightedRandomChestContent[] {new WeightedRandomChestContent(Item.saddle.itemID, 0, 1, 1, 10), new WeightedRandomChestContent(Item.ingotIron.itemID, 0, 1, 4, 10), new WeightedRandomChestContent(Item.bread.itemID, 0, 1, 1, 10), new WeightedRandomChestContent(Item.wheat.itemID, 0, 1, 4, 10), new WeightedRandomChestContent(Item.gunpowder.itemID, 0, 1, 4, 10), new WeightedRandomChestContent(Item.silk.itemID, 0, 1, 4, 10), new WeightedRandomChestContent(Item.bucketEmpty.itemID, 0, 1, 1, 10), new WeightedRandomChestContent(Item.appleGold.itemID, 0, 1, 1, 1), new WeightedRandomChestContent(Item.redstone.itemID, 0, 1, 4, 10), new WeightedRandomChestContent(Item.record13.itemID, 0, 1, 1, 10), new WeightedRandomChestContent(Item.recordCat.itemID, 0, 1, 1, 10), new WeightedRandomChestContent(Item.nameTag.itemID, 0, 1, 1, 10), new WeightedRandomChestContent(Item.horseArmorGold.itemID, 0, 1, 1, 2), new WeightedRandomChestContent(Item.horseArmorIron.itemID, 0, 1, 1, 5), new WeightedRandomChestContent(Item.horseArmorDiamond.itemID, 0, 1, 1, 1)}; - -- public boolean generate(World var1, Random var2, int var3, int var4, int var5) { -+ public boolean generate(World par1World, Random par2Random, int par3, int par4, int par5) { - byte var6 = 3; -- int var7 = var2.nextInt(2) + 2; -- int var8 = var2.nextInt(2) + 2; -+ int var7 = par2Random.nextInt(2) + 2; -+ int var8 = par2Random.nextInt(2) + 2; - int var9 = 0; -- - int var10; - int var11; - int var12; -- for(var10 = var3 - var7 - 1; var10 <= var3 + var7 + 1; ++var10) { -- for(var11 = var4 - 1; var11 <= var4 + var6 + 1; ++var11) { -- for(var12 = var5 - var8 - 1; var12 <= var5 + var8 + 1; ++var12) { -- Material var13 = var1.getBlockMaterial(var10, var11, var12); -- if(var11 == var4 - 1 && !var13.isSolid()) { -- return false; -- } -- -- if(var11 == var4 + var6 + 1 && !var13.isSolid()) { -- return false; -- } -- -- if((var10 == var3 - var7 - 1 || var10 == var3 + var7 + 1 || var12 == var5 - var8 - 1 || var12 == var5 + var8 + 1) && var11 == var4 && var1.isAirBlock(var10, var11, var12) && var1.isAirBlock(var10, var11 + 1, var12)) { -+ -+ for (var10 = par3 - var7 - 1; var10 <= par3 + var7 + 1; ++var10) { -+ for (var11 = par4 - 1; var11 <= par4 + var6 + 1; ++var11) { -+ for (var12 = par5 - var8 - 1; var12 <= par5 + var8 + 1; ++var12) { -+ Material var13 = par1World.getBlockMaterial(var10, var11, var12); -+ -+ if (var11 == par4 - 1 && !var13.isSolid()) { -+ return false; -+ } -+ -+ if (var11 == par4 + var6 + 1 && !var13.isSolid()) { -+ return false; -+ } -+ -+ if ((var10 == par3 - var7 - 1 || var10 == par3 + var7 + 1 || var12 == par5 - var8 - 1 || var12 == par5 + var8 + 1) && var11 == par4 && par1World.isAirBlock(var10, var11, var12) && par1World.isAirBlock(var10, var11 + 1, var12)) { - ++var9; - } - } - } - } - -- if(var9 >= 1 && var9 <= 5) { -- for(var10 = var3 - var7 - 1; var10 <= var3 + var7 + 1; ++var10) { -- for(var11 = var4 + var6; var11 >= var4 - 1; --var11) { -- for(var12 = var5 - var8 - 1; var12 <= var5 + var8 + 1; ++var12) { -- if(var10 != var3 - var7 - 1 && var11 != var4 - 1 && var12 != var5 - var8 - 1 && var10 != var3 + var7 + 1 && var11 != var4 + var6 + 1 && var12 != var5 + var8 + 1) { -- var1.setBlockToAir(var10, var11, var12); -- } else if(var11 >= 0 && !var1.getBlockMaterial(var10, var11 - 1, var12).isSolid()) { -- var1.setBlockToAir(var10, var11, var12); -- } else if(var1.getBlockMaterial(var10, var11, var12).isSolid()) { -- if(var11 == var4 - 1 && var2.nextInt(4) != 0) { -- var1.setBlock(var10, var11, var12, Block.cobblestoneMossy.blockID, 0, 2); -+ if (var9 >= 1 && var9 <= 5) { -+ for (var10 = par3 - var7 - 1; var10 <= par3 + var7 + 1; ++var10) { -+ for (var11 = par4 + var6; var11 >= par4 - 1; --var11) { -+ for (var12 = par5 - var8 - 1; var12 <= par5 + var8 + 1; ++var12) { -+ if (var10 != par3 - var7 - 1 && var11 != par4 - 1 && var12 != par5 - var8 - 1 && var10 != par3 + var7 + 1 && var11 != par4 + var6 + 1 && var12 != par5 + var8 + 1) { -+ par1World.setBlockToAir(var10, var11, var12); -+ } else if (var11 >= 0 && !par1World.getBlockMaterial(var10, var11 - 1, var12).isSolid()) { -+ par1World.setBlockToAir(var10, var11, var12); -+ } else if (par1World.getBlockMaterial(var10, var11, var12).isSolid()) { -+ if (var11 == par4 - 1 && par2Random.nextInt(4) != 0) { -+ par1World.setBlock(var10, var11, var12, Block.cobblestoneMossy.blockID, 0, 2); - } else { -- var1.setBlock(var10, var11, var12, Block.cobblestone.blockID, 0, 2); -- } -- } -- } -- } -- } -- -- for(var10 = 0; var10 < 2; ++var10) { -- for(var11 = 0; var11 < 3; ++var11) { -- var12 = var3 + var2.nextInt(var7 * 2 + 1) - var7; -- int var14 = var5 + var2.nextInt(var8 * 2 + 1) - var8; -- if(var1.isAirBlock(var12, var4, var14)) { -- int var15 = 0; -- if(var1.getBlockMaterial(var12 - 1, var4, var14).isSolid()) { -- ++var15; -- } -- -- if(var1.getBlockMaterial(var12 + 1, var4, var14).isSolid()) { -- ++var15; -- } -- -- if(var1.getBlockMaterial(var12, var4, var14 - 1).isSolid()) { -- ++var15; -- } -- -- if(var1.getBlockMaterial(var12, var4, var14 + 1).isSolid()) { -- ++var15; -- } -- -- if(var15 == 1) { -- var1.setBlock(var12, var4, var14, Block.chest.blockID, 0, 2); -- WeightedRandomChestContent[] var16 = WeightedRandomChestContent.func_92080_a(field_111189_a, new WeightedRandomChestContent[]{Item.enchantedBook.func_92114_b(var2)}); -- TileEntityChest var17 = (TileEntityChest)var1.getBlockTileEntity(var12, var4, var14); -- if(var17 != null) { -- WeightedRandomChestContent.generateChestContents(var2, var16, var17, 8); -- } -- break; -- } -- } -- } -- } -- -- var1.setBlock(var3, var4, var5, Block.mobSpawner.blockID, 0, 2); -- TileEntityMobSpawner var18 = (TileEntityMobSpawner)var1.getBlockTileEntity(var3, var4, var5); -- if(var18 != null) { -- var18.getSpawnerLogic().setMobID(this.pickMobSpawner(var2)); -+ par1World.setBlock(var10, var11, var12, Block.cobblestone.blockID, 0, 2); -+ } -+ } -+ } -+ } -+ } -+ -+ var10 = 0; -+ -+ while (var10 < 2) { -+ var11 = 0; -+ -+ while (true) { -+ if (var11 < 3) { -+ label101: { -+ var12 = par3 + par2Random.nextInt(var7 * 2 + 1) - var7; -+ int var14 = par5 + par2Random.nextInt(var8 * 2 + 1) - var8; -+ -+ if (par1World.isAirBlock(var12, par4, var14)) { -+ int var15 = 0; -+ -+ if (par1World.getBlockMaterial(var12 - 1, par4, var14).isSolid()) { -+ ++var15; -+ } -+ -+ if (par1World.getBlockMaterial(var12 + 1, par4, var14).isSolid()) { -+ ++var15; -+ } -+ -+ if (par1World.getBlockMaterial(var12, par4, var14 - 1).isSolid()) { -+ ++var15; -+ } -+ -+ if (par1World.getBlockMaterial(var12, par4, var14 + 1).isSolid()) { -+ ++var15; -+ } -+ -+ if (var15 == 1) { -+ par1World.setBlock(var12, par4, var14, Block.chest.blockID, 0, 2); -+ WeightedRandomChestContent[] var16 = WeightedRandomChestContent.func_92080_a(field_111189_a, new WeightedRandomChestContent[] {Item.enchantedBook.func_92114_b(par2Random)}); -+ TileEntityChest var17 = (TileEntityChest)par1World.getBlockTileEntity(var12, par4, var14); -+ -+ if (var17 != null) { -+ WeightedRandomChestContent.generateChestContents(par2Random, var16, var17, 8); -+ } -+ -+ break label101; -+ } -+ } -+ -+ ++var11; -+ continue; -+ } -+ } -+ -+ ++var10; -+ break; -+ } -+ } -+ -+ par1World.setBlock(par3, par4, par5, Block.mobSpawner.blockID, 0, 2); -+ TileEntityMobSpawner var18 = (TileEntityMobSpawner)par1World.getBlockTileEntity(par3, par4, par5); -+ -+ if (var18 != null) { -+ var18.getSpawnerLogic().setMobID(this.pickMobSpawner(par2Random)); - } else { -- System.err.println("Failed to fetch mob spawner entity at (" + var3 + ", " + var4 + ", " + var5 + ")"); -+ System.err.println("Failed to fetch mob spawner entity at (" + par3 + ", " + par4 + ", " + par5 + ")"); - } - - return true; -@@ -101,8 +121,11 @@ - } - } - -- private String pickMobSpawner(Random var1) { -- int var2 = var1.nextInt(4); -+ /** -+ * Randomly decides which spawner to use in a dungeon -+ */ -+ private String pickMobSpawner(Random par1Random) { -+ int var2 = par1Random.nextInt(4); - return var2 == 0 ? "Skeleton" : (var2 == 1 ? "Zombie" : (var2 == 2 ? "Zombie" : (var2 == 3 ? "Spider" : ""))); - } - } ---- /dev/null -+++ org/spoutcraft/api/material/item/GenericCustomTool.java -@@ -1,0 +1,110 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.api.material.item; -+ -+import java.io.IOException; -+ -+import gnu.trove.map.hash.TObjectFloatHashMap; -+ -+import org.spoutcraft.api.io.SpoutInputStream; -+import org.spoutcraft.api.io.SpoutOutputStream; -+import org.spoutcraft.api.material.Block; -+import org.spoutcraft.api.material.CustomBlock; -+import org.spoutcraft.api.material.MaterialData; -+import org.spoutcraft.api.material.Tool; -+ -+public class GenericCustomTool extends GenericCustomItem implements Tool{ -+ private short durability = 1; -+ private TObjectFloatHashMap strengthMods = new TObjectFloatHashMap(); -+ -+ public GenericCustomTool() { -+ super(); -+ } -+ -+ public GenericCustomTool(String addon, String name, String texture) { -+ super(addon, name, texture); -+ } -+ -+ public short getDurability() { -+ return durability; -+ } -+ -+ public Tool setDurability(short durability) { -+ this.durability = durability; -+ return this; -+ } -+ -+ public float getStrengthModifier(Block block) { -+ if (strengthMods.contains(block)) { -+ return strengthMods.get(block); -+ } -+ return 1.0F; -+ } -+ -+ public Tool setStrengthModifier(Block block, float modifier) { -+ strengthMods.put(block, modifier); -+ return this; -+ } -+ -+ public Block[] getStrengthModifiedBlocks() { -+ return (Block[]) strengthMods.keys(); -+ } -+ -+ @Override -+ public void readData(SpoutInputStream input) throws IOException { -+ super.readData(input); -+ setDurability(input.readShort()); -+ short size = input.readShort(); -+ for (int i = 0; i < size; i++) { -+ int id = input.readInt(); -+ int data = input.readShort(); -+ float mod = input.readFloat(); -+ Block block = MaterialData.getBlock(id, (short) data); -+ if (data == -1) { -+ block = MaterialData.getCustomBlock(id); -+ } -+ setStrengthModifier(block, mod); -+ } -+ } -+ -+ @Override -+ public void writeData(SpoutOutputStream output) throws IOException { -+ super.writeData(output); -+ output.writeShort(getDurability()); -+ Block[] mod = getStrengthModifiedBlocks(); -+ output.writeShort((short) mod.length); -+ for (int i = 0; i < mod.length; i++) { -+ Block block = mod[i]; -+ if (block instanceof CustomBlock) { -+ output.writeInt(((CustomBlock)block).getCustomId()); -+ output.writeShort((short) -1); -+ } else { -+ output.writeInt(block.getRawId()); -+ output.writeShort((short) block.getRawData()); -+ } -+ output.writeFloat(getStrengthModifier(block)); -+ } -+ } -+ -+ @Override -+ public int getVersion() { -+ return super.getVersion() + 0; -+ } -+} ---- net/minecraft/src/GuiMainMenu.java -+++ net/minecraft/src/GuiMainMenu.java -@@ -13,22 +13,36 @@ - import org.lwjgl.util.glu.Project; - - public class GuiMainMenu extends GuiScreen { -- private static final Random b = new Random(); -+ -+ /** The RNG used by the Main Menu Screen. */ -+ private static final Random rand = new Random(); -+ -+ /** Counts the number of screen updates. */ - private float updateCounter; -- private String d = "missingno"; -+ -+ /** The splash message. */ -+ private String splashText = "missingno"; - private GuiButton buttonResetDemo; -+ -+ /** Timer used to rotate the panorama, increases every tick. */ - private int panoramaTimer; -+ -+ /** -+ * Texture allocated for the current viewport of the main menu's panorama background. -+ */ - private DynamicTexture viewportTexture; - private boolean field_96141_q = true; - private static boolean field_96140_r; - private static boolean field_96139_s; -- private final Object u = new Object(); -- private String v; -- private String w; -+ private final Object field_104025_t = new Object(); -+ private String field_92025_p; -+ private String field_104024_v; - private static final ResourceLocation splashTexts = new ResourceLocation("texts/splashes.txt"); - private static final ResourceLocation minecraftTitleTextures = new ResourceLocation("textures/gui/title/minecraft.png"); -- private static final ResourceLocation[] titlePanoramaPaths = new ResourceLocation[]{new ResourceLocation("textures/gui/title/background/panorama_0.png"), new ResourceLocation("textures/gui/title/background/panorama_1.png"), new ResourceLocation("textures/gui/title/background/panorama_2.png"), new ResourceLocation("textures/gui/title/background/panorama_3.png"), new ResourceLocation("textures/gui/title/background/panorama_4.png"), new ResourceLocation("textures/gui/title/background/panorama_5.png")}; -- public static final String a = "Please click " + EnumChatFormatting.UNDERLINE + "here" + EnumChatFormatting.RESET + " for more information."; -+ -+ /** An array of all the paths to the panorama pictures. */ -+ private static final ResourceLocation[] titlePanoramaPaths = new ResourceLocation[] {new ResourceLocation("textures/gui/title/background/panorama_0.png"), new ResourceLocation("textures/gui/title/background/panorama_1.png"), new ResourceLocation("textures/gui/title/background/panorama_2.png"), new ResourceLocation("textures/gui/title/background/panorama_3.png"), new ResourceLocation("textures/gui/title/background/panorama_4.png"), new ResourceLocation("textures/gui/title/background/panorama_5.png")}; -+ public static final String field_96138_a = "Please click " + EnumChatFormatting.UNDERLINE + "here" + EnumChatFormatting.RESET + " for more information."; - private int field_92024_r; - private int field_92023_s; - private int field_92022_t; -@@ -40,182 +54,202 @@ - - public GuiMainMenu() { - BufferedReader var1 = null; -- - String var3; -+ - try { - ArrayList var2 = new ArrayList(); - var1 = new BufferedReader(new InputStreamReader(Minecraft.getMinecraft().getResourceManager().getResource(splashTexts).getInputStream(), Charsets.UTF_8)); - -- while(true) { -- var3 = var1.readLine(); -- if(var3 == null) { -- do { -- this.d = (String)var2.get(b.nextInt(var2.size())); -- } while(this.d.hashCode() == 125780783); -- break; -- } -- -+ while ((var3 = var1.readLine()) != null) { - var3 = var3.trim(); -- if(!var3.isEmpty()) { -+ -+ if (!var3.isEmpty()) { - var2.add(var3); - } - } -+ -+ do { -+ this.splashText = (String)var2.get(rand.nextInt(var2.size())); -+ } while (this.splashText.hashCode() == 125780783); - } catch (IOException var12) { -+ ; - } finally { -- if(var1 != null) { -+ if (var1 != null) { - try { - var1.close(); - } catch (IOException var11) { -+ ; - } - } -- - } - -- this.updateCounter = b.nextFloat(); -- this.v = ""; -+ this.updateCounter = rand.nextFloat(); -+ this.field_92025_p = ""; - String var14 = System.getProperty("os_architecture"); - var3 = System.getProperty("java_version"); -- if("ppc".equalsIgnoreCase(var14)) { -- this.v = "" + EnumChatFormatting.BOLD + "Notice!" + EnumChatFormatting.RESET + " PowerPC compatibility will be dropped in Minecraft 1.6"; -- this.w = "http://tinyurl.com/javappc"; -- } else if(var3 != null && var3.startsWith("1.5")) { -- this.v = "" + EnumChatFormatting.BOLD + "Notice!" + EnumChatFormatting.RESET + " Java 1.5 compatibility will be dropped in Minecraft 1.6"; -- this.w = "http://tinyurl.com/javappc"; -+ -+ if ("ppc".equalsIgnoreCase(var14)) { -+ this.field_92025_p = "" + EnumChatFormatting.BOLD + "Notice!" + EnumChatFormatting.RESET + " PowerPC compatibility will be dropped in Minecraft 1.6"; -+ this.field_104024_v = "http://tinyurl.com/javappc"; -+ } else if (var3 != null && var3.startsWith("1.5")) { -+ this.field_92025_p = "" + EnumChatFormatting.BOLD + "Notice!" + EnumChatFormatting.RESET + " Java 1.5 compatibility will be dropped in Minecraft 1.6"; -+ this.field_104024_v = "http://tinyurl.com/javappc"; - } -- - } - -+ /** -+ * Called from the main game loop to update the screen. -+ */ - public void updateScreen() { - ++this.panoramaTimer; - } - -+ /** -+ * Returns true if this GUI should pause the game when it is displayed in single-player -+ */ - public boolean doesGuiPauseGame() { - return false; - } - -- protected void keyTyped(char var1, int var2) { -- } -+ /** -+ * Fired when a key is typed. This is the equivalent of KeyListener.keyTyped(KeyEvent e). -+ */ -+ protected void keyTyped(char par1, int par2) {} - -+ /** -+ * Adds the buttons (and other controls) to the screen in question. -+ */ - public void initGui() { - this.viewportTexture = new DynamicTexture(256, 256); - this.field_110351_G = this.mc.getTextureManager().getDynamicTextureLocation("background", this.viewportTexture); - Calendar var1 = Calendar.getInstance(); - var1.setTime(new Date()); -- if(var1.get(2) + 1 == 11 && var1.get(5) == 9) { -- this.d = "Happy birthday, ez!"; -- } else if(var1.get(2) + 1 == 6 && var1.get(5) == 1) { -- this.d = "Happy birthday, Notch!"; -- } else if(var1.get(2) + 1 == 12 && var1.get(5) == 24) { -- this.d = "Merry X-mas!"; -- } else if(var1.get(2) + 1 == 1 && var1.get(5) == 1) { -- this.d = "Happy new year!"; -- } else if(var1.get(2) + 1 == 10 && var1.get(5) == 31) { -- this.d = "OOoooOOOoooo! Spooky!"; -+ -+ if (var1.get(2) + 1 == 11 && var1.get(5) == 9) { -+ this.splashText = "Happy birthday, ez!"; -+ } else if (var1.get(2) + 1 == 6 && var1.get(5) == 1) { -+ this.splashText = "Happy birthday, Notch!"; -+ } else if (var1.get(2) + 1 == 12 && var1.get(5) == 24) { -+ this.splashText = "Merry X-mas!"; -+ } else if (var1.get(2) + 1 == 1 && var1.get(5) == 1) { -+ this.splashText = "Happy new year!"; -+ } else if (var1.get(2) + 1 == 10 && var1.get(5) == 31) { -+ this.splashText = "OOoooOOOoooo! Spooky!"; - } - - boolean var2 = true; - int var3 = this.height / 4 + 48; -- if(this.mc.isDemo()) { -+ -+ if (this.mc.isDemo()) { - this.addDemoButtons(var3, 24); - } else { - this.addSingleplayerMultiplayerButtons(var3, 24); - } - - this.func_130020_g(); -- this.i.add(new GuiButton(0, this.width / 2 - 100, var3 + 72 + 12, 98, 20, I18n.getString("menu.options"))); -- this.i.add(new GuiButton(4, this.width / 2 + 2, var3 + 72 + 12, 98, 20, I18n.getString("menu.quit"))); -- this.i.add(new GuiButtonLanguage(5, this.width / 2 - 124, var3 + 72 + 12)); -- Object var4 = this.u; -- synchronized(var4) { -- this.field_92023_s = this.fontRenderer.getStringWidth(this.v); -- this.field_92024_r = this.fontRenderer.getStringWidth(a); -+ this.buttonList.add(new GuiButton(0, this.width / 2 - 100, var3 + 72 + 12, 98, 20, I18n.getString("menu.options"))); -+ this.buttonList.add(new GuiButton(4, this.width / 2 + 2, var3 + 72 + 12, 98, 20, I18n.getString("menu.quit"))); -+ this.buttonList.add(new GuiButtonLanguage(5, this.width / 2 - 124, var3 + 72 + 12)); -+ Object var4 = this.field_104025_t; -+ -+ synchronized (this.field_104025_t) { -+ this.field_92023_s = this.fontRenderer.getStringWidth(this.field_92025_p); -+ this.field_92024_r = this.fontRenderer.getStringWidth(field_96138_a); - int var5 = Math.max(this.field_92023_s, this.field_92024_r); - this.field_92022_t = (this.width - var5) / 2; -- this.field_92021_u = ((GuiButton)this.i.get(0)).yPosition - 24; -+ this.field_92021_u = ((GuiButton)this.buttonList.get(0)).yPosition - 24; - this.field_92020_v = this.field_92022_t + var5; - this.field_92019_w = this.field_92021_u + 24; - } - } - - private void func_130020_g() { -- if(this.field_96141_q) { -- if(!field_96140_r) { -+ if (this.field_96141_q) { -+ if (!field_96140_r) { - field_96140_r = true; - (new RunnableTitleScreen(this)).start(); -- } else if(field_96139_s) { -+ } else if (field_96139_s) { - this.func_130022_h(); - } - } -- - } - - private void func_130022_h() { - this.minecraftRealmsButton.drawButton = true; - } - -- private void addSingleplayerMultiplayerButtons(int var1, int var2) { -- this.i.add(new GuiButton(1, this.width / 2 - 100, var1, I18n.getString("menu.singleplayer"))); -- this.i.add(new GuiButton(2, this.width / 2 - 100, var1 + var2 * 1, I18n.getString("menu.multiplayer"))); -- this.i.add(this.minecraftRealmsButton = new GuiButton(14, this.width / 2 - 100, var1 + var2 * 2, I18n.getString("menu.online"))); -+ /** -+ * Adds Singleplayer and Multiplayer buttons on Main Menu for players who have bought the game. -+ */ -+ private void addSingleplayerMultiplayerButtons(int par1, int par2) { -+ this.buttonList.add(new GuiButton(1, this.width / 2 - 100, par1, I18n.getString("menu.singleplayer"))); -+ this.buttonList.add(new GuiButton(2, this.width / 2 - 100, par1 + par2 * 1, I18n.getString("menu.multiplayer"))); -+ this.buttonList.add(this.minecraftRealmsButton = new GuiButton(14, this.width / 2 - 100, par1 + par2 * 2, I18n.getString("menu.online"))); - this.minecraftRealmsButton.drawButton = false; - } - -- private void addDemoButtons(int var1, int var2) { -- this.i.add(new GuiButton(11, this.width / 2 - 100, var1, I18n.getString("menu.playdemo"))); -- this.i.add(this.buttonResetDemo = new GuiButton(12, this.width / 2 - 100, var1 + var2 * 1, I18n.getString("menu.resetdemo"))); -+ /** -+ * Adds Demo buttons on Main Menu for players who are playing Demo. -+ */ -+ private void addDemoButtons(int par1, int par2) { -+ this.buttonList.add(new GuiButton(11, this.width / 2 - 100, par1, I18n.getString("menu.playdemo"))); -+ this.buttonList.add(this.buttonResetDemo = new GuiButton(12, this.width / 2 - 100, par1 + par2 * 1, I18n.getString("menu.resetdemo"))); - ISaveFormat var3 = this.mc.getSaveLoader(); - WorldInfo var4 = var3.getWorldInfo("Demo_World"); -- if(var4 == null) { -+ -+ if (var4 == null) { - this.buttonResetDemo.enabled = false; - } -- - } - -- protected void actionPerformed(GuiButton var1) { -- if(var1.id == 0) { -+ /** -+ * Fired when a control is clicked. This is the equivalent of ActionListener.actionPerformed(ActionEvent e). -+ */ -+ protected void actionPerformed(GuiButton par1GuiButton) { -+ if (par1GuiButton.id == 0) { - this.mc.displayGuiScreen(new GuiOptions(this, this.mc.gameSettings)); - } - -- if(var1.id == 5) { -+ if (par1GuiButton.id == 5) { - this.mc.displayGuiScreen(new GuiLanguage(this, this.mc.gameSettings, this.mc.getLanguageManager())); - } - -- if(var1.id == 1) { -+ if (par1GuiButton.id == 1) { - this.mc.displayGuiScreen(new GuiSelectWorld(this)); - } - -- if(var1.id == 2) { -+ if (par1GuiButton.id == 2) { - this.mc.displayGuiScreen(new GuiMultiplayer(this)); - } - -- if(var1.id == 14 && this.minecraftRealmsButton.drawButton) { -+ if (par1GuiButton.id == 14 && this.minecraftRealmsButton.drawButton) { - this.func_140005_i(); - } - -- if(var1.id == 4) { -+ if (par1GuiButton.id == 4) { - this.mc.shutdown(); - } - -- if(var1.id == 11) { -+ if (par1GuiButton.id == 11) { - this.mc.launchIntegratedServer("Demo_World", "Demo_World", DemoWorldServer.demoWorldSettings); - } - -- if(var1.id == 12) { -+ if (par1GuiButton.id == 12) { - ISaveFormat var2 = this.mc.getSaveLoader(); - WorldInfo var3 = var2.getWorldInfo("Demo_World"); -- if(var3 != null) { -+ -+ if (var3 != null) { - GuiYesNo var4 = GuiSelectWorld.getDeleteWorldScreen(this, var3.getWorldName(), 12); - this.mc.displayGuiScreen(var4); - } - } -- - } - - private void func_140005_i() { - McoClient var1 = new McoClient(this.mc.getSession()); - - try { -- if(var1.func_140054_c().booleanValue()) { -+ if (var1.func_140054_c().booleanValue()) { - this.mc.displayGuiScreen(new GuiScreenClientOutdated(this)); - } else { - this.mc.displayGuiScreen(new GuiScreenOnlineServers(this)); -@@ -225,21 +259,20 @@ - } catch (IOException var4) { - this.mc.getLogAgent().logSevere(var4.getLocalizedMessage()); - } -- - } - -- public void confirmClicked(boolean var1, int var2) { -- if(var1 && var2 == 12) { -+ public void confirmClicked(boolean par1, int par2) { -+ if (par1 && par2 == 12) { - ISaveFormat var6 = this.mc.getSaveLoader(); - var6.flushCache(); - var6.deleteWorldDirectory("Demo_World"); - this.mc.displayGuiScreen(this); -- } else if(var2 == 13) { -- if(var1) { -+ } else if (par2 == 13) { -+ if (par1) { - try { - Class var3 = Class.forName("java.awt.Desktop"); - Object var4 = var3.getMethod("getDesktop", new Class[0]).invoke((Object)null, new Object[0]); -- var3.getMethod("browse", new Class[]{URI.class}).invoke(var4, new Object[]{new URI(this.w)}); -+ var3.getMethod("browse", new Class[] {URI.class}).invoke(var4, new Object[] {new URI(this.field_104024_v)}); - } catch (Throwable var5) { - var5.printStackTrace(); - } -@@ -247,10 +280,12 @@ - - this.mc.displayGuiScreen(this); - } -- - } - -- private void drawPanorama(int var1, int var2, float var3) { -+ /** -+ * Draws the main menu panorama -+ */ -+ private void drawPanorama(int par1, int par2, float par3) { - Tessellator var4 = Tessellator.instance; - GL11.glMatrixMode(GL11.GL_PROJECTION); - GL11.glPushMatrix(); -@@ -268,34 +303,35 @@ - GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); - byte var5 = 8; - -- for(int var6 = 0; var6 < var5 * var5; ++var6) { -+ for (int var6 = 0; var6 < var5 * var5; ++var6) { - GL11.glPushMatrix(); - float var7 = ((float)(var6 % var5) / (float)var5 - 0.5F) / 64.0F; - float var8 = ((float)(var6 / var5) / (float)var5 - 0.5F) / 64.0F; - float var9 = 0.0F; - GL11.glTranslatef(var7, var8, var9); -- GL11.glRotatef(MathHelper.sin(((float)this.panoramaTimer + var3) / 400.0F) * 25.0F + 20.0F, 1.0F, 0.0F, 0.0F); -- GL11.glRotatef(-((float)this.panoramaTimer + var3) * 0.1F, 0.0F, 1.0F, 0.0F); -+ GL11.glRotatef(MathHelper.sin(((float)this.panoramaTimer + par3) / 400.0F) * 25.0F + 20.0F, 1.0F, 0.0F, 0.0F); -+ GL11.glRotatef(-((float)this.panoramaTimer + par3) * 0.1F, 0.0F, 1.0F, 0.0F); - -- for(int var10 = 0; var10 < 6; ++var10) { -+ for (int var10 = 0; var10 < 6; ++var10) { - GL11.glPushMatrix(); -- if(var10 == 1) { -+ -+ if (var10 == 1) { - GL11.glRotatef(90.0F, 0.0F, 1.0F, 0.0F); - } - -- if(var10 == 2) { -+ if (var10 == 2) { - GL11.glRotatef(180.0F, 0.0F, 1.0F, 0.0F); - } - -- if(var10 == 3) { -+ if (var10 == 3) { - GL11.glRotatef(-90.0F, 0.0F, 1.0F, 0.0F); - } - -- if(var10 == 4) { -+ if (var10 == 4) { - GL11.glRotatef(90.0F, 1.0F, 0.0F, 0.0F); - } - -- if(var10 == 5) { -+ if (var10 == 5) { - GL11.glRotatef(-90.0F, 1.0F, 0.0F, 0.0F); - } - -@@ -327,7 +363,10 @@ - GL11.glEnable(GL11.GL_DEPTH_TEST); - } - -- private void rotateAndBlurSkybox(float var1) { -+ /** -+ * Rotate and blurs the skybox view in the main menu -+ */ -+ private void rotateAndBlurSkybox(float par1) { - this.mc.getTextureManager().bindTexture(this.field_110351_G); - GL11.glCopyTexSubImage2D(GL11.GL_TEXTURE_2D, 0, 0, 0, 0, 0, 256, 256); - GL11.glEnable(GL11.GL_BLEND); -@@ -337,7 +376,7 @@ - var2.startDrawingQuads(); - byte var3 = 3; - -- for(int var4 = 0; var4 < var3; ++var4) { -+ for (int var4 = 0; var4 < var3; ++var4) { - var2.setColorRGBA_F(1.0F, 1.0F, 1.0F, 1.0F / (float)(var4 + 1)); - int var5 = this.width; - int var6 = this.height; -@@ -352,19 +391,22 @@ - GL11.glColorMask(true, true, true, true); - } - -- private void renderSkybox(int var1, int var2, float var3) { -+ /** -+ * Renders the skybox in the main menu -+ */ -+ private void renderSkybox(int par1, int par2, float par3) { - GL11.glViewport(0, 0, 256, 256); -- this.drawPanorama(var1, var2, var3); -+ this.drawPanorama(par1, par2, par3); - GL11.glDisable(GL11.GL_TEXTURE_2D); - GL11.glEnable(GL11.GL_TEXTURE_2D); -- this.rotateAndBlurSkybox(var3); -- this.rotateAndBlurSkybox(var3); -- this.rotateAndBlurSkybox(var3); -- this.rotateAndBlurSkybox(var3); -- this.rotateAndBlurSkybox(var3); -- this.rotateAndBlurSkybox(var3); -- this.rotateAndBlurSkybox(var3); -- this.rotateAndBlurSkybox(var3); -+ this.rotateAndBlurSkybox(par3); -+ this.rotateAndBlurSkybox(par3); -+ this.rotateAndBlurSkybox(par3); -+ this.rotateAndBlurSkybox(par3); -+ this.rotateAndBlurSkybox(par3); -+ this.rotateAndBlurSkybox(par3); -+ this.rotateAndBlurSkybox(par3); -+ this.rotateAndBlurSkybox(par3); - GL11.glViewport(0, 0, this.mc.displayWidth, this.mc.displayHeight); - Tessellator var4 = Tessellator.instance; - var4.startDrawingQuads(); -@@ -383,8 +425,11 @@ - var4.draw(); - } - -- public void drawScreen(int var1, int var2, float var3) { -- this.renderSkybox(var1, var2, var3); -+ /** -+ * Draws the screen and all the components in it. -+ */ -+ public void drawScreen(int par1, int par2, float par3) { -+ this.renderSkybox(par1, par2, par3); - Tessellator var4 = Tessellator.instance; - short var5 = 274; - int var6 = this.width / 2 - var5 / 2; -@@ -393,7 +438,8 @@ - this.drawGradientRect(0, 0, this.width, this.height, 0, Integer.MIN_VALUE); - this.mc.getTextureManager().bindTexture(minecraftTitleTextures); - GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); -- if((double)this.updateCounter < 1.0E-4D) { -+ -+ if ((double)this.updateCounter < 1.0E-4D) { - this.drawTexturedModalRect(var6 + 0, var7 + 0, 0, 0, 99, 44); - this.drawTexturedModalRect(var6 + 99, var7 + 0, 129, 0, 27, 44); - this.drawTexturedModalRect(var6 + 99 + 26, var7 + 0, 126, 0, 3, 44); -@@ -409,58 +455,63 @@ - GL11.glTranslatef((float)(this.width / 2 + 90), 70.0F, 0.0F); - GL11.glRotatef(-20.0F, 0.0F, 0.0F, 1.0F); - float var8 = 1.8F - MathHelper.abs(MathHelper.sin((float)(Minecraft.getSystemTime() % 1000L) / 1000.0F * (float)Math.PI * 2.0F) * 0.1F); -- var8 = var8 * 100.0F / (float)(this.fontRenderer.getStringWidth(this.d) + 32); -+ var8 = var8 * 100.0F / (float)(this.fontRenderer.getStringWidth(this.splashText) + 32); - GL11.glScalef(var8, var8, var8); -- this.drawCenteredString(this.fontRenderer, this.d, 0, -8, 16776960); -+ this.drawCenteredString(this.fontRenderer, this.splashText, 0, -8, 16776960); - GL11.glPopMatrix(); - String var9 = "Minecraft 1.6.4"; -- if(this.mc.isDemo()) { -+ -+ if (this.mc.isDemo()) { - var9 = var9 + " Demo"; - } - - this.drawString(this.fontRenderer, var9, 2, this.height - 10, 16777215); - String var10 = "Copyright Mojang AB. Do not distribute!"; - this.drawString(this.fontRenderer, var10, this.width - this.fontRenderer.getStringWidth(var10) - 2, this.height - 10, 16777215); -- if(this.v != null && this.v.length() > 0) { -+ -+ if (this.field_92025_p != null && this.field_92025_p.length() > 0) { - drawRect(this.field_92022_t - 2, this.field_92021_u - 2, this.field_92020_v + 2, this.field_92019_w - 1, 1428160512); -- this.drawString(this.fontRenderer, this.v, this.field_92022_t, this.field_92021_u, 16777215); -- this.drawString(this.fontRenderer, a, (this.width - this.field_92024_r) / 2, ((GuiButton)this.i.get(0)).yPosition - 12, 16777215); -+ this.drawString(this.fontRenderer, this.field_92025_p, this.field_92022_t, this.field_92021_u, 16777215); -+ this.drawString(this.fontRenderer, field_96138_a, (this.width - this.field_92024_r) / 2, ((GuiButton)this.buttonList.get(0)).yPosition - 12, 16777215); - } - -- super.drawScreen(var1, var2, var3); -+ super.drawScreen(par1, par2, par3); - } - -- protected void mouseClicked(int var1, int var2, int var3) { -- super.mouseClicked(var1, var2, var3); -- Object var4 = this.u; -- synchronized(var4) { -- if(this.v.length() > 0 && var1 >= this.field_92022_t && var1 <= this.field_92020_v && var2 >= this.field_92021_u && var2 <= this.field_92019_w) { -- GuiConfirmOpenLink var5 = new GuiConfirmOpenLink(this, this.w, 13, true); -+ /** -+ * Called when the mouse is clicked. -+ */ -+ protected void mouseClicked(int par1, int par2, int par3) { -+ super.mouseClicked(par1, par2, par3); -+ Object var4 = this.field_104025_t; -+ -+ synchronized (this.field_104025_t) { -+ if (this.field_92025_p.length() > 0 && par1 >= this.field_92022_t && par1 <= this.field_92020_v && par2 >= this.field_92021_u && par2 <= this.field_92019_w) { -+ GuiConfirmOpenLink var5 = new GuiConfirmOpenLink(this, this.field_104024_v, 13, true); - var5.func_92026_h(); - this.mc.displayGuiScreen(var5); - } -- - } - } - -- static Minecraft func_110348_a(GuiMainMenu var0) { -- return var0.mc; -- } -- -- static void func_130021_b(GuiMainMenu var0) { -- var0.func_130022_h(); -- } -- -- static boolean func_110349_a(boolean var0) { -- field_96139_s = var0; -- return var0; -- } -- -- static Minecraft func_130018_c(GuiMainMenu var0) { -- return var0.mc; -- } -- -- static Minecraft func_130019_d(GuiMainMenu var0) { -- return var0.mc; -+ static Minecraft func_110348_a(GuiMainMenu par0GuiMainMenu) { -+ return par0GuiMainMenu.mc; -+ } -+ -+ static void func_130021_b(GuiMainMenu par0GuiMainMenu) { -+ par0GuiMainMenu.func_130022_h(); -+ } -+ -+ static boolean func_110349_a(boolean par0) { -+ field_96139_s = par0; -+ return par0; -+ } -+ -+ static Minecraft func_130018_c(GuiMainMenu par0GuiMainMenu) { -+ return par0GuiMainMenu.mc; -+ } -+ -+ static Minecraft func_130019_d(GuiMainMenu par0GuiMainMenu) { -+ return par0GuiMainMenu.mc; - } - } ---- /dev/null -+++ org/spoutcraft/client/gui/settings/GuiSimpleOptions.java -@@ -1,0 +1,240 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.client.gui.settings; -+ -+import net.minecraft.src.GuiScreen; -+ -+import org.spoutcraft.api.Spoutcraft; -+import org.spoutcraft.api.gui.Button; -+import org.spoutcraft.api.gui.CheckBox; -+import org.spoutcraft.api.gui.Color; -+import org.spoutcraft.api.gui.Control; -+import org.spoutcraft.api.gui.GenericButton; -+import org.spoutcraft.api.gui.GenericCheckBox; -+import org.spoutcraft.api.gui.GenericGradient; -+import org.spoutcraft.api.gui.GenericLabel; -+import org.spoutcraft.api.gui.GenericScrollArea; -+import org.spoutcraft.api.gui.Gradient; -+import org.spoutcraft.api.gui.Label; -+import org.spoutcraft.api.gui.RadioButton; -+import org.spoutcraft.api.gui.RenderPriority; -+import org.spoutcraft.api.gui.WidgetAnchor; -+import org.spoutcraft.client.SpoutClient; -+import org.spoutcraft.client.config.Configuration; -+import org.spoutcraft.client.gui.settings.controls.ChatButton; -+import org.spoutcraft.client.gui.settings.controls.ControlsButton; -+import org.spoutcraft.client.gui.settings.controls.DifficultyButton; -+import org.spoutcraft.client.gui.settings.controls.FavorAppearanceButton; -+import org.spoutcraft.client.gui.settings.controls.FavorPerformanceButton; -+import org.spoutcraft.client.gui.settings.controls.FieldOfViewSlider; -+import org.spoutcraft.client.gui.settings.controls.LanguagesButton; -+import org.spoutcraft.client.gui.settings.controls.ManualSelectionButton; -+import org.spoutcraft.client.gui.settings.controls.MinimapButton; -+import org.spoutcraft.client.gui.settings.controls.MusicSlider; -+import org.spoutcraft.client.gui.settings.controls.OptimalGameplayButton; -+import org.spoutcraft.client.gui.settings.controls.ResetButton; -+import org.spoutcraft.client.gui.settings.controls.SoundEffectsSlider; -+import org.spoutcraft.client.gui.settings.controls.TexturesButton; -+ -+public class GuiSimpleOptions extends GuiScreen { -+ GuiScreen parent = null; -+ Button doneButton, chatButton; -+ GenericScrollArea scroll; -+ Label title; -+ CheckBox switchToAdvancedCheck; -+ -+ public static GuiScreen constructOptionsScreen(GuiScreen parent) { -+ return Configuration.isAdvancedOptions() ? new GuiAdvancedOptions(parent) : new GuiSimpleOptions(parent); -+ } -+ -+ public GuiSimpleOptions(GuiScreen parent) { -+ this.parent = parent; -+ } -+ -+ @Override -+ public void initGui() { -+ Control control; -+ -+ GenericScrollArea screen = new GenericScrollArea(); -+ scroll = screen; -+ screen.setHeight(height - 24 - 30).setWidth(width).setY(24).setX(0); -+ getScreen().attachWidget("Spoutcraft", screen); -+ -+ GenericLabel label = new GenericLabel("Game Settings"); -+ int size = Spoutcraft.getMinecraftFont().getTextWidth(label.getText()); -+ label.setX((int) (width / 2 - size / 2)).setY(10); -+ label.setFixed(true).setPriority(RenderPriority.Lowest); -+ getScreen().attachWidget("Spoutcraft", label); -+ -+ int left = (int)(width / 2 - 155); -+ int right = (int)(width / 2 + 5); -+ int center = (int)(width / 2 - 75); -+ -+ control = new ResetButton(parent).setAlign(WidgetAnchor.TOP_CENTER); -+ control.setWidth(150).setHeight(20).setX(left).setY(height - 25); -+ getScreen().attachWidget("Spoutcraft", control); -+ -+ switchToAdvancedCheck = new GenericCheckBox("Advanced"); -+ switchToAdvancedCheck.setChecked(false); -+ switchToAdvancedCheck.setX(5).setY(3).setWidth(100).setHeight(20); -+ switchToAdvancedCheck.setPriority(RenderPriority.Low); -+ getScreen().attachWidget("Spoutcraft", switchToAdvancedCheck); -+ -+ doneButton = new GenericButton("Done"); -+ doneButton.setAlign(WidgetAnchor.CENTER_CENTER); -+ doneButton.setX(right).setY(height - 25); -+ doneButton.setHeight(20).setWidth(150); -+ getScreen().attachWidget("Spoutcraft", doneButton); -+ -+ int top = 5; -+ -+ Color grey = new Color(0.80F, 0.80F, 0.80F, 0.65F); -+ -+ label = new GenericLabel("Controls and Audio Settings"); -+ size = Spoutcraft.getMinecraftFont().getTextWidth(label.getText()); -+ label.setX((int) (width / 2 - size / 2)).setY(top); -+ label.setTextColor(grey); -+ screen.attachWidget("Spoutcraft", label); -+ top += 11; -+ -+ Gradient linebreak = new GenericGradient(); -+ linebreak.setBottomColor(grey); -+ linebreak.setTopColor(grey); -+ linebreak.setX(width/2 - 318 / 2).setY(top).setHeight(3).setWidth(318); -+ screen.attachWidget("Spoutcraft", linebreak); -+ top += 6; -+ -+ control = new MusicSlider().setAlign(WidgetAnchor.TOP_CENTER); -+ control.setWidth(150).setHeight(20).setX(left).setY(top); -+ screen.attachWidget("Spoutcraft", control); -+ -+ control = new SoundEffectsSlider().setAlign(WidgetAnchor.TOP_CENTER); -+ control.setWidth(150).setHeight(20).setX(right).setY(top); -+ screen.attachWidget("Spoutcraft", control); -+ top += 22; -+ -+ control = new FieldOfViewSlider().setAlign(WidgetAnchor.TOP_CENTER); -+ control.setWidth(150).setHeight(20).setX(left).setY(top); -+ screen.attachWidget("Spoutcraft", control); -+ -+ control = new DifficultyButton().setAlign(WidgetAnchor.TOP_CENTER); -+ control.setWidth(150).setHeight(20).setX(right).setY(top); -+ screen.attachWidget("Spoutcraft", control); -+ top += 22; -+ -+ control = new TexturesButton(this).setAlign(WidgetAnchor.TOP_CENTER); -+ control.setWidth(150).setHeight(20).setX(center).setY(top); -+ screen.attachWidget("Spoutcraft", control); -+ top += 22; -+ -+ control = new ControlsButton(this).setAlign(WidgetAnchor.TOP_CENTER); -+ control.setWidth(150).setHeight(20).setX(left).setY(top); -+ screen.attachWidget("Spoutcraft", control); -+ -+ control = new LanguagesButton(this).setAlign(WidgetAnchor.TOP_CENTER); -+ control.setWidth(150).setHeight(20).setX(right).setY(top); -+ screen.attachWidget("Spoutcraft", control); -+ top += 22; -+ -+ control = new ChatButton(this).setAlign(WidgetAnchor.TOP_CENTER); -+ control.setWidth(150).setHeight(20).setX(left).setY(top); -+ screen.attachWidget("Spoutcraft", control); -+ -+ control = new MinimapButton(this).setAlign(WidgetAnchor.TOP_CENTER); -+ control.setWidth(150).setHeight(20).setX(right).setY(top); -+ screen.attachWidget("Spoutcraft", control); -+ -+ top += 22; -+ -+ // Graphics -+ label = new GenericLabel("Graphical Settings"); -+ size = Spoutcraft.getMinecraftFont().getTextWidth(label.getText()); -+ label.setX((int) (width / 2 - size / 2)).setY(top); -+ label.setTextColor(grey); -+ screen.attachWidget("Spoutcraft", label); -+ top += 11; -+ -+ linebreak = new GenericGradient(); -+ linebreak.setBottomColor(grey); -+ linebreak.setTopColor(grey); -+ linebreak.setX(width/2 - 318 / 2).setY(top).setHeight(3).setWidth(318); -+ screen.attachWidget("Spoutcraft", linebreak); -+ top += 6; -+ -+ // TODO Clean up references to Spoutworth and remove message -+ Label message = new GenericLabel(""); -+ message.setWidth(150).setHeight(20).setX(left).setY(top); -+ -+ if (Configuration.isAutomatePerformance()) { -+ screen.attachWidget("Spoutcraft", message); -+ -+ //top += 47; -+ } -+ -+ RadioButton button; -+ button = (RadioButton) new FavorPerformanceButton("Favor Performance", message).setGroup(1).setAlign(WidgetAnchor.TOP_CENTER); -+ button.setWidth(150).setHeight(20).setX(left).setY(top); -+ button.setTooltip("Spoutcraft will attempt to provide smooth framerates, potentially at the cost of appearance."); -+ screen.attachWidget("Spoutcraft", button); -+ button.setSelected(Configuration.isAutomatePerformance() && Configuration.getAutomateMode() == 0); -+ -+ button = (RadioButton) new OptimalGameplayButton("Balanced Gameplay", message).setGroup(1).setAlign(WidgetAnchor.TOP_CENTER); -+ button.setWidth(150).setHeight(20).setX(right).setY(top); -+ button.setTooltip("Spoutcraft will attempt to provide reasonable framerates and appearance."); -+ screen.attachWidget("Spoutcraft", button); -+ button.setSelected(Configuration.isAutomatePerformance() && Configuration.getAutomateMode() == 1); -+ -+ top += 22; -+ -+ button = (RadioButton) new FavorAppearanceButton("Favor Appearance", message).setGroup(1).setAlign(WidgetAnchor.TOP_CENTER); -+ button.setWidth(150).setHeight(20).setX(left).setY(top); -+ button.setTooltip("Spoutcraft will attempt to provide the best appearance, but potentially at the cost of framerates."); -+ screen.attachWidget("Spoutcraft", button); -+ button.setSelected(Configuration.isAutomatePerformance() && Configuration.getAutomateMode() == 2); -+ -+ button = (RadioButton) new ManualSelectionButton("Manual Selection", message, parent).setGroup(1).setAlign(WidgetAnchor.TOP_CENTER); -+ button.setWidth(150).setHeight(20).setX(right).setY(top); -+ button.setTooltip("Disable automatic performance settings and adjust the settings manually."); -+ screen.attachWidget("Spoutcraft", button); -+ button.setSelected(!Configuration.isAutomatePerformance()); -+ -+ top += 22; -+ // TODO add option controls to the scroll area -+ } -+ -+ @Override -+ public void drawScreen(int par1, int par2, float par3) { -+ drawDefaultBackground(); -+ super.drawScreen(par1, par2, par3); -+ } -+ -+ @Override -+ protected void buttonClicked(Button btn) { -+ if (btn == doneButton) { -+ SpoutClient.getHandle().displayGuiScreen(parent); -+ } -+ if (btn == switchToAdvancedCheck) { -+ Configuration.setAdvancedOptions(true); -+ Configuration.write(); -+ SpoutClient.getHandle().displayGuiScreen(new GuiAdvancedOptions(parent)); -+ } -+ } -+ -+} ---- net/minecraft/src/ChunkCache.java -+++ net/minecraft/src/ChunkCache.java -@@ -1,123 +1,158 @@ - package net.minecraft.src; - -+import net.minecraft.src.Minecraft; -+ - public class ChunkCache implements IBlockAccess { - private int chunkX; - private int chunkZ; - private Chunk[][] chunkArray; -- private boolean hasExtendedLevels; -+ -+ /** True if the chunk cache is empty. */ -+ private boolean isEmpty; -+ -+ /** Reference to the World object. */ - private World worldObj; - -- public ChunkCache(World var1, int var2, int var3, int var4, int var5, int var6, int var7, int var8) { -- this.worldObj = var1; -- this.chunkX = var2 - var8 >> 4; -- this.chunkZ = var4 - var8 >> 4; -- int var9 = var5 + var8 >> 4; -- int var10 = var7 + var8 >> 4; -+ public ChunkCache(World par1World, int par2, int par3, int par4, int par5, int par6, int par7, int par8) { -+ this.worldObj = par1World; -+ this.chunkX = par2 - par8 >> 4; -+ this.chunkZ = par4 - par8 >> 4; -+ int var9 = par5 + par8 >> 4; -+ int var10 = par7 + par8 >> 4; - this.chunkArray = new Chunk[var9 - this.chunkX + 1][var10 - this.chunkZ + 1]; -- this.hasExtendedLevels = true; -- -+ this.isEmpty = true; - int var11; - int var12; - Chunk var13; -- for(var11 = this.chunkX; var11 <= var9; ++var11) { -- for(var12 = this.chunkZ; var12 <= var10; ++var12) { -- var13 = var1.getChunkFromChunkCoords(var11, var12); -- if(var13 != null) { -+ -+ for (var11 = this.chunkX; var11 <= var9; ++var11) { -+ for (var12 = this.chunkZ; var12 <= var10; ++var12) { -+ var13 = par1World.getChunkFromChunkCoords(var11, var12); -+ -+ if (var13 != null) { - this.chunkArray[var11 - this.chunkX][var12 - this.chunkZ] = var13; - } - } - } - -- for(var11 = var2 >> 4; var11 <= var5 >> 4; ++var11) { -- for(var12 = var4 >> 4; var12 <= var7 >> 4; ++var12) { -+ for (var11 = par2 >> 4; var11 <= par5 >> 4; ++var11) { -+ for (var12 = par4 >> 4; var12 <= par7 >> 4; ++var12) { - var13 = this.chunkArray[var11 - this.chunkX][var12 - this.chunkZ]; -- if(var13 != null && !var13.getAreLevelsEmpty(var3, var6)) { -- this.hasExtendedLevels = false; -+ -+ if (var13 != null && !var13.getAreLevelsEmpty(par3, par6)) { -+ this.isEmpty = false; - } - } - } -- - } - -+ /** -+ * set by !chunk.getAreLevelsEmpty -+ */ - public boolean extendedLevelsInChunkCache() { -- return this.hasExtendedLevels; -+ return this.isEmpty; - } - -- public int getBlockId(int var1, int var2, int var3) { -- if(var2 < 0) { -+ /** -+ * Returns the block ID at coords x,y,z -+ */ -+ public int getBlockId(int par1, int par2, int par3) { -+ if (par2 < 0) { - return 0; -- } else if(var2 >= 256) { -+ } else if (par2 >= 256) { - return 0; - } else { -- int var4 = (var1 >> 4) - this.chunkX; -- int var5 = (var3 >> 4) - this.chunkZ; -- if(var4 >= 0 && var4 < this.chunkArray.length && var5 >= 0 && var5 < this.chunkArray[var4].length) { -+ int var4 = (par1 >> 4) - this.chunkX; -+ int var5 = (par3 >> 4) - this.chunkZ; -+ -+ if (var4 >= 0 && var4 < this.chunkArray.length && var5 >= 0 && var5 < this.chunkArray[var4].length) { - Chunk var6 = this.chunkArray[var4][var5]; -- return var6 == null ? 0 : var6.getBlockID(var1 & 15, var2, var3 & 15); -+ return var6 == null ? 0 : var6.getBlockID(par1 & 15, par2, par3 & 15); - } else { - return 0; - } - } - } - -- public TileEntity getBlockTileEntity(int var1, int var2, int var3) { -- int var4 = (var1 >> 4) - this.chunkX; -- int var5 = (var3 >> 4) - this.chunkZ; -- return this.chunkArray[var4][var5].getChunkBlockTileEntity(var1 & 15, var2, var3 & 15); -+ /** -+ * Returns the TileEntity associated with a given block in X,Y,Z coordinates, or null if no TileEntity exists -+ */ -+ public TileEntity getBlockTileEntity(int par1, int par2, int par3) { -+ int var4 = (par1 >> 4) - this.chunkX; -+ int var5 = (par3 >> 4) - this.chunkZ; -+ return this.chunkArray[var4][var5].getChunkBlockTileEntity(par1 & 15, par2, par3 & 15); - } - -- public float getBrightness(int var1, int var2, int var3, int var4) { -- int var5 = this.getLightValue(var1, var2, var3); -- if(var5 < var4) { -- var5 = var4; -+ public float getBrightness(int par1, int par2, int par3, int par4) { -+ int var5 = this.getLightValue(par1, par2, par3); -+ -+ if (var5 < par4) { -+ var5 = par4; - } - - return this.worldObj.provider.lightBrightnessTable[var5]; - } - -- public int getLightBrightnessForSkyBlocks(int var1, int var2, int var3, int var4) { -- int var5 = this.getSkyBlockTypeBrightness(EnumSkyBlock.Sky, var1, var2, var3); -- int var6 = this.getSkyBlockTypeBrightness(EnumSkyBlock.Block, var1, var2, var3); -- if(var6 < var4) { -- var6 = var4; -+ /** -+ * Any Light rendered on a 1.8 Block goes through here -+ */ -+ public int getLightBrightnessForSkyBlocks(int par1, int par2, int par3, int par4) { -+ int var5 = this.getSkyBlockTypeBrightness(EnumSkyBlock.Sky, par1, par2, par3); -+ int var6 = this.getSkyBlockTypeBrightness(EnumSkyBlock.Block, par1, par2, par3); -+ -+ if (var6 < par4) { -+ var6 = par4; - } - - return var5 << 20 | var6 << 4; - } - -- public float getLightBrightness(int var1, int var2, int var3) { -- return this.worldObj.provider.lightBrightnessTable[this.getLightValue(var1, var2, var3)]; -- } -- -- public int getLightValue(int var1, int var2, int var3) { -- return this.getLightValueExt(var1, var2, var3, true); -- } -- -- public int getLightValueExt(int var1, int var2, int var3, boolean var4) { -- if(var1 >= -30000000 && var3 >= -30000000 && var1 < 30000000 && var3 <= 30000000) { -+ /** -+ * Returns how bright the block is shown as which is the block's light value looked up in a lookup table (light values -+ * aren't linear for brightness). Args: x, y, z -+ */ -+ public float getLightBrightness(int par1, int par2, int par3) { -+ return this.worldObj.provider.lightBrightnessTable[this.getLightValue(par1, par2, par3)]; -+ } -+ -+ /** -+ * Gets the light value of the specified block coords. Args: x, y, z -+ */ -+ public int getLightValue(int par1, int par2, int par3) { -+ return this.getLightValueExt(par1, par2, par3, true); -+ } -+ -+ /** -+ * Get light value with flag -+ */ -+ public int getLightValueExt(int par1, int par2, int par3, boolean par4) { -+ if (par1 >= -30000000 && par3 >= -30000000 && par1 < 30000000 && par3 <= 30000000) { - int var5; - int var6; -- if(var4) { -- var5 = this.getBlockId(var1, var2, var3); -- if(var5 == Block.stoneSingleSlab.blockID || var5 == Block.woodSingleSlab.blockID || var5 == Block.tilledField.blockID || var5 == Block.stairsWoodOak.blockID || var5 == Block.stairsCobblestone.blockID) { -- var6 = this.getLightValueExt(var1, var2 + 1, var3, false); -- int var7 = this.getLightValueExt(var1 + 1, var2, var3, false); -- int var8 = this.getLightValueExt(var1 - 1, var2, var3, false); -- int var9 = this.getLightValueExt(var1, var2, var3 + 1, false); -- int var10 = this.getLightValueExt(var1, var2, var3 - 1, false); -- if(var7 > var6) { -+ -+ if (par4) { -+ var5 = this.getBlockId(par1, par2, par3); -+ -+ if (var5 == Block.stoneSingleSlab.blockID || var5 == Block.woodSingleSlab.blockID || var5 == Block.tilledField.blockID || var5 == Block.stairsWoodOak.blockID || var5 == Block.stairsCobblestone.blockID) { -+ var6 = this.getLightValueExt(par1, par2 + 1, par3, false); -+ int var7 = this.getLightValueExt(par1 + 1, par2, par3, false); -+ int var8 = this.getLightValueExt(par1 - 1, par2, par3, false); -+ int var9 = this.getLightValueExt(par1, par2, par3 + 1, false); -+ int var10 = this.getLightValueExt(par1, par2, par3 - 1, false); -+ -+ if (var7 > var6) { - var6 = var7; - } - -- if(var8 > var6) { -+ if (var8 > var6) { - var6 = var8; - } - -- if(var9 > var6) { -+ if (var9 > var6) { - var6 = var9; - } - -- if(var10 > var6) { -+ if (var10 > var6) { - var6 = var10; - } - -@@ -125,143 +160,219 @@ - } - } - -- if(var2 < 0) { -+ if (par2 < 0) { - return 0; -- } else if(var2 >= 256) { -+ } else if (par2 >= 256) { - var5 = 15 - this.worldObj.skylightSubtracted; -- if(var5 < 0) { -+ -+ if (var5 < 0) { - var5 = 0; - } - - return var5; - } else { -- var5 = (var1 >> 4) - this.chunkX; -- var6 = (var3 >> 4) - this.chunkZ; -- return this.chunkArray[var5][var6].getBlockLightValue(var1 & 15, var2, var3 & 15, this.worldObj.skylightSubtracted); -+ var5 = (par1 >> 4) - this.chunkX; -+ var6 = (par3 >> 4) - this.chunkZ; -+ return this.chunkArray[var5][var6].getBlockLightValue(par1 & 15, par2, par3 & 15, this.worldObj.skylightSubtracted); - } - } else { - return 15; - } - } - -- public int getBlockMetadata(int var1, int var2, int var3) { -- if(var2 < 0) { -+ /** -+ * Returns the block metadata at coords x,y,z -+ */ -+ public int getBlockMetadata(int par1, int par2, int par3) { -+ if (par2 < 0) { - return 0; -- } else if(var2 >= 256) { -+ } else if (par2 >= 256) { - return 0; - } else { -- int var4 = (var1 >> 4) - this.chunkX; -- int var5 = (var3 >> 4) - this.chunkZ; -- return this.chunkArray[var4][var5].getBlockMetadata(var1 & 15, var2, var3 & 15); -+ int var4 = (par1 >> 4) - this.chunkX; -+ int var5 = (par3 >> 4) - this.chunkZ; -+ return this.chunkArray[var4][var5].getBlockMetadata(par1 & 15, par2, par3 & 15); - } - } - -- public Material getBlockMaterial(int var1, int var2, int var3) { -- int var4 = this.getBlockId(var1, var2, var3); -+ /** -+ * Returns the block's material. -+ */ -+ public Material getBlockMaterial(int par1, int par2, int par3) { -+ int var4 = this.getBlockId(par1, par2, par3); - return var4 == 0 ? Material.air : Block.blocksList[var4].blockMaterial; - } - -- public BiomeGenBase getBiomeGenForCoords(int var1, int var2) { -- return this.worldObj.getBiomeGenForCoords(var1, var2); -+ /** -+ * Gets the biome for a given set of x/z coordinates -+ */ -+ public BiomeGenBase getBiomeGenForCoords(int par1, int par2) { -+ return this.worldObj.getBiomeGenForCoords(par1, par2); - } - -- public boolean isBlockOpaqueCube(int var1, int var2, int var3) { -- Block var4 = Block.blocksList[this.getBlockId(var1, var2, var3)]; -+ /** -+ * Returns true if the block at the specified coordinates is an opaque cube. Args: x, y, z -+ */ -+ public boolean isBlockOpaqueCube(int par1, int par2, int par3) { -+ Block var4 = Block.blocksList[this.getBlockId(par1, par2, par3)]; - return var4 == null ? false : var4.isOpaqueCube(); - } - -- public boolean isBlockNormalCube(int var1, int var2, int var3) { -- Block var4 = Block.blocksList[this.getBlockId(var1, var2, var3)]; -+ /** -+ * Indicate if a material is a normal solid opaque cube. -+ */ -+ public boolean isBlockNormalCube(int par1, int par2, int par3) { -+ Block var4 = Block.blocksList[this.getBlockId(par1, par2, par3)]; - return var4 == null ? false : var4.blockMaterial.blocksMovement() && var4.renderAsNormalBlock(); - } - -- public boolean doesBlockHaveSolidTopSurface(int var1, int var2, int var3) { -- Block var4 = Block.blocksList[this.getBlockId(var1, var2, var3)]; -- return this.worldObj.isBlockTopFacingSurfaceSolid(var4, this.getBlockMetadata(var1, var2, var3)); -+ /** -+ * Returns true if the block at the given coordinate has a solid (buildable) top surface. -+ */ -+ public boolean doesBlockHaveSolidTopSurface(int par1, int par2, int par3) { -+ Block var4 = Block.blocksList[this.getBlockId(par1, par2, par3)]; -+ return this.worldObj.isBlockTopFacingSurfaceSolid(var4, this.getBlockMetadata(par1, par2, par3)); - } - -+ /** -+ * Return the Vec3Pool object for this world. -+ */ - public Vec3Pool getWorldVec3Pool() { - return this.worldObj.getWorldVec3Pool(); - } - -- public boolean isAirBlock(int var1, int var2, int var3) { -- Block var4 = Block.blocksList[this.getBlockId(var1, var2, var3)]; -+ /** -+ * Returns true if the block at the specified coordinates is empty -+ */ -+ public boolean isAirBlock(int par1, int par2, int par3) { -+ Block var4 = Block.blocksList[this.getBlockId(par1, par2, par3)]; - return var4 == null; - } - -- public int getSkyBlockTypeBrightness(EnumSkyBlock var1, int var2, int var3, int var4) { -- if(var3 < 0) { -- var3 = 0; -- } -- -- if(var3 >= 256) { -- var3 = 255; -- } -- -- if(var3 >= 0 && var3 < 256 && var2 >= -30000000 && var4 >= -30000000 && var2 < 30000000 && var4 <= 30000000) { -- if(var1 == EnumSkyBlock.Sky && this.worldObj.provider.hasNoSky) { -+ /** -+ * Brightness for SkyBlock.Sky is clear white and (through color computing it is assumed) DEPENDENT ON DAYTIME. -+ * Brightness for SkyBlock.Block is yellowish and independent. -+ */ -+ public int getSkyBlockTypeBrightness(EnumSkyBlock par1EnumSkyBlock, int par2, int par3, int par4) { -+ if (par3 < 0) { -+ par3 = 0; -+ } -+ -+ if (par3 >= 256) { -+ par3 = 255; -+ } -+ -+ if (par3 >= 0 && par3 < 256 && par2 >= -30000000 && par4 >= -30000000 && par2 < 30000000 && par4 <= 30000000) { -+ if (par1EnumSkyBlock == EnumSkyBlock.Sky && this.worldObj.provider.hasNoSky) { - return 0; - } else { - int var5; - int var6; -- if(Block.useNeighborBrightness[this.getBlockId(var2, var3, var4)]) { -- var5 = this.getSpecialBlockBrightness(var1, var2, var3 + 1, var4); -- var6 = this.getSpecialBlockBrightness(var1, var2 + 1, var3, var4); -- int var7 = this.getSpecialBlockBrightness(var1, var2 - 1, var3, var4); -- int var8 = this.getSpecialBlockBrightness(var1, var2, var3, var4 + 1); -- int var9 = this.getSpecialBlockBrightness(var1, var2, var3, var4 - 1); -- if(var6 > var5) { -+ -+ if (Block.useNeighborBrightness[this.getBlockId(par2, par3, par4)]) { -+ var5 = this.getSpecialBlockBrightness(par1EnumSkyBlock, par2, par3 + 1, par4); -+ var6 = this.getSpecialBlockBrightness(par1EnumSkyBlock, par2 + 1, par3, par4); -+ int var7 = this.getSpecialBlockBrightness(par1EnumSkyBlock, par2 - 1, par3, par4); -+ int var8 = this.getSpecialBlockBrightness(par1EnumSkyBlock, par2, par3, par4 + 1); -+ int var9 = this.getSpecialBlockBrightness(par1EnumSkyBlock, par2, par3, par4 - 1); -+ -+ if (var6 > var5) { - var5 = var6; - } - -- if(var7 > var5) { -+ if (var7 > var5) { - var5 = var7; - } - -- if(var8 > var5) { -+ if (var8 > var5) { - var5 = var8; - } - -- if(var9 > var5) { -+ if (var9 > var5) { - var5 = var9; - } - - return var5; - } else { -- var5 = (var2 >> 4) - this.chunkX; -- var6 = (var4 >> 4) - this.chunkZ; -- return this.chunkArray[var5][var6].getSavedLightValue(var1, var2 & 15, var3, var4 & 15); -+ var5 = (par2 >> 4) - this.chunkX; -+ var6 = (par4 >> 4) - this.chunkZ; -+ return this.chunkArray[var5][var6].getSavedLightValue(par1EnumSkyBlock, par2 & 15, par3, par4 & 15); - } - } - } else { -- return var1.defaultLightValue; -+ return par1EnumSkyBlock.defaultLightValue; - } - } - -- public int getSpecialBlockBrightness(EnumSkyBlock var1, int var2, int var3, int var4) { -- if(var3 < 0) { -- var3 = 0; -- } -- -- if(var3 >= 256) { -- var3 = 255; -- } -- -- if(var3 >= 0 && var3 < 256 && var2 >= -30000000 && var4 >= -30000000 && var2 < 30000000 && var4 <= 30000000) { -- int var5 = (var2 >> 4) - this.chunkX; -- int var6 = (var4 >> 4) - this.chunkZ; -- return this.chunkArray[var5][var6].getSavedLightValue(var1, var2 & 15, var3, var4 & 15); -+ /** -+ * is only used on stairs and tilled fields -+ */ -+ public int getSpecialBlockBrightness(EnumSkyBlock par1EnumSkyBlock, int par2, int par3, int par4) { -+ if (par3 < 0) { -+ par3 = 0; -+ } -+ -+ if (par3 >= 256) { -+ par3 = 255; -+ } -+ -+ if (par3 >= 0 && par3 < 256 && par2 >= -30000000 && par4 >= -30000000 && par2 < 30000000 && par4 <= 30000000) { -+ int var5 = (par2 >> 4) - this.chunkX; -+ int var6 = (par4 >> 4) - this.chunkZ; -+ return this.chunkArray[var5][var6].getSavedLightValue(par1EnumSkyBlock, par2 & 15, par3, par4 & 15); - } else { -- return var1.defaultLightValue; -+ return par1EnumSkyBlock.defaultLightValue; - } - } - -+ /** -+ * Returns current world height. -+ */ - public int getHeight() { - return 256; - } - -- public int isBlockProvidingPowerTo(int var1, int var2, int var3, int var4) { -- int var5 = this.getBlockId(var1, var2, var3); -- return var5 == 0 ? 0 : Block.blocksList[var5].isProvidingStrongPower(this, var1, var2, var3, var4); -- } -+ /** -+ * Is this block powering in the specified direction Args: x, y, z, direction -+ */ -+ public int isBlockProvidingPowerTo(int par1, int par2, int par3, int par4) { -+ int var5 = this.getBlockId(par1, par2, par3); -+ return var5 == 0 ? 0 : Block.blocksList[var5].isProvidingStrongPower(this, par1, par2, par3, par4); -+ } -+ -+ // Spout Start -+ public int getGrassColorCache(int x, int y, int z) { -+ Chunk chunk = Minecraft.getMinecraft().theWorld.getChunkFromBlockCoords(x, z); -+ if (chunk != null) { -+ return chunk.grassColorCache; -+ } -+ return 0xffffff; -+ } -+ -+ public void setGrassColorCache(int x, int y, int z, int color) { -+ Chunk chunk = Minecraft.getMinecraft().theWorld.getChunkFromBlockCoords(x, z); -+ if (chunk != null) { -+ chunk.grassColorCache = color; -+ } -+ } -+ -+ public int getWaterColorCache(int x, int y, int z) { -+ Chunk chunk = Minecraft.getMinecraft().theWorld.getChunkFromBlockCoords(x, z); -+ if (chunk != null) { -+ return chunk.waterColorCache; -+ } -+ return 0xffffff; -+ } -+ -+ public void setWaterColorCache(int x, int y, int z, int color) { -+ Chunk chunk = Minecraft.getMinecraft().theWorld.getChunkFromBlockCoords(x, z); -+ if (chunk != null) { -+ chunk.waterColorCache = color; -+ } -+ } -+ -+ public WorldChunkManager getWorldChunkManager() { -+ return Minecraft.getMinecraft().theWorld.getWorldChunkManager(); -+ } -+ // Spout End - } ---- /dev/null -+++ org/spoutcraft/client/gui/SafeButton.java -@@ -1,0 +1,85 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.client.gui; -+ -+import org.spoutcraft.api.ChatColor; -+import org.spoutcraft.api.gui.GenericButton; -+ -+public abstract class SafeButton extends GenericButton { -+ private String warningText = ChatColor.RED + "Really?"; -+ protected boolean reallyShown = false; -+ private long timeout = 3000; -+ protected Thread currentThread = null; -+ -+ @Override -+ public String getText() { -+ return reallyShown?getWarningText():super.getText(); -+ } -+ -+ public String getOriginalText() { -+ return super.getText(); -+ } -+ -+ public void setWarningText(String warningText) { -+ this.warningText = warningText; -+ } -+ -+ public String getWarningText() { -+ return warningText; -+ } -+ -+ public void setTimeout(long timeout) { -+ this.timeout = timeout; -+ } -+ -+ public long getTimeout() { -+ return timeout; -+ } -+ -+ @Override -+ public void onButtonClick() { -+ if (currentThread != null) { -+ currentThread.interrupt(); -+ currentThread = null; -+ } -+ -+ if (reallyShown) { -+ executeAction(); -+ reallyShown = false; -+ } else { -+ reallyShown = true; -+ currentThread = new Thread() { -+ public void run() { -+ try { -+ Thread.sleep(getTimeout()); -+ reallyShown = false; -+ currentThread = null; -+ } catch(InterruptedException e) {} -+ } -+ }; -+ currentThread.start(); -+ } -+ } -+ -+ /** -+ * Execute the unsafe action. Will be called if clicked the second time within the timeout. -+ */ -+ protected abstract void executeAction(); -+} ---- net/minecraft/src/ScoreHealthCriteria.java -+++ net/minecraft/src/ScoreHealthCriteria.java -@@ -4,20 +4,20 @@ - import java.util.List; - - public class ScoreHealthCriteria extends ScoreDummyCriteria { -- public ScoreHealthCriteria(String var1) { -- super(var1); -+ public ScoreHealthCriteria(String par1Str) { -+ super(par1Str); - } - -- public int func_96635_a(List var1) { -+ public int func_96635_a(List par1List) { - float var2 = 0.0F; -- - EntityPlayer var4; -- for(Iterator var3 = var1.iterator(); var3.hasNext(); var2 += var4.getHealth() + var4.getAbsorptionAmount()) { -+ -+ for (Iterator var3 = par1List.iterator(); var3.hasNext(); var2 += var4.getHealth() + var4.getAbsorptionAmount()) { - var4 = (EntityPlayer)var3.next(); - } - -- if(var1.size() > 0) { -- var2 /= (float)var1.size(); -+ if (par1List.size() > 0) { -+ var2 /= (float)par1List.size(); - } - - return MathHelper.ceiling_float_int(var2); ---- /dev/null -+++ org/spoutcraft/client/gui/minimap/BackgroundCheckBox.java -@@ -1,0 +1,35 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.client.gui.minimap; -+ -+import org.spoutcraft.api.gui.GenericCheckBox; -+ -+public class BackgroundCheckBox extends GenericCheckBox { -+ public BackgroundCheckBox() { -+ super("Background"); -+ setChecked(MinimapConfig.getInstance().isShowBackground()); -+ setTooltip("Background\nON - Shows the standard 'ancient map' style background\nOFF - no background for the minimap"); -+ } -+ -+ @Override -+ public void onButtonClick() { -+ MinimapConfig.getInstance().setShowBackground(isChecked()); -+ } -+} ---- net/minecraft/src/ThreadDownloadImageDataINNER1.java -+++ net/minecraft/src/ThreadDownloadImageDataINNER1.java -@@ -8,21 +8,30 @@ - class ThreadDownloadImageDataINNER1 extends Thread { - final ThreadDownloadImageData theThreadDownloadImageData; - -- ThreadDownloadImageDataINNER1(ThreadDownloadImageData var1) { -- this.theThreadDownloadImageData = var1; -+ ThreadDownloadImageDataINNER1(ThreadDownloadImageData par1ThreadDownloadImageData) { -+ this.theThreadDownloadImageData = par1ThreadDownloadImageData; - } - - public void run() { - HttpURLConnection var1 = null; - - try { -+ // Spout Start -+ HttpURLConnection.setFollowRedirects(true); -+ // Spout End - var1 = (HttpURLConnection)(new URL(ThreadDownloadImageData.getImageUrl(this.theThreadDownloadImageData))).openConnection(Minecraft.getMinecraft().getProxy()); -+ // Spout Start -+ System.setProperty("http.agent", ""); -+ var1.setRequestProperty("User-Agent", "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/534.30 (KHTML, like Gecko) Chrome/12.0.742.100 Safari/534.30"); -+ // Spout End - var1.setDoInput(true); - var1.setDoOutput(false); - var1.connect(); -- if(var1.getResponseCode() / 100 == 2) { -+ -+ if (var1.getResponseCode() / 100 == 2) { - BufferedImage var2 = ImageIO.read(var1.getInputStream()); -- if(ThreadDownloadImageData.getImageBuffer(this.theThreadDownloadImageData) != null) { -+ -+ if (ThreadDownloadImageData.getImageBuffer(this.theThreadDownloadImageData) != null) { - var2 = ThreadDownloadImageData.getImageBuffer(this.theThreadDownloadImageData).parseUserSkin(var2); - } - -@@ -33,11 +42,9 @@ - var6.printStackTrace(); - return; - } finally { -- if(var1 != null) { -+ if (var1 != null) { - var1.disconnect(); - } -- - } -- - } - } ---- /dev/null -+++ org/spoutcraft/client/precache/PrecacheManager.java -@@ -1,0 +1,305 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.client.precache; -+ -+import java.io.File; -+import java.io.FileInputStream; -+import java.io.FileOutputStream; -+import java.io.IOException; -+import java.nio.MappedByteBuffer; -+import java.nio.channels.Channels; -+import java.nio.channels.FileChannel; -+import java.nio.channels.ReadableByteChannel; -+import java.util.HashMap; -+import java.util.Map.Entry; -+import java.util.zip.ZipEntry; -+import java.util.zip.ZipInputStream; -+ -+import org.newdawn.slick.opengl.Texture; -+ -+import net.minecraft.src.Minecraft; -+import net.minecraft.src.GuiDownloadTerrain; -+ -+import org.bukkit.ChatColor; -+ -+import org.spoutcraft.api.block.design.GenericBlockDesign; -+import org.spoutcraft.api.io.SpoutInputStream; -+import org.spoutcraft.api.material.CustomBlock; -+import org.spoutcraft.api.material.MaterialData; -+import org.spoutcraft.client.SpoutClient; -+import org.spoutcraft.client.gui.precache.GuiPrecache; -+import org.spoutcraft.client.io.CustomTextureManager; -+import org.spoutcraft.client.io.FileUtil; -+import org.spoutcraft.client.packet.PacketRequestPrecache; -+ -+public class PrecacheManager { -+ public static boolean spoutDebug = false; -+ public static int toDownload, downloaded = 0; -+ /** -+ * PrecacheTuple - Holds Plugin Name, Version, and CRC -+ * Boolean - Is this cached or not? -+ */ -+ public static HashMap plugins = new HashMap(); -+ /** -+ * Adds a plugin tuple to the hashmap, and checks if it's cached and valid -+ * @param plugin -+ */ -+ public static void addPlugin(PrecacheTuple plugin) { -+ // Grab precache file -+ File target = getPluginPreCacheFile(plugin); -+ // Does it exist locally? -+ if (target.exists()) { -+ // Is the CRC the same as the one sent from SpoutPlugin? -+ if (plugin.getCrc() == FileUtil.getCRC(target, new byte[(int) target.length()])) { -+ // It's cached, continue on -+ plugins.put(plugin, true); -+ return; -+ } -+ } -+ // Either it doesn't exist or CRC failed, either or it isn't cached. -+ File temp = new File(FileUtil.getCacheDir(), plugin.getPlugin()); -+ if (temp.exists() && temp.isDirectory()) { -+ FileUtil.deleteDirectory(temp); -+ } -+ plugins.put(plugin, false); -+ toDownload++; -+ } -+ -+ /** -+ * Resets the plugins. Useful to clear out previous entries when starting a new login sequence. -+ */ -+ public static void reset() { -+ plugins.clear(); -+ } -+ -+ /** -+ * Returns the tuple that matches to parameters -+ * @param plugin -+ * @param version -+ */ -+ public static PrecacheTuple getPrecacheTuple(String plugin, String version) { -+ for (Entry entry : plugins.entrySet()) { -+ PrecacheTuple tuple = (PrecacheTuple)entry.getKey(); -+ if (tuple.getPlugin().equalsIgnoreCase(plugin) && tuple.getVersion().equalsIgnoreCase(version)) { -+ return tuple; -+ } -+ } -+ return null; -+ } -+ -+ /** -+ * Sets the given plugin precache tuple to a cached status. -+ * @param plugin -+ */ -+ public static void setCached(PrecacheTuple plugin) { -+ plugins.put(plugin, true); -+ } -+ -+ /** -+ * Checks if there is a plugin precache still needing to be cached. -+ * @return true if a plugin needs to be cached, false is everything is already cached. -+ */ -+ public static boolean hasNextCache() { -+ for (boolean cached : plugins.values()) { -+ if (!cached) { -+ return true; -+ } -+ } -+ return false; -+ } -+ -+ /** -+ * Gets the next item to be cached -+ * @return The PrecacheTuple to cache or null if not found -+ */ -+ public static PrecacheTuple getNextToCache() { -+ // Loop through the list of plugins -+ for (Entry entry : plugins.entrySet()) { -+ // Get the status of the entry (cached or not) -+ if ((Boolean) entry.getValue()) { -+ // It's cached, continue -+ continue; -+ } -+ // It wasn't cached so return this entry to be cached -+ return (PrecacheTuple) entry.getKey(); -+ } -+ // Nothing is left to cache, return null -+ return null; -+ } -+ -+ /** -+ * Starts the next cache -+ */ -+ public static void doNextCache() { -+ // Check if there is any thing left to be cached -+ if (!hasNextCache()) { -+ // Nothing is left to cache, proceed to load the cache -+ loadPrecache(); -+ return; -+ } -+ final PrecacheTuple next = getNextToCache(); -+ -+ // Let the user know we are precaching -+ downloaded++; -+ setPreloadGuiText(ChatColor.WHITE + "Downloading resources, files remaining: " + ChatColor.ITALIC + (toDownload-downloaded)); -+ if (toDownload-downloaded == 0) { -+ setPreloadGuiText(ChatColor.WHITE + "Activating downloaded resources..."); -+ } -+ -+ // Send SpoutPlugin a request for the pre-cache zip -+ SpoutClient.getInstance().getPacketManager().sendSpoutPacket(new PacketRequestPrecache(next.getPlugin())); -+ } -+ -+ public static File getPluginPreCacheFile(PrecacheTuple plugin) { -+ return getPluginPreCacheFile(plugin.getPlugin(), plugin.getVersion()); -+ } -+ -+ public static File getPluginPreCacheFile(String plugin, String version) { -+ return new File(FileUtil.getCacheDir(), plugin + ".zip"); -+ } -+ -+ public static void loadPrecache() { -+ // Unzip -+ final File cacheRoot = FileUtil.getCacheDir(); -+ -+ for (Entry entry : plugins.entrySet()) { -+ // Grab the tuple -+ final PrecacheTuple toCache = (PrecacheTuple) entry.getKey(); -+ final File extractDir = new File(cacheRoot, toCache.getPlugin()); //Ex. /cache/pluginname/ -+ if (spoutDebug) { -+ System.out.println("[Spoutcraft] Reading: " + extractDir.getName() + ".zip"); -+ } -+ // Make the directories to unzip to -+ extractDir.mkdirs(); -+ try { -+ // Read in a zip stream -+ final ZipInputStream stream = new ZipInputStream(new FileInputStream(getPluginPreCacheFile(toCache))); -+ final ReadableByteChannel read = Channels.newChannel(stream); -+ // Grab the first entry in the zip -+ ZipEntry inner = stream.getNextEntry(); -+ while (inner != null) { -+ // Construct an output stream for the entry -+ final File toExtract = new File(extractDir, inner.getName()); -+ if (!toExtract.exists()) { -+ final FileOutputStream write = new FileOutputStream(toExtract); -+ write.getChannel().transferFrom(read, 0, Long.MAX_VALUE); -+ // Close the writable buffer -+ write.close(); -+ } -+ // Close the zip stream for this entry -+ stream.closeEntry(); -+ // Grab the next entry in the zip -+ inner = stream.getNextEntry(); -+ } -+ // Finally close the stream altogether -+ stream.close(); -+ } catch (Exception e ) { -+ e.printStackTrace(); -+ } -+ } -+ for (Entry entry : plugins.entrySet()) { -+ final File dir = new File(cacheRoot, ((PrecacheTuple) entry.getKey()).getPlugin()); -+ if (!dir.isDirectory()) { -+ continue; -+ } -+ final File[] files = dir.listFiles(); -+ for (File file : files) { -+ if (file.getName().endsWith(".sbd")) { -+ if (spoutDebug) { -+ System.out.println("[Spoutcraft] Loading Spout Block Design: " + file.getName() + " from: " + file.getParent()); -+ } -+ loadDesign(file); -+ } else if (FileUtil.isImageFile(file.getName())) { -+ if (spoutDebug) { -+ System.out.println("[Spoutcraft] Loading image: " + file.getName() + " from: " + file.getParent()); -+ } -+ Texture tex = CustomTextureManager.getTextureFromUrl(((PrecacheTuple) entry.getKey()).getPlugin(),file.getName()); -+ if (spoutDebug && tex == null) { -+ System.out.println("[Spoutcraft] Precache tried to load a null image: " + tex); -+ } -+ } -+ } -+ } -+ -+ if (Minecraft.getMinecraft().theWorld != null) { -+ Minecraft.getMinecraft().renderGlobal.updateAllRenderers(); -+ if (spoutDebug) { -+ System.out.println("[Spoutcraft] Updating renderer..."); -+ } -+ } -+ -+ closePreloadGui(); -+ } -+ -+ public static void showPreloadGui() { -+ // Display precache GUI -+ if (SpoutClient.getHandle().currentScreen instanceof GuiDownloadTerrain) { -+ SpoutClient.getHandle().displayGuiScreen(new GuiPrecache(), false); -+ //setPreloadGuiText("Checking plugin caches..."); -+ } -+ } -+ -+ public static void closePreloadGui() { -+ if (SpoutClient.getHandle().currentScreen instanceof GuiPrecache) { -+ // Closes downloading terrain -+ SpoutClient.getHandle().displayGuiScreen(null, false); -+ // Prevent closing a plugin created menu from opening the downloading terrain -+ SpoutClient.getHandle().clearPreviousScreen(); -+ } -+ SpoutClient.getInstance().getPacketManager().sendSpoutPacket(new org.spoutcraft.client.packet.PacketPreCacheCompleted()); -+ } -+ -+ public static void setPreloadGuiText(String text) { -+ if (SpoutClient.getHandle().currentScreen instanceof GuiPrecache) { -+ ((GuiPrecache)SpoutClient.getHandle().currentScreen).statusText.setText(text); -+ ((GuiPrecache)SpoutClient.getHandle().currentScreen).statusText.onTick(); -+ } -+ } -+ -+ public static void loadDesign(File file) { -+ short customId = -1; -+ byte data = 0; -+ GenericBlockDesign design = null; -+ -+ try { -+ final FileInputStream stream = new FileInputStream(file); -+ final FileChannel read = stream.getChannel(); -+ final MappedByteBuffer buffer = read.map(FileChannel.MapMode.READ_ONLY, 0, read.size()); -+ stream.close(); -+ customId = buffer.getShort(); -+ data = buffer.get(); -+ design = new GenericBlockDesign(); -+ design.read(new SpoutInputStream(buffer)); -+ -+ } catch (IOException e) { -+ e.printStackTrace(); -+ } finally { -+ if (design != null && design.isReset()) { -+ design = null; -+ } -+ if (customId != -1) { -+ CustomBlock block = MaterialData.getCustomBlock(customId); -+ if (block != null) { -+ block.setBlockDesign(design, data); -+ } -+ } -+ } -+ } -+} ---- net/minecraft/src/CommandDebug.java -+++ net/minecraft/src/CommandDebug.java -@@ -8,43 +8,50 @@ - import net.minecraft.server.MinecraftServer; - - public class CommandDebug extends CommandBase { -+ -+ /** Time the debugging started in milliseconds. */ - private long startTime; -+ -+ /** The number of ticks when debugging started. */ - private int startTicks; - - public String getCommandName() { - return "debug"; - } - -+ /** -+ * Return the required permission level for this command. -+ */ - public int getRequiredPermissionLevel() { - return 3; - } - -- public String getCommandUsage(ICommandSender var1) { -+ public String getCommandUsage(ICommandSender par1ICommandSender) { - return "commands.debug.usage"; - } - -- public void processCommand(ICommandSender var1, String[] var2) { -- if(var2.length == 1) { -- if(var2[0].equals("start")) { -- notifyAdmins(var1, "commands.debug.start", new Object[0]); -+ public void processCommand(ICommandSender par1ICommandSender, String[] par2ArrayOfStr) { -+ if (par2ArrayOfStr.length == 1) { -+ if (par2ArrayOfStr[0].equals("start")) { -+ notifyAdmins(par1ICommandSender, "commands.debug.start", new Object[0]); - MinecraftServer.getServer().enableProfiling(); -- this.startTime = MinecraftServer.getCurrentTimeMillis(); -+ this.startTime = MinecraftServer.getSystemTimeMillis(); - this.startTicks = MinecraftServer.getServer().getTickCounter(); - return; - } - -- if(var2[0].equals("stop")) { -- if(!MinecraftServer.getServer().theProfiler.profilingEnabled) { -+ if (par2ArrayOfStr[0].equals("stop")) { -+ if (!MinecraftServer.getServer().theProfiler.profilingEnabled) { - throw new CommandException("commands.debug.notStarted", new Object[0]); - } - -- long var3 = MinecraftServer.getCurrentTimeMillis(); -+ long var3 = MinecraftServer.getSystemTimeMillis(); - int var5 = MinecraftServer.getServer().getTickCounter(); - long var6 = var3 - this.startTime; - int var8 = var5 - this.startTicks; - this.saveProfilerResults(var6, var8); - MinecraftServer.getServer().theProfiler.profilingEnabled = false; -- notifyAdmins(var1, "commands.debug.stop", new Object[]{Float.valueOf((float)var6 / 1000.0F), Integer.valueOf(var8)}); -+ notifyAdmins(par1ICommandSender, "commands.debug.stop", new Object[] {Float.valueOf((float)var6 / 1000.0F), Integer.valueOf(var8)}); - return; - } - } -@@ -52,66 +59,69 @@ - throw new WrongUsageException("commands.debug.usage", new Object[0]); - } - -- private void saveProfilerResults(long var1, int var3) { -+ private void saveProfilerResults(long par1, int par3) { - File var4 = new File(MinecraftServer.getServer().getFile("debug"), "profile-results-" + (new SimpleDateFormat("yyyy-MM-dd_HH.mm.ss")).format(new Date()) + ".txt"); - var4.getParentFile().mkdirs(); - - try { - FileWriter var5 = new FileWriter(var4); -- var5.write(this.getProfilerResults(var1, var3)); -+ var5.write(this.getProfilerResults(par1, par3)); - var5.close(); - } catch (Throwable var6) { - MinecraftServer.getServer().getLogAgent().logSevereException("Could not save profiler results to " + var4, var6); - } -- - } - -- private String getProfilerResults(long var1, int var3) { -+ private String getProfilerResults(long par1, int par3) { - StringBuilder var4 = new StringBuilder(); - var4.append("---- Minecraft Profiler Results ----\n"); - var4.append("// "); - var4.append(getWittyComment()); - var4.append("\n\n"); -- var4.append("Time span: ").append(var1).append(" ms\n"); -- var4.append("Tick span: ").append(var3).append(" ticks\n"); -- var4.append("// This is approximately ").append(String.format("%.2f", new Object[]{Float.valueOf((float)var3 / ((float)var1 / 1000.0F))})).append(" ticks per second. It should be ").append(20).append(" ticks per second\n\n"); -+ var4.append("Time span: ").append(par1).append(" ms\n"); -+ var4.append("Tick span: ").append(par3).append(" ticks\n"); -+ var4.append("// This is approximately ").append(String.format("%.2f", new Object[] {Float.valueOf((float)par3 / ((float)par1 / 1000.0F))})).append(" ticks per second. It should be ").append(20).append(" ticks per second\n\n"); - var4.append("--- BEGIN PROFILE DUMP ---\n\n"); - this.getProfileDump(0, "root", var4); - var4.append("--- END PROFILE DUMP ---\n\n"); - return var4.toString(); - } - -- private void getProfileDump(int var1, String var2, StringBuilder var3) { -- List var4 = MinecraftServer.getServer().theProfiler.getProfilingData(var2); -- if(var4 != null && var4.size() >= 3) { -- for(int var5 = 1; var5 < var4.size(); ++var5) { -+ private void getProfileDump(int par1, String par2Str, StringBuilder par3StringBuilder) { -+ List var4 = MinecraftServer.getServer().theProfiler.getProfilingData(par2Str); -+ -+ if (var4 != null && var4.size() >= 3) { -+ for (int var5 = 1; var5 < var4.size(); ++var5) { - ProfilerResult var6 = (ProfilerResult)var4.get(var5); -- var3.append(String.format("[%02d] ", new Object[]{Integer.valueOf(var1)})); -+ par3StringBuilder.append(String.format("[%02d] ", new Object[] {Integer.valueOf(par1)})); - -- for(int var7 = 0; var7 < var1; ++var7) { -- var3.append(" "); -+ for (int var7 = 0; var7 < par1; ++var7) { -+ par3StringBuilder.append(" "); - } - -- var3.append(var6.c); -- var3.append(" - "); -- var3.append(String.format("%.2f", new Object[]{Double.valueOf(var6.field_76332_a)})); -- var3.append("%/"); -- var3.append(String.format("%.2f", new Object[]{Double.valueOf(var6.field_76330_b)})); -- var3.append("%\n"); -- if(!var6.c.equals("unspecified")) { -+ par3StringBuilder.append(var6.field_76331_c); -+ par3StringBuilder.append(" - "); -+ par3StringBuilder.append(String.format("%.2f", new Object[] {Double.valueOf(var6.field_76332_a)})); -+ par3StringBuilder.append("%/"); -+ par3StringBuilder.append(String.format("%.2f", new Object[] {Double.valueOf(var6.field_76330_b)})); -+ par3StringBuilder.append("%\n"); -+ -+ if (!var6.field_76331_c.equals("unspecified")) { - try { -- this.getProfileDump(var1 + 1, var2 + "." + var6.c, var3); -+ this.getProfileDump(par1 + 1, par2Str + "." + var6.field_76331_c, par3StringBuilder); - } catch (Exception var8) { -- var3.append("[[ EXCEPTION " + var8 + " ]]"); -+ par3StringBuilder.append("[[ EXCEPTION " + var8 + " ]]"); - } - } - } -- - } - } - -+ /** -+ * Returns a random "witty" comment. -+ */ - private static String getWittyComment() { -- String[] var0 = new String[]{"Shiny numbers!", "Am I not running fast enough? :(", "I\'m working as hard as I can!", "Will I ever be good enough for you? :(", "Speedy. Zoooooom!", "Hello world", "40% better than a crash report.", "Now with extra numbers", "Now with less numbers", "Now with the same numbers", "You should add flames to things, it makes them go faster!", "Do you feel the need for... optimization?", "*cracks redstone whip*", "Maybe if you treated it better then it\'ll have more motivation to work faster! Poor server."}; -+ String[] var0 = new String[] {"Shiny numbers!", "Am I not running fast enough? :(", "I\'m working as hard as I can!", "Will I ever be good enough for you? :(", "Speedy. Zoooooom!", "Hello world", "40% better than a crash report.", "Now with extra numbers", "Now with less numbers", "Now with the same numbers", "You should add flames to things, it makes them go faster!", "Do you feel the need for... optimization?", "*cracks redstone whip*", "Maybe if you treated it better then it\'ll have more motivation to work faster! Poor server."}; - - try { - return var0[(int)(System.nanoTime() % (long)var0.length)]; -@@ -120,7 +130,10 @@ - } - } - -- public List addTabCompletionOptions(ICommandSender var1, String[] var2) { -- return var2.length == 1 ? getListOfStringsMatchingLastWord(var2, new String[]{"start", "stop"}) : null; -+ /** -+ * Adds the strings available in this command to the given list of tab completion options. -+ */ -+ public List addTabCompletionOptions(ICommandSender par1ICommandSender, String[] par2ArrayOfStr) { -+ return par2ArrayOfStr.length == 1 ? getListOfStringsMatchingLastWord(par2ArrayOfStr, new String[] {"start", "stop"}): null; - } - } ---- net/minecraft/src/GuiSlotStats.java -+++ net/minecraft/src/GuiSlotStats.java -@@ -7,25 +7,31 @@ - - abstract class GuiSlotStats extends GuiSlot { - protected int field_77262_g; -- protected List h; -- protected Comparator i; -+ protected List field_77266_h; -+ protected Comparator field_77267_i; - protected int field_77264_j; - protected int field_77265_k; -+ - final GuiStats statsGui; - -- protected GuiSlotStats(GuiStats var1) { -- super(GuiStats.getMinecraft1(var1), var1.width, var1.height, 32, var1.height - 64, 20); -- this.statsGui = var1; -+ protected GuiSlotStats(GuiStats par1GuiStats) { -+ super(GuiStats.getMinecraft1(par1GuiStats), par1GuiStats.width, par1GuiStats.height, 32, par1GuiStats.height - 64, 20); -+ this.statsGui = par1GuiStats; - this.field_77262_g = -1; - this.field_77264_j = -1; - this.setShowSelectionBox(false); - this.func_77223_a(true, 20); - } - -- protected void elementClicked(int var1, boolean var2) { -- } -+ /** -+ * the element in the slot that was clicked, boolean for wether it was double clicked or not -+ */ -+ protected void elementClicked(int par1, boolean par2) {} - -- protected boolean isSelected(int var1) { -+ /** -+ * returns true if the element passed in is currently selected -+ */ -+ protected boolean isSelected(int par1) { - return false; - } - -@@ -33,150 +39,155 @@ - this.statsGui.drawDefaultBackground(); - } - -- protected void func_77222_a(int var1, int var2, Tessellator var3) { -- if(!Mouse.isButtonDown(0)) { -+ protected void func_77222_a(int par1, int par2, Tessellator par3Tessellator) { -+ if (!Mouse.isButtonDown(0)) { - this.field_77262_g = -1; - } - -- if(this.field_77262_g == 0) { -- GuiStats.drawSprite(this.statsGui, var1 + 115 - 18, var2 + 1, 0, 0); -- } else { -- GuiStats.drawSprite(this.statsGui, var1 + 115 - 18, var2 + 1, 0, 18); -- } -- -- if(this.field_77262_g == 1) { -- GuiStats.drawSprite(this.statsGui, var1 + 165 - 18, var2 + 1, 0, 0); -- } else { -- GuiStats.drawSprite(this.statsGui, var1 + 165 - 18, var2 + 1, 0, 18); -- } -- -- if(this.field_77262_g == 2) { -- GuiStats.drawSprite(this.statsGui, var1 + 215 - 18, var2 + 1, 0, 0); -- } else { -- GuiStats.drawSprite(this.statsGui, var1 + 215 - 18, var2 + 1, 0, 18); -- } -- -- if(this.field_77264_j != -1) { -+ if (this.field_77262_g == 0) { -+ GuiStats.drawSprite(this.statsGui, par1 + 115 - 18, par2 + 1, 0, 0); -+ } else { -+ GuiStats.drawSprite(this.statsGui, par1 + 115 - 18, par2 + 1, 0, 18); -+ } -+ -+ if (this.field_77262_g == 1) { -+ GuiStats.drawSprite(this.statsGui, par1 + 165 - 18, par2 + 1, 0, 0); -+ } else { -+ GuiStats.drawSprite(this.statsGui, par1 + 165 - 18, par2 + 1, 0, 18); -+ } -+ -+ if (this.field_77262_g == 2) { -+ GuiStats.drawSprite(this.statsGui, par1 + 215 - 18, par2 + 1, 0, 0); -+ } else { -+ GuiStats.drawSprite(this.statsGui, par1 + 215 - 18, par2 + 1, 0, 18); -+ } -+ -+ if (this.field_77264_j != -1) { - short var4 = 79; - byte var5 = 18; -- if(this.field_77264_j == 1) { -+ -+ if (this.field_77264_j == 1) { - var4 = 129; -- } else if(this.field_77264_j == 2) { -+ } else if (this.field_77264_j == 2) { - var4 = 179; - } - -- if(this.field_77265_k == 1) { -+ if (this.field_77265_k == 1) { - var5 = 36; - } - -- GuiStats.drawSprite(this.statsGui, var1 + var4, var2 + 1, var5, 0); -+ GuiStats.drawSprite(this.statsGui, par1 + var4, par2 + 1, var5, 0); - } -- - } - -- protected void func_77224_a(int var1, int var2) { -+ protected void func_77224_a(int par1, int par2) { - this.field_77262_g = -1; -- if(var1 >= 79 && var1 < 115) { -+ -+ if (par1 >= 79 && par1 < 115) { - this.field_77262_g = 0; -- } else if(var1 >= 129 && var1 < 165) { -+ } else if (par1 >= 129 && par1 < 165) { - this.field_77262_g = 1; -- } else if(var1 >= 179 && var1 < 215) { -+ } else if (par1 >= 179 && par1 < 215) { - this.field_77262_g = 2; - } - -- if(this.field_77262_g >= 0) { -+ if (this.field_77262_g >= 0) { - this.func_77261_e(this.field_77262_g); - GuiStats.getMinecraft2(this.statsGui).sndManager.playSoundFX("random.click", 1.0F, 1.0F); - } -- - } - -+ /** -+ * Gets the size of the current slot list. -+ */ - protected final int getSize() { -- return this.h.size(); -+ return this.field_77266_h.size(); - } - -- protected final StatCrafting func_77257_d(int var1) { -- return (StatCrafting)this.h.get(var1); -+ protected final StatCrafting func_77257_d(int par1) { -+ return (StatCrafting)this.field_77266_h.get(par1); - } - - protected abstract String func_77258_c(int var1); - -- protected void func_77260_a(StatCrafting var1, int var2, int var3, boolean var4) { -+ protected void func_77260_a(StatCrafting par1StatCrafting, int par2, int par3, boolean par4) { - String var5; -- if(var1 != null) { -- var5 = var1.func_75968_a(GuiStats.getStatsFileWriter(this.statsGui).writeStat(var1)); -- this.statsGui.drawString(GuiStats.getFontRenderer4(this.statsGui), var5, var2 - GuiStats.getFontRenderer5(this.statsGui).getStringWidth(var5), var3 + 5, var4 ? 16777215 : 9474192); -+ -+ if (par1StatCrafting != null) { -+ var5 = par1StatCrafting.func_75968_a(GuiStats.getStatsFileWriter(this.statsGui).writeStat(par1StatCrafting)); -+ this.statsGui.drawString(GuiStats.getFontRenderer4(this.statsGui), var5, par2 - GuiStats.getFontRenderer5(this.statsGui).getStringWidth(var5), par3 + 5, par4 ? 16777215 : 9474192); - } else { - var5 = "-"; -- this.statsGui.drawString(GuiStats.getFontRenderer6(this.statsGui), var5, var2 - GuiStats.getFontRenderer7(this.statsGui).getStringWidth(var5), var3 + 5, var4 ? 16777215 : 9474192); -+ this.statsGui.drawString(GuiStats.getFontRenderer6(this.statsGui), var5, par2 - GuiStats.getFontRenderer7(this.statsGui).getStringWidth(var5), par3 + 5, par4 ? 16777215 : 9474192); - } -- - } - -- protected void func_77215_b(int var1, int var2) { -- if(var2 >= this.top && var2 <= this.bottom) { -- int var3 = this.func_77210_c(var1, var2); -+ protected void func_77215_b(int par1, int par2) { -+ if (par2 >= this.top && par2 <= this.bottom) { -+ int var3 = this.func_77210_c(par1, par2); - int var4 = this.statsGui.width / 2 - 92 - 16; -- if(var3 >= 0) { -- if(var1 < var4 + 40 || var1 > var4 + 40 + 20) { -+ -+ if (var3 >= 0) { -+ if (par1 < var4 + 40 || par1 > var4 + 40 + 20) { - return; - } - -- StatCrafting var9 = this.func_77257_d(var3); -- this.func_77259_a(var9, var1, var2); -+ StatCrafting var5 = this.func_77257_d(var3); -+ this.func_77259_a(var5, par1, par2); - } else { -- String var5 = ""; -- if(var1 >= var4 + 115 - 18 && var1 <= var4 + 115) { -- var5 = this.func_77258_c(0); -- } else if(var1 >= var4 + 165 - 18 && var1 <= var4 + 165) { -- var5 = this.func_77258_c(1); -+ String var9 = ""; -+ -+ if (par1 >= var4 + 115 - 18 && par1 <= var4 + 115) { -+ var9 = this.func_77258_c(0); -+ } else if (par1 >= var4 + 165 - 18 && par1 <= var4 + 165) { -+ var9 = this.func_77258_c(1); - } else { -- if(var1 < var4 + 215 - 18 || var1 > var4 + 215) { -+ if (par1 < var4 + 215 - 18 || par1 > var4 + 215) { - return; - } - -- var5 = this.func_77258_c(2); -+ var9 = this.func_77258_c(2); - } - -- var5 = ("" + I18n.getString(var5)).trim(); -- if(var5.length() > 0) { -- int var6 = var1 + 12; -- int var7 = var2 - 12; -- int var8 = GuiStats.getFontRenderer8(this.statsGui).getStringWidth(var5); -+ var9 = ("" + I18n.getString(var9)).trim(); -+ -+ if (var9.length() > 0) { -+ int var6 = par1 + 12; -+ int var7 = par2 - 12; -+ int var8 = GuiStats.getFontRenderer8(this.statsGui).getStringWidth(var9); - GuiStats.drawGradientRect(this.statsGui, var6 - 3, var7 - 3, var6 + var8 + 3, var7 + 8 + 3, -1073741824, -1073741824); -- GuiStats.getFontRenderer9(this.statsGui).drawStringWithShadow(var5, var6, var7, -1); -+ GuiStats.getFontRenderer9(this.statsGui).drawStringWithShadow(var9, var6, var7, -1); - } - } -- - } - } - -- protected void func_77259_a(StatCrafting var1, int var2, int var3) { -- if(var1 != null) { -- Item var4 = Item.itemsList[var1.getItemID()]; -+ protected void func_77259_a(StatCrafting par1StatCrafting, int par2, int par3) { -+ if (par1StatCrafting != null) { -+ Item var4 = Item.itemsList[par1StatCrafting.getItemID()]; - String var5 = ("" + I18n.getString(var4.getUnlocalizedName() + ".name")).trim(); -- if(var5.length() > 0) { -- int var6 = var2 + 12; -- int var7 = var3 - 12; -+ -+ if (var5.length() > 0) { -+ int var6 = par2 + 12; -+ int var7 = par3 - 12; - int var8 = GuiStats.getFontRenderer10(this.statsGui).getStringWidth(var5); - GuiStats.drawGradientRect1(this.statsGui, var6 - 3, var7 - 3, var6 + var8 + 3, var7 + 8 + 3, -1073741824, -1073741824); - GuiStats.getFontRenderer11(this.statsGui).drawStringWithShadow(var5, var6, var7, -1); - } -- - } - } - -- protected void func_77261_e(int var1) { -- if(var1 != this.field_77264_j) { -- this.field_77264_j = var1; -+ protected void func_77261_e(int par1) { -+ if (par1 != this.field_77264_j) { -+ this.field_77264_j = par1; - this.field_77265_k = -1; -- } else if(this.field_77265_k == -1) { -+ } else if (this.field_77265_k == -1) { - this.field_77265_k = 1; - } else { - this.field_77264_j = -1; - this.field_77265_k = 0; - } - -- Collections.sort(this.h, this.i); -+ Collections.sort(this.field_77266_h, this.field_77267_i); - } - } ---- net/minecraft/src/SimpleReloadableResourceManagerINNER1.java -+++ net/minecraft/src/SimpleReloadableResourceManagerINNER1.java -@@ -5,15 +5,15 @@ - class SimpleReloadableResourceManagerINNER1 implements Function { - final SimpleReloadableResourceManager theSimpleReloadableResourceManager; - -- SimpleReloadableResourceManagerINNER1(SimpleReloadableResourceManager var1) { -- this.theSimpleReloadableResourceManager = var1; -- } -- -- public String apply(ResourcePack var1) { -- return var1.getPackName(); -- } -- -- public Object apply(Object var1) { -- return this.apply((ResourcePack)var1); -+ SimpleReloadableResourceManagerINNER1(SimpleReloadableResourceManager par1SimpleReloadableResourceManager) { -+ this.theSimpleReloadableResourceManager = par1SimpleReloadableResourceManager; -+ } -+ -+ public String apply(ResourcePack par1ResourcePack) { -+ return par1ResourcePack.getPackName(); -+ } -+ -+ public Object apply(Object par1Obj) { -+ return this.apply((ResourcePack)par1Obj); - } - } ---- /dev/null -+++ org/spoutcraft/client/gui/server/GuiAddFavorite.java -@@ -1,0 +1,194 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.client.gui.server; -+ -+import net.minecraft.src.GuiScreen; -+ -+import org.spoutcraft.api.Spoutcraft; -+import org.spoutcraft.api.gui.Button; -+import org.spoutcraft.api.gui.GenericButton; -+import org.spoutcraft.api.gui.GenericLabel; -+import org.spoutcraft.api.gui.GenericTextField; -+import org.spoutcraft.api.gui.Keyboard; -+import org.spoutcraft.api.gui.Label; -+import org.spoutcraft.api.gui.TextField; -+import org.spoutcraft.client.SpoutClient; -+ -+public class GuiAddFavorite extends GuiScreen { -+ private TextField textIp, textTitle; -+ private ServerItem item = null; -+ private ServerItem toUpdate = null; -+ private Label labelTitle, labelIp; -+ private boolean update = false; -+ private Button buttonDone, buttonCancel, buttonClear; -+ private GuiScreen parent; -+ -+ public GuiAddFavorite(String server, GuiScreen parent) { -+ String splt[] = server.split(":"); -+ int port = ServerItem.DEFAULT_PORT; -+ if (splt.length > 0) { -+ server = splt[0]; -+ if (splt.length > 1) { -+ try { -+ port = Integer.valueOf(splt[1]); -+ } catch (NumberFormatException e) { -+ port = ServerItem.DEFAULT_PORT; -+ } -+ } -+ } else { -+ server = ""; -+ } -+ item = new ServerItem("", server, port, -1); -+ update = false; -+ this.parent = parent; -+ } -+ -+ public GuiAddFavorite(ServerItem toUpdate, GuiScreen parent) { -+ item = toUpdate.clone(); -+ this.toUpdate = toUpdate; -+ update = true; -+ this.parent = parent; -+ } -+ -+ @Override -+ public void initGui() { -+ int top = height / 2 - 101/2; -+ int left = width / 2 - 250 / 2; -+ -+ updateItem(); -+ -+ labelTitle = new GenericLabel("Server Name"); -+ labelTitle.setHeight(11).setWidth(250).setX(left).setY(top); -+ getScreen().attachWidget("Spoutcraft", labelTitle); -+ top+=13; -+ -+ textTitle = new TabField(); -+ textTitle.setMaximumCharacters(0).setWidth(250).setHeight(20).setX(left).setY(top); -+ textTitle.setText(item.getTitle()); -+ getScreen().attachWidget("Spoutcraft", textTitle); -+ top+=25; -+ -+ labelIp = new GenericLabel("Server Address"); -+ labelIp.setHeight(11).setWidth(250).setX(left).setY(top); -+ getScreen().attachWidget("Spoutcraft", labelIp); -+ top+=13; -+ -+ textIp = new TabField(); -+ textIp.setMaximumCharacters(0); -+ textIp.setWidth(250); -+ textIp.setHeight(20); -+ textIp.setX(left).setY(top); -+ getScreen().attachWidget("Spoutcraft", textIp); -+ textIp.setText(item.getIp() + (item.getPort() != ServerItem.DEFAULT_PORT ? ":" + item.getPort() : "")); -+ top+=25; -+ -+ buttonClear = new GenericButton("Clear"); -+ buttonClear.setWidth(100).setHeight(20).setX(textIp.getX()).setY(top); -+ getScreen().attachWidget("Spoutcraft", buttonClear); -+ -+ buttonDone = new GenericButton("Done"); -+ buttonDone.setWidth(200).setHeight(20).setX(width - 205).setY(height - 25); -+ getScreen().attachWidget("Spoutcraft", buttonDone); -+ -+ buttonCancel = new GenericButton("Cancel"); -+ buttonCancel.setWidth(200).setHeight(20).setX(width - 205 - 205).setY(height - 25); -+ getScreen().attachWidget("Spoutcraft", buttonCancel); -+ -+ updateButtons(); -+ } -+ -+ private class TabField extends GenericTextField { -+ @Override -+ public void onTextFieldChange() { -+ updateButtons(); -+ } -+ -+ @Override -+ public boolean onKeyPressed(Keyboard key) { -+ if (key == Keyboard.KEY_TAB) { -+ if (textIp.isFocus()) { -+ textIp.setFocus(false); -+ textTitle.setFocus(true); -+ } else { -+ textTitle.setFocus(false); -+ textIp.setFocus(true); -+ } -+ return true; -+ } -+ return false; -+ } -+ -+ } -+ -+ @Override -+ protected void buttonClicked(Button btn) { -+ if (btn.equals(buttonDone)) { -+ updateItem(); -+ if (item.getTitle().isEmpty() || item.getIp().isEmpty()) { -+ SpoutClient.getHandle().displayGuiScreen(parent); -+ return; -+ } -+ if (update) { -+ // Update original item -+ toUpdate.update(item); -+ } else { -+ SpoutClient.getInstance().getServerManager().getFavorites().addServer(item); -+ } -+ SpoutClient.getInstance().getServerManager().getFavorites().save(); -+ SpoutClient.getHandle().displayGuiScreen(parent); -+ } -+ if (btn.equals(buttonCancel)) { -+ SpoutClient.getHandle().displayGuiScreen(parent); -+ } -+ if (btn == buttonClear) { -+ textTitle.setText(""); -+ textIp.setText(""); -+ item.setTitle(""); -+ item.setIp(""); -+ item.setPort(ServerItem.DEFAULT_PORT); -+ updateButtons(); -+ } -+ } -+ -+ protected void updateButtons() { -+ buttonDone.setEnabled(!textIp.getText().isEmpty() && !textTitle.getText().isEmpty()); -+ } -+ -+ private void updateItem() { -+ if (textTitle != null) { -+ item.setTitle(textTitle.getText()); -+ } -+ if (textIp != null) { -+ String split[] = textIp.getText().split(":"); -+ item.setIp(split[0]); -+ try { -+ item.setPort(Integer.valueOf(split[1])); -+ } catch(Exception e) { -+ // Handles both InvalidNumber and OutOfRange exceptions, yay -+ item.setPort(ServerItem.DEFAULT_PORT); -+ } -+ } -+ } -+ -+ @Override -+ public void drawScreen(int a, int b, float f) { -+ drawDefaultBackground(); -+ } -+} ---- /dev/null -+++ org/spoutcraft/client/gui/settings/controls/FancyGrassButton.java -@@ -1,0 +1,47 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.client.gui.settings.controls; -+ -+import java.util.UUID; -+ -+import net.minecraft.src.Minecraft; -+ -+import org.spoutcraft.client.config.Configuration; -+ -+public class FancyGrassButton extends AutomatedCheckBox { -+ UUID fancyGraphics; -+ public FancyGrassButton(UUID fancyGraphics) { -+ super("Fancy Grass"); -+ this.fancyGraphics = fancyGraphics; -+ setChecked(Configuration.isFancyGrass()); -+ setTooltip("Fancy Grass\nFast - lower quality, faster\nFancy - higher quality, slower\nFast grass uses default side texture.\nFancy grass uses biome side texture."); -+ } -+ -+ @Override -+ public void onButtonClick() { -+ Configuration.setFancyGrass(!Configuration.isFancyGrass()); -+ Configuration.write(); -+ ((FancyGraphicsButton)getScreen().getWidget(fancyGraphics)).custom = true; -+ -+ if (Minecraft.getMinecraft().theWorld != null) { -+ Minecraft.getMinecraft().renderGlobal.updateAllRenderers(); -+ } -+ } -+} ---- net/minecraft/src/Packet54PlayNoteBlock.java -+++ net/minecraft/src/Packet54PlayNoteBlock.java -@@ -8,44 +8,63 @@ - public int xLocation; - public int yLocation; - public int zLocation; -+ -+ /** 1=Double Bass, 2=Snare Drum, 3=Clicks / Sticks, 4=Bass Drum, 5=Harp */ - public int instrumentType; -+ -+ /** -+ * The pitch of the note (between 0-24 inclusive where 0 is the lowest and 24 is the highest). -+ */ - public int pitch; -+ -+ /** The block ID this action is set for. */ - public int blockId; - -- public Packet54PlayNoteBlock() { -- } -- -- public Packet54PlayNoteBlock(int var1, int var2, int var3, int var4, int var5, int var6) { -- this.xLocation = var1; -- this.yLocation = var2; -- this.zLocation = var3; -- this.instrumentType = var5; -- this.pitch = var6; -- this.blockId = var4; -- } -- -- public void readPacketData(DataInput var1) throws IOException { -- this.xLocation = var1.readInt(); -- this.yLocation = var1.readShort(); -- this.zLocation = var1.readInt(); -- this.instrumentType = var1.readUnsignedByte(); -- this.pitch = var1.readUnsignedByte(); -- this.blockId = var1.readShort() & 4095; -- } -- -- public void writePacketData(DataOutput var1) throws IOException { -- var1.writeInt(this.xLocation); -- var1.writeShort(this.yLocation); -- var1.writeInt(this.zLocation); -- var1.write(this.instrumentType); -- var1.write(this.pitch); -- var1.writeShort(this.blockId & 4095); -- } -- -- public void processPacket(NetHandler var1) { -- var1.handleBlockEvent(this); -- } -- -+ public Packet54PlayNoteBlock() {} -+ -+ public Packet54PlayNoteBlock(int par1, int par2, int par3, int par4, int par5, int par6) { -+ this.xLocation = par1; -+ this.yLocation = par2; -+ this.zLocation = par3; -+ this.instrumentType = par5; -+ this.pitch = par6; -+ this.blockId = par4; -+ } -+ -+ /** -+ * Abstract. Reads the raw packet data from the data stream. -+ */ -+ public void readPacketData(DataInput par1DataInput) throws IOException { -+ this.xLocation = par1DataInput.readInt(); -+ this.yLocation = par1DataInput.readShort(); -+ this.zLocation = par1DataInput.readInt(); -+ this.instrumentType = par1DataInput.readUnsignedByte(); -+ this.pitch = par1DataInput.readUnsignedByte(); -+ this.blockId = par1DataInput.readShort() & 4095; -+ } -+ -+ /** -+ * Abstract. Writes the raw packet data to the data stream. -+ */ -+ public void writePacketData(DataOutput par1DataOutput) throws IOException { -+ par1DataOutput.writeInt(this.xLocation); -+ par1DataOutput.writeShort(this.yLocation); -+ par1DataOutput.writeInt(this.zLocation); -+ par1DataOutput.write(this.instrumentType); -+ par1DataOutput.write(this.pitch); -+ par1DataOutput.writeShort(this.blockId & 4095); -+ } -+ -+ /** -+ * Passes this Packet on to the NetHandler for processing. -+ */ -+ public void processPacket(NetHandler par1NetHandler) { -+ par1NetHandler.handleBlockEvent(this); -+ } -+ -+ /** -+ * Abstract. Return the size of the packet (not counting the header). -+ */ - public int getPacketSize() { - return 14; - } ---- net/minecraft/src/EntitySpellParticleFX.java -+++ net/minecraft/src/EntitySpellParticleFX.java -@@ -1,61 +1,73 @@ - package net.minecraft.src; - - public class EntitySpellParticleFX extends EntityFX { -+ -+ /** Base spell texture index */ - private int baseSpellTextureIndex = 128; - -- public EntitySpellParticleFX(World var1, double var2, double var4, double var6, double var8, double var10, double var12) { -- super(var1, var2, var4, var6, var8, var10, var12); -- this.motionY *= (double)0.2F; -- if(var8 == 0.0D && var12 == 0.0D) { -- this.motionX *= (double)0.1F; -- this.motionZ *= (double)0.1F; -+ public EntitySpellParticleFX(World par1World, double par2, double par4, double par6, double par8, double par10, double par12) { -+ super(par1World, par2, par4, par6, par8, par10, par12); -+ this.motionY *= 0.20000000298023224D; -+ -+ if (par8 == 0.0D && par12 == 0.0D) { -+ this.motionX *= 0.10000000149011612D; -+ this.motionZ *= 0.10000000149011612D; - } - -- this.particleScale *= 12.0F / 16.0F; -+ this.particleScale *= 0.75F; - this.particleMaxAge = (int)(8.0D / (Math.random() * 0.8D + 0.2D)); - this.noClip = false; - } - -- public void renderParticle(Tessellator var1, float var2, float var3, float var4, float var5, float var6, float var7) { -- float var8 = ((float)this.particleAge + var2) / (float)this.particleMaxAge * 32.0F; -- if(var8 < 0.0F) { -+ public void renderParticle(Tessellator par1Tessellator, float par2, float par3, float par4, float par5, float par6, float par7) { -+ float var8 = ((float)this.particleAge + par2) / (float)this.particleMaxAge * 32.0F; -+ -+ if (var8 < 0.0F) { - var8 = 0.0F; - } - -- if(var8 > 1.0F) { -+ if (var8 > 1.0F) { - var8 = 1.0F; - } - -- super.renderParticle(var1, var2, var3, var4, var5, var6, var7); -+ super.renderParticle(par1Tessellator, par2, par3, par4, par5, par6, par7); - } - -+ /** -+ * Called to update the entity's position/logic. -+ */ - public void onUpdate() { - this.prevPosX = this.posX; - this.prevPosY = this.posY; - this.prevPosZ = this.posZ; -- if(this.particleAge++ >= this.particleMaxAge) { -+ -+ if (this.particleAge++ >= this.particleMaxAge) { - this.setDead(); - } - - this.setParticleTextureIndex(this.baseSpellTextureIndex + (7 - this.particleAge * 8 / this.particleMaxAge)); - this.motionY += 0.004D; - this.moveEntity(this.motionX, this.motionY, this.motionZ); -- if(this.posY == this.prevPosY) { -+ -+ if (this.posY == this.prevPosY) { - this.motionX *= 1.1D; - this.motionZ *= 1.1D; - } - -- this.motionX *= (double)0.96F; -- this.motionY *= (double)0.96F; -- this.motionZ *= (double)0.96F; -- if(this.onGround) { -- this.motionX *= (double)0.7F; -- this.motionZ *= (double)0.7F; -+ this.motionX *= 0.9599999785423279D; -+ this.motionY *= 0.9599999785423279D; -+ this.motionZ *= 0.9599999785423279D; -+ -+ if (this.onGround) { -+ this.motionX *= 0.699999988079071D; -+ this.motionZ *= 0.699999988079071D; - } -- - } - -- public void setBaseSpellTextureIndex(int var1) { -- this.baseSpellTextureIndex = var1; -+ /** -+ * Sets the base spell texture index -+ */ -+ public void setBaseSpellTextureIndex(int par1) { -+ this.baseSpellTextureIndex = par1; - } - } ---- net/minecraft/src/ScaledResolution.java -+++ net/minecraft/src/ScaledResolution.java -@@ -7,16 +7,17 @@ - private double scaledHeightD; - private int scaleFactor; - -- public ScaledResolution(GameSettings var1, int var2, int var3) { -- this.scaledWidth = var2; -- this.scaledHeight = var3; -+ public ScaledResolution(GameSettings par1GameSettings, int par2, int par3) { -+ this.scaledWidth = par2; -+ this.scaledHeight = par3; - this.scaleFactor = 1; -- int var4 = var1.guiScale; -- if(var4 == 0) { -+ int var4 = par1GameSettings.guiScale; -+ -+ if (var4 == 0) { - var4 = 1000; - } - -- while(this.scaleFactor < var4 && this.scaledWidth / (this.scaleFactor + 1) >= 320 && this.scaledHeight / (this.scaleFactor + 1) >= 240) { -+ while (this.scaleFactor < var4 && this.scaledWidth / (this.scaleFactor + 1) >= 320 && this.scaledHeight / (this.scaleFactor + 1) >= 240) { - ++this.scaleFactor; - } - ---- net/minecraft/src/SpiderEffectsGroupData.java -+++ net/minecraft/src/SpiderEffectsGroupData.java -@@ -5,17 +5,17 @@ - public class SpiderEffectsGroupData implements EntityLivingData { - public int field_111105_a; - -- public void func_111104_a(Random var1) { -- int var2 = var1.nextInt(5); -- if(var2 <= 1) { -+ public void func_111104_a(Random par1Random) { -+ int var2 = par1Random.nextInt(5); -+ -+ if (var2 <= 1) { - this.field_111105_a = Potion.moveSpeed.id; -- } else if(var2 <= 2) { -+ } else if (var2 <= 2) { - this.field_111105_a = Potion.damageBoost.id; -- } else if(var2 <= 3) { -+ } else if (var2 <= 3) { - this.field_111105_a = Potion.regeneration.id; -- } else if(var2 <= 4) { -+ } else if (var2 <= 4) { - this.field_111105_a = Potion.invisibility.id; - } -- - } - } ---- net/minecraft/src/EntityFootStepFX.java -+++ net/minecraft/src/EntityFootStepFX.java -@@ -8,24 +8,25 @@ - private int footstepMaxAge; - private TextureManager currentFootSteps; - -- public EntityFootStepFX(TextureManager var1, World var2, double var3, double var5, double var7) { -- super(var2, var3, var5, var7, 0.0D, 0.0D, 0.0D); -- this.currentFootSteps = var1; -+ public EntityFootStepFX(TextureManager par1TextureManager, World par2World, double par3, double par5, double par7) { -+ super(par2World, par3, par5, par7, 0.0D, 0.0D, 0.0D); -+ this.currentFootSteps = par1TextureManager; - this.motionX = this.motionY = this.motionZ = 0.0D; - this.footstepMaxAge = 200; - } - -- public void renderParticle(Tessellator var1, float var2, float var3, float var4, float var5, float var6, float var7) { -- float var8 = ((float)this.footstepAge + var2) / (float)this.footstepMaxAge; -+ public void renderParticle(Tessellator par1Tessellator, float par2, float par3, float par4, float par5, float par6, float par7) { -+ float var8 = ((float)this.footstepAge + par2) / (float)this.footstepMaxAge; - var8 *= var8; - float var9 = 2.0F - var8 * 2.0F; -- if(var9 > 1.0F) { -+ -+ if (var9 > 1.0F) { - var9 = 1.0F; - } - - var9 *= 0.2F; - GL11.glDisable(GL11.GL_LIGHTING); -- float var10 = 2.0F / 16.0F; -+ float var10 = 0.125F; - float var11 = (float)(this.posX - interpPosX); - float var12 = (float)(this.posY - interpPosY); - float var13 = (float)(this.posZ - interpPosZ); -@@ -33,23 +34,26 @@ - this.currentFootSteps.bindTexture(field_110126_a); - GL11.glEnable(GL11.GL_BLEND); - GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); -- var1.startDrawingQuads(); -- var1.setColorRGBA_F(var14, var14, var14, var9); -- var1.addVertexWithUV((double)(var11 - var10), (double)var12, (double)(var13 + var10), 0.0D, 1.0D); -- var1.addVertexWithUV((double)(var11 + var10), (double)var12, (double)(var13 + var10), 1.0D, 1.0D); -- var1.addVertexWithUV((double)(var11 + var10), (double)var12, (double)(var13 - var10), 1.0D, 0.0D); -- var1.addVertexWithUV((double)(var11 - var10), (double)var12, (double)(var13 - var10), 0.0D, 0.0D); -- var1.draw(); -+ par1Tessellator.startDrawingQuads(); -+ par1Tessellator.setColorRGBA_F(var14, var14, var14, var9); -+ par1Tessellator.addVertexWithUV((double)(var11 - var10), (double)var12, (double)(var13 + var10), 0.0D, 1.0D); -+ par1Tessellator.addVertexWithUV((double)(var11 + var10), (double)var12, (double)(var13 + var10), 1.0D, 1.0D); -+ par1Tessellator.addVertexWithUV((double)(var11 + var10), (double)var12, (double)(var13 - var10), 1.0D, 0.0D); -+ par1Tessellator.addVertexWithUV((double)(var11 - var10), (double)var12, (double)(var13 - var10), 0.0D, 0.0D); -+ par1Tessellator.draw(); - GL11.glDisable(GL11.GL_BLEND); - GL11.glEnable(GL11.GL_LIGHTING); - } - -+ /** -+ * Called to update the entity's position/logic. -+ */ - public void onUpdate() { - ++this.footstepAge; -- if(this.footstepAge == this.footstepMaxAge) { -+ -+ if (this.footstepAge == this.footstepMaxAge) { - this.setDead(); - } -- - } - - public int getFXLayer() { ---- net/minecraft/src/EntityAIMate.java -+++ net/minecraft/src/EntityAIMate.java -@@ -8,18 +8,27 @@ - private EntityAnimal theAnimal; - World theWorld; - private EntityAnimal targetMate; -+ -+ /** -+ * Delay preventing a baby from spawning immediately when two mate-able animals find each other. -+ */ - int spawnBabyDelay; -+ -+ /** The speed the creature moves at during mating behavior. */ - double moveSpeed; - -- public EntityAIMate(EntityAnimal var1, double var2) { -- this.theAnimal = var1; -- this.theWorld = var1.worldObj; -- this.moveSpeed = var2; -+ public EntityAIMate(EntityAnimal par1EntityAnimal, double par2) { -+ this.theAnimal = par1EntityAnimal; -+ this.theWorld = par1EntityAnimal.worldObj; -+ this.moveSpeed = par2; - this.setMutexBits(3); - } - -+ /** -+ * Returns whether the EntityAIBase should begin execution. -+ */ - public boolean shouldExecute() { -- if(!this.theAnimal.isInLove()) { -+ if (!this.theAnimal.isInLove()) { - return false; - } else { - this.targetMate = this.getNearbyMate(); -@@ -27,25 +36,38 @@ - } - } - -+ /** -+ * Returns whether an in-progress EntityAIBase should continue executing -+ */ - public boolean continueExecuting() { - return this.targetMate.isEntityAlive() && this.targetMate.isInLove() && this.spawnBabyDelay < 60; - } - -+ /** -+ * Resets the task -+ */ - public void resetTask() { - this.targetMate = null; - this.spawnBabyDelay = 0; - } - -+ /** -+ * Updates the task -+ */ - public void updateTask() { - this.theAnimal.getLookHelper().setLookPositionWithEntity(this.targetMate, 10.0F, (float)this.theAnimal.getVerticalFaceSpeed()); - this.theAnimal.getNavigator().tryMoveToEntityLiving(this.targetMate, this.moveSpeed); - ++this.spawnBabyDelay; -- if(this.spawnBabyDelay >= 60 && this.theAnimal.getDistanceSqToEntity(this.targetMate) < 9.0D) { -+ -+ if (this.spawnBabyDelay >= 60 && this.theAnimal.getDistanceSqToEntity(this.targetMate) < 9.0D) { - this.spawnBaby(); - } -- - } - -+ /** -+ * Loops through nearby animals and finds another animal of the same type that can be mated with. Returns the first -+ * valid mate found. -+ */ - private EntityAnimal getNearbyMate() { - float var1 = 8.0F; - List var2 = this.theWorld.getEntitiesWithinAABB(this.theAnimal.getClass(), this.theAnimal.boundingBox.expand((double)var1, (double)var1, (double)var1)); -@@ -53,9 +75,10 @@ - EntityAnimal var5 = null; - Iterator var6 = var2.iterator(); - -- while(var6.hasNext()) { -+ while (var6.hasNext()) { - EntityAnimal var7 = (EntityAnimal)var6.next(); -- if(this.theAnimal.canMateWith(var7) && this.theAnimal.getDistanceSqToEntity(var7) < var3) { -+ -+ if (this.theAnimal.canMateWith(var7) && this.theAnimal.getDistanceSqToEntity(var7) < var3) { - var5 = var7; - var3 = this.theAnimal.getDistanceSqToEntity(var7); - } -@@ -64,9 +87,13 @@ - return var5; - } - -+ /** -+ * Spawns a baby animal of the same type. -+ */ - private void spawnBaby() { - EntityAgeable var1 = this.theAnimal.createChild(this.targetMate); -- if(var1 != null) { -+ -+ if (var1 != null) { - this.theAnimal.setGrowingAge(6000); - this.targetMate.setGrowingAge(6000); - this.theAnimal.resetInLove(); -@@ -76,7 +103,7 @@ - this.theWorld.spawnEntityInWorld(var1); - Random var2 = this.theAnimal.getRNG(); - -- for(int var3 = 0; var3 < 7; ++var3) { -+ for (int var3 = 0; var3 < 7; ++var3) { - double var4 = var2.nextGaussian() * 0.02D; - double var6 = var2.nextGaussian() * 0.02D; - double var8 = var2.nextGaussian() * 0.02D; ---- net/minecraft/src/Packet10Flying.java -+++ net/minecraft/src/Packet10Flying.java -@@ -5,44 +5,80 @@ - import java.io.IOException; - - public class Packet10Flying extends Packet { -+ -+ /** The player's X position. */ - public double xPosition; -+ -+ /** The player's Y position. */ - public double yPosition; -+ -+ /** The player's Z position. */ - public double zPosition; -+ -+ /** The player's stance. (boundingBox.minY) */ - public double stance; -+ -+ /** The player's yaw rotation. */ - public float yaw; -+ -+ /** The player's pitch rotation. */ - public float pitch; -+ -+ /** True if the client is on the ground. */ - public boolean onGround; -+ -+ /** Boolean set to true if the player is moving. */ - public boolean moving; -+ -+ /** Boolean set to true if the player is rotating. */ - public boolean rotating; - -- public Packet10Flying() { -- } -- -- public Packet10Flying(boolean var1) { -- this.onGround = var1; -- } -- -- public void processPacket(NetHandler var1) { -- var1.handleFlying(this); -- } -- -- public void readPacketData(DataInput var1) throws IOException { -- this.onGround = var1.readUnsignedByte() != 0; -- } -- -- public void writePacketData(DataOutput var1) throws IOException { -- var1.write(this.onGround ? 1 : 0); -- } -- -+ public Packet10Flying() {} -+ -+ public Packet10Flying(boolean par1) { -+ this.onGround = par1; -+ } -+ -+ /** -+ * Passes this Packet on to the NetHandler for processing. -+ */ -+ public void processPacket(NetHandler par1NetHandler) { -+ par1NetHandler.handleFlying(this); -+ } -+ -+ /** -+ * Abstract. Reads the raw packet data from the data stream. -+ */ -+ public void readPacketData(DataInput par1DataInput) throws IOException { -+ this.onGround = par1DataInput.readUnsignedByte() != 0; -+ } -+ -+ /** -+ * Abstract. Writes the raw packet data to the data stream. -+ */ -+ public void writePacketData(DataOutput par1DataOutput) throws IOException { -+ par1DataOutput.write(this.onGround ? 1 : 0); -+ } -+ -+ /** -+ * Abstract. Return the size of the packet (not counting the header). -+ */ - public int getPacketSize() { - return 1; - } - -+ /** -+ * only false for the abstract Packet class, all real packets return true -+ */ - public boolean isRealPacket() { - return true; - } - -- public boolean containsSameEntityIDAs(Packet var1) { -+ /** -+ * eg return packet30entity.entityId == entityId; WARNING : will throw if you compare a packet to a different packet -+ * class -+ */ -+ public boolean containsSameEntityIDAs(Packet par1Packet) { - return true; - } - } ---- /dev/null -+++ org/spoutcraft/client/gui/MinecraftFontWrapper.java -@@ -1,0 +1,56 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.client.gui; -+ -+import net.minecraft.src.Minecraft; -+import net.minecraft.src.ChatAllowedCharacters; -+ -+import org.spoutcraft.api.gui.MinecraftFont; -+ -+public class MinecraftFontWrapper implements MinecraftFont { -+ public int getTextWidth(String text) { -+ return Minecraft.getMinecraft().fontRenderer.getStringWidth(text); -+ } -+ -+ public boolean isAllowedChar(char ch) { -+ return ChatAllowedCharacters.allowedCharacters.indexOf(ch) > -1 || ch > 32; -+ } -+ -+ public boolean isAllowedText(String text) { -+ for (int i = 0; i < text.length(); i++) { -+ if (!isAllowedChar(text.charAt(i))) { -+ return false; -+ } -+ } -+ return true; -+ } -+ -+ public void drawString(String text, int x, int y, int color) { -+ Minecraft.getMinecraft().fontRenderer.drawString(text, x, y, color); -+ } -+ -+ public void drawCenteredString(String text, int x, int y, int color) { -+ Minecraft.getMinecraft().fontRenderer.drawString(text, x, y - getTextWidth(text) / 2, color); -+ } -+ -+ public void drawShadowedString(String text, int x, int y, int color) { -+ Minecraft.getMinecraft().fontRenderer.drawStringWithShadow(text, x, y, color); -+ } -+} ---- net/minecraft/src/BlockRedstoneLogic.java -+++ net/minecraft/src/BlockRedstoneLogic.java -@@ -3,220 +3,285 @@ - import java.util.Random; - - public abstract class BlockRedstoneLogic extends BlockDirectional { -+ -+ /** Tells whether the repeater is powered or not */ - protected final boolean isRepeaterPowered; - -- protected BlockRedstoneLogic(int var1, boolean var2) { -- super(var1, Material.circuits); -- this.isRepeaterPowered = var2; -- this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 2.0F / 16.0F, 1.0F); -+ protected BlockRedstoneLogic(int par1, boolean par2) { -+ super(par1, Material.circuits); -+ this.isRepeaterPowered = par2; -+ this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.125F, 1.0F); - } - -+ /** -+ * If this block doesn't render as an ordinary block it will return False (examples: signs, buttons, stairs, etc) -+ */ - public boolean renderAsNormalBlock() { - return false; - } - -- public boolean canPlaceBlockAt(World var1, int var2, int var3, int var4) { -- return !var1.doesBlockHaveSolidTopSurface(var2, var3 - 1, var4) ? false : super.canPlaceBlockAt(var1, var2, var3, var4); -- } -- -- public boolean canBlockStay(World var1, int var2, int var3, int var4) { -- return !var1.doesBlockHaveSolidTopSurface(var2, var3 - 1, var4) ? false : super.canBlockStay(var1, var2, var3, var4); -- } -- -- public void updateTick(World var1, int var2, int var3, int var4, Random var5) { -- int var6 = var1.getBlockMetadata(var2, var3, var4); -- if(!this.func_94476_e(var1, var2, var3, var4, var6)) { -- boolean var7 = this.isGettingInput(var1, var2, var3, var4, var6); -- if(this.isRepeaterPowered && !var7) { -- var1.setBlock(var2, var3, var4, this.func_94484_i().blockID, var6, 2); -- } else if(!this.isRepeaterPowered) { -- var1.setBlock(var2, var3, var4, this.func_94485_e().blockID, var6, 2); -- if(!var7) { -- var1.scheduleBlockUpdateWithPriority(var2, var3, var4, this.func_94485_e().blockID, this.func_94486_g(var6), -1); -+ /** -+ * Checks to see if its valid to put this block at the specified coordinates. Args: world, x, y, z -+ */ -+ public boolean canPlaceBlockAt(World par1World, int par2, int par3, int par4) { -+ return !par1World.doesBlockHaveSolidTopSurface(par2, par3 - 1, par4) ? false : super.canPlaceBlockAt(par1World, par2, par3, par4); -+ } -+ -+ /** -+ * Can this block stay at this position. Similar to canPlaceBlockAt except gets checked often with plants. -+ */ -+ public boolean canBlockStay(World par1World, int par2, int par3, int par4) { -+ return !par1World.doesBlockHaveSolidTopSurface(par2, par3 - 1, par4) ? false : super.canBlockStay(par1World, par2, par3, par4); -+ } -+ -+ /** -+ * Ticks the block if it's been scheduled -+ */ -+ public void updateTick(World par1World, int par2, int par3, int par4, Random par5Random) { -+ int var6 = par1World.getBlockMetadata(par2, par3, par4); -+ -+ if (!this.func_94476_e(par1World, par2, par3, par4, var6)) { -+ boolean var7 = this.isGettingInput(par1World, par2, par3, par4, var6); -+ -+ if (this.isRepeaterPowered && !var7) { -+ par1World.setBlock(par2, par3, par4, this.func_94484_i().blockID, var6, 2); -+ } else if (!this.isRepeaterPowered) { -+ par1World.setBlock(par2, par3, par4, this.func_94485_e().blockID, var6, 2); -+ -+ if (!var7) { -+ par1World.scheduleBlockUpdateWithPriority(par2, par3, par4, this.func_94485_e().blockID, this.func_94486_g(var6), -1); - } - } - } -- -- } -- -- public Icon getIcon(int var1, int var2) { -- return var1 == 0 ? (this.isRepeaterPowered ? Block.torchRedstoneActive.getBlockTextureFromSide(var1) : Block.torchRedstoneIdle.getBlockTextureFromSide(var1)) : (var1 == 1 ? this.blockIcon : Block.stoneDoubleSlab.getBlockTextureFromSide(1)); -- } -- -- public boolean shouldSideBeRendered(IBlockAccess var1, int var2, int var3, int var4, int var5) { -- return var5 != 0 && var5 != 1; -- } -- -+ } -+ -+ /** -+ * From the specified side and block metadata retrieves the blocks texture. Args: side, metadata -+ */ -+ public Icon getIcon(int par1, int par2) { -+ return par1 == 0 ? (this.isRepeaterPowered ? Block.torchRedstoneActive.getBlockTextureFromSide(par1) : Block.torchRedstoneIdle.getBlockTextureFromSide(par1)) : (par1 == 1 ? this.blockIcon : Block.stoneDoubleSlab.getBlockTextureFromSide(1)); -+ } -+ -+ /** -+ * Returns true if the given side of this block type should be rendered, if the adjacent block is at the given -+ * coordinates. Args: blockAccess, x, y, z, side -+ */ -+ public boolean shouldSideBeRendered(IBlockAccess par1IBlockAccess, int par2, int par3, int par4, int par5) { -+ return par5 != 0 && par5 != 1; -+ } -+ -+ /** -+ * The type of render function that is called for this block -+ */ - public int getRenderType() { - return 36; - } - -- protected boolean func_96470_c(int var1) { -+ protected boolean func_96470_c(int par1) { - return this.isRepeaterPowered; - } - -- public int isProvidingStrongPower(IBlockAccess var1, int var2, int var3, int var4, int var5) { -- return this.isProvidingWeakPower(var1, var2, var3, var4, var5); -+ /** -+ * Returns true if the block is emitting direct/strong redstone power on the specified side. Args: World, X, Y, Z, -+ * side. Note that the side is reversed - eg it is 1 (up) when checking the bottom of the block. -+ */ -+ public int isProvidingStrongPower(IBlockAccess par1IBlockAccess, int par2, int par3, int par4, int par5) { -+ return this.isProvidingWeakPower(par1IBlockAccess, par2, par3, par4, par5); - } - -- public int isProvidingWeakPower(IBlockAccess var1, int var2, int var3, int var4, int var5) { -- int var6 = var1.getBlockMetadata(var2, var3, var4); -- if(!this.func_96470_c(var6)) { -+ /** -+ * Returns true if the block is emitting indirect/weak redstone power on the specified side. If isBlockNormalCube -+ * returns true, standard redstone propagation rules will apply instead and this will not be called. Args: World, X, Y, -+ * Z, side. Note that the side is reversed - eg it is 1 (up) when checking the bottom of the block. -+ */ -+ public int isProvidingWeakPower(IBlockAccess par1IBlockAccess, int par2, int par3, int par4, int par5) { -+ int var6 = par1IBlockAccess.getBlockMetadata(par2, par3, par4); -+ -+ if (!this.func_96470_c(var6)) { - return 0; - } else { - int var7 = getDirection(var6); -- return var7 == 0 && var5 == 3 ? this.func_94480_d(var1, var2, var3, var4, var6) : (var7 == 1 && var5 == 4 ? this.func_94480_d(var1, var2, var3, var4, var6) : (var7 == 2 && var5 == 2 ? this.func_94480_d(var1, var2, var3, var4, var6) : (var7 == 3 && var5 == 5 ? this.func_94480_d(var1, var2, var3, var4, var6) : 0))); -+ return var7 == 0 && par5 == 3 ? this.func_94480_d(par1IBlockAccess, par2, par3, par4, var6) : (var7 == 1 && par5 == 4 ? this.func_94480_d(par1IBlockAccess, par2, par3, par4, var6) : (var7 == 2 && par5 == 2 ? this.func_94480_d(par1IBlockAccess, par2, par3, par4, var6) : (var7 == 3 && par5 == 5 ? this.func_94480_d(par1IBlockAccess, par2, par3, par4, var6) : 0))); - } - } - -- public void onNeighborBlockChange(World var1, int var2, int var3, int var4, int var5) { -- if(!this.canBlockStay(var1, var2, var3, var4)) { -- this.dropBlockAsItem(var1, var2, var3, var4, var1.getBlockMetadata(var2, var3, var4), 0); -- var1.setBlockToAir(var2, var3, var4); -- var1.notifyBlocksOfNeighborChange(var2 + 1, var3, var4, this.blockID); -- var1.notifyBlocksOfNeighborChange(var2 - 1, var3, var4, this.blockID); -- var1.notifyBlocksOfNeighborChange(var2, var3, var4 + 1, this.blockID); -- var1.notifyBlocksOfNeighborChange(var2, var3, var4 - 1, this.blockID); -- var1.notifyBlocksOfNeighborChange(var2, var3 - 1, var4, this.blockID); -- var1.notifyBlocksOfNeighborChange(var2, var3 + 1, var4, this.blockID); -+ /** -+ * Lets the block know when one of its neighbor changes. Doesn't know which neighbor changed (coordinates passed are -+ * their own) Args: x, y, z, neighbor blockID -+ */ -+ public void onNeighborBlockChange(World par1World, int par2, int par3, int par4, int par5) { -+ if (!this.canBlockStay(par1World, par2, par3, par4)) { -+ this.dropBlockAsItem(par1World, par2, par3, par4, par1World.getBlockMetadata(par2, par3, par4), 0); -+ par1World.setBlockToAir(par2, par3, par4); -+ par1World.notifyBlocksOfNeighborChange(par2 + 1, par3, par4, this.blockID); -+ par1World.notifyBlocksOfNeighborChange(par2 - 1, par3, par4, this.blockID); -+ par1World.notifyBlocksOfNeighborChange(par2, par3, par4 + 1, this.blockID); -+ par1World.notifyBlocksOfNeighborChange(par2, par3, par4 - 1, this.blockID); -+ par1World.notifyBlocksOfNeighborChange(par2, par3 - 1, par4, this.blockID); -+ par1World.notifyBlocksOfNeighborChange(par2, par3 + 1, par4, this.blockID); - } else { -- this.func_94479_f(var1, var2, var3, var4, var5); -+ this.func_94479_f(par1World, par2, par3, par4, par5); - } - } - -- protected void func_94479_f(World var1, int var2, int var3, int var4, int var5) { -- int var6 = var1.getBlockMetadata(var2, var3, var4); -- if(!this.func_94476_e(var1, var2, var3, var4, var6)) { -- boolean var7 = this.isGettingInput(var1, var2, var3, var4, var6); -- if((this.isRepeaterPowered && !var7 || !this.isRepeaterPowered && var7) && !var1.isBlockTickScheduledThisTick(var2, var3, var4, this.blockID)) { -+ protected void func_94479_f(World par1World, int par2, int par3, int par4, int par5) { -+ int var6 = par1World.getBlockMetadata(par2, par3, par4); -+ -+ if (!this.func_94476_e(par1World, par2, par3, par4, var6)) { -+ boolean var7 = this.isGettingInput(par1World, par2, par3, par4, var6); -+ -+ if ((this.isRepeaterPowered && !var7 || !this.isRepeaterPowered && var7) && !par1World.isBlockTickScheduledThisTick(par2, par3, par4, this.blockID)) { - byte var8 = -1; -- if(this.func_83011_d(var1, var2, var3, var4, var6)) { -+ -+ if (this.func_83011_d(par1World, par2, par3, par4, var6)) { - var8 = -3; -- } else if(this.isRepeaterPowered) { -+ } else if (this.isRepeaterPowered) { - var8 = -2; - } - -- var1.scheduleBlockUpdateWithPriority(var2, var3, var4, this.blockID, this.func_94481_j_(var6), var8); -+ par1World.scheduleBlockUpdateWithPriority(par2, par3, par4, this.blockID, this.func_94481_j_(var6), var8); - } - } -- - } - -- public boolean func_94476_e(IBlockAccess var1, int var2, int var3, int var4, int var5) { -+ public boolean func_94476_e(IBlockAccess par1IBlockAccess, int par2, int par3, int par4, int par5) { - return false; - } - -- protected boolean isGettingInput(World var1, int var2, int var3, int var4, int var5) { -- return this.getInputStrength(var1, var2, var3, var4, var5) > 0; -- } -- -- protected int getInputStrength(World var1, int var2, int var3, int var4, int var5) { -- int var6 = getDirection(var5); -- int var7 = var2 + Direction.offsetX[var6]; -- int var8 = var4 + Direction.offsetZ[var6]; -- int var9 = var1.getIndirectPowerLevelTo(var7, var3, var8, Direction.directionToFacing[var6]); -- return var9 >= 15 ? var9 : Math.max(var9, var1.getBlockId(var7, var3, var8) == Block.redstoneWire.blockID ? var1.getBlockMetadata(var7, var3, var8) : 0); -- } -- -- protected int func_94482_f(IBlockAccess var1, int var2, int var3, int var4, int var5) { -- int var6 = getDirection(var5); -- switch(var6) { -- case 0: -- case 2: -- return Math.max(this.func_94488_g(var1, var2 - 1, var3, var4, 4), this.func_94488_g(var1, var2 + 1, var3, var4, 5)); -- case 1: -- case 3: -- return Math.max(this.func_94488_g(var1, var2, var3, var4 + 1, 3), this.func_94488_g(var1, var2, var3, var4 - 1, 2)); -- default: -- return 0; -+ protected boolean isGettingInput(World par1World, int par2, int par3, int par4, int par5) { -+ return this.getInputStrength(par1World, par2, par3, par4, par5) > 0; -+ } -+ -+ /** -+ * Returns the signal strength at one input of the block. Args: world, X, Y, Z, side -+ */ -+ protected int getInputStrength(World par1World, int par2, int par3, int par4, int par5) { -+ int var6 = getDirection(par5); -+ int var7 = par2 + Direction.offsetX[var6]; -+ int var8 = par4 + Direction.offsetZ[var6]; -+ int var9 = par1World.getIndirectPowerLevelTo(var7, par3, var8, Direction.directionToFacing[var6]); -+ return var9 >= 15 ? var9 : Math.max(var9, par1World.getBlockId(var7, par3, var8) == Block.redstoneWire.blockID ? par1World.getBlockMetadata(var7, par3, var8) : 0); -+ } -+ -+ protected int func_94482_f(IBlockAccess par1IBlockAccess, int par2, int par3, int par4, int par5) { -+ int var6 = getDirection(par5); -+ -+ switch (var6) { -+ case 0: -+ case 2: -+ return Math.max(this.func_94488_g(par1IBlockAccess, par2 - 1, par3, par4, 4), this.func_94488_g(par1IBlockAccess, par2 + 1, par3, par4, 5)); -+ -+ case 1: -+ case 3: -+ return Math.max(this.func_94488_g(par1IBlockAccess, par2, par3, par4 + 1, 3), this.func_94488_g(par1IBlockAccess, par2, par3, par4 - 1, 2)); -+ -+ default: -+ return 0; - } - } - -- protected int func_94488_g(IBlockAccess var1, int var2, int var3, int var4, int var5) { -- int var6 = var1.getBlockId(var2, var3, var4); -- return this.func_94477_d(var6) ? (var6 == Block.redstoneWire.blockID ? var1.getBlockMetadata(var2, var3, var4) : var1.isBlockProvidingPowerTo(var2, var3, var4, var5)) : 0; -+ protected int func_94488_g(IBlockAccess par1IBlockAccess, int par2, int par3, int par4, int par5) { -+ int var6 = par1IBlockAccess.getBlockId(par2, par3, par4); -+ return this.func_94477_d(var6) ? (var6 == Block.redstoneWire.blockID ? par1IBlockAccess.getBlockMetadata(par2, par3, par4) : par1IBlockAccess.isBlockProvidingPowerTo(par2, par3, par4, par5)) : 0; - } - -+ /** -+ * Can this block provide power. Only wire currently seems to have this change based on its state. -+ */ - public boolean canProvidePower() { - return true; - } - -- public void onBlockPlacedBy(World var1, int var2, int var3, int var4, EntityLivingBase var5, ItemStack var6) { -- int var7 = ((MathHelper.floor_double((double)(var5.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3) + 2) % 4; -- var1.setBlockMetadata(var2, var3, var4, var7, 3); -- boolean var8 = this.isGettingInput(var1, var2, var3, var4, var7); -- if(var8) { -- var1.scheduleBlockUpdate(var2, var3, var4, this.blockID, 1); -- } -- -- } -- -- public void onBlockAdded(World var1, int var2, int var3, int var4) { -- this.func_94483_i_(var1, var2, var3, var4); -- } -- -- protected void func_94483_i_(World var1, int var2, int var3, int var4) { -- int var5 = getDirection(var1.getBlockMetadata(var2, var3, var4)); -- if(var5 == 1) { -- var1.notifyBlockOfNeighborChange(var2 + 1, var3, var4, this.blockID); -- var1.notifyBlocksOfNeighborChange(var2 + 1, var3, var4, this.blockID, 4); -- } -- -- if(var5 == 3) { -- var1.notifyBlockOfNeighborChange(var2 - 1, var3, var4, this.blockID); -- var1.notifyBlocksOfNeighborChange(var2 - 1, var3, var4, this.blockID, 5); -- } -- -- if(var5 == 2) { -- var1.notifyBlockOfNeighborChange(var2, var3, var4 + 1, this.blockID); -- var1.notifyBlocksOfNeighborChange(var2, var3, var4 + 1, this.blockID, 2); -- } -- -- if(var5 == 0) { -- var1.notifyBlockOfNeighborChange(var2, var3, var4 - 1, this.blockID); -- var1.notifyBlocksOfNeighborChange(var2, var3, var4 - 1, this.blockID, 3); -- } -- -- } -- -- public void onBlockDestroyedByPlayer(World var1, int var2, int var3, int var4, int var5) { -- if(this.isRepeaterPowered) { -- var1.notifyBlocksOfNeighborChange(var2 + 1, var3, var4, this.blockID); -- var1.notifyBlocksOfNeighborChange(var2 - 1, var3, var4, this.blockID); -- var1.notifyBlocksOfNeighborChange(var2, var3, var4 + 1, this.blockID); -- var1.notifyBlocksOfNeighborChange(var2, var3, var4 - 1, this.blockID); -- var1.notifyBlocksOfNeighborChange(var2, var3 - 1, var4, this.blockID); -- var1.notifyBlocksOfNeighborChange(var2, var3 + 1, var4, this.blockID); -- } -- -- super.onBlockDestroyedByPlayer(var1, var2, var3, var4, var5); -- } -- -+ /** -+ * Called when the block is placed in the world. -+ */ -+ public void onBlockPlacedBy(World par1World, int par2, int par3, int par4, EntityLivingBase par5EntityLivingBase, ItemStack par6ItemStack) { -+ int var7 = ((MathHelper.floor_double((double)(par5EntityLivingBase.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3) + 2) % 4; -+ par1World.setBlockMetadataWithNotify(par2, par3, par4, var7, 3); -+ boolean var8 = this.isGettingInput(par1World, par2, par3, par4, var7); -+ -+ if (var8) { -+ par1World.scheduleBlockUpdate(par2, par3, par4, this.blockID, 1); -+ } -+ } -+ -+ /** -+ * Called whenever the block is added into the world. Args: world, x, y, z -+ */ -+ public void onBlockAdded(World par1World, int par2, int par3, int par4) { -+ this.func_94483_i_(par1World, par2, par3, par4); -+ } -+ -+ protected void func_94483_i_(World par1World, int par2, int par3, int par4) { -+ int var5 = getDirection(par1World.getBlockMetadata(par2, par3, par4)); -+ -+ if (var5 == 1) { -+ par1World.notifyBlockOfNeighborChange(par2 + 1, par3, par4, this.blockID); -+ par1World.notifyBlocksOfNeighborChange(par2 + 1, par3, par4, this.blockID, 4); -+ } -+ -+ if (var5 == 3) { -+ par1World.notifyBlockOfNeighborChange(par2 - 1, par3, par4, this.blockID); -+ par1World.notifyBlocksOfNeighborChange(par2 - 1, par3, par4, this.blockID, 5); -+ } -+ -+ if (var5 == 2) { -+ par1World.notifyBlockOfNeighborChange(par2, par3, par4 + 1, this.blockID); -+ par1World.notifyBlocksOfNeighborChange(par2, par3, par4 + 1, this.blockID, 2); -+ } -+ -+ if (var5 == 0) { -+ par1World.notifyBlockOfNeighborChange(par2, par3, par4 - 1, this.blockID); -+ par1World.notifyBlocksOfNeighborChange(par2, par3, par4 - 1, this.blockID, 3); -+ } -+ } -+ -+ /** -+ * Called right before the block is destroyed by a player. Args: world, x, y, z, metaData -+ */ -+ public void onBlockDestroyedByPlayer(World par1World, int par2, int par3, int par4, int par5) { -+ if (this.isRepeaterPowered) { -+ par1World.notifyBlocksOfNeighborChange(par2 + 1, par3, par4, this.blockID); -+ par1World.notifyBlocksOfNeighborChange(par2 - 1, par3, par4, this.blockID); -+ par1World.notifyBlocksOfNeighborChange(par2, par3, par4 + 1, this.blockID); -+ par1World.notifyBlocksOfNeighborChange(par2, par3, par4 - 1, this.blockID); -+ par1World.notifyBlocksOfNeighborChange(par2, par3 - 1, par4, this.blockID); -+ par1World.notifyBlocksOfNeighborChange(par2, par3 + 1, par4, this.blockID); -+ } -+ -+ super.onBlockDestroyedByPlayer(par1World, par2, par3, par4, par5); -+ } -+ -+ /** -+ * Is this block (a) opaque and (b) a full 1m cube? This determines whether or not to render the shared face of two -+ * adjacent blocks and also whether the player can attach torches, redstone wire, etc to this block. -+ */ - public boolean isOpaqueCube() { - return false; - } - -- protected boolean func_94477_d(int var1) { -- Block var2 = Block.blocksList[var1]; -+ protected boolean func_94477_d(int par1) { -+ Block var2 = Block.blocksList[par1]; - return var2 != null && var2.canProvidePower(); - } - -- protected int func_94480_d(IBlockAccess var1, int var2, int var3, int var4, int var5) { -+ protected int func_94480_d(IBlockAccess par1IBlockAccess, int par2, int par3, int par4, int par5) { - return 15; - } - -- public static boolean isRedstoneRepeaterBlockID(int var0) { -- return Block.redstoneRepeaterIdle.func_94487_f(var0) || Block.redstoneComparatorIdle.func_94487_f(var0); -- } -- -- public boolean func_94487_f(int var1) { -- return var1 == this.func_94485_e().blockID || var1 == this.func_94484_i().blockID; -- } -- -- public boolean func_83011_d(World var1, int var2, int var3, int var4, int var5) { -- int var6 = getDirection(var5); -- if(isRedstoneRepeaterBlockID(var1.getBlockId(var2 - Direction.offsetX[var6], var3, var4 - Direction.offsetZ[var6]))) { -- int var7 = var1.getBlockMetadata(var2 - Direction.offsetX[var6], var3, var4 - Direction.offsetZ[var6]); -+ public static boolean isRedstoneRepeaterBlockID(int par0) { -+ return Block.redstoneRepeaterIdle.func_94487_f(par0) || Block.redstoneComparatorIdle.func_94487_f(par0); -+ } -+ -+ public boolean func_94487_f(int par1) { -+ return par1 == this.func_94485_e().blockID || par1 == this.func_94484_i().blockID; -+ } -+ -+ public boolean func_83011_d(World par1World, int par2, int par3, int par4, int par5) { -+ int var6 = getDirection(par5); -+ -+ if (isRedstoneRepeaterBlockID(par1World.getBlockId(par2 - Direction.offsetX[var6], par3, par4 - Direction.offsetZ[var6]))) { -+ int var7 = par1World.getBlockMetadata(par2 - Direction.offsetX[var6], par3, par4 - Direction.offsetZ[var6]); - int var8 = getDirection(var7); - return var8 != var6; - } else { -@@ -224,8 +289,8 @@ - } - } - -- protected int func_94486_g(int var1) { -- return this.func_94481_j_(var1); -+ protected int func_94486_g(int par1) { -+ return this.func_94481_j_(par1); - } - - protected abstract int func_94481_j_(int var1); -@@ -234,7 +299,11 @@ - - protected abstract BlockRedstoneLogic func_94484_i(); - -- public boolean isAssociatedBlockID(int var1) { -- return this.func_94487_f(var1); -+ /** -+ * Returns true if the given block ID is equivalent to this one. Example: redstoneTorchOn matches itself and -+ * redstoneTorchOff, and vice versa. Most blocks only match themselves. -+ */ -+ public boolean isAssociatedBlockID(int par1) { -+ return this.func_94487_f(par1); - } - } ---- /dev/null -+++ org/spoutcraft/client/gui/settings/controls/DelayedTooltipCheckbox.java -@@ -1,0 +1,37 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.client.gui.settings.controls; -+ -+import org.spoutcraft.api.gui.GenericCheckBox; -+import org.spoutcraft.client.config.Configuration; -+ -+public class DelayedTooltipCheckbox extends GenericCheckBox { -+ public DelayedTooltipCheckbox() { -+ super("Delayed Tooltips"); -+ setTooltip("If ticked, widgets wait 500 ms\nuntil they show their tooltips."); -+ setChecked(Configuration.isDelayedTooltips()); -+ } -+ -+ @Override -+ public void onButtonClick() { -+ Configuration.setDelayedTooltips(!Configuration.isDelayedTooltips()); -+ Configuration.write(); -+ } -+} ---- net/minecraft/src/ItemExpBottle.java -+++ net/minecraft/src/ItemExpBottle.java -@@ -1,25 +1,29 @@ - package net.minecraft.src; - - public class ItemExpBottle extends Item { -- public ItemExpBottle(int var1) { -- super(var1); -+ public ItemExpBottle(int par1) { -+ super(par1); - this.setCreativeTab(CreativeTabs.tabMisc); - } - -- public boolean hasEffect(ItemStack var1) { -+ public boolean hasEffect(ItemStack par1ItemStack) { - return true; - } - -- public ItemStack onItemRightClick(ItemStack var1, World var2, EntityPlayer var3) { -- if(!var3.capabilities.isCreativeMode) { -- --var1.stackSize; -- } -- -- var2.playSoundAtEntity(var3, "random.bow", 0.5F, 0.4F / (f.nextFloat() * 0.4F + 0.8F)); -- if(!var2.isRemote) { -- var2.spawnEntityInWorld(new EntityExpBottle(var2, var3)); -- } -- -- return var1; -+ /** -+ * Called whenever this item is equipped and the right mouse button is pressed. Args: itemStack, world, entityPlayer -+ */ -+ public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) { -+ if (!par3EntityPlayer.capabilities.isCreativeMode) { -+ --par1ItemStack.stackSize; -+ } -+ -+ par2World.playSoundAtEntity(par3EntityPlayer, "random.bow", 0.5F, 0.4F / (itemRand.nextFloat() * 0.4F + 0.8F)); -+ -+ if (!par2World.isRemote) { -+ par2World.spawnEntityInWorld(new EntityExpBottle(par2World, par3EntityPlayer)); -+ } -+ -+ return par1ItemStack; - } - } ---- /dev/null -+++ org/spoutcraft/client/gui/server/GuiServerList.java -@@ -1,0 +1,314 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.client.gui.server; -+ -+import org.lwjgl.Sys; -+ -+import org.spoutcraft.api.Spoutcraft; -+import org.spoutcraft.api.gui.Button; -+import org.spoutcraft.api.gui.Color; -+import org.spoutcraft.api.gui.GenericButton; -+import org.spoutcraft.api.gui.GenericLabel; -+import org.spoutcraft.api.gui.GenericListView; -+import org.spoutcraft.api.gui.GenericScrollArea; -+import org.spoutcraft.api.gui.Label; -+import org.spoutcraft.api.gui.Orientation; -+import org.spoutcraft.api.gui.Widget; -+import org.spoutcraft.client.SpoutClient; -+import org.spoutcraft.client.gui.database.FilterButton; -+import org.spoutcraft.client.gui.database.GuiAPIDisplay; -+import org.spoutcraft.client.gui.database.RandomButton; -+import org.spoutcraft.client.gui.database.SearchField; -+import org.spoutcraft.client.gui.database.SortButton; -+ -+public class GuiServerList extends GuiAPIDisplay { -+ private ServerListModel model = SpoutClient.getInstance().getServerManager().getServerList(); -+ -+ private Label labelTitle, filterTitle; -+ private GenericListView view; -+ private GenericScrollArea filters; -+ private Button buttonJoin, buttonMainMenu, buttonFavorites, buttonRefresh, buttonReset, buttonAddServer, buttonInfo; -+ SortButton featured, popular, byName, byFreeSlots, /* byPing, */ byPlayers, trending; -+ RandomButton random; -+ FilterButton hasPlayers, notFull; -+ AccessTypeFilter accessType; -+ CountryButton buttonCountry; -+ SearchField search; -+ -+ boolean instancesCreated = false; -+ -+ public GuiServerList() { -+ model.setCurrentGui(this); -+ } -+ -+ public void createInstances() { -+ labelTitle = new GenericLabel("Public Server List"); -+ filters = new GenericScrollArea(); -+ filterTitle = new GenericLabel("Sort & Filter"); -+ featured = new SortButton("Featured", "featured", model); -+ popular = new SortButton("Popular", "popular", model); -+ trending = new SortButton("Trending", "trending", model); -+ byName = new SortButton("Name", "sortBy=name", model); -+ byFreeSlots = new SortButton("Free Slots", "sortBy=freeslots", false, model); -+ byPlayers = new SortButton("Players Online", "sortBy=players", false, model); -+ //byPing = new SortButton("Ping", "sortBy=ping", model); -+ random = new RandomButton(model); -+ hasPlayers = new FilterButton("Has Players", "hasplayers", model); -+ notFull = new FilterButton("Not Full", "notfull", model); -+ accessType = new AccessTypeFilter(model); -+ search = new SearchField(model); -+ buttonCountry = new CountryButton(); -+ view = new GenericListView(model); -+ buttonJoin = new GenericButton("Join Server"); -+ buttonMainMenu = new GenericButton("Main Menu"); -+ buttonFavorites = new GenericButton("Favorites"); -+ buttonRefresh = new GenericButton("Refresh"); -+ buttonReset = new GenericButton("Reset Filters"); -+ buttonAddServer = new GenericButton("Add Your Server"); -+ buttonInfo = new GenericButton("More Info..."); -+ -+ if (!model.getCurrentUrl().equals(model.getDefaultUrl())) { -+ model.clear(); -+ model.refreshAPIData(model.getDefaultUrl(), 0, true); -+ } -+ } -+ -+ public void initGui() { -+ model.clearUrlElements(); -+ -+ if (!instancesCreated) { -+ createInstances(); -+ } -+ -+ int top = 5; -+ labelTitle.setY(top + 7).setX(width / 2 - mc.fontRenderer.getStringWidth("Public Server List") / 2); -+ getScreen().attachWidget("Spoutcraft", labelTitle); -+ -+ buttonRefresh.setX(width - 5 - 100).setY(top).setWidth(100).setHeight(20); -+ getScreen().attachWidget("Spoutcraft", buttonRefresh); -+ -+ search.setWidth(128).setHeight(18).setX(6).setY(top+1); -+ getScreen().attachWidget("Spoutcraft", search); -+ model.addUrlElement(search); -+ -+ top+=25; -+ -+ filters.setWidth(130).setHeight(height - top - 55); -+ filters.setX(5).setY(top); -+ getScreen().attachWidget("Spoutcraft", filters); -+ -+ // Filter init { -+ int ftop = 5; -+ filterTitle.setX(5).setY(ftop).setHeight(11).setWidth(100); -+ filters.attachWidget("Spoutcraft", filterTitle); -+ ftop += 16; -+ -+ featured.setAllowSorting(false); -+ featured.setWidth(100).setHeight(20).setX(5).setY(ftop); -+ filters.attachWidget("Spoutcraft", featured); -+ model.addUrlElement(featured); -+ ftop += 25; -+ -+ trending.setAllowSorting(false); -+ trending.setWidth(100).setHeight(20).setX(5).setY(ftop); -+ filters.attachWidget("Spoutcraft", trending); -+ model.addUrlElement(trending); -+ ftop += 25; -+ -+ popular.setAllowSorting(false); -+ popular.setWidth(100).setHeight(20).setX(5).setY(ftop); -+ filters.attachWidget("Spoutcraft", popular); -+ model.addUrlElement(popular); -+ ftop += 25; -+ -+ random.setWidth(100).setHeight(20).setX(5).setY(ftop); -+ filters.attachWidget("Spoutcraft", random); -+ model.addUrlElement(random); -+ ftop += 25; -+ -+ byName.setWidth(100).setHeight(20).setX(5).setY(ftop); -+ filters.attachWidget("Spoutcraft", byName); -+ model.addUrlElement(byName); -+ ftop += 25; -+ -+ byFreeSlots.setWidth(100).setHeight(20).setX(5).setY(ftop); -+ byFreeSlots.setTooltip("Sorts by the number of free slots\non the server (maxplayers - players)"); -+ filters.attachWidget("Spoutcraft", byFreeSlots); -+ model.addUrlElement(byFreeSlots); -+ ftop += 25; -+ -+ byPlayers.setWidth(100).setHeight(20).setX(5).setY(ftop); -+ byPlayers.setTooltip("Sorts by the actual number of\nonline players on the server"); -+ filters.attachWidget("Spoutcraft", byPlayers); -+ model.addUrlElement(byPlayers); -+ ftop += 25; -+ -+ /*byPing.setWidth(100).setHeight(20).setX(5).setY(ftop); -+ filters.attachWidget("Spoutcraft", byPing); -+ model.addUrlElement(byPing); -+ ftop += 25;*/ -+ -+ hasPlayers.setWidth(100).setHeight(20).setX(5).setY(ftop); -+ filters.attachWidget("Spoutcraft", hasPlayers); -+ model.addUrlElement(hasPlayers); -+ ftop += 25; -+ -+ notFull.setWidth(100).setHeight(20).setX(5).setY(ftop); -+ filters.attachWidget("Spoutcraft", notFull); -+ model.addUrlElement(notFull); -+ ftop += 25; -+ -+ accessType.setWidth(100).setHeight(20).setX(5).setY(ftop); -+ filters.attachWidget("Spoutcraft", accessType); -+ model.addUrlElement(accessType); -+ ftop += 25; -+ -+ buttonCountry.setWidth(100).setHeight(20).setX(5).setY(ftop); -+ filters.attachWidget("Spoutcraft", buttonCountry); -+ model.addUrlElement(buttonCountry); -+ ftop += 25; -+ -+ // Stretch to real width -+ int fw = filters.getViewportSize(Orientation.HORIZONTAL); -+ fw-=10; -+ for (Widget w:filters.getAttachedWidgets()) { -+ w.setWidth(fw); -+ } -+ -+ if (!instancesCreated) { -+ featured.setSelected(true); -+ } -+ // Filter init } -+ -+ view.setX((int) filters.getWidth() + filters.getX() + 5).setY(top).setWidth((int) (width - filters.getWidth() - 10 - filters.getX())).setHeight(height - top - 55); -+ getScreen().attachWidget("Spoutcraft", view); -+ -+ top += view.getHeight() + 5; -+ -+ int totalWidth = Math.min(width - 9, 200 * 3 + 10); -+ int cellWidth = (totalWidth - 10) / 3; -+ int left = width / 2 - totalWidth / 2; -+ int center = left + cellWidth + 5; -+ int right = center + cellWidth + 5; -+ -+ buttonReset.setX(left).setY(top).setWidth(cellWidth).setHeight(20); -+ getScreen().attachWidget("Spoutcraft", buttonReset); -+ -+ buttonInfo.setX(center).setY(top).setWidth(cellWidth).setHeight(20); -+ getScreen().attachWidget("Spoutcraft", buttonInfo); -+ -+ buttonJoin.setHeight(20).setWidth(cellWidth).setX(right).setY(top); -+ getScreen().attachWidget("Spoutcraft", buttonJoin); -+ -+ top+=25; -+ -+ buttonAddServer.setHeight(20).setWidth(cellWidth).setX(left).setY(top); -+ getScreen().attachWidget("Spoutcraft", buttonAddServer); -+ -+ buttonFavorites.setHeight(20).setWidth(cellWidth).setX(center).setY(top); -+ getScreen().attachWidget("Spoutcraft", buttonFavorites); -+ -+ buttonMainMenu.setHeight(20).setWidth(cellWidth).setX(right).setY(top); -+ getScreen().attachWidget("Spoutcraft", buttonMainMenu); -+ -+ updateButtons(); -+ instancesCreated = true; -+ } -+ -+ public void drawScreen(int a, int b, float c) { -+ drawDefaultBackground(); -+ } -+ -+ public void buttonClicked(Button btn) { -+ if (btn.equals(buttonMainMenu)) { -+ mc.displayGuiScreen(new org.spoutcraft.client.gui.mainmenu.MainMenu()); -+ } -+ if (btn.equals(buttonFavorites)) { -+ GuiFavorites fav = new GuiFavorites(new org.spoutcraft.client.gui.mainmenu.MainMenu()); -+ mc.displayGuiScreen(fav); -+ fav.refresh(); -+ } -+ if (btn.equals(buttonJoin)) { -+ ServerItem item = (ServerItem) view.getSelectedItem(); -+ if (item != null) { -+ item.onClick(-1, -1, true); -+ } else { -+ updateButtons(); -+ } -+ } -+ if (btn.equals(buttonRefresh)) { -+ model.updateUrl(); -+ } -+ if (btn.equals(buttonReset)) { -+ model.clearElementFilters(); -+ featured.setSelected(true); -+ model.updateUrl(); -+ } -+ if (btn.equals(buttonAddServer)) { -+ Sys.openURL("http://servers.spout.org/submit"); -+ } -+ if (btn.equals(buttonInfo)) { -+ ServerItem item = (ServerItem) view.getSelectedItem(); -+ if (item != null) { -+ mc.displayGuiScreen(new GuiServerInfo(item, this)); -+ } else { -+ updateButtons(); -+ } -+ } -+ } -+ -+ public void updateButtons() { -+ boolean b = true; -+ if (view.getSelectedRow() == -1 || !(view.getSelectedItem() instanceof ServerItem)) { -+ b = false; -+ } -+ -+ buttonJoin.setEnabled(b); -+ -+ if (view.getSelectedItem() instanceof ServerItem) { -+ ServerItem item = (ServerItem) view.getSelectedItem(); -+ buttonJoin.setEnabled(item.isCompatible(SpoutClient.spoutcraftVersion)); -+ } -+ -+ buttonInfo.setEnabled(b); -+ -+ if (model.isLoading()) { -+ buttonRefresh.setEnabled(false); -+ buttonRefresh.setText("Loading..."); -+ buttonRefresh.setDisabledColor(new Color(0f,1f,0f)); -+ } else { -+ buttonRefresh.setEnabled(true); -+ buttonRefresh.setText("Refresh"); -+ } -+ } -+ -+ @Override -+ public void updateScreen() { -+ if (model.isLoading()) { -+ Color color = new Color(0, 1f, 0); -+ double darkness = 0; -+ long t = System.currentTimeMillis() % 1000; -+ darkness = Math.cos(t * 2 * Math.PI / 1000) * 0.2 + 0.2; -+ color.setGreen(1f - (float)darkness); -+ buttonRefresh.setDisabledColor(color); -+ } -+ super.updateScreen(); -+ } -+} ---- /dev/null -+++ com/prupe/mcpatcher/hd/BorderedTexture.java -@@ -1,0 +1,125 @@ -+package com.prupe.mcpatcher.hd; -+ -+import com.prupe.mcpatcher.MCLogger; -+import net.minecraft.src.TextureAtlasSprite; -+ -+public class BorderedTexture extends TextureAtlasSprite { -+ private static final MCLogger logger = MCLogger.getLogger("Mipmap"); -+ private float minU; -+ private float maxU; -+ private float minV; -+ private float maxV; -+ private float scaledWidth; -+ private float scaledHeight; -+ private int tilesheetWidth; -+ private int tilesheetHeight; -+ private int x0; -+ private int y0; -+ private String tilesheet; -+ int border; -+ -+ public static TextureAtlasSprite create(String tilesheet, String name) { -+ return (TextureAtlasSprite)(AAHelper.useAAForTexture(tilesheet) ? new BorderedTexture(tilesheet, name) : new TextureAtlasSprite(name)); -+ } -+ -+ private BorderedTexture(String tilesheet, String name) { -+ super(name); -+ this.tilesheet = tilesheet; -+ } -+ -+ public void initSprite(int tilesheetWidth, int tilesheetHeight, int x0, int y0, boolean flipped) { -+ super.initSprite(tilesheetWidth, tilesheetHeight, x0, y0, flipped); -+ this.tilesheetWidth = tilesheetWidth; -+ this.tilesheetHeight = tilesheetHeight; -+ this.x0 = x0; -+ this.y0 = y0; -+ this.setBorderWidth(this.border); -+ } -+ -+ /** -+ * Returns the minimum U coordinate to use when rendering with this icon. -+ */ -+ public float getMinU() { -+ return this.minU; -+ } -+ -+ /** -+ * Returns the maximum U coordinate to use when rendering with this icon. -+ */ -+ public float getMaxU() { -+ return this.maxU; -+ } -+ -+ /** -+ * Gets a U coordinate on the icon. 0 returns uMin and 16 returns uMax. Other arguments return in-between values. -+ */ -+ public float getInterpolatedU(double u) { -+ return this.border > 0 ? this.minU + (float)u * this.scaledWidth : super.getInterpolatedU(u); -+ } -+ -+ /** -+ * Returns the minimum V coordinate to use when rendering with this icon. -+ */ -+ public float getMinV() { -+ return this.minV; -+ } -+ -+ /** -+ * Returns the maximum V coordinate to use when rendering with this icon. -+ */ -+ public float getMaxV() { -+ return this.maxV; -+ } -+ -+ /** -+ * Gets a V coordinate on the icon. 0 returns vMin and 16 returns vMax. Other arguments return in-between values. -+ */ -+ public float getInterpolatedV(double v) { -+ return this.border > 0 ? this.minV + (float)v * this.scaledHeight : super.getInterpolatedV(v); -+ } -+ -+ public void copyFrom(TextureAtlasSprite stitched) { -+ if (stitched instanceof BorderedTexture) { -+ BorderedTexture bordered = (BorderedTexture)stitched; -+ this.tilesheetWidth = bordered.tilesheetWidth; -+ this.tilesheetHeight = bordered.tilesheetHeight; -+ this.x0 = bordered.x0; -+ this.y0 = bordered.y0; -+ this.tilesheet = bordered.tilesheet; -+ this.border = bordered.border; -+ } -+ } -+ -+ void setBorderWidth(int border) { -+ this.border = border; -+ int width = this.getIconWidth(); -+ int height = this.getIconHeight(); -+ -+ if (width > 0 && height > 0) { -+ logger.finer("setBorderWidth(%s, %s, %d): %dx%d -> %dx%d", new Object[] {this.tilesheet, this.getIconName(), Integer.valueOf(border), Integer.valueOf(width - 2 * border), Integer.valueOf(height - 2 * border), Integer.valueOf(width), Integer.valueOf(height)}); -+ -+ if (border > 0) { -+ this.x0 += border; -+ this.y0 += border; -+ width -= 2 * border; -+ height -= 2 * border; -+ this.minU = (float)this.x0 / (float)this.tilesheetWidth; -+ this.maxU = (float)(this.x0 + width) / (float)this.tilesheetWidth; -+ this.minV = (float)this.y0 / (float)this.tilesheetHeight; -+ this.maxV = (float)(this.y0 + height) / (float)this.tilesheetHeight; -+ } else { -+ this.minU = super.getMinU(); -+ this.maxU = super.getMaxU(); -+ this.minV = super.getMinV(); -+ this.maxV = super.getMaxV(); -+ } -+ -+ this.scaledWidth = (this.maxU - this.minU) / 16.0F; -+ this.scaledHeight = (this.maxV - this.minV) / 16.0F; -+ } else { -+ this.x0 = this.y0 = 0; -+ this.minU = this.maxU = this.minV = this.maxV = 0.0F; -+ this.scaledWidth = this.scaledHeight = 0.0F; -+ } -+ } -+} ---- net/minecraft/src/EntityAIRunAroundLikeCrazy.java -+++ net/minecraft/src/EntityAIRunAroundLikeCrazy.java -@@ -7,16 +7,20 @@ - private double field_111176_d; - private double field_111177_e; - -- public EntityAIRunAroundLikeCrazy(EntityHorse var1, double var2) { -- this.horseHost = var1; -- this.field_111178_b = var2; -+ public EntityAIRunAroundLikeCrazy(EntityHorse par1EntityHorse, double par2) { -+ this.horseHost = par1EntityHorse; -+ this.field_111178_b = par2; - this.setMutexBits(1); - } - -+ /** -+ * Returns whether the EntityAIBase should begin execution. -+ */ - public boolean shouldExecute() { -- if(!this.horseHost.isTame() && this.horseHost.riddenByEntity != null) { -+ if (!this.horseHost.isTame() && this.horseHost.riddenByEntity != null) { - Vec3 var1 = RandomPositionGenerator.findRandomTarget(this.horseHost, 5, 4); -- if(var1 == null) { -+ -+ if (var1 == null) { - return false; - } else { - this.field_111179_c = var1.xCoord; -@@ -29,20 +33,30 @@ - } - } - -+ /** -+ * Execute a one shot task or start executing a continuous task -+ */ - public void startExecuting() { - this.horseHost.getNavigator().tryMoveToXYZ(this.field_111179_c, this.field_111176_d, this.field_111177_e, this.field_111178_b); - } - -+ /** -+ * Returns whether an in-progress EntityAIBase should continue executing -+ */ - public boolean continueExecuting() { - return !this.horseHost.getNavigator().noPath() && this.horseHost.riddenByEntity != null; - } - -+ /** -+ * Updates the task -+ */ - public void updateTask() { -- if(this.horseHost.getRNG().nextInt(50) == 0) { -- if(this.horseHost.riddenByEntity instanceof EntityPlayer) { -+ if (this.horseHost.getRNG().nextInt(50) == 0) { -+ if (this.horseHost.riddenByEntity instanceof EntityPlayer) { - int var1 = this.horseHost.getTemper(); - int var2 = this.horseHost.getMaxTemper(); -- if(var2 > 0 && this.horseHost.getRNG().nextInt(var2) < var1) { -+ -+ if (var2 > 0 && this.horseHost.getRNG().nextInt(var2) < var1) { - this.horseHost.setTamedBy((EntityPlayer)this.horseHost.riddenByEntity); - this.horseHost.worldObj.setEntityState(this.horseHost, (byte)7); - return; -@@ -56,6 +70,5 @@ - this.horseHost.makeHorseRearWithSound(); - this.horseHost.worldObj.setEntityState(this.horseHost, (byte)6); - } -- - } - } ---- net/minecraft/src/IPlayerUsage.java -+++ net/minecraft/src/IPlayerUsage.java -@@ -5,6 +5,9 @@ - - void addServerTypeToSnooper(PlayerUsageSnooper var1); - -+ /** -+ * Returns whether snooping is enabled or not. -+ */ - boolean isSnooperEnabled(); - - ILogAgent getLogAgent(); ---- net/minecraft/src/Packet26EntityExpOrb.java -+++ net/minecraft/src/Packet26EntityExpOrb.java -@@ -5,43 +5,58 @@ - import java.io.IOException; - - public class Packet26EntityExpOrb extends Packet { -+ -+ /** Entity ID for the XP Orb */ - public int entityId; - public int posX; - public int posY; - public int posZ; -+ -+ /** The Orbs Experience points value. */ - public int xpValue; - -- public Packet26EntityExpOrb() { -- } -- -- public Packet26EntityExpOrb(EntityXPOrb var1) { -- this.entityId = var1.entityId; -- this.posX = MathHelper.floor_double(var1.posX * 32.0D); -- this.posY = MathHelper.floor_double(var1.posY * 32.0D); -- this.posZ = MathHelper.floor_double(var1.posZ * 32.0D); -- this.xpValue = var1.getXpValue(); -- } -- -- public void readPacketData(DataInput var1) throws IOException { -- this.entityId = var1.readInt(); -- this.posX = var1.readInt(); -- this.posY = var1.readInt(); -- this.posZ = var1.readInt(); -- this.xpValue = var1.readShort(); -- } -- -- public void writePacketData(DataOutput var1) throws IOException { -- var1.writeInt(this.entityId); -- var1.writeInt(this.posX); -- var1.writeInt(this.posY); -- var1.writeInt(this.posZ); -- var1.writeShort(this.xpValue); -- } -- -- public void processPacket(NetHandler var1) { -- var1.handleEntityExpOrb(this); -- } -- -+ public Packet26EntityExpOrb() {} -+ -+ public Packet26EntityExpOrb(EntityXPOrb par1EntityXPOrb) { -+ this.entityId = par1EntityXPOrb.entityId; -+ this.posX = MathHelper.floor_double(par1EntityXPOrb.posX * 32.0D); -+ this.posY = MathHelper.floor_double(par1EntityXPOrb.posY * 32.0D); -+ this.posZ = MathHelper.floor_double(par1EntityXPOrb.posZ * 32.0D); -+ this.xpValue = par1EntityXPOrb.getXpValue(); -+ } -+ -+ /** -+ * Abstract. Reads the raw packet data from the data stream. -+ */ -+ public void readPacketData(DataInput par1DataInput) throws IOException { -+ this.entityId = par1DataInput.readInt(); -+ this.posX = par1DataInput.readInt(); -+ this.posY = par1DataInput.readInt(); -+ this.posZ = par1DataInput.readInt(); -+ this.xpValue = par1DataInput.readShort(); -+ } -+ -+ /** -+ * Abstract. Writes the raw packet data to the data stream. -+ */ -+ public void writePacketData(DataOutput par1DataOutput) throws IOException { -+ par1DataOutput.writeInt(this.entityId); -+ par1DataOutput.writeInt(this.posX); -+ par1DataOutput.writeInt(this.posY); -+ par1DataOutput.writeInt(this.posZ); -+ par1DataOutput.writeShort(this.xpValue); -+ } -+ -+ /** -+ * Passes this Packet on to the NetHandler for processing. -+ */ -+ public void processPacket(NetHandler par1NetHandler) { -+ par1NetHandler.handleEntityExpOrb(this); -+ } -+ -+ /** -+ * Abstract. Return the size of the packet (not counting the header). -+ */ - public int getPacketSize() { - return 18; - } ---- net/minecraft/src/RConThreadMain.java -+++ net/minecraft/src/RConThreadMain.java -@@ -11,93 +11,111 @@ - import java.util.Map.Entry; - - public class RConThreadMain extends RConThreadBase { -+ -+ /** Port RCon is running on */ - private int rconPort; -+ -+ /** Port the server is running on */ - private int serverPort; -- private String i; -- private ServerSocket j; -- private String k; -- private Map l; -- -- public RConThreadMain(IServer var1) { -- super(var1); -- this.rconPort = var1.getIntProperty("rcon.port", 0); -- this.k = var1.getStringProperty("rcon.password", ""); -- this.i = var1.getHostname(); -- this.serverPort = var1.getPort(); -- if(0 == this.rconPort) { -+ -+ /** Hostname RCon is running on */ -+ private String hostname; -+ -+ /** The RCon ServerSocket. */ -+ private ServerSocket serverSocket; -+ -+ /** The RCon password */ -+ private String rconPassword; -+ -+ /** A map of client addresses to their running Threads */ -+ private Map clientThreads; -+ -+ public RConThreadMain(IServer par1IServer) { -+ super(par1IServer); -+ this.rconPort = par1IServer.getIntProperty("rcon.port", 0); -+ this.rconPassword = par1IServer.getStringProperty("rcon.password", ""); -+ this.hostname = par1IServer.getHostname(); -+ this.serverPort = par1IServer.getPort(); -+ -+ if (0 == this.rconPort) { - this.rconPort = this.serverPort + 10; - this.logInfo("Setting default rcon port to " + this.rconPort); -- var1.setProperty("rcon.port", Integer.valueOf(this.rconPort)); -- if(0 == this.k.length()) { -- var1.setProperty("rcon.password", ""); -+ par1IServer.setProperty("rcon.port", Integer.valueOf(this.rconPort)); -+ -+ if (0 == this.rconPassword.length()) { -+ par1IServer.setProperty("rcon.password", ""); - } - -- var1.saveProperties(); -+ par1IServer.saveProperties(); - } - -- if(0 == this.i.length()) { -- this.i = "0.0.0.0"; -+ if (0 == this.hostname.length()) { -+ this.hostname = "0.0.0.0"; - } - - this.initClientThreadList(); -- this.j = null; -+ this.serverSocket = null; - } - - private void initClientThreadList() { -- this.l = new HashMap(); -+ this.clientThreads = new HashMap(); - } - -+ /** -+ * Cleans up the clientThreads map by removing client Threads that are not running -+ */ - private void cleanClientThreadsMap() { -- Iterator var1 = this.l.entrySet().iterator(); -+ Iterator var1 = this.clientThreads.entrySet().iterator(); - -- while(var1.hasNext()) { -+ while (var1.hasNext()) { - Entry var2 = (Entry)var1.next(); -- if(!((RConThreadClient)var2.getValue()).isRunning()) { -+ -+ if (!((RConThreadClient)var2.getValue()).isRunning()) { - var1.remove(); - } - } -- - } - - public void run() { -- this.logInfo("RCON running on " + this.i + ":" + this.rconPort); -+ this.logInfo("RCON running on " + this.hostname + ":" + this.rconPort); - - try { -- while(this.running) { -+ while (this.running) { - try { -- Socket var1 = this.j.accept(); -+ Socket var1 = this.serverSocket.accept(); - var1.setSoTimeout(500); - RConThreadClient var2 = new RConThreadClient(this.server, var1); - var2.startThread(); -- this.l.put(var1.getRemoteSocketAddress(), var2); -+ this.clientThreads.put(var1.getRemoteSocketAddress(), var2); - this.cleanClientThreadsMap(); - } catch (SocketTimeoutException var7) { - this.cleanClientThreadsMap(); - } catch (IOException var8) { -- if(this.running) { -+ if (this.running) { - this.logInfo("IO: " + var8.getMessage()); - } - } - } - } finally { -- this.closeServerSocket(this.j); -+ this.closeServerSocket(this.serverSocket); - } -- - } - -+ /** -+ * Creates a new Thread object from this class and starts running -+ */ - public void startThread() { -- if(0 == this.k.length()) { -+ if (0 == this.rconPassword.length()) { - this.logWarning("No rcon password set in \'" + this.server.getSettingsFilename() + "\', rcon disabled!"); -- } else if(0 < this.rconPort && '\uffff' >= this.rconPort) { -- if(!this.running) { -+ } else if (0 < this.rconPort && 65535 >= this.rconPort) { -+ if (!this.running) { - try { -- this.j = new ServerSocket(this.rconPort, 0, InetAddress.getByName(this.i)); -- this.j.setSoTimeout(500); -+ this.serverSocket = new ServerSocket(this.rconPort, 0, InetAddress.getByName(this.hostname)); -+ this.serverSocket.setSoTimeout(500); - super.startThread(); - } catch (IOException var2) { -- this.logWarning("Unable to initialise rcon on " + this.i + ":" + this.rconPort + " : " + var2.getMessage()); -+ this.logWarning("Unable to initialise rcon on " + this.hostname + ":" + this.rconPort + " : " + var2.getMessage()); - } -- - } - } else { - this.logWarning("Invalid rcon port " + this.rconPort + " found in \'" + this.server.getSettingsFilename() + "\', rcon disabled!"); ---- /dev/null -+++ com/prupe/mcpatcher/TileLoader.java -@@ -1,0 +1,405 @@ -+package com.prupe.mcpatcher; -+ -+import com.prupe.mcpatcher.TileLoader$1; -+import java.awt.Color; -+import java.awt.Graphics; -+import java.awt.image.BufferedImage; -+import java.io.FileNotFoundException; -+import java.io.IOException; -+import java.util.ArrayList; -+import java.util.Collection; -+import java.util.HashMap; -+import java.util.HashSet; -+import java.util.Iterator; -+import java.util.List; -+import java.util.Map; -+import java.util.Set; -+import net.minecraft.src.Icon; -+import net.minecraft.src.Minecraft; -+import net.minecraft.src.ResourceLocation; -+import net.minecraft.src.Tessellator; -+import net.minecraft.src.TextureAtlasSprite; -+import net.minecraft.src.TextureMap; -+ -+public class TileLoader { -+ private static final MCLogger logger = MCLogger.getLogger("Tilesheet"); -+ private static final List loaders = new ArrayList(); -+ private static final ResourceLocation BLANK_RESOURCE = new ResourceLocation("mcpatcher/blank.png"); -+ private static final boolean debugTextures = Config.getBoolean("Connected Textures", "debugTextures", false); -+ private static final int splitTextures = Config.getInt("Connected Textures", "splitTextures", 1); -+ private static final Map specialTextures = new HashMap(); -+ private static final TexturePackChangeHandler changeHandler; -+ private static boolean changeHandlerCalled; -+ private static boolean registerIconsCalled; -+ private static final Set overflowMaps = new HashSet(); -+ private static final int OVERFLOW_TEXTURE_MAP_INDEX = 2; -+ private static final long MAX_TILESHEET_SIZE; -+ protected final String mapName; -+ protected final boolean allowOverflow; -+ protected final MCLogger subLogger; -+ private int overflowIndex; -+ private TextureMap baseTextureMap; -+ private Map baseTexturesByName; -+ private final Set tilesToRegister = new HashSet(); -+ private final Map tileImages = new HashMap(); -+ private final Map iconMap = new HashMap(); -+ -+ public static void registerIcons(TextureMap textureMap, String mapName, Map map) { -+ logger.fine("before registerIcons(%s) %d icons", new Object[] {mapName, Integer.valueOf(map.size())}); -+ mapName = mapName.replaceFirst("/$", ""); -+ registerIconsCalled = true; -+ -+ if (!changeHandlerCalled) { -+ logger.severe("beforeChange was not called, invoking directly", new Object[0]); -+ changeHandler.beforeChange(); -+ } -+ -+ TessellatorUtils.registerTextureMap(textureMap, mapName); -+ Iterator i$ = loaders.iterator(); -+ -+ while (i$.hasNext()) { -+ TileLoader loader = (TileLoader)i$.next(); -+ -+ if (loader.baseTextureMap == null && mapName.equals(loader.mapName)) { -+ loader.baseTextureMap = textureMap; -+ loader.baseTexturesByName = map; -+ } -+ -+ if (loader.isForThisMap(mapName) && !loader.tilesToRegister.isEmpty()) { -+ loader.subLogger.fine("adding icons to %s (%d remaining)", new Object[] {mapName, Integer.valueOf(loader.tilesToRegister.size()), mapName}); -+ -+ while (!loader.tilesToRegister.isEmpty() && loader.registerOneIcon(textureMap, mapName, map)) { -+ ; -+ } -+ -+ loader.subLogger.fine("done adding icons to %s (%d remaining)", new Object[] {mapName, Integer.valueOf(loader.tilesToRegister.size()), mapName}); -+ } -+ } -+ -+ logger.fine("after registerIcons(%s) %d icons", new Object[] {mapName, Integer.valueOf(map.size())}); -+ } -+ -+ public static String getOverridePath(String prefix, String name, String ext) { -+ String path; -+ -+ if (name.endsWith(".png")) { -+ path = name.replaceFirst("\\.[^.]+$", "") + ext; -+ } else { -+ path = prefix; -+ -+ if (!prefix.endsWith("/")) { -+ path = prefix + "/"; -+ } -+ -+ path = path + name; -+ path = path + ext; -+ } -+ -+ logger.finer("getOverridePath(%s, %s, %s) -> %s", new Object[] {prefix, name, ext, path}); -+ return path; -+ } -+ -+ public static boolean isSpecialTexture(TextureMap map, String texture, String special) { -+ return special.equals(texture) || special.equals(specialTextures.get(texture)); -+ } -+ -+ public static BufferedImage getOverrideImage(ResourceLocation resource) throws IOException { -+ Iterator i$ = loaders.iterator(); -+ BufferedImage image; -+ -+ do { -+ if (!i$.hasNext()) { -+ image = TexturePackAPI.getImage(resource); -+ -+ if (image == null) { -+ throw new FileNotFoundException(resource + " not found"); -+ } -+ -+ return image; -+ } -+ -+ TileLoader loader = (TileLoader)i$.next(); -+ image = (BufferedImage)loader.tileImages.get(resource); -+ } while (image == null); -+ -+ return image; -+ } -+ -+ public static void updateAnimations() { -+ Iterator i$ = overflowMaps.iterator(); -+ -+ while (i$.hasNext()) { -+ TextureMap textureMap = (TextureMap)i$.next(); -+ textureMap.updateAnimations(); -+ } -+ } -+ -+ public static BufferedImage generateDebugTexture(String text, int width, int height, boolean alternate) { -+ BufferedImage image = new BufferedImage(width, height, 2); -+ Graphics graphics = image.getGraphics(); -+ graphics.setColor(alternate ? new Color(0, 255, 255, 128) : Color.WHITE); -+ graphics.fillRect(0, 0, width, height); -+ graphics.setColor(alternate ? Color.RED : Color.BLACK); -+ int ypos = 10; -+ -+ if (alternate) { -+ ypos += height / 2; -+ } -+ -+ int charsPerRow = width / 8; -+ -+ if (charsPerRow <= 0) { -+ return image; -+ } else { -+ while (text.length() % charsPerRow != 0) { -+ text = text + " "; -+ } -+ -+ while (ypos < height && !text.equals("")) { -+ graphics.drawString(text.substring(0, charsPerRow), 1, ypos); -+ ypos += graphics.getFont().getSize(); -+ text = text.substring(charsPerRow); -+ } -+ -+ return image; -+ } -+ } -+ -+ static void init() {} -+ -+ public static ResourceLocation getBlocksAtlas() { -+ return TextureMap.locationBlocksTexture; -+ } -+ -+ public static ResourceLocation getItemsAtlas() { -+ return TextureMap.locationItemsTexture; -+ } -+ -+ public TileLoader(String mapName, boolean allowOverflow, MCLogger logger) { -+ this.mapName = mapName; -+ this.allowOverflow = allowOverflow; -+ this.subLogger = logger; -+ loaders.add(this); -+ } -+ -+ private static long getTextureSize(TextureAtlasSprite texture) { -+ return texture == null ? 0L : (long)(4 * texture.getIconWidth() * texture.getIconHeight()); -+ } -+ -+ private static long getTextureSize(Collection textures) { -+ long size = 0L; -+ TextureAtlasSprite texture; -+ -+ for (Iterator i$ = textures.iterator(); i$.hasNext(); size += getTextureSize(texture)) { -+ texture = (TextureAtlasSprite)i$.next(); -+ } -+ -+ return size; -+ } -+ -+ public static ResourceLocation getDefaultAddress(ResourceLocation propertiesAddress) { -+ return TexturePackAPI.transformResourceLocation(propertiesAddress, ".properties", ".png"); -+ } -+ -+ public static ResourceLocation parseTileAddress(ResourceLocation propertiesAddress, String value) { -+ if (value == null) { -+ return null; -+ } else if (value.equals("blank")) { -+ return BLANK_RESOURCE; -+ } else if (!value.equals("null") && !value.equals("none") && !value.equals("default") && !value.equals("")) { -+ if (!value.endsWith(".png")) { -+ value = value + ".png"; -+ } -+ -+ return TexturePackAPI.parseResourceLocation(propertiesAddress, value); -+ } else { -+ return null; -+ } -+ } -+ -+ public boolean preloadTile(ResourceLocation resource, boolean alternate, String special) { -+ if (this.tileImages.containsKey(resource)) { -+ return true; -+ } else { -+ BufferedImage image = null; -+ -+ if (!debugTextures) { -+ image = TexturePackAPI.getImage(resource); -+ -+ if (image == null) { -+ this.subLogger.warning("missing %s", new Object[] {resource}); -+ } -+ } -+ -+ if (image == null) { -+ image = generateDebugTexture(resource.getResourcePath(), 64, 64, alternate); -+ } -+ -+ this.tilesToRegister.add(resource); -+ this.tileImages.put(resource, image); -+ -+ if (special != null) { -+ specialTextures.put(resource.toString(), special); -+ } -+ -+ return true; -+ } -+ } -+ -+ public boolean preloadTile(ResourceLocation resource, boolean alternate) { -+ return this.preloadTile(resource, alternate, (String)null); -+ } -+ -+ protected boolean isForThisMap(String mapName) { -+ return this.allowOverflow && splitTextures > 1 ? mapName.startsWith(this.mapName + "_overflow") : mapName.startsWith(this.mapName); -+ } -+ -+ private boolean registerDefaultIcon(String name) { -+ if (name.startsWith(this.mapName) && name.endsWith(".png") && this.baseTextureMap != null) { -+ String defaultName = name.substring(this.mapName.length()).replaceFirst("\\.png$", ""); -+ TextureAtlasSprite texture = (TextureAtlasSprite)this.baseTexturesByName.get(defaultName); -+ -+ if (texture != null) { -+ this.subLogger.finer("%s -> existing icon %s", new Object[] {name, defaultName}); -+ this.iconMap.put(name, texture); -+ return true; -+ } -+ } -+ -+ return false; -+ } -+ -+ private boolean registerOneIcon(TextureMap textureMap, String mapName, Map map) { -+ ResourceLocation resource = (ResourceLocation)this.tilesToRegister.iterator().next(); -+ String name = resource.toString(); -+ -+ if (this.registerDefaultIcon(name)) { -+ this.tilesToRegister.remove(resource); -+ return true; -+ } else { -+ BufferedImage image = (BufferedImage)this.tileImages.get(resource); -+ -+ if (image == null) { -+ this.subLogger.error("tile for %s unexpectedly missing", new Object[] {resource}); -+ this.tilesToRegister.remove(resource); -+ return true; -+ } else { -+ int width = image.getWidth(); -+ int height = image.getHeight(); -+ long currentSize = getTextureSize(map.values()); -+ long newSize = (long)(4 * width * width); -+ -+ if (newSize + currentSize > MAX_TILESHEET_SIZE) { -+ float icon1 = (float)currentSize / 1048576.0F; -+ -+ if (currentSize <= 0L) { -+ this.subLogger.error("%s too big for any tilesheet (%.1fMB), dropping", new Object[] {name, Float.valueOf(icon1)}); -+ this.tilesToRegister.remove(resource); -+ return true; -+ } else { -+ this.subLogger.warning("%s nearly full (%.1fMB), will start a new tilesheet", new Object[] {mapName, Float.valueOf(icon1)}); -+ return false; -+ } -+ } else { -+ Icon icon = textureMap.registerIcon(name); -+ map.put(name, (TextureAtlasSprite)icon); -+ -+ if (mapName.contains("_overflow")) { -+ TessellatorUtils.registerIcon(textureMap, icon); -+ } -+ -+ this.iconMap.put(name, icon); -+ String extra = width == height ? "" : ", " + height / width + " frames"; -+ this.subLogger.finer("%s -> %s icon %dx%d%s", new Object[] {name, mapName, Integer.valueOf(width), Integer.valueOf(width), extra}); -+ this.tilesToRegister.remove(resource); -+ return true; -+ } -+ } -+ } -+ } -+ -+ public void finish() { -+ this.tilesToRegister.clear(); -+ this.tileImages.clear(); -+ } -+ -+ public Icon getIcon(String name) { -+ if (name != null && !name.equals("")) { -+ Icon icon = (Icon)this.iconMap.get(name); -+ -+ if (icon == null && this.baseTexturesByName != null) { -+ icon = (Icon)this.baseTexturesByName.get(name); -+ } -+ -+ return icon; -+ } else { -+ return null; -+ } -+ } -+ -+ public Icon getIcon(ResourceLocation resource) { -+ return resource == null ? null : this.getIcon(resource.toString()); -+ } -+ -+ public boolean setDefaultTextureMap(Tessellator tessellator) { -+ tessellator.textureMap = this.baseTextureMap; -+ return this.baseTextureMap != null; -+ } -+ -+ static boolean access$002(boolean x0) { -+ changeHandlerCalled = x0; -+ return x0; -+ } -+ -+ static Set access$100() { -+ return overflowMaps; -+ } -+ -+ static List access$200() { -+ return loaders; -+ } -+ -+ static Map access$300() { -+ return specialTextures; -+ } -+ -+ static Set access$400(TileLoader x0) { -+ return x0.tilesToRegister; -+ } -+ -+ static int access$500() { -+ return splitTextures; -+ } -+ -+ static boolean access$602(boolean x0) { -+ registerIconsCalled = x0; -+ return x0; -+ } -+ -+ static int access$704(TileLoader x0) { -+ return ++x0.overflowIndex; -+ } -+ -+ static MCLogger access$800() { -+ return logger; -+ } -+ -+ static boolean access$600() { -+ return registerIconsCalled; -+ } -+ -+ static { -+ long maxSize = 4096L; -+ -+ try { -+ maxSize = (long)Minecraft.getGLMaximumTextureSize(); -+ } catch (Throwable var3) { -+ var3.printStackTrace(); -+ } -+ -+ MAX_TILESHEET_SIZE = maxSize * maxSize * 4L * 7L / 8L; -+ logger.config("max texture size is %dx%d (%.1fMB)", new Object[] {Long.valueOf(maxSize), Long.valueOf(maxSize), Float.valueOf((float)MAX_TILESHEET_SIZE / 1048576.0F)}); -+ changeHandler = new TileLoader$1("Tilesheet API", 2); -+ TexturePackChangeHandler.register(changeHandler); -+ } -+} ---- net/minecraft/src/MathHelper.java -+++ net/minecraft/src/MathHelper.java -@@ -3,192 +3,254 @@ - import java.util.Random; - - public class MathHelper { -+ -+ /** -+ * A table of sin values computed from 0 (inclusive) to 2*pi (exclusive), with steps of 2*PI / 65536. -+ */ - private static float[] SIN_TABLE = new float[65536]; - -- public static final float sin(float var0) { -- return SIN_TABLE[(int)(var0 * 10430.378F) & '\uffff']; -- } -- -- public static final float cos(float var0) { -- return SIN_TABLE[(int)(var0 * 10430.378F + 16384.0F) & '\uffff']; -- } -- -- public static final float sqrt_float(float var0) { -- return (float)Math.sqrt((double)var0); -- } -- -- public static final float sqrt_double(double var0) { -- return (float)Math.sqrt(var0); -- } -- -- public static int floor_float(float var0) { -- int var1 = (int)var0; -- return var0 < (float)var1 ? var1 - 1 : var1; -- } -- -- public static int truncateDoubleToInt(double var0) { -- return (int)(var0 + 1024.0D) - 1024; -- } -- -- public static int floor_double(double var0) { -- int var2 = (int)var0; -- return var0 < (double)var2 ? var2 - 1 : var2; -- } -- -- public static long floor_double_long(double var0) { -- long var2 = (long)var0; -- return var0 < (double)var2 ? var2 - 1L : var2; -- } -- -- public static float abs(float var0) { -- return var0 >= 0.0F ? var0 : -var0; -- } -- -- public static int abs_int(int var0) { -- return var0 >= 0 ? var0 : -var0; -- } -- -- public static int ceiling_float_int(float var0) { -- int var1 = (int)var0; -- return var0 > (float)var1 ? var1 + 1 : var1; -- } -- -- public static int ceiling_double_int(double var0) { -- int var2 = (int)var0; -- return var0 > (double)var2 ? var2 + 1 : var2; -- } -- -- public static int clamp_int(int var0, int var1, int var2) { -- return var0 < var1 ? var1 : (var0 > var2 ? var2 : var0); -- } -- -- public static float clamp_float(float var0, float var1, float var2) { -- return var0 < var1 ? var1 : (var0 > var2 ? var2 : var0); -- } -- -- public static double abs_max(double var0, double var2) { -- if(var0 < 0.0D) { -- var0 = -var0; -- } -- -- if(var2 < 0.0D) { -- var2 = -var2; -- } -- -- return var0 > var2 ? var0 : var2; -- } -- -- public static int bucketInt(int var0, int var1) { -- return var0 < 0 ? -((-var0 - 1) / var1) - 1 : var0 / var1; -- } -- -- public static boolean stringNullOrLengthZero(String var0) { -- return var0 == null || var0.length() == 0; -- } -- -- public static int getRandomIntegerInRange(Random var0, int var1, int var2) { -- return var1 >= var2 ? var1 : var0.nextInt(var2 - var1 + 1) + var1; -- } -- -- public static double getRandomDoubleInRange(Random var0, double var1, double var3) { -- return var1 >= var3 ? var1 : var0.nextDouble() * (var3 - var1) + var1; -- } -- -- public static double average(long[] var0) { -+ /** -+ * sin looked up in a table -+ */ -+ public static final float sin(float par0) { -+ return SIN_TABLE[(int)(par0 * 10430.378F) & 65535]; -+ } -+ -+ /** -+ * cos looked up in the sin table with the appropriate offset -+ */ -+ public static final float cos(float par0) { -+ return SIN_TABLE[(int)(par0 * 10430.378F + 16384.0F) & 65535]; -+ } -+ -+ public static final float sqrt_float(float par0) { -+ return (float)Math.sqrt((double)par0); -+ } -+ -+ public static final float sqrt_double(double par0) { -+ return (float)Math.sqrt(par0); -+ } -+ -+ /** -+ * Returns the greatest integer less than or equal to the float argument -+ */ -+ public static int floor_float(float par0) { -+ int var1 = (int)par0; -+ return par0 < (float)var1 ? var1 - 1 : var1; -+ } -+ -+ /** -+ * returns par0 cast as an int, and no greater than Integer.MAX_VALUE-1024 -+ */ -+ public static int truncateDoubleToInt(double par0) { -+ return (int)(par0 + 1024.0D) - 1024; -+ } -+ -+ /** -+ * Returns the greatest integer less than or equal to the double argument -+ */ -+ public static int floor_double(double par0) { -+ int var2 = (int)par0; -+ return par0 < (double)var2 ? var2 - 1 : var2; -+ } -+ -+ /** -+ * Long version of floor_double -+ */ -+ public static long floor_double_long(double par0) { -+ long var2 = (long)par0; -+ return par0 < (double)var2 ? var2 - 1L : var2; -+ } -+ -+ public static float abs(float par0) { -+ return par0 >= 0.0F ? par0 : -par0; -+ } -+ -+ /** -+ * Returns the unsigned value of an int. -+ */ -+ public static int abs_int(int par0) { -+ return par0 >= 0 ? par0 : -par0; -+ } -+ -+ public static int ceiling_float_int(float par0) { -+ int var1 = (int)par0; -+ return par0 > (float)var1 ? var1 + 1 : var1; -+ } -+ -+ public static int ceiling_double_int(double par0) { -+ int var2 = (int)par0; -+ return par0 > (double)var2 ? var2 + 1 : var2; -+ } -+ -+ /** -+ * Returns the value of the first parameter, clamped to be within the lower and upper limits given by the second and -+ * third parameters. -+ */ -+ public static int clamp_int(int par0, int par1, int par2) { -+ return par0 < par1 ? par1 : (par0 > par2 ? par2 : par0); -+ } -+ -+ /** -+ * Returns the value of the first parameter, clamped to be within the lower and upper limits given by the second and -+ * third parameters -+ */ -+ public static float clamp_float(float par0, float par1, float par2) { -+ return par0 < par1 ? par1 : (par0 > par2 ? par2 : par0); -+ } -+ -+ /** -+ * Maximum of the absolute value of two numbers. -+ */ -+ public static double abs_max(double par0, double par2) { -+ if (par0 < 0.0D) { -+ par0 = -par0; -+ } -+ -+ if (par2 < 0.0D) { -+ par2 = -par2; -+ } -+ -+ return par0 > par2 ? par0 : par2; -+ } -+ -+ /** -+ * Buckets an integer with specifed bucket sizes. Args: i, bucketSize -+ */ -+ public static int bucketInt(int par0, int par1) { -+ return par0 < 0 ? -((-par0 - 1) / par1) - 1 : par0 / par1; -+ } -+ -+ /** -+ * Tests if a string is null or of length zero -+ */ -+ public static boolean stringNullOrLengthZero(String par0Str) { -+ return par0Str == null || par0Str.length() == 0; -+ } -+ -+ public static int getRandomIntegerInRange(Random par0Random, int par1, int par2) { -+ return par1 >= par2 ? par1 : par0Random.nextInt(par2 - par1 + 1) + par1; -+ } -+ -+ public static double getRandomDoubleInRange(Random par0Random, double par1, double par3) { -+ return par1 >= par3 ? par1 : par0Random.nextDouble() * (par3 - par1) + par1; -+ } -+ -+ public static double average(long[] par0ArrayOfLong) { - long var1 = 0L; -- long[] var3 = var0; -- int var4 = var0.length; -+ long[] var3 = par0ArrayOfLong; -+ int var4 = par0ArrayOfLong.length; - -- for(int var5 = 0; var5 < var4; ++var5) { -+ for (int var5 = 0; var5 < var4; ++var5) { - long var6 = var3[var5]; - var1 += var6; - } - -- return (double)var1 / (double)var0.length; -- } -- -- public static float wrapAngleTo180_float(float var0) { -- var0 %= 360.0F; -- if(var0 >= 180.0F) { -- var0 -= 360.0F; -- } -- -- if(var0 < -180.0F) { -- var0 += 360.0F; -- } -- -- return var0; -- } -- -- public static double wrapAngleTo180_double(double var0) { -- var0 %= 360.0D; -- if(var0 >= 180.0D) { -- var0 -= 360.0D; -- } -- -- if(var0 < -180.0D) { -- var0 += 360.0D; -- } -- -- return var0; -- } -- -- public static int parseIntWithDefault(String var0, int var1) { -- int var2 = var1; -+ return (double)var1 / (double)par0ArrayOfLong.length; -+ } -+ -+ /** -+ * the angle is reduced to an angle between -180 and +180 by mod, and a 360 check -+ */ -+ public static float wrapAngleTo180_float(float par0) { -+ par0 %= 360.0F; -+ -+ if (par0 >= 180.0F) { -+ par0 -= 360.0F; -+ } -+ -+ if (par0 < -180.0F) { -+ par0 += 360.0F; -+ } -+ -+ return par0; -+ } -+ -+ /** -+ * the angle is reduced to an angle between -180 and +180 by mod, and a 360 check -+ */ -+ public static double wrapAngleTo180_double(double par0) { -+ par0 %= 360.0D; -+ -+ if (par0 >= 180.0D) { -+ par0 -= 360.0D; -+ } -+ -+ if (par0 < -180.0D) { -+ par0 += 360.0D; -+ } -+ -+ return par0; -+ } -+ -+ /** -+ * parses the string as integer or returns the second parameter if it fails -+ */ -+ public static int parseIntWithDefault(String par0Str, int par1) { -+ int var2 = par1; - - try { -- var2 = Integer.parseInt(var0); -+ var2 = Integer.parseInt(par0Str); - } catch (Throwable var4) { -+ ; - } - - return var2; - } - -- public static int parseIntWithDefaultAndMax(String var0, int var1, int var2) { -- int var3 = var1; -+ /** -+ * parses the string as integer or returns the second parameter if it fails. this value is capped to par2 -+ */ -+ public static int parseIntWithDefaultAndMax(String par0Str, int par1, int par2) { -+ int var3 = par1; - - try { -- var3 = Integer.parseInt(var0); -+ var3 = Integer.parseInt(par0Str); - } catch (Throwable var5) { -+ ; - } - -- if(var3 < var2) { -- var3 = var2; -+ if (var3 < par2) { -+ var3 = par2; - } - - return var3; - } - -- public static double parseDoubleWithDefault(String var0, double var1) { -- double var3 = var1; -+ /** -+ * parses the string as double or returns the second parameter if it fails. -+ */ -+ public static double parseDoubleWithDefault(String par0Str, double par1) { -+ double var3 = par1; - - try { -- var3 = Double.parseDouble(var0); -+ var3 = Double.parseDouble(par0Str); - } catch (Throwable var6) { -+ ; - } - - return var3; - } - -- public static double func_82713_a(String var0, double var1, double var3) { -- double var5 = var1; -+ public static double func_82713_a(String par0Str, double par1, double par3) { -+ double var5 = par1; - - try { -- var5 = Double.parseDouble(var0); -+ var5 = Double.parseDouble(par0Str); - } catch (Throwable var8) { -+ ; - } - -- if(var5 < var3) { -- var5 = var3; -+ if (var5 < par3) { -+ var5 = par3; - } - - return var5; - } - - static { -- for(int var0 = 0; var0 < 65536; ++var0) { -+ for (int var0 = 0; var0 < 65536; ++var0) { - SIN_TABLE[var0] = (float)Math.sin((double)var0 * Math.PI * 2.0D / 65536.0D); - } -- - } - } ---- net/minecraft/src/IEnchantmentModifier.java -+++ net/minecraft/src/IEnchantmentModifier.java -@@ -1,5 +1,9 @@ - package net.minecraft.src; - - interface IEnchantmentModifier { -+ -+ /** -+ * Generic method use to calculate modifiers of offensive or defensive enchantment values. -+ */ - void calculateModifier(Enchantment var1, int var2); - } ---- net/minecraft/src/ComparatorClassSorter.java -+++ net/minecraft/src/ComparatorClassSorter.java -@@ -5,17 +5,17 @@ - class ComparatorClassSorter implements Comparator { - final CallableSuspiciousClasses theSuspiciousClasses; - -- ComparatorClassSorter(CallableSuspiciousClasses var1) { -- this.theSuspiciousClasses = var1; -+ ComparatorClassSorter(CallableSuspiciousClasses par1CallableSuspiciousClasses) { -+ this.theSuspiciousClasses = par1CallableSuspiciousClasses; - } - -- public int func_85081_a(Class var1, Class var2) { -- String var3 = var1.getPackage() == null ? "" : var1.getPackage().getName(); -- String var4 = var2.getPackage() == null ? "" : var2.getPackage().getName(); -+ public int func_85081_a(Class par1Class, Class par2Class) { -+ String var3 = par1Class.getPackage() == null ? "" : par1Class.getPackage().getName(); -+ String var4 = par2Class.getPackage() == null ? "" : par2Class.getPackage().getName(); - return var3.compareTo(var4); - } - -- public int compare(Object var1, Object var2) { -- return this.func_85081_a((Class)var1, (Class)var2); -+ public int compare(Object par1Obj, Object par2Obj) { -+ return this.func_85081_a((Class)par1Obj, (Class)par2Obj); - } - } ---- net/minecraft/src/EntityFireworkStarterFX.java -+++ net/minecraft/src/EntityFireworkStarterFX.java -@@ -6,23 +6,26 @@ - private NBTTagList fireworkExplosions; - boolean twinkle; - -- public EntityFireworkStarterFX(World var1, double var2, double var4, double var6, double var8, double var10, double var12, EffectRenderer var14, NBTTagCompound var15) { -- super(var1, var2, var4, var6, 0.0D, 0.0D, 0.0D); -- this.motionX = var8; -- this.motionY = var10; -- this.motionZ = var12; -- this.theEffectRenderer = var14; -+ public EntityFireworkStarterFX(World par1World, double par2, double par4, double par6, double par8, double par10, double par12, EffectRenderer par14EffectRenderer, NBTTagCompound par15NBTTagCompound) { -+ super(par1World, par2, par4, par6, 0.0D, 0.0D, 0.0D); -+ this.motionX = par8; -+ this.motionY = par10; -+ this.motionZ = par12; -+ this.theEffectRenderer = par14EffectRenderer; - this.particleMaxAge = 8; -- if(var15 != null) { -- this.fireworkExplosions = var15.getTagList("Explosions"); -- if(this.fireworkExplosions.tagCount() == 0) { -+ -+ if (par15NBTTagCompound != null) { -+ this.fireworkExplosions = par15NBTTagCompound.getTagList("Explosions"); -+ -+ if (this.fireworkExplosions.tagCount() == 0) { - this.fireworkExplosions = null; - } else { - this.particleMaxAge = this.fireworkExplosions.tagCount() * 2 - 1; - -- for(int var16 = 0; var16 < this.fireworkExplosions.tagCount(); ++var16) { -+ for (int var16 = 0; var16 < this.fireworkExplosions.tagCount(); ++var16) { - NBTTagCompound var17 = (NBTTagCompound)this.fireworkExplosions.tagAt(var16); -- if(var17.getBoolean("Flicker")) { -+ -+ if (var17.getBoolean("Flicker")) { - this.twinkle = true; - this.particleMaxAge += 15; - break; -@@ -30,23 +33,27 @@ - } - } - } -- -- } -- -- public void renderParticle(Tessellator var1, float var2, float var3, float var4, float var5, float var6, float var7) { -- } -- -+ } -+ -+ public void renderParticle(Tessellator par1Tessellator, float par2, float par3, float par4, float par5, float par6, float par7) {} -+ -+ /** -+ * Called to update the entity's position/logic. -+ */ - public void onUpdate() { - boolean var1; -- if(this.fireworkAge == 0 && this.fireworkExplosions != null) { -+ -+ if (this.fireworkAge == 0 && this.fireworkExplosions != null) { - var1 = this.func_92037_i(); - boolean var2 = false; -- if(this.fireworkExplosions.tagCount() >= 3) { -+ -+ if (this.fireworkExplosions.tagCount() >= 3) { - var2 = true; - } else { -- for(int var3 = 0; var3 < this.fireworkExplosions.tagCount(); ++var3) { -+ for (int var3 = 0; var3 < this.fireworkExplosions.tagCount(); ++var3) { - NBTTagCompound var4 = (NBTTagCompound)this.fireworkExplosions.tagAt(var3); -- if(var4.getByte("Type") == 1) { -+ -+ if (var4.getByte("Type") == 1) { - var2 = true; - break; - } -@@ -54,10 +61,10 @@ - } - - String var15 = "fireworks." + (var2 ? "largeBlast" : "blast") + (var1 ? "_far" : ""); -- this.worldObj.playSound(this.posX, this.posY, this.posZ, var15, 20.0F, 0.95F + this.ab.nextFloat() * 0.1F, true); -+ this.worldObj.playSound(this.posX, this.posY, this.posZ, var15, 20.0F, 0.95F + this.rand.nextFloat() * 0.1F, true); - } - -- if(this.fireworkAge % 2 == 0 && this.fireworkExplosions != null && this.fireworkAge / 2 < this.fireworkExplosions.tagCount()) { -+ if (this.fireworkAge % 2 == 0 && this.fireworkExplosions != null && this.fireworkAge / 2 < this.fireworkExplosions.tagCount()) { - int var13 = this.fireworkAge / 2; - NBTTagCompound var14 = (NBTTagCompound)this.fireworkExplosions.tagAt(var13); - byte var17 = var14.getByte("Type"); -@@ -65,13 +72,14 @@ - boolean var5 = var14.getBoolean("Flicker"); - int[] var6 = var14.getIntArray("Colors"); - int[] var7 = var14.getIntArray("FadeColors"); -- if(var17 == 1) { -+ -+ if (var17 == 1) { - this.createBall(0.5D, 4, var6, var7, var18, var5); -- } else if(var17 == 2) { -- this.createShaped(0.5D, new double[][]{{0.0D, 1.0D}, {0.3455D, 0.309D}, {0.9511D, 0.309D}, {0.3795918367346939D, -0.12653061224489795D}, {0.6122448979591837D, -0.8040816326530612D}, {0.0D, -0.35918367346938773D}}, var6, var7, var18, var5, false); -- } else if(var17 == 3) { -- this.createShaped(0.5D, new double[][]{{0.0D, 0.2D}, {0.2D, 0.2D}, {0.2D, 0.6D}, {0.6D, 0.6D}, {0.6D, 0.2D}, {0.2D, 0.2D}, {0.2D, 0.0D}, {0.4D, 0.0D}, {0.4D, -0.6D}, {0.2D, -0.6D}, {0.2D, -0.4D}, {0.0D, -0.4D}}, var6, var7, var18, var5, true); -- } else if(var17 == 4) { -+ } else if (var17 == 2) { -+ this.createShaped(0.5D, new double[][] {{0.0D, 1.0D}, {0.3455D, 0.309D}, {0.9511D, 0.309D}, {0.3795918367346939D, -0.12653061224489795D}, {0.6122448979591837D, -0.8040816326530612D}, {0.0D, -0.35918367346938773D}}, var6, var7, var18, var5, false); -+ } else if (var17 == 3) { -+ this.createShaped(0.5D, new double[][] {{0.0D, 0.2D}, {0.2D, 0.2D}, {0.2D, 0.6D}, {0.6D, 0.6D}, {0.6D, 0.2D}, {0.2D, 0.2D}, {0.2D, 0.0D}, {0.4D, 0.0D}, {0.4D, -0.6D}, {0.2D, -0.6D}, {0.2D, -0.4D}, {0.0D, -0.4D}}, var6, var7, var18, var5, true); -+ } else if (var17 == 4) { - this.createBurst(var6, var7, var18, var5); - } else { - this.createBall(0.25D, 2, var6, var7, var18, var5); -@@ -79,7 +87,7 @@ - - int var8 = var6[0]; - float var9 = (float)((var8 & 16711680) >> 16) / 255.0F; -- float var10 = (float)((var8 & '\uff00') >> 8) / 255.0F; -+ float var10 = (float)((var8 & 65280) >> 8) / 255.0F; - float var11 = (float)((var8 & 255) >> 0) / 255.0F; - EntityFireworkOverlayFX var12 = new EntityFireworkOverlayFX(this.worldObj, this.posX, this.posY, this.posZ); - var12.setRBGColorF(var9, var10, var11); -@@ -87,16 +95,16 @@ - } - - ++this.fireworkAge; -- if(this.fireworkAge > this.particleMaxAge) { -- if(this.twinkle) { -+ -+ if (this.fireworkAge > this.particleMaxAge) { -+ if (this.twinkle) { - var1 = this.func_92037_i(); - String var16 = "fireworks." + (var1 ? "twinkle_far" : "twinkle"); -- this.worldObj.playSound(this.posX, this.posY, this.posZ, var16, 20.0F, 0.9F + this.ab.nextFloat() * 0.15F, true); -+ this.worldObj.playSound(this.posX, this.posY, this.posZ, var16, 20.0F, 0.9F + this.rand.nextFloat() * 0.15F, true); - } - - this.setDead(); - } -- - } - - private boolean func_92037_i() { -@@ -104,65 +112,78 @@ - return var1 == null || var1.renderViewEntity == null || var1.renderViewEntity.getDistanceSq(this.posX, this.posY, this.posZ) >= 256.0D; - } - -- private void createParticle(double var1, double var3, double var5, double var7, double var9, double var11, int[] var13, int[] var14, boolean var15, boolean var16) { -- EntityFireworkSparkFX var17 = new EntityFireworkSparkFX(this.worldObj, var1, var3, var5, var7, var9, var11, this.theEffectRenderer); -- var17.setTrail(var15); -- var17.setTwinkle(var16); -- int var18 = this.ab.nextInt(var13.length); -- var17.setColour(var13[var18]); -- if(var14 != null && var14.length > 0) { -- var17.setFadeColour(var14[this.ab.nextInt(var14.length)]); -+ /** -+ * Creates a single particle. Args: x, y, z, x velocity, y velocity, z velocity, colours, fade colours, whether to -+ * trail, whether to twinkle -+ */ -+ private void createParticle(double par1, double par3, double par5, double par7, double par9, double par11, int[] par13ArrayOfInteger, int[] par14ArrayOfInteger, boolean par15, boolean par16) { -+ EntityFireworkSparkFX var17 = new EntityFireworkSparkFX(this.worldObj, par1, par3, par5, par7, par9, par11, this.theEffectRenderer); -+ var17.setTrail(par15); -+ var17.setTwinkle(par16); -+ int var18 = this.rand.nextInt(par13ArrayOfInteger.length); -+ var17.setColour(par13ArrayOfInteger[var18]); -+ -+ if (par14ArrayOfInteger != null && par14ArrayOfInteger.length > 0) { -+ var17.setFadeColour(par14ArrayOfInteger[this.rand.nextInt(par14ArrayOfInteger.length)]); - } - - this.theEffectRenderer.addEffect(var17); - } - -- private void createBall(double var1, int var3, int[] var4, int[] var5, boolean var6, boolean var7) { -+ /** -+ * Creates a small ball or large ball type explosion. Args: particle speed, size, colours, fade colours, whether to -+ * trail, whether to flicker -+ */ -+ private void createBall(double par1, int par3, int[] par4ArrayOfInteger, int[] par5ArrayOfInteger, boolean par6, boolean par7) { - double var8 = this.posX; - double var10 = this.posY; - double var12 = this.posZ; - -- for(int var14 = -var3; var14 <= var3; ++var14) { -- for(int var15 = -var3; var15 <= var3; ++var15) { -- for(int var16 = -var3; var16 <= var3; ++var16) { -- double var17 = (double)var15 + (this.ab.nextDouble() - this.ab.nextDouble()) * 0.5D; -- double var19 = (double)var14 + (this.ab.nextDouble() - this.ab.nextDouble()) * 0.5D; -- double var21 = (double)var16 + (this.ab.nextDouble() - this.ab.nextDouble()) * 0.5D; -- double var23 = (double)MathHelper.sqrt_double(var17 * var17 + var19 * var19 + var21 * var21) / var1 + this.ab.nextGaussian() * 0.05D; -- this.createParticle(var8, var10, var12, var17 / var23, var19 / var23, var21 / var23, var4, var5, var6, var7); -- if(var14 != -var3 && var14 != var3 && var15 != -var3 && var15 != var3) { -- var16 += var3 * 2 - 1; -+ for (int var14 = -par3; var14 <= par3; ++var14) { -+ for (int var15 = -par3; var15 <= par3; ++var15) { -+ for (int var16 = -par3; var16 <= par3; ++var16) { -+ double var17 = (double)var15 + (this.rand.nextDouble() - this.rand.nextDouble()) * 0.5D; -+ double var19 = (double)var14 + (this.rand.nextDouble() - this.rand.nextDouble()) * 0.5D; -+ double var21 = (double)var16 + (this.rand.nextDouble() - this.rand.nextDouble()) * 0.5D; -+ double var23 = (double)MathHelper.sqrt_double(var17 * var17 + var19 * var19 + var21 * var21) / par1 + this.rand.nextGaussian() * 0.05D; -+ this.createParticle(var8, var10, var12, var17 / var23, var19 / var23, var21 / var23, par4ArrayOfInteger, par5ArrayOfInteger, par6, par7); -+ -+ if (var14 != -par3 && var14 != par3 && var15 != -par3 && var15 != par3) { -+ var16 += par3 * 2 - 1; - } - } - } - } -- - } - -- private void createShaped(double var1, double[][] var3, int[] var4, int[] var5, boolean var6, boolean var7, boolean var8) { -- double var9 = var3[0][0]; -- double var11 = var3[0][1]; -- this.createParticle(this.posX, this.posY, this.posZ, var9 * var1, var11 * var1, 0.0D, var4, var5, var6, var7); -- float var13 = this.ab.nextFloat() * (float)Math.PI; -- double var14 = var8 ? 0.034D : 0.34D; -+ /** -+ * Creates a creeper-shaped or star-shaped explosion. Args: particle speed, shape, colours, fade colours, whether to -+ * trail, whether to flicker, unknown -+ */ -+ private void createShaped(double par1, double[][] par3ArrayOfDouble, int[] par4ArrayOfInteger, int[] par5ArrayOfInteger, boolean par6, boolean par7, boolean par8) { -+ double var9 = par3ArrayOfDouble[0][0]; -+ double var11 = par3ArrayOfDouble[0][1]; -+ this.createParticle(this.posX, this.posY, this.posZ, var9 * par1, var11 * par1, 0.0D, par4ArrayOfInteger, par5ArrayOfInteger, par6, par7); -+ float var13 = this.rand.nextFloat() * (float)Math.PI; -+ double var14 = par8 ? 0.034D : 0.34D; - -- for(int var16 = 0; var16 < 3; ++var16) { -+ for (int var16 = 0; var16 < 3; ++var16) { - double var17 = (double)var13 + (double)((float)var16 * (float)Math.PI) * var14; - double var19 = var9; - double var21 = var11; - -- for(int var23 = 1; var23 < var3.length; ++var23) { -- double var24 = var3[var23][0]; -- double var26 = var3[var23][1]; -+ for (int var23 = 1; var23 < par3ArrayOfDouble.length; ++var23) { -+ double var24 = par3ArrayOfDouble[var23][0]; -+ double var26 = par3ArrayOfDouble[var23][1]; - -- for(double var28 = 0.25D; var28 <= 1.0D; var28 += 0.25D) { -- double var30 = (var19 + (var24 - var19) * var28) * var1; -- double var32 = (var21 + (var26 - var21) * var28) * var1; -+ for (double var28 = 0.25D; var28 <= 1.0D; var28 += 0.25D) { -+ double var30 = (var19 + (var24 - var19) * var28) * par1; -+ double var32 = (var21 + (var26 - var21) * var28) * par1; - double var34 = var30 * Math.sin(var17); - var30 *= Math.cos(var17); - -- for(double var36 = -1.0D; var36 <= 1.0D; var36 += 2.0D) { -- this.createParticle(this.posX, this.posY, this.posZ, var30 * var36, var32, var34 * var36, var4, var5, var6, var7); -+ for (double var36 = -1.0D; var36 <= 1.0D; var36 += 2.0D) { -+ this.createParticle(this.posX, this.posY, this.posZ, var30 * var36, var32, var34 * var36, par4ArrayOfInteger, par5ArrayOfInteger, par6, par7); - } - } - -@@ -170,20 +191,21 @@ - var21 = var26; - } - } -- - } - -- private void createBurst(int[] var1, int[] var2, boolean var3, boolean var4) { -- double var5 = this.ab.nextGaussian() * 0.05D; -- double var7 = this.ab.nextGaussian() * 0.05D; -+ /** -+ * Creates a burst type explosion. Args: colours, fade colours, whether to trail, whether to flicker -+ */ -+ private void createBurst(int[] par1ArrayOfInteger, int[] par2ArrayOfInteger, boolean par3, boolean par4) { -+ double var5 = this.rand.nextGaussian() * 0.05D; -+ double var7 = this.rand.nextGaussian() * 0.05D; - -- for(int var9 = 0; var9 < 70; ++var9) { -- double var10 = this.motionX * 0.5D + this.ab.nextGaussian() * 0.15D + var5; -- double var12 = this.motionZ * 0.5D + this.ab.nextGaussian() * 0.15D + var7; -- double var14 = this.motionY * 0.5D + this.ab.nextDouble() * 0.5D; -- this.createParticle(this.posX, this.posY, this.posZ, var10, var14, var12, var1, var2, var3, var4); -+ for (int var9 = 0; var9 < 70; ++var9) { -+ double var10 = this.motionX * 0.5D + this.rand.nextGaussian() * 0.15D + var5; -+ double var12 = this.motionZ * 0.5D + this.rand.nextGaussian() * 0.15D + var7; -+ double var14 = this.motionY * 0.5D + this.rand.nextDouble() * 0.5D; -+ this.createParticle(this.posX, this.posY, this.posZ, var10, var14, var12, par1ArrayOfInteger, par2ArrayOfInteger, par3, par4); - } -- - } - - public int getFXLayer() { ---- /dev/null -+++ org/spoutcraft/client/gui/GuiTextDialog.java -@@ -1,0 +1,105 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.client.gui; -+ -+import net.minecraft.src.GuiScreen; -+ -+import org.spoutcraft.api.gui.Button; -+import org.spoutcraft.api.gui.GenericButton; -+import org.spoutcraft.api.gui.GenericLabel; -+import org.spoutcraft.api.gui.GenericTextField; -+ -+public class GuiTextDialog extends GuiSpoutScreen { -+ private String title, text; -+ private GenericLabel labelTitle; -+ private GenericTextField textText; -+ private GenericButton buttonCancel, buttonDone; -+ private DialogEventHandler handler; -+ private GuiScreen parent; -+ -+ public GuiTextDialog(String title, String text, DialogEventHandler handler, GuiScreen parent) { -+ this.setTitle(title); -+ this.setText(text); -+ this.handler = handler; -+ this.parent = parent; -+ } -+ -+ protected void createInstances() { -+ labelTitle = new GenericLabel(title); -+ textText = new GenericTextField(); -+ textText.setWidth(200); -+ textText.setText(text); -+ -+ buttonCancel = new GenericButton("Cancel"); -+ buttonDone = new GenericButton("Done"); -+ -+ getScreen().attachWidgets("Spoutcraft", labelTitle, textText, buttonCancel, buttonDone); -+ } -+ -+ protected void layoutWidgets() { -+ final int totalHeight = 11 + 5 + 20 + 5 + 20; -+ int top = height / 2 - totalHeight / 2; -+ labelTitle.setWidth(200).setHeight(11).setX(width / 2 - 100).setY(top); -+ top += 16; -+ textText.setWidth(200).setHeight(20).setX(width / 2 - 100).setY(top); -+ top += 25; -+ buttonCancel.setWidth(95).setHeight(20).setX(width / 2 - 100).setY(top); -+ buttonDone.setWidth(100).setHeight(20).setX(width / 2).setY(top); -+ } -+ -+ protected void buttonClicked(Button btn) { -+ if (btn == buttonCancel) { -+ handler.onCancel(this); -+ mc.displayGuiScreen(parent); -+ } -+ if (btn == buttonDone) { -+ handler.onDone(this); -+ mc.displayGuiScreen(parent); -+ } -+ } -+ -+ public void setTitle(String title) { -+ this.title = title; -+ if (labelTitle != null) { -+ labelTitle.setText(title); -+ } -+ } -+ -+ public String getTitle() { -+ return title; -+ } -+ -+ public void setText(String text) { -+ this.text = text; -+ if (textText != null) { -+ textText.setText(text); // Redundant text is redundant -+ } -+ } -+ -+ public String getText() { -+ text = textText.getText(); -+ return text; -+ } -+ -+ public interface DialogEventHandler { -+ public void onDone(GuiTextDialog dialog); -+ public void onCancel(GuiTextDialog dialog); -+ } -+} ---- /dev/null -+++ org/spoutcraft/client/packet/PacketFocusUpdate.java -@@ -1,0 +1,77 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.client.packet; -+ -+import java.io.IOException; -+import java.util.UUID; -+ -+import org.spoutcraft.api.gui.Control; -+import org.spoutcraft.api.gui.InGameHUD; -+import org.spoutcraft.api.gui.PopupScreen; -+import org.spoutcraft.api.gui.Widget; -+import org.spoutcraft.api.io.SpoutInputStream; -+import org.spoutcraft.api.io.SpoutOutputStream; -+import org.spoutcraft.client.SpoutClient; -+ -+public class PacketFocusUpdate implements SpoutPacket { -+ private Control control; -+ private boolean focus; -+ private UUID widgetId; -+ -+ public PacketFocusUpdate() { -+ } -+ -+ public PacketFocusUpdate(Control control, boolean focus) { -+ this.control = control; -+ this.focus = focus; -+ } -+ -+ public void readData(SpoutInputStream input) throws IOException { -+ widgetId = new UUID(input.readLong(), input.readLong()); -+ focus = input.readBoolean(); -+ } -+ -+ public void writeData(SpoutOutputStream output) throws IOException { -+ output.writeLong(control.getId().getMostSignificantBits()); -+ output.writeLong(control.getId().getLeastSignificantBits()); -+ output.writeBoolean(focus); -+ } -+ -+ public void run(int playerId) { -+ InGameHUD screen = SpoutClient.getInstance().getActivePlayer().getMainScreen(); -+ PopupScreen popup = screen.getActivePopup(); -+ if (popup != null) { -+ Widget w = popup.getWidget(widgetId); -+ if (w != null && w instanceof Control) { -+ ((Control)w).setFocus(focus); -+ } -+ } -+ } -+ -+ public void failure(int playerId) {} -+ -+ public PacketType getPacketType() { -+ return PacketType.PacketFocusUpdate; -+ } -+ -+ public int getVersion() { -+ return 0; -+ } -+} ---- /dev/null -+++ org/spoutcraft/client/precache/PrecacheTuple.java -@@ -1,0 +1,62 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.client.precache; -+ -+public class PrecacheTuple { -+ private String plugin; -+ private String version; -+ private long crc; -+ -+ /** -+ * A tuple for zip -> crc -+ * @param plugin - Name of the plugin -+ * @param version - plugin version -+ * @param crc - crc of the precache file -+ */ -+ public PrecacheTuple(String plugin, String version, long crc) { -+ this.plugin = plugin; -+ this.version = version; -+ this.crc = crc; -+ } -+ -+ public String getPlugin() { -+ return plugin; -+ } -+ -+ public String getVersion() { -+ return version; -+ } -+ -+ public long getCrc() { -+ return crc; -+ } -+ -+ public void setPlugin(String plugin) { -+ this.plugin = plugin; -+ } -+ -+ public void setVersion(String version) { -+ this.version = version; -+ } -+ -+ public void setCrc(long crc) { -+ this.crc = crc; -+ } -+} ---- /dev/null -+++ org/spoutcraft/client/config/MipMapUtils.java -@@ -1,0 +1,232 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.client.config; -+ -+import gnu.trove.map.hash.TIntIntHashMap; -+ -+import org.lwjgl.opengl.ContextCapabilities; -+import org.lwjgl.opengl.EXTFramebufferObject; -+import org.lwjgl.opengl.GL11; -+import org.lwjgl.opengl.GL12; -+import org.lwjgl.opengl.GL14; -+import org.lwjgl.opengl.GL30; -+import org.lwjgl.opengl.GLContext; -+import org.newdawn.slick.opengl.Texture; -+ -+import net.minecraft.src.Minecraft; -+import net.minecraft.src.ResourceLocation; -+import net.minecraft.src.TextureMap; -+ -+import org.spoutcraft.api.material.CustomBlock; -+import org.spoutcraft.api.material.MaterialData; -+import org.spoutcraft.client.SpoutClient; -+import org.spoutcraft.client.io.CustomTextureManager; -+ -+public class MipMapUtils { -+ private static TIntIntHashMap mipmapLevels = new TIntIntHashMap(); -+ public static int mode = 0; -+ public static boolean updateTerrain = true; -+ public static float targetFade = 1F; -+ public static float currentFade = 1F; -+ private static boolean initialized = false; -+ -+ public static void initializeMipMaps() { -+ initialized = false; -+ GL11.glPushMatrix(); -+ if (Configuration.getMipmapsPercent() > 0F) { -+ // ToDO: this doesn't work. -+ int terrain = Minecraft.getMinecraft().renderEngine.getTextureId(new ResourceLocation("textures/atlas/blocks.png")); -+ initalizeTexture(terrain); -+ -+ for (CustomBlock block : MaterialData.getCustomBlocks()) { -+ if (block.getBlockDesign() != null) { -+ String texture = block.getBlockDesign().getTextureURL(); -+ String textureAddon = block.getBlockDesign().getTextureAddon(); -+ if (texture != null && textureAddon != null) { -+ Texture tex = CustomTextureManager.getTextureFromUrl(textureAddon, texture); -+ if (tex != null) { -+ initalizeTexture(tex.getTextureID()); -+ } -+ } -+ } -+ } -+ -+ MipMapUtils.targetFade = Configuration.getMipmapsPercent(); -+ initialized = true; -+ } -+ GL11.glPopMatrix(); -+ } -+ -+ public static int getMipmapLevels(int texture) { -+ int levels = mipmapLevels.get(texture); -+ if (levels == 0) { -+ levels = 8; -+ } -+ return levels; -+ } -+ -+ public static void setMipmapLevels(int texture, int levels) { -+ mipmapLevels.put(texture, levels); -+ } -+ -+ public static void initalizeTexture(int textureId) { -+ SpoutClient.getHandle().renderEngine.bindTexture(textureId); -+ GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MIN_FILTER, GL11.GL_NEAREST_MIPMAP_LINEAR); -+ -+ int textureWidth = GL11.glGetTexLevelParameteri(GL11.GL_TEXTURE_2D, 0, GL11.GL_TEXTURE_WIDTH); -+ int tileWidth = textureWidth / 16; -+ -+ setMipmapLevels(textureId, (int)Math.round(Math.log((double)tileWidth)/Math.log(2D))); -+ -+ GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL12.GL_TEXTURE_MAX_LOD, getMipmapLevels(textureId)); -+ -+ ContextCapabilities capabilities = GLContext.getCapabilities(); -+ if (capabilities.OpenGL30) { -+ MipMapUtils.mode = 1; -+ } else if (capabilities.GL_EXT_framebuffer_object) { -+ MipMapUtils.mode = 2; -+ } else if (capabilities.OpenGL14) { -+ MipMapUtils.mode = 3; -+ GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL14.GL_GENERATE_MIPMAP, GL11.GL_TRUE); -+ } -+ } -+ -+ public static void update() { -+ if (!initialized && Configuration.getMipmapsPercent() > 0F) { -+ initializeMipMaps(); -+ } -+ MipMapUtils.targetFade = Configuration.getMipmapsPercent(); -+ int terrain = Minecraft.getMinecraft().renderEngine.getTextureId(new ResourceLocation("textures/atlas/blocks.png")); -+ update(terrain); -+ -+ for (CustomBlock block : MaterialData.getCustomBlocks()) { -+ if (block.getBlockDesign() != null) { -+ String texture = block.getBlockDesign().getTextureURL(); -+ String textureAddon = block.getBlockDesign().getTextureAddon(); -+ if (texture != null && textureAddon != null) { -+ Texture tex = CustomTextureManager.getTextureFromUrl(textureAddon, texture); -+ if (tex != null) { -+ update(tex.getTextureID()); -+ } -+ } -+ } -+ } -+ -+ } -+ -+ public static void update(int texture) { -+ GL11.glPushMatrix(); -+ if (MipMapUtils.mode == 3) { -+ MipMapUtils.updateTerrain = Configuration.getMipmapsPercent() > 0F; -+ SpoutClient.getHandle().renderEngine.bindTexture(texture); -+ if (Configuration.getMipmapsPercent() > 0F) { -+ GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MIN_FILTER, GL11.GL_NEAREST_MIPMAP_LINEAR); -+ } else { -+ GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MIN_FILTER, GL11.GL_NEAREST); -+ } -+ GL11.glPopMatrix(); -+ return; -+ } -+ -+ if (Configuration.getMipmapsPercent() > 0F) { -+ MipMapUtils.updateTerrain = true; -+ SpoutClient.getHandle().renderEngine.bindTexture(texture); -+ GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MIN_FILTER, GL11.GL_NEAREST_MIPMAP_LINEAR); -+ } -+ GL11.glPopMatrix(); -+ } -+ -+ public static void onTick() { -+ if (updateTerrain) { -+ int terrain = Minecraft.getMinecraft().renderEngine.getTextureId(new ResourceLocation("textures/atlas/blocks.png")); -+ onTick(terrain, targetFade, currentFade); -+ -+ if (targetFade != currentFade) { -+ for (CustomBlock block : MaterialData.getCustomBlocks()) { -+ if (block.getBlockDesign() != null) { -+ String texture = block.getBlockDesign().getTextureURL(); -+ String textureAddon = block.getBlockDesign().getTextureAddon(); -+ if (texture != null && textureAddon != null) { -+ Texture tex = CustomTextureManager.getTextureFromUrl(textureAddon, texture); -+ if (tex != null) { -+ onTick(tex.getTextureID(), targetFade, currentFade); -+ } -+ } -+ } -+ } -+ } -+ -+ if (targetFade != currentFade) { -+ if (targetFade < currentFade) { -+ currentFade -= 0.01f; -+ if (currentFade <= targetFade) { -+ currentFade = targetFade; -+ } -+ } else { -+ currentFade += 0.01f; -+ if (currentFade >= targetFade) { -+ currentFade = targetFade; -+ } -+ } -+ } -+ } -+ } -+ -+ public static void onTick(int texture, float targetFade, float currentFade) { -+ GL11.glPushMatrix(); -+ SpoutClient.getHandle().renderEngine.bindTexture(texture); -+ -+ if (targetFade != currentFade) { -+ if (targetFade < currentFade) { -+ currentFade -= 0.01f; -+ if (currentFade <= targetFade) { -+ currentFade = targetFade; -+ } -+ } else { -+ currentFade += 0.01f; -+ if (currentFade >= targetFade) { -+ currentFade = targetFade; -+ } -+ } -+ -+ if (currentFade <= 0.0f) { -+ GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MIN_FILTER, GL11.GL_NEAREST); -+ GL11.glAlphaFunc(GL11.GL_GREATER, 0.01F); // Default blend state -+ -+ updateTerrain = false; -+ GL11.glPopMatrix(); -+ return; -+ } else { -+ GL11.glTexEnvf(GL14.GL_TEXTURE_FILTER_CONTROL, GL14.GL_TEXTURE_LOD_BIAS, getMipmapLevels(texture)*(currentFade-1.0f)); -+ } -+ } -+ -+ switch (mode) { -+ case 1: -+ GL30.glGenerateMipmap(GL11.GL_TEXTURE_2D); -+ break; -+ case 2: -+ EXTFramebufferObject.glGenerateMipmapEXT(GL11.GL_TEXTURE_2D); -+ break; -+ } -+ GL11.glAlphaFunc(GL11.GL_GEQUAL, 0.3F); // More strict blend state -+ GL11.glPopMatrix(); -+ } -+} ---- net/minecraft/src/EntityCow.java -+++ net/minecraft/src/EntityCow.java -@@ -1,8 +1,8 @@ - package net.minecraft.src; - - public class EntityCow extends EntityAnimal { -- public EntityCow(World var1) { -- super(var1); -+ public EntityCow(World par1World) { -+ super(par1World); - this.setSize(0.9F, 1.3F); - this.getNavigator().setAvoidsWater(true); - this.tasks.addTask(0, new EntityAISwimming(this)); -@@ -15,6 +15,9 @@ - this.tasks.addTask(7, new EntityAILookIdle(this)); - } - -+ /** -+ * Returns true if the newer Entity AI code should be run -+ */ - public boolean isAIEnabled() { - return true; - } -@@ -22,73 +25,101 @@ - protected void applyEntityAttributes() { - super.applyEntityAttributes(); - this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setAttribute(10.0D); -- this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setAttribute((double)0.2F); -+ this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setAttribute(0.20000000298023224D); - } - -+ /** -+ * Returns the sound this mob makes while it's alive. -+ */ - protected String getLivingSound() { - return "mob.cow.say"; - } - -+ /** -+ * Returns the sound this mob makes when it is hurt. -+ */ - protected String getHurtSound() { - return "mob.cow.hurt"; - } - -+ /** -+ * Returns the sound this mob makes on death. -+ */ - protected String getDeathSound() { - return "mob.cow.hurt"; - } - -- protected void playStepSound(int var1, int var2, int var3, int var4) { -+ /** -+ * Plays step sound at given x, y, z for the entity -+ */ -+ protected void playStepSound(int par1, int par2, int par3, int par4) { - this.playSound("mob.cow.step", 0.15F, 1.0F); - } - -+ /** -+ * Returns the volume for the sounds this mob makes. -+ */ - protected float getSoundVolume() { - return 0.4F; - } - -+ /** -+ * Returns the item ID for the item the mob drops on death. -+ */ - protected int getDropItemId() { - return Item.leather.itemID; - } - -- protected void dropFewItems(boolean var1, int var2) { -- int var3 = this.ab.nextInt(3) + this.ab.nextInt(1 + var2); -- -+ /** -+ * Drop 0-2 items of this living's type. @param par1 - Whether this entity has recently been hit by a player. @param -+ * par2 - Level of Looting used to kill this mob. -+ */ -+ protected void dropFewItems(boolean par1, int par2) { -+ int var3 = this.rand.nextInt(3) + this.rand.nextInt(1 + par2); - int var4; -- for(var4 = 0; var4 < var3; ++var4) { -+ -+ for (var4 = 0; var4 < var3; ++var4) { - this.dropItem(Item.leather.itemID, 1); - } - -- var3 = this.ab.nextInt(3) + 1 + this.ab.nextInt(1 + var2); -+ var3 = this.rand.nextInt(3) + 1 + this.rand.nextInt(1 + par2); - -- for(var4 = 0; var4 < var3; ++var4) { -- if(this.isBurning()) { -+ for (var4 = 0; var4 < var3; ++var4) { -+ if (this.isBurning()) { - this.dropItem(Item.beefCooked.itemID, 1); - } else { - this.dropItem(Item.beefRaw.itemID, 1); - } - } -- - } - -- public boolean interact(EntityPlayer var1) { -- ItemStack var2 = var1.inventory.getCurrentItem(); -- if(var2 != null && var2.itemID == Item.bucketEmpty.itemID && !var1.capabilities.isCreativeMode) { -- if(var2.stackSize-- == 1) { -- var1.inventory.setInventorySlotContents(var1.inventory.currentItem, new ItemStack(Item.bucketMilk)); -- } else if(!var1.inventory.addItemStackToInventory(new ItemStack(Item.bucketMilk))) { -- var1.dropPlayerItem(new ItemStack(Item.bucketMilk.itemID, 1, 0)); -+ /** -+ * Called when a player interacts with a mob. e.g. gets milk from a cow, gets into the saddle on a pig. -+ */ -+ public boolean interact(EntityPlayer par1EntityPlayer) { -+ ItemStack var2 = par1EntityPlayer.inventory.getCurrentItem(); -+ -+ if (var2 != null && var2.itemID == Item.bucketEmpty.itemID && !par1EntityPlayer.capabilities.isCreativeMode) { -+ if (var2.stackSize-- == 1) { -+ par1EntityPlayer.inventory.setInventorySlotContents(par1EntityPlayer.inventory.currentItem, new ItemStack(Item.bucketMilk)); -+ } else if (!par1EntityPlayer.inventory.addItemStackToInventory(new ItemStack(Item.bucketMilk))) { -+ par1EntityPlayer.dropPlayerItem(new ItemStack(Item.bucketMilk.itemID, 1, 0)); - } - - return true; - } else { -- return super.interact(var1); -+ return super.interact(par1EntityPlayer); - } - } - -- public EntityCow spawnBabyAnimal(EntityAgeable var1) { -+ /** -+ * This function is used when two same-species animals in 'love mode' breed to generate the new baby animal. -+ */ -+ public EntityCow spawnBabyAnimal(EntityAgeable par1EntityAgeable) { - return new EntityCow(this.worldObj); - } - -- public EntityAgeable createChild(EntityAgeable var1) { -- return this.spawnBabyAnimal(var1); -+ public EntityAgeable createChild(EntityAgeable par1EntityAgeable) { -+ return this.spawnBabyAnimal(par1EntityAgeable); - } - } ---- net/minecraft/src/BlockComparator.java -+++ net/minecraft/src/BlockComparator.java -@@ -3,20 +3,26 @@ - import java.util.Random; - - public class BlockComparator extends BlockRedstoneLogic implements ITileEntityProvider { -- public BlockComparator(int var1, boolean var2) { -- super(var1, var2); -+ public BlockComparator(int par1, boolean par2) { -+ super(par1, par2); - this.isBlockContainer = true; - } - -- public int idDropped(int var1, Random var2, int var3) { -- return Item.comparator.itemID; -- } -- -- public int idPicked(World var1, int var2, int var3, int var4) { -- return Item.comparator.itemID; -- } -- -- protected int func_94481_j_(int var1) { -+ /** -+ * Returns the ID of the items to drop on destruction. -+ */ -+ public int idDropped(int par1, Random par2Random, int par3) { -+ return Item.comparator.itemID; -+ } -+ -+ /** -+ * only called by clickMiddleMouseButton , and passed to inventory.setCurrentItem (along with isCreative) -+ */ -+ public int idPicked(World par1World, int par2, int par3, int par4) { -+ return Item.comparator.itemID; -+ } -+ -+ protected int func_94481_j_(int par1) { - return 2; - } - -@@ -28,58 +34,70 @@ - return Block.redstoneComparatorIdle; - } - -+ /** -+ * The type of render function that is called for this block -+ */ - public int getRenderType() { - return 37; - } - -- public Icon getIcon(int var1, int var2) { -- boolean var3 = this.isRepeaterPowered || (var2 & 8) != 0; -- return var1 == 0 ? (var3 ? Block.torchRedstoneActive.getBlockTextureFromSide(var1) : Block.torchRedstoneIdle.getBlockTextureFromSide(var1)) : (var1 == 1 ? (var3 ? Block.redstoneComparatorActive.blockIcon : this.blockIcon) : Block.stoneDoubleSlab.getBlockTextureFromSide(1)); -- } -- -- protected boolean func_96470_c(int var1) { -- return this.isRepeaterPowered || (var1 & 8) != 0; -- } -- -- protected int func_94480_d(IBlockAccess var1, int var2, int var3, int var4, int var5) { -- return this.getTileEntityComparator(var1, var2, var3, var4).getOutputSignal(); -- } -- -- private int getOutputStrength(World var1, int var2, int var3, int var4, int var5) { -- return !this.func_94490_c(var5) ? this.getInputStrength(var1, var2, var3, var4, var5) : Math.max(this.getInputStrength(var1, var2, var3, var4, var5) - this.func_94482_f(var1, var2, var3, var4, var5), 0); -- } -- -- public boolean func_94490_c(int var1) { -- return (var1 & 4) == 4; -- } -- -- protected boolean isGettingInput(World var1, int var2, int var3, int var4, int var5) { -- int var6 = this.getInputStrength(var1, var2, var3, var4, var5); -- if(var6 >= 15) { -+ /** -+ * From the specified side and block metadata retrieves the blocks texture. Args: side, metadata -+ */ -+ public Icon getIcon(int par1, int par2) { -+ boolean var3 = this.isRepeaterPowered || (par2 & 8) != 0; -+ return par1 == 0 ? (var3 ? Block.torchRedstoneActive.getBlockTextureFromSide(par1) : Block.torchRedstoneIdle.getBlockTextureFromSide(par1)) : (par1 == 1 ? (var3 ? Block.redstoneComparatorActive.blockIcon : this.blockIcon) : Block.stoneDoubleSlab.getBlockTextureFromSide(1)); -+ } -+ -+ protected boolean func_96470_c(int par1) { -+ return this.isRepeaterPowered || (par1 & 8) != 0; -+ } -+ -+ protected int func_94480_d(IBlockAccess par1IBlockAccess, int par2, int par3, int par4, int par5) { -+ return this.getTileEntityComparator(par1IBlockAccess, par2, par3, par4).getOutputSignal(); -+ } -+ -+ private int getOutputStrength(World par1World, int par2, int par3, int par4, int par5) { -+ return !this.func_94490_c(par5) ? this.getInputStrength(par1World, par2, par3, par4, par5) : Math.max(this.getInputStrength(par1World, par2, par3, par4, par5) - this.func_94482_f(par1World, par2, par3, par4, par5), 0); -+ } -+ -+ public boolean func_94490_c(int par1) { -+ return (par1 & 4) == 4; -+ } -+ -+ protected boolean isGettingInput(World par1World, int par2, int par3, int par4, int par5) { -+ int var6 = this.getInputStrength(par1World, par2, par3, par4, par5); -+ -+ if (var6 >= 15) { - return true; -- } else if(var6 == 0) { -+ } else if (var6 == 0) { - return false; - } else { -- int var7 = this.func_94482_f(var1, var2, var3, var4, var5); -+ int var7 = this.func_94482_f(par1World, par2, par3, par4, par5); - return var7 == 0 ? true : var6 >= var7; - } - } - -- protected int getInputStrength(World var1, int var2, int var3, int var4, int var5) { -- int var6 = super.getInputStrength(var1, var2, var3, var4, var5); -- int var7 = getDirection(var5); -- int var8 = var2 + Direction.offsetX[var7]; -- int var9 = var4 + Direction.offsetZ[var7]; -- int var10 = var1.getBlockId(var8, var3, var9); -- if(var10 > 0) { -- if(Block.blocksList[var10].hasComparatorInputOverride()) { -- var6 = Block.blocksList[var10].getComparatorInputOverride(var1, var8, var3, var9, Direction.rotateOpposite[var7]); -- } else if(var6 < 15 && Block.isNormalCube(var10)) { -+ /** -+ * Returns the signal strength at one input of the block. Args: world, X, Y, Z, side -+ */ -+ protected int getInputStrength(World par1World, int par2, int par3, int par4, int par5) { -+ int var6 = super.getInputStrength(par1World, par2, par3, par4, par5); -+ int var7 = getDirection(par5); -+ int var8 = par2 + Direction.offsetX[var7]; -+ int var9 = par4 + Direction.offsetZ[var7]; -+ int var10 = par1World.getBlockId(var8, par3, var9); -+ -+ if (var10 > 0) { -+ if (Block.blocksList[var10].hasComparatorInputOverride()) { -+ var6 = Block.blocksList[var10].getComparatorInputOverride(par1World, var8, par3, var9, Direction.rotateOpposite[var7]); -+ } else if (var6 < 15 && Block.isNormalCube(var10)) { - var8 += Direction.offsetX[var7]; - var9 += Direction.offsetZ[var7]; -- var10 = var1.getBlockId(var8, var3, var9); -- if(var10 > 0 && Block.blocksList[var10].hasComparatorInputOverride()) { -- var6 = Block.blocksList[var10].getComparatorInputOverride(var1, var8, var3, var9, Direction.rotateOpposite[var7]); -+ var10 = par1World.getBlockId(var8, par3, var9); -+ -+ if (var10 > 0 && Block.blocksList[var10].hasComparatorInputOverride()) { -+ var6 = Block.blocksList[var10].getComparatorInputOverride(par1World, var8, par3, var9, Direction.rotateOpposite[var7]); - } - } - } -@@ -87,84 +105,108 @@ - return var6; - } - -- public TileEntityComparator getTileEntityComparator(IBlockAccess var1, int var2, int var3, int var4) { -- return (TileEntityComparator)var1.getBlockTileEntity(var2, var3, var4); -+ /** -+ * Returns the blockTileEntity at given coordinates. -+ */ -+ public TileEntityComparator getTileEntityComparator(IBlockAccess par1IBlockAccess, int par2, int par3, int par4) { -+ return (TileEntityComparator)par1IBlockAccess.getBlockTileEntity(par2, par3, par4); - } - -- public boolean onBlockActivated(World var1, int var2, int var3, int var4, EntityPlayer var5, int var6, float var7, float var8, float var9) { -- int var10 = var1.getBlockMetadata(var2, var3, var4); -+ /** -+ * Called upon block activation (right click on the block.) -+ */ -+ public boolean onBlockActivated(World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer, int par6, float par7, float par8, float par9) { -+ int var10 = par1World.getBlockMetadata(par2, par3, par4); - boolean var11 = this.isRepeaterPowered | (var10 & 8) != 0; - boolean var12 = !this.func_94490_c(var10); - int var13 = var12 ? 4 : 0; - var13 |= var11 ? 8 : 0; -- var1.playSoundEffect((double)var2 + 0.5D, (double)var3 + 0.5D, (double)var4 + 0.5D, "random.click", 0.3F, var12 ? 0.55F : 0.5F); -- var1.setBlockMetadata(var2, var3, var4, var13 | var10 & 3, 2); -- this.func_96476_c(var1, var2, var3, var4, var1.s); -+ par1World.playSoundEffect((double)par2 + 0.5D, (double)par3 + 0.5D, (double)par4 + 0.5D, "random.click", 0.3F, var12 ? 0.55F : 0.5F); -+ par1World.setBlockMetadataWithNotify(par2, par3, par4, var13 | var10 & 3, 2); -+ this.func_96476_c(par1World, par2, par3, par4, par1World.rand); - return true; - } - -- protected void func_94479_f(World var1, int var2, int var3, int var4, int var5) { -- if(!var1.isBlockTickScheduledThisTick(var2, var3, var4, this.blockID)) { -- int var6 = var1.getBlockMetadata(var2, var3, var4); -- int var7 = this.getOutputStrength(var1, var2, var3, var4, var6); -- int var8 = this.getTileEntityComparator(var1, var2, var3, var4).getOutputSignal(); -- if(var7 != var8 || this.func_96470_c(var6) != this.isGettingInput(var1, var2, var3, var4, var6)) { -- if(this.func_83011_d(var1, var2, var3, var4, var6)) { -- var1.scheduleBlockUpdateWithPriority(var2, var3, var4, this.blockID, this.func_94481_j_(0), -1); -+ protected void func_94479_f(World par1World, int par2, int par3, int par4, int par5) { -+ if (!par1World.isBlockTickScheduledThisTick(par2, par3, par4, this.blockID)) { -+ int var6 = par1World.getBlockMetadata(par2, par3, par4); -+ int var7 = this.getOutputStrength(par1World, par2, par3, par4, var6); -+ int var8 = this.getTileEntityComparator(par1World, par2, par3, par4).getOutputSignal(); -+ -+ if (var7 != var8 || this.func_96470_c(var6) != this.isGettingInput(par1World, par2, par3, par4, var6)) { -+ if (this.func_83011_d(par1World, par2, par3, par4, var6)) { -+ par1World.scheduleBlockUpdateWithPriority(par2, par3, par4, this.blockID, this.func_94481_j_(0), -1); - } else { -- var1.scheduleBlockUpdateWithPriority(var2, var3, var4, this.blockID, this.func_94481_j_(0), 0); -+ par1World.scheduleBlockUpdateWithPriority(par2, par3, par4, this.blockID, this.func_94481_j_(0), 0); - } - } - } -- - } - -- private void func_96476_c(World var1, int var2, int var3, int var4, Random var5) { -- int var6 = var1.getBlockMetadata(var2, var3, var4); -- int var7 = this.getOutputStrength(var1, var2, var3, var4, var6); -- int var8 = this.getTileEntityComparator(var1, var2, var3, var4).getOutputSignal(); -- this.getTileEntityComparator(var1, var2, var3, var4).setOutputSignal(var7); -- if(var8 != var7 || !this.func_94490_c(var6)) { -- boolean var9 = this.isGettingInput(var1, var2, var3, var4, var6); -+ private void func_96476_c(World par1World, int par2, int par3, int par4, Random par5Random) { -+ int var6 = par1World.getBlockMetadata(par2, par3, par4); -+ int var7 = this.getOutputStrength(par1World, par2, par3, par4, var6); -+ int var8 = this.getTileEntityComparator(par1World, par2, par3, par4).getOutputSignal(); -+ this.getTileEntityComparator(par1World, par2, par3, par4).setOutputSignal(var7); -+ -+ if (var8 != var7 || !this.func_94490_c(var6)) { -+ boolean var9 = this.isGettingInput(par1World, par2, par3, par4, var6); - boolean var10 = this.isRepeaterPowered || (var6 & 8) != 0; -- if(var10 && !var9) { -- var1.setBlockMetadata(var2, var3, var4, var6 & -9, 2); -- } else if(!var10 && var9) { -- var1.setBlockMetadata(var2, var3, var4, var6 | 8, 2); -+ -+ if (var10 && !var9) { -+ par1World.setBlockMetadataWithNotify(par2, par3, par4, var6 & -9, 2); -+ } else if (!var10 && var9) { -+ par1World.setBlockMetadataWithNotify(par2, par3, par4, var6 | 8, 2); - } - -- this.func_94483_i_(var1, var2, var3, var4); -- } -- -- } -- -- public void updateTick(World var1, int var2, int var3, int var4, Random var5) { -- if(this.isRepeaterPowered) { -- int var6 = var1.getBlockMetadata(var2, var3, var4); -- var1.setBlock(var2, var3, var4, this.func_94484_i().blockID, var6 | 8, 4); -- } -- -- this.func_96476_c(var1, var2, var3, var4, var5); -- } -- -- public void onBlockAdded(World var1, int var2, int var3, int var4) { -- super.onBlockAdded(var1, var2, var3, var4); -- var1.setBlockTileEntity(var2, var3, var4, this.createNewTileEntity(var1)); -- } -- -- public void breakBlock(World var1, int var2, int var3, int var4, int var5, int var6) { -- super.breakBlock(var1, var2, var3, var4, var5, var6); -- var1.removeBlockTileEntity(var2, var3, var4); -- this.func_94483_i_(var1, var2, var3, var4); -- } -- -- public boolean onBlockEventReceived(World var1, int var2, int var3, int var4, int var5, int var6) { -- super.onBlockEventReceived(var1, var2, var3, var4, var5, var6); -- TileEntity var7 = var1.getBlockTileEntity(var2, var3, var4); -- return var7 != null ? var7.receiveClientEvent(var5, var6) : false; -- } -- -- public TileEntity createNewTileEntity(World var1) { -+ this.func_94483_i_(par1World, par2, par3, par4); -+ } -+ } -+ -+ /** -+ * Ticks the block if it's been scheduled -+ */ -+ public void updateTick(World par1World, int par2, int par3, int par4, Random par5Random) { -+ if (this.isRepeaterPowered) { -+ int var6 = par1World.getBlockMetadata(par2, par3, par4); -+ par1World.setBlock(par2, par3, par4, this.func_94484_i().blockID, var6 | 8, 4); -+ } -+ -+ this.func_96476_c(par1World, par2, par3, par4, par5Random); -+ } -+ -+ /** -+ * Called whenever the block is added into the world. Args: world, x, y, z -+ */ -+ public void onBlockAdded(World par1World, int par2, int par3, int par4) { -+ super.onBlockAdded(par1World, par2, par3, par4); -+ par1World.setBlockTileEntity(par2, par3, par4, this.createNewTileEntity(par1World)); -+ } -+ -+ /** -+ * Called on server worlds only when the block has been replaced by a different block ID, or the same block with a -+ * different metadata value, but before the new metadata value is set. Args: World, x, y, z, old block ID, old metadata -+ */ -+ public void breakBlock(World par1World, int par2, int par3, int par4, int par5, int par6) { -+ super.breakBlock(par1World, par2, par3, par4, par5, par6); -+ par1World.removeBlockTileEntity(par2, par3, par4); -+ this.func_94483_i_(par1World, par2, par3, par4); -+ } -+ -+ /** -+ * Called when the block receives a BlockEvent - see World.addBlockEvent. By default, passes it on to the tile entity -+ * at this location. Args: world, x, y, z, blockID, EventID, event parameter -+ */ -+ public boolean onBlockEventReceived(World par1World, int par2, int par3, int par4, int par5, int par6) { -+ super.onBlockEventReceived(par1World, par2, par3, par4, par5, par6); -+ TileEntity var7 = par1World.getBlockTileEntity(par2, par3, par4); -+ return var7 != null ? var7.receiveClientEvent(par5, par6) : false; -+ } -+ -+ /** -+ * Returns a new instance of a block's tile entity class. Called on placing the block. -+ */ -+ public TileEntity createNewTileEntity(World par1World) { - return new TileEntityComparator(); - } - } ---- /dev/null -+++ com/prupe/mcpatcher/mob/LineRenderer.java -@@ -1,0 +1,174 @@ -+package com.prupe.mcpatcher.mob; -+ -+import com.prupe.mcpatcher.Config; -+import com.prupe.mcpatcher.InputHandler; -+import com.prupe.mcpatcher.MCLogger; -+import com.prupe.mcpatcher.MCPatcherUtils; -+import com.prupe.mcpatcher.TexturePackAPI; -+import java.util.Properties; -+import net.minecraft.src.ResourceLocation; -+import net.minecraft.src.Tessellator; -+import org.lwjgl.opengl.GL11; -+ -+public class LineRenderer { -+ private static final MCLogger logger = MCLogger.getLogger("Random Mobs"); -+ private static final double D_WIDTH = 9.765625E-4D; -+ private static final double D_POS = 0.00390625D; -+ private static final boolean enable = Config.getBoolean("Random Mobs", "leashLine", true); -+ private static final LineRenderer[] renderers = new LineRenderer[2]; -+ private final ResourceLocation texture; -+ private final double width; -+ private final double a; -+ private final double b; -+ private final double sx; -+ private final double sy; -+ private final double sz; -+ private final int segments; -+ private final double tileFactor; -+ private final boolean active; -+ private final InputHandler keyboard; -+ private double plusWidth; -+ private double plusTile; -+ private double plusSX; -+ private double plusSY; -+ private double plusSZ; -+ -+ public static boolean renderLine(int type, double x, double y, double z, double dx, double dy, double dz) { -+ LineRenderer renderer = renderers[type]; -+ return renderer != null && renderer.render(x, y, z, dx, dy, dz); -+ } -+ -+ static void reset() { -+ if (enable) { -+ setup(0, "fishingline", 0.0075D, 0.0D, 0.25D, 16); -+ setup(1, "lead", 0.025D, 1.3333333333333333D, 0.125D, 24); -+ } -+ } -+ -+ private static void setup(int type, String name, double defaultWidth, double a, double b, int segments) { -+ LineRenderer renderer = new LineRenderer(name, defaultWidth, a, b, segments); -+ -+ if (renderer.active) { -+ logger.fine("using %s", new Object[] {renderer}); -+ renderers[type] = renderer; -+ } else { -+ logger.fine("%s not found", new Object[] {renderer}); -+ renderers[type] = null; -+ } -+ } -+ -+ private LineRenderer(String name, double width, double a, double b, int segments) { -+ this.texture = TexturePackAPI.newMCPatcherResourceLocation("line/" + name + ".png"); -+ this.active = TexturePackAPI.hasResource(this.texture); -+ Properties properties = TexturePackAPI.getProperties(TexturePackAPI.transformResourceLocation(this.texture, ".png", ".properties")); -+ this.width = MCPatcherUtils.getDoubleProperty(properties, "width", width); -+ this.a = MCPatcherUtils.getDoubleProperty(properties, "a", a); -+ this.b = MCPatcherUtils.getDoubleProperty(properties, "b", b); -+ this.sx = MCPatcherUtils.getDoubleProperty(properties, "sx", 0.0D); -+ this.sy = MCPatcherUtils.getDoubleProperty(properties, "sy", 0.0D); -+ this.sz = MCPatcherUtils.getDoubleProperty(properties, "sz", 0.0D); -+ this.segments = MCPatcherUtils.getIntProperty(properties, "segments", segments); -+ this.tileFactor = MCPatcherUtils.getDoubleProperty(properties, "tileFactor", 24.0D); -+ this.keyboard = new InputHandler(name, MCPatcherUtils.getBooleanProperty(properties, "debug", false)); -+ } -+ -+ private boolean render(double x, double y, double z, double dx, double dy, double dz) { -+ if (this.keyboard.isKeyDown(55)) { -+ return false; -+ } else { -+ boolean changed = false; -+ -+ if (this.keyboard.isEnabled()) { -+ if (this.keyboard.isKeyPressed(78)) { -+ changed = true; -+ this.plusWidth += 9.765625E-4D; -+ } else if (this.keyboard.isKeyPressed(74)) { -+ changed = true; -+ this.plusWidth -= 9.765625E-4D; -+ } else if (this.keyboard.isKeyPressed(181)) { -+ changed = true; -+ this.plusWidth = this.plusTile = this.plusSX = this.plusSY = this.plusSZ = 0.0D; -+ } else if (this.keyboard.isKeyPressed(81)) { -+ changed = true; -+ --this.plusTile; -+ } else if (this.keyboard.isKeyPressed(73)) { -+ changed = true; -+ ++this.plusTile; -+ } else if (this.keyboard.isKeyDown(75)) { -+ changed = true; -+ this.plusSX -= 0.00390625D; -+ } else if (this.keyboard.isKeyDown(77)) { -+ changed = true; -+ this.plusSX += 0.00390625D; -+ } else if (this.keyboard.isKeyDown(79)) { -+ changed = true; -+ this.plusSY -= 0.00390625D; -+ } else if (this.keyboard.isKeyDown(71)) { -+ changed = true; -+ this.plusSY += 0.00390625D; -+ } else if (this.keyboard.isKeyDown(80)) { -+ changed = true; -+ this.plusSZ += 0.00390625D; -+ } else if (this.keyboard.isKeyDown(72)) { -+ changed = true; -+ this.plusSZ -= 0.00390625D; -+ } -+ } -+ -+ TexturePackAPI.bindTexture(this.texture); -+ Tessellator tessellator = Tessellator.instance; -+ tessellator.startDrawingQuads(); -+ GL11.glDisable(GL11.GL_CULL_FACE); -+ GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); -+ dx += this.sx + this.plusSX; -+ dy += this.sy + this.plusSY; -+ dz += this.sz + this.plusSZ; -+ double x0 = x; -+ double y0 = y + this.a + this.b; -+ double z0 = z; -+ double u0 = 0.0D; -+ double len = Math.sqrt(dx * dx + dy * dy + dz * dz); -+ double t = this.tileFactor + this.plusTile; -+ double w = this.width + this.plusWidth; -+ -+ if (changed) { -+ logger.info("%s: dx=%f, dy=%f, dz=%f, len=%f(*%d=%f), slen=%f", new Object[] {this, Double.valueOf(dx), Double.valueOf(dy), Double.valueOf(dz), Double.valueOf(len), Integer.valueOf((int)t), Double.valueOf(len * t), Double.valueOf(len * t / (double)this.segments)}); -+ System.out.printf("width=%f\n", new Object[] {Double.valueOf(w)}); -+ System.out.printf("tileFactor=%f\n", new Object[] {Double.valueOf(t)}); -+ System.out.printf("sx=%f\n", new Object[] {Double.valueOf(this.sx + this.plusSX)}); -+ System.out.printf("sy=%f\n", new Object[] {Double.valueOf(this.sy + this.plusSY)}); -+ System.out.printf("sz=%f\n", new Object[] {Double.valueOf(this.sz + this.plusSZ)}); -+ } -+ -+ len *= t / (double)this.segments; -+ -+ for (int i = 1; i <= this.segments; ++i) { -+ double s = (double)i / (double)this.segments; -+ double x1 = x + s * dx; -+ double y1 = y + (s * s + s) * 0.5D * dy + this.a * (1.0D - s) + this.b; -+ double z1 = z + s * dz; -+ double u1 = (double)(this.segments - i) * len; -+ tessellator.addVertexWithUV(x0, y0, z0, u0, 1.0D); -+ tessellator.addVertexWithUV(x1, y1, z1, u1, 1.0D); -+ tessellator.addVertexWithUV(x1 + w, y1 + w, z1, u1, 0.0D); -+ tessellator.addVertexWithUV(x0 + w, y0 + w, z0, u0, 0.0D); -+ tessellator.addVertexWithUV(x0, y0 + w, z0, u0, 1.0D); -+ tessellator.addVertexWithUV(x1, y1 + w, z1, u1, 1.0D); -+ tessellator.addVertexWithUV(x1 + w, y1, z1 + w, u1, 0.0D); -+ tessellator.addVertexWithUV(x0 + w, y0, z0 + w, u0, 0.0D); -+ x0 = x1; -+ y0 = y1; -+ z0 = z1; -+ u0 = u1; -+ } -+ -+ tessellator.draw(); -+ GL11.glEnable(GL11.GL_CULL_FACE); -+ return true; -+ } -+ } -+ -+ public String toString() { -+ return "LineRenderer{" + this.texture + ", " + (this.width + this.plusWidth) + "}"; -+ } -+} ---- net/minecraft/src/EntityCreeper.java -+++ net/minecraft/src/EntityCreeper.java -@@ -1,13 +1,24 @@ - package net.minecraft.src; - - public class EntityCreeper extends EntityMob { -+ -+ /** -+ * Time when this creeper was last in an active state (Messed up code here, probably causes creeper animation to go -+ * weird) -+ */ - private int lastActiveTime; -+ -+ /** -+ * The amount of time since the creeper was close enough to the player to ignite -+ */ - private int timeSinceIgnited; - private int fuseTime = 30; -+ -+ /** Explosion radius for this creeper. */ - private int explosionRadius = 3; - -- public EntityCreeper(World var1) { -- super(var1); -+ public EntityCreeper(World par1World) { -+ super(par1World); - this.tasks.addTask(1, new EntityAISwimming(this)); - this.tasks.addTask(2, new EntityAICreeperSwell(this)); - this.tasks.addTask(3, new EntityAIAvoidEntity(this, EntityOcelot.class, 6.0F, 1.0D, 1.2D)); -@@ -24,70 +35,93 @@ - this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setAttribute(0.25D); - } - -+ /** -+ * Returns true if the newer Entity AI code should be run -+ */ - public boolean isAIEnabled() { - return true; - } - -+ /** -+ * The number of iterations PathFinder.getSafePoint will execute before giving up. -+ */ - public int getMaxSafePointTries() { - return this.getAttackTarget() == null ? 3 : 3 + (int)(this.getHealth() - 1.0F); - } - -- protected void fall(float var1) { -- super.fall(var1); -- this.timeSinceIgnited = (int)((float)this.timeSinceIgnited + var1 * 1.5F); -- if(this.timeSinceIgnited > this.fuseTime - 5) { -+ /** -+ * Called when the mob is falling. Calculates and applies fall damage. -+ */ -+ protected void fall(float par1) { -+ super.fall(par1); -+ this.timeSinceIgnited = (int)((float)this.timeSinceIgnited + par1 * 1.5F); -+ -+ if (this.timeSinceIgnited > this.fuseTime - 5) { - this.timeSinceIgnited = this.fuseTime - 5; - } -- - } - - protected void entityInit() { - super.entityInit(); -- this.dataWatcher.addObject(16, Byte.valueOf((byte)-1)); -+ this.dataWatcher.addObject(16, Byte.valueOf((byte) - 1)); - this.dataWatcher.addObject(17, Byte.valueOf((byte)0)); - } - -- public void writeEntityToNBT(NBTTagCompound var1) { -- super.writeEntityToNBT(var1); -- if(this.dataWatcher.getWatchableObjectByte(17) == 1) { -- var1.setBoolean("powered", true); -- } -- -- var1.setShort("Fuse", (short)this.fuseTime); -- var1.setByte("ExplosionRadius", (byte)this.explosionRadius); -- } -- -- public void readEntityFromNBT(NBTTagCompound var1) { -- super.readEntityFromNBT(var1); -- this.dataWatcher.updateObject(17, Byte.valueOf((byte)(var1.getBoolean("powered") ? 1 : 0))); -- if(var1.hasKey("Fuse")) { -- this.fuseTime = var1.getShort("Fuse"); -- } -- -- if(var1.hasKey("ExplosionRadius")) { -- this.explosionRadius = var1.getByte("ExplosionRadius"); -- } -- -- } -- -+ /** -+ * (abstract) Protected helper method to write subclass entity data to NBT. -+ */ -+ public void writeEntityToNBT(NBTTagCompound par1NBTTagCompound) { -+ super.writeEntityToNBT(par1NBTTagCompound); -+ -+ if (this.dataWatcher.getWatchableObjectByte(17) == 1) { -+ par1NBTTagCompound.setBoolean("powered", true); -+ } -+ -+ par1NBTTagCompound.setShort("Fuse", (short)this.fuseTime); -+ par1NBTTagCompound.setByte("ExplosionRadius", (byte)this.explosionRadius); -+ } -+ -+ /** -+ * (abstract) Protected helper method to read subclass entity data from NBT. -+ */ -+ public void readEntityFromNBT(NBTTagCompound par1NBTTagCompound) { -+ super.readEntityFromNBT(par1NBTTagCompound); -+ this.dataWatcher.updateObject(17, Byte.valueOf((byte)(par1NBTTagCompound.getBoolean("powered") ? 1 : 0))); -+ -+ if (par1NBTTagCompound.hasKey("Fuse")) { -+ this.fuseTime = par1NBTTagCompound.getShort("Fuse"); -+ } -+ -+ if (par1NBTTagCompound.hasKey("ExplosionRadius")) { -+ this.explosionRadius = par1NBTTagCompound.getByte("ExplosionRadius"); -+ } -+ } -+ -+ /** -+ * Called to update the entity's position/logic. -+ */ - public void onUpdate() { -- if(this.isEntityAlive()) { -+ if (this.isEntityAlive()) { - this.lastActiveTime = this.timeSinceIgnited; - int var1 = this.getCreeperState(); -- if(var1 > 0 && this.timeSinceIgnited == 0) { -+ -+ if (var1 > 0 && this.timeSinceIgnited == 0) { - this.playSound("random.fuse", 1.0F, 0.5F); - } - - this.timeSinceIgnited += var1; -- if(this.timeSinceIgnited < 0) { -+ -+ if (this.timeSinceIgnited < 0) { - this.timeSinceIgnited = 0; - } - -- if(this.timeSinceIgnited >= this.fuseTime) { -+ if (this.timeSinceIgnited >= this.fuseTime) { - this.timeSinceIgnited = this.fuseTime; -- if(!this.worldObj.isRemote) { -+ -+ if (!this.worldObj.isRemote) { - boolean var2 = this.worldObj.getGameRules().getGameRuleBooleanValue("mobGriefing"); -- if(this.getPowered()) { -+ -+ if (this.getPowered()) { - this.worldObj.createExplosion(this, this.posX, this.posY, this.posZ, (float)(this.explosionRadius * 2), var2); - } else { - this.worldObj.createExplosion(this, this.posX, this.posY, this.posZ, (float)this.explosionRadius, var2); -@@ -101,49 +135,76 @@ - super.onUpdate(); - } - -+ /** -+ * Returns the sound this mob makes when it is hurt. -+ */ - protected String getHurtSound() { - return "mob.creeper.say"; - } - -+ /** -+ * Returns the sound this mob makes on death. -+ */ - protected String getDeathSound() { - return "mob.creeper.death"; - } - -- public void onDeath(DamageSource var1) { -- super.onDeath(var1); -- if(var1.getEntity() instanceof EntitySkeleton) { -- int var2 = Item.record13.itemID + this.ab.nextInt(Item.recordWait.itemID - Item.record13.itemID + 1); -+ /** -+ * Called when the mob's health reaches 0. -+ */ -+ public void onDeath(DamageSource par1DamageSource) { -+ super.onDeath(par1DamageSource); -+ -+ if (par1DamageSource.getEntity() instanceof EntitySkeleton) { -+ int var2 = Item.record13.itemID + this.rand.nextInt(Item.recordWait.itemID - Item.record13.itemID + 1); - this.dropItem(var2, 1); - } -- - } - -- public boolean attackEntityAsMob(Entity var1) { -+ public boolean attackEntityAsMob(Entity par1Entity) { - return true; - } - -+ /** -+ * Returns true if the creeper is powered by a lightning bolt. -+ */ - public boolean getPowered() { - return this.dataWatcher.getWatchableObjectByte(17) == 1; - } - -- public float getCreeperFlashIntensity(float var1) { -- return ((float)this.lastActiveTime + (float)(this.timeSinceIgnited - this.lastActiveTime) * var1) / (float)(this.fuseTime - 2); -+ /** -+ * Params: (Float)Render tick. Returns the intensity of the creeper's flash when it is ignited. -+ */ -+ public float getCreeperFlashIntensity(float par1) { -+ return ((float)this.lastActiveTime + (float)(this.timeSinceIgnited - this.lastActiveTime) * par1) / (float)(this.fuseTime - 2); - } - -+ /** -+ * Returns the item ID for the item the mob drops on death. -+ */ - protected int getDropItemId() { - return Item.gunpowder.itemID; - } - -+ /** -+ * Returns the current state of creeper, -1 is idle, 1 is 'in fuse' -+ */ - public int getCreeperState() { - return this.dataWatcher.getWatchableObjectByte(16); - } - -- public void setCreeperState(int var1) { -- this.dataWatcher.updateObject(16, Byte.valueOf((byte)var1)); -+ /** -+ * Sets the state of creeper, -1 to idle and 1 to be 'in fuse' -+ */ -+ public void setCreeperState(int par1) { -+ this.dataWatcher.updateObject(16, Byte.valueOf((byte)par1)); - } - -- public void onStruckByLightning(EntityLightningBolt var1) { -- super.onStruckByLightning(var1); -+ /** -+ * Called when a lightning bolt hits the entity. -+ */ -+ public void onStruckByLightning(EntityLightningBolt par1EntityLightningBolt) { -+ super.onStruckByLightning(par1EntityLightningBolt); - this.dataWatcher.updateObject(17, Byte.valueOf((byte)1)); - } - } ---- net/minecraft/src/EntityMob.java -+++ net/minecraft/src/EntityMob.java -@@ -1,41 +1,57 @@ - package net.minecraft.src; - - public abstract class EntityMob extends EntityCreature implements IMob { -- public EntityMob(World var1) { -- super(var1); -+ public EntityMob(World par1World) { -+ super(par1World); - this.experienceValue = 5; - } - -+ /** -+ * Called frequently so the entity can update its state every tick as required. For example, zombies and skeletons use -+ * this to react to sunlight and start to burn. -+ */ - public void onLivingUpdate() { - this.updateArmSwingProgress(); - float var1 = this.getBrightness(1.0F); -- if(var1 > 0.5F) { -+ -+ if (var1 > 0.5F) { - this.entityAge += 2; - } - - super.onLivingUpdate(); - } - -+ /** -+ * Called to update the entity's position/logic. -+ */ - public void onUpdate() { - super.onUpdate(); -- if(!this.worldObj.isRemote && this.worldObj.difficultySetting == 0) { -+ -+ if (!this.worldObj.isRemote && this.worldObj.difficultySetting == 0) { - this.setDead(); - } -- - } - -+ /** -+ * Finds the closest player within 16 blocks to attack, or null if this Entity isn't interested in attacking (Animals, -+ * Spiders at day, peaceful PigZombies). -+ */ - protected Entity findPlayerToAttack() { - EntityPlayer var1 = this.worldObj.getClosestVulnerablePlayerToEntity(this, 16.0D); - return var1 != null && this.canEntityBeSeen(var1) ? var1 : null; - } - -- public boolean attackEntityFrom(DamageSource var1, float var2) { -- if(this.isEntityInvulnerable()) { -+ /** -+ * Called when the entity is attacked. -+ */ -+ public boolean attackEntityFrom(DamageSource par1DamageSource, float par2) { -+ if (this.isEntityInvulnerable()) { - return false; -- } else if(super.attackEntityFrom(var1, var2)) { -- Entity var3 = var1.getEntity(); -- if(this.riddenByEntity != var3 && this.ridingEntity != var3) { -- if(var3 != this) { -+ } else if (super.attackEntityFrom(par1DamageSource, par2)) { -+ Entity var3 = par1DamageSource.getEntity(); -+ -+ if (this.riddenByEntity != var3 && this.ridingEntity != var3) { -+ if (var3 != this) { - this.entityToAttack = var3; - } - -@@ -48,66 +64,83 @@ - } - } - -- public boolean attackEntityAsMob(Entity var1) { -+ public boolean attackEntityAsMob(Entity par1Entity) { - float var2 = (float)this.getEntityAttribute(SharedMonsterAttributes.attackDamage).getAttributeValue(); - int var3 = 0; -- if(var1 instanceof EntityLivingBase) { -- var2 += EnchantmentHelper.getEnchantmentModifierLiving(this, (EntityLivingBase)var1); -- var3 += EnchantmentHelper.getKnockbackModifier(this, (EntityLivingBase)var1); -+ -+ if (par1Entity instanceof EntityLivingBase) { -+ var2 += EnchantmentHelper.getEnchantmentModifierLiving(this, (EntityLivingBase)par1Entity); -+ var3 += EnchantmentHelper.getKnockbackModifier(this, (EntityLivingBase)par1Entity); - } - -- boolean var4 = var1.attackEntityFrom(DamageSource.causeMobDamage(this), var2); -- if(var4) { -- if(var3 > 0) { -- var1.addVelocity((double)(-MathHelper.sin(this.rotationYaw * (float)Math.PI / 180.0F) * (float)var3 * 0.5F), 0.1D, (double)(MathHelper.cos(this.rotationYaw * (float)Math.PI / 180.0F) * (float)var3 * 0.5F)); -+ boolean var4 = par1Entity.attackEntityFrom(DamageSource.causeMobDamage(this), var2); -+ -+ if (var4) { -+ if (var3 > 0) { -+ par1Entity.addVelocity((double)(-MathHelper.sin(this.rotationYaw * (float)Math.PI / 180.0F) * (float)var3 * 0.5F), 0.1D, (double)(MathHelper.cos(this.rotationYaw * (float)Math.PI / 180.0F) * (float)var3 * 0.5F)); - this.motionX *= 0.6D; - this.motionZ *= 0.6D; - } - - int var5 = EnchantmentHelper.getFireAspectModifier(this); -- if(var5 > 0) { -- var1.setFire(var5 * 4); -+ -+ if (var5 > 0) { -+ par1Entity.setFire(var5 * 4); - } - -- if(var1 instanceof EntityLivingBase) { -- EnchantmentThorns.func_92096_a(this, (EntityLivingBase)var1, this.ab); -+ if (par1Entity instanceof EntityLivingBase) { -+ EnchantmentThorns.func_92096_a(this, (EntityLivingBase)par1Entity, this.rand); - } - } - - return var4; - } - -- protected void attackEntity(Entity var1, float var2) { -- if(this.attackTime <= 0 && var2 < 2.0F && var1.boundingBox.maxY > this.boundingBox.minY && var1.boundingBox.minY < this.boundingBox.maxY) { -+ /** -+ * Basic mob attack. Default to touch of death in EntityCreature. Overridden by each mob to define their attack. -+ */ -+ protected void attackEntity(Entity par1Entity, float par2) { -+ if (this.attackTime <= 0 && par2 < 2.0F && par1Entity.boundingBox.maxY > this.boundingBox.minY && par1Entity.boundingBox.minY < this.boundingBox.maxY) { - this.attackTime = 20; -- this.attackEntityAsMob(var1); -+ this.attackEntityAsMob(par1Entity); - } -- -- } -- -- public float getBlockPathWeight(int var1, int var2, int var3) { -- return 0.5F - this.worldObj.getLightBrightness(var1, var2, var3); -- } -- -+ } -+ -+ /** -+ * Takes a coordinate in and returns a weight to determine how likely this creature will try to path to the block. -+ * Args: x, y, z -+ */ -+ public float getBlockPathWeight(int par1, int par2, int par3) { -+ return 0.5F - this.worldObj.getLightBrightness(par1, par2, par3); -+ } -+ -+ /** -+ * Checks to make sure the light is not too bright where the mob is spawning -+ */ - protected boolean isValidLightLevel() { - int var1 = MathHelper.floor_double(this.posX); - int var2 = MathHelper.floor_double(this.boundingBox.minY); - int var3 = MathHelper.floor_double(this.posZ); -- if(this.worldObj.getSavedLightValue(EnumSkyBlock.Sky, var1, var2, var3) > this.ab.nextInt(32)) { -+ -+ if (this.worldObj.getSavedLightValue(EnumSkyBlock.Sky, var1, var2, var3) > this.rand.nextInt(32)) { - return false; - } else { - int var4 = this.worldObj.getBlockLightValue(var1, var2, var3); -- if(this.worldObj.isThundering()) { -+ -+ if (this.worldObj.isThundering()) { - int var5 = this.worldObj.skylightSubtracted; - this.worldObj.skylightSubtracted = 10; - var4 = this.worldObj.getBlockLightValue(var1, var2, var3); - this.worldObj.skylightSubtracted = var5; - } - -- return var4 <= this.ab.nextInt(8); -+ return var4 <= this.rand.nextInt(8); - } - } - -+ /** -+ * Checks if the entity's current position is a valid location to spawn this entity. -+ */ - public boolean getCanSpawnHere() { - return this.worldObj.difficultySetting > 0 && this.isValidLightLevel() && super.getCanSpawnHere(); - } ---- net/minecraft/src/BlockFlower.java -+++ net/minecraft/src/BlockFlower.java -@@ -3,59 +3,89 @@ - import java.util.Random; - - public class BlockFlower extends Block { -- protected BlockFlower(int var1, Material var2) { -- super(var1, var2); -+ protected BlockFlower(int par1, Material par2Material) { -+ super(par1, par2Material); - this.setTickRandomly(true); - float var3 = 0.2F; - this.setBlockBounds(0.5F - var3, 0.0F, 0.5F - var3, 0.5F + var3, var3 * 3.0F, 0.5F + var3); - this.setCreativeTab(CreativeTabs.tabDecorations); - } - -- protected BlockFlower(int var1) { -- this(var1, Material.plants); -- } -- -- public boolean canPlaceBlockAt(World var1, int var2, int var3, int var4) { -- return super.canPlaceBlockAt(var1, var2, var3, var4) && this.canThisPlantGrowOnThisBlockID(var1.getBlockId(var2, var3 - 1, var4)); -- } -- -- protected boolean canThisPlantGrowOnThisBlockID(int var1) { -- return var1 == Block.grass.blockID || var1 == Block.dirt.blockID || var1 == Block.tilledField.blockID; -- } -- -- public void onNeighborBlockChange(World var1, int var2, int var3, int var4, int var5) { -- super.onNeighborBlockChange(var1, var2, var3, var4, var5); -- this.checkFlowerChange(var1, var2, var3, var4); -- } -- -- public void updateTick(World var1, int var2, int var3, int var4, Random var5) { -- this.checkFlowerChange(var1, var2, var3, var4); -- } -- -- protected final void checkFlowerChange(World var1, int var2, int var3, int var4) { -- if(!this.canBlockStay(var1, var2, var3, var4)) { -- this.dropBlockAsItem(var1, var2, var3, var4, var1.getBlockMetadata(var2, var3, var4), 0); -- var1.setBlock(var2, var3, var4, 0, 0, 2); -+ protected BlockFlower(int par1) { -+ this(par1, Material.plants); -+ } -+ -+ /** -+ * Checks to see if its valid to put this block at the specified coordinates. Args: world, x, y, z -+ */ -+ public boolean canPlaceBlockAt(World par1World, int par2, int par3, int par4) { -+ return super.canPlaceBlockAt(par1World, par2, par3, par4) && this.canThisPlantGrowOnThisBlockID(par1World.getBlockId(par2, par3 - 1, par4)); -+ } -+ -+ /** -+ * Gets passed in the blockID of the block below and supposed to return true if its allowed to grow on the type of -+ * blockID passed in. Args: blockID -+ */ -+ protected boolean canThisPlantGrowOnThisBlockID(int par1) { -+ return par1 == Block.grass.blockID || par1 == Block.dirt.blockID || par1 == Block.tilledField.blockID; -+ } -+ -+ /** -+ * Lets the block know when one of its neighbor changes. Doesn't know which neighbor changed (coordinates passed are -+ * their own) Args: x, y, z, neighbor blockID -+ */ -+ public void onNeighborBlockChange(World par1World, int par2, int par3, int par4, int par5) { -+ super.onNeighborBlockChange(par1World, par2, par3, par4, par5); -+ this.checkFlowerChange(par1World, par2, par3, par4); -+ } -+ -+ /** -+ * Ticks the block if it's been scheduled -+ */ -+ public void updateTick(World par1World, int par2, int par3, int par4, Random par5Random) { -+ this.checkFlowerChange(par1World, par2, par3, par4); -+ } -+ -+ protected final void checkFlowerChange(World par1World, int par2, int par3, int par4) { -+ if (!this.canBlockStay(par1World, par2, par3, par4)) { -+ this.dropBlockAsItem(par1World, par2, par3, par4, par1World.getBlockMetadata(par2, par3, par4), 0); -+ par1World.setBlock(par2, par3, par4, 0, 0, 2); - } -- -- } -- -- public boolean canBlockStay(World var1, int var2, int var3, int var4) { -- return (var1.getFullBlockLightValue(var2, var3, var4) >= 8 || var1.canBlockSeeTheSky(var2, var3, var4)) && this.canThisPlantGrowOnThisBlockID(var1.getBlockId(var2, var3 - 1, var4)); -- } -- -- public AxisAlignedBB getCollisionBoundingBoxFromPool(World var1, int var2, int var3, int var4) { -+ } -+ -+ /** -+ * Can this block stay at this position. Similar to canPlaceBlockAt except gets checked often with plants. -+ */ -+ public boolean canBlockStay(World par1World, int par2, int par3, int par4) { -+ return (par1World.getFullBlockLightValue(par2, par3, par4) >= 8 || par1World.canBlockSeeTheSky(par2, par3, par4)) && this.canThisPlantGrowOnThisBlockID(par1World.getBlockId(par2, par3 - 1, par4)); -+ } -+ -+ /** -+ * Returns a bounding box from the pool of bounding boxes (this means this box can change after the pool has been -+ * cleared to be reused) -+ */ -+ public AxisAlignedBB getCollisionBoundingBoxFromPool(World par1World, int par2, int par3, int par4) { - return null; - } - -+ /** -+ * Is this block (a) opaque and (b) a full 1m cube? This determines whether or not to render the shared face of two -+ * adjacent blocks and also whether the player can attach torches, redstone wire, etc to this block. -+ */ - public boolean isOpaqueCube() { - return false; - } - -+ /** -+ * If this block doesn't render as an ordinary block it will return False (examples: signs, buttons, stairs, etc) -+ */ - public boolean renderAsNormalBlock() { - return false; - } - -+ /** -+ * The type of render function that is called for this block -+ */ - public int getRenderType() { - return 1; - } ---- net/minecraft/src/Packet104WindowItems.java -+++ net/minecraft/src/Packet104WindowItems.java -@@ -6,48 +6,62 @@ - import java.util.List; - - public class Packet104WindowItems extends Packet { -+ -+ /** -+ * The id of window which items are being sent for. 0 for player inventory. -+ */ - public int windowId; -+ -+ /** Stack of items */ - public ItemStack[] itemStack; - -- public Packet104WindowItems() { -- } -- -- public Packet104WindowItems(int var1, List var2) { -- this.windowId = var1; -- this.itemStack = new ItemStack[var2.size()]; -- -- for(int var3 = 0; var3 < this.itemStack.length; ++var3) { -- ItemStack var4 = (ItemStack)var2.get(var3); -+ public Packet104WindowItems() {} -+ -+ public Packet104WindowItems(int par1, List par2List) { -+ this.windowId = par1; -+ this.itemStack = new ItemStack[par2List.size()]; -+ -+ for (int var3 = 0; var3 < this.itemStack.length; ++var3) { -+ ItemStack var4 = (ItemStack)par2List.get(var3); - this.itemStack[var3] = var4 == null ? null : var4.copy(); - } -- - } - -- public void readPacketData(DataInput var1) throws IOException { -- this.windowId = var1.readByte(); -- short var2 = var1.readShort(); -+ /** -+ * Abstract. Reads the raw packet data from the data stream. -+ */ -+ public void readPacketData(DataInput par1DataInput) throws IOException { -+ this.windowId = par1DataInput.readByte(); -+ short var2 = par1DataInput.readShort(); - this.itemStack = new ItemStack[var2]; - -- for(int var3 = 0; var3 < var2; ++var3) { -- this.itemStack[var3] = readItemStack(var1); -- } -- -- } -- -- public void writePacketData(DataOutput var1) throws IOException { -- var1.writeByte(this.windowId); -- var1.writeShort(this.itemStack.length); -- -- for(int var2 = 0; var2 < this.itemStack.length; ++var2) { -- writeItemStack(this.itemStack[var2], var1); -- } -- -- } -- -- public void processPacket(NetHandler var1) { -- var1.handleWindowItems(this); -- } -- -+ for (int var3 = 0; var3 < var2; ++var3) { -+ this.itemStack[var3] = readItemStack(par1DataInput); -+ } -+ } -+ -+ /** -+ * Abstract. Writes the raw packet data to the data stream. -+ */ -+ public void writePacketData(DataOutput par1DataOutput) throws IOException { -+ par1DataOutput.writeByte(this.windowId); -+ par1DataOutput.writeShort(this.itemStack.length); -+ -+ for (int var2 = 0; var2 < this.itemStack.length; ++var2) { -+ writeItemStack(this.itemStack[var2], par1DataOutput); -+ } -+ } -+ -+ /** -+ * Passes this Packet on to the NetHandler for processing. -+ */ -+ public void processPacket(NetHandler par1NetHandler) { -+ par1NetHandler.handleWindowItems(this); -+ } -+ -+ /** -+ * Abstract. Return the size of the packet (not counting the header). -+ */ - public int getPacketSize() { - return 3 + this.itemStack.length * 5; - } ---- net/minecraft/src/CallableBlockDataValue.java -+++ net/minecraft/src/CallableBlockDataValue.java -@@ -5,16 +5,16 @@ - final class CallableBlockDataValue implements Callable { - final int field_85063_a; - -- CallableBlockDataValue(int var1) { -- this.field_85063_a = var1; -+ CallableBlockDataValue(int par1) { -+ this.field_85063_a = par1; - } - - public String callBlockDataValue() { -- if(this.field_85063_a < 0) { -+ if (this.field_85063_a < 0) { - return "Unknown? (Got " + this.field_85063_a + ")"; - } else { -- String var1 = String.format("%4s", new Object[]{Integer.toBinaryString(this.field_85063_a)}).replace(" ", "0"); -- return String.format("%1$d / 0x%1$X / 0b%2$s", new Object[]{Integer.valueOf(this.field_85063_a), var1}); -+ String var1 = String.format("%4s", new Object[] {Integer.toBinaryString(this.field_85063_a)}).replace(" ", "0"); -+ return String.format("%1$d / 0x%1$X / 0b%2$s", new Object[] {Integer.valueOf(this.field_85063_a), var1}); - } - } - ---- net/minecraft/src/CallableMinecraftVersion.java -+++ net/minecraft/src/CallableMinecraftVersion.java -@@ -3,12 +3,17 @@ - import java.util.concurrent.Callable; - - class CallableMinecraftVersion implements Callable { -+ -+ /** Reference to the CrashReport object. */ - final CrashReport theCrashReport; - -- CallableMinecraftVersion(CrashReport var1) { -- this.theCrashReport = var1; -+ CallableMinecraftVersion(CrashReport par1CrashReport) { -+ this.theCrashReport = par1CrashReport; - } - -+ /** -+ * The current version of Minecraft -+ */ - public String minecraftVersion() { - return "1.6.4"; - } ---- net/minecraft/src/ScoreObjectiveCriteria.java -+++ net/minecraft/src/ScoreObjectiveCriteria.java -@@ -5,7 +5,7 @@ - import java.util.Map; - - public interface ScoreObjectiveCriteria { -- Map a = new HashMap(); -+ Map field_96643_a = new HashMap(); - ScoreObjectiveCriteria field_96641_b = new ScoreDummyCriteria("dummy"); - ScoreObjectiveCriteria deathCount = new ScoreDummyCriteria("deathCount"); - ScoreObjectiveCriteria playerKillCount = new ScoreDummyCriteria("playerKillCount"); ---- net/minecraft/src/ScheduledSound.java -+++ net/minecraft/src/ScheduledSound.java -@@ -1,7 +1,7 @@ - package net.minecraft.src; - - class ScheduledSound { -- String a; -+ String field_92069_a; - float field_92067_b; - float field_92068_c; - float field_92065_d; -@@ -9,13 +9,13 @@ - float field_92063_f; - int field_92064_g; - -- public ScheduledSound(String var1, float var2, float var3, float var4, float var5, float var6, int var7) { -- this.a = var1; -- this.field_92067_b = var2; -- this.field_92068_c = var3; -- this.field_92065_d = var4; -- this.field_92066_e = var5; -- this.field_92063_f = var6; -- this.field_92064_g = var7; -+ public ScheduledSound(String par1Str, float par2, float par3, float par4, float par5, float par6, int par7) { -+ this.field_92069_a = par1Str; -+ this.field_92067_b = par2; -+ this.field_92068_c = par3; -+ this.field_92065_d = par4; -+ this.field_92066_e = par5; -+ this.field_92063_f = par6; -+ this.field_92064_g = par7; - } - } ---- net/minecraft/src/ComponentStrongholdCrossing.java -+++ net/minecraft/src/ComponentStrongholdCrossing.java -@@ -9,105 +9,113 @@ - private boolean field_74995_d; - private boolean field_74999_h; - -- public ComponentStrongholdCrossing() { -- } -- -- public ComponentStrongholdCrossing(int var1, Random var2, StructureBoundingBox var3, int var4) { -- super(var1); -- this.coordBaseMode = var4; -- this.field_143013_d = this.getRandomDoor(var2); -- this.boundingBox = var3; -- this.field_74996_b = var2.nextBoolean(); -- this.field_74997_c = var2.nextBoolean(); -- this.field_74995_d = var2.nextBoolean(); -- this.field_74999_h = var2.nextInt(3) > 0; -- } -- -- protected void func_143012_a(NBTTagCompound var1) { -- super.func_143012_a(var1); -- var1.setBoolean("leftLow", this.field_74996_b); -- var1.setBoolean("leftHigh", this.field_74997_c); -- var1.setBoolean("rightLow", this.field_74995_d); -- var1.setBoolean("rightHigh", this.field_74999_h); -- } -- -- protected void func_143011_b(NBTTagCompound var1) { -- super.func_143011_b(var1); -- this.field_74996_b = var1.getBoolean("leftLow"); -- this.field_74997_c = var1.getBoolean("leftHigh"); -- this.field_74995_d = var1.getBoolean("rightLow"); -- this.field_74999_h = var1.getBoolean("rightHigh"); -- } -- -- public void buildComponent(StructureComponent var1, List var2, Random var3) { -+ public ComponentStrongholdCrossing() {} -+ -+ public ComponentStrongholdCrossing(int par1, Random par2Random, StructureBoundingBox par3StructureBoundingBox, int par4) { -+ super(par1); -+ this.coordBaseMode = par4; -+ this.field_143013_d = this.getRandomDoor(par2Random); -+ this.boundingBox = par3StructureBoundingBox; -+ this.field_74996_b = par2Random.nextBoolean(); -+ this.field_74997_c = par2Random.nextBoolean(); -+ this.field_74995_d = par2Random.nextBoolean(); -+ this.field_74999_h = par2Random.nextInt(3) > 0; -+ } -+ -+ protected void func_143012_a(NBTTagCompound par1NBTTagCompound) { -+ super.func_143012_a(par1NBTTagCompound); -+ par1NBTTagCompound.setBoolean("leftLow", this.field_74996_b); -+ par1NBTTagCompound.setBoolean("leftHigh", this.field_74997_c); -+ par1NBTTagCompound.setBoolean("rightLow", this.field_74995_d); -+ par1NBTTagCompound.setBoolean("rightHigh", this.field_74999_h); -+ } -+ -+ protected void func_143011_b(NBTTagCompound par1NBTTagCompound) { -+ super.func_143011_b(par1NBTTagCompound); -+ this.field_74996_b = par1NBTTagCompound.getBoolean("leftLow"); -+ this.field_74997_c = par1NBTTagCompound.getBoolean("leftHigh"); -+ this.field_74995_d = par1NBTTagCompound.getBoolean("rightLow"); -+ this.field_74999_h = par1NBTTagCompound.getBoolean("rightHigh"); -+ } -+ -+ /** -+ * Initiates construction of the Structure Component picked, at the current Location of StructGen -+ */ -+ public void buildComponent(StructureComponent par1StructureComponent, List par2List, Random par3Random) { - int var4 = 3; - int var5 = 5; -- if(this.coordBaseMode == 1 || this.coordBaseMode == 2) { -+ -+ if (this.coordBaseMode == 1 || this.coordBaseMode == 2) { - var4 = 8 - var4; - var5 = 8 - var5; - } - -- this.getNextComponentNormal((ComponentStrongholdStairs2)var1, var2, var3, 5, 1); -- if(this.field_74996_b) { -- this.getNextComponentX((ComponentStrongholdStairs2)var1, var2, var3, var4, 1); -- } -- -- if(this.field_74997_c) { -- this.getNextComponentX((ComponentStrongholdStairs2)var1, var2, var3, var5, 7); -- } -- -- if(this.field_74995_d) { -- this.getNextComponentZ((ComponentStrongholdStairs2)var1, var2, var3, var4, 1); -- } -- -- if(this.field_74999_h) { -- this.getNextComponentZ((ComponentStrongholdStairs2)var1, var2, var3, var5, 7); -- } -- -- } -- -- public static ComponentStrongholdCrossing findValidPlacement(List var0, Random var1, int var2, int var3, int var4, int var5, int var6) { -- StructureBoundingBox var7 = StructureBoundingBox.getComponentToAddBoundingBox(var2, var3, var4, -4, -3, 0, 10, 9, 11, var5); -- return canStrongholdGoDeeper(var7) && StructureComponent.findIntersecting(var0, var7) == null ? new ComponentStrongholdCrossing(var6, var1, var7, var5) : null; -- } -- -- public boolean addComponentParts(World var1, Random var2, StructureBoundingBox var3) { -- if(this.isLiquidInStructureBoundingBox(var1, var3)) { -+ this.getNextComponentNormal((ComponentStrongholdStairs2)par1StructureComponent, par2List, par3Random, 5, 1); -+ -+ if (this.field_74996_b) { -+ this.getNextComponentX((ComponentStrongholdStairs2)par1StructureComponent, par2List, par3Random, var4, 1); -+ } -+ -+ if (this.field_74997_c) { -+ this.getNextComponentX((ComponentStrongholdStairs2)par1StructureComponent, par2List, par3Random, var5, 7); -+ } -+ -+ if (this.field_74995_d) { -+ this.getNextComponentZ((ComponentStrongholdStairs2)par1StructureComponent, par2List, par3Random, var4, 1); -+ } -+ -+ if (this.field_74999_h) { -+ this.getNextComponentZ((ComponentStrongholdStairs2)par1StructureComponent, par2List, par3Random, var5, 7); -+ } -+ } -+ -+ public static ComponentStrongholdCrossing findValidPlacement(List par0List, Random par1Random, int par2, int par3, int par4, int par5, int par6) { -+ StructureBoundingBox var7 = StructureBoundingBox.getComponentToAddBoundingBox(par2, par3, par4, -4, -3, 0, 10, 9, 11, par5); -+ return canStrongholdGoDeeper(var7) && StructureComponent.findIntersecting(par0List, var7) == null ? new ComponentStrongholdCrossing(par6, par1Random, var7, par5) : null; -+ } -+ -+ /** -+ * second Part of Structure generating, this for example places Spiderwebs, Mob Spawners, it closes Mineshafts at the -+ * end, it adds Fences... -+ */ -+ public boolean addComponentParts(World par1World, Random par2Random, StructureBoundingBox par3StructureBoundingBox) { -+ if (this.isLiquidInStructureBoundingBox(par1World, par3StructureBoundingBox)) { - return false; - } else { -- this.fillWithRandomizedBlocks(var1, var3, 0, 0, 0, 9, 8, 10, true, var2, StructureStrongholdPieces.getStrongholdStones()); -- this.placeDoor(var1, var2, var3, this.field_143013_d, 4, 3, 0); -- if(this.field_74996_b) { -- this.fillWithBlocks(var1, var3, 0, 3, 1, 0, 5, 3, 0, 0, false); -- } -- -- if(this.field_74995_d) { -- this.fillWithBlocks(var1, var3, 9, 3, 1, 9, 5, 3, 0, 0, false); -- } -- -- if(this.field_74997_c) { -- this.fillWithBlocks(var1, var3, 0, 5, 7, 0, 7, 9, 0, 0, false); -- } -- -- if(this.field_74999_h) { -- this.fillWithBlocks(var1, var3, 9, 5, 7, 9, 7, 9, 0, 0, false); -- } -- -- this.fillWithBlocks(var1, var3, 5, 1, 10, 7, 3, 10, 0, 0, false); -- this.fillWithRandomizedBlocks(var1, var3, 1, 2, 1, 8, 2, 6, false, var2, StructureStrongholdPieces.getStrongholdStones()); -- this.fillWithRandomizedBlocks(var1, var3, 4, 1, 5, 4, 4, 9, false, var2, StructureStrongholdPieces.getStrongholdStones()); -- this.fillWithRandomizedBlocks(var1, var3, 8, 1, 5, 8, 4, 9, false, var2, StructureStrongholdPieces.getStrongholdStones()); -- this.fillWithRandomizedBlocks(var1, var3, 1, 4, 7, 3, 4, 9, false, var2, StructureStrongholdPieces.getStrongholdStones()); -- this.fillWithRandomizedBlocks(var1, var3, 1, 3, 5, 3, 3, 6, false, var2, StructureStrongholdPieces.getStrongholdStones()); -- this.fillWithBlocks(var1, var3, 1, 3, 4, 3, 3, 4, Block.stoneSingleSlab.blockID, Block.stoneSingleSlab.blockID, false); -- this.fillWithBlocks(var1, var3, 1, 4, 6, 3, 4, 6, Block.stoneSingleSlab.blockID, Block.stoneSingleSlab.blockID, false); -- this.fillWithRandomizedBlocks(var1, var3, 5, 1, 7, 7, 1, 8, false, var2, StructureStrongholdPieces.getStrongholdStones()); -- this.fillWithBlocks(var1, var3, 5, 1, 9, 7, 1, 9, Block.stoneSingleSlab.blockID, Block.stoneSingleSlab.blockID, false); -- this.fillWithBlocks(var1, var3, 5, 2, 7, 7, 2, 7, Block.stoneSingleSlab.blockID, Block.stoneSingleSlab.blockID, false); -- this.fillWithBlocks(var1, var3, 4, 5, 7, 4, 5, 9, Block.stoneSingleSlab.blockID, Block.stoneSingleSlab.blockID, false); -- this.fillWithBlocks(var1, var3, 8, 5, 7, 8, 5, 9, Block.stoneSingleSlab.blockID, Block.stoneSingleSlab.blockID, false); -- this.fillWithBlocks(var1, var3, 5, 5, 7, 7, 5, 9, Block.stoneDoubleSlab.blockID, Block.stoneDoubleSlab.blockID, false); -- this.placeBlockAtCurrentPosition(var1, Block.torchWood.blockID, 0, 6, 5, 6, var3); -+ this.fillWithRandomizedBlocks(par1World, par3StructureBoundingBox, 0, 0, 0, 9, 8, 10, true, par2Random, StructureStrongholdPieces.getStrongholdStones()); -+ this.placeDoor(par1World, par2Random, par3StructureBoundingBox, this.field_143013_d, 4, 3, 0); -+ -+ if (this.field_74996_b) { -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 0, 3, 1, 0, 5, 3, 0, 0, false); -+ } -+ -+ if (this.field_74995_d) { -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 9, 3, 1, 9, 5, 3, 0, 0, false); -+ } -+ -+ if (this.field_74997_c) { -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 0, 5, 7, 0, 7, 9, 0, 0, false); -+ } -+ -+ if (this.field_74999_h) { -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 9, 5, 7, 9, 7, 9, 0, 0, false); -+ } -+ -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 5, 1, 10, 7, 3, 10, 0, 0, false); -+ this.fillWithRandomizedBlocks(par1World, par3StructureBoundingBox, 1, 2, 1, 8, 2, 6, false, par2Random, StructureStrongholdPieces.getStrongholdStones()); -+ this.fillWithRandomizedBlocks(par1World, par3StructureBoundingBox, 4, 1, 5, 4, 4, 9, false, par2Random, StructureStrongholdPieces.getStrongholdStones()); -+ this.fillWithRandomizedBlocks(par1World, par3StructureBoundingBox, 8, 1, 5, 8, 4, 9, false, par2Random, StructureStrongholdPieces.getStrongholdStones()); -+ this.fillWithRandomizedBlocks(par1World, par3StructureBoundingBox, 1, 4, 7, 3, 4, 9, false, par2Random, StructureStrongholdPieces.getStrongholdStones()); -+ this.fillWithRandomizedBlocks(par1World, par3StructureBoundingBox, 1, 3, 5, 3, 3, 6, false, par2Random, StructureStrongholdPieces.getStrongholdStones()); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 1, 3, 4, 3, 3, 4, Block.stoneSingleSlab.blockID, Block.stoneSingleSlab.blockID, false); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 1, 4, 6, 3, 4, 6, Block.stoneSingleSlab.blockID, Block.stoneSingleSlab.blockID, false); -+ this.fillWithRandomizedBlocks(par1World, par3StructureBoundingBox, 5, 1, 7, 7, 1, 8, false, par2Random, StructureStrongholdPieces.getStrongholdStones()); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 5, 1, 9, 7, 1, 9, Block.stoneSingleSlab.blockID, Block.stoneSingleSlab.blockID, false); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 5, 2, 7, 7, 2, 7, Block.stoneSingleSlab.blockID, Block.stoneSingleSlab.blockID, false); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 4, 5, 7, 4, 5, 9, Block.stoneSingleSlab.blockID, Block.stoneSingleSlab.blockID, false); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 8, 5, 7, 8, 5, 9, Block.stoneSingleSlab.blockID, Block.stoneSingleSlab.blockID, false); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 5, 5, 7, 7, 5, 9, Block.stoneDoubleSlab.blockID, Block.stoneDoubleSlab.blockID, false); -+ this.placeBlockAtCurrentPosition(par1World, Block.torchWood.blockID, 0, 6, 5, 6, par3StructureBoundingBox); - return true; - } - } ---- net/minecraft/src/InventoryEnderChest.java -+++ net/minecraft/src/InventoryEnderChest.java -@@ -7,32 +7,34 @@ - super("container.enderchest", false, 27); - } - -- public void setAssociatedChest(TileEntityEnderChest var1) { -- this.associatedChest = var1; -+ public void setAssociatedChest(TileEntityEnderChest par1TileEntityEnderChest) { -+ this.associatedChest = par1TileEntityEnderChest; - } - -- public void loadInventoryFromNBT(NBTTagList var1) { -+ public void loadInventoryFromNBT(NBTTagList par1NBTTagList) { - int var2; -- for(var2 = 0; var2 < this.getSizeInventory(); ++var2) { -+ -+ for (var2 = 0; var2 < this.getSizeInventory(); ++var2) { - this.setInventorySlotContents(var2, (ItemStack)null); - } - -- for(var2 = 0; var2 < var1.tagCount(); ++var2) { -- NBTTagCompound var3 = (NBTTagCompound)var1.tagAt(var2); -+ for (var2 = 0; var2 < par1NBTTagList.tagCount(); ++var2) { -+ NBTTagCompound var3 = (NBTTagCompound)par1NBTTagList.tagAt(var2); - int var4 = var3.getByte("Slot") & 255; -- if(var4 >= 0 && var4 < this.getSizeInventory()) { -+ -+ if (var4 >= 0 && var4 < this.getSizeInventory()) { - this.setInventorySlotContents(var4, ItemStack.loadItemStackFromNBT(var3)); - } - } -- - } - - public NBTTagList saveInventoryToNBT() { - NBTTagList var1 = new NBTTagList("EnderItems"); - -- for(int var2 = 0; var2 < this.getSizeInventory(); ++var2) { -+ for (int var2 = 0; var2 < this.getSizeInventory(); ++var2) { - ItemStack var3 = this.getStackInSlot(var2); -- if(var3 != null) { -+ -+ if (var3 != null) { - NBTTagCompound var4 = new NBTTagCompound(); - var4.setByte("Slot", (byte)var2); - var3.writeToNBT(var4); -@@ -43,12 +45,15 @@ - return var1; - } - -- public boolean isUseableByPlayer(EntityPlayer var1) { -- return this.associatedChest != null && !this.associatedChest.isUseableByPlayer(var1) ? false : super.isUseableByPlayer(var1); -+ /** -+ * Do not make give this method the name canInteractWith because it clashes with Container -+ */ -+ public boolean isUseableByPlayer(EntityPlayer par1EntityPlayer) { -+ return this.associatedChest != null && !this.associatedChest.isUseableByPlayer(par1EntityPlayer) ? false : super.isUseableByPlayer(par1EntityPlayer); - } - - public void openChest() { -- if(this.associatedChest != null) { -+ if (this.associatedChest != null) { - this.associatedChest.openChest(); - } - -@@ -56,7 +61,7 @@ - } - - public void closeChest() { -- if(this.associatedChest != null) { -+ if (this.associatedChest != null) { - this.associatedChest.closeChest(); - } - -@@ -64,7 +69,10 @@ - this.associatedChest = null; - } - -- public boolean isItemValidForSlot(int var1, ItemStack var2) { -+ /** -+ * Returns true if automation is allowed to insert the given stack (ignoring stack size) into the given slot. -+ */ -+ public boolean isItemValidForSlot(int par1, ItemStack par2ItemStack) { - return true; - } - } ---- net/minecraft/src/Achievement.java -+++ net/minecraft/src/Achievement.java -@@ -1,84 +1,146 @@ - package net.minecraft.src; - - public class Achievement extends StatBase { -+ -+ /** -+ * Is the column (related to center of achievement gui, in 24 pixels unit) that the achievement will be displayed. -+ */ - public final int displayColumn; -+ -+ /** -+ * Is the row (related to center of achievement gui, in 24 pixels unit) that the achievement will be displayed. -+ */ - public final int displayRow; -+ -+ /** -+ * Holds the parent achievement, that must be taken before this achievement is avaiable. -+ */ - public final Achievement parentAchievement; -- private final String l; -+ -+ /** -+ * Holds the description of the achievement, ready to be formatted and/or displayed. -+ */ -+ private final String achievementDescription; -+ -+ /** -+ * Holds a string formatter for the achievement, some of then needs extra dynamic info - like the key used to open the -+ * inventory. -+ */ - private IStatStringFormat statStringFormatter; -+ -+ /** -+ * Holds the ItemStack that will be used to draw the achievement into the GUI. -+ */ - public final ItemStack theItemStack; -+ -+ /** -+ * Special achievements have a 'spiked' (on normal texture pack) frame, special achievements are the hardest ones to -+ * achieve. -+ */ - private boolean isSpecial; - -- public Achievement(int var1, String var2, int var3, int var4, Item var5, Achievement var6) { -- this(var1, var2, var3, var4, new ItemStack(var5), var6); -- } -- -- public Achievement(int var1, String var2, int var3, int var4, Block var5, Achievement var6) { -- this(var1, var2, var3, var4, new ItemStack(var5), var6); -- } -- -- public Achievement(int var1, String var2, int var3, int var4, ItemStack var5, Achievement var6) { -- super(5242880 + var1, "achievement." + var2); -- this.theItemStack = var5; -- this.l = "achievement." + var2 + ".desc"; -- this.displayColumn = var3; -- this.displayRow = var4; -- if(var3 < AchievementList.minDisplayColumn) { -- AchievementList.minDisplayColumn = var3; -- } -- -- if(var4 < AchievementList.minDisplayRow) { -- AchievementList.minDisplayRow = var4; -- } -- -- if(var3 > AchievementList.maxDisplayColumn) { -- AchievementList.maxDisplayColumn = var3; -- } -- -- if(var4 > AchievementList.maxDisplayRow) { -- AchievementList.maxDisplayRow = var4; -- } -- -- this.parentAchievement = var6; -- } -- -+ public Achievement(int par1, String par2Str, int par3, int par4, Item par5Item, Achievement par6Achievement) { -+ this(par1, par2Str, par3, par4, new ItemStack(par5Item), par6Achievement); -+ } -+ -+ public Achievement(int par1, String par2Str, int par3, int par4, Block par5Block, Achievement par6Achievement) { -+ this(par1, par2Str, par3, par4, new ItemStack(par5Block), par6Achievement); -+ } -+ -+ public Achievement(int par1, String par2Str, int par3, int par4, ItemStack par5ItemStack, Achievement par6Achievement) { -+ super(5242880 + par1, "achievement." + par2Str); -+ this.theItemStack = par5ItemStack; -+ this.achievementDescription = "achievement." + par2Str + ".desc"; -+ this.displayColumn = par3; -+ this.displayRow = par4; -+ -+ if (par3 < AchievementList.minDisplayColumn) { -+ AchievementList.minDisplayColumn = par3; -+ } -+ -+ if (par4 < AchievementList.minDisplayRow) { -+ AchievementList.minDisplayRow = par4; -+ } -+ -+ if (par3 > AchievementList.maxDisplayColumn) { -+ AchievementList.maxDisplayColumn = par3; -+ } -+ -+ if (par4 > AchievementList.maxDisplayRow) { -+ AchievementList.maxDisplayRow = par4; -+ } -+ -+ this.parentAchievement = par6Achievement; -+ } -+ -+ /** -+ * Indicates whether or not the given achievement or statistic is independent (i.e., lacks prerequisites for being -+ * update). -+ */ - public Achievement setIndependent() { - this.isIndependent = true; - return this; - } - -+ /** -+ * Special achievements have a 'spiked' (on normal texture pack) frame, special achievements are the hardest ones to -+ * achieve. -+ */ - public Achievement setSpecial() { - this.isSpecial = true; - return this; - } - -+ /** -+ * Adds the achievement on the internal list of registered achievements, also, it's check for duplicated id's. -+ */ - public Achievement registerAchievement() { - super.registerStat(); -- AchievementList.e.add(this); -+ AchievementList.achievementList.add(this); - return this; - } - -+ /** -+ * Returns whether or not the StatBase-derived class is a statistic (running counter) or an achievement (one-shot). -+ */ - public boolean isAchievement() { - return true; - } - -+ /** -+ * Returns the fully description of the achievement - ready to be displayed on screen. -+ */ - public String getDescription() { -- return this.statStringFormatter != null ? this.statStringFormatter.formatString(StatCollector.translateToLocal(this.l)) : StatCollector.translateToLocal(this.l); -+ return this.statStringFormatter != null ? this.statStringFormatter.formatString(StatCollector.translateToLocal(this.achievementDescription)) : StatCollector.translateToLocal(this.achievementDescription); - } - -- public Achievement setStatStringFormatter(IStatStringFormat var1) { -- this.statStringFormatter = var1; -+ /** -+ * Defines a string formatter for the achievement. -+ */ -+ public Achievement setStatStringFormatter(IStatStringFormat par1IStatStringFormat) { -+ this.statStringFormatter = par1IStatStringFormat; - return this; - } - -+ /** -+ * Special achievements have a 'spiked' (on normal texture pack) frame, special achievements are the hardest ones to -+ * achieve. -+ */ - public boolean getSpecial() { - return this.isSpecial; - } - -+ /** -+ * Register the stat into StatList. -+ */ - public StatBase registerStat() { - return this.registerAchievement(); - } - -+ /** -+ * Initializes the current stat as independent (i.e., lacking prerequisites for being updated) and returns the current -+ * instance. -+ */ - public StatBase initIndependentStat() { - return this.setIndependent(); - } ---- /dev/null -+++ com/prupe/mcpatcher/mob/MobRuleList$MobRuleEntry.java -@@ -1,0 +1,112 @@ -+package com.prupe.mcpatcher.mob; -+ -+import com.prupe.mcpatcher.MCPatcherUtils; -+import com.prupe.mcpatcher.WeightedIndex; -+import java.lang.reflect.Method; -+import java.util.BitSet; -+import java.util.Properties; -+ -+class MobRuleList$MobRuleEntry { -+ final int[] skins; -+ final WeightedIndex weightedIndex; -+ private final BitSet biomes; -+ private final int minHeight; -+ private final int maxHeight; -+ -+ static MobRuleList$MobRuleEntry load(Properties properties, int index, int limit) { -+ String skinList = properties.getProperty("skins." + index, "").trim().toLowerCase(); -+ int[] skins; -+ int chooser; -+ -+ if (!skinList.equals("*") && !skinList.equals("all") && !skinList.equals("any")) { -+ skins = MCPatcherUtils.parseIntegerList(skinList, 1, limit); -+ -+ if (skins.length <= 0) { -+ return null; -+ } -+ -+ for (chooser = 0; chooser < skins.length; ++chooser) { -+ --skins[chooser]; -+ } -+ } else { -+ skins = new int[limit]; -+ -+ for (chooser = 0; chooser < skins.length; skins[chooser] = chooser++) { -+ ; -+ } -+ } -+ -+ WeightedIndex var11 = WeightedIndex.create(skins.length, properties.getProperty("weights." + index, "")); -+ -+ if (var11 == null) { -+ return null; -+ } else { -+ String biomeList = MCPatcherUtils.getStringProperty(properties, "biomes." + index, ""); -+ BitSet biomes; -+ -+ if (biomeList.isEmpty()) { -+ biomes = null; -+ } else { -+ biomes = new BitSet(); -+ -+ if (MobRuleList.access$000() != null) { -+ try { -+ MobRuleList.access$000().invoke((Object)null, new Object[] {biomeList, biomes}); -+ } catch (Throwable var10) { -+ var10.printStackTrace(); -+ MobRuleList.access$002((Method)null); -+ } -+ } -+ } -+ -+ int minHeight = MCPatcherUtils.getIntProperty(properties, "minHeight." + index, -1); -+ int maxHeight = MCPatcherUtils.getIntProperty(properties, "maxHeight." + index, Integer.MAX_VALUE); -+ -+ if (minHeight < 0 || minHeight > maxHeight) { -+ minHeight = -1; -+ maxHeight = Integer.MAX_VALUE; -+ } -+ -+ return new MobRuleList$MobRuleEntry(skins, var11, biomes, minHeight, maxHeight); -+ } -+ } -+ -+ MobRuleList$MobRuleEntry(int[] skins, WeightedIndex weightedIndex, BitSet biomes, int minHeight, int maxHeight) { -+ this.skins = skins; -+ this.weightedIndex = weightedIndex; -+ this.biomes = biomes; -+ this.minHeight = minHeight; -+ this.maxHeight = maxHeight; -+ } -+ -+ boolean match(int i, int j, int k, Integer biome) { -+ return this.biomes != null && (biome == null || !this.biomes.get(biome.intValue())) ? false : this.minHeight < 0 || j >= this.minHeight && j <= this.maxHeight; -+ } -+ -+ public String toString() { -+ StringBuilder sb = new StringBuilder(); -+ sb.append("skins:"); -+ int[] i = this.skins; -+ int len$ = i.length; -+ -+ for (int i$ = 0; i$ < len$; ++i$) { -+ int i1 = i[i$]; -+ sb.append(' ').append(i1 + 1); -+ } -+ -+ if (this.biomes != null) { -+ sb.append(", biomes:"); -+ -+ for (int var6 = this.biomes.nextSetBit(0); var6 >= 0; var6 = this.biomes.nextSetBit(var6 + 1)) { -+ sb.append(' ').append(var6); -+ } -+ } -+ -+ if (this.minHeight >= 0) { -+ sb.append(", height: ").append(this.minHeight).append('-').append(this.maxHeight); -+ } -+ -+ sb.append(", weights: ").append(this.weightedIndex.toString()); -+ return sb.toString(); -+ } -+} ---- net/minecraft/src/BlockCocoa.java -+++ net/minecraft/src/BlockCocoa.java -@@ -5,143 +5,196 @@ - public class BlockCocoa extends BlockDirectional { - private Icon[] iconArray; - -- public BlockCocoa(int var1) { -- super(var1, Material.plants); -+ public BlockCocoa(int par1) { -+ super(par1, Material.plants); - this.setTickRandomly(true); - } - -- public Icon getIcon(int var1, int var2) { -+ /** -+ * From the specified side and block metadata retrieves the blocks texture. Args: side, metadata -+ */ -+ public Icon getIcon(int par1, int par2) { - return this.iconArray[2]; - } - -- public Icon getCocoaIcon(int var1) { -- if(var1 < 0 || var1 >= this.iconArray.length) { -- var1 = this.iconArray.length - 1; -+ public Icon getCocoaIcon(int par1) { -+ if (par1 < 0 || par1 >= this.iconArray.length) { -+ par1 = this.iconArray.length - 1; - } - -- return this.iconArray[var1]; -+ return this.iconArray[par1]; - } - -- public void updateTick(World var1, int var2, int var3, int var4, Random var5) { -- if(!this.canBlockStay(var1, var2, var3, var4)) { -- this.dropBlockAsItem(var1, var2, var3, var4, var1.getBlockMetadata(var2, var3, var4), 0); -- var1.setBlock(var2, var3, var4, 0, 0, 2); -- } else if(var1.s.nextInt(5) == 0) { -- int var6 = var1.getBlockMetadata(var2, var3, var4); -+ /** -+ * Ticks the block if it's been scheduled -+ */ -+ public void updateTick(World par1World, int par2, int par3, int par4, Random par5Random) { -+ if (!this.canBlockStay(par1World, par2, par3, par4)) { -+ this.dropBlockAsItem(par1World, par2, par3, par4, par1World.getBlockMetadata(par2, par3, par4), 0); -+ par1World.setBlock(par2, par3, par4, 0, 0, 2); -+ } else if (par1World.rand.nextInt(5) == 0) { -+ int var6 = par1World.getBlockMetadata(par2, par3, par4); - int var7 = func_72219_c(var6); -- if(var7 < 2) { -+ -+ if (var7 < 2) { - ++var7; -- var1.setBlockMetadata(var2, var3, var4, var7 << 2 | getDirection(var6), 2); -+ par1World.setBlockMetadataWithNotify(par2, par3, par4, var7 << 2 | getDirection(var6), 2); - } - } -- -- } -- -- public boolean canBlockStay(World var1, int var2, int var3, int var4) { -- int var5 = getDirection(var1.getBlockMetadata(var2, var3, var4)); -- var2 += Direction.offsetX[var5]; -- var4 += Direction.offsetZ[var5]; -- int var6 = var1.getBlockId(var2, var3, var4); -- return var6 == Block.wood.blockID && BlockLog.limitToValidMetadata(var1.getBlockMetadata(var2, var3, var4)) == 3; -- } -- -+ } -+ -+ /** -+ * Can this block stay at this position. Similar to canPlaceBlockAt except gets checked often with plants. -+ */ -+ public boolean canBlockStay(World par1World, int par2, int par3, int par4) { -+ int var5 = getDirection(par1World.getBlockMetadata(par2, par3, par4)); -+ par2 += Direction.offsetX[var5]; -+ par4 += Direction.offsetZ[var5]; -+ int var6 = par1World.getBlockId(par2, par3, par4); -+ return var6 == Block.wood.blockID && BlockLog.limitToValidMetadata(par1World.getBlockMetadata(par2, par3, par4)) == 3; -+ } -+ -+ /** -+ * The type of render function that is called for this block -+ */ - public int getRenderType() { - return 28; - } - -+ /** -+ * If this block doesn't render as an ordinary block it will return False (examples: signs, buttons, stairs, etc) -+ */ - public boolean renderAsNormalBlock() { - return false; - } - -+ /** -+ * Is this block (a) opaque and (b) a full 1m cube? This determines whether or not to render the shared face of two -+ * adjacent blocks and also whether the player can attach torches, redstone wire, etc to this block. -+ */ - public boolean isOpaqueCube() { - return false; - } - -- public AxisAlignedBB getCollisionBoundingBoxFromPool(World var1, int var2, int var3, int var4) { -- this.setBlockBoundsBasedOnState(var1, var2, var3, var4); -- return super.getCollisionBoundingBoxFromPool(var1, var2, var3, var4); -- } -- -- public AxisAlignedBB getSelectedBoundingBoxFromPool(World var1, int var2, int var3, int var4) { -- this.setBlockBoundsBasedOnState(var1, var2, var3, var4); -- return super.getSelectedBoundingBoxFromPool(var1, var2, var3, var4); -- } -- -- public void setBlockBoundsBasedOnState(IBlockAccess var1, int var2, int var3, int var4) { -- int var5 = var1.getBlockMetadata(var2, var3, var4); -+ /** -+ * Returns a bounding box from the pool of bounding boxes (this means this box can change after the pool has been -+ * cleared to be reused) -+ */ -+ public AxisAlignedBB getCollisionBoundingBoxFromPool(World par1World, int par2, int par3, int par4) { -+ this.setBlockBoundsBasedOnState(par1World, par2, par3, par4); -+ return super.getCollisionBoundingBoxFromPool(par1World, par2, par3, par4); -+ } -+ -+ /** -+ * Returns the bounding box of the wired rectangular prism to render. -+ */ -+ public AxisAlignedBB getSelectedBoundingBoxFromPool(World par1World, int par2, int par3, int par4) { -+ this.setBlockBoundsBasedOnState(par1World, par2, par3, par4); -+ return super.getSelectedBoundingBoxFromPool(par1World, par2, par3, par4); -+ } -+ -+ /** -+ * Updates the blocks bounds based on its current state. Args: world, x, y, z -+ */ -+ public void setBlockBoundsBasedOnState(IBlockAccess par1IBlockAccess, int par2, int par3, int par4) { -+ int var5 = par1IBlockAccess.getBlockMetadata(par2, par3, par4); - int var6 = getDirection(var5); - int var7 = func_72219_c(var5); - int var8 = 4 + var7 * 2; - int var9 = 5 + var7 * 2; - float var10 = (float)var8 / 2.0F; -- switch(var6) { -- case 0: -- this.setBlockBounds((8.0F - var10) / 16.0F, (12.0F - (float)var9) / 16.0F, (15.0F - (float)var8) / 16.0F, (8.0F + var10) / 16.0F, 12.0F / 16.0F, 15.0F / 16.0F); -- break; -- case 1: -- this.setBlockBounds(1.0F / 16.0F, (12.0F - (float)var9) / 16.0F, (8.0F - var10) / 16.0F, (1.0F + (float)var8) / 16.0F, 12.0F / 16.0F, (8.0F + var10) / 16.0F); -- break; -- case 2: -- this.setBlockBounds((8.0F - var10) / 16.0F, (12.0F - (float)var9) / 16.0F, 1.0F / 16.0F, (8.0F + var10) / 16.0F, 12.0F / 16.0F, (1.0F + (float)var8) / 16.0F); -- break; -- case 3: -- this.setBlockBounds((15.0F - (float)var8) / 16.0F, (12.0F - (float)var9) / 16.0F, (8.0F - var10) / 16.0F, 15.0F / 16.0F, 12.0F / 16.0F, (8.0F + var10) / 16.0F); -- } -- -- } -- -- public void onBlockPlacedBy(World var1, int var2, int var3, int var4, EntityLivingBase var5, ItemStack var6) { -- int var7 = ((MathHelper.floor_double((double)(var5.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3) + 0) % 4; -- var1.setBlockMetadata(var2, var3, var4, var7, 2); -- } -- -- public int onBlockPlaced(World var1, int var2, int var3, int var4, int var5, float var6, float var7, float var8, int var9) { -- if(var5 == 1 || var5 == 0) { -- var5 = 2; -- } -- -- return Direction.rotateOpposite[Direction.facingToDirection[var5]]; -- } -- -- public void onNeighborBlockChange(World var1, int var2, int var3, int var4, int var5) { -- if(!this.canBlockStay(var1, var2, var3, var4)) { -- this.dropBlockAsItem(var1, var2, var3, var4, var1.getBlockMetadata(var2, var3, var4), 0); -- var1.setBlock(var2, var3, var4, 0, 0, 2); -- } -- -- } -- -- public static int func_72219_c(int var0) { -- return (var0 & 12) >> 2; -- } -- -- public void dropBlockAsItemWithChance(World var1, int var2, int var3, int var4, int var5, float var6, int var7) { -- int var8 = func_72219_c(var5); -+ -+ switch (var6) { -+ case 0: -+ this.setBlockBounds((8.0F - var10) / 16.0F, (12.0F - (float)var9) / 16.0F, (15.0F - (float)var8) / 16.0F, (8.0F + var10) / 16.0F, 0.75F, 0.9375F); -+ break; -+ -+ case 1: -+ this.setBlockBounds(0.0625F, (12.0F - (float)var9) / 16.0F, (8.0F - var10) / 16.0F, (1.0F + (float)var8) / 16.0F, 0.75F, (8.0F + var10) / 16.0F); -+ break; -+ -+ case 2: -+ this.setBlockBounds((8.0F - var10) / 16.0F, (12.0F - (float)var9) / 16.0F, 0.0625F, (8.0F + var10) / 16.0F, 0.75F, (1.0F + (float)var8) / 16.0F); -+ break; -+ -+ case 3: -+ this.setBlockBounds((15.0F - (float)var8) / 16.0F, (12.0F - (float)var9) / 16.0F, (8.0F - var10) / 16.0F, 0.9375F, 0.75F, (8.0F + var10) / 16.0F); -+ } -+ } -+ -+ /** -+ * Called when the block is placed in the world. -+ */ -+ public void onBlockPlacedBy(World par1World, int par2, int par3, int par4, EntityLivingBase par5EntityLivingBase, ItemStack par6ItemStack) { -+ int var7 = ((MathHelper.floor_double((double)(par5EntityLivingBase.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3) + 0) % 4; -+ par1World.setBlockMetadataWithNotify(par2, par3, par4, var7, 2); -+ } -+ -+ /** -+ * Called when a block is placed using its ItemBlock. Args: World, X, Y, Z, side, hitX, hitY, hitZ, block metadata -+ */ -+ public int onBlockPlaced(World par1World, int par2, int par3, int par4, int par5, float par6, float par7, float par8, int par9) { -+ if (par5 == 1 || par5 == 0) { -+ par5 = 2; -+ } -+ -+ return Direction.rotateOpposite[Direction.facingToDirection[par5]]; -+ } -+ -+ /** -+ * Lets the block know when one of its neighbor changes. Doesn't know which neighbor changed (coordinates passed are -+ * their own) Args: x, y, z, neighbor blockID -+ */ -+ public void onNeighborBlockChange(World par1World, int par2, int par3, int par4, int par5) { -+ if (!this.canBlockStay(par1World, par2, par3, par4)) { -+ this.dropBlockAsItem(par1World, par2, par3, par4, par1World.getBlockMetadata(par2, par3, par4), 0); -+ par1World.setBlock(par2, par3, par4, 0, 0, 2); -+ } -+ } -+ -+ public static int func_72219_c(int par0) { -+ return (par0 & 12) >> 2; -+ } -+ -+ /** -+ * Drops the block items with a specified chance of dropping the specified items -+ */ -+ public void dropBlockAsItemWithChance(World par1World, int par2, int par3, int par4, int par5, float par6, int par7) { -+ int var8 = func_72219_c(par5); - byte var9 = 1; -- if(var8 >= 2) { -+ -+ if (var8 >= 2) { - var9 = 3; - } - -- for(int var10 = 0; var10 < var9; ++var10) { -- this.dropBlockAsItem_do(var1, var2, var3, var4, new ItemStack(Item.dyePowder, 1, 3)); -+ for (int var10 = 0; var10 < var9; ++var10) { -+ this.dropBlockAsItem_do(par1World, par2, par3, par4, new ItemStack(Item.dyePowder, 1, 3)); - } -- - } - -- public int idPicked(World var1, int var2, int var3, int var4) { -+ /** -+ * only called by clickMiddleMouseButton , and passed to inventory.setCurrentItem (along with isCreative) -+ */ -+ public int idPicked(World par1World, int par2, int par3, int par4) { - return Item.dyePowder.itemID; - } - -- public int getDamageValue(World var1, int var2, int var3, int var4) { -+ /** -+ * Get the block's damage value (for use with pick block). -+ */ -+ public int getDamageValue(World par1World, int par2, int par3, int par4) { - return 3; - } - -- public void registerIcons(IconRegister var1) { -+ /** -+ * When this method is called, your block should register all the icons it needs with the given IconRegister. This is -+ * the only chance you get to register icons. -+ */ -+ public void registerIcons(IconRegister par1IconRegister) { - this.iconArray = new Icon[3]; - -- for(int var2 = 0; var2 < this.iconArray.length; ++var2) { -- this.iconArray[var2] = var1.registerIcon(this.getTextureName() + "_stage_" + var2); -+ for (int var2 = 0; var2 < this.iconArray.length; ++var2) { -+ this.iconArray[var2] = par1IconRegister.registerIcon(this.getTextureName() + "_stage_" + var2); - } -- - } - } ---- net/minecraft/src/NBTTagFloat.java -+++ net/minecraft/src/NBTTagFloat.java -@@ -5,25 +5,36 @@ - import java.io.IOException; - - public class NBTTagFloat extends NBTBase { -+ -+ /** The float value for the tag. */ - public float data; - -- public NBTTagFloat(String var1) { -- super(var1); -- } -- -- public NBTTagFloat(String var1, float var2) { -- super(var1); -- this.data = var2; -- } -- -- void write(DataOutput var1) throws IOException { -- var1.writeFloat(this.data); -- } -- -- void load(DataInput var1, int var2) throws IOException { -- this.data = var1.readFloat(); -- } -- -+ public NBTTagFloat(String par1Str) { -+ super(par1Str); -+ } -+ -+ public NBTTagFloat(String par1Str, float par2) { -+ super(par1Str); -+ this.data = par2; -+ } -+ -+ /** -+ * Write the actual data contents of the tag, implemented in NBT extension classes -+ */ -+ void write(DataOutput par1DataOutput) throws IOException { -+ par1DataOutput.writeFloat(this.data); -+ } -+ -+ /** -+ * Read the actual data contents of the tag, implemented in NBT extension classes -+ */ -+ void load(DataInput par1DataInput, int par2) throws IOException { -+ this.data = par1DataInput.readFloat(); -+ } -+ -+ /** -+ * Gets the type byte for the tag. -+ */ - public byte getId() { - return (byte)5; - } -@@ -32,13 +43,16 @@ - return "" + this.data; - } - -+ /** -+ * Creates a clone of the tag. -+ */ - public NBTBase copy() { - return new NBTTagFloat(this.getName(), this.data); - } - -- public boolean equals(Object var1) { -- if(super.equals(var1)) { -- NBTTagFloat var2 = (NBTTagFloat)var1; -+ public boolean equals(Object par1Obj) { -+ if (super.equals(par1Obj)) { -+ NBTTagFloat var2 = (NBTTagFloat)par1Obj; - return this.data == var2.data; - } else { - return false; ---- net/minecraft/src/CallableIsModded.java -+++ net/minecraft/src/CallableIsModded.java -@@ -4,15 +4,21 @@ - import net.minecraft.client.ClientBrandRetriever; - - class CallableIsModded implements Callable { -+ -+ /** Reference to the IntegratedServer object. */ - final IntegratedServer theIntegratedServer; - -- CallableIsModded(IntegratedServer var1) { -- this.theIntegratedServer = var1; -+ CallableIsModded(IntegratedServer par1IntegratedServer) { -+ this.theIntegratedServer = par1IntegratedServer; - } - -+ /** -+ * Gets if your Minecraft is Modded. -+ */ - public String getMinecraftIsModded() { - String var1 = ClientBrandRetriever.getClientModName(); -- if(!var1.equals("vanilla")) { -+ -+ if (!var1.equals("vanilla")) { - return "Definitely; Client brand changed to \'" + var1 + "\'"; - } else { - var1 = this.theIntegratedServer.getServerModName(); ---- net/minecraft/src/Packet14BlockDig.java -+++ net/minecraft/src/Packet14BlockDig.java -@@ -5,43 +5,64 @@ - import java.io.IOException; - - public class Packet14BlockDig extends Packet { -+ -+ /** Block X position. */ - public int xPosition; -+ -+ /** Block Y position. */ - public int yPosition; -+ -+ /** Block Z position. */ - public int zPosition; -+ -+ /** Punched face of the block. */ - public int face; -+ -+ /** Status of the digging (started, ongoing, broken). */ - public int status; - -- public Packet14BlockDig() { -- } -- -- public Packet14BlockDig(int var1, int var2, int var3, int var4, int var5) { -- this.status = var1; -- this.xPosition = var2; -- this.yPosition = var3; -- this.zPosition = var4; -- this.face = var5; -- } -- -- public void readPacketData(DataInput var1) throws IOException { -- this.status = var1.readUnsignedByte(); -- this.xPosition = var1.readInt(); -- this.yPosition = var1.readUnsignedByte(); -- this.zPosition = var1.readInt(); -- this.face = var1.readUnsignedByte(); -- } -- -- public void writePacketData(DataOutput var1) throws IOException { -- var1.write(this.status); -- var1.writeInt(this.xPosition); -- var1.write(this.yPosition); -- var1.writeInt(this.zPosition); -- var1.write(this.face); -- } -- -- public void processPacket(NetHandler var1) { -- var1.handleBlockDig(this); -- } -- -+ public Packet14BlockDig() {} -+ -+ public Packet14BlockDig(int par1, int par2, int par3, int par4, int par5) { -+ this.status = par1; -+ this.xPosition = par2; -+ this.yPosition = par3; -+ this.zPosition = par4; -+ this.face = par5; -+ } -+ -+ /** -+ * Abstract. Reads the raw packet data from the data stream. -+ */ -+ public void readPacketData(DataInput par1DataInput) throws IOException { -+ this.status = par1DataInput.readUnsignedByte(); -+ this.xPosition = par1DataInput.readInt(); -+ this.yPosition = par1DataInput.readUnsignedByte(); -+ this.zPosition = par1DataInput.readInt(); -+ this.face = par1DataInput.readUnsignedByte(); -+ } -+ -+ /** -+ * Abstract. Writes the raw packet data to the data stream. -+ */ -+ public void writePacketData(DataOutput par1DataOutput) throws IOException { -+ par1DataOutput.write(this.status); -+ par1DataOutput.writeInt(this.xPosition); -+ par1DataOutput.write(this.yPosition); -+ par1DataOutput.writeInt(this.zPosition); -+ par1DataOutput.write(this.face); -+ } -+ -+ /** -+ * Passes this Packet on to the NetHandler for processing. -+ */ -+ public void processPacket(NetHandler par1NetHandler) { -+ par1NetHandler.handleBlockDig(this); -+ } -+ -+ /** -+ * Abstract. Return the size of the packet (not counting the header). -+ */ - public int getPacketSize() { - return 11; - } ---- net/minecraft/src/CallableEntityName.java -+++ net/minecraft/src/CallableEntityName.java -@@ -5,8 +5,8 @@ - class CallableEntityName implements Callable { - final Entity theEntity; - -- CallableEntityName(Entity var1) { -- this.theEntity = var1; -+ CallableEntityName(Entity par1Entity) { -+ this.theEntity = par1Entity; - } - - public String callEntityName() { ---- net/minecraft/src/CallableMPL2.java -+++ net/minecraft/src/CallableMPL2.java -@@ -3,12 +3,17 @@ - import java.util.concurrent.Callable; - - class CallableMPL2 implements Callable { -+ -+ /** Reference to the WorldClient object. */ - final WorldClient theWorldClient; - -- CallableMPL2(WorldClient var1) { -- this.theWorldClient = var1; -+ CallableMPL2(WorldClient par1WorldClient) { -+ this.theWorldClient = par1WorldClient; - } - -+ /** -+ * Returns the size and contents of the entity spawn queue. -+ */ - public String getEntitySpawnQueueCountAndList() { - return WorldClient.getEntitySpawnQueue(this.theWorldClient).size() + " total; " + WorldClient.getEntitySpawnQueue(this.theWorldClient).toString(); - } ---- /dev/null -+++ org/spoutcraft/client/gui/minimap/GuiMoveMinimap.java -@@ -1,0 +1,140 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.client.gui.minimap; -+ -+import org.lwjgl.input.Mouse; -+ -+import net.minecraft.src.GuiScreen; -+ -+import org.spoutcraft.api.gui.Button; -+import org.spoutcraft.api.gui.Color; -+import org.spoutcraft.api.gui.GenericButton; -+import org.spoutcraft.api.gui.GenericGradient; -+import org.spoutcraft.api.gui.GenericLabel; -+import org.spoutcraft.api.gui.GenericSlider; -+import org.spoutcraft.api.gui.Gradient; -+import org.spoutcraft.api.gui.Label; -+import org.spoutcraft.api.gui.Slider; -+import org.spoutcraft.client.SpoutClient; -+import org.spoutcraft.client.gui.GuiSpoutScreen; -+ -+public class GuiMoveMinimap extends GuiSpoutScreen { -+ private Label title; -+ private Gradient minimapDrag; -+ private Button buttonDone, buttonReset; -+ private Slider sliderScale; -+ -+ private final static Color dragColor = new Color(1f, 1f, 1f, 0.5f); -+ -+ private GuiScreen parent; -+ -+ private boolean dragging = false; -+ private int dragStartX = 0, dragStartY = 0; -+ -+ public GuiMoveMinimap(GuiScreen parent) { -+ this.parent = parent; -+ } -+ -+ @Override -+ protected void createInstances() { -+ title = new GenericLabel("Drag the minimap around"); -+ minimapDrag = new GenericGradient(); -+ minimapDrag.setTopColor(dragColor); -+ minimapDrag.setBottomColor(dragColor); -+ buttonDone = new GenericButton("Done"); -+ buttonReset = new GenericButton("Reset to Default"); -+ sliderScale = new GenericSlider(); -+ float scale = MinimapConfig.getInstance().getSizeAdjust(); -+ sliderScale.setSliderPosition(scale / 4); -+ -+ getScreen().attachWidgets("Spoutcraft", title, minimapDrag, buttonDone, buttonReset, sliderScale); -+ } -+ -+ @Override -+ protected void layoutWidgets() { -+ title.setX(width / 2 - SpoutClient.getHandle().fontRenderer.getStringWidth(title.getText()) / 2); -+ title.setY(10); -+ -+ sliderScale.setGeometry(width / 2 - 100, height - 55, 200, 20); -+ -+ buttonDone.setGeometry(width / 2 + 5, height - 25, 150, 20); -+ buttonReset.setGeometry(width / 2 - 155, height - 25, 150, 20); -+ } -+ -+ @Override -+ public void updateScreen() { -+ int x = (int) MinimapConfig.getInstance().getAdjustX(); -+ int y = (int) MinimapConfig.getInstance().getAdjustY(); -+ float scale = sliderScale.getSliderPosition() * 4; -+ int width = (int) (65 * scale); int height = (int) (65 * scale); -+ if (MinimapConfig.getInstance().isCoords()) { -+ height += 18 * scale; -+ } -+ -+ sliderScale.setText("Size adjust: " + Math.round(scale * 100f) / 100f); -+ -+ MinimapConfig.getInstance().setSizeAdjust(scale); -+ -+ minimapDrag.setGeometry(this.width + x - width, y, width, height); -+ super.updateScreen(); -+ } -+ -+ @Override -+ protected void mouseClicked(int x, int y, int button) { -+ if (button == 0 && isInBoundingRect(minimapDrag, x, y)) { -+ dragging = true; -+ dragStartX = x; -+ dragStartY = y; -+ } -+ super.mouseClicked(x, y, button); -+ } -+ -+ @Override -+ protected void mouseMovedOrUp(int x, int y, int button) { -+ if (button == 0 && !Mouse.isButtonDown(button)) { -+ dragging = false; -+ } -+ if (dragging) { -+ int mX = (int) MinimapConfig.getInstance().getAdjustX(); -+ int mY = (int) MinimapConfig.getInstance().getAdjustY(); -+ mX += x - dragStartX; -+ mY += y - dragStartY; -+ MinimapConfig.getInstance().setAdjustX(mX); -+ MinimapConfig.getInstance().setAdjustY(mY); -+ -+ dragStartX = x; -+ dragStartY = y; -+ } -+ super.mouseMovedOrUp(x, y, button); -+ } -+ -+ @Override -+ protected void buttonClicked(Button btn) { -+ if (btn == buttonDone) { -+ mc.displayGuiScreen(parent); -+ } -+ if (btn == buttonReset) { -+ MinimapConfig.getInstance().setAdjustX(0); -+ MinimapConfig.getInstance().setAdjustY(0); -+ MinimapConfig.getInstance().setSizeAdjust(1); -+ sliderScale.setSliderPosition(1f / 4f); -+ } -+ } -+} ---- /dev/null -+++ org/spoutcraft/client/gui/settings/controls/StarsToggleButton.java -@@ -1,0 +1,39 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.client.gui.settings.controls; -+ -+import org.spoutcraft.api.gui.GenericCheckBox; -+import org.spoutcraft.client.SpoutClient; -+import org.spoutcraft.client.config.Configuration; -+ -+public class StarsToggleButton extends GenericCheckBox { -+ public StarsToggleButton() { -+ super("Stars"); -+ setChecked(Configuration.isStars()); -+ setEnabled(SpoutClient.getInstance().isStarsCheat()); -+ setTooltip("Stars\nON - stars are visible, slower\nOFF - stars are not visible, faster"); -+ } -+ -+ @Override -+ public void onButtonClick() { -+ Configuration.setStars(!Configuration.isStars()); -+ Configuration.write(); -+ } -+} ---- net/minecraft/src/EntityAIArrowAttack.java -+++ net/minecraft/src/EntityAIArrowAttack.java -@@ -1,40 +1,60 @@ - package net.minecraft.src; - - public class EntityAIArrowAttack extends EntityAIBase { -+ -+ /** The entity the AI instance has been applied to */ - private final EntityLiving entityHost; -+ -+ /** -+ * The entity (as a RangedAttackMob) the AI instance has been applied to. -+ */ - private final IRangedAttackMob rangedAttackEntityHost; - private EntityLivingBase attackTarget; -+ -+ /** -+ * A decrementing tick that spawns a ranged attack once this value reaches 0. It is then set back to the -+ * maxRangedAttackTime. -+ */ - private int rangedAttackTime; - private double entityMoveSpeed; - private int field_75318_f; - private int field_96561_g; -+ -+ /** -+ * The maximum time the AI has to wait before peforming another ranged attack. -+ */ - private int maxRangedAttackTime; - private float field_96562_i; - private float field_82642_h; - -- public EntityAIArrowAttack(IRangedAttackMob var1, double var2, int var4, float var5) { -- this(var1, var2, var4, var4, var5); -+ public EntityAIArrowAttack(IRangedAttackMob par1IRangedAttackMob, double par2, int par4, float par5) { -+ this(par1IRangedAttackMob, par2, par4, par4, par5); - } - -- public EntityAIArrowAttack(IRangedAttackMob var1, double var2, int var4, int var5, float var6) { -+ public EntityAIArrowAttack(IRangedAttackMob par1IRangedAttackMob, double par2, int par4, int par5, float par6) { - this.rangedAttackTime = -1; -- if(!(var1 instanceof EntityLivingBase)) { -+ -+ if (!(par1IRangedAttackMob instanceof EntityLivingBase)) { - throw new IllegalArgumentException("ArrowAttackGoal requires Mob implements RangedAttackMob"); - } else { -- this.rangedAttackEntityHost = var1; -- this.entityHost = (EntityLiving)var1; -- this.entityMoveSpeed = var2; -- this.field_96561_g = var4; -- this.maxRangedAttackTime = var5; -- this.field_96562_i = var6; -- this.field_82642_h = var6 * var6; -+ this.rangedAttackEntityHost = par1IRangedAttackMob; -+ this.entityHost = (EntityLiving)par1IRangedAttackMob; -+ this.entityMoveSpeed = par2; -+ this.field_96561_g = par4; -+ this.maxRangedAttackTime = par5; -+ this.field_96562_i = par6; -+ this.field_82642_h = par6 * par6; - this.setMutexBits(3); - } - } - -+ /** -+ * Returns whether the EntityAIBase should begin execution. -+ */ - public boolean shouldExecute() { - EntityLivingBase var1 = this.entityHost.getAttackTarget(); -- if(var1 == null) { -+ -+ if (var1 == null) { - return false; - } else { - this.attackTarget = var1; -@@ -42,26 +62,36 @@ - } - } - -+ /** -+ * Returns whether an in-progress EntityAIBase should continue executing -+ */ - public boolean continueExecuting() { - return this.shouldExecute() || !this.entityHost.getNavigator().noPath(); - } - -+ /** -+ * Resets the task -+ */ - public void resetTask() { - this.attackTarget = null; - this.field_75318_f = 0; - this.rangedAttackTime = -1; - } - -+ /** -+ * Updates the task -+ */ - public void updateTask() { - double var1 = this.entityHost.getDistanceSq(this.attackTarget.posX, this.attackTarget.boundingBox.minY, this.attackTarget.posZ); - boolean var3 = this.entityHost.getEntitySenses().canSee(this.attackTarget); -- if(var3) { -+ -+ if (var3) { - ++this.field_75318_f; - } else { - this.field_75318_f = 0; - } - -- if(var1 <= (double)this.field_82642_h && this.field_75318_f >= 20) { -+ if (var1 <= (double)this.field_82642_h && this.field_75318_f >= 20) { - this.entityHost.getNavigator().clearPathEntity(); - } else { - this.entityHost.getNavigator().tryMoveToEntityLiving(this.attackTarget, this.entityMoveSpeed); -@@ -69,27 +99,28 @@ - - this.entityHost.getLookHelper().setLookPositionWithEntity(this.attackTarget, 30.0F, 30.0F); - float var4; -- if(--this.rangedAttackTime == 0) { -- if(var1 > (double)this.field_82642_h || !var3) { -+ -+ if (--this.rangedAttackTime == 0) { -+ if (var1 > (double)this.field_82642_h || !var3) { - return; - } - - var4 = MathHelper.sqrt_double(var1) / this.field_96562_i; - float var5 = var4; -- if(var4 < 0.1F) { -+ -+ if (var4 < 0.1F) { - var5 = 0.1F; - } - -- if(var5 > 1.0F) { -+ if (var5 > 1.0F) { - var5 = 1.0F; - } - - this.rangedAttackEntityHost.attackEntityWithRangedAttack(this.attackTarget, var5); - this.rangedAttackTime = MathHelper.floor_float(var4 * (float)(this.maxRangedAttackTime - this.field_96561_g) + (float)this.field_96561_g); -- } else if(this.rangedAttackTime < 0) { -+ } else if (this.rangedAttackTime < 0) { - var4 = MathHelper.sqrt_double(var1) / this.field_96562_i; - this.rangedAttackTime = MathHelper.floor_float(var4 * (float)(this.maxRangedAttackTime - this.field_96561_g) + (float)this.field_96561_g); - } -- - } - } ---- net/minecraft/src/CallableType3.java -+++ net/minecraft/src/CallableType3.java -@@ -3,10 +3,12 @@ - import java.util.concurrent.Callable; - - class CallableType3 implements Callable { -+ -+ /** Reference to the IntegratedServer object. */ - final IntegratedServer theIntegratedServer; - -- CallableType3(IntegratedServer var1) { -- this.theIntegratedServer = var1; -+ CallableType3(IntegratedServer par1IntegratedServer) { -+ this.theIntegratedServer = par1IntegratedServer; - } - - public String getType() { ---- /dev/null -+++ org/spoutcraft/client/gui/server/SpoutServerData.java -@@ -1,0 +1,73 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.client.gui.server; -+ -+import net.minecraft.src.ServerData; -+ -+/** -+ * Extends ServerData to store additional spout server details. -+ */ -+public class SpoutServerData extends ServerData { -+ private ServerItem serverItem; -+ -+ /** -+ * Construct more closely matches Minecraft ServerData -+ * @param name - Server Name -+ * @param ip - Server ip and port in ip:port format -+ */ -+ public SpoutServerData(String name, String ip) { -+ super(name, ip); -+ } -+ -+ /** -+ * Construct more closely matches Spoutcraft data from a ServerItem -+ * @param name - Server Name -+ * @param ip - Ip Address -+ * @param port - port -+ * @param uid - databaseId -+ */ -+ public SpoutServerData(String name, ServerItem serverItem) { -+ this(name, serverItem.getIp() + ":" + String.valueOf(serverItem.getPort())); -+ setServerItem(serverItem); -+ if (serverItem.getAcceptsTextures() != null) setAcceptsTextures(serverItem.getAcceptsTextures()); -+ } -+ -+ @Override -+ public void setAcceptsTextures(boolean accepts) { -+ this.getServerItem().setAcceptsTextures(accepts); -+ super.setAcceptsTextures(accepts); -+ } -+ -+ /** -+ * Sets the serveritem entry for this server -+ * @param uid -+ */ -+ public void setServerItem(ServerItem serverItem) { -+ this.serverItem = serverItem; -+ } -+ -+ /** -+ * Gets the serveritem entry for this server -+ * @return -+ */ -+ public ServerItem getServerItem() { -+ return serverItem; -+ } -+} ---- net/minecraft/src/BlockDirt.java -+++ net/minecraft/src/BlockDirt.java -@@ -1,8 +1,8 @@ - package net.minecraft.src; - - public class BlockDirt extends Block { -- protected BlockDirt(int var1) { -- super(var1, Material.ground); -+ protected BlockDirt(int par1) { -+ super(par1, Material.ground); - this.setCreativeTab(CreativeTabs.tabBlock); - } - } ---- /dev/null -+++ org/spoutcraft/client/entity/CraftHumanEntity.java -@@ -1,0 +1,61 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.client.entity; -+ -+import net.minecraft.src.EntityPlayer; -+ -+import org.spoutcraft.api.inventory.ItemStack; -+import org.spoutcraft.api.inventory.PlayerInventory; -+import org.spoutcraft.client.inventory.CraftInventoryPlayer; -+ -+public class CraftHumanEntity extends CraftLivingEntity { -+ public CraftHumanEntity(EntityPlayer player) { -+ super(player); -+ } -+ -+ public EntityPlayer getMCPlayer() { -+ return (EntityPlayer)handle; -+ } -+ -+ public String getName() { -+ return getMCPlayer().username; -+ } -+ -+ public PlayerInventory getInventory() { -+ return new CraftInventoryPlayer(getMCPlayer().inventory); -+ } -+ -+ public ItemStack getItemInHand() { -+ return getInventory().getItemInHand(); -+ } -+ -+ public void setItemInHand(ItemStack item) { -+ getInventory().setItemInHand(item); -+ } -+ -+ public boolean isSleeping() { -+ boolean sleep = getMCPlayer().isPlayerSleeping(); -+ return sleep; -+ } -+ -+ public int getSleepTicks() { -+ return getMCPlayer().getSleepTimer(); -+ } -+} ---- net/minecraft/src/GenLayerSwampRivers.java -+++ net/minecraft/src/GenLayerSwampRivers.java -@@ -1,23 +1,28 @@ - package net.minecraft.src; - - public class GenLayerSwampRivers extends GenLayer { -- public GenLayerSwampRivers(long var1, GenLayer var3) { -- super(var1); -- this.parent = var3; -+ public GenLayerSwampRivers(long par1, GenLayer par3GenLayer) { -+ super(par1); -+ this.parent = par3GenLayer; - } - -- public int[] getInts(int var1, int var2, int var3, int var4) { -- int[] var5 = this.parent.getInts(var1 - 1, var2 - 1, var3 + 2, var4 + 2); -- int[] var6 = IntCache.getIntCache(var3 * var4); -- -- for(int var7 = 0; var7 < var4; ++var7) { -- for(int var8 = 0; var8 < var3; ++var8) { -- this.initChunkSeed((long)(var8 + var1), (long)(var7 + var2)); -- int var9 = var5[var8 + 1 + (var7 + 1) * (var3 + 2)]; -- if((var9 != BiomeGenBase.swampland.biomeID || this.nextInt(6) != 0) && (var9 != BiomeGenBase.jungle.biomeID && var9 != BiomeGenBase.jungleHills.biomeID || this.nextInt(8) != 0)) { -- var6[var8 + var7 * var3] = var9; -+ /** -+ * Returns a list of integer values generated by this layer. These may be interpreted as temperatures, rainfall -+ * amounts, or biomeList[] indices based on the particular GenLayer subclass. -+ */ -+ public int[] getInts(int par1, int par2, int par3, int par4) { -+ int[] var5 = this.parent.getInts(par1 - 1, par2 - 1, par3 + 2, par4 + 2); -+ int[] var6 = IntCache.getIntCache(par3 * par4); -+ -+ for (int var7 = 0; var7 < par4; ++var7) { -+ for (int var8 = 0; var8 < par3; ++var8) { -+ this.initChunkSeed((long)(var8 + par1), (long)(var7 + par2)); -+ int var9 = var5[var8 + 1 + (var7 + 1) * (par3 + 2)]; -+ -+ if ((var9 != BiomeGenBase.swampland.biomeID || this.nextInt(6) != 0) && (var9 != BiomeGenBase.jungle.biomeID && var9 != BiomeGenBase.jungleHills.biomeID || this.nextInt(8) != 0)) { -+ var6[var8 + var7 * par3] = var9; - } else { -- var6[var8 + var7 * var3] = BiomeGenBase.river.biomeID; -+ var6[var8 + var7 * par3] = BiomeGenBase.river.biomeID; - } - } - } ---- net/minecraft/src/TextureManagerINNER1.java -+++ net/minecraft/src/TextureManagerINNER1.java -@@ -4,11 +4,12 @@ - - class TextureManagerINNER1 implements Callable { - final TextureObject theTextureObject; -+ - final TextureManager theTextureManager; - -- TextureManagerINNER1(TextureManager var1, TextureObject var2) { -- this.theTextureManager = var1; -- this.theTextureObject = var2; -+ TextureManagerINNER1(TextureManager par1TextureManager, TextureObject par2TextureObject) { -+ this.theTextureManager = par1TextureManager; -+ this.theTextureObject = par2TextureObject; - } - - public String func_135060_a() { ---- net/minecraft/src/BlockPortal.java -+++ net/minecraft/src/BlockPortal.java -@@ -3,95 +3,122 @@ - import java.util.Random; - - public class BlockPortal extends BlockBreakable { -- public BlockPortal(int var1) { -- super(var1, "portal", Material.portal, false); -+ public BlockPortal(int par1) { -+ super(par1, "portal", Material.portal, false); - this.setTickRandomly(true); - } - -- public void updateTick(World var1, int var2, int var3, int var4, Random var5) { -- super.updateTick(var1, var2, var3, var4, var5); -- if(var1.provider.isSurfaceWorld() && var5.nextInt(2000) < var1.difficultySetting) { -+ /** -+ * Ticks the block if it's been scheduled -+ */ -+ public void updateTick(World par1World, int par2, int par3, int par4, Random par5Random) { -+ super.updateTick(par1World, par2, par3, par4, par5Random); -+ -+ if (par1World.provider.isSurfaceWorld() && par5Random.nextInt(2000) < par1World.difficultySetting) { - int var6; -- for(var6 = var3; !var1.doesBlockHaveSolidTopSurface(var2, var6, var4) && var6 > 0; --var6) { -+ -+ for (var6 = par3; !par1World.doesBlockHaveSolidTopSurface(par2, var6, par4) && var6 > 0; --var6) { -+ ; - } - -- if(var6 > 0 && !var1.isBlockNormalCube(var2, var6 + 1, var4)) { -- Entity var7 = ItemMonsterPlacer.spawnCreature(var1, 57, (double)var2 + 0.5D, (double)var6 + 1.1D, (double)var4 + 0.5D); -- if(var7 != null) { -+ if (var6 > 0 && !par1World.isBlockNormalCube(par2, var6 + 1, par4)) { -+ Entity var7 = ItemMonsterPlacer.spawnCreature(par1World, 57, (double)par2 + 0.5D, (double)var6 + 1.1D, (double)par4 + 0.5D); -+ -+ if (var7 != null) { - var7.timeUntilPortal = var7.getPortalCooldown(); - } - } - } -- - } - -- public AxisAlignedBB getCollisionBoundingBoxFromPool(World var1, int var2, int var3, int var4) { -+ /** -+ * Returns a bounding box from the pool of bounding boxes (this means this box can change after the pool has been -+ * cleared to be reused) -+ */ -+ public AxisAlignedBB getCollisionBoundingBoxFromPool(World par1World, int par2, int par3, int par4) { - return null; - } - -- public void setBlockBoundsBasedOnState(IBlockAccess var1, int var2, int var3, int var4) { -+ /** -+ * Updates the blocks bounds based on its current state. Args: world, x, y, z -+ */ -+ public void setBlockBoundsBasedOnState(IBlockAccess par1IBlockAccess, int par2, int par3, int par4) { - float var5; - float var6; -- if(var1.getBlockId(var2 - 1, var3, var4) != this.blockID && var1.getBlockId(var2 + 1, var3, var4) != this.blockID) { -- var5 = 2.0F / 16.0F; -+ -+ if (par1IBlockAccess.getBlockId(par2 - 1, par3, par4) != this.blockID && par1IBlockAccess.getBlockId(par2 + 1, par3, par4) != this.blockID) { -+ var5 = 0.125F; - var6 = 0.5F; - this.setBlockBounds(0.5F - var5, 0.0F, 0.5F - var6, 0.5F + var5, 1.0F, 0.5F + var6); - } else { - var5 = 0.5F; -- var6 = 2.0F / 16.0F; -+ var6 = 0.125F; - this.setBlockBounds(0.5F - var5, 0.0F, 0.5F - var6, 0.5F + var5, 1.0F, 0.5F + var6); - } -- - } - -+ /** -+ * Is this block (a) opaque and (b) a full 1m cube? This determines whether or not to render the shared face of two -+ * adjacent blocks and also whether the player can attach torches, redstone wire, etc to this block. -+ */ - public boolean isOpaqueCube() { - return false; - } - -+ /** -+ * If this block doesn't render as an ordinary block it will return False (examples: signs, buttons, stairs, etc) -+ */ - public boolean renderAsNormalBlock() { - return false; - } - -- public boolean tryToCreatePortal(World var1, int var2, int var3, int var4) { -+ /** -+ * Checks to see if this location is valid to create a portal and will return True if it does. Args: world, x, y, z -+ */ -+ public boolean tryToCreatePortal(World par1World, int par2, int par3, int par4) { - byte var5 = 0; - byte var6 = 0; -- if(var1.getBlockId(var2 - 1, var3, var4) == Block.obsidian.blockID || var1.getBlockId(var2 + 1, var3, var4) == Block.obsidian.blockID) { -+ -+ if (par1World.getBlockId(par2 - 1, par3, par4) == Block.obsidian.blockID || par1World.getBlockId(par2 + 1, par3, par4) == Block.obsidian.blockID) { - var5 = 1; - } - -- if(var1.getBlockId(var2, var3, var4 - 1) == Block.obsidian.blockID || var1.getBlockId(var2, var3, var4 + 1) == Block.obsidian.blockID) { -+ if (par1World.getBlockId(par2, par3, par4 - 1) == Block.obsidian.blockID || par1World.getBlockId(par2, par3, par4 + 1) == Block.obsidian.blockID) { - var6 = 1; - } - -- if(var5 == var6) { -+ if (var5 == var6) { - return false; - } else { -- if(var1.getBlockId(var2 - var5, var3, var4 - var6) == 0) { -- var2 -= var5; -- var4 -= var6; -+ if (par1World.getBlockId(par2 - var5, par3, par4 - var6) == 0) { -+ par2 -= var5; -+ par4 -= var6; - } - - int var7; - int var8; -- for(var7 = -1; var7 <= 2; ++var7) { -- for(var8 = -1; var8 <= 3; ++var8) { -+ -+ for (var7 = -1; var7 <= 2; ++var7) { -+ for (var8 = -1; var8 <= 3; ++var8) { - boolean var9 = var7 == -1 || var7 == 2 || var8 == -1 || var8 == 3; -- if(var7 != -1 && var7 != 2 || var8 != -1 && var8 != 3) { -- int var10 = var1.getBlockId(var2 + var5 * var7, var3 + var8, var4 + var6 * var7); -- if(var9) { -- if(var10 != Block.obsidian.blockID) { -+ -+ if (var7 != -1 && var7 != 2 || var8 != -1 && var8 != 3) { -+ int var10 = par1World.getBlockId(par2 + var5 * var7, par3 + var8, par4 + var6 * var7); -+ -+ if (var9) { -+ if (var10 != Block.obsidian.blockID) { - return false; - } -- } else if(var10 != 0 && var10 != Block.fire.blockID) { -+ } else if (var10 != 0 && var10 != Block.fire.blockID) { - return false; - } - } - } - } - -- for(var7 = 0; var7 < 2; ++var7) { -- for(var8 = 0; var8 < 3; ++var8) { -- var1.setBlock(var2 + var5 * var7, var3 + var8, var4 + var6 * var7, Block.portal.blockID, 0, 2); -+ for (var7 = 0; var7 < 2; ++var7) { -+ for (var8 = 0; var8 < 3; ++var8) { -+ par1World.setBlock(par2 + var5 * var7, par3 + var8, par4 + var6 * var7, Block.portal.blockID, 0, 2); - } - } - -@@ -99,101 +126,128 @@ - } - } - -- public void onNeighborBlockChange(World var1, int var2, int var3, int var4, int var5) { -+ /** -+ * Lets the block know when one of its neighbor changes. Doesn't know which neighbor changed (coordinates passed are -+ * their own) Args: x, y, z, neighbor blockID -+ */ -+ public void onNeighborBlockChange(World par1World, int par2, int par3, int par4, int par5) { - byte var6 = 0; - byte var7 = 1; -- if(var1.getBlockId(var2 - 1, var3, var4) == this.blockID || var1.getBlockId(var2 + 1, var3, var4) == this.blockID) { -+ -+ if (par1World.getBlockId(par2 - 1, par3, par4) == this.blockID || par1World.getBlockId(par2 + 1, par3, par4) == this.blockID) { - var6 = 1; - var7 = 0; - } - - int var8; -- for(var8 = var3; var1.getBlockId(var2, var8 - 1, var4) == this.blockID; --var8) { -+ -+ for (var8 = par3; par1World.getBlockId(par2, var8 - 1, par4) == this.blockID; --var8) { -+ ; - } - -- if(var1.getBlockId(var2, var8 - 1, var4) != Block.obsidian.blockID) { -- var1.setBlockToAir(var2, var3, var4); -+ if (par1World.getBlockId(par2, var8 - 1, par4) != Block.obsidian.blockID) { -+ par1World.setBlockToAir(par2, par3, par4); - } else { - int var9; -- for(var9 = 1; var9 < 4 && var1.getBlockId(var2, var8 + var9, var4) == this.blockID; ++var9) { -+ -+ for (var9 = 1; var9 < 4 && par1World.getBlockId(par2, var8 + var9, par4) == this.blockID; ++var9) { -+ ; - } - -- if(var9 == 3 && var1.getBlockId(var2, var8 + var9, var4) == Block.obsidian.blockID) { -- boolean var10 = var1.getBlockId(var2 - 1, var3, var4) == this.blockID || var1.getBlockId(var2 + 1, var3, var4) == this.blockID; -- boolean var11 = var1.getBlockId(var2, var3, var4 - 1) == this.blockID || var1.getBlockId(var2, var3, var4 + 1) == this.blockID; -- if(var10 && var11) { -- var1.setBlockToAir(var2, var3, var4); -+ if (var9 == 3 && par1World.getBlockId(par2, var8 + var9, par4) == Block.obsidian.blockID) { -+ boolean var10 = par1World.getBlockId(par2 - 1, par3, par4) == this.blockID || par1World.getBlockId(par2 + 1, par3, par4) == this.blockID; -+ boolean var11 = par1World.getBlockId(par2, par3, par4 - 1) == this.blockID || par1World.getBlockId(par2, par3, par4 + 1) == this.blockID; -+ -+ if (var10 && var11) { -+ par1World.setBlockToAir(par2, par3, par4); - } else { -- if((var1.getBlockId(var2 + var6, var3, var4 + var7) != Block.obsidian.blockID || var1.getBlockId(var2 - var6, var3, var4 - var7) != this.blockID) && (var1.getBlockId(var2 - var6, var3, var4 - var7) != Block.obsidian.blockID || var1.getBlockId(var2 + var6, var3, var4 + var7) != this.blockID)) { -- var1.setBlockToAir(var2, var3, var4); -+ if ((par1World.getBlockId(par2 + var6, par3, par4 + var7) != Block.obsidian.blockID || par1World.getBlockId(par2 - var6, par3, par4 - var7) != this.blockID) && (par1World.getBlockId(par2 - var6, par3, par4 - var7) != Block.obsidian.blockID || par1World.getBlockId(par2 + var6, par3, par4 + var7) != this.blockID)) { -+ par1World.setBlockToAir(par2, par3, par4); - } -- - } - } else { -- var1.setBlockToAir(var2, var3, var4); -+ par1World.setBlockToAir(par2, par3, par4); - } - } - } - -- public boolean shouldSideBeRendered(IBlockAccess var1, int var2, int var3, int var4, int var5) { -- if(var1.getBlockId(var2, var3, var4) == this.blockID) { -+ /** -+ * Returns true if the given side of this block type should be rendered, if the adjacent block is at the given -+ * coordinates. Args: blockAccess, x, y, z, side -+ */ -+ public boolean shouldSideBeRendered(IBlockAccess par1IBlockAccess, int par2, int par3, int par4, int par5) { -+ if (par1IBlockAccess.getBlockId(par2, par3, par4) == this.blockID) { - return false; - } else { -- boolean var6 = var1.getBlockId(var2 - 1, var3, var4) == this.blockID && var1.getBlockId(var2 - 2, var3, var4) != this.blockID; -- boolean var7 = var1.getBlockId(var2 + 1, var3, var4) == this.blockID && var1.getBlockId(var2 + 2, var3, var4) != this.blockID; -- boolean var8 = var1.getBlockId(var2, var3, var4 - 1) == this.blockID && var1.getBlockId(var2, var3, var4 - 2) != this.blockID; -- boolean var9 = var1.getBlockId(var2, var3, var4 + 1) == this.blockID && var1.getBlockId(var2, var3, var4 + 2) != this.blockID; -+ boolean var6 = par1IBlockAccess.getBlockId(par2 - 1, par3, par4) == this.blockID && par1IBlockAccess.getBlockId(par2 - 2, par3, par4) != this.blockID; -+ boolean var7 = par1IBlockAccess.getBlockId(par2 + 1, par3, par4) == this.blockID && par1IBlockAccess.getBlockId(par2 + 2, par3, par4) != this.blockID; -+ boolean var8 = par1IBlockAccess.getBlockId(par2, par3, par4 - 1) == this.blockID && par1IBlockAccess.getBlockId(par2, par3, par4 - 2) != this.blockID; -+ boolean var9 = par1IBlockAccess.getBlockId(par2, par3, par4 + 1) == this.blockID && par1IBlockAccess.getBlockId(par2, par3, par4 + 2) != this.blockID; - boolean var10 = var6 || var7; - boolean var11 = var8 || var9; -- return var10 && var5 == 4 ? true : (var10 && var5 == 5 ? true : (var11 && var5 == 2 ? true : var11 && var5 == 3)); -+ return var10 && par5 == 4 ? true : (var10 && par5 == 5 ? true : (var11 && par5 == 2 ? true : var11 && par5 == 3)); - } - } - -- public int quantityDropped(Random var1) { -+ /** -+ * Returns the quantity of items to drop on block destruction. -+ */ -+ public int quantityDropped(Random par1Random) { - return 0; - } - -+ /** -+ * Returns which pass should this block be rendered on. 0 for solids and 1 for alpha -+ */ - public int getRenderBlockPass() { - return 1; - } - -- public void onEntityCollidedWithBlock(World var1, int var2, int var3, int var4, Entity var5) { -- if(var5.ridingEntity == null && var5.riddenByEntity == null) { -- var5.setInPortal(); -+ /** -+ * Triggered whenever an entity collides with this block (enters into the block). Args: world, x, y, z, entity -+ */ -+ public void onEntityCollidedWithBlock(World par1World, int par2, int par3, int par4, Entity par5Entity) { -+ if (par5Entity.ridingEntity == null && par5Entity.riddenByEntity == null) { -+ par5Entity.setInPortal(); - } -- - } - -- public void randomDisplayTick(World var1, int var2, int var3, int var4, Random var5) { -- if(var5.nextInt(100) == 0) { -- var1.playSound((double)var2 + 0.5D, (double)var3 + 0.5D, (double)var4 + 0.5D, "portal.portal", 0.5F, var5.nextFloat() * 0.4F + 0.8F, false); -+ /** -+ * A randomly called display update to be able to add particles or other items for display -+ */ -+ public void randomDisplayTick(World par1World, int par2, int par3, int par4, Random par5Random) { -+ if (par5Random.nextInt(100) == 0) { -+ par1World.playSound((double)par2 + 0.5D, (double)par3 + 0.5D, (double)par4 + 0.5D, "portal.portal", 0.5F, par5Random.nextFloat() * 0.4F + 0.8F, false); - } - -- for(int var6 = 0; var6 < 4; ++var6) { -- double var7 = (double)((float)var2 + var5.nextFloat()); -- double var9 = (double)((float)var3 + var5.nextFloat()); -- double var11 = (double)((float)var4 + var5.nextFloat()); -+ for (int var6 = 0; var6 < 4; ++var6) { -+ double var7 = (double)((float)par2 + par5Random.nextFloat()); -+ double var9 = (double)((float)par3 + par5Random.nextFloat()); -+ double var11 = (double)((float)par4 + par5Random.nextFloat()); - double var13 = 0.0D; - double var15 = 0.0D; - double var17 = 0.0D; -- int var19 = var5.nextInt(2) * 2 - 1; -- var13 = ((double)var5.nextFloat() - 0.5D) * 0.5D; -- var15 = ((double)var5.nextFloat() - 0.5D) * 0.5D; -- var17 = ((double)var5.nextFloat() - 0.5D) * 0.5D; -- if(var1.getBlockId(var2 - 1, var3, var4) != this.blockID && var1.getBlockId(var2 + 1, var3, var4) != this.blockID) { -- var7 = (double)var2 + 0.5D + 0.25D * (double)var19; -- var13 = (double)(var5.nextFloat() * 2.0F * (float)var19); -+ int var19 = par5Random.nextInt(2) * 2 - 1; -+ var13 = ((double)par5Random.nextFloat() - 0.5D) * 0.5D; -+ var15 = ((double)par5Random.nextFloat() - 0.5D) * 0.5D; -+ var17 = ((double)par5Random.nextFloat() - 0.5D) * 0.5D; -+ -+ if (par1World.getBlockId(par2 - 1, par3, par4) != this.blockID && par1World.getBlockId(par2 + 1, par3, par4) != this.blockID) { -+ var7 = (double)par2 + 0.5D + 0.25D * (double)var19; -+ var13 = (double)(par5Random.nextFloat() * 2.0F * (float)var19); - } else { -- var11 = (double)var4 + 0.5D + 0.25D * (double)var19; -- var17 = (double)(var5.nextFloat() * 2.0F * (float)var19); -+ var11 = (double)par4 + 0.5D + 0.25D * (double)var19; -+ var17 = (double)(par5Random.nextFloat() * 2.0F * (float)var19); - } - -- var1.spawnParticle("portal", var7, var9, var11, var13, var15, var17); -+ par1World.spawnParticle("portal", var7, var9, var11, var13, var15, var17); - } -- - } - -- public int idPicked(World var1, int var2, int var3, int var4) { -+ /** -+ * only called by clickMiddleMouseButton , and passed to inventory.setCurrentItem (along with isCreative) -+ */ -+ public int idPicked(World par1World, int par2, int par3, int par4) { - return 0; - } - } ---- net/minecraft/src/EntityOcelot.java -+++ net/minecraft/src/EntityOcelot.java -@@ -1,10 +1,14 @@ - package net.minecraft.src; - - public class EntityOcelot extends EntityTameable { -+ -+ /** -+ * The tempt AI task for this mob, used to prevent taming while it is fleeing. -+ */ - private EntityAITempt aiTempt; - -- public EntityOcelot(World var1) { -- super(var1); -+ public EntityOcelot(World par1World) { -+ super(par1World); - this.setSize(0.6F, 0.8F); - this.getNavigator().setAvoidsWater(true); - this.tasks.addTask(1, new EntityAISwimming(this)); -@@ -26,13 +30,17 @@ - this.dataWatcher.addObject(18, Byte.valueOf((byte)0)); - } - -+ /** -+ * main AI tick function, replaces updateEntityActionState -+ */ - public void updateAITick() { -- if(this.getMoveHelper().isUpdating()) { -+ if (this.getMoveHelper().isUpdating()) { - double var1 = this.getMoveHelper().getSpeed(); -- if(var1 == 0.6D) { -+ -+ if (var1 == 0.6D) { - this.setSneaking(true); - this.setSprinting(false); -- } else if(var1 == 1.33D) { -+ } else if (var1 == 1.33D) { - this.setSneaking(false); - this.setSprinting(true); - } else { -@@ -43,13 +51,18 @@ - this.setSneaking(false); - this.setSprinting(false); - } -- - } - -+ /** -+ * Determines if an entity can be despawned, used on idle far away entities -+ */ - protected boolean canDespawn() { - return !this.isTamed() && this.ticksExisted > 2400; - } - -+ /** -+ * Returns true if the newer Entity AI code should be run -+ */ - public boolean isAIEnabled() { - return true; - } -@@ -57,78 +70,111 @@ - protected void applyEntityAttributes() { - super.applyEntityAttributes(); - this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setAttribute(10.0D); -- this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setAttribute((double)0.3F); -- } -- -- protected void fall(float var1) { -- } -- -- public void writeEntityToNBT(NBTTagCompound var1) { -- super.writeEntityToNBT(var1); -- var1.setInteger("CatType", this.getTameSkin()); -- } -- -- public void readEntityFromNBT(NBTTagCompound var1) { -- super.readEntityFromNBT(var1); -- this.setTameSkin(var1.getInteger("CatType")); -- } -- -+ this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setAttribute(0.30000001192092896D); -+ } -+ -+ /** -+ * Called when the mob is falling. Calculates and applies fall damage. -+ */ -+ protected void fall(float par1) {} -+ -+ /** -+ * (abstract) Protected helper method to write subclass entity data to NBT. -+ */ -+ public void writeEntityToNBT(NBTTagCompound par1NBTTagCompound) { -+ super.writeEntityToNBT(par1NBTTagCompound); -+ par1NBTTagCompound.setInteger("CatType", this.getTameSkin()); -+ } -+ -+ /** -+ * (abstract) Protected helper method to read subclass entity data from NBT. -+ */ -+ public void readEntityFromNBT(NBTTagCompound par1NBTTagCompound) { -+ super.readEntityFromNBT(par1NBTTagCompound); -+ this.setTameSkin(par1NBTTagCompound.getInteger("CatType")); -+ } -+ -+ /** -+ * Returns the sound this mob makes while it's alive. -+ */ - protected String getLivingSound() { -- return this.isTamed() ? (this.isInLove() ? "mob.cat.purr" : (this.ab.nextInt(4) == 0 ? "mob.cat.purreow" : "mob.cat.meow")) : ""; -+ return this.isTamed() ? (this.isInLove() ? "mob.cat.purr" : (this.rand.nextInt(4) == 0 ? "mob.cat.purreow" : "mob.cat.meow")) : ""; - } - -+ /** -+ * Returns the sound this mob makes when it is hurt. -+ */ - protected String getHurtSound() { - return "mob.cat.hitt"; - } - -+ /** -+ * Returns the sound this mob makes on death. -+ */ - protected String getDeathSound() { - return "mob.cat.hitt"; - } - -+ /** -+ * Returns the volume for the sounds this mob makes. -+ */ - protected float getSoundVolume() { - return 0.4F; - } - -+ /** -+ * Returns the item ID for the item the mob drops on death. -+ */ - protected int getDropItemId() { - return Item.leather.itemID; - } - -- public boolean attackEntityAsMob(Entity var1) { -- return var1.attackEntityFrom(DamageSource.causeMobDamage(this), 3.0F); -+ public boolean attackEntityAsMob(Entity par1Entity) { -+ return par1Entity.attackEntityFrom(DamageSource.causeMobDamage(this), 3.0F); - } - -- public boolean attackEntityFrom(DamageSource var1, float var2) { -- if(this.isEntityInvulnerable()) { -+ /** -+ * Called when the entity is attacked. -+ */ -+ public boolean attackEntityFrom(DamageSource par1DamageSource, float par2) { -+ if (this.isEntityInvulnerable()) { - return false; - } else { - this.aiSit.setSitting(false); -- return super.attackEntityFrom(var1, var2); -+ return super.attackEntityFrom(par1DamageSource, par2); - } - } - -- protected void dropFewItems(boolean var1, int var2) { -- } -- -- public boolean interact(EntityPlayer var1) { -- ItemStack var2 = var1.inventory.getCurrentItem(); -- if(this.isTamed()) { -- if(var1.getCommandSenderName().equalsIgnoreCase(this.getOwnerName()) && !this.worldObj.isRemote && !this.isBreedingItem(var2)) { -+ /** -+ * Drop 0-2 items of this living's type. @param par1 - Whether this entity has recently been hit by a player. @param -+ * par2 - Level of Looting used to kill this mob. -+ */ -+ protected void dropFewItems(boolean par1, int par2) {} -+ -+ /** -+ * Called when a player interacts with a mob. e.g. gets milk from a cow, gets into the saddle on a pig. -+ */ -+ public boolean interact(EntityPlayer par1EntityPlayer) { -+ ItemStack var2 = par1EntityPlayer.inventory.getCurrentItem(); -+ -+ if (this.isTamed()) { -+ if (par1EntityPlayer.getCommandSenderName().equalsIgnoreCase(this.getOwnerName()) && !this.worldObj.isRemote && !this.isBreedingItem(var2)) { - this.aiSit.setSitting(!this.isSitting()); - } -- } else if(this.aiTempt.isRunning() && var2 != null && var2.itemID == Item.fishRaw.itemID && var1.getDistanceSqToEntity(this) < 9.0D) { -- if(!var1.capabilities.isCreativeMode) { -+ } else if (this.aiTempt.isRunning() && var2 != null && var2.itemID == Item.fishRaw.itemID && par1EntityPlayer.getDistanceSqToEntity(this) < 9.0D) { -+ if (!par1EntityPlayer.capabilities.isCreativeMode) { - --var2.stackSize; - } - -- if(var2.stackSize <= 0) { -- var1.inventory.setInventorySlotContents(var1.inventory.currentItem, (ItemStack)null); -+ if (var2.stackSize <= 0) { -+ par1EntityPlayer.inventory.setInventorySlotContents(par1EntityPlayer.inventory.currentItem, (ItemStack)null); - } - -- if(!this.worldObj.isRemote) { -- if(this.ab.nextInt(3) == 0) { -+ if (!this.worldObj.isRemote) { -+ if (this.rand.nextInt(3) == 0) { - this.setTamed(true); -- this.setTameSkin(1 + this.worldObj.s.nextInt(3)); -- this.setOwner(var1.getCommandSenderName()); -+ this.setTameSkin(1 + this.worldObj.rand.nextInt(3)); -+ this.setOwner(par1EntityPlayer.getCommandSenderName()); - this.playTameEffect(true); - this.aiSit.setSitting(true); - this.worldObj.setEntityState(this, (byte)7); -@@ -141,12 +187,16 @@ - return true; - } - -- return super.interact(var1); -+ return super.interact(par1EntityPlayer); - } - -- public EntityOcelot spawnBabyAnimal(EntityAgeable var1) { -+ /** -+ * This function is used when two same-species animals in 'love mode' breed to generate the new baby animal. -+ */ -+ public EntityOcelot spawnBabyAnimal(EntityAgeable par1EntityAgeable) { - EntityOcelot var2 = new EntityOcelot(this.worldObj); -- if(this.isTamed()) { -+ -+ if (this.isTamed()) { - var2.setOwner(this.getOwnerName()); - var2.setTamed(true); - var2.setTameSkin(this.getTameSkin()); -@@ -155,19 +205,26 @@ - return var2; - } - -- public boolean isBreedingItem(ItemStack var1) { -- return var1 != null && var1.itemID == Item.fishRaw.itemID; -+ /** -+ * Checks if the parameter is an item which this animal can be fed to breed it (wheat, carrots or seeds depending on -+ * the animal type) -+ */ -+ public boolean isBreedingItem(ItemStack par1ItemStack) { -+ return par1ItemStack != null && par1ItemStack.itemID == Item.fishRaw.itemID; - } - -- public boolean canMateWith(EntityAnimal var1) { -- if(var1 == this) { -- return false; -- } else if(!this.isTamed()) { -- return false; -- } else if(!(var1 instanceof EntityOcelot)) { -+ /** -+ * Returns true if the mob is currently able to mate with the specified mob. -+ */ -+ public boolean canMateWith(EntityAnimal par1EntityAnimal) { -+ if (par1EntityAnimal == this) { -+ return false; -+ } else if (!this.isTamed()) { -+ return false; -+ } else if (!(par1EntityAnimal instanceof EntityOcelot)) { - return false; - } else { -- EntityOcelot var2 = (EntityOcelot)var1; -+ EntityOcelot var2 = (EntityOcelot)par1EntityAnimal; - return !var2.isTamed() ? false : this.isInLove() && var2.isInLove(); - } - } -@@ -176,24 +233,29 @@ - return this.dataWatcher.getWatchableObjectByte(18); - } - -- public void setTameSkin(int var1) { -- this.dataWatcher.updateObject(18, Byte.valueOf((byte)var1)); -+ public void setTameSkin(int par1) { -+ this.dataWatcher.updateObject(18, Byte.valueOf((byte)par1)); - } - -+ /** -+ * Checks if the entity's current position is a valid location to spawn this entity. -+ */ - public boolean getCanSpawnHere() { -- if(this.worldObj.s.nextInt(3) == 0) { -+ if (this.worldObj.rand.nextInt(3) == 0) { - return false; - } else { -- if(this.worldObj.checkNoEntityCollision(this.boundingBox) && this.worldObj.getCollidingBoundingBoxes(this, this.boundingBox).isEmpty() && !this.worldObj.isAnyLiquid(this.boundingBox)) { -+ if (this.worldObj.checkNoEntityCollision(this.boundingBox) && this.worldObj.getCollidingBoundingBoxes(this, this.boundingBox).isEmpty() && !this.worldObj.isAnyLiquid(this.boundingBox)) { - int var1 = MathHelper.floor_double(this.posX); - int var2 = MathHelper.floor_double(this.boundingBox.minY); - int var3 = MathHelper.floor_double(this.posZ); -- if(var2 < 63) { -+ -+ if (var2 < 63) { - return false; - } - - int var4 = this.worldObj.getBlockId(var1, var2 - 1, var3); -- if(var4 == Block.grass.blockID || var4 == Block.leaves.blockID) { -+ -+ if (var4 == Block.grass.blockID || var4 == Block.leaves.blockID) { - return true; - } - } -@@ -202,14 +264,18 @@ - } - } - -+ /** -+ * Gets the username of the entity. -+ */ - public String getEntityName() { - return this.hasCustomNameTag() ? this.getCustomNameTag() : (this.isTamed() ? "entity.Cat.name" : super.getEntityName()); - } - -- public EntityLivingData onSpawnWithEgg(EntityLivingData var1) { -- var1 = super.onSpawnWithEgg(var1); -- if(this.worldObj.s.nextInt(7) == 0) { -- for(int var2 = 0; var2 < 2; ++var2) { -+ public EntityLivingData onSpawnWithEgg(EntityLivingData par1EntityLivingData) { -+ par1EntityLivingData = super.onSpawnWithEgg(par1EntityLivingData); -+ -+ if (this.worldObj.rand.nextInt(7) == 0) { -+ for (int var2 = 0; var2 < 2; ++var2) { - EntityOcelot var3 = new EntityOcelot(this.worldObj); - var3.setLocationAndAngles(this.posX, this.posY, this.posZ, this.rotationYaw, 0.0F); - var3.setGrowingAge(-24000); -@@ -217,10 +283,10 @@ - } - } - -- return var1; -+ return par1EntityLivingData; - } - -- public EntityAgeable createChild(EntityAgeable var1) { -- return this.spawnBabyAnimal(var1); -+ public EntityAgeable createChild(EntityAgeable par1EntityAgeable) { -+ return this.spawnBabyAnimal(par1EntityAgeable); - } - } ---- net/minecraft/src/ComponentStrongholdLeftTurn.java -+++ net/minecraft/src/ComponentStrongholdLeftTurn.java -@@ -4,40 +4,46 @@ - import java.util.Random; - - public class ComponentStrongholdLeftTurn extends ComponentStronghold { -- public ComponentStrongholdLeftTurn() { -- } -- -- public ComponentStrongholdLeftTurn(int var1, Random var2, StructureBoundingBox var3, int var4) { -- super(var1); -- this.coordBaseMode = var4; -- this.field_143013_d = this.getRandomDoor(var2); -- this.boundingBox = var3; -- } -- -- public void buildComponent(StructureComponent var1, List var2, Random var3) { -- if(this.coordBaseMode != 2 && this.coordBaseMode != 3) { -- this.getNextComponentZ((ComponentStrongholdStairs2)var1, var2, var3, 1, 1); -+ public ComponentStrongholdLeftTurn() {} -+ -+ public ComponentStrongholdLeftTurn(int par1, Random par2Random, StructureBoundingBox par3StructureBoundingBox, int par4) { -+ super(par1); -+ this.coordBaseMode = par4; -+ this.field_143013_d = this.getRandomDoor(par2Random); -+ this.boundingBox = par3StructureBoundingBox; -+ } -+ -+ /** -+ * Initiates construction of the Structure Component picked, at the current Location of StructGen -+ */ -+ public void buildComponent(StructureComponent par1StructureComponent, List par2List, Random par3Random) { -+ if (this.coordBaseMode != 2 && this.coordBaseMode != 3) { -+ this.getNextComponentZ((ComponentStrongholdStairs2)par1StructureComponent, par2List, par3Random, 1, 1); - } else { -- this.getNextComponentX((ComponentStrongholdStairs2)var1, var2, var3, 1, 1); -+ this.getNextComponentX((ComponentStrongholdStairs2)par1StructureComponent, par2List, par3Random, 1, 1); - } -- -- } -- -- public static ComponentStrongholdLeftTurn findValidPlacement(List var0, Random var1, int var2, int var3, int var4, int var5, int var6) { -- StructureBoundingBox var7 = StructureBoundingBox.getComponentToAddBoundingBox(var2, var3, var4, -1, -1, 0, 5, 5, 5, var5); -- return canStrongholdGoDeeper(var7) && StructureComponent.findIntersecting(var0, var7) == null ? new ComponentStrongholdLeftTurn(var6, var1, var7, var5) : null; -- } -- -- public boolean addComponentParts(World var1, Random var2, StructureBoundingBox var3) { -- if(this.isLiquidInStructureBoundingBox(var1, var3)) { -+ } -+ -+ public static ComponentStrongholdLeftTurn findValidPlacement(List par0List, Random par1Random, int par2, int par3, int par4, int par5, int par6) { -+ StructureBoundingBox var7 = StructureBoundingBox.getComponentToAddBoundingBox(par2, par3, par4, -1, -1, 0, 5, 5, 5, par5); -+ return canStrongholdGoDeeper(var7) && StructureComponent.findIntersecting(par0List, var7) == null ? new ComponentStrongholdLeftTurn(par6, par1Random, var7, par5) : null; -+ } -+ -+ /** -+ * second Part of Structure generating, this for example places Spiderwebs, Mob Spawners, it closes Mineshafts at the -+ * end, it adds Fences... -+ */ -+ public boolean addComponentParts(World par1World, Random par2Random, StructureBoundingBox par3StructureBoundingBox) { -+ if (this.isLiquidInStructureBoundingBox(par1World, par3StructureBoundingBox)) { - return false; - } else { -- this.fillWithRandomizedBlocks(var1, var3, 0, 0, 0, 4, 4, 4, true, var2, StructureStrongholdPieces.getStrongholdStones()); -- this.placeDoor(var1, var2, var3, this.field_143013_d, 1, 1, 0); -- if(this.coordBaseMode != 2 && this.coordBaseMode != 3) { -- this.fillWithBlocks(var1, var3, 4, 1, 1, 4, 3, 3, 0, 0, false); -+ this.fillWithRandomizedBlocks(par1World, par3StructureBoundingBox, 0, 0, 0, 4, 4, 4, true, par2Random, StructureStrongholdPieces.getStrongholdStones()); -+ this.placeDoor(par1World, par2Random, par3StructureBoundingBox, this.field_143013_d, 1, 1, 0); -+ -+ if (this.coordBaseMode != 2 && this.coordBaseMode != 3) { -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 4, 1, 1, 4, 3, 3, 0, 0, false); - } else { -- this.fillWithBlocks(var1, var3, 0, 1, 1, 0, 3, 3, 0, 0, false); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 0, 1, 1, 0, 3, 3, 0, 0, false); - } - - return true; ---- /dev/null -+++ org/spoutcraft/api/material/item/GenericWeapon.java -@@ -1,0 +1,28 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.api.material.item; -+ -+import org.spoutcraft.api.material.Weapon; -+ -+public class GenericWeapon extends GenericItem implements Weapon { -+ public GenericWeapon(String name, int id) { -+ super(name, id); -+ } -+} ---- net/minecraft/src/EntityAITarget.java -+++ net/minecraft/src/EntityAITarget.java -@@ -1,38 +1,61 @@ - package net.minecraft.src; - - public abstract class EntityAITarget extends EntityAIBase { -+ -+ /** The entity that this task belongs to */ - protected EntityCreature taskOwner; -+ -+ /** -+ * If true, EntityAI targets must be able to be seen (cannot be blocked by walls) to be suitable targets. -+ */ - protected boolean shouldCheckSight; -+ -+ /** -+ * When true, only entities that can be reached with minimal effort will be targetted. -+ */ - private boolean nearbyOnly; -+ -+ /** -+ * When nearbyOnly is true: 0 -> No target, but OK to search; 1 -> Nearby target found; 2 -> Target too far. -+ */ - private int targetSearchStatus; -+ -+ /** -+ * When nearbyOnly is true, this throttles target searching to avoid excessive pathfinding. -+ */ - private int targetSearchDelay; - private int field_75298_g; - -- public EntityAITarget(EntityCreature var1, boolean var2) { -- this(var1, var2, false); -- } -- -- public EntityAITarget(EntityCreature var1, boolean var2, boolean var3) { -- this.taskOwner = var1; -- this.shouldCheckSight = var2; -- this.nearbyOnly = var3; -- } -- -+ public EntityAITarget(EntityCreature par1EntityCreature, boolean par2) { -+ this(par1EntityCreature, par2, false); -+ } -+ -+ public EntityAITarget(EntityCreature par1EntityCreature, boolean par2, boolean par3) { -+ this.taskOwner = par1EntityCreature; -+ this.shouldCheckSight = par2; -+ this.nearbyOnly = par3; -+ } -+ -+ /** -+ * Returns whether an in-progress EntityAIBase should continue executing -+ */ - public boolean continueExecuting() { - EntityLivingBase var1 = this.taskOwner.getAttackTarget(); -- if(var1 == null) { -+ -+ if (var1 == null) { - return false; -- } else if(!var1.isEntityAlive()) { -+ } else if (!var1.isEntityAlive()) { - return false; - } else { - double var2 = this.getTargetDistance(); -- if(this.taskOwner.getDistanceSqToEntity(var1) > var2 * var2) { -+ -+ if (this.taskOwner.getDistanceSqToEntity(var1) > var2 * var2) { - return false; - } else { -- if(this.shouldCheckSight) { -- if(this.taskOwner.getEntitySenses().canSee(var1)) { -+ if (this.shouldCheckSight) { -+ if (this.taskOwner.getEntitySenses().canSee(var1)) { - this.field_75298_g = 0; -- } else if(++this.field_75298_g > 60) { -+ } else if (++this.field_75298_g > 60) { - return false; - } - } -@@ -47,53 +70,62 @@ - return var1 == null ? 16.0D : var1.getAttributeValue(); - } - -+ /** -+ * Execute a one shot task or start executing a continuous task -+ */ - public void startExecuting() { - this.targetSearchStatus = 0; - this.targetSearchDelay = 0; - this.field_75298_g = 0; - } - -+ /** -+ * Resets the task -+ */ - public void resetTask() { - this.taskOwner.setAttackTarget((EntityLivingBase)null); - } - -- protected boolean isSuitableTarget(EntityLivingBase var1, boolean var2) { -- if(var1 == null) { -- return false; -- } else if(var1 == this.taskOwner) { -- return false; -- } else if(!var1.isEntityAlive()) { -- return false; -- } else if(!this.taskOwner.canAttackClass(var1.getClass())) { -+ /** -+ * A method used to see if an entity is a suitable target through a number of checks. -+ */ -+ protected boolean isSuitableTarget(EntityLivingBase par1EntityLivingBase, boolean par2) { -+ if (par1EntityLivingBase == null) { -+ return false; -+ } else if (par1EntityLivingBase == this.taskOwner) { -+ return false; -+ } else if (!par1EntityLivingBase.isEntityAlive()) { -+ return false; -+ } else if (!this.taskOwner.canAttackClass(par1EntityLivingBase.getClass())) { - return false; - } else { -- if(this.taskOwner instanceof EntityOwnable && org.apache.commons.lang3.StringUtils.isNotEmpty(((EntityOwnable)this.taskOwner).getOwnerName())) { -- if(var1 instanceof EntityOwnable && ((EntityOwnable)this.taskOwner).getOwnerName().equals(((EntityOwnable)var1).getOwnerName())) { -+ if (this.taskOwner instanceof EntityOwnable && org.apache.commons.lang3.StringUtils.isNotEmpty(((EntityOwnable)this.taskOwner).getOwnerName())) { -+ if (par1EntityLivingBase instanceof EntityOwnable && ((EntityOwnable)this.taskOwner).getOwnerName().equals(((EntityOwnable)par1EntityLivingBase).getOwnerName())) { - return false; - } - -- if(var1 == ((EntityOwnable)this.taskOwner).getOwner()) { -+ if (par1EntityLivingBase == ((EntityOwnable)this.taskOwner).getOwner()) { - return false; - } -- } else if(var1 instanceof EntityPlayer && !var2 && ((EntityPlayer)var1).capabilities.disableDamage) { -+ } else if (par1EntityLivingBase instanceof EntityPlayer && !par2 && ((EntityPlayer)par1EntityLivingBase).capabilities.disableDamage) { - return false; - } - -- if(!this.taskOwner.func_110176_b(MathHelper.floor_double(var1.posX), MathHelper.floor_double(var1.posY), MathHelper.floor_double(var1.posZ))) { -+ if (!this.taskOwner.func_110176_b(MathHelper.floor_double(par1EntityLivingBase.posX), MathHelper.floor_double(par1EntityLivingBase.posY), MathHelper.floor_double(par1EntityLivingBase.posZ))) { - return false; -- } else if(this.shouldCheckSight && !this.taskOwner.getEntitySenses().canSee(var1)) { -+ } else if (this.shouldCheckSight && !this.taskOwner.getEntitySenses().canSee(par1EntityLivingBase)) { - return false; - } else { -- if(this.nearbyOnly) { -- if(--this.targetSearchDelay <= 0) { -+ if (this.nearbyOnly) { -+ if (--this.targetSearchDelay <= 0) { - this.targetSearchStatus = 0; - } - -- if(this.targetSearchStatus == 0) { -- this.targetSearchStatus = this.canEasilyReach(var1) ? 1 : 2; -+ if (this.targetSearchStatus == 0) { -+ this.targetSearchStatus = this.canEasilyReach(par1EntityLivingBase) ? 1 : 2; - } - -- if(this.targetSearchStatus == 2) { -+ if (this.targetSearchStatus == 2) { - return false; - } - } -@@ -103,18 +135,23 @@ - } - } - -- private boolean canEasilyReach(EntityLivingBase var1) { -+ /** -+ * Checks to see if this entity can find a short path to the given target. -+ */ -+ private boolean canEasilyReach(EntityLivingBase par1EntityLivingBase) { - this.targetSearchDelay = 10 + this.taskOwner.getRNG().nextInt(5); -- PathEntity var2 = this.taskOwner.getNavigator().getPathToEntityLiving(var1); -- if(var2 == null) { -+ PathEntity var2 = this.taskOwner.getNavigator().getPathToEntityLiving(par1EntityLivingBase); -+ -+ if (var2 == null) { - return false; - } else { - PathPoint var3 = var2.getFinalPathPoint(); -- if(var3 == null) { -+ -+ if (var3 == null) { - return false; - } else { -- int var4 = var3.xCoord - MathHelper.floor_double(var1.posX); -- int var5 = var3.zCoord - MathHelper.floor_double(var1.posZ); -+ int var4 = var3.xCoord - MathHelper.floor_double(par1EntityLivingBase.posX); -+ int var5 = var3.zCoord - MathHelper.floor_double(par1EntityLivingBase.posZ); - return (double)(var4 * var4 + var5 * var5) <= 2.25D; - } - } ---- net/minecraft/src/RenderCreeper.java -+++ net/minecraft/src/RenderCreeper.java -@@ -5,20 +5,26 @@ - public class RenderCreeper extends RenderLiving { - private static final ResourceLocation armoredCreeperTextures = new ResourceLocation("textures/entity/creeper/creeper_armor.png"); - private static final ResourceLocation creeperTextures = new ResourceLocation("textures/entity/creeper/creeper.png"); -+ -+ /** The creeper model. */ - private ModelBase creeperModel = new ModelCreeper(2.0F); - - public RenderCreeper() { - super(new ModelCreeper(), 0.5F); - } - -- protected void updateCreeperScale(EntityCreeper var1, float var2) { -- float var3 = var1.getCreeperFlashIntensity(var2); -+ /** -+ * Updates creeper scale in prerender callback -+ */ -+ protected void updateCreeperScale(EntityCreeper par1EntityCreeper, float par2) { -+ float var3 = par1EntityCreeper.getCreeperFlashIntensity(par2); - float var4 = 1.0F + MathHelper.sin(var3 * 100.0F) * var3 * 0.01F; -- if(var3 < 0.0F) { -+ -+ if (var3 < 0.0F) { - var3 = 0.0F; - } - -- if(var3 > 1.0F) { -+ if (var3 > 1.0F) { - var3 = 1.0F; - } - -@@ -29,17 +35,22 @@ - GL11.glScalef(var5, var6, var5); - } - -- protected int updateCreeperColorMultiplier(EntityCreeper var1, float var2, float var3) { -- float var4 = var1.getCreeperFlashIntensity(var3); -- if((int)(var4 * 10.0F) % 2 == 0) { -+ /** -+ * Updates color multiplier based on creeper state called by getColorMultiplier -+ */ -+ protected int updateCreeperColorMultiplier(EntityCreeper par1EntityCreeper, float par2, float par3) { -+ float var4 = par1EntityCreeper.getCreeperFlashIntensity(par3); -+ -+ if ((int)(var4 * 10.0F) % 2 == 0) { - return 0; - } else { - int var5 = (int)(var4 * 0.2F * 255.0F); -- if(var5 < 0) { -+ -+ if (var5 < 0) { - var5 = 0; - } - -- if(var5 > 255) { -+ if (var5 > 255) { - var5 = 255; - } - -@@ -50,16 +61,19 @@ - } - } - -- protected int renderCreeperPassModel(EntityCreeper var1, int var2, float var3) { -- if(var1.getPowered()) { -- if(var1.isInvisible()) { -+ /** -+ * A method used to render a creeper's powered form as a pass model. -+ */ -+ protected int renderCreeperPassModel(EntityCreeper par1EntityCreeper, int par2, float par3) { -+ if (par1EntityCreeper.getPowered()) { -+ if (par1EntityCreeper.isInvisible()) { - GL11.glDepthMask(false); - } else { - GL11.glDepthMask(true); - } - -- if(var2 == 1) { -- float var4 = (float)var1.ticksExisted + var3; -+ if (par2 == 1) { -+ float var4 = (float)par1EntityCreeper.ticksExisted + par3; - this.bindTexture(armoredCreeperTextures); - GL11.glMatrixMode(GL11.GL_TEXTURE); - GL11.glLoadIdentity(); -@@ -76,7 +90,7 @@ - return 1; - } - -- if(var2 == 2) { -+ if (par2 == 2) { - GL11.glMatrixMode(GL11.GL_TEXTURE); - GL11.glLoadIdentity(); - GL11.glMatrixMode(GL11.GL_MODELVIEW); -@@ -88,31 +102,44 @@ - return -1; - } - -- protected int func_77061_b(EntityCreeper var1, int var2, float var3) { -+ protected int func_77061_b(EntityCreeper par1EntityCreeper, int par2, float par3) { - return -1; - } - -- protected ResourceLocation getCreeperTextures(EntityCreeper var1) { -+ protected ResourceLocation getCreeperTextures(EntityCreeper par1EntityCreeper) { - return creeperTextures; - } - -- protected void preRenderCallback(EntityLivingBase var1, float var2) { -- this.updateCreeperScale((EntityCreeper)var1, var2); -- } -- -- protected int getColorMultiplier(EntityLivingBase var1, float var2, float var3) { -- return this.updateCreeperColorMultiplier((EntityCreeper)var1, var2, var3); -- } -- -- protected int shouldRenderPass(EntityLivingBase var1, int var2, float var3) { -- return this.renderCreeperPassModel((EntityCreeper)var1, var2, var3); -- } -- -- protected int inheritRenderPass(EntityLivingBase var1, int var2, float var3) { -- return this.func_77061_b((EntityCreeper)var1, var2, var3); -- } -- -- protected ResourceLocation getEntityTexture(Entity var1) { -- return this.getCreeperTextures((EntityCreeper)var1); -+ /** -+ * Allows the render to do any OpenGL state modifications necessary before the model is rendered. Args: entityLiving, -+ * partialTickTime -+ */ -+ protected void preRenderCallback(EntityLivingBase par1EntityLivingBase, float par2) { -+ this.updateCreeperScale((EntityCreeper)par1EntityLivingBase, par2); -+ } -+ -+ /** -+ * Returns an ARGB int color back. Args: entityLiving, lightBrightness, partialTickTime -+ */ -+ protected int getColorMultiplier(EntityLivingBase par1EntityLivingBase, float par2, float par3) { -+ return this.updateCreeperColorMultiplier((EntityCreeper)par1EntityLivingBase, par2, par3); -+ } -+ -+ /** -+ * Queries whether should render the specified pass or not. -+ */ -+ protected int shouldRenderPass(EntityLivingBase par1EntityLivingBase, int par2, float par3) { -+ return this.renderCreeperPassModel((EntityCreeper)par1EntityLivingBase, par2, par3); -+ } -+ -+ protected int inheritRenderPass(EntityLivingBase par1EntityLivingBase, int par2, float par3) { -+ return this.func_77061_b((EntityCreeper)par1EntityLivingBase, par2, par3); -+ } -+ -+ /** -+ * Returns the location of an entity's texture. Doesn't seem to be called unless you call Render.bindEntityTexture. -+ */ -+ protected ResourceLocation getEntityTexture(Entity par1Entity) { -+ return this.getCreeperTextures((EntityCreeper)par1Entity); - } - } ---- /dev/null -+++ org/spoutcraft/client/gui/FilterItem.java -@@ -1,0 +1,24 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.client.gui; -+ -+public interface FilterItem { -+ public boolean matches(Object obj); -+} ---- net/minecraft/src/TileEntityFurnace.java -+++ net/minecraft/src/TileEntityFurnace.java -@@ -1,34 +1,58 @@ - package net.minecraft.src; - - public class TileEntityFurnace extends TileEntity implements ISidedInventory { -- private static final int[] slots_top = new int[]{0}; -- private static final int[] slots_bottom = new int[]{2, 1}; -- private static final int[] slots_sides = new int[]{1}; -+ private static final int[] slots_top = new int[] {0}; -+ private static final int[] slots_bottom = new int[] {2, 1}; -+ private static final int[] slots_sides = new int[] {1}; -+ -+ /** -+ * The ItemStacks that hold the items currently being used in the furnace -+ */ - private ItemStack[] furnaceItemStacks = new ItemStack[3]; -+ -+ /** The number of ticks that the furnace will keep burning */ - public int furnaceBurnTime; -+ -+ /** -+ * The number of ticks that a fresh copy of the currently-burning item would keep the furnace burning for -+ */ - public int currentItemBurnTime; -+ -+ /** The number of ticks that the current item has been cooking for */ - public int furnaceCookTime; -- private String h; -+ private String field_94130_e; - -+ /** -+ * Returns the number of slots in the inventory. -+ */ - public int getSizeInventory() { - return this.furnaceItemStacks.length; - } - -- public ItemStack getStackInSlot(int var1) { -- return this.furnaceItemStacks[var1]; -+ /** -+ * Returns the stack in slot i -+ */ -+ public ItemStack getStackInSlot(int par1) { -+ return this.furnaceItemStacks[par1]; - } - -- public ItemStack decrStackSize(int var1, int var2) { -- if(this.furnaceItemStacks[var1] != null) { -+ /** -+ * Removes from an inventory slot (first arg) up to a specified number (second arg) of items and returns them in a new -+ * stack. -+ */ -+ public ItemStack decrStackSize(int par1, int par2) { -+ if (this.furnaceItemStacks[par1] != null) { - ItemStack var3; -- if(this.furnaceItemStacks[var1].stackSize <= var2) { -- var3 = this.furnaceItemStacks[var1]; -- this.furnaceItemStacks[var1] = null; -+ -+ if (this.furnaceItemStacks[par1].stackSize <= par2) { -+ var3 = this.furnaceItemStacks[par1]; -+ this.furnaceItemStacks[par1] = null; - return var3; - } else { -- var3 = this.furnaceItemStacks[var1].splitStack(var2); -- if(this.furnaceItemStacks[var1].stackSize == 0) { -- this.furnaceItemStacks[var1] = null; -+ var3 = this.furnaceItemStacks[par1].splitStack(par2); -+ -+ if (this.furnaceItemStacks[par1].stackSize == 0) { -+ this.furnaceItemStacks[par1] = null; - } - - return var3; -@@ -38,66 +62,90 @@ - } - } - -- public ItemStack getStackInSlotOnClosing(int var1) { -- if(this.furnaceItemStacks[var1] != null) { -- ItemStack var2 = this.furnaceItemStacks[var1]; -- this.furnaceItemStacks[var1] = null; -+ /** -+ * When some containers are closed they call this on each slot, then drop whatever it returns as an EntityItem - like -+ * when you close a workbench GUI. -+ */ -+ public ItemStack getStackInSlotOnClosing(int par1) { -+ if (this.furnaceItemStacks[par1] != null) { -+ ItemStack var2 = this.furnaceItemStacks[par1]; -+ this.furnaceItemStacks[par1] = null; - return var2; - } else { - return null; - } - } - -- public void setInventorySlotContents(int var1, ItemStack var2) { -- this.furnaceItemStacks[var1] = var2; -- if(var2 != null && var2.stackSize > this.getInventoryStackLimit()) { -- var2.stackSize = this.getInventoryStackLimit(); -+ /** -+ * Sets the given item stack to the specified slot in the inventory (can be crafting or armor sections). -+ */ -+ public void setInventorySlotContents(int par1, ItemStack par2ItemStack) { -+ this.furnaceItemStacks[par1] = par2ItemStack; -+ -+ if (par2ItemStack != null && par2ItemStack.stackSize > this.getInventoryStackLimit()) { -+ par2ItemStack.stackSize = this.getInventoryStackLimit(); - } -- - } - -+ /** -+ * Returns the name of the inventory. -+ */ - public String getInvName() { -- return this.isInvNameLocalized() ? this.h : "container.furnace"; -+ return this.isInvNameLocalized() ? this.field_94130_e : "container.furnace"; - } - -+ /** -+ * If this returns false, the inventory name will be used as an unlocalized name, and translated into the player's -+ * language. Otherwise it will be used directly. -+ */ - public boolean isInvNameLocalized() { -- return this.h != null && this.h.length() > 0; -- } -- -- public void setGuiDisplayName(String var1) { -- this.h = var1; -- } -- -- public void readFromNBT(NBTTagCompound var1) { -- super.readFromNBT(var1); -- NBTTagList var2 = var1.getTagList("Items"); -+ return this.field_94130_e != null && this.field_94130_e.length() > 0; -+ } -+ -+ /** -+ * Sets the custom display name to use when opening a GUI linked to this tile entity. -+ */ -+ public void setGuiDisplayName(String par1Str) { -+ this.field_94130_e = par1Str; -+ } -+ -+ /** -+ * Reads a tile entity from NBT. -+ */ -+ public void readFromNBT(NBTTagCompound par1NBTTagCompound) { -+ super.readFromNBT(par1NBTTagCompound); -+ NBTTagList var2 = par1NBTTagCompound.getTagList("Items"); - this.furnaceItemStacks = new ItemStack[this.getSizeInventory()]; - -- for(int var3 = 0; var3 < var2.tagCount(); ++var3) { -+ for (int var3 = 0; var3 < var2.tagCount(); ++var3) { - NBTTagCompound var4 = (NBTTagCompound)var2.tagAt(var3); - byte var5 = var4.getByte("Slot"); -- if(var5 >= 0 && var5 < this.furnaceItemStacks.length) { -+ -+ if (var5 >= 0 && var5 < this.furnaceItemStacks.length) { - this.furnaceItemStacks[var5] = ItemStack.loadItemStackFromNBT(var4); - } - } - -- this.furnaceBurnTime = var1.getShort("BurnTime"); -- this.furnaceCookTime = var1.getShort("CookTime"); -+ this.furnaceBurnTime = par1NBTTagCompound.getShort("BurnTime"); -+ this.furnaceCookTime = par1NBTTagCompound.getShort("CookTime"); - this.currentItemBurnTime = getItemBurnTime(this.furnaceItemStacks[1]); -- if(var1.hasKey("CustomName")) { -- this.h = var1.getString("CustomName"); -+ -+ if (par1NBTTagCompound.hasKey("CustomName")) { -+ this.field_94130_e = par1NBTTagCompound.getString("CustomName"); - } -- - } - -- public void writeToNBT(NBTTagCompound var1) { -- super.writeToNBT(var1); -- var1.setShort("BurnTime", (short)this.furnaceBurnTime); -- var1.setShort("CookTime", (short)this.furnaceCookTime); -+ /** -+ * Writes a tile entity to NBT. -+ */ -+ public void writeToNBT(NBTTagCompound par1NBTTagCompound) { -+ super.writeToNBT(par1NBTTagCompound); -+ par1NBTTagCompound.setShort("BurnTime", (short)this.furnaceBurnTime); -+ par1NBTTagCompound.setShort("CookTime", (short)this.furnaceCookTime); - NBTTagList var2 = new NBTTagList(); - -- for(int var3 = 0; var3 < this.furnaceItemStacks.length; ++var3) { -- if(this.furnaceItemStacks[var3] != null) { -+ for (int var3 = 0; var3 < this.furnaceItemStacks.length; ++var3) { -+ if (this.furnaceItemStacks[var3] != null) { - NBTTagCompound var4 = new NBTTagCompound(); - var4.setByte("Slot", (byte)var3); - this.furnaceItemStacks[var3].writeToNBT(var4); -@@ -105,48 +153,71 @@ - } - } - -- var1.setTag("Items", var2); -- if(this.isInvNameLocalized()) { -- var1.setString("CustomName", this.h); -+ par1NBTTagCompound.setTag("Items", var2); -+ -+ if (this.isInvNameLocalized()) { -+ par1NBTTagCompound.setString("CustomName", this.field_94130_e); - } -- - } - -+ /** -+ * Returns the maximum stack size for a inventory slot. Seems to always be 64, possibly will be extended. *Isn't this -+ * more of a set than a get?* -+ */ - public int getInventoryStackLimit() { - return 64; - } - -- public int getCookProgressScaled(int var1) { -- return this.furnaceCookTime * var1 / 200; -+ /** -+ * Returns an integer between 0 and the passed value representing how close the current item is to being completely -+ * cooked -+ */ -+ public int getCookProgressScaled(int par1) { -+ return this.furnaceCookTime * par1 / 200; - } - -- public int getBurnTimeRemainingScaled(int var1) { -- if(this.currentItemBurnTime == 0) { -+ /** -+ * Returns an integer between 0 and the passed value representing how much burn time is left on the current fuel item, -+ * where 0 means that the item is exhausted and the passed value means that the item is fresh -+ */ -+ public int getBurnTimeRemainingScaled(int par1) { -+ if (this.currentItemBurnTime == 0) { - this.currentItemBurnTime = 200; - } - -- return this.furnaceBurnTime * var1 / this.currentItemBurnTime; -+ return this.furnaceBurnTime * par1 / this.currentItemBurnTime; - } - -+ /** -+ * Returns true if the furnace is currently burning -+ */ - public boolean isBurning() { - return this.furnaceBurnTime > 0; - } - -+ /** -+ * Allows the entity to update its state. Overridden in most subclasses, e.g. the mob spawner uses this to count ticks -+ * and creates a new spawn inside its implementation. -+ */ - public void updateEntity() { - boolean var1 = this.furnaceBurnTime > 0; - boolean var2 = false; -- if(this.furnaceBurnTime > 0) { -+ -+ if (this.furnaceBurnTime > 0) { - --this.furnaceBurnTime; - } - -- if(!this.worldObj.isRemote) { -- if(this.furnaceBurnTime == 0 && this.canSmelt()) { -+ if (!this.worldObj.isRemote) { -+ if (this.furnaceBurnTime == 0 && this.canSmelt()) { - this.currentItemBurnTime = this.furnaceBurnTime = getItemBurnTime(this.furnaceItemStacks[1]); -- if(this.furnaceBurnTime > 0) { -+ -+ if (this.furnaceBurnTime > 0) { - var2 = true; -- if(this.furnaceItemStacks[1] != null) { -+ -+ if (this.furnaceItemStacks[1] != null) { - --this.furnaceItemStacks[1].stackSize; -- if(this.furnaceItemStacks[1].stackSize == 0) { -+ -+ if (this.furnaceItemStacks[1].stackSize == 0) { - Item var3 = this.furnaceItemStacks[1].getItem().getContainerItem(); - this.furnaceItemStacks[1] = var3 != null ? new ItemStack(var3) : null; - } -@@ -154,9 +225,10 @@ - } - } - -- if(this.isBurning() && this.canSmelt()) { -+ if (this.isBurning() && this.canSmelt()) { - ++this.furnaceCookTime; -- if(this.furnaceCookTime == 200) { -+ -+ if (this.furnaceCookTime == 200) { - this.furnaceCookTime = 0; - this.smeltItem(); - var2 = true; -@@ -165,20 +237,22 @@ - this.furnaceCookTime = 0; - } - -- if(var1 != this.furnaceBurnTime > 0) { -+ if (var1 != this.furnaceBurnTime > 0) { - var2 = true; - BlockFurnace.updateFurnaceBlockState(this.furnaceBurnTime > 0, this.worldObj, this.xCoord, this.yCoord, this.zCoord); - } - } - -- if(var2) { -+ if (var2) { - this.onInventoryChanged(); - } -- - } - -+ /** -+ * Returns true if the furnace can smelt an item, i.e. has a source item, destination stack isn't full, etc. -+ */ - private boolean canSmelt() { -- if(this.furnaceItemStacks[0] == null) { -+ if (this.furnaceItemStacks[0] == null) { - return false; - } else { - ItemStack var1 = FurnaceRecipes.smelting().getSmeltingResult(this.furnaceItemStacks[0].getItem().itemID); -@@ -186,40 +260,49 @@ - } - } - -+ /** -+ * Turn one item from the furnace source stack into the appropriate smelted item in the furnace result stack -+ */ - public void smeltItem() { -- if(this.canSmelt()) { -+ if (this.canSmelt()) { - ItemStack var1 = FurnaceRecipes.smelting().getSmeltingResult(this.furnaceItemStacks[0].getItem().itemID); -- if(this.furnaceItemStacks[2] == null) { -+ -+ if (this.furnaceItemStacks[2] == null) { - this.furnaceItemStacks[2] = var1.copy(); -- } else if(this.furnaceItemStacks[2].itemID == var1.itemID) { -+ } else if (this.furnaceItemStacks[2].itemID == var1.itemID) { - ++this.furnaceItemStacks[2].stackSize; - } - - --this.furnaceItemStacks[0].stackSize; -- if(this.furnaceItemStacks[0].stackSize <= 0) { -+ -+ if (this.furnaceItemStacks[0].stackSize <= 0) { - this.furnaceItemStacks[0] = null; - } -- - } - } - -- public static int getItemBurnTime(ItemStack var0) { -- if(var0 == null) { -+ /** -+ * Returns the number of ticks that the supplied fuel item will keep the furnace burning, or 0 if the item isn't fuel -+ */ -+ public static int getItemBurnTime(ItemStack par0ItemStack) { -+ if (par0ItemStack == null) { - return 0; - } else { -- int var1 = var0.getItem().itemID; -- Item var2 = var0.getItem(); -- if(var1 < 256 && Block.blocksList[var1] != null) { -+ int var1 = par0ItemStack.getItem().itemID; -+ Item var2 = par0ItemStack.getItem(); -+ -+ if (var1 < 256 && Block.blocksList[var1] != null) { - Block var3 = Block.blocksList[var1]; -- if(var3 == Block.woodSingleSlab) { -+ -+ if (var3 == Block.woodSingleSlab) { - return 150; - } - -- if(var3.blockMaterial == Material.wood) { -+ if (var3.blockMaterial == Material.wood) { - return 300; - } - -- if(var3 == Block.coalBlock) { -+ if (var3 == Block.coalBlock) { - return 16000; - } - } -@@ -228,33 +311,50 @@ - } - } - -- public static boolean isItemFuel(ItemStack var0) { -- return getItemBurnTime(var0) > 0; -- } -- -- public boolean isUseableByPlayer(EntityPlayer var1) { -- return this.worldObj.getBlockTileEntity(this.xCoord, this.yCoord, this.zCoord) != this ? false : var1.getDistanceSq((double)this.xCoord + 0.5D, (double)this.yCoord + 0.5D, (double)this.zCoord + 0.5D) <= 64.0D; -- } -- -- public void openChest() { -- } -- -- public void closeChest() { -- } -- -- public boolean isItemValidForSlot(int var1, ItemStack var2) { -- return var1 == 2 ? false : (var1 == 1 ? isItemFuel(var2) : true); -- } -- -- public int[] getSlotsForFace(int var1) { -- return var1 == 0 ? slots_bottom : (var1 == 1 ? slots_top : slots_sides); -- } -- -- public boolean canInsertItem(int var1, ItemStack var2, int var3) { -- return this.isItemValidForSlot(var1, var2); -- } -- -- public boolean canExtractItem(int var1, ItemStack var2, int var3) { -- return var3 != 0 || var1 != 1 || var2.itemID == Item.bucketEmpty.itemID; -+ /** -+ * Return true if item is a fuel source (getItemBurnTime() > 0). -+ */ -+ public static boolean isItemFuel(ItemStack par0ItemStack) { -+ return getItemBurnTime(par0ItemStack) > 0; -+ } -+ -+ /** -+ * Do not make give this method the name canInteractWith because it clashes with Container -+ */ -+ public boolean isUseableByPlayer(EntityPlayer par1EntityPlayer) { -+ return this.worldObj.getBlockTileEntity(this.xCoord, this.yCoord, this.zCoord) != this ? false : par1EntityPlayer.getDistanceSq((double)this.xCoord + 0.5D, (double)this.yCoord + 0.5D, (double)this.zCoord + 0.5D) <= 64.0D; -+ } -+ -+ public void openChest() {} -+ -+ public void closeChest() {} -+ -+ /** -+ * Returns true if automation is allowed to insert the given stack (ignoring stack size) into the given slot. -+ */ -+ public boolean isItemValidForSlot(int par1, ItemStack par2ItemStack) { -+ return par1 == 2 ? false : (par1 == 1 ? isItemFuel(par2ItemStack) : true); -+ } -+ -+ /** -+ * Returns an array containing the indices of the slots that can be accessed by automation on the given side of this -+ * block. -+ */ -+ public int[] getAccessibleSlotsFromSide(int par1) { -+ return par1 == 0 ? slots_bottom : (par1 == 1 ? slots_top : slots_sides); -+ } -+ -+ /** -+ * Returns true if automation can insert the given item in the given slot from the given side. Args: Slot, item, side -+ */ -+ public boolean canInsertItem(int par1, ItemStack par2ItemStack, int par3) { -+ return this.isItemValidForSlot(par1, par2ItemStack); -+ } -+ -+ /** -+ * Returns true if automation can extract the given item in the given slot from the given side. Args: Slot, item, side -+ */ -+ public boolean canExtractItem(int par1, ItemStack par2ItemStack, int par3) { -+ return par3 != 0 || par1 != 1 || par2ItemStack.itemID == Item.bucketEmpty.itemID; - } - } ---- /dev/null -+++ org/spoutcraft/client/gui/server/PollResult.java -@@ -1,0 +1,275 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.client.gui.server; -+ -+import java.io.BufferedReader; -+import java.io.DataInputStream; -+import java.io.DataOutputStream; -+import java.io.IOException; -+import java.io.InputStreamReader; -+import java.io.OutputStreamWriter; -+import java.net.InetSocketAddress; -+import java.net.MalformedURLException; -+import java.net.Socket; -+import java.net.URL; -+import java.net.URLConnection; -+import java.net.URLEncoder; -+ -+import gnu.trove.map.hash.TIntObjectHashMap; -+ -+import org.spoutcraft.client.SpoutClient; -+import org.spoutcraft.client.util.NetworkUtils; -+ -+public class PollResult { -+ protected int ping; -+ protected int players; -+ protected int maxPlayers; -+ protected String motd = ""; -+ protected int protocolVersion; -+ protected String version; -+ protected String ip; -+ protected int port; -+ -+ protected int databaseId = -1; -+ -+ public static final int PING_POLLING = -1; -+ public static final int PING_UNKNOWN = -2; -+ public static final int PING_TIMEOUT = -3; -+ public static final int PING_BAD_MESSAGE = -4; -+ protected boolean polling = false; -+ protected long pollStart; -+ protected static volatile int numPolling = 0; -+ private static final int maxPollingThreads; -+ -+ protected PollThread currentThread; -+ -+ protected ServerModel favorites = SpoutClient.getInstance().getServerManager().getFavorites(); -+ protected ServerListModel serverList = SpoutClient.getInstance().getServerManager().getServerList(); -+ -+ protected static TIntObjectHashMap recentResults = new TIntObjectHashMap(); -+ protected static Thread send = null; -+ private boolean sent = false; -+ -+ static { -+ maxPollingThreads = 5 + (5 * Runtime.getRuntime().availableProcessors()); -+ } -+ -+ protected PollResult(String ip, int port, int uid) { -+ setIp(ip); -+ setPort(port); -+ setDatabaseId(uid); -+ } -+ -+ public int getPing() { -+ return ping; -+ } -+ -+ public void setPing(int ping) { -+ this.ping = ping; -+ } -+ -+ public int getPlayers() { -+ return players; -+ } -+ -+ public void setPlayers(int players) { -+ this.players = players; -+ } -+ -+ public int getMaxPlayers() { -+ return maxPlayers; -+ } -+ -+ public void setMaxPlayers(int maxPlayers) { -+ this.maxPlayers = maxPlayers; -+ } -+ -+ public String getIp() { -+ return ip; -+ } -+ -+ public void setIp(String ip) { -+ this.ip = ip; -+ } -+ -+ public int getPort() { -+ return port; -+ } -+ -+ public void setPort(int port) { -+ this.port = port; -+ } -+ -+ public void poll() { -+ if (!isPolling()) { -+ currentThread = new PollThread(); -+ currentThread.start(); -+ } -+ } -+ -+ public static PollResult getPoll(String ip, int port, int uid) { -+ String hash = ip + ":" + port; -+ PollResult result = recentResults.get(hash.hashCode()); -+ if (result == null) { -+ result = new PollResult(ip, port, uid); -+ recentResults.put(hash.hashCode(), result); -+ result.poll(); -+ } -+ return result; -+ } -+ -+ public String getVersion() { -+ return version; -+ } -+ -+ public void setVersion(String version) { -+ this.version = version; -+ } -+ -+ public int getProtocolVersion() { -+ return protocolVersion; -+ } -+ -+ public void setProtocolVersion(int protocolVersion) { -+ this.protocolVersion = protocolVersion; -+ } -+ -+ public String getMotd() { -+ return motd; -+ } -+ -+ public void setMotd(String motd) { -+ this.motd = motd; -+ } -+ -+ public int getDatabaseId() { -+ return databaseId; -+ } -+ -+ public void setDatabaseId(int databaseId) { -+ this.databaseId = databaseId; -+ } -+ -+ public boolean isPolling() { -+ return polling; -+ } -+ -+ public void endPolling() { -+ if (polling) { -+ polling = false; -+ numPolling--; -+ } -+ } -+ -+ protected class PollThread extends Thread { -+ @Override -+ public void run() { -+ while (numPolling >= maxPollingThreads) { -+ try { -+ sleep(10); -+ } catch (InterruptedException e) {} -+ } -+ numPolling ++; -+ polling = true; -+ favorites.setPolling(true); -+ Socket sock = null; -+ DataInputStream input = null; -+ DataOutputStream output = null; -+ try { -+ long start = System.currentTimeMillis(); -+ sock = new Socket(); -+ sock.setSoTimeout(10000); -+ InetSocketAddress address = NetworkUtils.resolve(ip, port); -+ if (address.isUnresolved()) { -+ ping = PING_UNKNOWN; -+ return; -+ } -+ sock.connect(address, 10000); -+ sock.setTcpNoDelay(true); -+ sock.setTrafficClass(18); -+ -+ input = new DataInputStream(sock.getInputStream()); -+ output = new DataOutputStream(sock.getOutputStream()); -+ -+ // Packet ID is 254 -+ output.write(254); -+ // Writes 1 for getting extended server information since 1.4 -+ output.writeByte(1); -+ -+ // Server will return a packet 255 with the data as string -+ if (input.read() != 255) { -+ ping = PING_BAD_MESSAGE; -+ return; -+ } -+ -+ StringBuilder builder = new StringBuilder(); -+ short size = input.readShort(); -+ for (int i = 0; i < size; i++) { -+ builder.append(input.readChar()); -+ } -+ -+ long end = System.currentTimeMillis(); -+ String sPacket = builder.toString(); -+ ping = (int) (end - start); -+ -+ // Check if we have new format here (1.4), and fall back to old format if not -+ if (sPacket.startsWith("\u00a71")) { -+ String split[] = sPacket.split("\u0000"); -+ protocolVersion = Integer.valueOf(split[1]); -+ version = split[2]; -+ synchronized (motd) { -+ motd = split[3]; -+ } -+ players = Integer.valueOf(split[4]); -+ maxPlayers = Integer.valueOf(split[5]); -+ } -+ else { -+ String split[] = sPacket.split("\u00a7"); -+ synchronized (motd) { -+ motd = split[0]; -+ } -+ players = Integer.valueOf(split[1]); -+ maxPlayers = Integer.valueOf(split[2]); -+ } -+ } catch(java.net.UnknownHostException e) { -+ ping = PING_UNKNOWN; -+ } catch(IOException e) { -+ ping = PING_TIMEOUT; -+ } catch (Exception e) { -+ ping = PING_BAD_MESSAGE; -+ } finally { -+ polling = false; -+ numPolling--; -+ if (numPolling == 0) { -+ favorites.setPolling(false); -+ } -+ if (SpoutClient.getHandle().currentScreen instanceof GuiServerInfo) { -+ GuiServerInfo screen = (GuiServerInfo) SpoutClient.getHandle().currentScreen; -+ screen.updateData(); -+ } -+ try { -+ sock.close(); -+ input.close(); -+ output.close(); -+ } catch(Exception e) {} -+ } -+ } -+ } -+} ---- net/minecraft/src/StructureNetherBridgeStart.java -+++ net/minecraft/src/StructureNetherBridgeStart.java -@@ -4,23 +4,22 @@ - import java.util.Random; - - public class StructureNetherBridgeStart extends StructureStart { -- public StructureNetherBridgeStart() { -- } -- -- public StructureNetherBridgeStart(World var1, Random var2, int var3, int var4) { -- super(var3, var4); -- ComponentNetherBridgeStartPiece var5 = new ComponentNetherBridgeStartPiece(var2, (var3 << 4) + 2, (var4 << 4) + 2); -- this.a.add(var5); -- var5.buildComponent(var5, this.a, var2); -- ArrayList var6 = var5.e; -- -- while(!var6.isEmpty()) { -- int var7 = var2.nextInt(var6.size()); -+ public StructureNetherBridgeStart() {} -+ -+ public StructureNetherBridgeStart(World par1World, Random par2Random, int par3, int par4) { -+ super(par3, par4); -+ ComponentNetherBridgeStartPiece var5 = new ComponentNetherBridgeStartPiece(par2Random, (par3 << 4) + 2, (par4 << 4) + 2); -+ this.components.add(var5); -+ var5.buildComponent(var5, this.components, par2Random); -+ ArrayList var6 = var5.field_74967_d; -+ -+ while (!var6.isEmpty()) { -+ int var7 = par2Random.nextInt(var6.size()); - StructureComponent var8 = (StructureComponent)var6.remove(var7); -- var8.buildComponent(var5, this.a, var2); -+ var8.buildComponent(var5, this.components, par2Random); - } - - this.updateBoundingBox(); -- this.setRandomHeight(var1, var2, 48, 70); -+ this.setRandomHeight(par1World, par2Random, 48, 70); - } - } ---- net/minecraft/src/TileEntityRecordPlayer.java -+++ net/minecraft/src/TileEntityRecordPlayer.java -@@ -1,33 +1,41 @@ - package net.minecraft.src; - - public class TileEntityRecordPlayer extends TileEntity { -+ -+ /** ID of record which is in Jukebox */ - private ItemStack record; - -- public void readFromNBT(NBTTagCompound var1) { -- super.readFromNBT(var1); -- if(var1.hasKey("RecordItem")) { -- this.func_96098_a(ItemStack.loadItemStackFromNBT(var1.getCompoundTag("RecordItem"))); -- } else if(var1.getInteger("Record") > 0) { -- this.func_96098_a(new ItemStack(var1.getInteger("Record"), 1, 0)); -- } -+ /** -+ * Reads a tile entity from NBT. -+ */ -+ public void readFromNBT(NBTTagCompound par1NBTTagCompound) { -+ super.readFromNBT(par1NBTTagCompound); - -+ if (par1NBTTagCompound.hasKey("RecordItem")) { -+ this.func_96098_a(ItemStack.loadItemStackFromNBT(par1NBTTagCompound.getCompoundTag("RecordItem"))); -+ } else if (par1NBTTagCompound.getInteger("Record") > 0) { -+ this.func_96098_a(new ItemStack(par1NBTTagCompound.getInteger("Record"), 1, 0)); -+ } - } - -- public void writeToNBT(NBTTagCompound var1) { -- super.writeToNBT(var1); -- if(this.func_96097_a() != null) { -- var1.setCompoundTag("RecordItem", this.func_96097_a().writeToNBT(new NBTTagCompound())); -- var1.setInteger("Record", this.func_96097_a().itemID); -- } -+ /** -+ * Writes a tile entity to NBT. -+ */ -+ public void writeToNBT(NBTTagCompound par1NBTTagCompound) { -+ super.writeToNBT(par1NBTTagCompound); - -+ if (this.func_96097_a() != null) { -+ par1NBTTagCompound.setCompoundTag("RecordItem", this.func_96097_a().writeToNBT(new NBTTagCompound())); -+ par1NBTTagCompound.setInteger("Record", this.func_96097_a().itemID); -+ } - } - - public ItemStack func_96097_a() { - return this.record; - } - -- public void func_96098_a(ItemStack var1) { -- this.record = var1; -+ public void func_96098_a(ItemStack par1ItemStack) { -+ this.record = par1ItemStack; - this.onInventoryChanged(); - } - } ---- net/minecraft/src/TileEntityRendererPiston.java -+++ net/minecraft/src/TileEntityRendererPiston.java -@@ -3,50 +3,58 @@ - import org.lwjgl.opengl.GL11; - - public class TileEntityRendererPiston extends TileEntitySpecialRenderer { -+ -+ /** instance of RenderBlocks used to draw the piston base and extension. */ - private RenderBlocks blockRenderer; - -- public void renderPiston(TileEntityPiston var1, double var2, double var4, double var6, float var8) { -- Block var9 = Block.blocksList[var1.getStoredBlockID()]; -- if(var9 != null && var1.getProgress(var8) < 1.0F) { -+ public void renderPiston(TileEntityPiston par1TileEntityPiston, double par2, double par4, double par6, float par8) { -+ Block var9 = Block.blocksList[par1TileEntityPiston.getStoredBlockID()]; -+ -+ if (var9 != null && par1TileEntityPiston.getProgress(par8) < 1.0F) { - Tessellator var10 = Tessellator.instance; - this.bindTexture(TextureMap.locationBlocksTexture); - RenderHelper.disableStandardItemLighting(); - GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); - GL11.glEnable(GL11.GL_BLEND); - GL11.glDisable(GL11.GL_CULL_FACE); -- if(Minecraft.isAmbientOcclusionEnabled()) { -+ -+ if (Minecraft.isAmbientOcclusionEnabled()) { - GL11.glShadeModel(GL11.GL_SMOOTH); - } else { - GL11.glShadeModel(GL11.GL_FLAT); - } - - var10.startDrawingQuads(); -- var10.setTranslation((double)((float)var2 - (float)var1.xCoord + var1.getOffsetX(var8)), (double)((float)var4 - (float)var1.yCoord + var1.getOffsetY(var8)), (double)((float)var6 - (float)var1.zCoord + var1.getOffsetZ(var8))); -+ var10.setTranslation((double)((float)par2 - (float)par1TileEntityPiston.xCoord + par1TileEntityPiston.getOffsetX(par8)), (double)((float)par4 - (float)par1TileEntityPiston.yCoord + par1TileEntityPiston.getOffsetY(par8)), (double)((float)par6 - (float)par1TileEntityPiston.zCoord + par1TileEntityPiston.getOffsetZ(par8))); - var10.setColorOpaque(1, 1, 1); -- if(var9 == Block.pistonExtension && var1.getProgress(var8) < 0.5F) { -- this.blockRenderer.renderPistonExtensionAllFaces(var9, var1.xCoord, var1.yCoord, var1.zCoord, false); -- } else if(var1.shouldRenderHead() && !var1.isExtending()) { -+ -+ if (var9 == Block.pistonExtension && par1TileEntityPiston.getProgress(par8) < 0.5F) { -+ this.blockRenderer.renderPistonExtensionAllFaces(var9, par1TileEntityPiston.xCoord, par1TileEntityPiston.yCoord, par1TileEntityPiston.zCoord, false); -+ } else if (par1TileEntityPiston.shouldRenderHead() && !par1TileEntityPiston.isExtending()) { - Block.pistonExtension.setHeadTexture(((BlockPistonBase)var9).getPistonExtensionTexture()); -- this.blockRenderer.renderPistonExtensionAllFaces(Block.pistonExtension, var1.xCoord, var1.yCoord, var1.zCoord, var1.getProgress(var8) < 0.5F); -+ this.blockRenderer.renderPistonExtensionAllFaces(Block.pistonExtension, par1TileEntityPiston.xCoord, par1TileEntityPiston.yCoord, par1TileEntityPiston.zCoord, par1TileEntityPiston.getProgress(par8) < 0.5F); - Block.pistonExtension.clearHeadTexture(); -- var10.setTranslation((double)((float)var2 - (float)var1.xCoord), (double)((float)var4 - (float)var1.yCoord), (double)((float)var6 - (float)var1.zCoord)); -- this.blockRenderer.renderPistonBaseAllFaces(var9, var1.xCoord, var1.yCoord, var1.zCoord); -+ var10.setTranslation((double)((float)par2 - (float)par1TileEntityPiston.xCoord), (double)((float)par4 - (float)par1TileEntityPiston.yCoord), (double)((float)par6 - (float)par1TileEntityPiston.zCoord)); -+ this.blockRenderer.renderPistonBaseAllFaces(var9, par1TileEntityPiston.xCoord, par1TileEntityPiston.yCoord, par1TileEntityPiston.zCoord); - } else { -- this.blockRenderer.renderBlockAllFaces(var9, var1.xCoord, var1.yCoord, var1.zCoord); -+ this.blockRenderer.renderBlockAllFaces(var9, par1TileEntityPiston.xCoord, par1TileEntityPiston.yCoord, par1TileEntityPiston.zCoord); - } - - var10.setTranslation(0.0D, 0.0D, 0.0D); - var10.draw(); - RenderHelper.enableStandardItemLighting(); - } -- -- } -- -- public void onWorldChange(World var1) { -- this.blockRenderer = new RenderBlocks(var1); -- } -- -- public void renderTileEntityAt(TileEntity var1, double var2, double var4, double var6, float var8) { -- this.renderPiston((TileEntityPiston)var1, var2, var4, var6, var8); -+ } -+ -+ /** -+ * Called when the ingame world being rendered changes (e.g. on world -> nether travel) due to using one renderer per -+ * tile entity type, rather than instance -+ */ -+ public void onWorldChange(World par1World) { -+ this.blockRenderer = new RenderBlocks(par1World); -+ } -+ -+ public void renderTileEntityAt(TileEntity par1TileEntity, double par2, double par4, double par6, float par8) { -+ this.renderPiston((TileEntityPiston)par1TileEntity, par2, par4, par6, par8); - } - } ---- net/minecraft/src/ItemFishingRod.java -+++ net/minecraft/src/ItemFishingRod.java -@@ -3,41 +3,51 @@ - public class ItemFishingRod extends Item { - private Icon theIcon; - -- public ItemFishingRod(int var1) { -- super(var1); -+ public ItemFishingRod(int par1) { -+ super(par1); - this.setMaxDamage(64); - this.setMaxStackSize(1); - this.setCreativeTab(CreativeTabs.tabTools); - } - -+ /** -+ * Returns True is the item is renderer in full 3D when hold. -+ */ - public boolean isFull3D() { - return true; - } - -+ /** -+ * Returns true if this item should be rotated by 180 degrees around the Y axis when being held in an entities hands. -+ */ - public boolean shouldRotateAroundWhenRendering() { - return true; - } - -- public ItemStack onItemRightClick(ItemStack var1, World var2, EntityPlayer var3) { -- if(var3.fishEntity != null) { -- int var4 = var3.fishEntity.catchFish(); -- var1.damageItem(var4, var3); -- var3.swingItem(); -+ /** -+ * Called whenever this item is equipped and the right mouse button is pressed. Args: itemStack, world, entityPlayer -+ */ -+ public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) { -+ if (par3EntityPlayer.fishEntity != null) { -+ int var4 = par3EntityPlayer.fishEntity.catchFish(); -+ par1ItemStack.damageItem(var4, par3EntityPlayer); -+ par3EntityPlayer.swingItem(); - } else { -- var2.playSoundAtEntity(var3, "random.bow", 0.5F, 0.4F / (f.nextFloat() * 0.4F + 0.8F)); -- if(!var2.isRemote) { -- var2.spawnEntityInWorld(new EntityFishHook(var2, var3)); -+ par2World.playSoundAtEntity(par3EntityPlayer, "random.bow", 0.5F, 0.4F / (itemRand.nextFloat() * 0.4F + 0.8F)); -+ -+ if (!par2World.isRemote) { -+ par2World.spawnEntityInWorld(new EntityFishHook(par2World, par3EntityPlayer)); - } - -- var3.swingItem(); -+ par3EntityPlayer.swingItem(); - } - -- return var1; -+ return par1ItemStack; - } - -- public void registerIcons(IconRegister var1) { -- this.itemIcon = var1.registerIcon(this.getIconString() + "_uncast"); -- this.theIcon = var1.registerIcon(this.getIconString() + "_cast"); -+ public void registerIcons(IconRegister par1IconRegister) { -+ this.itemIcon = par1IconRegister.registerIcon(this.getIconString() + "_uncast"); -+ this.theIcon = par1IconRegister.registerIcon(this.getIconString() + "_cast"); - } - - public Icon func_94597_g() { ---- net/minecraft/src/BiomeGenForest.java -+++ net/minecraft/src/BiomeGenForest.java -@@ -3,14 +3,17 @@ - import java.util.Random; - - public class BiomeGenForest extends BiomeGenBase { -- public BiomeGenForest(int var1) { -- super(var1); -- this.K.add(new SpawnListEntry(EntityWolf.class, 5, 4, 4)); -+ public BiomeGenForest(int par1) { -+ super(par1); -+ this.spawnableCreatureList.add(new SpawnListEntry(EntityWolf.class, 5, 4, 4)); - this.theBiomeDecorator.treesPerChunk = 10; - this.theBiomeDecorator.grassPerChunk = 2; - } - -- public WorldGenerator getRandomWorldGenForTrees(Random var1) { -- return (WorldGenerator)(var1.nextInt(5) == 0 ? this.worldGeneratorForest : (var1.nextInt(10) == 0 ? this.worldGeneratorBigTree : this.worldGeneratorTrees)); -+ /** -+ * Gets a WorldGen appropriate for this biome. -+ */ -+ public WorldGenerator getRandomWorldGenForTrees(Random par1Random) { -+ return (WorldGenerator)(par1Random.nextInt(5) == 0 ? this.worldGeneratorForest : (par1Random.nextInt(10) == 0 ? this.worldGeneratorBigTree : this.worldGeneratorTrees)); - } - } ---- /dev/null -+++ com/prupe/mcpatcher/MCLogger$1.java -@@ -1,0 +1,25 @@ -+package com.prupe.mcpatcher; -+ -+import com.prupe.mcpatcher.MCLogger$1$1; -+import java.util.logging.Formatter; -+import java.util.logging.Handler; -+import java.util.logging.LogRecord; -+ -+class MCLogger$1 extends Handler { -+ private final Formatter formatter; -+ -+ final MCLogger this$0; -+ -+ MCLogger$1(MCLogger var1) { -+ this.this$0 = var1; -+ this.formatter = new MCLogger$1$1(this); -+ } -+ -+ public void publish(LogRecord record) { -+ System.out.println(this.formatter.format(record)); -+ } -+ -+ public void flush() {} -+ -+ public void close() throws SecurityException {} -+} ---- /dev/null -+++ org/spoutcraft/client/gui/settings/controls/FancyTreesButton.java -@@ -1,0 +1,47 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.client.gui.settings.controls; -+ -+import java.util.UUID; -+ -+import net.minecraft.src.Minecraft; -+ -+import org.spoutcraft.client.config.Configuration; -+ -+public class FancyTreesButton extends AutomatedCheckBox { -+ UUID fancyGraphics; -+ public FancyTreesButton(UUID fancyGraphics) { -+ super("Fancy Trees"); -+ this.fancyGraphics = fancyGraphics; -+ setChecked(Configuration.isFancyTrees()); -+ setTooltip("Trees\nFast - lower quality, faster\nFancy - higher quality, slower\nFast trees have opaque leaves.\nFancy trees have transparent leaves."); -+ } -+ -+ @Override -+ public void onButtonClick() { -+ Configuration.setFancyTrees(!Configuration.isFancyTrees()); -+ Configuration.write(); -+ ((FancyGraphicsButton)getScreen().getWidget(fancyGraphics)).custom = true; -+ -+ if (Minecraft.getMinecraft().theWorld != null) { -+ Minecraft.getMinecraft().renderGlobal.updateAllRenderers(); -+ } -+ } -+} ---- net/minecraft/src/SlotBrewingStandIngredient.java -+++ net/minecraft/src/SlotBrewingStandIngredient.java -@@ -1,17 +1,26 @@ - package net.minecraft.src; - - class SlotBrewingStandIngredient extends Slot { -+ -+ /** The brewing stand this slot belongs to. */ - final ContainerBrewingStand brewingStand; - -- public SlotBrewingStandIngredient(ContainerBrewingStand var1, IInventory var2, int var3, int var4, int var5) { -- super(var2, var3, var4, var5); -- this.brewingStand = var1; -- } -- -- public boolean isItemValid(ItemStack var1) { -- return var1 != null ? Item.itemsList[var1.itemID].isPotionIngredient() : false; -- } -- -+ public SlotBrewingStandIngredient(ContainerBrewingStand par1ContainerBrewingStand, IInventory par2IInventory, int par3, int par4, int par5) { -+ super(par2IInventory, par3, par4, par5); -+ this.brewingStand = par1ContainerBrewingStand; -+ } -+ -+ /** -+ * Check if the stack is a valid item for this slot. Always true beside for the armor slots. -+ */ -+ public boolean isItemValid(ItemStack par1ItemStack) { -+ return par1ItemStack != null ? Item.itemsList[par1ItemStack.itemID].isPotionIngredient() : false; -+ } -+ -+ /** -+ * Returns the maximum stack size for a given slot (usually the same as getInventoryStackLimit(), but 1 in the case of -+ * armor slots) -+ */ - public int getSlotStackLimit() { - return 64; - } ---- net/minecraft/src/EntityPigZombie.java -+++ net/minecraft/src/EntityPigZombie.java -@@ -4,14 +4,18 @@ - import java.util.UUID; - - public class EntityPigZombie extends EntityZombie { -- private static final UUID bq = UUID.fromString("49455A49-7EC5-45BA-B886-3B90B23A1718"); -- private static final AttributeModifier field_110190_br = (new AttributeModifier(bq, "Attacking speed boost", 0.45D, 0)).setSaved(false); -+ private static final UUID field_110189_bq = UUID.fromString("49455A49-7EC5-45BA-B886-3B90B23A1718"); -+ private static final AttributeModifier field_110190_br = (new AttributeModifier(field_110189_bq, "Attacking speed boost", 0.45D, 0)).setSaved(false); -+ -+ /** Above zero if this PigZombie is Angry. */ - private int angerLevel; -+ -+ /** A random delay until this PigZombie next makes a sound. */ - private int randomSoundDelay; - private Entity field_110191_bu; - -- public EntityPigZombie(World var1) { -- super(var1); -+ public EntityPigZombie(World par1World) { -+ super(par1World); - this.isImmuneToFire = true; - } - -@@ -22,56 +26,82 @@ - this.getEntityAttribute(SharedMonsterAttributes.attackDamage).setAttribute(5.0D); - } - -+ /** -+ * Returns true if the newer Entity AI code should be run -+ */ - protected boolean isAIEnabled() { - return false; - } - -+ /** -+ * Called to update the entity's position/logic. -+ */ - public void onUpdate() { -- if(this.field_110191_bu != this.entityToAttack && !this.worldObj.isRemote) { -+ if (this.field_110191_bu != this.entityToAttack && !this.worldObj.isRemote) { - AttributeInstance var1 = this.getEntityAttribute(SharedMonsterAttributes.movementSpeed); - var1.removeModifier(field_110190_br); -- if(this.entityToAttack != null) { -+ -+ if (this.entityToAttack != null) { - var1.applyModifier(field_110190_br); - } - } - - this.field_110191_bu = this.entityToAttack; -- if(this.randomSoundDelay > 0 && --this.randomSoundDelay == 0) { -- this.playSound("mob.zombiepig.zpigangry", this.getSoundVolume() * 2.0F, ((this.ab.nextFloat() - this.ab.nextFloat()) * 0.2F + 1.0F) * 1.8F); -+ -+ if (this.randomSoundDelay > 0 && --this.randomSoundDelay == 0) { -+ this.playSound("mob.zombiepig.zpigangry", this.getSoundVolume() * 2.0F, ((this.rand.nextFloat() - this.rand.nextFloat()) * 0.2F + 1.0F) * 1.8F); - } - - super.onUpdate(); - } - -+ /** -+ * Checks if the entity's current position is a valid location to spawn this entity. -+ */ - public boolean getCanSpawnHere() { - return this.worldObj.difficultySetting > 0 && this.worldObj.checkNoEntityCollision(this.boundingBox) && this.worldObj.getCollidingBoundingBoxes(this, this.boundingBox).isEmpty() && !this.worldObj.isAnyLiquid(this.boundingBox); - } - -- public void writeEntityToNBT(NBTTagCompound var1) { -- super.writeEntityToNBT(var1); -- var1.setShort("Anger", (short)this.angerLevel); -- } -- -- public void readEntityFromNBT(NBTTagCompound var1) { -- super.readEntityFromNBT(var1); -- this.angerLevel = var1.getShort("Anger"); -- } -- -+ /** -+ * (abstract) Protected helper method to write subclass entity data to NBT. -+ */ -+ public void writeEntityToNBT(NBTTagCompound par1NBTTagCompound) { -+ super.writeEntityToNBT(par1NBTTagCompound); -+ par1NBTTagCompound.setShort("Anger", (short)this.angerLevel); -+ } -+ -+ /** -+ * (abstract) Protected helper method to read subclass entity data from NBT. -+ */ -+ public void readEntityFromNBT(NBTTagCompound par1NBTTagCompound) { -+ super.readEntityFromNBT(par1NBTTagCompound); -+ this.angerLevel = par1NBTTagCompound.getShort("Anger"); -+ } -+ -+ /** -+ * Finds the closest player within 16 blocks to attack, or null if this Entity isn't interested in attacking (Animals, -+ * Spiders at day, peaceful PigZombies). -+ */ - protected Entity findPlayerToAttack() { - return this.angerLevel == 0 ? null : super.findPlayerToAttack(); - } - -- public boolean attackEntityFrom(DamageSource var1, float var2) { -- if(this.isEntityInvulnerable()) { -+ /** -+ * Called when the entity is attacked. -+ */ -+ public boolean attackEntityFrom(DamageSource par1DamageSource, float par2) { -+ if (this.isEntityInvulnerable()) { - return false; - } else { -- Entity var3 = var1.getEntity(); -- if(var3 instanceof EntityPlayer) { -+ Entity var3 = par1DamageSource.getEntity(); -+ -+ if (var3 instanceof EntityPlayer) { - List var4 = this.worldObj.getEntitiesWithinAABBExcludingEntity(this, this.boundingBox.expand(32.0D, 32.0D, 32.0D)); - -- for(int var5 = 0; var5 < var4.size(); ++var5) { -+ for (int var5 = 0; var5 < var4.size(); ++var5) { - Entity var6 = (Entity)var4.get(var5); -- if(var6 instanceof EntityPigZombie) { -+ -+ if (var6 instanceof EntityPigZombie) { - EntityPigZombie var7 = (EntityPigZombie)var6; - var7.becomeAngryAt(var3); - } -@@ -80,63 +110,87 @@ - this.becomeAngryAt(var3); - } - -- return super.attackEntityFrom(var1, var2); -+ return super.attackEntityFrom(par1DamageSource, par2); - } - } - -- private void becomeAngryAt(Entity var1) { -- this.entityToAttack = var1; -- this.angerLevel = 400 + this.ab.nextInt(400); -- this.randomSoundDelay = this.ab.nextInt(40); -+ /** -+ * Causes this PigZombie to become angry at the supplied Entity (which will be a player). -+ */ -+ private void becomeAngryAt(Entity par1Entity) { -+ this.entityToAttack = par1Entity; -+ this.angerLevel = 400 + this.rand.nextInt(400); -+ this.randomSoundDelay = this.rand.nextInt(40); - } - -+ /** -+ * Returns the sound this mob makes while it's alive. -+ */ - protected String getLivingSound() { - return "mob.zombiepig.zpig"; - } - -+ /** -+ * Returns the sound this mob makes when it is hurt. -+ */ - protected String getHurtSound() { - return "mob.zombiepig.zpighurt"; - } - -+ /** -+ * Returns the sound this mob makes on death. -+ */ - protected String getDeathSound() { - return "mob.zombiepig.zpigdeath"; - } - -- protected void dropFewItems(boolean var1, int var2) { -- int var3 = this.ab.nextInt(2 + var2); -- -+ /** -+ * Drop 0-2 items of this living's type. @param par1 - Whether this entity has recently been hit by a player. @param -+ * par2 - Level of Looting used to kill this mob. -+ */ -+ protected void dropFewItems(boolean par1, int par2) { -+ int var3 = this.rand.nextInt(2 + par2); - int var4; -- for(var4 = 0; var4 < var3; ++var4) { -+ -+ for (var4 = 0; var4 < var3; ++var4) { - this.dropItem(Item.rottenFlesh.itemID, 1); - } - -- var3 = this.ab.nextInt(2 + var2); -+ var3 = this.rand.nextInt(2 + par2); - -- for(var4 = 0; var4 < var3; ++var4) { -+ for (var4 = 0; var4 < var3; ++var4) { - this.dropItem(Item.goldNugget.itemID, 1); - } -- - } - -- public boolean interact(EntityPlayer var1) { -+ /** -+ * Called when a player interacts with a mob. e.g. gets milk from a cow, gets into the saddle on a pig. -+ */ -+ public boolean interact(EntityPlayer par1EntityPlayer) { - return false; - } - -- protected void dropRareDrop(int var1) { -+ protected void dropRareDrop(int par1) { - this.dropItem(Item.ingotGold.itemID, 1); - } - -+ /** -+ * Returns the item ID for the item the mob drops on death. -+ */ - protected int getDropItemId() { - return Item.rottenFlesh.itemID; - } - -+ /** -+ * Makes entity wear random armor based on difficulty -+ */ - protected void addRandomArmor() { - this.setCurrentItemOrArmor(0, new ItemStack(Item.swordGold)); - } - -- public EntityLivingData onSpawnWithEgg(EntityLivingData var1) { -- super.onSpawnWithEgg(var1); -+ public EntityLivingData onSpawnWithEgg(EntityLivingData par1EntityLivingData) { -+ super.onSpawnWithEgg(par1EntityLivingData); - this.setVillager(false); -- return var1; -+ return par1EntityLivingData; - } - } ---- net/minecraft/src/ItemWritableBook.java -+++ net/minecraft/src/ItemWritableBook.java -@@ -1,35 +1,42 @@ - package net.minecraft.src; - - public class ItemWritableBook extends Item { -- public ItemWritableBook(int var1) { -- super(var1); -+ public ItemWritableBook(int par1) { -+ super(par1); - this.setMaxStackSize(1); - } - -- public ItemStack onItemRightClick(ItemStack var1, World var2, EntityPlayer var3) { -- var3.displayGUIBook(var1); -- return var1; -+ /** -+ * Called whenever this item is equipped and the right mouse button is pressed. Args: itemStack, world, entityPlayer -+ */ -+ public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) { -+ par3EntityPlayer.displayGUIBook(par1ItemStack); -+ return par1ItemStack; - } - -+ /** -+ * If this function returns true (or the item is damageable), the ItemStack's NBT tag will be sent to the client. -+ */ - public boolean getShareTag() { - return true; - } - -- public static boolean validBookTagPages(NBTTagCompound var0) { -- if(var0 == null) { -+ public static boolean validBookTagPages(NBTTagCompound par0NBTTagCompound) { -+ if (par0NBTTagCompound == null) { - return false; -- } else if(!var0.hasKey("pages")) { -+ } else if (!par0NBTTagCompound.hasKey("pages")) { - return false; - } else { -- NBTTagList var1 = (NBTTagList)var0.getTag("pages"); -+ NBTTagList var1 = (NBTTagList)par0NBTTagCompound.getTag("pages"); - -- for(int var2 = 0; var2 < var1.tagCount(); ++var2) { -+ for (int var2 = 0; var2 < var1.tagCount(); ++var2) { - NBTTagString var3 = (NBTTagString)var1.tagAt(var2); -- if(var3.a == null) { -+ -+ if (var3.data == null) { - return false; - } - -- if(var3.a.length() > 256) { -+ if (var3.data.length() > 256) { - return false; - } - } ---- /dev/null -+++ org/spoutcraft/client/packet/PacketAlert.java -@@ -1,0 +1,68 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.client.packet; -+ -+import java.io.IOException; -+ -+import org.spoutcraft.api.io.SpoutInputStream; -+import org.spoutcraft.api.io.SpoutOutputStream; -+import org.spoutcraft.client.SpoutClient; -+ -+public class PacketAlert implements SpoutPacket { -+ String message; -+ String title; -+ int itemId; -+ -+ public PacketAlert() { -+ } -+ -+ public PacketAlert(String title, String message, int itemId) { -+ this.title = title; -+ this.message = message; -+ this.itemId = itemId; -+ } -+ -+ public void readData(SpoutInputStream input) throws IOException { -+ title = input.readString(); -+ message = input.readString(); -+ itemId = input.readInt(); -+ } -+ -+ public void writeData(SpoutOutputStream output) throws IOException { -+ output.writeString(title); -+ output.writeString(message); -+ output.writeInt(itemId); -+ } -+ -+ public void run(int PlayerId) { -+ SpoutClient.getInstance().getActivePlayer().showAchievement(title, message, itemId); -+ } -+ -+ public PacketType getPacketType() { -+ return PacketType.PacketAlert; -+ } -+ -+ public int getVersion() { -+ return 1; -+ } -+ -+ public void failure(int playerId) { -+ } -+} ---- net/minecraft/src/ComponentNetherBridgeStraight.java -+++ net/minecraft/src/ComponentNetherBridgeStraight.java -@@ -4,49 +4,58 @@ - import java.util.Random; - - public class ComponentNetherBridgeStraight extends ComponentNetherBridgePiece { -- public ComponentNetherBridgeStraight() { -- } -- -- public ComponentNetherBridgeStraight(int var1, Random var2, StructureBoundingBox var3, int var4) { -- super(var1); -- this.coordBaseMode = var4; -- this.boundingBox = var3; -- } -- -- public void buildComponent(StructureComponent var1, List var2, Random var3) { -- this.getNextComponentNormal((ComponentNetherBridgeStartPiece)var1, var2, var3, 1, 3, false); -- } -- -- public static ComponentNetherBridgeStraight createValidComponent(List var0, Random var1, int var2, int var3, int var4, int var5, int var6) { -- StructureBoundingBox var7 = StructureBoundingBox.getComponentToAddBoundingBox(var2, var3, var4, -1, -3, 0, 5, 10, 19, var5); -- return isAboveGround(var7) && StructureComponent.findIntersecting(var0, var7) == null ? new ComponentNetherBridgeStraight(var6, var1, var7, var5) : null; -- } -- -- public boolean addComponentParts(World var1, Random var2, StructureBoundingBox var3) { -- this.fillWithBlocks(var1, var3, 0, 3, 0, 4, 4, 18, Block.netherBrick.blockID, Block.netherBrick.blockID, false); -- this.fillWithBlocks(var1, var3, 1, 5, 0, 3, 7, 18, 0, 0, false); -- this.fillWithBlocks(var1, var3, 0, 5, 0, 0, 5, 18, Block.netherBrick.blockID, Block.netherBrick.blockID, false); -- this.fillWithBlocks(var1, var3, 4, 5, 0, 4, 5, 18, Block.netherBrick.blockID, Block.netherBrick.blockID, false); -- this.fillWithBlocks(var1, var3, 0, 2, 0, 4, 2, 5, Block.netherBrick.blockID, Block.netherBrick.blockID, false); -- this.fillWithBlocks(var1, var3, 0, 2, 13, 4, 2, 18, Block.netherBrick.blockID, Block.netherBrick.blockID, false); -- this.fillWithBlocks(var1, var3, 0, 0, 0, 4, 1, 3, Block.netherBrick.blockID, Block.netherBrick.blockID, false); -- this.fillWithBlocks(var1, var3, 0, 0, 15, 4, 1, 18, Block.netherBrick.blockID, Block.netherBrick.blockID, false); -- -- for(int var4 = 0; var4 <= 4; ++var4) { -- for(int var5 = 0; var5 <= 2; ++var5) { -- this.fillCurrentPositionBlocksDownwards(var1, Block.netherBrick.blockID, 0, var4, -1, var5, var3); -- this.fillCurrentPositionBlocksDownwards(var1, Block.netherBrick.blockID, 0, var4, -1, 18 - var5, var3); -+ public ComponentNetherBridgeStraight() {} -+ -+ public ComponentNetherBridgeStraight(int par1, Random par2Random, StructureBoundingBox par3StructureBoundingBox, int par4) { -+ super(par1); -+ this.coordBaseMode = par4; -+ this.boundingBox = par3StructureBoundingBox; -+ } -+ -+ /** -+ * Initiates construction of the Structure Component picked, at the current Location of StructGen -+ */ -+ public void buildComponent(StructureComponent par1StructureComponent, List par2List, Random par3Random) { -+ this.getNextComponentNormal((ComponentNetherBridgeStartPiece)par1StructureComponent, par2List, par3Random, 1, 3, false); -+ } -+ -+ /** -+ * Creates and returns a new component piece. Or null if it could not find enough room to place it. -+ */ -+ public static ComponentNetherBridgeStraight createValidComponent(List par0List, Random par1Random, int par2, int par3, int par4, int par5, int par6) { -+ StructureBoundingBox var7 = StructureBoundingBox.getComponentToAddBoundingBox(par2, par3, par4, -1, -3, 0, 5, 10, 19, par5); -+ return isAboveGround(var7) && StructureComponent.findIntersecting(par0List, var7) == null ? new ComponentNetherBridgeStraight(par6, par1Random, var7, par5) : null; -+ } -+ -+ /** -+ * second Part of Structure generating, this for example places Spiderwebs, Mob Spawners, it closes Mineshafts at the -+ * end, it adds Fences... -+ */ -+ public boolean addComponentParts(World par1World, Random par2Random, StructureBoundingBox par3StructureBoundingBox) { -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 0, 3, 0, 4, 4, 18, Block.netherBrick.blockID, Block.netherBrick.blockID, false); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 1, 5, 0, 3, 7, 18, 0, 0, false); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 0, 5, 0, 0, 5, 18, Block.netherBrick.blockID, Block.netherBrick.blockID, false); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 4, 5, 0, 4, 5, 18, Block.netherBrick.blockID, Block.netherBrick.blockID, false); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 0, 2, 0, 4, 2, 5, Block.netherBrick.blockID, Block.netherBrick.blockID, false); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 0, 2, 13, 4, 2, 18, Block.netherBrick.blockID, Block.netherBrick.blockID, false); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 0, 0, 0, 4, 1, 3, Block.netherBrick.blockID, Block.netherBrick.blockID, false); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 0, 0, 15, 4, 1, 18, Block.netherBrick.blockID, Block.netherBrick.blockID, false); -+ -+ for (int var4 = 0; var4 <= 4; ++var4) { -+ for (int var5 = 0; var5 <= 2; ++var5) { -+ this.fillCurrentPositionBlocksDownwards(par1World, Block.netherBrick.blockID, 0, var4, -1, var5, par3StructureBoundingBox); -+ this.fillCurrentPositionBlocksDownwards(par1World, Block.netherBrick.blockID, 0, var4, -1, 18 - var5, par3StructureBoundingBox); - } - } - -- this.fillWithBlocks(var1, var3, 0, 1, 1, 0, 4, 1, Block.netherFence.blockID, Block.netherFence.blockID, false); -- this.fillWithBlocks(var1, var3, 0, 3, 4, 0, 4, 4, Block.netherFence.blockID, Block.netherFence.blockID, false); -- this.fillWithBlocks(var1, var3, 0, 3, 14, 0, 4, 14, Block.netherFence.blockID, Block.netherFence.blockID, false); -- this.fillWithBlocks(var1, var3, 0, 1, 17, 0, 4, 17, Block.netherFence.blockID, Block.netherFence.blockID, false); -- this.fillWithBlocks(var1, var3, 4, 1, 1, 4, 4, 1, Block.netherFence.blockID, Block.netherFence.blockID, false); -- this.fillWithBlocks(var1, var3, 4, 3, 4, 4, 4, 4, Block.netherFence.blockID, Block.netherFence.blockID, false); -- this.fillWithBlocks(var1, var3, 4, 3, 14, 4, 4, 14, Block.netherFence.blockID, Block.netherFence.blockID, false); -- this.fillWithBlocks(var1, var3, 4, 1, 17, 4, 4, 17, Block.netherFence.blockID, Block.netherFence.blockID, false); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 0, 1, 1, 0, 4, 1, Block.netherFence.blockID, Block.netherFence.blockID, false); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 0, 3, 4, 0, 4, 4, Block.netherFence.blockID, Block.netherFence.blockID, false); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 0, 3, 14, 0, 4, 14, Block.netherFence.blockID, Block.netherFence.blockID, false); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 0, 1, 17, 0, 4, 17, Block.netherFence.blockID, Block.netherFence.blockID, false); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 4, 1, 1, 4, 4, 1, Block.netherFence.blockID, Block.netherFence.blockID, false); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 4, 3, 4, 4, 4, 4, Block.netherFence.blockID, Block.netherFence.blockID, false); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 4, 3, 14, 4, 4, 14, Block.netherFence.blockID, Block.netherFence.blockID, false); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 4, 1, 17, 4, 4, 17, Block.netherFence.blockID, Block.netherFence.blockID, false); - return true; - } - } ---- net/minecraft/src/GuiScreenInvite.java -+++ net/minecraft/src/GuiScreenInvite.java -@@ -10,97 +10,120 @@ - private final GuiScreenConfigureWorld field_96222_d; - private final int field_96228_n = 0; - private final int field_96229_o = 1; -- private String q = "Could not invite the provided name"; -- private String r; -+ private String field_101016_p = "Could not invite the provided name"; -+ private String field_96226_p; - private boolean field_96225_q; - -- public GuiScreenInvite(GuiScreen var1, GuiScreenConfigureWorld var2, McoServer var3) { -- this.field_96224_c = var1; -- this.field_96222_d = var2; -- this.field_96223_b = var3; -+ public GuiScreenInvite(GuiScreen par1GuiScreen, GuiScreenConfigureWorld par2GuiScreenConfigureWorld, McoServer par3McoServer) { -+ this.field_96224_c = par1GuiScreen; -+ this.field_96222_d = par2GuiScreenConfigureWorld; -+ this.field_96223_b = par3McoServer; - } - -+ /** -+ * Called from the main game loop to update the screen. -+ */ - public void updateScreen() { - this.field_96227_a.updateCursorCounter(); - } - -+ /** -+ * Adds the buttons (and other controls) to the screen in question. -+ */ - public void initGui() { - Keyboard.enableRepeatEvents(true); -- this.i.clear(); -- this.i.add(new GuiButton(0, this.width / 2 - 100, this.height / 4 + 96 + 12, I18n.getString("mco.configure.world.buttons.invite"))); -- this.i.add(new GuiButton(1, this.width / 2 - 100, this.height / 4 + 120 + 12, I18n.getString("gui.cancel"))); -+ this.buttonList.clear(); -+ this.buttonList.add(new GuiButton(0, this.width / 2 - 100, this.height / 4 + 96 + 12, I18n.getString("mco.configure.world.buttons.invite"))); -+ this.buttonList.add(new GuiButton(1, this.width / 2 - 100, this.height / 4 + 120 + 12, I18n.getString("gui.cancel"))); - this.field_96227_a = new GuiTextField(this.fontRenderer, this.width / 2 - 100, 66, 200, 20); - this.field_96227_a.setFocused(true); - } - -+ /** -+ * Called when the screen is unloaded. Used to disable keyboard repeat events -+ */ - public void onGuiClosed() { - Keyboard.enableRepeatEvents(false); - } - -- protected void actionPerformed(GuiButton var1) { -- if(var1.enabled) { -- if(var1.id == 1) { -+ /** -+ * Fired when a control is clicked. This is the equivalent of ActionListener.actionPerformed(ActionEvent e). -+ */ -+ protected void actionPerformed(GuiButton par1GuiButton) { -+ if (par1GuiButton.enabled) { -+ if (par1GuiButton.id == 1) { - this.mc.displayGuiScreen(this.field_96222_d); -- } else if(var1.id == 0) { -+ } else if (par1GuiButton.id == 0) { - McoClient var2 = new McoClient(this.mc.getSession()); -- if(this.field_96227_a.getText() == null || this.field_96227_a.getText().isEmpty()) { -+ -+ if (this.field_96227_a.getText() == null || this.field_96227_a.getText().isEmpty()) { - return; - } - - try { - McoServer var3 = var2.func_96387_b(this.field_96223_b.field_96408_a, this.field_96227_a.getText()); -- if(var3 != null) { -- this.field_96223_b.f = var3.f; -+ -+ if (var3 != null) { -+ this.field_96223_b.field_96402_f = var3.field_96402_f; - this.mc.displayGuiScreen(new GuiScreenConfigureWorld(this.field_96224_c, this.field_96223_b)); - } else { -- this.func_101015_a(this.q); -+ this.func_101015_a(this.field_101016_p); - } - } catch (ExceptionMcoService var4) { - this.mc.getLogAgent().logSevere(var4.toString()); -- this.func_101015_a(var4.b); -+ this.func_101015_a(var4.field_96391_b); - } catch (IOException var5) { - this.mc.getLogAgent().logWarning("Realms: could not parse response"); -- this.func_101015_a(this.q); -+ this.func_101015_a(this.field_101016_p); - } - } -- - } - } - -- private void func_101015_a(String var1) { -+ private void func_101015_a(String par1Str) { - this.field_96225_q = true; -- this.r = var1; -+ this.field_96226_p = par1Str; - } - -- protected void keyTyped(char var1, int var2) { -- this.field_96227_a.textboxKeyTyped(var1, var2); -- if(var2 == 15) { -- if(this.field_96227_a.isFocused()) { -+ /** -+ * Fired when a key is typed. This is the equivalent of KeyListener.keyTyped(KeyEvent e). -+ */ -+ protected void keyTyped(char par1, int par2) { -+ this.field_96227_a.textboxKeyTyped(par1, par2); -+ -+ if (par2 == 15) { -+ if (this.field_96227_a.isFocused()) { - this.field_96227_a.setFocused(false); - } else { - this.field_96227_a.setFocused(true); - } - } - -- if(var2 == 28 || var2 == 156) { -- this.actionPerformed((GuiButton)this.i.get(0)); -+ if (par2 == 28 || par2 == 156) { -+ this.actionPerformed((GuiButton)this.buttonList.get(0)); - } -- -- } -- -- protected void mouseClicked(int var1, int var2, int var3) { -- super.mouseClicked(var1, var2, var3); -- this.field_96227_a.mouseClicked(var1, var2, var3); -- } -- -- public void drawScreen(int var1, int var2, float var3) { -+ } -+ -+ /** -+ * Called when the mouse is clicked. -+ */ -+ protected void mouseClicked(int par1, int par2, int par3) { -+ super.mouseClicked(par1, par2, par3); -+ this.field_96227_a.mouseClicked(par1, par2, par3); -+ } -+ -+ /** -+ * Draws the screen and all the components in it. -+ */ -+ public void drawScreen(int par1, int par2, float par3) { - this.drawDefaultBackground(); - this.drawString(this.fontRenderer, I18n.getString("mco.configure.world.invite.profile.name"), this.width / 2 - 100, 53, 10526880); -- if(this.field_96225_q) { -- this.drawCenteredString(this.fontRenderer, this.r, this.width / 2, 100, 16711680); -+ -+ if (this.field_96225_q) { -+ this.drawCenteredString(this.fontRenderer, this.field_96226_p, this.width / 2, 100, 16711680); - } - - this.field_96227_a.drawTextBox(); -- super.drawScreen(var1, var2, var3); -+ super.drawScreen(par1, par2, par3); - } - } ---- net/minecraft/src/EntityCaveSpider.java -+++ net/minecraft/src/EntityCaveSpider.java -@@ -1,8 +1,8 @@ - package net.minecraft.src; - - public class EntityCaveSpider extends EntitySpider { -- public EntityCaveSpider(World var1) { -- super(var1); -+ public EntityCaveSpider(World par1World) { -+ super(par1World); - this.setSize(0.7F, 0.5F); - } - -@@ -11,20 +11,21 @@ - this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setAttribute(12.0D); - } - -- public boolean attackEntityAsMob(Entity var1) { -- if(super.attackEntityAsMob(var1)) { -- if(var1 instanceof EntityLivingBase) { -+ public boolean attackEntityAsMob(Entity par1Entity) { -+ if (super.attackEntityAsMob(par1Entity)) { -+ if (par1Entity instanceof EntityLivingBase) { - byte var2 = 0; -- if(this.worldObj.difficultySetting > 1) { -- if(this.worldObj.difficultySetting == 2) { -+ -+ if (this.worldObj.difficultySetting > 1) { -+ if (this.worldObj.difficultySetting == 2) { - var2 = 7; -- } else if(this.worldObj.difficultySetting == 3) { -+ } else if (this.worldObj.difficultySetting == 3) { - var2 = 15; - } - } - -- if(var2 > 0) { -- ((EntityLivingBase)var1).addPotionEffect(new PotionEffect(Potion.poison.id, var2 * 20, 0)); -+ if (var2 > 0) { -+ ((EntityLivingBase)par1Entity).addPotionEffect(new PotionEffect(Potion.poison.id, var2 * 20, 0)); - } - } - -@@ -34,7 +35,7 @@ - } - } - -- public EntityLivingData onSpawnWithEgg(EntityLivingData var1) { -- return var1; -+ public EntityLivingData onSpawnWithEgg(EntityLivingData par1EntityLivingData) { -+ return par1EntityLivingData; - } - } ---- net/minecraft/src/GenLayerRiver.java -+++ net/minecraft/src/GenLayerRiver.java -@@ -1,30 +1,35 @@ - package net.minecraft.src; - - public class GenLayerRiver extends GenLayer { -- public GenLayerRiver(long var1, GenLayer var3) { -- super(var1); -- super.parent = var3; -+ public GenLayerRiver(long par1, GenLayer par3GenLayer) { -+ super(par1); -+ super.parent = par3GenLayer; - } - -- public int[] getInts(int var1, int var2, int var3, int var4) { -- int var5 = var1 - 1; -- int var6 = var2 - 1; -- int var7 = var3 + 2; -- int var8 = var4 + 2; -+ /** -+ * Returns a list of integer values generated by this layer. These may be interpreted as temperatures, rainfall -+ * amounts, or biomeList[] indices based on the particular GenLayer subclass. -+ */ -+ public int[] getInts(int par1, int par2, int par3, int par4) { -+ int var5 = par1 - 1; -+ int var6 = par2 - 1; -+ int var7 = par3 + 2; -+ int var8 = par4 + 2; - int[] var9 = this.parent.getInts(var5, var6, var7, var8); -- int[] var10 = IntCache.getIntCache(var3 * var4); -+ int[] var10 = IntCache.getIntCache(par3 * par4); - -- for(int var11 = 0; var11 < var4; ++var11) { -- for(int var12 = 0; var12 < var3; ++var12) { -+ for (int var11 = 0; var11 < par4; ++var11) { -+ for (int var12 = 0; var12 < par3; ++var12) { - int var13 = var9[var12 + 0 + (var11 + 1) * var7]; - int var14 = var9[var12 + 2 + (var11 + 1) * var7]; - int var15 = var9[var12 + 1 + (var11 + 0) * var7]; - int var16 = var9[var12 + 1 + (var11 + 2) * var7]; - int var17 = var9[var12 + 1 + (var11 + 1) * var7]; -- if(var17 != 0 && var13 != 0 && var14 != 0 && var15 != 0 && var16 != 0 && var17 == var13 && var17 == var15 && var17 == var14 && var17 == var16) { -- var10[var12 + var11 * var3] = -1; -+ -+ if (var17 != 0 && var13 != 0 && var14 != 0 && var15 != 0 && var16 != 0 && var17 == var13 && var17 == var15 && var17 == var14 && var17 == var16) { -+ var10[var12 + var11 * par3] = -1; - } else { -- var10[var12 + var11 * var3] = BiomeGenBase.river.biomeID; -+ var10[var12 + var11 * par3] = BiomeGenBase.river.biomeID; - } - } - } ---- /dev/null -+++ org/spoutcraft/client/gui/minimap/WatchedEntity.java -@@ -1,0 +1,98 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.client.gui.minimap; -+ -+import java.util.HashMap; -+ -+import org.newdawn.slick.opengl.Texture; -+ -+import net.minecraft.src.Entity; -+import net.minecraft.src.EntityBlaze; -+import net.minecraft.src.EntityCaveSpider; -+import net.minecraft.src.EntityChicken; -+import net.minecraft.src.EntityCow; -+import net.minecraft.src.EntityCreeper; -+import net.minecraft.src.EntityDragon; -+import net.minecraft.src.EntityEnderman; -+import net.minecraft.src.EntityGhast; -+import net.minecraft.src.EntityIronGolem; -+import net.minecraft.src.EntityMagmaCube; -+import net.minecraft.src.EntityMooshroom; -+import net.minecraft.src.EntityOcelot; -+import net.minecraft.src.EntityPig; -+import net.minecraft.src.EntityPigZombie; -+import net.minecraft.src.EntityPlayer; -+import net.minecraft.src.EntitySheep; -+import net.minecraft.src.EntitySilverfish; -+import net.minecraft.src.EntitySkeleton; -+import net.minecraft.src.EntitySlime; -+import net.minecraft.src.EntitySnowman; -+import net.minecraft.src.EntitySpider; -+import net.minecraft.src.EntitySquid; -+import net.minecraft.src.EntityVillager; -+import net.minecraft.src.EntityWolf; -+import net.minecraft.src.EntityZombie; -+ -+import org.spoutcraft.client.io.CustomTextureManager; -+import org.spoutcraft.client.io.FileUtil; -+ -+public class WatchedEntity { -+ public static HashMap, String> mobFaceTextures = new HashMap, String>(); -+ public static HashMap, Texture> mobFaceTextureBindings = new HashMap, Texture>(); -+ -+ static { -+ mobFaceTextures.put(EntityBlaze.class, "blaze.png"); -+ mobFaceTextures.put(EntityCaveSpider.class, "cave_spider.png"); -+ mobFaceTextures.put(EntityChicken.class, "chicken.png"); -+ mobFaceTextures.put(EntityCow.class, "cow.png"); -+ mobFaceTextures.put(EntityCreeper.class, "creeper.png"); -+ mobFaceTextures.put(EntityDragon.class, "ender_dragon.png"); -+ mobFaceTextures.put(EntityEnderman.class, "enderman.png"); -+ mobFaceTextures.put(EntityGhast.class, "ghast.png"); -+ mobFaceTextures.put(EntityPlayer.class, "human.png"); -+ mobFaceTextures.put(EntityIronGolem.class, "iron_golem.png"); -+ mobFaceTextures.put(EntityMagmaCube.class, "magma_cube.png"); -+ mobFaceTextures.put(EntityMooshroom.class, "mooshroom.png"); -+ mobFaceTextures.put(EntityOcelot.class, "ocelot.png"); -+ mobFaceTextures.put(EntityPig.class, "pig.png"); -+ mobFaceTextures.put(EntitySheep.class, "sheep.png"); -+ mobFaceTextures.put(EntitySilverfish.class, "silverfish.png"); -+ mobFaceTextures.put(EntitySkeleton.class, "skeleton.png"); -+ mobFaceTextures.put(EntitySlime.class, "slime.png"); -+ mobFaceTextures.put(EntitySnowman.class, "snow_golem.png"); -+ mobFaceTextures.put(EntitySpider.class, "spider.png"); -+ mobFaceTextures.put(EntitySquid.class, "squid.png"); -+ mobFaceTextures.put(EntityVillager.class, "villager.png"); -+ mobFaceTextures.put(EntityWolf.class, "wolf.png"); -+ mobFaceTextures.put(EntityZombie.class, "zombie.png"); -+ mobFaceTextures.put(EntityPigZombie.class, "zombie_pigman.png"); -+ } -+ -+ public Entity entity; -+ private final String path; -+ public WatchedEntity(Entity entity) { -+ this.entity = entity; -+ path = FileUtil.getAssetsDir().getPath()+"/mobface/" + mobFaceTextures.get(entity.getClass()); -+ } -+ -+ public Texture getTexture() { -+ return CustomTextureManager.getTextureFromPath(path); -+ } -+} ---- net/minecraft/src/ThreadMinecraftServer.java -+++ net/minecraft/src/ThreadMinecraftServer.java -@@ -3,14 +3,16 @@ - import net.minecraft.server.MinecraftServer; - - public class ThreadMinecraftServer extends Thread { -- final MinecraftServer a; -- -- public ThreadMinecraftServer(MinecraftServer var1, String var2) { -- super(var2); -- this.a = var1; -+ -+ /** Instance of MinecraftServer. */ -+ final MinecraftServer theServer; -+ -+ public ThreadMinecraftServer(MinecraftServer par1MinecraftServer, String par2Str) { -+ super(par2Str); -+ this.theServer = par1MinecraftServer; - } - - public void run() { -- this.a.run(); -+ this.theServer.run(); - } - } ---- net/minecraft/src/WorldGenSpikes.java -+++ net/minecraft/src/WorldGenSpikes.java -@@ -3,47 +3,53 @@ - import java.util.Random; - - public class WorldGenSpikes extends WorldGenerator { -+ -+ /** -+ * The Block ID that the generator is allowed to replace while generating the terrain. -+ */ - private int replaceID; - -- public WorldGenSpikes(int var1) { -- this.replaceID = var1; -+ public WorldGenSpikes(int par1) { -+ this.replaceID = par1; - } - -- public boolean generate(World var1, Random var2, int var3, int var4, int var5) { -- if(var1.isAirBlock(var3, var4, var5) && var1.getBlockId(var3, var4 - 1, var5) == this.replaceID) { -- int var6 = var2.nextInt(32) + 6; -- int var7 = var2.nextInt(4) + 1; -- -+ public boolean generate(World par1World, Random par2Random, int par3, int par4, int par5) { -+ if (par1World.isAirBlock(par3, par4, par5) && par1World.getBlockId(par3, par4 - 1, par5) == this.replaceID) { -+ int var6 = par2Random.nextInt(32) + 6; -+ int var7 = par2Random.nextInt(4) + 1; - int var8; - int var9; - int var10; - int var11; -- for(var8 = var3 - var7; var8 <= var3 + var7; ++var8) { -- for(var9 = var5 - var7; var9 <= var5 + var7; ++var9) { -- var10 = var8 - var3; -- var11 = var9 - var5; -- if(var10 * var10 + var11 * var11 <= var7 * var7 + 1 && var1.getBlockId(var8, var4 - 1, var9) != this.replaceID) { -+ -+ for (var8 = par3 - var7; var8 <= par3 + var7; ++var8) { -+ for (var9 = par5 - var7; var9 <= par5 + var7; ++var9) { -+ var10 = var8 - par3; -+ var11 = var9 - par5; -+ -+ if (var10 * var10 + var11 * var11 <= var7 * var7 + 1 && par1World.getBlockId(var8, par4 - 1, var9) != this.replaceID) { - return false; - } - } - } - -- for(var8 = var4; var8 < var4 + var6 && var8 < 128; ++var8) { -- for(var9 = var3 - var7; var9 <= var3 + var7; ++var9) { -- for(var10 = var5 - var7; var10 <= var5 + var7; ++var10) { -- var11 = var9 - var3; -- int var12 = var10 - var5; -- if(var11 * var11 + var12 * var12 <= var7 * var7 + 1) { -- var1.setBlock(var9, var8, var10, Block.obsidian.blockID, 0, 2); -+ for (var8 = par4; var8 < par4 + var6 && var8 < 128; ++var8) { -+ for (var9 = par3 - var7; var9 <= par3 + var7; ++var9) { -+ for (var10 = par5 - var7; var10 <= par5 + var7; ++var10) { -+ var11 = var9 - par3; -+ int var12 = var10 - par5; -+ -+ if (var11 * var11 + var12 * var12 <= var7 * var7 + 1) { -+ par1World.setBlock(var9, var8, var10, Block.obsidian.blockID, 0, 2); - } - } - } - } - -- EntityEnderCrystal var13 = new EntityEnderCrystal(var1); -- var13.setLocationAndAngles((double)((float)var3 + 0.5F), (double)(var4 + var6), (double)((float)var5 + 0.5F), var2.nextFloat() * 360.0F, 0.0F); -- var1.spawnEntityInWorld(var13); -- var1.setBlock(var3, var4 + var6, var5, Block.bedrock.blockID, 0, 2); -+ EntityEnderCrystal var13 = new EntityEnderCrystal(par1World); -+ var13.setLocationAndAngles((double)((float)par3 + 0.5F), (double)(par4 + var6), (double)((float)par5 + 0.5F), par2Random.nextFloat() * 360.0F, 0.0F); -+ par1World.spawnEntityInWorld(var13); -+ par1World.setBlock(par3, par4 + var6, par5, Block.bedrock.blockID, 0, 2); - return true; - } else { - return false; ---- net/minecraft/src/EntityMinecartMobSpawnerLogic.java -+++ net/minecraft/src/EntityMinecartMobSpawnerLogic.java -@@ -1,14 +1,16 @@ - package net.minecraft.src; - - class EntityMinecartMobSpawnerLogic extends MobSpawnerBaseLogic { -+ -+ /** The spawner minecart using this mob spawner logic. */ - final EntityMinecartMobSpawner spawnerMinecart; - -- EntityMinecartMobSpawnerLogic(EntityMinecartMobSpawner var1) { -- this.spawnerMinecart = var1; -+ EntityMinecartMobSpawnerLogic(EntityMinecartMobSpawner par1EntityMinecartMobSpawner) { -+ this.spawnerMinecart = par1EntityMinecartMobSpawner; - } - -- public void func_98267_a(int var1) { -- this.spawnerMinecart.worldObj.setEntityState(this.spawnerMinecart, (byte)var1); -+ public void func_98267_a(int par1) { -+ this.spawnerMinecart.worldObj.setEntityState(this.spawnerMinecart, (byte)par1); - } - - public World getSpawnerWorld() { ---- net/minecraft/src/CallableItemName.java -+++ net/minecraft/src/CallableItemName.java -@@ -4,11 +4,12 @@ - - class CallableItemName implements Callable { - final ItemStack theItemStack; -+ - final InventoryPlayer playerInventory; - -- CallableItemName(InventoryPlayer var1, ItemStack var2) { -- this.playerInventory = var1; -- this.theItemStack = var2; -+ CallableItemName(InventoryPlayer par1InventoryPlayer, ItemStack par2ItemStack) { -+ this.playerInventory = par1InventoryPlayer; -+ this.theItemStack = par2ItemStack; - } - - public String callItemDisplayName() { ---- net/minecraft/src/Enchantment.java -+++ net/minecraft/src/Enchantment.java -@@ -4,42 +4,105 @@ - - public abstract class Enchantment { - public static final Enchantment[] enchantmentsList = new Enchantment[256]; -+ -+ /** The list of enchantments applicable by the anvil from a book */ - public static final Enchantment[] enchantmentsBookList; -+ -+ /** Converts environmental damage to armour damage */ - public static final Enchantment protection = new EnchantmentProtection(0, 10, 0); -+ -+ /** Protection against fire */ - public static final Enchantment fireProtection = new EnchantmentProtection(1, 5, 1); -+ -+ /** Less fall damage */ - public static final Enchantment featherFalling = new EnchantmentProtection(2, 5, 2); -+ -+ /** Protection against explosions */ - public static final Enchantment blastProtection = new EnchantmentProtection(3, 2, 3); -+ -+ /** Protection against projectile entities (e.g. arrows) */ - public static final Enchantment projectileProtection = new EnchantmentProtection(4, 5, 4); -+ -+ /** -+ * Decreases the rate of air loss underwater; increases time between damage while suffocating -+ */ - public static final Enchantment respiration = new EnchantmentOxygen(5, 2); -+ -+ /** Increases underwater mining rate */ - public static final Enchantment aquaAffinity = new EnchantmentWaterWorker(6, 2); - public static final Enchantment thorns = new EnchantmentThorns(7, 1); -+ -+ /** Extra damage to mobs */ - public static final Enchantment sharpness = new EnchantmentDamage(16, 10, 0); -+ -+ /** Extra damage to zombies, zombie pigmen and skeletons */ - public static final Enchantment smite = new EnchantmentDamage(17, 5, 1); -+ -+ /** Extra damage to spiders, cave spiders and silverfish */ - public static final Enchantment baneOfArthropods = new EnchantmentDamage(18, 5, 2); -+ -+ /** Knocks mob and players backwards upon hit */ - public static final Enchantment knockback = new EnchantmentKnockback(19, 5); -+ -+ /** Lights mobs on fire */ - public static final Enchantment fireAspect = new EnchantmentFireAspect(20, 2); -+ -+ /** Mobs have a chance to drop more loot */ - public static final Enchantment looting = new EnchantmentLootBonus(21, 2, EnumEnchantmentType.weapon); -+ -+ /** Faster resource gathering while in use */ - public static final Enchantment efficiency = new EnchantmentDigging(32, 10); -+ -+ /** -+ * Blocks mined will drop themselves, even if it should drop something else (e.g. stone will drop stone, not -+ * cobblestone) -+ */ - public static final Enchantment silkTouch = new EnchantmentUntouching(33, 1); -+ -+ /** -+ * Sometimes, the tool's durability will not be spent when the tool is used -+ */ - public static final Enchantment unbreaking = new EnchantmentDurability(34, 5); -+ -+ /** Can multiply the drop rate of items from blocks */ - public static final Enchantment fortune = new EnchantmentLootBonus(35, 2, EnumEnchantmentType.digger); -+ -+ /** Power enchantment for bows, add's extra damage to arrows. */ - public static final Enchantment power = new EnchantmentArrowDamage(48, 10); -+ -+ /** -+ * Knockback enchantments for bows, the arrows will knockback the target when hit. -+ */ - public static final Enchantment punch = new EnchantmentArrowKnockback(49, 2); -+ -+ /** -+ * Flame enchantment for bows. Arrows fired by the bow will be on fire. Any target hit will also set on fire. -+ */ - public static final Enchantment flame = new EnchantmentArrowFire(50, 2); -+ -+ /** -+ * Infinity enchantment for bows. The bow will not consume arrows anymore, but will still required at least one arrow -+ * on inventory use the bow. -+ */ - public static final Enchantment infinity = new EnchantmentArrowInfinite(51, 1); - public final int effectId; - private final int weight; -+ -+ /** The EnumEnchantmentType given to this Enchantment. */ - public EnumEnchantmentType type; -- protected String B; -- -- protected Enchantment(int var1, int var2, EnumEnchantmentType var3) { -- this.effectId = var1; -- this.weight = var2; -- this.type = var3; -- if(enchantmentsList[var1] != null) { -+ -+ /** Used in localisation and stats. */ -+ protected String name; -+ -+ protected Enchantment(int par1, int par2, EnumEnchantmentType par3EnumEnchantmentType) { -+ this.effectId = par1; -+ this.weight = par2; -+ this.type = par3EnumEnchantmentType; -+ -+ if (enchantmentsList[par1] != null) { - throw new IllegalArgumentException("Duplicate enchantment id!"); - } else { -- enchantmentsList[var1] = this; -+ enchantmentsList[par1] = this; - } - } - -@@ -47,50 +110,80 @@ - return this.weight; - } - -+ /** -+ * Returns the minimum level that the enchantment can have. -+ */ - public int getMinLevel() { - return 1; - } - -+ /** -+ * Returns the maximum level that the enchantment can have. -+ */ - public int getMaxLevel() { - return 1; - } - -- public int getMinEnchantability(int var1) { -- return 1 + var1 * 10; -- } -- -- public int getMaxEnchantability(int var1) { -- return this.getMinEnchantability(var1) + 5; -- } -- -- public int calcModifierDamage(int var1, DamageSource var2) { -+ /** -+ * Returns the minimal value of enchantability needed on the enchantment level passed. -+ */ -+ public int getMinEnchantability(int par1) { -+ return 1 + par1 * 10; -+ } -+ -+ /** -+ * Returns the maximum value of enchantability nedded on the enchantment level passed. -+ */ -+ public int getMaxEnchantability(int par1) { -+ return this.getMinEnchantability(par1) + 5; -+ } -+ -+ /** -+ * Calculates de damage protection of the enchantment based on level and damage source passed. -+ */ -+ public int calcModifierDamage(int par1, DamageSource par2DamageSource) { - return 0; - } - -- public float calcModifierLiving(int var1, EntityLivingBase var2) { -+ /** -+ * Calculates de (magic) damage done by the enchantment on a living entity based on level and entity passed. -+ */ -+ public float calcModifierLiving(int par1, EntityLivingBase par2EntityLivingBase) { - return 0.0F; - } - -- public boolean canApplyTogether(Enchantment var1) { -- return this != var1; -+ /** -+ * Determines if the enchantment passed can be applyied together with this enchantment. -+ */ -+ public boolean canApplyTogether(Enchantment par1Enchantment) { -+ return this != par1Enchantment; - } - -- public Enchantment setName(String var1) { -- this.B = var1; -+ /** -+ * Sets the enchantment name -+ */ -+ public Enchantment setName(String par1Str) { -+ this.name = par1Str; - return this; - } - -+ /** -+ * Return the name of key in translation table of this enchantment. -+ */ - public String getName() { -- return "enchantment." + this.B; -+ return "enchantment." + this.name; - } - -- public String getTranslatedName(int var1) { -+ /** -+ * Returns the correct traslated name of the enchantment and the level in roman numbers. -+ */ -+ public String getTranslatedName(int par1) { - String var2 = StatCollector.translateToLocal(this.getName()); -- return var2 + " " + StatCollector.translateToLocal("enchantment.level." + var1); -+ return var2 + " " + StatCollector.translateToLocal("enchantment.level." + par1); - } - -- public boolean canApply(ItemStack var1) { -- return this.type.canEnchantItem(var1.getItem()); -+ public boolean canApply(ItemStack par1ItemStack) { -+ return this.type.canEnchantItem(par1ItemStack.getItem()); - } - - static { -@@ -98,9 +191,10 @@ - Enchantment[] var1 = enchantmentsList; - int var2 = var1.length; - -- for(int var3 = 0; var3 < var2; ++var3) { -+ for (int var3 = 0; var3 < var2; ++var3) { - Enchantment var4 = var1[var3]; -- if(var4 != null) { -+ -+ if (var4 != null) { - var0.add(var4); - } - } ---- net/minecraft/src/GuiScreenConfigureWorld.java -+++ net/minecraft/src/GuiScreenConfigureWorld.java -@@ -11,7 +11,7 @@ - private int field_96286_n; - private int field_96287_o; - private int field_96284_p = -1; -- private String r; -+ private String field_96283_q; - private GuiButton field_96281_r; - private GuiButton field_96279_s; - private GuiButton field_96278_t; -@@ -22,35 +22,41 @@ - private GuiButton field_110381_z; - private boolean field_102020_y; - -- public GuiScreenConfigureWorld(GuiScreen var1, McoServer var2) { -- this.field_96285_a = var1; -- this.field_96280_b = var2; -- } -- -- public void updateScreen() { -- } -- -+ public GuiScreenConfigureWorld(GuiScreen par1GuiScreen, McoServer par2McoServer) { -+ this.field_96285_a = par1GuiScreen; -+ this.field_96280_b = par2McoServer; -+ } -+ -+ /** -+ * Called from the main game loop to update the screen. -+ */ -+ public void updateScreen() {} -+ -+ /** -+ * Adds the buttons (and other controls) to the screen in question. -+ */ - public void initGui() { - this.field_96277_d = this.width / 2 - 200; - this.field_96286_n = 180; - this.field_96287_o = this.width / 2; - Keyboard.enableRepeatEvents(true); -- this.i.clear(); -- if(this.field_96280_b.d.equals("CLOSED")) { -- this.i.add(this.field_96281_r = new GuiButton(0, this.field_96277_d, this.func_96264_a(12), this.field_96286_n / 2 - 2, 20, I18n.getString("mco.configure.world.buttons.open"))); -+ this.buttonList.clear(); -+ -+ if (this.field_96280_b.field_96404_d.equals("CLOSED")) { -+ this.buttonList.add(this.field_96281_r = new GuiButton(0, this.field_96277_d, this.func_96264_a(12), this.field_96286_n / 2 - 2, 20, I18n.getString("mco.configure.world.buttons.open"))); - this.field_96281_r.enabled = !this.field_96280_b.field_98166_h; - } else { -- this.i.add(this.field_96279_s = new GuiButton(1, this.field_96277_d, this.func_96264_a(12), this.field_96286_n / 2 - 2, 20, I18n.getString("mco.configure.world.buttons.close"))); -+ this.buttonList.add(this.field_96279_s = new GuiButton(1, this.field_96277_d, this.func_96264_a(12), this.field_96286_n / 2 - 2, 20, I18n.getString("mco.configure.world.buttons.close"))); - this.field_96279_s.enabled = !this.field_96280_b.field_98166_h; - } - -- this.i.add(this.field_98129_x = new GuiButton(7, this.field_96277_d + this.field_96286_n / 2 + 2, this.func_96264_a(12), this.field_96286_n / 2 - 2, 20, I18n.getString("mco.configure.world.buttons.subscription"))); -- this.i.add(this.field_96278_t = new GuiButton(5, this.field_96277_d, this.func_96264_a(10), this.field_96286_n / 2 - 2, 20, I18n.getString("mco.configure.world.buttons.edit"))); -- this.i.add(this.field_96276_u = new GuiButton(6, this.field_96277_d + this.field_96286_n / 2 + 2, this.func_96264_a(10), this.field_96286_n / 2 - 2, 20, I18n.getString("mco.configure.world.buttons.reset"))); -- this.i.add(this.field_98128_v = new GuiButton(4, this.field_96287_o, this.func_96264_a(10), this.field_96286_n / 2 - 2, 20, I18n.getString("mco.configure.world.buttons.invite"))); -- this.i.add(this.field_98127_w = new GuiButton(3, this.field_96287_o + this.field_96286_n / 2 + 2, this.func_96264_a(10), this.field_96286_n / 2 - 2, 20, I18n.getString("mco.configure.world.buttons.uninvite"))); -- this.i.add(this.field_110381_z = new GuiButton(8, this.field_96287_o, this.func_96264_a(12), this.field_96286_n / 2 - 2, 20, I18n.getString("mco.configure.world.buttons.backup"))); -- this.i.add(new GuiButton(10, this.field_96287_o + this.field_96286_n / 2 + 2, this.func_96264_a(12), this.field_96286_n / 2 - 2, 20, I18n.getString("gui.back"))); -+ this.buttonList.add(this.field_98129_x = new GuiButton(7, this.field_96277_d + this.field_96286_n / 2 + 2, this.func_96264_a(12), this.field_96286_n / 2 - 2, 20, I18n.getString("mco.configure.world.buttons.subscription"))); -+ this.buttonList.add(this.field_96278_t = new GuiButton(5, this.field_96277_d, this.func_96264_a(10), this.field_96286_n / 2 - 2, 20, I18n.getString("mco.configure.world.buttons.edit"))); -+ this.buttonList.add(this.field_96276_u = new GuiButton(6, this.field_96277_d + this.field_96286_n / 2 + 2, this.func_96264_a(10), this.field_96286_n / 2 - 2, 20, I18n.getString("mco.configure.world.buttons.reset"))); -+ this.buttonList.add(this.field_98128_v = new GuiButton(4, this.field_96287_o, this.func_96264_a(10), this.field_96286_n / 2 - 2, 20, I18n.getString("mco.configure.world.buttons.invite"))); -+ this.buttonList.add(this.field_98127_w = new GuiButton(3, this.field_96287_o + this.field_96286_n / 2 + 2, this.func_96264_a(10), this.field_96286_n / 2 - 2, 20, I18n.getString("mco.configure.world.buttons.uninvite"))); -+ this.buttonList.add(this.field_110381_z = new GuiButton(8, this.field_96287_o, this.func_96264_a(12), this.field_96286_n / 2 - 2, 20, I18n.getString("mco.configure.world.buttons.backup"))); -+ this.buttonList.add(new GuiButton(10, this.field_96287_o + this.field_96286_n / 2 + 2, this.func_96264_a(12), this.field_96286_n / 2 - 2, 20, I18n.getString("gui.back"))); - this.field_96282_c = new SelectionListInvited(this); - this.field_96278_t.enabled = !this.field_96280_b.field_98166_h; - this.field_96276_u.enabled = !this.field_96280_b.field_98166_h; -@@ -59,42 +65,47 @@ - this.field_110381_z.enabled = !this.field_96280_b.field_98166_h; - } - -- private int func_96264_a(int var1) { -- return 40 + var1 * 13; -+ private int func_96264_a(int par1) { -+ return 40 + par1 * 13; - } - -+ /** -+ * Called when the screen is unloaded. Used to disable keyboard repeat events -+ */ - public void onGuiClosed() { - Keyboard.enableRepeatEvents(false); - } - -- protected void actionPerformed(GuiButton var1) { -- if(var1.enabled) { -- if(var1.id == 10) { -- if(this.field_102020_y) { -+ /** -+ * Fired when a control is clicked. This is the equivalent of ActionListener.actionPerformed(ActionEvent e). -+ */ -+ protected void actionPerformed(GuiButton par1GuiButton) { -+ if (par1GuiButton.enabled) { -+ if (par1GuiButton.id == 10) { -+ if (this.field_102020_y) { - ((GuiScreenOnlineServers)this.field_96285_a).func_102018_a(this.field_96280_b.field_96408_a); - } - - this.mc.displayGuiScreen(this.field_96285_a); -- } else if(var1.id == 5) { -+ } else if (par1GuiButton.id == 5) { - this.mc.displayGuiScreen(new GuiScreenEditOnlineWorld(this, this.field_96285_a, this.field_96280_b)); -- } else if(var1.id == 1) { -+ } else if (par1GuiButton.id == 1) { - String var2 = I18n.getString("mco.configure.world.close.question.line1"); - String var3 = I18n.getString("mco.configure.world.close.question.line2"); - this.mc.displayGuiScreen(new GuiScreenConfirmation(this, GuiScreenConfirmationType.Info, var2, var3, 1)); -- } else if(var1.id == 0) { -+ } else if (par1GuiButton.id == 0) { - this.func_96268_g(); -- } else if(var1.id == 4) { -+ } else if (par1GuiButton.id == 4) { - this.mc.displayGuiScreen(new GuiScreenInvite(this.field_96285_a, this, this.field_96280_b)); -- } else if(var1.id == 3) { -+ } else if (par1GuiButton.id == 3) { - this.func_96272_i(); -- } else if(var1.id == 6) { -+ } else if (par1GuiButton.id == 6) { - this.mc.displayGuiScreen(new GuiScreenResetWorld(this, this.field_96280_b)); -- } else if(var1.id == 7) { -+ } else if (par1GuiButton.id == 7) { - this.mc.displayGuiScreen(new GuiScreenSubscription(this, this.field_96280_b)); -- } else if(var1.id == 8) { -+ } else if (par1GuiButton.id == 8) { - this.mc.displayGuiScreen(new GuiScreenBackup(this, this.field_96280_b.field_96408_a)); - } -- - } - } - -@@ -103,9 +114,10 @@ - - try { - Boolean var2 = var1.func_96383_b(this.field_96280_b.field_96408_a); -- if(var2.booleanValue()) { -+ -+ if (var2.booleanValue()) { - this.field_102020_y = true; -- this.field_96280_b.d = "OPEN"; -+ this.field_96280_b.field_96404_d = "OPEN"; - this.initGui(); - } - } catch (ExceptionMcoService var3) { -@@ -113,7 +125,6 @@ - } catch (IOException var4) { - this.mc.getLogAgent().logWarning("Realms: could not parse response"); - } -- - } - - private void func_96275_h() { -@@ -121,9 +132,10 @@ - - try { - boolean var2 = var1.func_96378_c(this.field_96280_b.field_96408_a).booleanValue(); -- if(var2) { -+ -+ if (var2) { - this.field_102020_y = true; -- this.field_96280_b.d = "CLOSED"; -+ this.field_96280_b.field_96404_d = "CLOSED"; - this.initGui(); - } - } catch (ExceptionMcoService var3) { -@@ -131,25 +143,23 @@ - } catch (IOException var4) { - this.mc.getLogAgent().logWarning("Realms: could not parse response"); - } -- - } - - private void func_96272_i() { -- if(this.field_96284_p >= 0 && this.field_96284_p < this.field_96280_b.f.size()) { -- this.r = (String)this.field_96280_b.f.get(this.field_96284_p); -- GuiYesNo var1 = new GuiYesNo(this, "Warning!", I18n.getString("mco.configure.world.uninvite.question") + " \'" + this.r + "\'", 3); -+ if (this.field_96284_p >= 0 && this.field_96284_p < this.field_96280_b.field_96402_f.size()) { -+ this.field_96283_q = (String)this.field_96280_b.field_96402_f.get(this.field_96284_p); -+ GuiYesNo var1 = new GuiYesNo(this, "Warning!", I18n.getString("mco.configure.world.uninvite.question") + " \'" + this.field_96283_q + "\'", 3); - this.mc.displayGuiScreen(var1); - } -- - } - -- public void confirmClicked(boolean var1, int var2) { -- if(var2 == 3) { -- if(var1) { -+ public void confirmClicked(boolean par1, int par2) { -+ if (par2 == 3) { -+ if (par1) { - McoClient var3 = new McoClient(this.mc.getSession()); - - try { -- var3.func_96381_a(this.field_96280_b.field_96408_a, this.r); -+ var3.func_96381_a(this.field_96280_b.field_96408_a, this.field_96283_q); - } catch (ExceptionMcoService var5) { - this.mc.getLogAgent().logSevere(var5.toString()); - } -@@ -160,30 +170,37 @@ - this.mc.displayGuiScreen(new GuiScreenConfigureWorld(this.field_96285_a, this.field_96280_b)); - } - -- if(var2 == 1) { -- if(var1) { -+ if (par2 == 1) { -+ if (par1) { - this.func_96275_h(); - } - - this.mc.displayGuiScreen(this); - } -- -- } -- -- private void func_96267_d(int var1) { -- this.field_96280_b.f.remove(var1); -- } -- -- protected void keyTyped(char var1, int var2) { -- } -- -- protected void mouseClicked(int var1, int var2, int var3) { -- super.mouseClicked(var1, var2, var3); -- } -- -- public void drawScreen(int var1, int var2, float var3) { -+ } -+ -+ private void func_96267_d(int par1) { -+ this.field_96280_b.field_96402_f.remove(par1); -+ } -+ -+ /** -+ * Fired when a key is typed. This is the equivalent of KeyListener.keyTyped(KeyEvent e). -+ */ -+ protected void keyTyped(char par1, int par2) {} -+ -+ /** -+ * Called when the mouse is clicked. -+ */ -+ protected void mouseClicked(int par1, int par2, int par3) { -+ super.mouseClicked(par1, par2, par3); -+ } -+ -+ /** -+ * Draws the screen and all the components in it. -+ */ -+ public void drawScreen(int par1, int par2, float par3) { - this.drawDefaultBackground(); -- this.field_96282_c.func_96612_a(var1, var2, var3); -+ this.field_96282_c.func_96612_a(par1, par2, par3); - this.drawCenteredString(this.fontRenderer, I18n.getString("mco.configure.world.title"), this.width / 2, 17, 16777215); - this.drawString(this.fontRenderer, I18n.getString("mco.configure.world.name"), this.field_96277_d, this.func_96264_a(1), 10526880); - this.drawString(this.fontRenderer, this.field_96280_b.func_96398_b(), this.field_96277_d, this.func_96264_a(2), 16777215); -@@ -192,47 +209,47 @@ - this.drawString(this.fontRenderer, I18n.getString("mco.configure.world.status"), this.field_96277_d, this.func_96264_a(7), 10526880); - this.drawString(this.fontRenderer, this.func_104045_j(), this.field_96277_d, this.func_96264_a(8), 16777215); - this.drawString(this.fontRenderer, I18n.getString("mco.configure.world.invited"), this.field_96287_o, this.func_96264_a(1), 10526880); -- super.drawScreen(var1, var2, var3); -+ super.drawScreen(par1, par2, par3); - } - - private String func_104045_j() { -- if(this.field_96280_b.field_98166_h) { -+ if (this.field_96280_b.field_98166_h) { - return "Expired"; - } else { -- String var1 = this.field_96280_b.d.toLowerCase(); -+ String var1 = this.field_96280_b.field_96404_d.toLowerCase(); - return Character.toUpperCase(var1.charAt(0)) + var1.substring(1); - } - } - -- static Minecraft getMinecraft(GuiScreenConfigureWorld var0) { -- return var0.mc; -- } -- -- static int func_96271_b(GuiScreenConfigureWorld var0) { -- return var0.field_96287_o; -- } -- -- static int func_96274_a(GuiScreenConfigureWorld var0, int var1) { -- return var0.func_96264_a(var1); -- } -- -- static int func_96269_c(GuiScreenConfigureWorld var0) { -- return var0.field_96286_n; -- } -- -- static McoServer func_96266_d(GuiScreenConfigureWorld var0) { -- return var0.field_96280_b; -- } -- -- static int func_96270_b(GuiScreenConfigureWorld var0, int var1) { -- return var0.field_96284_p = var1; -- } -- -- static int func_96263_e(GuiScreenConfigureWorld var0) { -- return var0.field_96284_p; -- } -- -- static FontRenderer func_96273_f(GuiScreenConfigureWorld var0) { -- return var0.fontRenderer; -+ static Minecraft getMinecraft(GuiScreenConfigureWorld par0GuiScreenConfigureWorld) { -+ return par0GuiScreenConfigureWorld.mc; -+ } -+ -+ static int func_96271_b(GuiScreenConfigureWorld par0GuiScreenConfigureWorld) { -+ return par0GuiScreenConfigureWorld.field_96287_o; -+ } -+ -+ static int func_96274_a(GuiScreenConfigureWorld par0GuiScreenConfigureWorld, int par1) { -+ return par0GuiScreenConfigureWorld.func_96264_a(par1); -+ } -+ -+ static int func_96269_c(GuiScreenConfigureWorld par0GuiScreenConfigureWorld) { -+ return par0GuiScreenConfigureWorld.field_96286_n; -+ } -+ -+ static McoServer func_96266_d(GuiScreenConfigureWorld par0GuiScreenConfigureWorld) { -+ return par0GuiScreenConfigureWorld.field_96280_b; -+ } -+ -+ static int func_96270_b(GuiScreenConfigureWorld par0GuiScreenConfigureWorld, int par1) { -+ return par0GuiScreenConfigureWorld.field_96284_p = par1; -+ } -+ -+ static int func_96263_e(GuiScreenConfigureWorld par0GuiScreenConfigureWorld) { -+ return par0GuiScreenConfigureWorld.field_96284_p; -+ } -+ -+ static FontRenderer func_96273_f(GuiScreenConfigureWorld par0GuiScreenConfigureWorld) { -+ return par0GuiScreenConfigureWorld.fontRenderer; - } - } ---- /dev/null -+++ com/prupe/mcpatcher/mob/MobRandomizer$1.java -@@ -1,0 +1,19 @@ -+package com.prupe.mcpatcher.mob; -+ -+import com.prupe.mcpatcher.TexturePackChangeHandler; -+ -+final class MobRandomizer$1 extends TexturePackChangeHandler { -+ MobRandomizer$1(String x0, int x1) { -+ super(x0, x1); -+ } -+ -+ public void beforeChange() { -+ MobRandomizer.access$000().clear(); -+ } -+ -+ public void afterChange() { -+ MobRuleList.clear(); -+ MobOverlay.reset(); -+ LineRenderer.reset(); -+ } -+} ---- /dev/null -+++ org/spoutcraft/client/gui/minimap/DirectionsToggleCheckBox.java -@@ -1,0 +1,35 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.client.gui.minimap; -+ -+import org.spoutcraft.api.gui.GenericCheckBox; -+ -+public class DirectionsToggleCheckBox extends GenericCheckBox { -+ public DirectionsToggleCheckBox() { -+ super("Compass Directions"); -+ setChecked(MinimapConfig.getInstance().isDirections()); -+ setTooltip("Compass Directions\nOFF - Hides compass directions from the map.\nON - Shows compass directions on the map."); -+ } -+ -+ @Override -+ public void onButtonClick() { -+ MinimapConfig.getInstance().setDirections(isChecked()); -+ } -+} ---- net/minecraft/src/EntityEnchantmentTableParticleFX.java -+++ net/minecraft/src/EntityEnchantmentTableParticleFX.java -@@ -6,16 +6,16 @@ - private double field_70567_ar; - private double field_70566_as; - -- public EntityEnchantmentTableParticleFX(World var1, double var2, double var4, double var6, double var8, double var10, double var12) { -- super(var1, var2, var4, var6, var8, var10, var12); -- this.motionX = var8; -- this.motionY = var10; -- this.motionZ = var12; -- this.field_70568_aq = this.posX = var2; -- this.field_70567_ar = this.posY = var4; -- this.field_70566_as = this.posZ = var6; -- float var14 = this.ab.nextFloat() * 0.6F + 0.4F; -- this.field_70565_a = this.particleScale = this.ab.nextFloat() * 0.5F + 0.2F; -+ public EntityEnchantmentTableParticleFX(World par1World, double par2, double par4, double par6, double par8, double par10, double par12) { -+ super(par1World, par2, par4, par6, par8, par10, par12); -+ this.motionX = par8; -+ this.motionY = par10; -+ this.motionZ = par12; -+ this.field_70568_aq = this.posX = par2; -+ this.field_70567_ar = this.posY = par4; -+ this.field_70566_as = this.posZ = par6; -+ float var14 = this.rand.nextFloat() * 0.6F + 0.4F; -+ this.field_70565_a = this.particleScale = this.rand.nextFloat() * 0.5F + 0.2F; - this.particleRed = this.particleGreen = this.particleBlue = 1.0F * var14; - this.particleGreen *= 0.9F; - this.particleRed *= 0.9F; -@@ -24,29 +24,36 @@ - this.setParticleTextureIndex((int)(Math.random() * 26.0D + 1.0D + 224.0D)); - } - -- public int getBrightnessForRender(float var1) { -- int var2 = super.getBrightnessForRender(var1); -+ public int getBrightnessForRender(float par1) { -+ int var2 = super.getBrightnessForRender(par1); - float var3 = (float)this.particleAge / (float)this.particleMaxAge; - var3 *= var3; - var3 *= var3; - int var4 = var2 & 255; - int var5 = var2 >> 16 & 255; - var5 += (int)(var3 * 15.0F * 16.0F); -- if(var5 > 240) { -+ -+ if (var5 > 240) { - var5 = 240; - } - - return var4 | var5 << 16; - } - -- public float getBrightness(float var1) { -- float var2 = super.getBrightness(var1); -+ /** -+ * Gets how bright this entity is. -+ */ -+ public float getBrightness(float par1) { -+ float var2 = super.getBrightness(par1); - float var3 = (float)this.particleAge / (float)this.particleMaxAge; - var3 *= var3; - var3 *= var3; - return var2 * (1.0F - var3) + var3; - } - -+ /** -+ * Called to update the entity's position/logic. -+ */ - public void onUpdate() { - this.prevPosX = this.posX; - this.prevPosY = this.posY; -@@ -59,9 +66,9 @@ - this.posX = this.field_70568_aq + this.motionX * (double)var1; - this.posY = this.field_70567_ar + this.motionY * (double)var1 - (double)(var2 * 1.2F); - this.posZ = this.field_70566_as + this.motionZ * (double)var1; -- if(this.particleAge++ >= this.particleMaxAge) { -+ -+ if (this.particleAge++ >= this.particleMaxAge) { - this.setDead(); - } -- - } - } ---- /dev/null -+++ org/spoutcraft/client/gui/settings/controls/MipMapSlider.java -@@ -1,0 +1,47 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.client.gui.settings.controls; -+ -+import org.spoutcraft.api.gui.GenericSlider; -+import org.spoutcraft.client.config.Configuration; -+import org.spoutcraft.client.config.MipMapUtils; -+ -+public class MipMapSlider extends GenericSlider { -+ public MipMapSlider() { -+ super("Terrain Mipmaps"); -+ this.setSliderPosition(Configuration.getMipmapsPercent()); -+ setTooltip("Terrain Mipmaps\nON - reduces the pixelation in far off terrain. However, not all \ngraphic cards support it, and some texture packs handle it poorly.\nOFF - Normal Minecraft terrain."); -+ } -+ -+ @Override -+ public String getText() { -+ if (this.getSliderPosition() == 0F) { -+ return "Terrain Mipmaps: OFF"; -+ } -+ return "Terrain Mipmaps: " + (int)(this.getSliderPosition() * 100) + "%"; -+ } -+ -+ @Override -+ public void onSliderDrag(float old, float newPos) { -+ Configuration.setMipmapsPercent(newPos); -+ Configuration.write(); -+ MipMapUtils.update(); -+ } -+} ---- /dev/null -+++ org/spoutcraft/client/entity/EntityTexture.java -@@ -1,0 +1,90 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.client.entity; -+ -+import net.minecraft.src.Entity; -+import net.minecraft.src.NBTTagCompound; -+import net.minecraft.src.World; -+ -+import org.spoutcraft.client.io.CustomTextureManager; -+ -+public class EntityTexture extends Entity { -+ private String url = null; -+ org.newdawn.slick.opengl.Texture texture = null; -+ private boolean rotateWithPlayer = true; -+ private float scale = 1.0F; -+ -+ public EntityTexture(World var1) { -+ super(var1); -+ } -+ -+ @Override -+ protected void entityInit() { -+ } -+ -+ @Override -+ protected void readEntityFromNBT(NBTTagCompound var1) { -+ url = var1.getString("url"); -+ rotateWithPlayer = var1.getBoolean("rotateWithPlayer"); -+ scale = var1.getFloat("scale"); -+ } -+ -+ @Override -+ protected void writeEntityToNBT(NBTTagCompound var1) { -+ var1.setString("url", url); -+ var1.setBoolean("rotateWithPlayer", rotateWithPlayer); -+ var1.setFloat("scale", scale); -+ } -+ -+ public void setUrl(String url) { -+ this.url = url; -+ if (getUrl() != null) { -+ CustomTextureManager.downloadTexture(url); -+ } -+ } -+ -+ public String getUrl() { -+ return url; -+ } -+ -+ public void setRotateWithPlayer(boolean rotateWithPlayer) { -+ this.rotateWithPlayer = rotateWithPlayer; -+ } -+ -+ public boolean isRotateWithPlayer() { -+ return rotateWithPlayer; -+ } -+ -+ public void setHeight(float height) { -+ this.height = height; -+ } -+ -+ public float getHeight() { -+ return this.height; -+ } -+ -+ public void setWidth(float width) { -+ this.width = width; -+ } -+ -+ public float getWidth() { -+ return this.width; -+ } -+} ---- net/minecraft/src/PropertyManager.java -+++ net/minecraft/src/PropertyManager.java -@@ -7,96 +7,119 @@ - import java.util.Properties; - - public class PropertyManager { -- private final Properties a = new Properties(); -+ private final Properties properties = new Properties(); -+ -+ /** Reference to the logger. */ - private final ILogAgent logger; -- private final File c; -- -- public PropertyManager(File var1, ILogAgent var2) { -- this.c = var1; -- this.logger = var2; -- if(var1.exists()) { -+ private final File associatedFile; -+ -+ public PropertyManager(File par1File, ILogAgent par2ILogAgent) { -+ this.associatedFile = par1File; -+ this.logger = par2ILogAgent; -+ -+ if (par1File.exists()) { - FileInputStream var3 = null; - - try { -- var3 = new FileInputStream(var1); -- this.a.load(var3); -+ var3 = new FileInputStream(par1File); -+ this.properties.load(var3); - } catch (Exception var13) { -- var2.logWarningException("Failed to load " + var1, var13); -- this.generateNewProperties(); -+ par2ILogAgent.logWarningException("Failed to load " + par1File, var13); -+ this.logMessageAndSave(); - } finally { -- if(var3 != null) { -+ if (var3 != null) { - try { - var3.close(); - } catch (IOException var12) { -+ ; - } - } -- - } - } else { -- var2.logWarning(var1 + " does not exist"); -- this.generateNewProperties(); -+ par2ILogAgent.logWarning(par1File + " does not exist"); -+ this.logMessageAndSave(); - } -- - } - -- public void generateNewProperties() { -+ /** -+ * logs an info message then calls saveSettingsToFile Yes this appears to be a potential stack overflow - these 2 -+ * functions call each other repeatdly if an exception occurs. -+ */ -+ public void logMessageAndSave() { - this.logger.logInfo("Generating new properties file"); - this.saveProperties(); - } - -+ /** -+ * Writes the properties to the properties file. -+ */ - public void saveProperties() { - FileOutputStream var1 = null; - - try { -- var1 = new FileOutputStream(this.c); -- this.a.store(var1, "Minecraft server properties"); -+ var1 = new FileOutputStream(this.associatedFile); -+ this.properties.store(var1, "Minecraft server properties"); - } catch (Exception var11) { -- this.logger.logWarningException("Failed to save " + this.c, var11); -- this.generateNewProperties(); -+ this.logger.logWarningException("Failed to save " + this.associatedFile, var11); -+ this.logMessageAndSave(); - } finally { -- if(var1 != null) { -+ if (var1 != null) { - try { - var1.close(); - } catch (IOException var10) { -+ ; - } - } -- - } -- - } - -+ /** -+ * Returns this PropertyManager's file object used for property saving. -+ */ - public File getPropertiesFile() { -- return this.c; -+ return this.associatedFile; - } - -- public String getStringProperty(String var1, String var2) { -- if(!this.a.containsKey(var1)) { -- this.a.setProperty(var1, var2); -+ /** -+ * Gets a property. If it does not exist, set it to the specified value. -+ */ -+ public String getProperty(String par1Str, String par2Str) { -+ if (!this.properties.containsKey(par1Str)) { -+ this.properties.setProperty(par1Str, par2Str); - this.saveProperties(); - } - -- return this.a.getProperty(var1, var2); -- } -- -- public int getIntProperty(String var1, int var2) { -- try { -- return Integer.parseInt(this.getStringProperty(var1, "" + var2)); -- } catch (Exception var4) { -- this.a.setProperty(var1, "" + var2); -- return var2; -- } -- } -- -- public boolean getBooleanProperty(String var1, boolean var2) { -- try { -- return Boolean.parseBoolean(this.getStringProperty(var1, "" + var2)); -- } catch (Exception var4) { -- this.a.setProperty(var1, "" + var2); -- return var2; -- } -- } -- -- public void setProperty(String var1, Object var2) { -- this.a.setProperty(var1, "" + var2); -+ return this.properties.getProperty(par1Str, par2Str); -+ } -+ -+ /** -+ * Gets an integer property. If it does not exist, set it to the specified value. -+ */ -+ public int getIntProperty(String par1Str, int par2) { -+ try { -+ return Integer.parseInt(this.getProperty(par1Str, "" + par2)); -+ } catch (Exception var4) { -+ this.properties.setProperty(par1Str, "" + par2); -+ return par2; -+ } -+ } -+ -+ /** -+ * Gets a boolean property. If it does not exist, set it to the specified value. -+ */ -+ public boolean getBooleanProperty(String par1Str, boolean par2) { -+ try { -+ return Boolean.parseBoolean(this.getProperty(par1Str, "" + par2)); -+ } catch (Exception var4) { -+ this.properties.setProperty(par1Str, "" + par2); -+ return par2; -+ } -+ } -+ -+ /** -+ * Saves an Object with the given property name. -+ */ -+ public void setProperty(String par1Str, Object par2Obj) { -+ this.properties.setProperty(par1Str, "" + par2Obj); - } - } ---- net/minecraft/src/TaskResetWorld.java -+++ net/minecraft/src/TaskResetWorld.java -@@ -2,15 +2,16 @@ - - class TaskResetWorld extends TaskLongRunning { - private final long field_96591_c; -- private final String d; -+ private final String field_104066_d; - private final WorldTemplate field_111252_e; -+ - final GuiScreenResetWorld field_96592_a; - -- public TaskResetWorld(GuiScreenResetWorld var1, long var2, String var4, WorldTemplate var5) { -- this.field_96592_a = var1; -- this.field_96591_c = var2; -- this.d = var4; -- this.field_111252_e = var5; -+ public TaskResetWorld(GuiScreenResetWorld par1GuiScreenResetWorld, long par2, String par4Str, WorldTemplate par5WorldTemplate) { -+ this.field_96592_a = par1GuiScreenResetWorld; -+ this.field_96591_c = par2; -+ this.field_104066_d = par4Str; -+ this.field_111252_e = par5WorldTemplate; - } - - public void run() { -@@ -19,10 +20,10 @@ - this.setMessage(var2); - - try { -- if(this.field_111252_e != null) { -- var1.func_111233_e(this.field_96591_c, this.field_111252_e.a); -+ if (this.field_111252_e != null) { -+ var1.func_111233_e(this.field_96591_c, this.field_111252_e.field_110734_a); - } else { -- var1.func_96376_d(this.field_96591_c, this.d); -+ var1.func_96376_d(this.field_96591_c, this.field_104066_d); - } - - GuiScreenResetWorld.func_96147_b(this.field_96592_a).displayGuiScreen(GuiScreenResetWorld.func_96148_a(this.field_96592_a)); -@@ -33,6 +34,5 @@ - GuiScreenResetWorld.func_130024_d(this.field_96592_a).getLogAgent().logWarning("Realms: "); - this.setFailedMessage(var5.toString()); - } -- - } - } ---- net/minecraft/src/TextureMetadataSection.java -+++ net/minecraft/src/TextureMetadataSection.java -@@ -4,9 +4,9 @@ - private final boolean textureBlur; - private final boolean textureClamp; - -- public TextureMetadataSection(boolean var1, boolean var2) { -- this.textureBlur = var1; -- this.textureClamp = var2; -+ public TextureMetadataSection(boolean par1, boolean par2) { -+ this.textureBlur = par1; -+ this.textureClamp = par2; - } - - public boolean getTextureBlur() { ---- net/minecraft/src/ClippingHelper.java -+++ net/minecraft/src/ClippingHelper.java -@@ -6,9 +6,12 @@ - public float[] modelviewMatrix = new float[16]; - public float[] clippingMatrix = new float[16]; - -- public boolean isBoxInFrustum(double var1, double var3, double var5, double var7, double var9, double var11) { -- for(int var13 = 0; var13 < 6; ++var13) { -- if((double)this.frustum[var13][0] * var1 + (double)this.frustum[var13][1] * var3 + (double)this.frustum[var13][2] * var5 + (double)this.frustum[var13][3] <= 0.0D && (double)this.frustum[var13][0] * var7 + (double)this.frustum[var13][1] * var3 + (double)this.frustum[var13][2] * var5 + (double)this.frustum[var13][3] <= 0.0D && (double)this.frustum[var13][0] * var1 + (double)this.frustum[var13][1] * var9 + (double)this.frustum[var13][2] * var5 + (double)this.frustum[var13][3] <= 0.0D && (double)this.frustum[var13][0] * var7 + (double)this.frustum[var13][1] * var9 + (double)this.frustum[var13][2] * var5 + (double)this.frustum[var13][3] <= 0.0D && (double)this.frustum[var13][0] * var1 + (double)this.frustum[var13][1] * var3 + (double)this.frustum[var13][2] * var11 + (double)this.frustum[var13][3] <= 0.0D && (double)this.frustum[var13][0] * var7 + (double)this.frustum[var13][1] * var3 + (double)this.frustum[var13][2] * var11 + (double)this.frustum[var13][3] <= 0.0D && (double)this.frustum[var13][0] * var1 + (double)this.frustum[var13][1] * var9 + (double)this.frustum[var13][2] * var11 + (double)this.frustum[var13][3] <= 0.0D && (double)this.frustum[var13][0] * var7 + (double)this.frustum[var13][1] * var9 + (double)this.frustum[var13][2] * var11 + (double)this.frustum[var13][3] <= 0.0D) { -+ /** -+ * Returns true if the box is inside all 6 clipping planes, otherwise returns false. -+ */ -+ public boolean isBoxInFrustum(double par1, double par3, double par5, double par7, double par9, double par11) { -+ for (int var13 = 0; var13 < 6; ++var13) { -+ if ((double)this.frustum[var13][0] * par1 + (double)this.frustum[var13][1] * par3 + (double)this.frustum[var13][2] * par5 + (double)this.frustum[var13][3] <= 0.0D && (double)this.frustum[var13][0] * par7 + (double)this.frustum[var13][1] * par3 + (double)this.frustum[var13][2] * par5 + (double)this.frustum[var13][3] <= 0.0D && (double)this.frustum[var13][0] * par1 + (double)this.frustum[var13][1] * par9 + (double)this.frustum[var13][2] * par5 + (double)this.frustum[var13][3] <= 0.0D && (double)this.frustum[var13][0] * par7 + (double)this.frustum[var13][1] * par9 + (double)this.frustum[var13][2] * par5 + (double)this.frustum[var13][3] <= 0.0D && (double)this.frustum[var13][0] * par1 + (double)this.frustum[var13][1] * par3 + (double)this.frustum[var13][2] * par11 + (double)this.frustum[var13][3] <= 0.0D && (double)this.frustum[var13][0] * par7 + (double)this.frustum[var13][1] * par3 + (double)this.frustum[var13][2] * par11 + (double)this.frustum[var13][3] <= 0.0D && (double)this.frustum[var13][0] * par1 + (double)this.frustum[var13][1] * par9 + (double)this.frustum[var13][2] * par11 + (double)this.frustum[var13][3] <= 0.0D && (double)this.frustum[var13][0] * par7 + (double)this.frustum[var13][1] * par9 + (double)this.frustum[var13][2] * par11 + (double)this.frustum[var13][3] <= 0.0D) { - return false; - } - } ---- net/minecraft/src/EntityAIMoveTowardsTarget.java -+++ net/minecraft/src/EntityAIMoveTowardsTarget.java -@@ -7,24 +7,33 @@ - private double movePosY; - private double movePosZ; - private double speed; -+ -+ /** -+ * If the distance to the target entity is further than this, this AI task will not run. -+ */ - private float maxTargetDistance; - -- public EntityAIMoveTowardsTarget(EntityCreature var1, double var2, float var4) { -- this.theEntity = var1; -- this.speed = var2; -- this.maxTargetDistance = var4; -+ public EntityAIMoveTowardsTarget(EntityCreature par1EntityCreature, double par2, float par4) { -+ this.theEntity = par1EntityCreature; -+ this.speed = par2; -+ this.maxTargetDistance = par4; - this.setMutexBits(1); - } - -+ /** -+ * Returns whether the EntityAIBase should begin execution. -+ */ - public boolean shouldExecute() { - this.targetEntity = this.theEntity.getAttackTarget(); -- if(this.targetEntity == null) { -+ -+ if (this.targetEntity == null) { - return false; -- } else if(this.targetEntity.getDistanceSqToEntity(this.theEntity) > (double)(this.maxTargetDistance * this.maxTargetDistance)) { -+ } else if (this.targetEntity.getDistanceSqToEntity(this.theEntity) > (double)(this.maxTargetDistance * this.maxTargetDistance)) { - return false; - } else { - Vec3 var1 = RandomPositionGenerator.findRandomTargetBlockTowards(this.theEntity, 16, 7, this.theEntity.worldObj.getWorldVec3Pool().getVecFromPool(this.targetEntity.posX, this.targetEntity.posY, this.targetEntity.posZ)); -- if(var1 == null) { -+ -+ if (var1 == null) { - return false; - } else { - this.movePosX = var1.xCoord; -@@ -35,14 +44,23 @@ - } - } - -+ /** -+ * Returns whether an in-progress EntityAIBase should continue executing -+ */ - public boolean continueExecuting() { - return !this.theEntity.getNavigator().noPath() && this.targetEntity.isEntityAlive() && this.targetEntity.getDistanceSqToEntity(this.theEntity) < (double)(this.maxTargetDistance * this.maxTargetDistance); - } - -+ /** -+ * Resets the task -+ */ - public void resetTask() { - this.targetEntity = null; - } - -+ /** -+ * Execute a one shot task or start executing a continuous task -+ */ - public void startExecuting() { - this.theEntity.getNavigator().tryMoveToXYZ(this.movePosX, this.movePosY, this.movePosZ, this.speed); - } ---- net/minecraft/src/Packet202PlayerAbilities.java -+++ net/minecraft/src/Packet202PlayerAbilities.java -@@ -5,62 +5,84 @@ - import java.io.IOException; - - public class Packet202PlayerAbilities extends Packet { -+ -+ /** Disables player damage. */ - private boolean disableDamage; -+ -+ /** Indicates whether the player is flying or not. */ - private boolean isFlying; -+ -+ /** Whether or not to allow the player to fly when they double jump. */ - private boolean allowFlying; -+ -+ /** -+ * Used to determine if creative mode is enabled, and therefore if items should be depleted on usage -+ */ - private boolean isCreativeMode; - private float flySpeed; - private float walkSpeed; - -- public Packet202PlayerAbilities() { -- } -- -- public Packet202PlayerAbilities(PlayerCapabilities var1) { -- this.setDisableDamage(var1.disableDamage); -- this.setFlying(var1.isFlying); -- this.setAllowFlying(var1.allowFlying); -- this.setCreativeMode(var1.isCreativeMode); -- this.setFlySpeed(var1.getFlySpeed()); -- this.setWalkSpeed(var1.getWalkSpeed()); -- } -- -- public void readPacketData(DataInput var1) throws IOException { -- byte var2 = var1.readByte(); -+ public Packet202PlayerAbilities() {} -+ -+ public Packet202PlayerAbilities(PlayerCapabilities par1PlayerCapabilities) { -+ this.setDisableDamage(par1PlayerCapabilities.disableDamage); -+ this.setFlying(par1PlayerCapabilities.isFlying); -+ this.setAllowFlying(par1PlayerCapabilities.allowFlying); -+ this.setCreativeMode(par1PlayerCapabilities.isCreativeMode); -+ this.setFlySpeed(par1PlayerCapabilities.getFlySpeed()); -+ this.setWalkSpeed(par1PlayerCapabilities.getWalkSpeed()); -+ } -+ -+ /** -+ * Abstract. Reads the raw packet data from the data stream. -+ */ -+ public void readPacketData(DataInput par1DataInput) throws IOException { -+ byte var2 = par1DataInput.readByte(); - this.setDisableDamage((var2 & 1) > 0); - this.setFlying((var2 & 2) > 0); - this.setAllowFlying((var2 & 4) > 0); - this.setCreativeMode((var2 & 8) > 0); -- this.setFlySpeed(var1.readFloat()); -- this.setWalkSpeed(var1.readFloat()); -+ this.setFlySpeed(par1DataInput.readFloat()); -+ this.setWalkSpeed(par1DataInput.readFloat()); - } - -- public void writePacketData(DataOutput var1) throws IOException { -+ /** -+ * Abstract. Writes the raw packet data to the data stream. -+ */ -+ public void writePacketData(DataOutput par1DataOutput) throws IOException { - byte var2 = 0; -- if(this.getDisableDamage()) { -+ -+ if (this.getDisableDamage()) { - var2 = (byte)(var2 | 1); - } - -- if(this.getFlying()) { -+ if (this.getFlying()) { - var2 = (byte)(var2 | 2); - } - -- if(this.getAllowFlying()) { -+ if (this.getAllowFlying()) { - var2 = (byte)(var2 | 4); - } - -- if(this.isCreativeMode()) { -+ if (this.isCreativeMode()) { - var2 = (byte)(var2 | 8); - } - -- var1.writeByte(var2); -- var1.writeFloat(this.flySpeed); -- var1.writeFloat(this.walkSpeed); -- } -- -- public void processPacket(NetHandler var1) { -- var1.handlePlayerAbilities(this); -- } -- -+ par1DataOutput.writeByte(var2); -+ par1DataOutput.writeFloat(this.flySpeed); -+ par1DataOutput.writeFloat(this.walkSpeed); -+ } -+ -+ /** -+ * Passes this Packet on to the NetHandler for processing. -+ */ -+ public void processPacket(NetHandler par1NetHandler) { -+ par1NetHandler.handlePlayerAbilities(this); -+ } -+ -+ /** -+ * Abstract. Return the size of the packet (not counting the header). -+ */ - public int getPacketSize() { - return 2; - } -@@ -69,55 +91,74 @@ - return this.disableDamage; - } - -- public void setDisableDamage(boolean var1) { -- this.disableDamage = var1; -+ /** -+ * Sets whether damage is disabled or not. -+ */ -+ public void setDisableDamage(boolean par1) { -+ this.disableDamage = par1; - } - - public boolean getFlying() { - return this.isFlying; - } - -- public void setFlying(boolean var1) { -- this.isFlying = var1; -+ /** -+ * Sets whether we're currently flying or not. -+ */ -+ public void setFlying(boolean par1) { -+ this.isFlying = par1; - } - - public boolean getAllowFlying() { - return this.allowFlying; - } - -- public void setAllowFlying(boolean var1) { -- this.allowFlying = var1; -+ public void setAllowFlying(boolean par1) { -+ this.allowFlying = par1; - } - - public boolean isCreativeMode() { - return this.isCreativeMode; - } - -- public void setCreativeMode(boolean var1) { -- this.isCreativeMode = var1; -+ public void setCreativeMode(boolean par1) { -+ this.isCreativeMode = par1; - } - - public float getFlySpeed() { - return this.flySpeed; - } - -- public void setFlySpeed(float var1) { -- this.flySpeed = var1; -+ /** -+ * Sets the flying speed. -+ */ -+ public void setFlySpeed(float par1) { -+ this.flySpeed = par1; - } - - public float getWalkSpeed() { - return this.walkSpeed; - } - -- public void setWalkSpeed(float var1) { -- this.walkSpeed = var1; -+ /** -+ * Sets the walking speed. -+ */ -+ public void setWalkSpeed(float par1) { -+ this.walkSpeed = par1; - } - -+ /** -+ * only false for the abstract Packet class, all real packets return true -+ */ - public boolean isRealPacket() { - return true; - } - -- public boolean containsSameEntityIDAs(Packet var1) { -+ /** -+ * eg return packet30entity.entityId == entityId; WARNING : will throw if you compare a packet to a different packet -+ * class -+ */ -+ public boolean containsSameEntityIDAs(Packet par1Packet) { - return true; - } - } ---- net/minecraft/src/ItemSeedFood.java -+++ net/minecraft/src/ItemSeedFood.java -@@ -1,23 +1,32 @@ - package net.minecraft.src; - - public class ItemSeedFood extends ItemFood { -+ -+ /** Block ID of the crop this seed food should place. */ - private int cropId; -+ -+ /** Block ID of the soil this seed food should be planted on. */ - private int soilId; - -- public ItemSeedFood(int var1, int var2, float var3, int var4, int var5) { -- super(var1, var2, var3, false); -- this.cropId = var4; -- this.soilId = var5; -+ public ItemSeedFood(int par1, int par2, float par3, int par4, int par5) { -+ super(par1, par2, par3, false); -+ this.cropId = par4; -+ this.soilId = par5; - } - -- public boolean onItemUse(ItemStack var1, EntityPlayer var2, World var3, int var4, int var5, int var6, int var7, float var8, float var9, float var10) { -- if(var7 != 1) { -+ /** -+ * Callback for item usage. If the item does something special on right clicking, he will have one of those. Return -+ * True if something happen and false if it don't. This is for ITEMS, not BLOCKS -+ */ -+ public boolean onItemUse(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, World par3World, int par4, int par5, int par6, int par7, float par8, float par9, float par10) { -+ if (par7 != 1) { - return false; -- } else if(var2.canPlayerEdit(var4, var5, var6, var7, var1) && var2.canPlayerEdit(var4, var5 + 1, var6, var7, var1)) { -- int var11 = var3.getBlockId(var4, var5, var6); -- if(var11 == this.soilId && var3.isAirBlock(var4, var5 + 1, var6)) { -- var3.setBlock(var4, var5 + 1, var6, this.cropId); -- --var1.stackSize; -+ } else if (par2EntityPlayer.canPlayerEdit(par4, par5, par6, par7, par1ItemStack) && par2EntityPlayer.canPlayerEdit(par4, par5 + 1, par6, par7, par1ItemStack)) { -+ int var11 = par3World.getBlockId(par4, par5, par6); -+ -+ if (var11 == this.soilId && par3World.isAirBlock(par4, par5 + 1, par6)) { -+ par3World.setBlock(par4, par5 + 1, par6, this.cropId); -+ --par1ItemStack.stackSize; - return true; - } else { - return false; ---- net/minecraft/src/MapGenNetherBridge.java -+++ net/minecraft/src/MapGenNetherBridge.java -@@ -4,13 +4,13 @@ - import java.util.List; - - public class MapGenNetherBridge extends MapGenStructure { -- private List e = new ArrayList(); -+ private List spawnList = new ArrayList(); - - public MapGenNetherBridge() { -- this.e.add(new SpawnListEntry(EntityBlaze.class, 10, 2, 3)); -- this.e.add(new SpawnListEntry(EntityPigZombie.class, 5, 4, 4)); -- this.e.add(new SpawnListEntry(EntitySkeleton.class, 10, 4, 4)); -- this.e.add(new SpawnListEntry(EntityMagmaCube.class, 3, 4, 4)); -+ this.spawnList.add(new SpawnListEntry(EntityBlaze.class, 10, 2, 3)); -+ this.spawnList.add(new SpawnListEntry(EntityPigZombie.class, 5, 4, 4)); -+ this.spawnList.add(new SpawnListEntry(EntitySkeleton.class, 10, 4, 4)); -+ this.spawnList.add(new SpawnListEntry(EntityMagmaCube.class, 3, 4, 4)); - } - - public String func_143025_a() { -@@ -18,18 +18,18 @@ - } - - public List getSpawnList() { -- return this.e; -- } -- -- protected boolean canSpawnStructureAtCoords(int var1, int var2) { -- int var3 = var1 >> 4; -- int var4 = var2 >> 4; -- this.b.setSeed((long)(var3 ^ var4 << 4) ^ this.worldObj.getSeed()); -- this.b.nextInt(); -- return this.b.nextInt(3) != 0 ? false : (var1 != (var3 << 4) + 4 + this.b.nextInt(8) ? false : var2 == (var4 << 4) + 4 + this.b.nextInt(8)); -- } -- -- protected StructureStart getStructureStart(int var1, int var2) { -- return new StructureNetherBridgeStart(this.worldObj, this.b, var1, var2); -+ return this.spawnList; -+ } -+ -+ protected boolean canSpawnStructureAtCoords(int par1, int par2) { -+ int var3 = par1 >> 4; -+ int var4 = par2 >> 4; -+ this.rand.setSeed((long)(var3 ^ var4 << 4) ^ this.worldObj.getSeed()); -+ this.rand.nextInt(); -+ return this.rand.nextInt(3) != 0 ? false : (par1 != (var3 << 4) + 4 + this.rand.nextInt(8) ? false : par2 == (var4 << 4) + 4 + this.rand.nextInt(8)); -+ } -+ -+ protected StructureStart getStructureStart(int par1, int par2) { -+ return new StructureNetherBridgeStart(this.worldObj, this.rand, par1, par2); - } - } ---- net/minecraft/src/Packet42RemoveEntityEffect.java -+++ net/minecraft/src/Packet42RemoveEntityEffect.java -@@ -5,31 +5,46 @@ - import java.io.IOException; - - public class Packet42RemoveEntityEffect extends Packet { -+ -+ /** The ID of the entity which an effect is being removed from. */ - public int entityId; -+ -+ /** The ID of the effect which is being removed from an entity. */ - public byte effectId; - -- public Packet42RemoveEntityEffect() { -- } -- -- public Packet42RemoveEntityEffect(int var1, PotionEffect var2) { -- this.entityId = var1; -- this.effectId = (byte)(var2.getPotionID() & 255); -- } -- -- public void readPacketData(DataInput var1) throws IOException { -- this.entityId = var1.readInt(); -- this.effectId = var1.readByte(); -- } -- -- public void writePacketData(DataOutput var1) throws IOException { -- var1.writeInt(this.entityId); -- var1.writeByte(this.effectId); -- } -- -- public void processPacket(NetHandler var1) { -- var1.handleRemoveEntityEffect(this); -- } -- -+ public Packet42RemoveEntityEffect() {} -+ -+ public Packet42RemoveEntityEffect(int par1, PotionEffect par2PotionEffect) { -+ this.entityId = par1; -+ this.effectId = (byte)(par2PotionEffect.getPotionID() & 255); -+ } -+ -+ /** -+ * Abstract. Reads the raw packet data from the data stream. -+ */ -+ public void readPacketData(DataInput par1DataInput) throws IOException { -+ this.entityId = par1DataInput.readInt(); -+ this.effectId = par1DataInput.readByte(); -+ } -+ -+ /** -+ * Abstract. Writes the raw packet data to the data stream. -+ */ -+ public void writePacketData(DataOutput par1DataOutput) throws IOException { -+ par1DataOutput.writeInt(this.entityId); -+ par1DataOutput.writeByte(this.effectId); -+ } -+ -+ /** -+ * Passes this Packet on to the NetHandler for processing. -+ */ -+ public void processPacket(NetHandler par1NetHandler) { -+ par1NetHandler.handleRemoveEntityEffect(this); -+ } -+ -+ /** -+ * Abstract. Return the size of the packet (not counting the header). -+ */ - public int getPacketSize() { - return 5; - } ---- /dev/null -+++ com/prupe/mcpatcher/ctm/TileOverrideImpl$BetterGrass.java -@@ -1,0 +1,84 @@ -+package com.prupe.mcpatcher.ctm; -+ -+import com.prupe.mcpatcher.TileLoader; -+import java.util.HashSet; -+import java.util.Set; -+import net.minecraft.src.Block; -+import net.minecraft.src.IBlockAccess; -+import net.minecraft.src.Icon; -+ -+final class TileOverrideImpl$BetterGrass implements ITileOverride { -+ private static final int[][] OFFSET_MATRIX = new int[][] {{0, -1}, {0, 1}, { -1, 0}, {1, 0}}; -+ private final int blockID; -+ private final String tileName; -+ private final Icon fullTile; -+ private final Icon fullSnowTile; -+ -+ TileOverrideImpl$BetterGrass(TileLoader tileLoader, int blockID, String tileName) { -+ this.blockID = blockID; -+ this.tileName = tileName; -+ this.fullSnowTile = tileLoader.getIcon("snow"); -+ this.fullTile = tileLoader.getIcon(tileName + "_top"); -+ } -+ -+ public String toString() { -+ return "BetterGrass{" + this.tileName + "}"; -+ } -+ -+ public boolean isDisabled() { -+ return false; -+ } -+ -+ public void registerIcons() {} -+ -+ public Set getMatchingBlocks() { -+ HashSet ids = new HashSet(); -+ ids.add(Integer.valueOf(this.blockID)); -+ return ids; -+ } -+ -+ public Set getMatchingTiles() { -+ return null; -+ } -+ -+ public int getRenderPass() { -+ return 0; -+ } -+ -+ public int getWeight() { -+ return -1; -+ } -+ -+ public int compareTo(ITileOverride o) { -+ return o.getWeight() - this.getWeight(); -+ } -+ -+ public Icon getTile(IBlockAccess blockAccess, Block block, Icon origIcon, int i, int j, int k, int face) { -+ if (face >= 2 && face <= 5) { -+ int[] offset = OFFSET_MATRIX[face - 2]; -+ -+ if (blockAccess.getBlockId(i + offset[0], j - 1, k + offset[1]) == this.blockID) { -+ int neighborBlock = blockAccess.getBlockId(i, j + 1, k); -+ -+ if (neighborBlock != 78 && neighborBlock != 80) { -+ return this.fullTile; -+ } else { -+ neighborBlock = blockAccess.getBlockId(i + offset[0], j, k + offset[1]); -+ return neighborBlock != 78 && neighborBlock != 80 ? null : this.fullSnowTile; -+ } -+ } else { -+ return null; -+ } -+ } else { -+ return null; -+ } -+ } -+ -+ boolean isBetterGrass(IBlockAccess blockAccess, Block block, int i, int j, int k, int face) { -+ return block.blockID == this.blockID && this.getTile(blockAccess, block, (Icon)null, i, j, k, face) == this.fullTile; -+ } -+ -+ public Icon getTile(Block block, Icon origIcon, int face, int metadata) { -+ return null; -+ } -+} ---- net/minecraft/src/StatTypeDistance.java -+++ net/minecraft/src/StatTypeDistance.java -@@ -1,9 +1,13 @@ - package net.minecraft.src; - - final class StatTypeDistance implements IStatType { -- public String format(int var1) { -- double var2 = (double)var1 / 100.0D; -+ -+ /** -+ * Formats a given stat for human consumption. -+ */ -+ public String format(int par1) { -+ double var2 = (double)par1 / 100.0D; - double var4 = var2 / 1000.0D; -- return var4 > 0.5D ? StatBase.getDecimalFormat().format(var4) + " km" : (var2 > 0.5D ? StatBase.getDecimalFormat().format(var2) + " m" : var1 + " cm"); -+ return var4 > 0.5D ? StatBase.getDecimalFormat().format(var4) + " km" : (var2 > 0.5D ? StatBase.getDecimalFormat().format(var2) + " m" : par1 + " cm"); - } - } ---- net/minecraft/src/CreativeTabInventory.java -+++ net/minecraft/src/CreativeTabInventory.java -@@ -1,10 +1,13 @@ - package net.minecraft.src; - - final class CreativeTabInventory extends CreativeTabs { -- CreativeTabInventory(int var1, String var2) { -- super(var1, var2); -+ CreativeTabInventory(int par1, String par2Str) { -+ super(par1, par2Str); - } - -+ /** -+ * the itemID for the item to be displayed on the tab -+ */ - public int getTabIconItemIndex() { - return Block.chest.blockID; - } ---- net/minecraft/src/MovementInput.java -+++ net/minecraft/src/MovementInput.java -@@ -1,11 +1,24 @@ - package net.minecraft.src; - - public class MovementInput { -+ -+ /** -+ * The speed at which the player is strafing. Postive numbers to the left and negative to the right. -+ */ - public float moveStrafe; -+ -+ /** -+ * The speed at which the player is moving forward. Negative numbers will move backwards. -+ */ - public float moveForward; - public boolean jump; - public boolean sneak; -+ // Spout Start -+ public boolean flyingUp; -+ public boolean flyingDown; -+ // Spout End - -- public void updatePlayerMoveState() { -- } -+ // Spout Start - Keep parameter. TODO: Add a reason why. -+ public void updatePlayerMoveState(EntityPlayer par1EntityPlayer) {} -+ // Spout End - } ---- net/minecraft/src/SoundManagerINNER1.java -+++ net/minecraft/src/SoundManagerINNER1.java -@@ -5,8 +5,8 @@ - class SoundManagerINNER1 implements Runnable { - final SoundManager theSoundManager; - -- SoundManagerINNER1(SoundManager var1) { -- this.theSoundManager = var1; -+ SoundManagerINNER1(SoundManager par1SoundManager) { -+ this.theSoundManager = par1SoundManager; - } - - public void run() { ---- net/minecraft/src/RegionFile.java -+++ net/minecraft/src/RegionFile.java -@@ -15,106 +15,116 @@ - - public class RegionFile { - private static final byte[] emptySector = new byte[4096]; -- private final File b; -- private RandomAccessFile c; -+ private final File fileName; -+ private RandomAccessFile dataFile; - private final int[] offsets = new int[1024]; - private final int[] chunkTimestamps = new int[1024]; -- private ArrayList f; -+ private ArrayList sectorFree; -+ -+ /** McRegion sizeDelta */ - private int sizeDelta; - private long lastModified; - -- public RegionFile(File var1) { -- this.b = var1; -+ public RegionFile(File par1File) { -+ this.fileName = par1File; - this.sizeDelta = 0; - - try { -- if(var1.exists()) { -- this.lastModified = var1.lastModified(); -+ if (par1File.exists()) { -+ this.lastModified = par1File.lastModified(); - } - -- this.c = new RandomAccessFile(var1, "rw"); -+ this.dataFile = new RandomAccessFile(par1File, "rw"); - int var2; -- if(this.c.length() < 4096L) { -- for(var2 = 0; var2 < 1024; ++var2) { -- this.c.writeInt(0); -+ -+ if (this.dataFile.length() < 4096L) { -+ for (var2 = 0; var2 < 1024; ++var2) { -+ this.dataFile.writeInt(0); - } - -- for(var2 = 0; var2 < 1024; ++var2) { -- this.c.writeInt(0); -+ for (var2 = 0; var2 < 1024; ++var2) { -+ this.dataFile.writeInt(0); - } - - this.sizeDelta += 8192; - } - -- if((this.c.length() & 4095L) != 0L) { -- for(var2 = 0; (long)var2 < (this.c.length() & 4095L); ++var2) { -- this.c.write(0); -+ if ((this.dataFile.length() & 4095L) != 0L) { -+ for (var2 = 0; (long)var2 < (this.dataFile.length() & 4095L); ++var2) { -+ this.dataFile.write(0); - } - } - -- var2 = (int)this.c.length() / 4096; -- this.f = new ArrayList(var2); -- -+ var2 = (int)this.dataFile.length() / 4096; -+ this.sectorFree = new ArrayList(var2); - int var3; -- for(var3 = 0; var3 < var2; ++var3) { -- this.f.add(Boolean.valueOf(true)); -+ -+ for (var3 = 0; var3 < var2; ++var3) { -+ this.sectorFree.add(Boolean.valueOf(true)); - } - -- this.f.set(0, Boolean.valueOf(false)); -- this.f.set(1, Boolean.valueOf(false)); -- this.c.seek(0L); -- -+ this.sectorFree.set(0, Boolean.valueOf(false)); -+ this.sectorFree.set(1, Boolean.valueOf(false)); -+ this.dataFile.seek(0L); - int var4; -- for(var3 = 0; var3 < 1024; ++var3) { -- var4 = this.c.readInt(); -+ -+ for (var3 = 0; var3 < 1024; ++var3) { -+ var4 = this.dataFile.readInt(); - this.offsets[var3] = var4; -- if(var4 != 0 && (var4 >> 8) + (var4 & 255) <= this.f.size()) { -- for(int var5 = 0; var5 < (var4 & 255); ++var5) { -- this.f.set((var4 >> 8) + var5, Boolean.valueOf(false)); -+ -+ if (var4 != 0 && (var4 >> 8) + (var4 & 255) <= this.sectorFree.size()) { -+ for (int var5 = 0; var5 < (var4 & 255); ++var5) { -+ this.sectorFree.set((var4 >> 8) + var5, Boolean.valueOf(false)); - } - } - } - -- for(var3 = 0; var3 < 1024; ++var3) { -- var4 = this.c.readInt(); -+ for (var3 = 0; var3 < 1024; ++var3) { -+ var4 = this.dataFile.readInt(); - this.chunkTimestamps[var3] = var4; - } - } catch (IOException var6) { - var6.printStackTrace(); - } -- - } - -- public synchronized DataInputStream getChunkDataInputStream(int var1, int var2) { -- if(this.outOfBounds(var1, var2)) { -+ /** -+ * args: x, y - get uncompressed chunk stream from the region file -+ */ -+ public synchronized DataInputStream getChunkDataInputStream(int par1, int par2) { -+ if (this.outOfBounds(par1, par2)) { - return null; - } else { - try { -- int var3 = this.getOffset(var1, var2); -- if(var3 == 0) { -+ int var3 = this.getOffset(par1, par2); -+ -+ if (var3 == 0) { - return null; - } else { - int var4 = var3 >> 8; - int var5 = var3 & 255; -- if(var4 + var5 > this.f.size()) { -+ -+ if (var4 + var5 > this.sectorFree.size()) { - return null; - } else { -- this.c.seek((long)(var4 * 4096)); -- int var6 = this.c.readInt(); -- if(var6 > 4096 * var5) { -+ this.dataFile.seek((long)(var4 * 4096)); -+ int var6 = this.dataFile.readInt(); -+ -+ if (var6 > 4096 * var5) { - return null; -- } else if(var6 <= 0) { -+ } else if (var6 <= 0) { - return null; - } else { -- byte var7 = this.c.readByte(); -+ byte var7 = this.dataFile.readByte(); - byte[] var8; -- if(var7 == 1) { -+ -+ if (var7 == 1) { - var8 = new byte[var6 - 1]; -- this.c.read(var8); -+ this.dataFile.read(var8); - return new DataInputStream(new BufferedInputStream(new GZIPInputStream(new ByteArrayInputStream(var8)))); -- } else if(var7 == 2) { -+ } else if (var7 == 2) { - var8 = new byte[var6 - 1]; -- this.c.read(var8); -+ this.dataFile.read(var8); - return new DataInputStream(new BufferedInputStream(new InflaterInputStream(new ByteArrayInputStream(var8)))); - } else { - return null; -@@ -128,116 +138,144 @@ - } - } - -- public DataOutputStream getChunkDataOutputStream(int var1, int var2) { -- return this.outOfBounds(var1, var2) ? null : new DataOutputStream(new DeflaterOutputStream(new RegionFileChunkBuffer(this, var1, var2))); -+ /** -+ * args: x, z - get an output stream used to write chunk data, data is on disk when the returned stream is closed -+ */ -+ public DataOutputStream getChunkDataOutputStream(int par1, int par2) { -+ return this.outOfBounds(par1, par2) ? null : new DataOutputStream(new DeflaterOutputStream(new RegionFileChunkBuffer(this, par1, par2))); - } - -- protected synchronized void write(int var1, int var2, byte[] var3, int var4) { -+ /** -+ * args: x, z, data, length - write chunk data at (x, z) to disk -+ */ -+ protected synchronized void write(int par1, int par2, byte[] par3ArrayOfByte, int par4) { - try { -- int var5 = this.getOffset(var1, var2); -+ int var5 = this.getOffset(par1, par2); - int var6 = var5 >> 8; - int var7 = var5 & 255; -- int var8 = (var4 + 5) / 4096 + 1; -- if(var8 >= 256) { -+ int var8 = (par4 + 5) / 4096 + 1; -+ -+ if (var8 >= 256) { - return; - } - -- if(var6 != 0 && var7 == var8) { -- this.write(var6, var3, var4); -+ if (var6 != 0 && var7 == var8) { -+ this.write(var6, par3ArrayOfByte, par4); - } else { - int var9; -- for(var9 = 0; var9 < var7; ++var9) { -- this.f.set(var6 + var9, Boolean.valueOf(true)); -+ -+ for (var9 = 0; var9 < var7; ++var9) { -+ this.sectorFree.set(var6 + var9, Boolean.valueOf(true)); - } - -- var9 = this.f.indexOf(Boolean.valueOf(true)); -+ var9 = this.sectorFree.indexOf(Boolean.valueOf(true)); - int var10 = 0; - int var11; -- if(var9 != -1) { -- for(var11 = var9; var11 < this.f.size(); ++var11) { -- if(var10 != 0) { -- if(((Boolean)this.f.get(var11)).booleanValue()) { -+ -+ if (var9 != -1) { -+ for (var11 = var9; var11 < this.sectorFree.size(); ++var11) { -+ if (var10 != 0) { -+ if (((Boolean)this.sectorFree.get(var11)).booleanValue()) { - ++var10; - } else { - var10 = 0; - } -- } else if(((Boolean)this.f.get(var11)).booleanValue()) { -+ } else if (((Boolean)this.sectorFree.get(var11)).booleanValue()) { - var9 = var11; - var10 = 1; - } - -- if(var10 >= var8) { -+ if (var10 >= var8) { - break; - } - } - } - -- if(var10 >= var8) { -+ if (var10 >= var8) { - var6 = var9; -- this.setOffset(var1, var2, var9 << 8 | var8); -+ this.setOffset(par1, par2, var9 << 8 | var8); - -- for(var11 = 0; var11 < var8; ++var11) { -- this.f.set(var6 + var11, Boolean.valueOf(false)); -+ for (var11 = 0; var11 < var8; ++var11) { -+ this.sectorFree.set(var6 + var11, Boolean.valueOf(false)); - } - -- this.write(var6, var3, var4); -+ this.write(var6, par3ArrayOfByte, par4); - } else { -- this.c.seek(this.c.length()); -- var6 = this.f.size(); -+ this.dataFile.seek(this.dataFile.length()); -+ var6 = this.sectorFree.size(); - -- for(var11 = 0; var11 < var8; ++var11) { -- this.c.write(emptySector); -- this.f.add(Boolean.valueOf(false)); -+ for (var11 = 0; var11 < var8; ++var11) { -+ this.dataFile.write(emptySector); -+ this.sectorFree.add(Boolean.valueOf(false)); - } - - this.sizeDelta += 4096 * var8; -- this.write(var6, var3, var4); -- this.setOffset(var1, var2, var6 << 8 | var8); -+ this.write(var6, par3ArrayOfByte, par4); -+ this.setOffset(par1, par2, var6 << 8 | var8); - } - } - -- this.setChunkTimestamp(var1, var2, (int)(MinecraftServer.getCurrentTimeMillis() / 1000L)); -+ this.setChunkTimestamp(par1, par2, (int)(MinecraftServer.getSystemTimeMillis() / 1000L)); - } catch (IOException var12) { - var12.printStackTrace(); - } -- -- } -- -- private void write(int var1, byte[] var2, int var3) throws IOException { -- this.c.seek((long)(var1 * 4096)); -- this.c.writeInt(var3 + 1); -- this.c.writeByte(2); -- this.c.write(var2, 0, var3); -- } -- -- private boolean outOfBounds(int var1, int var2) { -- return var1 < 0 || var1 >= 32 || var2 < 0 || var2 >= 32; -- } -- -- private int getOffset(int var1, int var2) { -- return this.offsets[var1 + var2 * 32]; -- } -- -- public boolean isChunkSaved(int var1, int var2) { -- return this.getOffset(var1, var2) != 0; -- } -- -- private void setOffset(int var1, int var2, int var3) throws IOException { -- this.offsets[var1 + var2 * 32] = var3; -- this.c.seek((long)((var1 + var2 * 32) * 4)); -- this.c.writeInt(var3); -- } -- -- private void setChunkTimestamp(int var1, int var2, int var3) throws IOException { -- this.chunkTimestamps[var1 + var2 * 32] = var3; -- this.c.seek((long)(4096 + (var1 + var2 * 32) * 4)); -- this.c.writeInt(var3); -- } -- -+ } -+ -+ /** -+ * args: sectorNumber, data, length - write the chunk data to this RegionFile -+ */ -+ private void write(int par1, byte[] par2ArrayOfByte, int par3) throws IOException { -+ this.dataFile.seek((long)(par1 * 4096)); -+ this.dataFile.writeInt(par3 + 1); -+ this.dataFile.writeByte(2); -+ this.dataFile.write(par2ArrayOfByte, 0, par3); -+ } -+ -+ /** -+ * args: x, z - check region bounds -+ */ -+ private boolean outOfBounds(int par1, int par2) { -+ return par1 < 0 || par1 >= 32 || par2 < 0 || par2 >= 32; -+ } -+ -+ /** -+ * args: x, y - get chunk's offset in region file -+ */ -+ private int getOffset(int par1, int par2) { -+ return this.offsets[par1 + par2 * 32]; -+ } -+ -+ /** -+ * args: x, z, - true if chunk has been saved / converted -+ */ -+ public boolean isChunkSaved(int par1, int par2) { -+ return this.getOffset(par1, par2) != 0; -+ } -+ -+ /** -+ * args: x, z, offset - sets the chunk's offset in the region file -+ */ -+ private void setOffset(int par1, int par2, int par3) throws IOException { -+ this.offsets[par1 + par2 * 32] = par3; -+ this.dataFile.seek((long)((par1 + par2 * 32) * 4)); -+ this.dataFile.writeInt(par3); -+ } -+ -+ /** -+ * args: x, z, timestamp - sets the chunk's write timestamp -+ */ -+ private void setChunkTimestamp(int par1, int par2, int par3) throws IOException { -+ this.chunkTimestamps[par1 + par2 * 32] = par3; -+ this.dataFile.seek((long)(4096 + (par1 + par2 * 32) * 4)); -+ this.dataFile.writeInt(par3); -+ } -+ -+ /** -+ * close this RegionFile and prevent further writes -+ */ - public void close() throws IOException { -- if(this.c != null) { -- this.c.close(); -+ if (this.dataFile != null) { -+ this.dataFile.close(); - } -- - } - } ---- net/minecraft/src/EnumEntitySize.java -+++ net/minecraft/src/EnumEntitySize.java -@@ -8,62 +8,68 @@ - SIZE_5, - SIZE_6; - -- public int multiplyBy32AndRound(double var1) { -- double var3 = var1 - ((double)MathHelper.floor_double(var1) + 0.5D); -- switch(EnumEntitySizeHelper.field_96565_a[this.ordinal()]) { -- case 1: -- if(var3 < 0.0D) { -- if(var3 < -0.3125D) { -- return MathHelper.ceiling_double_int(var1 * 32.0D); -- } -- } else if(var3 < 0.3125D) { -- return MathHelper.ceiling_double_int(var1 * 32.0D); -- } -- -- return MathHelper.floor_double(var1 * 32.0D); -- case 2: -- if(var3 < 0.0D) { -- if(var3 < -0.3125D) { -- return MathHelper.floor_double(var1 * 32.0D); -- } -- } else if(var3 < 0.3125D) { -- return MathHelper.floor_double(var1 * 32.0D); -- } -- -- return MathHelper.ceiling_double_int(var1 * 32.0D); -- case 3: -- if(var3 > 0.0D) { -- return MathHelper.floor_double(var1 * 32.0D); -- } -- -- return MathHelper.ceiling_double_int(var1 * 32.0D); -- case 4: -- if(var3 < 0.0D) { -- if(var3 < -0.1875D) { -- return MathHelper.ceiling_double_int(var1 * 32.0D); -- } -- } else if(var3 < 0.1875D) { -- return MathHelper.ceiling_double_int(var1 * 32.0D); -- } -- -- return MathHelper.floor_double(var1 * 32.0D); -- case 5: -- if(var3 < 0.0D) { -- if(var3 < -0.1875D) { -- return MathHelper.floor_double(var1 * 32.0D); -- } -- } else if(var3 < 0.1875D) { -- return MathHelper.floor_double(var1 * 32.0D); -- } -- -- return MathHelper.ceiling_double_int(var1 * 32.0D); -- case 6: -- default: -- if(var3 > 0.0D) { -- return MathHelper.ceiling_double_int(var1 * 32.0D); -- } else { -- return MathHelper.floor_double(var1 * 32.0D); -- } -+ public int multiplyBy32AndRound(double par1) { -+ double var3 = par1 - ((double)MathHelper.floor_double(par1) + 0.5D); -+ -+ switch (EnumEntitySizeHelper.field_96565_a[this.ordinal()]) { -+ case 1: -+ if (var3 < 0.0D) { -+ if (var3 < -0.3125D) { -+ return MathHelper.ceiling_double_int(par1 * 32.0D); -+ } -+ } else if (var3 < 0.3125D) { -+ return MathHelper.ceiling_double_int(par1 * 32.0D); -+ } -+ -+ return MathHelper.floor_double(par1 * 32.0D); -+ -+ case 2: -+ if (var3 < 0.0D) { -+ if (var3 < -0.3125D) { -+ return MathHelper.floor_double(par1 * 32.0D); -+ } -+ } else if (var3 < 0.3125D) { -+ return MathHelper.floor_double(par1 * 32.0D); -+ } -+ -+ return MathHelper.ceiling_double_int(par1 * 32.0D); -+ -+ case 3: -+ if (var3 > 0.0D) { -+ return MathHelper.floor_double(par1 * 32.0D); -+ } -+ -+ return MathHelper.ceiling_double_int(par1 * 32.0D); -+ -+ case 4: -+ if (var3 < 0.0D) { -+ if (var3 < -0.1875D) { -+ return MathHelper.ceiling_double_int(par1 * 32.0D); -+ } -+ } else if (var3 < 0.1875D) { -+ return MathHelper.ceiling_double_int(par1 * 32.0D); -+ } -+ -+ return MathHelper.floor_double(par1 * 32.0D); -+ -+ case 5: -+ if (var3 < 0.0D) { -+ if (var3 < -0.1875D) { -+ return MathHelper.floor_double(par1 * 32.0D); -+ } -+ } else if (var3 < 0.1875D) { -+ return MathHelper.floor_double(par1 * 32.0D); -+ } -+ -+ return MathHelper.ceiling_double_int(par1 * 32.0D); -+ -+ case 6: -+ default: -+ if (var3 > 0.0D) { -+ return MathHelper.ceiling_double_int(par1 * 32.0D); -+ } else { -+ return MathHelper.floor_double(par1 * 32.0D); -+ } - } - } - } ---- net/minecraft/src/EntityBoat.java -+++ net/minecraft/src/EntityBoat.java -@@ -15,8 +15,8 @@ - private double velocityY; - private double velocityZ; - -- public EntityBoat(World var1) { -- super(var1); -+ public EntityBoat(World par1World) { -+ super(par1World); - this.field_70279_a = true; - this.speedMultiplier = 0.07D; - this.preventEntitySpawning = true; -@@ -24,6 +24,10 @@ - this.yOffset = this.height / 2.0F; - } - -+ /** -+ * returns if this entity triggers Block.onEntityWalking on the blocks they walk on. used for spiders and wolves to -+ * prevent them from trampling crops -+ */ - protected boolean canTriggerWalking() { - return false; - } -@@ -34,48 +38,65 @@ - this.dataWatcher.addObject(19, new Float(0.0F)); - } - -- public AxisAlignedBB getCollisionBox(Entity var1) { -- return var1.boundingBox; -+ /** -+ * Returns a boundingBox used to collide the entity with other entities and blocks. This enables the entity to be -+ * pushable on contact, like boats or minecarts. -+ */ -+ public AxisAlignedBB getCollisionBox(Entity par1Entity) { -+ return par1Entity.boundingBox; - } - -+ /** -+ * returns the bounding box for this entity -+ */ - public AxisAlignedBB getBoundingBox() { - return this.boundingBox; - } - -+ /** -+ * Returns true if this entity should push and be pushed by other entities when colliding. -+ */ - public boolean canBePushed() { - return true; - } - -- public EntityBoat(World var1, double var2, double var4, double var6) { -- this(var1); -- this.setPosition(var2, var4 + (double)this.yOffset, var6); -+ public EntityBoat(World par1World, double par2, double par4, double par6) { -+ this(par1World); -+ this.setPosition(par2, par4 + (double)this.yOffset, par6); - this.motionX = 0.0D; - this.motionY = 0.0D; - this.motionZ = 0.0D; -- this.prevPosX = var2; -- this.prevPosY = var4; -- this.prevPosZ = var6; -+ this.prevPosX = par2; -+ this.prevPosY = par4; -+ this.prevPosZ = par6; - } - -+ /** -+ * Returns the Y offset from the entity's position for any entity riding this one. -+ */ - public double getMountedYOffset() { -- return (double)this.height * 0.0D - (double)0.3F; -+ return (double)this.height * 0.0D - 0.30000001192092896D; - } - -- public boolean attackEntityFrom(DamageSource var1, float var2) { -- if(this.isEntityInvulnerable()) { -+ /** -+ * Called when the entity is attacked. -+ */ -+ public boolean attackEntityFrom(DamageSource par1DamageSource, float par2) { -+ if (this.isEntityInvulnerable()) { - return false; -- } else if(!this.worldObj.isRemote && !this.isDead) { -+ } else if (!this.worldObj.isRemote && !this.isDead) { - this.setForwardDirection(-this.getForwardDirection()); - this.setTimeSinceHit(10); -- this.setDamageTaken(this.getDamageTaken() + var2 * 10.0F); -+ this.setDamageTaken(this.getDamageTaken() + par2 * 10.0F); - this.setBeenAttacked(); -- boolean var3 = var1.getEntity() instanceof EntityPlayer && ((EntityPlayer)var1.getEntity()).capabilities.isCreativeMode; -- if(var3 || this.getDamageTaken() > 40.0F) { -- if(this.riddenByEntity != null) { -+ boolean var3 = par1DamageSource.getEntity() instanceof EntityPlayer && ((EntityPlayer)par1DamageSource.getEntity()).capabilities.isCreativeMode; -+ -+ if (var3 || this.getDamageTaken() > 40.0F) { -+ if (this.riddenByEntity != null) { - this.riddenByEntity.mountEntity(this); - } - -- if(!var3) { -+ if (!var3) { - this.dropItemWithOffset(Item.boat.itemID, 1, 0.0F); - } - -@@ -88,54 +109,72 @@ - } - } - -+ /** -+ * Setups the entity to do the hurt animation. Only used by packets in multiplayer. -+ */ - public void performHurtAnimation() { - this.setForwardDirection(-this.getForwardDirection()); - this.setTimeSinceHit(10); - this.setDamageTaken(this.getDamageTaken() * 11.0F); - } - -+ /** -+ * Returns true if other Entities should be prevented from moving through this Entity. -+ */ - public boolean canBeCollidedWith() { - return !this.isDead; - } - -- public void setPositionAndRotation2(double var1, double var3, double var5, float var7, float var8, int var9) { -- if(this.field_70279_a) { -- this.boatPosRotationIncrements = var9 + 5; -+ /** -+ * Sets the position and rotation. Only difference from the other one is no bounding on the rotation. Args: posX, posY, -+ * posZ, yaw, pitch -+ */ -+ public void setPositionAndRotation2(double par1, double par3, double par5, float par7, float par8, int par9) { -+ if (this.field_70279_a) { -+ this.boatPosRotationIncrements = par9 + 5; - } else { -- double var10 = var1 - this.posX; -- double var12 = var3 - this.posY; -- double var14 = var5 - this.posZ; -+ double var10 = par1 - this.posX; -+ double var12 = par3 - this.posY; -+ double var14 = par5 - this.posZ; - double var16 = var10 * var10 + var12 * var12 + var14 * var14; -- if(var16 <= 1.0D) { -+ -+ if (var16 <= 1.0D) { - return; - } - - this.boatPosRotationIncrements = 3; - } - -- this.boatX = var1; -- this.boatY = var3; -- this.boatZ = var5; -- this.boatYaw = (double)var7; -- this.boatPitch = (double)var8; -+ this.boatX = par1; -+ this.boatY = par3; -+ this.boatZ = par5; -+ this.boatYaw = (double)par7; -+ this.boatPitch = (double)par8; - this.motionX = this.velocityX; - this.motionY = this.velocityY; - this.motionZ = this.velocityZ; - } - -- public void setVelocity(double var1, double var3, double var5) { -- this.velocityX = this.motionX = var1; -- this.velocityY = this.motionY = var3; -- this.velocityZ = this.motionZ = var5; -+ /** -+ * Sets the velocity to the args. Args: x, y, z -+ */ -+ public void setVelocity(double par1, double par3, double par5) { -+ this.velocityX = this.motionX = par1; -+ this.velocityY = this.motionY = par3; -+ this.velocityZ = this.motionZ = par5; - } - -+ /** -+ * Called to update the entity's position/logic. -+ */ - public void onUpdate() { - super.onUpdate(); -- if(this.getTimeSinceHit() > 0) { -+ -+ if (this.getTimeSinceHit() > 0) { - this.setTimeSinceHit(this.getTimeSinceHit() - 1); - } - -- if(this.getDamageTaken() > 0.0F) { -+ if (this.getDamageTaken() > 0.0F) { - this.setDamageTaken(this.getDamageTaken() - 1.0F); - } - -@@ -145,11 +184,12 @@ - byte var1 = 5; - double var2 = 0.0D; - -- for(int var4 = 0; var4 < var1; ++var4) { -+ for (int var4 = 0; var4 < var1; ++var4) { - double var5 = this.boundingBox.minY + (this.boundingBox.maxY - this.boundingBox.minY) * (double)(var4 + 0) / (double)var1 - 0.125D; - double var7 = this.boundingBox.minY + (this.boundingBox.maxY - this.boundingBox.minY) * (double)(var4 + 1) / (double)var1 - 0.125D; - AxisAlignedBB var9 = AxisAlignedBB.getAABBPool().getAABB(this.boundingBox.minX, var5, this.boundingBox.minZ, this.boundingBox.maxX, var7, this.boundingBox.maxZ); -- if(this.worldObj.isAABBInMaterial(var9, Material.water)) { -+ -+ if (this.worldObj.isAABBInMaterial(var9, Material.water)) { - var2 += 1.0D / (double)var1; - } - } -@@ -157,16 +197,18 @@ - double var23 = Math.sqrt(this.motionX * this.motionX + this.motionZ * this.motionZ); - double var6; - double var8; -- if(var23 > 0.26249999999999996D) { -+ -+ if (var23 > 0.26249999999999996D) { - var6 = Math.cos((double)this.rotationYaw * Math.PI / 180.0D); - var8 = Math.sin((double)this.rotationYaw * Math.PI / 180.0D); - -- for(int var10 = 0; (double)var10 < 1.0D + var23 * 60.0D; ++var10) { -- double var11 = (double)(this.ab.nextFloat() * 2.0F - 1.0F); -- double var13 = (double)(this.ab.nextInt(2) * 2 - 1) * 0.7D; -+ for (int var10 = 0; (double)var10 < 1.0D + var23 * 60.0D; ++var10) { -+ double var11 = (double)(this.rand.nextFloat() * 2.0F - 1.0F); -+ double var13 = (double)(this.rand.nextInt(2) * 2 - 1) * 0.7D; - double var15; - double var17; -- if(this.ab.nextBoolean()) { -+ -+ if (this.rand.nextBoolean()) { - var15 = this.posX - var6 * var11 * 0.8D + var8 * var13; - var17 = this.posZ - var8 * var11 * 0.8D - var6 * var13; - this.worldObj.spawnParticle("splash", var15, this.posY - 0.125D, var17, this.motionX, this.motionY, this.motionZ); -@@ -180,8 +222,9 @@ - - double var12; - double var25; -- if(this.worldObj.isRemote && this.field_70279_a) { -- if(this.boatPosRotationIncrements > 0) { -+ -+ if (this.worldObj.isRemote && this.field_70279_a) { -+ if (this.boatPosRotationIncrements > 0) { - var6 = this.posX + (this.boatX - this.posX) / (double)this.boatPosRotationIncrements; - var8 = this.posY + (this.boatY - this.posY) / (double)this.boatPosRotationIncrements; - var25 = this.posZ + (this.boatZ - this.posZ) / (double)this.boatPosRotationIncrements; -@@ -196,194 +239,229 @@ - var8 = this.posY + this.motionY; - var25 = this.posZ + this.motionZ; - this.setPosition(var6, var8, var25); -- if(this.onGround) { -+ -+ if (this.onGround) { - this.motionX *= 0.5D; - this.motionY *= 0.5D; - this.motionZ *= 0.5D; - } - -- this.motionX *= (double)0.99F; -- this.motionY *= (double)0.95F; -- this.motionZ *= (double)0.99F; -+ this.motionX *= 0.9900000095367432D; -+ this.motionY *= 0.949999988079071D; -+ this.motionZ *= 0.9900000095367432D; - } -- - } else { -- if(var2 < 1.0D) { -+ if (var2 < 1.0D) { - var6 = var2 * 2.0D - 1.0D; -- this.motionY += (double)0.04F * var6; -+ this.motionY += 0.03999999910593033D * var6; - } else { -- if(this.motionY < 0.0D) { -+ if (this.motionY < 0.0D) { - this.motionY /= 2.0D; - } - -- this.motionY += (double)0.007F; -+ this.motionY += 0.007000000216066837D; - } - -- if(this.riddenByEntity != null && this.riddenByEntity instanceof EntityLivingBase) { -+ if (this.riddenByEntity != null && this.riddenByEntity instanceof EntityLivingBase) { - var6 = (double)((EntityLivingBase)this.riddenByEntity).moveForward; -- if(var6 > 0.0D) { -+ -+ if (var6 > 0.0D) { - var8 = -Math.sin((double)(this.riddenByEntity.rotationYaw * (float)Math.PI / 180.0F)); - var25 = Math.cos((double)(this.riddenByEntity.rotationYaw * (float)Math.PI / 180.0F)); -- this.motionX += var8 * this.speedMultiplier * (double)0.05F; -- this.motionZ += var25 * this.speedMultiplier * (double)0.05F; -+ this.motionX += var8 * this.speedMultiplier * 0.05000000074505806D; -+ this.motionZ += var25 * this.speedMultiplier * 0.05000000074505806D; - } - } - - var6 = Math.sqrt(this.motionX * this.motionX + this.motionZ * this.motionZ); -- if(var6 > 0.35D) { -+ -+ if (var6 > 0.35D) { - var8 = 0.35D / var6; - this.motionX *= var8; - this.motionZ *= var8; - var6 = 0.35D; - } - -- if(var6 > var23 && this.speedMultiplier < 0.35D) { -+ if (var6 > var23 && this.speedMultiplier < 0.35D) { - this.speedMultiplier += (0.35D - this.speedMultiplier) / 35.0D; -- if(this.speedMultiplier > 0.35D) { -+ -+ if (this.speedMultiplier > 0.35D) { - this.speedMultiplier = 0.35D; - } - } else { - this.speedMultiplier -= (this.speedMultiplier - 0.07D) / 35.0D; -- if(this.speedMultiplier < 0.07D) { -+ -+ if (this.speedMultiplier < 0.07D) { - this.speedMultiplier = 0.07D; - } - } - -- if(this.onGround) { -+ if (this.onGround) { - this.motionX *= 0.5D; - this.motionY *= 0.5D; - this.motionZ *= 0.5D; - } - - this.moveEntity(this.motionX, this.motionY, this.motionZ); -- if(this.isCollidedHorizontally && var23 > 0.2D) { -- if(!this.worldObj.isRemote && !this.isDead) { -+ -+ if (this.isCollidedHorizontally && var23 > 0.2D) { -+ if (!this.worldObj.isRemote && !this.isDead) { - this.setDead(); -- - int var24; -- for(var24 = 0; var24 < 3; ++var24) { -+ -+ for (var24 = 0; var24 < 3; ++var24) { - this.dropItemWithOffset(Block.planks.blockID, 1, 0.0F); - } - -- for(var24 = 0; var24 < 2; ++var24) { -+ for (var24 = 0; var24 < 2; ++var24) { - this.dropItemWithOffset(Item.stick.itemID, 1, 0.0F); - } - } - } else { -- this.motionX *= (double)0.99F; -- this.motionY *= (double)0.95F; -- this.motionZ *= (double)0.99F; -+ this.motionX *= 0.9900000095367432D; -+ this.motionY *= 0.949999988079071D; -+ this.motionZ *= 0.9900000095367432D; - } - - this.rotationPitch = 0.0F; - var8 = (double)this.rotationYaw; - var25 = this.prevPosX - this.posX; - var12 = this.prevPosZ - this.posZ; -- if(var25 * var25 + var12 * var12 > 0.001D) { -+ -+ if (var25 * var25 + var12 * var12 > 0.001D) { - var8 = (double)((float)(Math.atan2(var12, var25) * 180.0D / Math.PI)); - } - - double var14 = MathHelper.wrapAngleTo180_double(var8 - (double)this.rotationYaw); -- if(var14 > 20.0D) { -+ -+ if (var14 > 20.0D) { - var14 = 20.0D; - } - -- if(var14 < -20.0D) { -+ if (var14 < -20.0D) { - var14 = -20.0D; - } - - this.rotationYaw = (float)((double)this.rotationYaw + var14); - this.setRotation(this.rotationYaw, this.rotationPitch); -- if(!this.worldObj.isRemote) { -- List var16 = this.worldObj.getEntitiesWithinAABBExcludingEntity(this, this.boundingBox.expand((double)0.2F, 0.0D, (double)0.2F)); -+ -+ if (!this.worldObj.isRemote) { -+ List var16 = this.worldObj.getEntitiesWithinAABBExcludingEntity(this, this.boundingBox.expand(0.20000000298023224D, 0.0D, 0.20000000298023224D)); - int var26; -- if(var16 != null && !var16.isEmpty()) { -- for(var26 = 0; var26 < var16.size(); ++var26) { -+ -+ if (var16 != null && !var16.isEmpty()) { -+ for (var26 = 0; var26 < var16.size(); ++var26) { - Entity var18 = (Entity)var16.get(var26); -- if(var18 != this.riddenByEntity && var18.canBePushed() && var18 instanceof EntityBoat) { -+ -+ if (var18 != this.riddenByEntity && var18.canBePushed() && var18 instanceof EntityBoat) { - var18.applyEntityCollision(this); - } - } - } - -- for(var26 = 0; var26 < 4; ++var26) { -+ for (var26 = 0; var26 < 4; ++var26) { - int var27 = MathHelper.floor_double(this.posX + ((double)(var26 % 2) - 0.5D) * 0.8D); - int var19 = MathHelper.floor_double(this.posZ + ((double)(var26 / 2) - 0.5D) * 0.8D); - -- for(int var20 = 0; var20 < 2; ++var20) { -+ for (int var20 = 0; var20 < 2; ++var20) { - int var21 = MathHelper.floor_double(this.posY) + var20; - int var22 = this.worldObj.getBlockId(var27, var21, var19); -- if(var22 == Block.snow.blockID) { -+ -+ if (var22 == Block.snow.blockID) { - this.worldObj.setBlockToAir(var27, var21, var19); -- } else if(var22 == Block.waterlily.blockID) { -+ } else if (var22 == Block.waterlily.blockID) { - this.worldObj.destroyBlock(var27, var21, var19, true); - } - } - } - -- if(this.riddenByEntity != null && this.riddenByEntity.isDead) { -+ if (this.riddenByEntity != null && this.riddenByEntity.isDead) { - this.riddenByEntity = null; - } -- - } - } - } - - public void updateRiderPosition() { -- if(this.riddenByEntity != null) { -+ if (this.riddenByEntity != null) { - double var1 = Math.cos((double)this.rotationYaw * Math.PI / 180.0D) * 0.4D; - double var3 = Math.sin((double)this.rotationYaw * Math.PI / 180.0D) * 0.4D; - this.riddenByEntity.setPosition(this.posX + var1, this.posY + this.getMountedYOffset() + this.riddenByEntity.getYOffset(), this.posZ + var3); - } - } - -- protected void writeEntityToNBT(NBTTagCompound var1) { -- } -+ /** -+ * (abstract) Protected helper method to write subclass entity data to NBT. -+ */ -+ protected void writeEntityToNBT(NBTTagCompound par1NBTTagCompound) {} - -- protected void readEntityFromNBT(NBTTagCompound var1) { -- } -+ /** -+ * (abstract) Protected helper method to read subclass entity data from NBT. -+ */ -+ protected void readEntityFromNBT(NBTTagCompound par1NBTTagCompound) {} - - public float getShadowSize() { - return 0.0F; - } - -- public boolean interactFirst(EntityPlayer var1) { -- if(this.riddenByEntity != null && this.riddenByEntity instanceof EntityPlayer && this.riddenByEntity != var1) { -+ /** -+ * First layer of player interaction -+ */ -+ public boolean interactFirst(EntityPlayer par1EntityPlayer) { -+ if (this.riddenByEntity != null && this.riddenByEntity instanceof EntityPlayer && this.riddenByEntity != par1EntityPlayer) { - return true; - } else { -- if(!this.worldObj.isRemote) { -- var1.mountEntity(this); -+ if (!this.worldObj.isRemote) { -+ par1EntityPlayer.mountEntity(this); - } - - return true; - } - } - -- public void setDamageTaken(float var1) { -- this.dataWatcher.updateObject(19, Float.valueOf(var1)); -+ /** -+ * Sets the damage taken from the last hit. -+ */ -+ public void setDamageTaken(float par1) { -+ this.dataWatcher.updateObject(19, Float.valueOf(par1)); - } - -+ /** -+ * Gets the damage taken from the last hit. -+ */ - public float getDamageTaken() { - return this.dataWatcher.getWatchableObjectFloat(19); - } - -- public void setTimeSinceHit(int var1) { -- this.dataWatcher.updateObject(17, Integer.valueOf(var1)); -+ /** -+ * Sets the time to count down from since the last time entity was hit. -+ */ -+ public void setTimeSinceHit(int par1) { -+ this.dataWatcher.updateObject(17, Integer.valueOf(par1)); - } - -+ /** -+ * Gets the time since the last hit. -+ */ - public int getTimeSinceHit() { - return this.dataWatcher.getWatchableObjectInt(17); - } - -- public void setForwardDirection(int var1) { -- this.dataWatcher.updateObject(18, Integer.valueOf(var1)); -+ /** -+ * Sets the forward direction of the entity. -+ */ -+ public void setForwardDirection(int par1) { -+ this.dataWatcher.updateObject(18, Integer.valueOf(par1)); - } - -+ /** -+ * Gets the forward direction of the entity. -+ */ - public int getForwardDirection() { - return this.dataWatcher.getWatchableObjectInt(18); - } - -- public void func_70270_d(boolean var1) { -- this.field_70279_a = var1; -+ public void func_70270_d(boolean par1) { -+ this.field_70279_a = par1; - } - } ---- net/minecraft/src/ThreadConnectToOnlineServer.java -+++ net/minecraft/src/ThreadConnectToOnlineServer.java -@@ -7,17 +7,16 @@ - - class ThreadConnectToOnlineServer extends Thread { - final McoServer field_96597_a; -+ - final GuiSlotOnlineServerList field_96596_b; - -- ThreadConnectToOnlineServer(GuiSlotOnlineServerList var1, McoServer var2) { -- this.field_96596_b = var1; -- this.field_96597_a = var2; -+ ThreadConnectToOnlineServer(GuiSlotOnlineServerList par1GuiSlotOnlineServerList, McoServer par2McoServer) { -+ this.field_96596_b = par1GuiSlotOnlineServerList; -+ this.field_96597_a = par2McoServer; - } - - public void run() { - boolean var27 = false; -- -- Object var41; - label194: { - label195: { - label196: { -@@ -25,23 +24,25 @@ - label198: { - try { - var27 = true; -- if(!this.field_96597_a.field_96411_l) { -+ -+ if (!this.field_96597_a.field_96411_l) { - this.field_96597_a.field_96411_l = true; - this.field_96597_a.field_96412_m = -2L; -- this.field_96597_a.m = ""; -+ this.field_96597_a.field_96414_k = ""; - GuiScreenOnlineServers.func_140016_k(); - long var1 = System.nanoTime(); - GuiScreenOnlineServers.func_140024_a(this.field_96596_b.field_96294_a, this.field_96597_a); - long var3 = System.nanoTime(); - this.field_96597_a.field_96412_m = (var3 - var1) / 1000000L; - var27 = false; -- } else if(this.field_96597_a.field_102022_m) { -+ } else if (this.field_96597_a.field_102022_m) { - this.field_96597_a.field_102022_m = false; - GuiScreenOnlineServers.func_140024_a(this.field_96596_b.field_96294_a, this.field_96597_a); - var27 = false; - } else { - var27 = false; - } -+ - break label194; - } catch (UnknownHostException var35) { - this.field_96597_a.field_96412_m = -1L; -@@ -63,53 +64,45 @@ - var27 = false; - break label195; - } finally { -- if(var27) { -- Object var12 = GuiScreenOnlineServers.func_140029_i(); -- synchronized(var12) { -+ if (var27) { -+ synchronized (GuiScreenOnlineServers.func_140029_i()) { - GuiScreenOnlineServers.func_140021_r(); - } - } - } - -- var41 = GuiScreenOnlineServers.func_140029_i(); -- synchronized(var41) { -+ synchronized (GuiScreenOnlineServers.func_140029_i()) { - GuiScreenOnlineServers.func_140021_r(); - return; - } - } - -- var41 = GuiScreenOnlineServers.func_140029_i(); -- synchronized(var41) { -+ synchronized (GuiScreenOnlineServers.func_140029_i()) { - GuiScreenOnlineServers.func_140021_r(); - return; - } - } - -- var41 = GuiScreenOnlineServers.func_140029_i(); -- synchronized(var41) { -+ synchronized (GuiScreenOnlineServers.func_140029_i()) { - GuiScreenOnlineServers.func_140021_r(); - return; - } - } - -- var41 = GuiScreenOnlineServers.func_140029_i(); -- synchronized(var41) { -+ synchronized (GuiScreenOnlineServers.func_140029_i()) { - GuiScreenOnlineServers.func_140021_r(); - return; - } - } - -- var41 = GuiScreenOnlineServers.func_140029_i(); -- synchronized(var41) { -+ synchronized (GuiScreenOnlineServers.func_140029_i()) { - GuiScreenOnlineServers.func_140021_r(); - return; - } - } - -- var41 = GuiScreenOnlineServers.func_140029_i(); -- synchronized(var41) { -+ synchronized (GuiScreenOnlineServers.func_140029_i()) { - GuiScreenOnlineServers.func_140021_r(); - } -- - } - } ---- net/minecraft/src/GenLayerHills.java -+++ net/minecraft/src/GenLayerHills.java -@@ -1,50 +1,57 @@ - package net.minecraft.src; - - public class GenLayerHills extends GenLayer { -- public GenLayerHills(long var1, GenLayer var3) { -- super(var1); -- this.parent = var3; -+ public GenLayerHills(long par1, GenLayer par3GenLayer) { -+ super(par1); -+ this.parent = par3GenLayer; - } - -- public int[] getInts(int var1, int var2, int var3, int var4) { -- int[] var5 = this.parent.getInts(var1 - 1, var2 - 1, var3 + 2, var4 + 2); -- int[] var6 = IntCache.getIntCache(var3 * var4); -- -- for(int var7 = 0; var7 < var4; ++var7) { -- for(int var8 = 0; var8 < var3; ++var8) { -- this.initChunkSeed((long)(var8 + var1), (long)(var7 + var2)); -- int var9 = var5[var8 + 1 + (var7 + 1) * (var3 + 2)]; -- if(this.nextInt(3) == 0) { -+ /** -+ * Returns a list of integer values generated by this layer. These may be interpreted as temperatures, rainfall -+ * amounts, or biomeList[] indices based on the particular GenLayer subclass. -+ */ -+ public int[] getInts(int par1, int par2, int par3, int par4) { -+ int[] var5 = this.parent.getInts(par1 - 1, par2 - 1, par3 + 2, par4 + 2); -+ int[] var6 = IntCache.getIntCache(par3 * par4); -+ -+ for (int var7 = 0; var7 < par4; ++var7) { -+ for (int var8 = 0; var8 < par3; ++var8) { -+ this.initChunkSeed((long)(var8 + par1), (long)(var7 + par2)); -+ int var9 = var5[var8 + 1 + (var7 + 1) * (par3 + 2)]; -+ -+ if (this.nextInt(3) == 0) { - int var10 = var9; -- if(var9 == BiomeGenBase.desert.biomeID) { -+ -+ if (var9 == BiomeGenBase.desert.biomeID) { - var10 = BiomeGenBase.desertHills.biomeID; -- } else if(var9 == BiomeGenBase.forest.biomeID) { -+ } else if (var9 == BiomeGenBase.forest.biomeID) { - var10 = BiomeGenBase.forestHills.biomeID; -- } else if(var9 == BiomeGenBase.taiga.biomeID) { -+ } else if (var9 == BiomeGenBase.taiga.biomeID) { - var10 = BiomeGenBase.taigaHills.biomeID; -- } else if(var9 == BiomeGenBase.plains.biomeID) { -+ } else if (var9 == BiomeGenBase.plains.biomeID) { - var10 = BiomeGenBase.forest.biomeID; -- } else if(var9 == BiomeGenBase.icePlains.biomeID) { -+ } else if (var9 == BiomeGenBase.icePlains.biomeID) { - var10 = BiomeGenBase.iceMountains.biomeID; -- } else if(var9 == BiomeGenBase.jungle.biomeID) { -+ } else if (var9 == BiomeGenBase.jungle.biomeID) { - var10 = BiomeGenBase.jungleHills.biomeID; - } - -- if(var10 == var9) { -- var6[var8 + var7 * var3] = var9; -+ if (var10 == var9) { -+ var6[var8 + var7 * par3] = var9; - } else { -- int var11 = var5[var8 + 1 + (var7 + 1 - 1) * (var3 + 2)]; -- int var12 = var5[var8 + 1 + 1 + (var7 + 1) * (var3 + 2)]; -- int var13 = var5[var8 + 1 - 1 + (var7 + 1) * (var3 + 2)]; -- int var14 = var5[var8 + 1 + (var7 + 1 + 1) * (var3 + 2)]; -- if(var11 == var9 && var12 == var9 && var13 == var9 && var14 == var9) { -- var6[var8 + var7 * var3] = var10; -+ int var11 = var5[var8 + 1 + (var7 + 1 - 1) * (par3 + 2)]; -+ int var12 = var5[var8 + 1 + 1 + (var7 + 1) * (par3 + 2)]; -+ int var13 = var5[var8 + 1 - 1 + (var7 + 1) * (par3 + 2)]; -+ int var14 = var5[var8 + 1 + (var7 + 1 + 1) * (par3 + 2)]; -+ -+ if (var11 == var9 && var12 == var9 && var13 == var9 && var14 == var9) { -+ var6[var8 + var7 * par3] = var10; - } else { -- var6[var8 + var7 * var3] = var9; -+ var6[var8 + var7 * par3] = var9; - } - } - } else { -- var6[var8 + var7 * var3] = var9; -+ var6[var8 + var7 * par3] = var9; - } - } - } ---- /dev/null -+++ org/spoutcraft/api/material/block/Wool.java -@@ -1,0 +1,32 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.api.material.block; -+ -+import org.spoutcraft.api.material.SolidBlock; -+ -+public class Wool extends GenericBlock implements SolidBlock { -+ public Wool(String name, int id, int data) { -+ super(name, id, data); -+ } -+ -+ public boolean isFallingBlock() { -+ return false; -+ } -+} ---- net/minecraft/src/RenderXPOrb.java -+++ net/minecraft/src/RenderXPOrb.java -@@ -3,19 +3,24 @@ - import org.lwjgl.opengl.GL11; - import org.lwjgl.opengl.GL12; - -+import com.prupe.mcpatcher.cc.ColorizeEntity; -+ - public class RenderXPOrb extends Render { - private static final ResourceLocation experienceOrbTextures = new ResourceLocation("textures/entity/experience_orb.png"); - - public RenderXPOrb() { - this.shadowSize = 0.15F; -- this.shadowOpaque = 12.0F / 16.0F; -+ this.shadowOpaque = 0.75F; - } - -- public void renderTheXPOrb(EntityXPOrb var1, double var2, double var4, double var6, float var8, float var9) { -+ /** -+ * Renders the XP Orb. -+ */ -+ public void renderTheXPOrb(EntityXPOrb par1EntityXPOrb, double par2, double par4, double par6, float par8, float par9) { - GL11.glPushMatrix(); -- GL11.glTranslatef((float)var2, (float)var4, (float)var6); -- this.bindEntityTexture(var1); -- int var10 = var1.getTextureByXP(); -+ GL11.glTranslatef((float)par2, (float)par4, (float)par6); -+ this.bindEntityTexture(par1EntityXPOrb); -+ int var10 = par1EntityXPOrb.getTextureByXP(); - float var11 = (float)(var10 % 4 * 16 + 0) / 64.0F; - float var12 = (float)(var10 % 4 * 16 + 16) / 64.0F; - float var13 = (float)(var10 / 4 * 16 + 0) / 64.0F; -@@ -23,16 +28,16 @@ - float var15 = 1.0F; - float var16 = 0.5F; - float var17 = 0.25F; -- int var18 = var1.getBrightnessForRender(var9); -+ int var18 = par1EntityXPOrb.getBrightnessForRender(par9); - int var19 = var18 % 65536; - int var20 = var18 / 65536; - OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, (float)var19 / 1.0F, (float)var20 / 1.0F); - GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); -- float var26 = 255.0F; -- float var27 = ((float)var1.xpColor + var9) / 2.0F; -- var20 = (int)((MathHelper.sin(var27 + 0.0F) + 1.0F) * 0.5F * var26); -- int var21 = (int)var26; -- int var22 = (int)((MathHelper.sin(var27 + (float)Math.PI * 4.0F / 3.0F) + 1.0F) * 0.1F * var26); -+ float var27 = 255.0F; -+ float var26 = ((float)par1EntityXPOrb.xpColor + par9) / 2.0F; -+ var20 = (int)((MathHelper.sin(var26 + 0.0F) + 1.0F) * 0.5F * var27); -+ int var21 = (int)var27; -+ int var22 = (int)((MathHelper.sin(var26 + 4.1887903F) + 1.0F) * 0.1F * var27); - int var23 = var20 << 16 | var21 << 8 | var22; - GL11.glRotatef(180.0F - this.renderManager.playerViewY, 0.0F, 1.0F, 0.0F); - GL11.glRotatef(-this.renderManager.playerViewX, 1.0F, 0.0F, 0.0F); -@@ -40,7 +45,7 @@ - GL11.glScalef(var24, var24, var24); - Tessellator var25 = Tessellator.instance; - var25.startDrawingQuads(); -- var25.setColorRGBA_I(var23, 128); -+ var25.setColorRGBA_I(ColorizeEntity.colorizeXPOrb(var23, var26), 128); - var25.setNormal(0.0F, 1.0F, 0.0F); - var25.addVertexWithUV((double)(0.0F - var16), (double)(0.0F - var17), 0.0D, (double)var11, (double)var14); - var25.addVertexWithUV((double)(var15 - var16), (double)(0.0F - var17), 0.0D, (double)var12, (double)var14); -@@ -52,15 +57,24 @@ - GL11.glPopMatrix(); - } - -- protected ResourceLocation getExperienceOrbTextures(EntityXPOrb var1) { -+ protected ResourceLocation getExperienceOrbTextures(EntityXPOrb par1EntityXPOrb) { - return experienceOrbTextures; - } - -- protected ResourceLocation getEntityTexture(Entity var1) { -- return this.getExperienceOrbTextures((EntityXPOrb)var1); -+ /** -+ * Returns the location of an entity's texture. Doesn't seem to be called unless you call Render.bindEntityTexture. -+ */ -+ protected ResourceLocation getEntityTexture(Entity par1Entity) { -+ return this.getExperienceOrbTextures((EntityXPOrb)par1Entity); - } - -- public void doRender(Entity var1, double var2, double var4, double var6, float var8, float var9) { -- this.renderTheXPOrb((EntityXPOrb)var1, var2, var4, var6, var8, var9); -+ /** -+ * Actually renders the given argument. This is a synthetic bridge method, always casting down its argument and then -+ * handing it off to a worker function which does the actual work. In all probabilty, the class Render is generic -+ * (Render -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.api.gui; -+ -+import java.io.IOException; -+ -+import org.spoutcraft.api.Spoutcraft; -+import org.spoutcraft.api.UnsafeClass; -+import org.spoutcraft.api.io.SpoutInputStream; -+import org.spoutcraft.api.io.SpoutOutputStream; -+ -+@UnsafeClass -+public abstract class GenericScrollable extends GenericControl implements Scrollable { -+ private ScrollBarPolicy sbpVert; -+ protected ScrollBarPolicy sbpHoriz = sbpVert = ScrollBarPolicy.SHOW_IF_NEEDED; -+ protected int innerSizeHoriz = 0, innerSizeVert = 0; -+ protected int scrollX = 0, scrollY = 0; -+ private Color background = new Color(0F, 0F, 0F, 0.6F); -+ -+ public GenericScrollable() { -+ } -+ -+ public void render() { -+ Spoutcraft.getRenderDelegate().render(this); -+ } -+ -+ public int getInnerSize(Orientation axis) { -+ switch(axis) { -+ case HORIZONTAL: -+ return innerSizeHoriz; -+ case VERTICAL: -+ return innerSizeVert; -+ } -+ return 0; -+ } -+ -+ public int getScrollPosition(Orientation axis) { -+ switch(axis) { -+ case HORIZONTAL: -+ return scrollX; -+ case VERTICAL: -+ return scrollY; -+ } -+ return 0; -+ } -+ -+ public void setScrollPosition(Orientation axis, int position) { -+ if (position < 0) { -+ position = 0; -+ } -+ if (position > getMaximumScrollPosition(axis)) { -+ position = getMaximumScrollPosition(axis); -+ } -+ switch(axis) { -+ case HORIZONTAL: -+ scrollX = position; -+ break; -+ case VERTICAL: -+ scrollY = position; -+ break; -+ } -+ } -+ -+ public void scroll(int x, int y) { -+ int currentX, currentY; -+ currentX = getScrollPosition(Orientation.HORIZONTAL); -+ currentX += x; -+ currentY = getScrollPosition(Orientation.VERTICAL); -+ currentY += y; -+ setScrollPosition(Orientation.HORIZONTAL, currentX); -+ setScrollPosition(Orientation.VERTICAL, currentY); -+ } -+ -+ public void ensureVisible(Rectangle rect) { -+ int scrollTop = getScrollPosition(Orientation.VERTICAL); -+ int scrollLeft = getScrollPosition(Orientation.HORIZONTAL); -+ int scrollBottom = scrollTop + getViewportSize(Orientation.VERTICAL) - 10; -+ int scrollRight = scrollLeft + getViewportSize(Orientation.HORIZONTAL) - 10; -+ boolean correctHorizontal = false; -+ boolean correctVertical = false; -+ if (scrollTop <= rect.getTop() && rect.getBottom() <=scrollBottom) { -+ // Fits vertical -+ if (scrollLeft <= rect.getLeft() && rect.getRight() <= scrollRight) { -+ // Fits completely -+ // Nothing to do. -+ return; -+ } else { -+ // Doesn't fit horizontal -+ correctHorizontal = true; -+ } -+ } else { -+ // Doesn't fit vertical -+ correctVertical = true; -+ if (scrollLeft <= rect.getLeft() && rect.getRight() <= scrollRight) { -+ // But does fit horizontal -+ } else { -+ // Doesn't fit horizontal too -+ correctHorizontal = true; -+ } -+ } -+ if (correctHorizontal) { -+ if (scrollRight < rect.getRight()) { -+ setScrollPosition(Orientation.HORIZONTAL, rect.getRight() - getViewportSize(Orientation.HORIZONTAL) + 10); -+ } -+ if (scrollLeft > rect.getLeft()) { -+ setScrollPosition(Orientation.HORIZONTAL, rect.getLeft()); -+ } -+ } -+ if (correctVertical) { -+ if (scrollBottom < rect.getBottom()) { -+ setScrollPosition(Orientation.VERTICAL, rect.getBottom() - getViewportSize(Orientation.VERTICAL) + 10); -+ } -+ if (scrollTop > rect.getTop()) { -+ setScrollPosition(Orientation.VERTICAL, rect.getTop()); -+ } -+ } -+ } -+ -+ public int getMaximumScrollPosition(Orientation axis) { -+ return (int) Math.max(0, getInnerSize(axis) - (axis==Orientation.HORIZONTAL?getWidth():getHeight())); -+ } -+ -+ public boolean needsScrollBar(Orientation axis) { -+ ScrollBarPolicy policy = getScrollBarPolicy(axis); -+ switch(policy) { -+ case SHOW_IF_NEEDED: -+ return getMaximumScrollPosition(axis) > 0; -+ case SHOW_ALWAYS: -+ return true; -+ case SHOW_NEVER: -+ return false; -+ default: -+ return true; -+ } -+ } -+ -+ public void setScrollBarPolicy(Orientation axis, ScrollBarPolicy policy) { -+ switch(axis) { -+ case HORIZONTAL: -+ sbpHoriz = policy; -+ break; -+ case VERTICAL: -+ sbpVert = policy; -+ break; -+ } -+ } -+ -+ public ScrollBarPolicy getScrollBarPolicy(Orientation axis) { -+ switch(axis) { -+ case HORIZONTAL: -+ return sbpHoriz; -+ case VERTICAL: -+ return sbpVert; -+ } -+ return null; -+ } -+ -+ protected void setInnerSize(Orientation axis, int size) { -+ switch(axis) { -+ case HORIZONTAL: -+ innerSizeHoriz = size; -+ break; -+ case VERTICAL: -+ innerSizeVert = size; -+ break; -+ } -+ } -+ -+ public int getViewportSize(Orientation axis) { -+ int size = 0; -+ size = (int) (axis == Orientation.HORIZONTAL?getWidth():getHeight()); -+ if (needsScrollBar(axis.getOther())) { -+ return size - 16; -+ } -+ return size; -+ } -+ -+ public int getMargin(PositionOrientation pos) { -+ switch(pos) { -+ case TOP: -+ return 5; -+ default: -+ return 0; -+ } -+ } -+ -+ @Override -+ public void readData(SpoutInputStream input) throws IOException { -+ super.readData(input); -+ sbpHoriz = ScrollBarPolicy.getById(input.readInt()); -+ sbpVert = ScrollBarPolicy.getById(input.readInt()); -+ scrollX = input.readInt(); -+ scrollY = input.readInt(); -+ innerSizeHoriz = input.readInt(); -+ innerSizeVert = input.readInt(); -+ setBackgroundColor(input.readColor()); -+ } -+ -+ @Override -+ public void writeData(SpoutOutputStream output) throws IOException { -+ super.writeData(output); -+ output.writeInt(sbpHoriz.getId()); -+ output.writeInt(sbpVert.getId()); -+ output.writeInt(scrollX); -+ output.writeInt(scrollY); -+ output.writeInt(innerSizeHoriz); -+ output.writeInt(innerSizeVert); -+ output.writeColor(getBackgroundColor()); -+ } -+ -+ @Override -+ public int getVersion() { -+ return super.getVersion() + 1; -+ } -+ -+ public Color getBackgroundColor() { -+ return background; -+ } -+ -+ public Scrollable setBackgroundColor(Color color) { -+ background = color; -+ return this; -+ } -+} ---- net/minecraft/src/CallableLevelGenerator.java -+++ net/minecraft/src/CallableLevelGenerator.java -@@ -5,12 +5,12 @@ - class CallableLevelGenerator implements Callable { - final WorldInfo worldInfoInstance; - -- CallableLevelGenerator(WorldInfo var1) { -- this.worldInfoInstance = var1; -+ CallableLevelGenerator(WorldInfo par1WorldInfo) { -+ this.worldInfoInstance = par1WorldInfo; - } - - public String callLevelGeneratorInfo() { -- return String.format("ID %02d - %s, ver %d. Features enabled: %b", new Object[]{Integer.valueOf(WorldInfo.getTerrainTypeOfWorld(this.worldInfoInstance).getWorldTypeID()), WorldInfo.getTerrainTypeOfWorld(this.worldInfoInstance).getWorldTypeName(), Integer.valueOf(WorldInfo.getTerrainTypeOfWorld(this.worldInfoInstance).getGeneratorVersion()), Boolean.valueOf(WorldInfo.getMapFeaturesEnabled(this.worldInfoInstance))}); -+ return String.format("ID %02d - %s, ver %d. Features enabled: %b", new Object[] {Integer.valueOf(WorldInfo.getTerrainTypeOfWorld(this.worldInfoInstance).getWorldTypeID()), WorldInfo.getTerrainTypeOfWorld(this.worldInfoInstance).getWorldTypeName(), Integer.valueOf(WorldInfo.getTerrainTypeOfWorld(this.worldInfoInstance).getGeneratorVersion()), Boolean.valueOf(WorldInfo.getMapFeaturesEnabled(this.worldInfoInstance))}); - } - - public Object call() { ---- /dev/null -+++ org/spoutcraft/client/gui/MinecraftTessellatorWrapper.java -@@ -1,0 +1,91 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.client.gui; -+ -+import net.minecraft.src.Minecraft; -+import net.minecraft.src.Tessellator; -+ -+import org.spoutcraft.api.gui.MinecraftTessellator; -+ -+public class MinecraftTessellatorWrapper implements MinecraftTessellator { -+ public void draw() { -+ Tessellator.instance.draw(); -+ } -+ -+ public void startDrawingQuads() { -+ Tessellator.instance.startDrawingQuads(); -+ } -+ -+ public void startDrawing(int drawMode) { -+ Tessellator.instance.startDrawing(drawMode); -+ } -+ -+ public void setBrightness(int brightness) { -+ Tessellator.instance.setBrightness(brightness); -+ } -+ -+ public void setTextureUV(double s, double t) { -+ Tessellator.instance.setTextureUV(s, t); -+ } -+ -+ public void setColorOpaqueFloat(float red, float green, float blue) { -+ Tessellator.instance.setColorOpaque_F(red, green, blue); -+ } -+ -+ public void setColorRGBAFloat(float red, float green, float blue, float alpha) { -+ Tessellator.instance.setColorRGBA_F(red, green, blue, alpha); -+ } -+ -+ public void setColorOpaque(int red, int green, int blue) { -+ Tessellator.instance.setColorOpaque(red, green, blue); -+ } -+ -+ public void setColorRGBA(int red, int green, int blue, int alpha) { -+ Tessellator.instance.setColorRGBA(red, green, blue, alpha); -+ } -+ -+ public void addVertexWithUV(double x, double y, double z, double s, double t) { -+ Tessellator.instance.addVertexWithUV(x, y, z, s, t); -+ } -+ -+ public void addVertex(double x, double y, double z) { -+ Tessellator.instance.addVertex(x, y, z); -+ } -+ -+ public void setColorOpaqueInt(int color) { -+ Tessellator.instance.setColorOpaque_I(color); -+ } -+ -+ public void setColorRGBAInt(int color, int alpha) { -+ Tessellator.instance.setColorRGBA_I(color, alpha); -+ } -+ -+ public void disableColor() { -+ Tessellator.instance.disableColor(); -+ } -+ -+ public void setNormal(float x, float y, float z) { -+ Tessellator.instance.setNormal(x, y, z); -+ } -+ -+ public void setTranslation(double x, double y, double z) { -+ Tessellator.instance.setTranslation(x, y, z); -+ } -+} ---- net/minecraft/src/EntityList.java -+++ net/minecraft/src/EntityList.java -@@ -4,34 +4,61 @@ - import java.util.LinkedHashMap; - import java.util.Map; - -+import com.prupe.mcpatcher.cc.ColorizeItem; -+ - public class EntityList { -- private static Map b = new HashMap(); -- private static Map c = new HashMap(); -- private static Map d = new HashMap(); -- private static Map e = new HashMap(); -- private static Map f = new HashMap(); -- public static HashMap a = new LinkedHashMap(); -- -- private static void addMapping(Class var0, String var1, int var2) { -- b.put(var1, var0); -- c.put(var0, var1); -- d.put(Integer.valueOf(var2), var0); -- e.put(var0, Integer.valueOf(var2)); -- f.put(var1, Integer.valueOf(var2)); -- } -- -- private static void addMapping(Class var0, String var1, int var2, int var3, int var4) { -- addMapping(var0, var1, var2); -- a.put(Integer.valueOf(var2), new EntityEggInfo(var2, var3, var4)); -- } -- -- public static Entity createEntityByName(String var0, World var1) { -+ -+ /** Provides a mapping between entity classes and a string */ -+ private static Map stringToClassMapping = new HashMap(); -+ -+ /** Provides a mapping between a string and an entity classes */ -+ private static Map classToStringMapping = new HashMap(); -+ -+ /** provides a mapping between an entityID and an Entity Class */ -+ private static Map IDtoClassMapping = new HashMap(); -+ -+ /** provides a mapping between an Entity Class and an entity ID */ -+ private static Map classToIDMapping = new HashMap(); -+ -+ /** Maps entity names to their numeric identifiers */ -+ private static Map stringToIDMapping = new HashMap(); -+ -+ /** This is a HashMap of the Creative Entity Eggs/Spawners. */ -+ public static HashMap entityEggs = new LinkedHashMap(); -+ -+ /** -+ * adds a mapping between Entity classes and both a string representation and an ID -+ */ -+ private static void addMapping(Class par0Class, String par1Str, int par2) { -+ stringToClassMapping.put(par1Str, par0Class); -+ classToStringMapping.put(par0Class, par1Str); -+ IDtoClassMapping.put(Integer.valueOf(par2), par0Class); -+ classToIDMapping.put(par0Class, Integer.valueOf(par2)); -+ stringToIDMapping.put(par1Str, Integer.valueOf(par2)); -+ } -+ -+ /** -+ * Adds a entity mapping with egg info. -+ */ -+ private static void addMapping(Class par0Class, String par1Str, int par2, int par3, int par4) { -+ // MCPatcher Start -+ ColorizeItem.setupSpawnerEgg(par1Str, par2, par3, par4); -+ // MCPatcher End -+ addMapping(par0Class, par1Str, par2); -+ entityEggs.put(Integer.valueOf(par2), new EntityEggInfo(par2, par3, par4)); -+ } -+ -+ /** -+ * Create a new instance of an entity in the world by using the entity name. -+ */ -+ public static Entity createEntityByName(String par0Str, World par1World) { - Entity var2 = null; - - try { -- Class var3 = (Class)b.get(var0); -- if(var3 != null) { -- var2 = (Entity)var3.getConstructor(new Class[]{World.class}).newInstance(new Object[]{var1}); -+ Class var3 = (Class)stringToClassMapping.get(par0Str); -+ -+ if (var3 != null) { -+ var2 = (Entity)var3.getConstructor(new Class[] {World.class}).newInstance(new Object[] {par1World}); - } - } catch (Exception var4) { - var4.printStackTrace(); -@@ -40,76 +67,99 @@ - return var2; - } - -- public static Entity createEntityFromNBT(NBTTagCompound var0, World var1) { -+ /** -+ * create a new instance of an entity from NBT store -+ */ -+ public static Entity createEntityFromNBT(NBTTagCompound par0NBTTagCompound, World par1World) { - Entity var2 = null; -- if("Minecart".equals(var0.getString("id"))) { -- switch(var0.getInteger("Type")) { -- case 0: -- var0.setString("id", "MinecartRideable"); -- break; -- case 1: -- var0.setString("id", "MinecartChest"); -- break; -- case 2: -- var0.setString("id", "MinecartFurnace"); -+ -+ if ("Minecart".equals(par0NBTTagCompound.getString("id"))) { -+ switch (par0NBTTagCompound.getInteger("Type")) { -+ case 0: -+ par0NBTTagCompound.setString("id", "MinecartRideable"); -+ break; -+ -+ case 1: -+ par0NBTTagCompound.setString("id", "MinecartChest"); -+ break; -+ -+ case 2: -+ par0NBTTagCompound.setString("id", "MinecartFurnace"); - } - -- var0.removeTag("Type"); -+ par0NBTTagCompound.removeTag("Type"); - } - - try { -- Class var3 = (Class)b.get(var0.getString("id")); -- if(var3 != null) { -- var2 = (Entity)var3.getConstructor(new Class[]{World.class}).newInstance(new Object[]{var1}); -+ Class var3 = (Class)stringToClassMapping.get(par0NBTTagCompound.getString("id")); -+ -+ if (var3 != null) { -+ var2 = (Entity)var3.getConstructor(new Class[] {World.class}).newInstance(new Object[] {par1World}); - } - } catch (Exception var4) { - var4.printStackTrace(); - } - -- if(var2 != null) { -- var2.readFromNBT(var0); -+ if (var2 != null) { -+ var2.readFromNBT(par0NBTTagCompound); - } else { -- var1.getWorldLogAgent().logWarning("Skipping Entity with id " + var0.getString("id")); -+ par1World.getWorldLogAgent().logWarning("Skipping Entity with id " + par0NBTTagCompound.getString("id")); - } - - return var2; - } - -- public static Entity createEntityByID(int var0, World var1) { -+ /** -+ * Create a new instance of an entity in the world by using an entity ID. -+ */ -+ public static Entity createEntityByID(int par0, World par1World) { - Entity var2 = null; - - try { -- Class var3 = getClassFromID(var0); -- if(var3 != null) { -- var2 = (Entity)var3.getConstructor(new Class[]{World.class}).newInstance(new Object[]{var1}); -+ Class var3 = getClassFromID(par0); -+ -+ if (var3 != null) { -+ var2 = (Entity)var3.getConstructor(new Class[] {World.class}).newInstance(new Object[] {par1World}); - } - } catch (Exception var4) { - var4.printStackTrace(); - } - -- if(var2 == null) { -- var1.getWorldLogAgent().logWarning("Skipping Entity with id " + var0); -+ if (var2 == null) { -+ par1World.getWorldLogAgent().logWarning("Skipping Entity with id " + par0); - } - - return var2; - } - -- public static int getEntityID(Entity var0) { -- Class var1 = var0.getClass(); -- return e.containsKey(var1) ? ((Integer)e.get(var1)).intValue() : 0; -- } -- -- public static Class getClassFromID(int var0) { -- return (Class)d.get(Integer.valueOf(var0)); -- } -- -- public static String getEntityString(Entity var0) { -- return (String)c.get(var0.getClass()); -- } -- -- public static String getStringFromID(int var0) { -- Class var1 = getClassFromID(var0); -- return var1 != null ? (String)c.get(var1) : null; -+ /** -+ * gets the entityID of a specific entity -+ */ -+ public static int getEntityID(Entity par0Entity) { -+ Class var1 = par0Entity.getClass(); -+ return classToIDMapping.containsKey(var1) ? ((Integer)classToIDMapping.get(var1)).intValue() : 0; -+ } -+ -+ /** -+ * Return the class assigned to this entity ID. -+ */ -+ public static Class getClassFromID(int par0) { -+ return (Class)IDtoClassMapping.get(Integer.valueOf(par0)); -+ } -+ -+ /** -+ * Gets the string representation of a specific entity. -+ */ -+ public static String getEntityString(Entity par0Entity) { -+ return (String)classToStringMapping.get(par0Entity.getClass()); -+ } -+ -+ /** -+ * Finds the class using IDtoClassMapping and classToStringMapping -+ */ -+ public static String getStringFromID(int par0) { -+ Class var1 = getClassFromID(par0); -+ return var1 != null ? (String)classToStringMapping.get(var1) : null; - } - - static { -@@ -143,7 +193,7 @@ - addMapping(EntitySkeleton.class, "Skeleton", 51, 12698049, 4802889); - addMapping(EntitySpider.class, "Spider", 52, 3419431, 11013646); - addMapping(EntityGiantZombie.class, "Giant", 53); -- addMapping(EntityZombie.class, "Zombie", 54, '\uafaf', 7969893); -+ addMapping(EntityZombie.class, "Zombie", 54, 44975, 7969893); - addMapping(EntitySlime.class, "Slime", 55, 5349438, 8306542); - addMapping(EntityGhast.class, "Ghast", 56, 16382457, 12369084); - addMapping(EntityPigZombie.class, "PigZombie", 57, 15373203, 5009705); ---- net/minecraft/src/EntityMinecartHopper.java -+++ net/minecraft/src/EntityMinecartHopper.java -@@ -3,15 +3,17 @@ - import java.util.List; - - public class EntityMinecartHopper extends EntityMinecartContainer implements Hopper { -+ -+ /** Whether this hopper minecart is being blocked by an activator rail. */ - private boolean isBlocked = true; - private int transferTicker = -1; - -- public EntityMinecartHopper(World var1) { -- super(var1); -+ public EntityMinecartHopper(World par1World) { -+ super(par1World); - } - -- public EntityMinecartHopper(World var1, double var2, double var4, double var6) { -- super(var1, var2, var4, var6); -+ public EntityMinecartHopper(World par1World, double par2, double par4, double par6) { -+ super(par1World, par2, par4, par6); - } - - public int getMinecartType() { -@@ -26,71 +28,104 @@ - return 1; - } - -+ /** -+ * Returns the number of slots in the inventory. -+ */ - public int getSizeInventory() { - return 5; - } - -- public boolean interactFirst(EntityPlayer var1) { -- if(!this.worldObj.isRemote) { -- var1.displayGUIHopperMinecart(this); -+ /** -+ * First layer of player interaction -+ */ -+ public boolean interactFirst(EntityPlayer par1EntityPlayer) { -+ if (!this.worldObj.isRemote) { -+ par1EntityPlayer.displayGUIHopperMinecart(this); - } - - return true; - } - -- public void onActivatorRailPass(int var1, int var2, int var3, boolean var4) { -- boolean var5 = !var4; -- if(var5 != this.getBlocked()) { -+ /** -+ * Called every tick the minecart is on an activator rail. -+ */ -+ public void onActivatorRailPass(int par1, int par2, int par3, boolean par4) { -+ boolean var5 = !par4; -+ -+ if (var5 != this.getBlocked()) { - this.setBlocked(var5); - } -- - } - -+ /** -+ * Get whether this hopper minecart is being blocked by an activator rail. -+ */ - public boolean getBlocked() { - return this.isBlocked; - } - -- public void setBlocked(boolean var1) { -- this.isBlocked = var1; -+ /** -+ * Set whether this hopper minecart is being blocked by an activator rail. -+ */ -+ public void setBlocked(boolean par1) { -+ this.isBlocked = par1; - } - -+ /** -+ * Returns the worldObj for this tileEntity. -+ */ - public World getWorldObj() { - return this.worldObj; - } - -+ /** -+ * Gets the world X position for this hopper entity. -+ */ - public double getXPos() { - return this.posX; - } - -+ /** -+ * Gets the world Y position for this hopper entity. -+ */ - public double getYPos() { - return this.posY; - } - -+ /** -+ * Gets the world Z position for this hopper entity. -+ */ - public double getZPos() { - return this.posZ; - } - -+ /** -+ * Called to update the entity's position/logic. -+ */ - public void onUpdate() { - super.onUpdate(); -- if(!this.worldObj.isRemote && this.isEntityAlive() && this.getBlocked()) { -+ -+ if (!this.worldObj.isRemote && this.isEntityAlive() && this.getBlocked()) { - --this.transferTicker; -- if(!this.canTransfer()) { -+ -+ if (!this.canTransfer()) { - this.setTransferTicker(0); -- if(this.func_96112_aD()) { -+ -+ if (this.func_96112_aD()) { - this.setTransferTicker(4); - this.onInventoryChanged(); - } - } - } -- - } - - public boolean func_96112_aD() { -- if(TileEntityHopper.suckItemsIntoHopper(this)) { -+ if (TileEntityHopper.suckItemsIntoHopper(this)) { - return true; - } else { - List var1 = this.worldObj.selectEntitiesWithinAABB(EntityItem.class, this.boundingBox.expand(0.25D, 0.0D, 0.25D), IEntitySelector.selectAnything); -- if(var1.size() > 0) { -+ -+ if (var1.size() > 0) { - TileEntityHopper.insertStackFromEntity(this, (EntityItem)var1.get(0)); - } - -@@ -98,25 +133,37 @@ - } - } - -- public void killMinecart(DamageSource var1) { -- super.killMinecart(var1); -+ public void killMinecart(DamageSource par1DamageSource) { -+ super.killMinecart(par1DamageSource); - this.dropItemWithOffset(Block.hopperBlock.blockID, 1, 0.0F); - } - -- protected void writeEntityToNBT(NBTTagCompound var1) { -- super.writeEntityToNBT(var1); -- var1.setInteger("TransferCooldown", this.transferTicker); -- } -- -- protected void readEntityFromNBT(NBTTagCompound var1) { -- super.readEntityFromNBT(var1); -- this.transferTicker = var1.getInteger("TransferCooldown"); -- } -- -- public void setTransferTicker(int var1) { -- this.transferTicker = var1; -- } -- -+ /** -+ * (abstract) Protected helper method to write subclass entity data to NBT. -+ */ -+ protected void writeEntityToNBT(NBTTagCompound par1NBTTagCompound) { -+ super.writeEntityToNBT(par1NBTTagCompound); -+ par1NBTTagCompound.setInteger("TransferCooldown", this.transferTicker); -+ } -+ -+ /** -+ * (abstract) Protected helper method to read subclass entity data from NBT. -+ */ -+ protected void readEntityFromNBT(NBTTagCompound par1NBTTagCompound) { -+ super.readEntityFromNBT(par1NBTTagCompound); -+ this.transferTicker = par1NBTTagCompound.getInteger("TransferCooldown"); -+ } -+ -+ /** -+ * Sets the transfer ticker, used to determine the delay between transfers. -+ */ -+ public void setTransferTicker(int par1) { -+ this.transferTicker = par1; -+ } -+ -+ /** -+ * Returns whether the hopper cart can currently transfer an item. -+ */ - public boolean canTransfer() { - return this.transferTicker > 0; - } ---- net/minecraft/src/IProgressUpdate.java -+++ net/minecraft/src/IProgressUpdate.java -@@ -1,9 +1,19 @@ - package net.minecraft.src; - - public interface IProgressUpdate { -- void displaySavingString(String var1); -- -- void displayLoadingString(String var1); -- -+ -+ /** -+ * "Saving level", or the loading,or downloading equivelent -+ */ -+ void displayProgressMessage(String var1); -+ -+ /** -+ * This is called with "Working..." by resetProgressAndMessage -+ */ -+ void resetProgresAndWorkingMessage(String var1); -+ -+ /** -+ * Updates the progress bar on the loading screen to the specified amount. Args: loadProgress -+ */ - void setLoadingProgress(int var1); - } ---- net/minecraft/src/RecipeSorter.java -+++ net/minecraft/src/RecipeSorter.java -@@ -5,15 +5,15 @@ - class RecipeSorter implements Comparator { - final CraftingManager craftingManager; - -- RecipeSorter(CraftingManager var1) { -- this.craftingManager = var1; -- } -- -- public int compareRecipes(IRecipe var1, IRecipe var2) { -- return var1 instanceof ShapelessRecipes && var2 instanceof ShapedRecipes ? 1 : (var2 instanceof ShapelessRecipes && var1 instanceof ShapedRecipes ? -1 : (var2.getRecipeSize() < var1.getRecipeSize() ? -1 : (var2.getRecipeSize() > var1.getRecipeSize() ? 1 : 0))); -- } -- -- public int compare(Object var1, Object var2) { -- return this.compareRecipes((IRecipe)var1, (IRecipe)var2); -+ RecipeSorter(CraftingManager par1CraftingManager) { -+ this.craftingManager = par1CraftingManager; -+ } -+ -+ public int compareRecipes(IRecipe par1IRecipe, IRecipe par2IRecipe) { -+ return par1IRecipe instanceof ShapelessRecipes && par2IRecipe instanceof ShapedRecipes ? 1 : (par2IRecipe instanceof ShapelessRecipes && par1IRecipe instanceof ShapedRecipes ? -1 : (par2IRecipe.getRecipeSize() < par1IRecipe.getRecipeSize() ? -1 : (par2IRecipe.getRecipeSize() > par1IRecipe.getRecipeSize() ? 1 : 0))); -+ } -+ -+ public int compare(Object par1Obj, Object par2Obj) { -+ return this.compareRecipes((IRecipe)par1Obj, (IRecipe)par2Obj); - } - } ---- /dev/null -+++ org/spoutcraft/api/gui/GenericScrollArea.java -@@ -1,0 +1,248 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.api.gui; -+ -+import java.io.IOException; -+import java.util.Collections; -+import java.util.HashSet; -+import java.util.Map; -+import java.util.Set; -+import java.util.UUID; -+import java.util.concurrent.ConcurrentHashMap; -+ -+import org.spoutcraft.api.Spoutcraft; -+import org.spoutcraft.api.UnsafeClass; -+import org.spoutcraft.api.io.SpoutInputStream; -+import org.spoutcraft.api.io.SpoutOutputStream; -+ -+@UnsafeClass -+public class GenericScrollArea extends GenericScrollable implements ScrollArea { -+ protected Map widgets = new ConcurrentHashMap(); -+ protected int playerId; -+ protected boolean bgvis; -+ protected int mouseX = -1, mouseY = -1; -+ @SuppressWarnings("unused") -+ private int screenHeight, screenWidth; -+ -+ public GenericScrollArea(int playerId) { -+ this.playerId = playerId; -+ } -+ -+ public GenericScrollArea() { -+ super(); -+ screenWidth = Spoutcraft.getClient().getRenderDelegate().getScreenWidth(); -+ screenHeight = Spoutcraft.getClient().getRenderDelegate().getScreenHeight(); -+ } -+ -+ public void renderContents() { -+ Spoutcraft.getRenderDelegate().renderContents(this); -+ } -+ -+ public WidgetType getType() { -+ return WidgetType.ScrollArea; -+ } -+ -+ @Override -+ public int getVersion() { -+ return super.getVersion() + 0; -+ } -+ -+ public Widget[] getAttachedWidgets() { -+ Widget[] list = new Widget[widgets.size()]; -+ list = widgets.keySet().toArray(list); -+ return list; -+ } -+ -+ @Deprecated -+ public Screen attachWidget(Widget widget) { -+ return attachWidget(null, widget); -+ } -+ -+ public Screen attachWidget(String addon, Widget widget) { -+ widgets.put(widget, addon); -+ widget.setAddon(addon); -+ widget.setAnchor(WidgetAnchor.TOP_LEFT); -+ widget.setScreen(this); -+ updateInnerSize(); -+ return this; -+ } -+ -+ public Screen attachWidgets(String addon, Widget ...widgets) { -+ for (Widget widget:widgets) { -+ this.widgets.put(widget, addon); -+ widget.setAddon(addon); -+ widget.setAnchor(WidgetAnchor.TOP_LEFT); -+ widget.setScreen(this); -+ } -+ updateInnerSize(); -+ return this; -+ } -+ -+ public void updateInnerSize() { -+ int height = 0; -+ int width = 0; -+ for (Widget w:widgets.keySet()) { -+ height = (int) Math.max(height, w.getY() + w.getHeight()); -+ width = (int) Math.max(width, w.getX() + w.getWidth()); -+ } -+ setInnerSize(Orientation.HORIZONTAL, width); -+ setInnerSize(Orientation.VERTICAL, height + 5); -+ } -+ -+ public Screen removeWidget(Widget widget) { -+ widgets.remove(widget); -+ widget.setScreen(null); -+ updateInnerSize(); -+ return this; -+ } -+ -+ public Screen removeWidgets(String addon) { -+ for (Widget i : getAttachedWidgets()) { -+ if (widgets.get(i) != null && widgets.get(i).equals(addon)) { -+ removeWidget(i); -+ } -+ } -+ updateInnerSize(); -+ return this; -+ } -+ -+ public boolean containsWidget(Widget widget) { -+ return containsWidget(widget.getId()); -+ } -+ -+ public boolean containsWidget(UUID id) { -+ return getWidget(id) != null; -+ } -+ -+ public Widget getWidget(UUID id) { -+ for (Widget w : widgets.keySet()) { -+ if (w.getId().equals(id)) { -+ return w; -+ } -+ } -+ return null; -+ } -+ -+ public boolean updateWidget(Widget widget) { -+ if (widgets.containsKey(widget)) { -+ String addon = widgets.get(widget); -+ widgets.remove(widget); -+ widgets.put(widget, addon); -+ widget.setScreen(this); -+ return true; -+ } -+ return false; -+ } -+ -+ @Override -+ public void onTick() { -+ for (Widget widget : widgets.keySet()) { -+ widget.onTick(); -+ } -+ screenWidth = Spoutcraft.getClient().getRenderDelegate().getScreenWidth(); -+ screenHeight = Spoutcraft.getClient().getRenderDelegate().getScreenHeight(); -+ } -+ -+ public Screen setBgVisible(boolean enable) { -+ bgvis = enable; -+ return this; -+ } -+ -+ public boolean isBgVisible() { -+ return bgvis; -+ } -+ -+ @Override -+ public void readData(SpoutInputStream input) throws IOException { -+ super.readData(input); -+ setBgVisible(input.readBoolean()); -+ } -+ -+ @Override -+ public void writeData(SpoutOutputStream output) throws IOException { -+ super.writeData(output); -+ output.writeBoolean(isBgVisible()); -+ } -+ -+ protected boolean canRender(Widget widget) { -+ return widget.isVisible(); -+ } -+ -+ RenderPriority[] rvalues = RenderPriority.values(); -+ -+ public Screen setMouseX(int mouseX) { -+ this.mouseX = mouseX; -+ return this; -+ } -+ -+ public Screen setMouseY(int mouseY) { -+ this.mouseY = mouseY; -+ return this; -+ } -+ -+ public int getMouseX() { -+ return getScreen().getMouseX(); -+ } -+ -+ public int getMouseY() { -+ return getScreen().getMouseY(); -+ } -+ -+ @Override -+ public Control copy() { -+ throw new UnsupportedOperationException("You can not create a copy of a screen"); -+ } -+ -+ public ScreenType getScreenType() { -+ return getScreen().getScreenType(); -+ } -+ -+ public Set getAttachedWidgetsAsSet() { -+ return Collections.unmodifiableSet(widgets.keySet()); -+ } -+ -+ public Widget[] getAttachedWidgets(boolean recursive) { -+ Widget[] list = new Widget[widgets.size()]; -+ Set allwidgets = new HashSet(); -+ allwidgets.addAll(widgets.keySet()); -+ if (recursive) { -+ for (Widget w:widgets.keySet()) { -+ if (w instanceof Screen) { -+ allwidgets.addAll(((Screen)w).getAttachedWidgetsAsSet(true)); -+ } -+ } -+ } -+ allwidgets.toArray(list); -+ return list; -+ } -+ -+ public Set getAttachedWidgetsAsSet(boolean recursive) { -+ Set allwidgets = new HashSet(); -+ allwidgets.addAll(widgets.keySet()); -+ if (recursive) { -+ for (Widget w:widgets.keySet()) { -+ if (w instanceof Screen) { -+ allwidgets.addAll(((Screen)w).getAttachedWidgetsAsSet(true)); -+ } -+ } -+ } -+ return allwidgets; -+ } -+} ---- net/minecraft/src/BlockFence.java -+++ net/minecraft/src/BlockFence.java -@@ -3,109 +3,133 @@ - import java.util.List; - - public class BlockFence extends Block { -- private final String a; -+ private final String field_94464_a; - -- public BlockFence(int var1, String var2, Material var3) { -- super(var1, var3); -- this.a = var2; -+ public BlockFence(int par1, String par2Str, Material par3Material) { -+ super(par1, par3Material); -+ this.field_94464_a = par2Str; - this.setCreativeTab(CreativeTabs.tabDecorations); - } - -- public void addCollisionBoxesToList(World var1, int var2, int var3, int var4, AxisAlignedBB var5, List var6, Entity var7) { -- boolean var8 = this.canConnectFenceTo(var1, var2, var3, var4 - 1); -- boolean var9 = this.canConnectFenceTo(var1, var2, var3, var4 + 1); -- boolean var10 = this.canConnectFenceTo(var1, var2 - 1, var3, var4); -- boolean var11 = this.canConnectFenceTo(var1, var2 + 1, var3, var4); -- float var12 = 6.0F / 16.0F; -- float var13 = 10.0F / 16.0F; -- float var14 = 6.0F / 16.0F; -- float var15 = 10.0F / 16.0F; -- if(var8) { -+ /** -+ * Adds all intersecting collision boxes to a list. (Be sure to only add boxes to the list if they intersect the mask.) -+ * Parameters: World, X, Y, Z, mask, list, colliding entity -+ */ -+ public void addCollisionBoxesToList(World par1World, int par2, int par3, int par4, AxisAlignedBB par5AxisAlignedBB, List par6List, Entity par7Entity) { -+ boolean var8 = this.canConnectFenceTo(par1World, par2, par3, par4 - 1); -+ boolean var9 = this.canConnectFenceTo(par1World, par2, par3, par4 + 1); -+ boolean var10 = this.canConnectFenceTo(par1World, par2 - 1, par3, par4); -+ boolean var11 = this.canConnectFenceTo(par1World, par2 + 1, par3, par4); -+ float var12 = 0.375F; -+ float var13 = 0.625F; -+ float var14 = 0.375F; -+ float var15 = 0.625F; -+ -+ if (var8) { - var14 = 0.0F; - } - -- if(var9) { -+ if (var9) { - var15 = 1.0F; - } - -- if(var8 || var9) { -+ if (var8 || var9) { - this.setBlockBounds(var12, 0.0F, var14, var13, 1.5F, var15); -- super.addCollisionBoxesToList(var1, var2, var3, var4, var5, var6, var7); -+ super.addCollisionBoxesToList(par1World, par2, par3, par4, par5AxisAlignedBB, par6List, par7Entity); - } - -- var14 = 6.0F / 16.0F; -- var15 = 10.0F / 16.0F; -- if(var10) { -+ var14 = 0.375F; -+ var15 = 0.625F; -+ -+ if (var10) { - var12 = 0.0F; - } - -- if(var11) { -+ if (var11) { - var13 = 1.0F; - } - -- if(var10 || var11 || !var8 && !var9) { -+ if (var10 || var11 || !var8 && !var9) { - this.setBlockBounds(var12, 0.0F, var14, var13, 1.5F, var15); -- super.addCollisionBoxesToList(var1, var2, var3, var4, var5, var6, var7); -+ super.addCollisionBoxesToList(par1World, par2, par3, par4, par5AxisAlignedBB, par6List, par7Entity); - } - -- if(var8) { -+ if (var8) { - var14 = 0.0F; - } - -- if(var9) { -+ if (var9) { - var15 = 1.0F; - } - - this.setBlockBounds(var12, 0.0F, var14, var13, 1.0F, var15); - } - -- public void setBlockBoundsBasedOnState(IBlockAccess var1, int var2, int var3, int var4) { -- boolean var5 = this.canConnectFenceTo(var1, var2, var3, var4 - 1); -- boolean var6 = this.canConnectFenceTo(var1, var2, var3, var4 + 1); -- boolean var7 = this.canConnectFenceTo(var1, var2 - 1, var3, var4); -- boolean var8 = this.canConnectFenceTo(var1, var2 + 1, var3, var4); -- float var9 = 6.0F / 16.0F; -- float var10 = 10.0F / 16.0F; -- float var11 = 6.0F / 16.0F; -- float var12 = 10.0F / 16.0F; -- if(var5) { -+ /** -+ * Updates the blocks bounds based on its current state. Args: world, x, y, z -+ */ -+ public void setBlockBoundsBasedOnState(IBlockAccess par1IBlockAccess, int par2, int par3, int par4) { -+ boolean var5 = this.canConnectFenceTo(par1IBlockAccess, par2, par3, par4 - 1); -+ boolean var6 = this.canConnectFenceTo(par1IBlockAccess, par2, par3, par4 + 1); -+ boolean var7 = this.canConnectFenceTo(par1IBlockAccess, par2 - 1, par3, par4); -+ boolean var8 = this.canConnectFenceTo(par1IBlockAccess, par2 + 1, par3, par4); -+ float var9 = 0.375F; -+ float var10 = 0.625F; -+ float var11 = 0.375F; -+ float var12 = 0.625F; -+ -+ if (var5) { - var11 = 0.0F; - } - -- if(var6) { -+ if (var6) { - var12 = 1.0F; - } - -- if(var7) { -+ if (var7) { - var9 = 0.0F; - } - -- if(var8) { -+ if (var8) { - var10 = 1.0F; - } - - this.setBlockBounds(var9, 0.0F, var11, var10, 1.0F, var12); - } - -+ /** -+ * Is this block (a) opaque and (b) a full 1m cube? This determines whether or not to render the shared face of two -+ * adjacent blocks and also whether the player can attach torches, redstone wire, etc to this block. -+ */ - public boolean isOpaqueCube() { - return false; - } - -+ /** -+ * If this block doesn't render as an ordinary block it will return False (examples: signs, buttons, stairs, etc) -+ */ - public boolean renderAsNormalBlock() { - return false; - } - -- public boolean getBlocksMovement(IBlockAccess var1, int var2, int var3, int var4) { -+ public boolean getBlocksMovement(IBlockAccess par1IBlockAccess, int par2, int par3, int par4) { - return false; - } - -+ /** -+ * The type of render function that is called for this block -+ */ - public int getRenderType() { - return 11; - } - -- public boolean canConnectFenceTo(IBlockAccess var1, int var2, int var3, int var4) { -- int var5 = var1.getBlockId(var2, var3, var4); -- if(var5 != this.blockID && var5 != Block.fenceGate.blockID) { -+ /** -+ * Returns true if the specified block can be connected by a fence -+ */ -+ public boolean canConnectFenceTo(IBlockAccess par1IBlockAccess, int par2, int par3, int par4) { -+ int var5 = par1IBlockAccess.getBlockId(par2, par3, par4); -+ -+ if (var5 != this.blockID && var5 != Block.fenceGate.blockID) { - Block var6 = Block.blocksList[var5]; - return var6 != null && var6.blockMaterial.isOpaque() && var6.renderAsNormalBlock() ? var6.blockMaterial != Material.pumpkin : false; - } else { -@@ -113,19 +137,30 @@ - } - } - -- public static boolean isIdAFence(int var0) { -- return var0 == Block.fence.blockID || var0 == Block.netherFence.blockID; -+ public static boolean isIdAFence(int par0) { -+ return par0 == Block.fence.blockID || par0 == Block.netherFence.blockID; - } - -- public boolean shouldSideBeRendered(IBlockAccess var1, int var2, int var3, int var4, int var5) { -+ /** -+ * Returns true if the given side of this block type should be rendered, if the adjacent block is at the given -+ * coordinates. Args: blockAccess, x, y, z, side -+ */ -+ public boolean shouldSideBeRendered(IBlockAccess par1IBlockAccess, int par2, int par3, int par4, int par5) { - return true; - } - -- public void registerIcons(IconRegister var1) { -- this.blockIcon = var1.registerIcon(this.a); -+ /** -+ * When this method is called, your block should register all the icons it needs with the given IconRegister. This is -+ * the only chance you get to register icons. -+ */ -+ public void registerIcons(IconRegister par1IconRegister) { -+ this.blockIcon = par1IconRegister.registerIcon(this.field_94464_a); - } - -- public boolean onBlockActivated(World var1, int var2, int var3, int var4, EntityPlayer var5, int var6, float var7, float var8, float var9) { -- return var1.isRemote ? true : ItemLeash.func_135066_a(var5, var1, var2, var3, var4); -+ /** -+ * Called upon block activation (right click on the block.) -+ */ -+ public boolean onBlockActivated(World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer, int par6, float par7, float par8, float par9) { -+ return par1World.isRemote ? true : ItemLeash.func_135066_a(par5EntityPlayer, par1World, par2, par3, par4); - } - } ---- net/minecraft/src/ItemBook.java -+++ net/minecraft/src/ItemBook.java -@@ -1,14 +1,20 @@ - package net.minecraft.src; - - public class ItemBook extends Item { -- public ItemBook(int var1) { -- super(var1); -- } -- -- public boolean isItemTool(ItemStack var1) { -- return var1.stackSize == 1; -- } -- -+ public ItemBook(int par1) { -+ super(par1); -+ } -+ -+ /** -+ * Checks isDamagable and if it cannot be stacked -+ */ -+ public boolean isItemTool(ItemStack par1ItemStack) { -+ return par1ItemStack.stackSize == 1; -+ } -+ -+ /** -+ * Return the enchantability factor of the item, most of the time is based on material. -+ */ - public int getItemEnchantability() { - return 1; - } ---- /dev/null -+++ org/spoutcraft/client/gui/settings/controls/ClearWaterToggleButton.java -@@ -1,0 +1,56 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.client.gui.settings.controls; -+ -+import net.minecraft.src.Minecraft; -+import net.minecraft.src.Block; -+ -+import org.spoutcraft.api.gui.GenericCheckBox; -+import org.spoutcraft.client.SpoutClient; -+import org.spoutcraft.client.config.Configuration; -+ -+public class ClearWaterToggleButton extends GenericCheckBox { -+ public ClearWaterToggleButton() { -+ super("Clear Water"); -+ setChecked(Configuration.isClearWater()); -+ setEnabled(SpoutClient.getInstance().isClearWaterCheat()); -+ setTooltip("Clear Water\nOFF - (default) standard water view\nON - can see deeper through water, no longer obscures vision\nClear water is very resource demanding!"); -+ } -+ -+ @Override -+ public String getTooltip() { -+ if (!isEnabled()) { -+ return "This option is not allowed by your server, it is considered cheating."; -+ } -+ return super.getTooltip(); -+ } -+ -+ @Override -+ public void onButtonClick() { -+ Configuration.setClearWater(!Configuration.isClearWater()); -+ Configuration.write(); -+ -+ Block.waterStill.setLightOpacity(isChecked() ? 1 : 3); -+ Block.waterMoving.setLightOpacity(isChecked() ? 1 : 3); -+ if (Minecraft.getMinecraft().theWorld != null) { -+ Minecraft.getMinecraft().renderGlobal.updateAllRenderers(); -+ } -+ } -+} ---- net/minecraft/src/FileResourcePack.java -+++ net/minecraft/src/FileResourcePack.java -@@ -16,34 +16,35 @@ - import java.util.zip.ZipFile; - - public class FileResourcePack extends AbstractResourcePack implements Closeable { -- public static final Splitter c = Splitter.on('/').omitEmptyStrings().limit(3); -- private ZipFile d; -+ public static final Splitter entryNameSplitter = Splitter.on('/').omitEmptyStrings().limit(3); -+ public ZipFile resourcePackZipFile; - -- public FileResourcePack(File var1) { -- super(var1); -+ public FileResourcePack(File par1File) { -+ super(par1File); - } - - private ZipFile getResourcePackZipFile() throws IOException { -- if(this.d == null) { -- this.d = new ZipFile(this.b); -+ if (this.resourcePackZipFile == null) { -+ this.resourcePackZipFile = new ZipFile(this.resourcePackFile); - } - -- return this.d; -+ return this.resourcePackZipFile; - } - -- protected InputStream getInputStreamByName(String var1) throws IOException { -+ protected InputStream getInputStreamByName(String par1Str) throws IOException { - ZipFile var2 = this.getResourcePackZipFile(); -- ZipEntry var3 = var2.getEntry(var1); -- if(var3 == null) { -- throw new ResourcePackFileNotFoundException(this.b, var1); -+ ZipEntry var3 = var2.getEntry(par1Str); -+ -+ if (var3 == null) { -+ throw new ResourcePackFileNotFoundException(this.resourcePackFile, par1Str); - } else { - return var2.getInputStream(var3); - } - } - -- public boolean hasResourceName(String var1) { -+ public boolean hasResourceName(String par1Str) { - try { -- return this.getResourcePackZipFile().getEntry(var1) != null; -+ return this.getResourcePackZipFile().getEntry(par1Str) != null; - } catch (IOException var3) { - return false; - } -@@ -51,6 +52,7 @@ - - public Set getResourceDomains() { - ZipFile var1; -+ - try { - var1 = this.getResourcePackZipFile(); - } catch (IOException var8) { -@@ -60,14 +62,17 @@ - Enumeration var2 = var1.entries(); - HashSet var3 = Sets.newHashSet(); - -- while(var2.hasMoreElements()) { -+ while (var2.hasMoreElements()) { - ZipEntry var4 = (ZipEntry)var2.nextElement(); - String var5 = var4.getName(); -- if(var5.startsWith("assets/")) { -- ArrayList var6 = Lists.newArrayList(c.split(var5)); -- if(var6.size() > 1) { -+ -+ if (var5.startsWith("assets/")) { -+ ArrayList var6 = Lists.newArrayList(entryNameSplitter.split(var5)); -+ -+ if (var6.size() > 1) { - String var7 = (String)var6.get(1); -- if(!var7.equals(var7.toLowerCase())) { -+ -+ if (!var7.equals(var7.toLowerCase())) { - this.logNameNotLowercase(var7); - } else { - var3.add(var7); -@@ -81,14 +86,21 @@ - - protected void finalize() { - this.close(); -- super.finalize(); -+ -+ try { -+ super.finalize(); -+ } catch (Throwable t) { -+ } - } - - public void close() { -- if(this.d != null) { -- this.d.close(); -- this.d = null; -- } -+ if (this.resourcePackZipFile != null) { -+ try { -+ this.resourcePackZipFile.close(); -+ } catch (Exception ex) { -+ } - -+ this.resourcePackZipFile = null; -+ } - } - } ---- net/minecraft/src/Explosion.java -+++ net/minecraft/src/Explosion.java -@@ -9,42 +9,51 @@ - import java.util.Random; - - public class Explosion { -+ -+ /** whether or not the explosion sets fire to blocks around it */ - public boolean isFlaming; -+ -+ /** whether or not this explosion spawns smoke particles */ - public boolean isSmoking = true; - private int field_77289_h = 16; -- private Random j = new Random(); -+ private Random explosionRNG = new Random(); - private World worldObj; - public double explosionX; - public double explosionY; - public double explosionZ; - public Entity exploder; - public float explosionSize; -- public List h = new ArrayList(); -- private Map l = new HashMap(); -- -- public Explosion(World var1, Entity var2, double var3, double var5, double var7, float var9) { -- this.worldObj = var1; -- this.exploder = var2; -- this.explosionSize = var9; -- this.explosionX = var3; -- this.explosionY = var5; -- this.explosionZ = var7; -+ -+ /** A list of ChunkPositions of blocks affected by this explosion */ -+ public List affectedBlockPositions = new ArrayList(); -+ private Map field_77288_k = new HashMap(); -+ -+ public Explosion(World par1World, Entity par2Entity, double par3, double par5, double par7, float par9) { -+ this.worldObj = par1World; -+ this.exploder = par2Entity; -+ this.explosionSize = par9; -+ this.explosionX = par3; -+ this.explosionY = par5; -+ this.explosionZ = par7; - } - -+ /** -+ * Does the first part of the explosion (destroy blocks) -+ */ - public void doExplosionA() { - float var1 = this.explosionSize; - HashSet var2 = new HashSet(); -- - int var3; - int var4; - int var5; - double var15; - double var17; - double var19; -- for(var3 = 0; var3 < this.field_77289_h; ++var3) { -- for(var4 = 0; var4 < this.field_77289_h; ++var4) { -- for(var5 = 0; var5 < this.field_77289_h; ++var5) { -- if(var3 == 0 || var3 == this.field_77289_h - 1 || var4 == 0 || var4 == this.field_77289_h - 1 || var5 == 0 || var5 == this.field_77289_h - 1) { -+ -+ for (var3 = 0; var3 < this.field_77289_h; ++var3) { -+ for (var4 = 0; var4 < this.field_77289_h; ++var4) { -+ for (var5 = 0; var5 < this.field_77289_h; ++var5) { -+ if (var3 == 0 || var3 == this.field_77289_h - 1 || var4 == 0 || var4 == this.field_77289_h - 1 || var5 == 0 || var5 == this.field_77289_h - 1) { - double var6 = (double)((float)var3 / ((float)this.field_77289_h - 1.0F) * 2.0F - 1.0F); - double var8 = (double)((float)var4 / ((float)this.field_77289_h - 1.0F) * 2.0F - 1.0F); - double var10 = (double)((float)var5 / ((float)this.field_77289_h - 1.0F) * 2.0F - 1.0F); -@@ -52,23 +61,24 @@ - var6 /= var12; - var8 /= var12; - var10 /= var12; -- float var14 = this.explosionSize * (0.7F + this.worldObj.s.nextFloat() * 0.6F); -+ float var14 = this.explosionSize * (0.7F + this.worldObj.rand.nextFloat() * 0.6F); - var15 = this.explosionX; - var17 = this.explosionY; - var19 = this.explosionZ; - -- for(float var21 = 0.3F; var14 > 0.0F; var14 -= var21 * (12.0F / 16.0F)) { -+ for (float var21 = 0.3F; var14 > 0.0F; var14 -= var21 * 0.75F) { - int var22 = MathHelper.floor_double(var15); - int var23 = MathHelper.floor_double(var17); - int var24 = MathHelper.floor_double(var19); - int var25 = this.worldObj.getBlockId(var22, var23, var24); -- if(var25 > 0) { -+ -+ if (var25 > 0) { - Block var26 = Block.blocksList[var25]; - float var27 = this.exploder != null ? this.exploder.getBlockExplosionResistance(this, this.worldObj, var22, var23, var24, var26) : var26.getExplosionResistance(this.exploder); - var14 -= (var27 + 0.3F) * var21; - } - -- if(var14 > 0.0F && (this.exploder == null || this.exploder.shouldExplodeBlock(this, this.worldObj, var22, var23, var24, var25, var14))) { -+ if (var14 > 0.0F && (this.exploder == null || this.exploder.shouldExplodeBlock(this, this.worldObj, var22, var23, var24, var25, var14))) { - var2.add(new ChunkPosition(var22, var23, var24)); - } - -@@ -81,7 +91,7 @@ - } - } - -- this.h.addAll(var2); -+ this.affectedBlockPositions.addAll(var2); - this.explosionSize *= 2.0F; - var3 = MathHelper.floor_double(this.explosionX - (double)this.explosionSize - 1.0D); - var4 = MathHelper.floor_double(this.explosionX + (double)this.explosionSize + 1.0D); -@@ -92,15 +102,17 @@ - List var9 = this.worldObj.getEntitiesWithinAABBExcludingEntity(this.exploder, AxisAlignedBB.getAABBPool().getAABB((double)var3, (double)var5, (double)var7, (double)var4, (double)var29, (double)var30)); - Vec3 var31 = this.worldObj.getWorldVec3Pool().getVecFromPool(this.explosionX, this.explosionY, this.explosionZ); - -- for(int var11 = 0; var11 < var9.size(); ++var11) { -+ for (int var11 = 0; var11 < var9.size(); ++var11) { - Entity var32 = (Entity)var9.get(var11); - double var13 = var32.getDistance(this.explosionX, this.explosionY, this.explosionZ) / (double)this.explosionSize; -- if(var13 <= 1.0D) { -+ -+ if (var13 <= 1.0D) { - var15 = var32.posX - this.explosionX; - var17 = var32.posY + (double)var32.getEyeHeight() - this.explosionY; - var19 = var32.posZ - this.explosionZ; - double var33 = (double)MathHelper.sqrt_double(var15 * var15 + var17 * var17 + var19 * var19); -- if(var33 != 0.0D) { -+ -+ if (var33 != 0.0D) { - var15 /= var33; - var17 /= var33; - var19 /= var33; -@@ -111,8 +123,9 @@ - var32.motionX += var15 * var36; - var32.motionY += var17 * var36; - var32.motionZ += var19 * var36; -- if(var32 instanceof EntityPlayer) { -- this.l.put((EntityPlayer)var32, this.worldObj.getWorldVec3Pool().getVecFromPool(var15 * var35, var17 * var35, var19 * var35)); -+ -+ if (var32 instanceof EntityPlayer) { -+ this.field_77288_k.put((EntityPlayer)var32, this.worldObj.getWorldVec3Pool().getVecFromPool(var15 * var35, var17 * var35, var19 * var35)); - } - } - } -@@ -121,9 +134,13 @@ - this.explosionSize = var1; - } - -- public void doExplosionB(boolean var1) { -- this.worldObj.playSoundEffect(this.explosionX, this.explosionY, this.explosionZ, "random.explode", 4.0F, (1.0F + (this.worldObj.s.nextFloat() - this.worldObj.s.nextFloat()) * 0.2F) * 0.7F); -- if(this.explosionSize >= 2.0F && this.isSmoking) { -+ /** -+ * Does the second part of the explosion (sound, particles, drop spawn) -+ */ -+ public void doExplosionB(boolean par1) { -+ this.worldObj.playSoundEffect(this.explosionX, this.explosionY, this.explosionZ, "random.explode", 4.0F, (1.0F + (this.worldObj.rand.nextFloat() - this.worldObj.rand.nextFloat()) * 0.2F) * 0.7F); -+ -+ if (this.explosionSize >= 2.0F && this.isSmoking) { - this.worldObj.spawnParticle("hugeexplosion", this.explosionX, this.explosionY, this.explosionZ, 1.0D, 0.0D, 0.0D); - } else { - this.worldObj.spawnParticle("largeexplode", this.explosionX, this.explosionY, this.explosionZ, 1.0D, 0.0D, 0.0D); -@@ -135,19 +152,21 @@ - int var5; - int var6; - int var7; -- if(this.isSmoking) { -- var2 = this.h.iterator(); -- -- while(var2.hasNext()) { -+ -+ if (this.isSmoking) { -+ var2 = this.affectedBlockPositions.iterator(); -+ -+ while (var2.hasNext()) { - var3 = (ChunkPosition)var2.next(); - var4 = var3.x; - var5 = var3.y; - var6 = var3.z; - var7 = this.worldObj.getBlockId(var4, var5, var6); -- if(var1) { -- double var8 = (double)((float)var4 + this.worldObj.s.nextFloat()); -- double var10 = (double)((float)var5 + this.worldObj.s.nextFloat()); -- double var12 = (double)((float)var6 + this.worldObj.s.nextFloat()); -+ -+ if (par1) { -+ double var8 = (double)((float)var4 + this.worldObj.rand.nextFloat()); -+ double var10 = (double)((float)var5 + this.worldObj.rand.nextFloat()); -+ double var12 = (double)((float)var6 + this.worldObj.rand.nextFloat()); - double var14 = var8 - this.explosionX; - double var16 = var10 - this.explosionY; - double var18 = var12 - this.explosionZ; -@@ -156,7 +175,7 @@ - var16 /= var20; - var18 /= var20; - double var22 = 0.5D / (var20 / (double)this.explosionSize + 0.1D); -- var22 *= (double)(this.worldObj.s.nextFloat() * this.worldObj.s.nextFloat() + 0.3F); -+ var22 *= (double)(this.worldObj.rand.nextFloat() * this.worldObj.rand.nextFloat() + 0.3F); - var14 *= var22; - var16 *= var22; - var18 *= var22; -@@ -164,9 +183,10 @@ - this.worldObj.spawnParticle("smoke", var8, var10, var12, var14, var16, var18); - } - -- if(var7 > 0) { -+ if (var7 > 0) { - Block var24 = Block.blocksList[var7]; -- if(var24.canDropFromExplosion(this)) { -+ -+ if (var24.canDropFromExplosion(this)) { - var24.dropBlockAsItemWithChance(this.worldObj, var4, var5, var6, this.worldObj.getBlockMetadata(var4, var5, var6), 1.0F / this.explosionSize, 0); - } - -@@ -176,28 +196,31 @@ - } - } - -- if(this.isFlaming) { -- var2 = this.h.iterator(); -+ if (this.isFlaming) { -+ var2 = this.affectedBlockPositions.iterator(); - -- while(var2.hasNext()) { -+ while (var2.hasNext()) { - var3 = (ChunkPosition)var2.next(); - var4 = var3.x; - var5 = var3.y; - var6 = var3.z; - var7 = this.worldObj.getBlockId(var4, var5, var6); - int var25 = this.worldObj.getBlockId(var4, var5 - 1, var6); -- if(var7 == 0 && Block.opaqueCubeLookup[var25] && this.j.nextInt(3) == 0) { -+ -+ if (var7 == 0 && Block.opaqueCubeLookup[var25] && this.explosionRNG.nextInt(3) == 0) { - this.worldObj.setBlock(var4, var5, var6, Block.fire.blockID); - } - } - } -- - } - - public Map func_77277_b() { -- return this.l; -+ return this.field_77288_k; - } - -+ /** -+ * Returns either the entity that placed the explosive block, the entity that caused the explosion or null. -+ */ - public EntityLivingBase getExplosivePlacedBy() { - return this.exploder == null ? null : (this.exploder instanceof EntityTNTPrimed ? ((EntityTNTPrimed)this.exploder).getTntPlacedBy() : (this.exploder instanceof EntityLivingBase ? (EntityLivingBase)this.exploder : null)); - } ---- net/minecraft/src/ChunkProviderEnd.java -+++ net/minecraft/src/ChunkProviderEnd.java -@@ -4,7 +4,7 @@ - import java.util.Random; - - public class ChunkProviderEnd implements IChunkProvider { -- private Random i; -+ private Random endRNG; - private NoiseGeneratorOctaves noiseGen1; - private NoiseGeneratorOctaves noiseGen2; - private NoiseGeneratorOctaves noiseGen3; -@@ -12,6 +12,8 @@ - public NoiseGeneratorOctaves noiseGen5; - private World endWorld; - private double[] densities; -+ -+ /** The biomes that are used to generate the chunk */ - private BiomeGenBase[] biomesForGeneration; - double[] noiseData1; - double[] noiseData2; -@@ -20,26 +22,26 @@ - double[] noiseData5; - int[][] field_73203_h = new int[32][32]; - -- public ChunkProviderEnd(World var1, long var2) { -- this.endWorld = var1; -- this.i = new Random(var2); -- this.noiseGen1 = new NoiseGeneratorOctaves(this.i, 16); -- this.noiseGen2 = new NoiseGeneratorOctaves(this.i, 16); -- this.noiseGen3 = new NoiseGeneratorOctaves(this.i, 8); -- this.noiseGen4 = new NoiseGeneratorOctaves(this.i, 10); -- this.noiseGen5 = new NoiseGeneratorOctaves(this.i, 16); -+ public ChunkProviderEnd(World par1World, long par2) { -+ this.endWorld = par1World; -+ this.endRNG = new Random(par2); -+ this.noiseGen1 = new NoiseGeneratorOctaves(this.endRNG, 16); -+ this.noiseGen2 = new NoiseGeneratorOctaves(this.endRNG, 16); -+ this.noiseGen3 = new NoiseGeneratorOctaves(this.endRNG, 8); -+ this.noiseGen4 = new NoiseGeneratorOctaves(this.endRNG, 10); -+ this.noiseGen5 = new NoiseGeneratorOctaves(this.endRNG, 16); - } - -- public void generateTerrain(int var1, int var2, byte[] var3, BiomeGenBase[] var4) { -+ public void generateTerrain(int par1, int par2, byte[] par3ArrayOfByte, BiomeGenBase[] par4ArrayOfBiomeGenBase) { - byte var5 = 2; - int var6 = var5 + 1; - byte var7 = 33; - int var8 = var5 + 1; -- this.densities = this.initializeNoiseField(this.densities, var1 * var5, 0, var2 * var5, var6, var7, var8); -+ this.densities = this.initializeNoiseField(this.densities, par1 * var5, 0, par2 * var5, var6, var7, var8); - -- for(int var9 = 0; var9 < var5; ++var9) { -- for(int var10 = 0; var10 < var5; ++var10) { -- for(int var11 = 0; var11 < 32; ++var11) { -+ for (int var9 = 0; var9 < var5; ++var9) { -+ for (int var10 = 0; var10 < var5; ++var10) { -+ for (int var11 = 0; var11 < 32; ++var11) { - double var12 = 0.25D; - double var14 = this.densities[((var9 + 0) * var8 + var10 + 0) * var7 + var11 + 0]; - double var16 = this.densities[((var9 + 0) * var8 + var10 + 1) * var7 + var11 + 0]; -@@ -50,27 +52,28 @@ - double var26 = (this.densities[((var9 + 1) * var8 + var10 + 0) * var7 + var11 + 1] - var18) * var12; - double var28 = (this.densities[((var9 + 1) * var8 + var10 + 1) * var7 + var11 + 1] - var20) * var12; - -- for(int var30 = 0; var30 < 4; ++var30) { -+ for (int var30 = 0; var30 < 4; ++var30) { - double var31 = 0.125D; - double var33 = var14; - double var35 = var16; - double var37 = (var18 - var14) * var31; - double var39 = (var20 - var16) * var31; - -- for(int var41 = 0; var41 < 8; ++var41) { -+ for (int var41 = 0; var41 < 8; ++var41) { - int var42 = var41 + var9 * 8 << 11 | 0 + var10 * 8 << 7 | var11 * 4 + var30; - short var43 = 128; - double var44 = 0.125D; - double var46 = var33; - double var48 = (var35 - var33) * var44; - -- for(int var50 = 0; var50 < 8; ++var50) { -+ for (int var50 = 0; var50 < 8; ++var50) { - int var51 = 0; -- if(var46 > 0.0D) { -+ -+ if (var46 > 0.0D) { - var51 = Block.whiteStone.blockID; - } - -- var3[var42] = (byte)var51; -+ par3ArrayOfByte[var42] = (byte)var51; - var42 += var43; - var46 += var48; - } -@@ -87,60 +90,67 @@ - } - } - } -- - } - -- public void replaceBlocksForBiome(int var1, int var2, byte[] var3, BiomeGenBase[] var4) { -- for(int var5 = 0; var5 < 16; ++var5) { -- for(int var6 = 0; var6 < 16; ++var6) { -+ public void replaceBlocksForBiome(int par1, int par2, byte[] par3ArrayOfByte, BiomeGenBase[] par4ArrayOfBiomeGenBase) { -+ for (int var5 = 0; var5 < 16; ++var5) { -+ for (int var6 = 0; var6 < 16; ++var6) { - byte var7 = 1; - int var8 = -1; - byte var9 = (byte)Block.whiteStone.blockID; - byte var10 = (byte)Block.whiteStone.blockID; - -- for(int var11 = 127; var11 >= 0; --var11) { -+ for (int var11 = 127; var11 >= 0; --var11) { - int var12 = (var6 * 16 + var5) * 128 + var11; -- byte var13 = var3[var12]; -- if(var13 == 0) { -+ byte var13 = par3ArrayOfByte[var12]; -+ -+ if (var13 == 0) { - var8 = -1; -- } else if(var13 == Block.stone.blockID) { -- if(var8 == -1) { -- if(var7 <= 0) { -+ } else if (var13 == Block.stone.blockID) { -+ if (var8 == -1) { -+ if (var7 <= 0) { - var9 = 0; - var10 = (byte)Block.whiteStone.blockID; - } - - var8 = var7; -- if(var11 >= 0) { -- var3[var12] = var9; -+ -+ if (var11 >= 0) { -+ par3ArrayOfByte[var12] = var9; - } else { -- var3[var12] = var10; -+ par3ArrayOfByte[var12] = var10; - } -- } else if(var8 > 0) { -+ } else if (var8 > 0) { - --var8; -- var3[var12] = var10; -+ par3ArrayOfByte[var12] = var10; - } - } - } - } - } -- -- } -- -- public Chunk loadChunk(int var1, int var2) { -- return this.provideChunk(var1, var2); -- } -- -- public Chunk provideChunk(int var1, int var2) { -- this.i.setSeed((long)var1 * 341873128712L + (long)var2 * 132897987541L); -- byte[] var3 = new byte[-Short.MIN_VALUE]; -- this.biomesForGeneration = this.endWorld.getWorldChunkManager().loadBlockGeneratorData(this.biomesForGeneration, var1 * 16, var2 * 16, 16, 16); -- this.generateTerrain(var1, var2, var3, this.biomesForGeneration); -- this.replaceBlocksForBiome(var1, var2, var3, this.biomesForGeneration); -- Chunk var4 = new Chunk(this.endWorld, var3, var1, var2); -+ } -+ -+ /** -+ * loads or generates the chunk at the chunk location specified -+ */ -+ public Chunk loadChunk(int par1, int par2) { -+ return this.provideChunk(par1, par2); -+ } -+ -+ /** -+ * Will return back a chunk, if it doesn't exist and its not a MP client it will generates all the blocks for the -+ * specified chunk from the map seed and chunk seed -+ */ -+ public Chunk provideChunk(int par1, int par2) { -+ this.endRNG.setSeed((long)par1 * 341873128712L + (long)par2 * 132897987541L); -+ byte[] var3 = new byte[32768]; -+ this.biomesForGeneration = this.endWorld.getWorldChunkManager().loadBlockGeneratorData(this.biomesForGeneration, par1 * 16, par2 * 16, 16, 16); -+ this.generateTerrain(par1, par2, var3, this.biomesForGeneration); -+ this.replaceBlocksForBiome(par1, par2, var3, this.biomesForGeneration); -+ Chunk var4 = new Chunk(this.endWorld, var3, par1, par2); - byte[] var5 = var4.getBiomeArray(); - -- for(int var6 = 0; var6 < var5.length; ++var6) { -+ for (int var6 = 0; var6 < var5.length; ++var6) { - var5[var6] = (byte)this.biomesForGeneration[var6].biomeID; - } - -@@ -148,74 +158,84 @@ - return var4; - } - -- private double[] initializeNoiseField(double[] var1, int var2, int var3, int var4, int var5, int var6, int var7) { -- if(var1 == null) { -- var1 = new double[var5 * var6 * var7]; -+ /** -+ * generates a subset of the level's terrain data. Takes 7 arguments: the [empty] noise array, the position, and the -+ * size. -+ */ -+ private double[] initializeNoiseField(double[] par1ArrayOfDouble, int par2, int par3, int par4, int par5, int par6, int par7) { -+ if (par1ArrayOfDouble == null) { -+ par1ArrayOfDouble = new double[par5 * par6 * par7]; - } - - double var8 = 684.412D; - double var10 = 684.412D; -- this.noiseData4 = this.noiseGen4.generateNoiseOctaves(this.noiseData4, var2, var4, var5, var7, 1.121D, 1.121D, 0.5D); -- this.noiseData5 = this.noiseGen5.generateNoiseOctaves(this.noiseData5, var2, var4, var5, var7, 200.0D, 200.0D, 0.5D); -+ this.noiseData4 = this.noiseGen4.generateNoiseOctaves(this.noiseData4, par2, par4, par5, par7, 1.121D, 1.121D, 0.5D); -+ this.noiseData5 = this.noiseGen5.generateNoiseOctaves(this.noiseData5, par2, par4, par5, par7, 200.0D, 200.0D, 0.5D); - var8 *= 2.0D; -- this.noiseData1 = this.noiseGen3.generateNoiseOctaves(this.noiseData1, var2, var3, var4, var5, var6, var7, var8 / 80.0D, var10 / 160.0D, var8 / 80.0D); -- this.noiseData2 = this.noiseGen1.generateNoiseOctaves(this.noiseData2, var2, var3, var4, var5, var6, var7, var8, var10, var8); -- this.noiseData3 = this.noiseGen2.generateNoiseOctaves(this.noiseData3, var2, var3, var4, var5, var6, var7, var8, var10, var8); -+ this.noiseData1 = this.noiseGen3.generateNoiseOctaves(this.noiseData1, par2, par3, par4, par5, par6, par7, var8 / 80.0D, var10 / 160.0D, var8 / 80.0D); -+ this.noiseData2 = this.noiseGen1.generateNoiseOctaves(this.noiseData2, par2, par3, par4, par5, par6, par7, var8, var10, var8); -+ this.noiseData3 = this.noiseGen2.generateNoiseOctaves(this.noiseData3, par2, par3, par4, par5, par6, par7, var8, var10, var8); - int var12 = 0; - int var13 = 0; - -- for(int var14 = 0; var14 < var5; ++var14) { -- for(int var15 = 0; var15 < var7; ++var15) { -+ for (int var14 = 0; var14 < par5; ++var14) { -+ for (int var15 = 0; var15 < par7; ++var15) { - double var16 = (this.noiseData4[var13] + 256.0D) / 512.0D; -- if(var16 > 1.0D) { -+ -+ if (var16 > 1.0D) { - var16 = 1.0D; - } - - double var18 = this.noiseData5[var13] / 8000.0D; -- if(var18 < 0.0D) { -+ -+ if (var18 < 0.0D) { - var18 = -var18 * 0.3D; - } - - var18 = var18 * 3.0D - 2.0D; -- float var20 = (float)(var14 + var2 - 0) / 1.0F; -- float var21 = (float)(var15 + var4 - 0) / 1.0F; -+ float var20 = (float)(var14 + par2 - 0) / 1.0F; -+ float var21 = (float)(var15 + par4 - 0) / 1.0F; - float var22 = 100.0F - MathHelper.sqrt_float(var20 * var20 + var21 * var21) * 8.0F; -- if(var22 > 80.0F) { -+ -+ if (var22 > 80.0F) { - var22 = 80.0F; - } - -- if(var22 < -100.0F) { -+ if (var22 < -100.0F) { - var22 = -100.0F; - } - -- if(var18 > 1.0D) { -+ if (var18 > 1.0D) { - var18 = 1.0D; - } - - var18 /= 8.0D; - var18 = 0.0D; -- if(var16 < 0.0D) { -+ -+ if (var16 < 0.0D) { - var16 = 0.0D; - } - - var16 += 0.5D; -- var18 = var18 * (double)var6 / 16.0D; -+ var18 = var18 * (double)par6 / 16.0D; - ++var13; -- double var23 = (double)var6 / 2.0D; -+ double var23 = (double)par6 / 2.0D; - -- for(int var25 = 0; var25 < var6; ++var25) { -+ for (int var25 = 0; var25 < par6; ++var25) { - double var26 = 0.0D; - double var28 = ((double)var25 - var23) * 8.0D / var16; -- if(var28 < 0.0D) { -+ -+ if (var28 < 0.0D) { - var28 *= -1.0D; - } - - double var30 = this.noiseData2[var12] / 512.0D; - double var32 = this.noiseData3[var12] / 512.0D; - double var34 = (this.noiseData1[var12] / 10.0D + 1.0D) / 2.0D; -- if(var34 < 0.0D) { -+ -+ if (var34 < 0.0D) { - var26 = var30; -- } else if(var34 > 1.0D) { -+ } else if (var34 > 1.0D) { - var26 = var32; - } else { - var26 = var30 + (var32 - var30) * var34; -@@ -225,13 +245,15 @@ - var26 += (double)var22; - byte var36 = 2; - double var37; -- if(var25 > var6 / 2 - var36) { -- var37 = (double)((float)(var25 - (var6 / 2 - var36)) / 64.0F); -- if(var37 < 0.0D) { -+ -+ if (var25 > par6 / 2 - var36) { -+ var37 = (double)((float)(var25 - (par6 / 2 - var36)) / 64.0F); -+ -+ if (var37 < 0.0D) { - var37 = 0.0D; - } - -- if(var37 > 1.0D) { -+ if (var37 > 1.0D) { - var37 = 1.0D; - } - -@@ -239,58 +261,87 @@ - } - - var36 = 8; -- if(var25 < var36) { -+ -+ if (var25 < var36) { - var37 = (double)((float)(var36 - var25) / ((float)var36 - 1.0F)); - var26 = var26 * (1.0D - var37) + -30.0D * var37; - } - -- var1[var12] = var26; -+ par1ArrayOfDouble[var12] = var26; - ++var12; - } - } - } - -- return var1; -+ return par1ArrayOfDouble; - } - -- public boolean chunkExists(int var1, int var2) { -+ /** -+ * Checks to see if a chunk exists at x, y -+ */ -+ public boolean chunkExists(int par1, int par2) { - return true; - } - -- public void populate(IChunkProvider var1, int var2, int var3) { -+ /** -+ * Populates chunk with ores etc etc -+ */ -+ public void populate(IChunkProvider par1IChunkProvider, int par2, int par3) { - BlockSand.fallInstantly = true; -- int var4 = var2 * 16; -- int var5 = var3 * 16; -+ int var4 = par2 * 16; -+ int var5 = par3 * 16; - BiomeGenBase var6 = this.endWorld.getBiomeGenForCoords(var4 + 16, var5 + 16); -- var6.decorate(this.endWorld, this.endWorld.s, var4, var5); -+ var6.decorate(this.endWorld, this.endWorld.rand, var4, var5); - BlockSand.fallInstantly = false; - } - -- public boolean saveChunks(boolean var1, IProgressUpdate var2) { -+ /** -+ * Two modes of operation: if passed true, save all Chunks in one go. If passed false, save up to two chunks. Return -+ * true if all chunks have been saved. -+ */ -+ public boolean saveChunks(boolean par1, IProgressUpdate par2IProgressUpdate) { - return true; - } - -- public void saveExtraData() { -- } -+ /** -+ * Save extra data not associated with any Chunk. Not saved during autosave, only during world unload. Currently -+ * unimplemented. -+ */ -+ public void saveExtraData() {} - -+ /** -+ * Unloads chunks that are marked to be unloaded. This is not guaranteed to unload every such chunk. -+ */ - public boolean unloadQueuedChunks() { - return false; - } - -+ /** -+ * Returns if the IChunkProvider supports saving. -+ */ - public boolean canSave() { - return true; - } - -+ /** -+ * Converts the instance data to a readable string. -+ */ - public String makeString() { - return "RandomLevelSource"; - } - -- public List getPossibleCreatures(EnumCreatureType var1, int var2, int var3, int var4) { -- BiomeGenBase var5 = this.endWorld.getBiomeGenForCoords(var2, var4); -- return var5 == null ? null : var5.getSpawnableList(var1); -+ /** -+ * Returns a list of creatures of the specified type that can spawn at the given location. -+ */ -+ public List getPossibleCreatures(EnumCreatureType par1EnumCreatureType, int par2, int par3, int par4) { -+ BiomeGenBase var5 = this.endWorld.getBiomeGenForCoords(par2, par4); -+ return var5 == null ? null : var5.getSpawnableList(par1EnumCreatureType); - } - -- public ChunkPosition findClosestStructure(World var1, String var2, int var3, int var4, int var5) { -+ /** -+ * Returns the location of the closest structure of the specified type. If not found returns null. -+ */ -+ public ChunkPosition findClosestStructure(World par1World, String par2Str, int par3, int par4, int par5) { - return null; - } - -@@ -298,6 +349,5 @@ - return 0; - } - -- public void recreateStructures(int var1, int var2) { -- } -+ public void recreateStructures(int par1, int par2) {} - } ---- /dev/null -+++ com/prupe/mcpatcher/sky/FireworksHelper.java -@@ -1,0 +1,56 @@ -+package com.prupe.mcpatcher.sky; -+ -+import com.prupe.mcpatcher.BlendMethod; -+import com.prupe.mcpatcher.Config; -+import com.prupe.mcpatcher.MCLogger; -+import com.prupe.mcpatcher.MCPatcherUtils; -+import com.prupe.mcpatcher.TexturePackAPI; -+import java.util.Properties; -+import net.minecraft.src.EntityFX; -+import net.minecraft.src.EntityFireworkOverlayFX; -+import net.minecraft.src.EntityFireworkSparkFX; -+import net.minecraft.src.ResourceLocation; -+import org.lwjgl.opengl.GL11; -+ -+//Spout Start -+import org.spoutcraft.client.config.Configuration; -+//Spout End -+ -+public class FireworksHelper { -+ private static final int LIT_LAYER = 3; -+ private static final int EXTRA_LAYER = 4; -+ private static final ResourceLocation PARTICLE_PROPERTIES = TexturePackAPI.newMCPatcherResourceLocation("particle.properties"); -+ private static final MCLogger logger = MCLogger.getLogger("Better Skies"); -+ private static final boolean enable = Config.getBoolean("Better Skies", "brightenFireworks", true); -+ private static BlendMethod blendMethod; -+ -+ public static int getFXLayer(EntityFX entity) { -+ return enable && (entity instanceof EntityFireworkSparkFX || entity instanceof EntityFireworkOverlayFX) ? 4 : entity.getFXLayer(); -+ } -+ -+ public static boolean skipThisLayer(boolean skip, int layer) { -+ return skip || layer == 3 || !enable && layer > 3; -+ } -+ -+ public static void setParticleBlendMethod(int layer) { -+ if (Configuration.isFancyClouds() && layer == 4 && blendMethod != null) { -+ blendMethod.applyBlending(); -+ } else { -+ GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); -+ } -+ } -+ -+ static void reload() { -+ Properties properties = TexturePackAPI.getProperties(PARTICLE_PROPERTIES); -+ String blend = MCPatcherUtils.getStringProperty(properties, "blend.4", "add"); -+ blendMethod = BlendMethod.parse(blend); -+ -+ if (blendMethod == null) { -+ logger.error("%s: unknown blend method %s", new Object[] {PARTICLE_PROPERTIES, blend}); -+ } else if (enable) { -+ logger.config("using %s blending for fireworks particles", new Object[] {blendMethod}); -+ } else { -+ logger.config("using default blending for fireworks particles", new Object[0]); -+ } -+ } -+} ---- /dev/null -+++ org/spoutcraft/api/material/Material.java -@@ -1,0 +1,34 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.api.material; -+ -+public interface Material { -+ public int getRawId(); -+ -+ public int getRawData(); -+ -+ public boolean hasSubtypes(); -+ -+ public String getName(); -+ -+ public String getNotchianName(); -+ -+ public void setName(String name); -+} ---- net/minecraft/src/NoiseGeneratorOctaves.java -+++ net/minecraft/src/NoiseGeneratorOctaves.java -@@ -3,34 +3,41 @@ - import java.util.Random; - - public class NoiseGeneratorOctaves extends NoiseGenerator { -+ -+ /** -+ * Collection of noise generation functions. Output is combined to produce different octaves of noise. -+ */ - private NoiseGeneratorPerlin[] generatorCollection; - private int octaves; - -- public NoiseGeneratorOctaves(Random var1, int var2) { -- this.octaves = var2; -- this.generatorCollection = new NoiseGeneratorPerlin[var2]; -+ public NoiseGeneratorOctaves(Random par1Random, int par2) { -+ this.octaves = par2; -+ this.generatorCollection = new NoiseGeneratorPerlin[par2]; - -- for(int var3 = 0; var3 < var2; ++var3) { -- this.generatorCollection[var3] = new NoiseGeneratorPerlin(var1); -+ for (int var3 = 0; var3 < par2; ++var3) { -+ this.generatorCollection[var3] = new NoiseGeneratorPerlin(par1Random); - } -- - } - -- public double[] generateNoiseOctaves(double[] var1, int var2, int var3, int var4, int var5, int var6, int var7, double var8, double var10, double var12) { -- if(var1 == null) { -- var1 = new double[var5 * var6 * var7]; -+ /** -+ * pars:(par2,3,4=noiseOffset ; so that adjacent noise segments connect) (pars5,6,7=x,y,zArraySize),(pars8,10,12 = -+ * x,y,z noiseScale) -+ */ -+ public double[] generateNoiseOctaves(double[] par1ArrayOfDouble, int par2, int par3, int par4, int par5, int par6, int par7, double par8, double par10, double par12) { -+ if (par1ArrayOfDouble == null) { -+ par1ArrayOfDouble = new double[par5 * par6 * par7]; - } else { -- for(int var14 = 0; var14 < var1.length; ++var14) { -- var1[var14] = 0.0D; -+ for (int var14 = 0; var14 < par1ArrayOfDouble.length; ++var14) { -+ par1ArrayOfDouble[var14] = 0.0D; - } - } - - double var27 = 1.0D; - -- for(int var16 = 0; var16 < this.octaves; ++var16) { -- double var17 = (double)var2 * var27 * var8; -- double var19 = (double)var3 * var27 * var10; -- double var21 = (double)var4 * var27 * var12; -+ for (int var16 = 0; var16 < this.octaves; ++var16) { -+ double var17 = (double)par2 * var27 * par8; -+ double var19 = (double)par3 * var27 * par10; -+ double var21 = (double)par4 * var27 * par12; - long var23 = MathHelper.floor_double_long(var17); - long var25 = MathHelper.floor_double_long(var21); - var17 -= (double)var23; -@@ -39,14 +46,17 @@ - var25 %= 16777216L; - var17 += (double)var23; - var21 += (double)var25; -- this.generatorCollection[var16].populateNoiseArray(var1, var17, var19, var21, var5, var6, var7, var8 * var27, var10 * var27, var12 * var27, var27); -+ this.generatorCollection[var16].populateNoiseArray(par1ArrayOfDouble, var17, var19, var21, par5, par6, par7, par8 * var27, par10 * var27, par12 * var27, var27); - var27 /= 2.0D; - } - -- return var1; -+ return par1ArrayOfDouble; - } - -- public double[] generateNoiseOctaves(double[] var1, int var2, int var3, int var4, int var5, double var6, double var8, double var10) { -- return this.generateNoiseOctaves(var1, var2, 10, var3, var4, 1, var5, var6, 1.0D, var8); -+ /** -+ * Bouncer function to the main one with some default arguments. -+ */ -+ public double[] generateNoiseOctaves(double[] par1ArrayOfDouble, int par2, int par3, int par4, int par5, double par6, double par8, double par10) { -+ return this.generateNoiseOctaves(par1ArrayOfDouble, par2, 10, par3, par4, 1, par5, par6, 1.0D, par8); - } - } ---- /dev/null -+++ org/spoutcraft/api/gui/ChatBar.java -@@ -1,0 +1,130 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.api.gui; -+ -+import java.io.IOException; -+import java.util.UUID; -+ -+import org.spoutcraft.api.UnsafeClass; -+import org.spoutcraft.api.io.SpoutInputStream; -+import org.spoutcraft.api.io.SpoutOutputStream; -+ -+@UnsafeClass -+public class ChatBar extends GenericWidget implements Widget { -+ private int cursorX = 4, cursorY = 240; -+ protected Color textColor = new Color((short) 255, (short) 255, (short) 255, (short) 0); -+ -+ public ChatBar() { -+ super(); -+ setX(2); -+ setY(-2); -+ setWidth(425); -+ setHeight(12); -+ setAnchor(WidgetAnchor.BOTTOM_LEFT); -+ } -+ -+ @Override -+ public void readData(SpoutInputStream input) throws IOException { -+ super.readData(input); -+ setCursorX(input.readInt()); -+ setCursorY(input.readInt()); -+ setTextColor(input.readColor()); -+ } -+ -+ @Override -+ public void writeData(SpoutOutputStream output) throws IOException { -+ super.writeData(output); -+ output.writeInt(getCursorX()); -+ output.writeInt(getCursorY()); -+ output.writeColor(getTextColor()); -+ } -+ -+ public WidgetType getType() { -+ return WidgetType.ChatBar; -+ } -+ -+ @Override -+ public UUID getId() { -+ return new UUID(0, 2); -+ } -+ -+ /** -+ * Gets the x position that the cursor starts at when typing chat -+ * @return cursor x -+ */ -+ public int getCursorX() { -+ return cursorX; -+ } -+ -+ /** -+ * Sets the x position that the cursor starts at when typing -+ * @param x position to set -+ * @return this -+ */ -+ public ChatBar setCursorX(int x) { -+ cursorX = x; -+ return this; -+ } -+ -+ /** -+ * Gets the y position that the cursor starts at when typing chat -+ * @return cursor y -+ */ -+ public int getCursorY() { -+ int diff = 240 - cursorY; -+ return (int) (getScreen() != null ? getScreen().getHeight() - diff : cursorY); -+ } -+ -+ /** -+ * Sets the y position that the cursor starts at when typing -+ * @param y position to set -+ * @return this -+ */ -+ public ChatBar setCursorY(int y) { -+ cursorY = y; -+ return this; -+ } -+ -+ /** -+ * Gets the default color of the text for the chat bar -+ * @return default text color -+ */ -+ public Color getTextColor() { -+ return textColor; -+ } -+ -+ /** -+ * Sets the default color of the text for the chat bar -+ * @param color to set -+ * @return this -+ */ -+ public ChatBar setTextColor(Color color) { -+ textColor = color; -+ return this; -+ } -+ -+ public void render() { -+ } -+ -+ @Override -+ public int getVersion() { -+ return super.getVersion() + 2; -+ } -+} ---- /dev/null -+++ com/prupe/mcpatcher/sky/SkyRenderer$WorldEntry.java -@@ -1,0 +1,118 @@ -+package com.prupe.mcpatcher.sky; -+ -+import com.prupe.mcpatcher.TexturePackAPI; -+import com.prupe.mcpatcher.sky.SkyRenderer$Layer; -+import java.util.ArrayList; -+import java.util.HashMap; -+import java.util.HashSet; -+import java.util.Iterator; -+import java.util.List; -+import java.util.Map; -+import java.util.Properties; -+import java.util.Set; -+import net.minecraft.src.ResourceLocation; -+import net.minecraft.src.Tessellator; -+ -+class SkyRenderer$WorldEntry { -+ private final int worldType; -+ private final List skies = new ArrayList(); -+ private final Map objects = new HashMap(); -+ private final Set textures = new HashSet(); -+ -+ SkyRenderer$WorldEntry(int worldType) { -+ this.worldType = worldType; -+ this.loadSkies(); -+ this.loadCelestialObject("sun"); -+ this.loadCelestialObject("moon_phases"); -+ } -+ -+ private void loadSkies() { -+ int i = -1; -+ -+ while (true) { -+ String path = "sky/world" + this.worldType + "/sky" + (i < 0 ? "" : String.valueOf(i)) + ".properties"; -+ ResourceLocation resource = TexturePackAPI.newMCPatcherResourceLocation(path); -+ SkyRenderer$Layer layer = SkyRenderer$Layer.create(resource); -+ -+ if (layer == null) { -+ if (i > 0) { -+ return; -+ } -+ } else if (layer.valid) { -+ SkyRenderer.access$400().fine("loaded %s", new Object[] {resource}); -+ this.skies.add(layer); -+ this.textures.add(SkyRenderer$Layer.access$300(layer)); -+ } -+ -+ ++i; -+ } -+ } -+ -+ private void loadCelestialObject(String objName) { -+ ResourceLocation textureName = new ResourceLocation("textures/environment/" + objName + ".png"); -+ ResourceLocation resource = TexturePackAPI.newMCPatcherResourceLocation("sky/world0/" + objName + ".properties"); -+ Properties properties = TexturePackAPI.getProperties(resource); -+ -+ if (properties != null) { -+ properties.setProperty("fade", "false"); -+ properties.setProperty("rotate", "true"); -+ SkyRenderer$Layer layer = new SkyRenderer$Layer(resource, properties); -+ -+ if (layer.valid) { -+ SkyRenderer.access$400().fine("using %s (%s) for the %s", new Object[] {resource, SkyRenderer$Layer.access$300(layer), objName}); -+ this.objects.put(textureName, layer); -+ } -+ } -+ } -+ -+ boolean active() { -+ return !this.skies.isEmpty() || !this.objects.isEmpty(); -+ } -+ -+ void renderAll(Tessellator tessellator) { -+ HashSet texturesNeeded = new HashSet(); -+ Iterator texturesToUnload = this.skies.iterator(); -+ -+ while (texturesToUnload.hasNext()) { -+ SkyRenderer$Layer i$ = (SkyRenderer$Layer)texturesToUnload.next(); -+ -+ if (i$.prepare()) { -+ texturesNeeded.add(SkyRenderer$Layer.access$300(i$)); -+ } -+ } -+ -+ HashSet texturesToUnload1 = new HashSet(); -+ texturesToUnload1.addAll(this.textures); -+ texturesToUnload1.removeAll(texturesNeeded); -+ Iterator i$1 = texturesToUnload1.iterator(); -+ -+ while (i$1.hasNext()) { -+ ResourceLocation layer = (ResourceLocation)i$1.next(); -+ TexturePackAPI.unloadTexture(layer); -+ } -+ -+ i$1 = this.skies.iterator(); -+ -+ while (i$1.hasNext()) { -+ SkyRenderer$Layer layer1 = (SkyRenderer$Layer)i$1.next(); -+ -+ if (layer1.brightness > 0.0F) { -+ layer1.render(tessellator); -+ SkyRenderer$Layer.clearBlendingMethod(); -+ } -+ } -+ } -+ -+ SkyRenderer$Layer getCelestialObject(ResourceLocation defaultTexture) { -+ return (SkyRenderer$Layer)this.objects.get(defaultTexture); -+ } -+ -+ void unloadTextures() { -+ Iterator i$ = this.skies.iterator(); -+ -+ while (i$.hasNext()) { -+ SkyRenderer$Layer layer = (SkyRenderer$Layer)i$.next(); -+ TexturePackAPI.unloadTexture(SkyRenderer$Layer.access$300(layer)); -+ } -+ } -+} ---- net/minecraft/src/BlockDropper.java -+++ net/minecraft/src/BlockDropper.java -@@ -3,42 +3,57 @@ - public class BlockDropper extends BlockDispenser { - private final IBehaviorDispenseItem dropperDefaultBehaviour = new BehaviorDefaultDispenseItem(); - -- protected BlockDropper(int var1) { -- super(var1); -- } -- -- public void registerIcons(IconRegister var1) { -- this.blockIcon = var1.registerIcon("furnace_side"); -- this.furnaceTopIcon = var1.registerIcon("furnace_top"); -- this.furnaceFrontIcon = var1.registerIcon(this.getTextureName() + "_front_horizontal"); -- this.field_96473_e = var1.registerIcon(this.getTextureName() + "_front_vertical"); -- } -- -- protected IBehaviorDispenseItem getBehaviorForItemStack(ItemStack var1) { -+ protected BlockDropper(int par1) { -+ super(par1); -+ } -+ -+ /** -+ * When this method is called, your block should register all the icons it needs with the given IconRegister. This is -+ * the only chance you get to register icons. -+ */ -+ public void registerIcons(IconRegister par1IconRegister) { -+ this.blockIcon = par1IconRegister.registerIcon("furnace_side"); -+ this.furnaceTopIcon = par1IconRegister.registerIcon("furnace_top"); -+ this.furnaceFrontIcon = par1IconRegister.registerIcon(this.getTextureName() + "_front_horizontal"); -+ this.field_96473_e = par1IconRegister.registerIcon(this.getTextureName() + "_front_vertical"); -+ } -+ -+ /** -+ * Returns the behavior for the given ItemStack. -+ */ -+ protected IBehaviorDispenseItem getBehaviorForItemStack(ItemStack par1ItemStack) { - return this.dropperDefaultBehaviour; - } - -- public TileEntity createNewTileEntity(World var1) { -+ /** -+ * Returns a new instance of a block's tile entity class. Called on placing the block. -+ */ -+ public TileEntity createNewTileEntity(World par1World) { - return new TileEntityDropper(); - } - -- protected void dispense(World var1, int var2, int var3, int var4) { -- BlockSourceImpl var5 = new BlockSourceImpl(var1, var2, var3, var4); -+ protected void dispense(World par1World, int par2, int par3, int par4) { -+ BlockSourceImpl var5 = new BlockSourceImpl(par1World, par2, par3, par4); - TileEntityDispenser var6 = (TileEntityDispenser)var5.getBlockTileEntity(); -- if(var6 != null) { -+ -+ if (var6 != null) { - int var7 = var6.getRandomStackFromInventory(); -- if(var7 < 0) { -- var1.playAuxSFX(1001, var2, var3, var4, 0); -+ -+ if (var7 < 0) { -+ par1World.playAuxSFX(1001, par2, par3, par4, 0); - } else { - ItemStack var8 = var6.getStackInSlot(var7); -- int var9 = var1.getBlockMetadata(var2, var3, var4) & 7; -- IInventory var10 = TileEntityHopper.getInventoryAtLocation(var1, (double)(var2 + Facing.offsetsXForSide[var9]), (double)(var3 + Facing.offsetsYForSide[var9]), (double)(var4 + Facing.offsetsZForSide[var9])); -+ int var9 = par1World.getBlockMetadata(par2, par3, par4) & 7; -+ IInventory var10 = TileEntityHopper.getInventoryAtLocation(par1World, (double)(par2 + Facing.offsetsXForSide[var9]), (double)(par3 + Facing.offsetsYForSide[var9]), (double)(par4 + Facing.offsetsZForSide[var9])); - ItemStack var11; -- if(var10 != null) { -+ -+ if (var10 != null) { - var11 = TileEntityHopper.insertStack(var10, var8.copy().splitStack(1), Facing.oppositeSide[var9]); -- if(var11 == null) { -+ -+ if (var11 == null) { - var11 = var8.copy(); -- if(--var11.stackSize == 0) { -+ -+ if (--var11.stackSize == 0) { - var11 = null; - } - } else { -@@ -46,14 +61,14 @@ - } - } else { - var11 = this.dropperDefaultBehaviour.dispense(var5, var8); -- if(var11 != null && var11.stackSize == 0) { -+ -+ if (var11 != null && var11.stackSize == 0) { - var11 = null; - } - } - - var6.setInventorySlotContents(var7, var11); - } -- - } - } - } ---- net/minecraft/src/MapCoord.java -+++ net/minecraft/src/MapCoord.java -@@ -5,13 +5,14 @@ - public byte centerX; - public byte centerZ; - public byte iconRotation; -+ - final MapData data; - -- public MapCoord(MapData var1, byte var2, byte var3, byte var4, byte var5) { -- this.data = var1; -- this.iconSize = var2; -- this.centerX = var3; -- this.centerZ = var4; -- this.iconRotation = var5; -+ public MapCoord(MapData par1MapData, byte par2, byte par3, byte par4, byte par5) { -+ this.data = par1MapData; -+ this.iconSize = par2; -+ this.centerX = par3; -+ this.centerZ = par4; -+ this.iconRotation = par5; - } - } ---- net/minecraft/src/BiomeGenJungle.java -+++ net/minecraft/src/BiomeGenJungle.java -@@ -3,33 +3,38 @@ - import java.util.Random; - - public class BiomeGenJungle extends BiomeGenBase { -- public BiomeGenJungle(int var1) { -- super(var1); -+ public BiomeGenJungle(int par1) { -+ super(par1); - this.theBiomeDecorator.treesPerChunk = 50; - this.theBiomeDecorator.grassPerChunk = 25; - this.theBiomeDecorator.flowersPerChunk = 4; -- this.J.add(new SpawnListEntry(EntityOcelot.class, 2, 1, 1)); -- this.K.add(new SpawnListEntry(EntityChicken.class, 10, 4, 4)); -- } -- -- public WorldGenerator getRandomWorldGenForTrees(Random var1) { -- return (WorldGenerator)(var1.nextInt(10) == 0 ? this.worldGeneratorBigTree : (var1.nextInt(2) == 0 ? new WorldGenShrub(3, 0) : (var1.nextInt(3) == 0 ? new WorldGenHugeTrees(false, 10 + var1.nextInt(20), 3, 3) : new WorldGenTrees(false, 4 + var1.nextInt(7), 3, 3, true)))); -- } -- -- public WorldGenerator getRandomWorldGenForGrass(Random var1) { -- return var1.nextInt(4) == 0 ? new WorldGenTallGrass(Block.tallGrass.blockID, 2) : new WorldGenTallGrass(Block.tallGrass.blockID, 1); -- } -- -- public void decorate(World var1, Random var2, int var3, int var4) { -- super.decorate(var1, var2, var3, var4); -+ this.spawnableMonsterList.add(new SpawnListEntry(EntityOcelot.class, 2, 1, 1)); -+ this.spawnableCreatureList.add(new SpawnListEntry(EntityChicken.class, 10, 4, 4)); -+ } -+ -+ /** -+ * Gets a WorldGen appropriate for this biome. -+ */ -+ public WorldGenerator getRandomWorldGenForTrees(Random par1Random) { -+ return (WorldGenerator)(par1Random.nextInt(10) == 0 ? this.worldGeneratorBigTree : (par1Random.nextInt(2) == 0 ? new WorldGenShrub(3, 0) : (par1Random.nextInt(3) == 0 ? new WorldGenHugeTrees(false, 10 + par1Random.nextInt(20), 3, 3) : new WorldGenTrees(false, 4 + par1Random.nextInt(7), 3, 3, true)))); -+ } -+ -+ /** -+ * Gets a WorldGen appropriate for this biome. -+ */ -+ public WorldGenerator getRandomWorldGenForGrass(Random par1Random) { -+ return par1Random.nextInt(4) == 0 ? new WorldGenTallGrass(Block.tallGrass.blockID, 2) : new WorldGenTallGrass(Block.tallGrass.blockID, 1); -+ } -+ -+ public void decorate(World par1World, Random par2Random, int par3, int par4) { -+ super.decorate(par1World, par2Random, par3, par4); - WorldGenVines var5 = new WorldGenVines(); - -- for(int var6 = 0; var6 < 50; ++var6) { -- int var7 = var3 + var2.nextInt(16) + 8; -+ for (int var6 = 0; var6 < 50; ++var6) { -+ int var7 = par3 + par2Random.nextInt(16) + 8; - byte var8 = 64; -- int var9 = var4 + var2.nextInt(16) + 8; -- var5.generate(var1, var2, var7, var8, var9); -+ int var9 = par4 + par2Random.nextInt(16) + 8; -+ var5.generate(par1World, par2Random, var7, var8, var9); - } -- - } - } ---- /dev/null -+++ org/spoutcraft/client/inventory/SimpleShapedRecipe.java -@@ -1,0 +1,75 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.client.inventory; -+ -+import java.util.HashMap; -+ -+import net.minecraft.src.CraftingManager; -+ -+import org.spoutcraft.api.inventory.ItemStack; -+import org.spoutcraft.api.inventory.ShapedRecipe; -+import org.spoutcraft.api.material.Material; -+ -+public class SimpleShapedRecipe extends ShapedRecipe implements SpoutcraftRecipe { -+ public SimpleShapedRecipe(ItemStack result) { -+ super(result); -+ } -+ -+ public static SimpleShapedRecipe fromSpoutRecipe(ShapedRecipe recipe) { -+ if (recipe instanceof SimpleShapedRecipe) { -+ return (SimpleShapedRecipe) recipe; -+ } -+ SimpleShapedRecipe ret = new SimpleShapedRecipe(recipe.getResult()); -+ String[] shape = recipe.getShape(); -+ ret.shape(shape); -+ for (char c : recipe.getIngredientMap().keySet()) { -+ ret.setIngredient(c, recipe.getIngredientMap().get(c)); -+ } -+ return ret; -+ } -+ -+ public void addToCraftingManager() { -+ Object[] data; -+ String[] shape = this.getShape(); -+ HashMap ingred = this.getIngredientMap(); -+ int datalen = shape.length; -+ datalen += ingred.size() * 2; -+ int i = 0; -+ data = new Object[datalen]; -+ for (; i < shape.length; i++) { -+ data[i] = shape[i]; -+ } -+ for (char c : ingred.keySet()) { -+ data[i] = c; -+ i++; -+ Material mdata = ingred.get(c); -+ -+ int id = mdata.getRawId(); -+ int dmg = mdata.getRawData(); -+ -+ data[i] = new net.minecraft.src.ItemStack(id, 1, dmg); -+ i++; -+ } -+ int id = this.getResult().getTypeId(); -+ int amount = this.getResult().getAmount(); -+ short durability = this.getResult().getDurability(); -+ CraftingManager.getInstance().addRecipe(new net.minecraft.src.ItemStack(id, amount, durability), data); -+ } -+} ---- net/minecraft/src/EntityFX.java -+++ net/minecraft/src/EntityFX.java -@@ -2,72 +2,99 @@ - - public class EntityFX extends Entity { - protected int particleTextureIndexX; -- protected int particleTextureIndexY; -+ protected int particleTextureIndexY; - protected float particleTextureJitterX; - protected float particleTextureJitterY; -- protected int particleAge; -- protected int particleMaxAge; -- protected float particleScale; -- protected float particleGravity; -- protected float particleRed; -- protected float particleGreen; -- protected float particleBlue; -+ // Spout Start - protected to public -+ public int particleAge; -+ public int particleMaxAge; -+ public float particleScale; -+ public float particleGravity; -+ // Spout End -+ -+ /** The red amount of color. Used as a percentage, 1.0 = 255 and 0.0 = 0. */ -+ // Spout Start - protected to public -+ public float particleRed; -+ // Spout End -+ -+ /** -+ * The green amount of color. Used as a percentage, 1.0 = 255 and 0.0 = 0. -+ */ -+ // Spout Start - protected to public -+ public float particleGreen; -+ // Spout End -+ -+ /** -+ * The blue amount of color. Used as a percentage, 1.0 = 255 and 0.0 = 0. -+ */ -+ // Spout Start - protected to public -+ public float particleBlue; -+ // Spout End -+ -+ /** Particle alpha */ - protected float particleAlpha; -+ -+ /** The icon field from which the given particle pulls its texture. */ - protected Icon particleIcon; - public static double interpPosX; - public static double interpPosY; - public static double interpPosZ; - -- protected EntityFX(World var1, double var2, double var4, double var6) { -- super(var1); -- this.particleAlpha = 1.0F; -+ // Spout Start - protected to public -+ public EntityFX(World par1World, double par2, double par4, double par6) { -+ // Spout End -+ super(par1World); -+ this.particleAlpha = 1.0F; - this.setSize(0.2F, 0.2F); - this.yOffset = this.height / 2.0F; -- this.setPosition(var2, var4, var6); -- this.lastTickPosX = var2; -- this.lastTickPosY = var4; -- this.lastTickPosZ = var6; -+ this.setPosition(par2, par4, par6); -+ this.lastTickPosX = par2; -+ this.lastTickPosY = par4; -+ this.lastTickPosZ = par6; - this.particleRed = this.particleGreen = this.particleBlue = 1.0F; -- this.particleTextureJitterX = this.ab.nextFloat() * 3.0F; -- this.particleTextureJitterY = this.ab.nextFloat() * 3.0F; -- this.particleScale = (this.ab.nextFloat() * 0.5F + 0.5F) * 2.0F; -- this.particleMaxAge = (int)(4.0F / (this.ab.nextFloat() * 0.9F + 0.1F)); -+ this.particleTextureJitterX = this.rand.nextFloat() * 3.0F; -+ this.particleTextureJitterY = this.rand.nextFloat() * 3.0F; -+ this.particleScale = (this.rand.nextFloat() * 0.5F + 0.5F) * 2.0F; -+ this.particleMaxAge = (int)(4.0F / (this.rand.nextFloat() * 0.9F + 0.1F)); - this.particleAge = 0; - } - -- public EntityFX(World var1, double var2, double var4, double var6, double var8, double var10, double var12) { -- this(var1, var2, var4, var6); -- this.motionX = var8 + (double)((float)(Math.random() * 2.0D - 1.0D) * 0.4F); -- this.motionY = var10 + (double)((float)(Math.random() * 2.0D - 1.0D) * 0.4F); -- this.motionZ = var12 + (double)((float)(Math.random() * 2.0D - 1.0D) * 0.4F); -+ public EntityFX(World par1World, double par2, double par4, double par6, double par8, double par10, double par12) { -+ this(par1World, par2, par4, par6); -+ this.motionX = par8 + (double)((float)(Math.random() * 2.0D - 1.0D) * 0.4F); -+ this.motionY = par10 + (double)((float)(Math.random() * 2.0D - 1.0D) * 0.4F); -+ this.motionZ = par12 + (double)((float)(Math.random() * 2.0D - 1.0D) * 0.4F); - float var14 = (float)(Math.random() + Math.random() + 1.0D) * 0.15F; - float var15 = MathHelper.sqrt_double(this.motionX * this.motionX + this.motionY * this.motionY + this.motionZ * this.motionZ); -- this.motionX = this.motionX / (double)var15 * (double)var14 * (double)0.4F; -- this.motionY = this.motionY / (double)var15 * (double)var14 * (double)0.4F + (double)0.1F; -- this.motionZ = this.motionZ / (double)var15 * (double)var14 * (double)0.4F; -- } -- -- public EntityFX multiplyVelocity(float var1) { -- this.motionX *= (double)var1; -- this.motionY = (this.motionY - (double)0.1F) * (double)var1 + (double)0.1F; -- this.motionZ *= (double)var1; -- return this; -- } -- -- public EntityFX multipleParticleScaleBy(float var1) { -- this.setSize(0.2F * var1, 0.2F * var1); -- this.particleScale *= var1; -- return this; -- } -- -- public void setRBGColorF(float var1, float var2, float var3) { -- this.particleRed = var1; -- this.particleGreen = var2; -- this.particleBlue = var3; -- } -- -- public void setAlphaF(float var1) { -- this.particleAlpha = var1; -+ this.motionX = this.motionX / (double)var15 * (double)var14 * 0.4000000059604645D; -+ this.motionY = this.motionY / (double)var15 * (double)var14 * 0.4000000059604645D + 0.10000000149011612D; -+ this.motionZ = this.motionZ / (double)var15 * (double)var14 * 0.4000000059604645D; -+ } -+ -+ public EntityFX multiplyVelocity(float par1) { -+ this.motionX *= (double)par1; -+ this.motionY = (this.motionY - 0.10000000149011612D) * (double)par1 + 0.10000000149011612D; -+ this.motionZ *= (double)par1; -+ return this; -+ } -+ -+ public EntityFX multipleParticleScaleBy(float par1) { -+ this.setSize(0.2F * par1, 0.2F * par1); -+ this.particleScale *= par1; -+ return this; -+ } -+ -+ public void setRBGColorF(float par1, float par2, float par3) { -+ this.particleRed = par1; -+ this.particleGreen = par2; -+ this.particleBlue = par3; -+ } -+ -+ /** -+ * Sets the particle alpha (float) -+ */ -+ public void setAlphaF(float par1) { -+ this.particleAlpha = par1; - } - - public float getRedColorF() { -@@ -82,93 +109,110 @@ - return this.particleBlue; - } - -+ /** -+ * returns if this entity triggers Block.onEntityWalking on the blocks they walk on. used for spiders and wolves to -+ * prevent them from trampling crops -+ */ - protected boolean canTriggerWalking() { - return false; - } - -- protected void entityInit() { -- } -+ protected void entityInit() {} - -+ /** -+ * Called to update the entity's position/logic. -+ */ - public void onUpdate() { - this.prevPosX = this.posX; - this.prevPosY = this.posY; - this.prevPosZ = this.posZ; -- if(this.particleAge++ >= this.particleMaxAge) { -+ -+ if (this.particleAge++ >= this.particleMaxAge) { - this.setDead(); - } - - this.motionY -= 0.04D * (double)this.particleGravity; - this.moveEntity(this.motionX, this.motionY, this.motionZ); -- this.motionX *= (double)0.98F; -- this.motionY *= (double)0.98F; -- this.motionZ *= (double)0.98F; -- if(this.onGround) { -- this.motionX *= (double)0.7F; -- this.motionZ *= (double)0.7F; -+ this.motionX *= 0.9800000190734863D; -+ this.motionY *= 0.9800000190734863D; -+ this.motionZ *= 0.9800000190734863D; -+ -+ if (this.onGround) { -+ this.motionX *= 0.699999988079071D; -+ this.motionZ *= 0.699999988079071D; - } -- - } - -- public void renderParticle(Tessellator var1, float var2, float var3, float var4, float var5, float var6, float var7) { -+ public void renderParticle(Tessellator par1Tessellator, float par2, float par3, float par4, float par5, float par6, float par7) { - float var8 = (float)this.particleTextureIndexX / 16.0F; -- float var9 = var8 + 0.999F / 16.0F; -+ float var9 = var8 + 0.0624375F; - float var10 = (float)this.particleTextureIndexY / 16.0F; -- float var11 = var10 + 0.999F / 16.0F; -+ float var11 = var10 + 0.0624375F; - float var12 = 0.1F * this.particleScale; -- if(this.particleIcon != null) { -+ -+ if (this.particleIcon != null) { - var8 = this.particleIcon.getMinU(); - var9 = this.particleIcon.getMaxU(); - var10 = this.particleIcon.getMinV(); - var11 = this.particleIcon.getMaxV(); - } - -- float var13 = (float)(this.prevPosX + (this.posX - this.prevPosX) * (double)var2 - interpPosX); -- float var14 = (float)(this.prevPosY + (this.posY - this.prevPosY) * (double)var2 - interpPosY); -- float var15 = (float)(this.prevPosZ + (this.posZ - this.prevPosZ) * (double)var2 - interpPosZ); -+ float var13 = (float)(this.prevPosX + (this.posX - this.prevPosX) * (double)par2 - interpPosX); -+ float var14 = (float)(this.prevPosY + (this.posY - this.prevPosY) * (double)par2 - interpPosY); -+ float var15 = (float)(this.prevPosZ + (this.posZ - this.prevPosZ) * (double)par2 - interpPosZ); - float var16 = 1.0F; -- var1.setColorRGBA_F(this.particleRed * var16, this.particleGreen * var16, this.particleBlue * var16, this.particleAlpha); -- var1.addVertexWithUV((double)(var13 - var3 * var12 - var6 * var12), (double)(var14 - var4 * var12), (double)(var15 - var5 * var12 - var7 * var12), (double)var9, (double)var11); -- var1.addVertexWithUV((double)(var13 - var3 * var12 + var6 * var12), (double)(var14 + var4 * var12), (double)(var15 - var5 * var12 + var7 * var12), (double)var9, (double)var10); -- var1.addVertexWithUV((double)(var13 + var3 * var12 + var6 * var12), (double)(var14 + var4 * var12), (double)(var15 + var5 * var12 + var7 * var12), (double)var8, (double)var10); -- var1.addVertexWithUV((double)(var13 + var3 * var12 - var6 * var12), (double)(var14 - var4 * var12), (double)(var15 + var5 * var12 - var7 * var12), (double)var8, (double)var11); -+ par1Tessellator.setColorRGBA_F(this.particleRed * var16, this.particleGreen * var16, this.particleBlue * var16, this.particleAlpha); -+ par1Tessellator.addVertexWithUV((double)(var13 - par3 * var12 - par6 * var12), (double)(var14 - par4 * var12), (double)(var15 - par5 * var12 - par7 * var12), (double)var9, (double)var11); -+ par1Tessellator.addVertexWithUV((double)(var13 - par3 * var12 + par6 * var12), (double)(var14 + par4 * var12), (double)(var15 - par5 * var12 + par7 * var12), (double)var9, (double)var10); -+ par1Tessellator.addVertexWithUV((double)(var13 + par3 * var12 + par6 * var12), (double)(var14 + par4 * var12), (double)(var15 + par5 * var12 + par7 * var12), (double)var8, (double)var10); -+ par1Tessellator.addVertexWithUV((double)(var13 + par3 * var12 - par6 * var12), (double)(var14 - par4 * var12), (double)(var15 + par5 * var12 - par7 * var12), (double)var8, (double)var11); - } - - public int getFXLayer() { - return 0; - } - -- public void writeEntityToNBT(NBTTagCompound var1) { -- } -- -- public void readEntityFromNBT(NBTTagCompound var1) { -- } -- -- public void setParticleIcon(Icon var1) { -- if(this.getFXLayer() == 1) { -- this.particleIcon = var1; -+ /** -+ * (abstract) Protected helper method to write subclass entity data to NBT. -+ */ -+ public void writeEntityToNBT(NBTTagCompound par1NBTTagCompound) {} -+ -+ /** -+ * (abstract) Protected helper method to read subclass entity data from NBT. -+ */ -+ public void readEntityFromNBT(NBTTagCompound par1NBTTagCompound) {} -+ -+ public void setParticleIcon(Icon par1Icon) { -+ if (this.getFXLayer() == 1) { -+ this.particleIcon = par1Icon; - } else { -- if(this.getFXLayer() != 2) { -+ if (this.getFXLayer() != 2) { - throw new RuntimeException("Invalid call to Particle.setTex, use coordinate methods"); - } - -- this.particleIcon = var1; -+ this.particleIcon = par1Icon; - } -- - } - -- public void setParticleTextureIndex(int var1) { -- if(this.getFXLayer() != 0) { -+ /** -+ * Public method to set private field particleTextureIndex. -+ */ -+ public void setParticleTextureIndex(int par1) { -+ if (this.getFXLayer() != 0) { - throw new RuntimeException("Invalid call to Particle.setMiscTex"); - } else { -- this.particleTextureIndexX = var1 % 16; -- this.particleTextureIndexY = var1 / 16; -+ this.particleTextureIndexX = par1 % 16; -+ this.particleTextureIndexY = par1 / 16; - } - } - - public void nextTextureIndexX() { -- ++this.particleTextureIndexX; -+ ++this.particleTextureIndexX; - } - -+ /** -+ * If returns false, the item will not inflict any damage against entities. -+ */ - public boolean canAttackWithItem() { - return false; - } ---- net/minecraft/src/BlockBreakable.java -+++ net/minecraft/src/BlockBreakable.java -@@ -2,24 +2,36 @@ - - public class BlockBreakable extends Block { - private boolean localFlag; -- private String b; -+ private String breakableBlockIcon; - -- protected BlockBreakable(int var1, String var2, Material var3, boolean var4) { -- super(var1, var3); -- this.localFlag = var4; -- this.b = var2; -+ protected BlockBreakable(int par1, String par2Str, Material par3Material, boolean par4) { -+ super(par1, par3Material); -+ this.localFlag = par4; -+ this.breakableBlockIcon = par2Str; - } - -+ /** -+ * Is this block (a) opaque and (b) a full 1m cube? This determines whether or not to render the shared face of two -+ * adjacent blocks and also whether the player can attach torches, redstone wire, etc to this block. -+ */ - public boolean isOpaqueCube() { - return false; - } - -- public boolean shouldSideBeRendered(IBlockAccess var1, int var2, int var3, int var4, int var5) { -- int var6 = var1.getBlockId(var2, var3, var4); -- return !this.localFlag && var6 == this.blockID ? false : super.shouldSideBeRendered(var1, var2, var3, var4, var5); -+ /** -+ * Returns true if the given side of this block type should be rendered, if the adjacent block is at the given -+ * coordinates. Args: blockAccess, x, y, z, side -+ */ -+ public boolean shouldSideBeRendered(IBlockAccess par1IBlockAccess, int par2, int par3, int par4, int par5) { -+ int var6 = par1IBlockAccess.getBlockId(par2, par3, par4); -+ return !this.localFlag && var6 == this.blockID ? false : super.shouldSideBeRendered(par1IBlockAccess, par2, par3, par4, par5); - } - -- public void registerIcons(IconRegister var1) { -- this.blockIcon = var1.registerIcon(this.b); -+ /** -+ * When this method is called, your block should register all the icons it needs with the given IconRegister. This is -+ * the only chance you get to register icons. -+ */ -+ public void registerIcons(IconRegister par1IconRegister) { -+ this.blockIcon = par1IconRegister.registerIcon(this.breakableBlockIcon); - } - } ---- net/minecraft/src/CommandDifficulty.java -+++ net/minecraft/src/CommandDifficulty.java -@@ -4,35 +4,44 @@ - import net.minecraft.server.MinecraftServer; - - public class CommandDifficulty extends CommandBase { -- private static final String[] a = new String[]{"options.difficulty.peaceful", "options.difficulty.easy", "options.difficulty.normal", "options.difficulty.hard"}; -+ private static final String[] difficulties = new String[] {"options.difficulty.peaceful", "options.difficulty.easy", "options.difficulty.normal", "options.difficulty.hard"}; - - public String getCommandName() { - return "difficulty"; - } - -+ /** -+ * Return the required permission level for this command. -+ */ - public int getRequiredPermissionLevel() { - return 2; - } - -- public String getCommandUsage(ICommandSender var1) { -+ public String getCommandUsage(ICommandSender par1ICommandSender) { - return "commands.difficulty.usage"; - } - -- public void processCommand(ICommandSender var1, String[] var2) { -- if(var2.length > 0) { -- int var3 = this.getDifficultyForName(var1, var2[0]); -+ public void processCommand(ICommandSender par1ICommandSender, String[] par2ArrayOfStr) { -+ if (par2ArrayOfStr.length > 0) { -+ int var3 = this.getDifficultyForName(par1ICommandSender, par2ArrayOfStr[0]); - MinecraftServer.getServer().setDifficultyForAllWorlds(var3); -- notifyAdmins(var1, "commands.difficulty.success", new Object[]{ChatMessageComponent.createFromTranslationKey(a[var3])}); -+ notifyAdmins(par1ICommandSender, "commands.difficulty.success", new Object[] {ChatMessageComponent.createFromTranslationKey(difficulties[var3])}); - } else { - throw new WrongUsageException("commands.difficulty.usage", new Object[0]); - } - } - -- protected int getDifficultyForName(ICommandSender var1, String var2) { -- return !var2.equalsIgnoreCase("peaceful") && !var2.equalsIgnoreCase("p") ? (!var2.equalsIgnoreCase("easy") && !var2.equalsIgnoreCase("e") ? (!var2.equalsIgnoreCase("normal") && !var2.equalsIgnoreCase("n") ? (!var2.equalsIgnoreCase("hard") && !var2.equalsIgnoreCase("h") ? parseIntBounded(var1, var2, 0, 3) : 3) : 2) : 1) : 0; -+ /** -+ * Return the difficulty value for the specified string. -+ */ -+ protected int getDifficultyForName(ICommandSender par1ICommandSender, String par2Str) { -+ return !par2Str.equalsIgnoreCase("peaceful") && !par2Str.equalsIgnoreCase("p") ? (!par2Str.equalsIgnoreCase("easy") && !par2Str.equalsIgnoreCase("e") ? (!par2Str.equalsIgnoreCase("normal") && !par2Str.equalsIgnoreCase("n") ? (!par2Str.equalsIgnoreCase("hard") && !par2Str.equalsIgnoreCase("h") ? parseIntBounded(par1ICommandSender, par2Str, 0, 3) : 3) : 2) : 1) : 0; - } - -- public List addTabCompletionOptions(ICommandSender var1, String[] var2) { -- return var2.length == 1 ? getListOfStringsMatchingLastWord(var2, new String[]{"peaceful", "easy", "normal", "hard"}) : null; -+ /** -+ * Adds the strings available in this command to the given list of tab completion options. -+ */ -+ public List addTabCompletionOptions(ICommandSender par1ICommandSender, String[] par2ArrayOfStr) { -+ return par2ArrayOfStr.length == 1 ? getListOfStringsMatchingLastWord(par2ArrayOfStr, new String[] {"peaceful", "easy", "normal", "hard"}): null; - } - } ---- /dev/null -+++ com/prupe/mcpatcher/hd/MipmapHelper.java -@@ -1,0 +1,488 @@ -+package com.prupe.mcpatcher.hd; -+ -+import com.prupe.mcpatcher.Config; -+import com.prupe.mcpatcher.MCLogger; -+import com.prupe.mcpatcher.TexturePackAPI; -+import java.awt.Graphics2D; -+import java.awt.image.BufferedImage; -+import java.awt.image.DataBuffer; -+import java.awt.image.DataBufferByte; -+import java.awt.image.DataBufferInt; -+import java.awt.image.ImageObserver; -+import java.lang.ref.Reference; -+import java.lang.ref.SoftReference; -+import java.math.BigInteger; -+import java.nio.ByteBuffer; -+import java.nio.ByteOrder; -+import java.nio.IntBuffer; -+import java.util.ArrayList; -+import java.util.Arrays; -+import java.util.HashMap; -+import java.util.Iterator; -+import java.util.Map; -+import java.util.Properties; -+import java.util.Map.Entry; -+import net.minecraft.src.ResourceLocation; -+import net.minecraft.src.TextureAtlasSprite; -+import org.lwjgl.opengl.GL11; -+import org.lwjgl.opengl.GL14; -+import org.lwjgl.opengl.GL12; -+import org.lwjgl.opengl.GLContext; -+import org.lwjgl.util.glu.GLU; -+ -+public class MipmapHelper { -+ private static final MCLogger logger = MCLogger.getLogger("Mipmap"); -+ private static final ResourceLocation MIPMAP_PROPERTIES = TexturePackAPI.newMCPatcherResourceLocation("mipmap.properties"); -+ private static final int TEX_FORMAT = 32993; -+ private static final int TEX_DATA_TYPE = 33639; -+ private static final int MIN_ALPHA = 26; -+ private static final int MAX_ALPHA = 229; -+ private static final boolean mipmapSupported = GLContext.getCapabilities().OpenGL12; -+ static final boolean mipmapEnabled = Config.getBoolean("Extended HD", "mipmap", false); -+ static final int maxMipmapLevel = Config.getInt("Extended HD", "maxMipmapLevel", 3); -+ private static final boolean useMipmap = mipmapSupported && mipmapEnabled && maxMipmapLevel > 0; -+ private static final int mipmapAlignment = (1 << Config.getInt("Extended HD", "mipmapAlignment", 3)) - 1; -+ private static final boolean anisoSupported = GLContext.getCapabilities().GL_EXT_texture_filter_anisotropic; -+ static final int anisoLevel; -+ private static final int anisoMax; -+ private static final boolean lodSupported; -+ private static final int lodBias; -+ private static final Map> imagePool = new HashMap(); -+ private static final Map> bufferPool = new HashMap(); -+ private static final Map mipmapType = new HashMap(); -+ -+ private static void setupTexture(int width, int height, boolean blur, boolean clamp, String textureName) { -+ int mipmaps = useMipmapsForTexture(textureName) ? getMipmapLevels(width, height, 1) : 0; -+ logger.finer("setupTexture(%s) %dx%d %d mipmaps", new Object[] {textureName, Integer.valueOf(width), Integer.valueOf(height), Integer.valueOf(mipmaps)}); -+ int magFilter = blur ? 9729 : 9728; -+ int minFilter = mipmaps > 0 ? 9986 : magFilter; -+ int wrap = clamp ? 10496 : 10497; -+ -+ if (mipmaps > 0) { -+ GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL12.GL_TEXTURE_MAX_LEVEL, mipmaps); -+ checkGLError("%s: set GL_TEXTURE_MAX_LEVEL = %d", new Object[] {textureName, Integer.valueOf(mipmaps)}); -+ -+ if (anisoSupported && anisoLevel > 1) { -+ GL11.glTexParameterf(GL11.GL_TEXTURE_2D, 34046, (float)anisoLevel); -+ checkGLError("%s: set GL_TEXTURE_MAX_ANISOTROPY_EXT = %f", new Object[] {textureName, Integer.valueOf(anisoLevel)}); -+ } -+ -+ if (lodSupported) { -+ GL11.glTexEnvi(GL14.GL_TEXTURE_FILTER_CONTROL, GL14.GL_TEXTURE_LOD_BIAS, lodBias); -+ checkGLError("%s: set GL_TEXTURE_LOD_BIAS_EXT = %d", new Object[] {textureName, Integer.valueOf(lodBias)}); -+ } -+ } -+ -+ GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MIN_FILTER, minFilter); -+ GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MAG_FILTER, magFilter); -+ GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_WRAP_S, wrap); -+ GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_WRAP_T, wrap); -+ -+ for (int level = 0; level <= mipmaps; ++level) { -+ GL11.glTexImage2D(GL11.GL_TEXTURE_2D, level, GL11.GL_RGBA, width, height, 0, GL12.GL_BGRA, GL12.GL_UNSIGNED_INT_8_8_8_8_REV, (IntBuffer)null); -+ checkGLError("%s: glTexImage2D %dx%d level %d", new Object[] {textureName, Integer.valueOf(width), Integer.valueOf(height), Integer.valueOf(level)}); -+ width >>= 1; -+ height >>= 1; -+ } -+ } -+ -+ public static void setupTexture(int[] rgb, int width, int height, int x, int y, boolean blur, boolean clamp, String textureName) { -+ setupTexture(width, height, blur, clamp, textureName); -+ copySubTexture(rgb, width, height, x, y, textureName); -+ } -+ -+ public static int setupTexture(int glTexture, BufferedImage image, boolean blur, boolean clamp, ResourceLocation textureName) { -+ int width = image.getWidth(); -+ int height = image.getHeight(); -+ GL11.glBindTexture(GL11.GL_TEXTURE_2D, glTexture); -+ logger.finer("setupTexture(%s, %d, %dx%d, %s, %s)", new Object[] {textureName, Integer.valueOf(glTexture), Integer.valueOf(width), Integer.valueOf(height), Boolean.valueOf(blur), Boolean.valueOf(clamp)}); -+ int[] rgb = new int[width * height]; -+ image.getRGB(0, 0, width, height, rgb, 0, width); -+ setupTexture(rgb, width, height, 0, 0, blur, clamp, textureName.getResourcePath()); -+ return glTexture; -+ } -+ -+ public static void setupTexture(int glTexture, int width, int height, String textureName) { -+ GL11.glBindTexture(GL11.GL_TEXTURE_2D, glTexture); -+ logger.finer("setupTexture(tilesheet %s, %d, %dx%d)", new Object[] {textureName, Integer.valueOf(glTexture), Integer.valueOf(width), Integer.valueOf(height)}); -+ setupTexture(width, height, false, false, textureName); -+ } -+ -+ public static void copySubTexture(int[] rgb, int width, int height, int x, int y, String textureName) { -+ if (rgb == null) { -+ logger.error("copySubTexture %s %d,%d %dx%d: rgb data is null", new Object[] {textureName, Integer.valueOf(x), Integer.valueOf(y), Integer.valueOf(width), Integer.valueOf(height)}); -+ } else { -+ IntBuffer buffer = getPooledBuffer(width * height * 4).asIntBuffer(); -+ buffer.put(rgb).position(0); -+ int mipmaps = getMipmapLevelsForCurrentTexture(); -+ logger.finest("copySubTexture %s %d,%d %dx%d %d mipmaps", new Object[] {textureName, Integer.valueOf(x), Integer.valueOf(y), Integer.valueOf(width), Integer.valueOf(height), Integer.valueOf(mipmaps)}); -+ -+ for (int level = 0; width > 0 && height > 0; height >>= 1) { -+ GL11.glTexSubImage2D(GL11.GL_TEXTURE_2D, level, x, y, width, height, GL12.GL_BGRA, GL12.GL_UNSIGNED_INT_8_8_8_8_REV, buffer); -+ checkGLError("%s: glTexSubImage2D(%d, %d, %d, %d, %d)", new Object[] {textureName, Integer.valueOf(level), Integer.valueOf(x), Integer.valueOf(y), Integer.valueOf(width), Integer.valueOf(height)}); -+ -+ if (level >= mipmaps) { -+ break; -+ } -+ -+ IntBuffer newBuffer = getPooledBuffer(width * height).asIntBuffer(); -+ scaleHalf(buffer, width, height, newBuffer, 0); -+ buffer = newBuffer; -+ ++level; -+ x >>= 1; -+ y >>= 1; -+ width >>= 1; -+ } -+ } -+ } -+ -+ public static void copySubTexture(TextureAtlasSprite texture, int index) { -+ int width = texture.getIconWidth(); -+ int height = texture.getIconHeight(); -+ int x; -+ int y; -+ -+ if (texture.mipmaps == null || texture.mipmaps.size() != texture.framesTextureData.size()) { -+ texture.mipmaps = new ArrayList(texture.framesTextureData.size()); -+ x = getMipmapLevelsForCurrentTexture(); -+ -+ if (x > 0) { -+ logger.fine("generating %d mipmaps for tile %s", new Object[] {Integer.valueOf(x), texture.getIconName()}); -+ } -+ -+ for (y = 0; y < texture.framesTextureData.size(); ++y) { -+ texture.mipmaps.add(generateMipmaps((int[])texture.framesTextureData.get(y), width, height, x)); -+ } -+ } -+ -+ x = texture.getOriginX(); -+ y = texture.getOriginY(); -+ IntBuffer[] mipmapData = (IntBuffer[])texture.mipmaps.get(index); -+ -+ if (mipmapData != null) { -+ for (int level = 0; level < mipmapData.length; ++level) { -+ GL11.glTexSubImage2D(GL11.GL_TEXTURE_2D, level, x, y, width, height, GL12.GL_BGRA, GL12.GL_UNSIGNED_INT_8_8_8_8_REV, mipmapData[level]); -+ x >>= 1; -+ y >>= 1; -+ width >>= 1; -+ height >>= 1; -+ } -+ } -+ } -+ -+ private static IntBuffer[] generateMipmaps(int[] rgb, int width, int height, int mipmaps) { -+ if (rgb == null) { -+ return null; -+ } else { -+ ArrayList mipmapData = new ArrayList(); -+ IntBuffer buffer = newIntBuffer(width * height * 4); -+ buffer.put(rgb).position(0); -+ int level = 0; -+ -+ while (true) { -+ mipmapData.add(buffer); -+ -+ if (width <= 0 || height <= 0 || level >= mipmaps) { -+ return (IntBuffer[])mipmapData.toArray(new IntBuffer[mipmapData.size()]); -+ } -+ -+ IntBuffer newBuffer = newIntBuffer(width * height); -+ scaleHalf(buffer, width, height, newBuffer, 0); -+ buffer = newBuffer; -+ ++level; -+ width >>= 1; -+ height >>= 1; -+ } -+ } -+ } -+ -+ static BufferedImage fixTransparency(ResourceLocation name, BufferedImage image) { -+ if (image == null) { -+ return image; -+ } else { -+ long s1 = System.currentTimeMillis(); -+ image = convertToARGB(image); -+ int width = image.getWidth(); -+ int height = image.getHeight(); -+ IntBuffer buffer = getImageAsARGBIntBuffer(image); -+ IntBuffer scaledBuffer = buffer; -+ label33: -+ -+ while (width % 2 == 0 && height % 2 == 0) { -+ int s2 = 0; -+ -+ while (true) { -+ if (s2 >= scaledBuffer.limit()) { -+ break label33; -+ } -+ -+ if (scaledBuffer.get(s2) >>> 24 == 0) { -+ IntBuffer newBuffer = getPooledBuffer(width * height).asIntBuffer(); -+ scaleHalf(scaledBuffer, width, height, newBuffer, 8); -+ scaledBuffer = newBuffer; -+ width >>= 1; -+ height >>= 1; -+ break; -+ } -+ -+ ++s2; -+ } -+ } -+ -+ long var12 = System.currentTimeMillis(); -+ -+ if (scaledBuffer != buffer) { -+ setBackgroundColor(buffer, image.getWidth(), image.getHeight(), scaledBuffer, image.getWidth() / width); -+ } -+ -+ long s3 = System.currentTimeMillis(); -+ logger.finer("bg fix (tile %s): scaling %dms, setbg %dms", new Object[] {name, Long.valueOf(var12 - s1), Long.valueOf(s3 - var12)}); -+ return image; -+ } -+ } -+ -+ static void reset() { -+ mipmapType.clear(); -+ mipmapType.put("terrain", Boolean.valueOf(true)); -+ mipmapType.put("items", Boolean.valueOf(false)); -+ Properties properties = TexturePackAPI.getProperties(MIPMAP_PROPERTIES); -+ -+ if (properties != null) { -+ Iterator i$ = properties.entrySet().iterator(); -+ -+ while (i$.hasNext()) { -+ Entry entry = (Entry)i$.next(); -+ -+ if (entry.getKey() instanceof String && entry.getValue() instanceof String) { -+ String key = ((String)entry.getKey()).trim(); -+ boolean value = Boolean.parseBoolean(((String)entry.getValue()).trim().toLowerCase()); -+ -+ if (key.endsWith(".png")) { -+ mipmapType.put(key, Boolean.valueOf(value)); -+ } -+ } -+ } -+ } -+ } -+ -+ static boolean useMipmapsForTexture(String texture) { -+ return useMipmap && texture != null ? (mipmapType.containsKey(texture) ? ((Boolean)mipmapType.get(texture)).booleanValue() : !texture.contains("item") && !texture.startsWith("textures/colormap/") && !texture.startsWith("textures/environment/") && !texture.startsWith("textures/font/") && !texture.startsWith("textures/gui/") && !texture.startsWith("textures/map/") && !texture.startsWith("textures/misc/") && !texture.startsWith("mcpatcher/colormap/") && !texture.startsWith("mcpatcher/cit/") && !texture.startsWith("mcpatcher/dial/") && !texture.startsWith("mcpatcher/font/") && !texture.startsWith("mcpatcher/lightmap/") && !texture.startsWith("mcpatcher/sky/")) : false; -+ } -+ -+ static int getMipmapLevelsForCurrentTexture() { -+ int filter = GL11.glGetTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MIN_FILTER); -+ return filter != 9986 && filter != 9984 ? 0 : Math.min(maxMipmapLevel, GL11.glGetTexParameteri(GL11.GL_TEXTURE_2D, GL12.GL_TEXTURE_MAX_LEVEL)); -+ } -+ -+ private static int gcd(int a, int b) { -+ return BigInteger.valueOf((long)a).gcd(BigInteger.valueOf((long)b)).intValue(); -+ } -+ -+ private static int getMipmapLevels(int width, int height, int minSize) { -+ int size = gcd(width, height); -+ int mipmap; -+ -+ for (mipmap = 0; size >= minSize && (size & 1) == 0 && mipmap < maxMipmapLevel; ++mipmap) { -+ size >>= 1; -+ } -+ -+ return mipmap; -+ } -+ -+ private static BufferedImage getPooledImage(int width, int height, int index) { -+ String key = String.format("%dx%d#%d", new Object[] {Integer.valueOf(width), Integer.valueOf(height), Integer.valueOf(index)}); -+ Reference ref = (Reference)imagePool.get(key); -+ BufferedImage image = ref == null ? null : (BufferedImage)ref.get(); -+ -+ if (image == null) { -+ image = new BufferedImage(width, height, 2); -+ imagePool.put(key, new SoftReference(image)); -+ } -+ -+ return image; -+ } -+ -+ private static IntBuffer newIntBuffer(int size) { -+ ByteBuffer buffer = ByteBuffer.allocateDirect(size); -+ buffer.order(ByteOrder.LITTLE_ENDIAN); -+ return buffer.asIntBuffer(); -+ } -+ -+ private static ByteBuffer getPooledBuffer(int size) { -+ Reference ref = (Reference)bufferPool.get(Integer.valueOf(size)); -+ ByteBuffer buffer = ref == null ? null : (ByteBuffer)ref.get(); -+ -+ if (buffer == null) { -+ buffer = ByteBuffer.allocateDirect(size); -+ bufferPool.put(Integer.valueOf(size), new SoftReference(buffer)); -+ } -+ -+ buffer.order(ByteOrder.LITTLE_ENDIAN); -+ buffer.position(0); -+ return buffer; -+ } -+ -+ private static BufferedImage convertToARGB(BufferedImage image) { -+ if (image == null) { -+ return null; -+ } else if (image.getType() == 2) { -+ return image; -+ } else { -+ int width = image.getWidth(); -+ int height = image.getHeight(); -+ logger.finest("converting %dx%d image to ARGB", new Object[] {Integer.valueOf(width), Integer.valueOf(height)}); -+ BufferedImage newImage = getPooledImage(width, height, 0); -+ Graphics2D graphics = newImage.createGraphics(); -+ Arrays.fill(getImageAsARGBIntBuffer(newImage).array(), 0); -+ graphics.drawImage(image, 0, 0, (ImageObserver)null); -+ return newImage; -+ } -+ } -+ -+ private static IntBuffer getImageAsARGBIntBuffer(BufferedImage image) { -+ DataBuffer buffer = image.getRaster().getDataBuffer(); -+ -+ if (buffer instanceof DataBufferInt) { -+ return IntBuffer.wrap(((DataBufferInt)buffer).getData()); -+ } else if (buffer instanceof DataBufferByte) { -+ return ByteBuffer.wrap(((DataBufferByte)buffer).getData()).order(ByteOrder.BIG_ENDIAN).asIntBuffer(); -+ } else { -+ int width = image.getWidth(); -+ int height = image.getHeight(); -+ int[] pixels = new int[width * height]; -+ image.getRGB(0, 0, width, height, pixels, 0, width); -+ return IntBuffer.wrap(pixels); -+ } -+ } -+ -+ private static void setBackgroundColor(IntBuffer buffer, int width, int height, IntBuffer scaledBuffer, int scale) { -+ for (int i = 0; i < width; ++i) { -+ for (int j = 0; j < height; ++j) { -+ int k = width * j + i; -+ int pixel = buffer.get(k); -+ -+ if ((pixel & -16777216) == 0) { -+ pixel = scaledBuffer.get(j / scale * (width / scale) + i / scale); -+ buffer.put(k, pixel & 16777215); -+ } -+ } -+ } -+ } -+ -+ static void scaleHalf(IntBuffer in, int w, int h, IntBuffer out, int rotate) { -+ for (int i = 0; i < w / 2; ++i) { -+ for (int j = 0; j < h / 2; ++j) { -+ int k = w * 2 * j + 2 * i; -+ int pixel00 = in.get(k); -+ int pixel01 = in.get(k + 1); -+ int pixel10 = in.get(k + w); -+ int pixel11 = in.get(k + w + 1); -+ -+ if (rotate != 0) { -+ pixel00 = Integer.rotateLeft(pixel00, rotate); -+ pixel01 = Integer.rotateLeft(pixel01, rotate); -+ pixel10 = Integer.rotateLeft(pixel10, rotate); -+ pixel11 = Integer.rotateLeft(pixel11, rotate); -+ } -+ -+ int pixel = average4RGBA(pixel00, pixel01, pixel10, pixel11); -+ -+ if (rotate != 0) { -+ pixel = Integer.rotateRight(pixel, rotate); -+ } -+ -+ out.put(w / 2 * j + i, pixel); -+ } -+ } -+ } -+ -+ private static int average4RGBA(int pixel00, int pixel01, int pixel10, int pixel11) { -+ int a00 = pixel00 & 255; -+ int a01 = pixel01 & 255; -+ int a10 = pixel10 & 255; -+ int a11 = pixel11 & 255; -+ -+ switch (a00 << 24 | a01 << 16 | a10 << 8 | a11) { -+ case -16777216: -+ return pixel00; -+ -+ case -16776961: -+ return average2RGBA(pixel00, pixel11); -+ -+ case -16711936: -+ return average2RGBA(pixel00, pixel10); -+ -+ case -65536: -+ return average2RGBA(pixel00, pixel01); -+ -+ case -1: -+ case 0: -+ return average2RGBA(average2RGBA(pixel00, pixel11), average2RGBA(pixel01, pixel10)); -+ -+ case 255: -+ return pixel11; -+ -+ case 65280: -+ return pixel10; -+ -+ case 65535: -+ return average2RGBA(pixel10, pixel11); -+ -+ case 16711680: -+ return pixel01; -+ -+ case 16711935: -+ return average2RGBA(pixel01, pixel11); -+ -+ case 16776960: -+ return average2RGBA(pixel01, pixel10); -+ -+ default: -+ int a = a00 + a01 + a10 + a11; -+ int pixel = a >> 2; -+ -+ for (int i = 8; i < 32; i += 8) { -+ int average = (a00 * (pixel00 >> i & 255) + a01 * (pixel01 >> i & 255) + a10 * (pixel10 >> i & 255) + a11 * (pixel11 >> i & 255)) / a; -+ pixel |= average << i; -+ } -+ -+ return pixel; -+ } -+ } -+ -+ private static int average2RGBA(int a, int b) { -+ return ((a & -16843010) >>> 1) + ((b & -16843010) >>> 1) | a & b & 16843009; -+ } -+ -+ private static void checkGLError(String format, Object ... params) { -+ int error = GL11.glGetError(); -+ -+ if (error != 0) { -+ String message = GLU.gluErrorString(error) + ": " + String.format(format, params); -+ (new RuntimeException(message)).printStackTrace(); -+ } -+ } -+ -+ static { -+ if (anisoSupported) { -+ anisoMax = (int)GL11.glGetFloat(34047); -+ checkGLError("glGetFloat(GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT)", new Object[0]); -+ anisoLevel = Math.max(Math.min(Config.getInt("Extended HD", "anisotropicFiltering", 1), anisoMax), 1); -+ } else { -+ anisoLevel = 1; -+ anisoMax = 1; -+ } -+ -+ lodSupported = GLContext.getCapabilities().GL_EXT_texture_lod_bias; -+ -+ if (lodSupported) { -+ lodBias = Config.getInt("Extended HD", "lodBias", 0); -+ } else { -+ lodBias = 0; -+ } -+ -+ logger.config("mipmap: supported=%s, enabled=%s, level=%d", new Object[] {Boolean.valueOf(mipmapSupported), Boolean.valueOf(mipmapEnabled), Integer.valueOf(maxMipmapLevel)}); -+ logger.config("anisotropic: supported=%s, level=%d, max=%d", new Object[] {Boolean.valueOf(anisoSupported), Integer.valueOf(anisoLevel), Integer.valueOf(anisoMax)}); -+ logger.config("lod bias: supported=%s, bias=%d", new Object[] {Boolean.valueOf(lodSupported), Integer.valueOf(lodBias)}); -+ } -+} ---- /dev/null -+++ org/spoutcraft/api/Spoutcraft.java -@@ -1,0 +1,193 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.api; -+ -+import java.io.File; -+import java.util.logging.Logger; -+ -+import net.minecraft.src.Chunk; -+import net.minecraft.src.World; -+ -+import org.spoutcraft.api.Client.Mode; -+import org.spoutcraft.api.gui.MinecraftFont; -+import org.spoutcraft.api.gui.MinecraftTessellator; -+import org.spoutcraft.api.gui.RenderDelegate; -+import org.spoutcraft.api.gui.WidgetManager; -+import org.spoutcraft.api.inventory.MaterialManager; -+import org.spoutcraft.api.keyboard.KeyBindingManager; -+import org.spoutcraft.api.player.BiomeManager; -+import org.spoutcraft.api.player.SkyManager; -+import org.spoutcraft.client.SpoutClient; -+import org.spoutcraft.client.SpoutcraftWorld; -+import org.spoutcraft.client.block.SpoutcraftChunk; -+import org.spoutcraft.client.player.ClientPlayer; -+ -+public final class Spoutcraft { -+ private static SpoutClient client = null; -+ -+ private Spoutcraft() { -+ } -+ -+ public static void setClient(SpoutClient argClient) { -+ if (client != null) { -+ throw new UnsupportedOperationException("Cannot redefine singleton Client"); -+ } -+ client = argClient; -+ } -+ -+ /** -+ * Gets the client singleton interface -+ * @return client -+ */ -+ public static Client getClient() { -+ return client; -+ } -+ -+ /** -+ * Gets the name with the version of this client. -+ * -+ * Example: 'Spoutcraft_555' -+ * @return name -+ */ -+ public static String getName() { -+ return client.getName(); -+ } -+ -+ /** -+ * Gets the build version of the client. -+ * @return version -+ */ -+ public static String getVersion() { -+ return client.getVersion(); -+ } -+ -+ /** -+ * Gets the build version of Spout on the server, or -1 if none exists -+ * @return version -+ */ -+ public static long getServerVersion() { -+ return client.getServerVersion(); -+ } -+ -+ /** -+ * Gets a logger that will print logs to the users .spoutcraft/logs folder, or terminal if it is active -+ * @return logger -+ */ -+ public static Logger getLogger() { -+ return client.getLogger(); -+ } -+ -+ public static File getUpdateFolder() { -+ return client.getUpdateFolder(); -+ } -+ -+ public static Mode getMode() { -+ return client.getMode(); -+ } -+ -+ public static SkyManager getSkyManager() { -+ return client.getSkyManager(); -+ } -+ -+ public static KeyBindingManager getKeyBindingManager() { -+ return client.getKeyBindingManager(); -+ } -+ -+ public static RenderDelegate getRenderDelegate() { -+ return client.getRenderDelegate(); -+ } -+ -+ public static MinecraftFont getMinecraftFont() { -+ return client.getRenderDelegate().getMinecraftFont(); -+ } -+ -+ public static MinecraftTessellator getTessellator() { -+ return client.getRenderDelegate().getTessellator(); -+ } -+ -+ public static BiomeManager getBiomeManager() { -+ return client.getBiomeManager(); -+ } -+ -+ public static MaterialManager getMaterialManager() { -+ return client.getMaterialManager(); -+ } -+ -+ public static boolean isSpoutEnabled() { -+ return client.isSpoutEnabled(); -+ } -+ -+ public static File getAddonFolder() { -+ return client.getAddonFolder(); -+ } -+ -+ public static File getAudioCache() { -+ return client.getAudioCache(); -+ } -+ -+ public static File getTemporaryCache() { -+ return client.getTemporaryCache(); -+ } -+ -+ public static File getTextureCache() { -+ return client.getTextureCache(); -+ } -+ -+ public static File getTexturePackFolder() { -+ return client.getTexturePackFolder(); -+ } -+ -+ public static File getStatsFolder() { -+ return client.getStatsFolder(); -+ } -+ -+ -+ public static long getTick() { -+ return client.getTick(); -+ } -+ -+ public static WidgetManager getWidgetManager() { -+ return client.getWidgetManager(); -+ } -+ -+ public static boolean hasPermission(String permission) { -+ return client.hasPermission(permission); -+ } -+ -+ public static SpoutcraftChunk getChunkAt(World world, int x, int y, int z) { -+ return getChunk(world, x >> 4, z >> 4); -+ } -+ -+ public static SpoutcraftChunk getChunk(World world, int chunkX, int chunkZ) { -+ Chunk chunk = world.getChunkFromChunkCoords(chunkX, chunkZ); -+ if (chunk != null) { -+ return chunk.spoutChunk; -+ } -+ return null; -+ } -+ -+ public static SpoutcraftWorld getWorld() { -+ return SpoutClient.getInstance().getRawWorld().world; -+ } -+ -+ public static ClientPlayer getActivePlayer() { -+ return ClientPlayer.getInstance(); -+ } -+} ---- net/minecraft/src/ItemSoup.java -+++ net/minecraft/src/ItemSoup.java -@@ -1,13 +1,13 @@ - package net.minecraft.src; - - public class ItemSoup extends ItemFood { -- public ItemSoup(int var1, int var2) { -- super(var1, var2, false); -+ public ItemSoup(int par1, int par2) { -+ super(par1, par2, false); - this.setMaxStackSize(1); - } - -- public ItemStack onEaten(ItemStack var1, World var2, EntityPlayer var3) { -- super.onEaten(var1, var2, var3); -+ public ItemStack onEaten(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) { -+ super.onEaten(par1ItemStack, par2World, par3EntityPlayer); - return new ItemStack(Item.bowlEmpty); - } - } ---- net/minecraft/src/RenderFireball.java -+++ net/minecraft/src/RenderFireball.java -@@ -6,14 +6,14 @@ - public class RenderFireball extends Render { - private float field_77002_a; - -- public RenderFireball(float var1) { -- this.field_77002_a = var1; -+ public RenderFireball(float par1) { -+ this.field_77002_a = par1; - } - -- public void doRenderFireball(EntityFireball var1, double var2, double var4, double var6, float var8, float var9) { -+ public void doRenderFireball(EntityFireball par1EntityFireball, double par2, double par4, double par6, float par8, float par9) { - GL11.glPushMatrix(); -- this.bindEntityTexture(var1); -- GL11.glTranslatef((float)var2, (float)var4, (float)var6); -+ this.bindEntityTexture(par1EntityFireball); -+ GL11.glTranslatef((float)par2, (float)par4, (float)par6); - GL11.glEnable(GL12.GL_RESCALE_NORMAL); - float var10 = this.field_77002_a; - GL11.glScalef(var10 / 1.0F, var10 / 1.0F, var10 / 1.0F); -@@ -39,15 +39,24 @@ - GL11.glPopMatrix(); - } - -- protected ResourceLocation getFireballTextures(EntityFireball var1) { -+ protected ResourceLocation getFireballTextures(EntityFireball par1EntityFireball) { - return TextureMap.locationItemsTexture; - } - -- protected ResourceLocation getEntityTexture(Entity var1) { -- return this.getFireballTextures((EntityFireball)var1); -+ /** -+ * Returns the location of an entity's texture. Doesn't seem to be called unless you call Render.bindEntityTexture. -+ */ -+ protected ResourceLocation getEntityTexture(Entity par1Entity) { -+ return this.getFireballTextures((EntityFireball)par1Entity); - } - -- public void doRender(Entity var1, double var2, double var4, double var6, float var8, float var9) { -- this.doRenderFireball((EntityFireball)var1, var2, var4, var6, var8, var9); -+ /** -+ * Actually renders the given argument. This is a synthetic bridge method, always casting down its argument and then -+ * handing it off to a worker function which does the actual work. In all probabilty, the class Render is generic -+ * (Render 5 ? this.topIcon : (var1 == var3 ? (!isExtended(var2) && this.minX <= 0.0D && this.minY <= 0.0D && this.minZ <= 0.0D && this.maxX >= 1.0D && this.maxY >= 1.0D && this.maxZ >= 1.0D ? this.topIcon : this.innerTopIcon) : (var1 == Facing.oppositeSide[var3] ? this.bottomIcon : this.blockIcon)); -- } -- -- public static Icon getPistonBaseIcon(String var0) { -- return var0 == "piston_side" ? Block.pistonBase.blockIcon : (var0 == "piston_top_normal" ? Block.pistonBase.topIcon : (var0 == "piston_top_sticky" ? Block.pistonStickyBase.topIcon : (var0 == "piston_inner" ? Block.pistonBase.innerTopIcon : null))); -- } -- -- public void registerIcons(IconRegister var1) { -- this.blockIcon = var1.registerIcon("piston_side"); -- this.topIcon = var1.registerIcon(this.isSticky ? "piston_top_sticky" : "piston_top_normal"); -- this.innerTopIcon = var1.registerIcon("piston_inner"); -- this.bottomIcon = var1.registerIcon("piston_bottom"); -- } -- -+ public void func_96479_b(float par1, float par2, float par3, float par4, float par5, float par6) { -+ this.setBlockBounds(par1, par2, par3, par4, par5, par6); -+ } -+ -+ /** -+ * From the specified side and block metadata retrieves the blocks texture. Args: side, metadata -+ */ -+ public Icon getIcon(int par1, int par2) { -+ int var3 = getOrientation(par2); -+ return var3 > 5 ? this.topIcon : (par1 == var3 ? (!isExtended(par2) && this.minX <= 0.0D && this.minY <= 0.0D && this.minZ <= 0.0D && this.maxX >= 1.0D && this.maxY >= 1.0D && this.maxZ >= 1.0D ? this.topIcon : this.innerTopIcon) : (par1 == Facing.oppositeSide[var3] ? this.bottomIcon : this.blockIcon)); -+ } -+ -+ public static Icon getPistonBaseIcon(String par0Str) { -+ return par0Str == "piston_side" ? Block.pistonBase.blockIcon : (par0Str == "piston_top_normal" ? Block.pistonBase.topIcon : (par0Str == "piston_top_sticky" ? Block.pistonStickyBase.topIcon : (par0Str == "piston_inner" ? Block.pistonBase.innerTopIcon : null))); -+ } -+ -+ /** -+ * When this method is called, your block should register all the icons it needs with the given IconRegister. This is -+ * the only chance you get to register icons. -+ */ -+ public void registerIcons(IconRegister par1IconRegister) { -+ this.blockIcon = par1IconRegister.registerIcon("piston_side"); -+ this.topIcon = par1IconRegister.registerIcon(this.isSticky ? "piston_top_sticky" : "piston_top_normal"); -+ this.innerTopIcon = par1IconRegister.registerIcon("piston_inner"); -+ this.bottomIcon = par1IconRegister.registerIcon("piston_bottom"); -+ } -+ -+ /** -+ * The type of render function that is called for this block -+ */ - public int getRenderType() { - return 16; - } - -+ /** -+ * Is this block (a) opaque and (b) a full 1m cube? This determines whether or not to render the shared face of two -+ * adjacent blocks and also whether the player can attach torches, redstone wire, etc to this block. -+ */ - public boolean isOpaqueCube() { - return false; - } - -- public boolean onBlockActivated(World var1, int var2, int var3, int var4, EntityPlayer var5, int var6, float var7, float var8, float var9) { -+ /** -+ * Called upon block activation (right click on the block.) -+ */ -+ public boolean onBlockActivated(World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer, int par6, float par7, float par8, float par9) { - return false; - } - -- public void onBlockPlacedBy(World var1, int var2, int var3, int var4, EntityLivingBase var5, ItemStack var6) { -- int var7 = determineOrientation(var1, var2, var3, var4, var5); -- var1.setBlockMetadata(var2, var3, var4, var7, 2); -- if(!var1.isRemote) { -- this.updatePistonState(var1, var2, var3, var4); -- } -- -- } -- -- public void onNeighborBlockChange(World var1, int var2, int var3, int var4, int var5) { -- if(!var1.isRemote) { -- this.updatePistonState(var1, var2, var3, var4); -- } -- -- } -- -- public void onBlockAdded(World var1, int var2, int var3, int var4) { -- if(!var1.isRemote && var1.getBlockTileEntity(var2, var3, var4) == null) { -- this.updatePistonState(var1, var2, var3, var4); -- } -- -- } -- -- private void updatePistonState(World var1, int var2, int var3, int var4) { -- int var5 = var1.getBlockMetadata(var2, var3, var4); -+ /** -+ * Called when the block is placed in the world. -+ */ -+ public void onBlockPlacedBy(World par1World, int par2, int par3, int par4, EntityLivingBase par5EntityLivingBase, ItemStack par6ItemStack) { -+ int var7 = determineOrientation(par1World, par2, par3, par4, par5EntityLivingBase); -+ par1World.setBlockMetadataWithNotify(par2, par3, par4, var7, 2); -+ -+ if (!par1World.isRemote) { -+ this.updatePistonState(par1World, par2, par3, par4); -+ } -+ } -+ -+ /** -+ * Lets the block know when one of its neighbor changes. Doesn't know which neighbor changed (coordinates passed are -+ * their own) Args: x, y, z, neighbor blockID -+ */ -+ public void onNeighborBlockChange(World par1World, int par2, int par3, int par4, int par5) { -+ if (!par1World.isRemote) { -+ this.updatePistonState(par1World, par2, par3, par4); -+ } -+ } -+ -+ /** -+ * Called whenever the block is added into the world. Args: world, x, y, z -+ */ -+ public void onBlockAdded(World par1World, int par2, int par3, int par4) { -+ if (!par1World.isRemote && par1World.getBlockTileEntity(par2, par3, par4) == null) { -+ this.updatePistonState(par1World, par2, par3, par4); -+ } -+ } -+ -+ /** -+ * handles attempts to extend or retract the piston. -+ */ -+ private void updatePistonState(World par1World, int par2, int par3, int par4) { -+ int var5 = par1World.getBlockMetadata(par2, par3, par4); - int var6 = getOrientation(var5); -- if(var6 != 7) { -- boolean var7 = this.isIndirectlyPowered(var1, var2, var3, var4, var6); -- if(var7 && !isExtended(var5)) { -- if(canExtend(var1, var2, var3, var4, var6)) { -- var1.addBlockEvent(var2, var3, var4, this.blockID, 0, var6); -+ -+ if (var6 != 7) { -+ boolean var7 = this.isIndirectlyPowered(par1World, par2, par3, par4, var6); -+ -+ if (var7 && !isExtended(var5)) { -+ if (canExtend(par1World, par2, par3, par4, var6)) { -+ par1World.addBlockEvent(par2, par3, par4, this.blockID, 0, var6); - } -- } else if(!var7 && isExtended(var5)) { -- var1.setBlockMetadata(var2, var3, var4, var6, 2); -- var1.addBlockEvent(var2, var3, var4, this.blockID, 1, var6); -- } -- -- } -- } -- -- private boolean isIndirectlyPowered(World var1, int var2, int var3, int var4, int var5) { -- return var5 != 0 && var1.getIndirectPowerOutput(var2, var3 - 1, var4, 0) ? true : (var5 != 1 && var1.getIndirectPowerOutput(var2, var3 + 1, var4, 1) ? true : (var5 != 2 && var1.getIndirectPowerOutput(var2, var3, var4 - 1, 2) ? true : (var5 != 3 && var1.getIndirectPowerOutput(var2, var3, var4 + 1, 3) ? true : (var5 != 5 && var1.getIndirectPowerOutput(var2 + 1, var3, var4, 5) ? true : (var5 != 4 && var1.getIndirectPowerOutput(var2 - 1, var3, var4, 4) ? true : (var1.getIndirectPowerOutput(var2, var3, var4, 0) ? true : (var1.getIndirectPowerOutput(var2, var3 + 2, var4, 1) ? true : (var1.getIndirectPowerOutput(var2, var3 + 1, var4 - 1, 2) ? true : (var1.getIndirectPowerOutput(var2, var3 + 1, var4 + 1, 3) ? true : (var1.getIndirectPowerOutput(var2 - 1, var3 + 1, var4, 4) ? true : var1.getIndirectPowerOutput(var2 + 1, var3 + 1, var4, 5))))))))))); -- } -- -- public boolean onBlockEventReceived(World var1, int var2, int var3, int var4, int var5, int var6) { -- if(!var1.isRemote) { -- boolean var7 = this.isIndirectlyPowered(var1, var2, var3, var4, var6); -- if(var7 && var5 == 1) { -- var1.setBlockMetadata(var2, var3, var4, var6 | 8, 2); -- return false; -- } -- -- if(!var7 && var5 == 0) { -- return false; -- } -- } -- -- if(var5 == 0) { -- if(!this.tryExtend(var1, var2, var3, var4, var6)) { -- return false; -- } -- -- var1.setBlockMetadata(var2, var3, var4, var6 | 8, 2); -- var1.playSoundEffect((double)var2 + 0.5D, (double)var3 + 0.5D, (double)var4 + 0.5D, "tile.piston.out", 0.5F, var1.s.nextFloat() * 0.25F + 0.6F); -- } else if(var5 == 1) { -- TileEntity var16 = var1.getBlockTileEntity(var2 + Facing.offsetsXForSide[var6], var3 + Facing.offsetsYForSide[var6], var4 + Facing.offsetsZForSide[var6]); -- if(var16 instanceof TileEntityPiston) { -+ } else if (!var7 && isExtended(var5)) { -+ par1World.setBlockMetadataWithNotify(par2, par3, par4, var6, 2); -+ par1World.addBlockEvent(par2, par3, par4, this.blockID, 1, var6); -+ } -+ } -+ } -+ -+ /** -+ * checks the block to that side to see if it is indirectly powered. -+ */ -+ private boolean isIndirectlyPowered(World par1World, int par2, int par3, int par4, int par5) { -+ return par5 != 0 && par1World.getIndirectPowerOutput(par2, par3 - 1, par4, 0) ? true : (par5 != 1 && par1World.getIndirectPowerOutput(par2, par3 + 1, par4, 1) ? true : (par5 != 2 && par1World.getIndirectPowerOutput(par2, par3, par4 - 1, 2) ? true : (par5 != 3 && par1World.getIndirectPowerOutput(par2, par3, par4 + 1, 3) ? true : (par5 != 5 && par1World.getIndirectPowerOutput(par2 + 1, par3, par4, 5) ? true : (par5 != 4 && par1World.getIndirectPowerOutput(par2 - 1, par3, par4, 4) ? true : (par1World.getIndirectPowerOutput(par2, par3, par4, 0) ? true : (par1World.getIndirectPowerOutput(par2, par3 + 2, par4, 1) ? true : (par1World.getIndirectPowerOutput(par2, par3 + 1, par4 - 1, 2) ? true : (par1World.getIndirectPowerOutput(par2, par3 + 1, par4 + 1, 3) ? true : (par1World.getIndirectPowerOutput(par2 - 1, par3 + 1, par4, 4) ? true : par1World.getIndirectPowerOutput(par2 + 1, par3 + 1, par4, 5))))))))))); -+ } -+ -+ /** -+ * Called when the block receives a BlockEvent - see World.addBlockEvent. By default, passes it on to the tile entity -+ * at this location. Args: world, x, y, z, blockID, EventID, event parameter -+ */ -+ public boolean onBlockEventReceived(World par1World, int par2, int par3, int par4, int par5, int par6) { -+ if (!par1World.isRemote) { -+ boolean var7 = this.isIndirectlyPowered(par1World, par2, par3, par4, par6); -+ -+ if (var7 && par5 == 1) { -+ par1World.setBlockMetadataWithNotify(par2, par3, par4, par6 | 8, 2); -+ return false; -+ } -+ -+ if (!var7 && par5 == 0) { -+ return false; -+ } -+ } -+ -+ if (par5 == 0) { -+ if (!this.tryExtend(par1World, par2, par3, par4, par6)) { -+ return false; -+ } -+ -+ par1World.setBlockMetadataWithNotify(par2, par3, par4, par6 | 8, 2); -+ par1World.playSoundEffect((double)par2 + 0.5D, (double)par3 + 0.5D, (double)par4 + 0.5D, "tile.piston.out", 0.5F, par1World.rand.nextFloat() * 0.25F + 0.6F); -+ } else if (par5 == 1) { -+ TileEntity var16 = par1World.getBlockTileEntity(par2 + Facing.offsetsXForSide[par6], par3 + Facing.offsetsYForSide[par6], par4 + Facing.offsetsZForSide[par6]); -+ -+ if (var16 instanceof TileEntityPiston) { - ((TileEntityPiston)var16).clearPistonTileEntity(); - } - -- var1.setBlock(var2, var3, var4, Block.pistonMoving.blockID, var6, 3); -- var1.setBlockTileEntity(var2, var3, var4, BlockPistonMoving.getTileEntity(this.blockID, var6, var6, false, true)); -- if(this.isSticky) { -- int var8 = var2 + Facing.offsetsXForSide[var6] * 2; -- int var9 = var3 + Facing.offsetsYForSide[var6] * 2; -- int var10 = var4 + Facing.offsetsZForSide[var6] * 2; -- int var11 = var1.getBlockId(var8, var9, var10); -- int var12 = var1.getBlockMetadata(var8, var9, var10); -+ par1World.setBlock(par2, par3, par4, Block.pistonMoving.blockID, par6, 3); -+ par1World.setBlockTileEntity(par2, par3, par4, BlockPistonMoving.getTileEntity(this.blockID, par6, par6, false, true)); -+ -+ if (this.isSticky) { -+ int var8 = par2 + Facing.offsetsXForSide[par6] * 2; -+ int var9 = par3 + Facing.offsetsYForSide[par6] * 2; -+ int var10 = par4 + Facing.offsetsZForSide[par6] * 2; -+ int var11 = par1World.getBlockId(var8, var9, var10); -+ int var12 = par1World.getBlockMetadata(var8, var9, var10); - boolean var13 = false; -- if(var11 == Block.pistonMoving.blockID) { -- TileEntity var14 = var1.getBlockTileEntity(var8, var9, var10); -- if(var14 instanceof TileEntityPiston) { -+ -+ if (var11 == Block.pistonMoving.blockID) { -+ TileEntity var14 = par1World.getBlockTileEntity(var8, var9, var10); -+ -+ if (var14 instanceof TileEntityPiston) { - TileEntityPiston var15 = (TileEntityPiston)var14; -- if(var15.getPistonOrientation() == var6 && var15.isExtending()) { -+ -+ if (var15.getPistonOrientation() == par6 && var15.isExtending()) { - var15.clearPistonTileEntity(); - var11 = var15.getStoredBlockID(); - var12 = var15.getBlockMetadata(); -@@ -144,153 +198,191 @@ - } - } - -- if(var13 || var11 <= 0 || !canPushBlock(var11, var1, var8, var9, var10, false) || Block.blocksList[var11].getMobilityFlag() != 0 && var11 != Block.pistonBase.blockID && var11 != Block.pistonStickyBase.blockID) { -- if(!var13) { -- var1.setBlockToAir(var2 + Facing.offsetsXForSide[var6], var3 + Facing.offsetsYForSide[var6], var4 + Facing.offsetsZForSide[var6]); -- } -- } else { -- var2 += Facing.offsetsXForSide[var6]; -- var3 += Facing.offsetsYForSide[var6]; -- var4 += Facing.offsetsZForSide[var6]; -- var1.setBlock(var2, var3, var4, Block.pistonMoving.blockID, var12, 3); -- var1.setBlockTileEntity(var2, var3, var4, BlockPistonMoving.getTileEntity(var11, var12, var6, false, false)); -- var1.setBlockToAir(var8, var9, var10); -+ if (!var13 && var11 > 0 && canPushBlock(var11, par1World, var8, var9, var10, false) && (Block.blocksList[var11].getMobilityFlag() == 0 || var11 == Block.pistonBase.blockID || var11 == Block.pistonStickyBase.blockID)) { -+ par2 += Facing.offsetsXForSide[par6]; -+ par3 += Facing.offsetsYForSide[par6]; -+ par4 += Facing.offsetsZForSide[par6]; -+ par1World.setBlock(par2, par3, par4, Block.pistonMoving.blockID, var12, 3); -+ par1World.setBlockTileEntity(par2, par3, par4, BlockPistonMoving.getTileEntity(var11, var12, par6, false, false)); -+ par1World.setBlockToAir(var8, var9, var10); -+ } else if (!var13) { -+ par1World.setBlockToAir(par2 + Facing.offsetsXForSide[par6], par3 + Facing.offsetsYForSide[par6], par4 + Facing.offsetsZForSide[par6]); - } - } else { -- var1.setBlockToAir(var2 + Facing.offsetsXForSide[var6], var3 + Facing.offsetsYForSide[var6], var4 + Facing.offsetsZForSide[var6]); -+ par1World.setBlockToAir(par2 + Facing.offsetsXForSide[par6], par3 + Facing.offsetsYForSide[par6], par4 + Facing.offsetsZForSide[par6]); - } - -- var1.playSoundEffect((double)var2 + 0.5D, (double)var3 + 0.5D, (double)var4 + 0.5D, "tile.piston.in", 0.5F, var1.s.nextFloat() * 0.15F + 0.6F); -+ par1World.playSoundEffect((double)par2 + 0.5D, (double)par3 + 0.5D, (double)par4 + 0.5D, "tile.piston.in", 0.5F, par1World.rand.nextFloat() * 0.15F + 0.6F); - } - - return true; - } - -- public void setBlockBoundsBasedOnState(IBlockAccess var1, int var2, int var3, int var4) { -- int var5 = var1.getBlockMetadata(var2, var3, var4); -- if(isExtended(var5)) { -+ /** -+ * Updates the blocks bounds based on its current state. Args: world, x, y, z -+ */ -+ public void setBlockBoundsBasedOnState(IBlockAccess par1IBlockAccess, int par2, int par3, int par4) { -+ int var5 = par1IBlockAccess.getBlockMetadata(par2, par3, par4); -+ -+ if (isExtended(var5)) { - float var6 = 0.25F; -- switch(getOrientation(var5)) { -- case 0: -- this.setBlockBounds(0.0F, 0.25F, 0.0F, 1.0F, 1.0F, 1.0F); -- break; -- case 1: -- this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 12.0F / 16.0F, 1.0F); -- break; -- case 2: -- this.setBlockBounds(0.0F, 0.0F, 0.25F, 1.0F, 1.0F, 1.0F); -- break; -- case 3: -- this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 12.0F / 16.0F); -- break; -- case 4: -- this.setBlockBounds(0.25F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F); -- break; -- case 5: -- this.setBlockBounds(0.0F, 0.0F, 0.0F, 12.0F / 16.0F, 1.0F, 1.0F); -+ -+ switch (getOrientation(var5)) { -+ case 0: -+ this.setBlockBounds(0.0F, 0.25F, 0.0F, 1.0F, 1.0F, 1.0F); -+ break; -+ -+ case 1: -+ this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.75F, 1.0F); -+ break; -+ -+ case 2: -+ this.setBlockBounds(0.0F, 0.0F, 0.25F, 1.0F, 1.0F, 1.0F); -+ break; -+ -+ case 3: -+ this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 0.75F); -+ break; -+ -+ case 4: -+ this.setBlockBounds(0.25F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F); -+ break; -+ -+ case 5: -+ this.setBlockBounds(0.0F, 0.0F, 0.0F, 0.75F, 1.0F, 1.0F); - } - } else { - this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F); - } -- - } - -+ /** -+ * Sets the block's bounds for rendering it as an item -+ */ - public void setBlockBoundsForItemRender() { - this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F); - } - -- public void addCollisionBoxesToList(World var1, int var2, int var3, int var4, AxisAlignedBB var5, List var6, Entity var7) { -+ /** -+ * Adds all intersecting collision boxes to a list. (Be sure to only add boxes to the list if they intersect the mask.) -+ * Parameters: World, X, Y, Z, mask, list, colliding entity -+ */ -+ public void addCollisionBoxesToList(World par1World, int par2, int par3, int par4, AxisAlignedBB par5AxisAlignedBB, List par6List, Entity par7Entity) { - this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F); -- super.addCollisionBoxesToList(var1, var2, var3, var4, var5, var6, var7); -- } -- -- public AxisAlignedBB getCollisionBoundingBoxFromPool(World var1, int var2, int var3, int var4) { -- this.setBlockBoundsBasedOnState(var1, var2, var3, var4); -- return super.getCollisionBoundingBoxFromPool(var1, var2, var3, var4); -- } -- -+ super.addCollisionBoxesToList(par1World, par2, par3, par4, par5AxisAlignedBB, par6List, par7Entity); -+ } -+ -+ /** -+ * Returns a bounding box from the pool of bounding boxes (this means this box can change after the pool has been -+ * cleared to be reused) -+ */ -+ public AxisAlignedBB getCollisionBoundingBoxFromPool(World par1World, int par2, int par3, int par4) { -+ this.setBlockBoundsBasedOnState(par1World, par2, par3, par4); -+ return super.getCollisionBoundingBoxFromPool(par1World, par2, par3, par4); -+ } -+ -+ /** -+ * If this block doesn't render as an ordinary block it will return False (examples: signs, buttons, stairs, etc) -+ */ - public boolean renderAsNormalBlock() { - return false; - } - -- public static int getOrientation(int var0) { -- return var0 & 7; -- } -- -- public static boolean isExtended(int var0) { -- return (var0 & 8) != 0; -- } -- -- public static int determineOrientation(World var0, int var1, int var2, int var3, EntityLivingBase var4) { -- if(MathHelper.abs((float)var4.posX - (float)var1) < 2.0F && MathHelper.abs((float)var4.posZ - (float)var3) < 2.0F) { -- double var5 = var4.posY + 1.82D - (double)var4.yOffset; -- if(var5 - (double)var2 > 2.0D) { -+ /** -+ * returns an int which describes the direction the piston faces -+ */ -+ public static int getOrientation(int par0) { -+ return par0 & 7; -+ } -+ -+ /** -+ * Determine if the metadata is related to something powered. -+ */ -+ public static boolean isExtended(int par0) { -+ return (par0 & 8) != 0; -+ } -+ -+ /** -+ * gets the way this piston should face for that entity that placed it. -+ */ -+ public static int determineOrientation(World par0World, int par1, int par2, int par3, EntityLivingBase par4EntityLivingBase) { -+ if (MathHelper.abs((float)par4EntityLivingBase.posX - (float)par1) < 2.0F && MathHelper.abs((float)par4EntityLivingBase.posZ - (float)par3) < 2.0F) { -+ double var5 = par4EntityLivingBase.posY + 1.82D - (double)par4EntityLivingBase.yOffset; -+ -+ if (var5 - (double)par2 > 2.0D) { - return 1; - } - -- if((double)var2 - var5 > 0.0D) { -+ if ((double)par2 - var5 > 0.0D) { - return 0; - } - } - -- int var7 = MathHelper.floor_double((double)(var4.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3; -+ int var7 = MathHelper.floor_double((double)(par4EntityLivingBase.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3; - return var7 == 0 ? 2 : (var7 == 1 ? 5 : (var7 == 2 ? 3 : (var7 == 3 ? 4 : 0))); - } - -- private static boolean canPushBlock(int var0, World var1, int var2, int var3, int var4, boolean var5) { -- if(var0 == Block.obsidian.blockID) { -+ /** -+ * returns true if the piston can push the specified block -+ */ -+ private static boolean canPushBlock(int par0, World par1World, int par2, int par3, int par4, boolean par5) { -+ if (par0 == Block.obsidian.blockID) { - return false; - } else { -- if(var0 != Block.pistonBase.blockID && var0 != Block.pistonStickyBase.blockID) { -- if(Block.blocksList[var0].getBlockHardness(var1, var2, var3, var4) == -1.0F) { -- return false; -- } -- -- if(Block.blocksList[var0].getMobilityFlag() == 2) { -- return false; -- } -- -- if(Block.blocksList[var0].getMobilityFlag() == 1) { -- if(!var5) { -+ if (par0 != Block.pistonBase.blockID && par0 != Block.pistonStickyBase.blockID) { -+ if (Block.blocksList[par0].getBlockHardness(par1World, par2, par3, par4) == -1.0F) { -+ return false; -+ } -+ -+ if (Block.blocksList[par0].getMobilityFlag() == 2) { -+ return false; -+ } -+ -+ if (Block.blocksList[par0].getMobilityFlag() == 1) { -+ if (!par5) { - return false; - } - - return true; - } -- } else if(isExtended(var1.getBlockMetadata(var2, var3, var4))) { -+ } else if (isExtended(par1World.getBlockMetadata(par2, par3, par4))) { - return false; - } - -- return !(Block.blocksList[var0] instanceof ITileEntityProvider); -+ return !(Block.blocksList[par0] instanceof ITileEntityProvider); - } - } - -- private static boolean canExtend(World var0, int var1, int var2, int var3, int var4) { -- int var5 = var1 + Facing.offsetsXForSide[var4]; -- int var6 = var2 + Facing.offsetsYForSide[var4]; -- int var7 = var3 + Facing.offsetsZForSide[var4]; -+ /** -+ * checks to see if this piston could push the blocks in front of it. -+ */ -+ private static boolean canExtend(World par0World, int par1, int par2, int par3, int par4) { -+ int var5 = par1 + Facing.offsetsXForSide[par4]; -+ int var6 = par2 + Facing.offsetsYForSide[par4]; -+ int var7 = par3 + Facing.offsetsZForSide[par4]; - int var8 = 0; - -- while(true) { -- if(var8 < 13) { -- if(var6 <= 0 || var6 >= 255) { -+ while (true) { -+ if (var8 < 13) { -+ if (var6 <= 0 || var6 >= 255) { - return false; - } - -- int var9 = var0.getBlockId(var5, var6, var7); -- if(var9 != 0) { -- if(!canPushBlock(var9, var0, var5, var6, var7, true)) { -+ int var9 = par0World.getBlockId(var5, var6, var7); -+ -+ if (var9 != 0) { -+ if (!canPushBlock(var9, par0World, var5, var6, var7, true)) { - return false; - } - -- if(Block.blocksList[var9].getMobilityFlag() != 1) { -- if(var8 == 12) { -+ if (Block.blocksList[var9].getMobilityFlag() != 1) { -+ if (var8 == 12) { - return false; - } - -- var5 += Facing.offsetsXForSide[var4]; -- var6 += Facing.offsetsYForSide[var4]; -- var7 += Facing.offsetsZForSide[var4]; -+ var5 += Facing.offsetsXForSide[par4]; -+ var6 += Facing.offsetsYForSide[par4]; -+ var7 += Facing.offsetsZForSide[par4]; - ++var8; - continue; - } -@@ -301,39 +393,44 @@ - } - } - -- private boolean tryExtend(World var1, int var2, int var3, int var4, int var5) { -- int var6 = var2 + Facing.offsetsXForSide[var5]; -- int var7 = var3 + Facing.offsetsYForSide[var5]; -- int var8 = var4 + Facing.offsetsZForSide[var5]; -+ /** -+ * attempts to extend the piston. returns false if impossible. -+ */ -+ private boolean tryExtend(World par1World, int par2, int par3, int par4, int par5) { -+ int var6 = par2 + Facing.offsetsXForSide[par5]; -+ int var7 = par3 + Facing.offsetsYForSide[par5]; -+ int var8 = par4 + Facing.offsetsZForSide[par5]; - int var9 = 0; - -- while(true) { -+ while (true) { - int var10; -- if(var9 < 13) { -- if(var7 <= 0 || var7 >= 255) { -+ -+ if (var9 < 13) { -+ if (var7 <= 0 || var7 >= 255) { - return false; - } - -- var10 = var1.getBlockId(var6, var7, var8); -- if(var10 != 0) { -- if(!canPushBlock(var10, var1, var6, var7, var8, true)) { -+ var10 = par1World.getBlockId(var6, var7, var8); -+ -+ if (var10 != 0) { -+ if (!canPushBlock(var10, par1World, var6, var7, var8, true)) { - return false; - } - -- if(Block.blocksList[var10].getMobilityFlag() != 1) { -- if(var9 == 12) { -+ if (Block.blocksList[var10].getMobilityFlag() != 1) { -+ if (var9 == 12) { - return false; - } - -- var6 += Facing.offsetsXForSide[var5]; -- var7 += Facing.offsetsYForSide[var5]; -- var8 += Facing.offsetsZForSide[var5]; -+ var6 += Facing.offsetsXForSide[par5]; -+ var7 += Facing.offsetsYForSide[par5]; -+ var8 += Facing.offsetsZForSide[par5]; - ++var9; - continue; - } - -- Block.blocksList[var10].dropBlockAsItem(var1, var6, var7, var8, var1.getBlockMetadata(var6, var7, var8), 0); -- var1.setBlockToAir(var6, var7, var8); -+ Block.blocksList[var10].dropBlockAsItem(par1World, var6, var7, var8, par1World.getBlockMetadata(var6, var7, var8), 0); -+ par1World.setBlockToAir(var6, var7, var8); - } - } - -@@ -341,23 +438,24 @@ - var10 = var7; - int var11 = var8; - int var12 = 0; -- - int[] var13; - int var14; - int var15; - int var16; -- for(var13 = new int[13]; var6 != var2 || var7 != var3 || var8 != var4; var8 = var16) { -- var14 = var6 - Facing.offsetsXForSide[var5]; -- var15 = var7 - Facing.offsetsYForSide[var5]; -- var16 = var8 - Facing.offsetsZForSide[var5]; -- int var17 = var1.getBlockId(var14, var15, var16); -- int var18 = var1.getBlockMetadata(var14, var15, var16); -- if(var17 == this.blockID && var14 == var2 && var15 == var3 && var16 == var4) { -- var1.setBlock(var6, var7, var8, Block.pistonMoving.blockID, var5 | (this.isSticky ? 8 : 0), 4); -- var1.setBlockTileEntity(var6, var7, var8, BlockPistonMoving.getTileEntity(Block.pistonExtension.blockID, var5 | (this.isSticky ? 8 : 0), var5, true, false)); -+ -+ for (var13 = new int[13]; var6 != par2 || var7 != par3 || var8 != par4; var8 = var16) { -+ var14 = var6 - Facing.offsetsXForSide[par5]; -+ var15 = var7 - Facing.offsetsYForSide[par5]; -+ var16 = var8 - Facing.offsetsZForSide[par5]; -+ int var17 = par1World.getBlockId(var14, var15, var16); -+ int var18 = par1World.getBlockMetadata(var14, var15, var16); -+ -+ if (var17 == this.blockID && var14 == par2 && var15 == par3 && var16 == par4) { -+ par1World.setBlock(var6, var7, var8, Block.pistonMoving.blockID, par5 | (this.isSticky ? 8 : 0), 4); -+ par1World.setBlockTileEntity(var6, var7, var8, BlockPistonMoving.getTileEntity(Block.pistonExtension.blockID, par5 | (this.isSticky ? 8 : 0), par5, true, false)); - } else { -- var1.setBlock(var6, var7, var8, Block.pistonMoving.blockID, var18, 4); -- var1.setBlockTileEntity(var6, var7, var8, BlockPistonMoving.getTileEntity(var17, var18, var5, true, false)); -+ par1World.setBlock(var6, var7, var8, Block.pistonMoving.blockID, var18, 4); -+ par1World.setBlockTileEntity(var6, var7, var8, BlockPistonMoving.getTileEntity(var17, var18, par5, true, false)); - } - - var13[var12++] = var17; -@@ -369,11 +467,11 @@ - var7 = var10; - var8 = var11; - -- for(var12 = 0; var6 != var2 || var7 != var3 || var8 != var4; var8 = var16) { -- var14 = var6 - Facing.offsetsXForSide[var5]; -- var15 = var7 - Facing.offsetsYForSide[var5]; -- var16 = var8 - Facing.offsetsZForSide[var5]; -- var1.notifyBlocksOfNeighborChange(var14, var15, var16, var13[var12++]); -+ for (var12 = 0; var6 != par2 || var7 != par3 || var8 != par4; var8 = var16) { -+ var14 = var6 - Facing.offsetsXForSide[par5]; -+ var15 = var7 - Facing.offsetsYForSide[par5]; -+ var16 = var8 - Facing.offsetsZForSide[par5]; -+ par1World.notifyBlocksOfNeighborChange(var14, var15, var16, var13[var12++]); - var6 = var14; - var7 = var15; - } ---- net/minecraft/src/ComponentNetherBridgeCorridor5.java -+++ net/minecraft/src/ComponentNetherBridgeCorridor5.java -@@ -4,38 +4,47 @@ - import java.util.Random; - - public class ComponentNetherBridgeCorridor5 extends ComponentNetherBridgePiece { -- public ComponentNetherBridgeCorridor5() { -- } -- -- public ComponentNetherBridgeCorridor5(int var1, Random var2, StructureBoundingBox var3, int var4) { -- super(var1); -- this.coordBaseMode = var4; -- this.boundingBox = var3; -- } -- -- public void buildComponent(StructureComponent var1, List var2, Random var3) { -- this.getNextComponentNormal((ComponentNetherBridgeStartPiece)var1, var2, var3, 1, 0, true); -- } -- -- public static ComponentNetherBridgeCorridor5 createValidComponent(List var0, Random var1, int var2, int var3, int var4, int var5, int var6) { -- StructureBoundingBox var7 = StructureBoundingBox.getComponentToAddBoundingBox(var2, var3, var4, -1, 0, 0, 5, 7, 5, var5); -- return isAboveGround(var7) && StructureComponent.findIntersecting(var0, var7) == null ? new ComponentNetherBridgeCorridor5(var6, var1, var7, var5) : null; -- } -- -- public boolean addComponentParts(World var1, Random var2, StructureBoundingBox var3) { -- this.fillWithBlocks(var1, var3, 0, 0, 0, 4, 1, 4, Block.netherBrick.blockID, Block.netherBrick.blockID, false); -- this.fillWithBlocks(var1, var3, 0, 2, 0, 4, 5, 4, 0, 0, false); -- this.fillWithBlocks(var1, var3, 0, 2, 0, 0, 5, 4, Block.netherBrick.blockID, Block.netherBrick.blockID, false); -- this.fillWithBlocks(var1, var3, 4, 2, 0, 4, 5, 4, Block.netherBrick.blockID, Block.netherBrick.blockID, false); -- this.fillWithBlocks(var1, var3, 0, 3, 1, 0, 4, 1, Block.netherFence.blockID, Block.netherFence.blockID, false); -- this.fillWithBlocks(var1, var3, 0, 3, 3, 0, 4, 3, Block.netherFence.blockID, Block.netherFence.blockID, false); -- this.fillWithBlocks(var1, var3, 4, 3, 1, 4, 4, 1, Block.netherFence.blockID, Block.netherFence.blockID, false); -- this.fillWithBlocks(var1, var3, 4, 3, 3, 4, 4, 3, Block.netherFence.blockID, Block.netherFence.blockID, false); -- this.fillWithBlocks(var1, var3, 0, 6, 0, 4, 6, 4, Block.netherBrick.blockID, Block.netherBrick.blockID, false); -- -- for(int var4 = 0; var4 <= 4; ++var4) { -- for(int var5 = 0; var5 <= 4; ++var5) { -- this.fillCurrentPositionBlocksDownwards(var1, Block.netherBrick.blockID, 0, var4, -1, var5, var3); -+ public ComponentNetherBridgeCorridor5() {} -+ -+ public ComponentNetherBridgeCorridor5(int par1, Random par2Random, StructureBoundingBox par3StructureBoundingBox, int par4) { -+ super(par1); -+ this.coordBaseMode = par4; -+ this.boundingBox = par3StructureBoundingBox; -+ } -+ -+ /** -+ * Initiates construction of the Structure Component picked, at the current Location of StructGen -+ */ -+ public void buildComponent(StructureComponent par1StructureComponent, List par2List, Random par3Random) { -+ this.getNextComponentNormal((ComponentNetherBridgeStartPiece)par1StructureComponent, par2List, par3Random, 1, 0, true); -+ } -+ -+ /** -+ * Creates and returns a new component piece. Or null if it could not find enough room to place it. -+ */ -+ public static ComponentNetherBridgeCorridor5 createValidComponent(List par0List, Random par1Random, int par2, int par3, int par4, int par5, int par6) { -+ StructureBoundingBox var7 = StructureBoundingBox.getComponentToAddBoundingBox(par2, par3, par4, -1, 0, 0, 5, 7, 5, par5); -+ return isAboveGround(var7) && StructureComponent.findIntersecting(par0List, var7) == null ? new ComponentNetherBridgeCorridor5(par6, par1Random, var7, par5) : null; -+ } -+ -+ /** -+ * second Part of Structure generating, this for example places Spiderwebs, Mob Spawners, it closes Mineshafts at the -+ * end, it adds Fences... -+ */ -+ public boolean addComponentParts(World par1World, Random par2Random, StructureBoundingBox par3StructureBoundingBox) { -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 0, 0, 0, 4, 1, 4, Block.netherBrick.blockID, Block.netherBrick.blockID, false); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 0, 2, 0, 4, 5, 4, 0, 0, false); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 0, 2, 0, 0, 5, 4, Block.netherBrick.blockID, Block.netherBrick.blockID, false); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 4, 2, 0, 4, 5, 4, Block.netherBrick.blockID, Block.netherBrick.blockID, false); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 0, 3, 1, 0, 4, 1, Block.netherFence.blockID, Block.netherFence.blockID, false); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 0, 3, 3, 0, 4, 3, Block.netherFence.blockID, Block.netherFence.blockID, false); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 4, 3, 1, 4, 4, 1, Block.netherFence.blockID, Block.netherFence.blockID, false); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 4, 3, 3, 4, 4, 3, Block.netherFence.blockID, Block.netherFence.blockID, false); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 0, 6, 0, 4, 6, 4, Block.netherBrick.blockID, Block.netherBrick.blockID, false); -+ -+ for (int var4 = 0; var4 <= 4; ++var4) { -+ for (int var5 = 0; var5 <= 4; ++var5) { -+ this.fillCurrentPositionBlocksDownwards(par1World, Block.netherBrick.blockID, 0, var4, -1, var5, par3StructureBoundingBox); - } - } - ---- net/minecraft/src/WorldGenTaiga2.java -+++ net/minecraft/src/WorldGenTaiga2.java -@@ -3,34 +3,38 @@ - import java.util.Random; - - public class WorldGenTaiga2 extends WorldGenerator { -- public WorldGenTaiga2(boolean var1) { -- super(var1); -+ public WorldGenTaiga2(boolean par1) { -+ super(par1); - } - -- public boolean generate(World var1, Random var2, int var3, int var4, int var5) { -- int var6 = var2.nextInt(4) + 6; -- int var7 = 1 + var2.nextInt(2); -+ public boolean generate(World par1World, Random par2Random, int par3, int par4, int par5) { -+ int var6 = par2Random.nextInt(4) + 6; -+ int var7 = 1 + par2Random.nextInt(2); - int var8 = var6 - var7; -- int var9 = 2 + var2.nextInt(2); -+ int var9 = 2 + par2Random.nextInt(2); - boolean var10 = true; -- if(var4 >= 1 && var4 + var6 + 1 <= 256) { -+ -+ if (par4 >= 1 && par4 + var6 + 1 <= 256) { - int var11; - int var13; - int var15; - int var21; -- for(var11 = var4; var11 <= var4 + 1 + var6 && var10; ++var11) { -+ -+ for (var11 = par4; var11 <= par4 + 1 + var6 && var10; ++var11) { - boolean var12 = true; -- if(var11 - var4 < var7) { -+ -+ if (var11 - par4 < var7) { - var21 = 0; - } else { - var21 = var9; - } - -- for(var13 = var3 - var21; var13 <= var3 + var21 && var10; ++var13) { -- for(int var14 = var5 - var21; var14 <= var5 + var21 && var10; ++var14) { -- if(var11 >= 0 && var11 < 256) { -- var15 = var1.getBlockId(var13, var11, var14); -- if(var15 != 0 && var15 != Block.leaves.blockID) { -+ for (var13 = par3 - var21; var13 <= par3 + var21 && var10; ++var13) { -+ for (int var14 = par5 - var21; var14 <= par5 + var21 && var10; ++var14) { -+ if (var11 >= 0 && var11 < 256) { -+ var15 = par1World.getBlockId(var13, var11, var14); -+ -+ if (var15 != 0 && var15 != Block.leaves.blockID) { - var10 = false; - } - } else { -@@ -40,37 +44,40 @@ - } - } - -- if(!var10) { -+ if (!var10) { - return false; - } else { -- var11 = var1.getBlockId(var3, var4 - 1, var5); -- if((var11 == Block.grass.blockID || var11 == Block.dirt.blockID) && var4 < 256 - var6 - 1) { -- this.setBlock(var1, var3, var4 - 1, var5, Block.dirt.blockID); -- var21 = var2.nextInt(2); -+ var11 = par1World.getBlockId(par3, par4 - 1, par5); -+ -+ if ((var11 == Block.grass.blockID || var11 == Block.dirt.blockID) && par4 < 256 - var6 - 1) { -+ this.setBlock(par1World, par3, par4 - 1, par5, Block.dirt.blockID); -+ var21 = par2Random.nextInt(2); - var13 = 1; - byte var22 = 0; -- - int var16; - int var17; -- for(var15 = 0; var15 <= var8; ++var15) { -- var16 = var4 + var6 - var15; -- -- for(var17 = var3 - var21; var17 <= var3 + var21; ++var17) { -- int var18 = var17 - var3; -- -- for(int var19 = var5 - var21; var19 <= var5 + var21; ++var19) { -- int var20 = var19 - var5; -- if((Math.abs(var18) != var21 || Math.abs(var20) != var21 || var21 <= 0) && !Block.opaqueCubeLookup[var1.getBlockId(var17, var16, var19)]) { -- this.setBlockAndMetadata(var1, var17, var16, var19, Block.leaves.blockID, 1); -+ -+ for (var15 = 0; var15 <= var8; ++var15) { -+ var16 = par4 + var6 - var15; -+ -+ for (var17 = par3 - var21; var17 <= par3 + var21; ++var17) { -+ int var18 = var17 - par3; -+ -+ for (int var19 = par5 - var21; var19 <= par5 + var21; ++var19) { -+ int var20 = var19 - par5; -+ -+ if ((Math.abs(var18) != var21 || Math.abs(var20) != var21 || var21 <= 0) && !Block.opaqueCubeLookup[par1World.getBlockId(var17, var16, var19)]) { -+ this.setBlockAndMetadata(par1World, var17, var16, var19, Block.leaves.blockID, 1); - } - } - } - -- if(var21 >= var13) { -+ if (var21 >= var13) { - var21 = var22; - var22 = 1; - ++var13; -- if(var13 > var9) { -+ -+ if (var13 > var9) { - var13 = var9; - } - } else { -@@ -78,12 +85,13 @@ - } - } - -- var15 = var2.nextInt(3); -- -- for(var16 = 0; var16 < var6 - var15; ++var16) { -- var17 = var1.getBlockId(var3, var4 + var16, var5); -- if(var17 == 0 || var17 == Block.leaves.blockID) { -- this.setBlockAndMetadata(var1, var3, var4 + var16, var5, Block.wood.blockID, 1); -+ var15 = par2Random.nextInt(3); -+ -+ for (var16 = 0; var16 < var6 - var15; ++var16) { -+ var17 = par1World.getBlockId(par3, par4 + var16, par5); -+ -+ if (var17 == 0 || var17 == Block.leaves.blockID) { -+ this.setBlockAndMetadata(par1World, par3, par4 + var16, par5, Block.wood.blockID, 1); - } - } - ---- net/minecraft/src/GuiScreenConfirmationType.java -+++ net/minecraft/src/GuiScreenConfirmationType.java -@@ -3,12 +3,11 @@ - public enum GuiScreenConfirmationType { - Warning("Warning!", 16711680), - Info("Info!", 8226750); -- - public final int field_140075_c; -- public final String d; -+ public final String field_140072_d; - -- private GuiScreenConfirmationType(String var3, int var4) { -- this.d = var3; -- this.field_140075_c = var4; -+ private GuiScreenConfirmationType(String par3Str, int par4) { -+ this.field_140072_d = par3Str; -+ this.field_140075_c = par4; - } - } ---- net/minecraft/src/MaterialLiquid.java -+++ net/minecraft/src/MaterialLiquid.java -@@ -1,16 +1,22 @@ - package net.minecraft.src; - - public class MaterialLiquid extends Material { -- public MaterialLiquid(MapColor var1) { -- super(var1); -+ public MaterialLiquid(MapColor par1MapColor) { -+ super(par1MapColor); - this.setReplaceable(); - this.setNoPushMobility(); - } - -+ /** -+ * Returns if blocks of these materials are liquids. -+ */ - public boolean isLiquid() { - return true; - } - -+ /** -+ * Returns if this material is considered solid or not -+ */ - public boolean blocksMovement() { - return false; - } ---- net/minecraft/src/EntityOtherPlayerMP.java -+++ net/minecraft/src/EntityOtherPlayerMP.java -@@ -9,32 +9,45 @@ - private double otherPlayerMPYaw; - private double otherPlayerMPPitch; - -- public EntityOtherPlayerMP(World var1, String var2) { -- super(var1, var2); -+ public EntityOtherPlayerMP(World par1World, String par2Str) { -+ super(par1World, par2Str); - this.yOffset = 0.0F; -- this.stepHeight = 0.0F; -+ this.stepHeight = 0.0F; - this.noClip = true; - this.field_71082_cx = 0.25F; -- this.renderDistanceWeight = 10.0D; -+ this.renderDistanceWeight = 10.0D; - } - -+ /** -+ * sets the players height back to normal after doing things like sleeping and dieing -+ */ - protected void resetHeight() { - this.yOffset = 0.0F; - } - -- public boolean attackEntityFrom(DamageSource var1, float var2) { -+ /** -+ * Called when the entity is attacked. -+ */ -+ public boolean attackEntityFrom(DamageSource par1DamageSource, float par2) { - return true; - } - -- public void setPositionAndRotation2(double var1, double var3, double var5, float var7, float var8, int var9) { -- this.otherPlayerMPX = var1; -- this.otherPlayerMPY = var3; -- this.otherPlayerMPZ = var5; -- this.otherPlayerMPYaw = (double)var7; -- this.otherPlayerMPPitch = (double)var8; -- this.otherPlayerMPPosRotationIncrements = var9; -+ /** -+ * Sets the position and rotation. Only difference from the other one is no bounding on the rotation. Args: posX, posY, -+ * posZ, yaw, pitch -+ */ -+ public void setPositionAndRotation2(double par1, double par3, double par5, float par7, float par8, int par9) { -+ this.otherPlayerMPX = par1; -+ this.otherPlayerMPY = par3; -+ this.otherPlayerMPZ = par5; -+ this.otherPlayerMPYaw = (double)par7; -+ this.otherPlayerMPPitch = (double)par8; -+ this.otherPlayerMPPosRotationIncrements = par9; - } - -+ /** -+ * Called to update the entity's position/logic. -+ */ - public void onUpdate() { - this.field_71082_cx = 0.0F; - super.onUpdate(); -@@ -42,39 +55,46 @@ - double var1 = this.posX - this.prevPosX; - double var3 = this.posZ - this.prevPosZ; - float var5 = MathHelper.sqrt_double(var1 * var1 + var3 * var3) * 4.0F; -- if(var5 > 1.0F) { -+ -+ if (var5 > 1.0F) { - var5 = 1.0F; - } - - this.limbSwingAmount += (var5 - this.limbSwingAmount) * 0.4F; - this.limbSwing += this.limbSwingAmount; -- if(!this.isItemInUse && this.isEating() && this.inventory.mainInventory[this.inventory.currentItem] != null) { -+ -+ if (!this.isItemInUse && this.isEating() && this.inventory.mainInventory[this.inventory.currentItem] != null) { - ItemStack var6 = this.inventory.mainInventory[this.inventory.currentItem]; - this.setItemInUse(this.inventory.mainInventory[this.inventory.currentItem], Item.itemsList[var6.itemID].getMaxItemUseDuration(var6)); - this.isItemInUse = true; -- } else if(this.isItemInUse && !this.isEating()) { -+ } else if (this.isItemInUse && !this.isEating()) { - this.clearItemInUse(); - this.isItemInUse = false; - } -- - } - - public float getShadowSize() { - return 0.0F; - } - -+ /** -+ * Called frequently so the entity can update its state every tick as required. For example, zombies and skeletons use -+ * this to react to sunlight and start to burn. -+ */ - public void onLivingUpdate() { - super.updateEntityActionState(); -- if(this.otherPlayerMPPosRotationIncrements > 0) { -+ -+ if (this.otherPlayerMPPosRotationIncrements > 0) { - double var1 = this.posX + (this.otherPlayerMPX - this.posX) / (double)this.otherPlayerMPPosRotationIncrements; - double var3 = this.posY + (this.otherPlayerMPY - this.posY) / (double)this.otherPlayerMPPosRotationIncrements; - double var5 = this.posZ + (this.otherPlayerMPZ - this.posZ) / (double)this.otherPlayerMPPosRotationIncrements; -- - double var7; -- for(var7 = this.otherPlayerMPYaw - (double)this.rotationYaw; var7 < -180.0D; var7 += 360.0D) { -+ -+ for (var7 = this.otherPlayerMPYaw - (double)this.rotationYaw; var7 < -180.0D; var7 += 360.0D) { -+ ; - } - -- while(var7 >= 180.0D) { -+ while (var7 >= 180.0D) { - var7 -= 360.0D; - } - -@@ -87,16 +107,17 @@ - - this.prevCameraYaw = this.cameraYaw; - float var9 = MathHelper.sqrt_double(this.motionX * this.motionX + this.motionZ * this.motionZ); -- float var2 = (float)Math.atan(-this.motionY * (double)0.2F) * 15.0F; -- if(var9 > 0.1F) { -+ float var2 = (float)Math.atan(-this.motionY * 0.20000000298023224D) * 15.0F; -+ -+ if (var9 > 0.1F) { - var9 = 0.1F; - } - -- if(!this.onGround || this.getHealth() <= 0.0F) { -+ if (!this.onGround || this.getHealth() <= 0.0F) { - var9 = 0.0F; - } - -- if(this.onGround || this.getHealth() <= 0.0F) { -+ if (this.onGround || this.getHealth() <= 0.0F) { - var2 = 0.0F; - } - -@@ -104,28 +125,36 @@ - this.cameraPitch += (var2 - this.cameraPitch) * 0.8F; - } - -- public void setCurrentItemOrArmor(int var1, ItemStack var2) { -- if(var1 == 0) { -- this.inventory.mainInventory[this.inventory.currentItem] = var2; -+ /** -+ * Sets the held item, or an armor slot. Slot 0 is held item. Slot 1-4 is armor. Params: Item, slot -+ */ -+ public void setCurrentItemOrArmor(int par1, ItemStack par2ItemStack) { -+ if (par1 == 0) { -+ this.inventory.mainInventory[this.inventory.currentItem] = par2ItemStack; - } else { -- this.inventory.armorInventory[var1 - 1] = var2; -+ this.inventory.armorInventory[par1 - 1] = par2ItemStack; - } -- - } - - public float getEyeHeight() { - return 1.82F; - } - -- public void sendChatToPlayer(ChatMessageComponent var1) { -- Minecraft.getMinecraft().ingameGUI.getChatGUI().printChatMessage(var1.toStringWithFormatting(true)); -+ public void sendChatToPlayer(ChatMessageComponent par1ChatMessageComponent) { -+ Minecraft.getMinecraft().ingameGUI.getChatGUI().printChatMessage(par1ChatMessageComponent.toStringWithFormatting(true)); - } - -- public boolean canCommandSenderUseCommand(int var1, String var2) { -+ /** -+ * Returns true if the command sender is allowed to use the given command. -+ */ -+ public boolean canCommandSenderUseCommand(int par1, String par2Str) { - return false; - } - -- public ChunkCoordinates getCommandSenderPosition() { -+ /** -+ * Return the position for this command sender. -+ */ -+ public ChunkCoordinates getPlayerCoordinates() { - return new ChunkCoordinates(MathHelper.floor_double(this.posX + 0.5D), MathHelper.floor_double(this.posY + 0.5D), MathHelper.floor_double(this.posZ + 0.5D)); - } - } ---- net/minecraft/src/OpenGlHelper.java -+++ net/minecraft/src/OpenGlHelper.java -@@ -5,46 +5,69 @@ - import org.lwjgl.opengl.GLContext; - - public class OpenGlHelper { -+ -+ /** -+ * An OpenGL constant corresponding to GL_TEXTURE0, used when setting data pertaining to auxiliary OpenGL texture -+ * units. -+ */ - public static int defaultTexUnit; -+ -+ /** -+ * An OpenGL constant corresponding to GL_TEXTURE1, used when setting data pertaining to auxiliary OpenGL texture -+ * units. -+ */ - public static int lightmapTexUnit; -+ -+ /** -+ * True if the renderer supports multitextures and the OpenGL version != 1.3 -+ */ - private static boolean useMultitextureARB; - -+ /** -+ * Initializes the texture constants to be used when rendering lightmap values -+ */ - public static void initializeTextures() { - useMultitextureARB = GLContext.getCapabilities().GL_ARB_multitexture && !GLContext.getCapabilities().OpenGL13; -- if(useMultitextureARB) { -- defaultTexUnit = '\u84c0'; -- lightmapTexUnit = '\u84c1'; -- } else { -- defaultTexUnit = '\u84c0'; -- lightmapTexUnit = '\u84c1'; -- } -- -- } -- -- public static void setActiveTexture(int var0) { -- if(useMultitextureARB) { -- ARBMultitexture.glActiveTextureARB(var0); -- } else { -- GL13.glActiveTexture(var0); -- } -- -- } -- -- public static void setClientActiveTexture(int var0) { -- if(useMultitextureARB) { -- ARBMultitexture.glClientActiveTextureARB(var0); -- } else { -- GL13.glClientActiveTexture(var0); -- } -- -- } -- -- public static void setLightmapTextureCoords(int var0, float var1, float var2) { -- if(useMultitextureARB) { -- ARBMultitexture.glMultiTexCoord2fARB(var0, var1, var2); -- } else { -- GL13.glMultiTexCoord2f(var0, var1, var2); -- } -- -+ -+ if (useMultitextureARB) { -+ defaultTexUnit = 33984; -+ lightmapTexUnit = 33985; -+ } else { -+ defaultTexUnit = 33984; -+ lightmapTexUnit = 33985; -+ } -+ } -+ -+ /** -+ * Sets the current lightmap texture to the specified OpenGL constant -+ */ -+ public static void setActiveTexture(int par0) { -+ if (useMultitextureARB) { -+ ARBMultitexture.glActiveTextureARB(par0); -+ } else { -+ GL13.glActiveTexture(par0); -+ } -+ } -+ -+ /** -+ * Sets the current lightmap texture to the specified OpenGL constant -+ */ -+ public static void setClientActiveTexture(int par0) { -+ if (useMultitextureARB) { -+ ARBMultitexture.glClientActiveTextureARB(par0); -+ } else { -+ GL13.glClientActiveTexture(par0); -+ } -+ } -+ -+ /** -+ * Sets the current coordinates of the given lightmap texture -+ */ -+ public static void setLightmapTextureCoords(int par0, float par1, float par2) { -+ if (useMultitextureARB) { -+ ARBMultitexture.glMultiTexCoord2fARB(par0, par1, par2); -+ } else { -+ GL13.glMultiTexCoord2f(par0, par1, par2); -+ } - } - } ---- net/minecraft/src/EntitySnowman.java -+++ net/minecraft/src/EntitySnowman.java -@@ -1,8 +1,8 @@ - package net.minecraft.src; - - public class EntitySnowman extends EntityGolem implements IRangedAttackMob { -- public EntitySnowman(World var1) { -- super(var1); -+ public EntitySnowman(World par1World) { -+ super(par1World); - this.setSize(0.4F, 1.8F); - this.getNavigator().setAvoidsWater(true); - this.tasks.addTask(1, new EntityAIArrowAttack(this, 1.25D, 20, 10.0F)); -@@ -12,6 +12,9 @@ - this.targetTasks.addTask(1, new EntityAINearestAttackableTarget(this, EntityLiving.class, 0, true, false, IMob.mobSelector)); - } - -+ /** -+ * Returns true if the newer Entity AI code should be run -+ */ - public boolean isAIEnabled() { - return true; - } -@@ -19,50 +22,65 @@ - protected void applyEntityAttributes() { - super.applyEntityAttributes(); - this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setAttribute(4.0D); -- this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setAttribute((double)0.2F); -+ this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setAttribute(0.20000000298023224D); - } - -+ /** -+ * Called frequently so the entity can update its state every tick as required. For example, zombies and skeletons use -+ * this to react to sunlight and start to burn. -+ */ - public void onLivingUpdate() { - super.onLivingUpdate(); -- if(this.isWet()) { -+ -+ if (this.isWet()) { - this.attackEntityFrom(DamageSource.drown, 1.0F); - } - - int var1 = MathHelper.floor_double(this.posX); - int var2 = MathHelper.floor_double(this.posZ); -- if(this.worldObj.getBiomeGenForCoords(var1, var2).getFloatTemperature() > 1.0F) { -+ -+ if (this.worldObj.getBiomeGenForCoords(var1, var2).getFloatTemperature() > 1.0F) { - this.attackEntityFrom(DamageSource.onFire, 1.0F); - } - -- for(var1 = 0; var1 < 4; ++var1) { -+ for (var1 = 0; var1 < 4; ++var1) { - var2 = MathHelper.floor_double(this.posX + (double)((float)(var1 % 2 * 2 - 1) * 0.25F)); - int var3 = MathHelper.floor_double(this.posY); - int var4 = MathHelper.floor_double(this.posZ + (double)((float)(var1 / 2 % 2 * 2 - 1) * 0.25F)); -- if(this.worldObj.getBlockId(var2, var3, var4) == 0 && this.worldObj.getBiomeGenForCoords(var2, var4).getFloatTemperature() < 0.8F && Block.snow.canPlaceBlockAt(this.worldObj, var2, var3, var4)) { -+ -+ if (this.worldObj.getBlockId(var2, var3, var4) == 0 && this.worldObj.getBiomeGenForCoords(var2, var4).getFloatTemperature() < 0.8F && Block.snow.canPlaceBlockAt(this.worldObj, var2, var3, var4)) { - this.worldObj.setBlock(var2, var3, var4, Block.snow.blockID); - } - } -- - } - -+ /** -+ * Returns the item ID for the item the mob drops on death. -+ */ - protected int getDropItemId() { - return Item.snowball.itemID; - } - -- protected void dropFewItems(boolean var1, int var2) { -- int var3 = this.ab.nextInt(16); -+ /** -+ * Drop 0-2 items of this living's type. @param par1 - Whether this entity has recently been hit by a player. @param -+ * par2 - Level of Looting used to kill this mob. -+ */ -+ protected void dropFewItems(boolean par1, int par2) { -+ int var3 = this.rand.nextInt(16); - -- for(int var4 = 0; var4 < var3; ++var4) { -+ for (int var4 = 0; var4 < var3; ++var4) { - this.dropItem(Item.snowball.itemID, 1); - } -- - } - -- public void attackEntityWithRangedAttack(EntityLivingBase var1, float var2) { -+ /** -+ * Attack the specified entity using a ranged attack. -+ */ -+ public void attackEntityWithRangedAttack(EntityLivingBase par1EntityLivingBase, float par2) { - EntitySnowball var3 = new EntitySnowball(this.worldObj, this); -- double var4 = var1.posX - this.posX; -- double var6 = var1.posY + (double)var1.getEyeHeight() - (double)1.1F - var3.posY; -- double var8 = var1.posZ - this.posZ; -+ double var4 = par1EntityLivingBase.posX - this.posX; -+ double var6 = par1EntityLivingBase.posY + (double)par1EntityLivingBase.getEyeHeight() - 1.100000023841858D - var3.posY; -+ double var8 = par1EntityLivingBase.posZ - this.posZ; - float var10 = MathHelper.sqrt_double(var4 * var4 + var8 * var8) * 0.2F; - var3.setThrowableHeading(var4, var6 + (double)var10, var8, 1.6F, 12.0F); - this.playSound("random.bow", 1.0F, 1.0F / (this.getRNG().nextFloat() * 0.4F + 0.8F)); ---- net/minecraft/src/Path.java -+++ net/minecraft/src/Path.java -@@ -1,35 +1,49 @@ - package net.minecraft.src; - - public class Path { -+ -+ /** Contains the points in this path */ - private PathPoint[] pathPoints = new PathPoint[1024]; -+ -+ /** The number of points in this path */ - private int count; - -- public PathPoint addPoint(PathPoint var1) { -- if(var1.index >= 0) { -+ /** -+ * Adds a point to the path -+ */ -+ public PathPoint addPoint(PathPoint par1PathPoint) { -+ if (par1PathPoint.index >= 0) { - throw new IllegalStateException("OW KNOWS!"); - } else { -- if(this.count == this.pathPoints.length) { -+ if (this.count == this.pathPoints.length) { - PathPoint[] var2 = new PathPoint[this.count << 1]; - System.arraycopy(this.pathPoints, 0, var2, 0, this.count); - this.pathPoints = var2; - } - -- this.pathPoints[this.count] = var1; -- var1.index = this.count; -+ this.pathPoints[this.count] = par1PathPoint; -+ par1PathPoint.index = this.count; - this.sortBack(this.count++); -- return var1; -+ return par1PathPoint; - } - } - -+ /** -+ * Clears the path -+ */ - public void clearPath() { - this.count = 0; - } - -+ /** -+ * Returns and removes the first point in the path -+ */ - public PathPoint dequeue() { - PathPoint var1 = this.pathPoints[0]; - this.pathPoints[0] = this.pathPoints[--this.count]; - this.pathPoints[this.count] = null; -- if(this.count > 0) { -+ -+ if (this.count > 0) { - this.sortForward(0); - } - -@@ -37,44 +51,55 @@ - return var1; - } - -- public void changeDistance(PathPoint var1, float var2) { -- float var3 = var1.distanceToTarget; -- var1.distanceToTarget = var2; -- if(var2 < var3) { -- this.sortBack(var1.index); -+ /** -+ * Changes the provided point's distance to target -+ */ -+ public void changeDistance(PathPoint par1PathPoint, float par2) { -+ float var3 = par1PathPoint.distanceToTarget; -+ par1PathPoint.distanceToTarget = par2; -+ -+ if (par2 < var3) { -+ this.sortBack(par1PathPoint.index); - } else { -- this.sortForward(var1.index); -+ this.sortForward(par1PathPoint.index); - } -- - } - -- private void sortBack(int var1) { -- PathPoint var2 = this.pathPoints[var1]; -- -+ /** -+ * Sorts a point to the left -+ */ -+ private void sortBack(int par1) { -+ PathPoint var2 = this.pathPoints[par1]; - int var4; -- for(float var3 = var2.distanceToTarget; var1 > 0; var1 = var4) { -- var4 = var1 - 1 >> 1; -+ -+ for (float var3 = var2.distanceToTarget; par1 > 0; par1 = var4) { -+ var4 = par1 - 1 >> 1; - PathPoint var5 = this.pathPoints[var4]; -- if(var3 >= var5.distanceToTarget) { -+ -+ if (var3 >= var5.distanceToTarget) { - break; - } - -- this.pathPoints[var1] = var5; -- var5.index = var1; -+ this.pathPoints[par1] = var5; -+ var5.index = par1; - } - -- this.pathPoints[var1] = var2; -- var2.index = var1; -+ this.pathPoints[par1] = var2; -+ var2.index = par1; - } - -- private void sortForward(int var1) { -- PathPoint var2 = this.pathPoints[var1]; -+ /** -+ * Sorts a point to the right -+ */ -+ private void sortForward(int par1) { -+ PathPoint var2 = this.pathPoints[par1]; - float var3 = var2.distanceToTarget; - -- while(true) { -- int var4 = 1 + (var1 << 1); -+ while (true) { -+ int var4 = 1 + (par1 << 1); - int var5 = var4 + 1; -- if(var4 >= this.count) { -+ -+ if (var4 >= this.count) { - break; - } - -@@ -82,7 +107,8 @@ - float var7 = var6.distanceToTarget; - PathPoint var8; - float var9; -- if(var5 >= this.count) { -+ -+ if (var5 >= this.count) { - var8 = null; - var9 = Float.POSITIVE_INFINITY; - } else { -@@ -90,29 +116,32 @@ - var9 = var8.distanceToTarget; - } - -- if(var7 < var9) { -- if(var7 >= var3) { -+ if (var7 < var9) { -+ if (var7 >= var3) { - break; - } - -- this.pathPoints[var1] = var6; -- var6.index = var1; -- var1 = var4; -+ this.pathPoints[par1] = var6; -+ var6.index = par1; -+ par1 = var4; - } else { -- if(var9 >= var3) { -+ if (var9 >= var3) { - break; - } - -- this.pathPoints[var1] = var8; -- var8.index = var1; -- var1 = var5; -+ this.pathPoints[par1] = var8; -+ var8.index = par1; -+ par1 = var5; - } - } - -- this.pathPoints[var1] = var2; -- var2.index = var1; -+ this.pathPoints[par1] = var2; -+ var2.index = par1; - } - -+ /** -+ * Returns true if this path contains no points -+ */ - public boolean isPathEmpty() { - return this.count == 0; - } ---- net/minecraft/src/EntityRainFX.java -+++ net/minecraft/src/EntityRainFX.java -@@ -1,49 +1,68 @@ - package net.minecraft.src; - -+// MCPatcher Start -+import com.prupe.mcpatcher.cc.ColorizeBlock; -+// MCPatcher End -+ - public class EntityRainFX extends EntityFX { -- public EntityRainFX(World var1, double var2, double var4, double var6) { -- super(var1, var2, var4, var6, 0.0D, 0.0D, 0.0D); -- this.motionX *= (double)0.3F; -+ public EntityRainFX(World par1World, double par2, double par4, double par6) { -+ super(par1World, par2, par4, par6, 0.0D, 0.0D, 0.0D); -+ this.motionX *= 0.30000001192092896D; - this.motionY = (double)((float)Math.random() * 0.2F + 0.1F); -- this.motionZ *= (double)0.3F; -- this.particleRed = 1.0F; -- this.particleGreen = 1.0F; -- this.particleBlue = 1.0F; -- this.setParticleTextureIndex(19 + this.ab.nextInt(4)); -+ this.motionZ *= 0.30000001192092896D; -+ -+ // MCPatcher Start -+ if (ColorizeBlock.computeWaterColor(this.posX, this.posY, this.posZ)) { -+ this.particleRed = ColorizeBlock.waterColor[0]; -+ this.particleGreen = ColorizeBlock.waterColor[1]; -+ this.particleBlue = ColorizeBlock.waterColor[2]; -+ } else { -+ this.particleRed = 0.2F; -+ this.particleGreen = 0.3F; -+ this.particleBlue = 1.0F; -+ } -+ // MCPatcher End -+ -+ this.setParticleTextureIndex(19 + this.rand.nextInt(4)); - this.setSize(0.01F, 0.01F); - this.particleGravity = 0.06F; - this.particleMaxAge = (int)(8.0D / (Math.random() * 0.8D + 0.2D)); - } - -+ /** -+ * Called to update the entity's position/logic. -+ */ - public void onUpdate() { - this.prevPosX = this.posX; - this.prevPosY = this.posY; - this.prevPosZ = this.posZ; - this.motionY -= (double)this.particleGravity; - this.moveEntity(this.motionX, this.motionY, this.motionZ); -- this.motionX *= (double)0.98F; -- this.motionY *= (double)0.98F; -- this.motionZ *= (double)0.98F; -- if(this.particleMaxAge-- <= 0) { -+ this.motionX *= 0.9800000190734863D; -+ this.motionY *= 0.9800000190734863D; -+ this.motionZ *= 0.9800000190734863D; -+ -+ if (this.particleMaxAge-- <= 0) { - this.setDead(); - } - -- if(this.onGround) { -- if(Math.random() < 0.5D) { -+ if (this.onGround) { -+ if (Math.random() < 0.5D) { - this.setDead(); - } - -- this.motionX *= (double)0.7F; -- this.motionZ *= (double)0.7F; -+ this.motionX *= 0.699999988079071D; -+ this.motionZ *= 0.699999988079071D; - } - - Material var1 = this.worldObj.getBlockMaterial(MathHelper.floor_double(this.posX), MathHelper.floor_double(this.posY), MathHelper.floor_double(this.posZ)); -- if(var1.isLiquid() || var1.isSolid()) { -+ -+ if (var1.isLiquid() || var1.isSolid()) { - double var2 = (double)((float)(MathHelper.floor_double(this.posY) + 1) - BlockFluid.getFluidHeightPercent(this.worldObj.getBlockMetadata(MathHelper.floor_double(this.posX), MathHelper.floor_double(this.posY), MathHelper.floor_double(this.posZ)))); -- if(this.posY < var2) { -+ -+ if (this.posY < var2) { - this.setDead(); - } - } -- - } - } ---- net/minecraft/src/EntityAIDefendVillage.java -+++ net/minecraft/src/EntityAIDefendVillage.java -@@ -2,22 +2,31 @@ - - public class EntityAIDefendVillage extends EntityAITarget { - EntityIronGolem irongolem; -+ -+ /** -+ * The aggressor of the iron golem's village which is now the golem's attack target. -+ */ - EntityLivingBase villageAgressorTarget; - -- public EntityAIDefendVillage(EntityIronGolem var1) { -- super(var1, false, true); -- this.irongolem = var1; -+ public EntityAIDefendVillage(EntityIronGolem par1EntityIronGolem) { -+ super(par1EntityIronGolem, false, true); -+ this.irongolem = par1EntityIronGolem; - this.setMutexBits(1); - } - -+ /** -+ * Returns whether the EntityAIBase should begin execution. -+ */ - public boolean shouldExecute() { - Village var1 = this.irongolem.getVillage(); -- if(var1 == null) { -+ -+ if (var1 == null) { - return false; - } else { - this.villageAgressorTarget = var1.findNearestVillageAggressor(this.irongolem); -- if(!this.isSuitableTarget(this.villageAgressorTarget, false)) { -- if(this.taskOwner.getRNG().nextInt(20) == 0) { -+ -+ if (!this.isSuitableTarget(this.villageAgressorTarget, false)) { -+ if (this.taskOwner.getRNG().nextInt(20) == 0) { - this.villageAgressorTarget = var1.func_82685_c(this.irongolem); - return this.isSuitableTarget(this.villageAgressorTarget, false); - } else { -@@ -29,6 +38,9 @@ - } - } - -+ /** -+ * Execute a one shot task or start executing a continuous task -+ */ - public void startExecuting() { - this.irongolem.setAttackTarget(this.villageAgressorTarget); - super.startExecuting(); ---- net/minecraft/src/EntityBubbleFX.java -+++ net/minecraft/src/EntityBubbleFX.java -@@ -1,36 +1,51 @@ - package net.minecraft.src; - -+// MCPatcher Start -+import com.prupe.mcpatcher.cc.ColorizeBlock; -+// MCPatcher End -+ - public class EntityBubbleFX extends EntityFX { -- public EntityBubbleFX(World var1, double var2, double var4, double var6, double var8, double var10, double var12) { -- super(var1, var2, var4, var6, var8, var10, var12); -- this.particleRed = 1.0F; -- this.particleGreen = 1.0F; -- this.particleBlue = 1.0F; -+ public EntityBubbleFX(World par1World, double par2, double par4, double par6, double par8, double par10, double par12) { -+ super(par1World, par2, par4, par6, par8, par10, par12); -+ // MCPatcher Start -+ if (ColorizeBlock.computeWaterColor(this.posX, this.posY, this.posZ)) { -+ this.particleRed = ColorizeBlock.waterColor[0]; -+ this.particleGreen = ColorizeBlock.waterColor[1]; -+ this.particleBlue = ColorizeBlock.waterColor[2]; -+ } else { -+ this.particleRed = 1.0F; -+ this.particleGreen = 1.0F; -+ this.particleBlue = 1.0F; -+ } -+ // MCPatcher End - this.setParticleTextureIndex(32); - this.setSize(0.02F, 0.02F); -- this.particleScale *= this.ab.nextFloat() * 0.6F + 0.2F; -- this.motionX = var8 * (double)0.2F + (double)((float)(Math.random() * 2.0D - 1.0D) * 0.02F); -- this.motionY = var10 * (double)0.2F + (double)((float)(Math.random() * 2.0D - 1.0D) * 0.02F); -- this.motionZ = var12 * (double)0.2F + (double)((float)(Math.random() * 2.0D - 1.0D) * 0.02F); -+ this.particleScale *= this.rand.nextFloat() * 0.6F + 0.2F; -+ this.motionX = par8 * 0.20000000298023224D + (double)((float)(Math.random() * 2.0D - 1.0D) * 0.02F); -+ this.motionY = par10 * 0.20000000298023224D + (double)((float)(Math.random() * 2.0D - 1.0D) * 0.02F); -+ this.motionZ = par12 * 0.20000000298023224D + (double)((float)(Math.random() * 2.0D - 1.0D) * 0.02F); - this.particleMaxAge = (int)(8.0D / (Math.random() * 0.8D + 0.2D)); - } - -+ /** -+ * Called to update the entity's position/logic. -+ */ - public void onUpdate() { - this.prevPosX = this.posX; - this.prevPosY = this.posY; - this.prevPosZ = this.posZ; - this.motionY += 0.002D; - this.moveEntity(this.motionX, this.motionY, this.motionZ); -- this.motionX *= (double)0.85F; -- this.motionY *= (double)0.85F; -- this.motionZ *= (double)0.85F; -- if(this.worldObj.getBlockMaterial(MathHelper.floor_double(this.posX), MathHelper.floor_double(this.posY), MathHelper.floor_double(this.posZ)) != Material.water) { -- this.setDead(); -- } -- -- if(this.particleMaxAge-- <= 0) { -- this.setDead(); -- } -- -+ this.motionX *= 0.8500000238418579D; -+ this.motionY *= 0.8500000238418579D; -+ this.motionZ *= 0.8500000238418579D; -+ -+ if (this.worldObj.getBlockMaterial(MathHelper.floor_double(this.posX), MathHelper.floor_double(this.posY), MathHelper.floor_double(this.posZ)) != Material.water) { -+ this.setDead(); -+ } -+ -+ if (this.particleMaxAge-- <= 0) { -+ this.setDead(); -+ } - } - } ---- net/minecraft/src/TileEntityHopper.java -+++ net/minecraft/src/TileEntityHopper.java -@@ -4,35 +4,44 @@ - - public class TileEntityHopper extends TileEntity implements Hopper { - private ItemStack[] hopperItemStacks = new ItemStack[5]; -- private String b; -+ -+ /** The name that is displayed if the hopper was renamed */ -+ private String inventoryName; - private int transferCooldown = -1; - -- public void readFromNBT(NBTTagCompound var1) { -- super.readFromNBT(var1); -- NBTTagList var2 = var1.getTagList("Items"); -+ /** -+ * Reads a tile entity from NBT. -+ */ -+ public void readFromNBT(NBTTagCompound par1NBTTagCompound) { -+ super.readFromNBT(par1NBTTagCompound); -+ NBTTagList var2 = par1NBTTagCompound.getTagList("Items"); - this.hopperItemStacks = new ItemStack[this.getSizeInventory()]; -- if(var1.hasKey("CustomName")) { -- this.b = var1.getString("CustomName"); -+ -+ if (par1NBTTagCompound.hasKey("CustomName")) { -+ this.inventoryName = par1NBTTagCompound.getString("CustomName"); - } - -- this.transferCooldown = var1.getInteger("TransferCooldown"); -+ this.transferCooldown = par1NBTTagCompound.getInteger("TransferCooldown"); - -- for(int var3 = 0; var3 < var2.tagCount(); ++var3) { -+ for (int var3 = 0; var3 < var2.tagCount(); ++var3) { - NBTTagCompound var4 = (NBTTagCompound)var2.tagAt(var3); - byte var5 = var4.getByte("Slot"); -- if(var5 >= 0 && var5 < this.hopperItemStacks.length) { -+ -+ if (var5 >= 0 && var5 < this.hopperItemStacks.length) { - this.hopperItemStacks[var5] = ItemStack.loadItemStackFromNBT(var4); - } - } -- - } - -- public void writeToNBT(NBTTagCompound var1) { -- super.writeToNBT(var1); -+ /** -+ * Writes a tile entity to NBT. -+ */ -+ public void writeToNBT(NBTTagCompound par1NBTTagCompound) { -+ super.writeToNBT(par1NBTTagCompound); - NBTTagList var2 = new NBTTagList(); - -- for(int var3 = 0; var3 < this.hopperItemStacks.length; ++var3) { -- if(this.hopperItemStacks[var3] != null) { -+ for (int var3 = 0; var3 < this.hopperItemStacks.length; ++var3) { -+ if (this.hopperItemStacks[var3] != null) { - NBTTagCompound var4 = new NBTTagCompound(); - var4.setByte("Slot", (byte)var3); - this.hopperItemStacks[var3].writeToNBT(var4); -@@ -40,37 +49,52 @@ - } - } - -- var1.setTag("Items", var2); -- var1.setInteger("TransferCooldown", this.transferCooldown); -- if(this.isInvNameLocalized()) { -- var1.setString("CustomName", this.b); -+ par1NBTTagCompound.setTag("Items", var2); -+ par1NBTTagCompound.setInteger("TransferCooldown", this.transferCooldown); -+ -+ if (this.isInvNameLocalized()) { -+ par1NBTTagCompound.setString("CustomName", this.inventoryName); - } -- - } - -+ /** -+ * Called when an the contents of an Inventory change, usually -+ */ - public void onInventoryChanged() { - super.onInventoryChanged(); - } - -+ /** -+ * Returns the number of slots in the inventory. -+ */ - public int getSizeInventory() { - return this.hopperItemStacks.length; - } - -- public ItemStack getStackInSlot(int var1) { -- return this.hopperItemStacks[var1]; -+ /** -+ * Returns the stack in slot i -+ */ -+ public ItemStack getStackInSlot(int par1) { -+ return this.hopperItemStacks[par1]; - } - -- public ItemStack decrStackSize(int var1, int var2) { -- if(this.hopperItemStacks[var1] != null) { -+ /** -+ * Removes from an inventory slot (first arg) up to a specified number (second arg) of items and returns them in a new -+ * stack. -+ */ -+ public ItemStack decrStackSize(int par1, int par2) { -+ if (this.hopperItemStacks[par1] != null) { - ItemStack var3; -- if(this.hopperItemStacks[var1].stackSize <= var2) { -- var3 = this.hopperItemStacks[var1]; -- this.hopperItemStacks[var1] = null; -+ -+ if (this.hopperItemStacks[par1].stackSize <= par2) { -+ var3 = this.hopperItemStacks[par1]; -+ this.hopperItemStacks[par1] = null; - return var3; - } else { -- var3 = this.hopperItemStacks[var1].splitStack(var2); -- if(this.hopperItemStacks[var1].stackSize == 0) { -- this.hopperItemStacks[var1] = null; -+ var3 = this.hopperItemStacks[par1].splitStack(par2); -+ -+ if (this.hopperItemStacks[par1].stackSize == 0) { -+ this.hopperItemStacks[par1] = null; - } - - return var3; -@@ -80,71 +104,98 @@ - } - } - -- public ItemStack getStackInSlotOnClosing(int var1) { -- if(this.hopperItemStacks[var1] != null) { -- ItemStack var2 = this.hopperItemStacks[var1]; -- this.hopperItemStacks[var1] = null; -+ /** -+ * When some containers are closed they call this on each slot, then drop whatever it returns as an EntityItem - like -+ * when you close a workbench GUI. -+ */ -+ public ItemStack getStackInSlotOnClosing(int par1) { -+ if (this.hopperItemStacks[par1] != null) { -+ ItemStack var2 = this.hopperItemStacks[par1]; -+ this.hopperItemStacks[par1] = null; - return var2; - } else { - return null; - } - } - -- public void setInventorySlotContents(int var1, ItemStack var2) { -- this.hopperItemStacks[var1] = var2; -- if(var2 != null && var2.stackSize > this.getInventoryStackLimit()) { -- var2.stackSize = this.getInventoryStackLimit(); -+ /** -+ * Sets the given item stack to the specified slot in the inventory (can be crafting or armor sections). -+ */ -+ public void setInventorySlotContents(int par1, ItemStack par2ItemStack) { -+ this.hopperItemStacks[par1] = par2ItemStack; -+ -+ if (par2ItemStack != null && par2ItemStack.stackSize > this.getInventoryStackLimit()) { -+ par2ItemStack.stackSize = this.getInventoryStackLimit(); - } -- - } - -+ /** -+ * Returns the name of the inventory. -+ */ - public String getInvName() { -- return this.isInvNameLocalized() ? this.b : "container.hopper"; -+ return this.isInvNameLocalized() ? this.inventoryName : "container.hopper"; - } - -+ /** -+ * If this returns false, the inventory name will be used as an unlocalized name, and translated into the player's -+ * language. Otherwise it will be used directly. -+ */ - public boolean isInvNameLocalized() { -- return this.b != null && this.b.length() > 0; -- } -- -- public void setInventoryName(String var1) { -- this.b = var1; -- } -- -+ return this.inventoryName != null && this.inventoryName.length() > 0; -+ } -+ -+ public void setInventoryName(String par1Str) { -+ this.inventoryName = par1Str; -+ } -+ -+ /** -+ * Returns the maximum stack size for a inventory slot. Seems to always be 64, possibly will be extended. *Isn't this -+ * more of a set than a get?* -+ */ - public int getInventoryStackLimit() { - return 64; - } - -- public boolean isUseableByPlayer(EntityPlayer var1) { -- return this.worldObj.getBlockTileEntity(this.xCoord, this.yCoord, this.zCoord) != this ? false : var1.getDistanceSq((double)this.xCoord + 0.5D, (double)this.yCoord + 0.5D, (double)this.zCoord + 0.5D) <= 64.0D; -- } -- -- public void openChest() { -- } -- -- public void closeChest() { -- } -- -- public boolean isItemValidForSlot(int var1, ItemStack var2) { -+ /** -+ * Do not make give this method the name canInteractWith because it clashes with Container -+ */ -+ public boolean isUseableByPlayer(EntityPlayer par1EntityPlayer) { -+ return this.worldObj.getBlockTileEntity(this.xCoord, this.yCoord, this.zCoord) != this ? false : par1EntityPlayer.getDistanceSq((double)this.xCoord + 0.5D, (double)this.yCoord + 0.5D, (double)this.zCoord + 0.5D) <= 64.0D; -+ } -+ -+ public void openChest() {} -+ -+ public void closeChest() {} -+ -+ /** -+ * Returns true if automation is allowed to insert the given stack (ignoring stack size) into the given slot. -+ */ -+ public boolean isItemValidForSlot(int par1, ItemStack par2ItemStack) { - return true; - } - -+ /** -+ * Allows the entity to update its state. Overridden in most subclasses, e.g. the mob spawner uses this to count ticks -+ * and creates a new spawn inside its implementation. -+ */ - public void updateEntity() { -- if(this.worldObj != null && !this.worldObj.isRemote) { -+ if (this.worldObj != null && !this.worldObj.isRemote) { - --this.transferCooldown; -- if(!this.isCoolingDown()) { -+ -+ if (!this.isCoolingDown()) { - this.setTransferCooldown(0); - this.updateHopper(); - } -- - } - } - - public boolean updateHopper() { -- if(this.worldObj != null && !this.worldObj.isRemote) { -- if(!this.isCoolingDown() && BlockHopper.getIsBlockNotPoweredFromMetadata(this.getBlockMetadata())) { -+ if (this.worldObj != null && !this.worldObj.isRemote) { -+ if (!this.isCoolingDown() && BlockHopper.getIsBlockNotPoweredFromMetadata(this.getBlockMetadata())) { - boolean var1 = this.insertItemToInventory(); - var1 = suckItemsIntoHopper(this) || var1; -- if(var1) { -+ -+ if (var1) { - this.setTransferCooldown(8); - this.onInventoryChanged(); - return true; -@@ -157,16 +208,21 @@ - } - } - -+ /** -+ * Inserts one item from the hopper into the inventory the hopper is pointing at. -+ */ - private boolean insertItemToInventory() { - IInventory var1 = this.getOutputInventory(); -- if(var1 == null) { -+ -+ if (var1 == null) { - return false; - } else { -- for(int var2 = 0; var2 < this.getSizeInventory(); ++var2) { -- if(this.getStackInSlot(var2) != null) { -+ for (int var2 = 0; var2 < this.getSizeInventory(); ++var2) { -+ if (this.getStackInSlot(var2) != null) { - ItemStack var3 = this.getStackInSlot(var2).copy(); - ItemStack var4 = insertStack(var1, this.decrStackSize(var2, 1), Facing.oppositeSide[BlockHopper.getDirectionFromMetadata(this.getBlockMetadata())]); -- if(var4 == null || var4.stackSize == 0) { -+ -+ if (var4 == null || var4.stackSize == 0) { - var1.onInventoryChanged(); - return true; - } -@@ -179,191 +235,232 @@ - } - } - -- public static boolean suckItemsIntoHopper(Hopper var0) { -- IInventory var1 = getInventoryAboveHopper(var0); -- if(var1 != null) { -+ /** -+ * Sucks one item into the given hopper from an inventory or EntityItem above it. -+ */ -+ public static boolean suckItemsIntoHopper(Hopper par0Hopper) { -+ IInventory var1 = getInventoryAboveHopper(par0Hopper); -+ -+ if (var1 != null) { - byte var2 = 0; -- if(var1 instanceof ISidedInventory && var2 > -1) { -+ -+ if (var1 instanceof ISidedInventory && var2 > -1) { - ISidedInventory var7 = (ISidedInventory)var1; -- int[] var8 = var7.getSlotsForFace(var2); -+ int[] var8 = var7.getAccessibleSlotsFromSide(var2); - -- for(int var5 = 0; var5 < var8.length; ++var5) { -- if(insertStackFromInventory(var0, var1, var8[var5], var2)) { -+ for (int var5 = 0; var5 < var8.length; ++var5) { -+ if (insertStackFromInventory(par0Hopper, var1, var8[var5], var2)) { - return true; - } - } - } else { - int var3 = var1.getSizeInventory(); - -- for(int var4 = 0; var4 < var3; ++var4) { -- if(insertStackFromInventory(var0, var1, var4, var2)) { -+ for (int var4 = 0; var4 < var3; ++var4) { -+ if (insertStackFromInventory(par0Hopper, var1, var4, var2)) { - return true; - } - } - } - } else { -- EntityItem var6 = getEntityAbove(var0.getWorldObj(), var0.getXPos(), var0.getYPos() + 1.0D, var0.getZPos()); -- if(var6 != null) { -- return insertStackFromEntity(var0, var6); -+ EntityItem var6 = getEntityAbove(par0Hopper.getWorldObj(), par0Hopper.getXPos(), par0Hopper.getYPos() + 1.0D, par0Hopper.getZPos()); -+ -+ if (var6 != null) { -+ return insertStackFromEntity(par0Hopper, var6); - } - } - - return false; - } - -- private static boolean insertStackFromInventory(Hopper var0, IInventory var1, int var2, int var3) { -- ItemStack var4 = var1.getStackInSlot(var2); -- if(var4 != null && canExtractItemFromInventory(var1, var4, var2, var3)) { -+ private static boolean insertStackFromInventory(Hopper par0Hopper, IInventory par1IInventory, int par2, int par3) { -+ ItemStack var4 = par1IInventory.getStackInSlot(par2); -+ -+ if (var4 != null && canExtractItemFromInventory(par1IInventory, var4, par2, par3)) { - ItemStack var5 = var4.copy(); -- ItemStack var6 = insertStack(var0, var1.decrStackSize(var2, 1), -1); -- if(var6 == null || var6.stackSize == 0) { -- var1.onInventoryChanged(); -+ ItemStack var6 = insertStack(par0Hopper, par1IInventory.decrStackSize(par2, 1), -1); -+ -+ if (var6 == null || var6.stackSize == 0) { -+ par1IInventory.onInventoryChanged(); - return true; - } - -- var1.setInventorySlotContents(var2, var5); -+ par1IInventory.setInventorySlotContents(par2, var5); - } - - return false; - } - -- public static boolean insertStackFromEntity(IInventory var0, EntityItem var1) { -+ public static boolean insertStackFromEntity(IInventory par0IInventory, EntityItem par1EntityItem) { - boolean var2 = false; -- if(var1 == null) { -+ -+ if (par1EntityItem == null) { - return false; - } else { -- ItemStack var3 = var1.getEntityItem().copy(); -- ItemStack var4 = insertStack(var0, var3, -1); -- if(var4 != null && var4.stackSize != 0) { -- var1.setEntityItemStack(var4); -+ ItemStack var3 = par1EntityItem.getEntityItem().copy(); -+ ItemStack var4 = insertStack(par0IInventory, var3, -1); -+ -+ if (var4 != null && var4.stackSize != 0) { -+ par1EntityItem.setEntityItemStack(var4); - } else { - var2 = true; -- var1.setDead(); -+ par1EntityItem.setDead(); - } - - return var2; - } - } - -- public static ItemStack insertStack(IInventory var0, ItemStack var1, int var2) { -- if(var0 instanceof ISidedInventory && var2 > -1) { -- ISidedInventory var6 = (ISidedInventory)var0; -- int[] var7 = var6.getSlotsForFace(var2); -+ /** -+ * Inserts a stack into an inventory. Args: Inventory, stack, side. Returns leftover items. -+ */ -+ public static ItemStack insertStack(IInventory par0IInventory, ItemStack par1ItemStack, int par2) { -+ if (par0IInventory instanceof ISidedInventory && par2 > -1) { -+ ISidedInventory var6 = (ISidedInventory)par0IInventory; -+ int[] var7 = var6.getAccessibleSlotsFromSide(par2); - -- for(int var5 = 0; var5 < var7.length && var1 != null && var1.stackSize > 0; ++var5) { -- var1 = func_102014_c(var0, var1, var7[var5], var2); -+ for (int var5 = 0; var5 < var7.length && par1ItemStack != null && par1ItemStack.stackSize > 0; ++var5) { -+ par1ItemStack = func_102014_c(par0IInventory, par1ItemStack, var7[var5], par2); - } - } else { -- int var3 = var0.getSizeInventory(); -+ int var3 = par0IInventory.getSizeInventory(); - -- for(int var4 = 0; var4 < var3 && var1 != null && var1.stackSize > 0; ++var4) { -- var1 = func_102014_c(var0, var1, var4, var2); -+ for (int var4 = 0; var4 < var3 && par1ItemStack != null && par1ItemStack.stackSize > 0; ++var4) { -+ par1ItemStack = func_102014_c(par0IInventory, par1ItemStack, var4, par2); - } - } - -- if(var1 != null && var1.stackSize == 0) { -- var1 = null; -+ if (par1ItemStack != null && par1ItemStack.stackSize == 0) { -+ par1ItemStack = null; - } - -- return var1; -- } -- -- private static boolean canInsertItemToInventory(IInventory var0, ItemStack var1, int var2, int var3) { -- return !var0.isItemValidForSlot(var2, var1) ? false : !(var0 instanceof ISidedInventory) || ((ISidedInventory)var0).canInsertItem(var2, var1, var3); -- } -- -- private static boolean canExtractItemFromInventory(IInventory var0, ItemStack var1, int var2, int var3) { -- return !(var0 instanceof ISidedInventory) || ((ISidedInventory)var0).canExtractItem(var2, var1, var3); -- } -- -- private static ItemStack func_102014_c(IInventory var0, ItemStack var1, int var2, int var3) { -- ItemStack var4 = var0.getStackInSlot(var2); -- if(canInsertItemToInventory(var0, var1, var2, var3)) { -+ return par1ItemStack; -+ } -+ -+ /** -+ * Args: inventory, item, slot, side -+ */ -+ private static boolean canInsertItemToInventory(IInventory par0IInventory, ItemStack par1ItemStack, int par2, int par3) { -+ return !par0IInventory.isItemValidForSlot(par2, par1ItemStack) ? false : !(par0IInventory instanceof ISidedInventory) || ((ISidedInventory)par0IInventory).canInsertItem(par2, par1ItemStack, par3); -+ } -+ -+ private static boolean canExtractItemFromInventory(IInventory par0IInventory, ItemStack par1ItemStack, int par2, int par3) { -+ return !(par0IInventory instanceof ISidedInventory) || ((ISidedInventory)par0IInventory).canExtractItem(par2, par1ItemStack, par3); -+ } -+ -+ private static ItemStack func_102014_c(IInventory par0IInventory, ItemStack par1ItemStack, int par2, int par3) { -+ ItemStack var4 = par0IInventory.getStackInSlot(par2); -+ -+ if (canInsertItemToInventory(par0IInventory, par1ItemStack, par2, par3)) { - boolean var5 = false; -- if(var4 == null) { -- var0.setInventorySlotContents(var2, var1); -- var1 = null; -+ -+ if (var4 == null) { -+ par0IInventory.setInventorySlotContents(par2, par1ItemStack); -+ par1ItemStack = null; - var5 = true; -- } else if(areItemStacksEqualItem(var4, var1)) { -- int var6 = var1.getMaxStackSize() - var4.stackSize; -- int var7 = Math.min(var1.stackSize, var6); -- var1.stackSize -= var7; -+ } else if (areItemStacksEqualItem(var4, par1ItemStack)) { -+ int var6 = par1ItemStack.getMaxStackSize() - var4.stackSize; -+ int var7 = Math.min(par1ItemStack.stackSize, var6); -+ par1ItemStack.stackSize -= var7; - var4.stackSize += var7; - var5 = var7 > 0; - } - -- if(var5) { -- if(var0 instanceof TileEntityHopper) { -- ((TileEntityHopper)var0).setTransferCooldown(8); -- var0.onInventoryChanged(); -+ if (var5) { -+ if (par0IInventory instanceof TileEntityHopper) { -+ ((TileEntityHopper)par0IInventory).setTransferCooldown(8); -+ par0IInventory.onInventoryChanged(); - } - -- var0.onInventoryChanged(); -+ par0IInventory.onInventoryChanged(); - } - } - -- return var1; -+ return par1ItemStack; - } - -+ /** -+ * Gets the inventory the hopper is pointing at. -+ */ - private IInventory getOutputInventory() { - int var1 = BlockHopper.getDirectionFromMetadata(this.getBlockMetadata()); - return getInventoryAtLocation(this.getWorldObj(), (double)(this.xCoord + Facing.offsetsXForSide[var1]), (double)(this.yCoord + Facing.offsetsYForSide[var1]), (double)(this.zCoord + Facing.offsetsZForSide[var1])); - } - -- public static IInventory getInventoryAboveHopper(Hopper var0) { -- return getInventoryAtLocation(var0.getWorldObj(), var0.getXPos(), var0.getYPos() + 1.0D, var0.getZPos()); -+ /** -+ * Looks for anything, that can hold items (like chests, furnaces, etc.) one block above the given hopper. -+ */ -+ public static IInventory getInventoryAboveHopper(Hopper par0Hopper) { -+ return getInventoryAtLocation(par0Hopper.getWorldObj(), par0Hopper.getXPos(), par0Hopper.getYPos() + 1.0D, par0Hopper.getZPos()); - } - -- public static EntityItem getEntityAbove(World var0, double var1, double var3, double var5) { -- List var7 = var0.selectEntitiesWithinAABB(EntityItem.class, AxisAlignedBB.getAABBPool().getAABB(var1, var3, var5, var1 + 1.0D, var3 + 1.0D, var5 + 1.0D), IEntitySelector.selectAnything); -+ public static EntityItem getEntityAbove(World par0World, double par1, double par3, double par5) { -+ List var7 = par0World.selectEntitiesWithinAABB(EntityItem.class, AxisAlignedBB.getAABBPool().getAABB(par1, par3, par5, par1 + 1.0D, par3 + 1.0D, par5 + 1.0D), IEntitySelector.selectAnything); - return var7.size() > 0 ? (EntityItem)var7.get(0) : null; - } - -- public static IInventory getInventoryAtLocation(World var0, double var1, double var3, double var5) { -+ /** -+ * Gets an inventory at the given location to extract items into or take items from. Can find either a tile entity or -+ * regular entity implementing IInventory. -+ */ -+ public static IInventory getInventoryAtLocation(World par0World, double par1, double par3, double par5) { - IInventory var7 = null; -- int var8 = MathHelper.floor_double(var1); -- int var9 = MathHelper.floor_double(var3); -- int var10 = MathHelper.floor_double(var5); -- TileEntity var11 = var0.getBlockTileEntity(var8, var9, var10); -- if(var11 != null && var11 instanceof IInventory) { -+ int var8 = MathHelper.floor_double(par1); -+ int var9 = MathHelper.floor_double(par3); -+ int var10 = MathHelper.floor_double(par5); -+ TileEntity var11 = par0World.getBlockTileEntity(var8, var9, var10); -+ -+ if (var11 != null && var11 instanceof IInventory) { - var7 = (IInventory)var11; -- if(var7 instanceof TileEntityChest) { -- int var12 = var0.getBlockId(var8, var9, var10); -+ -+ if (var7 instanceof TileEntityChest) { -+ int var12 = par0World.getBlockId(var8, var9, var10); - Block var13 = Block.blocksList[var12]; -- if(var13 instanceof BlockChest) { -- var7 = ((BlockChest)var13).getInventory(var0, var8, var9, var10); -+ -+ if (var13 instanceof BlockChest) { -+ var7 = ((BlockChest)var13).getInventory(par0World, var8, var9, var10); - } - } - } - -- if(var7 == null) { -- List var14 = var0.getEntitiesWithinAABBExcludingEntity((Entity)null, AxisAlignedBB.getAABBPool().getAABB(var1, var3, var5, var1 + 1.0D, var3 + 1.0D, var5 + 1.0D), IEntitySelector.selectInventories); -- if(var14 != null && var14.size() > 0) { -- var7 = (IInventory)var14.get(var0.s.nextInt(var14.size())); -+ if (var7 == null) { -+ List var14 = par0World.getEntitiesWithinAABBExcludingEntity((Entity)null, AxisAlignedBB.getAABBPool().getAABB(par1, par3, par5, par1 + 1.0D, par3 + 1.0D, par5 + 1.0D), IEntitySelector.selectInventories); -+ -+ if (var14 != null && var14.size() > 0) { -+ var7 = (IInventory)var14.get(par0World.rand.nextInt(var14.size())); - } - } - - return var7; - } - -- private static boolean areItemStacksEqualItem(ItemStack var0, ItemStack var1) { -- return var0.itemID != var1.itemID ? false : (var0.getItemDamage() != var1.getItemDamage() ? false : (var0.stackSize > var0.getMaxStackSize() ? false : ItemStack.areItemStackTagsEqual(var0, var1))); -+ private static boolean areItemStacksEqualItem(ItemStack par0ItemStack, ItemStack par1ItemStack) { -+ return par0ItemStack.itemID != par1ItemStack.itemID ? false : (par0ItemStack.getItemDamage() != par1ItemStack.getItemDamage() ? false : (par0ItemStack.stackSize > par0ItemStack.getMaxStackSize() ? false : ItemStack.areItemStackTagsEqual(par0ItemStack, par1ItemStack))); - } - -+ /** -+ * Gets the world X position for this hopper entity. -+ */ - public double getXPos() { - return (double)this.xCoord; - } - -+ /** -+ * Gets the world Y position for this hopper entity. -+ */ - public double getYPos() { - return (double)this.yCoord; - } - -+ /** -+ * Gets the world Z position for this hopper entity. -+ */ - public double getZPos() { - return (double)this.zCoord; - } - -- public void setTransferCooldown(int var1) { -- this.transferCooldown = var1; -+ public void setTransferCooldown(int par1) { -+ this.transferCooldown = par1; - } - - public boolean isCoolingDown() { ---- /dev/null -+++ org/spoutcraft/client/gui/settings/controls/LanguagesButton.java -@@ -1,0 +1,41 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.client.gui.settings.controls; -+ -+import net.minecraft.src.Minecraft; -+import net.minecraft.src.GuiLanguage; -+import net.minecraft.src.GuiScreen; -+ -+import org.spoutcraft.api.gui.GenericButton; -+ -+public class LanguagesButton extends GenericButton { -+ GuiScreen parent; -+ public LanguagesButton(GuiScreen parent) { -+ super("Languages"); -+ setTooltip("Languages\nChange the language of the game."); -+ this.parent = parent; -+ } -+ -+ @Override -+ public void onButtonClick() { -+ //ToDO: broken -+ //Minecraft.getMinecraft().displayGuiScreen(new GuiLanguage(parent, Minecraft.getMinecraft().gameSettings)); -+ } -+} ---- /dev/null -+++ org/spoutcraft/client/packet/PacketRequestPrecache.java -@@ -1,0 +1,69 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.client.packet; -+ -+import java.io.IOException; -+ -+import net.minecraft.src.EntityClientPlayerMP; -+import net.minecraft.src.Minecraft; -+import net.minecraft.src.Packet0KeepAlive; -+ -+import org.spoutcraft.api.io.SpoutInputStream; -+import org.spoutcraft.api.io.SpoutOutputStream; -+ -+public class PacketRequestPrecache implements SpoutPacket { -+ private String plugin; -+ -+ public PacketRequestPrecache() { -+ } -+ -+ public PacketRequestPrecache(String plugin) { -+ this.plugin = plugin; -+ } -+ -+ @Override -+ public void readData(SpoutInputStream input) throws IOException { -+ plugin = input.readString(); -+ } -+ -+ @Override -+ public void writeData(SpoutOutputStream output) throws IOException { -+ output.writeString(plugin); -+ } -+ -+ @Override -+ public void run(int playerId) { -+ ((EntityClientPlayerMP)Minecraft.getMinecraft().thePlayer).sendQueue.addToSendQueue(new Packet0KeepAlive()); -+ } -+ -+ @Override -+ public void failure(int playerId) { -+ } -+ -+ @Override -+ public PacketType getPacketType() { -+ return PacketType.PacketRequestPrecache; -+ } -+ -+ @Override -+ public int getVersion() { -+ return 0; -+ } -+} ---- net/minecraft/src/ComponentStrongholdStairs2.java -+++ net/minecraft/src/ComponentStrongholdStairs2.java -@@ -7,13 +7,12 @@ - public class ComponentStrongholdStairs2 extends ComponentStrongholdStairs { - public StructureStrongholdPieceWeight strongholdPieceWeight; - public ComponentStrongholdPortalRoom strongholdPortalRoom; -- public List c = new ArrayList(); -- -- public ComponentStrongholdStairs2() { -- } -- -- public ComponentStrongholdStairs2(int var1, Random var2, int var3, int var4) { -- super(0, var2, var3, var4); -+ public List field_75026_c = new ArrayList(); -+ -+ public ComponentStrongholdStairs2() {} -+ -+ public ComponentStrongholdStairs2(int par1, Random par2Random, int par3, int par4) { -+ super(0, par2Random, par3, par4); - } - - public ChunkPosition getCenter() { ---- net/minecraft/src/BlockSourceImpl.java -+++ net/minecraft/src/BlockSourceImpl.java -@@ -6,11 +6,11 @@ - private final int yPos; - private final int zPos; - -- public BlockSourceImpl(World var1, int var2, int var3, int var4) { -- this.worldObj = var1; -- this.xPos = var2; -- this.yPos = var3; -- this.zPos = var4; -+ public BlockSourceImpl(World par1World, int par2, int par3, int par4) { -+ this.worldObj = par1World; -+ this.xPos = par2; -+ this.yPos = par3; -+ this.zPos = par4; - } - - public World getWorld() { ---- net/minecraft/src/GuiButton.java -+++ net/minecraft/src/GuiButton.java -@@ -4,79 +4,110 @@ - - public class GuiButton extends Gui { - protected static final ResourceLocation buttonTextures = new ResourceLocation("textures/gui/widgets.png"); -+ -+ /** Button width in pixels */ - protected int width; -+ -+ /** Button height in pixels */ - protected int height; -+ -+ /** The x position of this control. */ - public int xPosition; -+ -+ /** The y position of this control. */ - public int yPosition; -- public String f; -+ -+ /** The string displayed on this control. */ -+ public String displayString; -+ -+ /** ID for this control. */ - public int id; -+ -+ /** True if this control is enabled, false to disable. */ - public boolean enabled; -+ -+ /** Hides the button completely if false. */ - public boolean drawButton; - protected boolean field_82253_i; - -- public GuiButton(int var1, int var2, int var3, String var4) { -- this(var1, var2, var3, 200, 20, var4); -+ public GuiButton(int par1, int par2, int par3, String par4Str) { -+ this(par1, par2, par3, 200, 20, par4Str); - } - -- public GuiButton(int var1, int var2, int var3, int var4, int var5, String var6) { -+ public GuiButton(int par1, int par2, int par3, int par4, int par5, String par6Str) { - this.width = 200; - this.height = 20; - this.enabled = true; - this.drawButton = true; -- this.id = var1; -- this.xPosition = var2; -- this.yPosition = var3; -- this.width = var4; -- this.height = var5; -- this.f = var6; -+ this.id = par1; -+ this.xPosition = par2; -+ this.yPosition = par3; -+ this.width = par4; -+ this.height = par5; -+ this.displayString = par6Str; - } - -- protected int getHoverState(boolean var1) { -+ /** -+ * Returns 0 if the button is disabled, 1 if the mouse is NOT hovering over this button and 2 if it IS hovering over -+ * this button. -+ */ -+ protected int getHoverState(boolean par1) { - byte var2 = 1; -- if(!this.enabled) { -+ -+ if (!this.enabled) { - var2 = 0; -- } else if(var1) { -+ } else if (par1) { - var2 = 2; - } - - return var2; - } - -- public void drawButton(Minecraft var1, int var2, int var3) { -- if(this.drawButton) { -- FontRenderer var4 = var1.fontRenderer; -- var1.getTextureManager().bindTexture(buttonTextures); -+ /** -+ * Draws this button to the screen. -+ */ -+ public void drawButton(Minecraft par1Minecraft, int par2, int par3) { -+ if (this.drawButton) { -+ FontRenderer var4 = par1Minecraft.fontRenderer; -+ par1Minecraft.getTextureManager().bindTexture(buttonTextures); - GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); -- this.field_82253_i = var2 >= this.xPosition && var3 >= this.yPosition && var2 < this.xPosition + this.width && var3 < this.yPosition + this.height; -+ this.field_82253_i = par2 >= this.xPosition && par3 >= this.yPosition && par2 < this.xPosition + this.width && par3 < this.yPosition + this.height; - int var5 = this.getHoverState(this.field_82253_i); - this.drawTexturedModalRect(this.xPosition, this.yPosition, 0, 46 + var5 * 20, this.width / 2, this.height); - this.drawTexturedModalRect(this.xPosition + this.width / 2, this.yPosition, 200 - this.width / 2, 46 + var5 * 20, this.width / 2, this.height); -- this.mouseDragged(var1, var2, var3); -+ this.mouseDragged(par1Minecraft, par2, par3); - int var6 = 14737632; -- if(!this.enabled) { -+ -+ if (!this.enabled) { - var6 = -6250336; -- } else if(this.field_82253_i) { -+ } else if (this.field_82253_i) { - var6 = 16777120; - } - -- this.drawCenteredString(var4, this.f, this.xPosition + this.width / 2, this.yPosition + (this.height - 8) / 2, var6); -+ this.drawCenteredString(var4, this.displayString, this.xPosition + this.width / 2, this.yPosition + (this.height - 8) / 2, var6); - } - } - -- protected void mouseDragged(Minecraft var1, int var2, int var3) { -- } -- -- public void mouseReleased(int var1, int var2) { -- } -- -- public boolean mousePressed(Minecraft var1, int var2, int var3) { -- return this.enabled && this.drawButton && var2 >= this.xPosition && var3 >= this.yPosition && var2 < this.xPosition + this.width && var3 < this.yPosition + this.height; -+ /** -+ * Fired when the mouse button is dragged. Equivalent of MouseListener.mouseDragged(MouseEvent e). -+ */ -+ protected void mouseDragged(Minecraft par1Minecraft, int par2, int par3) {} -+ -+ /** -+ * Fired when the mouse button is released. Equivalent of MouseListener.mouseReleased(MouseEvent e). -+ */ -+ public void mouseReleased(int par1, int par2) {} -+ -+ /** -+ * Returns true if the mouse has been pressed on this control. Equivalent of MouseListener.mousePressed(MouseEvent e). -+ */ -+ public boolean mousePressed(Minecraft par1Minecraft, int par2, int par3) { -+ return this.enabled && this.drawButton && par2 >= this.xPosition && par3 >= this.yPosition && par2 < this.xPosition + this.width && par3 < this.yPosition + this.height; - } - - public boolean func_82252_a() { - return this.field_82253_i; - } - -- public void func_82251_b(int var1, int var2) { -- } -+ public void func_82251_b(int par1, int par2) {} - } ---- /dev/null -+++ org/spoutcraft/api/gui/Widget.java -@@ -1,0 +1,554 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.api.gui; -+ -+import java.io.IOException; -+import java.util.UUID; -+ -+import org.spoutcraft.api.UnsafeClass; -+import org.spoutcraft.api.io.SpoutInputStream; -+import org.spoutcraft.api.io.SpoutOutputStream; -+import org.spoutcraft.api.property.PropertyInterface; -+ -+@UnsafeClass -+public interface Widget extends PropertyInterface{ -+ /** -+ * Is this running on Spoutcraft (ie, not on the server) - declared final in GenericWidget! -+ * @return if it's running on a client -+ */ -+ public boolean isSpoutcraft(); -+ -+ /** -+ * The version this widget is. Mismatched versions will fail to be created. -+ * @return version -+ */ -+ public int getVersion(); -+ -+ /** -+ * The type of widget this is. Required for proper synchronization between the server and client. -+ * @return widget type -+ */ -+ public WidgetType getType(); -+ -+ /** -+ * Returns a unique id for this widget -+ * @return id -+ */ -+ public UUID getId(); -+ -+ /** -+ * Called after this widget this created for serialization. -+ * @param input -+ * @throws IOException -+ */ -+ public void readData(SpoutInputStream input) throws IOException; -+ -+ /** -+ * Called when this widget is serialized to the client. -+ * -+ * Note: ensure that any changes here are reflected in {@link getNumBytes()} and are also present on the client. -+ * @param output -+ * @throws IOException -+ */ -+ public void writeData(SpoutOutputStream output) throws IOException; -+ -+ /** -+ * Gets the plugin that attached this widget to the screen, or null if this screen is unattached. -+ * @return plugin that attached this widget to the screen -+ */ -+ public String getAddon(); -+ -+ /** -+ * Internal use only. -+ * @param plugin -+ * @return this -+ */ -+ public Widget setAddon(String addon); -+ -+ /** -+ * Gets the render priority for this widget. Highest priorities render first (in the background), the lowest priorities render on top (in the foreground). -+ * @return priority. -+ */ -+ public RenderPriority getPriority(); -+ -+ /** -+ * Sets the render priority for this widget. Highest priorities render first (in the background), the lowest priorities render on top (in the foreground). -+ * @param priority to render at -+ * @return widget -+ */ -+ public Widget setPriority(RenderPriority priority); -+ -+ /** -+ * Gets the actual unscaled width of this widget, in pixels -+ * @return width -+ */ -+ public double getActualWidth(); -+ -+ /** -+ * Gets the width of this widget, in pixels -+ * @return width -+ */ -+ public double getWidth(); -+ -+ /** -+ * Sets the width of this widget, in pixels -+ * @param width to set -+ * @return widget -+ */ -+ public Widget setWidth(int width); -+ -+ /** -+ * Gets the actual unscaled height of this widget, in pixels -+ * @return -+ */ -+ public double getActualHeight(); -+ -+ /** -+ * Gets the height of this widget, in pixels -+ * @return height -+ */ -+ public double getHeight(); -+ -+ /** -+ * Sets the height of this widget, in pixels -+ * @param height to set -+ * @return widget -+ */ -+ public Widget setHeight(int height); -+ -+ /** -+ * Gets the screen this widget is attached to, or null if unattached -+ * @return screen -+ */ -+ public Screen getScreen(); -+ -+ /** -+ * Sets the screen this widget is attached to. Should not be used normally, is handled with screen.attachWidget() is called. -+ * @param screen this is attached to -+ * @return widget -+ */ -+ public Widget setScreen(Screen screen); -+ -+ /** -+ * Sets the screen and plugin this widget is attached to. Should not be used normally, is handled with screen.attachWidget() is called. -+ * @param screen this is attached to -+ * @param plugin this is attached to -+ * @return widget -+ */ -+ public Widget setScreen(String addon, Screen screen); -+ -+ /** -+ * Gets the x coordinate of this widget. Widgets (and screens) render from the top left corner the screen. 0,0 represents the top left corner. -+ * @return x-coordinate -+ */ -+ public int getX(); -+ -+ /** -+ * Gets the scaled x coordinate of this widget -+ * @return scaled x-coordinate -+ */ -+ public double getScreenX(); -+ -+ /** -+ * Gets the y coordinate of this widget. Widgets (and screens) render from the top left corner the screen. 0,0 represents the top left corner. -+ * @return y-coordinate -+ */ -+ public int getY(); -+ -+ /** -+ * Gets the scaled y coordinate of this widget -+ * @return scaled y-coordinate -+ */ -+ public double getScreenY(); -+ -+ /** -+ * Sets the x coordinate of this widget. Widgets (and screens) render from the top left corner the screen. 0,0 represents the top left corner. -+ * @param pos to set -+ * @return widget -+ */ -+ public Widget setX(int pos); -+ -+ /** -+ * Sets the y coordinate of this widget. Widgets (and screens) render from the top left corner the screen. 0,0 represents the top left corner. -+ * @param pos to set -+ * @return widget -+ */ -+ public Widget setY(int pos); -+ -+ /** -+ * Shifts this widget the given number of pixels in the x direction. -+ * @param x pixels to shift -+ * @return widget -+ */ -+ public Widget shiftXPos(int x); -+ -+ /** -+ * Shifts this widget the given number of pixels in the y direction -+ * @param y pixels to shift -+ * @return widget -+ */ -+ public Widget shiftYPos(int y); -+ -+ /** -+ * Is true if this widget is visible and rendering on the screen -+ * @return visible -+ */ -+ public boolean isVisible(); -+ -+ /** -+ * Sets the visibility of this widget. If true, it will render normally. If false, it will not appear on the screen. -+ * @param enable the visibility -+ * @return widget -+ */ -+ public Widget setVisible(boolean enable); -+ -+ /** -+ * Called each tick this widget is updated. This widget is processed for isDirty() immediately afterwords. -+ */ -+ public void onTick(); -+ -+ /** -+ * Set the widget's tooltip. -+ * Returns the current instance of the widget to make chainable calls. -+ */ -+ public Widget setTooltip(String tooltip); -+ -+ /** -+ * Gets the widget's tooltip -+ */ -+ public String getTooltip(); -+ -+ /** -+ * Gets the widget's container -+ */ -+ public Container getContainer(); -+ -+ /** -+ * Does the widget have a container -+ */ -+ public boolean hasContainer(); -+ -+ /** -+ * Sets the parant container for this widget -+ */ -+ public void setContainer(Container container); -+ -+ /** -+ * Container Layout - Set whether the widget will be resized with its container -+ * @param fixed if it is a static size -+ * @return the container -+ */ -+ public Widget setFixed(boolean fixed); -+ -+ /** -+ * Container Layout - Whether the widget is fixed size inside its container -+ * @return -+ */ -+ public boolean isFixed(); -+ -+ // NOTE: Margins follow the same order as CSS -+ /** -+ * Container Layout - Padding to use for automatic container layout - not included in dimensions -+ * @param marginAll -+ * @return -+ */ -+ public Widget setMargin(int marginAll); -+ -+ /** -+ * Container Layout - Padding to use for automatic container layout - not included in dimensions -+ * @param marginTopBottom -+ * @param marginLeftRight -+ * @return -+ */ -+ public Widget setMargin(int marginTopBottom, int marginLeftRight); -+ -+ /** -+ * Container Layout - Padding to use for automatic container layout - not included in dimensions -+ * @param marginTop -+ * @param marginLeftRight -+ * @param marginBottom -+ * @return -+ */ -+ public Widget setMargin(int marginTop, int marginLeftRight, int marginBottom); -+ -+ /** -+ * Container Layout - Padding to use for automatic container layout - not included in dimensions -+ * @param marginTop -+ * @param marginRight -+ * @param marginBottom -+ * @param marginLeft -+ * @return -+ */ -+ public Widget setMargin(int marginTop, int marginRight, int marginBottom, int marginLeft); -+ -+ /** -+ * Container Layout - Padding to use for automatic container layout - not included in dimensions -+ * @param marginLeft -+ * @return -+ */ -+ public Widget setMarginTop(int marginTop); -+ -+ /** -+ * Container Layout - Padding to use for automatic container layout - not included in dimensions -+ * @param marginLeft -+ * @return -+ */ -+ public Widget setMarginRight(int marginRight); -+ -+ /** -+ * Container Layout - Padding to use for automatic container layout - not included in dimensions -+ * @param marginLeft -+ * @return -+ */ -+ public Widget setMarginBottom(int marginBottom); -+ -+ /** -+ * Container Layout - Padding to use for automatic container layout - not included in dimensions -+ * @param marginLeft -+ * @return -+ */ -+ public Widget setMarginLeft(int marginLeft); -+ -+ /** -+ * Container Layout - Get the margin used for container layout -+ * @return -+ */ -+ public int getMarginTop(); -+ -+ /** -+ * Container Layout - Get the margin used for container layout -+ * @return -+ */ -+ public int getMarginRight(); -+ -+ /** -+ * Container Layout - Get the margin used for container layout -+ * @return -+ */ -+ public int getMarginBottom(); -+ -+ /** -+ * Container Layout - Get the margin used for container layout -+ * @return -+ */ -+ public int getMarginLeft(); -+ -+ /** -+ * Container Layout - Set the minimum width for this widget -+ * @param min -+ * @return -+ */ -+ public Widget setMinWidth(int min); -+ -+ /** -+ * Container Layout - Get the minimum width for this widget -+ * @return -+ */ -+ public int getMinWidth(); -+ -+ /** -+ * Container Layout - Set the maximum width for this widget -+ * @param min -+ * @return -+ */ -+ public Widget setMaxWidth(int max); -+ -+ /** -+ * Container Layout - Get the maximum width for this widget -+ * @return -+ */ -+ public int getMaxWidth(); -+ -+ /** -+ * Container Layout - Set the minimum height for this widget -+ * @param min -+ * @return -+ */ -+ public Widget setMinHeight(int min); -+ -+ /** -+ * Container Layout - Get the minimum height for this widget -+ * @return -+ */ -+ public int getMinHeight(); -+ -+ /** -+ * Container Layout - Set the maximum height for this widget -+ * @param min -+ * @return -+ */ -+ public Widget setMaxHeight(int max); -+ -+ /** -+ * Container Layout - Get the maximum height for this widget -+ * @return -+ */ -+ public int getMaxHeight(); -+ -+ /** -+ * Container Layout - Save the position for later restoration -+ * @return -+ */ -+ public Widget savePos(); -+ -+ /** -+ * Container Layout - Restore the earlier saved position -+ * @return -+ */ -+ public Widget restorePos(); -+ -+ /** -+ * Set the anchor point for this widget, default is CENTER -+ * @param anchor -+ * @return -+ */ -+ public Widget setAnchor(WidgetAnchor anchor); -+ -+ /** -+ * Get the current anchor position -+ * @return -+ */ -+ public WidgetAnchor getAnchor(); -+ -+ /** -+ * Returns a copy of this widget with a new UUID. -+ * -+ * Copies will not be equal to each other, but will have the same internal data. -+ * -+ * Note: the copy will not be attached to a screen, nor be part of a container even if the original was. -+ * -+ * Warning: copy will not work on screens. -+ * @return a copy of this widget -+ */ -+ public Widget copy(); -+ -+ /** -+ * Called when any dimension or limit changes -+ * @return -+ */ -+ public Widget updateSize(); -+ -+ public void render(); -+ -+ public double getActualX(); -+ -+ public double getActualY(); -+ -+ /** -+ * Setup a simple automatic animation that automatically repeats and resets when finished. -+ * Please note that some animation types are limited to certain types of widget. -+ * All animation is carried out on the client, so it isn't possible to update -+ * the server side values affected by the animation... -+ * @param type the type of animation to use -+ * @param value a custom value used by some types (default: 1) -+ * @param count how many frames -+ * @param ticks how many ticks per "frame" -+ * @return widget -+ */ -+ public Widget animate(WidgetAnim type, float value, short count, short ticks); -+ -+ /** -+ * Setup a simple automatic animation that resets when finished. -+ * Please note that some animation types are limited to certain types of widget. -+ * All animation is carried out on the client, so it isn't possible to update -+ * the server side values affected by the animation... -+ * @param type the type of animation to use -+ * @param value a custom value used by some types (default: 1) -+ * @param count how many frames -+ * @param ticks how many ticks per "frame" -+ * @param repeat should the animation be repeated -+ * @return widget -+ */ -+ public Widget animate(WidgetAnim type, float value, short count, short ticks, boolean repeat); -+ -+ /** -+ * Setup a simple automatic animation. -+ * Please note that some animation types are limited to certain types of widget. -+ * All animation is carried out on the client, so it isn't possible to update -+ * the server side values affected by the animation... -+ * @param type the type of animation to use -+ * @param value a custom value used by some types (default: 1) -+ * @param count how many frames -+ * @param ticks how many ticks per "frame" -+ * @param repeat should the animation be repeated -+ * @param reset should it reset back to the first frame after finishing -+ * @return widget -+ */ -+ public Widget animate(WidgetAnim type, float value, short count, short ticks, boolean repeat, boolean reset); -+ -+ /** -+ * Start the animation. -+ * @return widget -+ */ -+ public Widget animateStart(); -+ -+ /** -+ * Stop the animation, optionally letting it finish a loop. -+ * If the "reset" option was set when creating the animation it will go -+ * back to the first frame, otherwise it will stop where it is. -+ * @param finish should it finish the current loop (if repeating) -+ * @return widget -+ */ -+ public Widget animateStop(boolean finish); -+ -+ /** -+ * This handles animation every frame. -+ * NOTE: On the server the default animation handler doesn't do anything as -+ * all animation is handled on the client. If you are writing an animation -+ * handler then please keep bandwidth use in mind... -+ */ -+ public void onAnimate(); -+ -+ /** -+ * This is called when the animation stops, and can be used for chaining -+ * together animations. -+ * This is called whether the stop was automatic or manual, and occurs at -+ * the start of the final frame (so the frame hasn't had any ticks of -+ * visibility yet). -+ * NOTE: On the server the values changed in the animation will not -+ * have changed, this is due to the animation being client side. If you -+ * didn't tell the animation to reset after finishing then please remember -+ * to change them! -+ */ -+ public void onAnimateStop(); -+ -+ /** -+ * Gets the widgets coordinates and size in one object -+ * @return the geometry of the widget. -+ */ -+ public Rectangle getGeometry(); -+ -+ /** -+ * Sets the widgets coordinates and size with one object -+ * @param rect the new geometry of the widget. -+ * @return the instance -+ */ -+ public Widget setGeometry(Rectangle rect); -+ -+ /** -+ * Sets the widgets coordinates and size -+ * @param x coordinate -+ * @param y coordinate -+ * @param width size -+ * @param height size -+ * @return the instance -+ */ -+ public Widget setGeometry(int x, int y, int width, int height); -+} ---- net/minecraft/src/Packet6SpawnPosition.java -+++ net/minecraft/src/Packet6SpawnPosition.java -@@ -5,47 +5,75 @@ - import java.io.IOException; - - public class Packet6SpawnPosition extends Packet { -+ -+ /** X coordinate of spawn. */ - public int xPosition; -+ -+ /** Y coordinate of spawn. */ - public int yPosition; -+ -+ /** Z coordinate of spawn. */ - public int zPosition; - -- public Packet6SpawnPosition() { -- } -- -- public Packet6SpawnPosition(int var1, int var2, int var3) { -- this.xPosition = var1; -- this.yPosition = var2; -- this.zPosition = var3; -- } -- -- public void readPacketData(DataInput var1) throws IOException { -- this.xPosition = var1.readInt(); -- this.yPosition = var1.readInt(); -- this.zPosition = var1.readInt(); -- } -- -- public void writePacketData(DataOutput var1) throws IOException { -- var1.writeInt(this.xPosition); -- var1.writeInt(this.yPosition); -- var1.writeInt(this.zPosition); -- } -- -- public void processPacket(NetHandler var1) { -- var1.handleSpawnPosition(this); -- } -- -+ public Packet6SpawnPosition() {} -+ -+ public Packet6SpawnPosition(int par1, int par2, int par3) { -+ this.xPosition = par1; -+ this.yPosition = par2; -+ this.zPosition = par3; -+ } -+ -+ /** -+ * Abstract. Reads the raw packet data from the data stream. -+ */ -+ public void readPacketData(DataInput par1DataInput) throws IOException { -+ this.xPosition = par1DataInput.readInt(); -+ this.yPosition = par1DataInput.readInt(); -+ this.zPosition = par1DataInput.readInt(); -+ } -+ -+ /** -+ * Abstract. Writes the raw packet data to the data stream. -+ */ -+ public void writePacketData(DataOutput par1DataOutput) throws IOException { -+ par1DataOutput.writeInt(this.xPosition); -+ par1DataOutput.writeInt(this.yPosition); -+ par1DataOutput.writeInt(this.zPosition); -+ } -+ -+ /** -+ * Passes this Packet on to the NetHandler for processing. -+ */ -+ public void processPacket(NetHandler par1NetHandler) { -+ par1NetHandler.handleSpawnPosition(this); -+ } -+ -+ /** -+ * Abstract. Return the size of the packet (not counting the header). -+ */ - public int getPacketSize() { - return 12; - } - -+ /** -+ * only false for the abstract Packet class, all real packets return true -+ */ - public boolean isRealPacket() { - return true; - } - -- public boolean containsSameEntityIDAs(Packet var1) { -+ /** -+ * eg return packet30entity.entityId == entityId; WARNING : will throw if you compare a packet to a different packet -+ * class -+ */ -+ public boolean containsSameEntityIDAs(Packet par1Packet) { - return true; - } - -+ /** -+ * If this returns true, the packet may be processed on any thread; otherwise it is queued for the main thread to -+ * handle. -+ */ - public boolean canProcessAsync() { - return false; - } ---- /dev/null -+++ com/prupe/mcpatcher/TexturePackAPI$1.java -@@ -1,0 +1,32 @@ -+package com.prupe.mcpatcher; -+ -+import java.util.Comparator; -+import net.minecraft.src.ResourceLocation; -+ -+final class TexturePackAPI$1 implements Comparator { -+ final boolean val$sortByFilename; -+ -+ TexturePackAPI$1(boolean var1) { -+ this.val$sortByFilename = var1; -+ } -+ -+ public int compare(ResourceLocation o1, ResourceLocation o2) { -+ String n1 = o1.getResourceDomain(); -+ String n2 = o2.getResourceDomain(); -+ int result = n1.compareTo(n2); -+ -+ if (result != 0) { -+ return result; -+ } else { -+ String f1 = o1.getResourcePath(); -+ String f2 = o2.getResourcePath(); -+ -+ if (this.val$sortByFilename) { -+ f1 = f1.replaceAll(".*/", "").replaceFirst("\\.properties", ""); -+ f2 = f2.replaceAll(".*/", "").replaceFirst("\\.properties", ""); -+ } -+ -+ return f1.compareTo(f2); -+ } -+ } -+} ---- /dev/null -+++ org/spoutcraft/client/packet/PacketType.java -@@ -1,0 +1,118 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.client.packet; -+ -+import java.util.HashMap; -+ -+public enum PacketType { -+ PacketKeyPress(0, PacketKeyPress.class), -+ PacketAirTime(1, PacketAirTime.class), -+ PacketSkinURL(2, PacketSkinURL.class), -+ PacketEntityTitle(3, PacketEntityTitle.class), -+ //PacketPluginReload(4, PacketPluginReload.class), -+ PacketRenderDistance(5, PacketRenderDistance.class), -+ PacketAlert(6, PacketAlert.class), -+ PacketPlaySound(7, PacketPlaySound.class), -+ PacketDownloadMusic(8, PacketDownloadMusic.class), -+ PacketClipboardText(9, PacketClipboardText.class), -+ PacketMusicChange(10, PacketMusicChange.class), -+ PacketWidget(11, PacketWidget.class), -+ PacketStopMusic(12, PacketStopMusic.class), -+ PacketItemName(13, PacketItemName.class), -+ PacketSky(14, PacketSky.class), -+ //PacketTexturePack(15, PacketTexturePack.class), -+ //PacketWorldSeed(16, PacketWorldSeed.class), -+ PacketNotification(17, PacketNotification.class), -+ PacketScreenAction(18, PacketScreenAction.class), -+ PacketControlAction(19, PacketControlAction.class), -+ //PacketCacheHashUpdate(20, PacketCacheHashUpdate.class), -+ PacketAllowVisualCheats(21, PacketAllowVisualCheats.class), -+ PacketWidgetRemove(22, PacketWidgetRemove.class), -+ PacketEntitySkin(23, PacketEntitySkin.class), -+ PacketBiomeWeather(24, PacketBiomeWeather.class), -+ PacketChunkRefresh(25, PacketChunkRefresh.class), -+ PacketOpenScreen(26, PacketOpenScreen.class), -+ PacketPreCacheFile(27, PacketPreCacheFile.class), -+ PacketCacheFile(28, PacketCacheFile.class), -+ PacketCacheDeleteFile(29, PacketCacheDeleteFile.class), -+ PacketPreCacheCompleted(30, PacketPreCacheCompleted.class), -+ PacketMovementModifiers(31, PacketMovementModifiers.class), -+ PacketSetVelocity(32, PacketSetVelocity.class), -+ PacketFullVersion(33, PacketFullVersion.class), -+ //PacketCustomId(34, PacketCustomId.class), -+ //PacketItemTexture(35, PacketItemTexture.class), -+ //PacketBlockHardness(36, PacketBlockHardness.class), -+ PacketOpenSignGUI(37, PacketOpenSignGUI.class), -+ PacketCustomBlockOverride(38, PacketCustomBlockOverride.class), -+ PacketCustomBlockDesign(39, PacketCustomBlockDesign.class), -+ //PacketUniqueId(40, PacketUniqueId.class), -+ PacketKeyBinding(41, PacketKeyBinding.class), -+ PacketBlockData(42, PacketBlockData.class), -+ PacketCustomMultiBlockOverride(43, PacketCustomMultiBlockOverride.class), -+ //PacketServerPlugins(44, PacketServerPlugins.class), -+ //PacketAddonData(45, PacketAddonData.class), -+ //PacketCustomMaterial(46, PacketCustomMaterial.class), -+ PacketScreenshot(47, PacketScreenshot.class), -+ PacketGenericItem(48, PacketGenericItem.class), -+ PacketGenericTool(49, PacketGenericTool.class), -+ PacketGenericBlock(50, PacketGenericBlock.class), -+ PacketCustomBlockChunkOverride(51, PacketCustomBlockChunkOverride.class), -+ PacketGenericFood(52, PacketGenericFood.class), -+ PacketEntityInformation(53, PacketEntityInformation.class), -+ PacketComboBox(54, PacketComboBox.class), -+ PacketFocusUpdate(55, PacketFocusUpdate.class), -+ //PacketClientAddons(56, PacketClientAddons.class), -+ PacketPermissionUpdate(57, PacketPermissionUpdate.class), -+ PacketSpawnTextEntity(58, PacketSpawnTextEntity.class), -+ PacketSlotClick(59, PacketSlotClick.class), -+ PacketWaypoint(60, PacketWaypoint.class), -+ PacketParticle(61, PacketParticle.class), -+ PacketAccessory(62, org.spoutcraft.client.player.accessories.PacketAccessory.class), -+ PacketValidatePrecache(63, PacketValidatePrecache.class), -+ PacketRequestPrecache(64, PacketRequestPrecache.class), -+ PacketSendPrecache(65, PacketSendPrecache.class), -+ PacketSendLink(66, PacketSendLink.class); -+ -+ private final int id; -+ private final Class packetClass; -+ private static final HashMap lookupId = new HashMap(); -+ PacketType(final int type, final Class packetClass) { -+ this.id = type; -+ this.packetClass = packetClass; -+ } -+ -+ public int getId() { -+ return id; -+ } -+ -+ public Class getPacketClass() { -+ return packetClass; -+ } -+ -+ public static PacketType getPacketFromId(int id) { -+ return lookupId.get(id); -+ } -+ -+ static { -+ for (PacketType packet : values()) { -+ lookupId.put(packet.getId(), packet); -+ } -+ } -+} ---- /dev/null -+++ org/spoutcraft/api/gui/RenderDelegate.java -@@ -1,0 +1,82 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.api.gui; -+ -+public interface RenderDelegate { -+ public void render(ArmorBar bar); -+ -+ public void render(BubbleBar bar); -+ -+ public void render(ExpBar bar); -+ -+ public void render(GenericButton button); -+ -+ public void render(GenericGradient gradient); -+ -+ public void render(GenericItemWidget item); -+ -+ public void render(GenericLabel label); -+ -+ public void render(GenericSlider slider); -+ -+ public void render(GenericTextField text); -+ -+ public void render(GenericTexture texture); -+ -+ public void render(HealthBar bar); -+ -+ public void render(HungerBar bar); -+ -+ public void render(GenericEntityWidget entityWidget); -+ -+ public void render(GenericRadioButton radio); -+ -+ public void render(GenericCheckBox check); -+ -+ public void render(GenericBitmap bitmap); -+ -+ public void downloadTexture(String plugin, String url); -+ -+ public int getScreenWidth(); -+ -+ public int getScreenHeight(); -+ -+ public MinecraftFont getMinecraftFont(); -+ -+ public MinecraftTessellator getTessellator(); -+ -+ void render(GenericListWidgetItem lwi, int x, int y, int width, int height); -+ -+ public void render(GenericScrollable genericScrollable); -+ -+ public void renderContents(GenericListWidget genericListWidget); -+ -+ public void renderContents(GenericScrollArea genericScrollArea); -+ -+ public void render(GenericComboBox comboBox); -+ -+ public void render(GenericSlot genericSlot); -+ -+ public String getFittingText(String text, int width); -+ -+ public boolean bindTexture(String path); -+ -+ public boolean bindTexture(String addon, String path); -+} ---- net/minecraft/src/EntityAISit.java -+++ net/minecraft/src/EntityAISit.java -@@ -2,19 +2,24 @@ - - public class EntityAISit extends EntityAIBase { - private EntityTameable theEntity; -+ -+ /** If the EntityTameable is sitting. */ - private boolean isSitting; - -- public EntityAISit(EntityTameable var1) { -- this.theEntity = var1; -+ public EntityAISit(EntityTameable par1EntityTameable) { -+ this.theEntity = par1EntityTameable; - this.setMutexBits(5); - } - -+ /** -+ * Returns whether the EntityAIBase should begin execution. -+ */ - public boolean shouldExecute() { -- if(!this.theEntity.isTamed()) { -- return false; -- } else if(this.theEntity.isInWater()) { -- return false; -- } else if(!this.theEntity.onGround) { -+ if (!this.theEntity.isTamed()) { -+ return false; -+ } else if (this.theEntity.isInWater()) { -+ return false; -+ } else if (!this.theEntity.onGround) { - return false; - } else { - EntityLivingBase var1 = this.theEntity.func_130012_q(); -@@ -22,16 +27,25 @@ - } - } - -+ /** -+ * Execute a one shot task or start executing a continuous task -+ */ - public void startExecuting() { - this.theEntity.getNavigator().clearPathEntity(); - this.theEntity.setSitting(true); - } - -+ /** -+ * Resets the task -+ */ - public void resetTask() { - this.theEntity.setSitting(false); - } - -- public void setSitting(boolean var1) { -- this.isSitting = var1; -+ /** -+ * Sets the sitting flag. -+ */ -+ public void setSitting(boolean par1) { -+ this.isSitting = par1; - } - } ---- /dev/null -+++ org/spoutcraft/client/packet/PacketCustomMultiBlockOverride.java -@@ -1,0 +1,137 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.client.packet; -+ -+import java.io.IOException; -+import java.nio.ByteBuffer; -+import java.util.zip.DataFormatException; -+import java.util.zip.Deflater; -+import java.util.zip.Inflater; -+ -+import org.apache.commons.io.output.ByteArrayOutputStream; -+ -+import org.spoutcraft.api.Spoutcraft; -+import org.spoutcraft.api.io.SpoutInputStream; -+import org.spoutcraft.api.io.SpoutOutputStream; -+import org.spoutcraft.client.SpoutClient; -+import org.spoutcraft.client.block.SpoutcraftChunk; -+ -+public class PacketCustomMultiBlockOverride implements CompressablePacket { -+ private int chunkX; -+ private int chunkZ; -+ private boolean compressed = true; -+ private byte[] data; -+ public PacketCustomMultiBlockOverride() { -+ } -+ -+ public void readData(SpoutInputStream input) throws IOException { -+ chunkX = input.readInt(); -+ chunkZ = input.readInt(); -+ int size = input.readInt(); -+ data = new byte[size]; -+ input.read(data); -+ } -+ -+ public void writeData(SpoutOutputStream output) throws IOException { -+ output.writeInt(chunkX); -+ output.writeInt(chunkZ); -+ output.writeInt(data.length); -+ output.write(data); -+ } -+ -+ public void run(int playerId) { -+ ByteBuffer result = ByteBuffer.allocate(data.length).put(data); -+ SpoutcraftChunk chunk = Spoutcraft.getChunk(SpoutClient.getInstance().getRawWorld(), chunkX, chunkZ); -+ for (int i = 0; i < data.length / 7; i++) { -+ int index = i * 7; -+ int x = result.get(index) + chunkX * 16; -+ int y = result.getShort(index+1); -+ int z = result.get(index+3) + chunkZ * 16; -+ short id = result.getShort(index+4); -+ byte data = result.get(index+6); -+ chunk.setCustomBlockId(x, y, z, id); -+ chunk.setCustomBlockData(x, y, z, data); -+ SpoutClient.getInstance().getRawWorld().updateAllLightTypes(x, y, z); -+ } -+ } -+ -+ public void failure(int playerId) { -+ } -+ -+ public PacketType getPacketType() { -+ return PacketType.PacketCustomMultiBlockOverride; -+ } -+ -+ public int getVersion() { -+ return 4; -+ } -+ -+ public void compress() { -+ if (!compressed) { -+ if (data != null) { -+ Deflater deflater = new Deflater(); -+ deflater.setInput(data); -+ deflater.setLevel(Deflater.BEST_COMPRESSION); -+ deflater.finish(); -+ ByteArrayOutputStream bos = new ByteArrayOutputStream(data.length); -+ byte[] buffer = new byte[1024]; -+ while (!deflater.finished()) { -+ int bytesCompressed = deflater.deflate(buffer); -+ bos.write(buffer, 0, bytesCompressed); -+ } -+ try { -+ bos.close(); -+ } catch (IOException e) { -+ e.printStackTrace(); -+ } -+ data = bos.toByteArray(); -+ } -+ compressed = true; -+ } -+ } -+ -+ public void decompress() { -+ if (compressed) { -+ Inflater decompressor = new Inflater(); -+ decompressor.setInput(data); -+ -+ ByteArrayOutputStream bos = new ByteArrayOutputStream(data.length); -+ -+ byte[] buf = new byte[1024]; -+ while (!decompressor.finished()) { -+ try { -+ int count = decompressor.inflate(buf); -+ bos.write(buf, 0, count); -+ } catch (DataFormatException e) { -+ } -+ } -+ try { -+ bos.close(); -+ } catch (IOException e) { -+ } -+ compressed = false; -+ data = bos.toByteArray(); -+ } -+ } -+ -+ public boolean isCompressed() { -+ return compressed; -+ } -+} ---- net/minecraft/src/DedicatedServerCommandThread.java -+++ net/minecraft/src/DedicatedServerCommandThread.java -@@ -7,25 +7,20 @@ - class DedicatedServerCommandThread extends Thread { - final DedicatedServer server; - -- DedicatedServerCommandThread(DedicatedServer var1) { -- this.server = var1; -+ DedicatedServerCommandThread(DedicatedServer par1DedicatedServer) { -+ this.server = par1DedicatedServer; - } - - public void run() { - BufferedReader var1 = new BufferedReader(new InputStreamReader(System.in)); -+ String var2; - - try { -- while(!this.server.isServerStopped() && this.server.isServerRunning()) { -- String var2 = var1.readLine(); -- if(var2 == null) { -- break; -- } -- -+ while (!this.server.isServerStopped() && this.server.isServerRunning() && (var2 = var1.readLine()) != null) { - this.server.addPendingCommand(var2, this.server); - } - } catch (IOException var4) { - var4.printStackTrace(); - } -- - } - } ---- net/minecraft/src/ImageBufferDownload.java -+++ net/minecraft/src/ImageBufferDownload.java -@@ -10,15 +10,15 @@ - private int imageWidth; - private int imageHeight; - -- public BufferedImage parseUserSkin(BufferedImage var1) { -- if(var1 == null) { -+ public BufferedImage parseUserSkin(BufferedImage par1BufferedImage) { -+ if (par1BufferedImage == null) { - return null; - } else { - this.imageWidth = 64; - this.imageHeight = 32; - BufferedImage var2 = new BufferedImage(this.imageWidth, this.imageHeight, 2); - Graphics var3 = var2.getGraphics(); -- var3.drawImage(var1, 0, 0, (ImageObserver)null); -+ var3.drawImage(par1BufferedImage, 0, 0, (ImageObserver)null); - var3.dispose(); - this.imageData = ((DataBufferInt)var2.getRaster().getDataBuffer()).getData(); - this.setAreaOpaque(0, 0, 32, 16); -@@ -28,31 +28,41 @@ - } - } - -- private void setAreaTransparent(int var1, int var2, int var3, int var4) { -- if(!this.hasTransparency(var1, var2, var3, var4)) { -- for(int var5 = var1; var5 < var3; ++var5) { -- for(int var6 = var2; var6 < var4; ++var6) { -+ /** -+ * Makes the given area of the image transparent if it was previously completely opaque (used to remove the outer layer -+ * of a skin around the head if it was saved all opaque; this would be redundant so it's assumed that the skin maker is -+ * just using an image editor without an alpha channel) -+ */ -+ private void setAreaTransparent(int par1, int par2, int par3, int par4) { -+ if (!this.hasTransparency(par1, par2, par3, par4)) { -+ for (int var5 = par1; var5 < par3; ++var5) { -+ for (int var6 = par2; var6 < par4; ++var6) { - this.imageData[var5 + var6 * this.imageWidth] &= 16777215; - } - } -- - } - } - -- private void setAreaOpaque(int var1, int var2, int var3, int var4) { -- for(int var5 = var1; var5 < var3; ++var5) { -- for(int var6 = var2; var6 < var4; ++var6) { -+ /** -+ * Makes the given area of the image opaque -+ */ -+ private void setAreaOpaque(int par1, int par2, int par3, int par4) { -+ for (int var5 = par1; var5 < par3; ++var5) { -+ for (int var6 = par2; var6 < par4; ++var6) { - this.imageData[var5 + var6 * this.imageWidth] |= -16777216; - } - } -- - } - -- private boolean hasTransparency(int var1, int var2, int var3, int var4) { -- for(int var5 = var1; var5 < var3; ++var5) { -- for(int var6 = var2; var6 < var4; ++var6) { -+ /** -+ * Returns true if the given area of the image contains transparent pixels -+ */ -+ private boolean hasTransparency(int par1, int par2, int par3, int par4) { -+ for (int var5 = par1; var5 < par3; ++var5) { -+ for (int var6 = par2; var6 < par4; ++var6) { - int var7 = this.imageData[var5 + var6 * this.imageWidth]; -- if((var7 >> 24 & 255) < 128) { -+ -+ if ((var7 >> 24 & 255) < 128) { - return true; - } - } ---- net/minecraft/src/WorldSavedData.java -+++ net/minecraft/src/WorldSavedData.java -@@ -1,25 +1,44 @@ - package net.minecraft.src; - - public abstract class WorldSavedData { -- public final String h; -+ -+ /** The name of the map data nbt */ -+ public final String mapName; -+ -+ /** Whether this MapDataBase needs saving to disk. */ - private boolean dirty; - -- public WorldSavedData(String var1) { -- this.h = var1; -+ public WorldSavedData(String par1Str) { -+ this.mapName = par1Str; - } - -+ /** -+ * reads in data from the NBTTagCompound into this MapDataBase -+ */ - public abstract void readFromNBT(NBTTagCompound var1); - -+ /** -+ * write data to NBTTagCompound from this MapDataBase, similar to Entities and TileEntities -+ */ - public abstract void writeToNBT(NBTTagCompound var1); - -+ /** -+ * Marks this MapDataBase dirty, to be saved to disk when the level next saves. -+ */ - public void markDirty() { - this.setDirty(true); - } - -- public void setDirty(boolean var1) { -- this.dirty = var1; -+ /** -+ * Sets the dirty state of this MapDataBase, whether it needs saving to disk. -+ */ -+ public void setDirty(boolean par1) { -+ this.dirty = par1; - } - -+ /** -+ * Whether this MapDataBase needs saving to disk. -+ */ - public boolean isDirty() { - return this.dirty; - } ---- net/minecraft/src/BlockLilyPad.java -+++ net/minecraft/src/BlockLilyPad.java -@@ -2,47 +2,79 @@ - - import java.util.List; - -+import com.prupe.mcpatcher.cc.ColorizeBlock; -+ - public class BlockLilyPad extends BlockFlower { -- protected BlockLilyPad(int var1) { -- super(var1); -+ protected BlockLilyPad(int par1) { -+ super(par1); - float var2 = 0.5F; - float var3 = 0.015625F; - this.setBlockBounds(0.5F - var2, 0.0F, 0.5F - var2, 0.5F + var2, var3, 0.5F + var2); - this.setCreativeTab(CreativeTabs.tabDecorations); - } - -+ /** -+ * The type of render function that is called for this block -+ */ - public int getRenderType() { - return 23; - } - -- public void addCollisionBoxesToList(World var1, int var2, int var3, int var4, AxisAlignedBB var5, List var6, Entity var7) { -- if(var7 == null || !(var7 instanceof EntityBoat)) { -- super.addCollisionBoxesToList(var1, var2, var3, var4, var5, var6, var7); -+ /** -+ * Adds all intersecting collision boxes to a list. (Be sure to only add boxes to the list if they intersect the mask.) -+ * Parameters: World, X, Y, Z, mask, list, colliding entity -+ */ -+ public void addCollisionBoxesToList(World par1World, int par2, int par3, int par4, AxisAlignedBB par5AxisAlignedBB, List par6List, Entity par7Entity) { -+ if (par7Entity == null || !(par7Entity instanceof EntityBoat)) { -+ super.addCollisionBoxesToList(par1World, par2, par3, par4, par5AxisAlignedBB, par6List, par7Entity); - } -- - } - -- public AxisAlignedBB getCollisionBoundingBoxFromPool(World var1, int var2, int var3, int var4) { -- return AxisAlignedBB.getAABBPool().getAABB((double)var2 + this.minX, (double)var3 + this.minY, (double)var4 + this.minZ, (double)var2 + this.maxX, (double)var3 + this.maxY, (double)var4 + this.maxZ); -+ /** -+ * Returns a bounding box from the pool of bounding boxes (this means this box can change after the pool has been -+ * cleared to be reused) -+ */ -+ public AxisAlignedBB getCollisionBoundingBoxFromPool(World par1World, int par2, int par3, int par4) { -+ return AxisAlignedBB.getAABBPool().getAABB((double)par2 + this.minX, (double)par3 + this.minY, (double)par4 + this.minZ, (double)par2 + this.maxX, (double)par3 + this.maxY, (double)par4 + this.maxZ); - } - - public int getBlockColor() { -- return 2129968; -- } -- -- public int getRenderColor(int var1) { -- return 2129968; -- } -- -- public int colorMultiplier(IBlockAccess var1, int var2, int var3, int var4) { -- return 2129968; -- } -- -- protected boolean canThisPlantGrowOnThisBlockID(int var1) { -- return var1 == Block.waterStill.blockID; -- } -- -- public boolean canBlockStay(World var1, int var2, int var3, int var4) { -- return var3 >= 0 && var3 < 256 ? var1.getBlockMaterial(var2, var3 - 1, var4) == Material.water && var1.getBlockMetadata(var2, var3 - 1, var4) == 0 : false; -+ // MCPatcher Start -+ return ColorizeBlock.getLilyPadColor(); -+ // MCPatcher End -+ } -+ -+ /** -+ * Returns the color this block should be rendered. Used by leaves. -+ */ -+ public int getRenderColor(int par1) { -+ // MCPatcher Start -+ return ColorizeBlock.getLilyPadColor(); -+ // MCPatcher End -+ } -+ -+ /** -+ * Returns a integer with hex for 0xrrggbb with this color multiplied against the blocks color. Note only called when -+ * first determining what to render. -+ */ -+ public int colorMultiplier(IBlockAccess par1IBlockAccess, int par2, int par3, int par4) { -+ // MCPatcher Start -+ return ColorizeBlock.getLilyPadColor(); -+ // MCPatcher End -+ } -+ -+ /** -+ * Gets passed in the blockID of the block below and supposed to return true if its allowed to grow on the type of -+ * blockID passed in. Args: blockID -+ */ -+ protected boolean canThisPlantGrowOnThisBlockID(int par1) { -+ return par1 == Block.waterStill.blockID; -+ } -+ -+ /** -+ * Can this block stay at this position. Similar to canPlaceBlockAt except gets checked often with plants. -+ */ -+ public boolean canBlockStay(World par1World, int par2, int par3, int par4) { -+ return par3 >= 0 && par3 < 256 ? par1World.getBlockMaterial(par2, par3 - 1, par4) == Material.water && par1World.getBlockMetadata(par2, par3 - 1, par4) == 0 : false; - } - } ---- net/minecraft/src/StructureStrongholdPieceWeight2.java -+++ net/minecraft/src/StructureStrongholdPieceWeight2.java -@@ -1,11 +1,11 @@ - package net.minecraft.src; - - final class StructureStrongholdPieceWeight2 extends StructureStrongholdPieceWeight { -- StructureStrongholdPieceWeight2(Class var1, int var2, int var3) { -- super(var1, var2, var3); -+ StructureStrongholdPieceWeight2(Class par1Class, int par2, int par3) { -+ super(par1Class, par2, par3); - } - -- public boolean canSpawnMoreStructuresOfType(int var1) { -- return super.canSpawnMoreStructuresOfType(var1) && var1 > 4; -+ public boolean canSpawnMoreStructuresOfType(int par1) { -+ return super.canSpawnMoreStructuresOfType(par1) && par1 > 4; - } - } ---- net/minecraft/src/DispenserBehaviorBoat.java -+++ net/minecraft/src/DispenserBehaviorBoat.java -@@ -3,22 +3,26 @@ - final class DispenserBehaviorBoat extends BehaviorDefaultDispenseItem { - private final BehaviorDefaultDispenseItem defaultDispenserItemBehavior = new BehaviorDefaultDispenseItem(); - -- public ItemStack dispenseStack(IBlockSource var1, ItemStack var2) { -- EnumFacing var3 = BlockDispenser.getFacing(var1.getBlockMetadata()); -- World var4 = var1.getWorld(); -- double var5 = var1.getX() + (double)((float)var3.getFrontOffsetX() * 1.125F); -- double var7 = var1.getY() + (double)((float)var3.getFrontOffsetY() * 1.125F); -- double var9 = var1.getZ() + (double)((float)var3.getFrontOffsetZ() * 1.125F); -- int var11 = var1.getXInt() + var3.getFrontOffsetX(); -- int var12 = var1.getYInt() + var3.getFrontOffsetY(); -- int var13 = var1.getZInt() + var3.getFrontOffsetZ(); -+ /** -+ * Dispense the specified stack, play the dispense sound and spawn particles. -+ */ -+ public ItemStack dispenseStack(IBlockSource par1IBlockSource, ItemStack par2ItemStack) { -+ EnumFacing var3 = BlockDispenser.getFacing(par1IBlockSource.getBlockMetadata()); -+ World var4 = par1IBlockSource.getWorld(); -+ double var5 = par1IBlockSource.getX() + (double)((float)var3.getFrontOffsetX() * 1.125F); -+ double var7 = par1IBlockSource.getY() + (double)((float)var3.getFrontOffsetY() * 1.125F); -+ double var9 = par1IBlockSource.getZ() + (double)((float)var3.getFrontOffsetZ() * 1.125F); -+ int var11 = par1IBlockSource.getXInt() + var3.getFrontOffsetX(); -+ int var12 = par1IBlockSource.getYInt() + var3.getFrontOffsetY(); -+ int var13 = par1IBlockSource.getZInt() + var3.getFrontOffsetZ(); - Material var14 = var4.getBlockMaterial(var11, var12, var13); - double var15; -- if(Material.water.equals(var14)) { -+ -+ if (Material.water.equals(var14)) { - var15 = 1.0D; - } else { -- if(!Material.air.equals(var14) || !Material.water.equals(var4.getBlockMaterial(var11, var12 - 1, var13))) { -- return this.defaultDispenserItemBehavior.dispense(var1, var2); -+ if (!Material.air.equals(var14) || !Material.water.equals(var4.getBlockMaterial(var11, var12 - 1, var13))) { -+ return this.defaultDispenserItemBehavior.dispense(par1IBlockSource, par2ItemStack); - } - - var15 = 0.0D; -@@ -26,11 +30,14 @@ - - EntityBoat var17 = new EntityBoat(var4, var5, var7 + var15, var9); - var4.spawnEntityInWorld(var17); -- var2.splitStack(1); -- return var2; -+ par2ItemStack.splitStack(1); -+ return par2ItemStack; - } - -- protected void playDispenseSound(IBlockSource var1) { -- var1.getWorld().playAuxSFX(1000, var1.getXInt(), var1.getYInt(), var1.getZInt(), 0); -+ /** -+ * Play the dispense sound from the specified block. -+ */ -+ protected void playDispenseSound(IBlockSource par1IBlockSource) { -+ par1IBlockSource.getWorld().playAuxSFX(1000, par1IBlockSource.getXInt(), par1IBlockSource.getYInt(), par1IBlockSource.getZInt(), 0); - } - } ---- net/minecraft/src/EnumToolMaterial.java -+++ net/minecraft/src/EnumToolMaterial.java -@@ -7,40 +7,74 @@ - EMERALD(3, 1561, 8.0F, 3.0F, 10), - GOLD(0, 32, 12.0F, 0.0F, 22); - -+ /** -+ * The level of material this tool can harvest (3 = DIAMOND, 2 = IRON, 1 = STONE, 0 = IRON/GOLD) -+ */ - private final int harvestLevel; -+ -+ /** -+ * The number of uses this material allows. (wood = 59, stone = 131, iron = 250, diamond = 1561, gold = 32) -+ */ - private final int maxUses; -+ -+ /** -+ * The strength of this tool material against blocks which it is effective against. -+ */ - private final float efficiencyOnProperMaterial; -+ -+ /** Damage versus entities. */ - private final float damageVsEntity; -+ -+ /** Defines the natural enchantability factor of the material. */ - private final int enchantability; - -- private EnumToolMaterial(int var3, int var4, float var5, float var6, int var7) { -- this.harvestLevel = var3; -- this.maxUses = var4; -- this.efficiencyOnProperMaterial = var5; -- this.damageVsEntity = var6; -- this.enchantability = var7; -+ private EnumToolMaterial(int par3, int par4, float par5, float par6, int par7) { -+ this.harvestLevel = par3; -+ this.maxUses = par4; -+ this.efficiencyOnProperMaterial = par5; -+ this.damageVsEntity = par6; -+ this.enchantability = par7; - } - -+ /** -+ * The number of uses this material allows. (wood = 59, stone = 131, iron = 250, diamond = 1561, gold = 32) -+ */ - public int getMaxUses() { - return this.maxUses; - } - -+ /** -+ * The strength of this tool material against blocks which it is effective against. -+ */ - public float getEfficiencyOnProperMaterial() { - return this.efficiencyOnProperMaterial; - } - -+ /** -+ * Damage versus entities. -+ */ - public float getDamageVsEntity() { - return this.damageVsEntity; - } - -+ /** -+ * The level of material this tool can harvest (3 = DIAMOND, 2 = IRON, 1 = STONE, 0 = IRON/GOLD) -+ */ - public int getHarvestLevel() { - return this.harvestLevel; - } - -+ /** -+ * Return the natural enchantability factor of the material. -+ */ - public int getEnchantability() { - return this.enchantability; - } - -+ /** -+ * Return the crafting material for this tool material, used to determine the item that can be used to repair a tool -+ * with an anvil -+ */ - public int getToolCraftingMaterial() { - return this == WOOD ? Block.planks.blockID : (this == STONE ? Block.cobblestone.blockID : (this == GOLD ? Item.ingotGold.itemID : (this == IRON ? Item.ingotIron.itemID : (this == EMERALD ? Item.diamond.itemID : 0)))); - } ---- net/minecraft/src/BehaviorDispenseMinecart.java -+++ net/minecraft/src/BehaviorDispenseMinecart.java -@@ -3,38 +3,46 @@ - final class BehaviorDispenseMinecart extends BehaviorDefaultDispenseItem { - private final BehaviorDefaultDispenseItem behaviourDefaultDispenseItem = new BehaviorDefaultDispenseItem(); - -- public ItemStack dispenseStack(IBlockSource var1, ItemStack var2) { -- EnumFacing var3 = BlockDispenser.getFacing(var1.getBlockMetadata()); -- World var4 = var1.getWorld(); -- double var5 = var1.getX() + (double)((float)var3.getFrontOffsetX() * 1.125F); -- double var7 = var1.getY() + (double)((float)var3.getFrontOffsetY() * 1.125F); -- double var9 = var1.getZ() + (double)((float)var3.getFrontOffsetZ() * 1.125F); -- int var11 = var1.getXInt() + var3.getFrontOffsetX(); -- int var12 = var1.getYInt() + var3.getFrontOffsetY(); -- int var13 = var1.getZInt() + var3.getFrontOffsetZ(); -+ /** -+ * Dispense the specified stack, play the dispense sound and spawn particles. -+ */ -+ public ItemStack dispenseStack(IBlockSource par1IBlockSource, ItemStack par2ItemStack) { -+ EnumFacing var3 = BlockDispenser.getFacing(par1IBlockSource.getBlockMetadata()); -+ World var4 = par1IBlockSource.getWorld(); -+ double var5 = par1IBlockSource.getX() + (double)((float)var3.getFrontOffsetX() * 1.125F); -+ double var7 = par1IBlockSource.getY() + (double)((float)var3.getFrontOffsetY() * 1.125F); -+ double var9 = par1IBlockSource.getZ() + (double)((float)var3.getFrontOffsetZ() * 1.125F); -+ int var11 = par1IBlockSource.getXInt() + var3.getFrontOffsetX(); -+ int var12 = par1IBlockSource.getYInt() + var3.getFrontOffsetY(); -+ int var13 = par1IBlockSource.getZInt() + var3.getFrontOffsetZ(); - int var14 = var4.getBlockId(var11, var12, var13); - double var15; -- if(BlockRailBase.isRailBlock(var14)) { -+ -+ if (BlockRailBase.isRailBlock(var14)) { - var15 = 0.0D; - } else { -- if(var14 != 0 || !BlockRailBase.isRailBlock(var4.getBlockId(var11, var12 - 1, var13))) { -- return this.behaviourDefaultDispenseItem.dispense(var1, var2); -+ if (var14 != 0 || !BlockRailBase.isRailBlock(var4.getBlockId(var11, var12 - 1, var13))) { -+ return this.behaviourDefaultDispenseItem.dispense(par1IBlockSource, par2ItemStack); - } - - var15 = -1.0D; - } - -- EntityMinecart var17 = EntityMinecart.createMinecart(var4, var5, var7 + var15, var9, ((ItemMinecart)var2.getItem()).minecartType); -- if(var2.hasDisplayName()) { -- var17.setMinecartName(var2.getDisplayName()); -+ EntityMinecart var17 = EntityMinecart.createMinecart(var4, var5, var7 + var15, var9, ((ItemMinecart)par2ItemStack.getItem()).minecartType); -+ -+ if (par2ItemStack.hasDisplayName()) { -+ var17.setMinecartName(par2ItemStack.getDisplayName()); - } - - var4.spawnEntityInWorld(var17); -- var2.splitStack(1); -- return var2; -+ par2ItemStack.splitStack(1); -+ return par2ItemStack; - } - -- protected void playDispenseSound(IBlockSource var1) { -- var1.getWorld().playAuxSFX(1000, var1.getXInt(), var1.getYInt(), var1.getZInt(), 0); -+ /** -+ * Play the dispense sound from the specified block. -+ */ -+ protected void playDispenseSound(IBlockSource par1IBlockSource) { -+ par1IBlockSource.getWorld().playAuxSFX(1000, par1IBlockSource.getXInt(), par1IBlockSource.getYInt(), par1IBlockSource.getZInt(), 0); - } - } ---- net/minecraft/src/WorldChunkManager.java -+++ net/minecraft/src/WorldChunkManager.java -@@ -6,138 +6,180 @@ - - public class WorldChunkManager { - private GenLayer genBiomes; -+ -+ /** A GenLayer containing the indices into BiomeGenBase.biomeList[] */ - private GenLayer biomeIndexLayer; -+ -+ /** The BiomeCache object for this world. */ - private BiomeCache biomeCache; -- private List g; -+ -+ /** A list of biomes that the player can spawn in. */ -+ private List biomesToSpawnIn; - - protected WorldChunkManager() { - this.biomeCache = new BiomeCache(this); -- this.g = new ArrayList(); -- this.g.add(BiomeGenBase.forest); -- this.g.add(BiomeGenBase.plains); -- this.g.add(BiomeGenBase.taiga); -- this.g.add(BiomeGenBase.taigaHills); -- this.g.add(BiomeGenBase.forestHills); -- this.g.add(BiomeGenBase.jungle); -- this.g.add(BiomeGenBase.jungleHills); -+ this.biomesToSpawnIn = new ArrayList(); -+ this.biomesToSpawnIn.add(BiomeGenBase.forest); -+ this.biomesToSpawnIn.add(BiomeGenBase.plains); -+ this.biomesToSpawnIn.add(BiomeGenBase.taiga); -+ this.biomesToSpawnIn.add(BiomeGenBase.taigaHills); -+ this.biomesToSpawnIn.add(BiomeGenBase.forestHills); -+ this.biomesToSpawnIn.add(BiomeGenBase.jungle); -+ this.biomesToSpawnIn.add(BiomeGenBase.jungleHills); - } - -- public WorldChunkManager(long var1, WorldType var3) { -+ public WorldChunkManager(long par1, WorldType par3WorldType) { - this(); -- GenLayer[] var4 = GenLayer.initializeAllBiomeGenerators(var1, var3); -+ GenLayer[] var4 = GenLayer.initializeAllBiomeGenerators(par1, par3WorldType); - this.genBiomes = var4[0]; - this.biomeIndexLayer = var4[1]; - } - -- public WorldChunkManager(World var1) { -- this(var1.getSeed(), var1.getWorldInfo().getTerrainType()); -+ public WorldChunkManager(World par1World) { -+ this(par1World.getSeed(), par1World.getWorldInfo().getTerrainType()); - } - -+ /** -+ * Gets the list of valid biomes for the player to spawn in. -+ */ - public List getBiomesToSpawnIn() { -- return this.g; -- } -- -- public BiomeGenBase getBiomeGenAt(int var1, int var2) { -- return this.biomeCache.getBiomeGenAt(var1, var2); -- } -- -- public float[] getRainfall(float[] var1, int var2, int var3, int var4, int var5) { -+ return this.biomesToSpawnIn; -+ } -+ -+ /** -+ * Returns the BiomeGenBase related to the x, z position on the world. -+ */ -+ public BiomeGenBase getBiomeGenAt(int par1, int par2) { -+ return this.biomeCache.getBiomeGenAt(par1, par2); -+ } -+ -+ /** -+ * Returns a list of rainfall values for the specified blocks. Args: listToReuse, x, z, width, length. -+ */ -+ public float[] getRainfall(float[] par1ArrayOfFloat, int par2, int par3, int par4, int par5) { - IntCache.resetIntCache(); -- if(var1 == null || var1.length < var4 * var5) { -- var1 = new float[var4 * var5]; -+ -+ if (par1ArrayOfFloat == null || par1ArrayOfFloat.length < par4 * par5) { -+ par1ArrayOfFloat = new float[par4 * par5]; - } - -- int[] var6 = this.biomeIndexLayer.getInts(var2, var3, var4, var5); -+ int[] var6 = this.biomeIndexLayer.getInts(par2, par3, par4, par5); - -- for(int var7 = 0; var7 < var4 * var5; ++var7) { -+ for (int var7 = 0; var7 < par4 * par5; ++var7) { - float var8 = (float)BiomeGenBase.biomeList[var6[var7]].getIntRainfall() / 65536.0F; -- if(var8 > 1.0F) { -+ -+ if (var8 > 1.0F) { - var8 = 1.0F; - } - -- var1[var7] = var8; -+ par1ArrayOfFloat[var7] = var8; - } - -- return var1; -- } -- -- public float getTemperatureAtHeight(float var1, int var2) { -- return var1; -- } -- -- public float[] getTemperatures(float[] var1, int var2, int var3, int var4, int var5) { -+ return par1ArrayOfFloat; -+ } -+ -+ /** -+ * Return an adjusted version of a given temperature based on the y height -+ */ -+ public float getTemperatureAtHeight(float par1, int par2) { -+ return par1; -+ } -+ -+ /** -+ * Returns a list of temperatures to use for the specified blocks. Args: listToReuse, x, y, width, length -+ */ -+ public float[] getTemperatures(float[] par1ArrayOfFloat, int par2, int par3, int par4, int par5) { - IntCache.resetIntCache(); -- if(var1 == null || var1.length < var4 * var5) { -- var1 = new float[var4 * var5]; -+ -+ if (par1ArrayOfFloat == null || par1ArrayOfFloat.length < par4 * par5) { -+ par1ArrayOfFloat = new float[par4 * par5]; - } - -- int[] var6 = this.biomeIndexLayer.getInts(var2, var3, var4, var5); -+ int[] var6 = this.biomeIndexLayer.getInts(par2, par3, par4, par5); - -- for(int var7 = 0; var7 < var4 * var5; ++var7) { -+ for (int var7 = 0; var7 < par4 * par5; ++var7) { - float var8 = (float)BiomeGenBase.biomeList[var6[var7]].getIntTemperature() / 65536.0F; -- if(var8 > 1.0F) { -+ -+ if (var8 > 1.0F) { - var8 = 1.0F; - } - -- var1[var7] = var8; -- } -- -- return var1; -- } -- -- public BiomeGenBase[] getBiomesForGeneration(BiomeGenBase[] var1, int var2, int var3, int var4, int var5) { -- IntCache.resetIntCache(); -- if(var1 == null || var1.length < var4 * var5) { -- var1 = new BiomeGenBase[var4 * var5]; -- } -- -- int[] var6 = this.genBiomes.getInts(var2, var3, var4, var5); -- -- for(int var7 = 0; var7 < var4 * var5; ++var7) { -- var1[var7] = BiomeGenBase.biomeList[var6[var7]]; -- } -- -- return var1; -- } -- -- public BiomeGenBase[] loadBlockGeneratorData(BiomeGenBase[] var1, int var2, int var3, int var4, int var5) { -- return this.getBiomeGenAt(var1, var2, var3, var4, var5, true); -- } -- -- public BiomeGenBase[] getBiomeGenAt(BiomeGenBase[] var1, int var2, int var3, int var4, int var5, boolean var6) { -- IntCache.resetIntCache(); -- if(var1 == null || var1.length < var4 * var5) { -- var1 = new BiomeGenBase[var4 * var5]; -- } -- -- if(var6 && var4 == 16 && var5 == 16 && (var2 & 15) == 0 && (var3 & 15) == 0) { -- BiomeGenBase[] var9 = this.biomeCache.getCachedBiomes(var2, var3); -- System.arraycopy(var9, 0, var1, 0, var4 * var5); -- return var1; -+ par1ArrayOfFloat[var7] = var8; -+ } -+ -+ return par1ArrayOfFloat; -+ } -+ -+ /** -+ * Returns an array of biomes for the location input. -+ */ -+ public BiomeGenBase[] getBiomesForGeneration(BiomeGenBase[] par1ArrayOfBiomeGenBase, int par2, int par3, int par4, int par5) { -+ IntCache.resetIntCache(); -+ -+ if (par1ArrayOfBiomeGenBase == null || par1ArrayOfBiomeGenBase.length < par4 * par5) { -+ par1ArrayOfBiomeGenBase = new BiomeGenBase[par4 * par5]; -+ } -+ -+ int[] var6 = this.genBiomes.getInts(par2, par3, par4, par5); -+ -+ for (int var7 = 0; var7 < par4 * par5; ++var7) { -+ par1ArrayOfBiomeGenBase[var7] = BiomeGenBase.biomeList[var6[var7]]; -+ } -+ -+ return par1ArrayOfBiomeGenBase; -+ } -+ -+ /** -+ * Returns biomes to use for the blocks and loads the other data like temperature and humidity onto the -+ * WorldChunkManager Args: oldBiomeList, x, z, width, depth -+ */ -+ public BiomeGenBase[] loadBlockGeneratorData(BiomeGenBase[] par1ArrayOfBiomeGenBase, int par2, int par3, int par4, int par5) { -+ return this.getBiomeGenAt(par1ArrayOfBiomeGenBase, par2, par3, par4, par5, true); -+ } -+ -+ /** -+ * Return a list of biomes for the specified blocks. Args: listToReuse, x, y, width, length, cacheFlag (if false, don't -+ * check biomeCache to avoid infinite loop in BiomeCacheBlock) -+ */ -+ public BiomeGenBase[] getBiomeGenAt(BiomeGenBase[] par1ArrayOfBiomeGenBase, int par2, int par3, int par4, int par5, boolean par6) { -+ IntCache.resetIntCache(); -+ -+ if (par1ArrayOfBiomeGenBase == null || par1ArrayOfBiomeGenBase.length < par4 * par5) { -+ par1ArrayOfBiomeGenBase = new BiomeGenBase[par4 * par5]; -+ } -+ -+ if (par6 && par4 == 16 && par5 == 16 && (par2 & 15) == 0 && (par3 & 15) == 0) { -+ BiomeGenBase[] var9 = this.biomeCache.getCachedBiomes(par2, par3); -+ System.arraycopy(var9, 0, par1ArrayOfBiomeGenBase, 0, par4 * par5); -+ return par1ArrayOfBiomeGenBase; - } else { -- int[] var7 = this.biomeIndexLayer.getInts(var2, var3, var4, var5); -+ int[] var7 = this.biomeIndexLayer.getInts(par2, par3, par4, par5); - -- for(int var8 = 0; var8 < var4 * var5; ++var8) { -- var1[var8] = BiomeGenBase.biomeList[var7[var8]]; -+ for (int var8 = 0; var8 < par4 * par5; ++var8) { -+ par1ArrayOfBiomeGenBase[var8] = BiomeGenBase.biomeList[var7[var8]]; - } - -- return var1; -+ return par1ArrayOfBiomeGenBase; - } - } - -- public boolean areBiomesViable(int var1, int var2, int var3, List var4) { -+ /** -+ * checks given Chunk's Biomes against List of allowed ones -+ */ -+ public boolean areBiomesViable(int par1, int par2, int par3, List par4List) { - IntCache.resetIntCache(); -- int var5 = var1 - var3 >> 2; -- int var6 = var2 - var3 >> 2; -- int var7 = var1 + var3 >> 2; -- int var8 = var2 + var3 >> 2; -+ int var5 = par1 - par3 >> 2; -+ int var6 = par2 - par3 >> 2; -+ int var7 = par1 + par3 >> 2; -+ int var8 = par2 + par3 >> 2; - int var9 = var7 - var5 + 1; - int var10 = var8 - var6 + 1; - int[] var11 = this.genBiomes.getInts(var5, var6, var9, var10); - -- for(int var12 = 0; var12 < var9 * var10; ++var12) { -+ for (int var12 = 0; var12 < var9 * var10; ++var12) { - BiomeGenBase var13 = BiomeGenBase.biomeList[var11[var12]]; -- if(!var4.contains(var13)) { -+ -+ if (!par4List.contains(var13)) { - return false; - } - } -@@ -145,23 +187,28 @@ - return true; - } - -- public ChunkPosition findBiomePosition(int var1, int var2, int var3, List var4, Random var5) { -+ /** -+ * Finds a valid position within a range, that is in one of the listed biomes. Searches {par1,par2} +-par3 blocks. -+ * Strongly favors positive y positions. -+ */ -+ public ChunkPosition findBiomePosition(int par1, int par2, int par3, List par4List, Random par5Random) { - IntCache.resetIntCache(); -- int var6 = var1 - var3 >> 2; -- int var7 = var2 - var3 >> 2; -- int var8 = var1 + var3 >> 2; -- int var9 = var2 + var3 >> 2; -+ int var6 = par1 - par3 >> 2; -+ int var7 = par2 - par3 >> 2; -+ int var8 = par1 + par3 >> 2; -+ int var9 = par2 + par3 >> 2; - int var10 = var8 - var6 + 1; - int var11 = var9 - var7 + 1; - int[] var12 = this.genBiomes.getInts(var6, var7, var10, var11); - ChunkPosition var13 = null; - int var14 = 0; - -- for(int var15 = 0; var15 < var10 * var11; ++var15) { -+ for (int var15 = 0; var15 < var10 * var11; ++var15) { - int var16 = var6 + var15 % var10 << 2; - int var17 = var7 + var15 / var10 << 2; - BiomeGenBase var18 = BiomeGenBase.biomeList[var12[var15]]; -- if(var4.contains(var18) && (var13 == null || var5.nextInt(var14 + 1) == 0)) { -+ -+ if (par4List.contains(var18) && (var13 == null || par5Random.nextInt(var14 + 1) == 0)) { - var13 = new ChunkPosition(var16, 0, var17); - ++var14; - } -@@ -170,6 +217,9 @@ - return var13; - } - -+ /** -+ * Calls the WorldChunkManager's biomeCache.cleanupCache() -+ */ - public void cleanupCache() { - this.biomeCache.cleanupCache(); - } ---- net/minecraft/src/AnimalChest.java -+++ net/minecraft/src/AnimalChest.java -@@ -1,11 +1,11 @@ - package net.minecraft.src; - - public class AnimalChest extends InventoryBasic { -- public AnimalChest(String var1, int var2) { -- super(var1, false, var2); -+ public AnimalChest(String par1Str, int par2) { -+ super(par1Str, false, par2); - } - -- public AnimalChest(String var1, boolean var2, int var3) { -- super(var1, var2, var3); -+ public AnimalChest(String par1Str, boolean par2, int par3) { -+ super(par1Str, par2, par3); - } - } ---- net/minecraft/src/CallableIsFeatureChunk.java -+++ net/minecraft/src/CallableIsFeatureChunk.java -@@ -4,13 +4,15 @@ - - class CallableIsFeatureChunk implements Callable { - final int field_85169_a; -+ - final int field_85167_b; -+ - final MapGenStructure theMapStructureGenerator; - -- CallableIsFeatureChunk(MapGenStructure var1, int var2, int var3) { -- this.theMapStructureGenerator = var1; -- this.field_85169_a = var2; -- this.field_85167_b = var3; -+ CallableIsFeatureChunk(MapGenStructure par1MapGenStructure, int par2, int par3) { -+ this.theMapStructureGenerator = par1MapGenStructure; -+ this.field_85169_a = par2; -+ this.field_85167_b = par3; - } - - public String func_85166_a() { ---- /dev/null -+++ org/spoutcraft/client/packet/PacketWidget.java -@@ -1,0 +1,201 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.client.packet; -+ -+import java.io.IOException; -+import java.nio.ByteBuffer; -+import java.util.HashMap; -+import java.util.UUID; -+ -+import org.spoutcraft.api.gui.GenericWidget; -+import org.spoutcraft.api.gui.InGameHUD; -+import org.spoutcraft.api.gui.OverlayScreen; -+import org.spoutcraft.api.gui.PopupScreen; -+import org.spoutcraft.api.gui.Screen; -+import org.spoutcraft.api.gui.Widget; -+import org.spoutcraft.api.gui.WidgetType; -+import org.spoutcraft.api.io.SpoutInputStream; -+import org.spoutcraft.api.io.SpoutOutputStream; -+import org.spoutcraft.client.SpoutClient; -+import org.spoutcraft.client.gui.CustomScreen; -+ -+public class PacketWidget implements SpoutPacket { -+ private Widget widget; -+ protected UUID screen; -+ private static final int[] nags; -+ ByteBuffer widgetData; -+ WidgetType widgetType; -+ private int version; -+ private UUID widgetId; -+ -+ static HashMap allWidgets = new HashMap(); -+ -+ static { -+ nags = new int[WidgetType.getNumWidgetTypes()]; -+ for (int i = 0; i < WidgetType.getNumWidgetTypes(); i++) { -+ nags[i] = CustomPacket.NAG_MSG_AMT; -+ } -+ } -+ -+ public PacketWidget() { -+ } -+ -+ public PacketWidget(Widget widget, UUID screen) { -+ this.widget = widget; -+ this.screen = screen; -+ } -+ -+ public void readData(SpoutInputStream input) throws IOException { -+ int id = input.readInt(); -+ screen = input.readUUID(); -+ widgetId = input.readUUID(); -+ -+ int size = input.readInt(); -+ version = input.readShort(); -+ byte[] widgetData = new byte[size]; -+ input.read(widgetData); -+ this.widgetData = ByteBuffer.wrap(widgetData); -+ widgetType = WidgetType.getWidgetFromId(id); -+ -+ /*SpoutInputStream data = new SpoutInputStream(ByteBuffer.wrap(widgetData)); -+ if (widgetType != null) { -+ try { -+ widget = widgetType.getWidgetClass().newInstance(); -+ if (widget.getVersion() == version) { -+ widget.readData(data); -+ } else { -+ if (nags[id]-- > 0) { -+ System.out.println("Received invalid widget: " + widgetType.getWidgetClass().getSimpleName() + " v: " + version + " current v: " + widget.getVersion()); -+ } -+ widget = null; -+ } -+ } catch (Exception e) { -+ e.printStackTrace(); -+ } -+ }*/ -+ } -+ -+ public void writeData(SpoutOutputStream output) throws IOException { -+ output.writeInt(widget.getType().getId()); -+ output.writeUUID(widget.getScreen().getId()); -+ output.writeUUID(widget.getId()); -+ -+ SpoutOutputStream data = new SpoutOutputStream(); -+ widget.writeData(data); -+ ByteBuffer buffer = data.getRawBuffer(); -+ byte[] widgetData = new byte[buffer.capacity() - buffer.remaining()]; -+ System.arraycopy(buffer.array(), 0, widgetData, 0, widgetData.length); -+ -+ output.writeInt(widgetData.length); -+ output.writeShort((short) widget.getVersion()); -+ output.write(widgetData); -+ } -+ -+ public void run(int playerId) { -+ try { -+ if (allWidgets.containsKey(widgetId)) { -+ widget = allWidgets.get(widgetId); -+ if (widget.getVersion() == version) { -+ widget.readData(new SpoutInputStream(widgetData)); -+ } -+ } else { -+ widget = widgetType.getWidgetClass().newInstance(); -+ -+ // Hackish way to set the ID without a setter -+ ((GenericWidget) widget).setId(widgetId); -+ if (widget.getVersion() == version) { -+ widget.readData(new SpoutInputStream(widgetData)); -+ } else { -+ if (nags[widgetType.getId()]-- > 0) { -+ System.out.println("Received invalid widget: " + widgetType.getWidgetClass().getSimpleName() + " v: " + version + " current v: " + widget.getVersion()); -+ } -+ widget = null; -+ } -+ } -+ } catch (Exception e) { -+ e.printStackTrace(); -+ } -+ if (widget != null) { -+ allWidgets.put(widgetId, widget); -+ InGameHUD mainScreen = SpoutClient.getInstance().getActivePlayer().getMainScreen(); -+ PopupScreen popup = mainScreen.getActivePopup(); -+ Screen overlay = null; -+ -+ if (SpoutClient.getHandle().currentScreen != null) { -+ overlay = SpoutClient.getHandle().currentScreen.getScreen(); -+ } -+ // Determine if this is a popup screen and if we need to update it -+ if (widget instanceof PopupScreen) { -+ if (popup != null) { -+ if (widget.getId().equals(popup.getId())) { -+ if (SpoutClient.getHandle().currentScreen instanceof CustomScreen) { -+ ((CustomScreen)SpoutClient.getHandle().currentScreen).update((PopupScreen)widget); -+ } -+ } else { -+ mainScreen.closePopup(); -+ mainScreen.attachPopupScreen((PopupScreen)widget); -+ } -+ } else { -+ mainScreen.attachPopupScreen((PopupScreen)widget); -+ } -+ } else if (widget instanceof OverlayScreen) { // Determine if this screen overrides another screen -+ if (SpoutClient.getHandle().currentScreen != null) { -+ SpoutClient.getHandle().currentScreen.update((OverlayScreen)widget); -+ overlay = (OverlayScreen)widget; -+ } -+ } else if (screen.equals(mainScreen.getId())) { // Determine if this is a widget on the main screen -+ if (mainScreen.containsWidget(widget.getId())) { -+ mainScreen.updateWidget(widget); -+ widget.setScreen(mainScreen); -+ } else { -+ widget.setScreen(mainScreen); -+ mainScreen.attachWidget(widget.getAddon(), widget); -+ } -+ } else if (popup != null && screen.equals(popup.getId())) { // Determine if this is a widget on the popup screen -+ if (popup.containsWidget(widget.getId())) { -+ popup.updateWidget(widget); -+ widget.setScreen(popup); -+ } else { -+ widget.setScreen(popup); -+ popup.attachWidget(widget.getAddon(), widget); -+ } -+ } else if (overlay != null && screen.equals(overlay.getId())) { // Determine if this is a widget on an overlay screen -+ if (overlay.containsWidget(widget.getId())) { -+ overlay.updateWidget(widget); -+ widget.setScreen(overlay); -+ } else { -+ widget.setScreen(overlay); -+ overlay.attachWidget(widget.getAddon(), widget); -+ } -+ } -+ } -+ } -+ -+ public PacketType getPacketType() { -+ return PacketType.PacketWidget; -+ } -+ -+ public int getVersion() { -+ return 2; -+ } -+ -+ public void failure(int playerId) { -+ } -+} ---- net/minecraft/src/ModelPig.java -+++ net/minecraft/src/ModelPig.java -@@ -5,9 +5,9 @@ - this(0.0F); - } - -- public ModelPig(float var1) { -- super(6, var1); -- this.head.setTextureOffset(16, 16).addBox(-2.0F, 0.0F, -9.0F, 4, 3, 1, var1); -+ public ModelPig(float par1) { -+ super(6, par1); -+ this.head.setTextureOffset(16, 16).addBox(-2.0F, 0.0F, -9.0F, 4, 3, 1, par1); - this.field_78145_g = 4.0F; - } - } ---- net/minecraft/src/GuiOptions.java -+++ net/minecraft/src/GuiOptions.java -@@ -1,96 +1,119 @@ - package net.minecraft.src; - - public class GuiOptions extends GuiScreen { -- private static final EnumOptions[] relevantOptions = new EnumOptions[]{EnumOptions.MUSIC, EnumOptions.SOUND, EnumOptions.INVERT_MOUSE, EnumOptions.SENSITIVITY, EnumOptions.FOV, EnumOptions.DIFFICULTY, EnumOptions.TOUCHSCREEN}; -+ -+ /** -+ * An array of options that can be changed directly from the options GUI. -+ */ -+ private static final EnumOptions[] relevantOptions = new EnumOptions[] {EnumOptions.MUSIC, EnumOptions.SOUND, EnumOptions.INVERT_MOUSE, EnumOptions.SENSITIVITY, EnumOptions.FOV, EnumOptions.DIFFICULTY, EnumOptions.TOUCHSCREEN}; -+ -+ /** -+ * A reference to the screen object that created this. Used for navigating between screens. -+ */ - private final GuiScreen parentScreen; -+ -+ /** Reference to the GameSettings object. */ - private final GameSettings options; -- protected String a = "Options"; -- -- public GuiOptions(GuiScreen var1, GameSettings var2) { -- this.parentScreen = var1; -- this.options = var2; -+ -+ /** The title string that is displayed in the top-center of the screen. */ -+ protected String screenTitle = "Options"; -+ -+ public GuiOptions(GuiScreen par1GuiScreen, GameSettings par2GameSettings) { -+ this.parentScreen = par1GuiScreen; -+ this.options = par2GameSettings; - } - -+ /** -+ * Adds the buttons (and other controls) to the screen in question. -+ */ -+ // ToDo: Need Spoutcraft API update for buttonList calls. - public void initGui() { - int var1 = 0; -- this.a = I18n.getString("options.title"); -+ this.screenTitle = I18n.getString("options.title"); - EnumOptions[] var2 = relevantOptions; - int var3 = var2.length; - -- for(int var4 = 0; var4 < var3; ++var4) { -+ for (int var4 = 0; var4 < var3; ++var4) { - EnumOptions var5 = var2[var4]; -- if(var5.getEnumFloat()) { -- this.i.add(new GuiSlider(var5.returnEnumOrdinal(), this.width / 2 - 155 + var1 % 2 * 160, this.height / 6 - 12 + 24 * (var1 >> 1), var5, this.options.getKeyBinding(var5), this.options.getOptionFloatValue(var5))); -+ -+ if (var5.getEnumFloat()) { -+ this.buttonList.add(new GuiSlider(var5.returnEnumOrdinal(), this.width / 2 - 155 + var1 % 2 * 160, this.height / 6 - 12 + 24 * (var1 >> 1), var5, this.options.getKeyBinding(var5), this.options.getOptionFloatValue(var5))); - } else { - GuiSmallButton var6 = new GuiSmallButton(var5.returnEnumOrdinal(), this.width / 2 - 155 + var1 % 2 * 160, this.height / 6 - 12 + 24 * (var1 >> 1), var5, this.options.getKeyBinding(var5)); -- if(var5 == EnumOptions.DIFFICULTY && this.mc.theWorld != null && this.mc.theWorld.getWorldInfo().isHardcoreModeEnabled()) { -+ -+ if (var5 == EnumOptions.DIFFICULTY && this.mc.theWorld != null && this.mc.theWorld.getWorldInfo().isHardcoreModeEnabled()) { - var6.enabled = false; -- var6.f = I18n.getString("options.difficulty") + ": " + I18n.getString("options.difficulty.hardcore"); -+ var6.displayString = I18n.getString("options.difficulty") + ": " + I18n.getString("options.difficulty.hardcore"); - } - -- this.i.add(var6); -+ this.buttonList.add(var6); - } - - ++var1; - } - -- this.i.add(new GuiButton(101, this.width / 2 - 152, this.height / 6 + 96 - 6, 150, 20, I18n.getString("options.video"))); -- this.i.add(new GuiButton(100, this.width / 2 + 2, this.height / 6 + 96 - 6, 150, 20, I18n.getString("options.controls"))); -- this.i.add(new GuiButton(102, this.width / 2 - 152, this.height / 6 + 120 - 6, 150, 20, I18n.getString("options.language"))); -- this.i.add(new GuiButton(103, this.width / 2 + 2, this.height / 6 + 120 - 6, 150, 20, I18n.getString("options.multiplayer.title"))); -- this.i.add(new GuiButton(105, this.width / 2 - 152, this.height / 6 + 144 - 6, 150, 20, I18n.getString("options.resourcepack"))); -- this.i.add(new GuiButton(104, this.width / 2 + 2, this.height / 6 + 144 - 6, 150, 20, I18n.getString("options.snooper.view"))); -- this.i.add(new GuiButton(200, this.width / 2 - 100, this.height / 6 + 168, I18n.getString("gui.done"))); -+ this.buttonList.add(new GuiButton(101, this.width / 2 - 152, this.height / 6 + 96 - 6, 150, 20, I18n.getString("options.video"))); -+ this.buttonList.add(new GuiButton(100, this.width / 2 + 2, this.height / 6 + 96 - 6, 150, 20, I18n.getString("options.controls"))); -+ this.buttonList.add(new GuiButton(102, this.width / 2 - 152, this.height / 6 + 120 - 6, 150, 20, I18n.getString("options.language"))); -+ this.buttonList.add(new GuiButton(103, this.width / 2 + 2, this.height / 6 + 120 - 6, 150, 20, I18n.getString("options.multiplayer.title"))); -+ this.buttonList.add(new GuiButton(105, this.width / 2 - 152, this.height / 6 + 144 - 6, 150, 20, I18n.getString("options.resourcepack"))); -+ this.buttonList.add(new GuiButton(104, this.width / 2 + 2, this.height / 6 + 144 - 6, 150, 20, I18n.getString("options.snooper.view"))); -+ this.buttonList.add(new GuiButton(200, this.width / 2 - 100, this.height / 6 + 168, I18n.getString("gui.done"))); - } - -- protected void actionPerformed(GuiButton var1) { -- if(var1.enabled) { -- if(var1.id < 100 && var1 instanceof GuiSmallButton) { -- this.options.setOptionValue(((GuiSmallButton)var1).returnEnumOptions(), 1); -- var1.f = this.options.getKeyBinding(EnumOptions.getEnumOptions(var1.id)); -+ /** -+ * Fired when a control is clicked. This is the equivalent of ActionListener.actionPerformed(ActionEvent e). -+ */ -+ protected void actionPerformed(GuiButton par1GuiButton) { -+ if (par1GuiButton.enabled) { -+ if (par1GuiButton.id < 100 && par1GuiButton instanceof GuiSmallButton) { -+ this.options.setOptionValue(((GuiSmallButton)par1GuiButton).returnEnumOptions(), 1); -+ par1GuiButton.displayString = this.options.getKeyBinding(EnumOptions.getEnumOptions(par1GuiButton.id)); - } - -- if(var1.id == 101) { -+ if (par1GuiButton.id == 101) { - this.mc.gameSettings.saveOptions(); - this.mc.displayGuiScreen(new GuiVideoSettings(this, this.options)); - } - -- if(var1.id == 100) { -+ if (par1GuiButton.id == 100) { - this.mc.gameSettings.saveOptions(); - this.mc.displayGuiScreen(new GuiControls(this, this.options)); - } - -- if(var1.id == 102) { -+ if (par1GuiButton.id == 102) { - this.mc.gameSettings.saveOptions(); - this.mc.displayGuiScreen(new GuiLanguage(this, this.options, this.mc.getLanguageManager())); - } - -- if(var1.id == 103) { -+ if (par1GuiButton.id == 103) { - this.mc.gameSettings.saveOptions(); - this.mc.displayGuiScreen(new ScreenChatOptions(this, this.options)); - } - -- if(var1.id == 104) { -+ if (par1GuiButton.id == 104) { - this.mc.gameSettings.saveOptions(); - this.mc.displayGuiScreen(new GuiSnooper(this, this.options)); - } - -- if(var1.id == 200) { -+ if (par1GuiButton.id == 200) { - this.mc.gameSettings.saveOptions(); - this.mc.displayGuiScreen(this.parentScreen); - } - -- if(var1.id == 105) { -+ if (par1GuiButton.id == 105) { - this.mc.gameSettings.saveOptions(); - this.mc.displayGuiScreen(new GuiScreenTemporaryResourcePackSelect(this, this.options)); - } -- - } - } - -- public void drawScreen(int var1, int var2, float var3) { -+ /** -+ * Draws the screen and all the components in it. -+ */ -+ public void drawScreen(int par1, int par2, float par3) { - this.drawDefaultBackground(); -- this.drawCenteredString(this.fontRenderer, this.a, this.width / 2, 15, 16777215); -- super.drawScreen(var1, var2, var3); -+ this.drawCenteredString(this.fontRenderer, this.screenTitle, this.width / 2, 15, 16777215); -+ super.drawScreen(par1, par2, par3); - } - } ---- /dev/null -+++ org/spoutcraft/client/gui/minimap/SquareToggleCheckBox.java -@@ -1,0 +1,37 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.client.gui.minimap; -+ -+import org.spoutcraft.api.gui.GenericCheckBox; -+ -+public class SquareToggleCheckBox extends GenericCheckBox { -+ public SquareToggleCheckBox() { -+ super("Square Minimap"); -+ setChecked(MinimapConfig.getInstance().isSquare()); -+ setTooltip("Square Minimap\nOFF - Shows a circle minimap.\nON - Shows a square minimap."); -+ } -+ -+ @Override -+ public void onButtonClick() { -+ MinimapConfig.getInstance().setAdjustX(-5); -+ MinimapConfig.getInstance().setAdjustY(5); -+ MinimapConfig.getInstance().setSquare(isChecked()); -+ } -+} ---- net/minecraft/src/EntityPlayerSP.java -+++ net/minecraft/src/EntityPlayerSP.java -@@ -1,9 +1,28 @@ - package net.minecraft.src; - -+// Spout Start -+ -+import org.spoutcraft.api.Spoutcraft; -+import org.spoutcraft.api.util.FixedLocation; -+import org.spoutcraft.client.SpoutClient; -+import org.spoutcraft.client.config.Configuration; -+import org.spoutcraft.client.gui.minimap.GuiOverviewMap; -+import org.spoutcraft.client.packet.PacketRenderDistance; -+import org.spoutcraft.client.player.ClientPlayer; -+// Spout End -+ - public class EntityPlayerSP extends AbstractClientPlayer { -- public MovementInput movementInput; -+ -+ public MovementInput movementInput; - protected Minecraft mc; -+ -+ /** -+ * Used to tell if the player pressed forward twice. If this is at 0 and it's pressed (And they are allowed to sprint, -+ * aka enough food on the ground etc) it sets this to 7. If it's pressed and it's greater than 0 enable sprinting. -+ */ - protected int sprintToggleTimer; -+ -+ /** Ticks left before sprinting is disabled. */ - public int sprintingTicksLeft; - public float renderArmYaw; - public float renderArmPitch; -@@ -14,39 +33,60 @@ - private MouseFilter field_71162_ch = new MouseFilter(); - private MouseFilter field_71160_ci = new MouseFilter(); - private MouseFilter field_71161_cj = new MouseFilter(); -+ -+ /** The amount of time an entity has been in a Portal */ - public float timeInPortal; -+ -+ /** The amount of time an entity has been in a Portal the previous tick */ - public float prevTimeInPortal; -+ // Spout Start -+ public FixedLocation lastClickLocation = null; -+ private KeyBinding fogKey = null; -+ // Spout End - -- public EntityPlayerSP(Minecraft var1, World var2, Session var3, int var4) { -- super(var2, var3.getUsername()); -- this.mc = var1; -- this.dimension = var4; -+ public EntityPlayerSP(Minecraft par1Minecraft, World par2World, Session par3Session, int par4) { -+ super(par2World, par3Session.getUsername()); -+ this.mc = par1Minecraft; -+ this.dimension = par4; -+ // Spout Start -+ ((ClientPlayer) spoutEnty).setPlayer(this); -+ SpoutClient.getInstance().player = (ClientPlayer) spoutEnty; -+ // Spout End - } - - public void updateEntityActionState() { - super.updateEntityActionState(); - this.moveStrafing = this.movementInput.moveStrafe; - this.moveForward = this.movementInput.moveForward; -- this.isJumping = this.movementInput.jump; -+ // Spout Start -+ this.isJumping = this.movementInput.jump || this.isTreadingWater(); -+ // Spout End - this.prevRenderArmYaw = this.renderArmYaw; - this.prevRenderArmPitch = this.renderArmPitch; - this.renderArmPitch = (float)((double)this.renderArmPitch + (double)(this.rotationPitch - this.renderArmPitch) * 0.5D); - this.renderArmYaw = (float)((double)this.renderArmYaw + (double)(this.rotationYaw - this.renderArmYaw) * 0.5D); - } -- -+ -+ /** -+ * Called frequently so the entity can update its state every tick as required. For example, zombies and skeletons use -+ * this to react to sunlight and start to burn. -+ */ - public void onLivingUpdate() { -- if(this.sprintingTicksLeft > 0) { -+ // Spout Start -+ if (this.sprintingTicksLeft > 0 && !runToggle) { -+ // Spout End - --this.sprintingTicksLeft; -- if(this.sprintingTicksLeft == 0) { -+ -+ if (this.sprintingTicksLeft == 0) { - this.setSprinting(false); - } - } - -- if(this.sprintToggleTimer > 0) { -+ if (this.sprintToggleTimer > 0) { - --this.sprintToggleTimer; - } - -- if(this.mc.playerController.enableEverythingIsScrewedUpMode()) { -+ if (this.mc.playerController.enableEverythingIsScrewedUpMode()) { - this.posX = this.posZ = 0.5D; - this.posX = 0.0D; - this.posZ = 0.0D; -@@ -54,56 +94,68 @@ - this.rotationPitch = 10.0F; - this.posY = 68.5D; - } else { -- if(!this.mc.statFileWriter.hasAchievementUnlocked(AchievementList.openInventory)) { -- this.mc.guiAchievement.queueAchievementInformation(AchievementList.openInventory); -+ if (!this.mc.statFileWriter.hasAchievementUnlocked(AchievementList.openInventory)) { -+ // Spout Start -+ //this.mc.guiAchievement.queueAchievementInformation(AchievementList.openInventory); -+ // Spout End - } - - this.prevTimeInPortal = this.timeInPortal; -- if(this.inPortal) { -- if(this.mc.currentScreen != null) { -+ -+ if (this.inPortal) { -+ if (this.mc.currentScreen != null) { - this.mc.displayGuiScreen((GuiScreen)null); - } - -- if(this.timeInPortal == 0.0F) { -- this.mc.sndManager.playSoundFX("portal.trigger", 1.0F, this.ab.nextFloat() * 0.4F + 0.8F); -+ if (this.timeInPortal == 0.0F) { -+ this.mc.sndManager.playSoundFX("portal.trigger", 1.0F, this.rand.nextFloat() * 0.4F + 0.8F); - } - - this.timeInPortal += 0.0125F; -- if(this.timeInPortal >= 1.0F) { -+ -+ if (this.timeInPortal >= 1.0F) { - this.timeInPortal = 1.0F; - } - - this.inPortal = false; -- } else if(this.isPotionActive(Potion.confusion) && this.getActivePotionEffect(Potion.confusion).getDuration() > 60) { -- this.timeInPortal += 2.0F / 3.0F * 0.01F; -- if(this.timeInPortal > 1.0F) { -+ } else if (this.isPotionActive(Potion.confusion) && this.getActivePotionEffect(Potion.confusion).getDuration() > 60) { -+ this.timeInPortal += 0.006666667F; -+ -+ if (this.timeInPortal > 1.0F) { - this.timeInPortal = 1.0F; - } - } else { -- if(this.timeInPortal > 0.0F) { -+ if (this.timeInPortal > 0.0F) { - this.timeInPortal -= 0.05F; - } - -- if(this.timeInPortal < 0.0F) { -+ if (this.timeInPortal < 0.0F) { - this.timeInPortal = 0.0F; - } - } - -- if(this.timeUntilPortal > 0) { -+ if (this.timeUntilPortal > 0) { - --this.timeUntilPortal; - } - -+ // Spout Start -+ boolean wasFlightUp = movementInput.flyingUp; -+ // Spout End -+ - boolean var1 = this.movementInput.jump; - float var2 = 0.8F; - boolean var3 = this.movementInput.moveForward >= var2; -- this.movementInput.updatePlayerMoveState(); -- if(this.isUsingItem() && !this.isRiding()) { -+ // Spout Start - Keep parameter -+ this.movementInput.updatePlayerMoveState(this); -+ // Spout End -+ -+ if (this.isUsingItem() && !this.isRiding()) { - this.movementInput.moveStrafe *= 0.2F; - this.movementInput.moveForward *= 0.2F; - this.sprintToggleTimer = 0; - } - -- if(this.movementInput.sneak && this.ySize < 0.2F) { -+ if (this.movementInput.sneak && this.ySize < 0.2F) { - this.ySize = 0.2F; - } - -@@ -112,8 +164,9 @@ - this.pushOutOfBlocks(this.posX + (double)this.width * 0.35D, this.boundingBox.minY + 0.5D, this.posZ - (double)this.width * 0.35D); - this.pushOutOfBlocks(this.posX + (double)this.width * 0.35D, this.boundingBox.minY + 0.5D, this.posZ + (double)this.width * 0.35D); - boolean var4 = (float)this.getFoodStats().getFoodLevel() > 6.0F || this.capabilities.allowFlying; -- if(this.onGround && !var3 && this.movementInput.moveForward >= var2 && !this.isSprinting() && var4 && !this.isUsingItem() && !this.isPotionActive(Potion.blindness)) { -- if(this.sprintToggleTimer == 0) { -+ -+ if (this.onGround && !var3 && this.movementInput.moveForward >= var2 && !this.isSprinting() && var4 && !this.isUsingItem() && !this.isPotionActive(Potion.blindness)) { -+ if (this.sprintToggleTimer == 0) { - this.sprintToggleTimer = 7; - } else { - this.setSprinting(true); -@@ -121,16 +174,18 @@ - } - } - -- if(this.isSneaking()) { -+ if (this.isSneaking()) { - this.sprintToggleTimer = 0; - } - -- if(this.isSprinting() && (this.movementInput.moveForward < var2 || this.isCollidedHorizontally || !var4)) { -+ if (this.isSprinting() && (this.movementInput.moveForward < var2 || this.isCollidedHorizontally || !var4)) { - this.setSprinting(false); - } - -- if(this.capabilities.allowFlying && !var1 && this.movementInput.jump) { -- if(this.flyToggleTimer == 0) { -+ // Spout Start -+ if (this.capabilities.allowFlying && !wasFlightUp && this.movementInput.flyingUp) { -+ // Spout End -+ if (this.flyToggleTimer == 0) { - this.flyToggleTimer = 7; - } else { - this.capabilities.isFlying = !this.capabilities.isFlying; -@@ -139,33 +194,45 @@ - } - } - -- if(this.capabilities.isFlying) { -- if(this.movementInput.sneak) { -- this.motionY -= 0.15D; -+ if (this.capabilities.isFlying) { -+ // Spout Start -+ if (this.movementInput.flyingDown) { -+ if (SpoutClient.getInstance().isFlySpeedCheat()) { -+ this.motionY -= 0.15D * Configuration.getFlightSpeedFactor(); -+ } else { -+ this.motionY -= 0.15D; -+ } - } - -- if(this.movementInput.jump) { -- this.motionY += 0.15D; -+ if (this.movementInput.flyingUp) { -+ if (SpoutClient.getInstance().isFlySpeedCheat()) { -+ this.motionY += 0.15D * Configuration.getFlightSpeedFactor(); -+ } else { -+ this.motionY += 0.15D; -+ } - } -+ // Spout End - } - -- if(this.isRidingHorse()) { -- if(this.horseJumpPowerCounter < 0) { -+ if (this.isRidingHorse()) { -+ if (this.horseJumpPowerCounter < 0) { - ++this.horseJumpPowerCounter; -- if(this.horseJumpPowerCounter == 0) { -+ -+ if (this.horseJumpPowerCounter == 0) { - this.horseJumpPower = 0.0F; - } - } - -- if(var1 && !this.movementInput.jump) { -+ if (var1 && !this.movementInput.jump) { - this.horseJumpPowerCounter = -10; - this.func_110318_g(); -- } else if(!var1 && this.movementInput.jump) { -+ } else if (!var1 && this.movementInput.jump) { - this.horseJumpPowerCounter = 0; - this.horseJumpPower = 0.0F; -- } else if(var1) { -+ } else if (var1) { - ++this.horseJumpPowerCounter; -- if(this.horseJumpPowerCounter < 10) { -+ -+ if (this.horseJumpPowerCounter < 10) { - this.horseJumpPower = (float)this.horseJumpPowerCounter * 0.1F; - } else { - this.horseJumpPower = 0.8F + 2.0F / (float)(this.horseJumpPowerCounter - 9) * 0.1F; -@@ -174,28 +241,34 @@ - } else { - this.horseJumpPower = 0.0F; - } -- -+ - super.onLivingUpdate(); -- if(this.onGround && this.capabilities.isFlying) { -+ -+ if (this.onGround && this.capabilities.isFlying) { - this.capabilities.isFlying = false; - this.sendPlayerAbilities(); - } -- - } - } - -+ /** -+ * Gets the player's field of view multiplier. (ex. when flying) -+ */ - public float getFOVMultiplier() { - float var1 = 1.0F; -- if(this.capabilities.isFlying) { -+ -+ if (this.capabilities.isFlying) { - var1 *= 1.1F; - } - - AttributeInstance var2 = this.getEntityAttribute(SharedMonsterAttributes.movementSpeed); - var1 = (float)((double)var1 * ((var2.getAttributeValue() / (double)this.capabilities.getWalkSpeed() + 1.0D) / 2.0D)); -- if(this.isUsingItem() && this.getItemInUse().itemID == Item.bow.itemID) { -+ -+ if (this.isUsingItem() && this.getItemInUse().itemID == Item.bow.itemID) { - int var3 = this.getItemInUseDuration(); - float var4 = (float)var3 / 20.0F; -- if(var4 > 1.0F) { -+ -+ if (var4 > 1.0F) { - var4 = 1.0F; - } else { - var4 *= var4; -@@ -207,100 +280,143 @@ - return var1; - } - -+ /** -+ * sets current screen to null (used on escape buttons of GUIs) -+ */ - public void closeScreen() { - super.closeScreen(); - this.mc.displayGuiScreen((GuiScreen)null); - } - -- public void displayGUIEditSign(TileEntity var1) { -- if(var1 instanceof TileEntitySign) { -- this.mc.displayGuiScreen(new GuiEditSign((TileEntitySign)var1)); -- } else if(var1 instanceof TileEntityCommandBlock) { -- this.mc.displayGuiScreen(new GuiCommandBlock((TileEntityCommandBlock)var1)); -- } -- -- } -- -- public void displayGUIBook(ItemStack var1) { -- Item var2 = var1.getItem(); -- if(var2 == Item.writtenBook) { -- this.mc.displayGuiScreen(new GuiScreenBook(this, var1, false)); -- } else if(var2 == Item.writableBook) { -- this.mc.displayGuiScreen(new GuiScreenBook(this, var1, true)); -- } -- -- } -- -- public void displayGUIChest(IInventory var1) { -- this.mc.displayGuiScreen(new GuiChest(this.inventory, var1)); -- } -- -- public void displayGUIHopper(TileEntityHopper var1) { -- this.mc.displayGuiScreen(new GuiHopper(this.inventory, var1)); -- } -- -- public void displayGUIHopperMinecart(EntityMinecartHopper var1) { -- this.mc.displayGuiScreen(new GuiHopper(this.inventory, var1)); -- } -- -- public void displayGUIHorse(EntityHorse var1, IInventory var2) { -- this.mc.displayGuiScreen(new GuiScreenHorseInventory(this.inventory, var2, var1)); -- } -- -- public void displayGUIWorkbench(int var1, int var2, int var3) { -- this.mc.displayGuiScreen(new GuiCrafting(this.inventory, this.worldObj, var1, var2, var3)); -- } -- -- public void displayGUIEnchantment(int var1, int var2, int var3, String var4) { -- this.mc.displayGuiScreen(new GuiEnchantment(this.inventory, this.worldObj, var1, var2, var3, var4)); -- } -- -- public void displayGUIAnvil(int var1, int var2, int var3) { -- this.mc.displayGuiScreen(new GuiRepair(this.inventory, this.worldObj, var1, var2, var3)); -- } -- -- public void displayGUIFurnace(TileEntityFurnace var1) { -- this.mc.displayGuiScreen(new GuiFurnace(this.inventory, var1)); -- } -- -- public void displayGUIBrewingStand(TileEntityBrewingStand var1) { -- this.mc.displayGuiScreen(new GuiBrewingStand(this.inventory, var1)); -- } -- -- public void displayGUIBeacon(TileEntityBeacon var1) { -- this.mc.displayGuiScreen(new GuiBeacon(this.inventory, var1)); -- } -- -- public void displayGUIDispenser(TileEntityDispenser var1) { -- this.mc.displayGuiScreen(new GuiDispenser(this.inventory, var1)); -- } -- -- public void displayGUIMerchant(IMerchant var1, String var2) { -- this.mc.displayGuiScreen(new GuiMerchant(this.inventory, var1, this.worldObj, var2)); -- } -- -- public void onCriticalHit(Entity var1) { -- this.mc.effectRenderer.addEffect(new EntityCrit2FX(this.mc.theWorld, var1)); -- } -- -- public void onEnchantmentCritical(Entity var1) { -- EntityCrit2FX var2 = new EntityCrit2FX(this.mc.theWorld, var1, "magicCrit"); -+ /** -+ * Displays the GUI for editing a sign. Args: tileEntitySign -+ */ -+ public void displayGUIEditSign(TileEntity par1TileEntity) { -+ if (par1TileEntity instanceof TileEntitySign) { -+ this.mc.displayGuiScreen(new GuiEditSign((TileEntitySign)par1TileEntity)); -+ } else if (par1TileEntity instanceof TileEntityCommandBlock) { -+ this.mc.displayGuiScreen(new GuiCommandBlock((TileEntityCommandBlock)par1TileEntity)); -+ } -+ } -+ -+ /** -+ * Displays the GUI for interacting with a book. -+ */ -+ public void displayGUIBook(ItemStack par1ItemStack) { -+ Item var2 = par1ItemStack.getItem(); -+ -+ if (var2 == Item.writtenBook) { -+ this.mc.displayGuiScreen(new GuiScreenBook(this, par1ItemStack, false)); -+ } else if (var2 == Item.writableBook) { -+ this.mc.displayGuiScreen(new GuiScreenBook(this, par1ItemStack, true)); -+ } -+ } -+ -+ /** -+ * Displays the GUI for interacting with a chest inventory. Args: chestInventory -+ */ -+ public void displayGUIChest(IInventory par1IInventory) { -+ this.mc.displayGuiScreen(new GuiChest(this.inventory, par1IInventory)); -+ } -+ -+ public void displayGUIHopper(TileEntityHopper par1TileEntityHopper) { -+ this.mc.displayGuiScreen(new GuiHopper(this.inventory, par1TileEntityHopper)); -+ } -+ -+ public void displayGUIHopperMinecart(EntityMinecartHopper par1EntityMinecartHopper) { -+ this.mc.displayGuiScreen(new GuiHopper(this.inventory, par1EntityMinecartHopper)); -+ } -+ -+ public void displayGUIHorse(EntityHorse par1EntityHorse, IInventory par2IInventory) { -+ this.mc.displayGuiScreen(new GuiScreenHorseInventory(this.inventory, par2IInventory, par1EntityHorse)); -+ } -+ -+ /** -+ * Displays the crafting GUI for a workbench. -+ */ -+ public void displayGUIWorkbench(int par1, int par2, int par3) { -+ this.mc.displayGuiScreen(new GuiCrafting(this.inventory, this.worldObj, par1, par2, par3)); -+ } -+ -+ public void displayGUIEnchantment(int par1, int par2, int par3, String par4Str) { -+ this.mc.displayGuiScreen(new GuiEnchantment(this.inventory, this.worldObj, par1, par2, par3, par4Str)); -+ } -+ -+ /** -+ * Displays the GUI for interacting with an anvil. -+ */ -+ public void displayGUIAnvil(int par1, int par2, int par3) { -+ this.mc.displayGuiScreen(new GuiRepair(this.inventory, this.worldObj, par1, par2, par3)); -+ } -+ -+ /** -+ * Displays the furnace GUI for the passed in furnace entity. Args: tileEntityFurnace -+ */ -+ public void displayGUIFurnace(TileEntityFurnace par1TileEntityFurnace) { -+ this.mc.displayGuiScreen(new GuiFurnace(this.inventory, par1TileEntityFurnace)); -+ } -+ -+ /** -+ * Displays the GUI for interacting with a brewing stand. -+ */ -+ public void displayGUIBrewingStand(TileEntityBrewingStand par1TileEntityBrewingStand) { -+ this.mc.displayGuiScreen(new GuiBrewingStand(this.inventory, par1TileEntityBrewingStand)); -+ } -+ -+ /** -+ * Displays the GUI for interacting with a beacon. -+ */ -+ public void displayGUIBeacon(TileEntityBeacon par1TileEntityBeacon) { -+ this.mc.displayGuiScreen(new GuiBeacon(this.inventory, par1TileEntityBeacon)); -+ } -+ -+ /** -+ * Displays the dipsenser GUI for the passed in dispenser entity. Args: TileEntityDispenser -+ */ -+ public void displayGUIDispenser(TileEntityDispenser par1TileEntityDispenser) { -+ this.mc.displayGuiScreen(new GuiDispenser(this.inventory, par1TileEntityDispenser)); -+ } -+ -+ public void displayGUIMerchant(IMerchant par1IMerchant, String par2Str) { -+ this.mc.displayGuiScreen(new GuiMerchant(this.inventory, par1IMerchant, this.worldObj, par2Str)); -+ } -+ -+ /** -+ * Called when the player performs a critical hit on the Entity. Args: entity that was hit critically -+ */ -+ public void onCriticalHit(Entity par1Entity) { -+ this.mc.effectRenderer.addEffect(new EntityCrit2FX(this.mc.theWorld, par1Entity)); -+ } -+ -+ public void onEnchantmentCritical(Entity par1Entity) { -+ EntityCrit2FX var2 = new EntityCrit2FX(this.mc.theWorld, par1Entity, "magicCrit"); - this.mc.effectRenderer.addEffect(var2); - } - -- public void onItemPickup(Entity var1, int var2) { -- this.mc.effectRenderer.addEffect(new EntityPickupFX(this.mc.theWorld, var1, this, -0.5F)); -+ /** -+ * Called whenever an item is picked up from walking over it. Args: pickedUpEntity, stackSize -+ */ -+ public void onItemPickup(Entity par1Entity, int par2) { -+ this.mc.effectRenderer.addEffect(new EntityPickupFX(this.mc.theWorld, par1Entity, this, -0.5F)); - } - -+ /** -+ * Returns if this entity is sneaking. -+ */ - public boolean isSneaking() { - return this.movementInput.sneak && !this.sleeping; - } - -- public void setPlayerSPHealth(float var1) { -- float var2 = this.getHealth() - var1; -- if(var2 <= 0.0F) { -- this.setHealth(var1); -- if(var2 < 0.0F) { -+ /** -+ * Updates health locally. -+ */ -+ public void setPlayerSPHealth(float par1) { -+ float var2 = this.getHealth() - par1; -+ -+ if (var2 <= 0.0F) { -+ this.setHealth(par1); -+ -+ if (var2 < 0.0F) { - this.hurtResistantTime = this.maxHurtResistantTime / 2; - } - } else { -@@ -310,82 +426,93 @@ - this.damageEntity(DamageSource.generic, var2); - this.hurtTime = this.maxHurtTime = 10; - } -- -- } -- -- public void addChatMessage(String var1) { -- this.mc.ingameGUI.getChatGUI().addTranslatedMessage(var1, new Object[0]); -- } -- -- public void addStat(StatBase var1, int var2) { -- if(var1 != null) { -- if(var1.isAchievement()) { -- Achievement var3 = (Achievement)var1; -- if(var3.parentAchievement == null || this.mc.statFileWriter.hasAchievementUnlocked(var3.parentAchievement)) { -- if(!this.mc.statFileWriter.hasAchievementUnlocked(var3)) { -+ } -+ -+ /** -+ * Add a chat message to the player -+ */ -+ public void addChatMessage(String par1Str) { -+ this.mc.ingameGUI.getChatGUI().addTranslatedMessage(par1Str, new Object[0]); -+ } -+ -+ /** -+ * Adds a value to a statistic field. -+ */ -+ public void addStat(StatBase par1StatBase, int par2) { -+ if (par1StatBase != null) { -+ if (par1StatBase.isAchievement()) { -+ Achievement var3 = (Achievement)par1StatBase; -+ -+ if (var3.parentAchievement == null || this.mc.statFileWriter.hasAchievementUnlocked(var3.parentAchievement)) { -+ if (!this.mc.statFileWriter.hasAchievementUnlocked(var3)) { - this.mc.guiAchievement.queueTakenAchievement(var3); - } - -- this.mc.statFileWriter.readStat(var1, var2); -+ this.mc.statFileWriter.readStat(par1StatBase, par2); - } - } else { -- this.mc.statFileWriter.readStat(var1, var2); -+ this.mc.statFileWriter.readStat(par1StatBase, par2); - } -- - } - } - -- private boolean isBlockTranslucent(int var1, int var2, int var3) { -- return this.worldObj.isBlockNormalCube(var1, var2, var3); -+ private boolean isBlockTranslucent(int par1, int par2, int par3) { -+ return this.worldObj.isBlockNormalCube(par1, par2, par3); - } - -- protected boolean pushOutOfBlocks(double var1, double var3, double var5) { -- int var7 = MathHelper.floor_double(var1); -- int var8 = MathHelper.floor_double(var3); -- int var9 = MathHelper.floor_double(var5); -- double var10 = var1 - (double)var7; -- double var12 = var5 - (double)var9; -- if(this.isBlockTranslucent(var7, var8, var9) || this.isBlockTranslucent(var7, var8 + 1, var9)) { -+ /** -+ * Adds velocity to push the entity out of blocks at the specified x, y, z position Args: x, y, z -+ */ -+ protected boolean pushOutOfBlocks(double par1, double par3, double par5) { -+ int var7 = MathHelper.floor_double(par1); -+ int var8 = MathHelper.floor_double(par3); -+ int var9 = MathHelper.floor_double(par5); -+ double var10 = par1 - (double)var7; -+ double var12 = par5 - (double)var9; -+ -+ if (this.isBlockTranslucent(var7, var8, var9) || this.isBlockTranslucent(var7, var8 + 1, var9)) { - boolean var14 = !this.isBlockTranslucent(var7 - 1, var8, var9) && !this.isBlockTranslucent(var7 - 1, var8 + 1, var9); - boolean var15 = !this.isBlockTranslucent(var7 + 1, var8, var9) && !this.isBlockTranslucent(var7 + 1, var8 + 1, var9); - boolean var16 = !this.isBlockTranslucent(var7, var8, var9 - 1) && !this.isBlockTranslucent(var7, var8 + 1, var9 - 1); - boolean var17 = !this.isBlockTranslucent(var7, var8, var9 + 1) && !this.isBlockTranslucent(var7, var8 + 1, var9 + 1); - byte var18 = -1; - double var19 = 9999.0D; -- if(var14 && var10 < var19) { -+ -+ if (var14 && var10 < var19) { - var19 = var10; - var18 = 0; - } - -- if(var15 && 1.0D - var10 < var19) { -+ if (var15 && 1.0D - var10 < var19) { - var19 = 1.0D - var10; - var18 = 1; - } - -- if(var16 && var12 < var19) { -+ if (var16 && var12 < var19) { - var19 = var12; - var18 = 4; - } - -- if(var17 && 1.0D - var12 < var19) { -+ if (var17 && 1.0D - var12 < var19) { - var19 = 1.0D - var12; - var18 = 5; - } - - float var21 = 0.1F; -- if(var18 == 0) { -+ -+ if (var18 == 0) { - this.motionX = (double)(-var21); - } - -- if(var18 == 1) { -+ if (var18 == 1) { - this.motionX = (double)var21; - } - -- if(var18 == 4) { -+ if (var18 == 4) { - this.motionZ = (double)(-var21); - } - -- if(var18 == 5) { -+ if (var18 == 5) { - this.motionZ = (double)var21; - } - } -@@ -393,37 +520,56 @@ - return false; - } - -- public void setSprinting(boolean var1) { -- super.setSprinting(var1); -- this.sprintingTicksLeft = var1 ? 600 : 0; -- } -- -- public void setXPStats(float var1, int var2, int var3) { -- this.experience = var1; -- this.experienceTotal = var2; -- this.experienceLevel = var3; -- } -- -- public void sendChatToPlayer(ChatMessageComponent var1) { -- this.mc.ingameGUI.getChatGUI().printChatMessage(var1.toStringWithFormatting(true)); -- } -- -- public boolean canCommandSenderUseCommand(int var1, String var2) { -- return var1 <= 0; -- } -- -- public ChunkCoordinates getCommandSenderPosition() { -+ /** -+ * Set sprinting switch for Entity. -+ */ -+ public void setSprinting(boolean par1) { -+ super.setSprinting(par1); -+ this.sprintingTicksLeft = par1 ? 600 : 0; -+ } -+ -+ /** -+ * Sets the current XP, total XP, and level number. -+ */ -+ public void setXPStats(float par1, int par2, int par3) { -+ this.experience = par1; -+ this.experienceTotal = par2; -+ this.experienceLevel = par3; -+ } -+ -+ //ToDO: This printChatMessage() method may not need to be called, its blocked within 1.5.2 -+ public void sendChatToPlayer(ChatMessageComponent par1ChatMessageComponent) { -+ this.mc.ingameGUI.getChatGUI().printChatMessage(par1ChatMessageComponent.toStringWithFormatting(true)); -+ } -+ -+ /** -+ * Returns true if the command sender is allowed to use the given command. -+ */ -+ public boolean canCommandSenderUseCommand(int par1, String par2Str) { -+ return par1 <= 0; -+ } -+ -+ /** -+ * Return the position for this command sender. -+ */ -+ public ChunkCoordinates getPlayerCoordinates() { - return new ChunkCoordinates(MathHelper.floor_double(this.posX + 0.5D), MathHelper.floor_double(this.posY + 0.5D), MathHelper.floor_double(this.posZ + 0.5D)); - } - -+ /** -+ * Returns the item that this EntityLiving is holding, if any. -+ */ - public ItemStack getHeldItem() { - return this.inventory.getCurrentItem(); - } - -- public void playSound(String var1, float var2, float var3) { -- this.worldObj.playSound(this.posX, this.posY - (double)this.yOffset, this.posZ, var1, var2, var3, false); -+ public void playSound(String par1Str, float par2, float par3) { -+ this.worldObj.playSound(this.posX, this.posY - (double)this.yOffset, this.posZ, par1Str, par2, par3, false); - } -- -+ -+ /** -+ * Returns whether the entity is in a local (client) world -+ */ - public boolean isClientWorld() { - return true; - } -@@ -436,6 +582,101 @@ - return this.horseJumpPower; - } - -- protected void func_110318_g() { -- } -+ protected void func_110318_g() {} -+ -+ // Spout -+ public boolean canSprint() { -+ return this.getFoodStats().getFoodLevel() > 6.0F; -+ } -+ -+ @Override -+ public void handleKeyPress(int key, boolean keyReleased) { -+ if (keyReleased) { -+ final GameSettings settings = SpoutClient.getHandle().gameSettings; -+ -+ // Fog toggle -+ if (key == settings.keyBindToggleFog.keyCode) { -+ byte view = (byte)settings.renderDistance; -+ byte newView = (byte) SpoutClient.getInstance().getActivePlayer().getNextRenderDistance().getValue(); -+ fogKey = settings.keyBindToggleFog; -+ settings.keyBindToggleFog = new KeyBinding("key.fog", -1); -+ if (view != newView) { -+ Configuration.setRenderDistance(newView); -+ Configuration.write(); -+ if (this instanceof EntityClientPlayerMP && Spoutcraft.getClient().isSpoutEnabled()) { -+ SpoutClient.getInstance().getPacketManager().sendSpoutPacket(new PacketRenderDistance((byte)newView)); -+ } -+ } -+ // Sneak toggle -+ } else if (key == settings.keySneakToggle.keyCode) { -+ sneakToggle = !sneakToggle; -+ if (sneakToggle) { -+ runToggle = false; -+ setSprinting(false); -+ treadWaterToggle = false; -+ } -+ // Run toggle -+ } else if (key == settings.keyRunToggle.keyCode) { -+ runToggle = !runToggle; -+ setSprinting(runToggle); -+ if (runToggle) { -+ sneakToggle = false; -+ treadWaterToggle = false; -+ } -+ // Water tread -+ } else if (key == settings.keyTreadWaterToggle.keyCode) { -+ treadWaterToggle = !treadWaterToggle; -+ if (treadWaterToggle) { -+ runToggle = false; -+ setSprinting(false); -+ sneakToggle = false; -+ } -+ // Auto forward -+ } else if (key == settings.keyAutoForward.keyCode) { -+ if (Spoutcraft.hasPermission("spout.plugin.autorun.forward")) { -+ autoforwardToggle = !autoforwardToggle; -+ autoBackwardToggle = false; -+ } -+ } else if (key == settings.keyBindForward.keyCode && autoforwardToggle) { -+ autoforwardToggle = false; -+ autoBackwardToggle = false; -+ // Auto backward -+ } else if (key == settings.keyAutoBackward.keyCode) { -+ if (Spoutcraft.hasPermission("spout.plugin.autorun.backward")) { -+ autoBackwardToggle = !autoBackwardToggle; -+ autoforwardToggle = false; -+ } -+ } else if (key == settings.keyBindBack.keyCode && autoBackwardToggle) { -+ autoBackwardToggle = false; -+ autoforwardToggle = false; -+ // Overview map -+ } else if (key == settings.keyWaypoint.keyCode){ -+ if(Spoutcraft.hasPermission("spout.plugin.overviewmap")) { -+ mc.displayGuiScreen(new GuiOverviewMap()); -+ } -+ } else if (key == settings.keyHideChat.keyCode){ -+ if (Spoutcraft.getActivePlayer() != null) { -+ Spoutcraft.getActivePlayer().getMainScreen().getChatTextBox().setVisible(!Spoutcraft.getActivePlayer().getMainScreen().getChatTextBox().isVisible()); -+ } -+ } -+ -+ if (this.capabilities.allowFlying && key == settings.keyFlyToggle.keyCode) { -+ this.capabilities.isFlying = !this.capabilities.isFlying; -+ if (this.capabilities.isFlying) { -+ posY += 0.1D; -+ this.motionY += 0.15D; -+ } -+ } -+ } -+ } -+ -+ @Override -+ public void onUpdate() { -+ if (fogKey != null) { -+ SpoutClient.getHandle().gameSettings.keyBindToggleFog = fogKey; -+ fogKey = null; -+ } -+ super.onUpdate(); -+ } -+ // Spout End - } ---- net/minecraft/src/GuiAchievement.java -+++ net/minecraft/src/GuiAchievement.java -@@ -5,37 +5,82 @@ - - public class GuiAchievement extends Gui { - private static final ResourceLocation achievementTextures = new ResourceLocation("textures/gui/achievement/achievement_background.png"); -+ -+ /** Holds the instance of the game (Minecraft) */ - private Minecraft theGame; -+ -+ /** Holds the latest width scaled to fit the game window. */ - private int achievementWindowWidth; -+ -+ /** Holds the latest height scaled to fit the game window. */ - private int achievementWindowHeight; -- private String e; -- private String f; -+ private String achievementGetLocalText; -+ private String achievementStatName; -+ -+ /** Holds the achievement that will be displayed on the GUI. */ - private Achievement theAchievement; - private long achievementTime; -+ -+ /** -+ * Holds a instance of RenderItem, used to draw the achievement icons on screen (is based on ItemStack) -+ */ - private RenderItem itemRender; - private boolean haveAchiement; -+ // Spout Start -+ private boolean customNotification = false; -+ private int itemId; -+ private short data = -1; -+ private int time = -1; -+ // Spout End - -- public GuiAchievement(Minecraft var1) { -- this.theGame = var1; -+ public GuiAchievement(Minecraft par1Minecraft) { -+ this.theGame = par1Minecraft; - this.itemRender = new RenderItem(); - } - -- public void queueTakenAchievement(Achievement var1) { -- this.e = I18n.getString("achievement.get"); -- this.f = I18n.getString(var1.getName()); -+ /** -+ * Queue a taken achievement to be displayed. -+ */ -+ public void queueTakenAchievement(Achievement par1Achievement) { -+ this.achievementGetLocalText = I18n.getString("achievement.get"); -+ this.achievementStatName = I18n.getString(par1Achievement.getName()); - this.achievementTime = Minecraft.getSystemTime(); -- this.theAchievement = var1; -+ this.theAchievement = par1Achievement; - this.haveAchiement = false; - } - -- public void queueAchievementInformation(Achievement var1) { -- this.e = I18n.getString(var1.getName()); -- this.f = var1.getDescription(); -+ /** -+ * Queue a information about a achievement to be displayed. -+ */ -+ public void queueAchievementInformation(Achievement par1Achievement) { -+ this.achievementGetLocalText = I18n.getString(par1Achievement.getName()); -+ this.achievementStatName = par1Achievement.getDescription(); - this.achievementTime = Minecraft.getSystemTime() - 2500L; -- this.theAchievement = var1; -+ this.theAchievement = par1Achievement; - this.haveAchiement = true; - } -- -+ -+ // Spout Start -+ public void queueNotification(String title, String message, int toRender) { -+ queueNotification(title, message, toRender, (short) -1, -1); -+ } -+ -+ public void queueNotification(String title, String message, int toRender, short data, int time) { -+ achievementGetLocalText = title; -+ achievementStatName = message; -+ achievementTime = Minecraft.getSystemTime(); -+ theAchievement = null; -+ haveAchiement = false; -+ customNotification = true; -+ this.itemId = toRender; -+ this.time = time; -+ this.data = data; -+ } -+ // Spout End -+ -+ /** -+ * Update the display of the achievement window to match the game window. -+ */ - private void updateAchievementWindowScale() { - GL11.glViewport(0, 0, this.theGame.displayWidth, this.theGame.displayHeight); - GL11.glMatrixMode(GL11.GL_PROJECTION); -@@ -56,21 +101,39 @@ - GL11.glTranslatef(0.0F, 0.0F, -2000.0F); - } - -+ /** -+ * Updates the small achievement tooltip window, showing a queued achievement if is needed. -+ */ - public void updateAchievementWindow() { -- if(this.theAchievement != null && this.achievementTime != 0L) { -- double var1 = (double)(Minecraft.getSystemTime() - this.achievementTime) / 3000.0D; -- if(this.haveAchiement || var1 >= 0.0D && var1 <= 1.0D) { -+ // Spout Start -+ if ((this.theAchievement != null || this.customNotification == true) && this.achievementTime != 0L) { -+ double delayTime = 3000.0D; -+ if (customNotification) { -+ if (time < 1) { -+ delayTime = 7500; -+ } else { -+ delayTime = time; -+ } -+ } -+ double var1 = (double)(Minecraft.getSystemTime() - this.achievementTime) / delayTime; -+ // Spout End -+ -+ if (!this.haveAchiement && (var1 < 0.0D || var1 > 1.0D)) { -+ this.achievementTime = 0L; -+ } else { - this.updateAchievementWindowScale(); - GL11.glDisable(GL11.GL_DEPTH_TEST); - GL11.glDepthMask(false); - double var3 = var1 * 2.0D; -- if(var3 > 1.0D) { -+ -+ if (var3 > 1.0D) { - var3 = 2.0D - var3; - } - - var3 *= 4.0D; - var3 = 1.0D - var3; -- if(var3 < 0.0D) { -+ -+ if (var3 < 0.0D) { - var3 = 0.0D; - } - -@@ -83,11 +146,12 @@ - this.theGame.getTextureManager().bindTexture(achievementTextures); - GL11.glDisable(GL11.GL_LIGHTING); - this.drawTexturedModalRect(var5, var6, 96, 202, 160, 32); -- if(this.haveAchiement) { -- this.theGame.fontRenderer.drawSplitString(this.f, var5 + 30, var6 + 7, 120, -1); -+ -+ if (this.haveAchiement) { -+ this.theGame.fontRenderer.drawSplitString(this.achievementStatName, var5 + 30, var6 + 7, 120, -1); - } else { -- this.theGame.fontRenderer.drawString(this.e, var5 + 30, var6 + 7, -256); -- this.theGame.fontRenderer.drawString(this.f, var5 + 30, var6 + 18, -1); -+ this.theGame.fontRenderer.drawString(this.achievementGetLocalText, var5 + 30, var6 + 7, -256); -+ this.theGame.fontRenderer.drawString(this.achievementStatName, var5 + 30, var6 + 18, -1); - } - - RenderHelper.enableGUIStandardItemLighting(); -@@ -95,12 +159,23 @@ - GL11.glEnable(GL12.GL_RESCALE_NORMAL); - GL11.glEnable(GL11.GL_COLOR_MATERIAL); - GL11.glEnable(GL11.GL_LIGHTING); -- this.itemRender.renderItemAndEffectIntoGUI(this.theGame.fontRenderer, this.theGame.getTextureManager(), this.theAchievement.theItemStack, var5 + 8, var6 + 8); -+ // Spout Start -+ ItemStack toRender = theAchievement != null ? theAchievement.theItemStack : null; -+ if (customNotification){ -+ if (data < 1) { -+ toRender = new ItemStack(itemId, 1, 0); -+ } else { -+ toRender = new ItemStack(itemId, 1, data); -+ } -+ } -+ -+ if (toRender != null) { -+ this.itemRender.renderItemAndEffectIntoGUI(this.theGame.fontRenderer, this.theGame.getTextureManager(), toRender, var5 + 8, var6 + 8); -+ } -+ // Spout End - GL11.glDisable(GL11.GL_LIGHTING); - GL11.glDepthMask(true); - GL11.glEnable(GL11.GL_DEPTH_TEST); -- } else { -- this.achievementTime = 0L; - } - } - } ---- net/minecraft/src/Minecraft.java -+++ net/minecraft/src/Minecraft.java -@@ -1,6 +1,5 @@ - package net.minecraft.src; - --import com.google.common.collect.Lists; - import java.awt.image.BufferedImage; - import java.io.File; - import java.io.IOException; -@@ -14,9 +13,11 @@ - import java.util.HashSet; - import java.util.Iterator; - import java.util.List; -+ - import javax.imageio.ImageIO; --import net.minecraft.client.ClientBrandRetriever; --import net.minecraft.server.MinecraftServer; -+ -+import com.google.common.collect.Lists; -+ - import org.lwjgl.LWJGLException; - import org.lwjgl.Sys; - import org.lwjgl.input.Keyboard; -@@ -28,105 +29,242 @@ - import org.lwjgl.opengl.GL20; - import org.lwjgl.opengl.GLContext; - import org.lwjgl.opengl.PixelFormat; --import org.lwjgl.util.glu.GLU; -+ -+import com.prupe.mcpatcher.MCPatcherUtils; -+import com.prupe.mcpatcher.TexturePackChangeHandler; -+import com.prupe.mcpatcher.hd.AAHelper; -+ -+import net.minecraft.client.ClientBrandRetriever; -+import net.minecraft.server.MinecraftServer; -+import net.minecraft.src.Session; -+ -+import org.bukkit.ChatColor; -+import org.spoutcraft.api.gui.PopupScreen; -+import org.spoutcraft.api.gui.Screen; -+import org.spoutcraft.api.gui.ScreenType; -+import org.spoutcraft.client.SpoutClient; -+import org.spoutcraft.client.chunkcache.HeightMap; -+import org.spoutcraft.client.config.Configuration; -+import org.spoutcraft.client.controls.SimpleKeyBindingManager; -+import org.spoutcraft.client.gui.ScreenUtil; -+import org.spoutcraft.client.gui.minimap.MinimapConfig; -+import org.spoutcraft.client.gui.minimap.MinimapUtils; -+import org.spoutcraft.client.gui.minimap.Waypoint; -+import org.spoutcraft.client.io.FileUtil; -+import org.spoutcraft.client.packet.PacketScreenAction; -+import org.spoutcraft.client.packet.ScreenAction; -+import org.spoutcraft.client.packet.SpoutPacket; -+import org.spoutcraft.client.spoutworth.SpoutWorth; - - public class Minecraft implements IPlayerUsage { - private static final ResourceLocation locationMojangPng = new ResourceLocation("textures/gui/title/mojang.png"); - public static final boolean isRunningOnMac = Util.getOSType() == EnumOS.MACOS; -+ -+ /** A 10MiB preallocation to ensure the heap is reasonably sized. */ - public static byte[] memoryReserve = new byte[10485760]; -- private static final List J = Lists.newArrayList((Object[])(new DisplayMode[]{new DisplayMode(2560, 1600), new DisplayMode(2880, 1800)})); -+ private static final List macDisplayModes = Lists.newArrayList(new DisplayMode[] {new DisplayMode(2560, 1600), new DisplayMode(2880, 1800)}); - private final ILogAgent mcLogAgent; -- private final File L; -+ private final File fileResourcepacks; - private ServerData currentServerData; -- private TextureManager renderEngine; -- private static Minecraft theMinecraft; -+ -+ /** The RenderEngine instance used by Minecraft */ -+ // Spout Start -+ public TextureManager renderEngine; -+ // Spout End -+ -+ /** -+ * Set to 'this' in Minecraft constructor; used by some settings get methods -+ */ -+ // Spout Start - private to public -+ public static Minecraft theMinecraft; -+ // Spout End - public PlayerControllerMP playerController; - private boolean fullscreen; - private boolean hasCrashed; -+ -+ /** Instance of CrashReport. */ - private CrashReport crashReporter; - public int displayWidth; - public int displayHeight; -- private Timer timer = new Timer(20.0F); -- private PlayerUsageSnooper usageSnooper = new PlayerUsageSnooper("client", this, MinecraftServer.getCurrentTimeMillis()); -+ private Timer timer; -+ -+ /** Instance of PlayerUsageSnooper. */ -+ private PlayerUsageSnooper usageSnooper; - public WorldClient theWorld; - public RenderGlobal renderGlobal; - public EntityClientPlayerMP thePlayer; -+ -+ /** -+ * The Entity from which the renderer determines the render viewpoint. Currently is always the parent Minecraft class's -+ * 'thePlayer' instance. Modification of its location, rotation, or other settings at render time will modify the -+ * camera likewise, with the caveat of triggering chunk rebuilds as it moves, making it unsuitable for changing the -+ * viewpoint mid-render. -+ */ - public EntityLivingBase renderViewEntity; - public EntityLivingBase pointedEntityLiving; - public EffectRenderer effectRenderer; -- private final Session session; -- private boolean isGamePaused; -+ public Session session; -+ public boolean isGamePaused; -+ -+ /** The font renderer used for displaying and measuring text. */ - public FontRenderer fontRenderer; - public FontRenderer standardGalacticFontRenderer; -+ -+ /** The GuiScreen that's being displayed at the moment. */ - public GuiScreen currentScreen; - public LoadingScreenRenderer loadingScreen; - public EntityRenderer entityRenderer; -+ -+ /** Mouse left click counter */ - private int leftClickCounter; -+ -+ /** Display width */ - private int tempDisplayWidth; -+ -+ /** Display height */ - private int tempDisplayHeight; -+ -+ /** Instance of IntegratedServer. */ - private IntegratedServer theIntegratedServer; -+ -+ /** Gui achievement */ - public GuiAchievement guiAchievement; - public GuiIngame ingameGUI; -+ -+ /** Skip render world */ - public boolean skipRenderWorld; -+ -+ /** The ray trace hit that the mouse is over. */ - public MovingObjectPosition objectMouseOver; -- public GameSettings gameSettings; -+ -+ /** The game settings that currently hold effect. */ -+ public GameSettings gameSettings; - public SoundManager sndManager; -+ -+ /** Mouse helper instance. */ - public MouseHelper mouseHelper; -- public final File x; -- private final File aa; -- private final String ab; -- private final Proxy ac; -+ public final File mcDataDir; -+ private final File fileAssets; -+ private final String launchedVersion; -+ private final Proxy proxy; - private ISaveFormat saveLoader; -+ -+ /** -+ * This is set to fpsCounter every debug screen update, and is shown on the debug screen. It's also sent as part of the -+ * usage snooping. -+ */ - private static int debugFPS; -+ -+ /** -+ * When you place a block, it's set to 6, decremented once per tick, when it's 0, you can place another block. -+ */ - private int rightClickDelayTimer; -+ -+ /** -+ * Checked in Minecraft's while(running) loop, if true it's set to false and the textures refreshed. -+ */ - private boolean refreshTexturePacksScheduled; -+ -+ /** Stat file writer */ - public StatFileWriter statFileWriter; -- private String ah; -+ private String serverName; - private int serverPort; -+ -+ /** -+ * Makes sure it doesn't keep taking screenshots when both buttons are down. -+ */ - boolean isTakingScreenshot; -+ -+ /** -+ * Does the actual gameplay have focus. If so then mouse and keys will effect the player instead of menus. -+ */ - public boolean inGameHasFocus; -- long systemTime = getSystemTime(); -+ long systemTime; -+ -+ /** Join player counter */ - private int joinPlayerCounter; - private final boolean isDemo; - private INetworkManager myNetworkManager; - private boolean integratedServerIsRunning; -- public final Profiler mcProfiler = new Profiler(); -- private long field_83002_am = -1L; -+ -+ /** The profiler instance */ -+ public final Profiler mcProfiler; -+ private long field_83002_am; - private ReloadableResourceManager mcResourceManager; -- private final MetadataSerializer metadataSerializer_ = new MetadataSerializer(); -- private List aq = Lists.newArrayList(); -+ private final MetadataSerializer metadataSerializer_; -+ private List defaultResourcePacks; - private DefaultResourcePack mcDefaultResourcePack; - private ResourcePackRepository mcResourcePackRepository; - private LanguageManager mcLanguageManager; -- volatile boolean running = true; -- public String E = ""; -- long debugUpdateTime = getSystemTime(); -+ -+ /** -+ * Set to true to keep the game loop running. Set to false by shutdown() to allow the game loop to exit cleanly. -+ */ -+ volatile boolean running; -+ -+ /** String that shows the debug information */ -+ public String debug; -+ -+ /** Approximate time (in ms) of last update to debug string */ -+ long debugUpdateTime; -+ -+ /** holds the current fps */ - int fpsCounter; -- long prevFrameTime = -1L; -- private String au = "root"; -- -- public Minecraft(Session var1, int var2, int var3, boolean var4, boolean var5, File var6, File var7, File var8, Proxy var9, String var10) { -+ long prevFrameTime; -+ -+ /** Profiler currently displayed in the debug screen pie chart */ -+ private String debugProfilerName; -+ // Spout Start -+ public static Thread mainThread; -+ private boolean shutdown = false; -+ public static boolean spoutcraftLauncher = true; -+ public static boolean portable = false; -+ public static int framesPerSecond = 0; -+ // Spout End -+ -+ public Minecraft(Session par1Session, int par2, int par3, boolean par4, boolean par5, File par6File, File par7File, File par8File, Proxy par9Proxy, String par10Str) { -+ MCPatcherUtils.setMinecraft(par6File, par7File, "1.6.4", "4.2.2"); -+ this.timer = new Timer(20.0F); -+ this.usageSnooper = new PlayerUsageSnooper("client", this, MinecraftServer.getSystemTimeMillis()); -+ this.systemTime = getSystemTime(); -+ this.mcProfiler = new Profiler(); -+ this.field_83002_am = -1L; -+ this.metadataSerializer_ = new MetadataSerializer(); -+ this.defaultResourcePacks = Lists.newArrayList(); -+ this.running = true; -+ this.debug = ""; -+ this.debugUpdateTime = getSystemTime(); -+ this.prevFrameTime = -1L; -+ this.debugProfilerName = "root"; - theMinecraft = this; -- this.mcLogAgent = new LogAgent("Minecraft-Client", " [CLIENT]", (new File(var6, "output-client.log")).getAbsolutePath()); -- this.x = var6; -- this.aa = var7; -- this.L = var8; -- this.ab = var10; -- this.mcDefaultResourcePack = new DefaultResourcePack(this.aa); -+ this.mcLogAgent = new LogAgent("Minecraft-Client", " [CLIENT]", (new File(par6File, "output-client.log")).getAbsolutePath()); -+ this.mcDataDir = par6File; -+ this.fileAssets = par7File; -+ this.fileResourcepacks = par8File; -+ this.launchedVersion = par10Str; -+ this.mcDefaultResourcePack = new DefaultResourcePack(this.fileAssets); - this.addDefaultResourcePack(); -- this.ac = var9; -+ this.proxy = par9Proxy; - this.startTimerHackThread(); -- this.session = var1; -- this.mcLogAgent.logInfo("Setting user: " + var1.getUsername()); -- this.mcLogAgent.logInfo("(Session ID is " + var1.getSessionID() + ")"); -- this.isDemo = var5; -- this.displayWidth = var2; -- this.displayHeight = var3; -- this.tempDisplayWidth = var2; -- this.tempDisplayHeight = var3; -- this.fullscreen = var4; -+ this.session = par1Session; -+ //this.mcLogAgent.logInfo("Setting user: " + par1Session.getUsername()); -+ //this.mcLogAgent.logInfo("(Session ID is " + par1Session.getSessionID() + ")"); -+ this.isDemo = par5; -+ this.displayWidth = par2; -+ this.displayHeight = par3; -+ this.tempDisplayWidth = par2; -+ this.tempDisplayHeight = par3; -+ this.fullscreen = par4; - ImageIO.setUseCache(false); - StatList.nopInit(); -+ -+ // Spout Start -+ Runtime.getRuntime().addShutdownHook(new Thread(new Runnable() { -+ public void run() { -+ shutdownMinecraftApplet(); -+ } -+ })); -+ // Spout End - } - - private void startTimerHackThread() { -@@ -135,83 +273,103 @@ - var1.start(); - } - -- public void crashed(CrashReport var1) { -+ public void crashed(CrashReport par1CrashReport) { - this.hasCrashed = true; -- this.crashReporter = var1; -+ this.crashReporter = par1CrashReport; - } - -- public void displayCrashReport(CrashReport var1) { -- File var2 = new File(getMinecraft().x, "crash-reports"); -+ /** -+ * Wrapper around displayCrashReportInternal -+ */ -+ public void displayCrashReport(CrashReport par1CrashReport) { -+ File var2 = new File(getMinecraft().mcDataDir, "crash-reports"); - File var3 = new File(var2, "crash-" + (new SimpleDateFormat("yyyy-MM-dd_HH.mm.ss")).format(new Date()) + "-client.txt"); -- System.out.println(var1.getCompleteReport()); -- if(var1.getFile() != null) { -- System.out.println("#@!@# Game crashed! Crash report saved to: #@!@# " + var1.getFile()); -+ System.out.println(par1CrashReport.getCompleteReport()); -+ -+ if (par1CrashReport.getFile() != null) { -+ System.out.println("#@!@# Game crashed! Crash report saved to: #@!@# " + par1CrashReport.getFile()); - System.exit(-1); -- } else if(var1.saveToFile(var3, this.getLogAgent())) { -+ } else if (par1CrashReport.saveToFile(var3, this.getLogAgent())) { - System.out.println("#@!@# Game crashed! Crash report saved to: #@!@# " + var3.getAbsolutePath()); - System.exit(-1); - } else { - System.out.println("#@?@# Game crashed! Crash report could not be saved. #@?@#"); - System.exit(-2); - } -- -- } -- -- public void setServer(String var1, int var2) { -- this.ah = var1; -- this.serverPort = var2; -- } -- -- private void startGame() throws LWJGLException { -- this.gameSettings = new GameSettings(this, this.x); -- if(this.gameSettings.overrideHeight > 0 && this.gameSettings.overrideWidth > 0) { -+ } -+ -+ public void setServer(String par1Str, int par2) { -+ this.serverName = par1Str; -+ this.serverPort = par2; -+ } -+ -+ /** -+ * Starts the game: initializes the canvas, the title, the settings, etcetera. -+ */ -+ public void startGame() throws LWJGLException { -+ this.gameSettings = new GameSettings(this, this.mcDataDir); -+ if (this.gameSettings.overrideHeight > 0 && this.gameSettings.overrideWidth > 0) { - this.displayWidth = this.gameSettings.overrideWidth; - this.displayHeight = this.gameSettings.overrideHeight; - } - -- if(this.fullscreen) { -+ if (this.fullscreen) { - Display.setFullscreen(true); - this.displayWidth = Display.getDisplayMode().getWidth(); - this.displayHeight = Display.getDisplayMode().getHeight(); -- if(this.displayWidth <= 0) { -+ -+ if (this.displayWidth <= 0) { - this.displayWidth = 1; - } - -- if(this.displayHeight <= 0) { -+ if (this.displayHeight <= 0) { - this.displayHeight = 1; - } -+ // Spout Start -+ Display.setDisplayMode(new DisplayMode(this.displayWidth, this.displayHeight)); -+ Display.setFullscreen(this.fullscreen); -+ Display.setVSyncEnabled(this.gameSettings.enableVsync); -+ Display.update(); -+ // Spout End - } else { - Display.setDisplayMode(new DisplayMode(this.displayWidth, this.displayHeight)); - } -- -+ - Display.setResizable(true); -- Display.setTitle("Minecraft 1.6.4"); -- this.getLogAgent().logInfo("LWJGL Version: " + Sys.getVersion()); -- if(Util.getOSType() != EnumOS.MACOS) { -+ Display.setTitle("Spoutcraft 1.6.4"); -+ //this.getLogAgent().logInfo("LWJGL Version: " + Sys.getVersion()); -+ -+ if (Util.getOSType() != EnumOS.MACOS) { - try { -- Display.setIcon(new ByteBuffer[]{this.readImage(new File(this.aa, "/icons/icon_16x16.png")), this.readImage(new File(this.aa, "/icons/icon_32x32.png"))}); -+ Display.setIcon(new ByteBuffer[] {this.readImage(new File(FileUtil.getAssetsDir(), "/icon/icon_16x16.png")), this.readImage(new File(FileUtil.getAssetsDir(), "/icon/icon_32x32.png"))}); - } catch (IOException var5) { - var5.printStackTrace(); - } - } - - try { -- Display.create((new PixelFormat()).withDepthBits(24)); -+ Display.create(AAHelper.setupPixelFormat((new PixelFormat()).withDepthBits(24))); - } catch (LWJGLException var4) { - var4.printStackTrace(); - - try { - Thread.sleep(1000L); - } catch (InterruptedException var3) { -+ ; - } - -- if(this.fullscreen) { -+ if (this.fullscreen) { - this.updateDisplayMode(); - } - - Display.create(); - } - -+ // Spout Start -+ System.out.println("\nSpoutcraft Version: " + SpoutClient.getSpoutcraftVersion() + SpoutClient.getSpoutcraftBuild()); -+ System.out.println("\nStarting texture pack initialization..."); -+ // Spout End -+ - OpenGlHelper.initializeTextures(); - this.guiAchievement = new GuiAchievement(this); - this.metadataSerializer_.registerMetadataSectionType(new TextureMetadataSectionSerializer(), TextureMetadataSection.class); -@@ -219,19 +377,27 @@ - this.metadataSerializer_.registerMetadataSectionType(new AnimationMetadataSectionSerializer(), AnimationMetadataSection.class); - this.metadataSerializer_.registerMetadataSectionType(new PackMetadataSectionSerializer(), PackMetadataSection.class); - this.metadataSerializer_.registerMetadataSectionType(new LanguageMetadataSectionSerializer(), LanguageMetadataSection.class); -- this.saveLoader = new AnvilSaveConverter(new File(this.x, "saves")); -- this.mcResourcePackRepository = new ResourcePackRepository(this.L, this.mcDefaultResourcePack, this.metadataSerializer_, this.gameSettings); -+ this.saveLoader = new AnvilSaveConverter(new File(this.mcDataDir, "saves")); -+ this.mcResourcePackRepository = new ResourcePackRepository(this.fileResourcepacks, this.mcDefaultResourcePack, this.metadataSerializer_, this.gameSettings); -+ TexturePackChangeHandler.earlyInitialize("com.prupe.mcpatcher.TileLoader", "init"); -+ TexturePackChangeHandler.earlyInitialize("com.prupe.mcpatcher.ctm.CTMUtils", "reset"); -+ TexturePackChangeHandler.earlyInitialize("com.prupe.mcpatcher.cit.CITUtils", "init"); -+ TexturePackChangeHandler.earlyInitialize("com.prupe.mcpatcher.hd.FontUtils", "init"); -+ TexturePackChangeHandler.earlyInitialize("com.prupe.mcpatcher.mob.MobRandomizer", "init"); -+ TexturePackChangeHandler.earlyInitialize("com.prupe.mcpatcher.cc.Colorizer", "init"); -+ TexturePackChangeHandler.beforeChange1(true); - this.mcResourceManager = new SimpleReloadableResourceManager(this.metadataSerializer_); -- this.mcLanguageManager = new LanguageManager(this.metadataSerializer_, this.gameSettings.an); -+ this.mcLanguageManager = new LanguageManager(this.metadataSerializer_, this.gameSettings.language); - this.mcResourceManager.registerReloadListener(this.mcLanguageManager); - this.refreshResources(); - this.renderEngine = new TextureManager(this.mcResourceManager); - this.mcResourceManager.registerReloadListener(this.renderEngine); -- this.sndManager = new SoundManager(this.mcResourceManager, this.gameSettings, this.aa); -- this.mcResourceManager.registerReloadListener(this.sndManager); -+ this.sndManager = new SoundManager(this.mcResourceManager, this.gameSettings, this.fileAssets); -+ this.mcResourceManager.registerReloadListener(this.sndManager); - this.loadScreen(); - this.fontRenderer = new FontRenderer(this.gameSettings, new ResourceLocation("textures/font/ascii.png"), this.renderEngine, false); -- if(this.gameSettings.an != null) { -+ -+ if (this.gameSettings.language != null) { - this.fontRenderer.setUnicodeFlag(this.mcLanguageManager.isCurrentLocaleUnicode()); - this.fontRenderer.setBidiFlag(this.mcLanguageManager.isCurrentLanguageBidirectional()); - } -@@ -243,9 +409,14 @@ - this.mcResourceManager.registerReloadListener(new FoliageColorReloadListener()); - RenderManager.instance.itemRenderer = new ItemRenderer(this); - this.entityRenderer = new EntityRenderer(this); -- this.statFileWriter = new StatFileWriter(this.session, this.x); -+ this.statFileWriter = new StatFileWriter(this.session, this.mcDataDir); - AchievementList.openInventory.setStatStringFormatter(new StatStringFormatKeyInv(this)); - this.mouseHelper = new MouseHelper(); -+ -+ // Spout Start -+ Keyboard.create(); -+ // Spout End -+ - this.checkGLError("Pre startup"); - GL11.glEnable(GL11.GL_TEXTURE_2D); - GL11.glShadeModel(GL11.GL_SMOOTH); -@@ -258,56 +429,59 @@ - GL11.glMatrixMode(GL11.GL_PROJECTION); - GL11.glLoadIdentity(); - GL11.glMatrixMode(GL11.GL_MODELVIEW); -- this.checkGLError("Startup"); - this.renderGlobal = new RenderGlobal(this); - this.renderEngine.loadTextureMap(TextureMap.locationBlocksTexture, new TextureMap(0, "textures/blocks")); - this.renderEngine.loadTextureMap(TextureMap.locationItemsTexture, new TextureMap(1, "textures/items")); - GL11.glViewport(0, 0, this.displayWidth, this.displayHeight); -+ TexturePackChangeHandler.afterChange1(true); - this.effectRenderer = new EffectRenderer(this.theWorld, this.renderEngine); - this.checkGLError("Post startup"); - this.ingameGUI = new GuiIngame(this); -- if(this.ah != null) { -- this.displayGuiScreen(new GuiConnecting(new GuiMainMenu(), this, this.ah, this.serverPort)); -+ -+ if (this.serverName != null) { -+ this.displayGuiScreen(new GuiConnecting(new GuiMainMenu(), this, this.serverName, this.serverPort)); - } else { -- this.displayGuiScreen(new GuiMainMenu()); -+ // Spout Start -+ this.displayGuiScreen(new org.spoutcraft.client.gui.mainmenu.MainMenu()); -+ // Spout End - } - - this.loadingScreen = new LoadingScreenRenderer(this); -- if(this.gameSettings.fullScreen && !this.fullscreen) { -+ -+ if (this.gameSettings.fullScreen && !this.fullscreen) { - this.toggleFullscreen(); - } -- - } - - public void refreshResources() { -- ArrayList var1 = Lists.newArrayList((Iterable)this.aq); -+ ArrayList var1 = Lists.newArrayList(this.defaultResourcePacks); - Iterator var2 = this.mcResourcePackRepository.getRepositoryEntries().iterator(); - -- while(var2.hasNext()) { -+ while (var2.hasNext()) { - ResourcePackRepositoryEntry var3 = (ResourcePackRepositoryEntry)var2.next(); - var1.add(var3.getResourcePack()); - } - - this.mcLanguageManager.parseLanguageMetadata(var1); - this.mcResourceManager.reloadResources(var1); -- if(this.renderGlobal != null) { -+ -+ if (this.renderGlobal != null) { - this.renderGlobal.loadRenderers(); - } -- - } - - private void addDefaultResourcePack() { -- this.aq.add(this.mcDefaultResourcePack); -+ this.defaultResourcePacks.add(this.mcDefaultResourcePack); - } - -- private ByteBuffer readImage(File var1) throws IOException { -- BufferedImage var2 = ImageIO.read(var1); -+ private ByteBuffer readImage(File par1File) throws IOException { -+ BufferedImage var2 = ImageIO.read(par1File); - int[] var3 = var2.getRGB(0, 0, var2.getWidth(), var2.getHeight(), (int[])null, 0, var2.getWidth()); - ByteBuffer var4 = ByteBuffer.allocate(4 * var3.length); - int[] var5 = var3; - int var6 = var3.length; - -- for(int var7 = 0; var7 < var6; ++var7) { -+ for (int var7 = 0; var7 < var6; ++var7) { - int var8 = var5[var7]; - var4.putInt(var8 << 8 | var8 >> 24 & 255); - } -@@ -320,39 +494,32 @@ - HashSet var1 = new HashSet(); - Collections.addAll(var1, Display.getAvailableDisplayModes()); - DisplayMode var2 = Display.getDesktopDisplayMode(); -- if(!var1.contains(var2) && Util.getOSType() == EnumOS.MACOS) { -- Iterator var3 = J.iterator(); -- -- label52: -- while(true) { -- while(true) { -- DisplayMode var4; -- boolean var5; -- Iterator var6; -- DisplayMode var7; -- do { -- if(!var3.hasNext()) { -- break label52; -- } -- -- var4 = (DisplayMode)var3.next(); -- var5 = true; -- var6 = var1.iterator(); -- -- while(var6.hasNext()) { -- var7 = (DisplayMode)var6.next(); -- if(var7.getBitsPerPixel() == 32 && var7.getWidth() == var4.getWidth() && var7.getHeight() == var4.getHeight()) { -- var5 = false; -- break; -- } -- } -- } while(var5); -- -+ -+ if (!var1.contains(var2) && Util.getOSType() == EnumOS.MACOS) { -+ Iterator var3 = macDisplayModes.iterator(); -+ -+ while (var3.hasNext()) { -+ DisplayMode var4 = (DisplayMode)var3.next(); -+ boolean var5 = true; -+ Iterator var6 = var1.iterator(); -+ DisplayMode var7; -+ -+ while (var6.hasNext()) { -+ var7 = (DisplayMode)var6.next(); -+ -+ if (var7.getBitsPerPixel() == 32 && var7.getWidth() == var4.getWidth() && var7.getHeight() == var4.getHeight()) { -+ var5 = false; -+ break; -+ } -+ } -+ -+ if (!var5) { - var6 = var1.iterator(); - -- while(var6.hasNext()) { -+ while (var6.hasNext()) { - var7 = (DisplayMode)var6.next(); -- if(var7.getBitsPerPixel() == 32 && var7.getWidth() == var4.getWidth() / 2 && var7.getHeight() == var4.getHeight() / 2) { -+ -+ if (var7.getBitsPerPixel() == 32 && var7.getWidth() == var4.getWidth() / 2 && var7.getHeight() == var4.getHeight() / 2) { - var2 = var7; - break; - } -@@ -366,9 +533,12 @@ - this.displayHeight = var2.getHeight(); - } - -+ /** -+ * Displays a new screen. -+ */ - private void loadScreen() throws LWJGLException { - ScaledResolution var1 = new ScaledResolution(this.gameSettings, this.displayWidth, this.displayHeight); -- GL11.glClear(GL11.GL_DEPTH_BUFFER_BIT | GL11.GL_COLOR_BUFFER_BIT); -+ GL11.glClear(GL11.GL_COLOR_BUFFER_BIT | GL11.GL_DEPTH_BUFFER_BIT); - GL11.glMatrixMode(GL11.GL_PROJECTION); - GL11.glLoadIdentity(); - GL11.glOrtho(0.0D, var1.getScaledWidth_double(), var1.getScaledHeight_double(), 0.0D, 1000.0D, 3000.0D); -@@ -380,8 +550,8 @@ - GL11.glDisable(GL11.GL_LIGHTING); - GL11.glEnable(GL11.GL_TEXTURE_2D); - GL11.glDisable(GL11.GL_FOG); -- this.renderEngine.bindTexture(locationMojangPng); - Tessellator var2 = Tessellator.instance; -+ this.renderEngine.bindTexture(locationMojangPng); - var2.startDrawingQuads(); - var2.setColorOpaque_I(16777215); - var2.addVertexWithUV(0.0D, (double)this.displayHeight, 0.0D, 0.0D, 0.0D); -@@ -401,86 +571,174 @@ - Display.update(); - } - -- public void scaledTessellator(int var1, int var2, int var3, int var4, int var5, int var6) { -+ /** -+ * Loads Tessellator with a scaled resolution -+ */ -+ public void scaledTessellator(int par1, int par2, int par3, int par4, int par5, int par6) { - float var7 = 0.00390625F; - float var8 = 0.00390625F; - Tessellator var9 = Tessellator.instance; - var9.startDrawingQuads(); -- var9.addVertexWithUV((double)(var1 + 0), (double)(var2 + var6), 0.0D, (double)((float)(var3 + 0) * var7), (double)((float)(var4 + var6) * var8)); -- var9.addVertexWithUV((double)(var1 + var5), (double)(var2 + var6), 0.0D, (double)((float)(var3 + var5) * var7), (double)((float)(var4 + var6) * var8)); -- var9.addVertexWithUV((double)(var1 + var5), (double)(var2 + 0), 0.0D, (double)((float)(var3 + var5) * var7), (double)((float)(var4 + 0) * var8)); -- var9.addVertexWithUV((double)(var1 + 0), (double)(var2 + 0), 0.0D, (double)((float)(var3 + 0) * var7), (double)((float)(var4 + 0) * var8)); -+ var9.addVertexWithUV((double)(par1 + 0), (double)(par2 + par6), 0.0D, (double)((float)(par3 + 0) * var7), (double)((float)(par4 + par6) * var8)); -+ var9.addVertexWithUV((double)(par1 + par5), (double)(par2 + par6), 0.0D, (double)((float)(par3 + par5) * var7), (double)((float)(par4 + par6) * var8)); -+ var9.addVertexWithUV((double)(par1 + par5), (double)(par2 + 0), 0.0D, (double)((float)(par3 + par5) * var7), (double)((float)(par4 + 0) * var8)); -+ var9.addVertexWithUV((double)(par1 + 0), (double)(par2 + 0), 0.0D, (double)((float)(par3 + 0) * var7), (double)((float)(par4 + 0) * var8)); - var9.draw(); - } - -+ /** -+ * Returns the save loader that is currently being used -+ */ - public ISaveFormat getSaveLoader() { - return this.saveLoader; - } - -- public void displayGuiScreen(GuiScreen var1) { -- if(this.currentScreen != null) { -+ // Spout Start -+ private GuiScreen previousScreen = null; -+ // Spout End -+ -+ /** -+ * Sets the argument GuiScreen as the main (topmost visible) screen. -+ */ -+ // Spout Start -+ public void displayGuiScreen(GuiScreen screen) { -+ displayGuiScreen(screen, true); -+ } -+ -+ public void displayGuiScreen(GuiScreen screen, boolean notify) { -+ // Part of original function -+ if (screen == null && this.theWorld == null) { -+ screen = new org.spoutcraft.client.gui.mainmenu.MainMenu(); -+ } else if (screen == null && this.thePlayer.getHealth() <= 0.0F) { -+ screen = new GuiGameOver(); -+ } -+ -+ ScreenType display = ScreenUtil.getType(screen); -+ -+ if (notify && thePlayer != null && theWorld != null) { -+ // Screen closed -+ SpoutPacket packet = null; -+ Screen widget = null; -+ if (this.currentScreen != null && screen == null) { -+ packet = new PacketScreenAction(ScreenAction.Close, ScreenUtil.getType(this.currentScreen)); -+ widget = currentScreen.getScreen(); -+ } -+ // Screen opened -+ if (screen != null && this.currentScreen == null) { -+ packet = new PacketScreenAction(ScreenAction.Open, display); -+ widget = screen.getScreen(); -+ } -+ // Screen swapped -+ if (screen != null && this.currentScreen != null) { // Hopefully just a submenu -+ packet = new PacketScreenAction(ScreenAction.Open, display); -+ widget = screen.getScreen(); -+ } -+ boolean cancel = false; -+ if (!cancel && packet != null) { -+ SpoutClient.getInstance().getPacketManager().sendSpoutPacket(packet); -+ if (widget instanceof PopupScreen) { -+ ((PopupScreen) widget).close(); -+ } -+ } -+ if (cancel) { -+ return; -+ } -+ } -+ // Spout End -+ if (this.currentScreen != null) { - this.currentScreen.onGuiClosed(); - } - - this.statFileWriter.syncStats(); -- if(var1 == null && this.theWorld == null) { -- var1 = new GuiMainMenu(); -- } else if(var1 == null && this.thePlayer.getHealth() <= 0.0F) { -- var1 = new GuiGameOver(); -- } - -- if(var1 instanceof GuiMainMenu) { -- this.gameSettings.showDebugInfo = false; -+ // Spout Start -+ if (theWorld == null && thePlayer == null && this.ingameGUI != null) { -+ // Spout End - this.ingameGUI.getChatGUI().clearChatMessages(); - } - -- this.currentScreen = (GuiScreen)var1; -- if(var1 != null) { -+ // Spout Start -+ if (previousScreen != null || screen != null) { -+ previousScreen = this.currentScreen; -+ } -+ -+ this.currentScreen = screen; -+ -+ if (screen != null) { -+ // Spout End - this.setIngameNotInFocus(); - ScaledResolution var2 = new ScaledResolution(this.gameSettings, this.displayWidth, this.displayHeight); - int var3 = var2.getScaledWidth(); - int var4 = var2.getScaledHeight(); -- ((GuiScreen)var1).setWorldAndResolution(this, var3, var4); -+ // Spout Start -+ screen.setWorldAndResolution(this, var3, var4); -+ // Spout End - this.skipRenderWorld = false; - } else { - this.setIngameFocus(); - } -- -- } -- -- private void checkGLError(String var1) { -+ } -+ -+ // Spout Start -+ public void displayPreviousScreen() { -+ displayGuiScreen(previousScreen, false); -+ previousScreen = null; -+ } -+ -+ public void clearPreviousScreen() { -+ previousScreen = null; -+ } -+ // Spout End -+ -+ /** -+ * Checks for an OpenGL error. If there is one, prints the error ID and error string. -+ */ -+ private void checkGLError(String par1Str) { - int var2 = GL11.glGetError(); -- if(var2 != 0) { -- String var3 = GLU.gluErrorString(var2); -- this.getLogAgent().logSevere("########## GL ERROR ##########"); -- this.getLogAgent().logSevere("@ " + var1); -- this.getLogAgent().logSevere(var2 + ": " + var3); -+ -+ if (var2 != 0) { -+ // Spout Start -+ if (!org.spoutcraft.client.gui.mainmenu.MainMenu.hasLoaded) { -+ return; -+ } - } -- - } - -+ /** -+ * Shuts down the minecraft applet by stopping the resource downloads, and clearing up GL stuff; called when the -+ * application (or web page) is exited. -+ */ - public void shutdownMinecraftApplet() { -+ // Spout Start -+ if (shutdown) { -+ return; -+ } -+ shutdown = true; -+ // Spout End - try { - this.statFileWriter.syncStats(); -- this.getLogAgent().logInfo("Stopping!"); -+ -+ this.getLogAgent().logInfo("Stopping!"); - - try { - this.loadWorld((WorldClient)null); - } catch (Throwable var7) { -+ ; - } - - try { - GLAllocation.deleteTexturesAndDisplayLists(); - } catch (Throwable var6) { -+ ; - } - -- this.sndManager.cleanup(); -+ this.sndManager.cleanup(); - } finally { - Display.destroy(); -- if(!this.hasCrashed) { -+ -+ if (!this.hasCrashed) { - System.exit(0); - } -- - } - - System.gc(); -@@ -488,8 +746,8 @@ - - public void run() { - this.running = true; -- - CrashReport var2; -+ - try { - this.startGame(); - } catch (Throwable var11) { -@@ -500,14 +758,14 @@ - } - - try { -- try { -- while(this.running) { -- if(this.hasCrashed && this.crashReporter != null) { -+ while (this.running) { -+ if (this.running) { -+ if (this.hasCrashed && this.crashReporter != null) { - this.displayCrashReport(this.crashReporter); - return; - } - -- if(this.refreshTexturePacksScheduled) { -+ if (this.refreshTexturePacksScheduled) { - this.refreshTexturePacksScheduled = false; - this.refreshResources(); - } -@@ -519,39 +777,82 @@ - this.displayGuiScreen(new GuiMemoryErrorScreen()); - System.gc(); - } -+ // Spout Start -+ catch (Throwable t) { -+ // Try to handle errors gracefuly -+ try { -+ t.printStackTrace(); -+ this.theWorld = null; -+ this.loadWorld((WorldClient) null); -+ this.displayGuiScreen(new org.spoutcraft.client.gui.error.GuiUnexpectedError(t)); -+ } catch (Throwable failed) { -+ failed.printStackTrace(); -+ throw new RuntimeException(t); -+ } -+ } -+ // Spout End -+ continue; - } -- -- return; -- } catch (MinecraftError var12) { -- } catch (ReportedException var13) { -- this.addGraphicsAndWorldToCrashReport(var13.getCrashReport()); -- this.freeMemory(); -- var13.printStackTrace(); -- this.displayCrashReport(var13.getCrashReport()); -- } catch (Throwable var14) { -- var2 = this.addGraphicsAndWorldToCrashReport(new CrashReport("Unexpected error", var14)); -- this.freeMemory(); -- var14.printStackTrace(); -- this.displayCrashReport(var2); - } -- -+ } catch (MinecraftError var12) { -+ } catch (ReportedException var13) { -+ this.addGraphicsAndWorldToCrashReport(var13.getCrashReport()); -+ this.freeMemory(); -+ var13.printStackTrace(); -+ this.displayCrashReport(var13.getCrashReport()); -+ } catch (Throwable var14) { -+ var2 = this.addGraphicsAndWorldToCrashReport(new CrashReport("Unexpected error", var14)); -+ this.freeMemory(); -+ var14.printStackTrace(); -+ this.displayCrashReport(var2); - } finally { -+ // Spout Start -+ if (theWorld != null) { -+ HeightMap map = HeightMap.getHeightMap(MinimapUtils.getWorldName()); -+ if (map.isDirty()) { -+ map.saveThreaded(); -+ } -+ } -+ HeightMap.joinSaveThread(); -+ // Spout End - this.shutdownMinecraftApplet(); - } - } - -+ /** -+ * Called repeatedly from run() -+ */ - private void runGameLoop() { -+ TexturePackChangeHandler.checkForTexturePackChange(); -+ -+ // Spout Start -+ this.checkGLError("First render check"); -+ // Spout End -+ - AxisAlignedBB.getAABBPool().cleanPool(); -- if(this.theWorld != null) { -+ -+ // Spout Start -+ mainThread = Thread.currentThread(); -+ if (sndManager != null) { -+ sndManager.tick(); -+ } -+ // Spout End -+ -+ if (this.theWorld != null) { - this.theWorld.getWorldVec3Pool().clear(); - } - - this.mcProfiler.startSection("root"); -- if(Display.isCloseRequested()) { -+ -+ if (Display.isCloseRequested()) { - this.shutdown(); - } - -- if(this.isGamePaused && this.theWorld != null) { -+ // Spout Start -+ this.checkGLError("Pre*3 render"); -+ // Spout End -+ -+ if (this.isGamePaused && this.theWorld != null) { - float var1 = this.timer.renderPartialTicks; - this.timer.updateTimer(); - this.timer.renderPartialTicks = var1; -@@ -559,10 +860,14 @@ - this.timer.updateTimer(); - } - -+ // Spout Start -+ this.checkGLError("Pre pre render"); -+ // Spout End -+ - long var6 = System.nanoTime(); - this.mcProfiler.startSection("tick"); - -- for(int var3 = 0; var3 < this.timer.elapsedTicks; ++var3) { -+ for (int var3 = 0; var3 < this.timer.elapsedTicks; ++var3) { - this.runTick(); - } - -@@ -572,24 +877,35 @@ - RenderBlocks.fancyGrass = this.gameSettings.fancyGraphics; - this.mcProfiler.endStartSection("sound"); - this.sndManager.setListener(this.thePlayer, this.timer.renderPartialTicks); -- if(!this.isGamePaused) { -+ -+ if (!this.isGamePaused) { - this.sndManager.func_92071_g(); - } - - this.mcProfiler.endSection(); -+ // Spout Start -+ if (this.thePlayer != null) { -+ this.mcProfiler.startSection("spoutclient"); -+ SpoutClient.getInstance().onTick(); // Spout - tick -+ this.mcProfiler.endSection(); -+ // Spout End -+ } -+ - this.mcProfiler.startSection("render"); - this.mcProfiler.startSection("display"); - GL11.glEnable(GL11.GL_TEXTURE_2D); -- if(!Keyboard.isKeyDown(Keyboard.KEY_F7)) { -+ -+ if (!Keyboard.isKeyDown(65)) { - Display.update(); - } - -- if(this.thePlayer != null && this.thePlayer.isEntityInsideOpaqueBlock()) { -+ if (this.thePlayer != null && this.thePlayer.isEntityInsideOpaqueBlock()) { - this.gameSettings.thirdPersonView = 0; - } - - this.mcProfiler.endSection(); -- if(!this.skipRenderWorld) { -+ -+ if (!this.skipRenderWorld) { - this.mcProfiler.endStartSection("gameRenderer"); - this.entityRenderer.updateCameraAndRender(this.timer.renderPartialTicks); - this.mcProfiler.endSection(); -@@ -597,12 +913,13 @@ - - GL11.glFlush(); - this.mcProfiler.endSection(); -- if(!Display.isActive() && this.fullscreen) { -+ -+ if (!Display.isActive() && this.fullscreen) { - this.toggleFullscreen(); - } - -- if(this.gameSettings.showDebugInfo && this.gameSettings.showDebugProfilerChart) { -- if(!this.mcProfiler.profilingEnabled) { -+ if (this.gameSettings.showDebugInfo && this.gameSettings.showDebugProfilerChart) { -+ if (!this.mcProfiler.profilingEnabled) { - this.mcProfiler.clearProfiling(); - } - -@@ -616,19 +933,22 @@ - this.guiAchievement.updateAchievementWindow(); - this.mcProfiler.startSection("root"); - Thread.yield(); -- if(Keyboard.isKeyDown(Keyboard.KEY_F7)) { -+ -+ if (Keyboard.isKeyDown(65)) { - Display.update(); - } - - this.screenshotListener(); -- if(!this.fullscreen && Display.wasResized()) { -+ -+ if (!this.fullscreen && Display.wasResized()) { - this.displayWidth = Display.getWidth(); - this.displayHeight = Display.getHeight(); -- if(this.displayWidth <= 0) { -+ -+ if (this.displayWidth <= 0) { - this.displayWidth = 1; - } - -- if(this.displayHeight <= 0) { -+ if (this.displayHeight <= 0) { - this.displayHeight = 1; - } - -@@ -639,27 +959,44 @@ - ++this.fpsCounter; - boolean var5 = this.isGamePaused; - this.isGamePaused = this.isSingleplayer() && this.currentScreen != null && this.currentScreen.doesGuiPauseGame() && !this.theIntegratedServer.getPublic(); -- if(this.isIntegratedServerRunning() && this.thePlayer != null && this.thePlayer.sendQueue != null && this.isGamePaused != var5) { -+ -+ if (this.isIntegratedServerRunning() && this.thePlayer != null && this.thePlayer.sendQueue != null && this.isGamePaused != var5) { - ((MemoryConnection)this.thePlayer.sendQueue.getNetManager()).setGamePaused(this.isGamePaused); - } - -- while(getSystemTime() >= this.debugUpdateTime + 1000L) { -+ // Spout Start -+ this.checkGLError("Late render"); -+ // Spout End -+ -+ while (getSystemTime() >= this.debugUpdateTime + 1000L) { - debugFPS = this.fpsCounter; -- this.E = debugFPS + " fps, " + WorldRenderer.chunksUpdated + " chunk updates"; -+ this.debug = debugFPS + " fps, " + WorldRenderer.chunksUpdated + " chunk updates"; - WorldRenderer.chunksUpdated = 0; - this.debugUpdateTime += 1000L; -+ -+ // Spout Start -+ framesPerSecond = fpsCounter; -+ checkGLError("Late render before fps"); -+ SpoutWorth.getInstance().updateFPS(framesPerSecond); -+ checkGLError("Late render after fps"); -+ // Spout End -+ - this.fpsCounter = 0; - this.usageSnooper.addMemoryStatsToSnooper(); -- if(!this.usageSnooper.isSnooperRunning()) { -+ -+ if (!this.usageSnooper.isSnooperRunning()) { - this.usageSnooper.startSnooper(); - } - } - - this.mcProfiler.endSection(); -- if(this.getLimitFramerate() > 0) { -+ -+ if (this.getLimitFramerate() > 0) { - Display.sync(EntityRenderer.performanceToFps(this.getLimitFramerate())); - } -- -+ // Spout Start -+ this.checkGLError("After sync"); -+ // Spout End - } - - private int getLimitFramerate() { -@@ -667,10 +1004,11 @@ - } - - public void freeMemory() { -- try { -- memoryReserve = new byte[0]; -+ try { -+ memoryReserve = new byte[0]; - this.renderGlobal.deleteAllDisplayLists(); - } catch (Throwable var4) { -+ ; - } - - try { -@@ -678,57 +1016,74 @@ - AxisAlignedBB.getAABBPool().clearPool(); - this.theWorld.getWorldVec3Pool().clearAndFreeCache(); - } catch (Throwable var3) { -+ ; - } - - try { - System.gc(); - this.loadWorld((WorldClient)null); - } catch (Throwable var2) { -+ ; - } - - System.gc(); - } - -+ /** -+ * checks if keys are down -+ */ - private void screenshotListener() { -- if(Keyboard.isKeyDown(Keyboard.KEY_F2)) { -- if(!this.isTakingScreenshot) { -+ if (Keyboard.isKeyDown(60)) { -+ if (!this.isTakingScreenshot) { - this.isTakingScreenshot = true; -- this.ingameGUI.getChatGUI().printChatMessage(ScreenShotHelper.saveScreenshot(this.x, this.displayWidth, this.displayHeight)); -+ if (theWorld != null) { -+ this.ingameGUI.getChatGUI().printChatMessage(ScreenShotHelper.saveScreenshot(this.mcDataDir, this.displayWidth, this.displayHeight)); -+ } - } - } else { - this.isTakingScreenshot = false; - } -- - } - -- private void updateDebugProfilerName(int var1) { -- List var2 = this.mcProfiler.getProfilingData(this.au); -- if(var2 != null && !var2.isEmpty()) { -+ /** -+ * Update debugProfilerName in response to number keys in debug screen -+ */ -+ private void updateDebugProfilerName(int par1) { -+ List var2 = this.mcProfiler.getProfilingData(this.debugProfilerName); -+ -+ if (var2 != null && !var2.isEmpty()) { - ProfilerResult var3 = (ProfilerResult)var2.remove(0); -- if(var1 == 0) { -- if(var3.c.length() > 0) { -- int var4 = this.au.lastIndexOf("."); -- if(var4 >= 0) { -- this.au = this.au.substring(0, var4); -+ -+ if (par1 == 0) { -+ if (var3.field_76331_c.length() > 0) { -+ int var4 = this.debugProfilerName.lastIndexOf("."); -+ -+ if (var4 >= 0) { -+ this.debugProfilerName = this.debugProfilerName.substring(0, var4); - } - } - } else { -- --var1; -- if(var1 < var2.size() && !((ProfilerResult)var2.get(var1)).c.equals("unspecified")) { -- if(this.au.length() > 0) { -- this.au = this.au + "."; -+ --par1; -+ -+ if (par1 < var2.size() && !((ProfilerResult)var2.get(par1)).field_76331_c.equals("unspecified")) { -+ if (this.debugProfilerName.length() > 0) { -+ this.debugProfilerName = this.debugProfilerName + "."; - } - -- this.au = this.au + ((ProfilerResult)var2.get(var1)).c; -+ this.debugProfilerName = this.debugProfilerName + ((ProfilerResult)var2.get(par1)).field_76331_c; - } - } -- - } - } - -- private void displayDebugInfo(long var1) { -- if(this.mcProfiler.profilingEnabled) { -- List var3 = this.mcProfiler.getProfilingData(this.au); -+ private void displayDebugInfo(long par1) { -+ // Spout Start - Only show if no other screens are up -+ if (currentScreen != null) { -+ return; -+ } -+ // Spout End -+ if (this.mcProfiler.profilingEnabled) { -+ List var3 = this.mcProfiler.getProfilingData(this.debugProfilerName); - ProfilerResult var4 = (ProfilerResult)var3.remove(0); - GL11.glClear(GL11.GL_DEPTH_BUFFER_BIT); - GL11.glMatrixMode(GL11.GL_PROJECTION); -@@ -754,21 +1109,21 @@ - var5.draw(); - GL11.glDisable(GL11.GL_BLEND); - double var9 = 0.0D; -- - int var13; -- for(int var11 = 0; var11 < var3.size(); ++var11) { -+ -+ for (int var11 = 0; var11 < var3.size(); ++var11) { - ProfilerResult var12 = (ProfilerResult)var3.get(var11); - var13 = MathHelper.floor_double(var12.field_76332_a / 4.0D) + 1; - var5.startDrawing(6); - var5.setColorOpaque_I(var12.func_76329_a()); - var5.addVertex((double)var7, (double)var8, 0.0D); -- - int var14; - float var15; -- float var16; - float var17; -- for(var14 = var13; var14 >= 0; --var14) { -- var15 = (float)((var9 + var12.field_76332_a * (double)var14 / (double)var13) * (double)((float)Math.PI) * 2.0D / 100.0D); -+ float var16; -+ -+ for (var14 = var13; var14 >= 0; --var14) { -+ var15 = (float)((var9 + var12.field_76332_a * (double)var14 / (double)var13) * Math.PI * 2.0D / 100.0D); - var16 = MathHelper.sin(var15) * (float)var6; - var17 = MathHelper.cos(var15) * (float)var6 * 0.5F; - var5.addVertex((double)((float)var7 + var16), (double)((float)var8 - var17), 0.0D); -@@ -778,8 +1133,8 @@ - var5.startDrawing(5); - var5.setColorOpaque_I((var12.func_76329_a() & 16711422) >> 1); - -- for(var14 = var13; var14 >= 0; --var14) { -- var15 = (float)((var9 + var12.field_76332_a * (double)var14 / (double)var13) * (double)((float)Math.PI) * 2.0D / 100.0D); -+ for (var14 = var13; var14 >= 0; --var14) { -+ var15 = (float)((var9 + var12.field_76332_a * (double)var14 / (double)var13) * Math.PI * 2.0D / 100.0D); - var16 = MathHelper.sin(var15) * (float)var6; - var17 = MathHelper.cos(var15) * (float)var6 * 0.5F; - var5.addVertex((double)((float)var7 + var16), (double)((float)var8 - var17), 0.0D); -@@ -790,190 +1145,221 @@ - var9 += var12.field_76332_a; - } - -- DecimalFormat var18 = new DecimalFormat("##0.00"); -+ DecimalFormat var19 = new DecimalFormat("##0.00"); - GL11.glEnable(GL11.GL_TEXTURE_2D); -- String var19 = ""; -- if(!var4.c.equals("unspecified")) { -- var19 = var19 + "[0] "; -+ String var18 = ""; -+ -+ if (!var4.field_76331_c.equals("unspecified")) { -+ var18 = var18 + "[0] "; - } - -- if(var4.c.length() == 0) { -- var19 = var19 + "ROOT "; -+ if (var4.field_76331_c.length() == 0) { -+ var18 = var18 + "ROOT "; - } else { -- var19 = var19 + var4.c + " "; -+ var18 = var18 + var4.field_76331_c + " "; - } - - var13 = 16777215; -- this.fontRenderer.drawStringWithShadow(var19, var7 - var6, var8 - var6 / 2 - 16, var13); -- FontRenderer var10000 = this.fontRenderer; -- var19 = var18.format(var4.field_76330_b) + "%"; -- var10000.drawStringWithShadow(var19, var7 + var6 - this.fontRenderer.getStringWidth(var19), var8 - var6 / 2 - 16, var13); -+ this.fontRenderer.drawStringWithShadow(var18, var7 - var6, var8 - var6 / 2 - 16, var13); -+ this.fontRenderer.drawStringWithShadow(var18 = var19.format(var4.field_76330_b) + "%", var7 + var6 - this.fontRenderer.getStringWidth(var18), var8 - var6 / 2 - 16, var13); - -- for(int var21 = 0; var21 < var3.size(); ++var21) { -+ for (int var21 = 0; var21 < var3.size(); ++var21) { - ProfilerResult var20 = (ProfilerResult)var3.get(var21); - String var22 = ""; -- if(var20.c.equals("unspecified")) { -+ -+ if (var20.field_76331_c.equals("unspecified")) { - var22 = var22 + "[?] "; - } else { - var22 = var22 + "[" + (var21 + 1) + "] "; - } - -- var22 = var22 + var20.c; -+ var22 = var22 + var20.field_76331_c; - this.fontRenderer.drawStringWithShadow(var22, var7 - var6, var8 + var6 / 2 + var21 * 8 + 20, var20.func_76329_a()); -- var10000 = this.fontRenderer; -- var22 = var18.format(var20.field_76332_a) + "%"; -- var10000.drawStringWithShadow(var22, var7 + var6 - 50 - this.fontRenderer.getStringWidth(var22), var8 + var6 / 2 + var21 * 8 + 20, var20.func_76329_a()); -- var10000 = this.fontRenderer; -- var22 = var18.format(var20.field_76330_b) + "%"; -- var10000.drawStringWithShadow(var22, var7 + var6 - this.fontRenderer.getStringWidth(var22), var8 + var6 / 2 + var21 * 8 + 20, var20.func_76329_a()); -+ this.fontRenderer.drawStringWithShadow(var22 = var19.format(var20.field_76332_a) + "%", var7 + var6 - 50 - this.fontRenderer.getStringWidth(var22), var8 + var6 / 2 + var21 * 8 + 20, var20.func_76329_a()); -+ this.fontRenderer.drawStringWithShadow(var22 = var19.format(var20.field_76330_b) + "%", var7 + var6 - this.fontRenderer.getStringWidth(var22), var8 + var6 / 2 + var21 * 8 + 20, var20.func_76329_a()); - } -- - } - } - -+ /** -+ * Called when the window is closing. Sets 'running' to false which allows the game loop to exit cleanly. -+ */ - public void shutdown() { - this.running = false; - } - -+ /** -+ * Will set the focus to ingame if the Minecraft window is the active with focus. Also clears any GUI screen currently -+ * displayed -+ */ - public void setIngameFocus() { -- if(Display.isActive()) { -- if(!this.inGameHasFocus) { -+ // Spout Start -+ setIngameFocus(true); -+ } -+ -+ public void setIngameFocus(boolean close) { -+ // Spout End -+ if (Display.isActive()) { -+ if (!this.inGameHasFocus) { - this.inGameHasFocus = true; - this.mouseHelper.grabMouseCursor(); -- this.displayGuiScreen((GuiScreen)null); -+ // Spout Start -+ if (close) { -+ this.displayGuiScreen((GuiScreen)null); -+ } -+ // Spout End - this.leftClickCounter = 10000; - } - } - } - -+ /** -+ * Resets the player keystate, disables the ingame focus, and ungrabs the mouse cursor. -+ */ - public void setIngameNotInFocus() { -- if(this.inGameHasFocus) { -+ if (this.inGameHasFocus) { - KeyBinding.unPressAllKeys(); - this.inGameHasFocus = false; - this.mouseHelper.ungrabMouseCursor(); - } - } - -+ /** -+ * Displays the ingame menu -+ */ - public void displayInGameMenu() { -- if(this.currentScreen == null) { -+ if (this.currentScreen == null) { - this.displayGuiScreen(new GuiIngameMenu()); -- if(this.isSingleplayer() && !this.theIntegratedServer.getPublic()) { -+ -+ if (this.isSingleplayer() && !this.theIntegratedServer.getPublic()) { - this.sndManager.pauseAllSounds(); - } -- - } - } - -- private void sendClickBlockToController(int var1, boolean var2) { -- if(!var2) { -+ private void sendClickBlockToController(int par1, boolean par2) { -+ if (!par2) { - this.leftClickCounter = 0; - } - -- if(var1 != 0 || this.leftClickCounter <= 0) { -- if(var2 && this.objectMouseOver != null && this.objectMouseOver.typeOfHit == EnumMovingObjectType.TILE && var1 == 0) { -+ if (par1 != 0 || this.leftClickCounter <= 0) { -+ if (par2 && this.objectMouseOver != null && this.objectMouseOver.typeOfHit == EnumMovingObjectType.TILE && par1 == 0) { - int var3 = this.objectMouseOver.blockX; - int var4 = this.objectMouseOver.blockY; - int var5 = this.objectMouseOver.blockZ; - this.playerController.onPlayerDamageBlock(var3, var4, var5, this.objectMouseOver.sideHit); -- if(this.thePlayer.isCurrentToolAdventureModeExempt(var3, var4, var5)) { -+ -+ if (this.thePlayer.isCurrentToolAdventureModeExempt(var3, var4, var5)) { - this.effectRenderer.addBlockHitEffects(var3, var4, var5, this.objectMouseOver.sideHit); - this.thePlayer.swingItem(); - } - } else { - this.playerController.resetBlockRemoving(); - } -- - } - } - -- private void clickMouse(int var1) { -- if(var1 != 0 || this.leftClickCounter <= 0) { -- if(var1 == 0) { -+ /** -+ * Called whenever the mouse is clicked. Button clicked is 0 for left clicking and 1 for right clicking. Args: -+ * buttonClicked -+ */ -+ private void clickMouse(int par1) { -+ if (par1 != 0 || this.leftClickCounter <= 0) { -+ if (par1 == 0) { - this.thePlayer.swingItem(); - } - -- if(var1 == 1) { -+ if (par1 == 1) { - this.rightClickDelayTimer = 4; - } - - boolean var2 = true; - ItemStack var3 = this.thePlayer.inventory.getCurrentItem(); -- if(this.objectMouseOver == null) { -- if(var1 == 0 && this.playerController.isNotCreative()) { -+ -+ if (this.objectMouseOver == null) { -+ if (par1 == 0 && this.playerController.isNotCreative()) { - this.leftClickCounter = 10; - } -- } else if(this.objectMouseOver.typeOfHit == EnumMovingObjectType.ENTITY) { -- if(var1 == 0) { -+ } else if (this.objectMouseOver.typeOfHit == EnumMovingObjectType.ENTITY) { -+ if (par1 == 0) { - this.playerController.attackEntity(this.thePlayer, this.objectMouseOver.entityHit); - } - -- if(var1 == 1 && this.playerController.func_78768_b(this.thePlayer, this.objectMouseOver.entityHit)) { -+ if (par1 == 1 && this.playerController.func_78768_b(this.thePlayer, this.objectMouseOver.entityHit)) { - var2 = false; - } -- } else if(this.objectMouseOver.typeOfHit == EnumMovingObjectType.TILE) { -+ } else if (this.objectMouseOver.typeOfHit == EnumMovingObjectType.TILE) { - int var4 = this.objectMouseOver.blockX; - int var5 = this.objectMouseOver.blockY; - int var6 = this.objectMouseOver.blockZ; - int var7 = this.objectMouseOver.sideHit; -- if(var1 == 0) { -+ -+ if (par1 == 0) { - this.playerController.clickBlock(var4, var5, var6, this.objectMouseOver.sideHit); - } else { - int var8 = var3 != null ? var3.stackSize : 0; -- if(this.playerController.onPlayerRightClick(this.thePlayer, this.theWorld, var3, var4, var5, var6, var7, this.objectMouseOver.hitVec)) { -+ -+ if (this.playerController.onPlayerRightClick(this.thePlayer, this.theWorld, var3, var4, var5, var6, var7, this.objectMouseOver.hitVec)) { - var2 = false; - this.thePlayer.swingItem(); - } - -- if(var3 == null) { -+ if (var3 == null) { - return; - } - -- if(var3.stackSize == 0) { -+ if (var3.stackSize == 0) { - this.thePlayer.inventory.mainInventory[this.thePlayer.inventory.currentItem] = null; -- } else if(var3.stackSize != var8 || this.playerController.isInCreativeMode()) { -+ } else if (var3.stackSize != var8 || this.playerController.isInCreativeMode()) { - this.entityRenderer.itemRenderer.resetEquippedProgress(); - } - } - } - -- if(var2 && var1 == 1) { -+ if (var2 && par1 == 1) { - ItemStack var9 = this.thePlayer.inventory.getCurrentItem(); -- if(var9 != null && this.playerController.sendUseItem(this.thePlayer, this.theWorld, var9)) { -+ -+ if (var9 != null && this.playerController.sendUseItem(this.thePlayer, this.theWorld, var9)) { - this.entityRenderer.itemRenderer.resetEquippedProgress2(); - } - } -- - } - } - -+ /** -+ * Toggles fullscreen mode. -+ */ - public void toggleFullscreen() { - try { - this.fullscreen = !this.fullscreen; -- if(this.fullscreen) { -+ -+ if (this.fullscreen) { - this.updateDisplayMode(); - this.displayWidth = Display.getDisplayMode().getWidth(); - this.displayHeight = Display.getDisplayMode().getHeight(); -- if(this.displayWidth <= 0) { -+ -+ if (this.displayWidth <= 0) { - this.displayWidth = 1; - } - -- if(this.displayHeight <= 0) { -+ if (this.displayHeight <= 0) { - this.displayHeight = 1; - } - } else { - Display.setDisplayMode(new DisplayMode(this.tempDisplayWidth, this.tempDisplayHeight)); - this.displayWidth = this.tempDisplayWidth; - this.displayHeight = this.tempDisplayHeight; -- if(this.displayWidth <= 0) { -+ -+ if (this.displayWidth <= 0) { - this.displayWidth = 1; - } - -- if(this.displayHeight <= 0) { -+ if (this.displayHeight <= 0) { - this.displayHeight = 1; - } - } - -- if(this.currentScreen != null) { -+ if (this.currentScreen != null) { - this.resize(this.displayWidth, this.displayHeight); - } - -@@ -983,62 +1369,73 @@ - } catch (Exception var2) { - var2.printStackTrace(); - } -- - } - -- private void resize(int var1, int var2) { -- this.displayWidth = var1 <= 0 ? 1 : var1; -- this.displayHeight = var2 <= 0 ? 1 : var2; -- if(this.currentScreen != null) { -- ScaledResolution var3 = new ScaledResolution(this.gameSettings, var1, var2); -+ /** -+ * Called to resize the current screen. -+ */ -+ // Spout Start - private to public -+ public void resize(int par1, int par2) { -+ // Spout End -+ this.displayWidth = par1 <= 0 ? 1 : par1; -+ this.displayHeight = par2 <= 0 ? 1 : par2; -+ -+ if (this.currentScreen != null) { -+ ScaledResolution var3 = new ScaledResolution(this.gameSettings, par1, par2); - int var4 = var3.getScaledWidth(); - int var5 = var3.getScaledHeight(); - this.currentScreen.setWorldAndResolution(this, var4, var5); - } -- - } - -+ /** -+ * Runs the current tick. -+ */ - public void runTick() { -- if(this.rightClickDelayTimer > 0) { -+ if (this.rightClickDelayTimer > 0) { - --this.rightClickDelayTimer; - } - - this.mcProfiler.startSection("stats"); - this.statFileWriter.func_77449_e(); - this.mcProfiler.endStartSection("gui"); -- if(!this.isGamePaused) { -+ -+ if (!this.isGamePaused) { - this.ingameGUI.updateTick(); - } - - this.mcProfiler.endStartSection("pick"); - this.entityRenderer.getMouseOver(1.0F); - this.mcProfiler.endStartSection("gameMode"); -- if(!this.isGamePaused && this.theWorld != null) { -+ -+ if (!this.isGamePaused && this.theWorld != null) { - this.playerController.updateController(); - } -- -+ - this.mcProfiler.endStartSection("textures"); -- if(!this.isGamePaused) { -+ -+ if (!this.isGamePaused) { - this.renderEngine.tick(); - } - -- if(this.currentScreen == null && this.thePlayer != null) { -- if(this.thePlayer.getHealth() <= 0.0F) { -+ if (this.currentScreen == null && this.thePlayer != null) { -+ if (this.thePlayer.getHealth() <= 0.0F) { - this.displayGuiScreen((GuiScreen)null); -- } else if(this.thePlayer.isPlayerSleeping() && this.theWorld != null) { -+ } else if (this.thePlayer.isPlayerSleeping() && this.theWorld != null) { - this.displayGuiScreen(new GuiSleepMP()); - } -- } else if(this.currentScreen != null && this.currentScreen instanceof GuiSleepMP && !this.thePlayer.isPlayerSleeping()) { -+ } else if (this.currentScreen != null && this.currentScreen instanceof GuiSleepMP && !this.thePlayer.isPlayerSleeping()) { - this.displayGuiScreen((GuiScreen)null); - } - -- if(this.currentScreen != null) { -+ if (this.currentScreen != null) { - this.leftClickCounter = 10000; - } - - CrashReport var2; - CrashReportCategory var3; -- if(this.currentScreen != null) { -+ -+ if (this.currentScreen != null) { - try { - this.currentScreen.handleInput(); - } catch (Throwable var6) { -@@ -1048,7 +1445,7 @@ - throw new ReportedException(var2); - } - -- if(this.currentScreen != null) { -+ if (this.currentScreen != null) { - try { - this.currentScreen.updateScreen(); - } catch (Throwable var5) { -@@ -1060,32 +1457,43 @@ - } - } - -- if(this.currentScreen == null || this.currentScreen.allowUserInput) { -+ if (this.currentScreen == null || this.currentScreen.allowUserInput) { - this.mcProfiler.endStartSection("mouse"); -- - int var1; -- while(Mouse.next()) { -+ -+ while (Mouse.next()) { - var1 = Mouse.getEventButton(); -- if(isRunningOnMac && var1 == 0 && (Keyboard.isKeyDown(Keyboard.KEY_LCONTROL) || Keyboard.isKeyDown(Keyboard.KEY_RCONTROL))) { -+ -+ if (isRunningOnMac && var1 == 0 && (Keyboard.isKeyDown(29) || Keyboard.isKeyDown(157))) { - var1 = 1; - } -+ // Spout Start -+ if (var1 >= 0) { -+ ((SimpleKeyBindingManager) SpoutClient.getInstance().getKeyBindingManager()).pressKey(Mouse.getEventButton() - 100, Mouse.getEventButtonState(), ScreenUtil.getType(currentScreen).getCode()); -+ this.thePlayer.handleKeyPress(Mouse.getEventButton() - 100, Mouse.getEventButtonState()); // Spout handle key press -+ } -+ // Spout End - - KeyBinding.setKeyBindState(var1 - 100, Mouse.getEventButtonState()); -- if(Mouse.getEventButtonState()) { -+ -+ if (Mouse.getEventButtonState()) { - KeyBinding.onTick(var1 - 100); - } - - long var9 = getSystemTime() - this.systemTime; -- if(var9 <= 200L) { -+ -+ if (var9 <= 200L) { - int var4 = Mouse.getEventDWheel(); -- if(var4 != 0) { -+ -+ if (var4 != 0) { - this.thePlayer.inventory.changeCurrentItem(var4); -- if(this.gameSettings.noclip) { -- if(var4 > 0) { -+ -+ if (this.gameSettings.noclip) { -+ if (var4 > 0) { - var4 = 1; - } - -- if(var4 < 0) { -+ if (var4 < 0) { - var4 = -1; - } - -@@ -1093,225 +1501,250 @@ - } - } - -- if(this.currentScreen == null) { -- if(!this.inGameHasFocus && Mouse.getEventButtonState()) { -+ if (this.currentScreen == null) { -+ if (!this.inGameHasFocus && Mouse.getEventButtonState()) { - this.setIngameFocus(); - } -- } else if(this.currentScreen != null) { -+ } else if (this.currentScreen != null) { - this.currentScreen.handleMouseInput(); - } - } - } - -- if(this.leftClickCounter > 0) { -+ if (this.leftClickCounter > 0) { - --this.leftClickCounter; - } - - this.mcProfiler.endStartSection("keyboard"); -- -- label440: -- while(true) { -- while(true) { -- boolean var8; -- do { -- if(!Keyboard.next()) { -- var8 = this.gameSettings.chatVisibility != 2; -- -- while(this.gameSettings.keyBindInventory.isPressed()) { -- if(this.playerController.func_110738_j()) { -- this.thePlayer.func_110322_i(); -- } else { -- this.displayGuiScreen(new GuiInventory(this.thePlayer)); -- } -- } -- -- while(this.gameSettings.keyBindDrop.isPressed()) { -- this.thePlayer.dropOneItem(GuiScreen.isCtrlKeyDown()); -- } -- -- while(this.gameSettings.keyBindChat.isPressed() && var8) { -- this.displayGuiScreen(new GuiChat()); -- } -- -- if(this.currentScreen == null && this.gameSettings.keyBindCommand.isPressed() && var8) { -- this.displayGuiScreen(new GuiChat("/")); -- } -- -- if(this.thePlayer.isUsingItem()) { -- if(!this.gameSettings.keyBindUseItem.pressed) { -- this.playerController.onStoppedUsingItem(this.thePlayer); -- } -- -- while(true) { -- if(!this.gameSettings.keyBindAttack.isPressed()) { -- while(this.gameSettings.keyBindUseItem.isPressed()) { -- } -- -- while(this.gameSettings.keyBindPickBlock.isPressed()) { -- } -- break; -- } -- } -- } else { -- while(this.gameSettings.keyBindAttack.isPressed()) { -- this.clickMouse(0); -- } -- -- while(this.gameSettings.keyBindUseItem.isPressed()) { -- this.clickMouse(1); -- } -- -- while(this.gameSettings.keyBindPickBlock.isPressed()) { -- this.clickMiddleMouseButton(); -- } -- } -- -- if(this.gameSettings.keyBindUseItem.pressed && this.rightClickDelayTimer == 0 && !this.thePlayer.isUsingItem()) { -- this.clickMouse(1); -- } -- -- this.sendClickBlockToController(0, this.currentScreen == null && this.gameSettings.keyBindAttack.pressed && this.inGameHasFocus); -- break label440; -- } -- -- KeyBinding.setKeyBindState(Keyboard.getEventKey(), Keyboard.getEventKeyState()); -- if(Keyboard.getEventKeyState()) { -- KeyBinding.onTick(Keyboard.getEventKey()); -- } -- -- if(this.field_83002_am > 0L) { -- if(getSystemTime() - this.field_83002_am >= 6000L) { -- throw new ReportedException(new CrashReport("Manually triggered debug crash", new Throwable())); -- } -- -- if(!Keyboard.isKeyDown(Keyboard.KEY_C) || !Keyboard.isKeyDown(Keyboard.KEY_F3)) { -- this.field_83002_am = -1L; -- } -- } else if(Keyboard.isKeyDown(Keyboard.KEY_C) && Keyboard.isKeyDown(Keyboard.KEY_F3)) { -- this.field_83002_am = getSystemTime(); -- } -- } while(!Keyboard.getEventKeyState()); -- -- if(Keyboard.getEventKey() == Keyboard.KEY_F11) { -+ boolean var8; -+ -+ while (Keyboard.next()) { -+ // Spout Start -+ ((SimpleKeyBindingManager) SpoutClient.getInstance().getKeyBindingManager()).pressKey(Keyboard.getEventKey(), Keyboard.getEventKeyState(), ScreenUtil.getType(currentScreen).getCode()); -+ this.thePlayer.handleKeyPress(Keyboard.getEventKey(), Keyboard.getEventKeyState()); // Spout handle key press -+ // Spout End -+ -+ KeyBinding.setKeyBindState(Keyboard.getEventKey(), Keyboard.getEventKeyState()); -+ -+ if (Keyboard.getEventKeyState()) { -+ KeyBinding.onTick(Keyboard.getEventKey()); -+ } -+ -+ if (this.field_83002_am > 0L) { -+ if (getSystemTime() - this.field_83002_am >= 6000L) { -+ throw new ReportedException(new CrashReport("Manually triggered debug crash", new Throwable())); -+ } -+ -+ if (!Keyboard.isKeyDown(46) || !Keyboard.isKeyDown(61)) { -+ this.field_83002_am = -1L; -+ } -+ } else if (Keyboard.isKeyDown(46) && Keyboard.isKeyDown(61)) { -+ this.field_83002_am = getSystemTime(); -+ } -+ -+ if (Keyboard.getEventKeyState()) { -+ if (Keyboard.getEventKey() == 87) { - this.toggleFullscreen(); - } else { -- if(this.currentScreen != null) { -+ if (this.currentScreen != null) { - this.currentScreen.handleKeyboardInput(); - } else { -- if(Keyboard.getEventKey() == Keyboard.KEY_ESCAPE) { -+ if (Keyboard.getEventKey() == 1) { - this.displayInGameMenu(); - } - -- if(Keyboard.getEventKey() == Keyboard.KEY_S && Keyboard.isKeyDown(Keyboard.KEY_F3)) { -- this.refreshResources(); -- } -- -- if(Keyboard.getEventKey() == Keyboard.KEY_T && Keyboard.isKeyDown(Keyboard.KEY_F3)) { -- this.refreshResources(); -- } -- -- if(Keyboard.getEventKey() == Keyboard.KEY_F && Keyboard.isKeyDown(Keyboard.KEY_F3)) { -- var8 = Keyboard.isKeyDown(Keyboard.KEY_LSHIFT) | Keyboard.isKeyDown(Keyboard.KEY_RSHIFT); -+ if (Keyboard.getEventKey() == 31 && Keyboard.isKeyDown(61)) { -+ this.refreshResources(); -+ } -+ -+ if (Keyboard.getEventKey() == 20 && Keyboard.isKeyDown(61)) { -+ this.refreshResources(); -+ } -+ -+ if (Keyboard.getEventKey() == 33 && Keyboard.isKeyDown(61)) { -+ var8 = Keyboard.isKeyDown(42) | Keyboard.isKeyDown(54); - this.gameSettings.setOptionValue(EnumOptions.RENDER_DISTANCE, var8 ? -1 : 1); - } - -- if(Keyboard.getEventKey() == Keyboard.KEY_A && Keyboard.isKeyDown(Keyboard.KEY_F3)) { -+ if (Keyboard.getEventKey() == 30 && Keyboard.isKeyDown(61)) { - this.renderGlobal.loadRenderers(); - } - -- if(Keyboard.getEventKey() == Keyboard.KEY_H && Keyboard.isKeyDown(Keyboard.KEY_F3)) { -+ if (Keyboard.getEventKey() == 35 && Keyboard.isKeyDown(61)) { - this.gameSettings.advancedItemTooltips = !this.gameSettings.advancedItemTooltips; - this.gameSettings.saveOptions(); - } - -- if(Keyboard.getEventKey() == Keyboard.KEY_B && Keyboard.isKeyDown(Keyboard.KEY_F3)) { -+ if (Keyboard.getEventKey() == 48 && Keyboard.isKeyDown(61)) { - RenderManager.field_85095_o = !RenderManager.field_85095_o; - } - -- if(Keyboard.getEventKey() == Keyboard.KEY_P && Keyboard.isKeyDown(Keyboard.KEY_F3)) { -+ if (Keyboard.getEventKey() == 25 && Keyboard.isKeyDown(61)) { - this.gameSettings.pauseOnLostFocus = !this.gameSettings.pauseOnLostFocus; - this.gameSettings.saveOptions(); - } - -- if(Keyboard.getEventKey() == Keyboard.KEY_F1) { -+ if (Keyboard.getEventKey() == 59) { - this.gameSettings.hideGUI = !this.gameSettings.hideGUI; - } - -- if(Keyboard.getEventKey() == Keyboard.KEY_F3) { -+ if (Keyboard.getEventKey() == 61) { - this.gameSettings.showDebugInfo = !this.gameSettings.showDebugInfo; - this.gameSettings.showDebugProfilerChart = GuiScreen.isShiftKeyDown(); - } - -- if(Keyboard.getEventKey() == Keyboard.KEY_F5) { -+ if (Keyboard.getEventKey() == 63) { - ++this.gameSettings.thirdPersonView; -- if(this.gameSettings.thirdPersonView > 2) { -+ -+ if (this.gameSettings.thirdPersonView > 2) { - this.gameSettings.thirdPersonView = 0; - } - } - -- if(Keyboard.getEventKey() == Keyboard.KEY_F8) { -+ if (Keyboard.getEventKey() == 66) { - this.gameSettings.smoothCamera = !this.gameSettings.smoothCamera; - } - } - -- for(var1 = 0; var1 < 9; ++var1) { -- if(Keyboard.getEventKey() == Keyboard.KEY_1 + var1) { -- this.thePlayer.inventory.currentItem = var1; -+ int var9; -+ // Spout Start -+ if (Configuration.isHotbarQuickKeysEnabled()) { -+ for (var9 = 0; var9 < 9; ++var9) { -+ if (Keyboard.getEventKey() == 2 + var9) { -+ this.thePlayer.inventory.currentItem = var9; -+ } - } - } -+ // Spout End - -- if(this.gameSettings.showDebugInfo && this.gameSettings.showDebugProfilerChart) { -- if(Keyboard.getEventKey() == Keyboard.KEY_0) { -+ if (this.gameSettings.showDebugInfo && this.gameSettings.showDebugProfilerChart) { -+ if (Keyboard.getEventKey() == 11) { - this.updateDebugProfilerName(0); - } - -- for(var1 = 0; var1 < 9; ++var1) { -- if(Keyboard.getEventKey() == Keyboard.KEY_1 + var1) { -- this.updateDebugProfilerName(var1 + 1); -- } -- } -- } -- } -- } -- } -+ for (var9 = 0; var9 < 9; ++var9) { -+ if (Keyboard.getEventKey() == 2 + var9) { -+ this.updateDebugProfilerName(var9 + 1); -+ } -+ } -+ } -+ } -+ } -+ } -+ -+ var8 = this.gameSettings.chatVisibility != 2; -+ -+ while (this.gameSettings.keyBindInventory.isPressed()) { -+ if (this.playerController.func_110738_j()) { -+ this.thePlayer.func_110322_i(); -+ } else { -+ this.displayGuiScreen(new GuiInventory(this.thePlayer)); -+ } -+ } -+ -+ while (this.gameSettings.keyBindDrop.isPressed()) { -+ this.thePlayer.dropOneItem(GuiScreen.isCtrlKeyDown()); -+ } -+ -+ while (this.gameSettings.keyBindChat.isPressed() && var8) { -+ this.displayGuiScreen(new GuiChat()); -+ } -+ -+ // Spout Start - Open chat in SP with debug key -+ if (this.currentScreen == null && this.gameSettings.keyBindCommand.isPressed() && var8 && Keyboard.getEventKey() != Keyboard.KEY_SLASH && isIntegratedServerRunning()) { -+ this.displayGuiScreen(new GuiChat()); -+ thePlayer.sendChatMessage(ChatColor.RED + "Debug Console Opened"); -+ } -+ -+ if (currentScreen == null && Keyboard.getEventKey() == Keyboard.KEY_SLASH) { -+ // Spout End -+ this.displayGuiScreen(new GuiChat("/")); -+ } -+ -+ if (this.thePlayer.isUsingItem()) { -+ if (!this.gameSettings.keyBindUseItem.pressed) { -+ this.playerController.onStoppedUsingItem(this.thePlayer); -+ } -+ -+ label381: -+ -+ while (true) { -+ if (!this.gameSettings.keyBindAttack.isPressed()) { -+ while (this.gameSettings.keyBindUseItem.isPressed()) { -+ ; -+ } -+ -+ while (true) { -+ if (this.gameSettings.keyBindPickBlock.isPressed()) { -+ continue; -+ } -+ -+ break label381; -+ } -+ } -+ } -+ } else { -+ while (this.gameSettings.keyBindAttack.isPressed()) { -+ this.clickMouse(0); -+ } -+ -+ while (this.gameSettings.keyBindUseItem.isPressed()) { -+ this.clickMouse(1); -+ } -+ -+ while (this.gameSettings.keyBindPickBlock.isPressed()) { -+ this.clickMiddleMouseButton(); -+ } -+ } -+ -+ if (this.gameSettings.keyBindUseItem.pressed && this.rightClickDelayTimer == 0 && !this.thePlayer.isUsingItem()) { -+ this.clickMouse(1); -+ } -+ -+ this.sendClickBlockToController(0, this.currentScreen == null && this.gameSettings.keyBindAttack.pressed && this.inGameHasFocus); - } - -- if(this.theWorld != null) { -- if(this.thePlayer != null) { -+ if (this.theWorld != null) { -+ if (this.thePlayer != null) { - ++this.joinPlayerCounter; -- if(this.joinPlayerCounter == 30) { -+ -+ if (this.joinPlayerCounter == 30) { - this.joinPlayerCounter = 0; - this.theWorld.joinEntityInSurroundings(this.thePlayer); - } - } - - this.mcProfiler.endStartSection("gameRenderer"); -- if(!this.isGamePaused) { -+ -+ if (!this.isGamePaused) { - this.entityRenderer.updateRenderer(); - } - - this.mcProfiler.endStartSection("levelRenderer"); -- if(!this.isGamePaused) { -+ -+ if (!this.isGamePaused) { - this.renderGlobal.updateClouds(); - } - - this.mcProfiler.endStartSection("level"); -- if(!this.isGamePaused) { -- if(this.theWorld.lastLightningBolt > 0) { -+ -+ if (!this.isGamePaused) { -+ if (this.theWorld.lastLightningBolt > 0) { - --this.theWorld.lastLightningBolt; - } - - this.theWorld.updateEntities(); - } - -- if(!this.isGamePaused) { -+ if (!this.isGamePaused) { - this.theWorld.setAllowedSpawnTypes(this.theWorld.difficultySetting > 0, true); - - try { - this.theWorld.tick(); - } catch (Throwable var7) { - var2 = CrashReport.makeCrashReport(var7, "Exception in world tick"); -- if(this.theWorld == null) { -+ -+ if (this.theWorld == null) { - var3 = var2.makeCategory("Affected level"); - var3.addCrashSection("Problem", "Level is null!"); - } else { -@@ -1323,15 +1756,17 @@ - } - - this.mcProfiler.endStartSection("animateTick"); -- if(!this.isGamePaused && this.theWorld != null) { -+ -+ if (!this.isGamePaused && this.theWorld != null) { - this.theWorld.doVoidFogParticles(MathHelper.floor_double(this.thePlayer.posX), MathHelper.floor_double(this.thePlayer.posY), MathHelper.floor_double(this.thePlayer.posZ)); - } - - this.mcProfiler.endStartSection("particles"); -- if(!this.isGamePaused) { -+ -+ if (!this.isGamePaused) { - this.effectRenderer.updateEffects(); - } -- } else if(this.myNetworkManager != null) { -+ } else if (this.myNetworkManager != null) { - this.mcProfiler.endStartSection("pendingConnection"); - this.myNetworkManager.processReadPackets(); - } -@@ -1340,37 +1775,43 @@ - this.systemTime = getSystemTime(); - } - -- public void launchIntegratedServer(String var1, String var2, WorldSettings var3) { -+ /** -+ * Arguments: World foldername, World ingame name, WorldSettings -+ */ -+ public void launchIntegratedServer(String par1Str, String par2Str, WorldSettings par3WorldSettings) { - this.loadWorld((WorldClient)null); - System.gc(); -- ISaveHandler var4 = this.saveLoader.getSaveLoader(var1, false); -+ ISaveHandler var4 = this.saveLoader.getSaveLoader(par1Str, false); - WorldInfo var5 = var4.loadWorldInfo(); -- if(var5 == null && var3 != null) { -- var5 = new WorldInfo(var3, var1); -+ -+ if (var5 == null && par3WorldSettings != null) { -+ var5 = new WorldInfo(par3WorldSettings, par1Str); - var4.saveWorldInfo(var5); - } - -- if(var3 == null) { -- var3 = new WorldSettings(var5); -+ if (par3WorldSettings == null) { -+ par3WorldSettings = new WorldSettings(var5); - } - - this.statFileWriter.readStat(StatList.startGameStat, 1); -- this.theIntegratedServer = new IntegratedServer(this, var1, var2, var3); -+ this.theIntegratedServer = new IntegratedServer(this, par1Str, par2Str, par3WorldSettings); - this.theIntegratedServer.startServerThread(); - this.integratedServerIsRunning = true; -- this.loadingScreen.displaySavingString(I18n.getString("menu.loadingLevel")); -+ this.loadingScreen.displayProgressMessage(I18n.getString("menu.loadingLevel")); - -- while(!this.theIntegratedServer.serverIsInRunLoop()) { -+ while (!this.theIntegratedServer.serverIsInRunLoop()) { - String var6 = this.theIntegratedServer.getUserMessage(); -- if(var6 != null) { -- this.loadingScreen.displayLoadingString(I18n.getString(var6)); -+ -+ if (var6 != null) { -+ this.loadingScreen.resetProgresAndWorkingMessage(I18n.getString(var6)); - } else { -- this.loadingScreen.displayLoadingString(""); -+ this.loadingScreen.resetProgresAndWorkingMessage(""); - } - - try { - Thread.sleep(200L); - } catch (InterruptedException var9) { -+ ; - } - } - -@@ -1382,26 +1823,33 @@ - } catch (IOException var8) { - this.displayCrashReport(this.addGraphicsAndWorldToCrashReport(new CrashReport("Connecting to integrated server", var8))); - } -- -- } -- -- public void loadWorld(WorldClient var1) { -- this.loadWorld(var1, ""); -- } -- -- public void loadWorld(WorldClient var1, String var2) { -+ } -+ -+ /** -+ * unloads the current world first -+ */ -+ public void loadWorld(WorldClient par1WorldClient) { -+ this.loadWorld(par1WorldClient, ""); -+ } -+ -+ /** -+ * par2Str is displayed on the loading screen to the user unloads the current world first -+ */ -+ public void loadWorld(WorldClient par1WorldClient, String par2Str) { - this.statFileWriter.syncStats(); -- if(var1 == null) { -+ -+ if (par1WorldClient == null) { - NetClientHandler var3 = this.getNetHandler(); -- if(var3 != null) { -+ -+ if (var3 != null) { - var3.cleanup(); - } - -- if(this.myNetworkManager != null) { -+ if (this.myNetworkManager != null) { - this.myNetworkManager.closeConnections(); - } - -- if(this.theIntegratedServer != null) { -+ if (this.theIntegratedServer != null) { - this.theIntegratedServer.initiateShutdown(); - } - -@@ -1410,69 +1858,90 @@ - - this.renderViewEntity = null; - this.myNetworkManager = null; -- if(this.loadingScreen != null) { -- this.loadingScreen.resetProgressAndMessage(var2); -- this.loadingScreen.displayLoadingString(""); -+ -+ if (this.loadingScreen != null) { -+ this.loadingScreen.resetProgressAndMessage(par2Str); -+ this.loadingScreen.resetProgresAndWorkingMessage(""); - } - -- if(var1 == null && this.theWorld != null) { -+ if (par1WorldClient == null && this.theWorld != null) { - this.setServerData((ServerData)null); - this.integratedServerIsRunning = false; - } - - this.sndManager.playStreaming((String)null, 0.0F, 0.0F, 0.0F); - this.sndManager.stopAllSounds(); -- this.theWorld = var1; -- if(var1 != null) { -- if(this.renderGlobal != null) { -- this.renderGlobal.setWorldAndLoadRenderers(var1); -- } -- -- if(this.effectRenderer != null) { -- this.effectRenderer.clearEffects(var1); -- } -- -- if(this.thePlayer == null) { -- this.thePlayer = this.playerController.func_78754_a(var1); -+ this.theWorld = par1WorldClient; -+ -+ if (par1WorldClient != null) { -+ if (this.renderGlobal != null) { -+ this.renderGlobal.setWorldAndLoadRenderers(par1WorldClient); -+ } -+ -+ if (this.effectRenderer != null) { -+ this.effectRenderer.clearEffects(par1WorldClient); -+ } -+ -+ if (this.thePlayer == null) { -+ this.thePlayer = this.playerController.func_78754_a(par1WorldClient); - this.playerController.flipPlayer(this.thePlayer); - } - - this.thePlayer.preparePlayerToSpawn(); -- var1.spawnEntityInWorld(this.thePlayer); -+ par1WorldClient.spawnEntityInWorld(this.thePlayer); - this.thePlayer.movementInput = new MovementInputFromOptions(this.gameSettings); - this.playerController.setPlayerCapabilities(this.thePlayer); - this.renderViewEntity = this.thePlayer; -+ // Spout Start -+ SpoutClient.getInstance().onWorldEnter(); -+ // Spout End - } else { - this.saveLoader.flushCache(); -- this.thePlayer = null; -+ this.thePlayer = null; -+ SpoutClient.getInstance().onWorldExit(); -+ SpoutClient.getInstance().clearPermissions(); -+ // Spout End - } - - System.gc(); - this.systemTime = 0L; - } - -+ /** -+ * A String of renderGlobal.getDebugInfoRenders -+ */ - public String debugInfoRenders() { - return this.renderGlobal.getDebugInfoRenders(); - } - -+ /** -+ * Gets the information in the F3 menu about how many entities are infront/around you -+ */ - public String getEntityDebug() { - return this.renderGlobal.getDebugInfoEntities(); - } - -+ /** -+ * Gets the name of the world's current chunk provider -+ */ - public String getWorldProviderName() { - return this.theWorld.getProviderName(); - } - -+ /** -+ * A String of how many entities are in the world -+ */ - public String debugInfoEntities() { - return "P: " + this.effectRenderer.getStatistics() + ". T: " + this.theWorld.getDebugLoadedEntities(); - } - -- public void setDimensionAndSpawnPlayer(int var1) { -+ public void setDimensionAndSpawnPlayer(int par1) { - this.theWorld.setSpawnLocation(); - this.theWorld.removeAllEntities(); - int var2 = 0; - String var3 = null; -- if(this.thePlayer != null) { -+ -+ if (this.thePlayer != null) { - var2 = this.thePlayer.entityId; - this.theWorld.removeEntity(this.thePlayer); - var3 = this.thePlayer.func_142021_k(); -@@ -1480,7 +1949,7 @@ - - this.renderViewEntity = null; - this.thePlayer = this.playerController.func_78754_a(this.theWorld); -- this.thePlayer.dimension = var1; -+ this.thePlayer.dimension = par1; - this.renderViewEntity = this.thePlayer; - this.thePlayer.preparePlayerToSpawn(); - this.thePlayer.func_142020_c(var3); -@@ -1489,16 +1958,37 @@ - this.thePlayer.movementInput = new MovementInputFromOptions(this.gameSettings); - this.thePlayer.entityId = var2; - this.playerController.setPlayerCapabilities(this.thePlayer); -- if(this.currentScreen instanceof GuiGameOver) { -+ -+ //ToDo: Needs var9.func_110138_aP update. -+ // Spout Start -+ /* -+ EntityPlayer var9 = this.thePlayer; -+ if (var9 != null) { -+ this.thePlayer.setData(var9.getData()); // Even in MP still need to copy Spout data across -+ if (var9.health <= 0) { -+ String name = "Death " + new SimpleDateFormat("dd-MM-yyyy").format(new Date()); -+ Waypoint death = new Waypoint(name, (int)var9.posX, (int)var9.posY, (int)var9.posZ, true); -+ death.deathpoint = true; -+ MinimapConfig.getInstance().addWaypoint(death); -+ } -+ }*/ -+ // Spout End -+ -+ if (this.currentScreen instanceof GuiGameOver) { - this.displayGuiScreen((GuiScreen)null); - } -- - } - -+ /** -+ * Gets whether this is a demo or not. -+ */ - public final boolean isDemo() { - return this.isDemo; - } - -+ /** -+ * Returns the NetClientHandler. -+ */ - public NetClientHandler getNetHandler() { - return this.thePlayer != null ? this.thePlayer.sendQueue : null; - } -@@ -1511,32 +2001,51 @@ - return theMinecraft != null && theMinecraft.gameSettings.fancyGraphics; - } - -+ /** -+ * Returns if ambient occlusion is enabled -+ */ - public static boolean isAmbientOcclusionEnabled() { -- return theMinecraft != null && theMinecraft.gameSettings.ambientOcclusion != 0; -- } -- -- public boolean handleClientCommand(String var1) { -+ // Spout Start -+ return theMinecraft != null && Configuration.ambientOcclusion; -+ // Spout End -+ } -+ -+ public static boolean isDebugInfoEnabled() { -+ return theMinecraft != null && theMinecraft.gameSettings.showDebugInfo; -+ } -+ -+ /** -+ * Returns true if the message is a client command and should not be sent to the server. However there are no such -+ * commands at this point in time. -+ */ -+ public boolean handleClientCommand(String par1Str) { - return false; - } - -+ /** -+ * Called when the middle mouse button gets clicked -+ */ - private void clickMiddleMouseButton() { -- if(this.objectMouseOver != null) { -+ if (this.objectMouseOver != null) { - boolean var1 = this.thePlayer.capabilities.isCreativeMode; - int var3 = 0; - boolean var4 = false; - int var2; - int var5; -- if(this.objectMouseOver.typeOfHit == EnumMovingObjectType.TILE) { -+ -+ if (this.objectMouseOver.typeOfHit == EnumMovingObjectType.TILE) { - var5 = this.objectMouseOver.blockX; - int var6 = this.objectMouseOver.blockY; - int var7 = this.objectMouseOver.blockZ; - Block var8 = Block.blocksList[this.theWorld.getBlockId(var5, var6, var7)]; -- if(var8 == null) { -+ -+ if (var8 == null) { - return; - } - - var2 = var8.idPicked(this.theWorld, var5, var6, var7); -- if(var2 == 0) { -+ -+ if (var2 == 0) { - return; - } - -@@ -1544,122 +2053,136 @@ - int var9 = var2 < 256 && !Block.blocksList[var8.blockID].isFlowerPot() ? var2 : var8.blockID; - var3 = Block.blocksList[var9].getDamageValue(this.theWorld, var5, var6, var7); - } else { -- if(this.objectMouseOver.typeOfHit != EnumMovingObjectType.ENTITY || this.objectMouseOver.entityHit == null || !var1) { -+ if (this.objectMouseOver.typeOfHit != EnumMovingObjectType.ENTITY || this.objectMouseOver.entityHit == null || !var1) { - return; - } - -- if(this.objectMouseOver.entityHit instanceof EntityPainting) { -+ if (this.objectMouseOver.entityHit instanceof EntityPainting) { - var2 = Item.painting.itemID; -- } else if(this.objectMouseOver.entityHit instanceof EntityLeashKnot) { -+ } else if (this.objectMouseOver.entityHit instanceof EntityLeashKnot) { - var2 = Item.leash.itemID; -- } else if(this.objectMouseOver.entityHit instanceof EntityItemFrame) { -+ } else if (this.objectMouseOver.entityHit instanceof EntityItemFrame) { - EntityItemFrame var10 = (EntityItemFrame)this.objectMouseOver.entityHit; -- if(var10.getDisplayedItem() == null) { -+ -+ if (var10.getDisplayedItem() == null) { - var2 = Item.itemFrame.itemID; - } else { - var2 = var10.getDisplayedItem().itemID; - var3 = var10.getDisplayedItem().getItemDamage(); - var4 = true; - } -- } else if(this.objectMouseOver.entityHit instanceof EntityMinecart) { -+ } else if (this.objectMouseOver.entityHit instanceof EntityMinecart) { - EntityMinecart var11 = (EntityMinecart)this.objectMouseOver.entityHit; -- if(var11.getMinecartType() == 2) { -+ -+ if (var11.getMinecartType() == 2) { - var2 = Item.minecartPowered.itemID; -- } else if(var11.getMinecartType() == 1) { -+ } else if (var11.getMinecartType() == 1) { - var2 = Item.minecartCrate.itemID; -- } else if(var11.getMinecartType() == 3) { -- var2 = Item.tntMinecart.itemID; -- } else if(var11.getMinecartType() == 5) { -+ } else if (var11.getMinecartType() == 3) { -+ var2 = Item.minecartTnt.itemID; -+ } else if (var11.getMinecartType() == 5) { - var2 = Item.minecartHopper.itemID; - } else { - var2 = Item.minecartEmpty.itemID; - } -- } else if(this.objectMouseOver.entityHit instanceof EntityBoat) { -+ } else if (this.objectMouseOver.entityHit instanceof EntityBoat) { - var2 = Item.boat.itemID; - } else { - var2 = Item.monsterPlacer.itemID; - var3 = EntityList.getEntityID(this.objectMouseOver.entityHit); - var4 = true; -- if(var3 <= 0 || !EntityList.a.containsKey(Integer.valueOf(var3))) { -+ -+ if (var3 <= 0 || !EntityList.entityEggs.containsKey(Integer.valueOf(var3))) { - return; - } - } - } - - this.thePlayer.inventory.setCurrentItem(var2, var3, var4, var1); -- if(var1) { -- var5 = this.thePlayer.inventoryContainer.c.size() - 9 + this.thePlayer.inventory.currentItem; -+ -+ if (var1) { -+ var5 = this.thePlayer.inventoryContainer.inventorySlots.size() - 9 + this.thePlayer.inventory.currentItem; - this.playerController.sendSlotPacket(this.thePlayer.inventory.getStackInSlot(this.thePlayer.inventory.currentItem), var5); - } -- -- } -- } -- -- public CrashReport addGraphicsAndWorldToCrashReport(CrashReport var1) { -- var1.getCategory().addCrashSectionCallable("Launched Version", new CallableLaunchedVersion(this)); -- var1.getCategory().addCrashSectionCallable("LWJGL", new CallableLWJGLVersion(this)); -- var1.getCategory().addCrashSectionCallable("OpenGL", new CallableGLInfo(this)); -- var1.getCategory().addCrashSectionCallable("Is Modded", new CallableModded(this)); -- var1.getCategory().addCrashSectionCallable("Type", new CallableType2(this)); -- var1.getCategory().addCrashSectionCallable("Resource Pack", new CallableTexturePack(this)); -- var1.getCategory().addCrashSectionCallable("Current Language", new CallableClientProfiler(this)); -- var1.getCategory().addCrashSectionCallable("Profiler Position", new CallableClientMemoryStats(this)); -- var1.getCategory().addCrashSectionCallable("Vec3 Pool Size", new MinecraftINNER13(this)); -- if(this.theWorld != null) { -- this.theWorld.addWorldInfoToCrashReport(var1); -- } -- -- return var1; -- } -- -+ } -+ } -+ -+ /** -+ * adds core server Info (GL version , Texture pack, isModded, type), and the worldInfo to the crash report -+ */ -+ public CrashReport addGraphicsAndWorldToCrashReport(CrashReport par1CrashReport) { -+ par1CrashReport.getCategory().addCrashSectionCallable("Launched Version", new CallableLaunchedVersion(this)); -+ par1CrashReport.getCategory().addCrashSectionCallable("LWJGL", new CallableLWJGLVersion(this)); -+ par1CrashReport.getCategory().addCrashSectionCallable("OpenGL", new CallableGLInfo(this)); -+ par1CrashReport.getCategory().addCrashSectionCallable("Is Modded", new CallableModded(this)); -+ par1CrashReport.getCategory().addCrashSectionCallable("Type", new CallableType2(this)); -+ par1CrashReport.getCategory().addCrashSectionCallable("Resource Pack", new CallableTexturePack(this)); -+ par1CrashReport.getCategory().addCrashSectionCallable("Current Language", new CallableClientProfiler(this)); -+ par1CrashReport.getCategory().addCrashSectionCallable("Profiler Position", new CallableClientMemoryStats(this)); -+ par1CrashReport.getCategory().addCrashSectionCallable("Vec3 Pool Size", new MinecraftINNER13(this)); -+ -+ if (this.theWorld != null) { -+ this.theWorld.addWorldInfoToCrashReport(par1CrashReport); -+ } -+ -+ return par1CrashReport; -+ } -+ -+ /** -+ * Return the singleton Minecraft instance for the game -+ */ - public static Minecraft getMinecraft() { - return theMinecraft; - } - -- public void addServerStatsToSnooper(PlayerUsageSnooper var1) { -- var1.addData("fps", Integer.valueOf(debugFPS)); -- var1.addData("texpack_name", this.mcResourcePackRepository.getResourcePackName()); -- var1.addData("vsync_enabled", Boolean.valueOf(this.gameSettings.enableVsync)); -- var1.addData("display_frequency", Integer.valueOf(Display.getDisplayMode().getFrequency())); -- var1.addData("display_type", this.fullscreen ? "fullscreen" : "windowed"); -- var1.addData("run_time", Long.valueOf((MinecraftServer.getCurrentTimeMillis() - var1.func_130105_g()) / 60L * 1000L)); -- if(this.theIntegratedServer != null && this.theIntegratedServer.getPlayerUsageSnooper() != null) { -- var1.addData("snooper_partner", this.theIntegratedServer.getPlayerUsageSnooper().getUniqueID()); -+ public void addServerStatsToSnooper(PlayerUsageSnooper par1PlayerUsageSnooper) { -+ par1PlayerUsageSnooper.addData("fps", Integer.valueOf(debugFPS)); -+ par1PlayerUsageSnooper.addData("texpack_name", this.mcResourcePackRepository.getResourcePackName()); -+ par1PlayerUsageSnooper.addData("vsync_enabled", Boolean.valueOf(this.gameSettings.enableVsync)); -+ par1PlayerUsageSnooper.addData("display_frequency", Integer.valueOf(Display.getDisplayMode().getFrequency())); -+ par1PlayerUsageSnooper.addData("display_type", this.fullscreen ? "fullscreen" : "windowed"); -+ par1PlayerUsageSnooper.addData("run_time", Long.valueOf((MinecraftServer.getSystemTimeMillis() - par1PlayerUsageSnooper.func_130105_g()) / 60L * 1000L)); -+ -+ if (this.theIntegratedServer != null && this.theIntegratedServer.getPlayerUsageSnooper() != null) { -+ par1PlayerUsageSnooper.addData("snooper_partner", this.theIntegratedServer.getPlayerUsageSnooper().getUniqueID()); - } -- - } - -- public void addServerTypeToSnooper(PlayerUsageSnooper var1) { -- var1.addData("opengl_version", GL11.glGetString(GL11.GL_VERSION)); -- var1.addData("opengl_vendor", GL11.glGetString(GL11.GL_VENDOR)); -- var1.addData("client_brand", ClientBrandRetriever.getClientModName()); -- var1.addData("launched_version", this.ab); -+ public void addServerTypeToSnooper(PlayerUsageSnooper par1PlayerUsageSnooper) { -+ par1PlayerUsageSnooper.addData("opengl_version", GL11.glGetString(GL11.GL_VERSION)); -+ par1PlayerUsageSnooper.addData("opengl_vendor", GL11.glGetString(GL11.GL_VENDOR)); -+ par1PlayerUsageSnooper.addData("client_brand", ClientBrandRetriever.getClientModName()); -+ par1PlayerUsageSnooper.addData("launched_version", this.launchedVersion); - ContextCapabilities var2 = GLContext.getCapabilities(); -- var1.addData("gl_caps[ARB_multitexture]", Boolean.valueOf(var2.GL_ARB_multitexture)); -- var1.addData("gl_caps[ARB_multisample]", Boolean.valueOf(var2.GL_ARB_multisample)); -- var1.addData("gl_caps[ARB_texture_cube_map]", Boolean.valueOf(var2.GL_ARB_texture_cube_map)); -- var1.addData("gl_caps[ARB_vertex_blend]", Boolean.valueOf(var2.GL_ARB_vertex_blend)); -- var1.addData("gl_caps[ARB_matrix_palette]", Boolean.valueOf(var2.GL_ARB_matrix_palette)); -- var1.addData("gl_caps[ARB_vertex_program]", Boolean.valueOf(var2.GL_ARB_vertex_program)); -- var1.addData("gl_caps[ARB_vertex_shader]", Boolean.valueOf(var2.GL_ARB_vertex_shader)); -- var1.addData("gl_caps[ARB_fragment_program]", Boolean.valueOf(var2.GL_ARB_fragment_program)); -- var1.addData("gl_caps[ARB_fragment_shader]", Boolean.valueOf(var2.GL_ARB_fragment_shader)); -- var1.addData("gl_caps[ARB_shader_objects]", Boolean.valueOf(var2.GL_ARB_shader_objects)); -- var1.addData("gl_caps[ARB_vertex_buffer_object]", Boolean.valueOf(var2.GL_ARB_vertex_buffer_object)); -- var1.addData("gl_caps[ARB_framebuffer_object]", Boolean.valueOf(var2.GL_ARB_framebuffer_object)); -- var1.addData("gl_caps[ARB_pixel_buffer_object]", Boolean.valueOf(var2.GL_ARB_pixel_buffer_object)); -- var1.addData("gl_caps[ARB_uniform_buffer_object]", Boolean.valueOf(var2.GL_ARB_uniform_buffer_object)); -- var1.addData("gl_caps[ARB_texture_non_power_of_two]", Boolean.valueOf(var2.GL_ARB_texture_non_power_of_two)); -- var1.addData("gl_caps[gl_max_vertex_uniforms]", Integer.valueOf(GL11.glGetInteger(GL20.GL_MAX_VERTEX_UNIFORM_COMPONENTS))); -- var1.addData("gl_caps[gl_max_fragment_uniforms]", Integer.valueOf(GL11.glGetInteger(GL20.GL_MAX_FRAGMENT_UNIFORM_COMPONENTS))); -- var1.addData("gl_max_texture_size", Integer.valueOf(getGLMaximumTextureSize())); -+ par1PlayerUsageSnooper.addData("gl_caps[ARB_multitexture]", Boolean.valueOf(var2.GL_ARB_multitexture)); -+ par1PlayerUsageSnooper.addData("gl_caps[ARB_multisample]", Boolean.valueOf(var2.GL_ARB_multisample)); -+ par1PlayerUsageSnooper.addData("gl_caps[ARB_texture_cube_map]", Boolean.valueOf(var2.GL_ARB_texture_cube_map)); -+ par1PlayerUsageSnooper.addData("gl_caps[ARB_vertex_blend]", Boolean.valueOf(var2.GL_ARB_vertex_blend)); -+ par1PlayerUsageSnooper.addData("gl_caps[ARB_matrix_palette]", Boolean.valueOf(var2.GL_ARB_matrix_palette)); -+ par1PlayerUsageSnooper.addData("gl_caps[ARB_vertex_program]", Boolean.valueOf(var2.GL_ARB_vertex_program)); -+ par1PlayerUsageSnooper.addData("gl_caps[ARB_vertex_shader]", Boolean.valueOf(var2.GL_ARB_vertex_shader)); -+ par1PlayerUsageSnooper.addData("gl_caps[ARB_fragment_program]", Boolean.valueOf(var2.GL_ARB_fragment_program)); -+ par1PlayerUsageSnooper.addData("gl_caps[ARB_fragment_shader]", Boolean.valueOf(var2.GL_ARB_fragment_shader)); -+ par1PlayerUsageSnooper.addData("gl_caps[ARB_shader_objects]", Boolean.valueOf(var2.GL_ARB_shader_objects)); -+ par1PlayerUsageSnooper.addData("gl_caps[ARB_vertex_buffer_object]", Boolean.valueOf(var2.GL_ARB_vertex_buffer_object)); -+ par1PlayerUsageSnooper.addData("gl_caps[ARB_framebuffer_object]", Boolean.valueOf(var2.GL_ARB_framebuffer_object)); -+ par1PlayerUsageSnooper.addData("gl_caps[ARB_pixel_buffer_object]", Boolean.valueOf(var2.GL_ARB_pixel_buffer_object)); -+ par1PlayerUsageSnooper.addData("gl_caps[ARB_uniform_buffer_object]", Boolean.valueOf(var2.GL_ARB_uniform_buffer_object)); -+ par1PlayerUsageSnooper.addData("gl_caps[ARB_texture_non_power_of_two]", Boolean.valueOf(var2.GL_ARB_texture_non_power_of_two)); -+ par1PlayerUsageSnooper.addData("gl_caps[gl_max_vertex_uniforms]", Integer.valueOf(GL11.glGetInteger(GL20.GL_MAX_VERTEX_UNIFORM_COMPONENTS))); -+ par1PlayerUsageSnooper.addData("gl_caps[gl_max_fragment_uniforms]", Integer.valueOf(GL11.glGetInteger(GL20.GL_MAX_FRAGMENT_UNIFORM_COMPONENTS))); -+ par1PlayerUsageSnooper.addData("gl_max_texture_size", Integer.valueOf(getGLMaximumTextureSize())); - } - -+ /** -+ * Used in the usage snooper. -+ */ - public static int getGLMaximumTextureSize() { -- for(int var0 = 16384; var0 > 0; var0 >>= 1) { -- GL11.glTexImage2D(GL11.GL_PROXY_TEXTURE_2D, 0, GL11.GL_RGBA, var0, var0, 0, GL11.GL_RGBA, GL11.GL_UNSIGNED_BYTE, (ByteBuffer)((ByteBuffer)null)); -+ for (int var0 = 16384; var0 > 0; var0 >>= 1) { -+ GL11.glTexImage2D(GL11.GL_PROXY_TEXTURE_2D, 0, GL11.GL_RGBA, var0, var0, 0, GL11.GL_RGBA, GL11.GL_UNSIGNED_BYTE, (ByteBuffer)null); - int var1 = GL11.glGetTexLevelParameteri(GL11.GL_PROXY_TEXTURE_2D, 0, GL11.GL_TEXTURE_WIDTH); -- if(var1 != 0) { -+ -+ if (var1 != 0) { - return var0; - } - } -@@ -1667,44 +2190,65 @@ - return -1; - } - -+ /** -+ * Returns whether snooping is enabled or not. -+ */ - public boolean isSnooperEnabled() { - return this.gameSettings.snooperEnabled; - } - -- public void setServerData(ServerData var1) { -- this.currentServerData = var1; -+ /** -+ * Set the current ServerData instance. -+ */ -+ public void setServerData(ServerData par1ServerData) { -+ this.currentServerData = par1ServerData; - } - - public boolean isIntegratedServerRunning() { - return this.integratedServerIsRunning; - } - -+ /** -+ * Returns true if there is only one player playing, and the current server is the integrated one. -+ */ - public boolean isSingleplayer() { - return this.integratedServerIsRunning && this.theIntegratedServer != null; - } - -+ /** -+ * Returns the currently running integrated server -+ */ - public IntegratedServer getIntegratedServer() { - return this.theIntegratedServer; - } - - public static void stopIntegratedServer() { -- if(theMinecraft != null) { -+ if (theMinecraft != null) { - IntegratedServer var0 = theMinecraft.getIntegratedServer(); -- if(var0 != null) { -+ -+ if (var0 != null) { - var0.stopServer(); - } -- - } - } - -+ /** -+ * Returns the PlayerUsageSnooper instance. -+ */ - public PlayerUsageSnooper getPlayerUsageSnooper() { - return this.usageSnooper; - } - -+ /** -+ * Gets the system time in milliseconds. -+ */ - public static long getSystemTime() { - return Sys.getTime() * 1000L / Sys.getTimerResolution(); - } - -+ /** -+ * Returns whether we're in full screen or not. -+ */ - public boolean isFullScreen() { - return this.fullscreen; - } -@@ -1718,7 +2262,7 @@ - } - - public Proxy getProxy() { -- return this.ac; -+ return this.proxy; - } - - public TextureManager getTextureManager() { -@@ -1737,11 +2281,17 @@ - return this.mcLanguageManager; - } - -- static String getLaunchedVersion(Minecraft var0) { -- return var0.ab; -- } -- -- static LanguageManager func_142024_b(Minecraft var0) { -- return var0.mcLanguageManager; -- } -+ static String getLaunchedVersion(Minecraft par0Minecraft) { -+ return par0Minecraft.launchedVersion; -+ } -+ -+ static LanguageManager func_142024_b(Minecraft par0Minecraft) { -+ return par0Minecraft.mcLanguageManager; -+ } -+ -+ // Spout Start -+ public boolean isMultiplayerWorld() { -+ return theWorld != null && theWorld.isRemote; -+ } -+ // Spout End - } ---- net/minecraft/src/LowerStringMap.java -+++ net/minecraft/src/LowerStringMap.java -@@ -8,63 +8,65 @@ - import java.util.Map.Entry; - - public class LowerStringMap implements Map { -- private final Map a = new LinkedHashMap(); -+ private final Map internalMap = new LinkedHashMap(); - - public int size() { -- return this.a.size(); -+ return this.internalMap.size(); - } - - public boolean isEmpty() { -- return this.a.isEmpty(); -- } -- -- public boolean containsKey(Object var1) { -- return this.a.containsKey(var1.toString().toLowerCase()); -- } -- -- public boolean containsValue(Object var1) { -- return this.a.containsKey(var1); -- } -- -- public Object get(Object var1) { -- return this.a.get(var1.toString().toLowerCase()); -- } -- -- public Object putLower(String var1, Object var2) { -- return this.a.put(var1.toLowerCase(), var2); -- } -- -- public Object remove(Object var1) { -- return this.a.remove(var1.toString().toLowerCase()); -- } -- -- public void putAll(Map var1) { -- Iterator var2 = var1.entrySet().iterator(); -- -- while(var2.hasNext()) { -+ return this.internalMap.isEmpty(); -+ } -+ -+ public boolean containsKey(Object par1Obj) { -+ return this.internalMap.containsKey(par1Obj.toString().toLowerCase()); -+ } -+ -+ public boolean containsValue(Object par1Obj) { -+ return this.internalMap.containsKey(par1Obj); -+ } -+ -+ public Object get(Object par1Obj) { -+ return this.internalMap.get(par1Obj.toString().toLowerCase()); -+ } -+ -+ /** -+ * a map already defines a general put -+ */ -+ public Object putLower(String par1Str, Object par2Obj) { -+ return this.internalMap.put(par1Str.toLowerCase(), par2Obj); -+ } -+ -+ public Object remove(Object par1Obj) { -+ return this.internalMap.remove(par1Obj.toString().toLowerCase()); -+ } -+ -+ public void putAll(Map par1Map) { -+ Iterator var2 = par1Map.entrySet().iterator(); -+ -+ while (var2.hasNext()) { - Entry var3 = (Entry)var2.next(); - this.putLower((String)var3.getKey(), var3.getValue()); - } -- - } - - public void clear() { -- this.a.clear(); -+ this.internalMap.clear(); - } - - public Set keySet() { -- return this.a.keySet(); -+ return this.internalMap.keySet(); - } - - public Collection values() { -- return this.a.values(); -+ return this.internalMap.values(); - } - - public Set entrySet() { -- return this.a.entrySet(); -+ return this.internalMap.entrySet(); - } - -- public Object put(Object var1, Object var2) { -- return this.putLower((String)var1, var2); -+ public Object put(Object par1Obj, Object par2Obj) { -+ return this.putLower((String)par1Obj, par2Obj); - } - } ---- /dev/null -+++ org/spoutcraft/client/gui/server/GuiStaticServerList.java -@@ -1,0 +1,301 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.client.gui.server; -+ -+import net.minecraft.src.GuiScreen; -+ -+import org.lwjgl.Sys; -+ -+import org.spoutcraft.api.gui.Button; -+import org.spoutcraft.api.gui.Color; -+import org.spoutcraft.api.gui.GenericButton; -+import org.spoutcraft.api.gui.GenericLabel; -+import org.spoutcraft.api.gui.GenericTextField; -+import org.spoutcraft.api.gui.Keyboard; -+import org.spoutcraft.api.gui.TextField; -+import org.spoutcraft.api.gui.GenericListView; -+import org.spoutcraft.client.SpoutClient; -+ -+public class GuiStaticServerList extends GuiScreen { -+ private GuiScreen parent; -+ -+ // GUI stuff -+ private Button buttonJoin, buttonAdd, buttonDelete, buttonEdit, buttonMainMenu, buttonFavoritesList, buttonClear, buttonQuickJoin, buttonMoveUp, buttonMoveDown, buttonRefresh,buttonAddServer, buttonAddtoFavorites; -+ private GenericLabel labelTitle; -+ private TextField textQuickJoin; -+ private GenericListView view; -+ public ServerModel model = SpoutClient.getInstance().getServerManager().getStaticServerList(); -+ private long pollTime = 0L; -+ -+ public GuiStaticServerList(GuiScreen parent) { -+ this.parent = parent; -+ model.setStaticServerGUI(this); -+ } -+ -+ @Override -+ public void initGui() { -+ labelTitle = new GenericLabel("Public Servers"); -+ labelTitle.setY(12).setX(width / 2 - mc.fontRenderer.getStringWidth(labelTitle.getText()) / 2); -+ labelTitle.setHeight(15).setWidth(mc.fontRenderer.getStringWidth(labelTitle.getText()) / 2); -+ getScreen().attachWidget("Spoutcraft", labelTitle); -+ -+ buttonMoveUp = new GenericButton("/\\"); -+ buttonMoveUp.setTooltip("Move Item Up"); -+ buttonMoveUp.setX(5).setY(5); -+ buttonMoveUp.setHeight(20).setWidth(20); -+ getScreen().attachWidget("Spoutcraft", buttonMoveUp); -+ -+ buttonMoveDown = new GenericButton("\\/"); -+ buttonMoveDown.setTooltip("Move Item Down"); -+ buttonMoveDown.setX(25).setY(5); -+ buttonMoveDown.setHeight(20).setWidth(20); -+ getScreen().attachWidget("Spoutcraft", buttonMoveDown); -+ -+ buttonRefresh = new GenericButton("Refresh"); -+ buttonRefresh.setHeight(20).setWidth(100).setX(width - 105).setY(5); -+ getScreen().attachWidget("Spoutcraft", buttonRefresh); -+ -+ int viewheight = height - 110; -+ view = new GenericListView(model); -+ view.setX(5).setY(30).setWidth(width - 10).setHeight(viewheight); -+ getScreen().attachWidget("Spoutcraft", view); -+ -+ int top = (int) (view.getY() + view.getHeight() + 5); -+ -+ int totalWidth = Math.min(width - 9, 200 * 3 + 10); -+ int cellWidth = (totalWidth - 10) / 3; -+ int left = width / 2 - totalWidth / 2; -+ int center = left + cellWidth + 5; -+ int right = center + cellWidth + 5; -+ -+ String text = SpoutClient.getHandle().gameSettings.lastServer.replace("_", ":"); -+ if (textQuickJoin != null) { -+ text = textQuickJoin.getText(); -+ } -+ textQuickJoin = new QuickJoin(); -+ textQuickJoin.setX(left + 2).setY(top + 2).setHeight(16).setWidth((cellWidth * 2 + 5 - 4) - (cellWidth/2)); -+ textQuickJoin.setMaximumCharacters(0); -+ textQuickJoin.setText(text); -+ getScreen().attachWidget("Spoutcraft", textQuickJoin); -+ -+ buttonClear = new GenericButton("Clear"); -+ buttonClear.setX(left + 10 + (cellWidth*2) - (cellWidth/2)).setY(top).setWidth((cellWidth/2) - 5).setHeight(20); -+ getScreen().attachWidget("Spoutcraft", buttonClear); -+ -+ buttonQuickJoin = new GenericButton("Quick Join"); -+ buttonQuickJoin.setX(right).setY(top).setWidth(cellWidth).setHeight(20); -+ getScreen().attachWidget("Spoutcraft", buttonQuickJoin); -+ -+ top += 25; -+ -+ buttonJoin = new GenericButton("Join Server"); -+ buttonJoin.setX(right).setY(top).setWidth(cellWidth).setHeight(20); -+ getScreen().attachWidget("Spoutcraft", buttonJoin); -+ -+ buttonAddtoFavorites = new GenericButton("Add this to Favorites"); -+ buttonAddtoFavorites.setX(center).setY(top).setWidth(cellWidth).setHeight(20); -+ getScreen().attachWidget("Spoutcraft", buttonAddtoFavorites); -+ -+ top += 25; -+ buttonAddServer = new GenericButton("Add Your Server"); -+ buttonAddServer.setX(left).setY(top).setWidth(cellWidth).setHeight(20); -+ getScreen().attachWidget("Spoutcraft", buttonAddServer); -+ -+ buttonFavoritesList = new GenericButton("Favorites"); -+ buttonFavoritesList.setX(center).setY(top).setWidth(cellWidth) -+ .setHeight(20); -+ getScreen().attachWidget("Spoutcraft", buttonFavoritesList); -+ -+ buttonMainMenu = new GenericButton("Main Menu"); -+ buttonMainMenu.setX(right).setY(top).setWidth(cellWidth).setHeight(20); -+ getScreen().attachWidget("Spoutcraft", buttonMainMenu); -+ refresh(); -+ updateButtons(); -+ } -+ -+ private class QuickJoin extends GenericTextField { -+ @Override -+ public boolean onKeyPressed(Keyboard key) { -+ if (key == Keyboard.KEY_RETURN && buttonQuickJoin.isEnabled()) { -+ doQuickJoin(); -+ return true; -+ } else { -+ buttonQuickJoin.setEnabled(textQuickJoin.getText().length() > 0); -+ } -+ return false; -+ } -+ } -+ -+ @Override -+ public void drawScreen(int var1, int var2, float var3) { -+ drawDefaultBackground(); -+ } -+ -+ @Override -+ public void buttonClicked(Button btn) { -+ if (btn.equals(buttonMainMenu)) { -+ SpoutClient.getHandle().displayGuiScreen(new org.spoutcraft.client.gui.mainmenu.MainMenu()); -+ } -+ if (btn.equals(buttonAddServer)) { -+ Sys.openURL("http://spoutcraft.org/resources/categories/servers.7/"); -+ } -+ if (btn.equals(buttonFavoritesList)) { -+ SpoutClient.getHandle().displayGuiScreen(new GuiFavorites(this)); -+ } -+ -+ if (btn.equals(buttonClear)) { -+ textQuickJoin.setText(""); -+ } -+ -+ if (btn.equals(buttonQuickJoin)) { -+ doQuickJoin(); -+ } -+ -+ if (btn.equals(buttonAddtoFavorites)) { -+ ServerItem item = null; -+ if (view.getSelectedRow() > -1) { -+ item = (ServerItem) model.getItem(view.getSelectedRow()); -+ } -+ if (item != null) { -+ SpoutClient.getInstance().getServerManager().getFavorites().addServer(item); -+ SpoutClient.getInstance().getServerManager().getFavorites().save(); -+ SpoutClient.getHandle().displayGuiScreen(new GuiFavorites(this)); -+ } -+ } -+ -+ if (btn.equals(buttonJoin)) { -+ ServerItem item = null; -+ if (view.getSelectedRow() > -1) { -+ item = (ServerItem) model.getItem(view.getSelectedRow()); -+ } -+ if (item != null) { -+ SpoutClient.getInstance().getServerManager().join(item, this, "Favorites"); -+ } else { -+ // Just in case something weird happens -+ updateButtons(); -+ } -+ } -+ StaticServerModel sslist = null; -+ if (model instanceof StaticServerModel) { -+ sslist = (StaticServerModel) model; -+ } -+ if (btn.equals(buttonMoveUp) && sslist != null) { -+ if (view.getSelectedRow() != -1) { -+ sslist.move(view.getSelectedRow(), view.getSelectedRow() - 1); -+ view.shiftSelection(-1); -+ sslist.save(); -+ } -+ } -+ if (btn.equals(buttonMoveDown) && sslist != null) { -+ if (view.getSelectedRow() != -1) { -+ sslist.move(view.getSelectedRow(), view.getSelectedRow() + 1); -+ view.shiftSelection(1); -+ sslist.save(); -+ } -+ } -+ if (btn.equals(buttonRefresh)) { -+ refresh(); -+ } -+ } -+ -+ public void refresh() { -+ pollTime = System.currentTimeMillis(); -+ for (int i = 0; i < model.getSize(); i++) { -+ ServerItem item = (ServerItem) model.getItem(i); -+ item.poll(); -+ } -+ } -+ -+ public void doQuickJoin() { -+ try { -+ String adress = textQuickJoin.getText(); -+ if (!adress.isEmpty()) { -+ String split[] = adress.split(":"); -+ String ip = split[0]; -+ int port = split.length > 1 ? Integer.parseInt(split[1]) : ServerItem.DEFAULT_PORT; -+ SpoutClient.getHandle().gameSettings.lastServer = adress.replace(":", "_"); -+ SpoutClient.getHandle().gameSettings.saveOptions(); -+ SpoutClient.getInstance().getServerManager().join(ip, port, this, "Favorites"); -+ } -+ } catch (Exception e) { -+ } -+ } -+ -+ public void updateButtons() { -+ boolean enable = true; -+ -+ if (view != null && view.getSelectedRow() == -1) { -+ enable = false; -+ } -+ -+ // GUI has not been initialized -+ if (buttonJoin == null) { -+ return; -+ } -+ -+ buttonJoin.setEnabled(enable); -+ buttonMoveDown.setEnabled(enable); -+ buttonMoveUp.setEnabled(enable); -+ buttonAddtoFavorites.setEnabled(enable); -+ -+ if (model.isPolling()) { -+ buttonRefresh.setEnabled(false); -+ buttonRefresh.setText("Polling..."); -+ buttonRefresh.setDisabledColor(new Color(0f, 0f, 1f)); -+ } else { -+ buttonRefresh.setEnabled(true); -+ buttonRefresh.setText("Refresh"); -+ } -+ -+ if (view.getSelectedItem() instanceof ServerItem) { -+ ServerItem item = (ServerItem) view.getSelectedItem(); -+ buttonJoin.setEnabled(item.isCompatible(SpoutClient.spoutcraftVersion)); -+ buttonAddtoFavorites.setEnabled(true); -+ } -+ } -+ -+ @Override -+ public void updateScreen() { -+ if (model.isPolling()) { -+ Color color = new Color(0, 0f, 0); -+ double darkness = 0; -+ long t = System.currentTimeMillis() % 1000; -+ darkness = Math.cos(t * 2 * Math.PI / 1000) * 0.2 + 0.2; -+ color.setBlue(1f - (float) darkness); -+ if (model.isPolling()) { -+ buttonRefresh.setDisabledColor(color); -+ } -+ -+ // If polling locks up and takes > 15s, unlock the button -+ if (pollTime + 15000L < System.currentTimeMillis()) { -+ for (int i = 0; i < model.getSize(); i++) { -+ ServerItem item = (ServerItem) model.getItem(i); -+ if (item.isPolling()) { -+ item.endPolling(); -+ } -+ } -+ model.setPolling(false); -+ } -+ } -+ buttonClear.setEnabled(textQuickJoin.getText().length() > 0); -+ buttonQuickJoin.setEnabled(textQuickJoin.getText().length() > 0); -+ super.updateScreen(); -+ } -+} ---- net/minecraft/src/EntityAIFollowGolem.java -+++ net/minecraft/src/EntityAIFollowGolem.java -@@ -9,26 +9,31 @@ - private int takeGolemRoseTick; - private boolean tookGolemRose; - -- public EntityAIFollowGolem(EntityVillager var1) { -- this.theVillager = var1; -+ public EntityAIFollowGolem(EntityVillager par1EntityVillager) { -+ this.theVillager = par1EntityVillager; - this.setMutexBits(3); - } - -+ /** -+ * Returns whether the EntityAIBase should begin execution. -+ */ - public boolean shouldExecute() { -- if(this.theVillager.getGrowingAge() >= 0) { -+ if (this.theVillager.getGrowingAge() >= 0) { - return false; -- } else if(!this.theVillager.worldObj.isDaytime()) { -+ } else if (!this.theVillager.worldObj.isDaytime()) { - return false; - } else { - List var1 = this.theVillager.worldObj.getEntitiesWithinAABB(EntityIronGolem.class, this.theVillager.boundingBox.expand(6.0D, 2.0D, 6.0D)); -- if(var1.isEmpty()) { -+ -+ if (var1.isEmpty()) { - return false; - } else { - Iterator var2 = var1.iterator(); - -- while(var2.hasNext()) { -+ while (var2.hasNext()) { - EntityIronGolem var3 = (EntityIronGolem)var2.next(); -- if(var3.getHoldRoseTick() > 0) { -+ -+ if (var3.getHoldRoseTick() > 0) { - this.theGolem = var3; - break; - } -@@ -39,32 +44,44 @@ - } - } - -+ /** -+ * Returns whether an in-progress EntityAIBase should continue executing -+ */ - public boolean continueExecuting() { - return this.theGolem.getHoldRoseTick() > 0; - } - -+ /** -+ * Execute a one shot task or start executing a continuous task -+ */ - public void startExecuting() { - this.takeGolemRoseTick = this.theVillager.getRNG().nextInt(320); - this.tookGolemRose = false; - this.theGolem.getNavigator().clearPathEntity(); - } - -+ /** -+ * Resets the task -+ */ - public void resetTask() { - this.theGolem = null; - this.theVillager.getNavigator().clearPathEntity(); - } - -+ /** -+ * Updates the task -+ */ - public void updateTask() { - this.theVillager.getLookHelper().setLookPositionWithEntity(this.theGolem, 30.0F, 30.0F); -- if(this.theGolem.getHoldRoseTick() == this.takeGolemRoseTick) { -+ -+ if (this.theGolem.getHoldRoseTick() == this.takeGolemRoseTick) { - this.theVillager.getNavigator().tryMoveToEntityLiving(this.theGolem, 0.5D); - this.tookGolemRose = true; - } - -- if(this.tookGolemRose && this.theVillager.getDistanceSqToEntity(this.theGolem) < 4.0D) { -+ if (this.tookGolemRose && this.theVillager.getDistanceSqToEntity(this.theGolem) < 4.0D) { - this.theGolem.setHoldingRose(false); - this.theVillager.getNavigator().clearPathEntity(); - } -- - } - } ---- net/minecraft/src/TileEntityComparator.java -+++ net/minecraft/src/TileEntityComparator.java -@@ -3,21 +3,27 @@ - public class TileEntityComparator extends TileEntity { - private int outputSignal; - -- public void writeToNBT(NBTTagCompound var1) { -- super.writeToNBT(var1); -- var1.setInteger("OutputSignal", this.outputSignal); -+ /** -+ * Writes a tile entity to NBT. -+ */ -+ public void writeToNBT(NBTTagCompound par1NBTTagCompound) { -+ super.writeToNBT(par1NBTTagCompound); -+ par1NBTTagCompound.setInteger("OutputSignal", this.outputSignal); - } - -- public void readFromNBT(NBTTagCompound var1) { -- super.readFromNBT(var1); -- this.outputSignal = var1.getInteger("OutputSignal"); -+ /** -+ * Reads a tile entity from NBT. -+ */ -+ public void readFromNBT(NBTTagCompound par1NBTTagCompound) { -+ super.readFromNBT(par1NBTTagCompound); -+ this.outputSignal = par1NBTTagCompound.getInteger("OutputSignal"); - } - - public int getOutputSignal() { - return this.outputSignal; - } - -- public void setOutputSignal(int var1) { -- this.outputSignal = var1; -+ public void setOutputSignal(int par1) { -+ this.outputSignal = par1; - } - } ---- net/minecraft/src/BlockSand.java -+++ net/minecraft/src/BlockSand.java -@@ -3,68 +3,91 @@ - import java.util.Random; - - public class BlockSand extends Block { -+ -+ /** Do blocks fall instantly to where they stop or do they fall over time */ - public static boolean fallInstantly; - -- public BlockSand(int var1) { -- super(var1, Material.sand); -+ public BlockSand(int par1) { -+ super(par1, Material.sand); - this.setCreativeTab(CreativeTabs.tabBlock); - } - -- public BlockSand(int var1, Material var2) { -- super(var1, var2); -- } -- -- public void onBlockAdded(World var1, int var2, int var3, int var4) { -- var1.scheduleBlockUpdate(var2, var3, var4, this.blockID, this.tickRate(var1)); -- } -- -- public void onNeighborBlockChange(World var1, int var2, int var3, int var4, int var5) { -- var1.scheduleBlockUpdate(var2, var3, var4, this.blockID, this.tickRate(var1)); -- } -- -- public void updateTick(World var1, int var2, int var3, int var4, Random var5) { -- if(!var1.isRemote) { -- this.tryToFall(var1, var2, var3, var4); -+ public BlockSand(int par1, Material par2Material) { -+ super(par1, par2Material); -+ } -+ -+ /** -+ * Called whenever the block is added into the world. Args: world, x, y, z -+ */ -+ public void onBlockAdded(World par1World, int par2, int par3, int par4) { -+ par1World.scheduleBlockUpdate(par2, par3, par4, this.blockID, this.tickRate(par1World)); -+ } -+ -+ /** -+ * Lets the block know when one of its neighbor changes. Doesn't know which neighbor changed (coordinates passed are -+ * their own) Args: x, y, z, neighbor blockID -+ */ -+ public void onNeighborBlockChange(World par1World, int par2, int par3, int par4, int par5) { -+ par1World.scheduleBlockUpdate(par2, par3, par4, this.blockID, this.tickRate(par1World)); -+ } -+ -+ /** -+ * Ticks the block if it's been scheduled -+ */ -+ public void updateTick(World par1World, int par2, int par3, int par4, Random par5Random) { -+ if (!par1World.isRemote) { -+ this.tryToFall(par1World, par2, par3, par4); - } -- - } - -- private void tryToFall(World var1, int var2, int var3, int var4) { -- if(canFallBelow(var1, var2, var3 - 1, var4) && var3 >= 0) { -+ /** -+ * If there is space to fall below will start this block falling -+ */ -+ private void tryToFall(World par1World, int par2, int par3, int par4) { -+ if (canFallBelow(par1World, par2, par3 - 1, par4) && par3 >= 0) { - byte var8 = 32; -- if(!fallInstantly && var1.checkChunksExist(var2 - var8, var3 - var8, var4 - var8, var2 + var8, var3 + var8, var4 + var8)) { -- if(!var1.isRemote) { -- EntityFallingSand var9 = new EntityFallingSand(var1, (double)((float)var2 + 0.5F), (double)((float)var3 + 0.5F), (double)((float)var4 + 0.5F), this.blockID, var1.getBlockMetadata(var2, var3, var4)); -+ -+ if (!fallInstantly && par1World.checkChunksExist(par2 - var8, par3 - var8, par4 - var8, par2 + var8, par3 + var8, par4 + var8)) { -+ if (!par1World.isRemote) { -+ EntityFallingSand var9 = new EntityFallingSand(par1World, (double)((float)par2 + 0.5F), (double)((float)par3 + 0.5F), (double)((float)par4 + 0.5F), this.blockID, par1World.getBlockMetadata(par2, par3, par4)); - this.onStartFalling(var9); -- var1.spawnEntityInWorld(var9); -+ par1World.spawnEntityInWorld(var9); - } - } else { -- var1.setBlockToAir(var2, var3, var4); -+ par1World.setBlockToAir(par2, par3, par4); - -- while(canFallBelow(var1, var2, var3 - 1, var4) && var3 > 0) { -- --var3; -+ while (canFallBelow(par1World, par2, par3 - 1, par4) && par3 > 0) { -+ --par3; - } - -- if(var3 > 0) { -- var1.setBlock(var2, var3, var4, this.blockID); -+ if (par3 > 0) { -+ par1World.setBlock(par2, par3, par4, this.blockID); - } - } - } -- -- } -- -- protected void onStartFalling(EntityFallingSand var1) { -- } -- -- public int tickRate(World var1) { -+ } -+ -+ /** -+ * Called when the falling block entity for this block is created -+ */ -+ protected void onStartFalling(EntityFallingSand par1EntityFallingSand) {} -+ -+ /** -+ * How many world ticks before ticking -+ */ -+ public int tickRate(World par1World) { - return 2; - } - -- public static boolean canFallBelow(World var0, int var1, int var2, int var3) { -- int var4 = var0.getBlockId(var1, var2, var3); -- if(var4 == 0) { -+ /** -+ * Checks to see if the sand can fall into the block below it -+ */ -+ public static boolean canFallBelow(World par0World, int par1, int par2, int par3) { -+ int var4 = par0World.getBlockId(par1, par2, par3); -+ -+ if (var4 == 0) { - return true; -- } else if(var4 == Block.fire.blockID) { -+ } else if (var4 == Block.fire.blockID) { - return true; - } else { - Material var5 = Block.blocksList[var4].blockMaterial; -@@ -72,6 +95,8 @@ - } - } - -- public void onFinishFalling(World var1, int var2, int var3, int var4, int var5) { -- } -+ /** -+ * Called when the falling block entity for this block hits the ground and turns back into a block -+ */ -+ public void onFinishFalling(World par1World, int par2, int par3, int par4, int par5) {} - } ---- /dev/null -+++ org/spoutcraft/client/player/SimpleBiomeManager.java -@@ -1,0 +1,98 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.client.player; -+ -+import java.util.ArrayList; -+import java.util.HashMap; -+import java.util.List; -+ -+import org.spoutcraft.api.player.BiomeManager; -+ -+public class SimpleBiomeManager implements BiomeManager { -+ private HashMap changedSnow = new HashMap(); -+ private HashMap changedRain = new HashMap(); -+ private List defaultSnow = new ArrayList(); -+ private List defaultRain = new ArrayList(); -+ -+ public SimpleBiomeManager() { -+ defaultSnow.add("Tundra"); -+ defaultSnow.add("Taiga"); -+ defaultSnow.add("Ice Desert"); -+ -+ defaultRain.add("Desert"); -+ defaultRain.add("Ice Desert"); -+ defaultRain.add("Hell"); -+ defaultRain.add("Sky"); -+ } -+ -+ public void setSnowEnabled(String biome, boolean bool) { -+ changedSnow.put(biome, bool); -+ } -+ -+ public void setRainEnabled(String biome, boolean bool) { -+ changedRain.put(biome, bool); -+ } -+ -+ public boolean getSnowChanged(String biome) { -+ boolean bool = false; -+ if (changedSnow.containsKey(biome)) { -+ bool = true; -+ } -+ -+ return bool; -+ } -+ -+ public boolean getRainChanged(String biome) { -+ boolean bool = false; -+ if (changedRain.containsKey(biome)) { -+ bool = true; -+ } -+ -+ return bool; -+ } -+ -+ public boolean getSnowEnabled(String biome) { -+ boolean bool = false; -+ bool = changedSnow.get(biome); -+ -+ return bool; -+ } -+ -+ public boolean getRainEnabled(String biome) { -+ boolean bool = false; -+ bool = changedRain.get(biome); -+ -+ return bool; -+ } -+ -+ public void resetWeather(String biome) { -+ if (defaultSnow.contains(biome)) { -+ changedSnow.put(biome, true); -+ } else { -+ changedSnow.put(biome,false); -+ } -+ -+ if (defaultRain.contains(biome)) { -+ changedRain.put(biome, false); -+ } else { -+ changedRain.put(biome,true); -+ } -+ } -+} ---- net/minecraft/src/TextureClock.java -+++ net/minecraft/src/TextureClock.java -@@ -1,38 +1,45 @@ - package net.minecraft.src; - -+import com.prupe.mcpatcher.hd.FancyDial; -+ - public class TextureClock extends TextureAtlasSprite { -- private double field_94239_h; -+ public double field_94239_h; - private double field_94240_i; - -- public TextureClock(String var1) { -- super(var1); -+ public TextureClock(String par1Str) { -+ super(par1Str); -+ FancyDial.setup(this); - } - - public void updateAnimation() { -- if(!this.a.isEmpty()) { -+ if (!this.framesTextureData.isEmpty()) { - Minecraft var1 = Minecraft.getMinecraft(); - double var2 = 0.0D; -- if(var1.theWorld != null && var1.thePlayer != null) { -+ -+ if (var1.theWorld != null && var1.thePlayer != null) { - float var4 = var1.theWorld.getCelestialAngle(1.0F); - var2 = (double)var4; -- if(!var1.theWorld.provider.isSurfaceWorld()) { -+ -+ if (!var1.theWorld.provider.isSurfaceWorld()) { - var2 = Math.random(); - } - } - - double var7; -- for(var7 = var2 - this.field_94239_h; var7 < -0.5D; ++var7) { -+ -+ for (var7 = var2 - this.field_94239_h; var7 < -0.5D; ++var7) { -+ ; - } - -- while(var7 >= 0.5D) { -+ while (var7 >= 0.5D) { - --var7; - } - -- if(var7 < -1.0D) { -+ if (var7 < -1.0D) { - var7 = -1.0D; - } - -- if(var7 > 1.0D) { -+ if (var7 > 1.0D) { - var7 = 1.0D; - } - -@@ -40,15 +47,18 @@ - this.field_94240_i *= 0.8D; - this.field_94239_h += this.field_94240_i; - -- int var6; -- for(var6 = (int)((this.field_94239_h + 1.0D) * (double)this.a.size()) % this.a.size(); var6 < 0; var6 = (var6 + this.a.size()) % this.a.size()) { -- } -- -- if(var6 != this.frameCounter) { -- this.frameCounter = var6; -- TextureUtil.uploadTextureSub((int[])this.a.get(this.frameCounter), this.width, this.height, this.originX, this.originY, false, false); -- } -- -+ if (!FancyDial.update(this, false)) { -+ int var6; -+ -+ for (var6 = (int)((this.field_94239_h + 1.0D) * (double)this.framesTextureData.size()) % this.framesTextureData.size(); var6 < 0; var6 = (var6 + this.framesTextureData.size()) % this.framesTextureData.size()) { -+ ; -+ } -+ -+ if (var6 != this.frameCounter) { -+ this.frameCounter = var6; -+ TextureUtil.uploadTextureSub((int[])this.framesTextureData.get(this.frameCounter), this.width, this.height, this.originX, this.originY, false, false); -+ } -+ } - } - } - } ---- net/minecraft/src/SlotBeacon.java -+++ net/minecraft/src/SlotBeacon.java -@@ -1,17 +1,26 @@ - package net.minecraft.src; - - class SlotBeacon extends Slot { -+ -+ /** The beacon this slot belongs to. */ - final ContainerBeacon beacon; - -- public SlotBeacon(ContainerBeacon var1, IInventory var2, int var3, int var4, int var5) { -- super(var2, var3, var4, var5); -- this.beacon = var1; -- } -- -- public boolean isItemValid(ItemStack var1) { -- return var1 == null ? false : var1.itemID == Item.emerald.itemID || var1.itemID == Item.diamond.itemID || var1.itemID == Item.ingotGold.itemID || var1.itemID == Item.ingotIron.itemID; -- } -- -+ public SlotBeacon(ContainerBeacon par1ContainerBeacon, IInventory par2IInventory, int par3, int par4, int par5) { -+ super(par2IInventory, par3, par4, par5); -+ this.beacon = par1ContainerBeacon; -+ } -+ -+ /** -+ * Check if the stack is a valid item for this slot. Always true beside for the armor slots. -+ */ -+ public boolean isItemValid(ItemStack par1ItemStack) { -+ return par1ItemStack == null ? false : par1ItemStack.itemID == Item.emerald.itemID || par1ItemStack.itemID == Item.diamond.itemID || par1ItemStack.itemID == Item.ingotGold.itemID || par1ItemStack.itemID == Item.ingotIron.itemID; -+ } -+ -+ /** -+ * Returns the maximum stack size for a given slot (usually the same as getInventoryStackLimit(), but 1 in the case of -+ * armor slots) -+ */ - public int getSlotStackLimit() { - return 1; - } ---- /dev/null -+++ com/prupe/mcpatcher/MCLogger$1$1.java -@@ -1,0 +1,31 @@ -+package com.prupe.mcpatcher; -+ -+import com.prupe.mcpatcher.MCLogger$1; -+import java.util.logging.Formatter; -+import java.util.logging.Level; -+import java.util.logging.LogRecord; -+ -+class MCLogger$1$1 extends Formatter { -+ final MCLogger$1 this$1; -+ -+ MCLogger$1$1(MCLogger$1 var1) { -+ this.this$1 = var1; -+ } -+ -+ public String format(LogRecord record) { -+ Level level = record.getLevel(); -+ -+ if (level == Level.CONFIG) { -+ return record.getMessage(); -+ } else { -+ String message = record.getMessage(); -+ String prefix; -+ -+ for (prefix = ""; message.startsWith("\n"); message = message.substring(1)) { -+ prefix = prefix + "\n"; -+ } -+ -+ return prefix + "[" + MCLogger.access$000(this.this$1.this$0) + "] " + level.toString() + ": " + message; -+ } -+ } -+} ---- net/minecraft/src/ComponentVillageHouse2.java -+++ net/minecraft/src/ComponentVillageHouse2.java -@@ -4,108 +4,119 @@ - import java.util.Random; - - public class ComponentVillageHouse2 extends ComponentVillage { -- private static final WeightedRandomChestContent[] villageBlacksmithChestContents = new WeightedRandomChestContent[]{new WeightedRandomChestContent(Item.diamond.itemID, 0, 1, 3, 3), new WeightedRandomChestContent(Item.ingotIron.itemID, 0, 1, 5, 10), new WeightedRandomChestContent(Item.ingotGold.itemID, 0, 1, 3, 5), new WeightedRandomChestContent(Item.bread.itemID, 0, 1, 3, 15), new WeightedRandomChestContent(Item.appleRed.itemID, 0, 1, 3, 15), new WeightedRandomChestContent(Item.pickaxeIron.itemID, 0, 1, 1, 5), new WeightedRandomChestContent(Item.swordIron.itemID, 0, 1, 1, 5), new WeightedRandomChestContent(Item.plateIron.itemID, 0, 1, 1, 5), new WeightedRandomChestContent(Item.helmetIron.itemID, 0, 1, 1, 5), new WeightedRandomChestContent(Item.legsIron.itemID, 0, 1, 1, 5), new WeightedRandomChestContent(Item.bootsIron.itemID, 0, 1, 1, 5), new WeightedRandomChestContent(Block.obsidian.blockID, 0, 3, 7, 5), new WeightedRandomChestContent(Block.sapling.blockID, 0, 3, 7, 5), new WeightedRandomChestContent(Item.saddle.itemID, 0, 1, 1, 3), new WeightedRandomChestContent(Item.horseArmorIron.itemID, 0, 1, 1, 1), new WeightedRandomChestContent(Item.horseArmorGold.itemID, 0, 1, 1, 1), new WeightedRandomChestContent(Item.horseArmorDiamond.itemID, 0, 1, 1, 1)}; -+ -+ /** List of items that Village's Blacksmith chest can contain. */ -+ private static final WeightedRandomChestContent[] villageBlacksmithChestContents = new WeightedRandomChestContent[] {new WeightedRandomChestContent(Item.diamond.itemID, 0, 1, 3, 3), new WeightedRandomChestContent(Item.ingotIron.itemID, 0, 1, 5, 10), new WeightedRandomChestContent(Item.ingotGold.itemID, 0, 1, 3, 5), new WeightedRandomChestContent(Item.bread.itemID, 0, 1, 3, 15), new WeightedRandomChestContent(Item.appleRed.itemID, 0, 1, 3, 15), new WeightedRandomChestContent(Item.pickaxeIron.itemID, 0, 1, 1, 5), new WeightedRandomChestContent(Item.swordIron.itemID, 0, 1, 1, 5), new WeightedRandomChestContent(Item.plateIron.itemID, 0, 1, 1, 5), new WeightedRandomChestContent(Item.helmetIron.itemID, 0, 1, 1, 5), new WeightedRandomChestContent(Item.legsIron.itemID, 0, 1, 1, 5), new WeightedRandomChestContent(Item.bootsIron.itemID, 0, 1, 1, 5), new WeightedRandomChestContent(Block.obsidian.blockID, 0, 3, 7, 5), new WeightedRandomChestContent(Block.sapling.blockID, 0, 3, 7, 5), new WeightedRandomChestContent(Item.saddle.itemID, 0, 1, 1, 3), new WeightedRandomChestContent(Item.horseArmorIron.itemID, 0, 1, 1, 1), new WeightedRandomChestContent(Item.horseArmorGold.itemID, 0, 1, 1, 1), new WeightedRandomChestContent(Item.horseArmorDiamond.itemID, 0, 1, 1, 1)}; - private boolean hasMadeChest; - -- public ComponentVillageHouse2() { -- } -- -- public ComponentVillageHouse2(ComponentVillageStartPiece var1, int var2, Random var3, StructureBoundingBox var4, int var5) { -- super(var1, var2); -- this.coordBaseMode = var5; -- this.boundingBox = var4; -- } -- -- public static ComponentVillageHouse2 func_74915_a(ComponentVillageStartPiece var0, List var1, Random var2, int var3, int var4, int var5, int var6, int var7) { -- StructureBoundingBox var8 = StructureBoundingBox.getComponentToAddBoundingBox(var3, var4, var5, 0, 0, 0, 10, 6, 7, var6); -- return canVillageGoDeeper(var8) && StructureComponent.findIntersecting(var1, var8) == null ? new ComponentVillageHouse2(var0, var7, var2, var8, var6) : null; -- } -- -- protected void func_143012_a(NBTTagCompound var1) { -- super.func_143012_a(var1); -- var1.setBoolean("Chest", this.hasMadeChest); -- } -- -- protected void func_143011_b(NBTTagCompound var1) { -- super.func_143011_b(var1); -- this.hasMadeChest = var1.getBoolean("Chest"); -- } -- -- public boolean addComponentParts(World var1, Random var2, StructureBoundingBox var3) { -- if(this.field_143015_k < 0) { -- this.field_143015_k = this.getAverageGroundLevel(var1, var3); -- if(this.field_143015_k < 0) { -+ public ComponentVillageHouse2() {} -+ -+ public ComponentVillageHouse2(ComponentVillageStartPiece par1ComponentVillageStartPiece, int par2, Random par3Random, StructureBoundingBox par4StructureBoundingBox, int par5) { -+ super(par1ComponentVillageStartPiece, par2); -+ this.coordBaseMode = par5; -+ this.boundingBox = par4StructureBoundingBox; -+ } -+ -+ public static ComponentVillageHouse2 func_74915_a(ComponentVillageStartPiece par0ComponentVillageStartPiece, List par1List, Random par2Random, int par3, int par4, int par5, int par6, int par7) { -+ StructureBoundingBox var8 = StructureBoundingBox.getComponentToAddBoundingBox(par3, par4, par5, 0, 0, 0, 10, 6, 7, par6); -+ return canVillageGoDeeper(var8) && StructureComponent.findIntersecting(par1List, var8) == null ? new ComponentVillageHouse2(par0ComponentVillageStartPiece, par7, par2Random, var8, par6) : null; -+ } -+ -+ protected void func_143012_a(NBTTagCompound par1NBTTagCompound) { -+ super.func_143012_a(par1NBTTagCompound); -+ par1NBTTagCompound.setBoolean("Chest", this.hasMadeChest); -+ } -+ -+ protected void func_143011_b(NBTTagCompound par1NBTTagCompound) { -+ super.func_143011_b(par1NBTTagCompound); -+ this.hasMadeChest = par1NBTTagCompound.getBoolean("Chest"); -+ } -+ -+ /** -+ * second Part of Structure generating, this for example places Spiderwebs, Mob Spawners, it closes Mineshafts at the -+ * end, it adds Fences... -+ */ -+ public boolean addComponentParts(World par1World, Random par2Random, StructureBoundingBox par3StructureBoundingBox) { -+ if (this.field_143015_k < 0) { -+ this.field_143015_k = this.getAverageGroundLevel(par1World, par3StructureBoundingBox); -+ -+ if (this.field_143015_k < 0) { - return true; - } - - this.boundingBox.offset(0, this.field_143015_k - this.boundingBox.maxY + 6 - 1, 0); - } - -- this.fillWithBlocks(var1, var3, 0, 1, 0, 9, 4, 6, 0, 0, false); -- this.fillWithBlocks(var1, var3, 0, 0, 0, 9, 0, 6, Block.cobblestone.blockID, Block.cobblestone.blockID, false); -- this.fillWithBlocks(var1, var3, 0, 4, 0, 9, 4, 6, Block.cobblestone.blockID, Block.cobblestone.blockID, false); -- this.fillWithBlocks(var1, var3, 0, 5, 0, 9, 5, 6, Block.stoneSingleSlab.blockID, Block.stoneSingleSlab.blockID, false); -- this.fillWithBlocks(var1, var3, 1, 5, 1, 8, 5, 5, 0, 0, false); -- this.fillWithBlocks(var1, var3, 1, 1, 0, 2, 3, 0, Block.planks.blockID, Block.planks.blockID, false); -- this.fillWithBlocks(var1, var3, 0, 1, 0, 0, 4, 0, Block.wood.blockID, Block.wood.blockID, false); -- this.fillWithBlocks(var1, var3, 3, 1, 0, 3, 4, 0, Block.wood.blockID, Block.wood.blockID, false); -- this.fillWithBlocks(var1, var3, 0, 1, 6, 0, 4, 6, Block.wood.blockID, Block.wood.blockID, false); -- this.placeBlockAtCurrentPosition(var1, Block.planks.blockID, 0, 3, 3, 1, var3); -- this.fillWithBlocks(var1, var3, 3, 1, 2, 3, 3, 2, Block.planks.blockID, Block.planks.blockID, false); -- this.fillWithBlocks(var1, var3, 4, 1, 3, 5, 3, 3, Block.planks.blockID, Block.planks.blockID, false); -- this.fillWithBlocks(var1, var3, 0, 1, 1, 0, 3, 5, Block.planks.blockID, Block.planks.blockID, false); -- this.fillWithBlocks(var1, var3, 1, 1, 6, 5, 3, 6, Block.planks.blockID, Block.planks.blockID, false); -- this.fillWithBlocks(var1, var3, 5, 1, 0, 5, 3, 0, Block.fence.blockID, Block.fence.blockID, false); -- this.fillWithBlocks(var1, var3, 9, 1, 0, 9, 3, 0, Block.fence.blockID, Block.fence.blockID, false); -- this.fillWithBlocks(var1, var3, 6, 1, 4, 9, 4, 6, Block.cobblestone.blockID, Block.cobblestone.blockID, false); -- this.placeBlockAtCurrentPosition(var1, Block.lavaMoving.blockID, 0, 7, 1, 5, var3); -- this.placeBlockAtCurrentPosition(var1, Block.lavaMoving.blockID, 0, 8, 1, 5, var3); -- this.placeBlockAtCurrentPosition(var1, Block.fenceIron.blockID, 0, 9, 2, 5, var3); -- this.placeBlockAtCurrentPosition(var1, Block.fenceIron.blockID, 0, 9, 2, 4, var3); -- this.fillWithBlocks(var1, var3, 7, 2, 4, 8, 2, 5, 0, 0, false); -- this.placeBlockAtCurrentPosition(var1, Block.cobblestone.blockID, 0, 6, 1, 3, var3); -- this.placeBlockAtCurrentPosition(var1, Block.furnaceIdle.blockID, 0, 6, 2, 3, var3); -- this.placeBlockAtCurrentPosition(var1, Block.furnaceIdle.blockID, 0, 6, 3, 3, var3); -- this.placeBlockAtCurrentPosition(var1, Block.stoneDoubleSlab.blockID, 0, 8, 1, 1, var3); -- this.placeBlockAtCurrentPosition(var1, Block.thinGlass.blockID, 0, 0, 2, 2, var3); -- this.placeBlockAtCurrentPosition(var1, Block.thinGlass.blockID, 0, 0, 2, 4, var3); -- this.placeBlockAtCurrentPosition(var1, Block.thinGlass.blockID, 0, 2, 2, 6, var3); -- this.placeBlockAtCurrentPosition(var1, Block.thinGlass.blockID, 0, 4, 2, 6, var3); -- this.placeBlockAtCurrentPosition(var1, Block.fence.blockID, 0, 2, 1, 4, var3); -- this.placeBlockAtCurrentPosition(var1, Block.pressurePlatePlanks.blockID, 0, 2, 2, 4, var3); -- this.placeBlockAtCurrentPosition(var1, Block.planks.blockID, 0, 1, 1, 5, var3); -- this.placeBlockAtCurrentPosition(var1, Block.stairsWoodOak.blockID, this.getMetadataWithOffset(Block.stairsWoodOak.blockID, 3), 2, 1, 5, var3); -- this.placeBlockAtCurrentPosition(var1, Block.stairsWoodOak.blockID, this.getMetadataWithOffset(Block.stairsWoodOak.blockID, 1), 1, 1, 4, var3); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 0, 1, 0, 9, 4, 6, 0, 0, false); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 0, 0, 0, 9, 0, 6, Block.cobblestone.blockID, Block.cobblestone.blockID, false); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 0, 4, 0, 9, 4, 6, Block.cobblestone.blockID, Block.cobblestone.blockID, false); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 0, 5, 0, 9, 5, 6, Block.stoneSingleSlab.blockID, Block.stoneSingleSlab.blockID, false); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 1, 5, 1, 8, 5, 5, 0, 0, false); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 1, 1, 0, 2, 3, 0, Block.planks.blockID, Block.planks.blockID, false); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 0, 1, 0, 0, 4, 0, Block.wood.blockID, Block.wood.blockID, false); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 3, 1, 0, 3, 4, 0, Block.wood.blockID, Block.wood.blockID, false); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 0, 1, 6, 0, 4, 6, Block.wood.blockID, Block.wood.blockID, false); -+ this.placeBlockAtCurrentPosition(par1World, Block.planks.blockID, 0, 3, 3, 1, par3StructureBoundingBox); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 3, 1, 2, 3, 3, 2, Block.planks.blockID, Block.planks.blockID, false); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 4, 1, 3, 5, 3, 3, Block.planks.blockID, Block.planks.blockID, false); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 0, 1, 1, 0, 3, 5, Block.planks.blockID, Block.planks.blockID, false); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 1, 1, 6, 5, 3, 6, Block.planks.blockID, Block.planks.blockID, false); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 5, 1, 0, 5, 3, 0, Block.fence.blockID, Block.fence.blockID, false); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 9, 1, 0, 9, 3, 0, Block.fence.blockID, Block.fence.blockID, false); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 6, 1, 4, 9, 4, 6, Block.cobblestone.blockID, Block.cobblestone.blockID, false); -+ this.placeBlockAtCurrentPosition(par1World, Block.lavaMoving.blockID, 0, 7, 1, 5, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.lavaMoving.blockID, 0, 8, 1, 5, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.fenceIron.blockID, 0, 9, 2, 5, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.fenceIron.blockID, 0, 9, 2, 4, par3StructureBoundingBox); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 7, 2, 4, 8, 2, 5, 0, 0, false); -+ this.placeBlockAtCurrentPosition(par1World, Block.cobblestone.blockID, 0, 6, 1, 3, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.furnaceIdle.blockID, 0, 6, 2, 3, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.furnaceIdle.blockID, 0, 6, 3, 3, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.stoneDoubleSlab.blockID, 0, 8, 1, 1, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.thinGlass.blockID, 0, 0, 2, 2, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.thinGlass.blockID, 0, 0, 2, 4, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.thinGlass.blockID, 0, 2, 2, 6, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.thinGlass.blockID, 0, 4, 2, 6, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.fence.blockID, 0, 2, 1, 4, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.pressurePlatePlanks.blockID, 0, 2, 2, 4, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.planks.blockID, 0, 1, 1, 5, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.stairsWoodOak.blockID, this.getMetadataWithOffset(Block.stairsWoodOak.blockID, 3), 2, 1, 5, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.stairsWoodOak.blockID, this.getMetadataWithOffset(Block.stairsWoodOak.blockID, 1), 1, 1, 4, par3StructureBoundingBox); - int var4; - int var5; -- if(!this.hasMadeChest) { -+ -+ if (!this.hasMadeChest) { - var4 = this.getYWithOffset(1); - var5 = this.getXWithOffset(5, 5); - int var6 = this.getZWithOffset(5, 5); -- if(var3.isVecInside(var5, var4, var6)) { -+ -+ if (par3StructureBoundingBox.isVecInside(var5, var4, var6)) { - this.hasMadeChest = true; -- this.generateStructureChestContents(var1, var3, var2, 5, 1, 5, villageBlacksmithChestContents, 3 + var2.nextInt(6)); -- } -- } -- -- for(var4 = 6; var4 <= 8; ++var4) { -- if(this.getBlockIdAtCurrentPosition(var1, var4, 0, -1, var3) == 0 && this.getBlockIdAtCurrentPosition(var1, var4, -1, -1, var3) != 0) { -- this.placeBlockAtCurrentPosition(var1, Block.stairsCobblestone.blockID, this.getMetadataWithOffset(Block.stairsCobblestone.blockID, 3), var4, 0, -1, var3); -- } -- } -- -- for(var4 = 0; var4 < 7; ++var4) { -- for(var5 = 0; var5 < 10; ++var5) { -- this.clearCurrentPositionBlocksUpwards(var1, var5, 6, var4, var3); -- this.fillCurrentPositionBlocksDownwards(var1, Block.cobblestone.blockID, 0, var5, -1, var4, var3); -- } -- } -- -- this.spawnVillagers(var1, var3, 7, 1, 1, 1); -+ this.generateStructureChestContents(par1World, par3StructureBoundingBox, par2Random, 5, 1, 5, villageBlacksmithChestContents, 3 + par2Random.nextInt(6)); -+ } -+ } -+ -+ for (var4 = 6; var4 <= 8; ++var4) { -+ if (this.getBlockIdAtCurrentPosition(par1World, var4, 0, -1, par3StructureBoundingBox) == 0 && this.getBlockIdAtCurrentPosition(par1World, var4, -1, -1, par3StructureBoundingBox) != 0) { -+ this.placeBlockAtCurrentPosition(par1World, Block.stairsCobblestone.blockID, this.getMetadataWithOffset(Block.stairsCobblestone.blockID, 3), var4, 0, -1, par3StructureBoundingBox); -+ } -+ } -+ -+ for (var4 = 0; var4 < 7; ++var4) { -+ for (var5 = 0; var5 < 10; ++var5) { -+ this.clearCurrentPositionBlocksUpwards(par1World, var5, 6, var4, par3StructureBoundingBox); -+ this.fillCurrentPositionBlocksDownwards(par1World, Block.cobblestone.blockID, 0, var5, -1, var4, par3StructureBoundingBox); -+ } -+ } -+ -+ this.spawnVillagers(par1World, par3StructureBoundingBox, 7, 1, 1, 1); - return true; - } - -- protected int getVillagerType(int var1) { -+ /** -+ * Returns the villager type to spawn in this component, based on the number of villagers already spawned. -+ */ -+ protected int getVillagerType(int par1) { - return 3; - } - } ---- net/minecraft/src/DispenserBehaviorArrow.java -+++ net/minecraft/src/DispenserBehaviorArrow.java -@@ -1,8 +1,12 @@ - package net.minecraft.src; - - final class DispenserBehaviorArrow extends BehaviorProjectileDispense { -- protected IProjectile getProjectileEntity(World var1, IPosition var2) { -- EntityArrow var3 = new EntityArrow(var1, var2.getX(), var2.getY(), var2.getZ()); -+ -+ /** -+ * Return the projectile entity spawned by this dispense behavior. -+ */ -+ protected IProjectile getProjectileEntity(World par1World, IPosition par2IPosition) { -+ EntityArrow var3 = new EntityArrow(par1World, par2IPosition.getX(), par2IPosition.getY(), par2IPosition.getZ()); - var3.canBePickedUp = 1; - return var3; - } ---- net/minecraft/src/RenderOcelot.java -+++ net/minecraft/src/RenderOcelot.java -@@ -8,53 +8,72 @@ - private static final ResourceLocation redOcelotTextures = new ResourceLocation("textures/entity/cat/red.png"); - private static final ResourceLocation siameseOcelotTextures = new ResourceLocation("textures/entity/cat/siamese.png"); - -- public RenderOcelot(ModelBase var1, float var2) { -- super(var1, var2); -- } -- -- public void renderLivingOcelot(EntityOcelot var1, double var2, double var4, double var6, float var8, float var9) { -- super.doRenderLiving(var1, var2, var4, var6, var8, var9); -- } -- -- protected ResourceLocation func_110874_a(EntityOcelot var1) { -- switch(var1.getTameSkin()) { -- case 0: -- default: -- return ocelotTextures; -- case 1: -- return blackOcelotTextures; -- case 2: -- return redOcelotTextures; -- case 3: -- return siameseOcelotTextures; -+ public RenderOcelot(ModelBase par1ModelBase, float par2) { -+ super(par1ModelBase, par2); -+ } -+ -+ public void renderLivingOcelot(EntityOcelot par1EntityOcelot, double par2, double par4, double par6, float par8, float par9) { -+ super.doRenderLiving(par1EntityOcelot, par2, par4, par6, par8, par9); -+ } -+ -+ protected ResourceLocation func_110874_a(EntityOcelot par1EntityOcelot) { -+ switch (par1EntityOcelot.getTameSkin()) { -+ case 0: -+ default: -+ return ocelotTextures; -+ -+ case 1: -+ return blackOcelotTextures; -+ -+ case 2: -+ return redOcelotTextures; -+ -+ case 3: -+ return siameseOcelotTextures; - } - } - -- protected void preRenderOcelot(EntityOcelot var1, float var2) { -- super.preRenderCallback(var1, var2); -- if(var1.isTamed()) { -+ /** -+ * Pre-Renders the Ocelot. -+ */ -+ protected void preRenderOcelot(EntityOcelot par1EntityOcelot, float par2) { -+ super.preRenderCallback(par1EntityOcelot, par2); -+ -+ if (par1EntityOcelot.isTamed()) { - GL11.glScalef(0.8F, 0.8F, 0.8F); - } -- -- } -- -- public void doRenderLiving(EntityLiving var1, double var2, double var4, double var6, float var8, float var9) { -- this.renderLivingOcelot((EntityOcelot)var1, var2, var4, var6, var8, var9); -- } -- -- protected void preRenderCallback(EntityLivingBase var1, float var2) { -- this.preRenderOcelot((EntityOcelot)var1, var2); -- } -- -- public void renderPlayer(EntityLivingBase var1, double var2, double var4, double var6, float var8, float var9) { -- this.renderLivingOcelot((EntityOcelot)var1, var2, var4, var6, var8, var9); -- } -- -- protected ResourceLocation getEntityTexture(Entity var1) { -- return this.func_110874_a((EntityOcelot)var1); -- } -- -- public void doRender(Entity var1, double var2, double var4, double var6, float var8, float var9) { -- this.renderLivingOcelot((EntityOcelot)var1, var2, var4, var6, var8, var9); -+ } -+ -+ public void doRenderLiving(EntityLiving par1EntityLiving, double par2, double par4, double par6, float par8, float par9) { -+ this.renderLivingOcelot((EntityOcelot)par1EntityLiving, par2, par4, par6, par8, par9); -+ } -+ -+ /** -+ * Allows the render to do any OpenGL state modifications necessary before the model is rendered. Args: entityLiving, -+ * partialTickTime -+ */ -+ protected void preRenderCallback(EntityLivingBase par1EntityLivingBase, float par2) { -+ this.preRenderOcelot((EntityOcelot)par1EntityLivingBase, par2); -+ } -+ -+ public void renderPlayer(EntityLivingBase par1EntityLivingBase, double par2, double par4, double par6, float par8, float par9) { -+ this.renderLivingOcelot((EntityOcelot)par1EntityLivingBase, par2, par4, par6, par8, par9); -+ } -+ -+ /** -+ * Returns the location of an entity's texture. Doesn't seem to be called unless you call Render.bindEntityTexture. -+ */ -+ protected ResourceLocation getEntityTexture(Entity par1Entity) { -+ return this.func_110874_a((EntityOcelot)par1Entity); -+ } -+ -+ /** -+ * Actually renders the given argument. This is a synthetic bridge method, always casting down its argument and then -+ * handing it off to a worker function which does the actual work. In all probabilty, the class Render is generic -+ * (Render -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.api.animation; -+ -+public class LinearAnimationProgress implements AnimationProgress { -+ public double getValueAt(double progress) { -+ return progress; -+ } -+} ---- net/minecraft/src/Packet11PlayerPosition.java -+++ net/minecraft/src/Packet11PlayerPosition.java -@@ -9,31 +9,40 @@ - this.moving = true; - } - -- public Packet11PlayerPosition(double var1, double var3, double var5, double var7, boolean var9) { -- this.xPosition = var1; -- this.yPosition = var3; -- this.stance = var5; -- this.zPosition = var7; -- this.onGround = var9; -+ public Packet11PlayerPosition(double par1, double par3, double par5, double par7, boolean par9) { -+ this.xPosition = par1; -+ this.yPosition = par3; -+ this.stance = par5; -+ this.zPosition = par7; -+ this.onGround = par9; - this.moving = true; - } - -- public void readPacketData(DataInput var1) throws IOException { -- this.xPosition = var1.readDouble(); -- this.yPosition = var1.readDouble(); -- this.stance = var1.readDouble(); -- this.zPosition = var1.readDouble(); -- super.readPacketData(var1); -- } -- -- public void writePacketData(DataOutput var1) throws IOException { -- var1.writeDouble(this.xPosition); -- var1.writeDouble(this.yPosition); -- var1.writeDouble(this.stance); -- var1.writeDouble(this.zPosition); -- super.writePacketData(var1); -- } -- -+ /** -+ * Abstract. Reads the raw packet data from the data stream. -+ */ -+ public void readPacketData(DataInput par1DataInput) throws IOException { -+ this.xPosition = par1DataInput.readDouble(); -+ this.yPosition = par1DataInput.readDouble(); -+ this.stance = par1DataInput.readDouble(); -+ this.zPosition = par1DataInput.readDouble(); -+ super.readPacketData(par1DataInput); -+ } -+ -+ /** -+ * Abstract. Writes the raw packet data to the data stream. -+ */ -+ public void writePacketData(DataOutput par1DataOutput) throws IOException { -+ par1DataOutput.writeDouble(this.xPosition); -+ par1DataOutput.writeDouble(this.yPosition); -+ par1DataOutput.writeDouble(this.stance); -+ par1DataOutput.writeDouble(this.zPosition); -+ super.writePacketData(par1DataOutput); -+ } -+ -+ /** -+ * Abstract. Return the size of the packet (not counting the header). -+ */ - public int getPacketSize() { - return 33; - } ---- /dev/null -+++ org/spoutcraft/api/player/SkyManager.java -@@ -1,0 +1,78 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.api.player; -+ -+import org.spoutcraft.api.gui.Color; -+ -+public interface SkyManager { -+ public int getCloudHeight(); -+ -+ public void setCloudHeight(int y); -+ -+ public boolean isCloudsVisible(); -+ -+ public void setCloudsVisible(boolean visible); -+ -+ public int getStarFrequency(); -+ -+ public void setStarFrequency(int frequency); -+ -+ public boolean isStarsVisible(); -+ -+ public void setStarsVisible(boolean visible); -+ -+ public int getSunSizePercent(); -+ -+ public void setSunSizePercent(int percent); -+ -+ public boolean isSunVisible(); -+ -+ public void setSunVisible(boolean visible); -+ -+ public String getSunTextureUrl(); -+ -+ public void setSunTextureUrl(String Url); -+ -+ public int getMoonSizePercent(); -+ -+ public void setMoonSizePercent(int percent); -+ -+ public boolean isMoonVisible(); -+ -+ public void setMoonVisible(boolean visible); -+ -+ public String getMoonTextureUrl(); -+ -+ public void setMoonTextureUrl(String Url); -+ -+ public void setSkyColor(float red, float green, float blue); -+ -+ public void setSkyColor(Color color); -+ -+ public Color getSkyColor(); -+ -+ public void setFogColor(Color color); -+ -+ public Color getFogColor(); -+ -+ public void setCloudColor(Color color); -+ -+ public Color getCloudColor(); -+} ---- net/minecraft/src/EntityAITaskEntry.java -+++ net/minecraft/src/EntityAITaskEntry.java -@@ -1,13 +1,19 @@ - package net.minecraft.src; - - class EntityAITaskEntry { -+ -+ /** The EntityAIBase object. */ - public EntityAIBase action; -+ -+ /** Priority of the EntityAIBase */ - public int priority; -+ -+ /** The EntityAITasks object of which this is an entry. */ - final EntityAITasks tasks; - -- public EntityAITaskEntry(EntityAITasks var1, int var2, EntityAIBase var3) { -- this.tasks = var1; -- this.priority = var2; -- this.action = var3; -+ public EntityAITaskEntry(EntityAITasks par1EntityAITasks, int par2, EntityAIBase par3EntityAIBase) { -+ this.tasks = par1EntityAITasks; -+ this.priority = par2; -+ this.action = par3EntityAIBase; - } - } ---- net/minecraft/src/CombatEntry.java -+++ net/minecraft/src/CombatEntry.java -@@ -5,18 +5,21 @@ - private final int field_94567_b; - private final float field_94568_c; - private final float field_94565_d; -- private final String e; -+ private final String field_94566_e; - private final float field_94564_f; - -- public CombatEntry(DamageSource var1, int var2, float var3, float var4, String var5, float var6) { -- this.damageSrc = var1; -- this.field_94567_b = var2; -- this.field_94568_c = var4; -- this.field_94565_d = var3; -- this.e = var5; -- this.field_94564_f = var6; -+ public CombatEntry(DamageSource par1DamageSource, int par2, float par3, float par4, String par5Str, float par6) { -+ this.damageSrc = par1DamageSource; -+ this.field_94567_b = par2; -+ this.field_94568_c = par4; -+ this.field_94565_d = par3; -+ this.field_94566_e = par5Str; -+ this.field_94564_f = par6; - } - -+ /** -+ * Get the DamageSource of the CombatEntry instance. -+ */ - public DamageSource getDamageSrc() { - return this.damageSrc; - } -@@ -30,7 +33,7 @@ - } - - public String func_94562_g() { -- return this.e; -+ return this.field_94566_e; - } - - public String func_94558_h() { ---- net/minecraft/src/IChunkLoader.java -+++ net/minecraft/src/IChunkLoader.java -@@ -3,13 +3,28 @@ - import java.io.IOException; - - public interface IChunkLoader { -+ -+ /** -+ * Loads the specified(XZ) chunk into the specified world. -+ */ - Chunk loadChunk(World var1, int var2, int var3) throws IOException; - -- void saveChunk(World var1, Chunk var2) throws IOException, MinecraftException; -+ void saveChunk(World var1, Chunk var2) throws MinecraftException, IOException; - -+ /** -+ * Save extra data associated with this Chunk not normally saved during autosave, only during chunk unload. Currently -+ * unused. -+ */ - void saveExtraChunkData(World var1, Chunk var2); - -+ /** -+ * Called every World.tick() -+ */ - void chunkTick(); - -+ /** -+ * Save extra data not associated with any Chunk. Not saved during autosave, only during world unload. Currently -+ * unused. -+ */ - void saveExtraData(); - } ---- net/minecraft/src/GuiScreenPendingInvitationINNER3.java -+++ net/minecraft/src/GuiScreenPendingInvitationINNER3.java -@@ -3,18 +3,17 @@ - class GuiScreenPendingInvitationINNER3 extends Thread { - final GuiScreenPendingInvitation field_130131_a; - -- GuiScreenPendingInvitationINNER3(GuiScreenPendingInvitation var1) { -- this.field_130131_a = var1; -+ GuiScreenPendingInvitationINNER3(GuiScreenPendingInvitation par1GuiScreenPendingInvitation) { -+ this.field_130131_a = par1GuiScreenPendingInvitation; - } - - public void run() { - try { - McoClient var1 = new McoClient(GuiScreenPendingInvitation.func_130046_h(this.field_130131_a).getSession()); -- var1.func_130107_a(((PendingInvite)GuiScreenPendingInvitation.func_130042_e(this.field_130131_a).get(GuiScreenPendingInvitation.func_130049_d(this.field_130131_a))).a); -+ var1.func_130107_a(((PendingInvite)GuiScreenPendingInvitation.func_130042_e(this.field_130131_a).get(GuiScreenPendingInvitation.func_130049_d(this.field_130131_a))).field_130094_a); - GuiScreenPendingInvitation.func_130040_f(this.field_130131_a); - } catch (ExceptionMcoService var2) { - GuiScreenPendingInvitation.func_130055_i(this.field_130131_a).getLogAgent().logSevere(var2.toString()); - } -- - } - } ---- net/minecraft/src/BlockFluid.java -+++ net/minecraft/src/BlockFluid.java -@@ -2,18 +2,20 @@ - - import java.util.Random; - -+import com.prupe.mcpatcher.cc.ColorizeBlock; -+ - public abstract class BlockFluid extends Block { - private Icon[] theIcon; - -- protected BlockFluid(int var1, Material var2) { -- super(var1, var2); -+ protected BlockFluid(int par1, Material par2Material) { -+ super(par1, par2Material); - float var3 = 0.0F; - float var4 = 0.0F; - this.setBlockBounds(0.0F + var4, 0.0F + var3, 0.0F + var4, 1.0F + var4, 1.0F + var3, 1.0F + var4); - this.setTickRandomly(true); - } - -- public boolean getBlocksMovement(IBlockAccess var1, int var2, int var3, int var4) { -+ public boolean getBlocksMovement(IBlockAccess par1IBlockAccess, int par2, int par3, int par4) { - return this.blockMaterial != Material.lava; - } - -@@ -21,19 +23,25 @@ - return 16777215; - } - -- public int colorMultiplier(IBlockAccess var1, int var2, int var3, int var4) { -- if(this.blockMaterial != Material.water) { -+ /** -+ * Returns a integer with hex for 0xrrggbb with this color multiplied against the blocks color. Note only called when -+ * first determining what to render. -+ */ -+ public int colorMultiplier(IBlockAccess par1IBlockAccess, int par2, int par3, int par4) { -+ if (this.blockMaterial != Material.water) { - return 16777215; - } else { - int var5 = 0; - int var6 = 0; - int var7 = 0; - -- for(int var8 = -1; var8 <= 1; ++var8) { -- for(int var9 = -1; var9 <= 1; ++var9) { -- int var10 = var1.getBiomeGenForCoords(var2 + var9, var4 + var8).waterColorMultiplier; -+ for (int var8 = -1; var8 <= 1; ++var8) { -+ for (int var9 = -1; var9 <= 1; ++var9) { -+ // MCPatcher Start -+ int var10 = ColorizeBlock.colorizeWater(par1IBlockAccess, par2 + var9, par4 + var8); -+ // MCPatcher End - var5 += (var10 & 16711680) >> 16; -- var6 += (var10 & '\uff00') >> 8; -+ var6 += (var10 & 65280) >> 8; - var7 += var10 & 255; - } - } -@@ -42,28 +50,43 @@ - } - } - -- public static float getFluidHeightPercent(int var0) { -- if(var0 >= 8) { -- var0 = 0; -+ /** -+ * Returns the percentage of the fluid block that is air, based on the given flow decay of the fluid. -+ */ -+ public static float getFluidHeightPercent(int par0) { -+ if (par0 >= 8) { -+ par0 = 0; - } - -- return (float)(var0 + 1) / 9.0F; -- } -- -- public Icon getIcon(int var1, int var2) { -- return var1 != 0 && var1 != 1 ? this.theIcon[1] : this.theIcon[0]; -- } -- -- protected int getFlowDecay(World var1, int var2, int var3, int var4) { -- return var1.getBlockMaterial(var2, var3, var4) == this.blockMaterial ? var1.getBlockMetadata(var2, var3, var4) : -1; -- } -- -- protected int getEffectiveFlowDecay(IBlockAccess var1, int var2, int var3, int var4) { -- if(var1.getBlockMaterial(var2, var3, var4) != this.blockMaterial) { -+ return (float)(par0 + 1) / 9.0F; -+ } -+ -+ /** -+ * From the specified side and block metadata retrieves the blocks texture. Args: side, metadata -+ */ -+ public Icon getIcon(int par1, int par2) { -+ return par1 != 0 && par1 != 1 ? this.theIcon[1] : this.theIcon[0]; -+ } -+ -+ /** -+ * Returns the amount of fluid decay at the coordinates, or -1 if the block at the coordinates is not the same material -+ * as the fluid. -+ */ -+ protected int getFlowDecay(World par1World, int par2, int par3, int par4) { -+ return par1World.getBlockMaterial(par2, par3, par4) == this.blockMaterial ? par1World.getBlockMetadata(par2, par3, par4) : -1; -+ } -+ -+ /** -+ * Returns the flow decay but converts values indicating falling liquid (values >=8) to their effective source block -+ * value of zero. -+ */ -+ protected int getEffectiveFlowDecay(IBlockAccess par1IBlockAccess, int par2, int par3, int par4) { -+ if (par1IBlockAccess.getBlockMaterial(par2, par3, par4) != this.blockMaterial) { - return -1; - } else { -- int var5 = var1.getBlockMetadata(var2, var3, var4); -- if(var5 >= 8) { -+ int var5 = par1IBlockAccess.getBlockMetadata(par2, par3, par4); -+ -+ if (var5 >= 8) { - var5 = 0; - } - -@@ -71,118 +94,157 @@ - } - } - -+ /** -+ * If this block doesn't render as an ordinary block it will return False (examples: signs, buttons, stairs, etc) -+ */ - public boolean renderAsNormalBlock() { - return false; - } - -+ /** -+ * Is this block (a) opaque and (b) a full 1m cube? This determines whether or not to render the shared face of two -+ * adjacent blocks and also whether the player can attach torches, redstone wire, etc to this block. -+ */ - public boolean isOpaqueCube() { - return false; - } - -- public boolean canCollideCheck(int var1, boolean var2) { -- return var2 && var1 == 0; -- } -- -- public boolean isBlockSolid(IBlockAccess var1, int var2, int var3, int var4, int var5) { -- Material var6 = var1.getBlockMaterial(var2, var3, var4); -- return var6 == this.blockMaterial ? false : (var5 == 1 ? true : (var6 == Material.ice ? false : super.isBlockSolid(var1, var2, var3, var4, var5))); -- } -- -- public boolean shouldSideBeRendered(IBlockAccess var1, int var2, int var3, int var4, int var5) { -- Material var6 = var1.getBlockMaterial(var2, var3, var4); -- return var6 == this.blockMaterial ? false : (var5 == 1 ? true : (var6 == Material.ice ? false : super.shouldSideBeRendered(var1, var2, var3, var4, var5))); -- } -- -- public AxisAlignedBB getCollisionBoundingBoxFromPool(World var1, int var2, int var3, int var4) { -+ /** -+ * Returns whether this block is collideable based on the arguments passed in \n@param par1 block metaData \n@param -+ * par2 whether the player right-clicked while holding a boat -+ */ -+ public boolean canCollideCheck(int par1, boolean par2) { -+ return par2 && par1 == 0; -+ } -+ -+ /** -+ * Returns Returns true if the given side of this block type should be rendered (if it's solid or not), if the adjacent -+ * block is at the given coordinates. Args: blockAccess, x, y, z, side -+ */ -+ public boolean isBlockSolid(IBlockAccess par1IBlockAccess, int par2, int par3, int par4, int par5) { -+ Material var6 = par1IBlockAccess.getBlockMaterial(par2, par3, par4); -+ return var6 == this.blockMaterial ? false : (par5 == 1 ? true : (var6 == Material.ice ? false : super.isBlockSolid(par1IBlockAccess, par2, par3, par4, par5))); -+ } -+ -+ /** -+ * Returns true if the given side of this block type should be rendered, if the adjacent block is at the given -+ * coordinates. Args: blockAccess, x, y, z, side -+ */ -+ public boolean shouldSideBeRendered(IBlockAccess par1IBlockAccess, int par2, int par3, int par4, int par5) { -+ Material var6 = par1IBlockAccess.getBlockMaterial(par2, par3, par4); -+ return var6 == this.blockMaterial ? false : (par5 == 1 ? true : (var6 == Material.ice ? false : super.shouldSideBeRendered(par1IBlockAccess, par2, par3, par4, par5))); -+ } -+ -+ /** -+ * Returns a bounding box from the pool of bounding boxes (this means this box can change after the pool has been -+ * cleared to be reused) -+ */ -+ public AxisAlignedBB getCollisionBoundingBoxFromPool(World par1World, int par2, int par3, int par4) { - return null; - } - -+ /** -+ * The type of render function that is called for this block -+ */ - public int getRenderType() { - return 4; - } - -- public int idDropped(int var1, Random var2, int var3) { -- return 0; -- } -- -- public int quantityDropped(Random var1) { -- return 0; -- } -- -- private Vec3 getFlowVector(IBlockAccess var1, int var2, int var3, int var4) { -- Vec3 var5 = var1.getWorldVec3Pool().getVecFromPool(0.0D, 0.0D, 0.0D); -- int var6 = this.getEffectiveFlowDecay(var1, var2, var3, var4); -- -- for(int var7 = 0; var7 < 4; ++var7) { -- int var8 = var2; -- int var10 = var4; -- if(var7 == 0) { -- var8 = var2 - 1; -- } -- -- if(var7 == 1) { -- var10 = var4 - 1; -- } -- -- if(var7 == 2) { -+ /** -+ * Returns the ID of the items to drop on destruction. -+ */ -+ public int idDropped(int par1, Random par2Random, int par3) { -+ return 0; -+ } -+ -+ /** -+ * Returns the quantity of items to drop on block destruction. -+ */ -+ public int quantityDropped(Random par1Random) { -+ return 0; -+ } -+ -+ /** -+ * Returns a vector indicating the direction and intensity of fluid flow. -+ */ -+ private Vec3 getFlowVector(IBlockAccess par1IBlockAccess, int par2, int par3, int par4) { -+ Vec3 var5 = par1IBlockAccess.getWorldVec3Pool().getVecFromPool(0.0D, 0.0D, 0.0D); -+ int var6 = this.getEffectiveFlowDecay(par1IBlockAccess, par2, par3, par4); -+ -+ for (int var7 = 0; var7 < 4; ++var7) { -+ int var8 = par2; -+ int var10 = par4; -+ -+ if (var7 == 0) { -+ var8 = par2 - 1; -+ } -+ -+ if (var7 == 1) { -+ var10 = par4 - 1; -+ } -+ -+ if (var7 == 2) { - ++var8; - } - -- if(var7 == 3) { -+ if (var7 == 3) { - ++var10; - } - -- int var11 = this.getEffectiveFlowDecay(var1, var8, var3, var10); -+ int var11 = this.getEffectiveFlowDecay(par1IBlockAccess, var8, par3, var10); - int var12; -- if(var11 < 0) { -- if(!var1.getBlockMaterial(var8, var3, var10).blocksMovement()) { -- var11 = this.getEffectiveFlowDecay(var1, var8, var3 - 1, var10); -- if(var11 >= 0) { -+ -+ if (var11 < 0) { -+ if (!par1IBlockAccess.getBlockMaterial(var8, par3, var10).blocksMovement()) { -+ var11 = this.getEffectiveFlowDecay(par1IBlockAccess, var8, par3 - 1, var10); -+ -+ if (var11 >= 0) { - var12 = var11 - (var6 - 8); -- var5 = var5.addVector((double)((var8 - var2) * var12), (double)((var3 - var3) * var12), (double)((var10 - var4) * var12)); -+ var5 = var5.addVector((double)((var8 - par2) * var12), (double)((par3 - par3) * var12), (double)((var10 - par4) * var12)); - } - } -- } else if(var11 >= 0) { -+ } else if (var11 >= 0) { - var12 = var11 - var6; -- var5 = var5.addVector((double)((var8 - var2) * var12), (double)((var3 - var3) * var12), (double)((var10 - var4) * var12)); -+ var5 = var5.addVector((double)((var8 - par2) * var12), (double)((par3 - par3) * var12), (double)((var10 - par4) * var12)); - } - } - -- if(var1.getBlockMetadata(var2, var3, var4) >= 8) { -+ if (par1IBlockAccess.getBlockMetadata(par2, par3, par4) >= 8) { - boolean var13 = false; -- if(var13 || this.isBlockSolid(var1, var2, var3, var4 - 1, 2)) { -- var13 = true; -- } -- -- if(var13 || this.isBlockSolid(var1, var2, var3, var4 + 1, 3)) { -- var13 = true; -- } -- -- if(var13 || this.isBlockSolid(var1, var2 - 1, var3, var4, 4)) { -- var13 = true; -- } -- -- if(var13 || this.isBlockSolid(var1, var2 + 1, var3, var4, 5)) { -- var13 = true; -- } -- -- if(var13 || this.isBlockSolid(var1, var2, var3 + 1, var4 - 1, 2)) { -- var13 = true; -- } -- -- if(var13 || this.isBlockSolid(var1, var2, var3 + 1, var4 + 1, 3)) { -- var13 = true; -- } -- -- if(var13 || this.isBlockSolid(var1, var2 - 1, var3 + 1, var4, 4)) { -- var13 = true; -- } -- -- if(var13 || this.isBlockSolid(var1, var2 + 1, var3 + 1, var4, 5)) { -- var13 = true; -- } -- -- if(var13) { -+ -+ if (var13 || this.isBlockSolid(par1IBlockAccess, par2, par3, par4 - 1, 2)) { -+ var13 = true; -+ } -+ -+ if (var13 || this.isBlockSolid(par1IBlockAccess, par2, par3, par4 + 1, 3)) { -+ var13 = true; -+ } -+ -+ if (var13 || this.isBlockSolid(par1IBlockAccess, par2 - 1, par3, par4, 4)) { -+ var13 = true; -+ } -+ -+ if (var13 || this.isBlockSolid(par1IBlockAccess, par2 + 1, par3, par4, 5)) { -+ var13 = true; -+ } -+ -+ if (var13 || this.isBlockSolid(par1IBlockAccess, par2, par3 + 1, par4 - 1, 2)) { -+ var13 = true; -+ } -+ -+ if (var13 || this.isBlockSolid(par1IBlockAccess, par2, par3 + 1, par4 + 1, 3)) { -+ var13 = true; -+ } -+ -+ if (var13 || this.isBlockSolid(par1IBlockAccess, par2 - 1, par3 + 1, par4, 4)) { -+ var13 = true; -+ } -+ -+ if (var13 || this.isBlockSolid(par1IBlockAccess, par2 + 1, par3 + 1, par4, 5)) { -+ var13 = true; -+ } -+ -+ if (var13) { - var5 = var5.normalize().addVector(0.0D, -6.0D, 0.0D); - } - } -@@ -191,20 +253,29 @@ - return var5; - } - -- public void velocityToAddToEntity(World var1, int var2, int var3, int var4, Entity var5, Vec3 var6) { -- Vec3 var7 = this.getFlowVector(var1, var2, var3, var4); -- var6.xCoord += var7.xCoord; -- var6.yCoord += var7.yCoord; -- var6.zCoord += var7.zCoord; -- } -- -- public int tickRate(World var1) { -- return this.blockMaterial == Material.water ? 5 : (this.blockMaterial == Material.lava ? (var1.provider.hasNoSky ? 10 : 30) : 0); -- } -- -- public int getMixedBrightnessForBlock(IBlockAccess var1, int var2, int var3, int var4) { -- int var5 = var1.getLightBrightnessForSkyBlocks(var2, var3, var4, 0); -- int var6 = var1.getLightBrightnessForSkyBlocks(var2, var3 + 1, var4, 0); -+ /** -+ * Can add to the passed in vector for a movement vector to be applied to the entity. Args: x, y, z, entity, vec3d -+ */ -+ public void velocityToAddToEntity(World par1World, int par2, int par3, int par4, Entity par5Entity, Vec3 par6Vec3) { -+ Vec3 var7 = this.getFlowVector(par1World, par2, par3, par4); -+ par6Vec3.xCoord += var7.xCoord; -+ par6Vec3.yCoord += var7.yCoord; -+ par6Vec3.zCoord += var7.zCoord; -+ } -+ -+ /** -+ * How many world ticks before ticking -+ */ -+ public int tickRate(World par1World) { -+ return this.blockMaterial == Material.water ? 5 : (this.blockMaterial == Material.lava ? (par1World.provider.hasNoSky ? 10 : 30) : 0); -+ } -+ -+ /** -+ * Goes straight to getLightBrightnessForSkyBlocks for Blocks, does some fancy computing for Fluids -+ */ -+ public int getMixedBrightnessForBlock(IBlockAccess par1IBlockAccess, int par2, int par3, int par4) { -+ int var5 = par1IBlockAccess.getLightBrightnessForSkyBlocks(par2, par3, par4, 0); -+ int var6 = par1IBlockAccess.getLightBrightnessForSkyBlocks(par2, par3 + 1, par4, 0); - int var7 = var5 & 255; - int var8 = var6 & 255; - int var9 = var5 >> 16 & 255; -@@ -212,206 +283,242 @@ - return (var7 > var8 ? var7 : var8) | (var9 > var10 ? var9 : var10) << 16; - } - -- public float getBlockBrightness(IBlockAccess var1, int var2, int var3, int var4) { -- float var5 = var1.getLightBrightness(var2, var3, var4); -- float var6 = var1.getLightBrightness(var2, var3 + 1, var4); -+ /** -+ * How bright to render this block based on the light its receiving. Args: iBlockAccess, x, y, z -+ */ -+ public float getBlockBrightness(IBlockAccess par1IBlockAccess, int par2, int par3, int par4) { -+ float var5 = par1IBlockAccess.getLightBrightness(par2, par3, par4); -+ float var6 = par1IBlockAccess.getLightBrightness(par2, par3 + 1, par4); - return var5 > var6 ? var5 : var6; - } - -+ /** -+ * Returns which pass should this block be rendered on. 0 for solids and 1 for alpha -+ */ - public int getRenderBlockPass() { - return this.blockMaterial == Material.water ? 1 : 0; - } - -- public void randomDisplayTick(World var1, int var2, int var3, int var4, Random var5) { -+ /** -+ * A randomly called display update to be able to add particles or other items for display -+ */ -+ public void randomDisplayTick(World par1World, int par2, int par3, int par4, Random par5Random) { - int var6; -- if(this.blockMaterial == Material.water) { -- if(var5.nextInt(10) == 0) { -- var6 = var1.getBlockMetadata(var2, var3, var4); -- if(var6 <= 0 || var6 >= 8) { -- var1.spawnParticle("suspended", (double)((float)var2 + var5.nextFloat()), (double)((float)var3 + var5.nextFloat()), (double)((float)var4 + var5.nextFloat()), 0.0D, 0.0D, 0.0D); -+ -+ if (this.blockMaterial == Material.water) { -+ if (par5Random.nextInt(10) == 0) { -+ var6 = par1World.getBlockMetadata(par2, par3, par4); -+ -+ if (var6 <= 0 || var6 >= 8) { -+ par1World.spawnParticle("suspended", (double)((float)par2 + par5Random.nextFloat()), (double)((float)par3 + par5Random.nextFloat()), (double)((float)par4 + par5Random.nextFloat()), 0.0D, 0.0D, 0.0D); - } - } - -- for(var6 = 0; var6 < 0; ++var6) { -- int var7 = var5.nextInt(4); -- int var8 = var2; -- int var9 = var4; -- if(var7 == 0) { -- var8 = var2 - 1; -+ for (var6 = 0; var6 < 0; ++var6) { -+ int var7 = par5Random.nextInt(4); -+ int var8 = par2; -+ int var9 = par4; -+ -+ if (var7 == 0) { -+ var8 = par2 - 1; - } - -- if(var7 == 1) { -+ if (var7 == 1) { - ++var8; - } - -- if(var7 == 2) { -- var9 = var4 - 1; -+ if (var7 == 2) { -+ var9 = par4 - 1; - } - -- if(var7 == 3) { -+ if (var7 == 3) { - ++var9; - } - -- if(var1.getBlockMaterial(var8, var3, var9) == Material.air && (var1.getBlockMaterial(var8, var3 - 1, var9).blocksMovement() || var1.getBlockMaterial(var8, var3 - 1, var9).isLiquid())) { -- float var10 = 1.0F / 16.0F; -- double var11 = (double)((float)var2 + var5.nextFloat()); -- double var13 = (double)((float)var3 + var5.nextFloat()); -- double var15 = (double)((float)var4 + var5.nextFloat()); -- if(var7 == 0) { -- var11 = (double)((float)var2 - var10); -- } -- -- if(var7 == 1) { -- var11 = (double)((float)(var2 + 1) + var10); -- } -- -- if(var7 == 2) { -- var15 = (double)((float)var4 - var10); -- } -- -- if(var7 == 3) { -- var15 = (double)((float)(var4 + 1) + var10); -+ if (par1World.getBlockMaterial(var8, par3, var9) == Material.air && (par1World.getBlockMaterial(var8, par3 - 1, var9).blocksMovement() || par1World.getBlockMaterial(var8, par3 - 1, var9).isLiquid())) { -+ float var10 = 0.0625F; -+ double var11 = (double)((float)par2 + par5Random.nextFloat()); -+ double var13 = (double)((float)par3 + par5Random.nextFloat()); -+ double var15 = (double)((float)par4 + par5Random.nextFloat()); -+ -+ if (var7 == 0) { -+ var11 = (double)((float)par2 - var10); -+ } -+ -+ if (var7 == 1) { -+ var11 = (double)((float)(par2 + 1) + var10); -+ } -+ -+ if (var7 == 2) { -+ var15 = (double)((float)par4 - var10); -+ } -+ -+ if (var7 == 3) { -+ var15 = (double)((float)(par4 + 1) + var10); - } - - double var17 = 0.0D; - double var19 = 0.0D; -- if(var7 == 0) { -+ -+ if (var7 == 0) { - var17 = (double)(-var10); - } - -- if(var7 == 1) { -+ if (var7 == 1) { - var17 = (double)var10; - } - -- if(var7 == 2) { -+ if (var7 == 2) { - var19 = (double)(-var10); - } - -- if(var7 == 3) { -+ if (var7 == 3) { - var19 = (double)var10; - } - -- var1.spawnParticle("splash", var11, var13, var15, var17, 0.0D, var19); -+ par1World.spawnParticle("splash", var11, var13, var15, var17, 0.0D, var19); - } - } - } - -- if(this.blockMaterial == Material.water && var5.nextInt(64) == 0) { -- var6 = var1.getBlockMetadata(var2, var3, var4); -- if(var6 > 0 && var6 < 8) { -- var1.playSound((double)((float)var2 + 0.5F), (double)((float)var3 + 0.5F), (double)((float)var4 + 0.5F), "liquid.water", var5.nextFloat() * 0.25F + 12.0F / 16.0F, var5.nextFloat() * 1.0F + 0.5F, false); -+ if (this.blockMaterial == Material.water && par5Random.nextInt(64) == 0) { -+ var6 = par1World.getBlockMetadata(par2, par3, par4); -+ -+ if (var6 > 0 && var6 < 8) { -+ par1World.playSound((double)((float)par2 + 0.5F), (double)((float)par3 + 0.5F), (double)((float)par4 + 0.5F), "liquid.water", par5Random.nextFloat() * 0.25F + 0.75F, par5Random.nextFloat() * 1.0F + 0.5F, false); - } - } - -- double var21; - double var22; - double var23; -- if(this.blockMaterial == Material.lava && var1.getBlockMaterial(var2, var3 + 1, var4) == Material.air && !var1.isBlockOpaqueCube(var2, var3 + 1, var4)) { -- if(var5.nextInt(100) == 0) { -- var21 = (double)((float)var2 + var5.nextFloat()); -- var22 = (double)var3 + this.maxY; -- var23 = (double)((float)var4 + var5.nextFloat()); -- var1.spawnParticle("lava", var21, var22, var23, 0.0D, 0.0D, 0.0D); -- var1.playSound(var21, var22, var23, "liquid.lavapop", 0.2F + var5.nextFloat() * 0.2F, 0.9F + var5.nextFloat() * 0.15F, false); -+ double var21; -+ -+ if (this.blockMaterial == Material.lava && par1World.getBlockMaterial(par2, par3 + 1, par4) == Material.air && !par1World.isBlockOpaqueCube(par2, par3 + 1, par4)) { -+ if (par5Random.nextInt(100) == 0) { -+ var21 = (double)((float)par2 + par5Random.nextFloat()); -+ var22 = (double)par3 + this.maxY; -+ var23 = (double)((float)par4 + par5Random.nextFloat()); -+ par1World.spawnParticle("lava", var21, var22, var23, 0.0D, 0.0D, 0.0D); -+ par1World.playSound(var21, var22, var23, "liquid.lavapop", 0.2F + par5Random.nextFloat() * 0.2F, 0.9F + par5Random.nextFloat() * 0.15F, false); - } - -- if(var5.nextInt(200) == 0) { -- var1.playSound((double)var2, (double)var3, (double)var4, "liquid.lava", 0.2F + var5.nextFloat() * 0.2F, 0.9F + var5.nextFloat() * 0.15F, false); -+ if (par5Random.nextInt(200) == 0) { -+ par1World.playSound((double)par2, (double)par3, (double)par4, "liquid.lava", 0.2F + par5Random.nextFloat() * 0.2F, 0.9F + par5Random.nextFloat() * 0.15F, false); - } - } - -- if(var5.nextInt(10) == 0 && var1.doesBlockHaveSolidTopSurface(var2, var3 - 1, var4) && !var1.getBlockMaterial(var2, var3 - 2, var4).blocksMovement()) { -- var21 = (double)((float)var2 + var5.nextFloat()); -- var22 = (double)var3 - 1.05D; -- var23 = (double)((float)var4 + var5.nextFloat()); -- if(this.blockMaterial == Material.water) { -- var1.spawnParticle("dripWater", var21, var22, var23, 0.0D, 0.0D, 0.0D); -+ if (par5Random.nextInt(10) == 0 && par1World.doesBlockHaveSolidTopSurface(par2, par3 - 1, par4) && !par1World.getBlockMaterial(par2, par3 - 2, par4).blocksMovement()) { -+ var21 = (double)((float)par2 + par5Random.nextFloat()); -+ var22 = (double)par3 - 1.05D; -+ var23 = (double)((float)par4 + par5Random.nextFloat()); -+ -+ if (this.blockMaterial == Material.water) { -+ par1World.spawnParticle("dripWater", var21, var22, var23, 0.0D, 0.0D, 0.0D); - } else { -- var1.spawnParticle("dripLava", var21, var22, var23, 0.0D, 0.0D, 0.0D); -+ par1World.spawnParticle("dripLava", var21, var22, var23, 0.0D, 0.0D, 0.0D); - } - } -- - } - -- public static double getFlowDirection(IBlockAccess var0, int var1, int var2, int var3, Material var4) { -+ /** -+ * the sin and cos of this number determine the surface gradient of the flowing block. -+ */ -+ public static double getFlowDirection(IBlockAccess par0IBlockAccess, int par1, int par2, int par3, Material par4Material) { - Vec3 var5 = null; -- if(var4 == Material.water) { -- var5 = Block.waterMoving.getFlowVector(var0, var1, var2, var3); -- } -- -- if(var4 == Material.lava) { -- var5 = Block.lavaMoving.getFlowVector(var0, var1, var2, var3); -- } -- -- return var5.xCoord == 0.0D && var5.zCoord == 0.0D ? -1000.0D : Math.atan2(var5.zCoord, var5.xCoord) - Math.PI * 0.5D; -- } -- -- public void onBlockAdded(World var1, int var2, int var3, int var4) { -- this.checkForHarden(var1, var2, var3, var4); -- } -- -- public void onNeighborBlockChange(World var1, int var2, int var3, int var4, int var5) { -- this.checkForHarden(var1, var2, var3, var4); -- } -- -- private void checkForHarden(World var1, int var2, int var3, int var4) { -- if(var1.getBlockId(var2, var3, var4) == this.blockID) { -- if(this.blockMaterial == Material.lava) { -+ -+ if (par4Material == Material.water) { -+ var5 = Block.waterMoving.getFlowVector(par0IBlockAccess, par1, par2, par3); -+ } -+ -+ if (par4Material == Material.lava) { -+ var5 = Block.lavaMoving.getFlowVector(par0IBlockAccess, par1, par2, par3); -+ } -+ -+ return var5.xCoord == 0.0D && var5.zCoord == 0.0D ? -1000.0D : Math.atan2(var5.zCoord, var5.xCoord) - (Math.PI / 2D); -+ } -+ -+ /** -+ * Called whenever the block is added into the world. Args: world, x, y, z -+ */ -+ public void onBlockAdded(World par1World, int par2, int par3, int par4) { -+ this.checkForHarden(par1World, par2, par3, par4); -+ } -+ -+ /** -+ * Lets the block know when one of its neighbor changes. Doesn't know which neighbor changed (coordinates passed are -+ * their own) Args: x, y, z, neighbor blockID -+ */ -+ public void onNeighborBlockChange(World par1World, int par2, int par3, int par4, int par5) { -+ this.checkForHarden(par1World, par2, par3, par4); -+ } -+ -+ /** -+ * Forces lava to check to see if it is colliding with water, and then decide what it should harden to. -+ */ -+ private void checkForHarden(World par1World, int par2, int par3, int par4) { -+ if (par1World.getBlockId(par2, par3, par4) == this.blockID) { -+ if (this.blockMaterial == Material.lava) { - boolean var5 = false; -- if(var5 || var1.getBlockMaterial(var2, var3, var4 - 1) == Material.water) { -- var5 = true; -- } -- -- if(var5 || var1.getBlockMaterial(var2, var3, var4 + 1) == Material.water) { -- var5 = true; -- } -- -- if(var5 || var1.getBlockMaterial(var2 - 1, var3, var4) == Material.water) { -- var5 = true; -- } -- -- if(var5 || var1.getBlockMaterial(var2 + 1, var3, var4) == Material.water) { -- var5 = true; -- } -- -- if(var5 || var1.getBlockMaterial(var2, var3 + 1, var4) == Material.water) { -- var5 = true; -- } -- -- if(var5) { -- int var6 = var1.getBlockMetadata(var2, var3, var4); -- if(var6 == 0) { -- var1.setBlock(var2, var3, var4, Block.obsidian.blockID); -- } else if(var6 <= 4) { -- var1.setBlock(var2, var3, var4, Block.cobblestone.blockID); -+ -+ if (var5 || par1World.getBlockMaterial(par2, par3, par4 - 1) == Material.water) { -+ var5 = true; -+ } -+ -+ if (var5 || par1World.getBlockMaterial(par2, par3, par4 + 1) == Material.water) { -+ var5 = true; -+ } -+ -+ if (var5 || par1World.getBlockMaterial(par2 - 1, par3, par4) == Material.water) { -+ var5 = true; -+ } -+ -+ if (var5 || par1World.getBlockMaterial(par2 + 1, par3, par4) == Material.water) { -+ var5 = true; -+ } -+ -+ if (var5 || par1World.getBlockMaterial(par2, par3 + 1, par4) == Material.water) { -+ var5 = true; -+ } -+ -+ if (var5) { -+ int var6 = par1World.getBlockMetadata(par2, par3, par4); -+ -+ if (var6 == 0) { -+ par1World.setBlock(par2, par3, par4, Block.obsidian.blockID); -+ } else if (var6 <= 4) { -+ par1World.setBlock(par2, par3, par4, Block.cobblestone.blockID); - } - -- this.triggerLavaMixEffects(var1, var2, var3, var4); -+ this.triggerLavaMixEffects(par1World, par2, par3, par4); - } - } -- -- } -- } -- -- protected void triggerLavaMixEffects(World var1, int var2, int var3, int var4) { -- var1.playSoundEffect((double)((float)var2 + 0.5F), (double)((float)var3 + 0.5F), (double)((float)var4 + 0.5F), "random.fizz", 0.5F, 2.6F + (var1.s.nextFloat() - var1.s.nextFloat()) * 0.8F); -- -- for(int var5 = 0; var5 < 8; ++var5) { -- var1.spawnParticle("largesmoke", (double)var2 + Math.random(), (double)var3 + 1.2D, (double)var4 + Math.random(), 0.0D, 0.0D, 0.0D); -- } -- -- } -- -- public void registerIcons(IconRegister var1) { -- if(this.blockMaterial == Material.lava) { -- this.theIcon = new Icon[]{var1.registerIcon("lava_still"), var1.registerIcon("lava_flow")}; -+ } -+ } -+ -+ /** -+ * Creates fizzing sound and smoke. Used when lava flows over block or mixes with water. -+ */ -+ protected void triggerLavaMixEffects(World par1World, int par2, int par3, int par4) { -+ par1World.playSoundEffect((double)((float)par2 + 0.5F), (double)((float)par3 + 0.5F), (double)((float)par4 + 0.5F), "random.fizz", 0.5F, 2.6F + (par1World.rand.nextFloat() - par1World.rand.nextFloat()) * 0.8F); -+ -+ for (int var5 = 0; var5 < 8; ++var5) { -+ par1World.spawnParticle("largesmoke", (double)par2 + Math.random(), (double)par3 + 1.2D, (double)par4 + Math.random(), 0.0D, 0.0D, 0.0D); -+ } -+ } -+ -+ /** -+ * When this method is called, your block should register all the icons it needs with the given IconRegister. This is -+ * the only chance you get to register icons. -+ */ -+ public void registerIcons(IconRegister par1IconRegister) { -+ if (this.blockMaterial == Material.lava) { -+ this.theIcon = new Icon[] {par1IconRegister.registerIcon("lava_still"), par1IconRegister.registerIcon("lava_flow")}; - } else { -- this.theIcon = new Icon[]{var1.registerIcon("water_still"), var1.registerIcon("water_flow")}; -+ this.theIcon = new Icon[] {par1IconRegister.registerIcon("water_still"), par1IconRegister.registerIcon("water_flow")}; - } -- - } - -- public static Icon getFluidIcon(String var0) { -- return var0 == "water_still" ? Block.waterMoving.theIcon[0] : (var0 == "water_flow" ? Block.waterMoving.theIcon[1] : (var0 == "lava_still" ? Block.lavaMoving.theIcon[0] : (var0 == "lava_flow" ? Block.lavaMoving.theIcon[1] : null))); -+ public static Icon getFluidIcon(String par0Str) { -+ return par0Str == "water_still" ? Block.waterMoving.theIcon[0] : (par0Str == "water_flow" ? Block.waterMoving.theIcon[1] : (par0Str == "lava_still" ? Block.lavaMoving.theIcon[0] : (par0Str == "lava_flow" ? Block.lavaMoving.theIcon[1] : null))); - } - } ---- net/minecraft/src/GenLayerIsland.java -+++ net/minecraft/src/GenLayerIsland.java -@@ -1,22 +1,26 @@ - package net.minecraft.src; - - public class GenLayerIsland extends GenLayer { -- public GenLayerIsland(long var1) { -- super(var1); -+ public GenLayerIsland(long par1) { -+ super(par1); - } - -- public int[] getInts(int var1, int var2, int var3, int var4) { -- int[] var5 = IntCache.getIntCache(var3 * var4); -+ /** -+ * Returns a list of integer values generated by this layer. These may be interpreted as temperatures, rainfall -+ * amounts, or biomeList[] indices based on the particular GenLayer subclass. -+ */ -+ public int[] getInts(int par1, int par2, int par3, int par4) { -+ int[] var5 = IntCache.getIntCache(par3 * par4); - -- for(int var6 = 0; var6 < var4; ++var6) { -- for(int var7 = 0; var7 < var3; ++var7) { -- this.initChunkSeed((long)(var1 + var7), (long)(var2 + var6)); -- var5[var7 + var6 * var3] = this.nextInt(10) == 0 ? 1 : 0; -+ for (int var6 = 0; var6 < par4; ++var6) { -+ for (int var7 = 0; var7 < par3; ++var7) { -+ this.initChunkSeed((long)(par1 + var7), (long)(par2 + var6)); -+ var5[var7 + var6 * par3] = this.nextInt(10) == 0 ? 1 : 0; - } - } - -- if(var1 > -var3 && var1 <= 0 && var2 > -var4 && var2 <= 0) { -- var5[-var1 + -var2 * var3] = 1; -+ if (par1 > -par3 && par1 <= 0 && par2 > -par4 && par2 <= 0) { -+ var5[-par1 + -par2 * par3] = 1; - } - - return var5; ---- net/minecraft/src/ComponentVillageField2.java -+++ net/minecraft/src/ComponentVillageField2.java -@@ -4,79 +4,92 @@ - import java.util.Random; - - public class ComponentVillageField2 extends ComponentVillage { -+ -+ /** First crop type for this field. */ - private int cropTypeA; -+ -+ /** Second crop type for this field. */ - private int cropTypeB; - -- public ComponentVillageField2() { -- } -- -- public ComponentVillageField2(ComponentVillageStartPiece var1, int var2, Random var3, StructureBoundingBox var4, int var5) { -- super(var1, var2); -- this.coordBaseMode = var5; -- this.boundingBox = var4; -- this.cropTypeA = this.pickRandomCrop(var3); -- this.cropTypeB = this.pickRandomCrop(var3); -- } -- -- protected void func_143012_a(NBTTagCompound var1) { -- super.func_143012_a(var1); -- var1.setInteger("CA", this.cropTypeA); -- var1.setInteger("CB", this.cropTypeB); -- } -- -- protected void func_143011_b(NBTTagCompound var1) { -- super.func_143011_b(var1); -- this.cropTypeA = var1.getInteger("CA"); -- this.cropTypeB = var1.getInteger("CB"); -- } -- -- private int pickRandomCrop(Random var1) { -- switch(var1.nextInt(5)) { -- case 0: -- return Block.carrot.blockID; -- case 1: -- return Block.potato.blockID; -- default: -- return Block.crops.blockID; -+ public ComponentVillageField2() {} -+ -+ public ComponentVillageField2(ComponentVillageStartPiece par1ComponentVillageStartPiece, int par2, Random par3Random, StructureBoundingBox par4StructureBoundingBox, int par5) { -+ super(par1ComponentVillageStartPiece, par2); -+ this.coordBaseMode = par5; -+ this.boundingBox = par4StructureBoundingBox; -+ this.cropTypeA = this.pickRandomCrop(par3Random); -+ this.cropTypeB = this.pickRandomCrop(par3Random); -+ } -+ -+ protected void func_143012_a(NBTTagCompound par1NBTTagCompound) { -+ super.func_143012_a(par1NBTTagCompound); -+ par1NBTTagCompound.setInteger("CA", this.cropTypeA); -+ par1NBTTagCompound.setInteger("CB", this.cropTypeB); -+ } -+ -+ protected void func_143011_b(NBTTagCompound par1NBTTagCompound) { -+ super.func_143011_b(par1NBTTagCompound); -+ this.cropTypeA = par1NBTTagCompound.getInteger("CA"); -+ this.cropTypeB = par1NBTTagCompound.getInteger("CB"); -+ } -+ -+ /** -+ * Returns a crop type to be planted on this field. -+ */ -+ private int pickRandomCrop(Random par1Random) { -+ switch (par1Random.nextInt(5)) { -+ case 0: -+ return Block.carrot.blockID; -+ -+ case 1: -+ return Block.potato.blockID; -+ -+ default: -+ return Block.crops.blockID; - } - } - -- public static ComponentVillageField2 func_74902_a(ComponentVillageStartPiece var0, List var1, Random var2, int var3, int var4, int var5, int var6, int var7) { -- StructureBoundingBox var8 = StructureBoundingBox.getComponentToAddBoundingBox(var3, var4, var5, 0, 0, 0, 7, 4, 9, var6); -- return canVillageGoDeeper(var8) && StructureComponent.findIntersecting(var1, var8) == null ? new ComponentVillageField2(var0, var7, var2, var8, var6) : null; -+ public static ComponentVillageField2 func_74902_a(ComponentVillageStartPiece par0ComponentVillageStartPiece, List par1List, Random par2Random, int par3, int par4, int par5, int par6, int par7) { -+ StructureBoundingBox var8 = StructureBoundingBox.getComponentToAddBoundingBox(par3, par4, par5, 0, 0, 0, 7, 4, 9, par6); -+ return canVillageGoDeeper(var8) && StructureComponent.findIntersecting(par1List, var8) == null ? new ComponentVillageField2(par0ComponentVillageStartPiece, par7, par2Random, var8, par6) : null; - } - -- public boolean addComponentParts(World var1, Random var2, StructureBoundingBox var3) { -- if(this.field_143015_k < 0) { -- this.field_143015_k = this.getAverageGroundLevel(var1, var3); -- if(this.field_143015_k < 0) { -+ /** -+ * second Part of Structure generating, this for example places Spiderwebs, Mob Spawners, it closes Mineshafts at the -+ * end, it adds Fences... -+ */ -+ public boolean addComponentParts(World par1World, Random par2Random, StructureBoundingBox par3StructureBoundingBox) { -+ if (this.field_143015_k < 0) { -+ this.field_143015_k = this.getAverageGroundLevel(par1World, par3StructureBoundingBox); -+ -+ if (this.field_143015_k < 0) { - return true; - } - - this.boundingBox.offset(0, this.field_143015_k - this.boundingBox.maxY + 4 - 1, 0); - } - -- this.fillWithBlocks(var1, var3, 0, 1, 0, 6, 4, 8, 0, 0, false); -- this.fillWithBlocks(var1, var3, 1, 0, 1, 2, 0, 7, Block.tilledField.blockID, Block.tilledField.blockID, false); -- this.fillWithBlocks(var1, var3, 4, 0, 1, 5, 0, 7, Block.tilledField.blockID, Block.tilledField.blockID, false); -- this.fillWithBlocks(var1, var3, 0, 0, 0, 0, 0, 8, Block.wood.blockID, Block.wood.blockID, false); -- this.fillWithBlocks(var1, var3, 6, 0, 0, 6, 0, 8, Block.wood.blockID, Block.wood.blockID, false); -- this.fillWithBlocks(var1, var3, 1, 0, 0, 5, 0, 0, Block.wood.blockID, Block.wood.blockID, false); -- this.fillWithBlocks(var1, var3, 1, 0, 8, 5, 0, 8, Block.wood.blockID, Block.wood.blockID, false); -- this.fillWithBlocks(var1, var3, 3, 0, 1, 3, 0, 7, Block.waterMoving.blockID, Block.waterMoving.blockID, false); -- -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 0, 1, 0, 6, 4, 8, 0, 0, false); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 1, 0, 1, 2, 0, 7, Block.tilledField.blockID, Block.tilledField.blockID, false); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 4, 0, 1, 5, 0, 7, Block.tilledField.blockID, Block.tilledField.blockID, false); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 0, 0, 0, 0, 0, 8, Block.wood.blockID, Block.wood.blockID, false); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 6, 0, 0, 6, 0, 8, Block.wood.blockID, Block.wood.blockID, false); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 1, 0, 0, 5, 0, 0, Block.wood.blockID, Block.wood.blockID, false); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 1, 0, 8, 5, 0, 8, Block.wood.blockID, Block.wood.blockID, false); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 3, 0, 1, 3, 0, 7, Block.waterMoving.blockID, Block.waterMoving.blockID, false); - int var4; -- for(var4 = 1; var4 <= 7; ++var4) { -- this.placeBlockAtCurrentPosition(var1, this.cropTypeA, MathHelper.getRandomIntegerInRange(var2, 2, 7), 1, 1, var4, var3); -- this.placeBlockAtCurrentPosition(var1, this.cropTypeA, MathHelper.getRandomIntegerInRange(var2, 2, 7), 2, 1, var4, var3); -- this.placeBlockAtCurrentPosition(var1, this.cropTypeB, MathHelper.getRandomIntegerInRange(var2, 2, 7), 4, 1, var4, var3); -- this.placeBlockAtCurrentPosition(var1, this.cropTypeB, MathHelper.getRandomIntegerInRange(var2, 2, 7), 5, 1, var4, var3); -+ -+ for (var4 = 1; var4 <= 7; ++var4) { -+ this.placeBlockAtCurrentPosition(par1World, this.cropTypeA, MathHelper.getRandomIntegerInRange(par2Random, 2, 7), 1, 1, var4, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, this.cropTypeA, MathHelper.getRandomIntegerInRange(par2Random, 2, 7), 2, 1, var4, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, this.cropTypeB, MathHelper.getRandomIntegerInRange(par2Random, 2, 7), 4, 1, var4, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, this.cropTypeB, MathHelper.getRandomIntegerInRange(par2Random, 2, 7), 5, 1, var4, par3StructureBoundingBox); - } - -- for(var4 = 0; var4 < 9; ++var4) { -- for(int var5 = 0; var5 < 7; ++var5) { -- this.clearCurrentPositionBlocksUpwards(var1, var5, 4, var4, var3); -- this.fillCurrentPositionBlocksDownwards(var1, Block.dirt.blockID, 0, var5, -1, var4, var3); -+ for (var4 = 0; var4 < 9; ++var4) { -+ for (int var5 = 0; var5 < 7; ++var5) { -+ this.clearCurrentPositionBlocksUpwards(par1World, var5, 4, var4, par3StructureBoundingBox); -+ this.fillCurrentPositionBlocksDownwards(par1World, Block.dirt.blockID, 0, var5, -1, var4, par3StructureBoundingBox); - } - } - ---- /dev/null -+++ org/spoutcraft/api/gui/ItemWidget.java -@@ -1,0 +1,74 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.api.gui; -+ -+import org.spoutcraft.api.UnsafeClass; -+ -+@UnsafeClass -+public interface ItemWidget extends Widget { -+ /** -+ * Sets the type id of this item widget -+ * -+ * @param id -+ * @return ItemWidget -+ */ -+ public ItemWidget setTypeId(int id); -+ -+ /** -+ * Gets the type id of this item widget -+ * -+ * @return type id -+ */ -+ public int getTypeId(); -+ -+ /** -+ * Sets the data of this item widget -+ * -+ * @param data to set -+ * @return ItemWidget -+ */ -+ public ItemWidget setData(short data); -+ -+ /** -+ * Gets the data of this item widget, is zero by default -+ * -+ * @return data -+ */ -+ public short getData(); -+ -+ /** -+ * Sets the z render depth for this 3-d item widget -+ * -+ * @param depth to render at -+ * @return ItemWidget -+ */ -+ public ItemWidget setDepth(int depth); -+ -+ /** -+ * Gets the z render depth for this 3-d item widget -+ * -+ * @return depth -+ */ -+ public int getDepth(); -+ -+ public ItemWidget setWidth(int width); -+ -+ public ItemWidget setHeight(int height); -+} ---- net/minecraft/src/BlockRedstoneRepeater.java -+++ net/minecraft/src/BlockRedstoneRepeater.java -@@ -3,23 +3,30 @@ - import java.util.Random; - - public class BlockRedstoneRepeater extends BlockRedstoneLogic { -- public static final double[] repeaterTorchOffset = new double[]{-0.0625D, 1.0D / 16.0D, 0.1875D, 0.3125D}; -- private static final int[] repeaterState = new int[]{1, 2, 3, 4}; -- -- protected BlockRedstoneRepeater(int var1, boolean var2) { -- super(var1, var2); -+ -+ /** The offsets for the two torches in redstone repeater blocks. */ -+ public static final double[] repeaterTorchOffset = new double[] { -0.0625D, 0.0625D, 0.1875D, 0.3125D}; -+ -+ /** The states in which the redstone repeater blocks can be. */ -+ private static final int[] repeaterState = new int[] {1, 2, 3, 4}; -+ -+ protected BlockRedstoneRepeater(int par1, boolean par2) { -+ super(par1, par2); - } - -- public boolean onBlockActivated(World var1, int var2, int var3, int var4, EntityPlayer var5, int var6, float var7, float var8, float var9) { -- int var10 = var1.getBlockMetadata(var2, var3, var4); -+ /** -+ * Called upon block activation (right click on the block.) -+ */ -+ public boolean onBlockActivated(World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer, int par6, float par7, float par8, float par9) { -+ int var10 = par1World.getBlockMetadata(par2, par3, par4); - int var11 = (var10 & 12) >> 2; - var11 = var11 + 1 << 2 & 12; -- var1.setBlockMetadata(var2, var3, var4, var11 | var10 & 3, 3); -+ par1World.setBlockMetadataWithNotify(par2, par3, par4, var11 | var10 & 3, 3); - return true; - } - -- protected int func_94481_j_(int var1) { -- return repeaterState[(var1 & 12) >> 2] * 2; -+ protected int func_94481_j_(int par1) { -+ return repeaterState[(par1 & 12) >> 2] * 2; - } - - protected BlockRedstoneLogic func_94485_e() { -@@ -30,72 +37,96 @@ - return Block.redstoneRepeaterIdle; - } - -- public int idDropped(int var1, Random var2, int var3) { -- return Item.redstoneRepeater.itemID; -- } -- -- public int idPicked(World var1, int var2, int var3, int var4) { -- return Item.redstoneRepeater.itemID; -- } -- -+ /** -+ * Returns the ID of the items to drop on destruction. -+ */ -+ public int idDropped(int par1, Random par2Random, int par3) { -+ return Item.redstoneRepeater.itemID; -+ } -+ -+ /** -+ * only called by clickMiddleMouseButton , and passed to inventory.setCurrentItem (along with isCreative) -+ */ -+ public int idPicked(World par1World, int par2, int par3, int par4) { -+ return Item.redstoneRepeater.itemID; -+ } -+ -+ /** -+ * The type of render function that is called for this block -+ */ - public int getRenderType() { - return 15; - } - -- public boolean func_94476_e(IBlockAccess var1, int var2, int var3, int var4, int var5) { -- return this.func_94482_f(var1, var2, var3, var4, var5) > 0; -- } -- -- protected boolean func_94477_d(int var1) { -- return isRedstoneRepeaterBlockID(var1); -- } -- -- public void randomDisplayTick(World var1, int var2, int var3, int var4, Random var5) { -- if(this.isRepeaterPowered) { -- int var6 = var1.getBlockMetadata(var2, var3, var4); -+ public boolean func_94476_e(IBlockAccess par1IBlockAccess, int par2, int par3, int par4, int par5) { -+ return this.func_94482_f(par1IBlockAccess, par2, par3, par4, par5) > 0; -+ } -+ -+ protected boolean func_94477_d(int par1) { -+ return isRedstoneRepeaterBlockID(par1); -+ } -+ -+ /** -+ * A randomly called display update to be able to add particles or other items for display -+ */ -+ public void randomDisplayTick(World par1World, int par2, int par3, int par4, Random par5Random) { -+ if (this.isRepeaterPowered) { -+ int var6 = par1World.getBlockMetadata(par2, par3, par4); - int var7 = getDirection(var6); -- double var8 = (double)((float)var2 + 0.5F) + (double)(var5.nextFloat() - 0.5F) * 0.2D; -- double var10 = (double)((float)var3 + 0.4F) + (double)(var5.nextFloat() - 0.5F) * 0.2D; -- double var12 = (double)((float)var4 + 0.5F) + (double)(var5.nextFloat() - 0.5F) * 0.2D; -+ double var8 = (double)((float)par2 + 0.5F) + (double)(par5Random.nextFloat() - 0.5F) * 0.2D; -+ double var10 = (double)((float)par3 + 0.4F) + (double)(par5Random.nextFloat() - 0.5F) * 0.2D; -+ double var12 = (double)((float)par4 + 0.5F) + (double)(par5Random.nextFloat() - 0.5F) * 0.2D; - double var14 = 0.0D; - double var16 = 0.0D; -- if(var5.nextInt(2) == 0) { -- switch(var7) { -- case 0: -- var16 = -0.3125D; -- break; -- case 1: -- var14 = 0.3125D; -- break; -- case 2: -- var16 = 0.3125D; -- break; -- case 3: -- var14 = -0.3125D; -+ -+ if (par5Random.nextInt(2) == 0) { -+ switch (var7) { -+ case 0: -+ var16 = -0.3125D; -+ break; -+ -+ case 1: -+ var14 = 0.3125D; -+ break; -+ -+ case 2: -+ var16 = 0.3125D; -+ break; -+ -+ case 3: -+ var14 = -0.3125D; - } - } else { - int var18 = (var6 & 12) >> 2; -- switch(var7) { -- case 0: -- var16 = repeaterTorchOffset[var18]; -- break; -- case 1: -- var14 = -repeaterTorchOffset[var18]; -- break; -- case 2: -- var16 = -repeaterTorchOffset[var18]; -- break; -- case 3: -- var14 = repeaterTorchOffset[var18]; -+ -+ switch (var7) { -+ case 0: -+ var16 = repeaterTorchOffset[var18]; -+ break; -+ -+ case 1: -+ var14 = -repeaterTorchOffset[var18]; -+ break; -+ -+ case 2: -+ var16 = -repeaterTorchOffset[var18]; -+ break; -+ -+ case 3: -+ var14 = repeaterTorchOffset[var18]; - } - } - -- var1.spawnParticle("reddust", var8 + var14, var10, var12 + var16, 0.0D, 0.0D, 0.0D); -+ par1World.spawnParticle("reddust", var8 + var14, var10, var12 + var16, 0.0D, 0.0D, 0.0D); - } - } - -- public void breakBlock(World var1, int var2, int var3, int var4, int var5, int var6) { -- super.breakBlock(var1, var2, var3, var4, var5, var6); -- this.func_94483_i_(var1, var2, var3, var4); -+ /** -+ * Called on server worlds only when the block has been replaced by a different block ID, or the same block with a -+ * different metadata value, but before the new metadata value is set. Args: World, x, y, z, old block ID, old metadata -+ */ -+ public void breakBlock(World par1World, int par2, int par3, int par4, int par5, int par6) { -+ super.breakBlock(par1World, par2, par3, par4, par5, par6); -+ this.func_94483_i_(par1World, par2, par3, par4); - } - } ---- net/minecraft/src/WorldGenHellLava.java -+++ net/minecraft/src/WorldGenHellLava.java -@@ -3,67 +3,71 @@ - import java.util.Random; - - public class WorldGenHellLava extends WorldGenerator { -+ -+ /** Stores the ID for WorldGenHellLava */ - private int hellLavaID; - private boolean field_94524_b; - -- public WorldGenHellLava(int var1, boolean var2) { -- this.hellLavaID = var1; -- this.field_94524_b = var2; -+ public WorldGenHellLava(int par1, boolean par2) { -+ this.hellLavaID = par1; -+ this.field_94524_b = par2; - } - -- public boolean generate(World var1, Random var2, int var3, int var4, int var5) { -- if(var1.getBlockId(var3, var4 + 1, var5) != Block.netherrack.blockID) { -+ public boolean generate(World par1World, Random par2Random, int par3, int par4, int par5) { -+ if (par1World.getBlockId(par3, par4 + 1, par5) != Block.netherrack.blockID) { - return false; -- } else if(var1.getBlockId(var3, var4, var5) != 0 && var1.getBlockId(var3, var4, var5) != Block.netherrack.blockID) { -+ } else if (par1World.getBlockId(par3, par4, par5) != 0 && par1World.getBlockId(par3, par4, par5) != Block.netherrack.blockID) { - return false; - } else { - int var6 = 0; -- if(var1.getBlockId(var3 - 1, var4, var5) == Block.netherrack.blockID) { -- ++var6; -- } -- -- if(var1.getBlockId(var3 + 1, var4, var5) == Block.netherrack.blockID) { -- ++var6; -- } -- -- if(var1.getBlockId(var3, var4, var5 - 1) == Block.netherrack.blockID) { -- ++var6; -- } -- -- if(var1.getBlockId(var3, var4, var5 + 1) == Block.netherrack.blockID) { -- ++var6; -- } -- -- if(var1.getBlockId(var3, var4 - 1, var5) == Block.netherrack.blockID) { -+ -+ if (par1World.getBlockId(par3 - 1, par4, par5) == Block.netherrack.blockID) { -+ ++var6; -+ } -+ -+ if (par1World.getBlockId(par3 + 1, par4, par5) == Block.netherrack.blockID) { -+ ++var6; -+ } -+ -+ if (par1World.getBlockId(par3, par4, par5 - 1) == Block.netherrack.blockID) { -+ ++var6; -+ } -+ -+ if (par1World.getBlockId(par3, par4, par5 + 1) == Block.netherrack.blockID) { -+ ++var6; -+ } -+ -+ if (par1World.getBlockId(par3, par4 - 1, par5) == Block.netherrack.blockID) { - ++var6; - } - - int var7 = 0; -- if(var1.isAirBlock(var3 - 1, var4, var5)) { -- ++var7; -- } -- -- if(var1.isAirBlock(var3 + 1, var4, var5)) { -- ++var7; -- } -- -- if(var1.isAirBlock(var3, var4, var5 - 1)) { -- ++var7; -- } -- -- if(var1.isAirBlock(var3, var4, var5 + 1)) { -- ++var7; -- } -- -- if(var1.isAirBlock(var3, var4 - 1, var5)) { -- ++var7; -- } -- -- if(!this.field_94524_b && var6 == 4 && var7 == 1 || var6 == 5) { -- var1.setBlock(var3, var4, var5, this.hellLavaID, 0, 2); -- var1.scheduledUpdatesAreImmediate = true; -- Block.blocksList[this.hellLavaID].updateTick(var1, var3, var4, var5, var2); -- var1.scheduledUpdatesAreImmediate = false; -+ -+ if (par1World.isAirBlock(par3 - 1, par4, par5)) { -+ ++var7; -+ } -+ -+ if (par1World.isAirBlock(par3 + 1, par4, par5)) { -+ ++var7; -+ } -+ -+ if (par1World.isAirBlock(par3, par4, par5 - 1)) { -+ ++var7; -+ } -+ -+ if (par1World.isAirBlock(par3, par4, par5 + 1)) { -+ ++var7; -+ } -+ -+ if (par1World.isAirBlock(par3, par4 - 1, par5)) { -+ ++var7; -+ } -+ -+ if (!this.field_94524_b && var6 == 4 && var7 == 1 || var6 == 5) { -+ par1World.setBlock(par3, par4, par5, this.hellLavaID, 0, 2); -+ par1World.scheduledUpdatesAreImmediate = true; -+ Block.blocksList[this.hellLavaID].updateTick(par1World, par3, par4, par5, par2Random); -+ par1World.scheduledUpdatesAreImmediate = false; - } - - return true; ---- /dev/null -+++ org/spoutcraft/api/material/Armor.java -@@ -1,0 +1,23 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.api.material; -+ -+public interface Armor extends Item { -+} ---- net/minecraft/src/Score.java -+++ net/minecraft/src/Score.java -@@ -4,36 +4,36 @@ - import java.util.List; - - public class Score { -- public static final Comparator a = new ScoreComparator(); -+ public static final Comparator field_96658_a = new ScoreComparator(); - private final Scoreboard theScoreboard; - private final ScoreObjective theScoreObjective; -- private final String d; -+ private final String field_96654_d; - private int field_96655_e; - -- public Score(Scoreboard var1, ScoreObjective var2, String var3) { -- this.theScoreboard = var1; -- this.theScoreObjective = var2; -- this.d = var3; -+ public Score(Scoreboard par1Scoreboard, ScoreObjective par2ScoreObjective, String par3Str) { -+ this.theScoreboard = par1Scoreboard; -+ this.theScoreObjective = par2ScoreObjective; -+ this.field_96654_d = par3Str; - } - -- public void func_96649_a(int var1) { -- if(this.theScoreObjective.getCriteria().isReadOnly()) { -+ public void func_96649_a(int par1) { -+ if (this.theScoreObjective.getCriteria().isReadOnly()) { - throw new IllegalStateException("Cannot modify read-only score"); - } else { -- this.func_96647_c(this.getScorePoints() + var1); -+ this.func_96647_c(this.getScorePoints() + par1); - } - } - -- public void func_96646_b(int var1) { -- if(this.theScoreObjective.getCriteria().isReadOnly()) { -+ public void func_96646_b(int par1) { -+ if (this.theScoreObjective.getCriteria().isReadOnly()) { - throw new IllegalStateException("Cannot modify read-only score"); - } else { -- this.func_96647_c(this.getScorePoints() - var1); -+ this.func_96647_c(this.getScorePoints() - par1); - } - } - - public void func_96648_a() { -- if(this.theScoreObjective.getCriteria().isReadOnly()) { -+ if (this.theScoreObjective.getCriteria().isReadOnly()) { - throw new IllegalStateException("Cannot modify read-only score"); - } else { - this.func_96649_a(1); -@@ -44,13 +44,13 @@ - return this.field_96655_e; - } - -- public void func_96647_c(int var1) { -+ public void func_96647_c(int par1) { - int var2 = this.field_96655_e; -- this.field_96655_e = var1; -- if(var2 != var1) { -+ this.field_96655_e = par1; -+ -+ if (var2 != par1) { - this.func_96650_f().func_96536_a(this); - } -- - } - - public ScoreObjective func_96645_d() { -@@ -58,14 +58,14 @@ - } - - public String getPlayerName() { -- return this.d; -+ return this.field_96654_d; - } - - public Scoreboard func_96650_f() { - return this.theScoreboard; - } - -- public void func_96651_a(List var1) { -- this.func_96647_c(this.theScoreObjective.getCriteria().func_96635_a(var1)); -+ public void func_96651_a(List par1List) { -+ this.func_96647_c(this.theScoreObjective.getCriteria().func_96635_a(par1List)); - } - } ---- /dev/null -+++ org/spoutcraft/client/gui/minimap/MinimapUtils.java -@@ -1,0 +1,40 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.client.gui.minimap; -+ -+import org.spoutcraft.client.SpoutClient; -+ -+public class MinimapUtils { -+ public static boolean insideCircle(int centerX, int centerY, int radius, int x, int y) { -+ double squareDist = (centerX - x) * (centerX - x) + (centerY - y) * (centerY - y); -+ return squareDist <= radius * radius; -+ } -+ -+ public static String getWorldName() { -+ String worldName = "MpServer"; -+ if (SpoutClient.getHandle().isIntegratedServerRunning()) { -+ worldName = SpoutClient.getHandle().getIntegratedServer().getWorldName(); -+ } -+ if (worldName.equals("MpServer") && org.spoutcraft.client.gui.error.GuiConnectionLost.lastServerIp != null) { -+ return org.spoutcraft.client.gui.error.GuiConnectionLost.lastServerIp.replaceAll("\\.", "-"); -+ } -+ return worldName; -+ } -+} ---- /dev/null -+++ org/spoutcraft/api/gui/RadioButton.java -@@ -1,0 +1,51 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.api.gui; -+ -+import org.spoutcraft.api.UnsafeClass; -+ -+@UnsafeClass -+public interface RadioButton extends Button { -+ /** -+ * Is true if the radio button is selected -+ * @return selected -+ */ -+ public boolean isSelected(); -+ -+ /** -+ * Sets this radio button as selected -+ * @param selected -+ * @return this -+ */ -+ public RadioButton setSelected(boolean selected); -+ -+ /** -+ * Gets the group id for this radio button. Radio buttons on the same screen, with the same group id will be grouped together -+ * @return group id -+ */ -+ public int getGroup(); -+ -+ /** -+ * Sets the group id for this radio button -+ * @param group id to set -+ * @return this -+ */ -+ public RadioButton setGroup(int group); -+} ---- net/minecraft/src/SpawnListEntry.java -+++ net/minecraft/src/SpawnListEntry.java -@@ -1,18 +1,20 @@ - package net.minecraft.src; - - public class SpawnListEntry extends WeightedRandomItem { -- public Class b; -+ -+ /** Holds the class of the entity to be spawned. */ -+ public Class entityClass; - public int minGroupCount; - public int maxGroupCount; - -- public SpawnListEntry(Class var1, int var2, int var3, int var4) { -- super(var2); -- this.b = var1; -- this.minGroupCount = var3; -- this.maxGroupCount = var4; -+ public SpawnListEntry(Class par1Class, int par2, int par3, int par4) { -+ super(par2); -+ this.entityClass = par1Class; -+ this.minGroupCount = par3; -+ this.maxGroupCount = par4; - } - - public String toString() { -- return this.b.getSimpleName() + "*(" + this.minGroupCount + "-" + this.maxGroupCount + "):" + this.itemWeight; -+ return this.entityClass.getSimpleName() + "*(" + this.minGroupCount + "-" + this.maxGroupCount + "):" + this.itemWeight; - } - } ---- /dev/null -+++ org/spoutcraft/api/gui/Slot.java -@@ -1,0 +1,86 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.api.gui; -+ -+import org.spoutcraft.api.inventory.ItemStack; -+ -+/** -+ * Represents one item slot where items can be put in and out. -+ */ -+public interface Slot extends Control { -+ /** -+ * Gets the item of this slot -+ * @return the item of the slot -+ */ -+ public ItemStack getItem(); -+ -+ /** -+ * Sets a new item to this slot -+ * @param item the new item -+ * @return the instance -+ */ -+ public Slot setItem(ItemStack item); -+ -+ /** -+ * Called when the user puts an item into the slot. -+ * @param item the stack that the user wants to put in. \ -+ * The amount property in the stack will be calculated correctly, for example when the user right-clicks on the slot, it will only give one item. -+ * @return false if you want to cancel that. -+ */ -+ public boolean onItemPut(ItemStack item); -+ -+ /** -+ * Called when the user takes the item out of the slot -+ * @param item the stack that the user will get. \ -+ * The amount property in the stack will be calculated correctly,for example when the user right-clicks on the slot, it would split the amount. -+ * @return false if you want to cancel that. -+ */ -+ public boolean onItemTake(ItemStack item); -+ -+ /** -+ * Called when the user shift-clicks on the slot. -+ * If the user holds shift while left-clicking, no other actions will be done. -+ */ -+ public void onItemShiftClicked(); -+ -+ /** -+ * Called when the user wants to exchange the item on his cursor with that in the slot. -+ * @param current the item that is currently in the slot -+ * @param cursor the item that is on the cursor -+ * @return false, if you want to cancel the exchange -+ */ -+ public boolean onItemExchange(ItemStack current, ItemStack cursor); -+ -+ public Slot setDepth(int depth); -+ public int getDepth(); -+ -+ /** -+ * Returns if Spoutcraft will render the amount of items in the {@link net.minecraft.src.ItemStack} within the slot -+ * @return True if the slot renders item amount, false if not -+ */ -+ public boolean doesRenderAmount(); -+ -+ /** -+ * Sets if Spoutcraft will render the amount of items in the {@link net.minecraft.src.ItemStack} or not -+ * @param renderAmount True to render, false if not -+ * @return This object, for training -+ */ -+ public Slot setRenderAmount(boolean renderAmount); -+} ---- /dev/null -+++ org/spoutcraft/api/material/block/Tree.java -@@ -1,0 +1,40 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.api.material.block; -+ -+import org.spoutcraft.api.material.Plant; -+ -+public class Tree extends GenericBlock implements Plant{ -+ public Tree(String name, int id, int data) { -+ super(name, id, data); -+ } -+ -+ public boolean isHasGrowthStages() { -+ return false; -+ } -+ -+ public int getNumGrowthStages() { -+ return 0; -+ } -+ -+ public int getMinimumLightToGrow() { -+ return 0; -+ } -+} ---- /dev/null -+++ org/spoutcraft/api/animation/ExponentialAnimationProgress.java -@@ -1,0 +1,36 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.api.animation; -+ -+public class ExponentialAnimationProgress implements AnimationProgress { -+ private int strength; -+ -+ public ExponentialAnimationProgress() { -+ this(20); -+ } -+ -+ public ExponentialAnimationProgress(int strength) { -+ this.strength = strength; -+ } -+ -+ public double getValueAt(double progress) { -+ return (Math.pow(strength, progress) - 1) / (strength - 1); -+ } -+} ---- net/minecraft/src/RConConsoleSource.java -+++ net/minecraft/src/RConConsoleSource.java -@@ -3,30 +3,46 @@ - import net.minecraft.server.MinecraftServer; - - public class RConConsoleSource implements ICommandSender { -- public static final RConConsoleSource instance = new RConConsoleSource(); -- private StringBuffer b = new StringBuffer(); -- -+ -+ /** only ever used by MinecraftServer.executeCommand */ -+ public static final RConConsoleSource consoleBuffer = new RConConsoleSource(); -+ -+ /** RCon string buffer for log. */ -+ private StringBuffer buffer = new StringBuffer(); -+ -+ /** -+ * Clears the RCon log -+ */ - public void resetLog() { -- this.b.setLength(0); -- } -- -- public String getLogContents() { -- return this.b.toString(); -- } -- -+ this.buffer.setLength(0); -+ } -+ -+ public String getChatBuffer() { -+ return this.buffer.toString(); -+ } -+ -+ /** -+ * Gets the name of this command sender (usually username, but possibly "Rcon") -+ */ - public String getCommandSenderName() { - return "Rcon"; - } - -- public void sendChatToPlayer(ChatMessageComponent var1) { -- this.b.append(var1.toString()); -+ public void sendChatToPlayer(ChatMessageComponent par1ChatMessageComponent) { -+ this.buffer.append(par1ChatMessageComponent.toString()); - } - -- public boolean canCommandSenderUseCommand(int var1, String var2) { -+ /** -+ * Returns true if the command sender is allowed to use the given command. -+ */ -+ public boolean canCommandSenderUseCommand(int par1, String par2Str) { - return true; - } - -- public ChunkCoordinates getCommandSenderPosition() { -+ /** -+ * Return the position for this command sender. -+ */ -+ public ChunkCoordinates getPlayerCoordinates() { - return new ChunkCoordinates(0, 0, 0); - } - ---- /dev/null -+++ org/spoutcraft/client/gui/minimap/MinimapToggleCheckBox.java -@@ -1,0 +1,35 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.client.gui.minimap; -+ -+import org.spoutcraft.api.gui.GenericCheckBox; -+ -+public class MinimapToggleCheckBox extends GenericCheckBox { -+ public MinimapToggleCheckBox() { -+ super("Minimap Enabled"); -+ setChecked(MinimapConfig.getInstance().isEnabled()); -+ setTooltip("Minimap Enabled\nEnables or disables the minimap on the HUD."); -+ } -+ -+ @Override -+ public void onButtonClick() { -+ MinimapConfig.getInstance().setEnabled(isChecked()); -+ } -+} ---- /dev/null -+++ org/spoutcraft/client/gui/settings/controls/ViewBobbingButton.java -@@ -1,0 +1,40 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.client.gui.settings.controls; -+ -+import net.minecraft.src.Minecraft; -+ -+import org.spoutcraft.api.gui.GenericCheckBox; -+import org.spoutcraft.client.config.Configuration; -+ -+public class ViewBobbingButton extends GenericCheckBox { -+ public ViewBobbingButton() { -+ super("View Bobbing"); -+ setChecked(Configuration.isViewBobbing()); -+ setTooltip("More realistic movement."); -+ } -+ -+ @Override -+ public void onButtonClick() { -+ Configuration.setViewBobbing(!Configuration.isViewBobbing()); -+ Minecraft.getMinecraft().gameSettings.viewBobbing = Configuration.isViewBobbing(); -+ Configuration.write(); -+ } -+} ---- net/minecraft/src/SimpleReloadableResourceManager.java -+++ net/minecraft/src/SimpleReloadableResourceManager.java -@@ -5,6 +5,7 @@ - import com.google.common.collect.Lists; - import com.google.common.collect.Maps; - import com.google.common.collect.Sets; -+import com.prupe.mcpatcher.TexturePackChangeHandler; - import java.io.FileNotFoundException; - import java.io.IOException; - import java.util.Iterator; -@@ -13,63 +14,66 @@ - import java.util.Set; - - public class SimpleReloadableResourceManager implements ReloadableResourceManager { -- private static final Joiner a = Joiner.on(", "); -- private final Map b = Maps.newHashMap(); -- private final List c = Lists.newArrayList(); -- private final Set d = Sets.newLinkedHashSet(); -+ private static final Joiner joinerResourcePacks = Joiner.on(", "); -+ public final Map domainResourceManagers = Maps.newHashMap(); -+ private final List reloadListeners = Lists.newArrayList(); -+ private final Set setResourceDomains = Sets.newLinkedHashSet(); - private final MetadataSerializer rmMetadataSerializer; - -- public SimpleReloadableResourceManager(MetadataSerializer var1) { -- this.rmMetadataSerializer = var1; -+ public SimpleReloadableResourceManager(MetadataSerializer par1MetadataSerializer) { -+ this.rmMetadataSerializer = par1MetadataSerializer; - } - -- public void reloadResourcePack(ResourcePack var1) { -+ public void reloadResourcePack(ResourcePack par1ResourcePack) { - FallbackResourceManager var4; -- for(Iterator var2 = var1.getResourceDomains().iterator(); var2.hasNext(); var4.addResourcePack(var1)) { -+ -+ for (Iterator var2 = par1ResourcePack.getResourceDomains().iterator(); var2.hasNext(); var4.addResourcePack(par1ResourcePack)) { - String var3 = (String)var2.next(); -- this.d.add(var3); -- var4 = (FallbackResourceManager)this.b.get(var3); -- if(var4 == null) { -+ this.setResourceDomains.add(var3); -+ var4 = (FallbackResourceManager)this.domainResourceManagers.get(var3); -+ -+ if (var4 == null) { - var4 = new FallbackResourceManager(this.rmMetadataSerializer); -- this.b.put(var3, var4); -+ this.domainResourceManagers.put(var3, var4); - } - } -- - } - - public Set getResourceDomains() { -- return this.d; -+ return this.setResourceDomains; - } - -- public Resource getResource(ResourceLocation var1) throws IOException { -- ResourceManager var2 = (ResourceManager)this.b.get(var1.getResourceDomain()); -- if(var2 != null) { -- return var2.getResource(var1); -+ public Resource getResource(ResourceLocation par1ResourceLocation) throws IOException { -+ ResourceManager var2 = (ResourceManager)this.domainResourceManagers.get(par1ResourceLocation.getResourceDomain()); -+ -+ if (var2 != null) { -+ return var2.getResource(par1ResourceLocation); - } else { -- throw new FileNotFoundException(var1.toString()); -+ throw new FileNotFoundException(par1ResourceLocation.toString()); - } - } - -- public List getAllResources(ResourceLocation var1) throws IOException { -- ResourceManager var2 = (ResourceManager)this.b.get(var1.getResourceDomain()); -- if(var2 != null) { -- return var2.getAllResources(var1); -+ public List getAllResources(ResourceLocation par1ResourceLocation) throws IOException { -+ ResourceManager var2 = (ResourceManager)this.domainResourceManagers.get(par1ResourceLocation.getResourceDomain()); -+ -+ if (var2 != null) { -+ return var2.getAllResources(par1ResourceLocation); - } else { -- throw new FileNotFoundException(var1.toString()); -+ throw new FileNotFoundException(par1ResourceLocation.toString()); - } - } - - private void clearResources() { -- this.b.clear(); -- this.d.clear(); -+ this.domainResourceManagers.clear(); -+ this.setResourceDomains.clear(); - } - -- public void reloadResources(List var1) { -+ public void reloadResources(List par1List) { - this.clearResources(); -- Minecraft.getMinecraft().getLogAgent().logInfo("Reloading ResourceManager: " + a.join(Iterables.transform(var1, new SimpleReloadableResourceManagerINNER1(this)))); -- Iterator var2 = var1.iterator(); -+ Minecraft.getMinecraft().getLogAgent().logInfo("Reloading ResourceManager: " + joinerResourcePacks.join(Iterables.transform(par1List, new SimpleReloadableResourceManagerINNER1(this)))); -+ Iterator var2 = par1List.iterator(); - -- while(var2.hasNext()) { -+ while (var2.hasNext()) { - ResourcePack var3 = (ResourcePack)var2.next(); - this.reloadResourcePack(var3); - } -@@ -77,18 +81,20 @@ - this.notifyReloadListeners(); - } - -- public void registerReloadListener(ResourceManagerReloadListener var1) { -- this.c.add(var1); -- var1.onResourceManagerReload(this); -+ public void registerReloadListener(ResourceManagerReloadListener par1ResourceManagerReloadListener) { -+ this.reloadListeners.add(par1ResourceManagerReloadListener); -+ par1ResourceManagerReloadListener.onResourceManagerReload(this); - } - - private void notifyReloadListeners() { -- Iterator var1 = this.c.iterator(); -+ TexturePackChangeHandler.beforeChange1(false); -+ Iterator var1 = this.reloadListeners.iterator(); - -- while(var1.hasNext()) { -+ while (var1.hasNext()) { - ResourceManagerReloadListener var2 = (ResourceManagerReloadListener)var1.next(); - var2.onResourceManagerReload(this); - } - -+ TexturePackChangeHandler.afterChange1(false); - } - } ---- /dev/null -+++ org/spoutcraft/client/gui/minimap/ScanRadiusSlider.java -@@ -1,0 +1,62 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.client.gui.minimap; -+ -+import org.spoutcraft.api.ChatColor; -+import org.spoutcraft.api.gui.GenericSlider; -+ -+public class ScanRadiusSlider extends GenericSlider { -+ private static final int MIN_RADIUS = 0, MAX_RADIUS = 7; -+ -+ public ScanRadiusSlider() { -+ updateSliderPosition(); -+ setTooltip("Sets how far the overview-map scans the map when you move.\nHigher values will mean increased lag when you move"); -+ } -+ -+ public String getText() { -+ int radius = (int) (this.getSliderPosition() * (MAX_RADIUS - MIN_RADIUS) + MIN_RADIUS); -+ ChatColor color = ChatColor.WHITE; -+ if (radius > 3) { -+ color = ChatColor.YELLOW; -+ } -+ if (radius > 4) { -+ color = ChatColor.GOLD; -+ } -+ if (radius > 5) { -+ color = ChatColor.RED; -+ } -+ if (radius > 6) { -+ color = ChatColor.DARK_RED; -+ } -+ return color + "Scan Radius: " + radius + " chunks"; -+ } -+ -+ private void updateSliderPosition() { -+ setSliderPosition((float) (MinimapConfig.getInstance().getScanRadius() - MIN_RADIUS) / (float) (MAX_RADIUS - MIN_RADIUS)); -+ } -+ -+ @Override -+ public void onSliderDrag(float oldPos, float newPos) { -+ int newradius = (int) (newPos * (MAX_RADIUS - MIN_RADIUS) + MIN_RADIUS); -+ MinimapConfig.getInstance().setScanRadius(newradius); -+ MinimapConfig.getInstance().save(); -+ updateSliderPosition(); -+ } -+} ---- net/minecraft/src/InventoryCrafting.java -+++ net/minecraft/src/InventoryCrafting.java -@@ -1,64 +1,98 @@ - package net.minecraft.src; - - public class InventoryCrafting implements IInventory { -+ -+ /** List of the stacks in the crafting matrix. */ - private ItemStack[] stackList; -+ -+ /** the width of the crafting inventory */ - private int inventoryWidth; -+ -+ /** -+ * Class containing the callbacks for the events on_GUIClosed and on_CraftMaxtrixChanged. -+ */ - private Container eventHandler; - -- public InventoryCrafting(Container var1, int var2, int var3) { -- int var4 = var2 * var3; -+ public InventoryCrafting(Container par1Container, int par2, int par3) { -+ int var4 = par2 * par3; - this.stackList = new ItemStack[var4]; -- this.eventHandler = var1; -- this.inventoryWidth = var2; -+ this.eventHandler = par1Container; -+ this.inventoryWidth = par2; - } - -+ /** -+ * Returns the number of slots in the inventory. -+ */ - public int getSizeInventory() { - return this.stackList.length; - } - -- public ItemStack getStackInSlot(int var1) { -- return var1 >= this.getSizeInventory() ? null : this.stackList[var1]; -+ /** -+ * Returns the stack in slot i -+ */ -+ public ItemStack getStackInSlot(int par1) { -+ return par1 >= this.getSizeInventory() ? null : this.stackList[par1]; - } - -- public ItemStack getStackInRowAndColumn(int var1, int var2) { -- if(var1 >= 0 && var1 < this.inventoryWidth) { -- int var3 = var1 + var2 * this.inventoryWidth; -+ /** -+ * Returns the itemstack in the slot specified (Top left is 0, 0). Args: row, column -+ */ -+ public ItemStack getStackInRowAndColumn(int par1, int par2) { -+ if (par1 >= 0 && par1 < this.inventoryWidth) { -+ int var3 = par1 + par2 * this.inventoryWidth; - return this.getStackInSlot(var3); - } else { - return null; - } - } - -+ /** -+ * Returns the name of the inventory. -+ */ - public String getInvName() { - return "container.crafting"; - } - -+ /** -+ * If this returns false, the inventory name will be used as an unlocalized name, and translated into the player's -+ * language. Otherwise it will be used directly. -+ */ - public boolean isInvNameLocalized() { - return false; - } - -- public ItemStack getStackInSlotOnClosing(int var1) { -- if(this.stackList[var1] != null) { -- ItemStack var2 = this.stackList[var1]; -- this.stackList[var1] = null; -+ /** -+ * When some containers are closed they call this on each slot, then drop whatever it returns as an EntityItem - like -+ * when you close a workbench GUI. -+ */ -+ public ItemStack getStackInSlotOnClosing(int par1) { -+ if (this.stackList[par1] != null) { -+ ItemStack var2 = this.stackList[par1]; -+ this.stackList[par1] = null; - return var2; - } else { - return null; - } - } - -- public ItemStack decrStackSize(int var1, int var2) { -- if(this.stackList[var1] != null) { -+ /** -+ * Removes from an inventory slot (first arg) up to a specified number (second arg) of items and returns them in a new -+ * stack. -+ */ -+ public ItemStack decrStackSize(int par1, int par2) { -+ if (this.stackList[par1] != null) { - ItemStack var3; -- if(this.stackList[var1].stackSize <= var2) { -- var3 = this.stackList[var1]; -- this.stackList[var1] = null; -+ -+ if (this.stackList[par1].stackSize <= par2) { -+ var3 = this.stackList[par1]; -+ this.stackList[par1] = null; - this.eventHandler.onCraftMatrixChanged(this); - return var3; - } else { -- var3 = this.stackList[var1].splitStack(var2); -- if(this.stackList[var1].stackSize == 0) { -- this.stackList[var1] = null; -+ var3 = this.stackList[par1].splitStack(par2); -+ -+ if (this.stackList[par1].stackSize == 0) { -+ this.stackList[par1] = null; - } - - this.eventHandler.onCraftMatrixChanged(this); -@@ -69,29 +103,42 @@ - } - } - -- public void setInventorySlotContents(int var1, ItemStack var2) { -- this.stackList[var1] = var2; -+ /** -+ * Sets the given item stack to the specified slot in the inventory (can be crafting or armor sections). -+ */ -+ public void setInventorySlotContents(int par1, ItemStack par2ItemStack) { -+ this.stackList[par1] = par2ItemStack; - this.eventHandler.onCraftMatrixChanged(this); - } - -+ /** -+ * Returns the maximum stack size for a inventory slot. Seems to always be 64, possibly will be extended. *Isn't this -+ * more of a set than a get?* -+ */ - public int getInventoryStackLimit() { - return 64; - } - -- public void onInventoryChanged() { -- } -+ /** -+ * Called when an the contents of an Inventory change, usually -+ */ -+ public void onInventoryChanged() {} - -- public boolean isUseableByPlayer(EntityPlayer var1) { -+ /** -+ * Do not make give this method the name canInteractWith because it clashes with Container -+ */ -+ public boolean isUseableByPlayer(EntityPlayer par1EntityPlayer) { - return true; - } - -- public void openChest() { -- } -- -- public void closeChest() { -- } -- -- public boolean isItemValidForSlot(int var1, ItemStack var2) { -+ public void openChest() {} -+ -+ public void closeChest() {} -+ -+ /** -+ * Returns true if automation is allowed to insert the given stack (ignoring stack size) into the given slot. -+ */ -+ public boolean isItemValidForSlot(int par1, ItemStack par2ItemStack) { - return true; - } - } ---- /dev/null -+++ org/spoutcraft/api/SPOnly.java -@@ -1,0 +1,34 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.api; -+ -+import java.lang.annotation.Documented; -+import java.lang.annotation.Retention; -+import java.lang.annotation.RetentionPolicy; -+ -+@Documented -+@Retention(value = RetentionPolicy.RUNTIME) -+public @interface SPOnly { -+ public String author() default "SpoutDev"; -+ -+ public String version() default "1.0"; -+ -+ public String shortDescription() default "Indicates that the function or event only is used or runs when the client is in Single Player"; -+} ---- /dev/null -+++ org/spoutcraft/client/chunkcache/HeightMapAgent.java -@@ -1,0 +1,72 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.client.chunkcache; -+ -+import net.minecraft.src.Chunk; -+ -+import org.spoutcraft.client.chunkcache.HeightMap.HeightChunk; -+import org.spoutcraft.client.gui.minimap.MinimapUtils; -+ -+public class HeightMapAgent { -+ public static void scanChunk(Chunk chunk) { -+ try { -+ HeightMap map = HeightMap.getHeightMap(MinimapUtils.getWorldName()); -+ synchronized (map) { -+ HeightChunk hchunk = map.getChunk(chunk.xPosition, chunk.zPosition, true); -+ for (int x = 0; x < 16; x++) { -+ for (int z = 0; z < 16; z++) { -+ int h = getHighestBlock(chunk, x, z); -+ if (h > -1) { -+ byte id = (byte) chunk.getBlockID(x, h, z); -+ byte data = (byte) chunk.getBlockMetadata(x, h, z); -+ -+ // Check if block above is snow -+ if (chunk.getBlockID(x, h + 1, z) == 78) { -+ id = 78; -+ } -+ hchunk.setHeight(x, z, (short) h); -+ hchunk.setBlockId(x, z, id); -+ hchunk.setData(x, z, data); -+ } -+ } -+ } -+ } -+ } -+ catch (ArrayIndexOutOfBoundsException ignore) { -+ } -+ } -+ -+ public static void save() { -+ HeightMap.getHeightMap(MinimapUtils.getWorldName()).saveThreaded(); -+ } -+ -+ public static short getHighestBlock(Chunk chunk, int x, int z) { -+ boolean lastWater = false; -+ for (short y = 255; y > 0; y--) { -+ byte id = (byte) chunk.getBlockID(x, y, z); -+ if (id != 0 && id != 8 && id != 9) { -+ return (short) (lastWater ? y + 1 : y); -+ } else if (id == 8 || id == 9) { -+ lastWater = true; -+ } -+ } -+ return -1; -+ } -+} ---- net/minecraft/src/WorldGenMinable.java -+++ net/minecraft/src/WorldGenMinable.java -@@ -3,34 +3,40 @@ - import java.util.Random; - - public class WorldGenMinable extends WorldGenerator { -+ -+ /** The block ID of the ore to be placed using this generator. */ - private int minableBlockId; -+ -+ /** The number of blocks to generate. */ - private int numberOfBlocks; -+ -+ /** The block ID of the block to be replaced with the ore (usually stone) */ - private int blockToReplace; - -- public WorldGenMinable(int var1, int var2) { -- this(var1, var2, Block.stone.blockID); -- } -- -- public WorldGenMinable(int var1, int var2, int var3) { -- this.minableBlockId = var1; -- this.numberOfBlocks = var2; -- this.blockToReplace = var3; -- } -- -- public boolean generate(World var1, Random var2, int var3, int var4, int var5) { -- float var6 = var2.nextFloat() * (float)Math.PI; -- double var7 = (double)((float)(var3 + 8) + MathHelper.sin(var6) * (float)this.numberOfBlocks / 8.0F); -- double var9 = (double)((float)(var3 + 8) - MathHelper.sin(var6) * (float)this.numberOfBlocks / 8.0F); -- double var11 = (double)((float)(var5 + 8) + MathHelper.cos(var6) * (float)this.numberOfBlocks / 8.0F); -- double var13 = (double)((float)(var5 + 8) - MathHelper.cos(var6) * (float)this.numberOfBlocks / 8.0F); -- double var15 = (double)(var4 + var2.nextInt(3) - 2); -- double var17 = (double)(var4 + var2.nextInt(3) - 2); -- -- for(int var19 = 0; var19 <= this.numberOfBlocks; ++var19) { -+ public WorldGenMinable(int par1, int par2) { -+ this(par1, par2, Block.stone.blockID); -+ } -+ -+ public WorldGenMinable(int par1, int par2, int par3) { -+ this.minableBlockId = par1; -+ this.numberOfBlocks = par2; -+ this.blockToReplace = par3; -+ } -+ -+ public boolean generate(World par1World, Random par2Random, int par3, int par4, int par5) { -+ float var6 = par2Random.nextFloat() * (float)Math.PI; -+ double var7 = (double)((float)(par3 + 8) + MathHelper.sin(var6) * (float)this.numberOfBlocks / 8.0F); -+ double var9 = (double)((float)(par3 + 8) - MathHelper.sin(var6) * (float)this.numberOfBlocks / 8.0F); -+ double var11 = (double)((float)(par5 + 8) + MathHelper.cos(var6) * (float)this.numberOfBlocks / 8.0F); -+ double var13 = (double)((float)(par5 + 8) - MathHelper.cos(var6) * (float)this.numberOfBlocks / 8.0F); -+ double var15 = (double)(par4 + par2Random.nextInt(3) - 2); -+ double var17 = (double)(par4 + par2Random.nextInt(3) - 2); -+ -+ for (int var19 = 0; var19 <= this.numberOfBlocks; ++var19) { - double var20 = var7 + (var9 - var7) * (double)var19 / (double)this.numberOfBlocks; - double var22 = var15 + (var17 - var15) * (double)var19 / (double)this.numberOfBlocks; - double var24 = var11 + (var13 - var11) * (double)var19 / (double)this.numberOfBlocks; -- double var26 = var2.nextDouble() * (double)this.numberOfBlocks / 16.0D; -+ double var26 = par2Random.nextDouble() * (double)this.numberOfBlocks / 16.0D; - double var28 = (double)(MathHelper.sin((float)var19 * (float)Math.PI / (float)this.numberOfBlocks) + 1.0F) * var26 + 1.0D; - double var30 = (double)(MathHelper.sin((float)var19 * (float)Math.PI / (float)this.numberOfBlocks) + 1.0F) * var26 + 1.0D; - int var32 = MathHelper.floor_double(var20 - var28 / 2.0D); -@@ -40,16 +46,19 @@ - int var36 = MathHelper.floor_double(var22 + var30 / 2.0D); - int var37 = MathHelper.floor_double(var24 + var28 / 2.0D); - -- for(int var38 = var32; var38 <= var35; ++var38) { -+ for (int var38 = var32; var38 <= var35; ++var38) { - double var39 = ((double)var38 + 0.5D - var20) / (var28 / 2.0D); -- if(var39 * var39 < 1.0D) { -- for(int var41 = var33; var41 <= var36; ++var41) { -+ -+ if (var39 * var39 < 1.0D) { -+ for (int var41 = var33; var41 <= var36; ++var41) { - double var42 = ((double)var41 + 0.5D - var22) / (var30 / 2.0D); -- if(var39 * var39 + var42 * var42 < 1.0D) { -- for(int var44 = var34; var44 <= var37; ++var44) { -+ -+ if (var39 * var39 + var42 * var42 < 1.0D) { -+ for (int var44 = var34; var44 <= var37; ++var44) { - double var45 = ((double)var44 + 0.5D - var24) / (var28 / 2.0D); -- if(var39 * var39 + var42 * var42 + var45 * var45 < 1.0D && var1.getBlockId(var38, var41, var44) == this.blockToReplace) { -- var1.setBlock(var38, var41, var44, this.minableBlockId, 0, 2); -+ -+ if (var39 * var39 + var42 * var42 + var45 * var45 < 1.0D && par1World.getBlockId(var38, var41, var44) == this.blockToReplace) { -+ par1World.setBlock(var38, var41, var44, this.minableBlockId, 0, 2); - } - } - } ---- net/minecraft/src/IRegistry.java -+++ net/minecraft/src/IRegistry.java -@@ -3,5 +3,8 @@ - public interface IRegistry { - Object getObject(Object var1); - -+ /** -+ * Register an object on this registry. -+ */ - void putObject(Object var1, Object var2); - } ---- net/minecraft/src/ExceptionMcoService.java -+++ net/minecraft/src/ExceptionMcoService.java -@@ -2,17 +2,17 @@ - - public class ExceptionMcoService extends Exception { - public final int field_96392_a; -- public final String b; -+ public final String field_96391_b; - public final int field_130097_c; - -- public ExceptionMcoService(int var1, String var2, int var3) { -- super(var2); -- this.field_96392_a = var1; -- this.b = var2; -- this.field_130097_c = var3; -+ public ExceptionMcoService(int par1, String par2Str, int par3) { -+ super(par2Str); -+ this.field_96392_a = par1; -+ this.field_96391_b = par2Str; -+ this.field_130097_c = par3; - } - - public String toString() { -- return this.field_130097_c != -1 ? "Realms ( ErrorCode: " + this.field_130097_c + " )" : "Realms: " + this.b; -+ return this.field_130097_c != -1 ? "Realms ( ErrorCode: " + this.field_130097_c + " )" : "Realms: " + this.field_96391_b; - } - } ---- /dev/null -+++ org/spoutcraft/client/gui/settings/controls/AmbientOcclusionButton.java -@@ -1,0 +1,43 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.client.gui.settings.controls; -+ -+import net.minecraft.src.Minecraft; -+ -+import org.spoutcraft.client.config.Configuration; -+ -+public class AmbientOcclusionButton extends AutomatedCheckBox { -+ public AmbientOcclusionButton() { -+ super("Ambient Occlusion"); -+ setChecked(Configuration.isAmbientOcclusion()); -+ setTooltip("Applies Ambient Occlusion to lighting calculations.\nTurn off to improve FPS."); -+ } -+ -+ @Override -+ public void onButtonClick() { -+ Configuration.setAmbientOcclusion(!Configuration.isAmbientOcclusion()); -+ Configuration.write(); -+ -+ if (Minecraft.getMinecraft().theWorld != null) { -+ Minecraft.getMinecraft().renderGlobal.prepareAO(); -+ Minecraft.getMinecraft().renderGlobal.loadRenderers(); -+ } -+ } -+} ---- net/minecraft/src/BlockRailPowered.java -+++ net/minecraft/src/BlockRailPowered.java -@@ -3,132 +3,150 @@ - public class BlockRailPowered extends BlockRailBase { - protected Icon theIcon; - -- protected BlockRailPowered(int var1) { -- super(var1, true); -- } -- -- public Icon getIcon(int var1, int var2) { -- return (var2 & 8) == 0 ? this.blockIcon : this.theIcon; -- } -- -- public void registerIcons(IconRegister var1) { -- super.registerIcons(var1); -- this.theIcon = var1.registerIcon(this.getTextureName() + "_powered"); -- } -- -- protected boolean func_94360_a(World var1, int var2, int var3, int var4, int var5, boolean var6, int var7) { -- if(var7 >= 8) { -+ protected BlockRailPowered(int par1) { -+ super(par1, true); -+ } -+ -+ /** -+ * From the specified side and block metadata retrieves the blocks texture. Args: side, metadata -+ */ -+ public Icon getIcon(int par1, int par2) { -+ return (par2 & 8) == 0 ? this.blockIcon : this.theIcon; -+ } -+ -+ /** -+ * When this method is called, your block should register all the icons it needs with the given IconRegister. This is -+ * the only chance you get to register icons. -+ */ -+ public void registerIcons(IconRegister par1IconRegister) { -+ super.registerIcons(par1IconRegister); -+ this.theIcon = par1IconRegister.registerIcon(this.getTextureName() + "_powered"); -+ } -+ -+ protected boolean func_94360_a(World par1World, int par2, int par3, int par4, int par5, boolean par6, int par7) { -+ if (par7 >= 8) { - return false; - } else { -- int var8 = var5 & 7; -+ int var8 = par5 & 7; - boolean var9 = true; -- switch(var8) { -- case 0: -- if(var6) { -- ++var4; -- } else { -- --var4; -- } -- break; -- case 1: -- if(var6) { -- --var2; -- } else { -- ++var2; -- } -- break; -- case 2: -- if(var6) { -- --var2; -- } else { -- ++var2; -- ++var3; -- var9 = false; -- } -- -- var8 = 1; -- break; -- case 3: -- if(var6) { -- --var2; -- ++var3; -- var9 = false; -- } else { -- ++var2; -- } -- -- var8 = 1; -- break; -- case 4: -- if(var6) { -- ++var4; -- } else { -- --var4; -- ++var3; -- var9 = false; -- } -- -- var8 = 0; -- break; -- case 5: -- if(var6) { -- ++var4; -- ++var3; -- var9 = false; -- } else { -- --var4; -- } -- -- var8 = 0; -+ -+ switch (var8) { -+ case 0: -+ if (par6) { -+ ++par4; -+ } else { -+ --par4; -+ } -+ -+ break; -+ -+ case 1: -+ if (par6) { -+ --par2; -+ } else { -+ ++par2; -+ } -+ -+ break; -+ -+ case 2: -+ if (par6) { -+ --par2; -+ } else { -+ ++par2; -+ ++par3; -+ var9 = false; -+ } -+ -+ var8 = 1; -+ break; -+ -+ case 3: -+ if (par6) { -+ --par2; -+ ++par3; -+ var9 = false; -+ } else { -+ ++par2; -+ } -+ -+ var8 = 1; -+ break; -+ -+ case 4: -+ if (par6) { -+ ++par4; -+ } else { -+ --par4; -+ ++par3; -+ var9 = false; -+ } -+ -+ var8 = 0; -+ break; -+ -+ case 5: -+ if (par6) { -+ ++par4; -+ ++par3; -+ var9 = false; -+ } else { -+ --par4; -+ } -+ -+ var8 = 0; - } - -- return this.func_94361_a(var1, var2, var3, var4, var6, var7, var8) ? true : var9 && this.func_94361_a(var1, var2, var3 - 1, var4, var6, var7, var8); -+ return this.func_94361_a(par1World, par2, par3, par4, par6, par7, var8) ? true : var9 && this.func_94361_a(par1World, par2, par3 - 1, par4, par6, par7, var8); - } - } - -- protected boolean func_94361_a(World var1, int var2, int var3, int var4, boolean var5, int var6, int var7) { -- int var8 = var1.getBlockId(var2, var3, var4); -- if(var8 == this.blockID) { -- int var9 = var1.getBlockMetadata(var2, var3, var4); -+ protected boolean func_94361_a(World par1World, int par2, int par3, int par4, boolean par5, int par6, int par7) { -+ int var8 = par1World.getBlockId(par2, par3, par4); -+ -+ if (var8 == this.blockID) { -+ int var9 = par1World.getBlockMetadata(par2, par3, par4); - int var10 = var9 & 7; -- if(var7 == 1 && (var10 == 0 || var10 == 4 || var10 == 5)) { -- return false; -- } -- -- if(var7 == 0 && (var10 == 1 || var10 == 2 || var10 == 3)) { -- return false; -- } -- -- if((var9 & 8) != 0) { -- if(var1.isBlockIndirectlyGettingPowered(var2, var3, var4)) { -+ -+ if (par7 == 1 && (var10 == 0 || var10 == 4 || var10 == 5)) { -+ return false; -+ } -+ -+ if (par7 == 0 && (var10 == 1 || var10 == 2 || var10 == 3)) { -+ return false; -+ } -+ -+ if ((var9 & 8) != 0) { -+ if (par1World.isBlockIndirectlyGettingPowered(par2, par3, par4)) { - return true; - } - -- return this.func_94360_a(var1, var2, var3, var4, var9, var5, var6 + 1); -+ return this.func_94360_a(par1World, par2, par3, par4, var9, par5, par6 + 1); - } - } - - return false; - } - -- protected void func_94358_a(World var1, int var2, int var3, int var4, int var5, int var6, int var7) { -- boolean var8 = var1.isBlockIndirectlyGettingPowered(var2, var3, var4); -- var8 = var8 || this.func_94360_a(var1, var2, var3, var4, var5, true, 0) || this.func_94360_a(var1, var2, var3, var4, var5, false, 0); -+ protected void func_94358_a(World par1World, int par2, int par3, int par4, int par5, int par6, int par7) { -+ boolean var8 = par1World.isBlockIndirectlyGettingPowered(par2, par3, par4); -+ var8 = var8 || this.func_94360_a(par1World, par2, par3, par4, par5, true, 0) || this.func_94360_a(par1World, par2, par3, par4, par5, false, 0); - boolean var9 = false; -- if(var8 && (var5 & 8) == 0) { -- var1.setBlockMetadata(var2, var3, var4, var6 | 8, 3); -+ -+ if (var8 && (par5 & 8) == 0) { -+ par1World.setBlockMetadataWithNotify(par2, par3, par4, par6 | 8, 3); - var9 = true; -- } else if(!var8 && (var5 & 8) != 0) { -- var1.setBlockMetadata(var2, var3, var4, var6, 3); -+ } else if (!var8 && (par5 & 8) != 0) { -+ par1World.setBlockMetadataWithNotify(par2, par3, par4, par6, 3); - var9 = true; - } - -- if(var9) { -- var1.notifyBlocksOfNeighborChange(var2, var3 - 1, var4, this.blockID); -- if(var6 == 2 || var6 == 3 || var6 == 4 || var6 == 5) { -- var1.notifyBlocksOfNeighborChange(var2, var3 + 1, var4, this.blockID); -+ if (var9) { -+ par1World.notifyBlocksOfNeighborChange(par2, par3 - 1, par4, this.blockID); -+ -+ if (par6 == 2 || par6 == 3 || par6 == 4 || par6 == 5) { -+ par1World.notifyBlocksOfNeighborChange(par2, par3 + 1, par4, this.blockID); - } - } -- - } - } ---- net/minecraft/src/EntityAIOpenDoor.java -+++ net/minecraft/src/EntityAIOpenDoor.java -@@ -4,28 +4,39 @@ - boolean field_75361_i; - int field_75360_j; - -- public EntityAIOpenDoor(EntityLiving var1, boolean var2) { -- super(var1); -- this.theEntity = var1; -- this.field_75361_i = var2; -+ public EntityAIOpenDoor(EntityLiving par1EntityLiving, boolean par2) { -+ super(par1EntityLiving); -+ this.theEntity = par1EntityLiving; -+ this.field_75361_i = par2; - } - -+ /** -+ * Returns whether an in-progress EntityAIBase should continue executing -+ */ - public boolean continueExecuting() { - return this.field_75361_i && this.field_75360_j > 0 && super.continueExecuting(); - } - -+ /** -+ * Execute a one shot task or start executing a continuous task -+ */ - public void startExecuting() { - this.field_75360_j = 20; - this.targetDoor.onPoweredBlockChange(this.theEntity.worldObj, this.entityPosX, this.entityPosY, this.entityPosZ, true); - } - -+ /** -+ * Resets the task -+ */ - public void resetTask() { -- if(this.field_75361_i) { -+ if (this.field_75361_i) { - this.targetDoor.onPoweredBlockChange(this.theEntity.worldObj, this.entityPosX, this.entityPosY, this.entityPosZ, false); - } -- - } - -+ /** -+ * Updates the task -+ */ - public void updateTask() { - --this.field_75360_j; - super.updateTask(); ---- net/minecraft/src/ChestItemRenderHelper.java -+++ net/minecraft/src/ChestItemRenderHelper.java -@@ -1,19 +1,27 @@ - package net.minecraft.src; - - public class ChestItemRenderHelper { -+ -+ /** The static instance of ChestItemRenderHelper. */ - public static ChestItemRenderHelper instance = new ChestItemRenderHelper(); -+ -+ /** Instance of Chest's Tile Entity. */ - private TileEntityChest theChest = new TileEntityChest(0); - private TileEntityChest field_142033_c = new TileEntityChest(1); -+ -+ /** Instance of Ender Chest's Tile Entity. */ - private TileEntityEnderChest theEnderChest = new TileEntityEnderChest(); - -- public void renderChest(Block var1, int var2, float var3) { -- if(var1.blockID == Block.enderChest.blockID) { -+ /** -+ * Renders a chest at 0,0,0 - used for item rendering -+ */ -+ public void renderChest(Block par1Block, int par2, float par3) { -+ if (par1Block.blockID == Block.enderChest.blockID) { - TileEntityRenderer.instance.renderTileEntityAt(this.theEnderChest, 0.0D, 0.0D, 0.0D, 0.0F); -- } else if(var1.blockID == Block.chestTrapped.blockID) { -+ } else if (par1Block.blockID == Block.chestTrapped.blockID) { - TileEntityRenderer.instance.renderTileEntityAt(this.field_142033_c, 0.0D, 0.0D, 0.0D, 0.0F); - } else { - TileEntityRenderer.instance.renderTileEntityAt(this.theChest, 0.0D, 0.0D, 0.0D, 0.0F); - } -- - } - } ---- net/minecraft/src/ComponentScatteredFeatureJunglePyramid.java -+++ net/minecraft/src/ComponentScatteredFeatureJunglePyramid.java -@@ -7,206 +7,221 @@ - private boolean field_74948_i; - private boolean field_74945_j; - private boolean field_74946_k; -- private static final WeightedRandomChestContent[] junglePyramidsChestContents = new WeightedRandomChestContent[]{new WeightedRandomChestContent(Item.diamond.itemID, 0, 1, 3, 3), new WeightedRandomChestContent(Item.ingotIron.itemID, 0, 1, 5, 10), new WeightedRandomChestContent(Item.ingotGold.itemID, 0, 2, 7, 15), new WeightedRandomChestContent(Item.emerald.itemID, 0, 1, 3, 2), new WeightedRandomChestContent(Item.bone.itemID, 0, 4, 6, 20), new WeightedRandomChestContent(Item.rottenFlesh.itemID, 0, 3, 7, 16), new WeightedRandomChestContent(Item.saddle.itemID, 0, 1, 1, 3), new WeightedRandomChestContent(Item.horseArmorIron.itemID, 0, 1, 1, 1), new WeightedRandomChestContent(Item.horseArmorGold.itemID, 0, 1, 1, 1), new WeightedRandomChestContent(Item.horseArmorDiamond.itemID, 0, 1, 1, 1)}; -- private static final WeightedRandomChestContent[] junglePyramidsDispenserContents = new WeightedRandomChestContent[]{new WeightedRandomChestContent(Item.arrow.itemID, 0, 2, 7, 30)}; -+ -+ /** List of Chest contents to be generated in the Jungle Pyramid chests. */ -+ private static final WeightedRandomChestContent[] junglePyramidsChestContents = new WeightedRandomChestContent[] {new WeightedRandomChestContent(Item.diamond.itemID, 0, 1, 3, 3), new WeightedRandomChestContent(Item.ingotIron.itemID, 0, 1, 5, 10), new WeightedRandomChestContent(Item.ingotGold.itemID, 0, 2, 7, 15), new WeightedRandomChestContent(Item.emerald.itemID, 0, 1, 3, 2), new WeightedRandomChestContent(Item.bone.itemID, 0, 4, 6, 20), new WeightedRandomChestContent(Item.rottenFlesh.itemID, 0, 3, 7, 16), new WeightedRandomChestContent(Item.saddle.itemID, 0, 1, 1, 3), new WeightedRandomChestContent(Item.horseArmorIron.itemID, 0, 1, 1, 1), new WeightedRandomChestContent(Item.horseArmorGold.itemID, 0, 1, 1, 1), new WeightedRandomChestContent(Item.horseArmorDiamond.itemID, 0, 1, 1, 1)}; -+ -+ /** -+ * List of Dispenser contents to be generated in the Jungle Pyramid dispensers. -+ */ -+ private static final WeightedRandomChestContent[] junglePyramidsDispenserContents = new WeightedRandomChestContent[] {new WeightedRandomChestContent(Item.arrow.itemID, 0, 2, 7, 30)}; -+ -+ /** List of random stones to be generated in the Jungle Pyramid. */ - private static StructureScatteredFeatureStones junglePyramidsRandomScatteredStones = new StructureScatteredFeatureStones((ComponentScatteredFeaturePieces2)null); - -- public ComponentScatteredFeatureJunglePyramid() { -- } -- -- public ComponentScatteredFeatureJunglePyramid(Random var1, int var2, int var3) { -- super(var1, var2, 64, var3, 12, 10, 15); -- } -- -- protected void func_143012_a(NBTTagCompound var1) { -- super.func_143012_a(var1); -- var1.setBoolean("placedMainChest", this.field_74947_h); -- var1.setBoolean("placedHiddenChest", this.field_74948_i); -- var1.setBoolean("placedTrap1", this.field_74945_j); -- var1.setBoolean("placedTrap2", this.field_74946_k); -- } -- -- protected void func_143011_b(NBTTagCompound var1) { -- super.func_143011_b(var1); -- this.field_74947_h = var1.getBoolean("placedMainChest"); -- this.field_74948_i = var1.getBoolean("placedHiddenChest"); -- this.field_74945_j = var1.getBoolean("placedTrap1"); -- this.field_74946_k = var1.getBoolean("placedTrap2"); -- } -- -- public boolean addComponentParts(World var1, Random var2, StructureBoundingBox var3) { -- if(!this.func_74935_a(var1, var3, 0)) { -+ public ComponentScatteredFeatureJunglePyramid() {} -+ -+ public ComponentScatteredFeatureJunglePyramid(Random par1Random, int par2, int par3) { -+ super(par1Random, par2, 64, par3, 12, 10, 15); -+ } -+ -+ protected void func_143012_a(NBTTagCompound par1NBTTagCompound) { -+ super.func_143012_a(par1NBTTagCompound); -+ par1NBTTagCompound.setBoolean("placedMainChest", this.field_74947_h); -+ par1NBTTagCompound.setBoolean("placedHiddenChest", this.field_74948_i); -+ par1NBTTagCompound.setBoolean("placedTrap1", this.field_74945_j); -+ par1NBTTagCompound.setBoolean("placedTrap2", this.field_74946_k); -+ } -+ -+ protected void func_143011_b(NBTTagCompound par1NBTTagCompound) { -+ super.func_143011_b(par1NBTTagCompound); -+ this.field_74947_h = par1NBTTagCompound.getBoolean("placedMainChest"); -+ this.field_74948_i = par1NBTTagCompound.getBoolean("placedHiddenChest"); -+ this.field_74945_j = par1NBTTagCompound.getBoolean("placedTrap1"); -+ this.field_74946_k = par1NBTTagCompound.getBoolean("placedTrap2"); -+ } -+ -+ /** -+ * second Part of Structure generating, this for example places Spiderwebs, Mob Spawners, it closes Mineshafts at the -+ * end, it adds Fences... -+ */ -+ public boolean addComponentParts(World par1World, Random par2Random, StructureBoundingBox par3StructureBoundingBox) { -+ if (!this.func_74935_a(par1World, par3StructureBoundingBox, 0)) { - return false; - } else { - int var4 = this.getMetadataWithOffset(Block.stairsCobblestone.blockID, 3); - int var5 = this.getMetadataWithOffset(Block.stairsCobblestone.blockID, 2); - int var6 = this.getMetadataWithOffset(Block.stairsCobblestone.blockID, 0); - int var7 = this.getMetadataWithOffset(Block.stairsCobblestone.blockID, 1); -- this.fillWithRandomizedBlocks(var1, var3, 0, -4, 0, this.scatteredFeatureSizeX - 1, 0, this.scatteredFeatureSizeZ - 1, false, var2, junglePyramidsRandomScatteredStones); -- this.fillWithRandomizedBlocks(var1, var3, 2, 1, 2, 9, 2, 2, false, var2, junglePyramidsRandomScatteredStones); -- this.fillWithRandomizedBlocks(var1, var3, 2, 1, 12, 9, 2, 12, false, var2, junglePyramidsRandomScatteredStones); -- this.fillWithRandomizedBlocks(var1, var3, 2, 1, 3, 2, 2, 11, false, var2, junglePyramidsRandomScatteredStones); -- this.fillWithRandomizedBlocks(var1, var3, 9, 1, 3, 9, 2, 11, false, var2, junglePyramidsRandomScatteredStones); -- this.fillWithRandomizedBlocks(var1, var3, 1, 3, 1, 10, 6, 1, false, var2, junglePyramidsRandomScatteredStones); -- this.fillWithRandomizedBlocks(var1, var3, 1, 3, 13, 10, 6, 13, false, var2, junglePyramidsRandomScatteredStones); -- this.fillWithRandomizedBlocks(var1, var3, 1, 3, 2, 1, 6, 12, false, var2, junglePyramidsRandomScatteredStones); -- this.fillWithRandomizedBlocks(var1, var3, 10, 3, 2, 10, 6, 12, false, var2, junglePyramidsRandomScatteredStones); -- this.fillWithRandomizedBlocks(var1, var3, 2, 3, 2, 9, 3, 12, false, var2, junglePyramidsRandomScatteredStones); -- this.fillWithRandomizedBlocks(var1, var3, 2, 6, 2, 9, 6, 12, false, var2, junglePyramidsRandomScatteredStones); -- this.fillWithRandomizedBlocks(var1, var3, 3, 7, 3, 8, 7, 11, false, var2, junglePyramidsRandomScatteredStones); -- this.fillWithRandomizedBlocks(var1, var3, 4, 8, 4, 7, 8, 10, false, var2, junglePyramidsRandomScatteredStones); -- this.fillWithAir(var1, var3, 3, 1, 3, 8, 2, 11); -- this.fillWithAir(var1, var3, 4, 3, 6, 7, 3, 9); -- this.fillWithAir(var1, var3, 2, 4, 2, 9, 5, 12); -- this.fillWithAir(var1, var3, 4, 6, 5, 7, 6, 9); -- this.fillWithAir(var1, var3, 5, 7, 6, 6, 7, 8); -- this.fillWithAir(var1, var3, 5, 1, 2, 6, 2, 2); -- this.fillWithAir(var1, var3, 5, 2, 12, 6, 2, 12); -- this.fillWithAir(var1, var3, 5, 5, 1, 6, 5, 1); -- this.fillWithAir(var1, var3, 5, 5, 13, 6, 5, 13); -- this.placeBlockAtCurrentPosition(var1, 0, 0, 1, 5, 5, var3); -- this.placeBlockAtCurrentPosition(var1, 0, 0, 10, 5, 5, var3); -- this.placeBlockAtCurrentPosition(var1, 0, 0, 1, 5, 9, var3); -- this.placeBlockAtCurrentPosition(var1, 0, 0, 10, 5, 9, var3); -- -+ this.fillWithRandomizedBlocks(par1World, par3StructureBoundingBox, 0, -4, 0, this.scatteredFeatureSizeX - 1, 0, this.scatteredFeatureSizeZ - 1, false, par2Random, junglePyramidsRandomScatteredStones); -+ this.fillWithRandomizedBlocks(par1World, par3StructureBoundingBox, 2, 1, 2, 9, 2, 2, false, par2Random, junglePyramidsRandomScatteredStones); -+ this.fillWithRandomizedBlocks(par1World, par3StructureBoundingBox, 2, 1, 12, 9, 2, 12, false, par2Random, junglePyramidsRandomScatteredStones); -+ this.fillWithRandomizedBlocks(par1World, par3StructureBoundingBox, 2, 1, 3, 2, 2, 11, false, par2Random, junglePyramidsRandomScatteredStones); -+ this.fillWithRandomizedBlocks(par1World, par3StructureBoundingBox, 9, 1, 3, 9, 2, 11, false, par2Random, junglePyramidsRandomScatteredStones); -+ this.fillWithRandomizedBlocks(par1World, par3StructureBoundingBox, 1, 3, 1, 10, 6, 1, false, par2Random, junglePyramidsRandomScatteredStones); -+ this.fillWithRandomizedBlocks(par1World, par3StructureBoundingBox, 1, 3, 13, 10, 6, 13, false, par2Random, junglePyramidsRandomScatteredStones); -+ this.fillWithRandomizedBlocks(par1World, par3StructureBoundingBox, 1, 3, 2, 1, 6, 12, false, par2Random, junglePyramidsRandomScatteredStones); -+ this.fillWithRandomizedBlocks(par1World, par3StructureBoundingBox, 10, 3, 2, 10, 6, 12, false, par2Random, junglePyramidsRandomScatteredStones); -+ this.fillWithRandomizedBlocks(par1World, par3StructureBoundingBox, 2, 3, 2, 9, 3, 12, false, par2Random, junglePyramidsRandomScatteredStones); -+ this.fillWithRandomizedBlocks(par1World, par3StructureBoundingBox, 2, 6, 2, 9, 6, 12, false, par2Random, junglePyramidsRandomScatteredStones); -+ this.fillWithRandomizedBlocks(par1World, par3StructureBoundingBox, 3, 7, 3, 8, 7, 11, false, par2Random, junglePyramidsRandomScatteredStones); -+ this.fillWithRandomizedBlocks(par1World, par3StructureBoundingBox, 4, 8, 4, 7, 8, 10, false, par2Random, junglePyramidsRandomScatteredStones); -+ this.fillWithAir(par1World, par3StructureBoundingBox, 3, 1, 3, 8, 2, 11); -+ this.fillWithAir(par1World, par3StructureBoundingBox, 4, 3, 6, 7, 3, 9); -+ this.fillWithAir(par1World, par3StructureBoundingBox, 2, 4, 2, 9, 5, 12); -+ this.fillWithAir(par1World, par3StructureBoundingBox, 4, 6, 5, 7, 6, 9); -+ this.fillWithAir(par1World, par3StructureBoundingBox, 5, 7, 6, 6, 7, 8); -+ this.fillWithAir(par1World, par3StructureBoundingBox, 5, 1, 2, 6, 2, 2); -+ this.fillWithAir(par1World, par3StructureBoundingBox, 5, 2, 12, 6, 2, 12); -+ this.fillWithAir(par1World, par3StructureBoundingBox, 5, 5, 1, 6, 5, 1); -+ this.fillWithAir(par1World, par3StructureBoundingBox, 5, 5, 13, 6, 5, 13); -+ this.placeBlockAtCurrentPosition(par1World, 0, 0, 1, 5, 5, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, 0, 0, 10, 5, 5, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, 0, 0, 1, 5, 9, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, 0, 0, 10, 5, 9, par3StructureBoundingBox); - int var8; -- for(var8 = 0; var8 <= 14; var8 += 14) { -- this.fillWithRandomizedBlocks(var1, var3, 2, 4, var8, 2, 5, var8, false, var2, junglePyramidsRandomScatteredStones); -- this.fillWithRandomizedBlocks(var1, var3, 4, 4, var8, 4, 5, var8, false, var2, junglePyramidsRandomScatteredStones); -- this.fillWithRandomizedBlocks(var1, var3, 7, 4, var8, 7, 5, var8, false, var2, junglePyramidsRandomScatteredStones); -- this.fillWithRandomizedBlocks(var1, var3, 9, 4, var8, 9, 5, var8, false, var2, junglePyramidsRandomScatteredStones); -+ -+ for (var8 = 0; var8 <= 14; var8 += 14) { -+ this.fillWithRandomizedBlocks(par1World, par3StructureBoundingBox, 2, 4, var8, 2, 5, var8, false, par2Random, junglePyramidsRandomScatteredStones); -+ this.fillWithRandomizedBlocks(par1World, par3StructureBoundingBox, 4, 4, var8, 4, 5, var8, false, par2Random, junglePyramidsRandomScatteredStones); -+ this.fillWithRandomizedBlocks(par1World, par3StructureBoundingBox, 7, 4, var8, 7, 5, var8, false, par2Random, junglePyramidsRandomScatteredStones); -+ this.fillWithRandomizedBlocks(par1World, par3StructureBoundingBox, 9, 4, var8, 9, 5, var8, false, par2Random, junglePyramidsRandomScatteredStones); - } - -- this.fillWithRandomizedBlocks(var1, var3, 5, 6, 0, 6, 6, 0, false, var2, junglePyramidsRandomScatteredStones); -+ this.fillWithRandomizedBlocks(par1World, par3StructureBoundingBox, 5, 6, 0, 6, 6, 0, false, par2Random, junglePyramidsRandomScatteredStones); - -- for(var8 = 0; var8 <= 11; var8 += 11) { -- for(int var9 = 2; var9 <= 12; var9 += 2) { -- this.fillWithRandomizedBlocks(var1, var3, var8, 4, var9, var8, 5, var9, false, var2, junglePyramidsRandomScatteredStones); -+ for (var8 = 0; var8 <= 11; var8 += 11) { -+ for (int var9 = 2; var9 <= 12; var9 += 2) { -+ this.fillWithRandomizedBlocks(par1World, par3StructureBoundingBox, var8, 4, var9, var8, 5, var9, false, par2Random, junglePyramidsRandomScatteredStones); - } - -- this.fillWithRandomizedBlocks(var1, var3, var8, 6, 5, var8, 6, 5, false, var2, junglePyramidsRandomScatteredStones); -- this.fillWithRandomizedBlocks(var1, var3, var8, 6, 9, var8, 6, 9, false, var2, junglePyramidsRandomScatteredStones); -- } -- -- this.fillWithRandomizedBlocks(var1, var3, 2, 7, 2, 2, 9, 2, false, var2, junglePyramidsRandomScatteredStones); -- this.fillWithRandomizedBlocks(var1, var3, 9, 7, 2, 9, 9, 2, false, var2, junglePyramidsRandomScatteredStones); -- this.fillWithRandomizedBlocks(var1, var3, 2, 7, 12, 2, 9, 12, false, var2, junglePyramidsRandomScatteredStones); -- this.fillWithRandomizedBlocks(var1, var3, 9, 7, 12, 9, 9, 12, false, var2, junglePyramidsRandomScatteredStones); -- this.fillWithRandomizedBlocks(var1, var3, 4, 9, 4, 4, 9, 4, false, var2, junglePyramidsRandomScatteredStones); -- this.fillWithRandomizedBlocks(var1, var3, 7, 9, 4, 7, 9, 4, false, var2, junglePyramidsRandomScatteredStones); -- this.fillWithRandomizedBlocks(var1, var3, 4, 9, 10, 4, 9, 10, false, var2, junglePyramidsRandomScatteredStones); -- this.fillWithRandomizedBlocks(var1, var3, 7, 9, 10, 7, 9, 10, false, var2, junglePyramidsRandomScatteredStones); -- this.fillWithRandomizedBlocks(var1, var3, 5, 9, 7, 6, 9, 7, false, var2, junglePyramidsRandomScatteredStones); -- this.placeBlockAtCurrentPosition(var1, Block.stairsCobblestone.blockID, var4, 5, 9, 6, var3); -- this.placeBlockAtCurrentPosition(var1, Block.stairsCobblestone.blockID, var4, 6, 9, 6, var3); -- this.placeBlockAtCurrentPosition(var1, Block.stairsCobblestone.blockID, var5, 5, 9, 8, var3); -- this.placeBlockAtCurrentPosition(var1, Block.stairsCobblestone.blockID, var5, 6, 9, 8, var3); -- this.placeBlockAtCurrentPosition(var1, Block.stairsCobblestone.blockID, var4, 4, 0, 0, var3); -- this.placeBlockAtCurrentPosition(var1, Block.stairsCobblestone.blockID, var4, 5, 0, 0, var3); -- this.placeBlockAtCurrentPosition(var1, Block.stairsCobblestone.blockID, var4, 6, 0, 0, var3); -- this.placeBlockAtCurrentPosition(var1, Block.stairsCobblestone.blockID, var4, 7, 0, 0, var3); -- this.placeBlockAtCurrentPosition(var1, Block.stairsCobblestone.blockID, var4, 4, 1, 8, var3); -- this.placeBlockAtCurrentPosition(var1, Block.stairsCobblestone.blockID, var4, 4, 2, 9, var3); -- this.placeBlockAtCurrentPosition(var1, Block.stairsCobblestone.blockID, var4, 4, 3, 10, var3); -- this.placeBlockAtCurrentPosition(var1, Block.stairsCobblestone.blockID, var4, 7, 1, 8, var3); -- this.placeBlockAtCurrentPosition(var1, Block.stairsCobblestone.blockID, var4, 7, 2, 9, var3); -- this.placeBlockAtCurrentPosition(var1, Block.stairsCobblestone.blockID, var4, 7, 3, 10, var3); -- this.fillWithRandomizedBlocks(var1, var3, 4, 1, 9, 4, 1, 9, false, var2, junglePyramidsRandomScatteredStones); -- this.fillWithRandomizedBlocks(var1, var3, 7, 1, 9, 7, 1, 9, false, var2, junglePyramidsRandomScatteredStones); -- this.fillWithRandomizedBlocks(var1, var3, 4, 1, 10, 7, 2, 10, false, var2, junglePyramidsRandomScatteredStones); -- this.fillWithRandomizedBlocks(var1, var3, 5, 4, 5, 6, 4, 5, false, var2, junglePyramidsRandomScatteredStones); -- this.placeBlockAtCurrentPosition(var1, Block.stairsCobblestone.blockID, var6, 4, 4, 5, var3); -- this.placeBlockAtCurrentPosition(var1, Block.stairsCobblestone.blockID, var7, 7, 4, 5, var3); -- -- for(var8 = 0; var8 < 4; ++var8) { -- this.placeBlockAtCurrentPosition(var1, Block.stairsCobblestone.blockID, var5, 5, 0 - var8, 6 + var8, var3); -- this.placeBlockAtCurrentPosition(var1, Block.stairsCobblestone.blockID, var5, 6, 0 - var8, 6 + var8, var3); -- this.fillWithAir(var1, var3, 5, 0 - var8, 7 + var8, 6, 0 - var8, 9 + var8); -- } -- -- this.fillWithAir(var1, var3, 1, -3, 12, 10, -1, 13); -- this.fillWithAir(var1, var3, 1, -3, 1, 3, -1, 13); -- this.fillWithAir(var1, var3, 1, -3, 1, 9, -1, 5); -- -- for(var8 = 1; var8 <= 13; var8 += 2) { -- this.fillWithRandomizedBlocks(var1, var3, 1, -3, var8, 1, -2, var8, false, var2, junglePyramidsRandomScatteredStones); -- } -- -- for(var8 = 2; var8 <= 12; var8 += 2) { -- this.fillWithRandomizedBlocks(var1, var3, 1, -1, var8, 3, -1, var8, false, var2, junglePyramidsRandomScatteredStones); -- } -- -- this.fillWithRandomizedBlocks(var1, var3, 2, -2, 1, 5, -2, 1, false, var2, junglePyramidsRandomScatteredStones); -- this.fillWithRandomizedBlocks(var1, var3, 7, -2, 1, 9, -2, 1, false, var2, junglePyramidsRandomScatteredStones); -- this.fillWithRandomizedBlocks(var1, var3, 6, -3, 1, 6, -3, 1, false, var2, junglePyramidsRandomScatteredStones); -- this.fillWithRandomizedBlocks(var1, var3, 6, -1, 1, 6, -1, 1, false, var2, junglePyramidsRandomScatteredStones); -- this.placeBlockAtCurrentPosition(var1, Block.tripWireSource.blockID, this.getMetadataWithOffset(Block.tripWireSource.blockID, 3) | 4, 1, -3, 8, var3); -- this.placeBlockAtCurrentPosition(var1, Block.tripWireSource.blockID, this.getMetadataWithOffset(Block.tripWireSource.blockID, 1) | 4, 4, -3, 8, var3); -- this.placeBlockAtCurrentPosition(var1, Block.tripWire.blockID, 4, 2, -3, 8, var3); -- this.placeBlockAtCurrentPosition(var1, Block.tripWire.blockID, 4, 3, -3, 8, var3); -- this.placeBlockAtCurrentPosition(var1, Block.redstoneWire.blockID, 0, 5, -3, 7, var3); -- this.placeBlockAtCurrentPosition(var1, Block.redstoneWire.blockID, 0, 5, -3, 6, var3); -- this.placeBlockAtCurrentPosition(var1, Block.redstoneWire.blockID, 0, 5, -3, 5, var3); -- this.placeBlockAtCurrentPosition(var1, Block.redstoneWire.blockID, 0, 5, -3, 4, var3); -- this.placeBlockAtCurrentPosition(var1, Block.redstoneWire.blockID, 0, 5, -3, 3, var3); -- this.placeBlockAtCurrentPosition(var1, Block.redstoneWire.blockID, 0, 5, -3, 2, var3); -- this.placeBlockAtCurrentPosition(var1, Block.redstoneWire.blockID, 0, 5, -3, 1, var3); -- this.placeBlockAtCurrentPosition(var1, Block.redstoneWire.blockID, 0, 4, -3, 1, var3); -- this.placeBlockAtCurrentPosition(var1, Block.cobblestoneMossy.blockID, 0, 3, -3, 1, var3); -- if(!this.field_74945_j) { -- this.field_74945_j = this.generateStructureDispenserContents(var1, var3, var2, 3, -2, 1, 2, junglePyramidsDispenserContents, 2); -- } -- -- this.placeBlockAtCurrentPosition(var1, Block.vine.blockID, 15, 3, -2, 2, var3); -- this.placeBlockAtCurrentPosition(var1, Block.tripWireSource.blockID, this.getMetadataWithOffset(Block.tripWireSource.blockID, 2) | 4, 7, -3, 1, var3); -- this.placeBlockAtCurrentPosition(var1, Block.tripWireSource.blockID, this.getMetadataWithOffset(Block.tripWireSource.blockID, 0) | 4, 7, -3, 5, var3); -- this.placeBlockAtCurrentPosition(var1, Block.tripWire.blockID, 4, 7, -3, 2, var3); -- this.placeBlockAtCurrentPosition(var1, Block.tripWire.blockID, 4, 7, -3, 3, var3); -- this.placeBlockAtCurrentPosition(var1, Block.tripWire.blockID, 4, 7, -3, 4, var3); -- this.placeBlockAtCurrentPosition(var1, Block.redstoneWire.blockID, 0, 8, -3, 6, var3); -- this.placeBlockAtCurrentPosition(var1, Block.redstoneWire.blockID, 0, 9, -3, 6, var3); -- this.placeBlockAtCurrentPosition(var1, Block.redstoneWire.blockID, 0, 9, -3, 5, var3); -- this.placeBlockAtCurrentPosition(var1, Block.cobblestoneMossy.blockID, 0, 9, -3, 4, var3); -- this.placeBlockAtCurrentPosition(var1, Block.redstoneWire.blockID, 0, 9, -2, 4, var3); -- if(!this.field_74946_k) { -- this.field_74946_k = this.generateStructureDispenserContents(var1, var3, var2, 9, -2, 3, 4, junglePyramidsDispenserContents, 2); -- } -- -- this.placeBlockAtCurrentPosition(var1, Block.vine.blockID, 15, 8, -1, 3, var3); -- this.placeBlockAtCurrentPosition(var1, Block.vine.blockID, 15, 8, -2, 3, var3); -- if(!this.field_74947_h) { -- this.field_74947_h = this.generateStructureChestContents(var1, var3, var2, 8, -3, 3, WeightedRandomChestContent.func_92080_a(junglePyramidsChestContents, new WeightedRandomChestContent[]{Item.enchantedBook.func_92114_b(var2)}), 2 + var2.nextInt(5)); -- } -- -- this.placeBlockAtCurrentPosition(var1, Block.cobblestoneMossy.blockID, 0, 9, -3, 2, var3); -- this.placeBlockAtCurrentPosition(var1, Block.cobblestoneMossy.blockID, 0, 8, -3, 1, var3); -- this.placeBlockAtCurrentPosition(var1, Block.cobblestoneMossy.blockID, 0, 4, -3, 5, var3); -- this.placeBlockAtCurrentPosition(var1, Block.cobblestoneMossy.blockID, 0, 5, -2, 5, var3); -- this.placeBlockAtCurrentPosition(var1, Block.cobblestoneMossy.blockID, 0, 5, -1, 5, var3); -- this.placeBlockAtCurrentPosition(var1, Block.cobblestoneMossy.blockID, 0, 6, -3, 5, var3); -- this.placeBlockAtCurrentPosition(var1, Block.cobblestoneMossy.blockID, 0, 7, -2, 5, var3); -- this.placeBlockAtCurrentPosition(var1, Block.cobblestoneMossy.blockID, 0, 7, -1, 5, var3); -- this.placeBlockAtCurrentPosition(var1, Block.cobblestoneMossy.blockID, 0, 8, -3, 5, var3); -- this.fillWithRandomizedBlocks(var1, var3, 9, -1, 1, 9, -1, 5, false, var2, junglePyramidsRandomScatteredStones); -- this.fillWithAir(var1, var3, 8, -3, 8, 10, -1, 10); -- this.placeBlockAtCurrentPosition(var1, Block.stoneBrick.blockID, 3, 8, -2, 11, var3); -- this.placeBlockAtCurrentPosition(var1, Block.stoneBrick.blockID, 3, 9, -2, 11, var3); -- this.placeBlockAtCurrentPosition(var1, Block.stoneBrick.blockID, 3, 10, -2, 11, var3); -- this.placeBlockAtCurrentPosition(var1, Block.lever.blockID, BlockLever.invertMetadata(this.getMetadataWithOffset(Block.lever.blockID, 2)), 8, -2, 12, var3); -- this.placeBlockAtCurrentPosition(var1, Block.lever.blockID, BlockLever.invertMetadata(this.getMetadataWithOffset(Block.lever.blockID, 2)), 9, -2, 12, var3); -- this.placeBlockAtCurrentPosition(var1, Block.lever.blockID, BlockLever.invertMetadata(this.getMetadataWithOffset(Block.lever.blockID, 2)), 10, -2, 12, var3); -- this.fillWithRandomizedBlocks(var1, var3, 8, -3, 8, 8, -3, 10, false, var2, junglePyramidsRandomScatteredStones); -- this.fillWithRandomizedBlocks(var1, var3, 10, -3, 8, 10, -3, 10, false, var2, junglePyramidsRandomScatteredStones); -- this.placeBlockAtCurrentPosition(var1, Block.cobblestoneMossy.blockID, 0, 10, -2, 9, var3); -- this.placeBlockAtCurrentPosition(var1, Block.redstoneWire.blockID, 0, 8, -2, 9, var3); -- this.placeBlockAtCurrentPosition(var1, Block.redstoneWire.blockID, 0, 8, -2, 10, var3); -- this.placeBlockAtCurrentPosition(var1, Block.redstoneWire.blockID, 0, 10, -1, 9, var3); -- this.placeBlockAtCurrentPosition(var1, Block.pistonStickyBase.blockID, 1, 9, -2, 8, var3); -- this.placeBlockAtCurrentPosition(var1, Block.pistonStickyBase.blockID, this.getMetadataWithOffset(Block.pistonStickyBase.blockID, 4), 10, -2, 8, var3); -- this.placeBlockAtCurrentPosition(var1, Block.pistonStickyBase.blockID, this.getMetadataWithOffset(Block.pistonStickyBase.blockID, 4), 10, -1, 8, var3); -- this.placeBlockAtCurrentPosition(var1, Block.redstoneRepeaterIdle.blockID, this.getMetadataWithOffset(Block.redstoneRepeaterIdle.blockID, 2), 10, -2, 10, var3); -- if(!this.field_74948_i) { -- this.field_74948_i = this.generateStructureChestContents(var1, var3, var2, 9, -3, 10, WeightedRandomChestContent.func_92080_a(junglePyramidsChestContents, new WeightedRandomChestContent[]{Item.enchantedBook.func_92114_b(var2)}), 2 + var2.nextInt(5)); -+ this.fillWithRandomizedBlocks(par1World, par3StructureBoundingBox, var8, 6, 5, var8, 6, 5, false, par2Random, junglePyramidsRandomScatteredStones); -+ this.fillWithRandomizedBlocks(par1World, par3StructureBoundingBox, var8, 6, 9, var8, 6, 9, false, par2Random, junglePyramidsRandomScatteredStones); -+ } -+ -+ this.fillWithRandomizedBlocks(par1World, par3StructureBoundingBox, 2, 7, 2, 2, 9, 2, false, par2Random, junglePyramidsRandomScatteredStones); -+ this.fillWithRandomizedBlocks(par1World, par3StructureBoundingBox, 9, 7, 2, 9, 9, 2, false, par2Random, junglePyramidsRandomScatteredStones); -+ this.fillWithRandomizedBlocks(par1World, par3StructureBoundingBox, 2, 7, 12, 2, 9, 12, false, par2Random, junglePyramidsRandomScatteredStones); -+ this.fillWithRandomizedBlocks(par1World, par3StructureBoundingBox, 9, 7, 12, 9, 9, 12, false, par2Random, junglePyramidsRandomScatteredStones); -+ this.fillWithRandomizedBlocks(par1World, par3StructureBoundingBox, 4, 9, 4, 4, 9, 4, false, par2Random, junglePyramidsRandomScatteredStones); -+ this.fillWithRandomizedBlocks(par1World, par3StructureBoundingBox, 7, 9, 4, 7, 9, 4, false, par2Random, junglePyramidsRandomScatteredStones); -+ this.fillWithRandomizedBlocks(par1World, par3StructureBoundingBox, 4, 9, 10, 4, 9, 10, false, par2Random, junglePyramidsRandomScatteredStones); -+ this.fillWithRandomizedBlocks(par1World, par3StructureBoundingBox, 7, 9, 10, 7, 9, 10, false, par2Random, junglePyramidsRandomScatteredStones); -+ this.fillWithRandomizedBlocks(par1World, par3StructureBoundingBox, 5, 9, 7, 6, 9, 7, false, par2Random, junglePyramidsRandomScatteredStones); -+ this.placeBlockAtCurrentPosition(par1World, Block.stairsCobblestone.blockID, var4, 5, 9, 6, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.stairsCobblestone.blockID, var4, 6, 9, 6, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.stairsCobblestone.blockID, var5, 5, 9, 8, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.stairsCobblestone.blockID, var5, 6, 9, 8, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.stairsCobblestone.blockID, var4, 4, 0, 0, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.stairsCobblestone.blockID, var4, 5, 0, 0, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.stairsCobblestone.blockID, var4, 6, 0, 0, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.stairsCobblestone.blockID, var4, 7, 0, 0, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.stairsCobblestone.blockID, var4, 4, 1, 8, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.stairsCobblestone.blockID, var4, 4, 2, 9, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.stairsCobblestone.blockID, var4, 4, 3, 10, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.stairsCobblestone.blockID, var4, 7, 1, 8, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.stairsCobblestone.blockID, var4, 7, 2, 9, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.stairsCobblestone.blockID, var4, 7, 3, 10, par3StructureBoundingBox); -+ this.fillWithRandomizedBlocks(par1World, par3StructureBoundingBox, 4, 1, 9, 4, 1, 9, false, par2Random, junglePyramidsRandomScatteredStones); -+ this.fillWithRandomizedBlocks(par1World, par3StructureBoundingBox, 7, 1, 9, 7, 1, 9, false, par2Random, junglePyramidsRandomScatteredStones); -+ this.fillWithRandomizedBlocks(par1World, par3StructureBoundingBox, 4, 1, 10, 7, 2, 10, false, par2Random, junglePyramidsRandomScatteredStones); -+ this.fillWithRandomizedBlocks(par1World, par3StructureBoundingBox, 5, 4, 5, 6, 4, 5, false, par2Random, junglePyramidsRandomScatteredStones); -+ this.placeBlockAtCurrentPosition(par1World, Block.stairsCobblestone.blockID, var6, 4, 4, 5, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.stairsCobblestone.blockID, var7, 7, 4, 5, par3StructureBoundingBox); -+ -+ for (var8 = 0; var8 < 4; ++var8) { -+ this.placeBlockAtCurrentPosition(par1World, Block.stairsCobblestone.blockID, var5, 5, 0 - var8, 6 + var8, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.stairsCobblestone.blockID, var5, 6, 0 - var8, 6 + var8, par3StructureBoundingBox); -+ this.fillWithAir(par1World, par3StructureBoundingBox, 5, 0 - var8, 7 + var8, 6, 0 - var8, 9 + var8); -+ } -+ -+ this.fillWithAir(par1World, par3StructureBoundingBox, 1, -3, 12, 10, -1, 13); -+ this.fillWithAir(par1World, par3StructureBoundingBox, 1, -3, 1, 3, -1, 13); -+ this.fillWithAir(par1World, par3StructureBoundingBox, 1, -3, 1, 9, -1, 5); -+ -+ for (var8 = 1; var8 <= 13; var8 += 2) { -+ this.fillWithRandomizedBlocks(par1World, par3StructureBoundingBox, 1, -3, var8, 1, -2, var8, false, par2Random, junglePyramidsRandomScatteredStones); -+ } -+ -+ for (var8 = 2; var8 <= 12; var8 += 2) { -+ this.fillWithRandomizedBlocks(par1World, par3StructureBoundingBox, 1, -1, var8, 3, -1, var8, false, par2Random, junglePyramidsRandomScatteredStones); -+ } -+ -+ this.fillWithRandomizedBlocks(par1World, par3StructureBoundingBox, 2, -2, 1, 5, -2, 1, false, par2Random, junglePyramidsRandomScatteredStones); -+ this.fillWithRandomizedBlocks(par1World, par3StructureBoundingBox, 7, -2, 1, 9, -2, 1, false, par2Random, junglePyramidsRandomScatteredStones); -+ this.fillWithRandomizedBlocks(par1World, par3StructureBoundingBox, 6, -3, 1, 6, -3, 1, false, par2Random, junglePyramidsRandomScatteredStones); -+ this.fillWithRandomizedBlocks(par1World, par3StructureBoundingBox, 6, -1, 1, 6, -1, 1, false, par2Random, junglePyramidsRandomScatteredStones); -+ this.placeBlockAtCurrentPosition(par1World, Block.tripWireSource.blockID, this.getMetadataWithOffset(Block.tripWireSource.blockID, 3) | 4, 1, -3, 8, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.tripWireSource.blockID, this.getMetadataWithOffset(Block.tripWireSource.blockID, 1) | 4, 4, -3, 8, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.tripWire.blockID, 4, 2, -3, 8, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.tripWire.blockID, 4, 3, -3, 8, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.redstoneWire.blockID, 0, 5, -3, 7, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.redstoneWire.blockID, 0, 5, -3, 6, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.redstoneWire.blockID, 0, 5, -3, 5, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.redstoneWire.blockID, 0, 5, -3, 4, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.redstoneWire.blockID, 0, 5, -3, 3, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.redstoneWire.blockID, 0, 5, -3, 2, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.redstoneWire.blockID, 0, 5, -3, 1, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.redstoneWire.blockID, 0, 4, -3, 1, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.cobblestoneMossy.blockID, 0, 3, -3, 1, par3StructureBoundingBox); -+ -+ if (!this.field_74945_j) { -+ this.field_74945_j = this.generateStructureDispenserContents(par1World, par3StructureBoundingBox, par2Random, 3, -2, 1, 2, junglePyramidsDispenserContents, 2); -+ } -+ -+ this.placeBlockAtCurrentPosition(par1World, Block.vine.blockID, 15, 3, -2, 2, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.tripWireSource.blockID, this.getMetadataWithOffset(Block.tripWireSource.blockID, 2) | 4, 7, -3, 1, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.tripWireSource.blockID, this.getMetadataWithOffset(Block.tripWireSource.blockID, 0) | 4, 7, -3, 5, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.tripWire.blockID, 4, 7, -3, 2, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.tripWire.blockID, 4, 7, -3, 3, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.tripWire.blockID, 4, 7, -3, 4, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.redstoneWire.blockID, 0, 8, -3, 6, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.redstoneWire.blockID, 0, 9, -3, 6, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.redstoneWire.blockID, 0, 9, -3, 5, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.cobblestoneMossy.blockID, 0, 9, -3, 4, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.redstoneWire.blockID, 0, 9, -2, 4, par3StructureBoundingBox); -+ -+ if (!this.field_74946_k) { -+ this.field_74946_k = this.generateStructureDispenserContents(par1World, par3StructureBoundingBox, par2Random, 9, -2, 3, 4, junglePyramidsDispenserContents, 2); -+ } -+ -+ this.placeBlockAtCurrentPosition(par1World, Block.vine.blockID, 15, 8, -1, 3, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.vine.blockID, 15, 8, -2, 3, par3StructureBoundingBox); -+ -+ if (!this.field_74947_h) { -+ this.field_74947_h = this.generateStructureChestContents(par1World, par3StructureBoundingBox, par2Random, 8, -3, 3, WeightedRandomChestContent.func_92080_a(junglePyramidsChestContents, new WeightedRandomChestContent[] {Item.enchantedBook.func_92114_b(par2Random)}), 2 + par2Random.nextInt(5)); -+ } -+ -+ this.placeBlockAtCurrentPosition(par1World, Block.cobblestoneMossy.blockID, 0, 9, -3, 2, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.cobblestoneMossy.blockID, 0, 8, -3, 1, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.cobblestoneMossy.blockID, 0, 4, -3, 5, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.cobblestoneMossy.blockID, 0, 5, -2, 5, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.cobblestoneMossy.blockID, 0, 5, -1, 5, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.cobblestoneMossy.blockID, 0, 6, -3, 5, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.cobblestoneMossy.blockID, 0, 7, -2, 5, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.cobblestoneMossy.blockID, 0, 7, -1, 5, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.cobblestoneMossy.blockID, 0, 8, -3, 5, par3StructureBoundingBox); -+ this.fillWithRandomizedBlocks(par1World, par3StructureBoundingBox, 9, -1, 1, 9, -1, 5, false, par2Random, junglePyramidsRandomScatteredStones); -+ this.fillWithAir(par1World, par3StructureBoundingBox, 8, -3, 8, 10, -1, 10); -+ this.placeBlockAtCurrentPosition(par1World, Block.stoneBrick.blockID, 3, 8, -2, 11, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.stoneBrick.blockID, 3, 9, -2, 11, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.stoneBrick.blockID, 3, 10, -2, 11, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.lever.blockID, BlockLever.invertMetadata(this.getMetadataWithOffset(Block.lever.blockID, 2)), 8, -2, 12, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.lever.blockID, BlockLever.invertMetadata(this.getMetadataWithOffset(Block.lever.blockID, 2)), 9, -2, 12, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.lever.blockID, BlockLever.invertMetadata(this.getMetadataWithOffset(Block.lever.blockID, 2)), 10, -2, 12, par3StructureBoundingBox); -+ this.fillWithRandomizedBlocks(par1World, par3StructureBoundingBox, 8, -3, 8, 8, -3, 10, false, par2Random, junglePyramidsRandomScatteredStones); -+ this.fillWithRandomizedBlocks(par1World, par3StructureBoundingBox, 10, -3, 8, 10, -3, 10, false, par2Random, junglePyramidsRandomScatteredStones); -+ this.placeBlockAtCurrentPosition(par1World, Block.cobblestoneMossy.blockID, 0, 10, -2, 9, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.redstoneWire.blockID, 0, 8, -2, 9, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.redstoneWire.blockID, 0, 8, -2, 10, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.redstoneWire.blockID, 0, 10, -1, 9, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.pistonStickyBase.blockID, 1, 9, -2, 8, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.pistonStickyBase.blockID, this.getMetadataWithOffset(Block.pistonStickyBase.blockID, 4), 10, -2, 8, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.pistonStickyBase.blockID, this.getMetadataWithOffset(Block.pistonStickyBase.blockID, 4), 10, -1, 8, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.redstoneRepeaterIdle.blockID, this.getMetadataWithOffset(Block.redstoneRepeaterIdle.blockID, 2), 10, -2, 10, par3StructureBoundingBox); -+ -+ if (!this.field_74948_i) { -+ this.field_74948_i = this.generateStructureChestContents(par1World, par3StructureBoundingBox, par2Random, 9, -3, 10, WeightedRandomChestContent.func_92080_a(junglePyramidsChestContents, new WeightedRandomChestContent[] {Item.enchantedBook.func_92114_b(par2Random)}), 2 + par2Random.nextInt(5)); - } - - return true; ---- net/minecraft/src/ItemStack.java -+++ net/minecraft/src/ItemStack.java -@@ -1,80 +1,111 @@ - package net.minecraft.src; - --import com.google.common.collect.HashMultimap; --import com.google.common.collect.Multimap; - import java.text.DecimalFormat; - import java.util.ArrayList; - import java.util.Iterator; - import java.util.List; --import java.util.Random; - import java.util.Map.Entry; -- --public final class ItemStack { -- public static final DecimalFormat a = new DecimalFormat("#.###"); -+import java.util.Random; -+ -+import com.google.common.collect.HashMultimap; -+import com.google.common.collect.Multimap; -+ -+import org.spoutcraft.client.config.Configuration; -+import org.spoutcraft.client.inventory.InventoryUtil; -+ -+// Spout Start - Removed final -+public class ItemStack { -+// Spout End -+ -+ public static final DecimalFormat field_111284_a = new DecimalFormat("#.###"); -+ /** Size of the stack. */ - public int stackSize; -+ -+ /** -+ * Number of animation frames to go when receiving an item (by walking into it, for example). -+ */ - public int animationsToGo; -+ -+ /** ID of the item. */ - public int itemID; -+ -+ /** -+ * A NBTTagMap containing data about an ItemStack. Can only be used for non stackable items -+ */ - public NBTTagCompound stackTagCompound; -+ -+ /** Damage dealt to the item or number of use. Raise when using items. */ - private int itemDamage; -+ -+ /** Item frame this stack is on, or null if not on an item frame. */ - private EntityItemFrame itemFrame; - -- public ItemStack(Block var1) { -- this((Block)var1, 1); -- } -- -- public ItemStack(Block var1, int var2) { -- this(var1.blockID, var2, 0); -- } -- -- public ItemStack(Block var1, int var2, int var3) { -- this(var1.blockID, var2, var3); -- } -- -- public ItemStack(Item var1) { -- this(var1.itemID, 1, 0); -- } -- -- public ItemStack(Item var1, int var2) { -- this(var1.itemID, var2, 0); -- } -- -- public ItemStack(Item var1, int var2, int var3) { -- this(var1.itemID, var2, var3); -- } -- -- public ItemStack(int var1, int var2, int var3) { -- this.itemID = var1; -- this.stackSize = var2; -- this.itemDamage = var3; -- if(this.itemDamage < 0) { -+ public ItemStack(Block par1Block) { -+ this(par1Block, 1); -+ } -+ -+ public ItemStack(Block par1Block, int par2) { -+ this(par1Block.blockID, par2, 0); -+ } -+ -+ public ItemStack(Block par1Block, int par2, int par3) { -+ this(par1Block.blockID, par2, par3); -+ } -+ -+ public ItemStack(Item par1Item) { -+ this(par1Item.itemID, 1, 0); -+ } -+ -+ public ItemStack(Item par1Item, int par2) { -+ this(par1Item.itemID, par2, 0); -+ } -+ -+ public ItemStack(Item par1Item, int par2, int par3) { -+ this(par1Item.itemID, par2, par3); -+ } -+ -+ public ItemStack(int par1, int par2, int par3) { -+ this.itemID = par1; -+ this.stackSize = par2; -+ this.itemDamage = par3; -+ -+ if (this.itemDamage < 0) { - this.itemDamage = 0; - } -- - } - -- public static ItemStack loadItemStackFromNBT(NBTTagCompound var0) { -+ public static ItemStack loadItemStackFromNBT(NBTTagCompound par0NBTTagCompound) { - ItemStack var1 = new ItemStack(); -- var1.readFromNBT(var0); -+ var1.readFromNBT(par0NBTTagCompound); - return var1.getItem() != null ? var1 : null; - } - -- private ItemStack() { -- } -- -- public ItemStack splitStack(int var1) { -- ItemStack var2 = new ItemStack(this.itemID, var1, this.itemDamage); -- if(this.stackTagCompound != null) { -+ private ItemStack() {} -+ -+ /** -+ * Remove the argument from the stack size. Return a new stack object with argument size. -+ */ -+ public ItemStack splitStack(int par1) { -+ ItemStack var2 = new ItemStack(this.itemID, par1, this.itemDamage); -+ -+ if (this.stackTagCompound != null) { - var2.stackTagCompound = (NBTTagCompound)this.stackTagCompound.copy(); - } - -- this.stackSize -= var1; -+ this.stackSize -= par1; - return var2; - } - -+ /** -+ * Returns the object corresponding to the stack. -+ */ - public Item getItem() { - return Item.itemsList[this.itemID]; - } - -+ /** -+ * Returns the icon index of the current stack. -+ */ - public Icon getIconIndex() { - return this.getItem().getIconIndex(this); - } -@@ -83,60 +114,90 @@ - return this.getItem().getSpriteNumber(); - } - -- public boolean tryPlaceItemIntoWorld(EntityPlayer var1, World var2, int var3, int var4, int var5, int var6, float var7, float var8, float var9) { -- boolean var10 = this.getItem().onItemUse(this, var1, var2, var3, var4, var5, var6, var7, var8, var9); -- if(var10) { -- var1.addStat(StatList.objectUseStats[this.itemID], 1); -- } -+ public boolean tryPlaceItemIntoWorld(EntityPlayer par1EntityPlayer, World par2World, int par3, int par4, int par5, int par6, float par7, float par8, float par9) { -+ boolean var10 = this.getItem().onItemUse(this, par1EntityPlayer, par2World, par3, par4, par5, par6, par7, par8, par9); -+ -+ if (var10) { -+ par1EntityPlayer.addStat(StatList.objectUseStats[this.itemID], 1); -+ } -+ -+ // Spout Start -+ if (var10 && stackSize == 0 && getItem() instanceof ItemBlock && Configuration.isReplaceBlocks()) { -+ InventoryUtil.replaceItem(this.itemID, getItem().getMetadata(this.getItemDamage())); -+ } -+ // Spout End - - return var10; - } - -- public float getStrVsBlock(Block var1) { -- return this.getItem().getStrVsBlock(this, var1); -- } -- -- public ItemStack useItemRightClick(World var1, EntityPlayer var2) { -- return this.getItem().onItemRightClick(this, var1, var2); -- } -- -- public ItemStack onFoodEaten(World var1, EntityPlayer var2) { -- return this.getItem().onEaten(this, var1, var2); -- } -- -- public NBTTagCompound writeToNBT(NBTTagCompound var1) { -- var1.setShort("id", (short)this.itemID); -- var1.setByte("Count", (byte)this.stackSize); -- var1.setShort("Damage", (short)this.itemDamage); -- if(this.stackTagCompound != null) { -- var1.setTag("tag", this.stackTagCompound); -+ /** -+ * Returns the strength of the stack against a given block. -+ */ -+ public float getStrVsBlock(Block par1Block) { -+ return this.getItem().getStrVsBlock(this, par1Block); -+ } -+ -+ /** -+ * Called whenever this item stack is equipped and right clicked. Returns the new item stack to put in the position -+ * where this item is. Args: world, player -+ */ -+ public ItemStack useItemRightClick(World par1World, EntityPlayer par2EntityPlayer) { -+ return this.getItem().onItemRightClick(this, par1World, par2EntityPlayer); -+ } -+ -+ public ItemStack onFoodEaten(World par1World, EntityPlayer par2EntityPlayer) { -+ return this.getItem().onEaten(this, par1World, par2EntityPlayer); -+ } -+ -+ /** -+ * Write the stack fields to a NBT object. Return the new NBT object. -+ */ -+ public NBTTagCompound writeToNBT(NBTTagCompound par1NBTTagCompound) { -+ par1NBTTagCompound.setShort("id", (short)this.itemID); -+ par1NBTTagCompound.setByte("Count", (byte)this.stackSize); -+ par1NBTTagCompound.setShort("Damage", (short)this.itemDamage); -+ -+ if (this.stackTagCompound != null) { -+ par1NBTTagCompound.setTag("tag", this.stackTagCompound); - } - -- return var1; -+ return par1NBTTagCompound; - } - -- public void readFromNBT(NBTTagCompound var1) { -- this.itemID = var1.getShort("id"); -- this.stackSize = var1.getByte("Count"); -- this.itemDamage = var1.getShort("Damage"); -- if(this.itemDamage < 0) { -+ /** -+ * Read the stack fields from a NBT object. -+ */ -+ public void readFromNBT(NBTTagCompound par1NBTTagCompound) { -+ this.itemID = par1NBTTagCompound.getShort("id"); -+ this.stackSize = par1NBTTagCompound.getByte("Count"); -+ this.itemDamage = par1NBTTagCompound.getShort("Damage"); -+ -+ if (this.itemDamage < 0) { - this.itemDamage = 0; - } - -- if(var1.hasKey("tag")) { -- this.stackTagCompound = var1.getCompoundTag("tag"); -+ if (par1NBTTagCompound.hasKey("tag")) { -+ this.stackTagCompound = par1NBTTagCompound.getCompoundTag("tag"); - } -- - } - -+ /** -+ * Returns maximum size of the stack. -+ */ - public int getMaxStackSize() { - return this.getItem().getItemStackLimit(); - } - -+ /** -+ * Returns true if the ItemStack can hold 2 or more units of the item. -+ */ - public boolean isStackable() { - return this.getMaxStackSize() > 1 && (!this.isItemStackDamageable() || !this.isItemDamaged()); - } - -+ /** -+ * true if this itemStack is damageable -+ */ - public boolean isItemStackDamageable() { - return Item.itemsList[this.itemID].getMaxDamage() > 0; - } -@@ -145,152 +206,210 @@ - return Item.itemsList[this.itemID].getHasSubtypes(); - } - -+ /** -+ * returns true when a damageable item is damaged -+ */ - public boolean isItemDamaged() { - return this.isItemStackDamageable() && this.itemDamage > 0; - } - -+ /** -+ * gets the damage of an itemstack, for displaying purposes -+ */ - public int getItemDamageForDisplay() { - return this.itemDamage; - } - -+ /** -+ * gets the damage of an itemstack -+ */ - public int getItemDamage() { - return this.itemDamage; - } - -- public void setItemDamage(int var1) { -- this.itemDamage = var1; -- if(this.itemDamage < 0) { -+ /** -+ * Sets the item damage of the ItemStack. -+ */ -+ public void setItemDamage(int par1) { -+ this.itemDamage = par1; -+ -+ if (this.itemDamage < 0) { - this.itemDamage = 0; - } -- - } - -+ /** -+ * Returns the max damage an item in the stack can take. -+ */ - public int getMaxDamage() { - return Item.itemsList[this.itemID].getMaxDamage(); - } - -- public boolean attemptDamageItem(int var1, Random var2) { -- if(!this.isItemStackDamageable()) { -+ /** -+ * Attempts to damage the ItemStack with par1 amount of damage, If the ItemStack has the Unbreaking enchantment there -+ * is a chance for each point of damage to be negated. Returns true if it takes more damage than getMaxDamage(). -+ * Returns false otherwise or if the ItemStack can't be damaged or if all points of damage are negated. -+ */ -+ public boolean attemptDamageItem(int par1, Random par2Random) { -+ if (!this.isItemStackDamageable()) { - return false; - } else { -- if(var1 > 0) { -+ if (par1 > 0) { - int var3 = EnchantmentHelper.getEnchantmentLevel(Enchantment.unbreaking.effectId, this); - int var4 = 0; - -- for(int var5 = 0; var3 > 0 && var5 < var1; ++var5) { -- if(EnchantmentDurability.negateDamage(this, var3, var2)) { -+ for (int var5 = 0; var3 > 0 && var5 < par1; ++var5) { -+ if (EnchantmentDurability.negateDamage(this, var3, par2Random)) { - ++var4; - } - } - -- var1 -= var4; -- if(var1 <= 0) { -+ par1 -= var4; -+ -+ if (par1 <= 0) { - return false; - } - } - -- this.itemDamage += var1; -+ this.itemDamage += par1; - return this.itemDamage > this.getMaxDamage(); - } - } - -- public void damageItem(int var1, EntityLivingBase var2) { -- if(!(var2 instanceof EntityPlayer) || !((EntityPlayer)var2).capabilities.isCreativeMode) { -- if(this.isItemStackDamageable()) { -- if(this.attemptDamageItem(var1, var2.getRNG())) { -- var2.renderBrokenItemStack(this); -+ /** -+ * Damages the item in the ItemStack -+ */ -+ public void damageItem(int par1, EntityLivingBase par2EntityLivingBase) { -+ if (!(par2EntityLivingBase instanceof EntityPlayer) || !((EntityPlayer)par2EntityLivingBase).capabilities.isCreativeMode) { -+ if (this.isItemStackDamageable()) { -+ if (this.attemptDamageItem(par1, par2EntityLivingBase.getRNG())) { -+ par2EntityLivingBase.renderBrokenItemStack(this); - --this.stackSize; -- if(var2 instanceof EntityPlayer) { -- EntityPlayer var3 = (EntityPlayer)var2; -+ -+ if (par2EntityLivingBase instanceof EntityPlayer) { -+ EntityPlayer var3 = (EntityPlayer)par2EntityLivingBase; - var3.addStat(StatList.objectBreakStats[this.itemID], 1); -- if(this.stackSize == 0 && this.getItem() instanceof ItemBow) { -+ -+ if (this.stackSize == 0 && this.getItem() instanceof ItemBow) { - var3.destroyCurrentEquippedItem(); - } - } - -- if(this.stackSize < 0) { -+ if (this.stackSize < 0) { - this.stackSize = 0; - } - - this.itemDamage = 0; -+ -+ // Spout Start -+ if (stackSize == 0 && Configuration.isReplaceTools()) { -+ InventoryUtil.replaceItem(this.itemID, -1); -+ } -+ // Spout End - } -- - } - } - } - -- public void hitEntity(EntityLivingBase var1, EntityPlayer var2) { -- boolean var3 = Item.itemsList[this.itemID].hitEntity(this, var1, var2); -- if(var3) { -- var2.addStat(StatList.objectUseStats[this.itemID], 1); -- } -- -- } -- -- public void onBlockDestroyed(World var1, int var2, int var3, int var4, int var5, EntityPlayer var6) { -- boolean var7 = Item.itemsList[this.itemID].onBlockDestroyed(this, var1, var2, var3, var4, var5, var6); -- if(var7) { -- var6.addStat(StatList.objectUseStats[this.itemID], 1); -- } -- -- } -- -- public boolean canHarvestBlock(Block var1) { -- return Item.itemsList[this.itemID].canHarvestBlock(var1); -- } -- -- public boolean func_111282_a(EntityPlayer var1, EntityLivingBase var2) { -- return Item.itemsList[this.itemID].itemInteractionForEntity(this, var1, var2); -- } -- -+ /** -+ * Calls the corresponding fct in di -+ */ -+ public void hitEntity(EntityLivingBase par1EntityLivingBase, EntityPlayer par2EntityPlayer) { -+ boolean var3 = Item.itemsList[this.itemID].hitEntity(this, par1EntityLivingBase, par2EntityPlayer); -+ -+ if (var3) { -+ par2EntityPlayer.addStat(StatList.objectUseStats[this.itemID], 1); -+ } -+ } -+ -+ public void onBlockDestroyed(World par1World, int par2, int par3, int par4, int par5, EntityPlayer par6EntityPlayer) { -+ boolean var7 = Item.itemsList[this.itemID].onBlockDestroyed(this, par1World, par2, par3, par4, par5, par6EntityPlayer); -+ -+ if (var7) { -+ par6EntityPlayer.addStat(StatList.objectUseStats[this.itemID], 1); -+ } -+ } -+ -+ /** -+ * Checks if the itemStack object can harvest a specified block -+ */ -+ public boolean canHarvestBlock(Block par1Block) { -+ return Item.itemsList[this.itemID].canHarvestBlock(par1Block); -+ } -+ -+ public boolean func_111282_a(EntityPlayer par1EntityPlayer, EntityLivingBase par2EntityLivingBase) { -+ return Item.itemsList[this.itemID].itemInteractionForEntity(this, par1EntityPlayer, par2EntityLivingBase); -+ } -+ -+ /** -+ * Returns a new stack with the same properties. -+ */ - public ItemStack copy() { - ItemStack var1 = new ItemStack(this.itemID, this.stackSize, this.itemDamage); -- if(this.stackTagCompound != null) { -+ -+ if (this.stackTagCompound != null) { - var1.stackTagCompound = (NBTTagCompound)this.stackTagCompound.copy(); - } - - return var1; - } - -- public static boolean areItemStackTagsEqual(ItemStack var0, ItemStack var1) { -- return var0 == null && var1 == null ? true : (var0 != null && var1 != null ? (var0.stackTagCompound == null && var1.stackTagCompound != null ? false : var0.stackTagCompound == null || var0.stackTagCompound.equals(var1.stackTagCompound)) : false); -- } -- -- public static boolean areItemStacksEqual(ItemStack var0, ItemStack var1) { -- return var0 == null && var1 == null ? true : (var0 != null && var1 != null ? var0.isItemStackEqual(var1) : false); -- } -- -- private boolean isItemStackEqual(ItemStack var1) { -- return this.stackSize != var1.stackSize ? false : (this.itemID != var1.itemID ? false : (this.itemDamage != var1.itemDamage ? false : (this.stackTagCompound == null && var1.stackTagCompound != null ? false : this.stackTagCompound == null || this.stackTagCompound.equals(var1.stackTagCompound)))); -- } -- -- public boolean isItemEqual(ItemStack var1) { -- return this.itemID == var1.itemID && this.itemDamage == var1.itemDamage; -+ public static boolean areItemStackTagsEqual(ItemStack par0ItemStack, ItemStack par1ItemStack) { -+ return par0ItemStack == null && par1ItemStack == null ? true : (par0ItemStack != null && par1ItemStack != null ? (par0ItemStack.stackTagCompound == null && par1ItemStack.stackTagCompound != null ? false : par0ItemStack.stackTagCompound == null || par0ItemStack.stackTagCompound.equals(par1ItemStack.stackTagCompound)) : false); -+ } -+ -+ /** -+ * compares ItemStack argument1 with ItemStack argument2; returns true if both ItemStacks are equal -+ */ -+ public static boolean areItemStacksEqual(ItemStack par0ItemStack, ItemStack par1ItemStack) { -+ return par0ItemStack == null && par1ItemStack == null ? true : (par0ItemStack != null && par1ItemStack != null ? par0ItemStack.isItemStackEqual(par1ItemStack) : false); -+ } -+ -+ /** -+ * compares ItemStack argument to the instance ItemStack; returns true if both ItemStacks are equal -+ */ -+ private boolean isItemStackEqual(ItemStack par1ItemStack) { -+ return this.stackSize != par1ItemStack.stackSize ? false : (this.itemID != par1ItemStack.itemID ? false : (this.itemDamage != par1ItemStack.itemDamage ? false : (this.stackTagCompound == null && par1ItemStack.stackTagCompound != null ? false : this.stackTagCompound == null || this.stackTagCompound.equals(par1ItemStack.stackTagCompound)))); -+ } -+ -+ /** -+ * compares ItemStack argument to the instance ItemStack; returns true if the Items contained in both ItemStacks are -+ * equal -+ */ -+ public boolean isItemEqual(ItemStack par1ItemStack) { -+ return this.itemID == par1ItemStack.itemID && this.itemDamage == par1ItemStack.itemDamage; - } - - public String getUnlocalizedName() { - return Item.itemsList[this.itemID].getUnlocalizedName(this); - } - -- public static ItemStack copyItemStack(ItemStack var0) { -- return var0 == null ? null : var0.copy(); -+ /** -+ * Creates a copy of a ItemStack, a null parameters will return a null. -+ */ -+ public static ItemStack copyItemStack(ItemStack par0ItemStack) { -+ return par0ItemStack == null ? null : par0ItemStack.copy(); - } - - public String toString() { - return this.stackSize + "x" + Item.itemsList[this.itemID].getUnlocalizedName() + "@" + this.itemDamage; - } - -- public void updateAnimation(World var1, Entity var2, int var3, boolean var4) { -- if(this.animationsToGo > 0) { -+ /** -+ * Called each tick as long the ItemStack in on player inventory. Used to progress the pickup animation and update -+ * maps. -+ */ -+ public void updateAnimation(World par1World, Entity par2Entity, int par3, boolean par4) { -+ if (this.animationsToGo > 0) { - --this.animationsToGo; - } - -- Item.itemsList[this.itemID].onUpdate(this, var1, var2, var3, var4); -+ Item.itemsList[this.itemID].onUpdate(this, par1World, par2Entity, par3, par4); - } - -- public void onCrafting(World var1, EntityPlayer var2, int var3) { -- var2.addStat(StatList.objectCraftStats[this.itemID], var3); -- Item.itemsList[this.itemID].onCreated(this, var1, var2); -+ public void onCrafting(World par1World, EntityPlayer par2EntityPlayer, int par3) { -+ par2EntityPlayer.addStat(StatList.objectCraftStats[this.itemID], par3); -+ Item.itemsList[this.itemID].onCreated(this, par1World, par2EntityPlayer); - } - - public int getMaxItemUseDuration() { -@@ -301,31 +420,69 @@ - return this.getItem().getItemUseAction(this); - } - -- public void onPlayerStoppedUsing(World var1, EntityPlayer var2, int var3) { -- this.getItem().onPlayerStoppedUsing(this, var1, var2, var3); -+ /** -+ * Called when the player releases the use item button. Args: world, entityplayer, itemInUseCount -+ */ -+ public void onPlayerStoppedUsing(World par1World, EntityPlayer par2EntityPlayer, int par3) { -+ this.getItem().onPlayerStoppedUsing(this, par1World, par2EntityPlayer, par3); - } - -+ /** -+ * Returns true if the ItemStack has an NBTTagCompound. Currently used to store enchantments. -+ */ - public boolean hasTagCompound() { - return this.stackTagCompound != null; - } - -+ /** -+ * Returns the NBTTagCompound of the ItemStack. -+ */ - public NBTTagCompound getTagCompound() { - return this.stackTagCompound; - } - - public NBTTagList getEnchantmentTagList() { -+ // Spout Start -+ NBTTagList list = getAllEnchantmentTagList(); -+ if (list == null) { -+ return null; -+ } -+ list = (NBTTagList) list.copy(); -+ for (int i = 0; i < list.tagCount(); i++) { -+ NBTBase tag = list.tagAt(i); -+ if (tag instanceof NBTTagCompound) { -+ NBTTagCompound ench = (NBTTagCompound) tag; -+ short id = ench.getShort("id"); -+ if (id > 200) { -+ list.tagList.remove(ench); -+ } -+ } -+ } -+ return list; -+ } -+ -+ public NBTTagList getAllEnchantmentTagList() { -+ // Spout End - return this.stackTagCompound == null ? null : (NBTTagList)this.stackTagCompound.getTag("ench"); - } - -- public void setTagCompound(NBTTagCompound var1) { -- this.stackTagCompound = var1; -+ /** -+ * Assigns a NBTTagCompound to the ItemStack, minecraft validates that only non-stackable items can have it. -+ */ -+ public void setTagCompound(NBTTagCompound par1NBTTagCompound) { -+ this.stackTagCompound = par1NBTTagCompound; - } - -+ /** -+ * returns the display name of the itemstack -+ */ - public String getDisplayName() { - String var1 = this.getItem().getItemDisplayName(this); -- if(this.stackTagCompound != null && this.stackTagCompound.hasKey("display")) { -+ -+ if (this.stackTagCompound != null && this.stackTagCompound.hasKey("display")) { - NBTTagCompound var2 = this.stackTagCompound.getCompoundTag("display"); -- if(var2.hasKey("Name")) { -+ -+ if (var2.hasKey("Name")) { - var1 = var2.getString("Name"); - } - } -@@ -333,129 +490,147 @@ - return var1; - } - -- public void setItemName(String var1) { -- if(this.stackTagCompound == null) { -+ /** -+ * Sets the item's name (used by anvil to rename the items). -+ */ -+ public void setItemName(String par1Str) { -+ if (this.stackTagCompound == null) { - this.stackTagCompound = new NBTTagCompound("tag"); - } - -- if(!this.stackTagCompound.hasKey("display")) { -+ if (!this.stackTagCompound.hasKey("display")) { - this.stackTagCompound.setCompoundTag("display", new NBTTagCompound()); - } - -- this.stackTagCompound.getCompoundTag("display").setString("Name", var1); -+ this.stackTagCompound.getCompoundTag("display").setString("Name", par1Str); - } -- -+ - public void func_135074_t() { -- if(this.stackTagCompound != null) { -- if(this.stackTagCompound.hasKey("display")) { -+ if (this.stackTagCompound != null) { -+ if (this.stackTagCompound.hasKey("display")) { - NBTTagCompound var1 = this.stackTagCompound.getCompoundTag("display"); - var1.removeTag("Name"); -- if(var1.hasNoTags()) { -+ -+ if (var1.hasNoTags()) { - this.stackTagCompound.removeTag("display"); -- if(this.stackTagCompound.hasNoTags()) { -+ -+ if (this.stackTagCompound.hasNoTags()) { - this.setTagCompound((NBTTagCompound)null); - } - } -- - } - } - } - -+ /** -+ * Returns true if the itemstack has a display name -+ */ - public boolean hasDisplayName() { - return this.stackTagCompound == null ? false : (!this.stackTagCompound.hasKey("display") ? false : this.stackTagCompound.getCompoundTag("display").hasKey("Name")); - } - -- public List getTooltip(EntityPlayer var1, boolean var2) { -+ /** -+ * Return a list of strings containing information about the item -+ */ -+ public List getTooltip(EntityPlayer par1EntityPlayer, boolean par2) { - ArrayList var3 = new ArrayList(); - Item var4 = Item.itemsList[this.itemID]; - String var5 = this.getDisplayName(); -- if(this.hasDisplayName()) { -+ -+ if (this.hasDisplayName()) { - var5 = EnumChatFormatting.ITALIC + var5 + EnumChatFormatting.RESET; - } - -- if(var2) { -+ if (par2) { - String var6 = ""; -- if(var5.length() > 0) { -+ -+ if (var5.length() > 0) { - var5 = var5 + " ("; - var6 = ")"; - } - -- if(this.getHasSubtypes()) { -- var5 = var5 + String.format("#%04d/%d%s", new Object[]{Integer.valueOf(this.itemID), Integer.valueOf(this.itemDamage), var6}); -+ if (this.getHasSubtypes()) { -+ var5 = var5 + String.format("#%04d/%d%s", new Object[] {Integer.valueOf(this.itemID), Integer.valueOf(this.itemDamage), var6}); - } else { -- var5 = var5 + String.format("#%04d%s", new Object[]{Integer.valueOf(this.itemID), var6}); -+ var5 = var5 + String.format("#%04d%s", new Object[] {Integer.valueOf(this.itemID), var6}); - } -- } else if(!this.hasDisplayName() && this.itemID == Item.map.itemID) { -+ } else if (!this.hasDisplayName() && this.itemID == Item.map.itemID) { - var5 = var5 + " #" + this.itemDamage; - } - - var3.add(var5); -- var4.addInformation(this, var1, var3, var2); -- if(this.hasTagCompound()) { -+ var4.addInformation(this, par1EntityPlayer, var3, par2); -+ -+ if (this.hasTagCompound()) { - NBTTagList var14 = this.getEnchantmentTagList(); -- if(var14 != null) { -- for(int var7 = 0; var7 < var14.tagCount(); ++var7) { -+ -+ if (var14 != null) { -+ for (int var7 = 0; var7 < var14.tagCount(); ++var7) { - short var8 = ((NBTTagCompound)var14.tagAt(var7)).getShort("id"); - short var9 = ((NBTTagCompound)var14.tagAt(var7)).getShort("lvl"); -- if(Enchantment.enchantmentsList[var8] != null) { -+ -+ if (Enchantment.enchantmentsList[var8] != null) { - var3.add(Enchantment.enchantmentsList[var8].getTranslatedName(var9)); - } - } - } - -- if(this.stackTagCompound.hasKey("display")) { -- NBTTagCompound var16 = this.stackTagCompound.getCompoundTag("display"); -- if(var16.hasKey("color")) { -- if(var2) { -- var3.add("Color: #" + Integer.toHexString(var16.getInteger("color")).toUpperCase()); -+ if (this.stackTagCompound.hasKey("display")) { -+ NBTTagCompound var17 = this.stackTagCompound.getCompoundTag("display"); -+ -+ if (var17.hasKey("color")) { -+ if (par2) { -+ var3.add("Color: #" + Integer.toHexString(var17.getInteger("color")).toUpperCase()); - } else { - var3.add(EnumChatFormatting.ITALIC + StatCollector.translateToLocal("item.dyed")); - } - } - -- if(var16.hasKey("Lore")) { -- NBTTagList var18 = var16.getTagList("Lore"); -- if(var18.tagCount() > 0) { -- for(int var20 = 0; var20 < var18.tagCount(); ++var20) { -- var3.add(EnumChatFormatting.DARK_PURPLE + "" + EnumChatFormatting.ITALIC + ((NBTTagString)var18.tagAt(var20)).a); -+ if (var17.hasKey("Lore")) { -+ NBTTagList var19 = var17.getTagList("Lore"); -+ -+ if (var19.tagCount() > 0) { -+ for (int var20 = 0; var20 < var19.tagCount(); ++var20) { -+ var3.add(EnumChatFormatting.DARK_PURPLE + "" + EnumChatFormatting.ITALIC + ((NBTTagString)var19.tagAt(var20)).data); - } - } - } - } - } - -- Multimap var15 = this.getAttributeModifiers(); -- if(!var15.isEmpty()) { -+ Multimap var16 = this.getAttributeModifiers(); -+ -+ if (!var16.isEmpty()) { - var3.add(""); -- Iterator var17 = var15.entries().iterator(); -+ Iterator var15 = var16.entries().iterator(); - -- while(var17.hasNext()) { -- Entry var19 = (Entry)var17.next(); -- AttributeModifier var21 = (AttributeModifier)var19.getValue(); -+ while (var15.hasNext()) { -+ Entry var18 = (Entry)var15.next(); -+ AttributeModifier var21 = (AttributeModifier)var18.getValue(); - double var10 = var21.getAmount(); - double var12; -- if(var21.getOperation() != 1 && var21.getOperation() != 2) { -+ -+ if (var21.getOperation() != 1 && var21.getOperation() != 2) { - var12 = var21.getAmount(); - } else { - var12 = var21.getAmount() * 100.0D; - } - -- if(var10 > 0.0D) { -- var3.add(EnumChatFormatting.BLUE + StatCollector.translateToLocalFormatted("attribute.modifier.plus." + var21.getOperation(), new Object[]{a.format(var12), StatCollector.translateToLocal("attribute.name." + (String)var19.getKey())})); -- } else if(var10 < 0.0D) { -+ if (var10 > 0.0D) { -+ var3.add(EnumChatFormatting.BLUE + StatCollector.translateToLocalFormatted("attribute.modifier.plus." + var21.getOperation(), new Object[] {field_111284_a.format(var12), StatCollector.translateToLocal("attribute.name." + (String)var18.getKey())})); -+ } else if (var10 < 0.0D) { - var12 *= -1.0D; -- var3.add(EnumChatFormatting.RED + StatCollector.translateToLocalFormatted("attribute.modifier.take." + var21.getOperation(), new Object[]{a.format(var12), StatCollector.translateToLocal("attribute.name." + (String)var19.getKey())})); -+ var3.add(EnumChatFormatting.RED + StatCollector.translateToLocalFormatted("attribute.modifier.take." + var21.getOperation(), new Object[] {field_111284_a.format(var12), StatCollector.translateToLocal("attribute.name." + (String)var18.getKey())})); - } - } - } - -- if(var2 && this.isItemDamaged()) { -+ if (par2 && this.isItemDamaged()) { - var3.add("Durability: " + (this.getMaxDamage() - this.getItemDamageForDisplay()) + " / " + this.getMaxDamage()); - } - - return var3; - } -- - public boolean hasEffect() { - return this.getItem().hasEffect(this); - } -@@ -464,76 +639,105 @@ - return this.getItem().getRarity(this); - } - -+ /** -+ * True if it is a tool and has no enchantments to begin with -+ */ - public boolean isItemEnchantable() { - return !this.getItem().isItemTool(this) ? false : !this.isItemEnchanted(); - } - -- public void addEnchantment(Enchantment var1, int var2) { -- if(this.stackTagCompound == null) { -+ /** -+ * Adds an enchantment with a desired level on the ItemStack. -+ */ -+ public void addEnchantment(Enchantment par1Enchantment, int par2) { -+ if (this.stackTagCompound == null) { - this.setTagCompound(new NBTTagCompound()); - } - -- if(!this.stackTagCompound.hasKey("ench")) { -+ if (!this.stackTagCompound.hasKey("ench")) { - this.stackTagCompound.setTag("ench", new NBTTagList("ench")); - } - - NBTTagList var3 = (NBTTagList)this.stackTagCompound.getTag("ench"); - NBTTagCompound var4 = new NBTTagCompound(); -- var4.setShort("id", (short)var1.effectId); -- var4.setShort("lvl", (short)((byte)var2)); -+ var4.setShort("id", (short)par1Enchantment.effectId); -+ var4.setShort("lvl", (short)((byte)par2)); - var3.appendTag(var4); - } - -+ /** -+ * True if the item has enchantment data -+ */ - public boolean isItemEnchanted() { - return this.stackTagCompound != null && this.stackTagCompound.hasKey("ench"); - } - -- public void setTagInfo(String var1, NBTBase var2) { -- if(this.stackTagCompound == null) { -+ public void setTagInfo(String par1Str, NBTBase par2NBTBase) { -+ if (this.stackTagCompound == null) { - this.setTagCompound(new NBTTagCompound()); - } - -- this.stackTagCompound.setTag(var1, var2); -+ this.stackTagCompound.setTag(par1Str, par2NBTBase); - } - - public boolean canEditBlocks() { - return this.getItem().canItemEditBlocks(); - } - -+ /** -+ * Return whether this stack is on an item frame. -+ */ - public boolean isOnItemFrame() { - return this.itemFrame != null; - } - -- public void setItemFrame(EntityItemFrame var1) { -- this.itemFrame = var1; -+ /** -+ * Set the item frame this stack is on. -+ */ -+ public void setItemFrame(EntityItemFrame par1EntityItemFrame) { -+ this.itemFrame = par1EntityItemFrame; - } - -+ /** -+ * Return the item frame this stack is on. Returns null if not on an item frame. -+ */ - public EntityItemFrame getItemFrame() { - return this.itemFrame; - } - -+ /** -+ * Get this stack's repair cost, or 0 if no repair cost is defined. -+ */ - public int getRepairCost() { - return this.hasTagCompound() && this.stackTagCompound.hasKey("RepairCost") ? this.stackTagCompound.getInteger("RepairCost") : 0; - } - -- public void setRepairCost(int var1) { -- if(!this.hasTagCompound()) { -+ /** -+ * Set this stack's repair cost. -+ */ -+ public void setRepairCost(int par1) { -+ if (!this.hasTagCompound()) { - this.stackTagCompound = new NBTTagCompound("tag"); - } - -- this.stackTagCompound.setInteger("RepairCost", var1); -+ this.stackTagCompound.setInteger("RepairCost", par1); - } -- -+ -+ /** -+ * Gets the attribute modifiers for this ItemStack.\nWill check for an NBT tag list containing modifiers for the stack. -+ */ - public Multimap getAttributeModifiers() { - Object var1; -- if(this.hasTagCompound() && this.stackTagCompound.hasKey("AttributeModifiers")) { -+ -+ if (this.hasTagCompound() && this.stackTagCompound.hasKey("AttributeModifiers")) { - var1 = HashMultimap.create(); - NBTTagList var2 = this.stackTagCompound.getTagList("AttributeModifiers"); - -- for(int var3 = 0; var3 < var2.tagCount(); ++var3) { -+ for (int var3 = 0; var3 < var2.tagCount(); ++var3) { - NBTTagCompound var4 = (NBTTagCompound)var2.tagAt(var3); - AttributeModifier var5 = SharedMonsterAttributes.func_111259_a(var4); -- if(var5.getID().getLeastSignificantBits() != 0L && var5.getID().getMostSignificantBits() != 0L) { -+ -+ if (var5.getID().getLeastSignificantBits() != 0L && var5.getID().getMostSignificantBits() != 0L) { - ((Multimap)var1).put(var4.getString("AttributeName"), var5); - } - } ---- /dev/null -+++ com/prupe/mcpatcher/cc/Colorizer.java -@@ -1,0 +1,166 @@ -+package com.prupe.mcpatcher.cc; -+ -+import com.prupe.mcpatcher.Config; -+import com.prupe.mcpatcher.MCLogger; -+import com.prupe.mcpatcher.TexturePackAPI; -+import com.prupe.mcpatcher.TexturePackChangeHandler; -+import com.prupe.mcpatcher.cc.Colorizer$1; -+import java.util.Properties; -+import net.minecraft.src.Potion; -+import net.minecraft.src.ResourceLocation; -+ -+public class Colorizer { -+ private static final MCLogger logger = MCLogger.getLogger("Custom Colors"); -+ static final ResourceLocation COLOR_PROPERTIES = TexturePackAPI.newMCPatcherResourceLocation("color.properties"); -+ private static Properties properties; -+ static final boolean useWaterColors = Config.getBoolean("Custom Colors", "water", true); -+ static final boolean useSwampColors = Config.getBoolean("Custom Colors", "swamp", true); -+ static final boolean useTreeColors = Config.getBoolean("Custom Colors", "tree", true); -+ static final boolean usePotionColors = Config.getBoolean("Custom Colors", "potion", true); -+ static final boolean useParticleColors = Config.getBoolean("Custom Colors", "particle", true); -+ static final boolean useFogColors = Config.getBoolean("Custom Colors", "fog", true); -+ static final boolean useCloudType = Config.getBoolean("Custom Colors", "clouds", true); -+ static final boolean useRedstoneColors = Config.getBoolean("Custom Colors", "redstone", true); -+ static final boolean useStemColors = Config.getBoolean("Custom Colors", "stem", true); -+ static final boolean useMapColors = Config.getBoolean("Custom Colors", "map", true); -+ static final boolean useDyeColors = Config.getBoolean("Custom Colors", "dye", true); -+ static final boolean useBlockColors = Config.getBoolean("Custom Colors", "otherBlocks", true); -+ static final boolean useTextColors = Config.getBoolean("Custom Colors", "text", true); -+ static final boolean useXPOrbColors = Config.getBoolean("Custom Colors", "xporb", true); -+ static final boolean useEggColors = Config.getBoolean("Custom Colors", "egg", true); -+ public static final int COLOR_MAP_SWAMP_GRASS = 0; -+ public static final int COLOR_MAP_SWAMP_FOLIAGE = 1; -+ public static final int COLOR_MAP_PINE = 2; -+ public static final int COLOR_MAP_BIRCH = 3; -+ public static final int COLOR_MAP_FOLIAGE = 4; -+ public static final int COLOR_MAP_WATER = 5; -+ public static final int COLOR_MAP_UNDERWATER = 6; -+ public static final int COLOR_MAP_FOG0 = 7; -+ public static final int COLOR_MAP_SKY0 = 8; -+ public static final int NUM_FIXED_COLOR_MAPS = 9; -+ static final ColorMap[] fixedColorMaps = new ColorMap[9]; -+ public static final float[] setColor = new float[3]; -+ -+ public static void setColorF(int color) { -+ intToFloat3(color, setColor); -+ } -+ -+ static void init() {} -+ -+ private static void reset() { -+ properties = new Properties(); -+ ColorizeBlock.reset(); -+ Lightmap.reset(); -+ ColorizeItem.reset(); -+ ColorizeWorld.reset(); -+ ColorizeEntity.reset(); -+ } -+ -+ private static void reloadColorProperties() { -+ if (TexturePackAPI.getProperties(COLOR_PROPERTIES, properties)) { -+ logger.finer("reloading %s", new Object[] {COLOR_PROPERTIES}); -+ } -+ } -+ -+ static String getStringKey(String[] keys, int index) { -+ return keys != null && index >= 0 && index < keys.length && keys[index] != null ? keys[index] : "" + index; -+ } -+ -+ static void loadIntColor(String key, Potion potion) { -+ potion.liquidColor = loadIntColor(key, potion.liquidColor); -+ } -+ -+ static boolean loadIntColor(String key, int[] color, int index) { -+ logger.config("%s=%06x", new Object[] {key, Integer.valueOf(color[index])}); -+ String value = properties.getProperty(key, ""); -+ -+ if (!value.equals("")) { -+ try { -+ color[index] = Integer.parseInt(value, 16); -+ return true; -+ } catch (NumberFormatException var5) { -+ ; -+ } -+ } -+ -+ return false; -+ } -+ -+ static int loadIntColor(String key, int color) { -+ logger.config("%s=%06x", new Object[] {key, Integer.valueOf(color)}); -+ String value = properties.getProperty(key, ""); -+ -+ if (!value.equals("")) { -+ try { -+ return Integer.parseInt(value, 16); -+ } catch (NumberFormatException var4) { -+ ; -+ } -+ } -+ -+ return color; -+ } -+ -+ static void loadFloatColor(String key, float[] color) { -+ int intColor = float3ToInt(color); -+ intToFloat3(loadIntColor(key, intColor), color); -+ } -+ -+ static void intToFloat3(int rgb, float[] f, int offset) { -+ if ((rgb & 16777215) == 16777215) { -+ f[offset] = f[offset + 1] = f[offset + 2] = 1.0F; -+ } else { -+ f[offset] = (float)(rgb & 16711680) / 1.671168E7F; -+ f[offset + 1] = (float)(rgb & 65280) / 65280.0F; -+ f[offset + 2] = (float)(rgb & 255) / 255.0F; -+ } -+ } -+ -+ static void intToFloat3(int rgb, float[] f) { -+ intToFloat3(rgb, f, 0); -+ } -+ -+ static int float3ToInt(float[] f, int offset) { -+ return (int)(255.0F * f[offset]) << 16 | (int)(255.0F * f[offset + 1]) << 8 | (int)(255.0F * f[offset + 2]); -+ } -+ -+ static int float3ToInt(float[] f) { -+ return float3ToInt(f, 0); -+ } -+ -+ static float clamp(float f) { -+ return f < 0.0F ? 0.0F : (f > 1.0F ? 1.0F : f); -+ } -+ -+ static double clamp(double d) { -+ return d < 0.0D ? 0.0D : (d > 1.0D ? 1.0D : d); -+ } -+ -+ static void clamp(float[] f) { -+ for (int i = 0; i < f.length; ++i) { -+ f[i] = clamp(f[i]); -+ } -+ } -+ -+ static void access$000() { -+ reset(); -+ } -+ -+ static void access$100() { -+ reloadColorProperties(); -+ } -+ -+ static Properties access$200() { -+ return properties; -+ } -+ -+ static { -+ try { -+ reset(); -+ } catch (Throwable var1) { -+ var1.printStackTrace(); -+ } -+ -+ TexturePackChangeHandler.register(new Colorizer$1("Custom Colors", 2)); -+ } -+} ---- /dev/null -+++ org/spoutcraft/client/packet/PacketScreenshot.java -@@ -1,0 +1,101 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.client.packet; -+ -+import java.awt.image.BufferedImage; -+import java.io.ByteArrayOutputStream; -+import java.io.IOException; -+import javax.imageio.ImageIO; -+ -+import net.minecraft.src.Minecraft; -+import net.minecraft.src.ScreenShotHelper; -+ -+import org.spoutcraft.api.io.SpoutInputStream; -+import org.spoutcraft.api.io.SpoutOutputStream; -+import org.spoutcraft.client.SpoutClient; -+ -+public class PacketScreenshot implements SpoutPacket { -+ byte[] ssAsPng = null; -+ boolean isRequest = false; -+ -+ public PacketScreenshot() { -+ isRequest = true; -+ } -+ -+ public PacketScreenshot(BufferedImage ss) throws IOException { -+ ByteArrayOutputStream baos = new ByteArrayOutputStream(); -+ ImageIO.write(ss, "png", baos); -+ baos.flush(); -+ ssAsPng = baos.toByteArray(); -+ baos.close(); -+ } -+ -+ public int getNumBytes() { -+ if (ssAsPng == null) { -+ return 1; -+ } -+ return ssAsPng.length + 5; -+ } -+ -+ public void readData(SpoutInputStream input) throws IOException { -+ isRequest = input.readBoolean(); -+ if (!isRequest) { -+ int ssLen = input.readInt(); -+ ssAsPng = new byte[ssLen]; -+ input.read(ssAsPng); -+ } -+ } -+ -+ public void writeData(SpoutOutputStream output) throws IOException { -+ if (ssAsPng == null) { -+ output.writeBoolean(true); -+ } else { -+ output.writeBoolean(false); -+ output.writeInt(ssAsPng.length); -+ output.write(ssAsPng); -+ } -+ } -+ -+ public void run(int playerId) { -+ if (!isRequest) { -+ return; // we can't do anything! -+ } -+ try { -+ SpoutClient.getInstance().getActivePlayer().showAchievement("Sending screenshot...", "Screenshot requested", 321); -+ BufferedImage screenshot = ScreenShotHelper.getScreenshot(Minecraft.getMinecraft().displayWidth, Minecraft.getMinecraft().displayHeight); -+ PacketScreenshot packet = new PacketScreenshot(screenshot); -+ SpoutClient.getInstance().getPacketManager().sendSpoutPacket(packet); -+ } catch (IOException ioe) { -+ ioe.printStackTrace(); -+ SpoutClient.getInstance().getActivePlayer().showAchievement("Sending screenshot...", "Failed!", 321); -+ } -+ } -+ -+ public void failure(int playerId) { -+ } -+ -+ public PacketType getPacketType() { -+ return PacketType.PacketScreenshot; -+ } -+ -+ public int getVersion() { -+ return 1; -+ } -+} ---- net/minecraft/src/EntitySquid.java -+++ net/minecraft/src/EntitySquid.java -@@ -5,21 +5,33 @@ - public float prevSquidPitch; - public float squidYaw; - public float prevSquidYaw; -+ -+ /** -+ * appears to be rotation in radians; we already have pitch & yaw, so this completes the triumvirate. -+ */ - public float squidRotation; -+ -+ /** previous squidRotation in radians. */ - public float prevSquidRotation; -+ -+ /** angle of the tentacles in radians */ - public float tentacleAngle; -- public float lastTentacleAngle; -+ -+ /** the last calculated angle of the tentacles in radians */ -+ public float prevTentacleAngle; - private float randomMotionSpeed; -+ -+ /** change in squidRotation in radians. */ - private float rotationVelocity; - private float field_70871_bB; - private float randomMotionVecX; - private float randomMotionVecY; - private float randomMotionVecZ; - -- public EntitySquid(World var1) { -- super(var1); -+ public EntitySquid(World par1World) { -+ super(par1World); - this.setSize(0.95F, 0.95F); -- this.rotationVelocity = 1.0F / (this.ab.nextFloat() + 1.0F) * 0.2F; -+ this.rotationVelocity = 1.0F / (this.rand.nextFloat() + 1.0F) * 0.2F; - } - - protected void applyEntityAttributes() { -@@ -27,63 +39,96 @@ - this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setAttribute(10.0D); - } - -+ /** -+ * Returns the sound this mob makes while it's alive. -+ */ - protected String getLivingSound() { - return null; - } - -+ /** -+ * Returns the sound this mob makes when it is hurt. -+ */ - protected String getHurtSound() { - return null; - } - -+ /** -+ * Returns the sound this mob makes on death. -+ */ - protected String getDeathSound() { - return null; - } - -+ /** -+ * Returns the volume for the sounds this mob makes. -+ */ - protected float getSoundVolume() { - return 0.4F; - } - -+ /** -+ * Returns the item ID for the item the mob drops on death. -+ */ - protected int getDropItemId() { - return 0; - } - -+ /** -+ * returns if this entity triggers Block.onEntityWalking on the blocks they walk on. used for spiders and wolves to -+ * prevent them from trampling crops -+ */ - protected boolean canTriggerWalking() { - return false; - } - -- protected void dropFewItems(boolean var1, int var2) { -- int var3 = this.ab.nextInt(3 + var2) + 1; -+ /** -+ * Drop 0-2 items of this living's type. @param par1 - Whether this entity has recently been hit by a player. @param -+ * par2 - Level of Looting used to kill this mob. -+ */ -+ protected void dropFewItems(boolean par1, int par2) { -+ int var3 = this.rand.nextInt(3 + par2) + 1; - -- for(int var4 = 0; var4 < var3; ++var4) { -+ for (int var4 = 0; var4 < var3; ++var4) { - this.entityDropItem(new ItemStack(Item.dyePowder, 1, 0), 0.0F); - } -- - } - -+ /** -+ * Checks if this entity is inside water (if inWater field is true as a result of handleWaterMovement() returning true) -+ */ - public boolean isInWater() { -- return this.worldObj.handleMaterialAcceleration(this.boundingBox.expand(0.0D, (double)-0.6F, 0.0D), Material.water, this); -+ return this.worldObj.handleMaterialAcceleration(this.boundingBox.expand(0.0D, -0.6000000238418579D, 0.0D), Material.water, this); - } - -+ /** -+ * Called frequently so the entity can update its state every tick as required. For example, zombies and skeletons use -+ * this to react to sunlight and start to burn. -+ */ - public void onLivingUpdate() { - super.onLivingUpdate(); - this.prevSquidPitch = this.squidPitch; - this.prevSquidYaw = this.squidYaw; - this.prevSquidRotation = this.squidRotation; -- this.lastTentacleAngle = this.tentacleAngle; -+ this.prevTentacleAngle = this.tentacleAngle; - this.squidRotation += this.rotationVelocity; -- if(this.squidRotation > (float)Math.PI * 2.0F) { -- this.squidRotation -= (float)Math.PI * 2.0F; -- if(this.ab.nextInt(10) == 0) { -- this.rotationVelocity = 1.0F / (this.ab.nextFloat() + 1.0F) * 0.2F; -+ -+ if (this.squidRotation > ((float)Math.PI * 2F)) { -+ this.squidRotation -= ((float)Math.PI * 2F); -+ -+ if (this.rand.nextInt(10) == 0) { -+ this.rotationVelocity = 1.0F / (this.rand.nextFloat() + 1.0F) * 0.2F; - } - } - -- if(this.isInWater()) { -+ if (this.isInWater()) { - float var1; -- if(this.squidRotation < (float)Math.PI) { -+ -+ if (this.squidRotation < (float)Math.PI) { - var1 = this.squidRotation / (float)Math.PI; - this.tentacleAngle = MathHelper.sin(var1 * var1 * (float)Math.PI) * (float)Math.PI * 0.25F; -- if((double)var1 > 0.75D) { -+ -+ if ((double)var1 > 0.75D) { - this.randomMotionSpeed = 1.0F; - this.field_70871_bB = 1.0F; - } else { -@@ -95,7 +140,7 @@ - this.field_70871_bB *= 0.99F; - } - -- if(!this.worldObj.isRemote) { -+ if (!this.worldObj.isRemote) { - this.motionX = (double)(this.randomMotionVecX * this.randomMotionSpeed); - this.motionY = (double)(this.randomMotionVecY * this.randomMotionSpeed); - this.motionZ = (double)(this.randomMotionVecZ * this.randomMotionSpeed); -@@ -108,36 +153,43 @@ - this.squidPitch += (-((float)Math.atan2((double)var1, this.motionY)) * 180.0F / (float)Math.PI - this.squidPitch) * 0.1F; - } else { - this.tentacleAngle = MathHelper.abs(MathHelper.sin(this.squidRotation)) * (float)Math.PI * 0.25F; -- if(!this.worldObj.isRemote) { -+ -+ if (!this.worldObj.isRemote) { - this.motionX = 0.0D; - this.motionY -= 0.08D; -- this.motionY *= (double)0.98F; -+ this.motionY *= 0.9800000190734863D; - this.motionZ = 0.0D; - } - - this.squidPitch = (float)((double)this.squidPitch + (double)(-90.0F - this.squidPitch) * 0.02D); - } -- - } - -- public void moveEntityWithHeading(float var1, float var2) { -+ /** -+ * Moves the entity based on the specified heading. Args: strafe, forward -+ */ -+ public void moveEntityWithHeading(float par1, float par2) { - this.moveEntity(this.motionX, this.motionY, this.motionZ); - } - - protected void updateEntityActionState() { - ++this.entityAge; -- if(this.entityAge > 100) { -+ -+ if (this.entityAge > 100) { - this.randomMotionVecX = this.randomMotionVecY = this.randomMotionVecZ = 0.0F; -- } else if(this.ab.nextInt(50) == 0 || !this.inWater || this.randomMotionVecX == 0.0F && this.randomMotionVecY == 0.0F && this.randomMotionVecZ == 0.0F) { -- float var1 = this.ab.nextFloat() * (float)Math.PI * 2.0F; -+ } else if (this.rand.nextInt(50) == 0 || !this.inWater || this.randomMotionVecX == 0.0F && this.randomMotionVecY == 0.0F && this.randomMotionVecZ == 0.0F) { -+ float var1 = this.rand.nextFloat() * (float)Math.PI * 2.0F; - this.randomMotionVecX = MathHelper.cos(var1) * 0.2F; -- this.randomMotionVecY = -0.1F + this.ab.nextFloat() * 0.2F; -+ this.randomMotionVecY = -0.1F + this.rand.nextFloat() * 0.2F; - this.randomMotionVecZ = MathHelper.sin(var1) * 0.2F; - } - - this.despawnEntity(); - } - -+ /** -+ * Checks if the entity's current position is a valid location to spawn this entity. -+ */ - public boolean getCanSpawnHere() { - return this.posY > 45.0D && this.posY < 63.0D && super.getCanSpawnHere(); - } ---- net/minecraft/src/SlotCreativeInventory.java -+++ net/minecraft/src/SlotCreativeInventory.java -@@ -2,55 +2,84 @@ - - class SlotCreativeInventory extends Slot { - private final Slot theSlot; -+ - final GuiContainerCreative theCreativeInventory; - -- public SlotCreativeInventory(GuiContainerCreative var1, Slot var2, int var3) { -- super(var2.inventory, var3, 0, 0); -- this.theCreativeInventory = var1; -- this.theSlot = var2; -- } -- -- public void onPickupFromSlot(EntityPlayer var1, ItemStack var2) { -- this.theSlot.onPickupFromSlot(var1, var2); -- } -- -- public boolean isItemValid(ItemStack var1) { -- return this.theSlot.isItemValid(var1); -- } -- -+ public SlotCreativeInventory(GuiContainerCreative par1GuiContainerCreative, Slot par2Slot, int par3) { -+ super(par2Slot.inventory, par3, 0, 0); -+ this.theCreativeInventory = par1GuiContainerCreative; -+ this.theSlot = par2Slot; -+ } -+ -+ public void onPickupFromSlot(EntityPlayer par1EntityPlayer, ItemStack par2ItemStack) { -+ this.theSlot.onPickupFromSlot(par1EntityPlayer, par2ItemStack); -+ } -+ -+ /** -+ * Check if the stack is a valid item for this slot. Always true beside for the armor slots. -+ */ -+ public boolean isItemValid(ItemStack par1ItemStack) { -+ return this.theSlot.isItemValid(par1ItemStack); -+ } -+ -+ /** -+ * Helper fnct to get the stack in the slot. -+ */ - public ItemStack getStack() { - return this.theSlot.getStack(); - } - -+ /** -+ * Returns if this slot contains a stack. -+ */ - public boolean getHasStack() { - return this.theSlot.getHasStack(); - } - -- public void putStack(ItemStack var1) { -- this.theSlot.putStack(var1); -+ /** -+ * Helper method to put a stack in the slot. -+ */ -+ public void putStack(ItemStack par1ItemStack) { -+ this.theSlot.putStack(par1ItemStack); - } - -+ /** -+ * Called when the stack in a Slot changes -+ */ - public void onSlotChanged() { - this.theSlot.onSlotChanged(); - } - -+ /** -+ * Returns the maximum stack size for a given slot (usually the same as getInventoryStackLimit(), but 1 in the case of -+ * armor slots) -+ */ - public int getSlotStackLimit() { - return this.theSlot.getSlotStackLimit(); - } - -+ /** -+ * Returns the icon index on items.png that is used as background image of the slot. -+ */ - public Icon getBackgroundIconIndex() { - return this.theSlot.getBackgroundIconIndex(); - } - -- public ItemStack decrStackSize(int var1) { -- return this.theSlot.decrStackSize(var1); -- } -- -- public boolean isHere(IInventory var1, int var2) { -- return this.theSlot.isHere(var1, var2); -- } -- -- static Slot func_75240_a(SlotCreativeInventory var0) { -- return var0.theSlot; -+ /** -+ * Decrease the size of the stack in slot (first int arg) by the amount of the second int arg. Returns the new stack. -+ */ -+ public ItemStack decrStackSize(int par1) { -+ return this.theSlot.decrStackSize(par1); -+ } -+ -+ /** -+ * returns true if this slot is in par2 of par1 -+ */ -+ public boolean isSlotInInventory(IInventory par1IInventory, int par2) { -+ return this.theSlot.isSlotInInventory(par1IInventory, par2); -+ } -+ -+ static Slot func_75240_a(SlotCreativeInventory par0SlotCreativeInventory) { -+ return par0SlotCreativeInventory.theSlot; - } - } ---- net/minecraft/src/ScorePlayerTeam.java -+++ net/minecraft/src/ScorePlayerTeam.java -@@ -6,81 +6,92 @@ - - public class ScorePlayerTeam extends Team { - private final Scoreboard theScoreboard; -- private final String b; -- private final Set c = new HashSet(); -- private String d; -- private String e = ""; -- private String f = ""; -+ private final String field_96675_b; -+ -+ /** A set of all team member usernames. */ -+ private final Set membershipSet = new HashSet(); -+ private String field_96673_d; -+ private String field_96674_e = ""; -+ private String colorSuffix = ""; - private boolean allowFriendlyFire = true; - private boolean field_98301_h = true; - -- public ScorePlayerTeam(Scoreboard var1, String var2) { -- this.theScoreboard = var1; -- this.b = var2; -- this.d = var2; -+ public ScorePlayerTeam(Scoreboard par1Scoreboard, String par2Str) { -+ this.theScoreboard = par1Scoreboard; -+ this.field_96675_b = par2Str; -+ this.field_96673_d = par2Str; - } - - public String func_96661_b() { -- return this.b; -+ return this.field_96675_b; - } - - public String func_96669_c() { -- return this.d; -+ return this.field_96673_d; - } - -- public void setTeamName(String var1) { -- if(var1 == null) { -+ public void func_96664_a(String par1Str) { -+ if (par1Str == null) { - throw new IllegalArgumentException("Name cannot be null"); - } else { -- this.d = var1; -+ this.field_96673_d = par1Str; - this.theScoreboard.func_96538_b(this); - } - } - - public Collection getMembershipCollection() { -- return this.c; -+ return this.membershipSet; - } - -+ /** -+ * Returns the color prefix for the player's team name -+ */ - public String getColorPrefix() { -- return this.e; -+ return this.field_96674_e; - } - -- public void setNamePrefix(String var1) { -- if(var1 == null) { -+ public void func_96666_b(String par1Str) { -+ if (par1Str == null) { - throw new IllegalArgumentException("Prefix cannot be null"); - } else { -- this.e = var1; -+ this.field_96674_e = par1Str; - this.theScoreboard.func_96538_b(this); - } - } - -+ /** -+ * Returns the color suffix for the player's team name -+ */ - public String getColorSuffix() { -- return this.f; -+ return this.colorSuffix; - } - -- public void setNameSuffix(String var1) { -- if(var1 == null) { -+ public void func_96662_c(String par1Str) { -+ if (par1Str == null) { - throw new IllegalArgumentException("Suffix cannot be null"); - } else { -- this.f = var1; -+ this.colorSuffix = par1Str; - this.theScoreboard.func_96538_b(this); - } - } - -- public String func_142053_d(String var1) { -- return this.getColorPrefix() + var1 + this.getColorSuffix(); -+ public String func_142053_d(String par1Str) { -+ return this.getColorPrefix() + par1Str + this.getColorSuffix(); - } - -- public static String formatPlayerName(Team var0, String var1) { -- return var0 == null ? var1 : var0.func_142053_d(var1); -+ /** -+ * Returns the player name including the color prefixes and suffixes -+ */ -+ public static String formatPlayerName(Team par0Team, String par1Str) { -+ return par0Team == null ? par1Str : par0Team.func_142053_d(par1Str); - } - - public boolean getAllowFriendlyFire() { - return this.allowFriendlyFire; - } - -- public void setAllowFriendlyFire(boolean var1) { -- this.allowFriendlyFire = var1; -+ public void setAllowFriendlyFire(boolean par1) { -+ this.allowFriendlyFire = par1; - this.theScoreboard.func_96538_b(this); - } - -@@ -88,26 +99,27 @@ - return this.field_98301_h; - } - -- public void setSeeFriendlyInvisiblesEnabled(boolean var1) { -- this.field_98301_h = var1; -+ public void func_98300_b(boolean par1) { -+ this.field_98301_h = par1; - this.theScoreboard.func_96538_b(this); - } - - public int func_98299_i() { - int var1 = 0; -- if(this.getAllowFriendlyFire()) { -+ -+ if (this.getAllowFriendlyFire()) { - var1 |= 1; - } - -- if(this.func_98297_h()) { -+ if (this.func_98297_h()) { - var1 |= 2; - } - - return var1; - } - -- public void func_98298_a(int var1) { -- this.setAllowFriendlyFire((var1 & 1) > 0); -- this.setSeeFriendlyInvisiblesEnabled((var1 & 2) > 0); -+ public void func_98298_a(int par1) { -+ this.setAllowFriendlyFire((par1 & 1) > 0); -+ this.func_98300_b((par1 & 2) > 0); - } - } ---- net/minecraft/src/EntityChicken.java -+++ net/minecraft/src/EntityChicken.java -@@ -6,12 +6,14 @@ - public float field_70884_g; - public float field_70888_h; - public float field_70889_i = 1.0F; -+ -+ /** The time until the next egg is spawned. */ - public int timeUntilNextEgg; - -- public EntityChicken(World var1) { -- super(var1); -+ public EntityChicken(World par1World) { -+ super(par1World); - this.setSize(0.3F, 0.7F); -- this.timeUntilNextEgg = this.ab.nextInt(6000) + 6000; -+ this.timeUntilNextEgg = this.rand.nextInt(6000) + 6000; - this.tasks.addTask(0, new EntityAISwimming(this)); - this.tasks.addTask(1, new EntityAIPanic(this, 1.4D)); - this.tasks.addTask(2, new EntityAIMate(this, 1.0D)); -@@ -22,6 +24,9 @@ - this.tasks.addTask(7, new EntityAILookIdle(this)); - } - -+ /** -+ * Returns true if the newer Entity AI code should be run -+ */ - public boolean isAIEnabled() { - return true; - } -@@ -32,84 +37,117 @@ - this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setAttribute(0.25D); - } - -+ /** -+ * Called frequently so the entity can update its state every tick as required. For example, zombies and skeletons use -+ * this to react to sunlight and start to burn. -+ */ - public void onLivingUpdate() { - super.onLivingUpdate(); - this.field_70888_h = this.field_70886_e; - this.field_70884_g = this.destPos; - this.destPos = (float)((double)this.destPos + (double)(this.onGround ? -1 : 4) * 0.3D); -- if(this.destPos < 0.0F) { -+ -+ if (this.destPos < 0.0F) { - this.destPos = 0.0F; - } - -- if(this.destPos > 1.0F) { -+ if (this.destPos > 1.0F) { - this.destPos = 1.0F; - } - -- if(!this.onGround && this.field_70889_i < 1.0F) { -+ if (!this.onGround && this.field_70889_i < 1.0F) { - this.field_70889_i = 1.0F; - } - - this.field_70889_i = (float)((double)this.field_70889_i * 0.9D); -- if(!this.onGround && this.motionY < 0.0D) { -+ -+ if (!this.onGround && this.motionY < 0.0D) { - this.motionY *= 0.6D; - } - - this.field_70886_e += this.field_70889_i * 2.0F; -- if(!this.isChild() && !this.worldObj.isRemote && --this.timeUntilNextEgg <= 0) { -- this.playSound("mob.chicken.plop", 1.0F, (this.ab.nextFloat() - this.ab.nextFloat()) * 0.2F + 1.0F); -+ -+ if (!this.isChild() && !this.worldObj.isRemote && --this.timeUntilNextEgg <= 0) { -+ this.playSound("mob.chicken.plop", 1.0F, (this.rand.nextFloat() - this.rand.nextFloat()) * 0.2F + 1.0F); - this.dropItem(Item.egg.itemID, 1); -- this.timeUntilNextEgg = this.ab.nextInt(6000) + 6000; -+ this.timeUntilNextEgg = this.rand.nextInt(6000) + 6000; - } -- -- } -- -- protected void fall(float var1) { -- } -- -+ } -+ -+ /** -+ * Called when the mob is falling. Calculates and applies fall damage. -+ */ -+ protected void fall(float par1) {} -+ -+ /** -+ * Returns the sound this mob makes while it's alive. -+ */ - protected String getLivingSound() { - return "mob.chicken.say"; - } - -+ /** -+ * Returns the sound this mob makes when it is hurt. -+ */ - protected String getHurtSound() { - return "mob.chicken.hurt"; - } - -+ /** -+ * Returns the sound this mob makes on death. -+ */ - protected String getDeathSound() { - return "mob.chicken.hurt"; - } - -- protected void playStepSound(int var1, int var2, int var3, int var4) { -+ /** -+ * Plays step sound at given x, y, z for the entity -+ */ -+ protected void playStepSound(int par1, int par2, int par3, int par4) { - this.playSound("mob.chicken.step", 0.15F, 1.0F); - } - -+ /** -+ * Returns the item ID for the item the mob drops on death. -+ */ - protected int getDropItemId() { - return Item.feather.itemID; - } - -- protected void dropFewItems(boolean var1, int var2) { -- int var3 = this.ab.nextInt(3) + this.ab.nextInt(1 + var2); -+ /** -+ * Drop 0-2 items of this living's type. @param par1 - Whether this entity has recently been hit by a player. @param -+ * par2 - Level of Looting used to kill this mob. -+ */ -+ protected void dropFewItems(boolean par1, int par2) { -+ int var3 = this.rand.nextInt(3) + this.rand.nextInt(1 + par2); - -- for(int var4 = 0; var4 < var3; ++var4) { -+ for (int var4 = 0; var4 < var3; ++var4) { - this.dropItem(Item.feather.itemID, 1); - } - -- if(this.isBurning()) { -+ if (this.isBurning()) { - this.dropItem(Item.chickenCooked.itemID, 1); - } else { - this.dropItem(Item.chickenRaw.itemID, 1); - } -- - } - -- public EntityChicken spawnBabyAnimal(EntityAgeable var1) { -+ /** -+ * This function is used when two same-species animals in 'love mode' breed to generate the new baby animal. -+ */ -+ public EntityChicken spawnBabyAnimal(EntityAgeable par1EntityAgeable) { - return new EntityChicken(this.worldObj); - } - -- public boolean isBreedingItem(ItemStack var1) { -- return var1 != null && var1.getItem() instanceof ItemSeeds; -+ /** -+ * Checks if the parameter is an item which this animal can be fed to breed it (wheat, carrots or seeds depending on -+ * the animal type) -+ */ -+ public boolean isBreedingItem(ItemStack par1ItemStack) { -+ return par1ItemStack != null && par1ItemStack.getItem() instanceof ItemSeeds; - } - -- public EntityAgeable createChild(EntityAgeable var1) { -- return this.spawnBabyAnimal(var1); -+ public EntityAgeable createChild(EntityAgeable par1EntityAgeable) { -+ return this.spawnBabyAnimal(par1EntityAgeable); - } - } ---- /dev/null -+++ org/spoutcraft/api/gui/PopupScreen.java -@@ -1,0 +1,51 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.api.gui; -+ -+import org.spoutcraft.api.UnsafeClass; -+ -+@UnsafeClass -+public interface PopupScreen extends Screen { -+ /** -+ * Is true if the popup screen has no transparency layer -+ * -+ * @return transparency -+ */ -+ public boolean isTransparent(); -+ -+ /** -+ * Sets the transparency layer -+ * -+ * @param value to set -+ * @return popupscreen -+ */ -+ public PopupScreen setTransparent(boolean value); -+ -+ /** -+ * Closes the screen. Functionally equivelent to InGameHUD.closePopup() -+ * -+ * @return true if the screen was closed -+ */ -+ public boolean close(); -+ -+ public boolean isPausingGame(); -+ -+ public void setPauseGame(boolean v); -+} ---- net/minecraft/src/EntityAIAvoidEntitySelector.java -+++ net/minecraft/src/EntityAIAvoidEntitySelector.java -@@ -3,11 +3,14 @@ - class EntityAIAvoidEntitySelector implements IEntitySelector { - final EntityAIAvoidEntity entityAvoiderAI; - -- EntityAIAvoidEntitySelector(EntityAIAvoidEntity var1) { -- this.entityAvoiderAI = var1; -+ EntityAIAvoidEntitySelector(EntityAIAvoidEntity par1EntityAIAvoidEntity) { -+ this.entityAvoiderAI = par1EntityAIAvoidEntity; - } - -- public boolean isEntityApplicable(Entity var1) { -- return var1.isEntityAlive() && EntityAIAvoidEntity.func_98217_a(this.entityAvoiderAI).getEntitySenses().canSee(var1); -+ /** -+ * Return whether the specified entity is applicable to this filter. -+ */ -+ public boolean isEntityApplicable(Entity par1Entity) { -+ return par1Entity.isEntityAlive() && EntityAIAvoidEntity.func_98217_a(this.entityAvoiderAI).getEntitySenses().canSee(par1Entity); - } - } ---- /dev/null -+++ org/spoutcraft/client/SpoutcraftWorld.java -@@ -1,0 +1,261 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.client; -+ -+import java.util.ArrayList; -+import java.util.List; -+import java.util.UUID; -+ -+import net.minecraft.src.Minecraft; -+import net.minecraft.src.WorldInfo; -+ -+import org.spoutcraft.api.util.FastLocation; -+import org.spoutcraft.api.util.FixedLocation; -+import org.spoutcraft.client.block.SpoutcraftChunk; -+import org.spoutcraft.client.entity.CraftEntity; -+import org.spoutcraft.client.entity.CraftLivingEntity; -+import org.spoutcraft.client.player.SpoutPlayer; -+ -+public class SpoutcraftWorld { -+ private final net.minecraft.src.World handle; -+ -+ public SpoutcraftWorld(net.minecraft.src.World world) { -+ handle = world; -+ } -+ -+ public net.minecraft.src.World getHandle() { -+ return handle; -+ } -+ -+ public boolean isAllowAnimals() { -+ return handle.spawnPeacefulMobs; -+ } -+ -+ public boolean isAllowMonsters() { -+ return handle.spawnHostileMobs; -+ } -+ -+ public int getMixedBrightnessAt(org.spoutcraft.api.material.Block block, int x, int y, int z) { -+ net.minecraft.src.Block b = null; -+ if (block.getRawId() < net.minecraft.src.Block.blocksList.length) { -+ b = net.minecraft.src.Block.blocksList[block.getRawId()]; -+ } -+ if (b == null) { -+ b = net.minecraft.src.Block.stone; -+ } -+ return b.getMixedBrightnessForBlock(handle, x, y, z); -+ } -+ -+ public boolean isOpaque(int x, int y, int z) { -+ return handle.isBlockOpaqueCube(x, y, z); -+ } -+ -+ public long getFullTime() { -+ return handle.getWorldTime(); -+ } -+ -+ public int getHighestBlockYAt(int x, int z) { -+ return handle.getFirstUncoveredBlock(x, z); -+ } -+ -+ public int getMaxHeight() { -+ return 256; -+ } -+ -+ public int getXBitShifts() { -+ return 8; -+ } -+ -+ public int getZBitShifts() { -+ return 12; -+ } -+ -+ public long getSeed() { -+ return handle.getSeed(); -+ } -+ -+ public boolean isChunkLoaded(SpoutcraftChunk chunk) { -+ return handle.chunkProvider.chunkExists(chunk.getX(), chunk.getZ()); -+ } -+ -+ public boolean isChunkLoaded(int x, int z) { -+ return handle.chunkProvider.chunkExists(x, z); -+ } -+ -+ public void loadChunk(SpoutcraftChunk chunk) { -+ handle.chunkProvider.loadChunk(chunk.getX(), chunk.getZ()); -+ } -+ -+ public void loadChunk(int x, int z) { -+ handle.chunkProvider.loadChunk(x, z); -+ } -+ -+ public void save() { -+ handle.chunkProvider.saveChunks(false, null); -+ } -+ -+ public void setFullTime(long time) { -+ handle.worldInfo.setWorldTime(time); -+ } -+ -+ public long getTime() { -+ long time = getFullTime() % 24000; -+ if (time < 0) { -+ time += 24000; -+ } -+ return time; -+ } -+ -+ public void setTime(long time) { -+ long margin = (time - getFullTime()) % 24000; -+ if (margin < 0) { -+ margin += 24000; -+ } -+ setFullTime(getFullTime() + margin); -+ } -+ -+ public int getBlockTypeIdAt(int x, int y, int z) { -+ return handle.getBlockId(x, y, z); -+ } -+ -+ public int getBlockTypeIdAt(FixedLocation location) { -+ return getBlockTypeIdAt(location.getBlockX(), location.getBlockY(), location.getBlockZ()); -+ } -+ -+ public int getBlockDataAt(int x, int y, int z) { -+ return handle.getBlockMetadata(x, y, z); -+ } -+ -+ public int getBlockDataAt(FixedLocation location) { -+ return getBlockDataAt(location.getBlockX(), location.getBlockY(), location.getBlockZ()); -+ } -+ -+ public int getHighestBlockYAt(FixedLocation location) { -+ return getHighestBlockYAt(location.getBlockX(), location.getBlockZ()); -+ } -+ -+ public List getEntities() { -+ ArrayList ret = new ArrayList(); -+ for (Object mcentity:handle.loadedEntityList) { -+ if (mcentity instanceof net.minecraft.src.Entity) { -+ ret.add(((net.minecraft.src.Entity)mcentity).spoutEnty); -+ } -+ } -+ return ret; -+ } -+ -+ public List getLivingEntities() { -+ ArrayList ret = new ArrayList(); -+ for (Object mcentity:handle.loadedEntityList) { -+ if (mcentity instanceof net.minecraft.src.EntityLiving) { -+ ret.add((CraftLivingEntity) ((net.minecraft.src.EntityLiving)mcentity).spoutEnty); -+ } -+ } -+ return ret; -+ } -+ -+ public List getPlayers() { -+ ArrayList ret = new ArrayList(); -+ for (Object mcentity:handle.loadedEntityList) { -+ if (mcentity instanceof net.minecraft.src.EntityPlayer) { -+ ret.add((SpoutPlayer) ((net.minecraft.src.EntityPlayer)mcentity).spoutEnty); -+ } -+ } -+ return ret; -+ } -+ -+ public String getName() { -+ return null; -+ } -+ -+ public UUID getUID() { -+ return null; -+ } -+ -+ public FixedLocation getSpawnLocation() { -+ WorldInfo info = handle.worldInfo; -+ return new FastLocation(info.getSpawnX(), info.getSpawnY(), info.getSpawnZ(), 0, 0); -+ } -+ -+ public boolean setSpawnLocation(int x, int y, int z) { -+ handle.worldInfo.setSpawnPosition(x, y, z); -+ return true; -+ } -+ -+ public boolean hasStorm() { -+ return handle.worldInfo.isRaining(); -+ } -+ -+ public void setStorm(boolean hasStorm) { -+ handle.worldInfo.setRaining(hasStorm); -+ } -+ -+ public int getWeatherDuration() { -+ return handle.worldInfo.getRainTime(); -+ } -+ -+ public void setWeatherDuration(int duration) { -+ handle.worldInfo.setRainTime(duration); -+ } -+ -+ public boolean isThundering() { -+ return handle.worldInfo.isThundering(); -+ } -+ -+ public void setThundering(boolean thundering) { -+ handle.worldInfo.setThundering(thundering); -+ } -+ -+ public int getThunderDuration() { -+ return handle.worldInfo.getThunderTime(); -+ } -+ -+ public void setThunderDuration(int duration) { -+ handle.worldInfo.setThunderTime(duration); -+ } -+ -+ public boolean createExplosion(double x, double y, double z, float power) { -+ return createExplosion(x, y, z, power, false); -+ } -+ -+ public boolean createExplosion(double x, double y, double z, float power, boolean setFire) { -+ return handle.newExplosion(null, x, y, z, power, setFire, true) != null; -+ } -+ -+ public boolean createExplosion(FixedLocation loc, float power) { -+ return createExplosion(loc, power, false); -+ } -+ -+ public boolean createExplosion(FixedLocation loc, float power, boolean setFire) { -+ return createExplosion(loc.getX(), loc.getY(), loc.getZ(), power, setFire); -+ } -+ -+ public boolean isMultiplayerWorld() { -+ return Minecraft.getMinecraft().isMultiplayerWorld(); -+ } -+ -+ public CraftEntity getEntityFromId(int id) { -+ net.minecraft.src.Entity e = SpoutClient.getInstance().getEntityFromId(id); -+ if (e != null) { -+ return e.spoutEnty; -+ } -+ return null; -+ } -+} ---- net/minecraft/src/BlockRedstoneLight.java -+++ net/minecraft/src/BlockRedstoneLight.java -@@ -3,51 +3,66 @@ - import java.util.Random; - - public class BlockRedstoneLight extends Block { -+ -+ /** Whether this lamp block is the powered version. */ - private final boolean powered; - -- public BlockRedstoneLight(int var1, boolean var2) { -- super(var1, Material.redstoneLight); -- this.powered = var2; -- if(var2) { -+ public BlockRedstoneLight(int par1, boolean par2) { -+ super(par1, Material.redstoneLight); -+ this.powered = par2; -+ -+ if (par2) { - this.setLightValue(1.0F); - } -- -- } -- -- public void onBlockAdded(World var1, int var2, int var3, int var4) { -- if(!var1.isRemote) { -- if(this.powered && !var1.isBlockIndirectlyGettingPowered(var2, var3, var4)) { -- var1.scheduleBlockUpdate(var2, var3, var4, this.blockID, 4); -- } else if(!this.powered && var1.isBlockIndirectlyGettingPowered(var2, var3, var4)) { -- var1.setBlock(var2, var3, var4, Block.redstoneLampActive.blockID, 0, 2); -- } -- } -- -- } -- -- public void onNeighborBlockChange(World var1, int var2, int var3, int var4, int var5) { -- if(!var1.isRemote) { -- if(this.powered && !var1.isBlockIndirectlyGettingPowered(var2, var3, var4)) { -- var1.scheduleBlockUpdate(var2, var3, var4, this.blockID, 4); -- } else if(!this.powered && var1.isBlockIndirectlyGettingPowered(var2, var3, var4)) { -- var1.setBlock(var2, var3, var4, Block.redstoneLampActive.blockID, 0, 2); -- } -- } -- -- } -- -- public void updateTick(World var1, int var2, int var3, int var4, Random var5) { -- if(!var1.isRemote && this.powered && !var1.isBlockIndirectlyGettingPowered(var2, var3, var4)) { -- var1.setBlock(var2, var3, var4, Block.redstoneLampIdle.blockID, 0, 2); -- } -- -- } -- -- public int idDropped(int var1, Random var2, int var3) { -+ } -+ -+ /** -+ * Called whenever the block is added into the world. Args: world, x, y, z -+ */ -+ public void onBlockAdded(World par1World, int par2, int par3, int par4) { -+ if (!par1World.isRemote) { -+ if (this.powered && !par1World.isBlockIndirectlyGettingPowered(par2, par3, par4)) { -+ par1World.scheduleBlockUpdate(par2, par3, par4, this.blockID, 4); -+ } else if (!this.powered && par1World.isBlockIndirectlyGettingPowered(par2, par3, par4)) { -+ par1World.setBlock(par2, par3, par4, Block.redstoneLampActive.blockID, 0, 2); -+ } -+ } -+ } -+ -+ /** -+ * Lets the block know when one of its neighbor changes. Doesn't know which neighbor changed (coordinates passed are -+ * their own) Args: x, y, z, neighbor blockID -+ */ -+ public void onNeighborBlockChange(World par1World, int par2, int par3, int par4, int par5) { -+ if (!par1World.isRemote) { -+ if (this.powered && !par1World.isBlockIndirectlyGettingPowered(par2, par3, par4)) { -+ par1World.scheduleBlockUpdate(par2, par3, par4, this.blockID, 4); -+ } else if (!this.powered && par1World.isBlockIndirectlyGettingPowered(par2, par3, par4)) { -+ par1World.setBlock(par2, par3, par4, Block.redstoneLampActive.blockID, 0, 2); -+ } -+ } -+ } -+ -+ /** -+ * Ticks the block if it's been scheduled -+ */ -+ public void updateTick(World par1World, int par2, int par3, int par4, Random par5Random) { -+ if (!par1World.isRemote && this.powered && !par1World.isBlockIndirectlyGettingPowered(par2, par3, par4)) { -+ par1World.setBlock(par2, par3, par4, Block.redstoneLampIdle.blockID, 0, 2); -+ } -+ } -+ -+ /** -+ * Returns the ID of the items to drop on destruction. -+ */ -+ public int idDropped(int par1, Random par2Random, int par3) { - return Block.redstoneLampIdle.blockID; - } - -- public int idPicked(World var1, int var2, int var3, int var4) { -+ /** -+ * only called by clickMiddleMouseButton , and passed to inventory.setCurrentItem (along with isCreative) -+ */ -+ public int idPicked(World par1World, int par2, int par3, int par4) { - return Block.redstoneLampIdle.blockID; - } - } ---- net/minecraft/src/IInventory.java -+++ net/minecraft/src/IInventory.java -@@ -1,29 +1,67 @@ - package net.minecraft.src; - - public interface IInventory { -+ -+ /** -+ * Returns the number of slots in the inventory. -+ */ - int getSizeInventory(); - -+ /** -+ * Returns the stack in slot i -+ */ - ItemStack getStackInSlot(int var1); - -+ /** -+ * Removes from an inventory slot (first arg) up to a specified number (second arg) of items and returns them in a new -+ * stack. -+ */ - ItemStack decrStackSize(int var1, int var2); - -+ /** -+ * When some containers are closed they call this on each slot, then drop whatever it returns as an EntityItem - like -+ * when you close a workbench GUI. -+ */ - ItemStack getStackInSlotOnClosing(int var1); - -+ /** -+ * Sets the given item stack to the specified slot in the inventory (can be crafting or armor sections). -+ */ - void setInventorySlotContents(int var1, ItemStack var2); - -+ /** -+ * Returns the name of the inventory. -+ */ - String getInvName(); - -+ /** -+ * If this returns false, the inventory name will be used as an unlocalized name, and translated into the player's -+ * language. Otherwise it will be used directly. -+ */ - boolean isInvNameLocalized(); - -+ /** -+ * Returns the maximum stack size for a inventory slot. Seems to always be 64, possibly will be extended. *Isn't this -+ * more of a set than a get?* -+ */ - int getInventoryStackLimit(); - -+ /** -+ * Called when an the contents of an Inventory change, usually -+ */ - void onInventoryChanged(); - -+ /** -+ * Do not make give this method the name canInteractWith because it clashes with Container -+ */ - boolean isUseableByPlayer(EntityPlayer var1); - - void openChest(); - - void closeChest(); - -+ /** -+ * Returns true if automation is allowed to insert the given stack (ignoring stack size) into the given slot. -+ */ - boolean isItemValidForSlot(int var1, ItemStack var2); - } ---- net/minecraft/src/ExtendedBlockStorage.java -+++ net/minecraft/src/ExtendedBlockStorage.java -@@ -1,121 +1,191 @@ - package net.minecraft.src; - - public class ExtendedBlockStorage { -+ -+ /** -+ * Contains the bottom-most Y block represented by this ExtendedBlockStorage. Typically a multiple of 16. -+ */ - private int yBase; -+ -+ /** -+ * A total count of the number of non-air blocks in this block storage's Chunk. -+ */ - private int blockRefCount; -+ -+ /** -+ * Contains the number of blocks in this block storage's parent chunk that require random ticking. Used to cull the -+ * Chunk from random tick updates for performance reasons. -+ */ - private int tickRefCount; -+ -+ /** -+ * Contains the least significant 8 bits of each block ID belonging to this block storage's parent Chunk. -+ */ - private byte[] blockLSBArray; -+ -+ /** -+ * Contains the most significant 4 bits of each block ID belonging to this block storage's parent Chunk. -+ */ - private NibbleArray blockMSBArray; -+ -+ /** -+ * Stores the metadata associated with blocks in this ExtendedBlockStorage. -+ */ - private NibbleArray blockMetadataArray; -+ -+ /** The NibbleArray containing a block of Block-light data. */ - private NibbleArray blocklightArray; -+ -+ /** The NibbleArray containing a block of Sky-light data. */ - private NibbleArray skylightArray; - -- public ExtendedBlockStorage(int var1, boolean var2) { -- this.yBase = var1; -+ public ExtendedBlockStorage(int par1, boolean par2) { -+ this.yBase = par1; - this.blockLSBArray = new byte[4096]; - this.blockMetadataArray = new NibbleArray(this.blockLSBArray.length, 4); - this.blocklightArray = new NibbleArray(this.blockLSBArray.length, 4); -- if(var2) { -+ -+ if (par2) { - this.skylightArray = new NibbleArray(this.blockLSBArray.length, 4); - } -- -- } -- -- public int getExtBlockID(int var1, int var2, int var3) { -- int var4 = this.blockLSBArray[var2 << 8 | var3 << 4 | var1] & 255; -- return this.blockMSBArray != null ? this.blockMSBArray.get(var1, var2, var3) << 8 | var4 : var4; -- } -- -- public void setExtBlockID(int var1, int var2, int var3, int var4) { -- int var5 = this.blockLSBArray[var2 << 8 | var3 << 4 | var1] & 255; -- if(this.blockMSBArray != null) { -- var5 |= this.blockMSBArray.get(var1, var2, var3) << 8; -+ } -+ -+ /** -+ * Returns the extended block ID for a location in a chunk, merged from a byte array and a NibbleArray to form a full -+ * 12-bit block ID. -+ */ -+ public int getExtBlockID(int par1, int par2, int par3) { -+ int var4 = this.blockLSBArray[par2 << 8 | par3 << 4 | par1] & 255; -+ return this.blockMSBArray != null ? this.blockMSBArray.get(par1, par2, par3) << 8 | var4 : var4; -+ } -+ -+ /** -+ * Sets the extended block ID for a location in a chunk, splitting bits 11..8 into a NibbleArray and bits 7..0 into a -+ * byte array. Also performs reference counting to determine whether or not to broadly cull this Chunk from the random- -+ * update tick list. -+ */ -+ public void setExtBlockID(int par1, int par2, int par3, int par4) { -+ int var5 = this.blockLSBArray[par2 << 8 | par3 << 4 | par1] & 255; -+ -+ if (this.blockMSBArray != null) { -+ var5 |= this.blockMSBArray.get(par1, par2, par3) << 8; - } - -- if(var5 == 0 && var4 != 0) { -+ if (var5 == 0 && par4 != 0) { - ++this.blockRefCount; -- if(Block.blocksList[var4] != null && Block.blocksList[var4].getTickRandomly()) { -+ -+ if (Block.blocksList[par4] != null && Block.blocksList[par4].getTickRandomly()) { - ++this.tickRefCount; - } -- } else if(var5 != 0 && var4 == 0) { -+ } else if (var5 != 0 && par4 == 0) { - --this.blockRefCount; -- if(Block.blocksList[var5] != null && Block.blocksList[var5].getTickRandomly()) { -+ -+ if (Block.blocksList[var5] != null && Block.blocksList[var5].getTickRandomly()) { - --this.tickRefCount; - } -- } else if(Block.blocksList[var5] == null || !Block.blocksList[var5].getTickRandomly() || Block.blocksList[var4] != null && Block.blocksList[var4].getTickRandomly()) { -- if((Block.blocksList[var5] == null || !Block.blocksList[var5].getTickRandomly()) && Block.blocksList[var4] != null && Block.blocksList[var4].getTickRandomly()) { -- ++this.tickRefCount; -- } -- } else { -+ } else if (Block.blocksList[var5] != null && Block.blocksList[var5].getTickRandomly() && (Block.blocksList[par4] == null || !Block.blocksList[par4].getTickRandomly())) { - --this.tickRefCount; -+ } else if ((Block.blocksList[var5] == null || !Block.blocksList[var5].getTickRandomly()) && Block.blocksList[par4] != null && Block.blocksList[par4].getTickRandomly()) { -+ ++this.tickRefCount; - } - -- this.blockLSBArray[var2 << 8 | var3 << 4 | var1] = (byte)(var4 & 255); -- if(var4 > 255) { -- if(this.blockMSBArray == null) { -+ this.blockLSBArray[par2 << 8 | par3 << 4 | par1] = (byte)(par4 & 255); -+ -+ if (par4 > 255) { -+ if (this.blockMSBArray == null) { - this.blockMSBArray = new NibbleArray(this.blockLSBArray.length, 4); - } - -- this.blockMSBArray.set(var1, var2, var3, (var4 & 3840) >> 8); -- } else if(this.blockMSBArray != null) { -- this.blockMSBArray.set(var1, var2, var3, 0); -+ this.blockMSBArray.set(par1, par2, par3, (par4 & 3840) >> 8); -+ } else if (this.blockMSBArray != null) { -+ this.blockMSBArray.set(par1, par2, par3, 0); - } -- -- } -- -- public int getExtBlockMetadata(int var1, int var2, int var3) { -- return this.blockMetadataArray.get(var1, var2, var3); -- } -- -- public void setExtBlockMetadata(int var1, int var2, int var3, int var4) { -- this.blockMetadataArray.set(var1, var2, var3, var4); -- } -- -+ } -+ -+ /** -+ * Returns the metadata associated with the block at the given coordinates in this ExtendedBlockStorage. -+ */ -+ public int getExtBlockMetadata(int par1, int par2, int par3) { -+ return this.blockMetadataArray.get(par1, par2, par3); -+ } -+ -+ /** -+ * Sets the metadata of the Block at the given coordinates in this ExtendedBlockStorage to the given metadata. -+ */ -+ public void setExtBlockMetadata(int par1, int par2, int par3, int par4) { -+ this.blockMetadataArray.set(par1, par2, par3, par4); -+ } -+ -+ /** -+ * Returns whether or not this block storage's Chunk is fully empty, based on its internal reference count. -+ */ - public boolean isEmpty() { - return this.blockRefCount == 0; - } - -+ /** -+ * Returns whether or not this block storage's Chunk will require random ticking, used to avoid looping through random -+ * block ticks when there are no blocks that would randomly tick. -+ */ - public boolean getNeedsRandomTick() { - return this.tickRefCount > 0; - } - -+ /** -+ * Returns the Y location of this ExtendedBlockStorage. -+ */ - public int getYLocation() { - return this.yBase; - } - -- public void setExtSkylightValue(int var1, int var2, int var3, int var4) { -- this.skylightArray.set(var1, var2, var3, var4); -- } -- -- public int getExtSkylightValue(int var1, int var2, int var3) { -- return this.skylightArray.get(var1, var2, var3); -- } -- -- public void setExtBlocklightValue(int var1, int var2, int var3, int var4) { -- this.blocklightArray.set(var1, var2, var3, var4); -- } -- -- public int getExtBlocklightValue(int var1, int var2, int var3) { -- return this.blocklightArray.get(var1, var2, var3); -+ /** -+ * Sets the saved Sky-light value in the extended block storage structure. -+ */ -+ public void setExtSkylightValue(int par1, int par2, int par3, int par4) { -+ this.skylightArray.set(par1, par2, par3, par4); -+ } -+ -+ /** -+ * Gets the saved Sky-light value in the extended block storage structure. -+ */ -+ public int getExtSkylightValue(int par1, int par2, int par3) { -+ return this.skylightArray.get(par1, par2, par3); -+ } -+ -+ /** -+ * Sets the saved Block-light value in the extended block storage structure. -+ */ -+ public void setExtBlocklightValue(int par1, int par2, int par3, int par4) { -+ this.blocklightArray.set(par1, par2, par3, par4); -+ } -+ -+ /** -+ * Gets the saved Block-light value in the extended block storage structure. -+ */ -+ public int getExtBlocklightValue(int par1, int par2, int par3) { -+ return this.blocklightArray.get(par1, par2, par3); - } - - public void removeInvalidBlocks() { - this.blockRefCount = 0; - this.tickRefCount = 0; - -- for(int var1 = 0; var1 < 16; ++var1) { -- for(int var2 = 0; var2 < 16; ++var2) { -- for(int var3 = 0; var3 < 16; ++var3) { -+ for (int var1 = 0; var1 < 16; ++var1) { -+ for (int var2 = 0; var2 < 16; ++var2) { -+ for (int var3 = 0; var3 < 16; ++var3) { - int var4 = this.getExtBlockID(var1, var2, var3); -- if(var4 > 0) { -- if(Block.blocksList[var4] == null) { -+ -+ if (var4 > 0) { -+ if (Block.blocksList[var4] == null) { - this.blockLSBArray[var2 << 8 | var3 << 4 | var1] = 0; -- if(this.blockMSBArray != null) { -+ -+ if (this.blockMSBArray != null) { - this.blockMSBArray.set(var1, var2, var3, 0); - } - } else { - ++this.blockRefCount; -- if(Block.blocksList[var4].getTickRandomly()) { -+ -+ if (Block.blocksList[var4].getTickRandomly()) { - ++this.tickRefCount; - } - } -@@ -123,7 +193,6 @@ - } - } - } -- - } - - public byte[] getBlockLSBArray() { -@@ -134,6 +203,9 @@ - this.blockMSBArray = null; - } - -+ /** -+ * Returns the block ID MSB (bits 11..8) array for this storage array's Chunk. -+ */ - public NibbleArray getBlockMSBArray() { - return this.blockMSBArray; - } -@@ -142,34 +214,59 @@ - return this.blockMetadataArray; - } - -+ /** -+ * Returns the NibbleArray instance containing Block-light data. -+ */ - public NibbleArray getBlocklightArray() { - return this.blocklightArray; - } - -+ /** -+ * Returns the NibbleArray instance containing Sky-light data. -+ */ - public NibbleArray getSkylightArray() { - return this.skylightArray; - } - -- public void setBlockLSBArray(byte[] var1) { -- this.blockLSBArray = var1; -- } -- -- public void setBlockMSBArray(NibbleArray var1) { -- this.blockMSBArray = var1; -- } -- -- public void setBlockMetadataArray(NibbleArray var1) { -- this.blockMetadataArray = var1; -- } -- -- public void setBlocklightArray(NibbleArray var1) { -- this.blocklightArray = var1; -- } -- -- public void setSkylightArray(NibbleArray var1) { -- this.skylightArray = var1; -- } -- -+ /** -+ * Sets the array of block ID least significant bits for this ExtendedBlockStorage. -+ */ -+ public void setBlockLSBArray(byte[] par1ArrayOfByte) { -+ this.blockLSBArray = par1ArrayOfByte; -+ } -+ -+ /** -+ * Sets the array of blockID most significant bits (blockMSBArray) for this ExtendedBlockStorage. -+ */ -+ public void setBlockMSBArray(NibbleArray par1NibbleArray) { -+ this.blockMSBArray = par1NibbleArray; -+ } -+ -+ /** -+ * Sets the NibbleArray of block metadata (blockMetadataArray) for this ExtendedBlockStorage. -+ */ -+ public void setBlockMetadataArray(NibbleArray par1NibbleArray) { -+ this.blockMetadataArray = par1NibbleArray; -+ } -+ -+ /** -+ * Sets the NibbleArray instance used for Block-light values in this particular storage block. -+ */ -+ public void setBlocklightArray(NibbleArray par1NibbleArray) { -+ this.blocklightArray = par1NibbleArray; -+ } -+ -+ /** -+ * Sets the NibbleArray instance used for Sky-light values in this particular storage block. -+ */ -+ public void setSkylightArray(NibbleArray par1NibbleArray) { -+ this.skylightArray = par1NibbleArray; -+ } -+ -+ /** -+ * Called by a Chunk to initialize the MSB array if getBlockMSBArray returns null. Returns the newly-created -+ * NibbleArray instance. -+ */ - public NibbleArray createBlockMSBArray() { - this.blockMSBArray = new NibbleArray(this.blockLSBArray.length, 4); - return this.blockMSBArray; ---- /dev/null -+++ com/prupe/mcpatcher/hd/CustomAnimation.java -@@ -1,0 +1,354 @@ -+package com.prupe.mcpatcher.hd; -+ -+import com.prupe.mcpatcher.Config; -+import com.prupe.mcpatcher.MCLogger; -+import com.prupe.mcpatcher.MCPatcherUtils; -+import com.prupe.mcpatcher.TexturePackAPI; -+import com.prupe.mcpatcher.TexturePackChangeHandler; -+import com.prupe.mcpatcher.hd.CustomAnimation$1; -+import java.awt.Graphics2D; -+import java.awt.image.BufferedImage; -+import java.awt.image.ImageObserver; -+import java.nio.ByteBuffer; -+import java.util.ArrayList; -+import java.util.Collections; -+import java.util.HashMap; -+import java.util.Iterator; -+import java.util.List; -+import java.util.Map; -+import java.util.Properties; -+import java.util.Map.Entry; -+import net.minecraft.src.ResourceLocation; -+import org.lwjgl.opengl.GL11; -+import org.lwjgl.util.glu.GLU; -+ -+public class CustomAnimation implements Comparable { -+ private static final MCLogger logger = MCLogger.getLogger("Custom Animations", "Animation"); -+ private static final boolean enable = Config.getBoolean("Extended HD", "animations", true); -+ private static final Map pending = new HashMap(); -+ private static final List animations = new ArrayList(); -+ private final ResourceLocation propertiesName; -+ private final ResourceLocation dstName; -+ private final ResourceLocation srcName; -+ private final int mipmapLevel; -+ private final ByteBuffer imageData; -+ private final int x; -+ private final int y; -+ private final int w; -+ private final int h; -+ private int currentFrame; -+ private int currentDelay; -+ private int numFrames; -+ private int[] tileOrder; -+ private int[] tileDelay; -+ private final int numTiles; -+ private boolean error; -+ -+ public static void updateAll() { -+ if (!pending.isEmpty()) { -+ try { -+ checkPendingAnimations(); -+ } catch (Throwable var2) { -+ var2.printStackTrace(); -+ logger.error("%d remaining animations cleared", new Object[] {Integer.valueOf(pending.size())}); -+ pending.clear(); -+ } -+ } -+ -+ Iterator i$ = animations.iterator(); -+ -+ while (i$.hasNext()) { -+ CustomAnimation animation = (CustomAnimation)i$.next(); -+ animation.update(); -+ } -+ } -+ -+ private static void checkPendingAnimations() { -+ ArrayList done = new ArrayList(); -+ Iterator i$ = pending.entrySet().iterator(); -+ -+ while (i$.hasNext()) { -+ Entry name = (Entry)i$.next(); -+ ResourceLocation name1 = (ResourceLocation)name.getKey(); -+ Properties properties = (Properties)name.getValue(); -+ ResourceLocation textureName = TexturePackAPI.parseResourceLocation(name1, MCPatcherUtils.getStringProperty(properties, "to", "")); -+ -+ if (TexturePackAPI.isTextureLoaded(textureName)) { -+ addStrip(name1, properties); -+ done.add(name1); -+ } -+ } -+ -+ if (!done.isEmpty()) { -+ i$ = done.iterator(); -+ -+ while (i$.hasNext()) { -+ ResourceLocation name2 = (ResourceLocation)i$.next(); -+ pending.remove(name2); -+ } -+ -+ Collections.sort(animations); -+ } -+ } -+ -+ private static void addStrip(ResourceLocation propertiesName, Properties properties) { -+ ResourceLocation dstName = TexturePackAPI.parseResourceLocation(propertiesName, properties.getProperty("to", "")); -+ -+ if (dstName == null) { -+ logger.error("%s: missing to= property", new Object[0]); -+ } else { -+ ResourceLocation srcName = TexturePackAPI.parseResourceLocation(propertiesName, properties.getProperty("from", "")); -+ -+ if (srcName == null) { -+ logger.error("%s: missing from= property", new Object[0]); -+ } else { -+ BufferedImage srcImage = TexturePackAPI.getImage(srcName); -+ -+ if (srcImage == null) { -+ logger.error("%s: image %s not found in texture pack", new Object[] {propertiesName, srcName}); -+ } else { -+ int x = MCPatcherUtils.getIntProperty(properties, "x", 0); -+ int y = MCPatcherUtils.getIntProperty(properties, "y", 0); -+ int w = MCPatcherUtils.getIntProperty(properties, "w", 0); -+ int h = MCPatcherUtils.getIntProperty(properties, "h", 0); -+ -+ if (dstName.toString().startsWith("minecraft:textures/atlas/")) { -+ logger.error("%s: animations cannot have a target of %s", new Object[] {dstName}); -+ } else if (x >= 0 && y >= 0 && w > 0 && h > 0) { -+ TexturePackAPI.bindTexture(dstName); -+ int dstWidth = GL11.glGetTexLevelParameteri(GL11.GL_TEXTURE_2D, 0, GL11.GL_TEXTURE_WIDTH); -+ int dstHeight = GL11.glGetTexLevelParameteri(GL11.GL_TEXTURE_2D, 0, GL11.GL_TEXTURE_HEIGHT); -+ int levels = MipmapHelper.getMipmapLevelsForCurrentTexture(); -+ -+ if (x + w <= dstWidth && y + h <= dstHeight) { -+ int width = srcImage.getWidth(); -+ int height = srcImage.getHeight(); -+ -+ if (width != w) { -+ srcImage = resizeImage(srcImage, w); -+ width = srcImage.getWidth(); -+ height = srcImage.getHeight(); -+ } -+ -+ if (width == w && height >= h) { -+ ByteBuffer imageData = ByteBuffer.allocateDirect(4 * width * height); -+ int[] argb = new int[width * height]; -+ byte[] rgba = new byte[4 * width * height]; -+ srcImage.getRGB(0, 0, width, height, argb, 0, width); -+ ARGBtoRGBA(argb, rgba); -+ imageData.put(rgba).flip(); -+ -+ for (int mipmapLevel = 0; mipmapLevel <= levels; ++mipmapLevel) { -+ add(new CustomAnimation(propertiesName, srcName, dstName, mipmapLevel, x, y, w, h, imageData, height / h, properties)); -+ -+ if (((x | y | w | h) & 1) != 0 || w <= 0 || h <= 0) { -+ break; -+ } -+ -+ ByteBuffer newImage = ByteBuffer.allocateDirect(width * height); -+ MipmapHelper.scaleHalf(imageData.asIntBuffer(), width, height, newImage.asIntBuffer(), 0); -+ imageData = newImage; -+ width >>= 1; -+ height >>= 1; -+ x >>= 1; -+ y >>= 1; -+ w >>= 1; -+ h >>= 1; -+ } -+ } else { -+ logger.error("%s: %s dimensions %dx%d do not match %dx%d", new Object[] {propertiesName, srcName, Integer.valueOf(width), Integer.valueOf(height), Integer.valueOf(w), Integer.valueOf(h)}); -+ } -+ } else { -+ logger.error("%s: %s dimensions x=%d,y=%d,w=%d,h=%d exceed %s size %dx%d", new Object[] {propertiesName, srcName, Integer.valueOf(x), Integer.valueOf(y), Integer.valueOf(w), Integer.valueOf(h), dstName, Integer.valueOf(dstWidth), Integer.valueOf(dstHeight)}); -+ } -+ } else { -+ logger.error("%s: %s has invalid dimensions x=%d,y=%d,w=%d,h=%d", new Object[] {propertiesName, srcName, Integer.valueOf(x), Integer.valueOf(y), Integer.valueOf(w), Integer.valueOf(h)}); -+ } -+ } -+ } -+ } -+ } -+ -+ private static void add(CustomAnimation animation) { -+ if (animation != null) { -+ animations.add(animation); -+ -+ if (animation.mipmapLevel == 0) { -+ logger.fine("new %s", new Object[] {animation}); -+ } -+ } -+ } -+ -+ private CustomAnimation(ResourceLocation propertiesName, ResourceLocation srcName, ResourceLocation dstName, int mipmapLevel, int x, int y, int w, int h, ByteBuffer imageData, int numFrames, Properties properties) { -+ this.propertiesName = propertiesName; -+ this.srcName = srcName; -+ this.dstName = dstName; -+ this.mipmapLevel = mipmapLevel; -+ this.x = x; -+ this.y = y; -+ this.w = w; -+ this.h = h; -+ this.imageData = imageData; -+ this.numFrames = numFrames; -+ this.currentFrame = -1; -+ this.numTiles = numFrames; -+ this.loadProperties(properties); -+ } -+ -+ void update() { -+ if (!this.error) { -+ int texture = TexturePackAPI.getTextureIfLoaded(this.dstName); -+ -+ if (texture >= 0) { -+ if (--this.currentDelay <= 0) { -+ if (++this.currentFrame >= this.numFrames) { -+ this.currentFrame = 0; -+ } -+ -+ TexturePackAPI.bindTexture(texture); -+ this.update(texture, 0, 0); -+ int glError = GL11.glGetError(); -+ -+ if (glError != 0) { -+ logger.severe("%s: %s", new Object[] {this, GLU.gluErrorString(glError)}); -+ this.error = true; -+ } else { -+ this.currentDelay = this.getDelay(); -+ } -+ } -+ } -+ } -+ } -+ -+ public int compareTo(CustomAnimation o) { -+ return this.dstName.toString().compareTo(o.dstName.toString()); -+ } -+ -+ public String toString() { -+ return String.format("CustomAnimation{%s %s %dx%d -> %s%s @ %d,%d (%d frames)}", new Object[] {this.propertiesName, this.srcName, Integer.valueOf(this.w), Integer.valueOf(this.h), this.dstName, this.mipmapLevel > 0 ? "#" + this.mipmapLevel : "", Integer.valueOf(this.x), Integer.valueOf(this.y), Integer.valueOf(this.numFrames)}); -+ } -+ -+ private static void ARGBtoRGBA(int[] src, byte[] dest) { -+ for (int i = 0; i < src.length; ++i) { -+ int v = src[i]; -+ dest[i * 4 + 3] = (byte)(v >> 24 & 255); -+ dest[i * 4 + 0] = (byte)(v >> 16 & 255); -+ dest[i * 4 + 1] = (byte)(v >> 8 & 255); -+ dest[i * 4 + 2] = (byte)(v >> 0 & 255); -+ } -+ } -+ -+ private static BufferedImage resizeImage(BufferedImage image, int width) { -+ if (width == image.getWidth()) { -+ return image; -+ } else { -+ int height = image.getHeight() * width / image.getWidth(); -+ logger.finer("resizing to %dx%d", new Object[] {Integer.valueOf(width), Integer.valueOf(height)}); -+ BufferedImage newImage = new BufferedImage(width, height, 2); -+ Graphics2D graphics2D = newImage.createGraphics(); -+ graphics2D.drawImage(image, 0, 0, width, height, (ImageObserver)null); -+ return newImage; -+ } -+ } -+ -+ private void loadProperties(Properties properties) { -+ this.loadTileOrder(properties); -+ int i; -+ -+ if (this.tileOrder == null) { -+ this.tileOrder = new int[this.numFrames]; -+ -+ for (i = 0; i < this.numFrames; ++i) { -+ this.tileOrder[i] = i % this.numTiles; -+ } -+ } -+ -+ this.tileDelay = new int[this.numFrames]; -+ this.loadTileDelay(properties); -+ -+ for (i = 0; i < this.numFrames; ++i) { -+ this.tileDelay[i] = Math.max(this.tileDelay[i], 1); -+ } -+ } -+ -+ private void loadTileOrder(Properties properties) { -+ if (properties != null) { -+ int i; -+ -+ for (i = 0; getIntValue(properties, "tile.", i) != null; ++i) { -+ ; -+ } -+ -+ if (i > 0) { -+ this.numFrames = i; -+ this.tileOrder = new int[this.numFrames]; -+ -+ for (i = 0; i < this.numFrames; ++i) { -+ this.tileOrder[i] = Math.abs(getIntValue(properties, "tile.", i).intValue()) % this.numTiles; -+ } -+ } -+ } -+ } -+ -+ private void loadTileDelay(Properties properties) { -+ if (properties != null) { -+ Integer defaultValue = getIntValue(properties, "duration"); -+ -+ for (int i = 0; i < this.numFrames; ++i) { -+ Integer value = getIntValue(properties, "duration.", i); -+ -+ if (value != null) { -+ this.tileDelay[i] = value.intValue(); -+ } else if (defaultValue != null) { -+ this.tileDelay[i] = defaultValue.intValue(); -+ } -+ } -+ } -+ } -+ -+ private static Integer getIntValue(Properties properties, String key) { -+ try { -+ String e = properties.getProperty(key); -+ -+ if (e != null && e.matches("^\\d+$")) { -+ return Integer.valueOf(Integer.parseInt(e)); -+ } -+ } catch (NumberFormatException var3) { -+ ; -+ } -+ -+ return null; -+ } -+ -+ private static Integer getIntValue(Properties properties, String prefix, int index) { -+ return getIntValue(properties, prefix + index); -+ } -+ -+ private void update(int texture, int dx, int dy) { -+ GL11.glTexSubImage2D(GL11.GL_TEXTURE_2D, this.mipmapLevel, this.x + dx, this.y + dy, this.w, this.h, GL11.GL_RGBA, GL11.GL_UNSIGNED_BYTE, (ByteBuffer)this.imageData.position(4 * this.w * this.h * this.tileOrder[this.currentFrame])); -+ } -+ -+ private int getDelay() { -+ return this.tileDelay[this.currentFrame]; -+ } -+ -+ static Map access$000() { -+ return pending; -+ } -+ -+ static MCLogger access$100() { -+ return logger; -+ } -+ -+ static List access$200() { -+ return animations; -+ } -+ -+ static boolean access$300() { -+ return enable; -+ } -+ -+ static { -+ TexturePackChangeHandler.register(new CustomAnimation$1("Extended HD", 1)); -+ } -+} ---- net/minecraft/src/BlockSponge.java -+++ net/minecraft/src/BlockSponge.java -@@ -1,8 +1,8 @@ - package net.minecraft.src; - - public class BlockSponge extends Block { -- protected BlockSponge(int var1) { -- super(var1, Material.sponge); -+ protected BlockSponge(int par1) { -+ super(par1, Material.sponge); - this.setCreativeTab(CreativeTabs.tabBlock); - } - } ---- net/minecraft/src/GuiShareToLan.java -+++ net/minecraft/src/GuiShareToLan.java -@@ -1,71 +1,90 @@ - package net.minecraft.src; - - public class GuiShareToLan extends GuiScreen { -+ -+ /** -+ * A reference to the screen object that created this. Used for navigating between screens. -+ */ - private final GuiScreen parentScreen; - private GuiButton buttonAllowCommandsToggle; - private GuiButton buttonGameMode; -- private String d = "survival"; -+ -+ /** -+ * The currently selected game mode. One of 'survival', 'creative', or 'adventure' -+ */ -+ private String gameMode = "survival"; -+ -+ /** True if 'Allow Cheats' is currently enabled */ - private boolean allowCommands; - -- public GuiShareToLan(GuiScreen var1) { -- this.parentScreen = var1; -+ public GuiShareToLan(GuiScreen par1GuiScreen) { -+ this.parentScreen = par1GuiScreen; - } - -+ /** -+ * Adds the buttons (and other controls) to the screen in question. -+ */ - public void initGui() { -- this.i.clear(); -- this.i.add(new GuiButton(101, this.width / 2 - 155, this.height - 28, 150, 20, I18n.getString("lanServer.start"))); -- this.i.add(new GuiButton(102, this.width / 2 + 5, this.height - 28, 150, 20, I18n.getString("gui.cancel"))); -- this.i.add(this.buttonGameMode = new GuiButton(104, this.width / 2 - 155, 100, 150, 20, I18n.getString("selectWorld.gameMode"))); -- this.i.add(this.buttonAllowCommandsToggle = new GuiButton(103, this.width / 2 + 5, 100, 150, 20, I18n.getString("selectWorld.allowCommands"))); -+ this.buttonList.clear(); -+ this.buttonList.add(new GuiButton(101, this.width / 2 - 155, this.height - 28, 150, 20, I18n.getString("lanServer.start"))); -+ this.buttonList.add(new GuiButton(102, this.width / 2 + 5, this.height - 28, 150, 20, I18n.getString("gui.cancel"))); -+ this.buttonList.add(this.buttonGameMode = new GuiButton(104, this.width / 2 - 155, 100, 150, 20, I18n.getString("selectWorld.gameMode"))); -+ this.buttonList.add(this.buttonAllowCommandsToggle = new GuiButton(103, this.width / 2 + 5, 100, 150, 20, I18n.getString("selectWorld.allowCommands"))); - this.func_74088_g(); - } - - private void func_74088_g() { -- this.buttonGameMode.f = I18n.getString("selectWorld.gameMode") + " " + I18n.getString("selectWorld.gameMode." + this.d); -- this.buttonAllowCommandsToggle.f = I18n.getString("selectWorld.allowCommands") + " "; -- if(this.allowCommands) { -- this.buttonAllowCommandsToggle.f = this.buttonAllowCommandsToggle.f + I18n.getString("options.on"); -+ this.buttonGameMode.displayString = I18n.getString("selectWorld.gameMode") + " " + I18n.getString("selectWorld.gameMode." + this.gameMode); -+ this.buttonAllowCommandsToggle.displayString = I18n.getString("selectWorld.allowCommands") + " "; -+ -+ if (this.allowCommands) { -+ this.buttonAllowCommandsToggle.displayString = this.buttonAllowCommandsToggle.displayString + I18n.getString("options.on"); - } else { -- this.buttonAllowCommandsToggle.f = this.buttonAllowCommandsToggle.f + I18n.getString("options.off"); -+ this.buttonAllowCommandsToggle.displayString = this.buttonAllowCommandsToggle.displayString + I18n.getString("options.off"); - } -- - } - -- protected void actionPerformed(GuiButton var1) { -- if(var1.id == 102) { -+ /** -+ * Fired when a control is clicked. This is the equivalent of ActionListener.actionPerformed(ActionEvent e). -+ */ -+ protected void actionPerformed(GuiButton par1GuiButton) { -+ if (par1GuiButton.id == 102) { - this.mc.displayGuiScreen(this.parentScreen); -- } else if(var1.id == 104) { -- if(this.d.equals("survival")) { -- this.d = "creative"; -- } else if(this.d.equals("creative")) { -- this.d = "adventure"; -+ } else if (par1GuiButton.id == 104) { -+ if (this.gameMode.equals("survival")) { -+ this.gameMode = "creative"; -+ } else if (this.gameMode.equals("creative")) { -+ this.gameMode = "adventure"; - } else { -- this.d = "survival"; -+ this.gameMode = "survival"; - } - - this.func_74088_g(); -- } else if(var1.id == 103) { -+ } else if (par1GuiButton.id == 103) { - this.allowCommands = !this.allowCommands; - this.func_74088_g(); -- } else if(var1.id == 101) { -+ } else if (par1GuiButton.id == 101) { - this.mc.displayGuiScreen((GuiScreen)null); -- String var2 = this.mc.getIntegratedServer().shareToLAN(EnumGameType.getByName(this.d), this.allowCommands); -+ String var2 = this.mc.getIntegratedServer().shareToLAN(EnumGameType.getByName(this.gameMode), this.allowCommands); - ChatMessageComponent var3; -- if(var2 != null) { -- var3 = ChatMessageComponent.createFromTranslationWithSubstitutions("commands.publish.started", new Object[]{var2}); -+ -+ if (var2 != null) { -+ var3 = ChatMessageComponent.createFromTranslationWithSubstitutions("commands.publish.started", new Object[] {var2}); - } else { - var3 = ChatMessageComponent.createFromText("commands.publish.failed"); - } - - this.mc.ingameGUI.getChatGUI().printChatMessage(var3.toStringWithFormatting(true)); - } -- - } - -- public void drawScreen(int var1, int var2, float var3) { -+ /** -+ * Draws the screen and all the components in it. -+ */ -+ public void drawScreen(int par1, int par2, float par3) { - this.drawDefaultBackground(); - this.drawCenteredString(this.fontRenderer, I18n.getString("lanServer.title"), this.width / 2, 50, 16777215); - this.drawCenteredString(this.fontRenderer, I18n.getString("lanServer.otherPlayers"), this.width / 2, 82, 16777215); -- super.drawScreen(var1, var2, var3); -+ super.drawScreen(par1, par2, par3); - } - } ---- net/minecraft/src/NBTTagByteArray.java -+++ net/minecraft/src/NBTTagByteArray.java -@@ -6,28 +6,39 @@ - import java.util.Arrays; - - public class NBTTagByteArray extends NBTBase { -+ -+ /** The byte array stored in the tag. */ - public byte[] byteArray; - -- public NBTTagByteArray(String var1) { -- super(var1); -- } -- -- public NBTTagByteArray(String var1, byte[] var2) { -- super(var1); -- this.byteArray = var2; -- } -- -- void write(DataOutput var1) throws IOException { -- var1.writeInt(this.byteArray.length); -- var1.write(this.byteArray); -- } -- -- void load(DataInput var1, int var2) throws IOException { -- int var3 = var1.readInt(); -+ public NBTTagByteArray(String par1Str) { -+ super(par1Str); -+ } -+ -+ public NBTTagByteArray(String par1Str, byte[] par2ArrayOfByte) { -+ super(par1Str); -+ this.byteArray = par2ArrayOfByte; -+ } -+ -+ /** -+ * Write the actual data contents of the tag, implemented in NBT extension classes -+ */ -+ void write(DataOutput par1DataOutput) throws IOException { -+ par1DataOutput.writeInt(this.byteArray.length); -+ par1DataOutput.write(this.byteArray); -+ } -+ -+ /** -+ * Read the actual data contents of the tag, implemented in NBT extension classes -+ */ -+ void load(DataInput par1DataInput, int par2) throws IOException { -+ int var3 = par1DataInput.readInt(); - this.byteArray = new byte[var3]; -- var1.readFully(this.byteArray); -+ par1DataInput.readFully(this.byteArray); - } - -+ /** -+ * Gets the type byte for the tag. -+ */ - public byte getId() { - return (byte)7; - } -@@ -36,14 +47,17 @@ - return "[" + this.byteArray.length + " bytes]"; - } - -+ /** -+ * Creates a clone of the tag. -+ */ - public NBTBase copy() { - byte[] var1 = new byte[this.byteArray.length]; - System.arraycopy(this.byteArray, 0, var1, 0, this.byteArray.length); - return new NBTTagByteArray(this.getName(), var1); - } - -- public boolean equals(Object var1) { -- return super.equals(var1) ? Arrays.equals(this.byteArray, ((NBTTagByteArray)var1).byteArray) : false; -+ public boolean equals(Object par1Obj) { -+ return super.equals(par1Obj) ? Arrays.equals(this.byteArray, ((NBTTagByteArray)par1Obj).byteArray) : false; - } - - public int hashCode() { ---- net/minecraft/src/EntityLookHelper.java -+++ net/minecraft/src/EntityLookHelper.java -@@ -2,50 +2,71 @@ - - public class EntityLookHelper { - private EntityLiving entity; -+ -+ /** -+ * The amount of change that is made each update for an entity facing a direction. -+ */ - private float deltaLookYaw; -+ -+ /** -+ * The amount of change that is made each update for an entity facing a direction. -+ */ - private float deltaLookPitch; -+ -+ /** Whether or not the entity is trying to look at something. */ - private boolean isLooking; - private double posX; - private double posY; - private double posZ; - -- public EntityLookHelper(EntityLiving var1) { -- this.entity = var1; -+ public EntityLookHelper(EntityLiving par1EntityLiving) { -+ this.entity = par1EntityLiving; - } - -- public void setLookPositionWithEntity(Entity var1, float var2, float var3) { -- this.posX = var1.posX; -- if(var1 instanceof EntityLivingBase) { -- this.posY = var1.posY + (double)var1.getEyeHeight(); -+ /** -+ * Sets position to look at using entity -+ */ -+ public void setLookPositionWithEntity(Entity par1Entity, float par2, float par3) { -+ this.posX = par1Entity.posX; -+ -+ if (par1Entity instanceof EntityLivingBase) { -+ this.posY = par1Entity.posY + (double)par1Entity.getEyeHeight(); - } else { -- this.posY = (var1.boundingBox.minY + var1.boundingBox.maxY) / 2.0D; -+ this.posY = (par1Entity.boundingBox.minY + par1Entity.boundingBox.maxY) / 2.0D; - } - -- this.posZ = var1.posZ; -- this.deltaLookYaw = var2; -- this.deltaLookPitch = var3; -- this.isLooking = true; -- } -- -- public void setLookPosition(double var1, double var3, double var5, float var7, float var8) { -- this.posX = var1; -- this.posY = var3; -- this.posZ = var5; -- this.deltaLookYaw = var7; -- this.deltaLookPitch = var8; -- this.isLooking = true; -- } -- -+ this.posZ = par1Entity.posZ; -+ this.deltaLookYaw = par2; -+ this.deltaLookPitch = par3; -+ this.isLooking = true; -+ } -+ -+ /** -+ * Sets position to look at -+ */ -+ public void setLookPosition(double par1, double par3, double par5, float par7, float par8) { -+ this.posX = par1; -+ this.posY = par3; -+ this.posZ = par5; -+ this.deltaLookYaw = par7; -+ this.deltaLookPitch = par8; -+ this.isLooking = true; -+ } -+ -+ /** -+ * Updates look -+ */ - public void onUpdateLook() { - this.entity.rotationPitch = 0.0F; -- if(this.isLooking) { -+ -+ if (this.isLooking) { - this.isLooking = false; - double var1 = this.posX - this.entity.posX; - double var3 = this.posY - (this.entity.posY + (double)this.entity.getEyeHeight()); - double var5 = this.posZ - this.entity.posZ; - double var7 = (double)MathHelper.sqrt_double(var1 * var1 + var5 * var5); -- float var9 = (float)(Math.atan2(var5, var1) * 180.0D / (double)((float)Math.PI)) - 90.0F; -- float var10 = (float)(-(Math.atan2(var3, var7) * 180.0D / (double)((float)Math.PI))); -+ float var9 = (float)(Math.atan2(var5, var1) * 180.0D / Math.PI) - 90.0F; -+ float var10 = (float)(-(Math.atan2(var3, var7) * 180.0D / Math.PI)); - this.entity.rotationPitch = this.updateRotation(this.entity.rotationPitch, var10, this.deltaLookPitch); - this.entity.rotationYawHead = this.updateRotation(this.entity.rotationYawHead, var9, this.deltaLookYaw); - } else { -@@ -53,28 +74,29 @@ - } - - float var11 = MathHelper.wrapAngleTo180_float(this.entity.rotationYawHead - this.entity.renderYawOffset); -- if(!this.entity.getNavigator().noPath()) { -- if(var11 < -75.0F) { -+ -+ if (!this.entity.getNavigator().noPath()) { -+ if (var11 < -75.0F) { - this.entity.rotationYawHead = this.entity.renderYawOffset - 75.0F; - } - -- if(var11 > 75.0F) { -+ if (var11 > 75.0F) { - this.entity.rotationYawHead = this.entity.renderYawOffset + 75.0F; - } - } -- - } - -- private float updateRotation(float var1, float var2, float var3) { -- float var4 = MathHelper.wrapAngleTo180_float(var2 - var1); -- if(var4 > var3) { -- var4 = var3; -- } -- -- if(var4 < -var3) { -- var4 = -var3; -- } -- -- return var1 + var4; -+ private float updateRotation(float par1, float par2, float par3) { -+ float var4 = MathHelper.wrapAngleTo180_float(par2 - par1); -+ -+ if (var4 > par3) { -+ var4 = par3; -+ } -+ -+ if (var4 < -par3) { -+ var4 = -par3; -+ } -+ -+ return par1 + var4; - } - } ---- net/minecraft/src/GuiScreenAddServer.java -+++ net/minecraft/src/GuiScreenAddServer.java -@@ -3,84 +3,109 @@ - import org.lwjgl.input.Keyboard; - - public class GuiScreenAddServer extends GuiScreen { -+ -+ /** This GUI's parent GUI. */ - private GuiScreen parentGui; - private GuiTextField serverAddress; - private GuiTextField serverName; -+ -+ /** ServerData to be modified by this GUI */ - private ServerData newServerData; - -- public GuiScreenAddServer(GuiScreen var1, ServerData var2) { -- this.parentGui = var1; -- this.newServerData = var2; -+ public GuiScreenAddServer(GuiScreen par1GuiScreen, ServerData par2ServerData) { -+ this.parentGui = par1GuiScreen; -+ this.newServerData = par2ServerData; - } - -+ /** -+ * Called from the main game loop to update the screen. -+ */ - public void updateScreen() { - this.serverName.updateCursorCounter(); - this.serverAddress.updateCursorCounter(); - } - -+ /** -+ * Adds the buttons (and other controls) to the screen in question. -+ */ - public void initGui() { - Keyboard.enableRepeatEvents(true); -- this.i.clear(); -- this.i.add(new GuiButton(0, this.width / 2 - 100, this.height / 4 + 96 + 12, I18n.getString("addServer.add"))); -- this.i.add(new GuiButton(1, this.width / 2 - 100, this.height / 4 + 120 + 12, I18n.getString("gui.cancel"))); -- this.i.add(new GuiButton(2, this.width / 2 - 100, 142, I18n.getString("addServer.hideAddress") + ": " + (this.newServerData.isHidingAddress() ? I18n.getString("gui.yes") : I18n.getString("gui.no")))); -+ this.buttonList.clear(); -+ this.buttonList.add(new GuiButton(0, this.width / 2 - 100, this.height / 4 + 96 + 12, I18n.getString("addServer.add"))); -+ this.buttonList.add(new GuiButton(1, this.width / 2 - 100, this.height / 4 + 120 + 12, I18n.getString("gui.cancel"))); -+ this.buttonList.add(new GuiButton(2, this.width / 2 - 100, 142, I18n.getString("addServer.hideAddress") + ": " + (this.newServerData.isHidingAddress() ? I18n.getString("gui.yes") : I18n.getString("gui.no")))); - this.serverName = new GuiTextField(this.fontRenderer, this.width / 2 - 100, 66, 200, 20); - this.serverName.setFocused(true); -- this.serverName.setText(this.newServerData.a); -+ this.serverName.setText(this.newServerData.serverName); - this.serverAddress = new GuiTextField(this.fontRenderer, this.width / 2 - 100, 106, 200, 20); - this.serverAddress.setMaxStringLength(128); -- this.serverAddress.setText(this.newServerData.b); -- ((GuiButton)this.i.get(0)).enabled = this.serverAddress.getText().length() > 0 && this.serverAddress.getText().split(":").length > 0 && this.serverName.getText().length() > 0; -+ this.serverAddress.setText(this.newServerData.serverIP); -+ ((GuiButton)this.buttonList.get(0)).enabled = this.serverAddress.getText().length() > 0 && this.serverAddress.getText().split(":").length > 0 && this.serverName.getText().length() > 0; - } - -+ /** -+ * Called when the screen is unloaded. Used to disable keyboard repeat events -+ */ - public void onGuiClosed() { - Keyboard.enableRepeatEvents(false); - } - -- protected void actionPerformed(GuiButton var1) { -- if(var1.enabled) { -- if(var1.id == 1) { -+ /** -+ * Fired when a control is clicked. This is the equivalent of ActionListener.actionPerformed(ActionEvent e). -+ */ -+ protected void actionPerformed(GuiButton par1GuiButton) { -+ if (par1GuiButton.enabled) { -+ if (par1GuiButton.id == 1) { - this.parentGui.confirmClicked(false, 0); -- } else if(var1.id == 0) { -- this.newServerData.a = this.serverName.getText(); -- this.newServerData.b = this.serverAddress.getText(); -+ } else if (par1GuiButton.id == 0) { -+ this.newServerData.serverName = this.serverName.getText(); -+ this.newServerData.serverIP = this.serverAddress.getText(); - this.parentGui.confirmClicked(true, 0); -- } else if(var1.id == 2) { -+ } else if (par1GuiButton.id == 2) { - this.newServerData.setHideAddress(!this.newServerData.isHidingAddress()); -- ((GuiButton)this.i.get(2)).f = I18n.getString("addServer.hideAddress") + ": " + (this.newServerData.isHidingAddress() ? I18n.getString("gui.yes") : I18n.getString("gui.no")); -+ ((GuiButton)this.buttonList.get(2)).displayString = I18n.getString("addServer.hideAddress") + ": " + (this.newServerData.isHidingAddress() ? I18n.getString("gui.yes") : I18n.getString("gui.no")); - } -- - } - } - -- protected void keyTyped(char var1, int var2) { -- this.serverName.textboxKeyTyped(var1, var2); -- this.serverAddress.textboxKeyTyped(var1, var2); -- if(var2 == 15) { -+ /** -+ * Fired when a key is typed. This is the equivalent of KeyListener.keyTyped(KeyEvent e). -+ */ -+ protected void keyTyped(char par1, int par2) { -+ this.serverName.textboxKeyTyped(par1, par2); -+ this.serverAddress.textboxKeyTyped(par1, par2); -+ -+ if (par2 == 15) { - this.serverName.setFocused(!this.serverName.isFocused()); - this.serverAddress.setFocused(!this.serverAddress.isFocused()); - } - -- if(var2 == 28 || var2 == 156) { -- this.actionPerformed((GuiButton)this.i.get(0)); -+ if (par2 == 28 || par2 == 156) { -+ this.actionPerformed((GuiButton)this.buttonList.get(0)); - } - -- ((GuiButton)this.i.get(0)).enabled = this.serverAddress.getText().length() > 0 && this.serverAddress.getText().split(":").length > 0 && this.serverName.getText().length() > 0; -- } -- -- protected void mouseClicked(int var1, int var2, int var3) { -- super.mouseClicked(var1, var2, var3); -- this.serverAddress.mouseClicked(var1, var2, var3); -- this.serverName.mouseClicked(var1, var2, var3); -- } -- -- public void drawScreen(int var1, int var2, float var3) { -+ ((GuiButton)this.buttonList.get(0)).enabled = this.serverAddress.getText().length() > 0 && this.serverAddress.getText().split(":").length > 0 && this.serverName.getText().length() > 0; -+ } -+ -+ /** -+ * Called when the mouse is clicked. -+ */ -+ protected void mouseClicked(int par1, int par2, int par3) { -+ super.mouseClicked(par1, par2, par3); -+ this.serverAddress.mouseClicked(par1, par2, par3); -+ this.serverName.mouseClicked(par1, par2, par3); -+ } -+ -+ /** -+ * Draws the screen and all the components in it. -+ */ -+ public void drawScreen(int par1, int par2, float par3) { - this.drawDefaultBackground(); - this.drawCenteredString(this.fontRenderer, I18n.getString("addServer.title"), this.width / 2, 17, 16777215); - this.drawString(this.fontRenderer, I18n.getString("addServer.enterName"), this.width / 2 - 100, 53, 10526880); - this.drawString(this.fontRenderer, I18n.getString("addServer.enterIp"), this.width / 2 - 100, 94, 10526880); - this.serverName.drawTextBox(); - this.serverAddress.drawTextBox(); -- super.drawScreen(var1, var2, var3); -+ super.drawScreen(par1, par2, par3); - } - } ---- net/minecraft/src/SpawnerAnimals.java -+++ net/minecraft/src/SpawnerAnimals.java -@@ -1,134 +1,152 @@ - package net.minecraft.src; - --import java.util.Collection; - import java.util.HashMap; - import java.util.Iterator; - import java.util.List; - import java.util.Random; - - public final class SpawnerAnimals { -- private HashMap a = new HashMap(); -- -- protected static ChunkPosition getRandomSpawningPointInChunk(World var0, int var1, int var2) { -- Chunk var3 = var0.getChunkFromChunkCoords(var1, var2); -- int var4 = var1 * 16 + var0.s.nextInt(16); -- int var5 = var2 * 16 + var0.s.nextInt(16); -- int var6 = var0.s.nextInt(var3 == null ? var0.getActualHeight() : var3.getTopFilledSegment() + 16 - 1); -+ -+ /** The 17x17 area around the player where mobs can spawn */ -+ private HashMap eligibleChunksForSpawning = new HashMap(); -+ -+ /** -+ * Given a chunk, find a random position in it. -+ */ -+ protected static ChunkPosition getRandomSpawningPointInChunk(World par0World, int par1, int par2) { -+ Chunk var3 = par0World.getChunkFromChunkCoords(par1, par2); -+ int var4 = par1 * 16 + par0World.rand.nextInt(16); -+ int var5 = par2 * 16 + par0World.rand.nextInt(16); -+ int var6 = par0World.rand.nextInt(var3 == null ? par0World.getActualHeight() : var3.getTopFilledSegment() + 16 - 1); - return new ChunkPosition(var4, var6, var5); - } - -- public int findChunksForSpawning(WorldServer var1, boolean var2, boolean var3, boolean var4) { -- if(!var2 && !var3) { -+ /** -+ * adds all chunks within the spawn radius of the players to eligibleChunksForSpawning. pars: the world, -+ * hostileCreatures, passiveCreatures. returns number of eligible chunks. -+ */ -+ public int findChunksForSpawning(WorldServer par1WorldServer, boolean par2, boolean par3, boolean par4) { -+ if (!par2 && !par3) { - return 0; - } else { -- this.a.clear(); -- -+ this.eligibleChunksForSpawning.clear(); - int var5; - int var8; -- for(var5 = 0; var5 < var1.h.size(); ++var5) { -- EntityPlayer var6 = (EntityPlayer)var1.h.get(var5); -+ -+ for (var5 = 0; var5 < par1WorldServer.playerEntities.size(); ++var5) { -+ EntityPlayer var6 = (EntityPlayer)par1WorldServer.playerEntities.get(var5); - int var7 = MathHelper.floor_double(var6.posX / 16.0D); - var8 = MathHelper.floor_double(var6.posZ / 16.0D); - byte var9 = 8; - -- for(int var10 = -var9; var10 <= var9; ++var10) { -- for(int var11 = -var9; var11 <= var9; ++var11) { -+ for (int var10 = -var9; var10 <= var9; ++var10) { -+ for (int var11 = -var9; var11 <= var9; ++var11) { - boolean var12 = var10 == -var9 || var10 == var9 || var11 == -var9 || var11 == var9; - ChunkCoordIntPair var13 = new ChunkCoordIntPair(var10 + var7, var11 + var8); -- if(!var12) { -- this.a.put(var13, Boolean.valueOf(false)); -- } else if(!this.a.containsKey(var13)) { -- this.a.put(var13, Boolean.valueOf(true)); -+ -+ if (!var12) { -+ this.eligibleChunksForSpawning.put(var13, Boolean.valueOf(false)); -+ } else if (!this.eligibleChunksForSpawning.containsKey(var13)) { -+ this.eligibleChunksForSpawning.put(var13, Boolean.valueOf(true)); - } - } - } - } - - var5 = 0; -- ChunkCoordinates var34 = var1.getSpawnPoint(); -+ ChunkCoordinates var34 = par1WorldServer.getSpawnPoint(); - EnumCreatureType[] var35 = EnumCreatureType.values(); - var8 = var35.length; - -- label131: -- for(int var36 = 0; var36 < var8; ++var36) { -+ for (int var36 = 0; var36 < var8; ++var36) { - EnumCreatureType var37 = var35[var36]; -- if((!var37.getPeacefulCreature() || var3) && (var37.getPeacefulCreature() || var2) && (!var37.getAnimal() || var4) && var1.countEntities(var37.getCreatureClass()) <= var37.getMaxNumberOfCreature() * this.a.size() / 256) { -- Iterator var38 = this.a.keySet().iterator(); -- -- label128: -- while(true) { -- int var14; -- int var15; -- int var16; -- do { -- do { -- ChunkCoordIntPair var39; -- do { -- if(!var38.hasNext()) { -- continue label131; -- } -- -- var39 = (ChunkCoordIntPair)var38.next(); -- } while(((Boolean)this.a.get(var39)).booleanValue()); -- -- ChunkPosition var40 = getRandomSpawningPointInChunk(var1, var39.chunkXPos, var39.chunkZPos); -- var14 = var40.x; -- var15 = var40.y; -- var16 = var40.z; -- } while(var1.isBlockNormalCube(var14, var15, var16)); -- } while(var1.getBlockMaterial(var14, var15, var16) != var37.getCreatureMaterial()); -- -- int var17 = 0; -- -- for(int var18 = 0; var18 < 3; ++var18) { -- int var19 = var14; -- int var20 = var15; -- int var21 = var16; -- byte var22 = 6; -- SpawnListEntry var23 = null; -- EntityLivingData var24 = null; -- -- for(int var25 = 0; var25 < 4; ++var25) { -- var19 += var1.s.nextInt(var22) - var1.s.nextInt(var22); -- var20 += var1.s.nextInt(1) - var1.s.nextInt(1); -- var21 += var1.s.nextInt(var22) - var1.s.nextInt(var22); -- if(canCreatureTypeSpawnAtLocation(var37, var1, var19, var20, var21)) { -- float var26 = (float)var19 + 0.5F; -- float var27 = (float)var20; -- float var28 = (float)var21 + 0.5F; -- if(var1.getClosestPlayer((double)var26, (double)var27, (double)var28, 24.0D) == null) { -- float var29 = var26 - (float)var34.posX; -- float var30 = var27 - (float)var34.posY; -- float var31 = var28 - (float)var34.posZ; -- float var32 = var29 * var29 + var30 * var30 + var31 * var31; -- if(var32 >= 576.0F) { -- if(var23 == null) { -- var23 = var1.spawnRandomCreature(var37, var19, var20, var21); -- if(var23 == null) { -- break; -- } -- } -- -- EntityLiving var41; -- try { -- var41 = (EntityLiving)var23.b.getConstructor(new Class[]{World.class}).newInstance(new Object[]{var1}); -- } catch (Exception var33) { -- var33.printStackTrace(); -- return var5; -- } -- -- var41.setLocationAndAngles((double)var26, (double)var27, (double)var28, var1.s.nextFloat() * 360.0F, 0.0F); -- if(var41.getCanSpawnHere()) { -- ++var17; -- var1.spawnEntityInWorld(var41); -- var24 = var41.onSpawnWithEgg(var24); -- if(var17 >= var41.getMaxSpawnedInChunk()) { -- continue label128; -- } -- } -- -- var5 += var17; -+ -+ if ((!var37.getPeacefulCreature() || par3) && (var37.getPeacefulCreature() || par2) && (!var37.getAnimal() || par4) && par1WorldServer.countEntities(var37.getCreatureClass()) <= var37.getMaxNumberOfCreature() * this.eligibleChunksForSpawning.size() / 256) { -+ Iterator var38 = this.eligibleChunksForSpawning.keySet().iterator(); -+ label110: -+ -+ while (var38.hasNext()) { -+ ChunkCoordIntPair var39 = (ChunkCoordIntPair)var38.next(); -+ -+ if (!((Boolean)this.eligibleChunksForSpawning.get(var39)).booleanValue()) { -+ ChunkPosition var40 = getRandomSpawningPointInChunk(par1WorldServer, var39.chunkXPos, var39.chunkZPos); -+ int var14 = var40.x; -+ int var15 = var40.y; -+ int var16 = var40.z; -+ -+ if (!par1WorldServer.isBlockNormalCube(var14, var15, var16) && par1WorldServer.getBlockMaterial(var14, var15, var16) == var37.getCreatureMaterial()) { -+ int var17 = 0; -+ int var18 = 0; -+ -+ while (var18 < 3) { -+ int var19 = var14; -+ int var20 = var15; -+ int var21 = var16; -+ byte var22 = 6; -+ SpawnListEntry var23 = null; -+ EntityLivingData var24 = null; -+ int var25 = 0; -+ -+ while (true) { -+ if (var25 < 4) { -+ label103: { -+ var19 += par1WorldServer.rand.nextInt(var22) - par1WorldServer.rand.nextInt(var22); -+ var20 += par1WorldServer.rand.nextInt(1) - par1WorldServer.rand.nextInt(1); -+ var21 += par1WorldServer.rand.nextInt(var22) - par1WorldServer.rand.nextInt(var22); -+ -+ if (canCreatureTypeSpawnAtLocation(var37, par1WorldServer, var19, var20, var21)) { -+ float var26 = (float)var19 + 0.5F; -+ float var27 = (float)var20; -+ float var28 = (float)var21 + 0.5F; -+ -+ if (par1WorldServer.getClosestPlayer((double)var26, (double)var27, (double)var28, 24.0D) == null) { -+ float var29 = var26 - (float)var34.posX; -+ float var30 = var27 - (float)var34.posY; -+ float var31 = var28 - (float)var34.posZ; -+ float var32 = var29 * var29 + var30 * var30 + var31 * var31; -+ -+ if (var32 >= 576.0F) { -+ if (var23 == null) { -+ var23 = par1WorldServer.spawnRandomCreature(var37, var19, var20, var21); -+ -+ if (var23 == null) { -+ break label103; -+ } -+ } -+ -+ EntityLiving var41; -+ -+ try { -+ var41 = (EntityLiving)var23.entityClass.getConstructor(new Class[] {World.class}).newInstance(new Object[] {par1WorldServer}); -+ } catch (Exception var33) { -+ var33.printStackTrace(); -+ return var5; -+ } -+ -+ var41.setLocationAndAngles((double)var26, (double)var27, (double)var28, par1WorldServer.rand.nextFloat() * 360.0F, 0.0F); -+ -+ if (var41.getCanSpawnHere()) { -+ ++var17; -+ par1WorldServer.spawnEntityInWorld(var41); -+ var24 = var41.onSpawnWithEgg(var24); -+ -+ if (var17 >= var41.getMaxSpawnedInChunk()) { -+ continue label110; -+ } -+ } -+ -+ var5 += var17; -+ } -+ } -+ } -+ -+ ++var25; -+ continue; -+ } - } -+ -+ ++var18; -+ break; - } - } - } -@@ -141,62 +159,69 @@ - } - } - -- public static boolean canCreatureTypeSpawnAtLocation(EnumCreatureType var0, World var1, int var2, int var3, int var4) { -- if(var0.getCreatureMaterial() == Material.water) { -- return var1.getBlockMaterial(var2, var3, var4).isLiquid() && var1.getBlockMaterial(var2, var3 - 1, var4).isLiquid() && !var1.isBlockNormalCube(var2, var3 + 1, var4); -- } else if(!var1.doesBlockHaveSolidTopSurface(var2, var3 - 1, var4)) { -+ /** -+ * Returns whether or not the specified creature type can spawn at the specified location. -+ */ -+ public static boolean canCreatureTypeSpawnAtLocation(EnumCreatureType par0EnumCreatureType, World par1World, int par2, int par3, int par4) { -+ if (par0EnumCreatureType.getCreatureMaterial() == Material.water) { -+ return par1World.getBlockMaterial(par2, par3, par4).isLiquid() && par1World.getBlockMaterial(par2, par3 - 1, par4).isLiquid() && !par1World.isBlockNormalCube(par2, par3 + 1, par4); -+ } else if (!par1World.doesBlockHaveSolidTopSurface(par2, par3 - 1, par4)) { - return false; - } else { -- int var5 = var1.getBlockId(var2, var3 - 1, var4); -- return var5 != Block.bedrock.blockID && !var1.isBlockNormalCube(var2, var3, var4) && !var1.getBlockMaterial(var2, var3, var4).isLiquid() && !var1.isBlockNormalCube(var2, var3 + 1, var4); -+ int var5 = par1World.getBlockId(par2, par3 - 1, par4); -+ return var5 != Block.bedrock.blockID && !par1World.isBlockNormalCube(par2, par3, par4) && !par1World.getBlockMaterial(par2, par3, par4).isLiquid() && !par1World.isBlockNormalCube(par2, par3 + 1, par4); - } - } - -- public static void performWorldGenSpawning(World var0, BiomeGenBase var1, int var2, int var3, int var4, int var5, Random var6) { -- List var7 = var1.getSpawnableList(EnumCreatureType.creature); -- if(!var7.isEmpty()) { -- while(var6.nextFloat() < var1.getSpawningChance()) { -- SpawnListEntry var8 = (SpawnListEntry)WeightedRandom.getRandomItem(var0.s, (Collection)var7); -+ /** -+ * Called during chunk generation to spawn initial creatures. -+ */ -+ public static void performWorldGenSpawning(World par0World, BiomeGenBase par1BiomeGenBase, int par2, int par3, int par4, int par5, Random par6Random) { -+ List var7 = par1BiomeGenBase.getSpawnableList(EnumCreatureType.creature); -+ -+ if (!var7.isEmpty()) { -+ while (par6Random.nextFloat() < par1BiomeGenBase.getSpawningChance()) { -+ SpawnListEntry var8 = (SpawnListEntry)WeightedRandom.getRandomItem(par0World.rand, var7); - EntityLivingData var9 = null; -- int var10 = var8.minGroupCount + var6.nextInt(1 + var8.maxGroupCount - var8.minGroupCount); -- int var11 = var2 + var6.nextInt(var4); -- int var12 = var3 + var6.nextInt(var5); -+ int var10 = var8.minGroupCount + par6Random.nextInt(1 + var8.maxGroupCount - var8.minGroupCount); -+ int var11 = par2 + par6Random.nextInt(par4); -+ int var12 = par3 + par6Random.nextInt(par5); - int var13 = var11; - int var14 = var12; - -- for(int var15 = 0; var15 < var10; ++var15) { -+ for (int var15 = 0; var15 < var10; ++var15) { - boolean var16 = false; - -- for(int var17 = 0; !var16 && var17 < 4; ++var17) { -- int var18 = var0.getTopSolidOrLiquidBlock(var11, var12); -- if(canCreatureTypeSpawnAtLocation(EnumCreatureType.creature, var0, var11, var18, var12)) { -+ for (int var17 = 0; !var16 && var17 < 4; ++var17) { -+ int var18 = par0World.getTopSolidOrLiquidBlock(var11, var12); -+ -+ if (canCreatureTypeSpawnAtLocation(EnumCreatureType.creature, par0World, var11, var18, var12)) { - float var19 = (float)var11 + 0.5F; - float var20 = (float)var18; - float var21 = (float)var12 + 0.5F; -- - EntityLiving var22; -+ - try { -- var22 = (EntityLiving)var8.b.getConstructor(new Class[]{World.class}).newInstance(new Object[]{var0}); -+ var22 = (EntityLiving)var8.entityClass.getConstructor(new Class[] {World.class}).newInstance(new Object[] {par0World}); - } catch (Exception var24) { - var24.printStackTrace(); - continue; - } - -- var22.setLocationAndAngles((double)var19, (double)var20, (double)var21, var6.nextFloat() * 360.0F, 0.0F); -- var0.spawnEntityInWorld(var22); -+ var22.setLocationAndAngles((double)var19, (double)var20, (double)var21, par6Random.nextFloat() * 360.0F, 0.0F); -+ par0World.spawnEntityInWorld(var22); - var9 = var22.onSpawnWithEgg(var9); - var16 = true; - } - -- var11 += var6.nextInt(5) - var6.nextInt(5); -+ var11 += par6Random.nextInt(5) - par6Random.nextInt(5); - -- for(var12 += var6.nextInt(5) - var6.nextInt(5); var11 < var2 || var11 >= var2 + var4 || var12 < var3 || var12 >= var3 + var4; var12 = var14 + var6.nextInt(5) - var6.nextInt(5)) { -- var11 = var13 + var6.nextInt(5) - var6.nextInt(5); -+ for (var12 += par6Random.nextInt(5) - par6Random.nextInt(5); var11 < par2 || var11 >= par2 + par4 || var12 < par3 || var12 >= par3 + par4; var12 = var14 + par6Random.nextInt(5) - par6Random.nextInt(5)) { -+ var11 = var13 + par6Random.nextInt(5) - par6Random.nextInt(5); - } - } - } - } -- - } - } - } ---- net/minecraft/src/EnchantmentWaterWorker.java -+++ net/minecraft/src/EnchantmentWaterWorker.java -@@ -1,19 +1,28 @@ - package net.minecraft.src; - - public class EnchantmentWaterWorker extends Enchantment { -- public EnchantmentWaterWorker(int var1, int var2) { -- super(var1, var2, EnumEnchantmentType.armor_head); -+ public EnchantmentWaterWorker(int par1, int par2) { -+ super(par1, par2, EnumEnchantmentType.armor_head); - this.setName("waterWorker"); - } - -- public int getMinEnchantability(int var1) { -+ /** -+ * Returns the minimal value of enchantability needed on the enchantment level passed. -+ */ -+ public int getMinEnchantability(int par1) { - return 1; - } - -- public int getMaxEnchantability(int var1) { -- return this.getMinEnchantability(var1) + 40; -+ /** -+ * Returns the maximum value of enchantability nedded on the enchantment level passed. -+ */ -+ public int getMaxEnchantability(int par1) { -+ return this.getMinEnchantability(par1) + 40; - } - -+ /** -+ * Returns the maximum level that the enchantment can have. -+ */ - public int getMaxLevel() { - return 1; - } ---- net/minecraft/src/ModelZombie.java -+++ net/minecraft/src/ModelZombie.java -@@ -5,29 +5,34 @@ - this(0.0F, false); - } - -- protected ModelZombie(float var1, float var2, int var3, int var4) { -- super(var1, var2, var3, var4); -- } -- -- public ModelZombie(float var1, boolean var2) { -- super(var1, 0.0F, 64, var2 ? 32 : 64); -- } -- -- public void setRotationAngles(float var1, float var2, float var3, float var4, float var5, float var6, Entity var7) { -- super.setRotationAngles(var1, var2, var3, var4, var5, var6, var7); -+ protected ModelZombie(float par1, float par2, int par3, int par4) { -+ super(par1, par2, par3, par4); -+ } -+ -+ public ModelZombie(float par1, boolean par2) { -+ super(par1, 0.0F, 64, par2 ? 32 : 64); -+ } -+ -+ /** -+ * Sets the model's various rotation angles. For bipeds, par1 and par2 are used for animating the movement of arms and -+ * legs, where par1 represents the time(so that arms and legs swing back and forth) and par2 represents how "far" arms -+ * and legs can swing at most. -+ */ -+ public void setRotationAngles(float par1, float par2, float par3, float par4, float par5, float par6, Entity par7Entity) { -+ super.setRotationAngles(par1, par2, par3, par4, par5, par6, par7Entity); - float var8 = MathHelper.sin(this.onGround * (float)Math.PI); - float var9 = MathHelper.sin((1.0F - (1.0F - this.onGround) * (1.0F - this.onGround)) * (float)Math.PI); - this.bipedRightArm.rotateAngleZ = 0.0F; - this.bipedLeftArm.rotateAngleZ = 0.0F; - this.bipedRightArm.rotateAngleY = -(0.1F - var8 * 0.6F); - this.bipedLeftArm.rotateAngleY = 0.1F - var8 * 0.6F; -- this.bipedRightArm.rotateAngleX = (float)Math.PI * -0.5F; -- this.bipedLeftArm.rotateAngleX = (float)Math.PI * -0.5F; -+ this.bipedRightArm.rotateAngleX = -((float)Math.PI / 2F); -+ this.bipedLeftArm.rotateAngleX = -((float)Math.PI / 2F); - this.bipedRightArm.rotateAngleX -= var8 * 1.2F - var9 * 0.4F; - this.bipedLeftArm.rotateAngleX -= var8 * 1.2F - var9 * 0.4F; -- this.bipedRightArm.rotateAngleZ += MathHelper.cos(var3 * 0.09F) * 0.05F + 0.05F; -- this.bipedLeftArm.rotateAngleZ -= MathHelper.cos(var3 * 0.09F) * 0.05F + 0.05F; -- this.bipedRightArm.rotateAngleX += MathHelper.sin(var3 * 0.067F) * 0.05F; -- this.bipedLeftArm.rotateAngleX -= MathHelper.sin(var3 * 0.067F) * 0.05F; -+ this.bipedRightArm.rotateAngleZ += MathHelper.cos(par3 * 0.09F) * 0.05F + 0.05F; -+ this.bipedLeftArm.rotateAngleZ -= MathHelper.cos(par3 * 0.09F) * 0.05F + 0.05F; -+ this.bipedRightArm.rotateAngleX += MathHelper.sin(par3 * 0.067F) * 0.05F; -+ this.bipedLeftArm.rotateAngleX -= MathHelper.sin(par3 * 0.067F) * 0.05F; - } - } ---- net/minecraft/src/CallableServerProfiler.java -+++ net/minecraft/src/CallableServerProfiler.java -@@ -4,17 +4,19 @@ - import net.minecraft.server.MinecraftServer; - - public class CallableServerProfiler implements Callable { -- final MinecraftServer a; -- -- public CallableServerProfiler(MinecraftServer var1) { -- this.a = var1; -+ -+ /** Reference to the MinecraftServer object. */ -+ final MinecraftServer mcServer; -+ -+ public CallableServerProfiler(MinecraftServer par1MinecraftServer) { -+ this.mcServer = par1MinecraftServer; - } - - public String callServerProfiler() { -- int var1 = this.a.worldServers[0].getWorldVec3Pool().getPoolSize(); -+ int var1 = this.mcServer.worldServers[0].getWorldVec3Pool().getPoolSize(); - int var2 = 56 * var1; - int var3 = var2 / 1024 / 1024; -- int var4 = this.a.worldServers[0].getWorldVec3Pool().func_82590_d(); -+ int var4 = this.mcServer.worldServers[0].getWorldVec3Pool().func_82590_d(); - int var5 = 56 * var4; - int var6 = var5 / 1024 / 1024; - return var1 + " (" + var2 + " bytes; " + var3 + " MB) allocated, " + var4 + " (" + var5 + " bytes; " + var6 + " MB) used"; ---- net/minecraft/src/BiomeGenOcean.java -+++ net/minecraft/src/BiomeGenOcean.java -@@ -1,8 +1,8 @@ - package net.minecraft.src; - - public class BiomeGenOcean extends BiomeGenBase { -- public BiomeGenOcean(int var1) { -- super(var1); -- this.K.clear(); -+ public BiomeGenOcean(int par1) { -+ super(par1); -+ this.spawnableCreatureList.clear(); - } - } ---- /dev/null -+++ org/spoutcraft/client/gui/error/GuiConnectionLost.java -@@ -1,0 +1,143 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.client.gui.error; -+ -+import org.lwjgl.opengl.GL11; -+import org.newdawn.slick.opengl.Texture; -+ -+import net.minecraft.src.Minecraft; -+import net.minecraft.src.GuiConnecting; -+import net.minecraft.src.GuiScreen; -+ -+import org.spoutcraft.api.Spoutcraft; -+import org.spoutcraft.api.gui.Button; -+import org.spoutcraft.api.gui.Color; -+import org.spoutcraft.api.gui.GenericButton; -+import org.spoutcraft.api.gui.GenericLabel; -+import org.spoutcraft.api.gui.GenericScrollArea; -+import org.spoutcraft.api.gui.GenericTexture; -+import org.spoutcraft.api.gui.RenderPriority; -+import org.spoutcraft.api.gui.WidgetAnchor; -+import org.spoutcraft.client.SpoutClient; -+import org.spoutcraft.client.gui.MCRenderDelegate; -+import org.spoutcraft.client.io.CustomTextureManager; -+import org.spoutcraft.client.io.FileUtil; -+ -+public class GuiConnectionLost extends GuiScreen { -+ public static String lastServerIp; -+ public static int lastServerPort; -+ -+ private String message; -+ -+ public GuiConnectionLost() { -+ message = "The connection to the server has been lost!"; -+ } -+ -+ public GuiConnectionLost(String message) { -+ this.message = message; -+ } -+ -+ @Override -+ public void initGui() { -+ GenericScrollArea screen = new GenericScrollArea(); -+ screen.setHeight(height - 16 - 24).setWidth(width).setY(16 + 24).setX(0); -+ getScreen().attachWidget("Spoutcraft", screen); -+ -+ GenericLabel label = new GenericLabel("Connection Lost!"); -+ int size = Spoutcraft.getMinecraftFont().getTextWidth(label.getText()); -+ label.setX((int) (width / 2 - size / 2)).setY(16); -+ label.setFixed(true).setPriority(RenderPriority.Lowest); -+ getScreen().attachWidget("Spoutcraft", label); -+ -+ int top = 5; -+ Color grey = new Color(0.80F, 0.80F, 0.80F, 0.65F); -+ -+ label = new GenericLabel(message); -+ size = Spoutcraft.getMinecraftFont().getTextWidth(label.getText()); -+ label.setX((int) (width / 2 - size / 2)).setY(top); -+ label.setTextColor(grey); -+ screen.attachWidget("Spoutcraft", label); -+ -+ LocalTexture texture = new LocalTexture(); -+ texture.setUrl(FileUtil.getAssetsDir().getPath()+"/misc/disconnected.png").setX((int) (width / 2 - 64)).setY(top); -+ texture.setHeight(128).setWidth(128); -+ screen.attachWidget("Spoutcraft", texture); -+ -+ top += 116; -+ -+ Button button; -+ button = new ReconnectButton().setText("Attempt to Reconnect"); -+ button.setHeight(20).setWidth(200); -+ button.setX((int) (width / 2 - button.getWidth() / 2)); -+ button.setY(top); -+ button.setAlign(WidgetAnchor.TOP_CENTER); -+ screen.attachWidget("Spoutcraft", button); -+ top += 26; -+ -+ button = new ReturnToServerList().setText("Return to " + SpoutClient.getInstance().getServerManager().getJoinedFromName()); -+ button.setHeight(20).setWidth(200); -+ button.setX((int) (width / 2 - button.getWidth() / 2)); -+ button.setY(top); -+ button.setAlign(WidgetAnchor.TOP_CENTER); -+ screen.attachWidget("Spoutcraft", button); -+ top += 26; -+ -+ button = new ReturnToMainMenu().setText("Return to Main Menu"); -+ button.setHeight(20).setWidth(200); -+ button.setX((int) (width / 2 - button.getWidth() / 2)); -+ button.setY(top); -+ button.setAlign(WidgetAnchor.TOP_CENTER); -+ screen.attachWidget("Spoutcraft", button); -+ top += 26; -+ } -+ -+ @Override -+ public void drawScreen(int var1, int var2, float var3) { -+ drawDefaultBackground(); -+ } -+} -+ -+class ReconnectButton extends GenericButton { -+ public void onButtonClick() { -+ Minecraft.getMinecraft().displayGuiScreen(new GuiConnecting(Minecraft.getMinecraft(), GuiConnectionLost.lastServerIp, GuiConnectionLost.lastServerPort)); -+ } -+} -+ -+class ReturnToMainMenu extends GenericButton { -+ public void onButtonClick() { -+ Minecraft.getMinecraft().displayGuiScreen(new org.spoutcraft.client.gui.mainmenu.MainMenu()); -+ } -+} -+ -+class ReturnToServerList extends GenericButton { -+ public void onButtonClick() { -+ Minecraft.theMinecraft.displayGuiScreen(SpoutClient.getInstance().getServerManager().getJoinedFrom()); -+ } -+} -+ -+class LocalTexture extends GenericTexture { -+ public void render() { -+ Texture texture = CustomTextureManager.getTextureFromPath(getUrl()); -+ if (texture != null) { -+ GL11.glTranslatef((float) getScreenX(), (float) getScreenY(), 0); // Moves texture into place -+ ((MCRenderDelegate)Spoutcraft.getRenderDelegate()).drawTexture(texture, (int)getWidth(), (int)getHeight(), isDrawingAlphaChannel()); -+ } -+ } -+} ---- net/minecraft/src/ComponentNetherBridgeCorridor3.java -+++ net/minecraft/src/ComponentNetherBridgeCorridor3.java -@@ -4,49 +4,60 @@ - import java.util.Random; - - public class ComponentNetherBridgeCorridor3 extends ComponentNetherBridgePiece { -- public ComponentNetherBridgeCorridor3() { -- } -- -- public ComponentNetherBridgeCorridor3(int var1, Random var2, StructureBoundingBox var3, int var4) { -- super(var1); -- this.coordBaseMode = var4; -- this.boundingBox = var3; -- } -- -- public void buildComponent(StructureComponent var1, List var2, Random var3) { -- this.getNextComponentNormal((ComponentNetherBridgeStartPiece)var1, var2, var3, 1, 0, true); -- } -- -- public static ComponentNetherBridgeCorridor3 createValidComponent(List var0, Random var1, int var2, int var3, int var4, int var5, int var6) { -- StructureBoundingBox var7 = StructureBoundingBox.getComponentToAddBoundingBox(var2, var3, var4, -1, -7, 0, 5, 14, 10, var5); -- return isAboveGround(var7) && StructureComponent.findIntersecting(var0, var7) == null ? new ComponentNetherBridgeCorridor3(var6, var1, var7, var5) : null; -- } -- -- public boolean addComponentParts(World var1, Random var2, StructureBoundingBox var3) { -+ public ComponentNetherBridgeCorridor3() {} -+ -+ public ComponentNetherBridgeCorridor3(int par1, Random par2Random, StructureBoundingBox par3StructureBoundingBox, int par4) { -+ super(par1); -+ this.coordBaseMode = par4; -+ this.boundingBox = par3StructureBoundingBox; -+ } -+ -+ /** -+ * Initiates construction of the Structure Component picked, at the current Location of StructGen -+ */ -+ public void buildComponent(StructureComponent par1StructureComponent, List par2List, Random par3Random) { -+ this.getNextComponentNormal((ComponentNetherBridgeStartPiece)par1StructureComponent, par2List, par3Random, 1, 0, true); -+ } -+ -+ /** -+ * Creates and returns a new component piece. Or null if it could not find enough room to place it. -+ */ -+ public static ComponentNetherBridgeCorridor3 createValidComponent(List par0List, Random par1Random, int par2, int par3, int par4, int par5, int par6) { -+ StructureBoundingBox var7 = StructureBoundingBox.getComponentToAddBoundingBox(par2, par3, par4, -1, -7, 0, 5, 14, 10, par5); -+ return isAboveGround(var7) && StructureComponent.findIntersecting(par0List, var7) == null ? new ComponentNetherBridgeCorridor3(par6, par1Random, var7, par5) : null; -+ } -+ -+ /** -+ * second Part of Structure generating, this for example places Spiderwebs, Mob Spawners, it closes Mineshafts at the -+ * end, it adds Fences... -+ */ -+ public boolean addComponentParts(World par1World, Random par2Random, StructureBoundingBox par3StructureBoundingBox) { - int var4 = this.getMetadataWithOffset(Block.stairsNetherBrick.blockID, 2); - -- for(int var5 = 0; var5 <= 9; ++var5) { -+ for (int var5 = 0; var5 <= 9; ++var5) { - int var6 = Math.max(1, 7 - var5); - int var7 = Math.min(Math.max(var6 + 5, 14 - var5), 13); - int var8 = var5; -- this.fillWithBlocks(var1, var3, 0, 0, var5, 4, var6, var5, Block.netherBrick.blockID, Block.netherBrick.blockID, false); -- this.fillWithBlocks(var1, var3, 1, var6 + 1, var5, 3, var7 - 1, var5, 0, 0, false); -- if(var5 <= 6) { -- this.placeBlockAtCurrentPosition(var1, Block.stairsNetherBrick.blockID, var4, 1, var6 + 1, var5, var3); -- this.placeBlockAtCurrentPosition(var1, Block.stairsNetherBrick.blockID, var4, 2, var6 + 1, var5, var3); -- this.placeBlockAtCurrentPosition(var1, Block.stairsNetherBrick.blockID, var4, 3, var6 + 1, var5, var3); -- } -- -- this.fillWithBlocks(var1, var3, 0, var7, var5, 4, var7, var5, Block.netherBrick.blockID, Block.netherBrick.blockID, false); -- this.fillWithBlocks(var1, var3, 0, var6 + 1, var5, 0, var7 - 1, var5, Block.netherBrick.blockID, Block.netherBrick.blockID, false); -- this.fillWithBlocks(var1, var3, 4, var6 + 1, var5, 4, var7 - 1, var5, Block.netherBrick.blockID, Block.netherBrick.blockID, false); -- if((var5 & 1) == 0) { -- this.fillWithBlocks(var1, var3, 0, var6 + 2, var5, 0, var6 + 3, var5, Block.netherFence.blockID, Block.netherFence.blockID, false); -- this.fillWithBlocks(var1, var3, 4, var6 + 2, var5, 4, var6 + 3, var5, Block.netherFence.blockID, Block.netherFence.blockID, false); -- } -- -- for(int var9 = 0; var9 <= 4; ++var9) { -- this.fillCurrentPositionBlocksDownwards(var1, Block.netherBrick.blockID, 0, var9, -1, var8, var3); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 0, 0, var5, 4, var6, var5, Block.netherBrick.blockID, Block.netherBrick.blockID, false); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 1, var6 + 1, var5, 3, var7 - 1, var5, 0, 0, false); -+ -+ if (var5 <= 6) { -+ this.placeBlockAtCurrentPosition(par1World, Block.stairsNetherBrick.blockID, var4, 1, var6 + 1, var5, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.stairsNetherBrick.blockID, var4, 2, var6 + 1, var5, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.stairsNetherBrick.blockID, var4, 3, var6 + 1, var5, par3StructureBoundingBox); -+ } -+ -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 0, var7, var5, 4, var7, var5, Block.netherBrick.blockID, Block.netherBrick.blockID, false); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 0, var6 + 1, var5, 0, var7 - 1, var5, Block.netherBrick.blockID, Block.netherBrick.blockID, false); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 4, var6 + 1, var5, 4, var7 - 1, var5, Block.netherBrick.blockID, Block.netherBrick.blockID, false); -+ -+ if ((var5 & 1) == 0) { -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 0, var6 + 2, var5, 0, var6 + 3, var5, Block.netherFence.blockID, Block.netherFence.blockID, false); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 4, var6 + 2, var5, 4, var6 + 3, var5, Block.netherFence.blockID, Block.netherFence.blockID, false); -+ } -+ -+ for (int var9 = 0; var9 <= 4; ++var9) { -+ this.fillCurrentPositionBlocksDownwards(par1World, Block.netherBrick.blockID, 0, var9, -1, var8, par3StructureBoundingBox); - } - } - ---- net/minecraft/src/ItemSlab.java -+++ net/minecraft/src/ItemSlab.java -@@ -2,130 +2,154 @@ - - public class ItemSlab extends ItemBlock { - private final boolean isFullBlock; -+ -+ /** Instance of BlockHalfSlab. */ - private final BlockHalfSlab theHalfSlab; -+ -+ /** The double-slab block corresponding to this item. */ - private final BlockHalfSlab doubleSlab; - -- public ItemSlab(int var1, BlockHalfSlab var2, BlockHalfSlab var3, boolean var4) { -- super(var1); -- this.theHalfSlab = var2; -- this.doubleSlab = var3; -- this.isFullBlock = var4; -+ public ItemSlab(int par1, BlockHalfSlab par2BlockHalfSlab, BlockHalfSlab par3BlockHalfSlab, boolean par4) { -+ super(par1); -+ this.theHalfSlab = par2BlockHalfSlab; -+ this.doubleSlab = par3BlockHalfSlab; -+ this.isFullBlock = par4; - this.setMaxDamage(0); - this.setHasSubtypes(true); - } - -- public Icon getIconFromDamage(int var1) { -- return Block.blocksList[this.itemID].getIcon(2, var1); -- } -- -- public int getMetadata(int var1) { -- return var1; -- } -- -- public String getUnlocalizedName(ItemStack var1) { -- return this.theHalfSlab.getFullSlabName(var1.getItemDamage()); -- } -- -- public boolean onItemUse(ItemStack var1, EntityPlayer var2, World var3, int var4, int var5, int var6, int var7, float var8, float var9, float var10) { -- if(this.isFullBlock) { -- return super.onItemUse(var1, var2, var3, var4, var5, var6, var7, var8, var9, var10); -- } else if(var1.stackSize == 0) { -+ /** -+ * Gets an icon index based on an item's damage value -+ */ -+ public Icon getIconFromDamage(int par1) { -+ return Block.blocksList[this.itemID].getIcon(2, par1); -+ } -+ -+ /** -+ * Returns the metadata of the block which this Item (ItemBlock) can place -+ */ -+ public int getMetadata(int par1) { -+ return par1; -+ } -+ -+ /** -+ * Returns the unlocalized name of this item. This version accepts an ItemStack so different stacks can have different -+ * names based on their damage or NBT. -+ */ -+ public String getUnlocalizedName(ItemStack par1ItemStack) { -+ return this.theHalfSlab.getFullSlabName(par1ItemStack.getItemDamage()); -+ } -+ -+ /** -+ * Callback for item usage. If the item does something special on right clicking, he will have one of those. Return -+ * True if something happen and false if it don't. This is for ITEMS, not BLOCKS -+ */ -+ public boolean onItemUse(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, World par3World, int par4, int par5, int par6, int par7, float par8, float par9, float par10) { -+ if (this.isFullBlock) { -+ return super.onItemUse(par1ItemStack, par2EntityPlayer, par3World, par4, par5, par6, par7, par8, par9, par10); -+ } else if (par1ItemStack.stackSize == 0) { - return false; -- } else if(!var2.canPlayerEdit(var4, var5, var6, var7, var1)) { -+ } else if (!par2EntityPlayer.canPlayerEdit(par4, par5, par6, par7, par1ItemStack)) { - return false; - } else { -- int var11 = var3.getBlockId(var4, var5, var6); -- int var12 = var3.getBlockMetadata(var4, var5, var6); -+ int var11 = par3World.getBlockId(par4, par5, par6); -+ int var12 = par3World.getBlockMetadata(par4, par5, par6); - int var13 = var12 & 7; - boolean var14 = (var12 & 8) != 0; -- if((var7 == 1 && !var14 || var7 == 0 && var14) && var11 == this.theHalfSlab.blockID && var13 == var1.getItemDamage()) { -- if(var3.checkNoEntityCollision(this.doubleSlab.getCollisionBoundingBoxFromPool(var3, var4, var5, var6)) && var3.setBlock(var4, var5, var6, this.doubleSlab.blockID, var13, 3)) { -- var3.playSoundEffect((double)((float)var4 + 0.5F), (double)((float)var5 + 0.5F), (double)((float)var6 + 0.5F), this.doubleSlab.stepSound.getPlaceSound(), (this.doubleSlab.stepSound.getVolume() + 1.0F) / 2.0F, this.doubleSlab.stepSound.getPitch() * 0.8F); -- --var1.stackSize; -+ -+ if ((par7 == 1 && !var14 || par7 == 0 && var14) && var11 == this.theHalfSlab.blockID && var13 == par1ItemStack.getItemDamage()) { -+ if (par3World.checkNoEntityCollision(this.doubleSlab.getCollisionBoundingBoxFromPool(par3World, par4, par5, par6)) && par3World.setBlock(par4, par5, par6, this.doubleSlab.blockID, var13, 3)) { -+ par3World.playSoundEffect((double)((float)par4 + 0.5F), (double)((float)par5 + 0.5F), (double)((float)par6 + 0.5F), this.doubleSlab.stepSound.getPlaceSound(), (this.doubleSlab.stepSound.getVolume() + 1.0F) / 2.0F, this.doubleSlab.stepSound.getPitch() * 0.8F); -+ --par1ItemStack.stackSize; - } - - return true; - } else { -- return this.func_77888_a(var1, var2, var3, var4, var5, var6, var7) ? true : super.onItemUse(var1, var2, var3, var4, var5, var6, var7, var8, var9, var10); -+ return this.func_77888_a(par1ItemStack, par2EntityPlayer, par3World, par4, par5, par6, par7) ? true : super.onItemUse(par1ItemStack, par2EntityPlayer, par3World, par4, par5, par6, par7, par8, par9, par10); - } - } - } - -- public boolean canPlaceItemBlockOnSide(World var1, int var2, int var3, int var4, int var5, EntityPlayer var6, ItemStack var7) { -- int var8 = var2; -- int var9 = var3; -- int var10 = var4; -- int var11 = var1.getBlockId(var2, var3, var4); -- int var12 = var1.getBlockMetadata(var2, var3, var4); -+ /** -+ * Returns true if the given ItemBlock can be placed on the given side of the given block position. -+ */ -+ public boolean canPlaceItemBlockOnSide(World par1World, int par2, int par3, int par4, int par5, EntityPlayer par6EntityPlayer, ItemStack par7ItemStack) { -+ int var8 = par2; -+ int var9 = par3; -+ int var10 = par4; -+ int var11 = par1World.getBlockId(par2, par3, par4); -+ int var12 = par1World.getBlockMetadata(par2, par3, par4); - int var13 = var12 & 7; - boolean var14 = (var12 & 8) != 0; -- if((var5 == 1 && !var14 || var5 == 0 && var14) && var11 == this.theHalfSlab.blockID && var13 == var7.getItemDamage()) { -+ -+ if ((par5 == 1 && !var14 || par5 == 0 && var14) && var11 == this.theHalfSlab.blockID && var13 == par7ItemStack.getItemDamage()) { - return true; - } else { -- if(var5 == 0) { -- --var3; -- } -- -- if(var5 == 1) { -- ++var3; -- } -- -- if(var5 == 2) { -- --var4; -- } -- -- if(var5 == 3) { -- ++var4; -- } -- -- if(var5 == 4) { -- --var2; -- } -- -- if(var5 == 5) { -- ++var2; -- } -- -- var11 = var1.getBlockId(var2, var3, var4); -- var12 = var1.getBlockMetadata(var2, var3, var4); -+ if (par5 == 0) { -+ --par3; -+ } -+ -+ if (par5 == 1) { -+ ++par3; -+ } -+ -+ if (par5 == 2) { -+ --par4; -+ } -+ -+ if (par5 == 3) { -+ ++par4; -+ } -+ -+ if (par5 == 4) { -+ --par2; -+ } -+ -+ if (par5 == 5) { -+ ++par2; -+ } -+ -+ var11 = par1World.getBlockId(par2, par3, par4); -+ var12 = par1World.getBlockMetadata(par2, par3, par4); - var13 = var12 & 7; - var14 = (var12 & 8) != 0; -- return var11 == this.theHalfSlab.blockID && var13 == var7.getItemDamage() ? true : super.canPlaceItemBlockOnSide(var1, var8, var9, var10, var5, var6, var7); -+ return var11 == this.theHalfSlab.blockID && var13 == par7ItemStack.getItemDamage() ? true : super.canPlaceItemBlockOnSide(par1World, var8, var9, var10, par5, par6EntityPlayer, par7ItemStack); - } - } - -- private boolean func_77888_a(ItemStack var1, EntityPlayer var2, World var3, int var4, int var5, int var6, int var7) { -- if(var7 == 0) { -- --var5; -- } -- -- if(var7 == 1) { -- ++var5; -- } -- -- if(var7 == 2) { -- --var6; -- } -- -- if(var7 == 3) { -- ++var6; -- } -- -- if(var7 == 4) { -- --var4; -- } -- -- if(var7 == 5) { -- ++var4; -- } -- -- int var8 = var3.getBlockId(var4, var5, var6); -- int var9 = var3.getBlockMetadata(var4, var5, var6); -+ private boolean func_77888_a(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, World par3World, int par4, int par5, int par6, int par7) { -+ if (par7 == 0) { -+ --par5; -+ } -+ -+ if (par7 == 1) { -+ ++par5; -+ } -+ -+ if (par7 == 2) { -+ --par6; -+ } -+ -+ if (par7 == 3) { -+ ++par6; -+ } -+ -+ if (par7 == 4) { -+ --par4; -+ } -+ -+ if (par7 == 5) { -+ ++par4; -+ } -+ -+ int var8 = par3World.getBlockId(par4, par5, par6); -+ int var9 = par3World.getBlockMetadata(par4, par5, par6); - int var10 = var9 & 7; -- if(var8 == this.theHalfSlab.blockID && var10 == var1.getItemDamage()) { -- if(var3.checkNoEntityCollision(this.doubleSlab.getCollisionBoundingBoxFromPool(var3, var4, var5, var6)) && var3.setBlock(var4, var5, var6, this.doubleSlab.blockID, var10, 3)) { -- var3.playSoundEffect((double)((float)var4 + 0.5F), (double)((float)var5 + 0.5F), (double)((float)var6 + 0.5F), this.doubleSlab.stepSound.getPlaceSound(), (this.doubleSlab.stepSound.getVolume() + 1.0F) / 2.0F, this.doubleSlab.stepSound.getPitch() * 0.8F); -- --var1.stackSize; -+ -+ if (var8 == this.theHalfSlab.blockID && var10 == par1ItemStack.getItemDamage()) { -+ if (par3World.checkNoEntityCollision(this.doubleSlab.getCollisionBoundingBoxFromPool(par3World, par4, par5, par6)) && par3World.setBlock(par4, par5, par6, this.doubleSlab.blockID, var10, 3)) { -+ par3World.playSoundEffect((double)((float)par4 + 0.5F), (double)((float)par5 + 0.5F), (double)((float)par6 + 0.5F), this.doubleSlab.stepSound.getPlaceSound(), (this.doubleSlab.stepSound.getVolume() + 1.0F) / 2.0F, this.doubleSlab.stepSound.getPitch() * 0.8F); -+ --par1ItemStack.stackSize; - } - - return true; ---- net/minecraft/src/BlockBed.java -+++ net/minecraft/src/BlockBed.java -@@ -4,183 +4,238 @@ - import java.util.Random; - - public class BlockBed extends BlockDirectional { -- public static final int[][] footBlockToHeadBlockMap = new int[][]{{0, 1}, {-1, 0}, {0, -1}, {1, 0}}; -+ -+ /** Maps the foot-of-bed block to the head-of-bed block. */ -+ public static final int[][] footBlockToHeadBlockMap = new int[][] {{0, 1}, { -1, 0}, {0, -1}, {1, 0}}; - private Icon[] field_94472_b; - private Icon[] bedSideIcons; - private Icon[] bedTopIcons; - -- public BlockBed(int var1) { -- super(var1, Material.cloth); -+ public BlockBed(int par1) { -+ super(par1, Material.cloth); - this.setBounds(); - } - -- public boolean onBlockActivated(World var1, int var2, int var3, int var4, EntityPlayer var5, int var6, float var7, float var8, float var9) { -- if(var1.isRemote) { -+ /** -+ * Called upon block activation (right click on the block.) -+ */ -+ public boolean onBlockActivated(World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer, int par6, float par7, float par8, float par9) { -+ if (par1World.isRemote) { - return true; - } else { -- int var10 = var1.getBlockMetadata(var2, var3, var4); -- if(!isBlockHeadOfBed(var10)) { -+ int var10 = par1World.getBlockMetadata(par2, par3, par4); -+ -+ if (!isBlockHeadOfBed(var10)) { - int var11 = getDirection(var10); -- var2 += footBlockToHeadBlockMap[var11][0]; -- var4 += footBlockToHeadBlockMap[var11][1]; -- if(var1.getBlockId(var2, var3, var4) != this.blockID) { -+ par2 += footBlockToHeadBlockMap[var11][0]; -+ par4 += footBlockToHeadBlockMap[var11][1]; -+ -+ if (par1World.getBlockId(par2, par3, par4) != this.blockID) { - return true; - } - -- var10 = var1.getBlockMetadata(var2, var3, var4); -+ var10 = par1World.getBlockMetadata(par2, par3, par4); - } - -- if(var1.provider.canRespawnHere() && var1.getBiomeGenForCoords(var2, var4) != BiomeGenBase.hell) { -- if(isBedOccupied(var10)) { -+ if (par1World.provider.canRespawnHere() && par1World.getBiomeGenForCoords(par2, par4) != BiomeGenBase.hell) { -+ if (isBedOccupied(var10)) { - EntityPlayer var19 = null; -- Iterator var12 = var1.h.iterator(); -+ Iterator var12 = par1World.playerEntities.iterator(); - -- while(var12.hasNext()) { -+ while (var12.hasNext()) { - EntityPlayer var21 = (EntityPlayer)var12.next(); -- if(var21.isPlayerSleeping()) { -+ -+ if (var21.isPlayerSleeping()) { - ChunkCoordinates var14 = var21.playerLocation; -- if(var14.posX == var2 && var14.posY == var3 && var14.posZ == var4) { -+ -+ if (var14.posX == par2 && var14.posY == par3 && var14.posZ == par4) { - var19 = var21; - } - } - } - -- if(var19 != null) { -- var5.addChatMessage("tile.bed.occupied"); -+ if (var19 != null) { -+ par5EntityPlayer.addChatMessage("tile.bed.occupied"); - return true; - } - -- setBedOccupied(var1, var2, var3, var4, false); -+ setBedOccupied(par1World, par2, par3, par4, false); - } - -- EnumStatus var20 = var5.sleepInBedAt(var2, var3, var4); -- if(var20 == EnumStatus.OK) { -- setBedOccupied(var1, var2, var3, var4, true); -+ EnumStatus var20 = par5EntityPlayer.sleepInBedAt(par2, par3, par4); -+ -+ if (var20 == EnumStatus.OK) { -+ setBedOccupied(par1World, par2, par3, par4, true); - return true; - } else { -- if(var20 == EnumStatus.NOT_POSSIBLE_NOW) { -- var5.addChatMessage("tile.bed.noSleep"); -- } else if(var20 == EnumStatus.NOT_SAFE) { -- var5.addChatMessage("tile.bed.notSafe"); -+ if (var20 == EnumStatus.NOT_POSSIBLE_NOW) { -+ par5EntityPlayer.addChatMessage("tile.bed.noSleep"); -+ } else if (var20 == EnumStatus.NOT_SAFE) { -+ par5EntityPlayer.addChatMessage("tile.bed.notSafe"); - } - - return true; - } - } else { -- double var18 = (double)var2 + 0.5D; -- double var13 = (double)var3 + 0.5D; -- double var15 = (double)var4 + 0.5D; -- var1.setBlockToAir(var2, var3, var4); -+ double var18 = (double)par2 + 0.5D; -+ double var13 = (double)par3 + 0.5D; -+ double var15 = (double)par4 + 0.5D; -+ par1World.setBlockToAir(par2, par3, par4); - int var17 = getDirection(var10); -- var2 += footBlockToHeadBlockMap[var17][0]; -- var4 += footBlockToHeadBlockMap[var17][1]; -- if(var1.getBlockId(var2, var3, var4) == this.blockID) { -- var1.setBlockToAir(var2, var3, var4); -- var18 = (var18 + (double)var2 + 0.5D) / 2.0D; -- var13 = (var13 + (double)var3 + 0.5D) / 2.0D; -- var15 = (var15 + (double)var4 + 0.5D) / 2.0D; -+ par2 += footBlockToHeadBlockMap[var17][0]; -+ par4 += footBlockToHeadBlockMap[var17][1]; -+ -+ if (par1World.getBlockId(par2, par3, par4) == this.blockID) { -+ par1World.setBlockToAir(par2, par3, par4); -+ var18 = (var18 + (double)par2 + 0.5D) / 2.0D; -+ var13 = (var13 + (double)par3 + 0.5D) / 2.0D; -+ var15 = (var15 + (double)par4 + 0.5D) / 2.0D; - } - -- var1.newExplosion((Entity)null, (double)((float)var2 + 0.5F), (double)((float)var3 + 0.5F), (double)((float)var4 + 0.5F), 5.0F, true, true); -+ par1World.newExplosion((Entity)null, (double)((float)par2 + 0.5F), (double)((float)par3 + 0.5F), (double)((float)par4 + 0.5F), 5.0F, true, true); - return true; - } - } - } - -- public Icon getIcon(int var1, int var2) { -- if(var1 == 0) { -- return Block.planks.getBlockTextureFromSide(var1); -+ /** -+ * From the specified side and block metadata retrieves the blocks texture. Args: side, metadata -+ */ -+ public Icon getIcon(int par1, int par2) { -+ if (par1 == 0) { -+ return Block.planks.getBlockTextureFromSide(par1); - } else { -- int var3 = getDirection(var2); -- int var4 = Direction.bedDirection[var3][var1]; -- int var5 = isBlockHeadOfBed(var2) ? 1 : 0; -+ int var3 = getDirection(par2); -+ int var4 = Direction.bedDirection[var3][par1]; -+ int var5 = isBlockHeadOfBed(par2) ? 1 : 0; - return (var5 != 1 || var4 != 2) && (var5 != 0 || var4 != 3) ? (var4 != 5 && var4 != 4 ? this.bedTopIcons[var5] : this.bedSideIcons[var5]) : this.field_94472_b[var5]; - } - } - -- public void registerIcons(IconRegister var1) { -- this.bedTopIcons = new Icon[]{var1.registerIcon(this.getTextureName() + "_feet_top"), var1.registerIcon(this.getTextureName() + "_head_top")}; -- this.field_94472_b = new Icon[]{var1.registerIcon(this.getTextureName() + "_feet_end"), var1.registerIcon(this.getTextureName() + "_head_end")}; -- this.bedSideIcons = new Icon[]{var1.registerIcon(this.getTextureName() + "_feet_side"), var1.registerIcon(this.getTextureName() + "_head_side")}; -+ /** -+ * When this method is called, your block should register all the icons it needs with the given IconRegister. This is -+ * the only chance you get to register icons. -+ */ -+ public void registerIcons(IconRegister par1IconRegister) { -+ this.bedTopIcons = new Icon[] {par1IconRegister.registerIcon(this.getTextureName() + "_feet_top"), par1IconRegister.registerIcon(this.getTextureName() + "_head_top")}; -+ this.field_94472_b = new Icon[] {par1IconRegister.registerIcon(this.getTextureName() + "_feet_end"), par1IconRegister.registerIcon(this.getTextureName() + "_head_end")}; -+ this.bedSideIcons = new Icon[] {par1IconRegister.registerIcon(this.getTextureName() + "_feet_side"), par1IconRegister.registerIcon(this.getTextureName() + "_head_side")}; - } - -+ /** -+ * The type of render function that is called for this block -+ */ - public int getRenderType() { - return 14; - } - -+ /** -+ * If this block doesn't render as an ordinary block it will return False (examples: signs, buttons, stairs, etc) -+ */ - public boolean renderAsNormalBlock() { - return false; - } - -+ /** -+ * Is this block (a) opaque and (b) a full 1m cube? This determines whether or not to render the shared face of two -+ * adjacent blocks and also whether the player can attach torches, redstone wire, etc to this block. -+ */ - public boolean isOpaqueCube() { - return false; - } - -- public void setBlockBoundsBasedOnState(IBlockAccess var1, int var2, int var3, int var4) { -+ /** -+ * Updates the blocks bounds based on its current state. Args: world, x, y, z -+ */ -+ public void setBlockBoundsBasedOnState(IBlockAccess par1IBlockAccess, int par2, int par3, int par4) { - this.setBounds(); - } - -- public void onNeighborBlockChange(World var1, int var2, int var3, int var4, int var5) { -- int var6 = var1.getBlockMetadata(var2, var3, var4); -+ /** -+ * Lets the block know when one of its neighbor changes. Doesn't know which neighbor changed (coordinates passed are -+ * their own) Args: x, y, z, neighbor blockID -+ */ -+ public void onNeighborBlockChange(World par1World, int par2, int par3, int par4, int par5) { -+ int var6 = par1World.getBlockMetadata(par2, par3, par4); - int var7 = getDirection(var6); -- if(isBlockHeadOfBed(var6)) { -- if(var1.getBlockId(var2 - footBlockToHeadBlockMap[var7][0], var3, var4 - footBlockToHeadBlockMap[var7][1]) != this.blockID) { -- var1.setBlockToAir(var2, var3, var4); -+ -+ if (isBlockHeadOfBed(var6)) { -+ if (par1World.getBlockId(par2 - footBlockToHeadBlockMap[var7][0], par3, par4 - footBlockToHeadBlockMap[var7][1]) != this.blockID) { -+ par1World.setBlockToAir(par2, par3, par4); - } -- } else if(var1.getBlockId(var2 + footBlockToHeadBlockMap[var7][0], var3, var4 + footBlockToHeadBlockMap[var7][1]) != this.blockID) { -- var1.setBlockToAir(var2, var3, var4); -- if(!var1.isRemote) { -- this.dropBlockAsItem(var1, var2, var3, var4, var6, 0); -+ } else if (par1World.getBlockId(par2 + footBlockToHeadBlockMap[var7][0], par3, par4 + footBlockToHeadBlockMap[var7][1]) != this.blockID) { -+ par1World.setBlockToAir(par2, par3, par4); -+ -+ if (!par1World.isRemote) { -+ this.dropBlockAsItem(par1World, par2, par3, par4, var6, 0); - } - } -- -- } -- -- public int idDropped(int var1, Random var2, int var3) { -- return isBlockHeadOfBed(var1) ? 0 : Item.bed.itemID; -- } -- -+ } -+ -+ /** -+ * Returns the ID of the items to drop on destruction. -+ */ -+ public int idDropped(int par1, Random par2Random, int par3) { -+ return isBlockHeadOfBed(par1) ? 0 : Item.bed.itemID; -+ } -+ -+ /** -+ * Set the bounds of the bed block. -+ */ - private void setBounds() { -- this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 9.0F / 16.0F, 1.0F); -- } -- -- public static boolean isBlockHeadOfBed(int var0) { -- return (var0 & 8) != 0; -- } -- -- public static boolean isBedOccupied(int var0) { -- return (var0 & 4) != 0; -- } -- -- public static void setBedOccupied(World var0, int var1, int var2, int var3, boolean var4) { -- int var5 = var0.getBlockMetadata(var1, var2, var3); -- if(var4) { -+ this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.5625F, 1.0F); -+ } -+ -+ /** -+ * Returns whether or not this bed block is the head of the bed. -+ */ -+ public static boolean isBlockHeadOfBed(int par0) { -+ return (par0 & 8) != 0; -+ } -+ -+ /** -+ * Return whether or not the bed is occupied. -+ */ -+ public static boolean isBedOccupied(int par0) { -+ return (par0 & 4) != 0; -+ } -+ -+ /** -+ * Sets whether or not the bed is occupied. -+ */ -+ public static void setBedOccupied(World par0World, int par1, int par2, int par3, boolean par4) { -+ int var5 = par0World.getBlockMetadata(par1, par2, par3); -+ -+ if (par4) { - var5 |= 4; - } else { - var5 &= -5; - } - -- var0.setBlockMetadata(var1, var2, var3, var5, 4); -+ par0World.setBlockMetadataWithNotify(par1, par2, par3, var5, 4); - } - -- public static ChunkCoordinates getNearestEmptyChunkCoordinates(World var0, int var1, int var2, int var3, int var4) { -- int var5 = var0.getBlockMetadata(var1, var2, var3); -+ /** -+ * Gets the nearest empty chunk coordinates for the player to wake up from a bed into. -+ */ -+ public static ChunkCoordinates getNearestEmptyChunkCoordinates(World par0World, int par1, int par2, int par3, int par4) { -+ int var5 = par0World.getBlockMetadata(par1, par2, par3); - int var6 = BlockDirectional.getDirection(var5); - -- for(int var7 = 0; var7 <= 1; ++var7) { -- int var8 = var1 - footBlockToHeadBlockMap[var6][0] * var7 - 1; -- int var9 = var3 - footBlockToHeadBlockMap[var6][1] * var7 - 1; -+ for (int var7 = 0; var7 <= 1; ++var7) { -+ int var8 = par1 - footBlockToHeadBlockMap[var6][0] * var7 - 1; -+ int var9 = par3 - footBlockToHeadBlockMap[var6][1] * var7 - 1; - int var10 = var8 + 2; - int var11 = var9 + 2; - -- for(int var12 = var8; var12 <= var10; ++var12) { -- for(int var13 = var9; var13 <= var11; ++var13) { -- if(var0.doesBlockHaveSolidTopSurface(var12, var2 - 1, var13) && !var0.getBlockMaterial(var12, var2, var13).isOpaque() && !var0.getBlockMaterial(var12, var2 + 1, var13).isOpaque()) { -- if(var4 <= 0) { -- return new ChunkCoordinates(var12, var2, var13); -+ for (int var12 = var8; var12 <= var10; ++var12) { -+ for (int var13 = var9; var13 <= var11; ++var13) { -+ if (par0World.doesBlockHaveSolidTopSurface(var12, par2 - 1, var13) && !par0World.getBlockMaterial(var12, par2, var13).isOpaque() && !par0World.getBlockMaterial(var12, par2 + 1, var13).isOpaque()) { -+ if (par4 <= 0) { -+ return new ChunkCoordinates(var12, par2, var13); - } - -- --var4; -+ --par4; - } - } - } -@@ -189,30 +244,42 @@ - return null; - } - -- public void dropBlockAsItemWithChance(World var1, int var2, int var3, int var4, int var5, float var6, int var7) { -- if(!isBlockHeadOfBed(var5)) { -- super.dropBlockAsItemWithChance(var1, var2, var3, var4, var5, var6, 0); -+ /** -+ * Drops the block items with a specified chance of dropping the specified items -+ */ -+ public void dropBlockAsItemWithChance(World par1World, int par2, int par3, int par4, int par5, float par6, int par7) { -+ if (!isBlockHeadOfBed(par5)) { -+ super.dropBlockAsItemWithChance(par1World, par2, par3, par4, par5, par6, 0); - } -- - } - -+ /** -+ * Returns the mobility information of the block, 0 = free, 1 = can't push but can move over, 2 = total immobility and -+ * stop pistons -+ */ - public int getMobilityFlag() { - return 1; - } - -- public int idPicked(World var1, int var2, int var3, int var4) { -+ /** -+ * only called by clickMiddleMouseButton , and passed to inventory.setCurrentItem (along with isCreative) -+ */ -+ public int idPicked(World par1World, int par2, int par3, int par4) { - return Item.bed.itemID; - } - -- public void onBlockHarvested(World var1, int var2, int var3, int var4, int var5, EntityPlayer var6) { -- if(var6.capabilities.isCreativeMode && isBlockHeadOfBed(var5)) { -- int var7 = getDirection(var5); -- var2 -= footBlockToHeadBlockMap[var7][0]; -- var4 -= footBlockToHeadBlockMap[var7][1]; -- if(var1.getBlockId(var2, var3, var4) == this.blockID) { -- var1.setBlockToAir(var2, var3, var4); -+ /** -+ * Called when the block is attempted to be harvested -+ */ -+ public void onBlockHarvested(World par1World, int par2, int par3, int par4, int par5, EntityPlayer par6EntityPlayer) { -+ if (par6EntityPlayer.capabilities.isCreativeMode && isBlockHeadOfBed(par5)) { -+ int var7 = getDirection(par5); -+ par2 -= footBlockToHeadBlockMap[var7][0]; -+ par4 -= footBlockToHeadBlockMap[var7][1]; -+ -+ if (par1World.getBlockId(par2, par3, par4) == this.blockID) { -+ par1World.setBlockToAir(par2, par3, par4); - } - } -- - } - } ---- net/minecraft/src/EntityMinecartChest.java -+++ net/minecraft/src/EntityMinecartChest.java -@@ -1,19 +1,22 @@ - package net.minecraft.src; - - public class EntityMinecartChest extends EntityMinecartContainer { -- public EntityMinecartChest(World var1) { -- super(var1); -- } -- -- public EntityMinecartChest(World var1, double var2, double var4, double var6) { -- super(var1, var2, var4, var6); -- } -- -- public void killMinecart(DamageSource var1) { -- super.killMinecart(var1); -+ public EntityMinecartChest(World par1World) { -+ super(par1World); -+ } -+ -+ public EntityMinecartChest(World par1World, double par2, double par4, double par6) { -+ super(par1World, par2, par4, par6); -+ } -+ -+ public void killMinecart(DamageSource par1DamageSource) { -+ super.killMinecart(par1DamageSource); - this.dropItemWithOffset(Block.chest.blockID, 1, 0.0F); - } - -+ /** -+ * Returns the number of slots in the inventory. -+ */ - public int getSizeInventory() { - return 27; - } ---- net/minecraft/src/StringTranslate.java -+++ net/minecraft/src/StringTranslate.java -@@ -1,73 +1,91 @@ - package net.minecraft.src; - --import com.google.common.base.Splitter; --import com.google.common.collect.Iterables; --import com.google.common.collect.Maps; - import java.io.IOException; - import java.io.InputStream; - import java.util.IllegalFormatException; - import java.util.Iterator; - import java.util.Map; - import java.util.regex.Pattern; -+ -+import com.google.common.base.Splitter; -+import com.google.common.collect.Iterables; -+import com.google.common.collect.Maps; - import org.apache.commons.io.Charsets; - import org.apache.commons.io.IOUtils; - - public class StringTranslate { -- private static final Pattern a = Pattern.compile("%(\\d+\\$)?[\\d\\.]*[df]"); -- private static final Splitter b = Splitter.on('=').limit(2); -- private static StringTranslate instance = new StringTranslate(); -- private Map d = Maps.newHashMap(); -+ private static final Pattern field_111053_a = Pattern.compile("%(\\d+\\$)?[\\d\\.]*[df]"); -+ private static final Splitter field_135065_b = Splitter.on('=').limit(2); -+ // ToDo: missing previous Spoutcraft API code, requires re-write. -+ -+ /** Is the private singleton instance of StringTranslate. */ -+ // Spout Start -+ public static StringTranslate instance = new StringTranslate(); -+ // Spout End -+ private Map languageList = Maps.newHashMap(); - - public StringTranslate() { - try { - InputStream var1 = StringTranslate.class.getResourceAsStream("/assets/minecraft/lang/en_US.lang"); - Iterator var2 = IOUtils.readLines(var1, Charsets.UTF_8).iterator(); - -- while(var2.hasNext()) { -+ while (var2.hasNext()) { - String var3 = (String)var2.next(); -- if(!var3.isEmpty() && var3.charAt(0) != 35) { -- String[] var4 = (String[])Iterables.toArray(b.split(var3), String.class); -- if(var4 != null && var4.length == 2) { -+ -+ if (!var3.isEmpty() && var3.charAt(0) != 35) { -+ String[] var4 = (String[])Iterables.toArray(field_135065_b.split(var3), String.class); -+ -+ if (var4 != null && var4.length == 2) { - String var5 = var4[0]; -- String var6 = a.matcher(var4[1]).replaceAll("%$1s"); -- this.d.put(var5, var6); -+ String var6 = field_111053_a.matcher(var4[1]).replaceAll("%$1s"); -+ this.languageList.put(var5, var6); - } - } - } - } catch (IOException var7) { -+ ; - } -- -- } -- -- static StringTranslate getInstance() { -- return instance; -- } -- -- public static synchronized void func_135063_a(Map var0) { -- instance.d.clear(); -- instance.d.putAll(var0); -- } -- -- public synchronized String translateKey(String var1) { -- return this.func_135064_c(var1); -- } -- -- public synchronized String translateKeyFormat(String var1, Object... var2) { -- String var3 = this.func_135064_c(var1); -+ } -+ -+ /** -+ * Return the StringTranslate singleton instance -+ */ -+ // Spout Start > Public -+ public static StringTranslate getInstance() { -+ return instance; -+ } -+ -+ public static synchronized void func_135063_a(Map par0Map) { -+ instance.languageList.clear(); -+ instance.languageList.putAll(par0Map); -+ } -+ -+ /** -+ * Translate a key to current language. -+ */ -+ public synchronized String translateKey(String par1Str) { -+ return this.func_135064_c(par1Str); -+ } -+ -+ /** -+ * Translate a key to current language applying String.format() -+ */ -+ public synchronized String translateKeyFormat(String par1Str, Object ... par2ArrayOfObj) { -+ String var3 = this.func_135064_c(par1Str); - - try { -- return String.format(var3, var2); -+ return String.format(var3, par2ArrayOfObj); - } catch (IllegalFormatException var5) { - return "Format error: " + var3; - } - } - -- private String func_135064_c(String var1) { -- String var2 = (String)this.d.get(var1); -- return var2 == null ? var1 : var2; -+ private String func_135064_c(String par1Str) { -+ String var2 = (String)this.languageList.get(par1Str); -+ return var2 == null ? par1Str : var2; - } - -- public synchronized boolean isKeyTranslated(String var1) { -- return this.d.containsKey(var1); -+ public synchronized boolean containsTranslateKey(String par1Str) { -+ return this.languageList.containsKey(par1Str); - } - } ---- /dev/null -+++ org/spoutcraft/api/material/CustomItem.java -@@ -1,0 +1,32 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.api.material; -+ -+public interface CustomItem extends Item { -+ public int getCustomId(); -+ -+ public String getFullName(); -+ -+ public String getAddon(); -+ -+ public CustomItem setTexture(String texture); -+ -+ public String getTexture(); -+} ---- /dev/null -+++ com/prupe/mcpatcher/mob/MobOverlay.java -@@ -1,0 +1,132 @@ -+package com.prupe.mcpatcher.mob; -+ -+import com.prupe.mcpatcher.TexturePackAPI; -+import net.minecraft.src.EntityLivingBase; -+import net.minecraft.src.ResourceLocation; -+import net.minecraft.src.Tessellator; -+ -+public class MobOverlay { -+ private static final ResourceLocation MOOSHROOM_OVERLAY = TexturePackAPI.newMCPatcherResourceLocation("mob/cow/mooshroom_overlay.png"); -+ private static final ResourceLocation SNOWMAN_OVERLAY = TexturePackAPI.newMCPatcherResourceLocation("mob/snowman_overlay.png"); -+ private static final double MOO_X0 = -0.45D; -+ private static final double MOO_X1 = 0.45D; -+ private static final double MOO_Y0 = -0.5D; -+ private static final double MOO_Y1 = 0.5D; -+ private static final double MOO_Z0 = -0.45D; -+ private static final double MOO_Z1 = 0.45D; -+ private static final double SNOW_X0 = -0.5D; -+ private static final double SNOW_X1 = 0.5D; -+ private static final double SNOW_Y0 = -0.5D; -+ private static final double SNOW_Y1 = 0.5D; -+ private static final double SNOW_Z0 = -0.5D; -+ private static final double SNOW_Z1 = 0.5D; -+ private static boolean overlayActive; -+ private static int overlayCounter; -+ private static boolean haveMooshroom; -+ private static boolean haveSnowman; -+ public static ResourceLocation snowmanOverlayTexture; -+ -+ static void reset() { -+ haveMooshroom = TexturePackAPI.hasResource(MOOSHROOM_OVERLAY); -+ haveSnowman = TexturePackAPI.hasResource(SNOWMAN_OVERLAY); -+ } -+ -+ public static ResourceLocation setupMooshroom(EntityLivingBase entity, ResourceLocation defaultTexture) { -+ overlayCounter = 0; -+ -+ if (haveMooshroom) { -+ overlayActive = true; -+ return MobRandomizer.randomTexture(entity, MOOSHROOM_OVERLAY); -+ } else { -+ overlayActive = false; -+ return defaultTexture; -+ } -+ } -+ -+ public static boolean renderMooshroomOverlay() { -+ if (overlayActive && overlayCounter < 3) { -+ float tileX0 = (float)overlayCounter / 3.0F; -+ float tileX1 = (float)(++overlayCounter) / 3.0F; -+ Tessellator tessellator = Tessellator.instance; -+ tessellator.startDrawingQuads(); -+ tessellator.addVertexWithUV(-0.45D, 0.5D, -0.45D, (double)tileX0, 0.0D); -+ tessellator.addVertexWithUV(-0.45D, -0.5D, -0.45D, (double)tileX0, 1.0D); -+ tessellator.addVertexWithUV(0.45D, -0.5D, 0.45D, (double)tileX1, 1.0D); -+ tessellator.addVertexWithUV(0.45D, 0.5D, 0.45D, (double)tileX1, 0.0D); -+ tessellator.addVertexWithUV(0.45D, 0.5D, 0.45D, (double)tileX0, 0.0D); -+ tessellator.addVertexWithUV(0.45D, -0.5D, 0.45D, (double)tileX0, 1.0D); -+ tessellator.addVertexWithUV(-0.45D, -0.5D, -0.45D, (double)tileX1, 1.0D); -+ tessellator.addVertexWithUV(-0.45D, 0.5D, -0.45D, (double)tileX1, 0.0D); -+ tessellator.addVertexWithUV(-0.45D, 0.5D, 0.45D, (double)tileX0, 0.0D); -+ tessellator.addVertexWithUV(-0.45D, -0.5D, 0.45D, (double)tileX0, 1.0D); -+ tessellator.addVertexWithUV(0.45D, -0.5D, -0.45D, (double)tileX1, 1.0D); -+ tessellator.addVertexWithUV(0.45D, 0.5D, -0.45D, (double)tileX1, 0.0D); -+ tessellator.addVertexWithUV(0.45D, 0.5D, -0.45D, (double)tileX0, 0.0D); -+ tessellator.addVertexWithUV(0.45D, -0.5D, -0.45D, (double)tileX0, 1.0D); -+ tessellator.addVertexWithUV(-0.45D, -0.5D, 0.45D, (double)tileX1, 1.0D); -+ tessellator.addVertexWithUV(-0.45D, 0.5D, 0.45D, (double)tileX1, 0.0D); -+ tessellator.draw(); -+ } -+ -+ return overlayActive; -+ } -+ -+ public static void finishMooshroom() { -+ overlayCounter = 0; -+ overlayActive = false; -+ } -+ -+ public static boolean setupSnowman(EntityLivingBase entity) { -+ if (haveSnowman) { -+ snowmanOverlayTexture = MobRandomizer.randomTexture(entity, SNOWMAN_OVERLAY); -+ return true; -+ } else { -+ snowmanOverlayTexture = null; -+ return false; -+ } -+ } -+ -+ public static void renderSnowmanOverlay() { -+ Tessellator tessellator = Tessellator.instance; -+ tessellator.startDrawingQuads(); -+ double[] c = new double[4]; -+ getTileCoordinates(0, c); -+ tessellator.addVertexWithUV(0.5D, -0.5D, -0.5D, c[0], c[2]); -+ tessellator.addVertexWithUV(0.5D, -0.5D, 0.5D, c[1], c[2]); -+ tessellator.addVertexWithUV(-0.5D, -0.5D, 0.5D, c[1], c[3]); -+ tessellator.addVertexWithUV(-0.5D, -0.5D, -0.5D, c[0], c[3]); -+ getTileCoordinates(1, c); -+ tessellator.addVertexWithUV(-0.5D, 0.5D, -0.5D, c[0], c[2]); -+ tessellator.addVertexWithUV(-0.5D, 0.5D, 0.5D, c[1], c[2]); -+ tessellator.addVertexWithUV(0.5D, 0.5D, 0.5D, c[1], c[3]); -+ tessellator.addVertexWithUV(0.5D, 0.5D, -0.5D, c[0], c[3]); -+ getTileCoordinates(2, c); -+ tessellator.addVertexWithUV(-0.5D, 0.5D, 0.5D, c[0], c[2]); -+ tessellator.addVertexWithUV(-0.5D, 0.5D, -0.5D, c[1], c[2]); -+ tessellator.addVertexWithUV(-0.5D, -0.5D, -0.5D, c[1], c[3]); -+ tessellator.addVertexWithUV(-0.5D, -0.5D, 0.5D, c[0], c[3]); -+ getTileCoordinates(3, c); -+ tessellator.addVertexWithUV(-0.5D, 0.5D, -0.5D, c[0], c[2]); -+ tessellator.addVertexWithUV(0.5D, 0.5D, -0.5D, c[1], c[2]); -+ tessellator.addVertexWithUV(0.5D, -0.5D, -0.5D, c[1], c[3]); -+ tessellator.addVertexWithUV(-0.5D, -0.5D, -0.5D, c[0], c[3]); -+ getTileCoordinates(4, c); -+ tessellator.addVertexWithUV(0.5D, 0.5D, -0.5D, c[0], c[2]); -+ tessellator.addVertexWithUV(0.5D, 0.5D, 0.5D, c[1], c[2]); -+ tessellator.addVertexWithUV(0.5D, -0.5D, 0.5D, c[1], c[3]); -+ tessellator.addVertexWithUV(0.5D, -0.5D, -0.5D, c[0], c[3]); -+ getTileCoordinates(5, c); -+ tessellator.addVertexWithUV(0.5D, 0.5D, 0.5D, c[0], c[2]); -+ tessellator.addVertexWithUV(-0.5D, 0.5D, 0.5D, c[1], c[2]); -+ tessellator.addVertexWithUV(-0.5D, -0.5D, 0.5D, c[1], c[3]); -+ tessellator.addVertexWithUV(0.5D, -0.5D, 0.5D, c[0], c[3]); -+ tessellator.draw(); -+ } -+ -+ private static void getTileCoordinates(int tileNum, double[] c) { -+ c[0] = (double)(tileNum % 3) / 3.0D; -+ c[1] = c[0] + 0.3333333333333333D; -+ c[2] = (double)(tileNum / 3) / 2.0D; -+ c[3] = c[2] + 0.5D; -+ } -+} ---- net/minecraft/src/IntegratedServer.java -+++ net/minecraft/src/IntegratedServer.java -@@ -5,27 +5,31 @@ - import net.minecraft.server.MinecraftServer; - - public class IntegratedServer extends MinecraftServer { -+ -+ /** The Minecraft instance. */ - private final Minecraft mc; - private final WorldSettings theWorldSettings; - private final ILogAgent serverLogAgent; -+ -+ /** Instance of IntegratedServerListenThread. */ - private IntegratedServerListenThread theServerListeningThread; - private boolean isGamePaused; - private boolean isPublic; - private ThreadLanServerPing lanServerPing; - -- public IntegratedServer(Minecraft var1, String var2, String var3, WorldSettings var4) { -- super(new File(var1.x, "saves")); -- this.serverLogAgent = new LogAgent("Minecraft-Server", " [SERVER]", (new File(var1.x, "output-server.log")).getAbsolutePath()); -- this.setServerOwner(var1.getSession().getUsername()); -- this.setFolderName(var2); -- this.setWorldName(var3); -- this.setDemo(var1.isDemo()); -- this.canCreateBonusChest(var4.isBonusChestEnabled()); -+ public IntegratedServer(Minecraft par1Minecraft, String par2Str, String par3Str, WorldSettings par4WorldSettings) { -+ super(new File(par1Minecraft.mcDataDir, "saves")); -+ this.serverLogAgent = new LogAgent("Minecraft-Server", " [SERVER]", (new File(par1Minecraft.mcDataDir, "output-server.log")).getAbsolutePath()); -+ this.setServerOwner(par1Minecraft.getSession().getUsername()); -+ this.setFolderName(par2Str); -+ this.setWorldName(par3Str); -+ this.setDemo(par1Minecraft.isDemo()); -+ this.canCreateBonusChest(par4WorldSettings.isBonusChestEnabled()); - this.setBuildLimit(256); - this.setConfigurationManager(new IntegratedPlayerList(this)); -- this.mc = var1; -- this.c = var1.getProxy(); -- this.theWorldSettings = var4; -+ this.mc = par1Minecraft; -+ this.serverProxy = par1Minecraft.getProxy(); -+ this.theWorldSettings = par4WorldSettings; - - try { - this.theServerListeningThread = new IntegratedServerListenThread(this); -@@ -34,30 +38,31 @@ - } - } - -- protected void loadAllWorlds(String var1, String var2, long var3, WorldType var5, String var6) { -- this.convertMapIfNeeded(var1); -+ protected void loadAllWorlds(String par1Str, String par2Str, long par3, WorldType par5WorldType, String par6Str) { -+ this.convertMapIfNeeded(par1Str); - this.worldServers = new WorldServer[3]; - this.timeOfLastDimensionTick = new long[this.worldServers.length][100]; -- ISaveHandler var7 = this.getActiveAnvilConverter().getSaveLoader(var1, true); -+ ISaveHandler var7 = this.getActiveAnvilConverter().getSaveLoader(par1Str, true); - -- for(int var8 = 0; var8 < this.worldServers.length; ++var8) { -+ for (int var8 = 0; var8 < this.worldServers.length; ++var8) { - byte var9 = 0; -- if(var8 == 1) { -+ -+ if (var8 == 1) { - var9 = -1; - } - -- if(var8 == 2) { -+ if (var8 == 2) { - var9 = 1; - } - -- if(var8 == 0) { -- if(this.isDemo()) { -- this.worldServers[var8] = new DemoWorldServer(this, var7, var2, var9, this.theProfiler, this.getLogAgent()); -+ if (var8 == 0) { -+ if (this.isDemo()) { -+ this.worldServers[var8] = new DemoWorldServer(this, var7, par2Str, var9, this.theProfiler, this.getLogAgent()); - } else { -- this.worldServers[var8] = new WorldServer(this, var7, var2, var9, this.theWorldSettings, this.theProfiler, this.getLogAgent()); -+ this.worldServers[var8] = new WorldServer(this, var7, par2Str, var9, this.theWorldSettings, this.theProfiler, this.getLogAgent()); - } - } else { -- this.worldServers[var8] = new WorldServerMulti(this, var7, var2, var9, this.theWorldSettings, this.worldServers[0], this.theProfiler, this.getLogAgent()); -+ this.worldServers[var8] = new WorldServerMulti(this, var7, par2Str, var9, this.theWorldSettings, this.worldServers[0], this.theProfiler, this.getLogAgent()); - } - - this.worldServers[var8].addWorldAccess(new WorldManager(this, this.worldServers[var8])); -@@ -68,6 +73,9 @@ - this.initialWorldChunkLoad(); - } - -+ /** -+ * Initialises the server and starts it. -+ */ - protected boolean startServer() throws IOException { - this.serverLogAgent.logInfo("Starting integrated minecraft server version 1.6.4"); - this.setOnlineMode(false); -@@ -76,25 +84,28 @@ - this.setAllowPvp(true); - this.setAllowFlight(true); - this.serverLogAgent.logInfo("Generating keypair"); -- this.setKeyPair(CryptManager.generateKeyPair()); -+ this.setKeyPair(CryptManager.createNewKeyPair()); - this.loadAllWorlds(this.getFolderName(), this.getWorldName(), this.theWorldSettings.getSeed(), this.theWorldSettings.getTerrainType(), this.theWorldSettings.func_82749_j()); - this.setMOTD(this.getServerOwner() + " - " + this.worldServers[0].getWorldInfo().getWorldName()); - return true; - } - -- protected void tick() { -+ /** -+ * Main function called by run() every loop. -+ */ -+ public void tick() { - boolean var1 = this.isGamePaused; - this.isGamePaused = this.theServerListeningThread.isGamePaused(); -- if(!var1 && this.isGamePaused) { -+ -+ if (!var1 && this.isGamePaused) { - this.serverLogAgent.logInfo("Saving and pausing game..."); - this.getConfigurationManager().saveAllPlayerData(); - this.saveAllWorlds(false); - } - -- if(!this.isGamePaused) { -+ if (!this.isGamePaused) { - super.tick(); - } -- - } - - public boolean canStructuresSpawn() { -@@ -105,55 +116,76 @@ - return this.theWorldSettings.getGameType(); - } - -+ /** -+ * Defaults to "1" (Easy) for the dedicated server, defaults to "2" (Normal) on the client. -+ */ - public int getDifficulty() { - return this.mc.gameSettings.difficulty; - } - -+ /** -+ * Defaults to false. -+ */ - public boolean isHardcore() { - return this.theWorldSettings.getHardcoreEnabled(); - } - - protected File getDataDirectory() { -- return this.mc.x; -+ return this.mc.mcDataDir; - } - - public boolean isDedicatedServer() { - return false; - } - -+ /** -+ * Gets the IntergratedServerListenThread. -+ */ - public IntegratedServerListenThread getServerListeningThread() { - return this.theServerListeningThread; - } - -- protected void finalTick(CrashReport var1) { -- this.mc.crashed(var1); -- } -- -- public CrashReport addServerInfoToCrashReport(CrashReport var1) { -- var1 = super.addServerInfoToCrashReport(var1); -- var1.getCategory().addCrashSectionCallable("Type", new CallableType3(this)); -- var1.getCategory().addCrashSectionCallable("Is Modded", new CallableIsModded(this)); -- return var1; -- } -- -- public void addServerStatsToSnooper(PlayerUsageSnooper var1) { -- super.addServerStatsToSnooper(var1); -- var1.addData("snooper_partner", this.mc.getPlayerUsageSnooper().getUniqueID()); -- } -- -+ /** -+ * Called on exit from the main run() loop. -+ */ -+ protected void finalTick(CrashReport par1CrashReport) { -+ this.mc.crashed(par1CrashReport); -+ } -+ -+ /** -+ * Adds the server info, including from theWorldServer, to the crash report. -+ */ -+ public CrashReport addServerInfoToCrashReport(CrashReport par1CrashReport) { -+ par1CrashReport = super.addServerInfoToCrashReport(par1CrashReport); -+ par1CrashReport.getCategory().addCrashSectionCallable("Type", new CallableType3(this)); -+ par1CrashReport.getCategory().addCrashSectionCallable("Is Modded", new CallableIsModded(this)); -+ return par1CrashReport; -+ } -+ -+ public void addServerStatsToSnooper(PlayerUsageSnooper par1PlayerUsageSnooper) { -+ super.addServerStatsToSnooper(par1PlayerUsageSnooper); -+ par1PlayerUsageSnooper.addData("snooper_partner", this.mc.getPlayerUsageSnooper().getUniqueID()); -+ } -+ -+ /** -+ * Returns whether snooping is enabled or not. -+ */ - public boolean isSnooperEnabled() { - return Minecraft.getMinecraft().isSnooperEnabled(); - } - -- public String shareToLAN(EnumGameType var1, boolean var2) { -+ /** -+ * On dedicated does nothing. On integrated, sets commandsAllowedForAll, gameType and allows external connections. -+ */ -+ public String shareToLAN(EnumGameType par1EnumGameType, boolean par2) { - try { - String var3 = this.theServerListeningThread.func_71755_c(); - this.getLogAgent().logInfo("Started on " + var3); - this.isPublic = true; - this.lanServerPing = new ThreadLanServerPing(this.getMOTD(), var3); - this.lanServerPing.start(); -- this.getConfigurationManager().setGameType(var1); -- this.getConfigurationManager().setCommandsAllowedForAll(var2); -+ this.getConfigurationManager().setGameType(par1EnumGameType); -+ this.getConfigurationManager().setCommandsAllowedForAll(par2); - return var3; - } catch (IOException var4) { - return null; -@@ -164,32 +196,47 @@ - return this.serverLogAgent; - } - -+ /** -+ * Saves all necessary data as preparation for stopping the server. -+ */ - public void stopServer() { - super.stopServer(); -- if(this.lanServerPing != null) { -+ -+ if (this.lanServerPing != null) { - this.lanServerPing.interrupt(); - this.lanServerPing = null; - } -- - } - -+ /** -+ * Sets the serverRunning variable to false, in order to get the server to shut down. -+ */ - public void initiateShutdown() { - super.initiateShutdown(); -- if(this.lanServerPing != null) { -+ -+ if (this.lanServerPing != null) { - this.lanServerPing.interrupt(); - this.lanServerPing = null; - } -- - } - -+ /** -+ * Returns true if this integrated server is open to LAN -+ */ - public boolean getPublic() { - return this.isPublic; - } - -- public void setGameType(EnumGameType var1) { -- this.getConfigurationManager().setGameType(var1); -+ /** -+ * Sets the game type for all worlds. -+ */ -+ public void setGameType(EnumGameType par1EnumGameType) { -+ this.getConfigurationManager().setGameType(par1EnumGameType); - } - -+ /** -+ * Return whether command blocks are enabled. -+ */ - public boolean isCommandBlockEnabled() { - return true; - } ---- net/minecraft/src/CallableLevelGamemode.java -+++ net/minecraft/src/CallableLevelGamemode.java -@@ -5,12 +5,12 @@ - class CallableLevelGamemode implements Callable { - final WorldInfo worldInfoInstance; - -- CallableLevelGamemode(WorldInfo var1) { -- this.worldInfoInstance = var1; -+ CallableLevelGamemode(WorldInfo par1WorldInfo) { -+ this.worldInfoInstance = par1WorldInfo; - } - - public String callLevelGameModeInfo() { -- return String.format("Game mode: %s (ID %d). Hardcore: %b. Cheats: %b", new Object[]{WorldInfo.getGameType(this.worldInfoInstance).getName(), Integer.valueOf(WorldInfo.getGameType(this.worldInfoInstance).getID()), Boolean.valueOf(WorldInfo.func_85117_p(this.worldInfoInstance)), Boolean.valueOf(WorldInfo.func_85131_q(this.worldInfoInstance))}); -+ return String.format("Game mode: %s (ID %d). Hardcore: %b. Cheats: %b", new Object[] {WorldInfo.getGameType(this.worldInfoInstance).getName(), Integer.valueOf(WorldInfo.getGameType(this.worldInfoInstance).getID()), Boolean.valueOf(WorldInfo.func_85117_p(this.worldInfoInstance)), Boolean.valueOf(WorldInfo.func_85131_q(this.worldInfoInstance))}); - } - - public Object call() { ---- /dev/null -+++ org/spoutcraft/api/NotImplemented.java -@@ -1,0 +1,34 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.api; -+ -+import java.lang.annotation.Documented; -+import java.lang.annotation.Retention; -+import java.lang.annotation.RetentionPolicy; -+ -+@Documented -+@Retention(value = RetentionPolicy.RUNTIME) -+public @interface NotImplemented { -+ public String author() default "SpoutDev"; -+ -+ public String version() default "1.0"; -+ -+ public String shortDescription() default "Indicates that the function or event is implemented into Spoutcraft currently"; -+} ---- net/minecraft/src/EntityMinecartTNT.java -+++ net/minecraft/src/EntityMinecartTNT.java -@@ -3,12 +3,12 @@ - public class EntityMinecartTNT extends EntityMinecart { - private int minecartTNTFuse = -1; - -- public EntityMinecartTNT(World var1) { -- super(var1); -+ public EntityMinecartTNT(World par1World) { -+ super(par1World); - } - -- public EntityMinecartTNT(World var1, double var2, double var4, double var6) { -- super(var1, var2, var4, var6); -+ public EntityMinecartTNT(World par1World, double par2, double par4, double par6) { -+ super(par1World, par2, par4, par6); - } - - public int getMinecartType() { -@@ -19,110 +19,137 @@ - return Block.tnt; - } - -+ /** -+ * Called to update the entity's position/logic. -+ */ - public void onUpdate() { - super.onUpdate(); -- if(this.minecartTNTFuse > 0) { -+ -+ if (this.minecartTNTFuse > 0) { - --this.minecartTNTFuse; - this.worldObj.spawnParticle("smoke", this.posX, this.posY + 0.5D, this.posZ, 0.0D, 0.0D, 0.0D); -- } else if(this.minecartTNTFuse == 0) { -+ } else if (this.minecartTNTFuse == 0) { - this.explodeCart(this.motionX * this.motionX + this.motionZ * this.motionZ); - } - -- if(this.isCollidedHorizontally) { -+ if (this.isCollidedHorizontally) { - double var1 = this.motionX * this.motionX + this.motionZ * this.motionZ; -- if(var1 >= (double)0.01F) { -+ -+ if (var1 >= 0.009999999776482582D) { - this.explodeCart(var1); - } - } -- - } - -- public void killMinecart(DamageSource var1) { -- super.killMinecart(var1); -+ public void killMinecart(DamageSource par1DamageSource) { -+ super.killMinecart(par1DamageSource); - double var2 = this.motionX * this.motionX + this.motionZ * this.motionZ; -- if(!var1.isExplosion()) { -+ -+ if (!par1DamageSource.isExplosion()) { - this.entityDropItem(new ItemStack(Block.tnt, 1), 0.0F); - } - -- if(var1.isFireDamage() || var1.isExplosion() || var2 >= (double)0.01F) { -+ if (par1DamageSource.isFireDamage() || par1DamageSource.isExplosion() || var2 >= 0.009999999776482582D) { - this.explodeCart(var2); - } -- - } - -- protected void explodeCart(double var1) { -- if(!this.worldObj.isRemote) { -- double var3 = Math.sqrt(var1); -- if(var3 > 5.0D) { -+ /** -+ * Makes the minecart explode. -+ */ -+ protected void explodeCart(double par1) { -+ if (!this.worldObj.isRemote) { -+ double var3 = Math.sqrt(par1); -+ -+ if (var3 > 5.0D) { - var3 = 5.0D; - } - -- this.worldObj.createExplosion(this, this.posX, this.posY, this.posZ, (float)(4.0D + this.ab.nextDouble() * 1.5D * var3), true); -+ this.worldObj.createExplosion(this, this.posX, this.posY, this.posZ, (float)(4.0D + this.rand.nextDouble() * 1.5D * var3), true); - this.setDead(); - } -- - } - -- protected void fall(float var1) { -- if(var1 >= 3.0F) { -- float var2 = var1 / 10.0F; -+ /** -+ * Called when the mob is falling. Calculates and applies fall damage. -+ */ -+ protected void fall(float par1) { -+ if (par1 >= 3.0F) { -+ float var2 = par1 / 10.0F; - this.explodeCart((double)(var2 * var2)); - } - -- super.fall(var1); -+ super.fall(par1); - } - -- public void onActivatorRailPass(int var1, int var2, int var3, boolean var4) { -- if(var4 && this.minecartTNTFuse < 0) { -+ /** -+ * Called every tick the minecart is on an activator rail. -+ */ -+ public void onActivatorRailPass(int par1, int par2, int par3, boolean par4) { -+ if (par4 && this.minecartTNTFuse < 0) { - this.ignite(); - } -- - } - -- public void handleHealthUpdate(byte var1) { -- if(var1 == 10) { -+ public void handleHealthUpdate(byte par1) { -+ if (par1 == 10) { - this.ignite(); - } else { -- super.handleHealthUpdate(var1); -+ super.handleHealthUpdate(par1); - } -- - } - -+ /** -+ * Ignites this TNT cart. -+ */ - public void ignite() { - this.minecartTNTFuse = 80; -- if(!this.worldObj.isRemote) { -+ -+ if (!this.worldObj.isRemote) { - this.worldObj.setEntityState(this, (byte)10); - this.worldObj.playSoundAtEntity(this, "random.fuse", 1.0F, 1.0F); - } -- - } - - public int func_94104_d() { - return this.minecartTNTFuse; - } - -+ /** -+ * Returns true if the TNT minecart is ignited. -+ */ - public boolean isIgnited() { - return this.minecartTNTFuse > -1; - } - -- public float getBlockExplosionResistance(Explosion var1, World var2, int var3, int var4, int var5, Block var6) { -- return !this.isIgnited() || !BlockRailBase.isRailBlock(var6.blockID) && !BlockRailBase.isRailBlockAt(var2, var3, var4 + 1, var5) ? super.getBlockExplosionResistance(var1, var2, var3, var4, var5, var6) : 0.0F; -- } -- -- public boolean shouldExplodeBlock(Explosion var1, World var2, int var3, int var4, int var5, int var6, float var7) { -- return !this.isIgnited() || !BlockRailBase.isRailBlock(var6) && !BlockRailBase.isRailBlockAt(var2, var3, var4 + 1, var5) ? super.shouldExplodeBlock(var1, var2, var3, var4, var5, var6, var7) : false; -- } -- -- protected void readEntityFromNBT(NBTTagCompound var1) { -- super.readEntityFromNBT(var1); -- if(var1.hasKey("TNTFuse")) { -- this.minecartTNTFuse = var1.getInteger("TNTFuse"); -+ /** -+ * Gets a block's resistance to this entity's explosion. Used to make rails immune to TNT minecarts' explosions and -+ * Wither skulls more destructive. -+ */ -+ public float getBlockExplosionResistance(Explosion par1Explosion, World par2World, int par3, int par4, int par5, Block par6Block) { -+ return this.isIgnited() && (BlockRailBase.isRailBlock(par6Block.blockID) || BlockRailBase.isRailBlockAt(par2World, par3, par4 + 1, par5)) ? 0.0F : super.getBlockExplosionResistance(par1Explosion, par2World, par3, par4, par5, par6Block); -+ } -+ -+ public boolean shouldExplodeBlock(Explosion par1Explosion, World par2World, int par3, int par4, int par5, int par6, float par7) { -+ return this.isIgnited() && (BlockRailBase.isRailBlock(par6) || BlockRailBase.isRailBlockAt(par2World, par3, par4 + 1, par5)) ? false : super.shouldExplodeBlock(par1Explosion, par2World, par3, par4, par5, par6, par7); -+ } -+ -+ /** -+ * (abstract) Protected helper method to read subclass entity data from NBT. -+ */ -+ protected void readEntityFromNBT(NBTTagCompound par1NBTTagCompound) { -+ super.readEntityFromNBT(par1NBTTagCompound); -+ -+ if (par1NBTTagCompound.hasKey("TNTFuse")) { -+ this.minecartTNTFuse = par1NBTTagCompound.getInteger("TNTFuse"); - } -- - } - -- protected void writeEntityToNBT(NBTTagCompound var1) { -- super.writeEntityToNBT(var1); -- var1.setInteger("TNTFuse", this.minecartTNTFuse); -+ /** -+ * (abstract) Protected helper method to write subclass entity data to NBT. -+ */ -+ protected void writeEntityToNBT(NBTTagCompound par1NBTTagCompound) { -+ super.writeEntityToNBT(par1NBTTagCompound); -+ par1NBTTagCompound.setInteger("TNTFuse", this.minecartTNTFuse); - } - } ---- net/minecraft/src/Packet250CustomPayload.java -+++ net/minecraft/src/Packet250CustomPayload.java -@@ -5,49 +5,67 @@ - import java.io.IOException; - - public class Packet250CustomPayload extends Packet { -- public String a; -+ -+ /** Name of the 'channel' used to send data */ -+ public String channel; -+ -+ /** Length of the data to be read */ - public int length; -+ -+ /** Any data */ - public byte[] data; - -- public Packet250CustomPayload() { -- } -- -- public Packet250CustomPayload(String var1, byte[] var2) { -- this.a = var1; -- this.data = var2; -- if(var2 != null) { -- this.length = var2.length; -- if(this.length > Short.MAX_VALUE) { -+ public Packet250CustomPayload() {} -+ -+ public Packet250CustomPayload(String par1Str, byte[] par2ArrayOfByte) { -+ this.channel = par1Str; -+ this.data = par2ArrayOfByte; -+ -+ if (par2ArrayOfByte != null) { -+ this.length = par2ArrayOfByte.length; -+ -+ if (this.length > 32767) { - throw new IllegalArgumentException("Payload may not be larger than 32k"); - } - } -- - } - -- public void readPacketData(DataInput var1) throws IOException { -- this.a = readString(var1, 20); -- this.length = var1.readShort(); -- if(this.length > 0 && this.length < Short.MAX_VALUE) { -+ /** -+ * Abstract. Reads the raw packet data from the data stream. -+ */ -+ public void readPacketData(DataInput par1DataInput) throws IOException { -+ this.channel = readString(par1DataInput, 20); -+ this.length = par1DataInput.readShort(); -+ -+ if (this.length > 0 && this.length < 32767) { - this.data = new byte[this.length]; -- var1.readFully(this.data); -- } -- -- } -- -- public void writePacketData(DataOutput var1) throws IOException { -- writeString(this.a, var1); -- var1.writeShort((short)this.length); -- if(this.data != null) { -- var1.write(this.data); -- } -- -- } -- -- public void processPacket(NetHandler var1) { -- var1.handleCustomPayload(this); -- } -- -+ par1DataInput.readFully(this.data); -+ } -+ } -+ -+ /** -+ * Abstract. Writes the raw packet data to the data stream. -+ */ -+ public void writePacketData(DataOutput par1DataOutput) throws IOException { -+ writeString(this.channel, par1DataOutput); -+ par1DataOutput.writeShort((short)this.length); -+ -+ if (this.data != null) { -+ par1DataOutput.write(this.data); -+ } -+ } -+ -+ /** -+ * Passes this Packet on to the NetHandler for processing. -+ */ -+ public void processPacket(NetHandler par1NetHandler) { -+ par1NetHandler.handleCustomPayload(this); -+ } -+ -+ /** -+ * Abstract. Return the size of the packet (not counting the header). -+ */ - public int getPacketSize() { -- return 2 + this.a.length() * 2 + 2 + this.length; -+ return 2 + this.channel.length() * 2 + 2 + this.length; - } - } ---- /dev/null -+++ org/spoutcraft/client/gui/about/ImageSection.java -@@ -1,0 +1,136 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.client.gui.about; -+ -+import java.util.HashMap; -+import java.util.LinkedList; -+import java.util.List; -+ -+import org.lwjgl.Sys; -+ -+import org.spoutcraft.api.gui.Color; -+import org.spoutcraft.api.gui.GenericButton; -+import org.spoutcraft.api.gui.GenericLabel; -+import org.spoutcraft.api.gui.GenericTexture; -+import org.spoutcraft.api.gui.RenderPriority; -+import org.spoutcraft.api.gui.Widget; -+ -+public class ImageSection extends Section { -+ private GuiNewAbout screen; -+ private List images = new LinkedList(); -+ private int height = 0; -+ -+ private class Image { -+ public GenericTexture texture; -+ public String url = ""; -+ public GenericLabel description = null; -+ public GenericButton button = new GenericButton() { -+ { -+ setPriority(RenderPriority.Highest); -+ } -+ -+ @Override -+ public void render() { -+ // Don't render ;) -+ } -+ -+ @Override -+ public void onButtonClick() { -+ Sys.openURL(url); -+ super.onButtonClick(); -+ } -+ }; -+ } -+ -+ @Override -+ public List getWidgets() { -+ List ret = super.getWidgets(); -+ for (Image img:images) { -+ ret.add(img.texture); -+ ret.add(img.button); -+ if (img.description != null) { -+ ret.add(img.description); -+ } -+ } -+ return ret; -+ } -+ -+ @Override -+ public int getHeight() { -+ return super.getHeight() + 5 + height; -+ } -+ -+ @Override -+ public void update() { -+ height = 0; -+ int x = getX(); -+ int y = getY() + super.getHeight() + 5; -+ for (Image img:images) { -+ int th = img.texture.getOriginalHeight(); -+ int tw = img.texture.getOriginalWidth(); -+ int theight = (int) (getWidth() * ((float) th / (float) tw)); -+ img.texture.setGeometry(x, y, getWidth(), theight); -+ img.button.setGeometry(x, y, getWidth(), theight); -+ int h = theight + 5; -+ -+ if (img.description != null) { -+ img.description.setX(x); -+ img.description.setY(y + theight + 5); -+ img.description.setWidth(getWidth()); -+ img.description.setWrapLines(true); -+ img.description.recalculateLines(); -+ h += 5 + img.description.getHeight(); -+ } -+ -+ y += h; -+ height += h; -+ } -+ super.update(); -+ } -+ -+ @SuppressWarnings("unchecked") -+ @Override -+ public void init(final GuiNewAbout screen, String title, Object yaml) { -+ setTitle(title); -+ this.screen = screen; -+ -+ HashMap images = (HashMap) yaml; -+ for (Object img:images.values()) { -+ HashMap attr = (HashMap) img; -+ Image image = new Image(); -+ image.texture = new GenericTexture(attr.get("image")); -+ image.texture.setFinishDelegate(new Runnable() { -+ @Override -+ public void run() { -+ screen.update(); -+ } -+ }); -+ image.url = attr.get("website"); -+ image.texture.setTooltip(attr.get("tooltip")); -+ if (attr.containsKey("description") && !attr.get("description").isEmpty()) { -+ image.description = new GenericLabel(attr.get("description")); -+ image.description.setTextColor(new Color(0xaaaaaa)); -+ } -+ this.images.add(image); -+ -+ // TODO Description -+ } -+ } -+} ---- net/minecraft/src/GuiContainerCreative.java -+++ net/minecraft/src/GuiContainerCreative.java -@@ -4,117 +4,147 @@ - import java.util.Iterator; - import java.util.List; - import java.util.Map; -+ -+import net.minecraft.src.Minecraft; -+import net.minecraft.src.ResourceLocation; -+ - import org.lwjgl.input.Keyboard; - import org.lwjgl.input.Mouse; - import org.lwjgl.opengl.GL11; - import org.lwjgl.opengl.GL12; - -+import org.spoutcraft.api.material.CustomItem; -+import org.spoutcraft.api.material.MaterialData; -+ - public class GuiContainerCreative extends InventoryEffectRenderer { - private static final ResourceLocation field_110424_t = new ResourceLocation("textures/gui/container/creative_inventory/tabs.png"); - private static InventoryBasic inventory = new InventoryBasic("tmp", true, 45); -+ -+ /** Currently selected creative inventory tab index. */ - private static int selectedTabIndex = CreativeTabs.tabBlock.getTabIndex(); -+ -+ /** Amount scrolled in Creative mode inventory (0 = top, 1 = bottom) */ - private float currentScroll; -+ -+ /** True if the scrollbar is being dragged */ - private boolean isScrolling; -+ -+ /** -+ * True if the left mouse button was held down last time drawScreen was called. -+ */ - private boolean wasClicking; - private GuiTextField searchField; -- private List A; -+ -+ /** -+ * Used to back up the ContainerCreative's inventory slots before filling it with the player's inventory slots for the -+ * inventory tab. -+ */ -+ private List backupContainerSlots; - private Slot field_74235_v; - private boolean field_74234_w; - private CreativeCrafting field_82324_x; - -- public GuiContainerCreative(EntityPlayer var1) { -- super(new ContainerCreative(var1)); -- var1.openContainer = this.inventorySlots; -+ public GuiContainerCreative(EntityPlayer par1EntityPlayer) { -+ super(new ContainerCreative(par1EntityPlayer)); -+ par1EntityPlayer.openContainer = this.inventorySlots; - this.allowUserInput = true; -- var1.addStat(AchievementList.openInventory, 1); -+ par1EntityPlayer.addStat(AchievementList.openInventory, 1); - this.ySize = 136; - this.xSize = 195; - } - -+ /** -+ * Called from the main game loop to update the screen. -+ */ - public void updateScreen() { -- if(!this.mc.playerController.isInCreativeMode()) { -+ if (!this.mc.playerController.isInCreativeMode()) { - this.mc.displayGuiScreen(new GuiInventory(this.mc.thePlayer)); - } -- - } - -- protected void handleMouseClick(Slot var1, int var2, int var3, int var4) { -+ protected void handleMouseClick(Slot par1Slot, int par2, int par3, int par4) { - this.field_74234_w = true; -- boolean var5 = var4 == 1; -- var4 = var2 == -999 && var4 == 0 ? 4 : var4; -+ boolean var5 = par4 == 1; -+ par4 = par2 == -999 && par4 == 0 ? 4 : par4; - ItemStack var7; -- InventoryPlayer var11; -- if(var1 == null && selectedTabIndex != CreativeTabs.tabInventory.getTabIndex() && var4 != 5) { -- var11 = this.mc.thePlayer.inventory; -- if(var11.getItemStack() != null) { -- if(var3 == 0) { -- this.mc.thePlayer.dropPlayerItem(var11.getItemStack()); -- this.mc.playerController.func_78752_a(var11.getItemStack()); -- var11.setItemStack((ItemStack)null); -+ InventoryPlayer var10; -+ -+ if (par1Slot == null && selectedTabIndex != CreativeTabs.tabInventory.getTabIndex() && par4 != 5) { -+ var10 = this.mc.thePlayer.inventory; -+ -+ if (var10.getItemStack() != null) { -+ if (par3 == 0) { -+ this.mc.thePlayer.dropPlayerItem(var10.getItemStack()); -+ this.mc.playerController.func_78752_a(var10.getItemStack()); -+ var10.setItemStack((ItemStack)null); - } - -- if(var3 == 1) { -- var7 = var11.getItemStack().splitStack(1); -+ if (par3 == 1) { -+ var7 = var10.getItemStack().splitStack(1); - this.mc.thePlayer.dropPlayerItem(var7); - this.mc.playerController.func_78752_a(var7); -- if(var11.getItemStack().stackSize == 0) { -- var11.setItemStack((ItemStack)null); -+ -+ if (var10.getItemStack().stackSize == 0) { -+ var10.setItemStack((ItemStack)null); - } - } - } - } else { -- int var10; -- if(var1 == this.field_74235_v && var5) { -- for(var10 = 0; var10 < this.mc.thePlayer.inventoryContainer.getInventory().size(); ++var10) { -- this.mc.playerController.sendSlotPacket((ItemStack)null, var10); -+ int var11; -+ -+ if (par1Slot == this.field_74235_v && var5) { -+ for (var11 = 0; var11 < this.mc.thePlayer.inventoryContainer.getInventory().size(); ++var11) { -+ this.mc.playerController.sendSlotPacket((ItemStack)null, var11); - } - } else { - ItemStack var6; -- if(selectedTabIndex == CreativeTabs.tabInventory.getTabIndex()) { -- if(var1 == this.field_74235_v) { -+ -+ if (selectedTabIndex == CreativeTabs.tabInventory.getTabIndex()) { -+ if (par1Slot == this.field_74235_v) { - this.mc.thePlayer.inventory.setItemStack((ItemStack)null); -- } else if(var4 == 4 && var1 != null && var1.getHasStack()) { -- var6 = var1.decrStackSize(var3 == 0 ? 1 : var1.getStack().getMaxStackSize()); -+ } else if (par4 == 4 && par1Slot != null && par1Slot.getHasStack()) { -+ var6 = par1Slot.decrStackSize(par3 == 0 ? 1 : par1Slot.getStack().getMaxStackSize()); - this.mc.thePlayer.dropPlayerItem(var6); - this.mc.playerController.func_78752_a(var6); -- } else if(var4 == 4 && this.mc.thePlayer.inventory.getItemStack() != null) { -+ } else if (par4 == 4 && this.mc.thePlayer.inventory.getItemStack() != null) { - this.mc.thePlayer.dropPlayerItem(this.mc.thePlayer.inventory.getItemStack()); - this.mc.playerController.func_78752_a(this.mc.thePlayer.inventory.getItemStack()); - this.mc.thePlayer.inventory.setItemStack((ItemStack)null); - } else { -- this.mc.thePlayer.inventoryContainer.slotClick(var1 == null ? var2 : SlotCreativeInventory.func_75240_a((SlotCreativeInventory)var1).slotNumber, var3, var4, this.mc.thePlayer); -+ this.mc.thePlayer.inventoryContainer.slotClick(par1Slot == null ? par2 : SlotCreativeInventory.func_75240_a((SlotCreativeInventory)par1Slot).slotNumber, par3, par4, this.mc.thePlayer); - this.mc.thePlayer.inventoryContainer.detectAndSendChanges(); - } -- } else if(var4 != 5 && var1.inventory == inventory) { -- var11 = this.mc.thePlayer.inventory; -- var7 = var11.getItemStack(); -- ItemStack var8 = var1.getStack(); -+ } else if (par4 != 5 && par1Slot.inventory == inventory) { -+ var10 = this.mc.thePlayer.inventory; -+ var7 = var10.getItemStack(); -+ ItemStack var8 = par1Slot.getStack(); - ItemStack var9; -- if(var4 == 2) { -- if(var8 != null && var3 >= 0 && var3 < 9) { -+ -+ if (par4 == 2) { -+ if (var8 != null && par3 >= 0 && par3 < 9) { - var9 = var8.copy(); - var9.stackSize = var9.getMaxStackSize(); -- this.mc.thePlayer.inventory.setInventorySlotContents(var3, var9); -+ this.mc.thePlayer.inventory.setInventorySlotContents(par3, var9); - this.mc.thePlayer.inventoryContainer.detectAndSendChanges(); - } - - return; - } - -- if(var4 == 3) { -- if(var11.getItemStack() == null && var1.getHasStack()) { -- var9 = var1.getStack().copy(); -+ if (par4 == 3) { -+ if (var10.getItemStack() == null && par1Slot.getHasStack()) { -+ var9 = par1Slot.getStack().copy(); - var9.stackSize = var9.getMaxStackSize(); -- var11.setItemStack(var9); -+ var10.setItemStack(var9); - } - - return; - } - -- if(var4 == 4) { -- if(var8 != null) { -+ if (par4 == 4) { -+ if (var8 != null) { - var9 = var8.copy(); -- var9.stackSize = var3 == 0 ? 1 : var9.getMaxStackSize(); -+ var9.stackSize = par3 == 0 ? 1 : var9.getMaxStackSize(); - this.mc.thePlayer.dropPlayerItem(var9); - this.mc.playerController.func_78752_a(var9); - } -@@ -122,47 +152,51 @@ - return; - } - -- if(var7 != null && var8 != null && var7.isItemEqual(var8)) { -- if(var3 == 0) { -- if(var5) { -+ if (var7 != null && var8 != null && var7.isItemEqual(var8)) { -+ if (par3 == 0) { -+ if (var5) { - var7.stackSize = var7.getMaxStackSize(); -- } else if(var7.stackSize < var7.getMaxStackSize()) { -+ } else if (var7.stackSize < var7.getMaxStackSize()) { - ++var7.stackSize; - } -- } else if(var7.stackSize <= 1) { -- var11.setItemStack((ItemStack)null); -+ } else if (var7.stackSize <= 1) { -+ var10.setItemStack((ItemStack)null); - } else { - --var7.stackSize; - } -- } else if(var8 != null && var7 == null) { -- var11.setItemStack(ItemStack.copyItemStack(var8)); -- var7 = var11.getItemStack(); -- if(var5) { -+ } else if (var8 != null && var7 == null) { -+ var10.setItemStack(ItemStack.copyItemStack(var8)); -+ var7 = var10.getItemStack(); -+ -+ if (var5) { - var7.stackSize = var7.getMaxStackSize(); - } - } else { -- var11.setItemStack((ItemStack)null); -+ var10.setItemStack((ItemStack)null); - } - } else { -- this.inventorySlots.slotClick(var1 == null ? var2 : var1.slotNumber, var3, var4, this.mc.thePlayer); -- if(Container.func_94532_c(var3) == 2) { -- for(var10 = 0; var10 < 9; ++var10) { -- this.mc.playerController.sendSlotPacket(this.inventorySlots.getSlot(45 + var10).getStack(), 36 + var10); -+ this.inventorySlots.slotClick(par1Slot == null ? par2 : par1Slot.slotNumber, par3, par4, this.mc.thePlayer); -+ -+ if (Container.func_94532_c(par3) == 2) { -+ for (var11 = 0; var11 < 9; ++var11) { -+ this.mc.playerController.sendSlotPacket(this.inventorySlots.getSlot(45 + var11).getStack(), 36 + var11); - } -- } else if(var1 != null) { -- var6 = this.inventorySlots.getSlot(var1.slotNumber).getStack(); -- this.mc.playerController.sendSlotPacket(var6, var1.slotNumber - this.inventorySlots.c.size() + 9 + 36); -+ } else if (par1Slot != null) { -+ var6 = this.inventorySlots.getSlot(par1Slot.slotNumber).getStack(); -+ this.mc.playerController.sendSlotPacket(var6, par1Slot.slotNumber - this.inventorySlots.inventorySlots.size() + 9 + 36); - } - } - } - } -- - } - -+ /** -+ * Adds the buttons (and other controls) to the screen in question. -+ */ - public void initGui() { -- if(this.mc.playerController.isInCreativeMode()) { -+ if (this.mc.playerController.isInCreativeMode()) { - super.initGui(); -- this.i.clear(); -+ this.buttonList.clear(); - Keyboard.enableRepeatEvents(true); - this.searchField = new GuiTextField(this.fontRenderer, this.guiLeft + 82, this.guiTop + 6, 89, this.fontRenderer.FONT_HEIGHT); - this.searchField.setMaxStringLength(15); -@@ -173,89 +207,101 @@ - selectedTabIndex = -1; - this.setCurrentCreativeTab(CreativeTabs.creativeTabArray[var1]); - this.field_82324_x = new CreativeCrafting(this.mc); -- this.mc.thePlayer.inventoryContainer.onCraftGuiOpened(this.field_82324_x); -+ this.mc.thePlayer.inventoryContainer.addCraftingToCrafters(this.field_82324_x); - } else { - this.mc.displayGuiScreen(new GuiInventory(this.mc.thePlayer)); - } -- - } - -+ /** -+ * Called when the screen is unloaded. Used to disable keyboard repeat events -+ */ - public void onGuiClosed() { - super.onGuiClosed(); -- if(this.mc.thePlayer != null && this.mc.thePlayer.inventory != null) { -+ -+ if (this.mc.thePlayer != null && this.mc.thePlayer.inventory != null) { - this.mc.thePlayer.inventoryContainer.removeCraftingFromCrafters(this.field_82324_x); - } - - Keyboard.enableRepeatEvents(false); - } - -- protected void keyTyped(char var1, int var2) { -- if(selectedTabIndex != CreativeTabs.tabAllSearch.getTabIndex()) { -- if(GameSettings.isKeyDown(this.mc.gameSettings.keyBindChat)) { -+ /** -+ * Fired when a key is typed. This is the equivalent of KeyListener.keyTyped(KeyEvent e). -+ */ -+ protected void keyTyped(char par1, int par2) { -+ if (selectedTabIndex != CreativeTabs.tabAllSearch.getTabIndex()) { -+ if (GameSettings.isKeyDown(this.mc.gameSettings.keyBindChat)) { - this.setCurrentCreativeTab(CreativeTabs.tabAllSearch); - } else { -- super.keyTyped(var1, var2); -+ super.keyTyped(par1, par2); - } -- - } else { -- if(this.field_74234_w) { -+ if (this.field_74234_w) { - this.field_74234_w = false; - this.searchField.setText(""); - } - -- if(!this.checkHotbarKeys(var2)) { -- if(this.searchField.textboxKeyTyped(var1, var2)) { -+ if (!this.checkHotbarKeys(par2)) { -+ if (this.searchField.textboxKeyTyped(par1, par2)) { - this.updateCreativeSearch(); - } else { -- super.keyTyped(var1, var2); -+ super.keyTyped(par1, par2); - } -- - } - } - } - - private void updateCreativeSearch() { - ContainerCreative var1 = (ContainerCreative)this.inventorySlots; -- var1.a.clear(); -+ var1.itemList.clear(); - Item[] var2 = Item.itemsList; - int var3 = var2.length; -- - int var4; -- for(var4 = 0; var4 < var3; ++var4) { -+ -+ for (var4 = 0; var4 < var3; ++var4) { - Item var5 = var2[var4]; -- if(var5 != null && var5.getCreativeTab() != null) { -- var5.getSubItems(var5.itemID, (CreativeTabs)null, var1.a); -+ -+ if (var5 != null && var5.getCreativeTab() != null) { -+ var5.getSubItems(var5.itemID, (CreativeTabs)null, var1.itemList); - } - } - - Enchantment[] var8 = Enchantment.enchantmentsList; - var3 = var8.length; - -- for(var4 = 0; var4 < var3; ++var4) { -- Enchantment var11 = var8[var4]; -- if(var11 != null && var11.type != null) { -- Item.enchantedBook.func_92113_a(var11, var1.a); -+ for (var4 = 0; var4 < var3; ++var4) { -+ Enchantment var12 = var8[var4]; -+ -+ if (var12 != null && var12.type != null) { -+ Item.enchantedBook.func_92113_a(var12, var1.itemList); - } - } - -- Iterator var9 = var1.a.iterator(); -+ Iterator var9 = var1.itemList.iterator(); - String var10 = this.searchField.getText().toLowerCase(); - -- while(var9.hasNext()) { -- ItemStack var12 = (ItemStack)var9.next(); -+ while (var9.hasNext()) { -+ ItemStack var11 = (ItemStack)var9.next(); - boolean var13 = false; -- Iterator var6 = var12.getTooltip(this.mc.thePlayer, this.mc.gameSettings.advancedItemTooltips).iterator(); -- -- while(var6.hasNext()) { -- String var7 = (String)var6.next(); -- if(var7.toLowerCase().contains(var10)) { -+ Iterator var6 = var11.getTooltip(this.mc.thePlayer, this.mc.gameSettings.advancedItemTooltips).iterator(); -+ -+ while (true) { -+ if (var6.hasNext()) { -+ String var7 = (String)var6.next(); -+ -+ if (!var7.toLowerCase().contains(var10)) { -+ continue; -+ } -+ - var13 = true; -- break; -- } -- } -- -- if(!var13) { -- var9.remove(); -+ } -+ -+ if (!var13) { -+ var9.remove(); -+ } -+ -+ break; - } - } - -@@ -263,91 +309,116 @@ - var1.scrollTo(0.0F); - } - -- protected void drawGuiContainerForegroundLayer(int var1, int var2) { -+ /** -+ * Draw the foreground layer for the GuiContainer (everything in front of the items) -+ */ -+ protected void drawGuiContainerForegroundLayer(int par1, int par2) { - CreativeTabs var3 = CreativeTabs.creativeTabArray[selectedTabIndex]; -- if(var3.drawInForegroundOfTab()) { -+ -+ if (var3.drawInForegroundOfTab()) { - this.fontRenderer.drawString(I18n.getString(var3.getTranslatedTabLabel()), 8, 6, 4210752); - } -- - } - -- protected void mouseClicked(int var1, int var2, int var3) { -- if(var3 == 0) { -- int var4 = var1 - this.guiLeft; -- int var5 = var2 - this.guiTop; -+ /** -+ * Called when the mouse is clicked. -+ */ -+ protected void mouseClicked(int par1, int par2, int par3) { -+ if (par3 == 0) { -+ int var4 = par1 - this.guiLeft; -+ int var5 = par2 - this.guiTop; - CreativeTabs[] var6 = CreativeTabs.creativeTabArray; - int var7 = var6.length; - -- for(int var8 = 0; var8 < var7; ++var8) { -+ for (int var8 = 0; var8 < var7; ++var8) { - CreativeTabs var9 = var6[var8]; -- if(this.func_74232_a(var9, var4, var5)) { -+ -+ if (this.func_74232_a(var9, var4, var5)) { -+ //this.setCurrentCreativeTab(var9); Might not be needed in 1.5 - return; - } - } -+ -+ // Spout Start -+ // yes this is needed -+ handleSpoutMouse(par1, par2, true); -+ // Spout End - } - -- super.mouseClicked(var1, var2, var3); -+ super.mouseClicked(par1, par2, par3); - } - -- protected void mouseMovedOrUp(int var1, int var2, int var3) { -- if(var3 == 0) { -- int var4 = var1 - this.guiLeft; -- int var5 = var2 - this.guiTop; -+ /** -+ * Called when the mouse is moved or a mouse button is released. Signature: (mouseX, mouseY, which) which==-1 is -+ * mouseMove, which==0 or which==1 is mouseUp -+ */ -+ protected void mouseMovedOrUp(int par1, int par2, int par3) { -+ if (par3 == 0) { -+ int var4 = par1 - this.guiLeft; -+ int var5 = par2 - this.guiTop; - CreativeTabs[] var6 = CreativeTabs.creativeTabArray; - int var7 = var6.length; - -- for(int var8 = 0; var8 < var7; ++var8) { -+ for (int var8 = 0; var8 < var7; ++var8) { - CreativeTabs var9 = var6[var8]; -- if(this.func_74232_a(var9, var4, var5)) { -+ -+ if (this.func_74232_a(var9, var4, var5)) { - this.setCurrentCreativeTab(var9); - return; - } - } - } - -- super.mouseMovedOrUp(var1, var2, var3); -+ super.mouseMovedOrUp(par1, par2, par3); - } - -+ /** -+ * returns (if you are not on the inventoryTab) and (the flag isn't set) and( you have more than 1 page of items) -+ */ - private boolean needsScrollBars() { - return selectedTabIndex != CreativeTabs.tabInventory.getTabIndex() && CreativeTabs.creativeTabArray[selectedTabIndex].shouldHidePlayerInventory() && ((ContainerCreative)this.inventorySlots).hasMoreThan1PageOfItemsInList(); - } - -- private void setCurrentCreativeTab(CreativeTabs var1) { -+ private void setCurrentCreativeTab(CreativeTabs par1CreativeTabs) { - int var2 = selectedTabIndex; -- selectedTabIndex = var1.getTabIndex(); -+ selectedTabIndex = par1CreativeTabs.getTabIndex(); - ContainerCreative var3 = (ContainerCreative)this.inventorySlots; -- this.r.clear(); -- var3.a.clear(); -- var1.displayAllReleventItems(var3.a); -- if(var1 == CreativeTabs.tabInventory) { -+ this.field_94077_p.clear(); -+ var3.itemList.clear(); -+ par1CreativeTabs.displayAllReleventItems(var3.itemList); -+ -+ if (par1CreativeTabs == CreativeTabs.tabInventory) { - Container var4 = this.mc.thePlayer.inventoryContainer; -- if(this.A == null) { -- this.A = var3.c; -+ -+ if (this.backupContainerSlots == null) { -+ this.backupContainerSlots = var3.inventorySlots; - } - -- var3.c = new ArrayList(); -+ var3.inventorySlots = new ArrayList(); - -- for(int var5 = 0; var5 < var4.c.size(); ++var5) { -- SlotCreativeInventory var6 = new SlotCreativeInventory(this, (Slot)var4.c.get(var5), var5); -- var3.c.add(var6); -+ for (int var5 = 0; var5 < var4.inventorySlots.size(); ++var5) { -+ SlotCreativeInventory var6 = new SlotCreativeInventory(this, (Slot)var4.inventorySlots.get(var5), var5); -+ var3.inventorySlots.add(var6); - int var7; - int var8; - int var9; -- if(var5 >= 5 && var5 < 9) { -+ -+ if (var5 >= 5 && var5 < 9) { - var7 = var5 - 5; - var8 = var7 / 2; - var9 = var7 % 2; - var6.xDisplayPosition = 9 + var8 * 54; - var6.yDisplayPosition = 6 + var9 * 27; -- } else if(var5 >= 0 && var5 < 5) { -+ } else if (var5 >= 0 && var5 < 5) { - var6.yDisplayPosition = -2000; - var6.xDisplayPosition = -2000; -- } else if(var5 < var4.c.size()) { -+ } else if (var5 < var4.inventorySlots.size()) { - var7 = var5 - 9; - var8 = var7 % 9; - var9 = var7 / 9; - var6.xDisplayPosition = 9 + var8 * 18; -- if(var5 >= 36) { -+ -+ if (var5 >= 36) { - var6.yDisplayPosition = 112; - } else { - var6.yDisplayPosition = 54 + var9 * 18; -@@ -356,14 +427,14 @@ - } - - this.field_74235_v = new Slot(inventory, 0, 173, 112); -- var3.c.add(this.field_74235_v); -- } else if(var2 == CreativeTabs.tabInventory.getTabIndex()) { -- var3.c = this.A; -- this.A = null; -+ var3.inventorySlots.add(this.field_74235_v); -+ } else if (var2 == CreativeTabs.tabInventory.getTabIndex()) { -+ var3.inventorySlots = this.backupContainerSlots; -+ this.backupContainerSlots = null; - } - -- if(this.searchField != null) { -- if(var1 == CreativeTabs.tabAllSearch) { -+ if (this.searchField != null) { -+ if (par1CreativeTabs == CreativeTabs.tabAllSearch) { - this.searchField.setVisible(true); - this.searchField.setCanLoseFocus(false); - this.searchField.setFocused(true); -@@ -380,34 +451,42 @@ - var3.scrollTo(0.0F); - } - -+ /** -+ * Handles mouse input. -+ */ - public void handleMouseInput() { - super.handleMouseInput(); - int var1 = Mouse.getEventDWheel(); -- if(var1 != 0 && this.needsScrollBars()) { -- int var2 = ((ContainerCreative)this.inventorySlots).a.size() / 9 - 5 + 1; -- if(var1 > 0) { -+ -+ if (var1 != 0 && this.needsScrollBars()) { -+ int var2 = ((ContainerCreative)this.inventorySlots).itemList.size() / 9 - 5 + 1; -+ -+ if (var1 > 0) { - var1 = 1; - } - -- if(var1 < 0) { -+ if (var1 < 0) { - var1 = -1; - } - - this.currentScroll = (float)((double)this.currentScroll - (double)var1 / (double)var2); -- if(this.currentScroll < 0.0F) { -+ -+ if (this.currentScroll < 0.0F) { - this.currentScroll = 0.0F; - } - -- if(this.currentScroll > 1.0F) { -+ if (this.currentScroll > 1.0F) { - this.currentScroll = 1.0F; - } - - ((ContainerCreative)this.inventorySlots).scrollTo(this.currentScroll); - } -- - } - -- public void drawScreen(int var1, int var2, float var3) { -+ /** -+ * Draws the screen and all the components in it. -+ */ -+ public void drawScreen(int par1, int par2, float par3) { - boolean var4 = Mouse.isButtonDown(0); - int var5 = this.guiLeft; - int var6 = this.guiTop; -@@ -415,61 +494,72 @@ - int var8 = var6 + 18; - int var9 = var7 + 14; - int var10 = var8 + 112; -- if(!this.wasClicking && var4 && var1 >= var7 && var2 >= var8 && var1 < var9 && var2 < var10) { -+ -+ if (!this.wasClicking && var4 && par1 >= var7 && par2 >= var8 && par1 < var9 && par2 < var10) { - this.isScrolling = this.needsScrollBars(); - } - -- if(!var4) { -+ if (!var4) { - this.isScrolling = false; - } - - this.wasClicking = var4; -- if(this.isScrolling) { -- this.currentScroll = ((float)(var2 - var8) - 7.5F) / ((float)(var10 - var8) - 15.0F); -- if(this.currentScroll < 0.0F) { -+ -+ if (this.isScrolling) { -+ this.currentScroll = ((float)(par2 - var8) - 7.5F) / ((float)(var10 - var8) - 15.0F); -+ -+ if (this.currentScroll < 0.0F) { - this.currentScroll = 0.0F; - } - -- if(this.currentScroll > 1.0F) { -+ if (this.currentScroll > 1.0F) { - this.currentScroll = 1.0F; - } - - ((ContainerCreative)this.inventorySlots).scrollTo(this.currentScroll); - } - -- super.drawScreen(var1, var2, var3); -+ super.drawScreen(par1, par2, par3); - CreativeTabs[] var11 = CreativeTabs.creativeTabArray; - int var12 = var11.length; - -- for(int var13 = 0; var13 < var12; ++var13) { -+ for (int var13 = 0; var13 < var12; ++var13) { - CreativeTabs var14 = var11[var13]; -- if(this.renderCreativeInventoryHoveringText(var14, var1, var2)) { -+ -+ if (this.renderCreativeInventoryHoveringText(var14, par1, par2)) { - break; - } - } - -- if(this.field_74235_v != null && selectedTabIndex == CreativeTabs.tabInventory.getTabIndex() && this.isPointInRegion(this.field_74235_v.xDisplayPosition, this.field_74235_v.yDisplayPosition, 16, 16, var1, var2)) { -- this.drawCreativeTabHoveringText(I18n.getString("inventory.binSlot"), var1, var2); -+ // Spout Start -+ handleSpoutMouse(par1, par2, false); -+ // Spout End -+ -+ if (this.field_74235_v != null && selectedTabIndex == CreativeTabs.tabInventory.getTabIndex() && this.isPointInRegion(this.field_74235_v.xDisplayPosition, this.field_74235_v.yDisplayPosition, 16, 16, par1, par2)) { -+ this.drawCreativeTabHoveringText(I18n.getString("inventory.binSlot"), par1, par2); - } - - GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - GL11.glDisable(GL11.GL_LIGHTING); - } - -- protected void drawItemStackTooltip(ItemStack var1, int var2, int var3) { -- if(selectedTabIndex == CreativeTabs.tabAllSearch.getTabIndex()) { -- List var4 = var1.getTooltip(this.mc.thePlayer, this.mc.gameSettings.advancedItemTooltips); -- CreativeTabs var5 = var1.getItem().getCreativeTab(); -- if(var5 == null && var1.itemID == Item.enchantedBook.itemID) { -- Map var6 = EnchantmentHelper.getEnchantments(var1); -- if(var6.size() == 1) { -+ protected void drawItemStackTooltip(ItemStack par1ItemStack, int par2, int par3) { -+ if (selectedTabIndex == CreativeTabs.tabAllSearch.getTabIndex()) { -+ List var4 = par1ItemStack.getTooltip(this.mc.thePlayer, this.mc.gameSettings.advancedItemTooltips); -+ CreativeTabs var5 = par1ItemStack.getItem().getCreativeTab(); -+ -+ if (var5 == null && par1ItemStack.itemID == Item.enchantedBook.itemID) { -+ Map var6 = EnchantmentHelper.getEnchantments(par1ItemStack); -+ -+ if (var6.size() == 1) { - Enchantment var7 = Enchantment.enchantmentsList[((Integer)var6.keySet().iterator().next()).intValue()]; - CreativeTabs[] var8 = CreativeTabs.creativeTabArray; - int var9 = var8.length; - -- for(int var10 = 0; var10 < var9; ++var10) { -+ for (int var10 = 0; var10 < var9; ++var10) { - CreativeTabs var11 = var8[var10]; -- if(var11.func_111226_a(var7.type)) { -+ -+ if (var11.func_111226_a(var7.type)) { - var5 = var11; - break; - } -@@ -477,41 +567,48 @@ - } - } - -- if(var5 != null) { -+ if (var5 != null) { - var4.add(1, "" + EnumChatFormatting.BOLD + EnumChatFormatting.BLUE + I18n.getString(var5.getTranslatedTabLabel())); - } - -- for(int var12 = 0; var12 < var4.size(); ++var12) { -- if(var12 == 0) { -- var4.set(var12, "\u00a7" + Integer.toHexString(var1.getRarity().rarityColor) + (String)var4.get(var12)); -+ for (int var12 = 0; var12 < var4.size(); ++var12) { -+ if (var12 == 0) { -+ var4.set(var12, "\u00a7" + Integer.toHexString(par1ItemStack.getRarity().rarityColor) + (String)var4.get(var12)); - } else { - var4.set(var12, EnumChatFormatting.GRAY + (String)var4.get(var12)); - } - } -- -- this.func_102021_a(var4, var2, var3); -+ // ToDO: might need this for tooltip -+ //this.func_102021_a(var4, par2, par3); - } else { -- super.drawItemStackTooltip(var1, var2, var3); -+ super.drawItemStackTooltip(par1ItemStack, par2, par3); - } -- - } -- -- protected void drawGuiContainerBackgroundLayer(float var1, int var2, int var3) { -+ -+ /** -+ * Draw the background layer for the GuiContainer (everything behind the items) -+ */ -+ protected void drawGuiContainerBackgroundLayer(float par1, int par2, int par3) { - GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - RenderHelper.enableGUIStandardItemLighting(); - CreativeTabs var4 = CreativeTabs.creativeTabArray[selectedTabIndex]; - CreativeTabs[] var5 = CreativeTabs.creativeTabArray; - int var6 = var5.length; -- - int var7; -- for(var7 = 0; var7 < var6; ++var7) { -+ -+ for (var7 = 0; var7 < var6 - 1; ++var7) { //Spout don't render the last tab - CreativeTabs var8 = var5[var7]; - this.mc.getTextureManager().bindTexture(field_110424_t); -- if(var8.getTabIndex() != selectedTabIndex) { -+ -+ if (var8.getTabIndex() != selectedTabIndex) { - this.renderCreativeTab(var8); - } - } - -+ // Spout Start - Render ours separately -+ renderInInventory(true); -+ // Spout End -+ - this.mc.getTextureManager().bindTexture(new ResourceLocation("textures/gui/container/creative_inventory/tab_" + var4.getBackgroundImageName())); - this.drawTexturedModalRect(this.guiLeft, this.guiTop, 0, 0, this.xSize, this.ySize); - this.searchField.drawTextBox(); -@@ -520,82 +617,102 @@ - var6 = this.guiTop + 18; - var7 = var6 + 112; - this.mc.getTextureManager().bindTexture(field_110424_t); -- if(var4.shouldHidePlayerInventory()) { -+ -+ if (var4.shouldHidePlayerInventory()) { - this.drawTexturedModalRect(var9, var6 + (int)((float)(var7 - var6 - 17) * this.currentScroll), 232 + (this.needsScrollBars() ? 0 : 12), 0, 12, 15); - } - -+ // Spout Start -+ renderInInventory(false); // Render ours separately -+ if (selectedTabIndex == 12) { // Return, useless code now -+ return; -+ } -+ // Spout End -+ - this.renderCreativeTab(var4); -- if(var4 == CreativeTabs.tabInventory) { -- GuiInventory.func_110423_a(this.guiLeft + 43, this.guiTop + 45, 20, (float)(this.guiLeft + 43 - var2), (float)(this.guiTop + 45 - 30 - var3), this.mc.thePlayer); -- } -- -- } -- -- protected boolean func_74232_a(CreativeTabs var1, int var2, int var3) { -- int var4 = var1.getTabColumn(); -- int var5 = 28 * var4; -- byte var6 = 0; -- if(var4 == 5) { -- var5 = this.xSize - 28 + 2; -- } else if(var4 > 0) { -- var5 += var4; -- } -- -- int var7; -- if(var1.isTabInFirstRow()) { -- var7 = var6 - 32; -- } else { -- var7 = var6 + this.ySize; -- } -- -- return var2 >= var5 && var2 <= var5 + 28 && var3 >= var7 && var3 <= var7 + 32; -- } -- -- protected boolean renderCreativeInventoryHoveringText(CreativeTabs var1, int var2, int var3) { -- int var4 = var1.getTabColumn(); -- int var5 = 28 * var4; -- byte var6 = 0; -- if(var4 == 5) { -- var5 = this.xSize - 28 + 2; -- } else if(var4 > 0) { -- var5 += var4; -- } -- -- int var7; -- if(var1.isTabInFirstRow()) { -- var7 = var6 - 32; -- } else { -- var7 = var6 + this.ySize; -- } -- -- if(this.isPointInRegion(var5 + 3, var7 + 3, 23, 27, var2, var3)) { -- this.drawCreativeTabHoveringText(I18n.getString(var1.getTranslatedTabLabel()), var2, var3); -+ -+ if (var4 == CreativeTabs.tabInventory) { -+ GuiInventory.func_110423_a(this.guiLeft + 43, this.guiTop + 45, 20, (float)(this.guiLeft + 43 - par2), (float)(this.guiTop + 45 - 30 - par3), this.mc.thePlayer); -+ } -+ } -+ -+ protected boolean func_74232_a(CreativeTabs par1CreativeTabs, int par2, int par3) { -+ int var4 = par1CreativeTabs.getTabColumn(); -+ int var5 = 28 * var4; -+ byte var6 = 0; -+ -+ if (var4 == 5) { -+ var5 = this.xSize - 28 + 2; -+ } else if (var4 > 0) { -+ var5 += var4; -+ } -+ -+ int var7; -+ -+ if (par1CreativeTabs.isTabInFirstRow()) { -+ var7 = var6 - 32; -+ } else { -+ var7 = var6 + this.ySize; -+ } -+ -+ return par2 >= var5 && par2 <= var5 + 28 && par3 >= var7 && par3 <= var7 + 32; -+ } -+ -+ /** -+ * Renders the creative inventory hovering text if mouse is over it. Returns true if did render or false otherwise. -+ * Params: current creative tab to be checked, current mouse x position, current mouse y position. -+ */ -+ protected boolean renderCreativeInventoryHoveringText(CreativeTabs par1CreativeTabs, int par2, int par3) { -+ int var4 = par1CreativeTabs.getTabColumn(); -+ int var5 = 28 * var4; -+ byte var6 = 0; -+ -+ if (var4 == 5) { -+ var5 = this.xSize - 28 + 2; -+ } else if (var4 > 0) { -+ var5 += var4; -+ } -+ -+ int var7; -+ -+ if (par1CreativeTabs.isTabInFirstRow()) { -+ var7 = var6 - 32; -+ } else { -+ var7 = var6 + this.ySize; -+ } -+ -+ if (this.isPointInRegion(var5 + 3, var7 + 3, 23, 27, par2, par3)) { -+ this.drawCreativeTabHoveringText(I18n.getString(par1CreativeTabs.getTranslatedTabLabel()), par2, par3); - return true; - } else { - return false; - } - } - -- protected void renderCreativeTab(CreativeTabs var1) { -- boolean var2 = var1.getTabIndex() == selectedTabIndex; -- boolean var3 = var1.isTabInFirstRow(); -- int var4 = var1.getTabColumn(); -+ /** -+ * Renders passed creative inventory tab into the screen. -+ */ -+ protected void renderCreativeTab(CreativeTabs par1CreativeTabs) { -+ boolean var2 = par1CreativeTabs.getTabIndex() == selectedTabIndex; -+ boolean var3 = par1CreativeTabs.isTabInFirstRow(); -+ int var4 = par1CreativeTabs.getTabColumn(); - int var5 = var4 * 28; - int var6 = 0; - int var7 = this.guiLeft + 28 * var4; - int var8 = this.guiTop; - byte var9 = 32; -- if(var2) { -+ -+ if (var2) { - var6 += 32; - } - -- if(var4 == 5) { -+ if (var4 == 5) { - var7 = this.guiLeft + this.xSize - 28; -- } else if(var4 > 0) { -+ } else if (var4 > 0) { - var7 += var4; - } - -- if(var3) { -+ if (var3) { - var8 -= 28; - } else { - var6 += 64; -@@ -610,7 +727,7 @@ - var8 += 8 + (var3 ? 1 : -1); - GL11.glEnable(GL11.GL_LIGHTING); - GL11.glEnable(GL12.GL_RESCALE_NORMAL); -- ItemStack var10 = new ItemStack(var1.getTabIconItem()); -+ ItemStack var10 = new ItemStack(par1CreativeTabs.getTabIconItem()); - itemRenderer.renderItemAndEffectIntoGUI(this.fontRenderer, this.mc.getTextureManager(), var10, var7, var8); - itemRenderer.renderItemOverlayIntoGUI(this.fontRenderer, this.mc.getTextureManager(), var10, var7, var8); - GL11.glDisable(GL11.GL_LIGHTING); -@@ -618,22 +735,98 @@ - this.zLevel = 0.0F; - } - -- protected void actionPerformed(GuiButton var1) { -- if(var1.id == 0) { -+ /** -+ * Fired when a control is clicked. This is the equivalent of ActionListener.actionPerformed(ActionEvent e). -+ */ -+ protected void actionPerformed(GuiButton par1GuiButton) { -+ if (par1GuiButton.id == 0) { - this.mc.displayGuiScreen(new GuiAchievements(this.mc.statFileWriter)); - } - -- if(var1.id == 1) { -+ if (par1GuiButton.id == 1) { - this.mc.displayGuiScreen(new GuiStats(this, this.mc.statFileWriter)); - } -- - } - -+ /** -+ * Returns the current creative tab index. -+ */ - public int getCurrentTabIndex() { - return selectedTabIndex; - } - -+ /** -+ * Returns the creative inventory -+ */ - static InventoryBasic getInventory() { - return inventory; - } -+ -+ // Spout Start -+ public void handleSpoutMouse(int x, int y, boolean isClicked) { -+ int var7 = guiTop; -+ int var5 = guiLeft - 26; -+ boolean inside = x >= var5 && x <= var5 + 28 && y >= var7 && y <= var7 + 32; -+ if (inside) { -+ drawCreativeTabHoveringText("Custom Items", x, y); -+ if (isClicked) { -+ setCurrentCreativeTab(CreativeTabs.tabSpout); -+ /* -+ selectedTabIndex = CreativeTabs.tabSpout.getTabIndex(); -+ ContainerCreative var3 = (ContainerCreative)this.inventorySlots; -+ var3.itemList.clear(); -+ CreativeTabs.tabSpout.displayAllReleventItems(var3.itemList); -+ this.searchField.setVisible(false); -+ this.searchField.setCanLoseFocus(true); -+ this.searchField.setFocused(false); -+ this.currentScroll = 0.0F; -+ var3.scrollTo(0.0F); -+ */ -+ } -+ } -+ } -+ -+ public void renderInInventory(boolean beforeBackground) { -+ if (!beforeBackground && selectedTabIndex != 12) { -+ return; -+ } -+ Minecraft.getMinecraft().getTextureManager().bindTexture(new ResourceLocation("textures/gui/container/creative_inventory/tabs.png")); -+ byte var9 = 32; -+ -+ int startY = 0; -+ int diff = 75; -+ if (!beforeBackground) { -+ startY = 32; -+ diff=79; -+ } -+ -+ int var8 = this.guiTop; -+ int var7 = this.guiLeft-21; -+ -+ GL11.glDisable(GL11.GL_LIGHTING); -+ //this.drawTexturedModalRect(var7, var8, 56, 0, 28, var9); -+ this.drawTexturedModalRect(var7, var8, 56, startY, 25, var9/2); -+ this.drawTexturedModalRect(var7, var8 + var9/2, 56, startY+diff, 25, var9/2); -+ this.zLevel = 100.0F; -+ itemRenderer.zLevel = 100.0F; -+ var7 += 6; -+ var8 += 7; -+ GL11.glEnable(GL11.GL_LIGHTING); -+ GL11.glEnable(GL12.GL_RESCALE_NORMAL); -+ // Bypass stupidity -+ ItemStack var10; -+ if (MaterialData.getCustomItems().length == 0) { -+ var10 = new ItemStack(Item.flint); -+ } else { -+ CustomItem cItem = MaterialData.getCustomItems()[0]; -+ var10 = new ItemStack(cItem.getRawId(), 1, cItem.getRawData()); -+ } -+ // End of stupidity -+ itemRenderer.renderItemIntoGUI(this.fontRenderer, this.mc.getTextureManager(), var10, var7, var8); -+ itemRenderer.renderItemOverlayIntoGUI(this.fontRenderer, this.mc.getTextureManager(), var10, var7, var8); -+ GL11.glDisable(GL11.GL_LIGHTING); -+ itemRenderer.zLevel = 0.0F; -+ this.zLevel = 0.0F; -+ } -+ // Spout End - } ---- net/minecraft/src/GuiScreenMcoWorldTemplate.java -+++ net/minecraft/src/GuiScreenMcoWorldTemplate.java -@@ -7,111 +7,121 @@ - public class GuiScreenMcoWorldTemplate extends GuiScreen { - private final ScreenWithCallback field_110401_a; - private WorldTemplate field_110398_b; -- private List c = Collections.emptyList(); -+ private List field_110399_c = Collections.emptyList(); - private GuiScreenMcoWorldTemplateSelectionList field_110396_d; - private int field_110397_e = -1; - private GuiButton field_110400_p; - -- public GuiScreenMcoWorldTemplate(ScreenWithCallback var1, WorldTemplate var2) { -- this.field_110401_a = var1; -- this.field_110398_b = var2; -+ public GuiScreenMcoWorldTemplate(ScreenWithCallback par1ScreenWithCallback, WorldTemplate par2WorldTemplate) { -+ this.field_110401_a = par1ScreenWithCallback; -+ this.field_110398_b = par2WorldTemplate; - } - -+ /** -+ * Adds the buttons (and other controls) to the screen in question. -+ */ - public void initGui() { - Keyboard.enableRepeatEvents(true); -- this.i.clear(); -+ this.buttonList.clear(); - this.field_110396_d = new GuiScreenMcoWorldTemplateSelectionList(this); - (new GuiScreenMcoWorldTemplateDownloadThread(this)).start(); - this.func_110385_g(); - } - - private void func_110385_g() { -- this.i.add(new GuiButton(0, this.width / 2 + 6, this.height - 52, 153, 20, I18n.getString("gui.cancel"))); -- this.i.add(this.field_110400_p = new GuiButton(1, this.width / 2 - 154, this.height - 52, 153, 20, I18n.getString("mco.template.button.select"))); -+ this.buttonList.add(new GuiButton(0, this.width / 2 + 6, this.height - 52, 153, 20, I18n.getString("gui.cancel"))); -+ this.buttonList.add(this.field_110400_p = new GuiButton(1, this.width / 2 - 154, this.height - 52, 153, 20, I18n.getString("mco.template.button.select"))); - } - -+ /** -+ * Called from the main game loop to update the screen. -+ */ - public void updateScreen() { - super.updateScreen(); - } - -- protected void actionPerformed(GuiButton var1) { -- if(var1.enabled) { -- if(var1.id == 1) { -+ /** -+ * Fired when a control is clicked. This is the equivalent of ActionListener.actionPerformed(ActionEvent e). -+ */ -+ protected void actionPerformed(GuiButton par1GuiButton) { -+ if (par1GuiButton.enabled) { -+ if (par1GuiButton.id == 1) { - this.func_110394_h(); -- } else if(var1.id == 0) { -+ } else if (par1GuiButton.id == 0) { - this.field_110401_a.func_110354_a((Object)null); - this.mc.displayGuiScreen(this.field_110401_a); - } else { -- this.field_110396_d.actionPerformed(var1); -+ this.field_110396_d.actionPerformed(par1GuiButton); - } -- - } - } - - private void func_110394_h() { -- if(this.field_110397_e >= 0 && this.field_110397_e < this.c.size()) { -- this.field_110401_a.func_110354_a(this.c.get(this.field_110397_e)); -+ if (this.field_110397_e >= 0 && this.field_110397_e < this.field_110399_c.size()) { -+ this.field_110401_a.func_110354_a(this.field_110399_c.get(this.field_110397_e)); - this.mc.displayGuiScreen(this.field_110401_a); - } -- - } - -- public void drawScreen(int var1, int var2, float var3) { -+ /** -+ * Draws the screen and all the components in it. -+ */ -+ public void drawScreen(int par1, int par2, float par3) { - this.drawDefaultBackground(); -- this.field_110396_d.drawScreen(var1, var2, var3); -+ this.field_110396_d.drawScreen(par1, par2, par3); - this.drawCenteredString(this.fontRenderer, I18n.getString("mco.template.title"), this.width / 2, 20, 16777215); -- super.drawScreen(var1, var2, var3); -- } -- -- static Minecraft func_110382_a(GuiScreenMcoWorldTemplate var0) { -- return var0.mc; -- } -- -- static List func_110388_a(GuiScreenMcoWorldTemplate var0, List var1) { -- return var0.c = var1; -- } -- -- static Minecraft func_110392_b(GuiScreenMcoWorldTemplate var0) { -- return var0.mc; -- } -- -- static Minecraft func_130066_c(GuiScreenMcoWorldTemplate var0) { -- return var0.mc; -- } -- -- static List func_110395_c(GuiScreenMcoWorldTemplate var0) { -- return var0.c; -- } -- -- static int func_130064_a(GuiScreenMcoWorldTemplate var0, int var1) { -- return var0.field_110397_e = var1; -- } -- -- static WorldTemplate func_130065_a(GuiScreenMcoWorldTemplate var0, WorldTemplate var1) { -- return var0.field_110398_b = var1; -- } -- -- static WorldTemplate func_130067_e(GuiScreenMcoWorldTemplate var0) { -- return var0.field_110398_b; -- } -- -- static int func_130062_f(GuiScreenMcoWorldTemplate var0) { -- return var0.field_110397_e; -- } -- -- static FontRenderer func_110389_g(GuiScreenMcoWorldTemplate var0) { -- return var0.fontRenderer; -- } -- -- static FontRenderer func_110387_h(GuiScreenMcoWorldTemplate var0) { -- return var0.fontRenderer; -- } -- -- static FontRenderer func_110384_i(GuiScreenMcoWorldTemplate var0) { -- return var0.fontRenderer; -- } -- -- static FontRenderer func_130063_j(GuiScreenMcoWorldTemplate var0) { -- return var0.fontRenderer; -+ super.drawScreen(par1, par2, par3); -+ } -+ -+ static Minecraft func_110382_a(GuiScreenMcoWorldTemplate par0GuiScreenMcoWorldTemplate) { -+ return par0GuiScreenMcoWorldTemplate.mc; -+ } -+ -+ static List func_110388_a(GuiScreenMcoWorldTemplate par0GuiScreenMcoWorldTemplate, List par1List) { -+ return par0GuiScreenMcoWorldTemplate.field_110399_c = par1List; -+ } -+ -+ static Minecraft func_110392_b(GuiScreenMcoWorldTemplate par0GuiScreenMcoWorldTemplate) { -+ return par0GuiScreenMcoWorldTemplate.mc; -+ } -+ -+ static Minecraft func_130066_c(GuiScreenMcoWorldTemplate par0GuiScreenMcoWorldTemplate) { -+ return par0GuiScreenMcoWorldTemplate.mc; -+ } -+ -+ static List func_110395_c(GuiScreenMcoWorldTemplate par0GuiScreenMcoWorldTemplate) { -+ return par0GuiScreenMcoWorldTemplate.field_110399_c; -+ } -+ -+ static int func_130064_a(GuiScreenMcoWorldTemplate par0GuiScreenMcoWorldTemplate, int par1) { -+ return par0GuiScreenMcoWorldTemplate.field_110397_e = par1; -+ } -+ -+ static WorldTemplate func_130065_a(GuiScreenMcoWorldTemplate par0GuiScreenMcoWorldTemplate, WorldTemplate par1WorldTemplate) { -+ return par0GuiScreenMcoWorldTemplate.field_110398_b = par1WorldTemplate; -+ } -+ -+ static WorldTemplate func_130067_e(GuiScreenMcoWorldTemplate par0GuiScreenMcoWorldTemplate) { -+ return par0GuiScreenMcoWorldTemplate.field_110398_b; -+ } -+ -+ static int func_130062_f(GuiScreenMcoWorldTemplate par0GuiScreenMcoWorldTemplate) { -+ return par0GuiScreenMcoWorldTemplate.field_110397_e; -+ } -+ -+ static FontRenderer func_110389_g(GuiScreenMcoWorldTemplate par0GuiScreenMcoWorldTemplate) { -+ return par0GuiScreenMcoWorldTemplate.fontRenderer; -+ } -+ -+ static FontRenderer func_110387_h(GuiScreenMcoWorldTemplate par0GuiScreenMcoWorldTemplate) { -+ return par0GuiScreenMcoWorldTemplate.fontRenderer; -+ } -+ -+ static FontRenderer func_110384_i(GuiScreenMcoWorldTemplate par0GuiScreenMcoWorldTemplate) { -+ return par0GuiScreenMcoWorldTemplate.fontRenderer; -+ } -+ -+ static FontRenderer func_130063_j(GuiScreenMcoWorldTemplate par0GuiScreenMcoWorldTemplate) { -+ return par0GuiScreenMcoWorldTemplate.fontRenderer; - } - } ---- net/minecraft/src/EntityClientPlayerMP.java -+++ net/minecraft/src/EntityClientPlayerMP.java -@@ -1,49 +1,83 @@ - package net.minecraft.src; - -+import org.spoutcraft.api.gui.ScreenType; -+import org.spoutcraft.client.SpoutClient; -+import org.spoutcraft.client.packet.PacketKeyPress; -+ - public class EntityClientPlayerMP extends EntityPlayerSP { - public NetClientHandler sendQueue; - private double oldPosX; -+ -+ /** Old Minimum Y of the bounding box */ - private double oldMinY; - private double oldPosY; - private double oldPosZ; - private float oldRotationYaw; - private float oldRotationPitch; -+ -+ /** Check if was on ground last update */ - private boolean wasOnGround; -+ -+ /** should the player stop sneaking? */ - private boolean shouldStopSneaking; - private boolean wasSneaking; - private int field_71168_co; -+ -+ /** has the client player's health been set? */ - private boolean hasSetHealth; -- private String ce; -+ private String field_142022_ce; - -- public EntityClientPlayerMP(Minecraft var1, World var2, Session var3, NetClientHandler var4) { -- super(var1, var2, var3, 0); -- this.sendQueue = var4; -+ public EntityClientPlayerMP(Minecraft par1Minecraft, World par2World, Session par3Session, NetClientHandler par4NetClientHandler) { -+ super(par1Minecraft, par2World, par3Session, 0); -+ this.sendQueue = par4NetClientHandler; - } - -- public boolean attackEntityFrom(DamageSource var1, float var2) { -+ /** -+ * Called when the entity is attacked. -+ */ -+ public boolean attackEntityFrom(DamageSource par1DamageSource, float par2) { - return false; - } - -- public void heal(float var1) { -- } -+ /** -+ * Heal living entity (param: amount of half-hearts) -+ */ -+ public void heal(int par1) {} - -+ /** -+ * Called to update the entity's position/logic. -+ */ - public void onUpdate() { -- if(this.worldObj.blockExists(MathHelper.floor_double(this.posX), 0, MathHelper.floor_double(this.posZ))) { -+ if (this.worldObj.blockExists(MathHelper.floor_double(this.posX), 0, MathHelper.floor_double(this.posZ))) { - super.onUpdate(); -- if(this.isRiding()) { -+ if (this.isRiding()) { - this.sendQueue.addToSendQueue(new Packet12PlayerLook(this.rotationYaw, this.rotationPitch, this.onGround)); - this.sendQueue.addToSendQueue(new Packet27PlayerInput(this.moveStrafing, this.moveForward, this.movementInput.jump, this.movementInput.sneak)); - } else { - this.sendMotionUpdates(); - } -+ } - -+ // Spout Start -+ if (!this.isRiding()) { -+ if (!this.isSprinting() && runToggle) { -+ if (canSprint()) { -+ setSprinting(true); -+ this.sendQueue.addToSendQueue(new Packet19EntityAction(this, 4)); -+ } -+ } - } -+ // Spout End - } - -+ /** -+ * Send updated motion and position information to the server -+ */ - public void sendMotionUpdates() { - boolean var1 = this.isSprinting(); -- if(var1 != this.wasSneaking) { -- if(var1) { -+ -+ if (var1 != this.wasSneaking) { -+ if (var1) { - this.sendQueue.addToSendQueue(new Packet19EntityAction(this, 4)); - } else { - this.sendQueue.addToSendQueue(new Packet19EntityAction(this, 5)); -@@ -53,8 +87,9 @@ - } - - boolean var2 = this.isSneaking(); -- if(var2 != this.shouldStopSneaking) { -- if(var2) { -+ -+ if (var2 != this.shouldStopSneaking) { -+ if (var2) { - this.sendQueue.addToSendQueue(new Packet19EntityAction(this, 1)); - } else { - this.sendQueue.addToSendQueue(new Packet19EntityAction(this, 2)); -@@ -68,16 +103,19 @@ - double var7 = this.posZ - this.oldPosZ; - double var9 = (double)(this.rotationYaw - this.oldRotationYaw); - double var11 = (double)(this.rotationPitch - this.oldRotationPitch); -- boolean var13 = var3 * var3 + var5 * var5 + var7 * var7 > 9.0E-4D || this.field_71168_co >= 20; -+ // Spout Start - Send more updates while airborne. -+ boolean var13 = var3 * var3 + var5 * var5 + var7 * var7 > 9.0E-4D || this.field_71168_co >= (this.isAirBorne ? 4 : 20); -+ // Spout End - boolean var14 = var9 != 0.0D || var11 != 0.0D; -- if(this.ridingEntity != null) { -+ -+ if (this.ridingEntity != null) { - this.sendQueue.addToSendQueue(new Packet13PlayerLookMove(this.motionX, -999.0D, -999.0D, this.motionZ, this.rotationYaw, this.rotationPitch, this.onGround)); - var13 = false; -- } else if(var13 && var14) { -+ } else if (var13 && var14) { - this.sendQueue.addToSendQueue(new Packet13PlayerLookMove(this.posX, this.boundingBox.minY, this.posY, this.posZ, this.rotationYaw, this.rotationPitch, this.onGround)); -- } else if(var13) { -+ } else if (var13) { - this.sendQueue.addToSendQueue(new Packet11PlayerPosition(this.posX, this.boundingBox.minY, this.posY, this.posZ, this.onGround)); -- } else if(var14) { -+ } else if (var14) { - this.sendQueue.addToSendQueue(new Packet12PlayerLook(this.rotationYaw, this.rotationPitch, this.onGround)); - } else { - this.sendQueue.addToSendQueue(new Packet10Flying(this.onGround)); -@@ -85,7 +123,8 @@ - - ++this.field_71168_co; - this.wasOnGround = this.onGround; -- if(var13) { -+ -+ if (var13) { - this.oldPosX = this.posX; - this.oldMinY = this.boundingBox.minY; - this.oldPosY = this.posY; -@@ -93,26 +132,36 @@ - this.field_71168_co = 0; - } - -- if(var14) { -+ if (var14) { - this.oldRotationYaw = this.rotationYaw; - this.oldRotationPitch = this.rotationPitch; - } -- - } - -- public EntityItem dropOneItem(boolean var1) { -- int var2 = var1 ? 3 : 4; -+ /** -+ * Called when player presses the drop item key -+ */ -+ public EntityItem dropOneItem(boolean par1) { -+ int var2 = par1 ? 3 : 4; - this.sendQueue.addToSendQueue(new Packet14BlockDig(var2, 0, 0, 0, 0)); - return null; - } - -- protected void joinEntityItemWithWorld(EntityItem var1) { -- } -- -- public void sendChatMessage(String var1) { -- this.sendQueue.addToSendQueue(new Packet3Chat(var1)); -- } -- -+ /** -+ * Joins the passed in entity item with the world. Args: entityItem -+ */ -+ protected void joinEntityItemWithWorld(EntityItem par1EntityItem) {} -+ -+ /** -+ * Sends a chat message from the player. Args: chatMessage -+ */ -+ public void sendChatMessage(String par1Str) { -+ this.sendQueue.addToSendQueue(new Packet3Chat(par1Str)); -+ } -+ -+ /** -+ * Swings the item the player is holding. -+ */ - public void swingItem() { - super.swingItem(); - this.sendQueue.addToSendQueue(new Packet18Animation(this, 1)); -@@ -122,12 +171,21 @@ - this.sendQueue.addToSendQueue(new Packet205ClientCommand(1)); - } - -- protected void damageEntity(DamageSource var1, float var2) { -- if(!this.isEntityInvulnerable()) { -- this.setHealth(this.getHealth() - var2); -+ /** -+ * Deals damage to the entity. If its a EntityPlayer then will take damage from the armor first and then health second -+ * with the reduced value. Args: damageAmount -+ */ -+ // Spout Start - private to public -+ public void damageEntity(DamageSource par1DamageSource, float par2) { -+ // Spout End -+ if (!this.isEntityInvulnerable()) { -+ this.setHealth(this.getHealth() - par2); - } - } - -+ /** -+ * sets current screen to null (used on escape buttons of GUIs) -+ */ - public void closeScreen() { - this.sendQueue.addToSendQueue(new Packet101CloseWindow(this.openContainer.windowId)); - this.func_92015_f(); -@@ -138,34 +196,43 @@ - super.closeScreen(); - } - -- public void setPlayerSPHealth(float var1) { -- if(this.hasSetHealth) { -- super.setPlayerSPHealth(var1); -+ /** -+ * Updates health locally. -+ */ -+ public void setPlayerSPHealth(float par1) { -+ if (this.hasSetHealth) { -+ super.setPlayerSPHealth(par1); - } else { -- this.setHealth(var1); -+ this.setHealth(par1); - this.hasSetHealth = true; - } -- -- } -- -- public void addStat(StatBase var1, int var2) { -- if(var1 != null) { -- if(var1.isIndependent) { -- super.addStat(var1, var2); -- } -- -- } -- } -- -- public void incrementStat(StatBase var1, int var2) { -- if(var1 != null) { -- if(!var1.isIndependent) { -- super.addStat(var1, var2); -- } -- -- } -- } -- -+ } -+ -+ /** -+ * Adds a value to a statistic field. -+ */ -+ public void addStat(StatBase par1StatBase, int par2) { -+ if (par1StatBase != null) { -+ if (par1StatBase.isIndependent) { -+ super.addStat(par1StatBase, par2); -+ } -+ } -+ } -+ -+ /** -+ * Used by NetClientHandler.handleStatistic -+ */ -+ public void incrementStat(StatBase par1StatBase, int par2) { -+ if (par1StatBase != null) { -+ if (!par1StatBase.isIndependent) { -+ super.addStat(par1StatBase, par2); -+ } -+ } -+ } -+ -+ /** -+ * Sends the player's abilities to the server (if there is one). -+ */ - public void sendPlayerAbilities() { - this.sendQueue.addToSendQueue(new Packet202PlayerAbilities(this.capabilities)); - } -@@ -178,11 +245,21 @@ - this.sendQueue.addToSendQueue(new Packet19EntityAction(this, 7)); - } - -- public void func_142020_c(String var1) { -- this.ce = var1; -+ public void func_142020_c(String par1Str) { -+ this.field_142022_ce = par1Str; - } - - public String func_142021_k() { -- return this.ce; -+ return this.field_142022_ce; - } -+ -+ // Spout Start -+ @Override -+ public void handleKeyPress(int i, boolean keyReleased) { -+ if (SpoutClient.getInstance().isSpoutEnabled()) { -+ SpoutClient.getInstance().getPacketManager().sendSpoutPacket(new PacketKeyPress(i, keyReleased, (MovementInputFromOptions)movementInput, ScreenType.GAME_SCREEN)); -+ } -+ -+ super.handleKeyPress(i, keyReleased); -+ } - } ---- net/minecraft/src/EntityAINearestAttackableTarget.java -+++ net/minecraft/src/EntityAINearestAttackableTarget.java -@@ -4,37 +4,47 @@ - import java.util.List; - - public class EntityAINearestAttackableTarget extends EntityAITarget { -- private final Class a; -+ private final Class targetClass; - private final int targetChance; -+ -+ /** Instance of EntityAINearestAttackableTargetSorter. */ - private final EntityAINearestAttackableTargetSorter theNearestAttackableTargetSorter; -+ -+ /** -+ * This filter is applied to the Entity search. Only matching entities will be targetted. (null -> no restrictions) -+ */ - private final IEntitySelector targetEntitySelector; - private EntityLivingBase targetEntity; - -- public EntityAINearestAttackableTarget(EntityCreature var1, Class var2, int var3, boolean var4) { -- this(var1, var2, var3, var4, false); -- } -- -- public EntityAINearestAttackableTarget(EntityCreature var1, Class var2, int var3, boolean var4, boolean var5) { -- this(var1, var2, var3, var4, var5, (IEntitySelector)null); -- } -- -- public EntityAINearestAttackableTarget(EntityCreature var1, Class var2, int var3, boolean var4, boolean var5, IEntitySelector var6) { -- super(var1, var4, var5); -- this.a = var2; -- this.targetChance = var3; -- this.theNearestAttackableTargetSorter = new EntityAINearestAttackableTargetSorter(var1); -+ public EntityAINearestAttackableTarget(EntityCreature par1EntityCreature, Class par2Class, int par3, boolean par4) { -+ this(par1EntityCreature, par2Class, par3, par4, false); -+ } -+ -+ public EntityAINearestAttackableTarget(EntityCreature par1EntityCreature, Class par2Class, int par3, boolean par4, boolean par5) { -+ this(par1EntityCreature, par2Class, par3, par4, par5, (IEntitySelector)null); -+ } -+ -+ public EntityAINearestAttackableTarget(EntityCreature par1EntityCreature, Class par2Class, int par3, boolean par4, boolean par5, IEntitySelector par6IEntitySelector) { -+ super(par1EntityCreature, par4, par5); -+ this.targetClass = par2Class; -+ this.targetChance = par3; -+ this.theNearestAttackableTargetSorter = new EntityAINearestAttackableTargetSorter(par1EntityCreature); - this.setMutexBits(1); -- this.targetEntitySelector = new EntityAINearestAttackableTargetSelector(this, var6); -+ this.targetEntitySelector = new EntityAINearestAttackableTargetSelector(this, par6IEntitySelector); - } - -+ /** -+ * Returns whether the EntityAIBase should begin execution. -+ */ - public boolean shouldExecute() { -- if(this.targetChance > 0 && this.taskOwner.getRNG().nextInt(this.targetChance) != 0) { -+ if (this.targetChance > 0 && this.taskOwner.getRNG().nextInt(this.targetChance) != 0) { - return false; - } else { - double var1 = this.getTargetDistance(); -- List var3 = this.taskOwner.worldObj.selectEntitiesWithinAABB(this.a, this.taskOwner.boundingBox.expand(var1, 4.0D, var1), this.targetEntitySelector); -+ List var3 = this.taskOwner.worldObj.selectEntitiesWithinAABB(this.targetClass, this.taskOwner.boundingBox.expand(var1, 4.0D, var1), this.targetEntitySelector); - Collections.sort(var3, this.theNearestAttackableTargetSorter); -- if(var3.isEmpty()) { -+ -+ if (var3.isEmpty()) { - return false; - } else { - this.targetEntity = (EntityLivingBase)var3.get(0); -@@ -43,6 +53,9 @@ - } - } - -+ /** -+ * Execute a one shot task or start executing a continuous task -+ */ - public void startExecuting() { - this.taskOwner.setAttackTarget(this.targetEntity); - super.startExecuting(); ---- net/minecraft/src/ItemBlockWithMetadata.java -+++ net/minecraft/src/ItemBlockWithMetadata.java -@@ -3,18 +3,24 @@ - public class ItemBlockWithMetadata extends ItemBlock { - private Block theBlock; - -- public ItemBlockWithMetadata(int var1, Block var2) { -- super(var1); -- this.theBlock = var2; -+ public ItemBlockWithMetadata(int par1, Block par2Block) { -+ super(par1); -+ this.theBlock = par2Block; - this.setMaxDamage(0); - this.setHasSubtypes(true); - } - -- public Icon getIconFromDamage(int var1) { -- return this.theBlock.getIcon(2, var1); -+ /** -+ * Gets an icon index based on an item's damage value -+ */ -+ public Icon getIconFromDamage(int par1) { -+ return this.theBlock.getIcon(2, par1); - } - -- public int getMetadata(int var1) { -- return var1; -+ /** -+ * Returns the metadata of the block which this Item (ItemBlock) can place -+ */ -+ public int getMetadata(int par1) { -+ return par1; - } - } ---- net/minecraft/src/StructureMineshaftPieces.java -+++ net/minecraft/src/StructureMineshaftPieces.java -@@ -4,7 +4,9 @@ - import java.util.Random; - - public class StructureMineshaftPieces { -- private static final WeightedRandomChestContent[] mineshaftChestContents = new WeightedRandomChestContent[]{new WeightedRandomChestContent(Item.ingotIron.itemID, 0, 1, 5, 10), new WeightedRandomChestContent(Item.ingotGold.itemID, 0, 1, 3, 5), new WeightedRandomChestContent(Item.redstone.itemID, 0, 4, 9, 5), new WeightedRandomChestContent(Item.dyePowder.itemID, 4, 4, 9, 5), new WeightedRandomChestContent(Item.diamond.itemID, 0, 1, 2, 3), new WeightedRandomChestContent(Item.coal.itemID, 0, 3, 8, 10), new WeightedRandomChestContent(Item.bread.itemID, 0, 1, 3, 15), new WeightedRandomChestContent(Item.pickaxeIron.itemID, 0, 1, 1, 1), new WeightedRandomChestContent(Block.rail.blockID, 0, 4, 8, 1), new WeightedRandomChestContent(Item.melonSeeds.itemID, 0, 2, 4, 10), new WeightedRandomChestContent(Item.pumpkinSeeds.itemID, 0, 2, 4, 10), new WeightedRandomChestContent(Item.saddle.itemID, 0, 1, 1, 3), new WeightedRandomChestContent(Item.horseArmorIron.itemID, 0, 1, 1, 1)}; -+ -+ /** List of contents that can generate in Mineshafts. */ -+ private static final WeightedRandomChestContent[] mineshaftChestContents = new WeightedRandomChestContent[] {new WeightedRandomChestContent(Item.ingotIron.itemID, 0, 1, 5, 10), new WeightedRandomChestContent(Item.ingotGold.itemID, 0, 1, 3, 5), new WeightedRandomChestContent(Item.redstone.itemID, 0, 4, 9, 5), new WeightedRandomChestContent(Item.dyePowder.itemID, 4, 4, 9, 5), new WeightedRandomChestContent(Item.diamond.itemID, 0, 1, 2, 3), new WeightedRandomChestContent(Item.coal.itemID, 0, 3, 8, 10), new WeightedRandomChestContent(Item.bread.itemID, 0, 1, 3, 15), new WeightedRandomChestContent(Item.pickaxeIron.itemID, 0, 1, 1, 1), new WeightedRandomChestContent(Block.rail.blockID, 0, 4, 8, 1), new WeightedRandomChestContent(Item.melonSeeds.itemID, 0, 2, 4, 10), new WeightedRandomChestContent(Item.pumpkinSeeds.itemID, 0, 2, 4, 10), new WeightedRandomChestContent(Item.saddle.itemID, 0, 1, 1, 3), new WeightedRandomChestContent(Item.horseArmorIron.itemID, 0, 1, 1, 1)}; - - public static void func_143048_a() { - MapGenStructureIO.func_143031_a(ComponentMineshaftCorridor.class, "MSCorridor"); -@@ -13,37 +15,42 @@ - MapGenStructureIO.func_143031_a(ComponentMineshaftStairs.class, "MSStairs"); - } - -- private static StructureComponent getRandomComponent(List var0, Random var1, int var2, int var3, int var4, int var5, int var6) { -- int var7 = var1.nextInt(100); -+ private static StructureComponent getRandomComponent(List par0List, Random par1Random, int par2, int par3, int par4, int par5, int par6) { -+ int var7 = par1Random.nextInt(100); - StructureBoundingBox var8; -- if(var7 >= 80) { -- var8 = ComponentMineshaftCross.findValidPlacement(var0, var1, var2, var3, var4, var5); -- if(var8 != null) { -- return new ComponentMineshaftCross(var6, var1, var8, var5); -+ -+ if (var7 >= 80) { -+ var8 = ComponentMineshaftCross.findValidPlacement(par0List, par1Random, par2, par3, par4, par5); -+ -+ if (var8 != null) { -+ return new ComponentMineshaftCross(par6, par1Random, var8, par5); - } -- } else if(var7 >= 70) { -- var8 = ComponentMineshaftStairs.findValidPlacement(var0, var1, var2, var3, var4, var5); -- if(var8 != null) { -- return new ComponentMineshaftStairs(var6, var1, var8, var5); -+ } else if (var7 >= 70) { -+ var8 = ComponentMineshaftStairs.findValidPlacement(par0List, par1Random, par2, par3, par4, par5); -+ -+ if (var8 != null) { -+ return new ComponentMineshaftStairs(par6, par1Random, var8, par5); - } - } else { -- var8 = ComponentMineshaftCorridor.findValidPlacement(var0, var1, var2, var3, var4, var5); -- if(var8 != null) { -- return new ComponentMineshaftCorridor(var6, var1, var8, var5); -+ var8 = ComponentMineshaftCorridor.findValidPlacement(par0List, par1Random, par2, par3, par4, par5); -+ -+ if (var8 != null) { -+ return new ComponentMineshaftCorridor(par6, par1Random, var8, par5); - } - } - - return null; - } - -- private static StructureComponent getNextMineShaftComponent(StructureComponent var0, List var1, Random var2, int var3, int var4, int var5, int var6, int var7) { -- if(var7 > 8) { -+ private static StructureComponent getNextMineShaftComponent(StructureComponent par0StructureComponent, List par1List, Random par2Random, int par3, int par4, int par5, int par6, int par7) { -+ if (par7 > 8) { - return null; -- } else if(Math.abs(var3 - var0.getBoundingBox().minX) <= 80 && Math.abs(var5 - var0.getBoundingBox().minZ) <= 80) { -- StructureComponent var8 = getRandomComponent(var1, var2, var3, var4, var5, var6, var7 + 1); -- if(var8 != null) { -- var1.add(var8); -- var8.buildComponent(var0, var1, var2); -+ } else if (Math.abs(par3 - par0StructureComponent.getBoundingBox().minX) <= 80 && Math.abs(par5 - par0StructureComponent.getBoundingBox().minZ) <= 80) { -+ StructureComponent var8 = getRandomComponent(par1List, par2Random, par3, par4, par5, par6, par7 + 1); -+ -+ if (var8 != null) { -+ par1List.add(var8); -+ var8.buildComponent(par0StructureComponent, par1List, par2Random); - } - - return var8; -@@ -52,8 +59,8 @@ - } - } - -- static StructureComponent getNextComponent(StructureComponent var0, List var1, Random var2, int var3, int var4, int var5, int var6, int var7) { -- return getNextMineShaftComponent(var0, var1, var2, var3, var4, var5, var6, var7); -+ static StructureComponent getNextComponent(StructureComponent par0StructureComponent, List par1List, Random par2Random, int par3, int par4, int par5, int par6, int par7) { -+ return getNextMineShaftComponent(par0StructureComponent, par1List, par2Random, par3, par4, par5, par6, par7); - } - - static WeightedRandomChestContent[] func_78816_a() { ---- net/minecraft/src/StatPlaceholder.java -+++ net/minecraft/src/StatPlaceholder.java -@@ -1,7 +1,7 @@ - package net.minecraft.src; - - public class StatPlaceholder extends StatBase { -- public StatPlaceholder(int var1) { -- super(var1, "Unknown stat"); -+ public StatPlaceholder(int par1) { -+ super(par1, "Unknown stat"); - } - } ---- /dev/null -+++ org/spoutcraft/client/packet/PacketPreCacheFile.java -@@ -1,0 +1,125 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.client.packet; -+ -+import java.io.File; -+import java.io.IOException; -+ -+import org.spoutcraft.api.io.SpoutInputStream; -+import org.spoutcraft.api.io.SpoutOutputStream; -+import org.spoutcraft.client.SpoutClient; -+import org.spoutcraft.client.io.CRCManager; -+import org.spoutcraft.client.io.CustomTextureManager; -+import org.spoutcraft.client.io.Download; -+import org.spoutcraft.client.io.FileDownloadThread; -+import org.spoutcraft.client.io.FileUtil; -+ -+public class PacketPreCacheFile implements SpoutPacket { -+ private static byte[] downloadBuffer = new byte[16384]; -+ private boolean cached = false; -+ private boolean url = false; -+ private long expectedCRC; -+ private String file; -+ private String plugin; -+ -+ public PacketPreCacheFile() { -+ } -+ -+ public PacketPreCacheFile(String plugin, String file, long expectedCRC, boolean url) { -+ this.file = file; -+ this.plugin = plugin; -+ this.expectedCRC = expectedCRC; -+ this.url = url; -+ } -+ -+ public void readData(SpoutInputStream input) throws IOException { -+ this.cached = input.readBoolean(); -+ this.url = input.readBoolean(); -+ this.expectedCRC = input.readLong(); -+ this.file = input.readString(); -+ this.plugin = input.readString(); -+ } -+ -+ public void writeData(SpoutOutputStream output) throws IOException { -+ output.writeBoolean(this.cached); -+ output.writeBoolean(this.url); -+ output.writeLong(this.expectedCRC); -+ output.writeString(this.file); -+ output.writeString(this.plugin); -+ } -+ -+ public void run(int playerId) { -+ if (!FileUtil.canCache(file)) { -+ System.out.println("WARNING, " + plugin + " tried to cache an invalid file type: " + file); -+ return; -+ } -+ final File directory = new File(FileUtil.getCacheDir(), plugin); -+ if (!directory.exists()) { -+ directory.mkdir(); -+ } -+ final String fileName = FileUtil.getFileName(file); -+ final File expected = new File(directory, fileName); -+ this.cached = expected.exists(); -+ System.out.println("Received Precache for [" + fileName + "]. File " + (expected.exists() ? ("exists" + (cached ? " and is valid" : "and is invalid")) : "does not exist")); -+ if (!cached) { -+ final long finalCRC = expectedCRC; -+ CRCManager.setCRC(fileName, finalCRC); -+ if (expected.exists()) { -+ expected.delete(); -+ } -+ // Request copy of file -+ if (!url) { -+ SpoutClient.getInstance().getPacketManager().sendSpoutPacket(this); -+ } else { // Begin download -+ Runnable queued = null; -+ if (FileUtil.isImageFile(fileName)) { -+ queued = new Runnable() { -+ public void run() { -+ long crc = FileUtil.getCRC(expected, new byte[16384]); -+ System.out.println("Downloaded File " + fileName + "'s CRC " + crc + ", expected CRC: " + expectedCRC); -+ if (crc == finalCRC) { -+ CustomTextureManager.getTextureFromUrl(plugin, fileName); -+ } else { -+ System.out.println("WARNING, Downloaded File " + fileName + "'s CRC " + crc + " did not match the expected CRC: " + finalCRC); -+ } -+ } -+ }; -+ } -+ Download data = new Download(fileName, directory, file, queued); -+ FileDownloadThread.getInstance().addToDownloadQueue(data); -+ } -+ } else { -+ if (FileUtil.isImageFile(fileName)) { -+ CustomTextureManager.getTextureFromUrl(plugin, fileName); -+ } -+ } -+ } -+ -+ public void failure(int playerId) { -+ } -+ -+ public PacketType getPacketType() { -+ return PacketType.PacketPreCacheFile; -+ } -+ -+ public int getVersion() { -+ return 0; -+ } -+} ---- net/minecraft/src/TcpMonitorThread.java -+++ net/minecraft/src/TcpMonitorThread.java -@@ -3,20 +3,20 @@ - class TcpMonitorThread extends Thread { - final TcpConnection theTcpConnection; - -- TcpMonitorThread(TcpConnection var1) { -- this.theTcpConnection = var1; -+ TcpMonitorThread(TcpConnection par1TcpConnection) { -+ this.theTcpConnection = par1TcpConnection; - } - - public void run() { - try { - Thread.sleep(2000L); -- if(TcpConnection.isRunning(this.theTcpConnection)) { -+ -+ if (TcpConnection.isRunning(this.theTcpConnection)) { - TcpConnection.getWriteThread(this.theTcpConnection).interrupt(); - this.theTcpConnection.networkShutdown("disconnect.closed", new Object[0]); - } - } catch (Exception var2) { - var2.printStackTrace(); - } -- - } - } ---- net/minecraft/src/CallableLvl2.java -+++ net/minecraft/src/CallableLvl2.java -@@ -3,14 +3,19 @@ - import java.util.concurrent.Callable; - - class CallableLvl2 implements Callable { -+ -+ /** Reference to the World object. */ - final World theWorld; - -- CallableLvl2(World var1) { -- this.theWorld = var1; -+ CallableLvl2(World par1World) { -+ this.theWorld = par1World; - } - -+ /** -+ * Returns the size and contents of the player entity list. -+ */ - public String getPlayerEntities() { -- return this.theWorld.h.size() + " total; " + this.theWorld.h.toString(); -+ return this.theWorld.playerEntities.size() + " total; " + this.theWorld.playerEntities.toString(); - } - - public Object call() { ---- net/minecraft/src/NetHandler.java -+++ net/minecraft/src/NetHandler.java -@@ -1,316 +1,402 @@ - package net.minecraft.src; - - public abstract class NetHandler { -+ -+ /** -+ * determine if it is a server handler -+ */ - public abstract boolean isServerHandler(); - -- public void handleMapChunk(Packet51MapChunk var1) { -- } -- -- public void unexpectedPacket(Packet var1) { -- } -- -- public void handleErrorMessage(String var1, Object[] var2) { -- } -- -- public void handleKickDisconnect(Packet255KickDisconnect var1) { -- this.unexpectedPacket(var1); -- } -- -- public void handleLogin(Packet1Login var1) { -- this.unexpectedPacket(var1); -- } -- -- public void handleFlying(Packet10Flying var1) { -- this.unexpectedPacket(var1); -- } -- -- public void handleMultiBlockChange(Packet52MultiBlockChange var1) { -- this.unexpectedPacket(var1); -- } -- -- public void handleBlockDig(Packet14BlockDig var1) { -- this.unexpectedPacket(var1); -- } -- -- public void handleBlockChange(Packet53BlockChange var1) { -- this.unexpectedPacket(var1); -- } -- -- public void handleNamedEntitySpawn(Packet20NamedEntitySpawn var1) { -- this.unexpectedPacket(var1); -- } -- -- public void handleEntity(Packet30Entity var1) { -- this.unexpectedPacket(var1); -- } -- -- public void handleEntityTeleport(Packet34EntityTeleport var1) { -- this.unexpectedPacket(var1); -- } -- -- public void handlePlace(Packet15Place var1) { -- this.unexpectedPacket(var1); -- } -- -- public void handleBlockItemSwitch(Packet16BlockItemSwitch var1) { -- this.unexpectedPacket(var1); -- } -- -- public void handleDestroyEntity(Packet29DestroyEntity var1) { -- this.unexpectedPacket(var1); -- } -- -- public void handleCollect(Packet22Collect var1) { -- this.unexpectedPacket(var1); -- } -- -- public void handleChat(Packet3Chat var1) { -- this.unexpectedPacket(var1); -- } -- -- public void handleVehicleSpawn(Packet23VehicleSpawn var1) { -- this.unexpectedPacket(var1); -- } -- -- public void handleAnimation(Packet18Animation var1) { -- this.unexpectedPacket(var1); -- } -- -- public void handleEntityAction(Packet19EntityAction var1) { -- this.unexpectedPacket(var1); -- } -- -- public void handleClientProtocol(Packet2ClientProtocol var1) { -- this.unexpectedPacket(var1); -- } -- -- public void handleServerAuthData(Packet253ServerAuthData var1) { -- this.unexpectedPacket(var1); -- } -- -- public void handleSharedKey(Packet252SharedKey var1) { -- this.unexpectedPacket(var1); -- } -- -- public void handleMobSpawn(Packet24MobSpawn var1) { -- this.unexpectedPacket(var1); -- } -- -- public void handleUpdateTime(Packet4UpdateTime var1) { -- this.unexpectedPacket(var1); -- } -- -- public void handleSpawnPosition(Packet6SpawnPosition var1) { -- this.unexpectedPacket(var1); -- } -- -- public void handleEntityVelocity(Packet28EntityVelocity var1) { -- this.unexpectedPacket(var1); -- } -- -- public void handleEntityMetadata(Packet40EntityMetadata var1) { -- this.unexpectedPacket(var1); -- } -- -- public void handleAttachEntity(Packet39AttachEntity var1) { -- this.unexpectedPacket(var1); -- } -- -- public void handleUseEntity(Packet7UseEntity var1) { -- this.unexpectedPacket(var1); -- } -- -- public void handleEntityStatus(Packet38EntityStatus var1) { -- this.unexpectedPacket(var1); -- } -- -- public void handleUpdateHealth(Packet8UpdateHealth var1) { -- this.unexpectedPacket(var1); -- } -- -- public void handleRespawn(Packet9Respawn var1) { -- this.unexpectedPacket(var1); -- } -- -- public void handleExplosion(Packet60Explosion var1) { -- this.unexpectedPacket(var1); -- } -- -- public void handleOpenWindow(Packet100OpenWindow var1) { -- this.unexpectedPacket(var1); -- } -- -- public void handleCloseWindow(Packet101CloseWindow var1) { -- this.unexpectedPacket(var1); -- } -- -- public void handleWindowClick(Packet102WindowClick var1) { -- this.unexpectedPacket(var1); -- } -- -- public void handleSetSlot(Packet103SetSlot var1) { -- this.unexpectedPacket(var1); -- } -- -- public void handleWindowItems(Packet104WindowItems var1) { -- this.unexpectedPacket(var1); -- } -- -- public void handleUpdateSign(Packet130UpdateSign var1) { -- this.unexpectedPacket(var1); -- } -- -- public void handleUpdateProgressbar(Packet105UpdateProgressbar var1) { -- this.unexpectedPacket(var1); -- } -- -- public void handlePlayerInventory(Packet5PlayerInventory var1) { -- this.unexpectedPacket(var1); -- } -- -- public void handleTransaction(Packet106Transaction var1) { -- this.unexpectedPacket(var1); -- } -- -- public void handleEntityPainting(Packet25EntityPainting var1) { -- this.unexpectedPacket(var1); -- } -- -- public void handleBlockEvent(Packet54PlayNoteBlock var1) { -- this.unexpectedPacket(var1); -- } -- -- public void handleStatistic(Packet200Statistic var1) { -- this.unexpectedPacket(var1); -- } -- -- public void handleSleep(Packet17Sleep var1) { -- this.unexpectedPacket(var1); -- } -- -- public void func_110774_a(Packet27PlayerInput var1) { -- this.unexpectedPacket(var1); -- } -- -- public void handleGameEvent(Packet70GameEvent var1) { -- this.unexpectedPacket(var1); -- } -- -- public void handleWeather(Packet71Weather var1) { -- this.unexpectedPacket(var1); -- } -- -- public void handleMapData(Packet131MapData var1) { -- this.unexpectedPacket(var1); -- } -- -- public void handleDoorChange(Packet61DoorChange var1) { -- this.unexpectedPacket(var1); -- } -- -- public void handleServerPing(Packet254ServerPing var1) { -- this.unexpectedPacket(var1); -- } -- -- public void handleEntityEffect(Packet41EntityEffect var1) { -- this.unexpectedPacket(var1); -- } -- -- public void handleRemoveEntityEffect(Packet42RemoveEntityEffect var1) { -- this.unexpectedPacket(var1); -- } -- -- public void handlePlayerInfo(Packet201PlayerInfo var1) { -- this.unexpectedPacket(var1); -- } -- -- public void handleKeepAlive(Packet0KeepAlive var1) { -- this.unexpectedPacket(var1); -- } -- -- public void handleExperience(Packet43Experience var1) { -- this.unexpectedPacket(var1); -- } -- -- public void handleCreativeSetSlot(Packet107CreativeSetSlot var1) { -- this.unexpectedPacket(var1); -- } -- -- public void handleEntityExpOrb(Packet26EntityExpOrb var1) { -- this.unexpectedPacket(var1); -- } -- -- public void handleEnchantItem(Packet108EnchantItem var1) { -- } -- -- public void handleCustomPayload(Packet250CustomPayload var1) { -- } -- -- public void handleEntityHeadRotation(Packet35EntityHeadRotation var1) { -- this.unexpectedPacket(var1); -- } -- -- public void handleTileEntityData(Packet132TileEntityData var1) { -- this.unexpectedPacket(var1); -- } -- -- public void handlePlayerAbilities(Packet202PlayerAbilities var1) { -- this.unexpectedPacket(var1); -- } -- -- public void handleAutoComplete(Packet203AutoComplete var1) { -- this.unexpectedPacket(var1); -- } -- -- public void handleClientInfo(Packet204ClientInfo var1) { -- this.unexpectedPacket(var1); -- } -- -- public void handleLevelSound(Packet62LevelSound var1) { -- this.unexpectedPacket(var1); -- } -- -- public void handleBlockDestroy(Packet55BlockDestroy var1) { -- this.unexpectedPacket(var1); -- } -- -- public void handleClientCommand(Packet205ClientCommand var1) { -- } -- -- public void handleMapChunks(Packet56MapChunks var1) { -- this.unexpectedPacket(var1); -- } -- -+ /** -+ * Handle Packet51MapChunk (full chunk update of blocks, metadata, light levels, and optionally biome data) -+ */ -+ public void handleMapChunk(Packet51MapChunk par1Packet51MapChunk) {} -+ -+ /** -+ * Default handler called for packets that don't have their own handlers in NetClientHandler; currentlly does nothing. -+ */ -+ public void unexpectedPacket(Packet par1Packet) {} -+ -+ public void handleErrorMessage(String par1Str, Object[] par2ArrayOfObj) {} -+ -+ public void handleKickDisconnect(Packet255KickDisconnect par1Packet255KickDisconnect) { -+ this.unexpectedPacket(par1Packet255KickDisconnect); -+ } -+ -+ public void handleLogin(Packet1Login par1Packet1Login) { -+ this.unexpectedPacket(par1Packet1Login); -+ } -+ -+ public void handleFlying(Packet10Flying par1Packet10Flying) { -+ this.unexpectedPacket(par1Packet10Flying); -+ } -+ -+ public void handleMultiBlockChange(Packet52MultiBlockChange par1Packet52MultiBlockChange) { -+ this.unexpectedPacket(par1Packet52MultiBlockChange); -+ } -+ -+ public void handleBlockDig(Packet14BlockDig par1Packet14BlockDig) { -+ this.unexpectedPacket(par1Packet14BlockDig); -+ } -+ -+ public void handleBlockChange(Packet53BlockChange par1Packet53BlockChange) { -+ this.unexpectedPacket(par1Packet53BlockChange); -+ } -+ -+ public void handleNamedEntitySpawn(Packet20NamedEntitySpawn par1Packet20NamedEntitySpawn) { -+ this.unexpectedPacket(par1Packet20NamedEntitySpawn); -+ } -+ -+ public void handleEntity(Packet30Entity par1Packet30Entity) { -+ this.unexpectedPacket(par1Packet30Entity); -+ } -+ -+ public void handleEntityTeleport(Packet34EntityTeleport par1Packet34EntityTeleport) { -+ this.unexpectedPacket(par1Packet34EntityTeleport); -+ } -+ -+ public void handlePlace(Packet15Place par1Packet15Place) { -+ this.unexpectedPacket(par1Packet15Place); -+ } -+ -+ public void handleBlockItemSwitch(Packet16BlockItemSwitch par1Packet16BlockItemSwitch) { -+ this.unexpectedPacket(par1Packet16BlockItemSwitch); -+ } -+ -+ public void handleDestroyEntity(Packet29DestroyEntity par1Packet29DestroyEntity) { -+ this.unexpectedPacket(par1Packet29DestroyEntity); -+ } -+ -+ public void handleCollect(Packet22Collect par1Packet22Collect) { -+ this.unexpectedPacket(par1Packet22Collect); -+ } -+ -+ public void handleChat(Packet3Chat par1Packet3Chat) { -+ this.unexpectedPacket(par1Packet3Chat); -+ } -+ -+ public void handleVehicleSpawn(Packet23VehicleSpawn par1Packet23VehicleSpawn) { -+ this.unexpectedPacket(par1Packet23VehicleSpawn); -+ } -+ -+ public void handleAnimation(Packet18Animation par1Packet18Animation) { -+ this.unexpectedPacket(par1Packet18Animation); -+ } -+ -+ /** -+ * runs registerPacket on the given Packet19EntityAction -+ */ -+ public void handleEntityAction(Packet19EntityAction par1Packet19EntityAction) { -+ this.unexpectedPacket(par1Packet19EntityAction); -+ } -+ -+ public void handleClientProtocol(Packet2ClientProtocol par1Packet2ClientProtocol) { -+ this.unexpectedPacket(par1Packet2ClientProtocol); -+ } -+ -+ public void handleServerAuthData(Packet253ServerAuthData par1Packet253ServerAuthData) { -+ this.unexpectedPacket(par1Packet253ServerAuthData); -+ } -+ -+ public void handleSharedKey(Packet252SharedKey par1Packet252SharedKey) { -+ this.unexpectedPacket(par1Packet252SharedKey); -+ } -+ -+ public void handleMobSpawn(Packet24MobSpawn par1Packet24MobSpawn) { -+ this.unexpectedPacket(par1Packet24MobSpawn); -+ } -+ -+ public void handleUpdateTime(Packet4UpdateTime par1Packet4UpdateTime) { -+ this.unexpectedPacket(par1Packet4UpdateTime); -+ } -+ -+ public void handleSpawnPosition(Packet6SpawnPosition par1Packet6SpawnPosition) { -+ this.unexpectedPacket(par1Packet6SpawnPosition); -+ } -+ -+ /** -+ * Packet handler -+ */ -+ public void handleEntityVelocity(Packet28EntityVelocity par1Packet28EntityVelocity) { -+ this.unexpectedPacket(par1Packet28EntityVelocity); -+ } -+ -+ /** -+ * Packet handler -+ */ -+ public void handleEntityMetadata(Packet40EntityMetadata par1Packet40EntityMetadata) { -+ this.unexpectedPacket(par1Packet40EntityMetadata); -+ } -+ -+ /** -+ * Packet handler -+ */ -+ public void handleAttachEntity(Packet39AttachEntity par1Packet39AttachEntity) { -+ this.unexpectedPacket(par1Packet39AttachEntity); -+ } -+ -+ public void handleUseEntity(Packet7UseEntity par1Packet7UseEntity) { -+ this.unexpectedPacket(par1Packet7UseEntity); -+ } -+ -+ /** -+ * Packet handler -+ */ -+ public void handleEntityStatus(Packet38EntityStatus par1Packet38EntityStatus) { -+ this.unexpectedPacket(par1Packet38EntityStatus); -+ } -+ -+ /** -+ * Recieves player health from the server and then proceeds to set it locally on the client. -+ */ -+ public void handleUpdateHealth(Packet8UpdateHealth par1Packet8UpdateHealth) { -+ this.unexpectedPacket(par1Packet8UpdateHealth); -+ } -+ -+ /** -+ * respawns the player -+ */ -+ public void handleRespawn(Packet9Respawn par1Packet9Respawn) { -+ this.unexpectedPacket(par1Packet9Respawn); -+ } -+ -+ public void handleExplosion(Packet60Explosion par1Packet60Explosion) { -+ this.unexpectedPacket(par1Packet60Explosion); -+ } -+ -+ public void handleOpenWindow(Packet100OpenWindow par1Packet100OpenWindow) { -+ this.unexpectedPacket(par1Packet100OpenWindow); -+ } -+ -+ public void handleCloseWindow(Packet101CloseWindow par1Packet101CloseWindow) { -+ this.unexpectedPacket(par1Packet101CloseWindow); -+ } -+ -+ public void handleWindowClick(Packet102WindowClick par1Packet102WindowClick) { -+ this.unexpectedPacket(par1Packet102WindowClick); -+ } -+ -+ public void handleSetSlot(Packet103SetSlot par1Packet103SetSlot) { -+ this.unexpectedPacket(par1Packet103SetSlot); -+ } -+ -+ public void handleWindowItems(Packet104WindowItems par1Packet104WindowItems) { -+ this.unexpectedPacket(par1Packet104WindowItems); -+ } -+ -+ /** -+ * Updates Client side signs -+ */ -+ public void handleUpdateSign(Packet130UpdateSign par1Packet130UpdateSign) { -+ this.unexpectedPacket(par1Packet130UpdateSign); -+ } -+ -+ public void handleUpdateProgressbar(Packet105UpdateProgressbar par1Packet105UpdateProgressbar) { -+ this.unexpectedPacket(par1Packet105UpdateProgressbar); -+ } -+ -+ public void handlePlayerInventory(Packet5PlayerInventory par1Packet5PlayerInventory) { -+ this.unexpectedPacket(par1Packet5PlayerInventory); -+ } -+ -+ public void handleTransaction(Packet106Transaction par1Packet106Transaction) { -+ this.unexpectedPacket(par1Packet106Transaction); -+ } -+ -+ /** -+ * Packet handler -+ */ -+ public void handleEntityPainting(Packet25EntityPainting par1Packet25EntityPainting) { -+ this.unexpectedPacket(par1Packet25EntityPainting); -+ } -+ -+ public void handleBlockEvent(Packet54PlayNoteBlock par1Packet54PlayNoteBlock) { -+ this.unexpectedPacket(par1Packet54PlayNoteBlock); -+ } -+ -+ /** -+ * Increment player statistics -+ */ -+ public void handleStatistic(Packet200Statistic par1Packet200Statistic) { -+ this.unexpectedPacket(par1Packet200Statistic); -+ } -+ -+ public void handleSleep(Packet17Sleep par1Packet17Sleep) { -+ this.unexpectedPacket(par1Packet17Sleep); -+ } -+ -+ public void func_110774_a(Packet27PlayerInput par1Packet27PlayerInput) { -+ this.unexpectedPacket(par1Packet27PlayerInput); -+ } -+ -+ public void handleGameEvent(Packet70GameEvent par1Packet70GameEvent) { -+ this.unexpectedPacket(par1Packet70GameEvent); -+ } -+ -+ /** -+ * Handles weather packet -+ */ -+ public void handleWeather(Packet71Weather par1Packet71Weather) { -+ this.unexpectedPacket(par1Packet71Weather); -+ } -+ -+ /** -+ * Contains logic for handling packets containing arbitrary unique item data. Currently this is only for maps. -+ */ -+ public void handleMapData(Packet131MapData par1Packet131MapData) { -+ this.unexpectedPacket(par1Packet131MapData); -+ } -+ -+ public void handleDoorChange(Packet61DoorChange par1Packet61DoorChange) { -+ this.unexpectedPacket(par1Packet61DoorChange); -+ } -+ -+ /** -+ * Handle a server ping packet. -+ */ -+ public void handleServerPing(Packet254ServerPing par1Packet254ServerPing) { -+ this.unexpectedPacket(par1Packet254ServerPing); -+ } -+ -+ /** -+ * Handle an entity effect packet. -+ */ -+ public void handleEntityEffect(Packet41EntityEffect par1Packet41EntityEffect) { -+ this.unexpectedPacket(par1Packet41EntityEffect); -+ } -+ -+ /** -+ * Handle a remove entity effect packet. -+ */ -+ public void handleRemoveEntityEffect(Packet42RemoveEntityEffect par1Packet42RemoveEntityEffect) { -+ this.unexpectedPacket(par1Packet42RemoveEntityEffect); -+ } -+ -+ /** -+ * Handle a player information packet. -+ */ -+ public void handlePlayerInfo(Packet201PlayerInfo par1Packet201PlayerInfo) { -+ this.unexpectedPacket(par1Packet201PlayerInfo); -+ } -+ -+ /** -+ * Handle a keep alive packet. -+ */ -+ public void handleKeepAlive(Packet0KeepAlive par1Packet0KeepAlive) { -+ this.unexpectedPacket(par1Packet0KeepAlive); -+ } -+ -+ /** -+ * Handle an experience packet. -+ */ -+ public void handleExperience(Packet43Experience par1Packet43Experience) { -+ this.unexpectedPacket(par1Packet43Experience); -+ } -+ -+ /** -+ * Handle a creative slot packet. -+ */ -+ public void handleCreativeSetSlot(Packet107CreativeSetSlot par1Packet107CreativeSetSlot) { -+ this.unexpectedPacket(par1Packet107CreativeSetSlot); -+ } -+ -+ /** -+ * Handle a entity experience orb packet. -+ */ -+ public void handleEntityExpOrb(Packet26EntityExpOrb par1Packet26EntityExpOrb) { -+ this.unexpectedPacket(par1Packet26EntityExpOrb); -+ } -+ -+ public void handleEnchantItem(Packet108EnchantItem par1Packet108EnchantItem) {} -+ -+ public void handleCustomPayload(Packet250CustomPayload par1Packet250CustomPayload) {} -+ -+ public void handleEntityHeadRotation(Packet35EntityHeadRotation par1Packet35EntityHeadRotation) { -+ this.unexpectedPacket(par1Packet35EntityHeadRotation); -+ } -+ -+ public void handleTileEntityData(Packet132TileEntityData par1Packet132TileEntityData) { -+ this.unexpectedPacket(par1Packet132TileEntityData); -+ } -+ -+ /** -+ * Handle a player abilities packet. -+ */ -+ public void handlePlayerAbilities(Packet202PlayerAbilities par1Packet202PlayerAbilities) { -+ this.unexpectedPacket(par1Packet202PlayerAbilities); -+ } -+ -+ public void handleAutoComplete(Packet203AutoComplete par1Packet203AutoComplete) { -+ this.unexpectedPacket(par1Packet203AutoComplete); -+ } -+ -+ public void handleClientInfo(Packet204ClientInfo par1Packet204ClientInfo) { -+ this.unexpectedPacket(par1Packet204ClientInfo); -+ } -+ -+ public void handleLevelSound(Packet62LevelSound par1Packet62LevelSound) { -+ this.unexpectedPacket(par1Packet62LevelSound); -+ } -+ -+ public void handleBlockDestroy(Packet55BlockDestroy par1Packet55BlockDestroy) { -+ this.unexpectedPacket(par1Packet55BlockDestroy); -+ } -+ -+ public void handleClientCommand(Packet205ClientCommand par1Packet205ClientCommand) {} -+ -+ public void handleMapChunks(Packet56MapChunks par1Packet56MapChunks) { -+ this.unexpectedPacket(par1Packet56MapChunks); -+ } -+ -+ /** -+ * If this returns false, all packets will be queued for the main thread to handle, even if they would otherwise be -+ * processed asynchronously. Used to avoid processing packets on the client before the world has been downloaded (which -+ * happens on the main thread) -+ */ - public boolean canProcessPacketsAsync() { - return false; - } - -- public void handleSetObjective(Packet206SetObjective var1) { -- this.unexpectedPacket(var1); -- } -- -- public void handleSetScore(Packet207SetScore var1) { -- this.unexpectedPacket(var1); -- } -- -- public void handleSetDisplayObjective(Packet208SetDisplayObjective var1) { -- this.unexpectedPacket(var1); -- } -- -- public void handleSetPlayerTeam(Packet209SetPlayerTeam var1) { -- this.unexpectedPacket(var1); -- } -- -- public void handleWorldParticles(Packet63WorldParticles var1) { -- this.unexpectedPacket(var1); -- } -- -- public void func_110773_a(Packet44UpdateAttributes var1) { -- this.unexpectedPacket(var1); -- } -- -- public void func_142031_a(Packet133TileEditorOpen var1) { -- } -+ /** -+ * Handle a set objective packet. -+ */ -+ public void handleSetObjective(Packet206SetObjective par1Packet206SetObjective) { -+ this.unexpectedPacket(par1Packet206SetObjective); -+ } -+ -+ /** -+ * Handle a set score packet. -+ */ -+ public void handleSetScore(Packet207SetScore par1Packet207SetScore) { -+ this.unexpectedPacket(par1Packet207SetScore); -+ } -+ -+ /** -+ * Handle a set display objective packet. -+ */ -+ public void handleSetDisplayObjective(Packet208SetDisplayObjective par1Packet208SetDisplayObjective) { -+ this.unexpectedPacket(par1Packet208SetDisplayObjective); -+ } -+ -+ /** -+ * Handle a set player team packet. -+ */ -+ public void handleSetPlayerTeam(Packet209SetPlayerTeam par1Packet209SetPlayerTeam) { -+ this.unexpectedPacket(par1Packet209SetPlayerTeam); -+ } -+ -+ /** -+ * Handle a world particles packet. -+ */ -+ public void handleWorldParticles(Packet63WorldParticles par1Packet63WorldParticles) { -+ this.unexpectedPacket(par1Packet63WorldParticles); -+ } -+ -+ public void func_110773_a(Packet44UpdateAttributes par1Packet44UpdateAttributes) { -+ this.unexpectedPacket(par1Packet44UpdateAttributes); -+ } -+ -+ public void func_142031_a(Packet133TileEditorOpen par1Packet133TileEditorOpen) {} - - public boolean isConnectionClosed() { - return false; ---- net/minecraft/src/GuiScreenServerList.java -+++ net/minecraft/src/GuiScreenServerList.java -@@ -3,68 +3,91 @@ - import org.lwjgl.input.Keyboard; - - public class GuiScreenServerList extends GuiScreen { -+ -+ /** Needed a change as a local variable was conflicting on construct */ - private final GuiScreen guiScreen; -+ -+ /** Instance of ServerData. */ - private final ServerData theServerData; - private GuiTextField serverTextField; - -- public GuiScreenServerList(GuiScreen var1, ServerData var2) { -- this.guiScreen = var1; -- this.theServerData = var2; -+ public GuiScreenServerList(GuiScreen par1GuiScreen, ServerData par2ServerData) { -+ this.guiScreen = par1GuiScreen; -+ this.theServerData = par2ServerData; - } - -+ /** -+ * Called from the main game loop to update the screen. -+ */ - public void updateScreen() { - this.serverTextField.updateCursorCounter(); - } - -+ /** -+ * Adds the buttons (and other controls) to the screen in question. -+ */ - public void initGui() { - Keyboard.enableRepeatEvents(true); -- this.i.clear(); -- this.i.add(new GuiButton(0, this.width / 2 - 100, this.height / 4 + 96 + 12, I18n.getString("selectServer.select"))); -- this.i.add(new GuiButton(1, this.width / 2 - 100, this.height / 4 + 120 + 12, I18n.getString("gui.cancel"))); -+ this.buttonList.clear(); -+ this.buttonList.add(new GuiButton(0, this.width / 2 - 100, this.height / 4 + 96 + 12, I18n.getString("selectServer.select"))); -+ this.buttonList.add(new GuiButton(1, this.width / 2 - 100, this.height / 4 + 120 + 12, I18n.getString("gui.cancel"))); - this.serverTextField = new GuiTextField(this.fontRenderer, this.width / 2 - 100, 116, 200, 20); - this.serverTextField.setMaxStringLength(128); - this.serverTextField.setFocused(true); -- this.serverTextField.setText(this.mc.gameSettings.ad); -- ((GuiButton)this.i.get(0)).enabled = this.serverTextField.getText().length() > 0 && this.serverTextField.getText().split(":").length > 0; -+ this.serverTextField.setText(this.mc.gameSettings.lastServer); -+ ((GuiButton)this.buttonList.get(0)).enabled = this.serverTextField.getText().length() > 0 && this.serverTextField.getText().split(":").length > 0; - } - -+ /** -+ * Called when the screen is unloaded. Used to disable keyboard repeat events -+ */ - public void onGuiClosed() { - Keyboard.enableRepeatEvents(false); -- this.mc.gameSettings.ad = this.serverTextField.getText(); -+ this.mc.gameSettings.lastServer = this.serverTextField.getText(); - this.mc.gameSettings.saveOptions(); - } - -- protected void actionPerformed(GuiButton var1) { -- if(var1.enabled) { -- if(var1.id == 1) { -+ /** -+ * Fired when a control is clicked. This is the equivalent of ActionListener.actionPerformed(ActionEvent e). -+ */ -+ protected void actionPerformed(GuiButton par1GuiButton) { -+ if (par1GuiButton.enabled) { -+ if (par1GuiButton.id == 1) { - this.guiScreen.confirmClicked(false, 0); -- } else if(var1.id == 0) { -- this.theServerData.b = this.serverTextField.getText(); -+ } else if (par1GuiButton.id == 0) { -+ this.theServerData.serverIP = this.serverTextField.getText(); - this.guiScreen.confirmClicked(true, 0); - } -- -- } -- } -- -- protected void keyTyped(char var1, int var2) { -- if(this.serverTextField.textboxKeyTyped(var1, var2)) { -- ((GuiButton)this.i.get(0)).enabled = this.serverTextField.getText().length() > 0 && this.serverTextField.getText().split(":").length > 0; -- } else if(var2 == 28 || var2 == 156) { -- this.actionPerformed((GuiButton)this.i.get(0)); -- } -- -- } -- -- protected void mouseClicked(int var1, int var2, int var3) { -- super.mouseClicked(var1, var2, var3); -- this.serverTextField.mouseClicked(var1, var2, var3); -- } -- -- public void drawScreen(int var1, int var2, float var3) { -+ } -+ } -+ -+ /** -+ * Fired when a key is typed. This is the equivalent of KeyListener.keyTyped(KeyEvent e). -+ */ -+ protected void keyTyped(char par1, int par2) { -+ if (this.serverTextField.textboxKeyTyped(par1, par2)) { -+ ((GuiButton)this.buttonList.get(0)).enabled = this.serverTextField.getText().length() > 0 && this.serverTextField.getText().split(":").length > 0; -+ } else if (par2 == 28 || par2 == 156) { -+ this.actionPerformed((GuiButton)this.buttonList.get(0)); -+ } -+ } -+ -+ /** -+ * Called when the mouse is clicked. -+ */ -+ protected void mouseClicked(int par1, int par2, int par3) { -+ super.mouseClicked(par1, par2, par3); -+ this.serverTextField.mouseClicked(par1, par2, par3); -+ } -+ -+ /** -+ * Draws the screen and all the components in it. -+ */ -+ public void drawScreen(int par1, int par2, float par3) { - this.drawDefaultBackground(); - this.drawCenteredString(this.fontRenderer, I18n.getString("selectServer.direct"), this.width / 2, 20, 16777215); - this.drawString(this.fontRenderer, I18n.getString("addServer.enterIp"), this.width / 2 - 100, 100, 10526880); - this.serverTextField.drawTextBox(); -- super.drawScreen(var1, var2, var3); -+ super.drawScreen(par1, par2, par3); - } - } ---- net/minecraft/src/IAdminCommand.java -+++ net/minecraft/src/IAdminCommand.java -@@ -1,5 +1,10 @@ - package net.minecraft.src; - - public interface IAdminCommand { -- void notifyAdmins(ICommandSender var1, int var2, String var3, Object... var4); -+ -+ /** -+ * Sends a message to the admins of the server from a given CommandSender with the given resource string and given -+ * extra srings. If the int par2 is even or zero, the original sender is also notified. -+ */ -+ void notifyAdmins(ICommandSender var1, int var2, String var3, Object ... var4); - } ---- net/minecraft/src/MapGenCavesHell.java -+++ net/minecraft/src/MapGenCavesHell.java -@@ -3,109 +3,123 @@ - import java.util.Random; - - public class MapGenCavesHell extends MapGenBase { -- protected void generateLargeCaveNode(long var1, int var3, int var4, byte[] var5, double var6, double var8, double var10) { -- this.generateCaveNode(var1, var3, var4, var5, var6, var8, var10, 1.0F + this.b.nextFloat() * 6.0F, 0.0F, 0.0F, -1, -1, 0.5D); -+ -+ /** -+ * Generates a larger initial cave node than usual. Called 25% of the time. -+ */ -+ protected void generateLargeCaveNode(long par1, int par3, int par4, byte[] par5ArrayOfByte, double par6, double par8, double par10) { -+ this.generateCaveNode(par1, par3, par4, par5ArrayOfByte, par6, par8, par10, 1.0F + this.rand.nextFloat() * 6.0F, 0.0F, 0.0F, -1, -1, 0.5D); - } - -- protected void generateCaveNode(long var1, int var3, int var4, byte[] var5, double var6, double var8, double var10, float var12, float var13, float var14, int var15, int var16, double var17) { -- double var19 = (double)(var3 * 16 + 8); -- double var21 = (double)(var4 * 16 + 8); -+ /** -+ * Generates a node in the current cave system recursion tree. -+ */ -+ protected void generateCaveNode(long par1, int par3, int par4, byte[] par5ArrayOfByte, double par6, double par8, double par10, float par12, float par13, float par14, int par15, int par16, double par17) { -+ double var19 = (double)(par3 * 16 + 8); -+ double var21 = (double)(par4 * 16 + 8); - float var23 = 0.0F; - float var24 = 0.0F; -- Random var25 = new Random(var1); -- if(var16 <= 0) { -+ Random var25 = new Random(par1); -+ -+ if (par16 <= 0) { - int var26 = this.range * 16 - 16; -- var16 = var26 - var25.nextInt(var26 / 4); -+ par16 = var26 - var25.nextInt(var26 / 4); - } - - boolean var53 = false; -- if(var15 == -1) { -- var15 = var16 / 2; -+ -+ if (par15 == -1) { -+ par15 = par16 / 2; - var53 = true; - } - -- int var27 = var25.nextInt(var16 / 2) + var16 / 4; -- -- for(boolean var28 = var25.nextInt(6) == 0; var15 < var16; ++var15) { -- double var29 = 1.5D + (double)(MathHelper.sin((float)var15 * (float)Math.PI / (float)var16) * var12 * 1.0F); -- double var31 = var29 * var17; -- float var33 = MathHelper.cos(var14); -- float var34 = MathHelper.sin(var14); -- var6 += (double)(MathHelper.cos(var13) * var33); -- var8 += (double)var34; -- var10 += (double)(MathHelper.sin(var13) * var33); -- if(var28) { -- var14 *= 0.92F; -+ int var27 = var25.nextInt(par16 / 2) + par16 / 4; -+ -+ for (boolean var28 = var25.nextInt(6) == 0; par15 < par16; ++par15) { -+ double var29 = 1.5D + (double)(MathHelper.sin((float)par15 * (float)Math.PI / (float)par16) * par12 * 1.0F); -+ double var31 = var29 * par17; -+ float var33 = MathHelper.cos(par14); -+ float var34 = MathHelper.sin(par14); -+ par6 += (double)(MathHelper.cos(par13) * var33); -+ par8 += (double)var34; -+ par10 += (double)(MathHelper.sin(par13) * var33); -+ -+ if (var28) { -+ par14 *= 0.92F; - } else { -- var14 *= 0.7F; -+ par14 *= 0.7F; - } - -- var14 += var24 * 0.1F; -- var13 += var23 * 0.1F; -+ par14 += var24 * 0.1F; -+ par13 += var23 * 0.1F; - var24 *= 0.9F; -- var23 *= 12.0F / 16.0F; -+ var23 *= 0.75F; - var24 += (var25.nextFloat() - var25.nextFloat()) * var25.nextFloat() * 2.0F; - var23 += (var25.nextFloat() - var25.nextFloat()) * var25.nextFloat() * 4.0F; -- if(!var53 && var15 == var27 && var12 > 1.0F) { -- this.generateCaveNode(var25.nextLong(), var3, var4, var5, var6, var8, var10, var25.nextFloat() * 0.5F + 0.5F, var13 - (float)Math.PI * 0.5F, var14 / 3.0F, var15, var16, 1.0D); -- this.generateCaveNode(var25.nextLong(), var3, var4, var5, var6, var8, var10, var25.nextFloat() * 0.5F + 0.5F, var13 + (float)Math.PI * 0.5F, var14 / 3.0F, var15, var16, 1.0D); -+ -+ if (!var53 && par15 == var27 && par12 > 1.0F) { -+ this.generateCaveNode(var25.nextLong(), par3, par4, par5ArrayOfByte, par6, par8, par10, var25.nextFloat() * 0.5F + 0.5F, par13 - ((float)Math.PI / 2F), par14 / 3.0F, par15, par16, 1.0D); -+ this.generateCaveNode(var25.nextLong(), par3, par4, par5ArrayOfByte, par6, par8, par10, var25.nextFloat() * 0.5F + 0.5F, par13 + ((float)Math.PI / 2F), par14 / 3.0F, par15, par16, 1.0D); - return; - } - -- if(var53 || var25.nextInt(4) != 0) { -- double var35 = var6 - var19; -- double var37 = var10 - var21; -- double var39 = (double)(var16 - var15); -- double var41 = (double)(var12 + 2.0F + 16.0F); -- if(var35 * var35 + var37 * var37 - var39 * var39 > var41 * var41) { -+ if (var53 || var25.nextInt(4) != 0) { -+ double var35 = par6 - var19; -+ double var37 = par10 - var21; -+ double var39 = (double)(par16 - par15); -+ double var41 = (double)(par12 + 2.0F + 16.0F); -+ -+ if (var35 * var35 + var37 * var37 - var39 * var39 > var41 * var41) { - return; - } - -- if(var6 >= var19 - 16.0D - var29 * 2.0D && var10 >= var21 - 16.0D - var29 * 2.0D && var6 <= var19 + 16.0D + var29 * 2.0D && var10 <= var21 + 16.0D + var29 * 2.0D) { -- int var54 = MathHelper.floor_double(var6 - var29) - var3 * 16 - 1; -- int var36 = MathHelper.floor_double(var6 + var29) - var3 * 16 + 1; -- int var55 = MathHelper.floor_double(var8 - var31) - 1; -- int var38 = MathHelper.floor_double(var8 + var31) + 1; -- int var56 = MathHelper.floor_double(var10 - var29) - var4 * 16 - 1; -- int var40 = MathHelper.floor_double(var10 + var29) - var4 * 16 + 1; -- if(var54 < 0) { -+ if (par6 >= var19 - 16.0D - var29 * 2.0D && par10 >= var21 - 16.0D - var29 * 2.0D && par6 <= var19 + 16.0D + var29 * 2.0D && par10 <= var21 + 16.0D + var29 * 2.0D) { -+ int var54 = MathHelper.floor_double(par6 - var29) - par3 * 16 - 1; -+ int var36 = MathHelper.floor_double(par6 + var29) - par3 * 16 + 1; -+ int var55 = MathHelper.floor_double(par8 - var31) - 1; -+ int var38 = MathHelper.floor_double(par8 + var31) + 1; -+ int var56 = MathHelper.floor_double(par10 - var29) - par4 * 16 - 1; -+ int var40 = MathHelper.floor_double(par10 + var29) - par4 * 16 + 1; -+ -+ if (var54 < 0) { - var54 = 0; - } - -- if(var36 > 16) { -+ if (var36 > 16) { - var36 = 16; - } - -- if(var55 < 1) { -+ if (var55 < 1) { - var55 = 1; - } - -- if(var38 > 120) { -+ if (var38 > 120) { - var38 = 120; - } - -- if(var56 < 0) { -+ if (var56 < 0) { - var56 = 0; - } - -- if(var40 > 16) { -+ if (var40 > 16) { - var40 = 16; - } - - boolean var57 = false; -- - int var42; - int var45; -- for(var42 = var54; !var57 && var42 < var36; ++var42) { -- for(int var43 = var56; !var57 && var43 < var40; ++var43) { -- for(int var44 = var38 + 1; !var57 && var44 >= var55 - 1; --var44) { -+ -+ for (var42 = var54; !var57 && var42 < var36; ++var42) { -+ for (int var43 = var56; !var57 && var43 < var40; ++var43) { -+ for (int var44 = var38 + 1; !var57 && var44 >= var55 - 1; --var44) { - var45 = (var42 * 16 + var43) * 128 + var44; -- if(var44 >= 0 && var44 < 128) { -- if(var5[var45] == Block.lavaMoving.blockID || var5[var45] == Block.lavaStill.blockID) { -+ -+ if (var44 >= 0 && var44 < 128) { -+ if (par5ArrayOfByte[var45] == Block.lavaMoving.blockID || par5ArrayOfByte[var45] == Block.lavaStill.blockID) { - var57 = true; - } - -- if(var44 != var55 - 1 && var42 != var54 && var42 != var36 - 1 && var43 != var56 && var43 != var40 - 1) { -+ if (var44 != var55 - 1 && var42 != var54 && var42 != var36 - 1 && var43 != var56 && var43 != var40 - 1) { - var44 = var55; - } - } -@@ -113,20 +127,22 @@ - } - } - -- if(!var57) { -- for(var42 = var54; var42 < var36; ++var42) { -- double var58 = ((double)(var42 + var3 * 16) + 0.5D - var6) / var29; -+ if (!var57) { -+ for (var42 = var54; var42 < var36; ++var42) { -+ double var58 = ((double)(var42 + par3 * 16) + 0.5D - par6) / var29; - -- for(var45 = var56; var45 < var40; ++var45) { -- double var46 = ((double)(var45 + var4 * 16) + 0.5D - var10) / var29; -+ for (var45 = var56; var45 < var40; ++var45) { -+ double var46 = ((double)(var45 + par4 * 16) + 0.5D - par10) / var29; - int var48 = (var42 * 16 + var45) * 128 + var38; - -- for(int var49 = var38 - 1; var49 >= var55; --var49) { -- double var50 = ((double)var49 + 0.5D - var8) / var31; -- if(var50 > -0.7D && var58 * var58 + var50 * var50 + var46 * var46 < 1.0D) { -- byte var52 = var5[var48]; -- if(var52 == Block.netherrack.blockID || var52 == Block.dirt.blockID || var52 == Block.grass.blockID) { -- var5[var48] = 0; -+ for (int var49 = var38 - 1; var49 >= var55; --var49) { -+ double var50 = ((double)var49 + 0.5D - par8) / var31; -+ -+ if (var50 > -0.7D && var58 * var58 + var50 * var50 + var46 * var46 < 1.0D) { -+ byte var52 = par5ArrayOfByte[var48]; -+ -+ if (var52 == Block.netherrack.blockID || var52 == Block.dirt.blockID || var52 == Block.grass.blockID) { -+ par5ArrayOfByte[var48] = 0; - } - } - -@@ -135,39 +151,42 @@ - } - } - -- if(var53) { -+ if (var53) { - break; - } - } - } - } - } -- - } - -- protected void recursiveGenerate(World var1, int var2, int var3, int var4, int var5, byte[] var6) { -- int var7 = this.b.nextInt(this.b.nextInt(this.b.nextInt(10) + 1) + 1); -- if(this.b.nextInt(5) != 0) { -+ /** -+ * Recursively called by generate() (generate) and optionally by itself. -+ */ -+ protected void recursiveGenerate(World par1World, int par2, int par3, int par4, int par5, byte[] par6ArrayOfByte) { -+ int var7 = this.rand.nextInt(this.rand.nextInt(this.rand.nextInt(10) + 1) + 1); -+ -+ if (this.rand.nextInt(5) != 0) { - var7 = 0; - } - -- for(int var8 = 0; var8 < var7; ++var8) { -- double var9 = (double)(var2 * 16 + this.b.nextInt(16)); -- double var11 = (double)this.b.nextInt(128); -- double var13 = (double)(var3 * 16 + this.b.nextInt(16)); -+ for (int var8 = 0; var8 < var7; ++var8) { -+ double var9 = (double)(par2 * 16 + this.rand.nextInt(16)); -+ double var11 = (double)this.rand.nextInt(128); -+ double var13 = (double)(par3 * 16 + this.rand.nextInt(16)); - int var15 = 1; -- if(this.b.nextInt(4) == 0) { -- this.generateLargeCaveNode(this.b.nextLong(), var4, var5, var6, var9, var11, var13); -- var15 += this.b.nextInt(4); -+ -+ if (this.rand.nextInt(4) == 0) { -+ this.generateLargeCaveNode(this.rand.nextLong(), par4, par5, par6ArrayOfByte, var9, var11, var13); -+ var15 += this.rand.nextInt(4); - } - -- for(int var16 = 0; var16 < var15; ++var16) { -- float var17 = this.b.nextFloat() * (float)Math.PI * 2.0F; -- float var18 = (this.b.nextFloat() - 0.5F) * 2.0F / 8.0F; -- float var19 = this.b.nextFloat() * 2.0F + this.b.nextFloat(); -- this.generateCaveNode(this.b.nextLong(), var4, var5, var6, var9, var11, var13, var19 * 2.0F, var17, var18, 0, 0, 0.5D); -+ for (int var16 = 0; var16 < var15; ++var16) { -+ float var17 = this.rand.nextFloat() * (float)Math.PI * 2.0F; -+ float var18 = (this.rand.nextFloat() - 0.5F) * 2.0F / 8.0F; -+ float var19 = this.rand.nextFloat() * 2.0F + this.rand.nextFloat(); -+ this.generateCaveNode(this.rand.nextLong(), par4, par5, par6ArrayOfByte, var9, var11, var13, var19 * 2.0F, var17, var18, 0, 0, 0.5D); - } - } -- - } - } ---- /dev/null -+++ org/spoutcraft/client/gui/settings/controls/Anaglyph3DButton.java -@@ -1,0 +1,40 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.client.gui.settings.controls; -+ -+import net.minecraft.src.Minecraft; -+ -+import org.spoutcraft.api.gui.GenericCheckBox; -+import org.spoutcraft.client.config.Configuration; -+ -+public class Anaglyph3DButton extends GenericCheckBox { -+ public Anaglyph3DButton() { -+ super("3D Anaglyph"); -+ setChecked(Configuration.isAnaglyph3D()); -+ setTooltip("3D mode used with red-cyan 3D glasses."); -+ } -+ -+ @Override -+ public void onButtonClick() { -+ Configuration.setAnaglyph3D(!Configuration.isAnaglyph3D()); -+ Minecraft.getMinecraft().gameSettings.anaglyph = Configuration.isAnaglyph3D(); -+ Minecraft.getMinecraft().refreshResources(); -+ } -+} ---- /dev/null -+++ org/spoutcraft/client/gui/server/StaticServerModel.java -@@ -1,0 +1,190 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.client.gui.server; -+ -+import java.io.BufferedReader; -+import java.io.File; -+import java.io.FileNotFoundException; -+import java.io.FileReader; -+import java.io.FileWriter; -+import java.io.IOException; -+import java.util.ArrayList; -+import java.util.HashMap; -+ -+import org.yaml.snakeyaml.Yaml; -+ -+import org.spoutcraft.client.SpoutClient; -+import org.spoutcraft.client.io.FileUtil; -+ -+public class StaticServerModel extends ServerModel { -+ public StaticServerModel() { -+ } -+ -+ public void load() { -+ items.clear(); -+ try { -+ if (!getFile().exists()) { -+ -+ } else { -+ Yaml yaml = new Yaml(); -+ try { -+ ArrayList> list = (ArrayList>) yaml.load(new FileReader(getFile())); -+ for (HashMap item : list) { -+ String title = ""; -+ String ip = ""; -+ String country = ""; -+ int port = ServerItem.DEFAULT_PORT; -+ int databaseId = -1; -+ Boolean acceptsTextures = null; -+ if (item.containsKey("title")) { -+ title = (String) item.get("title"); -+ } -+ if (item.containsKey("ip")) { -+ ip = (String) item.get("ip"); -+ } -+ if (item.containsKey("port")) { -+ port = (Integer) item.get("port"); -+ } -+ if (item.containsKey("databaseid")) { -+ databaseId = (Integer) item.get("databaseid"); -+ } -+ if (item.containsKey("acceptsTextures")) { -+ acceptsTextures = (Boolean) item.get("acceptsTextures"); -+ } -+ -+ if (item.containsKey("country")) { -+ country = (String) item.get("country"); -+ } -+ -+ addServer(title, ip, port, databaseId, acceptsTextures, country); -+ } -+ } catch (FileNotFoundException e) { -+ e.printStackTrace(); -+ } -+ } -+ } catch (Exception e) { -+ e.printStackTrace(); -+ } -+ } -+ -+ public void save() { -+ Yaml yaml = new Yaml(); -+ ArrayList list = new ArrayList(); -+ for (ServerItem item : items) { -+ HashMap data = new HashMap(); -+ data.put("title", item.getTitle()); -+ data.put("ip", item.getIp()); -+ data.put("port", item.getPort()); -+ data.put("databaseid", item.getDatabaseId()); -+ data.put("country", item.getCountry()); -+ item.showPing = true; -+ if (item.getAcceptsTextures() != null) { -+ data.put("acceptsTextures", item.getAcceptsTextures().booleanValue()); -+ } -+ list.add(data); -+ } -+ try { -+ yaml.dump(list, new FileWriter(getFile())); -+ } catch (IOException e) { -+ e.printStackTrace(); -+ } -+ } -+ -+ private File getFile() { -+ return new File(FileUtil.getConfigDir(), "servers.yml"); -+ } -+ -+ public void addServer(String title, String ip, int port) { -+ ServerItem item = new ServerItem(title, ip, port, -1); -+ item.poll(); -+ items.add(item); -+ sizeChanged(); -+ if (gui != null) { -+ gui.updateButtons(); -+ } -+ } -+ -+ public void addServer(String title, String ip, int port, int databaseId) { -+ ServerItem item = new ServerItem(title, ip, port, databaseId); -+ item.setShowPing(true); -+ item.poll(); -+ items.add(item); -+ sizeChanged(); -+ if (gui != null) { -+ gui.updateButtons(); -+ } -+ } -+ -+ public void addServer(String title, String ip, int port, int databaseId, Boolean acceptsTextures) { -+ ServerItem item = new ServerItem(title, ip, port, databaseId); -+ item.setShowPing(true); -+ if (acceptsTextures != null) { -+ item.setAcceptsTextures(acceptsTextures); -+ } -+ item.poll(); -+ items.add(item); -+ sizeChanged(); -+ if (gui != null) { -+ gui.updateButtons(); -+ } -+ } -+ -+ public void addServer(String title, String ip, int port, int databaseId, Boolean acceptsTextures, String country) { -+ ServerItem item = new ServerItem(title, ip, port, databaseId); -+ item.setShowPing(true); -+ if (acceptsTextures != null) { -+ item.setAcceptsTextures(acceptsTextures); -+ } -+ item.poll(); -+ item.country = country; -+ items.add(item); -+ sizeChanged(); -+ if (gui != null) { -+ gui.updateButtons(); -+ } -+ } -+ -+ public void removeServer(ServerItem selectedItem) { -+ items.remove(selectedItem); -+ sizeChanged(); -+ } -+ -+ public void addServer(ServerItem item) { -+ items.add(item); -+ sizeChanged(); -+ } -+ -+ public void move(int selectedRow, int i) { -+ ServerItem item = items.get(selectedRow); -+ i = Math.max(0, i); -+ i = Math.min(i, getSize() - 1); -+ items.remove(selectedRow); -+ items.add(i, item); -+ } -+ -+ public boolean containsSever(ServerItem item) { -+ for (ServerItem obj : items) { -+ if (obj.getIp().equals(item.getIp()) && obj.getPort() == item.getPort()) { -+ return true; -+ } -+ } -+ return false; -+ } -+} ---- /dev/null -+++ org/spoutcraft/client/packet/PacketSky.java -@@ -1,0 +1,140 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.client.packet; -+ -+import java.io.IOException; -+ -+import org.spoutcraft.api.gui.Color; -+import org.spoutcraft.api.io.SpoutInputStream; -+import org.spoutcraft.api.io.SpoutOutputStream; -+import org.spoutcraft.api.player.SkyManager; -+import org.spoutcraft.client.SpoutClient; -+ -+public class PacketSky implements SpoutPacket { -+ private int cloudY, stars, sunPercent, moonPercent; -+ private Color skyColor, fogColor, cloudColor; -+ String sun = ""; -+ String moon = ""; -+ public PacketSky() { -+ } -+ -+ public PacketSky(int cloudY, int stars, int sunPercent, int moonPercent, Color skyColor) { -+ this.cloudY = cloudY; -+ this.stars = stars; -+ this.sunPercent = sunPercent; -+ this.moonPercent = moonPercent; -+ this.skyColor = skyColor.clone(); -+ } -+ -+ public PacketSky(String sunUrl, String moonUrl) { -+ this.cloudY = 0; -+ this.stars = 0; -+ this.sunPercent = 0; -+ this.moonPercent = 0; -+ this.sun = sunUrl; -+ this.moon = moonUrl; -+ } -+ -+ public void readData(SpoutInputStream input) throws IOException { -+ cloudY = input.readInt(); -+ stars = input.readInt(); -+ sunPercent = input.readInt(); -+ moonPercent = input.readInt(); -+ sun = input.readString(); -+ moon = input.readString(); -+ skyColor = input.readColor(); -+ fogColor = input.readColor(); -+ cloudColor = input.readColor(); -+ } -+ -+ public void writeData(SpoutOutputStream output) throws IOException { -+ output.writeInt(cloudY); -+ output.writeInt(stars); -+ output.writeInt(sunPercent); -+ output.writeInt(moonPercent); -+ output.writeString(sun); -+ output.writeString(moon); -+ output.writeColor(skyColor); -+ output.writeColor(fogColor); -+ output.writeColor(cloudColor); -+ } -+ -+ public void run(int PlayerId) { -+ if (cloudY != 0) { -+ SpoutClient.getInstance().getSkyManager().setCloudHeight(cloudY); -+ } -+ if (stars != 0) { -+ SpoutClient.getInstance().getSkyManager().setStarFrequency(stars); -+ } -+ if (sunPercent != 0) { -+ SpoutClient.getInstance().getSkyManager().setSunSizePercent(sunPercent); -+ } -+ if (moonPercent != 0) { -+ SpoutClient.getInstance().getSkyManager().setMoonSizePercent(moonPercent); -+ } -+ if (sun != null) { -+ if (sun.equals("[reset]")) { -+ SpoutClient.getInstance().getSkyManager().setSunTextureUrl(null); -+ } else if (sun.length() > 5) { -+ SpoutClient.getInstance().getSkyManager().setSunTextureUrl(sun); -+ } -+ } -+ if (moon != null) { -+ if (moon.equals("[reset]")) { -+ SpoutClient.getInstance().getSkyManager().setMoonTextureUrl(null); -+ } else if (moon.length() > 5) { -+ SpoutClient.getInstance().getSkyManager().setMoonTextureUrl(moon); -+ } -+ } -+ SkyManager sky = SpoutClient.getInstance().getSkyManager(); -+ -+ // Sky -+ if (skyColor.isOverride()) { -+ sky.setSkyColor(null); -+ } else if (!skyColor.isInvalid()) { -+ sky.setSkyColor(skyColor); -+ } -+ -+ // Fog -+ if (fogColor.isOverride()) { -+ sky.setFogColor(null); -+ } else if (!fogColor.isInvalid()) { -+ sky.setFogColor(fogColor); -+ } -+ -+ // Cloud -+ if (cloudColor.isOverride()) { -+ sky.setCloudColor(null); -+ } else if (!cloudColor.isInvalid()) { -+ sky.setCloudColor(cloudColor); -+ } -+ } -+ -+ public PacketType getPacketType() { -+ return PacketType.PacketSky; -+ } -+ -+ public int getVersion() { -+ return 2; -+ } -+ -+ public void failure(int playerId) { -+ } -+} ---- net/minecraft/src/IStatStringFormat.java -+++ net/minecraft/src/IStatStringFormat.java -@@ -1,5 +1,9 @@ - package net.minecraft.src; - - public interface IStatStringFormat { -+ -+ /** -+ * Formats the strings based on 'IStatStringFormat' interface. -+ */ - String formatString(String var1); - } ---- net/minecraft/src/SoundPoolProtocolHandler.java -+++ net/minecraft/src/SoundPoolProtocolHandler.java -@@ -7,11 +7,11 @@ - class SoundPoolProtocolHandler extends URLStreamHandler { - final SoundPool theSoundPool; - -- SoundPoolProtocolHandler(SoundPool var1) { -- this.theSoundPool = var1; -+ SoundPoolProtocolHandler(SoundPool par1SoundPool) { -+ this.theSoundPool = par1SoundPool; - } - -- protected URLConnection openConnection(URL var1) { -- return new SoundPoolURLConnection(this.theSoundPool, var1, (SoundPoolProtocolHandler)null); -+ protected URLConnection openConnection(URL par1URL) { -+ return new SoundPoolURLConnection(this.theSoundPool, par1URL, (SoundPoolProtocolHandler)null); - } - } ---- /dev/null -+++ org/spoutcraft/client/packet/PacketEntityTitle.java -@@ -1,0 +1,88 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.client.packet; -+ -+import java.io.IOException; -+ -+import net.minecraft.src.Entity; -+import net.minecraft.src.EntityLivingBase; -+import net.minecraft.src.EntityPlayer; -+ -+import org.spoutcraft.api.io.SpoutInputStream; -+import org.spoutcraft.api.io.SpoutOutputStream; -+import org.spoutcraft.client.SpoutClient; -+import org.spoutcraft.client.SpoutcraftWorld; -+import org.spoutcraft.client.entity.CraftLivingEntity; -+ -+public class PacketEntityTitle implements SpoutPacket { -+ public String title; -+ public int entityId; -+ public PacketEntityTitle() { -+ } -+ -+ public PacketEntityTitle(int entityId, String title) { -+ this.entityId = entityId; -+ this.title = title; -+ } -+ -+ public void readData(SpoutInputStream input) throws IOException { -+ entityId = input.readInt(); -+ title = input.readString(); -+ } -+ -+ public void writeData(SpoutOutputStream output) throws IOException { -+ output.writeInt(entityId); -+ output.writeString(title); -+ } -+ -+ public void run(int id) { -+ Entity e = SpoutClient.getInstance().getEntityFromId(entityId); -+ if (e != null && e instanceof EntityLivingBase) { -+ CraftLivingEntity living = (CraftLivingEntity)e.spoutEnty; -+ // Check to see if this title is our username, if so, use defaults -+ if (e instanceof EntityPlayer) { -+ EntityPlayer player = (EntityPlayer)e; -+ if (player.vip != null && title.equals(player.username)) { -+ title = player.vip.getTitle(); -+ } -+ } -+ if (title.equals("reset")) { -+ living.resetTitle(); -+ SpoutcraftWorld spworld = (SpoutcraftWorld) living.getWorld(); -+ spworld.getHandle().customTitles.remove(entityId); -+ } else { -+ living.setTitle(title); -+ SpoutcraftWorld spworld = (SpoutcraftWorld) living.getWorld(); -+ spworld.getHandle().customTitles.put(living.getEntityId(), title); -+ } -+ } -+ } -+ -+ public PacketType getPacketType() { -+ return PacketType.PacketEntityTitle; -+ } -+ -+ public int getVersion() { -+ return 0; -+ } -+ -+ public void failure(int playerId) { -+ } -+} ---- /dev/null -+++ org/spoutcraft/api/UnsafeClass.java -@@ -1,0 +1,34 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.api; -+ -+import java.lang.annotation.Documented; -+import java.lang.annotation.Retention; -+import java.lang.annotation.RetentionPolicy; -+ -+@Documented -+@Retention(value = RetentionPolicy.RUNTIME) -+public @interface UnsafeClass { -+ public String author() default "SpoutDev"; -+ -+ public String version() default "1.0"; -+ -+ public String shortDescription() default "Indicates that the method executes potentionally unsafe addon code and should be sandboxed before calling"; -+} ---- net/minecraft/src/ReportedException.java -+++ net/minecraft/src/ReportedException.java -@@ -1,12 +1,17 @@ - package net.minecraft.src; - - public class ReportedException extends RuntimeException { -+ -+ /** Instance of CrashReport. */ - private final CrashReport theReportedExceptionCrashReport; - -- public ReportedException(CrashReport var1) { -- this.theReportedExceptionCrashReport = var1; -+ public ReportedException(CrashReport par1CrashReport) { -+ this.theReportedExceptionCrashReport = par1CrashReport; - } - -+ /** -+ * Gets the CrashReport wrapped by this exception. -+ */ - public CrashReport getCrashReport() { - return this.theReportedExceptionCrashReport; - } ---- net/minecraft/src/RequestDelete.java -+++ net/minecraft/src/RequestDelete.java -@@ -1,18 +1,18 @@ - package net.minecraft.src; - - public class RequestDelete extends Request { -- public RequestDelete(String var1, int var2, int var3) { -- super(var1, var2, var3); -+ public RequestDelete(String par1Str, int par2, int par3) { -+ super(par1Str, par2, par3); - } - - public RequestDelete func_96370_f() { - try { -- this.a.setDoOutput(true); -- this.a.setRequestMethod("DELETE"); -- this.a.connect(); -+ this.field_96367_a.setDoOutput(true); -+ this.field_96367_a.setRequestMethod("DELETE"); -+ this.field_96367_a.connect(); - return this; - } catch (Exception var2) { -- throw new ExceptionMcoHttp("Failed URL: " + this.b, var2); -+ throw new ExceptionMcoHttp("Failed URL: " + this.field_96365_b, var2); - } - } - ---- /dev/null -+++ org/spoutcraft/client/gui/settings/controls/GuiScaleButton.java -@@ -1,0 +1,63 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.client.gui.settings.controls; -+ -+import net.minecraft.src.Minecraft; -+import net.minecraft.src.ScaledResolution; -+ -+import org.spoutcraft.api.gui.GenericButton; -+import org.spoutcraft.client.SpoutClient; -+import org.spoutcraft.client.config.Configuration; -+import org.spoutcraft.client.gui.settings.GuiAdvancedOptions; -+ -+public class GuiScaleButton extends GenericButton { -+ GuiAdvancedOptions parent; -+ public GuiScaleButton(GuiAdvancedOptions parent) { -+ this.parent = parent; -+ setTooltip("Alters how the size of the display scales."); -+ } -+ -+ @Override -+ public String getText() { -+ switch (Configuration.getGuiScale()) { -+ case 0: return "GUI Scale: Auto"; -+ case 1: return "GUI Scale: Small"; -+ case 2: return "GUI Scale: Normal"; -+ case 3: return "GUI Scale: Large"; -+ } -+ return "Unknown State: " + Configuration.getGuiScale(); -+ } -+ -+ @Override -+ public void onButtonClick() { -+ int guiScale = Configuration.getGuiScale(); -+ guiScale += 1; -+ guiScale &= 3; -+ Minecraft.getMinecraft().gameSettings.guiScale = guiScale; -+ Configuration.setGuiScale(guiScale); -+ Configuration.write(); -+ -+ // Redisplay the video screen. -+ ScaledResolution var3 = new ScaledResolution(Minecraft.getMinecraft().gameSettings, Minecraft.getMinecraft().displayWidth, Minecraft.getMinecraft().displayHeight); -+ int width = var3.getScaledWidth(); -+ int height = var3.getScaledHeight(); -+ SpoutClient.getHandle().currentScreen.setWorldAndResolution(Minecraft.getMinecraft(), width, height); -+ } -+} ---- net/minecraft/src/PlayerInstance.java -+++ net/minecraft/src/PlayerInstance.java -@@ -4,159 +4,179 @@ - import java.util.List; - - class PlayerInstance { -- private final List b; -- private final ChunkCoordIntPair currentChunk; -- private short[] blocksToUpdate; -- private int numBlocksToUpdate; -+ private final List playersInChunk; -+ -+ /** note: this is final */ -+ private final ChunkCoordIntPair chunkLocation; -+ private short[] locationOfBlockChange; -+ private int numberOfTilesToUpdate; -+ -+ /** -+ * Integer field where each bit means to make update 16x16x16 division of chunk (from bottom). -+ */ - private int flagsYAreasToUpdate; -+ -+ /** time what is using when chunk InhabitedTime is being calculated */ - private long previousWorldTime; -+ - final PlayerManager thePlayerManager; - -- public PlayerInstance(PlayerManager var1, int var2, int var3) { -- this.thePlayerManager = var1; -- this.b = new ArrayList(); -- this.blocksToUpdate = new short[64]; -- this.currentChunk = new ChunkCoordIntPair(var2, var3); -- var1.getMinecraftServer().theChunkProviderServer.loadChunk(var2, var3); -+ public PlayerInstance(PlayerManager par1PlayerManager, int par2, int par3) { -+ this.thePlayerManager = par1PlayerManager; -+ this.playersInChunk = new ArrayList(); -+ this.locationOfBlockChange = new short[64]; -+ this.chunkLocation = new ChunkCoordIntPair(par2, par3); -+ par1PlayerManager.getWorldServer().theChunkProviderServer.loadChunk(par2, par3); - } - -- public void addPlayer(EntityPlayerMP var1) { -- if(this.b.contains(var1)) { -- throw new IllegalStateException("Failed to add player. " + var1 + " already is in chunk " + this.currentChunk.chunkXPos + ", " + this.currentChunk.chunkZPos); -+ public void addPlayer(EntityPlayerMP par1EntityPlayerMP) { -+ if (this.playersInChunk.contains(par1EntityPlayerMP)) { -+ throw new IllegalStateException("Failed to add player. " + par1EntityPlayerMP + " already is in chunk " + this.chunkLocation.chunkXPos + ", " + this.chunkLocation.chunkZPos); - } else { -- if(this.b.isEmpty()) { -+ if (this.playersInChunk.isEmpty()) { - this.previousWorldTime = PlayerManager.getWorldServer(this.thePlayerManager).getTotalWorldTime(); - } - -- this.b.add(var1); -- var1.f.add(this.currentChunk); -+ this.playersInChunk.add(par1EntityPlayerMP); -+ par1EntityPlayerMP.loadedChunks.add(this.chunkLocation); - } - } - -- public void removePlayer(EntityPlayerMP var1) { -- if(this.b.contains(var1)) { -- Chunk var2 = PlayerManager.getWorldServer(this.thePlayerManager).getChunkFromChunkCoords(this.currentChunk.chunkXPos, this.currentChunk.chunkZPos); -- var1.playerNetServerHandler.sendPacket(new Packet51MapChunk(var2, true, 0)); -- this.b.remove(var1); -- var1.f.remove(this.currentChunk); -- if(this.b.isEmpty()) { -- long var3 = (long)this.currentChunk.chunkXPos + 2147483647L | (long)this.currentChunk.chunkZPos + 2147483647L << 32; -+ public void removePlayer(EntityPlayerMP par1EntityPlayerMP) { -+ if (this.playersInChunk.contains(par1EntityPlayerMP)) { -+ Chunk var2 = PlayerManager.getWorldServer(this.thePlayerManager).getChunkFromChunkCoords(this.chunkLocation.chunkXPos, this.chunkLocation.chunkZPos); -+ par1EntityPlayerMP.playerNetServerHandler.sendPacketToPlayer(new Packet51MapChunk(var2, true, 0)); -+ this.playersInChunk.remove(par1EntityPlayerMP); -+ par1EntityPlayerMP.loadedChunks.remove(this.chunkLocation); -+ -+ if (this.playersInChunk.isEmpty()) { -+ long var3 = (long)this.chunkLocation.chunkXPos + 2147483647L | (long)this.chunkLocation.chunkZPos + 2147483647L << 32; - this.increaseInhabitedTime(var2); - PlayerManager.getChunkWatchers(this.thePlayerManager).remove(var3); - PlayerManager.getChunkWatcherList(this.thePlayerManager).remove(this); -- if(this.numBlocksToUpdate > 0) { -+ -+ if (this.numberOfTilesToUpdate > 0) { - PlayerManager.getChunkWatchersWithPlayers(this.thePlayerManager).remove(this); - } - -- this.thePlayerManager.getMinecraftServer().theChunkProviderServer.dropChunk(this.currentChunk.chunkXPos, this.currentChunk.chunkZPos); -+ this.thePlayerManager.getWorldServer().theChunkProviderServer.unloadChunksIfNotNearSpawn(this.chunkLocation.chunkXPos, this.chunkLocation.chunkZPos); - } -- - } - } - -+ /** -+ * This method currently only increases chunk inhabited time. Extension is possible in next versions -+ */ - public void processChunk() { -- this.increaseInhabitedTime(PlayerManager.getWorldServer(this.thePlayerManager).getChunkFromChunkCoords(this.currentChunk.chunkXPos, this.currentChunk.chunkZPos)); -+ this.increaseInhabitedTime(PlayerManager.getWorldServer(this.thePlayerManager).getChunkFromChunkCoords(this.chunkLocation.chunkXPos, this.chunkLocation.chunkZPos)); - } - -- private void increaseInhabitedTime(Chunk var1) { -- var1.inhabitedTime += PlayerManager.getWorldServer(this.thePlayerManager).getTotalWorldTime() - this.previousWorldTime; -+ /** -+ * Increases chunk inhabited time every 8000 ticks -+ */ -+ private void increaseInhabitedTime(Chunk par1Chunk) { -+ par1Chunk.inhabitedTime += PlayerManager.getWorldServer(this.thePlayerManager).getTotalWorldTime() - this.previousWorldTime; - this.previousWorldTime = PlayerManager.getWorldServer(this.thePlayerManager).getTotalWorldTime(); - } - -- public void markBlockNeedsUpdate(int var1, int var2, int var3) { -- if(this.numBlocksToUpdate == 0) { -+ public void flagChunkForUpdate(int par1, int par2, int par3) { -+ if (this.numberOfTilesToUpdate == 0) { - PlayerManager.getChunkWatchersWithPlayers(this.thePlayerManager).add(this); - } - -- this.flagsYAreasToUpdate |= 1 << (var2 >> 4); -- if(this.numBlocksToUpdate < 64) { -- short var4 = (short)(var1 << 12 | var3 << 8 | var2); -- -- for(int var5 = 0; var5 < this.numBlocksToUpdate; ++var5) { -- if(this.blocksToUpdate[var5] == var4) { -+ this.flagsYAreasToUpdate |= 1 << (par2 >> 4); -+ -+ if (this.numberOfTilesToUpdate < 64) { -+ short var4 = (short)(par1 << 12 | par3 << 8 | par2); -+ -+ for (int var5 = 0; var5 < this.numberOfTilesToUpdate; ++var5) { -+ if (this.locationOfBlockChange[var5] == var4) { - return; - } - } - -- this.blocksToUpdate[this.numBlocksToUpdate++] = var4; -+ this.locationOfBlockChange[this.numberOfTilesToUpdate++] = var4; - } -- - } - -- public void sendPacketToPlayersInInstance(Packet var1) { -- for(int var2 = 0; var2 < this.b.size(); ++var2) { -- EntityPlayerMP var3 = (EntityPlayerMP)this.b.get(var2); -- if(!var3.f.contains(this.currentChunk)) { -- var3.playerNetServerHandler.sendPacket(var1); -+ public void sendToAllPlayersWatchingChunk(Packet par1Packet) { -+ for (int var2 = 0; var2 < this.playersInChunk.size(); ++var2) { -+ EntityPlayerMP var3 = (EntityPlayerMP)this.playersInChunk.get(var2); -+ -+ if (!var3.loadedChunks.contains(this.chunkLocation)) { -+ var3.playerNetServerHandler.sendPacketToPlayer(par1Packet); - } - } -- - } - -- public void onUpdate() { -- if(this.numBlocksToUpdate != 0) { -+ public void sendChunkUpdate() { -+ if (this.numberOfTilesToUpdate != 0) { - int var1; - int var2; - int var3; -- if(this.numBlocksToUpdate == 1) { -- var1 = this.currentChunk.chunkXPos * 16 + (this.blocksToUpdate[0] >> 12 & 15); -- var2 = this.blocksToUpdate[0] & 255; -- var3 = this.currentChunk.chunkZPos * 16 + (this.blocksToUpdate[0] >> 8 & 15); -- this.sendPacketToPlayersInInstance(new Packet53BlockChange(var1, var2, var3, PlayerManager.getWorldServer(this.thePlayerManager))); -- if(PlayerManager.getWorldServer(this.thePlayerManager).blockHasTileEntity(var1, var2, var3)) { -- this.updateTileEntity(PlayerManager.getWorldServer(this.thePlayerManager).getBlockTileEntity(var1, var2, var3)); -+ -+ if (this.numberOfTilesToUpdate == 1) { -+ var1 = this.chunkLocation.chunkXPos * 16 + (this.locationOfBlockChange[0] >> 12 & 15); -+ var2 = this.locationOfBlockChange[0] & 255; -+ var3 = this.chunkLocation.chunkZPos * 16 + (this.locationOfBlockChange[0] >> 8 & 15); -+ this.sendToAllPlayersWatchingChunk(new Packet53BlockChange(var1, var2, var3, PlayerManager.getWorldServer(this.thePlayerManager))); -+ -+ if (PlayerManager.getWorldServer(this.thePlayerManager).blockHasTileEntity(var1, var2, var3)) { -+ this.sendTileToAllPlayersWatchingChunk(PlayerManager.getWorldServer(this.thePlayerManager).getBlockTileEntity(var1, var2, var3)); - } - } else { - int var4; -- if(this.numBlocksToUpdate == 64) { -- var1 = this.currentChunk.chunkXPos * 16; -- var2 = this.currentChunk.chunkZPos * 16; -- this.sendPacketToPlayersInInstance(new Packet51MapChunk(PlayerManager.getWorldServer(this.thePlayerManager).getChunkFromChunkCoords(this.currentChunk.chunkXPos, this.currentChunk.chunkZPos), false, this.flagsYAreasToUpdate)); -- -- for(var3 = 0; var3 < 16; ++var3) { -- if((this.flagsYAreasToUpdate & 1 << var3) != 0) { -+ -+ if (this.numberOfTilesToUpdate == 64) { -+ var1 = this.chunkLocation.chunkXPos * 16; -+ var2 = this.chunkLocation.chunkZPos * 16; -+ this.sendToAllPlayersWatchingChunk(new Packet51MapChunk(PlayerManager.getWorldServer(this.thePlayerManager).getChunkFromChunkCoords(this.chunkLocation.chunkXPos, this.chunkLocation.chunkZPos), false, this.flagsYAreasToUpdate)); -+ -+ for (var3 = 0; var3 < 16; ++var3) { -+ if ((this.flagsYAreasToUpdate & 1 << var3) != 0) { - var4 = var3 << 4; -- List var5 = PlayerManager.getWorldServer(this.thePlayerManager).getTileEntityList(var1, var4, var2, var1 + 16, var4 + 16, var2 + 16); -+ List var5 = PlayerManager.getWorldServer(this.thePlayerManager).getAllTileEntityInBox(var1, var4, var2, var1 + 16, var4 + 16, var2 + 16); - -- for(int var6 = 0; var6 < var5.size(); ++var6) { -- this.updateTileEntity((TileEntity)var5.get(var6)); -+ for (int var6 = 0; var6 < var5.size(); ++var6) { -+ this.sendTileToAllPlayersWatchingChunk((TileEntity)var5.get(var6)); - } - } - } - } else { -- this.sendPacketToPlayersInInstance(new Packet52MultiBlockChange(this.currentChunk.chunkXPos, this.currentChunk.chunkZPos, this.blocksToUpdate, this.numBlocksToUpdate, PlayerManager.getWorldServer(this.thePlayerManager))); -- -- for(var1 = 0; var1 < this.numBlocksToUpdate; ++var1) { -- var2 = this.currentChunk.chunkXPos * 16 + (this.blocksToUpdate[var1] >> 12 & 15); -- var3 = this.blocksToUpdate[var1] & 255; -- var4 = this.currentChunk.chunkZPos * 16 + (this.blocksToUpdate[var1] >> 8 & 15); -- if(PlayerManager.getWorldServer(this.thePlayerManager).blockHasTileEntity(var2, var3, var4)) { -- this.updateTileEntity(PlayerManager.getWorldServer(this.thePlayerManager).getBlockTileEntity(var2, var3, var4)); -+ this.sendToAllPlayersWatchingChunk(new Packet52MultiBlockChange(this.chunkLocation.chunkXPos, this.chunkLocation.chunkZPos, this.locationOfBlockChange, this.numberOfTilesToUpdate, PlayerManager.getWorldServer(this.thePlayerManager))); -+ -+ for (var1 = 0; var1 < this.numberOfTilesToUpdate; ++var1) { -+ var2 = this.chunkLocation.chunkXPos * 16 + (this.locationOfBlockChange[var1] >> 12 & 15); -+ var3 = this.locationOfBlockChange[var1] & 255; -+ var4 = this.chunkLocation.chunkZPos * 16 + (this.locationOfBlockChange[var1] >> 8 & 15); -+ -+ if (PlayerManager.getWorldServer(this.thePlayerManager).blockHasTileEntity(var2, var3, var4)) { -+ this.sendTileToAllPlayersWatchingChunk(PlayerManager.getWorldServer(this.thePlayerManager).getBlockTileEntity(var2, var3, var4)); - } - } - } - } - -- this.numBlocksToUpdate = 0; -+ this.numberOfTilesToUpdate = 0; - this.flagsYAreasToUpdate = 0; - } - } - -- private void updateTileEntity(TileEntity var1) { -- if(var1 != null) { -- Packet var2 = var1.getDescriptionPacket(); -- if(var2 != null) { -- this.sendPacketToPlayersInInstance(var2); -+ private void sendTileToAllPlayersWatchingChunk(TileEntity par1TileEntity) { -+ if (par1TileEntity != null) { -+ Packet var2 = par1TileEntity.getDescriptionPacket(); -+ -+ if (var2 != null) { -+ this.sendToAllPlayersWatchingChunk(var2); - } - } -- -- } -- -- static ChunkCoordIntPair getChunkLocation(PlayerInstance var0) { -- return var0.currentChunk; -- } -- -- static List getPlayersInChunk(PlayerInstance var0) { -- return var0.b; -+ } -+ -+ static ChunkCoordIntPair getChunkLocation(PlayerInstance par0PlayerInstance) { -+ return par0PlayerInstance.chunkLocation; -+ } -+ -+ static List getPlayersInChunk(PlayerInstance par0PlayerInstance) { -+ return par0PlayerInstance.playersInChunk; - } - } ---- net/minecraft/src/Packet133TileEditorOpen.java -+++ net/minecraft/src/Packet133TileEditorOpen.java -@@ -10,34 +10,45 @@ - public int field_142036_c; - public int field_142034_d; - -- public Packet133TileEditorOpen() { -- } -- -- public Packet133TileEditorOpen(int var1, int var2, int var3, int var4) { -- this.field_142037_a = var1; -- this.field_142035_b = var2; -- this.field_142036_c = var3; -- this.field_142034_d = var4; -- } -- -- public void processPacket(NetHandler var1) { -- var1.func_142031_a(this); -- } -- -- public void readPacketData(DataInput var1) throws IOException { -- this.field_142037_a = var1.readByte(); -- this.field_142035_b = var1.readInt(); -- this.field_142036_c = var1.readInt(); -- this.field_142034_d = var1.readInt(); -- } -- -- public void writePacketData(DataOutput var1) throws IOException { -- var1.writeByte(this.field_142037_a); -- var1.writeInt(this.field_142035_b); -- var1.writeInt(this.field_142036_c); -- var1.writeInt(this.field_142034_d); -- } -- -+ public Packet133TileEditorOpen() {} -+ -+ public Packet133TileEditorOpen(int par1, int par2, int par3, int par4) { -+ this.field_142037_a = par1; -+ this.field_142035_b = par2; -+ this.field_142036_c = par3; -+ this.field_142034_d = par4; -+ } -+ -+ /** -+ * Passes this Packet on to the NetHandler for processing. -+ */ -+ public void processPacket(NetHandler par1NetHandler) { -+ par1NetHandler.func_142031_a(this); -+ } -+ -+ /** -+ * Abstract. Reads the raw packet data from the data stream. -+ */ -+ public void readPacketData(DataInput par1DataInput) throws IOException { -+ this.field_142037_a = par1DataInput.readByte(); -+ this.field_142035_b = par1DataInput.readInt(); -+ this.field_142036_c = par1DataInput.readInt(); -+ this.field_142034_d = par1DataInput.readInt(); -+ } -+ -+ /** -+ * Abstract. Writes the raw packet data to the data stream. -+ */ -+ public void writePacketData(DataOutput par1DataOutput) throws IOException { -+ par1DataOutput.writeByte(this.field_142037_a); -+ par1DataOutput.writeInt(this.field_142035_b); -+ par1DataOutput.writeInt(this.field_142036_c); -+ par1DataOutput.writeInt(this.field_142034_d); -+ } -+ -+ /** -+ * Abstract. Return the size of the packet (not counting the header). -+ */ - public int getPacketSize() { - return 13; - } ---- /dev/null -+++ org/spoutcraft/client/gui/settings/controls/DisplayEntityNamesinRangeButton.java -@@ -1,0 +1,38 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.client.gui.settings.controls; -+ -+import net.minecraft.src.Minecraft; -+ -+import org.spoutcraft.client.config.Configuration; -+ -+public class DisplayEntityNamesinRangeButton extends AutomatedCheckBox { -+ public DisplayEntityNamesinRangeButton() { -+ super("Display Entity Names in Range"); -+ setChecked(Configuration.isDisplayEntityNamesinRange()); -+ setTooltip("Displays the name of the entity if within a specific range."); -+ } -+ -+ @Override -+ public void onButtonClick() { -+ Configuration.setDisplayEntityNamesinRange(!Configuration.isDisplayEntityNamesinRange()); -+ Configuration.write(); -+ } -+} ---- net/minecraft/src/BlockObsidian.java -+++ net/minecraft/src/BlockObsidian.java -@@ -3,15 +3,21 @@ - import java.util.Random; - - public class BlockObsidian extends BlockStone { -- public BlockObsidian(int var1) { -- super(var1); -+ public BlockObsidian(int par1) { -+ super(par1); - } - -- public int quantityDropped(Random var1) { -+ /** -+ * Returns the quantity of items to drop on block destruction. -+ */ -+ public int quantityDropped(Random par1Random) { - return 1; - } - -- public int idDropped(int var1, Random var2, int var3) { -+ /** -+ * Returns the ID of the items to drop on destruction. -+ */ -+ public int idDropped(int par1, Random par2Random, int par3) { - return Block.obsidian.blockID; - } - } ---- net/minecraft/src/IProjectile.java -+++ net/minecraft/src/IProjectile.java -@@ -1,5 +1,9 @@ - package net.minecraft.src; - - public interface IProjectile { -+ -+ /** -+ * Similar to setArrowHeading, it's point the throwable entity to a x, y, z direction. -+ */ - void setThrowableHeading(double var1, double var3, double var5, float var7, float var8); - } ---- /dev/null -+++ org/spoutcraft/client/chunkcache/HeightMap.java -@@ -1,0 +1,439 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.client.chunkcache; -+ -+import java.io.DataInputStream; -+import java.io.DataOutputStream; -+import java.io.EOFException; -+import java.io.File; -+import java.io.FileInputStream; -+import java.io.FileNotFoundException; -+import java.io.FileOutputStream; -+import java.io.IOException; -+import java.util.HashMap; -+ -+import org.spoutcraft.api.util.map.TIntPairObjectHashMap; -+import org.spoutcraft.client.io.FileUtil; -+ -+public class HeightMap { -+ private String worldName; -+ private final static int INITIAL_CAPACITY = 500; -+ private final TIntPairObjectHashMap cache = new TIntPairObjectHashMap(INITIAL_CAPACITY); -+ private static final HashMap heightMaps = new HashMap(); -+ private static HeightMap lastMap = null; // Faster access to last height-map (which will be the case in most cases) -+ private int minX = 0, maxX = 0, minZ = 0, maxZ = 0; -+ private boolean initBounds = false; -+ private File file = null; -+ private HeightChunk lastChunk = null; // Faster access to last accessed chunk -+ private static HeightMapSaveThread saveThread; -+ private boolean dirty = true; -+ -+ public class HeightChunk { -+ public short heightmap[] = new short[16 * 16]; -+ public final int x, z; -+ public byte[] idmap = new byte[16 * 16]; -+ public byte [] datamap = new byte[16 * 16]; -+ -+ { -+ for (int i = 0; i < 256; i++) { -+ heightmap[i] = -1; -+ idmap[i] = -1; -+ } -+ } -+ -+ public HeightChunk(int x, int z) { -+ this.x = x; -+ this.z = z; -+ } -+ -+ public short getHeight(int x, int z) { -+ return heightmap[z << 4 | x]; -+ } -+ -+ public byte getBlockId(int x, int z) { -+ return idmap[z << 4 | x]; -+ } -+ -+ public void setHeight(int x, int z, short h) { -+ heightmap[z << 4 | x] = h; -+ } -+ -+ public void setBlockId(int x, int z, byte id) { -+ idmap[z << 4 | x] = id; -+ } -+ -+ public byte getData(int x, int z) { -+ return datamap[z << 4 | x]; -+ } -+ -+ public void setData(int x, int z, byte data) { -+ datamap[z << 4 | x] = data; -+ } -+ } -+ -+ public void clear() { -+ cache.clear(); -+ initBounds = false; -+ dirty = false; -+ } -+ -+ public static HeightMap getHeightMap(String worldName) { -+ return getHeightMap(worldName, getFile(worldName)); -+ } -+ -+ public static HeightMap getHeightMap(String worldName, File file) { -+ if (lastMap != null && lastMap.getWorldName().equals(worldName)) { -+ //lastMap.file = file; -+ return lastMap; -+ } -+ HeightMap ret = null; -+ if (heightMaps.containsKey(worldName)) { -+ ret = heightMaps.get(worldName); -+ //ret.file = file; -+ } else { -+ HeightMap map = new HeightMap(worldName); -+ map.file = file; -+ heightMaps.put(worldName, map); -+ if (file.exists()) { -+ map.load(); -+ } -+ ret = map; -+ } -+ lastMap = ret; -+ return ret; -+ } -+ -+ private HeightMap(String worldName) { -+ this.worldName = worldName; -+ } -+ -+ /* -+ * Format of the file is this: -+ * worldName:String -+ * minX:int -+ * maxX:int -+ * minZ:int -+ * maxZ:int -+ * height-map:short[], where map[0] is at minX, minZ and map[last] is at maxX, maxZ -+ */ -+ public void load() { -+ synchronized (cache) { -+ clear(); -+ try { -+ DataInputStream in = new DataInputStream(new FileInputStream(file)); -+ -+ int version = 0; -+ if (file.getAbsolutePath().endsWith(".hm2")) { -+ version = in.readInt(); // Read version -+ } -+ StringBuilder builder = new StringBuilder(); -+ short size = in.readShort(); -+ for (int i = 0; i < size; i++) { -+ builder.append(in.readChar()); -+ } -+ String name = builder.toString(); -+ if (!name.equals(getWorldName())) { -+ System.out.println("World names do not match: " + name + " [file] != " + getWorldName() + " [game]. Compensating..."); -+ // TODO Compensate -+ } -+ minX = in.readInt(); -+ maxX = in.readInt(); -+ minZ = in.readInt(); -+ maxZ = in.readInt(); -+ initBounds = true; -+ int x = minX; -+ int z = minZ; -+ try { -+ while (true) { -+ x = in.readInt(); -+ z = in.readInt(); -+ HeightChunk chunk = new HeightChunk(x, z); -+ for (int i = 0; i < 256; i++) { -+ chunk.heightmap[i] = in.readShort(); -+ chunk.idmap[i] = in.readByte(); -+ if (version >= 1) { -+ chunk.datamap[i] = in.readByte(); -+ } -+ } -+ addChunk(chunk); -+ } -+ } catch (EOFException e) {} -+ in.close(); -+ } catch (FileNotFoundException e) { -+ e.printStackTrace(); -+ } catch (IOException e) { -+ e.printStackTrace(); -+ cache.clear(); -+ initBounds = false; -+ System.out.println("Error while loading persistent copy of the heightmap. Clearing the cache."); -+ } -+ File progress = new File(file.getAbsoluteFile() + ".inProgress.hm2"); -+ if (progress.exists()) { -+ System.out.println("Found in-progress file!"); -+ HeightMap progressMap = new HeightMap(getWorldName()); -+ progressMap.file = progress; -+ progressMap.load(); -+ for (HeightChunk chunk:progressMap.cache.valueCollection()) { -+ if (chunk.getHeight(0, 0) != -1) { -+ addChunk(chunk); -+ } -+ } -+ heightMaps.remove(progressMap); -+ progress.delete(); -+ } -+ } -+ if (file.getAbsolutePath().endsWith(".hma")) { -+ file = new File(file.getAbsolutePath().replace(".hma", ".hm2")); -+ } -+ dirty = false; -+ } -+ -+ private void addChunk(HeightChunk chunk) { -+ dirty = true; -+ synchronized (cache) { -+ int x = chunk.x; -+ int z = chunk.z; -+ cache.put(x, z, chunk); -+ if (!initBounds) { -+ minX = x; -+ maxX = x; -+ minZ = z; -+ maxZ = z; -+ initBounds = true; -+ } else { -+ minX = Math.min(minX, x); -+ maxX = Math.max(maxX, x); -+ minZ = Math.min(minZ, z); -+ maxZ = Math.max(maxZ, z); -+ } -+ } -+ } -+ -+ public void save() { -+ if (!dirty) { -+ return; -+ // Don't need to save when not touched... -+ } -+ synchronized (cache) { -+ try { -+ File progress = new File(file.getAbsoluteFile() + ".inProgress.hm2"); -+ DataOutputStream out = new DataOutputStream(new FileOutputStream(progress)); -+ out.writeInt(1); // This is the version -+ -+ String name = getWorldName(); -+ out.writeShort(name.length()); -+ for (int i = 0; i < name.length(); i++) { -+ out.writeChar(name.charAt(i)); -+ } -+ -+ out.writeInt(minX); -+ out.writeInt(maxX); -+ out.writeInt(minZ); -+ out.writeInt(maxZ); -+ for (HeightChunk chunk : cache.valueCollection()) { -+ if (chunk == null) { -+ continue; -+ } else { -+ out.writeInt(chunk.x); -+ out.writeInt(chunk.z); -+ for (int i = 0; i < 256; i++) { -+ out.writeShort(chunk.heightmap[i]); -+ out.writeByte(chunk.idmap[i]); -+ out.writeByte(chunk.datamap[i]); -+ } -+ } -+ } -+ out.close(); -+ -+ // Make sure that we don't loose older stuff when someone quits. -+ File older = new File(file.getAbsoluteFile() + ".old"); -+ file.renameTo(older); -+ progress.renameTo(file); -+ older.delete(); -+ } catch (FileNotFoundException e) { -+ e.printStackTrace(); -+ } catch (IOException e) { -+ e.printStackTrace(); -+ } -+ } -+ dirty = false; -+ } -+ -+ public void saveThreaded() { -+ if (saveThread == null) { -+ saveThread = new HeightMapSaveThread(); -+ saveThread.addMap(this); -+ } -+ } -+ -+ private static File getFile(String worldName) { -+ File folder = new File(FileUtil.getConfigDir(), "heightmap"); -+ if (!folder.isDirectory()) { -+ folder.delete(); -+ } -+ if (!folder.exists()) { -+ folder.mkdirs(); -+ } -+ File oldFormat = new File(FileUtil.getConfigDir(), "heightmap/" + worldName + ".hma"); -+ File newFormat = new File(FileUtil.getConfigDir(), "heightmap/" + worldName + ".hm2"); -+ if (newFormat.exists() || !oldFormat.exists()) { -+ return newFormat; -+ } -+ return oldFormat; -+ } -+ -+ /*public boolean hasHeight(int x, int z) { -+ synchronized (cache) { -+ return cache.containsKey(x, z); -+ } -+ }*/ -+ -+ public HeightChunk getChunk(int x, int z) { -+ return getChunk(x, z, false); -+ } -+ -+ public HeightChunk getChunk(int x, int z, boolean force) { -+ dirty = true; // We don't know what they do with the chunk, so it could be dirtied... -+ if (lastChunk != null && lastChunk.x == x && lastChunk.z == z) { -+ return lastChunk; -+ } else { -+ synchronized (cache) { -+ lastChunk = cache.get(x, z); -+ if (lastChunk == null) { -+ lastChunk = new HeightChunk(x, z); -+ addChunk(lastChunk); -+ } -+ return lastChunk; -+ } -+ } -+ } -+ -+ public short getHeight(int x, int z) { -+ int cX = (x >> 4); -+ int cZ = (z >> 4); -+ x &= 0xF; -+ z &= 0xF; -+ if (lastChunk != null && lastChunk.x == cX && lastChunk.z == cZ) { -+ return lastChunk.heightmap[z << 4 | x]; -+ } -+ synchronized (cache) { -+ if (cache.containsKey(cX, cZ)) { -+ lastChunk = cache.get(cX, cZ); -+ return lastChunk.heightmap[z << 4 | x]; -+ } else { -+ return -1; -+ } -+ } -+ } -+ -+ public byte getBlockId(int x, int z) { -+ int cX = (x >> 4); -+ int cZ = (z >> 4); -+ x &= 0xF; -+ z &= 0xF; -+ if (lastChunk != null && lastChunk.x == cX && lastChunk.z == cZ) { -+ return lastChunk.idmap[z << 4 | x]; -+ } -+ synchronized (cache) { -+ if (cache.containsKey(cX, cZ)) { -+ lastChunk = cache.get(cX, cZ); -+ return lastChunk.idmap[z << 4 | x]; -+ } else { -+ return -1; -+ } -+ } -+ } -+ -+ public byte getData(int x, int z) { -+ int cX = (x >> 4); -+ int cZ = (z >> 4); -+ x &= 0xF; -+ z &= 0xF; -+ if (lastChunk != null && lastChunk.x == cX && lastChunk.z == cZ) { -+ return lastChunk.datamap[z << 4 | x]; -+ } -+ synchronized (cache) { -+ if (cache.containsKey(cX, cZ)) { -+ lastChunk = cache.get(cX, cZ); -+ return lastChunk.datamap[z << 4 | x]; -+ } else { -+ return -1; -+ } -+ } -+ } -+ -+ public void setHighestBlock(int x, int z, short height, byte id) { -+ dirty = true; -+ int cX = (x >> 4); -+ int cZ = (z >> 4); -+ x &= 0xF; -+ z &= 0xF; -+ synchronized (cache) { -+ if (!(lastChunk != null && lastChunk.x == cX && lastChunk.z == cZ)) { -+ if (cache.containsKey(cX, cZ)) { -+ lastChunk = cache.get(cX, cZ); -+ } else { -+ HeightChunk chunk = new HeightChunk(cX, cZ); -+ chunk.heightmap[z << 4 | x] = height; -+ chunk.idmap [z << 4 | x] = id; -+ lastChunk = chunk; -+ addChunk(chunk); -+ return; -+ } -+ } -+ lastChunk.heightmap[z << 4 | x] = height; -+ lastChunk.idmap[z << 4 | x] = id; -+ } -+ } -+ -+ public String getWorldName() { -+ return worldName; -+ } -+ -+ public int getMinX() { -+ return minX; -+ } -+ -+ public int getMaxX() { -+ return maxX; -+ } -+ -+ public int getMinZ() { -+ return minZ; -+ } -+ -+ public int getMaxZ() { -+ return maxZ; -+ } -+ -+ public static void joinSaveThread() { -+ if (saveThread != null) { -+ try { -+ System.out.println("Waiting for heightmap to save..."); -+ saveThread.join(); -+ } catch (InterruptedException e) { -+ } -+ } -+ } -+ -+ public boolean isDirty() { -+ return dirty; -+ } -+} ---- net/minecraft/src/ItemAxe.java -+++ net/minecraft/src/ItemAxe.java -@@ -1,13 +1,19 @@ - package net.minecraft.src; - - public class ItemAxe extends ItemTool { -- private static Block[] blocksEffectiveAgainst = new Block[]{Block.planks, Block.bookShelf, Block.wood, Block.chest, Block.stoneDoubleSlab, Block.stoneSingleSlab, Block.pumpkin, Block.pumpkinLantern}; -- -- protected ItemAxe(int var1, EnumToolMaterial var2) { -- super(var1, 3.0F, var2, blocksEffectiveAgainst); -+ -+ /** an array of the blocks this axe is effective against */ -+ private static Block[] blocksEffectiveAgainst = new Block[] {Block.planks, Block.bookShelf, Block.wood, Block.chest, Block.stoneDoubleSlab, Block.stoneSingleSlab, Block.pumpkin, Block.pumpkinLantern}; -+ -+ protected ItemAxe(int par1, EnumToolMaterial par2EnumToolMaterial) { -+ super(par1, 3.0F, par2EnumToolMaterial, blocksEffectiveAgainst); - } - -- public float getStrVsBlock(ItemStack var1, Block var2) { -- return var2 == null || var2.blockMaterial != Material.wood && var2.blockMaterial != Material.plants && var2.blockMaterial != Material.vine ? super.getStrVsBlock(var1, var2) : this.efficiencyOnProperMaterial; -+ /** -+ * Returns the strength of the stack against a given block. 1.0F base, (Quality+1)*2 if correct blocktype, 1.5F if -+ * sword -+ */ -+ public float getStrVsBlock(ItemStack par1ItemStack, Block par2Block) { -+ return par2Block != null && (par2Block.blockMaterial == Material.wood || par2Block.blockMaterial == Material.plants || par2Block.blockMaterial == Material.vine) ? this.efficiencyOnProperMaterial : super.getStrVsBlock(par1ItemStack, par2Block); - } - } ---- net/minecraft/src/EnchantmentHelper.java -+++ net/minecraft/src/EnchantmentHelper.java -@@ -9,22 +9,37 @@ - import java.util.Random; - - public class EnchantmentHelper { -- private static final Random a = new Random(); -+ -+ /** Is the random seed of enchantment effects. */ -+ private static final Random enchantmentRand = new Random(); -+ -+ /** -+ * Used to calculate the extra armor of enchantments on armors equipped on player. -+ */ - private static final EnchantmentModifierDamage enchantmentModifierDamage = new EnchantmentModifierDamage((Empty3)null); -+ -+ /** -+ * Used to calculate the (magic) extra damage done by enchantments on current equipped item of player. -+ */ - private static final EnchantmentModifierLiving enchantmentModifierLiving = new EnchantmentModifierLiving((Empty3)null); - -- public static int getEnchantmentLevel(int var0, ItemStack var1) { -- if(var1 == null) { -+ /** -+ * Returns the level of enchantment on the ItemStack passed. -+ */ -+ public static int getEnchantmentLevel(int par0, ItemStack par1ItemStack) { -+ if (par1ItemStack == null) { - return 0; - } else { -- NBTTagList var2 = var1.getEnchantmentTagList(); -- if(var2 == null) { -+ NBTTagList var2 = par1ItemStack.getEnchantmentTagList(); -+ -+ if (var2 == null) { - return 0; - } else { -- for(int var3 = 0; var3 < var2.tagCount(); ++var3) { -+ for (int var3 = 0; var3 < var2.tagCount(); ++var3) { - short var4 = ((NBTTagCompound)var2.tagAt(var3)).getShort("id"); - short var5 = ((NBTTagCompound)var2.tagAt(var3)).getShort("lvl"); -- if(var4 == var0) { -+ -+ if (var4 == par0) { - return var5; - } - } -@@ -34,11 +49,15 @@ - } - } - -- public static Map getEnchantments(ItemStack var0) { -+ /** -+ * Return the enchantments for the specified stack. -+ */ -+ public static Map getEnchantments(ItemStack par0ItemStack) { - LinkedHashMap var1 = new LinkedHashMap(); -- NBTTagList var2 = var0.itemID == Item.enchantedBook.itemID ? Item.enchantedBook.func_92110_g(var0) : var0.getEnchantmentTagList(); -- if(var2 != null) { -- for(int var3 = 0; var3 < var2.tagCount(); ++var3) { -+ NBTTagList var2 = par0ItemStack.itemID == Item.enchantedBook.itemID ? Item.enchantedBook.func_92110_g(par0ItemStack) : par0ItemStack.getEnchantmentTagList(); -+ -+ if (var2 != null) { -+ for (int var3 = 0; var3 < var2.tagCount(); ++var3) { - short var4 = ((NBTTagCompound)var2.tagAt(var3)).getShort("id"); - short var5 = ((NBTTagCompound)var2.tagAt(var3)).getShort("lvl"); - var1.put(Integer.valueOf(var4), Integer.valueOf(var5)); -@@ -48,43 +67,50 @@ - return var1; - } - -- public static void setEnchantments(Map var0, ItemStack var1) { -+ /** -+ * Set the enchantments for the specified stack. -+ */ -+ public static void setEnchantments(Map par0Map, ItemStack par1ItemStack) { - NBTTagList var2 = new NBTTagList(); -- Iterator var3 = var0.keySet().iterator(); -+ Iterator var3 = par0Map.keySet().iterator(); - -- while(var3.hasNext()) { -+ while (var3.hasNext()) { - int var4 = ((Integer)var3.next()).intValue(); - NBTTagCompound var5 = new NBTTagCompound(); - var5.setShort("id", (short)var4); -- var5.setShort("lvl", (short)((Integer)var0.get(Integer.valueOf(var4))).intValue()); -+ var5.setShort("lvl", (short)((Integer)par0Map.get(Integer.valueOf(var4))).intValue()); - var2.appendTag(var5); -- if(var1.itemID == Item.enchantedBook.itemID) { -- Item.enchantedBook.addEnchantment(var1, new EnchantmentData(var4, ((Integer)var0.get(Integer.valueOf(var4))).intValue())); -- } -- } -- -- if(var2.tagCount() > 0) { -- if(var1.itemID != Item.enchantedBook.itemID) { -- var1.setTagInfo("ench", var2); -- } -- } else if(var1.hasTagCompound()) { -- var1.getTagCompound().removeTag("ench"); -- } -- -+ -+ if (par1ItemStack.itemID == Item.enchantedBook.itemID) { -+ Item.enchantedBook.addEnchantment(par1ItemStack, new EnchantmentData(var4, ((Integer)par0Map.get(Integer.valueOf(var4))).intValue())); -+ } -+ } -+ -+ if (var2.tagCount() > 0) { -+ if (par1ItemStack.itemID != Item.enchantedBook.itemID) { -+ par1ItemStack.setTagInfo("ench", var2); -+ } -+ } else if (par1ItemStack.hasTagCompound()) { -+ par1ItemStack.getTagCompound().removeTag("ench"); -+ } - } - -- public static int getMaxEnchantmentLevel(int var0, ItemStack[] var1) { -- if(var1 == null) { -+ /** -+ * Returns the biggest level of the enchantment on the array of ItemStack passed. -+ */ -+ public static int getMaxEnchantmentLevel(int par0, ItemStack[] par1ArrayOfItemStack) { -+ if (par1ArrayOfItemStack == null) { - return 0; - } else { - int var2 = 0; -- ItemStack[] var3 = var1; -- int var4 = var1.length; -+ ItemStack[] var3 = par1ArrayOfItemStack; -+ int var4 = par1ArrayOfItemStack.length; - -- for(int var5 = 0; var5 < var4; ++var5) { -+ for (int var5 = 0; var5 < var4; ++var5) { - ItemStack var6 = var3[var5]; -- int var7 = getEnchantmentLevel(var0, var6); -- if(var7 > var2) { -+ int var7 = getEnchantmentLevel(par0, var6); -+ -+ if (var7 > var2) { - var2 = var7; - } - } -@@ -93,94 +119,129 @@ - } - } - -- private static void applyEnchantmentModifier(IEnchantmentModifier var0, ItemStack var1) { -- if(var1 != null) { -- NBTTagList var2 = var1.getEnchantmentTagList(); -- if(var2 != null) { -- for(int var3 = 0; var3 < var2.tagCount(); ++var3) { -+ /** -+ * Executes the enchantment modifier on the ItemStack passed. -+ */ -+ private static void applyEnchantmentModifier(IEnchantmentModifier par0IEnchantmentModifier, ItemStack par1ItemStack) { -+ if (par1ItemStack != null) { -+ NBTTagList var2 = par1ItemStack.getEnchantmentTagList(); -+ -+ if (var2 != null) { -+ for (int var3 = 0; var3 < var2.tagCount(); ++var3) { - short var4 = ((NBTTagCompound)var2.tagAt(var3)).getShort("id"); - short var5 = ((NBTTagCompound)var2.tagAt(var3)).getShort("lvl"); -- if(Enchantment.enchantmentsList[var4] != null) { -- var0.calculateModifier(Enchantment.enchantmentsList[var4], var5); -+ -+ if (Enchantment.enchantmentsList[var4] != null) { -+ par0IEnchantmentModifier.calculateModifier(Enchantment.enchantmentsList[var4], var5); - } - } -- - } - } - } - -- private static void applyEnchantmentModifierArray(IEnchantmentModifier var0, ItemStack[] var1) { -- ItemStack[] var2 = var1; -- int var3 = var1.length; -+ /** -+ * Executes the enchantment modifier on the array of ItemStack passed. -+ */ -+ private static void applyEnchantmentModifierArray(IEnchantmentModifier par0IEnchantmentModifier, ItemStack[] par1ArrayOfItemStack) { -+ ItemStack[] var2 = par1ArrayOfItemStack; -+ int var3 = par1ArrayOfItemStack.length; - -- for(int var4 = 0; var4 < var3; ++var4) { -+ for (int var4 = 0; var4 < var3; ++var4) { - ItemStack var5 = var2[var4]; -- applyEnchantmentModifier(var0, var5); -+ applyEnchantmentModifier(par0IEnchantmentModifier, var5); - } -- - } - -- public static int getEnchantmentModifierDamage(ItemStack[] var0, DamageSource var1) { -+ /** -+ * Returns the modifier of protection enchantments on armors equipped on player. -+ */ -+ public static int getEnchantmentModifierDamage(ItemStack[] par0ArrayOfItemStack, DamageSource par1DamageSource) { - enchantmentModifierDamage.damageModifier = 0; -- enchantmentModifierDamage.source = var1; -- applyEnchantmentModifierArray(enchantmentModifierDamage, var0); -- if(enchantmentModifierDamage.damageModifier > 25) { -+ enchantmentModifierDamage.source = par1DamageSource; -+ applyEnchantmentModifierArray(enchantmentModifierDamage, par0ArrayOfItemStack); -+ -+ if (enchantmentModifierDamage.damageModifier > 25) { - enchantmentModifierDamage.damageModifier = 25; - } - -- return (enchantmentModifierDamage.damageModifier + 1 >> 1) + a.nextInt((enchantmentModifierDamage.damageModifier >> 1) + 1); -+ return (enchantmentModifierDamage.damageModifier + 1 >> 1) + enchantmentRand.nextInt((enchantmentModifierDamage.damageModifier >> 1) + 1); - } - -- public static float getEnchantmentModifierLiving(EntityLivingBase var0, EntityLivingBase var1) { -+ /** -+ * Return the (magic) extra damage of the enchantments on player equipped item. -+ */ -+ public static float getEnchantmentModifierLiving(EntityLivingBase par0EntityLivingBase, EntityLivingBase par1EntityLivingBase) { - enchantmentModifierLiving.livingModifier = 0.0F; -- enchantmentModifierLiving.entityLiving = var1; -- applyEnchantmentModifier(enchantmentModifierLiving, var0.getHeldItem()); -+ enchantmentModifierLiving.entityLiving = par1EntityLivingBase; -+ applyEnchantmentModifier(enchantmentModifierLiving, par0EntityLivingBase.getHeldItem()); - return enchantmentModifierLiving.livingModifier; - } - -- public static int getKnockbackModifier(EntityLivingBase var0, EntityLivingBase var1) { -- return getEnchantmentLevel(Enchantment.knockback.effectId, var0.getHeldItem()); -- } -- -- public static int getFireAspectModifier(EntityLivingBase var0) { -- return getEnchantmentLevel(Enchantment.fireAspect.effectId, var0.getHeldItem()); -- } -- -- public static int getRespiration(EntityLivingBase var0) { -- return getMaxEnchantmentLevel(Enchantment.respiration.effectId, var0.getInventory()); -- } -- -- public static int getEfficiencyModifier(EntityLivingBase var0) { -- return getEnchantmentLevel(Enchantment.efficiency.effectId, var0.getHeldItem()); -- } -- -- public static boolean getSilkTouchModifier(EntityLivingBase var0) { -- return getEnchantmentLevel(Enchantment.silkTouch.effectId, var0.getHeldItem()) > 0; -- } -- -- public static int getFortuneModifier(EntityLivingBase var0) { -- return getEnchantmentLevel(Enchantment.fortune.effectId, var0.getHeldItem()); -- } -- -- public static int getLootingModifier(EntityLivingBase var0) { -- return getEnchantmentLevel(Enchantment.looting.effectId, var0.getHeldItem()); -- } -- -- public static boolean getAquaAffinityModifier(EntityLivingBase var0) { -- return getMaxEnchantmentLevel(Enchantment.aquaAffinity.effectId, var0.getInventory()) > 0; -- } -- -- public static int func_92098_i(EntityLivingBase var0) { -- return getMaxEnchantmentLevel(Enchantment.thorns.effectId, var0.getInventory()); -- } -- -- public static ItemStack func_92099_a(Enchantment var0, EntityLivingBase var1) { -- ItemStack[] var2 = var1.getInventory(); -+ /** -+ * Returns the knockback value of enchantments on equipped player item. -+ */ -+ public static int getKnockbackModifier(EntityLivingBase par0EntityLivingBase, EntityLivingBase par1EntityLivingBase) { -+ return getEnchantmentLevel(Enchantment.knockback.effectId, par0EntityLivingBase.getHeldItem()); -+ } -+ -+ public static int getFireAspectModifier(EntityLivingBase par0EntityLivingBase) { -+ return getEnchantmentLevel(Enchantment.fireAspect.effectId, par0EntityLivingBase.getHeldItem()); -+ } -+ -+ /** -+ * Returns the 'Water Breathing' modifier of enchantments on player equipped armors. -+ */ -+ public static int getRespiration(EntityLivingBase par0EntityLivingBase) { -+ return getMaxEnchantmentLevel(Enchantment.respiration.effectId, par0EntityLivingBase.getLastActiveItems()); -+ } -+ -+ /** -+ * Return the extra efficiency of tools based on enchantments on equipped player item. -+ */ -+ public static int getEfficiencyModifier(EntityLivingBase par0EntityLivingBase) { -+ return getEnchantmentLevel(Enchantment.efficiency.effectId, par0EntityLivingBase.getHeldItem()); -+ } -+ -+ /** -+ * Returns the silk touch status of enchantments on current equipped item of player. -+ */ -+ public static boolean getSilkTouchModifier(EntityLivingBase par0EntityLivingBase) { -+ return getEnchantmentLevel(Enchantment.silkTouch.effectId, par0EntityLivingBase.getHeldItem()) > 0; -+ } -+ -+ /** -+ * Returns the fortune enchantment modifier of the current equipped item of player. -+ */ -+ public static int getFortuneModifier(EntityLivingBase par0EntityLivingBase) { -+ return getEnchantmentLevel(Enchantment.fortune.effectId, par0EntityLivingBase.getHeldItem()); -+ } -+ -+ /** -+ * Returns the looting enchantment modifier of the current equipped item of player. -+ */ -+ public static int getLootingModifier(EntityLivingBase par0EntityLivingBase) { -+ return getEnchantmentLevel(Enchantment.looting.effectId, par0EntityLivingBase.getHeldItem()); -+ } -+ -+ /** -+ * Returns the aqua affinity status of enchantments on current equipped item of player. -+ */ -+ public static boolean getAquaAffinityModifier(EntityLivingBase par0EntityLivingBase) { -+ return getMaxEnchantmentLevel(Enchantment.aquaAffinity.effectId, par0EntityLivingBase.getLastActiveItems()) > 0; -+ } -+ -+ public static int func_92098_i(EntityLivingBase par0EntityLivingBase) { -+ return getMaxEnchantmentLevel(Enchantment.thorns.effectId, par0EntityLivingBase.getLastActiveItems()); -+ } -+ -+ public static ItemStack func_92099_a(Enchantment par0Enchantment, EntityLivingBase par1EntityLivingBase) { -+ ItemStack[] var2 = par1EntityLivingBase.getLastActiveItems(); - int var3 = var2.length; - -- for(int var4 = 0; var4 < var3; ++var4) { -+ for (int var4 = 0; var4 < var3; ++var4) { - ItemStack var5 = var2[var4]; -- if(var5 != null && getEnchantmentLevel(var0.effectId, var5) > 0) { -+ -+ if (var5 != null && getEnchantmentLevel(par0Enchantment.effectId, var5) > 0) { - return var5; - } - } -@@ -188,90 +249,114 @@ - return null; - } - -- public static int calcItemStackEnchantability(Random var0, int var1, int var2, ItemStack var3) { -- Item var4 = var3.getItem(); -+ /** -+ * Returns the enchantability of itemstack, it's uses a singular formula for each index (2nd parameter: 0, 1 and 2), -+ * cutting to the max enchantability power of the table (3rd parameter) -+ */ -+ public static int calcItemStackEnchantability(Random par0Random, int par1, int par2, ItemStack par3ItemStack) { -+ Item var4 = par3ItemStack.getItem(); - int var5 = var4.getItemEnchantability(); -- if(var5 <= 0) { -+ -+ if (var5 <= 0) { - return 0; - } else { -- if(var2 > 15) { -- var2 = 15; -+ if (par2 > 15) { -+ par2 = 15; - } - -- int var6 = var0.nextInt(8) + 1 + (var2 >> 1) + var0.nextInt(var2 + 1); -- return var1 == 0 ? Math.max(var6 / 3, 1) : (var1 == 1 ? var6 * 2 / 3 + 1 : Math.max(var6, var2 * 2)); -+ int var6 = par0Random.nextInt(8) + 1 + (par2 >> 1) + par0Random.nextInt(par2 + 1); -+ return par1 == 0 ? Math.max(var6 / 3, 1) : (par1 == 1 ? var6 * 2 / 3 + 1 : Math.max(var6, par2 * 2)); - } - } - -- public static ItemStack addRandomEnchantment(Random var0, ItemStack var1, int var2) { -- List var3 = buildEnchantmentList(var0, var1, var2); -- boolean var4 = var1.itemID == Item.book.itemID; -- if(var4) { -- var1.itemID = Item.enchantedBook.itemID; -+ /** -+ * Adds a random enchantment to the specified item. Args: random, itemStack, enchantabilityLevel -+ */ -+ public static ItemStack addRandomEnchantment(Random par0Random, ItemStack par1ItemStack, int par2) { -+ List var3 = buildEnchantmentList(par0Random, par1ItemStack, par2); -+ boolean var4 = par1ItemStack.itemID == Item.book.itemID; -+ -+ if (var4) { -+ par1ItemStack.itemID = Item.enchantedBook.itemID; - } - -- if(var3 != null) { -+ if (var3 != null) { - Iterator var5 = var3.iterator(); - -- while(var5.hasNext()) { -+ while (var5.hasNext()) { - EnchantmentData var6 = (EnchantmentData)var5.next(); -- if(var4) { -- Item.enchantedBook.addEnchantment(var1, var6); -+ -+ if (var4) { -+ Item.enchantedBook.addEnchantment(par1ItemStack, var6); - } else { -- var1.addEnchantment(var6.enchantmentobj, var6.enchantmentLevel); -+ par1ItemStack.addEnchantment(var6.enchantmentobj, var6.enchantmentLevel); - } - } - } - -- return var1; -+ return par1ItemStack; - } - -- public static List buildEnchantmentList(Random var0, ItemStack var1, int var2) { -- Item var3 = var1.getItem(); -+ /** -+ * Create a list of random EnchantmentData (enchantments) that can be added together to the ItemStack, the 3rd -+ * parameter is the total enchantability level. -+ */ -+ public static List buildEnchantmentList(Random par0Random, ItemStack par1ItemStack, int par2) { -+ Item var3 = par1ItemStack.getItem(); - int var4 = var3.getItemEnchantability(); -- if(var4 <= 0) { -+ -+ if (var4 <= 0) { - return null; - } else { - var4 /= 2; -- var4 = 1 + var0.nextInt((var4 >> 1) + 1) + var0.nextInt((var4 >> 1) + 1); -- int var5 = var4 + var2; -- float var6 = (var0.nextFloat() + var0.nextFloat() - 1.0F) * 0.15F; -+ var4 = 1 + par0Random.nextInt((var4 >> 1) + 1) + par0Random.nextInt((var4 >> 1) + 1); -+ int var5 = var4 + par2; -+ float var6 = (par0Random.nextFloat() + par0Random.nextFloat() - 1.0F) * 0.15F; - int var7 = (int)((float)var5 * (1.0F + var6) + 0.5F); -- if(var7 < 1) { -+ -+ if (var7 < 1) { - var7 = 1; - } - - ArrayList var8 = null; -- Map var9 = mapEnchantmentData(var7, var1); -- if(var9 != null && !var9.isEmpty()) { -- EnchantmentData var10 = (EnchantmentData)WeightedRandom.getRandomItem(var0, var9.values()); -- if(var10 != null) { -+ Map var9 = mapEnchantmentData(var7, par1ItemStack); -+ -+ if (var9 != null && !var9.isEmpty()) { -+ EnchantmentData var10 = (EnchantmentData)WeightedRandom.getRandomItem(par0Random, var9.values()); -+ -+ if (var10 != null) { - var8 = new ArrayList(); - var8.add(var10); - -- for(int var11 = var7; var0.nextInt(50) <= var11; var11 >>= 1) { -+ for (int var11 = var7; par0Random.nextInt(50) <= var11; var11 >>= 1) { - Iterator var12 = var9.keySet().iterator(); - -- while(var12.hasNext()) { -+ while (var12.hasNext()) { - Integer var13 = (Integer)var12.next(); - boolean var14 = true; - Iterator var15 = var8.iterator(); - -- while(var15.hasNext()) { -- EnchantmentData var16 = (EnchantmentData)var15.next(); -- if(!var16.enchantmentobj.canApplyTogether(Enchantment.enchantmentsList[var13.intValue()])) { -+ while (true) { -+ if (var15.hasNext()) { -+ EnchantmentData var16 = (EnchantmentData)var15.next(); -+ -+ if (var16.enchantmentobj.canApplyTogether(Enchantment.enchantmentsList[var13.intValue()])) { -+ continue; -+ } -+ - var14 = false; -- break; -- } -- } -- -- if(!var14) { -- var12.remove(); -+ } -+ -+ if (!var14) { -+ var12.remove(); -+ } -+ -+ break; - } - } - -- if(!var9.isEmpty()) { -- EnchantmentData var17 = (EnchantmentData)WeightedRandom.getRandomItem(var0, var9.values()); -+ if (!var9.isEmpty()) { -+ EnchantmentData var17 = (EnchantmentData)WeightedRandom.getRandomItem(par0Random, var9.values()); - var8.add(var17); - } - } -@@ -282,19 +367,24 @@ - } - } - -- public static Map mapEnchantmentData(int var0, ItemStack var1) { -- Item var2 = var1.getItem(); -+ /** -+ * Creates a 'Map' of EnchantmentData (enchantments) possible to add on the ItemStack and the enchantability level -+ * passed. -+ */ -+ public static Map mapEnchantmentData(int par0, ItemStack par1ItemStack) { -+ Item var2 = par1ItemStack.getItem(); - HashMap var3 = null; -- boolean var4 = var1.itemID == Item.book.itemID; -+ boolean var4 = par1ItemStack.itemID == Item.book.itemID; - Enchantment[] var5 = Enchantment.enchantmentsList; - int var6 = var5.length; - -- for(int var7 = 0; var7 < var6; ++var7) { -+ for (int var7 = 0; var7 < var6; ++var7) { - Enchantment var8 = var5[var7]; -- if(var8 != null && (var8.type.canEnchantItem(var2) || var4)) { -- for(int var9 = var8.getMinLevel(); var9 <= var8.getMaxLevel(); ++var9) { -- if(var0 >= var8.getMinEnchantability(var9) && var0 <= var8.getMaxEnchantability(var9)) { -- if(var3 == null) { -+ -+ if (var8 != null && (var8.type.canEnchantItem(var2) || var4)) { -+ for (int var9 = var8.getMinLevel(); var9 <= var8.getMaxLevel(); ++var9) { -+ if (par0 >= var8.getMinEnchantability(var9) && par0 <= var8.getMaxEnchantability(var9)) { -+ if (var3 == null) { - var3 = new HashMap(); - } - ---- /dev/null -+++ org/spoutcraft/client/inventory/CraftInventoryPlayer.java -@@ -1,0 +1,108 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.client.inventory; -+ -+import net.minecraft.src.InventoryPlayer; -+ -+import org.spoutcraft.api.inventory.ItemStack; -+import org.spoutcraft.api.inventory.PlayerInventory; -+ -+public class CraftInventoryPlayer extends CraftInventory implements PlayerInventory { -+ public CraftInventoryPlayer(net.minecraft.src.InventoryPlayer inventory) { -+ super(inventory); -+ } -+ -+ public InventoryPlayer getInventory() { -+ return (InventoryPlayer) inventory; -+ } -+ -+ public int getSize() { -+ return super.getSize() - 4; -+ } -+ -+ public ItemStack getItemInHand() { -+ return new CraftItemStack(getInventory().getCurrentItem()); -+ } -+ -+ public void setItemInHand(ItemStack stack) { -+ setItem(getHeldItemSlot(), stack); -+ } -+ -+ public int getHeldItemSlot() { -+ return getInventory().currentItem; -+ } -+ -+ public ItemStack getHelmet() { -+ return getItem(getSize() + 3); -+ } -+ -+ public ItemStack getChestplate() { -+ return getItem(getSize() + 2); -+ } -+ -+ public ItemStack getLeggings() { -+ return getItem(getSize() + 1); -+ } -+ -+ public ItemStack getBoots() { -+ return getItem(getSize() + 0); -+ } -+ -+ public void setHelmet(ItemStack helmet) { -+ setItem(getSize() + 3, helmet); -+ } -+ -+ public void setChestplate(ItemStack chestplate) { -+ setItem(getSize() + 2, chestplate); -+ } -+ -+ public void setLeggings(ItemStack leggings) { -+ setItem(getSize() + 1, leggings); -+ } -+ -+ public void setBoots(ItemStack boots) { -+ setItem(getSize() + 0, boots); -+ } -+ -+ public CraftItemStack[] getArmorContents() { -+ net.minecraft.src.ItemStack[] mcItems = getInventory().armorInventory; -+ CraftItemStack[] ret = new CraftItemStack[mcItems.length]; -+ -+ for (int i = 0; i < mcItems.length; i++) { -+ ret[i] = new CraftItemStack(mcItems[i]); -+ } -+ return ret; -+ } -+ -+ public void setArmorContents(ItemStack[] items) { -+ int cnt = getSize(); -+ -+ if (items == null) { -+ items = new ItemStack[4]; -+ } -+ for (ItemStack item : items) { -+ if (item == null || item.getTypeId() == 0) { -+ clear(cnt++); -+ } else { -+ setItem(cnt++, item); -+ } -+ } -+ } -+} ---- net/minecraft/src/BehaviorDefaultDispenseItem.java -+++ net/minecraft/src/BehaviorDefaultDispenseItem.java -@@ -1,45 +1,58 @@ - package net.minecraft.src; - - public class BehaviorDefaultDispenseItem implements IBehaviorDispenseItem { -- public final ItemStack dispense(IBlockSource var1, ItemStack var2) { -- ItemStack var3 = this.dispenseStack(var1, var2); -- this.playDispenseSound(var1); -- this.spawnDispenseParticles(var1, BlockDispenser.getFacing(var1.getBlockMetadata())); -+ -+ /** -+ * Dispenses the specified ItemStack from a dispenser. -+ */ -+ public final ItemStack dispense(IBlockSource par1IBlockSource, ItemStack par2ItemStack) { -+ ItemStack var3 = this.dispenseStack(par1IBlockSource, par2ItemStack); -+ this.playDispenseSound(par1IBlockSource); -+ this.spawnDispenseParticles(par1IBlockSource, BlockDispenser.getFacing(par1IBlockSource.getBlockMetadata())); - return var3; - } - -- protected ItemStack dispenseStack(IBlockSource var1, ItemStack var2) { -- EnumFacing var3 = BlockDispenser.getFacing(var1.getBlockMetadata()); -- IPosition var4 = BlockDispenser.getIPositionFromBlockSource(var1); -- ItemStack var5 = var2.splitStack(1); -- doDispense(var1.getWorld(), var5, 6, var3, var4); -- return var2; -- } -- -- public static void doDispense(World var0, ItemStack var1, int var2, EnumFacing var3, IPosition var4) { -- double var5 = var4.getX(); -- double var7 = var4.getY(); -- double var9 = var4.getZ(); -- EntityItem var11 = new EntityItem(var0, var5, var7 - 0.3D, var9, var1); -- double var12 = var0.s.nextDouble() * 0.1D + 0.2D; -- var11.motionX = (double)var3.getFrontOffsetX() * var12; -- var11.motionY = (double)0.2F; -- var11.motionZ = (double)var3.getFrontOffsetZ() * var12; -- var11.motionX += var0.s.nextGaussian() * (double)0.0075F * (double)var2; -- var11.motionY += var0.s.nextGaussian() * (double)0.0075F * (double)var2; -- var11.motionZ += var0.s.nextGaussian() * (double)0.0075F * (double)var2; -- var0.spawnEntityInWorld(var11); -- } -- -- protected void playDispenseSound(IBlockSource var1) { -- var1.getWorld().playAuxSFX(1000, var1.getXInt(), var1.getYInt(), var1.getZInt(), 0); -- } -- -- protected void spawnDispenseParticles(IBlockSource var1, EnumFacing var2) { -- var1.getWorld().playAuxSFX(2000, var1.getXInt(), var1.getYInt(), var1.getZInt(), this.func_82488_a(var2)); -- } -- -- private int func_82488_a(EnumFacing var1) { -- return var1.getFrontOffsetX() + 1 + (var1.getFrontOffsetZ() + 1) * 3; -+ /** -+ * Dispense the specified stack, play the dispense sound and spawn particles. -+ */ -+ protected ItemStack dispenseStack(IBlockSource par1IBlockSource, ItemStack par2ItemStack) { -+ EnumFacing var3 = BlockDispenser.getFacing(par1IBlockSource.getBlockMetadata()); -+ IPosition var4 = BlockDispenser.getIPositionFromBlockSource(par1IBlockSource); -+ ItemStack var5 = par2ItemStack.splitStack(1); -+ doDispense(par1IBlockSource.getWorld(), var5, 6, var3, var4); -+ return par2ItemStack; -+ } -+ -+ public static void doDispense(World par0World, ItemStack par1ItemStack, int par2, EnumFacing par3EnumFacing, IPosition par4IPosition) { -+ double var5 = par4IPosition.getX(); -+ double var7 = par4IPosition.getY(); -+ double var9 = par4IPosition.getZ(); -+ EntityItem var11 = new EntityItem(par0World, var5, var7 - 0.3D, var9, par1ItemStack); -+ double var12 = par0World.rand.nextDouble() * 0.1D + 0.2D; -+ var11.motionX = (double)par3EnumFacing.getFrontOffsetX() * var12; -+ var11.motionY = 0.20000000298023224D; -+ var11.motionZ = (double)par3EnumFacing.getFrontOffsetZ() * var12; -+ var11.motionX += par0World.rand.nextGaussian() * 0.007499999832361937D * (double)par2; -+ var11.motionY += par0World.rand.nextGaussian() * 0.007499999832361937D * (double)par2; -+ var11.motionZ += par0World.rand.nextGaussian() * 0.007499999832361937D * (double)par2; -+ par0World.spawnEntityInWorld(var11); -+ } -+ -+ /** -+ * Play the dispense sound from the specified block. -+ */ -+ protected void playDispenseSound(IBlockSource par1IBlockSource) { -+ par1IBlockSource.getWorld().playAuxSFX(1000, par1IBlockSource.getXInt(), par1IBlockSource.getYInt(), par1IBlockSource.getZInt(), 0); -+ } -+ -+ /** -+ * Order clients to display dispense particles from the specified block and facing. -+ */ -+ protected void spawnDispenseParticles(IBlockSource par1IBlockSource, EnumFacing par2EnumFacing) { -+ par1IBlockSource.getWorld().playAuxSFX(2000, par1IBlockSource.getXInt(), par1IBlockSource.getYInt(), par1IBlockSource.getZInt(), this.func_82488_a(par2EnumFacing)); -+ } -+ -+ private int func_82488_a(EnumFacing par1EnumFacing) { -+ return par1EnumFacing.getFrontOffsetX() + 1 + (par1EnumFacing.getFrontOffsetZ() + 1) * 3; - } - } ---- net/minecraft/src/RConThreadQueryAuth.java -+++ net/minecraft/src/RConThreadQueryAuth.java -@@ -5,39 +5,63 @@ - import java.util.Random; - - class RConThreadQueryAuth { -+ -+ /** The creation timestamp for this auth */ - private long timestamp; -+ -+ /** A random challenge */ - private int randomChallenge; -+ -+ /** A client-provided request ID associated with this query. */ - private byte[] requestId; -+ -+ /** A unique string of bytes used to verify client auth */ - private byte[] challengeValue; -- private String f; -+ -+ /** The request ID stored as a String */ -+ private String requestIdAsString; -+ -+ /** The RConThreadQuery that this is probably an inner class of */ - final RConThreadQuery queryThread; - -- public RConThreadQueryAuth(RConThreadQuery var1, DatagramPacket var2) { -- this.queryThread = var1; -+ public RConThreadQueryAuth(RConThreadQuery par1RConThreadQuery, DatagramPacket par2DatagramPacket) { -+ this.queryThread = par1RConThreadQuery; - this.timestamp = (new Date()).getTime(); -- byte[] var3 = var2.getData(); -+ byte[] var3 = par2DatagramPacket.getData(); - this.requestId = new byte[4]; - this.requestId[0] = var3[3]; - this.requestId[1] = var3[4]; - this.requestId[2] = var3[5]; - this.requestId[3] = var3[6]; -- this.f = new String(this.requestId); -+ this.requestIdAsString = new String(this.requestId); - this.randomChallenge = (new Random()).nextInt(16777216); -- this.challengeValue = String.format("\t%s%d\u0000", new Object[]{this.f, Integer.valueOf(this.randomChallenge)}).getBytes(); -- } -- -- public Boolean hasExpired(long var1) { -- return Boolean.valueOf(this.timestamp < var1); -- } -- -+ this.challengeValue = String.format("\t%s%d\u0000", new Object[] {this.requestIdAsString, Integer.valueOf(this.randomChallenge)}).getBytes(); -+ } -+ -+ /** -+ * Returns true if the auth's creation timestamp is less than the given time, otherwise false -+ */ -+ public Boolean hasExpired(long par1) { -+ return Boolean.valueOf(this.timestamp < par1); -+ } -+ -+ /** -+ * Returns the random challenge number assigned to this auth -+ */ - public int getRandomChallenge() { - return this.randomChallenge; - } - -+ /** -+ * Returns the auth challenge value -+ */ - public byte[] getChallengeValue() { - return this.challengeValue; - } - -+ /** -+ * Returns the request ID provided by the client. -+ */ - public byte[] getRequestId() { - return this.requestId; - } ---- net/minecraft/src/NBTTagDouble.java -+++ net/minecraft/src/NBTTagDouble.java -@@ -5,25 +5,36 @@ - import java.io.IOException; - - public class NBTTagDouble extends NBTBase { -+ -+ /** The double value for the tag. */ - public double data; - -- public NBTTagDouble(String var1) { -- super(var1); -- } -- -- public NBTTagDouble(String var1, double var2) { -- super(var1); -- this.data = var2; -- } -- -- void write(DataOutput var1) throws IOException { -- var1.writeDouble(this.data); -- } -- -- void load(DataInput var1, int var2) throws IOException { -- this.data = var1.readDouble(); -- } -- -+ public NBTTagDouble(String par1Str) { -+ super(par1Str); -+ } -+ -+ public NBTTagDouble(String par1Str, double par2) { -+ super(par1Str); -+ this.data = par2; -+ } -+ -+ /** -+ * Write the actual data contents of the tag, implemented in NBT extension classes -+ */ -+ void write(DataOutput par1DataOutput) throws IOException { -+ par1DataOutput.writeDouble(this.data); -+ } -+ -+ /** -+ * Read the actual data contents of the tag, implemented in NBT extension classes -+ */ -+ void load(DataInput par1DataInput, int par2) throws IOException { -+ this.data = par1DataInput.readDouble(); -+ } -+ -+ /** -+ * Gets the type byte for the tag. -+ */ - public byte getId() { - return (byte)6; - } -@@ -32,13 +43,16 @@ - return "" + this.data; - } - -+ /** -+ * Creates a clone of the tag. -+ */ - public NBTBase copy() { - return new NBTTagDouble(this.getName(), this.data); - } - -- public boolean equals(Object var1) { -- if(super.equals(var1)) { -- NBTTagDouble var2 = (NBTTagDouble)var1; -+ public boolean equals(Object par1Obj) { -+ if (super.equals(par1Obj)) { -+ NBTTagDouble var2 = (NBTTagDouble)par1Obj; - return this.data == var2.data; - } else { - return false; ---- net/minecraft/src/InventoryEffectRenderer.java -+++ net/minecraft/src/InventoryEffectRenderer.java -@@ -2,62 +2,78 @@ - - import java.util.Collection; - import java.util.Iterator; -+ - import org.lwjgl.opengl.GL11; - - public abstract class InventoryEffectRenderer extends GuiContainer { - private boolean field_74222_o; - -- public InventoryEffectRenderer(Container var1) { -- super(var1); -+ public InventoryEffectRenderer(Container par1Container) { -+ super(par1Container); - } - -+ /** -+ * Adds the buttons (and other controls) to the screen in question. -+ */ - public void initGui() { - super.initGui(); -- if(!this.mc.thePlayer.getActivePotionEffects().isEmpty()) { -+ -+ if (!this.mc.thePlayer.getActivePotionEffects().isEmpty()) { - this.guiLeft = 160 + (this.width - this.xSize - 200) / 2; - this.field_74222_o = true; - } -- - } - -- public void drawScreen(int var1, int var2, float var3) { -- super.drawScreen(var1, var2, var3); -- if(this.field_74222_o) { -+ /** -+ * Draws the screen and all the components in it. -+ */ -+ public void drawScreen(int par1, int par2, float par3) { -+ super.drawScreen(par1, par2, par3); -+ -+ if (this.field_74222_o) { - this.displayDebuffEffects(); - } -- - } - -+ /** -+ * Displays debuff/potion effects that are currently being applied to the player -+ */ - private void displayDebuffEffects() { -- int var1 = this.guiLeft - 124; -+ // Spout Start -+ int var1 = this.guiLeft - 142; -+ // Spout End - int var2 = this.guiTop; - boolean var3 = true; - Collection var4 = this.mc.thePlayer.getActivePotionEffects(); -- if(!var4.isEmpty()) { -+ -+ if (!var4.isEmpty()) { - GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - GL11.glDisable(GL11.GL_LIGHTING); - int var5 = 33; -- if(var4.size() > 5) { -+ -+ if (var4.size() > 5) { - var5 = 132 / (var4.size() - 1); - } - -- for(Iterator var6 = this.mc.thePlayer.getActivePotionEffects().iterator(); var6.hasNext(); var2 += var5) { -+ for (Iterator var6 = this.mc.thePlayer.getActivePotionEffects().iterator(); var6.hasNext(); var2 += var5) { - PotionEffect var7 = (PotionEffect)var6.next(); - Potion var8 = Potion.potionTypes[var7.getPotionID()]; - GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - this.mc.getTextureManager().bindTexture(field_110408_a); - this.drawTexturedModalRect(var1, var2, 0, 166, 140, 32); -- if(var8.hasStatusIcon()) { -+ -+ if (var8.hasStatusIcon()) { - int var9 = var8.getStatusIconIndex(); - this.drawTexturedModalRect(var1 + 6, var2 + 7, 0 + var9 % 8 * 18, 198 + var9 / 8 * 18, 18, 18); - } - - String var11 = I18n.getString(var8.getName()); -- if(var7.getAmplifier() == 1) { -+ -+ if (var7.getAmplifier() == 1) { - var11 = var11 + " II"; -- } else if(var7.getAmplifier() == 2) { -+ } else if (var7.getAmplifier() == 2) { - var11 = var11 + " III"; -- } else if(var7.getAmplifier() == 3) { -+ } else if (var7.getAmplifier() == 3) { - var11 = var11 + " IV"; - } - -@@ -65,7 +81,6 @@ - String var10 = Potion.getDurationString(var7); - this.fontRenderer.drawStringWithShadow(var10, var1 + 10 + 18, var2 + 6 + 10, 8355711); - } -- - } - } - } ---- net/minecraft/src/FoodStats.java -+++ net/minecraft/src/FoodStats.java -@@ -1,45 +1,66 @@ - package net.minecraft.src; - - public class FoodStats { -+ -+ /** The player's food level. */ - private int foodLevel = 20; -+ -+ /** The player's food saturation. */ - private float foodSaturationLevel = 5.0F; -+ -+ /** The player's food exhaustion. */ - private float foodExhaustionLevel; -+ -+ /** The player's food timer value. */ - private int foodTimer; - private int prevFoodLevel = 20; - -- public void addStats(int var1, float var2) { -- this.foodLevel = Math.min(var1 + this.foodLevel, 20); -- this.foodSaturationLevel = Math.min(this.foodSaturationLevel + (float)var1 * var2 * 2.0F, (float)this.foodLevel); -- } -- -- public void addStats(ItemFood var1) { -- this.addStats(var1.getHealAmount(), var1.getSaturationModifier()); -- } -- -- public void onUpdate(EntityPlayer var1) { -- int var2 = var1.worldObj.difficultySetting; -+ /** -+ * Args: int foodLevel, float foodSaturationModifier -+ */ -+ public void addStats(int par1, float par2) { -+ this.foodLevel = Math.min(par1 + this.foodLevel, 20); -+ this.foodSaturationLevel = Math.min(this.foodSaturationLevel + (float)par1 * par2 * 2.0F, (float)this.foodLevel); -+ } -+ -+ /** -+ * Eat some food. -+ */ -+ public void addStats(ItemFood par1ItemFood) { -+ this.addStats(par1ItemFood.getHealAmount(), par1ItemFood.getSaturationModifier()); -+ } -+ -+ /** -+ * Handles the food game logic. -+ */ -+ public void onUpdate(EntityPlayer par1EntityPlayer) { -+ int var2 = par1EntityPlayer.worldObj.difficultySetting; - this.prevFoodLevel = this.foodLevel; -- if(this.foodExhaustionLevel > 4.0F) { -+ -+ if (this.foodExhaustionLevel > 4.0F) { - this.foodExhaustionLevel -= 4.0F; -- if(this.foodSaturationLevel > 0.0F) { -+ -+ if (this.foodSaturationLevel > 0.0F) { - this.foodSaturationLevel = Math.max(this.foodSaturationLevel - 1.0F, 0.0F); -- } else if(var2 > 0) { -+ } else if (var2 > 0) { - this.foodLevel = Math.max(this.foodLevel - 1, 0); - } - } - -- if(var1.worldObj.getGameRules().getGameRuleBooleanValue("naturalRegeneration") && this.foodLevel >= 18 && var1.shouldHeal()) { -+ if (par1EntityPlayer.worldObj.getGameRules().getGameRuleBooleanValue("naturalRegeneration") && this.foodLevel >= 18 && par1EntityPlayer.shouldHeal()) { - ++this.foodTimer; -- if(this.foodTimer >= 80) { -- var1.heal(1.0F); -+ -+ if (this.foodTimer >= 80) { -+ par1EntityPlayer.heal(1.0F); - this.addExhaustion(3.0F); - this.foodTimer = 0; - } -- } else if(this.foodLevel <= 0) { -+ } else if (this.foodLevel <= 0) { - ++this.foodTimer; -- if(this.foodTimer >= 80) { -- if(var1.getHealth() > 10.0F || var2 >= 3 || var1.getHealth() > 1.0F && var2 >= 2) { -- var1.attackEntityFrom(DamageSource.starve, 1.0F); -+ -+ if (this.foodTimer >= 80) { -+ if (par1EntityPlayer.getHealth() > 10.0F || var2 >= 3 || par1EntityPlayer.getHealth() > 1.0F && var2 >= 2) { -+ par1EntityPlayer.attackEntityFrom(DamageSource.starve, 1.0F); - } - - this.foodTimer = 0; -@@ -47,26 +68,33 @@ - } else { - this.foodTimer = 0; - } -- - } - -- public void readNBT(NBTTagCompound var1) { -- if(var1.hasKey("foodLevel")) { -- this.foodLevel = var1.getInteger("foodLevel"); -- this.foodTimer = var1.getInteger("foodTickTimer"); -- this.foodSaturationLevel = var1.getFloat("foodSaturationLevel"); -- this.foodExhaustionLevel = var1.getFloat("foodExhaustionLevel"); -+ /** -+ * Reads food stats from an NBT object. -+ */ -+ public void readNBT(NBTTagCompound par1NBTTagCompound) { -+ if (par1NBTTagCompound.hasKey("foodLevel")) { -+ this.foodLevel = par1NBTTagCompound.getInteger("foodLevel"); -+ this.foodTimer = par1NBTTagCompound.getInteger("foodTickTimer"); -+ this.foodSaturationLevel = par1NBTTagCompound.getFloat("foodSaturationLevel"); -+ this.foodExhaustionLevel = par1NBTTagCompound.getFloat("foodExhaustionLevel"); - } -- -- } -- -- public void writeNBT(NBTTagCompound var1) { -- var1.setInteger("foodLevel", this.foodLevel); -- var1.setInteger("foodTickTimer", this.foodTimer); -- var1.setFloat("foodSaturationLevel", this.foodSaturationLevel); -- var1.setFloat("foodExhaustionLevel", this.foodExhaustionLevel); -- } -- -+ } -+ -+ /** -+ * Writes food stats to an NBT object. -+ */ -+ public void writeNBT(NBTTagCompound par1NBTTagCompound) { -+ par1NBTTagCompound.setInteger("foodLevel", this.foodLevel); -+ par1NBTTagCompound.setInteger("foodTickTimer", this.foodTimer); -+ par1NBTTagCompound.setFloat("foodSaturationLevel", this.foodSaturationLevel); -+ par1NBTTagCompound.setFloat("foodExhaustionLevel", this.foodExhaustionLevel); -+ } -+ -+ /** -+ * Get the player's food level. -+ */ - public int getFoodLevel() { - return this.foodLevel; - } -@@ -75,23 +103,32 @@ - return this.prevFoodLevel; - } - -+ /** -+ * If foodLevel is not max. -+ */ - public boolean needFood() { - return this.foodLevel < 20; - } - -- public void addExhaustion(float var1) { -- this.foodExhaustionLevel = Math.min(this.foodExhaustionLevel + var1, 40.0F); -+ /** -+ * adds input to foodExhaustionLevel to a max of 40 -+ */ -+ public void addExhaustion(float par1) { -+ this.foodExhaustionLevel = Math.min(this.foodExhaustionLevel + par1, 40.0F); - } - -+ /** -+ * Get the player's food saturation level. -+ */ - public float getSaturationLevel() { - return this.foodSaturationLevel; - } - -- public void setFoodLevel(int var1) { -- this.foodLevel = var1; -+ public void setFoodLevel(int par1) { -+ this.foodLevel = par1; - } - -- public void setFoodSaturationLevel(float var1) { -- this.foodSaturationLevel = var1; -+ public void setFoodSaturationLevel(float par1) { -+ this.foodSaturationLevel = par1; - } - } ---- net/minecraft/src/AttributeModifier.java -+++ net/minecraft/src/AttributeModifier.java -@@ -6,30 +6,34 @@ - public class AttributeModifier { - private final double amount; - private final int operation; -- private final String c; -- private final UUID d; -+ private final String name; -+ private final UUID id; -+ -+ /** -+ * If false, this modifier is not saved in NBT. Used for "natural" modifiers like speed boost from sprinting -+ */ - private boolean isSaved; - -- public AttributeModifier(String var1, double var2, int var4) { -- this(UUID.randomUUID(), var1, var2, var4); -+ public AttributeModifier(String par1Str, double par2, int par4) { -+ this(UUID.randomUUID(), par1Str, par2, par4); - } - -- public AttributeModifier(UUID var1, String var2, double var3, int var5) { -+ public AttributeModifier(UUID par1UUID, String par2Str, double par3, int par5) { - this.isSaved = true; -- this.d = var1; -- this.c = var2; -- this.amount = var3; -- this.operation = var5; -- Validate.notEmpty((CharSequence)var2, "Modifier name cannot be empty", new Object[0]); -- Validate.inclusiveBetween(Integer.valueOf(0), Integer.valueOf(2), Integer.valueOf(var5), "Invalid operation", new Object[0]); -+ this.id = par1UUID; -+ this.name = par2Str; -+ this.amount = par3; -+ this.operation = par5; -+ Validate.notEmpty(par2Str, "Modifier name cannot be empty", new Object[0]); -+ Validate.inclusiveBetween(Integer.valueOf(0), Integer.valueOf(2), Integer.valueOf(par5), "Invalid operation", new Object[0]); - } - - public UUID getID() { -- return this.d; -+ return this.id; - } - - public String getName() { -- return this.c; -+ return this.name; - } - - public int getOperation() { -@@ -40,25 +44,32 @@ - return this.amount; - } - -+ /** -+ * @see #isSaved -+ */ - public boolean isSaved() { - return this.isSaved; - } - -- public AttributeModifier setSaved(boolean var1) { -- this.isSaved = var1; -+ /** -+ * @see #isSaved -+ */ -+ public AttributeModifier setSaved(boolean par1) { -+ this.isSaved = par1; - return this; - } - -- public boolean equals(Object var1) { -- if(this == var1) { -+ public boolean equals(Object par1Obj) { -+ if (this == par1Obj) { - return true; -- } else if(var1 != null && this.getClass() == var1.getClass()) { -- AttributeModifier var2 = (AttributeModifier)var1; -- if(this.d != null) { -- if(!this.d.equals(var2.d)) { -+ } else if (par1Obj != null && this.getClass() == par1Obj.getClass()) { -+ AttributeModifier var2 = (AttributeModifier)par1Obj; -+ -+ if (this.id != null) { -+ if (!this.id.equals(var2.id)) { - return false; - } -- } else if(var2.d != null) { -+ } else if (var2.id != null) { - return false; - } - -@@ -69,10 +80,10 @@ - } - - public int hashCode() { -- return this.d != null ? this.d.hashCode() : 0; -+ return this.id != null ? this.id.hashCode() : 0; - } - - public String toString() { -- return "AttributeModifier{amount=" + this.amount + ", operation=" + this.operation + ", name=\'" + this.c + '\'' + ", id=" + this.d + ", serialize=" + this.isSaved + '}'; -+ return "AttributeModifier{amount=" + this.amount + ", operation=" + this.operation + ", name=\'" + this.name + '\'' + ", id=" + this.id + ", serialize=" + this.isSaved + '}'; - } - } ---- /dev/null -+++ org/spoutcraft/api/UnsafeConstructor.java -@@ -1,0 +1,34 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.api; -+ -+import java.lang.annotation.Documented; -+import java.lang.annotation.Retention; -+import java.lang.annotation.RetentionPolicy; -+ -+@Documented -+@Retention(value = RetentionPolicy.RUNTIME) -+public @interface UnsafeConstructor { -+ public String author() default "SpoutDev"; -+ -+ public String version() default "1.0"; -+ -+ public String shortDescription() default "Indicates that the constructor executes potentionally unsafe addon code and should be sandboxed before calling"; -+} ---- net/minecraft/src/GuiScreenLongRunningTask.java -+++ net/minecraft/src/GuiScreenLongRunningTask.java -@@ -6,80 +6,106 @@ - public class GuiScreenLongRunningTask extends GuiScreen { - private final int field_96213_b = 666; - private final GuiScreen previousScreen; -- private final Thread d; -- private volatile String e = ""; -+ private final Thread taskThread; -+ private volatile String message = ""; - private volatile boolean taskFailed; -- private volatile String q; -+ private volatile String failedMessage; -+ -+ /** -+ * Set to true when back button is clicked, or any other button with ID 666 -+ */ - private volatile boolean screenWasClosed; -+ -+ /** Incremented every tick, used to display progress indicator. */ - private int progressCounter; -+ -+ /** The long running task this GUI is showing the progress of. */ - private TaskLongRunning task; -- public static final String[] a = new String[]{"\u00e2\u2013\u0192 \u00e2\u2013\u201e \u00e2\u2013\u2026 \u00e2\u2013\u2020 \u00e2\u2013\u2021 \u00e2\u2013\u02c6 \u00e2\u2013\u2021 \u00e2\u2013\u2020 \u00e2\u2013\u2026 \u00e2\u2013\u201e \u00e2\u2013\u0192", "_ \u00e2\u2013\u0192 \u00e2\u2013\u201e \u00e2\u2013\u2026 \u00e2\u2013\u2020 \u00e2\u2013\u2021 \u00e2\u2013\u02c6 \u00e2\u2013\u2021 \u00e2\u2013\u2020 \u00e2\u2013\u2026 \u00e2\u2013\u201e", "_ _ \u00e2\u2013\u0192 \u00e2\u2013\u201e \u00e2\u2013\u2026 \u00e2\u2013\u2020 \u00e2\u2013\u2021 \u00e2\u2013\u02c6 \u00e2\u2013\u2021 \u00e2\u2013\u2020 \u00e2\u2013\u2026", "_ _ _ \u00e2\u2013\u0192 \u00e2\u2013\u201e \u00e2\u2013\u2026 \u00e2\u2013\u2020 \u00e2\u2013\u2021 \u00e2\u2013\u02c6 \u00e2\u2013\u2021 \u00e2\u2013\u2020", "_ _ _ _ \u00e2\u2013\u0192 \u00e2\u2013\u201e \u00e2\u2013\u2026 \u00e2\u2013\u2020 \u00e2\u2013\u2021 \u00e2\u2013\u02c6 \u00e2\u2013\u2021", "_ _ _ _ _ \u00e2\u2013\u0192 \u00e2\u2013\u201e \u00e2\u2013\u2026 \u00e2\u2013\u2020 \u00e2\u2013\u2021 \u00e2\u2013\u02c6", "_ _ _ _ \u00e2\u2013\u0192 \u00e2\u2013\u201e \u00e2\u2013\u2026 \u00e2\u2013\u2020 \u00e2\u2013\u2021 \u00e2\u2013\u02c6 \u00e2\u2013\u2021", "_ _ _ \u00e2\u2013\u0192 \u00e2\u2013\u201e \u00e2\u2013\u2026 \u00e2\u2013\u2020 \u00e2\u2013\u2021 \u00e2\u2013\u02c6 \u00e2\u2013\u2021 \u00e2\u2013\u2020", "_ _ \u00e2\u2013\u0192 \u00e2\u2013\u201e \u00e2\u2013\u2026 \u00e2\u2013\u2020 \u00e2\u2013\u2021 \u00e2\u2013\u02c6 \u00e2\u2013\u2021 \u00e2\u2013\u2020 \u00e2\u2013\u2026", "_ \u00e2\u2013\u0192 \u00e2\u2013\u201e \u00e2\u2013\u2026 \u00e2\u2013\u2020 \u00e2\u2013\u2021 \u00e2\u2013\u02c6 \u00e2\u2013\u2021 \u00e2\u2013\u2020 \u00e2\u2013\u2026 \u00e2\u2013\u201e", "\u00e2\u2013\u0192 \u00e2\u2013\u201e \u00e2\u2013\u2026 \u00e2\u2013\u2020 \u00e2\u2013\u2021 \u00e2\u2013\u02c6 \u00e2\u2013\u2021 \u00e2\u2013\u2020 \u00e2\u2013\u2026 \u00e2\u2013\u201e \u00e2\u2013\u0192", "\u00e2\u2013\u201e \u00e2\u2013\u2026 \u00e2\u2013\u2020 \u00e2\u2013\u2021 \u00e2\u2013\u02c6 \u00e2\u2013\u2021 \u00e2\u2013\u2020 \u00e2\u2013\u2026 \u00e2\u2013\u201e \u00e2\u2013\u0192 _", "\u00e2\u2013\u2026 \u00e2\u2013\u2020 \u00e2\u2013\u2021 \u00e2\u2013\u02c6 \u00e2\u2013\u2021 \u00e2\u2013\u2020 \u00e2\u2013\u2026 \u00e2\u2013\u201e \u00e2\u2013\u0192 _ _", "\u00e2\u2013\u2020 \u00e2\u2013\u2021 \u00e2\u2013\u02c6 \u00e2\u2013\u2021 \u00e2\u2013\u2020 \u00e2\u2013\u2026 \u00e2\u2013\u201e \u00e2\u2013\u0192 _ _ _", "\u00e2\u2013\u2021 \u00e2\u2013\u02c6 \u00e2\u2013\u2021 \u00e2\u2013\u2020 \u00e2\u2013\u2026 \u00e2\u2013\u201e \u00e2\u2013\u0192 _ _ _ _", "\u00e2\u2013\u02c6 \u00e2\u2013\u2021 \u00e2\u2013\u2020 \u00e2\u2013\u2026 \u00e2\u2013\u201e \u00e2\u2013\u0192 _ _ _ _ _", "\u00e2\u2013\u2021 \u00e2\u2013\u02c6 \u00e2\u2013\u2021 \u00e2\u2013\u2020 \u00e2\u2013\u2026 \u00e2\u2013\u201e \u00e2\u2013\u0192 _ _ _ _", "\u00e2\u2013\u2020 \u00e2\u2013\u2021 \u00e2\u2013\u02c6 \u00e2\u2013\u2021 \u00e2\u2013\u2020 \u00e2\u2013\u2026 \u00e2\u2013\u201e \u00e2\u2013\u0192 _ _ _", "\u00e2\u2013\u2026 \u00e2\u2013\u2020 \u00e2\u2013\u2021 \u00e2\u2013\u02c6 \u00e2\u2013\u2021 \u00e2\u2013\u2020 \u00e2\u2013\u2026 \u00e2\u2013\u201e \u00e2\u2013\u0192 _ _", "\u00e2\u2013\u201e \u00e2\u2013\u2026 \u00e2\u2013\u2020 \u00e2\u2013\u2021 \u00e2\u2013\u02c6 \u00e2\u2013\u2021 \u00e2\u2013\u2020 \u00e2\u2013\u2026 \u00e2\u2013\u201e \u00e2\u2013\u0192 _"}; -+ public static final String[] PROGRESS_TEXT = new String[] {"\u00e2\u2013\u0192 \u00e2\u2013\u201e \u00e2\u2013\u2026 \u00e2\u2013\u2020 \u00e2\u2013\u2021 \u00e2\u2013\u02c6 \u00e2\u2013\u2021 \u00e2\u2013\u2020 \u00e2\u2013\u2026 \u00e2\u2013\u201e \u00e2\u2013\u0192", "_ \u00e2\u2013\u0192 \u00e2\u2013\u201e \u00e2\u2013\u2026 \u00e2\u2013\u2020 \u00e2\u2013\u2021 \u00e2\u2013\u02c6 \u00e2\u2013\u2021 \u00e2\u2013\u2020 \u00e2\u2013\u2026 \u00e2\u2013\u201e", "_ _ \u00e2\u2013\u0192 \u00e2\u2013\u201e \u00e2\u2013\u2026 \u00e2\u2013\u2020 \u00e2\u2013\u2021 \u00e2\u2013\u02c6 \u00e2\u2013\u2021 \u00e2\u2013\u2020 \u00e2\u2013\u2026", "_ _ _ \u00e2\u2013\u0192 \u00e2\u2013\u201e \u00e2\u2013\u2026 \u00e2\u2013\u2020 \u00e2\u2013\u2021 \u00e2\u2013\u02c6 \u00e2\u2013\u2021 \u00e2\u2013\u2020", "_ _ _ _ \u00e2\u2013\u0192 \u00e2\u2013\u201e \u00e2\u2013\u2026 \u00e2\u2013\u2020 \u00e2\u2013\u2021 \u00e2\u2013\u02c6 \u00e2\u2013\u2021", "_ _ _ _ _ \u00e2\u2013\u0192 \u00e2\u2013\u201e \u00e2\u2013\u2026 \u00e2\u2013\u2020 \u00e2\u2013\u2021 \u00e2\u2013\u02c6", "_ _ _ _ \u00e2\u2013\u0192 \u00e2\u2013\u201e \u00e2\u2013\u2026 \u00e2\u2013\u2020 \u00e2\u2013\u2021 \u00e2\u2013\u02c6 \u00e2\u2013\u2021", "_ _ _ \u00e2\u2013\u0192 \u00e2\u2013\u201e \u00e2\u2013\u2026 \u00e2\u2013\u2020 \u00e2\u2013\u2021 \u00e2\u2013\u02c6 \u00e2\u2013\u2021 \u00e2\u2013\u2020", "_ _ \u00e2\u2013\u0192 \u00e2\u2013\u201e \u00e2\u2013\u2026 \u00e2\u2013\u2020 \u00e2\u2013\u2021 \u00e2\u2013\u02c6 \u00e2\u2013\u2021 \u00e2\u2013\u2020 \u00e2\u2013\u2026", "_ \u00e2\u2013\u0192 \u00e2\u2013\u201e \u00e2\u2013\u2026 \u00e2\u2013\u2020 \u00e2\u2013\u2021 \u00e2\u2013\u02c6 \u00e2\u2013\u2021 \u00e2\u2013\u2020 \u00e2\u2013\u2026 \u00e2\u2013\u201e", "\u00e2\u2013\u0192 \u00e2\u2013\u201e \u00e2\u2013\u2026 \u00e2\u2013\u2020 \u00e2\u2013\u2021 \u00e2\u2013\u02c6 \u00e2\u2013\u2021 \u00e2\u2013\u2020 \u00e2\u2013\u2026 \u00e2\u2013\u201e \u00e2\u2013\u0192", "\u00e2\u2013\u201e \u00e2\u2013\u2026 \u00e2\u2013\u2020 \u00e2\u2013\u2021 \u00e2\u2013\u02c6 \u00e2\u2013\u2021 \u00e2\u2013\u2020 \u00e2\u2013\u2026 \u00e2\u2013\u201e \u00e2\u2013\u0192 _", "\u00e2\u2013\u2026 \u00e2\u2013\u2020 \u00e2\u2013\u2021 \u00e2\u2013\u02c6 \u00e2\u2013\u2021 \u00e2\u2013\u2020 \u00e2\u2013\u2026 \u00e2\u2013\u201e \u00e2\u2013\u0192 _ _", "\u00e2\u2013\u2020 \u00e2\u2013\u2021 \u00e2\u2013\u02c6 \u00e2\u2013\u2021 \u00e2\u2013\u2020 \u00e2\u2013\u2026 \u00e2\u2013\u201e \u00e2\u2013\u0192 _ _ _", "\u00e2\u2013\u2021 \u00e2\u2013\u02c6 \u00e2\u2013\u2021 \u00e2\u2013\u2020 \u00e2\u2013\u2026 \u00e2\u2013\u201e \u00e2\u2013\u0192 _ _ _ _", "\u00e2\u2013\u02c6 \u00e2\u2013\u2021 \u00e2\u2013\u2020 \u00e2\u2013\u2026 \u00e2\u2013\u201e \u00e2\u2013\u0192 _ _ _ _ _", "\u00e2\u2013\u2021 \u00e2\u2013\u02c6 \u00e2\u2013\u2021 \u00e2\u2013\u2020 \u00e2\u2013\u2026 \u00e2\u2013\u201e \u00e2\u2013\u0192 _ _ _ _", "\u00e2\u2013\u2020 \u00e2\u2013\u2021 \u00e2\u2013\u02c6 \u00e2\u2013\u2021 \u00e2\u2013\u2020 \u00e2\u2013\u2026 \u00e2\u2013\u201e \u00e2\u2013\u0192 _ _ _", "\u00e2\u2013\u2026 \u00e2\u2013\u2020 \u00e2\u2013\u2021 \u00e2\u2013\u02c6 \u00e2\u2013\u2021 \u00e2\u2013\u2020 \u00e2\u2013\u2026 \u00e2\u2013\u201e \u00e2\u2013\u0192 _ _", "\u00e2\u2013\u201e \u00e2\u2013\u2026 \u00e2\u2013\u2020 \u00e2\u2013\u2021 \u00e2\u2013\u02c6 \u00e2\u2013\u2021 \u00e2\u2013\u2020 \u00e2\u2013\u2026 \u00e2\u2013\u201e \u00e2\u2013\u0192 _"}; - -- public GuiScreenLongRunningTask(Minecraft var1, GuiScreen var2, TaskLongRunning var3) { -- super.i = Collections.synchronizedList(new ArrayList()); -- this.mc = var1; -- this.previousScreen = var2; -- this.task = var3; -- var3.setGUI(this); -- this.d = new Thread(var3); -+ public GuiScreenLongRunningTask(Minecraft par1Minecraft, GuiScreen par2GuiScreen, TaskLongRunning par3TaskLongRunning) { -+ super.buttonList = Collections.synchronizedList(new ArrayList()); -+ this.mc = par1Minecraft; -+ this.previousScreen = par2GuiScreen; -+ this.task = par3TaskLongRunning; -+ par3TaskLongRunning.setGUI(this); -+ this.taskThread = new Thread(par3TaskLongRunning); - } - - public void func_98117_g() { -- this.d.start(); -+ this.taskThread.start(); - } - -+ /** -+ * Called from the main game loop to update the screen. -+ */ - public void updateScreen() { - super.updateScreen(); - ++this.progressCounter; - this.task.updateScreen(); - } - -- protected void keyTyped(char var1, int var2) { -- } -+ /** -+ * Fired when a key is typed. This is the equivalent of KeyListener.keyTyped(KeyEvent e). -+ */ -+ protected void keyTyped(char par1, int par2) {} - -+ /** -+ * Adds the buttons (and other controls) to the screen in question. -+ */ - public void initGui() { - this.task.initGUI(); - } - -- protected void actionPerformed(GuiButton var1) { -- if(var1.id == 666) { -+ /** -+ * Fired when a control is clicked. This is the equivalent of ActionListener.actionPerformed(ActionEvent e). -+ */ -+ protected void actionPerformed(GuiButton par1GuiButton) { -+ if (par1GuiButton.id == 666) { - this.screenWasClosed = true; - this.mc.displayGuiScreen(this.previousScreen); - } - -- this.task.buttonClicked(var1); -+ this.task.buttonClicked(par1GuiButton); - } - -- public void drawScreen(int var1, int var2, float var3) { -+ /** -+ * Draws the screen and all the components in it. -+ */ -+ public void drawScreen(int par1, int par2, float par3) { - this.drawDefaultBackground(); -- this.drawCenteredString(this.fontRenderer, this.e, this.width / 2, this.height / 2 - 50, 16777215); -+ this.drawCenteredString(this.fontRenderer, this.message, this.width / 2, this.height / 2 - 50, 16777215); - this.drawCenteredString(this.fontRenderer, "", this.width / 2, this.height / 2 - 10, 16777215); -- if(!this.taskFailed) { -- this.drawCenteredString(this.fontRenderer, a[this.progressCounter % a.length], this.width / 2, this.height / 2 + 15, 8421504); -- } -- -- if(this.taskFailed) { -- this.drawCenteredString(this.fontRenderer, this.q, this.width / 2, this.height / 2 + 15, 16711680); -- } -- -- super.drawScreen(var1, var2, var3); -+ -+ if (!this.taskFailed) { -+ this.drawCenteredString(this.fontRenderer, PROGRESS_TEXT[this.progressCounter % PROGRESS_TEXT.length], this.width / 2, this.height / 2 + 15, 8421504); -+ } -+ -+ if (this.taskFailed) { -+ this.drawCenteredString(this.fontRenderer, this.failedMessage, this.width / 2, this.height / 2 + 15, 16711680); -+ } -+ -+ super.drawScreen(par1, par2, par3); - } - -- public void setFailedMessage(String var1) { -+ public void setFailedMessage(String par1Str) { - this.taskFailed = true; -- this.q = var1; -- this.i.clear(); -- this.i.add(new GuiButton(666, this.width / 2 - 100, this.height / 4 + 120 + 12, "Back")); -+ this.failedMessage = par1Str; -+ this.buttonList.clear(); -+ this.buttonList.add(new GuiButton(666, this.width / 2 - 100, this.height / 4 + 120 + 12, "Back")); - } - - public Minecraft func_96208_g() { - return this.mc; - } - -- public void setMessage(String var1) { -- this.e = var1; -+ public void setMessage(String par1Str) { -+ this.message = par1Str; - } - -+ /** -+ * Returns the value of screenWasClosed -+ */ - public boolean wasScreenClosed() { - return this.screenWasClosed; - } ---- net/minecraft/src/Village.java -+++ net/minecraft/src/Village.java -@@ -7,60 +7,81 @@ - - public class Village { - private World worldObj; -- private final List b = new ArrayList(); -+ -+ /** list of VillageDoorInfo objects */ -+ private final List villageDoorInfoList = new ArrayList(); -+ -+ /** -+ * This is the sum of all door coordinates and used to calculate the actual village center by dividing by the number of -+ * doors. -+ */ - private final ChunkCoordinates centerHelper = new ChunkCoordinates(0, 0, 0); -+ -+ /** This is the actual village center. */ - private final ChunkCoordinates center = new ChunkCoordinates(0, 0, 0); - private int villageRadius; - private int lastAddDoorTimestamp; - private int tickCounter; - private int numVillagers; -+ -+ /** Timestamp of tick count when villager last bred */ - private int noBreedTicks; -- private TreeMap j = new TreeMap(); -- private List k = new ArrayList(); -+ -+ /** List of player reputations with this village */ -+ private TreeMap playerReputation = new TreeMap(); -+ private List villageAgressors = new ArrayList(); - private int numIronGolems; - -- public Village() { -- } -- -- public Village(World var1) { -- this.worldObj = var1; -- } -- -- public void func_82691_a(World var1) { -- this.worldObj = var1; -- } -- -- public void tick(int var1) { -- this.tickCounter = var1; -+ public Village() {} -+ -+ public Village(World par1World) { -+ this.worldObj = par1World; -+ } -+ -+ public void func_82691_a(World par1World) { -+ this.worldObj = par1World; -+ } -+ -+ /** -+ * Called periodically by VillageCollection -+ */ -+ public void tick(int par1) { -+ this.tickCounter = par1; - this.removeDeadAndOutOfRangeDoors(); - this.removeDeadAndOldAgressors(); -- if(var1 % 20 == 0) { -+ -+ if (par1 % 20 == 0) { - this.updateNumVillagers(); - } - -- if(var1 % 30 == 0) { -+ if (par1 % 30 == 0) { - this.updateNumIronGolems(); - } - - int var2 = this.numVillagers / 10; -- if(this.numIronGolems < var2 && this.b.size() > 20 && this.worldObj.s.nextInt(7000) == 0) { -+ -+ if (this.numIronGolems < var2 && this.villageDoorInfoList.size() > 20 && this.worldObj.rand.nextInt(7000) == 0) { - Vec3 var3 = this.tryGetIronGolemSpawningLocation(MathHelper.floor_float((float)this.center.posX), MathHelper.floor_float((float)this.center.posY), MathHelper.floor_float((float)this.center.posZ), 2, 4, 2); -- if(var3 != null) { -+ -+ if (var3 != null) { - EntityIronGolem var4 = new EntityIronGolem(this.worldObj); - var4.setPosition(var3.xCoord, var3.yCoord, var3.zCoord); - this.worldObj.spawnEntityInWorld(var4); - ++this.numIronGolems; - } - } -- - } - -- private Vec3 tryGetIronGolemSpawningLocation(int var1, int var2, int var3, int var4, int var5, int var6) { -- for(int var7 = 0; var7 < 10; ++var7) { -- int var8 = var1 + this.worldObj.s.nextInt(16) - 8; -- int var9 = var2 + this.worldObj.s.nextInt(6) - 3; -- int var10 = var3 + this.worldObj.s.nextInt(16) - 8; -- if(this.isInRange(var8, var9, var10) && this.isValidIronGolemSpawningLocation(var8, var9, var10, var4, var5, var6)) { -+ /** -+ * Tries up to 10 times to get a valid spawning location before eventually failing and returning null. -+ */ -+ private Vec3 tryGetIronGolemSpawningLocation(int par1, int par2, int par3, int par4, int par5, int par6) { -+ for (int var7 = 0; var7 < 10; ++var7) { -+ int var8 = par1 + this.worldObj.rand.nextInt(16) - 8; -+ int var9 = par2 + this.worldObj.rand.nextInt(6) - 3; -+ int var10 = par3 + this.worldObj.rand.nextInt(16) - 8; -+ -+ if (this.isInRange(var8, var9, var10) && this.isValidIronGolemSpawningLocation(var8, var9, var10, par4, par5, par6)) { - return this.worldObj.getWorldVec3Pool().getVecFromPool((double)var8, (double)var9, (double)var10); - } - } -@@ -68,17 +89,17 @@ - return null; - } - -- private boolean isValidIronGolemSpawningLocation(int var1, int var2, int var3, int var4, int var5, int var6) { -- if(!this.worldObj.doesBlockHaveSolidTopSurface(var1, var2 - 1, var3)) { -+ private boolean isValidIronGolemSpawningLocation(int par1, int par2, int par3, int par4, int par5, int par6) { -+ if (!this.worldObj.doesBlockHaveSolidTopSurface(par1, par2 - 1, par3)) { - return false; - } else { -- int var7 = var1 - var4 / 2; -- int var8 = var3 - var6 / 2; -+ int var7 = par1 - par4 / 2; -+ int var8 = par3 - par6 / 2; - -- for(int var9 = var7; var9 < var7 + var4; ++var9) { -- for(int var10 = var2; var10 < var2 + var5; ++var10) { -- for(int var11 = var8; var11 < var8 + var6; ++var11) { -- if(this.worldObj.isBlockNormalCube(var9, var10, var11)) { -+ for (int var9 = var7; var9 < var7 + par4; ++var9) { -+ for (int var10 = par2; var10 < par2 + par5; ++var10) { -+ for (int var11 = var8; var11 < var8 + par6; ++var11) { -+ if (this.worldObj.isBlockNormalCube(var9, var10, var11)) { - return false; - } - } -@@ -97,10 +118,10 @@ - private void updateNumVillagers() { - List var1 = this.worldObj.getEntitiesWithinAABB(EntityVillager.class, AxisAlignedBB.getAABBPool().getAABB((double)(this.center.posX - this.villageRadius), (double)(this.center.posY - 4), (double)(this.center.posZ - this.villageRadius), (double)(this.center.posX + this.villageRadius), (double)(this.center.posY + 4), (double)(this.center.posZ + this.villageRadius))); - this.numVillagers = var1.size(); -- if(this.numVillagers == 0) { -- this.j.clear(); -- } - -+ if (this.numVillagers == 0) { -+ this.playerReputation.clear(); -+ } - } - - public ChunkCoordinates getCenter() { -@@ -111,8 +132,12 @@ - return this.villageRadius; - } - -+ /** -+ * Actually get num village door info entries, but that boils down to number of doors. Called by EntityAIVillagerMate -+ * and VillageSiege -+ */ - public int getNumVillageDoors() { -- return this.b.size(); -+ return this.villageDoorInfoList.size(); - } - - public int getTicksSinceLastDoorAdding() { -@@ -123,23 +148,30 @@ - return this.numVillagers; - } - -- public boolean isInRange(int var1, int var2, int var3) { -- return this.center.getDistanceSquared(var1, var2, var3) < (float)(this.villageRadius * this.villageRadius); -+ /** -+ * Returns true, if the given coordinates are within the bounding box of the village. -+ */ -+ public boolean isInRange(int par1, int par2, int par3) { -+ return this.center.getDistanceSquared(par1, par2, par3) < (float)(this.villageRadius * this.villageRadius); - } - -+ /** -+ * called only by class EntityAIMoveThroughVillage -+ */ - public List getVillageDoorInfoList() { -- return this.b; -+ return this.villageDoorInfoList; - } - -- public VillageDoorInfo findNearestDoor(int var1, int var2, int var3) { -+ public VillageDoorInfo findNearestDoor(int par1, int par2, int par3) { - VillageDoorInfo var4 = null; - int var5 = Integer.MAX_VALUE; -- Iterator var6 = this.b.iterator(); -+ Iterator var6 = this.villageDoorInfoList.iterator(); - -- while(var6.hasNext()) { -+ while (var6.hasNext()) { - VillageDoorInfo var7 = (VillageDoorInfo)var6.next(); -- int var8 = var7.getDistanceSquared(var1, var2, var3); -- if(var8 < var5) { -+ int var8 = var7.getDistanceSquared(par1, par2, par3); -+ -+ if (var8 < var5) { - var4 = var7; - var5 = var8; - } -@@ -148,21 +180,27 @@ - return var4; - } - -- public VillageDoorInfo findNearestDoorUnrestricted(int var1, int var2, int var3) { -+ /** -+ * Find a door suitable for shelter. If there are more doors in a distance of 16 blocks, then the least restricted one -+ * (i.e. the one protecting the lowest number of villagers) of them is chosen, else the nearest one regardless of -+ * restriction. -+ */ -+ public VillageDoorInfo findNearestDoorUnrestricted(int par1, int par2, int par3) { - VillageDoorInfo var4 = null; - int var5 = Integer.MAX_VALUE; -- Iterator var6 = this.b.iterator(); -+ Iterator var6 = this.villageDoorInfoList.iterator(); - -- while(var6.hasNext()) { -+ while (var6.hasNext()) { - VillageDoorInfo var7 = (VillageDoorInfo)var6.next(); -- int var8 = var7.getDistanceSquared(var1, var2, var3); -- if(var8 > 256) { -+ int var8 = var7.getDistanceSquared(par1, par2, par3); -+ -+ if (var8 > 256) { - var8 *= 1000; - } else { - var8 = var7.getDoorOpeningRestrictionCounter(); - } - -- if(var8 < var5) { -+ if (var8 < var5) { - var4 = var7; - var5 = var8; - } -@@ -171,62 +209,66 @@ - return var4; - } - -- public VillageDoorInfo getVillageDoorAt(int var1, int var2, int var3) { -- if(this.center.getDistanceSquared(var1, var2, var3) > (float)(this.villageRadius * this.villageRadius)) { -+ public VillageDoorInfo getVillageDoorAt(int par1, int par2, int par3) { -+ if (this.center.getDistanceSquared(par1, par2, par3) > (float)(this.villageRadius * this.villageRadius)) { - return null; - } else { -- Iterator var4 = this.b.iterator(); -- -+ Iterator var4 = this.villageDoorInfoList.iterator(); - VillageDoorInfo var5; -+ - do { -- if(!var4.hasNext()) { -+ if (!var4.hasNext()) { - return null; - } - - var5 = (VillageDoorInfo)var4.next(); -- } while(var5.posX != var1 || var5.posZ != var3 || Math.abs(var5.posY - var2) > 1); -+ } while (var5.posX != par1 || var5.posZ != par3 || Math.abs(var5.posY - par2) > 1); - - return var5; - } - } - -- public void addVillageDoorInfo(VillageDoorInfo var1) { -- this.b.add(var1); -- this.centerHelper.posX += var1.posX; -- this.centerHelper.posY += var1.posY; -- this.centerHelper.posZ += var1.posZ; -+ public void addVillageDoorInfo(VillageDoorInfo par1VillageDoorInfo) { -+ this.villageDoorInfoList.add(par1VillageDoorInfo); -+ this.centerHelper.posX += par1VillageDoorInfo.posX; -+ this.centerHelper.posY += par1VillageDoorInfo.posY; -+ this.centerHelper.posZ += par1VillageDoorInfo.posZ; - this.updateVillageRadiusAndCenter(); -- this.lastAddDoorTimestamp = var1.lastActivityTimestamp; -+ this.lastAddDoorTimestamp = par1VillageDoorInfo.lastActivityTimestamp; - } - -+ /** -+ * Returns true, if there is not a single village door left. Called by VillageCollection -+ */ - public boolean isAnnihilated() { -- return this.b.isEmpty(); -+ return this.villageDoorInfoList.isEmpty(); - } - -- public void addOrRenewAgressor(EntityLivingBase var1) { -- Iterator var2 = this.k.iterator(); -- -+ public void addOrRenewAgressor(EntityLivingBase par1EntityLivingBase) { -+ Iterator var2 = this.villageAgressors.iterator(); - VillageAgressor var3; -+ - do { -- if(!var2.hasNext()) { -- this.k.add(new VillageAgressor(this, var1, this.tickCounter)); -+ if (!var2.hasNext()) { -+ this.villageAgressors.add(new VillageAgressor(this, par1EntityLivingBase, this.tickCounter)); - return; - } - - var3 = (VillageAgressor)var2.next(); -- } while(var3.agressor != var1); -+ } while (var3.agressor != par1EntityLivingBase); - - var3.agressionTime = this.tickCounter; - } - -- public EntityLivingBase findNearestVillageAggressor(EntityLivingBase var1) { -+ public EntityLivingBase findNearestVillageAggressor(EntityLivingBase par1EntityLivingBase) { - double var2 = Double.MAX_VALUE; - VillageAgressor var4 = null; - -- for(int var5 = 0; var5 < this.k.size(); ++var5) { -- VillageAgressor var6 = (VillageAgressor)this.k.get(var5); -- double var7 = var6.agressor.getDistanceSqToEntity(var1); -- if(var7 <= var2) { -+ for (int var5 = 0; var5 < this.villageAgressors.size(); ++var5) { -+ VillageAgressor var6 = (VillageAgressor)this.villageAgressors.get(var5); -+ double var7 = var6.agressor.getDistanceSqToEntity(par1EntityLivingBase); -+ -+ if (var7 <= var2) { - var4 = var6; - var2 = var7; - } -@@ -235,18 +277,21 @@ - return var4 != null ? var4.agressor : null; - } - -- public EntityPlayer func_82685_c(EntityLivingBase var1) { -+ public EntityPlayer func_82685_c(EntityLivingBase par1EntityLivingBase) { - double var2 = Double.MAX_VALUE; - EntityPlayer var4 = null; -- Iterator var5 = this.j.keySet().iterator(); -+ Iterator var5 = this.playerReputation.keySet().iterator(); - -- while(var5.hasNext()) { -+ while (var5.hasNext()) { - String var6 = (String)var5.next(); -- if(this.isPlayerReputationTooLow(var6)) { -+ -+ if (this.isPlayerReputationTooLow(var6)) { - EntityPlayer var7 = this.worldObj.getPlayerEntityByName(var6); -- if(var7 != null) { -- double var8 = var7.getDistanceSqToEntity(var1); -- if(var8 <= var2) { -+ -+ if (var7 != null) { -+ double var8 = var7.getDistanceSqToEntity(par1EntityLivingBase); -+ -+ if (var8 <= var2) { - var4 = var7; - var2 = var8; - } -@@ -258,69 +303,61 @@ - } - - private void removeDeadAndOldAgressors() { -- Iterator var1 = this.k.iterator(); -- -- while(true) { -- VillageAgressor var2; -- do { -- if(!var1.hasNext()) { -- return; -- } -- -- var2 = (VillageAgressor)var1.next(); -- } while(var2.agressor.isEntityAlive() && Math.abs(this.tickCounter - var2.agressionTime) <= 300); -- -- var1.remove(); -+ Iterator var1 = this.villageAgressors.iterator(); -+ -+ while (var1.hasNext()) { -+ VillageAgressor var2 = (VillageAgressor)var1.next(); -+ -+ if (!var2.agressor.isEntityAlive() || Math.abs(this.tickCounter - var2.agressionTime) > 300) { -+ var1.remove(); -+ } - } - } - - private void removeDeadAndOutOfRangeDoors() { - boolean var1 = false; -- boolean var2 = this.worldObj.s.nextInt(50) == 0; -- Iterator var3 = this.b.iterator(); -- -- while(true) { -- VillageDoorInfo var4; -- do { -- if(!var3.hasNext()) { -- if(var1) { -- this.updateVillageRadiusAndCenter(); -- } -- -- return; -- } -- -- var4 = (VillageDoorInfo)var3.next(); -- if(var2) { -- var4.resetDoorOpeningRestrictionCounter(); -- } -- } while(this.isBlockDoor(var4.posX, var4.posY, var4.posZ) && Math.abs(this.tickCounter - var4.lastActivityTimestamp) <= 1200); -- -- this.centerHelper.posX -= var4.posX; -- this.centerHelper.posY -= var4.posY; -- this.centerHelper.posZ -= var4.posZ; -- var1 = true; -- var4.isDetachedFromVillageFlag = true; -- var3.remove(); -+ boolean var2 = this.worldObj.rand.nextInt(50) == 0; -+ Iterator var3 = this.villageDoorInfoList.iterator(); -+ -+ while (var3.hasNext()) { -+ VillageDoorInfo var4 = (VillageDoorInfo)var3.next(); -+ -+ if (var2) { -+ var4.resetDoorOpeningRestrictionCounter(); -+ } -+ -+ if (!this.isBlockDoor(var4.posX, var4.posY, var4.posZ) || Math.abs(this.tickCounter - var4.lastActivityTimestamp) > 1200) { -+ this.centerHelper.posX -= var4.posX; -+ this.centerHelper.posY -= var4.posY; -+ this.centerHelper.posZ -= var4.posZ; -+ var1 = true; -+ var4.isDetachedFromVillageFlag = true; -+ var3.remove(); -+ } -+ } -+ -+ if (var1) { -+ this.updateVillageRadiusAndCenter(); - } - } - -- private boolean isBlockDoor(int var1, int var2, int var3) { -- int var4 = this.worldObj.getBlockId(var1, var2, var3); -+ private boolean isBlockDoor(int par1, int par2, int par3) { -+ int var4 = this.worldObj.getBlockId(par1, par2, par3); - return var4 <= 0 ? false : var4 == Block.doorWood.blockID; - } - - private void updateVillageRadiusAndCenter() { -- int var1 = this.b.size(); -- if(var1 == 0) { -+ int var1 = this.villageDoorInfoList.size(); -+ -+ if (var1 == 0) { - this.center.set(0, 0, 0); - this.villageRadius = 0; - } else { - this.center.set(this.centerHelper.posX / var1, this.centerHelper.posY / var1, this.centerHelper.posZ / var1); - int var2 = 0; -- - VillageDoorInfo var4; -- for(Iterator var3 = this.b.iterator(); var3.hasNext(); var2 = Math.max(var4.getDistanceSquared(this.center.posX, this.center.posY, this.center.posZ), var2)) { -+ -+ for (Iterator var3 = this.villageDoorInfoList.iterator(); var3.hasNext(); var2 = Math.max(var4.getDistanceSquared(this.center.posX, this.center.posY, this.center.posZ), var2)) { - var4 = (VillageDoorInfo)var3.next(); - } - -@@ -328,69 +365,83 @@ - } - } - -- public int getReputationForPlayer(String var1) { -- Integer var2 = (Integer)this.j.get(var1); -+ /** -+ * Return the village reputation for a player -+ */ -+ public int getReputationForPlayer(String par1Str) { -+ Integer var2 = (Integer)this.playerReputation.get(par1Str); - return var2 != null ? var2.intValue() : 0; - } - -- public int setReputationForPlayer(String var1, int var2) { -- int var3 = this.getReputationForPlayer(var1); -- int var4 = MathHelper.clamp_int(var3 + var2, -30, 10); -- this.j.put(var1, Integer.valueOf(var4)); -+ /** -+ * Set the village reputation for a player. -+ */ -+ public int setReputationForPlayer(String par1Str, int par2) { -+ int var3 = this.getReputationForPlayer(par1Str); -+ int var4 = MathHelper.clamp_int(var3 + par2, -30, 10); -+ this.playerReputation.put(par1Str, Integer.valueOf(var4)); - return var4; - } - -- public boolean isPlayerReputationTooLow(String var1) { -- return this.getReputationForPlayer(var1) <= -15; -+ /** -+ * Return whether this player has a too low reputation with this village. -+ */ -+ public boolean isPlayerReputationTooLow(String par1Str) { -+ return this.getReputationForPlayer(par1Str) <= -15; - } - -- public void readVillageDataFromNBT(NBTTagCompound var1) { -- this.numVillagers = var1.getInteger("PopSize"); -- this.villageRadius = var1.getInteger("Radius"); -- this.numIronGolems = var1.getInteger("Golems"); -- this.lastAddDoorTimestamp = var1.getInteger("Stable"); -- this.tickCounter = var1.getInteger("Tick"); -- this.noBreedTicks = var1.getInteger("MTick"); -- this.center.posX = var1.getInteger("CX"); -- this.center.posY = var1.getInteger("CY"); -- this.center.posZ = var1.getInteger("CZ"); -- this.centerHelper.posX = var1.getInteger("ACX"); -- this.centerHelper.posY = var1.getInteger("ACY"); -- this.centerHelper.posZ = var1.getInteger("ACZ"); -- NBTTagList var2 = var1.getTagList("Doors"); -+ /** -+ * Read this village's data from NBT. -+ */ -+ public void readVillageDataFromNBT(NBTTagCompound par1NBTTagCompound) { -+ this.numVillagers = par1NBTTagCompound.getInteger("PopSize"); -+ this.villageRadius = par1NBTTagCompound.getInteger("Radius"); -+ this.numIronGolems = par1NBTTagCompound.getInteger("Golems"); -+ this.lastAddDoorTimestamp = par1NBTTagCompound.getInteger("Stable"); -+ this.tickCounter = par1NBTTagCompound.getInteger("Tick"); -+ this.noBreedTicks = par1NBTTagCompound.getInteger("MTick"); -+ this.center.posX = par1NBTTagCompound.getInteger("CX"); -+ this.center.posY = par1NBTTagCompound.getInteger("CY"); -+ this.center.posZ = par1NBTTagCompound.getInteger("CZ"); -+ this.centerHelper.posX = par1NBTTagCompound.getInteger("ACX"); -+ this.centerHelper.posY = par1NBTTagCompound.getInteger("ACY"); -+ this.centerHelper.posZ = par1NBTTagCompound.getInteger("ACZ"); -+ NBTTagList var2 = par1NBTTagCompound.getTagList("Doors"); - -- for(int var3 = 0; var3 < var2.tagCount(); ++var3) { -+ for (int var3 = 0; var3 < var2.tagCount(); ++var3) { - NBTTagCompound var4 = (NBTTagCompound)var2.tagAt(var3); - VillageDoorInfo var5 = new VillageDoorInfo(var4.getInteger("X"), var4.getInteger("Y"), var4.getInteger("Z"), var4.getInteger("IDX"), var4.getInteger("IDZ"), var4.getInteger("TS")); -- this.b.add(var5); -+ this.villageDoorInfoList.add(var5); - } - -- NBTTagList var6 = var1.getTagList("Players"); -+ NBTTagList var6 = par1NBTTagCompound.getTagList("Players"); - -- for(int var7 = 0; var7 < var6.tagCount(); ++var7) { -+ for (int var7 = 0; var7 < var6.tagCount(); ++var7) { - NBTTagCompound var8 = (NBTTagCompound)var6.tagAt(var7); -- this.j.put(var8.getString("Name"), Integer.valueOf(var8.getInteger("S"))); -+ this.playerReputation.put(var8.getString("Name"), Integer.valueOf(var8.getInteger("S"))); - } -- - } - -- public void writeVillageDataToNBT(NBTTagCompound var1) { -- var1.setInteger("PopSize", this.numVillagers); -- var1.setInteger("Radius", this.villageRadius); -- var1.setInteger("Golems", this.numIronGolems); -- var1.setInteger("Stable", this.lastAddDoorTimestamp); -- var1.setInteger("Tick", this.tickCounter); -- var1.setInteger("MTick", this.noBreedTicks); -- var1.setInteger("CX", this.center.posX); -- var1.setInteger("CY", this.center.posY); -- var1.setInteger("CZ", this.center.posZ); -- var1.setInteger("ACX", this.centerHelper.posX); -- var1.setInteger("ACY", this.centerHelper.posY); -- var1.setInteger("ACZ", this.centerHelper.posZ); -+ /** -+ * Write this village's data to NBT. -+ */ -+ public void writeVillageDataToNBT(NBTTagCompound par1NBTTagCompound) { -+ par1NBTTagCompound.setInteger("PopSize", this.numVillagers); -+ par1NBTTagCompound.setInteger("Radius", this.villageRadius); -+ par1NBTTagCompound.setInteger("Golems", this.numIronGolems); -+ par1NBTTagCompound.setInteger("Stable", this.lastAddDoorTimestamp); -+ par1NBTTagCompound.setInteger("Tick", this.tickCounter); -+ par1NBTTagCompound.setInteger("MTick", this.noBreedTicks); -+ par1NBTTagCompound.setInteger("CX", this.center.posX); -+ par1NBTTagCompound.setInteger("CY", this.center.posY); -+ par1NBTTagCompound.setInteger("CZ", this.center.posZ); -+ par1NBTTagCompound.setInteger("ACX", this.centerHelper.posX); -+ par1NBTTagCompound.setInteger("ACY", this.centerHelper.posY); -+ par1NBTTagCompound.setInteger("ACZ", this.centerHelper.posZ); - NBTTagList var2 = new NBTTagList("Doors"); -- Iterator var3 = this.b.iterator(); -+ Iterator var3 = this.villageDoorInfoList.iterator(); - -- while(var3.hasNext()) { -+ while (var3.hasNext()) { - VillageDoorInfo var4 = (VillageDoorInfo)var3.next(); - NBTTagCompound var5 = new NBTTagCompound("Door"); - var5.setInteger("X", var4.posX); -@@ -402,36 +453,41 @@ - var2.appendTag(var5); - } - -- var1.setTag("Doors", var2); -- NBTTagList var7 = new NBTTagList("Players"); -- Iterator var8 = this.j.keySet().iterator(); -+ par1NBTTagCompound.setTag("Doors", var2); -+ NBTTagList var8 = new NBTTagList("Players"); -+ Iterator var9 = this.playerReputation.keySet().iterator(); - -- while(var8.hasNext()) { -- String var9 = (String)var8.next(); -- NBTTagCompound var6 = new NBTTagCompound(var9); -- var6.setString("Name", var9); -- var6.setInteger("S", ((Integer)this.j.get(var9)).intValue()); -- var7.appendTag(var6); -+ while (var9.hasNext()) { -+ String var7 = (String)var9.next(); -+ NBTTagCompound var6 = new NBTTagCompound(var7); -+ var6.setString("Name", var7); -+ var6.setInteger("S", ((Integer)this.playerReputation.get(var7)).intValue()); -+ var8.appendTag(var6); - } - -- var1.setTag("Players", var7); -+ par1NBTTagCompound.setTag("Players", var8); - } - -+ /** -+ * Prevent villager breeding for a fixed interval of time -+ */ - public void endMatingSeason() { - this.noBreedTicks = this.tickCounter; - } - -+ /** -+ * Return whether villagers mating refractory period has passed -+ */ - public boolean isMatingSeason() { - return this.noBreedTicks == 0 || this.tickCounter - this.noBreedTicks >= 3600; - } - -- public void func_82683_b(int var1) { -- Iterator var2 = this.j.keySet().iterator(); -+ public void func_82683_b(int par1) { -+ Iterator var2 = this.playerReputation.keySet().iterator(); - -- while(var2.hasNext()) { -+ while (var2.hasNext()) { - String var3 = (String)var2.next(); -- this.setReputationForPlayer(var3, var1); -+ this.setReputationForPlayer(var3, par1); - } -- - } - } ---- /dev/null -+++ org/spoutcraft/client/packet/PacketStopMusic.java -@@ -1,0 +1,74 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.client.packet; -+ -+import java.io.IOException; -+ -+import org.spoutcraft.api.io.SpoutInputStream; -+import org.spoutcraft.api.io.SpoutOutputStream; -+import org.spoutcraft.client.SpoutClient; -+ -+public class PacketStopMusic implements SpoutPacket { -+ private boolean resetTimer = false; -+ private int fadeTime = -1; -+ public PacketStopMusic() { -+ } -+ -+ public PacketStopMusic(boolean resetTimer, int fadeTime) { -+ this.resetTimer = resetTimer; -+ this.fadeTime = fadeTime; -+ } -+ -+ public int getNumBytes() { -+ return 5; -+ } -+ -+ public void readData(SpoutInputStream input) throws IOException { -+ resetTimer = input.readBoolean(); -+ fadeTime = input.readInt(); -+ } -+ -+ public void writeData(SpoutOutputStream output) throws IOException { -+ output.writeBoolean(resetTimer); -+ output.writeInt(fadeTime); -+ } -+ -+ public void run(int PlayerId) { -+ if (fadeTime == -1) { -+ SpoutClient.getHandle().sndManager.stopMusic(); -+ } else { -+ SpoutClient.getHandle().sndManager.fadeOut(fadeTime); -+ } -+ if (resetTimer) { -+ SpoutClient.getHandle().sndManager.resetTime(); -+ } -+ } -+ -+ public PacketType getPacketType() { -+ return PacketType.PacketStopMusic; -+ } -+ -+ public int getVersion() { -+ return 0; -+ } -+ -+ public void failure(int playerId) { -+ } -+} ---- /dev/null -+++ org/spoutcraft/client/gui/server/ServerTab.java -@@ -1,0 +1,36 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.client.gui.server; -+ -+public class ServerTab { -+ public String title; -+ public String url; -+ public boolean pages; -+ -+ public ServerTab(String title, String url, boolean pages) { -+ this.title = title; -+ this.url = url; -+ this.pages = pages; -+ } -+ -+ public ServerTab(String title, String url) { -+ this(title, url, false); -+ } -+} ---- net/minecraft/src/ChatLine.java -+++ net/minecraft/src/ChatLine.java -@@ -1,18 +1,24 @@ - package net.minecraft.src; - - public class ChatLine { -+ -+ /** GUI Update Counter value this Line was created at */ - private final int updateCounterCreated; -- private final String b; -+ private final String lineString; -+ -+ /** -+ * int value to refer to existing Chat Lines, can be 0 which means unreferrable -+ */ - private final int chatLineID; - -- public ChatLine(int var1, String var2, int var3) { -- this.b = var2; -- this.updateCounterCreated = var1; -- this.chatLineID = var3; -+ public ChatLine(int par1, String par2Str, int par3) { -+ this.lineString = par2Str; -+ this.updateCounterCreated = par1; -+ this.chatLineID = par3; - } - - public String getChatLineString() { -- return this.b; -+ return this.lineString; - } - - public int getUpdatedCounter() { ---- net/minecraft/src/EnchantmentModifierDamage.java -+++ net/minecraft/src/EnchantmentModifierDamage.java -@@ -1,17 +1,28 @@ - package net.minecraft.src; - - final class EnchantmentModifierDamage implements IEnchantmentModifier { -+ -+ /** -+ * Used to calculate the damage modifier (extra armor) on enchantments that the player have on equipped armors. -+ */ - public int damageModifier; -+ -+ /** -+ * Used as parameter to calculate the damage modifier (extra armor) on enchantments that the player have on equipped -+ * armors. -+ */ - public DamageSource source; - -- private EnchantmentModifierDamage() { -- } -- -- public void calculateModifier(Enchantment var1, int var2) { -- this.damageModifier += var1.calcModifierDamage(var2, this.source); -- } -- -- EnchantmentModifierDamage(Empty3 var1) { -+ private EnchantmentModifierDamage() {} -+ -+ /** -+ * Generic method use to calculate modifiers of offensive or defensive enchantment values. -+ */ -+ public void calculateModifier(Enchantment par1Enchantment, int par2) { -+ this.damageModifier += par1Enchantment.calcModifierDamage(par2, this.source); -+ } -+ -+ EnchantmentModifierDamage(Empty3 par1Empty3) { - this(); - } - } ---- net/minecraft/src/SorterStatsBlock.java -+++ net/minecraft/src/SorterStatsBlock.java -@@ -4,41 +4,44 @@ - - class SorterStatsBlock implements Comparator { - final GuiStats statsGUI; -+ - final GuiSlotStatsBlock slotStatsBlockGUI; - -- SorterStatsBlock(GuiSlotStatsBlock var1, GuiStats var2) { -- this.slotStatsBlockGUI = var1; -- this.statsGUI = var2; -+ SorterStatsBlock(GuiSlotStatsBlock par1GuiSlotStatsBlock, GuiStats par2GuiStats) { -+ this.slotStatsBlockGUI = par1GuiSlotStatsBlock; -+ this.statsGUI = par2GuiStats; - } - -- public int func_78334_a(StatCrafting var1, StatCrafting var2) { -- int var3 = var1.getItemID(); -- int var4 = var2.getItemID(); -+ public int func_78334_a(StatCrafting par1StatCrafting, StatCrafting par2StatCrafting) { -+ int var3 = par1StatCrafting.getItemID(); -+ int var4 = par2StatCrafting.getItemID(); - StatBase var5 = null; - StatBase var6 = null; -- if(this.slotStatsBlockGUI.field_77264_j == 2) { -+ -+ if (this.slotStatsBlockGUI.field_77264_j == 2) { - var5 = StatList.mineBlockStatArray[var3]; - var6 = StatList.mineBlockStatArray[var4]; -- } else if(this.slotStatsBlockGUI.field_77264_j == 0) { -+ } else if (this.slotStatsBlockGUI.field_77264_j == 0) { - var5 = StatList.objectCraftStats[var3]; - var6 = StatList.objectCraftStats[var4]; -- } else if(this.slotStatsBlockGUI.field_77264_j == 1) { -+ } else if (this.slotStatsBlockGUI.field_77264_j == 1) { - var5 = StatList.objectUseStats[var3]; - var6 = StatList.objectUseStats[var4]; - } - -- if(var5 != null || var6 != null) { -- if(var5 == null) { -+ if (var5 != null || var6 != null) { -+ if (var5 == null) { - return 1; - } - -- if(var6 == null) { -+ if (var6 == null) { - return -1; - } - - int var7 = GuiStats.getStatsFileWriter(this.slotStatsBlockGUI.theStats).writeStat(var5); - int var8 = GuiStats.getStatsFileWriter(this.slotStatsBlockGUI.theStats).writeStat(var6); -- if(var7 != var8) { -+ -+ if (var7 != var8) { - return (var7 - var8) * this.slotStatsBlockGUI.field_77265_k; - } - } -@@ -46,7 +49,7 @@ - return var3 - var4; - } - -- public int compare(Object var1, Object var2) { -- return this.func_78334_a((StatCrafting)var1, (StatCrafting)var2); -+ public int compare(Object par1Obj, Object par2Obj) { -+ return this.func_78334_a((StatCrafting)par1Obj, (StatCrafting)par2Obj); - } - } ---- net/minecraft/src/ItemShears.java -+++ net/minecraft/src/ItemShears.java -@@ -1,27 +1,34 @@ - package net.minecraft.src; - - public class ItemShears extends Item { -- public ItemShears(int var1) { -- super(var1); -+ public ItemShears(int par1) { -+ super(par1); - this.setMaxStackSize(1); - this.setMaxDamage(238); - this.setCreativeTab(CreativeTabs.tabTools); - } - -- public boolean onBlockDestroyed(ItemStack var1, World var2, int var3, int var4, int var5, int var6, EntityLivingBase var7) { -- if(var3 != Block.leaves.blockID && var3 != Block.web.blockID && var3 != Block.tallGrass.blockID && var3 != Block.vine.blockID && var3 != Block.tripWire.blockID) { -- return super.onBlockDestroyed(var1, var2, var3, var4, var5, var6, var7); -+ public boolean onBlockDestroyed(ItemStack par1ItemStack, World par2World, int par3, int par4, int par5, int par6, EntityLivingBase par7EntityLivingBase) { -+ if (par3 != Block.leaves.blockID && par3 != Block.web.blockID && par3 != Block.tallGrass.blockID && par3 != Block.vine.blockID && par3 != Block.tripWire.blockID) { -+ return super.onBlockDestroyed(par1ItemStack, par2World, par3, par4, par5, par6, par7EntityLivingBase); - } else { -- var1.damageItem(1, var7); -+ par1ItemStack.damageItem(1, par7EntityLivingBase); - return true; - } - } - -- public boolean canHarvestBlock(Block var1) { -- return var1.blockID == Block.web.blockID || var1.blockID == Block.redstoneWire.blockID || var1.blockID == Block.tripWire.blockID; -+ /** -+ * Returns if the item (tool) can harvest results from the block type. -+ */ -+ public boolean canHarvestBlock(Block par1Block) { -+ return par1Block.blockID == Block.web.blockID || par1Block.blockID == Block.redstoneWire.blockID || par1Block.blockID == Block.tripWire.blockID; - } - -- public float getStrVsBlock(ItemStack var1, Block var2) { -- return var2.blockID != Block.web.blockID && var2.blockID != Block.leaves.blockID ? (var2.blockID == Block.cloth.blockID ? 5.0F : super.getStrVsBlock(var1, var2)) : 15.0F; -+ /** -+ * Returns the strength of the stack against a given block. 1.0F base, (Quality+1)*2 if correct blocktype, 1.5F if -+ * sword -+ */ -+ public float getStrVsBlock(ItemStack par1ItemStack, Block par2Block) { -+ return par2Block.blockID != Block.web.blockID && par2Block.blockID != Block.leaves.blockID ? (par2Block.blockID == Block.cloth.blockID ? 5.0F : super.getStrVsBlock(par1ItemStack, par2Block)) : 15.0F; - } - } ---- net/minecraft/src/BlockCommandBlock.java -+++ net/minecraft/src/BlockCommandBlock.java -@@ -3,70 +3,101 @@ - import java.util.Random; - - public class BlockCommandBlock extends BlockContainer { -- public BlockCommandBlock(int var1) { -- super(var1, Material.iron); -+ public BlockCommandBlock(int par1) { -+ super(par1, Material.iron); - } - -- public TileEntity createNewTileEntity(World var1) { -+ /** -+ * Returns a new instance of a block's tile entity class. Called on placing the block. -+ */ -+ public TileEntity createNewTileEntity(World par1World) { - return new TileEntityCommandBlock(); - } - -- public void onNeighborBlockChange(World var1, int var2, int var3, int var4, int var5) { -- if(!var1.isRemote) { -- boolean var6 = var1.isBlockIndirectlyGettingPowered(var2, var3, var4); -- int var7 = var1.getBlockMetadata(var2, var3, var4); -+ /** -+ * Lets the block know when one of its neighbor changes. Doesn't know which neighbor changed (coordinates passed are -+ * their own) Args: x, y, z, neighbor blockID -+ */ -+ public void onNeighborBlockChange(World par1World, int par2, int par3, int par4, int par5) { -+ if (!par1World.isRemote) { -+ boolean var6 = par1World.isBlockIndirectlyGettingPowered(par2, par3, par4); -+ int var7 = par1World.getBlockMetadata(par2, par3, par4); - boolean var8 = (var7 & 1) != 0; -- if(var6 && !var8) { -- var1.setBlockMetadata(var2, var3, var4, var7 | 1, 4); -- var1.scheduleBlockUpdate(var2, var3, var4, this.blockID, this.tickRate(var1)); -- } else if(!var6 && var8) { -- var1.setBlockMetadata(var2, var3, var4, var7 & -2, 4); -+ -+ if (var6 && !var8) { -+ par1World.setBlockMetadataWithNotify(par2, par3, par4, var7 | 1, 4); -+ par1World.scheduleBlockUpdate(par2, par3, par4, this.blockID, this.tickRate(par1World)); -+ } else if (!var6 && var8) { -+ par1World.setBlockMetadataWithNotify(par2, par3, par4, var7 & -2, 4); - } - } -- - } - -- public void updateTick(World var1, int var2, int var3, int var4, Random var5) { -- TileEntity var6 = var1.getBlockTileEntity(var2, var3, var4); -- if(var6 != null && var6 instanceof TileEntityCommandBlock) { -+ /** -+ * Ticks the block if it's been scheduled -+ */ -+ public void updateTick(World par1World, int par2, int par3, int par4, Random par5Random) { -+ TileEntity var6 = par1World.getBlockTileEntity(par2, par3, par4); -+ -+ if (var6 != null && var6 instanceof TileEntityCommandBlock) { - TileEntityCommandBlock var7 = (TileEntityCommandBlock)var6; -- var7.setSignalStrength(var7.executeCommandOnPowered(var1)); -- var1.func_96440_m(var2, var3, var4, this.blockID); -+ var7.func_96102_a(var7.executeCommandOnPowered(par1World)); -+ par1World.func_96440_m(par2, par3, par4, this.blockID); - } -- - } - -- public int tickRate(World var1) { -+ /** -+ * How many world ticks before ticking -+ */ -+ public int tickRate(World par1World) { - return 1; - } - -- public boolean onBlockActivated(World var1, int var2, int var3, int var4, EntityPlayer var5, int var6, float var7, float var8, float var9) { -- TileEntityCommandBlock var10 = (TileEntityCommandBlock)var1.getBlockTileEntity(var2, var3, var4); -- if(var10 != null) { -- var5.displayGUIEditSign(var10); -+ /** -+ * Called upon block activation (right click on the block.) -+ */ -+ public boolean onBlockActivated(World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer, int par6, float par7, float par8, float par9) { -+ TileEntityCommandBlock var10 = (TileEntityCommandBlock)par1World.getBlockTileEntity(par2, par3, par4); -+ -+ if (var10 != null) { -+ par5EntityPlayer.displayGUIEditSign(var10); - } - - return true; - } - -+ /** -+ * If this returns true, then comparators facing away from this block will use the value from -+ * getComparatorInputOverride instead of the actual redstone signal strength. -+ */ - public boolean hasComparatorInputOverride() { - return true; - } - -- public int getComparatorInputOverride(World var1, int var2, int var3, int var4, int var5) { -- TileEntity var6 = var1.getBlockTileEntity(var2, var3, var4); -- return var6 != null && var6 instanceof TileEntityCommandBlock ? ((TileEntityCommandBlock)var6).getSignalStrength() : 0; -+ /** -+ * If hasComparatorInputOverride returns true, the return value from this is used instead of the redstone signal -+ * strength when this block inputs to a comparator. -+ */ -+ public int getComparatorInputOverride(World par1World, int par2, int par3, int par4, int par5) { -+ TileEntity var6 = par1World.getBlockTileEntity(par2, par3, par4); -+ return var6 != null && var6 instanceof TileEntityCommandBlock ? ((TileEntityCommandBlock)var6).func_96103_d() : 0; - } - -- public void onBlockPlacedBy(World var1, int var2, int var3, int var4, EntityLivingBase var5, ItemStack var6) { -- TileEntityCommandBlock var7 = (TileEntityCommandBlock)var1.getBlockTileEntity(var2, var3, var4); -- if(var6.hasDisplayName()) { -- var7.setCommandSenderName(var6.getDisplayName()); -+ /** -+ * Called when the block is placed in the world. -+ */ -+ public void onBlockPlacedBy(World par1World, int par2, int par3, int par4, EntityLivingBase par5EntityLivingBase, ItemStack par6ItemStack) { -+ TileEntityCommandBlock var7 = (TileEntityCommandBlock)par1World.getBlockTileEntity(par2, par3, par4); -+ -+ if (par6ItemStack.hasDisplayName()) { -+ var7.setCommandSenderName(par6ItemStack.getDisplayName()); - } -- - } - -- public int quantityDropped(Random var1) { -+ /** -+ * Returns the quantity of items to drop on block destruction. -+ */ -+ public int quantityDropped(Random par1Random) { - return 0; - } - } ---- net/minecraft/src/BiomeDecorator.java -+++ net/minecraft/src/BiomeDecorator.java -@@ -3,241 +3,376 @@ - import java.util.Random; - - public class BiomeDecorator { -+ -+ /** The world the BiomeDecorator is currently decorating */ - protected World currentWorld; -- protected Random b; -+ -+ /** The Biome Decorator's random number generator. */ -+ protected Random randomGenerator; -+ -+ /** The X-coordinate of the chunk currently being decorated */ - protected int chunk_X; -+ -+ /** The Z-coordinate of the chunk currently being decorated */ - protected int chunk_Z; -+ -+ /** The biome generator object. */ - protected BiomeGenBase biome; -+ -+ /** The clay generator. */ - protected WorldGenerator clayGen = new WorldGenClay(4); -- protected WorldGenerator sandGen = new WorldGenSand(7, Block.sand.blockID); -- protected WorldGenerator gravelAsSandGen = new WorldGenSand(6, Block.gravel.blockID); -- protected WorldGenerator dirtGen = new WorldGenMinable(Block.dirt.blockID, 32); -- protected WorldGenerator gravelGen = new WorldGenMinable(Block.gravel.blockID, 32); -- protected WorldGenerator coalGen = new WorldGenMinable(Block.oreCoal.blockID, 16); -- protected WorldGenerator ironGen = new WorldGenMinable(Block.oreIron.blockID, 8); -- protected WorldGenerator goldGen = new WorldGenMinable(Block.oreGold.blockID, 8); -- protected WorldGenerator redstoneGen = new WorldGenMinable(Block.oreRedstone.blockID, 7); -- protected WorldGenerator diamondGen = new WorldGenMinable(Block.oreDiamond.blockID, 7); -- protected WorldGenerator lapisGen = new WorldGenMinable(Block.oreLapis.blockID, 6); -- protected WorldGenerator plantYellowGen = new WorldGenFlowers(Block.plantYellow.blockID); -- protected WorldGenerator plantRedGen = new WorldGenFlowers(Block.plantRed.blockID); -- protected WorldGenerator mushroomBrownGen = new WorldGenFlowers(Block.mushroomBrown.blockID); -- protected WorldGenerator mushroomRedGen = new WorldGenFlowers(Block.mushroomRed.blockID); -- protected WorldGenerator bigMushroomGen = new WorldGenBigMushroom(); -- protected WorldGenerator reedGen = new WorldGenReed(); -- protected WorldGenerator cactusGen = new WorldGenCactus(); -- protected WorldGenerator waterlilyGen = new WorldGenWaterlily(); -+ -+ /** The sand generator. */ -+ protected WorldGenerator sandGen; -+ -+ /** The gravel generator. */ -+ protected WorldGenerator gravelAsSandGen; -+ -+ /** The dirt generator. */ -+ protected WorldGenerator dirtGen; -+ protected WorldGenerator gravelGen; -+ protected WorldGenerator coalGen; -+ protected WorldGenerator ironGen; -+ -+ /** Field that holds gold WorldGenMinable */ -+ protected WorldGenerator goldGen; -+ -+ /** Field that holds redstone WorldGenMinable */ -+ protected WorldGenerator redstoneGen; -+ -+ /** Field that holds diamond WorldGenMinable */ -+ protected WorldGenerator diamondGen; -+ -+ /** Field that holds Lapis WorldGenMinable */ -+ protected WorldGenerator lapisGen; -+ -+ /** Field that holds one of the plantYellow WorldGenFlowers */ -+ protected WorldGenerator plantYellowGen; -+ -+ /** Field that holds one of the plantRed WorldGenFlowers */ -+ protected WorldGenerator plantRedGen; -+ -+ /** Field that holds mushroomBrown WorldGenFlowers */ -+ protected WorldGenerator mushroomBrownGen; -+ -+ /** Field that holds mushroomRed WorldGenFlowers */ -+ protected WorldGenerator mushroomRedGen; -+ -+ /** Field that holds big mushroom generator */ -+ protected WorldGenerator bigMushroomGen; -+ -+ /** Field that holds WorldGenReed */ -+ protected WorldGenerator reedGen; -+ -+ /** Field that holds WorldGenCactus */ -+ protected WorldGenerator cactusGen; -+ -+ /** The water lily generation! */ -+ protected WorldGenerator waterlilyGen; -+ -+ /** Amount of waterlilys per chunk. */ - protected int waterlilyPerChunk; -+ -+ /** -+ * The number of trees to attempt to generate per chunk. Up to 10 in forests, none in deserts. -+ */ - protected int treesPerChunk; -- protected int flowersPerChunk = 2; -- protected int grassPerChunk = 1; -+ -+ /** -+ * The number of yellow flower patches to generate per chunk. The game generates much less than this number, since it -+ * attempts to generate them at a random altitude. -+ */ -+ protected int flowersPerChunk; -+ -+ /** The amount of tall grass to generate per chunk. */ -+ protected int grassPerChunk; -+ -+ /** -+ * The number of dead bushes to generate per chunk. Used in deserts and swamps. -+ */ - protected int deadBushPerChunk; -+ -+ /** -+ * The number of extra mushroom patches per chunk. It generates 1/4 this number in brown mushroom patches, and 1/8 this -+ * number in red mushroom patches. These mushrooms go beyond the default base number of mushrooms. -+ */ - protected int mushroomsPerChunk; -+ -+ /** -+ * The number of reeds to generate per chunk. Reeds won't generate if the randomly selected placement is unsuitable. -+ */ - protected int reedsPerChunk; -+ -+ /** -+ * The number of cactus plants to generate per chunk. Cacti only work on sand. -+ */ - protected int cactiPerChunk; -- protected int sandPerChunk = 1; -- protected int sandPerChunk2 = 3; -- protected int clayPerChunk = 1; -+ -+ /** -+ * The number of sand patches to generate per chunk. Sand patches only generate when part of it is underwater. -+ */ -+ protected int sandPerChunk; -+ -+ /** -+ * The number of sand patches to generate per chunk. Sand patches only generate when part of it is underwater. There -+ * appear to be two separate fields for this. -+ */ -+ protected int sandPerChunk2; -+ -+ /** -+ * The number of clay patches to generate per chunk. Only generates when part of it is underwater. -+ */ -+ protected int clayPerChunk; -+ -+ /** Amount of big mushrooms per chunk */ - protected int bigMushroomsPerChunk; -- public boolean generateLakes = true; -- -- public BiomeDecorator(BiomeGenBase var1) { -- this.biome = var1; -+ -+ /** True if decorator should generate surface lava & water */ -+ public boolean generateLakes; -+ -+ public BiomeDecorator(BiomeGenBase par1BiomeGenBase) { -+ this.sandGen = new WorldGenSand(7, Block.sand.blockID); -+ this.gravelAsSandGen = new WorldGenSand(6, Block.gravel.blockID); -+ this.dirtGen = new WorldGenMinable(Block.dirt.blockID, 32); -+ this.gravelGen = new WorldGenMinable(Block.gravel.blockID, 32); -+ this.coalGen = new WorldGenMinable(Block.oreCoal.blockID, 16); -+ this.ironGen = new WorldGenMinable(Block.oreIron.blockID, 8); -+ this.goldGen = new WorldGenMinable(Block.oreGold.blockID, 8); -+ this.redstoneGen = new WorldGenMinable(Block.oreRedstone.blockID, 7); -+ this.diamondGen = new WorldGenMinable(Block.oreDiamond.blockID, 7); -+ this.lapisGen = new WorldGenMinable(Block.oreLapis.blockID, 6); -+ this.plantYellowGen = new WorldGenFlowers(Block.plantYellow.blockID); -+ this.plantRedGen = new WorldGenFlowers(Block.plantRed.blockID); -+ this.mushroomBrownGen = new WorldGenFlowers(Block.mushroomBrown.blockID); -+ this.mushroomRedGen = new WorldGenFlowers(Block.mushroomRed.blockID); -+ this.bigMushroomGen = new WorldGenBigMushroom(); -+ this.reedGen = new WorldGenReed(); -+ this.cactusGen = new WorldGenCactus(); -+ this.waterlilyGen = new WorldGenWaterlily(); -+ this.flowersPerChunk = 2; -+ this.grassPerChunk = 1; -+ this.sandPerChunk = 1; -+ this.sandPerChunk2 = 3; -+ this.clayPerChunk = 1; -+ this.generateLakes = true; -+ this.biome = par1BiomeGenBase; - } - -- public void decorate(World var1, Random var2, int var3, int var4) { -- if(this.currentWorld != null) { -+ /** -+ * Decorates the world. Calls code that was formerly (pre-1.8) in ChunkProviderGenerate.populate -+ */ -+ // Spout Start - Synchronize instead of throwing exceptions. -+ public synchronized void decorate(World par1World, Random par2Random, int par3, int par4) { -+ /* -+ if (this.currentWorld != null) { - throw new RuntimeException("Already decorating!!"); - } else { -- this.currentWorld = var1; -- this.b = var2; -- this.chunk_X = var3; -- this.chunk_Z = var4; -+ */ -+ { -+ // Spout End -+ this.currentWorld = par1World; -+ this.randomGenerator = par2Random; -+ this.chunk_X = par3; -+ this.chunk_Z = par4; - this.decorate(); - this.currentWorld = null; -- this.b = null; -+ this.randomGenerator = null; - } - } - -+ /** -+ * The method that does the work of actually decorating chunks -+ */ - protected void decorate() { - this.generateOres(); -- - int var1; - int var2; - int var3; -- for(var1 = 0; var1 < this.sandPerChunk2; ++var1) { -- var2 = this.chunk_X + this.b.nextInt(16) + 8; -- var3 = this.chunk_Z + this.b.nextInt(16) + 8; -- this.sandGen.generate(this.currentWorld, this.b, var2, this.currentWorld.getTopSolidOrLiquidBlock(var2, var3), var3); -- } -- -- for(var1 = 0; var1 < this.clayPerChunk; ++var1) { -- var2 = this.chunk_X + this.b.nextInt(16) + 8; -- var3 = this.chunk_Z + this.b.nextInt(16) + 8; -- this.clayGen.generate(this.currentWorld, this.b, var2, this.currentWorld.getTopSolidOrLiquidBlock(var2, var3), var3); -- } -- -- for(var1 = 0; var1 < this.sandPerChunk; ++var1) { -- var2 = this.chunk_X + this.b.nextInt(16) + 8; -- var3 = this.chunk_Z + this.b.nextInt(16) + 8; -- this.sandGen.generate(this.currentWorld, this.b, var2, this.currentWorld.getTopSolidOrLiquidBlock(var2, var3), var3); -+ -+ for (var1 = 0; var1 < this.sandPerChunk2; ++var1) { -+ var2 = this.chunk_X + this.randomGenerator.nextInt(16) + 8; -+ var3 = this.chunk_Z + this.randomGenerator.nextInt(16) + 8; -+ this.sandGen.generate(this.currentWorld, this.randomGenerator, var2, this.currentWorld.getTopSolidOrLiquidBlock(var2, var3), var3); -+ } -+ -+ for (var1 = 0; var1 < this.clayPerChunk; ++var1) { -+ var2 = this.chunk_X + this.randomGenerator.nextInt(16) + 8; -+ var3 = this.chunk_Z + this.randomGenerator.nextInt(16) + 8; -+ this.clayGen.generate(this.currentWorld, this.randomGenerator, var2, this.currentWorld.getTopSolidOrLiquidBlock(var2, var3), var3); -+ } -+ -+ for (var1 = 0; var1 < this.sandPerChunk; ++var1) { -+ var2 = this.chunk_X + this.randomGenerator.nextInt(16) + 8; -+ var3 = this.chunk_Z + this.randomGenerator.nextInt(16) + 8; -+ this.sandGen.generate(this.currentWorld, this.randomGenerator, var2, this.currentWorld.getTopSolidOrLiquidBlock(var2, var3), var3); - } - - var1 = this.treesPerChunk; -- if(this.b.nextInt(10) == 0) { -+ -+ if (this.randomGenerator.nextInt(10) == 0) { - ++var1; - } - - int var4; -- for(var2 = 0; var2 < var1; ++var2) { -- var3 = this.chunk_X + this.b.nextInt(16) + 8; -- var4 = this.chunk_Z + this.b.nextInt(16) + 8; -- WorldGenerator var5 = this.biome.getRandomWorldGenForTrees(this.b); -+ -+ for (var2 = 0; var2 < var1; ++var2) { -+ var3 = this.chunk_X + this.randomGenerator.nextInt(16) + 8; -+ var4 = this.chunk_Z + this.randomGenerator.nextInt(16) + 8; -+ WorldGenerator var5 = this.biome.getRandomWorldGenForTrees(this.randomGenerator); - var5.setScale(1.0D, 1.0D, 1.0D); -- var5.generate(this.currentWorld, this.b, var3, this.currentWorld.getHeightValue(var3, var4), var4); -+ var5.generate(this.currentWorld, this.randomGenerator, var3, this.currentWorld.getHeightValue(var3, var4), var4); - } - -- for(var2 = 0; var2 < this.bigMushroomsPerChunk; ++var2) { -- var3 = this.chunk_X + this.b.nextInt(16) + 8; -- var4 = this.chunk_Z + this.b.nextInt(16) + 8; -- this.bigMushroomGen.generate(this.currentWorld, this.b, var3, this.currentWorld.getHeightValue(var3, var4), var4); -+ for (var2 = 0; var2 < this.bigMushroomsPerChunk; ++var2) { -+ var3 = this.chunk_X + this.randomGenerator.nextInt(16) + 8; -+ var4 = this.chunk_Z + this.randomGenerator.nextInt(16) + 8; -+ this.bigMushroomGen.generate(this.currentWorld, this.randomGenerator, var3, this.currentWorld.getHeightValue(var3, var4), var4); - } - - int var7; -- for(var2 = 0; var2 < this.flowersPerChunk; ++var2) { -- var3 = this.chunk_X + this.b.nextInt(16) + 8; -- var4 = this.b.nextInt(128); -- var7 = this.chunk_Z + this.b.nextInt(16) + 8; -- this.plantYellowGen.generate(this.currentWorld, this.b, var3, var4, var7); -- if(this.b.nextInt(4) == 0) { -- var3 = this.chunk_X + this.b.nextInt(16) + 8; -- var4 = this.b.nextInt(128); -- var7 = this.chunk_Z + this.b.nextInt(16) + 8; -- this.plantRedGen.generate(this.currentWorld, this.b, var3, var4, var7); -- } -- } -- -- for(var2 = 0; var2 < this.grassPerChunk; ++var2) { -- var3 = this.chunk_X + this.b.nextInt(16) + 8; -- var4 = this.b.nextInt(128); -- var7 = this.chunk_Z + this.b.nextInt(16) + 8; -- WorldGenerator var6 = this.biome.getRandomWorldGenForGrass(this.b); -- var6.generate(this.currentWorld, this.b, var3, var4, var7); -- } -- -- for(var2 = 0; var2 < this.deadBushPerChunk; ++var2) { -- var3 = this.chunk_X + this.b.nextInt(16) + 8; -- var4 = this.b.nextInt(128); -- var7 = this.chunk_Z + this.b.nextInt(16) + 8; -- (new WorldGenDeadBush(Block.deadBush.blockID)).generate(this.currentWorld, this.b, var3, var4, var7); -- } -- -- for(var2 = 0; var2 < this.waterlilyPerChunk; ++var2) { -- var3 = this.chunk_X + this.b.nextInt(16) + 8; -- var4 = this.chunk_Z + this.b.nextInt(16) + 8; -- -- for(var7 = this.b.nextInt(128); var7 > 0 && this.currentWorld.getBlockId(var3, var7 - 1, var4) == 0; --var7) { -- } -- -- this.waterlilyGen.generate(this.currentWorld, this.b, var3, var7, var4); -- } -- -- for(var2 = 0; var2 < this.mushroomsPerChunk; ++var2) { -- if(this.b.nextInt(4) == 0) { -- var3 = this.chunk_X + this.b.nextInt(16) + 8; -- var4 = this.chunk_Z + this.b.nextInt(16) + 8; -+ -+ for (var2 = 0; var2 < this.flowersPerChunk; ++var2) { -+ var3 = this.chunk_X + this.randomGenerator.nextInt(16) + 8; -+ var4 = this.randomGenerator.nextInt(128); -+ var7 = this.chunk_Z + this.randomGenerator.nextInt(16) + 8; -+ this.plantYellowGen.generate(this.currentWorld, this.randomGenerator, var3, var4, var7); -+ -+ if (this.randomGenerator.nextInt(4) == 0) { -+ var3 = this.chunk_X + this.randomGenerator.nextInt(16) + 8; -+ var4 = this.randomGenerator.nextInt(128); -+ var7 = this.chunk_Z + this.randomGenerator.nextInt(16) + 8; -+ this.plantRedGen.generate(this.currentWorld, this.randomGenerator, var3, var4, var7); -+ } -+ } -+ -+ for (var2 = 0; var2 < this.grassPerChunk; ++var2) { -+ var3 = this.chunk_X + this.randomGenerator.nextInt(16) + 8; -+ var4 = this.randomGenerator.nextInt(128); -+ var7 = this.chunk_Z + this.randomGenerator.nextInt(16) + 8; -+ WorldGenerator var6 = this.biome.getRandomWorldGenForGrass(this.randomGenerator); -+ var6.generate(this.currentWorld, this.randomGenerator, var3, var4, var7); -+ } -+ -+ for (var2 = 0; var2 < this.deadBushPerChunk; ++var2) { -+ var3 = this.chunk_X + this.randomGenerator.nextInt(16) + 8; -+ var4 = this.randomGenerator.nextInt(128); -+ var7 = this.chunk_Z + this.randomGenerator.nextInt(16) + 8; -+ (new WorldGenDeadBush(Block.deadBush.blockID)).generate(this.currentWorld, this.randomGenerator, var3, var4, var7); -+ } -+ -+ for (var2 = 0; var2 < this.waterlilyPerChunk; ++var2) { -+ var3 = this.chunk_X + this.randomGenerator.nextInt(16) + 8; -+ var4 = this.chunk_Z + this.randomGenerator.nextInt(16) + 8; -+ -+ for (var7 = this.randomGenerator.nextInt(128); var7 > 0 && this.currentWorld.getBlockId(var3, var7 - 1, var4) == 0; --var7) { -+ ; -+ } -+ -+ this.waterlilyGen.generate(this.currentWorld, this.randomGenerator, var3, var7, var4); -+ } -+ -+ for (var2 = 0; var2 < this.mushroomsPerChunk; ++var2) { -+ if (this.randomGenerator.nextInt(4) == 0) { -+ var3 = this.chunk_X + this.randomGenerator.nextInt(16) + 8; -+ var4 = this.chunk_Z + this.randomGenerator.nextInt(16) + 8; - var7 = this.currentWorld.getHeightValue(var3, var4); -- this.mushroomBrownGen.generate(this.currentWorld, this.b, var3, var7, var4); -- } -- -- if(this.b.nextInt(8) == 0) { -- var3 = this.chunk_X + this.b.nextInt(16) + 8; -- var4 = this.chunk_Z + this.b.nextInt(16) + 8; -- var7 = this.b.nextInt(128); -- this.mushroomRedGen.generate(this.currentWorld, this.b, var3, var7, var4); -- } -- } -- -- if(this.b.nextInt(4) == 0) { -- var2 = this.chunk_X + this.b.nextInt(16) + 8; -- var3 = this.b.nextInt(128); -- var4 = this.chunk_Z + this.b.nextInt(16) + 8; -- this.mushroomBrownGen.generate(this.currentWorld, this.b, var2, var3, var4); -- } -- -- if(this.b.nextInt(8) == 0) { -- var2 = this.chunk_X + this.b.nextInt(16) + 8; -- var3 = this.b.nextInt(128); -- var4 = this.chunk_Z + this.b.nextInt(16) + 8; -- this.mushroomRedGen.generate(this.currentWorld, this.b, var2, var3, var4); -- } -- -- for(var2 = 0; var2 < this.reedsPerChunk; ++var2) { -- var3 = this.chunk_X + this.b.nextInt(16) + 8; -- var4 = this.chunk_Z + this.b.nextInt(16) + 8; -- var7 = this.b.nextInt(128); -- this.reedGen.generate(this.currentWorld, this.b, var3, var7, var4); -- } -- -- for(var2 = 0; var2 < 10; ++var2) { -- var3 = this.chunk_X + this.b.nextInt(16) + 8; -- var4 = this.b.nextInt(128); -- var7 = this.chunk_Z + this.b.nextInt(16) + 8; -- this.reedGen.generate(this.currentWorld, this.b, var3, var4, var7); -- } -- -- if(this.b.nextInt(32) == 0) { -- var2 = this.chunk_X + this.b.nextInt(16) + 8; -- var3 = this.b.nextInt(128); -- var4 = this.chunk_Z + this.b.nextInt(16) + 8; -- (new WorldGenPumpkin()).generate(this.currentWorld, this.b, var2, var3, var4); -- } -- -- for(var2 = 0; var2 < this.cactiPerChunk; ++var2) { -- var3 = this.chunk_X + this.b.nextInt(16) + 8; -- var4 = this.b.nextInt(128); -- var7 = this.chunk_Z + this.b.nextInt(16) + 8; -- this.cactusGen.generate(this.currentWorld, this.b, var3, var4, var7); -- } -- -- if(this.generateLakes) { -- for(var2 = 0; var2 < 50; ++var2) { -- var3 = this.chunk_X + this.b.nextInt(16) + 8; -- var4 = this.b.nextInt(this.b.nextInt(120) + 8); -- var7 = this.chunk_Z + this.b.nextInt(16) + 8; -- (new WorldGenLiquids(Block.waterMoving.blockID)).generate(this.currentWorld, this.b, var3, var4, var7); -- } -- -- for(var2 = 0; var2 < 20; ++var2) { -- var3 = this.chunk_X + this.b.nextInt(16) + 8; -- var4 = this.b.nextInt(this.b.nextInt(this.b.nextInt(112) + 8) + 8); -- var7 = this.chunk_Z + this.b.nextInt(16) + 8; -- (new WorldGenLiquids(Block.lavaMoving.blockID)).generate(this.currentWorld, this.b, var3, var4, var7); -- } -- } -- -- } -- -- protected void genStandardOre1(int var1, WorldGenerator var2, int var3, int var4) { -- for(int var5 = 0; var5 < var1; ++var5) { -- int var6 = this.chunk_X + this.b.nextInt(16); -- int var7 = this.b.nextInt(var4 - var3) + var3; -- int var8 = this.chunk_Z + this.b.nextInt(16); -- var2.generate(this.currentWorld, this.b, var6, var7, var8); -- } -- -- } -- -- protected void genStandardOre2(int var1, WorldGenerator var2, int var3, int var4) { -- for(int var5 = 0; var5 < var1; ++var5) { -- int var6 = this.chunk_X + this.b.nextInt(16); -- int var7 = this.b.nextInt(var4) + this.b.nextInt(var4) + (var3 - var4); -- int var8 = this.chunk_Z + this.b.nextInt(16); -- var2.generate(this.currentWorld, this.b, var6, var7, var8); -- } -- -- } -- -+ this.mushroomBrownGen.generate(this.currentWorld, this.randomGenerator, var3, var7, var4); -+ } -+ -+ if (this.randomGenerator.nextInt(8) == 0) { -+ var3 = this.chunk_X + this.randomGenerator.nextInt(16) + 8; -+ var4 = this.chunk_Z + this.randomGenerator.nextInt(16) + 8; -+ var7 = this.randomGenerator.nextInt(128); -+ this.mushroomRedGen.generate(this.currentWorld, this.randomGenerator, var3, var7, var4); -+ } -+ } -+ -+ if (this.randomGenerator.nextInt(4) == 0) { -+ var2 = this.chunk_X + this.randomGenerator.nextInt(16) + 8; -+ var3 = this.randomGenerator.nextInt(128); -+ var4 = this.chunk_Z + this.randomGenerator.nextInt(16) + 8; -+ this.mushroomBrownGen.generate(this.currentWorld, this.randomGenerator, var2, var3, var4); -+ } -+ -+ if (this.randomGenerator.nextInt(8) == 0) { -+ var2 = this.chunk_X + this.randomGenerator.nextInt(16) + 8; -+ var3 = this.randomGenerator.nextInt(128); -+ var4 = this.chunk_Z + this.randomGenerator.nextInt(16) + 8; -+ this.mushroomRedGen.generate(this.currentWorld, this.randomGenerator, var2, var3, var4); -+ } -+ -+ for (var2 = 0; var2 < this.reedsPerChunk; ++var2) { -+ var3 = this.chunk_X + this.randomGenerator.nextInt(16) + 8; -+ var4 = this.chunk_Z + this.randomGenerator.nextInt(16) + 8; -+ var7 = this.randomGenerator.nextInt(128); -+ this.reedGen.generate(this.currentWorld, this.randomGenerator, var3, var7, var4); -+ } -+ -+ for (var2 = 0; var2 < 10; ++var2) { -+ var3 = this.chunk_X + this.randomGenerator.nextInt(16) + 8; -+ var4 = this.randomGenerator.nextInt(128); -+ var7 = this.chunk_Z + this.randomGenerator.nextInt(16) + 8; -+ this.reedGen.generate(this.currentWorld, this.randomGenerator, var3, var4, var7); -+ } -+ -+ if (this.randomGenerator.nextInt(32) == 0) { -+ var2 = this.chunk_X + this.randomGenerator.nextInt(16) + 8; -+ var3 = this.randomGenerator.nextInt(128); -+ var4 = this.chunk_Z + this.randomGenerator.nextInt(16) + 8; -+ (new WorldGenPumpkin()).generate(this.currentWorld, this.randomGenerator, var2, var3, var4); -+ } -+ -+ for (var2 = 0; var2 < this.cactiPerChunk; ++var2) { -+ var3 = this.chunk_X + this.randomGenerator.nextInt(16) + 8; -+ var4 = this.randomGenerator.nextInt(128); -+ var7 = this.chunk_Z + this.randomGenerator.nextInt(16) + 8; -+ this.cactusGen.generate(this.currentWorld, this.randomGenerator, var3, var4, var7); -+ } -+ -+ if (this.generateLakes) { -+ for (var2 = 0; var2 < 50; ++var2) { -+ var3 = this.chunk_X + this.randomGenerator.nextInt(16) + 8; -+ var4 = this.randomGenerator.nextInt(this.randomGenerator.nextInt(120) + 8); -+ var7 = this.chunk_Z + this.randomGenerator.nextInt(16) + 8; -+ (new WorldGenLiquids(Block.waterMoving.blockID)).generate(this.currentWorld, this.randomGenerator, var3, var4, var7); -+ } -+ -+ for (var2 = 0; var2 < 20; ++var2) { -+ var3 = this.chunk_X + this.randomGenerator.nextInt(16) + 8; -+ var4 = this.randomGenerator.nextInt(this.randomGenerator.nextInt(this.randomGenerator.nextInt(112) + 8) + 8); -+ var7 = this.chunk_Z + this.randomGenerator.nextInt(16) + 8; -+ (new WorldGenLiquids(Block.lavaMoving.blockID)).generate(this.currentWorld, this.randomGenerator, var3, var4, var7); -+ } -+ } -+ } -+ -+ /** -+ * Standard ore generation helper. Generates most ores. -+ */ -+ protected void genStandardOre1(int par1, WorldGenerator par2WorldGenerator, int par3, int par4) { -+ for (int var5 = 0; var5 < par1; ++var5) { -+ int var6 = this.chunk_X + this.randomGenerator.nextInt(16); -+ int var7 = this.randomGenerator.nextInt(par4 - par3) + par3; -+ int var8 = this.chunk_Z + this.randomGenerator.nextInt(16); -+ par2WorldGenerator.generate(this.currentWorld, this.randomGenerator, var6, var7, var8); -+ } -+ } -+ -+ /** -+ * Standard ore generation helper. Generates Lapis Lazuli. -+ */ -+ protected void genStandardOre2(int par1, WorldGenerator par2WorldGenerator, int par3, int par4) { -+ for (int var5 = 0; var5 < par1; ++var5) { -+ int var6 = this.chunk_X + this.randomGenerator.nextInt(16); -+ int var7 = this.randomGenerator.nextInt(par4) + this.randomGenerator.nextInt(par4) + (par3 - par4); -+ int var8 = this.chunk_Z + this.randomGenerator.nextInt(16); -+ par2WorldGenerator.generate(this.currentWorld, this.randomGenerator, var6, var7, var8); -+ } -+ } -+ -+ /** -+ * Generates ores in the current chunk -+ */ - protected void generateOres() { - this.genStandardOre1(20, this.dirtGen, 0, 128); - this.genStandardOre1(10, this.gravelGen, 0, 128); ---- /dev/null -+++ org/spoutcraft/api/gui/ChatTextBox.java -@@ -1,0 +1,272 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.api.gui; -+ -+import java.io.IOException; -+import java.util.Iterator; -+import java.util.LinkedList; -+import java.util.List; -+import java.util.UUID; -+ -+import org.spoutcraft.api.UnsafeClass; -+import org.spoutcraft.api.io.SpoutInputStream; -+import org.spoutcraft.api.io.SpoutOutputStream; -+import org.spoutcraft.api.player.ChatMessage; -+ -+@UnsafeClass -+public class ChatTextBox extends GenericWidget implements Widget { -+ protected int visibleLines = 10; -+ protected int visibleChatLines = 20; -+ protected int fadeoutTicks = 20 * 5; -+ protected static final List chatMessages = new LinkedList(); -+ -+ public ChatTextBox() { -+ } -+ -+ public WidgetType getType() { -+ return WidgetType.ChatTextBox; -+ } -+ -+ @Override -+ public void readData(SpoutInputStream input) throws IOException { -+ super.readData(input); -+ setNumVisibleLines(input.readInt()); -+ setNumVisibleChatLines(input.readInt()); -+ setFadeoutTicks(input.readInt()); -+ } -+ -+ @Override -+ public void writeData(SpoutOutputStream output) throws IOException { -+ super.writeData(output); -+ output.writeInt(getNumVisibleLines()); -+ output.writeInt(getNumVisibleChatLines()); -+ output.writeInt(getFadeoutTicks()); -+ } -+ -+ public UUID getId() { -+ return new UUID(0, 3); -+ } -+ -+ private boolean chatOpen = false; -+ public void setChatOpen(boolean chat) { -+ chatOpen = chat; -+ } -+ -+ public void render() { -+ /*GL11.glEnable(GL11.GL_BLEND); -+ GL11.glBlendFunc(GL11.GL_SRC_ALPHA, 771); -+ if (!isVisible()) { -+ return; -+ } -+ float chatOpacity = Spoutcraft.getChatManager().getOpacity(); -+ int scroll = Spoutcraft.getChatManager().getScroll(); -+ MinecraftFont font = Spoutcraft.getMinecraftFont(); -+ synchronized(chatMessages) { -+ Iterator iter = chatMessages.iterator(); -+ for (int i = 0; i < scroll; i++) { -+ if (iter.hasNext()) { -+ iter.next(); -+ } -+ } -+ int lines = 0; -+ int bottom = (int) getScreen().getHeight() - 50; -+ while (iter.hasNext()) { -+ ChatMessage message = iter.next(); -+ if (message.isIgnoredPerson() && Spoutcraft.getChatManager().isIgnoringPlayers()) { -+ continue; -+ } -+ if (message.isJoinMessage() && !Spoutcraft.getChatManager().isShowingJoins()) { -+ continue; -+ } -+ double opacity = 1D; -+ -+ if (message.getAge() > getFadeoutTicks() - 20) { -+ opacity = 1D - ((double) message.getAge() - (double) getFadeoutTicks()) / 20d; -+ } -+ -+ if (opacity > 1.0d) { -+ opacity = 1.0d; -+ } -+ if (opacity < 0.0d) { -+ opacity = 0.0d; -+ } -+ if (message.getAge() > getFadeoutTicks() + 20 && !chatOpen) { -+ break; -+ } -+ if (chatOpen) { -+ opacity = 1D; -+ } -+ if (opacity == 0) { -+ continue; -+ } -+ //int chatColor = (chatOpen ? 255 : (int)(255D * opacity)); -+ int chatColor = 0x00ffffff; -+ int textAlpha = (int) (opacity * 255) << 24; -+ chatColor |= textAlpha; -+ int backgroundAlpha = (int) (Math.min(chatOpacity, opacity) * 255) << 24; -+ int backgroundColor = 0x00000000 | backgroundAlpha; -+ if (Spoutcraft.getChatManager().isHighlightingWords() && message.isHighlighted() && !message.isJoinMessage()) { -+ backgroundColor = 0x00ff0000 | backgroundAlpha; -+ } -+ RenderUtil.drawRectangle(3, bottom - 1, 3 + 320, bottom + 9, backgroundColor); -+ font.drawShadowedString(message.getUnparsedMessage(), 4, bottom, chatColor); -+ bottom -= 10; -+ lines ++; -+ if (!chatOpen && lines > visibleLines) { -+ break; -+ } else if (chatOpen && lines > visibleChatLines) { -+ break; -+ } -+ } -+ } -+ GL11.glDisable(GL11.GL_BLEND);*/ -+ } -+ -+ public void increaseAge() { -+ synchronized (chatMessages) { -+ Iterator iter = chatMessages.iterator(); -+ while (iter.hasNext()) { -+ ChatMessage message = iter.next(); -+ message.onTick(); -+ if (message.getAge() > getFadeoutTicks()) { -+ break; -+ } -+ } -+ } -+ } -+ -+ /** -+ * Gets the number of visible lines of chat for the player -+ * -+ * @return visible chat lines -+ */ -+ public int getNumVisibleLines() { -+ return visibleLines; -+ } -+ -+ /** -+ * Sets the number of visible lines of chat for the player -+ * -+ * @param lines to view -+ * @return ChatTextBox -+ */ -+ public ChatTextBox setNumVisibleLines(int lines) { -+ visibleLines = lines; -+ return this; -+ } -+ -+ /** -+ * Gets the number of visible lines of chat for the player, when fully opened -+ * -+ * @return visible chat lines -+ */ -+ public int getNumVisibleChatLines() { -+ return visibleChatLines; -+ } -+ -+ /** -+ * Sets the number of visible lines of chat for the player, when fully opened -+ * -+ * @param lines to view -+ * @return ChatTextBox -+ */ -+ public ChatTextBox setNumVisibleChatLines(int lines) { -+ visibleChatLines = lines; -+ return this; -+ } -+ -+ /** -+ * The number ticks until the text fades out from the main screen -+ * -+ * @return fadeout ticks -+ */ -+ public int getFadeoutTicks() { -+ return fadeoutTicks; -+ } -+ -+ /** -+ * Sets the number of ticks until the text fades out from the main screen. 20 ticks is equivelent to one second. -+ * -+ * @param ticks to set -+ * @return this -+ */ -+ public ChatTextBox setFadeoutTicks(int ticks) { -+ fadeoutTicks = ticks; -+ return this; -+ } -+ -+ public static void addChatMessage(ChatMessage message) { -+ if (message.getUnparsedMessage().trim().equals("")) { -+ return; -+ } -+ synchronized (chatMessages) { -+ chatMessages.add(0, message); -+ while (chatMessages.size() > 3000) { -+ chatMessages.remove(chatMessages.size() - 1); -+ } -+ } -+ } -+ -+ public static void reparse() { -+ synchronized (chatMessages) { -+ for (ChatMessage message:chatMessages) { -+ message.reparse(); -+ } -+ } -+ } -+ -+ public static void clearChat() { -+ synchronized (chatMessages) { -+ chatMessages.clear(); -+ } -+ } -+ -+ public static int getNumChatMessages() { -+ synchronized (chatMessages) { -+ return chatMessages.size(); -+ } -+ } -+ -+ public static String getChatMessageAt(int pos) { -+ synchronized (chatMessages) { -+ if (pos > -1 && pos < chatMessages.size()) { -+ return chatMessages.get(pos).getMessage(); -+ } -+ } -+ return ""; -+ } -+ -+ public static String getPlayerNameAt(int pos) { -+ synchronized (chatMessages) { -+ if (pos > -1 && pos < chatMessages.size()) { -+ String player = chatMessages.get(pos).getPlayer(); -+ if (player != null) { -+ return player; -+ } -+ } -+ } -+ return ""; -+ } -+ -+ @Override -+ public int getVersion() { -+ return super.getVersion() + 1; -+ } -+} ---- /dev/null -+++ org/bukkit/util/config/Configuration.java -@@ -1,0 +1,137 @@ -+package org.bukkit.util.config; -+ -+import java.io.File; -+import java.io.FileInputStream; -+import java.io.FileOutputStream; -+import java.io.IOException; -+import java.io.OutputStreamWriter; -+import java.util.HashMap; -+import java.util.Map; -+ -+import org.yaml.snakeyaml.DumperOptions; -+import org.yaml.snakeyaml.Yaml; -+import org.yaml.snakeyaml.constructor.SafeConstructor; -+import org.yaml.snakeyaml.reader.UnicodeReader; -+import org.yaml.snakeyaml.representer.Representer; -+ -+/** -+ * YAML configuration loader. To use this class, construct it with path to -+ * a file and call its load() method. For specifying node paths in the -+ * various get*() methods, they support SK's path notation, allowing you to -+ * select child nodes by delimiting node names with periods. -+ * -+ *

-+ * For example, given the following configuration file:

-+ * -+ *
members:
-+ *	 - Hollie
-+ *	 - Jason
-+ *	 - Bobo
-+ *	 - Aya
-+ *	 - Tetsu
-+ * worldguard:
-+ *	 fire:
-+ *		 spread: false
-+ *		 blocks: [cloth, rock, glass]
-+ * sturmeh:
-+ *	 cool: false
-+ *	 eats:
-+ *		 babies: true
-+ * -+ *

Calling code could access sturmeh's baby eating state by using -+ * getBoolean("sturmeh.eats.babies", false). For lists, there are -+ * methods such as getStringList that will return a type safe list. -+ * -+ *

This class is currently incomplete. It is not yet possible to get a node. -+ *

-+ */ -+public class Configuration extends ConfigurationNode { -+ private Yaml yaml; -+ private File file; -+ -+ public Configuration(File file) { -+ super(new HashMap()); -+ -+ DumperOptions options = new DumperOptions(); -+ -+ options.setIndent(4); -+ options.setDefaultFlowStyle(DumperOptions.FlowStyle.BLOCK); -+ -+ yaml = new Yaml(new SafeConstructor(), new Representer(), options); -+ -+ this.file = file; -+ } -+ -+ /** -+ * Loads the configuration file. All errors are thrown away. -+ */ -+ public void load() { -+ FileInputStream stream = null; -+ -+ try { -+ stream = new FileInputStream(file); -+ read(yaml.load(new UnicodeReader(stream))); -+ } catch (IOException e) { -+ root = new HashMap(); -+ } catch (ConfigurationException e) { -+ root = new HashMap(); -+ } finally { -+ try { -+ if (stream != null) { -+ stream.close(); -+ } -+ } catch (IOException e) {} -+ } -+ } -+ -+ /** -+ * Saves the configuration to disk. All errors are clobbered. -+ * -+ * @return true if it was successful -+ */ -+ public boolean save() { -+ FileOutputStream stream = null; -+ -+ File parent = file.getParentFile(); -+ -+ if (parent != null) { -+ parent.mkdirs(); -+ } -+ -+ try { -+ stream = new FileOutputStream(file); -+ yaml.dump(root, new OutputStreamWriter(stream, "UTF-8")); -+ return true; -+ } catch (IOException e) {} finally { -+ try { -+ if (stream != null) { -+ stream.close(); -+ } -+ } catch (IOException e) {} -+ } -+ -+ return false; -+ } -+ -+ @SuppressWarnings("unchecked") -+ private void read(Object input) throws ConfigurationException { -+ try { -+ if (null == input) { -+ root = new HashMap(); -+ } else { -+ root = (Map) input; -+ } -+ } catch (ClassCastException e) { -+ throw new ConfigurationException("Root document must be an key-value structure"); -+ } -+ } -+ -+ /** -+ * This method returns an empty ConfigurationNode for using as a -+ * default in methods that select a node from a node list. -+ * @return -+ */ -+ public static ConfigurationNode getEmptyNode() { -+ return new ConfigurationNode(new HashMap()); -+ } -+} ---- net/minecraft/src/GuiScreenConfirmation.java -+++ net/minecraft/src/GuiScreenConfirmation.java -@@ -2,37 +2,46 @@ - - public class GuiScreenConfirmation extends GuiScreen { - private final GuiScreenConfirmationType field_140045_e; -- private final String p; -- private final String q; -+ private final String field_140049_p; -+ private final String field_96288_n; - protected final GuiScreen field_140048_a; -- protected final String b; -- protected final String c; -+ protected final String field_140046_b; -+ protected final String field_140047_c; - protected final int field_140044_d; - -- public GuiScreenConfirmation(GuiScreen var1, GuiScreenConfirmationType var2, String var3, String var4, int var5) { -- this.field_140048_a = var1; -- this.field_140044_d = var5; -- this.field_140045_e = var2; -- this.p = var3; -- this.q = var4; -- this.b = I18n.getString("gui.yes"); -- this.c = I18n.getString("gui.no"); -+ public GuiScreenConfirmation(GuiScreen par1GuiScreen, GuiScreenConfirmationType par2GuiScreenConfirmationType, String par3Str, String par4Str, int par5) { -+ this.field_140048_a = par1GuiScreen; -+ this.field_140044_d = par5; -+ this.field_140045_e = par2GuiScreenConfirmationType; -+ this.field_140049_p = par3Str; -+ this.field_96288_n = par4Str; -+ this.field_140046_b = I18n.getString("gui.yes"); -+ this.field_140047_c = I18n.getString("gui.no"); - } - -+ /** -+ * Adds the buttons (and other controls) to the screen in question. -+ */ - public void initGui() { -- this.i.add(new GuiSmallButton(0, this.width / 2 - 155, this.height / 6 + 112, this.b)); -- this.i.add(new GuiSmallButton(1, this.width / 2 - 155 + 160, this.height / 6 + 112, this.c)); -- } -- -- protected void actionPerformed(GuiButton var1) { -- this.field_140048_a.confirmClicked(var1.id == 0, this.field_140044_d); -- } -- -- public void drawScreen(int var1, int var2, float var3) { -+ this.buttonList.add(new GuiSmallButton(0, this.width / 2 - 155, this.height / 6 + 112, this.field_140046_b)); -+ this.buttonList.add(new GuiSmallButton(1, this.width / 2 - 155 + 160, this.height / 6 + 112, this.field_140047_c)); -+ } -+ -+ /** -+ * Fired when a control is clicked. This is the equivalent of ActionListener.actionPerformed(ActionEvent e). -+ */ -+ protected void actionPerformed(GuiButton par1GuiButton) { -+ this.field_140048_a.confirmClicked(par1GuiButton.id == 0, this.field_140044_d); -+ } -+ -+ /** -+ * Draws the screen and all the components in it. -+ */ -+ public void drawScreen(int par1, int par2, float par3) { - this.drawDefaultBackground(); -- this.drawCenteredString(this.fontRenderer, this.field_140045_e.d, this.width / 2, 70, this.field_140045_e.field_140075_c); -- this.drawCenteredString(this.fontRenderer, this.p, this.width / 2, 90, 16777215); -- this.drawCenteredString(this.fontRenderer, this.q, this.width / 2, 110, 16777215); -- super.drawScreen(var1, var2, var3); -+ this.drawCenteredString(this.fontRenderer, this.field_140045_e.field_140072_d, this.width / 2, 70, this.field_140045_e.field_140075_c); -+ this.drawCenteredString(this.fontRenderer, this.field_140049_p, this.width / 2, 90, 16777215); -+ this.drawCenteredString(this.fontRenderer, this.field_96288_n, this.width / 2, 110, 16777215); -+ super.drawScreen(par1, par2, par3); - } - } ---- net/minecraft/src/RenderSilverfish.java -+++ net/minecraft/src/RenderSilverfish.java -@@ -7,43 +7,64 @@ - super(new ModelSilverfish(), 0.3F); - } - -- protected float getSilverfishDeathRotation(EntitySilverfish var1) { -+ /** -+ * Return the silverfish's maximum death rotation. -+ */ -+ protected float getSilverfishDeathRotation(EntitySilverfish par1EntitySilverfish) { - return 180.0F; - } - -- public void renderSilverfish(EntitySilverfish var1, double var2, double var4, double var6, float var8, float var9) { -- super.doRenderLiving(var1, var2, var4, var6, var8, var9); -+ /** -+ * Renders the silverfish. -+ */ -+ public void renderSilverfish(EntitySilverfish par1EntitySilverfish, double par2, double par4, double par6, float par8, float par9) { -+ super.doRenderLiving(par1EntitySilverfish, par2, par4, par6, par8, par9); - } - -- protected ResourceLocation getSilverfishTextures(EntitySilverfish var1) { -+ protected ResourceLocation getSilverfishTextures(EntitySilverfish par1EntitySilverfish) { - return silverfishTextures; - } - -- protected int shouldSilverfishRenderPass(EntitySilverfish var1, int var2, float var3) { -+ /** -+ * Disallows the silverfish to render the renderPassModel. -+ */ -+ protected int shouldSilverfishRenderPass(EntitySilverfish par1EntitySilverfish, int par2, float par3) { - return -1; - } - -- public void doRenderLiving(EntityLiving var1, double var2, double var4, double var6, float var8, float var9) { -- this.renderSilverfish((EntitySilverfish)var1, var2, var4, var6, var8, var9); -- } -- -- protected float getDeathMaxRotation(EntityLivingBase var1) { -- return this.getSilverfishDeathRotation((EntitySilverfish)var1); -- } -- -- protected int shouldRenderPass(EntityLivingBase var1, int var2, float var3) { -- return this.shouldSilverfishRenderPass((EntitySilverfish)var1, var2, var3); -- } -- -- public void renderPlayer(EntityLivingBase var1, double var2, double var4, double var6, float var8, float var9) { -- this.renderSilverfish((EntitySilverfish)var1, var2, var4, var6, var8, var9); -- } -- -- protected ResourceLocation getEntityTexture(Entity var1) { -- return this.getSilverfishTextures((EntitySilverfish)var1); -- } -- -- public void doRender(Entity var1, double var2, double var4, double var6, float var8, float var9) { -- this.renderSilverfish((EntitySilverfish)var1, var2, var4, var6, var8, var9); -+ public void doRenderLiving(EntityLiving par1EntityLiving, double par2, double par4, double par6, float par8, float par9) { -+ this.renderSilverfish((EntitySilverfish)par1EntityLiving, par2, par4, par6, par8, par9); -+ } -+ -+ protected float getDeathMaxRotation(EntityLivingBase par1EntityLivingBase) { -+ return this.getSilverfishDeathRotation((EntitySilverfish)par1EntityLivingBase); -+ } -+ -+ /** -+ * Queries whether should render the specified pass or not. -+ */ -+ protected int shouldRenderPass(EntityLivingBase par1EntityLivingBase, int par2, float par3) { -+ return this.shouldSilverfishRenderPass((EntitySilverfish)par1EntityLivingBase, par2, par3); -+ } -+ -+ public void renderPlayer(EntityLivingBase par1EntityLivingBase, double par2, double par4, double par6, float par8, float par9) { -+ this.renderSilverfish((EntitySilverfish)par1EntityLivingBase, par2, par4, par6, par8, par9); -+ } -+ -+ /** -+ * Returns the location of an entity's texture. Doesn't seem to be called unless you call Render.bindEntityTexture. -+ */ -+ protected ResourceLocation getEntityTexture(Entity par1Entity) { -+ return this.getSilverfishTextures((EntitySilverfish)par1Entity); -+ } -+ -+ /** -+ * Actually renders the given argument. This is a synthetic bridge method, always casting down its argument and then -+ * handing it off to a worker function which does the actual work. In all probabilty, the class Render is generic -+ * (Render 0.0D ? true : (var5 == 1 && this.maxY < 1.0D ? true : (var5 == 2 && this.minZ > 0.0D ? true : (var5 == 3 && this.maxZ < 1.0D ? true : (var5 == 4 && this.minX > 0.0D ? true : (var5 == 5 && this.maxX < 1.0D ? true : !var1.isBlockOpaqueCube(var2, var3, var4)))))); -- } -- -- public boolean isBlockSolid(IBlockAccess var1, int var2, int var3, int var4, int var5) { -- return var1.getBlockMaterial(var2, var3, var4).isSolid(); -- } -- -- public Icon getBlockTexture(IBlockAccess var1, int var2, int var3, int var4, int var5) { -- return this.getIcon(var5, var1.getBlockMetadata(var2, var3, var4)); -- } -- -- public Icon getIcon(int var1, int var2) { -+ /** -+ * Sets the bounds of the block. minX, minY, minZ, maxX, maxY, maxZ -+ */ -+ protected final void setBlockBounds(float par1, float par2, float par3, float par4, float par5, float par6) { -+ this.minX = (double)par1; -+ this.minY = (double)par2; -+ this.minZ = (double)par3; -+ this.maxX = (double)par4; -+ this.maxY = (double)par5; -+ this.maxZ = (double)par6; -+ } -+ -+ /** -+ * How bright to render this block based on the light its receiving. Args: iBlockAccess, x, y, z -+ */ -+ // Spout Start -+ public float getBlockBrightness(IBlockAccess par1IBlockAccess, int x, int y, int z) { -+ if (SpoutClient.getInstance().xrayMode) { -+ return 1000.0F; -+ } else { -+ int light = lightValue[par1IBlockAccess.getBlockId(x, y, z)]; -+ if (customIds != null) { -+ int key = ((x & 0xF) << 12) | ((z & 0xF) << 8) | (y & 256); -+ short customId = customIds[key]; -+ if (customId > 0) { -+ CustomBlock block = MaterialData.getCustomBlock(customId); -+ if (block != null) { -+ light = block.getLightLevel(); -+ } -+ } -+ } -+ return par1IBlockAccess.getBrightness(x, y, z, light); -+ } -+ // Spout End -+ } -+ -+ /** -+ * Goes straight to getLightBrightnessForSkyBlocks for Blocks, does some fancy computing for Fluids -+ */ -+ // Spout Start -+ public int getMixedBrightnessForBlock(IBlockAccess par1IBlockAccess, int x, int y, int z) { -+ if (SpoutClient.getInstance().xrayMode) { -+ return 15728640; -+ } else { -+ int light = lightValue[par1IBlockAccess.getBlockId(x, y, z)]; -+ if (customIds != null) { -+ int key = ((x & 0xF) << 12) | ((z & 0xF) << 8) | (y & 256); -+ short customId = customIds[key]; -+ if (customId > 0) { -+ CustomBlock block = MaterialData.getCustomBlock(customId); -+ if (block != null) { -+ light = block.getLightLevel(); -+ } -+ } -+ } -+ return par1IBlockAccess.getLightBrightnessForSkyBlocks(x, y, z, light); -+ } -+ // Spout End -+ } -+ -+ /** -+ * Returns true if the given side of this block type should be rendered, if the adjacent block is at the given -+ * coordinates. Args: blockAccess, x, y, z, side -+ */ -+ public boolean shouldSideBeRendered(IBlockAccess par1IBlockAccess, int par2, int par3, int par4, int par5) { -+ int[] var6; -+ int var7; -+ -+ if (SpoutClient.getInstance().xrayMode) { -+ var6 = SpoutClient.getInstance().visibleBlocks; -+ for (var7 = 0; var7 < var6.length; ++var7) { -+ if (this.blockID == var6[var7]) { -+ return true; -+ } -+ } -+ return false; -+ } else { -+ return par5 == 0 && this.minY > 0.0D ? true : (par5 == 1 && this.maxY < 1.0D ? true : (par5 == 2 && this.minZ > 0.0D ? true : (par5 == 3 && this.maxZ < 1.0D ? true : (par5 == 4 && this.minX > 0.0D ? true : (par5 == 5 && this.maxX < 1.0D ? true : !par1IBlockAccess.isBlockOpaqueCube(par2, par3, par4)))))); -+ } -+ } -+ -+ /** -+ * Returns Returns true if the given side of this block type should be rendered (if it's solid or not), if the adjacent -+ * block is at the given coordinates. Args: blockAccess, x, y, z, side -+ */ -+ public boolean isBlockSolid(IBlockAccess par1IBlockAccess, int par2, int par3, int par4, int par5) { -+ return par1IBlockAccess.getBlockMaterial(par2, par3, par4).isSolid(); -+ } -+ -+ /** -+ * Retrieves the block texture to use based on the display side. Args: iBlockAccess, x, y, z, side -+ */ -+ public Icon getBlockTexture(IBlockAccess par1IBlockAccess, int par2, int par3, int par4, int par5) { -+ return this.getIcon(par5, par1IBlockAccess.getBlockMetadata(par2, par3, par4)); -+ } -+ -+ /** -+ * From the specified side and block metadata retrieves the blocks texture. Args: side, metadata -+ */ -+ public Icon getIcon(int par1, int par2) { - return this.blockIcon; - } - -- public final Icon getBlockTextureFromSide(int var1) { -- return this.getIcon(var1, 0); -- } -- -- public AxisAlignedBB getSelectedBoundingBoxFromPool(World var1, int var2, int var3, int var4) { -- return AxisAlignedBB.getAABBPool().getAABB((double)var2 + this.minX, (double)var3 + this.minY, (double)var4 + this.minZ, (double)var2 + this.maxX, (double)var3 + this.maxY, (double)var4 + this.maxZ); -- } -- -- public void addCollisionBoxesToList(World var1, int var2, int var3, int var4, AxisAlignedBB var5, List var6, Entity var7) { -- AxisAlignedBB var8 = this.getCollisionBoundingBoxFromPool(var1, var2, var3, var4); -- if(var8 != null && var5.intersectsWith(var8)) { -- var6.add(var8); -+ /** -+ * Returns the block texture based on the side being looked at. Args: side -+ */ -+ public final Icon getBlockTextureFromSide(int par1) { -+ return this.getIcon(par1, 0); -+ } -+ -+ /** -+ * Returns the bounding box of the wired rectangular prism to render. -+ */ -+ public AxisAlignedBB getSelectedBoundingBoxFromPool(World par1World, int par2, int par3, int par4) { -+ return AxisAlignedBB.getAABBPool().getAABB((double)par2 + this.minX, (double)par3 + this.minY, (double)par4 + this.minZ, (double)par2 + this.maxX, (double)par3 + this.maxY, (double)par4 + this.maxZ); -+ } -+ -+ /** -+ * Adds all intersecting collision boxes to a list. (Be sure to only add boxes to the list if they intersect the mask.) -+ * Parameters: World, X, Y, Z, mask, list, colliding entity -+ */ -+ public void addCollisionBoxesToList(World par1World, int par2, int par3, int par4, AxisAlignedBB par5AxisAlignedBB, List par6List, Entity par7Entity) { -+ AxisAlignedBB var8 = this.getCollisionBoundingBoxFromPool(par1World, par2, par3, par4); -+ -+ if (var8 != null && par5AxisAlignedBB.intersectsWith(var8)) { -+ par6List.add(var8); - } -- -- } -- -- public AxisAlignedBB getCollisionBoundingBoxFromPool(World var1, int var2, int var3, int var4) { -- return AxisAlignedBB.getAABBPool().getAABB((double)var2 + this.minX, (double)var3 + this.minY, (double)var4 + this.minZ, (double)var2 + this.maxX, (double)var3 + this.maxY, (double)var4 + this.maxZ); -- } -- -+ } -+ -+ /** -+ * Returns a bounding box from the pool of bounding boxes (this means this box can change after the pool has been -+ * cleared to be reused) -+ */ -+ public AxisAlignedBB getCollisionBoundingBoxFromPool(World par1World, int par2, int par3, int par4) { -+ return AxisAlignedBB.getAABBPool().getAABB((double)par2 + this.minX, (double)par3 + this.minY, (double)par4 + this.minZ, (double)par2 + this.maxX, (double)par3 + this.maxY, (double)par4 + this.maxZ); -+ } -+ -+ /** -+ * Is this block (a) opaque and (b) a full 1m cube? This determines whether or not to render the shared face of two -+ * adjacent blocks and also whether the player can attach torches, redstone wire, etc to this block. -+ */ - public boolean isOpaqueCube() { - return true; - } - -- public boolean canCollideCheck(int var1, boolean var2) { -+ /** -+ * Returns whether this block is collideable based on the arguments passed in \n@param par1 block metaData \n@param -+ * par2 whether the player right-clicked while holding a boat -+ */ -+ public boolean canCollideCheck(int par1, boolean par2) { - return this.isCollidable(); - } - -+ /** -+ * Returns if this block is collidable (only used by Fire). Args: x, y, z -+ */ - public boolean isCollidable() { - return true; - } - -- public void updateTick(World var1, int var2, int var3, int var4, Random var5) { -- } -- -- public void randomDisplayTick(World var1, int var2, int var3, int var4, Random var5) { -- } -- -- public void onBlockDestroyedByPlayer(World var1, int var2, int var3, int var4, int var5) { -- } -- -- public void onNeighborBlockChange(World var1, int var2, int var3, int var4, int var5) { -- } -- -- public int tickRate(World var1) { -+ /** -+ * Ticks the block if it's been scheduled -+ */ -+ public void updateTick(World par1World, int par2, int par3, int par4, Random par5Random) {} -+ -+ /** -+ * A randomly called display update to be able to add particles or other items for display -+ */ -+ public void randomDisplayTick(World par1World, int par2, int par3, int par4, Random par5Random) {} -+ -+ /** -+ * Called right before the block is destroyed by a player. Args: world, x, y, z, metaData -+ */ -+ public void onBlockDestroyedByPlayer(World par1World, int par2, int par3, int par4, int par5) {} -+ -+ /** -+ * Lets the block know when one of its neighbor changes. Doesn't know which neighbor changed (coordinates passed are -+ * their own) Args: x, y, z, neighbor blockID -+ */ -+ public void onNeighborBlockChange(World par1World, int par2, int par3, int par4, int par5) {} -+ -+ /** -+ * How many world ticks before ticking -+ */ -+ public int tickRate(World par1World) { - return 10; - } - -- public void onBlockAdded(World var1, int var2, int var3, int var4) { -- } -- -- public void breakBlock(World var1, int var2, int var3, int var4, int var5, int var6) { -- } -- -- public int quantityDropped(Random var1) { -+ /** -+ * Called whenever the block is added into the world. Args: world, x, y, z -+ */ -+ public void onBlockAdded(World par1World, int par2, int par3, int par4) {} -+ -+ /** -+ * Called on server worlds only when the block has been replaced by a different block ID, or the same block with a -+ * different metadata value, but before the new metadata value is set. Args: World, x, y, z, old block ID, old metadata -+ */ -+ public void breakBlock(World par1World, int par2, int par3, int par4, int par5, int par6) {} -+ -+ /** -+ * Returns the quantity of items to drop on block destruction. -+ */ -+ public int quantityDropped(Random par1Random) { - return 1; - } - -- public int idDropped(int var1, Random var2, int var3) { -+ /** -+ * Returns the ID of the items to drop on destruction. -+ */ -+ public int idDropped(int par1, Random par2Random, int par3) { - return this.blockID; - } - -- public float getPlayerRelativeBlockHardness(EntityPlayer var1, World var2, int var3, int var4, int var5) { -- float var6 = this.getBlockHardness(var2, var3, var4, var5); -- return var6 < 0.0F ? 0.0F : (!var1.canHarvestBlock(this) ? var1.getCurrentPlayerStrVsBlock(this, false) / var6 / 100.0F : var1.getCurrentPlayerStrVsBlock(this, true) / var6 / 30.0F); -- } -- -- public final void dropBlockAsItem(World var1, int var2, int var3, int var4, int var5, int var6) { -- this.dropBlockAsItemWithChance(var1, var2, var3, var4, var5, 1.0F, var6); -- } -- -- public void dropBlockAsItemWithChance(World var1, int var2, int var3, int var4, int var5, float var6, int var7) { -- if(!var1.isRemote) { -- int var8 = this.quantityDroppedWithBonus(var7, var1.s); -- -- for(int var9 = 0; var9 < var8; ++var9) { -- if(var1.s.nextFloat() <= var6) { -- int var10 = this.idDropped(var5, var1.s, var7); -- if(var10 > 0) { -- this.dropBlockAsItem_do(var1, var2, var3, var4, new ItemStack(var10, 1, this.damageDropped(var5))); -- } -- } -- } -- -- } -- } -- -- protected void dropBlockAsItem_do(World var1, int var2, int var3, int var4, ItemStack var5) { -- if(!var1.isRemote && var1.getGameRules().getGameRuleBooleanValue("doTileDrops")) { -+ /** -+ * Gets the hardness of block at the given coordinates in the given world, relative to the ability of the given -+ * EntityPlayer. -+ */ -+ // TODO: This should be combined into one method. -+ public float getPlayerRelativeBlockHardness(EntityPlayer par1EntityPlayer, World par2World, int par3, int par4, int par5) { -+ float var6 = this.getBlockHardness(par2World, par3, par4, par5); -+ return var6 < 0.0F ? 0.0F : (!par1EntityPlayer.canHarvestBlock(this) ? par1EntityPlayer.getCurrentPlayerStrVsBlock(this, false) / var6 / 100.0F : par1EntityPlayer.getCurrentPlayerStrVsBlock(this, true) / var6 / 30.0F); -+ } -+ -+ // Spout Start -+ /** -+ * Gets the hardness of block at the given coordinates in the given world, relative to the ability of the given -+ * EntityPlayer. -+ */ -+ public float getPlayerRelativeBlockHardness(EntityPlayer entityhuman) { -+ if (entityhuman instanceof EntityPlayerSP) { -+ FixedLocation target = Spoutcraft.getActivePlayer().getLastClickedLocation(); -+ if (target != null) { -+ int x = (int) target.getX(); -+ int y = (int) target.getY(); -+ int z = (int) target.getZ(); -+ SpoutcraftChunk chunk = Spoutcraft.getChunkAt(entityhuman.worldObj, x, y, z); -+ short customId = chunk.getCustomBlockId(x, y, z); -+ if (customId > 0) { -+ CustomBlock b = MaterialData.getCustomBlock(customId); -+ if (b == null) { -+ // ToDo: Shouldn't be needed. Something outside of SpoutPlugin changed the Custom Blocks value outside of SpoutPlugin. This is a fall-back return to prevent client returning null and crashing. -+ return (!entityhuman.canHarvestBlock(this) ? entityhuman.getCurrentPlayerStrVsBlock(this, false) / 1.0F / 100.0F : entityhuman.getCurrentPlayerStrVsBlock(this, true) / 1.0F / 30.0F); -+ } -+ return b.getHardness() < 0.0F ? 0.0F : (!entityhuman.canHarvestBlock(this) ? entityhuman.getCurrentPlayerStrVsBlock(this, false) / b.getHardness() / 100.0F : entityhuman.getCurrentPlayerStrVsBlock(this, true) / b.getHardness() / 30.0F); -+ } -+ } -+ } -+ return this.blockHardness < 0.0F ? 0.0F : (!entityhuman.canHarvestBlock(this) ? entityhuman.getCurrentPlayerStrVsBlock(this, false) / this.blockHardness / 100.0F : entityhuman.getCurrentPlayerStrVsBlock(this, true) / this.blockHardness / 30.0F); -+ } -+ // Spout End -+ -+ /** -+ * Drops the specified block items -+ */ -+ public final void dropBlockAsItem(World par1World, int par2, int par3, int par4, int par5, int par6) { -+ this.dropBlockAsItemWithChance(par1World, par2, par3, par4, par5, 1.0F, par6); -+ } -+ -+ /** -+ * Drops the block items with a specified chance of dropping the specified items -+ */ -+ public void dropBlockAsItemWithChance(World par1World, int par2, int par3, int par4, int par5, float par6, int par7) { -+ if (!par1World.isRemote) { -+ int var8 = this.quantityDroppedWithBonus(par7, par1World.rand); -+ -+ for (int var9 = 0; var9 < var8; ++var9) { -+ if (par1World.rand.nextFloat() <= par6) { -+ int var10 = this.idDropped(par5, par1World.rand, par7); -+ -+ if (var10 > 0) { -+ this.dropBlockAsItem_do(par1World, par2, par3, par4, new ItemStack(var10, 1, this.damageDropped(par5))); -+ } -+ } -+ } -+ } -+ } -+ -+ /** -+ * Spawns EntityItem in the world for the given ItemStack if the world is not remote. -+ */ -+ protected void dropBlockAsItem_do(World par1World, int par2, int par3, int par4, ItemStack par5ItemStack) { -+ if (!par1World.isRemote && par1World.getGameRules().getGameRuleBooleanValue("doTileDrops")) { - float var6 = 0.7F; -- double var7 = (double)(var1.s.nextFloat() * var6) + (double)(1.0F - var6) * 0.5D; -- double var9 = (double)(var1.s.nextFloat() * var6) + (double)(1.0F - var6) * 0.5D; -- double var11 = (double)(var1.s.nextFloat() * var6) + (double)(1.0F - var6) * 0.5D; -- EntityItem var13 = new EntityItem(var1, (double)var2 + var7, (double)var3 + var9, (double)var4 + var11, var5); -+ double var7 = (double)(par1World.rand.nextFloat() * var6) + (double)(1.0F - var6) * 0.5D; -+ double var9 = (double)(par1World.rand.nextFloat() * var6) + (double)(1.0F - var6) * 0.5D; -+ double var11 = (double)(par1World.rand.nextFloat() * var6) + (double)(1.0F - var6) * 0.5D; -+ EntityItem var13 = new EntityItem(par1World, (double)par2 + var7, (double)par3 + var9, (double)par4 + var11, par5ItemStack); - var13.delayBeforeCanPickup = 10; -- var1.spawnEntityInWorld(var13); -+ par1World.spawnEntityInWorld(var13); - } - } - -- protected void dropXpOnBlockBreak(World var1, int var2, int var3, int var4, int var5) { -- if(!var1.isRemote) { -- while(var5 > 0) { -- int var6 = EntityXPOrb.getXPSplit(var5); -- var5 -= var6; -- var1.spawnEntityInWorld(new EntityXPOrb(var1, (double)var2 + 0.5D, (double)var3 + 0.5D, (double)var4 + 0.5D, var6)); -+ /** -+ * called by spawner, ore, redstoneOre blocks -+ */ -+ protected void dropXpOnBlockBreak(World par1World, int par2, int par3, int par4, int par5) { -+ if (!par1World.isRemote) { -+ while (par5 > 0) { -+ int var6 = EntityXPOrb.getXPSplit(par5); -+ par5 -= var6; -+ par1World.spawnEntityInWorld(new EntityXPOrb(par1World, (double)par2 + 0.5D, (double)par3 + 0.5D, (double)par4 + 0.5D, var6)); - } - } -- - } - -- public int damageDropped(int var1) { -+ /** -+ * Determines the damage on the item the block drops. Used in cloth and wood. -+ */ -+ public int damageDropped(int par1) { - return 0; - } - -- public float getExplosionResistance(Entity var1) { -+ // Spout Start - getBlockHardness version with removed random params. -+ public float getHardness() { -+ return this.blockHardness; -+ } -+ // Spout End -+ -+ /** -+ * Returns how much this block can resist explosions from the passed in entity. -+ */ -+ public float getExplosionResistance(Entity par1Entity) { - return this.blockResistance / 5.0F; - } - -- public MovingObjectPosition collisionRayTrace(World var1, int var2, int var3, int var4, Vec3 var5, Vec3 var6) { -- this.setBlockBoundsBasedOnState(var1, var2, var3, var4); -- var5 = var5.addVector((double)(-var2), (double)(-var3), (double)(-var4)); -- var6 = var6.addVector((double)(-var2), (double)(-var3), (double)(-var4)); -- Vec3 var7 = var5.getIntermediateWithXValue(var6, this.minX); -- Vec3 var8 = var5.getIntermediateWithXValue(var6, this.maxX); -- Vec3 var9 = var5.getIntermediateWithYValue(var6, this.minY); -- Vec3 var10 = var5.getIntermediateWithYValue(var6, this.maxY); -- Vec3 var11 = var5.getIntermediateWithZValue(var6, this.minZ); -- Vec3 var12 = var5.getIntermediateWithZValue(var6, this.maxZ); -- if(!this.isVecInsideYZBounds(var7)) { -+ /** -+ * Ray traces through the blocks collision from start vector to end vector returning a ray trace hit. Args: world, x, -+ * y, z, startVec, endVec -+ */ -+ public MovingObjectPosition collisionRayTrace(World par1World, int par2, int par3, int par4, Vec3 par5Vec3, Vec3 par6Vec3) { -+ this.setBlockBoundsBasedOnState(par1World, par2, par3, par4); -+ par5Vec3 = par5Vec3.addVector((double)(-par2), (double)(-par3), (double)(-par4)); -+ par6Vec3 = par6Vec3.addVector((double)(-par2), (double)(-par3), (double)(-par4)); -+ Vec3 var7 = par5Vec3.getIntermediateWithXValue(par6Vec3, this.minX); -+ Vec3 var8 = par5Vec3.getIntermediateWithXValue(par6Vec3, this.maxX); -+ Vec3 var9 = par5Vec3.getIntermediateWithYValue(par6Vec3, this.minY); -+ Vec3 var10 = par5Vec3.getIntermediateWithYValue(par6Vec3, this.maxY); -+ Vec3 var11 = par5Vec3.getIntermediateWithZValue(par6Vec3, this.minZ); -+ Vec3 var12 = par5Vec3.getIntermediateWithZValue(par6Vec3, this.maxZ); -+ -+ if (!this.isVecInsideYZBounds(var7)) { - var7 = null; - } - -- if(!this.isVecInsideYZBounds(var8)) { -+ if (!this.isVecInsideYZBounds(var8)) { - var8 = null; - } - -- if(!this.isVecInsideXZBounds(var9)) { -+ if (!this.isVecInsideXZBounds(var9)) { - var9 = null; - } - -- if(!this.isVecInsideXZBounds(var10)) { -+ if (!this.isVecInsideXZBounds(var10)) { - var10 = null; - } - -- if(!this.isVecInsideXYBounds(var11)) { -+ if (!this.isVecInsideXYBounds(var11)) { - var11 = null; - } - -- if(!this.isVecInsideXYBounds(var12)) { -+ if (!this.isVecInsideXYBounds(var12)) { - var12 = null; - } - - Vec3 var13 = null; -- if(var7 != null && (var13 == null || var5.squareDistanceTo(var7) < var5.squareDistanceTo(var13))) { -+ -+ if (var7 != null && (var13 == null || par5Vec3.squareDistanceTo(var7) < par5Vec3.squareDistanceTo(var13))) { - var13 = var7; - } - -- if(var8 != null && (var13 == null || var5.squareDistanceTo(var8) < var5.squareDistanceTo(var13))) { -+ if (var8 != null && (var13 == null || par5Vec3.squareDistanceTo(var8) < par5Vec3.squareDistanceTo(var13))) { - var13 = var8; - } - -- if(var9 != null && (var13 == null || var5.squareDistanceTo(var9) < var5.squareDistanceTo(var13))) { -+ if (var9 != null && (var13 == null || par5Vec3.squareDistanceTo(var9) < par5Vec3.squareDistanceTo(var13))) { - var13 = var9; - } - -- if(var10 != null && (var13 == null || var5.squareDistanceTo(var10) < var5.squareDistanceTo(var13))) { -+ if (var10 != null && (var13 == null || par5Vec3.squareDistanceTo(var10) < par5Vec3.squareDistanceTo(var13))) { - var13 = var10; - } - -- if(var11 != null && (var13 == null || var5.squareDistanceTo(var11) < var5.squareDistanceTo(var13))) { -+ if (var11 != null && (var13 == null || par5Vec3.squareDistanceTo(var11) < par5Vec3.squareDistanceTo(var13))) { - var13 = var11; - } - -- if(var12 != null && (var13 == null || var5.squareDistanceTo(var12) < var5.squareDistanceTo(var13))) { -+ if (var12 != null && (var13 == null || par5Vec3.squareDistanceTo(var12) < par5Vec3.squareDistanceTo(var13))) { - var13 = var12; - } - -- if(var13 == null) { -+ if (var13 == null) { - return null; - } else { - byte var14 = -1; -- if(var13 == var7) { -+ -+ if (var13 == var7) { - var14 = 4; - } - -- if(var13 == var8) { -+ if (var13 == var8) { - var14 = 5; - } - -- if(var13 == var9) { -+ if (var13 == var9) { - var14 = 0; - } - -- if(var13 == var10) { -+ if (var13 == var10) { - var14 = 1; - } - -- if(var13 == var11) { -+ if (var13 == var11) { - var14 = 2; - } - -- if(var13 == var12) { -+ if (var13 == var12) { - var14 = 3; - } - -- return new MovingObjectPosition(var2, var3, var4, var14, var13.addVector((double)var2, (double)var3, (double)var4)); -+ return new MovingObjectPosition(par2, par3, par4, var14, var13.addVector((double)par2, (double)par3, (double)par4)); - } - } - -- private boolean isVecInsideYZBounds(Vec3 var1) { -- return var1 == null ? false : var1.yCoord >= this.minY && var1.yCoord <= this.maxY && var1.zCoord >= this.minZ && var1.zCoord <= this.maxZ; -- } -- -- private boolean isVecInsideXZBounds(Vec3 var1) { -- return var1 == null ? false : var1.xCoord >= this.minX && var1.xCoord <= this.maxX && var1.zCoord >= this.minZ && var1.zCoord <= this.maxZ; -- } -- -- private boolean isVecInsideXYBounds(Vec3 var1) { -- return var1 == null ? false : var1.xCoord >= this.minX && var1.xCoord <= this.maxX && var1.yCoord >= this.minY && var1.yCoord <= this.maxY; -- } -- -- public void onBlockDestroyedByExplosion(World var1, int var2, int var3, int var4, Explosion var5) { -- } -- -+ /** -+ * Checks if a vector is within the Y and Z bounds of the block. -+ */ -+ private boolean isVecInsideYZBounds(Vec3 par1Vec3) { -+ return par1Vec3 == null ? false : par1Vec3.yCoord >= this.minY && par1Vec3.yCoord <= this.maxY && par1Vec3.zCoord >= this.minZ && par1Vec3.zCoord <= this.maxZ; -+ } -+ -+ /** -+ * Checks if a vector is within the X and Z bounds of the block. -+ */ -+ private boolean isVecInsideXZBounds(Vec3 par1Vec3) { -+ return par1Vec3 == null ? false : par1Vec3.xCoord >= this.minX && par1Vec3.xCoord <= this.maxX && par1Vec3.zCoord >= this.minZ && par1Vec3.zCoord <= this.maxZ; -+ } -+ -+ /** -+ * Checks if a vector is within the X and Y bounds of the block. -+ */ -+ private boolean isVecInsideXYBounds(Vec3 par1Vec3) { -+ return par1Vec3 == null ? false : par1Vec3.xCoord >= this.minX && par1Vec3.xCoord <= this.maxX && par1Vec3.yCoord >= this.minY && par1Vec3.yCoord <= this.maxY; -+ } -+ -+ /** -+ * Called upon the block being destroyed by an explosion -+ */ -+ public void onBlockDestroyedByExplosion(World par1World, int par2, int par3, int par4, Explosion par5Explosion) {} -+ -+ /** -+ * Returns which pass should this block be rendered on. 0 for solids and 1 for alpha -+ */ - public int getRenderBlockPass() { - return 0; - } - -- public boolean canPlaceBlockOnSide(World var1, int var2, int var3, int var4, int var5, ItemStack var6) { -- return this.canPlaceBlockOnSide(var1, var2, var3, var4, var5); -- } -- -- public boolean canPlaceBlockOnSide(World var1, int var2, int var3, int var4, int var5) { -- return this.canPlaceBlockAt(var1, var2, var3, var4); -- } -- -- public boolean canPlaceBlockAt(World var1, int var2, int var3, int var4) { -- int var5 = var1.getBlockId(var2, var3, var4); -+ public boolean canPlaceBlockOnSide(World par1World, int par2, int par3, int par4, int par5, ItemStack par6ItemStack) { -+ return this.canPlaceBlockOnSide(par1World, par2, par3, par4, par5); -+ } -+ -+ /** -+ * checks to see if you can place this block can be placed on that side of a block: BlockLever overrides -+ */ -+ public boolean canPlaceBlockOnSide(World par1World, int par2, int par3, int par4, int par5) { -+ return this.canPlaceBlockAt(par1World, par2, par3, par4); -+ } -+ -+ /** -+ * Checks to see if its valid to put this block at the specified coordinates. Args: world, x, y, z -+ */ -+ public boolean canPlaceBlockAt(World par1World, int par2, int par3, int par4) { -+ int var5 = par1World.getBlockId(par2, par3, par4); - return var5 == 0 || blocksList[var5].blockMaterial.isReplaceable(); - } - -- public boolean onBlockActivated(World var1, int var2, int var3, int var4, EntityPlayer var5, int var6, float var7, float var8, float var9) { -+ /** -+ * Called upon block activation (right click on the block.) -+ */ -+ public boolean onBlockActivated(World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer, int par6, float par7, float par8, float par9) { - return false; - } - -- public void onEntityWalking(World var1, int var2, int var3, int var4, Entity var5) { -- } -- -- public int onBlockPlaced(World var1, int var2, int var3, int var4, int var5, float var6, float var7, float var8, int var9) { -- return var9; -- } -- -+ /** -+ * Called whenever an entity is walking on top of this block. Args: world, x, y, z, entity -+ */ -+ public void onEntityWalking(World par1World, int par2, int par3, int par4, Entity par5Entity) {} -+ -+ /** -+ * Called when a block is placed using its ItemBlock. Args: World, X, Y, Z, side, hitX, hitY, hitZ, block metadata -+ */ -+ public int onBlockPlaced(World par1World, int par2, int par3, int par4, int par5, float par6, float par7, float par8, int par9) { -+ return par9; -+ } -+ -+ /** -+ * Called when the block is clicked by a player. Args: x, y, z, entityPlayer -+ */ -+ // Spout Start - public void onBlockClicked(World var1, int var2, int var3, int var4, EntityPlayer var5) { -- } -- -- public void velocityToAddToEntity(World var1, int var2, int var3, int var4, Entity var5, Vec3 var6) { -- } -- -- public void setBlockBoundsBasedOnState(IBlockAccess var1, int var2, int var3, int var4) { -- } -- -- public final double getMinX() { -+ if (var5 instanceof EntityPlayerSP) { -+ FixedLocation location = new FastLocation(var2, var3, var4, 0, 0); -+ ((EntityPlayerSP)var5).lastClickLocation = location; -+ } -+ } -+ // Spout End -+ -+ /** -+ * Can add to the passed in vector for a movement vector to be applied to the entity. Args: x, y, z, entity, vec3d -+ */ -+ public void velocityToAddToEntity(World par1World, int par2, int par3, int par4, Entity par5Entity, Vec3 par6Vec3) {} -+ -+ /** -+ * Updates the blocks bounds based on its current state. Args: world, x, y, z -+ */ -+ public void setBlockBoundsBasedOnState(IBlockAccess par1IBlockAccess, int par2, int par3, int par4) {} -+ -+ /** -+ * returns the block bounderies minX value -+ */ -+ public final double getBlockBoundsMinX() { - return this.minX; - } - -+ /** -+ * returns the block bounderies maxX value -+ */ - public final double getBlockBoundsMaxX() { - return this.maxX; - } - -+ /** -+ * returns the block bounderies minY value -+ */ - public final double getBlockBoundsMinY() { - return this.minY; - } - -+ /** -+ * returns the block bounderies maxY value -+ */ - public final double getBlockBoundsMaxY() { - return this.maxY; - } - -+ /** -+ * returns the block bounderies minZ value -+ */ - public final double getBlockBoundsMinZ() { - return this.minZ; - } - -+ /** -+ * returns the block bounderies maxZ value -+ */ - public final double getBlockBoundsMaxZ() { - return this.maxZ; - } -@@ -614,141 +994,241 @@ - return 16777215; - } - -- public int getRenderColor(int var1) { -- return 16777215; -- } -- -- public int colorMultiplier(IBlockAccess var1, int var2, int var3, int var4) { -- return 16777215; -- } -- -- public int isProvidingWeakPower(IBlockAccess var1, int var2, int var3, int var4, int var5) { -+ /** -+ * Returns the color this block should be rendered. Used by leaves. -+ */ -+ public int getRenderColor(int par1) { -+ // MCPatcher Start -+ return ColorizeBlock.colorizeBlock(this); -+ // MCPatcher End -+ } -+ -+ /** -+ * Returns a integer with hex for 0xrrggbb with this color multiplied against the blocks color. Note only called when -+ * first determining what to render. -+ */ -+ public int colorMultiplier(IBlockAccess par1IBlockAccess, int par2, int par3, int par4) { -+ // MCPatcher Start -+ return ColorizeBlock.colorizeBlock(this, par2, par3, par4, par1IBlockAccess.getBlockMetadata(par2, par3, par4)); -+ // MCPatcher End -+ } -+ -+ /** -+ * Returns true if the block is emitting indirect/weak redstone power on the specified side. If isBlockNormalCube -+ * returns true, standard redstone propagation rules will apply instead and this will not be called. Args: World, X, Y, -+ * Z, side. Note that the side is reversed - eg it is 1 (up) when checking the bottom of the block. -+ */ -+ public int isProvidingWeakPower(IBlockAccess par1IBlockAccess, int par2, int par3, int par4, int par5) { - return 0; - } - -+ /** -+ * Can this block provide power. Only wire currently seems to have this change based on its state. -+ */ - public boolean canProvidePower() { - return false; - } - -- public void onEntityCollidedWithBlock(World var1, int var2, int var3, int var4, Entity var5) { -- } -+ /** -+ * Triggered whenever an entity collides with this block (enters into the block). Args: world, x, y, z, entity -+ */ -+ public void onEntityCollidedWithBlock(World par1World, int par2, int par3, int par4, Entity par5Entity) {} - -- public int isProvidingStrongPower(IBlockAccess var1, int var2, int var3, int var4, int var5) { -+ /** -+ * Returns true if the block is emitting direct/strong redstone power on the specified side. Args: World, X, Y, Z, -+ * side. Note that the side is reversed - eg it is 1 (up) when checking the bottom of the block. -+ */ -+ public int isProvidingStrongPower(IBlockAccess par1IBlockAccess, int par2, int par3, int par4, int par5) { - return 0; - } - -- public void setBlockBoundsForItemRender() { -- } -- -- public void harvestBlock(World var1, EntityPlayer var2, int var3, int var4, int var5, int var6) { -- var2.addStat(StatList.mineBlockStatArray[this.blockID], 1); -- var2.addExhaustion(0.025F); -- if(this.canSilkHarvest() && EnchantmentHelper.getSilkTouchModifier(var2)) { -- ItemStack var8 = this.createStackedBlock(var6); -- if(var8 != null) { -- this.dropBlockAsItem_do(var1, var3, var4, var5, var8); -+ /** -+ * Sets the block's bounds for rendering it as an item -+ */ -+ public void setBlockBoundsForItemRender() {} -+ -+ /** -+ * Called when the player destroys a block with an item that can harvest it. (i, j, k) are the coordinates of the block -+ * and l is the block's subtype/damage. -+ */ -+ public void harvestBlock(World par1World, EntityPlayer par2EntityPlayer, int par3, int par4, int par5, int par6) { -+ par2EntityPlayer.addStat(StatList.mineBlockStatArray[this.blockID], 1); -+ par2EntityPlayer.addExhaustion(0.025F); -+ -+ if (this.canSilkHarvest() && EnchantmentHelper.getSilkTouchModifier(par2EntityPlayer)) { -+ ItemStack var8 = this.createStackedBlock(par6); -+ -+ if (var8 != null) { -+ this.dropBlockAsItem_do(par1World, par3, par4, par5, var8); - } - } else { -- int var7 = EnchantmentHelper.getFortuneModifier(var2); -- this.dropBlockAsItem(var1, var3, var4, var5, var6, var7); -+ int var7 = EnchantmentHelper.getFortuneModifier(par2EntityPlayer); -+ this.dropBlockAsItem(par1World, par3, par4, par5, par6, var7); - } -- - } - -+ /** -+ * Return true if a player with Silk Touch can harvest this block directly, and not its normal drops. -+ */ - protected boolean canSilkHarvest() { - return this.renderAsNormalBlock() && !this.isBlockContainer; - } - -- protected ItemStack createStackedBlock(int var1) { -+ /** -+ * Returns an item stack containing a single instance of the current block type. 'i' is the block's subtype/damage and -+ * is ignored for blocks which do not support subtypes. Blocks which cannot be harvested should return null. -+ */ -+ protected ItemStack createStackedBlock(int par1) { - int var2 = 0; -- if(this.blockID >= 0 && this.blockID < Item.itemsList.length && Item.itemsList[this.blockID].getHasSubtypes()) { -- var2 = var1; -+ -+ if (this.blockID >= 0 && this.blockID < Item.itemsList.length && Item.itemsList[this.blockID].getHasSubtypes()) { -+ var2 = par1; - } - - return new ItemStack(this.blockID, 1, var2); - } - -- public int quantityDroppedWithBonus(int var1, Random var2) { -- return this.quantityDropped(var2); -+ /** -+ * Returns the usual quantity dropped by the block plus a bonus of 1 to 'i' (inclusive). -+ */ -+ public int quantityDroppedWithBonus(int par1, Random par2Random) { -+ return this.quantityDropped(par2Random); - } - -- public boolean canBlockStay(World var1, int var2, int var3, int var4) { -+ /** -+ * Can this block stay at this position. Similar to canPlaceBlockAt except gets checked often with plants. -+ */ -+ public boolean canBlockStay(World par1World, int par2, int par3, int par4) { - return true; - } - -- public void onBlockPlacedBy(World var1, int var2, int var3, int var4, EntityLivingBase var5, ItemStack var6) { -- } -- -- public void onPostBlockPlaced(World var1, int var2, int var3, int var4, int var5) { -- } -- -- public Block setUnlocalizedName(String var1) { -- this.b = var1; -+ /** -+ * Called when the block is placed in the world. -+ */ -+ public void onBlockPlacedBy(World par1World, int par2, int par3, int par4, EntityLivingBase par5EntityLivingBase, ItemStack par6ItemStack) {} -+ -+ /** -+ * Called after a block is placed -+ */ -+ public void onPostBlockPlaced(World par1World, int par2, int par3, int par4, int par5) {} -+ -+ public Block setUnlocalizedName(String par1Str) { -+ this.unlocalizedName = par1Str; - return this; - } - -+ /** -+ * Gets the localized name of this block. Used for the statistics page. -+ */ - public String getLocalizedName() { - return StatCollector.translateToLocal(this.getUnlocalizedName() + ".name"); - } - -+ /** -+ * Returns the unlocalized name of this block. -+ */ - public String getUnlocalizedName() { -- return "tile." + this.b; -+ return "tile." + this.unlocalizedName; - } -- -- public boolean onBlockEventReceived(World var1, int var2, int var3, int var4, int var5, int var6) { -+ -+ /** -+ * Called when the block receives a BlockEvent - see World.addBlockEvent. By default, passes it on to the tile entity -+ * at this location. Args: world, x, y, z, blockID, EventID, event parameter -+ */ -+ public boolean onBlockEventReceived(World par1World, int par2, int par3, int par4, int par5, int par6) { - return false; - } - -+ /** -+ * Return the state of blocks statistics flags - if the block is counted for mined and placed. -+ */ - public boolean getEnableStats() { - return this.enableStats; - } - -+ /** -+ * Disable statistics for the block, the block will no count for mined or placed. -+ */ - protected Block disableStats() { - this.enableStats = false; - return this; - } - -+ /** -+ * Returns the mobility information of the block, 0 = free, 1 = can't push but can move over, 2 = total immobility and -+ * stop pistons -+ */ - public int getMobilityFlag() { - return this.blockMaterial.getMaterialMobility(); - } - -- public float getAmbientOcclusionLightValue(IBlockAccess var1, int var2, int var3, int var4) { -- return var1.isBlockNormalCube(var2, var3, var4) ? 0.2F : 1.0F; -- } -- -- public void onFallenUpon(World var1, int var2, int var3, int var4, Entity var5, float var6) { -- } -- -- public int idPicked(World var1, int var2, int var3, int var4) { -+ /** -+ * Returns the default ambient occlusion value based on block opacity -+ */ -+ public float getAmbientOcclusionLightValue(IBlockAccess par1IBlockAccess, int par2, int par3, int par4) { -+ return par1IBlockAccess.isBlockNormalCube(par2, par3, par4) ? 0.2F : 1.0F; -+ } -+ -+ /** -+ * Block's chance to react to an entity falling on it. -+ */ -+ public void onFallenUpon(World par1World, int par2, int par3, int par4, Entity par5Entity, float par6) {} -+ -+ /** -+ * only called by clickMiddleMouseButton , and passed to inventory.setCurrentItem (along with isCreative) -+ */ -+ public int idPicked(World par1World, int par2, int par3, int par4) { - return this.blockID; - } - -- public int getDamageValue(World var1, int var2, int var3, int var4) { -- return this.damageDropped(var1.getBlockMetadata(var2, var3, var4)); -- } -- -- public void getSubBlocks(int var1, CreativeTabs var2, List var3) { -- var3.add(new ItemStack(var1, 1, 0)); -- } -- -+ /** -+ * Get the block's damage value (for use with pick block). -+ */ -+ public int getDamageValue(World par1World, int par2, int par3, int par4) { -+ return this.damageDropped(par1World.getBlockMetadata(par2, par3, par4)); -+ } -+ -+ /** -+ * returns a list of blocks with the same ID, but different meta (eg: wood returns 4 blocks) -+ */ -+ public void getSubBlocks(int par1, CreativeTabs par2CreativeTabs, List par3List) { -+ par3List.add(new ItemStack(par1, 1, 0)); -+ } -+ -+ /** -+ * Returns the CreativeTab to display the given block on. -+ */ - public CreativeTabs getCreativeTabToDisplayOn() { - return this.displayOnCreativeTab; - } - -- public Block setCreativeTab(CreativeTabs var1) { -- this.displayOnCreativeTab = var1; -+ /** -+ * Sets the CreativeTab to display this block on. -+ */ -+ public Block setCreativeTab(CreativeTabs par1CreativeTabs) { -+ this.displayOnCreativeTab = par1CreativeTabs; - return this; - } - -- public void onBlockHarvested(World var1, int var2, int var3, int var4, int var5, EntityPlayer var6) { -- } -- -- public void onBlockPreDestroy(World var1, int var2, int var3, int var4, int var5) { -- } -- -- public void fillWithRain(World var1, int var2, int var3, int var4) { -- } -- -+ /** -+ * Called when the block is attempted to be harvested -+ */ -+ public void onBlockHarvested(World par1World, int par2, int par3, int par4, int par5, EntityPlayer par6EntityPlayer) {} -+ -+ /** -+ * Called on server worlds only when the block is about to be replaced by a different block or the same block with a -+ * different metadata value. Args: world, x, y, z, old metadata -+ */ -+ public void onBlockPreDestroy(World par1World, int par2, int par3, int par4, int par5) {} -+ -+ /** -+ * currently only used by BlockCauldron to incrament meta-data during rain -+ */ -+ public void fillWithRain(World par1World, int par2, int par3, int par4) {} -+ -+ /** -+ * Returns true only if block is flowerPot -+ */ - public boolean isFlowerPot() { - return false; - } -@@ -757,39 +1237,64 @@ - return true; - } - -- public boolean canDropFromExplosion(Explosion var1) { -+ /** -+ * Return whether this block can drop from an explosion. -+ */ -+ public boolean canDropFromExplosion(Explosion par1Explosion) { - return true; - } - -- public boolean isAssociatedBlockID(int var1) { -- return this.blockID == var1; -- } -- -- public static boolean isAssociatedBlockID(int var0, int var1) { -- return var0 == var1 ? true : (var0 != 0 && var1 != 0 && blocksList[var0] != null && blocksList[var1] != null ? blocksList[var0].isAssociatedBlockID(var1) : false); -- } -- -+ /** -+ * Returns true if the given block ID is equivalent to this one. Example: redstoneTorchOn matches itself and -+ * redstoneTorchOff, and vice versa. Most blocks only match themselves. -+ */ -+ public boolean isAssociatedBlockID(int par1) { -+ return this.blockID == par1; -+ } -+ -+ /** -+ * Static version of isAssociatedBlockID. -+ */ -+ public static boolean isAssociatedBlockID(int par0, int par1) { -+ return par0 == par1 ? true : (par0 != 0 && par1 != 0 && blocksList[par0] != null && blocksList[par1] != null ? blocksList[par0].isAssociatedBlockID(par1) : false); -+ } -+ -+ /** -+ * If this returns true, then comparators facing away from this block will use the value from -+ * getComparatorInputOverride instead of the actual redstone signal strength. -+ */ - public boolean hasComparatorInputOverride() { - return false; -- } -+ } - -- public int getComparatorInputOverride(World var1, int var2, int var3, int var4, int var5) { -+ /** -+ * If hasComparatorInputOverride returns true, the return value from this is used instead of the redstone signal -+ * strength when this block inputs to a comparator. -+ */ -+ public int getComparatorInputOverride(World par1World, int par2, int par3, int par4, int par5) { - return 0; -- } -+ } - -- protected Block setTextureName(String var1) { -- this.f = var1; -+ protected Block setTextureName(String par1Str) { -+ this.textureName = par1Str; - return this; - } - - protected String getTextureName() { -- return this.f == null ? "MISSING_ICON_TILE_" + this.blockID + "_" + this.b : this.f; -- } -- -- public void registerIcons(IconRegister var1) { -- this.blockIcon = var1.registerIcon(this.getTextureName()); -- } -- -+ return this.textureName == null ? "MISSING_ICON_TILE_" + this.blockID + "_" + this.unlocalizedName : this.textureName; -+ } -+ -+ /** -+ * When this method is called, your block should register all the icons it needs with the given IconRegister. This is -+ * the only chance you get to register icons. -+ */ -+ public void registerIcons(IconRegister par1IconRegister) { -+ this.blockIcon = par1IconRegister.registerIcon(this.getTextureName()); -+ } -+ -+ /** -+ * Gets the icon name of the ItemBlock corresponding to this block. Used by hoppers. -+ */ - public String getItemIconName() { - return null; - } -@@ -798,52 +1303,53 @@ - Item.itemsList[cloth.blockID] = (new ItemCloth(cloth.blockID - 256)).setUnlocalizedName("cloth"); - Item.itemsList[stainedClay.blockID] = (new ItemCloth(stainedClay.blockID - 256)).setUnlocalizedName("clayHardenedStained"); - Item.itemsList[carpet.blockID] = (new ItemCloth(carpet.blockID - 256)).setUnlocalizedName("woolCarpet"); -- Item.itemsList[wood.blockID] = (new ItemMultiTextureTile(wood.blockID - 256, wood, BlockLog.b)).setUnlocalizedName("log"); -- Item.itemsList[planks.blockID] = (new ItemMultiTextureTile(planks.blockID - 256, planks, BlockWood.a)).setUnlocalizedName("wood"); -- Item.itemsList[silverfish.blockID] = (new ItemMultiTextureTile(silverfish.blockID - 256, silverfish, BlockSilverfish.a)).setUnlocalizedName("monsterStoneEgg"); -- Item.itemsList[stoneBrick.blockID] = (new ItemMultiTextureTile(stoneBrick.blockID - 256, stoneBrick, BlockStoneBrick.a)).setUnlocalizedName("stonebricksmooth"); -- Item.itemsList[sandStone.blockID] = (new ItemMultiTextureTile(sandStone.blockID - 256, sandStone, BlockSandStone.a)).setUnlocalizedName("sandStone"); -- Item.itemsList[blockNetherQuartz.blockID] = (new ItemMultiTextureTile(blockNetherQuartz.blockID - 256, blockNetherQuartz, BlockQuartz.a)).setUnlocalizedName("quartzBlock"); -+ Item.itemsList[wood.blockID] = (new ItemMultiTextureTile(wood.blockID - 256, wood, BlockLog.woodType)).setUnlocalizedName("log"); -+ Item.itemsList[planks.blockID] = (new ItemMultiTextureTile(planks.blockID - 256, planks, BlockWood.woodType)).setUnlocalizedName("wood"); -+ Item.itemsList[silverfish.blockID] = (new ItemMultiTextureTile(silverfish.blockID - 256, silverfish, BlockSilverfish.silverfishStoneTypes)).setUnlocalizedName("monsterStoneEgg"); -+ Item.itemsList[stoneBrick.blockID] = (new ItemMultiTextureTile(stoneBrick.blockID - 256, stoneBrick, BlockStoneBrick.STONE_BRICK_TYPES)).setUnlocalizedName("stonebricksmooth"); -+ Item.itemsList[sandStone.blockID] = (new ItemMultiTextureTile(sandStone.blockID - 256, sandStone, BlockSandStone.SAND_STONE_TYPES)).setUnlocalizedName("sandStone"); -+ Item.itemsList[blockNetherQuartz.blockID] = (new ItemMultiTextureTile(blockNetherQuartz.blockID - 256, blockNetherQuartz, BlockQuartz.quartzBlockTypes)).setUnlocalizedName("quartzBlock"); - Item.itemsList[stoneSingleSlab.blockID] = (new ItemSlab(stoneSingleSlab.blockID - 256, stoneSingleSlab, stoneDoubleSlab, false)).setUnlocalizedName("stoneSlab"); - Item.itemsList[stoneDoubleSlab.blockID] = (new ItemSlab(stoneDoubleSlab.blockID - 256, stoneSingleSlab, stoneDoubleSlab, true)).setUnlocalizedName("stoneSlab"); - Item.itemsList[woodSingleSlab.blockID] = (new ItemSlab(woodSingleSlab.blockID - 256, woodSingleSlab, woodDoubleSlab, false)).setUnlocalizedName("woodSlab"); - Item.itemsList[woodDoubleSlab.blockID] = (new ItemSlab(woodDoubleSlab.blockID - 256, woodSingleSlab, woodDoubleSlab, true)).setUnlocalizedName("woodSlab"); -- Item.itemsList[sapling.blockID] = (new ItemMultiTextureTile(sapling.blockID - 256, sapling, BlockSapling.a)).setUnlocalizedName("sapling"); -+ Item.itemsList[sapling.blockID] = (new ItemMultiTextureTile(sapling.blockID - 256, sapling, BlockSapling.WOOD_TYPES)).setUnlocalizedName("sapling"); - Item.itemsList[leaves.blockID] = (new ItemLeaves(leaves.blockID - 256)).setUnlocalizedName("leaves"); - Item.itemsList[vine.blockID] = new ItemColored(vine.blockID - 256, false); -- Item.itemsList[tallGrass.blockID] = (new ItemColored(tallGrass.blockID - 256, true)).setBlockNames(new String[]{"shrub", "grass", "fern"}); -+ Item.itemsList[tallGrass.blockID] = (new ItemColored(tallGrass.blockID - 256, true)).setBlockNames(new String[] {"shrub", "grass", "fern"}); - Item.itemsList[snow.blockID] = new ItemSnow(snow.blockID - 256, snow); - Item.itemsList[waterlily.blockID] = new ItemLilyPad(waterlily.blockID - 256); - Item.itemsList[pistonBase.blockID] = new ItemPiston(pistonBase.blockID - 256); - Item.itemsList[pistonStickyBase.blockID] = new ItemPiston(pistonStickyBase.blockID - 256); -- Item.itemsList[cobblestoneWall.blockID] = (new ItemMultiTextureTile(cobblestoneWall.blockID - 256, cobblestoneWall, BlockWall.a)).setUnlocalizedName("cobbleWall"); -+ Item.itemsList[cobblestoneWall.blockID] = (new ItemMultiTextureTile(cobblestoneWall.blockID - 256, cobblestoneWall, BlockWall.types)).setUnlocalizedName("cobbleWall"); - Item.itemsList[anvil.blockID] = (new ItemAnvilBlock(anvil)).setUnlocalizedName("anvil"); - -- for(int var0 = 0; var0 < 256; ++var0) { -- if(blocksList[var0] != null) { -- if(Item.itemsList[var0] == null) { -+ for (int var0 = 0; var0 < 256; ++var0) { -+ if (blocksList[var0] != null) { -+ if (Item.itemsList[var0] == null) { - Item.itemsList[var0] = new ItemBlock(var0 - 256); - blocksList[var0].initializeBlock(); - } - - boolean var1 = false; -- if(var0 > 0 && blocksList[var0].getRenderType() == 10) { -- var1 = true; -- } -- -- if(var0 > 0 && blocksList[var0] instanceof BlockHalfSlab) { -- var1 = true; -- } -- -- if(var0 == tilledField.blockID) { -- var1 = true; -- } -- -- if(canBlockGrass[var0]) { -- var1 = true; -- } -- -- if(lightOpacity[var0] == 0) { -+ -+ if (var0 > 0 && blocksList[var0].getRenderType() == 10) { -+ var1 = true; -+ } -+ -+ if (var0 > 0 && blocksList[var0] instanceof BlockHalfSlab) { -+ var1 = true; -+ } -+ -+ if (var0 == tilledField.blockID) { -+ var1 = true; -+ } -+ -+ if (canBlockGrass[var0]) { -+ var1 = true; -+ } -+ -+ if (lightOpacity[var0] == 0) { - var1 = true; - } - ---- /dev/null -+++ org/spoutcraft/api/Note.java -@@ -1,0 +1,219 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.api; -+ -+import java.util.HashMap; -+import java.util.Map; -+ -+/** -+ * A note class to store a specific note. -+ */ -+public class Note { -+ /** -+ * An enum holding tones. -+ */ -+ public enum Tone { -+ F((byte) -0x1, true), -+ G((byte) 0x1, true), -+ A((byte) 0x3, true), -+ B((byte) 0x5, false), -+ C((byte) 0x6, true), -+ D((byte) 0x8, true), -+ E((byte) 0xA, false); -+ -+ private final boolean sharpable; -+ private final byte id; -+ private static final Map tones = new HashMap(); -+ /** The number of tones including sharped tones. */ -+ public static final byte TONES_COUNT; -+ -+ private Tone(byte id, boolean sharpable) { -+ this.id = id; -+ this.sharpable = sharpable; -+ } -+ -+ /** -+ * Returns the not sharped id of this tone. -+ * -+ * @return the not sharped id of this tone. -+ */ -+ public byte getId() { -+ return getId(false); -+ } -+ -+ /** -+ * Returns the id of this tone. These method allows to return the -+ * sharped id of the tone. If the tone couldn't be sharped it always -+ * return the not sharped id of this tone. -+ * -+ * @param sharped -+ * Set to true to return the sharped id. -+ * @return the id of this tone. -+ */ -+ public byte getId(boolean sharped) { -+ byte tempId = (byte) (sharped && sharpable ? id + 1 : id); -+ -+ while (tempId < 0) { -+ tempId += TONES_COUNT; -+ } -+ return (byte) (tempId % TONES_COUNT); -+ } -+ -+ /** -+ * Returns if this tone could be sharped. -+ * -+ * @return if this tone could be sharped. -+ */ -+ public boolean isSharpable() { -+ return sharpable; -+ } -+ -+ /** -+ * Returns if this tone id is the sharped id of the tone. -+ * -+ * @param id -+ * the id of the tone. -+ * @return if the tone id is the sharped id of the tone. -+ * @throws IllegalArgumentException -+ * if neither the tone nor the semitone have the id. -+ */ -+ public boolean isSharped(byte id) { -+ if (id == getId(false)) { -+ return false; -+ } else if (id == getId(true)) { -+ return true; -+ } else { -+ // The id isn't matching to the tone! -+ throw new IllegalArgumentException("The id isn't matching to the tone."); -+ } -+ } -+ -+ /** -+ * Returns the tone to id. Also returning the semitones. -+ * -+ * @param id -+ * the id of the tone. -+ * @return the tone to id. -+ */ -+ public static Tone getToneById(byte id) { -+ return tones.get(id); -+ } -+ -+ static { -+ byte lowest = F.id; -+ byte highest = F.id; -+ for (Tone tone : Tone.values()) { -+ byte id = tone.id; -+ tones.put(id, tone); -+ if (id < lowest) { -+ lowest = id; -+ } -+ if (tone.isSharpable()) { -+ id++; -+ tones.put(id, tone); -+ } -+ if (id > highest) { -+ highest = id; -+ } -+ } -+ -+ TONES_COUNT = (byte) (highest - lowest + 1); -+ tones.put((byte) (TONES_COUNT - 1), F); -+ } -+ } -+ -+ private final byte note; -+ -+ /** -+ * Creates a new note. -+ * -+ * @param note -+ * Internal note id. {@link #getId()} always return this value. -+ * The value has to be in the interval [0; 24]. -+ */ -+ public Note(byte note) { -+ if (note < 0 || note > 24) { -+ throw new IllegalArgumentException("The note value has to be between 0 and 24."); -+ } -+ this.note = note; -+ } -+ -+ /** -+ * Creates a new note. -+ * -+ * @param octave -+ * The octave where the note is in. Has to be 0 - 2. -+ * @param note -+ * The tone within the octave. If the octave is 2 the note has to -+ * be F#. -+ * @param sharped -+ * Set it the tone is sharped (e.g. for F#). -+ */ -+ public Note(byte octave, Tone note, boolean sharped) { -+ if (sharped && !note.isSharpable()) { -+ throw new IllegalArgumentException("This tone could not be sharped."); -+ } -+ if (octave < 0 || octave > 2 || (octave == 2 && !(note == Tone.F && sharped))) { -+ throw new IllegalArgumentException("Tone and octave have to be between F#0 and F#2"); -+ } -+ this.note = (byte) (octave * Tone.TONES_COUNT + note.getId(sharped)); -+ } -+ -+ /** -+ * Returns the internal id of this note. -+ * -+ * @return the internal id of this note. -+ */ -+ public byte getId() { -+ return note; -+ } -+ -+ /** -+ * Returns the octave of this note. -+ * -+ * @return the octave of this note. -+ */ -+ public int getOctave() { -+ return note / Tone.TONES_COUNT; -+ } -+ -+ private byte getToneByte() { -+ return (byte) (note % Tone.TONES_COUNT); -+ } -+ -+ /** -+ * Returns the tone of this note. -+ * -+ * @return the tone of this note. -+ */ -+ public Tone getTone() { -+ return Tone.getToneById(getToneByte()); -+ } -+ -+ /** -+ * Returns if this note is sharped. -+ * -+ * @return if this note is sharped. -+ */ -+ public boolean isSharped() { -+ byte note = getToneByte(); -+ return Tone.getToneById(note).isSharped(note); -+ } -+} ---- net/minecraft/src/ComponentStronghold.java -+++ net/minecraft/src/ComponentStronghold.java -@@ -4,129 +4,164 @@ - import java.util.Random; - - abstract class ComponentStronghold extends StructureComponent { -- protected EnumDoor field_143013_d = EnumDoor.OPENING; -+ protected EnumDoor field_143013_d; - - public ComponentStronghold() { -- } -- -- protected ComponentStronghold(int var1) { -- super(var1); -- } -- -- protected void func_143012_a(NBTTagCompound var1) { -- var1.setString("EntryDoor", this.field_143013_d.name()); -- } -- -- protected void func_143011_b(NBTTagCompound var1) { -- this.field_143013_d = EnumDoor.valueOf(var1.getString("EntryDoor")); -- } -- -- protected void placeDoor(World var1, Random var2, StructureBoundingBox var3, EnumDoor var4, int var5, int var6, int var7) { -- switch(EnumDoorHelper.doorEnum[var4.ordinal()]) { -- case 1: -- default: -- this.fillWithBlocks(var1, var3, var5, var6, var7, var5 + 3 - 1, var6 + 3 - 1, var7, 0, 0, false); -- break; -- case 2: -- this.placeBlockAtCurrentPosition(var1, Block.stoneBrick.blockID, 0, var5, var6, var7, var3); -- this.placeBlockAtCurrentPosition(var1, Block.stoneBrick.blockID, 0, var5, var6 + 1, var7, var3); -- this.placeBlockAtCurrentPosition(var1, Block.stoneBrick.blockID, 0, var5, var6 + 2, var7, var3); -- this.placeBlockAtCurrentPosition(var1, Block.stoneBrick.blockID, 0, var5 + 1, var6 + 2, var7, var3); -- this.placeBlockAtCurrentPosition(var1, Block.stoneBrick.blockID, 0, var5 + 2, var6 + 2, var7, var3); -- this.placeBlockAtCurrentPosition(var1, Block.stoneBrick.blockID, 0, var5 + 2, var6 + 1, var7, var3); -- this.placeBlockAtCurrentPosition(var1, Block.stoneBrick.blockID, 0, var5 + 2, var6, var7, var3); -- this.placeBlockAtCurrentPosition(var1, Block.doorWood.blockID, 0, var5 + 1, var6, var7, var3); -- this.placeBlockAtCurrentPosition(var1, Block.doorWood.blockID, 8, var5 + 1, var6 + 1, var7, var3); -- break; -- case 3: -- this.placeBlockAtCurrentPosition(var1, 0, 0, var5 + 1, var6, var7, var3); -- this.placeBlockAtCurrentPosition(var1, 0, 0, var5 + 1, var6 + 1, var7, var3); -- this.placeBlockAtCurrentPosition(var1, Block.fenceIron.blockID, 0, var5, var6, var7, var3); -- this.placeBlockAtCurrentPosition(var1, Block.fenceIron.blockID, 0, var5, var6 + 1, var7, var3); -- this.placeBlockAtCurrentPosition(var1, Block.fenceIron.blockID, 0, var5, var6 + 2, var7, var3); -- this.placeBlockAtCurrentPosition(var1, Block.fenceIron.blockID, 0, var5 + 1, var6 + 2, var7, var3); -- this.placeBlockAtCurrentPosition(var1, Block.fenceIron.blockID, 0, var5 + 2, var6 + 2, var7, var3); -- this.placeBlockAtCurrentPosition(var1, Block.fenceIron.blockID, 0, var5 + 2, var6 + 1, var7, var3); -- this.placeBlockAtCurrentPosition(var1, Block.fenceIron.blockID, 0, var5 + 2, var6, var7, var3); -- break; -- case 4: -- this.placeBlockAtCurrentPosition(var1, Block.stoneBrick.blockID, 0, var5, var6, var7, var3); -- this.placeBlockAtCurrentPosition(var1, Block.stoneBrick.blockID, 0, var5, var6 + 1, var7, var3); -- this.placeBlockAtCurrentPosition(var1, Block.stoneBrick.blockID, 0, var5, var6 + 2, var7, var3); -- this.placeBlockAtCurrentPosition(var1, Block.stoneBrick.blockID, 0, var5 + 1, var6 + 2, var7, var3); -- this.placeBlockAtCurrentPosition(var1, Block.stoneBrick.blockID, 0, var5 + 2, var6 + 2, var7, var3); -- this.placeBlockAtCurrentPosition(var1, Block.stoneBrick.blockID, 0, var5 + 2, var6 + 1, var7, var3); -- this.placeBlockAtCurrentPosition(var1, Block.stoneBrick.blockID, 0, var5 + 2, var6, var7, var3); -- this.placeBlockAtCurrentPosition(var1, Block.doorIron.blockID, 0, var5 + 1, var6, var7, var3); -- this.placeBlockAtCurrentPosition(var1, Block.doorIron.blockID, 8, var5 + 1, var6 + 1, var7, var3); -- this.placeBlockAtCurrentPosition(var1, Block.stoneButton.blockID, this.getMetadataWithOffset(Block.stoneButton.blockID, 4), var5 + 2, var6 + 1, var7 + 1, var3); -- this.placeBlockAtCurrentPosition(var1, Block.stoneButton.blockID, this.getMetadataWithOffset(Block.stoneButton.blockID, 3), var5 + 2, var6 + 1, var7 - 1, var3); -- } -- -- } -- -- protected EnumDoor getRandomDoor(Random var1) { -- int var2 = var1.nextInt(5); -- switch(var2) { -- case 0: -- case 1: -- default: -- return EnumDoor.OPENING; -- case 2: -- return EnumDoor.WOOD_DOOR; -- case 3: -- return EnumDoor.GRATES; -- case 4: -- return EnumDoor.IRON_DOOR; -- } -- } -- -- protected StructureComponent getNextComponentNormal(ComponentStrongholdStairs2 var1, List var2, Random var3, int var4, int var5) { -- switch(this.coordBaseMode) { -- case 0: -- return StructureStrongholdPieces.getNextValidComponentAccess(var1, var2, var3, this.boundingBox.minX + var4, this.boundingBox.minY + var5, this.boundingBox.maxZ + 1, this.coordBaseMode, this.getComponentType()); -- case 1: -- return StructureStrongholdPieces.getNextValidComponentAccess(var1, var2, var3, this.boundingBox.minX - 1, this.boundingBox.minY + var5, this.boundingBox.minZ + var4, this.coordBaseMode, this.getComponentType()); -- case 2: -- return StructureStrongholdPieces.getNextValidComponentAccess(var1, var2, var3, this.boundingBox.minX + var4, this.boundingBox.minY + var5, this.boundingBox.minZ - 1, this.coordBaseMode, this.getComponentType()); -- case 3: -- return StructureStrongholdPieces.getNextValidComponentAccess(var1, var2, var3, this.boundingBox.maxX + 1, this.boundingBox.minY + var5, this.boundingBox.minZ + var4, this.coordBaseMode, this.getComponentType()); -- default: -- return null; -- } -- } -- -- protected StructureComponent getNextComponentX(ComponentStrongholdStairs2 var1, List var2, Random var3, int var4, int var5) { -- switch(this.coordBaseMode) { -- case 0: -- return StructureStrongholdPieces.getNextValidComponentAccess(var1, var2, var3, this.boundingBox.minX - 1, this.boundingBox.minY + var4, this.boundingBox.minZ + var5, 1, this.getComponentType()); -- case 1: -- return StructureStrongholdPieces.getNextValidComponentAccess(var1, var2, var3, this.boundingBox.minX + var5, this.boundingBox.minY + var4, this.boundingBox.minZ - 1, 2, this.getComponentType()); -- case 2: -- return StructureStrongholdPieces.getNextValidComponentAccess(var1, var2, var3, this.boundingBox.minX - 1, this.boundingBox.minY + var4, this.boundingBox.minZ + var5, 1, this.getComponentType()); -- case 3: -- return StructureStrongholdPieces.getNextValidComponentAccess(var1, var2, var3, this.boundingBox.minX + var5, this.boundingBox.minY + var4, this.boundingBox.minZ - 1, 2, this.getComponentType()); -- default: -- return null; -- } -- } -- -- protected StructureComponent getNextComponentZ(ComponentStrongholdStairs2 var1, List var2, Random var3, int var4, int var5) { -- switch(this.coordBaseMode) { -- case 0: -- return StructureStrongholdPieces.getNextValidComponentAccess(var1, var2, var3, this.boundingBox.maxX + 1, this.boundingBox.minY + var4, this.boundingBox.minZ + var5, 3, this.getComponentType()); -- case 1: -- return StructureStrongholdPieces.getNextValidComponentAccess(var1, var2, var3, this.boundingBox.minX + var5, this.boundingBox.minY + var4, this.boundingBox.maxZ + 1, 0, this.getComponentType()); -- case 2: -- return StructureStrongholdPieces.getNextValidComponentAccess(var1, var2, var3, this.boundingBox.maxX + 1, this.boundingBox.minY + var4, this.boundingBox.minZ + var5, 3, this.getComponentType()); -- case 3: -- return StructureStrongholdPieces.getNextValidComponentAccess(var1, var2, var3, this.boundingBox.minX + var5, this.boundingBox.minY + var4, this.boundingBox.maxZ + 1, 0, this.getComponentType()); -- default: -- return null; -- } -- } -- -- protected static boolean canStrongholdGoDeeper(StructureBoundingBox var0) { -- return var0 != null && var0.minY > 10; -+ this.field_143013_d = EnumDoor.OPENING; -+ } -+ -+ protected ComponentStronghold(int par1) { -+ super(par1); -+ this.field_143013_d = EnumDoor.OPENING; -+ } -+ -+ protected void func_143012_a(NBTTagCompound par1NBTTagCompound) { -+ par1NBTTagCompound.setString("EntryDoor", this.field_143013_d.name()); -+ } -+ -+ protected void func_143011_b(NBTTagCompound par1NBTTagCompound) { -+ this.field_143013_d = EnumDoor.valueOf(par1NBTTagCompound.getString("EntryDoor")); -+ } -+ -+ /** -+ * builds a door of the enumerated types (empty opening is a door) -+ */ -+ protected void placeDoor(World par1World, Random par2Random, StructureBoundingBox par3StructureBoundingBox, EnumDoor par4EnumDoor, int par5, int par6, int par7) { -+ switch (EnumDoorHelper.doorEnum[par4EnumDoor.ordinal()]) { -+ case 1: -+ default: -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, par5, par6, par7, par5 + 3 - 1, par6 + 3 - 1, par7, 0, 0, false); -+ break; -+ -+ case 2: -+ this.placeBlockAtCurrentPosition(par1World, Block.stoneBrick.blockID, 0, par5, par6, par7, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.stoneBrick.blockID, 0, par5, par6 + 1, par7, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.stoneBrick.blockID, 0, par5, par6 + 2, par7, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.stoneBrick.blockID, 0, par5 + 1, par6 + 2, par7, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.stoneBrick.blockID, 0, par5 + 2, par6 + 2, par7, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.stoneBrick.blockID, 0, par5 + 2, par6 + 1, par7, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.stoneBrick.blockID, 0, par5 + 2, par6, par7, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.doorWood.blockID, 0, par5 + 1, par6, par7, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.doorWood.blockID, 8, par5 + 1, par6 + 1, par7, par3StructureBoundingBox); -+ break; -+ -+ case 3: -+ this.placeBlockAtCurrentPosition(par1World, 0, 0, par5 + 1, par6, par7, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, 0, 0, par5 + 1, par6 + 1, par7, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.fenceIron.blockID, 0, par5, par6, par7, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.fenceIron.blockID, 0, par5, par6 + 1, par7, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.fenceIron.blockID, 0, par5, par6 + 2, par7, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.fenceIron.blockID, 0, par5 + 1, par6 + 2, par7, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.fenceIron.blockID, 0, par5 + 2, par6 + 2, par7, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.fenceIron.blockID, 0, par5 + 2, par6 + 1, par7, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.fenceIron.blockID, 0, par5 + 2, par6, par7, par3StructureBoundingBox); -+ break; -+ -+ case 4: -+ this.placeBlockAtCurrentPosition(par1World, Block.stoneBrick.blockID, 0, par5, par6, par7, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.stoneBrick.blockID, 0, par5, par6 + 1, par7, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.stoneBrick.blockID, 0, par5, par6 + 2, par7, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.stoneBrick.blockID, 0, par5 + 1, par6 + 2, par7, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.stoneBrick.blockID, 0, par5 + 2, par6 + 2, par7, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.stoneBrick.blockID, 0, par5 + 2, par6 + 1, par7, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.stoneBrick.blockID, 0, par5 + 2, par6, par7, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.doorIron.blockID, 0, par5 + 1, par6, par7, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.doorIron.blockID, 8, par5 + 1, par6 + 1, par7, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.stoneButton.blockID, this.getMetadataWithOffset(Block.stoneButton.blockID, 4), par5 + 2, par6 + 1, par7 + 1, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.stoneButton.blockID, this.getMetadataWithOffset(Block.stoneButton.blockID, 3), par5 + 2, par6 + 1, par7 - 1, par3StructureBoundingBox); -+ } -+ } -+ -+ protected EnumDoor getRandomDoor(Random par1Random) { -+ int var2 = par1Random.nextInt(5); -+ -+ switch (var2) { -+ case 0: -+ case 1: -+ default: -+ return EnumDoor.OPENING; -+ -+ case 2: -+ return EnumDoor.WOOD_DOOR; -+ -+ case 3: -+ return EnumDoor.GRATES; -+ -+ case 4: -+ return EnumDoor.IRON_DOOR; -+ } -+ } -+ -+ /** -+ * Gets the next component in any cardinal direction -+ */ -+ protected StructureComponent getNextComponentNormal(ComponentStrongholdStairs2 par1ComponentStrongholdStairs2, List par2List, Random par3Random, int par4, int par5) { -+ switch (this.coordBaseMode) { -+ case 0: -+ return StructureStrongholdPieces.getNextValidComponentAccess(par1ComponentStrongholdStairs2, par2List, par3Random, this.boundingBox.minX + par4, this.boundingBox.minY + par5, this.boundingBox.maxZ + 1, this.coordBaseMode, this.getComponentType()); -+ -+ case 1: -+ return StructureStrongholdPieces.getNextValidComponentAccess(par1ComponentStrongholdStairs2, par2List, par3Random, this.boundingBox.minX - 1, this.boundingBox.minY + par5, this.boundingBox.minZ + par4, this.coordBaseMode, this.getComponentType()); -+ -+ case 2: -+ return StructureStrongholdPieces.getNextValidComponentAccess(par1ComponentStrongholdStairs2, par2List, par3Random, this.boundingBox.minX + par4, this.boundingBox.minY + par5, this.boundingBox.minZ - 1, this.coordBaseMode, this.getComponentType()); -+ -+ case 3: -+ return StructureStrongholdPieces.getNextValidComponentAccess(par1ComponentStrongholdStairs2, par2List, par3Random, this.boundingBox.maxX + 1, this.boundingBox.minY + par5, this.boundingBox.minZ + par4, this.coordBaseMode, this.getComponentType()); -+ -+ default: -+ return null; -+ } -+ } -+ -+ /** -+ * Gets the next component in the +/- X direction -+ */ -+ protected StructureComponent getNextComponentX(ComponentStrongholdStairs2 par1ComponentStrongholdStairs2, List par2List, Random par3Random, int par4, int par5) { -+ switch (this.coordBaseMode) { -+ case 0: -+ return StructureStrongholdPieces.getNextValidComponentAccess(par1ComponentStrongholdStairs2, par2List, par3Random, this.boundingBox.minX - 1, this.boundingBox.minY + par4, this.boundingBox.minZ + par5, 1, this.getComponentType()); -+ -+ case 1: -+ return StructureStrongholdPieces.getNextValidComponentAccess(par1ComponentStrongholdStairs2, par2List, par3Random, this.boundingBox.minX + par5, this.boundingBox.minY + par4, this.boundingBox.minZ - 1, 2, this.getComponentType()); -+ -+ case 2: -+ return StructureStrongholdPieces.getNextValidComponentAccess(par1ComponentStrongholdStairs2, par2List, par3Random, this.boundingBox.minX - 1, this.boundingBox.minY + par4, this.boundingBox.minZ + par5, 1, this.getComponentType()); -+ -+ case 3: -+ return StructureStrongholdPieces.getNextValidComponentAccess(par1ComponentStrongholdStairs2, par2List, par3Random, this.boundingBox.minX + par5, this.boundingBox.minY + par4, this.boundingBox.minZ - 1, 2, this.getComponentType()); -+ -+ default: -+ return null; -+ } -+ } -+ -+ /** -+ * Gets the next component in the +/- Z direction -+ */ -+ protected StructureComponent getNextComponentZ(ComponentStrongholdStairs2 par1ComponentStrongholdStairs2, List par2List, Random par3Random, int par4, int par5) { -+ switch (this.coordBaseMode) { -+ case 0: -+ return StructureStrongholdPieces.getNextValidComponentAccess(par1ComponentStrongholdStairs2, par2List, par3Random, this.boundingBox.maxX + 1, this.boundingBox.minY + par4, this.boundingBox.minZ + par5, 3, this.getComponentType()); -+ -+ case 1: -+ return StructureStrongholdPieces.getNextValidComponentAccess(par1ComponentStrongholdStairs2, par2List, par3Random, this.boundingBox.minX + par5, this.boundingBox.minY + par4, this.boundingBox.maxZ + 1, 0, this.getComponentType()); -+ -+ case 2: -+ return StructureStrongholdPieces.getNextValidComponentAccess(par1ComponentStrongholdStairs2, par2List, par3Random, this.boundingBox.maxX + 1, this.boundingBox.minY + par4, this.boundingBox.minZ + par5, 3, this.getComponentType()); -+ -+ case 3: -+ return StructureStrongholdPieces.getNextValidComponentAccess(par1ComponentStrongholdStairs2, par2List, par3Random, this.boundingBox.minX + par5, this.boundingBox.minY + par4, this.boundingBox.maxZ + 1, 0, this.getComponentType()); -+ -+ default: -+ return null; -+ } -+ } -+ -+ /** -+ * returns false if the Structure Bounding Box goes below 10 -+ */ -+ protected static boolean canStrongholdGoDeeper(StructureBoundingBox par0StructureBoundingBox) { -+ return par0StructureBoundingBox != null && par0StructureBoundingBox.minY > 10; - } - } ---- /dev/null -+++ com/prupe/mcpatcher/ctm/ITileOverride.java -@@ -1,0 +1,24 @@ -+package com.prupe.mcpatcher.ctm; -+ -+import java.util.Set; -+import net.minecraft.src.Block; -+import net.minecraft.src.IBlockAccess; -+import net.minecraft.src.Icon; -+ -+interface ITileOverride extends Comparable { -+ boolean isDisabled(); -+ -+ void registerIcons(); -+ -+ Set getMatchingBlocks(); -+ -+ Set getMatchingTiles(); -+ -+ int getRenderPass(); -+ -+ int getWeight(); -+ -+ Icon getTile(IBlockAccess var1, Block var2, Icon var3, int var4, int var5, int var6, int var7); -+ -+ Icon getTile(Block var1, Icon var2, int var3, int var4); -+} ---- net/minecraft/src/EnumEntitySizeHelper.java -+++ net/minecraft/src/EnumEntitySizeHelper.java -@@ -7,32 +7,37 @@ - try { - field_96565_a[EnumEntitySize.SIZE_1.ordinal()] = 1; - } catch (NoSuchFieldError var6) { -+ ; - } - - try { - field_96565_a[EnumEntitySize.SIZE_2.ordinal()] = 2; - } catch (NoSuchFieldError var5) { -+ ; - } - - try { - field_96565_a[EnumEntitySize.SIZE_3.ordinal()] = 3; - } catch (NoSuchFieldError var4) { -+ ; - } - - try { - field_96565_a[EnumEntitySize.SIZE_4.ordinal()] = 4; - } catch (NoSuchFieldError var3) { -+ ; - } - - try { - field_96565_a[EnumEntitySize.SIZE_5.ordinal()] = 5; - } catch (NoSuchFieldError var2) { -+ ; - } - - try { - field_96565_a[EnumEntitySize.SIZE_6.ordinal()] = 6; - } catch (NoSuchFieldError var1) { -+ ; - } -- - } - } ---- /dev/null -+++ org/spoutcraft/api/util/map/TIntPairFloatHashMap.java -@@ -1,0 +1,101 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.api.util.map; -+ -+import gnu.trove.TFloatCollection; -+import gnu.trove.iterator.TLongFloatIterator; -+import gnu.trove.map.hash.TLongFloatHashMap; -+import gnu.trove.set.TLongSet; -+ -+/** -+ * A simplistic map that supports a pair of integers for keys, using a trove long float hashmap in the backend. -+ */ -+public class TIntPairFloatHashMap { -+ private TLongFloatHashMap map; -+ -+ public TIntPairFloatHashMap() { -+ map = new TLongFloatHashMap(100); -+ } -+ -+ public TIntPairFloatHashMap(int capacity) { -+ map = new TLongFloatHashMap(capacity); -+ } -+ -+ public float put(int key1, int key2, float value) { -+ long key = (((long)key1)<<32) | (((long)key2) & 0xFFFFFFFFL); -+ return map.put(key, value); -+ } -+ -+ public float get(int key1, int key2) { -+ long key = (((long)key1)<<32) | (((long)key2) & 0xFFFFFFFFL); -+ return map.get(key); -+ } -+ -+ public boolean containsKey(int key1, int key2) { -+ long key = (((long)key1)<<32) | (((long)key2) & 0xFFFFFFFFL); -+ return map.containsKey(key); -+ } -+ -+ public void clear() { -+ map.clear(); -+ } -+ -+ public boolean containsValue(float val) { -+ return map.containsValue(val); -+ } -+ -+ public boolean increment(int key1, int key2) { -+ long key = (((long)key1)<<32) | (((long)key2) & 0xFFFFFFFFL); -+ return map.increment(key); -+ } -+ -+ public boolean isEmpty() { -+ return map.isEmpty(); -+ } -+ -+ public TLongFloatIterator iterator() { -+ return map.iterator(); -+ } -+ -+ public TLongSet keySet() { -+ return map.keySet(); -+ } -+ -+ public long[] keys() { -+ return map.keys(); -+ } -+ -+ public float remove(int key1, int key2) { -+ long key = (((long)key1)<<32) | (((long)key2) & 0xFFFFFFFFL); -+ return map.remove(key); -+ } -+ -+ public int size() { -+ return map.size(); -+ } -+ -+ public TFloatCollection valueCollection() { -+ return map.valueCollection(); -+ } -+ -+ public float[] values() { -+ return map.values(); -+ } -+} ---- /dev/null -+++ com/prupe/mcpatcher/ctm/CTMUtils.java -@@ -1,0 +1,261 @@ -+package com.prupe.mcpatcher.ctm; -+ -+import com.prupe.mcpatcher.Config; -+import com.prupe.mcpatcher.MCLogger; -+import com.prupe.mcpatcher.TessellatorUtils; -+import com.prupe.mcpatcher.TexturePackChangeHandler; -+import com.prupe.mcpatcher.TileLoader; -+import com.prupe.mcpatcher.ctm.CTMUtils$1; -+import com.prupe.mcpatcher.ctm.CTMUtils$2; -+import com.prupe.mcpatcher.ctm.CTMUtils$3; -+import com.prupe.mcpatcher.ctm.TileOverrideImpl$BetterGrass; -+import java.util.ArrayList; -+import java.util.HashMap; -+import java.util.Iterator; -+import java.util.List; -+import java.util.Map; -+import net.minecraft.src.Block; -+import net.minecraft.src.IBlockAccess; -+import net.minecraft.src.Icon; -+import net.minecraft.src.RenderBlocks; -+import net.minecraft.src.Tessellator; -+ -+//Spout Start -+import org.spoutcraft.client.config.Configuration; -+//Spout End -+ -+public class CTMUtils { -+ private static final MCLogger logger = MCLogger.getLogger("Connected Textures", "CTM"); -+ private static final boolean enableStandard = Config.getBoolean("Connected Textures", "standard", true); -+ private static final boolean enableNonStandard = Config.getBoolean("Connected Textures", "nonStandard", true); -+ private static final boolean enableGrass = Config.getBoolean("Connected Textures", "grass", false); -+ private static final int maxRecursion = Config.getInt("Connected Textures", "maxRecursion", 4); -+ static final int BLOCK_ID_GRASS = 2; -+ static final int BLOCK_ID_MYCELIUM = 110; -+ static final int BLOCK_ID_SNOW = 78; -+ static final int BLOCK_ID_CRAFTED_SNOW = 80; -+ private static final List allOverrides = new ArrayList(); -+ private static final ITileOverride[][] blockOverrides = new ITileOverride[Block.blocksList.length][]; -+ private static final Map tileOverrides = new HashMap(); -+ private static TileLoader tileLoader; -+ private static TileOverrideImpl$BetterGrass betterGrass; -+ static boolean active; -+ static ITileOverride lastOverride; -+ -+ public static void start() { -+ lastOverride = null; -+ active = tileLoader.setDefaultTextureMap(Tessellator.instance); -+ } -+ -+ public static Icon getTile(RenderBlocks renderBlocks, Block block, int i, int j, int k, Icon origIcon, Tessellator tessellator) { -+ return getTile(renderBlocks, block, i, j, k, -1, origIcon, tessellator); -+ } -+ -+ public static Icon getTile(RenderBlocks renderBlocks, Block block, int i, int j, int k, int face, Icon icon, Tessellator tessellator) { -+ lastOverride = null; -+ -+ if (checkFace(face) && checkBlock(renderBlocks, block)) { -+ IBlockAccess blockAccess = renderBlocks.blockAccess; -+ CTMUtils$2 iterator = new CTMUtils$2(block, icon, blockAccess, i, j, k, face); -+ lastOverride = iterator.go(); -+ -+ if (lastOverride != null) { -+ icon = iterator.getIcon(); -+ } -+ } -+ -+ return lastOverride == null && skipDefaultRendering(block) ? null : icon; -+ } -+ -+ public static Icon getTile(RenderBlocks renderBlocks, Block block, int face, int metadata, Tessellator tessellator) { -+ return getTile(renderBlocks, block, face, metadata, renderBlocks.getBlockIconFromSideAndMetadata(block, face, metadata), tessellator); -+ } -+ -+ public static Icon getTile(RenderBlocks renderBlocks, Block block, int face, Tessellator tessellator) { -+ return getTile(renderBlocks, block, face, 0, renderBlocks.getBlockIconFromSide(block, face), tessellator); -+ } -+ -+ private static Icon getTile(RenderBlocks renderBlocks, Block block, int face, int metadata, Icon icon, Tessellator tessellator) { -+ lastOverride = null; -+ -+ if (checkFace(face) && checkRenderType(block)) { -+ CTMUtils$3 iterator = new CTMUtils$3(block, icon, face, metadata); -+ lastOverride = iterator.go(); -+ -+ if (lastOverride != null) { -+ icon = iterator.getIcon(); -+ } -+ } -+ -+ return icon; -+ } -+ -+ public static void reset() {} -+ -+ public static void finish() { -+ reset(); -+ RenderPassAPI.instance.finish(); -+ TessellatorUtils.clearDefaultTextureMap(Tessellator.instance); -+ lastOverride = null; -+ active = false; -+ } -+ -+ public static boolean isBetterGrass(IBlockAccess blockAccess, Block block, int i, int j, int k, int face) { -+ return betterGrass != null && betterGrass.isBetterGrass(blockAccess, block, i, j, k, face); -+ } -+ -+ private static boolean checkBlock(RenderBlocks renderBlocks, Block block) { -+ return active && renderBlocks.blockAccess != null; -+ } -+ -+ private static boolean checkFace(int face) { -+ boolean var10000; -+ -+ if (active) { -+ label25: { -+ if (face < 0) { -+ if (!enableNonStandard) { -+ break label25; -+ } -+ } else if (!enableStandard) { -+ break label25; -+ } -+ -+ var10000 = true; -+ return var10000; -+ } -+ } -+ -+ var10000 = false; -+ return var10000; -+ } -+ -+ private static boolean checkRenderType(Block block) { -+ switch (block.getRenderType()) { -+ case 11: -+ case 21: -+ return false; -+ -+ default: -+ return true; -+ } -+ } -+ -+ private static boolean skipDefaultRendering(Block block) { -+ return RenderPassAPI.instance.skipDefaultRendering(block); -+ } -+ -+ private static void registerOverride(ITileOverride override) { -+ if (override != null && !override.isDisabled()) { -+ boolean registered = false; -+ Iterator i$; -+ -+ if (override.getMatchingBlocks() != null) { -+ for (i$ = override.getMatchingBlocks().iterator(); i$.hasNext(); registered = true) { -+ int name = ((Integer)i$.next()).intValue(); -+ String blockName = ""; -+ -+ if (name >= 0 && name < Block.blocksList.length && Block.blocksList[name] != null) { -+ blockName = Block.blocksList[name].getUnlocalizedName(); -+ -+ if (blockName == null) { -+ blockName = ""; -+ } else { -+ blockName = " (" + blockName.replaceFirst("^tile\\.", "") + ")"; -+ } -+ } -+ -+ blockOverrides[name] = registerOverride(blockOverrides[name], override, "block " + name + blockName); -+ } -+ } -+ -+ if (override.getMatchingTiles() != null) { -+ for (i$ = override.getMatchingTiles().iterator(); i$.hasNext(); registered = true) { -+ String name1 = (String)i$.next(); -+ tileOverrides.put(name1, registerOverride((ITileOverride[])tileOverrides.get(name1), override, "tile " + name1)); -+ } -+ } -+ -+ if (registered) { -+ allOverrides.add(override); -+ } -+ } -+ } -+ -+ private static ITileOverride[] registerOverride(ITileOverride[] overrides, ITileOverride override, String description) { -+ logger.fine("using %s for %s", new Object[] {override, description}); -+ -+ if (overrides == null) { -+ return new ITileOverride[] {override}; -+ } else { -+ ITileOverride[] newList = new ITileOverride[overrides.length + 1]; -+ System.arraycopy(overrides, 0, newList, 0, overrides.length); -+ newList[overrides.length] = override; -+ return newList; -+ } -+ } -+ -+ static List access$000() { -+ return allOverrides; -+ } -+ -+ static ITileOverride[][] access$100() { -+ return blockOverrides; -+ } -+ -+ static Map access$200() { -+ return tileOverrides; -+ } -+ -+ static TileLoader access$302(TileLoader x0) { -+ tileLoader = x0; -+ return x0; -+ } -+ -+ static MCLogger access$400() { -+ return logger; -+ } -+ -+ static TileOverrideImpl$BetterGrass access$502(TileOverrideImpl$BetterGrass x0) { -+ betterGrass = x0; -+ return x0; -+ } -+ -+ static boolean access$600() { -+ return enableStandard; -+ } -+ -+ static boolean access$700() { -+ return enableNonStandard; -+ } -+ -+ static TileLoader access$300() { -+ return tileLoader; -+ } -+ -+ static void access$800(ITileOverride x0) { -+ registerOverride(x0); -+ } -+ -+ static boolean access$900() { -+ if (Configuration.betterGrass !=0) { -+ return true; -+ } else { -+ return false; -+ } -+ } -+ -+ static int access$1000() { -+ return maxRecursion; -+ } -+ -+ static { -+ try { -+ Class.forName("com.prupe.mcpatcher.ctm.RenderPass").getMethod("finish", new Class[0]).invoke((Object)null, new Object[0]); -+ } catch (Throwable var1) { -+ ; -+ } -+ -+ TexturePackChangeHandler.register(new CTMUtils$1("Connected Textures", 3)); -+ } -+} ---- /dev/null -+++ org/spoutcraft/client/chunkcache/HeightMapSaveThread.java -@@ -1,0 +1,48 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.client.chunkcache; -+ -+import java.util.Queue; -+import java.util.concurrent.LinkedBlockingDeque; -+ -+public class HeightMapSaveThread extends Thread { -+ private Queue saveQueue = new LinkedBlockingDeque(); -+ private boolean running; -+ -+ public void addMap(HeightMap heightMap) { -+ synchronized (saveQueue) { -+ saveQueue.add(heightMap); -+ } -+ if (!running) { -+ start(); -+ } -+ } -+ -+ @Override -+ public void run() { -+ running = true; -+ synchronized (saveQueue) { -+ while (!saveQueue.isEmpty()) { -+ saveQueue.poll().save(); -+ } -+ } -+ running = false; -+ } -+} ---- /dev/null -+++ com/prupe/mcpatcher/cc/BiomeHelper.java -@@ -1,0 +1,88 @@ -+package com.prupe.mcpatcher.cc; -+ -+import com.prupe.mcpatcher.MCLogger; -+import com.prupe.mcpatcher.MCPatcherUtils; -+import java.lang.reflect.Method; -+import java.util.BitSet; -+import net.minecraft.src.BiomeGenBase; -+import net.minecraft.src.Minecraft; -+ -+class BiomeHelper { -+ private static final MCLogger logger = MCLogger.getLogger("Custom Colors"); -+ private static Method getWaterColorMultiplier; -+ private static BiomeGenBase lastBiome; -+ private static int lastI; -+ private static int lastK; -+ -+ static void parseBiomeList(String list, BitSet bits) { -+ if (!MCPatcherUtils.isNullOrEmpty(list)) { -+ String[] arr$ = list.toLowerCase().split("\\s+"); -+ int len$ = arr$.length; -+ -+ for (int i$ = 0; i$ < len$; ++i$) { -+ String s = arr$[i$]; -+ -+ if (!s.isEmpty()) { -+ BiomeGenBase[] arr$1 = BiomeGenBase.biomeList; -+ int len$1 = arr$1.length; -+ -+ for (int i$1 = 0; i$1 < len$1; ++i$1) { -+ BiomeGenBase biome = arr$1[i$1]; -+ -+ if (biome != null && biome.biomeName != null && s.equals(biome.biomeName.toLowerCase().replace(" ", ""))) { -+ bits.set(biome.biomeID); -+ } -+ } -+ } -+ } -+ } -+ } -+ -+ static int getBiomeIDAt(int i, int j, int k) { -+ BiomeGenBase biome = getBiomeGenAt(i, j, k); -+ return biome == null ? BiomeGenBase.biomeList.length : biome.biomeID; -+ } -+ -+ static BiomeGenBase getBiomeGenAt(int i, int j, int k) { -+ if (lastBiome == null || i != lastI || k != lastK) { -+ lastI = i; -+ lastK = k; -+ lastBiome = Minecraft.getMinecraft().theWorld.getBiomeGenForCoords(i, k); -+ } -+ -+ return lastBiome; -+ } -+ -+ static float getTemperature(int i, int j, int k) { -+ return getBiomeGenAt(i, j, k).getFloatTemperature(); -+ } -+ -+ static float getRainfall(int i, int j, int k) { -+ return getBiomeGenAt(i, j, k).getFloatRainfall(); -+ } -+ -+ static int getWaterColorMultiplier(int i, int j, int k) { -+ BiomeGenBase biome = getBiomeGenAt(i, j, k); -+ -+ if (getWaterColorMultiplier != null) { -+ try { -+ return ((Integer)getWaterColorMultiplier.invoke(biome, new Object[0])).intValue(); -+ } catch (Throwable var5) { -+ var5.printStackTrace(); -+ getWaterColorMultiplier = null; -+ } -+ } -+ -+ return biome.waterColorMultiplier; -+ } -+ -+ static { -+ try { -+ getWaterColorMultiplier = BiomeGenBase.class.getDeclaredMethod("getWaterColorMultiplier", new Class[0]); -+ getWaterColorMultiplier.setAccessible(true); -+ logger.config("forge getWaterColorMultiplier detected", new Object[0]); -+ } catch (NoSuchMethodException var1) { -+ ; -+ } -+ } -+} ---- /dev/null -+++ org/spoutcraft/client/SpoutClient.java -@@ -1,0 +1,602 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.client; -+ -+import java.io.File; -+import java.util.HashMap; -+import java.util.Iterator; -+import java.util.LinkedList; -+import java.util.logging.Logger; -+ -+import org.newdawn.slick.util.Log; -+import org.newdawn.slick.util.LogSystem; -+ -+import net.minecraft.src.Minecraft; -+import net.minecraft.src.AbstractClientPlayer; -+import net.minecraft.src.Entity; -+import net.minecraft.src.EntityClientPlayerMP; -+import net.minecraft.src.EntityPlayer; -+import net.minecraft.src.Packet; -+import net.minecraft.src.WorldClient; -+ -+import org.spoutcraft.api.Client; -+import org.spoutcraft.api.Spoutcraft; -+import org.spoutcraft.api.gui.Keyboard; -+import org.spoutcraft.api.gui.RenderDelegate; -+import org.spoutcraft.api.gui.WidgetManager; -+import org.spoutcraft.api.inventory.MaterialManager; -+import org.spoutcraft.api.keyboard.KeyBindingManager; -+import org.spoutcraft.api.material.MaterialData; -+import org.spoutcraft.api.player.BiomeManager; -+import org.spoutcraft.api.player.SkyManager; -+import org.spoutcraft.api.property.PropertyObject; -+import org.spoutcraft.client.config.Configuration; -+import org.spoutcraft.client.config.MipMapUtils; -+import org.spoutcraft.client.controls.SimpleKeyBindingManager; -+import org.spoutcraft.client.entity.CraftEntity; -+import org.spoutcraft.client.gui.MCRenderDelegate; -+import org.spoutcraft.client.gui.SimpleKeyManager; -+import org.spoutcraft.client.gui.SimpleWidgetManager; -+import org.spoutcraft.client.gui.minimap.MinimapConfig; -+import org.spoutcraft.client.gui.server.ServerManager; -+import org.spoutcraft.client.inventory.SimpleMaterialManager; -+import org.spoutcraft.client.io.CRCManager; -+import org.spoutcraft.client.io.CustomTextureManager; -+import org.spoutcraft.client.io.FileDownloadThread; -+import org.spoutcraft.client.io.FileUtil; -+import org.spoutcraft.client.io.DownloadAssets; -+import org.spoutcraft.client.packet.CustomPacket; -+import org.spoutcraft.client.packet.PacketEntityInformation; -+import org.spoutcraft.client.packet.PacketManager; -+import org.spoutcraft.client.player.ClientPlayer; -+import org.spoutcraft.client.player.SimpleBiomeManager; -+import org.spoutcraft.client.player.SimpleSkyManager; -+ -+public class SpoutClient extends PropertyObject implements Client { -+ private static SpoutClient instance = null; -+ private static final Thread dataMiningThread = new DataMiningThread(); -+ private static final String version = "Spoutcraft 1.6.4 / b21"; -+ public static final String spoutcraftVersion = "1.6.4"; -+ public static final String spoutcraftBuild = " - b21"; -+ private final SimpleSkyManager skyManager = new SimpleSkyManager(); -+ private final PacketManager packetManager = new PacketManager(); -+ private final BiomeManager biomeManager = new SimpleBiomeManager(); -+ private final MaterialManager materialManager = new SimpleMaterialManager(); -+ private final RenderDelegate render = new MCRenderDelegate(); -+ private final ServerManager serverManager = new ServerManager(); -+ private final KeyBindingManager bindingManager = new SimpleKeyBindingManager(); -+ private final Logger log = Logger.getLogger(SpoutClient.class.getName()); -+ private long tick = 0; -+ private long inWorldTicks = 0; -+ private Thread clipboardThread = null; -+ private long server = -1L; -+ public ClientPlayer player = null; -+ private boolean cheatsky = false; -+ private boolean forcesky = false; -+ private boolean showsky = true; -+ private boolean cheatclearwater = false; -+ private boolean forceclearwater = false; -+ private boolean showclearwater = true; -+ private boolean cheatstars = false; -+ private boolean forcestars = true; -+ private boolean showstars = true; -+ private boolean cheatweather = false; -+ private boolean forceweather = true; -+ private boolean showweather = true; -+ private boolean time = false; -+ private boolean coords = false; -+ private boolean entitylabel = false; -+ private boolean cheatvoidfog = false; -+ private boolean forcevoidfog = true; -+ private boolean showvoidfog = true; -+ private boolean flySpeed = false; -+ private Mode clientMode = Mode.Menu; -+ private String addonFolder = Minecraft.getMinecraft().mcDataDir + File.separator + "addons"; -+ private final WidgetManager widgetManager = new SimpleWidgetManager(); -+ private final HashMap permissions = new HashMap(); -+ private boolean active = false; -+ public boolean xrayMode = false; -+ public static int[] visibleBlocks = new int[] {133, 132, 131, 120, 129, 122, 120, 119, 118, 117, 116, 115, 111, 103, 100, 151, 152, 153, 154, 155, 158, 99, 98, 96, 95, 89, 85, 74, 73, 72, 71, 70, 66, 65, 59, 57, 56, 54, 52, 51, 50, 48, 46, 44, 43, 42, 41, 40, 39, 34, 33, 30, 29, 28, 27, 26, 25, 22, 21, 18, 17, 16, 15, 14, 11, 10, 9, 8, 5}; -+ -+ private SpoutClient() { -+ instance = this; -+ if (!Thread.currentThread().getName().equals("Minecraft main thread")) { -+ throw new SecurityException("Main thread name mismatch"); -+ } -+ serverManager.init(); -+ ((SimpleKeyBindingManager)bindingManager).load(); -+ Log.setVerbose(false); -+ Log.setLogSystem(new SilencedLogSystem()); -+ DownloadAssets.getHttpAssets(); -+ } -+ -+ private class SilencedLogSystem implements LogSystem { -+ @Override -+ public void debug(String debug) {} -+ @Override -+ public void error(Throwable t) {} -+ @Override -+ public void error(String error) {} -+ @Override -+ public void error(String error, Throwable t) {} -+ @Override -+ public void info(String info) {} -+ @Override -+ public void warn(String warn) {} -+ @Override -+ public void warn(String warn, Throwable t) {} -+ } -+ -+ static { -+ dataMiningThread.start(); -+ Packet.addIdClassMapping(195, true, true, CustomPacket.class); -+ Configuration.read(); -+ Keyboard.setKeyManager(new SimpleKeyManager()); -+ FileUtil.migrateOldFiles(); -+ } -+ -+ public static SpoutClient getInstance() { -+ if (instance == null) { -+ Spoutcraft.setClient(new SpoutClient()); -+ } -+ return instance; -+ } -+ -+ public static String getClientVersion() { -+ return version; -+ } -+ -+ public static boolean hasAvailableRAM() { -+ return Runtime.getRuntime().maxMemory() > 756L; -+ } -+ -+ public long getServerVersion() { -+ return server; -+ } -+ -+ public static String getSpoutcraftVersion() { -+ return spoutcraftVersion; -+ } -+ -+ public static String getSpoutcraftBuild() { -+ return spoutcraftBuild; -+ } -+ -+ public SkyManager getSkyManager() { -+ return skyManager; -+ } -+ -+ public PacketManager getPacketManager() { -+ return packetManager; -+ } -+ -+ public ClientPlayer getActivePlayer() { -+ return player; -+ } -+ -+ public BiomeManager getBiomeManager() { -+ return biomeManager; -+ } -+ -+ public MaterialManager getMaterialManager() { -+ return materialManager; -+ } -+ -+ public net.minecraft.src.World getRawWorld() { -+ if (getHandle() == null) { -+ return null; -+ } -+ return getHandle().theWorld; -+ } -+ -+ public boolean isSkyCheat() { -+ return cheatsky || !getHandle().isMultiplayerWorld() || !isSpoutEnabled(); -+ } -+ -+ public boolean isForceSky() { -+ return forcesky || !getHandle().isMultiplayerWorld() || !isSpoutEnabled(); -+ } -+ -+ public boolean isShowSky() { -+ return showsky || !getHandle().isMultiplayerWorld() || !isSpoutEnabled(); -+ } -+ -+ public boolean isClearWaterCheat() { -+ return cheatclearwater || !getHandle().isMultiplayerWorld() || !isSpoutEnabled(); -+ } -+ public boolean isForceClearWater() { -+ return forceclearwater || !getHandle().isMultiplayerWorld() || !isSpoutEnabled(); -+ } -+ -+ public boolean isShowClearWater() { -+ return showclearwater || !getHandle().isMultiplayerWorld() || !isSpoutEnabled(); -+ } -+ -+ public boolean isStarsCheat() { -+ return cheatstars || !getHandle().isMultiplayerWorld() || !isSpoutEnabled(); -+ } -+ -+ public boolean isForceStars() { -+ return forcestars || !getHandle().isMultiplayerWorld() || !isSpoutEnabled(); -+ } -+ -+ public boolean isShowStars() { -+ return showstars || !getHandle().isMultiplayerWorld() || !isSpoutEnabled(); -+ } -+ -+ public boolean isWeatherCheat() { -+ return cheatweather || !getHandle().isMultiplayerWorld() || !isSpoutEnabled(); -+ } -+ -+ public boolean isForceWeather() { -+ return forceweather || !getHandle().isMultiplayerWorld() || !isSpoutEnabled(); -+ } -+ -+ public boolean isShowWeather() { -+ return showweather || !getHandle().isMultiplayerWorld() || !isSpoutEnabled(); -+ } -+ -+ public boolean isTimeCheat() { -+ return time || !getHandle().isMultiplayerWorld() || !isSpoutEnabled(); -+ } -+ -+ public boolean isCoordsCheat() { -+ return coords || !getHandle().isMultiplayerWorld() || !isSpoutEnabled(); -+ } -+ -+ public boolean isEntityLabelCheat() { -+ return entitylabel || !getHandle().isMultiplayerWorld() || !isSpoutEnabled(); -+ } -+ -+ public boolean isFlySpeedCheat() { -+ return flySpeed || !getHandle().isMultiplayerWorld() || !isSpoutEnabled(); -+ } -+ -+ public boolean isVoidFogCheat() { -+ return cheatvoidfog || !getHandle().isMultiplayerWorld() || !isSpoutEnabled(); -+ } -+ -+ public boolean isForceVoidFog() { -+ return forcevoidfog || !getHandle().isMultiplayerWorld() || !isSpoutEnabled(); -+ } -+ -+ public boolean isShowVoidFog() { -+ return showvoidfog || !getHandle().isMultiplayerWorld() || !isSpoutEnabled(); -+ } -+ -+ public void setVisualCheats(boolean tsky, boolean fsky, boolean ssky, boolean tclearwater, boolean fclearwater, boolean sclearwater, boolean tstars, boolean fstars, boolean sstars, boolean tweather, boolean fweather, boolean sweather, boolean ttime, boolean tcoords, boolean tentitylabel, boolean tvoidfog, boolean fvoidfog, boolean svoidfog, boolean tflyspeed) { -+ this.cheatsky = tsky; -+ this.forcesky = fsky; -+ this.showsky = ssky; -+ this.cheatclearwater = tclearwater; -+ this.forceclearwater = fclearwater; -+ this.showclearwater = sclearwater; -+ this.cheatstars = tstars; -+ this.forcestars = fstars; -+ this.showstars = sstars; -+ this.cheatweather = tweather; -+ this.forceweather = fweather; -+ this.showweather = sweather; -+ this.time = ttime; -+ this.coords = tcoords; -+ this.entitylabel = tentitylabel; -+ this.cheatvoidfog = tvoidfog; -+ this.forcevoidfog = fvoidfog; -+ this.showvoidfog = svoidfog; -+ this.flySpeed = tflyspeed; -+ -+ if (!isTimeCheat()) { -+ Configuration.setTime(0); -+ } -+ -+ if (cheatweather) { -+ Configuration.cheatweather = true; -+ } else { -+ Configuration.cheatweather = false; -+ } -+ -+ if (cheatsky) { -+ Configuration.cheatsky = true; -+ } else { -+ Configuration.cheatsky = false; -+ } -+ -+ if (cheatstars) { -+ Configuration.cheatstars = true; -+ } else { -+ Configuration.cheatstars = false; -+ } -+ -+ if (cheatvoidfog) { -+ Configuration.cheatvoidFog = true; -+ } else { -+ Configuration.cheatvoidFog = false; -+ } -+ -+ if (cheatclearwater) { -+ Configuration.cheatclearWater = true; -+ } else { -+ Configuration.cheatclearWater = false; -+ } -+ -+ if (isForceWeather()) { -+ if (isShowWeather()) { -+ Configuration.setWeather(true); -+ } else { -+ Configuration.setWeather(false); -+ } -+ } -+ -+ if (isForceStars()) { -+ if (isShowStars()) { -+ Configuration.setStars(true); -+ } else { -+ Configuration.setStars(false); -+ } -+ } -+ -+ if (isForceSky()) { -+ if (isShowSky()) { -+ Configuration.setSky(true); -+ } else { -+ Configuration.setSky(false); -+ } -+ } -+ -+ if (isForceClearWater()) { -+ if (isShowClearWater()) { -+ Configuration.setClearWater(true); -+ } else { -+ Configuration.setClearWater(false); -+ } -+ } -+ -+ if (isForceWeather()) { -+ if (isShowWeather()) { -+ Configuration.setWeather(true); -+ } else { -+ Configuration.setWeather(false); -+ } -+ } -+ -+ if (isForceVoidFog()) { -+ if (isShowVoidFog()) { -+ Configuration.setVoidFog(true); -+ } else { -+ Configuration.setVoidFog(false); -+ } -+ } -+ } -+ -+ public boolean isSpoutEnabled() { -+ return server >= 0; -+ } -+ -+ public void setSpoutVersion(long version) { -+ server = version; -+ } -+ -+ public boolean isSpoutActive() { -+ return active; -+ } -+ -+ public void setSpoutActive(boolean active) { -+ this.active = active; -+ } -+ -+ public void onTick() { -+ tick++; -+ Configuration.onTick(); -+ getHandle().mcProfiler.startSection("httpdownloads"); -+ FileDownloadThread.getInstance().onTick(); -+ getHandle().mcProfiler.endStartSection("packet_decompression"); -+ PacketDecompressionThread.onTick(); -+ getHandle().mcProfiler.endStartSection("widgets"); -+ player.getMainScreen().onTick(); -+ getHandle().mcProfiler.endStartSection("mipmapping"); -+ MipMapUtils.onTick(); -+ getHandle().mcProfiler.endStartSection("special_effects"); -+ if (Minecraft.getMinecraft().theWorld != null) { -+ Minecraft.getMinecraft().theWorld.doColorfulStuff(); -+ inWorldTicks++; -+ } -+ getHandle().mcProfiler.endStartSection("entity_info"); -+ if (isSpoutEnabled()) { -+ LinkedList processed = new LinkedList(); -+ Iterator i = Entity.toProcess.iterator(); -+ while (i.hasNext()) { -+ Entity next = i.next(); -+ if (next.spoutEnty != null) { -+ processed.add((CraftEntity) next.spoutEnty); -+ } -+ } -+ Entity.toProcess.clear(); -+ if (processed.size() > 0) { -+ getPacketManager().sendSpoutPacket(new PacketEntityInformation(processed)); -+ } -+ } -+ getHandle().mcProfiler.endSection(); -+ } -+ -+ public long getTick() { -+ return tick; -+ } -+ -+ public long getInWorldTicks() { -+ return inWorldTicks; -+ } -+ -+ public void onWorldExit() { -+ FileUtil.deleteTempDirectory(); -+ CustomTextureManager.resetTextures(); -+ CRCManager.clear(); -+ if (clipboardThread != null) { -+ clipboardThread.interrupt(); -+ clipboardThread = null; -+ } -+ Minecraft.getMinecraft().sndManager.stopMusic(); -+ PacketDecompressionThread.endThread(); -+ MaterialData.reset(); -+ FileDownloadThread.preCacheCompleted.lazySet(0); -+ server = -1L; -+ inWorldTicks = 0L; -+ MaterialData.reset(); -+ MinimapConfig.getInstance().getServerWaypoints().clear(); -+ } -+ -+ public void onWorldEnter() { -+ if (player == null) { -+ player = ClientPlayer.getInstance(); -+ player.setPlayer(getHandle().thePlayer); -+ getHandle().thePlayer.spoutEnty = player; -+ } -+ if (player.getHandle() instanceof EntityClientPlayerMP && isSpoutEnabled()) { -+ clipboardThread = new ClipboardThread((EntityClientPlayerMP)player.getHandle()); -+ clipboardThread.start(); -+ } else if (clipboardThread != null) { -+ clipboardThread.interrupt(); -+ clipboardThread = null; -+ } -+ PacketDecompressionThread.startThread(); -+ MipMapUtils.initializeMipMaps(); -+ MipMapUtils.update(); -+ player.getMainScreen().toggleSurvivalHUD(!Minecraft.getMinecraft().playerController.isInCreativeMode()); -+ inWorldTicks = 0L; -+ MinimapConfig.getInstance().getServerWaypoints().clear(); -+ } -+ -+ public static Minecraft getHandle() { -+ return Minecraft.getMinecraft(); -+ } -+ -+ public AbstractClientPlayer getAbstractPlayerFromId(int id) { -+ if (getHandle().thePlayer.entityId == id) { -+ return getHandle().thePlayer; -+ } -+ WorldClient world = (WorldClient)getHandle().theWorld; -+ Entity e = world.getEntityByID(id); -+ if (e instanceof AbstractClientPlayer) { -+ return (AbstractClientPlayer) e; -+ } -+ return null; -+ } -+ -+ public EntityPlayer getPlayerFromId(int id) { -+ if (getHandle().thePlayer.entityId == id) { -+ return getHandle().thePlayer; -+ } -+ WorldClient world = (WorldClient)getHandle().theWorld; -+ Entity e = world.getEntityByID(id); -+ if (e instanceof EntityPlayer) { -+ return (EntityPlayer) e; -+ } -+ return null; -+ } -+ -+ public Entity getEntityFromId(int id) { -+ if (getHandle().thePlayer.entityId == id) { -+ return getHandle().thePlayer; -+ } -+ WorldClient world = (WorldClient)getHandle().theWorld; -+ return world.getEntityByID(id); -+ } -+ -+ public Logger getLogger() { -+ return log; -+ } -+ -+ public ServerManager getServerManager() { -+ return instance.serverManager; -+ } -+ -+ public Mode getMode() { -+ return clientMode; -+ } -+ -+ public void setMode(Mode clientMode) { -+ this.clientMode = clientMode; -+ } -+ -+ public String getName() { -+ return "Spoutcraft"; -+ } -+ -+ public RenderDelegate getRenderDelegate() { -+ return render; -+ } -+ -+ public File getUpdateFolder() { -+ return new File(Minecraft.getMinecraft().mcDataDir, "addons" + File.separator + "updates"); -+ } -+ -+ public String getVersion() { -+ return version; -+ } -+ -+ public KeyBindingManager getKeyBindingManager() { -+ return bindingManager; -+ } -+ -+ public File getAddonFolder() { -+ return new File(addonFolder); -+ } -+ -+ public File getAudioCache() { -+ return getTemporaryCache(); -+ } -+ -+ public File getTemporaryCache() { -+ return FileUtil.getTempDir(); -+ } -+ -+ public File getTextureCache() { -+ return getTemporaryCache(); -+ } -+ -+ public File getTexturePackFolder() { -+ return FileUtil.getTexturePackDir(); -+ } -+ -+ public File getStatsFolder() { -+ return FileUtil.getStatsDir(); -+ } -+ -+ public WidgetManager getWidgetManager() { -+ return widgetManager; -+ } -+ -+ @Override -+ public boolean hasPermission(String node) { -+ Boolean allow = permissions.get(node); -+ if (allow != null) { -+ return allow; -+ } else { -+ return true; -+ } -+ } -+ -+ public void setPermission(String node, boolean allow) { -+ permissions.put(node, allow); -+ } -+ -+ public void clearPermissions() { -+ permissions.clear(); -+ } -+} ---- net/minecraft/src/PlayerUsageSnooper.java -+++ net/minecraft/src/PlayerUsageSnooper.java -@@ -13,38 +13,49 @@ - import java.util.Map.Entry; - - public class PlayerUsageSnooper { -- private Map a = new HashMap(); -- private final String b = UUID.randomUUID().toString(); -- private final URL c; -+ -+ /** String map for report data */ -+ private Map dataMap = new HashMap(); -+ private final String uniqueID = UUID.randomUUID().toString(); -+ -+ /** URL of the server to send the report to */ -+ private final URL serverUrl; - private final IPlayerUsage playerStatsCollector; -- private final java.util.Timer e = new java.util.Timer("Snooper Timer", true); -- private final Object f = new Object(); -+ -+ /** set to fire the snooperThread every 15 mins */ -+ private final java.util.Timer threadTrigger = new java.util.Timer("Snooper Timer", true); -+ private final Object syncLock = new Object(); - private final long field_98224_g; - private boolean isRunning; -+ -+ /** incremented on every getSelfCounterFor */ - private int selfCounter; - -- public PlayerUsageSnooper(String var1, IPlayerUsage var2, long var3) { -+ public PlayerUsageSnooper(String par1Str, IPlayerUsage par2IPlayerUsage, long par3) { - try { -- this.c = new URL("http://snoop.minecraft.net/" + var1 + "?version=" + 1); -+ this.serverUrl = new URL("http://snoop.minecraft.net/" + par1Str + "?version=" + 1); - } catch (MalformedURLException var6) { - throw new IllegalArgumentException(); - } - -- this.playerStatsCollector = var2; -- this.field_98224_g = var3; -+ this.playerStatsCollector = par2IPlayerUsage; -+ this.field_98224_g = par3; - } - -+ /** -+ * Note issuing start multiple times is not an error. -+ */ - public void startSnooper() { -- if(!this.isRunning) { -+ if (!this.isRunning) { - this.isRunning = true; - this.addBaseDataToSnooper(); -- this.e.schedule(new PlayerUsageSnooperThread(this), 0L, 900000L); -+ this.threadTrigger.schedule(new PlayerUsageSnooperThread(this), 0L, 900000L); - } - } - - private void addBaseDataToSnooper() { - this.addJvmArgsToSnooper(); -- this.addData("snooper_token", this.b); -+ this.addData("snooper_token", this.uniqueID); - this.addData("os_name", System.getProperty("os.name")); - this.addData("os_version", System.getProperty("os.version")); - this.addData("os_architecture", System.getProperty("os.arch")); -@@ -59,9 +70,10 @@ - int var3 = 0; - Iterator var4 = var2.iterator(); - -- while(var4.hasNext()) { -+ while (var4.hasNext()) { - String var5 = (String)var4.next(); -- if(var5.startsWith("-X")) { -+ -+ if (var5.startsWith("-X")) { - this.addData("jvm_arg[" + var3++ + "]", var5); - } - } -@@ -77,21 +89,26 @@ - this.playerStatsCollector.addServerStatsToSnooper(this); - } - -- public void addData(String var1, Object var2) { -- Object var3 = this.f; -- synchronized(var3) { -- this.a.put(var1, var2); -+ /** -+ * Adds information to the report -+ */ -+ public void addData(String par1Str, Object par2Obj) { -+ Object var3 = this.syncLock; -+ -+ synchronized (this.syncLock) { -+ this.dataMap.put(par1Str, par2Obj); - } - } - - public Map getCurrentStats() { - LinkedHashMap var1 = new LinkedHashMap(); -- Object var2 = this.f; -- synchronized(var2) { -+ Object var2 = this.syncLock; -+ -+ synchronized (this.syncLock) { - this.addMemoryStatsToSnooper(); -- Iterator var3 = this.a.entrySet().iterator(); -+ Iterator var3 = this.dataMap.entrySet().iterator(); - -- while(var3.hasNext()) { -+ while (var3.hasNext()) { - Entry var4 = (Entry)var3.next(); - var1.put(var4.getKey(), var4.getValue().toString()); - } -@@ -105,34 +122,37 @@ - } - - public void stopSnooper() { -- this.e.cancel(); -+ this.threadTrigger.cancel(); - } - - public String getUniqueID() { -- return this.b; -+ return this.uniqueID; - } - - public long func_130105_g() { - return this.field_98224_g; - } - -- static IPlayerUsage getStatsCollectorFor(PlayerUsageSnooper var0) { -- return var0.playerStatsCollector; -- } -- -- static Object getSyncLockFor(PlayerUsageSnooper var0) { -- return var0.f; -- } -- -- static Map getDataMapFor(PlayerUsageSnooper var0) { -- return var0.a; -- } -- -- static int getSelfCounterFor(PlayerUsageSnooper var0) { -- return var0.selfCounter++; -- } -- -- static URL getServerUrlFor(PlayerUsageSnooper var0) { -- return var0.c; -+ static IPlayerUsage getStatsCollectorFor(PlayerUsageSnooper par0PlayerUsageSnooper) { -+ return par0PlayerUsageSnooper.playerStatsCollector; -+ } -+ -+ static Object getSyncLockFor(PlayerUsageSnooper par0PlayerUsageSnooper) { -+ return par0PlayerUsageSnooper.syncLock; -+ } -+ -+ static Map getDataMapFor(PlayerUsageSnooper par0PlayerUsageSnooper) { -+ return par0PlayerUsageSnooper.dataMap; -+ } -+ -+ /** -+ * returns a value indicating how many times this function has been run on the snooper -+ */ -+ static int getSelfCounterFor(PlayerUsageSnooper par0PlayerUsageSnooper) { -+ return par0PlayerUsageSnooper.selfCounter++; -+ } -+ -+ static URL getServerUrlFor(PlayerUsageSnooper par0PlayerUsageSnooper) { -+ return par0PlayerUsageSnooper.serverUrl; - } - } ---- net/minecraft/src/ModelWither.java -+++ net/minecraft/src/ModelWither.java -@@ -35,44 +35,54 @@ - return 32; - } - -- public void render(Entity var1, float var2, float var3, float var4, float var5, float var6, float var7) { -- this.setRotationAngles(var2, var3, var4, var5, var6, var7, var1); -+ /** -+ * Sets the models various rotation angles then renders the model. -+ */ -+ public void render(Entity par1Entity, float par2, float par3, float par4, float par5, float par6, float par7) { -+ this.setRotationAngles(par2, par3, par4, par5, par6, par7, par1Entity); - ModelRenderer[] var8 = this.field_82904_b; - int var9 = var8.length; -- - int var10; - ModelRenderer var11; -- for(var10 = 0; var10 < var9; ++var10) { -+ -+ for (var10 = 0; var10 < var9; ++var10) { - var11 = var8[var10]; -- var11.render(var7); -+ var11.render(par7); - } - - var8 = this.field_82905_a; - var9 = var8.length; - -- for(var10 = 0; var10 < var9; ++var10) { -+ for (var10 = 0; var10 < var9; ++var10) { - var11 = var8[var10]; -- var11.render(var7); -+ var11.render(par7); - } -- - } - -- public void setRotationAngles(float var1, float var2, float var3, float var4, float var5, float var6, Entity var7) { -- float var8 = MathHelper.cos(var3 * 0.1F); -+ /** -+ * Sets the model's various rotation angles. For bipeds, par1 and par2 are used for animating the movement of arms and -+ * legs, where par1 represents the time(so that arms and legs swing back and forth) and par2 represents how "far" arms -+ * and legs can swing at most. -+ */ -+ public void setRotationAngles(float par1, float par2, float par3, float par4, float par5, float par6, Entity par7Entity) { -+ float var8 = MathHelper.cos(par3 * 0.1F); - this.field_82905_a[1].rotateAngleX = (0.065F + 0.05F * var8) * (float)Math.PI; - this.field_82905_a[2].setRotationPoint(-2.0F, 6.9F + MathHelper.cos(this.field_82905_a[1].rotateAngleX) * 10.0F, -0.5F + MathHelper.sin(this.field_82905_a[1].rotateAngleX) * 10.0F); - this.field_82905_a[2].rotateAngleX = (0.265F + 0.1F * var8) * (float)Math.PI; -- this.field_82904_b[0].rotateAngleY = var4 / (180.0F / (float)Math.PI); -- this.field_82904_b[0].rotateAngleX = var5 / (180.0F / (float)Math.PI); -+ this.field_82904_b[0].rotateAngleY = par4 / (180F / (float)Math.PI); -+ this.field_82904_b[0].rotateAngleX = par5 / (180F / (float)Math.PI); - } - -- public void setLivingAnimations(EntityLivingBase var1, float var2, float var3, float var4) { -- EntityWither var5 = (EntityWither)var1; -+ /** -+ * Used for easily adding entity-dependent animations. The second and third float params here are the same second and -+ * third as in the setRotationAngles method. -+ */ -+ public void setLivingAnimations(EntityLivingBase par1EntityLivingBase, float par2, float par3, float par4) { -+ EntityWither var5 = (EntityWither)par1EntityLivingBase; - -- for(int var6 = 1; var6 < 3; ++var6) { -- this.field_82904_b[var6].rotateAngleY = (var5.func_82207_a(var6 - 1) - var1.renderYawOffset) / (180.0F / (float)Math.PI); -- this.field_82904_b[var6].rotateAngleX = var5.func_82210_r(var6 - 1) / (180.0F / (float)Math.PI); -+ for (int var6 = 1; var6 < 3; ++var6) { -+ this.field_82904_b[var6].rotateAngleY = (var5.func_82207_a(var6 - 1) - par1EntityLivingBase.renderYawOffset) / (180F / (float)Math.PI); -+ this.field_82904_b[var6].rotateAngleX = var5.func_82210_r(var6 - 1) / (180F / (float)Math.PI); - } -- - } - } ---- net/minecraft/src/RenderEnderCrystal.java -+++ net/minecraft/src/RenderEnderCrystal.java -@@ -11,26 +11,38 @@ - this.field_76995_b = new ModelEnderCrystal(0.0F, true); - } - -- public void doRenderEnderCrystal(EntityEnderCrystal var1, double var2, double var4, double var6, float var8, float var9) { -- float var10 = (float)var1.innerRotation + var9; -+ /** -+ * Renders the Ender Crystal. -+ */ -+ public void doRenderEnderCrystal(EntityEnderCrystal par1EntityEnderCrystal, double par2, double par4, double par6, float par8, float par9) { -+ float var10 = (float)par1EntityEnderCrystal.innerRotation + par9; - GL11.glPushMatrix(); -- GL11.glTranslatef((float)var2, (float)var4, (float)var6); -+ GL11.glTranslatef((float)par2, (float)par4, (float)par6); - this.bindTexture(enderCrystalTextures); - float var11 = MathHelper.sin(var10 * 0.2F) / 2.0F + 0.5F; - var11 += var11 * var11; -- this.field_76995_b.render(var1, 0.0F, var10 * 3.0F, var11 * 0.2F, 0.0F, 0.0F, 1.0F / 16.0F); -+ this.field_76995_b.render(par1EntityEnderCrystal, 0.0F, var10 * 3.0F, var11 * 0.2F, 0.0F, 0.0F, 0.0625F); - GL11.glPopMatrix(); - } - -- protected ResourceLocation getEnderCrystalTextures(EntityEnderCrystal var1) { -+ protected ResourceLocation getEnderCrystalTextures(EntityEnderCrystal par1EntityEnderCrystal) { - return enderCrystalTextures; - } - -- protected ResourceLocation getEntityTexture(Entity var1) { -- return this.getEnderCrystalTextures((EntityEnderCrystal)var1); -+ /** -+ * Returns the location of an entity's texture. Doesn't seem to be called unless you call Render.bindEntityTexture. -+ */ -+ protected ResourceLocation getEntityTexture(Entity par1Entity) { -+ return this.getEnderCrystalTextures((EntityEnderCrystal)par1Entity); - } - -- public void doRender(Entity var1, double var2, double var4, double var6, float var8, float var9) { -- this.doRenderEnderCrystal((EntityEnderCrystal)var1, var2, var4, var6, var8, var9); -+ /** -+ * Actually renders the given argument. This is a synthetic bridge method, always casting down its argument and then -+ * handing it off to a worker function which does the actual work. In all probabilty, the class Render is generic -+ * (Render= 0; i = this.keysDown.nextSetBit(i + 1)) { -+ sb.append(' ').append(Keyboard.getKeyName(i)); -+ } -+ -+ sb.append('}'); -+ return sb.toString(); -+ } -+} ---- /dev/null -+++ org/spoutcraft/client/packet/PacketGenericItem.java -@@ -1,0 +1,52 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.client.packet; -+ -+import java.io.IOException; -+ -+import org.spoutcraft.api.io.SpoutInputStream; -+import org.spoutcraft.api.io.SpoutOutputStream; -+import org.spoutcraft.api.material.item.GenericCustomItem; -+ -+public class PacketGenericItem implements SpoutPacket { -+ GenericCustomItem item = new GenericCustomItem(); -+ -+ public void readData(SpoutInputStream input) throws IOException { -+ item.readData(input); -+ } -+ -+ public void writeData(SpoutOutputStream output) throws IOException { -+ item.writeData(output); -+ } -+ -+ public void run(int playerId) { -+ } -+ -+ public void failure(int playerId) { -+ } -+ -+ public PacketType getPacketType() { -+ return PacketType.PacketGenericItem; -+ } -+ -+ public int getVersion() { -+ return item.getVersion(); -+ } -+} ---- /dev/null -+++ org/spoutcraft/client/packet/PacketSetVelocity.java -@@ -1,0 +1,83 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.client.packet; -+ -+import java.io.IOException; -+ -+import net.minecraft.src.Entity; -+ -+import org.spoutcraft.api.io.SpoutInputStream; -+import org.spoutcraft.api.io.SpoutOutputStream; -+import org.spoutcraft.client.SpoutClient; -+ -+public class PacketSetVelocity implements SpoutPacket { -+ private double motX = 0; -+ private double motY = 0; -+ private double motZ = 0; -+ private int entityId = 0; -+ -+ public PacketSetVelocity() { -+ } -+ -+ public PacketSetVelocity(int entityId, double motX, double motY, double motZ) { -+ this.entityId = entityId; -+ this.motX = motX; -+ this.motY = motY; -+ this.motZ = motZ; -+ } -+ -+ public int getNumBytes() { -+ return 28; -+ } -+ -+ public void readData(SpoutInputStream input) throws IOException { -+ entityId = input.readInt(); -+ motX = input.readDouble(); -+ motY = input.readDouble(); -+ motZ = input.readDouble(); -+ } -+ -+ public void writeData(SpoutOutputStream output) throws IOException { -+ output.writeInt(entityId); -+ output.writeDouble(motX); -+ output.writeDouble(motY); -+ output.writeDouble(motZ); -+ } -+ -+ public void run(int playerId) { -+ Entity e = SpoutClient.getInstance().getEntityFromId(entityId); -+ if (e != null && !Double.isNaN(motX) && !Double.isNaN(motY) && !Double.isNaN(motZ)) { -+ e.motionX = motX; -+ e.motionY = motY; -+ e.motionZ = motZ; -+ } -+ } -+ -+ public void failure(int playerId) { -+ } -+ -+ public PacketType getPacketType() { -+ return PacketType.PacketSetVelocity; -+ } -+ -+ public int getVersion() { -+ return 1; -+ } -+} ---- net/minecraft/src/GuiFlatPresets.java -+++ net/minecraft/src/GuiFlatPresets.java -@@ -8,71 +8,94 @@ - import org.lwjgl.input.Keyboard; - - public class GuiFlatPresets extends GuiScreen { -+ -+ /** RenderItem instance used to render preset icons. */ - private static RenderItem presetIconRenderer = new RenderItem(); -- private static final List b = new ArrayList(); -+ -+ /** List of defined flat world presets. */ -+ private static final List presets = new ArrayList(); - private final GuiCreateFlatWorld createFlatWorldGui; -- private String d; -- private String e; -- private String p; -+ private String field_82300_d; -+ private String field_82308_m; -+ private String field_82306_n; - private GuiFlatPresetsListSlot theFlatPresetsListSlot; - private GuiButton theButton; - private GuiTextField theTextField; - -- public GuiFlatPresets(GuiCreateFlatWorld var1) { -- this.createFlatWorldGui = var1; -+ public GuiFlatPresets(GuiCreateFlatWorld par1GuiCreateFlatWorld) { -+ this.createFlatWorldGui = par1GuiCreateFlatWorld; - } - -+ /** -+ * Adds the buttons (and other controls) to the screen in question. -+ */ - public void initGui() { -- this.i.clear(); -+ this.buttonList.clear(); - Keyboard.enableRepeatEvents(true); -- this.d = I18n.getString("createWorld.customize.presets.title"); -- this.e = I18n.getString("createWorld.customize.presets.share"); -- this.p = I18n.getString("createWorld.customize.presets.list"); -+ this.field_82300_d = I18n.getString("createWorld.customize.presets.title"); -+ this.field_82308_m = I18n.getString("createWorld.customize.presets.share"); -+ this.field_82306_n = I18n.getString("createWorld.customize.presets.list"); - this.theTextField = new GuiTextField(this.fontRenderer, 50, 40, this.width - 100, 20); - this.theFlatPresetsListSlot = new GuiFlatPresetsListSlot(this); - this.theTextField.setMaxStringLength(1230); - this.theTextField.setText(this.createFlatWorldGui.getFlatGeneratorInfo()); -- this.i.add(this.theButton = new GuiButton(0, this.width / 2 - 155, this.height - 28, 150, 20, I18n.getString("createWorld.customize.presets.select"))); -- this.i.add(new GuiButton(1, this.width / 2 + 5, this.height - 28, 150, 20, I18n.getString("gui.cancel"))); -+ this.buttonList.add(this.theButton = new GuiButton(0, this.width / 2 - 155, this.height - 28, 150, 20, I18n.getString("createWorld.customize.presets.select"))); -+ this.buttonList.add(new GuiButton(1, this.width / 2 + 5, this.height - 28, 150, 20, I18n.getString("gui.cancel"))); - this.func_82296_g(); - } - -+ /** -+ * Called when the screen is unloaded. Used to disable keyboard repeat events -+ */ - public void onGuiClosed() { - Keyboard.enableRepeatEvents(false); - } - -- protected void mouseClicked(int var1, int var2, int var3) { -- this.theTextField.mouseClicked(var1, var2, var3); -- super.mouseClicked(var1, var2, var3); -+ /** -+ * Called when the mouse is clicked. -+ */ -+ protected void mouseClicked(int par1, int par2, int par3) { -+ this.theTextField.mouseClicked(par1, par2, par3); -+ super.mouseClicked(par1, par2, par3); - } - -- protected void keyTyped(char var1, int var2) { -- if(!this.theTextField.textboxKeyTyped(var1, var2)) { -- super.keyTyped(var1, var2); -+ /** -+ * Fired when a key is typed. This is the equivalent of KeyListener.keyTyped(KeyEvent e). -+ */ -+ protected void keyTyped(char par1, int par2) { -+ if (!this.theTextField.textboxKeyTyped(par1, par2)) { -+ super.keyTyped(par1, par2); - } -- - } - -- protected void actionPerformed(GuiButton var1) { -- if(var1.id == 0 && this.func_82293_j()) { -+ /** -+ * Fired when a control is clicked. This is the equivalent of ActionListener.actionPerformed(ActionEvent e). -+ */ -+ protected void actionPerformed(GuiButton par1GuiButton) { -+ if (par1GuiButton.id == 0 && this.func_82293_j()) { - this.createFlatWorldGui.setFlatGeneratorInfo(this.theTextField.getText()); - this.mc.displayGuiScreen(this.createFlatWorldGui); -- } else if(var1.id == 1) { -+ } else if (par1GuiButton.id == 1) { - this.mc.displayGuiScreen(this.createFlatWorldGui); - } -- - } - -- public void drawScreen(int var1, int var2, float var3) { -+ /** -+ * Draws the screen and all the components in it. -+ */ -+ public void drawScreen(int par1, int par2, float par3) { - this.drawDefaultBackground(); -- this.theFlatPresetsListSlot.drawScreen(var1, var2, var3); -- this.drawCenteredString(this.fontRenderer, this.d, this.width / 2, 8, 16777215); -- this.drawString(this.fontRenderer, this.e, 50, 30, 10526880); -- this.drawString(this.fontRenderer, this.p, 50, 70, 10526880); -+ this.theFlatPresetsListSlot.drawScreen(par1, par2, par3); -+ this.drawCenteredString(this.fontRenderer, this.field_82300_d, this.width / 2, 8, 16777215); -+ this.drawString(this.fontRenderer, this.field_82308_m, 50, 30, 10526880); -+ this.drawString(this.fontRenderer, this.field_82306_n, 50, 70, 10526880); - this.theTextField.drawTextBox(); -- super.drawScreen(var1, var2, var3); -+ super.drawScreen(par1, par2, par3); - } - -+ /** -+ * Called from the main game loop to update the screen. -+ */ - public void updateScreen() { - this.theTextField.updateCursorCounter(); - super.updateScreen(); -@@ -84,58 +107,71 @@ - } - - private boolean func_82293_j() { -- return this.theFlatPresetsListSlot.field_82459_a > -1 && this.theFlatPresetsListSlot.field_82459_a < b.size() || this.theTextField.getText().length() > 1; -- } -- -- private static void addPresetNoFeatures(String var0, int var1, BiomeGenBase var2, FlatLayerInfo... var3) { -- addPreset(var0, var1, var2, (List)null, var3); -- } -- -- private static void addPreset(String var0, int var1, BiomeGenBase var2, List var3, FlatLayerInfo... var4) { -+ return this.theFlatPresetsListSlot.field_82459_a > -1 && this.theFlatPresetsListSlot.field_82459_a < presets.size() || this.theTextField.getText().length() > 1; -+ } -+ -+ /** -+ * Add a flat world preset with no world features. -+ */ -+ private static void addPresetNoFeatures(String par0Str, int par1, BiomeGenBase par2BiomeGenBase, FlatLayerInfo ... par3ArrayOfFlatLayerInfo) { -+ addPreset(par0Str, par1, par2BiomeGenBase, (List)null, par3ArrayOfFlatLayerInfo); -+ } -+ -+ /** -+ * Add a flat world preset. -+ */ -+ private static void addPreset(String par0Str, int par1, BiomeGenBase par2BiomeGenBase, List par3List, FlatLayerInfo ... par4ArrayOfFlatLayerInfo) { - FlatGeneratorInfo var5 = new FlatGeneratorInfo(); - -- for(int var6 = var4.length - 1; var6 >= 0; --var6) { -- var5.getFlatLayers().add(var4[var6]); -+ for (int var6 = par4ArrayOfFlatLayerInfo.length - 1; var6 >= 0; --var6) { -+ var5.getFlatLayers().add(par4ArrayOfFlatLayerInfo[var6]); - } - -- var5.setBiome(var2.biomeID); -+ var5.setBiome(par2BiomeGenBase.biomeID); - var5.func_82645_d(); -- if(var3 != null) { -- Iterator var8 = var3.iterator(); -- -- while(var8.hasNext()) { -+ -+ if (par3List != null) { -+ Iterator var8 = par3List.iterator(); -+ -+ while (var8.hasNext()) { - String var7 = (String)var8.next(); - var5.getWorldFeatures().put(var7, new HashMap()); - } - } - -- b.add(new GuiFlatPresetsItem(var1, var0, var5.toString())); -+ presets.add(new GuiFlatPresetsItem(par1, par0Str, var5.toString())); - } - -+ /** -+ * Return the RenderItem instance used to render preset icons. -+ */ - static RenderItem getPresetIconRenderer() { - return presetIconRenderer; - } - -+ /** -+ * Return the list of defined flat world presets. -+ */ - static List getPresets() { -- return b; -- } -- -- static GuiFlatPresetsListSlot func_82292_a(GuiFlatPresets var0) { -- return var0.theFlatPresetsListSlot; -- } -- -- static GuiTextField func_82298_b(GuiFlatPresets var0) { -- return var0.theTextField; -+ return presets; -+ } -+ -+ static GuiFlatPresetsListSlot func_82292_a(GuiFlatPresets par0GuiFlatPresets) { -+ return par0GuiFlatPresets.theFlatPresetsListSlot; -+ } -+ -+ static GuiTextField func_82298_b(GuiFlatPresets par0GuiFlatPresets) { -+ return par0GuiFlatPresets.theTextField; - } - - static { -- addPreset("Classic Flat", Block.grass.blockID, BiomeGenBase.plains, Arrays.asList(new String[]{"village"}), new FlatLayerInfo[]{new FlatLayerInfo(1, Block.grass.blockID), new FlatLayerInfo(2, Block.dirt.blockID), new FlatLayerInfo(1, Block.bedrock.blockID)}); -- addPreset("Tunnelers\' Dream", Block.stone.blockID, BiomeGenBase.extremeHills, Arrays.asList(new String[]{"biome_1", "dungeon", "decoration", "stronghold", "mineshaft"}), new FlatLayerInfo[]{new FlatLayerInfo(1, Block.grass.blockID), new FlatLayerInfo(5, Block.dirt.blockID), new FlatLayerInfo(230, Block.stone.blockID), new FlatLayerInfo(1, Block.bedrock.blockID)}); -- addPreset("Water World", Block.waterMoving.blockID, BiomeGenBase.plains, Arrays.asList(new String[]{"village", "biome_1"}), new FlatLayerInfo[]{new FlatLayerInfo(90, Block.waterStill.blockID), new FlatLayerInfo(5, Block.sand.blockID), new FlatLayerInfo(5, Block.dirt.blockID), new FlatLayerInfo(5, Block.stone.blockID), new FlatLayerInfo(1, Block.bedrock.blockID)}); -- addPreset("Overworld", Block.tallGrass.blockID, BiomeGenBase.plains, Arrays.asList(new String[]{"village", "biome_1", "decoration", "stronghold", "mineshaft", "dungeon", "lake", "lava_lake"}), new FlatLayerInfo[]{new FlatLayerInfo(1, Block.grass.blockID), new FlatLayerInfo(3, Block.dirt.blockID), new FlatLayerInfo(59, Block.stone.blockID), new FlatLayerInfo(1, Block.bedrock.blockID)}); -- addPreset("Snowy Kingdom", Block.snow.blockID, BiomeGenBase.icePlains, Arrays.asList(new String[]{"village", "biome_1"}), new FlatLayerInfo[]{new FlatLayerInfo(1, Block.snow.blockID), new FlatLayerInfo(1, Block.grass.blockID), new FlatLayerInfo(3, Block.dirt.blockID), new FlatLayerInfo(59, Block.stone.blockID), new FlatLayerInfo(1, Block.bedrock.blockID)}); -- addPreset("Bottomless Pit", Item.feather.itemID, BiomeGenBase.plains, Arrays.asList(new String[]{"village", "biome_1"}), new FlatLayerInfo[]{new FlatLayerInfo(1, Block.grass.blockID), new FlatLayerInfo(3, Block.dirt.blockID), new FlatLayerInfo(2, Block.cobblestone.blockID)}); -- addPreset("Desert", Block.sand.blockID, BiomeGenBase.desert, Arrays.asList(new String[]{"village", "biome_1", "decoration", "stronghold", "mineshaft", "dungeon"}), new FlatLayerInfo[]{new FlatLayerInfo(8, Block.sand.blockID), new FlatLayerInfo(52, Block.sandStone.blockID), new FlatLayerInfo(3, Block.stone.blockID), new FlatLayerInfo(1, Block.bedrock.blockID)}); -- addPresetNoFeatures("Redstone Ready", Item.redstone.itemID, BiomeGenBase.desert, new FlatLayerInfo[]{new FlatLayerInfo(52, Block.sandStone.blockID), new FlatLayerInfo(3, Block.stone.blockID), new FlatLayerInfo(1, Block.bedrock.blockID)}); -+ addPreset("Classic Flat", Block.grass.blockID, BiomeGenBase.plains, Arrays.asList(new String[] {"village"}), new FlatLayerInfo[] {new FlatLayerInfo(1, Block.grass.blockID), new FlatLayerInfo(2, Block.dirt.blockID), new FlatLayerInfo(1, Block.bedrock.blockID)}); -+ addPreset("Tunnelers\' Dream", Block.stone.blockID, BiomeGenBase.extremeHills, Arrays.asList(new String[] {"biome_1", "dungeon", "decoration", "stronghold", "mineshaft"}), new FlatLayerInfo[] {new FlatLayerInfo(1, Block.grass.blockID), new FlatLayerInfo(5, Block.dirt.blockID), new FlatLayerInfo(230, Block.stone.blockID), new FlatLayerInfo(1, Block.bedrock.blockID)}); -+ addPreset("Water World", Block.waterMoving.blockID, BiomeGenBase.plains, Arrays.asList(new String[] {"village", "biome_1"}), new FlatLayerInfo[] {new FlatLayerInfo(90, Block.waterStill.blockID), new FlatLayerInfo(5, Block.sand.blockID), new FlatLayerInfo(5, Block.dirt.blockID), new FlatLayerInfo(5, Block.stone.blockID), new FlatLayerInfo(1, Block.bedrock.blockID)}); -+ addPreset("Overworld", Block.tallGrass.blockID, BiomeGenBase.plains, Arrays.asList(new String[] {"village", "biome_1", "decoration", "stronghold", "mineshaft", "dungeon", "lake", "lava_lake"}), new FlatLayerInfo[] {new FlatLayerInfo(1, Block.grass.blockID), new FlatLayerInfo(3, Block.dirt.blockID), new FlatLayerInfo(59, Block.stone.blockID), new FlatLayerInfo(1, Block.bedrock.blockID)}); -+ addPreset("Snowy Kingdom", Block.snow.blockID, BiomeGenBase.icePlains, Arrays.asList(new String[] {"village", "biome_1"}), new FlatLayerInfo[] {new FlatLayerInfo(1, Block.snow.blockID), new FlatLayerInfo(1, Block.grass.blockID), new FlatLayerInfo(3, Block.dirt.blockID), new FlatLayerInfo(59, Block.stone.blockID), new FlatLayerInfo(1, Block.bedrock.blockID)}); -+ addPreset("Bottomless Pit", Item.feather.itemID, BiomeGenBase.plains, Arrays.asList(new String[] {"village", "biome_1"}), new FlatLayerInfo[] {new FlatLayerInfo(1, Block.grass.blockID), new FlatLayerInfo(3, Block.dirt.blockID), new FlatLayerInfo(2, Block.cobblestone.blockID)}); -+ addPreset("Desert", Block.sand.blockID, BiomeGenBase.desert, Arrays.asList(new String[] {"village", "biome_1", "decoration", "stronghold", "mineshaft", "dungeon"}), new FlatLayerInfo[] {new FlatLayerInfo(8, Block.sand.blockID), new FlatLayerInfo(52, Block.sandStone.blockID), new FlatLayerInfo(3, Block.stone.blockID), new FlatLayerInfo(1, Block.bedrock.blockID)}); -+ addPresetNoFeatures("Redstone Ready", Item.redstone.itemID, BiomeGenBase.desert, new FlatLayerInfo[] {new FlatLayerInfo(52, Block.sandStone.blockID), new FlatLayerInfo(3, Block.stone.blockID), new FlatLayerInfo(1, Block.bedrock.blockID)}); - } - } ---- net/minecraft/src/NpcMerchant.java -+++ net/minecraft/src/NpcMerchant.java -@@ -1,33 +1,36 @@ - package net.minecraft.src; - - public class NpcMerchant implements IMerchant { -+ -+ /** Instance of Merchants Inventory. */ - private InventoryMerchant theMerchantInventory; -+ -+ /** This merchant's current player customer. */ - private EntityPlayer customer; -+ -+ /** The MerchantRecipeList instance. */ - private MerchantRecipeList recipeList; - -- public NpcMerchant(EntityPlayer var1) { -- this.customer = var1; -- this.theMerchantInventory = new InventoryMerchant(var1, this); -+ public NpcMerchant(EntityPlayer par1EntityPlayer) { -+ this.customer = par1EntityPlayer; -+ this.theMerchantInventory = new InventoryMerchant(par1EntityPlayer, this); - } - - public EntityPlayer getCustomer() { - return this.customer; - } - -- public void setCustomer(EntityPlayer var1) { -- } -+ public void setCustomer(EntityPlayer par1EntityPlayer) {} - -- public MerchantRecipeList getRecipes(EntityPlayer var1) { -+ public MerchantRecipeList getRecipes(EntityPlayer par1EntityPlayer) { - return this.recipeList; - } - -- public void setRecipes(MerchantRecipeList var1) { -- this.recipeList = var1; -- } -- -- public void useRecipe(MerchantRecipe var1) { -- } -- -- public void func_110297_a_(ItemStack var1) { -- } -+ public void setRecipes(MerchantRecipeList par1MerchantRecipeList) { -+ this.recipeList = par1MerchantRecipeList; -+ } -+ -+ public void useRecipe(MerchantRecipe par1MerchantRecipe) {} -+ -+ public void func_110297_a_(ItemStack par1ItemStack) {} - } ---- /dev/null -+++ org/spoutcraft/client/packet/PacketDownloadMusic.java -@@ -1,0 +1,103 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.client.packet; -+ -+import java.io.File; -+import java.io.IOException; -+ -+import org.spoutcraft.api.io.SpoutInputStream; -+import org.spoutcraft.api.io.SpoutOutputStream; -+import org.spoutcraft.client.SpoutClient; -+import org.spoutcraft.client.io.Download; -+import org.spoutcraft.client.io.FileDownloadThread; -+import org.spoutcraft.client.io.FileUtil; -+import org.spoutcraft.client.sound.QueuedSound; -+ -+public class PacketDownloadMusic implements SpoutPacket { -+ int x, y, z; -+ int volume, distance; -+ boolean soundEffect, notify; -+ String url, plugin; -+ public PacketDownloadMusic() { -+ } -+ -+ public void readData(SpoutInputStream input) throws IOException { -+ url = input.readString(); -+ plugin = input.readString(); -+ distance = input.readInt(); -+ x = input.readInt(); -+ y = input.readInt(); -+ z = input.readInt(); -+ volume = input.readInt(); -+ soundEffect = input.readBoolean(); -+ notify = input.readBoolean(); -+ } -+ -+ public void writeData(SpoutOutputStream output) throws IOException { -+ output.writeString(url); -+ output.writeString(plugin); -+ output.writeInt(distance); -+ output.writeInt(x); -+ output.writeInt(y); -+ output.writeInt(z); -+ output.writeInt(volume); -+ output.writeBoolean(soundEffect); -+ output.writeBoolean(notify); -+ } -+ -+ public void run(int PlayerId) { -+ File directory = new File(FileUtil.getTempDir(), plugin); -+ if (!directory.exists()) { -+ directory.mkdir(); -+ } -+ String fileName = FileUtil.getFileName(url); -+ if (!FileUtil.isAudioFile(fileName)) { -+ System.out.println("Rejecting download of invalid audio: " + fileName); -+ return; -+ } -+ File song = FileUtil.findFile(plugin, fileName); -+ if (song != null && song.exists()) { -+ QueuedSound action = new QueuedSound(song, x, y, z, volume, distance, soundEffect); -+ action.run(); -+ return; -+ } else { -+ song = new File(directory, fileName); -+ } -+ -+ QueuedSound action = new QueuedSound(song, x, y, z, volume, distance, soundEffect); -+ Download download = new Download(fileName, directory, url, action); -+ action.setNotify(!download.isDownloaded() && notify); -+ if (!download.isDownloaded() && notify) { -+ SpoutClient.getInstance().getActivePlayer().showAchievement("Downloading Music...", fileName, 2256 /*Gold Record*/); -+ } -+ FileDownloadThread.getInstance().addToDownloadQueue(download); -+ } -+ -+ public PacketType getPacketType() { -+ return PacketType.PacketDownloadMusic; -+ } -+ -+ public int getVersion() { -+ return 0; -+ } -+ -+ public void failure(int playerId) { -+ } -+} ---- /dev/null -+++ org/spoutcraft/client/entity/RenderTexture.java -@@ -1,0 +1,62 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.client.entity; -+ -+import org.lwjgl.opengl.GL11; -+ -+import net.minecraft.src.Entity; -+import net.minecraft.src.RenderEntity; -+import net.minecraft.src.RenderHelper; -+import net.minecraft.src.Tessellator; -+ -+import org.spoutcraft.client.SpoutClient; -+import org.spoutcraft.client.io.CustomTextureManager; -+ -+public class RenderTexture extends RenderEntity { -+ @Override -+ public void doRender(Entity entity, double x, double y, double z, float yaw, float pitch) { -+ EntityTexture entityT = (EntityTexture) entity; -+ if (entityT.texture == null) { -+ entityT.texture = CustomTextureManager.getTextureFromUrl(entityT.getUrl()); -+ if (entityT.texture == null) { -+ return; -+ } -+ } -+ GL11.glPushMatrix(); -+ RenderHelper.disableStandardItemLighting(); -+ yaw = entityT.isRotateWithPlayer()?-this.renderManager.playerViewY:yaw; -+ GL11.glTranslated(x, y, z); -+ GL11.glRotatef(yaw, 0, 1.0F, 0); -+ GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); -+ SpoutClient.getHandle().renderEngine.bindTexture(entityT.texture.getTextureID()); -+ Tessellator tessellator = Tessellator.instance; -+ tessellator.startDrawingQuads(); -+ double h = entityT.height * 0.014; -+ double w = entityT.width * 0.014; -+ tessellator.addVertexWithUV(w/2, -h/2, 0, 0.0D, 0.0D); // Draw corners -+ tessellator.addVertexWithUV(-w/2, -h/2, 0, entityT.texture.getWidth(), 0.0D); -+ tessellator.addVertexWithUV(-w/2, h/2, 0, entityT.texture.getWidth(), entityT.texture.getHeight()); -+ tessellator.addVertexWithUV(w/2, h/2, 0, 0.0D, entityT.texture.getHeight()); -+ tessellator.draw(); -+ GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); -+ RenderHelper.enableStandardItemLighting(); -+ GL11.glPopMatrix(); -+ } -+} ---- net/minecraft/src/MapGenCaves.java -+++ net/minecraft/src/MapGenCaves.java -@@ -3,109 +3,123 @@ - import java.util.Random; - - public class MapGenCaves extends MapGenBase { -- protected void generateLargeCaveNode(long var1, int var3, int var4, byte[] var5, double var6, double var8, double var10) { -- this.generateCaveNode(var1, var3, var4, var5, var6, var8, var10, 1.0F + this.b.nextFloat() * 6.0F, 0.0F, 0.0F, -1, -1, 0.5D); -+ -+ /** -+ * Generates a larger initial cave node than usual. Called 25% of the time. -+ */ -+ protected void generateLargeCaveNode(long par1, int par3, int par4, byte[] par5ArrayOfByte, double par6, double par8, double par10) { -+ this.generateCaveNode(par1, par3, par4, par5ArrayOfByte, par6, par8, par10, 1.0F + this.rand.nextFloat() * 6.0F, 0.0F, 0.0F, -1, -1, 0.5D); - } - -- protected void generateCaveNode(long var1, int var3, int var4, byte[] var5, double var6, double var8, double var10, float var12, float var13, float var14, int var15, int var16, double var17) { -- double var19 = (double)(var3 * 16 + 8); -- double var21 = (double)(var4 * 16 + 8); -+ /** -+ * Generates a node in the current cave system recursion tree. -+ */ -+ protected void generateCaveNode(long par1, int par3, int par4, byte[] par5ArrayOfByte, double par6, double par8, double par10, float par12, float par13, float par14, int par15, int par16, double par17) { -+ double var19 = (double)(par3 * 16 + 8); -+ double var21 = (double)(par4 * 16 + 8); - float var23 = 0.0F; - float var24 = 0.0F; -- Random var25 = new Random(var1); -- if(var16 <= 0) { -+ Random var25 = new Random(par1); -+ -+ if (par16 <= 0) { - int var26 = this.range * 16 - 16; -- var16 = var26 - var25.nextInt(var26 / 4); -+ par16 = var26 - var25.nextInt(var26 / 4); - } - - boolean var54 = false; -- if(var15 == -1) { -- var15 = var16 / 2; -+ -+ if (par15 == -1) { -+ par15 = par16 / 2; - var54 = true; - } - -- int var27 = var25.nextInt(var16 / 2) + var16 / 4; -- -- for(boolean var28 = var25.nextInt(6) == 0; var15 < var16; ++var15) { -- double var29 = 1.5D + (double)(MathHelper.sin((float)var15 * (float)Math.PI / (float)var16) * var12 * 1.0F); -- double var31 = var29 * var17; -- float var33 = MathHelper.cos(var14); -- float var34 = MathHelper.sin(var14); -- var6 += (double)(MathHelper.cos(var13) * var33); -- var8 += (double)var34; -- var10 += (double)(MathHelper.sin(var13) * var33); -- if(var28) { -- var14 *= 0.92F; -+ int var27 = var25.nextInt(par16 / 2) + par16 / 4; -+ -+ for (boolean var28 = var25.nextInt(6) == 0; par15 < par16; ++par15) { -+ double var29 = 1.5D + (double)(MathHelper.sin((float)par15 * (float)Math.PI / (float)par16) * par12 * 1.0F); -+ double var31 = var29 * par17; -+ float var33 = MathHelper.cos(par14); -+ float var34 = MathHelper.sin(par14); -+ par6 += (double)(MathHelper.cos(par13) * var33); -+ par8 += (double)var34; -+ par10 += (double)(MathHelper.sin(par13) * var33); -+ -+ if (var28) { -+ par14 *= 0.92F; - } else { -- var14 *= 0.7F; -+ par14 *= 0.7F; - } - -- var14 += var24 * 0.1F; -- var13 += var23 * 0.1F; -+ par14 += var24 * 0.1F; -+ par13 += var23 * 0.1F; - var24 *= 0.9F; -- var23 *= 12.0F / 16.0F; -+ var23 *= 0.75F; - var24 += (var25.nextFloat() - var25.nextFloat()) * var25.nextFloat() * 2.0F; - var23 += (var25.nextFloat() - var25.nextFloat()) * var25.nextFloat() * 4.0F; -- if(!var54 && var15 == var27 && var12 > 1.0F && var16 > 0) { -- this.generateCaveNode(var25.nextLong(), var3, var4, var5, var6, var8, var10, var25.nextFloat() * 0.5F + 0.5F, var13 - (float)Math.PI * 0.5F, var14 / 3.0F, var15, var16, 1.0D); -- this.generateCaveNode(var25.nextLong(), var3, var4, var5, var6, var8, var10, var25.nextFloat() * 0.5F + 0.5F, var13 + (float)Math.PI * 0.5F, var14 / 3.0F, var15, var16, 1.0D); -+ -+ if (!var54 && par15 == var27 && par12 > 1.0F && par16 > 0) { -+ this.generateCaveNode(var25.nextLong(), par3, par4, par5ArrayOfByte, par6, par8, par10, var25.nextFloat() * 0.5F + 0.5F, par13 - ((float)Math.PI / 2F), par14 / 3.0F, par15, par16, 1.0D); -+ this.generateCaveNode(var25.nextLong(), par3, par4, par5ArrayOfByte, par6, par8, par10, var25.nextFloat() * 0.5F + 0.5F, par13 + ((float)Math.PI / 2F), par14 / 3.0F, par15, par16, 1.0D); - return; - } - -- if(var54 || var25.nextInt(4) != 0) { -- double var35 = var6 - var19; -- double var37 = var10 - var21; -- double var39 = (double)(var16 - var15); -- double var41 = (double)(var12 + 2.0F + 16.0F); -- if(var35 * var35 + var37 * var37 - var39 * var39 > var41 * var41) { -+ if (var54 || var25.nextInt(4) != 0) { -+ double var35 = par6 - var19; -+ double var37 = par10 - var21; -+ double var39 = (double)(par16 - par15); -+ double var41 = (double)(par12 + 2.0F + 16.0F); -+ -+ if (var35 * var35 + var37 * var37 - var39 * var39 > var41 * var41) { - return; - } - -- if(var6 >= var19 - 16.0D - var29 * 2.0D && var10 >= var21 - 16.0D - var29 * 2.0D && var6 <= var19 + 16.0D + var29 * 2.0D && var10 <= var21 + 16.0D + var29 * 2.0D) { -- int var55 = MathHelper.floor_double(var6 - var29) - var3 * 16 - 1; -- int var36 = MathHelper.floor_double(var6 + var29) - var3 * 16 + 1; -- int var56 = MathHelper.floor_double(var8 - var31) - 1; -- int var38 = MathHelper.floor_double(var8 + var31) + 1; -- int var57 = MathHelper.floor_double(var10 - var29) - var4 * 16 - 1; -- int var40 = MathHelper.floor_double(var10 + var29) - var4 * 16 + 1; -- if(var55 < 0) { -+ if (par6 >= var19 - 16.0D - var29 * 2.0D && par10 >= var21 - 16.0D - var29 * 2.0D && par6 <= var19 + 16.0D + var29 * 2.0D && par10 <= var21 + 16.0D + var29 * 2.0D) { -+ int var55 = MathHelper.floor_double(par6 - var29) - par3 * 16 - 1; -+ int var36 = MathHelper.floor_double(par6 + var29) - par3 * 16 + 1; -+ int var56 = MathHelper.floor_double(par8 - var31) - 1; -+ int var38 = MathHelper.floor_double(par8 + var31) + 1; -+ int var57 = MathHelper.floor_double(par10 - var29) - par4 * 16 - 1; -+ int var40 = MathHelper.floor_double(par10 + var29) - par4 * 16 + 1; -+ -+ if (var55 < 0) { - var55 = 0; - } - -- if(var36 > 16) { -+ if (var36 > 16) { - var36 = 16; - } - -- if(var56 < 1) { -+ if (var56 < 1) { - var56 = 1; - } - -- if(var38 > 120) { -+ if (var38 > 120) { - var38 = 120; - } - -- if(var57 < 0) { -+ if (var57 < 0) { - var57 = 0; - } - -- if(var40 > 16) { -+ if (var40 > 16) { - var40 = 16; - } - - boolean var58 = false; -- - int var42; - int var45; -- for(var42 = var55; !var58 && var42 < var36; ++var42) { -- for(int var43 = var57; !var58 && var43 < var40; ++var43) { -- for(int var44 = var38 + 1; !var58 && var44 >= var56 - 1; --var44) { -+ -+ for (var42 = var55; !var58 && var42 < var36; ++var42) { -+ for (int var43 = var57; !var58 && var43 < var40; ++var43) { -+ for (int var44 = var38 + 1; !var58 && var44 >= var56 - 1; --var44) { - var45 = (var42 * 16 + var43) * 128 + var44; -- if(var44 >= 0 && var44 < 128) { -- if(var5[var45] == Block.waterMoving.blockID || var5[var45] == Block.waterStill.blockID) { -+ -+ if (var44 >= 0 && var44 < 128) { -+ if (par5ArrayOfByte[var45] == Block.waterMoving.blockID || par5ArrayOfByte[var45] == Block.waterStill.blockID) { - var58 = true; - } - -- if(var44 != var56 - 1 && var42 != var55 && var42 != var36 - 1 && var43 != var57 && var43 != var40 - 1) { -+ if (var44 != var56 - 1 && var42 != var55 && var42 != var36 - 1 && var43 != var57 && var43 != var40 - 1) { - var44 = var56; - } - } -@@ -113,30 +127,34 @@ - } - } - -- if(!var58) { -- for(var42 = var55; var42 < var36; ++var42) { -- double var59 = ((double)(var42 + var3 * 16) + 0.5D - var6) / var29; -+ if (!var58) { -+ for (var42 = var55; var42 < var36; ++var42) { -+ double var59 = ((double)(var42 + par3 * 16) + 0.5D - par6) / var29; - -- for(var45 = var57; var45 < var40; ++var45) { -- double var46 = ((double)(var45 + var4 * 16) + 0.5D - var10) / var29; -+ for (var45 = var57; var45 < var40; ++var45) { -+ double var46 = ((double)(var45 + par4 * 16) + 0.5D - par10) / var29; - int var48 = (var42 * 16 + var45) * 128 + var38; - boolean var49 = false; -- if(var59 * var59 + var46 * var46 < 1.0D) { -- for(int var50 = var38 - 1; var50 >= var56; --var50) { -- double var51 = ((double)var50 + 0.5D - var8) / var31; -- if(var51 > -0.7D && var59 * var59 + var51 * var51 + var46 * var46 < 1.0D) { -- byte var53 = var5[var48]; -- if(var53 == Block.grass.blockID) { -+ -+ if (var59 * var59 + var46 * var46 < 1.0D) { -+ for (int var50 = var38 - 1; var50 >= var56; --var50) { -+ double var51 = ((double)var50 + 0.5D - par8) / var31; -+ -+ if (var51 > -0.7D && var59 * var59 + var51 * var51 + var46 * var46 < 1.0D) { -+ byte var53 = par5ArrayOfByte[var48]; -+ -+ if (var53 == Block.grass.blockID) { - var49 = true; - } - -- if(var53 == Block.stone.blockID || var53 == Block.dirt.blockID || var53 == Block.grass.blockID) { -- if(var50 < 10) { -- var5[var48] = (byte)Block.lavaMoving.blockID; -+ if (var53 == Block.stone.blockID || var53 == Block.dirt.blockID || var53 == Block.grass.blockID) { -+ if (var50 < 10) { -+ par5ArrayOfByte[var48] = (byte)Block.lavaMoving.blockID; - } else { -- var5[var48] = 0; -- if(var49 && var5[var48 - 1] == Block.dirt.blockID) { -- var5[var48 - 1] = this.worldObj.getBiomeGenForCoords(var42 + var3 * 16, var45 + var4 * 16).topBlock; -+ par5ArrayOfByte[var48] = 0; -+ -+ if (var49 && par5ArrayOfByte[var48 - 1] == Block.dirt.blockID) { -+ par5ArrayOfByte[var48 - 1] = this.worldObj.getBiomeGenForCoords(var42 + par3 * 16, var45 + par4 * 16).topBlock; - } - } - } -@@ -148,43 +166,47 @@ - } - } - -- if(var54) { -+ if (var54) { - break; - } - } - } - } - } -- - } - -- protected void recursiveGenerate(World var1, int var2, int var3, int var4, int var5, byte[] var6) { -- int var7 = this.b.nextInt(this.b.nextInt(this.b.nextInt(40) + 1) + 1); -- if(this.b.nextInt(15) != 0) { -+ /** -+ * Recursively called by generate() (generate) and optionally by itself. -+ */ -+ protected void recursiveGenerate(World par1World, int par2, int par3, int par4, int par5, byte[] par6ArrayOfByte) { -+ int var7 = this.rand.nextInt(this.rand.nextInt(this.rand.nextInt(40) + 1) + 1); -+ -+ if (this.rand.nextInt(15) != 0) { - var7 = 0; - } - -- for(int var8 = 0; var8 < var7; ++var8) { -- double var9 = (double)(var2 * 16 + this.b.nextInt(16)); -- double var11 = (double)this.b.nextInt(this.b.nextInt(120) + 8); -- double var13 = (double)(var3 * 16 + this.b.nextInt(16)); -+ for (int var8 = 0; var8 < var7; ++var8) { -+ double var9 = (double)(par2 * 16 + this.rand.nextInt(16)); -+ double var11 = (double)this.rand.nextInt(this.rand.nextInt(120) + 8); -+ double var13 = (double)(par3 * 16 + this.rand.nextInt(16)); - int var15 = 1; -- if(this.b.nextInt(4) == 0) { -- this.generateLargeCaveNode(this.b.nextLong(), var4, var5, var6, var9, var11, var13); -- var15 += this.b.nextInt(4); -+ -+ if (this.rand.nextInt(4) == 0) { -+ this.generateLargeCaveNode(this.rand.nextLong(), par4, par5, par6ArrayOfByte, var9, var11, var13); -+ var15 += this.rand.nextInt(4); - } - -- for(int var16 = 0; var16 < var15; ++var16) { -- float var17 = this.b.nextFloat() * (float)Math.PI * 2.0F; -- float var18 = (this.b.nextFloat() - 0.5F) * 2.0F / 8.0F; -- float var19 = this.b.nextFloat() * 2.0F + this.b.nextFloat(); -- if(this.b.nextInt(10) == 0) { -- var19 *= this.b.nextFloat() * this.b.nextFloat() * 3.0F + 1.0F; -+ for (int var16 = 0; var16 < var15; ++var16) { -+ float var17 = this.rand.nextFloat() * (float)Math.PI * 2.0F; -+ float var18 = (this.rand.nextFloat() - 0.5F) * 2.0F / 8.0F; -+ float var19 = this.rand.nextFloat() * 2.0F + this.rand.nextFloat(); -+ -+ if (this.rand.nextInt(10) == 0) { -+ var19 *= this.rand.nextFloat() * this.rand.nextFloat() * 3.0F + 1.0F; - } - -- this.generateCaveNode(this.b.nextLong(), var4, var5, var6, var9, var11, var13, var19, var17, var18, 0, 0, 1.0D); -+ this.generateCaveNode(this.rand.nextLong(), par4, par5, par6ArrayOfByte, var9, var11, var13, var19, var17, var18, 0, 0, 1.0D); - } - } -- - } - } ---- /dev/null -+++ org/spoutcraft/client/gui/error/PasteBinAPI.java -@@ -1,0 +1,111 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.client.gui.error; -+ -+import java.io.BufferedReader; -+import java.io.DataOutputStream; -+import java.io.InputStream; -+import java.io.InputStreamReader; -+import java.io.UnsupportedEncodingException; -+import java.net.HttpURLConnection; -+import java.net.URL; -+import java.net.URLEncoder; -+ -+class PasteBinAPI { -+ private final static String pasteURL = "http://www.pastebin.com/api/api_post.php"; -+ private String token; -+ private String devkey; -+ -+ public PasteBinAPI(String devkey) { -+ this.devkey = devkey; -+ } -+ -+ public String checkResponse(String response) { -+ if (response.substring(0, 15) == "Bad API request") -+ return response.substring(17); -+ return ""; -+ } -+ -+ public String makePaste(String message, String name, String format) throws UnsupportedEncodingException { -+ String content = URLEncoder.encode(message, "UTF-8"); -+ String title = URLEncoder.encode(name, "UTF-8"); -+ String data = "api_option=paste&api_user_key=" + this.token -+ + "&api_paste_private=0&api_paste_name=" + title -+ + "&api_paste_expire_date=N&api_paste_format=" + format -+ + "&api_dev_key=" + this.devkey + "&api_paste_code=" + content; -+ String response = this.page(pasteURL, data); -+ String check = this.checkResponse(response); -+ if (!check.equals("")) -+ return check; -+ return response; -+ } -+ -+ public String page(String uri, String urlParameters) { -+ URL url; -+ HttpURLConnection connection = null; -+ try { -+ // Create connection -+ url = new URL(uri); -+ connection = (HttpURLConnection) url.openConnection(); -+ connection.setRequestMethod("POST"); -+ connection.setRequestProperty("Content-Type", -+ "application/x-www-form-urlencoded"); -+ -+ connection.setRequestProperty("Content-Length", -+ "" + Integer.toString(urlParameters.getBytes().length)); -+ connection.setRequestProperty("Content-Language", "en-US"); -+ -+ connection.setUseCaches(false); -+ connection.setDoInput(true); -+ connection.setDoOutput(true); -+ -+ // Send request -+ DataOutputStream wr = new DataOutputStream( -+ connection.getOutputStream()); -+ wr.writeBytes(urlParameters); -+ wr.flush(); -+ wr.close(); -+ -+ // Get Response -+ InputStream is = connection.getInputStream(); -+ BufferedReader rd = new BufferedReader(new InputStreamReader(is)); -+ String line; -+ StringBuffer response = new StringBuffer(); -+ while ((line = rd.readLine()) != null) { -+ response.append(line); -+ } -+ rd.close(); -+ return response.toString(); -+ -+ } catch (Exception e) { -+ e.printStackTrace(); -+ return null; -+ -+ } finally { -+ if (connection != null) { -+ connection.disconnect(); -+ } -+ } -+ } -+ -+ public void setToken(String token) { -+ this.token = token; -+ } -+} ---- net/minecraft/src/MobSpawnerBaseLogic.java -+++ net/minecraft/src/MobSpawnerBaseLogic.java -@@ -1,148 +1,166 @@ - package net.minecraft.src; - - import java.util.ArrayList; --import java.util.Collection; - import java.util.Iterator; - import java.util.List; - - public abstract class MobSpawnerBaseLogic { -+ -+ /** The delay to spawn. */ - public int spawnDelay = 20; -- private String a = "Pig"; -- private List e; -+ private String mobID = "Pig"; -+ -+ /** List of minecart to spawn. */ -+ private List minecartToSpawn; - private WeightedRandomMinecart randomMinecart; - public double field_98287_c; - public double field_98284_d; - private int minSpawnDelay = 200; - private int maxSpawnDelay = 800; -+ -+ /** A counter for spawn tries. */ - private int spawnCount = 4; - private Entity field_98291_j; - private int maxNearbyEntities = 6; -+ -+ /** The distance from which a player activates the spawner. */ - private int activatingRangeFromPlayer = 16; -+ -+ /** The range coefficient for spawning entities around. */ - private int spawnRange = 4; - -+ /** -+ * Gets the entity name that should be spawned. -+ */ - public String getEntityNameToSpawn() { -- if(this.getRandomMinecart() == null) { -- if(this.a.equals("Minecart")) { -- this.a = "MinecartRideable"; -+ if (this.getRandomMinecart() == null) { -+ if (this.mobID.equals("Minecart")) { -+ this.mobID = "MinecartRideable"; - } - -- return this.a; -+ return this.mobID; - } else { -- return this.getRandomMinecart().c; -+ return this.getRandomMinecart().minecartName; - } - } - -- public void setMobID(String var1) { -- this.a = var1; -+ public void setMobID(String par1Str) { -+ this.mobID = par1Str; - } - -+ /** -+ * Returns true if there's a player close enough to this mob spawner to activate it. -+ */ - public boolean canRun() { - return this.getSpawnerWorld().getClosestPlayer((double)this.getSpawnerX() + 0.5D, (double)this.getSpawnerY() + 0.5D, (double)this.getSpawnerZ() + 0.5D, (double)this.activatingRangeFromPlayer) != null; - } - - public void updateSpawner() { -- if(this.canRun()) { -+ if (this.canRun()) { - double var5; -- if(this.getSpawnerWorld().isRemote) { -- double var12 = (double)((float)this.getSpawnerX() + this.getSpawnerWorld().s.nextFloat()); -- double var13 = (double)((float)this.getSpawnerY() + this.getSpawnerWorld().s.nextFloat()); -- var5 = (double)((float)this.getSpawnerZ() + this.getSpawnerWorld().s.nextFloat()); -- this.getSpawnerWorld().spawnParticle("smoke", var12, var13, var5, 0.0D, 0.0D, 0.0D); -- this.getSpawnerWorld().spawnParticle("flame", var12, var13, var5, 0.0D, 0.0D, 0.0D); -- if(this.spawnDelay > 0) { -+ -+ if (this.getSpawnerWorld().isRemote) { -+ double var1 = (double)((float)this.getSpawnerX() + this.getSpawnerWorld().rand.nextFloat()); -+ double var3 = (double)((float)this.getSpawnerY() + this.getSpawnerWorld().rand.nextFloat()); -+ var5 = (double)((float)this.getSpawnerZ() + this.getSpawnerWorld().rand.nextFloat()); -+ this.getSpawnerWorld().spawnParticle("smoke", var1, var3, var5, 0.0D, 0.0D, 0.0D); -+ this.getSpawnerWorld().spawnParticle("flame", var1, var3, var5, 0.0D, 0.0D, 0.0D); -+ -+ if (this.spawnDelay > 0) { - --this.spawnDelay; - } - - this.field_98284_d = this.field_98287_c; - this.field_98287_c = (this.field_98287_c + (double)(1000.0F / ((float)this.spawnDelay + 200.0F))) % 360.0D; - } else { -- if(this.spawnDelay == -1) { -+ if (this.spawnDelay == -1) { - this.func_98273_j(); - } - -- if(this.spawnDelay > 0) { -+ if (this.spawnDelay > 0) { - --this.spawnDelay; - return; - } - -- boolean var1 = false; -- int var2 = 0; -- -- while(true) { -- if(var2 >= this.spawnCount) { -- if(var1) { -- this.func_98273_j(); -- } -- break; -- } -- -- Entity var3 = EntityList.createEntityByName(this.getEntityNameToSpawn(), this.getSpawnerWorld()); -- if(var3 == null) { -+ boolean var12 = false; -+ -+ for (int var2 = 0; var2 < this.spawnCount; ++var2) { -+ Entity var13 = EntityList.createEntityByName(this.getEntityNameToSpawn(), this.getSpawnerWorld()); -+ -+ if (var13 == null) { - return; - } - -- int var4 = this.getSpawnerWorld().getEntitiesWithinAABB(var3.getClass(), AxisAlignedBB.getAABBPool().getAABB((double)this.getSpawnerX(), (double)this.getSpawnerY(), (double)this.getSpawnerZ(), (double)(this.getSpawnerX() + 1), (double)(this.getSpawnerY() + 1), (double)(this.getSpawnerZ() + 1)).expand((double)(this.spawnRange * 2), 4.0D, (double)(this.spawnRange * 2))).size(); -- if(var4 >= this.maxNearbyEntities) { -+ int var4 = this.getSpawnerWorld().getEntitiesWithinAABB(var13.getClass(), AxisAlignedBB.getAABBPool().getAABB((double)this.getSpawnerX(), (double)this.getSpawnerY(), (double)this.getSpawnerZ(), (double)(this.getSpawnerX() + 1), (double)(this.getSpawnerY() + 1), (double)(this.getSpawnerZ() + 1)).expand((double)(this.spawnRange * 2), 4.0D, (double)(this.spawnRange * 2))).size(); -+ -+ if (var4 >= this.maxNearbyEntities) { - this.func_98273_j(); - return; - } - -- var5 = (double)this.getSpawnerX() + (this.getSpawnerWorld().s.nextDouble() - this.getSpawnerWorld().s.nextDouble()) * (double)this.spawnRange; -- double var7 = (double)(this.getSpawnerY() + this.getSpawnerWorld().s.nextInt(3) - 1); -- double var9 = (double)this.getSpawnerZ() + (this.getSpawnerWorld().s.nextDouble() - this.getSpawnerWorld().s.nextDouble()) * (double)this.spawnRange; -- EntityLiving var11 = var3 instanceof EntityLiving ? (EntityLiving)var3 : null; -- var3.setLocationAndAngles(var5, var7, var9, this.getSpawnerWorld().s.nextFloat() * 360.0F, 0.0F); -- if(var11 == null || var11.getCanSpawnHere()) { -- this.func_98265_a(var3); -+ var5 = (double)this.getSpawnerX() + (this.getSpawnerWorld().rand.nextDouble() - this.getSpawnerWorld().rand.nextDouble()) * (double)this.spawnRange; -+ double var7 = (double)(this.getSpawnerY() + this.getSpawnerWorld().rand.nextInt(3) - 1); -+ double var9 = (double)this.getSpawnerZ() + (this.getSpawnerWorld().rand.nextDouble() - this.getSpawnerWorld().rand.nextDouble()) * (double)this.spawnRange; -+ EntityLiving var11 = var13 instanceof EntityLiving ? (EntityLiving)var13 : null; -+ var13.setLocationAndAngles(var5, var7, var9, this.getSpawnerWorld().rand.nextFloat() * 360.0F, 0.0F); -+ -+ if (var11 == null || var11.getCanSpawnHere()) { -+ this.func_98265_a(var13); - this.getSpawnerWorld().playAuxSFX(2004, this.getSpawnerX(), this.getSpawnerY(), this.getSpawnerZ(), 0); -- if(var11 != null) { -+ -+ if (var11 != null) { - var11.spawnExplosionParticle(); - } - -- var1 = true; -+ var12 = true; - } -+ } - -- ++var2; -+ if (var12) { -+ this.func_98273_j(); - } - } -- - } - } - -- public Entity func_98265_a(Entity var1) { -- if(this.getRandomMinecart() != null) { -+ public Entity func_98265_a(Entity par1Entity) { -+ if (this.getRandomMinecart() != null) { - NBTTagCompound var2 = new NBTTagCompound(); -- var1.writeToNBTOptional(var2); -+ par1Entity.writeToNBTOptional(var2); - Iterator var3 = this.getRandomMinecart().field_98222_b.getTags().iterator(); - -- while(var3.hasNext()) { -+ while (var3.hasNext()) { - NBTBase var4 = (NBTBase)var3.next(); - var2.setTag(var4.getName(), var4.copy()); - } - -- var1.readFromNBT(var2); -- if(var1.worldObj != null) { -- var1.worldObj.spawnEntityInWorld(var1); -+ par1Entity.readFromNBT(var2); -+ -+ if (par1Entity.worldObj != null) { -+ par1Entity.worldObj.spawnEntityInWorld(par1Entity); - } - - NBTTagCompound var10; -- for(Entity var9 = var1; var2.hasKey("Riding"); var2 = var10) { -+ -+ for (Entity var9 = par1Entity; var2.hasKey("Riding"); var2 = var10) { - var10 = var2.getCompoundTag("Riding"); -- Entity var5 = EntityList.createEntityByName(var10.getString("id"), var1.worldObj); -- if(var5 != null) { -+ Entity var5 = EntityList.createEntityByName(var10.getString("id"), par1Entity.worldObj); -+ -+ if (var5 != null) { - NBTTagCompound var6 = new NBTTagCompound(); - var5.writeToNBTOptional(var6); - Iterator var7 = var10.getTags().iterator(); - -- while(var7.hasNext()) { -+ while (var7.hasNext()) { - NBTBase var8 = (NBTBase)var7.next(); - var6.setTag(var8.getName(), var8.copy()); - } - - var5.readFromNBT(var6); - var5.setLocationAndAngles(var9.posX, var9.posY, var9.posZ, var9.rotationYaw, var9.rotationPitch); -- if(var1.worldObj != null) { -- var1.worldObj.spawnEntityInWorld(var5); -+ -+ if (par1Entity.worldObj != null) { -+ par1Entity.worldObj.spawnEntityInWorld(var5); - } - - var9.mountEntity(var5); -@@ -150,89 +168,91 @@ - - var9 = var5; - } -- } else if(var1 instanceof EntityLivingBase && var1.worldObj != null) { -- ((EntityLiving)var1).onSpawnWithEgg((EntityLivingData)null); -- this.getSpawnerWorld().spawnEntityInWorld(var1); -+ } else if (par1Entity instanceof EntityLivingBase && par1Entity.worldObj != null) { -+ ((EntityLiving)par1Entity).onSpawnWithEgg((EntityLivingData)null); -+ this.getSpawnerWorld().spawnEntityInWorld(par1Entity); - } - -- return var1; -+ return par1Entity; - } - - private void func_98273_j() { -- if(this.maxSpawnDelay <= this.minSpawnDelay) { -+ if (this.maxSpawnDelay <= this.minSpawnDelay) { - this.spawnDelay = this.minSpawnDelay; - } else { - int var10003 = this.maxSpawnDelay - this.minSpawnDelay; -- this.spawnDelay = this.minSpawnDelay + this.getSpawnerWorld().s.nextInt(var10003); -+ this.spawnDelay = this.minSpawnDelay + this.getSpawnerWorld().rand.nextInt(var10003); - } - -- if(this.e != null && this.e.size() > 0) { -- this.setRandomMinecart((WeightedRandomMinecart)WeightedRandom.getRandomItem(this.getSpawnerWorld().s, (Collection)this.e)); -+ if (this.minecartToSpawn != null && this.minecartToSpawn.size() > 0) { -+ this.setRandomMinecart((WeightedRandomMinecart)WeightedRandom.getRandomItem(this.getSpawnerWorld().rand, this.minecartToSpawn)); - } - - this.func_98267_a(1); - } - -- public void readFromNBT(NBTTagCompound var1) { -- this.a = var1.getString("EntityId"); -- this.spawnDelay = var1.getShort("Delay"); -- if(var1.hasKey("SpawnPotentials")) { -- this.e = new ArrayList(); -- NBTTagList var2 = var1.getTagList("SpawnPotentials"); -- -- for(int var3 = 0; var3 < var2.tagCount(); ++var3) { -- this.e.add(new WeightedRandomMinecart(this, (NBTTagCompound)var2.tagAt(var3))); -+ public void readFromNBT(NBTTagCompound par1NBTTagCompound) { -+ this.mobID = par1NBTTagCompound.getString("EntityId"); -+ this.spawnDelay = par1NBTTagCompound.getShort("Delay"); -+ -+ if (par1NBTTagCompound.hasKey("SpawnPotentials")) { -+ this.minecartToSpawn = new ArrayList(); -+ NBTTagList var2 = par1NBTTagCompound.getTagList("SpawnPotentials"); -+ -+ for (int var3 = 0; var3 < var2.tagCount(); ++var3) { -+ this.minecartToSpawn.add(new WeightedRandomMinecart(this, (NBTTagCompound)var2.tagAt(var3))); - } - } else { -- this.e = null; -+ this.minecartToSpawn = null; - } - -- if(var1.hasKey("SpawnData")) { -- this.setRandomMinecart(new WeightedRandomMinecart(this, var1.getCompoundTag("SpawnData"), this.a)); -+ if (par1NBTTagCompound.hasKey("SpawnData")) { -+ this.setRandomMinecart(new WeightedRandomMinecart(this, par1NBTTagCompound.getCompoundTag("SpawnData"), this.mobID)); - } else { - this.setRandomMinecart((WeightedRandomMinecart)null); - } - -- if(var1.hasKey("MinSpawnDelay")) { -- this.minSpawnDelay = var1.getShort("MinSpawnDelay"); -- this.maxSpawnDelay = var1.getShort("MaxSpawnDelay"); -- this.spawnCount = var1.getShort("SpawnCount"); -- } -- -- if(var1.hasKey("MaxNearbyEntities")) { -- this.maxNearbyEntities = var1.getShort("MaxNearbyEntities"); -- this.activatingRangeFromPlayer = var1.getShort("RequiredPlayerRange"); -- } -- -- if(var1.hasKey("SpawnRange")) { -- this.spawnRange = var1.getShort("SpawnRange"); -- } -- -- if(this.getSpawnerWorld() != null && this.getSpawnerWorld().isRemote) { -+ if (par1NBTTagCompound.hasKey("MinSpawnDelay")) { -+ this.minSpawnDelay = par1NBTTagCompound.getShort("MinSpawnDelay"); -+ this.maxSpawnDelay = par1NBTTagCompound.getShort("MaxSpawnDelay"); -+ this.spawnCount = par1NBTTagCompound.getShort("SpawnCount"); -+ } -+ -+ if (par1NBTTagCompound.hasKey("MaxNearbyEntities")) { -+ this.maxNearbyEntities = par1NBTTagCompound.getShort("MaxNearbyEntities"); -+ this.activatingRangeFromPlayer = par1NBTTagCompound.getShort("RequiredPlayerRange"); -+ } -+ -+ if (par1NBTTagCompound.hasKey("SpawnRange")) { -+ this.spawnRange = par1NBTTagCompound.getShort("SpawnRange"); -+ } -+ -+ if (this.getSpawnerWorld() != null && this.getSpawnerWorld().isRemote) { - this.field_98291_j = null; - } -- - } - -- public void writeToNBT(NBTTagCompound var1) { -- var1.setString("EntityId", this.getEntityNameToSpawn()); -- var1.setShort("Delay", (short)this.spawnDelay); -- var1.setShort("MinSpawnDelay", (short)this.minSpawnDelay); -- var1.setShort("MaxSpawnDelay", (short)this.maxSpawnDelay); -- var1.setShort("SpawnCount", (short)this.spawnCount); -- var1.setShort("MaxNearbyEntities", (short)this.maxNearbyEntities); -- var1.setShort("RequiredPlayerRange", (short)this.activatingRangeFromPlayer); -- var1.setShort("SpawnRange", (short)this.spawnRange); -- if(this.getRandomMinecart() != null) { -- var1.setCompoundTag("SpawnData", (NBTTagCompound)this.getRandomMinecart().field_98222_b.copy()); -+ public void writeToNBT(NBTTagCompound par1NBTTagCompound) { -+ par1NBTTagCompound.setString("EntityId", this.getEntityNameToSpawn()); -+ par1NBTTagCompound.setShort("Delay", (short)this.spawnDelay); -+ par1NBTTagCompound.setShort("MinSpawnDelay", (short)this.minSpawnDelay); -+ par1NBTTagCompound.setShort("MaxSpawnDelay", (short)this.maxSpawnDelay); -+ par1NBTTagCompound.setShort("SpawnCount", (short)this.spawnCount); -+ par1NBTTagCompound.setShort("MaxNearbyEntities", (short)this.maxNearbyEntities); -+ par1NBTTagCompound.setShort("RequiredPlayerRange", (short)this.activatingRangeFromPlayer); -+ par1NBTTagCompound.setShort("SpawnRange", (short)this.spawnRange); -+ -+ if (this.getRandomMinecart() != null) { -+ par1NBTTagCompound.setCompoundTag("SpawnData", (NBTTagCompound)this.getRandomMinecart().field_98222_b.copy()); - } - -- if(this.getRandomMinecart() != null || this.e != null && this.e.size() > 0) { -+ if (this.getRandomMinecart() != null || this.minecartToSpawn != null && this.minecartToSpawn.size() > 0) { - NBTTagList var2 = new NBTTagList(); -- if(this.e != null && this.e.size() > 0) { -- Iterator var3 = this.e.iterator(); -- -- while(var3.hasNext()) { -+ -+ if (this.minecartToSpawn != null && this.minecartToSpawn.size() > 0) { -+ Iterator var3 = this.minecartToSpawn.iterator(); -+ -+ while (var3.hasNext()) { - WeightedRandomMinecart var4 = (WeightedRandomMinecart)var3.next(); - var2.appendTag(var4.func_98220_a()); - } -@@ -240,13 +260,12 @@ - var2.appendTag(this.getRandomMinecart().func_98220_a()); - } - -- var1.setTag("SpawnPotentials", var2); -+ par1NBTTagCompound.setTag("SpawnPotentials", var2); - } -- - } - - public Entity func_98281_h() { -- if(this.field_98291_j == null) { -+ if (this.field_98291_j == null) { - Entity var1 = EntityList.createEntityByName(this.getEntityNameToSpawn(), (World)null); - var1 = this.func_98265_a(var1); - this.field_98291_j = var1; -@@ -255,8 +274,11 @@ - return this.field_98291_j; - } - -- public boolean setDelayToMin(int var1) { -- if(var1 == 1 && this.getSpawnerWorld().isRemote) { -+ /** -+ * Sets the delay to minDelay if parameter given is 1, else return false. -+ */ -+ public boolean setDelayToMin(int par1) { -+ if (par1 == 1 && this.getSpawnerWorld().isRemote) { - this.spawnDelay = this.minSpawnDelay; - return true; - } else { -@@ -268,8 +290,8 @@ - return this.randomMinecart; - } - -- public void setRandomMinecart(WeightedRandomMinecart var1) { -- this.randomMinecart = var1; -+ public void setRandomMinecart(WeightedRandomMinecart par1WeightedRandomMinecart) { -+ this.randomMinecart = par1WeightedRandomMinecart; - } - - public abstract void func_98267_a(int var1); ---- /dev/null -+++ org/spoutcraft/api/keyboard/KeyBinding.java -@@ -1,0 +1,131 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.api.keyboard; -+ -+import java.io.Serializable; -+import java.util.UUID; -+ -+import org.apache.commons.lang3.builder.HashCodeBuilder; -+ -+import org.spoutcraft.api.Spoutcraft; -+ -+public final class KeyBinding extends AbstractBinding implements Serializable { -+ private static final long serialVersionUID = 3241524501740640147L; -+ private String id; -+ private String description; -+ private transient UUID uuid = null; -+ private String addonName; -+ private transient BindingExecutionDelegate myDelegate = null; -+ -+ public KeyBinding() { -+ } -+ -+ public KeyBinding(int key, String addon, String id, String description) { -+ setKey(key); -+ this.addonName = addon; -+ this.addonName = addon; -+ this.description = description; -+ this.id = id; -+ } -+ -+ public String getAddon() { -+ return addonName; -+ } -+ -+ public void setAddon(String addon) { -+ this.addonName = addon; -+ } -+ -+ public String getId() { -+ return id; -+ } -+ -+ public void setId(String id) { -+ this.id = id; -+ } -+ -+ public String getDescription() { -+ return description; -+ } -+ -+ public String getTitle() { -+ return description; -+ } -+ -+ public void setDescription(String description) { -+ this.description = description; -+ } -+ -+ public void setUniqueId(UUID uuid) { -+ this.uuid = uuid; -+ } -+ -+ public UUID getUniqueId() { -+ return uuid; -+ } -+ -+ @Override -+ public boolean equals(Object obj) { -+ if (obj instanceof KeyBinding) { -+ KeyBinding other = (KeyBinding)obj; -+ if (uuid != null && other.uuid != null) { -+ return other.uuid.equals(this.uuid); -+ } else { -+ return this == obj; -+ } -+ } -+ return false; -+ } -+ -+ @Override -+ public int hashCode() { -+ return (new HashCodeBuilder()).append(getKey()).append(addonName).append(id).append(uuid).toHashCode(); -+ } -+ -+ public void takeChanges(KeyBinding binding) { -+ description = binding.description; -+ uuid = binding.uuid; -+ myDelegate = binding.myDelegate; -+ } -+ -+ public String getAddonName() { -+ return addonName; -+ } -+ -+ public void setDelegate(BindingExecutionDelegate myDelegate) { -+ this.myDelegate = myDelegate; -+ } -+ -+ public BindingExecutionDelegate getDelegate() { -+ return myDelegate; -+ } -+ -+ public void summon(int key, boolean keyReleased, int screen) { -+ Spoutcraft.getKeyBindingManager().summon(this, key, keyReleased, screen); -+ } -+ -+ @Override -+ public boolean matches(int key, byte modifiers) { -+ if (myDelegate == null && uuid == null) { -+ return false; -+ } -+ return super.matches(key, modifiers); -+ } -+} ---- net/minecraft/src/ComponentVillage.java -+++ net/minecraft/src/ComponentVillage.java -@@ -5,174 +5,216 @@ - - abstract class ComponentVillage extends StructureComponent { - protected int field_143015_k = -1; -+ -+ /** The number of villagers that have been spawned in this component. */ - private int villagersSpawned; - private boolean field_143014_b; - -- public ComponentVillage() { -- } -- -- protected ComponentVillage(ComponentVillageStartPiece var1, int var2) { -- super(var2); -- if(var1 != null) { -- this.field_143014_b = var1.inDesert; -- } -- -- } -- -- protected void func_143012_a(NBTTagCompound var1) { -- var1.setInteger("HPos", this.field_143015_k); -- var1.setInteger("VCount", this.villagersSpawned); -- var1.setBoolean("Desert", this.field_143014_b); -- } -- -- protected void func_143011_b(NBTTagCompound var1) { -- this.field_143015_k = var1.getInteger("HPos"); -- this.villagersSpawned = var1.getInteger("VCount"); -- this.field_143014_b = var1.getBoolean("Desert"); -- } -- -- protected StructureComponent getNextComponentNN(ComponentVillageStartPiece var1, List var2, Random var3, int var4, int var5) { -- switch(this.coordBaseMode) { -- case 0: -- return StructureVillagePieces.getNextStructureComponent(var1, var2, var3, this.boundingBox.minX - 1, this.boundingBox.minY + var4, this.boundingBox.minZ + var5, 1, this.getComponentType()); -- case 1: -- return StructureVillagePieces.getNextStructureComponent(var1, var2, var3, this.boundingBox.minX + var5, this.boundingBox.minY + var4, this.boundingBox.minZ - 1, 2, this.getComponentType()); -- case 2: -- return StructureVillagePieces.getNextStructureComponent(var1, var2, var3, this.boundingBox.minX - 1, this.boundingBox.minY + var4, this.boundingBox.minZ + var5, 1, this.getComponentType()); -- case 3: -- return StructureVillagePieces.getNextStructureComponent(var1, var2, var3, this.boundingBox.minX + var5, this.boundingBox.minY + var4, this.boundingBox.minZ - 1, 2, this.getComponentType()); -- default: -- return null; -- } -- } -- -- protected StructureComponent getNextComponentPP(ComponentVillageStartPiece var1, List var2, Random var3, int var4, int var5) { -- switch(this.coordBaseMode) { -- case 0: -- return StructureVillagePieces.getNextStructureComponent(var1, var2, var3, this.boundingBox.maxX + 1, this.boundingBox.minY + var4, this.boundingBox.minZ + var5, 3, this.getComponentType()); -- case 1: -- return StructureVillagePieces.getNextStructureComponent(var1, var2, var3, this.boundingBox.minX + var5, this.boundingBox.minY + var4, this.boundingBox.maxZ + 1, 0, this.getComponentType()); -- case 2: -- return StructureVillagePieces.getNextStructureComponent(var1, var2, var3, this.boundingBox.maxX + 1, this.boundingBox.minY + var4, this.boundingBox.minZ + var5, 3, this.getComponentType()); -- case 3: -- return StructureVillagePieces.getNextStructureComponent(var1, var2, var3, this.boundingBox.minX + var5, this.boundingBox.minY + var4, this.boundingBox.maxZ + 1, 0, this.getComponentType()); -- default: -- return null; -- } -- } -- -- protected int getAverageGroundLevel(World var1, StructureBoundingBox var2) { -+ public ComponentVillage() {} -+ -+ protected ComponentVillage(ComponentVillageStartPiece par1ComponentVillageStartPiece, int par2) { -+ super(par2); -+ -+ if (par1ComponentVillageStartPiece != null) { -+ this.field_143014_b = par1ComponentVillageStartPiece.inDesert; -+ } -+ } -+ -+ protected void func_143012_a(NBTTagCompound par1NBTTagCompound) { -+ par1NBTTagCompound.setInteger("HPos", this.field_143015_k); -+ par1NBTTagCompound.setInteger("VCount", this.villagersSpawned); -+ par1NBTTagCompound.setBoolean("Desert", this.field_143014_b); -+ } -+ -+ protected void func_143011_b(NBTTagCompound par1NBTTagCompound) { -+ this.field_143015_k = par1NBTTagCompound.getInteger("HPos"); -+ this.villagersSpawned = par1NBTTagCompound.getInteger("VCount"); -+ this.field_143014_b = par1NBTTagCompound.getBoolean("Desert"); -+ } -+ -+ /** -+ * Gets the next village component, with the bounding box shifted -1 in the X and Z direction. -+ */ -+ protected StructureComponent getNextComponentNN(ComponentVillageStartPiece par1ComponentVillageStartPiece, List par2List, Random par3Random, int par4, int par5) { -+ switch (this.coordBaseMode) { -+ case 0: -+ return StructureVillagePieces.getNextStructureComponent(par1ComponentVillageStartPiece, par2List, par3Random, this.boundingBox.minX - 1, this.boundingBox.minY + par4, this.boundingBox.minZ + par5, 1, this.getComponentType()); -+ -+ case 1: -+ return StructureVillagePieces.getNextStructureComponent(par1ComponentVillageStartPiece, par2List, par3Random, this.boundingBox.minX + par5, this.boundingBox.minY + par4, this.boundingBox.minZ - 1, 2, this.getComponentType()); -+ -+ case 2: -+ return StructureVillagePieces.getNextStructureComponent(par1ComponentVillageStartPiece, par2List, par3Random, this.boundingBox.minX - 1, this.boundingBox.minY + par4, this.boundingBox.minZ + par5, 1, this.getComponentType()); -+ -+ case 3: -+ return StructureVillagePieces.getNextStructureComponent(par1ComponentVillageStartPiece, par2List, par3Random, this.boundingBox.minX + par5, this.boundingBox.minY + par4, this.boundingBox.minZ - 1, 2, this.getComponentType()); -+ -+ default: -+ return null; -+ } -+ } -+ -+ /** -+ * Gets the next village component, with the bounding box shifted +1 in the X and Z direction. -+ */ -+ protected StructureComponent getNextComponentPP(ComponentVillageStartPiece par1ComponentVillageStartPiece, List par2List, Random par3Random, int par4, int par5) { -+ switch (this.coordBaseMode) { -+ case 0: -+ return StructureVillagePieces.getNextStructureComponent(par1ComponentVillageStartPiece, par2List, par3Random, this.boundingBox.maxX + 1, this.boundingBox.minY + par4, this.boundingBox.minZ + par5, 3, this.getComponentType()); -+ -+ case 1: -+ return StructureVillagePieces.getNextStructureComponent(par1ComponentVillageStartPiece, par2List, par3Random, this.boundingBox.minX + par5, this.boundingBox.minY + par4, this.boundingBox.maxZ + 1, 0, this.getComponentType()); -+ -+ case 2: -+ return StructureVillagePieces.getNextStructureComponent(par1ComponentVillageStartPiece, par2List, par3Random, this.boundingBox.maxX + 1, this.boundingBox.minY + par4, this.boundingBox.minZ + par5, 3, this.getComponentType()); -+ -+ case 3: -+ return StructureVillagePieces.getNextStructureComponent(par1ComponentVillageStartPiece, par2List, par3Random, this.boundingBox.minX + par5, this.boundingBox.minY + par4, this.boundingBox.maxZ + 1, 0, this.getComponentType()); -+ -+ default: -+ return null; -+ } -+ } -+ -+ /** -+ * Discover the y coordinate that will serve as the ground level of the supplied BoundingBox. (A median of all the -+ * levels in the BB's horizontal rectangle). -+ */ -+ protected int getAverageGroundLevel(World par1World, StructureBoundingBox par2StructureBoundingBox) { - int var3 = 0; - int var4 = 0; - -- for(int var5 = this.boundingBox.minZ; var5 <= this.boundingBox.maxZ; ++var5) { -- for(int var6 = this.boundingBox.minX; var6 <= this.boundingBox.maxX; ++var6) { -- if(var2.isVecInside(var6, 64, var5)) { -- var3 += Math.max(var1.getTopSolidOrLiquidBlock(var6, var5), var1.provider.getAverageGroundLevel()); -+ for (int var5 = this.boundingBox.minZ; var5 <= this.boundingBox.maxZ; ++var5) { -+ for (int var6 = this.boundingBox.minX; var6 <= this.boundingBox.maxX; ++var6) { -+ if (par2StructureBoundingBox.isVecInside(var6, 64, var5)) { -+ var3 += Math.max(par1World.getTopSolidOrLiquidBlock(var6, var5), par1World.provider.getAverageGroundLevel()); - ++var4; - } - } - } - -- if(var4 == 0) { -+ if (var4 == 0) { - return -1; - } else { - return var3 / var4; - } - } - -- protected static boolean canVillageGoDeeper(StructureBoundingBox var0) { -- return var0 != null && var0.minY > 10; -+ protected static boolean canVillageGoDeeper(StructureBoundingBox par0StructureBoundingBox) { -+ return par0StructureBoundingBox != null && par0StructureBoundingBox.minY > 10; - } - -- protected void spawnVillagers(World var1, StructureBoundingBox var2, int var3, int var4, int var5, int var6) { -- if(this.villagersSpawned < var6) { -- for(int var7 = this.villagersSpawned; var7 < var6; ++var7) { -- int var8 = this.getXWithOffset(var3 + var7, var5); -- int var9 = this.getYWithOffset(var4); -- int var10 = this.getZWithOffset(var3 + var7, var5); -- if(!var2.isVecInside(var8, var9, var10)) { -+ /** -+ * Spawns a number of villagers in this component. Parameters: world, component bounding box, x offset, y offset, z -+ * offset, number of villagers -+ */ -+ protected void spawnVillagers(World par1World, StructureBoundingBox par2StructureBoundingBox, int par3, int par4, int par5, int par6) { -+ if (this.villagersSpawned < par6) { -+ for (int var7 = this.villagersSpawned; var7 < par6; ++var7) { -+ int var8 = this.getXWithOffset(par3 + var7, par5); -+ int var9 = this.getYWithOffset(par4); -+ int var10 = this.getZWithOffset(par3 + var7, par5); -+ -+ if (!par2StructureBoundingBox.isVecInside(var8, var9, var10)) { - break; - } - - ++this.villagersSpawned; -- EntityVillager var11 = new EntityVillager(var1, this.getVillagerType(var7)); -+ EntityVillager var11 = new EntityVillager(par1World, this.getVillagerType(var7)); - var11.setLocationAndAngles((double)var8 + 0.5D, (double)var9, (double)var10 + 0.5D, 0.0F, 0.0F); -- var1.spawnEntityInWorld(var11); -+ par1World.spawnEntityInWorld(var11); - } -- - } - } - -- protected int getVillagerType(int var1) { -+ /** -+ * Returns the villager type to spawn in this component, based on the number of villagers already spawned. -+ */ -+ protected int getVillagerType(int par1) { - return 0; - } - -- protected int getBiomeSpecificBlock(int var1, int var2) { -- if(this.field_143014_b) { -- if(var1 == Block.wood.blockID) { -- return Block.sandStone.blockID; -- } -- -- if(var1 == Block.cobblestone.blockID) { -- return Block.sandStone.blockID; -- } -- -- if(var1 == Block.planks.blockID) { -- return Block.sandStone.blockID; -- } -- -- if(var1 == Block.stairsWoodOak.blockID) { -- return Block.stairsSandStone.blockID; -- } -- -- if(var1 == Block.stairsCobblestone.blockID) { -- return Block.stairsSandStone.blockID; -- } -- -- if(var1 == Block.gravel.blockID) { -+ /** -+ * Gets the replacement block for the current biome -+ */ -+ protected int getBiomeSpecificBlock(int par1, int par2) { -+ if (this.field_143014_b) { -+ if (par1 == Block.wood.blockID) { -+ return Block.sandStone.blockID; -+ } -+ -+ if (par1 == Block.cobblestone.blockID) { -+ return Block.sandStone.blockID; -+ } -+ -+ if (par1 == Block.planks.blockID) { -+ return Block.sandStone.blockID; -+ } -+ -+ if (par1 == Block.stairsWoodOak.blockID) { -+ return Block.stairsSandStone.blockID; -+ } -+ -+ if (par1 == Block.stairsCobblestone.blockID) { -+ return Block.stairsSandStone.blockID; -+ } -+ -+ if (par1 == Block.gravel.blockID) { - return Block.sandStone.blockID; - } - } - -- return var1; -+ return par1; - } - -- protected int getBiomeSpecificBlockMetadata(int var1, int var2) { -- if(this.field_143014_b) { -- if(var1 == Block.wood.blockID) { -- return 0; -- } -- -- if(var1 == Block.cobblestone.blockID) { -- return 0; -- } -- -- if(var1 == Block.planks.blockID) { -+ /** -+ * Gets the replacement block metadata for the current biome -+ */ -+ protected int getBiomeSpecificBlockMetadata(int par1, int par2) { -+ if (this.field_143014_b) { -+ if (par1 == Block.wood.blockID) { -+ return 0; -+ } -+ -+ if (par1 == Block.cobblestone.blockID) { -+ return 0; -+ } -+ -+ if (par1 == Block.planks.blockID) { - return 2; - } - } - -- return var2; -- } -- -- protected void placeBlockAtCurrentPosition(World var1, int var2, int var3, int var4, int var5, int var6, StructureBoundingBox var7) { -- int var8 = this.getBiomeSpecificBlock(var2, var3); -- int var9 = this.getBiomeSpecificBlockMetadata(var2, var3); -- super.placeBlockAtCurrentPosition(var1, var8, var9, var4, var5, var6, var7); -- } -- -- protected void fillWithBlocks(World var1, StructureBoundingBox var2, int var3, int var4, int var5, int var6, int var7, int var8, int var9, int var10, boolean var11) { -- int var12 = this.getBiomeSpecificBlock(var9, 0); -- int var13 = this.getBiomeSpecificBlockMetadata(var9, 0); -- int var14 = this.getBiomeSpecificBlock(var10, 0); -- int var15 = this.getBiomeSpecificBlockMetadata(var10, 0); -- super.fillWithMetadataBlocks(var1, var2, var3, var4, var5, var6, var7, var8, var12, var13, var14, var15, var11); -- } -- -- protected void fillCurrentPositionBlocksDownwards(World var1, int var2, int var3, int var4, int var5, int var6, StructureBoundingBox var7) { -- int var8 = this.getBiomeSpecificBlock(var2, var3); -- int var9 = this.getBiomeSpecificBlockMetadata(var2, var3); -- super.fillCurrentPositionBlocksDownwards(var1, var8, var9, var4, var5, var6, var7); -+ return par2; -+ } -+ -+ /** -+ * current Position depends on currently set Coordinates mode, is computed here -+ */ -+ protected void placeBlockAtCurrentPosition(World par1World, int par2, int par3, int par4, int par5, int par6, StructureBoundingBox par7StructureBoundingBox) { -+ int var8 = this.getBiomeSpecificBlock(par2, par3); -+ int var9 = this.getBiomeSpecificBlockMetadata(par2, par3); -+ super.placeBlockAtCurrentPosition(par1World, var8, var9, par4, par5, par6, par7StructureBoundingBox); -+ } -+ -+ /** -+ * arguments: (World worldObj, StructureBoundingBox structBB, int minX, int minY, int minZ, int maxX, int maxY, int -+ * maxZ, int placeBlockId, int replaceBlockId, boolean alwaysreplace) -+ */ -+ protected void fillWithBlocks(World par1World, StructureBoundingBox par2StructureBoundingBox, int par3, int par4, int par5, int par6, int par7, int par8, int par9, int par10, boolean par11) { -+ int var12 = this.getBiomeSpecificBlock(par9, 0); -+ int var13 = this.getBiomeSpecificBlockMetadata(par9, 0); -+ int var14 = this.getBiomeSpecificBlock(par10, 0); -+ int var15 = this.getBiomeSpecificBlockMetadata(par10, 0); -+ super.fillWithMetadataBlocks(par1World, par2StructureBoundingBox, par3, par4, par5, par6, par7, par8, var12, var13, var14, var15, par11); -+ } -+ -+ /** -+ * Overwrites air and liquids from selected position downwards, stops at hitting anything else. -+ */ -+ protected void fillCurrentPositionBlocksDownwards(World par1World, int par2, int par3, int par4, int par5, int par6, StructureBoundingBox par7StructureBoundingBox) { -+ int var8 = this.getBiomeSpecificBlock(par2, par3); -+ int var9 = this.getBiomeSpecificBlockMetadata(par2, par3); -+ super.fillCurrentPositionBlocksDownwards(par1World, var8, var9, par4, par5, par6, par7StructureBoundingBox); - } - } ---- /dev/null -+++ org/spoutcraft/client/gui/settings/controls/MinimapButton.java -@@ -1,0 +1,40 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.client.gui.settings.controls; -+ -+import net.minecraft.src.GuiScreen; -+ -+import org.spoutcraft.api.gui.GenericButton; -+import org.spoutcraft.client.SpoutClient; -+import org.spoutcraft.client.gui.minimap.GuiMinimapMenu; -+ -+public class MinimapButton extends GenericButton { -+ GuiScreen parent; -+ -+ public MinimapButton(GuiScreen parent) { -+ super("Minimap Options"); -+ this.parent = parent; -+ } -+ -+ @Override -+ public void onButtonClick() { -+ SpoutClient.getHandle().displayGuiScreen(new GuiMinimapMenu(parent)); -+ } -+} ---- /dev/null -+++ org/spoutcraft/client/packet/PacketRenderDistance.java -@@ -1,0 +1,91 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.client.packet; -+ -+import java.io.IOException; -+ -+import net.minecraft.src.GameSettings; -+import net.minecraft.src.Minecraft; -+ -+import org.spoutcraft.api.io.SpoutInputStream; -+import org.spoutcraft.api.io.SpoutOutputStream; -+import org.spoutcraft.api.player.RenderDistance; -+import org.spoutcraft.client.SpoutClient; -+ -+public class PacketRenderDistance implements SpoutPacket { -+ protected byte view = -1; -+ protected byte max = -1; -+ protected byte min = -1; -+ public PacketRenderDistance() { -+ } -+ -+ public PacketRenderDistance(byte view) { -+ this.view = view; -+ } -+ -+ public int getNumBytes() { -+ return 3; -+ } -+ -+ public void readData(SpoutInputStream input) throws IOException { -+ view = (byte) input.read(); -+ max = (byte) input.read(); -+ min = (byte) input.read(); -+ } -+ -+ public void writeData(SpoutOutputStream output) throws IOException { -+ output.write(view); -+ output.write(max); -+ output.write(min); -+ } -+ -+ public void run(int PlayerId) { -+ Minecraft game = SpoutClient.getHandle(); -+ if (game != null) { -+ GameSettings settings = game.gameSettings; -+ if (view > -1 && view < 4) { -+ settings.renderDistance = view; -+ } -+ } -+ if (min > -1 && min < 4) { -+ SpoutClient.getInstance().getActivePlayer().setMinimumView(RenderDistance.getRenderDistanceFromValue(min)); -+ } -+ if (max > -1 && max < 4) { -+ SpoutClient.getInstance().getActivePlayer().setMaximumView(RenderDistance.getRenderDistanceFromValue(max)); -+ } -+ if (min == -2) { -+ SpoutClient.getInstance().getActivePlayer().setMinimumView(RenderDistance.TINY); -+ } -+ if (max == -2) { -+ SpoutClient.getInstance().getActivePlayer().setMinimumView(RenderDistance.FAR); -+ } -+ } -+ -+ public PacketType getPacketType() { -+ return PacketType.PacketRenderDistance; -+ } -+ -+ public int getVersion() { -+ return 0; -+ } -+ -+ public void failure(int playerId) { -+ } -+} ---- net/minecraft/src/Packet105UpdateProgressbar.java -+++ net/minecraft/src/Packet105UpdateProgressbar.java -@@ -5,35 +5,58 @@ - import java.io.IOException; - - public class Packet105UpdateProgressbar extends Packet { -+ -+ /** The id of the window that the progress bar is in. */ - public int windowId; -+ -+ /** -+ * Which of the progress bars that should be updated. (For furnaces, 0 = progress arrow, 1 = fire icon) -+ */ - public int progressBar; -+ -+ /** -+ * The value of the progress bar. The maximum values vary depending on the progress bar. Presumably the values are -+ * specified as in-game ticks. Some progress bar values increase, while others decrease. For furnaces, 0 is empty, full -+ * progress arrow = about 180, full fire icon = about 250) -+ */ - public int progressBarValue; - -- public Packet105UpdateProgressbar() { -- } -- -- public Packet105UpdateProgressbar(int var1, int var2, int var3) { -- this.windowId = var1; -- this.progressBar = var2; -- this.progressBarValue = var3; -- } -- -- public void processPacket(NetHandler var1) { -- var1.handleUpdateProgressbar(this); -- } -- -- public void readPacketData(DataInput var1) throws IOException { -- this.windowId = var1.readByte(); -- this.progressBar = var1.readShort(); -- this.progressBarValue = var1.readShort(); -- } -- -- public void writePacketData(DataOutput var1) throws IOException { -- var1.writeByte(this.windowId); -- var1.writeShort(this.progressBar); -- var1.writeShort(this.progressBarValue); -- } -- -+ public Packet105UpdateProgressbar() {} -+ -+ public Packet105UpdateProgressbar(int par1, int par2, int par3) { -+ this.windowId = par1; -+ this.progressBar = par2; -+ this.progressBarValue = par3; -+ } -+ -+ /** -+ * Passes this Packet on to the NetHandler for processing. -+ */ -+ public void processPacket(NetHandler par1NetHandler) { -+ par1NetHandler.handleUpdateProgressbar(this); -+ } -+ -+ /** -+ * Abstract. Reads the raw packet data from the data stream. -+ */ -+ public void readPacketData(DataInput par1DataInput) throws IOException { -+ this.windowId = par1DataInput.readByte(); -+ this.progressBar = par1DataInput.readShort(); -+ this.progressBarValue = par1DataInput.readShort(); -+ } -+ -+ /** -+ * Abstract. Writes the raw packet data to the data stream. -+ */ -+ public void writePacketData(DataOutput par1DataOutput) throws IOException { -+ par1DataOutput.writeByte(this.windowId); -+ par1DataOutput.writeShort(this.progressBar); -+ par1DataOutput.writeShort(this.progressBarValue); -+ } -+ -+ /** -+ * Abstract. Return the size of the packet (not counting the header). -+ */ - public int getPacketSize() { - return 5; - } ---- net/minecraft/src/Packet102WindowClick.java -+++ net/minecraft/src/Packet102WindowClick.java -@@ -5,47 +5,68 @@ - import java.io.IOException; - - public class Packet102WindowClick extends Packet { -+ -+ /** The id of the window which was clicked. 0 for player inventory. */ - public int window_Id; -+ -+ /** The clicked slot (-999 is outside of inventory) */ - public int inventorySlot; -+ -+ /** 1 when right-clicking and otherwise 0 */ - public int mouseClick; -+ -+ /** A unique number for the action, used for transaction handling */ - public short action; -+ -+ /** Item stack for inventory */ - public ItemStack itemStack; - public int holdingShift; - -- public Packet102WindowClick() { -- } -- -- public Packet102WindowClick(int var1, int var2, int var3, int var4, ItemStack var5, short var6) { -- this.window_Id = var1; -- this.inventorySlot = var2; -- this.mouseClick = var3; -- this.itemStack = var5 != null ? var5.copy() : null; -- this.action = var6; -- this.holdingShift = var4; -- } -- -- public void processPacket(NetHandler var1) { -- var1.handleWindowClick(this); -- } -- -- public void readPacketData(DataInput var1) throws IOException { -- this.window_Id = var1.readByte(); -- this.inventorySlot = var1.readShort(); -- this.mouseClick = var1.readByte(); -- this.action = var1.readShort(); -- this.holdingShift = var1.readByte(); -- this.itemStack = readItemStack(var1); -- } -- -- public void writePacketData(DataOutput var1) throws IOException { -- var1.writeByte(this.window_Id); -- var1.writeShort(this.inventorySlot); -- var1.writeByte(this.mouseClick); -- var1.writeShort(this.action); -- var1.writeByte(this.holdingShift); -- writeItemStack(this.itemStack, var1); -- } -- -+ public Packet102WindowClick() {} -+ -+ public Packet102WindowClick(int par1, int par2, int par3, int par4, ItemStack par5ItemStack, short par6) { -+ this.window_Id = par1; -+ this.inventorySlot = par2; -+ this.mouseClick = par3; -+ this.itemStack = par5ItemStack != null ? par5ItemStack.copy() : null; -+ this.action = par6; -+ this.holdingShift = par4; -+ } -+ -+ /** -+ * Passes this Packet on to the NetHandler for processing. -+ */ -+ public void processPacket(NetHandler par1NetHandler) { -+ par1NetHandler.handleWindowClick(this); -+ } -+ -+ /** -+ * Abstract. Reads the raw packet data from the data stream. -+ */ -+ public void readPacketData(DataInput par1DataInput) throws IOException { -+ this.window_Id = par1DataInput.readByte(); -+ this.inventorySlot = par1DataInput.readShort(); -+ this.mouseClick = par1DataInput.readByte(); -+ this.action = par1DataInput.readShort(); -+ this.holdingShift = par1DataInput.readByte(); -+ this.itemStack = readItemStack(par1DataInput); -+ } -+ -+ /** -+ * Abstract. Writes the raw packet data to the data stream. -+ */ -+ public void writePacketData(DataOutput par1DataOutput) throws IOException { -+ par1DataOutput.writeByte(this.window_Id); -+ par1DataOutput.writeShort(this.inventorySlot); -+ par1DataOutput.writeByte(this.mouseClick); -+ par1DataOutput.writeShort(this.action); -+ par1DataOutput.writeByte(this.holdingShift); -+ writeItemStack(this.itemStack, par1DataOutput); -+ } -+ -+ /** -+ * Abstract. Return the size of the packet (not counting the header). -+ */ - public int getPacketSize() { - return 11; - } ---- /dev/null -+++ org/spoutcraft/client/gui/LinkButton.java -@@ -1,0 +1,45 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.client.gui; -+ -+import org.spoutcraft.api.gui.GenericButton; -+import org.spoutcraft.client.util.NetworkUtils; -+ -+public class LinkButton extends GenericButton { -+ private String url = ""; -+ -+ public LinkButton(String text, String url) { -+ super(text); -+ setUrl(url); -+ } -+ -+ public String getUrl() { -+ return url; -+ } -+ -+ public void setUrl(String url) { -+ this.url = url; -+ } -+ -+ @Override -+ public void onButtonClick() { -+ NetworkUtils.openInBrowser(url); -+ } -+} ---- /dev/null -+++ org/spoutcraft/client/gui/settings/controls/ReplaceToolsButton.java -@@ -1,0 +1,37 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.client.gui.settings.controls; -+ -+import org.spoutcraft.api.gui.GenericCheckBox; -+import org.spoutcraft.client.config.Configuration; -+ -+public class ReplaceToolsButton extends GenericCheckBox { -+ public ReplaceToolsButton() { -+ super("Auto Replace Tools"); -+ setChecked(Configuration.isReplaceTools()); -+ setTooltip("Replaces used up tools with spares from your inventory"); -+ } -+ -+ @Override -+ public void onButtonClick() { -+ Configuration.setReplaceTools(!Configuration.isReplaceTools()); -+ Configuration.write(); -+ } -+} ---- net/minecraft/src/EntityFireball.java -+++ net/minecraft/src/EntityFireball.java -@@ -14,58 +14,73 @@ - public double accelerationX; - public double accelerationY; - public double accelerationZ; -+ // Spout Start -+ public float yield = 1F; -+ public boolean incendiary = true; -+ // Spout End - -- public EntityFireball(World var1) { -- super(var1); -+ public EntityFireball(World par1World) { -+ super(par1World); - this.setSize(1.0F, 1.0F); - } - -- protected void entityInit() { -- } -+ protected void entityInit() {} - -- public boolean isInRangeToRenderDist(double var1) { -+ /** -+ * Checks if the entity is in range to render by using the past in distance and comparing it to its average edge length -+ * * 64 * renderDistanceWeight Args: distance -+ */ -+ public boolean isInRangeToRenderDist(double par1) { - double var3 = this.boundingBox.getAverageEdgeLength() * 4.0D; - var3 *= 64.0D; -- return var1 < var3 * var3; -- } -- -- public EntityFireball(World var1, double var2, double var4, double var6, double var8, double var10, double var12) { -- super(var1); -- this.setSize(1.0F, 1.0F); -- this.setLocationAndAngles(var2, var4, var6, this.rotationYaw, this.rotationPitch); -- this.setPosition(var2, var4, var6); -- double var14 = (double)MathHelper.sqrt_double(var8 * var8 + var10 * var10 + var12 * var12); -- this.accelerationX = var8 / var14 * 0.1D; -- this.accelerationY = var10 / var14 * 0.1D; -- this.accelerationZ = var12 / var14 * 0.1D; -- } -- -- public EntityFireball(World var1, EntityLivingBase var2, double var3, double var5, double var7) { -- super(var1); -- this.shootingEntity = var2; -- this.setSize(1.0F, 1.0F); -- this.setLocationAndAngles(var2.posX, var2.posY, var2.posZ, var2.rotationYaw, var2.rotationPitch); -+ return par1 < var3 * var3; -+ } -+ -+ public EntityFireball(World par1World, double par2, double par4, double par6, double par8, double par10, double par12) { -+ super(par1World); -+ this.setSize(1.0F, 1.0F); -+ this.setLocationAndAngles(par2, par4, par6, this.rotationYaw, this.rotationPitch); -+ this.setPosition(par2, par4, par6); -+ double var14 = (double)MathHelper.sqrt_double(par8 * par8 + par10 * par10 + par12 * par12); -+ this.accelerationX = par8 / var14 * 0.1D; -+ this.accelerationY = par10 / var14 * 0.1D; -+ this.accelerationZ = par12 / var14 * 0.1D; -+ } -+ -+ public EntityFireball(World par1World, EntityLivingBase par2EntityLivingBase, double par3, double par5, double par7) { -+ super(par1World); -+ this.shootingEntity = par2EntityLivingBase; -+ this.setSize(1.0F, 1.0F); -+ this.setLocationAndAngles(par2EntityLivingBase.posX, par2EntityLivingBase.posY, par2EntityLivingBase.posZ, par2EntityLivingBase.rotationYaw, par2EntityLivingBase.rotationPitch); - this.setPosition(this.posX, this.posY, this.posZ); - this.yOffset = 0.0F; - this.motionX = this.motionY = this.motionZ = 0.0D; -- var3 += this.ab.nextGaussian() * 0.4D; -- var5 += this.ab.nextGaussian() * 0.4D; -- var7 += this.ab.nextGaussian() * 0.4D; -- double var9 = (double)MathHelper.sqrt_double(var3 * var3 + var5 * var5 + var7 * var7); -- this.accelerationX = var3 / var9 * 0.1D; -- this.accelerationY = var5 / var9 * 0.1D; -- this.accelerationZ = var7 / var9 * 0.1D; -+ par3 += this.rand.nextGaussian() * 0.4D; -+ par5 += this.rand.nextGaussian() * 0.4D; -+ par7 += this.rand.nextGaussian() * 0.4D; -+ double var9 = (double)MathHelper.sqrt_double(par3 * par3 + par5 * par5 + par7 * par7); -+ this.accelerationX = par3 / var9 * 0.1D; -+ this.accelerationY = par5 / var9 * 0.1D; -+ this.accelerationZ = par7 / var9 * 0.1D; - } - -+ /** -+ * Called to update the entity's position/logic. -+ */ - public void onUpdate() { -- if(this.worldObj.isRemote || (this.shootingEntity == null || !this.shootingEntity.isDead) && this.worldObj.blockExists((int)this.posX, (int)this.posY, (int)this.posZ)) { -+ if (!this.worldObj.isRemote && (this.shootingEntity != null && this.shootingEntity.isDead || !this.worldObj.blockExists((int)this.posX, (int)this.posY, (int)this.posZ))) { -+ this.setDead(); -+ } else { - super.onUpdate(); - this.setFire(1); -- if(this.inGround) { -+ -+ if (this.inGround) { - int var1 = this.worldObj.getBlockId(this.xTile, this.yTile, this.zTile); -- if(var1 == this.inTile) { -+ -+ if (var1 == this.inTile) { - ++this.ticksAlive; -- if(this.ticksAlive == 600) { -+ -+ if (this.ticksAlive == 600) { - this.setDead(); - } - -@@ -73,9 +88,9 @@ - } - - this.inGround = false; -- this.motionX *= (double)(this.ab.nextFloat() * 0.2F); -- this.motionY *= (double)(this.ab.nextFloat() * 0.2F); -- this.motionZ *= (double)(this.ab.nextFloat() * 0.2F); -+ this.motionX *= (double)(this.rand.nextFloat() * 0.2F); -+ this.motionY *= (double)(this.rand.nextFloat() * 0.2F); -+ this.motionZ *= (double)(this.rand.nextFloat() * 0.2F); - this.ticksAlive = 0; - this.ticksInAir = 0; - } else { -@@ -84,10 +99,11 @@ - - Vec3 var15 = this.worldObj.getWorldVec3Pool().getVecFromPool(this.posX, this.posY, this.posZ); - Vec3 var2 = this.worldObj.getWorldVec3Pool().getVecFromPool(this.posX + this.motionX, this.posY + this.motionY, this.posZ + this.motionZ); -- MovingObjectPosition var3 = this.worldObj.rayTraceBlocks(var15, var2); -+ MovingObjectPosition var3 = this.worldObj.clip(var15, var2); - var15 = this.worldObj.getWorldVec3Pool().getVecFromPool(this.posX, this.posY, this.posZ); - var2 = this.worldObj.getWorldVec3Pool().getVecFromPool(this.posX + this.motionX, this.posY + this.motionY, this.posZ + this.motionZ); -- if(var3 != null) { -+ -+ if (var3 != null) { - var2 = this.worldObj.getWorldVec3Pool().getVecFromPool(var3.hitVec.xCoord, var3.hitVec.yCoord, var3.hitVec.zCoord); - } - -@@ -95,15 +111,18 @@ - List var5 = this.worldObj.getEntitiesWithinAABBExcludingEntity(this, this.boundingBox.addCoord(this.motionX, this.motionY, this.motionZ).expand(1.0D, 1.0D, 1.0D)); - double var6 = 0.0D; - -- for(int var8 = 0; var8 < var5.size(); ++var8) { -+ for (int var8 = 0; var8 < var5.size(); ++var8) { - Entity var9 = (Entity)var5.get(var8); -- if(var9.canBeCollidedWith() && (!var9.isEntityEqual(this.shootingEntity) || this.ticksInAir >= 25)) { -+ -+ if (var9.canBeCollidedWith() && (!var9.isEntityEqual(this.shootingEntity) || this.ticksInAir >= 25)) { - float var10 = 0.3F; - AxisAlignedBB var11 = var9.boundingBox.expand((double)var10, (double)var10, (double)var10); - MovingObjectPosition var12 = var11.calculateIntercept(var15, var2); -- if(var12 != null) { -+ -+ if (var12 != null) { - double var13 = var15.distanceTo(var12.hitVec); -- if(var13 < var6 || var6 == 0.0D) { -+ -+ if (var13 < var6 || var6 == 0.0D) { - var4 = var9; - var6 = var13; - } -@@ -111,11 +130,11 @@ - } - } - -- if(var4 != null) { -+ if (var4 != null) { - var3 = new MovingObjectPosition(var4); - } - -- if(var3 != null) { -+ if (var3 != null) { - this.onImpact(var3); - } - -@@ -123,30 +142,32 @@ - this.posY += this.motionY; - this.posZ += this.motionZ; - float var16 = MathHelper.sqrt_double(this.motionX * this.motionX + this.motionZ * this.motionZ); -- this.rotationYaw = (float)(Math.atan2(this.motionZ, this.motionX) * 180.0D / (double)((float)Math.PI)) + 90.0F; -+ this.rotationYaw = (float)(Math.atan2(this.motionZ, this.motionX) * 180.0D / Math.PI) + 90.0F; - -- for(this.rotationPitch = (float)(Math.atan2((double)var16, this.motionY) * 180.0D / (double)((float)Math.PI)) - 90.0F; this.rotationPitch - this.prevRotationPitch < -180.0F; this.prevRotationPitch -= 360.0F) { -+ for (this.rotationPitch = (float)(Math.atan2((double)var16, this.motionY) * 180.0D / Math.PI) - 90.0F; this.rotationPitch - this.prevRotationPitch < -180.0F; this.prevRotationPitch -= 360.0F) { -+ ; - } - -- while(this.rotationPitch - this.prevRotationPitch >= 180.0F) { -+ while (this.rotationPitch - this.prevRotationPitch >= 180.0F) { - this.prevRotationPitch += 360.0F; - } - -- while(this.rotationYaw - this.prevRotationYaw < -180.0F) { -+ while (this.rotationYaw - this.prevRotationYaw < -180.0F) { - this.prevRotationYaw -= 360.0F; - } - -- while(this.rotationYaw - this.prevRotationYaw >= 180.0F) { -+ while (this.rotationYaw - this.prevRotationYaw >= 180.0F) { - this.prevRotationYaw += 360.0F; - } - - this.rotationPitch = this.prevRotationPitch + (this.rotationPitch - this.prevRotationPitch) * 0.2F; - this.rotationYaw = this.prevRotationYaw + (this.rotationYaw - this.prevRotationYaw) * 0.2F; - float var17 = this.getMotionFactor(); -- if(this.isInWater()) { -- for(int var18 = 0; var18 < 4; ++var18) { -- float var19 = 0.25F; -- this.worldObj.spawnParticle("bubble", this.posX - this.motionX * (double)var19, this.posY - this.motionY * (double)var19, this.posZ - this.motionZ * (double)var19, this.motionX, this.motionY, this.motionZ); -+ -+ if (this.isInWater()) { -+ for (int var19 = 0; var19 < 4; ++var19) { -+ float var18 = 0.25F; -+ this.worldObj.spawnParticle("bubble", this.posX - this.motionX * (double)var18, this.posY - this.motionY * (double)var18, this.posZ - this.motionZ * (double)var18, this.motionX, this.motionY, this.motionZ); - } - - var17 = 0.8F; -@@ -160,43 +181,56 @@ - this.motionZ *= (double)var17; - this.worldObj.spawnParticle("smoke", this.posX, this.posY + 0.5D, this.posZ, 0.0D, 0.0D, 0.0D); - this.setPosition(this.posX, this.posY, this.posZ); -- } else { -- this.setDead(); - } - } - -+ /** -+ * Return the motion factor for this projectile. The factor is multiplied by the original motion. -+ */ - protected float getMotionFactor() { - return 0.95F; - } - -+ /** -+ * Called when this EntityFireball hits a block or entity. -+ */ - protected abstract void onImpact(MovingObjectPosition var1); - -- public void writeEntityToNBT(NBTTagCompound var1) { -- var1.setShort("xTile", (short)this.xTile); -- var1.setShort("yTile", (short)this.yTile); -- var1.setShort("zTile", (short)this.zTile); -- var1.setByte("inTile", (byte)this.inTile); -- var1.setByte("inGround", (byte)(this.inGround ? 1 : 0)); -- var1.setTag("direction", this.newDoubleNBTList(new double[]{this.motionX, this.motionY, this.motionZ})); -+ /** -+ * (abstract) Protected helper method to write subclass entity data to NBT. -+ */ -+ public void writeEntityToNBT(NBTTagCompound par1NBTTagCompound) { -+ par1NBTTagCompound.setShort("xTile", (short)this.xTile); -+ par1NBTTagCompound.setShort("yTile", (short)this.yTile); -+ par1NBTTagCompound.setShort("zTile", (short)this.zTile); -+ par1NBTTagCompound.setByte("inTile", (byte)this.inTile); -+ par1NBTTagCompound.setByte("inGround", (byte)(this.inGround ? 1 : 0)); -+ par1NBTTagCompound.setTag("direction", this.newDoubleNBTList(new double[] {this.motionX, this.motionY, this.motionZ})); - } - -- public void readEntityFromNBT(NBTTagCompound var1) { -- this.xTile = var1.getShort("xTile"); -- this.yTile = var1.getShort("yTile"); -- this.zTile = var1.getShort("zTile"); -- this.inTile = var1.getByte("inTile") & 255; -- this.inGround = var1.getByte("inGround") == 1; -- if(var1.hasKey("direction")) { -- NBTTagList var2 = var1.getTagList("direction"); -+ /** -+ * (abstract) Protected helper method to read subclass entity data from NBT. -+ */ -+ public void readEntityFromNBT(NBTTagCompound par1NBTTagCompound) { -+ this.xTile = par1NBTTagCompound.getShort("xTile"); -+ this.yTile = par1NBTTagCompound.getShort("yTile"); -+ this.zTile = par1NBTTagCompound.getShort("zTile"); -+ this.inTile = par1NBTTagCompound.getByte("inTile") & 255; -+ this.inGround = par1NBTTagCompound.getByte("inGround") == 1; -+ -+ if (par1NBTTagCompound.hasKey("direction")) { -+ NBTTagList var2 = par1NBTTagCompound.getTagList("direction"); - this.motionX = ((NBTTagDouble)var2.tagAt(0)).data; - this.motionY = ((NBTTagDouble)var2.tagAt(1)).data; - this.motionZ = ((NBTTagDouble)var2.tagAt(2)).data; - } else { - this.setDead(); - } -- - } - -+ /** -+ * Returns true if other Entities should be prevented from moving through this Entity. -+ */ - public boolean canBeCollidedWith() { - return true; - } -@@ -205,14 +239,19 @@ - return 1.0F; - } - -- public boolean attackEntityFrom(DamageSource var1, float var2) { -- if(this.isEntityInvulnerable()) { -+ /** -+ * Called when the entity is attacked. -+ */ -+ public boolean attackEntityFrom(DamageSource par1DamageSource, float par2) { -+ if (this.isEntityInvulnerable()) { - return false; - } else { - this.setBeenAttacked(); -- if(var1.getEntity() != null) { -- Vec3 var3 = var1.getEntity().getLookVec(); -- if(var3 != null) { -+ -+ if (par1DamageSource.getEntity() != null) { -+ Vec3 var3 = par1DamageSource.getEntity().getLookVec(); -+ -+ if (var3 != null) { - this.motionX = var3.xCoord; - this.motionY = var3.yCoord; - this.motionZ = var3.zCoord; -@@ -221,8 +260,8 @@ - this.accelerationZ = this.motionZ * 0.1D; - } - -- if(var1.getEntity() instanceof EntityLivingBase) { -- this.shootingEntity = (EntityLivingBase)var1.getEntity(); -+ if (par1DamageSource.getEntity() instanceof EntityLivingBase) { -+ this.shootingEntity = (EntityLivingBase)par1DamageSource.getEntity(); - } - - return true; -@@ -236,11 +275,14 @@ - return 0.0F; - } - -- public float getBrightness(float var1) { -+ /** -+ * Gets how bright this entity is. -+ */ -+ public float getBrightness(float par1) { - return 1.0F; - } - -- public int getBrightnessForRender(float var1) { -+ public int getBrightnessForRender(float par1) { - return 15728880; - } - } ---- net/minecraft/src/DispenserBehaviorDye.java -+++ net/minecraft/src/DispenserBehaviorDye.java -@@ -3,33 +3,39 @@ - final class DispenserBehaviorDye extends BehaviorDefaultDispenseItem { - private boolean field_96461_b = true; - -- protected ItemStack dispenseStack(IBlockSource var1, ItemStack var2) { -- if(var2.getItemDamage() == 15) { -- EnumFacing var3 = BlockDispenser.getFacing(var1.getBlockMetadata()); -- World var4 = var1.getWorld(); -- int var5 = var1.getXInt() + var3.getFrontOffsetX(); -- int var6 = var1.getYInt() + var3.getFrontOffsetY(); -- int var7 = var1.getZInt() + var3.getFrontOffsetZ(); -- if(ItemDye.func_96604_a(var2, var4, var5, var6, var7)) { -- if(!var4.isRemote) { -+ /** -+ * Dispense the specified stack, play the dispense sound and spawn particles. -+ */ -+ protected ItemStack dispenseStack(IBlockSource par1IBlockSource, ItemStack par2ItemStack) { -+ if (par2ItemStack.getItemDamage() == 15) { -+ EnumFacing var3 = BlockDispenser.getFacing(par1IBlockSource.getBlockMetadata()); -+ World var4 = par1IBlockSource.getWorld(); -+ int var5 = par1IBlockSource.getXInt() + var3.getFrontOffsetX(); -+ int var6 = par1IBlockSource.getYInt() + var3.getFrontOffsetY(); -+ int var7 = par1IBlockSource.getZInt() + var3.getFrontOffsetZ(); -+ -+ if (ItemDye.func_96604_a(par2ItemStack, var4, var5, var6, var7)) { -+ if (!var4.isRemote) { - var4.playAuxSFX(2005, var5, var6, var7, 0); - } - } else { - this.field_96461_b = false; - } - -- return var2; -+ return par2ItemStack; - } else { -- return super.dispenseStack(var1, var2); -+ return super.dispenseStack(par1IBlockSource, par2ItemStack); - } - } - -- protected void playDispenseSound(IBlockSource var1) { -- if(this.field_96461_b) { -- var1.getWorld().playAuxSFX(1000, var1.getXInt(), var1.getYInt(), var1.getZInt(), 0); -+ /** -+ * Play the dispense sound from the specified block. -+ */ -+ protected void playDispenseSound(IBlockSource par1IBlockSource) { -+ if (this.field_96461_b) { -+ par1IBlockSource.getWorld().playAuxSFX(1000, par1IBlockSource.getXInt(), par1IBlockSource.getYInt(), par1IBlockSource.getZInt(), 0); - } else { -- var1.getWorld().playAuxSFX(1001, var1.getXInt(), var1.getYInt(), var1.getZInt(), 0); -+ par1IBlockSource.getWorld().playAuxSFX(1001, par1IBlockSource.getXInt(), par1IBlockSource.getYInt(), par1IBlockSource.getZInt(), 0); - } -- - } - } ---- net/minecraft/src/EntitySenses.java -+++ net/minecraft/src/EntitySenses.java -@@ -5,31 +5,42 @@ - - public class EntitySenses { - EntityLiving entityObj; -- List b = new ArrayList(); -- List c = new ArrayList(); -- -- public EntitySenses(EntityLiving var1) { -- this.entityObj = var1; -+ -+ /** Cache of entities which we can see */ -+ List seenEntities = new ArrayList(); -+ -+ /** Cache of entities which we cannot see */ -+ List unseenEntities = new ArrayList(); -+ -+ public EntitySenses(EntityLiving par1EntityLiving) { -+ this.entityObj = par1EntityLiving; - } - -+ /** -+ * Clears canSeeCachePositive and canSeeCacheNegative. -+ */ - public void clearSensingCache() { -- this.b.clear(); -- this.c.clear(); -+ this.seenEntities.clear(); -+ this.unseenEntities.clear(); - } - -- public boolean canSee(Entity var1) { -- if(this.b.contains(var1)) { -+ /** -+ * Checks, whether 'our' entity can see the entity given as argument (true) or not (false), caching the result. -+ */ -+ public boolean canSee(Entity par1Entity) { -+ if (this.seenEntities.contains(par1Entity)) { - return true; -- } else if(this.c.contains(var1)) { -+ } else if (this.unseenEntities.contains(par1Entity)) { - return false; - } else { - this.entityObj.worldObj.theProfiler.startSection("canSee"); -- boolean var2 = this.entityObj.canEntityBeSeen(var1); -+ boolean var2 = this.entityObj.canEntityBeSeen(par1Entity); - this.entityObj.worldObj.theProfiler.endSection(); -- if(var2) { -- this.b.add(var1); -+ -+ if (var2) { -+ this.seenEntities.add(par1Entity); - } else { -- this.c.add(var1); -+ this.unseenEntities.add(par1Entity); - } - - return var2; ---- net/minecraft/src/CompressedStreamTools.java -+++ net/minecraft/src/CompressedStreamTools.java -@@ -17,12 +17,16 @@ - import java.util.zip.GZIPOutputStream; - - public class CompressedStreamTools { -- public static NBTTagCompound readCompressed(InputStream var0) throws IOException { -- DataInputStream var1 = new DataInputStream(new BufferedInputStream(new GZIPInputStream(var0))); - -+ /** -+ * Load the gzipped compound from the inputstream. -+ */ -+ public static NBTTagCompound readCompressed(InputStream par0InputStream) throws IOException { -+ DataInputStream var1 = new DataInputStream(new BufferedInputStream(new GZIPInputStream(par0InputStream))); - NBTTagCompound var2; -+ - try { -- var2 = read((DataInput)var1); -+ var2 = read(var1); - } finally { - var1.close(); - } -@@ -30,23 +34,25 @@ - return var2; - } - -- public static void writeCompressed(NBTTagCompound var0, OutputStream var1) throws IOException { -- DataOutputStream var2 = new DataOutputStream(new GZIPOutputStream(var1)); -+ /** -+ * Write the compound, gzipped, to the outputstream. -+ */ -+ public static void writeCompressed(NBTTagCompound par0NBTTagCompound, OutputStream par1OutputStream) throws IOException { -+ DataOutputStream var2 = new DataOutputStream(new GZIPOutputStream(par1OutputStream)); - - try { -- write(var0, (DataOutput)var2); -+ write(par0NBTTagCompound, var2); - } finally { - var2.close(); - } -- - } - -- public static NBTTagCompound decompress(byte[] var0) throws IOException { -- DataInputStream var1 = new DataInputStream(new BufferedInputStream(new GZIPInputStream(new ByteArrayInputStream(var0)))); -- -+ public static NBTTagCompound decompress(byte[] par0ArrayOfByte) throws IOException { -+ DataInputStream var1 = new DataInputStream(new BufferedInputStream(new GZIPInputStream(new ByteArrayInputStream(par0ArrayOfByte)))); - NBTTagCompound var2; -+ - try { -- var2 = read((DataInput)var1); -+ var2 = read(var1); - } finally { - var1.close(); - } -@@ -54,12 +60,12 @@ - return var2; - } - -- public static byte[] compress(NBTTagCompound var0) throws IOException { -+ public static byte[] compress(NBTTagCompound par0NBTTagCompound) throws IOException { - ByteArrayOutputStream var1 = new ByteArrayOutputStream(); - DataOutputStream var2 = new DataOutputStream(new GZIPOutputStream(var1)); - - try { -- write(var0, (DataOutput)var2); -+ write(par0NBTTagCompound, var2); - } finally { - var2.close(); - } -@@ -67,44 +73,45 @@ - return var1.toByteArray(); - } - -- public static void safeWrite(NBTTagCompound var0, File var1) throws IOException { -- File var2 = new File(var1.getAbsolutePath() + "_tmp"); -- if(var2.exists()) { -+ public static void safeWrite(NBTTagCompound par0NBTTagCompound, File par1File) throws IOException { -+ File var2 = new File(par1File.getAbsolutePath() + "_tmp"); -+ -+ if (var2.exists()) { - var2.delete(); - } - -- write(var0, var2); -- if(var1.exists()) { -- var1.delete(); -+ write(par0NBTTagCompound, var2); -+ -+ if (par1File.exists()) { -+ par1File.delete(); - } - -- if(var1.exists()) { -- throw new IOException("Failed to delete " + var1); -+ if (par1File.exists()) { -+ throw new IOException("Failed to delete " + par1File); - } else { -- var2.renameTo(var1); -+ var2.renameTo(par1File); - } - } - -- public static void write(NBTTagCompound var0, File var1) throws IOException { -- DataOutputStream var2 = new DataOutputStream(new FileOutputStream(var1)); -+ public static void write(NBTTagCompound par0NBTTagCompound, File par1File) throws IOException { -+ DataOutputStream var2 = new DataOutputStream(new FileOutputStream(par1File)); - - try { -- write(var0, (DataOutput)var2); -+ write(par0NBTTagCompound, var2); - } finally { - var2.close(); - } -- - } - -- public static NBTTagCompound read(File var0) throws IOException { -- if(!var0.exists()) { -+ public static NBTTagCompound read(File par0File) throws IOException { -+ if (!par0File.exists()) { - return null; - } else { -- DataInputStream var1 = new DataInputStream(new FileInputStream(var0)); -- -+ DataInputStream var1 = new DataInputStream(new FileInputStream(par0File)); - NBTTagCompound var2; -+ - try { -- var2 = read((DataInput)var1); -+ var2 = read(var1); - } finally { - var1.close(); - } -@@ -113,16 +120,20 @@ - } - } - -- public static NBTTagCompound read(DataInput var0) throws IOException { -- NBTBase var1 = NBTBase.readNamedTag(var0); -- if(var1 instanceof NBTTagCompound) { -+ /** -+ * Reads from a CompressedStream. -+ */ -+ public static NBTTagCompound read(DataInput par0DataInput) throws IOException { -+ NBTBase var1 = NBTBase.readNamedTag(par0DataInput); -+ -+ if (var1 instanceof NBTTagCompound) { - return (NBTTagCompound)var1; - } else { - throw new IOException("Root tag must be a named compound tag"); - } - } - -- public static void write(NBTTagCompound var0, DataOutput var1) throws IOException { -- NBTBase.writeNamedTag(var0, var1); -+ public static void write(NBTTagCompound par0NBTTagCompound, DataOutput par1DataOutput) throws IOException { -+ NBTBase.writeNamedTag(par0NBTTagCompound, par1DataOutput); - } - } ---- net/minecraft/src/RegionFileCache.java -+++ net/minecraft/src/RegionFileCache.java -@@ -9,37 +9,43 @@ - import java.util.Map; - - public class RegionFileCache { -- private static final Map a = new HashMap(); -- -- public static synchronized RegionFile createOrLoadRegionFile(File var0, int var1, int var2) { -- File var3 = new File(var0, "region"); -- File var4 = new File(var3, "r." + (var1 >> 5) + "." + (var2 >> 5) + ".mca"); -- RegionFile var5 = (RegionFile)a.get(var4); -- if(var5 != null) { -+ -+ /** A map containing Files as keys and RegionFiles as values */ -+ private static final Map regionsByFilename = new HashMap(); -+ -+ public static synchronized RegionFile createOrLoadRegionFile(File par0File, int par1, int par2) { -+ File var3 = new File(par0File, "region"); -+ File var4 = new File(var3, "r." + (par1 >> 5) + "." + (par2 >> 5) + ".mca"); -+ RegionFile var5 = (RegionFile)regionsByFilename.get(var4); -+ -+ if (var5 != null) { - return var5; - } else { -- if(!var3.exists()) { -+ if (!var3.exists()) { - var3.mkdirs(); - } - -- if(a.size() >= 256) { -+ if (regionsByFilename.size() >= 256) { - clearRegionFileReferences(); - } - - RegionFile var6 = new RegionFile(var4); -- a.put(var4, var6); -+ regionsByFilename.put(var4, var6); - return var6; - } - } - -+ /** -+ * Saves the current Chunk Map Cache -+ */ - public static synchronized void clearRegionFileReferences() { -- Iterator var0 = a.values().iterator(); -+ Iterator var0 = regionsByFilename.values().iterator(); - -- while(var0.hasNext()) { -+ while (var0.hasNext()) { - RegionFile var1 = (RegionFile)var0.next(); - - try { -- if(var1 != null) { -+ if (var1 != null) { - var1.close(); - } - } catch (IOException var3) { -@@ -47,16 +53,22 @@ - } - } - -- a.clear(); -- } -- -- public static DataInputStream getChunkInputStream(File var0, int var1, int var2) { -- RegionFile var3 = createOrLoadRegionFile(var0, var1, var2); -- return var3.getChunkDataInputStream(var1 & 31, var2 & 31); -- } -- -- public static DataOutputStream getChunkOutputStream(File var0, int var1, int var2) { -- RegionFile var3 = createOrLoadRegionFile(var0, var1, var2); -- return var3.getChunkDataOutputStream(var1 & 31, var2 & 31); -+ regionsByFilename.clear(); -+ } -+ -+ /** -+ * Returns an input stream for the specified chunk. Args: worldDir, chunkX, chunkZ -+ */ -+ public static DataInputStream getChunkInputStream(File par0File, int par1, int par2) { -+ RegionFile var3 = createOrLoadRegionFile(par0File, par1, par2); -+ return var3.getChunkDataInputStream(par1 & 31, par2 & 31); -+ } -+ -+ /** -+ * Returns an output stream for the specified chunk. Args: worldDir, chunkX, chunkZ -+ */ -+ public static DataOutputStream getChunkOutputStream(File par0File, int par1, int par2) { -+ RegionFile var3 = createOrLoadRegionFile(par0File, par1, par2); -+ return var3.getChunkDataOutputStream(par1 & 31, par2 & 31); - } - } ---- net/minecraft/src/NBTTagByte.java -+++ net/minecraft/src/NBTTagByte.java -@@ -5,25 +5,36 @@ - import java.io.IOException; - - public class NBTTagByte extends NBTBase { -+ -+ /** The byte value for the tag. */ - public byte data; - -- public NBTTagByte(String var1) { -- super(var1); -- } -- -- public NBTTagByte(String var1, byte var2) { -- super(var1); -- this.data = var2; -- } -- -- void write(DataOutput var1) throws IOException { -- var1.writeByte(this.data); -- } -- -- void load(DataInput var1, int var2) throws IOException { -- this.data = var1.readByte(); -- } -- -+ public NBTTagByte(String par1Str) { -+ super(par1Str); -+ } -+ -+ public NBTTagByte(String par1Str, byte par2) { -+ super(par1Str); -+ this.data = par2; -+ } -+ -+ /** -+ * Write the actual data contents of the tag, implemented in NBT extension classes -+ */ -+ void write(DataOutput par1DataOutput) throws IOException { -+ par1DataOutput.writeByte(this.data); -+ } -+ -+ /** -+ * Read the actual data contents of the tag, implemented in NBT extension classes -+ */ -+ void load(DataInput par1DataInput, int par2) throws IOException { -+ this.data = par1DataInput.readByte(); -+ } -+ -+ /** -+ * Gets the type byte for the tag. -+ */ - public byte getId() { - return (byte)1; - } -@@ -32,13 +43,16 @@ - return "" + this.data; - } - -+ /** -+ * Creates a clone of the tag. -+ */ - public NBTBase copy() { - return new NBTTagByte(this.getName(), this.data); - } - -- public boolean equals(Object var1) { -- if(super.equals(var1)) { -- NBTTagByte var2 = (NBTTagByte)var1; -+ public boolean equals(Object par1Obj) { -+ if (super.equals(par1Obj)) { -+ NBTTagByte var2 = (NBTTagByte)par1Obj; - return this.data == var2.data; - } else { - return false; ---- net/minecraft/src/Packet27PlayerInput.java -+++ net/minecraft/src/Packet27PlayerInput.java -@@ -10,34 +10,45 @@ - private boolean field_111016_c; - private boolean field_111014_d; - -- public Packet27PlayerInput() { -- } -- -- public Packet27PlayerInput(float var1, float var2, boolean var3, boolean var4) { -- this.field_111017_a = var1; -- this.field_111015_b = var2; -- this.field_111016_c = var3; -- this.field_111014_d = var4; -- } -- -- public void readPacketData(DataInput var1) throws IOException { -- this.field_111017_a = var1.readFloat(); -- this.field_111015_b = var1.readFloat(); -- this.field_111016_c = var1.readBoolean(); -- this.field_111014_d = var1.readBoolean(); -- } -- -- public void writePacketData(DataOutput var1) throws IOException { -- var1.writeFloat(this.field_111017_a); -- var1.writeFloat(this.field_111015_b); -- var1.writeBoolean(this.field_111016_c); -- var1.writeBoolean(this.field_111014_d); -- } -- -- public void processPacket(NetHandler var1) { -- var1.func_110774_a(this); -- } -- -+ public Packet27PlayerInput() {} -+ -+ public Packet27PlayerInput(float par1, float par2, boolean par3, boolean par4) { -+ this.field_111017_a = par1; -+ this.field_111015_b = par2; -+ this.field_111016_c = par3; -+ this.field_111014_d = par4; -+ } -+ -+ /** -+ * Abstract. Reads the raw packet data from the data stream. -+ */ -+ public void readPacketData(DataInput par1DataInput) throws IOException { -+ this.field_111017_a = par1DataInput.readFloat(); -+ this.field_111015_b = par1DataInput.readFloat(); -+ this.field_111016_c = par1DataInput.readBoolean(); -+ this.field_111014_d = par1DataInput.readBoolean(); -+ } -+ -+ /** -+ * Abstract. Writes the raw packet data to the data stream. -+ */ -+ public void writePacketData(DataOutput par1DataOutput) throws IOException { -+ par1DataOutput.writeFloat(this.field_111017_a); -+ par1DataOutput.writeFloat(this.field_111015_b); -+ par1DataOutput.writeBoolean(this.field_111016_c); -+ par1DataOutput.writeBoolean(this.field_111014_d); -+ } -+ -+ /** -+ * Passes this Packet on to the NetHandler for processing. -+ */ -+ public void processPacket(NetHandler par1NetHandler) { -+ par1NetHandler.func_110774_a(this); -+ } -+ -+ /** -+ * Abstract. Return the size of the packet (not counting the header). -+ */ - public int getPacketSize() { - return 10; - } ---- net/minecraft/src/VillageSiege.java -+++ net/minecraft/src/VillageSiege.java -@@ -9,131 +9,141 @@ - private int field_75536_c = -1; - private int field_75533_d; - private int field_75534_e; -+ -+ /** Instance of Village. */ - private Village theVillage; - private int field_75532_g; - private int field_75538_h; - private int field_75539_i; - -- public VillageSiege(World var1) { -- this.worldObj = var1; -+ public VillageSiege(World par1World) { -+ this.worldObj = par1World; - } - -+ /** -+ * Runs a single tick for the village siege -+ */ - public void tick() { - boolean var1 = false; -- if(var1) { -- if(this.field_75536_c == 2) { -+ -+ if (var1) { -+ if (this.field_75536_c == 2) { - this.field_75533_d = 100; - return; - } - } else { -- if(this.worldObj.isDaytime()) { -+ if (this.worldObj.isDaytime()) { - this.field_75536_c = 0; - return; - } - -- if(this.field_75536_c == 2) { -+ if (this.field_75536_c == 2) { - return; - } - -- if(this.field_75536_c == 0) { -+ if (this.field_75536_c == 0) { - float var2 = this.worldObj.getCelestialAngle(0.0F); -- if((double)var2 < 0.5D || (double)var2 > 0.501D) { -+ -+ if ((double)var2 < 0.5D || (double)var2 > 0.501D) { - return; - } - -- this.field_75536_c = this.worldObj.s.nextInt(10) == 0 ? 1 : 2; -+ this.field_75536_c = this.worldObj.rand.nextInt(10) == 0 ? 1 : 2; - this.field_75535_b = false; -- if(this.field_75536_c == 2) { -+ -+ if (this.field_75536_c == 2) { - return; - } - } - } - -- if(!this.field_75535_b) { -- if(!this.func_75529_b()) { -+ if (!this.field_75535_b) { -+ if (!this.func_75529_b()) { - return; - } - - this.field_75535_b = true; - } - -- if(this.field_75534_e > 0) { -+ if (this.field_75534_e > 0) { - --this.field_75534_e; - } else { - this.field_75534_e = 2; -- if(this.field_75533_d > 0) { -+ -+ if (this.field_75533_d > 0) { - this.spawnZombie(); - --this.field_75533_d; - } else { - this.field_75536_c = 2; - } -- - } - } - - private boolean func_75529_b() { -- List var1 = this.worldObj.h; -+ List var1 = this.worldObj.playerEntities; - Iterator var2 = var1.iterator(); - -- Vec3 var10; -- do { -- do { -- do { -- do { -- do { -- if(!var2.hasNext()) { -- return false; -+ while (var2.hasNext()) { -+ EntityPlayer var3 = (EntityPlayer)var2.next(); -+ this.theVillage = this.worldObj.villageCollectionObj.findNearestVillage((int)var3.posX, (int)var3.posY, (int)var3.posZ, 1); -+ -+ if (this.theVillage != null && this.theVillage.getNumVillageDoors() >= 10 && this.theVillage.getTicksSinceLastDoorAdding() >= 20 && this.theVillage.getNumVillagers() >= 20) { -+ ChunkCoordinates var4 = this.theVillage.getCenter(); -+ float var5 = (float)this.theVillage.getVillageRadius(); -+ boolean var6 = false; -+ int var7 = 0; -+ -+ while (true) { -+ if (var7 < 10) { -+ this.field_75532_g = var4.posX + (int)((double)(MathHelper.cos(this.worldObj.rand.nextFloat() * (float)Math.PI * 2.0F) * var5) * 0.9D); -+ this.field_75538_h = var4.posY; -+ this.field_75539_i = var4.posZ + (int)((double)(MathHelper.sin(this.worldObj.rand.nextFloat() * (float)Math.PI * 2.0F) * var5) * 0.9D); -+ var6 = false; -+ Iterator var8 = this.worldObj.villageCollectionObj.getVillageList().iterator(); -+ -+ while (var8.hasNext()) { -+ Village var9 = (Village)var8.next(); -+ -+ if (var9 != this.theVillage && var9.isInRange(this.field_75532_g, this.field_75538_h, this.field_75539_i)) { -+ var6 = true; -+ break; - } -- -- EntityPlayer var3 = (EntityPlayer)var2.next(); -- this.theVillage = this.worldObj.villageCollectionObj.findNearestVillage((int)var3.posX, (int)var3.posY, (int)var3.posZ, 1); -- } while(this.theVillage == null); -- } while(this.theVillage.getNumVillageDoors() < 10); -- } while(this.theVillage.getTicksSinceLastDoorAdding() < 20); -- } while(this.theVillage.getNumVillagers() < 20); -- -- ChunkCoordinates var4 = this.theVillage.getCenter(); -- float var5 = (float)this.theVillage.getVillageRadius(); -- boolean var6 = false; -- -- for(int var7 = 0; var7 < 10; ++var7) { -- this.field_75532_g = var4.posX + (int)((double)(MathHelper.cos(this.worldObj.s.nextFloat() * (float)Math.PI * 2.0F) * var5) * 0.9D); -- this.field_75538_h = var4.posY; -- this.field_75539_i = var4.posZ + (int)((double)(MathHelper.sin(this.worldObj.s.nextFloat() * (float)Math.PI * 2.0F) * var5) * 0.9D); -- var6 = false; -- Iterator var8 = this.worldObj.villageCollectionObj.getVillageList().iterator(); -- -- while(var8.hasNext()) { -- Village var9 = (Village)var8.next(); -- if(var9 != this.theVillage && var9.isInRange(this.field_75532_g, this.field_75538_h, this.field_75539_i)) { -- var6 = true; -- break; -- } -- } -- -- if(!var6) { -+ } -+ -+ if (var6) { -+ ++var7; -+ continue; -+ } -+ } -+ -+ if (var6) { -+ return false; -+ } -+ -+ Vec3 var10 = this.func_75527_a(this.field_75532_g, this.field_75538_h, this.field_75539_i); -+ -+ if (var10 != null) { -+ this.field_75534_e = 0; -+ this.field_75533_d = 20; -+ return true; -+ } -+ - break; - } - } -- -- if(var6) { -- return false; -- } -- -- var10 = this.func_75527_a(this.field_75532_g, this.field_75538_h, this.field_75539_i); -- } while(var10 == null); -- -- this.field_75534_e = 0; -- this.field_75533_d = 20; -- return true; -+ } -+ -+ return false; - } - - private boolean spawnZombie() { - Vec3 var1 = this.func_75527_a(this.field_75532_g, this.field_75538_h, this.field_75539_i); -- if(var1 == null) { -+ -+ if (var1 == null) { - return false; - } else { - EntityZombie var2; -+ - try { - var2 = new EntityZombie(this.worldObj); - var2.onSpawnWithEgg((EntityLivingData)null); -@@ -143,7 +153,7 @@ - return false; - } - -- var2.setLocationAndAngles(var1.xCoord, var1.yCoord, var1.zCoord, this.worldObj.s.nextFloat() * 360.0F, 0.0F); -+ var2.setLocationAndAngles(var1.xCoord, var1.yCoord, var1.zCoord, this.worldObj.rand.nextFloat() * 360.0F, 0.0F); - this.worldObj.spawnEntityInWorld(var2); - ChunkCoordinates var3 = this.theVillage.getCenter(); - var2.setHomeArea(var3.posX, var3.posY, var3.posZ, this.theVillage.getVillageRadius()); -@@ -151,12 +161,13 @@ - } - } - -- private Vec3 func_75527_a(int var1, int var2, int var3) { -- for(int var4 = 0; var4 < 10; ++var4) { -- int var5 = var1 + this.worldObj.s.nextInt(16) - 8; -- int var6 = var2 + this.worldObj.s.nextInt(6) - 3; -- int var7 = var3 + this.worldObj.s.nextInt(16) - 8; -- if(this.theVillage.isInRange(var5, var6, var7) && SpawnerAnimals.canCreatureTypeSpawnAtLocation(EnumCreatureType.monster, this.worldObj, var5, var6, var7)) { -+ private Vec3 func_75527_a(int par1, int par2, int par3) { -+ for (int var4 = 0; var4 < 10; ++var4) { -+ int var5 = par1 + this.worldObj.rand.nextInt(16) - 8; -+ int var6 = par2 + this.worldObj.rand.nextInt(6) - 3; -+ int var7 = par3 + this.worldObj.rand.nextInt(16) - 8; -+ -+ if (this.theVillage.isInRange(var5, var6, var7) && SpawnerAnimals.canCreatureTypeSpawnAtLocation(EnumCreatureType.monster, this.worldObj, var5, var6, var7)) { - this.worldObj.getWorldVec3Pool().getVecFromPool((double)var5, (double)var6, (double)var7); - } - } ---- net/minecraft/src/GuiSelectWorld.java -+++ net/minecraft/src/GuiSelectWorld.java -@@ -6,28 +6,59 @@ - import java.util.List; - - public class GuiSelectWorld extends GuiScreen { -- private final DateFormat c = new SimpleDateFormat(); -+ -+ /** simple date formater */ -+ private final DateFormat dateFormatter = new SimpleDateFormat(); -+ -+ /** -+ * A reference to the screen object that created this. Used for navigating between screens. -+ */ - protected GuiScreen parentScreen; -- protected String b = "Select world"; -+ -+ /** The title string that is displayed in the top-center of the screen. */ -+ protected String screenTitle = "Select world"; -+ -+ /** True if a world has been selected. */ - private boolean selected; -+ -+ /** the currently selected world */ - private int selectedWorld; -- private List p; -+ -+ /** The save list for the world selection screen */ -+ private List saveList; - private GuiWorldSlot worldSlotContainer; -- private String r; -- private String s; -- private String[] t = new String[3]; -+ -+ /** E.g. World, Welt, Monde, Mundo */ -+ private String localizedWorldText; -+ private String localizedMustConvertText; -+ -+ /** -+ * The game mode text that is displayed with each world on the world selection list. -+ */ -+ private String[] localizedGameModeText = new String[3]; -+ -+ /** set to true if you arein the process of deleteing a world/save */ - private boolean deleting; -+ -+ /** The delete button in the world selection GUI */ - private GuiButton buttonDelete; -+ -+ /** the select button in the world selection gui */ - private GuiButton buttonSelect; -+ -+ /** The rename button in the world selection GUI */ - private GuiButton buttonRename; - private GuiButton buttonRecreate; - -- public GuiSelectWorld(GuiScreen var1) { -- this.parentScreen = var1; -+ public GuiSelectWorld(GuiScreen par1GuiScreen) { -+ this.parentScreen = par1GuiScreen; - } - -+ /** -+ * Adds the buttons (and other controls) to the screen in question. -+ */ - public void initGui() { -- this.b = I18n.getString("selectWorld.title"); -+ this.screenTitle = I18n.getString("selectWorld.title"); - - try { - this.loadSaves(); -@@ -37,67 +68,84 @@ - return; - } - -- this.r = I18n.getString("selectWorld.world"); -- this.s = I18n.getString("selectWorld.conversion"); -- this.t[EnumGameType.SURVIVAL.getID()] = I18n.getString("gameMode.survival"); -- this.t[EnumGameType.CREATIVE.getID()] = I18n.getString("gameMode.creative"); -- this.t[EnumGameType.ADVENTURE.getID()] = I18n.getString("gameMode.adventure"); -+ this.localizedWorldText = I18n.getString("selectWorld.world"); -+ this.localizedMustConvertText = I18n.getString("selectWorld.conversion"); -+ this.localizedGameModeText[EnumGameType.SURVIVAL.getID()] = I18n.getString("gameMode.survival"); -+ this.localizedGameModeText[EnumGameType.CREATIVE.getID()] = I18n.getString("gameMode.creative"); -+ this.localizedGameModeText[EnumGameType.ADVENTURE.getID()] = I18n.getString("gameMode.adventure"); - this.worldSlotContainer = new GuiWorldSlot(this); - this.worldSlotContainer.registerScrollButtons(4, 5); - this.initButtons(); - } - -+ /** -+ * loads the saves -+ */ - private void loadSaves() throws AnvilConverterException { - ISaveFormat var1 = this.mc.getSaveLoader(); -- this.p = var1.getSaveList(); -- Collections.sort(this.p); -+ this.saveList = var1.getSaveList(); -+ Collections.sort(this.saveList); - this.selectedWorld = -1; - } - -- protected String getSaveFileName(int var1) { -- return ((SaveFormatComparator)this.p.get(var1)).getFileName(); -+ /** -+ * returns the file name of the specified save number -+ */ -+ protected String getSaveFileName(int par1) { -+ return ((SaveFormatComparator)this.saveList.get(par1)).getFileName(); - } - -- protected String getSaveName(int var1) { -- String var2 = ((SaveFormatComparator)this.p.get(var1)).getDisplayName(); -- if(var2 == null || MathHelper.stringNullOrLengthZero(var2)) { -- var2 = I18n.getString("selectWorld.world") + " " + (var1 + 1); -+ /** -+ * returns the name of the saved game -+ */ -+ protected String getSaveName(int par1) { -+ String var2 = ((SaveFormatComparator)this.saveList.get(par1)).getDisplayName(); -+ -+ if (var2 == null || MathHelper.stringNullOrLengthZero(var2)) { -+ var2 = I18n.getString("selectWorld.world") + " " + (par1 + 1); - } - - return var2; - } - -+ /** -+ * intilize the buttons for this GUI -+ */ - public void initButtons() { -- this.i.add(this.buttonSelect = new GuiButton(1, this.width / 2 - 154, this.height - 52, 150, 20, I18n.getString("selectWorld.select"))); -- this.i.add(new GuiButton(3, this.width / 2 + 4, this.height - 52, 150, 20, I18n.getString("selectWorld.create"))); -- this.i.add(this.buttonRename = new GuiButton(6, this.width / 2 - 154, this.height - 28, 72, 20, I18n.getString("selectWorld.rename"))); -- this.i.add(this.buttonDelete = new GuiButton(2, this.width / 2 - 76, this.height - 28, 72, 20, I18n.getString("selectWorld.delete"))); -- this.i.add(this.buttonRecreate = new GuiButton(7, this.width / 2 + 4, this.height - 28, 72, 20, I18n.getString("selectWorld.recreate"))); -- this.i.add(new GuiButton(0, this.width / 2 + 82, this.height - 28, 72, 20, I18n.getString("gui.cancel"))); -+ this.buttonList.add(this.buttonSelect = new GuiButton(1, this.width / 2 - 154, this.height - 52, 150, 20, I18n.getString("selectWorld.select"))); -+ this.buttonList.add(new GuiButton(3, this.width / 2 + 4, this.height - 52, 150, 20, I18n.getString("selectWorld.create"))); -+ this.buttonList.add(this.buttonRename = new GuiButton(6, this.width / 2 - 154, this.height - 28, 72, 20, I18n.getString("selectWorld.rename"))); -+ this.buttonList.add(this.buttonDelete = new GuiButton(2, this.width / 2 - 76, this.height - 28, 72, 20, I18n.getString("selectWorld.delete"))); -+ this.buttonList.add(this.buttonRecreate = new GuiButton(7, this.width / 2 + 4, this.height - 28, 72, 20, I18n.getString("selectWorld.recreate"))); -+ this.buttonList.add(new GuiButton(0, this.width / 2 + 82, this.height - 28, 72, 20, I18n.getString("gui.cancel"))); - this.buttonSelect.enabled = false; - this.buttonDelete.enabled = false; - this.buttonRename.enabled = false; - this.buttonRecreate.enabled = false; - } - -- protected void actionPerformed(GuiButton var1) { -- if(var1.enabled) { -- if(var1.id == 2) { -+ /** -+ * Fired when a control is clicked. This is the equivalent of ActionListener.actionPerformed(ActionEvent e). -+ */ -+ protected void actionPerformed(GuiButton par1GuiButton) { -+ if (par1GuiButton.enabled) { -+ if (par1GuiButton.id == 2) { - String var2 = this.getSaveName(this.selectedWorld); -- if(var2 != null) { -+ -+ if (var2 != null) { - this.deleting = true; - GuiYesNo var3 = getDeleteWorldScreen(this, var2, this.selectedWorld); - this.mc.displayGuiScreen(var3); - } -- } else if(var1.id == 1) { -+ } else if (par1GuiButton.id == 1) { - this.selectWorld(this.selectedWorld); -- } else if(var1.id == 3) { -+ } else if (par1GuiButton.id == 3) { - this.mc.displayGuiScreen(new GuiCreateWorld(this)); -- } else if(var1.id == 6) { -+ } else if (par1GuiButton.id == 6) { - this.mc.displayGuiScreen(new GuiRenameWorld(this, this.getSaveFileName(this.selectedWorld))); -- } else if(var1.id == 0) { -- this.mc.displayGuiScreen(this.parentScreen); -- } else if(var1.id == 7) { -+ } else if (par1GuiButton.id == 0) { -+ this.mc.displayGuiScreen(new org.spoutcraft.client.gui.mainmenu.MainMenu()); // Spout -+ } else if (par1GuiButton.id == 7) { - GuiCreateWorld var5 = new GuiCreateWorld(this); - ISaveHandler var6 = this.mc.getSaveLoader().getSaveLoader(this.getSaveFileName(this.selectedWorld), false); - WorldInfo var4 = var6.loadWorldInfo(); -@@ -105,41 +153,46 @@ - var5.func_82286_a(var4); - this.mc.displayGuiScreen(var5); - } else { -- this.worldSlotContainer.actionPerformed(var1); -+ this.worldSlotContainer.actionPerformed(par1GuiButton); - } -- - } - } - -- public void selectWorld(int var1) { -+ /** -+ * Gets the selected world. -+ */ -+ public void selectWorld(int par1) { - this.mc.displayGuiScreen((GuiScreen)null); -- if(!this.selected) { -+ -+ if (!this.selected) { - this.selected = true; -- String var2 = this.getSaveFileName(var1); -- if(var2 == null) { -- var2 = "World" + var1; -- } -- -- String var3 = this.getSaveName(var1); -- if(var3 == null) { -- var3 = "World" + var1; -- } -- -- if(this.mc.getSaveLoader().canLoadWorld(var2)) { -+ String var2 = this.getSaveFileName(par1); -+ -+ if (var2 == null) { -+ var2 = "World" + par1; -+ } -+ -+ String var3 = this.getSaveName(par1); -+ -+ if (var3 == null) { -+ var3 = "World" + par1; -+ } -+ -+ if (this.mc.getSaveLoader().canLoadWorld(var2)) { - this.mc.launchIntegratedServer(var2, var3, (WorldSettings)null); - this.mc.statFileWriter.readStat(StatList.loadWorldStat, 1); - } -- - } - } - -- public void confirmClicked(boolean var1, int var2) { -- if(this.deleting) { -+ public void confirmClicked(boolean par1, int par2) { -+ if (this.deleting) { - this.deleting = false; -- if(var1) { -+ -+ if (par1) { - ISaveFormat var3 = this.mc.getSaveLoader(); - var3.flushCache(); -- var3.deleteWorldDirectory(this.getSaveFileName(var2)); -+ var3.deleteWorldDirectory(this.getSaveFileName(par2)); - - try { - this.loadSaves(); -@@ -150,65 +203,85 @@ - - this.mc.displayGuiScreen(this); - } -- -- } -- -- public void drawScreen(int var1, int var2, float var3) { -- this.worldSlotContainer.drawScreen(var1, var2, var3); -- this.drawCenteredString(this.fontRenderer, this.b, this.width / 2, 20, 16777215); -- super.drawScreen(var1, var2, var3); -- } -- -- public static GuiYesNo getDeleteWorldScreen(GuiScreen var0, String var1, int var2) { -+ } -+ -+ /** -+ * Draws the screen and all the components in it. -+ */ -+ public void drawScreen(int par1, int par2, float par3) { -+ this.worldSlotContainer.drawScreen(par1, par2, par3); -+ this.drawCenteredString(this.fontRenderer, this.screenTitle, this.width / 2, 20, 16777215); -+ super.drawScreen(par1, par2, par3); -+ } -+ -+ /** -+ * Gets a GuiYesNo screen with the warning, buttons, etc. -+ */ -+ public static GuiYesNo getDeleteWorldScreen(GuiScreen par0GuiScreen, String par1Str, int par2) { - String var3 = I18n.getString("selectWorld.deleteQuestion"); -- String var4 = "\'" + var1 + "\' " + I18n.getString("selectWorld.deleteWarning"); -+ String var4 = "\'" + par1Str + "\' " + I18n.getString("selectWorld.deleteWarning"); - String var5 = I18n.getString("selectWorld.deleteButton"); - String var6 = I18n.getString("gui.cancel"); -- GuiYesNo var7 = new GuiYesNo(var0, var3, var4, var5, var6, var2); -+ GuiYesNo var7 = new GuiYesNo(par0GuiScreen, var3, var4, var5, var6, par2); - return var7; - } - -- static List getSize(GuiSelectWorld var0) { -- return var0.p; -- } -- -- static int onElementSelected(GuiSelectWorld var0, int var1) { -- return var0.selectedWorld = var1; -- } -- -- static int getSelectedWorld(GuiSelectWorld var0) { -- return var0.selectedWorld; -- } -- -- static GuiButton getSelectButton(GuiSelectWorld var0) { -- return var0.buttonSelect; -- } -- -- static GuiButton getRenameButton(GuiSelectWorld var0) { -- return var0.buttonDelete; -- } -- -- static GuiButton getDeleteButton(GuiSelectWorld var0) { -- return var0.buttonRename; -- } -- -- static GuiButton func_82312_f(GuiSelectWorld var0) { -- return var0.buttonRecreate; -- } -- -- static String func_82313_g(GuiSelectWorld var0) { -- return var0.r; -- } -- -- static DateFormat func_82315_h(GuiSelectWorld var0) { -- return var0.c; -- } -- -- static String func_82311_i(GuiSelectWorld var0) { -- return var0.s; -- } -- -- static String[] func_82314_j(GuiSelectWorld var0) { -- return var0.t; -+ static List getSize(GuiSelectWorld par0GuiSelectWorld) { -+ return par0GuiSelectWorld.saveList; -+ } -+ -+ /** -+ * called whenever an element in this gui is selected -+ */ -+ static int onElementSelected(GuiSelectWorld par0GuiSelectWorld, int par1) { -+ return par0GuiSelectWorld.selectedWorld = par1; -+ } -+ -+ /** -+ * returns the world currently selected -+ */ -+ static int getSelectedWorld(GuiSelectWorld par0GuiSelectWorld) { -+ return par0GuiSelectWorld.selectedWorld; -+ } -+ -+ /** -+ * returns the select button -+ */ -+ static GuiButton getSelectButton(GuiSelectWorld par0GuiSelectWorld) { -+ return par0GuiSelectWorld.buttonSelect; -+ } -+ -+ /** -+ * returns the rename button -+ */ -+ static GuiButton getRenameButton(GuiSelectWorld par0GuiSelectWorld) { -+ return par0GuiSelectWorld.buttonDelete; -+ } -+ -+ /** -+ * returns the delete button -+ */ -+ static GuiButton getDeleteButton(GuiSelectWorld par0GuiSelectWorld) { -+ return par0GuiSelectWorld.buttonRename; -+ } -+ -+ static GuiButton func_82312_f(GuiSelectWorld par0GuiSelectWorld) { -+ return par0GuiSelectWorld.buttonRecreate; -+ } -+ -+ static String func_82313_g(GuiSelectWorld par0GuiSelectWorld) { -+ return par0GuiSelectWorld.localizedWorldText; -+ } -+ -+ static DateFormat func_82315_h(GuiSelectWorld par0GuiSelectWorld) { -+ return par0GuiSelectWorld.dateFormatter; -+ } -+ -+ static String func_82311_i(GuiSelectWorld par0GuiSelectWorld) { -+ return par0GuiSelectWorld.localizedMustConvertText; -+ } -+ -+ static String[] func_82314_j(GuiSelectWorld par0GuiSelectWorld) { -+ return par0GuiSelectWorld.localizedGameModeText; - } - } ---- net/minecraft/src/ContainerRepairINNER2.java -+++ net/minecraft/src/ContainerRepairINNER2.java -@@ -2,37 +2,49 @@ - - class ContainerRepairINNER2 extends Slot { - final World field_135071_a; -+ - final int field_135069_b; -+ - final int field_135070_c; -+ - final int field_135067_d; -+ - final ContainerRepair repairContainer; - -- ContainerRepairINNER2(ContainerRepair var1, IInventory var2, int var3, int var4, int var5, World var6, int var7, int var8, int var9) { -- super(var2, var3, var4, var5); -- this.repairContainer = var1; -- this.field_135071_a = var6; -- this.field_135069_b = var7; -- this.field_135070_c = var8; -- this.field_135067_d = var9; -+ ContainerRepairINNER2(ContainerRepair par1ContainerRepair, IInventory par2IInventory, int par3, int par4, int par5, World par6World, int par7, int par8, int par9) { -+ super(par2IInventory, par3, par4, par5); -+ this.repairContainer = par1ContainerRepair; -+ this.field_135071_a = par6World; -+ this.field_135069_b = par7; -+ this.field_135070_c = par8; -+ this.field_135067_d = par9; - } - -- public boolean isItemValid(ItemStack var1) { -+ /** -+ * Check if the stack is a valid item for this slot. Always true beside for the armor slots. -+ */ -+ public boolean isItemValid(ItemStack par1ItemStack) { - return false; - } - -- public boolean canTakeStack(EntityPlayer var1) { -- return (var1.capabilities.isCreativeMode || var1.experienceLevel >= this.repairContainer.maximumCost) && this.repairContainer.maximumCost > 0 && this.getHasStack(); -+ /** -+ * Return whether this slot's stack can be taken from this slot. -+ */ -+ public boolean canTakeStack(EntityPlayer par1EntityPlayer) { -+ return (par1EntityPlayer.capabilities.isCreativeMode || par1EntityPlayer.experienceLevel >= this.repairContainer.maximumCost) && this.repairContainer.maximumCost > 0 && this.getHasStack(); - } - -- public void onPickupFromSlot(EntityPlayer var1, ItemStack var2) { -- if(!var1.capabilities.isCreativeMode) { -- var1.addExperienceLevel(-this.repairContainer.maximumCost); -+ public void onPickupFromSlot(EntityPlayer par1EntityPlayer, ItemStack par2ItemStack) { -+ if (!par1EntityPlayer.capabilities.isCreativeMode) { -+ par1EntityPlayer.addExperienceLevel(-this.repairContainer.maximumCost); - } - - ContainerRepair.getRepairInputInventory(this.repairContainer).setInventorySlotContents(0, (ItemStack)null); -- if(ContainerRepair.getStackSizeUsedInRepair(this.repairContainer) > 0) { -+ -+ if (ContainerRepair.getStackSizeUsedInRepair(this.repairContainer) > 0) { - ItemStack var3 = ContainerRepair.getRepairInputInventory(this.repairContainer).getStackInSlot(1); -- if(var3 != null && var3.stackSize > ContainerRepair.getStackSizeUsedInRepair(this.repairContainer)) { -+ -+ if (var3 != null && var3.stackSize > ContainerRepair.getStackSizeUsedInRepair(this.repairContainer)) { - var3.stackSize -= ContainerRepair.getStackSizeUsedInRepair(this.repairContainer); - ContainerRepair.getRepairInputInventory(this.repairContainer).setInventorySlotContents(1, var3); - } else { -@@ -43,21 +55,22 @@ - } - - this.repairContainer.maximumCost = 0; -- if(!var1.capabilities.isCreativeMode && !this.field_135071_a.isRemote && this.field_135071_a.getBlockId(this.field_135069_b, this.field_135070_c, this.field_135067_d) == Block.anvil.blockID && var1.getRNG().nextFloat() < 0.12F) { -+ -+ if (!par1EntityPlayer.capabilities.isCreativeMode && !this.field_135071_a.isRemote && this.field_135071_a.getBlockId(this.field_135069_b, this.field_135070_c, this.field_135067_d) == Block.anvil.blockID && par1EntityPlayer.getRNG().nextFloat() < 0.12F) { - int var6 = this.field_135071_a.getBlockMetadata(this.field_135069_b, this.field_135070_c, this.field_135067_d); - int var4 = var6 & 3; - int var5 = var6 >> 2; - ++var5; -- if(var5 > 2) { -+ -+ if (var5 > 2) { - this.field_135071_a.setBlockToAir(this.field_135069_b, this.field_135070_c, this.field_135067_d); - this.field_135071_a.playAuxSFX(1020, this.field_135069_b, this.field_135070_c, this.field_135067_d, 0); - } else { -- this.field_135071_a.setBlockMetadata(this.field_135069_b, this.field_135070_c, this.field_135067_d, var4 | var5 << 2, 2); -+ this.field_135071_a.setBlockMetadataWithNotify(this.field_135069_b, this.field_135070_c, this.field_135067_d, var4 | var5 << 2, 2); - this.field_135071_a.playAuxSFX(1021, this.field_135069_b, this.field_135070_c, this.field_135067_d, 0); - } -- } else if(!this.field_135071_a.isRemote) { -+ } else if (!this.field_135071_a.isRemote) { - this.field_135071_a.playAuxSFX(1021, this.field_135069_b, this.field_135070_c, this.field_135067_d, 0); - } -- - } - } ---- /dev/null -+++ org/spoutcraft/client/gui/minimap/GuiMinimapMenu.java -@@ -1,0 +1,246 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.client.gui.minimap; -+ -+import java.util.List; -+import java.util.ArrayList; -+ -+import net.minecraft.src.GuiScreen; -+ -+import org.spoutcraft.api.Spoutcraft; -+import org.spoutcraft.api.gui.Button; -+import org.spoutcraft.api.gui.Color; -+import org.spoutcraft.api.gui.CheckBox; -+import org.spoutcraft.api.gui.Control; -+import org.spoutcraft.api.gui.GenericButton; -+import org.spoutcraft.api.gui.GenericGradient; -+import org.spoutcraft.api.gui.GenericLabel; -+import org.spoutcraft.api.gui.GenericScrollArea; -+import org.spoutcraft.api.gui.Gradient; -+import org.spoutcraft.api.gui.RenderPriority; -+import org.spoutcraft.api.gui.WidgetAnchor; -+import org.spoutcraft.client.SpoutClient; -+ -+public class GuiMinimapMenu extends GuiScreen { -+ private List hideable; -+ private Button doneButton = null, positionButton = null, toggleCheckBox = null, advancedMobsButton = null; -+ GuiScreen parent; -+ public GuiMinimapMenu(GuiScreen parent) { -+ this.parent = parent; -+ } -+ -+ private void setControlsEnabled(boolean enabled) { -+ for (Control control: hideable) { -+ control.setEnabled(enabled); -+ } -+ } -+ -+ public void initGui() { -+ hideable = new ArrayList(); -+ Control control; -+ -+ GenericScrollArea screen = new GenericScrollArea(); -+ screen.setHeight(height - 24 - 30).setWidth(width).setY(24).setX(0); -+ getScreen().attachWidget("Spoutcraft", screen); -+ -+ GenericLabel label = new GenericLabel("Minimap Settings"); -+ int size = Spoutcraft.getMinecraftFont().getTextWidth(label.getText()); -+ label.setX((int) (width / 2 - size / 2)).setY(10); -+ label.setFixed(true).setPriority(RenderPriority.Lowest); -+ getScreen().attachWidget("Spoutcraft", label); -+ -+ int left = (int)(width / 2 - 155); -+ int right = (int)(width / 2 + 5); -+ -+ control = new ResetButton(this).setAlign(WidgetAnchor.TOP_CENTER); -+ control.setWidth(150).setHeight(20).setX(left).setY(height - 25); -+ getScreen().attachWidget("Spoutcraft", control); -+ -+ doneButton = new GenericButton("Done"); -+ doneButton.setAlign(WidgetAnchor.CENTER_CENTER); -+ doneButton.setX(right).setY(height - 25); -+ doneButton.setHeight(20).setWidth(150); -+ getScreen().attachWidget("Spoutcraft", doneButton); -+ -+ int top = 5; -+ final Color grey = new Color(0.80F, 0.80F, 0.80F, 0.65F); -+ -+ label = new GenericLabel("Minimap Position"); -+ size = Spoutcraft.getMinecraftFont().getTextWidth(label.getText()); -+ label.setX((int) (width / 2 - size / 2)).setY(top); -+ label.setTextColor(grey); -+ screen.attachWidget("Spoutcraft", label); -+ -+ top += 11; -+ -+ Gradient linebreak = new GenericGradient(); -+ linebreak.setBottomColor(grey); -+ linebreak.setTopColor(grey); -+ linebreak.setX(width/2 - 318 / 2).setY(top).setHeight(3).setWidth(318); -+ screen.attachWidget("Spoutcraft", linebreak); -+ -+ top += 6; -+ -+ positionButton = new GenericButton("Move Minimap"); -+ positionButton.setGeometry(width / 2 - 75, top, 150, 20); -+ screen.attachWidget("Spoutcraft", positionButton); -+ -+ top += 27; -+ -+ label = new GenericLabel("Minimap Configuration"); -+ size = Spoutcraft.getMinecraftFont().getTextWidth(label.getText()); -+ label.setX((int) (width / 2 - size / 2)).setY(top); -+ label.setTextColor(grey); -+ screen.attachWidget("Spoutcraft", label); -+ -+ top += 11; -+ -+ linebreak = new GenericGradient(); -+ linebreak.setBottomColor(grey); -+ linebreak.setTopColor(grey); -+ linebreak.setX(width/2 - 318 / 2).setY(top).setHeight(3).setWidth(318); -+ screen.attachWidget("Spoutcraft", linebreak); -+ -+ top += 6; -+ -+ toggleCheckBox = new MinimapToggleCheckBox().setAlign(WidgetAnchor.TOP_CENTER); -+ toggleCheckBox.setWidth(150).setHeight(20).setX(left).setY(top); -+ screen.attachWidget("Spoutcraft", toggleCheckBox); -+ -+ control = new ColorToggleCheckBox().setAlign(WidgetAnchor.TOP_CENTER); -+ control.setWidth(150).setHeight(20).setX(right).setY(top); -+ screen.attachWidget("Spoutcraft", control); -+ -+ control.setEnabled(false); -+ control.setTooltip("Feature broken."); -+ -+ top += 22; -+ -+ control = new CoordsToggleCheckBox().setAlign(WidgetAnchor.TOP_CENTER); -+ control.setWidth(150).setHeight(20).setX(left).setY(top); -+ screen.attachWidget("Spoutcraft", control); -+ -+ hideable.add(control); -+ -+ control = new SquareToggleCheckBox().setAlign(WidgetAnchor.TOP_CENTER); -+ control.setWidth(150).setHeight(20).setX(right).setY(top); -+ screen.attachWidget("Spoutcraft", control); -+ -+ top += 22; -+ -+ hideable.add(control); -+ -+ control = new ScaleToggleCheckBox().setAlign(WidgetAnchor.TOP_CENTER); -+ control.setWidth(150).setHeight(20).setX(left).setY(top); -+ screen.attachWidget("Spoutcraft", control); -+ -+ hideable.add(control); -+ -+ control = new DirectionsToggleCheckBox().setAlign(WidgetAnchor.TOP_CENTER); -+ control.setWidth(150).setHeight(20).setX(right).setY(top); -+ screen.attachWidget("Spoutcraft", control); -+ -+ top += 22; -+ -+ hideable.add(control); -+ -+ control = new MinimapModeButton().setAlign(WidgetAnchor.TOP_CENTER); -+ control.setWidth(150).setHeight(20).setX(left).setY(top); -+ screen.attachWidget("Spoutcraft", control); -+ -+ control.setEnabled(false); -+ control.setTooltip("Feature broken."); -+ -+ control = new ZoomModeButton().setAlign(WidgetAnchor.TOP_CENTER); -+ control.setWidth(150).setHeight(20).setX(right).setY(top); -+ screen.attachWidget("Spoutcraft", control); -+ -+ top += 22; -+ -+ hideable.add(control); -+ -+ control = new DeathpointsCheckBox().setAlign(WidgetAnchor.TOP_CENTER); -+ control.setWidth(150).setHeight(20).setX(left).setY(top); -+ screen.attachWidget("Spoutcraft", control); -+ -+ hideable.add(control); -+ -+ control = new BackgroundCheckBox().setAlign(WidgetAnchor.TOP_CENTER); -+ control.setWidth(150).setHeight(20).setX(right).setY(top); -+ screen.attachWidget("Spoutcraft", control); -+ -+ top += 22; -+ -+ hideable.add(control); -+ -+ control = new HeightMapCheckBox().setAlign(WidgetAnchor.TOP_CENTER); -+ control.setWidth(150).setHeight(20).setX(left).setY(top); -+ screen.attachWidget("Spoutcraft", control); -+ -+ hideable.add(control); -+ -+ control = new ScanRadiusSlider().setAlign(WidgetAnchor.TOP_CENTER); -+ control.setWidth(150).setHeight(20).setX(right).setY(top); -+ screen.attachWidget("Spoutcraft", control); -+ -+ top += 22; -+ -+ hideable.add(control); -+ -+ control = new ShowEntitiesCheckbox().setAlign(WidgetAnchor.TOP_CENTER); -+ control.setWidth(150).setHeight(20).setX(left).setY(top); -+ screen.attachWidget("Spoutcraft", control); -+ -+ hideable.add(control); -+ -+ advancedMobsButton = new GenericButton("Filter Mobs").setAlign(WidgetAnchor.TOP_CENTER); -+ advancedMobsButton.setWidth(150).setHeight(20).setX(right).setY(top); -+ advancedMobsButton.setTooltip("Select which mobs are shown on the minimap"); -+ screen.attachWidget("Spoutcraft", advancedMobsButton); -+ -+ hideable.add(advancedMobsButton); -+ -+ setControlsEnabled(MinimapConfig.getInstance().isEnabled()); -+ } -+ -+ @Override -+ public void drawScreen(int x, int y, float z) { -+ drawDefaultBackground(); -+ -+ super.drawScreen(x, y, z); -+ } -+ -+ @Override -+ protected void buttonClicked(Button btn) { -+ if (btn.equals(toggleCheckBox)) { -+ setControlsEnabled(((CheckBox) btn).isChecked()); -+ } -+ if (btn.equals(doneButton)) { -+ MinimapConfig.getInstance().save(); -+ SpoutClient.getHandle().displayGuiScreen(parent); -+ } -+ if (btn.equals(positionButton)) { -+ mc.displayGuiScreen(new GuiMoveMinimap(this)); -+ } -+ if (btn.equals(advancedMobsButton)) { -+ mc.displayGuiScreen(new GuiAdvancedEntitySettings(this)); -+ } -+ } -+} ---- net/minecraft/src/Packet15Place.java -+++ net/minecraft/src/Packet15Place.java -@@ -8,52 +8,71 @@ - private int xPosition; - private int yPosition; - private int zPosition; -+ -+ /** The offset to use for block/item placement. */ - private int direction; - private ItemStack itemStack; -+ -+ /** The offset from xPosition where the actual click took place */ - private float xOffset; -+ -+ /** The offset from yPosition where the actual click took place */ - private float yOffset; -+ -+ /** The offset from zPosition where the actual click took place */ - private float zOffset; - -- public Packet15Place() { -- } -- -- public Packet15Place(int var1, int var2, int var3, int var4, ItemStack var5, float var6, float var7, float var8) { -- this.xPosition = var1; -- this.yPosition = var2; -- this.zPosition = var3; -- this.direction = var4; -- this.itemStack = var5 != null ? var5.copy() : null; -- this.xOffset = var6; -- this.yOffset = var7; -- this.zOffset = var8; -- } -- -- public void readPacketData(DataInput var1) throws IOException { -- this.xPosition = var1.readInt(); -- this.yPosition = var1.readUnsignedByte(); -- this.zPosition = var1.readInt(); -- this.direction = var1.readUnsignedByte(); -- this.itemStack = readItemStack(var1); -- this.xOffset = (float)var1.readUnsignedByte() / 16.0F; -- this.yOffset = (float)var1.readUnsignedByte() / 16.0F; -- this.zOffset = (float)var1.readUnsignedByte() / 16.0F; -- } -- -- public void writePacketData(DataOutput var1) throws IOException { -- var1.writeInt(this.xPosition); -- var1.write(this.yPosition); -- var1.writeInt(this.zPosition); -- var1.write(this.direction); -- writeItemStack(this.itemStack, var1); -- var1.write((int)(this.xOffset * 16.0F)); -- var1.write((int)(this.yOffset * 16.0F)); -- var1.write((int)(this.zOffset * 16.0F)); -- } -- -- public void processPacket(NetHandler var1) { -- var1.handlePlace(this); -- } -- -+ public Packet15Place() {} -+ -+ public Packet15Place(int par1, int par2, int par3, int par4, ItemStack par5ItemStack, float par6, float par7, float par8) { -+ this.xPosition = par1; -+ this.yPosition = par2; -+ this.zPosition = par3; -+ this.direction = par4; -+ this.itemStack = par5ItemStack != null ? par5ItemStack.copy() : null; -+ this.xOffset = par6; -+ this.yOffset = par7; -+ this.zOffset = par8; -+ } -+ -+ /** -+ * Abstract. Reads the raw packet data from the data stream. -+ */ -+ public void readPacketData(DataInput par1DataInput) throws IOException { -+ this.xPosition = par1DataInput.readInt(); -+ this.yPosition = par1DataInput.readUnsignedByte(); -+ this.zPosition = par1DataInput.readInt(); -+ this.direction = par1DataInput.readUnsignedByte(); -+ this.itemStack = readItemStack(par1DataInput); -+ this.xOffset = (float)par1DataInput.readUnsignedByte() / 16.0F; -+ this.yOffset = (float)par1DataInput.readUnsignedByte() / 16.0F; -+ this.zOffset = (float)par1DataInput.readUnsignedByte() / 16.0F; -+ } -+ -+ /** -+ * Abstract. Writes the raw packet data to the data stream. -+ */ -+ public void writePacketData(DataOutput par1DataOutput) throws IOException { -+ par1DataOutput.writeInt(this.xPosition); -+ par1DataOutput.write(this.yPosition); -+ par1DataOutput.writeInt(this.zPosition); -+ par1DataOutput.write(this.direction); -+ writeItemStack(this.itemStack, par1DataOutput); -+ par1DataOutput.write((int)(this.xOffset * 16.0F)); -+ par1DataOutput.write((int)(this.yOffset * 16.0F)); -+ par1DataOutput.write((int)(this.zOffset * 16.0F)); -+ } -+ -+ /** -+ * Passes this Packet on to the NetHandler for processing. -+ */ -+ public void processPacket(NetHandler par1NetHandler) { -+ par1NetHandler.handlePlace(this); -+ } -+ -+ /** -+ * Abstract. Return the size of the packet (not counting the header). -+ */ - public int getPacketSize() { - return 19; - } -@@ -78,14 +97,23 @@ - return this.itemStack; - } - -+ /** -+ * Returns the offset from xPosition where the actual click took place -+ */ - public float getXOffset() { - return this.xOffset; - } - -+ /** -+ * Returns the offset from yPosition where the actual click took place -+ */ - public float getYOffset() { - return this.yOffset; - } - -+ /** -+ * Returns the offset from zPosition where the actual click took place -+ */ - public float getZOffset() { - return this.zOffset; - } ---- /dev/null -+++ org/spoutcraft/api/material/block/StoneBricks.java -@@ -1,0 +1,26 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.api.material.block; -+ -+public class StoneBricks extends GenericBlock { -+ public StoneBricks(String name, int id, int data) { -+ super(name, id, data); -+ } -+} ---- net/minecraft/src/BehaviorDispenseItemProvider.java -+++ net/minecraft/src/BehaviorDispenseItemProvider.java -@@ -1,7 +1,11 @@ - package net.minecraft.src; - - final class BehaviorDispenseItemProvider implements IBehaviorDispenseItem { -- public ItemStack dispense(IBlockSource var1, ItemStack var2) { -- return var2; -+ -+ /** -+ * Dispenses the specified ItemStack from a dispenser. -+ */ -+ public ItemStack dispense(IBlockSource par1IBlockSource, ItemStack par2ItemStack) { -+ return par2ItemStack; - } - } ---- /dev/null -+++ org/spoutcraft/client/packet/PacketEntitySkin.java -@@ -1,0 +1,67 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.client.packet; -+ -+import java.io.IOException; -+ -+import org.spoutcraft.api.Spoutcraft; -+import org.spoutcraft.api.entity.EntitySkinType; -+import org.spoutcraft.api.io.SpoutInputStream; -+import org.spoutcraft.api.io.SpoutOutputStream; -+import org.spoutcraft.client.entity.CraftEntity; -+ -+public class PacketEntitySkin implements SpoutPacket { -+ protected String texture = ""; -+ protected int entityId; -+ protected byte textureId = 0; -+ -+ public void readData(SpoutInputStream input) throws IOException { -+ entityId = input.readInt(); -+ textureId = (byte) input.read(); -+ texture = input.readString(); -+ } -+ -+ public void writeData(SpoutOutputStream output) throws IOException { -+ output.writeInt(entityId); -+ output.write(textureId); -+ output.writeString(texture); -+ } -+ -+ public void run(int PlayerId) { -+ if (texture.equals("[reset]")) { -+ texture = null; -+ } -+ CraftEntity entity = Spoutcraft.getWorld().getEntityFromId(entityId); -+ if (entity != null) { -+ entity.setSkin(texture, EntitySkinType.getType(textureId)); -+ } -+ } -+ -+ public PacketType getPacketType() { -+ return PacketType.PacketEntitySkin; -+ } -+ -+ public int getVersion() { -+ return 1; -+ } -+ -+ public void failure(int playerId) { -+ } -+} ---- net/minecraft/src/Tessellator.java -+++ net/minecraft/src/Tessellator.java -@@ -5,274 +5,441 @@ - import java.nio.FloatBuffer; - import java.nio.IntBuffer; - import java.nio.ShortBuffer; -+import java.util.Map; -+import java.util.WeakHashMap; -+ - import org.lwjgl.opengl.ARBVertexBufferObject; - import org.lwjgl.opengl.GL11; --import org.lwjgl.opengl.GL15; - import org.lwjgl.opengl.GLContext; - -+import com.prupe.mcpatcher.TessellatorUtils; -+ -+import org.spoutcraft.client.SpoutClient; -+ - public class Tessellator { -+ -+ /** -+ * Boolean used to check whether quads should be drawn as two triangles. Initialized to false and never changed. -+ */ - private static boolean convertQuadsToTriangles; -+ -+ /** -+ * Boolean used to check if we should use vertex buffers. Initialized to false and never changed. -+ */ - private static boolean tryVBO; -- private ByteBuffer d; -- private IntBuffer e; -- private FloatBuffer f; -- private ShortBuffer g; -+ -+ /** The byte buffer used for GL allocation. */ -+ private ByteBuffer byteBuffer; -+ -+ /** The same memory as byteBuffer, but referenced as an integer buffer. */ -+ private IntBuffer intBuffer; -+ -+ /** The same memory as byteBuffer, but referenced as an float buffer. */ -+ private FloatBuffer floatBuffer; -+ -+ /** Short buffer */ -+ private ShortBuffer shortBuffer; -+ -+ /** Raw integer array. */ - private int[] rawBuffer; -- private int vertexCount; -+ -+ /** -+ * The number of vertices to be drawn in the next draw call. Reset to 0 between draw calls. -+ */ -+ // MCPatcher Start - private to public -+ public int vertexCount; -+ // MCPatcher End -+ -+ /** The first coordinate to be used for the texture. */ - private double textureU; -+ -+ /** The second coordinate to be used for the texture. */ - private double textureV; - private int brightness; -+ -+ /** The color (RGBA) value to be used for the following draw call. */ - private int color; -+ -+ /** -+ * Whether the current draw object for this tessellator has color values. -+ */ - private boolean hasColor; -+ -+ /** -+ * Whether the current draw object for this tessellator has texture coordinates. -+ */ - private boolean hasTexture; - private boolean hasBrightness; -+ -+ /** -+ * Whether the current draw object for this tessellator has normal values. -+ */ - private boolean hasNormals; -- private int rawBufferIndex; -- private int addedVertices; -+ -+ /** The index into the raw buffer to be used for the next data. */ -+ // MCPatcher Start - private to public -+ public int rawBufferIndex; -+ // MCPatcher End -+ -+ /** -+ * The number of vertices manually added to the given draw call. This differs from vertexCount because it adds extra -+ * vertices when converting quads to triangles. -+ */ -+ // MCPatcher Start - private to public -+ public int addedVertices; -+ // MCPatcher End -+ -+ /** Disables all color information for the following draw call. */ - private boolean isColorDisabled; -- private int drawMode; -+ -+ /** The draw mode currently being used by the tessellator. */ -+ // MCPatcher Start - private to public -+ public int drawMode; -+ // MCPatcher End -+ -+ /** -+ * An offset to be applied along the x-axis for all vertices in this draw call. -+ */ - private double xOffset; -+ -+ /** -+ * An offset to be applied along the y-axis for all vertices in this draw call. -+ */ - private double yOffset; -+ -+ /** -+ * An offset to be applied along the z-axis for all vertices in this draw call. -+ */ - private double zOffset; -+ -+ /** The normal to be applied to the face being drawn. */ - private int normal; -+ -+ /** The static instance of the Tessellator. */ - public static final Tessellator instance = new Tessellator(2097152); -- private boolean isDrawing; -+ -+ /** Whether this tessellator is currently in draw mode. */ -+ // MCPatcher Start - private to public -+ public boolean isDrawing; -+ // MCPatcher End -+ -+ /** Whether we are currently using VBO or not. */ - private boolean useVBO; -- private IntBuffer B; -+ -+ /** An IntBuffer used to store the indices of vertex buffer objects. */ -+ private IntBuffer vertexBuffers; -+ -+ /** -+ * The index of the last VBO used. This is used in round-robin fashion, sequentially, through the vboCount vertex -+ * buffers. -+ */ - private int vboIndex; -+ -+ /** Number of vertex buffer objects allocated for use. */ - private int vboCount = 10; -- private int bufferSize; -- -- private Tessellator(int var1) { -- this.bufferSize = var1; -- this.d = GLAllocation.createDirectByteBuffer(var1 * 4); -- this.e = this.d.asIntBuffer(); -- this.f = this.d.asFloatBuffer(); -- this.g = this.d.asShortBuffer(); -- this.rawBuffer = new int[var1]; -+ -+ /** The size of the buffers used (in integers). */ -+ // MCPatcher Start - private to public -+ public int texture; //Spout Keep this in. -+ public int bufferSize; -+ public TextureMap textureMap; -+ public Map children; -+ -+ public Tessellator(int par1) { -+ // MCPatcher End -+ this.bufferSize = par1; -+ this.byteBuffer = GLAllocation.createDirectByteBuffer(par1 * 4); -+ this.intBuffer = this.byteBuffer.asIntBuffer(); -+ this.floatBuffer = this.byteBuffer.asFloatBuffer(); -+ this.shortBuffer = this.byteBuffer.asShortBuffer(); -+ this.rawBuffer = new int[par1]; - this.useVBO = tryVBO && GLContext.getCapabilities().GL_ARB_vertex_buffer_object; -- if(this.useVBO) { -- this.B = GLAllocation.createDirectIntBuffer(this.vboCount); -- ARBVertexBufferObject.glGenBuffersARB(this.B); -+ -+ if (this.useVBO) { -+ this.vertexBuffers = GLAllocation.createDirectIntBuffer(this.vboCount); -+ ARBVertexBufferObject.glGenBuffersARB(this.vertexBuffers); - } - -+ // MCPatcher Start -+ this.children = new WeakHashMap(); -+ TessellatorUtils.haveBufferSize = true; -+ // MCPatcher End - } - -+ /** -+ * Draws the data set up in this tessellator and resets the state to prepare for new drawing. -+ */ - public int draw() { -- if(!this.isDrawing) { -+ // MCPatcher Start -+ int var1 = TessellatorUtils.drawChildren(0, this); -+ // MCPatcher End -+ if (!this.isDrawing) { - throw new IllegalStateException("Not tesselating!"); - } else { - this.isDrawing = false; -- if(this.vertexCount > 0) { -- this.e.clear(); -- this.e.put(this.rawBuffer, 0, this.rawBufferIndex); -- this.d.position(0); -- this.d.limit(this.rawBufferIndex * 4); -- if(this.useVBO) { -+ -+ if (this.vertexCount > 0) { -+ // MCPatcher && Spout Start -+ if (this.textureMap != null && SpoutClient.getHandle().renderEngine.boundTexture <= 0) { -+ GL11.glBindTexture(GL11.GL_TEXTURE_2D, this.textureMap.getGlTextureId()); -+ } else if (this.texture > 0) { -+ GL11.glBindTexture(GL11.GL_TEXTURE_2D, this.texture); -+ } -+ // MCPatcher && Spout End -+ -+ this.intBuffer.clear(); -+ this.intBuffer.put(this.rawBuffer, 0, this.rawBufferIndex); -+ this.byteBuffer.position(0); -+ this.byteBuffer.limit(this.rawBufferIndex * 4); -+ -+ if (this.useVBO) { - this.vboIndex = (this.vboIndex + 1) % this.vboCount; -- ARBVertexBufferObject.glBindBufferARB(GL15.GL_ARRAY_BUFFER, this.B.get(this.vboIndex)); -- ARBVertexBufferObject.glBufferDataARB(GL15.GL_ARRAY_BUFFER, this.d, GL15.GL_STREAM_DRAW); -+ ARBVertexBufferObject.glBindBufferARB(ARBVertexBufferObject.GL_ARRAY_BUFFER_ARB, this.vertexBuffers.get(this.vboIndex)); -+ ARBVertexBufferObject.glBufferDataARB(ARBVertexBufferObject.GL_ARRAY_BUFFER_ARB, this.byteBuffer, ARBVertexBufferObject.GL_STREAM_DRAW_ARB); - } - -- if(this.hasTexture) { -- if(this.useVBO) { -+ if (this.hasTexture) { -+ if (this.useVBO) { - GL11.glTexCoordPointer(2, GL11.GL_FLOAT, 32, 12L); - } else { -- this.f.position(3); -- GL11.glTexCoordPointer(2, 32, (FloatBuffer)this.f); -+ this.floatBuffer.position(3); -+ GL11.glTexCoordPointer(2, 32, this.floatBuffer); - } - - GL11.glEnableClientState(GL11.GL_TEXTURE_COORD_ARRAY); - } - -- if(this.hasBrightness) { -+ if (this.hasBrightness) { - OpenGlHelper.setClientActiveTexture(OpenGlHelper.lightmapTexUnit); -- if(this.useVBO) { -+ -+ if (this.useVBO) { - GL11.glTexCoordPointer(2, GL11.GL_SHORT, 32, 28L); - } else { -- this.g.position(14); -- GL11.glTexCoordPointer(2, 32, (ShortBuffer)this.g); -+ this.shortBuffer.position(14); -+ GL11.glTexCoordPointer(2, 32, this.shortBuffer); - } - - GL11.glEnableClientState(GL11.GL_TEXTURE_COORD_ARRAY); - OpenGlHelper.setClientActiveTexture(OpenGlHelper.defaultTexUnit); - } - -- if(this.hasColor) { -- if(this.useVBO) { -+ if (this.hasColor) { -+ if (this.useVBO) { - GL11.glColorPointer(4, GL11.GL_UNSIGNED_BYTE, 32, 20L); - } else { -- this.d.position(20); -- GL11.glColorPointer(4, true, 32, this.d); -+ this.byteBuffer.position(20); -+ GL11.glColorPointer(4, true, 32, this.byteBuffer); - } - - GL11.glEnableClientState(GL11.GL_COLOR_ARRAY); - } - -- if(this.hasNormals) { -- if(this.useVBO) { -+ if (this.hasNormals) { -+ if (this.useVBO) { - GL11.glNormalPointer(GL11.GL_UNSIGNED_BYTE, 32, 24L); - } else { -- this.d.position(24); -- GL11.glNormalPointer(32, (ByteBuffer)this.d); -+ this.byteBuffer.position(24); -+ GL11.glNormalPointer(32, this.byteBuffer); - } - - GL11.glEnableClientState(GL11.GL_NORMAL_ARRAY); - } - -- if(this.useVBO) { -+ if (this.useVBO) { - GL11.glVertexPointer(3, GL11.GL_FLOAT, 32, 0L); - } else { -- this.f.position(0); -- GL11.glVertexPointer(3, 32, (FloatBuffer)this.f); -+ this.floatBuffer.position(0); -+ GL11.glVertexPointer(3, 32, this.floatBuffer); - } - - GL11.glEnableClientState(GL11.GL_VERTEX_ARRAY); -- if(this.drawMode == 7 && convertQuadsToTriangles) { -- GL11.glDrawArrays(GL11.GL_TRIANGLES, GL11.GL_POINTS, this.vertexCount); -+ -+ if (this.drawMode == 7 && convertQuadsToTriangles) { -+ GL11.glDrawArrays(GL11.GL_TRIANGLES, 0, this.vertexCount); - } else { -- GL11.glDrawArrays(this.drawMode, GL11.GL_POINTS, this.vertexCount); -+ GL11.glDrawArrays(this.drawMode, 0, this.vertexCount); - } - - GL11.glDisableClientState(GL11.GL_VERTEX_ARRAY); -- if(this.hasTexture) { -+ -+ if (this.hasTexture) { - GL11.glDisableClientState(GL11.GL_TEXTURE_COORD_ARRAY); - } - -- if(this.hasBrightness) { -+ if (this.hasBrightness) { - OpenGlHelper.setClientActiveTexture(OpenGlHelper.lightmapTexUnit); - GL11.glDisableClientState(GL11.GL_TEXTURE_COORD_ARRAY); - OpenGlHelper.setClientActiveTexture(OpenGlHelper.defaultTexUnit); - } - -- if(this.hasColor) { -+ if (this.hasColor) { - GL11.glDisableClientState(GL11.GL_COLOR_ARRAY); - } - -- if(this.hasNormals) { -+ if (this.hasNormals) { - GL11.glDisableClientState(GL11.GL_NORMAL_ARRAY); - } - } - -- int var1 = this.rawBufferIndex * 4; -+ var1 = this.rawBufferIndex * 4; - this.reset(); - return var1; - } - } - -- private void reset() { -+ /** -+ * Clears the tessellator state in preparation for new drawing. -+ */ -+ // MCPatcher Start - private to public -+ public void reset() { -+ // MCPatcher End - this.vertexCount = 0; -- this.d.clear(); -+ this.byteBuffer.clear(); - this.rawBufferIndex = 0; - this.addedVertices = 0; -+ // MCPatcher Start -+ TessellatorUtils.resetChildren(this); -+ // MCPatcher End - } - -+ /** -+ * Sets draw mode in the tessellator to draw quads. -+ */ - public void startDrawingQuads() { - this.startDrawing(7); - } - -- public void startDrawing(int var1) { -- if(this.isDrawing) { -+ /** -+ * Resets tessellator state and prepares for drawing (with the specified draw mode). -+ */ -+ public void startDrawing(int par1) { -+ if (this.isDrawing) { - throw new IllegalStateException("Already tesselating!"); - } else { - this.isDrawing = true; - this.reset(); -- this.drawMode = var1; -+ this.drawMode = par1; - this.hasNormals = false; - this.hasColor = false; - this.hasTexture = false; - this.hasBrightness = false; - this.isColorDisabled = false; -+ // MCPatcher Start -+ TessellatorUtils.startDrawingChildren(this, par1); -+ // MCPatcher End - } - } - -- public void setTextureUV(double var1, double var3) { -+ /** -+ * Sets the texture coordinates. -+ */ -+ public void setTextureUV(double par1, double par3) { - this.hasTexture = true; -- this.textureU = var1; -- this.textureV = var3; -+ this.textureU = par1; -+ this.textureV = par3; - } - -- public void setBrightness(int var1) { -+ public void setBrightness(int par1) { - this.hasBrightness = true; -- this.brightness = var1; -- } -- -- public void setColorOpaque_F(float var1, float var2, float var3) { -- this.setColorOpaque((int)(var1 * 255.0F), (int)(var2 * 255.0F), (int)(var3 * 255.0F)); -- } -- -- public void setColorRGBA_F(float var1, float var2, float var3, float var4) { -- this.setColorRGBA((int)(var1 * 255.0F), (int)(var2 * 255.0F), (int)(var3 * 255.0F), (int)(var4 * 255.0F)); -- } -- -- public void setColorOpaque(int var1, int var2, int var3) { -- this.setColorRGBA(var1, var2, var3, 255); -- } -- -- public void setColorRGBA(int var1, int var2, int var3, int var4) { -- if(!this.isColorDisabled) { -- if(var1 > 255) { -- var1 = 255; -- } -- -- if(var2 > 255) { -- var2 = 255; -- } -- -- if(var3 > 255) { -- var3 = 255; -- } -- -- if(var4 > 255) { -- var4 = 255; -- } -- -- if(var1 < 0) { -- var1 = 0; -- } -- -- if(var2 < 0) { -- var2 = 0; -- } -- -- if(var3 < 0) { -- var3 = 0; -- } -- -- if(var4 < 0) { -- var4 = 0; -+ this.brightness = par1; -+ } -+ -+ /** -+ * Sets the RGB values as specified, converting from floats between 0 and 1 to integers from 0-255. -+ */ -+ public void setColorOpaque_F(float par1, float par2, float par3) { -+ this.setColorOpaque((int)(par1 * 255.0F), (int)(par2 * 255.0F), (int)(par3 * 255.0F)); -+ } -+ -+ /** -+ * Sets the RGBA values for the color, converting from floats between 0 and 1 to integers from 0-255. -+ */ -+ public void setColorRGBA_F(float par1, float par2, float par3, float par4) { -+ this.setColorRGBA((int)(par1 * 255.0F), (int)(par2 * 255.0F), (int)(par3 * 255.0F), (int)(par4 * 255.0F)); -+ } -+ -+ /** -+ * Sets the RGB values as specified, and sets alpha to opaque. -+ */ -+ public void setColorOpaque(int par1, int par2, int par3) { -+ this.setColorRGBA(par1, par2, par3, 255); -+ } -+ -+ /** -+ * Sets the RGBA values for the color. Also clamps them to 0-255. -+ */ -+ public void setColorRGBA(int par1, int par2, int par3, int par4) { -+ if (!this.isColorDisabled) { -+ if (par1 > 255) { -+ par1 = 255; -+ } -+ -+ if (par2 > 255) { -+ par2 = 255; -+ } -+ -+ if (par3 > 255) { -+ par3 = 255; -+ } -+ -+ if (par4 > 255) { -+ par4 = 255; -+ } -+ -+ if (par1 < 0) { -+ par1 = 0; -+ } -+ -+ if (par2 < 0) { -+ par2 = 0; -+ } -+ -+ if (par3 < 0) { -+ par3 = 0; -+ } -+ -+ if (par4 < 0) { -+ par4 = 0; - } - - this.hasColor = true; -- if(ByteOrder.nativeOrder() == ByteOrder.LITTLE_ENDIAN) { -- this.color = var4 << 24 | var3 << 16 | var2 << 8 | var1; -+ -+ if (ByteOrder.nativeOrder() == ByteOrder.LITTLE_ENDIAN) { -+ this.color = par4 << 24 | par3 << 16 | par2 << 8 | par1; - } else { -- this.color = var1 << 24 | var2 << 16 | var3 << 8 | var4; -+ this.color = par1 << 24 | par2 << 16 | par3 << 8 | par4; - } -- - } - } - -- public void addVertexWithUV(double var1, double var3, double var5, double var7, double var9) { -- this.setTextureUV(var7, var9); -- this.addVertex(var1, var3, var5); -+ /** -+ * Adds a vertex specifying both x,y,z and the texture u,v for it. -+ */ -+ public void addVertexWithUV(double par1, double par3, double par5, double par7, double par9) { -+ this.setTextureUV(par7, par9); -+ this.addVertex(par1, par3, par5); - } - -- public void addVertex(double var1, double var3, double var5) { -+ /** -+ * Adds a vertex with the specified x,y,z to the current draw call. It will trigger a draw() if the buffer gets full. -+ */ -+ public void addVertex(double par1, double par3, double par5) { - ++this.addedVertices; -- if(this.drawMode == 7 && convertQuadsToTriangles && this.addedVertices % 4 == 0) { -- for(int var7 = 0; var7 < 2; ++var7) { -+ -+ if (this.drawMode == 7 && convertQuadsToTriangles && this.addedVertices % 4 == 0) { -+ for (int var7 = 0; var7 < 2; ++var7) { - int var8 = 8 * (3 - var7); -- if(this.hasTexture) { -+ -+ if (this.hasTexture) { - this.rawBuffer[this.rawBufferIndex + 3] = this.rawBuffer[this.rawBufferIndex - var8 + 3]; - this.rawBuffer[this.rawBufferIndex + 4] = this.rawBuffer[this.rawBufferIndex - var8 + 4]; - } - -- if(this.hasBrightness) { -+ if (this.hasBrightness) { - this.rawBuffer[this.rawBufferIndex + 7] = this.rawBuffer[this.rawBufferIndex - var8 + 7]; - } - -- if(this.hasColor) { -+ if (this.hasColor) { - this.rawBuffer[this.rawBufferIndex + 5] = this.rawBuffer[this.rawBufferIndex - var8 + 5]; - } - -@@ -284,70 +451,88 @@ - } - } - -- if(this.hasTexture) { -+ if (this.hasTexture) { - this.rawBuffer[this.rawBufferIndex + 3] = Float.floatToRawIntBits((float)this.textureU); - this.rawBuffer[this.rawBufferIndex + 4] = Float.floatToRawIntBits((float)this.textureV); - } - -- if(this.hasBrightness) { -+ if (this.hasBrightness) { - this.rawBuffer[this.rawBufferIndex + 7] = this.brightness; - } - -- if(this.hasColor) { -+ if (this.hasColor) { - this.rawBuffer[this.rawBufferIndex + 5] = this.color; - } - -- if(this.hasNormals) { -+ if (this.hasNormals) { - this.rawBuffer[this.rawBufferIndex + 6] = this.normal; - } - -- this.rawBuffer[this.rawBufferIndex + 0] = Float.floatToRawIntBits((float)(var1 + this.xOffset)); -- this.rawBuffer[this.rawBufferIndex + 1] = Float.floatToRawIntBits((float)(var3 + this.yOffset)); -- this.rawBuffer[this.rawBufferIndex + 2] = Float.floatToRawIntBits((float)(var5 + this.zOffset)); -+ this.rawBuffer[this.rawBufferIndex + 0] = Float.floatToRawIntBits((float)(par1 + this.xOffset)); -+ this.rawBuffer[this.rawBufferIndex + 1] = Float.floatToRawIntBits((float)(par3 + this.yOffset)); -+ this.rawBuffer[this.rawBufferIndex + 2] = Float.floatToRawIntBits((float)(par5 + this.zOffset)); - this.rawBufferIndex += 8; - ++this.vertexCount; -- if(this.vertexCount % 4 == 0 && this.rawBufferIndex >= this.bufferSize - 32) { -+ -+ if (this.vertexCount % 4 == 0 && this.rawBufferIndex >= this.bufferSize - 32) { - this.draw(); - this.isDrawing = true; - } -- - } - -- public void setColorOpaque_I(int var1) { -- int var2 = var1 >> 16 & 255; -- int var3 = var1 >> 8 & 255; -- int var4 = var1 & 255; -+ /** -+ * Sets the color to the given opaque value (stored as byte values packed in an integer). -+ */ -+ public void setColorOpaque_I(int par1) { -+ int var2 = par1 >> 16 & 255; -+ int var3 = par1 >> 8 & 255; -+ int var4 = par1 & 255; - this.setColorOpaque(var2, var3, var4); - } - -- public void setColorRGBA_I(int var1, int var2) { -- int var3 = var1 >> 16 & 255; -- int var4 = var1 >> 8 & 255; -- int var5 = var1 & 255; -- this.setColorRGBA(var3, var4, var5, var2); -+ /** -+ * Sets the color to the given color (packed as bytes in integer) and alpha values. -+ */ -+ public void setColorRGBA_I(int par1, int par2) { -+ int var3 = par1 >> 16 & 255; -+ int var4 = par1 >> 8 & 255; -+ int var5 = par1 & 255; -+ this.setColorRGBA(var3, var4, var5, par2); - } - -+ /** -+ * Disables colors for the current draw call. -+ */ - public void disableColor() { - this.isColorDisabled = true; - } - -- public void setNormal(float var1, float var2, float var3) { -+ /** -+ * Sets the normal for the current draw call. -+ */ -+ public void setNormal(float par1, float par2, float par3) { - this.hasNormals = true; -- byte var4 = (byte)((int)(var1 * 127.0F)); -- byte var5 = (byte)((int)(var2 * 127.0F)); -- byte var6 = (byte)((int)(var3 * 127.0F)); -+ byte var4 = (byte)((int)(par1 * 127.0F)); -+ byte var5 = (byte)((int)(par2 * 127.0F)); -+ byte var6 = (byte)((int)(par3 * 127.0F)); - this.normal = var4 & 255 | (var5 & 255) << 8 | (var6 & 255) << 16; - } - -- public void setTranslation(double var1, double var3, double var5) { -- this.xOffset = var1; -- this.yOffset = var3; -- this.zOffset = var5; -+ /** -+ * Sets the translation for all vertices in the current draw call. -+ */ -+ public void setTranslation(double par1, double par3, double par5) { -+ this.xOffset = par1; -+ this.yOffset = par3; -+ this.zOffset = par5; - } - -- public void addTranslation(float var1, float var2, float var3) { -- this.xOffset += (double)var1; -- this.yOffset += (double)var2; -- this.zOffset += (double)var3; -+ /** -+ * Offsets the translation for all vertices in the current draw call. -+ */ -+ public void addTranslation(float par1, float par2, float par3) { -+ this.xOffset += (double)par1; -+ this.yOffset += (double)par2; -+ this.zOffset += (double)par3; - } - } ---- net/minecraft/src/McoClient.java -+++ net/minecraft/src/McoClient.java -@@ -8,51 +8,54 @@ - import java.util.Map.Entry; - - public class McoClient { -- private final String a; -- private final String b; -- private static String c = "https://mcoapi.minecraft.net/"; -+ private final String field_96390_a; -+ private final String field_100007_c; -+ private static String field_96388_b = "https://mcoapi.minecraft.net/"; - -- public McoClient(Session var1) { -- this.a = var1.getSessionID(); -- this.b = var1.getUsername(); -+ public McoClient(Session par1Session) { -+ this.field_96390_a = par1Session.getSessionID(); -+ this.field_100007_c = par1Session.getUsername(); - } - -- public ValueObjectList func_96382_a() throws IOException, ExceptionMcoService { -- String var1 = this.func_96377_a(Request.func_96358_a(c + "worlds")); -+ public ValueObjectList func_96382_a() throws ExceptionMcoService, IOException { -+ String var1 = this.func_96377_a(Request.func_96358_a(field_96388_b + "worlds")); - return ValueObjectList.func_98161_a(var1); - } - -- public McoServer func_98176_a(long var1) throws IOException, ExceptionMcoService { -- String var3 = this.func_96377_a(Request.func_96358_a(c + "worlds" + "/$ID".replace("$ID", String.valueOf(var1)))); -+ public McoServer func_98176_a(long par1) throws ExceptionMcoService, IOException { -+ String var3 = this.func_96377_a(Request.func_96358_a(field_96388_b + "worlds" + "/$ID".replace("$ID", String.valueOf(par1)))); - return McoServer.func_98165_c(var3); - } - -- public McoServerAddress func_96374_a(long var1) throws IOException, ExceptionMcoService { -- String var3 = c + "worlds" + "/$ID/join".replace("$ID", "" + var1); -+ public McoServerAddress func_96374_a(long par1) throws ExceptionMcoService, IOException { -+ String var3 = field_96388_b + "worlds" + "/$ID/join".replace("$ID", "" + par1); - String var4 = this.func_96377_a(Request.func_96358_a(var3)); - return McoServerAddress.func_98162_a(var4); - } - -- public void func_96386_a(String var1, String var2, String var3, String var4) throws UnsupportedEncodingException, ExceptionMcoService { -+ public void func_96386_a(String par1Str, String par2Str, String par3Str, String par4Str) throws ExceptionMcoService, UnsupportedEncodingException { - StringBuilder var5 = new StringBuilder(); -- var5.append(c).append("worlds").append("/$NAME/$LOCATION_ID".replace("$NAME", this.func_96380_a(var1))); -+ var5.append(field_96388_b).append("worlds").append("/$NAME/$LOCATION_ID".replace("$NAME", this.func_96380_a(par1Str))); - HashMap var6 = new HashMap(); -- if(var2 != null && !var2.trim().equals("")) { -- var6.put("motd", var2); -- } -- -- if(var3 != null && !var3.equals("")) { -- var6.put("seed", var3); -- } -- -- var6.put("template", var4); -- if(!var6.isEmpty()) { -+ -+ if (par2Str != null && !par2Str.trim().equals("")) { -+ var6.put("motd", par2Str); -+ } -+ -+ if (par3Str != null && !par3Str.equals("")) { -+ var6.put("seed", par3Str); -+ } -+ -+ var6.put("template", par4Str); -+ -+ if (!var6.isEmpty()) { - boolean var7 = true; -- - Entry var9; -- for(Iterator var8 = var6.entrySet().iterator(); var8.hasNext(); var5.append((String)var9.getKey()).append("=").append(this.func_96380_a((String)var9.getValue()))) { -+ -+ for (Iterator var8 = var6.entrySet().iterator(); var8.hasNext(); var5.append((String)var9.getKey()).append("=").append(this.func_96380_a((String)var9.getValue()))) { - var9 = (Entry)var8.next(); -- if(var7) { -+ -+ if (var7) { - var5.append("?"); - var7 = false; - } else { -@@ -64,145 +67,149 @@ - this.func_96377_a(Request.func_104064_a(var5.toString(), "", 5000, 30000)); - } - -- public Boolean func_96375_b() throws IOException, ExceptionMcoService { -- String var1 = c + "mco" + "/available"; -+ public Boolean func_96375_b() throws ExceptionMcoService, IOException { -+ String var1 = field_96388_b + "mco" + "/available"; - String var2 = this.func_96377_a(Request.func_96358_a(var1)); - return Boolean.valueOf(var2); - } - -- public Boolean func_140054_c() throws IOException, ExceptionMcoService { -- String var1 = c + "mco" + "/client/outdated"; -+ public Boolean func_140054_c() throws ExceptionMcoService, IOException { -+ String var1 = field_96388_b + "mco" + "/client/outdated"; - String var2 = this.func_96377_a(Request.func_96358_a(var1)); - return Boolean.valueOf(var2); - } - - public int func_96379_c() throws ExceptionMcoService { -- String var1 = c + "payments" + "/unused"; -+ String var1 = field_96388_b + "payments" + "/unused"; - String var2 = this.func_96377_a(Request.func_96358_a(var1)); - return Integer.valueOf(var2).intValue(); - } - -- public void func_96381_a(long var1, String var3) throws ExceptionMcoService { -- String var4 = c + "invites" + "/$WORLD_ID/invite/$USER_NAME".replace("$WORLD_ID", String.valueOf(var1)).replace("$USER_NAME", var3); -+ public void func_96381_a(long par1, String par3Str) throws ExceptionMcoService { -+ String var4 = field_96388_b + "invites" + "/$WORLD_ID/invite/$USER_NAME".replace("$WORLD_ID", String.valueOf(par1)).replace("$USER_NAME", par3Str); - this.func_96377_a(Request.func_96355_b(var4)); - } - -- public void func_140055_c(long var1) throws ExceptionMcoService { -- String var3 = c + "invites" + "/$WORLD_ID".replace("$WORLD_ID", String.valueOf(var1)); -+ public void func_140055_c(long par1) throws ExceptionMcoService { -+ String var3 = field_96388_b + "invites" + "/$WORLD_ID".replace("$WORLD_ID", String.valueOf(par1)); - this.func_96377_a(Request.func_96355_b(var3)); - } - -- public McoServer func_96387_b(long var1, String var3) throws IOException, ExceptionMcoService { -- String var4 = c + "invites" + "/$WORLD_ID/invite/$USER_NAME".replace("$WORLD_ID", String.valueOf(var1)).replace("$USER_NAME", var3); -+ public McoServer func_96387_b(long par1, String par3Str) throws ExceptionMcoService, IOException { -+ String var4 = field_96388_b + "invites" + "/$WORLD_ID/invite/$USER_NAME".replace("$WORLD_ID", String.valueOf(par1)).replace("$USER_NAME", par3Str); - String var5 = this.func_96377_a(Request.func_96361_b(var4, "")); - return McoServer.func_98165_c(var5); - } - -- public BackupList func_111232_c(long var1) throws ExceptionMcoService { -- String var3 = c + "worlds" + "/$WORLD_ID/backups".replace("$WORLD_ID", String.valueOf(var1)); -+ public BackupList func_111232_c(long par1) throws ExceptionMcoService { -+ String var3 = field_96388_b + "worlds" + "/$WORLD_ID/backups".replace("$WORLD_ID", String.valueOf(par1)); - String var4 = this.func_96377_a(Request.func_96358_a(var3)); - return BackupList.func_111222_a(var4); - } - -- public void func_96384_a(long var1, String var3, String var4, int var5, int var6) throws UnsupportedEncodingException, ExceptionMcoService { -+ public void func_96384_a(long par1, String par3Str, String par4Str, int par5, int par6) throws ExceptionMcoService, UnsupportedEncodingException { - StringBuilder var7 = new StringBuilder(); -- var7.append(c).append("worlds").append("/$WORLD_ID/$NAME".replace("$WORLD_ID", String.valueOf(var1)).replace("$NAME", this.func_96380_a(var3))); -- if(var4 != null && !var4.trim().equals("")) { -- var7.append("?motd=").append(this.func_96380_a(var4)); -+ var7.append(field_96388_b).append("worlds").append("/$WORLD_ID/$NAME".replace("$WORLD_ID", String.valueOf(par1)).replace("$NAME", this.func_96380_a(par3Str))); -+ -+ if (par4Str != null && !par4Str.trim().equals("")) { -+ var7.append("?motd=").append(this.func_96380_a(par4Str)); - } else { - var7.append("?motd="); - } - -- var7.append("&difficulty=").append(var5).append("&gameMode=").append(var6); -+ var7.append("&difficulty=").append(par5).append("&gameMode=").append(par6); - this.func_96377_a(Request.func_96363_c(var7.toString(), "")); - } - -- public void func_111235_c(long var1, String var3) throws ExceptionMcoService { -- String var4 = c + "worlds" + "/$WORLD_ID/backups".replace("$WORLD_ID", String.valueOf(var1)) + "?backupId=" + var3; -+ public void func_111235_c(long par1, String par3Str) throws ExceptionMcoService { -+ String var4 = field_96388_b + "worlds" + "/$WORLD_ID/backups".replace("$WORLD_ID", String.valueOf(par1)) + "?backupId=" + par3Str; - this.func_96377_a(Request.func_96363_c(var4, "")); - } - - public WorldTemplateList func_111231_d() throws ExceptionMcoService { -- String var1 = c + "worlds" + "/templates"; -+ String var1 = field_96388_b + "worlds" + "/templates"; - String var2 = this.func_96377_a(Request.func_96358_a(var1)); - return WorldTemplateList.func_110735_a(var2); - } - -- public Boolean func_96383_b(long var1) throws IOException, ExceptionMcoService { -- String var3 = c + "worlds" + "/$WORLD_ID/open".replace("$WORLD_ID", String.valueOf(var1)); -- String var4 = this.func_96377_a(Request.func_96363_c(var3, "")); -- return Boolean.valueOf(var4); -- } -- -- public Boolean func_96378_c(long var1) throws IOException, ExceptionMcoService { -- String var3 = c + "worlds" + "/$WORLD_ID/close".replace("$WORLD_ID", String.valueOf(var1)); -- String var4 = this.func_96377_a(Request.func_96363_c(var3, "")); -- return Boolean.valueOf(var4); -- } -- -- public Boolean func_96376_d(long var1, String var3) throws UnsupportedEncodingException, ExceptionMcoService { -- StringBuilder var4 = new StringBuilder(); -- var4.append(c).append("worlds").append("/$WORLD_ID/reset".replace("$WORLD_ID", String.valueOf(var1))); -- if(var3 != null && var3.length() > 0) { -- var4.append("?seed=").append(this.func_96380_a(var3)); -- } -- -- String var5 = this.func_96377_a(Request.func_96353_a(var4.toString(), "", 30000, 80000)); -- return Boolean.valueOf(var5); -- } -- -- public Boolean func_111233_e(long var1, String var3) throws ExceptionMcoService { -- StringBuilder var4 = new StringBuilder(); -- var4.append(c).append("worlds").append("/$WORLD_ID/reset".replace("$WORLD_ID", String.valueOf(var1))); -- if(var3 != null) { -- var4.append("?template=").append(var3); -- } -- -- String var5 = this.func_96377_a(Request.func_96353_a(var4.toString(), "", 30000, 80000)); -- return Boolean.valueOf(var5); -- } -- -- public ValueObjectSubscription func_98177_f(long var1) throws IOException, ExceptionMcoService { -- String var3 = this.func_96377_a(Request.func_96358_a(c + "subscriptions" + "/$WORLD_ID".replace("$WORLD_ID", String.valueOf(var1)))); -+ public Boolean func_96383_b(long par1) throws ExceptionMcoService, IOException { -+ String var3 = field_96388_b + "worlds" + "/$WORLD_ID/open".replace("$WORLD_ID", String.valueOf(par1)); -+ String var4 = this.func_96377_a(Request.func_96363_c(var3, "")); -+ return Boolean.valueOf(var4); -+ } -+ -+ public Boolean func_96378_c(long par1) throws ExceptionMcoService, IOException { -+ String var3 = field_96388_b + "worlds" + "/$WORLD_ID/close".replace("$WORLD_ID", String.valueOf(par1)); -+ String var4 = this.func_96377_a(Request.func_96363_c(var3, "")); -+ return Boolean.valueOf(var4); -+ } -+ -+ public Boolean func_96376_d(long par1, String par3Str) throws ExceptionMcoService, UnsupportedEncodingException { -+ StringBuilder var4 = new StringBuilder(); -+ var4.append(field_96388_b).append("worlds").append("/$WORLD_ID/reset".replace("$WORLD_ID", String.valueOf(par1))); -+ -+ if (par3Str != null && par3Str.length() > 0) { -+ var4.append("?seed=").append(this.func_96380_a(par3Str)); -+ } -+ -+ String var5 = this.func_96377_a(Request.func_96353_a(var4.toString(), "", 30000, 80000)); -+ return Boolean.valueOf(var5); -+ } -+ -+ public Boolean func_111233_e(long par1, String par3Str) throws ExceptionMcoService { -+ StringBuilder var4 = new StringBuilder(); -+ var4.append(field_96388_b).append("worlds").append("/$WORLD_ID/reset".replace("$WORLD_ID", String.valueOf(par1))); -+ -+ if (par3Str != null) { -+ var4.append("?template=").append(par3Str); -+ } -+ -+ String var5 = this.func_96377_a(Request.func_96353_a(var4.toString(), "", 30000, 80000)); -+ return Boolean.valueOf(var5); -+ } -+ -+ public ValueObjectSubscription func_98177_f(long par1) throws ExceptionMcoService, IOException { -+ String var3 = this.func_96377_a(Request.func_96358_a(field_96388_b + "subscriptions" + "/$WORLD_ID".replace("$WORLD_ID", String.valueOf(par1)))); - return ValueObjectSubscription.func_98169_a(var3); - } - - public int func_130106_e() throws ExceptionMcoService { -- String var1 = this.func_96377_a(Request.func_96358_a(c + "invites" + "/count/pending")); -+ String var1 = this.func_96377_a(Request.func_96358_a(field_96388_b + "invites" + "/count/pending")); - return Integer.parseInt(var1); - } - - public PendingInvitesList func_130108_f() throws ExceptionMcoService { -- String var1 = this.func_96377_a(Request.func_96358_a(c + "invites" + "/pending")); -+ String var1 = this.func_96377_a(Request.func_96358_a(field_96388_b + "invites" + "/pending")); - return PendingInvitesList.func_130095_a(var1); - } - -- public void func_130107_a(String var1) throws ExceptionMcoService { -- this.func_96377_a(Request.func_96363_c(c + "invites" + "/accept/$INVITATION_ID".replace("$INVITATION_ID", var1), "")); -- } -- -- public void func_130109_b(String var1) throws ExceptionMcoService { -- this.func_96377_a(Request.func_96363_c(c + "invites" + "/reject/$INVITATION_ID".replace("$INVITATION_ID", var1), "")); -- } -- -- private String func_96380_a(String var1) throws UnsupportedEncodingException { -- return URLEncoder.encode(var1, "UTF-8"); -- } -- -- private String func_96377_a(Request var1) throws ExceptionMcoService { -- var1.func_100006_a("sid", this.a); -- var1.func_100006_a("user", this.b); -- var1.func_100006_a("version", "1.6.4"); -+ public void func_130107_a(String par1Str) throws ExceptionMcoService { -+ this.func_96377_a(Request.func_96363_c(field_96388_b + "invites" + "/accept/$INVITATION_ID".replace("$INVITATION_ID", par1Str), "")); -+ } -+ -+ public void func_130109_b(String par1Str) throws ExceptionMcoService { -+ this.func_96377_a(Request.func_96363_c(field_96388_b + "invites" + "/reject/$INVITATION_ID".replace("$INVITATION_ID", par1Str), "")); -+ } -+ -+ private String func_96380_a(String par1Str) throws UnsupportedEncodingException { -+ return URLEncoder.encode(par1Str, "UTF-8"); -+ } -+ -+ private String func_96377_a(Request par1Request) throws ExceptionMcoService { -+ par1Request.func_100006_a("sid", this.field_96390_a); -+ par1Request.func_100006_a("user", this.field_100007_c); -+ par1Request.func_100006_a("version", "1.6.4"); - - try { -- int var2 = var1.func_96362_a(); -- if(var2 == 503) { -- int var3 = var1.func_111221_b(); -+ int var2 = par1Request.func_96362_a(); -+ -+ if (var2 == 503) { -+ int var3 = par1Request.func_111221_b(); - throw new ExceptionRetryCall(var3); -- } else if(var2 >= 200 && var2 < 300) { -- return var1.func_96364_c(); -+ } else if (var2 >= 200 && var2 < 300) { -+ return par1Request.func_96364_c(); - } else { -- throw new ExceptionMcoService(var1.func_96362_a(), var1.func_96364_c(), var1.func_130110_g()); -+ throw new ExceptionMcoService(par1Request.func_96362_a(), par1Request.func_96364_c(), par1Request.func_130110_g()); - } - } catch (ExceptionMcoHttp var4) { - throw new ExceptionMcoService(500, "Server not available!", -1); ---- /dev/null -+++ com/prupe/mcpatcher/cc/Colorizer$1.java -@@ -1,0 +1,66 @@ -+package com.prupe.mcpatcher.cc; -+ -+import com.prupe.mcpatcher.TexturePackChangeHandler; -+ -+final class Colorizer$1 extends TexturePackChangeHandler { -+ Colorizer$1(String x0, int x1) { -+ super(x0, x1); -+ } -+ -+ public void beforeChange() { -+ Colorizer.access$000(); -+ } -+ -+ public void afterChange() { -+ Colorizer.access$100(); -+ ColorizeBlock.reloadColorMaps(Colorizer.access$200()); -+ -+ if (Colorizer.useFogColors) { -+ ColorizeWorld.reloadFogColors(Colorizer.access$200()); -+ } -+ -+ if (Colorizer.usePotionColors) { -+ ColorizeItem.reloadPotionColors(Colorizer.access$200()); -+ } -+ -+ if (Colorizer.useSwampColors) { -+ ColorizeBlock.reloadSwampColors(Colorizer.access$200()); -+ } -+ -+ if (Colorizer.useBlockColors) { -+ ColorizeBlock.reloadBlockColors(Colorizer.access$200()); -+ } -+ -+ if (Colorizer.useParticleColors) { -+ ColorizeEntity.reloadParticleColors(Colorizer.access$200()); -+ } -+ -+ if (Colorizer.useRedstoneColors) { -+ ColorizeBlock.reloadRedstoneColors(Colorizer.access$200()); -+ } -+ -+ if (Colorizer.useStemColors) { -+ ColorizeBlock.reloadStemColors(Colorizer.access$200()); -+ } -+ -+ if (Colorizer.useCloudType) { -+ ColorizeWorld.reloadCloudType(Colorizer.access$200()); -+ } -+ -+ if (Colorizer.useMapColors) { -+ ColorizeItem.reloadMapColors(Colorizer.access$200()); -+ } -+ -+ if (Colorizer.useDyeColors) { -+ ColorizeEntity.reloadDyeColors(Colorizer.access$200()); -+ } -+ -+ if (Colorizer.useTextColors) { -+ ColorizeWorld.reloadTextColors(Colorizer.access$200()); -+ } -+ -+ if (Colorizer.useXPOrbColors) { -+ ColorizeEntity.reloadXPOrbColors(Colorizer.access$200()); -+ } -+ } -+} ---- net/minecraft/src/ChatMessageComponent.java -+++ net/minecraft/src/ChatMessageComponent.java -@@ -7,35 +7,34 @@ - import java.util.List; - - public class ChatMessageComponent { -- private static final Gson a = (new GsonBuilder()).registerTypeAdapter(ChatMessageComponent.class, new MessageComponentSerializer()).create(); -+ private static final Gson field_111089_a = (new GsonBuilder()).registerTypeAdapter(ChatMessageComponent.class, new MessageComponentSerializer()).create(); - private EnumChatFormatting color; -- private Boolean c; -- private Boolean d; -- private Boolean e; -- private Boolean f; -- private String g; -- private String h; -- private List i; -- -- public ChatMessageComponent() { -- } -- -- public ChatMessageComponent(ChatMessageComponent var1) { -- this.color = var1.color; -- this.c = var1.c; -- this.d = var1.d; -- this.e = var1.e; -- this.f = var1.f; -- this.g = var1.g; -- this.h = var1.h; -- this.i = var1.i == null ? null : Lists.newArrayList((Iterable)var1.i); -- } -- -- public ChatMessageComponent setColor(EnumChatFormatting var1) { -- if(var1 != null && !var1.Checks()) { -+ private Boolean bold; -+ private Boolean italic; -+ private Boolean underline; -+ private Boolean obfuscated; -+ private String text; -+ private String translationKey; -+ private List field_111091_i; -+ -+ public ChatMessageComponent() {} -+ -+ public ChatMessageComponent(ChatMessageComponent par1ChatMessageComponent) { -+ this.color = par1ChatMessageComponent.color; -+ this.bold = par1ChatMessageComponent.bold; -+ this.italic = par1ChatMessageComponent.italic; -+ this.underline = par1ChatMessageComponent.underline; -+ this.obfuscated = par1ChatMessageComponent.obfuscated; -+ this.text = par1ChatMessageComponent.text; -+ this.translationKey = par1ChatMessageComponent.translationKey; -+ this.field_111091_i = par1ChatMessageComponent.field_111091_i == null ? null : Lists.newArrayList(par1ChatMessageComponent.field_111091_i); -+ } -+ -+ public ChatMessageComponent setColor(EnumChatFormatting par1EnumChatFormatting) { -+ if (par1EnumChatFormatting != null && !par1EnumChatFormatting.isColor()) { - throw new IllegalArgumentException("Argument is not a valid color!"); - } else { -- this.color = var1; -+ this.color = par1EnumChatFormatting; - return this; - } - } -@@ -44,125 +43,133 @@ - return this.color; - } - -- public ChatMessageComponent setBold(Boolean var1) { -- this.c = var1; -+ public ChatMessageComponent setBold(Boolean par1) { -+ this.bold = par1; - return this; - } - - public Boolean isBold() { -- return this.c; -+ return this.bold; - } - -- public ChatMessageComponent setItalic(Boolean var1) { -- this.d = var1; -+ public ChatMessageComponent setItalic(Boolean par1) { -+ this.italic = par1; - return this; - } - - public Boolean isItalic() { -- return this.d; -+ return this.italic; - } - -- public ChatMessageComponent setUnderline(Boolean var1) { -- this.e = var1; -+ public ChatMessageComponent setUnderline(Boolean par1) { -+ this.underline = par1; - return this; - } - - public Boolean isUnderline() { -- return this.e; -+ return this.underline; - } - -- public ChatMessageComponent setObfuscated(Boolean var1) { -- this.f = var1; -+ public ChatMessageComponent setObfuscated(Boolean par1) { -+ this.obfuscated = par1; - return this; - } - - public Boolean isObfuscated() { -- return this.f; -+ return this.obfuscated; - } - - protected String getText() { -- return this.g; -+ return this.text; - } - - protected String getTranslationKey() { -- return this.h; -+ return this.translationKey; - } - - protected List getSubComponents() { -- return this.i; -- } -- -- public ChatMessageComponent appendComponent(ChatMessageComponent var1) { -- if(this.g == null && this.h == null) { -- if(this.i != null) { -- this.i.add(var1); -- } else { -- this.i = Lists.newArrayList((Object[])(new ChatMessageComponent[]{var1})); -- } -- } else { -- this.i = Lists.newArrayList((Object[])(new ChatMessageComponent[]{new ChatMessageComponent(this), var1})); -- this.g = null; -- this.h = null; -- } -- -- return this; -- } -- -- public ChatMessageComponent addText(String var1) { -- if(this.g == null && this.h == null) { -- if(this.i != null) { -- this.i.add(createFromText(var1)); -- } else { -- this.g = var1; -- } -- } else { -- this.i = Lists.newArrayList((Object[])(new ChatMessageComponent[]{new ChatMessageComponent(this), createFromText(var1)})); -- this.g = null; -- this.h = null; -- } -- -- return this; -- } -- -- public ChatMessageComponent addKey(String var1) { -- if(this.g == null && this.h == null) { -- if(this.i != null) { -- this.i.add(createFromTranslationKey(var1)); -- } else { -- this.h = var1; -- } -- } else { -- this.i = Lists.newArrayList((Object[])(new ChatMessageComponent[]{new ChatMessageComponent(this), createFromTranslationKey(var1)})); -- this.g = null; -- this.h = null; -- } -- -- return this; -- } -- -- public ChatMessageComponent addFormatted(String var1, Object... var2) { -- if(this.g == null && this.h == null) { -- if(this.i != null) { -- this.i.add(createFromTranslationWithSubstitutions(var1, var2)); -- } else { -- this.h = var1; -- this.i = Lists.newArrayList(); -- Object[] var3 = var2; -- int var4 = var2.length; -- -- for(int var5 = 0; var5 < var4; ++var5) { -+ return this.field_111091_i; -+ } -+ -+ public ChatMessageComponent appendComponent(ChatMessageComponent par1ChatMessageComponent) { -+ if (this.text == null && this.translationKey == null) { -+ if (this.field_111091_i != null) { -+ this.field_111091_i.add(par1ChatMessageComponent); -+ } else { -+ this.field_111091_i = Lists.newArrayList(new ChatMessageComponent[] {par1ChatMessageComponent}); -+ } -+ } else { -+ this.field_111091_i = Lists.newArrayList(new ChatMessageComponent[] {new ChatMessageComponent(this), par1ChatMessageComponent}); -+ this.text = null; -+ this.translationKey = null; -+ } -+ -+ return this; -+ } -+ -+ public ChatMessageComponent addText(String par1Str) { -+ if (this.text == null && this.translationKey == null) { -+ if (this.field_111091_i != null) { -+ this.field_111091_i.add(createFromText(par1Str)); -+ } else { -+ this.text = par1Str; -+ } -+ } else { -+ this.field_111091_i = Lists.newArrayList(new ChatMessageComponent[] {new ChatMessageComponent(this), createFromText(par1Str)}); -+ this.text = null; -+ this.translationKey = null; -+ } -+ -+ return this; -+ } -+ -+ /** -+ * Appends a translated string. -+ */ -+ public ChatMessageComponent addKey(String par1Str) { -+ if (this.text == null && this.translationKey == null) { -+ if (this.field_111091_i != null) { -+ this.field_111091_i.add(createFromTranslationKey(par1Str)); -+ } else { -+ this.translationKey = par1Str; -+ } -+ } else { -+ this.field_111091_i = Lists.newArrayList(new ChatMessageComponent[] {new ChatMessageComponent(this), createFromTranslationKey(par1Str)}); -+ this.text = null; -+ this.translationKey = null; -+ } -+ -+ return this; -+ } -+ -+ /** -+ * Appends a formatted translation key. Args: key, params. The text ultimately displayed is -+ * String.format(translate(key), params) -+ */ -+ public ChatMessageComponent addFormatted(String par1Str, Object ... par2ArrayOfObj) { -+ if (this.text == null && this.translationKey == null) { -+ if (this.field_111091_i != null) { -+ this.field_111091_i.add(createFromTranslationWithSubstitutions(par1Str, par2ArrayOfObj)); -+ } else { -+ this.translationKey = par1Str; -+ this.field_111091_i = Lists.newArrayList(); -+ Object[] var3 = par2ArrayOfObj; -+ int var4 = par2ArrayOfObj.length; -+ -+ for (int var5 = 0; var5 < var4; ++var5) { - Object var6 = var3[var5]; -- if(var6 instanceof ChatMessageComponent) { -- this.i.add((ChatMessageComponent)var6); -+ -+ if (var6 instanceof ChatMessageComponent) { -+ this.field_111091_i.add((ChatMessageComponent)var6); - } else { -- this.i.add(createFromText(var6.toString())); -+ this.field_111091_i.add(createFromText(var6.toString())); - } - } - } - } else { -- this.i = Lists.newArrayList((Object[])(new ChatMessageComponent[]{new ChatMessageComponent(this), createFromTranslationWithSubstitutions(var1, var2)})); -- this.g = null; -- this.h = null; -+ this.field_111091_i = Lists.newArrayList(new ChatMessageComponent[] {new ChatMessageComponent(this), createFromTranslationWithSubstitutions(par1Str, par2ArrayOfObj)}); -+ this.text = null; -+ this.translationKey = null; - } - - return this; -@@ -172,45 +179,51 @@ - return this.toStringWithFormatting(false); - } - -- public String toStringWithFormatting(boolean var1) { -- return this.toStringWithDefaultFormatting(var1, (EnumChatFormatting)null, false, false, false, false); -+ public String toStringWithFormatting(boolean par1) { -+ return this.toStringWithDefaultFormatting(par1, (EnumChatFormatting)null, false, false, false, false); - } - -- public String toStringWithDefaultFormatting(boolean var1, EnumChatFormatting var2, boolean var3, boolean var4, boolean var5, boolean var6) { -+ /** -+ * args: enableFormat, defaultColor, defaultBold, defaultItalic, defaultUnderline, defaultObfuscated -+ */ -+ public String toStringWithDefaultFormatting(boolean par1, EnumChatFormatting par2EnumChatFormatting, boolean par3, boolean par4, boolean par5, boolean par6) { - StringBuilder var7 = new StringBuilder(); -- EnumChatFormatting var8 = this.color == null ? var2 : this.color; -- boolean var9 = this.c == null ? var3 : this.c.booleanValue(); -- boolean var10 = this.d == null ? var4 : this.d.booleanValue(); -- boolean var11 = this.e == null ? var5 : this.e.booleanValue(); -- boolean var12 = this.f == null ? var6 : this.f.booleanValue(); -- if(this.h != null) { -- if(var1) { -+ EnumChatFormatting var8 = this.color == null ? par2EnumChatFormatting : this.color; -+ boolean var9 = this.bold == null ? par3 : this.bold.booleanValue(); -+ boolean var10 = this.italic == null ? par4 : this.italic.booleanValue(); -+ boolean var11 = this.underline == null ? par5 : this.underline.booleanValue(); -+ boolean var12 = this.obfuscated == null ? par6 : this.obfuscated.booleanValue(); -+ -+ if (this.translationKey != null) { -+ if (par1) { - appendFormattingToString(var7, var8, var9, var10, var11, var12); - } - -- if(this.i != null) { -- String[] var13 = new String[this.i.size()]; -+ if (this.field_111091_i != null) { -+ String[] var13 = new String[this.field_111091_i.size()]; - -- for(int var14 = 0; var14 < this.i.size(); ++var14) { -- var13[var14] = ((ChatMessageComponent)this.i.get(var14)).toStringWithDefaultFormatting(var1, var8, var9, var10, var11, var12); -+ for (int var14 = 0; var14 < this.field_111091_i.size(); ++var14) { -+ var13[var14] = ((ChatMessageComponent)this.field_111091_i.get(var14)).toStringWithDefaultFormatting(par1, var8, var9, var10, var11, var12); - } - -- var7.append(StatCollector.translateToLocalFormatted(this.h, var13)); -+ var7.append(StatCollector.translateToLocalFormatted(this.translationKey, var13)); - } else { -- var7.append(StatCollector.translateToLocal(this.h)); -+ var7.append(StatCollector.translateToLocal(this.translationKey)); - } -- } else if(this.g != null) { -- if(var1) { -+ } else if (this.text != null) { -+ if (par1) { - appendFormattingToString(var7, var8, var9, var10, var11, var12); - } - -- var7.append(this.g); -+ var7.append(this.text); - } else { - ChatMessageComponent var16; -- if(this.i != null) { -- for(Iterator var15 = this.i.iterator(); var15.hasNext(); var7.append(var16.toStringWithDefaultFormatting(var1, var8, var9, var10, var11, var12))) { -+ -+ if (this.field_111091_i != null) { -+ for (Iterator var15 = this.field_111091_i.iterator(); var15.hasNext(); var7.append(var16.toStringWithDefaultFormatting(par1, var8, var9, var10, var11, var12))) { - var16 = (ChatMessageComponent)var15.next(); -- if(var1) { -+ -+ if (par1) { - appendFormattingToString(var7, var8, var9, var10, var11, var12); - } - } -@@ -220,61 +233,60 @@ - return var7.toString(); - } - -- private static void appendFormattingToString(StringBuilder var0, EnumChatFormatting var1, boolean var2, boolean var3, boolean var4, boolean var5) { -- if(var1 != null) { -- var0.append(var1); -- } else if(var2 || var3 || var4 || var5) { -- var0.append(EnumChatFormatting.RESET); -- } -- -- if(var2) { -- var0.append(EnumChatFormatting.BOLD); -- } -- -- if(var3) { -- var0.append(EnumChatFormatting.ITALIC); -- } -- -- if(var4) { -- var0.append(EnumChatFormatting.UNDERLINE); -- } -- -- if(var5) { -- var0.append(EnumChatFormatting.OBFUSCATED); -- } -- -+ private static void appendFormattingToString(StringBuilder par0StringBuilder, EnumChatFormatting par1EnumChatFormatting, boolean par2, boolean par3, boolean par4, boolean par5) { -+ if (par1EnumChatFormatting != null) { -+ par0StringBuilder.append(par1EnumChatFormatting); -+ } else if (par2 || par3 || par4 || par5) { -+ par0StringBuilder.append(EnumChatFormatting.RESET); -+ } -+ -+ if (par2) { -+ par0StringBuilder.append(EnumChatFormatting.BOLD); -+ } -+ -+ if (par3) { -+ par0StringBuilder.append(EnumChatFormatting.ITALIC); -+ } -+ -+ if (par4) { -+ par0StringBuilder.append(EnumChatFormatting.UNDERLINE); -+ } -+ -+ if (par5) { -+ par0StringBuilder.append(EnumChatFormatting.OBFUSCATED); -+ } - } - -- public static ChatMessageComponent createFromJson(String var0) { -+ public static ChatMessageComponent createFromJson(String par0Str) { - try { -- return (ChatMessageComponent)a.fromJson(var0, ChatMessageComponent.class); -+ return (ChatMessageComponent)field_111089_a.fromJson(par0Str, ChatMessageComponent.class); - } catch (Throwable var4) { - CrashReport var2 = CrashReport.makeCrashReport(var4, "Deserializing Message"); - CrashReportCategory var3 = var2.makeCategory("Serialized Message"); -- var3.addCrashSection("JSON string", var0); -+ var3.addCrashSection("JSON string", par0Str); - throw new ReportedException(var2); - } - } - -- public static ChatMessageComponent createFromText(String var0) { -- ChatMessageComponent var1 = new ChatMessageComponent(); -- var1.addText(var0); -- return var1; -- } -- -- public static ChatMessageComponent createFromTranslationKey(String var0) { -- ChatMessageComponent var1 = new ChatMessageComponent(); -- var1.addKey(var0); -- return var1; -- } -- -- public static ChatMessageComponent createFromTranslationWithSubstitutions(String var0, Object... var1) { -+ public static ChatMessageComponent createFromText(String par0Str) { -+ ChatMessageComponent var1 = new ChatMessageComponent(); -+ var1.addText(par0Str); -+ return var1; -+ } -+ -+ public static ChatMessageComponent createFromTranslationKey(String par0Str) { -+ ChatMessageComponent var1 = new ChatMessageComponent(); -+ var1.addKey(par0Str); -+ return var1; -+ } -+ -+ public static ChatMessageComponent createFromTranslationWithSubstitutions(String par0Str, Object ... par1ArrayOfObj) { - ChatMessageComponent var2 = new ChatMessageComponent(); -- var2.addFormatted(var0, var1); -+ var2.addFormatted(par0Str, par1ArrayOfObj); - return var2; - } - - public String toJson() { -- return a.toJson((Object)this); -+ return field_111089_a.toJson(this); - } - } ---- net/minecraft/src/EntitySlime.java -+++ net/minecraft/src/EntitySlime.java -@@ -4,13 +4,15 @@ - public float squishAmount; - public float squishFactor; - public float prevSquishFactor; -+ -+ /** the time between each jump of the slime */ - private int slimeJumpDelay; - -- public EntitySlime(World var1) { -- super(var1); -- int var2 = 1 << this.ab.nextInt(3); -+ public EntitySlime(World par1World) { -+ super(par1World); -+ int var2 = 1 << this.rand.nextInt(3); - this.yOffset = 0.0F; -- this.slimeJumpDelay = this.ab.nextInt(20) + 10; -+ this.slimeJumpDelay = this.rand.nextInt(20) + 10; - this.setSlimeSize(var2); - } - -@@ -19,39 +21,57 @@ - this.dataWatcher.addObject(16, new Byte((byte)1)); - } - -- protected void setSlimeSize(int var1) { -- this.dataWatcher.updateObject(16, new Byte((byte)var1)); -- this.setSize(0.6F * (float)var1, 0.6F * (float)var1); -+ protected void setSlimeSize(int par1) { -+ this.dataWatcher.updateObject(16, new Byte((byte)par1)); -+ this.setSize(0.6F * (float)par1, 0.6F * (float)par1); - this.setPosition(this.posX, this.posY, this.posZ); -- this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setAttribute((double)(var1 * var1)); -+ this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setAttribute((double)(par1 * par1)); - this.setHealth(this.getMaxHealth()); -- this.experienceValue = var1; -+ this.experienceValue = par1; - } - -+ /** -+ * Returns the size of the slime. -+ */ - public int getSlimeSize() { - return this.dataWatcher.getWatchableObjectByte(16); - } - -- public void writeEntityToNBT(NBTTagCompound var1) { -- super.writeEntityToNBT(var1); -- var1.setInteger("Size", this.getSlimeSize() - 1); -- } -- -- public void readEntityFromNBT(NBTTagCompound var1) { -- super.readEntityFromNBT(var1); -- this.setSlimeSize(var1.getInteger("Size") + 1); -- } -- -+ /** -+ * (abstract) Protected helper method to write subclass entity data to NBT. -+ */ -+ public void writeEntityToNBT(NBTTagCompound par1NBTTagCompound) { -+ super.writeEntityToNBT(par1NBTTagCompound); -+ par1NBTTagCompound.setInteger("Size", this.getSlimeSize() - 1); -+ } -+ -+ /** -+ * (abstract) Protected helper method to read subclass entity data from NBT. -+ */ -+ public void readEntityFromNBT(NBTTagCompound par1NBTTagCompound) { -+ super.readEntityFromNBT(par1NBTTagCompound); -+ this.setSlimeSize(par1NBTTagCompound.getInteger("Size") + 1); -+ } -+ -+ /** -+ * Returns the name of a particle effect that may be randomly created by EntitySlime.onUpdate() -+ */ - protected String getSlimeParticle() { - return "slime"; - } - -+ /** -+ * Returns the name of the sound played when the slime jumps. -+ */ - protected String getJumpSound() { - return "mob.slime." + (this.getSlimeSize() > 1 ? "big" : "small"); - } - -+ /** -+ * Called to update the entity's position/logic. -+ */ - public void onUpdate() { -- if(!this.worldObj.isRemote && this.worldObj.difficultySetting == 0 && this.getSlimeSize() > 0) { -+ if (!this.worldObj.isRemote && this.worldObj.difficultySetting == 0 && this.getSlimeSize() > 0) { - this.isDead = true; - } - -@@ -60,86 +80,97 @@ - boolean var1 = this.onGround; - super.onUpdate(); - int var2; -- if(this.onGround && !var1) { -+ -+ if (this.onGround && !var1) { - var2 = this.getSlimeSize(); - -- for(int var3 = 0; var3 < var2 * 8; ++var3) { -- float var4 = this.ab.nextFloat() * (float)Math.PI * 2.0F; -- float var5 = this.ab.nextFloat() * 0.5F + 0.5F; -+ for (int var3 = 0; var3 < var2 * 8; ++var3) { -+ float var4 = this.rand.nextFloat() * (float)Math.PI * 2.0F; -+ float var5 = this.rand.nextFloat() * 0.5F + 0.5F; - float var6 = MathHelper.sin(var4) * (float)var2 * 0.5F * var5; - float var7 = MathHelper.cos(var4) * (float)var2 * 0.5F * var5; - this.worldObj.spawnParticle(this.getSlimeParticle(), this.posX + (double)var6, this.boundingBox.minY, this.posZ + (double)var7, 0.0D, 0.0D, 0.0D); - } - -- if(this.makesSoundOnLand()) { -- this.playSound(this.getJumpSound(), this.getSoundVolume(), ((this.ab.nextFloat() - this.ab.nextFloat()) * 0.2F + 1.0F) / 0.8F); -+ if (this.makesSoundOnLand()) { -+ this.playSound(this.getJumpSound(), this.getSoundVolume(), ((this.rand.nextFloat() - this.rand.nextFloat()) * 0.2F + 1.0F) / 0.8F); - } - - this.squishAmount = -0.5F; -- } else if(!this.onGround && var1) { -+ } else if (!this.onGround && var1) { - this.squishAmount = 1.0F; - } - - this.alterSquishAmount(); -- if(this.worldObj.isRemote) { -+ -+ if (this.worldObj.isRemote) { - var2 = this.getSlimeSize(); - this.setSize(0.6F * (float)var2, 0.6F * (float)var2); - } -- - } - - protected void updateEntityActionState() { - this.despawnEntity(); - EntityPlayer var1 = this.worldObj.getClosestVulnerablePlayerToEntity(this, 16.0D); -- if(var1 != null) { -+ -+ if (var1 != null) { - this.faceEntity(var1, 10.0F, 20.0F); - } - -- if(this.onGround && this.slimeJumpDelay-- <= 0) { -+ if (this.onGround && this.slimeJumpDelay-- <= 0) { - this.slimeJumpDelay = this.getJumpDelay(); -- if(var1 != null) { -+ -+ if (var1 != null) { - this.slimeJumpDelay /= 3; - } - - this.isJumping = true; -- if(this.makesSoundOnJump()) { -- this.playSound(this.getJumpSound(), this.getSoundVolume(), ((this.ab.nextFloat() - this.ab.nextFloat()) * 0.2F + 1.0F) * 0.8F); -+ -+ if (this.makesSoundOnJump()) { -+ this.playSound(this.getJumpSound(), this.getSoundVolume(), ((this.rand.nextFloat() - this.rand.nextFloat()) * 0.2F + 1.0F) * 0.8F); - } - -- this.moveStrafing = 1.0F - this.ab.nextFloat() * 2.0F; -+ this.moveStrafing = 1.0F - this.rand.nextFloat() * 2.0F; - this.moveForward = (float)(1 * this.getSlimeSize()); - } else { - this.isJumping = false; -- if(this.onGround) { -+ -+ if (this.onGround) { - this.moveStrafing = this.moveForward = 0.0F; - } - } -- - } - - protected void alterSquishAmount() { - this.squishAmount *= 0.6F; - } - -+ /** -+ * Gets the amount of time the slime needs to wait between jumps. -+ */ - protected int getJumpDelay() { -- return this.ab.nextInt(20) + 10; -+ return this.rand.nextInt(20) + 10; - } - - protected EntitySlime createInstance() { - return new EntitySlime(this.worldObj); - } - -+ /** -+ * Will get destroyed next tick. -+ */ - public void setDead() { - int var1 = this.getSlimeSize(); -- if(!this.worldObj.isRemote && var1 > 1 && this.getHealth() <= 0.0F) { -- int var2 = 2 + this.ab.nextInt(3); -- -- for(int var3 = 0; var3 < var2; ++var3) { -+ -+ if (!this.worldObj.isRemote && var1 > 1 && this.getHealth() <= 0.0F) { -+ int var2 = 2 + this.rand.nextInt(3); -+ -+ for (int var3 = 0; var3 < var2; ++var3) { - float var4 = ((float)(var3 % 2) - 0.5F) * (float)var1 / 4.0F; - float var5 = ((float)(var3 / 2) - 0.5F) * (float)var1 / 4.0F; - EntitySlime var6 = this.createInstance(); - var6.setSlimeSize(var1 / 2); -- var6.setLocationAndAngles(this.posX + (double)var4, this.posY + 0.5D, this.posZ + (double)var5, this.ab.nextFloat() * 360.0F, 0.0F); -+ var6.setLocationAndAngles(this.posX + (double)var4, this.posY + 0.5D, this.posZ + (double)var5, this.rand.nextFloat() * 360.0F, 0.0F); - this.worldObj.spawnEntityInWorld(var6); - } - } -@@ -147,48 +178,71 @@ - super.setDead(); - } - -- public void onCollideWithPlayer(EntityPlayer var1) { -- if(this.canDamagePlayer()) { -+ /** -+ * Called by a player entity when they collide with an entity -+ */ -+ public void onCollideWithPlayer(EntityPlayer par1EntityPlayer) { -+ if (this.canDamagePlayer()) { - int var2 = this.getSlimeSize(); -- if(this.canEntityBeSeen(var1) && this.getDistanceSqToEntity(var1) < 0.6D * (double)var2 * 0.6D * (double)var2 && var1.attackEntityFrom(DamageSource.causeMobDamage(this), (float)this.getAttackStrength())) { -- this.playSound("mob.attack", 1.0F, (this.ab.nextFloat() - this.ab.nextFloat()) * 0.2F + 1.0F); -+ -+ if (this.canEntityBeSeen(par1EntityPlayer) && this.getDistanceSqToEntity(par1EntityPlayer) < 0.6D * (double)var2 * 0.6D * (double)var2 && par1EntityPlayer.attackEntityFrom(DamageSource.causeMobDamage(this), (float)this.getAttackStrength())) { -+ this.playSound("mob.attack", 1.0F, (this.rand.nextFloat() - this.rand.nextFloat()) * 0.2F + 1.0F); - } - } -- - } - -+ /** -+ * Indicates weather the slime is able to damage the player (based upon the slime's size) -+ */ - protected boolean canDamagePlayer() { - return this.getSlimeSize() > 1; - } - -+ /** -+ * Gets the amount of damage dealt to the player when "attacked" by the slime. -+ */ - protected int getAttackStrength() { - return this.getSlimeSize(); - } - -+ /** -+ * Returns the sound this mob makes when it is hurt. -+ */ - protected String getHurtSound() { - return "mob.slime." + (this.getSlimeSize() > 1 ? "big" : "small"); - } - -+ /** -+ * Returns the sound this mob makes on death. -+ */ - protected String getDeathSound() { - return "mob.slime." + (this.getSlimeSize() > 1 ? "big" : "small"); - } - -+ /** -+ * Returns the item ID for the item the mob drops on death. -+ */ - protected int getDropItemId() { - return this.getSlimeSize() == 1 ? Item.slimeBall.itemID : 0; - } - -+ /** -+ * Checks if the entity's current position is a valid location to spawn this entity. -+ */ - public boolean getCanSpawnHere() { - Chunk var1 = this.worldObj.getChunkFromBlockCoords(MathHelper.floor_double(this.posX), MathHelper.floor_double(this.posZ)); -- if(this.worldObj.getWorldInfo().getTerrainType() == WorldType.FLAT && this.ab.nextInt(4) != 1) { -+ -+ if (this.worldObj.getWorldInfo().getTerrainType() == WorldType.FLAT && this.rand.nextInt(4) != 1) { - return false; - } else { -- if(this.getSlimeSize() == 1 || this.worldObj.difficultySetting > 0) { -+ if (this.getSlimeSize() == 1 || this.worldObj.difficultySetting > 0) { - BiomeGenBase var2 = this.worldObj.getBiomeGenForCoords(MathHelper.floor_double(this.posX), MathHelper.floor_double(this.posZ)); -- if(var2 == BiomeGenBase.swampland && this.posY > 50.0D && this.posY < 70.0D && this.ab.nextFloat() < 0.5F && this.ab.nextFloat() < this.worldObj.getCurrentMoonPhaseFactor() && this.worldObj.getBlockLightValue(MathHelper.floor_double(this.posX), MathHelper.floor_double(this.posY), MathHelper.floor_double(this.posZ)) <= this.ab.nextInt(8)) { -+ -+ if (var2 == BiomeGenBase.swampland && this.posY > 50.0D && this.posY < 70.0D && this.rand.nextFloat() < 0.5F && this.rand.nextFloat() < this.worldObj.getCurrentMoonPhaseFactor() && this.worldObj.getBlockLightValue(MathHelper.floor_double(this.posX), MathHelper.floor_double(this.posY), MathHelper.floor_double(this.posZ)) <= this.rand.nextInt(8)) { - return super.getCanSpawnHere(); - } - -- if(this.ab.nextInt(10) == 0 && var1.getRandomWithSeed(987234911L).nextInt(10) == 0 && this.posY < 40.0D) { -+ if (this.rand.nextInt(10) == 0 && var1.getRandomWithSeed(987234911L).nextInt(10) == 0 && this.posY < 40.0D) { - return super.getCanSpawnHere(); - } - } -@@ -197,18 +251,31 @@ - } - } - -+ /** -+ * Returns the volume for the sounds this mob makes. -+ */ - protected float getSoundVolume() { - return 0.4F * (float)this.getSlimeSize(); - } - -+ /** -+ * The speed it takes to move the entityliving's rotationPitch through the faceEntity method. This is only currently -+ * use in wolves. -+ */ - public int getVerticalFaceSpeed() { - return 0; - } - -+ /** -+ * Returns true if the slime makes a sound when it jumps (based upon the slime's size) -+ */ - protected boolean makesSoundOnJump() { - return this.getSlimeSize() > 0; - } - -+ /** -+ * Returns true if the slime makes a sound when it lands after a jump (based upon the slime's size) -+ */ - protected boolean makesSoundOnLand() { - return this.getSlimeSize() > 2; - } ---- net/minecraft/src/TileEntityChest.java -+++ net/minecraft/src/TileEntityChest.java -@@ -3,48 +3,84 @@ - import java.util.Iterator; - import java.util.List; - -+// Spout Start -+import org.spoutcraft.api.Spoutcraft; -+import org.spoutcraft.client.SpoutClient; -+import org.spoutcraft.client.block.SpoutcraftChunk; -+// Spout End -+ - public class TileEntityChest extends TileEntity implements IInventory { - private ItemStack[] chestContents = new ItemStack[36]; -+ -+ /** Determines if the check for adjacent chests has taken place. */ - public boolean adjacentChestChecked; -+ -+ /** Contains the chest tile located adjacent to this one (if any) */ - public TileEntityChest adjacentChestZNeg; -+ -+ /** Contains the chest tile located adjacent to this one (if any) */ - public TileEntityChest adjacentChestXPos; -+ -+ /** Contains the chest tile located adjacent to this one (if any) */ - public TileEntityChest adjacentChestXNeg; -+ -+ /** Contains the chest tile located adjacent to this one (if any) */ - public TileEntityChest adjacentChestZPosition; -+ -+ /** The current angle of the lid (between 0 and 1) */ - public float lidAngle; -+ -+ /** The angle of the lid last tick */ - public float prevLidAngle; -+ -+ /** The number of players currently using this chest */ - public int numUsingPlayers; -+ -+ /** Server sync counter (once per 20 ticks) */ - private int ticksSinceSync; - private int cachedChestType; -- private String s; -+ private String customName; - - public TileEntityChest() { - this.cachedChestType = -1; - } - -- public TileEntityChest(int var1) { -- this.cachedChestType = var1; -+ public TileEntityChest(int par1) { -+ this.cachedChestType = par1; - } - -+ /** -+ * Returns the number of slots in the inventory. -+ */ - public int getSizeInventory() { - return 27; - } - -- public ItemStack getStackInSlot(int var1) { -- return this.chestContents[var1]; -+ /** -+ * Returns the stack in slot i -+ */ -+ public ItemStack getStackInSlot(int par1) { -+ return this.chestContents[par1]; - } - -- public ItemStack decrStackSize(int var1, int var2) { -- if(this.chestContents[var1] != null) { -+ /** -+ * Removes from an inventory slot (first arg) up to a specified number (second arg) of items and returns them in a new -+ * stack. -+ */ -+ public ItemStack decrStackSize(int par1, int par2) { -+ if (this.chestContents[par1] != null) { - ItemStack var3; -- if(this.chestContents[var1].stackSize <= var2) { -- var3 = this.chestContents[var1]; -- this.chestContents[var1] = null; -+ -+ if (this.chestContents[par1].stackSize <= par2) { -+ var3 = this.chestContents[par1]; -+ this.chestContents[par1] = null; - this.onInventoryChanged(); - return var3; - } else { -- var3 = this.chestContents[var1].splitStack(var2); -- if(this.chestContents[var1].stackSize == 0) { -- this.chestContents[var1] = null; -+ var3 = this.chestContents[par1].splitStack(par2); -+ -+ if (this.chestContents[par1].stackSize == 0) { -+ this.chestContents[par1] = null; - } - - this.onInventoryChanged(); -@@ -55,61 +91,86 @@ - } - } - -- public ItemStack getStackInSlotOnClosing(int var1) { -- if(this.chestContents[var1] != null) { -- ItemStack var2 = this.chestContents[var1]; -- this.chestContents[var1] = null; -+ /** -+ * When some containers are closed they call this on each slot, then drop whatever it returns as an EntityItem - like -+ * when you close a workbench GUI. -+ */ -+ public ItemStack getStackInSlotOnClosing(int par1) { -+ if (this.chestContents[par1] != null) { -+ ItemStack var2 = this.chestContents[par1]; -+ this.chestContents[par1] = null; - return var2; - } else { - return null; - } - } - -- public void setInventorySlotContents(int var1, ItemStack var2) { -- this.chestContents[var1] = var2; -- if(var2 != null && var2.stackSize > this.getInventoryStackLimit()) { -- var2.stackSize = this.getInventoryStackLimit(); -+ /** -+ * Sets the given item stack to the specified slot in the inventory (can be crafting or armor sections). -+ */ -+ public void setInventorySlotContents(int par1, ItemStack par2ItemStack) { -+ this.chestContents[par1] = par2ItemStack; -+ -+ if (par2ItemStack != null && par2ItemStack.stackSize > this.getInventoryStackLimit()) { -+ par2ItemStack.stackSize = this.getInventoryStackLimit(); - } - - this.onInventoryChanged(); - } - -+ /** -+ * Returns the name of the inventory. -+ */ - public String getInvName() { -- return this.isInvNameLocalized() ? this.s : "container.chest"; -+ return this.isInvNameLocalized() ? this.customName : "container.chest"; - } - -+ /** -+ * If this returns false, the inventory name will be used as an unlocalized name, and translated into the player's -+ * language. Otherwise it will be used directly. -+ */ - public boolean isInvNameLocalized() { -- return this.s != null && this.s.length() > 0; -- } -- -- public void setChestGuiName(String var1) { -- this.s = var1; -- } -- -- public void readFromNBT(NBTTagCompound var1) { -- super.readFromNBT(var1); -- NBTTagList var2 = var1.getTagList("Items"); -+ return this.customName != null && this.customName.length() > 0; -+ } -+ -+ /** -+ * Sets the custom display name to use when opening a GUI for this specific TileEntityChest. -+ */ -+ public void setChestGuiName(String par1Str) { -+ this.customName = par1Str; -+ } -+ -+ /** -+ * Reads a tile entity from NBT. -+ */ -+ public void readFromNBT(NBTTagCompound par1NBTTagCompound) { -+ super.readFromNBT(par1NBTTagCompound); -+ NBTTagList var2 = par1NBTTagCompound.getTagList("Items"); - this.chestContents = new ItemStack[this.getSizeInventory()]; -- if(var1.hasKey("CustomName")) { -- this.s = var1.getString("CustomName"); -+ -+ if (par1NBTTagCompound.hasKey("CustomName")) { -+ this.customName = par1NBTTagCompound.getString("CustomName"); - } - -- for(int var3 = 0; var3 < var2.tagCount(); ++var3) { -+ for (int var3 = 0; var3 < var2.tagCount(); ++var3) { - NBTTagCompound var4 = (NBTTagCompound)var2.tagAt(var3); - int var5 = var4.getByte("Slot") & 255; -- if(var5 >= 0 && var5 < this.chestContents.length) { -+ -+ if (var5 >= 0 && var5 < this.chestContents.length) { - this.chestContents[var5] = ItemStack.loadItemStackFromNBT(var4); - } - } -- - } - -- public void writeToNBT(NBTTagCompound var1) { -- super.writeToNBT(var1); -+ /** -+ * Writes a tile entity to NBT. -+ */ -+ public void writeToNBT(NBTTagCompound par1NBTTagCompound) { -+ super.writeToNBT(par1NBTTagCompound); - NBTTagList var2 = new NBTTagList(); - -- for(int var3 = 0; var3 < this.chestContents.length; ++var3) { -- if(this.chestContents[var3] != null) { -+ for (int var3 = 0; var3 < this.chestContents.length; ++var3) { -+ if (this.chestContents[var3] != null) { - NBTTagCompound var4 = new NBTTagCompound(); - var4.setByte("Slot", (byte)var3); - this.chestContents[var3].writeToNBT(var4); -@@ -117,195 +178,247 @@ - } - } - -- var1.setTag("Items", var2); -- if(this.isInvNameLocalized()) { -- var1.setString("CustomName", this.s); -+ par1NBTTagCompound.setTag("Items", var2); -+ -+ if (this.isInvNameLocalized()) { -+ par1NBTTagCompound.setString("CustomName", this.customName); - } -- - } - -+ /** -+ * Returns the maximum stack size for a inventory slot. Seems to always be 64, possibly will be extended. *Isn't this -+ * more of a set than a get?* -+ */ - public int getInventoryStackLimit() { - return 64; - } - -- public boolean isUseableByPlayer(EntityPlayer var1) { -- return this.worldObj.getBlockTileEntity(this.xCoord, this.yCoord, this.zCoord) != this ? false : var1.getDistanceSq((double)this.xCoord + 0.5D, (double)this.yCoord + 0.5D, (double)this.zCoord + 0.5D) <= 64.0D; -+ /** -+ * Do not make give this method the name canInteractWith because it clashes with Container -+ */ -+ public boolean isUseableByPlayer(EntityPlayer par1EntityPlayer) { -+ return this.worldObj.getBlockTileEntity(this.xCoord, this.yCoord, this.zCoord) != this ? false : par1EntityPlayer.getDistanceSq((double)this.xCoord + 0.5D, (double)this.yCoord + 0.5D, (double)this.zCoord + 0.5D) <= 64.0D; - } - -+ /** -+ * Causes the TileEntity to reset all it's cached values for it's container block, blockID, metaData and in the case of -+ * chests, the adjcacent chest check -+ */ - public void updateContainingBlockInfo() { - super.updateContainingBlockInfo(); - this.adjacentChestChecked = false; - } - -- private void func_90009_a(TileEntityChest var1, int var2) { -- if(var1.isInvalid()) { -+ private void func_90009_a(TileEntityChest par1TileEntityChest, int par2) { -+ if (par1TileEntityChest.isInvalid()) { - this.adjacentChestChecked = false; -- } else if(this.adjacentChestChecked) { -- switch(var2) { -- case 0: -- if(this.adjacentChestZPosition != var1) { -- this.adjacentChestChecked = false; -- } -- break; -- case 1: -- if(this.adjacentChestXNeg != var1) { -- this.adjacentChestChecked = false; -- } -- break; -- case 2: -- if(this.adjacentChestZNeg != var1) { -- this.adjacentChestChecked = false; -- } -- break; -- case 3: -- if(this.adjacentChestXPos != var1) { -- this.adjacentChestChecked = false; -- } -+ } else if (this.adjacentChestChecked) { -+ switch (par2) { -+ case 0: -+ if (this.adjacentChestZPosition != par1TileEntityChest) { -+ this.adjacentChestChecked = false; -+ } -+ -+ break; -+ -+ case 1: -+ if (this.adjacentChestXNeg != par1TileEntityChest) { -+ this.adjacentChestChecked = false; -+ } -+ -+ break; -+ -+ case 2: -+ if (this.adjacentChestZNeg != par1TileEntityChest) { -+ this.adjacentChestChecked = false; -+ } -+ -+ break; -+ -+ case 3: -+ if (this.adjacentChestXPos != par1TileEntityChest) { -+ this.adjacentChestChecked = false; -+ } - } - } -- - } - -+ /** -+ * Performs the check for adjacent chests to determine if this chest is double or not. -+ */ - public void checkForAdjacentChests() { -- if(!this.adjacentChestChecked) { -+ if (!this.adjacentChestChecked) { - this.adjacentChestChecked = true; - this.adjacentChestZNeg = null; - this.adjacentChestXPos = null; - this.adjacentChestXNeg = null; - this.adjacentChestZPosition = null; -- if(this.func_94044_a(this.xCoord - 1, this.yCoord, this.zCoord)) { -+ -+ if (this.func_94044_a(this.xCoord - 1, this.yCoord, this.zCoord)) { - this.adjacentChestXNeg = (TileEntityChest)this.worldObj.getBlockTileEntity(this.xCoord - 1, this.yCoord, this.zCoord); - } - -- if(this.func_94044_a(this.xCoord + 1, this.yCoord, this.zCoord)) { -+ if (this.func_94044_a(this.xCoord + 1, this.yCoord, this.zCoord)) { - this.adjacentChestXPos = (TileEntityChest)this.worldObj.getBlockTileEntity(this.xCoord + 1, this.yCoord, this.zCoord); - } - -- if(this.func_94044_a(this.xCoord, this.yCoord, this.zCoord - 1)) { -+ if (this.func_94044_a(this.xCoord, this.yCoord, this.zCoord - 1)) { - this.adjacentChestZNeg = (TileEntityChest)this.worldObj.getBlockTileEntity(this.xCoord, this.yCoord, this.zCoord - 1); - } - -- if(this.func_94044_a(this.xCoord, this.yCoord, this.zCoord + 1)) { -+ if (this.func_94044_a(this.xCoord, this.yCoord, this.zCoord + 1)) { - this.adjacentChestZPosition = (TileEntityChest)this.worldObj.getBlockTileEntity(this.xCoord, this.yCoord, this.zCoord + 1); - } - -- if(this.adjacentChestZNeg != null) { -+ if (this.adjacentChestZNeg != null) { - this.adjacentChestZNeg.func_90009_a(this, 0); - } - -- if(this.adjacentChestZPosition != null) { -+ if (this.adjacentChestZPosition != null) { - this.adjacentChestZPosition.func_90009_a(this, 2); - } - -- if(this.adjacentChestXPos != null) { -+ if (this.adjacentChestXPos != null) { - this.adjacentChestXPos.func_90009_a(this, 1); - } - -- if(this.adjacentChestXNeg != null) { -+ if (this.adjacentChestXNeg != null) { - this.adjacentChestXNeg.func_90009_a(this, 3); - } -- - } - } - -- private boolean func_94044_a(int var1, int var2, int var3) { -- Block var4 = Block.blocksList[this.worldObj.getBlockId(var1, var2, var3)]; -+ private boolean func_94044_a(int par1, int par2, int par3) { -+ Block var4 = Block.blocksList[this.worldObj.getBlockId(par1, par2, par3)]; - return var4 != null && var4 instanceof BlockChest ? ((BlockChest)var4).chestType == this.getChestType() : false; - } - -+ /** -+ * Allows the entity to update its state. Overridden in most subclasses, e.g. the mob spawner uses this to count ticks -+ * and creates a new spawn inside its implementation. -+ */ - public void updateEntity() { - super.updateEntity(); - this.checkForAdjacentChests(); - ++this.ticksSinceSync; - float var1; -- if(!this.worldObj.isRemote && this.numUsingPlayers != 0 && (this.ticksSinceSync + this.xCoord + this.yCoord + this.zCoord) % 200 == 0) { -+ -+ if (!this.worldObj.isRemote && this.numUsingPlayers != 0 && (this.ticksSinceSync + this.xCoord + this.yCoord + this.zCoord) % 200 == 0) { - this.numUsingPlayers = 0; - var1 = 5.0F; - List var2 = this.worldObj.getEntitiesWithinAABB(EntityPlayer.class, AxisAlignedBB.getAABBPool().getAABB((double)((float)this.xCoord - var1), (double)((float)this.yCoord - var1), (double)((float)this.zCoord - var1), (double)((float)(this.xCoord + 1) + var1), (double)((float)(this.yCoord + 1) + var1), (double)((float)(this.zCoord + 1) + var1))); - Iterator var3 = var2.iterator(); - -- label93: -- while(true) { -- IInventory var5; -- do { -- EntityPlayer var4; -- do { -- if(!var3.hasNext()) { -- break label93; -- } -- -- var4 = (EntityPlayer)var3.next(); -- } while(!(var4.openContainer instanceof ContainerChest)); -- -- var5 = ((ContainerChest)var4.openContainer).getLowerChestInventory(); -- } while(var5 != this && (!(var5 instanceof InventoryLargeChest) || !((InventoryLargeChest)var5).isPartOfLargeChest(this))); -- -- ++this.numUsingPlayers; -+ while (var3.hasNext()) { -+ EntityPlayer var4 = (EntityPlayer)var3.next(); -+ -+ if (var4.openContainer instanceof ContainerChest) { -+ IInventory var5 = ((ContainerChest)var4.openContainer).getLowerChestInventory(); -+ -+ if (var5 == this || var5 instanceof InventoryLargeChest && ((InventoryLargeChest)var5).isPartOfLargeChest(this)) { -+ ++this.numUsingPlayers; -+ } -+ } - } - } - - this.prevLidAngle = this.lidAngle; - var1 = 0.1F; - double var11; -- if(this.numUsingPlayers > 0 && this.lidAngle == 0.0F && this.adjacentChestZNeg == null && this.adjacentChestXNeg == null) { -+ -+ if (this.numUsingPlayers > 0 && this.lidAngle == 0.0F && this.adjacentChestZNeg == null && this.adjacentChestXNeg == null) { - double var8 = (double)this.xCoord + 0.5D; - var11 = (double)this.zCoord + 0.5D; -- if(this.adjacentChestZPosition != null) { -+ -+ if (this.adjacentChestZPosition != null) { - var11 += 0.5D; - } - -- if(this.adjacentChestXPos != null) { -+ if (this.adjacentChestXPos != null) { - var8 += 0.5D; - } -+ -+ // Spout Start -+ short customId = 0; -+ if (SpoutClient.getInstance().getRawWorld() != null && this.hasWorldObj()) { -+ SpoutcraftChunk sChunk = Spoutcraft.getChunkAt(this.worldObj, this.xCoord, this.yCoord, this.zCoord); -+ customId = sChunk.getCustomBlockId(this.xCoord, this.yCoord, this.zCoord); -+ short[] customBlockIds = sChunk.getCustomBlockIds(); -+ byte[] customBlockData = sChunk.getCustomBlockData(); - -- this.worldObj.playSoundEffect(var8, (double)this.yCoord + 0.5D, var11, "random.chestopen", 0.5F, this.worldObj.s.nextFloat() * 0.1F + 0.9F); -+ if (customId > 0) { -+ // Custom Chest Code to be here. -+ } else { -+ this.worldObj.playSoundEffect(var8, (double)this.yCoord + 0.5D, var11, "random.chestopen", 0.5F, this.worldObj.rand.nextFloat() * 0.1F + 0.9F); -+ } -+ } -+ // Spout End - } - -- if(this.numUsingPlayers == 0 && this.lidAngle > 0.0F || this.numUsingPlayers > 0 && this.lidAngle < 1.0F) { -+ if (this.numUsingPlayers == 0 && this.lidAngle > 0.0F || this.numUsingPlayers > 0 && this.lidAngle < 1.0F) { - float var9 = this.lidAngle; -- if(this.numUsingPlayers > 0) { -+ -+ if (this.numUsingPlayers > 0) { - this.lidAngle += var1; - } else { - this.lidAngle -= var1; - } - -- if(this.lidAngle > 1.0F) { -+ if (this.lidAngle > 1.0F) { - this.lidAngle = 1.0F; - } - - float var10 = 0.5F; -- if(this.lidAngle < var10 && var9 >= var10 && this.adjacentChestZNeg == null && this.adjacentChestXNeg == null) { -+ -+ if (this.lidAngle < var10 && var9 >= var10 && this.adjacentChestZNeg == null && this.adjacentChestXNeg == null) { - var11 = (double)this.xCoord + 0.5D; - double var6 = (double)this.zCoord + 0.5D; -- if(this.adjacentChestZPosition != null) { -+ -+ if (this.adjacentChestZPosition != null) { - var6 += 0.5D; - } - -- if(this.adjacentChestXPos != null) { -+ if (this.adjacentChestXPos != null) { - var11 += 0.5D; - } -+ -+ // Spout Start -+ short customId = 0; -+ if (SpoutClient.getInstance().getRawWorld() != null && this.hasWorldObj()) { -+ SpoutcraftChunk sChunk = Spoutcraft.getChunkAt(this.worldObj, this.xCoord, this.yCoord, this.zCoord); -+ customId = sChunk.getCustomBlockId(this.xCoord, this.yCoord, this.zCoord); -+ short[] customBlockIds = sChunk.getCustomBlockIds(); -+ byte[] customBlockData = sChunk.getCustomBlockData(); - -- this.worldObj.playSoundEffect(var11, (double)this.yCoord + 0.5D, var6, "random.chestclosed", 0.5F, this.worldObj.s.nextFloat() * 0.1F + 0.9F); -+ if (customId > 0) { -+ // Custom Chest Sound to be here. -+ } else { -+ this.worldObj.playSoundEffect(var11, (double)this.yCoord + 0.5D, var6, "random.chestclosed", 0.5F, this.worldObj.rand.nextFloat() * 0.1F + 0.9F); -+ } -+ } -+ // Spout End - } - -- if(this.lidAngle < 0.0F) { -+ if (this.lidAngle < 0.0F) { - this.lidAngle = 0.0F; - } - } -- - } - -- public boolean receiveClientEvent(int var1, int var2) { -- if(var1 == 1) { -- this.numUsingPlayers = var2; -+ /** -+ * Called when a client event is received with the event number and argument, see World.sendClientEvent -+ */ -+ public boolean receiveClientEvent(int par1, int par2) { -+ if (par1 == 1) { -+ this.numUsingPlayers = par2; - return true; - } else { -- return super.receiveClientEvent(var1, var2); -+ return super.receiveClientEvent(par1, par2); - } - } - - public void openChest() { -- if(this.numUsingPlayers < 0) { -+ if (this.numUsingPlayers < 0) { - this.numUsingPlayers = 0; - } - -@@ -316,7 +429,7 @@ - } - - public void closeChest() { -- if(this.getBlockType() != null && this.getBlockType() instanceof BlockChest) { -+ if (this.getBlockType() != null && this.getBlockType() instanceof BlockChest) { - --this.numUsingPlayers; - this.worldObj.addBlockEvent(this.xCoord, this.yCoord, this.zCoord, this.getBlockType().blockID, 1, this.numUsingPlayers); - this.worldObj.notifyBlocksOfNeighborChange(this.xCoord, this.yCoord, this.zCoord, this.getBlockType().blockID); -@@ -324,10 +437,16 @@ - } - } - -- public boolean isItemValidForSlot(int var1, ItemStack var2) { -+ /** -+ * Returns true if automation is allowed to insert the given stack (ignoring stack size) into the given slot. -+ */ -+ public boolean isItemValidForSlot(int par1, ItemStack par2ItemStack) { - return true; - } - -+ /** -+ * invalidates a tile entity -+ */ - public void invalidate() { - super.invalidate(); - this.updateContainingBlockInfo(); -@@ -335,8 +454,8 @@ - } - - public int getChestType() { -- if(this.cachedChestType == -1) { -- if(this.worldObj == null || !(this.getBlockType() instanceof BlockChest)) { -+ if (this.cachedChestType == -1) { -+ if (this.worldObj == null || !(this.getBlockType() instanceof BlockChest)) { - return 0; - } - ---- net/minecraft/src/BlockGrass.java -+++ net/minecraft/src/BlockGrass.java -@@ -7,32 +7,42 @@ - private Icon iconSnowSide; - private Icon iconGrassSideOverlay; - -- protected BlockGrass(int var1) { -- super(var1, Material.grass); -+ protected BlockGrass(int par1) { -+ super(par1, Material.grass); - this.setTickRandomly(true); - this.setCreativeTab(CreativeTabs.tabBlock); - } - -- public Icon getIcon(int var1, int var2) { -- return var1 == 1 ? this.iconGrassTop : (var1 == 0 ? Block.dirt.getBlockTextureFromSide(var1) : this.blockIcon); -+ /** -+ * From the specified side and block metadata retrieves the blocks texture. Args: side, metadata -+ */ -+ public Icon getIcon(int par1, int par2) { -+ return par1 == 1 ? this.iconGrassTop : (par1 == 0 ? Block.dirt.getBlockTextureFromSide(par1) : this.blockIcon); - } - -- public Icon getBlockTexture(IBlockAccess var1, int var2, int var3, int var4, int var5) { -- if(var5 == 1) { -+ /** -+ * Retrieves the block texture to use based on the display side. Args: iBlockAccess, x, y, z, side -+ */ -+ public Icon getBlockTexture(IBlockAccess par1IBlockAccess, int par2, int par3, int par4, int par5) { -+ if (par5 == 1) { - return this.iconGrassTop; -- } else if(var5 == 0) { -- return Block.dirt.getBlockTextureFromSide(var5); -+ } else if (par5 == 0) { -+ return Block.dirt.getBlockTextureFromSide(par5); - } else { -- Material var6 = var1.getBlockMaterial(var2, var3 + 1, var4); -+ Material var6 = par1IBlockAccess.getBlockMaterial(par2, par3 + 1, par4); - return var6 != Material.snow && var6 != Material.craftedSnow ? this.blockIcon : this.iconSnowSide; - } - } - -- public void registerIcons(IconRegister var1) { -- this.blockIcon = var1.registerIcon(this.getTextureName() + "_side"); -- this.iconGrassTop = var1.registerIcon(this.getTextureName() + "_top"); -- this.iconSnowSide = var1.registerIcon(this.getTextureName() + "_side_snowed"); -- this.iconGrassSideOverlay = var1.registerIcon(this.getTextureName() + "_side_overlay"); -+ /** -+ * When this method is called, your block should register all the icons it needs with the given IconRegister. This is -+ * the only chance you get to register icons. -+ */ -+ public void registerIcons(IconRegister par1IconRegister) { -+ this.blockIcon = par1IconRegister.registerIcon(this.getTextureName() + "_side"); -+ this.iconGrassTop = par1IconRegister.registerIcon(this.getTextureName() + "_top"); -+ this.iconSnowSide = par1IconRegister.registerIcon(this.getTextureName() + "_side_snowed"); -+ this.iconGrassSideOverlay = par1IconRegister.registerIcon(this.getTextureName() + "_side_overlay"); - } - - public int getBlockColor() { -@@ -41,20 +51,27 @@ - return ColorizerGrass.getGrassColor(var1, var3); - } - -- public int getRenderColor(int var1) { -+ /** -+ * Returns the color this block should be rendered. Used by leaves. -+ */ -+ public int getRenderColor(int par1) { - return this.getBlockColor(); - } - -- public int colorMultiplier(IBlockAccess var1, int var2, int var3, int var4) { -+ /** -+ * Returns a integer with hex for 0xrrggbb with this color multiplied against the blocks color. Note only called when -+ * first determining what to render. -+ */ -+ public int colorMultiplier(IBlockAccess par1IBlockAccess, int par2, int par3, int par4) { - int var5 = 0; - int var6 = 0; - int var7 = 0; - -- for(int var8 = -1; var8 <= 1; ++var8) { -- for(int var9 = -1; var9 <= 1; ++var9) { -- int var10 = var1.getBiomeGenForCoords(var2 + var9, var4 + var8).getBiomeGrassColor(); -+ for (int var8 = -1; var8 <= 1; ++var8) { -+ for (int var9 = -1; var9 <= 1; ++var9) { -+ int var10 = par1IBlockAccess.getBiomeGenForCoords(par2 + var9, par4 + var8).getBiomeGrassColor(); - var5 += (var10 & 16711680) >> 16; -- var6 += (var10 & '\uff00') >> 8; -+ var6 += (var10 & 65280) >> 8; - var7 += var10 & 255; - } - } -@@ -62,27 +79,33 @@ - return (var5 / 9 & 255) << 16 | (var6 / 9 & 255) << 8 | var7 / 9 & 255; - } - -- public void updateTick(World var1, int var2, int var3, int var4, Random var5) { -- if(!var1.isRemote) { -- if(var1.getBlockLightValue(var2, var3 + 1, var4) < 4 && Block.lightOpacity[var1.getBlockId(var2, var3 + 1, var4)] > 2) { -- var1.setBlock(var2, var3, var4, Block.dirt.blockID); -- } else if(var1.getBlockLightValue(var2, var3 + 1, var4) >= 9) { -- for(int var6 = 0; var6 < 4; ++var6) { -- int var7 = var2 + var5.nextInt(3) - 1; -- int var8 = var3 + var5.nextInt(5) - 3; -- int var9 = var4 + var5.nextInt(3) - 1; -- int var10 = var1.getBlockId(var7, var8 + 1, var9); -- if(var1.getBlockId(var7, var8, var9) == Block.dirt.blockID && var1.getBlockLightValue(var7, var8 + 1, var9) >= 4 && Block.lightOpacity[var10] <= 2) { -- var1.setBlock(var7, var8, var9, Block.grass.blockID); -+ /** -+ * Ticks the block if it's been scheduled -+ */ -+ public void updateTick(World par1World, int par2, int par3, int par4, Random par5Random) { -+ if (!par1World.isRemote) { -+ if (par1World.getBlockLightValue(par2, par3 + 1, par4) < 4 && Block.lightOpacity[par1World.getBlockId(par2, par3 + 1, par4)] > 2) { -+ par1World.setBlock(par2, par3, par4, Block.dirt.blockID); -+ } else if (par1World.getBlockLightValue(par2, par3 + 1, par4) >= 9) { -+ for (int var6 = 0; var6 < 4; ++var6) { -+ int var7 = par2 + par5Random.nextInt(3) - 1; -+ int var8 = par3 + par5Random.nextInt(5) - 3; -+ int var9 = par4 + par5Random.nextInt(3) - 1; -+ int var10 = par1World.getBlockId(var7, var8 + 1, var9); -+ -+ if (par1World.getBlockId(var7, var8, var9) == Block.dirt.blockID && par1World.getBlockLightValue(var7, var8 + 1, var9) >= 4 && Block.lightOpacity[var10] <= 2) { -+ par1World.setBlock(var7, var8, var9, Block.grass.blockID); - } - } - } -- - } - } - -- public int idDropped(int var1, Random var2, int var3) { -- return Block.dirt.idDropped(0, var2, var3); -+ /** -+ * Returns the ID of the items to drop on destruction. -+ */ -+ public int idDropped(int par1, Random par2Random, int par3) { -+ return Block.dirt.idDropped(0, par2Random, par3); - } - - public static Icon getIconSideOverlay() { ---- net/minecraft/src/TileEntityChestRenderer.java -+++ net/minecraft/src/TileEntityChestRenderer.java -@@ -1,9 +1,18 @@ - package net.minecraft.src; - - import java.util.Calendar; -+ -+import net.minecraft.src.TileEntityChest; -+ - import org.lwjgl.opengl.GL11; - import org.lwjgl.opengl.GL12; - -+// Spout Start -+import org.spoutcraft.api.Spoutcraft; -+import org.spoutcraft.client.SpoutClient; -+import org.spoutcraft.client.block.SpoutcraftChunk; -+// Spout End -+ - public class TileEntityChestRenderer extends TileEntitySpecialRenderer { - private static final ResourceLocation RES_TRAPPED_DOUBLE = new ResourceLocation("textures/entity/chest/trapped_double.png"); - private static final ResourceLocation RES_CHRISTMAS_DOUBLE = new ResourceLocation("textures/entity/chest/christmas_double.png"); -@@ -11,49 +20,76 @@ - private static final ResourceLocation RES_TRAPPED_SINGLE = new ResourceLocation("textures/entity/chest/trapped.png"); - private static final ResourceLocation RES_CHRISTMAS_SINGLE = new ResourceLocation("textures/entity/chest/christmas.png"); - private static final ResourceLocation RES_NORMAL_SINGLE = new ResourceLocation("textures/entity/chest/normal.png"); -+ -+ /** The normal small chest model. */ - private ModelChest chestModel = new ModelChest(); -+ -+ /** The large double chest model. */ - private ModelChest largeChestModel = new ModelLargeChest(); -+ -+ /** If true, chests will be rendered with the Christmas present textures. */ - private boolean isChristmas; - - public TileEntityChestRenderer() { - Calendar var1 = Calendar.getInstance(); -- if(var1.get(2) + 1 == 12 && var1.get(5) >= 24 && var1.get(5) <= 26) { -+ -+ if (var1.get(2) + 1 == 12 && var1.get(5) >= 24 && var1.get(5) <= 26) { - this.isChristmas = true; - } -- - } - -- public void renderTileEntityChestAt(TileEntityChest var1, double var2, double var4, double var6, float var8) { -+ /** -+ * Renders the TileEntity for the chest at a position. -+ */ -+ public void renderTileEntityChestAt(TileEntityChest par1TileEntityChest, double par2, double par4, double par6, float par8) { - int var9; -- if(!var1.hasWorldObj()) { -+ // Spout Start -+ short customId = 0; -+ if (SpoutClient.getInstance().getRawWorld() != null && par1TileEntityChest.hasWorldObj()) { -+ SpoutcraftChunk sChunk = Spoutcraft.getChunkAt(par1TileEntityChest.worldObj, par1TileEntityChest.xCoord, par1TileEntityChest.yCoord, par1TileEntityChest.zCoord); -+ customId = sChunk.getCustomBlockId(par1TileEntityChest.xCoord, par1TileEntityChest.yCoord, par1TileEntityChest.zCoord); -+ short[] customBlockIds = sChunk.getCustomBlockIds(); -+ byte[] customBlockData = sChunk.getCustomBlockData(); -+ -+ if (customId > 0) { -+ return; // Don't render the chest image or animation if its a custom chest. -+ } -+ } -+ // Spout End -+ -+ if (!par1TileEntityChest.hasWorldObj()) { - var9 = 0; - } else { -- Block var10 = var1.getBlockType(); -- var9 = var1.getBlockMetadata(); -- if(var10 instanceof BlockChest && var9 == 0) { -- ((BlockChest)var10).unifyAdjacentChests(var1.getWorldObj(), var1.xCoord, var1.yCoord, var1.zCoord); -- var9 = var1.getBlockMetadata(); -+ Block var10 = par1TileEntityChest.getBlockType(); -+ var9 = par1TileEntityChest.getBlockMetadata(); -+ -+ if (var10 instanceof BlockChest && var9 == 0) { -+ ((BlockChest)var10).unifyAdjacentChests(par1TileEntityChest.getWorldObj(), par1TileEntityChest.xCoord, par1TileEntityChest.yCoord, par1TileEntityChest.zCoord); -+ var9 = par1TileEntityChest.getBlockMetadata(); - } - -- var1.checkForAdjacentChests(); -+ par1TileEntityChest.checkForAdjacentChests(); - } - -- if(var1.adjacentChestZNeg == null && var1.adjacentChestXNeg == null) { -+ if (par1TileEntityChest.adjacentChestZNeg == null && par1TileEntityChest.adjacentChestXNeg == null) { - ModelChest var14; -- if(var1.adjacentChestXPos == null && var1.adjacentChestZPosition == null) { -+ -+ if (par1TileEntityChest.adjacentChestXPos == null && par1TileEntityChest.adjacentChestZPosition == null) { - var14 = this.chestModel; -- if(var1.getChestType() == 1) { -+ -+ if (par1TileEntityChest.getChestType() == 1) { - this.bindTexture(RES_TRAPPED_SINGLE); -- } else if(this.isChristmas) { -+ } else if (this.isChristmas) { - this.bindTexture(RES_CHRISTMAS_SINGLE); - } else { - this.bindTexture(RES_NORMAL_SINGLE); - } - } else { - var14 = this.largeChestModel; -- if(var1.getChestType() == 1) { -+ -+ if (par1TileEntityChest.getChestType() == 1) { - this.bindTexture(RES_TRAPPED_DOUBLE); -- } else if(this.isChristmas) { -+ } else if (this.isChristmas) { - this.bindTexture(RES_CHRISTMAS_DOUBLE); - } else { - this.bindTexture(RES_NORMAL_DOUBLE); -@@ -63,48 +99,52 @@ - GL11.glPushMatrix(); - GL11.glEnable(GL12.GL_RESCALE_NORMAL); - GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); -- GL11.glTranslatef((float)var2, (float)var4 + 1.0F, (float)var6 + 1.0F); -+ GL11.glTranslatef((float)par2, (float)par4 + 1.0F, (float)par6 + 1.0F); - GL11.glScalef(1.0F, -1.0F, -1.0F); - GL11.glTranslatef(0.5F, 0.5F, 0.5F); - short var11 = 0; -- if(var9 == 2) { -+ -+ if (var9 == 2) { - var11 = 180; - } - -- if(var9 == 3) { -+ if (var9 == 3) { - var11 = 0; - } - -- if(var9 == 4) { -+ if (var9 == 4) { - var11 = 90; - } - -- if(var9 == 5) { -+ if (var9 == 5) { - var11 = -90; - } - -- if(var9 == 2 && var1.adjacentChestXPos != null) { -+ if (var9 == 2 && par1TileEntityChest.adjacentChestXPos != null) { - GL11.glTranslatef(1.0F, 0.0F, 0.0F); - } - -- if(var9 == 5 && var1.adjacentChestZPosition != null) { -+ if (var9 == 5 && par1TileEntityChest.adjacentChestZPosition != null) { - GL11.glTranslatef(0.0F, 0.0F, -1.0F); - } - - GL11.glRotatef((float)var11, 0.0F, 1.0F, 0.0F); - GL11.glTranslatef(-0.5F, -0.5F, -0.5F); -- float var12 = var1.prevLidAngle + (var1.lidAngle - var1.prevLidAngle) * var8; -+ float var12 = par1TileEntityChest.prevLidAngle + (par1TileEntityChest.lidAngle - par1TileEntityChest.prevLidAngle) * par8; - float var13; -- if(var1.adjacentChestZNeg != null) { -- var13 = var1.adjacentChestZNeg.prevLidAngle + (var1.adjacentChestZNeg.lidAngle - var1.adjacentChestZNeg.prevLidAngle) * var8; -- if(var13 > var12) { -+ -+ if (par1TileEntityChest.adjacentChestZNeg != null) { -+ var13 = par1TileEntityChest.adjacentChestZNeg.prevLidAngle + (par1TileEntityChest.adjacentChestZNeg.lidAngle - par1TileEntityChest.adjacentChestZNeg.prevLidAngle) * par8; -+ -+ if (var13 > var12) { - var12 = var13; - } - } - -- if(var1.adjacentChestXNeg != null) { -- var13 = var1.adjacentChestXNeg.prevLidAngle + (var1.adjacentChestXNeg.lidAngle - var1.adjacentChestXNeg.prevLidAngle) * var8; -- if(var13 > var12) { -+ if (par1TileEntityChest.adjacentChestXNeg != null) { -+ var13 = par1TileEntityChest.adjacentChestXNeg.prevLidAngle + (par1TileEntityChest.adjacentChestXNeg.lidAngle - par1TileEntityChest.adjacentChestXNeg.prevLidAngle) * par8; -+ -+ if (var13 > var12) { - var12 = var13; - } - } -@@ -119,7 +159,7 @@ - } - } - -- public void renderTileEntityAt(TileEntity var1, double var2, double var4, double var6, float var8) { -- this.renderTileEntityChestAt((TileEntityChest)var1, var2, var4, var6, var8); -+ public void renderTileEntityAt(TileEntity par1TileEntity, double par2, double par4, double par6, float par8) { -+ this.renderTileEntityChestAt((TileEntityChest)par1TileEntity, par2, par4, par6, par8); - } - } ---- net/minecraft/src/ICommandSender.java -+++ net/minecraft/src/ICommandSender.java -@@ -1,13 +1,23 @@ - package net.minecraft.src; - - public interface ICommandSender { -+ -+ /** -+ * Gets the name of this command sender (usually username, but possibly "Rcon") -+ */ - String getCommandSenderName(); - - void sendChatToPlayer(ChatMessageComponent var1); - -+ /** -+ * Returns true if the command sender is allowed to use the given command. -+ */ - boolean canCommandSenderUseCommand(int var1, String var2); - -- ChunkCoordinates getCommandSenderPosition(); -+ /** -+ * Return the position for this command sender. -+ */ -+ ChunkCoordinates getPlayerCoordinates(); - - World getEntityWorld(); - } ---- net/minecraft/src/Packet29DestroyEntity.java -+++ net/minecraft/src/Packet29DestroyEntity.java -@@ -5,37 +5,48 @@ - import java.io.IOException; - - public class Packet29DestroyEntity extends Packet { -+ -+ /** ID of the entity to be destroyed on the client. */ - public int[] entityId; - -- public Packet29DestroyEntity() { -- } -- -- public Packet29DestroyEntity(int... var1) { -- this.entityId = var1; -- } -- -- public void readPacketData(DataInput var1) throws IOException { -- this.entityId = new int[var1.readByte()]; -- -- for(int var2 = 0; var2 < this.entityId.length; ++var2) { -- this.entityId[var2] = var1.readInt(); -- } -- -- } -- -- public void writePacketData(DataOutput var1) throws IOException { -- var1.writeByte(this.entityId.length); -- -- for(int var2 = 0; var2 < this.entityId.length; ++var2) { -- var1.writeInt(this.entityId[var2]); -- } -- -- } -- -- public void processPacket(NetHandler var1) { -- var1.handleDestroyEntity(this); -- } -- -+ public Packet29DestroyEntity() {} -+ -+ public Packet29DestroyEntity(int ... par1ArrayOfInteger) { -+ this.entityId = par1ArrayOfInteger; -+ } -+ -+ /** -+ * Abstract. Reads the raw packet data from the data stream. -+ */ -+ public void readPacketData(DataInput par1DataInput) throws IOException { -+ this.entityId = new int[par1DataInput.readByte()]; -+ -+ for (int var2 = 0; var2 < this.entityId.length; ++var2) { -+ this.entityId[var2] = par1DataInput.readInt(); -+ } -+ } -+ -+ /** -+ * Abstract. Writes the raw packet data to the data stream. -+ */ -+ public void writePacketData(DataOutput par1DataOutput) throws IOException { -+ par1DataOutput.writeByte(this.entityId.length); -+ -+ for (int var2 = 0; var2 < this.entityId.length; ++var2) { -+ par1DataOutput.writeInt(this.entityId[var2]); -+ } -+ } -+ -+ /** -+ * Passes this Packet on to the NetHandler for processing. -+ */ -+ public void processPacket(NetHandler par1NetHandler) { -+ par1NetHandler.handleDestroyEntity(this); -+ } -+ -+ /** -+ * Abstract. Return the size of the packet (not counting the header). -+ */ - public int getPacketSize() { - return 1 + this.entityId.length * 4; - } ---- net/minecraft/src/SoundPool.java -+++ net/minecraft/src/SoundPool.java -@@ -1,42 +1,55 @@ - package net.minecraft.src; - --import com.google.common.collect.Lists; --import com.google.common.collect.Maps; - import java.net.MalformedURLException; - import java.net.URL; -+import java.io.File; - import java.util.ArrayList; - import java.util.List; - import java.util.Map; - import java.util.Random; - -+import com.google.common.collect.Lists; -+import com.google.common.collect.Maps; -+ - public class SoundPool { -- private final Random a = new Random(); -- private final Map b = Maps.newHashMap(); -+ -+ /** The RNG used by SoundPool. */ -+ private final Random rand = new Random(); -+ -+ /** -+ * Maps a name (can be sound/newsound/streaming/music/newmusic) to a list of SoundPoolEntry's. -+ */ -+ private final Map nameToSoundPoolEntriesMapping = Maps.newHashMap(); - private final ResourceManager soundResourceManager; -- private final String d; -+ private final String soundType; - private final boolean isGetRandomSound; - -- public SoundPool(ResourceManager var1, String var2, boolean var3) { -- this.soundResourceManager = var1; -- this.d = var2; -- this.isGetRandomSound = var3; -+ public SoundPool(ResourceManager par1ResourceManager, String par2Str, boolean par3) { -+ this.soundResourceManager = par1ResourceManager; -+ this.soundType = par2Str; -+ this.isGetRandomSound = par3; - } - -- public void addSound(String var1) { -+ /** -+ * Adds a sound to this sound pool. -+ */ -+ public void addSound(String par1Str) { - try { -- String var2 = var1; -- var1 = var1.substring(0, var1.indexOf(".")); -- if(this.isGetRandomSound) { -- while(Character.isDigit(var1.charAt(var1.length() - 1))) { -- var1 = var1.substring(0, var1.length() - 1); -+ String var2 = par1Str; -+ par1Str = par1Str.substring(0, par1Str.indexOf(".")); -+ -+ if (this.isGetRandomSound) { -+ while (Character.isDigit(par1Str.charAt(par1Str.length() - 1))) { -+ par1Str = par1Str.substring(0, par1Str.length() - 1); - } - } - -- var1 = var1.replaceAll("/", "."); -- Object var3 = (List)this.b.get(var1); -- if(var3 == null) { -+ par1Str = par1Str.replaceAll("/", "."); -+ Object var3 = (List)this.nameToSoundPoolEntriesMapping.get(par1Str); -+ -+ if (var3 == null) { - var3 = Lists.newArrayList(); -- this.b.put(var1, var3); -+ this.nameToSoundPoolEntriesMapping.put(par1Str, var3); - } - - ((List)var3).add(new SoundPoolEntry(var2, this.func_110654_c(var2))); -@@ -46,28 +59,58 @@ - } - } - -- private URL func_110654_c(String var1) throws MalformedURLException { -- ResourceLocation var2 = new ResourceLocation(var1); -- String var3 = String.format("%s:%s:%s/%s", new Object[]{"mcsounddomain", var2.getResourceDomain(), this.d, var2.getResourcePath()}); -+ private URL func_110654_c(String par1Str) throws MalformedURLException { -+ ResourceLocation var2 = new ResourceLocation(par1Str); -+ String var3 = String.format("%s:%s:%s/%s", new Object[] {"mcsounddomain", var2.getResourceDomain(), this.soundType, var2.getResourcePath()}); - SoundPoolProtocolHandler var4 = new SoundPoolProtocolHandler(this); - return new URL((URL)null, var3, var4); - } - -- public SoundPoolEntry getRandomSoundFromSoundPool(String var1) { -- List var2 = (List)this.b.get(var1); -- return var2 == null ? null : (SoundPoolEntry)var2.get(this.a.nextInt(var2.size())); -+ /** -+ * gets a random sound from the specified (by name, can be sound/newsound/streaming/music/newmusic) sound pool. -+ */ -+ public SoundPoolEntry getRandomSoundFromSoundPool(String par1Str) { -+ List var2 = (List)this.nameToSoundPoolEntriesMapping.get(par1Str); -+ return var2 == null ? null : (SoundPoolEntry)var2.get(this.rand.nextInt(var2.size())); - } - -+ /** -+ * Gets a random SoundPoolEntry. -+ */ - public SoundPoolEntry getRandomSound() { -- if(this.b.isEmpty()) { -+ if (this.nameToSoundPoolEntriesMapping.isEmpty()) { - return null; - } else { -- ArrayList var1 = Lists.newArrayList((Iterable)this.b.keySet()); -- return this.getRandomSoundFromSoundPool((String)var1.get(this.a.nextInt(var1.size()))); -- } -- } -- -- static ResourceManager func_110655_a(SoundPool var0) { -- return var0.soundResourceManager; -- } -+ ArrayList var1 = Lists.newArrayList(this.nameToSoundPoolEntriesMapping.keySet()); -+ return this.getRandomSoundFromSoundPool((String)var1.get(this.rand.nextInt(var1.size()))); -+ } -+ } -+ -+ static ResourceManager func_110655_a(SoundPool par0SoundPool) { -+ return par0SoundPool.soundResourceManager; -+ } -+ -+ // Spout Start -+ public SoundPoolEntry getSoundFromSoundPool(String s, int id) { -+ List list = (List)nameToSoundPoolEntriesMapping.get(s); -+ if (list == null) { -+ return null; -+ } -+ return (SoundPoolEntry)list.get(id); -+ } -+ -+ public SoundPoolEntry addCustomSound(String sound, File file) { -+ try { -+ if(!nameToSoundPoolEntriesMapping.containsKey(sound)) { -+ nameToSoundPoolEntriesMapping.put(sound, new ArrayList()); -+ } -+ SoundPoolEntry soundpoolentry = new SoundPoolEntry(sound, file.toURI().toURL()); -+ ((List)nameToSoundPoolEntriesMapping.get(sound)).add(soundpoolentry); -+ return soundpoolentry; -+ } -+ catch(MalformedURLException malformedurlexception) { -+ return null; -+ } -+ } -+ // Spout End - } ---- net/minecraft/src/RenderFallingSand.java -+++ net/minecraft/src/RenderFallingSand.java -@@ -9,51 +9,64 @@ - this.shadowSize = 0.5F; - } - -- public void doRenderFallingSand(EntityFallingSand var1, double var2, double var4, double var6, float var8, float var9) { -- World var10 = var1.getWorld(); -- Block var11 = Block.blocksList[var1.blockID]; -- if(var10.getBlockId(MathHelper.floor_double(var1.posX), MathHelper.floor_double(var1.posY), MathHelper.floor_double(var1.posZ)) != var1.blockID) { -+ /** -+ * The actual render method that is used in doRender -+ */ -+ public void doRenderFallingSand(EntityFallingSand par1EntityFallingSand, double par2, double par4, double par6, float par8, float par9) { -+ World var10 = par1EntityFallingSand.getWorld(); -+ Block var11 = Block.blocksList[par1EntityFallingSand.blockID]; -+ -+ if (var10.getBlockId(MathHelper.floor_double(par1EntityFallingSand.posX), MathHelper.floor_double(par1EntityFallingSand.posY), MathHelper.floor_double(par1EntityFallingSand.posZ)) != par1EntityFallingSand.blockID) { - GL11.glPushMatrix(); -- GL11.glTranslatef((float)var2, (float)var4, (float)var6); -- this.bindEntityTexture(var1); -+ GL11.glTranslatef((float)par2, (float)par4, (float)par6); -+ this.bindEntityTexture(par1EntityFallingSand); - GL11.glDisable(GL11.GL_LIGHTING); - Tessellator var12; -- if(var11 instanceof BlockAnvil && var11.getRenderType() == 35) { -- this.sandRenderBlocks.blockAccess = var10; -- var12 = Tessellator.instance; -- var12.startDrawingQuads(); -- var12.setTranslation((double)((float)(-MathHelper.floor_double(var1.posX)) - 0.5F), (double)((float)(-MathHelper.floor_double(var1.posY)) - 0.5F), (double)((float)(-MathHelper.floor_double(var1.posZ)) - 0.5F)); -- this.sandRenderBlocks.renderBlockAnvilMetadata((BlockAnvil)var11, MathHelper.floor_double(var1.posX), MathHelper.floor_double(var1.posY), MathHelper.floor_double(var1.posZ), var1.metadata); -- var12.setTranslation(0.0D, 0.0D, 0.0D); -- var12.draw(); -- } else if(var11.getRenderType() == 27) { -- this.sandRenderBlocks.blockAccess = var10; -- var12 = Tessellator.instance; -- var12.startDrawingQuads(); -- var12.setTranslation((double)((float)(-MathHelper.floor_double(var1.posX)) - 0.5F), (double)((float)(-MathHelper.floor_double(var1.posY)) - 0.5F), (double)((float)(-MathHelper.floor_double(var1.posZ)) - 0.5F)); -- this.sandRenderBlocks.renderBlockDragonEgg((BlockDragonEgg)var11, MathHelper.floor_double(var1.posX), MathHelper.floor_double(var1.posY), MathHelper.floor_double(var1.posZ)); -- var12.setTranslation(0.0D, 0.0D, 0.0D); -- var12.draw(); -- } else if(var11 != null) { -+ -+ if (var11 instanceof BlockAnvil && var11.getRenderType() == 35) { -+ this.sandRenderBlocks.blockAccess = var10; -+ var12 = Tessellator.instance; -+ var12.startDrawingQuads(); -+ var12.setTranslation((double)((float)(-MathHelper.floor_double(par1EntityFallingSand.posX)) - 0.5F), (double)((float)(-MathHelper.floor_double(par1EntityFallingSand.posY)) - 0.5F), (double)((float)(-MathHelper.floor_double(par1EntityFallingSand.posZ)) - 0.5F)); -+ this.sandRenderBlocks.renderBlockAnvilMetadata((BlockAnvil)var11, MathHelper.floor_double(par1EntityFallingSand.posX), MathHelper.floor_double(par1EntityFallingSand.posY), MathHelper.floor_double(par1EntityFallingSand.posZ), par1EntityFallingSand.metadata); -+ var12.setTranslation(0.0D, 0.0D, 0.0D); -+ var12.draw(); -+ } else if (var11.getRenderType() == 27) { -+ this.sandRenderBlocks.blockAccess = var10; -+ var12 = Tessellator.instance; -+ var12.startDrawingQuads(); -+ var12.setTranslation((double)((float)(-MathHelper.floor_double(par1EntityFallingSand.posX)) - 0.5F), (double)((float)(-MathHelper.floor_double(par1EntityFallingSand.posY)) - 0.5F), (double)((float)(-MathHelper.floor_double(par1EntityFallingSand.posZ)) - 0.5F)); -+ this.sandRenderBlocks.renderBlockDragonEgg((BlockDragonEgg)var11, MathHelper.floor_double(par1EntityFallingSand.posX), MathHelper.floor_double(par1EntityFallingSand.posY), MathHelper.floor_double(par1EntityFallingSand.posZ)); -+ var12.setTranslation(0.0D, 0.0D, 0.0D); -+ var12.draw(); -+ } else if (var11 != null) { - this.sandRenderBlocks.setRenderBoundsFromBlock(var11); -- this.sandRenderBlocks.renderBlockSandFalling(var11, var10, MathHelper.floor_double(var1.posX), MathHelper.floor_double(var1.posY), MathHelper.floor_double(var1.posZ), var1.metadata); -+ this.sandRenderBlocks.renderBlockSandFalling(var11, var10, MathHelper.floor_double(par1EntityFallingSand.posX), MathHelper.floor_double(par1EntityFallingSand.posY), MathHelper.floor_double(par1EntityFallingSand.posZ), par1EntityFallingSand.metadata); - } - - GL11.glEnable(GL11.GL_LIGHTING); - GL11.glPopMatrix(); - } -- - } - -- protected ResourceLocation getFallingSandTextures(EntityFallingSand var1) { -+ protected ResourceLocation getFallingSandTextures(EntityFallingSand par1EntityFallingSand) { - return TextureMap.locationBlocksTexture; - } - -- protected ResourceLocation getEntityTexture(Entity var1) { -- return this.getFallingSandTextures((EntityFallingSand)var1); -+ /** -+ * Returns the location of an entity's texture. Doesn't seem to be called unless you call Render.bindEntityTexture. -+ */ -+ protected ResourceLocation getEntityTexture(Entity par1Entity) { -+ return this.getFallingSandTextures((EntityFallingSand)par1Entity); - } - -- public void doRender(Entity var1, double var2, double var4, double var6, float var8, float var9) { -- this.doRenderFallingSand((EntityFallingSand)var1, var2, var4, var6, var8, var9); -+ /** -+ * Actually renders the given argument. This is a synthetic bridge method, always casting down its argument and then -+ * handing it off to a worker function which does the actual work. In all probabilty, the class Render is generic -+ * (Render this.posY + (double)this.getEyeHeight() + (double)this.heightOffset) { -- this.motionY += ((double)0.3F - this.motionY) * (double)0.3F; -- } -- } -- -- if(this.ab.nextInt(24) == 0) { -- this.worldObj.playSoundEffect(this.posX + 0.5D, this.posY + 0.5D, this.posZ + 0.5D, "fire.fire", 1.0F + this.ab.nextFloat(), this.ab.nextFloat() * 0.7F + 0.3F); -- } -- -- if(!this.onGround && this.motionY < 0.0D) { -+ this.heightOffset = 0.5F + (float)this.rand.nextGaussian() * 3.0F; -+ } -+ -+ if (this.getEntityToAttack() != null && this.getEntityToAttack().posY + (double)this.getEntityToAttack().getEyeHeight() > this.posY + (double)this.getEyeHeight() + (double)this.heightOffset) { -+ this.motionY += (0.30000001192092896D - this.motionY) * 0.30000001192092896D; -+ } -+ } -+ -+ if (this.rand.nextInt(24) == 0) { -+ this.worldObj.playSoundEffect(this.posX + 0.5D, this.posY + 0.5D, this.posZ + 0.5D, "fire.fire", 1.0F + this.rand.nextFloat(), this.rand.nextFloat() * 0.7F + 0.3F); -+ } -+ -+ if (!this.onGround && this.motionY < 0.0D) { - this.motionY *= 0.6D; - } - -- for(int var1 = 0; var1 < 2; ++var1) { -- this.worldObj.spawnParticle("largesmoke", this.posX + (this.ab.nextDouble() - 0.5D) * (double)this.width, this.posY + this.ab.nextDouble() * (double)this.height, this.posZ + (this.ab.nextDouble() - 0.5D) * (double)this.width, 0.0D, 0.0D, 0.0D); -+ for (int var1 = 0; var1 < 2; ++var1) { -+ this.worldObj.spawnParticle("largesmoke", this.posX + (this.rand.nextDouble() - 0.5D) * (double)this.width, this.posY + this.rand.nextDouble() * (double)this.height, this.posZ + (this.rand.nextDouble() - 0.5D) * (double)this.width, 0.0D, 0.0D, 0.0D); - } - - super.onLivingUpdate(); - } - -- protected void attackEntity(Entity var1, float var2) { -- if(this.attackTime <= 0 && var2 < 2.0F && var1.boundingBox.maxY > this.boundingBox.minY && var1.boundingBox.minY < this.boundingBox.maxY) { -+ /** -+ * Basic mob attack. Default to touch of death in EntityCreature. Overridden by each mob to define their attack. -+ */ -+ protected void attackEntity(Entity par1Entity, float par2) { -+ if (this.attackTime <= 0 && par2 < 2.0F && par1Entity.boundingBox.maxY > this.boundingBox.minY && par1Entity.boundingBox.minY < this.boundingBox.maxY) { - this.attackTime = 20; -- this.attackEntityAsMob(var1); -- } else if(var2 < 30.0F) { -- double var3 = var1.posX - this.posX; -- double var5 = var1.boundingBox.minY + (double)(var1.height / 2.0F) - (this.posY + (double)(this.height / 2.0F)); -- double var7 = var1.posZ - this.posZ; -- if(this.attackTime == 0) { -+ this.attackEntityAsMob(par1Entity); -+ } else if (par2 < 30.0F) { -+ double var3 = par1Entity.posX - this.posX; -+ double var5 = par1Entity.boundingBox.minY + (double)(par1Entity.height / 2.0F) - (this.posY + (double)(this.height / 2.0F)); -+ double var7 = par1Entity.posZ - this.posZ; -+ -+ if (this.attackTime == 0) { - ++this.field_70846_g; -- if(this.field_70846_g == 1) { -+ -+ if (this.field_70846_g == 1) { - this.attackTime = 60; - this.func_70844_e(true); -- } else if(this.field_70846_g <= 4) { -+ } else if (this.field_70846_g <= 4) { - this.attackTime = 6; - } else { - this.attackTime = 100; -@@ -94,53 +120,64 @@ - this.func_70844_e(false); - } - -- if(this.field_70846_g > 1) { -- float var9 = MathHelper.sqrt_float(var2) * 0.5F; -+ if (this.field_70846_g > 1) { -+ float var9 = MathHelper.sqrt_float(par2) * 0.5F; - this.worldObj.playAuxSFXAtEntity((EntityPlayer)null, 1009, (int)this.posX, (int)this.posY, (int)this.posZ, 0); - -- for(int var10 = 0; var10 < 1; ++var10) { -- EntitySmallFireball var11 = new EntitySmallFireball(this.worldObj, this, var3 + this.ab.nextGaussian() * (double)var9, var5, var7 + this.ab.nextGaussian() * (double)var9); -+ for (int var10 = 0; var10 < 1; ++var10) { -+ EntitySmallFireball var11 = new EntitySmallFireball(this.worldObj, this, var3 + this.rand.nextGaussian() * (double)var9, var5, var7 + this.rand.nextGaussian() * (double)var9); - var11.posY = this.posY + (double)(this.height / 2.0F) + 0.5D; - this.worldObj.spawnEntityInWorld(var11); - } - } - } - -- this.rotationYaw = (float)(Math.atan2(var7, var3) * 180.0D / (double)((float)Math.PI)) - 90.0F; -+ this.rotationYaw = (float)(Math.atan2(var7, var3) * 180.0D / Math.PI) - 90.0F; - this.hasAttacked = true; - } -- -- } -- -- protected void fall(float var1) { -- } -- -+ } -+ -+ /** -+ * Called when the mob is falling. Calculates and applies fall damage. -+ */ -+ protected void fall(float par1) {} -+ -+ /** -+ * Returns the item ID for the item the mob drops on death. -+ */ - protected int getDropItemId() { - return Item.blazeRod.itemID; - } - -+ /** -+ * Returns true if the entity is on fire. Used by render to add the fire effect on rendering. -+ */ - public boolean isBurning() { - return this.func_70845_n(); - } - -- protected void dropFewItems(boolean var1, int var2) { -- if(var1) { -- int var3 = this.ab.nextInt(2 + var2); -+ /** -+ * Drop 0-2 items of this living's type. @param par1 - Whether this entity has recently been hit by a player. @param -+ * par2 - Level of Looting used to kill this mob. -+ */ -+ protected void dropFewItems(boolean par1, int par2) { -+ if (par1) { -+ int var3 = this.rand.nextInt(2 + par2); - -- for(int var4 = 0; var4 < var3; ++var4) { -+ for (int var4 = 0; var4 < var3; ++var4) { - this.dropItem(Item.blazeRod.itemID, 1); - } - } -- - } - - public boolean func_70845_n() { - return (this.dataWatcher.getWatchableObjectByte(16) & 1) != 0; - } - -- public void func_70844_e(boolean var1) { -+ public void func_70844_e(boolean par1) { - byte var2 = this.dataWatcher.getWatchableObjectByte(16); -- if(var1) { -+ -+ if (par1) { - var2 = (byte)(var2 | 1); - } else { - var2 &= -2; -@@ -149,6 +186,9 @@ - this.dataWatcher.updateObject(16, Byte.valueOf(var2)); - } - -+ /** -+ * Checks to make sure the light is not too bright where the mob is spawning -+ */ - protected boolean isValidLightLevel() { - return true; - } ---- net/minecraft/src/BlockFurnace.java -+++ net/minecraft/src/BlockFurnace.java -@@ -3,196 +3,260 @@ - import java.util.Random; - - public class BlockFurnace extends BlockContainer { -- private final Random a = new Random(); -+ -+ /** -+ * Is the random generator used by furnace to drop the inventory contents in random directions. -+ */ -+ private final Random furnaceRand = new Random(); -+ -+ /** True if this is an active furnace, false if idle */ - private final boolean isActive; -+ -+ /** -+ * This flag is used to prevent the furnace inventory to be dropped upon block removal, is used internally when the -+ * furnace block changes from idle to active and vice-versa. -+ */ - private static boolean keepFurnaceInventory; - private Icon furnaceIconTop; - private Icon furnaceIconFront; - -- protected BlockFurnace(int var1, boolean var2) { -- super(var1, Material.rock); -- this.isActive = var2; -+ protected BlockFurnace(int par1, boolean par2) { -+ super(par1, Material.rock); -+ this.isActive = par2; - } - -- public int idDropped(int var1, Random var2, int var3) { -+ /** -+ * Returns the ID of the items to drop on destruction. -+ */ -+ public int idDropped(int par1, Random par2Random, int par3) { - return Block.furnaceIdle.blockID; - } - -- public void onBlockAdded(World var1, int var2, int var3, int var4) { -- super.onBlockAdded(var1, var2, var3, var4); -- this.setDefaultDirection(var1, var2, var3, var4); -+ /** -+ * Called whenever the block is added into the world. Args: world, x, y, z -+ */ -+ public void onBlockAdded(World par1World, int par2, int par3, int par4) { -+ super.onBlockAdded(par1World, par2, par3, par4); -+ this.setDefaultDirection(par1World, par2, par3, par4); - } - -- private void setDefaultDirection(World var1, int var2, int var3, int var4) { -- if(!var1.isRemote) { -- int var5 = var1.getBlockId(var2, var3, var4 - 1); -- int var6 = var1.getBlockId(var2, var3, var4 + 1); -- int var7 = var1.getBlockId(var2 - 1, var3, var4); -- int var8 = var1.getBlockId(var2 + 1, var3, var4); -+ /** -+ * set a blocks direction -+ */ -+ private void setDefaultDirection(World par1World, int par2, int par3, int par4) { -+ if (!par1World.isRemote) { -+ int var5 = par1World.getBlockId(par2, par3, par4 - 1); -+ int var6 = par1World.getBlockId(par2, par3, par4 + 1); -+ int var7 = par1World.getBlockId(par2 - 1, par3, par4); -+ int var8 = par1World.getBlockId(par2 + 1, par3, par4); - byte var9 = 3; -- if(Block.opaqueCubeLookup[var5] && !Block.opaqueCubeLookup[var6]) { -+ -+ if (Block.opaqueCubeLookup[var5] && !Block.opaqueCubeLookup[var6]) { - var9 = 3; - } - -- if(Block.opaqueCubeLookup[var6] && !Block.opaqueCubeLookup[var5]) { -+ if (Block.opaqueCubeLookup[var6] && !Block.opaqueCubeLookup[var5]) { - var9 = 2; - } - -- if(Block.opaqueCubeLookup[var7] && !Block.opaqueCubeLookup[var8]) { -+ if (Block.opaqueCubeLookup[var7] && !Block.opaqueCubeLookup[var8]) { - var9 = 5; - } - -- if(Block.opaqueCubeLookup[var8] && !Block.opaqueCubeLookup[var7]) { -+ if (Block.opaqueCubeLookup[var8] && !Block.opaqueCubeLookup[var7]) { - var9 = 4; - } - -- var1.setBlockMetadata(var2, var3, var4, var9, 2); -+ par1World.setBlockMetadataWithNotify(par2, par3, par4, var9, 2); - } - } - -- public Icon getIcon(int var1, int var2) { -- return var1 == 1 ? this.furnaceIconTop : (var1 == 0 ? this.furnaceIconTop : (var1 != var2 ? this.blockIcon : this.furnaceIconFront)); -- } -- -- public void registerIcons(IconRegister var1) { -- this.blockIcon = var1.registerIcon("furnace_side"); -- this.furnaceIconFront = var1.registerIcon(this.isActive ? "furnace_front_on" : "furnace_front_off"); -- this.furnaceIconTop = var1.registerIcon("furnace_top"); -- } -- -- public void randomDisplayTick(World var1, int var2, int var3, int var4, Random var5) { -- if(this.isActive) { -- int var6 = var1.getBlockMetadata(var2, var3, var4); -- float var7 = (float)var2 + 0.5F; -- float var8 = (float)var3 + 0.0F + var5.nextFloat() * 6.0F / 16.0F; -- float var9 = (float)var4 + 0.5F; -+ /** -+ * From the specified side and block metadata retrieves the blocks texture. Args: side, metadata -+ */ -+ public Icon getIcon(int par1, int par2) { -+ return par1 == 1 ? this.furnaceIconTop : (par1 == 0 ? this.furnaceIconTop : (par1 != par2 ? this.blockIcon : this.furnaceIconFront)); -+ } -+ -+ /** -+ * When this method is called, your block should register all the icons it needs with the given IconRegister. This is -+ * the only chance you get to register icons. -+ */ -+ public void registerIcons(IconRegister par1IconRegister) { -+ this.blockIcon = par1IconRegister.registerIcon("furnace_side"); -+ this.furnaceIconFront = par1IconRegister.registerIcon(this.isActive ? "furnace_front_on" : "furnace_front_off"); -+ this.furnaceIconTop = par1IconRegister.registerIcon("furnace_top"); -+ } -+ -+ /** -+ * A randomly called display update to be able to add particles or other items for display -+ */ -+ public void randomDisplayTick(World par1World, int par2, int par3, int par4, Random par5Random) { -+ if (this.isActive) { -+ int var6 = par1World.getBlockMetadata(par2, par3, par4); -+ float var7 = (float)par2 + 0.5F; -+ float var8 = (float)par3 + 0.0F + par5Random.nextFloat() * 6.0F / 16.0F; -+ float var9 = (float)par4 + 0.5F; - float var10 = 0.52F; -- float var11 = var5.nextFloat() * 0.6F - 0.3F; -- if(var6 == 4) { -- var1.spawnParticle("smoke", (double)(var7 - var10), (double)var8, (double)(var9 + var11), 0.0D, 0.0D, 0.0D); -- var1.spawnParticle("flame", (double)(var7 - var10), (double)var8, (double)(var9 + var11), 0.0D, 0.0D, 0.0D); -- } else if(var6 == 5) { -- var1.spawnParticle("smoke", (double)(var7 + var10), (double)var8, (double)(var9 + var11), 0.0D, 0.0D, 0.0D); -- var1.spawnParticle("flame", (double)(var7 + var10), (double)var8, (double)(var9 + var11), 0.0D, 0.0D, 0.0D); -- } else if(var6 == 2) { -- var1.spawnParticle("smoke", (double)(var7 + var11), (double)var8, (double)(var9 - var10), 0.0D, 0.0D, 0.0D); -- var1.spawnParticle("flame", (double)(var7 + var11), (double)var8, (double)(var9 - var10), 0.0D, 0.0D, 0.0D); -- } else if(var6 == 3) { -- var1.spawnParticle("smoke", (double)(var7 + var11), (double)var8, (double)(var9 + var10), 0.0D, 0.0D, 0.0D); -- var1.spawnParticle("flame", (double)(var7 + var11), (double)var8, (double)(var9 + var10), 0.0D, 0.0D, 0.0D); -+ float var11 = par5Random.nextFloat() * 0.6F - 0.3F; -+ -+ if (var6 == 4) { -+ par1World.spawnParticle("smoke", (double)(var7 - var10), (double)var8, (double)(var9 + var11), 0.0D, 0.0D, 0.0D); -+ par1World.spawnParticle("flame", (double)(var7 - var10), (double)var8, (double)(var9 + var11), 0.0D, 0.0D, 0.0D); -+ } else if (var6 == 5) { -+ par1World.spawnParticle("smoke", (double)(var7 + var10), (double)var8, (double)(var9 + var11), 0.0D, 0.0D, 0.0D); -+ par1World.spawnParticle("flame", (double)(var7 + var10), (double)var8, (double)(var9 + var11), 0.0D, 0.0D, 0.0D); -+ } else if (var6 == 2) { -+ par1World.spawnParticle("smoke", (double)(var7 + var11), (double)var8, (double)(var9 - var10), 0.0D, 0.0D, 0.0D); -+ par1World.spawnParticle("flame", (double)(var7 + var11), (double)var8, (double)(var9 - var10), 0.0D, 0.0D, 0.0D); -+ } else if (var6 == 3) { -+ par1World.spawnParticle("smoke", (double)(var7 + var11), (double)var8, (double)(var9 + var10), 0.0D, 0.0D, 0.0D); -+ par1World.spawnParticle("flame", (double)(var7 + var11), (double)var8, (double)(var9 + var10), 0.0D, 0.0D, 0.0D); - } -- - } - } - -- public boolean onBlockActivated(World var1, int var2, int var3, int var4, EntityPlayer var5, int var6, float var7, float var8, float var9) { -- if(var1.isRemote) { -+ /** -+ * Called upon block activation (right click on the block.) -+ */ -+ public boolean onBlockActivated(World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer, int par6, float par7, float par8, float par9) { -+ if (par1World.isRemote) { - return true; - } else { -- TileEntityFurnace var10 = (TileEntityFurnace)var1.getBlockTileEntity(var2, var3, var4); -- if(var10 != null) { -- var5.displayGUIFurnace(var10); -+ TileEntityFurnace var10 = (TileEntityFurnace)par1World.getBlockTileEntity(par2, par3, par4); -+ -+ if (var10 != null) { -+ par5EntityPlayer.displayGUIFurnace(var10); - } - - return true; - } - } - -- public static void updateFurnaceBlockState(boolean var0, World var1, int var2, int var3, int var4) { -- int var5 = var1.getBlockMetadata(var2, var3, var4); -- TileEntity var6 = var1.getBlockTileEntity(var2, var3, var4); -+ /** -+ * Update which block ID the furnace is using depending on whether or not it is burning -+ */ -+ public static void updateFurnaceBlockState(boolean par0, World par1World, int par2, int par3, int par4) { -+ int var5 = par1World.getBlockMetadata(par2, par3, par4); -+ TileEntity var6 = par1World.getBlockTileEntity(par2, par3, par4); - keepFurnaceInventory = true; -- if(var0) { -- var1.setBlock(var2, var3, var4, Block.furnaceBurning.blockID); -+ -+ if (par0) { -+ par1World.setBlock(par2, par3, par4, Block.furnaceBurning.blockID); - } else { -- var1.setBlock(var2, var3, var4, Block.furnaceIdle.blockID); -+ par1World.setBlock(par2, par3, par4, Block.furnaceIdle.blockID); - } - - keepFurnaceInventory = false; -- var1.setBlockMetadata(var2, var3, var4, var5, 2); -- if(var6 != null) { -+ par1World.setBlockMetadataWithNotify(par2, par3, par4, var5, 2); -+ -+ if (var6 != null) { - var6.validate(); -- var1.setBlockTileEntity(var2, var3, var4, var6); -+ par1World.setBlockTileEntity(par2, par3, par4, var6); - } -- - } - -- public TileEntity createNewTileEntity(World var1) { -+ /** -+ * Returns a new instance of a block's tile entity class. Called on placing the block. -+ */ -+ public TileEntity createNewTileEntity(World par1World) { - return new TileEntityFurnace(); - } - -- public void onBlockPlacedBy(World var1, int var2, int var3, int var4, EntityLivingBase var5, ItemStack var6) { -- int var7 = MathHelper.floor_double((double)(var5.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3; -- if(var7 == 0) { -- var1.setBlockMetadata(var2, var3, var4, 2, 2); -- } -- -- if(var7 == 1) { -- var1.setBlockMetadata(var2, var3, var4, 5, 2); -- } -- -- if(var7 == 2) { -- var1.setBlockMetadata(var2, var3, var4, 3, 2); -- } -- -- if(var7 == 3) { -- var1.setBlockMetadata(var2, var3, var4, 4, 2); -- } -- -- if(var6.hasDisplayName()) { -- ((TileEntityFurnace)var1.getBlockTileEntity(var2, var3, var4)).setGuiDisplayName(var6.getDisplayName()); -- } -- -+ /** -+ * Called when the block is placed in the world. -+ */ -+ public void onBlockPlacedBy(World par1World, int par2, int par3, int par4, EntityLivingBase par5EntityLivingBase, ItemStack par6ItemStack) { -+ int var7 = MathHelper.floor_double((double)(par5EntityLivingBase.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3; -+ -+ if (var7 == 0) { -+ par1World.setBlockMetadataWithNotify(par2, par3, par4, 2, 2); -+ } -+ -+ if (var7 == 1) { -+ par1World.setBlockMetadataWithNotify(par2, par3, par4, 5, 2); -+ } -+ -+ if (var7 == 2) { -+ par1World.setBlockMetadataWithNotify(par2, par3, par4, 3, 2); -+ } -+ -+ if (var7 == 3) { -+ par1World.setBlockMetadataWithNotify(par2, par3, par4, 4, 2); -+ } -+ -+ if (par6ItemStack.hasDisplayName()) { -+ ((TileEntityFurnace)par1World.getBlockTileEntity(par2, par3, par4)).setGuiDisplayName(par6ItemStack.getDisplayName()); -+ } - } - -- public void breakBlock(World var1, int var2, int var3, int var4, int var5, int var6) { -- if(!keepFurnaceInventory) { -- TileEntityFurnace var7 = (TileEntityFurnace)var1.getBlockTileEntity(var2, var3, var4); -- if(var7 != null) { -- for(int var8 = 0; var8 < var7.getSizeInventory(); ++var8) { -+ /** -+ * Called on server worlds only when the block has been replaced by a different block ID, or the same block with a -+ * different metadata value, but before the new metadata value is set. Args: World, x, y, z, old block ID, old metadata -+ */ -+ public void breakBlock(World par1World, int par2, int par3, int par4, int par5, int par6) { -+ if (!keepFurnaceInventory) { -+ TileEntityFurnace var7 = (TileEntityFurnace)par1World.getBlockTileEntity(par2, par3, par4); -+ -+ if (var7 != null) { -+ for (int var8 = 0; var8 < var7.getSizeInventory(); ++var8) { - ItemStack var9 = var7.getStackInSlot(var8); -- if(var9 != null) { -- float var10 = this.a.nextFloat() * 0.8F + 0.1F; -- float var11 = this.a.nextFloat() * 0.8F + 0.1F; -- float var12 = this.a.nextFloat() * 0.8F + 0.1F; -- -- while(var9.stackSize > 0) { -- int var13 = this.a.nextInt(21) + 10; -- if(var13 > var9.stackSize) { -+ -+ if (var9 != null) { -+ float var10 = this.furnaceRand.nextFloat() * 0.8F + 0.1F; -+ float var11 = this.furnaceRand.nextFloat() * 0.8F + 0.1F; -+ float var12 = this.furnaceRand.nextFloat() * 0.8F + 0.1F; -+ -+ while (var9.stackSize > 0) { -+ int var13 = this.furnaceRand.nextInt(21) + 10; -+ -+ if (var13 > var9.stackSize) { - var13 = var9.stackSize; - } - - var9.stackSize -= var13; -- EntityItem var14 = new EntityItem(var1, (double)((float)var2 + var10), (double)((float)var3 + var11), (double)((float)var4 + var12), new ItemStack(var9.itemID, var13, var9.getItemDamage())); -- if(var9.hasTagCompound()) { -+ EntityItem var14 = new EntityItem(par1World, (double)((float)par2 + var10), (double)((float)par3 + var11), (double)((float)par4 + var12), new ItemStack(var9.itemID, var13, var9.getItemDamage())); -+ -+ if (var9.hasTagCompound()) { - var14.getEntityItem().setTagCompound((NBTTagCompound)var9.getTagCompound().copy()); - } - - float var15 = 0.05F; -- var14.motionX = (double)((float)this.a.nextGaussian() * var15); -- var14.motionY = (double)((float)this.a.nextGaussian() * var15 + 0.2F); -- var14.motionZ = (double)((float)this.a.nextGaussian() * var15); -- var1.spawnEntityInWorld(var14); -+ var14.motionX = (double)((float)this.furnaceRand.nextGaussian() * var15); -+ var14.motionY = (double)((float)this.furnaceRand.nextGaussian() * var15 + 0.2F); -+ var14.motionZ = (double)((float)this.furnaceRand.nextGaussian() * var15); -+ par1World.spawnEntityInWorld(var14); - } - } - } - -- var1.func_96440_m(var2, var3, var4, var5); -+ par1World.func_96440_m(par2, par3, par4, par5); - } - } - -- super.breakBlock(var1, var2, var3, var4, var5, var6); -+ super.breakBlock(par1World, par2, par3, par4, par5, par6); - } - -+ /** -+ * If this returns true, then comparators facing away from this block will use the value from -+ * getComparatorInputOverride instead of the actual redstone signal strength. -+ */ - public boolean hasComparatorInputOverride() { - return true; - } - -- public int getComparatorInputOverride(World var1, int var2, int var3, int var4, int var5) { -- return Container.calcRedstoneFromInventory((IInventory)var1.getBlockTileEntity(var2, var3, var4)); -+ /** -+ * If hasComparatorInputOverride returns true, the return value from this is used instead of the redstone signal -+ * strength when this block inputs to a comparator. -+ */ -+ public int getComparatorInputOverride(World par1World, int par2, int par3, int par4, int par5) { -+ return Container.calcRedstoneFromInventory((IInventory)par1World.getBlockTileEntity(par2, par3, par4)); - } - -- public int idPicked(World var1, int var2, int var3, int var4) { -+ /** -+ * only called by clickMiddleMouseButton , and passed to inventory.setCurrentItem (along with isCreative) -+ */ -+ public int idPicked(World par1World, int par2, int par3, int par4) { - return Block.furnaceIdle.blockID; - } - } ---- net/minecraft/src/IBossDisplayData.java -+++ net/minecraft/src/IBossDisplayData.java -@@ -5,5 +5,8 @@ - - float getHealth(); - -+ /** -+ * Gets the username of the entity. -+ */ - String getEntityName(); - } ---- net/minecraft/src/TileEntityBeacon.java -+++ net/minecraft/src/TileEntityBeacon.java -@@ -4,29 +4,43 @@ - import java.util.List; - - public class TileEntityBeacon extends TileEntity implements IInventory { -- public static final Potion[][] effectsList = new Potion[][]{{Potion.moveSpeed, Potion.digSpeed}, {Potion.resistance, Potion.jump}, {Potion.damageBoost}, {Potion.regeneration}}; -+ -+ /** List of effects that Beacon can apply */ -+ public static final Potion[][] effectsList = new Potion[][] {{Potion.moveSpeed, Potion.digSpeed}, {Potion.resistance, Potion.jump}, {Potion.damageBoost}, {Potion.regeneration}}; - private long field_82137_b; - private float field_82138_c; - private boolean isBeaconActive; -+ -+ /** Level of this beacon's pyramid. */ - private int levels = -1; -+ -+ /** Primary potion effect given by this beacon. */ - private int primaryEffect; -+ -+ /** Secondary potion effect given by this beacon. */ - private int secondaryEffect; -+ -+ /** Item given to this beacon as payment. */ - private ItemStack payment; -- private String i; -+ private String field_94048_i; - -+ /** -+ * Allows the entity to update its state. Overridden in most subclasses, e.g. the mob spawner uses this to count ticks -+ * and creates a new spawn inside its implementation. -+ */ - public void updateEntity() { -- if(this.worldObj.getTotalWorldTime() % 80L == 0L) { -+ if (this.worldObj.getTotalWorldTime() % 80L == 0L) { - this.updateState(); - this.addEffectsToPlayers(); - } -- - } - - private void addEffectsToPlayers() { -- if(this.isBeaconActive && this.levels > 0 && !this.worldObj.isRemote && this.primaryEffect > 0) { -+ if (this.isBeaconActive && this.levels > 0 && !this.worldObj.isRemote && this.primaryEffect > 0) { - double var1 = (double)(this.levels * 10 + 10); - byte var3 = 0; -- if(this.levels >= 4 && this.primaryEffect == this.secondaryEffect) { -+ -+ if (this.levels >= 4 && this.primaryEffect == this.secondaryEffect) { - var3 = 1; - } - -@@ -34,78 +48,84 @@ - var4.maxY = (double)this.worldObj.getHeight(); - List var5 = this.worldObj.getEntitiesWithinAABB(EntityPlayer.class, var4); - Iterator var6 = var5.iterator(); -- - EntityPlayer var7; -- while(var6.hasNext()) { -+ -+ while (var6.hasNext()) { - var7 = (EntityPlayer)var6.next(); - var7.addPotionEffect(new PotionEffect(this.primaryEffect, 180, var3, true)); - } - -- if(this.levels >= 4 && this.primaryEffect != this.secondaryEffect && this.secondaryEffect > 0) { -+ if (this.levels >= 4 && this.primaryEffect != this.secondaryEffect && this.secondaryEffect > 0) { - var6 = var5.iterator(); - -- while(var6.hasNext()) { -+ while (var6.hasNext()) { - var7 = (EntityPlayer)var6.next(); - var7.addPotionEffect(new PotionEffect(this.secondaryEffect, 180, 0, true)); - } - } - } -- - } - -+ /** -+ * Checks if the Beacon has a valid pyramid underneath and direct sunlight above -+ */ - private void updateState() { -- if(!this.worldObj.canBlockSeeTheSky(this.xCoord, this.yCoord + 1, this.zCoord)) { -+ if (!this.worldObj.canBlockSeeTheSky(this.xCoord, this.yCoord + 1, this.zCoord)) { - this.isBeaconActive = false; - this.levels = 0; - } else { - this.isBeaconActive = true; - this.levels = 0; - -- for(int var1 = 1; var1 <= 4; this.levels = var1++) { -+ for (int var1 = 1; var1 <= 4; this.levels = var1++) { - int var2 = this.yCoord - var1; -- if(var2 < 0) { -+ -+ if (var2 < 0) { - break; - } - - boolean var3 = true; - -- for(int var4 = this.xCoord - var1; var4 <= this.xCoord + var1 && var3; ++var4) { -- for(int var5 = this.zCoord - var1; var5 <= this.zCoord + var1; ++var5) { -+ for (int var4 = this.xCoord - var1; var4 <= this.xCoord + var1 && var3; ++var4) { -+ for (int var5 = this.zCoord - var1; var5 <= this.zCoord + var1; ++var5) { - int var6 = this.worldObj.getBlockId(var4, var2, var5); -- if(var6 != Block.blockEmerald.blockID && var6 != Block.blockGold.blockID && var6 != Block.blockDiamond.blockID && var6 != Block.blockIron.blockID) { -+ -+ if (var6 != Block.blockEmerald.blockID && var6 != Block.blockGold.blockID && var6 != Block.blockDiamond.blockID && var6 != Block.blockIron.blockID) { - var3 = false; - break; - } - } - } - -- if(!var3) { -+ if (!var3) { - break; - } - } - -- if(this.levels == 0) { -+ if (this.levels == 0) { - this.isBeaconActive = false; - } - } -- - } - - public float func_82125_v_() { -- if(!this.isBeaconActive) { -+ if (!this.isBeaconActive) { - return 0.0F; - } else { - int var1 = (int)(this.worldObj.getTotalWorldTime() - this.field_82137_b); - this.field_82137_b = this.worldObj.getTotalWorldTime(); -- if(var1 > 1) { -+ -+ if (var1 > 1) { - this.field_82138_c -= (float)var1 / 40.0F; -- if(this.field_82138_c < 0.0F) { -+ -+ if (this.field_82138_c < 0.0F) { - this.field_82138_c = 0.0F; - } - } - - this.field_82138_c += 0.025F; -- if(this.field_82138_c > 1.0F) { -+ -+ if (this.field_82138_c > 1.0F) { - this.field_82138_c = 1.0F; - } - -@@ -113,59 +133,75 @@ - } - } - -+ /** -+ * Return the primary potion effect given by this beacon. -+ */ - public int getPrimaryEffect() { - return this.primaryEffect; - } - -+ /** -+ * Return the secondary potion effect given by this beacon. -+ */ - public int getSecondaryEffect() { - return this.secondaryEffect; - } - -+ /** -+ * Return the levels of this beacon's pyramid. -+ */ - public int getLevels() { - return this.levels; - } - -- public void setLevels(int var1) { -- this.levels = var1; -+ /** -+ * Set the levels of this beacon's pyramid. -+ */ -+ public void setLevels(int par1) { -+ this.levels = par1; - } - -- public void setPrimaryEffect(int var1) { -+ public void setPrimaryEffect(int par1) { - this.primaryEffect = 0; - -- for(int var2 = 0; var2 < this.levels && var2 < 3; ++var2) { -+ for (int var2 = 0; var2 < this.levels && var2 < 3; ++var2) { - Potion[] var3 = effectsList[var2]; - int var4 = var3.length; - -- for(int var5 = 0; var5 < var4; ++var5) { -+ for (int var5 = 0; var5 < var4; ++var5) { - Potion var6 = var3[var5]; -- if(var6.id == var1) { -- this.primaryEffect = var1; -+ -+ if (var6.id == par1) { -+ this.primaryEffect = par1; - return; - } - } - } -- - } - -- public void setSecondaryEffect(int var1) { -+ public void setSecondaryEffect(int par1) { - this.secondaryEffect = 0; -- if(this.levels >= 4) { -- for(int var2 = 0; var2 < 4; ++var2) { -+ -+ if (this.levels >= 4) { -+ for (int var2 = 0; var2 < 4; ++var2) { - Potion[] var3 = effectsList[var2]; - int var4 = var3.length; - -- for(int var5 = 0; var5 < var4; ++var5) { -+ for (int var5 = 0; var5 < var4; ++var5) { - Potion var6 = var3[var5]; -- if(var6.id == var1) { -- this.secondaryEffect = var1; -+ -+ if (var6.id == par1) { -+ this.secondaryEffect = par1; - return; - } - } - } - } -- - } - -+ /** -+ * Overriden in a sign to provide the text. -+ */ - public Packet getDescriptionPacket() { - NBTTagCompound var1 = new NBTTagCompound(); - this.writeToNBT(var1); -@@ -176,45 +212,65 @@ - return 65536.0D; - } - -- public void readFromNBT(NBTTagCompound var1) { -- super.readFromNBT(var1); -- this.primaryEffect = var1.getInteger("Primary"); -- this.secondaryEffect = var1.getInteger("Secondary"); -- this.levels = var1.getInteger("Levels"); -- } -- -- public void writeToNBT(NBTTagCompound var1) { -- super.writeToNBT(var1); -- var1.setInteger("Primary", this.primaryEffect); -- var1.setInteger("Secondary", this.secondaryEffect); -- var1.setInteger("Levels", this.levels); -- } -- -+ /** -+ * Reads a tile entity from NBT. -+ */ -+ public void readFromNBT(NBTTagCompound par1NBTTagCompound) { -+ super.readFromNBT(par1NBTTagCompound); -+ this.primaryEffect = par1NBTTagCompound.getInteger("Primary"); -+ this.secondaryEffect = par1NBTTagCompound.getInteger("Secondary"); -+ this.levels = par1NBTTagCompound.getInteger("Levels"); -+ } -+ -+ /** -+ * Writes a tile entity to NBT. -+ */ -+ public void writeToNBT(NBTTagCompound par1NBTTagCompound) { -+ super.writeToNBT(par1NBTTagCompound); -+ par1NBTTagCompound.setInteger("Primary", this.primaryEffect); -+ par1NBTTagCompound.setInteger("Secondary", this.secondaryEffect); -+ par1NBTTagCompound.setInteger("Levels", this.levels); -+ } -+ -+ /** -+ * Returns the number of slots in the inventory. -+ */ - public int getSizeInventory() { - return 1; - } - -- public ItemStack getStackInSlot(int var1) { -- return var1 == 0 ? this.payment : null; -+ /** -+ * Returns the stack in slot i -+ */ -+ public ItemStack getStackInSlot(int par1) { -+ return par1 == 0 ? this.payment : null; - } - -- public ItemStack decrStackSize(int var1, int var2) { -- if(var1 == 0 && this.payment != null) { -- if(var2 >= this.payment.stackSize) { -+ /** -+ * Removes from an inventory slot (first arg) up to a specified number (second arg) of items and returns them in a new -+ * stack. -+ */ -+ public ItemStack decrStackSize(int par1, int par2) { -+ if (par1 == 0 && this.payment != null) { -+ if (par2 >= this.payment.stackSize) { - ItemStack var3 = this.payment; - this.payment = null; - return var3; - } else { -- this.payment.stackSize -= var2; -- return new ItemStack(this.payment.itemID, var2, this.payment.getItemDamage()); -+ this.payment.stackSize -= par2; -+ return new ItemStack(this.payment.itemID, par2, this.payment.getItemDamage()); - } - } else { - return null; - } - } - -- public ItemStack getStackInSlotOnClosing(int var1) { -- if(var1 == 0 && this.payment != null) { -+ /** -+ * When some containers are closed they call this on each slot, then drop whatever it returns as an EntityItem - like -+ * when you close a workbench GUI. -+ */ -+ public ItemStack getStackInSlotOnClosing(int par1) { -+ if (par1 == 0 && this.payment != null) { - ItemStack var2 = this.payment; - this.payment = null; - return var2; -@@ -223,40 +279,57 @@ - } - } - -- public void setInventorySlotContents(int var1, ItemStack var2) { -- if(var1 == 0) { -- this.payment = var2; -+ /** -+ * Sets the given item stack to the specified slot in the inventory (can be crafting or armor sections). -+ */ -+ public void setInventorySlotContents(int par1, ItemStack par2ItemStack) { -+ if (par1 == 0) { -+ this.payment = par2ItemStack; - } -- - } - -+ /** -+ * Returns the name of the inventory. -+ */ - public String getInvName() { -- return this.isInvNameLocalized() ? this.i : "container.beacon"; -+ return this.isInvNameLocalized() ? this.field_94048_i : "container.beacon"; - } - -+ /** -+ * If this returns false, the inventory name will be used as an unlocalized name, and translated into the player's -+ * language. Otherwise it will be used directly. -+ */ - public boolean isInvNameLocalized() { -- return this.i != null && this.i.length() > 0; -- } -- -- public void func_94047_a(String var1) { -- this.i = var1; -- } -- -+ return this.field_94048_i != null && this.field_94048_i.length() > 0; -+ } -+ -+ public void func_94047_a(String par1Str) { -+ this.field_94048_i = par1Str; -+ } -+ -+ /** -+ * Returns the maximum stack size for a inventory slot. Seems to always be 64, possibly will be extended. *Isn't this -+ * more of a set than a get?* -+ */ - public int getInventoryStackLimit() { - return 1; - } - -- public boolean isUseableByPlayer(EntityPlayer var1) { -- return this.worldObj.getBlockTileEntity(this.xCoord, this.yCoord, this.zCoord) != this ? false : var1.getDistanceSq((double)this.xCoord + 0.5D, (double)this.yCoord + 0.5D, (double)this.zCoord + 0.5D) <= 64.0D; -- } -- -- public void openChest() { -- } -- -- public void closeChest() { -- } -- -- public boolean isItemValidForSlot(int var1, ItemStack var2) { -- return var2.itemID == Item.emerald.itemID || var2.itemID == Item.diamond.itemID || var2.itemID == Item.ingotGold.itemID || var2.itemID == Item.ingotIron.itemID; -+ /** -+ * Do not make give this method the name canInteractWith because it clashes with Container -+ */ -+ public boolean isUseableByPlayer(EntityPlayer par1EntityPlayer) { -+ return this.worldObj.getBlockTileEntity(this.xCoord, this.yCoord, this.zCoord) != this ? false : par1EntityPlayer.getDistanceSq((double)this.xCoord + 0.5D, (double)this.yCoord + 0.5D, (double)this.zCoord + 0.5D) <= 64.0D; -+ } -+ -+ public void openChest() {} -+ -+ public void closeChest() {} -+ -+ /** -+ * Returns true if automation is allowed to insert the given stack (ignoring stack size) into the given slot. -+ */ -+ public boolean isItemValidForSlot(int par1, ItemStack par2ItemStack) { -+ return par2ItemStack.itemID == Item.emerald.itemID || par2ItemStack.itemID == Item.diamond.itemID || par2ItemStack.itemID == Item.ingotGold.itemID || par2ItemStack.itemID == Item.ingotIron.itemID; - } - } ---- net/minecraft/src/CreativeTabFood.java -+++ net/minecraft/src/CreativeTabFood.java -@@ -1,10 +1,13 @@ - package net.minecraft.src; - - final class CreativeTabFood extends CreativeTabs { -- CreativeTabFood(int var1, String var2) { -- super(var1, var2); -+ CreativeTabFood(int par1, String par2Str) { -+ super(par1, par2Str); - } - -+ /** -+ * the itemID for the item to be displayed on the tab -+ */ - public int getTabIconItemIndex() { - return Item.axeIron.itemID; - } ---- net/minecraft/src/EntityAIFollowParent.java -+++ net/minecraft/src/EntityAIFollowParent.java -@@ -4,18 +4,23 @@ - import java.util.List; - - public class EntityAIFollowParent extends EntityAIBase { -+ -+ /** The child that is following its parent. */ - EntityAnimal childAnimal; - EntityAnimal parentAnimal; - double field_75347_c; - private int field_75345_d; - -- public EntityAIFollowParent(EntityAnimal var1, double var2) { -- this.childAnimal = var1; -- this.field_75347_c = var2; -+ public EntityAIFollowParent(EntityAnimal par1EntityAnimal, double par2) { -+ this.childAnimal = par1EntityAnimal; -+ this.field_75347_c = par2; - } - -+ /** -+ * Returns whether the EntityAIBase should begin execution. -+ */ - public boolean shouldExecute() { -- if(this.childAnimal.getGrowingAge() >= 0) { -+ if (this.childAnimal.getGrowingAge() >= 0) { - return false; - } else { - List var1 = this.childAnimal.worldObj.getEntitiesWithinAABB(this.childAnimal.getClass(), this.childAnimal.boundingBox.expand(8.0D, 4.0D, 8.0D)); -@@ -23,20 +28,22 @@ - double var3 = Double.MAX_VALUE; - Iterator var5 = var1.iterator(); - -- while(var5.hasNext()) { -+ while (var5.hasNext()) { - EntityAnimal var6 = (EntityAnimal)var5.next(); -- if(var6.getGrowingAge() >= 0) { -+ -+ if (var6.getGrowingAge() >= 0) { - double var7 = this.childAnimal.getDistanceSqToEntity(var6); -- if(var7 <= var3) { -+ -+ if (var7 <= var3) { - var3 = var7; - var2 = var6; - } - } - } - -- if(var2 == null) { -+ if (var2 == null) { - return false; -- } else if(var3 < 9.0D) { -+ } else if (var3 < 9.0D) { - return false; - } else { - this.parentAnimal = var2; -@@ -45,8 +52,11 @@ - } - } - -+ /** -+ * Returns whether an in-progress EntityAIBase should continue executing -+ */ - public boolean continueExecuting() { -- if(!this.parentAnimal.isEntityAlive()) { -+ if (!this.parentAnimal.isEntityAlive()) { - return false; - } else { - double var1 = this.childAnimal.getDistanceSqToEntity(this.parentAnimal); -@@ -54,16 +64,25 @@ - } - } - -+ /** -+ * Execute a one shot task or start executing a continuous task -+ */ - public void startExecuting() { - this.field_75345_d = 0; - } - -+ /** -+ * Resets the task -+ */ - public void resetTask() { - this.parentAnimal = null; - } - -+ /** -+ * Updates the task -+ */ - public void updateTask() { -- if(--this.field_75345_d <= 0) { -+ if (--this.field_75345_d <= 0) { - this.field_75345_d = 10; - this.childAnimal.getNavigator().tryMoveToEntityLiving(this.parentAnimal, this.field_75347_c); - } ---- net/minecraft/src/AnimationMetadataSectionSerializer.java -+++ net/minecraft/src/AnimationMetadataSectionSerializer.java -@@ -13,19 +13,21 @@ - import java.util.ArrayList; - - public class AnimationMetadataSectionSerializer extends BaseMetadataSectionSerializer implements JsonSerializer { -- public AnimationMetadataSection func_110493_a(JsonElement var1, Type var2, JsonDeserializationContext var3) { -+ public AnimationMetadataSection func_110493_a(JsonElement par1JsonElement, Type par2Type, JsonDeserializationContext par3JsonDeserializationContext) { - ArrayList var4 = Lists.newArrayList(); -- JsonObject var5 = (JsonObject)var1; -+ JsonObject var5 = (JsonObject)par1JsonElement; - int var6 = this.func_110485_a(var5.get("frametime"), "frametime", Integer.valueOf(1), 1, Integer.MAX_VALUE); - int var8; -- if(var5.has("frames")) { -+ -+ if (var5.has("frames")) { - try { - JsonArray var7 = var5.getAsJsonArray("frames"); - -- for(var8 = 0; var8 < var7.size(); ++var8) { -+ for (var8 = 0; var8 < var7.size(); ++var8) { - JsonElement var9 = var7.get(var8); - AnimationFrame var10 = this.parseAnimationFrame(var8, var9); -- if(var10 != null) { -+ -+ if (var10 != null) { - var4.add(var10); - } - } -@@ -39,45 +41,46 @@ - return new AnimationMetadataSection(var4, var12, var8, var6); - } - -- private AnimationFrame parseAnimationFrame(int var1, JsonElement var2) { -- if(var2.isJsonPrimitive()) { -+ private AnimationFrame parseAnimationFrame(int par1, JsonElement par2JsonElement) { -+ if (par2JsonElement.isJsonPrimitive()) { - try { -- return new AnimationFrame(var2.getAsInt()); -+ return new AnimationFrame(par2JsonElement.getAsInt()); - } catch (NumberFormatException var6) { -- throw new JsonParseException("Invalid animation->frames->" + var1 + ": expected number, was " + var2, var6); -+ throw new JsonParseException("Invalid animation->frames->" + par1 + ": expected number, was " + par2JsonElement, var6); - } -- } else if(var2.isJsonObject()) { -- JsonObject var3 = var2.getAsJsonObject(); -- int var4 = this.func_110485_a(var3.get("time"), "frames->" + var1 + "->time", Integer.valueOf(-1), 1, Integer.MAX_VALUE); -- int var5 = this.func_110485_a(var3.get("index"), "frames->" + var1 + "->index", (Integer)null, 0, Integer.MAX_VALUE); -+ } else if (par2JsonElement.isJsonObject()) { -+ JsonObject var3 = par2JsonElement.getAsJsonObject(); -+ int var4 = this.func_110485_a(var3.get("time"), "frames->" + par1 + "->time", Integer.valueOf(-1), 1, Integer.MAX_VALUE); -+ int var5 = this.func_110485_a(var3.get("index"), "frames->" + par1 + "->index", (Integer)null, 0, Integer.MAX_VALUE); - return new AnimationFrame(var5, var4); - } else { - return null; - } - } - -- public JsonElement func_110491_a(AnimationMetadataSection var1, Type var2, JsonSerializationContext var3) { -+ public JsonElement func_110491_a(AnimationMetadataSection par1AnimationMetadataSection, Type par2Type, JsonSerializationContext par3JsonSerializationContext) { - JsonObject var4 = new JsonObject(); -- var4.addProperty("frametime", (Number)Integer.valueOf(var1.getFrameTime())); -- if(var1.getFrameWidth() != -1) { -- var4.addProperty("width", (Number)Integer.valueOf(var1.getFrameWidth())); -- } -- -- if(var1.getFrameHeight() != -1) { -- var4.addProperty("height", (Number)Integer.valueOf(var1.getFrameHeight())); -- } -- -- if(var1.getFrameCount() > 0) { -+ var4.addProperty("frametime", Integer.valueOf(par1AnimationMetadataSection.getFrameTime())); -+ -+ if (par1AnimationMetadataSection.getFrameWidth() != -1) { -+ var4.addProperty("width", Integer.valueOf(par1AnimationMetadataSection.getFrameWidth())); -+ } -+ -+ if (par1AnimationMetadataSection.getFrameHeight() != -1) { -+ var4.addProperty("height", Integer.valueOf(par1AnimationMetadataSection.getFrameHeight())); -+ } -+ -+ if (par1AnimationMetadataSection.getFrameCount() > 0) { - JsonArray var5 = new JsonArray(); - -- for(int var6 = 0; var6 < var1.getFrameCount(); ++var6) { -- if(var1.frameHasTime(var6)) { -+ for (int var6 = 0; var6 < par1AnimationMetadataSection.getFrameCount(); ++var6) { -+ if (par1AnimationMetadataSection.frameHasTime(var6)) { - JsonObject var7 = new JsonObject(); -- var7.addProperty("index", (Number)Integer.valueOf(var1.getFrameIndex(var6))); -- var7.addProperty("time", (Number)Integer.valueOf(var1.getFrameTimeSingle(var6))); -+ var7.addProperty("index", Integer.valueOf(par1AnimationMetadataSection.getFrameIndex(var6))); -+ var7.addProperty("time", Integer.valueOf(par1AnimationMetadataSection.getFrameTimeSingle(var6))); - var5.add(var7); - } else { -- var5.add(new JsonPrimitive(Integer.valueOf(var1.getFrameIndex(var6)))); -+ var5.add(new JsonPrimitive(Integer.valueOf(par1AnimationMetadataSection.getFrameIndex(var6)))); - } - } - -@@ -87,15 +90,18 @@ - return var4; - } - -+ /** -+ * The name of this section type as it appears in JSON. -+ */ - public String getSectionName() { - return "animation"; - } - -- public Object deserialize(JsonElement var1, Type var2, JsonDeserializationContext var3) { -- return this.func_110493_a(var1, var2, var3); -+ public Object deserialize(JsonElement par1JsonElement, Type par2Type, JsonDeserializationContext par3JsonDeserializationContext) { -+ return this.func_110493_a(par1JsonElement, par2Type, par3JsonDeserializationContext); - } - -- public JsonElement serialize(Object var1, Type var2, JsonSerializationContext var3) { -- return this.func_110491_a((AnimationMetadataSection)var1, var2, var3); -+ public JsonElement serialize(Object par1Obj, Type par2Type, JsonSerializationContext par3JsonSerializationContext) { -+ return this.func_110491_a((AnimationMetadataSection)par1Obj, par2Type, par3JsonSerializationContext); - } - } ---- /dev/null -+++ org/spoutcraft/client/gui/settings/controls/MusicSlider.java -@@ -1,0 +1,43 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.client.gui.settings.controls; -+ -+import net.minecraft.src.Minecraft; -+ -+import org.spoutcraft.api.gui.GenericSlider; -+ -+public class MusicSlider extends GenericSlider { -+ public MusicSlider() { -+ super("Music"); -+ setSliderPosition(Minecraft.getMinecraft().gameSettings.musicVolume); -+ setTooltip("Music Volume\nControls the volume of all the music in game."); -+ } -+ -+ @Override -+ public void onSliderDrag(float old, float newPos) { -+ Minecraft.getMinecraft().gameSettings.musicVolume = newPos; -+ Minecraft.getMinecraft().gameSettings.saveOptions(); -+ Minecraft.getMinecraft().sndManager.onSoundOptionsChanged(); -+ } -+ -+ public String getText() { -+ return "Music: " + (this.getSliderPosition() > 0F ? (int)(this.getSliderPosition() * 100) + "%" : "OFF"); -+ } -+} ---- net/minecraft/src/FolderResourcePack.java -+++ net/minecraft/src/FolderResourcePack.java -@@ -11,29 +11,31 @@ - import org.apache.commons.io.filefilter.DirectoryFileFilter; - - public class FolderResourcePack extends AbstractResourcePack { -- public FolderResourcePack(File var1) { -- super(var1); -- } -- -- protected InputStream getInputStreamByName(String var1) throws IOException { -- return new BufferedInputStream(new FileInputStream(new File(this.b, var1))); -- } -- -- protected boolean hasResourceName(String var1) { -- return (new File(this.b, var1)).isFile(); -+ public FolderResourcePack(File par1File) { -+ super(par1File); -+ } -+ -+ protected InputStream getInputStreamByName(String par1Str) throws IOException { -+ return new BufferedInputStream(new FileInputStream(new File(this.resourcePackFile, par1Str))); -+ } -+ -+ protected boolean hasResourceName(String par1Str) { -+ return (new File(this.resourcePackFile, par1Str)).isFile(); - } - - public Set getResourceDomains() { - HashSet var1 = Sets.newHashSet(); -- File var2 = new File(this.b, "assets/"); -- if(var2.isDirectory()) { -- File[] var3 = var2.listFiles(DirectoryFileFilter.DIRECTORY); -+ File var2 = new File(this.resourcePackFile, "assets/"); -+ -+ if (var2.isDirectory()) { -+ File[] var3 = var2.listFiles((java.io.FileFilter)DirectoryFileFilter.DIRECTORY); - int var4 = var3.length; - -- for(int var5 = 0; var5 < var4; ++var5) { -+ for (int var5 = 0; var5 < var4; ++var5) { - File var6 = var3[var5]; - String var7 = getRelativeName(var2, var6); -- if(!var7.equals(var7.toLowerCase())) { -+ -+ if (!var7.equals(var7.toLowerCase())) { - this.logNameNotLowercase(var7); - } else { - var1.add(var7.substring(0, var7.length() - 1)); ---- net/minecraft/src/EntityPotion.java -+++ net/minecraft/src/EntityPotion.java -@@ -4,30 +4,37 @@ - import java.util.List; - - public class EntityPotion extends EntityThrowable { -+ -+ /** -+ * The damage value of the thrown potion that this EntityPotion represents. -+ */ - private ItemStack potionDamage; - -- public EntityPotion(World var1) { -- super(var1); -- } -- -- public EntityPotion(World var1, EntityLivingBase var2, int var3) { -- this(var1, var2, new ItemStack(Item.potion, 1, var3)); -- } -- -- public EntityPotion(World var1, EntityLivingBase var2, ItemStack var3) { -- super(var1, var2); -- this.potionDamage = var3; -- } -- -- public EntityPotion(World var1, double var2, double var4, double var6, int var8) { -- this(var1, var2, var4, var6, new ItemStack(Item.potion, 1, var8)); -- } -- -- public EntityPotion(World var1, double var2, double var4, double var6, ItemStack var8) { -- super(var1, var2, var4, var6); -- this.potionDamage = var8; -- } -- -+ public EntityPotion(World par1World) { -+ super(par1World); -+ } -+ -+ public EntityPotion(World par1World, EntityLivingBase par2EntityLivingBase, int par3) { -+ this(par1World, par2EntityLivingBase, new ItemStack(Item.potion, 1, par3)); -+ } -+ -+ public EntityPotion(World par1World, EntityLivingBase par2EntityLivingBase, ItemStack par3ItemStack) { -+ super(par1World, par2EntityLivingBase); -+ this.potionDamage = par3ItemStack; -+ } -+ -+ public EntityPotion(World par1World, double par2, double par4, double par6, int par8) { -+ this(par1World, par2, par4, par6, new ItemStack(Item.potion, 1, par8)); -+ } -+ -+ public EntityPotion(World par1World, double par2, double par4, double par6, ItemStack par8ItemStack) { -+ super(par1World, par2, par4, par6); -+ this.potionDamage = par8ItemStack; -+ } -+ -+ /** -+ * Gets the amount of gravity to apply to the thrown entity with each tick. -+ */ - protected float getGravityVelocity() { - return 0.05F; - } -@@ -40,60 +47,64 @@ - return -20.0F; - } - -- public void setPotionDamage(int var1) { -- if(this.potionDamage == null) { -+ public void setPotionDamage(int par1) { -+ if (this.potionDamage == null) { - this.potionDamage = new ItemStack(Item.potion, 1, 0); - } - -- this.potionDamage.setItemDamage(var1); -+ this.potionDamage.setItemDamage(par1); - } - -+ /** -+ * Returns the damage value of the thrown potion that this EntityPotion represents. -+ */ - public int getPotionDamage() { -- if(this.potionDamage == null) { -+ if (this.potionDamage == null) { - this.potionDamage = new ItemStack(Item.potion, 1, 0); - } - - return this.potionDamage.getItemDamage(); - } - -- protected void onImpact(MovingObjectPosition var1) { -- if(!this.worldObj.isRemote) { -+ /** -+ * Called when this EntityThrowable hits a block or entity. -+ */ -+ protected void onImpact(MovingObjectPosition par1MovingObjectPosition) { -+ if (!this.worldObj.isRemote) { - List var2 = Item.potion.getEffects(this.potionDamage); -- if(var2 != null && !var2.isEmpty()) { -+ -+ if (var2 != null && !var2.isEmpty()) { - AxisAlignedBB var3 = this.boundingBox.expand(4.0D, 2.0D, 4.0D); - List var4 = this.worldObj.getEntitiesWithinAABB(EntityLivingBase.class, var3); -- if(var4 != null && !var4.isEmpty()) { -+ -+ if (var4 != null && !var4.isEmpty()) { - Iterator var5 = var4.iterator(); - -- label48: -- while(true) { -- EntityLivingBase var6; -- double var7; -- do { -- if(!var5.hasNext()) { -- break label48; -+ while (var5.hasNext()) { -+ EntityLivingBase var6 = (EntityLivingBase)var5.next(); -+ double var7 = this.getDistanceSqToEntity(var6); -+ -+ if (var7 < 16.0D) { -+ double var9 = 1.0D - Math.sqrt(var7) / 4.0D; -+ -+ if (var6 == par1MovingObjectPosition.entityHit) { -+ var9 = 1.0D; - } - -- var6 = (EntityLivingBase)var5.next(); -- var7 = this.getDistanceSqToEntity(var6); -- } while(var7 >= 16.0D); -- -- double var9 = 1.0D - Math.sqrt(var7) / 4.0D; -- if(var6 == var1.entityHit) { -- var9 = 1.0D; -- } -- -- Iterator var11 = var2.iterator(); -- -- while(var11.hasNext()) { -- PotionEffect var12 = (PotionEffect)var11.next(); -- int var13 = var12.getPotionID(); -- if(Potion.potionTypes[var13].isInstant()) { -- Potion.potionTypes[var13].affectEntity(this.getThrower(), var6, var12.getAmplifier(), var9); -- } else { -- int var14 = (int)(var9 * (double)var12.getDuration() + 0.5D); -- if(var14 > 20) { -- var6.addPotionEffect(new PotionEffect(var13, var14, var12.getAmplifier())); -+ Iterator var11 = var2.iterator(); -+ -+ while (var11.hasNext()) { -+ PotionEffect var12 = (PotionEffect)var11.next(); -+ int var13 = var12.getPotionID(); -+ -+ if (Potion.potionTypes[var13].isInstant()) { -+ Potion.potionTypes[var13].affectEntity(this.getThrower(), var6, var12.getAmplifier(), var9); -+ } else { -+ int var14 = (int)(var9 * (double)var12.getDuration() + 0.5D); -+ -+ if (var14 > 20) { -+ var6.addPotionEffect(new PotionEffect(var13, var14, var12.getAmplifier())); -+ } - } - } - } -@@ -104,28 +115,33 @@ - this.worldObj.playAuxSFX(2002, (int)Math.round(this.posX), (int)Math.round(this.posY), (int)Math.round(this.posZ), this.getPotionDamage()); - this.setDead(); - } -- - } - -- public void readEntityFromNBT(NBTTagCompound var1) { -- super.readEntityFromNBT(var1); -- if(var1.hasKey("Potion")) { -- this.potionDamage = ItemStack.loadItemStackFromNBT(var1.getCompoundTag("Potion")); -+ /** -+ * (abstract) Protected helper method to read subclass entity data from NBT. -+ */ -+ public void readEntityFromNBT(NBTTagCompound par1NBTTagCompound) { -+ super.readEntityFromNBT(par1NBTTagCompound); -+ -+ if (par1NBTTagCompound.hasKey("Potion")) { -+ this.potionDamage = ItemStack.loadItemStackFromNBT(par1NBTTagCompound.getCompoundTag("Potion")); - } else { -- this.setPotionDamage(var1.getInteger("potionValue")); -+ this.setPotionDamage(par1NBTTagCompound.getInteger("potionValue")); - } - -- if(this.potionDamage == null) { -+ if (this.potionDamage == null) { - this.setDead(); - } -- - } - -- public void writeEntityToNBT(NBTTagCompound var1) { -- super.writeEntityToNBT(var1); -- if(this.potionDamage != null) { -- var1.setCompoundTag("Potion", this.potionDamage.writeToNBT(new NBTTagCompound())); -- } -+ /** -+ * (abstract) Protected helper method to write subclass entity data to NBT. -+ */ -+ public void writeEntityToNBT(NBTTagCompound par1NBTTagCompound) { -+ super.writeEntityToNBT(par1NBTTagCompound); - -+ if (this.potionDamage != null) { -+ par1NBTTagCompound.setCompoundTag("Potion", this.potionDamage.writeToNBT(new NBTTagCompound())); -+ } - } - } ---- net/minecraft/src/SlotCrafting.java -+++ net/minecraft/src/SlotCrafting.java -@@ -1,71 +1,95 @@ - package net.minecraft.src; - - public class SlotCrafting extends Slot { -+ -+ /** The craft matrix inventory linked to this result slot. */ - private final IInventory craftMatrix; -+ -+ /** The player that is using the GUI where this slot resides. */ - private EntityPlayer thePlayer; -+ -+ /** -+ * The number of items that have been crafted so far. Gets passed to ItemStack.onCrafting before being reset. -+ */ - private int amountCrafted; - -- public SlotCrafting(EntityPlayer var1, IInventory var2, IInventory var3, int var4, int var5, int var6) { -- super(var3, var4, var5, var6); -- this.thePlayer = var1; -- this.craftMatrix = var2; -+ public SlotCrafting(EntityPlayer par1EntityPlayer, IInventory par2IInventory, IInventory par3IInventory, int par4, int par5, int par6) { -+ super(par3IInventory, par4, par5, par6); -+ this.thePlayer = par1EntityPlayer; -+ this.craftMatrix = par2IInventory; - } - -- public boolean isItemValid(ItemStack var1) { -+ /** -+ * Check if the stack is a valid item for this slot. Always true beside for the armor slots. -+ */ -+ public boolean isItemValid(ItemStack par1ItemStack) { - return false; - } - -- public ItemStack decrStackSize(int var1) { -- if(this.getHasStack()) { -- this.amountCrafted += Math.min(var1, this.getStack().stackSize); -+ /** -+ * Decrease the size of the stack in slot (first int arg) by the amount of the second int arg. Returns the new stack. -+ */ -+ public ItemStack decrStackSize(int par1) { -+ if (this.getHasStack()) { -+ this.amountCrafted += Math.min(par1, this.getStack().stackSize); - } - -- return super.decrStackSize(var1); -- } -- -- protected void onCrafting(ItemStack var1, int var2) { -- this.amountCrafted += var2; -- this.onCrafting(var1); -- } -- -- protected void onCrafting(ItemStack var1) { -- var1.onCrafting(this.thePlayer.worldObj, this.thePlayer, this.amountCrafted); -+ return super.decrStackSize(par1); -+ } -+ -+ /** -+ * the itemStack passed in is the output - ie, iron ingots, and pickaxes, not ore and wood. Typically increases an -+ * internal count then calls onCrafting(item). -+ */ -+ protected void onCrafting(ItemStack par1ItemStack, int par2) { -+ this.amountCrafted += par2; -+ this.onCrafting(par1ItemStack); -+ } -+ -+ /** -+ * the itemStack passed in is the output - ie, iron ingots, and pickaxes, not ore and wood. -+ */ -+ protected void onCrafting(ItemStack par1ItemStack) { -+ par1ItemStack.onCrafting(this.thePlayer.worldObj, this.thePlayer, this.amountCrafted); - this.amountCrafted = 0; -- if(var1.itemID == Block.workbench.blockID) { -+ -+ if (par1ItemStack.itemID == Block.workbench.blockID) { - this.thePlayer.addStat(AchievementList.buildWorkBench, 1); -- } else if(var1.itemID == Item.pickaxeWood.itemID) { -+ } else if (par1ItemStack.itemID == Item.pickaxeWood.itemID) { - this.thePlayer.addStat(AchievementList.buildPickaxe, 1); -- } else if(var1.itemID == Block.furnaceIdle.blockID) { -+ } else if (par1ItemStack.itemID == Block.furnaceIdle.blockID) { - this.thePlayer.addStat(AchievementList.buildFurnace, 1); -- } else if(var1.itemID == Item.hoeWood.itemID) { -+ } else if (par1ItemStack.itemID == Item.hoeWood.itemID) { - this.thePlayer.addStat(AchievementList.buildHoe, 1); -- } else if(var1.itemID == Item.bread.itemID) { -+ } else if (par1ItemStack.itemID == Item.bread.itemID) { - this.thePlayer.addStat(AchievementList.makeBread, 1); -- } else if(var1.itemID == Item.cake.itemID) { -+ } else if (par1ItemStack.itemID == Item.cake.itemID) { - this.thePlayer.addStat(AchievementList.bakeCake, 1); -- } else if(var1.itemID == Item.pickaxeStone.itemID) { -+ } else if (par1ItemStack.itemID == Item.pickaxeStone.itemID) { - this.thePlayer.addStat(AchievementList.buildBetterPickaxe, 1); -- } else if(var1.itemID == Item.swordWood.itemID) { -+ } else if (par1ItemStack.itemID == Item.swordWood.itemID) { - this.thePlayer.addStat(AchievementList.buildSword, 1); -- } else if(var1.itemID == Block.enchantmentTable.blockID) { -+ } else if (par1ItemStack.itemID == Block.enchantmentTable.blockID) { - this.thePlayer.addStat(AchievementList.enchantments, 1); -- } else if(var1.itemID == Block.bookShelf.blockID) { -+ } else if (par1ItemStack.itemID == Block.bookShelf.blockID) { - this.thePlayer.addStat(AchievementList.bookcase, 1); - } -- - } - -- public void onPickupFromSlot(EntityPlayer var1, ItemStack var2) { -- this.onCrafting(var2); -+ public void onPickupFromSlot(EntityPlayer par1EntityPlayer, ItemStack par2ItemStack) { -+ this.onCrafting(par2ItemStack); - -- for(int var3 = 0; var3 < this.craftMatrix.getSizeInventory(); ++var3) { -+ for (int var3 = 0; var3 < this.craftMatrix.getSizeInventory(); ++var3) { - ItemStack var4 = this.craftMatrix.getStackInSlot(var3); -- if(var4 != null) { -+ -+ if (var4 != null) { - this.craftMatrix.decrStackSize(var3, 1); -- if(var4.getItem().hasContainerItem()) { -+ -+ if (var4.getItem().hasContainerItem()) { - ItemStack var5 = new ItemStack(var4.getItem().getContainerItem()); -- if(!var4.getItem().doesContainerItemLeaveCraftingGrid(var4) || !this.thePlayer.inventory.addItemStackToInventory(var5)) { -- if(this.craftMatrix.getStackInSlot(var3) == null) { -+ -+ if (!var4.getItem().doesContainerItemLeaveCraftingGrid(var4) || !this.thePlayer.inventory.addItemStackToInventory(var5)) { -+ if (this.craftMatrix.getStackInSlot(var3) == null) { - this.craftMatrix.setInventorySlotContents(var3, var5); - } else { - this.thePlayer.dropPlayerItem(var5); -@@ -74,6 +98,5 @@ - } - } - } -- - } - } ---- net/minecraft/src/Packet22Collect.java -+++ net/minecraft/src/Packet22Collect.java -@@ -5,31 +5,46 @@ - import java.io.IOException; - - public class Packet22Collect extends Packet { -+ -+ /** The entity on the ground that was picked up. */ - public int collectedEntityId; -+ -+ /** The entity that picked up the one from the ground. */ - public int collectorEntityId; - -- public Packet22Collect() { -- } -- -- public Packet22Collect(int var1, int var2) { -- this.collectedEntityId = var1; -- this.collectorEntityId = var2; -- } -- -- public void readPacketData(DataInput var1) throws IOException { -- this.collectedEntityId = var1.readInt(); -- this.collectorEntityId = var1.readInt(); -- } -- -- public void writePacketData(DataOutput var1) throws IOException { -- var1.writeInt(this.collectedEntityId); -- var1.writeInt(this.collectorEntityId); -- } -- -- public void processPacket(NetHandler var1) { -- var1.handleCollect(this); -- } -- -+ public Packet22Collect() {} -+ -+ public Packet22Collect(int par1, int par2) { -+ this.collectedEntityId = par1; -+ this.collectorEntityId = par2; -+ } -+ -+ /** -+ * Abstract. Reads the raw packet data from the data stream. -+ */ -+ public void readPacketData(DataInput par1DataInput) throws IOException { -+ this.collectedEntityId = par1DataInput.readInt(); -+ this.collectorEntityId = par1DataInput.readInt(); -+ } -+ -+ /** -+ * Abstract. Writes the raw packet data to the data stream. -+ */ -+ public void writePacketData(DataOutput par1DataOutput) throws IOException { -+ par1DataOutput.writeInt(this.collectedEntityId); -+ par1DataOutput.writeInt(this.collectorEntityId); -+ } -+ -+ /** -+ * Passes this Packet on to the NetHandler for processing. -+ */ -+ public void processPacket(NetHandler par1NetHandler) { -+ par1NetHandler.handleCollect(this); -+ } -+ -+ /** -+ * Abstract. Return the size of the packet (not counting the header). -+ */ - public int getPacketSize() { - return 8; - } ---- /dev/null -+++ org/spoutcraft/api/block/design/Texture.java -@@ -1,0 +1,77 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.api.block.design; -+ -+import java.util.ArrayList; -+import java.util.List; -+ -+public class Texture { -+ public String texture; -+ public String addon; -+ public int width; -+ public int height; -+ public int spriteSize; -+ -+ public List subTextures; -+ -+ public Texture(String addon, String texture, int width, int height, int spriteSize) { -+ this.texture = texture; -+ this.addon = addon; -+ this.width = width; -+ this.height = height; -+ this.spriteSize = spriteSize; -+ -+ int amount = (width / spriteSize) * (height / spriteSize); -+ -+ subTextures = new ArrayList(amount); -+ -+ int count = 0; -+ for (int y = (height / spriteSize) - 1; y >= 0; y--) { -+ for (int x = 0; x < width / spriteSize; x++) { -+ subTextures.add(count, new SubTexture(this, x * spriteSize, y * spriteSize, spriteSize)); -+ count++; -+ } -+ } -+ } -+ -+ public SubTexture getSubTexture(int textureId) { -+ return subTextures.get(textureId); -+ } -+ -+ public String getTexture() { -+ return texture; -+ } -+ -+ public int getSpriteSize() { -+ return spriteSize; -+ } -+ -+ public int getWidth() { -+ return width; -+ } -+ -+ public int getHeight() { -+ return height; -+ } -+ -+ public String getAddon() { -+ return addon; -+ } -+} ---- net/minecraft/src/Packet53BlockChange.java -+++ net/minecraft/src/Packet53BlockChange.java -@@ -5,45 +5,67 @@ - import java.io.IOException; - - public class Packet53BlockChange extends Packet { -+ -+ /** Block X position. */ - public int xPosition; -+ -+ /** Block Y position. */ - public int yPosition; -+ -+ /** Block Z position. */ - public int zPosition; -+ -+ /** The new block type for the block. */ - public int type; -+ -+ /** Metadata of the block. */ - public int metadata; - - public Packet53BlockChange() { - this.isChunkDataPacket = true; - } - -- public Packet53BlockChange(int var1, int var2, int var3, World var4) { -+ public Packet53BlockChange(int par1, int par2, int par3, World par4World) { - this.isChunkDataPacket = true; -- this.xPosition = var1; -- this.yPosition = var2; -- this.zPosition = var3; -- this.type = var4.getBlockId(var1, var2, var3); -- this.metadata = var4.getBlockMetadata(var1, var2, var3); -- } -- -- public void readPacketData(DataInput var1) throws IOException { -- this.xPosition = var1.readInt(); -- this.yPosition = var1.readUnsignedByte(); -- this.zPosition = var1.readInt(); -- this.type = var1.readShort(); -- this.metadata = var1.readUnsignedByte(); -- } -- -- public void writePacketData(DataOutput var1) throws IOException { -- var1.writeInt(this.xPosition); -- var1.write(this.yPosition); -- var1.writeInt(this.zPosition); -- var1.writeShort(this.type); -- var1.write(this.metadata); -- } -- -- public void processPacket(NetHandler var1) { -- var1.handleBlockChange(this); -- } -- -+ this.xPosition = par1; -+ this.yPosition = par2; -+ this.zPosition = par3; -+ this.type = par4World.getBlockId(par1, par2, par3); -+ this.metadata = par4World.getBlockMetadata(par1, par2, par3); -+ } -+ -+ /** -+ * Abstract. Reads the raw packet data from the data stream. -+ */ -+ public void readPacketData(DataInput par1DataInput) throws IOException { -+ this.xPosition = par1DataInput.readInt(); -+ this.yPosition = par1DataInput.readUnsignedByte(); -+ this.zPosition = par1DataInput.readInt(); -+ this.type = par1DataInput.readShort(); -+ this.metadata = par1DataInput.readUnsignedByte(); -+ } -+ -+ /** -+ * Abstract. Writes the raw packet data to the data stream. -+ */ -+ public void writePacketData(DataOutput par1DataOutput) throws IOException { -+ par1DataOutput.writeInt(this.xPosition); -+ par1DataOutput.write(this.yPosition); -+ par1DataOutput.writeInt(this.zPosition); -+ par1DataOutput.writeShort(this.type); -+ par1DataOutput.write(this.metadata); -+ } -+ -+ /** -+ * Passes this Packet on to the NetHandler for processing. -+ */ -+ public void processPacket(NetHandler par1NetHandler) { -+ par1NetHandler.handleBlockChange(this); -+ } -+ -+ /** -+ * Abstract. Return the size of the packet (not counting the header). -+ */ - public int getPacketSize() { - return 11; - } ---- /dev/null -+++ org/spoutcraft/client/player/SimpleSkyManager.java -@@ -1,0 +1,188 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.client.player; -+ -+import net.minecraft.src.Minecraft; -+ -+import org.spoutcraft.api.gui.Color; -+import org.spoutcraft.api.player.SkyManager; -+import org.spoutcraft.client.SpoutClient; -+import org.spoutcraft.client.io.CustomTextureManager; -+ -+public class SimpleSkyManager implements SkyManager { -+ private int cloudHeight = -999; -+ private int starFrequency = 1500; -+ private int sunPercent = 100; -+ private int moonPercent = 100; -+ private String sunUrl = null; -+ private String moonUrl = null; -+ private Color skyColor = null, fogColor = null, cloudColor = null; -+ -+ public int getCloudHeight() { -+ if (cloudHeight == -999) { -+ return (int)SpoutClient.getHandle().theWorld.provider.getCloudHeight(); -+ } -+ return cloudHeight; -+ } -+ -+ public void setCloudHeight(int y) { -+ this.cloudHeight = y; -+ } -+ -+ public boolean isCloudsVisible() { -+ return getCloudHeight() > -1; -+ } -+ -+ public void setCloudsVisible(boolean visible) { -+ if (isCloudsVisible() != visible) { -+ setCloudHeight(visible ? 108 : -1); -+ } -+ } -+ -+ public int getStarFrequency() { -+ return starFrequency; -+ } -+ -+ public void setStarFrequency(int frequency) { -+ starFrequency = frequency; -+ starFrequency = Math.min(starFrequency, 1000000); -+ Minecraft.getMinecraft().renderGlobal.refreshStars(); -+ } -+ -+ public boolean isStarsVisible() { -+ return starFrequency > -1; -+ } -+ -+ public void setStarsVisible(boolean visible) { -+ if (isStarsVisible() != visible) { -+ setStarFrequency(visible ? 1500 : -1); -+ } -+ } -+ -+ public int getSunSizePercent() { -+ return sunPercent; -+ } -+ -+ public void setSunSizePercent(int percent) { -+ sunPercent = percent; -+ } -+ -+ public boolean isSunVisible() { -+ return sunPercent > -1; -+ } -+ -+ public void setSunVisible(boolean visible) { -+ if (isSunVisible() != visible) { -+ setSunSizePercent(visible ? 100 : -1); -+ } -+ } -+ -+ public String getSunTextureUrl() { -+ return sunUrl; -+ } -+ -+ public void setSunTextureUrl(String Url) { -+ if (sunUrl != null) { -+ // TODO release image? -+ } -+ sunUrl = Url; -+ if (Url != null) { -+ CustomTextureManager.downloadTexture(Url); -+ } -+ } -+ -+ public int getMoonSizePercent() { -+ return moonPercent; -+ } -+ -+ public void setMoonSizePercent(int percent) { -+ moonPercent = percent; -+ } -+ -+ public boolean isMoonVisible() { -+ return moonPercent > -1; -+ } -+ -+ public void setMoonVisible(boolean visible) { -+ if (isMoonVisible() != visible) { -+ setMoonSizePercent(visible ? 100 : -1); -+ } -+ } -+ -+ public String getMoonTextureUrl() { -+ return moonUrl; -+ } -+ -+ public void setMoonTextureUrl(String Url) { -+ if (moonUrl != null) { -+ // TODO release image? -+ } -+ moonUrl = Url; -+ if (Url != null) { -+ CustomTextureManager.downloadTexture(Url); -+ } -+ } -+ -+ public void setSkyColor(float red, float green, float blue) { -+ skyColor.setRed(red).setGreen(green).setBlue(blue); -+ } -+ -+ public void setSkyColor(Color color) { -+ if (color!=null) { -+ skyColor = color.clone(); -+ } else { -+ skyColor = null; -+ } -+ } -+ -+ public Color getSkyColor() { -+ if (skyColor == null) { -+ return null; -+ } -+ return skyColor.clone(); -+ } -+ -+ public void setFogColor(Color color) { -+ if (color!=null) { -+ this.fogColor = color.clone(); -+ } else { -+ fogColor = null; -+ } -+ } -+ -+ public Color getFogColor() { -+ if (fogColor == null) { -+ return null; -+ } -+ return fogColor.clone(); -+ } -+ -+ public void setCloudColor(Color color) { -+ if (color!=null) { -+ this.cloudColor = color.clone(); -+ } else { -+ cloudColor = null; -+ } -+ } -+ -+ public Color getCloudColor() { -+ return this.cloudColor; -+ } -+} ---- net/minecraft/src/BlockRailBase.java -+++ net/minecraft/src/BlockRailBase.java -@@ -3,143 +3,201 @@ - import java.util.Random; - - public abstract class BlockRailBase extends Block { -+ -+ /** Power related rails have this field at true. */ - protected final boolean isPowered; - -- public static final boolean isRailBlockAt(World var0, int var1, int var2, int var3) { -- return isRailBlock(var0.getBlockId(var1, var2, var3)); -- } -- -- public static final boolean isRailBlock(int var0) { -- return var0 == Block.rail.blockID || var0 == Block.railPowered.blockID || var0 == Block.railDetector.blockID || var0 == Block.railActivator.blockID; -- } -- -- protected BlockRailBase(int var1, boolean var2) { -- super(var1, Material.circuits); -- this.isPowered = var2; -- this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 2.0F / 16.0F, 1.0F); -+ /** -+ * Returns true if the block at the coordinates of world passed is a valid rail block (current is rail, powered or -+ * detector). -+ */ -+ public static final boolean isRailBlockAt(World par0World, int par1, int par2, int par3) { -+ return isRailBlock(par0World.getBlockId(par1, par2, par3)); -+ } -+ -+ /** -+ * Return true if the parameter is a blockID for a valid rail block (current is rail, powered or detector). -+ */ -+ public static final boolean isRailBlock(int par0) { -+ return par0 == Block.rail.blockID || par0 == Block.railPowered.blockID || par0 == Block.railDetector.blockID || par0 == Block.railActivator.blockID; -+ } -+ -+ protected BlockRailBase(int par1, boolean par2) { -+ super(par1, Material.circuits); -+ this.isPowered = par2; -+ this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.125F, 1.0F); - this.setCreativeTab(CreativeTabs.tabTransport); - } - -+ /** -+ * Returns true if the block is power related rail. -+ */ - public boolean isPowered() { - return this.isPowered; - } - -- public AxisAlignedBB getCollisionBoundingBoxFromPool(World var1, int var2, int var3, int var4) { -+ /** -+ * Returns a bounding box from the pool of bounding boxes (this means this box can change after the pool has been -+ * cleared to be reused) -+ */ -+ public AxisAlignedBB getCollisionBoundingBoxFromPool(World par1World, int par2, int par3, int par4) { - return null; - } - -+ /** -+ * Is this block (a) opaque and (b) a full 1m cube? This determines whether or not to render the shared face of two -+ * adjacent blocks and also whether the player can attach torches, redstone wire, etc to this block. -+ */ - public boolean isOpaqueCube() { - return false; - } - -- public MovingObjectPosition collisionRayTrace(World var1, int var2, int var3, int var4, Vec3 var5, Vec3 var6) { -- this.setBlockBoundsBasedOnState(var1, var2, var3, var4); -- return super.collisionRayTrace(var1, var2, var3, var4, var5, var6); -+ /** -+ * Ray traces through the blocks collision from start vector to end vector returning a ray trace hit. Args: world, x, -+ * y, z, startVec, endVec -+ */ -+ public MovingObjectPosition collisionRayTrace(World par1World, int par2, int par3, int par4, Vec3 par5Vec3, Vec3 par6Vec3) { -+ this.setBlockBoundsBasedOnState(par1World, par2, par3, par4); -+ return super.collisionRayTrace(par1World, par2, par3, par4, par5Vec3, par6Vec3); - } - -- public void setBlockBoundsBasedOnState(IBlockAccess var1, int var2, int var3, int var4) { -- int var5 = var1.getBlockMetadata(var2, var3, var4); -- if(var5 >= 2 && var5 <= 5) { -- this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 10.0F / 16.0F, 1.0F); -+ /** -+ * Updates the blocks bounds based on its current state. Args: world, x, y, z -+ */ -+ public void setBlockBoundsBasedOnState(IBlockAccess par1IBlockAccess, int par2, int par3, int par4) { -+ int var5 = par1IBlockAccess.getBlockMetadata(par2, par3, par4); -+ -+ if (var5 >= 2 && var5 <= 5) { -+ this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.625F, 1.0F); - } else { -- this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 2.0F / 16.0F, 1.0F); -+ this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.125F, 1.0F); - } -- - } - -+ /** -+ * If this block doesn't render as an ordinary block it will return False (examples: signs, buttons, stairs, etc) -+ */ - public boolean renderAsNormalBlock() { - return false; - } - -+ /** -+ * The type of render function that is called for this block -+ */ - public int getRenderType() { - return 9; - } - -- public int quantityDropped(Random var1) { -+ /** -+ * Returns the quantity of items to drop on block destruction. -+ */ -+ public int quantityDropped(Random par1Random) { - return 1; - } - -- public boolean canPlaceBlockAt(World var1, int var2, int var3, int var4) { -- return var1.doesBlockHaveSolidTopSurface(var2, var3 - 1, var4); -+ /** -+ * Checks to see if its valid to put this block at the specified coordinates. Args: world, x, y, z -+ */ -+ public boolean canPlaceBlockAt(World par1World, int par2, int par3, int par4) { -+ return par1World.doesBlockHaveSolidTopSurface(par2, par3 - 1, par4); - } - -- public void onBlockAdded(World var1, int var2, int var3, int var4) { -- if(!var1.isRemote) { -- this.refreshTrackShape(var1, var2, var3, var4, true); -- if(this.isPowered) { -- this.onNeighborBlockChange(var1, var2, var3, var4, this.blockID); -+ /** -+ * Called whenever the block is added into the world. Args: world, x, y, z -+ */ -+ public void onBlockAdded(World par1World, int par2, int par3, int par4) { -+ if (!par1World.isRemote) { -+ this.refreshTrackShape(par1World, par2, par3, par4, true); -+ -+ if (this.isPowered) { -+ this.onNeighborBlockChange(par1World, par2, par3, par4, this.blockID); - } - } -- - } - -- public void onNeighborBlockChange(World var1, int var2, int var3, int var4, int var5) { -- if(!var1.isRemote) { -- int var6 = var1.getBlockMetadata(var2, var3, var4); -+ /** -+ * Lets the block know when one of its neighbor changes. Doesn't know which neighbor changed (coordinates passed are -+ * their own) Args: x, y, z, neighbor blockID -+ */ -+ public void onNeighborBlockChange(World par1World, int par2, int par3, int par4, int par5) { -+ if (!par1World.isRemote) { -+ int var6 = par1World.getBlockMetadata(par2, par3, par4); - int var7 = var6; -- if(this.isPowered) { -+ -+ if (this.isPowered) { - var7 = var6 & 7; - } - - boolean var8 = false; -- if(!var1.doesBlockHaveSolidTopSurface(var2, var3 - 1, var4)) { -- var8 = true; -- } -- -- if(var7 == 2 && !var1.doesBlockHaveSolidTopSurface(var2 + 1, var3, var4)) { -- var8 = true; -- } -- -- if(var7 == 3 && !var1.doesBlockHaveSolidTopSurface(var2 - 1, var3, var4)) { -- var8 = true; -- } -- -- if(var7 == 4 && !var1.doesBlockHaveSolidTopSurface(var2, var3, var4 - 1)) { -- var8 = true; -- } -- -- if(var7 == 5 && !var1.doesBlockHaveSolidTopSurface(var2, var3, var4 + 1)) { -- var8 = true; -- } -- -- if(var8) { -- this.dropBlockAsItem(var1, var2, var3, var4, var1.getBlockMetadata(var2, var3, var4), 0); -- var1.setBlockToAir(var2, var3, var4); -+ -+ if (!par1World.doesBlockHaveSolidTopSurface(par2, par3 - 1, par4)) { -+ var8 = true; -+ } -+ -+ if (var7 == 2 && !par1World.doesBlockHaveSolidTopSurface(par2 + 1, par3, par4)) { -+ var8 = true; -+ } -+ -+ if (var7 == 3 && !par1World.doesBlockHaveSolidTopSurface(par2 - 1, par3, par4)) { -+ var8 = true; -+ } -+ -+ if (var7 == 4 && !par1World.doesBlockHaveSolidTopSurface(par2, par3, par4 - 1)) { -+ var8 = true; -+ } -+ -+ if (var7 == 5 && !par1World.doesBlockHaveSolidTopSurface(par2, par3, par4 + 1)) { -+ var8 = true; -+ } -+ -+ if (var8) { -+ this.dropBlockAsItem(par1World, par2, par3, par4, par1World.getBlockMetadata(par2, par3, par4), 0); -+ par1World.setBlockToAir(par2, par3, par4); - } else { -- this.func_94358_a(var1, var2, var3, var4, var6, var7, var5); -+ this.func_94358_a(par1World, par2, par3, par4, var6, var7, par5); - } -- -- } -- } -- -- protected void func_94358_a(World var1, int var2, int var3, int var4, int var5, int var6, int var7) { -- } -- -- protected void refreshTrackShape(World var1, int var2, int var3, int var4, boolean var5) { -- if(!var1.isRemote) { -- (new BlockBaseRailLogic(this, var1, var2, var3, var4)).func_94511_a(var1.isBlockIndirectlyGettingPowered(var2, var3, var4), var5); -- } -- } -- -+ } -+ } -+ -+ protected void func_94358_a(World par1World, int par2, int par3, int par4, int par5, int par6, int par7) {} -+ -+ /** -+ * Completely recalculates the track shape based on neighboring tracks -+ */ -+ protected void refreshTrackShape(World par1World, int par2, int par3, int par4, boolean par5) { -+ if (!par1World.isRemote) { -+ (new BlockBaseRailLogic(this, par1World, par2, par3, par4)).func_94511_a(par1World.isBlockIndirectlyGettingPowered(par2, par3, par4), par5); -+ } -+ } -+ -+ /** -+ * Returns the mobility information of the block, 0 = free, 1 = can't push but can move over, 2 = total immobility and -+ * stop pistons -+ */ - public int getMobilityFlag() { - return 0; - } - -- public void breakBlock(World var1, int var2, int var3, int var4, int var5, int var6) { -- int var7 = var6; -- if(this.isPowered) { -- var7 = var6 & 7; -- } -- -- super.breakBlock(var1, var2, var3, var4, var5, var6); -- if(var7 == 2 || var7 == 3 || var7 == 4 || var7 == 5) { -- var1.notifyBlocksOfNeighborChange(var2, var3 + 1, var4, var5); -- } -- -- if(this.isPowered) { -- var1.notifyBlocksOfNeighborChange(var2, var3, var4, var5); -- var1.notifyBlocksOfNeighborChange(var2, var3 - 1, var4, var5); -- } -- -+ /** -+ * Called on server worlds only when the block has been replaced by a different block ID, or the same block with a -+ * different metadata value, but before the new metadata value is set. Args: World, x, y, z, old block ID, old metadata -+ */ -+ public void breakBlock(World par1World, int par2, int par3, int par4, int par5, int par6) { -+ int var7 = par6; -+ -+ if (this.isPowered) { -+ var7 = par6 & 7; -+ } -+ -+ super.breakBlock(par1World, par2, par3, par4, par5, par6); -+ -+ if (var7 == 2 || var7 == 3 || var7 == 4 || var7 == 5) { -+ par1World.notifyBlocksOfNeighborChange(par2, par3 + 1, par4, par5); -+ } -+ -+ if (this.isPowered) { -+ par1World.notifyBlocksOfNeighborChange(par2, par3, par4, par5); -+ par1World.notifyBlocksOfNeighborChange(par2, par3 - 1, par4, par5); -+ } - } - } ---- net/minecraft/src/RunnableTitleScreen.java -+++ net/minecraft/src/RunnableTitleScreen.java -@@ -5,18 +5,19 @@ - class RunnableTitleScreen extends Thread { - final GuiMainMenu theMainMenu; - -- RunnableTitleScreen(GuiMainMenu var1) { -- this.theMainMenu = var1; -+ RunnableTitleScreen(GuiMainMenu par1GuiMainMenu) { -+ this.theMainMenu = par1GuiMainMenu; - } - - public void run() { - McoClient var1 = new McoClient(GuiMainMenu.func_110348_a(this.theMainMenu).getSession()); - boolean var2 = false; - -- for(int var3 = 0; var3 < 3; ++var3) { -+ for (int var3 = 0; var3 < 3; ++var3) { - try { - Boolean var4 = var1.func_96375_b(); -- if(var4.booleanValue()) { -+ -+ if (var4.booleanValue()) { - GuiMainMenu.func_130021_b(this.theMainMenu); - } - -@@ -29,7 +30,7 @@ - GuiMainMenu.func_130019_d(this.theMainMenu).getLogAgent().logWarning("Realms: could not parse response"); - } - -- if(!var2) { -+ if (!var2) { - break; - } - -@@ -39,6 +40,5 @@ - Thread.currentThread().interrupt(); - } - } -- - } - } ---- net/minecraft/src/Packet51MapChunk.java -+++ net/minecraft/src/Packet51MapChunk.java -@@ -7,27 +7,54 @@ - import java.util.zip.Deflater; - import java.util.zip.Inflater; - -+import org.spoutcraft.client.SpoutClient; -+import org.spoutcraft.client.packet.PacketCustomBlockChunkOverride; -+ - public class Packet51MapChunk extends Packet { -+ -+ /** The x-position of the transmitted chunk, in chunk coordinates. */ - public int xCh; -+ -+ /** The z-position of the transmitted chunk, in chunk coordinates. */ - public int zCh; -+ -+ /** -+ * The y-position of the lowest chunk Section in the transmitted chunk, in chunk coordinates. -+ */ - public int yChMin; -+ -+ /** -+ * The y-position of the highest chunk Section in the transmitted chunk, in chunk coordinates. -+ */ - public int yChMax; -+ -+ /** The transmitted chunk data, decompressed. */ - private byte[] chunkData; -+ -+ /** The compressed chunk data */ - private byte[] compressedChunkData; -+ -+ /** -+ * Whether to initialize the Chunk before applying the effect of the Packet51MapChunk. -+ */ - public boolean includeInitialize; -+ -+ /** The length of the compressed chunk data byte array. */ - private int tempLength; -+ -+ /** A temporary storage for the compressed chunk data byte array. */ - private static byte[] temp = new byte[196864]; - - public Packet51MapChunk() { - this.isChunkDataPacket = true; - } - -- public Packet51MapChunk(Chunk var1, boolean var2, int var3) { -+ public Packet51MapChunk(Chunk par1Chunk, boolean par2, int par3) { - this.isChunkDataPacket = true; -- this.xCh = var1.xPosition; -- this.zCh = var1.zPosition; -- this.includeInitialize = var2; -- Packet51MapChunkData var4 = getMapChunkData(var1, var2, var3); -+ this.xCh = par1Chunk.xPosition; -+ this.zCh = par1Chunk.zPosition; -+ this.includeInitialize = par2; -+ Packet51MapChunkData var4 = getMapChunkData(par1Chunk, par2, par3); - Deflater var5 = new Deflater(-1); - this.yChMax = var4.chunkHasAddSectionFlag; - this.yChMin = var4.chunkExistFlag; -@@ -41,30 +68,36 @@ - } finally { - var5.end(); - } -- - } -+ // Spout Start -+ private static final byte[] inflateBuffer = new byte[196864]; -+ // Spout End -+ /** -+ * Abstract. Reads the raw packet data from the data stream. -+ */ -+ public void readPacketData(DataInput par1DataInput) throws IOException { -+ this.xCh = par1DataInput.readInt(); -+ this.zCh = par1DataInput.readInt(); -+ this.includeInitialize = par1DataInput.readBoolean(); -+ this.yChMin = par1DataInput.readShort(); -+ this.yChMax = par1DataInput.readShort(); -+ this.tempLength = par1DataInput.readInt(); - -- public void readPacketData(DataInput var1) throws IOException { -- this.xCh = var1.readInt(); -- this.zCh = var1.readInt(); -- this.includeInitialize = var1.readBoolean(); -- this.yChMin = var1.readShort(); -- this.yChMax = var1.readShort(); -- this.tempLength = var1.readInt(); -- if(temp.length < this.tempLength) { -+ if (temp.length < this.tempLength) { - temp = new byte[this.tempLength]; - } - -- var1.readFully(temp, 0, this.tempLength); -+ par1DataInput.readFully(temp, 0, this.tempLength); - int var2 = 0; -- - int var3; -- for(var3 = 0; var3 < 16; ++var3) { -+ -+ for (var3 = 0; var3 < 16; ++var3) { - var2 += this.yChMin >> var3 & 1; - } - - var3 = 12288 * var2; -- if(this.includeInitialize) { -+ -+ if (this.includeInitialize) { - var3 += 256; - } - -@@ -80,22 +113,33 @@ - var4.end(); - } - -- } -- -- public void writePacketData(DataOutput var1) throws IOException { -- var1.writeInt(this.xCh); -- var1.writeInt(this.zCh); -- var1.writeBoolean(this.includeInitialize); -- var1.writeShort((short)(this.yChMin & '\uffff')); -- var1.writeShort((short)(this.yChMax & '\uffff')); -- var1.writeInt(this.tempLength); -- var1.write(this.chunkData, 0, this.tempLength); -- } -- -- public void processPacket(NetHandler var1) { -- var1.handleMapChunk(this); -- } -- -+ SpoutClient.getInstance().getPacketManager().sendSpoutPacket(new PacketCustomBlockChunkOverride(xCh, zCh)); -+ // Spout End -+ } -+ -+ /** -+ * Abstract. Writes the raw packet data to the data stream. -+ */ -+ public void writePacketData(DataOutput par1DataOutput) throws IOException { -+ par1DataOutput.writeInt(this.xCh); -+ par1DataOutput.writeInt(this.zCh); -+ par1DataOutput.writeBoolean(this.includeInitialize); -+ par1DataOutput.writeShort((short)(this.yChMin & 65535)); -+ par1DataOutput.writeShort((short)(this.yChMax & 65535)); -+ par1DataOutput.writeInt(this.tempLength); -+ par1DataOutput.write(this.chunkData, 0, this.tempLength); -+ } -+ -+ /** -+ * Passes this Packet on to the NetHandler for processing. -+ */ -+ public void processPacket(NetHandler par1NetHandler) { -+ par1NetHandler.handleMapChunk(this); -+ } -+ -+ /** -+ * Abstract. Return the size of the packet (not counting the header). -+ */ - public int getPacketSize() { - return 17 + this.tempLength; - } -@@ -104,29 +148,32 @@ - return this.compressedChunkData; - } - -- public static Packet51MapChunkData getMapChunkData(Chunk var0, boolean var1, int var2) { -+ public static Packet51MapChunkData getMapChunkData(Chunk par0Chunk, boolean par1, int par2) { - int var3 = 0; -- ExtendedBlockStorage[] var4 = var0.getBlockStorageArray(); -+ ExtendedBlockStorage[] var4 = par0Chunk.getBlockStorageArray(); - int var5 = 0; - Packet51MapChunkData var6 = new Packet51MapChunkData(); - byte[] var7 = temp; -- if(var1) { -- var0.sendUpdates = true; -+ -+ if (par1) { -+ par0Chunk.sendUpdates = true; - } - - int var8; -- for(var8 = 0; var8 < var4.length; ++var8) { -- if(var4[var8] != null && (!var1 || !var4[var8].isEmpty()) && (var2 & 1 << var8) != 0) { -+ -+ for (var8 = 0; var8 < var4.length; ++var8) { -+ if (var4[var8] != null && (!par1 || !var4[var8].isEmpty()) && (par2 & 1 << var8) != 0) { - var6.chunkExistFlag |= 1 << var8; -- if(var4[var8].getBlockMSBArray() != null) { -+ -+ if (var4[var8].getBlockMSBArray() != null) { - var6.chunkHasAddSectionFlag |= 1 << var8; - ++var5; - } - } - } - -- for(var8 = 0; var8 < var4.length; ++var8) { -- if(var4[var8] != null && (!var1 || !var4[var8].isEmpty()) && (var2 & 1 << var8) != 0) { -+ for (var8 = 0; var8 < var4.length; ++var8) { -+ if (var4[var8] != null && (!par1 || !var4[var8].isEmpty()) && (par2 & 1 << var8) != 0) { - byte[] var9 = var4[var8].getBlockLSBArray(); - System.arraycopy(var9, 0, var7, var3, var9.length); - var3 += var9.length; -@@ -134,25 +181,26 @@ - } - - NibbleArray var10; -- for(var8 = 0; var8 < var4.length; ++var8) { -- if(var4[var8] != null && (!var1 || !var4[var8].isEmpty()) && (var2 & 1 << var8) != 0) { -+ -+ for (var8 = 0; var8 < var4.length; ++var8) { -+ if (var4[var8] != null && (!par1 || !var4[var8].isEmpty()) && (par2 & 1 << var8) != 0) { - var10 = var4[var8].getMetadataArray(); - System.arraycopy(var10.data, 0, var7, var3, var10.data.length); - var3 += var10.data.length; - } - } - -- for(var8 = 0; var8 < var4.length; ++var8) { -- if(var4[var8] != null && (!var1 || !var4[var8].isEmpty()) && (var2 & 1 << var8) != 0) { -+ for (var8 = 0; var8 < var4.length; ++var8) { -+ if (var4[var8] != null && (!par1 || !var4[var8].isEmpty()) && (par2 & 1 << var8) != 0) { - var10 = var4[var8].getBlocklightArray(); - System.arraycopy(var10.data, 0, var7, var3, var10.data.length); - var3 += var10.data.length; - } - } - -- if(!var0.worldObj.provider.hasNoSky) { -- for(var8 = 0; var8 < var4.length; ++var8) { -- if(var4[var8] != null && (!var1 || !var4[var8].isEmpty()) && (var2 & 1 << var8) != 0) { -+ if (!par0Chunk.worldObj.provider.hasNoSky) { -+ for (var8 = 0; var8 < var4.length; ++var8) { -+ if (var4[var8] != null && (!par1 || !var4[var8].isEmpty()) && (par2 & 1 << var8) != 0) { - var10 = var4[var8].getSkylightArray(); - System.arraycopy(var10.data, 0, var7, var3, var10.data.length); - var3 += var10.data.length; -@@ -160,9 +208,9 @@ - } - } - -- if(var5 > 0) { -- for(var8 = 0; var8 < var4.length; ++var8) { -- if(var4[var8] != null && (!var1 || !var4[var8].isEmpty()) && var4[var8].getBlockMSBArray() != null && (var2 & 1 << var8) != 0) { -+ if (var5 > 0) { -+ for (var8 = 0; var8 < var4.length; ++var8) { -+ if (var4[var8] != null && (!par1 || !var4[var8].isEmpty()) && var4[var8].getBlockMSBArray() != null && (par2 & 1 << var8) != 0) { - var10 = var4[var8].getBlockMSBArray(); - System.arraycopy(var10.data, 0, var7, var3, var10.data.length); - var3 += var10.data.length; -@@ -170,8 +218,8 @@ - } - } - -- if(var1) { -- byte[] var11 = var0.getBiomeArray(); -+ if (par1) { -+ byte[] var11 = par0Chunk.getBiomeArray(); - System.arraycopy(var11, 0, var7, var3, var11.length); - var3 += var11.length; - } ---- net/minecraft/src/ColorizerFoliage.java -+++ net/minecraft/src/ColorizerFoliage.java -@@ -1,28 +1,52 @@ - package net.minecraft.src; - -+// MCPatcher Start -+import com.prupe.mcpatcher.cc.ColorizeBlock; -+import com.prupe.mcpatcher.cc.Colorizer; -+// MCPatcher End -+ - public class ColorizerFoliage { -- private static int[] foliageBuffer = new int[65536]; -- -- public static void setFoliageBiomeColorizer(int[] var0) { -- foliageBuffer = var0; -+ -+ /** Color buffer for foliage */ -+ // MCPatcher Start - private to public -+ public static int[] foliageBuffer = new int[65536]; -+ // MCPatcher End -+ -+ public static void setFoliageBiomeColorizer(int[] par0ArrayOfInteger) { -+ foliageBuffer = par0ArrayOfInteger; - } - -- public static int getFoliageColor(double var0, double var2) { -- var2 *= var0; -- int var4 = (int)((1.0D - var0) * 255.0D); -- int var5 = (int)((1.0D - var2) * 255.0D); -+ /** -+ * Gets foliage color from temperature and humidity. Args: temperature, humidity -+ */ -+ public static int getFoliageColor(double par0, double par2) { -+ par2 *= par0; -+ int var4 = (int)((1.0D - par0) * 255.0D); -+ int var5 = (int)((1.0D - par2) * 255.0D); - return foliageBuffer[var5 << 8 | var4]; - } - -+ /** -+ * Gets the foliage color for pine type (metadata 1) trees -+ */ - public static int getFoliageColorPine() { -- return 6396257; -+ // MCPatcher Start -+ return ColorizeBlock.colorizeBiome(6396257, Colorizer.COLOR_MAP_PINE); -+ // MCPatcher End - } - -+ /** -+ * Gets the foliage color for birch type (metadata 2) trees -+ */ - public static int getFoliageColorBirch() { -- return 8431445; -+ // MCPatcher Start -+ return ColorizeBlock.colorizeBiome(8431445, Colorizer.COLOR_MAP_BIRCH); -+ // MCPatcher End - } - - public static int getFoliageColorBasic() { -- return 4764952; -+ // MCPatcher Start -+ return ColorizeBlock.colorizeBiome(4764952, Colorizer.COLOR_MAP_FOLIAGE); -+ // MCPatcher End - } - } ---- /dev/null -+++ org/spoutcraft/api/gui/RenderPriority.java -@@ -1,0 +1,62 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.api.gui; -+ -+public enum RenderPriority { -+ /** -+ * Will render before all other textures and widgets -+ */ -+ Highest(0), -+ /** -+ * Will render before most other textures and widgets -+ */ -+ High(1), -+ /** -+ * Will render in line with most other textures and widgets -+ */ -+ Normal(2), -+ /** -+ * Will render after most other textures and widgets -+ */ -+ Low(3), -+ /** -+ * Will render after all other textures and widgets -+ */ -+ Lowest(4), -+ ; -+ -+ private final int id; -+ RenderPriority(int id) { -+ this.id = id; -+ } -+ -+ public int getId() { -+ return id; -+ } -+ -+ public static RenderPriority getRenderPriorityFromId(int id) { -+ for (RenderPriority rp : values()) { -+ if (rp.getId() == id) { -+ return rp; -+ } -+ } -+ return null; -+ } -+} ---- net/minecraft/src/GuiDispenser.java -+++ net/minecraft/src/GuiDispenser.java -@@ -6,18 +6,24 @@ - private static final ResourceLocation dispenserGuiTextures = new ResourceLocation("textures/gui/container/dispenser.png"); - public TileEntityDispenser theDispenser; - -- public GuiDispenser(InventoryPlayer var1, TileEntityDispenser var2) { -- super(new ContainerDispenser(var1, var2)); -- this.theDispenser = var2; -+ public GuiDispenser(InventoryPlayer par1InventoryPlayer, TileEntityDispenser par2TileEntityDispenser) { -+ super(new ContainerDispenser(par1InventoryPlayer, par2TileEntityDispenser)); -+ this.theDispenser = par2TileEntityDispenser; - } - -- protected void drawGuiContainerForegroundLayer(int var1, int var2) { -+ /** -+ * Draw the foreground layer for the GuiContainer (everything in front of the items) -+ */ -+ protected void drawGuiContainerForegroundLayer(int par1, int par2) { - String var3 = this.theDispenser.isInvNameLocalized() ? this.theDispenser.getInvName() : I18n.getString(this.theDispenser.getInvName()); - this.fontRenderer.drawString(var3, this.xSize / 2 - this.fontRenderer.getStringWidth(var3) / 2, 6, 4210752); - this.fontRenderer.drawString(I18n.getString("container.inventory"), 8, this.ySize - 96 + 2, 4210752); - } - -- protected void drawGuiContainerBackgroundLayer(float var1, int var2, int var3) { -+ /** -+ * Draw the background layer for the GuiContainer (everything behind the items) -+ */ -+ protected void drawGuiContainerBackgroundLayer(float par1, int par2, int par3) { - GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - this.mc.getTextureManager().bindTexture(dispenserGuiTextures); - int var4 = (this.width - this.xSize) / 2; ---- /dev/null -+++ com/prupe/mcpatcher/TexturePackAPI.java -@@ -1,0 +1,370 @@ -+package com.prupe.mcpatcher; -+ -+import com.prupe.mcpatcher.TexturePackAPI$1; -+import java.awt.image.BufferedImage; -+import java.io.Closeable; -+import java.io.File; -+import java.io.IOException; -+import java.io.InputStream; -+import java.util.ArrayList; -+import java.util.Collection; -+import java.util.Collections; -+import java.util.HashSet; -+import java.util.Iterator; -+import java.util.List; -+import java.util.Properties; -+import java.util.Set; -+import java.util.Map.Entry; -+import java.util.regex.Pattern; -+import java.util.zip.ZipEntry; -+import java.util.zip.ZipFile; -+import javax.imageio.ImageIO; -+import net.minecraft.src.AbstractResourcePack; -+import net.minecraft.src.AbstractTexture; -+import net.minecraft.src.DefaultResourcePack; -+import net.minecraft.src.DynamicTexture; -+import net.minecraft.src.FallbackResourceManager; -+import net.minecraft.src.FileResourcePack; -+import net.minecraft.src.Minecraft; -+import net.minecraft.src.ResourceLocation; -+import net.minecraft.src.ResourceManager; -+import net.minecraft.src.ResourcePack; -+import net.minecraft.src.SimpleReloadableResourceManager; -+import net.minecraft.src.TextureManager; -+import net.minecraft.src.TextureMap; -+import net.minecraft.src.TextureObject; -+import org.lwjgl.opengl.GL11; -+ -+public class TexturePackAPI { -+ private static final MCLogger logger = MCLogger.getLogger("Texture Pack"); -+ public static final String DEFAULT_NAMESPACE = "minecraft"; -+ public static final String MCPATCHER_SUBDIR = "mcpatcher/"; -+ public static TexturePackAPI instance = new TexturePackAPI(); -+ -+ public static List getResourcePacks(String namespace) { -+ ArrayList list = new ArrayList(); -+ ResourceManager resourceManager = getResourceManager(); -+ -+ if (resourceManager instanceof SimpleReloadableResourceManager) { -+ Iterator i$ = ((SimpleReloadableResourceManager)resourceManager).domainResourceManagers.entrySet().iterator(); -+ -+ while (i$.hasNext()) { -+ Entry entry = (Entry)i$.next(); -+ -+ if (namespace == null || namespace.equals(entry.getKey())) { -+ FallbackResourceManager resourceManager1 = (FallbackResourceManager)entry.getValue(); -+ list.addAll(resourceManager1.resourcePacks); -+ } -+ } -+ } -+ -+ Collections.reverse(list); -+ return list; -+ } -+ -+ public static Set getNamespaces() { -+ HashSet set = new HashSet(); -+ ResourceManager resourceManager = getResourceManager(); -+ -+ if (resourceManager instanceof SimpleReloadableResourceManager) { -+ set.addAll(((SimpleReloadableResourceManager)resourceManager).domainResourceManagers.keySet()); -+ } -+ -+ return set; -+ } -+ -+ public static ResourceManager getResourceManager() { -+ return Minecraft.getMinecraft().getResourceManager(); -+ } -+ -+ public static boolean isDefaultTexturePack() { -+ return getResourcePacks("minecraft").size() <= 1; -+ } -+ -+ public static InputStream getInputStream(ResourceLocation resource) { -+ return resource == null ? null : instance.getInputStreamImpl(resource); -+ } -+ -+ public static boolean hasResource(ResourceLocation resource) { -+ if (resource == null) { -+ return false; -+ } else if (resource.getResourcePath().endsWith(".png")) { -+ return getImage(resource) != null; -+ } else if (resource.getResourcePath().endsWith(".properties")) { -+ return getProperties(resource) != null; -+ } else { -+ InputStream is = getInputStream(resource); -+ MCPatcherUtils.close((Closeable)is); -+ return is != null; -+ } -+ } -+ -+ public static BufferedImage getImage(ResourceLocation resource) { -+ return resource == null ? null : instance.getImageImpl(resource); -+ } -+ -+ public static Properties getProperties(ResourceLocation resource) { -+ Properties properties = new Properties(); -+ return getProperties(resource, properties) ? properties : null; -+ } -+ -+ public static boolean getProperties(ResourceLocation resource, Properties properties) { -+ return resource != null && instance.getPropertiesImpl(resource, properties); -+ } -+ -+ public static ResourceLocation transformResourceLocation(ResourceLocation resource, String oldExt, String newExt) { -+ return new ResourceLocation(resource.getResourceDomain(), resource.getResourcePath().replaceFirst(Pattern.quote(oldExt) + "$", newExt)); -+ } -+ -+ public static ResourceLocation parseResourceLocation(ResourceLocation baseResource, String path) { -+ if (path != null && !path.equals("")) { -+ boolean absolute = false; -+ -+ if (path.startsWith("%blur%")) { -+ path = path.substring(6); -+ } -+ -+ if (path.startsWith("%clamp%")) { -+ path = path.substring(7); -+ } -+ -+ if (path.startsWith("/")) { -+ path = path.substring(1); -+ absolute = true; -+ } -+ -+ if (path.startsWith("assets/minecraft/")) { -+ path = path.substring(17); -+ absolute = true; -+ } -+ -+ int colon = path.indexOf(58); -+ return colon >= 0 ? new ResourceLocation(path.substring(0, colon), path.substring(colon + 1)) : (path.startsWith("~/") ? new ResourceLocation(baseResource.getResourceDomain(), "mcpatcher/" + path.substring(2)) : (path.startsWith("./") ? new ResourceLocation(baseResource.getResourceDomain(), baseResource.getResourcePath().replaceFirst("[^/]+$", "") + path.substring(2)) : (!absolute && !path.contains("/") ? new ResourceLocation(baseResource.getResourceDomain(), baseResource.getResourcePath().replaceFirst("[^/]+$", "") + path) : new ResourceLocation(baseResource.getResourceDomain(), path)))); -+ } else { -+ return null; -+ } -+ } -+ -+ public static ResourceLocation newMCPatcherResourceLocation(String path) { -+ return new ResourceLocation("mcpatcher/" + path); -+ } -+ -+ public static List listResources(String directory, String suffix, boolean recursive, boolean directories, boolean sortByFilename) { -+ return listResources((String)null, directory, suffix, recursive, directories, sortByFilename); -+ } -+ -+ public static List listResources(String namespace, String directory, String suffix, boolean recursive, boolean directories, boolean sortByFilename) { -+ if (suffix == null) { -+ suffix = ""; -+ } -+ -+ ArrayList resources = new ArrayList(); -+ -+ if (MCPatcherUtils.isNullOrEmpty(namespace)) { -+ Iterator i$ = getNamespaces().iterator(); -+ -+ while (i$.hasNext()) { -+ String namespace1 = (String)i$.next(); -+ findResources(namespace1, directory, suffix, recursive, directories, resources); -+ } -+ } else { -+ findResources(namespace, directory, suffix, recursive, directories, resources); -+ } -+ -+ Collections.sort(resources, new TexturePackAPI$1(sortByFilename)); -+ return resources; -+ } -+ -+ private static void findResources(String namespace, String directory, String suffix, boolean recursive, boolean directories, Collection resources) { -+ Iterator i$ = getResourcePacks(namespace).iterator(); -+ -+ while (i$.hasNext()) { -+ ResourcePack resourcePack = (ResourcePack)i$.next(); -+ -+ if (resourcePack instanceof FileResourcePack) { -+ ZipFile base = ((FileResourcePack)resourcePack).resourcePackZipFile; -+ -+ if (base != null) { -+ findResources(base, namespace, "assets/" + namespace, directory, suffix, recursive, directories, resources); -+ } -+ } else { -+ File base1; -+ -+ if (resourcePack instanceof DefaultResourcePack) { -+ if ("minecraft".equals(namespace)) { -+ base1 = ((DefaultResourcePack)resourcePack).fileAssets; -+ -+ if (base1 != null && base1.isDirectory()) { -+ findResources(base1, namespace, directory, suffix, recursive, directories, resources); -+ } -+ } -+ } else if (resourcePack instanceof AbstractResourcePack) { -+ base1 = ((AbstractResourcePack)resourcePack).resourcePackFile; -+ -+ if (base1 != null && base1.isDirectory()) { -+ base1 = new File(base1, "assets/" + namespace); -+ -+ if (base1.isDirectory()) { -+ findResources(base1, namespace, directory, suffix, recursive, directories, resources); -+ } -+ } -+ } -+ } -+ } -+ } -+ -+ private static void findResources(ZipFile zipFile, String namespace, String root, String directory, String suffix, boolean recursive, boolean directories, Collection resources) { -+ String base = root + "/" + directory; -+ Iterator i$ = Collections.list(zipFile.entries()).iterator(); -+ -+ while (i$.hasNext()) { -+ ZipEntry entry = (ZipEntry)i$.next(); -+ -+ if (entry.isDirectory() == directories) { -+ String name = entry.getName().replaceFirst("^/", ""); -+ -+ if (name.startsWith(base) && name.endsWith(suffix)) { -+ if (directory.equals("")) { -+ if (recursive || !name.contains("/")) { -+ resources.add(new ResourceLocation(namespace, name)); -+ } -+ } else { -+ String subpath = name.substring(base.length()); -+ -+ if ((subpath.equals("") || subpath.startsWith("/")) && (recursive || subpath.equals("") || !subpath.substring(1).contains("/"))) { -+ resources.add(new ResourceLocation(namespace, name.substring(root.length() + 1))); -+ } -+ } -+ } -+ } -+ } -+ } -+ -+ private static void findResources(File base, String namespace, String directory, String suffix, boolean recursive, boolean directories, Collection resources) { -+ File subdirectory = new File(base, directory); -+ String[] list = subdirectory.list(); -+ -+ if (list != null) { -+ String pathComponent = directory.equals("") ? "" : directory + "/"; -+ String[] arr$ = list; -+ int len$ = list.length; -+ -+ for (int i$ = 0; i$ < len$; ++i$) { -+ String s = arr$[i$]; -+ File entry = new File(subdirectory, s); -+ String resourceName = pathComponent + s; -+ -+ if (entry.isDirectory()) { -+ if (directories && s.endsWith(suffix)) { -+ resources.add(new ResourceLocation(namespace, resourceName)); -+ } -+ -+ if (recursive) { -+ findResources(base, namespace, pathComponent + s, suffix, recursive, directories, resources); -+ } -+ } else if (s.endsWith(suffix) && !directories) { -+ resources.add(new ResourceLocation(namespace, resourceName)); -+ } -+ } -+ } -+ } -+ -+ public static int getTextureIfLoaded(ResourceLocation resource) { -+ if (resource == null) { -+ return -1; -+ } else { -+ TextureObject texture = Minecraft.getMinecraft().getTextureManager().getTexture(resource); -+ return texture instanceof AbstractTexture ? ((AbstractTexture)texture).glTextureId : -1; -+ } -+ } -+ -+ public static boolean isTextureLoaded(ResourceLocation resource) { -+ return getTextureIfLoaded(resource) >= 0; -+ } -+ -+ public static TextureObject getTextureObject(ResourceLocation resource) { -+ return Minecraft.getMinecraft().getTextureManager().getTexture(resource); -+ } -+ -+ public static void bindTexture(ResourceLocation resource) { -+ Minecraft.getMinecraft().getTextureManager().bindTexture(resource); -+ } -+ -+ public static void bindTexture(int texture) { -+ if (texture >= 0) { -+ GL11.glBindTexture(GL11.GL_TEXTURE_2D, texture); -+ } -+ } -+ -+ public static void unloadTexture(ResourceLocation resource) { -+ TextureManager textureManager = Minecraft.getMinecraft().getTextureManager(); -+ TextureObject texture = textureManager.getTexture(resource); -+ -+ if (texture != null && !(texture instanceof TextureMap) && !(texture instanceof DynamicTexture)) { -+ if (texture instanceof AbstractTexture) { -+ ((AbstractTexture)texture).unloadGLTexture(); -+ } -+ -+ logger.finer("unloading texture %s", new Object[] {resource}); -+ textureManager.mapTextureObjects.remove(resource); -+ } -+ } -+ -+ public static void deleteTexture(int texture) { -+ if (texture >= 0) { -+ GL11.glDeleteTextures(texture); -+ } -+ } -+ -+ protected InputStream getInputStreamImpl(ResourceLocation resource) { -+ try { -+ return Minecraft.getMinecraft().getResourceManager().getResource(resource).getInputStream(); -+ } catch (IOException var3) { -+ return null; -+ } -+ } -+ -+ protected BufferedImage getImageImpl(ResourceLocation resource) { -+ InputStream input = getInputStream(resource); -+ BufferedImage image = null; -+ -+ if (input != null) { -+ try { -+ image = ImageIO.read(input); -+ } catch (IOException var8) { -+ logger.error("could not read %s", new Object[] {resource}); -+ var8.printStackTrace(); -+ } finally { -+ MCPatcherUtils.close((Closeable)input); -+ } -+ } -+ -+ return image; -+ } -+ -+ protected boolean getPropertiesImpl(ResourceLocation resource, Properties properties) { -+ if (properties != null) { -+ InputStream input = getInputStream(resource); -+ boolean e; -+ -+ try { -+ if (input == null) { -+ return false; -+ } -+ -+ properties.load(input); -+ e = true; -+ } catch (IOException var8) { -+ logger.error("could not read %s", new Object[] {resource}); -+ var8.printStackTrace(); -+ return false; -+ } finally { -+ MCPatcherUtils.close((Closeable)input); -+ } -+ -+ return e; -+ } else { -+ return false; -+ } -+ } -+} ---- /dev/null -+++ org/spoutcraft/api/UnsafeMethod.java -@@ -1,0 +1,34 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.api; -+ -+import java.lang.annotation.Documented; -+import java.lang.annotation.Retention; -+import java.lang.annotation.RetentionPolicy; -+ -+@Documented -+@Retention(value = RetentionPolicy.RUNTIME) -+public @interface UnsafeMethod { -+ public String author() default "SpoutDev"; -+ -+ public String version() default "1.0"; -+ -+ public String shortDescription() default "Indicates that all of the methods inside of the class, and the constructor coud execute potentionally unsafe addon code and should be sandboxed before calling"; -+} ---- /dev/null -+++ org/spoutcraft/client/gui/settings/controls/ServerTexturesButton.java -@@ -1,0 +1,37 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.client.gui.settings.controls; -+ -+import org.spoutcraft.api.gui.GenericCheckBox; -+import org.spoutcraft.client.config.Configuration; -+ -+public class ServerTexturesButton extends GenericCheckBox { -+ public ServerTexturesButton() { -+ super("Server Texture Prompts"); -+ setChecked(Configuration.isServerTexturePromptsEnabled()); -+ setTooltip("Turn this setting off to ignore\nServer-Side Texture Pack Prompts at Login"); -+ } -+ -+ @Override -+ public void onButtonClick() { -+ Configuration.setServerTexturePromptsEnabled(!Configuration.isServerTexturePromptsEnabled()); -+ Configuration.write(); -+ } -+} ---- /dev/null -+++ org/spoutcraft/client/gui/minimap/GuiAddWaypoint.java -@@ -1,0 +1,151 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.client.gui.minimap; -+ -+import org.lwjgl.input.Keyboard; -+ -+import net.minecraft.src.GuiScreen; -+ -+import org.spoutcraft.api.Spoutcraft; -+import org.spoutcraft.api.gui.Button; -+import org.spoutcraft.api.gui.GenericButton; -+import org.spoutcraft.api.gui.GenericLabel; -+import org.spoutcraft.api.gui.GenericTextField; -+import org.spoutcraft.api.gui.RenderPriority; -+import org.spoutcraft.api.gui.TextField; -+import org.spoutcraft.client.SpoutClient; -+ -+public class GuiAddWaypoint extends GuiScreen { -+ Button done, cancel, delete; -+ TextField name; -+ private GuiScreen parent; -+ private int x,y,z; -+ private Waypoint toEdit = null; -+ private boolean existed = false; -+ -+ public GuiAddWaypoint(GuiScreen parent, int x, int y, int z) { -+ this.parent = parent; -+ this.x = x; -+ this.y = y; -+ this.z = z; -+ toEdit = new Waypoint("", x, y, z, true); -+ existed = false; -+ } -+ -+ public GuiAddWaypoint(GuiScreen parent, Waypoint edit) { -+ this.parent = parent; -+ this.toEdit = edit; -+ x = edit.x; -+ y = edit.y; -+ z = edit.z; -+ existed = true; -+ } -+ -+ public void initGui() { -+ GenericLabel label = new GenericLabel("Create Waypoint"); -+ int size = Spoutcraft.getMinecraftFont().getTextWidth(label.getText()); -+ label.setX((int) (width / 2 - size / 2)).setY(10); -+ label.setFixed(true).setPriority(RenderPriority.Lowest); -+ getScreen().attachWidget("Spoutcraft", label); -+ -+ int left = (int)(width / 2 - 155); -+ int right = (int)(width / 2 + 5); -+ -+ label = new GenericLabel("Waypoint Name:"); -+ size = Spoutcraft.getMinecraftFont().getTextWidth(label.getText()); -+ label.setX(left).setY(70); -+ label.setFixed(true).setPriority(RenderPriority.Lowest); -+ getScreen().attachWidget("Spoutcraft", label); -+ -+ name = new GenericTextField(); -+ name.setHeight(20).setWidth(300).setX(left).setY(81); -+ name.setMaximumCharacters(0); -+ name.setFixed(true).setPriority(RenderPriority.Lowest); -+ name.setText(toEdit.name); -+ getScreen().attachWidget("Spoutcraft", name); -+ -+ String text = "(" + x + ", " + y + ", " + z + ")"; -+ if (!SpoutClient.getInstance().isCoordsCheat()) { -+ text = "Coords not shown"; -+ } -+ label = new GenericLabel(text); -+ size = Spoutcraft.getMinecraftFont().getTextWidth(label.getText()); -+ label.setX((int) (width / 2 - size / 2)).setY(106); -+ label.setFixed(true).setPriority(RenderPriority.Lowest); -+ getScreen().attachWidget("Spoutcraft", label); -+ -+ done = new GenericButton("Create"); -+ if (existed) { -+ done.setText("Save"); -+ } -+ done.setWidth(150).setHeight(20).setX(right).setY(200); -+ getScreen().attachWidget("Spoutcraft", done); -+ -+ cancel = new GenericButton("Cancel"); -+ cancel.setWidth(150).setHeight(20).setX(left).setY(200); -+ getScreen().attachWidget("Spoutcraft", cancel); -+ -+ if (existed) { -+ delete = new GenericButton("Delete"); -+ delete.setGeometry(left, 175, 150, 20); -+ getScreen().attachWidget("Spoutcraft", delete); -+ } -+ } -+ -+ @Override -+ public void drawScreen(int x, int y, float z) { -+ drawDefaultBackground(); -+ name.setFocus(true); -+ done.setEnabled(name.getText().length() > 0); -+ super.drawScreen(x, y, z); -+ } -+ -+ @Override -+ protected void keyTyped(char ch, int keycode) { -+ if (keycode == Keyboard.KEY_RETURN) { -+ buttonClicked(done); -+ } else { -+ super.keyTyped(ch, keycode); -+ } -+ } -+ -+ @Override -+ protected void buttonClicked(Button btn) { -+ if (existed && btn == delete) { -+ MinimapConfig.getInstance().removeWaypoint(toEdit); -+ MinimapConfig.getInstance().save(); -+ SpoutClient.getHandle().displayGuiScreen(parent); -+ if (toEdit == MinimapConfig.getInstance().getFocussedWaypoint()) { -+ MinimapConfig.getInstance().setFocussedWaypoint(null); -+ } -+ } -+ if (btn.equals(done) && done.isEnabled()) { -+ toEdit.name = name.getText(); -+ if (!existed) { -+ MinimapConfig.getInstance().addWaypoint(MinimapUtils.getWorldName(), toEdit); -+ } -+ MinimapConfig.getInstance().save(); -+ SpoutClient.getHandle().displayGuiScreen(parent); -+ } -+ if (btn.equals(cancel)) { -+ mc.displayGuiScreen(parent); -+ } -+ } -+} ---- /dev/null -+++ org/spoutcraft/client/gui/settings/controls/AutomatedButton.java -@@ -1,0 +1,38 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.client.gui.settings.controls; -+ -+import org.spoutcraft.api.gui.GenericButton; -+import org.spoutcraft.client.config.Configuration; -+ -+public class AutomatedButton extends GenericButton { -+ public AutomatedButton() { -+ super(); -+ } -+ -+ public AutomatedButton(String title) { -+ super(title); -+ } -+ -+ @Override -+ public boolean isEnabled() { -+ return !Configuration.isAutomatePerformance(); -+ } -+} ---- net/minecraft/src/StepSoundAnvil.java -+++ net/minecraft/src/StepSoundAnvil.java -@@ -1,14 +1,20 @@ - package net.minecraft.src; - - final class StepSoundAnvil extends StepSound { -- StepSoundAnvil(String var1, float var2, float var3) { -- super(var1, var2, var3); -+ StepSoundAnvil(String par1Str, float par2, float par3) { -+ super(par1Str, par2, par3); - } - -+ /** -+ * Used when a block breaks, EXA: Player break, Shep eating grass, etc.. -+ */ - public String getBreakSound() { - return "dig.stone"; - } - -+ /** -+ * Used when a player places a block. -+ */ - public String getPlaceSound() { - return "random.anvil_land"; - } ---- /dev/null -+++ org/spoutcraft/api/gui/MinecraftFont.java -@@ -1,0 +1,77 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.api.gui; -+ -+public interface MinecraftFont { -+ /** -+ * Gets the scaled width of the text, in terms of the minecraft screen resolution -+ * -+ * @param text -+ * @return width -+ */ -+ public int getTextWidth(String text); -+ -+ /** -+ * Is true if the character can be be sent via chat or rendered on the screen -+ * -+ * @param ch to check -+ * @return if the character can be be sent via chat or rendered on the screen -+ */ -+ public boolean isAllowedChar(char ch); -+ -+ /** -+ * Is true if all of the text can be sent via chat or rendered on the screen -+ * -+ * @param text to check -+ * @return if all of the text can be sent via chat or rendered on the screen -+ */ -+ public boolean isAllowedText(String text); -+ -+ /** -+ * Draws the given text onto the screen at the given x and y coordinates, with the given hexidecimal color -+ * -+ * @param text to draw -+ * @param x to position the left lower corner at -+ * @param y to position the left lower corner at -+ * @param color, in 0XFFFFFF format (2 bytes for red, 2 bytes for green, 2 bytes for blue) -+ */ -+ public void drawString(String text, int x, int y, int color); -+ -+ /** -+ * Draws the given text onto the screen at the given x and y coordinates, with the given hexidecimal color -+ * This method also adds a shadow below the text -+ * -+ * @param text to draw -+ * @param x to position the left lower corner at -+ * @param y to position the left lower corner at -+ * @param color, in 0XFFFFFF format (2 bytes for red, 2 bytes for green, 2 bytes for blue) -+ */ -+ public void drawShadowedString(String text, int x, int y, int color); -+ -+ /** -+ * Draws the given text centered onto the screen at the given x and y coordinates, with the given hexidecimal color -+ * -+ * @param text to draw -+ * @param x to position the left lower corner at -+ * @param y to position the left lower corner at -+ * @param color, in 0XFFFFFF format (2 bytes for red, 2 bytes for green, 2 bytes for blue) -+ */ -+ public void drawCenteredString(String text, int x, int y, int color); -+} ---- net/minecraft/src/WorldSettings.java -+++ net/minecraft/src/WorldSettings.java -@@ -1,59 +1,94 @@ - package net.minecraft.src; - - public final class WorldSettings { -+ -+ /** The seed for the map. */ - private final long seed; -+ -+ /** The EnumGameType. */ - private final EnumGameType theGameType; -+ -+ /** -+ * Switch for the map features. 'true' for enabled, 'false' for disabled. -+ */ - private final boolean mapFeaturesEnabled; -+ -+ /** True if hardcore mode is enabled */ - private final boolean hardcoreEnabled; - private final WorldType terrainType; -+ -+ /** True if Commands (cheats) are allowed. */ - private boolean commandsAllowed; -+ -+ /** True if the Bonus Chest is enabled. */ - private boolean bonusChestEnabled; -- private String h; -- -- public WorldSettings(long var1, EnumGameType var3, boolean var4, boolean var5, WorldType var6) { -- this.h = ""; -- this.seed = var1; -- this.theGameType = var3; -- this.mapFeaturesEnabled = var4; -- this.hardcoreEnabled = var5; -- this.terrainType = var6; -- } -- -- public WorldSettings(WorldInfo var1) { -- this(var1.getSeed(), var1.getGameType(), var1.isMapFeaturesEnabled(), var1.isHardcoreModeEnabled(), var1.getTerrainType()); -- } -- -+ private String field_82751_h; -+ -+ public WorldSettings(long par1, EnumGameType par3EnumGameType, boolean par4, boolean par5, WorldType par6WorldType) { -+ this.field_82751_h = ""; -+ this.seed = par1; -+ this.theGameType = par3EnumGameType; -+ this.mapFeaturesEnabled = par4; -+ this.hardcoreEnabled = par5; -+ this.terrainType = par6WorldType; -+ } -+ -+ public WorldSettings(WorldInfo par1WorldInfo) { -+ this(par1WorldInfo.getSeed(), par1WorldInfo.getGameType(), par1WorldInfo.isMapFeaturesEnabled(), par1WorldInfo.isHardcoreModeEnabled(), par1WorldInfo.getTerrainType()); -+ } -+ -+ /** -+ * Enables the bonus chest. -+ */ - public WorldSettings enableBonusChest() { - this.bonusChestEnabled = true; - return this; - } - -+ /** -+ * Enables Commands (cheats). -+ */ - public WorldSettings enableCommands() { - this.commandsAllowed = true; - return this; - } - -- public WorldSettings func_82750_a(String var1) { -- this.h = var1; -+ public WorldSettings func_82750_a(String par1Str) { -+ this.field_82751_h = par1Str; - return this; - } - -+ /** -+ * Returns true if the Bonus Chest is enabled. -+ */ - public boolean isBonusChestEnabled() { - return this.bonusChestEnabled; - } - -+ /** -+ * Returns the seed for the world. -+ */ - public long getSeed() { - return this.seed; - } - -+ /** -+ * Gets the game type. -+ */ - public EnumGameType getGameType() { - return this.theGameType; - } - -+ /** -+ * Returns true if hardcore mode is enabled, otherwise false -+ */ - public boolean getHardcoreEnabled() { - return this.hardcoreEnabled; - } - -+ /** -+ * Get whether the map features (e.g. strongholds) generation is enabled or disabled. -+ */ - public boolean isMapFeaturesEnabled() { - return this.mapFeaturesEnabled; - } -@@ -62,15 +97,21 @@ - return this.terrainType; - } - -+ /** -+ * Returns true if Commands (cheats) are allowed. -+ */ - public boolean areCommandsAllowed() { - return this.commandsAllowed; - } - -- public static EnumGameType getGameTypeById(int var0) { -- return EnumGameType.getByID(var0); -+ /** -+ * Gets the GameType by ID -+ */ -+ public static EnumGameType getGameTypeById(int par0) { -+ return EnumGameType.getByID(par0); - } - - public String func_82749_j() { -- return this.h; -+ return this.field_82751_h; - } - } ---- net/minecraft/src/AchievementList.java -+++ net/minecraft/src/AchievementList.java -@@ -4,39 +4,103 @@ - import java.util.List; - - public class AchievementList { -+ -+ /** Is the smallest column used to display a achievement on the GUI. */ - public static int minDisplayColumn; -+ -+ /** Is the smallest row used to display a achievement on the GUI. */ - public static int minDisplayRow; -+ -+ /** Is the biggest column used to display a achievement on the GUI. */ - public static int maxDisplayColumn; -+ -+ /** Is the biggest row used to display a achievement on the GUI. */ - public static int maxDisplayRow; -- public static List e = new ArrayList(); -+ -+ /** Holds a list of all registered achievements. */ -+ public static List achievementList = new ArrayList(); -+ -+ /** Is the 'open inventory' achievement. */ - public static Achievement openInventory = (new Achievement(0, "openInventory", 0, 0, Item.book, (Achievement)null)).setIndependent().registerAchievement(); -+ -+ /** Is the 'getting wood' achievement. */ - public static Achievement mineWood = (new Achievement(1, "mineWood", 2, 1, Block.wood, openInventory)).registerAchievement(); -+ -+ /** Is the 'benchmarking' achievement. */ - public static Achievement buildWorkBench = (new Achievement(2, "buildWorkBench", 4, -1, Block.workbench, mineWood)).registerAchievement(); -+ -+ /** Is the 'time to mine' achievement. */ - public static Achievement buildPickaxe = (new Achievement(3, "buildPickaxe", 4, 2, Item.pickaxeWood, buildWorkBench)).registerAchievement(); -+ -+ /** Is the 'hot topic' achievement. */ - public static Achievement buildFurnace = (new Achievement(4, "buildFurnace", 3, 4, Block.furnaceIdle, buildPickaxe)).registerAchievement(); -+ -+ /** Is the 'acquire hardware' achievement. */ - public static Achievement acquireIron = (new Achievement(5, "acquireIron", 1, 4, Item.ingotIron, buildFurnace)).registerAchievement(); -+ -+ /** Is the 'time to farm' achievement. */ - public static Achievement buildHoe = (new Achievement(6, "buildHoe", 2, -3, Item.hoeWood, buildWorkBench)).registerAchievement(); -+ -+ /** Is the 'bake bread' achievement. */ - public static Achievement makeBread = (new Achievement(7, "makeBread", -1, -3, Item.bread, buildHoe)).registerAchievement(); -+ -+ /** Is the 'the lie' achievement. */ - public static Achievement bakeCake = (new Achievement(8, "bakeCake", 0, -5, Item.cake, buildHoe)).registerAchievement(); -+ -+ /** Is the 'getting a upgrade' achievement. */ - public static Achievement buildBetterPickaxe = (new Achievement(9, "buildBetterPickaxe", 6, 2, Item.pickaxeStone, buildPickaxe)).registerAchievement(); -+ -+ /** Is the 'delicious fish' achievement. */ - public static Achievement cookFish = (new Achievement(10, "cookFish", 2, 6, Item.fishCooked, buildFurnace)).registerAchievement(); -+ -+ /** Is the 'on a rail' achievement */ - public static Achievement onARail = (new Achievement(11, "onARail", 2, 3, Block.rail, acquireIron)).setSpecial().registerAchievement(); -+ -+ /** Is the 'time to strike' achievement. */ - public static Achievement buildSword = (new Achievement(12, "buildSword", 6, -1, Item.swordWood, buildWorkBench)).registerAchievement(); -+ -+ /** Is the 'monster hunter' achievement. */ - public static Achievement killEnemy = (new Achievement(13, "killEnemy", 8, -1, Item.bone, buildSword)).registerAchievement(); -+ -+ /** is the 'cow tipper' achievement. */ - public static Achievement killCow = (new Achievement(14, "killCow", 7, -3, Item.leather, buildSword)).registerAchievement(); -+ -+ /** Is the 'when pig fly' achievement. */ - public static Achievement flyPig = (new Achievement(15, "flyPig", 8, -4, Item.saddle, killCow)).setSpecial().registerAchievement(); -+ -+ /** The achievement for killing a Skeleton from 50 meters aways. */ - public static Achievement snipeSkeleton = (new Achievement(16, "snipeSkeleton", 7, 0, Item.bow, killEnemy)).setSpecial().registerAchievement(); -+ -+ /** Is the 'DIAMONDS!' achievement */ - public static Achievement diamonds = (new Achievement(17, "diamonds", -1, 5, Item.diamond, acquireIron)).registerAchievement(); -+ -+ /** Is the 'We Need to Go Deeper' achievement */ - public static Achievement portal = (new Achievement(18, "portal", -1, 7, Block.obsidian, diamonds)).registerAchievement(); -+ -+ /** Is the 'Return to Sender' achievement */ - public static Achievement ghast = (new Achievement(19, "ghast", -4, 8, Item.ghastTear, portal)).setSpecial().registerAchievement(); -+ -+ /** Is the 'Into Fire' achievement */ - public static Achievement blazeRod = (new Achievement(20, "blazeRod", 0, 9, Item.blazeRod, portal)).registerAchievement(); -+ -+ /** Is the 'Local Brewery' achievement */ - public static Achievement potion = (new Achievement(21, "potion", 2, 8, Item.potion, blazeRod)).registerAchievement(); -+ -+ /** Is the 'The End?' achievement */ - public static Achievement theEnd = (new Achievement(22, "theEnd", 3, 10, Item.eyeOfEnder, blazeRod)).setSpecial().registerAchievement(); -+ -+ /** Is the 'The End.' achievement */ - public static Achievement theEnd2 = (new Achievement(23, "theEnd2", 4, 13, Block.dragonEgg, theEnd)).setSpecial().registerAchievement(); -+ -+ /** Is the 'Enchanter' achievement */ - public static Achievement enchantments = (new Achievement(24, "enchantments", -4, 4, Block.enchantmentTable, diamonds)).registerAchievement(); - public static Achievement overkill = (new Achievement(25, "overkill", -4, 1, Item.swordDiamond, enchantments)).setSpecial().registerAchievement(); -+ -+ /** Is the 'Librarian' achievement */ - public static Achievement bookcase = (new Achievement(26, "bookcase", -3, 6, Block.bookShelf, enchantments)).registerAchievement(); - -- public static void init() { -- } -+ /** -+ * A stub functions called to make the static initializer for this class run. -+ */ -+ public static void init() {} - } ---- net/minecraft/src/CallableEntityTracker.java -+++ net/minecraft/src/CallableEntityTracker.java -@@ -4,16 +4,18 @@ - - class CallableEntityTracker implements Callable { - final int field_96570_a; -+ - final EntityTracker theEntityTracker; - -- CallableEntityTracker(EntityTracker var1, int var2) { -- this.theEntityTracker = var1; -- this.field_96570_a = var2; -+ CallableEntityTracker(EntityTracker par1EntityTracker, int par2) { -+ this.theEntityTracker = par1EntityTracker; -+ this.field_96570_a = par2; - } - - public String func_96568_a() { - String var1 = "Once per " + this.field_96570_a + " ticks"; -- if(this.field_96570_a == Integer.MAX_VALUE) { -+ -+ if (this.field_96570_a == Integer.MAX_VALUE) { - var1 = "Maximum (" + var1 + ")"; - } - ---- /dev/null -+++ org/spoutcraft/client/player/accessories/Wings.java -@@ -1,0 +1,190 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.client.player.accessories; -+ -+import net.minecraft.src.EntityPlayer; -+import net.minecraft.src.ModelBiped; -+import net.minecraft.src.ModelRenderer; -+ -+public class Wings extends Accessory{ -+ ModelRenderer LeftWingPart1; -+ ModelRenderer LeftWingPart2; -+ ModelRenderer LeftWingPart3; -+ ModelRenderer LeftWingPart4; -+ ModelRenderer LeftWingPart5; -+ ModelRenderer LeftWingPart6; -+ ModelRenderer LeftWingPart7; -+ ModelRenderer LeftWingPart8; -+ ModelRenderer LeftWingPart0; -+ ModelRenderer RightWingPart0; -+ ModelRenderer RightWingPart1; -+ ModelRenderer RightWingPart2; -+ ModelRenderer RightWingPart3; -+ ModelRenderer RightWingPart4; -+ ModelRenderer RightWingPart5; -+ ModelRenderer RightWingPart6; -+ ModelRenderer RightWingPart7; -+ ModelRenderer RightWingPart8; -+ -+ public Wings(ModelBiped mb) { -+ super(mb); -+ LeftWingPart1 = new ModelRenderer(mb, 56, 0); -+ LeftWingPart1.addBox(-1F, 1F, 3F, 1, 10, 1); -+ LeftWingPart1.setRotationPoint(0F, 0F, 0F); -+ LeftWingPart1.setTextureSize(64, 32); -+ LeftWingPart1.mirror = true; -+ setRotation(LeftWingPart1, 0F, 0.5007752F, 0.0174533F); -+ LeftWingPart2 = new ModelRenderer(mb, 50, 0); -+ LeftWingPart2.addBox(-1F, 0F, 4F, 1, 10, 2); -+ LeftWingPart2.setRotationPoint(0F, 0F, 0F); -+ LeftWingPart2.setTextureSize(64, 32); -+ LeftWingPart2.mirror = true; -+ setRotation(LeftWingPart2, 0F, 0.5182285F, 0.0349066F); -+ LeftWingPart3 = new ModelRenderer(mb, 46, 0); -+ LeftWingPart3.addBox(-1F, -1F, 6F, 1, 10, 1); -+ LeftWingPart3.setRotationPoint(0F, 0F, 0F); -+ LeftWingPart3.setTextureSize(64, 32); -+ LeftWingPart3.mirror = true; -+ setRotation(LeftWingPart3, 0F, 0.5356818F, 0.0523599F); -+ LeftWingPart4 = new ModelRenderer(mb, 38, 0); -+ LeftWingPart4.addBox(-1F, -2F, 7F, 1, 10, 3); -+ LeftWingPart4.setRotationPoint(0F, 0F, 0F); -+ LeftWingPart4.setTextureSize(64, 32); -+ LeftWingPart4.mirror = true; -+ setRotation(LeftWingPart4, 0F, 0.5531351F, 0.0698132F); -+ LeftWingPart5 = new ModelRenderer(mb, 34, 0); -+ LeftWingPart5.addBox(-1F, -1F, 10F, 1, 10, 1); -+ LeftWingPart5.setRotationPoint(0F, 0F, 0F); -+ LeftWingPart5.setTextureSize(64, 32); -+ LeftWingPart5.mirror = true; -+ setRotation(LeftWingPart5, 0F, 0.5531351F, 0.0523599F); -+ LeftWingPart6 = new ModelRenderer(mb, 30, 0); -+ LeftWingPart6.addBox(-1F, 0F, 11F, 1, 10, 1); -+ LeftWingPart6.setRotationPoint(0F, 0F, 0F); -+ LeftWingPart6.setTextureSize(64, 32); -+ LeftWingPart6.mirror = true; -+ setRotation(LeftWingPart6, 0F, 0.5705884F, 0.0349066F); -+ LeftWingPart7 = new ModelRenderer(mb, 26, 0); -+ LeftWingPart7.addBox(-1F, 1F, 12F, 1, 10, 1); -+ LeftWingPart7.setRotationPoint(0F, 0F, 0F); -+ LeftWingPart7.setTextureSize(64, 32); -+ LeftWingPart7.mirror = true; -+ setRotation(LeftWingPart7, 0F, 0.5880417F, 0.0174533F); -+ LeftWingPart8 = new ModelRenderer(mb, 22, 0); -+ LeftWingPart8.addBox(-1F, 3F, 13F, 1, 10, 1); -+ LeftWingPart8.setRotationPoint(0F, 0F, 0F); -+ LeftWingPart8.setTextureSize(64, 32); -+ LeftWingPart8.mirror = true; -+ setRotation(LeftWingPart8, 0F, 0.5880417F, 0F); -+ LeftWingPart0 = new ModelRenderer(mb, 60, 0); -+ LeftWingPart0.addBox(-1F, 2F, 2F, 1, 10, 1); -+ LeftWingPart0.setRotationPoint(0F, 0F, 0F); -+ LeftWingPart0.setTextureSize(64, 32); -+ LeftWingPart0.mirror = true; -+ setRotation(LeftWingPart0, 0F, 0.4833219F, 0F); -+ RightWingPart0 = new ModelRenderer(mb, 60, 21); -+ RightWingPart0.addBox(0F, 2F, 2F, 1, 10, 1); -+ RightWingPart0.setRotationPoint(0F, 0F, 0F); -+ RightWingPart0.setTextureSize(64, 32); -+ RightWingPart0.mirror = true; -+ setRotation(RightWingPart0, 0F, -0.4833166F, 0F); -+ RightWingPart1 = new ModelRenderer(mb, 56, 21); -+ RightWingPart1.addBox(0F, 1F, 3F, 1, 10, 1); -+ RightWingPart1.setRotationPoint(0F, 0F, 0F); -+ RightWingPart1.setTextureSize(64, 32); -+ RightWingPart1.mirror = true; -+ setRotation(RightWingPart1, 0F, -0.5007699F, -0.0174533F); -+ RightWingPart2 = new ModelRenderer(mb, 50, 20); -+ RightWingPart2.addBox(0F, 0F, 4F, 1, 10, 2); -+ RightWingPart2.setRotationPoint(0F, 0F, 0F); -+ RightWingPart2.setTextureSize(64, 32); -+ RightWingPart2.mirror = true; -+ setRotation(RightWingPart2, 0F, -0.5182232F, -0.0349066F); -+ RightWingPart3 = new ModelRenderer(mb, 46, 21); -+ RightWingPart3.addBox(0F, -1F, 6F, 1, 10, 1); -+ RightWingPart3.setRotationPoint(0F, 0F, 0F); -+ RightWingPart3.setTextureSize(64, 32); -+ RightWingPart3.mirror = true; -+ setRotation(RightWingPart3, 0.0174533F, -0.5356765F, -0.0523599F); -+ RightWingPart4 = new ModelRenderer(mb, 38, 19); -+ RightWingPart4.addBox(0F, -2F, 7F, 1, 10, 3); -+ RightWingPart4.setRotationPoint(0F, 0F, 0F); -+ RightWingPart4.setTextureSize(64, 32); -+ RightWingPart4.mirror = true; -+ setRotation(RightWingPart4, 0.0174533F, -0.5531297F, -0.0698132F); -+ RightWingPart5 = new ModelRenderer(mb, 34, 21); -+ RightWingPart5.addBox(0F, -1F, 10F, 1, 10, 1); -+ RightWingPart5.setRotationPoint(0F, 0F, 0F); -+ RightWingPart5.setTextureSize(64, 32); -+ RightWingPart5.mirror = true; -+ setRotation(RightWingPart5, 0.0174533F, -0.570583F, -0.0523599F); -+ RightWingPart6 = new ModelRenderer(mb, 30, 21); -+ RightWingPart6.addBox(0F, 0F, 11F, 1, 10, 1); -+ RightWingPart6.setRotationPoint(0F, 0F, 0F); -+ RightWingPart6.setTextureSize(64, 32); -+ RightWingPart6.mirror = true; -+ setRotation(RightWingPart6, 0.0174533F, -0.5880363F, -0.0349066F); -+ RightWingPart7 = new ModelRenderer(mb, 26, 21); -+ RightWingPart7.addBox(0F, 1F, 12F, 1, 10, 1); -+ RightWingPart7.setRotationPoint(0F, 0F, 0F); -+ RightWingPart7.setTextureSize(64, 32); -+ RightWingPart7.mirror = true; -+ setRotation(RightWingPart7, 0.0174533F, -0.6054896F, -0.0174533F); -+ RightWingPart8 = new ModelRenderer(mb, 22, 21); -+ RightWingPart8.addBox(0F, 3F, 13F, 1, 10, 1); -+ RightWingPart8.setRotationPoint(0F, 0F, 0F); -+ RightWingPart8.setTextureSize(64, 32); -+ RightWingPart8.mirror = true; -+ setRotation(RightWingPart8, 0.0174533F, -0.6229429F, 0F); -+ } -+ -+ private void setRotation(ModelRenderer model, float x, float y, float z) { -+ model.rotateAngleX = x; -+ model.rotateAngleY = y; -+ model.rotateAngleZ = z; -+ } -+ -+ @Override -+ public void render(EntityPlayer plr, float f) { -+ LeftWingPart1.render(f); -+ LeftWingPart2.render(f); -+ LeftWingPart3.render(f); -+ LeftWingPart4.render(f); -+ LeftWingPart5.render(f); -+ LeftWingPart6.render(f); -+ LeftWingPart7.render(f); -+ LeftWingPart8.render(f); -+ LeftWingPart0.render(f); -+ RightWingPart0.render(f); -+ RightWingPart1.render(f); -+ RightWingPart2.render(f); -+ RightWingPart3.render(f); -+ RightWingPart4.render(f); -+ RightWingPart5.render(f); -+ RightWingPart6.render(f); -+ RightWingPart7.render(f); -+ RightWingPart8.render(f); -+ } -+ -+ @Override -+ public AccessoryType getType() { -+ return AccessoryType.WINGS; -+ } -+} ---- /dev/null -+++ com/prupe/mcpatcher/JsonUtils.java -@@ -1,0 +1,134 @@ -+package com.prupe.mcpatcher; -+ -+import com.google.gson.Gson; -+import com.google.gson.GsonBuilder; -+import com.google.gson.JsonElement; -+import com.google.gson.JsonObject; -+import com.google.gson.JsonParser; -+import java.io.Closeable; -+import java.io.File; -+import java.io.FileInputStream; -+import java.io.FileReader; -+import java.io.InputStream; -+import java.io.InputStreamReader; -+import java.io.PrintWriter; -+ -+public class JsonUtils { -+ public static Gson newGson() { -+ GsonBuilder builder = new GsonBuilder(); -+ builder.setPrettyPrinting(); -+ return builder.create(); -+ } -+ -+ public static T parseJson(File path, Class cl) { -+ if (path != null && path.isFile() && path.length() > 0L) { -+ FileInputStream input = null; -+ Object var4; -+ -+ try { -+ input = new FileInputStream(path); -+ Object e = parseJson((InputStream)input, cl); -+ // ToDo: return e; [incompatible types] -+ return null; -+ } catch (Throwable var8) { -+ var8.printStackTrace(); -+ var4 = null; -+ } finally { -+ MCPatcherUtils.close((Closeable)input); -+ } -+//ToDo: -+ return null; //var4 -+ } else { -+ return null; -+ } -+ } -+ -+ public static T parseJson(InputStream input, Class cl) { -+ if (input == null) { -+ return null; -+ } else { -+ try { -+ InputStreamReader e = new InputStreamReader(input); -+ return newGson().fromJson(e, cl); -+ } catch (Throwable var3) { -+ var3.printStackTrace(); -+ return null; -+ } -+ } -+ } -+ -+ public static JsonObject parseJson(File path) { -+ FileReader input = null; -+ JsonObject var3; -+ -+ try { -+ input = new FileReader(path); -+ JsonParser e = new JsonParser(); -+ var3 = e.parse(input).getAsJsonObject(); -+ return var3; -+ } catch (Throwable var7) { -+ var7.printStackTrace(); -+ var3 = null; -+ } finally { -+ MCPatcherUtils.close((Closeable)input); -+ } -+ -+ return var3; -+ } -+ -+ public static boolean writeJson(JsonElement json, File path) { -+ PrintWriter output = null; -+ boolean var4; -+ -+ try { -+ output = new PrintWriter(path); -+ Gson e = newGson(); -+ e.toJson(json, output); -+ output.println(); -+ var4 = true; -+ return var4; -+ } catch (Throwable var8) { -+ var8.printStackTrace(); -+ MCPatcherUtils.close((Closeable)output); -+ path.delete(); -+ var4 = false; -+ } finally { -+ MCPatcherUtils.close((Closeable)output); -+ } -+ -+ return var4; -+ } -+ -+ public static boolean writeJson(Object object, File path) { -+ PrintWriter output = null; -+ boolean var4; -+ -+ try { -+ output = new PrintWriter(path); -+ Gson e = newGson(); -+ e.toJson(object, object.getClass(), output); -+ output.println(); -+ var4 = true; -+ return var4; -+ } catch (Throwable var8) { -+ var8.printStackTrace(); -+ MCPatcherUtils.close((Closeable)output); -+ path.delete(); -+ var4 = false; -+ } finally { -+ MCPatcherUtils.close((Closeable)output); -+ } -+ -+ return var4; -+ } -+ -+ public static T cloneJson(T json) { -+ //return (new JsonParser()).parse(json.toString()); -+ return null; -+ } -+ -+ public static T cloneJson(T json, Class jsonClass) { -+ Gson gson = newGson(); -+ return gson.fromJson(gson.toJson(json, jsonClass), jsonClass); -+ } -+} ---- net/minecraft/src/MapColor.java -+++ net/minecraft/src/MapColor.java -@@ -1,27 +1,71 @@ - package net.minecraft.src; - - public class MapColor { -+ -+ /** -+ * Holds all the 16 colors used on maps, very similar of a pallete system. -+ */ - public static final MapColor[] mapColorArray = new MapColor[16]; -+ -+ /** The map color for Air blocks */ - public static final MapColor airColor = new MapColor(0, 0); -+ -+ /** this is the grass color in html format */ - public static final MapColor grassColor = new MapColor(1, 8368696); -+ -+ /** This is the color of the sand */ - public static final MapColor sandColor = new MapColor(2, 16247203); -+ -+ /** The map color for Cloth and Sponge blocks */ - public static final MapColor clothColor = new MapColor(3, 10987431); -+ -+ /** The map color for TNT blocks */ - public static final MapColor tntColor = new MapColor(4, 16711680); -+ -+ /** The map color for Ice blocks */ - public static final MapColor iceColor = new MapColor(5, 10526975); -+ -+ /** The map color for Iron blocks */ - public static final MapColor ironColor = new MapColor(6, 10987431); -+ -+ /** The map color for Leaf, Plant, Cactus, and Pumpkin blocks. */ - public static final MapColor foliageColor = new MapColor(7, 31744); -+ -+ /** The map color for Snow Cover and Snow blocks */ - public static final MapColor snowColor = new MapColor(8, 16777215); -+ -+ /** The map color for Clay blocks */ - public static final MapColor clayColor = new MapColor(9, 10791096); -+ -+ /** The map color for Dirt blocks */ - public static final MapColor dirtColor = new MapColor(10, 12020271); -+ -+ /** The map color for Stone blocks */ - public static final MapColor stoneColor = new MapColor(11, 7368816); -+ -+ /** The map color for Water blocks */ - public static final MapColor waterColor = new MapColor(12, 4210943); -+ -+ /** The map color for Wood blocks */ - public static final MapColor woodColor = new MapColor(13, 6837042); -- public final int colorValue; -+ -+ /** Holds the color in RGB value that will be rendered on maps. */ -+ // MCPatcher Start - Removed final -+ public int colorValue; -+ // MCPatcher End -+ -+ /** Holds the index of the color used on map. */ - public final int colorIndex; -+ // MCPatcher Start - Removed final -+ public int origColorValue; -+ // MCPatcher End - -- private MapColor(int var1, int var2) { -- this.colorIndex = var1; -- this.colorValue = var2; -- mapColorArray[var1] = this; -+ private MapColor(int par1, int par2) { -+ this.colorIndex = par1; -+ this.colorValue = par2; -+ // MCPatcher Start -+ this.origColorValue = par2; -+ // MCPatcher End -+ mapColorArray[par1] = this; - } - } ---- net/minecraft/src/TileEntitySkull.java -+++ net/minecraft/src/TileEntitySkull.java -@@ -1,38 +1,59 @@ - package net.minecraft.src; - - public class TileEntitySkull extends TileEntity { -+ -+ /** Entity type for this skull. */ - private int skullType; -+ -+ /** The skull's rotation. */ - private int skullRotation; -- private String c = ""; -- -- public void writeToNBT(NBTTagCompound var1) { -- super.writeToNBT(var1); -- var1.setByte("SkullType", (byte)(this.skullType & 255)); -- var1.setByte("Rot", (byte)(this.skullRotation & 255)); -- var1.setString("ExtraType", this.c); -+ -+ /** Extra data for this skull, used as player username by player heads */ -+ private String extraType = ""; -+ -+ /** -+ * Writes a tile entity to NBT. -+ */ -+ public void writeToNBT(NBTTagCompound par1NBTTagCompound) { -+ super.writeToNBT(par1NBTTagCompound); -+ par1NBTTagCompound.setByte("SkullType", (byte)(this.skullType & 255)); -+ par1NBTTagCompound.setByte("Rot", (byte)(this.skullRotation & 255)); -+ par1NBTTagCompound.setString("ExtraType", this.extraType); - } - -- public void readFromNBT(NBTTagCompound var1) { -- super.readFromNBT(var1); -- this.skullType = var1.getByte("SkullType"); -- this.skullRotation = var1.getByte("Rot"); -- if(var1.hasKey("ExtraType")) { -- this.c = var1.getString("ExtraType"); -+ /** -+ * Reads a tile entity from NBT. -+ */ -+ public void readFromNBT(NBTTagCompound par1NBTTagCompound) { -+ super.readFromNBT(par1NBTTagCompound); -+ this.skullType = par1NBTTagCompound.getByte("SkullType"); -+ this.skullRotation = par1NBTTagCompound.getByte("Rot"); -+ -+ if (par1NBTTagCompound.hasKey("ExtraType")) { -+ this.extraType = par1NBTTagCompound.getString("ExtraType"); - } -- - } - -+ /** -+ * Overriden in a sign to provide the text. -+ */ - public Packet getDescriptionPacket() { - NBTTagCompound var1 = new NBTTagCompound(); - this.writeToNBT(var1); - return new Packet132TileEntityData(this.xCoord, this.yCoord, this.zCoord, 4, var1); - } - -- public void setSkullType(int var1, String var2) { -- this.skullType = var1; -- this.c = var2; -+ /** -+ * Set the entity type for the skull -+ */ -+ public void setSkullType(int par1, String par2Str) { -+ this.skullType = par1; -+ this.extraType = par2Str; - } - -+ /** -+ * Get the entity type for the skull -+ */ - public int getSkullType() { - return this.skullType; - } -@@ -41,11 +62,17 @@ - return this.skullRotation; - } - -- public void setSkullRotation(int var1) { -- this.skullRotation = var1; -+ /** -+ * Set the skull's rotation -+ */ -+ public void setSkullRotation(int par1) { -+ this.skullRotation = par1; - } - -+ /** -+ * Get the extra data foor this skull, used as player username by player heads -+ */ - public String getExtraType() { -- return this.c; -+ return this.extraType; - } - } ---- /dev/null -+++ org/spoutcraft/client/gui/server/ServerManager.java -@@ -1,0 +1,101 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.client.gui.server; -+ -+import net.minecraft.src.GuiConnecting; -+import net.minecraft.src.GuiScreen; -+import net.minecraft.src.ServerData; -+ -+import org.spoutcraft.client.SpoutClient; -+import org.spoutcraft.client.gui.mainmenu.MainMenu; -+ -+public class ServerManager { -+ private FavoritesModel favorites; -+ private ServerListModel serverList; -+ public StaticServerModel staticServers; -+ private LANModel lanModel; -+ private GuiScreen joinedFrom; -+ private String screenName; -+ -+ public void init() { -+ favorites = new FavoritesModel(); -+ favorites.load(); -+ staticServers = new StaticServerModel(); -+ //staticServers.load(); -+ serverList = new ServerListModel(); -+ lanModel = new LANModel(); -+ } -+ -+ public FavoritesModel getFavorites() { -+ return favorites; -+ } -+ -+ public StaticServerModel getStaticServerList() { -+ return staticServers; -+ } -+ -+ public ServerListModel getServerList() { -+ return serverList; -+ } -+ -+ public LANModel getLANModel() { -+ return lanModel; -+ } -+ -+ /** -+ * Joins the server given by the serverItem -+ * @param serverItem -+ */ -+ public void join(ServerItem serverItem, GuiScreen from, String name) { -+ //join(serverItem.getIp(), serverItem.getPort(), from, name); -+ SpoutServerData serverData = new SpoutServerData(name, serverItem); -+ join(serverData, from, name); -+ } -+ -+ /** -+ * Joins the server on the given ip:port -+ * @param ip -+ * @param port -+ */ -+ public void join(String ip, int port, GuiScreen from, String name) { -+ this.joinedFrom = from; -+ this.screenName = name; -+ SpoutClient.getHandle().displayGuiScreen(new GuiConnecting(SpoutClient.getHandle(), new ServerData(name, ip + ":" + port))); -+ } -+ -+ public void join(SpoutServerData serverData, GuiScreen from, String name) { -+ this.joinedFrom = from; -+ this.screenName = name; -+ SpoutClient.getHandle().displayGuiScreen(new GuiConnecting(SpoutClient.getHandle(), serverData)); -+ } -+ -+ public GuiScreen getJoinedFrom() { -+ return joinedFrom; -+ } -+ -+ public String getJoinedFromName() { -+ return screenName; -+ } -+ -+ public void setJoinedFrom(MainMenu screen, String name) { -+ joinedFrom = screen; -+ screenName = name; -+ } -+} ---- net/minecraft/src/BlockTripWire.java -+++ net/minecraft/src/BlockTripWire.java -@@ -5,174 +5,232 @@ - import java.util.Random; - - public class BlockTripWire extends Block { -- public BlockTripWire(int var1) { -- super(var1, Material.circuits); -+ public BlockTripWire(int par1) { -+ super(par1, Material.circuits); - this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.15625F, 1.0F); - this.setTickRandomly(true); - } - -- public int tickRate(World var1) { -+ /** -+ * How many world ticks before ticking -+ */ -+ public int tickRate(World par1World) { - return 10; - } - -- public AxisAlignedBB getCollisionBoundingBoxFromPool(World var1, int var2, int var3, int var4) { -+ /** -+ * Returns a bounding box from the pool of bounding boxes (this means this box can change after the pool has been -+ * cleared to be reused) -+ */ -+ public AxisAlignedBB getCollisionBoundingBoxFromPool(World par1World, int par2, int par3, int par4) { - return null; - } - -+ /** -+ * Is this block (a) opaque and (b) a full 1m cube? This determines whether or not to render the shared face of two -+ * adjacent blocks and also whether the player can attach torches, redstone wire, etc to this block. -+ */ - public boolean isOpaqueCube() { - return false; - } - -+ /** -+ * If this block doesn't render as an ordinary block it will return False (examples: signs, buttons, stairs, etc) -+ */ - public boolean renderAsNormalBlock() { - return false; - } - -+ /** -+ * Returns which pass should this block be rendered on. 0 for solids and 1 for alpha -+ */ - public int getRenderBlockPass() { - return 1; - } - -+ /** -+ * The type of render function that is called for this block -+ */ - public int getRenderType() { - return 30; - } - -- public int idDropped(int var1, Random var2, int var3) { -- return Item.silk.itemID; -- } -- -- public int idPicked(World var1, int var2, int var3, int var4) { -- return Item.silk.itemID; -- } -- -- public void onNeighborBlockChange(World var1, int var2, int var3, int var4, int var5) { -- int var6 = var1.getBlockMetadata(var2, var3, var4); -+ /** -+ * Returns the ID of the items to drop on destruction. -+ */ -+ public int idDropped(int par1, Random par2Random, int par3) { -+ return Item.silk.itemID; -+ } -+ -+ /** -+ * only called by clickMiddleMouseButton , and passed to inventory.setCurrentItem (along with isCreative) -+ */ -+ public int idPicked(World par1World, int par2, int par3, int par4) { -+ return Item.silk.itemID; -+ } -+ -+ /** -+ * Lets the block know when one of its neighbor changes. Doesn't know which neighbor changed (coordinates passed are -+ * their own) Args: x, y, z, neighbor blockID -+ */ -+ public void onNeighborBlockChange(World par1World, int par2, int par3, int par4, int par5) { -+ int var6 = par1World.getBlockMetadata(par2, par3, par4); - boolean var7 = (var6 & 2) == 2; -- boolean var8 = !var1.doesBlockHaveSolidTopSurface(var2, var3 - 1, var4); -- if(var7 != var8) { -- this.dropBlockAsItem(var1, var2, var3, var4, var6, 0); -- var1.setBlockToAir(var2, var3, var4); -+ boolean var8 = !par1World.doesBlockHaveSolidTopSurface(par2, par3 - 1, par4); -+ -+ if (var7 != var8) { -+ this.dropBlockAsItem(par1World, par2, par3, par4, var6, 0); -+ par1World.setBlockToAir(par2, par3, par4); - } -- - } - -- public void setBlockBoundsBasedOnState(IBlockAccess var1, int var2, int var3, int var4) { -- int var5 = var1.getBlockMetadata(var2, var3, var4); -+ /** -+ * Updates the blocks bounds based on its current state. Args: world, x, y, z -+ */ -+ public void setBlockBoundsBasedOnState(IBlockAccess par1IBlockAccess, int par2, int par3, int par4) { -+ int var5 = par1IBlockAccess.getBlockMetadata(par2, par3, par4); - boolean var6 = (var5 & 4) == 4; - boolean var7 = (var5 & 2) == 2; -- if(!var7) { -+ -+ if (!var7) { - this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.09375F, 1.0F); -- } else if(!var6) { -+ } else if (!var6) { - this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.5F, 1.0F); - } else { -- this.setBlockBounds(0.0F, 1.0F / 16.0F, 0.0F, 1.0F, 0.15625F, 1.0F); -+ this.setBlockBounds(0.0F, 0.0625F, 0.0F, 1.0F, 0.15625F, 1.0F); - } -- -- } -- -- public void onBlockAdded(World var1, int var2, int var3, int var4) { -- int var5 = var1.doesBlockHaveSolidTopSurface(var2, var3 - 1, var4) ? 0 : 2; -- var1.setBlockMetadata(var2, var3, var4, var5, 3); -- this.func_72149_e(var1, var2, var3, var4, var5); -- } -- -- public void breakBlock(World var1, int var2, int var3, int var4, int var5, int var6) { -- this.func_72149_e(var1, var2, var3, var4, var6 | 1); -- } -- -- public void onBlockHarvested(World var1, int var2, int var3, int var4, int var5, EntityPlayer var6) { -- if(!var1.isRemote) { -- if(var6.getCurrentEquippedItem() != null && var6.getCurrentEquippedItem().itemID == Item.shears.itemID) { -- var1.setBlockMetadata(var2, var3, var4, var5 | 8, 4); -+ } -+ -+ /** -+ * Called whenever the block is added into the world. Args: world, x, y, z -+ */ -+ public void onBlockAdded(World par1World, int par2, int par3, int par4) { -+ int var5 = par1World.doesBlockHaveSolidTopSurface(par2, par3 - 1, par4) ? 0 : 2; -+ par1World.setBlockMetadataWithNotify(par2, par3, par4, var5, 3); -+ this.func_72149_e(par1World, par2, par3, par4, var5); -+ } -+ -+ /** -+ * Called on server worlds only when the block has been replaced by a different block ID, or the same block with a -+ * different metadata value, but before the new metadata value is set. Args: World, x, y, z, old block ID, old metadata -+ */ -+ public void breakBlock(World par1World, int par2, int par3, int par4, int par5, int par6) { -+ this.func_72149_e(par1World, par2, par3, par4, par6 | 1); -+ } -+ -+ /** -+ * Called when the block is attempted to be harvested -+ */ -+ public void onBlockHarvested(World par1World, int par2, int par3, int par4, int par5, EntityPlayer par6EntityPlayer) { -+ if (!par1World.isRemote) { -+ if (par6EntityPlayer.getCurrentEquippedItem() != null && par6EntityPlayer.getCurrentEquippedItem().itemID == Item.shears.itemID) { -+ par1World.setBlockMetadataWithNotify(par2, par3, par4, par5 | 8, 4); - } -- - } - } - -- private void func_72149_e(World var1, int var2, int var3, int var4, int var5) { -- for(int var6 = 0; var6 < 2; ++var6) { -- for(int var7 = 1; var7 < 42; ++var7) { -- int var8 = var2 + Direction.offsetX[var6] * var7; -- int var9 = var4 + Direction.offsetZ[var6] * var7; -- int var10 = var1.getBlockId(var8, var3, var9); -- if(var10 == Block.tripWireSource.blockID) { -- int var11 = var1.getBlockMetadata(var8, var3, var9) & 3; -- if(var11 == Direction.rotateOpposite[var6]) { -- Block.tripWireSource.func_72143_a(var1, var8, var3, var9, var10, var1.getBlockMetadata(var8, var3, var9), true, var7, var5); -+ private void func_72149_e(World par1World, int par2, int par3, int par4, int par5) { -+ int var6 = 0; -+ -+ while (var6 < 2) { -+ int var7 = 1; -+ -+ while (true) { -+ if (var7 < 42) { -+ int var8 = par2 + Direction.offsetX[var6] * var7; -+ int var9 = par4 + Direction.offsetZ[var6] * var7; -+ int var10 = par1World.getBlockId(var8, par3, var9); -+ -+ if (var10 == Block.tripWireSource.blockID) { -+ int var11 = par1World.getBlockMetadata(var8, par3, var9) & 3; -+ -+ if (var11 == Direction.rotateOpposite[var6]) { -+ Block.tripWireSource.func_72143_a(par1World, var8, par3, var9, var10, par1World.getBlockMetadata(var8, par3, var9), true, var7, par5); -+ } -+ } else if (var10 == Block.tripWire.blockID) { -+ ++var7; -+ continue; - } -- break; -- } -- -- if(var10 != Block.tripWire.blockID) { -- break; -- } -- } -- } -- -- } -- -- public void onEntityCollidedWithBlock(World var1, int var2, int var3, int var4, Entity var5) { -- if(!var1.isRemote) { -- if((var1.getBlockMetadata(var2, var3, var4) & 1) != 1) { -- this.updateTripWireState(var1, var2, var3, var4); -- } -- } -- } -- -- public void updateTick(World var1, int var2, int var3, int var4, Random var5) { -- if(!var1.isRemote) { -- if((var1.getBlockMetadata(var2, var3, var4) & 1) == 1) { -- this.updateTripWireState(var1, var2, var3, var4); -- } -- } -- } -- -- private void updateTripWireState(World var1, int var2, int var3, int var4) { -- int var5 = var1.getBlockMetadata(var2, var3, var4); -+ } -+ -+ ++var6; -+ break; -+ } -+ } -+ } -+ -+ /** -+ * Triggered whenever an entity collides with this block (enters into the block). Args: world, x, y, z, entity -+ */ -+ public void onEntityCollidedWithBlock(World par1World, int par2, int par3, int par4, Entity par5Entity) { -+ if (!par1World.isRemote) { -+ if ((par1World.getBlockMetadata(par2, par3, par4) & 1) != 1) { -+ this.updateTripWireState(par1World, par2, par3, par4); -+ } -+ } -+ } -+ -+ /** -+ * Ticks the block if it's been scheduled -+ */ -+ public void updateTick(World par1World, int par2, int par3, int par4, Random par5Random) { -+ if (!par1World.isRemote) { -+ if ((par1World.getBlockMetadata(par2, par3, par4) & 1) == 1) { -+ this.updateTripWireState(par1World, par2, par3, par4); -+ } -+ } -+ } -+ -+ private void updateTripWireState(World par1World, int par2, int par3, int par4) { -+ int var5 = par1World.getBlockMetadata(par2, par3, par4); - boolean var6 = (var5 & 1) == 1; - boolean var7 = false; -- List var8 = var1.getEntitiesWithinAABBExcludingEntity((Entity)null, AxisAlignedBB.getAABBPool().getAABB((double)var2 + this.minX, (double)var3 + this.minY, (double)var4 + this.minZ, (double)var2 + this.maxX, (double)var3 + this.maxY, (double)var4 + this.maxZ)); -- if(!var8.isEmpty()) { -+ List var8 = par1World.getEntitiesWithinAABBExcludingEntity((Entity)null, AxisAlignedBB.getAABBPool().getAABB((double)par2 + this.minX, (double)par3 + this.minY, (double)par4 + this.minZ, (double)par2 + this.maxX, (double)par3 + this.maxY, (double)par4 + this.maxZ)); -+ -+ if (!var8.isEmpty()) { - Iterator var9 = var8.iterator(); - -- while(var9.hasNext()) { -+ while (var9.hasNext()) { - Entity var10 = (Entity)var9.next(); -- if(!var10.doesEntityNotTriggerPressurePlate()) { -+ -+ if (!var10.doesEntityNotTriggerPressurePlate()) { - var7 = true; - break; - } - } - } - -- if(var7 && !var6) { -+ if (var7 && !var6) { - var5 |= 1; - } - -- if(!var7 && var6) { -+ if (!var7 && var6) { - var5 &= -2; - } - -- if(var7 != var6) { -- var1.setBlockMetadata(var2, var3, var4, var5, 3); -- this.func_72149_e(var1, var2, var3, var4, var5); -- } -- -- if(var7) { -- var1.scheduleBlockUpdate(var2, var3, var4, this.blockID, this.tickRate(var1)); -- } -- -+ if (var7 != var6) { -+ par1World.setBlockMetadataWithNotify(par2, par3, par4, var5, 3); -+ this.func_72149_e(par1World, par2, par3, par4, var5); -+ } -+ -+ if (var7) { -+ par1World.scheduleBlockUpdate(par2, par3, par4, this.blockID, this.tickRate(par1World)); -+ } - } - -- public static boolean func_72148_a(IBlockAccess var0, int var1, int var2, int var3, int var4, int var5) { -- int var6 = var1 + Direction.offsetX[var5]; -- int var8 = var3 + Direction.offsetZ[var5]; -- int var9 = var0.getBlockId(var6, var2, var8); -- boolean var10 = (var4 & 2) == 2; -+ public static boolean func_72148_a(IBlockAccess par0IBlockAccess, int par1, int par2, int par3, int par4, int par5) { -+ int var6 = par1 + Direction.offsetX[par5]; -+ int var8 = par3 + Direction.offsetZ[par5]; -+ int var9 = par0IBlockAccess.getBlockId(var6, par2, var8); -+ boolean var10 = (par4 & 2) == 2; - int var11; -- if(var9 == Block.tripWireSource.blockID) { -- var11 = var0.getBlockMetadata(var6, var2, var8); -+ -+ if (var9 == Block.tripWireSource.blockID) { -+ var11 = par0IBlockAccess.getBlockMetadata(var6, par2, var8); - int var13 = var11 & 3; -- return var13 == Direction.rotateOpposite[var5]; -- } else if(var9 == Block.tripWire.blockID) { -- var11 = var0.getBlockMetadata(var6, var2, var8); -+ return var13 == Direction.rotateOpposite[par5]; -+ } else if (var9 == Block.tripWire.blockID) { -+ var11 = par0IBlockAccess.getBlockMetadata(var6, par2, var8); - boolean var12 = (var11 & 2) == 2; - return var10 == var12; - } else { ---- /dev/null -+++ org/spoutcraft/api/material/item/SpawnEgg.java -@@ -1,0 +1,26 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.api.material.item; -+ -+public class SpawnEgg extends GenericItem{ -+ public SpawnEgg(String name, int id, int data) { -+ super(name, id, data); -+ } -+} ---- net/minecraft/src/VillageDoorInfo.java -+++ net/minecraft/src/VillageDoorInfo.java -@@ -10,26 +10,33 @@ - public boolean isDetachedFromVillageFlag; - private int doorOpeningRestrictionCounter; - -- public VillageDoorInfo(int var1, int var2, int var3, int var4, int var5, int var6) { -- this.posX = var1; -- this.posY = var2; -- this.posZ = var3; -- this.insideDirectionX = var4; -- this.insideDirectionZ = var5; -- this.lastActivityTimestamp = var6; -+ public VillageDoorInfo(int par1, int par2, int par3, int par4, int par5, int par6) { -+ this.posX = par1; -+ this.posY = par2; -+ this.posZ = par3; -+ this.insideDirectionX = par4; -+ this.insideDirectionZ = par5; -+ this.lastActivityTimestamp = par6; - } - -- public int getDistanceSquared(int var1, int var2, int var3) { -- int var4 = var1 - this.posX; -- int var5 = var2 - this.posY; -- int var6 = var3 - this.posZ; -+ /** -+ * Returns the squared distance between this door and the given coordinate. -+ */ -+ public int getDistanceSquared(int par1, int par2, int par3) { -+ int var4 = par1 - this.posX; -+ int var5 = par2 - this.posY; -+ int var6 = par3 - this.posZ; - return var4 * var4 + var5 * var5 + var6 * var6; - } - -- public int getInsideDistanceSquare(int var1, int var2, int var3) { -- int var4 = var1 - this.posX - this.insideDirectionX; -- int var5 = var2 - this.posY; -- int var6 = var3 - this.posZ - this.insideDirectionZ; -+ /** -+ * Get the square of the distance from a location 2 blocks away from the door considered 'inside' and the given -+ * arguments -+ */ -+ public int getInsideDistanceSquare(int par1, int par2, int par3) { -+ int var4 = par1 - this.posX - this.insideDirectionX; -+ int var5 = par2 - this.posY; -+ int var6 = par3 - this.posZ - this.insideDirectionZ; - return var4 * var4 + var5 * var5 + var6 * var6; - } - -@@ -45,9 +52,9 @@ - return this.posZ + this.insideDirectionZ; - } - -- public boolean isInside(int var1, int var2) { -- int var3 = var1 - this.posX; -- int var4 = var2 - this.posZ; -+ public boolean isInside(int par1, int par2) { -+ int var3 = par1 - this.posX; -+ int var4 = par2 - this.posZ; - return var3 * this.insideDirectionX + var4 * this.insideDirectionZ >= 0; - } - ---- net/minecraft/src/Packet108EnchantItem.java -+++ net/minecraft/src/Packet108EnchantItem.java -@@ -6,30 +6,45 @@ - - public class Packet108EnchantItem extends Packet { - public int windowId; -+ -+ /** -+ * The position of the enchantment on the enchantment table window, starting with 0 as the topmost one. -+ */ - public int enchantment; - -- public Packet108EnchantItem() { -- } -- -- public Packet108EnchantItem(int var1, int var2) { -- this.windowId = var1; -- this.enchantment = var2; -- } -- -- public void processPacket(NetHandler var1) { -- var1.handleEnchantItem(this); -- } -- -- public void readPacketData(DataInput var1) throws IOException { -- this.windowId = var1.readByte(); -- this.enchantment = var1.readByte(); -- } -- -- public void writePacketData(DataOutput var1) throws IOException { -- var1.writeByte(this.windowId); -- var1.writeByte(this.enchantment); -- } -- -+ public Packet108EnchantItem() {} -+ -+ public Packet108EnchantItem(int par1, int par2) { -+ this.windowId = par1; -+ this.enchantment = par2; -+ } -+ -+ /** -+ * Passes this Packet on to the NetHandler for processing. -+ */ -+ public void processPacket(NetHandler par1NetHandler) { -+ par1NetHandler.handleEnchantItem(this); -+ } -+ -+ /** -+ * Abstract. Reads the raw packet data from the data stream. -+ */ -+ public void readPacketData(DataInput par1DataInput) throws IOException { -+ this.windowId = par1DataInput.readByte(); -+ this.enchantment = par1DataInput.readByte(); -+ } -+ -+ /** -+ * Abstract. Writes the raw packet data to the data stream. -+ */ -+ public void writePacketData(DataOutput par1DataOutput) throws IOException { -+ par1DataOutput.writeByte(this.windowId); -+ par1DataOutput.writeByte(this.enchantment); -+ } -+ -+ /** -+ * Abstract. Return the size of the packet (not counting the header). -+ */ - public int getPacketSize() { - return 2; - } ---- /dev/null -+++ org/spoutcraft/client/gui/about/Section.java -@@ -1,0 +1,110 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.client.gui.about; -+ -+import java.util.HashMap; -+import java.util.LinkedList; -+import java.util.List; -+ -+import org.spoutcraft.api.gui.GenericLabel; -+import org.spoutcraft.api.gui.Label; -+import org.spoutcraft.api.gui.Widget; -+ -+public abstract class Section { -+ private int x = 0; -+ private int y = 0; -+ private int width = 100; -+ private Label labelTitle; -+ -+ private static HashMap> types = new HashMap>(); -+ static { -+ type("text", TextSection.class); -+ type("table", TableSection.class); -+ type("images", ImageSection.class); -+ } -+ private static void type(String identify, Class clazz) { -+ types.put(identify, clazz); -+ } -+ public static Section getSection(String type) { -+ if (types.containsKey(type)) { -+ try { -+ return types.get(type).newInstance(); -+ } catch (InstantiationException e) { -+ } catch (IllegalAccessException e) { -+ } -+ } -+ return null; -+ } -+ -+ public Section() { -+ labelTitle = new GenericLabel("Untitled"); -+ } -+ -+ public String getTitle() { -+ return labelTitle.getText(); -+ } -+ -+ public void setTitle(String title) { -+ labelTitle.setText(title); -+ } -+ -+ public int getX() { -+ return x; -+ } -+ -+ public void setX(int x) { -+ this.x = x; -+ labelTitle.setX(x); -+ } -+ -+ public int getY() { -+ return y; -+ } -+ -+ public void setY(int y) { -+ this.y = y; -+ labelTitle.setY(y); -+ } -+ -+ public int getHeight() { -+ return 13; -+ } -+ -+ public int getWidth() { -+ return width; -+ } -+ -+ public void setWidth(int width) { -+ this.width = width; -+ update(); -+ } -+ -+ public void update() { -+ labelTitle.setWidth(getWidth()); -+ } -+ -+ public abstract void init(GuiNewAbout screen, String title, Object yaml); -+ -+ public List getWidgets() { -+ List ret = new LinkedList(); -+ ret.add(labelTitle); -+ return ret; -+ } -+} ---- net/minecraft/src/DamageSource.java -+++ net/minecraft/src/DamageSource.java -@@ -15,52 +15,80 @@ - public static DamageSource wither = (new DamageSource("wither")).setDamageBypassesArmor(); - public static DamageSource anvil = new DamageSource("anvil"); - public static DamageSource fallingBlock = new DamageSource("fallingBlock"); -+ -+ /** This kind of damage can be blocked or not. */ - private boolean isUnblockable; - private boolean isDamageAllowedInCreativeMode; - private float hungerDamage = 0.3F; -+ -+ /** This kind of damage is based on fire or not. */ - private boolean fireDamage; -+ -+ /** This kind of damage is based on a projectile or not. */ - private boolean projectile; -+ -+ /** -+ * Whether this damage source will have its damage amount scaled based on the current difficulty. -+ */ - private boolean difficultyScaled; - private boolean magicDamage; - private boolean explosion; -- public String o; -- -- public static DamageSource causeMobDamage(EntityLivingBase var0) { -- return new EntityDamageSource("mob", var0); -- } -- -- public static DamageSource causePlayerDamage(EntityPlayer var0) { -- return new EntityDamageSource("player", var0); -- } -- -- public static DamageSource causeArrowDamage(EntityArrow var0, Entity var1) { -- return (new EntityDamageSourceIndirect("arrow", var0, var1)).setProjectile(); -- } -- -- public static DamageSource causeFireballDamage(EntityFireball var0, Entity var1) { -- return var1 == null ? (new EntityDamageSourceIndirect("onFire", var0, var0)).setFireDamage().setProjectile() : (new EntityDamageSourceIndirect("fireball", var0, var1)).setFireDamage().setProjectile(); -- } -- -- public static DamageSource causeThrownDamage(Entity var0, Entity var1) { -- return (new EntityDamageSourceIndirect("thrown", var0, var1)).setProjectile(); -- } -- -- public static DamageSource causeIndirectMagicDamage(Entity var0, Entity var1) { -- return (new EntityDamageSourceIndirect("indirectMagic", var0, var1)).setDamageBypassesArmor().setMagicDamage(); -- } -- -- public static DamageSource causeThornsDamage(Entity var0) { -- return (new EntityDamageSource("thorns", var0)).setMagicDamage(); -- } -- -- public static DamageSource setExplosionSource(Explosion var0) { -- return var0 != null && var0.getExplosivePlacedBy() != null ? (new EntityDamageSource("explosion.player", var0.getExplosivePlacedBy())).setDifficultyScaled().setExplosion() : (new DamageSource("explosion")).setDifficultyScaled().setExplosion(); -- } -- -+ public String damageType; -+ -+ public static DamageSource causeMobDamage(EntityLivingBase par0EntityLivingBase) { -+ return new EntityDamageSource("mob", par0EntityLivingBase); -+ } -+ -+ /** -+ * returns an EntityDamageSource of type player -+ */ -+ public static DamageSource causePlayerDamage(EntityPlayer par0EntityPlayer) { -+ return new EntityDamageSource("player", par0EntityPlayer); -+ } -+ -+ /** -+ * returns EntityDamageSourceIndirect of an arrow -+ */ -+ public static DamageSource causeArrowDamage(EntityArrow par0EntityArrow, Entity par1Entity) { -+ return (new EntityDamageSourceIndirect("arrow", par0EntityArrow, par1Entity)).setProjectile(); -+ } -+ -+ /** -+ * returns EntityDamageSourceIndirect of a fireball -+ */ -+ public static DamageSource causeFireballDamage(EntityFireball par0EntityFireball, Entity par1Entity) { -+ return par1Entity == null ? (new EntityDamageSourceIndirect("onFire", par0EntityFireball, par0EntityFireball)).setFireDamage().setProjectile() : (new EntityDamageSourceIndirect("fireball", par0EntityFireball, par1Entity)).setFireDamage().setProjectile(); -+ } -+ -+ public static DamageSource causeThrownDamage(Entity par0Entity, Entity par1Entity) { -+ return (new EntityDamageSourceIndirect("thrown", par0Entity, par1Entity)).setProjectile(); -+ } -+ -+ public static DamageSource causeIndirectMagicDamage(Entity par0Entity, Entity par1Entity) { -+ return (new EntityDamageSourceIndirect("indirectMagic", par0Entity, par1Entity)).setDamageBypassesArmor().setMagicDamage(); -+ } -+ -+ /** -+ * Returns the EntityDamageSource of the Thorns enchantment -+ */ -+ public static DamageSource causeThornsDamage(Entity par0Entity) { -+ return (new EntityDamageSource("thorns", par0Entity)).setMagicDamage(); -+ } -+ -+ public static DamageSource setExplosionSource(Explosion par0Explosion) { -+ return par0Explosion != null && par0Explosion.getExplosivePlacedBy() != null ? (new EntityDamageSource("explosion.player", par0Explosion.getExplosivePlacedBy())).setDifficultyScaled().setExplosion() : (new DamageSource("explosion")).setDifficultyScaled().setExplosion(); -+ } -+ -+ /** -+ * Returns true if the damage is projectile based. -+ */ - public boolean isProjectile() { - return this.projectile; - } - -+ /** -+ * Define the damage type as projectile based. -+ */ - public DamageSource setProjectile() { - this.projectile = true; - return this; -@@ -79,6 +107,9 @@ - return this.isUnblockable; - } - -+ /** -+ * How much satiate(food) is consumed by this DamageSource -+ */ - public float getHungerDamage() { - return this.hungerDamage; - } -@@ -87,8 +118,8 @@ - return this.isDamageAllowedInCreativeMode; - } - -- protected DamageSource(String var1) { -- this.o = var1; -+ protected DamageSource(String par1Str) { -+ this.damageType = par1Str; - } - - public Entity getSourceOfDamage() { -@@ -110,39 +141,63 @@ - return this; - } - -+ /** -+ * Define the damage type as fire based. -+ */ - protected DamageSource setFireDamage() { - this.fireDamage = true; - return this; - } - -- public ChatMessageComponent getDeathMessage(EntityLivingBase var1) { -- EntityLivingBase var2 = var1.func_94060_bK(); -- String var3 = "death.attack." + this.o; -+ /** -+ * Returns the message to be displayed on player death. -+ */ -+ public ChatMessageComponent getDeathMessage(EntityLivingBase par1EntityLivingBase) { -+ EntityLivingBase var2 = par1EntityLivingBase.func_94060_bK(); -+ String var3 = "death.attack." + this.damageType; - String var4 = var3 + ".player"; -- return var2 != null && StatCollector.func_94522_b(var4) ? ChatMessageComponent.createFromTranslationWithSubstitutions(var4, new Object[]{var1.getTranslatedEntityName(), var2.getTranslatedEntityName()}) : ChatMessageComponent.createFromTranslationWithSubstitutions(var3, new Object[]{var1.getTranslatedEntityName()}); -+ return var2 != null && StatCollector.func_94522_b(var4) ? ChatMessageComponent.createFromTranslationWithSubstitutions(var4, new Object[] {par1EntityLivingBase.getTranslatedEntityName(), var2.getTranslatedEntityName()}): ChatMessageComponent.createFromTranslationWithSubstitutions(var3, new Object[] {par1EntityLivingBase.getTranslatedEntityName()}); - } - -+ /** -+ * Returns true if the damage is fire based. -+ */ - public boolean isFireDamage() { - return this.fireDamage; - } - -+ /** -+ * Return the name of damage type. -+ */ - public String getDamageType() { -- return this.o; -+ return this.damageType; - } - -+ /** -+ * Set whether this damage source will have its damage amount scaled based on the current difficulty. -+ */ - public DamageSource setDifficultyScaled() { - this.difficultyScaled = true; - return this; - } - -+ /** -+ * Return whether this damage source will have its damage amount scaled based on the current difficulty. -+ */ - public boolean isDifficultyScaled() { - return this.difficultyScaled; - } - -+ /** -+ * Returns true if the damage is magic based. -+ */ - public boolean isMagicDamage() { - return this.magicDamage; - } - -+ /** -+ * Define the damage type as magic based. -+ */ - public DamageSource setMagicDamage() { - this.magicDamage = true; - return this; ---- net/minecraft/src/CreativeTabMisc.java -+++ net/minecraft/src/CreativeTabMisc.java -@@ -1,10 +1,13 @@ - package net.minecraft.src; - - final class CreativeTabMisc extends CreativeTabs { -- CreativeTabMisc(int var1, String var2) { -- super(var1, var2); -+ CreativeTabMisc(int par1, String par2Str) { -+ super(par1, par2Str); - } - -+ /** -+ * the itemID for the item to be displayed on the tab -+ */ - public int getTabIconItemIndex() { - return Item.compass.itemID; - } ---- net/minecraft/src/PathEntity.java -+++ net/minecraft/src/PathEntity.java -@@ -1,66 +1,93 @@ - package net.minecraft.src; - - public class PathEntity { -+ -+ /** The actual points in the path */ - private final PathPoint[] points; -+ -+ /** PathEntity Array Index the Entity is currently targeting */ - private int currentPathIndex; -+ -+ /** The total length of the path */ - private int pathLength; - -- public PathEntity(PathPoint[] var1) { -- this.points = var1; -- this.pathLength = var1.length; -+ public PathEntity(PathPoint[] par1ArrayOfPathPoint) { -+ this.points = par1ArrayOfPathPoint; -+ this.pathLength = par1ArrayOfPathPoint.length; - } - -+ /** -+ * Directs this path to the next point in its array -+ */ - public void incrementPathIndex() { - ++this.currentPathIndex; - } - -+ /** -+ * Returns true if this path has reached the end -+ */ - public boolean isFinished() { - return this.currentPathIndex >= this.pathLength; - } - -+ /** -+ * returns the last PathPoint of the Array -+ */ - public PathPoint getFinalPathPoint() { - return this.pathLength > 0 ? this.points[this.pathLength - 1] : null; - } - -- public PathPoint getPathPointFromIndex(int var1) { -- return this.points[var1]; -+ /** -+ * return the PathPoint located at the specified PathIndex, usually the current one -+ */ -+ public PathPoint getPathPointFromIndex(int par1) { -+ return this.points[par1]; - } - - public int getCurrentPathLength() { - return this.pathLength; - } - -- public void setCurrentPathLength(int var1) { -- this.pathLength = var1; -+ public void setCurrentPathLength(int par1) { -+ this.pathLength = par1; - } - - public int getCurrentPathIndex() { - return this.currentPathIndex; - } - -- public void setCurrentPathIndex(int var1) { -- this.currentPathIndex = var1; -- } -- -- public Vec3 getVectorFromIndex(Entity var1, int var2) { -- double var3 = (double)this.points[var2].xCoord + (double)((int)(var1.width + 1.0F)) * 0.5D; -- double var5 = (double)this.points[var2].yCoord; -- double var7 = (double)this.points[var2].zCoord + (double)((int)(var1.width + 1.0F)) * 0.5D; -- return var1.worldObj.getWorldVec3Pool().getVecFromPool(var3, var5, var7); -- } -- -- public Vec3 getPosition(Entity var1) { -- return this.getVectorFromIndex(var1, this.currentPathIndex); -- } -- -- public boolean isSamePath(PathEntity var1) { -- if(var1 == null) { -+ public void setCurrentPathIndex(int par1) { -+ this.currentPathIndex = par1; -+ } -+ -+ /** -+ * Gets the vector of the PathPoint associated with the given index. -+ */ -+ public Vec3 getVectorFromIndex(Entity par1Entity, int par2) { -+ double var3 = (double)this.points[par2].xCoord + (double)((int)(par1Entity.width + 1.0F)) * 0.5D; -+ double var5 = (double)this.points[par2].yCoord; -+ double var7 = (double)this.points[par2].zCoord + (double)((int)(par1Entity.width + 1.0F)) * 0.5D; -+ return par1Entity.worldObj.getWorldVec3Pool().getVecFromPool(var3, var5, var7); -+ } -+ -+ /** -+ * returns the current PathEntity target node as Vec3D -+ */ -+ public Vec3 getPosition(Entity par1Entity) { -+ return this.getVectorFromIndex(par1Entity, this.currentPathIndex); -+ } -+ -+ /** -+ * Returns true if the EntityPath are the same. Non instance related equals. -+ */ -+ public boolean isSamePath(PathEntity par1PathEntity) { -+ if (par1PathEntity == null) { - return false; -- } else if(var1.points.length != this.points.length) { -+ } else if (par1PathEntity.points.length != this.points.length) { - return false; - } else { -- for(int var2 = 0; var2 < this.points.length; ++var2) { -- if(this.points[var2].xCoord != var1.points[var2].xCoord || this.points[var2].yCoord != var1.points[var2].yCoord || this.points[var2].zCoord != var1.points[var2].zCoord) { -+ for (int var2 = 0; var2 < this.points.length; ++var2) { -+ if (this.points[var2].xCoord != par1PathEntity.points[var2].xCoord || this.points[var2].yCoord != par1PathEntity.points[var2].yCoord || this.points[var2].zCoord != par1PathEntity.points[var2].zCoord) { - return false; - } - } -@@ -69,8 +96,11 @@ - } - } - -- public boolean isDestinationSame(Vec3 var1) { -+ /** -+ * Returns true if the final PathPoint in the PathEntity is equal to Vec3D coords. -+ */ -+ public boolean isDestinationSame(Vec3 par1Vec3) { - PathPoint var2 = this.getFinalPathPoint(); -- return var2 == null ? false : var2.xCoord == (int)var1.xCoord && var2.zCoord == (int)var1.zCoord; -+ return var2 == null ? false : var2.xCoord == (int)par1Vec3.xCoord && var2.zCoord == (int)par1Vec3.zCoord; - } - } ---- net/minecraft/src/Packet43Experience.java -+++ net/minecraft/src/Packet43Experience.java -@@ -5,44 +5,68 @@ - import java.io.IOException; - - public class Packet43Experience extends Packet { -+ -+ /** The current experience bar points. */ - public float experience; -+ -+ /** The total experience points. */ - public int experienceTotal; -+ -+ /** The experience level. */ - public int experienceLevel; - -- public Packet43Experience() { -- } -- -- public Packet43Experience(float var1, int var2, int var3) { -- this.experience = var1; -- this.experienceTotal = var2; -- this.experienceLevel = var3; -- } -- -- public void readPacketData(DataInput var1) throws IOException { -- this.experience = var1.readFloat(); -- this.experienceLevel = var1.readShort(); -- this.experienceTotal = var1.readShort(); -- } -- -- public void writePacketData(DataOutput var1) throws IOException { -- var1.writeFloat(this.experience); -- var1.writeShort(this.experienceLevel); -- var1.writeShort(this.experienceTotal); -- } -- -- public void processPacket(NetHandler var1) { -- var1.handleExperience(this); -- } -- -+ public Packet43Experience() {} -+ -+ public Packet43Experience(float par1, int par2, int par3) { -+ this.experience = par1; -+ this.experienceTotal = par2; -+ this.experienceLevel = par3; -+ } -+ -+ /** -+ * Abstract. Reads the raw packet data from the data stream. -+ */ -+ public void readPacketData(DataInput par1DataInput) throws IOException { -+ this.experience = par1DataInput.readFloat(); -+ this.experienceLevel = par1DataInput.readShort(); -+ this.experienceTotal = par1DataInput.readShort(); -+ } -+ -+ /** -+ * Abstract. Writes the raw packet data to the data stream. -+ */ -+ public void writePacketData(DataOutput par1DataOutput) throws IOException { -+ par1DataOutput.writeFloat(this.experience); -+ par1DataOutput.writeShort(this.experienceLevel); -+ par1DataOutput.writeShort(this.experienceTotal); -+ } -+ -+ /** -+ * Passes this Packet on to the NetHandler for processing. -+ */ -+ public void processPacket(NetHandler par1NetHandler) { -+ par1NetHandler.handleExperience(this); -+ } -+ -+ /** -+ * Abstract. Return the size of the packet (not counting the header). -+ */ - public int getPacketSize() { - return 4; - } - -+ /** -+ * only false for the abstract Packet class, all real packets return true -+ */ - public boolean isRealPacket() { - return true; - } - -- public boolean containsSameEntityIDAs(Packet var1) { -+ /** -+ * eg return packet30entity.entityId == entityId; WARNING : will throw if you compare a packet to a different packet -+ * class -+ */ -+ public boolean containsSameEntityIDAs(Packet par1Packet) { - return true; - } - } ---- net/minecraft/src/TileEntityNote.java -+++ net/minecraft/src/TileEntityNote.java -@@ -1,53 +1,70 @@ - package net.minecraft.src; - - public class TileEntityNote extends TileEntity { -+ -+ /** Note to play */ - public byte note; -+ -+ /** stores the latest redstone state */ - public boolean previousRedstoneState; - -- public void writeToNBT(NBTTagCompound var1) { -- super.writeToNBT(var1); -- var1.setByte("note", this.note); -+ /** -+ * Writes a tile entity to NBT. -+ */ -+ public void writeToNBT(NBTTagCompound par1NBTTagCompound) { -+ super.writeToNBT(par1NBTTagCompound); -+ par1NBTTagCompound.setByte("note", this.note); - } - -- public void readFromNBT(NBTTagCompound var1) { -- super.readFromNBT(var1); -- this.note = var1.getByte("note"); -- if(this.note < 0) { -+ /** -+ * Reads a tile entity from NBT. -+ */ -+ public void readFromNBT(NBTTagCompound par1NBTTagCompound) { -+ super.readFromNBT(par1NBTTagCompound); -+ this.note = par1NBTTagCompound.getByte("note"); -+ -+ if (this.note < 0) { - this.note = 0; - } - -- if(this.note > 24) { -+ if (this.note > 24) { - this.note = 24; - } -- - } - -+ /** -+ * change pitch by -> (currentPitch + 1) % 25 -+ */ - public void changePitch() { - this.note = (byte)((this.note + 1) % 25); - this.onInventoryChanged(); - } - -- public void triggerNote(World var1, int var2, int var3, int var4) { -- if(var1.getBlockMaterial(var2, var3 + 1, var4) == Material.air) { -- Material var5 = var1.getBlockMaterial(var2, var3 - 1, var4); -+ /** -+ * plays the stored note -+ */ -+ public void triggerNote(World par1World, int par2, int par3, int par4) { -+ if (par1World.getBlockMaterial(par2, par3 + 1, par4) == Material.air) { -+ Material var5 = par1World.getBlockMaterial(par2, par3 - 1, par4); - byte var6 = 0; -- if(var5 == Material.rock) { -+ -+ if (var5 == Material.rock) { - var6 = 1; - } - -- if(var5 == Material.sand) { -+ if (var5 == Material.sand) { - var6 = 2; - } - -- if(var5 == Material.glass) { -+ if (var5 == Material.glass) { - var6 = 3; - } - -- if(var5 == Material.wood) { -+ if (var5 == Material.wood) { - var6 = 4; - } - -- var1.addBlockEvent(var2, var3, var4, Block.music.blockID, var6, this.note); -+ par1World.addBlockEvent(par2, par3, par4, Block.music.blockID, var6, this.note); - } - } - } ---- net/minecraft/src/MapGenRavine.java -+++ net/minecraft/src/MapGenRavine.java -@@ -5,104 +5,110 @@ - public class MapGenRavine extends MapGenBase { - private float[] field_75046_d = new float[1024]; - -- protected void generateRavine(long var1, int var3, int var4, byte[] var5, double var6, double var8, double var10, float var12, float var13, float var14, int var15, int var16, double var17) { -- Random var19 = new Random(var1); -- double var20 = (double)(var3 * 16 + 8); -- double var22 = (double)(var4 * 16 + 8); -+ protected void generateRavine(long par1, int par3, int par4, byte[] par5ArrayOfByte, double par6, double par8, double par10, float par12, float par13, float par14, int par15, int par16, double par17) { -+ Random var19 = new Random(par1); -+ double var20 = (double)(par3 * 16 + 8); -+ double var22 = (double)(par4 * 16 + 8); - float var24 = 0.0F; - float var25 = 0.0F; -- if(var16 <= 0) { -+ -+ if (par16 <= 0) { - int var26 = this.range * 16 - 16; -- var16 = var26 - var19.nextInt(var26 / 4); -+ par16 = var26 - var19.nextInt(var26 / 4); - } - - boolean var53 = false; -- if(var15 == -1) { -- var15 = var16 / 2; -+ -+ if (par15 == -1) { -+ par15 = par16 / 2; - var53 = true; - } - - float var27 = 1.0F; - -- for(int var28 = 0; var28 < 128; ++var28) { -- if(var28 == 0 || var19.nextInt(3) == 0) { -+ for (int var28 = 0; var28 < 128; ++var28) { -+ if (var28 == 0 || var19.nextInt(3) == 0) { - var27 = 1.0F + var19.nextFloat() * var19.nextFloat() * 1.0F; - } - - this.field_75046_d[var28] = var27 * var27; - } - -- for(; var15 < var16; ++var15) { -- double var54 = 1.5D + (double)(MathHelper.sin((float)var15 * (float)Math.PI / (float)var16) * var12 * 1.0F); -- double var30 = var54 * var17; -+ for (; par15 < par16; ++par15) { -+ double var54 = 1.5D + (double)(MathHelper.sin((float)par15 * (float)Math.PI / (float)par16) * par12 * 1.0F); -+ double var30 = var54 * par17; - var54 *= (double)var19.nextFloat() * 0.25D + 0.75D; - var30 *= (double)var19.nextFloat() * 0.25D + 0.75D; -- float var32 = MathHelper.cos(var14); -- float var33 = MathHelper.sin(var14); -- var6 += (double)(MathHelper.cos(var13) * var32); -- var8 += (double)var33; -- var10 += (double)(MathHelper.sin(var13) * var32); -- var14 *= 0.7F; -- var14 += var25 * 0.05F; -- var13 += var24 * 0.05F; -+ float var32 = MathHelper.cos(par14); -+ float var33 = MathHelper.sin(par14); -+ par6 += (double)(MathHelper.cos(par13) * var32); -+ par8 += (double)var33; -+ par10 += (double)(MathHelper.sin(par13) * var32); -+ par14 *= 0.7F; -+ par14 += var25 * 0.05F; -+ par13 += var24 * 0.05F; - var25 *= 0.8F; - var24 *= 0.5F; - var25 += (var19.nextFloat() - var19.nextFloat()) * var19.nextFloat() * 2.0F; - var24 += (var19.nextFloat() - var19.nextFloat()) * var19.nextFloat() * 4.0F; -- if(var53 || var19.nextInt(4) != 0) { -- double var34 = var6 - var20; -- double var36 = var10 - var22; -- double var38 = (double)(var16 - var15); -- double var40 = (double)(var12 + 2.0F + 16.0F); -- if(var34 * var34 + var36 * var36 - var38 * var38 > var40 * var40) { -+ -+ if (var53 || var19.nextInt(4) != 0) { -+ double var34 = par6 - var20; -+ double var36 = par10 - var22; -+ double var38 = (double)(par16 - par15); -+ double var40 = (double)(par12 + 2.0F + 16.0F); -+ -+ if (var34 * var34 + var36 * var36 - var38 * var38 > var40 * var40) { - return; - } - -- if(var6 >= var20 - 16.0D - var54 * 2.0D && var10 >= var22 - 16.0D - var54 * 2.0D && var6 <= var20 + 16.0D + var54 * 2.0D && var10 <= var22 + 16.0D + var54 * 2.0D) { -- int var55 = MathHelper.floor_double(var6 - var54) - var3 * 16 - 1; -- int var35 = MathHelper.floor_double(var6 + var54) - var3 * 16 + 1; -- int var56 = MathHelper.floor_double(var8 - var30) - 1; -- int var37 = MathHelper.floor_double(var8 + var30) + 1; -- int var57 = MathHelper.floor_double(var10 - var54) - var4 * 16 - 1; -- int var39 = MathHelper.floor_double(var10 + var54) - var4 * 16 + 1; -- if(var55 < 0) { -+ if (par6 >= var20 - 16.0D - var54 * 2.0D && par10 >= var22 - 16.0D - var54 * 2.0D && par6 <= var20 + 16.0D + var54 * 2.0D && par10 <= var22 + 16.0D + var54 * 2.0D) { -+ int var55 = MathHelper.floor_double(par6 - var54) - par3 * 16 - 1; -+ int var35 = MathHelper.floor_double(par6 + var54) - par3 * 16 + 1; -+ int var56 = MathHelper.floor_double(par8 - var30) - 1; -+ int var37 = MathHelper.floor_double(par8 + var30) + 1; -+ int var57 = MathHelper.floor_double(par10 - var54) - par4 * 16 - 1; -+ int var39 = MathHelper.floor_double(par10 + var54) - par4 * 16 + 1; -+ -+ if (var55 < 0) { - var55 = 0; - } - -- if(var35 > 16) { -+ if (var35 > 16) { - var35 = 16; - } - -- if(var56 < 1) { -+ if (var56 < 1) { - var56 = 1; - } - -- if(var37 > 120) { -+ if (var37 > 120) { - var37 = 120; - } - -- if(var57 < 0) { -+ if (var57 < 0) { - var57 = 0; - } - -- if(var39 > 16) { -+ if (var39 > 16) { - var39 = 16; - } - - boolean var58 = false; -- - int var41; - int var44; -- for(var41 = var55; !var58 && var41 < var35; ++var41) { -- for(int var42 = var57; !var58 && var42 < var39; ++var42) { -- for(int var43 = var37 + 1; !var58 && var43 >= var56 - 1; --var43) { -+ -+ for (var41 = var55; !var58 && var41 < var35; ++var41) { -+ for (int var42 = var57; !var58 && var42 < var39; ++var42) { -+ for (int var43 = var37 + 1; !var58 && var43 >= var56 - 1; --var43) { - var44 = (var41 * 16 + var42) * 128 + var43; -- if(var43 >= 0 && var43 < 128) { -- if(var5[var44] == Block.waterMoving.blockID || var5[var44] == Block.waterStill.blockID) { -+ -+ if (var43 >= 0 && var43 < 128) { -+ if (par5ArrayOfByte[var44] == Block.waterMoving.blockID || par5ArrayOfByte[var44] == Block.waterStill.blockID) { - var58 = true; - } - -- if(var43 != var56 - 1 && var41 != var55 && var41 != var35 - 1 && var42 != var57 && var42 != var39 - 1) { -+ if (var43 != var56 - 1 && var41 != var55 && var41 != var35 - 1 && var42 != var57 && var42 != var39 - 1) { - var43 = var56; - } - } -@@ -110,30 +116,34 @@ - } - } - -- if(!var58) { -- for(var41 = var55; var41 < var35; ++var41) { -- double var59 = ((double)(var41 + var3 * 16) + 0.5D - var6) / var54; -+ if (!var58) { -+ for (var41 = var55; var41 < var35; ++var41) { -+ double var59 = ((double)(var41 + par3 * 16) + 0.5D - par6) / var54; - -- for(var44 = var57; var44 < var39; ++var44) { -- double var45 = ((double)(var44 + var4 * 16) + 0.5D - var10) / var54; -+ for (var44 = var57; var44 < var39; ++var44) { -+ double var45 = ((double)(var44 + par4 * 16) + 0.5D - par10) / var54; - int var47 = (var41 * 16 + var44) * 128 + var37; - boolean var48 = false; -- if(var59 * var59 + var45 * var45 < 1.0D) { -- for(int var49 = var37 - 1; var49 >= var56; --var49) { -- double var50 = ((double)var49 + 0.5D - var8) / var30; -- if((var59 * var59 + var45 * var45) * (double)this.field_75046_d[var49] + var50 * var50 / 6.0D < 1.0D) { -- byte var52 = var5[var47]; -- if(var52 == Block.grass.blockID) { -+ -+ if (var59 * var59 + var45 * var45 < 1.0D) { -+ for (int var49 = var37 - 1; var49 >= var56; --var49) { -+ double var50 = ((double)var49 + 0.5D - par8) / var30; -+ -+ if ((var59 * var59 + var45 * var45) * (double)this.field_75046_d[var49] + var50 * var50 / 6.0D < 1.0D) { -+ byte var52 = par5ArrayOfByte[var47]; -+ -+ if (var52 == Block.grass.blockID) { - var48 = true; - } - -- if(var52 == Block.stone.blockID || var52 == Block.dirt.blockID || var52 == Block.grass.blockID) { -- if(var49 < 10) { -- var5[var47] = (byte)Block.lavaMoving.blockID; -+ if (var52 == Block.stone.blockID || var52 == Block.dirt.blockID || var52 == Block.grass.blockID) { -+ if (var49 < 10) { -+ par5ArrayOfByte[var47] = (byte)Block.lavaMoving.blockID; - } else { -- var5[var47] = 0; -- if(var48 && var5[var47 - 1] == Block.dirt.blockID) { -- var5[var47 - 1] = this.worldObj.getBiomeGenForCoords(var41 + var3 * 16, var44 + var4 * 16).topBlock; -+ par5ArrayOfByte[var47] = 0; -+ -+ if (var48 && par5ArrayOfByte[var47 - 1] == Block.dirt.blockID) { -+ par5ArrayOfByte[var47 - 1] = this.worldObj.getBiomeGenForCoords(var41 + par3 * 16, var44 + par4 * 16).topBlock; - } - } - } -@@ -145,30 +155,31 @@ - } - } - -- if(var53) { -+ if (var53) { - break; - } - } - } - } - } -- - } - -- protected void recursiveGenerate(World var1, int var2, int var3, int var4, int var5, byte[] var6) { -- if(this.b.nextInt(50) == 0) { -- double var7 = (double)(var2 * 16 + this.b.nextInt(16)); -- double var9 = (double)(this.b.nextInt(this.b.nextInt(40) + 8) + 20); -- double var11 = (double)(var3 * 16 + this.b.nextInt(16)); -+ /** -+ * Recursively called by generate() (generate) and optionally by itself. -+ */ -+ protected void recursiveGenerate(World par1World, int par2, int par3, int par4, int par5, byte[] par6ArrayOfByte) { -+ if (this.rand.nextInt(50) == 0) { -+ double var7 = (double)(par2 * 16 + this.rand.nextInt(16)); -+ double var9 = (double)(this.rand.nextInt(this.rand.nextInt(40) + 8) + 20); -+ double var11 = (double)(par3 * 16 + this.rand.nextInt(16)); - byte var13 = 1; - -- for(int var14 = 0; var14 < var13; ++var14) { -- float var15 = this.b.nextFloat() * (float)Math.PI * 2.0F; -- float var16 = (this.b.nextFloat() - 0.5F) * 2.0F / 8.0F; -- float var17 = (this.b.nextFloat() * 2.0F + this.b.nextFloat()) * 2.0F; -- this.generateRavine(this.b.nextLong(), var4, var5, var6, var7, var9, var11, var17, var15, var16, 0, 0, 3.0D); -+ for (int var14 = 0; var14 < var13; ++var14) { -+ float var15 = this.rand.nextFloat() * (float)Math.PI * 2.0F; -+ float var16 = (this.rand.nextFloat() - 0.5F) * 2.0F / 8.0F; -+ float var17 = (this.rand.nextFloat() * 2.0F + this.rand.nextFloat()) * 2.0F; -+ this.generateRavine(this.rand.nextLong(), par4, par5, par6ArrayOfByte, var7, var9, var11, var17, var15, var16, 0, 0, 3.0D); - } -- - } - } - } ---- net/minecraft/src/WorldManager.java -+++ net/minecraft/src/WorldManager.java -@@ -1,71 +1,113 @@ - package net.minecraft.src; - - import java.util.Iterator; -+ -+import org.newdawn.slick.opengl.Texture; -+ - import net.minecraft.server.MinecraftServer; - - public class WorldManager implements IWorldAccess { -- private MinecraftServer a; -+ -+ /** Reference to the MinecraftServer object. */ -+ private MinecraftServer mcServer; -+ -+ /** The WorldServer object. */ - private WorldServer theWorldServer; - -- public WorldManager(MinecraftServer var1, WorldServer var2) { -- this.a = var1; -- this.theWorldServer = var2; -- } -- -- public void spawnParticle(String var1, double var2, double var4, double var6, double var8, double var10, double var12) { -- } -- -- public void onEntityCreate(Entity var1) { -- this.theWorldServer.getEntityTracker().trackEntity(var1); -- } -- -- public void onEntityDestroy(Entity var1) { -- this.theWorldServer.getEntityTracker().untrackEntity(var1); -- } -- -- public void playSound(String var1, double var2, double var4, double var6, float var8, float var9) { -- this.a.getConfigurationManager().sendPacketToPlayersAroundPoint(var2, var4, var6, var8 > 1.0F ? (double)(16.0F * var8) : 16.0D, this.theWorldServer.provider.dimensionId, new Packet62LevelSound(var1, var2, var4, var6, var8, var9)); -- } -- -- public void playSoundToNearExcept(EntityPlayer var1, String var2, double var3, double var5, double var7, float var9, float var10) { -- this.a.getConfigurationManager().sendToAllNearExcept(var1, var3, var5, var7, var9 > 1.0F ? (double)(16.0F * var9) : 16.0D, this.theWorldServer.provider.dimensionId, new Packet62LevelSound(var2, var3, var5, var7, var9, var10)); -- } -- -- public void markBlockRangeForRenderUpdate(int var1, int var2, int var3, int var4, int var5, int var6) { -- } -- -- public void markBlockForUpdate(int var1, int var2, int var3) { -- this.theWorldServer.getPlayerManager().markBlockForUpdate(var1, var2, var3); -- } -- -- public void markBlockForRenderUpdate(int var1, int var2, int var3) { -- } -- -- public void playRecord(String var1, int var2, int var3, int var4) { -- } -- -- public void playAuxSFX(EntityPlayer var1, int var2, int var3, int var4, int var5, int var6) { -- this.a.getConfigurationManager().sendToAllNearExcept(var1, (double)var3, (double)var4, (double)var5, 64.0D, this.theWorldServer.provider.dimensionId, new Packet61DoorChange(var2, var3, var4, var5, var6, false)); -- } -- -- public void broadcastSound(int var1, int var2, int var3, int var4, int var5) { -- this.a.getConfigurationManager().sendPacketToAllPlayers(new Packet61DoorChange(var1, var2, var3, var4, var5, true)); -- } -- -- public void destroyBlockPartially(int var1, int var2, int var3, int var4, int var5) { -- Iterator var6 = this.a.getConfigurationManager().a.iterator(); -- -- while(var6.hasNext()) { -+ public WorldManager(MinecraftServer par1MinecraftServer, WorldServer par2WorldServer) { -+ this.mcServer = par1MinecraftServer; -+ this.theWorldServer = par2WorldServer; -+ } -+ -+ /** -+ * Spawns a particle. Arg: particleType, x, y, z, velX, velY, velZ -+ */ -+ public void spawnParticle(String par1Str, double par2, double par4, double par6, double par8, double par10, double par12, Texture texture) {} -+ -+ /** -+ * Called on all IWorldAccesses when an entity is created or loaded. On client worlds, starts downloading any necessary -+ * textures. On server worlds, adds the entity to the entity tracker. -+ */ -+ public void onEntityCreate(Entity par1Entity) { -+ this.theWorldServer.getEntityTracker().addEntityToTracker(par1Entity); -+ } -+ -+ /** -+ * Called on all IWorldAccesses when an entity is unloaded or destroyed. On client worlds, releases any downloaded -+ * textures. On server worlds, removes the entity from the entity tracker. -+ */ -+ public void onEntityDestroy(Entity par1Entity) { -+ this.theWorldServer.getEntityTracker().removeEntityFromAllTrackingPlayers(par1Entity); -+ } -+ -+ /** -+ * Plays the specified sound. Arg: soundName, x, y, z, volume, pitch -+ */ -+ public void playSound(String par1Str, double par2, double par4, double par6, float par8, float par9) { -+ this.mcServer.getConfigurationManager().sendToAllNear(par2, par4, par6, par8 > 1.0F ? (double)(16.0F * par8) : 16.0D, this.theWorldServer.provider.dimensionId, new Packet62LevelSound(par1Str, par2, par4, par6, par8, par9)); -+ } -+ -+ /** -+ * Plays sound to all near players except the player reference given -+ */ -+ public void playSoundToNearExcept(EntityPlayer par1EntityPlayer, String par2Str, double par3, double par5, double par7, float par9, float par10) { -+ this.mcServer.getConfigurationManager().sendToAllNearExcept(par1EntityPlayer, par3, par5, par7, par9 > 1.0F ? (double)(16.0F * par9) : 16.0D, this.theWorldServer.provider.dimensionId, new Packet62LevelSound(par2Str, par3, par5, par7, par9, par10)); -+ } -+ -+ /** -+ * On the client, re-renders all blocks in this range, inclusive. On the server, does nothing. Args: min x, min y, min -+ * z, max x, max y, max z -+ */ -+ public void markBlockRangeForRenderUpdate(int par1, int par2, int par3, int par4, int par5, int par6) {} -+ -+ /** -+ * On the client, re-renders the block. On the server, sends the block to the client (which will re-render it), -+ * including the tile entity description packet if applicable. Args: x, y, z -+ */ -+ public void markBlockForUpdate(int par1, int par2, int par3) { -+ this.theWorldServer.getPlayerManager().markBlockForUpdate(par1, par2, par3); -+ } -+ -+ /** -+ * On the client, re-renders this block. On the server, does nothing. Used for lighting updates. -+ */ -+ public void markBlockForRenderUpdate(int par1, int par2, int par3) {} -+ -+ /** -+ * Plays the specified record. Arg: recordName, x, y, z -+ */ -+ public void playRecord(String par1Str, int par2, int par3, int par4) {} -+ -+ /** -+ * Plays a pre-canned sound effect along with potentially auxiliary data-driven one-shot behaviour (particles, etc). -+ */ -+ public void playAuxSFX(EntityPlayer par1EntityPlayer, int par2, int par3, int par4, int par5, int par6) { -+ this.mcServer.getConfigurationManager().sendToAllNearExcept(par1EntityPlayer, (double)par3, (double)par4, (double)par5, 64.0D, this.theWorldServer.provider.dimensionId, new Packet61DoorChange(par2, par3, par4, par5, par6, false)); -+ } -+ -+ public void broadcastSound(int par1, int par2, int par3, int par4, int par5) { -+ this.mcServer.getConfigurationManager().sendPacketToAllPlayers(new Packet61DoorChange(par1, par2, par3, par4, par5, true)); -+ } -+ -+ /** -+ * Starts (or continues) destroying a block with given ID at the given coordinates for the given partially destroyed -+ * value -+ */ -+ public void destroyBlockPartially(int par1, int par2, int par3, int par4, int par5) { -+ Iterator var6 = this.mcServer.getConfigurationManager().playerEntityList.iterator(); -+ -+ while (var6.hasNext()) { - EntityPlayerMP var7 = (EntityPlayerMP)var6.next(); -- if(var7 != null && var7.worldObj == this.theWorldServer && var7.entityId != var1) { -- double var8 = (double)var2 - var7.posX; -- double var10 = (double)var3 - var7.posY; -- double var12 = (double)var4 - var7.posZ; -- if(var8 * var8 + var10 * var10 + var12 * var12 < 1024.0D) { -- var7.playerNetServerHandler.sendPacket(new Packet55BlockDestroy(var1, var2, var3, var4, var5)); -+ -+ if (var7 != null && var7.worldObj == this.theWorldServer && var7.entityId != par1) { -+ double var8 = (double)par2 - var7.posX; -+ double var10 = (double)par3 - var7.posY; -+ double var12 = (double)par4 - var7.posZ; -+ -+ if (var8 * var8 + var10 * var10 + var12 * var12 < 1024.0D) { -+ var7.playerNetServerHandler.sendPacketToPlayer(new Packet55BlockDestroy(par1, par2, par3, par4, par5)); - } - } - } -- - } - } ---- net/minecraft/src/RenderFish.java -+++ net/minecraft/src/RenderFish.java -@@ -6,12 +6,15 @@ - public class RenderFish extends Render { - private static final ResourceLocation field_110792_a = new ResourceLocation("textures/particle/particles.png"); - -- public void doRenderFishHook(EntityFishHook var1, double var2, double var4, double var6, float var8, float var9) { -+ /** -+ * Actually renders the fishing line and hook -+ */ -+ public void doRenderFishHook(EntityFishHook par1EntityFishHook, double par2, double par4, double par6, float par8, float par9) { - GL11.glPushMatrix(); -- GL11.glTranslatef((float)var2, (float)var4, (float)var6); -+ GL11.glTranslatef((float)par2, (float)par4, (float)par6); - GL11.glEnable(GL12.GL_RESCALE_NORMAL); - GL11.glScalef(0.5F, 0.5F, 0.5F); -- this.bindEntityTexture(var1); -+ this.bindEntityTexture(par1EntityFishHook); - Tessellator var10 = Tessellator.instance; - byte var11 = 1; - byte var12 = 2; -@@ -33,30 +36,32 @@ - var10.draw(); - GL11.glDisable(GL12.GL_RESCALE_NORMAL); - GL11.glPopMatrix(); -- if(var1.angler != null) { -- float var20 = var1.angler.getSwingProgress(var9); -+ -+ if (par1EntityFishHook.angler != null) { -+ float var20 = par1EntityFishHook.angler.getSwingProgress(par9); - float var21 = MathHelper.sin(MathHelper.sqrt_float(var20) * (float)Math.PI); -- Vec3 var22 = var1.worldObj.getWorldVec3Pool().getVecFromPool(-0.5D, 0.03D, 0.8D); -- var22.rotateAroundX(-(var1.angler.prevRotationPitch + (var1.angler.rotationPitch - var1.angler.prevRotationPitch) * var9) * (float)Math.PI / 180.0F); -- var22.rotateAroundY(-(var1.angler.prevRotationYaw + (var1.angler.rotationYaw - var1.angler.prevRotationYaw) * var9) * (float)Math.PI / 180.0F); -+ Vec3 var22 = par1EntityFishHook.worldObj.getWorldVec3Pool().getVecFromPool(-0.5D, 0.03D, 0.8D); -+ var22.rotateAroundX(-(par1EntityFishHook.angler.prevRotationPitch + (par1EntityFishHook.angler.rotationPitch - par1EntityFishHook.angler.prevRotationPitch) * par9) * (float)Math.PI / 180.0F); -+ var22.rotateAroundY(-(par1EntityFishHook.angler.prevRotationYaw + (par1EntityFishHook.angler.rotationYaw - par1EntityFishHook.angler.prevRotationYaw) * par9) * (float)Math.PI / 180.0F); - var22.rotateAroundY(var21 * 0.5F); - var22.rotateAroundX(-var21 * 0.7F); -- double var23 = var1.angler.prevPosX + (var1.angler.posX - var1.angler.prevPosX) * (double)var9 + var22.xCoord; -- double var25 = var1.angler.prevPosY + (var1.angler.posY - var1.angler.prevPosY) * (double)var9 + var22.yCoord; -- double var27 = var1.angler.prevPosZ + (var1.angler.posZ - var1.angler.prevPosZ) * (double)var9 + var22.zCoord; -- double var29 = var1.angler == Minecraft.getMinecraft().thePlayer ? 0.0D : (double)var1.angler.getEyeHeight(); -- if(this.renderManager.options.thirdPersonView > 0 || var1.angler != Minecraft.getMinecraft().thePlayer) { -- float var31 = (var1.angler.prevRenderYawOffset + (var1.angler.renderYawOffset - var1.angler.prevRenderYawOffset) * var9) * (float)Math.PI / 180.0F; -+ double var23 = par1EntityFishHook.angler.prevPosX + (par1EntityFishHook.angler.posX - par1EntityFishHook.angler.prevPosX) * (double)par9 + var22.xCoord; -+ double var25 = par1EntityFishHook.angler.prevPosY + (par1EntityFishHook.angler.posY - par1EntityFishHook.angler.prevPosY) * (double)par9 + var22.yCoord; -+ double var27 = par1EntityFishHook.angler.prevPosZ + (par1EntityFishHook.angler.posZ - par1EntityFishHook.angler.prevPosZ) * (double)par9 + var22.zCoord; -+ double var29 = par1EntityFishHook.angler == Minecraft.getMinecraft().thePlayer ? 0.0D : (double)par1EntityFishHook.angler.getEyeHeight(); -+ -+ if (this.renderManager.options.thirdPersonView > 0 || par1EntityFishHook.angler != Minecraft.getMinecraft().thePlayer) { -+ float var31 = (par1EntityFishHook.angler.prevRenderYawOffset + (par1EntityFishHook.angler.renderYawOffset - par1EntityFishHook.angler.prevRenderYawOffset) * par9) * (float)Math.PI / 180.0F; - double var32 = (double)MathHelper.sin(var31); - double var34 = (double)MathHelper.cos(var31); -- var23 = var1.angler.prevPosX + (var1.angler.posX - var1.angler.prevPosX) * (double)var9 - var34 * 0.35D - var32 * 0.85D; -- var25 = var1.angler.prevPosY + var29 + (var1.angler.posY - var1.angler.prevPosY) * (double)var9 - 0.45D; -- var27 = var1.angler.prevPosZ + (var1.angler.posZ - var1.angler.prevPosZ) * (double)var9 - var32 * 0.35D + var34 * 0.85D; -+ var23 = par1EntityFishHook.angler.prevPosX + (par1EntityFishHook.angler.posX - par1EntityFishHook.angler.prevPosX) * (double)par9 - var34 * 0.35D - var32 * 0.85D; -+ var25 = par1EntityFishHook.angler.prevPosY + var29 + (par1EntityFishHook.angler.posY - par1EntityFishHook.angler.prevPosY) * (double)par9 - 0.45D; -+ var27 = par1EntityFishHook.angler.prevPosZ + (par1EntityFishHook.angler.posZ - par1EntityFishHook.angler.prevPosZ) * (double)par9 - var32 * 0.35D + var34 * 0.85D; - } - -- double var46 = var1.prevPosX + (var1.posX - var1.prevPosX) * (double)var9; -- double var33 = var1.prevPosY + (var1.posY - var1.prevPosY) * (double)var9 + 0.25D; -- double var35 = var1.prevPosZ + (var1.posZ - var1.prevPosZ) * (double)var9; -+ double var46 = par1EntityFishHook.prevPosX + (par1EntityFishHook.posX - par1EntityFishHook.prevPosX) * (double)par9; -+ double var33 = par1EntityFishHook.prevPosY + (par1EntityFishHook.posY - par1EntityFishHook.prevPosY) * (double)par9 + 0.25D; -+ double var35 = par1EntityFishHook.prevPosZ + (par1EntityFishHook.posZ - par1EntityFishHook.prevPosZ) * (double)par9; - double var37 = (double)((float)(var23 - var46)); - double var39 = (double)((float)(var25 - var33)); - double var41 = (double)((float)(var27 - var35)); -@@ -66,27 +71,35 @@ - var10.setColorOpaque_I(0); - byte var43 = 16; - -- for(int var44 = 0; var44 <= var43; ++var44) { -+ for (int var44 = 0; var44 <= var43; ++var44) { - float var45 = (float)var44 / (float)var43; -- var10.addVertex(var2 + var37 * (double)var45, var4 + var39 * (double)(var45 * var45 + var45) * 0.5D + 0.25D, var6 + var41 * (double)var45); -+ var10.addVertex(par2 + var37 * (double)var45, par4 + var39 * (double)(var45 * var45 + var45) * 0.5D + 0.25D, par6 + var41 * (double)var45); - } - - var10.draw(); - GL11.glEnable(GL11.GL_LIGHTING); - GL11.glEnable(GL11.GL_TEXTURE_2D); - } -- - } - -- protected ResourceLocation func_110791_a(EntityFishHook var1) { -+ protected ResourceLocation func_110791_a(EntityFishHook par1EntityFishHook) { - return field_110792_a; - } - -- protected ResourceLocation getEntityTexture(Entity var1) { -- return this.func_110791_a((EntityFishHook)var1); -+ /** -+ * Returns the location of an entity's texture. Doesn't seem to be called unless you call Render.bindEntityTexture. -+ */ -+ protected ResourceLocation getEntityTexture(Entity par1Entity) { -+ return this.func_110791_a((EntityFishHook)par1Entity); - } - -- public void doRender(Entity var1, double var2, double var4, double var6, float var8, float var9) { -- this.doRenderFishHook((EntityFishHook)var1, var2, var4, var6, var8, var9); -+ /** -+ * Actually renders the given argument. This is a synthetic bridge method, always casting down its argument and then -+ * handing it off to a worker function which does the actual work. In all probabilty, the class Render is generic -+ * (Render -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.api.material; -+ -+import org.spoutcraft.api.block.design.BlockDesign; -+ -+public interface CustomBlock extends Block { -+ public int getCustomId(); -+ -+ public String getFullName(); -+ -+ public String getAddon(); -+ -+ public CustomItem getBlockItem(); -+ -+ public int getBlockId(); -+ -+ public BlockDesign getBlockDesign(int id); -+ -+ public Block setBlockDesign(BlockDesign design, int id); -+} ---- net/minecraft/src/BlockBasePressurePlate.java -+++ net/minecraft/src/BlockBasePressurePlate.java -@@ -3,158 +3,228 @@ - import java.util.Random; - - public abstract class BlockBasePressurePlate extends Block { -- private String a; -+ private String pressurePlateIconName; - -- protected BlockBasePressurePlate(int var1, String var2, Material var3) { -- super(var1, var3); -- this.a = var2; -+ protected BlockBasePressurePlate(int par1, String par2Str, Material par3Material) { -+ super(par1, par3Material); -+ this.pressurePlateIconName = par2Str; - this.setCreativeTab(CreativeTabs.tabRedstone); - this.setTickRandomly(true); - this.func_94353_c_(this.getMetaFromWeight(15)); - } - -- public void setBlockBoundsBasedOnState(IBlockAccess var1, int var2, int var3, int var4) { -- this.func_94353_c_(var1.getBlockMetadata(var2, var3, var4)); -+ /** -+ * Updates the blocks bounds based on its current state. Args: world, x, y, z -+ */ -+ public void setBlockBoundsBasedOnState(IBlockAccess par1IBlockAccess, int par2, int par3, int par4) { -+ this.func_94353_c_(par1IBlockAccess.getBlockMetadata(par2, par3, par4)); - } - -- protected void func_94353_c_(int var1) { -- boolean var2 = this.getPowerSupply(var1) > 0; -- float var3 = 1.0F / 16.0F; -- if(var2) { -+ protected void func_94353_c_(int par1) { -+ boolean var2 = this.getPowerSupply(par1) > 0; -+ float var3 = 0.0625F; -+ -+ if (var2) { - this.setBlockBounds(var3, 0.0F, var3, 1.0F - var3, 0.03125F, 1.0F - var3); - } else { -- this.setBlockBounds(var3, 0.0F, var3, 1.0F - var3, 1.0F / 16.0F, 1.0F - var3); -+ this.setBlockBounds(var3, 0.0F, var3, 1.0F - var3, 0.0625F, 1.0F - var3); - } -- - } - -- public int tickRate(World var1) { -+ /** -+ * How many world ticks before ticking -+ */ -+ public int tickRate(World par1World) { - return 20; - } - -- public AxisAlignedBB getCollisionBoundingBoxFromPool(World var1, int var2, int var3, int var4) { -+ /** -+ * Returns a bounding box from the pool of bounding boxes (this means this box can change after the pool has been -+ * cleared to be reused) -+ */ -+ public AxisAlignedBB getCollisionBoundingBoxFromPool(World par1World, int par2, int par3, int par4) { - return null; - } - -+ /** -+ * Is this block (a) opaque and (b) a full 1m cube? This determines whether or not to render the shared face of two -+ * adjacent blocks and also whether the player can attach torches, redstone wire, etc to this block. -+ */ - public boolean isOpaqueCube() { - return false; - } - -+ /** -+ * If this block doesn't render as an ordinary block it will return False (examples: signs, buttons, stairs, etc) -+ */ - public boolean renderAsNormalBlock() { - return false; - } - -- public boolean getBlocksMovement(IBlockAccess var1, int var2, int var3, int var4) { -+ public boolean getBlocksMovement(IBlockAccess par1IBlockAccess, int par2, int par3, int par4) { - return true; - } - -- public boolean canPlaceBlockAt(World var1, int var2, int var3, int var4) { -- return var1.doesBlockHaveSolidTopSurface(var2, var3 - 1, var4) || BlockFence.isIdAFence(var1.getBlockId(var2, var3 - 1, var4)); -+ /** -+ * Checks to see if its valid to put this block at the specified coordinates. Args: world, x, y, z -+ */ -+ public boolean canPlaceBlockAt(World par1World, int par2, int par3, int par4) { -+ return par1World.doesBlockHaveSolidTopSurface(par2, par3 - 1, par4) || BlockFence.isIdAFence(par1World.getBlockId(par2, par3 - 1, par4)); - } - -- public void onNeighborBlockChange(World var1, int var2, int var3, int var4, int var5) { -+ /** -+ * Lets the block know when one of its neighbor changes. Doesn't know which neighbor changed (coordinates passed are -+ * their own) Args: x, y, z, neighbor blockID -+ */ -+ public void onNeighborBlockChange(World par1World, int par2, int par3, int par4, int par5) { - boolean var6 = false; -- if(!var1.doesBlockHaveSolidTopSurface(var2, var3 - 1, var4) && !BlockFence.isIdAFence(var1.getBlockId(var2, var3 - 1, var4))) { -+ -+ if (!par1World.doesBlockHaveSolidTopSurface(par2, par3 - 1, par4) && !BlockFence.isIdAFence(par1World.getBlockId(par2, par3 - 1, par4))) { - var6 = true; - } - -- if(var6) { -- this.dropBlockAsItem(var1, var2, var3, var4, var1.getBlockMetadata(var2, var3, var4), 0); -- var1.setBlockToAir(var2, var3, var4); -- } -- -- } -- -- public void updateTick(World var1, int var2, int var3, int var4, Random var5) { -- if(!var1.isRemote) { -- int var6 = this.getPowerSupply(var1.getBlockMetadata(var2, var3, var4)); -- if(var6 > 0) { -- this.setStateIfMobInteractsWithPlate(var1, var2, var3, var4, var6); -- } -- -- } -- } -- -- public void onEntityCollidedWithBlock(World var1, int var2, int var3, int var4, Entity var5) { -- if(!var1.isRemote) { -- int var6 = this.getPowerSupply(var1.getBlockMetadata(var2, var3, var4)); -- if(var6 == 0) { -- this.setStateIfMobInteractsWithPlate(var1, var2, var3, var4, var6); -- } -- -- } -- } -- -- protected void setStateIfMobInteractsWithPlate(World var1, int var2, int var3, int var4, int var5) { -- int var6 = this.getPlateState(var1, var2, var3, var4); -- boolean var7 = var5 > 0; -+ if (var6) { -+ this.dropBlockAsItem(par1World, par2, par3, par4, par1World.getBlockMetadata(par2, par3, par4), 0); -+ par1World.setBlockToAir(par2, par3, par4); -+ } -+ } -+ -+ /** -+ * Ticks the block if it's been scheduled -+ */ -+ public void updateTick(World par1World, int par2, int par3, int par4, Random par5Random) { -+ if (!par1World.isRemote) { -+ int var6 = this.getPowerSupply(par1World.getBlockMetadata(par2, par3, par4)); -+ -+ if (var6 > 0) { -+ this.setStateIfMobInteractsWithPlate(par1World, par2, par3, par4, var6); -+ } -+ } -+ } -+ -+ /** -+ * Triggered whenever an entity collides with this block (enters into the block). Args: world, x, y, z, entity -+ */ -+ public void onEntityCollidedWithBlock(World par1World, int par2, int par3, int par4, Entity par5Entity) { -+ if (!par1World.isRemote) { -+ int var6 = this.getPowerSupply(par1World.getBlockMetadata(par2, par3, par4)); -+ -+ if (var6 == 0) { -+ this.setStateIfMobInteractsWithPlate(par1World, par2, par3, par4, var6); -+ } -+ } -+ } -+ -+ /** -+ * Checks if there are mobs on the plate. If a mob is on the plate and it is off, it turns it on, and vice versa. -+ */ -+ protected void setStateIfMobInteractsWithPlate(World par1World, int par2, int par3, int par4, int par5) { -+ int var6 = this.getPlateState(par1World, par2, par3, par4); -+ boolean var7 = par5 > 0; - boolean var8 = var6 > 0; -- if(var5 != var6) { -- var1.setBlockMetadata(var2, var3, var4, this.getMetaFromWeight(var6), 2); -- this.func_94354_b_(var1, var2, var3, var4); -- var1.markBlockRangeForRenderUpdate(var2, var3, var4, var2, var3, var4); -- } -- -- if(!var8 && var7) { -- var1.playSoundEffect((double)var2 + 0.5D, (double)var3 + 0.1D, (double)var4 + 0.5D, "random.click", 0.3F, 0.5F); -- } else if(var8 && !var7) { -- var1.playSoundEffect((double)var2 + 0.5D, (double)var3 + 0.1D, (double)var4 + 0.5D, "random.click", 0.3F, 0.6F); -- } -- -- if(var8) { -- var1.scheduleBlockUpdate(var2, var3, var4, this.blockID, this.tickRate(var1)); -- } -- -- } -- -- protected AxisAlignedBB getSensitiveAABB(int var1, int var2, int var3) { -- float var4 = 2.0F / 16.0F; -- return AxisAlignedBB.getAABBPool().getAABB((double)((float)var1 + var4), (double)var2, (double)((float)var3 + var4), (double)((float)(var1 + 1) - var4), (double)var2 + 0.25D, (double)((float)(var3 + 1) - var4)); -- } -- -- public void breakBlock(World var1, int var2, int var3, int var4, int var5, int var6) { -- if(this.getPowerSupply(var6) > 0) { -- this.func_94354_b_(var1, var2, var3, var4); -- } -- -- super.breakBlock(var1, var2, var3, var4, var5, var6); -- } -- -- protected void func_94354_b_(World var1, int var2, int var3, int var4) { -- var1.notifyBlocksOfNeighborChange(var2, var3, var4, this.blockID); -- var1.notifyBlocksOfNeighborChange(var2, var3 - 1, var4, this.blockID); -- } -- -- public int isProvidingWeakPower(IBlockAccess var1, int var2, int var3, int var4, int var5) { -- return this.getPowerSupply(var1.getBlockMetadata(var2, var3, var4)); -- } -- -- public int isProvidingStrongPower(IBlockAccess var1, int var2, int var3, int var4, int var5) { -- return var5 == 1 ? this.getPowerSupply(var1.getBlockMetadata(var2, var3, var4)) : 0; -- } -- -+ -+ if (par5 != var6) { -+ par1World.setBlockMetadataWithNotify(par2, par3, par4, this.getMetaFromWeight(var6), 2); -+ this.func_94354_b_(par1World, par2, par3, par4); -+ par1World.markBlockRangeForRenderUpdate(par2, par3, par4, par2, par3, par4); -+ } -+ -+ if (!var8 && var7) { -+ par1World.playSoundEffect((double)par2 + 0.5D, (double)par3 + 0.1D, (double)par4 + 0.5D, "random.click", 0.3F, 0.5F); -+ } else if (var8 && !var7) { -+ par1World.playSoundEffect((double)par2 + 0.5D, (double)par3 + 0.1D, (double)par4 + 0.5D, "random.click", 0.3F, 0.6F); -+ } -+ -+ if (var8) { -+ par1World.scheduleBlockUpdate(par2, par3, par4, this.blockID, this.tickRate(par1World)); -+ } -+ } -+ -+ protected AxisAlignedBB getSensitiveAABB(int par1, int par2, int par3) { -+ float var4 = 0.125F; -+ return AxisAlignedBB.getAABBPool().getAABB((double)((float)par1 + var4), (double)par2, (double)((float)par3 + var4), (double)((float)(par1 + 1) - var4), (double)par2 + 0.25D, (double)((float)(par3 + 1) - var4)); -+ } -+ -+ /** -+ * Called on server worlds only when the block has been replaced by a different block ID, or the same block with a -+ * different metadata value, but before the new metadata value is set. Args: World, x, y, z, old block ID, old metadata -+ */ -+ public void breakBlock(World par1World, int par2, int par3, int par4, int par5, int par6) { -+ if (this.getPowerSupply(par6) > 0) { -+ this.func_94354_b_(par1World, par2, par3, par4); -+ } -+ -+ super.breakBlock(par1World, par2, par3, par4, par5, par6); -+ } -+ -+ protected void func_94354_b_(World par1World, int par2, int par3, int par4) { -+ par1World.notifyBlocksOfNeighborChange(par2, par3, par4, this.blockID); -+ par1World.notifyBlocksOfNeighborChange(par2, par3 - 1, par4, this.blockID); -+ } -+ -+ /** -+ * Returns true if the block is emitting indirect/weak redstone power on the specified side. If isBlockNormalCube -+ * returns true, standard redstone propagation rules will apply instead and this will not be called. Args: World, X, Y, -+ * Z, side. Note that the side is reversed - eg it is 1 (up) when checking the bottom of the block. -+ */ -+ public int isProvidingWeakPower(IBlockAccess par1IBlockAccess, int par2, int par3, int par4, int par5) { -+ return this.getPowerSupply(par1IBlockAccess.getBlockMetadata(par2, par3, par4)); -+ } -+ -+ /** -+ * Returns true if the block is emitting direct/strong redstone power on the specified side. Args: World, X, Y, Z, -+ * side. Note that the side is reversed - eg it is 1 (up) when checking the bottom of the block. -+ */ -+ public int isProvidingStrongPower(IBlockAccess par1IBlockAccess, int par2, int par3, int par4, int par5) { -+ return par5 == 1 ? this.getPowerSupply(par1IBlockAccess.getBlockMetadata(par2, par3, par4)) : 0; -+ } -+ -+ /** -+ * Can this block provide power. Only wire currently seems to have this change based on its state. -+ */ - public boolean canProvidePower() { - return true; - } - -+ /** -+ * Sets the block's bounds for rendering it as an item -+ */ - public void setBlockBoundsForItemRender() { - float var1 = 0.5F; -- float var2 = 2.0F / 16.0F; -+ float var2 = 0.125F; - float var3 = 0.5F; - this.setBlockBounds(0.5F - var1, 0.5F - var2, 0.5F - var3, 0.5F + var1, 0.5F + var2, 0.5F + var3); - } - -+ /** -+ * Returns the mobility information of the block, 0 = free, 1 = can't push but can move over, 2 = total immobility and -+ * stop pistons -+ */ - public int getMobilityFlag() { - return 1; - } - -+ /** -+ * Returns the current state of the pressure plate. Returns a value between 0 and 15 based on the number of items on -+ * it. -+ */ - protected abstract int getPlateState(World var1, int var2, int var3, int var4); - -+ /** -+ * Argument is metadata. Returns power level (0-15) -+ */ - protected abstract int getPowerSupply(int var1); - -+ /** -+ * Argument is weight (0-15). Return the metadata to be set because of it. -+ */ - protected abstract int getMetaFromWeight(int var1); - -- public void registerIcons(IconRegister var1) { -- this.blockIcon = var1.registerIcon(this.a); -+ /** -+ * When this method is called, your block should register all the icons it needs with the given IconRegister. This is -+ * the only chance you get to register icons. -+ */ -+ public void registerIcons(IconRegister par1IconRegister) { -+ this.blockIcon = par1IconRegister.registerIcon(this.pressurePlateIconName); - } - } ---- net/minecraft/src/Packet7UseEntity.java -+++ net/minecraft/src/Packet7UseEntity.java -@@ -5,35 +5,54 @@ - import java.io.IOException; - - public class Packet7UseEntity extends Packet { -+ -+ /** The entity of the player (ignored by the server) */ - public int playerEntityId; -+ -+ /** The entity the player is interacting with */ - public int targetEntity; -+ -+ /** -+ * Seems to be true when the player is pointing at an entity and left-clicking and false when right-clicking. -+ */ - public int isLeftClick; - -- public Packet7UseEntity() { -- } -- -- public Packet7UseEntity(int var1, int var2, int var3) { -- this.playerEntityId = var1; -- this.targetEntity = var2; -- this.isLeftClick = var3; -- } -- -- public void readPacketData(DataInput var1) throws IOException { -- this.playerEntityId = var1.readInt(); -- this.targetEntity = var1.readInt(); -- this.isLeftClick = var1.readByte(); -- } -- -- public void writePacketData(DataOutput var1) throws IOException { -- var1.writeInt(this.playerEntityId); -- var1.writeInt(this.targetEntity); -- var1.writeByte(this.isLeftClick); -- } -- -- public void processPacket(NetHandler var1) { -- var1.handleUseEntity(this); -- } -- -+ public Packet7UseEntity() {} -+ -+ public Packet7UseEntity(int par1, int par2, int par3) { -+ this.playerEntityId = par1; -+ this.targetEntity = par2; -+ this.isLeftClick = par3; -+ } -+ -+ /** -+ * Abstract. Reads the raw packet data from the data stream. -+ */ -+ public void readPacketData(DataInput par1DataInput) throws IOException { -+ this.playerEntityId = par1DataInput.readInt(); -+ this.targetEntity = par1DataInput.readInt(); -+ this.isLeftClick = par1DataInput.readByte(); -+ } -+ -+ /** -+ * Abstract. Writes the raw packet data to the data stream. -+ */ -+ public void writePacketData(DataOutput par1DataOutput) throws IOException { -+ par1DataOutput.writeInt(this.playerEntityId); -+ par1DataOutput.writeInt(this.targetEntity); -+ par1DataOutput.writeByte(this.isLeftClick); -+ } -+ -+ /** -+ * Passes this Packet on to the NetHandler for processing. -+ */ -+ public void processPacket(NetHandler par1NetHandler) { -+ par1NetHandler.handleUseEntity(this); -+ } -+ -+ /** -+ * Abstract. Return the size of the packet (not counting the header). -+ */ - public int getPacketSize() { - return 9; - } ---- net/minecraft/src/BlockDoor.java -+++ net/minecraft/src/BlockDoor.java -@@ -6,46 +6,53 @@ - private Icon[] field_111044_a; - private Icon[] field_111043_b; - -- protected BlockDoor(int var1, Material var2) { -- super(var1, var2); -+ protected BlockDoor(int par1, Material par2Material) { -+ super(par1, par2Material); - float var3 = 0.5F; - float var4 = 1.0F; - this.setBlockBounds(0.5F - var3, 0.0F, 0.5F - var3, 0.5F + var3, var4, 0.5F + var3); - } - -- public Icon getIcon(int var1, int var2) { -+ /** -+ * From the specified side and block metadata retrieves the blocks texture. Args: side, metadata -+ */ -+ public Icon getIcon(int par1, int par2) { - return this.field_111043_b[0]; - } - -- public Icon getBlockTexture(IBlockAccess var1, int var2, int var3, int var4, int var5) { -- if(var5 != 1 && var5 != 0) { -- int var6 = this.getFullMetadata(var1, var2, var3, var4); -+ /** -+ * Retrieves the block texture to use based on the display side. Args: iBlockAccess, x, y, z, side -+ */ -+ public Icon getBlockTexture(IBlockAccess par1IBlockAccess, int par2, int par3, int par4, int par5) { -+ if (par5 != 1 && par5 != 0) { -+ int var6 = this.getFullMetadata(par1IBlockAccess, par2, par3, par4); - int var7 = var6 & 3; - boolean var8 = (var6 & 4) != 0; - boolean var9 = false; - boolean var10 = (var6 & 8) != 0; -- if(var8) { -- if(var7 == 0 && var5 == 2) { -- var9 = !var9; -- } else if(var7 == 1 && var5 == 5) { -- var9 = !var9; -- } else if(var7 == 2 && var5 == 3) { -- var9 = !var9; -- } else if(var7 == 3 && var5 == 4) { -+ -+ if (var8) { -+ if (var7 == 0 && par5 == 2) { -+ var9 = !var9; -+ } else if (var7 == 1 && par5 == 5) { -+ var9 = !var9; -+ } else if (var7 == 2 && par5 == 3) { -+ var9 = !var9; -+ } else if (var7 == 3 && par5 == 4) { - var9 = !var9; - } - } else { -- if(var7 == 0 && var5 == 5) { -- var9 = !var9; -- } else if(var7 == 1 && var5 == 3) { -- var9 = !var9; -- } else if(var7 == 2 && var5 == 4) { -- var9 = !var9; -- } else if(var7 == 3 && var5 == 2) { -+ if (var7 == 0 && par5 == 5) { -+ var9 = !var9; -+ } else if (var7 == 1 && par5 == 3) { -+ var9 = !var9; -+ } else if (var7 == 2 && par5 == 4) { -+ var9 = !var9; -+ } else if (var7 == 3 && par5 == 2) { - var9 = !var9; - } - -- if((var6 & 16) != 0) { -+ if ((var6 & 16) != 0) { - var9 = !var9; - } - } -@@ -56,63 +63,91 @@ - } - } - -- public void registerIcons(IconRegister var1) { -+ /** -+ * When this method is called, your block should register all the icons it needs with the given IconRegister. This is -+ * the only chance you get to register icons. -+ */ -+ public void registerIcons(IconRegister par1IconRegister) { - this.field_111044_a = new Icon[2]; - this.field_111043_b = new Icon[2]; -- this.field_111044_a[0] = var1.registerIcon(this.getTextureName() + "_upper"); -- this.field_111043_b[0] = var1.registerIcon(this.getTextureName() + "_lower"); -+ this.field_111044_a[0] = par1IconRegister.registerIcon(this.getTextureName() + "_upper"); -+ this.field_111043_b[0] = par1IconRegister.registerIcon(this.getTextureName() + "_lower"); - this.field_111044_a[1] = new IconFlipped(this.field_111044_a[0], true, false); - this.field_111043_b[1] = new IconFlipped(this.field_111043_b[0], true, false); - } - -+ /** -+ * Is this block (a) opaque and (b) a full 1m cube? This determines whether or not to render the shared face of two -+ * adjacent blocks and also whether the player can attach torches, redstone wire, etc to this block. -+ */ - public boolean isOpaqueCube() { - return false; - } - -- public boolean getBlocksMovement(IBlockAccess var1, int var2, int var3, int var4) { -- int var5 = this.getFullMetadata(var1, var2, var3, var4); -+ public boolean getBlocksMovement(IBlockAccess par1IBlockAccess, int par2, int par3, int par4) { -+ int var5 = this.getFullMetadata(par1IBlockAccess, par2, par3, par4); - return (var5 & 4) != 0; - } - -+ /** -+ * If this block doesn't render as an ordinary block it will return False (examples: signs, buttons, stairs, etc) -+ */ - public boolean renderAsNormalBlock() { - return false; - } - -+ /** -+ * The type of render function that is called for this block -+ */ - public int getRenderType() { - return 7; - } - -- public AxisAlignedBB getSelectedBoundingBoxFromPool(World var1, int var2, int var3, int var4) { -- this.setBlockBoundsBasedOnState(var1, var2, var3, var4); -- return super.getSelectedBoundingBoxFromPool(var1, var2, var3, var4); -- } -- -- public AxisAlignedBB getCollisionBoundingBoxFromPool(World var1, int var2, int var3, int var4) { -- this.setBlockBoundsBasedOnState(var1, var2, var3, var4); -- return super.getCollisionBoundingBoxFromPool(var1, var2, var3, var4); -- } -- -- public void setBlockBoundsBasedOnState(IBlockAccess var1, int var2, int var3, int var4) { -- this.setDoorRotation(this.getFullMetadata(var1, var2, var3, var4)); -- } -- -- public int getDoorOrientation(IBlockAccess var1, int var2, int var3, int var4) { -- return this.getFullMetadata(var1, var2, var3, var4) & 3; -- } -- -- public boolean isDoorOpen(IBlockAccess var1, int var2, int var3, int var4) { -- return (this.getFullMetadata(var1, var2, var3, var4) & 4) != 0; -- } -- -- private void setDoorRotation(int var1) { -- float var2 = 3.0F / 16.0F; -+ /** -+ * Returns the bounding box of the wired rectangular prism to render. -+ */ -+ public AxisAlignedBB getSelectedBoundingBoxFromPool(World par1World, int par2, int par3, int par4) { -+ this.setBlockBoundsBasedOnState(par1World, par2, par3, par4); -+ return super.getSelectedBoundingBoxFromPool(par1World, par2, par3, par4); -+ } -+ -+ /** -+ * Returns a bounding box from the pool of bounding boxes (this means this box can change after the pool has been -+ * cleared to be reused) -+ */ -+ public AxisAlignedBB getCollisionBoundingBoxFromPool(World par1World, int par2, int par3, int par4) { -+ this.setBlockBoundsBasedOnState(par1World, par2, par3, par4); -+ return super.getCollisionBoundingBoxFromPool(par1World, par2, par3, par4); -+ } -+ -+ /** -+ * Updates the blocks bounds based on its current state. Args: world, x, y, z -+ */ -+ public void setBlockBoundsBasedOnState(IBlockAccess par1IBlockAccess, int par2, int par3, int par4) { -+ this.setDoorRotation(this.getFullMetadata(par1IBlockAccess, par2, par3, par4)); -+ } -+ -+ /** -+ * Returns 0, 1, 2 or 3 depending on where the hinge is. -+ */ -+ public int getDoorOrientation(IBlockAccess par1IBlockAccess, int par2, int par3, int par4) { -+ return this.getFullMetadata(par1IBlockAccess, par2, par3, par4) & 3; -+ } -+ -+ public boolean isDoorOpen(IBlockAccess par1IBlockAccess, int par2, int par3, int par4) { -+ return (this.getFullMetadata(par1IBlockAccess, par2, par3, par4) & 4) != 0; -+ } -+ -+ private void setDoorRotation(int par1) { -+ float var2 = 0.1875F; - this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 2.0F, 1.0F); -- int var3 = var1 & 3; -- boolean var4 = (var1 & 4) != 0; -- boolean var5 = (var1 & 16) != 0; -- if(var3 == 0) { -- if(var4) { -- if(!var5) { -+ int var3 = par1 & 3; -+ boolean var4 = (par1 & 4) != 0; -+ boolean var5 = (par1 & 16) != 0; -+ -+ if (var3 == 0) { -+ if (var4) { -+ if (!var5) { - this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, var2); - } else { - this.setBlockBounds(0.0F, 0.0F, 1.0F - var2, 1.0F, 1.0F, 1.0F); -@@ -120,9 +155,9 @@ - } else { - this.setBlockBounds(0.0F, 0.0F, 0.0F, var2, 1.0F, 1.0F); - } -- } else if(var3 == 1) { -- if(var4) { -- if(!var5) { -+ } else if (var3 == 1) { -+ if (var4) { -+ if (!var5) { - this.setBlockBounds(1.0F - var2, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F); - } else { - this.setBlockBounds(0.0F, 0.0F, 0.0F, var2, 1.0F, 1.0F); -@@ -130,9 +165,9 @@ - } else { - this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, var2); - } -- } else if(var3 == 2) { -- if(var4) { -- if(!var5) { -+ } else if (var3 == 2) { -+ if (var4) { -+ if (!var5) { - this.setBlockBounds(0.0F, 0.0F, 1.0F - var2, 1.0F, 1.0F, 1.0F); - } else { - this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, var2); -@@ -140,9 +175,9 @@ - } else { - this.setBlockBounds(1.0F - var2, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F); - } -- } else if(var3 == 3) { -- if(var4) { -- if(!var5) { -+ } else if (var3 == 3) { -+ if (var4) { -+ if (!var5) { - this.setBlockBounds(0.0F, 0.0F, 0.0F, var2, 1.0F, 1.0F); - } else { - this.setBlockBounds(1.0F - var2, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F); -@@ -151,131 +186,171 @@ - this.setBlockBounds(0.0F, 0.0F, 1.0F - var2, 1.0F, 1.0F, 1.0F); - } - } -- -- } -- -- public void onBlockClicked(World var1, int var2, int var3, int var4, EntityPlayer var5) { -- } -- -- public boolean onBlockActivated(World var1, int var2, int var3, int var4, EntityPlayer var5, int var6, float var7, float var8, float var9) { -- if(this.blockMaterial == Material.iron) { -+ } -+ -+ /** -+ * Called when the block is clicked by a player. Args: x, y, z, entityPlayer -+ */ -+ public void onBlockClicked(World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer) {} -+ -+ /** -+ * Called upon block activation (right click on the block.) -+ */ -+ public boolean onBlockActivated(World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer, int par6, float par7, float par8, float par9) { -+ if (this.blockMaterial == Material.iron) { - return true; - } else { -- int var10 = this.getFullMetadata(var1, var2, var3, var4); -+ int var10 = this.getFullMetadata(par1World, par2, par3, par4); - int var11 = var10 & 7; - var11 ^= 4; -- if((var10 & 8) == 0) { -- var1.setBlockMetadata(var2, var3, var4, var11, 2); -- var1.markBlockRangeForRenderUpdate(var2, var3, var4, var2, var3, var4); -+ -+ if ((var10 & 8) == 0) { -+ par1World.setBlockMetadataWithNotify(par2, par3, par4, var11, 2); -+ par1World.markBlockRangeForRenderUpdate(par2, par3, par4, par2, par3, par4); - } else { -- var1.setBlockMetadata(var2, var3 - 1, var4, var11, 2); -- var1.markBlockRangeForRenderUpdate(var2, var3 - 1, var4, var2, var3, var4); -+ par1World.setBlockMetadataWithNotify(par2, par3 - 1, par4, var11, 2); -+ par1World.markBlockRangeForRenderUpdate(par2, par3 - 1, par4, par2, par3, par4); - } - -- var1.playAuxSFXAtEntity(var5, 1003, var2, var3, var4, 0); -+ par1World.playAuxSFXAtEntity(par5EntityPlayer, 1003, par2, par3, par4, 0); - return true; - } - } - -- public void onPoweredBlockChange(World var1, int var2, int var3, int var4, boolean var5) { -- int var6 = this.getFullMetadata(var1, var2, var3, var4); -+ /** -+ * A function to open a door. -+ */ -+ public void onPoweredBlockChange(World par1World, int par2, int par3, int par4, boolean par5) { -+ int var6 = this.getFullMetadata(par1World, par2, par3, par4); - boolean var7 = (var6 & 4) != 0; -- if(var7 != var5) { -+ -+ if (var7 != par5) { - int var8 = var6 & 7; - var8 ^= 4; -- if((var6 & 8) == 0) { -- var1.setBlockMetadata(var2, var3, var4, var8, 2); -- var1.markBlockRangeForRenderUpdate(var2, var3, var4, var2, var3, var4); -+ -+ if ((var6 & 8) == 0) { -+ par1World.setBlockMetadataWithNotify(par2, par3, par4, var8, 2); -+ par1World.markBlockRangeForRenderUpdate(par2, par3, par4, par2, par3, par4); - } else { -- var1.setBlockMetadata(var2, var3 - 1, var4, var8, 2); -- var1.markBlockRangeForRenderUpdate(var2, var3 - 1, var4, var2, var3, var4); -+ par1World.setBlockMetadataWithNotify(par2, par3 - 1, par4, var8, 2); -+ par1World.markBlockRangeForRenderUpdate(par2, par3 - 1, par4, par2, par3, par4); - } - -- var1.playAuxSFXAtEntity((EntityPlayer)null, 1003, var2, var3, var4, 0); -+ par1World.playAuxSFXAtEntity((EntityPlayer)null, 1003, par2, par3, par4, 0); - } - } - -- public void onNeighborBlockChange(World var1, int var2, int var3, int var4, int var5) { -- int var6 = var1.getBlockMetadata(var2, var3, var4); -- if((var6 & 8) == 0) { -+ /** -+ * Lets the block know when one of its neighbor changes. Doesn't know which neighbor changed (coordinates passed are -+ * their own) Args: x, y, z, neighbor blockID -+ */ -+ public void onNeighborBlockChange(World par1World, int par2, int par3, int par4, int par5) { -+ int var6 = par1World.getBlockMetadata(par2, par3, par4); -+ -+ if ((var6 & 8) == 0) { - boolean var7 = false; -- if(var1.getBlockId(var2, var3 + 1, var4) != this.blockID) { -- var1.setBlockToAir(var2, var3, var4); -+ -+ if (par1World.getBlockId(par2, par3 + 1, par4) != this.blockID) { -+ par1World.setBlockToAir(par2, par3, par4); - var7 = true; - } - -- if(!var1.doesBlockHaveSolidTopSurface(var2, var3 - 1, var4)) { -- var1.setBlockToAir(var2, var3, var4); -+ if (!par1World.doesBlockHaveSolidTopSurface(par2, par3 - 1, par4)) { -+ par1World.setBlockToAir(par2, par3, par4); - var7 = true; -- if(var1.getBlockId(var2, var3 + 1, var4) == this.blockID) { -- var1.setBlockToAir(var2, var3 + 1, var4); -+ -+ if (par1World.getBlockId(par2, par3 + 1, par4) == this.blockID) { -+ par1World.setBlockToAir(par2, par3 + 1, par4); - } - } - -- if(var7) { -- if(!var1.isRemote) { -- this.dropBlockAsItem(var1, var2, var3, var4, var6, 0); -+ if (var7) { -+ if (!par1World.isRemote) { -+ this.dropBlockAsItem(par1World, par2, par3, par4, var6, 0); - } - } else { -- boolean var8 = var1.isBlockIndirectlyGettingPowered(var2, var3, var4) || var1.isBlockIndirectlyGettingPowered(var2, var3 + 1, var4); -- if((var8 || var5 > 0 && Block.blocksList[var5].canProvidePower()) && var5 != this.blockID) { -- this.onPoweredBlockChange(var1, var2, var3, var4, var8); -+ boolean var8 = par1World.isBlockIndirectlyGettingPowered(par2, par3, par4) || par1World.isBlockIndirectlyGettingPowered(par2, par3 + 1, par4); -+ -+ if ((var8 || par5 > 0 && Block.blocksList[par5].canProvidePower()) && par5 != this.blockID) { -+ this.onPoweredBlockChange(par1World, par2, par3, par4, var8); - } - } - } else { -- if(var1.getBlockId(var2, var3 - 1, var4) != this.blockID) { -- var1.setBlockToAir(var2, var3, var4); -+ if (par1World.getBlockId(par2, par3 - 1, par4) != this.blockID) { -+ par1World.setBlockToAir(par2, par3, par4); - } - -- if(var5 > 0 && var5 != this.blockID) { -- this.onNeighborBlockChange(var1, var2, var3 - 1, var4, var5); -+ if (par5 > 0 && par5 != this.blockID) { -+ this.onNeighborBlockChange(par1World, par2, par3 - 1, par4, par5); - } - } -- -- } -- -- public int idDropped(int var1, Random var2, int var3) { -- return (var1 & 8) != 0 ? 0 : (this.blockMaterial == Material.iron ? Item.doorIron.itemID : Item.doorWood.itemID); -- } -- -- public MovingObjectPosition collisionRayTrace(World var1, int var2, int var3, int var4, Vec3 var5, Vec3 var6) { -- this.setBlockBoundsBasedOnState(var1, var2, var3, var4); -- return super.collisionRayTrace(var1, var2, var3, var4, var5, var6); -- } -- -- public boolean canPlaceBlockAt(World var1, int var2, int var3, int var4) { -- return var3 >= 255 ? false : var1.doesBlockHaveSolidTopSurface(var2, var3 - 1, var4) && super.canPlaceBlockAt(var1, var2, var3, var4) && super.canPlaceBlockAt(var1, var2, var3 + 1, var4); -- } -- -+ } -+ -+ /** -+ * Returns the ID of the items to drop on destruction. -+ */ -+ public int idDropped(int par1, Random par2Random, int par3) { -+ return (par1 & 8) != 0 ? 0 : (this.blockMaterial == Material.iron ? Item.doorIron.itemID : Item.doorWood.itemID); -+ } -+ -+ /** -+ * Ray traces through the blocks collision from start vector to end vector returning a ray trace hit. Args: world, x, -+ * y, z, startVec, endVec -+ */ -+ public MovingObjectPosition collisionRayTrace(World par1World, int par2, int par3, int par4, Vec3 par5Vec3, Vec3 par6Vec3) { -+ this.setBlockBoundsBasedOnState(par1World, par2, par3, par4); -+ return super.collisionRayTrace(par1World, par2, par3, par4, par5Vec3, par6Vec3); -+ } -+ -+ /** -+ * Checks to see if its valid to put this block at the specified coordinates. Args: world, x, y, z -+ */ -+ public boolean canPlaceBlockAt(World par1World, int par2, int par3, int par4) { -+ return par3 >= 255 ? false : par1World.doesBlockHaveSolidTopSurface(par2, par3 - 1, par4) && super.canPlaceBlockAt(par1World, par2, par3, par4) && super.canPlaceBlockAt(par1World, par2, par3 + 1, par4); -+ } -+ -+ /** -+ * Returns the mobility information of the block, 0 = free, 1 = can't push but can move over, 2 = total immobility and -+ * stop pistons -+ */ - public int getMobilityFlag() { - return 1; - } - -- public int getFullMetadata(IBlockAccess var1, int var2, int var3, int var4) { -- int var5 = var1.getBlockMetadata(var2, var3, var4); -+ /** -+ * Returns the full metadata value created by combining the metadata of both blocks the door takes up. -+ */ -+ public int getFullMetadata(IBlockAccess par1IBlockAccess, int par2, int par3, int par4) { -+ int var5 = par1IBlockAccess.getBlockMetadata(par2, par3, par4); - boolean var6 = (var5 & 8) != 0; - int var7; - int var8; -- if(var6) { -- var7 = var1.getBlockMetadata(var2, var3 - 1, var4); -+ -+ if (var6) { -+ var7 = par1IBlockAccess.getBlockMetadata(par2, par3 - 1, par4); - var8 = var5; - } else { - var7 = var5; -- var8 = var1.getBlockMetadata(var2, var3 + 1, var4); -+ var8 = par1IBlockAccess.getBlockMetadata(par2, par3 + 1, par4); - } - - boolean var9 = (var8 & 1) != 0; - return var7 & 7 | (var6 ? 8 : 0) | (var9 ? 16 : 0); - } - -- public int idPicked(World var1, int var2, int var3, int var4) { -+ /** -+ * only called by clickMiddleMouseButton , and passed to inventory.setCurrentItem (along with isCreative) -+ */ -+ public int idPicked(World par1World, int par2, int par3, int par4) { - return this.blockMaterial == Material.iron ? Item.doorIron.itemID : Item.doorWood.itemID; - } - -- public void onBlockHarvested(World var1, int var2, int var3, int var4, int var5, EntityPlayer var6) { -- if(var6.capabilities.isCreativeMode && (var5 & 8) != 0 && var1.getBlockId(var2, var3 - 1, var4) == this.blockID) { -- var1.setBlockToAir(var2, var3 - 1, var4); -+ /** -+ * Called when the block is attempted to be harvested -+ */ -+ public void onBlockHarvested(World par1World, int par2, int par3, int par4, int par5, EntityPlayer par6EntityPlayer) { -+ if (par6EntityPlayer.capabilities.isCreativeMode && (par5 & 8) != 0 && par1World.getBlockId(par2, par3 - 1, par4) == this.blockID) { -+ par1World.setBlockToAir(par2, par3 - 1, par4); - } -- - } - } ---- net/minecraft/src/BlockDirectional.java -+++ net/minecraft/src/BlockDirectional.java -@@ -1,11 +1,14 @@ - package net.minecraft.src; - - public abstract class BlockDirectional extends Block { -- protected BlockDirectional(int var1, Material var2) { -- super(var1, var2); -+ protected BlockDirectional(int par1, Material par2Material) { -+ super(par1, par2Material); - } - -- public static int getDirection(int var0) { -- return var0 & 3; -+ /** -+ * Returns the orentation value from the specified metadata -+ */ -+ public static int getDirection(int par0) { -+ return par0 & 3; - } - } ---- net/minecraft/src/ThreadDownloadImageData.java -+++ net/minecraft/src/ThreadDownloadImageData.java -@@ -3,51 +3,55 @@ - import java.awt.image.BufferedImage; - import java.io.IOException; - -+import org.spoutcraft.client.HDImageBufferDownload; -+ - public class ThreadDownloadImageData extends AbstractTexture { -- private final String b; -+ private final String imageUrl; - private final IImageBuffer imageBuffer; -- private BufferedImage d; -- private Thread e; -+ private BufferedImage bufferedImage; -+ private Thread imageThread; - private SimpleTexture imageLocation; - private boolean textureUploaded; - -- public ThreadDownloadImageData(String var1, ResourceLocation var2, IImageBuffer var3) { -- this.b = var1; -- this.imageBuffer = var3; -- this.imageLocation = var2 != null ? new SimpleTexture(var2) : null; -+ public ThreadDownloadImageData(String par1Str, ResourceLocation par2ResourceLocation, IImageBuffer par3IImageBuffer) { -+ this.imageUrl = par1Str; -+ // Spout Start -+ this.imageBuffer = new HDImageBufferDownload(); -+ // Spout End -+ this.imageLocation = par2ResourceLocation != null ? new SimpleTexture(par2ResourceLocation) : null; - } - - public int getGlTextureId() { - int var1 = super.getGlTextureId(); -- if(!this.textureUploaded && this.d != null) { -- TextureUtil.uploadTextureImage(var1, this.d); -+ -+ if (!this.textureUploaded && this.bufferedImage != null) { -+ TextureUtil.uploadTextureImage(var1, this.bufferedImage); - this.textureUploaded = true; - } - - return var1; - } - -- public void getBufferedImage(BufferedImage var1) { -- this.d = var1; -+ public void getBufferedImage(BufferedImage par1BufferedImage) { -+ this.bufferedImage = par1BufferedImage; - } - -- public void loadTexture(ResourceManager var1) throws IOException { -- if(this.d == null) { -- if(this.imageLocation != null) { -- this.imageLocation.loadTexture(var1); -+ public void loadTexture(ResourceManager par1ResourceManager) throws IOException { -+ if (this.bufferedImage == null) { -+ if (this.imageLocation != null) { -+ this.imageLocation.loadTexture(par1ResourceManager); - this.glTextureId = this.imageLocation.getGlTextureId(); - } - } else { -- TextureUtil.uploadTextureImage(this.getGlTextureId(), this.d); -- } -- -- if(this.e == null) { -- this.e = new ThreadDownloadImageDataINNER1(this); -- this.e.setDaemon(true); -- this.e.setName("Skin downloader: " + this.b); -- this.e.start(); -- } -- -+ TextureUtil.uploadTextureImage(this.getGlTextureId(), this.bufferedImage); -+ } -+ -+ if (this.imageThread == null) { -+ this.imageThread = new ThreadDownloadImageDataINNER1(this); -+ this.imageThread.setDaemon(true); -+ this.imageThread.setName("Skin downloader: " + this.imageUrl); -+ this.imageThread.start(); -+ } - } - - public boolean isTextureUploaded() { -@@ -55,11 +59,11 @@ - return this.textureUploaded; - } - -- static String getImageUrl(ThreadDownloadImageData var0) { -- return var0.b; -+ static String getImageUrl(ThreadDownloadImageData par0ThreadDownloadImageData) { -+ return par0ThreadDownloadImageData.imageUrl; - } - -- static IImageBuffer getImageBuffer(ThreadDownloadImageData var0) { -- return var0.imageBuffer; -+ static IImageBuffer getImageBuffer(ThreadDownloadImageData par0ThreadDownloadImageData) { -+ return par0ThreadDownloadImageData.imageBuffer; - } - } ---- net/minecraft/src/Packet38EntityStatus.java -+++ net/minecraft/src/Packet38EntityStatus.java -@@ -6,30 +6,43 @@ - - public class Packet38EntityStatus extends Packet { - public int entityId; -+ -+ /** 2 for hurt, 3 for dead */ - public byte entityStatus; - -- public Packet38EntityStatus() { -- } -- -- public Packet38EntityStatus(int var1, byte var2) { -- this.entityId = var1; -- this.entityStatus = var2; -- } -- -- public void readPacketData(DataInput var1) throws IOException { -- this.entityId = var1.readInt(); -- this.entityStatus = var1.readByte(); -- } -- -- public void writePacketData(DataOutput var1) throws IOException { -- var1.writeInt(this.entityId); -- var1.writeByte(this.entityStatus); -- } -- -- public void processPacket(NetHandler var1) { -- var1.handleEntityStatus(this); -- } -- -+ public Packet38EntityStatus() {} -+ -+ public Packet38EntityStatus(int par1, byte par2) { -+ this.entityId = par1; -+ this.entityStatus = par2; -+ } -+ -+ /** -+ * Abstract. Reads the raw packet data from the data stream. -+ */ -+ public void readPacketData(DataInput par1DataInput) throws IOException { -+ this.entityId = par1DataInput.readInt(); -+ this.entityStatus = par1DataInput.readByte(); -+ } -+ -+ /** -+ * Abstract. Writes the raw packet data to the data stream. -+ */ -+ public void writePacketData(DataOutput par1DataOutput) throws IOException { -+ par1DataOutput.writeInt(this.entityId); -+ par1DataOutput.writeByte(this.entityStatus); -+ } -+ -+ /** -+ * Passes this Packet on to the NetHandler for processing. -+ */ -+ public void processPacket(NetHandler par1NetHandler) { -+ par1NetHandler.handleEntityStatus(this); -+ } -+ -+ /** -+ * Abstract. Return the size of the packet (not counting the header). -+ */ - public int getPacketSize() { - return 5; - } ---- /dev/null -+++ org/spoutcraft/api/gui/WidgetAnchor.java -@@ -1,0 +1,74 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.api.gui; -+ -+import java.util.HashMap; -+ -+public enum WidgetAnchor { -+ /** -+ * Widget anchors allow you to place widgets that -+ * stick or "anchor" to a point on the screen -+ * -+ * A widget's coordinates refer to its top left -+ * corner and anchors change the point they are -+ * relative to on the screen -+ * -+ * You can choose any of 9 points to anchor to, -+ * note that if anchoring to the bottom or right -+ * the widget will likely be offscreen until you -+ * set a negative y or x value -+ * -+ * The only exception is scale which assumes the -+ * screen to always be 427x240 and moves/scales -+ * widgets to conform -+ */ -+ TOP_LEFT(0), // x, y -+ TOP_CENTER(1), // screenwidth/2 + x, y -+ TOP_RIGHT(2), // screenwidth + x, y -+ CENTER_LEFT(3), // x, screenheight/2 + y -+ CENTER_CENTER(4), // screenwidth/2 + x, screenheight/2 + y -+ CENTER_RIGHT(5), // screenwidth + x, screenheight/2 + y -+ BOTTOM_LEFT(6), // x, screenheight + y -+ BOTTOM_CENTER(7), // screenwidth/2 + x, screenheight + y -+ BOTTOM_RIGHT(8), // screenwidth + x, screenheight + y -+ SCALE(9), // Scales -+ ; -+ -+ private final int id; -+ WidgetAnchor(int id) { -+ this.id = id; -+ } -+ -+ public int getId() { -+ return id; -+ } -+ -+ private static final HashMap lookupId = new HashMap(); -+ -+ static { -+ for (WidgetAnchor t : values()) { -+ lookupId.put(t.getId(), t); -+ } -+ } -+ -+ public static WidgetAnchor getAnchorFromId(int id) { -+ return lookupId.get(id); -+ } -+} ---- net/minecraft/src/BlockVine.java -+++ net/minecraft/src/BlockVine.java -@@ -3,31 +3,47 @@ - import java.util.Random; - - public class BlockVine extends Block { -- public BlockVine(int var1) { -- super(var1, Material.vine); -+ public BlockVine(int par1) { -+ super(par1, Material.vine); - this.setTickRandomly(true); - this.setCreativeTab(CreativeTabs.tabDecorations); - } - -+ /** -+ * Sets the block's bounds for rendering it as an item -+ */ - public void setBlockBoundsForItemRender() { - this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F); - } - -+ /** -+ * The type of render function that is called for this block -+ */ - public int getRenderType() { - return 20; - } - -+ /** -+ * Is this block (a) opaque and (b) a full 1m cube? This determines whether or not to render the shared face of two -+ * adjacent blocks and also whether the player can attach torches, redstone wire, etc to this block. -+ */ - public boolean isOpaqueCube() { - return false; - } - -+ /** -+ * If this block doesn't render as an ordinary block it will return False (examples: signs, buttons, stairs, etc) -+ */ - public boolean renderAsNormalBlock() { - return false; - } - -- public void setBlockBoundsBasedOnState(IBlockAccess var1, int var2, int var3, int var4) { -- float var5 = 1.0F / 16.0F; -- int var6 = var1.getBlockMetadata(var2, var3, var4); -+ /** -+ * Updates the blocks bounds based on its current state. Args: world, x, y, z -+ */ -+ public void setBlockBoundsBasedOnState(IBlockAccess par1IBlockAccess, int par2, int par3, int par4) { -+ float var5 = 0.0625F; -+ int var6 = par1IBlockAccess.getBlockMetadata(par2, par3, par4); - float var7 = 1.0F; - float var8 = 1.0F; - float var9 = 1.0F; -@@ -35,48 +51,49 @@ - float var11 = 0.0F; - float var12 = 0.0F; - boolean var13 = var6 > 0; -- if((var6 & 2) != 0) { -- var10 = Math.max(var10, 1.0F / 16.0F); -- var7 = 0.0F; -- var8 = 0.0F; -- var11 = 1.0F; -- var9 = 0.0F; -- var12 = 1.0F; -- var13 = true; -- } -- -- if((var6 & 8) != 0) { -- var7 = Math.min(var7, 15.0F / 16.0F); -- var10 = 1.0F; -- var8 = 0.0F; -- var11 = 1.0F; -- var9 = 0.0F; -- var12 = 1.0F; -- var13 = true; -- } -- -- if((var6 & 4) != 0) { -- var12 = Math.max(var12, 1.0F / 16.0F); -- var9 = 0.0F; -- var7 = 0.0F; -- var10 = 1.0F; -- var8 = 0.0F; -- var11 = 1.0F; -- var13 = true; -- } -- -- if((var6 & 1) != 0) { -- var9 = Math.min(var9, 15.0F / 16.0F); -- var12 = 1.0F; -- var7 = 0.0F; -- var10 = 1.0F; -- var8 = 0.0F; -- var11 = 1.0F; -- var13 = true; -- } -- -- if(!var13 && this.canBePlacedOn(var1.getBlockId(var2, var3 + 1, var4))) { -- var8 = Math.min(var8, 15.0F / 16.0F); -+ -+ if ((var6 & 2) != 0) { -+ var10 = Math.max(var10, 0.0625F); -+ var7 = 0.0F; -+ var8 = 0.0F; -+ var11 = 1.0F; -+ var9 = 0.0F; -+ var12 = 1.0F; -+ var13 = true; -+ } -+ -+ if ((var6 & 8) != 0) { -+ var7 = Math.min(var7, 0.9375F); -+ var10 = 1.0F; -+ var8 = 0.0F; -+ var11 = 1.0F; -+ var9 = 0.0F; -+ var12 = 1.0F; -+ var13 = true; -+ } -+ -+ if ((var6 & 4) != 0) { -+ var12 = Math.max(var12, 0.0625F); -+ var9 = 0.0F; -+ var7 = 0.0F; -+ var10 = 1.0F; -+ var8 = 0.0F; -+ var11 = 1.0F; -+ var13 = true; -+ } -+ -+ if ((var6 & 1) != 0) { -+ var9 = Math.min(var9, 0.9375F); -+ var12 = 1.0F; -+ var7 = 0.0F; -+ var10 = 1.0F; -+ var8 = 0.0F; -+ var11 = 1.0F; -+ var13 = true; -+ } -+ -+ if (!var13 && this.canBePlacedOn(par1IBlockAccess.getBlockId(par2, par3 + 1, par4))) { -+ var8 = Math.min(var8, 0.9375F); - var11 = 1.0F; - var7 = 0.0F; - var10 = 1.0F; -@@ -87,53 +104,73 @@ - this.setBlockBounds(var7, var8, var9, var10, var11, var12); - } - -- public AxisAlignedBB getCollisionBoundingBoxFromPool(World var1, int var2, int var3, int var4) { -+ /** -+ * Returns a bounding box from the pool of bounding boxes (this means this box can change after the pool has been -+ * cleared to be reused) -+ */ -+ public AxisAlignedBB getCollisionBoundingBoxFromPool(World par1World, int par2, int par3, int par4) { - return null; - } - -- public boolean canPlaceBlockOnSide(World var1, int var2, int var3, int var4, int var5) { -- switch(var5) { -- case 1: -- return this.canBePlacedOn(var1.getBlockId(var2, var3 + 1, var4)); -- case 2: -- return this.canBePlacedOn(var1.getBlockId(var2, var3, var4 + 1)); -- case 3: -- return this.canBePlacedOn(var1.getBlockId(var2, var3, var4 - 1)); -- case 4: -- return this.canBePlacedOn(var1.getBlockId(var2 + 1, var3, var4)); -- case 5: -- return this.canBePlacedOn(var1.getBlockId(var2 - 1, var3, var4)); -- default: -- return false; -+ /** -+ * checks to see if you can place this block can be placed on that side of a block: BlockLever overrides -+ */ -+ public boolean canPlaceBlockOnSide(World par1World, int par2, int par3, int par4, int par5) { -+ switch (par5) { -+ case 1: -+ return this.canBePlacedOn(par1World.getBlockId(par2, par3 + 1, par4)); -+ -+ case 2: -+ return this.canBePlacedOn(par1World.getBlockId(par2, par3, par4 + 1)); -+ -+ case 3: -+ return this.canBePlacedOn(par1World.getBlockId(par2, par3, par4 - 1)); -+ -+ case 4: -+ return this.canBePlacedOn(par1World.getBlockId(par2 + 1, par3, par4)); -+ -+ case 5: -+ return this.canBePlacedOn(par1World.getBlockId(par2 - 1, par3, par4)); -+ -+ default: -+ return false; - } - } - -- private boolean canBePlacedOn(int var1) { -- if(var1 == 0) { -+ /** -+ * returns true if a vine can be placed on that block (checks for render as normal block and if it is solid) -+ */ -+ private boolean canBePlacedOn(int par1) { -+ if (par1 == 0) { - return false; - } else { -- Block var2 = Block.blocksList[var1]; -+ Block var2 = Block.blocksList[par1]; - return var2.renderAsNormalBlock() && var2.blockMaterial.blocksMovement(); - } - } - -- private boolean canVineStay(World var1, int var2, int var3, int var4) { -- int var5 = var1.getBlockMetadata(var2, var3, var4); -+ /** -+ * Returns if the vine can stay in the world. It also changes the metadata according to neighboring blocks. -+ */ -+ private boolean canVineStay(World par1World, int par2, int par3, int par4) { -+ int var5 = par1World.getBlockMetadata(par2, par3, par4); - int var6 = var5; -- if(var5 > 0) { -- for(int var7 = 0; var7 <= 3; ++var7) { -+ -+ if (var5 > 0) { -+ for (int var7 = 0; var7 <= 3; ++var7) { - int var8 = 1 << var7; -- if((var5 & var8) != 0 && !this.canBePlacedOn(var1.getBlockId(var2 + Direction.offsetX[var7], var3, var4 + Direction.offsetZ[var7])) && (var1.getBlockId(var2, var3 + 1, var4) != this.blockID || (var1.getBlockMetadata(var2, var3 + 1, var4) & var8) == 0)) { -+ -+ if ((var5 & var8) != 0 && !this.canBePlacedOn(par1World.getBlockId(par2 + Direction.offsetX[var7], par3, par4 + Direction.offsetZ[var7])) && (par1World.getBlockId(par2, par3 + 1, par4) != this.blockID || (par1World.getBlockMetadata(par2, par3 + 1, par4) & var8) == 0)) { - var6 &= ~var8; - } - } - } - -- if(var6 == 0 && !this.canBePlacedOn(var1.getBlockId(var2, var3 + 1, var4))) { -+ if (var6 == 0 && !this.canBePlacedOn(par1World.getBlockId(par2, par3 + 1, par4))) { - return false; - } else { -- if(var6 != var5) { -- var1.setBlockMetadata(var2, var3, var4, var6, 2); -+ if (var6 != var5) { -+ par1World.setBlockMetadataWithNotify(par2, par3, par4, var6, 2); - } - - return true; -@@ -144,149 +181,186 @@ - return ColorizerFoliage.getFoliageColorBasic(); - } - -- public int getRenderColor(int var1) { -+ /** -+ * Returns the color this block should be rendered. Used by leaves. -+ */ -+ public int getRenderColor(int par1) { - return ColorizerFoliage.getFoliageColorBasic(); - } - -- public int colorMultiplier(IBlockAccess var1, int var2, int var3, int var4) { -- return var1.getBiomeGenForCoords(var2, var4).getBiomeFoliageColor(); -+ /** -+ * Returns a integer with hex for 0xrrggbb with this color multiplied against the blocks color. Note only called when -+ * first determining what to render. -+ */ -+ public int colorMultiplier(IBlockAccess par1IBlockAccess, int par2, int par3, int par4) { -+ return par1IBlockAccess.getBiomeGenForCoords(par2, par4).getBiomeFoliageColor(); - } - -- public void onNeighborBlockChange(World var1, int var2, int var3, int var4, int var5) { -- if(!var1.isRemote && !this.canVineStay(var1, var2, var3, var4)) { -- this.dropBlockAsItem(var1, var2, var3, var4, var1.getBlockMetadata(var2, var3, var4), 0); -- var1.setBlockToAir(var2, var3, var4); -+ /** -+ * Lets the block know when one of its neighbor changes. Doesn't know which neighbor changed (coordinates passed are -+ * their own) Args: x, y, z, neighbor blockID -+ */ -+ public void onNeighborBlockChange(World par1World, int par2, int par3, int par4, int par5) { -+ if (!par1World.isRemote && !this.canVineStay(par1World, par2, par3, par4)) { -+ this.dropBlockAsItem(par1World, par2, par3, par4, par1World.getBlockMetadata(par2, par3, par4), 0); -+ par1World.setBlockToAir(par2, par3, par4); - } -- - } - -- public void updateTick(World var1, int var2, int var3, int var4, Random var5) { -- if(!var1.isRemote && var1.s.nextInt(4) == 0) { -+ /** -+ * Ticks the block if it's been scheduled -+ */ -+ public void updateTick(World par1World, int par2, int par3, int par4, Random par5Random) { -+ if (!par1World.isRemote && par1World.rand.nextInt(4) == 0) { - byte var6 = 4; - int var7 = 5; - boolean var8 = false; -- - int var9; - int var10; - int var11; -- label141: -- for(var9 = var2 - var6; var9 <= var2 + var6; ++var9) { -- for(var10 = var4 - var6; var10 <= var4 + var6; ++var10) { -- for(var11 = var3 - 1; var11 <= var3 + 1; ++var11) { -- if(var1.getBlockId(var9, var11, var10) == this.blockID) { -+ label138: -+ -+ for (var9 = par2 - var6; var9 <= par2 + var6; ++var9) { -+ for (var10 = par4 - var6; var10 <= par4 + var6; ++var10) { -+ for (var11 = par3 - 1; var11 <= par3 + 1; ++var11) { -+ if (par1World.getBlockId(var9, var11, var10) == this.blockID) { - --var7; -- if(var7 <= 0) { -+ -+ if (var7 <= 0) { - var8 = true; -- break label141; -+ break label138; - } - } - } - } - } - -- var9 = var1.getBlockMetadata(var2, var3, var4); -- var10 = var1.s.nextInt(6); -+ var9 = par1World.getBlockMetadata(par2, par3, par4); -+ var10 = par1World.rand.nextInt(6); - var11 = Direction.facingToDirection[var10]; - int var12; - int var13; -- if(var10 == 1 && var3 < 255 && var1.isAirBlock(var2, var3 + 1, var4)) { -- if(var8) { -+ -+ if (var10 == 1 && par3 < 255 && par1World.isAirBlock(par2, par3 + 1, par4)) { -+ if (var8) { - return; - } - -- var12 = var1.s.nextInt(16) & var9; -- if(var12 > 0) { -- for(var13 = 0; var13 <= 3; ++var13) { -- if(!this.canBePlacedOn(var1.getBlockId(var2 + Direction.offsetX[var13], var3 + 1, var4 + Direction.offsetZ[var13]))) { -+ var12 = par1World.rand.nextInt(16) & var9; -+ -+ if (var12 > 0) { -+ for (var13 = 0; var13 <= 3; ++var13) { -+ if (!this.canBePlacedOn(par1World.getBlockId(par2 + Direction.offsetX[var13], par3 + 1, par4 + Direction.offsetZ[var13]))) { - var12 &= ~(1 << var13); - } - } - -- if(var12 > 0) { -- var1.setBlock(var2, var3 + 1, var4, this.blockID, var12, 2); -+ if (var12 > 0) { -+ par1World.setBlock(par2, par3 + 1, par4, this.blockID, var12, 2); - } - } - } else { - int var14; -- if(var10 >= 2 && var10 <= 5 && (var9 & 1 << var11) == 0) { -- if(var8) { -+ -+ if (var10 >= 2 && var10 <= 5 && (var9 & 1 << var11) == 0) { -+ if (var8) { - return; - } - -- var12 = var1.getBlockId(var2 + Direction.offsetX[var11], var3, var4 + Direction.offsetZ[var11]); -- if(var12 != 0 && Block.blocksList[var12] != null) { -- if(Block.blocksList[var12].blockMaterial.isOpaque() && Block.blocksList[var12].renderAsNormalBlock()) { -- var1.setBlockMetadata(var2, var3, var4, var9 | 1 << var11, 2); -+ var12 = par1World.getBlockId(par2 + Direction.offsetX[var11], par3, par4 + Direction.offsetZ[var11]); -+ -+ if (var12 != 0 && Block.blocksList[var12] != null) { -+ if (Block.blocksList[var12].blockMaterial.isOpaque() && Block.blocksList[var12].renderAsNormalBlock()) { -+ par1World.setBlockMetadataWithNotify(par2, par3, par4, var9 | 1 << var11, 2); - } - } else { - var13 = var11 + 1 & 3; - var14 = var11 + 3 & 3; -- if((var9 & 1 << var13) != 0 && this.canBePlacedOn(var1.getBlockId(var2 + Direction.offsetX[var11] + Direction.offsetX[var13], var3, var4 + Direction.offsetZ[var11] + Direction.offsetZ[var13]))) { -- var1.setBlock(var2 + Direction.offsetX[var11], var3, var4 + Direction.offsetZ[var11], this.blockID, 1 << var13, 2); -- } else if((var9 & 1 << var14) != 0 && this.canBePlacedOn(var1.getBlockId(var2 + Direction.offsetX[var11] + Direction.offsetX[var14], var3, var4 + Direction.offsetZ[var11] + Direction.offsetZ[var14]))) { -- var1.setBlock(var2 + Direction.offsetX[var11], var3, var4 + Direction.offsetZ[var11], this.blockID, 1 << var14, 2); -- } else if((var9 & 1 << var13) != 0 && var1.isAirBlock(var2 + Direction.offsetX[var11] + Direction.offsetX[var13], var3, var4 + Direction.offsetZ[var11] + Direction.offsetZ[var13]) && this.canBePlacedOn(var1.getBlockId(var2 + Direction.offsetX[var13], var3, var4 + Direction.offsetZ[var13]))) { -- var1.setBlock(var2 + Direction.offsetX[var11] + Direction.offsetX[var13], var3, var4 + Direction.offsetZ[var11] + Direction.offsetZ[var13], this.blockID, 1 << (var11 + 2 & 3), 2); -- } else if((var9 & 1 << var14) != 0 && var1.isAirBlock(var2 + Direction.offsetX[var11] + Direction.offsetX[var14], var3, var4 + Direction.offsetZ[var11] + Direction.offsetZ[var14]) && this.canBePlacedOn(var1.getBlockId(var2 + Direction.offsetX[var14], var3, var4 + Direction.offsetZ[var14]))) { -- var1.setBlock(var2 + Direction.offsetX[var11] + Direction.offsetX[var14], var3, var4 + Direction.offsetZ[var11] + Direction.offsetZ[var14], this.blockID, 1 << (var11 + 2 & 3), 2); -- } else if(this.canBePlacedOn(var1.getBlockId(var2 + Direction.offsetX[var11], var3 + 1, var4 + Direction.offsetZ[var11]))) { -- var1.setBlock(var2 + Direction.offsetX[var11], var3, var4 + Direction.offsetZ[var11], this.blockID, 0, 2); -+ -+ if ((var9 & 1 << var13) != 0 && this.canBePlacedOn(par1World.getBlockId(par2 + Direction.offsetX[var11] + Direction.offsetX[var13], par3, par4 + Direction.offsetZ[var11] + Direction.offsetZ[var13]))) { -+ par1World.setBlock(par2 + Direction.offsetX[var11], par3, par4 + Direction.offsetZ[var11], this.blockID, 1 << var13, 2); -+ } else if ((var9 & 1 << var14) != 0 && this.canBePlacedOn(par1World.getBlockId(par2 + Direction.offsetX[var11] + Direction.offsetX[var14], par3, par4 + Direction.offsetZ[var11] + Direction.offsetZ[var14]))) { -+ par1World.setBlock(par2 + Direction.offsetX[var11], par3, par4 + Direction.offsetZ[var11], this.blockID, 1 << var14, 2); -+ } else if ((var9 & 1 << var13) != 0 && par1World.isAirBlock(par2 + Direction.offsetX[var11] + Direction.offsetX[var13], par3, par4 + Direction.offsetZ[var11] + Direction.offsetZ[var13]) && this.canBePlacedOn(par1World.getBlockId(par2 + Direction.offsetX[var13], par3, par4 + Direction.offsetZ[var13]))) { -+ par1World.setBlock(par2 + Direction.offsetX[var11] + Direction.offsetX[var13], par3, par4 + Direction.offsetZ[var11] + Direction.offsetZ[var13], this.blockID, 1 << (var11 + 2 & 3), 2); -+ } else if ((var9 & 1 << var14) != 0 && par1World.isAirBlock(par2 + Direction.offsetX[var11] + Direction.offsetX[var14], par3, par4 + Direction.offsetZ[var11] + Direction.offsetZ[var14]) && this.canBePlacedOn(par1World.getBlockId(par2 + Direction.offsetX[var14], par3, par4 + Direction.offsetZ[var14]))) { -+ par1World.setBlock(par2 + Direction.offsetX[var11] + Direction.offsetX[var14], par3, par4 + Direction.offsetZ[var11] + Direction.offsetZ[var14], this.blockID, 1 << (var11 + 2 & 3), 2); -+ } else if (this.canBePlacedOn(par1World.getBlockId(par2 + Direction.offsetX[var11], par3 + 1, par4 + Direction.offsetZ[var11]))) { -+ par1World.setBlock(par2 + Direction.offsetX[var11], par3, par4 + Direction.offsetZ[var11], this.blockID, 0, 2); - } - } -- } else if(var3 > 1) { -- var12 = var1.getBlockId(var2, var3 - 1, var4); -- if(var12 == 0) { -- var13 = var1.s.nextInt(16) & var9; -- if(var13 > 0) { -- var1.setBlock(var2, var3 - 1, var4, this.blockID, var13, 2); -+ } else if (par3 > 1) { -+ var12 = par1World.getBlockId(par2, par3 - 1, par4); -+ -+ if (var12 == 0) { -+ var13 = par1World.rand.nextInt(16) & var9; -+ -+ if (var13 > 0) { -+ par1World.setBlock(par2, par3 - 1, par4, this.blockID, var13, 2); - } -- } else if(var12 == this.blockID) { -- var13 = var1.s.nextInt(16) & var9; -- var14 = var1.getBlockMetadata(var2, var3 - 1, var4); -- if(var14 != (var14 | var13)) { -- var1.setBlockMetadata(var2, var3 - 1, var4, var14 | var13, 2); -+ } else if (var12 == this.blockID) { -+ var13 = par1World.rand.nextInt(16) & var9; -+ var14 = par1World.getBlockMetadata(par2, par3 - 1, par4); -+ -+ if (var14 != (var14 | var13)) { -+ par1World.setBlockMetadataWithNotify(par2, par3 - 1, par4, var14 | var13, 2); - } - } - } - } - } -- - } - -- public int onBlockPlaced(World var1, int var2, int var3, int var4, int var5, float var6, float var7, float var8, int var9) { -+ /** -+ * Called when a block is placed using its ItemBlock. Args: World, X, Y, Z, side, hitX, hitY, hitZ, block metadata -+ */ -+ public int onBlockPlaced(World par1World, int par2, int par3, int par4, int par5, float par6, float par7, float par8, int par9) { - byte var10 = 0; -- switch(var5) { -- case 2: -- var10 = 1; -- break; -- case 3: -- var10 = 4; -- break; -- case 4: -- var10 = 8; -- break; -- case 5: -- var10 = 2; -+ -+ switch (par5) { -+ case 2: -+ var10 = 1; -+ break; -+ -+ case 3: -+ var10 = 4; -+ break; -+ -+ case 4: -+ var10 = 8; -+ break; -+ -+ case 5: -+ var10 = 2; - } - -- return var10 != 0 ? var10 : var9; -- } -- -- public int idDropped(int var1, Random var2, int var3) { -- return 0; -- } -- -- public int quantityDropped(Random var1) { -- return 0; -- } -- -- public void harvestBlock(World var1, EntityPlayer var2, int var3, int var4, int var5, int var6) { -- if(!var1.isRemote && var2.getCurrentEquippedItem() != null && var2.getCurrentEquippedItem().itemID == Item.shears.itemID) { -- var2.addStat(StatList.mineBlockStatArray[this.blockID], 1); -- this.dropBlockAsItem_do(var1, var3, var4, var5, new ItemStack(Block.vine, 1, 0)); -+ return var10 != 0 ? var10 : par9; -+ } -+ -+ /** -+ * Returns the ID of the items to drop on destruction. -+ */ -+ public int idDropped(int par1, Random par2Random, int par3) { -+ return 0; -+ } -+ -+ /** -+ * Returns the quantity of items to drop on block destruction. -+ */ -+ public int quantityDropped(Random par1Random) { -+ return 0; -+ } -+ -+ /** -+ * Called when the player destroys a block with an item that can harvest it. (i, j, k) are the coordinates of the block -+ * and l is the block's subtype/damage. -+ */ -+ public void harvestBlock(World par1World, EntityPlayer par2EntityPlayer, int par3, int par4, int par5, int par6) { -+ if (!par1World.isRemote && par2EntityPlayer.getCurrentEquippedItem() != null && par2EntityPlayer.getCurrentEquippedItem().itemID == Item.shears.itemID) { -+ par2EntityPlayer.addStat(StatList.mineBlockStatArray[this.blockID], 1); -+ this.dropBlockAsItem_do(par1World, par3, par4, par5, new ItemStack(Block.vine, 1, 0)); - } else { -- super.harvestBlock(var1, var2, var3, var4, var5, var6); -+ super.harvestBlock(par1World, par2EntityPlayer, par3, par4, par5, par6); - } -- - } - } ---- /dev/null -+++ org/spoutcraft/api/gui/WidgetType.java -@@ -1,0 +1,125 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.api.gui; -+ -+import java.util.HashMap; -+ -+public class WidgetType { -+ private static HashMap lookupClass = new HashMap(); -+ private static HashMap lookupId = new HashMap(); -+ private static int lastId = 0; -+ -+ public static WidgetType Label = new WidgetType(GenericLabel.class, 0); -+ public static WidgetType HealthBar = new WidgetType(HealthBar.class, 1); -+ public static WidgetType BubbleBar = new WidgetType(BubbleBar.class, 2); -+ public static WidgetType ChatBar = new WidgetType(ChatBar.class, 3); -+ public static WidgetType ChatTextBox = new WidgetType(ChatTextBox.class, 4); -+ public static WidgetType ArmorBar = new WidgetType(ArmorBar.class, 5); -+ public static WidgetType Texture = new WidgetType(GenericTexture.class, 6); -+ public static WidgetType PopupScreen = new WidgetType(GenericPopup.class, 7); -+ public static WidgetType InGameScreen = new WidgetType(null, 8); -+ public static WidgetType ItemWidget = new WidgetType(GenericItemWidget.class, 9); -+ public static WidgetType Button = new WidgetType(GenericButton.class, 10); -+ public static WidgetType Slider = new WidgetType(GenericSlider.class, 11); -+ public static WidgetType TextField = new WidgetType(GenericTextField.class, 12); -+ public static WidgetType Gradient = new WidgetType(GenericGradient.class, 13); -+ public static WidgetType Container = new WidgetType(GenericGradient.class, 14, true); -+ public static WidgetType EntityWidget = new WidgetType(GenericEntityWidget.class, 15); -+ public static WidgetType OverlayScreen = new WidgetType(GenericOverlayScreen.class, 16); -+ public static WidgetType HungerBar = new WidgetType(HungerBar.class, 17); -+ public static WidgetType ExpBar = new WidgetType(ExpBar.class, 18); -+ public static WidgetType CheckBox = new WidgetType(GenericCheckBox.class, 19); -+ public static WidgetType RadioButton = new WidgetType(GenericRadioButton.class, 20); -+ public static WidgetType ListWidget = new WidgetType(GenericListWidget.class, 21); -+ public static WidgetType DirtBackground = new WidgetType(DirtBackground.class, 22); -+ public static WidgetType ScrollArea = new WidgetType(GenericScrollArea.class, 23); -+ public static WidgetType ListView = new WidgetType(GenericListView.class, 24); -+ public static WidgetType ComboBox = new WidgetType(GenericComboBox.class, 25); -+ public static WidgetType Polygon = new WidgetType(GenericPolygon.class, 26); -+ public static WidgetType Slot = new WidgetType(GenericSlot.class, 27); -+ -+ private final int id; -+ private final boolean client; -+ private final Class widgetClass; -+ -+ public WidgetType(Class widget) { -+ widgetClass = widget; -+ id = lastId; -+ lastId++; -+ lookupClass.put(this, id); -+ lookupId.put(id, this); -+ client = false; -+ } -+ -+ private WidgetType(Class widget, int id) { -+ widgetClass = widget; -+ this.id = id; -+ if (id > lastId) { -+ lastId = id; -+ } -+ lookupClass.put(this, id); -+ lookupId.put(id, this); -+ client = false; -+ } -+ -+ public WidgetType(Class widget, boolean client) { -+ widgetClass = widget; -+ id = lastId; -+ lastId++; -+ lookupClass.put(this, id); -+ lookupId.put(id, this); -+ this.client = client; -+ } -+ -+ public WidgetType(Class widget, int id, boolean client) { -+ widgetClass = widget; -+ this.id = id; -+ if (id > lastId) { -+ lastId = id; -+ } -+ lookupClass.put(this, id); -+ lookupId.put(id, this); -+ this.client = client; -+ } -+ -+ public final int getId() { -+ return id; -+ } -+ -+ public final Class getWidgetClass() { -+ return widgetClass; -+ } -+ -+ public final boolean isClientOnly() { -+ return client; -+ } -+ -+ public static Integer getWidgetId(Class widget) { -+ return lookupClass.get(widget); -+ } -+ -+ public static WidgetType getWidgetFromId(int id) { -+ return lookupId.get(id); -+ } -+ -+ public static int getNumWidgetTypes() { -+ return lastId; -+ } -+} ---- net/minecraft/src/BlockStone.java -+++ net/minecraft/src/BlockStone.java -@@ -3,12 +3,15 @@ - import java.util.Random; - - public class BlockStone extends Block { -- public BlockStone(int var1) { -- super(var1, Material.rock); -+ public BlockStone(int par1) { -+ super(par1, Material.rock); - this.setCreativeTab(CreativeTabs.tabBlock); - } - -- public int idDropped(int var1, Random var2, int var3) { -+ /** -+ * Returns the ID of the items to drop on destruction. -+ */ -+ public int idDropped(int par1, Random par2Random, int par3) { - return Block.cobblestone.blockID; - } - } ---- net/minecraft/src/RenderItem.java -+++ net/minecraft/src/RenderItem.java -@@ -1,191 +1,293 @@ - package net.minecraft.src; - - import java.util.Random; -+ -+import net.minecraft.src.Minecraft; -+ - import org.lwjgl.opengl.GL11; - import org.lwjgl.opengl.GL12; -+import org.newdawn.slick.opengl.Texture; -+import org.spoutcraft.api.block.design.BlockDesign; -+import org.spoutcraft.api.material.MaterialData; -+import org.spoutcraft.client.io.CustomTextureManager; -+import org.spoutcraft.client.SpoutClient; -+import org.spoutcraft.client.config.Configuration; -+ -+//Spout Start -+//Spout End - - public class RenderItem extends Render { - private static final ResourceLocation RES_ITEM_GLINT = new ResourceLocation("textures/misc/enchanted_item_glint.png"); - private RenderBlocks itemRenderBlocks = new RenderBlocks(); -- private Random j = new Random(); -+ -+ /** The RNG used in RenderItem (for bobbing itemstacks on the ground) */ -+ private Random random = new Random(); - public boolean renderWithColor = true; -+ -+ /** Defines the zLevel of rendering of item on GUI. */ - public float zLevel; - public static boolean renderInFrame; - - public RenderItem() { - this.shadowSize = 0.15F; -- this.shadowOpaque = 12.0F / 16.0F; -+ this.shadowOpaque = 0.75F; - } -+ -+ /** -+ * Renders the item -+ */ -+ public void doRenderItem(EntityItem par1EntityItem, double par2, double par4, double par6, float par8, float par9) { -+ this.bindEntityTexture(par1EntityItem); -+ this.random.setSeed(187L); -+ ItemStack var10 = par1EntityItem.getEntityItem(); - -- public void doRenderItem(EntityItem var1, double var2, double var4, double var6, float var8, float var9) { -- this.bindEntityTexture(var1); -- this.j.setSeed(187L); -- ItemStack var10 = var1.getEntityItem(); -- if(var10.getItem() != null) { -- GL11.glPushMatrix(); -- float var11 = MathHelper.sin(((float)var1.age + var9) / 10.0F + var1.hoverStart) * 0.1F + 0.1F; -- float var12 = (((float)var1.age + var9) / 20.0F + var1.hoverStart) * (180.0F / (float)Math.PI); -+ if (var10.getItem() != null) { -+ // Spout Start - Removed -+ //GL11.glPushMatrix(); -+ // Spout End -+ float var11 = MathHelper.sin(((float)par1EntityItem.age + par9) / 10.0F + par1EntityItem.hoverStart) * 0.1F + 0.1F; -+ float var12 = (((float)par1EntityItem.age + par9) / 20.0F + par1EntityItem.hoverStart) * (180F / (float)Math.PI); - byte var13 = 1; -- if(var1.getEntityItem().stackSize > 1) { -+ -+ if (par1EntityItem.getEntityItem().stackSize > 1) { - var13 = 2; - } - -- if(var1.getEntityItem().stackSize > 5) { -+ if (par1EntityItem.getEntityItem().stackSize > 5) { - var13 = 3; - } - -- if(var1.getEntityItem().stackSize > 20) { -+ if (par1EntityItem.getEntityItem().stackSize > 20) { - var13 = 4; - } - -- if(var1.getEntityItem().stackSize > 40) { -+ if (par1EntityItem.getEntityItem().stackSize > 40) { - var13 = 5; - } - -- GL11.glTranslatef((float)var2, (float)var4 + var11, (float)var6); -+ // Spout Start -+ boolean custom = false; -+ BlockDesign design = null; -+ if (var10.itemID == 318) { -+ org.spoutcraft.api.material.CustomItem item = MaterialData.getCustomItem(var10.getItemDamage()); -+ if (item != null) { -+ String textureURI = item.getTexture(); -+ if (textureURI == null) { -+ org.spoutcraft.api.material.CustomBlock block = MaterialData.getCustomBlock(var10.getItemDamage()); -+ design = block != null ? block.getBlockDesign() : null; -+ textureURI = design != null ? design.getTextureURL() : null; -+ } -+ if (textureURI != null) { -+ Texture texture = CustomTextureManager.getTextureFromUrl(item.getAddon(), textureURI); -+ if (texture != null) { -+ SpoutClient.getHandle().renderEngine.bindTexture(texture.getTextureID()); -+ custom = true; -+ } -+ } -+ } -+ } - GL11.glEnable(GL12.GL_RESCALE_NORMAL); -- float var18; -- float var19; -- float var20; -- int var26; -- if(var10.getItemSpriteNumber() == 0 && var10.itemID < Block.blocksList.length && Block.blocksList[var10.itemID] != null && RenderBlocks.renderItemIn3d(Block.blocksList[var10.itemID].getRenderType())) { -- Block var22 = Block.blocksList[var10.itemID]; -- GL11.glRotatef(var12, 0.0F, 1.0F, 0.0F); -- if(renderInFrame) { -- GL11.glScalef(1.25F, 1.25F, 1.25F); -- GL11.glTranslatef(0.0F, 0.05F, 0.0F); -- GL11.glRotatef(-90.0F, 0.0F, 1.0F, 0.0F); -- } -- -- float var24 = 0.25F; -- int var25 = var22.getRenderType(); -- if(var25 == 1 || var25 == 19 || var25 == 12 || var25 == 2) { -- var24 = 0.5F; -- } -- -- GL11.glScalef(var24, var24, var24); -- -- for(var26 = 0; var26 < var13; ++var26) { -- GL11.glPushMatrix(); -- if(var26 > 0) { -- var18 = (this.j.nextFloat() * 2.0F - 1.0F) * 0.2F / var24; -- var19 = (this.j.nextFloat() * 2.0F - 1.0F) * 0.2F / var24; -- var20 = (this.j.nextFloat() * 2.0F - 1.0F) * 0.2F / var24; -- GL11.glTranslatef(var18, var19, var20); -- } -- -- var18 = 1.0F; -- this.itemRenderBlocks.renderBlockAsItem(var22, var10.getItemDamage(), var18); -- GL11.glPopMatrix(); -- } -+ -+ if (design != null && custom) { -+ //GL11.glScalef(0.25F, 0.25F, 0.25F); -+ design.renderItemstack(par1EntityItem.getEntityItem(), (float)par2, (float)(par4 + var11), (float)par6, var12, 0.25F, random); - } else { -- float var16; -- if(var10.getItemSpriteNumber() == 1 && var10.getItem().requiresMultipleRenderPasses()) { -- if(renderInFrame) { -- GL11.glScalef(0.5128205F, 0.5128205F, 0.5128205F); -- GL11.glTranslatef(0.0F, -0.05F, 0.0F); -+ GL11.glPushMatrix(); // the push from above -+ if (!custom) { -+ if (var10.itemID < 256) { -+ Minecraft.getMinecraft().getTextureManager().bindTexture(new ResourceLocation("textures/atlas/blocks.png")); - } else { -- GL11.glScalef(0.5F, 0.5F, 0.5F); -- } -- -- for(int var21 = 0; var21 <= 1; ++var21) { -- this.j.setSeed(187L); -- Icon var23 = var10.getItem().getIconFromDamageForRenderPass(var10.getItemDamage(), var21); -- var16 = 1.0F; -- if(this.renderWithColor) { -- var26 = Item.itemsList[var10.itemID].getColorFromItemStack(var10, var21); -- var18 = (float)(var26 >> 16 & 255) / 255.0F; -- var19 = (float)(var26 >> 8 & 255) / 255.0F; -- var20 = (float)(var26 & 255) / 255.0F; -- GL11.glColor4f(var18 * var16, var19 * var16, var20 * var16, 1.0F); -- this.renderDroppedItem(var1, var23, var13, var9, var18 * var16, var19 * var16, var20 * var16); -- } else { -- this.renderDroppedItem(var1, var23, var13, var9, 1.0F, 1.0F, 1.0F); -+ Minecraft.getMinecraft().getTextureManager().bindTexture(new ResourceLocation("textures/atlas/items.png")); -+ } -+ } -+ // Spout End -+ -+ GL11.glTranslatef((float)par2, (float)par4 + var11, (float)par6); -+ GL11.glEnable(GL12.GL_RESCALE_NORMAL); -+ int var17; -+ float var19; -+ float var18; -+ float var20; -+ -+ if (var10.getItemSpriteNumber() == 0 && Block.blocksList[var10.itemID] != null && RenderBlocks.renderItemIn3d(Block.blocksList[var10.itemID].getRenderType())) { -+ Block var21 = Block.blocksList[var10.itemID]; -+ GL11.glRotatef(var12, 0.0F, 1.0F, 0.0F); -+ -+ if (renderInFrame) { -+ GL11.glScalef(1.25F, 1.25F, 1.25F); -+ GL11.glTranslatef(0.0F, 0.05F, 0.0F); -+ GL11.glRotatef(-90.0F, 0.0F, 1.0F, 0.0F); -+ } -+ -+ if (!custom) { -+ Minecraft.getMinecraft().getTextureManager().bindTexture(new ResourceLocation("textures/atlas/blocks.png")); -+ } -+ float var25 = 0.25F; -+ int var24 = var21.getRenderType(); -+ -+ if (var24 == 1 || var24 == 19 || var24 == 12 || var24 == 2) { -+ var25 = 0.5F; -+ } -+ -+ GL11.glScalef(var25, var25, var25); -+ -+ for (var17 = 0; var17 < var13; ++var17) { -+ GL11.glPushMatrix(); -+ -+ if (var17 > 0) { -+ var18 = (this.random.nextFloat() * 2.0F - 1.0F) * 0.2F / var25; -+ var19 = (this.random.nextFloat() * 2.0F - 1.0F) * 0.2F / var25; -+ var20 = (this.random.nextFloat() * 2.0F - 1.0F) * 0.2F / var25; -+ GL11.glTranslatef(var18, var19, var20); - } -+ -+ var18 = 1.0F; -+ this.itemRenderBlocks.renderBlockAsItem(var21, var10.getItemDamage(), var18); -+ GL11.glPopMatrix(); - } - } else { -- if(renderInFrame) { -- GL11.glScalef(0.5128205F, 0.5128205F, 0.5128205F); -- GL11.glTranslatef(0.0F, -0.05F, 0.0F); -- } else { -- GL11.glScalef(0.5F, 0.5F, 0.5F); -- } -- -- Icon var14 = var10.getIconIndex(); -- if(this.renderWithColor) { -- int var15 = Item.itemsList[var10.itemID].getColorFromItemStack(var10, 0); -- var16 = (float)(var15 >> 16 & 255) / 255.0F; -- float var17 = (float)(var15 >> 8 & 255) / 255.0F; -- var18 = (float)(var15 & 255) / 255.0F; -- var19 = 1.0F; -- this.renderDroppedItem(var1, var14, var13, var9, var16 * var19, var17 * var19, var18 * var19); -- } else { -- this.renderDroppedItem(var1, var14, var13, var9, 1.0F, 1.0F, 1.0F); -+ float var16; -+ -+ if (var10.getItem().requiresMultipleRenderPasses()) { -+ if (renderInFrame) { -+ GL11.glScalef(0.5128205F, 0.5128205F, 0.5128205F); -+ GL11.glTranslatef(0.0F, -0.05F, 0.0F); -+ } else { -+ GL11.glScalef(0.5F, 0.5F, 0.5F); -+ } -+ -+ if (!custom) { -+ Minecraft.getMinecraft().getTextureManager().bindTexture(new ResourceLocation("textures/atlas/items.png")); -+ } -+ -+ for (int var14 = 0; var14 <= 1; ++var14) { -+ this.random.setSeed(187L); -+ Icon var15 = var10.getItem().getIconFromDamageForRenderPass(var10.getItemDamage(), var14); -+ var16 = 1.0F; -+ -+ if (this.renderWithColor) { -+ var17 = Item.itemsList[var10.itemID].getColorFromItemStack(var10, var14); -+ var18 = (float)(var17 >> 16 & 255) / 255.0F; -+ var19 = (float)(var17 >> 8 & 255) / 255.0F; -+ var20 = (float)(var17 & 255) / 255.0F; -+ GL11.glColor4f(var18 * var16, var19 * var16, var20 * var16, 1.0F); -+ this.renderDroppedItem(par1EntityItem, var15, var13, par9, var18 * var16, var19 * var16, var20 * var16, custom); -+ } else { -+ this.renderDroppedItem(par1EntityItem, var15, var13, par9, 1.0F, 1.0F, 1.0F, custom); -+ } -+ } -+ } else { -+ if (renderInFrame) { -+ GL11.glScalef(0.5128205F, 0.5128205F, 0.5128205F); -+ GL11.glTranslatef(0.0F, -0.05F, 0.0F); -+ } else { -+ GL11.glScalef(0.5F, 0.5F, 0.5F); -+ } -+ -+ Icon var23 = var10.getIconIndex(); -+ -+ if (var10.getItemSpriteNumber() == 0) { -+ Minecraft.getMinecraft().getTextureManager().bindTexture(new ResourceLocation("textures/atlas/blocks.png")); -+ } else { -+ if (!custom) { -+ Minecraft.getMinecraft().getTextureManager().bindTexture(new ResourceLocation("textures/atlas/items.png")); -+ } -+ } -+ -+ if (this.renderWithColor) { -+ int var22 = Item.itemsList[var10.itemID].getColorFromItemStack(var10, 0); -+ var16 = (float)(var22 >> 16 & 255) / 255.0F; -+ float var26 = (float)(var22 >> 8 & 255) / 255.0F; -+ var18 = (float)(var22 & 255) / 255.0F; -+ var19 = 1.0F; -+ this.renderDroppedItem(par1EntityItem, var23, var13, par9, var16 * var19, var26 * var19, var18 * var19, custom); -+ } else { -+ this.renderDroppedItem(par1EntityItem, var23, var13, par9, 1.0F, 1.0F, 1.0F, custom); -+ } - } - } -+ -+ GL11.glDisable(GL12.GL_RESCALE_NORMAL); -+ GL11.glPopMatrix(); - } -- -- GL11.glDisable(GL12.GL_RESCALE_NORMAL); -- GL11.glPopMatrix(); - } - } - -- protected ResourceLocation func_110796_a(EntityItem var1) { -- return this.renderManager.renderEngine.getResourceLocation(var1.getEntityItem().getItemSpriteNumber()); -+ protected ResourceLocation func_110796_a(EntityItem par1EntityItem) { -+ return this.renderManager.renderEngine.getResourceLocation(par1EntityItem.getEntityItem().getItemSpriteNumber()); - } - -- private void renderDroppedItem(EntityItem var1, Icon var2, int var3, float var4, float var5, float var6, float var7) { -+ /*** -+ * Renders a dropped item -+ */ -+ private void renderDroppedItem(EntityItem par1EntityItem, Icon par2Icon, int par3, float par4, float par5, float par6, float par7, boolean customTexture) { - Tessellator var8 = Tessellator.instance; -- if(var2 == null) { -+ -+ if (par2Icon == null) { - TextureManager var9 = Minecraft.getMinecraft().getTextureManager(); -- ResourceLocation var10 = var9.getResourceLocation(var1.getEntityItem().getItemSpriteNumber()); -- var2 = ((TextureMap)var9.getTexture(var10)).getAtlasSprite("missingno"); -+ ResourceLocation var10 = var9.getResourceLocation(par1EntityItem.getEntityItem().getItemSpriteNumber()); -+ par2Icon = ((TextureMap)var9.getTexture(var10)).getAtlasSprite("missingno"); - } - -- float var25 = ((Icon)var2).getMinU(); -- float var26 = ((Icon)var2).getMaxU(); -- float var11 = ((Icon)var2).getMinV(); -- float var12 = ((Icon)var2).getMaxV(); -+ float var25 = ((Icon)par2Icon).getMinU(); -+ float var26 = ((Icon)par2Icon).getMaxU(); -+ float var11 = ((Icon)par2Icon).getMinV(); -+ float var12 = ((Icon)par2Icon).getMaxV(); - float var13 = 1.0F; - float var14 = 0.5F; - float var15 = 0.25F; - float var17; -- if(this.renderManager.options.fancyGraphics) { -+ // Spout Start -+ if (customTexture) { -+ var25 = 0F; -+ var26 = 1F; -+ var11 = 1F; -+ var12 = 0F; -+ } -+ // Spout End -+ -+ if (this.renderManager.options.fancyGraphics || Configuration.fancyItems) { - GL11.glPushMatrix(); -- if(renderInFrame) { -+ -+ if (renderInFrame) { - GL11.glRotatef(180.0F, 0.0F, 1.0F, 0.0F); - } else { -- GL11.glRotatef((((float)var1.age + var4) / 20.0F + var1.hoverStart) * (180.0F / (float)Math.PI), 0.0F, 1.0F, 0.0F); -+ GL11.glRotatef((((float)par1EntityItem.age + par4) / 20.0F + par1EntityItem.hoverStart) * (180F / (float)Math.PI), 0.0F, 1.0F, 0.0F); - } - -- float var16 = 1.0F / 16.0F; -- var17 = 7.0F / 320.0F; -- ItemStack var18 = var1.getEntityItem(); -+ float var16 = 0.0625F; -+ var17 = 0.021875F; -+ ItemStack var18 = par1EntityItem.getEntityItem(); - int var19 = var18.stackSize; -- byte var24; -- if(var19 < 2) { -- var24 = 1; -- } else if(var19 < 16) { -- var24 = 2; -- } else if(var19 < 32) { -- var24 = 3; -+ byte var27; -+ -+ if (var19 < 2) { -+ var27 = 1; -+ } else if (var19 < 16) { -+ var27 = 2; -+ } else if (var19 < 32) { -+ var27 = 3; - } else { -- var24 = 4; -+ var27 = 4; - } - -- GL11.glTranslatef(-var14, -var15, -((var16 + var17) * (float)var24 / 2.0F)); -+ GL11.glTranslatef(-var14, -var15, -((var16 + var17) * (float)var27 / 2.0F)); - -- for(int var20 = 0; var20 < var24; ++var20) { -+ for (int var20 = 0; var20 < var27; ++var20) { - GL11.glTranslatef(0.0F, 0.0F, var16 + var17); -- if(var18.getItemSpriteNumber() == 0 && Block.blocksList[var18.itemID] != null) { -- this.bindTexture(TextureMap.locationBlocksTexture); -+ -+ //Don't need this -+ /* -+ if (var18.getItemSpriteNumber() == 0 && Block.blocksList[var18.itemID] != null) { -+ Minecraft.getMinecraft().getTextureManager().bindTexture(new ResourceLocation("textures/atlas/blocks.png")); - } else { -- this.bindTexture(TextureMap.locationItemsTexture); -- } -- -- GL11.glColor4f(var5, var6, var7, 1.0F); -- ItemRenderer.renderItemIn2D(var8, var26, var11, var25, var12, ((Icon)var2).getIconWidth(), ((Icon)var2).getIconHeight(), var16); -- if(var18.hasEffect()) { -+ Minecraft.getMinecraft().getTextureManager().bindTexture(new ResourceLocation("textures/atlas/items.png")); -+ }*/ -+ -+ GL11.glColor4f(par5, par6, par7, 1.0F); -+ ItemRenderer.renderItemIn2D(var8, var26, var11, var25, var12, ((Icon)par2Icon).getIconWidth(), ((Icon)par2Icon).getIconHeight(), var16); -+ -+ if (var18.hasEffect()) { - GL11.glDepthFunc(GL11.GL_EQUAL); - GL11.glDisable(GL11.GL_LIGHTING); - this.renderManager.renderEngine.bindTexture(RES_ITEM_GLINT); -@@ -195,7 +297,7 @@ - GL11.glColor4f(0.5F * var21, 0.25F * var21, 0.8F * var21, 1.0F); - GL11.glMatrixMode(GL11.GL_TEXTURE); - GL11.glPushMatrix(); -- float var22 = 2.0F / 16.0F; -+ float var22 = 0.125F; - GL11.glScalef(var22, var22, var22); - float var23 = (float)(Minecraft.getSystemTime() % 3000L) / 3000.0F * 8.0F; - GL11.glTranslatef(var23, 0.0F, 0.0F); -@@ -218,20 +320,21 @@ - - GL11.glPopMatrix(); - } else { -- for(int var27 = 0; var27 < var3; ++var27) { -+ for (int var27 = 0; var27 < par3; ++var27) { - GL11.glPushMatrix(); -- if(var27 > 0) { -- var17 = (this.j.nextFloat() * 2.0F - 1.0F) * 0.3F; -- float var28 = (this.j.nextFloat() * 2.0F - 1.0F) * 0.3F; -- float var29 = (this.j.nextFloat() * 2.0F - 1.0F) * 0.3F; -- GL11.glTranslatef(var17, var28, var29); -+ -+ if (var27 > 0) { -+ var17 = (this.random.nextFloat() * 2.0F - 1.0F) * 0.3F; -+ float var29 = (this.random.nextFloat() * 2.0F - 1.0F) * 0.3F; -+ float var28 = (this.random.nextFloat() * 2.0F - 1.0F) * 0.3F; -+ GL11.glTranslatef(var17, var29, var28); - } - -- if(!renderInFrame) { -+ if (!renderInFrame) { - GL11.glRotatef(180.0F - this.renderManager.playerViewY, 0.0F, 1.0F, 0.0F); - } - -- GL11.glColor4f(var5, var6, var7, 1.0F); -+ GL11.glColor4f(par5, par6, par7, 1.0F); - var8.startDrawingQuads(); - var8.setNormal(0.0F, 1.0F, 0.0F); - var8.addVertexWithUV((double)(0.0F - var14), (double)(0.0F - var15), 0.0D, (double)var25, (double)var12); -@@ -242,111 +345,171 @@ - GL11.glPopMatrix(); - } - } -- - } - -- public void renderItemIntoGUI(FontRenderer var1, TextureManager var2, ItemStack var3, int var4, int var5) { -- int var6 = var3.itemID; -- int var7 = var3.getItemDamage(); -- Object var8 = var3.getIconIndex(); -+ /** -+ * Renders the item's icon or block into the UI at the specified position. -+ */ -+ public void renderItemIntoGUI(FontRenderer par1FontRenderer, TextureManager par2TextureManager, ItemStack par3ItemStack, int par4, int par5) { -+ int var6 = par3ItemStack.itemID; -+ int var7 = par3ItemStack.getItemDamage(); -+ Object var8 = par3ItemStack.getIconIndex(); -+ float var17; -+ int var18; - float var12; - float var13; -- int var17; -- float var18; -- if(var3.getItemSpriteNumber() == 0 && RenderBlocks.renderItemIn3d(Block.blocksList[var6].getRenderType())) { -- var2.bindTexture(TextureMap.locationBlocksTexture); -- Block var16 = Block.blocksList[var6]; -+ -+ // Spout Start -+ boolean custom = false; -+ BlockDesign design = null; -+ if (var6 == 318) { -+ org.spoutcraft.api.material.CustomItem item = MaterialData.getCustomItem(var7); -+ if (item != null) { -+ String textureURI = item.getTexture(); -+ if (textureURI == null) { -+ org.spoutcraft.api.material.CustomBlock block = MaterialData.getCustomBlock(var7); -+ design = block != null ? block.getBlockDesign() : null; -+ textureURI = design != null ? design.getTextureURL() : null; -+ } -+ if (textureURI != null) { -+ Texture texture = CustomTextureManager.getTextureFromUrl(item.getAddon(), textureURI); -+ if (texture != null) { -+ Minecraft.getMinecraft().getTextureManager().bindTexture(texture.getTextureID()); -+ custom = true; -+ } -+ } -+ } -+ } -+ if (!custom) { -+ if (var6 < 256) { -+ Minecraft.getMinecraft().getTextureManager().bindTexture(new ResourceLocation("textures/atlas/blocks.png")); -+ } else { -+ Minecraft.getMinecraft().getTextureManager().bindTexture(new ResourceLocation("textures/atlas/items.png")); -+ } -+ } -+ -+ if (design != null && custom) { -+ GL11.glDisable(GL11.GL_LIGHTING); -+ design.renderItemOnHUD((float)(par4 - 2), (float)(par5 + 3), -3.0F + this.zLevel); -+ GL11.glEnable(GL11.GL_LIGHTING); -+ } else if (par3ItemStack.getItemSpriteNumber() == 0 && RenderBlocks.renderItemIn3d(Block.blocksList[var6].getRenderType())) { -+ Minecraft.getMinecraft().getTextureManager().bindTexture(new ResourceLocation("textures/atlas/blocks.png")); -+ Block var15 = Block.blocksList[var6]; - GL11.glPushMatrix(); -- GL11.glTranslatef((float)(var4 - 2), (float)(var5 + 3), -3.0F + this.zLevel); -+ GL11.glTranslatef((float)(par4 - 2), (float)(par5 + 3), -3.0F + this.zLevel); - GL11.glScalef(10.0F, 10.0F, 10.0F); - GL11.glTranslatef(1.0F, 0.5F, 1.0F); - GL11.glScalef(1.0F, 1.0F, -1.0F); - GL11.glRotatef(210.0F, 1.0F, 0.0F, 0.0F); - GL11.glRotatef(45.0F, 0.0F, 1.0F, 0.0F); -- var17 = Item.itemsList[var6].getColorFromItemStack(var3, 0); -- var18 = (float)(var17 >> 16 & 255) / 255.0F; -- var12 = (float)(var17 >> 8 & 255) / 255.0F; -- var13 = (float)(var17 & 255) / 255.0F; -- if(this.renderWithColor) { -- GL11.glColor4f(var18, var12, var13, 1.0F); -+ var18 = Item.itemsList[var6].getColorFromItemStack(par3ItemStack, 0); -+ var17 = (float)(var18 >> 16 & 255) / 255.0F; -+ var12 = (float)(var18 >> 8 & 255) / 255.0F; -+ var13 = (float)(var18 & 255) / 255.0F; -+ -+ if (this.renderWithColor) { -+ GL11.glColor4f(var17, var12, var13, 1.0F); - } - - GL11.glRotatef(-90.0F, 0.0F, 1.0F, 0.0F); - this.itemRenderBlocks.useInventoryTint = this.renderWithColor; -- this.itemRenderBlocks.renderBlockAsItem(var16, var7, 1.0F); -+ this.itemRenderBlocks.renderBlockAsItem(var15, var7, 1.0F); - this.itemRenderBlocks.useInventoryTint = true; - GL11.glPopMatrix(); -- } else if(Item.itemsList[var6].requiresMultipleRenderPasses()) { -- GL11.glDisable(GL11.GL_LIGHTING); -- var2.bindTexture(TextureMap.locationItemsTexture); -- -- for(int var9 = 0; var9 <= 1; ++var9) { -- Icon var10 = Item.itemsList[var6].getIconFromDamageForRenderPass(var7, var9); -- int var11 = Item.itemsList[var6].getColorFromItemStack(var3, var9); -- var12 = (float)(var11 >> 16 & 255) / 255.0F; -- var13 = (float)(var11 >> 8 & 255) / 255.0F; -- float var14 = (float)(var11 & 255) / 255.0F; -- if(this.renderWithColor) { -- GL11.glColor4f(var12, var13, var14, 1.0F); -- } -- -- this.renderIcon(var4, var5, var10, 16, 16); -- } -- -- GL11.glEnable(GL11.GL_LIGHTING); - } else { -- GL11.glDisable(GL11.GL_LIGHTING); -- ResourceLocation var15 = var2.getResourceLocation(var3.getItemSpriteNumber()); -- var2.bindTexture(var15); -- if(var8 == null) { -- var8 = ((TextureMap)Minecraft.getMinecraft().getTextureManager().getTexture(var15)).getAtlasSprite("missingno"); -- } -- -- var17 = Item.itemsList[var6].getColorFromItemStack(var3, 0); -- var18 = (float)(var17 >> 16 & 255) / 255.0F; -- var12 = (float)(var17 >> 8 & 255) / 255.0F; -- var13 = (float)(var17 & 255) / 255.0F; -- if(this.renderWithColor) { -- GL11.glColor4f(var18, var12, var13, 1.0F); -- } -- -- this.renderIcon(var4, var5, (Icon)var8, 16, 16); -- GL11.glEnable(GL11.GL_LIGHTING); -+ if (Item.itemsList[var6].requiresMultipleRenderPasses()) { -+ GL11.glDisable(GL11.GL_LIGHTING); -+ if (!custom) { -+ Minecraft.getMinecraft().getTextureManager().bindTexture(new ResourceLocation("textures/atlas/items.png")); -+ } -+ for (int var9 = 0; var9 <= 1; ++var9) { -+ Icon var10 = Item.itemsList[var6].getIconFromDamageForRenderPass(var7, var9); -+ int var11 = Item.itemsList[var6].getColorFromItemStack(par3ItemStack, var9); -+ var12 = (float)(var11 >> 16 & 255) / 255.0F; -+ var13 = (float)(var11 >> 8 & 255) / 255.0F; -+ float var14 = (float)(var11 & 255) / 255.0F; -+ -+ if (this.renderWithColor) { -+ GL11.glColor4f(var12, var13, var14, 1.0F); -+ } -+ -+ this.renderIcon(par4, par5, var10, 16, 16); -+ } -+ -+ GL11.glEnable(GL11.GL_LIGHTING); -+ } else { -+ GL11.glDisable(GL11.GL_LIGHTING); -+ -+ ResourceLocation var16 = par2TextureManager.getResourceLocation(par3ItemStack.getItemSpriteNumber()); -+ if (!custom) { -+ par2TextureManager.bindTexture(var16); -+ } -+ -+ if (var8 == null) { -+ var8 = ((TextureMap)Minecraft.getMinecraft().getTextureManager().getTexture(var16)).getAtlasSprite("missingno"); -+ } -+ -+ var18 = Item.itemsList[var6].getColorFromItemStack(par3ItemStack, 0); -+ var17 = (float)(var18 >> 16 & 255) / 255.0F; -+ var12 = (float)(var18 >> 8 & 255) / 255.0F; -+ var13 = (float)(var18 & 255) / 255.0F; -+ -+ if (this.renderWithColor) { -+ GL11.glColor4f(var17, var12, var13, 1.0F); -+ } -+ -+ // Spout Start -+ if (custom) { -+ Tessellator tes = Tessellator.instance; -+ tes.startDrawingQuads(); -+ tes.addVertexWithUV((double)(par4 + 0), (double)(par5 + 16), (double)0, 0, 0); -+ tes.addVertexWithUV((double)(par4 + 16), (double)(par5 + 16), (double)0, 1, 0); -+ tes.addVertexWithUV((double)(par4 + 16), (double)(par5 + 0), (double)0, 1, 1); -+ tes.addVertexWithUV((double)(par4 + 0), (double)(par5 + 0), (double)0, 0, 1); -+ tes.draw(); -+ } else { -+ this.renderIcon(par4, par5, (Icon)var8, 16, 16); -+ } -+ GL11.glEnable(GL11.GL_LIGHTING); -+ } - } -- - GL11.glEnable(GL11.GL_CULL_FACE); - } - -- public void renderItemAndEffectIntoGUI(FontRenderer var1, TextureManager var2, ItemStack var3, int var4, int var5) { -- if(var3 != null) { -- this.renderItemIntoGUI(var1, var2, var3, var4, var5); -- if(var3.hasEffect()) { -+ -+ /** -+ * Render the item's icon or block into the GUI, including the glint effect. -+ */ -+ public void renderItemAndEffectIntoGUI(FontRenderer par1FontRenderer, TextureManager par2TextureManager, ItemStack par3ItemStack, int par4, int par5) { -+ if (par3ItemStack != null) { -+ this.renderItemIntoGUI(par1FontRenderer, par2TextureManager, par3ItemStack, par4, par5); -+ -+ if (par3ItemStack.hasEffect()) { - GL11.glDepthFunc(GL11.GL_GREATER); - GL11.glDisable(GL11.GL_LIGHTING); - GL11.glDepthMask(false); -- var2.bindTexture(RES_ITEM_GLINT); -+ par2TextureManager.bindTexture(RES_ITEM_GLINT); - this.zLevel -= 50.0F; - GL11.glEnable(GL11.GL_BLEND); - GL11.glBlendFunc(GL11.GL_DST_COLOR, GL11.GL_DST_COLOR); - GL11.glColor4f(0.5F, 0.25F, 0.8F, 1.0F); -- this.renderGlint(var4 * 431278612 + var5 * 32178161, var4 - 2, var5 - 2, 20, 20); -+ this.renderGlint(par4 * 431278612 + par5 * 32178161, par4 - 2, par5 - 2, 20, 20); - GL11.glDisable(GL11.GL_BLEND); - GL11.glDepthMask(true); - this.zLevel += 50.0F; - GL11.glEnable(GL11.GL_LIGHTING); - GL11.glDepthFunc(GL11.GL_LEQUAL); - } -- - } - } - -- private void renderGlint(int var1, int var2, int var3, int var4, int var5) { -- for(int var6 = 0; var6 < 2; ++var6) { -- if(var6 == 0) { -+ private void renderGlint(int par1, int par2, int par3, int par4, int par5) { -+ for (int var6 = 0; var6 < 2; ++var6) { -+ if (var6 == 0) { - GL11.glBlendFunc(GL11.GL_SRC_COLOR, GL11.GL_ONE); - } - -- if(var6 == 1) { -+ if (var6 == 1) { - GL11.glBlendFunc(GL11.GL_SRC_COLOR, GL11.GL_ONE); - } - -@@ -356,81 +519,117 @@ - float var10 = 0.0F; - Tessellator var11 = Tessellator.instance; - float var12 = 4.0F; -- if(var6 == 1) { -+ -+ if (var6 == 1) { - var12 = -1.0F; - } - - var11.startDrawingQuads(); -- var11.addVertexWithUV((double)(var2 + 0), (double)(var3 + var5), (double)this.zLevel, (double)((var9 + (float)var5 * var12) * var7), (double)((var10 + (float)var5) * var8)); -- var11.addVertexWithUV((double)(var2 + var4), (double)(var3 + var5), (double)this.zLevel, (double)((var9 + (float)var4 + (float)var5 * var12) * var7), (double)((var10 + (float)var5) * var8)); -- var11.addVertexWithUV((double)(var2 + var4), (double)(var3 + 0), (double)this.zLevel, (double)((var9 + (float)var4) * var7), (double)((var10 + 0.0F) * var8)); -- var11.addVertexWithUV((double)(var2 + 0), (double)(var3 + 0), (double)this.zLevel, (double)((var9 + 0.0F) * var7), (double)((var10 + 0.0F) * var8)); -+ var11.addVertexWithUV((double)(par2 + 0), (double)(par3 + par5), (double)this.zLevel, (double)((var9 + (float)par5 * var12) * var7), (double)((var10 + (float)par5) * var8)); -+ var11.addVertexWithUV((double)(par2 + par4), (double)(par3 + par5), (double)this.zLevel, (double)((var9 + (float)par4 + (float)par5 * var12) * var7), (double)((var10 + (float)par5) * var8)); -+ var11.addVertexWithUV((double)(par2 + par4), (double)(par3 + 0), (double)this.zLevel, (double)((var9 + (float)par4) * var7), (double)((var10 + 0.0F) * var8)); -+ var11.addVertexWithUV((double)(par2 + 0), (double)(par3 + 0), (double)this.zLevel, (double)((var9 + 0.0F) * var7), (double)((var10 + 0.0F) * var8)); - var11.draw(); - } -- -- } -- -- public void renderItemOverlayIntoGUI(FontRenderer var1, TextureManager var2, ItemStack var3, int var4, int var5) { -- this.renderItemOverlayIntoGUI(var1, var2, var3, var4, var5, (String)null); -- } -- -- public void renderItemOverlayIntoGUI(FontRenderer var1, TextureManager var2, ItemStack var3, int var4, int var5, String var6) { -- if(var3 != null) { -- if(var3.stackSize > 1 || var6 != null) { -- String var7 = var6 == null ? String.valueOf(var3.stackSize) : var6; -+ } -+ -+ /** -+ * Renders the item's overlay information. Examples being stack count or damage on top of the item's image at the -+ * specified position. -+ */ -+ public void renderItemOverlayIntoGUI(FontRenderer par1FontRenderer, TextureManager par2TextureManager, ItemStack par3ItemStack, int par4, int par5) { -+ this.renderItemOverlayIntoGUI(par1FontRenderer, par2TextureManager, par3ItemStack, par4, par5, (String)null); -+ } -+ -+ public void renderItemOverlayIntoGUI(FontRenderer par1FontRenderer, TextureManager par2TextureManager, ItemStack par3ItemStack, int par4, int par5, String par6Str) { -+ if (par3ItemStack != null) { -+ if (par3ItemStack.stackSize > 1 || par6Str != null) { -+ String var7 = par6Str == null ? String.valueOf(par3ItemStack.stackSize) : par6Str; - GL11.glDisable(GL11.GL_LIGHTING); - GL11.glDisable(GL11.GL_DEPTH_TEST); -- var1.drawStringWithShadow(var7, var4 + 19 - 2 - var1.getStringWidth(var7), var5 + 6 + 3, 16777215); -+ par1FontRenderer.drawStringWithShadow(var7, par4 + 19 - 2 - par1FontRenderer.getStringWidth(var7), par5 + 6 + 3, 16777215); - GL11.glEnable(GL11.GL_LIGHTING); - GL11.glEnable(GL11.GL_DEPTH_TEST); - } - -- if(var3.isItemDamaged()) { -- int var12 = (int)Math.round(13.0D - (double)var3.getItemDamageForDisplay() * 13.0D / (double)var3.getMaxDamage()); -- int var8 = (int)Math.round(255.0D - (double)var3.getItemDamageForDisplay() * 255.0D / (double)var3.getMaxDamage()); -+ // Spout Start -+ NBTTagList list = par3ItemStack.getAllEnchantmentTagList(); -+ short max = -1; -+ short amnt = -1; -+ if (list != null) { -+ for (int i = 0; i < list.tagCount(); i++) { -+ NBTBase tag = list.tagAt(i); -+ if (tag instanceof NBTTagCompound) { -+ NBTTagCompound ench = (NBTTagCompound)tag; -+ short id = ench.getShort("id"); -+ short lvl = ench.getShort("lvl"); -+ if (id == 254) -+ amnt = lvl; //Enchantment DURABILITY = new SpoutEnchantment(254); -+ if (id == 255) -+ max = lvl; //Enchantment MAX_DURABILITY = new SpoutEnchantment(255); -+ } -+ } -+ } -+ boolean override = max > 0 && amnt > 0 && amnt < max; -+ if (par3ItemStack.isItemDamaged() || override) { -+ int var12 = (int)Math.round(13.0D - (double)(override ? amnt : par3ItemStack.getItemDamageForDisplay()) * 13.0D / (double)(override ? max : par3ItemStack.getMaxDamage())); -+ int var8 = (int)Math.round(255.0D - (double)(override ? amnt : par3ItemStack.getItemDamageForDisplay()) * 255.0D / (double)(override ? max : par3ItemStack.getMaxDamage())); -+ // Spout End - GL11.glDisable(GL11.GL_LIGHTING); - GL11.glDisable(GL11.GL_DEPTH_TEST); - GL11.glDisable(GL11.GL_TEXTURE_2D); - Tessellator var9 = Tessellator.instance; - int var10 = 255 - var8 << 16 | var8 << 8; - int var11 = (255 - var8) / 4 << 16 | 16128; -- this.renderQuad(var9, var4 + 2, var5 + 13, 13, 2, 0); -- this.renderQuad(var9, var4 + 2, var5 + 13, 12, 1, var11); -- this.renderQuad(var9, var4 + 2, var5 + 13, var12, 1, var10); -+ this.renderQuad(var9, par4 + 2, par5 + 13, 13, 2, 0); -+ this.renderQuad(var9, par4 + 2, par5 + 13, 12, 1, var11); -+ this.renderQuad(var9, par4 + 2, par5 + 13, var12, 1, var10); - GL11.glEnable(GL11.GL_TEXTURE_2D); - GL11.glEnable(GL11.GL_LIGHTING); - GL11.glEnable(GL11.GL_DEPTH_TEST); - GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - } -- - } - } - -- private void renderQuad(Tessellator var1, int var2, int var3, int var4, int var5, int var6) { -- var1.startDrawingQuads(); -- var1.setColorOpaque_I(var6); -- var1.addVertex((double)(var2 + 0), (double)(var3 + 0), 0.0D); -- var1.addVertex((double)(var2 + 0), (double)(var3 + var5), 0.0D); -- var1.addVertex((double)(var2 + var4), (double)(var3 + var5), 0.0D); -- var1.addVertex((double)(var2 + var4), (double)(var3 + 0), 0.0D); -- var1.draw(); -+ /** -+ * Adds a quad to the tesselator at the specified position with the set width and height and color. Args: tessellator, -+ * x, y, width, height, color -+ */ -+ private void renderQuad(Tessellator par1Tessellator, int par2, int par3, int par4, int par5, int par6) { -+ par1Tessellator.startDrawingQuads(); -+ par1Tessellator.setColorOpaque_I(par6); -+ par1Tessellator.addVertex((double)(par2 + 0), (double)(par3 + 0), 0.0D); -+ par1Tessellator.addVertex((double)(par2 + 0), (double)(par3 + par5), 0.0D); -+ par1Tessellator.addVertex((double)(par2 + par4), (double)(par3 + par5), 0.0D); -+ par1Tessellator.addVertex((double)(par2 + par4), (double)(par3 + 0), 0.0D); -+ par1Tessellator.draw(); - } - -- public void renderIcon(int var1, int var2, Icon var3, int var4, int var5) { -+ public void renderIcon(int par1, int par2, Icon par3Icon, int par4, int par5) { - Tessellator var6 = Tessellator.instance; - var6.startDrawingQuads(); -- var6.addVertexWithUV((double)(var1 + 0), (double)(var2 + var5), (double)this.zLevel, (double)var3.getMinU(), (double)var3.getMaxV()); -- var6.addVertexWithUV((double)(var1 + var4), (double)(var2 + var5), (double)this.zLevel, (double)var3.getMaxU(), (double)var3.getMaxV()); -- var6.addVertexWithUV((double)(var1 + var4), (double)(var2 + 0), (double)this.zLevel, (double)var3.getMaxU(), (double)var3.getMinV()); -- var6.addVertexWithUV((double)(var1 + 0), (double)(var2 + 0), (double)this.zLevel, (double)var3.getMinU(), (double)var3.getMinV()); -+ var6.addVertexWithUV((double)(par1 + 0), (double)(par2 + par5), (double)this.zLevel, (double)par3Icon.getMinU(), (double)par3Icon.getMaxV()); -+ var6.addVertexWithUV((double)(par1 + par4), (double)(par2 + par5), (double)this.zLevel, (double)par3Icon.getMaxU(), (double)par3Icon.getMaxV()); -+ var6.addVertexWithUV((double)(par1 + par4), (double)(par2 + 0), (double)this.zLevel, (double)par3Icon.getMaxU(), (double)par3Icon.getMinV()); -+ var6.addVertexWithUV((double)(par1 + 0), (double)(par2 + 0), (double)this.zLevel, (double)par3Icon.getMinU(), (double)par3Icon.getMinV()); - var6.draw(); - } - -- protected ResourceLocation getEntityTexture(Entity var1) { -- return this.func_110796_a((EntityItem)var1); -+ /** -+ * Returns the location of an entity's texture. Doesn't seem to be called unless you call Render.bindEntityTexture. -+ */ -+ protected ResourceLocation getEntityTexture(Entity par1Entity) { -+ return this.func_110796_a((EntityItem)par1Entity); - } - -- public void doRender(Entity var1, double var2, double var4, double var6, float var8, float var9) { -- this.doRenderItem((EntityItem)var1, var2, var4, var6, var8, var9); -+ /** -+ * Actually renders the given argument. This is a synthetic bridge method, always casting down its argument and then -+ * handing it off to a worker function which does the actual work. In all probabilty, the class Render is generic -+ * (Render 4) { -+ if (this.scale > 4) { - this.scale = 4; - } - -- short var2 = var1.getShort("width"); -- short var3 = var1.getShort("height"); -- if(var2 == 128 && var3 == 128) { -- this.colors = var1.getByteArray("colors"); -+ short var2 = par1NBTTagCompound.getShort("width"); -+ short var3 = par1NBTTagCompound.getShort("height"); -+ -+ if (var2 == 128 && var3 == 128) { -+ this.colors = par1NBTTagCompound.getByteArray("colors"); - } else { -- byte[] var4 = var1.getByteArray("colors"); -+ byte[] var4 = par1NBTTagCompound.getByteArray("colors"); - this.colors = new byte[16384]; - int var5 = (128 - var2) / 2; - int var6 = (128 - var3) / 2; - -- for(int var7 = 0; var7 < var3; ++var7) { -+ for (int var7 = 0; var7 < var3; ++var7) { - int var8 = var7 + var6; -- if(var8 >= 0 || var8 < 128) { -- for(int var9 = 0; var9 < var2; ++var9) { -+ -+ if (var8 >= 0 || var8 < 128) { -+ for (int var9 = 0; var9 < var2; ++var9) { - int var10 = var9 + var5; -- if(var10 >= 0 || var10 < 128) { -+ -+ if (var10 >= 0 || var10 < 128) { - this.colors[var10 + var8 * 128] = var4[var9 + var7 * var2]; - } - } - } - } - } -- -- } -- -- public void writeToNBT(NBTTagCompound var1) { -- var1.setByte("dimension", this.dimension); -- var1.setInteger("xCenter", this.xCenter); -- var1.setInteger("zCenter", this.zCenter); -- var1.setByte("scale", this.scale); -- var1.setShort("width", (short)128); -- var1.setShort("height", (short)128); -- var1.setByteArray("colors", this.colors); -- } -- -- public void updateVisiblePlayers(EntityPlayer var1, ItemStack var2) { -- if(!this.i.containsKey(var1)) { -- MapInfo var3 = new MapInfo(this, var1); -- this.i.put(var1, var3); -- this.f.add(var3); -- } -- -- if(!var1.inventory.hasItemStack(var2)) { -- this.g.remove(var1.getCommandSenderName()); -- } -- -- for(int var5 = 0; var5 < this.f.size(); ++var5) { -- MapInfo var4 = (MapInfo)this.f.get(var5); -- if(!var4.entityplayerObj.isDead && (var4.entityplayerObj.inventory.hasItemStack(var2) || var2.isOnItemFrame())) { -- if(!var2.isOnItemFrame() && var4.entityplayerObj.dimension == this.dimension) { -+ } -+ -+ /** -+ * write data to NBTTagCompound from this MapDataBase, similar to Entities and TileEntities -+ */ -+ public void writeToNBT(NBTTagCompound par1NBTTagCompound) { -+ par1NBTTagCompound.setByte("dimension", this.dimension); -+ par1NBTTagCompound.setInteger("xCenter", this.xCenter); -+ par1NBTTagCompound.setInteger("zCenter", this.zCenter); -+ par1NBTTagCompound.setByte("scale", this.scale); -+ par1NBTTagCompound.setShort("width", (short)128); -+ par1NBTTagCompound.setShort("height", (short)128); -+ par1NBTTagCompound.setByteArray("colors", this.colors); -+ } -+ -+ /** -+ * Adds the player passed to the list of visible players and checks to see which players are visible -+ */ -+ public void updateVisiblePlayers(EntityPlayer par1EntityPlayer, ItemStack par2ItemStack) { -+ if (!this.playersHashMap.containsKey(par1EntityPlayer)) { -+ MapInfo var3 = new MapInfo(this, par1EntityPlayer); -+ this.playersHashMap.put(par1EntityPlayer, var3); -+ this.playersArrayList.add(var3); -+ } -+ -+ if (!par1EntityPlayer.inventory.hasItemStack(par2ItemStack)) { -+ this.playersVisibleOnMap.remove(par1EntityPlayer.getCommandSenderName()); -+ } -+ -+ for (int var5 = 0; var5 < this.playersArrayList.size(); ++var5) { -+ MapInfo var4 = (MapInfo)this.playersArrayList.get(var5); -+ -+ if (!var4.entityplayerObj.isDead && (var4.entityplayerObj.inventory.hasItemStack(par2ItemStack) || par2ItemStack.isOnItemFrame())) { -+ if (!par2ItemStack.isOnItemFrame() && var4.entityplayerObj.dimension == this.dimension) { - this.func_82567_a(0, var4.entityplayerObj.worldObj, var4.entityplayerObj.getCommandSenderName(), var4.entityplayerObj.posX, var4.entityplayerObj.posZ, (double)var4.entityplayerObj.rotationYaw); - } - } else { -- this.i.remove(var4.entityplayerObj); -- this.f.remove(var4); -+ this.playersHashMap.remove(var4.entityplayerObj); -+ this.playersArrayList.remove(var4); - } - } - -- if(var2.isOnItemFrame()) { -- this.func_82567_a(1, var1.worldObj, "frame-" + var2.getItemFrame().entityId, (double)var2.getItemFrame().xPosition, (double)var2.getItemFrame().zPosition, (double)(var2.getItemFrame().hangingDirection * 90)); -+ if (par2ItemStack.isOnItemFrame()) { -+ this.func_82567_a(1, par1EntityPlayer.worldObj, "frame-" + par2ItemStack.getItemFrame().entityId, (double)par2ItemStack.getItemFrame().xPosition, (double)par2ItemStack.getItemFrame().zPosition, (double)(par2ItemStack.getItemFrame().hangingDirection * 90)); - } -- - } - -- private void func_82567_a(int var1, World var2, String var3, double var4, double var6, double var8) { -+ private void func_82567_a(int par1, World par2World, String par3Str, double par4, double par6, double par8) { - int var10 = 1 << this.scale; -- float var11 = (float)(var4 - (double)this.xCenter) / (float)var10; -- float var12 = (float)(var6 - (double)this.zCenter) / (float)var10; -+ float var11 = (float)(par4 - (double)this.xCenter) / (float)var10; -+ float var12 = (float)(par6 - (double)this.zCenter) / (float)var10; - byte var13 = (byte)((int)((double)(var11 * 2.0F) + 0.5D)); - byte var14 = (byte)((int)((double)(var12 * 2.0F) + 0.5D)); - byte var16 = 63; - byte var15; -- if(var11 >= (float)(-var16) && var12 >= (float)(-var16) && var11 <= (float)var16 && var12 <= (float)var16) { -- var8 += var8 < 0.0D ? -8.0D : 8.0D; -- var15 = (byte)((int)(var8 * 16.0D / 360.0D)); -- if(this.dimension < 0) { -- int var17 = (int)(var2.getWorldInfo().getWorldTime() / 10L); -+ -+ if (var11 >= (float)(-var16) && var12 >= (float)(-var16) && var11 <= (float)var16 && var12 <= (float)var16) { -+ par8 += par8 < 0.0D ? -8.0D : 8.0D; -+ var15 = (byte)((int)(par8 * 16.0D / 360.0D)); -+ -+ if (this.dimension < 0) { -+ int var17 = (int)(par2World.getWorldInfo().getWorldTime() / 10L); - var15 = (byte)(var17 * var17 * 34187121 + var17 * 121 >> 15 & 15); - } - } else { -- if(Math.abs(var11) >= 320.0F || Math.abs(var12) >= 320.0F) { -- this.g.remove(var3); -+ if (Math.abs(var11) >= 320.0F || Math.abs(var12) >= 320.0F) { -+ this.playersVisibleOnMap.remove(par3Str); - return; - } - -- var1 = 6; -+ par1 = 6; - var15 = 0; -- if(var11 <= (float)(-var16)) { -+ -+ if (var11 <= (float)(-var16)) { - var13 = (byte)((int)((double)(var16 * 2) + 2.5D)); - } - -- if(var12 <= (float)(-var16)) { -+ if (var12 <= (float)(-var16)) { - var14 = (byte)((int)((double)(var16 * 2) + 2.5D)); - } - -- if(var11 >= (float)var16) { -+ if (var11 >= (float)var16) { - var13 = (byte)(var16 * 2 + 1); - } - -- if(var12 >= (float)var16) { -+ if (var12 >= (float)var16) { - var14 = (byte)(var16 * 2 + 1); - } - } - -- this.g.put(var3, new MapCoord(this, (byte)var1, var13, var14, var15)); -- } -- -- public byte[] getUpdatePacketData(ItemStack var1, World var2, EntityPlayer var3) { -- MapInfo var4 = (MapInfo)this.i.get(var3); -- return var4 == null ? null : var4.getPlayersOnMap(var1); -- } -- -- public void setColumnDirty(int var1, int var2, int var3) { -+ this.playersVisibleOnMap.put(par3Str, new MapCoord(this, (byte)par1, var13, var14, var15)); -+ } -+ -+ /** -+ * Get byte array of packet data to send to players on map for updating map data -+ */ -+ public byte[] getUpdatePacketData(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) { -+ MapInfo var4 = (MapInfo)this.playersHashMap.get(par3EntityPlayer); -+ return var4 == null ? null : var4.getPlayersOnMap(par1ItemStack); -+ } -+ -+ /** -+ * Marks a vertical range of pixels as being modified so they will be resent to clients. Parameters: X, lowest Y, -+ * highest Y -+ */ -+ public void setColumnDirty(int par1, int par2, int par3) { - super.markDirty(); - -- for(int var4 = 0; var4 < this.f.size(); ++var4) { -- MapInfo var5 = (MapInfo)this.f.get(var4); -- if(var5.field_76209_b[var1] < 0 || var5.field_76209_b[var1] > var2) { -- var5.field_76209_b[var1] = var2; -+ for (int var4 = 0; var4 < this.playersArrayList.size(); ++var4) { -+ MapInfo var5 = (MapInfo)this.playersArrayList.get(var4); -+ -+ if (var5.field_76209_b[par1] < 0 || var5.field_76209_b[par1] > par2) { -+ var5.field_76209_b[par1] = par2; - } - -- if(var5.field_76210_c[var1] < 0 || var5.field_76210_c[var1] < var3) { -- var5.field_76210_c[var1] = var3; -+ if (var5.field_76210_c[par1] < 0 || var5.field_76210_c[par1] < par3) { -+ var5.field_76210_c[par1] = par3; - } - } -- - } - -- public void updateMPMapData(byte[] var1) { -+ /** -+ * Updates the client's map with information from other players in MP -+ */ -+ public void updateMPMapData(byte[] par1ArrayOfByte) { - int var2; -- if(var1[0] == 0) { -- var2 = var1[1] & 255; -- int var3 = var1[2] & 255; -- -- for(int var4 = 0; var4 < var1.length - 3; ++var4) { -- this.colors[(var4 + var3) * 128 + var2] = var1[var4 + 3]; -+ -+ if (par1ArrayOfByte[0] == 0) { -+ var2 = par1ArrayOfByte[1] & 255; -+ int var3 = par1ArrayOfByte[2] & 255; -+ -+ for (int var4 = 0; var4 < par1ArrayOfByte.length - 3; ++var4) { -+ this.colors[(var4 + var3) * 128 + var2] = par1ArrayOfByte[var4 + 3]; - } - - this.markDirty(); -- } else if(var1[0] == 1) { -- this.g.clear(); -+ } else if (par1ArrayOfByte[0] == 1) { -+ this.playersVisibleOnMap.clear(); - -- for(var2 = 0; var2 < (var1.length - 1) / 3; ++var2) { -- byte var7 = (byte)(var1[var2 * 3 + 1] >> 4); -- byte var8 = var1[var2 * 3 + 2]; -- byte var5 = var1[var2 * 3 + 3]; -- byte var6 = (byte)(var1[var2 * 3 + 1] & 15); -- this.g.put("icon-" + var2, new MapCoord(this, var7, var8, var5, var6)); -+ for (var2 = 0; var2 < (par1ArrayOfByte.length - 1) / 3; ++var2) { -+ byte var7 = (byte)(par1ArrayOfByte[var2 * 3 + 1] >> 4); -+ byte var8 = par1ArrayOfByte[var2 * 3 + 2]; -+ byte var5 = par1ArrayOfByte[var2 * 3 + 3]; -+ byte var6 = (byte)(par1ArrayOfByte[var2 * 3 + 1] & 15); -+ this.playersVisibleOnMap.put("icon-" + var2, new MapCoord(this, var7, var8, var5, var6)); - } -- } else if(var1[0] == 2) { -- this.scale = var1[1]; -+ } else if (par1ArrayOfByte[0] == 2) { -+ this.scale = par1ArrayOfByte[1]; - } -- - } - -- public MapInfo func_82568_a(EntityPlayer var1) { -- MapInfo var2 = (MapInfo)this.i.get(var1); -- if(var2 == null) { -- var2 = new MapInfo(this, var1); -- this.i.put(var1, var2); -- this.f.add(var2); -+ public MapInfo func_82568_a(EntityPlayer par1EntityPlayer) { -+ MapInfo var2 = (MapInfo)this.playersHashMap.get(par1EntityPlayer); -+ -+ if (var2 == null) { -+ var2 = new MapInfo(this, par1EntityPlayer); -+ this.playersHashMap.put(par1EntityPlayer, var2); -+ this.playersArrayList.add(var2); - } - - return var2; ---- net/minecraft/src/GuiBeacon.java -+++ net/minecraft/src/GuiBeacon.java -@@ -11,42 +11,50 @@ - private GuiBeaconButtonConfirm beaconConfirmButton; - private boolean buttonsNotDrawn; - -- public GuiBeacon(InventoryPlayer var1, TileEntityBeacon var2) { -- super(new ContainerBeacon(var1, var2)); -- this.beacon = var2; -+ public GuiBeacon(InventoryPlayer par1InventoryPlayer, TileEntityBeacon par2TileEntityBeacon) { -+ super(new ContainerBeacon(par1InventoryPlayer, par2TileEntityBeacon)); -+ this.beacon = par2TileEntityBeacon; - this.xSize = 230; - this.ySize = 219; - } - -+ /** -+ * Adds the buttons (and other controls) to the screen in question. -+ */ - public void initGui() { - super.initGui(); -- this.i.add(this.beaconConfirmButton = new GuiBeaconButtonConfirm(this, -1, this.guiLeft + 164, this.guiTop + 107)); -- this.i.add(new GuiBeaconButtonCancel(this, -2, this.guiLeft + 190, this.guiTop + 107)); -+ this.buttonList.add(this.beaconConfirmButton = new GuiBeaconButtonConfirm(this, -1, this.guiLeft + 164, this.guiTop + 107)); -+ this.buttonList.add(new GuiBeaconButtonCancel(this, -2, this.guiLeft + 190, this.guiTop + 107)); - this.buttonsNotDrawn = true; - this.beaconConfirmButton.enabled = false; - } - -+ /** -+ * Called from the main game loop to update the screen. -+ */ - public void updateScreen() { - super.updateScreen(); -- if(this.buttonsNotDrawn && this.beacon.getLevels() >= 0) { -+ -+ if (this.buttonsNotDrawn && this.beacon.getLevels() >= 0) { - this.buttonsNotDrawn = false; -- - int var2; - int var3; - int var4; - int var5; - GuiBeaconButtonPower var6; -- for(int var1 = 0; var1 <= 2; ++var1) { -+ -+ for (int var1 = 0; var1 <= 2; ++var1) { - var2 = TileEntityBeacon.effectsList[var1].length; - var3 = var2 * 22 + (var2 - 1) * 2; - -- for(var4 = 0; var4 < var2; ++var4) { -+ for (var4 = 0; var4 < var2; ++var4) { - var5 = TileEntityBeacon.effectsList[var1][var4].id; - var6 = new GuiBeaconButtonPower(this, var1 << 8 | var5, this.guiLeft + 76 + var4 * 24 - var3 / 2, this.guiTop + 22 + var1 * 25, var5, var1); -- this.i.add(var6); -- if(var1 >= this.beacon.getLevels()) { -+ this.buttonList.add(var6); -+ -+ if (var1 >= this.beacon.getLevels()) { - var6.enabled = false; -- } else if(var5 == this.beacon.getPrimaryEffect()) { -+ } else if (var5 == this.beacon.getPrimaryEffect()) { - var6.func_82254_b(true); - } - } -@@ -56,23 +64,25 @@ - var2 = TileEntityBeacon.effectsList[var7].length + 1; - var3 = var2 * 22 + (var2 - 1) * 2; - -- for(var4 = 0; var4 < var2 - 1; ++var4) { -+ for (var4 = 0; var4 < var2 - 1; ++var4) { - var5 = TileEntityBeacon.effectsList[var7][var4].id; - var6 = new GuiBeaconButtonPower(this, var7 << 8 | var5, this.guiLeft + 167 + var4 * 24 - var3 / 2, this.guiTop + 47, var5, var7); -- this.i.add(var6); -- if(var7 >= this.beacon.getLevels()) { -+ this.buttonList.add(var6); -+ -+ if (var7 >= this.beacon.getLevels()) { - var6.enabled = false; -- } else if(var5 == this.beacon.getSecondaryEffect()) { -+ } else if (var5 == this.beacon.getSecondaryEffect()) { - var6.func_82254_b(true); - } - } - -- if(this.beacon.getPrimaryEffect() > 0) { -+ if (this.beacon.getPrimaryEffect() > 0) { - GuiBeaconButtonPower var8 = new GuiBeaconButtonPower(this, var7 << 8 | this.beacon.getPrimaryEffect(), this.guiLeft + 167 + (var2 - 1) * 24 - var3 / 2, this.guiTop + 47, this.beacon.getPrimaryEffect(), var7); -- this.i.add(var8); -- if(var7 >= this.beacon.getLevels()) { -+ this.buttonList.add(var8); -+ -+ if (var7 >= this.beacon.getLevels()) { - var8.enabled = false; -- } else if(this.beacon.getPrimaryEffect() == this.beacon.getSecondaryEffect()) { -+ } else if (this.beacon.getPrimaryEffect() == this.beacon.getSecondaryEffect()) { - var8.func_82254_b(true); - } - } -@@ -81,10 +91,13 @@ - this.beaconConfirmButton.enabled = this.beacon.getStackInSlot(0) != null && this.beacon.getPrimaryEffect() > 0; - } - -- protected void actionPerformed(GuiButton var1) { -- if(var1.id == -2) { -+ /** -+ * Fired when a control is clicked. This is the equivalent of ActionListener.actionPerformed(ActionEvent e). -+ */ -+ protected void actionPerformed(GuiButton par1GuiButton) { -+ if (par1GuiButton.id == -2) { - this.mc.displayGuiScreen((GuiScreen)null); -- } else if(var1.id == -1) { -+ } else if (par1GuiButton.id == -1) { - String var2 = "MC|Beacon"; - ByteArrayOutputStream var3 = new ByteArrayOutputStream(); - DataOutputStream var4 = new DataOutputStream(var3); -@@ -98,37 +111,41 @@ - } - - this.mc.displayGuiScreen((GuiScreen)null); -- } else if(var1 instanceof GuiBeaconButtonPower) { -- if(((GuiBeaconButtonPower)var1).func_82255_b()) { -+ } else if (par1GuiButton instanceof GuiBeaconButtonPower) { -+ if (((GuiBeaconButtonPower)par1GuiButton).func_82255_b()) { - return; - } - -- int var7 = var1.id; -+ int var7 = par1GuiButton.id; - int var8 = var7 & 255; - int var9 = var7 >> 8; -- if(var9 < 3) { -+ -+ if (var9 < 3) { - this.beacon.setPrimaryEffect(var8); - } else { - this.beacon.setSecondaryEffect(var8); - } - -- this.i.clear(); -+ this.buttonList.clear(); - this.initGui(); - this.updateScreen(); - } -- - } - -- protected void drawGuiContainerForegroundLayer(int var1, int var2) { -+ /** -+ * Draw the foreground layer for the GuiContainer (everything in front of the items) -+ */ -+ protected void drawGuiContainerForegroundLayer(int par1, int par2) { - RenderHelper.disableStandardItemLighting(); - this.drawCenteredString(this.fontRenderer, I18n.getString("tile.beacon.primary"), 62, 10, 14737632); - this.drawCenteredString(this.fontRenderer, I18n.getString("tile.beacon.secondary"), 169, 10, 14737632); -- Iterator var3 = this.i.iterator(); -+ Iterator var3 = this.buttonList.iterator(); - -- while(var3.hasNext()) { -+ while (var3.hasNext()) { - GuiButton var4 = (GuiButton)var3.next(); -- if(var4.func_82252_a()) { -- var4.func_82251_b(var1 - this.guiLeft, var2 - this.guiTop); -+ -+ if (var4.func_82252_a()) { -+ var4.func_82251_b(par1 - this.guiLeft, par2 - this.guiTop); - break; - } - } -@@ -136,7 +153,10 @@ - RenderHelper.enableGUIStandardItemLighting(); - } - -- protected void drawGuiContainerBackgroundLayer(float var1, int var2, int var3) { -+ /** -+ * Draw the background layer for the GuiContainer (everything behind the items) -+ */ -+ protected void drawGuiContainerBackgroundLayer(float par1, int par2, int par3) { - GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - this.mc.getTextureManager().bindTexture(beaconGuiTextures); - int var4 = (this.width - this.xSize) / 2; ---- net/minecraft/src/ResourcePackFileNotFoundException.java -+++ net/minecraft/src/ResourcePackFileNotFoundException.java -@@ -4,7 +4,7 @@ - import java.io.FileNotFoundException; - - public class ResourcePackFileNotFoundException extends FileNotFoundException { -- public ResourcePackFileNotFoundException(File var1, String var2) { -- super(String.format("\'%s\' in ResourcePack \'%s\'", new Object[]{var2, var1})); -+ public ResourcePackFileNotFoundException(File par1File, String par2Str) { -+ super(String.format("\'%s\' in ResourcePack \'%s\'", new Object[] {par2Str, par1File})); - } - } ---- net/minecraft/src/CallableLWJGLVersion.java -+++ net/minecraft/src/CallableLWJGLVersion.java -@@ -4,10 +4,12 @@ - import org.lwjgl.Sys; - - class CallableLWJGLVersion implements Callable { -+ -+ /** Reference to the Minecraft object. */ - final Minecraft mc; - -- CallableLWJGLVersion(Minecraft var1) { -- this.mc = var1; -+ CallableLWJGLVersion(Minecraft par1Minecraft) { -+ this.mc = par1Minecraft; - } - - public String getType() { ---- net/minecraft/src/GuiFlatPresetsListSlot.java -+++ net/minecraft/src/GuiFlatPresetsListSlot.java -@@ -5,28 +5,29 @@ - - class GuiFlatPresetsListSlot extends GuiSlot { - public int field_82459_a; -+ - final GuiFlatPresets flatPresetsGui; - -- public GuiFlatPresetsListSlot(GuiFlatPresets var1) { -- super(var1.mc, var1.width, var1.height, 80, var1.height - 37, 24); -- this.flatPresetsGui = var1; -+ public GuiFlatPresetsListSlot(GuiFlatPresets par1GuiFlatPresets) { -+ super(par1GuiFlatPresets.mc, par1GuiFlatPresets.width, par1GuiFlatPresets.height, 80, par1GuiFlatPresets.height - 37, 24); -+ this.flatPresetsGui = par1GuiFlatPresets; - this.field_82459_a = -1; - } - -- private void func_82457_a(int var1, int var2, int var3) { -- this.func_82456_d(var1 + 1, var2 + 1); -+ private void func_82457_a(int par1, int par2, int par3) { -+ this.func_82456_d(par1 + 1, par2 + 1); - GL11.glEnable(GL12.GL_RESCALE_NORMAL); - RenderHelper.enableGUIStandardItemLighting(); -- GuiFlatPresets.getPresetIconRenderer().renderItemIntoGUI(this.flatPresetsGui.fontRenderer, this.flatPresetsGui.mc.getTextureManager(), new ItemStack(var3, 1, 0), var1 + 2, var2 + 2); -+ GuiFlatPresets.getPresetIconRenderer().renderItemIntoGUI(this.flatPresetsGui.fontRenderer, this.flatPresetsGui.mc.getTextureManager(), new ItemStack(par3, 1, 0), par1 + 2, par2 + 2); - RenderHelper.disableStandardItemLighting(); - GL11.glDisable(GL12.GL_RESCALE_NORMAL); - } - -- private void func_82456_d(int var1, int var2) { -- this.func_82455_b(var1, var2, 0, 0); -+ private void func_82456_d(int par1, int par2) { -+ this.func_82455_b(par1, par2, 0, 0); - } - -- private void func_82455_b(int var1, int var2, int var3, int var4) { -+ private void func_82455_b(int par1, int par2, int par3, int par4) { - GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - this.flatPresetsGui.mc.getTextureManager().bindTexture(Gui.statIcons); - float var5 = 0.0078125F; -@@ -35,33 +36,41 @@ - boolean var8 = true; - Tessellator var9 = Tessellator.instance; - var9.startDrawingQuads(); -- var9.addVertexWithUV((double)(var1 + 0), (double)(var2 + 18), (double)this.flatPresetsGui.zLevel, (double)((float)(var3 + 0) * 0.0078125F), (double)((float)(var4 + 18) * 0.0078125F)); -- var9.addVertexWithUV((double)(var1 + 18), (double)(var2 + 18), (double)this.flatPresetsGui.zLevel, (double)((float)(var3 + 18) * 0.0078125F), (double)((float)(var4 + 18) * 0.0078125F)); -- var9.addVertexWithUV((double)(var1 + 18), (double)(var2 + 0), (double)this.flatPresetsGui.zLevel, (double)((float)(var3 + 18) * 0.0078125F), (double)((float)(var4 + 0) * 0.0078125F)); -- var9.addVertexWithUV((double)(var1 + 0), (double)(var2 + 0), (double)this.flatPresetsGui.zLevel, (double)((float)(var3 + 0) * 0.0078125F), (double)((float)(var4 + 0) * 0.0078125F)); -+ var9.addVertexWithUV((double)(par1 + 0), (double)(par2 + 18), (double)this.flatPresetsGui.zLevel, (double)((float)(par3 + 0) * 0.0078125F), (double)((float)(par4 + 18) * 0.0078125F)); -+ var9.addVertexWithUV((double)(par1 + 18), (double)(par2 + 18), (double)this.flatPresetsGui.zLevel, (double)((float)(par3 + 18) * 0.0078125F), (double)((float)(par4 + 18) * 0.0078125F)); -+ var9.addVertexWithUV((double)(par1 + 18), (double)(par2 + 0), (double)this.flatPresetsGui.zLevel, (double)((float)(par3 + 18) * 0.0078125F), (double)((float)(par4 + 0) * 0.0078125F)); -+ var9.addVertexWithUV((double)(par1 + 0), (double)(par2 + 0), (double)this.flatPresetsGui.zLevel, (double)((float)(par3 + 0) * 0.0078125F), (double)((float)(par4 + 0) * 0.0078125F)); - var9.draw(); - } - -+ /** -+ * Gets the size of the current slot list. -+ */ - protected int getSize() { - return GuiFlatPresets.getPresets().size(); - } - -- protected void elementClicked(int var1, boolean var2) { -- this.field_82459_a = var1; -+ /** -+ * the element in the slot that was clicked, boolean for wether it was double clicked or not -+ */ -+ protected void elementClicked(int par1, boolean par2) { -+ this.field_82459_a = par1; - this.flatPresetsGui.func_82296_g(); -- GuiFlatPresets.func_82298_b(this.flatPresetsGui).setText(((GuiFlatPresetsItem)GuiFlatPresets.getPresets().get(GuiFlatPresets.func_82292_a(this.flatPresetsGui).field_82459_a)).c); -- } -- -- protected boolean isSelected(int var1) { -- return var1 == this.field_82459_a; -- } -- -- protected void drawBackground() { -- } -- -- protected void drawSlot(int var1, int var2, int var3, int var4, Tessellator var5) { -- GuiFlatPresetsItem var6 = (GuiFlatPresetsItem)GuiFlatPresets.getPresets().get(var1); -- this.func_82457_a(var2, var3, var6.iconId); -- this.flatPresetsGui.fontRenderer.drawString(var6.b, var2 + 18 + 5, var3 + 6, 16777215); -+ GuiFlatPresets.func_82298_b(this.flatPresetsGui).setText(((GuiFlatPresetsItem)GuiFlatPresets.getPresets().get(GuiFlatPresets.func_82292_a(this.flatPresetsGui).field_82459_a)).presetData); -+ } -+ -+ /** -+ * returns true if the element passed in is currently selected -+ */ -+ protected boolean isSelected(int par1) { -+ return par1 == this.field_82459_a; -+ } -+ -+ protected void drawBackground() {} -+ -+ protected void drawSlot(int par1, int par2, int par3, int par4, Tessellator par5Tessellator) { -+ GuiFlatPresetsItem var6 = (GuiFlatPresetsItem)GuiFlatPresets.getPresets().get(par1); -+ this.func_82457_a(par2, par3, var6.iconId); -+ this.flatPresetsGui.fontRenderer.drawString(var6.presetName, par2 + 18 + 5, par3 + 6, 16777215); - } - } ---- net/minecraft/src/EntityHorseBredSelector.java -+++ net/minecraft/src/EntityHorseBredSelector.java -@@ -1,7 +1,11 @@ - package net.minecraft.src; - - final class EntityHorseBredSelector implements IEntitySelector { -- public boolean isEntityApplicable(Entity var1) { -- return var1 instanceof EntityHorse && ((EntityHorse)var1).func_110205_ce(); -+ -+ /** -+ * Return whether the specified entity is applicable to this filter. -+ */ -+ public boolean isEntityApplicable(Entity par1Entity) { -+ return par1Entity instanceof EntityHorse && ((EntityHorse)par1Entity).func_110205_ce(); - } - } ---- net/minecraft/src/EntityGhast.java -+++ net/minecraft/src/EntityGhast.java -@@ -1,18 +1,26 @@ - package net.minecraft.src; - -+//Spout Start -+import org.spoutcraft.api.entity.EntitySkinType; -+//Spout End -+ - public class EntityGhast extends EntityFlying implements IMob { - public int courseChangeCooldown; - public double waypointX; - public double waypointY; - public double waypointZ; - private Entity targetedEntity; -+ -+ /** Cooldown time between target loss and new target aquirement. */ - private int aggroCooldown; - public int prevAttackCounter; - public int attackCounter; -+ -+ /** The explosion radius of spawned fireballs. */ - private int explosionStrength = 1; - -- public EntityGhast(World var1) { -- super(var1); -+ public EntityGhast(World par1World) { -+ super(par1World); - this.setSize(4.0F, 4.0F); - this.isImmuneToFire = true; - this.experienceValue = 5; -@@ -21,16 +29,19 @@ - public boolean func_110182_bF() { - return this.dataWatcher.getWatchableObjectByte(16) != 0; - } -- -- public boolean attackEntityFrom(DamageSource var1, float var2) { -- if(this.isEntityInvulnerable()) { -+ -+ /** -+ * Called when the entity is attacked. -+ */ -+ public boolean attackEntityFrom(DamageSource par1DamageSource, float par2) { -+ if (this.isEntityInvulnerable()) { - return false; -- } else if("fireball".equals(var1.getDamageType()) && var1.getEntity() instanceof EntityPlayer) { -- super.attackEntityFrom(var1, 1000.0F); -- ((EntityPlayer)var1.getEntity()).triggerAchievement(AchievementList.ghast); -+ } else if ("fireball".equals(par1DamageSource.getDamageType()) && par1DamageSource.getEntity() instanceof EntityPlayer) { -+ super.attackEntityFrom(par1DamageSource, 1000.0F); -+ ((EntityPlayer)par1DamageSource.getEntity()).triggerAchievement(AchievementList.ghast); - return true; - } else { -- return super.attackEntityFrom(var1, var2); -+ return super.attackEntityFrom(par1DamageSource, par2); - } - } - -@@ -44,8 +55,21 @@ - this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setAttribute(10.0D); - } - -+ /** -+ * Called to update the entity's position/logic. -+ */ -+ -+ public void onUpdate() { -+ super.onUpdate(); -+ byte var1 = this.dataWatcher.getWatchableObjectByte(16); -+ this.texture = var1 == 1 ? "/mob/ghast_fire.png" : "/mob/ghast.png"; -+ // Spout Start -+ setTextureToRender((byte) (var1 == 1 ? EntitySkinType.GHAST_MOUTH.getId() : 0)); -+ // Spout End -+ } -+ - protected void updateEntityActionState() { -- if(!this.worldObj.isRemote && this.worldObj.difficultySetting == 0) { -+ if (!this.worldObj.isRemote && this.worldObj.difficultySetting == 0) { - this.setDead(); - } - -@@ -55,16 +79,18 @@ - double var3 = this.waypointY - this.posY; - double var5 = this.waypointZ - this.posZ; - double var7 = var1 * var1 + var3 * var3 + var5 * var5; -- if(var7 < 1.0D || var7 > 3600.0D) { -- this.waypointX = this.posX + (double)((this.ab.nextFloat() * 2.0F - 1.0F) * 16.0F); -- this.waypointY = this.posY + (double)((this.ab.nextFloat() * 2.0F - 1.0F) * 16.0F); -- this.waypointZ = this.posZ + (double)((this.ab.nextFloat() * 2.0F - 1.0F) * 16.0F); -+ -+ if (var7 < 1.0D || var7 > 3600.0D) { -+ this.waypointX = this.posX + (double)((this.rand.nextFloat() * 2.0F - 1.0F) * 16.0F); -+ this.waypointY = this.posY + (double)((this.rand.nextFloat() * 2.0F - 1.0F) * 16.0F); -+ this.waypointZ = this.posZ + (double)((this.rand.nextFloat() * 2.0F - 1.0F) * 16.0F); - } - -- if(this.courseChangeCooldown-- <= 0) { -- this.courseChangeCooldown += this.ab.nextInt(5) + 2; -+ if (this.courseChangeCooldown-- <= 0) { -+ this.courseChangeCooldown += this.rand.nextInt(5) + 2; - var7 = (double)MathHelper.sqrt_double(var7); -- if(this.isCourseTraversable(this.waypointX, this.waypointY, this.waypointZ, var7)) { -+ -+ if (this.isCourseTraversable(this.waypointX, this.waypointY, this.waypointZ, var7)) { - this.motionX += var1 / var7 * 0.1D; - this.motionY += var3 / var7 * 0.1D; - this.motionZ += var5 / var7 * 0.1D; -@@ -75,30 +101,34 @@ - } - } - -- if(this.targetedEntity != null && this.targetedEntity.isDead) { -+ if (this.targetedEntity != null && this.targetedEntity.isDead) { - this.targetedEntity = null; - } - -- if(this.targetedEntity == null || this.aggroCooldown-- <= 0) { -+ if (this.targetedEntity == null || this.aggroCooldown-- <= 0) { - this.targetedEntity = this.worldObj.getClosestVulnerablePlayerToEntity(this, 100.0D); -- if(this.targetedEntity != null) { -+ -+ if (this.targetedEntity != null) { - this.aggroCooldown = 20; - } - } - - double var9 = 64.0D; -- if(this.targetedEntity != null && this.targetedEntity.getDistanceSqToEntity(this) < var9 * var9) { -+ -+ if (this.targetedEntity != null && this.targetedEntity.getDistanceSqToEntity(this) < var9 * var9) { - double var11 = this.targetedEntity.posX - this.posX; - double var13 = this.targetedEntity.boundingBox.minY + (double)(this.targetedEntity.height / 2.0F) - (this.posY + (double)(this.height / 2.0F)); - double var15 = this.targetedEntity.posZ - this.posZ; - this.renderYawOffset = this.rotationYaw = -((float)Math.atan2(var11, var15)) * 180.0F / (float)Math.PI; -- if(this.canEntityBeSeen(this.targetedEntity)) { -- if(this.attackCounter == 10) { -+ -+ if (this.canEntityBeSeen(this.targetedEntity)) { -+ if (this.attackCounter == 10) { - this.worldObj.playAuxSFXAtEntity((EntityPlayer)null, 1007, (int)this.posX, (int)this.posY, (int)this.posZ, 0); - } - - ++this.attackCounter; -- if(this.attackCounter == 20) { -+ -+ if (this.attackCounter == 20) { - this.worldObj.playAuxSFXAtEntity((EntityPlayer)null, 1008, (int)this.posX, (int)this.posY, (int)this.posZ, 0); - EntityLargeFireball var17 = new EntityLargeFireball(this.worldObj, this, var11, var13, var15); - var17.field_92057_e = this.explosionStrength; -@@ -110,35 +140,40 @@ - this.worldObj.spawnEntityInWorld(var17); - this.attackCounter = -40; - } -- } else if(this.attackCounter > 0) { -+ } else if (this.attackCounter > 0) { - --this.attackCounter; - } - } else { - this.renderYawOffset = this.rotationYaw = -((float)Math.atan2(this.motionX, this.motionZ)) * 180.0F / (float)Math.PI; -- if(this.attackCounter > 0) { -+ -+ if (this.attackCounter > 0) { - --this.attackCounter; - } - } - -- if(!this.worldObj.isRemote) { -+ if (!this.worldObj.isRemote) { - byte var21 = this.dataWatcher.getWatchableObjectByte(16); - byte var12 = (byte)(this.attackCounter > 10 ? 1 : 0); -- if(var21 != var12) { -+ -+ if (var21 != var12) { - this.dataWatcher.updateObject(16, Byte.valueOf(var12)); - } - } -- - } - -- private boolean isCourseTraversable(double var1, double var3, double var5, double var7) { -- double var9 = (this.waypointX - this.posX) / var7; -- double var11 = (this.waypointY - this.posY) / var7; -- double var13 = (this.waypointZ - this.posZ) / var7; -+ /** -+ * True if the ghast has an unobstructed line of travel to the waypoint. -+ */ -+ private boolean isCourseTraversable(double par1, double par3, double par5, double par7) { -+ double var9 = (this.waypointX - this.posX) / par7; -+ double var11 = (this.waypointY - this.posY) / par7; -+ double var13 = (this.waypointZ - this.posZ) / par7; - AxisAlignedBB var15 = this.boundingBox.copy(); - -- for(int var16 = 1; (double)var16 < var7; ++var16) { -+ for (int var16 = 1; (double)var16 < par7; ++var16) { - var15.offset(var9, var11, var13); -- if(!this.worldObj.getCollidingBoundingBoxes(this, var15).isEmpty()) { -+ -+ if (!this.worldObj.getCollidingBoundingBoxes(this, var15).isEmpty()) { - return false; - } - } -@@ -146,60 +181,90 @@ - return true; - } - -+ /** -+ * Returns the sound this mob makes while it's alive. -+ */ - protected String getLivingSound() { - return "mob.ghast.moan"; - } - -+ /** -+ * Returns the sound this mob makes when it is hurt. -+ */ - protected String getHurtSound() { - return "mob.ghast.scream"; - } - -+ /** -+ * Returns the sound this mob makes on death. -+ */ - protected String getDeathSound() { - return "mob.ghast.death"; - } - -+ /** -+ * Returns the item ID for the item the mob drops on death. -+ */ - protected int getDropItemId() { - return Item.gunpowder.itemID; - } - -- protected void dropFewItems(boolean var1, int var2) { -- int var3 = this.ab.nextInt(2) + this.ab.nextInt(1 + var2); -- -+ /** -+ * Drop 0-2 items of this living's type. @param par1 - Whether this entity has recently been hit by a player. @param -+ * par2 - Level of Looting used to kill this mob. -+ */ -+ protected void dropFewItems(boolean par1, int par2) { -+ int var3 = this.rand.nextInt(2) + this.rand.nextInt(1 + par2); - int var4; -- for(var4 = 0; var4 < var3; ++var4) { -+ -+ for (var4 = 0; var4 < var3; ++var4) { - this.dropItem(Item.ghastTear.itemID, 1); - } - -- var3 = this.ab.nextInt(3) + this.ab.nextInt(1 + var2); -+ var3 = this.rand.nextInt(3) + this.rand.nextInt(1 + par2); - -- for(var4 = 0; var4 < var3; ++var4) { -+ for (var4 = 0; var4 < var3; ++var4) { - this.dropItem(Item.gunpowder.itemID, 1); - } -- - } - -+ /** -+ * Returns the volume for the sounds this mob makes. -+ */ - protected float getSoundVolume() { - return 10.0F; - } - -+ /** -+ * Checks if the entity's current position is a valid location to spawn this entity. -+ */ - public boolean getCanSpawnHere() { -- return this.ab.nextInt(20) == 0 && super.getCanSpawnHere() && this.worldObj.difficultySetting > 0; -+ return this.rand.nextInt(20) == 0 && super.getCanSpawnHere() && this.worldObj.difficultySetting > 0; - } - -+ /** -+ * Will return how many at most can spawn in a chunk at once. -+ */ - public int getMaxSpawnedInChunk() { - return 1; - } - -- public void writeEntityToNBT(NBTTagCompound var1) { -- super.writeEntityToNBT(var1); -- var1.setInteger("ExplosionPower", this.explosionStrength); -+ /** -+ * (abstract) Protected helper method to write subclass entity data to NBT. -+ */ -+ public void writeEntityToNBT(NBTTagCompound par1NBTTagCompound) { -+ super.writeEntityToNBT(par1NBTTagCompound); -+ par1NBTTagCompound.setInteger("ExplosionPower", this.explosionStrength); - } - -- public void readEntityFromNBT(NBTTagCompound var1) { -- super.readEntityFromNBT(var1); -- if(var1.hasKey("ExplosionPower")) { -- this.explosionStrength = var1.getInteger("ExplosionPower"); -+ /** -+ * (abstract) Protected helper method to read subclass entity data from NBT. -+ */ -+ public void readEntityFromNBT(NBTTagCompound par1NBTTagCompound) { -+ super.readEntityFromNBT(par1NBTTagCompound); -+ -+ if (par1NBTTagCompound.hasKey("ExplosionPower")) { -+ this.explosionStrength = par1NBTTagCompound.getInteger("ExplosionPower"); - } -- - } - } ---- net/minecraft/src/WorldServerMulti.java -+++ net/minecraft/src/WorldServerMulti.java -@@ -3,13 +3,15 @@ - import net.minecraft.server.MinecraftServer; - - public class WorldServerMulti extends WorldServer { -- public WorldServerMulti(MinecraftServer var1, ISaveHandler var2, String var3, int var4, WorldSettings var5, WorldServer var6, Profiler var7, ILogAgent var8) { -- super(var1, var2, var3, var4, var5, var7, var8); -- this.mapStorage = var6.mapStorage; -- this.worldScoreboard = var6.getScoreboard(); -- this.worldInfo = new DerivedWorldInfo(var6.getWorldInfo()); -+ public WorldServerMulti(MinecraftServer par1MinecraftServer, ISaveHandler par2ISaveHandler, String par3Str, int par4, WorldSettings par5WorldSettings, WorldServer par6WorldServer, Profiler par7Profiler, ILogAgent par8ILogAgent) { -+ super(par1MinecraftServer, par2ISaveHandler, par3Str, par4, par5WorldSettings, par7Profiler, par8ILogAgent); -+ this.mapStorage = par6WorldServer.mapStorage; -+ this.worldScoreboard = par6WorldServer.getScoreboard(); -+ this.worldInfo = new DerivedWorldInfo(par6WorldServer.getWorldInfo()); - } - -- protected void saveLevel() throws MinecraftException { -- } -+ /** -+ * Saves the chunks to disk. -+ */ -+ protected void saveLevel() throws MinecraftException {} - } ---- net/minecraft/src/GuiStats.java -+++ net/minecraft/src/GuiStats.java -@@ -1,26 +1,38 @@ - package net.minecraft.src; - --import java.util.List; - import org.lwjgl.opengl.GL11; - import org.lwjgl.opengl.GL12; - - public class GuiStats extends GuiScreen { - private static RenderItem renderItem = new RenderItem(); - protected GuiScreen parentGui; -- protected String b = "Select world"; -+ -+ /** The title of the stats screen. */ -+ protected String statsTitle = "Select world"; -+ -+ /** The slot for general stats. */ - private GuiSlotStatsGeneral slotGeneral; -+ -+ /** The slot for item stats. */ - private GuiSlotStatsItem slotItem; -+ -+ /** The slot for block stats. */ - private GuiSlotStatsBlock slotBlock; - private StatFileWriter statFileWriter; -+ -+ /** The currently-selected slot. */ - private GuiSlot selectedSlot; - -- public GuiStats(GuiScreen var1, StatFileWriter var2) { -- this.parentGui = var1; -- this.statFileWriter = var2; -+ public GuiStats(GuiScreen par1GuiScreen, StatFileWriter par2StatFileWriter) { -+ this.parentGui = par1GuiScreen; -+ this.statFileWriter = par2StatFileWriter; - } - -+ /** -+ * Adds the buttons (and other controls) to the screen in question. -+ */ - public void initGui() { -- this.b = I18n.getString("gui.stats"); -+ this.statsTitle = I18n.getString("gui.stats"); - this.slotGeneral = new GuiSlotStatsGeneral(this); - this.slotGeneral.registerScrollButtons(1, 1); - this.slotItem = new GuiSlotStatsItem(this); -@@ -31,62 +43,77 @@ - this.addHeaderButtons(); - } - -+ /** -+ * Creates the buttons that appear at the top of the Stats GUI. -+ */ - public void addHeaderButtons() { -- this.i.add(new GuiButton(0, this.width / 2 + 4, this.height - 28, 150, 20, I18n.getString("gui.done"))); -- this.i.add(new GuiButton(1, this.width / 2 - 154, this.height - 52, 100, 20, I18n.getString("stat.generalButton"))); -- List var10000 = this.i; -- GuiButton var1 = new GuiButton(2, this.width / 2 - 46, this.height - 52, 100, 20, I18n.getString("stat.blocksButton")); -- var10000.add(var1); -- var10000 = this.i; -- GuiButton var2 = new GuiButton(3, this.width / 2 + 62, this.height - 52, 100, 20, I18n.getString("stat.itemsButton")); -- var10000.add(var2); -- if(this.slotBlock.getSize() == 0) { -+ this.buttonList.add(new GuiButton(0, this.width / 2 + 4, this.height - 28, 150, 20, I18n.getString("gui.done"))); -+ this.buttonList.add(new GuiButton(1, this.width / 2 - 154, this.height - 52, 100, 20, I18n.getString("stat.generalButton"))); -+ GuiButton var1; -+ this.buttonList.add(var1 = new GuiButton(2, this.width / 2 - 46, this.height - 52, 100, 20, I18n.getString("stat.blocksButton"))); -+ GuiButton var2; -+ this.buttonList.add(var2 = new GuiButton(3, this.width / 2 + 62, this.height - 52, 100, 20, I18n.getString("stat.itemsButton"))); -+ -+ if (this.slotBlock.getSize() == 0) { - var1.enabled = false; - } - -- if(this.slotItem.getSize() == 0) { -+ if (this.slotItem.getSize() == 0) { - var2.enabled = false; - } -- - } - -- protected void actionPerformed(GuiButton var1) { -- if(var1.enabled) { -- if(var1.id == 0) { -+ /** -+ * Fired when a control is clicked. This is the equivalent of ActionListener.actionPerformed(ActionEvent e). -+ */ -+ protected void actionPerformed(GuiButton par1GuiButton) { -+ if (par1GuiButton.enabled) { -+ if (par1GuiButton.id == 0) { - this.mc.displayGuiScreen(this.parentGui); -- } else if(var1.id == 1) { -+ } else if (par1GuiButton.id == 1) { - this.selectedSlot = this.slotGeneral; -- } else if(var1.id == 3) { -+ } else if (par1GuiButton.id == 3) { - this.selectedSlot = this.slotItem; -- } else if(var1.id == 2) { -+ } else if (par1GuiButton.id == 2) { - this.selectedSlot = this.slotBlock; - } else { -- this.selectedSlot.actionPerformed(var1); -+ this.selectedSlot.actionPerformed(par1GuiButton); - } -- - } - } - -- public void drawScreen(int var1, int var2, float var3) { -- this.selectedSlot.drawScreen(var1, var2, var3); -- this.drawCenteredString(this.fontRenderer, this.b, this.width / 2, 20, 16777215); -- super.drawScreen(var1, var2, var3); -+ /** -+ * Draws the screen and all the components in it. -+ */ -+ public void drawScreen(int par1, int par2, float par3) { -+ this.selectedSlot.drawScreen(par1, par2, par3); -+ this.drawCenteredString(this.fontRenderer, this.statsTitle, this.width / 2, 20, 16777215); -+ super.drawScreen(par1, par2, par3); - } - -- private void drawItemSprite(int var1, int var2, int var3) { -- this.drawButtonBackground(var1 + 1, var2 + 1); -+ /** -+ * Draws the item sprite on top of the background sprite. -+ */ -+ private void drawItemSprite(int par1, int par2, int par3) { -+ this.drawButtonBackground(par1 + 1, par2 + 1); - GL11.glEnable(GL12.GL_RESCALE_NORMAL); - RenderHelper.enableGUIStandardItemLighting(); -- renderItem.renderItemIntoGUI(this.fontRenderer, this.mc.getTextureManager(), new ItemStack(var3, 1, 0), var1 + 2, var2 + 2); -+ renderItem.renderItemIntoGUI(this.fontRenderer, this.mc.getTextureManager(), new ItemStack(par3, 1, 0), par1 + 2, par2 + 2); - RenderHelper.disableStandardItemLighting(); - GL11.glDisable(GL12.GL_RESCALE_NORMAL); - } - -- private void drawButtonBackground(int var1, int var2) { -- this.drawSprite(var1, var2, 0, 0); -+ /** -+ * Draws a gray box that serves as a button background. -+ */ -+ private void drawButtonBackground(int par1, int par2) { -+ this.drawSprite(par1, par2, 0, 0); - } - -- private void drawSprite(int var1, int var2, int var3, int var4) { -+ /** -+ * "Draws a sprite from assets/textures/gui/container/stats_icons.png" -+ */ -+ private void drawSprite(int par1, int par2, int par3, int par4) { - GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - this.mc.getTextureManager().bindTexture(statIcons); - float var5 = 0.0078125F; -@@ -95,86 +122,134 @@ - boolean var8 = true; - Tessellator var9 = Tessellator.instance; - var9.startDrawingQuads(); -- var9.addVertexWithUV((double)(var1 + 0), (double)(var2 + 18), (double)this.zLevel, (double)((float)(var3 + 0) * 0.0078125F), (double)((float)(var4 + 18) * 0.0078125F)); -- var9.addVertexWithUV((double)(var1 + 18), (double)(var2 + 18), (double)this.zLevel, (double)((float)(var3 + 18) * 0.0078125F), (double)((float)(var4 + 18) * 0.0078125F)); -- var9.addVertexWithUV((double)(var1 + 18), (double)(var2 + 0), (double)this.zLevel, (double)((float)(var3 + 18) * 0.0078125F), (double)((float)(var4 + 0) * 0.0078125F)); -- var9.addVertexWithUV((double)(var1 + 0), (double)(var2 + 0), (double)this.zLevel, (double)((float)(var3 + 0) * 0.0078125F), (double)((float)(var4 + 0) * 0.0078125F)); -+ var9.addVertexWithUV((double)(par1 + 0), (double)(par2 + 18), (double)this.zLevel, (double)((float)(par3 + 0) * 0.0078125F), (double)((float)(par4 + 18) * 0.0078125F)); -+ var9.addVertexWithUV((double)(par1 + 18), (double)(par2 + 18), (double)this.zLevel, (double)((float)(par3 + 18) * 0.0078125F), (double)((float)(par4 + 18) * 0.0078125F)); -+ var9.addVertexWithUV((double)(par1 + 18), (double)(par2 + 0), (double)this.zLevel, (double)((float)(par3 + 18) * 0.0078125F), (double)((float)(par4 + 0) * 0.0078125F)); -+ var9.addVertexWithUV((double)(par1 + 0), (double)(par2 + 0), (double)this.zLevel, (double)((float)(par3 + 0) * 0.0078125F), (double)((float)(par4 + 0) * 0.0078125F)); - var9.draw(); - } - -- static Minecraft getMinecraft(GuiStats var0) { -- return var0.mc; -- } -- -- static FontRenderer getFontRenderer1(GuiStats var0) { -- return var0.fontRenderer; -- } -- -- static StatFileWriter getStatsFileWriter(GuiStats var0) { -- return var0.statFileWriter; -- } -- -- static FontRenderer getFontRenderer2(GuiStats var0) { -- return var0.fontRenderer; -- } -- -- static FontRenderer getFontRenderer3(GuiStats var0) { -- return var0.fontRenderer; -- } -- -- static Minecraft getMinecraft1(GuiStats var0) { -- return var0.mc; -- } -- -- static void drawSprite(GuiStats var0, int var1, int var2, int var3, int var4) { -- var0.drawSprite(var1, var2, var3, var4); -- } -- -- static Minecraft getMinecraft2(GuiStats var0) { -- return var0.mc; -- } -- -- static FontRenderer getFontRenderer4(GuiStats var0) { -- return var0.fontRenderer; -- } -- -- static FontRenderer getFontRenderer5(GuiStats var0) { -- return var0.fontRenderer; -- } -- -- static FontRenderer getFontRenderer6(GuiStats var0) { -- return var0.fontRenderer; -- } -- -- static FontRenderer getFontRenderer7(GuiStats var0) { -- return var0.fontRenderer; -- } -- -- static FontRenderer getFontRenderer8(GuiStats var0) { -- return var0.fontRenderer; -- } -- -- static void drawGradientRect(GuiStats var0, int var1, int var2, int var3, int var4, int var5, int var6) { -- var0.drawGradientRect(var1, var2, var3, var4, var5, var6); -- } -- -- static FontRenderer getFontRenderer9(GuiStats var0) { -- return var0.fontRenderer; -- } -- -- static FontRenderer getFontRenderer10(GuiStats var0) { -- return var0.fontRenderer; -- } -- -- static void drawGradientRect1(GuiStats var0, int var1, int var2, int var3, int var4, int var5, int var6) { -- var0.drawGradientRect(var1, var2, var3, var4, var5, var6); -- } -- -- static FontRenderer getFontRenderer11(GuiStats var0) { -- return var0.fontRenderer; -- } -- -- static void drawItemSprite(GuiStats var0, int var1, int var2, int var3) { -- var0.drawItemSprite(var1, var2, var3); -+ static Minecraft getMinecraft(GuiStats par0GuiStats) { -+ return par0GuiStats.mc; -+ } -+ -+ /** -+ * there are 11 identical methods like this -+ */ -+ static FontRenderer getFontRenderer1(GuiStats par0GuiStats) { -+ return par0GuiStats.fontRenderer; -+ } -+ -+ static StatFileWriter getStatsFileWriter(GuiStats par0GuiStats) { -+ return par0GuiStats.statFileWriter; -+ } -+ -+ /** -+ * there are 11 identical methods like this -+ */ -+ static FontRenderer getFontRenderer2(GuiStats par0GuiStats) { -+ return par0GuiStats.fontRenderer; -+ } -+ -+ /** -+ * there are 11 identical methods like this -+ */ -+ static FontRenderer getFontRenderer3(GuiStats par0GuiStats) { -+ return par0GuiStats.fontRenderer; -+ } -+ -+ /** -+ * exactly the same as 27141 -+ */ -+ static Minecraft getMinecraft1(GuiStats par0GuiStats) { -+ return par0GuiStats.mc; -+ } -+ -+ /** -+ * Draws a sprite from /gui/slot.png. -+ */ -+ static void drawSprite(GuiStats par0GuiStats, int par1, int par2, int par3, int par4) { -+ par0GuiStats.drawSprite(par1, par2, par3, par4); -+ } -+ -+ /** -+ * exactly the same as 27141 and 27143 -+ */ -+ static Minecraft getMinecraft2(GuiStats par0GuiStats) { -+ return par0GuiStats.mc; -+ } -+ -+ /** -+ * there are 11 identical methods like this -+ */ -+ static FontRenderer getFontRenderer4(GuiStats par0GuiStats) { -+ return par0GuiStats.fontRenderer; -+ } -+ -+ /** -+ * there are 11 identical methods like this -+ */ -+ static FontRenderer getFontRenderer5(GuiStats par0GuiStats) { -+ return par0GuiStats.fontRenderer; -+ } -+ -+ /** -+ * there are 11 identical methods like this -+ */ -+ static FontRenderer getFontRenderer6(GuiStats par0GuiStats) { -+ return par0GuiStats.fontRenderer; -+ } -+ -+ /** -+ * there are 11 identical methods like this -+ */ -+ static FontRenderer getFontRenderer7(GuiStats par0GuiStats) { -+ return par0GuiStats.fontRenderer; -+ } -+ -+ /** -+ * there are 11 identical methods like this -+ */ -+ static FontRenderer getFontRenderer8(GuiStats par0GuiStats) { -+ return par0GuiStats.fontRenderer; -+ } -+ -+ static void drawGradientRect(GuiStats par0GuiStats, int par1, int par2, int par3, int par4, int par5, int par6) { -+ par0GuiStats.drawGradientRect(par1, par2, par3, par4, par5, par6); -+ } -+ -+ /** -+ * there are 11 identical methods like this -+ */ -+ static FontRenderer getFontRenderer9(GuiStats par0GuiStats) { -+ return par0GuiStats.fontRenderer; -+ } -+ -+ /** -+ * there are 11 identical methods like this -+ */ -+ static FontRenderer getFontRenderer10(GuiStats par0GuiStats) { -+ return par0GuiStats.fontRenderer; -+ } -+ -+ /** -+ * exactly the same as 27129 -+ */ -+ static void drawGradientRect1(GuiStats par0GuiStats, int par1, int par2, int par3, int par4, int par5, int par6) { -+ par0GuiStats.drawGradientRect(par1, par2, par3, par4, par5, par6); -+ } -+ -+ /** -+ * there are 11 identical methods like this -+ */ -+ static FontRenderer getFontRenderer11(GuiStats par0GuiStats) { -+ return par0GuiStats.fontRenderer; -+ } -+ -+ /** -+ * Draws the item sprite on top of the background sprite. -+ */ -+ static void drawItemSprite(GuiStats par0GuiStats, int par1, int par2, int par3) { -+ par0GuiStats.drawItemSprite(par1, par2, par3); - } - } ---- /dev/null -+++ org/spoutcraft/api/util/map/TIntPairObjectHashMap.java -@@ -1,0 +1,101 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.api.util.map; -+ -+import java.util.Collection; -+ -+import gnu.trove.iterator.TLongObjectIterator; -+import gnu.trove.map.hash.TLongObjectHashMap; -+import gnu.trove.set.TLongSet; -+ -+/** -+ * A simplistic map that supports a pair of integers for keys, using a trove long object hashmap in the backend. -+ */ -+public class TIntPairObjectHashMap{ -+ private TLongObjectHashMap map; -+ -+ public TIntPairObjectHashMap() { -+ map = new TLongObjectHashMap(100); -+ } -+ -+ public TIntPairObjectHashMap(int capacity) { -+ map = new TLongObjectHashMap(capacity); -+ } -+ -+ public TIntPairObjectHashMap(TLongObjectHashMap raw) { -+ map = raw; -+ } -+ -+ public K put(int key1, int key2, K value) { -+ long key = (((long)key1)<<32) | (((long)key2) & 0xFFFFFFFFL); -+ return map.put(key, value); -+ } -+ -+ public K get(int key1, int key2) { -+ long key = (((long)key1)<<32) | (((long)key2) & 0xFFFFFFFFL); -+ return map.get(key); -+ } -+ -+ public boolean containsKey(int key1, int key2) { -+ long key = (((long)key1)<<32) | (((long)key2) & 0xFFFFFFFFL); -+ return map.containsKey(key); -+ } -+ -+ public void clear() { -+ map.clear(); -+ } -+ -+ public boolean containsValue(K val) { -+ return map.containsValue(val); -+ } -+ -+ public boolean isEmpty() { -+ return map.isEmpty(); -+ } -+ -+ public TLongObjectIterator iterator() { -+ return map.iterator(); -+ } -+ -+ public TLongSet keySet() { -+ return map.keySet(); -+ } -+ -+ public long[] keys() { -+ return map.keys(); -+ } -+ -+ public K remove(int key1, int key2) { -+ long key = (((long)key1)<<32) | (((long)key2) & 0xFFFFFFFFL); -+ return map.remove(key); -+ } -+ -+ public int size() { -+ return map.size(); -+ } -+ -+ public Collection valueCollection() { -+ return map.valueCollection(); -+ } -+ -+ public K[] values() { -+ return (K[]) map.values(); -+ } -+} ---- net/minecraft/src/StatBase.java -+++ net/minecraft/src/StatBase.java -@@ -4,65 +4,81 @@ - import java.text.NumberFormat; - - public class StatBase { -+ -+ /** The Stat ID */ - public final int statId; -- private final String a; -+ -+ /** The Stat name */ -+ private final String statName; - public boolean isIndependent; -- public String g; -+ -+ /** Holds the GUID of the stat. */ -+ public String statGuid; - private final IStatType type; -- private static NumberFormat c = NumberFormat.getIntegerInstance(java.util.Locale.US); -+ private static NumberFormat numberFormat = NumberFormat.getIntegerInstance(java.util.Locale.US); - public static IStatType simpleStatType = new StatTypeSimple(); -- private static DecimalFormat d = new DecimalFormat("########0.00"); -+ private static DecimalFormat decimalFormat = new DecimalFormat("########0.00"); - public static IStatType timeStatType = new StatTypeTime(); - public static IStatType distanceStatType = new StatTypeDistance(); - public static IStatType field_111202_k = new StatTypeFloat(); - -- public StatBase(int var1, String var2, IStatType var3) { -- this.statId = var1; -- this.a = var2; -- this.type = var3; -- } -- -- public StatBase(int var1, String var2) { -- this(var1, var2, simpleStatType); -- } -- -+ public StatBase(int par1, String par2Str, IStatType par3IStatType) { -+ this.statId = par1; -+ this.statName = par2Str; -+ this.type = par3IStatType; -+ } -+ -+ public StatBase(int par1, String par2Str) { -+ this(par1, par2Str, simpleStatType); -+ } -+ -+ /** -+ * Initializes the current stat as independent (i.e., lacking prerequisites for being updated) and returns the current -+ * instance. -+ */ - public StatBase initIndependentStat() { - this.isIndependent = true; - return this; - } - -+ /** -+ * Register the stat into StatList. -+ */ - public StatBase registerStat() { -- if(StatList.a.containsKey(Integer.valueOf(this.statId))) { -- throw new RuntimeException("Duplicate stat id: \"" + ((StatBase)StatList.a.get(Integer.valueOf(this.statId))).a + "\" and \"" + this.a + "\" at id " + this.statId); -+ if (StatList.oneShotStats.containsKey(Integer.valueOf(this.statId))) { -+ throw new RuntimeException("Duplicate stat id: \"" + ((StatBase)StatList.oneShotStats.get(Integer.valueOf(this.statId))).statName + "\" and \"" + this.statName + "\" at id " + this.statId); - } else { -- StatList.b.add(this); -- StatList.a.put(Integer.valueOf(this.statId), this); -- this.g = AchievementMap.getGuid(this.statId); -+ StatList.allStats.add(this); -+ StatList.oneShotStats.put(Integer.valueOf(this.statId), this); -+ this.statGuid = AchievementMap.getGuid(this.statId); - return this; - } - } - -+ /** -+ * Returns whether or not the StatBase-derived class is a statistic (running counter) or an achievement (one-shot). -+ */ - public boolean isAchievement() { - return false; - } - -- public String func_75968_a(int var1) { -- return this.type.format(var1); -+ public String func_75968_a(int par1) { -+ return this.type.format(par1); - } - - public String getName() { -- return this.a; -+ return this.statName; - } - - public String toString() { -- return StatCollector.translateToLocal(this.a); -+ return StatCollector.translateToLocal(this.statName); - } - - static NumberFormat getNumberFormat() { -- return c; -+ return numberFormat; - } - - static DecimalFormat getDecimalFormat() { -- return d; -+ return decimalFormat; - } - } ---- net/minecraft/src/ModelSheep1.java -+++ net/minecraft/src/ModelSheep1.java -@@ -26,14 +26,23 @@ - this.leg4.setRotationPoint(3.0F, 12.0F, -5.0F); - } - -- public void setLivingAnimations(EntityLivingBase var1, float var2, float var3, float var4) { -- super.setLivingAnimations(var1, var2, var3, var4); -- this.head.rotationPointY = 6.0F + ((EntitySheep)var1).func_70894_j(var4) * 9.0F; -- this.field_78152_i = ((EntitySheep)var1).func_70890_k(var4); -+ /** -+ * Used for easily adding entity-dependent animations. The second and third float params here are the same second and -+ * third as in the setRotationAngles method. -+ */ -+ public void setLivingAnimations(EntityLivingBase par1EntityLivingBase, float par2, float par3, float par4) { -+ super.setLivingAnimations(par1EntityLivingBase, par2, par3, par4); -+ this.head.rotationPointY = 6.0F + ((EntitySheep)par1EntityLivingBase).func_70894_j(par4) * 9.0F; -+ this.field_78152_i = ((EntitySheep)par1EntityLivingBase).func_70890_k(par4); - } - -- public void setRotationAngles(float var1, float var2, float var3, float var4, float var5, float var6, Entity var7) { -- super.setRotationAngles(var1, var2, var3, var4, var5, var6, var7); -+ /** -+ * Sets the model's various rotation angles. For bipeds, par1 and par2 are used for animating the movement of arms and -+ * legs, where par1 represents the time(so that arms and legs swing back and forth) and par2 represents how "far" arms -+ * and legs can swing at most. -+ */ -+ public void setRotationAngles(float par1, float par2, float par3, float par4, float par5, float par6, Entity par7Entity) { -+ super.setRotationAngles(par1, par2, par3, par4, par5, par6, par7Entity); - this.head.rotateAngleX = this.field_78152_i; - } - } ---- net/minecraft/src/CallableIsServerModded.java -+++ net/minecraft/src/CallableIsServerModded.java -@@ -4,14 +4,16 @@ - import net.minecraft.server.MinecraftServer; - - public class CallableIsServerModded implements Callable { -- final MinecraftServer a; -- -- public CallableIsServerModded(MinecraftServer var1) { -- this.a = var1; -+ -+ /** Reference to the MinecraftServer object. */ -+ final MinecraftServer mcServer; -+ -+ public CallableIsServerModded(MinecraftServer par1MinecraftServer) { -+ this.mcServer = par1MinecraftServer; - } - - public String func_96558_a() { -- return this.a.theProfiler.profilingEnabled ? this.a.theProfiler.getNameOfLastSection() : "N/A (disabled)"; -+ return this.mcServer.theProfiler.profilingEnabled ? this.mcServer.theProfiler.getNameOfLastSection() : "N/A (disabled)"; - } - - public Object call() { ---- net/minecraft/src/Packet19EntityAction.java -+++ net/minecraft/src/Packet19EntityAction.java -@@ -5,39 +5,57 @@ - import java.io.IOException; - - public class Packet19EntityAction extends Packet { -+ -+ /** Player ID. */ - public int entityId; -+ -+ /** -+ * 1=start sneaking, 2=stop sneaking, 3=wake up, 4=start sprinting, 5=stop sprinting, 6 = horse jump?, 7 = open horse -+ * GUI -+ */ - public int action; - public int auxData; - -- public Packet19EntityAction() { -- } -- -- public Packet19EntityAction(Entity var1, int var2) { -- this(var1, var2, 0); -- } -- -- public Packet19EntityAction(Entity var1, int var2, int var3) { -- this.entityId = var1.entityId; -- this.action = var2; -- this.auxData = var3; -- } -- -- public void readPacketData(DataInput var1) throws IOException { -- this.entityId = var1.readInt(); -- this.action = var1.readByte(); -- this.auxData = var1.readInt(); -- } -- -- public void writePacketData(DataOutput var1) throws IOException { -- var1.writeInt(this.entityId); -- var1.writeByte(this.action); -- var1.writeInt(this.auxData); -- } -- -- public void processPacket(NetHandler var1) { -- var1.handleEntityAction(this); -- } -- -+ public Packet19EntityAction() {} -+ -+ public Packet19EntityAction(Entity par1Entity, int par2) { -+ this(par1Entity, par2, 0); -+ } -+ -+ public Packet19EntityAction(Entity par1Entity, int par2, int par3) { -+ this.entityId = par1Entity.entityId; -+ this.action = par2; -+ this.auxData = par3; -+ } -+ -+ /** -+ * Abstract. Reads the raw packet data from the data stream. -+ */ -+ public void readPacketData(DataInput par1DataInput) throws IOException { -+ this.entityId = par1DataInput.readInt(); -+ this.action = par1DataInput.readByte(); -+ this.auxData = par1DataInput.readInt(); -+ } -+ -+ /** -+ * Abstract. Writes the raw packet data to the data stream. -+ */ -+ public void writePacketData(DataOutput par1DataOutput) throws IOException { -+ par1DataOutput.writeInt(this.entityId); -+ par1DataOutput.writeByte(this.action); -+ par1DataOutput.writeInt(this.auxData); -+ } -+ -+ /** -+ * Passes this Packet on to the NetHandler for processing. -+ */ -+ public void processPacket(NetHandler par1NetHandler) { -+ par1NetHandler.handleEntityAction(this); -+ } -+ -+ /** -+ * Abstract. Return the size of the packet (not counting the header). -+ */ - public int getPacketSize() { - return 9; - } ---- net/minecraft/src/StructureVillagePieces.java -+++ net/minecraft/src/StructureVillagePieces.java -@@ -22,21 +22,21 @@ - MapGenStructureIO.func_143031_a(ComponentVillageWell.class, "ViW"); - } - -- public static List getStructureVillageWeightedPieceList(Random var0, int var1) { -+ public static List getStructureVillageWeightedPieceList(Random par0Random, int par1) { - ArrayList var2 = new ArrayList(); -- var2.add(new StructureVillagePieceWeight(ComponentVillageHouse4_Garden.class, 4, MathHelper.getRandomIntegerInRange(var0, 2 + var1, 4 + var1 * 2))); -- var2.add(new StructureVillagePieceWeight(ComponentVillageChurch.class, 20, MathHelper.getRandomIntegerInRange(var0, 0 + var1, 1 + var1))); -- var2.add(new StructureVillagePieceWeight(ComponentVillageHouse1.class, 20, MathHelper.getRandomIntegerInRange(var0, 0 + var1, 2 + var1))); -- var2.add(new StructureVillagePieceWeight(ComponentVillageWoodHut.class, 3, MathHelper.getRandomIntegerInRange(var0, 2 + var1, 5 + var1 * 3))); -- var2.add(new StructureVillagePieceWeight(ComponentVillageHall.class, 15, MathHelper.getRandomIntegerInRange(var0, 0 + var1, 2 + var1))); -- var2.add(new StructureVillagePieceWeight(ComponentVillageField.class, 3, MathHelper.getRandomIntegerInRange(var0, 1 + var1, 4 + var1))); -- var2.add(new StructureVillagePieceWeight(ComponentVillageField2.class, 3, MathHelper.getRandomIntegerInRange(var0, 2 + var1, 4 + var1 * 2))); -- var2.add(new StructureVillagePieceWeight(ComponentVillageHouse2.class, 15, MathHelper.getRandomIntegerInRange(var0, 0, 1 + var1))); -- var2.add(new StructureVillagePieceWeight(ComponentVillageHouse3.class, 8, MathHelper.getRandomIntegerInRange(var0, 0 + var1, 3 + var1 * 2))); -+ var2.add(new StructureVillagePieceWeight(ComponentVillageHouse4_Garden.class, 4, MathHelper.getRandomIntegerInRange(par0Random, 2 + par1, 4 + par1 * 2))); -+ var2.add(new StructureVillagePieceWeight(ComponentVillageChurch.class, 20, MathHelper.getRandomIntegerInRange(par0Random, 0 + par1, 1 + par1))); -+ var2.add(new StructureVillagePieceWeight(ComponentVillageHouse1.class, 20, MathHelper.getRandomIntegerInRange(par0Random, 0 + par1, 2 + par1))); -+ var2.add(new StructureVillagePieceWeight(ComponentVillageWoodHut.class, 3, MathHelper.getRandomIntegerInRange(par0Random, 2 + par1, 5 + par1 * 3))); -+ var2.add(new StructureVillagePieceWeight(ComponentVillageHall.class, 15, MathHelper.getRandomIntegerInRange(par0Random, 0 + par1, 2 + par1))); -+ var2.add(new StructureVillagePieceWeight(ComponentVillageField.class, 3, MathHelper.getRandomIntegerInRange(par0Random, 1 + par1, 4 + par1))); -+ var2.add(new StructureVillagePieceWeight(ComponentVillageField2.class, 3, MathHelper.getRandomIntegerInRange(par0Random, 2 + par1, 4 + par1 * 2))); -+ var2.add(new StructureVillagePieceWeight(ComponentVillageHouse2.class, 15, MathHelper.getRandomIntegerInRange(par0Random, 0, 1 + par1))); -+ var2.add(new StructureVillagePieceWeight(ComponentVillageHouse3.class, 8, MathHelper.getRandomIntegerInRange(par0Random, 0 + par1, 3 + par1 * 2))); - Iterator var3 = var2.iterator(); - -- while(var3.hasNext()) { -- if(((StructureVillagePieceWeight)var3.next()).villagePiecesLimit == 0) { -+ while (var3.hasNext()) { -+ if (((StructureVillagePieceWeight)var3.next()).villagePiecesLimit == 0) { - var3.remove(); - } - } -@@ -44,14 +44,15 @@ - return var2; - } - -- private static int func_75079_a(List var0) { -+ private static int func_75079_a(List par0List) { - boolean var1 = false; - int var2 = 0; -- - StructureVillagePieceWeight var4; -- for(Iterator var3 = var0.iterator(); var3.hasNext(); var2 += var4.villagePieceWeight) { -+ -+ for (Iterator var3 = par0List.iterator(); var3.hasNext(); var2 += var4.villagePieceWeight) { - var4 = (StructureVillagePieceWeight)var3.next(); -- if(var4.villagePiecesLimit > 0 && var4.villagePiecesSpawned < var4.villagePiecesLimit) { -+ -+ if (var4.villagePiecesLimit > 0 && var4.villagePiecesSpawned < var4.villagePiecesLimit) { - var1 = true; - } - } -@@ -59,58 +60,66 @@ - return var1 ? var2 : -1; - } - -- private static ComponentVillage func_75083_a(ComponentVillageStartPiece var0, StructureVillagePieceWeight var1, List var2, Random var3, int var4, int var5, int var6, int var7, int var8) { -- Class var9 = var1.a; -+ private static ComponentVillage func_75083_a(ComponentVillageStartPiece par0ComponentVillageStartPiece, StructureVillagePieceWeight par1StructureVillagePieceWeight, List par2List, Random par3Random, int par4, int par5, int par6, int par7, int par8) { -+ Class var9 = par1StructureVillagePieceWeight.villagePieceClass; - Object var10 = null; -- if(var9 == ComponentVillageHouse4_Garden.class) { -- var10 = ComponentVillageHouse4_Garden.func_74912_a(var0, var2, var3, var4, var5, var6, var7, var8); -- } else if(var9 == ComponentVillageChurch.class) { -- var10 = ComponentVillageChurch.func_74919_a(var0, var2, var3, var4, var5, var6, var7, var8); -- } else if(var9 == ComponentVillageHouse1.class) { -- var10 = ComponentVillageHouse1.func_74898_a(var0, var2, var3, var4, var5, var6, var7, var8); -- } else if(var9 == ComponentVillageWoodHut.class) { -- var10 = ComponentVillageWoodHut.func_74908_a(var0, var2, var3, var4, var5, var6, var7, var8); -- } else if(var9 == ComponentVillageHall.class) { -- var10 = ComponentVillageHall.func_74906_a(var0, var2, var3, var4, var5, var6, var7, var8); -- } else if(var9 == ComponentVillageField.class) { -- var10 = ComponentVillageField.func_74900_a(var0, var2, var3, var4, var5, var6, var7, var8); -- } else if(var9 == ComponentVillageField2.class) { -- var10 = ComponentVillageField2.func_74902_a(var0, var2, var3, var4, var5, var6, var7, var8); -- } else if(var9 == ComponentVillageHouse2.class) { -- var10 = ComponentVillageHouse2.func_74915_a(var0, var2, var3, var4, var5, var6, var7, var8); -- } else if(var9 == ComponentVillageHouse3.class) { -- var10 = ComponentVillageHouse3.func_74921_a(var0, var2, var3, var4, var5, var6, var7, var8); -+ -+ if (var9 == ComponentVillageHouse4_Garden.class) { -+ var10 = ComponentVillageHouse4_Garden.func_74912_a(par0ComponentVillageStartPiece, par2List, par3Random, par4, par5, par6, par7, par8); -+ } else if (var9 == ComponentVillageChurch.class) { -+ var10 = ComponentVillageChurch.func_74919_a(par0ComponentVillageStartPiece, par2List, par3Random, par4, par5, par6, par7, par8); -+ } else if (var9 == ComponentVillageHouse1.class) { -+ var10 = ComponentVillageHouse1.func_74898_a(par0ComponentVillageStartPiece, par2List, par3Random, par4, par5, par6, par7, par8); -+ } else if (var9 == ComponentVillageWoodHut.class) { -+ var10 = ComponentVillageWoodHut.func_74908_a(par0ComponentVillageStartPiece, par2List, par3Random, par4, par5, par6, par7, par8); -+ } else if (var9 == ComponentVillageHall.class) { -+ var10 = ComponentVillageHall.func_74906_a(par0ComponentVillageStartPiece, par2List, par3Random, par4, par5, par6, par7, par8); -+ } else if (var9 == ComponentVillageField.class) { -+ var10 = ComponentVillageField.func_74900_a(par0ComponentVillageStartPiece, par2List, par3Random, par4, par5, par6, par7, par8); -+ } else if (var9 == ComponentVillageField2.class) { -+ var10 = ComponentVillageField2.func_74902_a(par0ComponentVillageStartPiece, par2List, par3Random, par4, par5, par6, par7, par8); -+ } else if (var9 == ComponentVillageHouse2.class) { -+ var10 = ComponentVillageHouse2.func_74915_a(par0ComponentVillageStartPiece, par2List, par3Random, par4, par5, par6, par7, par8); -+ } else if (var9 == ComponentVillageHouse3.class) { -+ var10 = ComponentVillageHouse3.func_74921_a(par0ComponentVillageStartPiece, par2List, par3Random, par4, par5, par6, par7, par8); - } - - return (ComponentVillage)var10; - } - -- private static ComponentVillage getNextVillageComponent(ComponentVillageStartPiece var0, List var1, Random var2, int var3, int var4, int var5, int var6, int var7) { -- int var8 = func_75079_a(var0.e); -- if(var8 <= 0) { -+ /** -+ * attempts to find a next Village Component to be spawned -+ */ -+ private static ComponentVillage getNextVillageComponent(ComponentVillageStartPiece par0ComponentVillageStartPiece, List par1List, Random par2Random, int par3, int par4, int par5, int par6, int par7) { -+ int var8 = func_75079_a(par0ComponentVillageStartPiece.structureVillageWeightedPieceList); -+ -+ if (var8 <= 0) { - return null; - } else { - int var9 = 0; - -- while(var9 < 5) { -+ while (var9 < 5) { - ++var9; -- int var10 = var2.nextInt(var8); -- Iterator var11 = var0.e.iterator(); -+ int var10 = par2Random.nextInt(var8); -+ Iterator var11 = par0ComponentVillageStartPiece.structureVillageWeightedPieceList.iterator(); - -- while(var11.hasNext()) { -+ while (var11.hasNext()) { - StructureVillagePieceWeight var12 = (StructureVillagePieceWeight)var11.next(); - var10 -= var12.villagePieceWeight; -- if(var10 < 0) { -- if(!var12.canSpawnMoreVillagePiecesOfType(var7) || var12 == var0.structVillagePieceWeight && var0.e.size() > 1) { -+ -+ if (var10 < 0) { -+ if (!var12.canSpawnMoreVillagePiecesOfType(par7) || var12 == par0ComponentVillageStartPiece.structVillagePieceWeight && par0ComponentVillageStartPiece.structureVillageWeightedPieceList.size() > 1) { - break; - } - -- ComponentVillage var13 = func_75083_a(var0, var12, var1, var2, var3, var4, var5, var6, var7); -- if(var13 != null) { -+ ComponentVillage var13 = func_75083_a(par0ComponentVillageStartPiece, var12, par1List, par2Random, par3, par4, par5, par6, par7); -+ -+ if (var13 != null) { - ++var12.villagePiecesSpawned; -- var0.structVillagePieceWeight = var12; -- if(!var12.canSpawnMoreVillagePieces()) { -- var0.e.remove(var12); -+ par0ComponentVillageStartPiece.structVillagePieceWeight = var12; -+ -+ if (!var12.canSpawnMoreVillagePieces()) { -+ par0ComponentVillageStartPiece.structureVillageWeightedPieceList.remove(var12); - } - - return var13; -@@ -119,29 +128,35 @@ - } - } - -- StructureBoundingBox var14 = ComponentVillageTorch.func_74904_a(var0, var1, var2, var3, var4, var5, var6); -- if(var14 != null) { -- return new ComponentVillageTorch(var0, var7, var2, var14, var6); -+ StructureBoundingBox var14 = ComponentVillageTorch.func_74904_a(par0ComponentVillageStartPiece, par1List, par2Random, par3, par4, par5, par6); -+ -+ if (var14 != null) { -+ return new ComponentVillageTorch(par0ComponentVillageStartPiece, par7, par2Random, var14, par6); - } else { - return null; - } - } - } - -- private static StructureComponent getNextVillageStructureComponent(ComponentVillageStartPiece var0, List var1, Random var2, int var3, int var4, int var5, int var6, int var7) { -- if(var7 > 50) { -+ /** -+ * attempts to find a next Structure Component to be spawned, private Village function -+ */ -+ private static StructureComponent getNextVillageStructureComponent(ComponentVillageStartPiece par0ComponentVillageStartPiece, List par1List, Random par2Random, int par3, int par4, int par5, int par6, int par7) { -+ if (par7 > 50) { - return null; -- } else if(Math.abs(var3 - var0.getBoundingBox().minX) <= 112 && Math.abs(var5 - var0.getBoundingBox().minZ) <= 112) { -- ComponentVillage var8 = getNextVillageComponent(var0, var1, var2, var3, var4, var5, var6, var7 + 1); -- if(var8 != null) { -+ } else if (Math.abs(par3 - par0ComponentVillageStartPiece.getBoundingBox().minX) <= 112 && Math.abs(par5 - par0ComponentVillageStartPiece.getBoundingBox().minZ) <= 112) { -+ ComponentVillage var8 = getNextVillageComponent(par0ComponentVillageStartPiece, par1List, par2Random, par3, par4, par5, par6, par7 + 1); -+ -+ if (var8 != null) { - int var9 = (var8.boundingBox.minX + var8.boundingBox.maxX) / 2; - int var10 = (var8.boundingBox.minZ + var8.boundingBox.maxZ) / 2; - int var11 = var8.boundingBox.maxX - var8.boundingBox.minX; - int var12 = var8.boundingBox.maxZ - var8.boundingBox.minZ; - int var13 = var11 > var12 ? var11 : var12; -- if(var0.getWorldChunkManager().areBiomesViable(var9, var10, var13 / 2 + 4, MapGenVillage.e)) { -- var1.add(var8); -- var0.i.add(var8); -+ -+ if (par0ComponentVillageStartPiece.getWorldChunkManager().areBiomesViable(var9, var10, var13 / 2 + 4, MapGenVillage.villageSpawnBiomes)) { -+ par1List.add(var8); -+ par0ComponentVillageStartPiece.field_74932_i.add(var8); - return var8; - } - } -@@ -152,21 +167,23 @@ - } - } - -- private static StructureComponent getNextComponentVillagePath(ComponentVillageStartPiece var0, List var1, Random var2, int var3, int var4, int var5, int var6, int var7) { -- if(var7 > 3 + var0.terrainType) { -+ private static StructureComponent getNextComponentVillagePath(ComponentVillageStartPiece par0ComponentVillageStartPiece, List par1List, Random par2Random, int par3, int par4, int par5, int par6, int par7) { -+ if (par7 > 3 + par0ComponentVillageStartPiece.terrainType) { - return null; -- } else if(Math.abs(var3 - var0.getBoundingBox().minX) <= 112 && Math.abs(var5 - var0.getBoundingBox().minZ) <= 112) { -- StructureBoundingBox var8 = ComponentVillagePathGen.func_74933_a(var0, var1, var2, var3, var4, var5, var6); -- if(var8 != null && var8.minY > 10) { -- ComponentVillagePathGen var9 = new ComponentVillagePathGen(var0, var7, var2, var8, var6); -+ } else if (Math.abs(par3 - par0ComponentVillageStartPiece.getBoundingBox().minX) <= 112 && Math.abs(par5 - par0ComponentVillageStartPiece.getBoundingBox().minZ) <= 112) { -+ StructureBoundingBox var8 = ComponentVillagePathGen.func_74933_a(par0ComponentVillageStartPiece, par1List, par2Random, par3, par4, par5, par6); -+ -+ if (var8 != null && var8.minY > 10) { -+ ComponentVillagePathGen var9 = new ComponentVillagePathGen(par0ComponentVillageStartPiece, par7, par2Random, var8, par6); - int var10 = (var9.boundingBox.minX + var9.boundingBox.maxX) / 2; - int var11 = (var9.boundingBox.minZ + var9.boundingBox.maxZ) / 2; - int var12 = var9.boundingBox.maxX - var9.boundingBox.minX; - int var13 = var9.boundingBox.maxZ - var9.boundingBox.minZ; - int var14 = var12 > var13 ? var12 : var13; -- if(var0.getWorldChunkManager().areBiomesViable(var10, var11, var14 / 2 + 4, MapGenVillage.e)) { -- var1.add(var9); -- var0.j.add(var9); -+ -+ if (par0ComponentVillageStartPiece.getWorldChunkManager().areBiomesViable(var10, var11, var14 / 2 + 4, MapGenVillage.villageSpawnBiomes)) { -+ par1List.add(var9); -+ par0ComponentVillageStartPiece.field_74930_j.add(var9); - return var9; - } - } -@@ -177,11 +194,14 @@ - } - } - -- static StructureComponent getNextStructureComponent(ComponentVillageStartPiece var0, List var1, Random var2, int var3, int var4, int var5, int var6, int var7) { -- return getNextVillageStructureComponent(var0, var1, var2, var3, var4, var5, var6, var7); -+ /** -+ * attempts to find a next Structure Component to be spawned -+ */ -+ static StructureComponent getNextStructureComponent(ComponentVillageStartPiece par0ComponentVillageStartPiece, List par1List, Random par2Random, int par3, int par4, int par5, int par6, int par7) { -+ return getNextVillageStructureComponent(par0ComponentVillageStartPiece, par1List, par2Random, par3, par4, par5, par6, par7); - } - -- static StructureComponent getNextStructureComponentVillagePath(ComponentVillageStartPiece var0, List var1, Random var2, int var3, int var4, int var5, int var6, int var7) { -- return getNextComponentVillagePath(var0, var1, var2, var3, var4, var5, var6, var7); -+ static StructureComponent getNextStructureComponentVillagePath(ComponentVillageStartPiece par0ComponentVillageStartPiece, List par1List, Random par2Random, int par3, int par4, int par5, int par6, int par7) { -+ return getNextComponentVillagePath(par0ComponentVillageStartPiece, par1List, par2Random, par3, par4, par5, par6, par7); - } - } ---- net/minecraft/src/WorldClientINNER4.java -+++ net/minecraft/src/WorldClientINNER4.java -@@ -5,8 +5,8 @@ - class WorldClientINNER4 implements Callable { - final WorldClient theWorldClient; - -- WorldClientINNER4(WorldClient var1) { -- this.theWorldClient = var1; -+ WorldClientINNER4(WorldClient par1WorldClient) { -+ this.theWorldClient = par1WorldClient; - } - - public String func_142028_a() { ---- /dev/null -+++ org/spoutcraft/api/block/design/SubTexture.java -@@ -1,0 +1,80 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.api.block.design; -+ -+public class SubTexture { -+ Texture parent; -+ int xLoc; -+ int yLoc; -+ -+ int xTopLoc; -+ int yTopLoc; -+ -+ public SubTexture(Texture parent, int xLoc, int yLoc, int spriteSize) { -+ this.parent = parent; -+ this.xLoc = xLoc; -+ this.xTopLoc = xLoc + spriteSize; -+ this.yLoc = yLoc; -+ this.yTopLoc = yLoc + spriteSize; -+ } -+ -+ /** -+ * Gets the left-sided X of this subtexture -+ * @return xLoc -+ */ -+ public int getXLoc() { -+ return xLoc; -+ } -+ -+ /* -+ * Gets the bottom-sided y of this subtexture -+ * @return yLoc -+ */ -+ public int getYLoc() { -+ return yLoc; -+ } -+ -+ /** -+ * Gets the right-sided x of this subtexture -+ * -+ * @return xTopLoc -+ */ -+ public int getXTopLoc() { -+ return xTopLoc; -+ } -+ -+ /** -+ * Gets the top-sided y of this subtexture -+ * -+ * @return yTopLoc -+ */ -+ public int getYTopLoc() { -+ return yTopLoc; -+ } -+ -+ /** -+ * Gets the parent texture of this subtexture -+ * -+ * @return parent Texture -+ */ -+ public Texture getParent() { -+ return parent; -+ } -+} ---- net/minecraft/src/StructureStrongholdStones.java -+++ net/minecraft/src/StructureStrongholdStones.java -@@ -3,18 +3,21 @@ - import java.util.Random; - - class StructureStrongholdStones extends StructurePieceBlockSelector { -- private StructureStrongholdStones() { -- } -+ private StructureStrongholdStones() {} - -- public void selectBlocks(Random var1, int var2, int var3, int var4, boolean var5) { -- if(var5) { -+ /** -+ * picks Block Ids and Metadata (Silverfish) -+ */ -+ public void selectBlocks(Random par1Random, int par2, int par3, int par4, boolean par5) { -+ if (par5) { - this.selectedBlockId = Block.stoneBrick.blockID; -- float var6 = var1.nextFloat(); -- if(var6 < 0.2F) { -+ float var6 = par1Random.nextFloat(); -+ -+ if (var6 < 0.2F) { - this.selectedBlockMetaData = 2; -- } else if(var6 < 0.5F) { -+ } else if (var6 < 0.5F) { - this.selectedBlockMetaData = 1; -- } else if(var6 < 0.55F) { -+ } else if (var6 < 0.55F) { - this.selectedBlockId = Block.silverfish.blockID; - this.selectedBlockMetaData = 2; - } else { -@@ -24,10 +27,9 @@ - this.selectedBlockId = 0; - this.selectedBlockMetaData = 0; - } -- - } - -- StructureStrongholdStones(StructureStrongholdPieceWeight2 var1) { -+ StructureStrongholdStones(StructureStrongholdPieceWeight2 par1StructureStrongholdPieceWeight2) { - this(); - } - } ---- net/minecraft/src/Packet132TileEntityData.java -+++ net/minecraft/src/Packet132TileEntityData.java -@@ -5,45 +5,69 @@ - import java.io.IOException; - - public class Packet132TileEntityData extends Packet { -+ -+ /** The X position of the tile entity to update. */ - public int xPosition; -+ -+ /** The Y position of the tile entity to update. */ - public int yPosition; -+ -+ /** The Z position of the tile entity to update. */ - public int zPosition; -+ -+ /** The type of update to perform on the tile entity. */ - public int actionType; -+ -+ /** -+ * NBT tile entity data. This is NOT related to writeToNBT or readFromNBT. -+ */ - public NBTTagCompound data; - - public Packet132TileEntityData() { - this.isChunkDataPacket = true; - } - -- public Packet132TileEntityData(int var1, int var2, int var3, int var4, NBTTagCompound var5) { -+ public Packet132TileEntityData(int par1, int par2, int par3, int par4, NBTTagCompound par5NBTTagCompound) { - this.isChunkDataPacket = true; -- this.xPosition = var1; -- this.yPosition = var2; -- this.zPosition = var3; -- this.actionType = var4; -- this.data = var5; -- } -- -- public void readPacketData(DataInput var1) throws IOException { -- this.xPosition = var1.readInt(); -- this.yPosition = var1.readShort(); -- this.zPosition = var1.readInt(); -- this.actionType = var1.readByte(); -- this.data = readNBTTagCompound(var1); -- } -- -- public void writePacketData(DataOutput var1) throws IOException { -- var1.writeInt(this.xPosition); -- var1.writeShort(this.yPosition); -- var1.writeInt(this.zPosition); -- var1.writeByte((byte)this.actionType); -- writeNBTTagCompound(this.data, var1); -- } -- -- public void processPacket(NetHandler var1) { -- var1.handleTileEntityData(this); -- } -- -+ this.xPosition = par1; -+ this.yPosition = par2; -+ this.zPosition = par3; -+ this.actionType = par4; -+ this.data = par5NBTTagCompound; -+ } -+ -+ /** -+ * Abstract. Reads the raw packet data from the data stream. -+ */ -+ public void readPacketData(DataInput par1DataInput) throws IOException { -+ this.xPosition = par1DataInput.readInt(); -+ this.yPosition = par1DataInput.readShort(); -+ this.zPosition = par1DataInput.readInt(); -+ this.actionType = par1DataInput.readByte(); -+ this.data = readNBTTagCompound(par1DataInput); -+ } -+ -+ /** -+ * Abstract. Writes the raw packet data to the data stream. -+ */ -+ public void writePacketData(DataOutput par1DataOutput) throws IOException { -+ par1DataOutput.writeInt(this.xPosition); -+ par1DataOutput.writeShort(this.yPosition); -+ par1DataOutput.writeInt(this.zPosition); -+ par1DataOutput.writeByte((byte)this.actionType); -+ writeNBTTagCompound(this.data, par1DataOutput); -+ } -+ -+ /** -+ * Passes this Packet on to the NetHandler for processing. -+ */ -+ public void processPacket(NetHandler par1NetHandler) { -+ par1NetHandler.handleTileEntityData(this); -+ } -+ -+ /** -+ * Abstract. Return the size of the packet (not counting the header). -+ */ - public int getPacketSize() { - return 25; - } ---- net/minecraft/src/DynamicTexture.java -+++ net/minecraft/src/DynamicTexture.java -@@ -5,24 +5,27 @@ - - public class DynamicTexture extends AbstractTexture { - private final int[] dynamicTextureData; -+ -+ /** width of this icon in pixels */ - private final int width; -+ -+ /** height of this icon in pixels */ - private final int height; - -- public DynamicTexture(BufferedImage var1) { -- this(var1.getWidth(), var1.getHeight()); -- var1.getRGB(0, 0, var1.getWidth(), var1.getHeight(), this.dynamicTextureData, 0, var1.getWidth()); -+ public DynamicTexture(BufferedImage par1BufferedImage) { -+ this(par1BufferedImage.getWidth(), par1BufferedImage.getHeight()); -+ par1BufferedImage.getRGB(0, 0, par1BufferedImage.getWidth(), par1BufferedImage.getHeight(), this.dynamicTextureData, 0, par1BufferedImage.getWidth()); - this.updateDynamicTexture(); - } - -- public DynamicTexture(int var1, int var2) { -- this.width = var1; -- this.height = var2; -- this.dynamicTextureData = new int[var1 * var2]; -- TextureUtil.allocateTexture(this.getGlTextureId(), var1, var2); -+ public DynamicTexture(int par1, int par2) { -+ this.width = par1; -+ this.height = par2; -+ this.dynamicTextureData = new int[par1 * par2]; -+ TextureUtil.allocateTexture(this.getGlTextureId(), par1, par2); - } - -- public void loadTexture(ResourceManager var1) throws IOException { -- } -+ public void loadTexture(ResourceManager par1ResourceManager) throws IOException {} - - public void updateDynamicTexture() { - TextureUtil.uploadTexture(this.getGlTextureId(), this.dynamicTextureData, this.width, this.height); ---- /dev/null -+++ org/spoutcraft/client/ReconnectManager.java -@@ -1,0 +1,68 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.client; -+ -+import net.minecraft.src.GuiConnecting; -+ -+import org.spoutcraft.client.gui.server.ServerItem; -+ -+public class ReconnectManager { -+ static String hostName = null; -+ static int portNum = -1; -+ public static boolean serverTeleport = false; -+ -+ public static void detectKick(String infoString, String reason, Object[] objects) { -+ portNum = -1; -+ -+ if (infoString == null || reason == null || objects == null) { -+ return; -+ } -+ -+ if (objects.length == 0 || !(objects[0] instanceof String)) { -+ return; -+ } -+ -+ reason = (String) objects[0]; -+ -+ if (infoString.contains("disconnect.disconnected")) { -+ if (reason.indexOf("[Serverport]") == 0 || reason.indexOf("[Redirect]") == 0) { -+ String[] split = reason.split(":"); -+ if (split.length == 3) { -+ hostName = split[1].trim(); -+ try { -+ portNum = Integer.parseInt(split[2].trim()); -+ } catch (Exception e) { -+ portNum = -1; -+ } -+ } else if (split.length == 2) { -+ hostName = split[1].trim(); -+ portNum = ServerItem.DEFAULT_PORT; -+ } -+ } -+ } -+ } -+ -+ public static void teleport(net.minecraft.src.Minecraft mc) { -+ if (portNum != -1 && hostName != null) { -+ mc.displayGuiScreen(new GuiConnecting(mc, hostName, portNum)); -+ serverTeleport = true; -+ } -+ } -+} ---- net/minecraft/src/BlockContainer.java -+++ net/minecraft/src/BlockContainer.java -@@ -1,23 +1,34 @@ - package net.minecraft.src; - - public abstract class BlockContainer extends Block implements ITileEntityProvider { -- protected BlockContainer(int var1, Material var2) { -- super(var1, var2); -+ protected BlockContainer(int par1, Material par2Material) { -+ super(par1, par2Material); - this.isBlockContainer = true; - } - -- public void onBlockAdded(World var1, int var2, int var3, int var4) { -- super.onBlockAdded(var1, var2, var3, var4); -- } -- -- public void breakBlock(World var1, int var2, int var3, int var4, int var5, int var6) { -- super.breakBlock(var1, var2, var3, var4, var5, var6); -- var1.removeBlockTileEntity(var2, var3, var4); -- } -- -- public boolean onBlockEventReceived(World var1, int var2, int var3, int var4, int var5, int var6) { -- super.onBlockEventReceived(var1, var2, var3, var4, var5, var6); -- TileEntity var7 = var1.getBlockTileEntity(var2, var3, var4); -- return var7 != null ? var7.receiveClientEvent(var5, var6) : false; -+ /** -+ * Called whenever the block is added into the world. Args: world, x, y, z -+ */ -+ public void onBlockAdded(World par1World, int par2, int par3, int par4) { -+ super.onBlockAdded(par1World, par2, par3, par4); -+ } -+ -+ /** -+ * Called on server worlds only when the block has been replaced by a different block ID, or the same block with a -+ * different metadata value, but before the new metadata value is set. Args: World, x, y, z, old block ID, old metadata -+ */ -+ public void breakBlock(World par1World, int par2, int par3, int par4, int par5, int par6) { -+ super.breakBlock(par1World, par2, par3, par4, par5, par6); -+ par1World.removeBlockTileEntity(par2, par3, par4); -+ } -+ -+ /** -+ * Called when the block receives a BlockEvent - see World.addBlockEvent. By default, passes it on to the tile entity -+ * at this location. Args: world, x, y, z, blockID, EventID, event parameter -+ */ -+ public boolean onBlockEventReceived(World par1World, int par2, int par3, int par4, int par5, int par6) { -+ super.onBlockEventReceived(par1World, par2, par3, par4, par5, par6); -+ TileEntity var7 = par1World.getBlockTileEntity(par2, par3, par4); -+ return var7 != null ? var7.receiveClientEvent(par5, par6) : false; - } - } ---- net/minecraft/src/Packet207SetScore.java -+++ net/minecraft/src/Packet207SetScore.java -@@ -5,53 +5,76 @@ - import java.io.IOException; - - public class Packet207SetScore extends Packet { -- public String a = ""; -- public String b = ""; -+ -+ /** An unique name to be displayed in the list. */ -+ public String itemName = ""; -+ -+ /** -+ * The unique name for the scoreboard to be updated. Only sent when updateOrRemove does not equal 1. -+ */ -+ public String scoreName = ""; -+ -+ /** -+ * The score to be displayed next to the entry. Only sent when Update/Remove does not equal 1. -+ */ - public int value; -+ -+ /** 0 to create/update an item. 1 to remove an item. */ - public int updateOrRemove; - -- public Packet207SetScore() { -- } -- -- public Packet207SetScore(Score var1, int var2) { -- this.a = var1.getPlayerName(); -- this.b = var1.func_96645_d().getName(); -- this.value = var1.getScorePoints(); -- this.updateOrRemove = var2; -- } -- -- public Packet207SetScore(String var1) { -- this.a = var1; -- this.b = ""; -+ public Packet207SetScore() {} -+ -+ public Packet207SetScore(Score par1Score, int par2) { -+ this.itemName = par1Score.getPlayerName(); -+ this.scoreName = par1Score.func_96645_d().getName(); -+ this.value = par1Score.getScorePoints(); -+ this.updateOrRemove = par2; -+ } -+ -+ public Packet207SetScore(String par1Str) { -+ this.itemName = par1Str; -+ this.scoreName = ""; - this.value = 0; - this.updateOrRemove = 1; - } - -- public void readPacketData(DataInput var1) throws IOException { -- this.a = readString(var1, 16); -- this.updateOrRemove = var1.readByte(); -- if(this.updateOrRemove != 1) { -- this.b = readString(var1, 16); -- this.value = var1.readInt(); -- } -- -- } -- -- public void writePacketData(DataOutput var1) throws IOException { -- writeString(this.a, var1); -- var1.writeByte(this.updateOrRemove); -- if(this.updateOrRemove != 1) { -- writeString(this.b, var1); -- var1.writeInt(this.value); -- } -- -- } -- -- public void processPacket(NetHandler var1) { -- var1.handleSetScore(this); -- } -- -+ /** -+ * Abstract. Reads the raw packet data from the data stream. -+ */ -+ public void readPacketData(DataInput par1DataInput) throws IOException { -+ this.itemName = readString(par1DataInput, 16); -+ this.updateOrRemove = par1DataInput.readByte(); -+ -+ if (this.updateOrRemove != 1) { -+ this.scoreName = readString(par1DataInput, 16); -+ this.value = par1DataInput.readInt(); -+ } -+ } -+ -+ /** -+ * Abstract. Writes the raw packet data to the data stream. -+ */ -+ public void writePacketData(DataOutput par1DataOutput) throws IOException { -+ writeString(this.itemName, par1DataOutput); -+ par1DataOutput.writeByte(this.updateOrRemove); -+ -+ if (this.updateOrRemove != 1) { -+ writeString(this.scoreName, par1DataOutput); -+ par1DataOutput.writeInt(this.value); -+ } -+ } -+ -+ /** -+ * Passes this Packet on to the NetHandler for processing. -+ */ -+ public void processPacket(NetHandler par1NetHandler) { -+ par1NetHandler.handleSetScore(this); -+ } -+ -+ /** -+ * Abstract. Return the size of the packet (not counting the header). -+ */ - public int getPacketSize() { -- return 2 + (this.a == null ? 0 : this.a.length()) + 2 + (this.b == null ? 0 : this.b.length()) + 4 + 1; -+ return 2 + (this.itemName == null ? 0 : this.itemName.length()) + 2 + (this.scoreName == null ? 0 : this.scoreName.length()) + 4 + 1; - } - } ---- /dev/null -+++ org/spoutcraft/client/gui/settings/controls/ChunkRenderSpeed.java -@@ -1,0 +1,50 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.client.gui.settings.controls; -+ -+import org.spoutcraft.client.config.Configuration; -+ -+public class ChunkRenderSpeed extends AutomatedButton { -+ public ChunkRenderSpeed() { -+ setTooltip("Chunk Render Speed\nControls how fast chunks will render in new areas.\n Faster rendering may adversly affect FPS."); -+ } -+ -+ @Override -+ public void onButtonClick() { -+ Configuration.setChunkRenderPasses(Configuration.getChunkRenderPasses() * 2); -+ if (Configuration.getChunkRenderPasses() > 16) { -+ Configuration.setChunkRenderPasses(1); -+ } else if (Configuration.getChunkRenderPasses() < 1) { -+ Configuration.setChunkRenderPasses(1); -+ } -+ Configuration.write(); -+ } -+ -+ public String getText() { -+ switch(Configuration.getChunkRenderPasses()) { -+ case 16: return "Render Speed: Very Fast"; -+ case 8: return "Render Speed: Fast"; -+ case 4: return "Render Speed: Average"; -+ case 2: return "Render Speed: Slow"; -+ case 1: return "Render Speed: Slowest"; -+ } -+ return "Error, Unknown Setting!"; -+ } -+} ---- net/minecraft/src/GuiScreenTemporaryResourcePackSelect.java -+++ net/minecraft/src/GuiScreenTemporaryResourcePackSelect.java -@@ -11,33 +11,40 @@ - private GuiScreenTemporaryResourcePackSelectSelectionList field_110346_c; - private GameSettings field_96146_n; - -- public GuiScreenTemporaryResourcePackSelect(GuiScreen var1, GameSettings var2) { -- this.field_110347_a = var1; -- this.field_96146_n = var2; -+ public GuiScreenTemporaryResourcePackSelect(GuiScreen par1GuiScreen, GameSettings par2GameSettings) { -+ this.field_110347_a = par1GuiScreen; -+ this.field_96146_n = par2GameSettings; - } - -+ /** -+ * Adds the buttons (and other controls) to the screen in question. -+ */ - public void initGui() { -- this.i.add(new GuiSmallButton(5, this.width / 2 - 154, this.height - 48, I18n.getString("resourcePack.openFolder"))); -- this.i.add(new GuiSmallButton(6, this.width / 2 + 4, this.height - 48, I18n.getString("gui.done"))); -+ this.buttonList.add(new GuiSmallButton(5, this.width / 2 - 154, this.height - 48, I18n.getString("resourcePack.openFolder"))); -+ this.buttonList.add(new GuiSmallButton(6, this.width / 2 + 4, this.height - 48, I18n.getString("gui.done"))); - this.field_110346_c = new GuiScreenTemporaryResourcePackSelectSelectionList(this, this.mc.getResourcePackRepository()); - this.field_110346_c.registerScrollButtons(7, 8); - } - -- protected void actionPerformed(GuiButton var1) { -- if(var1.enabled) { -- if(var1.id == 5) { -+ /** -+ * Fired when a control is clicked. This is the equivalent of ActionListener.actionPerformed(ActionEvent e). -+ */ -+ protected void actionPerformed(GuiButton par1GuiButton) { -+ if (par1GuiButton.enabled) { -+ if (par1GuiButton.id == 5) { - File var2 = GuiScreenTemporaryResourcePackSelectSelectionList.func_110510_a(this.field_110346_c).getDirResourcepacks(); - String var3 = var2.getAbsolutePath(); -- if(Util.getOSType() == EnumOS.MACOS) { -+ -+ if (Util.getOSType() == EnumOS.MACOS) { - try { - this.mc.getLogAgent().logInfo(var3); -- Runtime.getRuntime().exec(new String[]{"/usr/bin/open", var3}); -+ Runtime.getRuntime().exec(new String[] {"/usr/bin/open", var3}); - return; - } catch (IOException var9) { - var9.printStackTrace(); - } -- } else if(Util.getOSType() == EnumOS.WINDOWS) { -- String var4 = String.format("cmd.exe /C start \"Open file\" \"%s\"", new Object[]{var3}); -+ } else if (Util.getOSType() == EnumOS.WINDOWS) { -+ String var4 = String.format("cmd.exe /C start \"Open file\" \"%s\"", new Object[] {var3}); - - try { - Runtime.getRuntime().exec(var4); -@@ -52,91 +59,104 @@ - try { - Class var5 = Class.forName("java.awt.Desktop"); - Object var6 = var5.getMethod("getDesktop", new Class[0]).invoke((Object)null, new Object[0]); -- var5.getMethod("browse", new Class[]{URI.class}).invoke(var6, new Object[]{var2.toURI()}); -+ var5.getMethod("browse", new Class[] {URI.class}).invoke(var6, new Object[] {var2.toURI()}); - } catch (Throwable var7) { - var7.printStackTrace(); - var10 = true; - } - -- if(var10) { -+ if (var10) { - this.mc.getLogAgent().logInfo("Opening via system class!"); - Sys.openURL("file://" + var3); - } -- } else if(var1.id == 6) { -+ } else if (par1GuiButton.id == 6) { - this.mc.displayGuiScreen(this.field_110347_a); - } else { -- this.field_110346_c.actionPerformed(var1); -+ this.field_110346_c.actionPerformed(par1GuiButton); - } -- - } - } - -- protected void mouseClicked(int var1, int var2, int var3) { -- super.mouseClicked(var1, var2, var3); -- } -- -- protected void mouseMovedOrUp(int var1, int var2, int var3) { -- super.mouseMovedOrUp(var1, var2, var3); -- } -- -- public void drawScreen(int var1, int var2, float var3) { -- this.field_110346_c.drawScreen(var1, var2, var3); -- if(this.refreshTimer <= 0) { -+ /** -+ * Called when the mouse is clicked. -+ */ -+ protected void mouseClicked(int par1, int par2, int par3) { -+ super.mouseClicked(par1, par2, par3); -+ } -+ -+ /** -+ * Called when the mouse is moved or a mouse button is released. Signature: (mouseX, mouseY, which) which==-1 is -+ * mouseMove, which==0 or which==1 is mouseUp -+ */ -+ protected void mouseMovedOrUp(int par1, int par2, int par3) { -+ super.mouseMovedOrUp(par1, par2, par3); -+ } -+ -+ /** -+ * Draws the screen and all the components in it. -+ */ -+ public void drawScreen(int par1, int par2, float par3) { -+ this.field_110346_c.drawScreen(par1, par2, par3); -+ -+ if (this.refreshTimer <= 0) { - GuiScreenTemporaryResourcePackSelectSelectionList.func_110510_a(this.field_110346_c).updateRepositoryEntriesAll(); - this.refreshTimer = 20; - } - - this.drawCenteredString(this.fontRenderer, I18n.getString("resourcePack.title"), this.width / 2, 16, 16777215); - this.drawCenteredString(this.fontRenderer, I18n.getString("resourcePack.folderInfo"), this.width / 2 - 77, this.height - 26, 8421504); -- super.drawScreen(var1, var2, var3); -+ super.drawScreen(par1, par2, par3); - } - -+ /** -+ * Called from the main game loop to update the screen. -+ */ - public void updateScreen() { - super.updateScreen(); - --this.refreshTimer; - } - -- static Minecraft func_110344_a(GuiScreenTemporaryResourcePackSelect var0) { -- return var0.mc; -- } -- -- static Minecraft func_110341_b(GuiScreenTemporaryResourcePackSelect var0) { -- return var0.mc; -- } -- -- static Minecraft func_110339_c(GuiScreenTemporaryResourcePackSelect var0) { -- return var0.mc; -- } -- -- static Minecraft func_110345_d(GuiScreenTemporaryResourcePackSelect var0) { -- return var0.mc; -- } -- -- static Minecraft func_110334_e(GuiScreenTemporaryResourcePackSelect var0) { -- return var0.mc; -- } -- -- static Minecraft func_110340_f(GuiScreenTemporaryResourcePackSelect var0) { -- return var0.mc; -- } -- -- static FontRenderer func_130017_g(GuiScreenTemporaryResourcePackSelect var0) { -- return var0.fontRenderer; -- } -- -- static FontRenderer func_130016_h(GuiScreenTemporaryResourcePackSelect var0) { -- return var0.fontRenderer; -- } -- -- static FontRenderer func_110337_i(GuiScreenTemporaryResourcePackSelect var0) { -- return var0.fontRenderer; -- } -- -- static FontRenderer func_110335_j(GuiScreenTemporaryResourcePackSelect var0) { -- return var0.fontRenderer; -- } -- -- static FontRenderer func_110338_k(GuiScreenTemporaryResourcePackSelect var0) { -- return var0.fontRenderer; -+ static Minecraft func_110344_a(GuiScreenTemporaryResourcePackSelect par0GuiScreenTemporaryResourcePackSelect) { -+ return par0GuiScreenTemporaryResourcePackSelect.mc; -+ } -+ -+ static Minecraft func_110341_b(GuiScreenTemporaryResourcePackSelect par0GuiScreenTemporaryResourcePackSelect) { -+ return par0GuiScreenTemporaryResourcePackSelect.mc; -+ } -+ -+ static Minecraft func_110339_c(GuiScreenTemporaryResourcePackSelect par0GuiScreenTemporaryResourcePackSelect) { -+ return par0GuiScreenTemporaryResourcePackSelect.mc; -+ } -+ -+ static Minecraft func_110345_d(GuiScreenTemporaryResourcePackSelect par0GuiScreenTemporaryResourcePackSelect) { -+ return par0GuiScreenTemporaryResourcePackSelect.mc; -+ } -+ -+ static Minecraft func_110334_e(GuiScreenTemporaryResourcePackSelect par0GuiScreenTemporaryResourcePackSelect) { -+ return par0GuiScreenTemporaryResourcePackSelect.mc; -+ } -+ -+ static Minecraft func_110340_f(GuiScreenTemporaryResourcePackSelect par0GuiScreenTemporaryResourcePackSelect) { -+ return par0GuiScreenTemporaryResourcePackSelect.mc; -+ } -+ -+ static FontRenderer func_130017_g(GuiScreenTemporaryResourcePackSelect par0GuiScreenTemporaryResourcePackSelect) { -+ return par0GuiScreenTemporaryResourcePackSelect.fontRenderer; -+ } -+ -+ static FontRenderer func_130016_h(GuiScreenTemporaryResourcePackSelect par0GuiScreenTemporaryResourcePackSelect) { -+ return par0GuiScreenTemporaryResourcePackSelect.fontRenderer; -+ } -+ -+ static FontRenderer func_110337_i(GuiScreenTemporaryResourcePackSelect par0GuiScreenTemporaryResourcePackSelect) { -+ return par0GuiScreenTemporaryResourcePackSelect.fontRenderer; -+ } -+ -+ static FontRenderer func_110335_j(GuiScreenTemporaryResourcePackSelect par0GuiScreenTemporaryResourcePackSelect) { -+ return par0GuiScreenTemporaryResourcePackSelect.fontRenderer; -+ } -+ -+ static FontRenderer func_110338_k(GuiScreenTemporaryResourcePackSelect par0GuiScreenTemporaryResourcePackSelect) { -+ return par0GuiScreenTemporaryResourcePackSelect.fontRenderer; - } - } ---- net/minecraft/src/ItemInWorldManager.java -+++ net/minecraft/src/ItemInWorldManager.java -@@ -1,29 +1,42 @@ - package net.minecraft.src; - - public class ItemInWorldManager { -+ -+ /** The world object that this object is connected to. */ - public World theWorld; -+ -+ /** The EntityPlayerMP object that this object is connected to. */ - public EntityPlayerMP thisPlayerMP; -- private EnumGameType gameType = EnumGameType.NOT_SET; -+ private EnumGameType gameType; -+ -+ /** True if the player is destroying a block */ - private boolean isDestroyingBlock; - private int initialDamage; -- private int curBlockX; -- private int curBlockY; -- private int curBlockZ; -+ private int partiallyDestroyedBlockX; -+ private int partiallyDestroyedBlockY; -+ private int partiallyDestroyedBlockZ; - private int curblockDamage; -+ -+ /** -+ * Set to true when the "finished destroying block" packet is received but the block wasn't fully damaged yet. The -+ * block will not be destroyed while this is false. -+ */ - private boolean receivedFinishDiggingPacket; - private int posX; - private int posY; - private int posZ; - private int field_73093_n; -- private int durabilityRemainingOnBlock = -1; -+ private int durabilityRemainingOnBlock; - -- public ItemInWorldManager(World var1) { -- this.theWorld = var1; -+ public ItemInWorldManager(World par1World) { -+ this.gameType = EnumGameType.NOT_SET; -+ this.durabilityRemainingOnBlock = -1; -+ this.theWorld = par1World; - } - -- public void setGameType(EnumGameType var1) { -- this.gameType = var1; -- var1.configurePlayerCapabilities(this.thisPlayerMP.capabilities); -+ public void setGameType(EnumGameType par1EnumGameType) { -+ this.gameType = par1EnumGameType; -+ par1EnumGameType.configurePlayerCapabilities(this.thisPlayerMP.capabilities); - this.thisPlayerMP.sendPlayerAbilities(); - } - -@@ -31,13 +44,19 @@ - return this.gameType; - } - -+ /** -+ * Get if we are in creative game mode. -+ */ - public boolean isCreative() { - return this.gameType.isCreative(); - } - -- public void initializeGameType(EnumGameType var1) { -- if(this.gameType == EnumGameType.NOT_SET) { -- this.gameType = var1; -+ /** -+ * if the gameType is currently NOT_SET then change it to par1 -+ */ -+ public void initializeGameType(EnumGameType par1EnumGameType) { -+ if (this.gameType == EnumGameType.NOT_SET) { -+ this.gameType = par1EnumGameType; - } - - this.setGameType(this.gameType); -@@ -48,146 +67,182 @@ - int var1; - float var4; - int var5; -- if(this.receivedFinishDiggingPacket) { -+ -+ if (this.receivedFinishDiggingPacket) { - var1 = this.curblockDamage - this.field_73093_n; - int var2 = this.theWorld.getBlockId(this.posX, this.posY, this.posZ); -- if(var2 == 0) { -+ -+ if (var2 == 0) { - this.receivedFinishDiggingPacket = false; - } else { - Block var3 = Block.blocksList[var2]; -- var4 = var3.getPlayerRelativeBlockHardness(this.thisPlayerMP, this.thisPlayerMP.worldObj, this.posX, this.posY, this.posZ) * (float)(var1 + 1); -+ // Spout Start -+ var4 = var3.getPlayerRelativeBlockHardness(this.thisPlayerMP) * (float)(var1 + 1); -+ // Spout End - var5 = (int)(var4 * 10.0F); -- if(var5 != this.durabilityRemainingOnBlock) { -+ -+ if (var5 != this.durabilityRemainingOnBlock) { - this.theWorld.destroyBlockInWorldPartially(this.thisPlayerMP.entityId, this.posX, this.posY, this.posZ, var5); - this.durabilityRemainingOnBlock = var5; - } - -- if(var4 >= 1.0F) { -+ if (var4 >= 1.0F) { - this.receivedFinishDiggingPacket = false; - this.tryHarvestBlock(this.posX, this.posY, this.posZ); - } - } -- } else if(this.isDestroyingBlock) { -- var1 = this.theWorld.getBlockId(this.curBlockX, this.curBlockY, this.curBlockZ); -+ } else if (this.isDestroyingBlock) { -+ var1 = this.theWorld.getBlockId(this.partiallyDestroyedBlockX, this.partiallyDestroyedBlockY, this.partiallyDestroyedBlockZ); - Block var6 = Block.blocksList[var1]; -- if(var6 == null) { -- this.theWorld.destroyBlockInWorldPartially(this.thisPlayerMP.entityId, this.curBlockX, this.curBlockY, this.curBlockZ, -1); -+ -+ if (var6 == null) { -+ this.theWorld.destroyBlockInWorldPartially(this.thisPlayerMP.entityId, this.partiallyDestroyedBlockX, this.partiallyDestroyedBlockY, this.partiallyDestroyedBlockZ, -1); - this.durabilityRemainingOnBlock = -1; - this.isDestroyingBlock = false; - } else { - int var7 = this.curblockDamage - this.initialDamage; -- var4 = var6.getPlayerRelativeBlockHardness(this.thisPlayerMP, this.thisPlayerMP.worldObj, this.curBlockX, this.curBlockY, this.curBlockZ) * (float)(var7 + 1); -+ // Spout Start -+ var4 = var6.getPlayerRelativeBlockHardness(this.thisPlayerMP) * (float)(var7 + 1); -+ // Spout End - var5 = (int)(var4 * 10.0F); -- if(var5 != this.durabilityRemainingOnBlock) { -- this.theWorld.destroyBlockInWorldPartially(this.thisPlayerMP.entityId, this.curBlockX, this.curBlockY, this.curBlockZ, var5); -+ -+ if (var5 != this.durabilityRemainingOnBlock) { -+ this.theWorld.destroyBlockInWorldPartially(this.thisPlayerMP.entityId, this.partiallyDestroyedBlockX, this.partiallyDestroyedBlockY, this.partiallyDestroyedBlockZ, var5); - this.durabilityRemainingOnBlock = var5; - } - } - } -- - } - -- public void onBlockClicked(int var1, int var2, int var3, int var4) { -- if(!this.gameType.isAdventure() || this.thisPlayerMP.isCurrentToolAdventureModeExempt(var1, var2, var3)) { -- if(this.isCreative()) { -- if(!this.theWorld.extinguishFire((EntityPlayer)null, var1, var2, var3, var4)) { -- this.tryHarvestBlock(var1, var2, var3); -+ /** -+ * if not creative, it calls destroyBlockInWorldPartially untill the block is broken first. par4 is the specific side. -+ * tryHarvestBlock can also be the result of this call -+ */ -+ public void onBlockClicked(int par1, int par2, int par3, int par4) { -+ if (!this.gameType.isAdventure() || this.thisPlayerMP.isCurrentToolAdventureModeExempt(par1, par2, par3)) { -+ if (this.isCreative()) { -+ if (!this.theWorld.extinguishFire((EntityPlayer)null, par1, par2, par3, par4)) { -+ this.tryHarvestBlock(par1, par2, par3); - } -- - } else { -- this.theWorld.extinguishFire((EntityPlayer)null, var1, var2, var3, var4); -+ this.theWorld.extinguishFire((EntityPlayer)null, par1, par2, par3, par4); - this.initialDamage = this.curblockDamage; - float var5 = 1.0F; -- int var6 = this.theWorld.getBlockId(var1, var2, var3); -- if(var6 > 0) { -- Block.blocksList[var6].onBlockClicked(this.theWorld, var1, var2, var3, this.thisPlayerMP); -- var5 = Block.blocksList[var6].getPlayerRelativeBlockHardness(this.thisPlayerMP, this.thisPlayerMP.worldObj, var1, var2, var3); -+ int var6 = this.theWorld.getBlockId(par1, par2, par3); -+ -+ if (var6 > 0) { -+ Block.blocksList[var6].onBlockClicked(this.theWorld, par1, par2, par3, this.thisPlayerMP); -+ // Spout Start -+ var5 = Block.blocksList[var6].getPlayerRelativeBlockHardness(this.thisPlayerMP); -+ // Spout End - } - -- if(var6 > 0 && var5 >= 1.0F) { -- this.tryHarvestBlock(var1, var2, var3); -+ if (var6 > 0 && var5 >= 1.0F) { -+ this.tryHarvestBlock(par1, par2, par3); - } else { - this.isDestroyingBlock = true; -- this.curBlockX = var1; -- this.curBlockY = var2; -- this.curBlockZ = var3; -+ this.partiallyDestroyedBlockX = par1; -+ this.partiallyDestroyedBlockY = par2; -+ this.partiallyDestroyedBlockZ = par3; - int var7 = (int)(var5 * 10.0F); -- this.theWorld.destroyBlockInWorldPartially(this.thisPlayerMP.entityId, var1, var2, var3, var7); -+ this.theWorld.destroyBlockInWorldPartially(this.thisPlayerMP.entityId, par1, par2, par3, var7); - this.durabilityRemainingOnBlock = var7; - } -- - } - } - } - -- public void blockRemoving(int var1, int var2, int var3) { -- if(var1 == this.curBlockX && var2 == this.curBlockY && var3 == this.curBlockZ) { -+ public void uncheckedTryHarvestBlock(int par1, int par2, int par3) { -+ if (par1 == this.partiallyDestroyedBlockX && par2 == this.partiallyDestroyedBlockY && par3 == this.partiallyDestroyedBlockZ) { - int var4 = this.curblockDamage - this.initialDamage; -- int var5 = this.theWorld.getBlockId(var1, var2, var3); -- if(var5 != 0) { -+ int var5 = this.theWorld.getBlockId(par1, par2, par3); -+ -+ if (var5 != 0) { - Block var6 = Block.blocksList[var5]; -- float var7 = var6.getPlayerRelativeBlockHardness(this.thisPlayerMP, this.thisPlayerMP.worldObj, var1, var2, var3) * (float)(var4 + 1); -- if(var7 >= 0.7F) { -+ // Spout Start -+ float var7 = var6.getPlayerRelativeBlockHardness(this.thisPlayerMP) * (float)(var4 + 1); -+ // Spout End -+ -+ if (var7 >= 0.7F) { - this.isDestroyingBlock = false; -- this.theWorld.destroyBlockInWorldPartially(this.thisPlayerMP.entityId, var1, var2, var3, -1); -- this.tryHarvestBlock(var1, var2, var3); -- } else if(!this.receivedFinishDiggingPacket) { -+ this.theWorld.destroyBlockInWorldPartially(this.thisPlayerMP.entityId, par1, par2, par3, -1); -+ this.tryHarvestBlock(par1, par2, par3); -+ } else if (!this.receivedFinishDiggingPacket) { - this.isDestroyingBlock = false; - this.receivedFinishDiggingPacket = true; -- this.posX = var1; -- this.posY = var2; -- this.posZ = var3; -+ this.posX = par1; -+ this.posY = par2; -+ this.posZ = par3; - this.field_73093_n = this.initialDamage; - } - } - } -- -- } -- -- public void cancelDestroyingBlock(int var1, int var2, int var3) { -+ } -+ -+ // Spout Start - Hack for MCP field mapping changes -+ public void destroyBlockInWorldPartially(int var1, int var2, int var3) { -+ cancelDestroyingBlock(var1, var2, var3); -+ } -+ // Spout End -+ -+ /** -+ * note: this ignores the pars passed in and continues to destroy the onClickedBlock -+ */ -+ public void cancelDestroyingBlock(int par1, int par2, int par3) { - this.isDestroyingBlock = false; -- this.theWorld.destroyBlockInWorldPartially(this.thisPlayerMP.entityId, this.curBlockX, this.curBlockY, this.curBlockZ, -1); -+ this.theWorld.destroyBlockInWorldPartially(this.thisPlayerMP.entityId, this.partiallyDestroyedBlockX, this.partiallyDestroyedBlockY, this.partiallyDestroyedBlockZ, -1); - } - -- private boolean removeBlock(int var1, int var2, int var3) { -- Block var4 = Block.blocksList[this.theWorld.getBlockId(var1, var2, var3)]; -- int var5 = this.theWorld.getBlockMetadata(var1, var2, var3); -- if(var4 != null) { -- var4.onBlockHarvested(this.theWorld, var1, var2, var3, var5, this.thisPlayerMP); -+ /** -+ * Removes a block and triggers the appropriate events -+ */ -+ private boolean removeBlock(int par1, int par2, int par3) { -+ Block var4 = Block.blocksList[this.theWorld.getBlockId(par1, par2, par3)]; -+ int var5 = this.theWorld.getBlockMetadata(par1, par2, par3); -+ -+ if (var4 != null) { -+ var4.onBlockHarvested(this.theWorld, par1, par2, par3, var5, this.thisPlayerMP); - } - -- boolean var6 = this.theWorld.setBlockToAir(var1, var2, var3); -- if(var4 != null && var6) { -- var4.onBlockDestroyedByPlayer(this.theWorld, var1, var2, var3, var5); -+ boolean var6 = this.theWorld.setBlockToAir(par1, par2, par3); -+ -+ if (var4 != null && var6) { -+ var4.onBlockDestroyedByPlayer(this.theWorld, par1, par2, par3, var5); - } - - return var6; - } - -- public boolean tryHarvestBlock(int var1, int var2, int var3) { -- if(this.gameType.isAdventure() && !this.thisPlayerMP.isCurrentToolAdventureModeExempt(var1, var2, var3)) { -+ /** -+ * Attempts to harvest a block at the given coordinate -+ */ -+ public boolean tryHarvestBlock(int par1, int par2, int par3) { -+ if (this.gameType.isAdventure() && !this.thisPlayerMP.isCurrentToolAdventureModeExempt(par1, par2, par3)) { - return false; -- } else if(this.gameType.isCreative() && this.thisPlayerMP.getHeldItem() != null && this.thisPlayerMP.getHeldItem().getItem() instanceof ItemSword) { -+ } else if (this.gameType.isCreative() && this.thisPlayerMP.getHeldItem() != null && this.thisPlayerMP.getHeldItem().getItem() instanceof ItemSword) { - return false; - } else { -- int var4 = this.theWorld.getBlockId(var1, var2, var3); -- int var5 = this.theWorld.getBlockMetadata(var1, var2, var3); -- this.theWorld.playAuxSFXAtEntity(this.thisPlayerMP, 2001, var1, var2, var3, var4 + (this.theWorld.getBlockMetadata(var1, var2, var3) << 12)); -- boolean var6 = this.removeBlock(var1, var2, var3); -- if(this.isCreative()) { -- this.thisPlayerMP.playerNetServerHandler.sendPacket(new Packet53BlockChange(var1, var2, var3, this.theWorld)); -+ int var4 = this.theWorld.getBlockId(par1, par2, par3); -+ int var5 = this.theWorld.getBlockMetadata(par1, par2, par3); -+ this.theWorld.playAuxSFXAtEntity(this.thisPlayerMP, 2001, par1, par2, par3, var4 + (this.theWorld.getBlockMetadata(par1, par2, par3) << 12)); -+ boolean var6 = this.removeBlock(par1, par2, par3); -+ -+ if (this.isCreative()) { -+ this.thisPlayerMP.playerNetServerHandler.sendPacketToPlayer(new Packet53BlockChange(par1, par2, par3, this.theWorld)); - } else { - ItemStack var7 = this.thisPlayerMP.getCurrentEquippedItem(); - boolean var8 = this.thisPlayerMP.canHarvestBlock(Block.blocksList[var4]); -- if(var7 != null) { -- var7.onBlockDestroyed(this.theWorld, var4, var1, var2, var3, this.thisPlayerMP); -- if(var7.stackSize == 0) { -+ -+ if (var7 != null) { -+ var7.onBlockDestroyed(this.theWorld, var4, par1, par2, par3, this.thisPlayerMP); -+ -+ if (var7.stackSize == 0) { - this.thisPlayerMP.destroyCurrentEquippedItem(); - } - } - -- if(var6 && var8) { -- Block.blocksList[var4].harvestBlock(this.theWorld, this.thisPlayerMP, var1, var2, var3, var5); -+ if (var6 && var8) { -+ Block.blocksList[var4].harvestBlock(this.theWorld, this.thisPlayerMP, par1, par2, par3, var5); - } - } - -@@ -195,57 +250,72 @@ - } - } - -- public boolean tryUseItem(EntityPlayer var1, World var2, ItemStack var3) { -- int var4 = var3.stackSize; -- int var5 = var3.getItemDamage(); -- ItemStack var6 = var3.useItemRightClick(var2, var1); -- if(var6 != var3 || var6 != null && (var6.stackSize != var4 || var6.getMaxItemUseDuration() > 0 || var6.getItemDamage() != var5)) { -- var1.inventory.mainInventory[var1.inventory.currentItem] = var6; -- if(this.isCreative()) { -+ /** -+ * Attempts to right-click use an item by the given EntityPlayer in the given World -+ */ -+ public boolean tryUseItem(EntityPlayer par1EntityPlayer, World par2World, ItemStack par3ItemStack) { -+ int var4 = par3ItemStack.stackSize; -+ int var5 = par3ItemStack.getItemDamage(); -+ ItemStack var6 = par3ItemStack.useItemRightClick(par2World, par1EntityPlayer); -+ -+ if (var6 == par3ItemStack && (var6 == null || var6.stackSize == var4 && var6.getMaxItemUseDuration() <= 0 && var6.getItemDamage() == var5)) { -+ return false; -+ } else { -+ par1EntityPlayer.inventory.mainInventory[par1EntityPlayer.inventory.currentItem] = var6; -+ -+ if (this.isCreative()) { - var6.stackSize = var4; -- if(var6.isItemStackDamageable()) { -+ -+ if (var6.isItemStackDamageable()) { - var6.setItemDamage(var5); - } - } - -- if(var6.stackSize == 0) { -- var1.inventory.mainInventory[var1.inventory.currentItem] = null; -+ if (var6.stackSize == 0) { -+ par1EntityPlayer.inventory.mainInventory[par1EntityPlayer.inventory.currentItem] = null; - } - -- if(!var1.isUsingItem()) { -- ((EntityPlayerMP)var1).sendContainerToPlayer(var1.inventoryContainer); -+ if (!par1EntityPlayer.isUsingItem()) { -+ ((EntityPlayerMP)par1EntityPlayer).sendContainerToPlayer(par1EntityPlayer.inventoryContainer); - } - - return true; -- } else { -- return false; - } - } - -- public boolean activateBlockOrUseItem(EntityPlayer var1, World var2, ItemStack var3, int var4, int var5, int var6, int var7, float var8, float var9, float var10) { -+ /** -+ * Activate the clicked on block, otherwise use the held item. Args: player, world, itemStack, x, y, z, side, xOffset, -+ * yOffset, zOffset -+ */ -+ public boolean activateBlockOrUseItem(EntityPlayer par1EntityPlayer, World par2World, ItemStack par3ItemStack, int par4, int par5, int par6, int par7, float par8, float par9, float par10) { - int var11; -- if(!var1.isSneaking() || var1.getHeldItem() == null) { -- var11 = var2.getBlockId(var4, var5, var6); -- if(var11 > 0 && Block.blocksList[var11].onBlockActivated(var2, var4, var5, var6, var1, var7, var8, var9, var10)) { -+ -+ if (!par1EntityPlayer.isSneaking() || par1EntityPlayer.getHeldItem() == null) { -+ var11 = par2World.getBlockId(par4, par5, par6); -+ -+ if (var11 > 0 && Block.blocksList[var11].onBlockActivated(par2World, par4, par5, par6, par1EntityPlayer, par7, par8, par9, par10)) { - return true; - } - } - -- if(var3 == null) { -+ if (par3ItemStack == null) { - return false; -- } else if(this.isCreative()) { -- var11 = var3.getItemDamage(); -- int var12 = var3.stackSize; -- boolean var13 = var3.tryPlaceItemIntoWorld(var1, var2, var4, var5, var6, var7, var8, var9, var10); -- var3.setItemDamage(var11); -- var3.stackSize = var12; -+ } else if (this.isCreative()) { -+ var11 = par3ItemStack.getItemDamage(); -+ int var12 = par3ItemStack.stackSize; -+ boolean var13 = par3ItemStack.tryPlaceItemIntoWorld(par1EntityPlayer, par2World, par4, par5, par6, par7, par8, par9, par10); -+ par3ItemStack.setItemDamage(var11); -+ par3ItemStack.stackSize = var12; - return var13; - } else { -- return var3.tryPlaceItemIntoWorld(var1, var2, var4, var5, var6, var7, var8, var9, var10); -+ return par3ItemStack.tryPlaceItemIntoWorld(par1EntityPlayer, par2World, par4, par5, par6, par7, par8, par9, par10); - } - } - -- public void setWorld(WorldServer var1) { -- this.theWorld = var1; -+ /** -+ * Sets the world instance. -+ */ -+ public void setWorld(WorldServer par1WorldServer) { -+ this.theWorld = par1WorldServer; - } - } ---- /dev/null -+++ org/spoutcraft/client/gui/settings/controls/BiomeColorsButton.java -@@ -1,0 +1,47 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.client.gui.settings.controls; -+ -+import java.util.UUID; -+ -+import net.minecraft.src.Minecraft; -+ -+import org.spoutcraft.client.config.Configuration; -+ -+public class BiomeColorsButton extends AutomatedCheckBox { -+ UUID fancyGraphics; -+ public BiomeColorsButton(UUID fancyGraphics) { -+ super("Fancy Biome Colors"); -+ this.fancyGraphics = fancyGraphics; -+ this.setChecked(Configuration.isFancyBiomeColors()); -+ setTooltip("Biome Colors\nFast - caches colors for grass and water per chunk.\nMay cause sharp changes in color near chunk edges.\nFancy - normal coloring for grass and water.\nCalculates color for water and grass for each block."); -+ } -+ -+ @Override -+ public void onButtonClick() { -+ Configuration.setFancyBiomeColors(!Configuration.isFancyBiomeColors()); -+ Configuration.write(); -+ ((FancyGraphicsButton)getScreen().getWidget(fancyGraphics)).custom = true; -+ -+ if (Minecraft.getMinecraft().theWorld != null) { -+ Minecraft.getMinecraft().renderGlobal.updateAllRenderers(); -+ } -+ } -+} ---- net/minecraft/src/BlockSilverfish.java -+++ net/minecraft/src/BlockSilverfish.java -@@ -4,65 +4,96 @@ - import java.util.Random; - - public class BlockSilverfish extends Block { -- public static final String[] a = new String[]{"stone", "cobble", "brick"}; -- -- public BlockSilverfish(int var1) { -- super(var1, Material.clay); -+ -+ /** Block names that can be a silverfish stone. */ -+ public static final String[] silverfishStoneTypes = new String[] {"stone", "cobble", "brick"}; -+ -+ public BlockSilverfish(int par1) { -+ super(par1, Material.clay); - this.setHardness(0.0F); - this.setCreativeTab(CreativeTabs.tabDecorations); - } - -- public Icon getIcon(int var1, int var2) { -- return var2 == 1 ? Block.cobblestone.getBlockTextureFromSide(var1) : (var2 == 2 ? Block.stoneBrick.getBlockTextureFromSide(var1) : Block.stone.getBlockTextureFromSide(var1)); -- } -- -- public void registerIcons(IconRegister var1) { -- } -- -- public void onBlockDestroyedByPlayer(World var1, int var2, int var3, int var4, int var5) { -- if(!var1.isRemote) { -- EntitySilverfish var6 = new EntitySilverfish(var1); -- var6.setLocationAndAngles((double)var2 + 0.5D, (double)var3, (double)var4 + 0.5D, 0.0F, 0.0F); -- var1.spawnEntityInWorld(var6); -+ /** -+ * From the specified side and block metadata retrieves the blocks texture. Args: side, metadata -+ */ -+ public Icon getIcon(int par1, int par2) { -+ return par2 == 1 ? Block.cobblestone.getBlockTextureFromSide(par1) : (par2 == 2 ? Block.stoneBrick.getBlockTextureFromSide(par1) : Block.stone.getBlockTextureFromSide(par1)); -+ } -+ -+ /** -+ * When this method is called, your block should register all the icons it needs with the given IconRegister. This is -+ * the only chance you get to register icons. -+ */ -+ public void registerIcons(IconRegister par1IconRegister) {} -+ -+ /** -+ * Called right before the block is destroyed by a player. Args: world, x, y, z, metaData -+ */ -+ public void onBlockDestroyedByPlayer(World par1World, int par2, int par3, int par4, int par5) { -+ if (!par1World.isRemote) { -+ EntitySilverfish var6 = new EntitySilverfish(par1World); -+ var6.setLocationAndAngles((double)par2 + 0.5D, (double)par3, (double)par4 + 0.5D, 0.0F, 0.0F); -+ par1World.spawnEntityInWorld(var6); - var6.spawnExplosionParticle(); - } - -- super.onBlockDestroyedByPlayer(var1, var2, var3, var4, var5); -+ super.onBlockDestroyedByPlayer(par1World, par2, par3, par4, par5); - } - -- public int quantityDropped(Random var1) { -+ /** -+ * Returns the quantity of items to drop on block destruction. -+ */ -+ public int quantityDropped(Random par1Random) { - return 0; - } - -- public static boolean getPosingIdByMetadata(int var0) { -- return var0 == Block.stone.blockID || var0 == Block.cobblestone.blockID || var0 == Block.stoneBrick.blockID; -- } -- -- public static int getMetadataForBlockType(int var0) { -- return var0 == Block.cobblestone.blockID ? 1 : (var0 == Block.stoneBrick.blockID ? 2 : 0); -- } -- -- protected ItemStack createStackedBlock(int var1) { -+ /** -+ * Gets the blockID of the block this block is pretending to be according to this block's metadata. -+ */ -+ public static boolean getPosingIdByMetadata(int par0) { -+ return par0 == Block.stone.blockID || par0 == Block.cobblestone.blockID || par0 == Block.stoneBrick.blockID; -+ } -+ -+ /** -+ * Returns the metadata to use when a Silverfish hides in the block. Sets the block to BlockSilverfish with this -+ * metadata. It changes the displayed texture client side to look like a normal block. -+ */ -+ public static int getMetadataForBlockType(int par0) { -+ return par0 == Block.cobblestone.blockID ? 1 : (par0 == Block.stoneBrick.blockID ? 2 : 0); -+ } -+ -+ /** -+ * Returns an item stack containing a single instance of the current block type. 'i' is the block's subtype/damage and -+ * is ignored for blocks which do not support subtypes. Blocks which cannot be harvested should return null. -+ */ -+ protected ItemStack createStackedBlock(int par1) { - Block var2 = Block.stone; -- if(var1 == 1) { -+ -+ if (par1 == 1) { - var2 = Block.cobblestone; - } - -- if(var1 == 2) { -+ if (par1 == 2) { - var2 = Block.stoneBrick; - } - - return new ItemStack(var2); - } - -- public int getDamageValue(World var1, int var2, int var3, int var4) { -- return var1.getBlockMetadata(var2, var3, var4); -+ /** -+ * Get the block's damage value (for use with pick block). -+ */ -+ public int getDamageValue(World par1World, int par2, int par3, int par4) { -+ return par1World.getBlockMetadata(par2, par3, par4); - } - -- public void getSubBlocks(int var1, CreativeTabs var2, List var3) { -- for(int var4 = 0; var4 < 3; ++var4) { -- var3.add(new ItemStack(var1, 1, var4)); -+ /** -+ * returns a list of blocks with the same ID, but different meta (eg: wood returns 4 blocks) -+ */ -+ public void getSubBlocks(int par1, CreativeTabs par2CreativeTabs, List par3List) { -+ for (int var4 = 0; var4 < 3; ++var4) { -+ par3List.add(new ItemStack(par1, 1, var4)); - } -- - } - } ---- net/minecraft/src/EntityWitch.java -+++ net/minecraft/src/EntityWitch.java -@@ -5,13 +5,20 @@ - import java.util.UUID; - - public class EntityWitch extends EntityMob implements IRangedAttackMob { -- private static final UUID bp = UUID.fromString("5CD17E52-A79A-43D3-A529-90FDE04B181E"); -- private static final AttributeModifier field_110185_bq = (new AttributeModifier(bp, "Drinking speed penalty", -0.25D, 0)).setSaved(false); -- private static final int[] witchDrops = new int[]{Item.glowstone.itemID, Item.sugar.itemID, Item.redstone.itemID, Item.spiderEye.itemID, Item.glassBottle.itemID, Item.gunpowder.itemID, Item.stick.itemID, Item.stick.itemID}; -+ private static final UUID field_110184_bp = UUID.fromString("5CD17E52-A79A-43D3-A529-90FDE04B181E"); -+ private static final AttributeModifier field_110185_bq = (new AttributeModifier(field_110184_bp, "Drinking speed penalty", -0.25D, 0)).setSaved(false); -+ -+ /** List of items a witch should drop on death. */ -+ private static final int[] witchDrops = new int[] {Item.glowstone.itemID, Item.sugar.itemID, Item.redstone.itemID, Item.spiderEye.itemID, Item.glassBottle.itemID, Item.gunpowder.itemID, Item.stick.itemID, Item.stick.itemID}; -+ -+ /** -+ * Timer used as interval for a witch's attack, decremented every tick if aggressive and when reaches zero the witch -+ * will throw a potion at the target entity. -+ */ - private int witchAttackTimer; - -- public EntityWitch(World var1) { -- super(var1); -+ public EntityWitch(World par1World) { -+ super(par1World); - this.tasks.addTask(1, new EntityAISwimming(this)); - this.tasks.addTask(2, new EntityAIArrowAttack(this, 1.0D, 60, 10.0F)); - this.tasks.addTask(2, new EntityAIWander(this, 1.0D)); -@@ -26,22 +33,37 @@ - this.getDataWatcher().addObject(21, Byte.valueOf((byte)0)); - } - -+ /** -+ * Returns the sound this mob makes while it's alive. -+ */ - protected String getLivingSound() { - return "mob.witch.idle"; - } - -+ /** -+ * Returns the sound this mob makes when it is hurt. -+ */ - protected String getHurtSound() { - return "mob.witch.hurt"; - } - -+ /** -+ * Returns the sound this mob makes on death. -+ */ - protected String getDeathSound() { - return "mob.witch.death"; - } - -- public void setAggressive(boolean var1) { -- this.getDataWatcher().updateObject(21, Byte.valueOf((byte)(var1 ? 1 : 0))); -+ /** -+ * Set whether this witch is aggressive at an entity. -+ */ -+ public void setAggressive(boolean par1) { -+ this.getDataWatcher().updateObject(21, Byte.valueOf((byte)(par1 ? 1 : 0))); - } - -+ /** -+ * Return whether this witch is aggressive at an entity. -+ */ - public boolean getAggressive() { - return this.getDataWatcher().getWatchableObjectByte(21) == 1; - } -@@ -52,23 +74,32 @@ - this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setAttribute(0.25D); - } - -+ /** -+ * Returns true if the newer Entity AI code should be run -+ */ - public boolean isAIEnabled() { - return true; - } - -+ /** -+ * Called frequently so the entity can update its state every tick as required. For example, zombies and skeletons use -+ * this to react to sunlight and start to burn. -+ */ - public void onLivingUpdate() { -- if(!this.worldObj.isRemote) { -- if(this.getAggressive()) { -- if(this.witchAttackTimer-- <= 0) { -+ if (!this.worldObj.isRemote) { -+ if (this.getAggressive()) { -+ if (this.witchAttackTimer-- <= 0) { - this.setAggressive(false); -- ItemStack var6 = this.getHeldItem(); -+ ItemStack var1 = this.getHeldItem(); - this.setCurrentItemOrArmor(0, (ItemStack)null); -- if(var6 != null && var6.itemID == Item.potion.itemID) { -- List var5 = Item.potion.getEffects(var6); -- if(var5 != null) { -- Iterator var3 = var5.iterator(); -- -- while(var3.hasNext()) { -+ -+ if (var1 != null && var1.itemID == Item.potion.itemID) { -+ List var2 = Item.potion.getEffects(var1); -+ -+ if (var2 != null) { -+ Iterator var3 = var2.iterator(); -+ -+ while (var3.hasNext()) { - PotionEffect var4 = (PotionEffect)var3.next(); - this.addPotionEffect(new PotionEffect(var4)); - } -@@ -78,28 +109,29 @@ - this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).removeModifier(field_110185_bq); - } - } else { -- short var1 = -1; -- if(this.ab.nextFloat() < 0.15F && this.isBurning() && !this.isPotionActive(Potion.fireResistance)) { -- var1 = 16307; -- } else if(this.ab.nextFloat() < 0.05F && this.getHealth() < this.getMaxHealth()) { -- var1 = 16341; -- } else if(this.ab.nextFloat() < 0.25F && this.getAttackTarget() != null && !this.isPotionActive(Potion.moveSpeed) && this.getAttackTarget().getDistanceSqToEntity(this) > 121.0D) { -- var1 = 16274; -- } else if(this.ab.nextFloat() < 0.25F && this.getAttackTarget() != null && !this.isPotionActive(Potion.moveSpeed) && this.getAttackTarget().getDistanceSqToEntity(this) > 121.0D) { -- var1 = 16274; -+ short var5 = -1; -+ -+ if (this.rand.nextFloat() < 0.15F && this.isBurning() && !this.isPotionActive(Potion.fireResistance)) { -+ var5 = 16307; -+ } else if (this.rand.nextFloat() < 0.05F && this.getHealth() < this.getMaxHealth()) { -+ var5 = 16341; -+ } else if (this.rand.nextFloat() < 0.25F && this.getAttackTarget() != null && !this.isPotionActive(Potion.moveSpeed) && this.getAttackTarget().getDistanceSqToEntity(this) > 121.0D) { -+ var5 = 16274; -+ } else if (this.rand.nextFloat() < 0.25F && this.getAttackTarget() != null && !this.isPotionActive(Potion.moveSpeed) && this.getAttackTarget().getDistanceSqToEntity(this) > 121.0D) { -+ var5 = 16274; - } - -- if(var1 > -1) { -- this.setCurrentItemOrArmor(0, new ItemStack(Item.potion, 1, var1)); -+ if (var5 > -1) { -+ this.setCurrentItemOrArmor(0, new ItemStack(Item.potion, 1, var5)); - this.witchAttackTimer = this.getHeldItem().getMaxItemUseDuration(); - this.setAggressive(true); -- AttributeInstance var2 = this.getEntityAttribute(SharedMonsterAttributes.movementSpeed); -- var2.removeModifier(field_110185_bq); -- var2.applyModifier(field_110185_bq); -+ AttributeInstance var6 = this.getEntityAttribute(SharedMonsterAttributes.movementSpeed); -+ var6.removeModifier(field_110185_bq); -+ var6.applyModifier(field_110185_bq); - } - } - -- if(this.ab.nextFloat() < 7.5E-4F) { -+ if (this.rand.nextFloat() < 7.5E-4F) { - this.worldObj.setEntityState(this, (byte)15); - } - } -@@ -107,64 +139,75 @@ - super.onLivingUpdate(); - } - -- public void handleHealthUpdate(byte var1) { -- if(var1 == 15) { -- for(int var2 = 0; var2 < this.ab.nextInt(35) + 10; ++var2) { -- this.worldObj.spawnParticle("witchMagic", this.posX + this.ab.nextGaussian() * (double)0.13F, this.boundingBox.maxY + 0.5D + this.ab.nextGaussian() * (double)0.13F, this.posZ + this.ab.nextGaussian() * (double)0.13F, 0.0D, 0.0D, 0.0D); -+ public void handleHealthUpdate(byte par1) { -+ if (par1 == 15) { -+ for (int var2 = 0; var2 < this.rand.nextInt(35) + 10; ++var2) { -+ this.worldObj.spawnParticle("witchMagic", this.posX + this.rand.nextGaussian() * 0.12999999523162842D, this.boundingBox.maxY + 0.5D + this.rand.nextGaussian() * 0.12999999523162842D, this.posZ + this.rand.nextGaussian() * 0.12999999523162842D, 0.0D, 0.0D, 0.0D); - } - } else { -- super.handleHealthUpdate(var1); -- } -- -- } -- -- protected float applyPotionDamageCalculations(DamageSource var1, float var2) { -- var2 = super.applyPotionDamageCalculations(var1, var2); -- if(var1.getEntity() == this) { -- var2 = 0.0F; -- } -- -- if(var1.isMagicDamage()) { -- var2 = (float)((double)var2 * 0.15D); -- } -- -- return var2; -- } -- -- protected void dropFewItems(boolean var1, int var2) { -- int var3 = this.ab.nextInt(3) + 1; -- -- for(int var4 = 0; var4 < var3; ++var4) { -- int var5 = this.ab.nextInt(3); -- int var6 = witchDrops[this.ab.nextInt(witchDrops.length)]; -- if(var2 > 0) { -- var5 += this.ab.nextInt(var2 + 1); -+ super.handleHealthUpdate(par1); -+ } -+ } -+ -+ /** -+ * Reduces damage, depending on potions -+ */ -+ protected float applyPotionDamageCalculations(DamageSource par1DamageSource, float par2) { -+ par2 = super.applyPotionDamageCalculations(par1DamageSource, par2); -+ -+ if (par1DamageSource.getEntity() == this) { -+ par2 = 0.0F; -+ } -+ -+ if (par1DamageSource.isMagicDamage()) { -+ par2 = (float)((double)par2 * 0.15D); -+ } -+ -+ return par2; -+ } -+ -+ /** -+ * Drop 0-2 items of this living's type. @param par1 - Whether this entity has recently been hit by a player. @param -+ * par2 - Level of Looting used to kill this mob. -+ */ -+ protected void dropFewItems(boolean par1, int par2) { -+ int var3 = this.rand.nextInt(3) + 1; -+ -+ for (int var4 = 0; var4 < var3; ++var4) { -+ int var5 = this.rand.nextInt(3); -+ int var6 = witchDrops[this.rand.nextInt(witchDrops.length)]; -+ -+ if (par2 > 0) { -+ var5 += this.rand.nextInt(par2 + 1); - } - -- for(int var7 = 0; var7 < var5; ++var7) { -+ for (int var7 = 0; var7 < var5; ++var7) { - this.dropItem(var6, 1); - } - } -- - } - -- public void attackEntityWithRangedAttack(EntityLivingBase var1, float var2) { -- if(!this.getAggressive()) { -+ /** -+ * Attack the specified entity using a ranged attack. -+ */ -+ public void attackEntityWithRangedAttack(EntityLivingBase par1EntityLivingBase, float par2) { -+ if (!this.getAggressive()) { - EntityPotion var3 = new EntityPotion(this.worldObj, this, 32732); - var3.rotationPitch -= -20.0F; -- double var4 = var1.posX + var1.motionX - this.posX; -- double var6 = var1.posY + (double)var1.getEyeHeight() - (double)1.1F - this.posY; -- double var8 = var1.posZ + var1.motionZ - this.posZ; -+ double var4 = par1EntityLivingBase.posX + par1EntityLivingBase.motionX - this.posX; -+ double var6 = par1EntityLivingBase.posY + (double)par1EntityLivingBase.getEyeHeight() - 1.100000023841858D - this.posY; -+ double var8 = par1EntityLivingBase.posZ + par1EntityLivingBase.motionZ - this.posZ; - float var10 = MathHelper.sqrt_double(var4 * var4 + var8 * var8); -- if(var10 >= 8.0F && !var1.isPotionActive(Potion.moveSlowdown)) { -+ -+ if (var10 >= 8.0F && !par1EntityLivingBase.isPotionActive(Potion.moveSlowdown)) { - var3.setPotionDamage(32698); -- } else if(var1.getHealth() >= 8.0F && !var1.isPotionActive(Potion.poison)) { -+ } else if (par1EntityLivingBase.getHealth() >= 8.0F && !par1EntityLivingBase.isPotionActive(Potion.poison)) { - var3.setPotionDamage(32660); -- } else if(var10 <= 3.0F && !var1.isPotionActive(Potion.weakness) && this.ab.nextFloat() < 0.25F) { -+ } else if (var10 <= 3.0F && !par1EntityLivingBase.isPotionActive(Potion.weakness) && this.rand.nextFloat() < 0.25F) { - var3.setPotionDamage(32696); - } - -- var3.setThrowableHeading(var4, var6 + (double)(var10 * 0.2F), var8, 12.0F / 16.0F, 8.0F); -+ var3.setThrowableHeading(var4, var6 + (double)(var10 * 0.2F), var8, 0.75F, 8.0F); - this.worldObj.spawnEntityInWorld(var3); - } - } ---- net/minecraft/src/Packet31RelEntityMove.java -+++ net/minecraft/src/Packet31RelEntityMove.java -@@ -5,30 +5,38 @@ - import java.io.IOException; - - public class Packet31RelEntityMove extends Packet30Entity { -- public Packet31RelEntityMove() { -- } -- -- public Packet31RelEntityMove(int var1, byte var2, byte var3, byte var4) { -- super(var1); -- this.xPosition = var2; -- this.yPosition = var3; -- this.zPosition = var4; -- } -- -- public void readPacketData(DataInput var1) throws IOException { -- super.readPacketData(var1); -- this.xPosition = var1.readByte(); -- this.yPosition = var1.readByte(); -- this.zPosition = var1.readByte(); -- } -- -- public void writePacketData(DataOutput var1) throws IOException { -- super.writePacketData(var1); -- var1.writeByte(this.xPosition); -- var1.writeByte(this.yPosition); -- var1.writeByte(this.zPosition); -- } -- -+ public Packet31RelEntityMove() {} -+ -+ public Packet31RelEntityMove(int par1, byte par2, byte par3, byte par4) { -+ super(par1); -+ this.xPosition = par2; -+ this.yPosition = par3; -+ this.zPosition = par4; -+ } -+ -+ /** -+ * Abstract. Reads the raw packet data from the data stream. -+ */ -+ public void readPacketData(DataInput par1DataInput) throws IOException { -+ super.readPacketData(par1DataInput); -+ this.xPosition = par1DataInput.readByte(); -+ this.yPosition = par1DataInput.readByte(); -+ this.zPosition = par1DataInput.readByte(); -+ } -+ -+ /** -+ * Abstract. Writes the raw packet data to the data stream. -+ */ -+ public void writePacketData(DataOutput par1DataOutput) throws IOException { -+ super.writePacketData(par1DataOutput); -+ par1DataOutput.writeByte(this.xPosition); -+ par1DataOutput.writeByte(this.yPosition); -+ par1DataOutput.writeByte(this.zPosition); -+ } -+ -+ /** -+ * Abstract. Return the size of the packet (not counting the header). -+ */ - public int getPacketSize() { - return 7; - } ---- net/minecraft/src/GuiScreenPendingInvitationINNER1.java -+++ net/minecraft/src/GuiScreenPendingInvitationINNER1.java -@@ -3,18 +3,17 @@ - class GuiScreenPendingInvitationINNER1 extends Thread { - final GuiScreenPendingInvitation field_130121_a; - -- GuiScreenPendingInvitationINNER1(GuiScreenPendingInvitation var1) { -- this.field_130121_a = var1; -+ GuiScreenPendingInvitationINNER1(GuiScreenPendingInvitation par1GuiScreenPendingInvitation) { -+ this.field_130121_a = par1GuiScreenPendingInvitation; - } - - public void run() { - McoClient var1 = new McoClient(GuiScreenPendingInvitation.func_130048_a(this.field_130121_a).getSession()); - - try { -- GuiScreenPendingInvitation.func_130043_a(this.field_130121_a, var1.func_130108_f().a); -+ GuiScreenPendingInvitation.func_130043_a(this.field_130121_a, var1.func_130108_f().field_130096_a); - } catch (ExceptionMcoService var3) { - GuiScreenPendingInvitation.func_130044_b(this.field_130121_a).getLogAgent().logSevere(var3.toString()); - } -- - } - } ---- net/minecraft/src/RecipesWeapons.java -+++ net/minecraft/src/RecipesWeapons.java -@@ -1,20 +1,27 @@ - package net.minecraft.src; - - public class RecipesWeapons { -- private String[][] a = new String[][]{{"X", "X", "#"}}; -- private Object[][] b = new Object[][]{{Block.planks, Block.cobblestone, Item.ingotIron, Item.diamond, Item.ingotGold}, {Item.swordWood, Item.swordStone, Item.swordIron, Item.swordDiamond, Item.swordGold}}; -- -- public void addRecipes(CraftingManager var1) { -- for(int var2 = 0; var2 < this.b[0].length; ++var2) { -- Object var3 = this.b[0][var2]; -- -- for(int var4 = 0; var4 < this.b.length - 1; ++var4) { -- Item var5 = (Item)this.b[var4 + 1][var2]; -- var1.addRecipe(new ItemStack(var5), new Object[]{this.a[var4], Character.valueOf('#'), Item.stick, Character.valueOf('X'), var3}); -+ private String[][] recipePatterns = new String[][] {{"X", "X", "#"}}; -+ private Object[][] recipeItems; -+ -+ public RecipesWeapons() { -+ this.recipeItems = new Object[][] {{Block.planks, Block.cobblestone, Item.ingotIron, Item.diamond, Item.ingotGold}, {Item.swordWood, Item.swordStone, Item.swordIron, Item.swordDiamond, Item.swordGold}}; -+ } -+ -+ /** -+ * Adds the weapon recipes to the CraftingManager. -+ */ -+ public void addRecipes(CraftingManager par1CraftingManager) { -+ for (int var2 = 0; var2 < this.recipeItems[0].length; ++var2) { -+ Object var3 = this.recipeItems[0][var2]; -+ -+ for (int var4 = 0; var4 < this.recipeItems.length - 1; ++var4) { -+ Item var5 = (Item)this.recipeItems[var4 + 1][var2]; -+ par1CraftingManager.addRecipe(new ItemStack(var5), new Object[] {this.recipePatterns[var4], '#', Item.stick, 'X', var3}); - } - } - -- var1.addRecipe(new ItemStack(Item.bow, 1), new Object[]{" #X", "# X", " #X", Character.valueOf('X'), Item.silk, Character.valueOf('#'), Item.stick}); -- var1.addRecipe(new ItemStack(Item.arrow, 4), new Object[]{"X", "#", "Y", Character.valueOf('Y'), Item.feather, Character.valueOf('X'), Item.flint, Character.valueOf('#'), Item.stick}); -+ par1CraftingManager.addRecipe(new ItemStack(Item.bow, 1), new Object[] {" #X", "# X", " #X", 'X', Item.silk, '#', Item.stick}); -+ par1CraftingManager.addRecipe(new ItemStack(Item.arrow, 4), new Object[] {"X", "#", "Y", 'Y', Item.feather, 'X', Item.flint, '#', Item.stick}); - } - } ---- net/minecraft/src/StructureVillageStart.java -+++ net/minecraft/src/StructureVillageStart.java -@@ -5,41 +5,44 @@ - import java.util.Random; - - public class StructureVillageStart extends StructureStart { -+ -+ /** well ... thats what it does */ - private boolean hasMoreThanTwoComponents; - -- public StructureVillageStart() { -- } -- -- public StructureVillageStart(World var1, Random var2, int var3, int var4, int var5) { -- super(var3, var4); -- List var6 = StructureVillagePieces.getStructureVillageWeightedPieceList(var2, var5); -- ComponentVillageStartPiece var7 = new ComponentVillageStartPiece(var1.getWorldChunkManager(), 0, var2, (var3 << 4) + 2, (var4 << 4) + 2, var6, var5); -- this.a.add(var7); -- var7.buildComponent(var7, this.a, var2); -- List var8 = var7.j; -- List var9 = var7.i; -- -+ public StructureVillageStart() {} -+ -+ public StructureVillageStart(World par1World, Random par2Random, int par3, int par4, int par5) { -+ super(par3, par4); -+ List var6 = StructureVillagePieces.getStructureVillageWeightedPieceList(par2Random, par5); -+ ComponentVillageStartPiece var7 = new ComponentVillageStartPiece(par1World.getWorldChunkManager(), 0, par2Random, (par3 << 4) + 2, (par4 << 4) + 2, var6, par5); -+ this.components.add(var7); -+ var7.buildComponent(var7, this.components, par2Random); -+ List var8 = var7.field_74930_j; -+ List var9 = var7.field_74932_i; - int var10; -- while(!var8.isEmpty() || !var9.isEmpty()) { -+ -+ while (!var8.isEmpty() || !var9.isEmpty()) { - StructureComponent var11; -- if(var8.isEmpty()) { -- var10 = var2.nextInt(var9.size()); -+ -+ if (var8.isEmpty()) { -+ var10 = par2Random.nextInt(var9.size()); - var11 = (StructureComponent)var9.remove(var10); -- var11.buildComponent(var7, this.a, var2); -+ var11.buildComponent(var7, this.components, par2Random); - } else { -- var10 = var2.nextInt(var8.size()); -+ var10 = par2Random.nextInt(var8.size()); - var11 = (StructureComponent)var8.remove(var10); -- var11.buildComponent(var7, this.a, var2); -+ var11.buildComponent(var7, this.components, par2Random); - } - } - - this.updateBoundingBox(); - var10 = 0; -- Iterator var13 = this.a.iterator(); -+ Iterator var13 = this.components.iterator(); - -- while(var13.hasNext()) { -+ while (var13.hasNext()) { - StructureComponent var12 = (StructureComponent)var13.next(); -- if(!(var12 instanceof ComponentVillageRoadPiece)) { -+ -+ if (!(var12 instanceof ComponentVillageRoadPiece)) { - ++var10; - } - } -@@ -47,13 +50,16 @@ - this.hasMoreThanTwoComponents = var10 > 2; - } - -+ /** -+ * currently only defined for Villages, returns true if Village has more than 2 non-road components -+ */ - public boolean isSizeableStructure() { - return this.hasMoreThanTwoComponents; - } - -- public void func_143022_a(NBTTagCompound var1) { -- super.func_143022_a(var1); -- var1.setBoolean("Valid", this.hasMoreThanTwoComponents); -+ public void func_143022_a(NBTTagCompound par1NBTTagCompound) { -+ super.func_143022_a(par1NBTTagCompound); -+ par1NBTTagCompound.setBoolean("Valid", this.hasMoreThanTwoComponents); - } - - public void func_143017_b(NBTTagCompound var1) { ---- net/minecraft/src/ComponentNetherBridgeCrossing.java -+++ net/minecraft/src/ComponentNetherBridgeCrossing.java -@@ -4,49 +4,58 @@ - import java.util.Random; - - public class ComponentNetherBridgeCrossing extends ComponentNetherBridgePiece { -- public ComponentNetherBridgeCrossing() { -- } -- -- public ComponentNetherBridgeCrossing(int var1, Random var2, StructureBoundingBox var3, int var4) { -- super(var1); -- this.coordBaseMode = var4; -- this.boundingBox = var3; -- } -- -- public void buildComponent(StructureComponent var1, List var2, Random var3) { -- this.getNextComponentNormal((ComponentNetherBridgeStartPiece)var1, var2, var3, 2, 0, false); -- this.getNextComponentX((ComponentNetherBridgeStartPiece)var1, var2, var3, 0, 2, false); -- this.getNextComponentZ((ComponentNetherBridgeStartPiece)var1, var2, var3, 0, 2, false); -- } -- -- public static ComponentNetherBridgeCrossing createValidComponent(List var0, Random var1, int var2, int var3, int var4, int var5, int var6) { -- StructureBoundingBox var7 = StructureBoundingBox.getComponentToAddBoundingBox(var2, var3, var4, -2, 0, 0, 7, 9, 7, var5); -- return isAboveGround(var7) && StructureComponent.findIntersecting(var0, var7) == null ? new ComponentNetherBridgeCrossing(var6, var1, var7, var5) : null; -- } -- -- public boolean addComponentParts(World var1, Random var2, StructureBoundingBox var3) { -- this.fillWithBlocks(var1, var3, 0, 0, 0, 6, 1, 6, Block.netherBrick.blockID, Block.netherBrick.blockID, false); -- this.fillWithBlocks(var1, var3, 0, 2, 0, 6, 7, 6, 0, 0, false); -- this.fillWithBlocks(var1, var3, 0, 2, 0, 1, 6, 0, Block.netherBrick.blockID, Block.netherBrick.blockID, false); -- this.fillWithBlocks(var1, var3, 0, 2, 6, 1, 6, 6, Block.netherBrick.blockID, Block.netherBrick.blockID, false); -- this.fillWithBlocks(var1, var3, 5, 2, 0, 6, 6, 0, Block.netherBrick.blockID, Block.netherBrick.blockID, false); -- this.fillWithBlocks(var1, var3, 5, 2, 6, 6, 6, 6, Block.netherBrick.blockID, Block.netherBrick.blockID, false); -- this.fillWithBlocks(var1, var3, 0, 2, 0, 0, 6, 1, Block.netherBrick.blockID, Block.netherBrick.blockID, false); -- this.fillWithBlocks(var1, var3, 0, 2, 5, 0, 6, 6, Block.netherBrick.blockID, Block.netherBrick.blockID, false); -- this.fillWithBlocks(var1, var3, 6, 2, 0, 6, 6, 1, Block.netherBrick.blockID, Block.netherBrick.blockID, false); -- this.fillWithBlocks(var1, var3, 6, 2, 5, 6, 6, 6, Block.netherBrick.blockID, Block.netherBrick.blockID, false); -- this.fillWithBlocks(var1, var3, 2, 6, 0, 4, 6, 0, Block.netherBrick.blockID, Block.netherBrick.blockID, false); -- this.fillWithBlocks(var1, var3, 2, 5, 0, 4, 5, 0, Block.netherFence.blockID, Block.netherFence.blockID, false); -- this.fillWithBlocks(var1, var3, 2, 6, 6, 4, 6, 6, Block.netherBrick.blockID, Block.netherBrick.blockID, false); -- this.fillWithBlocks(var1, var3, 2, 5, 6, 4, 5, 6, Block.netherFence.blockID, Block.netherFence.blockID, false); -- this.fillWithBlocks(var1, var3, 0, 6, 2, 0, 6, 4, Block.netherBrick.blockID, Block.netherBrick.blockID, false); -- this.fillWithBlocks(var1, var3, 0, 5, 2, 0, 5, 4, Block.netherFence.blockID, Block.netherFence.blockID, false); -- this.fillWithBlocks(var1, var3, 6, 6, 2, 6, 6, 4, Block.netherBrick.blockID, Block.netherBrick.blockID, false); -- this.fillWithBlocks(var1, var3, 6, 5, 2, 6, 5, 4, Block.netherFence.blockID, Block.netherFence.blockID, false); -- -- for(int var4 = 0; var4 <= 6; ++var4) { -- for(int var5 = 0; var5 <= 6; ++var5) { -- this.fillCurrentPositionBlocksDownwards(var1, Block.netherBrick.blockID, 0, var4, -1, var5, var3); -+ public ComponentNetherBridgeCrossing() {} -+ -+ public ComponentNetherBridgeCrossing(int par1, Random par2Random, StructureBoundingBox par3StructureBoundingBox, int par4) { -+ super(par1); -+ this.coordBaseMode = par4; -+ this.boundingBox = par3StructureBoundingBox; -+ } -+ -+ /** -+ * Initiates construction of the Structure Component picked, at the current Location of StructGen -+ */ -+ public void buildComponent(StructureComponent par1StructureComponent, List par2List, Random par3Random) { -+ this.getNextComponentNormal((ComponentNetherBridgeStartPiece)par1StructureComponent, par2List, par3Random, 2, 0, false); -+ this.getNextComponentX((ComponentNetherBridgeStartPiece)par1StructureComponent, par2List, par3Random, 0, 2, false); -+ this.getNextComponentZ((ComponentNetherBridgeStartPiece)par1StructureComponent, par2List, par3Random, 0, 2, false); -+ } -+ -+ /** -+ * Creates and returns a new component piece. Or null if it could not find enough room to place it. -+ */ -+ public static ComponentNetherBridgeCrossing createValidComponent(List par0List, Random par1Random, int par2, int par3, int par4, int par5, int par6) { -+ StructureBoundingBox var7 = StructureBoundingBox.getComponentToAddBoundingBox(par2, par3, par4, -2, 0, 0, 7, 9, 7, par5); -+ return isAboveGround(var7) && StructureComponent.findIntersecting(par0List, var7) == null ? new ComponentNetherBridgeCrossing(par6, par1Random, var7, par5) : null; -+ } -+ -+ /** -+ * second Part of Structure generating, this for example places Spiderwebs, Mob Spawners, it closes Mineshafts at the -+ * end, it adds Fences... -+ */ -+ public boolean addComponentParts(World par1World, Random par2Random, StructureBoundingBox par3StructureBoundingBox) { -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 0, 0, 0, 6, 1, 6, Block.netherBrick.blockID, Block.netherBrick.blockID, false); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 0, 2, 0, 6, 7, 6, 0, 0, false); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 0, 2, 0, 1, 6, 0, Block.netherBrick.blockID, Block.netherBrick.blockID, false); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 0, 2, 6, 1, 6, 6, Block.netherBrick.blockID, Block.netherBrick.blockID, false); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 5, 2, 0, 6, 6, 0, Block.netherBrick.blockID, Block.netherBrick.blockID, false); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 5, 2, 6, 6, 6, 6, Block.netherBrick.blockID, Block.netherBrick.blockID, false); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 0, 2, 0, 0, 6, 1, Block.netherBrick.blockID, Block.netherBrick.blockID, false); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 0, 2, 5, 0, 6, 6, Block.netherBrick.blockID, Block.netherBrick.blockID, false); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 6, 2, 0, 6, 6, 1, Block.netherBrick.blockID, Block.netherBrick.blockID, false); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 6, 2, 5, 6, 6, 6, Block.netherBrick.blockID, Block.netherBrick.blockID, false); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 2, 6, 0, 4, 6, 0, Block.netherBrick.blockID, Block.netherBrick.blockID, false); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 2, 5, 0, 4, 5, 0, Block.netherFence.blockID, Block.netherFence.blockID, false); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 2, 6, 6, 4, 6, 6, Block.netherBrick.blockID, Block.netherBrick.blockID, false); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 2, 5, 6, 4, 5, 6, Block.netherFence.blockID, Block.netherFence.blockID, false); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 0, 6, 2, 0, 6, 4, Block.netherBrick.blockID, Block.netherBrick.blockID, false); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 0, 5, 2, 0, 5, 4, Block.netherFence.blockID, Block.netherFence.blockID, false); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 6, 6, 2, 6, 6, 4, Block.netherBrick.blockID, Block.netherBrick.blockID, false); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 6, 5, 2, 6, 5, 4, Block.netherFence.blockID, Block.netherFence.blockID, false); -+ -+ for (int var4 = 0; var4 <= 6; ++var4) { -+ for (int var5 = 0; var5 <= 6; ++var5) { -+ this.fillCurrentPositionBlocksDownwards(par1World, Block.netherBrick.blockID, 0, var4, -1, var5, par3StructureBoundingBox); - } - } - ---- net/minecraft/src/EntityItem.java -+++ net/minecraft/src/EntityItem.java -@@ -2,36 +2,54 @@ - - import java.util.Iterator; - -+import net.minecraft.src.DamageSource; -+ -+import org.spoutcraft.api.Spoutcraft; -+import org.spoutcraft.api.material.CustomBlock; -+import org.spoutcraft.api.material.MaterialData; -+ - public class EntityItem extends Entity { -+ -+ /** -+ * The age of this EntityItem (used to animate it up and down as well as expire it) -+ */ - public int age; - public int delayBeforeCanPickup; -+ -+ /** The health of this EntityItem. (For example, damage for tools) */ - private int health; -+ -+ /** The EntityItem's random initial float height. */ - public float hoverStart; - -- public EntityItem(World var1, double var2, double var4, double var6) { -- super(var1); -+ public EntityItem(World par1World, double par2, double par4, double par6) { -+ super(par1World); - this.health = 5; - this.hoverStart = (float)(Math.random() * Math.PI * 2.0D); - this.setSize(0.25F, 0.25F); - this.yOffset = this.height / 2.0F; -- this.setPosition(var2, var4, var6); -+ this.setPosition(par2, par4, par6); - this.rotationYaw = (float)(Math.random() * 360.0D); -- this.motionX = (double)((float)(Math.random() * (double)0.2F - (double)0.1F)); -- this.motionY = (double)0.2F; -- this.motionZ = (double)((float)(Math.random() * (double)0.2F - (double)0.1F)); -- } -- -- public EntityItem(World var1, double var2, double var4, double var6, ItemStack var8) { -- this(var1, var2, var4, var6); -- this.setEntityItemStack(var8); -- } -- -+ this.motionX = (double)((float)(Math.random() * 0.20000000298023224D - 0.10000000149011612D)); -+ this.motionY = 0.20000000298023224D; -+ this.motionZ = (double)((float)(Math.random() * 0.20000000298023224D - 0.10000000149011612D)); -+ } -+ -+ public EntityItem(World par1World, double par2, double par4, double par6, ItemStack par8ItemStack) { -+ this(par1World, par2, par4, par6); -+ this.setEntityItemStack(par8ItemStack); -+ } -+ -+ /** -+ * returns if this entity triggers Block.onEntityWalking on the blocks they walk on. used for spiders and wolves to -+ * prevent them from trampling crops -+ */ - protected boolean canTriggerWalking() { - return false; - } - -- public EntityItem(World var1) { -- super(var1); -+ public EntityItem(World par1World) { -+ super(par1World); - this.health = 5; - this.hoverStart = (float)(Math.random() * Math.PI * 2.0D); - this.setSize(0.25F, 0.25F); -@@ -42,88 +60,117 @@ - this.getDataWatcher().addObjectByDataType(10, 5); - } - -+ /** -+ * Called to update the entity's position/logic. -+ */ - public void onUpdate() { - super.onUpdate(); -- if(this.delayBeforeCanPickup > 0) { -+ -+ if (this.delayBeforeCanPickup > 0) { - --this.delayBeforeCanPickup; - } - - this.prevPosX = this.posX; - this.prevPosY = this.posY; - this.prevPosZ = this.posZ; -- this.motionY -= (double)0.04F; -+ this.motionY -= 0.03999999910593033D; - this.noClip = this.pushOutOfBlocks(this.posX, (this.boundingBox.minY + this.boundingBox.maxY) / 2.0D, this.posZ); - this.moveEntity(this.motionX, this.motionY, this.motionZ); - boolean var1 = (int)this.prevPosX != (int)this.posX || (int)this.prevPosY != (int)this.posY || (int)this.prevPosZ != (int)this.posZ; -- if(var1 || this.ticksExisted % 25 == 0) { -- if(this.worldObj.getBlockMaterial(MathHelper.floor_double(this.posX), MathHelper.floor_double(this.posY), MathHelper.floor_double(this.posZ)) == Material.lava) { -- this.motionY = (double)0.2F; -- this.motionX = (double)((this.ab.nextFloat() - this.ab.nextFloat()) * 0.2F); -- this.motionZ = (double)((this.ab.nextFloat() - this.ab.nextFloat()) * 0.2F); -- this.playSound("random.fizz", 0.4F, 2.0F + this.ab.nextFloat() * 0.4F); -+ -+ if (var1 || this.ticksExisted % 25 == 0) { -+ if (this.worldObj.getBlockMaterial(MathHelper.floor_double(this.posX), MathHelper.floor_double(this.posY), MathHelper.floor_double(this.posZ)) == Material.lava) { -+ this.motionY = 0.20000000298023224D; -+ this.motionX = (double)((this.rand.nextFloat() - this.rand.nextFloat()) * 0.2F); -+ this.motionZ = (double)((this.rand.nextFloat() - this.rand.nextFloat()) * 0.2F); -+ this.playSound("random.fizz", 0.4F, 2.0F + this.rand.nextFloat() * 0.4F); - } - -- if(!this.worldObj.isRemote) { -+ if (!this.worldObj.isRemote) { - this.searchForOtherItemsNearby(); - } - } - - float var2 = 0.98F; -- if(this.onGround) { -- var2 = 0.1F * 0.1F * 58.8F; -+ -+ if (this.onGround) { -+ var2 = 0.58800006F; - int var3 = this.worldObj.getBlockId(MathHelper.floor_double(this.posX), MathHelper.floor_double(this.boundingBox.minY) - 1, MathHelper.floor_double(this.posZ)); -- if(var3 > 0) { -+ -+ if (var3 > 0) { - var2 = Block.blocksList[var3].slipperiness * 0.98F; -+ // Spout Start -+ if (!worldObj.isRemote) { -+ int x = MathHelper.floor_double(this.posX); -+ int y = MathHelper.floor_double(this.boundingBox.minY) - 1; -+ int z = MathHelper.floor_double(this.posZ); -+ short customId = Spoutcraft.getChunkAt(worldObj, x, y, z).getCustomBlockId(x, y, z); -+ if (customId > 0) { -+ CustomBlock block = MaterialData.getCustomBlock(customId); -+ if (block != null) { -+ var2 = block.getFriction() * 0.98F; -+ } -+ } -+ } -+ // Spout End - } - } - - this.motionX *= (double)var2; -- this.motionY *= (double)0.98F; -+ this.motionY *= 0.9800000190734863D; - this.motionZ *= (double)var2; -- if(this.onGround) { -+ -+ if (this.onGround) { - this.motionY *= -0.5D; - } - - ++this.age; -- if(!this.worldObj.isRemote && this.age >= 6000) { -+ -+ if (!this.worldObj.isRemote && this.age >= 6000) { - this.setDead(); - } -- - } - -+ /** -+ * Looks for other itemstacks nearby and tries to stack them together -+ */ - private void searchForOtherItemsNearby() { - Iterator var1 = this.worldObj.getEntitiesWithinAABB(EntityItem.class, this.boundingBox.expand(0.5D, 0.0D, 0.5D)).iterator(); - -- while(var1.hasNext()) { -+ while (var1.hasNext()) { - EntityItem var2 = (EntityItem)var1.next(); - this.combineItems(var2); - } -- - } - -- public boolean combineItems(EntityItem var1) { -- if(var1 == this) { -+ /** -+ * Tries to merge this item with the item passed as the parameter. Returns true if successful. Either this item or the -+ * other item will be removed from the world. -+ */ -+ public boolean combineItems(EntityItem par1EntityItem) { -+ if (par1EntityItem == this) { - return false; -- } else if(var1.isEntityAlive() && this.isEntityAlive()) { -+ } else if (par1EntityItem.isEntityAlive() && this.isEntityAlive()) { - ItemStack var2 = this.getEntityItem(); -- ItemStack var3 = var1.getEntityItem(); -- if(var3.getItem() != var2.getItem()) { -- return false; -- } else if(var3.hasTagCompound() ^ var2.hasTagCompound()) { -- return false; -- } else if(var3.hasTagCompound() && !var3.getTagCompound().equals(var2.getTagCompound())) { -- return false; -- } else if(var3.getItem().getHasSubtypes() && var3.getItemDamage() != var2.getItemDamage()) { -- return false; -- } else if(var3.stackSize < var2.stackSize) { -- return var1.combineItems(this); -- } else if(var3.stackSize + var2.stackSize > var3.getMaxStackSize()) { -+ ItemStack var3 = par1EntityItem.getEntityItem(); -+ -+ if (var3.getItem() != var2.getItem()) { -+ return false; -+ } else if (var3.hasTagCompound() ^ var2.hasTagCompound()) { -+ return false; -+ } else if (var3.hasTagCompound() && !var3.getTagCompound().equals(var2.getTagCompound())) { -+ return false; -+ } else if (var3.getItem().getHasSubtypes() && var3.getItemDamage() != var2.getItemDamage()) { -+ return false; -+ } else if (var3.stackSize < var2.stackSize) { -+ return par1EntityItem.combineItems(this); -+ } else if (var3.stackSize + var2.stackSize > var3.getMaxStackSize()) { - return false; - } else { - var3.stackSize += var2.stackSize; -- var1.delayBeforeCanPickup = Math.max(var1.delayBeforeCanPickup, this.delayBeforeCanPickup); -- var1.age = Math.min(var1.age, this.age); -- var1.setEntityItemStack(var3); -+ par1EntityItem.delayBeforeCanPickup = Math.max(par1EntityItem.delayBeforeCanPickup, this.delayBeforeCanPickup); -+ par1EntityItem.age = Math.min(par1EntityItem.age, this.age); -+ par1EntityItem.setEntityItemStack(var3); - this.setDead(); - return true; - } -@@ -132,27 +179,41 @@ - } - } - -+ /** -+ * sets the age of the item so that it'll despawn one minute after it has been dropped (instead of five). Used when -+ * items are dropped from players in creative mode -+ */ - public void setAgeToCreativeDespawnTime() { - this.age = 4800; - } - -+ /** -+ * Returns if this entity is in water and will end up adding the waters velocity to the entity -+ */ - public boolean handleWaterMovement() { - return this.worldObj.handleMaterialAcceleration(this.boundingBox, Material.water, this); - } - -- protected void dealFireDamage(int var1) { -- this.attackEntityFrom(DamageSource.inFire, (float)var1); -+ /** -+ * Will deal the specified amount of damage to the entity if the entity isn't immune to fire damage. Args: amountDamage -+ */ -+ protected void dealFireDamage(int par1) { -+ this.attackEntityFrom(DamageSource.inFire, (float)par1); - } - -- public boolean attackEntityFrom(DamageSource var1, float var2) { -- if(this.isEntityInvulnerable()) { -+ /** -+ * Called when the entity is attacked. -+ */ -+ public boolean attackEntityFrom(DamageSource par1DamageSource, float par2) { -+ if (this.isEntityInvulnerable()) { - return false; -- } else if(this.getEntityItem() != null && this.getEntityItem().itemID == Item.netherStar.itemID && var1.isExplosion()) { -+ } else if (this.getEntityItem() != null && this.getEntityItem().itemID == Item.netherStar.itemID && par1DamageSource.isExplosion()) { - return false; - } else { - this.setBeenAttacked(); -- this.health = (int)((float)this.health - var2); -- if(this.health <= 0) { -+ this.health = (int)((float)this.health - par2); -+ -+ if (this.health <= 0) { - this.setDead(); - } - -@@ -160,77 +221,101 @@ - } - } - -- public void writeEntityToNBT(NBTTagCompound var1) { -- var1.setShort("Health", (short)((byte)this.health)); -- var1.setShort("Age", (short)this.age); -- if(this.getEntityItem() != null) { -- var1.setCompoundTag("Item", this.getEntityItem().writeToNBT(new NBTTagCompound())); -+ /** -+ * (abstract) Protected helper method to write subclass entity data to NBT. -+ */ -+ public void writeEntityToNBT(NBTTagCompound par1NBTTagCompound) { -+ par1NBTTagCompound.setShort("Health", (short)((byte)this.health)); -+ par1NBTTagCompound.setShort("Age", (short)this.age); -+ -+ if (this.getEntityItem() != null) { -+ par1NBTTagCompound.setCompoundTag("Item", this.getEntityItem().writeToNBT(new NBTTagCompound())); - } -- - } - -- public void readEntityFromNBT(NBTTagCompound var1) { -- this.health = var1.getShort("Health") & 255; -- this.age = var1.getShort("Age"); -- NBTTagCompound var2 = var1.getCompoundTag("Item"); -+ /** -+ * (abstract) Protected helper method to read subclass entity data from NBT. -+ */ -+ public void readEntityFromNBT(NBTTagCompound par1NBTTagCompound) { -+ this.health = par1NBTTagCompound.getShort("Health") & 255; -+ this.age = par1NBTTagCompound.getShort("Age"); -+ NBTTagCompound var2 = par1NBTTagCompound.getCompoundTag("Item"); - this.setEntityItemStack(ItemStack.loadItemStackFromNBT(var2)); -- if(this.getEntityItem() == null) { -+ -+ if (this.getEntityItem() == null) { - this.setDead(); - } -- - } - -- public void onCollideWithPlayer(EntityPlayer var1) { -- if(!this.worldObj.isRemote) { -+ /** -+ * Called by a player entity when they collide with an entity -+ */ -+ public void onCollideWithPlayer(EntityPlayer par1EntityPlayer) { -+ if (!this.worldObj.isRemote) { - ItemStack var2 = this.getEntityItem(); - int var3 = var2.stackSize; -- if(this.delayBeforeCanPickup == 0 && var1.inventory.addItemStackToInventory(var2)) { -- if(var2.itemID == Block.wood.blockID) { -- var1.triggerAchievement(AchievementList.mineWood); -- } -- -- if(var2.itemID == Item.leather.itemID) { -- var1.triggerAchievement(AchievementList.killCow); -- } -- -- if(var2.itemID == Item.diamond.itemID) { -- var1.triggerAchievement(AchievementList.diamonds); -- } -- -- if(var2.itemID == Item.blazeRod.itemID) { -- var1.triggerAchievement(AchievementList.blazeRod); -- } -- -- this.playSound("random.pop", 0.2F, ((this.ab.nextFloat() - this.ab.nextFloat()) * 0.7F + 1.0F) * 2.0F); -- var1.onItemPickup(this, var3); -- if(var2.stackSize <= 0) { -+ -+ if (this.delayBeforeCanPickup == 0 && par1EntityPlayer.inventory.addItemStackToInventory(var2)) { -+ if (var2.itemID == Block.wood.blockID) { -+ par1EntityPlayer.triggerAchievement(AchievementList.mineWood); -+ } -+ -+ if (var2.itemID == Item.leather.itemID) { -+ par1EntityPlayer.triggerAchievement(AchievementList.killCow); -+ } -+ -+ if (var2.itemID == Item.diamond.itemID) { -+ par1EntityPlayer.triggerAchievement(AchievementList.diamonds); -+ } -+ -+ if (var2.itemID == Item.blazeRod.itemID) { -+ par1EntityPlayer.triggerAchievement(AchievementList.blazeRod); -+ } -+ -+ this.playSound("random.pop", 0.2F, ((this.rand.nextFloat() - this.rand.nextFloat()) * 0.7F + 1.0F) * 2.0F); -+ par1EntityPlayer.onItemPickup(this, var3); -+ -+ if (var2.stackSize <= 0) { - this.setDead(); - } - } -- - } - } - -+ /** -+ * Gets the username of the entity. -+ */ - public String getEntityName() { - return StatCollector.translateToLocal("item." + this.getEntityItem().getUnlocalizedName()); - } - -+ /** -+ * If returns false, the item will not inflict any damage against entities. -+ */ - public boolean canAttackWithItem() { - return false; - } - -- public void travelToDimension(int var1) { -- super.travelToDimension(var1); -- if(!this.worldObj.isRemote) { -+ /** -+ * Teleports the entity to another dimension. Params: Dimension number to teleport to -+ */ -+ public void travelToDimension(int par1) { -+ super.travelToDimension(par1); -+ -+ if (!this.worldObj.isRemote) { - this.searchForOtherItemsNearby(); - } -- - } - -+ /** -+ * Returns the ItemStack corresponding to the Entity (Note: if no item exists, will log an error but still return an -+ * ItemStack containing Block.stone) -+ */ - public ItemStack getEntityItem() { - ItemStack var1 = this.getDataWatcher().getWatchableObjectItemStack(10); -- if(var1 == null) { -- if(this.worldObj != null) { -+ -+ if (var1 == null) { -+ if (this.worldObj != null) { - this.worldObj.getWorldLogAgent().logSevere("Item entity " + this.entityId + " has no item?!"); - } - -@@ -240,8 +325,11 @@ - } - } - -- public void setEntityItemStack(ItemStack var1) { -- this.getDataWatcher().updateObject(10, var1); -+ /** -+ * Sets the ItemStack for this entity -+ */ -+ public void setEntityItemStack(ItemStack par1ItemStack) { -+ this.getDataWatcher().updateObject(10, par1ItemStack); - this.getDataWatcher().setObjectWatched(10); - } - } ---- /dev/null -+++ org/spoutcraft/client/gui/precache/GuiPrecache.java -@@ -1,0 +1,102 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.client.gui.precache; -+ -+import net.minecraft.src.GuiScreen; -+import net.minecraft.src.Minecraft; -+import net.minecraft.src.Packet0KeepAlive; -+ -+import org.lwjgl.opengl.GL11; -+import org.bukkit.ChatColor; -+import org.spoutcraft.api.gui.GenericLabel; -+import org.spoutcraft.api.gui.GenericTexture; -+import org.spoutcraft.api.gui.WidgetAnchor; -+import org.spoutcraft.api.gui.Texture; -+import org.spoutcraft.client.io.FileUtil; -+ -+public class GuiPrecache extends GuiScreen { -+ public GenericLabel statusText, defaultText; -+ Texture background, logo; -+ private int updateCounter; -+ -+ @Override -+ public void initGui() { -+ -+ logo = new ScaledTexture(FileUtil.getAssetsDir().getPath()+"/logo/spoutcraft.png"); -+ ((ScaledTexture) logo).setScale(Math.min(1F, (width - 135F) / 256F)); -+ logo.setGeometry((width / 2)-64, (height / 2)-60, 128, 32); -+ -+ logo.setLocal(true); -+ logo.setDrawAlphaChannel(true); -+ -+ defaultText = new GenericLabel(); -+ defaultText.setAnchor(WidgetAnchor.CENTER_CENTER); -+ defaultText.setAlign(WidgetAnchor.CENTER_CENTER); -+ defaultText.setText(ChatColor.WHITE + "Loading terrain and custom resources"); -+ // + "\n" + "\n" + ChatColor.MAGIC + "ShowMagic" -+ -+ statusText = new GenericLabel(); -+ statusText.setAnchor(WidgetAnchor.CENTER_CENTER); -+ statusText.setAlign(WidgetAnchor.CENTER_CENTER); -+ statusText.shiftYPos(20); -+ statusText.setText("Activating cached resources..."); -+ getScreen().attachWidgets("Spoutcraft", logo, defaultText, statusText); -+ } -+ -+ @Override -+ public void updateScreen() { -+ ++this.updateCounter; -+ -+ if (this.updateCounter % 20 == 0) { -+ Minecraft.getMinecraft().getNetHandler().addToSendQueue(new Packet0KeepAlive()); -+ } -+ -+ if (Minecraft.getMinecraft().getNetHandler() != null) { -+ Minecraft.getMinecraft().getNetHandler().processReadPackets(); -+ } -+ } -+ -+ @Override -+ public void drawScreen(int par1, int par2, float par3) { -+ this.drawBackground(0); -+ super.drawScreen(par1, par2, par3); -+ } -+} -+ -+class ScaledTexture extends GenericTexture { -+ float scale; -+ -+ ScaledTexture(String path) { -+ super(path); -+ } -+ -+ public ScaledTexture setScale(float scale) { -+ this.scale = scale; -+ return this; -+ } -+ -+ @Override -+ public void render() { -+ GL11.glPushMatrix(); -+ GL11.glScalef(scale, 1F, 1F); -+ super.render(); -+ GL11.glPopMatrix(); -+ } -+} ---- net/minecraft/src/CreativeTabBlock.java -+++ net/minecraft/src/CreativeTabBlock.java -@@ -1,10 +1,13 @@ - package net.minecraft.src; - - final class CreativeTabBlock extends CreativeTabs { -- CreativeTabBlock(int var1, String var2) { -- super(var1, var2); -+ CreativeTabBlock(int par1, String par2Str) { -+ super(par1, par2Str); - } - -+ /** -+ * the itemID for the item to be displayed on the tab -+ */ - public int getTabIconItemIndex() { - return Block.plantRed.blockID; - } ---- net/minecraft/src/ModelChicken.java -+++ net/minecraft/src/ModelChicken.java -@@ -40,49 +40,57 @@ - this.leftWing.setRotationPoint(4.0F, (float)(-3 + var1), 0.0F); - } - -- public void render(Entity var1, float var2, float var3, float var4, float var5, float var6, float var7) { -- this.setRotationAngles(var2, var3, var4, var5, var6, var7, var1); -- if(this.isChild) { -+ /** -+ * Sets the models various rotation angles then renders the model. -+ */ -+ public void render(Entity par1Entity, float par2, float par3, float par4, float par5, float par6, float par7) { -+ this.setRotationAngles(par2, par3, par4, par5, par6, par7, par1Entity); -+ -+ if (this.isChild) { - float var8 = 2.0F; - GL11.glPushMatrix(); -- GL11.glTranslatef(0.0F, 5.0F * var7, 2.0F * var7); -- this.head.render(var7); -- this.bill.render(var7); -- this.chin.render(var7); -+ GL11.glTranslatef(0.0F, 5.0F * par7, 2.0F * par7); -+ this.head.render(par7); -+ this.bill.render(par7); -+ this.chin.render(par7); - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glScalef(1.0F / var8, 1.0F / var8, 1.0F / var8); -- GL11.glTranslatef(0.0F, 24.0F * var7, 0.0F); -- this.body.render(var7); -- this.rightLeg.render(var7); -- this.leftLeg.render(var7); -- this.rightWing.render(var7); -- this.leftWing.render(var7); -+ GL11.glTranslatef(0.0F, 24.0F * par7, 0.0F); -+ this.body.render(par7); -+ this.rightLeg.render(par7); -+ this.leftLeg.render(par7); -+ this.rightWing.render(par7); -+ this.leftWing.render(par7); - GL11.glPopMatrix(); - } else { -- this.head.render(var7); -- this.bill.render(var7); -- this.chin.render(var7); -- this.body.render(var7); -- this.rightLeg.render(var7); -- this.leftLeg.render(var7); -- this.rightWing.render(var7); -- this.leftWing.render(var7); -+ this.head.render(par7); -+ this.bill.render(par7); -+ this.chin.render(par7); -+ this.body.render(par7); -+ this.rightLeg.render(par7); -+ this.leftLeg.render(par7); -+ this.rightWing.render(par7); -+ this.leftWing.render(par7); - } -- - } - -- public void setRotationAngles(float var1, float var2, float var3, float var4, float var5, float var6, Entity var7) { -- this.head.rotateAngleX = var5 / (180.0F / (float)Math.PI); -- this.head.rotateAngleY = var4 / (180.0F / (float)Math.PI); -+ /** -+ * Sets the model's various rotation angles. For bipeds, par1 and par2 are used for animating the movement of arms and -+ * legs, where par1 represents the time(so that arms and legs swing back and forth) and par2 represents how "far" arms -+ * and legs can swing at most. -+ */ -+ public void setRotationAngles(float par1, float par2, float par3, float par4, float par5, float par6, Entity par7Entity) { -+ this.head.rotateAngleX = par5 / (180F / (float)Math.PI); -+ this.head.rotateAngleY = par4 / (180F / (float)Math.PI); - this.bill.rotateAngleX = this.head.rotateAngleX; - this.bill.rotateAngleY = this.head.rotateAngleY; - this.chin.rotateAngleX = this.head.rotateAngleX; - this.chin.rotateAngleY = this.head.rotateAngleY; -- this.body.rotateAngleX = (float)Math.PI * 0.5F; -- this.rightLeg.rotateAngleX = MathHelper.cos(var1 * 0.6662F) * 1.4F * var2; -- this.leftLeg.rotateAngleX = MathHelper.cos(var1 * 0.6662F + (float)Math.PI) * 1.4F * var2; -- this.rightWing.rotateAngleZ = var3; -- this.leftWing.rotateAngleZ = -var3; -+ this.body.rotateAngleX = ((float)Math.PI / 2F); -+ this.rightLeg.rotateAngleX = MathHelper.cos(par1 * 0.6662F) * 1.4F * par2; -+ this.leftLeg.rotateAngleX = MathHelper.cos(par1 * 0.6662F + (float)Math.PI) * 1.4F * par2; -+ this.rightWing.rotateAngleZ = par3; -+ this.leftWing.rotateAngleZ = -par3; - } - } ---- net/minecraft/src/EnchantmentDigging.java -+++ net/minecraft/src/EnchantmentDigging.java -@@ -1,24 +1,33 @@ - package net.minecraft.src; - - public class EnchantmentDigging extends Enchantment { -- protected EnchantmentDigging(int var1, int var2) { -- super(var1, var2, EnumEnchantmentType.digger); -+ protected EnchantmentDigging(int par1, int par2) { -+ super(par1, par2, EnumEnchantmentType.digger); - this.setName("digging"); - } - -- public int getMinEnchantability(int var1) { -- return 1 + 10 * (var1 - 1); -- } -- -- public int getMaxEnchantability(int var1) { -- return super.getMinEnchantability(var1) + 50; -- } -- -+ /** -+ * Returns the minimal value of enchantability needed on the enchantment level passed. -+ */ -+ public int getMinEnchantability(int par1) { -+ return 1 + 10 * (par1 - 1); -+ } -+ -+ /** -+ * Returns the maximum value of enchantability nedded on the enchantment level passed. -+ */ -+ public int getMaxEnchantability(int par1) { -+ return super.getMinEnchantability(par1) + 50; -+ } -+ -+ /** -+ * Returns the maximum level that the enchantment can have. -+ */ - public int getMaxLevel() { - return 5; - } - -- public boolean canApply(ItemStack var1) { -- return var1.getItem().itemID == Item.shears.itemID ? true : super.canApply(var1); -+ public boolean canApply(ItemStack par1ItemStack) { -+ return par1ItemStack.getItem().itemID == Item.shears.itemID ? true : super.canApply(par1ItemStack); - } - } ---- /dev/null -+++ com/prupe/mcpatcher/ctm/TileOverrideImpl$Horizontal.java -@@ -1,0 +1,49 @@ -+package com.prupe.mcpatcher.ctm; -+ -+import com.prupe.mcpatcher.TileLoader; -+import java.util.Properties; -+import net.minecraft.src.Block; -+import net.minecraft.src.IBlockAccess; -+import net.minecraft.src.Icon; -+import net.minecraft.src.ResourceLocation; -+ -+class TileOverrideImpl$Horizontal extends TileOverride { -+ private static final int[] neighborMap = new int[] {3, 2, 0, 1}; -+ -+ TileOverrideImpl$Horizontal(ResourceLocation filePrefix, Properties properties, TileLoader tileLoader) { -+ super(filePrefix, properties, tileLoader); -+ } -+ -+ String getMethod() { -+ return "horizontal"; -+ } -+ -+ String checkTileMap() { -+ return this.getNumberOfTiles() == 4 ? null : "requires exactly 4 tiles"; -+ } -+ -+ Icon getTileImpl(IBlockAccess blockAccess, Block block, Icon origIcon, int i, int j, int k, int face) { -+ if (face < 0) { -+ face = 2; -+ } else if (this.reorient(face) <= 1) { -+ return null; -+ } -+ -+ int[][] offsets = NEIGHBOR_OFFSET[face]; -+ int neighborBits = 0; -+ -+ if (this.shouldConnect(blockAccess, block, origIcon, i, j, k, face, offsets[this.rotateUV(0)])) { -+ neighborBits |= 1; -+ } -+ -+ if (this.shouldConnect(blockAccess, block, origIcon, i, j, k, face, offsets[this.rotateUV(4)])) { -+ neighborBits |= 2; -+ } -+ -+ return this.icons[neighborMap[neighborBits]]; -+ } -+ -+ Icon getTileImpl(Block block, Icon origIcon, int face, int metadata) { -+ return this.icons[3]; -+ } -+} ---- net/minecraft/src/NBTTagIntArray.java -+++ net/minecraft/src/NBTTagIntArray.java -@@ -6,36 +6,45 @@ - import java.util.Arrays; - - public class NBTTagIntArray extends NBTBase { -+ -+ /** The array of saved integers */ - public int[] intArray; - -- public NBTTagIntArray(String var1) { -- super(var1); -- } -- -- public NBTTagIntArray(String var1, int[] var2) { -- super(var1); -- this.intArray = var2; -- } -- -- void write(DataOutput var1) throws IOException { -- var1.writeInt(this.intArray.length); -- -- for(int var2 = 0; var2 < this.intArray.length; ++var2) { -- var1.writeInt(this.intArray[var2]); -+ public NBTTagIntArray(String par1Str) { -+ super(par1Str); -+ } -+ -+ public NBTTagIntArray(String par1Str, int[] par2ArrayOfInteger) { -+ super(par1Str); -+ this.intArray = par2ArrayOfInteger; -+ } -+ -+ /** -+ * Write the actual data contents of the tag, implemented in NBT extension classes -+ */ -+ void write(DataOutput par1DataOutput) throws IOException { -+ par1DataOutput.writeInt(this.intArray.length); -+ -+ for (int var2 = 0; var2 < this.intArray.length; ++var2) { -+ par1DataOutput.writeInt(this.intArray[var2]); - } -- - } - -- void load(DataInput var1, int var2) throws IOException { -- int var3 = var1.readInt(); -+ /** -+ * Read the actual data contents of the tag, implemented in NBT extension classes -+ */ -+ void load(DataInput par1DataInput, int par2) throws IOException { -+ int var3 = par1DataInput.readInt(); - this.intArray = new int[var3]; - -- for(int var4 = 0; var4 < var3; ++var4) { -- this.intArray[var4] = var1.readInt(); -+ for (int var4 = 0; var4 < var3; ++var4) { -+ this.intArray[var4] = par1DataInput.readInt(); - } -- - } - -+ /** -+ * Gets the type byte for the tag. -+ */ - public byte getId() { - return (byte)11; - } -@@ -44,17 +53,20 @@ - return "[" + this.intArray.length + " bytes]"; - } - -+ /** -+ * Creates a clone of the tag. -+ */ - public NBTBase copy() { - int[] var1 = new int[this.intArray.length]; - System.arraycopy(this.intArray, 0, var1, 0, this.intArray.length); - return new NBTTagIntArray(this.getName(), var1); - } - -- public boolean equals(Object var1) { -- if(!super.equals(var1)) { -+ public boolean equals(Object par1Obj) { -+ if (!super.equals(par1Obj)) { - return false; - } else { -- NBTTagIntArray var2 = (NBTTagIntArray)var1; -+ NBTTagIntArray var2 = (NBTTagIntArray)par1Obj; - return this.intArray == null && var2.intArray == null || this.intArray != null && Arrays.equals(this.intArray, var2.intArray); - } - } ---- net/minecraft/src/NBTTagString.java -+++ net/minecraft/src/NBTTagString.java -@@ -5,50 +5,65 @@ - import java.io.IOException; - - public class NBTTagString extends NBTBase { -- public String a; -- -- public NBTTagString(String var1) { -- super(var1); -+ -+ /** The string value for the tag (cannot be empty). */ -+ public String data; -+ -+ public NBTTagString(String par1Str) { -+ super(par1Str); - } - -- public NBTTagString(String var1, String var2) { -- super(var1); -- this.a = var2; -- if(var2 == null) { -+ public NBTTagString(String par1Str, String par2Str) { -+ super(par1Str); -+ this.data = par2Str; -+ -+ if (par2Str == null) { - throw new IllegalArgumentException("Empty string not allowed"); - } - } - -- void write(DataOutput var1) throws IOException { -- var1.writeUTF(this.a); -- } -- -- void load(DataInput var1, int var2) throws IOException { -- this.a = var1.readUTF(); -- } -- -+ /** -+ * Write the actual data contents of the tag, implemented in NBT extension classes -+ */ -+ void write(DataOutput par1DataOutput) throws IOException { -+ par1DataOutput.writeUTF(this.data); -+ } -+ -+ /** -+ * Read the actual data contents of the tag, implemented in NBT extension classes -+ */ -+ void load(DataInput par1DataInput, int par2) throws IOException { -+ this.data = par1DataInput.readUTF(); -+ } -+ -+ /** -+ * Gets the type byte for the tag. -+ */ - public byte getId() { - return (byte)8; - } - - public String toString() { -- return "" + this.a; -+ return "" + this.data; - } - -+ /** -+ * Creates a clone of the tag. -+ */ - public NBTBase copy() { -- return new NBTTagString(this.getName(), this.a); -+ return new NBTTagString(this.getName(), this.data); - } - -- public boolean equals(Object var1) { -- if(!super.equals(var1)) { -+ public boolean equals(Object par1Obj) { -+ if (!super.equals(par1Obj)) { - return false; - } else { -- NBTTagString var2 = (NBTTagString)var1; -- return this.a == null && var2.a == null || this.a != null && this.a.equals(var2.a); -+ NBTTagString var2 = (NBTTagString)par1Obj; -+ return this.data == null && var2.data == null || this.data != null && this.data.equals(var2.data); - } - } - - public int hashCode() { -- return super.hashCode() ^ this.a.hashCode(); -+ return super.hashCode() ^ this.data.hashCode(); - } - } ---- /dev/null -+++ org/spoutcraft/api/sound/Music.java -@@ -1,0 +1,87 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.api.sound; -+ -+import java.util.HashMap; -+import java.util.Map; -+ -+public enum Music { -+ MINECRAFT_THEME(0, "calm", 0), -+ CLARK(1, "calm", 1), -+ SWEDEN(2, "calm", 2), -+ SUBWOOFER_LULLABY(3, "hal", 0), -+ LIVING_MICE(4, "hal", 1), -+ HAGGSTROM(5, "hal", 2), -+ DANNY(6, "hal", 3), -+ KEY(7, "nuance", 0), -+ OXYGENE(8, "nuance", 1), -+ DRY_HANDS(9, "piano", 0), -+ WET_HANDS(10, "piano", 1), -+ MICE_ON_VENUS(11, "piano", 2), -+ -+ CUSTOM(-1, null, -1), ; -+ -+ final int id; -+ final String name; -+ private final int soundId; -+ private static final Map lookupName = new HashMap(); -+ private static final Map lookupId = new HashMap(); -+ private static int last = 0; -+ -+ Music(final int id, final String name, final int soundId) { -+ this.id = id; -+ this.name = name; -+ this.soundId = soundId; -+ } -+ -+ public int getId() { -+ return id; -+ } -+ -+ public String getName() { -+ return name; -+ } -+ -+ public int getSoundId() { -+ return soundId; -+ } -+ -+ public static Music getMusicFromId(int id) { -+ return lookupId.get(id); -+ } -+ -+ public static Music getMusicFromName(String name) { -+ return lookupName.get(name); -+ } -+ -+ public static int getMaxId() { -+ return last; -+ } -+ -+ static { -+ for (Music i : values()) { -+ lookupName.put(i.getName() + (1 + i.getSoundId()) + ".ogg", i); -+ lookupId.put(i.getId(), i); -+ if (i.getId() > last) { -+ last = i.getId(); -+ } -+ } -+ } -+} ---- net/minecraft/src/ModelBoat.java -+++ net/minecraft/src/ModelBoat.java -@@ -23,16 +23,18 @@ - this.boatSides[3].setRotationPoint(0.0F, (float)var4, (float)(-var3 / 2 + 1)); - this.boatSides[4].addBox((float)(-var1 / 2 + 2), (float)(-var2 - 1), -1.0F, var1 - 4, var2, 2, 0.0F); - this.boatSides[4].setRotationPoint(0.0F, (float)var4, (float)(var3 / 2 - 1)); -- this.boatSides[0].rotateAngleX = (float)Math.PI * 0.5F; -- this.boatSides[1].rotateAngleY = (float)Math.PI * 3.0F / 2.0F; -- this.boatSides[2].rotateAngleY = (float)Math.PI * 0.5F; -+ this.boatSides[0].rotateAngleX = ((float)Math.PI / 2F); -+ this.boatSides[1].rotateAngleY = ((float)Math.PI * 3F / 2F); -+ this.boatSides[2].rotateAngleY = ((float)Math.PI / 2F); - this.boatSides[3].rotateAngleY = (float)Math.PI; - } - -- public void render(Entity var1, float var2, float var3, float var4, float var5, float var6, float var7) { -- for(int var8 = 0; var8 < 5; ++var8) { -- this.boatSides[var8].render(var7); -+ /** -+ * Sets the models various rotation angles then renders the model. -+ */ -+ public void render(Entity par1Entity, float par2, float par3, float par4, float par5, float par6, float par7) { -+ for (int var8 = 0; var8 < 5; ++var8) { -+ this.boatSides[var8].render(par7); - } -- - } - } ---- net/minecraft/src/ItemFood.java -+++ net/minecraft/src/ItemFood.java -@@ -1,80 +1,121 @@ - package net.minecraft.src; - - public class ItemFood extends Item { -+ -+ /** Number of ticks to run while 'EnumAction'ing until result. */ - public final int itemUseDuration; -+ -+ /** The amount this food item heals the player. */ - private final int healAmount; - private final float saturationModifier; -+ -+ /** Whether wolves like this food (true for raw and cooked porkchop). */ - private final boolean isWolfsFavoriteMeat; -+ -+ /** -+ * If this field is true, the food can be consumed even if the player don't need to eat. -+ */ - private boolean alwaysEdible; -+ -+ /** -+ * represents the potion effect that will occurr upon eating this food. Set by setPotionEffect -+ */ - private int potionId; -+ -+ /** set by setPotionEffect */ - private int potionDuration; -+ -+ /** set by setPotionEffect */ - private int potionAmplifier; -+ -+ /** probably of the set potion effect occurring */ - private float potionEffectProbability; - -- public ItemFood(int var1, int var2, float var3, boolean var4) { -- super(var1); -+ public ItemFood(int par1, int par2, float par3, boolean par4) { -+ super(par1); - this.itemUseDuration = 32; -- this.healAmount = var2; -- this.isWolfsFavoriteMeat = var4; -- this.saturationModifier = var3; -+ this.healAmount = par2; -+ this.isWolfsFavoriteMeat = par4; -+ this.saturationModifier = par3; - this.setCreativeTab(CreativeTabs.tabFood); - } - -- public ItemFood(int var1, int var2, boolean var3) { -- this(var1, var2, 0.6F, var3); -- } -- -- public ItemStack onEaten(ItemStack var1, World var2, EntityPlayer var3) { -- --var1.stackSize; -- var3.getFoodStats().addStats(this); -- var2.playSoundAtEntity(var3, "random.burp", 0.5F, var2.s.nextFloat() * 0.1F + 0.9F); -- this.onFoodEaten(var1, var2, var3); -- return var1; -- } -- -- protected void onFoodEaten(ItemStack var1, World var2, EntityPlayer var3) { -- if(!var2.isRemote && this.potionId > 0 && var2.s.nextFloat() < this.potionEffectProbability) { -- var3.addPotionEffect(new PotionEffect(this.potionId, this.potionDuration * 20, this.potionAmplifier)); -+ public ItemFood(int par1, int par2, boolean par3) { -+ this(par1, par2, 0.6F, par3); -+ } -+ -+ public ItemStack onEaten(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) { -+ --par1ItemStack.stackSize; -+ par3EntityPlayer.getFoodStats().addStats(this); -+ par2World.playSoundAtEntity(par3EntityPlayer, "random.burp", 0.5F, par2World.rand.nextFloat() * 0.1F + 0.9F); -+ this.onFoodEaten(par1ItemStack, par2World, par3EntityPlayer); -+ return par1ItemStack; -+ } -+ -+ protected void onFoodEaten(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) { -+ if (!par2World.isRemote && this.potionId > 0 && par2World.rand.nextFloat() < this.potionEffectProbability) { -+ par3EntityPlayer.addPotionEffect(new PotionEffect(this.potionId, this.potionDuration * 20, this.potionAmplifier)); - } -- - } - -- public int getMaxItemUseDuration(ItemStack var1) { -+ /** -+ * How long it takes to use or consume an item -+ */ -+ public int getMaxItemUseDuration(ItemStack par1ItemStack) { - return 32; - } - -- public EnumAction getItemUseAction(ItemStack var1) { -+ /** -+ * returns the action that specifies what animation to play when the items is being used -+ */ -+ public EnumAction getItemUseAction(ItemStack par1ItemStack) { - return EnumAction.eat; - } - -- public ItemStack onItemRightClick(ItemStack var1, World var2, EntityPlayer var3) { -- if(var3.canEat(this.alwaysEdible)) { -- var3.setItemInUse(var1, this.getMaxItemUseDuration(var1)); -+ /** -+ * Called whenever this item is equipped and the right mouse button is pressed. Args: itemStack, world, entityPlayer -+ */ -+ public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) { -+ if (par3EntityPlayer.canEat(this.alwaysEdible)) { -+ par3EntityPlayer.setItemInUse(par1ItemStack, this.getMaxItemUseDuration(par1ItemStack)); - } - -- return var1; -+ return par1ItemStack; - } - - public int getHealAmount() { - return this.healAmount; - } - -+ /** -+ * gets the saturationModifier of the ItemFood -+ */ - public float getSaturationModifier() { - return this.saturationModifier; - } - -+ /** -+ * Whether wolves like this food (true for raw and cooked porkchop). -+ */ - public boolean isWolfsFavoriteMeat() { - return this.isWolfsFavoriteMeat; - } - -- public ItemFood setPotionEffect(int var1, int var2, int var3, float var4) { -- this.potionId = var1; -- this.potionDuration = var2; -- this.potionAmplifier = var3; -- this.potionEffectProbability = var4; -+ /** -+ * sets a potion effect on the item. Args: int potionId, int duration (will be multiplied by 20), int amplifier, float -+ * probability of effect happening -+ */ -+ public ItemFood setPotionEffect(int par1, int par2, int par3, float par4) { -+ this.potionId = par1; -+ this.potionDuration = par2; -+ this.potionAmplifier = par3; -+ this.potionEffectProbability = par4; - return this; - } - -+ /** -+ * Set the field 'alwaysEdible' to true, and make the food edible even if the player don't need to eat. -+ */ - public ItemFood setAlwaysEdible() { - this.alwaysEdible = true; - return this; ---- net/minecraft/src/GuiBeaconButtonPower.java -+++ net/minecraft/src/GuiBeaconButtonPower.java -@@ -3,21 +3,24 @@ - class GuiBeaconButtonPower extends GuiBeaconButton { - private final int field_82261_l; - private final int field_82262_m; -+ -+ /** Beacon GUI this button belongs to. */ - final GuiBeacon beaconGui; - -- public GuiBeaconButtonPower(GuiBeacon var1, int var2, int var3, int var4, int var5, int var6) { -- super(var2, var3, var4, GuiContainer.field_110408_a, 0 + Potion.potionTypes[var5].getStatusIconIndex() % 8 * 18, 198 + Potion.potionTypes[var5].getStatusIconIndex() / 8 * 18); -- this.beaconGui = var1; -- this.field_82261_l = var5; -- this.field_82262_m = var6; -+ public GuiBeaconButtonPower(GuiBeacon par1GuiBeacon, int par2, int par3, int par4, int par5, int par6) { -+ super(par2, par3, par4, GuiContainer.field_110408_a, 0 + Potion.potionTypes[par5].getStatusIconIndex() % 8 * 18, 198 + Potion.potionTypes[par5].getStatusIconIndex() / 8 * 18); -+ this.beaconGui = par1GuiBeacon; -+ this.field_82261_l = par5; -+ this.field_82262_m = par6; - } - -- public void func_82251_b(int var1, int var2) { -+ public void func_82251_b(int par1, int par2) { - String var3 = I18n.getString(Potion.potionTypes[this.field_82261_l].getName()); -- if(this.field_82262_m >= 3 && this.field_82261_l != Potion.regeneration.id) { -+ -+ if (this.field_82262_m >= 3 && this.field_82261_l != Potion.regeneration.id) { - var3 = var3 + " II"; - } - -- this.beaconGui.drawCreativeTabHoveringText(var3, var1, var2); -+ this.beaconGui.drawCreativeTabHoveringText(var3, par1, par2); - } - } ---- net/minecraft/src/ICrafting.java -+++ net/minecraft/src/ICrafting.java -@@ -3,9 +3,18 @@ - import java.util.List; - - public interface ICrafting { -- void updateCraftingInventory(Container var1, List var2); -+ void sendContainerAndContentsToPlayer(Container var1, List var2); - -+ /** -+ * Sends the contents of an inventory slot to the client-side Container. This doesn't have to match the actual contents -+ * of that slot. Args: Container, slot number, slot contents -+ */ - void sendSlotContents(Container var1, int var2, ItemStack var3); - -+ /** -+ * Sends two ints to the client-side Container. Used for furnace burning time, smelting progress, brewing progress, and -+ * enchanting level. Normally the first int identifies which variable to update, and the second contains the new value. -+ * Both are truncated to shorts in non-local SMP. -+ */ - void sendProgressBarUpdate(Container var1, int var2, int var3); - } ---- net/minecraft/src/BiomeGenHills.java -+++ net/minecraft/src/BiomeGenHills.java -@@ -3,35 +3,36 @@ - import java.util.Random; - - public class BiomeGenHills extends BiomeGenBase { -- private WorldGenerator theWorldGenerator = new WorldGenMinable(Block.silverfish.blockID, 8); -+ private WorldGenerator theWorldGenerator; - -- protected BiomeGenHills(int var1) { -- super(var1); -+ protected BiomeGenHills(int par1) { -+ super(par1); -+ this.theWorldGenerator = new WorldGenMinable(Block.silverfish.blockID, 8); - } - -- public void decorate(World var1, Random var2, int var3, int var4) { -- super.decorate(var1, var2, var3, var4); -- int var5 = 3 + var2.nextInt(6); -- -+ public void decorate(World par1World, Random par2Random, int par3, int par4) { -+ super.decorate(par1World, par2Random, par3, par4); -+ int var5 = 3 + par2Random.nextInt(6); - int var6; - int var7; - int var8; -- for(var6 = 0; var6 < var5; ++var6) { -- var7 = var3 + var2.nextInt(16); -- var8 = var2.nextInt(28) + 4; -- int var9 = var4 + var2.nextInt(16); -- int var10 = var1.getBlockId(var7, var8, var9); -- if(var10 == Block.stone.blockID) { -- var1.setBlock(var7, var8, var9, Block.oreEmerald.blockID, 0, 2); -+ -+ for (var6 = 0; var6 < var5; ++var6) { -+ var7 = par3 + par2Random.nextInt(16); -+ var8 = par2Random.nextInt(28) + 4; -+ int var9 = par4 + par2Random.nextInt(16); -+ int var10 = par1World.getBlockId(var7, var8, var9); -+ -+ if (var10 == Block.stone.blockID) { -+ par1World.setBlock(var7, var8, var9, Block.oreEmerald.blockID, 0, 2); - } - } - -- for(var5 = 0; var5 < 7; ++var5) { -- var6 = var3 + var2.nextInt(16); -- var7 = var2.nextInt(64); -- var8 = var4 + var2.nextInt(16); -- this.theWorldGenerator.generate(var1, var2, var6, var7, var8); -+ for (var5 = 0; var5 < 7; ++var5) { -+ var6 = par3 + par2Random.nextInt(16); -+ var7 = par2Random.nextInt(64); -+ var8 = par4 + par2Random.nextInt(16); -+ this.theWorldGenerator.generate(par1World, par2Random, var6, var7, var8); - } -- - } - } ---- /dev/null -+++ org/spoutcraft/client/gui/controls/ControlsBasicItem.java -@@ -1,0 +1,83 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.client.gui.controls; -+ -+import org.spoutcraft.api.gui.ListWidget; -+import org.spoutcraft.api.gui.ListWidgetItem; -+ -+public abstract class ControlsBasicItem implements ListWidgetItem { -+ private ListWidget widget; -+ protected ControlsModel model; -+ private boolean conflicts = false; -+ -+ public ControlsBasicItem(ControlsModel model) { -+ this.model = model; -+ } -+ -+ public ListWidget getListWidget() { -+ return widget; -+ } -+ -+ public void onClick(int x, int y, boolean doubleClick) { -+ model.onItemClicked(this, doubleClick); -+ } -+ -+ public void setListWidget(ListWidget widget) { -+ this.widget = widget; -+ } -+ -+ public abstract void setKey(int id); -+ public abstract int getKey(); -+ -+ public boolean conflicts(ControlsBasicItem other) { -+ // TODO Better handling for modifiers -+ return getKey() != -128 && getKey() == other.getKey() && getModifiers() == other.getModifiers(); -+ } -+ -+ /** -+ * Tell if this item accepts modifier keys such as SHIFT, CONTROL or ALT. -+ * @return true, if the item accepts modifier keys. -+ */ -+ public abstract boolean useModifiers(); -+ -+ /** -+ * Tell if this item accepts mouse buttons to summon the action -+ * @return true, if the item accepts mouse buttons -+ */ -+ public abstract boolean useMouseButtons(); -+ -+ public void setConflicting(boolean c) { -+ this.conflicts = c; -+ } -+ -+ public void setModifiers(int m) { -+ // Unused -+ } -+ -+ public int getModifiers() { -+ return 0; -+ } -+ -+ public abstract String getName(); -+ -+ public boolean isConflicting() { -+ return conflicts; -+ } -+} ---- net/minecraft/src/RenderBlocks.java -+++ net/minecraft/src/RenderBlocks.java -@@ -3,19 +3,63 @@ - import org.lwjgl.opengl.GL11; - import org.lwjgl.opengl.GL12; - -+import com.prupe.mcpatcher.TessellatorUtils; -+import com.prupe.mcpatcher.cc.ColorizeBlock; -+import com.prupe.mcpatcher.cc.Colorizer; -+import com.prupe.mcpatcher.ctm.CTMUtils; -+import com.prupe.mcpatcher.ctm.GlassPaneRenderer; -+import com.prupe.mcpatcher.ctm.RenderPass; -+ -+import org.spoutcraft.client.config.Configuration; -+ -+//Spout Start -+//Spout End -+ - public class RenderBlocks { -+ -+ /** The IBlockAccess used by this instance of RenderBlocks */ - public IBlockAccess blockAccess; -+ -+ /** -+ * If set to >=0, all block faces will be rendered using this texture index -+ */ - private Icon overrideBlockTexture; -+ -+ /** -+ * Set to true if the texture should be flipped horizontally during render*Face -+ */ - private boolean flipTexture; -+ -+ /** -+ * If true, renders all faces on all blocks rather than using the logic in Block.shouldSideBeRendered. Unused. -+ */ - private boolean renderAllFaces; -+ -+ /** Fancy grass side matching biome */ - public static boolean fancyGrass = true; - public boolean useInventoryTint = true; -+ -+ /** The minimum X value for rendering (default 0.0). */ - private double renderMinX; -+ -+ /** The maximum X value for rendering (default 1.0). */ - private double renderMaxX; -+ -+ /** The minimum Y value for rendering (default 0.0). */ - private double renderMinY; -+ -+ /** The maximum Y value for rendering (default 1.0). */ - private double renderMaxY; -+ -+ /** The minimum Z value for rendering (default 0.0). */ - private double renderMinZ; -+ -+ /** The maximum Z value for rendering (default 1.0). */ - private double renderMaxZ; -+ -+ /** -+ * Set by overrideBlockBounds, to keep this class from changing the visual bounding box. -+ */ - private boolean lockBlockBounds; - private boolean partialRenderBounds; - private final Minecraft minecraftRB; -@@ -25,66 +69,224 @@ - private int uvRotateNorth; - private int uvRotateTop; - private int uvRotateBottom; -+ -+ /** Whether ambient occlusion is enabled or not */ - private boolean enableAO; -+ -+ /** -+ * Used as a scratch variable for ambient occlusion on the north/bottom/east corner. -+ */ - private float aoLightValueScratchXYZNNN; -+ -+ /** -+ * Used as a scratch variable for ambient occlusion between the bottom face and the north face. -+ */ - private float aoLightValueScratchXYNN; -+ -+ /** -+ * Used as a scratch variable for ambient occlusion on the north/bottom/west corner. -+ */ - private float aoLightValueScratchXYZNNP; -+ -+ /** -+ * Used as a scratch variable for ambient occlusion between the bottom face and the east face. -+ */ - private float aoLightValueScratchYZNN; -+ -+ /** -+ * Used as a scratch variable for ambient occlusion between the bottom face and the west face. -+ */ - private float aoLightValueScratchYZNP; -+ -+ /** -+ * Used as a scratch variable for ambient occlusion on the south/bottom/east corner. -+ */ - private float aoLightValueScratchXYZPNN; -+ -+ /** -+ * Used as a scratch variable for ambient occlusion between the bottom face and the south face. -+ */ - private float aoLightValueScratchXYPN; -+ -+ /** -+ * Used as a scratch variable for ambient occlusion on the south/bottom/west corner. -+ */ - private float aoLightValueScratchXYZPNP; -+ -+ /** -+ * Used as a scratch variable for ambient occlusion on the north/top/east corner. -+ */ - private float aoLightValueScratchXYZNPN; -+ -+ /** -+ * Used as a scratch variable for ambient occlusion between the top face and the north face. -+ */ - private float aoLightValueScratchXYNP; -+ -+ /** -+ * Used as a scratch variable for ambient occlusion on the north/top/west corner. -+ */ - private float aoLightValueScratchXYZNPP; -+ -+ /** -+ * Used as a scratch variable for ambient occlusion between the top face and the east face. -+ */ - private float aoLightValueScratchYZPN; -+ -+ /** -+ * Used as a scratch variable for ambient occlusion on the south/top/east corner. -+ */ - private float aoLightValueScratchXYZPPN; -+ -+ /** -+ * Used as a scratch variable for ambient occlusion between the top face and the south face. -+ */ - private float aoLightValueScratchXYPP; -+ -+ /** -+ * Used as a scratch variable for ambient occlusion between the top face and the west face. -+ */ - private float aoLightValueScratchYZPP; -+ -+ /** -+ * Used as a scratch variable for ambient occlusion on the south/top/west corner. -+ */ - private float aoLightValueScratchXYZPPP; -+ -+ /** -+ * Used as a scratch variable for ambient occlusion between the north face and the east face. -+ */ - private float aoLightValueScratchXZNN; -+ -+ /** -+ * Used as a scratch variable for ambient occlusion between the south face and the east face. -+ */ - private float aoLightValueScratchXZPN; -+ -+ /** -+ * Used as a scratch variable for ambient occlusion between the north face and the west face. -+ */ - private float aoLightValueScratchXZNP; -+ -+ /** -+ * Used as a scratch variable for ambient occlusion between the south face and the west face. -+ */ - private float aoLightValueScratchXZPP; -+ -+ /** Ambient occlusion brightness XYZNNN */ - private int aoBrightnessXYZNNN; -+ -+ /** Ambient occlusion brightness XYNN */ - private int aoBrightnessXYNN; -+ -+ /** Ambient occlusion brightness XYZNNP */ - private int aoBrightnessXYZNNP; -+ -+ /** Ambient occlusion brightness YZNN */ - private int aoBrightnessYZNN; -+ -+ /** Ambient occlusion brightness YZNP */ - private int aoBrightnessYZNP; -+ -+ /** Ambient occlusion brightness XYZPNN */ - private int aoBrightnessXYZPNN; -+ -+ /** Ambient occlusion brightness XYPN */ - private int aoBrightnessXYPN; -+ -+ /** Ambient occlusion brightness XYZPNP */ - private int aoBrightnessXYZPNP; -+ -+ /** Ambient occlusion brightness XYZNPN */ - private int aoBrightnessXYZNPN; -+ -+ /** Ambient occlusion brightness XYNP */ - private int aoBrightnessXYNP; -+ -+ /** Ambient occlusion brightness XYZNPP */ - private int aoBrightnessXYZNPP; -+ -+ /** Ambient occlusion brightness YZPN */ - private int aoBrightnessYZPN; -+ -+ /** Ambient occlusion brightness XYZPPN */ - private int aoBrightnessXYZPPN; -+ -+ /** Ambient occlusion brightness XYPP */ - private int aoBrightnessXYPP; -+ -+ /** Ambient occlusion brightness YZPP */ - private int aoBrightnessYZPP; -+ -+ /** Ambient occlusion brightness XYZPPP */ - private int aoBrightnessXYZPPP; -+ -+ /** Ambient occlusion brightness XZNN */ - private int aoBrightnessXZNN; -+ -+ /** Ambient occlusion brightness XZPN */ - private int aoBrightnessXZPN; -+ -+ /** Ambient occlusion brightness XZNP */ - private int aoBrightnessXZNP; -+ -+ /** Ambient occlusion brightness XZPP */ - private int aoBrightnessXZPP; -+ -+ /** Brightness top left */ - private int brightnessTopLeft; -+ -+ /** Brightness bottom left */ - private int brightnessBottomLeft; -+ -+ /** Brightness bottom right */ - private int brightnessBottomRight; -+ -+ /** Brightness top right */ - private int brightnessTopRight; -+ -+ /** Red color value for the top left corner */ - private float colorRedTopLeft; -+ -+ /** Red color value for the bottom left corner */ - private float colorRedBottomLeft; -+ -+ /** Red color value for the bottom right corner */ - private float colorRedBottomRight; -+ -+ /** Red color value for the top right corner */ - private float colorRedTopRight; -+ -+ /** Green color value for the top left corner */ - private float colorGreenTopLeft; -+ -+ /** Green color value for the bottom left corner */ - private float colorGreenBottomLeft; -+ -+ /** Green color value for the bottom right corner */ - private float colorGreenBottomRight; -+ -+ /** Green color value for the top right corner */ - private float colorGreenTopRight; -+ -+ /** Blue color value for the top left corner */ - private float colorBlueTopLeft; -+ -+ /** Blue color value for the bottom left corner */ - private float colorBlueBottomLeft; -+ -+ /** Blue color value for the bottom right corner */ - private float colorBlueBottomRight; -+ -+ /** Blue color value for the top right corner */ - private float colorBlueTopRight; - -- public RenderBlocks(IBlockAccess var1) { -- this.blockAccess = var1; -+ // Spout Start -+ public short[] customIds = null; -+ // Spout End -+ -+ public RenderBlocks(IBlockAccess par1IBlockAccess) { -+ this.blockAccess = par1IBlockAccess; - this.minecraftRB = Minecraft.getMinecraft(); - } - -@@ -92,10 +294,16 @@ - this.minecraftRB = Minecraft.getMinecraft(); - } - -- public void setOverrideBlockTexture(Icon var1) { -- this.overrideBlockTexture = var1; -+ /** -+ * Sets overrideBlockTexture -+ */ -+ public void setOverrideBlockTexture(Icon par1Icon) { -+ this.overrideBlockTexture = par1Icon; - } - -+ /** -+ * Clear override block texture -+ */ - public void clearOverrideBlockTexture() { - this.overrideBlockTexture = null; - } -@@ -104,93 +312,118 @@ - return this.overrideBlockTexture != null; - } - -- public void setRenderBounds(double var1, double var3, double var5, double var7, double var9, double var11) { -- if(!this.lockBlockBounds) { -- this.renderMinX = var1; -- this.renderMaxX = var7; -- this.renderMinY = var3; -- this.renderMaxY = var9; -- this.renderMinZ = var5; -- this.renderMaxZ = var11; -- this.partialRenderBounds = this.minecraftRB.gameSettings.ambientOcclusion >= 2 && (this.renderMinX > 0.0D || this.renderMaxX < 1.0D || this.renderMinY > 0.0D || this.renderMaxY < 1.0D || this.renderMinZ > 0.0D || this.renderMaxZ < 1.0D); -- } -- -- } -- -- public void setRenderBoundsFromBlock(Block var1) { -- if(!this.lockBlockBounds) { -- this.renderMinX = var1.getMinX(); -- this.renderMaxX = var1.getBlockBoundsMaxX(); -- this.renderMinY = var1.getBlockBoundsMinY(); -- this.renderMaxY = var1.getBlockBoundsMaxY(); -- this.renderMinZ = var1.getBlockBoundsMinZ(); -- this.renderMaxZ = var1.getBlockBoundsMaxZ(); -- this.partialRenderBounds = this.minecraftRB.gameSettings.ambientOcclusion >= 2 && (this.renderMinX > 0.0D || this.renderMaxX < 1.0D || this.renderMinY > 0.0D || this.renderMaxY < 1.0D || this.renderMinZ > 0.0D || this.renderMaxZ < 1.0D); -- } -- -- } -- -- public void overrideBlockBounds(double var1, double var3, double var5, double var7, double var9, double var11) { -- this.renderMinX = var1; -- this.renderMaxX = var7; -- this.renderMinY = var3; -- this.renderMaxY = var9; -- this.renderMinZ = var5; -- this.renderMaxZ = var11; -+ /** -+ * Sets the bounding box for the block to draw in, e.g. 0.25-0.75 on all axes for a half-size, centered block. -+ */ -+ public void setRenderBounds(double par1, double par3, double par5, double par7, double par9, double par11) { -+ if (!this.lockBlockBounds) { -+ this.renderMinX = par1; -+ this.renderMaxX = par7; -+ this.renderMinY = par3; -+ this.renderMaxY = par9; -+ this.renderMinZ = par5; -+ this.renderMaxZ = par11; -+ this.partialRenderBounds = this.minecraftRB.gameSettings.ambientOcclusion >= 2 && (this.renderMinX > 0.0D || this.renderMaxX < 1.0D || this.renderMinY > 0.0D || this.renderMaxY < 1.0D || this.renderMinZ > 0.0D || this.renderMaxZ < 1.0D); -+ } -+ } -+ -+ /** -+ * Like setRenderBounds, but automatically pulling the bounds from the given Block. -+ */ -+ public void setRenderBoundsFromBlock(Block par1Block) { -+ if (!this.lockBlockBounds) { -+ this.renderMinX = par1Block.getBlockBoundsMinX(); -+ this.renderMaxX = par1Block.getBlockBoundsMaxX(); -+ this.renderMinY = par1Block.getBlockBoundsMinY(); -+ this.renderMaxY = par1Block.getBlockBoundsMaxY(); -+ this.renderMinZ = par1Block.getBlockBoundsMinZ(); -+ this.renderMaxZ = par1Block.getBlockBoundsMaxZ(); -+ this.partialRenderBounds = this.minecraftRB.gameSettings.ambientOcclusion >= 2 && (this.renderMinX > 0.0D || this.renderMaxX < 1.0D || this.renderMinY > 0.0D || this.renderMaxY < 1.0D || this.renderMinZ > 0.0D || this.renderMaxZ < 1.0D); -+ } -+ } -+ -+ /** -+ * Like setRenderBounds, but locks the values so that RenderBlocks won't change them. If you use this, you must call -+ * unlockBlockBounds after you finish rendering! -+ */ -+ public void overrideBlockBounds(double par1, double par3, double par5, double par7, double par9, double par11) { -+ this.renderMinX = par1; -+ this.renderMaxX = par7; -+ this.renderMinY = par3; -+ this.renderMaxY = par9; -+ this.renderMinZ = par5; -+ this.renderMaxZ = par11; - this.lockBlockBounds = true; - this.partialRenderBounds = this.minecraftRB.gameSettings.ambientOcclusion >= 2 && (this.renderMinX > 0.0D || this.renderMaxX < 1.0D || this.renderMinY > 0.0D || this.renderMaxY < 1.0D || this.renderMinZ > 0.0D || this.renderMaxZ < 1.0D); - } - -+ /** -+ * Unlocks the visual bounding box so that RenderBlocks can change it again. -+ */ - public void unlockBlockBounds() { - this.lockBlockBounds = false; - } - -- public void renderBlockUsingTexture(Block var1, int var2, int var3, int var4, Icon var5) { -- this.setOverrideBlockTexture(var5); -- this.renderBlockByRenderType(var1, var2, var3, var4); -+ /** -+ * Renders a block using the given texture instead of the block's own default texture -+ */ -+ public void renderBlockUsingTexture(Block par1Block, int par2, int par3, int par4, Icon par5Icon) { -+ this.setOverrideBlockTexture(par5Icon); -+ this.renderBlockByRenderType(par1Block, par2, par3, par4); - this.clearOverrideBlockTexture(); - } - -- public void renderBlockAllFaces(Block var1, int var2, int var3, int var4) { -+ /** -+ * Render all faces of a block -+ */ -+ public void renderBlockAllFaces(Block par1Block, int par2, int par3, int par4) { - this.renderAllFaces = true; -- this.renderBlockByRenderType(var1, var2, var3, var4); -+ this.renderBlockByRenderType(par1Block, par2, par3, par4); - this.renderAllFaces = false; - } - -- public boolean renderBlockByRenderType(Block var1, int var2, int var3, int var4) { -- int var5 = var1.getRenderType(); -- if(var5 == -1) { -+ /** -+ * Renders the block at the given coordinates using the block's rendering type -+ */ -+ public boolean renderBlockByRenderType(Block par1Block, int par2, int par3, int par4) { -+ int var5 = par1Block.getRenderType(); -+ -+ if (var5 == -1) { - return false; - } else { -- var1.setBlockBoundsBasedOnState(this.blockAccess, var2, var3, var4); -- this.setRenderBoundsFromBlock(var1); -- return var5 == 0 ? this.renderStandardBlock(var1, var2, var3, var4) : (var5 == 4 ? this.renderBlockFluids(var1, var2, var3, var4) : (var5 == 31 ? this.renderBlockLog(var1, var2, var3, var4) : (var5 == 1 ? this.renderCrossedSquares(var1, var2, var3, var4) : (var5 == 2 ? this.renderBlockTorch(var1, var2, var3, var4) : (var5 == 20 ? this.renderBlockVine(var1, var2, var3, var4) : (var5 == 11 ? this.renderBlockFence((BlockFence)var1, var2, var3, var4) : (var5 == 39 ? this.renderBlockQuartz(var1, var2, var3, var4) : (var5 == 5 ? this.renderBlockRedstoneWire(var1, var2, var3, var4) : (var5 == 13 ? this.renderBlockCactus(var1, var2, var3, var4) : (var5 == 9 ? this.renderBlockMinecartTrack((BlockRailBase)var1, var2, var3, var4) : (var5 == 19 ? this.renderBlockStem(var1, var2, var3, var4) : (var5 == 23 ? this.renderBlockLilyPad(var1, var2, var3, var4) : (var5 == 6 ? this.renderBlockCrops(var1, var2, var3, var4) : (var5 == 3 ? this.renderBlockFire((BlockFire)var1, var2, var3, var4) : (var5 == 8 ? this.renderBlockLadder(var1, var2, var3, var4) : (var5 == 7 ? this.renderBlockDoor(var1, var2, var3, var4) : (var5 == 10 ? this.renderBlockStairs((BlockStairs)var1, var2, var3, var4) : (var5 == 27 ? this.renderBlockDragonEgg((BlockDragonEgg)var1, var2, var3, var4) : (var5 == 32 ? this.renderBlockWall((BlockWall)var1, var2, var3, var4) : (var5 == 12 ? this.renderBlockLever(var1, var2, var3, var4) : (var5 == 29 ? this.renderBlockTripWireSource(var1, var2, var3, var4) : (var5 == 30 ? this.renderBlockTripWire(var1, var2, var3, var4) : (var5 == 14 ? this.renderBlockBed(var1, var2, var3, var4) : (var5 == 15 ? this.renderBlockRepeater((BlockRedstoneRepeater)var1, var2, var3, var4) : (var5 == 36 ? this.renderBlockRedstoneLogic((BlockRedstoneLogic)var1, var2, var3, var4) : (var5 == 37 ? this.renderBlockComparator((BlockComparator)var1, var2, var3, var4) : (var5 == 16 ? this.renderPistonBase(var1, var2, var3, var4, false) : (var5 == 17 ? this.renderPistonExtension(var1, var2, var3, var4, true) : (var5 == 18 ? this.renderBlockPane((BlockPane)var1, var2, var3, var4) : (var5 == 21 ? this.renderBlockFenceGate((BlockFenceGate)var1, var2, var3, var4) : (var5 == 24 ? this.renderBlockCauldron((BlockCauldron)var1, var2, var3, var4) : (var5 == 33 ? this.renderBlockFlowerpot((BlockFlowerPot)var1, var2, var3, var4) : (var5 == 35 ? this.renderBlockAnvil((BlockAnvil)var1, var2, var3, var4) : (var5 == 25 ? this.renderBlockBrewingStand((BlockBrewingStand)var1, var2, var3, var4) : (var5 == 26 ? this.renderBlockEndPortalFrame((BlockEndPortalFrame)var1, var2, var3, var4) : (var5 == 28 ? this.renderBlockCocoa((BlockCocoa)var1, var2, var3, var4) : (var5 == 34 ? this.renderBlockBeacon((BlockBeacon)var1, var2, var3, var4) : (var5 == 38 ? this.renderBlockHopper((BlockHopper)var1, var2, var3, var4) : false)))))))))))))))))))))))))))))))))))))); -+ par1Block.setBlockBoundsBasedOnState(this.blockAccess, par2, par3, par4); -+ this.setRenderBoundsFromBlock(par1Block); -+ return var5 == 0 ? this.renderStandardBlock(par1Block, par2, par3, par4) : (var5 == 4 ? this.renderBlockFluids(par1Block, par2, par3, par4) : (var5 == 31 ? this.renderBlockLog(par1Block, par2, par3, par4) : (var5 == 1 ? this.renderCrossedSquares(par1Block, par2, par3, par4) : (var5 == 2 ? this.renderBlockTorch(par1Block, par2, par3, par4) : (var5 == 20 ? this.renderBlockVine(par1Block, par2, par3, par4) : (var5 == 11 ? this.renderBlockFence((BlockFence)par1Block, par2, par3, par4) : (var5 == 39 ? this.renderBlockQuartz(par1Block, par2, par3, par4) : (var5 == 5 ? this.renderBlockRedstoneWire(par1Block, par2, par3, par4) : (var5 == 13 ? this.renderBlockCactus(par1Block, par2, par3, par4) : (var5 == 9 ? this.renderBlockMinecartTrack((BlockRailBase)par1Block, par2, par3, par4) : (var5 == 19 ? this.renderBlockStem(par1Block, par2, par3, par4) : (var5 == 23 ? this.renderBlockLilyPad(par1Block, par2, par3, par4) : (var5 == 6 ? this.renderBlockCrops(par1Block, par2, par3, par4) : (var5 == 3 ? this.renderBlockFire((BlockFire)par1Block, par2, par3, par4) : (var5 == 8 ? this.renderBlockLadder(par1Block, par2, par3, par4) : (var5 == 7 ? this.renderBlockDoor(par1Block, par2, par3, par4) : (var5 == 10 ? this.renderBlockStairs((BlockStairs)par1Block, par2, par3, par4) : (var5 == 27 ? this.renderBlockDragonEgg((BlockDragonEgg)par1Block, par2, par3, par4) : (var5 == 32 ? this.renderBlockWall((BlockWall)par1Block, par2, par3, par4) : (var5 == 12 ? this.renderBlockLever(par1Block, par2, par3, par4) : (var5 == 29 ? this.renderBlockTripWireSource(par1Block, par2, par3, par4) : (var5 == 30 ? this.renderBlockTripWire(par1Block, par2, par3, par4) : (var5 == 14 ? this.renderBlockBed(par1Block, par2, par3, par4) : (var5 == 15 ? this.renderBlockRepeater((BlockRedstoneRepeater)par1Block, par2, par3, par4) : (var5 == 36 ? this.renderBlockRedstoneLogic((BlockRedstoneLogic)par1Block, par2, par3, par4) : (var5 == 37 ? this.renderBlockComparator((BlockComparator)par1Block, par2, par3, par4) : (var5 == 16 ? this.renderPistonBase(par1Block, par2, par3, par4, false) : (var5 == 17 ? this.renderPistonExtension(par1Block, par2, par3, par4, true) : (var5 == 18 ? this.renderBlockPane((BlockPane)par1Block, par2, par3, par4) : (var5 == 21 ? this.renderBlockFenceGate((BlockFenceGate)par1Block, par2, par3, par4) : (var5 == 24 ? this.renderBlockCauldron((BlockCauldron)par1Block, par2, par3, par4) : (var5 == 33 ? this.renderBlockFlowerpot((BlockFlowerPot)par1Block, par2, par3, par4) : (var5 == 35 ? this.renderBlockAnvil((BlockAnvil)par1Block, par2, par3, par4) : (var5 == 25 ? this.renderBlockBrewingStand((BlockBrewingStand)par1Block, par2, par3, par4) : (var5 == 26 ? this.renderBlockEndPortalFrame((BlockEndPortalFrame)par1Block, par2, par3, par4) : (var5 == 28 ? this.renderBlockCocoa((BlockCocoa)par1Block, par2, par3, par4) : (var5 == 34 ? this.renderBlockBeacon((BlockBeacon)par1Block, par2, par3, par4) : (var5 == 38 ? this.renderBlockHopper((BlockHopper)par1Block, par2, par3, par4) : false)))))))))))))))))))))))))))))))))))))); - } - } - -- private boolean renderBlockEndPortalFrame(BlockEndPortalFrame var1, int var2, int var3, int var4) { -- int var5 = this.blockAccess.getBlockMetadata(var2, var3, var4); -+ /** -+ * Render BlockEndPortalFrame -+ */ -+ private boolean renderBlockEndPortalFrame(BlockEndPortalFrame par1BlockEndPortalFrame, int par2, int par3, int par4) { -+ int var5 = this.blockAccess.getBlockMetadata(par2, par3, par4); - int var6 = var5 & 3; -- if(var6 == 0) { -+ -+ if (var6 == 0) { - this.uvRotateTop = 3; -- } else if(var6 == 3) { -+ } else if (var6 == 3) { - this.uvRotateTop = 1; -- } else if(var6 == 1) { -+ } else if (var6 == 1) { - this.uvRotateTop = 2; - } - -- if(!BlockEndPortalFrame.isEnderEyeInserted(var5)) { -+ if (!BlockEndPortalFrame.isEnderEyeInserted(var5)) { - this.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 0.8125D, 1.0D); -- this.renderStandardBlock(var1, var2, var3, var4); -+ this.renderStandardBlock(par1BlockEndPortalFrame, par2, par3, par4); - this.uvRotateTop = 0; - return true; - } else { - this.renderAllFaces = true; - this.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 0.8125D, 1.0D); -- this.renderStandardBlock(var1, var2, var3, var4); -- this.setOverrideBlockTexture(var1.func_94398_p()); -+ this.renderStandardBlock(par1BlockEndPortalFrame, par2, par3, par4); -+ this.setOverrideBlockTexture(par1BlockEndPortalFrame.func_94398_p()); - this.setRenderBounds(0.25D, 0.8125D, 0.25D, 0.75D, 1.0D, 0.75D); -- this.renderStandardBlock(var1, var2, var3, var4); -+ this.renderStandardBlock(par1BlockEndPortalFrame, par2, par3, par4); - this.renderAllFaces = false; - this.clearOverrideBlockTexture(); - this.uvRotateTop = 0; -@@ -198,149 +431,176 @@ - } - } - -- private boolean renderBlockBed(Block var1, int var2, int var3, int var4) { -+ /** -+ * render a bed at the given coordinates -+ */ -+ private boolean renderBlockBed(Block par1Block, int par2, int par3, int par4) { - Tessellator var5 = Tessellator.instance; -- int var6 = this.blockAccess.getBlockMetadata(var2, var3, var4); -+ int var6 = this.blockAccess.getBlockMetadata(par2, par3, par4); - int var7 = BlockBed.getDirection(var6); - boolean var8 = BlockBed.isBlockHeadOfBed(var6); - float var9 = 0.5F; - float var10 = 1.0F; - float var11 = 0.8F; - float var12 = 0.6F; -- int var25 = var1.getMixedBrightnessForBlock(this.blockAccess, var2, var3, var4); -+ int var25 = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2, par3, par4); - var5.setBrightness(var25); - var5.setColorOpaque_F(var9, var9, var9); -- Icon var27 = this.getBlockIcon(var1, this.blockAccess, var2, var3, var4, 0); -- double var28 = (double)var27.getMinU(); -- double var30 = (double)var27.getMaxU(); -- double var32 = (double)var27.getMinV(); -- double var34 = (double)var27.getMaxV(); -- double var36 = (double)var2 + this.renderMinX; -- double var38 = (double)var2 + this.renderMaxX; -- double var40 = (double)var3 + this.renderMinY + 0.1875D; -- double var42 = (double)var4 + this.renderMinZ; -- double var44 = (double)var4 + this.renderMaxZ; -- var5.addVertexWithUV(var36, var40, var44, var28, var34); -- var5.addVertexWithUV(var36, var40, var42, var28, var32); -- var5.addVertexWithUV(var38, var40, var42, var30, var32); -- var5.addVertexWithUV(var38, var40, var44, var30, var34); -- var5.setBrightness(var1.getMixedBrightnessForBlock(this.blockAccess, var2, var3 + 1, var4)); -- var5.setColorOpaque_F(var10, var10, var10); -- var27 = this.getBlockIcon(var1, this.blockAccess, var2, var3, var4, 1); -- var28 = (double)var27.getMinU(); -- var30 = (double)var27.getMaxU(); -- var32 = (double)var27.getMinV(); -- var34 = (double)var27.getMaxV(); -- var36 = var28; -- var38 = var30; -- var40 = var32; -- var42 = var32; -- var44 = var28; -- double var46 = var30; -- double var48 = var34; -- double var50 = var34; -- if(var7 == 0) { -- var38 = var28; -- var40 = var34; -- var44 = var30; -- var50 = var32; -- } else if(var7 == 2) { -- var36 = var30; -- var42 = var34; -- var46 = var28; -- var48 = var32; -- } else if(var7 == 3) { -- var36 = var30; -- var42 = var34; -- var46 = var28; -- var48 = var32; -- var38 = var28; -- var40 = var34; -- var44 = var30; -- var50 = var32; -- } -- -- double var52 = (double)var2 + this.renderMinX; -- double var54 = (double)var2 + this.renderMaxX; -- double var56 = (double)var3 + this.renderMaxY; -- double var58 = (double)var4 + this.renderMinZ; -- double var60 = (double)var4 + this.renderMaxZ; -- var5.addVertexWithUV(var54, var56, var60, var44, var48); -- var5.addVertexWithUV(var54, var56, var58, var36, var40); -- var5.addVertexWithUV(var52, var56, var58, var38, var42); -- var5.addVertexWithUV(var52, var56, var60, var46, var50); -- int var62 = Direction.directionToFacing[var7]; -- if(var8) { -- var62 = Direction.directionToFacing[Direction.rotateOpposite[var7]]; -- } -- -- byte var63 = 4; -- switch(var7) { -- case 0: -- var63 = 5; -- break; -- case 1: -- var63 = 3; -- case 2: -- default: -- break; -- case 3: -- var63 = 2; -- } -- -- if(var62 != 2 && (this.renderAllFaces || var1.shouldSideBeRendered(this.blockAccess, var2, var3, var4 - 1, 2))) { -- var5.setBrightness(this.renderMinZ > 0.0D ? var25 : var1.getMixedBrightnessForBlock(this.blockAccess, var2, var3, var4 - 1)); -- var5.setColorOpaque_F(var11, var11, var11); -- this.flipTexture = var63 == 2; -- this.renderFaceZNeg(var1, (double)var2, (double)var3, (double)var4, this.getBlockIcon(var1, this.blockAccess, var2, var3, var4, 2)); -- } -- -- if(var62 != 3 && (this.renderAllFaces || var1.shouldSideBeRendered(this.blockAccess, var2, var3, var4 + 1, 3))) { -- var5.setBrightness(this.renderMaxZ < 1.0D ? var25 : var1.getMixedBrightnessForBlock(this.blockAccess, var2, var3, var4 + 1)); -- var5.setColorOpaque_F(var11, var11, var11); -- this.flipTexture = var63 == 3; -- this.renderFaceZPos(var1, (double)var2, (double)var3, (double)var4, this.getBlockIcon(var1, this.blockAccess, var2, var3, var4, 3)); -- } -- -- if(var62 != 4 && (this.renderAllFaces || var1.shouldSideBeRendered(this.blockAccess, var2 - 1, var3, var4, 4))) { -- var5.setBrightness(this.renderMinZ > 0.0D ? var25 : var1.getMixedBrightnessForBlock(this.blockAccess, var2 - 1, var3, var4)); -- var5.setColorOpaque_F(var12, var12, var12); -- this.flipTexture = var63 == 4; -- this.renderFaceXNeg(var1, (double)var2, (double)var3, (double)var4, this.getBlockIcon(var1, this.blockAccess, var2, var3, var4, 4)); -- } -- -- if(var62 != 5 && (this.renderAllFaces || var1.shouldSideBeRendered(this.blockAccess, var2 + 1, var3, var4, 5))) { -- var5.setBrightness(this.renderMaxZ < 1.0D ? var25 : var1.getMixedBrightnessForBlock(this.blockAccess, var2 + 1, var3, var4)); -- var5.setColorOpaque_F(var12, var12, var12); -- this.flipTexture = var63 == 5; -- this.renderFaceXPos(var1, (double)var2, (double)var3, (double)var4, this.getBlockIcon(var1, this.blockAccess, var2, var3, var4, 5)); -- } -- -- this.flipTexture = false; -- return true; -+ Icon var27 = this.getBlockIcon(par1Block, this.blockAccess, par2, par3, par4, 0); -+ var27 = CTMUtils.getTile(this, par1Block, par2, par3, par4, var27, var5); -+ -+ if (var27 == null) { -+ return false; -+ } else { -+ var5 = TessellatorUtils.getTessellator(var5, var27); -+ double var28 = (double)var27.getMinU(); -+ double var30 = (double)var27.getMaxU(); -+ double var32 = (double)var27.getMinV(); -+ double var34 = (double)var27.getMaxV(); -+ double var36 = (double)par2 + this.renderMinX; -+ double var38 = (double)par2 + this.renderMaxX; -+ double var40 = (double)par3 + this.renderMinY + 0.1875D; -+ double var42 = (double)par4 + this.renderMinZ; -+ double var44 = (double)par4 + this.renderMaxZ; -+ var5.addVertexWithUV(var36, var40, var44, var28, var34); -+ var5.addVertexWithUV(var36, var40, var42, var28, var32); -+ var5.addVertexWithUV(var38, var40, var42, var30, var32); -+ var5.addVertexWithUV(var38, var40, var44, var30, var34); -+ var5.setBrightness(par1Block.getMixedBrightnessForBlock(this.blockAccess, par2, par3 + 1, par4)); -+ var5.setColorOpaque_F(var10, var10, var10); -+ var27 = this.getBlockIcon(par1Block, this.blockAccess, par2, par3, par4, 1); -+ var27 = CTMUtils.getTile(this, par1Block, par2, par3, par4, var27, var5); -+ -+ if (var27 == null) { -+ return false; -+ } else { -+ var5 = TessellatorUtils.getTessellator(var5, var27); -+ var28 = (double)var27.getMinU(); -+ var30 = (double)var27.getMaxU(); -+ var32 = (double)var27.getMinV(); -+ var34 = (double)var27.getMaxV(); -+ var36 = var28; -+ var38 = var30; -+ var40 = var32; -+ var42 = var32; -+ var44 = var28; -+ double var46 = var30; -+ double var48 = var34; -+ double var50 = var34; -+ -+ if (var7 == 0) { -+ var38 = var28; -+ var40 = var34; -+ var44 = var30; -+ var50 = var32; -+ } else if (var7 == 2) { -+ var36 = var30; -+ var42 = var34; -+ var46 = var28; -+ var48 = var32; -+ } else if (var7 == 3) { -+ var36 = var30; -+ var42 = var34; -+ var46 = var28; -+ var48 = var32; -+ var38 = var28; -+ var40 = var34; -+ var44 = var30; -+ var50 = var32; -+ } -+ -+ double var52 = (double)par2 + this.renderMinX; -+ double var54 = (double)par2 + this.renderMaxX; -+ double var56 = (double)par3 + this.renderMaxY; -+ double var58 = (double)par4 + this.renderMinZ; -+ double var60 = (double)par4 + this.renderMaxZ; -+ var5.addVertexWithUV(var54, var56, var60, var44, var48); -+ var5.addVertexWithUV(var54, var56, var58, var36, var40); -+ var5.addVertexWithUV(var52, var56, var58, var38, var42); -+ var5.addVertexWithUV(var52, var56, var60, var46, var50); -+ int var62 = Direction.directionToFacing[var7]; -+ -+ if (var8) { -+ var62 = Direction.directionToFacing[Direction.rotateOpposite[var7]]; -+ } -+ -+ byte var63 = 4; -+ -+ switch (var7) { -+ case 0: -+ var63 = 5; -+ break; -+ -+ case 1: -+ var63 = 3; -+ -+ case 2: -+ default: -+ break; -+ -+ case 3: -+ var63 = 2; -+ } -+ -+ if (var62 != 2 && (this.renderAllFaces || RenderPass.shouldSideBeRendered(par1Block, this.blockAccess, par2, par3, par4 - 1, 2))) { -+ var5.setBrightness(this.renderMinZ > 0.0D ? var25 : par1Block.getMixedBrightnessForBlock(this.blockAccess, par2, par3, par4 - 1)); -+ var5.setColorOpaque_F(var11, var11, var11); -+ this.flipTexture = var63 == 2; -+ this.renderFaceZNeg(par1Block, (double)par2, (double)par3, (double)par4, this.getBlockIcon(par1Block, this.blockAccess, par2, par3, par4, 2)); -+ } -+ -+ if (var62 != 3 && (this.renderAllFaces || RenderPass.shouldSideBeRendered(par1Block, this.blockAccess, par2, par3, par4 + 1, 3))) { -+ var5.setBrightness(this.renderMaxZ < 1.0D ? var25 : par1Block.getMixedBrightnessForBlock(this.blockAccess, par2, par3, par4 + 1)); -+ var5.setColorOpaque_F(var11, var11, var11); -+ this.flipTexture = var63 == 3; -+ this.renderFaceZPos(par1Block, (double)par2, (double)par3, (double)par4, this.getBlockIcon(par1Block, this.blockAccess, par2, par3, par4, 3)); -+ } -+ -+ if (var62 != 4 && (this.renderAllFaces || RenderPass.shouldSideBeRendered(par1Block, this.blockAccess, par2 - 1, par3, par4, 4))) { -+ var5.setBrightness(this.renderMinZ > 0.0D ? var25 : par1Block.getMixedBrightnessForBlock(this.blockAccess, par2 - 1, par3, par4)); -+ var5.setColorOpaque_F(var12, var12, var12); -+ this.flipTexture = var63 == 4; -+ this.renderFaceXNeg(par1Block, (double)par2, (double)par3, (double)par4, this.getBlockIcon(par1Block, this.blockAccess, par2, par3, par4, 4)); -+ } -+ -+ if (var62 != 5 && (this.renderAllFaces || RenderPass.shouldSideBeRendered(par1Block, this.blockAccess, par2 + 1, par3, par4, 5))) { -+ var5.setBrightness(this.renderMaxZ < 1.0D ? var25 : par1Block.getMixedBrightnessForBlock(this.blockAccess, par2 + 1, par3, par4)); -+ var5.setColorOpaque_F(var12, var12, var12); -+ this.flipTexture = var63 == 5; -+ this.renderFaceXPos(par1Block, (double)par2, (double)par3, (double)par4, this.getBlockIcon(par1Block, this.blockAccess, par2, par3, par4, 5)); -+ } -+ -+ this.flipTexture = false; -+ return true; -+ } -+ } - } - -- private boolean renderBlockBrewingStand(BlockBrewingStand var1, int var2, int var3, int var4) { -+ /** -+ * Render BlockBrewingStand -+ */ -+ private boolean renderBlockBrewingStand(BlockBrewingStand par1BlockBrewingStand, int par2, int par3, int par4) { - this.setRenderBounds(0.4375D, 0.0D, 0.4375D, 0.5625D, 0.875D, 0.5625D); -- this.renderStandardBlock(var1, var2, var3, var4); -- this.setOverrideBlockTexture(var1.getBrewingStandIcon()); -+ this.renderStandardBlock(par1BlockBrewingStand, par2, par3, par4); -+ this.setOverrideBlockTexture(par1BlockBrewingStand.getBrewingStandIcon()); - this.renderAllFaces = true; - this.setRenderBounds(0.5625D, 0.0D, 0.3125D, 0.9375D, 0.125D, 0.6875D); -- this.renderStandardBlock(var1, var2, var3, var4); -- this.setRenderBounds(0.125D, 0.0D, 1.0D / 16.0D, 0.5D, 0.125D, 0.4375D); -- this.renderStandardBlock(var1, var2, var3, var4); -+ this.renderStandardBlock(par1BlockBrewingStand, par2, par3, par4); -+ this.setRenderBounds(0.125D, 0.0D, 0.0625D, 0.5D, 0.125D, 0.4375D); -+ this.renderStandardBlock(par1BlockBrewingStand, par2, par3, par4); - this.setRenderBounds(0.125D, 0.0D, 0.5625D, 0.5D, 0.125D, 0.9375D); -- this.renderStandardBlock(var1, var2, var3, var4); -+ this.renderStandardBlock(par1BlockBrewingStand, par2, par3, par4); - this.renderAllFaces = false; - this.clearOverrideBlockTexture(); - Tessellator var5 = Tessellator.instance; -- var5.setBrightness(var1.getMixedBrightnessForBlock(this.blockAccess, var2, var3, var4)); -+ var5.setBrightness(par1BlockBrewingStand.getMixedBrightnessForBlock(this.blockAccess, par2, par3, par4)); - float var6 = 1.0F; -- int var7 = var1.colorMultiplier(this.blockAccess, var2, var3, var4); -+ int var7 = par1BlockBrewingStand.colorMultiplier(this.blockAccess, par2, par3, par4); - float var8 = (float)(var7 >> 16 & 255) / 255.0F; - float var9 = (float)(var7 >> 8 & 255) / 255.0F; - float var10 = (float)(var7 & 255) / 255.0F; -- if(EntityRenderer.anaglyphEnable) { -+ -+ if (EntityRenderer.anaglyphEnable) { - float var11 = (var8 * 30.0F + var9 * 59.0F + var10 * 11.0F) / 100.0F; - float var12 = (var8 * 30.0F + var9 * 70.0F) / 100.0F; - float var13 = (var8 * 30.0F + var10 * 70.0F) / 100.0F; -@@ -350,52 +610,65 @@ - } - - var5.setColorOpaque_F(var6 * var8, var6 * var9, var6 * var10); -- Icon var32 = this.getBlockIconFromSideAndMetadata(var1, 0, 0); -- if(this.hasOverrideBlockTexture()) { -+ Icon var32 = this.getBlockIconFromSideAndMetadata(par1BlockBrewingStand, 0, 0); -+ -+ if (this.hasOverrideBlockTexture()) { - var32 = this.overrideBlockTexture; - } - -- double var33 = (double)var32.getMinV(); -- double var14 = (double)var32.getMaxV(); -- int var16 = this.blockAccess.getBlockMetadata(var2, var3, var4); -- -- for(int var17 = 0; var17 < 3; ++var17) { -- double var18 = (double)var17 * Math.PI * 2.0D / 3.0D + Math.PI * 0.5D; -- double var20 = (double)var32.getInterpolatedU(8.0D); -- double var22 = (double)var32.getMaxU(); -- if((var16 & 1 << var17) != 0) { -- var22 = (double)var32.getMinU(); -+ var32 = CTMUtils.getTile(this, par1BlockBrewingStand, par2, par3, par4, var32, var5); -+ -+ if (var32 == null) { -+ return false; -+ } else { -+ var5 = TessellatorUtils.getTessellator(var5, var32); -+ double var33 = (double)var32.getMinV(); -+ double var14 = (double)var32.getMaxV(); -+ int var16 = this.blockAccess.getBlockMetadata(par2, par3, par4); -+ -+ for (int var17 = 0; var17 < 3; ++var17) { -+ double var18 = (double)var17 * Math.PI * 2.0D / 3.0D + (Math.PI / 2D); -+ double var20 = (double)var32.getInterpolatedU(8.0D); -+ double var22 = (double)var32.getMaxU(); -+ -+ if ((var16 & 1 << var17) != 0) { -+ var22 = (double)var32.getMinU(); -+ } -+ -+ double var24 = (double)par2 + 0.5D; -+ double var26 = (double)par2 + 0.5D + Math.sin(var18) * 8.0D / 16.0D; -+ double var28 = (double)par4 + 0.5D; -+ double var30 = (double)par4 + 0.5D + Math.cos(var18) * 8.0D / 16.0D; -+ var5.addVertexWithUV(var24, (double)(par3 + 1), var28, var20, var33); -+ var5.addVertexWithUV(var24, (double)(par3 + 0), var28, var20, var14); -+ var5.addVertexWithUV(var26, (double)(par3 + 0), var30, var22, var14); -+ var5.addVertexWithUV(var26, (double)(par3 + 1), var30, var22, var33); -+ var5.addVertexWithUV(var26, (double)(par3 + 1), var30, var22, var33); -+ var5.addVertexWithUV(var26, (double)(par3 + 0), var30, var22, var14); -+ var5.addVertexWithUV(var24, (double)(par3 + 0), var28, var20, var14); -+ var5.addVertexWithUV(var24, (double)(par3 + 1), var28, var20, var33); - } - -- double var24 = (double)var2 + 0.5D; -- double var26 = (double)var2 + 0.5D + Math.sin(var18) * 8.0D / 16.0D; -- double var28 = (double)var4 + 0.5D; -- double var30 = (double)var4 + 0.5D + Math.cos(var18) * 8.0D / 16.0D; -- var5.addVertexWithUV(var24, (double)(var3 + 1), var28, var20, var33); -- var5.addVertexWithUV(var24, (double)(var3 + 0), var28, var20, var14); -- var5.addVertexWithUV(var26, (double)(var3 + 0), var30, var22, var14); -- var5.addVertexWithUV(var26, (double)(var3 + 1), var30, var22, var33); -- var5.addVertexWithUV(var26, (double)(var3 + 1), var30, var22, var33); -- var5.addVertexWithUV(var26, (double)(var3 + 0), var30, var22, var14); -- var5.addVertexWithUV(var24, (double)(var3 + 0), var28, var20, var14); -- var5.addVertexWithUV(var24, (double)(var3 + 1), var28, var20, var33); -+ par1BlockBrewingStand.setBlockBoundsForItemRender(); -+ return true; - } -- -- var1.setBlockBoundsForItemRender(); -- return true; - } - -- private boolean renderBlockCauldron(BlockCauldron var1, int var2, int var3, int var4) { -- this.renderStandardBlock(var1, var2, var3, var4); -+ /** -+ * Render block cauldron -+ */ -+ private boolean renderBlockCauldron(BlockCauldron par1BlockCauldron, int par2, int par3, int par4) { -+ this.renderStandardBlock(par1BlockCauldron, par2, par3, par4); - Tessellator var5 = Tessellator.instance; -- var5.setBrightness(var1.getMixedBrightnessForBlock(this.blockAccess, var2, var3, var4)); -+ var5.setBrightness(par1BlockCauldron.getMixedBrightnessForBlock(this.blockAccess, par2, par3, par4)); - float var6 = 1.0F; -- int var7 = var1.colorMultiplier(this.blockAccess, var2, var3, var4); -+ int var7 = par1BlockCauldron.colorMultiplier(this.blockAccess, par2, par3, par4); - float var8 = (float)(var7 >> 16 & 255) / 255.0F; - float var9 = (float)(var7 >> 8 & 255) / 255.0F; - float var10 = (float)(var7 & 255) / 255.0F; - float var12; -- if(EntityRenderer.anaglyphEnable) { -+ -+ if (EntityRenderer.anaglyphEnable) { - float var11 = (var8 * 30.0F + var9 * 59.0F + var10 * 11.0F) / 100.0F; - var12 = (var8 * 30.0F + var9 * 70.0F) / 100.0F; - float var13 = (var8 * 30.0F + var10 * 70.0F) / 100.0F; -@@ -405,41 +678,49 @@ - } - - var5.setColorOpaque_F(var6 * var8, var6 * var9, var6 * var10); -- Icon var16 = var1.getBlockTextureFromSide(2); -- var12 = 2.0F / 16.0F; -- this.renderFaceXPos(var1, (double)((float)var2 - 1.0F + var12), (double)var3, (double)var4, var16); -- this.renderFaceXNeg(var1, (double)((float)var2 + 1.0F - var12), (double)var3, (double)var4, var16); -- this.renderFaceZPos(var1, (double)var2, (double)var3, (double)((float)var4 - 1.0F + var12), var16); -- this.renderFaceZNeg(var1, (double)var2, (double)var3, (double)((float)var4 + 1.0F - var12), var16); -+ Icon var16 = par1BlockCauldron.getBlockTextureFromSide(2); -+ var12 = 0.125F; -+ this.renderFaceXPos(par1BlockCauldron, (double)((float)par2 - 1.0F + var12), (double)par3, (double)par4, var16); -+ this.renderFaceXNeg(par1BlockCauldron, (double)((float)par2 + 1.0F - var12), (double)par3, (double)par4, var16); -+ this.renderFaceZPos(par1BlockCauldron, (double)par2, (double)par3, (double)((float)par4 - 1.0F + var12), var16); -+ this.renderFaceZNeg(par1BlockCauldron, (double)par2, (double)par3, (double)((float)par4 + 1.0F - var12), var16); - Icon var17 = BlockCauldron.getCauldronIcon("inner"); -- this.renderFaceYPos(var1, (double)var2, (double)((float)var3 - 1.0F + 0.25F), (double)var4, var17); -- this.renderFaceYNeg(var1, (double)var2, (double)((float)var3 + 1.0F - 12.0F / 16.0F), (double)var4, var17); -- int var14 = this.blockAccess.getBlockMetadata(var2, var3, var4); -- if(var14 > 0) { -+ this.renderFaceYPos(par1BlockCauldron, (double)par2, (double)((float)par3 - 1.0F + 0.25F), (double)par4, var17); -+ this.renderFaceYNeg(par1BlockCauldron, (double)par2, (double)((float)par3 + 1.0F - 0.75F), (double)par4, var17); -+ int var14 = this.blockAccess.getBlockMetadata(par2, par3, par4); -+ -+ if (var14 > 0) { - Icon var15 = BlockFluid.getFluidIcon("water_still"); -- if(var14 > 3) { -+ ColorizeBlock.computeWaterColor(); -+ var5.setColorOpaque_F(ColorizeBlock.waterColor[0], ColorizeBlock.waterColor[1], ColorizeBlock.waterColor[2]); -+ -+ if (var14 > 3) { - var14 = 3; - } - -- this.renderFaceYPos(var1, (double)var2, (double)((float)var3 - 1.0F + (6.0F + (float)var14 * 3.0F) / 16.0F), (double)var4, var15); -+ this.renderFaceYPos(par1BlockCauldron, (double)par2, (double)((float)par3 - 1.0F + (6.0F + (float)var14 * 3.0F) / 16.0F), (double)par4, var15); - } - - return true; - } - -- private boolean renderBlockFlowerpot(BlockFlowerPot var1, int var2, int var3, int var4) { -- this.renderStandardBlock(var1, var2, var3, var4); -+ /** -+ * Renders flower pot -+ */ -+ private boolean renderBlockFlowerpot(BlockFlowerPot par1BlockFlowerPot, int par2, int par3, int par4) { -+ this.renderStandardBlock(par1BlockFlowerPot, par2, par3, par4); - Tessellator var5 = Tessellator.instance; -- var5.setBrightness(var1.getMixedBrightnessForBlock(this.blockAccess, var2, var3, var4)); -+ var5.setBrightness(par1BlockFlowerPot.getMixedBrightnessForBlock(this.blockAccess, par2, par3, par4)); - float var6 = 1.0F; -- int var7 = var1.colorMultiplier(this.blockAccess, var2, var3, var4); -- Icon var8 = this.getBlockIconFromSide(var1, 0); -+ int var7 = par1BlockFlowerPot.colorMultiplier(this.blockAccess, par2, par3, par4); -+ Icon var8 = this.getBlockIconFromSide(par1BlockFlowerPot, 0); - float var9 = (float)(var7 >> 16 & 255) / 255.0F; - float var10 = (float)(var7 >> 8 & 255) / 255.0F; - float var11 = (float)(var7 & 255) / 255.0F; - float var12; - float var14; -- if(EntityRenderer.anaglyphEnable) { -+ -+ if (EntityRenderer.anaglyphEnable) { - var12 = (var9 * 30.0F + var10 * 59.0F + var11 * 11.0F) / 100.0F; - float var13 = (var9 * 30.0F + var10 * 70.0F) / 100.0F; - var14 = (var9 * 30.0F + var11 * 70.0F) / 100.0F; -@@ -450,67 +731,74 @@ - - var5.setColorOpaque_F(var6 * var9, var6 * var10, var6 * var11); - var12 = 0.1865F; -- this.renderFaceXPos(var1, (double)((float)var2 - 0.5F + var12), (double)var3, (double)var4, var8); -- this.renderFaceXNeg(var1, (double)((float)var2 + 0.5F - var12), (double)var3, (double)var4, var8); -- this.renderFaceZPos(var1, (double)var2, (double)var3, (double)((float)var4 - 0.5F + var12), var8); -- this.renderFaceZNeg(var1, (double)var2, (double)var3, (double)((float)var4 + 0.5F - var12), var8); -- this.renderFaceYPos(var1, (double)var2, (double)((float)var3 - 0.5F + var12 + 3.0F / 16.0F), (double)var4, this.getBlockIcon(Block.dirt)); -- int var19 = this.blockAccess.getBlockMetadata(var2, var3, var4); -- if(var19 != 0) { -+ this.renderFaceXPos(par1BlockFlowerPot, (double)((float)par2 - 0.5F + var12), (double)par3, (double)par4, var8); -+ this.renderFaceXNeg(par1BlockFlowerPot, (double)((float)par2 + 0.5F - var12), (double)par3, (double)par4, var8); -+ this.renderFaceZPos(par1BlockFlowerPot, (double)par2, (double)par3, (double)((float)par4 - 0.5F + var12), var8); -+ this.renderFaceZNeg(par1BlockFlowerPot, (double)par2, (double)par3, (double)((float)par4 + 0.5F - var12), var8); -+ this.renderFaceYPos(par1BlockFlowerPot, (double)par2, (double)((float)par3 - 0.5F + var12 + 0.1875F), (double)par4, this.getBlockIcon(Block.dirt)); -+ int var19 = this.blockAccess.getBlockMetadata(par2, par3, par4); -+ -+ if (var19 != 0) { - var14 = 0.0F; - float var15 = 4.0F; - float var16 = 0.0F; - BlockFlower var17 = null; -- switch(var19) { -- case 1: -- var17 = Block.plantRed; -- break; -- case 2: -- var17 = Block.plantYellow; -- case 3: -- case 4: -- case 5: -- case 6: -- default: -- break; -- case 7: -- var17 = Block.mushroomRed; -- break; -- case 8: -- var17 = Block.mushroomBrown; -+ -+ switch (var19) { -+ case 1: -+ var17 = Block.plantRed; -+ break; -+ -+ case 2: -+ var17 = Block.plantYellow; -+ -+ case 3: -+ case 4: -+ case 5: -+ case 6: -+ default: -+ break; -+ -+ case 7: -+ var17 = Block.mushroomRed; -+ break; -+ -+ case 8: -+ var17 = Block.mushroomBrown; - } - - var5.addTranslation(var14 / 16.0F, var15 / 16.0F, var16 / 16.0F); -- if(var17 != null) { -- this.renderBlockByRenderType(var17, var2, var3, var4); -- } else if(var19 == 9) { -+ -+ if (var17 != null) { -+ this.renderBlockByRenderType(var17, par2, par3, par4); -+ } else if (var19 == 9) { - this.renderAllFaces = true; -- float var18 = 2.0F / 16.0F; -+ float var18 = 0.125F; - this.setRenderBounds((double)(0.5F - var18), 0.0D, (double)(0.5F - var18), (double)(0.5F + var18), 0.25D, (double)(0.5F + var18)); -- this.renderStandardBlock(Block.cactus, var2, var3, var4); -+ this.renderStandardBlock(Block.cactus, par2, par3, par4); - this.setRenderBounds((double)(0.5F - var18), 0.25D, (double)(0.5F - var18), (double)(0.5F + var18), 0.5D, (double)(0.5F + var18)); -- this.renderStandardBlock(Block.cactus, var2, var3, var4); -+ this.renderStandardBlock(Block.cactus, par2, par3, par4); - this.setRenderBounds((double)(0.5F - var18), 0.5D, (double)(0.5F - var18), (double)(0.5F + var18), 0.75D, (double)(0.5F + var18)); -- this.renderStandardBlock(Block.cactus, var2, var3, var4); -+ this.renderStandardBlock(Block.cactus, par2, par3, par4); - this.renderAllFaces = false; - this.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 1.0D); -- } else if(var19 == 3) { -- this.drawCrossedSquares(Block.sapling, 0, (double)var2, (double)var3, (double)var4, 12.0F / 16.0F); -- } else if(var19 == 5) { -- this.drawCrossedSquares(Block.sapling, 2, (double)var2, (double)var3, (double)var4, 12.0F / 16.0F); -- } else if(var19 == 4) { -- this.drawCrossedSquares(Block.sapling, 1, (double)var2, (double)var3, (double)var4, 12.0F / 16.0F); -- } else if(var19 == 6) { -- this.drawCrossedSquares(Block.sapling, 3, (double)var2, (double)var3, (double)var4, 12.0F / 16.0F); -- } else if(var19 == 11) { -- var7 = Block.tallGrass.colorMultiplier(this.blockAccess, var2, var3, var4); -+ } else if (var19 == 3) { -+ this.drawCrossedSquares(Block.sapling, 0, (double)par2, (double)par3, (double)par4, 0.75F); -+ } else if (var19 == 5) { -+ this.drawCrossedSquares(Block.sapling, 2, (double)par2, (double)par3, (double)par4, 0.75F); -+ } else if (var19 == 4) { -+ this.drawCrossedSquares(Block.sapling, 1, (double)par2, (double)par3, (double)par4, 0.75F); -+ } else if (var19 == 6) { -+ this.drawCrossedSquares(Block.sapling, 3, (double)par2, (double)par3, (double)par4, 0.75F); -+ } else if (var19 == 11) { -+ var7 = Block.tallGrass.colorMultiplier(this.blockAccess, par2, par3, par4); - var9 = (float)(var7 >> 16 & 255) / 255.0F; - var10 = (float)(var7 >> 8 & 255) / 255.0F; - var11 = (float)(var7 & 255) / 255.0F; - var5.setColorOpaque_F(var6 * var9, var6 * var10, var6 * var11); -- this.drawCrossedSquares(Block.tallGrass, 2, (double)var2, (double)var3, (double)var4, 12.0F / 16.0F); -- } else if(var19 == 10) { -- this.drawCrossedSquares(Block.deadBush, 2, (double)var2, (double)var3, (double)var4, 12.0F / 16.0F); -+ this.drawCrossedSquares(Block.tallGrass, 2, (double)par2, (double)par3, (double)par4, 0.75F); -+ } else if (var19 == 10) { -+ this.drawCrossedSquares(Block.deadBush, 2, (double)par2, (double)par3, (double)par4, 0.75F); - } - - var5.addTranslation(-var14 / 16.0F, -var15 / 16.0F, -var16 / 16.0F); -@@ -519,19 +807,26 @@ - return true; - } - -- private boolean renderBlockAnvil(BlockAnvil var1, int var2, int var3, int var4) { -- return this.renderBlockAnvilMetadata(var1, var2, var3, var4, this.blockAccess.getBlockMetadata(var2, var3, var4)); -+ /** -+ * Renders anvil -+ */ -+ private boolean renderBlockAnvil(BlockAnvil par1BlockAnvil, int par2, int par3, int par4) { -+ return this.renderBlockAnvilMetadata(par1BlockAnvil, par2, par3, par4, this.blockAccess.getBlockMetadata(par2, par3, par4)); - } - -- public boolean renderBlockAnvilMetadata(BlockAnvil var1, int var2, int var3, int var4, int var5) { -+ /** -+ * Renders anvil block with metadata -+ */ -+ public boolean renderBlockAnvilMetadata(BlockAnvil par1BlockAnvil, int par2, int par3, int par4, int par5) { - Tessellator var6 = Tessellator.instance; -- var6.setBrightness(var1.getMixedBrightnessForBlock(this.blockAccess, var2, var3, var4)); -+ var6.setBrightness(par1BlockAnvil.getMixedBrightnessForBlock(this.blockAccess, par2, par3, par4)); - float var7 = 1.0F; -- int var8 = var1.colorMultiplier(this.blockAccess, var2, var3, var4); -+ int var8 = par1BlockAnvil.colorMultiplier(this.blockAccess, par2, par3, par4); - float var9 = (float)(var8 >> 16 & 255) / 255.0F; - float var10 = (float)(var8 >> 8 & 255) / 255.0F; - float var11 = (float)(var8 & 255) / 255.0F; -- if(EntityRenderer.anaglyphEnable) { -+ -+ if (EntityRenderer.anaglyphEnable) { - float var12 = (var9 * 30.0F + var10 * 59.0F + var11 * 11.0F) / 100.0F; - float var13 = (var9 * 30.0F + var10 * 70.0F) / 100.0F; - float var14 = (var9 * 30.0F + var11 * 70.0F) / 100.0F; -@@ -541,43 +836,50 @@ - } - - var6.setColorOpaque_F(var7 * var9, var7 * var10, var7 * var11); -- return this.renderBlockAnvilOrient(var1, var2, var3, var4, var5, false); -+ return this.renderBlockAnvilOrient(par1BlockAnvil, par2, par3, par4, par5, false); - } - -- private boolean renderBlockAnvilOrient(BlockAnvil var1, int var2, int var3, int var4, int var5, boolean var6) { -- int var7 = var6 ? 0 : var5 & 3; -+ /** -+ * Renders anvil block with orientation -+ */ -+ private boolean renderBlockAnvilOrient(BlockAnvil par1BlockAnvil, int par2, int par3, int par4, int par5, boolean par6) { -+ int var7 = par6 ? 0 : par5 & 3; - boolean var8 = false; - float var9 = 0.0F; -- switch(var7) { -- case 0: -- this.uvRotateSouth = 2; -- this.uvRotateNorth = 1; -- this.uvRotateTop = 3; -- this.uvRotateBottom = 3; -- break; -- case 1: -- this.uvRotateEast = 1; -- this.uvRotateWest = 2; -- this.uvRotateTop = 2; -- this.uvRotateBottom = 1; -- var8 = true; -- break; -- case 2: -- this.uvRotateSouth = 1; -- this.uvRotateNorth = 2; -- break; -- case 3: -- this.uvRotateEast = 2; -- this.uvRotateWest = 1; -- this.uvRotateTop = 1; -- this.uvRotateBottom = 2; -- var8 = true; -+ -+ switch (var7) { -+ case 0: -+ this.uvRotateSouth = 2; -+ this.uvRotateNorth = 1; -+ this.uvRotateTop = 3; -+ this.uvRotateBottom = 3; -+ break; -+ -+ case 1: -+ this.uvRotateEast = 1; -+ this.uvRotateWest = 2; -+ this.uvRotateTop = 2; -+ this.uvRotateBottom = 1; -+ var8 = true; -+ break; -+ -+ case 2: -+ this.uvRotateSouth = 1; -+ this.uvRotateNorth = 2; -+ break; -+ -+ case 3: -+ this.uvRotateEast = 2; -+ this.uvRotateWest = 1; -+ this.uvRotateTop = 1; -+ this.uvRotateBottom = 2; -+ var8 = true; - } - -- var9 = this.renderBlockAnvilRotate(var1, var2, var3, var4, 0, var9, 12.0F / 16.0F, 0.25F, 12.0F / 16.0F, var8, var6, var5); -- var9 = this.renderBlockAnvilRotate(var1, var2, var3, var4, 1, var9, 0.5F, 1.0F / 16.0F, 10.0F / 16.0F, var8, var6, var5); -- var9 = this.renderBlockAnvilRotate(var1, var2, var3, var4, 2, var9, 0.25F, 5.0F / 16.0F, 0.5F, var8, var6, var5); -- this.renderBlockAnvilRotate(var1, var2, var3, var4, 3, var9, 10.0F / 16.0F, 6.0F / 16.0F, 1.0F, var8, var6, var5); -+ var9 = this.renderBlockAnvilRotate(par1BlockAnvil, par2, par3, par4, 0, var9, 0.75F, 0.25F, 0.75F, var8, par6, par5); -+ var9 = this.renderBlockAnvilRotate(par1BlockAnvil, par2, par3, par4, 1, var9, 0.5F, 0.0625F, 0.625F, var8, par6, par5); -+ var9 = this.renderBlockAnvilRotate(par1BlockAnvil, par2, par3, par4, 2, var9, 0.25F, 0.3125F, 0.5F, var8, par6, par5); -+ this.renderBlockAnvilRotate(par1BlockAnvil, par2, par3, par4, 3, var9, 0.625F, 0.375F, 1.0F, var8, par6, par5); - this.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 1.0D); - this.uvRotateEast = 0; - this.uvRotateWest = 0; -@@ -588,106 +890,121 @@ - return true; - } - -- private float renderBlockAnvilRotate(BlockAnvil var1, int var2, int var3, int var4, int var5, float var6, float var7, float var8, float var9, boolean var10, boolean var11, int var12) { -- if(var10) { -- float var13 = var7; -- var7 = var9; -- var9 = var13; -+ /** -+ * Renders anvil block with rotation -+ */ -+ private float renderBlockAnvilRotate(BlockAnvil par1BlockAnvil, int par2, int par3, int par4, int par5, float par6, float par7, float par8, float par9, boolean par10, boolean par11, int par12) { -+ if (par10) { -+ float var13 = par7; -+ par7 = par9; -+ par9 = var13; - } - -- var7 /= 2.0F; -- var9 /= 2.0F; -- var1.field_82521_b = var5; -- this.setRenderBounds((double)(0.5F - var7), (double)var6, (double)(0.5F - var9), (double)(0.5F + var7), (double)(var6 + var8), (double)(0.5F + var9)); -- if(var11) { -+ par7 /= 2.0F; -+ par9 /= 2.0F; -+ par1BlockAnvil.field_82521_b = par5; -+ this.setRenderBounds((double)(0.5F - par7), (double)par6, (double)(0.5F - par9), (double)(0.5F + par7), (double)(par6 + par8), (double)(0.5F + par9)); -+ -+ if (par11) { - Tessellator var14 = Tessellator.instance; - var14.startDrawingQuads(); - var14.setNormal(0.0F, -1.0F, 0.0F); -- this.renderFaceYNeg(var1, 0.0D, 0.0D, 0.0D, this.getBlockIconFromSideAndMetadata(var1, 0, var12)); -+ this.renderFaceYNeg(par1BlockAnvil, 0.0D, 0.0D, 0.0D, this.getBlockIconFromSideAndMetadata(par1BlockAnvil, 0, par12)); - var14.draw(); - var14.startDrawingQuads(); - var14.setNormal(0.0F, 1.0F, 0.0F); -- this.renderFaceYPos(var1, 0.0D, 0.0D, 0.0D, this.getBlockIconFromSideAndMetadata(var1, 1, var12)); -+ this.renderFaceYPos(par1BlockAnvil, 0.0D, 0.0D, 0.0D, this.getBlockIconFromSideAndMetadata(par1BlockAnvil, 1, par12)); - var14.draw(); - var14.startDrawingQuads(); - var14.setNormal(0.0F, 0.0F, -1.0F); -- this.renderFaceZNeg(var1, 0.0D, 0.0D, 0.0D, this.getBlockIconFromSideAndMetadata(var1, 2, var12)); -+ this.renderFaceZNeg(par1BlockAnvil, 0.0D, 0.0D, 0.0D, this.getBlockIconFromSideAndMetadata(par1BlockAnvil, 2, par12)); - var14.draw(); - var14.startDrawingQuads(); - var14.setNormal(0.0F, 0.0F, 1.0F); -- this.renderFaceZPos(var1, 0.0D, 0.0D, 0.0D, this.getBlockIconFromSideAndMetadata(var1, 3, var12)); -+ this.renderFaceZPos(par1BlockAnvil, 0.0D, 0.0D, 0.0D, this.getBlockIconFromSideAndMetadata(par1BlockAnvil, 3, par12)); - var14.draw(); - var14.startDrawingQuads(); - var14.setNormal(-1.0F, 0.0F, 0.0F); -- this.renderFaceXNeg(var1, 0.0D, 0.0D, 0.0D, this.getBlockIconFromSideAndMetadata(var1, 4, var12)); -+ this.renderFaceXNeg(par1BlockAnvil, 0.0D, 0.0D, 0.0D, this.getBlockIconFromSideAndMetadata(par1BlockAnvil, 4, par12)); - var14.draw(); - var14.startDrawingQuads(); - var14.setNormal(1.0F, 0.0F, 0.0F); -- this.renderFaceXPos(var1, 0.0D, 0.0D, 0.0D, this.getBlockIconFromSideAndMetadata(var1, 5, var12)); -+ this.renderFaceXPos(par1BlockAnvil, 0.0D, 0.0D, 0.0D, this.getBlockIconFromSideAndMetadata(par1BlockAnvil, 5, par12)); - var14.draw(); - } else { -- this.renderStandardBlock(var1, var2, var3, var4); -+ this.renderStandardBlock(par1BlockAnvil, par2, par3, par4); - } - -- return var6 + var8; -+ return par6 + par8; - } - -- public boolean renderBlockTorch(Block var1, int var2, int var3, int var4) { -- int var5 = this.blockAccess.getBlockMetadata(var2, var3, var4); -+ /** -+ * Renders a torch block at the given coordinates -+ */ -+ public boolean renderBlockTorch(Block par1Block, int par2, int par3, int par4) { -+ int var5 = this.blockAccess.getBlockMetadata(par2, par3, par4); - Tessellator var6 = Tessellator.instance; -- var6.setBrightness(var1.getMixedBrightnessForBlock(this.blockAccess, var2, var3, var4)); -+ var6.setBrightness(par1Block.getMixedBrightnessForBlock(this.blockAccess, par2, par3, par4)); - var6.setColorOpaque_F(1.0F, 1.0F, 1.0F); -- double var7 = (double)0.4F; -+ double var7 = 0.4000000059604645D; - double var9 = 0.5D - var7; -- double var11 = (double)0.2F; -- if(var5 == 1) { -- this.renderTorchAtAngle(var1, (double)var2 - var9, (double)var3 + var11, (double)var4, -var7, 0.0D, 0); -- } else if(var5 == 2) { -- this.renderTorchAtAngle(var1, (double)var2 + var9, (double)var3 + var11, (double)var4, var7, 0.0D, 0); -- } else if(var5 == 3) { -- this.renderTorchAtAngle(var1, (double)var2, (double)var3 + var11, (double)var4 - var9, 0.0D, -var7, 0); -- } else if(var5 == 4) { -- this.renderTorchAtAngle(var1, (double)var2, (double)var3 + var11, (double)var4 + var9, 0.0D, var7, 0); -+ double var11 = 0.20000000298023224D; -+ -+ if (var5 == 1) { -+ this.renderTorchAtAngle(par1Block, (double)par2 - var9, (double)par3 + var11, (double)par4, -var7, 0.0D, 0); -+ } else if (var5 == 2) { -+ this.renderTorchAtAngle(par1Block, (double)par2 + var9, (double)par3 + var11, (double)par4, var7, 0.0D, 0); -+ } else if (var5 == 3) { -+ this.renderTorchAtAngle(par1Block, (double)par2, (double)par3 + var11, (double)par4 - var9, 0.0D, -var7, 0); -+ } else if (var5 == 4) { -+ this.renderTorchAtAngle(par1Block, (double)par2, (double)par3 + var11, (double)par4 + var9, 0.0D, var7, 0); - } else { -- this.renderTorchAtAngle(var1, (double)var2, (double)var3, (double)var4, 0.0D, 0.0D, 0); -+ this.renderTorchAtAngle(par1Block, (double)par2, (double)par3, (double)par4, 0.0D, 0.0D, 0); - } - - return true; - } - -- private boolean renderBlockRepeater(BlockRedstoneRepeater var1, int var2, int var3, int var4) { -- int var5 = this.blockAccess.getBlockMetadata(var2, var3, var4); -+ /** -+ * render a redstone repeater at the given coordinates -+ */ -+ private boolean renderBlockRepeater(BlockRedstoneRepeater par1BlockRedstoneRepeater, int par2, int par3, int par4) { -+ int var5 = this.blockAccess.getBlockMetadata(par2, par3, par4); - int var6 = var5 & 3; - int var7 = (var5 & 12) >> 2; - Tessellator var8 = Tessellator.instance; -- var8.setBrightness(var1.getMixedBrightnessForBlock(this.blockAccess, var2, var3, var4)); -+ var8.setBrightness(par1BlockRedstoneRepeater.getMixedBrightnessForBlock(this.blockAccess, par2, par3, par4)); - var8.setColorOpaque_F(1.0F, 1.0F, 1.0F); - double var9 = -0.1875D; -- boolean var11 = var1.func_94476_e(this.blockAccess, var2, var3, var4, var5); -+ boolean var11 = par1BlockRedstoneRepeater.func_94476_e(this.blockAccess, par2, par3, par4, var5); - double var12 = 0.0D; - double var14 = 0.0D; - double var16 = 0.0D; - double var18 = 0.0D; -- switch(var6) { -- case 0: -- var18 = -0.3125D; -- var14 = BlockRedstoneRepeater.repeaterTorchOffset[var7]; -- break; -- case 1: -- var16 = 0.3125D; -- var12 = -BlockRedstoneRepeater.repeaterTorchOffset[var7]; -- break; -- case 2: -- var18 = 0.3125D; -- var14 = -BlockRedstoneRepeater.repeaterTorchOffset[var7]; -- break; -- case 3: -- var16 = -0.3125D; -- var12 = BlockRedstoneRepeater.repeaterTorchOffset[var7]; -+ -+ switch (var6) { -+ case 0: -+ var18 = -0.3125D; -+ var14 = BlockRedstoneRepeater.repeaterTorchOffset[var7]; -+ break; -+ -+ case 1: -+ var16 = 0.3125D; -+ var12 = -BlockRedstoneRepeater.repeaterTorchOffset[var7]; -+ break; -+ -+ case 2: -+ var18 = 0.3125D; -+ var14 = -BlockRedstoneRepeater.repeaterTorchOffset[var7]; -+ break; -+ -+ case 3: -+ var16 = -0.3125D; -+ var12 = BlockRedstoneRepeater.repeaterTorchOffset[var7]; - } - -- if(!var11) { -- this.renderTorchAtAngle(var1, (double)var2 + var12, (double)var3 + var9, (double)var4 + var14, 0.0D, 0.0D, 0); -+ if (!var11) { -+ this.renderTorchAtAngle(par1BlockRedstoneRepeater, (double)par2 + var12, (double)par3 + var9, (double)par4 + var14, 0.0D, 0.0D, 0); - } else { - Icon var20 = this.getBlockIcon(Block.bedrock); - this.setOverrideBlockTexture(var20); -@@ -695,43 +1012,45 @@ - float var22 = 14.0F; - float var23 = 7.0F; - float var24 = 9.0F; -- switch(var6) { -- case 1: -- case 3: -- var21 = 7.0F; -- var22 = 9.0F; -- var23 = 2.0F; -- var24 = 14.0F; -- case 0: -- case 2: -- default: -- this.setRenderBounds((double)(var21 / 16.0F + (float)var12), 0.125D, (double)(var23 / 16.0F + (float)var14), (double)(var22 / 16.0F + (float)var12), 0.25D, (double)(var24 / 16.0F + (float)var14)); -- double var25 = (double)var20.getInterpolatedU((double)var21); -- double var27 = (double)var20.getInterpolatedV((double)var23); -- double var29 = (double)var20.getInterpolatedU((double)var22); -- double var31 = (double)var20.getInterpolatedV((double)var24); -- var8.addVertexWithUV((double)((float)var2 + var21 / 16.0F) + var12, (double)((float)var3 + 0.25F), (double)((float)var4 + var23 / 16.0F) + var14, var25, var27); -- var8.addVertexWithUV((double)((float)var2 + var21 / 16.0F) + var12, (double)((float)var3 + 0.25F), (double)((float)var4 + var24 / 16.0F) + var14, var25, var31); -- var8.addVertexWithUV((double)((float)var2 + var22 / 16.0F) + var12, (double)((float)var3 + 0.25F), (double)((float)var4 + var24 / 16.0F) + var14, var29, var31); -- var8.addVertexWithUV((double)((float)var2 + var22 / 16.0F) + var12, (double)((float)var3 + 0.25F), (double)((float)var4 + var23 / 16.0F) + var14, var29, var27); -- this.renderStandardBlock(var1, var2, var3, var4); -- this.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 0.125D, 1.0D); -- this.clearOverrideBlockTexture(); -+ -+ switch (var6) { -+ case 1: -+ case 3: -+ var21 = 7.0F; -+ var22 = 9.0F; -+ var23 = 2.0F; -+ var24 = 14.0F; -+ -+ case 0: -+ case 2: -+ default: -+ this.setRenderBounds((double)(var21 / 16.0F + (float)var12), 0.125D, (double)(var23 / 16.0F + (float)var14), (double)(var22 / 16.0F + (float)var12), 0.25D, (double)(var24 / 16.0F + (float)var14)); -+ double var25 = (double)var20.getInterpolatedU((double)var21); -+ double var27 = (double)var20.getInterpolatedV((double)var23); -+ double var29 = (double)var20.getInterpolatedU((double)var22); -+ double var31 = (double)var20.getInterpolatedV((double)var24); -+ var8.addVertexWithUV((double)((float)par2 + var21 / 16.0F) + var12, (double)((float)par3 + 0.25F), (double)((float)par4 + var23 / 16.0F) + var14, var25, var27); -+ var8.addVertexWithUV((double)((float)par2 + var21 / 16.0F) + var12, (double)((float)par3 + 0.25F), (double)((float)par4 + var24 / 16.0F) + var14, var25, var31); -+ var8.addVertexWithUV((double)((float)par2 + var22 / 16.0F) + var12, (double)((float)par3 + 0.25F), (double)((float)par4 + var24 / 16.0F) + var14, var29, var31); -+ var8.addVertexWithUV((double)((float)par2 + var22 / 16.0F) + var12, (double)((float)par3 + 0.25F), (double)((float)par4 + var23 / 16.0F) + var14, var29, var27); -+ this.renderStandardBlock(par1BlockRedstoneRepeater, par2, par3, par4); -+ this.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 0.125D, 1.0D); -+ this.clearOverrideBlockTexture(); - } - } - -- var8.setBrightness(var1.getMixedBrightnessForBlock(this.blockAccess, var2, var3, var4)); -+ var8.setBrightness(par1BlockRedstoneRepeater.getMixedBrightnessForBlock(this.blockAccess, par2, par3, par4)); - var8.setColorOpaque_F(1.0F, 1.0F, 1.0F); -- this.renderTorchAtAngle(var1, (double)var2 + var16, (double)var3 + var9, (double)var4 + var18, 0.0D, 0.0D, 0); -- this.renderBlockRedstoneLogic(var1, var2, var3, var4); -+ this.renderTorchAtAngle(par1BlockRedstoneRepeater, (double)par2 + var16, (double)par3 + var9, (double)par4 + var18, 0.0D, 0.0D, 0); -+ this.renderBlockRedstoneLogic(par1BlockRedstoneRepeater, par2, par3, par4); - return true; - } - -- private boolean renderBlockComparator(BlockComparator var1, int var2, int var3, int var4) { -+ private boolean renderBlockComparator(BlockComparator par1BlockComparator, int par2, int par3, int par4) { - Tessellator var5 = Tessellator.instance; -- var5.setBrightness(var1.getMixedBrightnessForBlock(this.blockAccess, var2, var3, var4)); -+ var5.setBrightness(par1BlockComparator.getMixedBrightnessForBlock(this.blockAccess, par2, par3, par4)); - var5.setColorOpaque_F(1.0F, 1.0F, 1.0F); -- int var6 = this.blockAccess.getBlockMetadata(var2, var3, var4); -+ int var6 = this.blockAccess.getBlockMetadata(par2, par3, par4); - int var7 = var6 & 3; - double var8 = 0.0D; - double var10 = -0.1875D; -@@ -739,154 +1058,164 @@ - double var14 = 0.0D; - double var16 = 0.0D; - Icon var18; -- if(var1.func_94490_c(var6)) { -+ -+ if (par1BlockComparator.func_94490_c(var6)) { - var18 = Block.torchRedstoneActive.getBlockTextureFromSide(0); - } else { - var10 -= 0.1875D; - var18 = Block.torchRedstoneIdle.getBlockTextureFromSide(0); - } - -- switch(var7) { -- case 0: -- var12 = -0.3125D; -- var16 = 1.0D; -- break; -- case 1: -- var8 = 0.3125D; -- var14 = -1.0D; -- break; -- case 2: -- var12 = 0.3125D; -- var16 = -1.0D; -- break; -- case 3: -- var8 = -0.3125D; -- var14 = 1.0D; -+ switch (var7) { -+ case 0: -+ var12 = -0.3125D; -+ var16 = 1.0D; -+ break; -+ -+ case 1: -+ var8 = 0.3125D; -+ var14 = -1.0D; -+ break; -+ -+ case 2: -+ var12 = 0.3125D; -+ var16 = -1.0D; -+ break; -+ -+ case 3: -+ var8 = -0.3125D; -+ var14 = 1.0D; - } - -- this.renderTorchAtAngle(var1, (double)var2 + 0.25D * var14 + 0.1875D * var16, (double)((float)var3 - 3.0F / 16.0F), (double)var4 + 0.25D * var16 + 0.1875D * var14, 0.0D, 0.0D, var6); -- this.renderTorchAtAngle(var1, (double)var2 + 0.25D * var14 + -0.1875D * var16, (double)((float)var3 - 3.0F / 16.0F), (double)var4 + 0.25D * var16 + -0.1875D * var14, 0.0D, 0.0D, var6); -+ this.renderTorchAtAngle(par1BlockComparator, (double)par2 + 0.25D * var14 + 0.1875D * var16, (double)((float)par3 - 0.1875F), (double)par4 + 0.25D * var16 + 0.1875D * var14, 0.0D, 0.0D, var6); -+ this.renderTorchAtAngle(par1BlockComparator, (double)par2 + 0.25D * var14 + -0.1875D * var16, (double)((float)par3 - 0.1875F), (double)par4 + 0.25D * var16 + -0.1875D * var14, 0.0D, 0.0D, var6); - this.setOverrideBlockTexture(var18); -- this.renderTorchAtAngle(var1, (double)var2 + var8, (double)var3 + var10, (double)var4 + var12, 0.0D, 0.0D, var6); -+ this.renderTorchAtAngle(par1BlockComparator, (double)par2 + var8, (double)par3 + var10, (double)par4 + var12, 0.0D, 0.0D, var6); - this.clearOverrideBlockTexture(); -- this.renderBlockRedstoneLogicMetadata(var1, var2, var3, var4, var7); -+ this.renderBlockRedstoneLogicMetadata(par1BlockComparator, par2, par3, par4, var7); - return true; - } - -- private boolean renderBlockRedstoneLogic(BlockRedstoneLogic var1, int var2, int var3, int var4) { -+ private boolean renderBlockRedstoneLogic(BlockRedstoneLogic par1BlockRedstoneLogic, int par2, int par3, int par4) { - Tessellator var5 = Tessellator.instance; -- this.renderBlockRedstoneLogicMetadata(var1, var2, var3, var4, this.blockAccess.getBlockMetadata(var2, var3, var4) & 3); -+ this.renderBlockRedstoneLogicMetadata(par1BlockRedstoneLogic, par2, par3, par4, this.blockAccess.getBlockMetadata(par2, par3, par4) & 3); - return true; - } - -- private void renderBlockRedstoneLogicMetadata(BlockRedstoneLogic var1, int var2, int var3, int var4, int var5) { -- this.renderStandardBlock(var1, var2, var3, var4); -+ private void renderBlockRedstoneLogicMetadata(BlockRedstoneLogic par1BlockRedstoneLogic, int par2, int par3, int par4, int par5) { -+ this.renderStandardBlock(par1BlockRedstoneLogic, par2, par3, par4); - Tessellator var6 = Tessellator.instance; -- var6.setBrightness(var1.getMixedBrightnessForBlock(this.blockAccess, var2, var3, var4)); -+ var6.setBrightness(par1BlockRedstoneLogic.getMixedBrightnessForBlock(this.blockAccess, par2, par3, par4)); - var6.setColorOpaque_F(1.0F, 1.0F, 1.0F); -- int var7 = this.blockAccess.getBlockMetadata(var2, var3, var4); -- Icon var8 = this.getBlockIconFromSideAndMetadata(var1, 1, var7); -- double var9 = (double)var8.getMinU(); -- double var11 = (double)var8.getMaxU(); -- double var13 = (double)var8.getMinV(); -- double var15 = (double)var8.getMaxV(); -- double var17 = 0.125D; -- double var19 = (double)(var2 + 1); -- double var21 = (double)(var2 + 1); -- double var23 = (double)(var2 + 0); -- double var25 = (double)(var2 + 0); -- double var27 = (double)(var4 + 0); -- double var29 = (double)(var4 + 1); -- double var31 = (double)(var4 + 1); -- double var33 = (double)(var4 + 0); -- double var35 = (double)var3 + var17; -- if(var5 == 2) { -- var21 = (double)(var2 + 0); -- var19 = var21; -- var25 = (double)(var2 + 1); -- var23 = var25; -- var33 = (double)(var4 + 1); -- var27 = var33; -- var31 = (double)(var4 + 0); -- var29 = var31; -- } else if(var5 == 3) { -- var25 = (double)(var2 + 0); -- var19 = var25; -- var23 = (double)(var2 + 1); -- var21 = var23; -- var29 = (double)(var4 + 0); -- var27 = var29; -- var33 = (double)(var4 + 1); -- var31 = var33; -- } else if(var5 == 1) { -- var25 = (double)(var2 + 1); -- var19 = var25; -- var23 = (double)(var2 + 0); -- var21 = var23; -- var29 = (double)(var4 + 1); -- var27 = var29; -- var33 = (double)(var4 + 0); -- var31 = var33; -+ int var7 = this.blockAccess.getBlockMetadata(par2, par3, par4); -+ Icon var8 = this.getBlockIconFromSideAndMetadata(par1BlockRedstoneLogic, 1, var7); -+ var8 = CTMUtils.getTile(this, par1BlockRedstoneLogic, par2, par3, par4, var8, var6); -+ -+ if (var8 != null) { -+ var6 = TessellatorUtils.getTessellator(var6, var8); -+ double var9 = (double)var8.getMinU(); -+ double var11 = (double)var8.getMaxU(); -+ double var13 = (double)var8.getMinV(); -+ double var15 = (double)var8.getMaxV(); -+ double var17 = 0.125D; -+ double var19 = (double)(par2 + 1); -+ double var21 = (double)(par2 + 1); -+ double var23 = (double)(par2 + 0); -+ double var25 = (double)(par2 + 0); -+ double var27 = (double)(par4 + 0); -+ double var29 = (double)(par4 + 1); -+ double var31 = (double)(par4 + 1); -+ double var33 = (double)(par4 + 0); -+ double var35 = (double)par3 + var17; -+ -+ if (par5 == 2) { -+ var19 = var21 = (double)(par2 + 0); -+ var23 = var25 = (double)(par2 + 1); -+ var27 = var33 = (double)(par4 + 1); -+ var29 = var31 = (double)(par4 + 0); -+ } else if (par5 == 3) { -+ var19 = var25 = (double)(par2 + 0); -+ var21 = var23 = (double)(par2 + 1); -+ var27 = var29 = (double)(par4 + 0); -+ var31 = var33 = (double)(par4 + 1); -+ } else if (par5 == 1) { -+ var19 = var25 = (double)(par2 + 1); -+ var21 = var23 = (double)(par2 + 0); -+ var27 = var29 = (double)(par4 + 1); -+ var31 = var33 = (double)(par4 + 0); -+ } -+ -+ var6.addVertexWithUV(var25, var35, var33, var9, var13); -+ var6.addVertexWithUV(var23, var35, var31, var9, var15); -+ var6.addVertexWithUV(var21, var35, var29, var11, var15); -+ var6.addVertexWithUV(var19, var35, var27, var11, var13); - } -- -- var6.addVertexWithUV(var25, var35, var33, var9, var13); -- var6.addVertexWithUV(var23, var35, var31, var9, var15); -- var6.addVertexWithUV(var21, var35, var29, var11, var15); -- var6.addVertexWithUV(var19, var35, var27, var11, var13); - } - -- public void renderPistonBaseAllFaces(Block var1, int var2, int var3, int var4) { -+ /** -+ * Render all faces of the piston base -+ */ -+ public void renderPistonBaseAllFaces(Block par1Block, int par2, int par3, int par4) { - this.renderAllFaces = true; -- this.renderPistonBase(var1, var2, var3, var4, true); -+ this.renderPistonBase(par1Block, par2, par3, par4, true); - this.renderAllFaces = false; - } - -- private boolean renderPistonBase(Block var1, int var2, int var3, int var4, boolean var5) { -- int var6 = this.blockAccess.getBlockMetadata(var2, var3, var4); -- boolean var7 = var5 || (var6 & 8) != 0; -+ /** -+ * renders a block as a piston base -+ */ -+ private boolean renderPistonBase(Block par1Block, int par2, int par3, int par4, boolean par5) { -+ int var6 = this.blockAccess.getBlockMetadata(par2, par3, par4); -+ boolean var7 = par5 || (var6 & 8) != 0; - int var8 = BlockPistonBase.getOrientation(var6); - float var9 = 0.25F; -- if(var7) { -- switch(var8) { -- case 0: -- this.uvRotateEast = 3; -- this.uvRotateWest = 3; -- this.uvRotateSouth = 3; -- this.uvRotateNorth = 3; -- this.setRenderBounds(0.0D, 0.25D, 0.0D, 1.0D, 1.0D, 1.0D); -- break; -- case 1: -- this.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 0.75D, 1.0D); -- break; -- case 2: -- this.uvRotateSouth = 1; -- this.uvRotateNorth = 2; -- this.setRenderBounds(0.0D, 0.0D, 0.25D, 1.0D, 1.0D, 1.0D); -- break; -- case 3: -- this.uvRotateSouth = 2; -- this.uvRotateNorth = 1; -- this.uvRotateTop = 3; -- this.uvRotateBottom = 3; -- this.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 0.75D); -- break; -- case 4: -- this.uvRotateEast = 1; -- this.uvRotateWest = 2; -- this.uvRotateTop = 2; -- this.uvRotateBottom = 1; -- this.setRenderBounds(0.25D, 0.0D, 0.0D, 1.0D, 1.0D, 1.0D); -- break; -- case 5: -- this.uvRotateEast = 2; -- this.uvRotateWest = 1; -- this.uvRotateTop = 1; -- this.uvRotateBottom = 2; -- this.setRenderBounds(0.0D, 0.0D, 0.0D, 0.75D, 1.0D, 1.0D); -+ -+ if (var7) { -+ switch (var8) { -+ case 0: -+ this.uvRotateEast = 3; -+ this.uvRotateWest = 3; -+ this.uvRotateSouth = 3; -+ this.uvRotateNorth = 3; -+ this.setRenderBounds(0.0D, 0.25D, 0.0D, 1.0D, 1.0D, 1.0D); -+ break; -+ -+ case 1: -+ this.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 0.75D, 1.0D); -+ break; -+ -+ case 2: -+ this.uvRotateSouth = 1; -+ this.uvRotateNorth = 2; -+ this.setRenderBounds(0.0D, 0.0D, 0.25D, 1.0D, 1.0D, 1.0D); -+ break; -+ -+ case 3: -+ this.uvRotateSouth = 2; -+ this.uvRotateNorth = 1; -+ this.uvRotateTop = 3; -+ this.uvRotateBottom = 3; -+ this.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 0.75D); -+ break; -+ -+ case 4: -+ this.uvRotateEast = 1; -+ this.uvRotateWest = 2; -+ this.uvRotateTop = 2; -+ this.uvRotateBottom = 1; -+ this.setRenderBounds(0.25D, 0.0D, 0.0D, 1.0D, 1.0D, 1.0D); -+ break; -+ -+ case 5: -+ this.uvRotateEast = 2; -+ this.uvRotateWest = 1; -+ this.uvRotateTop = 1; -+ this.uvRotateBottom = 2; -+ this.setRenderBounds(0.0D, 0.0D, 0.0D, 0.75D, 1.0D, 1.0D); - } - -- ((BlockPistonBase)var1).func_96479_b((float)this.renderMinX, (float)this.renderMinY, (float)this.renderMinZ, (float)this.renderMaxX, (float)this.renderMaxY, (float)this.renderMaxZ); -- this.renderStandardBlock(var1, var2, var3, var4); -+ ((BlockPistonBase)par1Block).func_96479_b((float)this.renderMinX, (float)this.renderMinY, (float)this.renderMinZ, (float)this.renderMaxX, (float)this.renderMaxY, (float)this.renderMaxZ); -+ this.renderStandardBlock(par1Block, par2, par3, par4); - this.uvRotateEast = 0; - this.uvRotateWest = 0; - this.uvRotateSouth = 0; -@@ -894,41 +1223,46 @@ - this.uvRotateTop = 0; - this.uvRotateBottom = 0; - this.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 1.0D); -- ((BlockPistonBase)var1).func_96479_b((float)this.renderMinX, (float)this.renderMinY, (float)this.renderMinZ, (float)this.renderMaxX, (float)this.renderMaxY, (float)this.renderMaxZ); -+ ((BlockPistonBase)par1Block).func_96479_b((float)this.renderMinX, (float)this.renderMinY, (float)this.renderMinZ, (float)this.renderMaxX, (float)this.renderMaxY, (float)this.renderMaxZ); - } else { -- switch(var8) { -- case 0: -- this.uvRotateEast = 3; -- this.uvRotateWest = 3; -- this.uvRotateSouth = 3; -- this.uvRotateNorth = 3; -- case 1: -- default: -- break; -- case 2: -- this.uvRotateSouth = 1; -- this.uvRotateNorth = 2; -- break; -- case 3: -- this.uvRotateSouth = 2; -- this.uvRotateNorth = 1; -- this.uvRotateTop = 3; -- this.uvRotateBottom = 3; -- break; -- case 4: -- this.uvRotateEast = 1; -- this.uvRotateWest = 2; -- this.uvRotateTop = 2; -- this.uvRotateBottom = 1; -- break; -- case 5: -- this.uvRotateEast = 2; -- this.uvRotateWest = 1; -- this.uvRotateTop = 1; -- this.uvRotateBottom = 2; -+ switch (var8) { -+ case 0: -+ this.uvRotateEast = 3; -+ this.uvRotateWest = 3; -+ this.uvRotateSouth = 3; -+ this.uvRotateNorth = 3; -+ -+ case 1: -+ default: -+ break; -+ -+ case 2: -+ this.uvRotateSouth = 1; -+ this.uvRotateNorth = 2; -+ break; -+ -+ case 3: -+ this.uvRotateSouth = 2; -+ this.uvRotateNorth = 1; -+ this.uvRotateTop = 3; -+ this.uvRotateBottom = 3; -+ break; -+ -+ case 4: -+ this.uvRotateEast = 1; -+ this.uvRotateWest = 2; -+ this.uvRotateTop = 2; -+ this.uvRotateBottom = 1; -+ break; -+ -+ case 5: -+ this.uvRotateEast = 2; -+ this.uvRotateWest = 1; -+ this.uvRotateTop = 1; -+ this.uvRotateBottom = 2; - } - -- this.renderStandardBlock(var1, var2, var3, var4); -+ this.renderStandardBlock(par1Block, par2, par3, par4); - this.uvRotateEast = 0; - this.uvRotateWest = 0; - this.uvRotateSouth = 0; -@@ -940,141 +1274,165 @@ - return true; - } - -- private void renderPistonRodUD(double var1, double var3, double var5, double var7, double var9, double var11, float var13, double var14) { -- Icon var16 = BlockPistonBase.getPistonBaseIcon("piston_side"); -- if(this.hasOverrideBlockTexture()) { -- var16 = this.overrideBlockTexture; -- } -- -- Tessellator var17 = Tessellator.instance; -- double var18 = (double)var16.getMinU(); -- double var20 = (double)var16.getMinV(); -- double var22 = (double)var16.getInterpolatedU(var14); -- double var24 = (double)var16.getInterpolatedV(4.0D); -- var17.setColorOpaque_F(var13, var13, var13); -- var17.addVertexWithUV(var1, var7, var9, var22, var20); -- var17.addVertexWithUV(var1, var5, var9, var18, var20); -- var17.addVertexWithUV(var3, var5, var11, var18, var24); -- var17.addVertexWithUV(var3, var7, var11, var22, var24); -- } -- -- private void renderPistonRodSN(double var1, double var3, double var5, double var7, double var9, double var11, float var13, double var14) { -- Icon var16 = BlockPistonBase.getPistonBaseIcon("piston_side"); -- if(this.hasOverrideBlockTexture()) { -- var16 = this.overrideBlockTexture; -- } -- -- Tessellator var17 = Tessellator.instance; -- double var18 = (double)var16.getMinU(); -- double var20 = (double)var16.getMinV(); -- double var22 = (double)var16.getInterpolatedU(var14); -- double var24 = (double)var16.getInterpolatedV(4.0D); -- var17.setColorOpaque_F(var13, var13, var13); -- var17.addVertexWithUV(var1, var5, var11, var22, var20); -- var17.addVertexWithUV(var1, var5, var9, var18, var20); -- var17.addVertexWithUV(var3, var7, var9, var18, var24); -- var17.addVertexWithUV(var3, var7, var11, var22, var24); -- } -- -- private void renderPistonRodEW(double var1, double var3, double var5, double var7, double var9, double var11, float var13, double var14) { -- Icon var16 = BlockPistonBase.getPistonBaseIcon("piston_side"); -- if(this.hasOverrideBlockTexture()) { -- var16 = this.overrideBlockTexture; -- } -- -- Tessellator var17 = Tessellator.instance; -- double var18 = (double)var16.getMinU(); -- double var20 = (double)var16.getMinV(); -- double var22 = (double)var16.getInterpolatedU(var14); -- double var24 = (double)var16.getInterpolatedV(4.0D); -- var17.setColorOpaque_F(var13, var13, var13); -- var17.addVertexWithUV(var3, var5, var9, var22, var20); -- var17.addVertexWithUV(var1, var5, var9, var18, var20); -- var17.addVertexWithUV(var1, var7, var11, var18, var24); -- var17.addVertexWithUV(var3, var7, var11, var22, var24); -- } -- -- public void renderPistonExtensionAllFaces(Block var1, int var2, int var3, int var4, boolean var5) { -+ /** -+ * Render piston rod up/down -+ */ -+ private void renderPistonRodUD(double par1, double par3, double par5, double par7, double par9, double par11, float par13, double par14) { -+ Icon var16 = BlockPistonBase.getPistonBaseIcon("piston_side"); -+ -+ if (this.hasOverrideBlockTexture()) { -+ var16 = this.overrideBlockTexture; -+ } -+ -+ Tessellator var17 = Tessellator.instance; -+ double var18 = (double)var16.getMinU(); -+ double var20 = (double)var16.getMinV(); -+ double var22 = (double)var16.getInterpolatedU(par14); -+ double var24 = (double)var16.getInterpolatedV(4.0D); -+ var17.setColorOpaque_F(par13, par13, par13); -+ var17.addVertexWithUV(par1, par7, par9, var22, var20); -+ var17.addVertexWithUV(par1, par5, par9, var18, var20); -+ var17.addVertexWithUV(par3, par5, par11, var18, var24); -+ var17.addVertexWithUV(par3, par7, par11, var22, var24); -+ } -+ -+ /** -+ * Render piston rod south/north -+ */ -+ private void renderPistonRodSN(double par1, double par3, double par5, double par7, double par9, double par11, float par13, double par14) { -+ Icon var16 = BlockPistonBase.getPistonBaseIcon("piston_side"); -+ -+ if (this.hasOverrideBlockTexture()) { -+ var16 = this.overrideBlockTexture; -+ } -+ -+ Tessellator var17 = Tessellator.instance; -+ double var18 = (double)var16.getMinU(); -+ double var20 = (double)var16.getMinV(); -+ double var22 = (double)var16.getInterpolatedU(par14); -+ double var24 = (double)var16.getInterpolatedV(4.0D); -+ var17.setColorOpaque_F(par13, par13, par13); -+ var17.addVertexWithUV(par1, par5, par11, var22, var20); -+ var17.addVertexWithUV(par1, par5, par9, var18, var20); -+ var17.addVertexWithUV(par3, par7, par9, var18, var24); -+ var17.addVertexWithUV(par3, par7, par11, var22, var24); -+ } -+ -+ /** -+ * Render piston rod east/west -+ */ -+ private void renderPistonRodEW(double par1, double par3, double par5, double par7, double par9, double par11, float par13, double par14) { -+ Icon var16 = BlockPistonBase.getPistonBaseIcon("piston_side"); -+ -+ if (this.hasOverrideBlockTexture()) { -+ var16 = this.overrideBlockTexture; -+ } -+ -+ Tessellator var17 = Tessellator.instance; -+ double var18 = (double)var16.getMinU(); -+ double var20 = (double)var16.getMinV(); -+ double var22 = (double)var16.getInterpolatedU(par14); -+ double var24 = (double)var16.getInterpolatedV(4.0D); -+ var17.setColorOpaque_F(par13, par13, par13); -+ var17.addVertexWithUV(par3, par5, par9, var22, var20); -+ var17.addVertexWithUV(par1, par5, par9, var18, var20); -+ var17.addVertexWithUV(par1, par7, par11, var18, var24); -+ var17.addVertexWithUV(par3, par7, par11, var22, var24); -+ } -+ -+ /** -+ * Render all faces of the piston extension -+ */ -+ public void renderPistonExtensionAllFaces(Block par1Block, int par2, int par3, int par4, boolean par5) { - this.renderAllFaces = true; -- this.renderPistonExtension(var1, var2, var3, var4, var5); -+ this.renderPistonExtension(par1Block, par2, par3, par4, par5); - this.renderAllFaces = false; - } - -- private boolean renderPistonExtension(Block var1, int var2, int var3, int var4, boolean var5) { -- int var6 = this.blockAccess.getBlockMetadata(var2, var3, var4); -+ /** -+ * renders the pushing part of a piston -+ */ -+ private boolean renderPistonExtension(Block par1Block, int par2, int par3, int par4, boolean par5) { -+ int var6 = this.blockAccess.getBlockMetadata(par2, par3, par4); - int var7 = BlockPistonExtension.getDirectionMeta(var6); - float var8 = 0.25F; -- float var9 = 6.0F / 16.0F; -- float var10 = 10.0F / 16.0F; -- float var11 = var1.getBlockBrightness(this.blockAccess, var2, var3, var4); -- float var12 = var5 ? 1.0F : 0.5F; -- double var13 = var5 ? 16.0D : 8.0D; -- switch(var7) { -- case 0: -- this.uvRotateEast = 3; -- this.uvRotateWest = 3; -- this.uvRotateSouth = 3; -- this.uvRotateNorth = 3; -- this.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 0.25D, 1.0D); -- this.renderStandardBlock(var1, var2, var3, var4); -- this.renderPistonRodUD((double)((float)var2 + 6.0F / 16.0F), (double)((float)var2 + 10.0F / 16.0F), (double)((float)var3 + 0.25F), (double)((float)var3 + 0.25F + var12), (double)((float)var4 + 10.0F / 16.0F), (double)((float)var4 + 10.0F / 16.0F), var11 * 0.8F, var13); -- this.renderPistonRodUD((double)((float)var2 + 10.0F / 16.0F), (double)((float)var2 + 6.0F / 16.0F), (double)((float)var3 + 0.25F), (double)((float)var3 + 0.25F + var12), (double)((float)var4 + 6.0F / 16.0F), (double)((float)var4 + 6.0F / 16.0F), var11 * 0.8F, var13); -- this.renderPistonRodUD((double)((float)var2 + 6.0F / 16.0F), (double)((float)var2 + 6.0F / 16.0F), (double)((float)var3 + 0.25F), (double)((float)var3 + 0.25F + var12), (double)((float)var4 + 6.0F / 16.0F), (double)((float)var4 + 10.0F / 16.0F), var11 * 0.6F, var13); -- this.renderPistonRodUD((double)((float)var2 + 10.0F / 16.0F), (double)((float)var2 + 10.0F / 16.0F), (double)((float)var3 + 0.25F), (double)((float)var3 + 0.25F + var12), (double)((float)var4 + 10.0F / 16.0F), (double)((float)var4 + 6.0F / 16.0F), var11 * 0.6F, var13); -- break; -- case 1: -- this.setRenderBounds(0.0D, 0.75D, 0.0D, 1.0D, 1.0D, 1.0D); -- this.renderStandardBlock(var1, var2, var3, var4); -- this.renderPistonRodUD((double)((float)var2 + 6.0F / 16.0F), (double)((float)var2 + 10.0F / 16.0F), (double)((float)var3 - 0.25F + 1.0F - var12), (double)((float)var3 - 0.25F + 1.0F), (double)((float)var4 + 10.0F / 16.0F), (double)((float)var4 + 10.0F / 16.0F), var11 * 0.8F, var13); -- this.renderPistonRodUD((double)((float)var2 + 10.0F / 16.0F), (double)((float)var2 + 6.0F / 16.0F), (double)((float)var3 - 0.25F + 1.0F - var12), (double)((float)var3 - 0.25F + 1.0F), (double)((float)var4 + 6.0F / 16.0F), (double)((float)var4 + 6.0F / 16.0F), var11 * 0.8F, var13); -- this.renderPistonRodUD((double)((float)var2 + 6.0F / 16.0F), (double)((float)var2 + 6.0F / 16.0F), (double)((float)var3 - 0.25F + 1.0F - var12), (double)((float)var3 - 0.25F + 1.0F), (double)((float)var4 + 6.0F / 16.0F), (double)((float)var4 + 10.0F / 16.0F), var11 * 0.6F, var13); -- this.renderPistonRodUD((double)((float)var2 + 10.0F / 16.0F), (double)((float)var2 + 10.0F / 16.0F), (double)((float)var3 - 0.25F + 1.0F - var12), (double)((float)var3 - 0.25F + 1.0F), (double)((float)var4 + 10.0F / 16.0F), (double)((float)var4 + 6.0F / 16.0F), var11 * 0.6F, var13); -- break; -- case 2: -- this.uvRotateSouth = 1; -- this.uvRotateNorth = 2; -- this.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 0.25D); -- this.renderStandardBlock(var1, var2, var3, var4); -- this.renderPistonRodSN((double)((float)var2 + 6.0F / 16.0F), (double)((float)var2 + 6.0F / 16.0F), (double)((float)var3 + 10.0F / 16.0F), (double)((float)var3 + 6.0F / 16.0F), (double)((float)var4 + 0.25F), (double)((float)var4 + 0.25F + var12), var11 * 0.6F, var13); -- this.renderPistonRodSN((double)((float)var2 + 10.0F / 16.0F), (double)((float)var2 + 10.0F / 16.0F), (double)((float)var3 + 6.0F / 16.0F), (double)((float)var3 + 10.0F / 16.0F), (double)((float)var4 + 0.25F), (double)((float)var4 + 0.25F + var12), var11 * 0.6F, var13); -- this.renderPistonRodSN((double)((float)var2 + 6.0F / 16.0F), (double)((float)var2 + 10.0F / 16.0F), (double)((float)var3 + 6.0F / 16.0F), (double)((float)var3 + 6.0F / 16.0F), (double)((float)var4 + 0.25F), (double)((float)var4 + 0.25F + var12), var11 * 0.5F, var13); -- this.renderPistonRodSN((double)((float)var2 + 10.0F / 16.0F), (double)((float)var2 + 6.0F / 16.0F), (double)((float)var3 + 10.0F / 16.0F), (double)((float)var3 + 10.0F / 16.0F), (double)((float)var4 + 0.25F), (double)((float)var4 + 0.25F + var12), var11, var13); -- break; -- case 3: -- this.uvRotateSouth = 2; -- this.uvRotateNorth = 1; -- this.uvRotateTop = 3; -- this.uvRotateBottom = 3; -- this.setRenderBounds(0.0D, 0.0D, 0.75D, 1.0D, 1.0D, 1.0D); -- this.renderStandardBlock(var1, var2, var3, var4); -- this.renderPistonRodSN((double)((float)var2 + 6.0F / 16.0F), (double)((float)var2 + 6.0F / 16.0F), (double)((float)var3 + 10.0F / 16.0F), (double)((float)var3 + 6.0F / 16.0F), (double)((float)var4 - 0.25F + 1.0F - var12), (double)((float)var4 - 0.25F + 1.0F), var11 * 0.6F, var13); -- this.renderPistonRodSN((double)((float)var2 + 10.0F / 16.0F), (double)((float)var2 + 10.0F / 16.0F), (double)((float)var3 + 6.0F / 16.0F), (double)((float)var3 + 10.0F / 16.0F), (double)((float)var4 - 0.25F + 1.0F - var12), (double)((float)var4 - 0.25F + 1.0F), var11 * 0.6F, var13); -- this.renderPistonRodSN((double)((float)var2 + 6.0F / 16.0F), (double)((float)var2 + 10.0F / 16.0F), (double)((float)var3 + 6.0F / 16.0F), (double)((float)var3 + 6.0F / 16.0F), (double)((float)var4 - 0.25F + 1.0F - var12), (double)((float)var4 - 0.25F + 1.0F), var11 * 0.5F, var13); -- this.renderPistonRodSN((double)((float)var2 + 10.0F / 16.0F), (double)((float)var2 + 6.0F / 16.0F), (double)((float)var3 + 10.0F / 16.0F), (double)((float)var3 + 10.0F / 16.0F), (double)((float)var4 - 0.25F + 1.0F - var12), (double)((float)var4 - 0.25F + 1.0F), var11, var13); -- break; -- case 4: -- this.uvRotateEast = 1; -- this.uvRotateWest = 2; -- this.uvRotateTop = 2; -- this.uvRotateBottom = 1; -- this.setRenderBounds(0.0D, 0.0D, 0.0D, 0.25D, 1.0D, 1.0D); -- this.renderStandardBlock(var1, var2, var3, var4); -- this.renderPistonRodEW((double)((float)var2 + 0.25F), (double)((float)var2 + 0.25F + var12), (double)((float)var3 + 6.0F / 16.0F), (double)((float)var3 + 6.0F / 16.0F), (double)((float)var4 + 10.0F / 16.0F), (double)((float)var4 + 6.0F / 16.0F), var11 * 0.5F, var13); -- this.renderPistonRodEW((double)((float)var2 + 0.25F), (double)((float)var2 + 0.25F + var12), (double)((float)var3 + 10.0F / 16.0F), (double)((float)var3 + 10.0F / 16.0F), (double)((float)var4 + 6.0F / 16.0F), (double)((float)var4 + 10.0F / 16.0F), var11, var13); -- this.renderPistonRodEW((double)((float)var2 + 0.25F), (double)((float)var2 + 0.25F + var12), (double)((float)var3 + 6.0F / 16.0F), (double)((float)var3 + 10.0F / 16.0F), (double)((float)var4 + 6.0F / 16.0F), (double)((float)var4 + 6.0F / 16.0F), var11 * 0.6F, var13); -- this.renderPistonRodEW((double)((float)var2 + 0.25F), (double)((float)var2 + 0.25F + var12), (double)((float)var3 + 10.0F / 16.0F), (double)((float)var3 + 6.0F / 16.0F), (double)((float)var4 + 10.0F / 16.0F), (double)((float)var4 + 10.0F / 16.0F), var11 * 0.6F, var13); -- break; -- case 5: -- this.uvRotateEast = 2; -- this.uvRotateWest = 1; -- this.uvRotateTop = 1; -- this.uvRotateBottom = 2; -- this.setRenderBounds(0.75D, 0.0D, 0.0D, 1.0D, 1.0D, 1.0D); -- this.renderStandardBlock(var1, var2, var3, var4); -- this.renderPistonRodEW((double)((float)var2 - 0.25F + 1.0F - var12), (double)((float)var2 - 0.25F + 1.0F), (double)((float)var3 + 6.0F / 16.0F), (double)((float)var3 + 6.0F / 16.0F), (double)((float)var4 + 10.0F / 16.0F), (double)((float)var4 + 6.0F / 16.0F), var11 * 0.5F, var13); -- this.renderPistonRodEW((double)((float)var2 - 0.25F + 1.0F - var12), (double)((float)var2 - 0.25F + 1.0F), (double)((float)var3 + 10.0F / 16.0F), (double)((float)var3 + 10.0F / 16.0F), (double)((float)var4 + 6.0F / 16.0F), (double)((float)var4 + 10.0F / 16.0F), var11, var13); -- this.renderPistonRodEW((double)((float)var2 - 0.25F + 1.0F - var12), (double)((float)var2 - 0.25F + 1.0F), (double)((float)var3 + 6.0F / 16.0F), (double)((float)var3 + 10.0F / 16.0F), (double)((float)var4 + 6.0F / 16.0F), (double)((float)var4 + 6.0F / 16.0F), var11 * 0.6F, var13); -- this.renderPistonRodEW((double)((float)var2 - 0.25F + 1.0F - var12), (double)((float)var2 - 0.25F + 1.0F), (double)((float)var3 + 10.0F / 16.0F), (double)((float)var3 + 6.0F / 16.0F), (double)((float)var4 + 10.0F / 16.0F), (double)((float)var4 + 10.0F / 16.0F), var11 * 0.6F, var13); -+ float var9 = 0.375F; -+ float var10 = 0.625F; -+ float var11 = par1Block.getBlockBrightness(this.blockAccess, par2, par3, par4); -+ float var12 = par5 ? 1.0F : 0.5F; -+ double var13 = par5 ? 16.0D : 8.0D; -+ -+ switch (var7) { -+ case 0: -+ this.uvRotateEast = 3; -+ this.uvRotateWest = 3; -+ this.uvRotateSouth = 3; -+ this.uvRotateNorth = 3; -+ this.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 0.25D, 1.0D); -+ this.renderStandardBlock(par1Block, par2, par3, par4); -+ this.renderPistonRodUD((double)((float)par2 + 0.375F), (double)((float)par2 + 0.625F), (double)((float)par3 + 0.25F), (double)((float)par3 + 0.25F + var12), (double)((float)par4 + 0.625F), (double)((float)par4 + 0.625F), var11 * 0.8F, var13); -+ this.renderPistonRodUD((double)((float)par2 + 0.625F), (double)((float)par2 + 0.375F), (double)((float)par3 + 0.25F), (double)((float)par3 + 0.25F + var12), (double)((float)par4 + 0.375F), (double)((float)par4 + 0.375F), var11 * 0.8F, var13); -+ this.renderPistonRodUD((double)((float)par2 + 0.375F), (double)((float)par2 + 0.375F), (double)((float)par3 + 0.25F), (double)((float)par3 + 0.25F + var12), (double)((float)par4 + 0.375F), (double)((float)par4 + 0.625F), var11 * 0.6F, var13); -+ this.renderPistonRodUD((double)((float)par2 + 0.625F), (double)((float)par2 + 0.625F), (double)((float)par3 + 0.25F), (double)((float)par3 + 0.25F + var12), (double)((float)par4 + 0.625F), (double)((float)par4 + 0.375F), var11 * 0.6F, var13); -+ break; -+ -+ case 1: -+ this.setRenderBounds(0.0D, 0.75D, 0.0D, 1.0D, 1.0D, 1.0D); -+ this.renderStandardBlock(par1Block, par2, par3, par4); -+ this.renderPistonRodUD((double)((float)par2 + 0.375F), (double)((float)par2 + 0.625F), (double)((float)par3 - 0.25F + 1.0F - var12), (double)((float)par3 - 0.25F + 1.0F), (double)((float)par4 + 0.625F), (double)((float)par4 + 0.625F), var11 * 0.8F, var13); -+ this.renderPistonRodUD((double)((float)par2 + 0.625F), (double)((float)par2 + 0.375F), (double)((float)par3 - 0.25F + 1.0F - var12), (double)((float)par3 - 0.25F + 1.0F), (double)((float)par4 + 0.375F), (double)((float)par4 + 0.375F), var11 * 0.8F, var13); -+ this.renderPistonRodUD((double)((float)par2 + 0.375F), (double)((float)par2 + 0.375F), (double)((float)par3 - 0.25F + 1.0F - var12), (double)((float)par3 - 0.25F + 1.0F), (double)((float)par4 + 0.375F), (double)((float)par4 + 0.625F), var11 * 0.6F, var13); -+ this.renderPistonRodUD((double)((float)par2 + 0.625F), (double)((float)par2 + 0.625F), (double)((float)par3 - 0.25F + 1.0F - var12), (double)((float)par3 - 0.25F + 1.0F), (double)((float)par4 + 0.625F), (double)((float)par4 + 0.375F), var11 * 0.6F, var13); -+ break; -+ -+ case 2: -+ this.uvRotateSouth = 1; -+ this.uvRotateNorth = 2; -+ this.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 0.25D); -+ this.renderStandardBlock(par1Block, par2, par3, par4); -+ this.renderPistonRodSN((double)((float)par2 + 0.375F), (double)((float)par2 + 0.375F), (double)((float)par3 + 0.625F), (double)((float)par3 + 0.375F), (double)((float)par4 + 0.25F), (double)((float)par4 + 0.25F + var12), var11 * 0.6F, var13); -+ this.renderPistonRodSN((double)((float)par2 + 0.625F), (double)((float)par2 + 0.625F), (double)((float)par3 + 0.375F), (double)((float)par3 + 0.625F), (double)((float)par4 + 0.25F), (double)((float)par4 + 0.25F + var12), var11 * 0.6F, var13); -+ this.renderPistonRodSN((double)((float)par2 + 0.375F), (double)((float)par2 + 0.625F), (double)((float)par3 + 0.375F), (double)((float)par3 + 0.375F), (double)((float)par4 + 0.25F), (double)((float)par4 + 0.25F + var12), var11 * 0.5F, var13); -+ this.renderPistonRodSN((double)((float)par2 + 0.625F), (double)((float)par2 + 0.375F), (double)((float)par3 + 0.625F), (double)((float)par3 + 0.625F), (double)((float)par4 + 0.25F), (double)((float)par4 + 0.25F + var12), var11, var13); -+ break; -+ -+ case 3: -+ this.uvRotateSouth = 2; -+ this.uvRotateNorth = 1; -+ this.uvRotateTop = 3; -+ this.uvRotateBottom = 3; -+ this.setRenderBounds(0.0D, 0.0D, 0.75D, 1.0D, 1.0D, 1.0D); -+ this.renderStandardBlock(par1Block, par2, par3, par4); -+ this.renderPistonRodSN((double)((float)par2 + 0.375F), (double)((float)par2 + 0.375F), (double)((float)par3 + 0.625F), (double)((float)par3 + 0.375F), (double)((float)par4 - 0.25F + 1.0F - var12), (double)((float)par4 - 0.25F + 1.0F), var11 * 0.6F, var13); -+ this.renderPistonRodSN((double)((float)par2 + 0.625F), (double)((float)par2 + 0.625F), (double)((float)par3 + 0.375F), (double)((float)par3 + 0.625F), (double)((float)par4 - 0.25F + 1.0F - var12), (double)((float)par4 - 0.25F + 1.0F), var11 * 0.6F, var13); -+ this.renderPistonRodSN((double)((float)par2 + 0.375F), (double)((float)par2 + 0.625F), (double)((float)par3 + 0.375F), (double)((float)par3 + 0.375F), (double)((float)par4 - 0.25F + 1.0F - var12), (double)((float)par4 - 0.25F + 1.0F), var11 * 0.5F, var13); -+ this.renderPistonRodSN((double)((float)par2 + 0.625F), (double)((float)par2 + 0.375F), (double)((float)par3 + 0.625F), (double)((float)par3 + 0.625F), (double)((float)par4 - 0.25F + 1.0F - var12), (double)((float)par4 - 0.25F + 1.0F), var11, var13); -+ break; -+ -+ case 4: -+ this.uvRotateEast = 1; -+ this.uvRotateWest = 2; -+ this.uvRotateTop = 2; -+ this.uvRotateBottom = 1; -+ this.setRenderBounds(0.0D, 0.0D, 0.0D, 0.25D, 1.0D, 1.0D); -+ this.renderStandardBlock(par1Block, par2, par3, par4); -+ this.renderPistonRodEW((double)((float)par2 + 0.25F), (double)((float)par2 + 0.25F + var12), (double)((float)par3 + 0.375F), (double)((float)par3 + 0.375F), (double)((float)par4 + 0.625F), (double)((float)par4 + 0.375F), var11 * 0.5F, var13); -+ this.renderPistonRodEW((double)((float)par2 + 0.25F), (double)((float)par2 + 0.25F + var12), (double)((float)par3 + 0.625F), (double)((float)par3 + 0.625F), (double)((float)par4 + 0.375F), (double)((float)par4 + 0.625F), var11, var13); -+ this.renderPistonRodEW((double)((float)par2 + 0.25F), (double)((float)par2 + 0.25F + var12), (double)((float)par3 + 0.375F), (double)((float)par3 + 0.625F), (double)((float)par4 + 0.375F), (double)((float)par4 + 0.375F), var11 * 0.6F, var13); -+ this.renderPistonRodEW((double)((float)par2 + 0.25F), (double)((float)par2 + 0.25F + var12), (double)((float)par3 + 0.625F), (double)((float)par3 + 0.375F), (double)((float)par4 + 0.625F), (double)((float)par4 + 0.625F), var11 * 0.6F, var13); -+ break; -+ -+ case 5: -+ this.uvRotateEast = 2; -+ this.uvRotateWest = 1; -+ this.uvRotateTop = 1; -+ this.uvRotateBottom = 2; -+ this.setRenderBounds(0.75D, 0.0D, 0.0D, 1.0D, 1.0D, 1.0D); -+ this.renderStandardBlock(par1Block, par2, par3, par4); -+ this.renderPistonRodEW((double)((float)par2 - 0.25F + 1.0F - var12), (double)((float)par2 - 0.25F + 1.0F), (double)((float)par3 + 0.375F), (double)((float)par3 + 0.375F), (double)((float)par4 + 0.625F), (double)((float)par4 + 0.375F), var11 * 0.5F, var13); -+ this.renderPistonRodEW((double)((float)par2 - 0.25F + 1.0F - var12), (double)((float)par2 - 0.25F + 1.0F), (double)((float)par3 + 0.625F), (double)((float)par3 + 0.625F), (double)((float)par4 + 0.375F), (double)((float)par4 + 0.625F), var11, var13); -+ this.renderPistonRodEW((double)((float)par2 - 0.25F + 1.0F - var12), (double)((float)par2 - 0.25F + 1.0F), (double)((float)par3 + 0.375F), (double)((float)par3 + 0.625F), (double)((float)par4 + 0.375F), (double)((float)par4 + 0.375F), var11 * 0.6F, var13); -+ this.renderPistonRodEW((double)((float)par2 - 0.25F + 1.0F - var12), (double)((float)par2 - 0.25F + 1.0F), (double)((float)par3 + 0.625F), (double)((float)par3 + 0.375F), (double)((float)par4 + 0.625F), (double)((float)par4 + 0.625F), var11 * 0.6F, var13); - } - - this.uvRotateEast = 0; -@@ -1087,1200 +1445,1354 @@ - return true; - } - -- public boolean renderBlockLever(Block var1, int var2, int var3, int var4) { -- int var5 = this.blockAccess.getBlockMetadata(var2, var3, var4); -+ /** -+ * Renders a lever block at the given coordinates -+ */ -+ public boolean renderBlockLever(Block par1Block, int par2, int par3, int par4) { -+ int var5 = this.blockAccess.getBlockMetadata(par2, par3, par4); - int var6 = var5 & 7; - boolean var7 = (var5 & 8) > 0; - Tessellator var8 = Tessellator.instance; - boolean var9 = this.hasOverrideBlockTexture(); -- if(!var9) { -+ -+ if (!var9) { - this.setOverrideBlockTexture(this.getBlockIcon(Block.cobblestone)); - } - - float var10 = 0.25F; -- float var11 = 3.0F / 16.0F; -- float var12 = 3.0F / 16.0F; -- if(var6 == 5) { -+ float var11 = 0.1875F; -+ float var12 = 0.1875F; -+ -+ if (var6 == 5) { - this.setRenderBounds((double)(0.5F - var11), 0.0D, (double)(0.5F - var10), (double)(0.5F + var11), (double)var12, (double)(0.5F + var10)); -- } else if(var6 == 6) { -+ } else if (var6 == 6) { - this.setRenderBounds((double)(0.5F - var10), 0.0D, (double)(0.5F - var11), (double)(0.5F + var10), (double)var12, (double)(0.5F + var11)); -- } else if(var6 == 4) { -+ } else if (var6 == 4) { - this.setRenderBounds((double)(0.5F - var11), (double)(0.5F - var10), (double)(1.0F - var12), (double)(0.5F + var11), (double)(0.5F + var10), 1.0D); -- } else if(var6 == 3) { -+ } else if (var6 == 3) { - this.setRenderBounds((double)(0.5F - var11), (double)(0.5F - var10), 0.0D, (double)(0.5F + var11), (double)(0.5F + var10), (double)var12); -- } else if(var6 == 2) { -+ } else if (var6 == 2) { - this.setRenderBounds((double)(1.0F - var12), (double)(0.5F - var10), (double)(0.5F - var11), 1.0D, (double)(0.5F + var10), (double)(0.5F + var11)); -- } else if(var6 == 1) { -+ } else if (var6 == 1) { - this.setRenderBounds(0.0D, (double)(0.5F - var10), (double)(0.5F - var11), (double)var12, (double)(0.5F + var10), (double)(0.5F + var11)); -- } else if(var6 == 0) { -+ } else if (var6 == 0) { - this.setRenderBounds((double)(0.5F - var10), (double)(1.0F - var12), (double)(0.5F - var11), (double)(0.5F + var10), 1.0D, (double)(0.5F + var11)); -- } else if(var6 == 7) { -+ } else if (var6 == 7) { - this.setRenderBounds((double)(0.5F - var11), (double)(1.0F - var12), (double)(0.5F - var10), (double)(0.5F + var11), 1.0D, (double)(0.5F + var10)); - } - -- this.renderStandardBlock(var1, var2, var3, var4); -- if(!var9) { -+ this.renderStandardBlock(par1Block, par2, par3, par4); -+ -+ if (!var9) { - this.clearOverrideBlockTexture(); - } - -- var8.setBrightness(var1.getMixedBrightnessForBlock(this.blockAccess, var2, var3, var4)); -+ var8.setBrightness(par1Block.getMixedBrightnessForBlock(this.blockAccess, par2, par3, par4)); - float var13 = 1.0F; -- if(Block.lightValue[var1.blockID] > 0) { -+ -+ if (Block.lightValue[par1Block.blockID] > 0) { - var13 = 1.0F; - } - - var8.setColorOpaque_F(var13, var13, var13); -- Icon var14 = this.getBlockIconFromSide(var1, 0); -- if(this.hasOverrideBlockTexture()) { -+ Icon var14 = this.getBlockIconFromSide(par1Block, 0); -+ -+ if (this.hasOverrideBlockTexture()) { - var14 = this.overrideBlockTexture; - } - -- double var15 = (double)var14.getMinU(); -- double var17 = (double)var14.getMinV(); -- double var19 = (double)var14.getMaxU(); -- double var21 = (double)var14.getMaxV(); -- Vec3[] var23 = new Vec3[8]; -- float var24 = 1.0F / 16.0F; -- float var25 = 1.0F / 16.0F; -- float var26 = 10.0F / 16.0F; -- var23[0] = this.blockAccess.getWorldVec3Pool().getVecFromPool((double)(-var24), 0.0D, (double)(-var25)); -- var23[1] = this.blockAccess.getWorldVec3Pool().getVecFromPool((double)var24, 0.0D, (double)(-var25)); -- var23[2] = this.blockAccess.getWorldVec3Pool().getVecFromPool((double)var24, 0.0D, (double)var25); -- var23[3] = this.blockAccess.getWorldVec3Pool().getVecFromPool((double)(-var24), 0.0D, (double)var25); -- var23[4] = this.blockAccess.getWorldVec3Pool().getVecFromPool((double)(-var24), (double)var26, (double)(-var25)); -- var23[5] = this.blockAccess.getWorldVec3Pool().getVecFromPool((double)var24, (double)var26, (double)(-var25)); -- var23[6] = this.blockAccess.getWorldVec3Pool().getVecFromPool((double)var24, (double)var26, (double)var25); -- var23[7] = this.blockAccess.getWorldVec3Pool().getVecFromPool((double)(-var24), (double)var26, (double)var25); -- -- for(int var27 = 0; var27 < 8; ++var27) { -- if(var7) { -- var23[var27].zCoord -= 1.0D / 16.0D; -- var23[var27].rotateAroundX((float)Math.PI * 2.0F / 9.0F); -- } else { -- var23[var27].zCoord += 1.0D / 16.0D; -- var23[var27].rotateAroundX(-((float)Math.PI * 2.0F / 9.0F)); -- } -- -- if(var6 == 0 || var6 == 7) { -- var23[var27].rotateAroundZ((float)Math.PI); -- } -- -- if(var6 == 6 || var6 == 0) { -- var23[var27].rotateAroundY((float)Math.PI * 0.5F); -- } -- -- if(var6 > 0 && var6 < 5) { -- var23[var27].yCoord -= 0.375D; -- var23[var27].rotateAroundX((float)Math.PI * 0.5F); -- if(var6 == 4) { -- var23[var27].rotateAroundY(0.0F); -- } -- -- if(var6 == 3) { -- var23[var27].rotateAroundY((float)Math.PI); -- } -- -- if(var6 == 2) { -- var23[var27].rotateAroundY((float)Math.PI * 0.5F); -- } -- -- if(var6 == 1) { -- var23[var27].rotateAroundY((float)Math.PI * -0.5F); -- } -- -- var23[var27].xCoord += (double)var2 + 0.5D; -- var23[var27].yCoord += (double)((float)var3 + 0.5F); -- var23[var27].zCoord += (double)var4 + 0.5D; -- } else if(var6 != 0 && var6 != 7) { -- var23[var27].xCoord += (double)var2 + 0.5D; -- var23[var27].yCoord += (double)((float)var3 + 2.0F / 16.0F); -- var23[var27].zCoord += (double)var4 + 0.5D; -- } else { -- var23[var27].xCoord += (double)var2 + 0.5D; -- var23[var27].yCoord += (double)((float)var3 + 14.0F / 16.0F); -- var23[var27].zCoord += (double)var4 + 0.5D; -- } -- } -- -- Vec3 var32 = null; -- Vec3 var28 = null; -- Vec3 var29 = null; -- Vec3 var30 = null; -- -- for(int var31 = 0; var31 < 6; ++var31) { -- if(var31 == 0) { -- var15 = (double)var14.getInterpolatedU(7.0D); -- var17 = (double)var14.getInterpolatedV(6.0D); -- var19 = (double)var14.getInterpolatedU(9.0D); -- var21 = (double)var14.getInterpolatedV(8.0D); -- } else if(var31 == 2) { -- var15 = (double)var14.getInterpolatedU(7.0D); -- var17 = (double)var14.getInterpolatedV(6.0D); -- var19 = (double)var14.getInterpolatedU(9.0D); -- var21 = (double)var14.getMaxV(); -- } -- -- if(var31 == 0) { -- var32 = var23[0]; -- var28 = var23[1]; -- var29 = var23[2]; -- var30 = var23[3]; -- } else if(var31 == 1) { -- var32 = var23[7]; -- var28 = var23[6]; -- var29 = var23[5]; -- var30 = var23[4]; -- } else if(var31 == 2) { -- var32 = var23[1]; -- var28 = var23[0]; -- var29 = var23[4]; -- var30 = var23[5]; -- } else if(var31 == 3) { -- var32 = var23[2]; -- var28 = var23[1]; -- var29 = var23[5]; -- var30 = var23[6]; -- } else if(var31 == 4) { -- var32 = var23[3]; -- var28 = var23[2]; -- var29 = var23[6]; -- var30 = var23[7]; -- } else if(var31 == 5) { -- var32 = var23[0]; -- var28 = var23[3]; -- var29 = var23[7]; -- var30 = var23[4]; -- } -- -- var8.addVertexWithUV(var32.xCoord, var32.yCoord, var32.zCoord, var15, var21); -- var8.addVertexWithUV(var28.xCoord, var28.yCoord, var28.zCoord, var19, var21); -- var8.addVertexWithUV(var29.xCoord, var29.yCoord, var29.zCoord, var19, var17); -- var8.addVertexWithUV(var30.xCoord, var30.yCoord, var30.zCoord, var15, var17); -- } -- -- return true; -+ var14 = CTMUtils.getTile(this, par1Block, par2, par3, par4, var14, var8); -+ -+ if (var14 == null) { -+ return false; -+ } else { -+ var8 = TessellatorUtils.getTessellator(var8, var14); -+ double var15 = (double)var14.getMinU(); -+ double var17 = (double)var14.getMinV(); -+ double var19 = (double)var14.getMaxU(); -+ double var21 = (double)var14.getMaxV(); -+ Vec3[] var23 = new Vec3[8]; -+ float var24 = 0.0625F; -+ float var25 = 0.0625F; -+ float var26 = 0.625F; -+ var23[0] = this.blockAccess.getWorldVec3Pool().getVecFromPool((double)(-var24), 0.0D, (double)(-var25)); -+ var23[1] = this.blockAccess.getWorldVec3Pool().getVecFromPool((double)var24, 0.0D, (double)(-var25)); -+ var23[2] = this.blockAccess.getWorldVec3Pool().getVecFromPool((double)var24, 0.0D, (double)var25); -+ var23[3] = this.blockAccess.getWorldVec3Pool().getVecFromPool((double)(-var24), 0.0D, (double)var25); -+ var23[4] = this.blockAccess.getWorldVec3Pool().getVecFromPool((double)(-var24), (double)var26, (double)(-var25)); -+ var23[5] = this.blockAccess.getWorldVec3Pool().getVecFromPool((double)var24, (double)var26, (double)(-var25)); -+ var23[6] = this.blockAccess.getWorldVec3Pool().getVecFromPool((double)var24, (double)var26, (double)var25); -+ var23[7] = this.blockAccess.getWorldVec3Pool().getVecFromPool((double)(-var24), (double)var26, (double)var25); -+ -+ for (int var27 = 0; var27 < 8; ++var27) { -+ if (var7) { -+ var23[var27].zCoord -= 0.0625D; -+ var23[var27].rotateAroundX(((float)Math.PI * 2F / 9F)); -+ } else { -+ var23[var27].zCoord += 0.0625D; -+ var23[var27].rotateAroundX(-((float)Math.PI * 2F / 9F)); -+ } -+ -+ if (var6 == 0 || var6 == 7) { -+ var23[var27].rotateAroundZ((float)Math.PI); -+ } -+ -+ if (var6 == 6 || var6 == 0) { -+ var23[var27].rotateAroundY(((float)Math.PI / 2F)); -+ } -+ -+ if (var6 > 0 && var6 < 5) { -+ var23[var27].yCoord -= 0.375D; -+ var23[var27].rotateAroundX(((float)Math.PI / 2F)); -+ -+ if (var6 == 4) { -+ var23[var27].rotateAroundY(0.0F); -+ } -+ -+ if (var6 == 3) { -+ var23[var27].rotateAroundY((float)Math.PI); -+ } -+ -+ if (var6 == 2) { -+ var23[var27].rotateAroundY(((float)Math.PI / 2F)); -+ } -+ -+ if (var6 == 1) { -+ var23[var27].rotateAroundY(-((float)Math.PI / 2F)); -+ } -+ -+ var23[var27].xCoord += (double)par2 + 0.5D; -+ var23[var27].yCoord += (double)((float)par3 + 0.5F); -+ var23[var27].zCoord += (double)par4 + 0.5D; -+ } else if (var6 != 0 && var6 != 7) { -+ var23[var27].xCoord += (double)par2 + 0.5D; -+ var23[var27].yCoord += (double)((float)par3 + 0.125F); -+ var23[var27].zCoord += (double)par4 + 0.5D; -+ } else { -+ var23[var27].xCoord += (double)par2 + 0.5D; -+ var23[var27].yCoord += (double)((float)par3 + 0.875F); -+ var23[var27].zCoord += (double)par4 + 0.5D; -+ } -+ } -+ -+ Vec3 var32 = null; -+ Vec3 var28 = null; -+ Vec3 var29 = null; -+ Vec3 var30 = null; -+ -+ for (int var31 = 0; var31 < 6; ++var31) { -+ if (var31 == 0) { -+ var15 = (double)var14.getInterpolatedU(7.0D); -+ var17 = (double)var14.getInterpolatedV(6.0D); -+ var19 = (double)var14.getInterpolatedU(9.0D); -+ var21 = (double)var14.getInterpolatedV(8.0D); -+ } else if (var31 == 2) { -+ var15 = (double)var14.getInterpolatedU(7.0D); -+ var17 = (double)var14.getInterpolatedV(6.0D); -+ var19 = (double)var14.getInterpolatedU(9.0D); -+ var21 = (double)var14.getMaxV(); -+ } -+ -+ if (var31 == 0) { -+ var32 = var23[0]; -+ var28 = var23[1]; -+ var29 = var23[2]; -+ var30 = var23[3]; -+ } else if (var31 == 1) { -+ var32 = var23[7]; -+ var28 = var23[6]; -+ var29 = var23[5]; -+ var30 = var23[4]; -+ } else if (var31 == 2) { -+ var32 = var23[1]; -+ var28 = var23[0]; -+ var29 = var23[4]; -+ var30 = var23[5]; -+ } else if (var31 == 3) { -+ var32 = var23[2]; -+ var28 = var23[1]; -+ var29 = var23[5]; -+ var30 = var23[6]; -+ } else if (var31 == 4) { -+ var32 = var23[3]; -+ var28 = var23[2]; -+ var29 = var23[6]; -+ var30 = var23[7]; -+ } else if (var31 == 5) { -+ var32 = var23[0]; -+ var28 = var23[3]; -+ var29 = var23[7]; -+ var30 = var23[4]; -+ } -+ -+ var8.addVertexWithUV(var32.xCoord, var32.yCoord, var32.zCoord, var15, var21); -+ var8.addVertexWithUV(var28.xCoord, var28.yCoord, var28.zCoord, var19, var21); -+ var8.addVertexWithUV(var29.xCoord, var29.yCoord, var29.zCoord, var19, var17); -+ var8.addVertexWithUV(var30.xCoord, var30.yCoord, var30.zCoord, var15, var17); -+ } -+ -+ return true; -+ } - } - -- public boolean renderBlockTripWireSource(Block var1, int var2, int var3, int var4) { -+ /** -+ * Renders a trip wire source block at the given coordinates -+ */ -+ public boolean renderBlockTripWireSource(Block par1Block, int par2, int par3, int par4) { - Tessellator var5 = Tessellator.instance; -- int var6 = this.blockAccess.getBlockMetadata(var2, var3, var4); -+ int var6 = this.blockAccess.getBlockMetadata(par2, par3, par4); - int var7 = var6 & 3; - boolean var8 = (var6 & 4) == 4; - boolean var9 = (var6 & 8) == 8; -- boolean var10 = !this.blockAccess.doesBlockHaveSolidTopSurface(var2, var3 - 1, var4); -+ boolean var10 = !this.blockAccess.doesBlockHaveSolidTopSurface(par2, par3 - 1, par4); - boolean var11 = this.hasOverrideBlockTexture(); -- if(!var11) { -+ -+ if (!var11) { - this.setOverrideBlockTexture(this.getBlockIcon(Block.planks)); - } - - float var12 = 0.25F; -- float var13 = 2.0F / 16.0F; -- float var14 = 2.0F / 16.0F; -+ float var13 = 0.125F; -+ float var14 = 0.125F; - float var15 = 0.3F - var12; - float var16 = 0.3F + var12; -- if(var7 == 2) { -+ -+ if (var7 == 2) { - this.setRenderBounds((double)(0.5F - var13), (double)var15, (double)(1.0F - var14), (double)(0.5F + var13), (double)var16, 1.0D); -- } else if(var7 == 0) { -+ } else if (var7 == 0) { - this.setRenderBounds((double)(0.5F - var13), (double)var15, 0.0D, (double)(0.5F + var13), (double)var16, (double)var14); -- } else if(var7 == 1) { -+ } else if (var7 == 1) { - this.setRenderBounds((double)(1.0F - var14), (double)var15, (double)(0.5F - var13), 1.0D, (double)var16, (double)(0.5F + var13)); -- } else if(var7 == 3) { -+ } else if (var7 == 3) { - this.setRenderBounds(0.0D, (double)var15, (double)(0.5F - var13), (double)var14, (double)var16, (double)(0.5F + var13)); - } - -- this.renderStandardBlock(var1, var2, var3, var4); -- if(!var11) { -+ this.renderStandardBlock(par1Block, par2, par3, par4); -+ -+ if (!var11) { - this.clearOverrideBlockTexture(); - } - -- var5.setBrightness(var1.getMixedBrightnessForBlock(this.blockAccess, var2, var3, var4)); -+ var5.setBrightness(par1Block.getMixedBrightnessForBlock(this.blockAccess, par2, par3, par4)); - float var17 = 1.0F; -- if(Block.lightValue[var1.blockID] > 0) { -+ -+ if (Block.lightValue[par1Block.blockID] > 0) { - var17 = 1.0F; - } - - var5.setColorOpaque_F(var17, var17, var17); -- Icon var18 = this.getBlockIconFromSide(var1, 0); -- if(this.hasOverrideBlockTexture()) { -+ Icon var18 = this.getBlockIconFromSide(par1Block, 0); -+ -+ if (this.hasOverrideBlockTexture()) { - var18 = this.overrideBlockTexture; - } - -- double var19 = (double)var18.getMinU(); -- double var21 = (double)var18.getMinV(); -- double var23 = (double)var18.getMaxU(); -- double var25 = (double)var18.getMaxV(); -- Vec3[] var27 = new Vec3[8]; -- float var28 = 0.046875F; -- float var29 = 0.046875F; -- float var30 = 5.0F / 16.0F; -- var27[0] = this.blockAccess.getWorldVec3Pool().getVecFromPool((double)(-var28), 0.0D, (double)(-var29)); -- var27[1] = this.blockAccess.getWorldVec3Pool().getVecFromPool((double)var28, 0.0D, (double)(-var29)); -- var27[2] = this.blockAccess.getWorldVec3Pool().getVecFromPool((double)var28, 0.0D, (double)var29); -- var27[3] = this.blockAccess.getWorldVec3Pool().getVecFromPool((double)(-var28), 0.0D, (double)var29); -- var27[4] = this.blockAccess.getWorldVec3Pool().getVecFromPool((double)(-var28), (double)var30, (double)(-var29)); -- var27[5] = this.blockAccess.getWorldVec3Pool().getVecFromPool((double)var28, (double)var30, (double)(-var29)); -- var27[6] = this.blockAccess.getWorldVec3Pool().getVecFromPool((double)var28, (double)var30, (double)var29); -- var27[7] = this.blockAccess.getWorldVec3Pool().getVecFromPool((double)(-var28), (double)var30, (double)var29); -- -- for(int var31 = 0; var31 < 8; ++var31) { -- var27[var31].zCoord += 1.0D / 16.0D; -- if(var9) { -- var27[var31].rotateAroundX(0.5235988F); -- var27[var31].yCoord -= 0.4375D; -- } else if(var8) { -- var27[var31].rotateAroundX(0.08726647F); -- var27[var31].yCoord -= 0.4375D; -- } else { -- var27[var31].rotateAroundX(-((float)Math.PI * 2.0F / 9.0F)); -- var27[var31].yCoord -= 0.375D; -- } -- -- var27[var31].rotateAroundX((float)Math.PI * 0.5F); -- if(var7 == 2) { -- var27[var31].rotateAroundY(0.0F); -- } -- -- if(var7 == 0) { -- var27[var31].rotateAroundY((float)Math.PI); -- } -- -- if(var7 == 1) { -- var27[var31].rotateAroundY((float)Math.PI * 0.5F); -- } -- -- if(var7 == 3) { -- var27[var31].rotateAroundY((float)Math.PI * -0.5F); -- } -- -- var27[var31].xCoord += (double)var2 + 0.5D; -- var27[var31].yCoord += (double)((float)var3 + 5.0F / 16.0F); -- var27[var31].zCoord += (double)var4 + 0.5D; -- } -- -- Vec3 var62 = null; -- Vec3 var32 = null; -- Vec3 var33 = null; -- Vec3 var34 = null; -- byte var35 = 7; -- byte var36 = 9; -- byte var37 = 9; -- byte var38 = 16; -- -- for(int var39 = 0; var39 < 6; ++var39) { -- if(var39 == 0) { -- var62 = var27[0]; -- var32 = var27[1]; -- var33 = var27[2]; -- var34 = var27[3]; -- var19 = (double)var18.getInterpolatedU((double)var35); -- var21 = (double)var18.getInterpolatedV((double)var37); -- var23 = (double)var18.getInterpolatedU((double)var36); -- var25 = (double)var18.getInterpolatedV((double)(var37 + 2)); -- } else if(var39 == 1) { -- var62 = var27[7]; -- var32 = var27[6]; -- var33 = var27[5]; -- var34 = var27[4]; -- } else if(var39 == 2) { -- var62 = var27[1]; -- var32 = var27[0]; -- var33 = var27[4]; -- var34 = var27[5]; -- var19 = (double)var18.getInterpolatedU((double)var35); -- var21 = (double)var18.getInterpolatedV((double)var37); -- var23 = (double)var18.getInterpolatedU((double)var36); -- var25 = (double)var18.getInterpolatedV((double)var38); -- } else if(var39 == 3) { -- var62 = var27[2]; -- var32 = var27[1]; -- var33 = var27[5]; -- var34 = var27[6]; -- } else if(var39 == 4) { -- var62 = var27[3]; -- var32 = var27[2]; -- var33 = var27[6]; -- var34 = var27[7]; -- } else if(var39 == 5) { -- var62 = var27[0]; -- var32 = var27[3]; -- var33 = var27[7]; -- var34 = var27[4]; -- } -- -- var5.addVertexWithUV(var62.xCoord, var62.yCoord, var62.zCoord, var19, var25); -- var5.addVertexWithUV(var32.xCoord, var32.yCoord, var32.zCoord, var23, var25); -- var5.addVertexWithUV(var33.xCoord, var33.yCoord, var33.zCoord, var23, var21); -- var5.addVertexWithUV(var34.xCoord, var34.yCoord, var34.zCoord, var19, var21); -- } -- -- float var63 = 0.09375F; -- float var40 = 0.09375F; -- float var41 = 0.03125F; -- var27[0] = this.blockAccess.getWorldVec3Pool().getVecFromPool((double)(-var63), 0.0D, (double)(-var40)); -- var27[1] = this.blockAccess.getWorldVec3Pool().getVecFromPool((double)var63, 0.0D, (double)(-var40)); -- var27[2] = this.blockAccess.getWorldVec3Pool().getVecFromPool((double)var63, 0.0D, (double)var40); -- var27[3] = this.blockAccess.getWorldVec3Pool().getVecFromPool((double)(-var63), 0.0D, (double)var40); -- var27[4] = this.blockAccess.getWorldVec3Pool().getVecFromPool((double)(-var63), (double)var41, (double)(-var40)); -- var27[5] = this.blockAccess.getWorldVec3Pool().getVecFromPool((double)var63, (double)var41, (double)(-var40)); -- var27[6] = this.blockAccess.getWorldVec3Pool().getVecFromPool((double)var63, (double)var41, (double)var40); -- var27[7] = this.blockAccess.getWorldVec3Pool().getVecFromPool((double)(-var63), (double)var41, (double)var40); -- -- for(int var42 = 0; var42 < 8; ++var42) { -- var27[var42].zCoord += 0.21875D; -- if(var9) { -- var27[var42].yCoord -= 0.09375D; -- var27[var42].zCoord -= 0.1625D; -- var27[var42].rotateAroundX(0.0F); -- } else if(var8) { -- var27[var42].yCoord += 1.0D / 64.0D; -- var27[var42].zCoord -= 0.171875D; -- var27[var42].rotateAroundX(0.17453294F); -- } else { -- var27[var42].rotateAroundX(0.87266463F); -- } -- -- if(var7 == 2) { -- var27[var42].rotateAroundY(0.0F); -- } -- -- if(var7 == 0) { -- var27[var42].rotateAroundY((float)Math.PI); -- } -- -- if(var7 == 1) { -- var27[var42].rotateAroundY((float)Math.PI * 0.5F); -- } -- -- if(var7 == 3) { -- var27[var42].rotateAroundY((float)Math.PI * -0.5F); -- } -- -- var27[var42].xCoord += (double)var2 + 0.5D; -- var27[var42].yCoord += (double)((float)var3 + 5.0F / 16.0F); -- var27[var42].zCoord += (double)var4 + 0.5D; -- } -- -- byte var64 = 5; -- byte var43 = 11; -- byte var44 = 3; -- byte var45 = 9; -- -- for(int var46 = 0; var46 < 6; ++var46) { -- if(var46 == 0) { -- var62 = var27[0]; -- var32 = var27[1]; -- var33 = var27[2]; -- var34 = var27[3]; -- var19 = (double)var18.getInterpolatedU((double)var64); -- var21 = (double)var18.getInterpolatedV((double)var44); -- var23 = (double)var18.getInterpolatedU((double)var43); -- var25 = (double)var18.getInterpolatedV((double)var45); -- } else if(var46 == 1) { -- var62 = var27[7]; -- var32 = var27[6]; -- var33 = var27[5]; -- var34 = var27[4]; -- } else if(var46 == 2) { -- var62 = var27[1]; -- var32 = var27[0]; -- var33 = var27[4]; -- var34 = var27[5]; -- var19 = (double)var18.getInterpolatedU((double)var64); -- var21 = (double)var18.getInterpolatedV((double)var44); -- var23 = (double)var18.getInterpolatedU((double)var43); -- var25 = (double)var18.getInterpolatedV((double)(var44 + 2)); -- } else if(var46 == 3) { -- var62 = var27[2]; -- var32 = var27[1]; -- var33 = var27[5]; -- var34 = var27[6]; -- } else if(var46 == 4) { -- var62 = var27[3]; -- var32 = var27[2]; -- var33 = var27[6]; -- var34 = var27[7]; -- } else if(var46 == 5) { -- var62 = var27[0]; -- var32 = var27[3]; -- var33 = var27[7]; -- var34 = var27[4]; -- } -- -- var5.addVertexWithUV(var62.xCoord, var62.yCoord, var62.zCoord, var19, var25); -- var5.addVertexWithUV(var32.xCoord, var32.yCoord, var32.zCoord, var23, var25); -- var5.addVertexWithUV(var33.xCoord, var33.yCoord, var33.zCoord, var23, var21); -- var5.addVertexWithUV(var34.xCoord, var34.yCoord, var34.zCoord, var19, var21); -- } -- -- if(var8) { -- double var65 = var27[0].yCoord; -- float var48 = 0.03125F; -- float var49 = 0.5F - var48 / 2.0F; -- float var50 = var49 + var48; -- Icon var51 = this.getBlockIcon(Block.tripWire); -- double var52 = (double)var18.getMinU(); -- double var54 = (double)var18.getInterpolatedV(var8 ? 2.0D : 0.0D); -- double var56 = (double)var18.getMaxU(); -- double var58 = (double)var18.getInterpolatedV(var8 ? 4.0D : 2.0D); -- double var60 = (double)(var10 ? 3.5F : 1.5F) / 16.0D; -- var17 = var1.getBlockBrightness(this.blockAccess, var2, var3, var4) * (12.0F / 16.0F); -- var5.setColorOpaque_F(var17, var17, var17); -- if(var7 == 2) { -- var5.addVertexWithUV((double)((float)var2 + var49), (double)var3 + var60, (double)var4 + 0.25D, var52, var54); -- var5.addVertexWithUV((double)((float)var2 + var50), (double)var3 + var60, (double)var4 + 0.25D, var52, var58); -- var5.addVertexWithUV((double)((float)var2 + var50), (double)var3 + var60, (double)var4, var56, var58); -- var5.addVertexWithUV((double)((float)var2 + var49), (double)var3 + var60, (double)var4, var56, var54); -- var5.addVertexWithUV((double)((float)var2 + var49), var65, (double)var4 + 0.5D, var52, var54); -- var5.addVertexWithUV((double)((float)var2 + var50), var65, (double)var4 + 0.5D, var52, var58); -- var5.addVertexWithUV((double)((float)var2 + var50), (double)var3 + var60, (double)var4 + 0.25D, var56, var58); -- var5.addVertexWithUV((double)((float)var2 + var49), (double)var3 + var60, (double)var4 + 0.25D, var56, var54); -- } else if(var7 == 0) { -- var5.addVertexWithUV((double)((float)var2 + var49), (double)var3 + var60, (double)var4 + 0.75D, var52, var54); -- var5.addVertexWithUV((double)((float)var2 + var50), (double)var3 + var60, (double)var4 + 0.75D, var52, var58); -- var5.addVertexWithUV((double)((float)var2 + var50), var65, (double)var4 + 0.5D, var56, var58); -- var5.addVertexWithUV((double)((float)var2 + var49), var65, (double)var4 + 0.5D, var56, var54); -- var5.addVertexWithUV((double)((float)var2 + var49), (double)var3 + var60, (double)(var4 + 1), var52, var54); -- var5.addVertexWithUV((double)((float)var2 + var50), (double)var3 + var60, (double)(var4 + 1), var52, var58); -- var5.addVertexWithUV((double)((float)var2 + var50), (double)var3 + var60, (double)var4 + 0.75D, var56, var58); -- var5.addVertexWithUV((double)((float)var2 + var49), (double)var3 + var60, (double)var4 + 0.75D, var56, var54); -- } else if(var7 == 1) { -- var5.addVertexWithUV((double)var2, (double)var3 + var60, (double)((float)var4 + var50), var52, var58); -- var5.addVertexWithUV((double)var2 + 0.25D, (double)var3 + var60, (double)((float)var4 + var50), var56, var58); -- var5.addVertexWithUV((double)var2 + 0.25D, (double)var3 + var60, (double)((float)var4 + var49), var56, var54); -- var5.addVertexWithUV((double)var2, (double)var3 + var60, (double)((float)var4 + var49), var52, var54); -- var5.addVertexWithUV((double)var2 + 0.25D, (double)var3 + var60, (double)((float)var4 + var50), var52, var58); -- var5.addVertexWithUV((double)var2 + 0.5D, var65, (double)((float)var4 + var50), var56, var58); -- var5.addVertexWithUV((double)var2 + 0.5D, var65, (double)((float)var4 + var49), var56, var54); -- var5.addVertexWithUV((double)var2 + 0.25D, (double)var3 + var60, (double)((float)var4 + var49), var52, var54); -- } else { -- var5.addVertexWithUV((double)var2 + 0.5D, var65, (double)((float)var4 + var50), var52, var58); -- var5.addVertexWithUV((double)var2 + 0.75D, (double)var3 + var60, (double)((float)var4 + var50), var56, var58); -- var5.addVertexWithUV((double)var2 + 0.75D, (double)var3 + var60, (double)((float)var4 + var49), var56, var54); -- var5.addVertexWithUV((double)var2 + 0.5D, var65, (double)((float)var4 + var49), var52, var54); -- var5.addVertexWithUV((double)var2 + 0.75D, (double)var3 + var60, (double)((float)var4 + var50), var52, var58); -- var5.addVertexWithUV((double)(var2 + 1), (double)var3 + var60, (double)((float)var4 + var50), var56, var58); -- var5.addVertexWithUV((double)(var2 + 1), (double)var3 + var60, (double)((float)var4 + var49), var56, var54); -- var5.addVertexWithUV((double)var2 + 0.75D, (double)var3 + var60, (double)((float)var4 + var49), var52, var54); -- } -- } -- -- return true; -+ var18 = CTMUtils.getTile(this, par1Block, par2, par3, par4, var18, var5); -+ -+ if (var18 == null) { -+ return false; -+ } else { -+ var5 = TessellatorUtils.getTessellator(var5, var18); -+ double var19 = (double)var18.getMinU(); -+ double var21 = (double)var18.getMinV(); -+ double var23 = (double)var18.getMaxU(); -+ double var25 = (double)var18.getMaxV(); -+ Vec3[] var27 = new Vec3[8]; -+ float var28 = 0.046875F; -+ float var29 = 0.046875F; -+ float var30 = 0.3125F; -+ var27[0] = this.blockAccess.getWorldVec3Pool().getVecFromPool((double)(-var28), 0.0D, (double)(-var29)); -+ var27[1] = this.blockAccess.getWorldVec3Pool().getVecFromPool((double)var28, 0.0D, (double)(-var29)); -+ var27[2] = this.blockAccess.getWorldVec3Pool().getVecFromPool((double)var28, 0.0D, (double)var29); -+ var27[3] = this.blockAccess.getWorldVec3Pool().getVecFromPool((double)(-var28), 0.0D, (double)var29); -+ var27[4] = this.blockAccess.getWorldVec3Pool().getVecFromPool((double)(-var28), (double)var30, (double)(-var29)); -+ var27[5] = this.blockAccess.getWorldVec3Pool().getVecFromPool((double)var28, (double)var30, (double)(-var29)); -+ var27[6] = this.blockAccess.getWorldVec3Pool().getVecFromPool((double)var28, (double)var30, (double)var29); -+ var27[7] = this.blockAccess.getWorldVec3Pool().getVecFromPool((double)(-var28), (double)var30, (double)var29); -+ -+ for (int var31 = 0; var31 < 8; ++var31) { -+ var27[var31].zCoord += 0.0625D; -+ -+ if (var9) { -+ var27[var31].rotateAroundX(0.5235988F); -+ var27[var31].yCoord -= 0.4375D; -+ } else if (var8) { -+ var27[var31].rotateAroundX(0.08726647F); -+ var27[var31].yCoord -= 0.4375D; -+ } else { -+ var27[var31].rotateAroundX(-((float)Math.PI * 2F / 9F)); -+ var27[var31].yCoord -= 0.375D; -+ } -+ -+ var27[var31].rotateAroundX(((float)Math.PI / 2F)); -+ -+ if (var7 == 2) { -+ var27[var31].rotateAroundY(0.0F); -+ } -+ -+ if (var7 == 0) { -+ var27[var31].rotateAroundY((float)Math.PI); -+ } -+ -+ if (var7 == 1) { -+ var27[var31].rotateAroundY(((float)Math.PI / 2F)); -+ } -+ -+ if (var7 == 3) { -+ var27[var31].rotateAroundY(-((float)Math.PI / 2F)); -+ } -+ -+ var27[var31].xCoord += (double)par2 + 0.5D; -+ var27[var31].yCoord += (double)((float)par3 + 0.3125F); -+ var27[var31].zCoord += (double)par4 + 0.5D; -+ } -+ -+ Vec3 var62 = null; -+ Vec3 var32 = null; -+ Vec3 var33 = null; -+ Vec3 var34 = null; -+ byte var35 = 7; -+ byte var36 = 9; -+ byte var37 = 9; -+ byte var38 = 16; -+ -+ for (int var39 = 0; var39 < 6; ++var39) { -+ if (var39 == 0) { -+ var62 = var27[0]; -+ var32 = var27[1]; -+ var33 = var27[2]; -+ var34 = var27[3]; -+ var19 = (double)var18.getInterpolatedU((double)var35); -+ var21 = (double)var18.getInterpolatedV((double)var37); -+ var23 = (double)var18.getInterpolatedU((double)var36); -+ var25 = (double)var18.getInterpolatedV((double)(var37 + 2)); -+ } else if (var39 == 1) { -+ var62 = var27[7]; -+ var32 = var27[6]; -+ var33 = var27[5]; -+ var34 = var27[4]; -+ } else if (var39 == 2) { -+ var62 = var27[1]; -+ var32 = var27[0]; -+ var33 = var27[4]; -+ var34 = var27[5]; -+ var19 = (double)var18.getInterpolatedU((double)var35); -+ var21 = (double)var18.getInterpolatedV((double)var37); -+ var23 = (double)var18.getInterpolatedU((double)var36); -+ var25 = (double)var18.getInterpolatedV((double)var38); -+ } else if (var39 == 3) { -+ var62 = var27[2]; -+ var32 = var27[1]; -+ var33 = var27[5]; -+ var34 = var27[6]; -+ } else if (var39 == 4) { -+ var62 = var27[3]; -+ var32 = var27[2]; -+ var33 = var27[6]; -+ var34 = var27[7]; -+ } else if (var39 == 5) { -+ var62 = var27[0]; -+ var32 = var27[3]; -+ var33 = var27[7]; -+ var34 = var27[4]; -+ } -+ -+ var5.addVertexWithUV(var62.xCoord, var62.yCoord, var62.zCoord, var19, var25); -+ var5.addVertexWithUV(var32.xCoord, var32.yCoord, var32.zCoord, var23, var25); -+ var5.addVertexWithUV(var33.xCoord, var33.yCoord, var33.zCoord, var23, var21); -+ var5.addVertexWithUV(var34.xCoord, var34.yCoord, var34.zCoord, var19, var21); -+ } -+ -+ float var63 = 0.09375F; -+ float var40 = 0.09375F; -+ float var41 = 0.03125F; -+ var27[0] = this.blockAccess.getWorldVec3Pool().getVecFromPool((double)(-var63), 0.0D, (double)(-var40)); -+ var27[1] = this.blockAccess.getWorldVec3Pool().getVecFromPool((double)var63, 0.0D, (double)(-var40)); -+ var27[2] = this.blockAccess.getWorldVec3Pool().getVecFromPool((double)var63, 0.0D, (double)var40); -+ var27[3] = this.blockAccess.getWorldVec3Pool().getVecFromPool((double)(-var63), 0.0D, (double)var40); -+ var27[4] = this.blockAccess.getWorldVec3Pool().getVecFromPool((double)(-var63), (double)var41, (double)(-var40)); -+ var27[5] = this.blockAccess.getWorldVec3Pool().getVecFromPool((double)var63, (double)var41, (double)(-var40)); -+ var27[6] = this.blockAccess.getWorldVec3Pool().getVecFromPool((double)var63, (double)var41, (double)var40); -+ var27[7] = this.blockAccess.getWorldVec3Pool().getVecFromPool((double)(-var63), (double)var41, (double)var40); -+ -+ for (int var42 = 0; var42 < 8; ++var42) { -+ var27[var42].zCoord += 0.21875D; -+ -+ if (var9) { -+ var27[var42].yCoord -= 0.09375D; -+ var27[var42].zCoord -= 0.1625D; -+ var27[var42].rotateAroundX(0.0F); -+ } else if (var8) { -+ var27[var42].yCoord += 0.015625D; -+ var27[var42].zCoord -= 0.171875D; -+ var27[var42].rotateAroundX(0.17453294F); -+ } else { -+ var27[var42].rotateAroundX(0.87266463F); -+ } -+ -+ if (var7 == 2) { -+ var27[var42].rotateAroundY(0.0F); -+ } -+ -+ if (var7 == 0) { -+ var27[var42].rotateAroundY((float)Math.PI); -+ } -+ -+ if (var7 == 1) { -+ var27[var42].rotateAroundY(((float)Math.PI / 2F)); -+ } -+ -+ if (var7 == 3) { -+ var27[var42].rotateAroundY(-((float)Math.PI / 2F)); -+ } -+ -+ var27[var42].xCoord += (double)par2 + 0.5D; -+ var27[var42].yCoord += (double)((float)par3 + 0.3125F); -+ var27[var42].zCoord += (double)par4 + 0.5D; -+ } -+ -+ byte var65 = 5; -+ byte var43 = 11; -+ byte var44 = 3; -+ byte var45 = 9; -+ -+ for (int var46 = 0; var46 < 6; ++var46) { -+ if (var46 == 0) { -+ var62 = var27[0]; -+ var32 = var27[1]; -+ var33 = var27[2]; -+ var34 = var27[3]; -+ var19 = (double)var18.getInterpolatedU((double)var65); -+ var21 = (double)var18.getInterpolatedV((double)var44); -+ var23 = (double)var18.getInterpolatedU((double)var43); -+ var25 = (double)var18.getInterpolatedV((double)var45); -+ } else if (var46 == 1) { -+ var62 = var27[7]; -+ var32 = var27[6]; -+ var33 = var27[5]; -+ var34 = var27[4]; -+ } else if (var46 == 2) { -+ var62 = var27[1]; -+ var32 = var27[0]; -+ var33 = var27[4]; -+ var34 = var27[5]; -+ var19 = (double)var18.getInterpolatedU((double)var65); -+ var21 = (double)var18.getInterpolatedV((double)var44); -+ var23 = (double)var18.getInterpolatedU((double)var43); -+ var25 = (double)var18.getInterpolatedV((double)(var44 + 2)); -+ } else if (var46 == 3) { -+ var62 = var27[2]; -+ var32 = var27[1]; -+ var33 = var27[5]; -+ var34 = var27[6]; -+ } else if (var46 == 4) { -+ var62 = var27[3]; -+ var32 = var27[2]; -+ var33 = var27[6]; -+ var34 = var27[7]; -+ } else if (var46 == 5) { -+ var62 = var27[0]; -+ var32 = var27[3]; -+ var33 = var27[7]; -+ var34 = var27[4]; -+ } -+ -+ var5.addVertexWithUV(var62.xCoord, var62.yCoord, var62.zCoord, var19, var25); -+ var5.addVertexWithUV(var32.xCoord, var32.yCoord, var32.zCoord, var23, var25); -+ var5.addVertexWithUV(var33.xCoord, var33.yCoord, var33.zCoord, var23, var21); -+ var5.addVertexWithUV(var34.xCoord, var34.yCoord, var34.zCoord, var19, var21); -+ } -+ -+ if (var8) { -+ double var64 = var27[0].yCoord; -+ float var48 = 0.03125F; -+ float var49 = 0.5F - var48 / 2.0F; -+ float var50 = var49 + var48; -+ Icon var51 = this.getBlockIcon(Block.tripWire); -+ var18 = CTMUtils.getTile(this, par1Block, par2, par3, par4, var18, var5); -+ -+ if (var18 == null) { -+ return false; -+ } -+ -+ var5 = TessellatorUtils.getTessellator(var5, var18); -+ double var52 = (double)var18.getMinU(); -+ double var54 = (double)var18.getInterpolatedV(var8 ? 2.0D : 0.0D); -+ double var56 = (double)var18.getMaxU(); -+ double var58 = (double)var18.getInterpolatedV(var8 ? 4.0D : 2.0D); -+ double var60 = (double)(var10 ? 3.5F : 1.5F) / 16.0D; -+ var17 = par1Block.getBlockBrightness(this.blockAccess, par2, par3, par4) * 0.75F; -+ var5.setColorOpaque_F(var17, var17, var17); -+ -+ if (var7 == 2) { -+ var5.addVertexWithUV((double)((float)par2 + var49), (double)par3 + var60, (double)par4 + 0.25D, var52, var54); -+ var5.addVertexWithUV((double)((float)par2 + var50), (double)par3 + var60, (double)par4 + 0.25D, var52, var58); -+ var5.addVertexWithUV((double)((float)par2 + var50), (double)par3 + var60, (double)par4, var56, var58); -+ var5.addVertexWithUV((double)((float)par2 + var49), (double)par3 + var60, (double)par4, var56, var54); -+ var5.addVertexWithUV((double)((float)par2 + var49), var64, (double)par4 + 0.5D, var52, var54); -+ var5.addVertexWithUV((double)((float)par2 + var50), var64, (double)par4 + 0.5D, var52, var58); -+ var5.addVertexWithUV((double)((float)par2 + var50), (double)par3 + var60, (double)par4 + 0.25D, var56, var58); -+ var5.addVertexWithUV((double)((float)par2 + var49), (double)par3 + var60, (double)par4 + 0.25D, var56, var54); -+ } else if (var7 == 0) { -+ var5.addVertexWithUV((double)((float)par2 + var49), (double)par3 + var60, (double)par4 + 0.75D, var52, var54); -+ var5.addVertexWithUV((double)((float)par2 + var50), (double)par3 + var60, (double)par4 + 0.75D, var52, var58); -+ var5.addVertexWithUV((double)((float)par2 + var50), var64, (double)par4 + 0.5D, var56, var58); -+ var5.addVertexWithUV((double)((float)par2 + var49), var64, (double)par4 + 0.5D, var56, var54); -+ var5.addVertexWithUV((double)((float)par2 + var49), (double)par3 + var60, (double)(par4 + 1), var52, var54); -+ var5.addVertexWithUV((double)((float)par2 + var50), (double)par3 + var60, (double)(par4 + 1), var52, var58); -+ var5.addVertexWithUV((double)((float)par2 + var50), (double)par3 + var60, (double)par4 + 0.75D, var56, var58); -+ var5.addVertexWithUV((double)((float)par2 + var49), (double)par3 + var60, (double)par4 + 0.75D, var56, var54); -+ } else if (var7 == 1) { -+ var5.addVertexWithUV((double)par2, (double)par3 + var60, (double)((float)par4 + var50), var52, var58); -+ var5.addVertexWithUV((double)par2 + 0.25D, (double)par3 + var60, (double)((float)par4 + var50), var56, var58); -+ var5.addVertexWithUV((double)par2 + 0.25D, (double)par3 + var60, (double)((float)par4 + var49), var56, var54); -+ var5.addVertexWithUV((double)par2, (double)par3 + var60, (double)((float)par4 + var49), var52, var54); -+ var5.addVertexWithUV((double)par2 + 0.25D, (double)par3 + var60, (double)((float)par4 + var50), var52, var58); -+ var5.addVertexWithUV((double)par2 + 0.5D, var64, (double)((float)par4 + var50), var56, var58); -+ var5.addVertexWithUV((double)par2 + 0.5D, var64, (double)((float)par4 + var49), var56, var54); -+ var5.addVertexWithUV((double)par2 + 0.25D, (double)par3 + var60, (double)((float)par4 + var49), var52, var54); -+ } else { -+ var5.addVertexWithUV((double)par2 + 0.5D, var64, (double)((float)par4 + var50), var52, var58); -+ var5.addVertexWithUV((double)par2 + 0.75D, (double)par3 + var60, (double)((float)par4 + var50), var56, var58); -+ var5.addVertexWithUV((double)par2 + 0.75D, (double)par3 + var60, (double)((float)par4 + var49), var56, var54); -+ var5.addVertexWithUV((double)par2 + 0.5D, var64, (double)((float)par4 + var49), var52, var54); -+ var5.addVertexWithUV((double)par2 + 0.75D, (double)par3 + var60, (double)((float)par4 + var50), var52, var58); -+ var5.addVertexWithUV((double)(par2 + 1), (double)par3 + var60, (double)((float)par4 + var50), var56, var58); -+ var5.addVertexWithUV((double)(par2 + 1), (double)par3 + var60, (double)((float)par4 + var49), var56, var54); -+ var5.addVertexWithUV((double)par2 + 0.75D, (double)par3 + var60, (double)((float)par4 + var49), var52, var54); -+ } -+ } -+ -+ return true; -+ } - } - -- public boolean renderBlockTripWire(Block var1, int var2, int var3, int var4) { -+ /** -+ * Renders a trip wire block at the given coordinates -+ */ -+ public boolean renderBlockTripWire(Block par1Block, int par2, int par3, int par4) { - Tessellator var5 = Tessellator.instance; -- Icon var6 = this.getBlockIconFromSide(var1, 0); -- int var7 = this.blockAccess.getBlockMetadata(var2, var3, var4); -+ Icon var6 = this.getBlockIconFromSide(par1Block, 0); -+ int var7 = this.blockAccess.getBlockMetadata(par2, par3, par4); - boolean var8 = (var7 & 4) == 4; - boolean var9 = (var7 & 2) == 2; -- if(this.hasOverrideBlockTexture()) { -+ -+ if (this.hasOverrideBlockTexture()) { - var6 = this.overrideBlockTexture; - } - -- var5.setBrightness(var1.getMixedBrightnessForBlock(this.blockAccess, var2, var3, var4)); -- float var10 = var1.getBlockBrightness(this.blockAccess, var2, var3, var4) * (12.0F / 16.0F); -+ var5.setBrightness(par1Block.getMixedBrightnessForBlock(this.blockAccess, par2, par3, par4)); -+ float var10 = par1Block.getBlockBrightness(this.blockAccess, par2, par3, par4) * 0.75F; - var5.setColorOpaque_F(var10, var10, var10); -- double var11 = (double)var6.getMinU(); -- double var13 = (double)var6.getInterpolatedV(var8 ? 2.0D : 0.0D); -- double var15 = (double)var6.getMaxU(); -- double var17 = (double)var6.getInterpolatedV(var8 ? 4.0D : 2.0D); -- double var19 = (double)(var9 ? 3.5F : 1.5F) / 16.0D; -- boolean var21 = BlockTripWire.func_72148_a(this.blockAccess, var2, var3, var4, var7, 1); -- boolean var22 = BlockTripWire.func_72148_a(this.blockAccess, var2, var3, var4, var7, 3); -- boolean var23 = BlockTripWire.func_72148_a(this.blockAccess, var2, var3, var4, var7, 2); -- boolean var24 = BlockTripWire.func_72148_a(this.blockAccess, var2, var3, var4, var7, 0); -- float var25 = 0.03125F; -- float var26 = 0.5F - var25 / 2.0F; -- float var27 = var26 + var25; -- if(!var23 && !var22 && !var24 && !var21) { -- var23 = true; -- var24 = true; -- } -- -- if(var23) { -- var5.addVertexWithUV((double)((float)var2 + var26), (double)var3 + var19, (double)var4 + 0.25D, var11, var13); -- var5.addVertexWithUV((double)((float)var2 + var27), (double)var3 + var19, (double)var4 + 0.25D, var11, var17); -- var5.addVertexWithUV((double)((float)var2 + var27), (double)var3 + var19, (double)var4, var15, var17); -- var5.addVertexWithUV((double)((float)var2 + var26), (double)var3 + var19, (double)var4, var15, var13); -- var5.addVertexWithUV((double)((float)var2 + var26), (double)var3 + var19, (double)var4, var15, var13); -- var5.addVertexWithUV((double)((float)var2 + var27), (double)var3 + var19, (double)var4, var15, var17); -- var5.addVertexWithUV((double)((float)var2 + var27), (double)var3 + var19, (double)var4 + 0.25D, var11, var17); -- var5.addVertexWithUV((double)((float)var2 + var26), (double)var3 + var19, (double)var4 + 0.25D, var11, var13); -- } -- -- if(var23 || var24 && !var22 && !var21) { -- var5.addVertexWithUV((double)((float)var2 + var26), (double)var3 + var19, (double)var4 + 0.5D, var11, var13); -- var5.addVertexWithUV((double)((float)var2 + var27), (double)var3 + var19, (double)var4 + 0.5D, var11, var17); -- var5.addVertexWithUV((double)((float)var2 + var27), (double)var3 + var19, (double)var4 + 0.25D, var15, var17); -- var5.addVertexWithUV((double)((float)var2 + var26), (double)var3 + var19, (double)var4 + 0.25D, var15, var13); -- var5.addVertexWithUV((double)((float)var2 + var26), (double)var3 + var19, (double)var4 + 0.25D, var15, var13); -- var5.addVertexWithUV((double)((float)var2 + var27), (double)var3 + var19, (double)var4 + 0.25D, var15, var17); -- var5.addVertexWithUV((double)((float)var2 + var27), (double)var3 + var19, (double)var4 + 0.5D, var11, var17); -- var5.addVertexWithUV((double)((float)var2 + var26), (double)var3 + var19, (double)var4 + 0.5D, var11, var13); -- } -- -- if(var24 || var23 && !var22 && !var21) { -- var5.addVertexWithUV((double)((float)var2 + var26), (double)var3 + var19, (double)var4 + 0.75D, var11, var13); -- var5.addVertexWithUV((double)((float)var2 + var27), (double)var3 + var19, (double)var4 + 0.75D, var11, var17); -- var5.addVertexWithUV((double)((float)var2 + var27), (double)var3 + var19, (double)var4 + 0.5D, var15, var17); -- var5.addVertexWithUV((double)((float)var2 + var26), (double)var3 + var19, (double)var4 + 0.5D, var15, var13); -- var5.addVertexWithUV((double)((float)var2 + var26), (double)var3 + var19, (double)var4 + 0.5D, var15, var13); -- var5.addVertexWithUV((double)((float)var2 + var27), (double)var3 + var19, (double)var4 + 0.5D, var15, var17); -- var5.addVertexWithUV((double)((float)var2 + var27), (double)var3 + var19, (double)var4 + 0.75D, var11, var17); -- var5.addVertexWithUV((double)((float)var2 + var26), (double)var3 + var19, (double)var4 + 0.75D, var11, var13); -- } -- -- if(var24) { -- var5.addVertexWithUV((double)((float)var2 + var26), (double)var3 + var19, (double)(var4 + 1), var11, var13); -- var5.addVertexWithUV((double)((float)var2 + var27), (double)var3 + var19, (double)(var4 + 1), var11, var17); -- var5.addVertexWithUV((double)((float)var2 + var27), (double)var3 + var19, (double)var4 + 0.75D, var15, var17); -- var5.addVertexWithUV((double)((float)var2 + var26), (double)var3 + var19, (double)var4 + 0.75D, var15, var13); -- var5.addVertexWithUV((double)((float)var2 + var26), (double)var3 + var19, (double)var4 + 0.75D, var15, var13); -- var5.addVertexWithUV((double)((float)var2 + var27), (double)var3 + var19, (double)var4 + 0.75D, var15, var17); -- var5.addVertexWithUV((double)((float)var2 + var27), (double)var3 + var19, (double)(var4 + 1), var11, var17); -- var5.addVertexWithUV((double)((float)var2 + var26), (double)var3 + var19, (double)(var4 + 1), var11, var13); -- } -- -- if(var21) { -- var5.addVertexWithUV((double)var2, (double)var3 + var19, (double)((float)var4 + var27), var11, var17); -- var5.addVertexWithUV((double)var2 + 0.25D, (double)var3 + var19, (double)((float)var4 + var27), var15, var17); -- var5.addVertexWithUV((double)var2 + 0.25D, (double)var3 + var19, (double)((float)var4 + var26), var15, var13); -- var5.addVertexWithUV((double)var2, (double)var3 + var19, (double)((float)var4 + var26), var11, var13); -- var5.addVertexWithUV((double)var2, (double)var3 + var19, (double)((float)var4 + var26), var11, var13); -- var5.addVertexWithUV((double)var2 + 0.25D, (double)var3 + var19, (double)((float)var4 + var26), var15, var13); -- var5.addVertexWithUV((double)var2 + 0.25D, (double)var3 + var19, (double)((float)var4 + var27), var15, var17); -- var5.addVertexWithUV((double)var2, (double)var3 + var19, (double)((float)var4 + var27), var11, var17); -- } -- -- if(var21 || var22 && !var23 && !var24) { -- var5.addVertexWithUV((double)var2 + 0.25D, (double)var3 + var19, (double)((float)var4 + var27), var11, var17); -- var5.addVertexWithUV((double)var2 + 0.5D, (double)var3 + var19, (double)((float)var4 + var27), var15, var17); -- var5.addVertexWithUV((double)var2 + 0.5D, (double)var3 + var19, (double)((float)var4 + var26), var15, var13); -- var5.addVertexWithUV((double)var2 + 0.25D, (double)var3 + var19, (double)((float)var4 + var26), var11, var13); -- var5.addVertexWithUV((double)var2 + 0.25D, (double)var3 + var19, (double)((float)var4 + var26), var11, var13); -- var5.addVertexWithUV((double)var2 + 0.5D, (double)var3 + var19, (double)((float)var4 + var26), var15, var13); -- var5.addVertexWithUV((double)var2 + 0.5D, (double)var3 + var19, (double)((float)var4 + var27), var15, var17); -- var5.addVertexWithUV((double)var2 + 0.25D, (double)var3 + var19, (double)((float)var4 + var27), var11, var17); -- } -- -- if(var22 || var21 && !var23 && !var24) { -- var5.addVertexWithUV((double)var2 + 0.5D, (double)var3 + var19, (double)((float)var4 + var27), var11, var17); -- var5.addVertexWithUV((double)var2 + 0.75D, (double)var3 + var19, (double)((float)var4 + var27), var15, var17); -- var5.addVertexWithUV((double)var2 + 0.75D, (double)var3 + var19, (double)((float)var4 + var26), var15, var13); -- var5.addVertexWithUV((double)var2 + 0.5D, (double)var3 + var19, (double)((float)var4 + var26), var11, var13); -- var5.addVertexWithUV((double)var2 + 0.5D, (double)var3 + var19, (double)((float)var4 + var26), var11, var13); -- var5.addVertexWithUV((double)var2 + 0.75D, (double)var3 + var19, (double)((float)var4 + var26), var15, var13); -- var5.addVertexWithUV((double)var2 + 0.75D, (double)var3 + var19, (double)((float)var4 + var27), var15, var17); -- var5.addVertexWithUV((double)var2 + 0.5D, (double)var3 + var19, (double)((float)var4 + var27), var11, var17); -- } -- -- if(var22) { -- var5.addVertexWithUV((double)var2 + 0.75D, (double)var3 + var19, (double)((float)var4 + var27), var11, var17); -- var5.addVertexWithUV((double)(var2 + 1), (double)var3 + var19, (double)((float)var4 + var27), var15, var17); -- var5.addVertexWithUV((double)(var2 + 1), (double)var3 + var19, (double)((float)var4 + var26), var15, var13); -- var5.addVertexWithUV((double)var2 + 0.75D, (double)var3 + var19, (double)((float)var4 + var26), var11, var13); -- var5.addVertexWithUV((double)var2 + 0.75D, (double)var3 + var19, (double)((float)var4 + var26), var11, var13); -- var5.addVertexWithUV((double)(var2 + 1), (double)var3 + var19, (double)((float)var4 + var26), var15, var13); -- var5.addVertexWithUV((double)(var2 + 1), (double)var3 + var19, (double)((float)var4 + var27), var15, var17); -- var5.addVertexWithUV((double)var2 + 0.75D, (double)var3 + var19, (double)((float)var4 + var27), var11, var17); -- } -- -- return true; -+ var6 = CTMUtils.getTile(this, par1Block, par2, par3, par4, var6, var5); -+ -+ if (var6 == null) { -+ return false; -+ } else { -+ var5 = TessellatorUtils.getTessellator(var5, var6); -+ double var11 = (double)var6.getMinU(); -+ double var13 = (double)var6.getInterpolatedV(var8 ? 2.0D : 0.0D); -+ double var15 = (double)var6.getMaxU(); -+ double var17 = (double)var6.getInterpolatedV(var8 ? 4.0D : 2.0D); -+ double var19 = (double)(var9 ? 3.5F : 1.5F) / 16.0D; -+ boolean var21 = BlockTripWire.func_72148_a(this.blockAccess, par2, par3, par4, var7, 1); -+ boolean var22 = BlockTripWire.func_72148_a(this.blockAccess, par2, par3, par4, var7, 3); -+ boolean var23 = BlockTripWire.func_72148_a(this.blockAccess, par2, par3, par4, var7, 2); -+ boolean var24 = BlockTripWire.func_72148_a(this.blockAccess, par2, par3, par4, var7, 0); -+ float var25 = 0.03125F; -+ float var26 = 0.5F - var25 / 2.0F; -+ float var27 = var26 + var25; -+ -+ if (!var23 && !var22 && !var24 && !var21) { -+ var23 = true; -+ var24 = true; -+ } -+ -+ if (var23) { -+ var5.addVertexWithUV((double)((float)par2 + var26), (double)par3 + var19, (double)par4 + 0.25D, var11, var13); -+ var5.addVertexWithUV((double)((float)par2 + var27), (double)par3 + var19, (double)par4 + 0.25D, var11, var17); -+ var5.addVertexWithUV((double)((float)par2 + var27), (double)par3 + var19, (double)par4, var15, var17); -+ var5.addVertexWithUV((double)((float)par2 + var26), (double)par3 + var19, (double)par4, var15, var13); -+ var5.addVertexWithUV((double)((float)par2 + var26), (double)par3 + var19, (double)par4, var15, var13); -+ var5.addVertexWithUV((double)((float)par2 + var27), (double)par3 + var19, (double)par4, var15, var17); -+ var5.addVertexWithUV((double)((float)par2 + var27), (double)par3 + var19, (double)par4 + 0.25D, var11, var17); -+ var5.addVertexWithUV((double)((float)par2 + var26), (double)par3 + var19, (double)par4 + 0.25D, var11, var13); -+ } -+ -+ if (var23 || var24 && !var22 && !var21) { -+ var5.addVertexWithUV((double)((float)par2 + var26), (double)par3 + var19, (double)par4 + 0.5D, var11, var13); -+ var5.addVertexWithUV((double)((float)par2 + var27), (double)par3 + var19, (double)par4 + 0.5D, var11, var17); -+ var5.addVertexWithUV((double)((float)par2 + var27), (double)par3 + var19, (double)par4 + 0.25D, var15, var17); -+ var5.addVertexWithUV((double)((float)par2 + var26), (double)par3 + var19, (double)par4 + 0.25D, var15, var13); -+ var5.addVertexWithUV((double)((float)par2 + var26), (double)par3 + var19, (double)par4 + 0.25D, var15, var13); -+ var5.addVertexWithUV((double)((float)par2 + var27), (double)par3 + var19, (double)par4 + 0.25D, var15, var17); -+ var5.addVertexWithUV((double)((float)par2 + var27), (double)par3 + var19, (double)par4 + 0.5D, var11, var17); -+ var5.addVertexWithUV((double)((float)par2 + var26), (double)par3 + var19, (double)par4 + 0.5D, var11, var13); -+ } -+ -+ if (var24 || var23 && !var22 && !var21) { -+ var5.addVertexWithUV((double)((float)par2 + var26), (double)par3 + var19, (double)par4 + 0.75D, var11, var13); -+ var5.addVertexWithUV((double)((float)par2 + var27), (double)par3 + var19, (double)par4 + 0.75D, var11, var17); -+ var5.addVertexWithUV((double)((float)par2 + var27), (double)par3 + var19, (double)par4 + 0.5D, var15, var17); -+ var5.addVertexWithUV((double)((float)par2 + var26), (double)par3 + var19, (double)par4 + 0.5D, var15, var13); -+ var5.addVertexWithUV((double)((float)par2 + var26), (double)par3 + var19, (double)par4 + 0.5D, var15, var13); -+ var5.addVertexWithUV((double)((float)par2 + var27), (double)par3 + var19, (double)par4 + 0.5D, var15, var17); -+ var5.addVertexWithUV((double)((float)par2 + var27), (double)par3 + var19, (double)par4 + 0.75D, var11, var17); -+ var5.addVertexWithUV((double)((float)par2 + var26), (double)par3 + var19, (double)par4 + 0.75D, var11, var13); -+ } -+ -+ if (var24) { -+ var5.addVertexWithUV((double)((float)par2 + var26), (double)par3 + var19, (double)(par4 + 1), var11, var13); -+ var5.addVertexWithUV((double)((float)par2 + var27), (double)par3 + var19, (double)(par4 + 1), var11, var17); -+ var5.addVertexWithUV((double)((float)par2 + var27), (double)par3 + var19, (double)par4 + 0.75D, var15, var17); -+ var5.addVertexWithUV((double)((float)par2 + var26), (double)par3 + var19, (double)par4 + 0.75D, var15, var13); -+ var5.addVertexWithUV((double)((float)par2 + var26), (double)par3 + var19, (double)par4 + 0.75D, var15, var13); -+ var5.addVertexWithUV((double)((float)par2 + var27), (double)par3 + var19, (double)par4 + 0.75D, var15, var17); -+ var5.addVertexWithUV((double)((float)par2 + var27), (double)par3 + var19, (double)(par4 + 1), var11, var17); -+ var5.addVertexWithUV((double)((float)par2 + var26), (double)par3 + var19, (double)(par4 + 1), var11, var13); -+ } -+ -+ if (var21) { -+ var5.addVertexWithUV((double)par2, (double)par3 + var19, (double)((float)par4 + var27), var11, var17); -+ var5.addVertexWithUV((double)par2 + 0.25D, (double)par3 + var19, (double)((float)par4 + var27), var15, var17); -+ var5.addVertexWithUV((double)par2 + 0.25D, (double)par3 + var19, (double)((float)par4 + var26), var15, var13); -+ var5.addVertexWithUV((double)par2, (double)par3 + var19, (double)((float)par4 + var26), var11, var13); -+ var5.addVertexWithUV((double)par2, (double)par3 + var19, (double)((float)par4 + var26), var11, var13); -+ var5.addVertexWithUV((double)par2 + 0.25D, (double)par3 + var19, (double)((float)par4 + var26), var15, var13); -+ var5.addVertexWithUV((double)par2 + 0.25D, (double)par3 + var19, (double)((float)par4 + var27), var15, var17); -+ var5.addVertexWithUV((double)par2, (double)par3 + var19, (double)((float)par4 + var27), var11, var17); -+ } -+ -+ if (var21 || var22 && !var23 && !var24) { -+ var5.addVertexWithUV((double)par2 + 0.25D, (double)par3 + var19, (double)((float)par4 + var27), var11, var17); -+ var5.addVertexWithUV((double)par2 + 0.5D, (double)par3 + var19, (double)((float)par4 + var27), var15, var17); -+ var5.addVertexWithUV((double)par2 + 0.5D, (double)par3 + var19, (double)((float)par4 + var26), var15, var13); -+ var5.addVertexWithUV((double)par2 + 0.25D, (double)par3 + var19, (double)((float)par4 + var26), var11, var13); -+ var5.addVertexWithUV((double)par2 + 0.25D, (double)par3 + var19, (double)((float)par4 + var26), var11, var13); -+ var5.addVertexWithUV((double)par2 + 0.5D, (double)par3 + var19, (double)((float)par4 + var26), var15, var13); -+ var5.addVertexWithUV((double)par2 + 0.5D, (double)par3 + var19, (double)((float)par4 + var27), var15, var17); -+ var5.addVertexWithUV((double)par2 + 0.25D, (double)par3 + var19, (double)((float)par4 + var27), var11, var17); -+ } -+ -+ if (var22 || var21 && !var23 && !var24) { -+ var5.addVertexWithUV((double)par2 + 0.5D, (double)par3 + var19, (double)((float)par4 + var27), var11, var17); -+ var5.addVertexWithUV((double)par2 + 0.75D, (double)par3 + var19, (double)((float)par4 + var27), var15, var17); -+ var5.addVertexWithUV((double)par2 + 0.75D, (double)par3 + var19, (double)((float)par4 + var26), var15, var13); -+ var5.addVertexWithUV((double)par2 + 0.5D, (double)par3 + var19, (double)((float)par4 + var26), var11, var13); -+ var5.addVertexWithUV((double)par2 + 0.5D, (double)par3 + var19, (double)((float)par4 + var26), var11, var13); -+ var5.addVertexWithUV((double)par2 + 0.75D, (double)par3 + var19, (double)((float)par4 + var26), var15, var13); -+ var5.addVertexWithUV((double)par2 + 0.75D, (double)par3 + var19, (double)((float)par4 + var27), var15, var17); -+ var5.addVertexWithUV((double)par2 + 0.5D, (double)par3 + var19, (double)((float)par4 + var27), var11, var17); -+ } -+ -+ if (var22) { -+ var5.addVertexWithUV((double)par2 + 0.75D, (double)par3 + var19, (double)((float)par4 + var27), var11, var17); -+ var5.addVertexWithUV((double)(par2 + 1), (double)par3 + var19, (double)((float)par4 + var27), var15, var17); -+ var5.addVertexWithUV((double)(par2 + 1), (double)par3 + var19, (double)((float)par4 + var26), var15, var13); -+ var5.addVertexWithUV((double)par2 + 0.75D, (double)par3 + var19, (double)((float)par4 + var26), var11, var13); -+ var5.addVertexWithUV((double)par2 + 0.75D, (double)par3 + var19, (double)((float)par4 + var26), var11, var13); -+ var5.addVertexWithUV((double)(par2 + 1), (double)par3 + var19, (double)((float)par4 + var26), var15, var13); -+ var5.addVertexWithUV((double)(par2 + 1), (double)par3 + var19, (double)((float)par4 + var27), var15, var17); -+ var5.addVertexWithUV((double)par2 + 0.75D, (double)par3 + var19, (double)((float)par4 + var27), var11, var17); -+ } -+ -+ return true; -+ } - } - -- public boolean renderBlockFire(BlockFire var1, int var2, int var3, int var4) { -+ /** -+ * Renders a fire block at the given coordinates -+ */ -+ public boolean renderBlockFire(BlockFire par1BlockFire, int par2, int par3, int par4) { - Tessellator var5 = Tessellator.instance; -- Icon var6 = var1.getFireIcon(0); -- Icon var7 = var1.getFireIcon(1); -+ Icon var6 = par1BlockFire.getFireIcon(0); -+ Icon var7 = par1BlockFire.getFireIcon(1); - Icon var8 = var6; -- if(this.hasOverrideBlockTexture()) { -+ -+ if (this.hasOverrideBlockTexture()) { - var8 = this.overrideBlockTexture; - } - - var5.setColorOpaque_F(1.0F, 1.0F, 1.0F); -- var5.setBrightness(var1.getMixedBrightnessForBlock(this.blockAccess, var2, var3, var4)); -- double var9 = (double)var8.getMinU(); -- double var11 = (double)var8.getMinV(); -- double var13 = (double)var8.getMaxU(); -- double var15 = (double)var8.getMaxV(); -- float var17 = 1.4F; -- double var20; -- double var22; -- double var24; -- double var26; -- double var28; -- double var30; -- double var32; -- if(!this.blockAccess.doesBlockHaveSolidTopSurface(var2, var3 - 1, var4) && !Block.fire.canBlockCatchFire(this.blockAccess, var2, var3 - 1, var4)) { -- float var36 = 0.2F; -- float var19 = 1.0F / 16.0F; -- if((var2 + var3 + var4 & 1) == 1) { -- var9 = (double)var7.getMinU(); -- var11 = (double)var7.getMinV(); -- var13 = (double)var7.getMaxU(); -- var15 = (double)var7.getMaxV(); -- } -- -- if((var2 / 2 + var3 / 2 + var4 / 2 & 1) == 1) { -- var20 = var13; -- var13 = var9; -- var9 = var20; -- } -- -- if(Block.fire.canBlockCatchFire(this.blockAccess, var2 - 1, var3, var4)) { -- var5.addVertexWithUV((double)((float)var2 + var36), (double)((float)var3 + var17 + var19), (double)(var4 + 1), var13, var11); -- var5.addVertexWithUV((double)(var2 + 0), (double)((float)(var3 + 0) + var19), (double)(var4 + 1), var13, var15); -- var5.addVertexWithUV((double)(var2 + 0), (double)((float)(var3 + 0) + var19), (double)(var4 + 0), var9, var15); -- var5.addVertexWithUV((double)((float)var2 + var36), (double)((float)var3 + var17 + var19), (double)(var4 + 0), var9, var11); -- var5.addVertexWithUV((double)((float)var2 + var36), (double)((float)var3 + var17 + var19), (double)(var4 + 0), var9, var11); -- var5.addVertexWithUV((double)(var2 + 0), (double)((float)(var3 + 0) + var19), (double)(var4 + 0), var9, var15); -- var5.addVertexWithUV((double)(var2 + 0), (double)((float)(var3 + 0) + var19), (double)(var4 + 1), var13, var15); -- var5.addVertexWithUV((double)((float)var2 + var36), (double)((float)var3 + var17 + var19), (double)(var4 + 1), var13, var11); -- } -- -- if(Block.fire.canBlockCatchFire(this.blockAccess, var2 + 1, var3, var4)) { -- var5.addVertexWithUV((double)((float)(var2 + 1) - var36), (double)((float)var3 + var17 + var19), (double)(var4 + 0), var9, var11); -- var5.addVertexWithUV((double)(var2 + 1 - 0), (double)((float)(var3 + 0) + var19), (double)(var4 + 0), var9, var15); -- var5.addVertexWithUV((double)(var2 + 1 - 0), (double)((float)(var3 + 0) + var19), (double)(var4 + 1), var13, var15); -- var5.addVertexWithUV((double)((float)(var2 + 1) - var36), (double)((float)var3 + var17 + var19), (double)(var4 + 1), var13, var11); -- var5.addVertexWithUV((double)((float)(var2 + 1) - var36), (double)((float)var3 + var17 + var19), (double)(var4 + 1), var13, var11); -- var5.addVertexWithUV((double)(var2 + 1 - 0), (double)((float)(var3 + 0) + var19), (double)(var4 + 1), var13, var15); -- var5.addVertexWithUV((double)(var2 + 1 - 0), (double)((float)(var3 + 0) + var19), (double)(var4 + 0), var9, var15); -- var5.addVertexWithUV((double)((float)(var2 + 1) - var36), (double)((float)var3 + var17 + var19), (double)(var4 + 0), var9, var11); -- } -- -- if(Block.fire.canBlockCatchFire(this.blockAccess, var2, var3, var4 - 1)) { -- var5.addVertexWithUV((double)(var2 + 0), (double)((float)var3 + var17 + var19), (double)((float)var4 + var36), var13, var11); -- var5.addVertexWithUV((double)(var2 + 0), (double)((float)(var3 + 0) + var19), (double)(var4 + 0), var13, var15); -- var5.addVertexWithUV((double)(var2 + 1), (double)((float)(var3 + 0) + var19), (double)(var4 + 0), var9, var15); -- var5.addVertexWithUV((double)(var2 + 1), (double)((float)var3 + var17 + var19), (double)((float)var4 + var36), var9, var11); -- var5.addVertexWithUV((double)(var2 + 1), (double)((float)var3 + var17 + var19), (double)((float)var4 + var36), var9, var11); -- var5.addVertexWithUV((double)(var2 + 1), (double)((float)(var3 + 0) + var19), (double)(var4 + 0), var9, var15); -- var5.addVertexWithUV((double)(var2 + 0), (double)((float)(var3 + 0) + var19), (double)(var4 + 0), var13, var15); -- var5.addVertexWithUV((double)(var2 + 0), (double)((float)var3 + var17 + var19), (double)((float)var4 + var36), var13, var11); -- } -- -- if(Block.fire.canBlockCatchFire(this.blockAccess, var2, var3, var4 + 1)) { -- var5.addVertexWithUV((double)(var2 + 1), (double)((float)var3 + var17 + var19), (double)((float)(var4 + 1) - var36), var9, var11); -- var5.addVertexWithUV((double)(var2 + 1), (double)((float)(var3 + 0) + var19), (double)(var4 + 1 - 0), var9, var15); -- var5.addVertexWithUV((double)(var2 + 0), (double)((float)(var3 + 0) + var19), (double)(var4 + 1 - 0), var13, var15); -- var5.addVertexWithUV((double)(var2 + 0), (double)((float)var3 + var17 + var19), (double)((float)(var4 + 1) - var36), var13, var11); -- var5.addVertexWithUV((double)(var2 + 0), (double)((float)var3 + var17 + var19), (double)((float)(var4 + 1) - var36), var13, var11); -- var5.addVertexWithUV((double)(var2 + 0), (double)((float)(var3 + 0) + var19), (double)(var4 + 1 - 0), var13, var15); -- var5.addVertexWithUV((double)(var2 + 1), (double)((float)(var3 + 0) + var19), (double)(var4 + 1 - 0), var9, var15); -- var5.addVertexWithUV((double)(var2 + 1), (double)((float)var3 + var17 + var19), (double)((float)(var4 + 1) - var36), var9, var11); -- } -- -- if(Block.fire.canBlockCatchFire(this.blockAccess, var2, var3 + 1, var4)) { -- var20 = (double)var2 + 0.5D + 0.5D; -- var22 = (double)var2 + 0.5D - 0.5D; -- var24 = (double)var4 + 0.5D + 0.5D; -- var26 = (double)var4 + 0.5D - 0.5D; -- var28 = (double)var2 + 0.5D - 0.5D; -- var30 = (double)var2 + 0.5D + 0.5D; -- var32 = (double)var4 + 0.5D - 0.5D; -- double var34 = (double)var4 + 0.5D + 0.5D; -- var9 = (double)var6.getMinU(); -- var11 = (double)var6.getMinV(); -- var13 = (double)var6.getMaxU(); -- var15 = (double)var6.getMaxV(); -- ++var3; -- var17 = -0.2F; -- if((var2 + var3 + var4 & 1) == 0) { -- var5.addVertexWithUV(var28, (double)((float)var3 + var17), (double)(var4 + 0), var13, var11); -- var5.addVertexWithUV(var20, (double)(var3 + 0), (double)(var4 + 0), var13, var15); -- var5.addVertexWithUV(var20, (double)(var3 + 0), (double)(var4 + 1), var9, var15); -- var5.addVertexWithUV(var28, (double)((float)var3 + var17), (double)(var4 + 1), var9, var11); -- var9 = (double)var7.getMinU(); -- var11 = (double)var7.getMinV(); -- var13 = (double)var7.getMaxU(); -- var15 = (double)var7.getMaxV(); -- var5.addVertexWithUV(var30, (double)((float)var3 + var17), (double)(var4 + 1), var13, var11); -- var5.addVertexWithUV(var22, (double)(var3 + 0), (double)(var4 + 1), var13, var15); -- var5.addVertexWithUV(var22, (double)(var3 + 0), (double)(var4 + 0), var9, var15); -- var5.addVertexWithUV(var30, (double)((float)var3 + var17), (double)(var4 + 0), var9, var11); -- } else { -- var5.addVertexWithUV((double)(var2 + 0), (double)((float)var3 + var17), var34, var13, var11); -- var5.addVertexWithUV((double)(var2 + 0), (double)(var3 + 0), var26, var13, var15); -- var5.addVertexWithUV((double)(var2 + 1), (double)(var3 + 0), var26, var9, var15); -- var5.addVertexWithUV((double)(var2 + 1), (double)((float)var3 + var17), var34, var9, var11); -- var9 = (double)var7.getMinU(); -- var11 = (double)var7.getMinV(); -- var13 = (double)var7.getMaxU(); -- var15 = (double)var7.getMaxV(); -- var5.addVertexWithUV((double)(var2 + 1), (double)((float)var3 + var17), var32, var13, var11); -- var5.addVertexWithUV((double)(var2 + 1), (double)(var3 + 0), var24, var13, var15); -- var5.addVertexWithUV((double)(var2 + 0), (double)(var3 + 0), var24, var9, var15); -- var5.addVertexWithUV((double)(var2 + 0), (double)((float)var3 + var17), var32, var9, var11); -- } -- } -+ var5.setBrightness(par1BlockFire.getMixedBrightnessForBlock(this.blockAccess, par2, par3, par4)); -+ var8 = CTMUtils.getTile(this, par1BlockFire, par2, par3, par4, var8, var5); -+ -+ if (var8 == null) { -+ return false; - } else { -- double var18 = (double)var2 + 0.5D + 0.2D; -- var20 = (double)var2 + 0.5D - 0.2D; -- var22 = (double)var4 + 0.5D + 0.2D; -- var24 = (double)var4 + 0.5D - 0.2D; -- var26 = (double)var2 + 0.5D - 0.3D; -- var28 = (double)var2 + 0.5D + 0.3D; -- var30 = (double)var4 + 0.5D - 0.3D; -- var32 = (double)var4 + 0.5D + 0.3D; -- var5.addVertexWithUV(var26, (double)((float)var3 + var17), (double)(var4 + 1), var13, var11); -- var5.addVertexWithUV(var18, (double)(var3 + 0), (double)(var4 + 1), var13, var15); -- var5.addVertexWithUV(var18, (double)(var3 + 0), (double)(var4 + 0), var9, var15); -- var5.addVertexWithUV(var26, (double)((float)var3 + var17), (double)(var4 + 0), var9, var11); -- var5.addVertexWithUV(var28, (double)((float)var3 + var17), (double)(var4 + 0), var13, var11); -- var5.addVertexWithUV(var20, (double)(var3 + 0), (double)(var4 + 0), var13, var15); -- var5.addVertexWithUV(var20, (double)(var3 + 0), (double)(var4 + 1), var9, var15); -- var5.addVertexWithUV(var28, (double)((float)var3 + var17), (double)(var4 + 1), var9, var11); -- var9 = (double)var7.getMinU(); -- var11 = (double)var7.getMinV(); -- var13 = (double)var7.getMaxU(); -- var15 = (double)var7.getMaxV(); -- var5.addVertexWithUV((double)(var2 + 1), (double)((float)var3 + var17), var32, var13, var11); -- var5.addVertexWithUV((double)(var2 + 1), (double)(var3 + 0), var24, var13, var15); -- var5.addVertexWithUV((double)(var2 + 0), (double)(var3 + 0), var24, var9, var15); -- var5.addVertexWithUV((double)(var2 + 0), (double)((float)var3 + var17), var32, var9, var11); -- var5.addVertexWithUV((double)(var2 + 0), (double)((float)var3 + var17), var30, var13, var11); -- var5.addVertexWithUV((double)(var2 + 0), (double)(var3 + 0), var22, var13, var15); -- var5.addVertexWithUV((double)(var2 + 1), (double)(var3 + 0), var22, var9, var15); -- var5.addVertexWithUV((double)(var2 + 1), (double)((float)var3 + var17), var30, var9, var11); -- var18 = (double)var2 + 0.5D - 0.5D; -- var20 = (double)var2 + 0.5D + 0.5D; -- var22 = (double)var4 + 0.5D - 0.5D; -- var24 = (double)var4 + 0.5D + 0.5D; -- var26 = (double)var2 + 0.5D - 0.4D; -- var28 = (double)var2 + 0.5D + 0.4D; -- var30 = (double)var4 + 0.5D - 0.4D; -- var32 = (double)var4 + 0.5D + 0.4D; -- var5.addVertexWithUV(var26, (double)((float)var3 + var17), (double)(var4 + 0), var9, var11); -- var5.addVertexWithUV(var18, (double)(var3 + 0), (double)(var4 + 0), var9, var15); -- var5.addVertexWithUV(var18, (double)(var3 + 0), (double)(var4 + 1), var13, var15); -- var5.addVertexWithUV(var26, (double)((float)var3 + var17), (double)(var4 + 1), var13, var11); -- var5.addVertexWithUV(var28, (double)((float)var3 + var17), (double)(var4 + 1), var9, var11); -- var5.addVertexWithUV(var20, (double)(var3 + 0), (double)(var4 + 1), var9, var15); -- var5.addVertexWithUV(var20, (double)(var3 + 0), (double)(var4 + 0), var13, var15); -- var5.addVertexWithUV(var28, (double)((float)var3 + var17), (double)(var4 + 0), var13, var11); -- var9 = (double)var6.getMinU(); -- var11 = (double)var6.getMinV(); -- var13 = (double)var6.getMaxU(); -- var15 = (double)var6.getMaxV(); -- var5.addVertexWithUV((double)(var2 + 0), (double)((float)var3 + var17), var32, var9, var11); -- var5.addVertexWithUV((double)(var2 + 0), (double)(var3 + 0), var24, var9, var15); -- var5.addVertexWithUV((double)(var2 + 1), (double)(var3 + 0), var24, var13, var15); -- var5.addVertexWithUV((double)(var2 + 1), (double)((float)var3 + var17), var32, var13, var11); -- var5.addVertexWithUV((double)(var2 + 1), (double)((float)var3 + var17), var30, var9, var11); -- var5.addVertexWithUV((double)(var2 + 1), (double)(var3 + 0), var22, var9, var15); -- var5.addVertexWithUV((double)(var2 + 0), (double)(var3 + 0), var22, var13, var15); -- var5.addVertexWithUV((double)(var2 + 0), (double)((float)var3 + var17), var30, var13, var11); -+ var5 = TessellatorUtils.getTessellator(var5, var8); -+ double var9 = (double)var8.getMinU(); -+ double var11 = (double)var8.getMinV(); -+ double var13 = (double)var8.getMaxU(); -+ double var15 = (double)var8.getMaxV(); -+ float var17 = 1.4F; -+ double var32; -+ double var20; -+ double var22; -+ double var24; -+ double var26; -+ double var28; -+ double var30; -+ -+ if (!this.blockAccess.doesBlockHaveSolidTopSurface(par2, par3 - 1, par4) && !Block.fire.canBlockCatchFire(this.blockAccess, par2, par3 - 1, par4)) { -+ float var36 = 0.2F; -+ float var19 = 0.0625F; -+ -+ if ((par2 + par3 + par4 & 1) == 1) { -+ var8 = CTMUtils.getTile(this, par1BlockFire, par2, par3, par4, var7, var5); -+ -+ if (var8 == null) { -+ return false; -+ } -+ -+ var5 = TessellatorUtils.getTessellator(var5, var8); -+ var9 = (double)var8.getMinU(); -+ var11 = (double)var8.getMinV(); -+ var13 = (double)var8.getMaxU(); -+ var15 = (double)var8.getMaxV(); -+ } -+ -+ if ((par2 / 2 + par3 / 2 + par4 / 2 & 1) == 1) { -+ var20 = var13; -+ var13 = var9; -+ var9 = var20; -+ } -+ -+ if (Block.fire.canBlockCatchFire(this.blockAccess, par2 - 1, par3, par4)) { -+ var5.addVertexWithUV((double)((float)par2 + var36), (double)((float)par3 + var17 + var19), (double)(par4 + 1), var13, var11); -+ var5.addVertexWithUV((double)(par2 + 0), (double)((float)(par3 + 0) + var19), (double)(par4 + 1), var13, var15); -+ var5.addVertexWithUV((double)(par2 + 0), (double)((float)(par3 + 0) + var19), (double)(par4 + 0), var9, var15); -+ var5.addVertexWithUV((double)((float)par2 + var36), (double)((float)par3 + var17 + var19), (double)(par4 + 0), var9, var11); -+ var5.addVertexWithUV((double)((float)par2 + var36), (double)((float)par3 + var17 + var19), (double)(par4 + 0), var9, var11); -+ var5.addVertexWithUV((double)(par2 + 0), (double)((float)(par3 + 0) + var19), (double)(par4 + 0), var9, var15); -+ var5.addVertexWithUV((double)(par2 + 0), (double)((float)(par3 + 0) + var19), (double)(par4 + 1), var13, var15); -+ var5.addVertexWithUV((double)((float)par2 + var36), (double)((float)par3 + var17 + var19), (double)(par4 + 1), var13, var11); -+ } -+ -+ if (Block.fire.canBlockCatchFire(this.blockAccess, par2 + 1, par3, par4)) { -+ var5.addVertexWithUV((double)((float)(par2 + 1) - var36), (double)((float)par3 + var17 + var19), (double)(par4 + 0), var9, var11); -+ var5.addVertexWithUV((double)(par2 + 1 - 0), (double)((float)(par3 + 0) + var19), (double)(par4 + 0), var9, var15); -+ var5.addVertexWithUV((double)(par2 + 1 - 0), (double)((float)(par3 + 0) + var19), (double)(par4 + 1), var13, var15); -+ var5.addVertexWithUV((double)((float)(par2 + 1) - var36), (double)((float)par3 + var17 + var19), (double)(par4 + 1), var13, var11); -+ var5.addVertexWithUV((double)((float)(par2 + 1) - var36), (double)((float)par3 + var17 + var19), (double)(par4 + 1), var13, var11); -+ var5.addVertexWithUV((double)(par2 + 1 - 0), (double)((float)(par3 + 0) + var19), (double)(par4 + 1), var13, var15); -+ var5.addVertexWithUV((double)(par2 + 1 - 0), (double)((float)(par3 + 0) + var19), (double)(par4 + 0), var9, var15); -+ var5.addVertexWithUV((double)((float)(par2 + 1) - var36), (double)((float)par3 + var17 + var19), (double)(par4 + 0), var9, var11); -+ } -+ -+ if (Block.fire.canBlockCatchFire(this.blockAccess, par2, par3, par4 - 1)) { -+ var5.addVertexWithUV((double)(par2 + 0), (double)((float)par3 + var17 + var19), (double)((float)par4 + var36), var13, var11); -+ var5.addVertexWithUV((double)(par2 + 0), (double)((float)(par3 + 0) + var19), (double)(par4 + 0), var13, var15); -+ var5.addVertexWithUV((double)(par2 + 1), (double)((float)(par3 + 0) + var19), (double)(par4 + 0), var9, var15); -+ var5.addVertexWithUV((double)(par2 + 1), (double)((float)par3 + var17 + var19), (double)((float)par4 + var36), var9, var11); -+ var5.addVertexWithUV((double)(par2 + 1), (double)((float)par3 + var17 + var19), (double)((float)par4 + var36), var9, var11); -+ var5.addVertexWithUV((double)(par2 + 1), (double)((float)(par3 + 0) + var19), (double)(par4 + 0), var9, var15); -+ var5.addVertexWithUV((double)(par2 + 0), (double)((float)(par3 + 0) + var19), (double)(par4 + 0), var13, var15); -+ var5.addVertexWithUV((double)(par2 + 0), (double)((float)par3 + var17 + var19), (double)((float)par4 + var36), var13, var11); -+ } -+ -+ if (Block.fire.canBlockCatchFire(this.blockAccess, par2, par3, par4 + 1)) { -+ var5.addVertexWithUV((double)(par2 + 1), (double)((float)par3 + var17 + var19), (double)((float)(par4 + 1) - var36), var9, var11); -+ var5.addVertexWithUV((double)(par2 + 1), (double)((float)(par3 + 0) + var19), (double)(par4 + 1 - 0), var9, var15); -+ var5.addVertexWithUV((double)(par2 + 0), (double)((float)(par3 + 0) + var19), (double)(par4 + 1 - 0), var13, var15); -+ var5.addVertexWithUV((double)(par2 + 0), (double)((float)par3 + var17 + var19), (double)((float)(par4 + 1) - var36), var13, var11); -+ var5.addVertexWithUV((double)(par2 + 0), (double)((float)par3 + var17 + var19), (double)((float)(par4 + 1) - var36), var13, var11); -+ var5.addVertexWithUV((double)(par2 + 0), (double)((float)(par3 + 0) + var19), (double)(par4 + 1 - 0), var13, var15); -+ var5.addVertexWithUV((double)(par2 + 1), (double)((float)(par3 + 0) + var19), (double)(par4 + 1 - 0), var9, var15); -+ var5.addVertexWithUV((double)(par2 + 1), (double)((float)par3 + var17 + var19), (double)((float)(par4 + 1) - var36), var9, var11); -+ } -+ -+ if (Block.fire.canBlockCatchFire(this.blockAccess, par2, par3 + 1, par4)) { -+ var20 = (double)par2 + 0.5D + 0.5D; -+ var22 = (double)par2 + 0.5D - 0.5D; -+ var24 = (double)par4 + 0.5D + 0.5D; -+ var26 = (double)par4 + 0.5D - 0.5D; -+ var28 = (double)par2 + 0.5D - 0.5D; -+ var30 = (double)par2 + 0.5D + 0.5D; -+ var32 = (double)par4 + 0.5D - 0.5D; -+ double var34 = (double)par4 + 0.5D + 0.5D; -+ var8 = CTMUtils.getTile(this, par1BlockFire, par2, par3, par4, var6, var5); -+ -+ if (var8 == null) { -+ return false; -+ } -+ -+ var5 = TessellatorUtils.getTessellator(var5, var8); -+ var9 = (double)var8.getMinU(); -+ var11 = (double)var8.getMinV(); -+ var13 = (double)var8.getMaxU(); -+ var15 = (double)var8.getMaxV(); -+ ++par3; -+ var17 = -0.2F; -+ -+ if ((par2 + par3 + par4 & 1) == 0) { -+ var5.addVertexWithUV(var28, (double)((float)par3 + var17), (double)(par4 + 0), var13, var11); -+ var5.addVertexWithUV(var20, (double)(par3 + 0), (double)(par4 + 0), var13, var15); -+ var5.addVertexWithUV(var20, (double)(par3 + 0), (double)(par4 + 1), var9, var15); -+ var5.addVertexWithUV(var28, (double)((float)par3 + var17), (double)(par4 + 1), var9, var11); -+ var8 = CTMUtils.getTile(this, par1BlockFire, par2, par3, par4, var7, var5); -+ -+ if (var8 == null) { -+ return false; -+ } -+ -+ var5 = TessellatorUtils.getTessellator(var5, var8); -+ var9 = (double)var8.getMinU(); -+ var11 = (double)var8.getMinV(); -+ var13 = (double)var8.getMaxU(); -+ var15 = (double)var8.getMaxV(); -+ var5.addVertexWithUV(var30, (double)((float)par3 + var17), (double)(par4 + 1), var13, var11); -+ var5.addVertexWithUV(var22, (double)(par3 + 0), (double)(par4 + 1), var13, var15); -+ var5.addVertexWithUV(var22, (double)(par3 + 0), (double)(par4 + 0), var9, var15); -+ var5.addVertexWithUV(var30, (double)((float)par3 + var17), (double)(par4 + 0), var9, var11); -+ } else { -+ var5.addVertexWithUV((double)(par2 + 0), (double)((float)par3 + var17), var34, var13, var11); -+ var5.addVertexWithUV((double)(par2 + 0), (double)(par3 + 0), var26, var13, var15); -+ var5.addVertexWithUV((double)(par2 + 1), (double)(par3 + 0), var26, var9, var15); -+ var5.addVertexWithUV((double)(par2 + 1), (double)((float)par3 + var17), var34, var9, var11); -+ var8 = CTMUtils.getTile(this, par1BlockFire, par2, par3, par4, var7, var5); -+ -+ if (var8 == null) { -+ return false; -+ } -+ -+ var5 = TessellatorUtils.getTessellator(var5, var8); -+ var9 = (double)var8.getMinU(); -+ var11 = (double)var8.getMinV(); -+ var13 = (double)var8.getMaxU(); -+ var15 = (double)var8.getMaxV(); -+ var5.addVertexWithUV((double)(par2 + 1), (double)((float)par3 + var17), var32, var13, var11); -+ var5.addVertexWithUV((double)(par2 + 1), (double)(par3 + 0), var24, var13, var15); -+ var5.addVertexWithUV((double)(par2 + 0), (double)(par3 + 0), var24, var9, var15); -+ var5.addVertexWithUV((double)(par2 + 0), (double)((float)par3 + var17), var32, var9, var11); -+ } -+ } -+ } else { -+ double var18 = (double)par2 + 0.5D + 0.2D; -+ var20 = (double)par2 + 0.5D - 0.2D; -+ var22 = (double)par4 + 0.5D + 0.2D; -+ var24 = (double)par4 + 0.5D - 0.2D; -+ var26 = (double)par2 + 0.5D - 0.3D; -+ var28 = (double)par2 + 0.5D + 0.3D; -+ var30 = (double)par4 + 0.5D - 0.3D; -+ var32 = (double)par4 + 0.5D + 0.3D; -+ var5.addVertexWithUV(var26, (double)((float)par3 + var17), (double)(par4 + 1), var13, var11); -+ var5.addVertexWithUV(var18, (double)(par3 + 0), (double)(par4 + 1), var13, var15); -+ var5.addVertexWithUV(var18, (double)(par3 + 0), (double)(par4 + 0), var9, var15); -+ var5.addVertexWithUV(var26, (double)((float)par3 + var17), (double)(par4 + 0), var9, var11); -+ var5.addVertexWithUV(var28, (double)((float)par3 + var17), (double)(par4 + 0), var13, var11); -+ var5.addVertexWithUV(var20, (double)(par3 + 0), (double)(par4 + 0), var13, var15); -+ var5.addVertexWithUV(var20, (double)(par3 + 0), (double)(par4 + 1), var9, var15); -+ var5.addVertexWithUV(var28, (double)((float)par3 + var17), (double)(par4 + 1), var9, var11); -+ var8 = CTMUtils.getTile(this, par1BlockFire, par2, par3, par4, var7, var5); -+ -+ if (var8 == null) { -+ return false; -+ } -+ -+ var5 = TessellatorUtils.getTessellator(var5, var8); -+ var9 = (double)var8.getMinU(); -+ var11 = (double)var8.getMinV(); -+ var13 = (double)var8.getMaxU(); -+ var15 = (double)var8.getMaxV(); -+ var5.addVertexWithUV((double)(par2 + 1), (double)((float)par3 + var17), var32, var13, var11); -+ var5.addVertexWithUV((double)(par2 + 1), (double)(par3 + 0), var24, var13, var15); -+ var5.addVertexWithUV((double)(par2 + 0), (double)(par3 + 0), var24, var9, var15); -+ var5.addVertexWithUV((double)(par2 + 0), (double)((float)par3 + var17), var32, var9, var11); -+ var5.addVertexWithUV((double)(par2 + 0), (double)((float)par3 + var17), var30, var13, var11); -+ var5.addVertexWithUV((double)(par2 + 0), (double)(par3 + 0), var22, var13, var15); -+ var5.addVertexWithUV((double)(par2 + 1), (double)(par3 + 0), var22, var9, var15); -+ var5.addVertexWithUV((double)(par2 + 1), (double)((float)par3 + var17), var30, var9, var11); -+ var18 = (double)par2 + 0.5D - 0.5D; -+ var20 = (double)par2 + 0.5D + 0.5D; -+ var22 = (double)par4 + 0.5D - 0.5D; -+ var24 = (double)par4 + 0.5D + 0.5D; -+ var26 = (double)par2 + 0.5D - 0.4D; -+ var28 = (double)par2 + 0.5D + 0.4D; -+ var30 = (double)par4 + 0.5D - 0.4D; -+ var32 = (double)par4 + 0.5D + 0.4D; -+ var5.addVertexWithUV(var26, (double)((float)par3 + var17), (double)(par4 + 0), var9, var11); -+ var5.addVertexWithUV(var18, (double)(par3 + 0), (double)(par4 + 0), var9, var15); -+ var5.addVertexWithUV(var18, (double)(par3 + 0), (double)(par4 + 1), var13, var15); -+ var5.addVertexWithUV(var26, (double)((float)par3 + var17), (double)(par4 + 1), var13, var11); -+ var5.addVertexWithUV(var28, (double)((float)par3 + var17), (double)(par4 + 1), var9, var11); -+ var5.addVertexWithUV(var20, (double)(par3 + 0), (double)(par4 + 1), var9, var15); -+ var5.addVertexWithUV(var20, (double)(par3 + 0), (double)(par4 + 0), var13, var15); -+ var5.addVertexWithUV(var28, (double)((float)par3 + var17), (double)(par4 + 0), var13, var11); -+ var8 = CTMUtils.getTile(this, par1BlockFire, par2, par3, par4, var6, var5); -+ -+ if (var8 == null) { -+ return false; -+ } -+ -+ var5 = TessellatorUtils.getTessellator(var5, var8); -+ var9 = (double)var8.getMinU(); -+ var11 = (double)var8.getMinV(); -+ var13 = (double)var8.getMaxU(); -+ var15 = (double)var8.getMaxV(); -+ var5.addVertexWithUV((double)(par2 + 0), (double)((float)par3 + var17), var32, var9, var11); -+ var5.addVertexWithUV((double)(par2 + 0), (double)(par3 + 0), var24, var9, var15); -+ var5.addVertexWithUV((double)(par2 + 1), (double)(par3 + 0), var24, var13, var15); -+ var5.addVertexWithUV((double)(par2 + 1), (double)((float)par3 + var17), var32, var13, var11); -+ var5.addVertexWithUV((double)(par2 + 1), (double)((float)par3 + var17), var30, var9, var11); -+ var5.addVertexWithUV((double)(par2 + 1), (double)(par3 + 0), var22, var9, var15); -+ var5.addVertexWithUV((double)(par2 + 0), (double)(par3 + 0), var22, var13, var15); -+ var5.addVertexWithUV((double)(par2 + 0), (double)((float)par3 + var17), var30, var13, var11); -+ } -+ -+ return true; - } -- -- return true; - } - -- public boolean renderBlockRedstoneWire(Block var1, int var2, int var3, int var4) { -+ /** -+ * Renders a redstone wire block at the given coordinates -+ */ -+ public boolean renderBlockRedstoneWire(Block par1Block, int par2, int par3, int par4) { - Tessellator var5 = Tessellator.instance; -- int var6 = this.blockAccess.getBlockMetadata(var2, var3, var4); -+ int var6 = this.blockAccess.getBlockMetadata(par2, par3, par4); - Icon var7 = BlockRedstoneWire.getRedstoneWireIcon("cross"); - Icon var8 = BlockRedstoneWire.getRedstoneWireIcon("line"); - Icon var9 = BlockRedstoneWire.getRedstoneWireIcon("cross_overlay"); - Icon var10 = BlockRedstoneWire.getRedstoneWireIcon("line_overlay"); -- var5.setBrightness(var1.getMixedBrightnessForBlock(this.blockAccess, var2, var3, var4)); -+ var5.setBrightness(par1Block.getMixedBrightnessForBlock(this.blockAccess, par2, par3, par4)); - float var11 = 1.0F; -- float var12 = (float)var6 / 15.0F; -- float var13 = var12 * 0.6F + 0.4F; -- if(var6 == 0) { -- var13 = 0.3F; -+ float var13; -+ float var14; -+ float var15; -+ -+ if (ColorizeBlock.computeRedstoneWireColor(var6)) { -+ var13 = Colorizer.setColor[0]; -+ var14 = Colorizer.setColor[1]; -+ var15 = Colorizer.setColor[2]; -+ } else { -+ float var12 = (float)var6 / 15.0F; -+ var13 = var12 * 0.6F + 0.4F; -+ -+ if (var6 == 0) { -+ var13 = 0.3F; -+ } -+ -+ var14 = var12 * var12 * 0.7F - 0.5F; -+ var15 = var12 * var12 * 0.6F - 0.7F; - } - -- float var14 = var12 * var12 * 0.7F - 0.5F; -- float var15 = var12 * var12 * 0.6F - 0.7F; -- if(var14 < 0.0F) { -+ if (var14 < 0.0F) { - var14 = 0.0F; - } - -- if(var15 < 0.0F) { -+ if (var15 < 0.0F) { - var15 = 0.0F; - } - - var5.setColorOpaque_F(var13, var14, var15); -- double var16 = 1.0D / 64.0D; -- double var18 = 1.0D / 64.0D; -- boolean var20 = BlockRedstoneWire.isPowerProviderOrWire(this.blockAccess, var2 - 1, var3, var4, 1) || !this.blockAccess.isBlockNormalCube(var2 - 1, var3, var4) && BlockRedstoneWire.isPowerProviderOrWire(this.blockAccess, var2 - 1, var3 - 1, var4, -1); -- boolean var21 = BlockRedstoneWire.isPowerProviderOrWire(this.blockAccess, var2 + 1, var3, var4, 3) || !this.blockAccess.isBlockNormalCube(var2 + 1, var3, var4) && BlockRedstoneWire.isPowerProviderOrWire(this.blockAccess, var2 + 1, var3 - 1, var4, -1); -- boolean var22 = BlockRedstoneWire.isPowerProviderOrWire(this.blockAccess, var2, var3, var4 - 1, 2) || !this.blockAccess.isBlockNormalCube(var2, var3, var4 - 1) && BlockRedstoneWire.isPowerProviderOrWire(this.blockAccess, var2, var3 - 1, var4 - 1, -1); -- boolean var23 = BlockRedstoneWire.isPowerProviderOrWire(this.blockAccess, var2, var3, var4 + 1, 0) || !this.blockAccess.isBlockNormalCube(var2, var3, var4 + 1) && BlockRedstoneWire.isPowerProviderOrWire(this.blockAccess, var2, var3 - 1, var4 + 1, -1); -- if(!this.blockAccess.isBlockNormalCube(var2, var3 + 1, var4)) { -- if(this.blockAccess.isBlockNormalCube(var2 - 1, var3, var4) && BlockRedstoneWire.isPowerProviderOrWire(this.blockAccess, var2 - 1, var3 + 1, var4, -1)) { -+ double var16 = 0.015625D; -+ double var18 = 0.015625D; -+ boolean var20 = BlockRedstoneWire.isPowerProviderOrWire(this.blockAccess, par2 - 1, par3, par4, 1) || !this.blockAccess.isBlockNormalCube(par2 - 1, par3, par4) && BlockRedstoneWire.isPowerProviderOrWire(this.blockAccess, par2 - 1, par3 - 1, par4, -1); -+ boolean var21 = BlockRedstoneWire.isPowerProviderOrWire(this.blockAccess, par2 + 1, par3, par4, 3) || !this.blockAccess.isBlockNormalCube(par2 + 1, par3, par4) && BlockRedstoneWire.isPowerProviderOrWire(this.blockAccess, par2 + 1, par3 - 1, par4, -1); -+ boolean var22 = BlockRedstoneWire.isPowerProviderOrWire(this.blockAccess, par2, par3, par4 - 1, 2) || !this.blockAccess.isBlockNormalCube(par2, par3, par4 - 1) && BlockRedstoneWire.isPowerProviderOrWire(this.blockAccess, par2, par3 - 1, par4 - 1, -1); -+ boolean var23 = BlockRedstoneWire.isPowerProviderOrWire(this.blockAccess, par2, par3, par4 + 1, 0) || !this.blockAccess.isBlockNormalCube(par2, par3, par4 + 1) && BlockRedstoneWire.isPowerProviderOrWire(this.blockAccess, par2, par3 - 1, par4 + 1, -1); -+ -+ if (!this.blockAccess.isBlockNormalCube(par2, par3 + 1, par4)) { -+ if (this.blockAccess.isBlockNormalCube(par2 - 1, par3, par4) && BlockRedstoneWire.isPowerProviderOrWire(this.blockAccess, par2 - 1, par3 + 1, par4, -1)) { - var20 = true; - } - -- if(this.blockAccess.isBlockNormalCube(var2 + 1, var3, var4) && BlockRedstoneWire.isPowerProviderOrWire(this.blockAccess, var2 + 1, var3 + 1, var4, -1)) { -+ if (this.blockAccess.isBlockNormalCube(par2 + 1, par3, par4) && BlockRedstoneWire.isPowerProviderOrWire(this.blockAccess, par2 + 1, par3 + 1, par4, -1)) { - var21 = true; - } - -- if(this.blockAccess.isBlockNormalCube(var2, var3, var4 - 1) && BlockRedstoneWire.isPowerProviderOrWire(this.blockAccess, var2, var3 + 1, var4 - 1, -1)) { -+ if (this.blockAccess.isBlockNormalCube(par2, par3, par4 - 1) && BlockRedstoneWire.isPowerProviderOrWire(this.blockAccess, par2, par3 + 1, par4 - 1, -1)) { - var22 = true; - } - -- if(this.blockAccess.isBlockNormalCube(var2, var3, var4 + 1) && BlockRedstoneWire.isPowerProviderOrWire(this.blockAccess, var2, var3 + 1, var4 + 1, -1)) { -+ if (this.blockAccess.isBlockNormalCube(par2, par3, par4 + 1) && BlockRedstoneWire.isPowerProviderOrWire(this.blockAccess, par2, par3 + 1, par4 + 1, -1)) { - var23 = true; - } - } - -- float var24 = (float)(var2 + 0); -- float var25 = (float)(var2 + 1); -- float var26 = (float)(var4 + 0); -- float var27 = (float)(var4 + 1); -- byte var28 = 0; -- if((var20 || var21) && !var22 && !var23) { -+ float var24 = (float)(par2 + 0); -+ float var25 = (float)(par2 + 1); -+ float var26 = (float)(par4 + 0); -+ float var27 = (float)(par4 + 1); -+ int var28 = 0; -+ -+ if ((var20 || var21) && !var22 && !var23) { - var28 = 1; - } - -- if((var22 || var23) && !var21 && !var20) { -+ if ((var22 || var23) && !var21 && !var20) { - var28 = 2; - } - -- if(var28 == 0) { -+ if (var28 == 0) { - int var29 = 0; - int var30 = 0; - int var31 = 16; - int var32 = 16; - boolean var33 = true; -- if(!var20) { -- var24 += 5.0F / 16.0F; -+ -+ if (!var20) { -+ var24 += 0.3125F; - } - -- if(!var20) { -+ if (!var20) { - var29 += 5; - } - -- if(!var21) { -- var25 -= 5.0F / 16.0F; -+ if (!var21) { -+ var25 -= 0.3125F; - } - -- if(!var21) { -+ if (!var21) { - var31 -= 5; - } - -- if(!var22) { -- var26 += 5.0F / 16.0F; -+ if (!var22) { -+ var26 += 0.3125F; - } - -- if(!var22) { -+ if (!var22) { - var30 += 5; - } - -- if(!var23) { -- var27 -= 5.0F / 16.0F; -+ if (!var23) { -+ var27 -= 0.3125F; - } - -- if(!var23) { -+ if (!var23) { - var32 -= 5; - } - -- var5.addVertexWithUV((double)var25, (double)var3 + 1.0D / 64.0D, (double)var27, (double)var7.getInterpolatedU((double)var31), (double)var7.getInterpolatedV((double)var32)); -- var5.addVertexWithUV((double)var25, (double)var3 + 1.0D / 64.0D, (double)var26, (double)var7.getInterpolatedU((double)var31), (double)var7.getInterpolatedV((double)var30)); -- var5.addVertexWithUV((double)var24, (double)var3 + 1.0D / 64.0D, (double)var26, (double)var7.getInterpolatedU((double)var29), (double)var7.getInterpolatedV((double)var30)); -- var5.addVertexWithUV((double)var24, (double)var3 + 1.0D / 64.0D, (double)var27, (double)var7.getInterpolatedU((double)var29), (double)var7.getInterpolatedV((double)var32)); -- var5.setColorOpaque_F(var11, var11, var11); -- var5.addVertexWithUV((double)var25, (double)var3 + 1.0D / 64.0D, (double)var27, (double)var9.getInterpolatedU((double)var31), (double)var9.getInterpolatedV((double)var32)); -- var5.addVertexWithUV((double)var25, (double)var3 + 1.0D / 64.0D, (double)var26, (double)var9.getInterpolatedU((double)var31), (double)var9.getInterpolatedV((double)var30)); -- var5.addVertexWithUV((double)var24, (double)var3 + 1.0D / 64.0D, (double)var26, (double)var9.getInterpolatedU((double)var29), (double)var9.getInterpolatedV((double)var30)); -- var5.addVertexWithUV((double)var24, (double)var3 + 1.0D / 64.0D, (double)var27, (double)var9.getInterpolatedU((double)var29), (double)var9.getInterpolatedV((double)var32)); -- } else if(var28 == 1) { -- var5.addVertexWithUV((double)var25, (double)var3 + 1.0D / 64.0D, (double)var27, (double)var8.getMaxU(), (double)var8.getMaxV()); -- var5.addVertexWithUV((double)var25, (double)var3 + 1.0D / 64.0D, (double)var26, (double)var8.getMaxU(), (double)var8.getMinV()); -- var5.addVertexWithUV((double)var24, (double)var3 + 1.0D / 64.0D, (double)var26, (double)var8.getMinU(), (double)var8.getMinV()); -- var5.addVertexWithUV((double)var24, (double)var3 + 1.0D / 64.0D, (double)var27, (double)var8.getMinU(), (double)var8.getMaxV()); -- var5.setColorOpaque_F(var11, var11, var11); -- var5.addVertexWithUV((double)var25, (double)var3 + 1.0D / 64.0D, (double)var27, (double)var10.getMaxU(), (double)var10.getMaxV()); -- var5.addVertexWithUV((double)var25, (double)var3 + 1.0D / 64.0D, (double)var26, (double)var10.getMaxU(), (double)var10.getMinV()); -- var5.addVertexWithUV((double)var24, (double)var3 + 1.0D / 64.0D, (double)var26, (double)var10.getMinU(), (double)var10.getMinV()); -- var5.addVertexWithUV((double)var24, (double)var3 + 1.0D / 64.0D, (double)var27, (double)var10.getMinU(), (double)var10.getMaxV()); -+ var5.addVertexWithUV((double)var25, (double)par3 + 0.015625D, (double)var27, (double)var7.getInterpolatedU((double)var31), (double)var7.getInterpolatedV((double)var32)); -+ var5.addVertexWithUV((double)var25, (double)par3 + 0.015625D, (double)var26, (double)var7.getInterpolatedU((double)var31), (double)var7.getInterpolatedV((double)var30)); -+ var5.addVertexWithUV((double)var24, (double)par3 + 0.015625D, (double)var26, (double)var7.getInterpolatedU((double)var29), (double)var7.getInterpolatedV((double)var30)); -+ var5.addVertexWithUV((double)var24, (double)par3 + 0.015625D, (double)var27, (double)var7.getInterpolatedU((double)var29), (double)var7.getInterpolatedV((double)var32)); -+ var5.setColorOpaque_F(var11, var11, var11); -+ var5.addVertexWithUV((double)var25, (double)par3 + 0.015625D, (double)var27, (double)var9.getInterpolatedU((double)var31), (double)var9.getInterpolatedV((double)var32)); -+ var5.addVertexWithUV((double)var25, (double)par3 + 0.015625D, (double)var26, (double)var9.getInterpolatedU((double)var31), (double)var9.getInterpolatedV((double)var30)); -+ var5.addVertexWithUV((double)var24, (double)par3 + 0.015625D, (double)var26, (double)var9.getInterpolatedU((double)var29), (double)var9.getInterpolatedV((double)var30)); -+ var5.addVertexWithUV((double)var24, (double)par3 + 0.015625D, (double)var27, (double)var9.getInterpolatedU((double)var29), (double)var9.getInterpolatedV((double)var32)); -+ } else if (var28 == 1) { -+ var5.addVertexWithUV((double)var25, (double)par3 + 0.015625D, (double)var27, (double)var8.getMaxU(), (double)var8.getMaxV()); -+ var5.addVertexWithUV((double)var25, (double)par3 + 0.015625D, (double)var26, (double)var8.getMaxU(), (double)var8.getMinV()); -+ var5.addVertexWithUV((double)var24, (double)par3 + 0.015625D, (double)var26, (double)var8.getMinU(), (double)var8.getMinV()); -+ var5.addVertexWithUV((double)var24, (double)par3 + 0.015625D, (double)var27, (double)var8.getMinU(), (double)var8.getMaxV()); -+ var5.setColorOpaque_F(var11, var11, var11); -+ var5.addVertexWithUV((double)var25, (double)par3 + 0.015625D, (double)var27, (double)var10.getMaxU(), (double)var10.getMaxV()); -+ var5.addVertexWithUV((double)var25, (double)par3 + 0.015625D, (double)var26, (double)var10.getMaxU(), (double)var10.getMinV()); -+ var5.addVertexWithUV((double)var24, (double)par3 + 0.015625D, (double)var26, (double)var10.getMinU(), (double)var10.getMinV()); -+ var5.addVertexWithUV((double)var24, (double)par3 + 0.015625D, (double)var27, (double)var10.getMinU(), (double)var10.getMaxV()); - } else { -- var5.addVertexWithUV((double)var25, (double)var3 + 1.0D / 64.0D, (double)var27, (double)var8.getMaxU(), (double)var8.getMaxV()); -- var5.addVertexWithUV((double)var25, (double)var3 + 1.0D / 64.0D, (double)var26, (double)var8.getMinU(), (double)var8.getMaxV()); -- var5.addVertexWithUV((double)var24, (double)var3 + 1.0D / 64.0D, (double)var26, (double)var8.getMinU(), (double)var8.getMinV()); -- var5.addVertexWithUV((double)var24, (double)var3 + 1.0D / 64.0D, (double)var27, (double)var8.getMaxU(), (double)var8.getMinV()); -+ var5.addVertexWithUV((double)var25, (double)par3 + 0.015625D, (double)var27, (double)var8.getMaxU(), (double)var8.getMaxV()); -+ var5.addVertexWithUV((double)var25, (double)par3 + 0.015625D, (double)var26, (double)var8.getMinU(), (double)var8.getMaxV()); -+ var5.addVertexWithUV((double)var24, (double)par3 + 0.015625D, (double)var26, (double)var8.getMinU(), (double)var8.getMinV()); -+ var5.addVertexWithUV((double)var24, (double)par3 + 0.015625D, (double)var27, (double)var8.getMaxU(), (double)var8.getMinV()); - var5.setColorOpaque_F(var11, var11, var11); -- var5.addVertexWithUV((double)var25, (double)var3 + 1.0D / 64.0D, (double)var27, (double)var10.getMaxU(), (double)var10.getMaxV()); -- var5.addVertexWithUV((double)var25, (double)var3 + 1.0D / 64.0D, (double)var26, (double)var10.getMinU(), (double)var10.getMaxV()); -- var5.addVertexWithUV((double)var24, (double)var3 + 1.0D / 64.0D, (double)var26, (double)var10.getMinU(), (double)var10.getMinV()); -- var5.addVertexWithUV((double)var24, (double)var3 + 1.0D / 64.0D, (double)var27, (double)var10.getMaxU(), (double)var10.getMinV()); -+ var5.addVertexWithUV((double)var25, (double)par3 + 0.015625D, (double)var27, (double)var10.getMaxU(), (double)var10.getMaxV()); -+ var5.addVertexWithUV((double)var25, (double)par3 + 0.015625D, (double)var26, (double)var10.getMinU(), (double)var10.getMaxV()); -+ var5.addVertexWithUV((double)var24, (double)par3 + 0.015625D, (double)var26, (double)var10.getMinU(), (double)var10.getMinV()); -+ var5.addVertexWithUV((double)var24, (double)par3 + 0.015625D, (double)var27, (double)var10.getMaxU(), (double)var10.getMinV()); - } - -- if(!this.blockAccess.isBlockNormalCube(var2, var3 + 1, var4)) { -- float var34 = 7.0F / 320.0F; -- if(this.blockAccess.isBlockNormalCube(var2 - 1, var3, var4) && this.blockAccess.getBlockId(var2 - 1, var3 + 1, var4) == Block.redstoneWire.blockID) { -- var5.setColorOpaque_F(var11 * var13, var11 * var14, var11 * var15); -- var5.addVertexWithUV((double)var2 + 1.0D / 64.0D, (double)((float)(var3 + 1) + 7.0F / 320.0F), (double)(var4 + 1), (double)var8.getMaxU(), (double)var8.getMinV()); -- var5.addVertexWithUV((double)var2 + 1.0D / 64.0D, (double)(var3 + 0), (double)(var4 + 1), (double)var8.getMinU(), (double)var8.getMinV()); -- var5.addVertexWithUV((double)var2 + 1.0D / 64.0D, (double)(var3 + 0), (double)(var4 + 0), (double)var8.getMinU(), (double)var8.getMaxV()); -- var5.addVertexWithUV((double)var2 + 1.0D / 64.0D, (double)((float)(var3 + 1) + 7.0F / 320.0F), (double)(var4 + 0), (double)var8.getMaxU(), (double)var8.getMaxV()); -- var5.setColorOpaque_F(var11, var11, var11); -- var5.addVertexWithUV((double)var2 + 1.0D / 64.0D, (double)((float)(var3 + 1) + 7.0F / 320.0F), (double)(var4 + 1), (double)var10.getMaxU(), (double)var10.getMinV()); -- var5.addVertexWithUV((double)var2 + 1.0D / 64.0D, (double)(var3 + 0), (double)(var4 + 1), (double)var10.getMinU(), (double)var10.getMinV()); -- var5.addVertexWithUV((double)var2 + 1.0D / 64.0D, (double)(var3 + 0), (double)(var4 + 0), (double)var10.getMinU(), (double)var10.getMaxV()); -- var5.addVertexWithUV((double)var2 + 1.0D / 64.0D, (double)((float)(var3 + 1) + 7.0F / 320.0F), (double)(var4 + 0), (double)var10.getMaxU(), (double)var10.getMaxV()); -- } -- -- if(this.blockAccess.isBlockNormalCube(var2 + 1, var3, var4) && this.blockAccess.getBlockId(var2 + 1, var3 + 1, var4) == Block.redstoneWire.blockID) { -- var5.setColorOpaque_F(var11 * var13, var11 * var14, var11 * var15); -- var5.addVertexWithUV((double)(var2 + 1) - 1.0D / 64.0D, (double)(var3 + 0), (double)(var4 + 1), (double)var8.getMinU(), (double)var8.getMaxV()); -- var5.addVertexWithUV((double)(var2 + 1) - 1.0D / 64.0D, (double)((float)(var3 + 1) + 7.0F / 320.0F), (double)(var4 + 1), (double)var8.getMaxU(), (double)var8.getMaxV()); -- var5.addVertexWithUV((double)(var2 + 1) - 1.0D / 64.0D, (double)((float)(var3 + 1) + 7.0F / 320.0F), (double)(var4 + 0), (double)var8.getMaxU(), (double)var8.getMinV()); -- var5.addVertexWithUV((double)(var2 + 1) - 1.0D / 64.0D, (double)(var3 + 0), (double)(var4 + 0), (double)var8.getMinU(), (double)var8.getMinV()); -- var5.setColorOpaque_F(var11, var11, var11); -- var5.addVertexWithUV((double)(var2 + 1) - 1.0D / 64.0D, (double)(var3 + 0), (double)(var4 + 1), (double)var10.getMinU(), (double)var10.getMaxV()); -- var5.addVertexWithUV((double)(var2 + 1) - 1.0D / 64.0D, (double)((float)(var3 + 1) + 7.0F / 320.0F), (double)(var4 + 1), (double)var10.getMaxU(), (double)var10.getMaxV()); -- var5.addVertexWithUV((double)(var2 + 1) - 1.0D / 64.0D, (double)((float)(var3 + 1) + 7.0F / 320.0F), (double)(var4 + 0), (double)var10.getMaxU(), (double)var10.getMinV()); -- var5.addVertexWithUV((double)(var2 + 1) - 1.0D / 64.0D, (double)(var3 + 0), (double)(var4 + 0), (double)var10.getMinU(), (double)var10.getMinV()); -- } -- -- if(this.blockAccess.isBlockNormalCube(var2, var3, var4 - 1) && this.blockAccess.getBlockId(var2, var3 + 1, var4 - 1) == Block.redstoneWire.blockID) { -- var5.setColorOpaque_F(var11 * var13, var11 * var14, var11 * var15); -- var5.addVertexWithUV((double)(var2 + 1), (double)(var3 + 0), (double)var4 + 1.0D / 64.0D, (double)var8.getMinU(), (double)var8.getMaxV()); -- var5.addVertexWithUV((double)(var2 + 1), (double)((float)(var3 + 1) + 7.0F / 320.0F), (double)var4 + 1.0D / 64.0D, (double)var8.getMaxU(), (double)var8.getMaxV()); -- var5.addVertexWithUV((double)(var2 + 0), (double)((float)(var3 + 1) + 7.0F / 320.0F), (double)var4 + 1.0D / 64.0D, (double)var8.getMaxU(), (double)var8.getMinV()); -- var5.addVertexWithUV((double)(var2 + 0), (double)(var3 + 0), (double)var4 + 1.0D / 64.0D, (double)var8.getMinU(), (double)var8.getMinV()); -- var5.setColorOpaque_F(var11, var11, var11); -- var5.addVertexWithUV((double)(var2 + 1), (double)(var3 + 0), (double)var4 + 1.0D / 64.0D, (double)var10.getMinU(), (double)var10.getMaxV()); -- var5.addVertexWithUV((double)(var2 + 1), (double)((float)(var3 + 1) + 7.0F / 320.0F), (double)var4 + 1.0D / 64.0D, (double)var10.getMaxU(), (double)var10.getMaxV()); -- var5.addVertexWithUV((double)(var2 + 0), (double)((float)(var3 + 1) + 7.0F / 320.0F), (double)var4 + 1.0D / 64.0D, (double)var10.getMaxU(), (double)var10.getMinV()); -- var5.addVertexWithUV((double)(var2 + 0), (double)(var3 + 0), (double)var4 + 1.0D / 64.0D, (double)var10.getMinU(), (double)var10.getMinV()); -- } -- -- if(this.blockAccess.isBlockNormalCube(var2, var3, var4 + 1) && this.blockAccess.getBlockId(var2, var3 + 1, var4 + 1) == Block.redstoneWire.blockID) { -- var5.setColorOpaque_F(var11 * var13, var11 * var14, var11 * var15); -- var5.addVertexWithUV((double)(var2 + 1), (double)((float)(var3 + 1) + 7.0F / 320.0F), (double)(var4 + 1) - 1.0D / 64.0D, (double)var8.getMaxU(), (double)var8.getMinV()); -- var5.addVertexWithUV((double)(var2 + 1), (double)(var3 + 0), (double)(var4 + 1) - 1.0D / 64.0D, (double)var8.getMinU(), (double)var8.getMinV()); -- var5.addVertexWithUV((double)(var2 + 0), (double)(var3 + 0), (double)(var4 + 1) - 1.0D / 64.0D, (double)var8.getMinU(), (double)var8.getMaxV()); -- var5.addVertexWithUV((double)(var2 + 0), (double)((float)(var3 + 1) + 7.0F / 320.0F), (double)(var4 + 1) - 1.0D / 64.0D, (double)var8.getMaxU(), (double)var8.getMaxV()); -- var5.setColorOpaque_F(var11, var11, var11); -- var5.addVertexWithUV((double)(var2 + 1), (double)((float)(var3 + 1) + 7.0F / 320.0F), (double)(var4 + 1) - 1.0D / 64.0D, (double)var10.getMaxU(), (double)var10.getMinV()); -- var5.addVertexWithUV((double)(var2 + 1), (double)(var3 + 0), (double)(var4 + 1) - 1.0D / 64.0D, (double)var10.getMinU(), (double)var10.getMinV()); -- var5.addVertexWithUV((double)(var2 + 0), (double)(var3 + 0), (double)(var4 + 1) - 1.0D / 64.0D, (double)var10.getMinU(), (double)var10.getMaxV()); -- var5.addVertexWithUV((double)(var2 + 0), (double)((float)(var3 + 1) + 7.0F / 320.0F), (double)(var4 + 1) - 1.0D / 64.0D, (double)var10.getMaxU(), (double)var10.getMaxV()); -+ if (!this.blockAccess.isBlockNormalCube(par2, par3 + 1, par4)) { -+ float var34 = 0.021875F; -+ -+ if (this.blockAccess.isBlockNormalCube(par2 - 1, par3, par4) && this.blockAccess.getBlockId(par2 - 1, par3 + 1, par4) == Block.redstoneWire.blockID) { -+ var5.setColorOpaque_F(var11 * var13, var11 * var14, var11 * var15); -+ var5.addVertexWithUV((double)par2 + 0.015625D, (double)((float)(par3 + 1) + 0.021875F), (double)(par4 + 1), (double)var8.getMaxU(), (double)var8.getMinV()); -+ var5.addVertexWithUV((double)par2 + 0.015625D, (double)(par3 + 0), (double)(par4 + 1), (double)var8.getMinU(), (double)var8.getMinV()); -+ var5.addVertexWithUV((double)par2 + 0.015625D, (double)(par3 + 0), (double)(par4 + 0), (double)var8.getMinU(), (double)var8.getMaxV()); -+ var5.addVertexWithUV((double)par2 + 0.015625D, (double)((float)(par3 + 1) + 0.021875F), (double)(par4 + 0), (double)var8.getMaxU(), (double)var8.getMaxV()); -+ var5.setColorOpaque_F(var11, var11, var11); -+ var5.addVertexWithUV((double)par2 + 0.015625D, (double)((float)(par3 + 1) + 0.021875F), (double)(par4 + 1), (double)var10.getMaxU(), (double)var10.getMinV()); -+ var5.addVertexWithUV((double)par2 + 0.015625D, (double)(par3 + 0), (double)(par4 + 1), (double)var10.getMinU(), (double)var10.getMinV()); -+ var5.addVertexWithUV((double)par2 + 0.015625D, (double)(par3 + 0), (double)(par4 + 0), (double)var10.getMinU(), (double)var10.getMaxV()); -+ var5.addVertexWithUV((double)par2 + 0.015625D, (double)((float)(par3 + 1) + 0.021875F), (double)(par4 + 0), (double)var10.getMaxU(), (double)var10.getMaxV()); -+ } -+ -+ if (this.blockAccess.isBlockNormalCube(par2 + 1, par3, par4) && this.blockAccess.getBlockId(par2 + 1, par3 + 1, par4) == Block.redstoneWire.blockID) { -+ var5.setColorOpaque_F(var11 * var13, var11 * var14, var11 * var15); -+ var5.addVertexWithUV((double)(par2 + 1) - 0.015625D, (double)(par3 + 0), (double)(par4 + 1), (double)var8.getMinU(), (double)var8.getMaxV()); -+ var5.addVertexWithUV((double)(par2 + 1) - 0.015625D, (double)((float)(par3 + 1) + 0.021875F), (double)(par4 + 1), (double)var8.getMaxU(), (double)var8.getMaxV()); -+ var5.addVertexWithUV((double)(par2 + 1) - 0.015625D, (double)((float)(par3 + 1) + 0.021875F), (double)(par4 + 0), (double)var8.getMaxU(), (double)var8.getMinV()); -+ var5.addVertexWithUV((double)(par2 + 1) - 0.015625D, (double)(par3 + 0), (double)(par4 + 0), (double)var8.getMinU(), (double)var8.getMinV()); -+ var5.setColorOpaque_F(var11, var11, var11); -+ var5.addVertexWithUV((double)(par2 + 1) - 0.015625D, (double)(par3 + 0), (double)(par4 + 1), (double)var10.getMinU(), (double)var10.getMaxV()); -+ var5.addVertexWithUV((double)(par2 + 1) - 0.015625D, (double)((float)(par3 + 1) + 0.021875F), (double)(par4 + 1), (double)var10.getMaxU(), (double)var10.getMaxV()); -+ var5.addVertexWithUV((double)(par2 + 1) - 0.015625D, (double)((float)(par3 + 1) + 0.021875F), (double)(par4 + 0), (double)var10.getMaxU(), (double)var10.getMinV()); -+ var5.addVertexWithUV((double)(par2 + 1) - 0.015625D, (double)(par3 + 0), (double)(par4 + 0), (double)var10.getMinU(), (double)var10.getMinV()); -+ } -+ -+ if (this.blockAccess.isBlockNormalCube(par2, par3, par4 - 1) && this.blockAccess.getBlockId(par2, par3 + 1, par4 - 1) == Block.redstoneWire.blockID) { -+ var5.setColorOpaque_F(var11 * var13, var11 * var14, var11 * var15); -+ var5.addVertexWithUV((double)(par2 + 1), (double)(par3 + 0), (double)par4 + 0.015625D, (double)var8.getMinU(), (double)var8.getMaxV()); -+ var5.addVertexWithUV((double)(par2 + 1), (double)((float)(par3 + 1) + 0.021875F), (double)par4 + 0.015625D, (double)var8.getMaxU(), (double)var8.getMaxV()); -+ var5.addVertexWithUV((double)(par2 + 0), (double)((float)(par3 + 1) + 0.021875F), (double)par4 + 0.015625D, (double)var8.getMaxU(), (double)var8.getMinV()); -+ var5.addVertexWithUV((double)(par2 + 0), (double)(par3 + 0), (double)par4 + 0.015625D, (double)var8.getMinU(), (double)var8.getMinV()); -+ var5.setColorOpaque_F(var11, var11, var11); -+ var5.addVertexWithUV((double)(par2 + 1), (double)(par3 + 0), (double)par4 + 0.015625D, (double)var10.getMinU(), (double)var10.getMaxV()); -+ var5.addVertexWithUV((double)(par2 + 1), (double)((float)(par3 + 1) + 0.021875F), (double)par4 + 0.015625D, (double)var10.getMaxU(), (double)var10.getMaxV()); -+ var5.addVertexWithUV((double)(par2 + 0), (double)((float)(par3 + 1) + 0.021875F), (double)par4 + 0.015625D, (double)var10.getMaxU(), (double)var10.getMinV()); -+ var5.addVertexWithUV((double)(par2 + 0), (double)(par3 + 0), (double)par4 + 0.015625D, (double)var10.getMinU(), (double)var10.getMinV()); -+ } -+ -+ if (this.blockAccess.isBlockNormalCube(par2, par3, par4 + 1) && this.blockAccess.getBlockId(par2, par3 + 1, par4 + 1) == Block.redstoneWire.blockID) { -+ var5.setColorOpaque_F(var11 * var13, var11 * var14, var11 * var15); -+ var5.addVertexWithUV((double)(par2 + 1), (double)((float)(par3 + 1) + 0.021875F), (double)(par4 + 1) - 0.015625D, (double)var8.getMaxU(), (double)var8.getMinV()); -+ var5.addVertexWithUV((double)(par2 + 1), (double)(par3 + 0), (double)(par4 + 1) - 0.015625D, (double)var8.getMinU(), (double)var8.getMinV()); -+ var5.addVertexWithUV((double)(par2 + 0), (double)(par3 + 0), (double)(par4 + 1) - 0.015625D, (double)var8.getMinU(), (double)var8.getMaxV()); -+ var5.addVertexWithUV((double)(par2 + 0), (double)((float)(par3 + 1) + 0.021875F), (double)(par4 + 1) - 0.015625D, (double)var8.getMaxU(), (double)var8.getMaxV()); -+ var5.setColorOpaque_F(var11, var11, var11); -+ var5.addVertexWithUV((double)(par2 + 1), (double)((float)(par3 + 1) + 0.021875F), (double)(par4 + 1) - 0.015625D, (double)var10.getMaxU(), (double)var10.getMinV()); -+ var5.addVertexWithUV((double)(par2 + 1), (double)(par3 + 0), (double)(par4 + 1) - 0.015625D, (double)var10.getMinU(), (double)var10.getMinV()); -+ var5.addVertexWithUV((double)(par2 + 0), (double)(par3 + 0), (double)(par4 + 1) - 0.015625D, (double)var10.getMinU(), (double)var10.getMaxV()); -+ var5.addVertexWithUV((double)(par2 + 0), (double)((float)(par3 + 1) + 0.021875F), (double)(par4 + 1) - 0.015625D, (double)var10.getMaxU(), (double)var10.getMaxV()); - } - } - - return true; - } - -- public boolean renderBlockMinecartTrack(BlockRailBase var1, int var2, int var3, int var4) { -+ /** -+ * Renders a minecart track block at the given coordinates -+ */ -+ public boolean renderBlockMinecartTrack(BlockRailBase par1BlockRailBase, int par2, int par3, int par4) { - Tessellator var5 = Tessellator.instance; -- int var6 = this.blockAccess.getBlockMetadata(var2, var3, var4); -- Icon var7 = this.getBlockIconFromSideAndMetadata(var1, 0, var6); -- if(this.hasOverrideBlockTexture()) { -+ int var6 = this.blockAccess.getBlockMetadata(par2, par3, par4); -+ Icon var7 = this.getBlockIconFromSideAndMetadata(par1BlockRailBase, 0, var6); -+ -+ if (this.hasOverrideBlockTexture()) { - var7 = this.overrideBlockTexture; - } - -- if(var1.isPowered()) { -+ if (par1BlockRailBase.isPowered()) { - var6 &= 7; - } - -- var5.setBrightness(var1.getMixedBrightnessForBlock(this.blockAccess, var2, var3, var4)); -+ var5.setBrightness(par1BlockRailBase.getMixedBrightnessForBlock(this.blockAccess, par2, par3, par4)); - var5.setColorOpaque_F(1.0F, 1.0F, 1.0F); -- double var8 = (double)var7.getMinU(); -- double var10 = (double)var7.getMinV(); -- double var12 = (double)var7.getMaxU(); -- double var14 = (double)var7.getMaxV(); -- double var16 = 1.0D / 16.0D; -- double var18 = (double)(var2 + 1); -- double var20 = (double)(var2 + 1); -- double var22 = (double)(var2 + 0); -- double var24 = (double)(var2 + 0); -- double var26 = (double)(var4 + 0); -- double var28 = (double)(var4 + 1); -- double var30 = (double)(var4 + 1); -- double var32 = (double)(var4 + 0); -- double var34 = (double)var3 + var16; -- double var36 = (double)var3 + var16; -- double var38 = (double)var3 + var16; -- double var40 = (double)var3 + var16; -- if(var6 != 1 && var6 != 2 && var6 != 3 && var6 != 7) { -- if(var6 == 8) { -- var20 = (double)(var2 + 0); -- var18 = var20; -- var24 = (double)(var2 + 1); -- var22 = var24; -- var32 = (double)(var4 + 1); -- var26 = var32; -- var30 = (double)(var4 + 0); -- var28 = var30; -- } else if(var6 == 9) { -- var24 = (double)(var2 + 0); -- var18 = var24; -- var22 = (double)(var2 + 1); -- var20 = var22; -- var28 = (double)(var4 + 0); -- var26 = var28; -- var32 = (double)(var4 + 1); -- var30 = var32; -- } -- } else { -- var24 = (double)(var2 + 1); -- var18 = var24; -- var22 = (double)(var2 + 0); -- var20 = var22; -- var28 = (double)(var4 + 1); -- var26 = var28; -- var32 = (double)(var4 + 0); -- var30 = var32; -- } -- -- if(var6 != 2 && var6 != 4) { -- if(var6 == 3 || var6 == 5) { -- ++var36; -- ++var38; -- } -- } else { -- ++var34; -- ++var40; -- } -- -- var5.addVertexWithUV(var18, var34, var26, var12, var10); -- var5.addVertexWithUV(var20, var36, var28, var12, var14); -- var5.addVertexWithUV(var22, var38, var30, var8, var14); -- var5.addVertexWithUV(var24, var40, var32, var8, var10); -- var5.addVertexWithUV(var24, var40, var32, var8, var10); -- var5.addVertexWithUV(var22, var38, var30, var8, var14); -- var5.addVertexWithUV(var20, var36, var28, var12, var14); -- var5.addVertexWithUV(var18, var34, var26, var12, var10); -- return true; -+ var7 = CTMUtils.getTile(this, par1BlockRailBase, par2, par3, par4, var7, var5); -+ -+ if (var7 == null) { -+ return false; -+ } else { -+ var5 = TessellatorUtils.getTessellator(var5, var7); -+ double var8 = (double)var7.getMinU(); -+ double var10 = (double)var7.getMinV(); -+ double var12 = (double)var7.getMaxU(); -+ double var14 = (double)var7.getMaxV(); -+ double var16 = 0.0625D; -+ double var18 = (double)(par2 + 1); -+ double var20 = (double)(par2 + 1); -+ double var22 = (double)(par2 + 0); -+ double var24 = (double)(par2 + 0); -+ double var26 = (double)(par4 + 0); -+ double var28 = (double)(par4 + 1); -+ double var30 = (double)(par4 + 1); -+ double var32 = (double)(par4 + 0); -+ double var34 = (double)par3 + var16; -+ double var36 = (double)par3 + var16; -+ double var38 = (double)par3 + var16; -+ double var40 = (double)par3 + var16; -+ -+ if (var6 != 1 && var6 != 2 && var6 != 3 && var6 != 7) { -+ if (var6 == 8) { -+ var18 = var20 = (double)(par2 + 0); -+ var22 = var24 = (double)(par2 + 1); -+ var26 = var32 = (double)(par4 + 1); -+ var28 = var30 = (double)(par4 + 0); -+ } else if (var6 == 9) { -+ var18 = var24 = (double)(par2 + 0); -+ var20 = var22 = (double)(par2 + 1); -+ var26 = var28 = (double)(par4 + 0); -+ var30 = var32 = (double)(par4 + 1); -+ } -+ } else { -+ var18 = var24 = (double)(par2 + 1); -+ var20 = var22 = (double)(par2 + 0); -+ var26 = var28 = (double)(par4 + 1); -+ var30 = var32 = (double)(par4 + 0); -+ } -+ -+ if (var6 != 2 && var6 != 4) { -+ if (var6 == 3 || var6 == 5) { -+ ++var36; -+ ++var38; -+ } -+ } else { -+ ++var34; -+ ++var40; -+ } -+ -+ var5.addVertexWithUV(var18, var34, var26, var12, var10); -+ var5.addVertexWithUV(var20, var36, var28, var12, var14); -+ var5.addVertexWithUV(var22, var38, var30, var8, var14); -+ var5.addVertexWithUV(var24, var40, var32, var8, var10); -+ var5.addVertexWithUV(var24, var40, var32, var8, var10); -+ var5.addVertexWithUV(var22, var38, var30, var8, var14); -+ var5.addVertexWithUV(var20, var36, var28, var12, var14); -+ var5.addVertexWithUV(var18, var34, var26, var12, var10); -+ return true; -+ } - } - -- public boolean renderBlockLadder(Block var1, int var2, int var3, int var4) { -+ /** -+ * Renders a ladder block at the given coordinates -+ */ -+ public boolean renderBlockLadder(Block par1Block, int par2, int par3, int par4) { - Tessellator var5 = Tessellator.instance; -- Icon var6 = this.getBlockIconFromSide(var1, 0); -- if(this.hasOverrideBlockTexture()) { -+ Icon var6 = this.getBlockIconFromSide(par1Block, 0); -+ -+ if (this.hasOverrideBlockTexture()) { - var6 = this.overrideBlockTexture; - } - -- var5.setBrightness(var1.getMixedBrightnessForBlock(this.blockAccess, var2, var3, var4)); -+ var5.setBrightness(par1Block.getMixedBrightnessForBlock(this.blockAccess, par2, par3, par4)); - float var7 = 1.0F; - var5.setColorOpaque_F(var7, var7, var7); -- double var20 = (double)var6.getMinU(); -- double var9 = (double)var6.getMinV(); -- double var11 = (double)var6.getMaxU(); -- double var13 = (double)var6.getMaxV(); -- int var15 = this.blockAccess.getBlockMetadata(var2, var3, var4); -- double var16 = 0.0D; -- double var18 = (double)0.05F; -- if(var15 == 5) { -- var5.addVertexWithUV((double)var2 + var18, (double)(var3 + 1) + var16, (double)(var4 + 1) + var16, var20, var9); -- var5.addVertexWithUV((double)var2 + var18, (double)(var3 + 0) - var16, (double)(var4 + 1) + var16, var20, var13); -- var5.addVertexWithUV((double)var2 + var18, (double)(var3 + 0) - var16, (double)(var4 + 0) - var16, var11, var13); -- var5.addVertexWithUV((double)var2 + var18, (double)(var3 + 1) + var16, (double)(var4 + 0) - var16, var11, var9); -- } -- -- if(var15 == 4) { -- var5.addVertexWithUV((double)(var2 + 1) - var18, (double)(var3 + 0) - var16, (double)(var4 + 1) + var16, var11, var13); -- var5.addVertexWithUV((double)(var2 + 1) - var18, (double)(var3 + 1) + var16, (double)(var4 + 1) + var16, var11, var9); -- var5.addVertexWithUV((double)(var2 + 1) - var18, (double)(var3 + 1) + var16, (double)(var4 + 0) - var16, var20, var9); -- var5.addVertexWithUV((double)(var2 + 1) - var18, (double)(var3 + 0) - var16, (double)(var4 + 0) - var16, var20, var13); -- } -- -- if(var15 == 3) { -- var5.addVertexWithUV((double)(var2 + 1) + var16, (double)(var3 + 0) - var16, (double)var4 + var18, var11, var13); -- var5.addVertexWithUV((double)(var2 + 1) + var16, (double)(var3 + 1) + var16, (double)var4 + var18, var11, var9); -- var5.addVertexWithUV((double)(var2 + 0) - var16, (double)(var3 + 1) + var16, (double)var4 + var18, var20, var9); -- var5.addVertexWithUV((double)(var2 + 0) - var16, (double)(var3 + 0) - var16, (double)var4 + var18, var20, var13); -- } -- -- if(var15 == 2) { -- var5.addVertexWithUV((double)(var2 + 1) + var16, (double)(var3 + 1) + var16, (double)(var4 + 1) - var18, var20, var9); -- var5.addVertexWithUV((double)(var2 + 1) + var16, (double)(var3 + 0) - var16, (double)(var4 + 1) - var18, var20, var13); -- var5.addVertexWithUV((double)(var2 + 0) - var16, (double)(var3 + 0) - var16, (double)(var4 + 1) - var18, var11, var13); -- var5.addVertexWithUV((double)(var2 + 0) - var16, (double)(var3 + 1) + var16, (double)(var4 + 1) - var18, var11, var9); -- } -- -- return true; -+ var6 = CTMUtils.getTile(this, par1Block, par2, par3, par4, var6, var5); -+ -+ if (var6 == null) { -+ return false; -+ } else { -+ var5 = TessellatorUtils.getTessellator(var5, var6); -+ double var20 = (double)var6.getMinU(); -+ double var9 = (double)var6.getMinV(); -+ double var11 = (double)var6.getMaxU(); -+ double var13 = (double)var6.getMaxV(); -+ int var15 = this.blockAccess.getBlockMetadata(par2, par3, par4); -+ double var16 = 0.0D; -+ double var18 = 0.05000000074505806D; -+ -+ if (var15 == 5) { -+ var5.addVertexWithUV((double)par2 + var18, (double)(par3 + 1) + var16, (double)(par4 + 1) + var16, var20, var9); -+ var5.addVertexWithUV((double)par2 + var18, (double)(par3 + 0) - var16, (double)(par4 + 1) + var16, var20, var13); -+ var5.addVertexWithUV((double)par2 + var18, (double)(par3 + 0) - var16, (double)(par4 + 0) - var16, var11, var13); -+ var5.addVertexWithUV((double)par2 + var18, (double)(par3 + 1) + var16, (double)(par4 + 0) - var16, var11, var9); -+ } -+ -+ if (var15 == 4) { -+ var5.addVertexWithUV((double)(par2 + 1) - var18, (double)(par3 + 0) - var16, (double)(par4 + 1) + var16, var11, var13); -+ var5.addVertexWithUV((double)(par2 + 1) - var18, (double)(par3 + 1) + var16, (double)(par4 + 1) + var16, var11, var9); -+ var5.addVertexWithUV((double)(par2 + 1) - var18, (double)(par3 + 1) + var16, (double)(par4 + 0) - var16, var20, var9); -+ var5.addVertexWithUV((double)(par2 + 1) - var18, (double)(par3 + 0) - var16, (double)(par4 + 0) - var16, var20, var13); -+ } -+ -+ if (var15 == 3) { -+ var5.addVertexWithUV((double)(par2 + 1) + var16, (double)(par3 + 0) - var16, (double)par4 + var18, var11, var13); -+ var5.addVertexWithUV((double)(par2 + 1) + var16, (double)(par3 + 1) + var16, (double)par4 + var18, var11, var9); -+ var5.addVertexWithUV((double)(par2 + 0) - var16, (double)(par3 + 1) + var16, (double)par4 + var18, var20, var9); -+ var5.addVertexWithUV((double)(par2 + 0) - var16, (double)(par3 + 0) - var16, (double)par4 + var18, var20, var13); -+ } -+ -+ if (var15 == 2) { -+ var5.addVertexWithUV((double)(par2 + 1) + var16, (double)(par3 + 1) + var16, (double)(par4 + 1) - var18, var20, var9); -+ var5.addVertexWithUV((double)(par2 + 1) + var16, (double)(par3 + 0) - var16, (double)(par4 + 1) - var18, var20, var13); -+ var5.addVertexWithUV((double)(par2 + 0) - var16, (double)(par3 + 0) - var16, (double)(par4 + 1) - var18, var11, var13); -+ var5.addVertexWithUV((double)(par2 + 0) - var16, (double)(par3 + 1) + var16, (double)(par4 + 1) - var18, var11, var9); -+ } -+ -+ return true; -+ } - } - -- public boolean renderBlockVine(Block var1, int var2, int var3, int var4) { -+ /** -+ * Render block vine -+ */ -+ public boolean renderBlockVine(Block par1Block, int par2, int par3, int par4) { - Tessellator var5 = Tessellator.instance; -- Icon var6 = this.getBlockIconFromSide(var1, 0); -- if(this.hasOverrideBlockTexture()) { -+ Icon var6 = this.getBlockIconFromSide(par1Block, 0); -+ -+ if (this.hasOverrideBlockTexture()) { - var6 = this.overrideBlockTexture; - } - - float var7 = 1.0F; -- var5.setBrightness(var1.getMixedBrightnessForBlock(this.blockAccess, var2, var3, var4)); -- int var8 = var1.colorMultiplier(this.blockAccess, var2, var3, var4); -+ var5.setBrightness(par1Block.getMixedBrightnessForBlock(this.blockAccess, par2, par3, par4)); -+ int var8 = par1Block.colorMultiplier(this.blockAccess, par2, par3, par4); - float var9 = (float)(var8 >> 16 & 255) / 255.0F; - float var10 = (float)(var8 >> 8 & 255) / 255.0F; - float var11 = (float)(var8 & 255) / 255.0F; - var5.setColorOpaque_F(var7 * var9, var7 * var10, var7 * var11); -- double var19 = (double)var6.getMinU(); -- double var20 = (double)var6.getMinV(); -- double var12 = (double)var6.getMaxU(); -- double var14 = (double)var6.getMaxV(); -- double var16 = (double)0.05F; -- int var18 = this.blockAccess.getBlockMetadata(var2, var3, var4); -- if((var18 & 2) != 0) { -- var5.addVertexWithUV((double)var2 + var16, (double)(var3 + 1), (double)(var4 + 1), var19, var20); -- var5.addVertexWithUV((double)var2 + var16, (double)(var3 + 0), (double)(var4 + 1), var19, var14); -- var5.addVertexWithUV((double)var2 + var16, (double)(var3 + 0), (double)(var4 + 0), var12, var14); -- var5.addVertexWithUV((double)var2 + var16, (double)(var3 + 1), (double)(var4 + 0), var12, var20); -- var5.addVertexWithUV((double)var2 + var16, (double)(var3 + 1), (double)(var4 + 0), var12, var20); -- var5.addVertexWithUV((double)var2 + var16, (double)(var3 + 0), (double)(var4 + 0), var12, var14); -- var5.addVertexWithUV((double)var2 + var16, (double)(var3 + 0), (double)(var4 + 1), var19, var14); -- var5.addVertexWithUV((double)var2 + var16, (double)(var3 + 1), (double)(var4 + 1), var19, var20); -- } -- -- if((var18 & 8) != 0) { -- var5.addVertexWithUV((double)(var2 + 1) - var16, (double)(var3 + 0), (double)(var4 + 1), var12, var14); -- var5.addVertexWithUV((double)(var2 + 1) - var16, (double)(var3 + 1), (double)(var4 + 1), var12, var20); -- var5.addVertexWithUV((double)(var2 + 1) - var16, (double)(var3 + 1), (double)(var4 + 0), var19, var20); -- var5.addVertexWithUV((double)(var2 + 1) - var16, (double)(var3 + 0), (double)(var4 + 0), var19, var14); -- var5.addVertexWithUV((double)(var2 + 1) - var16, (double)(var3 + 0), (double)(var4 + 0), var19, var14); -- var5.addVertexWithUV((double)(var2 + 1) - var16, (double)(var3 + 1), (double)(var4 + 0), var19, var20); -- var5.addVertexWithUV((double)(var2 + 1) - var16, (double)(var3 + 1), (double)(var4 + 1), var12, var20); -- var5.addVertexWithUV((double)(var2 + 1) - var16, (double)(var3 + 0), (double)(var4 + 1), var12, var14); -- } -- -- if((var18 & 4) != 0) { -- var5.addVertexWithUV((double)(var2 + 1), (double)(var3 + 0), (double)var4 + var16, var12, var14); -- var5.addVertexWithUV((double)(var2 + 1), (double)(var3 + 1), (double)var4 + var16, var12, var20); -- var5.addVertexWithUV((double)(var2 + 0), (double)(var3 + 1), (double)var4 + var16, var19, var20); -- var5.addVertexWithUV((double)(var2 + 0), (double)(var3 + 0), (double)var4 + var16, var19, var14); -- var5.addVertexWithUV((double)(var2 + 0), (double)(var3 + 0), (double)var4 + var16, var19, var14); -- var5.addVertexWithUV((double)(var2 + 0), (double)(var3 + 1), (double)var4 + var16, var19, var20); -- var5.addVertexWithUV((double)(var2 + 1), (double)(var3 + 1), (double)var4 + var16, var12, var20); -- var5.addVertexWithUV((double)(var2 + 1), (double)(var3 + 0), (double)var4 + var16, var12, var14); -- } -- -- if((var18 & 1) != 0) { -- var5.addVertexWithUV((double)(var2 + 1), (double)(var3 + 1), (double)(var4 + 1) - var16, var19, var20); -- var5.addVertexWithUV((double)(var2 + 1), (double)(var3 + 0), (double)(var4 + 1) - var16, var19, var14); -- var5.addVertexWithUV((double)(var2 + 0), (double)(var3 + 0), (double)(var4 + 1) - var16, var12, var14); -- var5.addVertexWithUV((double)(var2 + 0), (double)(var3 + 1), (double)(var4 + 1) - var16, var12, var20); -- var5.addVertexWithUV((double)(var2 + 0), (double)(var3 + 1), (double)(var4 + 1) - var16, var12, var20); -- var5.addVertexWithUV((double)(var2 + 0), (double)(var3 + 0), (double)(var4 + 1) - var16, var12, var14); -- var5.addVertexWithUV((double)(var2 + 1), (double)(var3 + 0), (double)(var4 + 1) - var16, var19, var14); -- var5.addVertexWithUV((double)(var2 + 1), (double)(var3 + 1), (double)(var4 + 1) - var16, var19, var20); -- } -- -- if(this.blockAccess.isBlockNormalCube(var2, var3 + 1, var4)) { -- var5.addVertexWithUV((double)(var2 + 1), (double)(var3 + 1) - var16, (double)(var4 + 0), var19, var20); -- var5.addVertexWithUV((double)(var2 + 1), (double)(var3 + 1) - var16, (double)(var4 + 1), var19, var14); -- var5.addVertexWithUV((double)(var2 + 0), (double)(var3 + 1) - var16, (double)(var4 + 1), var12, var14); -- var5.addVertexWithUV((double)(var2 + 0), (double)(var3 + 1) - var16, (double)(var4 + 0), var12, var20); -- } -- -- return true; -+ var6 = CTMUtils.getTile(this, par1Block, par2, par3, par4, var6, var5); -+ -+ if (var6 == null) { -+ return false; -+ } else { -+ var5 = TessellatorUtils.getTessellator(var5, var6); -+ double var19 = (double)var6.getMinU(); -+ double var20 = (double)var6.getMinV(); -+ double var12 = (double)var6.getMaxU(); -+ double var14 = (double)var6.getMaxV(); -+ double var16 = 0.05000000074505806D; -+ int var18 = this.blockAccess.getBlockMetadata(par2, par3, par4); -+ -+ if ((var18 & 2) != 0) { -+ var5.addVertexWithUV((double)par2 + var16, (double)(par3 + 1), (double)(par4 + 1), var19, var20); -+ var5.addVertexWithUV((double)par2 + var16, (double)(par3 + 0), (double)(par4 + 1), var19, var14); -+ var5.addVertexWithUV((double)par2 + var16, (double)(par3 + 0), (double)(par4 + 0), var12, var14); -+ var5.addVertexWithUV((double)par2 + var16, (double)(par3 + 1), (double)(par4 + 0), var12, var20); -+ var5.addVertexWithUV((double)par2 + var16, (double)(par3 + 1), (double)(par4 + 0), var12, var20); -+ var5.addVertexWithUV((double)par2 + var16, (double)(par3 + 0), (double)(par4 + 0), var12, var14); -+ var5.addVertexWithUV((double)par2 + var16, (double)(par3 + 0), (double)(par4 + 1), var19, var14); -+ var5.addVertexWithUV((double)par2 + var16, (double)(par3 + 1), (double)(par4 + 1), var19, var20); -+ } -+ -+ if ((var18 & 8) != 0) { -+ var5.addVertexWithUV((double)(par2 + 1) - var16, (double)(par3 + 0), (double)(par4 + 1), var12, var14); -+ var5.addVertexWithUV((double)(par2 + 1) - var16, (double)(par3 + 1), (double)(par4 + 1), var12, var20); -+ var5.addVertexWithUV((double)(par2 + 1) - var16, (double)(par3 + 1), (double)(par4 + 0), var19, var20); -+ var5.addVertexWithUV((double)(par2 + 1) - var16, (double)(par3 + 0), (double)(par4 + 0), var19, var14); -+ var5.addVertexWithUV((double)(par2 + 1) - var16, (double)(par3 + 0), (double)(par4 + 0), var19, var14); -+ var5.addVertexWithUV((double)(par2 + 1) - var16, (double)(par3 + 1), (double)(par4 + 0), var19, var20); -+ var5.addVertexWithUV((double)(par2 + 1) - var16, (double)(par3 + 1), (double)(par4 + 1), var12, var20); -+ var5.addVertexWithUV((double)(par2 + 1) - var16, (double)(par3 + 0), (double)(par4 + 1), var12, var14); -+ } -+ -+ if ((var18 & 4) != 0) { -+ var5.addVertexWithUV((double)(par2 + 1), (double)(par3 + 0), (double)par4 + var16, var12, var14); -+ var5.addVertexWithUV((double)(par2 + 1), (double)(par3 + 1), (double)par4 + var16, var12, var20); -+ var5.addVertexWithUV((double)(par2 + 0), (double)(par3 + 1), (double)par4 + var16, var19, var20); -+ var5.addVertexWithUV((double)(par2 + 0), (double)(par3 + 0), (double)par4 + var16, var19, var14); -+ var5.addVertexWithUV((double)(par2 + 0), (double)(par3 + 0), (double)par4 + var16, var19, var14); -+ var5.addVertexWithUV((double)(par2 + 0), (double)(par3 + 1), (double)par4 + var16, var19, var20); -+ var5.addVertexWithUV((double)(par2 + 1), (double)(par3 + 1), (double)par4 + var16, var12, var20); -+ var5.addVertexWithUV((double)(par2 + 1), (double)(par3 + 0), (double)par4 + var16, var12, var14); -+ } -+ -+ if ((var18 & 1) != 0) { -+ var5.addVertexWithUV((double)(par2 + 1), (double)(par3 + 1), (double)(par4 + 1) - var16, var19, var20); -+ var5.addVertexWithUV((double)(par2 + 1), (double)(par3 + 0), (double)(par4 + 1) - var16, var19, var14); -+ var5.addVertexWithUV((double)(par2 + 0), (double)(par3 + 0), (double)(par4 + 1) - var16, var12, var14); -+ var5.addVertexWithUV((double)(par2 + 0), (double)(par3 + 1), (double)(par4 + 1) - var16, var12, var20); -+ var5.addVertexWithUV((double)(par2 + 0), (double)(par3 + 1), (double)(par4 + 1) - var16, var12, var20); -+ var5.addVertexWithUV((double)(par2 + 0), (double)(par3 + 0), (double)(par4 + 1) - var16, var12, var14); -+ var5.addVertexWithUV((double)(par2 + 1), (double)(par3 + 0), (double)(par4 + 1) - var16, var19, var14); -+ var5.addVertexWithUV((double)(par2 + 1), (double)(par3 + 1), (double)(par4 + 1) - var16, var19, var20); -+ } -+ -+ if (this.blockAccess.isBlockNormalCube(par2, par3 + 1, par4)) { -+ var5.addVertexWithUV((double)(par2 + 1), (double)(par3 + 1) - var16, (double)(par4 + 0), var19, var20); -+ var5.addVertexWithUV((double)(par2 + 1), (double)(par3 + 1) - var16, (double)(par4 + 1), var19, var14); -+ var5.addVertexWithUV((double)(par2 + 0), (double)(par3 + 1) - var16, (double)(par4 + 1), var12, var14); -+ var5.addVertexWithUV((double)(par2 + 0), (double)(par3 + 1) - var16, (double)(par4 + 0), var12, var20); -+ } -+ -+ return true; -+ } - } - -- public boolean renderBlockPane(BlockPane var1, int var2, int var3, int var4) { -+ public boolean renderBlockPane(BlockPane par1BlockPane, int par2, int par3, int par4) { - int var5 = this.blockAccess.getHeight(); - Tessellator var6 = Tessellator.instance; -- var6.setBrightness(var1.getMixedBrightnessForBlock(this.blockAccess, var2, var3, var4)); -+ var6.setBrightness(par1BlockPane.getMixedBrightnessForBlock(this.blockAccess, par2, par3, par4)); - float var7 = 1.0F; -- int var8 = var1.colorMultiplier(this.blockAccess, var2, var3, var4); -+ int var8 = par1BlockPane.colorMultiplier(this.blockAccess, par2, par3, par4); - float var9 = (float)(var8 >> 16 & 255) / 255.0F; - float var10 = (float)(var8 >> 8 & 255) / 255.0F; - float var11 = (float)(var8 & 255) / 255.0F; -- if(EntityRenderer.anaglyphEnable) { -+ -+ if (EntityRenderer.anaglyphEnable) { - float var12 = (var9 * 30.0F + var10 * 59.0F + var11 * 11.0F) / 100.0F; - float var13 = (var9 * 30.0F + var10 * 70.0F) / 100.0F; - float var14 = (var9 * 30.0F + var11 * 70.0F) / 100.0F; -@@ -2292,13 +2804,14 @@ - var6.setColorOpaque_F(var7 * var9, var7 * var10, var7 * var11); - Icon var64; - Icon var65; -- if(this.hasOverrideBlockTexture()) { -+ -+ if (this.hasOverrideBlockTexture()) { - var64 = this.overrideBlockTexture; - var65 = this.overrideBlockTexture; - } else { -- int var66 = this.blockAccess.getBlockMetadata(var2, var3, var4); -- var64 = this.getBlockIconFromSideAndMetadata(var1, 0, var66); -- var65 = var1.getSideTextureIndex(); -+ int var66 = this.blockAccess.getBlockMetadata(par2, par3, par4); -+ var64 = this.getBlockIconFromSideAndMetadata(par1BlockPane, 0, var66); -+ var65 = par1BlockPane.getSideTextureIndex(); - } - - double var67 = (double)var64.getMinU(); -@@ -2311,356 +2824,379 @@ - double var28 = (double)var65.getMinV(); - double var30 = (double)var65.getInterpolatedV(8.0D); - double var32 = (double)var65.getMaxV(); -- double var34 = (double)var2; -- double var36 = (double)var2 + 0.5D; -- double var38 = (double)(var2 + 1); -- double var40 = (double)var4; -- double var42 = (double)var4 + 0.5D; -- double var44 = (double)(var4 + 1); -- double var46 = (double)var2 + 0.5D - 1.0D / 16.0D; -- double var48 = (double)var2 + 0.5D + 1.0D / 16.0D; -- double var50 = (double)var4 + 0.5D - 1.0D / 16.0D; -- double var52 = (double)var4 + 0.5D + 1.0D / 16.0D; -- boolean var54 = var1.canThisPaneConnectToThisBlockID(this.blockAccess.getBlockId(var2, var3, var4 - 1)); -- boolean var55 = var1.canThisPaneConnectToThisBlockID(this.blockAccess.getBlockId(var2, var3, var4 + 1)); -- boolean var56 = var1.canThisPaneConnectToThisBlockID(this.blockAccess.getBlockId(var2 - 1, var3, var4)); -- boolean var57 = var1.canThisPaneConnectToThisBlockID(this.blockAccess.getBlockId(var2 + 1, var3, var4)); -- boolean var58 = var1.shouldSideBeRendered(this.blockAccess, var2, var3 + 1, var4, 1); -- boolean var59 = var1.shouldSideBeRendered(this.blockAccess, var2, var3 - 1, var4, 0); -+ double var34 = (double)par2; -+ double var36 = (double)par2 + 0.5D; -+ double var38 = (double)(par2 + 1); -+ double var40 = (double)par4; -+ double var42 = (double)par4 + 0.5D; -+ double var44 = (double)(par4 + 1); -+ double var46 = (double)par2 + 0.5D - 0.0625D; -+ double var48 = (double)par2 + 0.5D + 0.0625D; -+ double var50 = (double)par4 + 0.5D - 0.0625D; -+ double var52 = (double)par4 + 0.5D + 0.0625D; -+ boolean var54 = par1BlockPane.canThisPaneConnectToThisBlockID(this.blockAccess.getBlockId(par2, par3, par4 - 1)); -+ boolean var55 = par1BlockPane.canThisPaneConnectToThisBlockID(this.blockAccess.getBlockId(par2, par3, par4 + 1)); -+ boolean var56 = par1BlockPane.canThisPaneConnectToThisBlockID(this.blockAccess.getBlockId(par2 - 1, par3, par4)); -+ boolean var57 = par1BlockPane.canThisPaneConnectToThisBlockID(this.blockAccess.getBlockId(par2 + 1, par3, par4)); -+ GlassPaneRenderer.render(this, par1BlockPane, var64, par2, par3, par4, var54, var55, var56, var57); -+ boolean var58 = par1BlockPane.shouldSideBeRendered(this.blockAccess, par2, par3 + 1, par4, 1); -+ boolean var59 = par1BlockPane.shouldSideBeRendered(this.blockAccess, par2, par3 - 1, par4, 0); - double var60 = 0.01D; - double var62 = 0.005D; -- if((!var56 || !var57) && (var56 || var57 || var54 || var55)) { -- if(var56 && !var57) { -- var6.addVertexWithUV(var34, (double)(var3 + 1), var42, var67, var20); -- var6.addVertexWithUV(var34, (double)(var3 + 0), var42, var67, var22); -- var6.addVertexWithUV(var36, (double)(var3 + 0), var42, var16, var22); -- var6.addVertexWithUV(var36, (double)(var3 + 1), var42, var16, var20); -- var6.addVertexWithUV(var36, (double)(var3 + 1), var42, var67, var20); -- var6.addVertexWithUV(var36, (double)(var3 + 0), var42, var67, var22); -- var6.addVertexWithUV(var34, (double)(var3 + 0), var42, var16, var22); -- var6.addVertexWithUV(var34, (double)(var3 + 1), var42, var16, var20); -- if(!var55 && !var54) { -- var6.addVertexWithUV(var36, (double)(var3 + 1), var52, var24, var28); -- var6.addVertexWithUV(var36, (double)(var3 + 0), var52, var24, var32); -- var6.addVertexWithUV(var36, (double)(var3 + 0), var50, var26, var32); -- var6.addVertexWithUV(var36, (double)(var3 + 1), var50, var26, var28); -- var6.addVertexWithUV(var36, (double)(var3 + 1), var50, var24, var28); -- var6.addVertexWithUV(var36, (double)(var3 + 0), var50, var24, var32); -- var6.addVertexWithUV(var36, (double)(var3 + 0), var52, var26, var32); -- var6.addVertexWithUV(var36, (double)(var3 + 1), var52, var26, var28); -- } -- -- if(var58 || var3 < var5 - 1 && this.blockAccess.isAirBlock(var2 - 1, var3 + 1, var4)) { -- var6.addVertexWithUV(var34, (double)(var3 + 1) + 0.01D, var52, var26, var30); -- var6.addVertexWithUV(var36, (double)(var3 + 1) + 0.01D, var52, var26, var32); -- var6.addVertexWithUV(var36, (double)(var3 + 1) + 0.01D, var50, var24, var32); -- var6.addVertexWithUV(var34, (double)(var3 + 1) + 0.01D, var50, var24, var30); -- var6.addVertexWithUV(var36, (double)(var3 + 1) + 0.01D, var52, var26, var30); -- var6.addVertexWithUV(var34, (double)(var3 + 1) + 0.01D, var52, var26, var32); -- var6.addVertexWithUV(var34, (double)(var3 + 1) + 0.01D, var50, var24, var32); -- var6.addVertexWithUV(var36, (double)(var3 + 1) + 0.01D, var50, var24, var30); -- } -- -- if(var59 || var3 > 1 && this.blockAccess.isAirBlock(var2 - 1, var3 - 1, var4)) { -- var6.addVertexWithUV(var34, (double)var3 - 0.01D, var52, var26, var30); -- var6.addVertexWithUV(var36, (double)var3 - 0.01D, var52, var26, var32); -- var6.addVertexWithUV(var36, (double)var3 - 0.01D, var50, var24, var32); -- var6.addVertexWithUV(var34, (double)var3 - 0.01D, var50, var24, var30); -- var6.addVertexWithUV(var36, (double)var3 - 0.01D, var52, var26, var30); -- var6.addVertexWithUV(var34, (double)var3 - 0.01D, var52, var26, var32); -- var6.addVertexWithUV(var34, (double)var3 - 0.01D, var50, var24, var32); -- var6.addVertexWithUV(var36, (double)var3 - 0.01D, var50, var24, var30); -- } -- } else if(!var56 && var57) { -- var6.addVertexWithUV(var36, (double)(var3 + 1), var42, var16, var20); -- var6.addVertexWithUV(var36, (double)(var3 + 0), var42, var16, var22); -- var6.addVertexWithUV(var38, (double)(var3 + 0), var42, var18, var22); -- var6.addVertexWithUV(var38, (double)(var3 + 1), var42, var18, var20); -- var6.addVertexWithUV(var38, (double)(var3 + 1), var42, var16, var20); -- var6.addVertexWithUV(var38, (double)(var3 + 0), var42, var16, var22); -- var6.addVertexWithUV(var36, (double)(var3 + 0), var42, var18, var22); -- var6.addVertexWithUV(var36, (double)(var3 + 1), var42, var18, var20); -- if(!var55 && !var54) { -- var6.addVertexWithUV(var36, (double)(var3 + 1), var50, var24, var28); -- var6.addVertexWithUV(var36, (double)(var3 + 0), var50, var24, var32); -- var6.addVertexWithUV(var36, (double)(var3 + 0), var52, var26, var32); -- var6.addVertexWithUV(var36, (double)(var3 + 1), var52, var26, var28); -- var6.addVertexWithUV(var36, (double)(var3 + 1), var52, var24, var28); -- var6.addVertexWithUV(var36, (double)(var3 + 0), var52, var24, var32); -- var6.addVertexWithUV(var36, (double)(var3 + 0), var50, var26, var32); -- var6.addVertexWithUV(var36, (double)(var3 + 1), var50, var26, var28); -- } -- -- if(var58 || var3 < var5 - 1 && this.blockAccess.isAirBlock(var2 + 1, var3 + 1, var4)) { -- var6.addVertexWithUV(var36, (double)(var3 + 1) + 0.01D, var52, var26, var28); -- var6.addVertexWithUV(var38, (double)(var3 + 1) + 0.01D, var52, var26, var30); -- var6.addVertexWithUV(var38, (double)(var3 + 1) + 0.01D, var50, var24, var30); -- var6.addVertexWithUV(var36, (double)(var3 + 1) + 0.01D, var50, var24, var28); -- var6.addVertexWithUV(var38, (double)(var3 + 1) + 0.01D, var52, var26, var28); -- var6.addVertexWithUV(var36, (double)(var3 + 1) + 0.01D, var52, var26, var30); -- var6.addVertexWithUV(var36, (double)(var3 + 1) + 0.01D, var50, var24, var30); -- var6.addVertexWithUV(var38, (double)(var3 + 1) + 0.01D, var50, var24, var28); -- } -- -- if(var59 || var3 > 1 && this.blockAccess.isAirBlock(var2 + 1, var3 - 1, var4)) { -- var6.addVertexWithUV(var36, (double)var3 - 0.01D, var52, var26, var28); -- var6.addVertexWithUV(var38, (double)var3 - 0.01D, var52, var26, var30); -- var6.addVertexWithUV(var38, (double)var3 - 0.01D, var50, var24, var30); -- var6.addVertexWithUV(var36, (double)var3 - 0.01D, var50, var24, var28); -- var6.addVertexWithUV(var38, (double)var3 - 0.01D, var52, var26, var28); -- var6.addVertexWithUV(var36, (double)var3 - 0.01D, var52, var26, var30); -- var6.addVertexWithUV(var36, (double)var3 - 0.01D, var50, var24, var30); -- var6.addVertexWithUV(var38, (double)var3 - 0.01D, var50, var24, var28); -+ -+ if ((!var56 || !var57) && (var56 || var57 || var54 || var55)) { -+ if (var56 && !var57) { -+ if (!GlassPaneRenderer.active) { -+ var6.addVertexWithUV(var34, (double)(par3 + 1), var42, var67, var20); -+ var6.addVertexWithUV(var34, (double)(par3 + 0), var42, var67, var22); -+ var6.addVertexWithUV(var36, (double)(par3 + 0), var42, var16, var22); -+ var6.addVertexWithUV(var36, (double)(par3 + 1), var42, var16, var20); -+ var6.addVertexWithUV(var36, (double)(par3 + 1), var42, var67, var20); -+ var6.addVertexWithUV(var36, (double)(par3 + 0), var42, var67, var22); -+ var6.addVertexWithUV(var34, (double)(par3 + 0), var42, var16, var22); -+ var6.addVertexWithUV(var34, (double)(par3 + 1), var42, var16, var20); -+ } -+ -+ if (!var55 && !var54) { -+ var6.addVertexWithUV(var36, (double)(par3 + 1), var52, var24, var28); -+ var6.addVertexWithUV(var36, (double)(par3 + 0), var52, var24, var32); -+ var6.addVertexWithUV(var36, (double)(par3 + 0), var50, var26, var32); -+ var6.addVertexWithUV(var36, (double)(par3 + 1), var50, var26, var28); -+ var6.addVertexWithUV(var36, (double)(par3 + 1), var50, var24, var28); -+ var6.addVertexWithUV(var36, (double)(par3 + 0), var50, var24, var32); -+ var6.addVertexWithUV(var36, (double)(par3 + 0), var52, var26, var32); -+ var6.addVertexWithUV(var36, (double)(par3 + 1), var52, var26, var28); -+ } -+ -+ if (var58 || par3 < var5 - 1 && this.blockAccess.isAirBlock(par2 - 1, par3 + 1, par4)) { -+ var6.addVertexWithUV(var34, (double)(par3 + 1) + 0.01D, var52, var26, var30); -+ var6.addVertexWithUV(var36, (double)(par3 + 1) + 0.01D, var52, var26, var32); -+ var6.addVertexWithUV(var36, (double)(par3 + 1) + 0.01D, var50, var24, var32); -+ var6.addVertexWithUV(var34, (double)(par3 + 1) + 0.01D, var50, var24, var30); -+ var6.addVertexWithUV(var36, (double)(par3 + 1) + 0.01D, var52, var26, var30); -+ var6.addVertexWithUV(var34, (double)(par3 + 1) + 0.01D, var52, var26, var32); -+ var6.addVertexWithUV(var34, (double)(par3 + 1) + 0.01D, var50, var24, var32); -+ var6.addVertexWithUV(var36, (double)(par3 + 1) + 0.01D, var50, var24, var30); -+ } -+ -+ if (var59 || par3 > 1 && this.blockAccess.isAirBlock(par2 - 1, par3 - 1, par4)) { -+ var6.addVertexWithUV(var34, (double)par3 - 0.01D, var52, var26, var30); -+ var6.addVertexWithUV(var36, (double)par3 - 0.01D, var52, var26, var32); -+ var6.addVertexWithUV(var36, (double)par3 - 0.01D, var50, var24, var32); -+ var6.addVertexWithUV(var34, (double)par3 - 0.01D, var50, var24, var30); -+ var6.addVertexWithUV(var36, (double)par3 - 0.01D, var52, var26, var30); -+ var6.addVertexWithUV(var34, (double)par3 - 0.01D, var52, var26, var32); -+ var6.addVertexWithUV(var34, (double)par3 - 0.01D, var50, var24, var32); -+ var6.addVertexWithUV(var36, (double)par3 - 0.01D, var50, var24, var30); -+ } -+ } else if (!var56 && var57) { -+ if (!GlassPaneRenderer.active) { -+ var6.addVertexWithUV(var36, (double)(par3 + 1), var42, var16, var20); -+ var6.addVertexWithUV(var36, (double)(par3 + 0), var42, var16, var22); -+ var6.addVertexWithUV(var38, (double)(par3 + 0), var42, var18, var22); -+ var6.addVertexWithUV(var38, (double)(par3 + 1), var42, var18, var20); -+ var6.addVertexWithUV(var38, (double)(par3 + 1), var42, var16, var20); -+ var6.addVertexWithUV(var38, (double)(par3 + 0), var42, var16, var22); -+ var6.addVertexWithUV(var36, (double)(par3 + 0), var42, var18, var22); -+ var6.addVertexWithUV(var36, (double)(par3 + 1), var42, var18, var20); -+ } -+ -+ if (!var55 && !var54) { -+ var6.addVertexWithUV(var36, (double)(par3 + 1), var50, var24, var28); -+ var6.addVertexWithUV(var36, (double)(par3 + 0), var50, var24, var32); -+ var6.addVertexWithUV(var36, (double)(par3 + 0), var52, var26, var32); -+ var6.addVertexWithUV(var36, (double)(par3 + 1), var52, var26, var28); -+ var6.addVertexWithUV(var36, (double)(par3 + 1), var52, var24, var28); -+ var6.addVertexWithUV(var36, (double)(par3 + 0), var52, var24, var32); -+ var6.addVertexWithUV(var36, (double)(par3 + 0), var50, var26, var32); -+ var6.addVertexWithUV(var36, (double)(par3 + 1), var50, var26, var28); -+ } -+ -+ if (var58 || par3 < var5 - 1 && this.blockAccess.isAirBlock(par2 + 1, par3 + 1, par4)) { -+ var6.addVertexWithUV(var36, (double)(par3 + 1) + 0.01D, var52, var26, var28); -+ var6.addVertexWithUV(var38, (double)(par3 + 1) + 0.01D, var52, var26, var30); -+ var6.addVertexWithUV(var38, (double)(par3 + 1) + 0.01D, var50, var24, var30); -+ var6.addVertexWithUV(var36, (double)(par3 + 1) + 0.01D, var50, var24, var28); -+ var6.addVertexWithUV(var38, (double)(par3 + 1) + 0.01D, var52, var26, var28); -+ var6.addVertexWithUV(var36, (double)(par3 + 1) + 0.01D, var52, var26, var30); -+ var6.addVertexWithUV(var36, (double)(par3 + 1) + 0.01D, var50, var24, var30); -+ var6.addVertexWithUV(var38, (double)(par3 + 1) + 0.01D, var50, var24, var28); -+ } -+ -+ if (var59 || par3 > 1 && this.blockAccess.isAirBlock(par2 + 1, par3 - 1, par4)) { -+ var6.addVertexWithUV(var36, (double)par3 - 0.01D, var52, var26, var28); -+ var6.addVertexWithUV(var38, (double)par3 - 0.01D, var52, var26, var30); -+ var6.addVertexWithUV(var38, (double)par3 - 0.01D, var50, var24, var30); -+ var6.addVertexWithUV(var36, (double)par3 - 0.01D, var50, var24, var28); -+ var6.addVertexWithUV(var38, (double)par3 - 0.01D, var52, var26, var28); -+ var6.addVertexWithUV(var36, (double)par3 - 0.01D, var52, var26, var30); -+ var6.addVertexWithUV(var36, (double)par3 - 0.01D, var50, var24, var30); -+ var6.addVertexWithUV(var38, (double)par3 - 0.01D, var50, var24, var28); - } - } - } else { -- var6.addVertexWithUV(var34, (double)(var3 + 1), var42, var67, var20); -- var6.addVertexWithUV(var34, (double)(var3 + 0), var42, var67, var22); -- var6.addVertexWithUV(var38, (double)(var3 + 0), var42, var18, var22); -- var6.addVertexWithUV(var38, (double)(var3 + 1), var42, var18, var20); -- var6.addVertexWithUV(var38, (double)(var3 + 1), var42, var67, var20); -- var6.addVertexWithUV(var38, (double)(var3 + 0), var42, var67, var22); -- var6.addVertexWithUV(var34, (double)(var3 + 0), var42, var18, var22); -- var6.addVertexWithUV(var34, (double)(var3 + 1), var42, var18, var20); -- if(var58) { -- var6.addVertexWithUV(var34, (double)(var3 + 1) + 0.01D, var52, var26, var32); -- var6.addVertexWithUV(var38, (double)(var3 + 1) + 0.01D, var52, var26, var28); -- var6.addVertexWithUV(var38, (double)(var3 + 1) + 0.01D, var50, var24, var28); -- var6.addVertexWithUV(var34, (double)(var3 + 1) + 0.01D, var50, var24, var32); -- var6.addVertexWithUV(var38, (double)(var3 + 1) + 0.01D, var52, var26, var32); -- var6.addVertexWithUV(var34, (double)(var3 + 1) + 0.01D, var52, var26, var28); -- var6.addVertexWithUV(var34, (double)(var3 + 1) + 0.01D, var50, var24, var28); -- var6.addVertexWithUV(var38, (double)(var3 + 1) + 0.01D, var50, var24, var32); -- } else { -- if(var3 < var5 - 1 && this.blockAccess.isAirBlock(var2 - 1, var3 + 1, var4)) { -- var6.addVertexWithUV(var34, (double)(var3 + 1) + 0.01D, var52, var26, var30); -- var6.addVertexWithUV(var36, (double)(var3 + 1) + 0.01D, var52, var26, var32); -- var6.addVertexWithUV(var36, (double)(var3 + 1) + 0.01D, var50, var24, var32); -- var6.addVertexWithUV(var34, (double)(var3 + 1) + 0.01D, var50, var24, var30); -- var6.addVertexWithUV(var36, (double)(var3 + 1) + 0.01D, var52, var26, var30); -- var6.addVertexWithUV(var34, (double)(var3 + 1) + 0.01D, var52, var26, var32); -- var6.addVertexWithUV(var34, (double)(var3 + 1) + 0.01D, var50, var24, var32); -- var6.addVertexWithUV(var36, (double)(var3 + 1) + 0.01D, var50, var24, var30); -- } -- -- if(var3 < var5 - 1 && this.blockAccess.isAirBlock(var2 + 1, var3 + 1, var4)) { -- var6.addVertexWithUV(var36, (double)(var3 + 1) + 0.01D, var52, var26, var28); -- var6.addVertexWithUV(var38, (double)(var3 + 1) + 0.01D, var52, var26, var30); -- var6.addVertexWithUV(var38, (double)(var3 + 1) + 0.01D, var50, var24, var30); -- var6.addVertexWithUV(var36, (double)(var3 + 1) + 0.01D, var50, var24, var28); -- var6.addVertexWithUV(var38, (double)(var3 + 1) + 0.01D, var52, var26, var28); -- var6.addVertexWithUV(var36, (double)(var3 + 1) + 0.01D, var52, var26, var30); -- var6.addVertexWithUV(var36, (double)(var3 + 1) + 0.01D, var50, var24, var30); -- var6.addVertexWithUV(var38, (double)(var3 + 1) + 0.01D, var50, var24, var28); -- } -- } -- -- if(var59) { -- var6.addVertexWithUV(var34, (double)var3 - 0.01D, var52, var26, var32); -- var6.addVertexWithUV(var38, (double)var3 - 0.01D, var52, var26, var28); -- var6.addVertexWithUV(var38, (double)var3 - 0.01D, var50, var24, var28); -- var6.addVertexWithUV(var34, (double)var3 - 0.01D, var50, var24, var32); -- var6.addVertexWithUV(var38, (double)var3 - 0.01D, var52, var26, var32); -- var6.addVertexWithUV(var34, (double)var3 - 0.01D, var52, var26, var28); -- var6.addVertexWithUV(var34, (double)var3 - 0.01D, var50, var24, var28); -- var6.addVertexWithUV(var38, (double)var3 - 0.01D, var50, var24, var32); -- } else { -- if(var3 > 1 && this.blockAccess.isAirBlock(var2 - 1, var3 - 1, var4)) { -- var6.addVertexWithUV(var34, (double)var3 - 0.01D, var52, var26, var30); -- var6.addVertexWithUV(var36, (double)var3 - 0.01D, var52, var26, var32); -- var6.addVertexWithUV(var36, (double)var3 - 0.01D, var50, var24, var32); -- var6.addVertexWithUV(var34, (double)var3 - 0.01D, var50, var24, var30); -- var6.addVertexWithUV(var36, (double)var3 - 0.01D, var52, var26, var30); -- var6.addVertexWithUV(var34, (double)var3 - 0.01D, var52, var26, var32); -- var6.addVertexWithUV(var34, (double)var3 - 0.01D, var50, var24, var32); -- var6.addVertexWithUV(var36, (double)var3 - 0.01D, var50, var24, var30); -- } -- -- if(var3 > 1 && this.blockAccess.isAirBlock(var2 + 1, var3 - 1, var4)) { -- var6.addVertexWithUV(var36, (double)var3 - 0.01D, var52, var26, var28); -- var6.addVertexWithUV(var38, (double)var3 - 0.01D, var52, var26, var30); -- var6.addVertexWithUV(var38, (double)var3 - 0.01D, var50, var24, var30); -- var6.addVertexWithUV(var36, (double)var3 - 0.01D, var50, var24, var28); -- var6.addVertexWithUV(var38, (double)var3 - 0.01D, var52, var26, var28); -- var6.addVertexWithUV(var36, (double)var3 - 0.01D, var52, var26, var30); -- var6.addVertexWithUV(var36, (double)var3 - 0.01D, var50, var24, var30); -- var6.addVertexWithUV(var38, (double)var3 - 0.01D, var50, var24, var28); -+ if (!GlassPaneRenderer.active) { -+ var6.addVertexWithUV(var34, (double)(par3 + 1), var42, var67, var20); -+ var6.addVertexWithUV(var34, (double)(par3 + 0), var42, var67, var22); -+ var6.addVertexWithUV(var38, (double)(par3 + 0), var42, var18, var22); -+ var6.addVertexWithUV(var38, (double)(par3 + 1), var42, var18, var20); -+ var6.addVertexWithUV(var38, (double)(par3 + 1), var42, var67, var20); -+ var6.addVertexWithUV(var38, (double)(par3 + 0), var42, var67, var22); -+ var6.addVertexWithUV(var34, (double)(par3 + 0), var42, var18, var22); -+ var6.addVertexWithUV(var34, (double)(par3 + 1), var42, var18, var20); -+ } -+ -+ if (var58) { -+ var6.addVertexWithUV(var34, (double)(par3 + 1) + 0.01D, var52, var26, var32); -+ var6.addVertexWithUV(var38, (double)(par3 + 1) + 0.01D, var52, var26, var28); -+ var6.addVertexWithUV(var38, (double)(par3 + 1) + 0.01D, var50, var24, var28); -+ var6.addVertexWithUV(var34, (double)(par3 + 1) + 0.01D, var50, var24, var32); -+ var6.addVertexWithUV(var38, (double)(par3 + 1) + 0.01D, var52, var26, var32); -+ var6.addVertexWithUV(var34, (double)(par3 + 1) + 0.01D, var52, var26, var28); -+ var6.addVertexWithUV(var34, (double)(par3 + 1) + 0.01D, var50, var24, var28); -+ var6.addVertexWithUV(var38, (double)(par3 + 1) + 0.01D, var50, var24, var32); -+ } else { -+ if (par3 < var5 - 1 && this.blockAccess.isAirBlock(par2 - 1, par3 + 1, par4)) { -+ var6.addVertexWithUV(var34, (double)(par3 + 1) + 0.01D, var52, var26, var30); -+ var6.addVertexWithUV(var36, (double)(par3 + 1) + 0.01D, var52, var26, var32); -+ var6.addVertexWithUV(var36, (double)(par3 + 1) + 0.01D, var50, var24, var32); -+ var6.addVertexWithUV(var34, (double)(par3 + 1) + 0.01D, var50, var24, var30); -+ var6.addVertexWithUV(var36, (double)(par3 + 1) + 0.01D, var52, var26, var30); -+ var6.addVertexWithUV(var34, (double)(par3 + 1) + 0.01D, var52, var26, var32); -+ var6.addVertexWithUV(var34, (double)(par3 + 1) + 0.01D, var50, var24, var32); -+ var6.addVertexWithUV(var36, (double)(par3 + 1) + 0.01D, var50, var24, var30); -+ } -+ -+ if (par3 < var5 - 1 && this.blockAccess.isAirBlock(par2 + 1, par3 + 1, par4)) { -+ var6.addVertexWithUV(var36, (double)(par3 + 1) + 0.01D, var52, var26, var28); -+ var6.addVertexWithUV(var38, (double)(par3 + 1) + 0.01D, var52, var26, var30); -+ var6.addVertexWithUV(var38, (double)(par3 + 1) + 0.01D, var50, var24, var30); -+ var6.addVertexWithUV(var36, (double)(par3 + 1) + 0.01D, var50, var24, var28); -+ var6.addVertexWithUV(var38, (double)(par3 + 1) + 0.01D, var52, var26, var28); -+ var6.addVertexWithUV(var36, (double)(par3 + 1) + 0.01D, var52, var26, var30); -+ var6.addVertexWithUV(var36, (double)(par3 + 1) + 0.01D, var50, var24, var30); -+ var6.addVertexWithUV(var38, (double)(par3 + 1) + 0.01D, var50, var24, var28); -+ } -+ } -+ -+ if (var59) { -+ var6.addVertexWithUV(var34, (double)par3 - 0.01D, var52, var26, var32); -+ var6.addVertexWithUV(var38, (double)par3 - 0.01D, var52, var26, var28); -+ var6.addVertexWithUV(var38, (double)par3 - 0.01D, var50, var24, var28); -+ var6.addVertexWithUV(var34, (double)par3 - 0.01D, var50, var24, var32); -+ var6.addVertexWithUV(var38, (double)par3 - 0.01D, var52, var26, var32); -+ var6.addVertexWithUV(var34, (double)par3 - 0.01D, var52, var26, var28); -+ var6.addVertexWithUV(var34, (double)par3 - 0.01D, var50, var24, var28); -+ var6.addVertexWithUV(var38, (double)par3 - 0.01D, var50, var24, var32); -+ } else { -+ if (par3 > 1 && this.blockAccess.isAirBlock(par2 - 1, par3 - 1, par4)) { -+ var6.addVertexWithUV(var34, (double)par3 - 0.01D, var52, var26, var30); -+ var6.addVertexWithUV(var36, (double)par3 - 0.01D, var52, var26, var32); -+ var6.addVertexWithUV(var36, (double)par3 - 0.01D, var50, var24, var32); -+ var6.addVertexWithUV(var34, (double)par3 - 0.01D, var50, var24, var30); -+ var6.addVertexWithUV(var36, (double)par3 - 0.01D, var52, var26, var30); -+ var6.addVertexWithUV(var34, (double)par3 - 0.01D, var52, var26, var32); -+ var6.addVertexWithUV(var34, (double)par3 - 0.01D, var50, var24, var32); -+ var6.addVertexWithUV(var36, (double)par3 - 0.01D, var50, var24, var30); -+ } -+ -+ if (par3 > 1 && this.blockAccess.isAirBlock(par2 + 1, par3 - 1, par4)) { -+ var6.addVertexWithUV(var36, (double)par3 - 0.01D, var52, var26, var28); -+ var6.addVertexWithUV(var38, (double)par3 - 0.01D, var52, var26, var30); -+ var6.addVertexWithUV(var38, (double)par3 - 0.01D, var50, var24, var30); -+ var6.addVertexWithUV(var36, (double)par3 - 0.01D, var50, var24, var28); -+ var6.addVertexWithUV(var38, (double)par3 - 0.01D, var52, var26, var28); -+ var6.addVertexWithUV(var36, (double)par3 - 0.01D, var52, var26, var30); -+ var6.addVertexWithUV(var36, (double)par3 - 0.01D, var50, var24, var30); -+ var6.addVertexWithUV(var38, (double)par3 - 0.01D, var50, var24, var28); - } - } - } - -- if((!var54 || !var55) && (var56 || var57 || var54 || var55)) { -- if(var54 && !var55) { -- var6.addVertexWithUV(var36, (double)(var3 + 1), var40, var67, var20); -- var6.addVertexWithUV(var36, (double)(var3 + 0), var40, var67, var22); -- var6.addVertexWithUV(var36, (double)(var3 + 0), var42, var16, var22); -- var6.addVertexWithUV(var36, (double)(var3 + 1), var42, var16, var20); -- var6.addVertexWithUV(var36, (double)(var3 + 1), var42, var67, var20); -- var6.addVertexWithUV(var36, (double)(var3 + 0), var42, var67, var22); -- var6.addVertexWithUV(var36, (double)(var3 + 0), var40, var16, var22); -- var6.addVertexWithUV(var36, (double)(var3 + 1), var40, var16, var20); -- if(!var57 && !var56) { -- var6.addVertexWithUV(var46, (double)(var3 + 1), var42, var24, var28); -- var6.addVertexWithUV(var46, (double)(var3 + 0), var42, var24, var32); -- var6.addVertexWithUV(var48, (double)(var3 + 0), var42, var26, var32); -- var6.addVertexWithUV(var48, (double)(var3 + 1), var42, var26, var28); -- var6.addVertexWithUV(var48, (double)(var3 + 1), var42, var24, var28); -- var6.addVertexWithUV(var48, (double)(var3 + 0), var42, var24, var32); -- var6.addVertexWithUV(var46, (double)(var3 + 0), var42, var26, var32); -- var6.addVertexWithUV(var46, (double)(var3 + 1), var42, var26, var28); -- } -- -- if(var58 || var3 < var5 - 1 && this.blockAccess.isAirBlock(var2, var3 + 1, var4 - 1)) { -- var6.addVertexWithUV(var46, (double)(var3 + 1) + 0.005D, var40, var26, var28); -- var6.addVertexWithUV(var46, (double)(var3 + 1) + 0.005D, var42, var26, var30); -- var6.addVertexWithUV(var48, (double)(var3 + 1) + 0.005D, var42, var24, var30); -- var6.addVertexWithUV(var48, (double)(var3 + 1) + 0.005D, var40, var24, var28); -- var6.addVertexWithUV(var46, (double)(var3 + 1) + 0.005D, var42, var26, var28); -- var6.addVertexWithUV(var46, (double)(var3 + 1) + 0.005D, var40, var26, var30); -- var6.addVertexWithUV(var48, (double)(var3 + 1) + 0.005D, var40, var24, var30); -- var6.addVertexWithUV(var48, (double)(var3 + 1) + 0.005D, var42, var24, var28); -- } -- -- if(var59 || var3 > 1 && this.blockAccess.isAirBlock(var2, var3 - 1, var4 - 1)) { -- var6.addVertexWithUV(var46, (double)var3 - 0.005D, var40, var26, var28); -- var6.addVertexWithUV(var46, (double)var3 - 0.005D, var42, var26, var30); -- var6.addVertexWithUV(var48, (double)var3 - 0.005D, var42, var24, var30); -- var6.addVertexWithUV(var48, (double)var3 - 0.005D, var40, var24, var28); -- var6.addVertexWithUV(var46, (double)var3 - 0.005D, var42, var26, var28); -- var6.addVertexWithUV(var46, (double)var3 - 0.005D, var40, var26, var30); -- var6.addVertexWithUV(var48, (double)var3 - 0.005D, var40, var24, var30); -- var6.addVertexWithUV(var48, (double)var3 - 0.005D, var42, var24, var28); -- } -- } else if(!var54 && var55) { -- var6.addVertexWithUV(var36, (double)(var3 + 1), var42, var16, var20); -- var6.addVertexWithUV(var36, (double)(var3 + 0), var42, var16, var22); -- var6.addVertexWithUV(var36, (double)(var3 + 0), var44, var18, var22); -- var6.addVertexWithUV(var36, (double)(var3 + 1), var44, var18, var20); -- var6.addVertexWithUV(var36, (double)(var3 + 1), var44, var16, var20); -- var6.addVertexWithUV(var36, (double)(var3 + 0), var44, var16, var22); -- var6.addVertexWithUV(var36, (double)(var3 + 0), var42, var18, var22); -- var6.addVertexWithUV(var36, (double)(var3 + 1), var42, var18, var20); -- if(!var57 && !var56) { -- var6.addVertexWithUV(var48, (double)(var3 + 1), var42, var24, var28); -- var6.addVertexWithUV(var48, (double)(var3 + 0), var42, var24, var32); -- var6.addVertexWithUV(var46, (double)(var3 + 0), var42, var26, var32); -- var6.addVertexWithUV(var46, (double)(var3 + 1), var42, var26, var28); -- var6.addVertexWithUV(var46, (double)(var3 + 1), var42, var24, var28); -- var6.addVertexWithUV(var46, (double)(var3 + 0), var42, var24, var32); -- var6.addVertexWithUV(var48, (double)(var3 + 0), var42, var26, var32); -- var6.addVertexWithUV(var48, (double)(var3 + 1), var42, var26, var28); -- } -- -- if(var58 || var3 < var5 - 1 && this.blockAccess.isAirBlock(var2, var3 + 1, var4 + 1)) { -- var6.addVertexWithUV(var46, (double)(var3 + 1) + 0.005D, var42, var24, var30); -- var6.addVertexWithUV(var46, (double)(var3 + 1) + 0.005D, var44, var24, var32); -- var6.addVertexWithUV(var48, (double)(var3 + 1) + 0.005D, var44, var26, var32); -- var6.addVertexWithUV(var48, (double)(var3 + 1) + 0.005D, var42, var26, var30); -- var6.addVertexWithUV(var46, (double)(var3 + 1) + 0.005D, var44, var24, var30); -- var6.addVertexWithUV(var46, (double)(var3 + 1) + 0.005D, var42, var24, var32); -- var6.addVertexWithUV(var48, (double)(var3 + 1) + 0.005D, var42, var26, var32); -- var6.addVertexWithUV(var48, (double)(var3 + 1) + 0.005D, var44, var26, var30); -- } -- -- if(var59 || var3 > 1 && this.blockAccess.isAirBlock(var2, var3 - 1, var4 + 1)) { -- var6.addVertexWithUV(var46, (double)var3 - 0.005D, var42, var24, var30); -- var6.addVertexWithUV(var46, (double)var3 - 0.005D, var44, var24, var32); -- var6.addVertexWithUV(var48, (double)var3 - 0.005D, var44, var26, var32); -- var6.addVertexWithUV(var48, (double)var3 - 0.005D, var42, var26, var30); -- var6.addVertexWithUV(var46, (double)var3 - 0.005D, var44, var24, var30); -- var6.addVertexWithUV(var46, (double)var3 - 0.005D, var42, var24, var32); -- var6.addVertexWithUV(var48, (double)var3 - 0.005D, var42, var26, var32); -- var6.addVertexWithUV(var48, (double)var3 - 0.005D, var44, var26, var30); -+ if ((!var54 || !var55) && (var56 || var57 || var54 || var55)) { -+ if (var54 && !var55) { -+ if (!GlassPaneRenderer.active) { -+ var6.addVertexWithUV(var36, (double)(par3 + 1), var40, var67, var20); -+ var6.addVertexWithUV(var36, (double)(par3 + 0), var40, var67, var22); -+ var6.addVertexWithUV(var36, (double)(par3 + 0), var42, var16, var22); -+ var6.addVertexWithUV(var36, (double)(par3 + 1), var42, var16, var20); -+ var6.addVertexWithUV(var36, (double)(par3 + 1), var42, var67, var20); -+ var6.addVertexWithUV(var36, (double)(par3 + 0), var42, var67, var22); -+ var6.addVertexWithUV(var36, (double)(par3 + 0), var40, var16, var22); -+ var6.addVertexWithUV(var36, (double)(par3 + 1), var40, var16, var20); -+ } -+ -+ if (!var57 && !var56) { -+ var6.addVertexWithUV(var46, (double)(par3 + 1), var42, var24, var28); -+ var6.addVertexWithUV(var46, (double)(par3 + 0), var42, var24, var32); -+ var6.addVertexWithUV(var48, (double)(par3 + 0), var42, var26, var32); -+ var6.addVertexWithUV(var48, (double)(par3 + 1), var42, var26, var28); -+ var6.addVertexWithUV(var48, (double)(par3 + 1), var42, var24, var28); -+ var6.addVertexWithUV(var48, (double)(par3 + 0), var42, var24, var32); -+ var6.addVertexWithUV(var46, (double)(par3 + 0), var42, var26, var32); -+ var6.addVertexWithUV(var46, (double)(par3 + 1), var42, var26, var28); -+ } -+ -+ if (var58 || par3 < var5 - 1 && this.blockAccess.isAirBlock(par2, par3 + 1, par4 - 1)) { -+ var6.addVertexWithUV(var46, (double)(par3 + 1) + 0.005D, var40, var26, var28); -+ var6.addVertexWithUV(var46, (double)(par3 + 1) + 0.005D, var42, var26, var30); -+ var6.addVertexWithUV(var48, (double)(par3 + 1) + 0.005D, var42, var24, var30); -+ var6.addVertexWithUV(var48, (double)(par3 + 1) + 0.005D, var40, var24, var28); -+ var6.addVertexWithUV(var46, (double)(par3 + 1) + 0.005D, var42, var26, var28); -+ var6.addVertexWithUV(var46, (double)(par3 + 1) + 0.005D, var40, var26, var30); -+ var6.addVertexWithUV(var48, (double)(par3 + 1) + 0.005D, var40, var24, var30); -+ var6.addVertexWithUV(var48, (double)(par3 + 1) + 0.005D, var42, var24, var28); -+ } -+ -+ if (var59 || par3 > 1 && this.blockAccess.isAirBlock(par2, par3 - 1, par4 - 1)) { -+ var6.addVertexWithUV(var46, (double)par3 - 0.005D, var40, var26, var28); -+ var6.addVertexWithUV(var46, (double)par3 - 0.005D, var42, var26, var30); -+ var6.addVertexWithUV(var48, (double)par3 - 0.005D, var42, var24, var30); -+ var6.addVertexWithUV(var48, (double)par3 - 0.005D, var40, var24, var28); -+ var6.addVertexWithUV(var46, (double)par3 - 0.005D, var42, var26, var28); -+ var6.addVertexWithUV(var46, (double)par3 - 0.005D, var40, var26, var30); -+ var6.addVertexWithUV(var48, (double)par3 - 0.005D, var40, var24, var30); -+ var6.addVertexWithUV(var48, (double)par3 - 0.005D, var42, var24, var28); -+ } -+ } else if (!var54 && var55) { -+ if (!GlassPaneRenderer.active) { -+ var6.addVertexWithUV(var36, (double)(par3 + 1), var42, var16, var20); -+ var6.addVertexWithUV(var36, (double)(par3 + 0), var42, var16, var22); -+ var6.addVertexWithUV(var36, (double)(par3 + 0), var44, var18, var22); -+ var6.addVertexWithUV(var36, (double)(par3 + 1), var44, var18, var20); -+ var6.addVertexWithUV(var36, (double)(par3 + 1), var44, var16, var20); -+ var6.addVertexWithUV(var36, (double)(par3 + 0), var44, var16, var22); -+ var6.addVertexWithUV(var36, (double)(par3 + 0), var42, var18, var22); -+ var6.addVertexWithUV(var36, (double)(par3 + 1), var42, var18, var20); -+ } -+ -+ if (!var57 && !var56) { -+ var6.addVertexWithUV(var48, (double)(par3 + 1), var42, var24, var28); -+ var6.addVertexWithUV(var48, (double)(par3 + 0), var42, var24, var32); -+ var6.addVertexWithUV(var46, (double)(par3 + 0), var42, var26, var32); -+ var6.addVertexWithUV(var46, (double)(par3 + 1), var42, var26, var28); -+ var6.addVertexWithUV(var46, (double)(par3 + 1), var42, var24, var28); -+ var6.addVertexWithUV(var46, (double)(par3 + 0), var42, var24, var32); -+ var6.addVertexWithUV(var48, (double)(par3 + 0), var42, var26, var32); -+ var6.addVertexWithUV(var48, (double)(par3 + 1), var42, var26, var28); -+ } -+ -+ if (var58 || par3 < var5 - 1 && this.blockAccess.isAirBlock(par2, par3 + 1, par4 + 1)) { -+ var6.addVertexWithUV(var46, (double)(par3 + 1) + 0.005D, var42, var24, var30); -+ var6.addVertexWithUV(var46, (double)(par3 + 1) + 0.005D, var44, var24, var32); -+ var6.addVertexWithUV(var48, (double)(par3 + 1) + 0.005D, var44, var26, var32); -+ var6.addVertexWithUV(var48, (double)(par3 + 1) + 0.005D, var42, var26, var30); -+ var6.addVertexWithUV(var46, (double)(par3 + 1) + 0.005D, var44, var24, var30); -+ var6.addVertexWithUV(var46, (double)(par3 + 1) + 0.005D, var42, var24, var32); -+ var6.addVertexWithUV(var48, (double)(par3 + 1) + 0.005D, var42, var26, var32); -+ var6.addVertexWithUV(var48, (double)(par3 + 1) + 0.005D, var44, var26, var30); -+ } -+ -+ if (var59 || par3 > 1 && this.blockAccess.isAirBlock(par2, par3 - 1, par4 + 1)) { -+ var6.addVertexWithUV(var46, (double)par3 - 0.005D, var42, var24, var30); -+ var6.addVertexWithUV(var46, (double)par3 - 0.005D, var44, var24, var32); -+ var6.addVertexWithUV(var48, (double)par3 - 0.005D, var44, var26, var32); -+ var6.addVertexWithUV(var48, (double)par3 - 0.005D, var42, var26, var30); -+ var6.addVertexWithUV(var46, (double)par3 - 0.005D, var44, var24, var30); -+ var6.addVertexWithUV(var46, (double)par3 - 0.005D, var42, var24, var32); -+ var6.addVertexWithUV(var48, (double)par3 - 0.005D, var42, var26, var32); -+ var6.addVertexWithUV(var48, (double)par3 - 0.005D, var44, var26, var30); - } - } - } else { -- var6.addVertexWithUV(var36, (double)(var3 + 1), var44, var67, var20); -- var6.addVertexWithUV(var36, (double)(var3 + 0), var44, var67, var22); -- var6.addVertexWithUV(var36, (double)(var3 + 0), var40, var18, var22); -- var6.addVertexWithUV(var36, (double)(var3 + 1), var40, var18, var20); -- var6.addVertexWithUV(var36, (double)(var3 + 1), var40, var67, var20); -- var6.addVertexWithUV(var36, (double)(var3 + 0), var40, var67, var22); -- var6.addVertexWithUV(var36, (double)(var3 + 0), var44, var18, var22); -- var6.addVertexWithUV(var36, (double)(var3 + 1), var44, var18, var20); -- if(var58) { -- var6.addVertexWithUV(var48, (double)(var3 + 1) + 0.005D, var44, var26, var32); -- var6.addVertexWithUV(var48, (double)(var3 + 1) + 0.005D, var40, var26, var28); -- var6.addVertexWithUV(var46, (double)(var3 + 1) + 0.005D, var40, var24, var28); -- var6.addVertexWithUV(var46, (double)(var3 + 1) + 0.005D, var44, var24, var32); -- var6.addVertexWithUV(var48, (double)(var3 + 1) + 0.005D, var40, var26, var32); -- var6.addVertexWithUV(var48, (double)(var3 + 1) + 0.005D, var44, var26, var28); -- var6.addVertexWithUV(var46, (double)(var3 + 1) + 0.005D, var44, var24, var28); -- var6.addVertexWithUV(var46, (double)(var3 + 1) + 0.005D, var40, var24, var32); -- } else { -- if(var3 < var5 - 1 && this.blockAccess.isAirBlock(var2, var3 + 1, var4 - 1)) { -- var6.addVertexWithUV(var46, (double)(var3 + 1) + 0.005D, var40, var26, var28); -- var6.addVertexWithUV(var46, (double)(var3 + 1) + 0.005D, var42, var26, var30); -- var6.addVertexWithUV(var48, (double)(var3 + 1) + 0.005D, var42, var24, var30); -- var6.addVertexWithUV(var48, (double)(var3 + 1) + 0.005D, var40, var24, var28); -- var6.addVertexWithUV(var46, (double)(var3 + 1) + 0.005D, var42, var26, var28); -- var6.addVertexWithUV(var46, (double)(var3 + 1) + 0.005D, var40, var26, var30); -- var6.addVertexWithUV(var48, (double)(var3 + 1) + 0.005D, var40, var24, var30); -- var6.addVertexWithUV(var48, (double)(var3 + 1) + 0.005D, var42, var24, var28); -- } -- -- if(var3 < var5 - 1 && this.blockAccess.isAirBlock(var2, var3 + 1, var4 + 1)) { -- var6.addVertexWithUV(var46, (double)(var3 + 1) + 0.005D, var42, var24, var30); -- var6.addVertexWithUV(var46, (double)(var3 + 1) + 0.005D, var44, var24, var32); -- var6.addVertexWithUV(var48, (double)(var3 + 1) + 0.005D, var44, var26, var32); -- var6.addVertexWithUV(var48, (double)(var3 + 1) + 0.005D, var42, var26, var30); -- var6.addVertexWithUV(var46, (double)(var3 + 1) + 0.005D, var44, var24, var30); -- var6.addVertexWithUV(var46, (double)(var3 + 1) + 0.005D, var42, var24, var32); -- var6.addVertexWithUV(var48, (double)(var3 + 1) + 0.005D, var42, var26, var32); -- var6.addVertexWithUV(var48, (double)(var3 + 1) + 0.005D, var44, var26, var30); -- } -- } -- -- if(var59) { -- var6.addVertexWithUV(var48, (double)var3 - 0.005D, var44, var26, var32); -- var6.addVertexWithUV(var48, (double)var3 - 0.005D, var40, var26, var28); -- var6.addVertexWithUV(var46, (double)var3 - 0.005D, var40, var24, var28); -- var6.addVertexWithUV(var46, (double)var3 - 0.005D, var44, var24, var32); -- var6.addVertexWithUV(var48, (double)var3 - 0.005D, var40, var26, var32); -- var6.addVertexWithUV(var48, (double)var3 - 0.005D, var44, var26, var28); -- var6.addVertexWithUV(var46, (double)var3 - 0.005D, var44, var24, var28); -- var6.addVertexWithUV(var46, (double)var3 - 0.005D, var40, var24, var32); -- } else { -- if(var3 > 1 && this.blockAccess.isAirBlock(var2, var3 - 1, var4 - 1)) { -- var6.addVertexWithUV(var46, (double)var3 - 0.005D, var40, var26, var28); -- var6.addVertexWithUV(var46, (double)var3 - 0.005D, var42, var26, var30); -- var6.addVertexWithUV(var48, (double)var3 - 0.005D, var42, var24, var30); -- var6.addVertexWithUV(var48, (double)var3 - 0.005D, var40, var24, var28); -- var6.addVertexWithUV(var46, (double)var3 - 0.005D, var42, var26, var28); -- var6.addVertexWithUV(var46, (double)var3 - 0.005D, var40, var26, var30); -- var6.addVertexWithUV(var48, (double)var3 - 0.005D, var40, var24, var30); -- var6.addVertexWithUV(var48, (double)var3 - 0.005D, var42, var24, var28); -- } -- -- if(var3 > 1 && this.blockAccess.isAirBlock(var2, var3 - 1, var4 + 1)) { -- var6.addVertexWithUV(var46, (double)var3 - 0.005D, var42, var24, var30); -- var6.addVertexWithUV(var46, (double)var3 - 0.005D, var44, var24, var32); -- var6.addVertexWithUV(var48, (double)var3 - 0.005D, var44, var26, var32); -- var6.addVertexWithUV(var48, (double)var3 - 0.005D, var42, var26, var30); -- var6.addVertexWithUV(var46, (double)var3 - 0.005D, var44, var24, var30); -- var6.addVertexWithUV(var46, (double)var3 - 0.005D, var42, var24, var32); -- var6.addVertexWithUV(var48, (double)var3 - 0.005D, var42, var26, var32); -- var6.addVertexWithUV(var48, (double)var3 - 0.005D, var44, var26, var30); -+ if (!GlassPaneRenderer.active) { -+ var6.addVertexWithUV(var36, (double)(par3 + 1), var44, var67, var20); -+ var6.addVertexWithUV(var36, (double)(par3 + 0), var44, var67, var22); -+ var6.addVertexWithUV(var36, (double)(par3 + 0), var40, var18, var22); -+ var6.addVertexWithUV(var36, (double)(par3 + 1), var40, var18, var20); -+ var6.addVertexWithUV(var36, (double)(par3 + 1), var40, var67, var20); -+ var6.addVertexWithUV(var36, (double)(par3 + 0), var40, var67, var22); -+ var6.addVertexWithUV(var36, (double)(par3 + 0), var44, var18, var22); -+ var6.addVertexWithUV(var36, (double)(par3 + 1), var44, var18, var20); -+ } -+ -+ if (var58) { -+ var6.addVertexWithUV(var48, (double)(par3 + 1) + 0.005D, var44, var26, var32); -+ var6.addVertexWithUV(var48, (double)(par3 + 1) + 0.005D, var40, var26, var28); -+ var6.addVertexWithUV(var46, (double)(par3 + 1) + 0.005D, var40, var24, var28); -+ var6.addVertexWithUV(var46, (double)(par3 + 1) + 0.005D, var44, var24, var32); -+ var6.addVertexWithUV(var48, (double)(par3 + 1) + 0.005D, var40, var26, var32); -+ var6.addVertexWithUV(var48, (double)(par3 + 1) + 0.005D, var44, var26, var28); -+ var6.addVertexWithUV(var46, (double)(par3 + 1) + 0.005D, var44, var24, var28); -+ var6.addVertexWithUV(var46, (double)(par3 + 1) + 0.005D, var40, var24, var32); -+ } else { -+ if (par3 < var5 - 1 && this.blockAccess.isAirBlock(par2, par3 + 1, par4 - 1)) { -+ var6.addVertexWithUV(var46, (double)(par3 + 1) + 0.005D, var40, var26, var28); -+ var6.addVertexWithUV(var46, (double)(par3 + 1) + 0.005D, var42, var26, var30); -+ var6.addVertexWithUV(var48, (double)(par3 + 1) + 0.005D, var42, var24, var30); -+ var6.addVertexWithUV(var48, (double)(par3 + 1) + 0.005D, var40, var24, var28); -+ var6.addVertexWithUV(var46, (double)(par3 + 1) + 0.005D, var42, var26, var28); -+ var6.addVertexWithUV(var46, (double)(par3 + 1) + 0.005D, var40, var26, var30); -+ var6.addVertexWithUV(var48, (double)(par3 + 1) + 0.005D, var40, var24, var30); -+ var6.addVertexWithUV(var48, (double)(par3 + 1) + 0.005D, var42, var24, var28); -+ } -+ -+ if (par3 < var5 - 1 && this.blockAccess.isAirBlock(par2, par3 + 1, par4 + 1)) { -+ var6.addVertexWithUV(var46, (double)(par3 + 1) + 0.005D, var42, var24, var30); -+ var6.addVertexWithUV(var46, (double)(par3 + 1) + 0.005D, var44, var24, var32); -+ var6.addVertexWithUV(var48, (double)(par3 + 1) + 0.005D, var44, var26, var32); -+ var6.addVertexWithUV(var48, (double)(par3 + 1) + 0.005D, var42, var26, var30); -+ var6.addVertexWithUV(var46, (double)(par3 + 1) + 0.005D, var44, var24, var30); -+ var6.addVertexWithUV(var46, (double)(par3 + 1) + 0.005D, var42, var24, var32); -+ var6.addVertexWithUV(var48, (double)(par3 + 1) + 0.005D, var42, var26, var32); -+ var6.addVertexWithUV(var48, (double)(par3 + 1) + 0.005D, var44, var26, var30); -+ } -+ } -+ -+ if (var59) { -+ var6.addVertexWithUV(var48, (double)par3 - 0.005D, var44, var26, var32); -+ var6.addVertexWithUV(var48, (double)par3 - 0.005D, var40, var26, var28); -+ var6.addVertexWithUV(var46, (double)par3 - 0.005D, var40, var24, var28); -+ var6.addVertexWithUV(var46, (double)par3 - 0.005D, var44, var24, var32); -+ var6.addVertexWithUV(var48, (double)par3 - 0.005D, var40, var26, var32); -+ var6.addVertexWithUV(var48, (double)par3 - 0.005D, var44, var26, var28); -+ var6.addVertexWithUV(var46, (double)par3 - 0.005D, var44, var24, var28); -+ var6.addVertexWithUV(var46, (double)par3 - 0.005D, var40, var24, var32); -+ } else { -+ if (par3 > 1 && this.blockAccess.isAirBlock(par2, par3 - 1, par4 - 1)) { -+ var6.addVertexWithUV(var46, (double)par3 - 0.005D, var40, var26, var28); -+ var6.addVertexWithUV(var46, (double)par3 - 0.005D, var42, var26, var30); -+ var6.addVertexWithUV(var48, (double)par3 - 0.005D, var42, var24, var30); -+ var6.addVertexWithUV(var48, (double)par3 - 0.005D, var40, var24, var28); -+ var6.addVertexWithUV(var46, (double)par3 - 0.005D, var42, var26, var28); -+ var6.addVertexWithUV(var46, (double)par3 - 0.005D, var40, var26, var30); -+ var6.addVertexWithUV(var48, (double)par3 - 0.005D, var40, var24, var30); -+ var6.addVertexWithUV(var48, (double)par3 - 0.005D, var42, var24, var28); -+ } -+ -+ if (par3 > 1 && this.blockAccess.isAirBlock(par2, par3 - 1, par4 + 1)) { -+ var6.addVertexWithUV(var46, (double)par3 - 0.005D, var42, var24, var30); -+ var6.addVertexWithUV(var46, (double)par3 - 0.005D, var44, var24, var32); -+ var6.addVertexWithUV(var48, (double)par3 - 0.005D, var44, var26, var32); -+ var6.addVertexWithUV(var48, (double)par3 - 0.005D, var42, var26, var30); -+ var6.addVertexWithUV(var46, (double)par3 - 0.005D, var44, var24, var30); -+ var6.addVertexWithUV(var46, (double)par3 - 0.005D, var42, var24, var32); -+ var6.addVertexWithUV(var48, (double)par3 - 0.005D, var42, var26, var32); -+ var6.addVertexWithUV(var48, (double)par3 - 0.005D, var44, var26, var30); - } - } - } - - return true; - } -- -- public boolean renderCrossedSquares(Block var1, int var2, int var3, int var4) { -+ /** -+ * Renders any block requiring croseed squares such as reeds, flowers, and mushrooms -+ */ -+ public boolean renderCrossedSquares(Block par1Block, int par2, int par3, int par4) { - Tessellator var5 = Tessellator.instance; -- var5.setBrightness(var1.getMixedBrightnessForBlock(this.blockAccess, var2, var3, var4)); -+ var5.setBrightness(par1Block.getMixedBrightnessForBlock(this.blockAccess, par2, par3, par4)); - float var6 = 1.0F; -- int var7 = var1.colorMultiplier(this.blockAccess, var2, var3, var4); -+ int var7 = par1Block.colorMultiplier(this.blockAccess, par2, par3, par4); - float var8 = (float)(var7 >> 16 & 255) / 255.0F; - float var9 = (float)(var7 >> 8 & 255) / 255.0F; - float var10 = (float)(var7 & 255) / 255.0F; -- if(EntityRenderer.anaglyphEnable) { -+ -+ if (EntityRenderer.anaglyphEnable) { - float var11 = (var8 * 30.0F + var9 * 59.0F + var10 * 11.0F) / 100.0F; - float var12 = (var8 * 30.0F + var9 * 70.0F) / 100.0F; - float var13 = (var8 * 30.0F + var10 * 70.0F) / 100.0F; -@@ -2670,31 +3206,36 @@ - } - - var5.setColorOpaque_F(var6 * var8, var6 * var9, var6 * var10); -- double var19 = (double)var2; -- double var20 = (double)var3; -- double var15 = (double)var4; -- if(var1 == Block.tallGrass) { -- long var17 = (long)(var2 * 3129871) ^ (long)var4 * 116129781L ^ (long)var3; -+ double var19 = (double)par2; -+ double var20 = (double)par3; -+ double var15 = (double)par4; -+ -+ if (par1Block == Block.tallGrass) { -+ long var17 = (long)(par2 * 3129871) ^ (long)par4 * 116129781L ^ (long)par3; - var17 = var17 * var17 * 42317861L + var17 * 11L; - var19 += ((double)((float)(var17 >> 16 & 15L) / 15.0F) - 0.5D) * 0.5D; - var20 += ((double)((float)(var17 >> 20 & 15L) / 15.0F) - 1.0D) * 0.2D; - var15 += ((double)((float)(var17 >> 24 & 15L) / 15.0F) - 0.5D) * 0.5D; - } - -- this.drawCrossedSquares(var1, this.blockAccess.getBlockMetadata(var2, var3, var4), var19, var20, var15, 1.0F); -+ this.drawCrossedSquares(par1Block, this.blockAccess.getBlockMetadata(par2, par3, par4), var19, var20, var15, 1.0F); - return true; - } - -- public boolean renderBlockStem(Block var1, int var2, int var3, int var4) { -- BlockStem var5 = (BlockStem)var1; -+ /** -+ * Render block stem -+ */ -+ public boolean renderBlockStem(Block par1Block, int par2, int par3, int par4) { -+ BlockStem var5 = (BlockStem)par1Block; - Tessellator var6 = Tessellator.instance; -- var6.setBrightness(var5.getMixedBrightnessForBlock(this.blockAccess, var2, var3, var4)); -+ var6.setBrightness(var5.getMixedBrightnessForBlock(this.blockAccess, par2, par3, par4)); - float var7 = 1.0F; -- int var8 = var5.colorMultiplier(this.blockAccess, var2, var3, var4); -+ int var8 = var5.colorMultiplier(this.blockAccess, par2, par3, par4); - float var9 = (float)(var8 >> 16 & 255) / 255.0F; - float var10 = (float)(var8 >> 8 & 255) / 255.0F; - float var11 = (float)(var8 & 255) / 255.0F; -- if(EntityRenderer.anaglyphEnable) { -+ -+ if (EntityRenderer.anaglyphEnable) { - float var12 = (var9 * 30.0F + var10 * 59.0F + var11 * 11.0F) / 100.0F; - float var13 = (var9 * 30.0F + var10 * 70.0F) / 100.0F; - float var14 = (var9 * 30.0F + var11 * 70.0F) / 100.0F; -@@ -2704,30 +3245,38 @@ - } - - var6.setColorOpaque_F(var7 * var9, var7 * var10, var7 * var11); -- var5.setBlockBoundsBasedOnState(this.blockAccess, var2, var3, var4); -- int var15 = var5.getState(this.blockAccess, var2, var3, var4); -- if(var15 < 0) { -- this.renderBlockStemSmall(var5, this.blockAccess.getBlockMetadata(var2, var3, var4), this.renderMaxY, (double)var2, (double)((float)var3 - 1.0F / 16.0F), (double)var4); -+ var5.setBlockBoundsBasedOnState(this.blockAccess, par2, par3, par4); -+ int var15 = var5.getState(this.blockAccess, par2, par3, par4); -+ -+ if (var15 < 0) { -+ this.renderBlockStemSmall(var5, this.blockAccess.getBlockMetadata(par2, par3, par4), this.renderMaxY, (double)par2, (double)((float)par3 - 0.0625F), (double)par4); - } else { -- this.renderBlockStemSmall(var5, this.blockAccess.getBlockMetadata(var2, var3, var4), 0.5D, (double)var2, (double)((float)var3 - 1.0F / 16.0F), (double)var4); -- this.renderBlockStemBig(var5, this.blockAccess.getBlockMetadata(var2, var3, var4), var15, this.renderMaxY, (double)var2, (double)((float)var3 - 1.0F / 16.0F), (double)var4); -+ this.renderBlockStemSmall(var5, this.blockAccess.getBlockMetadata(par2, par3, par4), 0.5D, (double)par2, (double)((float)par3 - 0.0625F), (double)par4); -+ this.renderBlockStemBig(var5, this.blockAccess.getBlockMetadata(par2, par3, par4), var15, this.renderMaxY, (double)par2, (double)((float)par3 - 0.0625F), (double)par4); - } - - return true; - } - -- public boolean renderBlockCrops(Block var1, int var2, int var3, int var4) { -+ /** -+ * Render block crops -+ */ -+ public boolean renderBlockCrops(Block par1Block, int par2, int par3, int par4) { - Tessellator var5 = Tessellator.instance; -- var5.setBrightness(var1.getMixedBrightnessForBlock(this.blockAccess, var2, var3, var4)); -+ var5.setBrightness(par1Block.getMixedBrightnessForBlock(this.blockAccess, par2, par3, par4)); - var5.setColorOpaque_F(1.0F, 1.0F, 1.0F); -- this.renderBlockCropsImpl(var1, this.blockAccess.getBlockMetadata(var2, var3, var4), (double)var2, (double)((float)var3 - 1.0F / 16.0F), (double)var4); -+ this.renderBlockCropsImpl(par1Block, this.blockAccess.getBlockMetadata(par2, par3, par4), (double)par2, (double)((float)par3 - 0.0625F), (double)par4); - return true; - } - -- public void renderTorchAtAngle(Block var1, double var2, double var4, double var6, double var8, double var10, int var12) { -+ /** -+ * Renders a torch at the given coordinates, with the base slanting at the given delta -+ */ -+ public void renderTorchAtAngle(Block par1Block, double par2, double par4, double par6, double par8, double par10, int par12) { - Tessellator var13 = Tessellator.instance; -- Icon var14 = this.getBlockIconFromSideAndMetadata(var1, 0, var12); -- if(this.hasOverrideBlockTexture()) { -+ Icon var14 = this.getBlockIconFromSideAndMetadata(par1Block, 0, par12); -+ -+ if (this.hasOverrideBlockTexture()) { - var14 = this.overrideBlockTexture; - } - -@@ -2743,144 +3292,186 @@ - double var33 = (double)var14.getInterpolatedV(13.0D); - double var35 = (double)var14.getInterpolatedU(9.0D); - double var37 = (double)var14.getInterpolatedV(15.0D); -- var2 += 0.5D; -- var6 += 0.5D; -- double var39 = var2 - 0.5D; -- double var41 = var2 + 0.5D; -- double var43 = var6 - 0.5D; -- double var45 = var6 + 0.5D; -- double var47 = 1.0D / 16.0D; -+ par2 += 0.5D; -+ par6 += 0.5D; -+ double var39 = par2 - 0.5D; -+ double var41 = par2 + 0.5D; -+ double var43 = par6 - 0.5D; -+ double var45 = par6 + 0.5D; -+ double var47 = 0.0625D; - double var49 = 0.625D; -- var13.addVertexWithUV(var2 + var8 * (1.0D - var49) - var47, var4 + var49, var6 + var10 * (1.0D - var49) - var47, var23, var25); -- var13.addVertexWithUV(var2 + var8 * (1.0D - var49) - var47, var4 + var49, var6 + var10 * (1.0D - var49) + var47, var23, var29); -- var13.addVertexWithUV(var2 + var8 * (1.0D - var49) + var47, var4 + var49, var6 + var10 * (1.0D - var49) + var47, var27, var29); -- var13.addVertexWithUV(var2 + var8 * (1.0D - var49) + var47, var4 + var49, var6 + var10 * (1.0D - var49) - var47, var27, var25); -- var13.addVertexWithUV(var2 + var47 + var8, var4, var6 - var47 + var10, var35, var33); -- var13.addVertexWithUV(var2 + var47 + var8, var4, var6 + var47 + var10, var35, var37); -- var13.addVertexWithUV(var2 - var47 + var8, var4, var6 + var47 + var10, var31, var37); -- var13.addVertexWithUV(var2 - var47 + var8, var4, var6 - var47 + var10, var31, var33); -- var13.addVertexWithUV(var2 - var47, var4 + 1.0D, var43, var15, var17); -- var13.addVertexWithUV(var2 - var47 + var8, var4 + 0.0D, var43 + var10, var15, var21); -- var13.addVertexWithUV(var2 - var47 + var8, var4 + 0.0D, var45 + var10, var19, var21); -- var13.addVertexWithUV(var2 - var47, var4 + 1.0D, var45, var19, var17); -- var13.addVertexWithUV(var2 + var47, var4 + 1.0D, var45, var15, var17); -- var13.addVertexWithUV(var2 + var8 + var47, var4 + 0.0D, var45 + var10, var15, var21); -- var13.addVertexWithUV(var2 + var8 + var47, var4 + 0.0D, var43 + var10, var19, var21); -- var13.addVertexWithUV(var2 + var47, var4 + 1.0D, var43, var19, var17); -- var13.addVertexWithUV(var39, var4 + 1.0D, var6 + var47, var15, var17); -- var13.addVertexWithUV(var39 + var8, var4 + 0.0D, var6 + var47 + var10, var15, var21); -- var13.addVertexWithUV(var41 + var8, var4 + 0.0D, var6 + var47 + var10, var19, var21); -- var13.addVertexWithUV(var41, var4 + 1.0D, var6 + var47, var19, var17); -- var13.addVertexWithUV(var41, var4 + 1.0D, var6 - var47, var15, var17); -- var13.addVertexWithUV(var41 + var8, var4 + 0.0D, var6 - var47 + var10, var15, var21); -- var13.addVertexWithUV(var39 + var8, var4 + 0.0D, var6 - var47 + var10, var19, var21); -- var13.addVertexWithUV(var39, var4 + 1.0D, var6 - var47, var19, var17); -- } -- -- public void drawCrossedSquares(Block var1, int var2, double var3, double var5, double var7, float var9) { -+ var13.addVertexWithUV(par2 + par8 * (1.0D - var49) - var47, par4 + var49, par6 + par10 * (1.0D - var49) - var47, var23, var25); -+ var13.addVertexWithUV(par2 + par8 * (1.0D - var49) - var47, par4 + var49, par6 + par10 * (1.0D - var49) + var47, var23, var29); -+ var13.addVertexWithUV(par2 + par8 * (1.0D - var49) + var47, par4 + var49, par6 + par10 * (1.0D - var49) + var47, var27, var29); -+ var13.addVertexWithUV(par2 + par8 * (1.0D - var49) + var47, par4 + var49, par6 + par10 * (1.0D - var49) - var47, var27, var25); -+ var13.addVertexWithUV(par2 + var47 + par8, par4, par6 - var47 + par10, var35, var33); -+ var13.addVertexWithUV(par2 + var47 + par8, par4, par6 + var47 + par10, var35, var37); -+ var13.addVertexWithUV(par2 - var47 + par8, par4, par6 + var47 + par10, var31, var37); -+ var13.addVertexWithUV(par2 - var47 + par8, par4, par6 - var47 + par10, var31, var33); -+ var13.addVertexWithUV(par2 - var47, par4 + 1.0D, var43, var15, var17); -+ var13.addVertexWithUV(par2 - var47 + par8, par4 + 0.0D, var43 + par10, var15, var21); -+ var13.addVertexWithUV(par2 - var47 + par8, par4 + 0.0D, var45 + par10, var19, var21); -+ var13.addVertexWithUV(par2 - var47, par4 + 1.0D, var45, var19, var17); -+ var13.addVertexWithUV(par2 + var47, par4 + 1.0D, var45, var15, var17); -+ var13.addVertexWithUV(par2 + par8 + var47, par4 + 0.0D, var45 + par10, var15, var21); -+ var13.addVertexWithUV(par2 + par8 + var47, par4 + 0.0D, var43 + par10, var19, var21); -+ var13.addVertexWithUV(par2 + var47, par4 + 1.0D, var43, var19, var17); -+ var13.addVertexWithUV(var39, par4 + 1.0D, par6 + var47, var15, var17); -+ var13.addVertexWithUV(var39 + par8, par4 + 0.0D, par6 + var47 + par10, var15, var21); -+ var13.addVertexWithUV(var41 + par8, par4 + 0.0D, par6 + var47 + par10, var19, var21); -+ var13.addVertexWithUV(var41, par4 + 1.0D, par6 + var47, var19, var17); -+ var13.addVertexWithUV(var41, par4 + 1.0D, par6 - var47, var15, var17); -+ var13.addVertexWithUV(var41 + par8, par4 + 0.0D, par6 - var47 + par10, var15, var21); -+ var13.addVertexWithUV(var39 + par8, par4 + 0.0D, par6 - var47 + par10, var19, var21); -+ var13.addVertexWithUV(var39, par4 + 1.0D, par6 - var47, var19, var17); -+ } -+ -+ /** -+ * Utility function to draw crossed swuares -+ */ -+ // Spout Start -+ public void drawCrossedSquares(Block par1Block, int par2, double par3, double par5, double par7, float par9) { -+ drawCrossedSquares(par1Block, par2, par3, par5, par7, par9, false); -+ } -+ -+ public void drawCrossedSquares(Block par1Block, int par2, double par3, double par5, double par7, float par9, boolean customUV) { -+ // Spout End - Tessellator var10 = Tessellator.instance; -- Icon var11 = this.getBlockIconFromSideAndMetadata(var1, 0, var2); -- if(this.hasOverrideBlockTexture()) { -+ Icon var11 = this.getBlockIconFromSideAndMetadata(par1Block, 0, par2); -+ -+ if (this.hasOverrideBlockTexture()) { - var11 = this.overrideBlockTexture; - } - -- double var12 = (double)var11.getMinU(); -- double var14 = (double)var11.getMinV(); -- double var16 = (double)var11.getMaxU(); -- double var18 = (double)var11.getMaxV(); -- double var20 = 0.45D * (double)var9; -- double var22 = var3 + 0.5D - var20; -- double var24 = var3 + 0.5D + var20; -- double var26 = var7 + 0.5D - var20; -- double var28 = var7 + 0.5D + var20; -- var10.addVertexWithUV(var22, var5 + (double)var9, var26, var12, var14); -- var10.addVertexWithUV(var22, var5 + 0.0D, var26, var12, var18); -- var10.addVertexWithUV(var24, var5 + 0.0D, var28, var16, var18); -- var10.addVertexWithUV(var24, var5 + (double)var9, var28, var16, var14); -- var10.addVertexWithUV(var24, var5 + (double)var9, var28, var12, var14); -- var10.addVertexWithUV(var24, var5 + 0.0D, var28, var12, var18); -- var10.addVertexWithUV(var22, var5 + 0.0D, var26, var16, var18); -- var10.addVertexWithUV(var22, var5 + (double)var9, var26, var16, var14); -- var10.addVertexWithUV(var22, var5 + (double)var9, var28, var12, var14); -- var10.addVertexWithUV(var22, var5 + 0.0D, var28, var12, var18); -- var10.addVertexWithUV(var24, var5 + 0.0D, var26, var16, var18); -- var10.addVertexWithUV(var24, var5 + (double)var9, var26, var16, var14); -- var10.addVertexWithUV(var24, var5 + (double)var9, var26, var12, var14); -- var10.addVertexWithUV(var24, var5 + 0.0D, var26, var12, var18); -- var10.addVertexWithUV(var22, var5 + 0.0D, var28, var16, var18); -- var10.addVertexWithUV(var22, var5 + (double)var9, var28, var16, var14); -+ var11 = CTMUtils.getTile(this, par1Block, (int)par3, (int)par5, (int)par7, var11, var10); -+ -+ if (var11 != null) { -+ var10 = TessellatorUtils.getTessellator(var10, var11); -+ double var12 = (double)var11.getMinU(); -+ double var14 = (double)var11.getMinV(); -+ double var16 = (double)var11.getMaxU(); -+ double var18 = (double)var11.getMaxV(); -+ double var20 = 0.45D * (double)par9; -+ double var22 = par3 + 0.5D - var20; -+ double var24 = par3 + 0.5D + var20; -+ double var26 = par7 + 0.5D - var20; -+ double var28 = par7 + 0.5D + var20; -+ // Spout Start -+ if (customUV) { -+ var12 = 1; -+ var14 = 0; -+ var16 = 1; -+ var18 = 0; -+ } -+ // Spout End -+ var10.addVertexWithUV(var22, par5 + (double)par9, var26, var12, var14); -+ var10.addVertexWithUV(var22, par5 + 0.0D, var26, var12, var18); -+ var10.addVertexWithUV(var24, par5 + 0.0D, var28, var16, var18); -+ var10.addVertexWithUV(var24, par5 + (double)par9, var28, var16, var14); -+ var10.addVertexWithUV(var24, par5 + (double)par9, var28, var12, var14); -+ var10.addVertexWithUV(var24, par5 + 0.0D, var28, var12, var18); -+ var10.addVertexWithUV(var22, par5 + 0.0D, var26, var16, var18); -+ var10.addVertexWithUV(var22, par5 + (double)par9, var26, var16, var14); -+ var10.addVertexWithUV(var22, par5 + (double)par9, var28, var12, var14); -+ var10.addVertexWithUV(var22, par5 + 0.0D, var28, var12, var18); -+ var10.addVertexWithUV(var24, par5 + 0.0D, var26, var16, var18); -+ var10.addVertexWithUV(var24, par5 + (double)par9, var26, var16, var14); -+ var10.addVertexWithUV(var24, par5 + (double)par9, var26, var12, var14); -+ var10.addVertexWithUV(var24, par5 + 0.0D, var26, var12, var18); -+ var10.addVertexWithUV(var22, par5 + 0.0D, var28, var16, var18); -+ var10.addVertexWithUV(var22, par5 + (double)par9, var28, var16, var14); -+ } - } - -- public void renderBlockStemSmall(Block var1, int var2, double var3, double var5, double var7, double var9) { -+ /** -+ * Render block stem small -+ */ -+ public void renderBlockStemSmall(Block par1Block, int par2, double par3, double par5, double par7, double par9) { - Tessellator var11 = Tessellator.instance; -- Icon var12 = this.getBlockIconFromSideAndMetadata(var1, 0, var2); -- if(this.hasOverrideBlockTexture()) { -+ Icon var12 = this.getBlockIconFromSideAndMetadata(par1Block, 0, par2); -+ -+ if (this.hasOverrideBlockTexture()) { - var12 = this.overrideBlockTexture; - } - - double var13 = (double)var12.getMinU(); - double var15 = (double)var12.getMinV(); - double var17 = (double)var12.getMaxU(); -- double var19 = (double)var12.getInterpolatedV(var3 * 16.0D); -- double var21 = var5 + 0.5D - (double)0.45F; -- double var23 = var5 + 0.5D + (double)0.45F; -- double var25 = var9 + 0.5D - (double)0.45F; -- double var27 = var9 + 0.5D + (double)0.45F; -- var11.addVertexWithUV(var21, var7 + var3, var25, var13, var15); -- var11.addVertexWithUV(var21, var7 + 0.0D, var25, var13, var19); -- var11.addVertexWithUV(var23, var7 + 0.0D, var27, var17, var19); -- var11.addVertexWithUV(var23, var7 + var3, var27, var17, var15); -- var11.addVertexWithUV(var23, var7 + var3, var27, var13, var15); -- var11.addVertexWithUV(var23, var7 + 0.0D, var27, var13, var19); -- var11.addVertexWithUV(var21, var7 + 0.0D, var25, var17, var19); -- var11.addVertexWithUV(var21, var7 + var3, var25, var17, var15); -- var11.addVertexWithUV(var21, var7 + var3, var27, var13, var15); -- var11.addVertexWithUV(var21, var7 + 0.0D, var27, var13, var19); -- var11.addVertexWithUV(var23, var7 + 0.0D, var25, var17, var19); -- var11.addVertexWithUV(var23, var7 + var3, var25, var17, var15); -- var11.addVertexWithUV(var23, var7 + var3, var25, var13, var15); -- var11.addVertexWithUV(var23, var7 + 0.0D, var25, var13, var19); -- var11.addVertexWithUV(var21, var7 + 0.0D, var27, var17, var19); -- var11.addVertexWithUV(var21, var7 + var3, var27, var17, var15); -+ double var19 = (double)var12.getInterpolatedV(par3 * 16.0D); -+ double var21 = par5 + 0.5D - 0.44999998807907104D; -+ double var23 = par5 + 0.5D + 0.44999998807907104D; -+ double var25 = par9 + 0.5D - 0.44999998807907104D; -+ double var27 = par9 + 0.5D + 0.44999998807907104D; -+ var11.addVertexWithUV(var21, par7 + par3, var25, var13, var15); -+ var11.addVertexWithUV(var21, par7 + 0.0D, var25, var13, var19); -+ var11.addVertexWithUV(var23, par7 + 0.0D, var27, var17, var19); -+ var11.addVertexWithUV(var23, par7 + par3, var27, var17, var15); -+ var11.addVertexWithUV(var23, par7 + par3, var27, var13, var15); -+ var11.addVertexWithUV(var23, par7 + 0.0D, var27, var13, var19); -+ var11.addVertexWithUV(var21, par7 + 0.0D, var25, var17, var19); -+ var11.addVertexWithUV(var21, par7 + par3, var25, var17, var15); -+ var11.addVertexWithUV(var21, par7 + par3, var27, var13, var15); -+ var11.addVertexWithUV(var21, par7 + 0.0D, var27, var13, var19); -+ var11.addVertexWithUV(var23, par7 + 0.0D, var25, var17, var19); -+ var11.addVertexWithUV(var23, par7 + par3, var25, var17, var15); -+ var11.addVertexWithUV(var23, par7 + par3, var25, var13, var15); -+ var11.addVertexWithUV(var23, par7 + 0.0D, var25, var13, var19); -+ var11.addVertexWithUV(var21, par7 + 0.0D, var27, var17, var19); -+ var11.addVertexWithUV(var21, par7 + par3, var27, var17, var15); - } - -- public boolean renderBlockLilyPad(Block var1, int var2, int var3, int var4) { -+ /** -+ * Render BlockLilyPad -+ */ -+ public boolean renderBlockLilyPad(Block par1Block, int par2, int par3, int par4) { - Tessellator var5 = Tessellator.instance; -- Icon var6 = this.getBlockIconFromSide(var1, 1); -- if(this.hasOverrideBlockTexture()) { -+ Icon var6 = this.getBlockIconFromSide(par1Block, 1); -+ -+ if (this.hasOverrideBlockTexture()) { - var6 = this.overrideBlockTexture; - } - - float var7 = 0.015625F; -- double var8 = (double)var6.getMinU(); -- double var10 = (double)var6.getMinV(); -- double var12 = (double)var6.getMaxU(); -- double var14 = (double)var6.getMaxV(); -- long var16 = (long)(var2 * 3129871) ^ (long)var4 * 116129781L ^ (long)var3; -- var16 = var16 * var16 * 42317861L + var16 * 11L; -- int var18 = (int)(var16 >> 16 & 3L); -- var5.setBrightness(var1.getMixedBrightnessForBlock(this.blockAccess, var2, var3, var4)); -- float var19 = (float)var2 + 0.5F; -- float var20 = (float)var4 + 0.5F; -- float var21 = (float)(var18 & 1) * 0.5F * (float)(1 - var18 / 2 % 2 * 2); -- float var22 = (float)(var18 + 1 & 1) * 0.5F * (float)(1 - (var18 + 1) / 2 % 2 * 2); -- var5.setColorOpaque_I(var1.getBlockColor()); -- var5.addVertexWithUV((double)(var19 + var21 - var22), (double)((float)var3 + var7), (double)(var20 + var21 + var22), var8, var10); -- var5.addVertexWithUV((double)(var19 + var21 + var22), (double)((float)var3 + var7), (double)(var20 - var21 + var22), var12, var10); -- var5.addVertexWithUV((double)(var19 - var21 + var22), (double)((float)var3 + var7), (double)(var20 - var21 - var22), var12, var14); -- var5.addVertexWithUV((double)(var19 - var21 - var22), (double)((float)var3 + var7), (double)(var20 + var21 - var22), var8, var14); -- var5.setColorOpaque_I((var1.getBlockColor() & 16711422) >> 1); -- var5.addVertexWithUV((double)(var19 - var21 - var22), (double)((float)var3 + var7), (double)(var20 + var21 - var22), var8, var14); -- var5.addVertexWithUV((double)(var19 - var21 + var22), (double)((float)var3 + var7), (double)(var20 - var21 - var22), var12, var14); -- var5.addVertexWithUV((double)(var19 + var21 + var22), (double)((float)var3 + var7), (double)(var20 - var21 + var22), var12, var10); -- var5.addVertexWithUV((double)(var19 + var21 - var22), (double)((float)var3 + var7), (double)(var20 + var21 + var22), var8, var10); -- return true; -+ var6 = CTMUtils.getTile(this, par1Block, par2, par3, par4, var6, var5); -+ -+ if (var6 == null) { -+ return false; -+ } else { -+ var5 = TessellatorUtils.getTessellator(var5, var6); -+ double var8 = (double)var6.getMinU(); -+ double var10 = (double)var6.getMinV(); -+ double var12 = (double)var6.getMaxU(); -+ double var14 = (double)var6.getMaxV(); -+ long var16 = (long)(par2 * 3129871) ^ (long)par4 * 116129781L ^ (long)par3; -+ var16 = var16 * var16 * 42317861L + var16 * 11L; -+ int var18 = (int)(var16 >> 16 & 3L); -+ var5.setBrightness(par1Block.getMixedBrightnessForBlock(this.blockAccess, par2, par3, par4)); -+ float var19 = (float)par2 + 0.5F; -+ float var20 = (float)par4 + 0.5F; -+ float var21 = (float)(var18 & 1) * 0.5F * (float)(1 - var18 / 2 % 2 * 2); -+ float var22 = (float)(var18 + 1 & 1) * 0.5F * (float)(1 - (var18 + 1) / 2 % 2 * 2); -+ var5.setColorOpaque_I(par1Block.getBlockColor()); -+ var5.addVertexWithUV((double)(var19 + var21 - var22), (double)((float)par3 + var7), (double)(var20 + var21 + var22), var8, var10); -+ var5.addVertexWithUV((double)(var19 + var21 + var22), (double)((float)par3 + var7), (double)(var20 - var21 + var22), var12, var10); -+ var5.addVertexWithUV((double)(var19 - var21 + var22), (double)((float)par3 + var7), (double)(var20 - var21 - var22), var12, var14); -+ var5.addVertexWithUV((double)(var19 - var21 - var22), (double)((float)par3 + var7), (double)(var20 + var21 - var22), var8, var14); -+ var5.setColorOpaque_I((par1Block.getBlockColor() & 16711422) >> 1); -+ var5.addVertexWithUV((double)(var19 - var21 - var22), (double)((float)par3 + var7), (double)(var20 + var21 - var22), var8, var14); -+ var5.addVertexWithUV((double)(var19 - var21 + var22), (double)((float)par3 + var7), (double)(var20 - var21 - var22), var12, var14); -+ var5.addVertexWithUV((double)(var19 + var21 + var22), (double)((float)par3 + var7), (double)(var20 - var21 + var22), var12, var10); -+ var5.addVertexWithUV((double)(var19 + var21 - var22), (double)((float)par3 + var7), (double)(var20 + var21 + var22), var8, var10); -+ return true; -+ } - } - -- public void renderBlockStemBig(BlockStem var1, int var2, int var3, double var4, double var6, double var8, double var10) { -+ /** -+ * Render block stem big -+ */ -+ public void renderBlockStemBig(BlockStem par1BlockStem, int par2, int par3, double par4, double par6, double par8, double par10) { - Tessellator var12 = Tessellator.instance; -- Icon var13 = var1.getStemIcon(); -- if(this.hasOverrideBlockTexture()) { -+ Icon var13 = par1BlockStem.getStemIcon(); -+ -+ if (this.hasOverrideBlockTexture()) { - var13 = this.overrideBlockTexture; - } - -@@ -2888,44 +3479,48 @@ - double var16 = (double)var13.getMinV(); - double var18 = (double)var13.getMaxU(); - double var20 = (double)var13.getMaxV(); -- double var22 = var6 + 0.5D - 0.5D; -- double var24 = var6 + 0.5D + 0.5D; -- double var26 = var10 + 0.5D - 0.5D; -- double var28 = var10 + 0.5D + 0.5D; -- double var30 = var6 + 0.5D; -- double var32 = var10 + 0.5D; -- if((var3 + 1) / 2 % 2 == 1) { -+ double var22 = par6 + 0.5D - 0.5D; -+ double var24 = par6 + 0.5D + 0.5D; -+ double var26 = par10 + 0.5D - 0.5D; -+ double var28 = par10 + 0.5D + 0.5D; -+ double var30 = par6 + 0.5D; -+ double var32 = par10 + 0.5D; -+ -+ if ((par3 + 1) / 2 % 2 == 1) { - double var34 = var18; - var18 = var14; - var14 = var34; - } - -- if(var3 < 2) { -- var12.addVertexWithUV(var22, var8 + var4, var32, var14, var16); -- var12.addVertexWithUV(var22, var8 + 0.0D, var32, var14, var20); -- var12.addVertexWithUV(var24, var8 + 0.0D, var32, var18, var20); -- var12.addVertexWithUV(var24, var8 + var4, var32, var18, var16); -- var12.addVertexWithUV(var24, var8 + var4, var32, var18, var16); -- var12.addVertexWithUV(var24, var8 + 0.0D, var32, var18, var20); -- var12.addVertexWithUV(var22, var8 + 0.0D, var32, var14, var20); -- var12.addVertexWithUV(var22, var8 + var4, var32, var14, var16); -+ if (par3 < 2) { -+ var12.addVertexWithUV(var22, par8 + par4, var32, var14, var16); -+ var12.addVertexWithUV(var22, par8 + 0.0D, var32, var14, var20); -+ var12.addVertexWithUV(var24, par8 + 0.0D, var32, var18, var20); -+ var12.addVertexWithUV(var24, par8 + par4, var32, var18, var16); -+ var12.addVertexWithUV(var24, par8 + par4, var32, var18, var16); -+ var12.addVertexWithUV(var24, par8 + 0.0D, var32, var18, var20); -+ var12.addVertexWithUV(var22, par8 + 0.0D, var32, var14, var20); -+ var12.addVertexWithUV(var22, par8 + par4, var32, var14, var16); - } else { -- var12.addVertexWithUV(var30, var8 + var4, var28, var14, var16); -- var12.addVertexWithUV(var30, var8 + 0.0D, var28, var14, var20); -- var12.addVertexWithUV(var30, var8 + 0.0D, var26, var18, var20); -- var12.addVertexWithUV(var30, var8 + var4, var26, var18, var16); -- var12.addVertexWithUV(var30, var8 + var4, var26, var18, var16); -- var12.addVertexWithUV(var30, var8 + 0.0D, var26, var18, var20); -- var12.addVertexWithUV(var30, var8 + 0.0D, var28, var14, var20); -- var12.addVertexWithUV(var30, var8 + var4, var28, var14, var16); -+ var12.addVertexWithUV(var30, par8 + par4, var28, var14, var16); -+ var12.addVertexWithUV(var30, par8 + 0.0D, var28, var14, var20); -+ var12.addVertexWithUV(var30, par8 + 0.0D, var26, var18, var20); -+ var12.addVertexWithUV(var30, par8 + par4, var26, var18, var16); -+ var12.addVertexWithUV(var30, par8 + par4, var26, var18, var16); -+ var12.addVertexWithUV(var30, par8 + 0.0D, var26, var18, var20); -+ var12.addVertexWithUV(var30, par8 + 0.0D, var28, var14, var20); -+ var12.addVertexWithUV(var30, par8 + par4, var28, var14, var16); - } -- - } - -- public void renderBlockCropsImpl(Block var1, int var2, double var3, double var5, double var7) { -+ /** -+ * Render block crops implementation -+ */ -+ public void renderBlockCropsImpl(Block par1Block, int par2, double par3, double par5, double par7) { - Tessellator var9 = Tessellator.instance; -- Icon var10 = this.getBlockIconFromSideAndMetadata(var1, 0, var2); -- if(this.hasOverrideBlockTexture()) { -+ Icon var10 = this.getBlockIconFromSideAndMetadata(par1Block, 0, par2); -+ -+ if (this.hasOverrideBlockTexture()) { - var10 = this.overrideBlockTexture; - } - -@@ -2933,58 +3528,62 @@ - double var13 = (double)var10.getMinV(); - double var15 = (double)var10.getMaxU(); - double var17 = (double)var10.getMaxV(); -- double var19 = var3 + 0.5D - 0.25D; -- double var21 = var3 + 0.5D + 0.25D; -- double var23 = var7 + 0.5D - 0.5D; -- double var25 = var7 + 0.5D + 0.5D; -- var9.addVertexWithUV(var19, var5 + 1.0D, var23, var11, var13); -- var9.addVertexWithUV(var19, var5 + 0.0D, var23, var11, var17); -- var9.addVertexWithUV(var19, var5 + 0.0D, var25, var15, var17); -- var9.addVertexWithUV(var19, var5 + 1.0D, var25, var15, var13); -- var9.addVertexWithUV(var19, var5 + 1.0D, var25, var11, var13); -- var9.addVertexWithUV(var19, var5 + 0.0D, var25, var11, var17); -- var9.addVertexWithUV(var19, var5 + 0.0D, var23, var15, var17); -- var9.addVertexWithUV(var19, var5 + 1.0D, var23, var15, var13); -- var9.addVertexWithUV(var21, var5 + 1.0D, var25, var11, var13); -- var9.addVertexWithUV(var21, var5 + 0.0D, var25, var11, var17); -- var9.addVertexWithUV(var21, var5 + 0.0D, var23, var15, var17); -- var9.addVertexWithUV(var21, var5 + 1.0D, var23, var15, var13); -- var9.addVertexWithUV(var21, var5 + 1.0D, var23, var11, var13); -- var9.addVertexWithUV(var21, var5 + 0.0D, var23, var11, var17); -- var9.addVertexWithUV(var21, var5 + 0.0D, var25, var15, var17); -- var9.addVertexWithUV(var21, var5 + 1.0D, var25, var15, var13); -- var19 = var3 + 0.5D - 0.5D; -- var21 = var3 + 0.5D + 0.5D; -- var23 = var7 + 0.5D - 0.25D; -- var25 = var7 + 0.5D + 0.25D; -- var9.addVertexWithUV(var19, var5 + 1.0D, var23, var11, var13); -- var9.addVertexWithUV(var19, var5 + 0.0D, var23, var11, var17); -- var9.addVertexWithUV(var21, var5 + 0.0D, var23, var15, var17); -- var9.addVertexWithUV(var21, var5 + 1.0D, var23, var15, var13); -- var9.addVertexWithUV(var21, var5 + 1.0D, var23, var11, var13); -- var9.addVertexWithUV(var21, var5 + 0.0D, var23, var11, var17); -- var9.addVertexWithUV(var19, var5 + 0.0D, var23, var15, var17); -- var9.addVertexWithUV(var19, var5 + 1.0D, var23, var15, var13); -- var9.addVertexWithUV(var21, var5 + 1.0D, var25, var11, var13); -- var9.addVertexWithUV(var21, var5 + 0.0D, var25, var11, var17); -- var9.addVertexWithUV(var19, var5 + 0.0D, var25, var15, var17); -- var9.addVertexWithUV(var19, var5 + 1.0D, var25, var15, var13); -- var9.addVertexWithUV(var19, var5 + 1.0D, var25, var11, var13); -- var9.addVertexWithUV(var19, var5 + 0.0D, var25, var11, var17); -- var9.addVertexWithUV(var21, var5 + 0.0D, var25, var15, var17); -- var9.addVertexWithUV(var21, var5 + 1.0D, var25, var15, var13); -+ double var19 = par3 + 0.5D - 0.25D; -+ double var21 = par3 + 0.5D + 0.25D; -+ double var23 = par7 + 0.5D - 0.5D; -+ double var25 = par7 + 0.5D + 0.5D; -+ var9.addVertexWithUV(var19, par5 + 1.0D, var23, var11, var13); -+ var9.addVertexWithUV(var19, par5 + 0.0D, var23, var11, var17); -+ var9.addVertexWithUV(var19, par5 + 0.0D, var25, var15, var17); -+ var9.addVertexWithUV(var19, par5 + 1.0D, var25, var15, var13); -+ var9.addVertexWithUV(var19, par5 + 1.0D, var25, var11, var13); -+ var9.addVertexWithUV(var19, par5 + 0.0D, var25, var11, var17); -+ var9.addVertexWithUV(var19, par5 + 0.0D, var23, var15, var17); -+ var9.addVertexWithUV(var19, par5 + 1.0D, var23, var15, var13); -+ var9.addVertexWithUV(var21, par5 + 1.0D, var25, var11, var13); -+ var9.addVertexWithUV(var21, par5 + 0.0D, var25, var11, var17); -+ var9.addVertexWithUV(var21, par5 + 0.0D, var23, var15, var17); -+ var9.addVertexWithUV(var21, par5 + 1.0D, var23, var15, var13); -+ var9.addVertexWithUV(var21, par5 + 1.0D, var23, var11, var13); -+ var9.addVertexWithUV(var21, par5 + 0.0D, var23, var11, var17); -+ var9.addVertexWithUV(var21, par5 + 0.0D, var25, var15, var17); -+ var9.addVertexWithUV(var21, par5 + 1.0D, var25, var15, var13); -+ var19 = par3 + 0.5D - 0.5D; -+ var21 = par3 + 0.5D + 0.5D; -+ var23 = par7 + 0.5D - 0.25D; -+ var25 = par7 + 0.5D + 0.25D; -+ var9.addVertexWithUV(var19, par5 + 1.0D, var23, var11, var13); -+ var9.addVertexWithUV(var19, par5 + 0.0D, var23, var11, var17); -+ var9.addVertexWithUV(var21, par5 + 0.0D, var23, var15, var17); -+ var9.addVertexWithUV(var21, par5 + 1.0D, var23, var15, var13); -+ var9.addVertexWithUV(var21, par5 + 1.0D, var23, var11, var13); -+ var9.addVertexWithUV(var21, par5 + 0.0D, var23, var11, var17); -+ var9.addVertexWithUV(var19, par5 + 0.0D, var23, var15, var17); -+ var9.addVertexWithUV(var19, par5 + 1.0D, var23, var15, var13); -+ var9.addVertexWithUV(var21, par5 + 1.0D, var25, var11, var13); -+ var9.addVertexWithUV(var21, par5 + 0.0D, var25, var11, var17); -+ var9.addVertexWithUV(var19, par5 + 0.0D, var25, var15, var17); -+ var9.addVertexWithUV(var19, par5 + 1.0D, var25, var15, var13); -+ var9.addVertexWithUV(var19, par5 + 1.0D, var25, var11, var13); -+ var9.addVertexWithUV(var19, par5 + 0.0D, var25, var11, var17); -+ var9.addVertexWithUV(var21, par5 + 0.0D, var25, var15, var17); -+ var9.addVertexWithUV(var21, par5 + 1.0D, var25, var15, var13); - } - -- public boolean renderBlockFluids(Block var1, int var2, int var3, int var4) { -+ /** -+ * Renders a block based on the BlockFluids class at the given coordinates -+ */ -+ public boolean renderBlockFluids(Block par1Block, int par2, int par3, int par4) { - Tessellator var5 = Tessellator.instance; -- int var6 = var1.colorMultiplier(this.blockAccess, var2, var3, var4); -+ int var6 = par1Block.colorMultiplier(this.blockAccess, par2, par3, par4); - float var7 = (float)(var6 >> 16 & 255) / 255.0F; - float var8 = (float)(var6 >> 8 & 255) / 255.0F; - float var9 = (float)(var6 & 255) / 255.0F; -- boolean var10 = var1.shouldSideBeRendered(this.blockAccess, var2, var3 + 1, var4, 1); -- boolean var11 = var1.shouldSideBeRendered(this.blockAccess, var2, var3 - 1, var4, 0); -- boolean[] var12 = new boolean[]{var1.shouldSideBeRendered(this.blockAccess, var2, var3, var4 - 1, 2), var1.shouldSideBeRendered(this.blockAccess, var2, var3, var4 + 1, 3), var1.shouldSideBeRendered(this.blockAccess, var2 - 1, var3, var4, 4), var1.shouldSideBeRendered(this.blockAccess, var2 + 1, var3, var4, 5)}; -- if(!var10 && !var11 && !var12[0] && !var12[1] && !var12[2] && !var12[3]) { -+ boolean var10 = RenderPass.shouldSideBeRendered(par1Block, this.blockAccess, par2, par3 + 1, par4, 1); -+ boolean var11 = RenderPass.shouldSideBeRendered(par1Block, this.blockAccess, par2, par3 - 1, par4, 0); -+ boolean[] var12 = new boolean[] {RenderPass.shouldSideBeRendered(par1Block, this.blockAccess, par2, par3, par4 - 1, 2), RenderPass.shouldSideBeRendered(par1Block, this.blockAccess, par2, par3, par4 + 1, 3), RenderPass.shouldSideBeRendered(par1Block, this.blockAccess, par2 - 1, par3, par4, 4), RenderPass.shouldSideBeRendered(par1Block, this.blockAccess, par2 + 1, par3, par4, 5)}; -+ -+ if (!var10 && !var11 && !var12[0] && !var12[1] && !var12[2] && !var12[3]) { - return false; - } else { - boolean var13 = false; -@@ -2994,37 +3593,40 @@ - float var17 = 0.6F; - double var18 = 0.0D; - double var20 = 1.0D; -- Material var22 = var1.blockMaterial; -- int var23 = this.blockAccess.getBlockMetadata(var2, var3, var4); -- double var24 = (double)this.getFluidHeight(var2, var3, var4, var22); -- double var26 = (double)this.getFluidHeight(var2, var3, var4 + 1, var22); -- double var28 = (double)this.getFluidHeight(var2 + 1, var3, var4 + 1, var22); -- double var30 = (double)this.getFluidHeight(var2 + 1, var3, var4, var22); -- double var32 = (double)0.001F; -- float var52; -- float var53; -+ Material var22 = par1Block.blockMaterial; -+ int var23 = this.blockAccess.getBlockMetadata(par2, par3, par4); -+ double var24 = (double)this.getFluidHeight(par2, par3, par4, var22); -+ double var26 = (double)this.getFluidHeight(par2, par3, par4 + 1, var22); -+ double var28 = (double)this.getFluidHeight(par2 + 1, par3, par4 + 1, var22); -+ double var30 = (double)this.getFluidHeight(par2 + 1, par3, par4, var22); -+ double var32 = 0.0010000000474974513D; - float var54; -- if(this.renderAllFaces || var10) { -+ float var53; -+ float var52; -+ -+ if (this.renderAllFaces || var10) { - var13 = true; -- Icon var34 = this.getBlockIconFromSideAndMetadata(var1, 1, var23); -- float var35 = (float)BlockFluid.getFlowDirection(this.blockAccess, var2, var3, var4, var22); -- if(var35 > -999.0F) { -- var34 = this.getBlockIconFromSideAndMetadata(var1, 2, var23); -+ Icon var34 = this.getBlockIconFromSideAndMetadata(par1Block, 1, var23); -+ float var35 = (float)BlockFluid.getFlowDirection(this.blockAccess, par2, par3, par4, var22); -+ -+ if (var35 > -999.0F) { -+ var34 = this.getBlockIconFromSideAndMetadata(par1Block, 2, var23); - } - - var24 -= var32; - var26 -= var32; - var28 -= var32; - var30 -= var32; -- double var36; - double var38; -- double var40; -+ double var36; - double var42; -- double var44; -+ double var40; - double var46; -- double var48; -+ double var44; - double var50; -- if(var35 < -999.0F) { -+ double var48; -+ -+ if (var35 < -999.0F) { - var36 = (double)var34.getInterpolatedU(0.0D); - var44 = (double)var34.getInterpolatedV(0.0D); - var38 = var36; -@@ -3047,78 +3649,81 @@ - var50 = (double)var34.getInterpolatedV((double)(8.0F + (-var53 - var52) * 16.0F)); - } - -- var5.setBrightness(var1.getMixedBrightnessForBlock(this.blockAccess, var2, var3, var4)); -+ var5.setBrightness(par1Block.getMixedBrightnessForBlock(this.blockAccess, par2, par3, par4)); - var52 = 1.0F; - var5.setColorOpaque_F(var15 * var52 * var7, var15 * var52 * var8, var15 * var52 * var9); -- var5.addVertexWithUV((double)(var2 + 0), (double)var3 + var24, (double)(var4 + 0), var36, var44); -- var5.addVertexWithUV((double)(var2 + 0), (double)var3 + var26, (double)(var4 + 1), var38, var46); -- var5.addVertexWithUV((double)(var2 + 1), (double)var3 + var28, (double)(var4 + 1), var40, var48); -- var5.addVertexWithUV((double)(var2 + 1), (double)var3 + var30, (double)(var4 + 0), var42, var50); -+ var5.addVertexWithUV((double)(par2 + 0), (double)par3 + var24, (double)(par4 + 0), var36, var44); -+ var5.addVertexWithUV((double)(par2 + 0), (double)par3 + var26, (double)(par4 + 1), var38, var46); -+ var5.addVertexWithUV((double)(par2 + 1), (double)par3 + var28, (double)(par4 + 1), var40, var48); -+ var5.addVertexWithUV((double)(par2 + 1), (double)par3 + var30, (double)(par4 + 0), var42, var50); - } - -- if(this.renderAllFaces || var11) { -- var5.setBrightness(var1.getMixedBrightnessForBlock(this.blockAccess, var2, var3 - 1, var4)); -- float var57 = 1.0F; -- var5.setColorOpaque_F(var14 * var57, var14 * var57, var14 * var57); -- this.renderFaceYNeg(var1, (double)var2, (double)var3 + var32, (double)var4, this.getBlockIconFromSide(var1, 0)); -+ if (this.renderAllFaces || var11) { -+ var5.setBrightness(par1Block.getMixedBrightnessForBlock(this.blockAccess, par2, par3 - 1, par4)); -+ float var58 = 1.0F; -+ var5.setColorOpaque_F(var14 * var58 * var7, var14 * var58 * var8, var14 * var58 * var9); -+ this.renderFaceYNeg(par1Block, (double)par2, (double)par3 + var32, (double)par4, this.getBlockIconFromSide(par1Block, 0)); - var13 = true; - } - -- for(int var59 = 0; var59 < 4; ++var59) { -- int var58 = var2; -- int var37 = var4; -- if(var59 == 0) { -- var37 = var4 - 1; -+ for (int var57 = 0; var57 < 4; ++var57) { -+ int var59 = par2; -+ int var37 = par4; -+ -+ if (var57 == 0) { -+ var37 = par4 - 1; - } - -- if(var59 == 1) { -+ if (var57 == 1) { - ++var37; - } - -- if(var59 == 2) { -- var58 = var2 - 1; -- } -- -- if(var59 == 3) { -- ++var58; -- } -- -- Icon var60 = this.getBlockIconFromSideAndMetadata(var1, var59 + 2, var23); -- if(this.renderAllFaces || var12[var59]) { -+ if (var57 == 2) { -+ var59 = par2 - 1; -+ } -+ -+ if (var57 == 3) { -+ ++var59; -+ } -+ -+ Icon var60 = this.getBlockIconFromSideAndMetadata(par1Block, var57 + 2, var23); -+ -+ if (this.renderAllFaces || var12[var57]) { - double var39; -- double var41; - double var43; -- double var45; -+ double var41; - double var47; -+ double var45; - double var49; -- if(var59 == 0) { -+ -+ if (var57 == 0) { - var39 = var24; - var41 = var30; -- var43 = (double)var2; -- var47 = (double)(var2 + 1); -- var45 = (double)var4 + var32; -- var49 = (double)var4 + var32; -- } else if(var59 == 1) { -+ var43 = (double)par2; -+ var47 = (double)(par2 + 1); -+ var45 = (double)par4 + var32; -+ var49 = (double)par4 + var32; -+ } else if (var57 == 1) { - var39 = var28; - var41 = var26; -- var43 = (double)(var2 + 1); -- var47 = (double)var2; -- var45 = (double)(var4 + 1) - var32; -- var49 = (double)(var4 + 1) - var32; -- } else if(var59 == 2) { -+ var43 = (double)(par2 + 1); -+ var47 = (double)par2; -+ var45 = (double)(par4 + 1) - var32; -+ var49 = (double)(par4 + 1) - var32; -+ } else if (var57 == 2) { - var39 = var26; - var41 = var24; -- var43 = (double)var2 + var32; -- var47 = (double)var2 + var32; -- var45 = (double)(var4 + 1); -- var49 = (double)var4; -+ var43 = (double)par2 + var32; -+ var47 = (double)par2 + var32; -+ var45 = (double)(par4 + 1); -+ var49 = (double)par4; - } else { - var39 = var30; - var41 = var28; -- var43 = (double)(var2 + 1) - var32; -- var47 = (double)(var2 + 1) - var32; -- var45 = (double)var4; -- var49 = (double)(var4 + 1); -+ var43 = (double)(par2 + 1) - var32; -+ var47 = (double)(par2 + 1) - var32; -+ var45 = (double)par4; -+ var49 = (double)(par4 + 1); - } - - var13 = true; -@@ -3127,19 +3732,20 @@ - var53 = var60.getInterpolatedV((1.0D - var39) * 16.0D * 0.5D); - var54 = var60.getInterpolatedV((1.0D - var41) * 16.0D * 0.5D); - float var55 = var60.getInterpolatedV(8.0D); -- var5.setBrightness(var1.getMixedBrightnessForBlock(this.blockAccess, var58, var3, var37)); -+ var5.setBrightness(par1Block.getMixedBrightnessForBlock(this.blockAccess, var59, par3, var37)); - float var56 = 1.0F; -- if(var59 < 2) { -+ -+ if (var57 < 2) { - var56 *= var16; - } else { - var56 *= var17; - } - - var5.setColorOpaque_F(var15 * var56 * var7, var15 * var56 * var8, var15 * var56 * var9); -- var5.addVertexWithUV(var43, (double)var3 + var39, var45, (double)var51, (double)var53); -- var5.addVertexWithUV(var47, (double)var3 + var41, var49, (double)var52, (double)var54); -- var5.addVertexWithUV(var47, (double)(var3 + 0), var49, (double)var52, (double)var55); -- var5.addVertexWithUV(var43, (double)(var3 + 0), var45, (double)var51, (double)var55); -+ var5.addVertexWithUV(var43, (double)par3 + var39, var45, (double)var51, (double)var53); -+ var5.addVertexWithUV(var47, (double)par3 + var41, var49, (double)var52, (double)var54); -+ var5.addVertexWithUV(var47, (double)(par3 + 0), var49, (double)var52, (double)var55); -+ var5.addVertexWithUV(var43, (double)(par3 + 0), var45, (double)var51, (double)var55); - } - } - -@@ -3149,98 +3755,116 @@ - } - } - -- private float getFluidHeight(int var1, int var2, int var3, Material var4) { -+ /** -+ * Get fluid height -+ */ -+ private float getFluidHeight(int par1, int par2, int par3, Material par4Material) { - int var5 = 0; - float var6 = 0.0F; - -- for(int var7 = 0; var7 < 4; ++var7) { -- int var8 = var1 - (var7 & 1); -- int var10 = var3 - (var7 >> 1 & 1); -- if(this.blockAccess.getBlockMaterial(var8, var2 + 1, var10) == var4) { -+ for (int var7 = 0; var7 < 4; ++var7) { -+ int var8 = par1 - (var7 & 1); -+ int var10 = par3 - (var7 >> 1 & 1); -+ -+ if (this.blockAccess.getBlockMaterial(var8, par2 + 1, var10) == par4Material) { - return 1.0F; - } - -- Material var11 = this.blockAccess.getBlockMaterial(var8, var2, var10); -- if(var11 != var4) { -- if(!var11.isSolid()) { -- ++var6; -- ++var5; -- } -- } else { -- int var12 = this.blockAccess.getBlockMetadata(var8, var2, var10); -- if(var12 >= 8 || var12 == 0) { -+ Material var11 = this.blockAccess.getBlockMaterial(var8, par2, var10); -+ -+ if (var11 == par4Material) { -+ int var12 = this.blockAccess.getBlockMetadata(var8, par2, var10); -+ -+ if (var12 >= 8 || var12 == 0) { - var6 += BlockFluid.getFluidHeightPercent(var12) * 10.0F; - var5 += 10; - } - - var6 += BlockFluid.getFluidHeightPercent(var12); - ++var5; -+ } else if (!var11.isSolid()) { -+ ++var6; -+ ++var5; - } - } - - return 1.0F - var6 / (float)var5; - } - -- public void renderBlockSandFalling(Block var1, World var2, int var3, int var4, int var5, int var6) { -+ /** -+ * Renders a falling sand block -+ */ -+ public void renderBlockSandFalling(Block par1Block, World par2World, int par3, int par4, int par5, int par6) { - float var7 = 0.5F; - float var8 = 1.0F; - float var9 = 0.8F; - float var10 = 0.6F; - Tessellator var11 = Tessellator.instance; - var11.startDrawingQuads(); -- var11.setBrightness(var1.getMixedBrightnessForBlock(var2, var3, var4, var5)); -+ var11.setBrightness(par1Block.getMixedBrightnessForBlock(par2World, par3, par4, par5)); - float var12 = 1.0F; - float var13 = 1.0F; -- if(var13 < var12) { -- var13 = var12; -- } -- -- var11.setColorOpaque_F(var7 * var13, var7 * var13, var7 * var13); -- this.renderFaceYNeg(var1, -0.5D, -0.5D, -0.5D, this.getBlockIconFromSideAndMetadata(var1, 0, var6)); -- var13 = 1.0F; -- if(var13 < var12) { -- var13 = var12; -- } -- -- var11.setColorOpaque_F(var8 * var13, var8 * var13, var8 * var13); -- this.renderFaceYPos(var1, -0.5D, -0.5D, -0.5D, this.getBlockIconFromSideAndMetadata(var1, 1, var6)); -- var13 = 1.0F; -- if(var13 < var12) { -- var13 = var12; -- } -- -- var11.setColorOpaque_F(var9 * var13, var9 * var13, var9 * var13); -- this.renderFaceZNeg(var1, -0.5D, -0.5D, -0.5D, this.getBlockIconFromSideAndMetadata(var1, 2, var6)); -- var13 = 1.0F; -- if(var13 < var12) { -- var13 = var12; -- } -- -- var11.setColorOpaque_F(var9 * var13, var9 * var13, var9 * var13); -- this.renderFaceZPos(var1, -0.5D, -0.5D, -0.5D, this.getBlockIconFromSideAndMetadata(var1, 3, var6)); -- var13 = 1.0F; -- if(var13 < var12) { -- var13 = var12; -- } -- -- var11.setColorOpaque_F(var10 * var13, var10 * var13, var10 * var13); -- this.renderFaceXNeg(var1, -0.5D, -0.5D, -0.5D, this.getBlockIconFromSideAndMetadata(var1, 4, var6)); -- var13 = 1.0F; -- if(var13 < var12) { -- var13 = var12; -- } -- -- var11.setColorOpaque_F(var10 * var13, var10 * var13, var10 * var13); -- this.renderFaceXPos(var1, -0.5D, -0.5D, -0.5D, this.getBlockIconFromSideAndMetadata(var1, 5, var6)); -+ -+ if (var13 < var12) { -+ var13 = var12; -+ } -+ -+ Colorizer.setColorF(ColorizeBlock.colorizeBlock(par1Block, par3, par4, par5, 0)); -+ var11.setColorOpaque_F(Colorizer.setColor[0] * var13, Colorizer.setColor[1] * var13, Colorizer.setColor[2] * var13); -+ this.renderFaceYNeg(par1Block, -0.5D, -0.5D, -0.5D, this.getBlockIconFromSideAndMetadata(par1Block, 0, par6)); -+ var13 = 1.0F; -+ -+ if (var13 < var12) { -+ var13 = var12; -+ } -+ -+ var11.setColorOpaque_F(Colorizer.setColor[0] * var13, Colorizer.setColor[1] * var13, Colorizer.setColor[2] * var13); -+ this.renderFaceYPos(par1Block, -0.5D, -0.5D, -0.5D, this.getBlockIconFromSideAndMetadata(par1Block, 1, par6)); -+ var13 = 1.0F; -+ -+ if (var13 < var12) { -+ var13 = var12; -+ } -+ -+ var11.setColorOpaque_F(Colorizer.setColor[0] * var13, Colorizer.setColor[1] * var13, Colorizer.setColor[2] * var13); -+ this.renderFaceZNeg(par1Block, -0.5D, -0.5D, -0.5D, this.getBlockIconFromSideAndMetadata(par1Block, 2, par6)); -+ var13 = 1.0F; -+ -+ if (var13 < var12) { -+ var13 = var12; -+ } -+ -+ var11.setColorOpaque_F(Colorizer.setColor[0] * var13, Colorizer.setColor[1] * var13, Colorizer.setColor[2] * var13); -+ this.renderFaceZPos(par1Block, -0.5D, -0.5D, -0.5D, this.getBlockIconFromSideAndMetadata(par1Block, 3, par6)); -+ var13 = 1.0F; -+ -+ if (var13 < var12) { -+ var13 = var12; -+ } -+ -+ var11.setColorOpaque_F(Colorizer.setColor[0] * var13, Colorizer.setColor[1] * var13, Colorizer.setColor[2] * var13); -+ this.renderFaceXNeg(par1Block, -0.5D, -0.5D, -0.5D, this.getBlockIconFromSideAndMetadata(par1Block, 4, par6)); -+ var13 = 1.0F; -+ -+ if (var13 < var12) { -+ var13 = var12; -+ } -+ -+ var11.setColorOpaque_F(Colorizer.setColor[0] * var13, Colorizer.setColor[1] * var13, Colorizer.setColor[2] * var13); -+ this.renderFaceXPos(par1Block, -0.5D, -0.5D, -0.5D, this.getBlockIconFromSideAndMetadata(par1Block, 5, par6)); - var11.draw(); - } - -- public boolean renderStandardBlock(Block var1, int var2, int var3, int var4) { -- int var5 = var1.colorMultiplier(this.blockAccess, var2, var3, var4); -+ /** -+ * Renders a standard cube block at the given coordinates -+ */ -+ public boolean renderStandardBlock(Block par1Block, int par2, int par3, int par4) { -+ int var5 = par1Block.colorMultiplier(this.blockAccess, par2, par3, par4); - float var6 = (float)(var5 >> 16 & 255) / 255.0F; - float var7 = (float)(var5 >> 8 & 255) / 255.0F; - float var8 = (float)(var5 & 255) / 255.0F; -- if(EntityRenderer.anaglyphEnable) { -+ -+ if (EntityRenderer.anaglyphEnable) { - float var9 = (var6 * 30.0F + var7 * 59.0F + var8 * 11.0F) / 100.0F; - float var10 = (var6 * 30.0F + var7 * 70.0F) / 100.0F; - float var11 = (var6 * 30.0F + var8 * 70.0F) / 100.0F; -@@ -3249,23 +3873,29 @@ - var8 = var11; - } - -- return Minecraft.isAmbientOcclusionEnabled() && Block.lightValue[var1.blockID] == 0 ? (this.partialRenderBounds ? this.renderStandardBlockWithAmbientOcclusionPartial(var1, var2, var3, var4, var6, var7, var8) : this.renderStandardBlockWithAmbientOcclusion(var1, var2, var3, var4, var6, var7, var8)) : this.renderStandardBlockWithColorMultiplier(var1, var2, var3, var4, var6, var7, var8); -+ // Spout Start -+ return Configuration.ambientOcclusion && Block.lightValue[par1Block.blockID] == 0 ? (this.partialRenderBounds ? this.renderStandardBlockWithAmbientOcclusionPartial(par1Block, par2, par3, par4, var6, var7, var8) : this.renderStandardBlockWithAmbientOcclusion(par1Block, par2, par3, par4, var6, var7, var8)) : this.renderStandardBlockWithColorMultiplier(par1Block, par2, par3, par4, var6, var7, var8); -+ // Spout End - } - -- public boolean renderBlockLog(Block var1, int var2, int var3, int var4) { -- int var5 = this.blockAccess.getBlockMetadata(var2, var3, var4); -+ /** -+ * Renders a log block at the given coordinates -+ */ -+ public boolean renderBlockLog(Block par1Block, int par2, int par3, int par4) { -+ int var5 = this.blockAccess.getBlockMetadata(par2, par3, par4); - int var6 = var5 & 12; -- if(var6 == 4) { -+ -+ if (var6 == 4) { - this.uvRotateEast = 1; - this.uvRotateWest = 1; - this.uvRotateTop = 1; - this.uvRotateBottom = 1; -- } else if(var6 == 8) { -+ } else if (var6 == 8) { - this.uvRotateSouth = 1; - this.uvRotateNorth = 1; - } - -- boolean var7 = this.renderStandardBlock(var1, var2, var3, var4); -+ boolean var7 = this.renderStandardBlock(par1Block, par2, par3, par4); - this.uvRotateSouth = 0; - this.uvRotateEast = 0; - this.uvRotateWest = 0; -@@ -3275,19 +3905,20 @@ - return var7; - } - -- public boolean renderBlockQuartz(Block var1, int var2, int var3, int var4) { -- int var5 = this.blockAccess.getBlockMetadata(var2, var3, var4); -- if(var5 == 3) { -+ public boolean renderBlockQuartz(Block par1Block, int par2, int par3, int par4) { -+ int var5 = this.blockAccess.getBlockMetadata(par2, par3, par4); -+ -+ if (var5 == 3) { - this.uvRotateEast = 1; - this.uvRotateWest = 1; - this.uvRotateTop = 1; - this.uvRotateBottom = 1; -- } else if(var5 == 4) { -+ } else if (var5 == 4) { - this.uvRotateSouth = 1; - this.uvRotateNorth = 1; - } - -- boolean var6 = this.renderStandardBlock(var1, var2, var3, var4); -+ boolean var6 = this.renderStandardBlock(par1Block, par2, par3, par4); - this.uvRotateSouth = 0; - this.uvRotateEast = 0; - this.uvRotateWest = 0; -@@ -3297,7 +3928,7 @@ - return var6; - } - -- public boolean renderStandardBlockWithAmbientOcclusion(Block var1, int var2, int var3, int var4, float var5, float var6, float var7) { -+ public boolean renderStandardBlockWithAmbientOcclusion(Block par1Block, int par2, int par3, int par4, float par5, float par6, float par7) { - this.enableAO = true; - boolean var8 = false; - float var9 = 0.0F; -@@ -3305,80 +3936,84 @@ - float var11 = 0.0F; - float var12 = 0.0F; - boolean var13 = true; -- int var14 = var1.getMixedBrightnessForBlock(this.blockAccess, var2, var3, var4); -+ int var14 = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2, par3, par4); - Tessellator var15 = Tessellator.instance; - var15.setBrightness(983055); -- if(this.getBlockIcon(var1).getIconName().equals("grass_top")) { -+ -+ if (this.getBlockIcon(par1Block).getIconName().equals("grass_top")) { - var13 = false; -- } else if(this.hasOverrideBlockTexture()) { -+ } else if (this.hasOverrideBlockTexture()) { - var13 = false; - } - -- boolean var16; - boolean var17; -- boolean var18; -+ boolean var16; - boolean var19; -- int var20; -+ boolean var18; - float var21; -- if(this.renderAllFaces || var1.shouldSideBeRendered(this.blockAccess, var2, var3 - 1, var4, 0)) { -- if(this.renderMinY <= 0.0D) { -- --var3; -+ int var20; -+ -+ if (this.renderAllFaces || RenderPass.shouldSideBeRendered(par1Block, this.blockAccess, par2, par3 - 1, par4, 0)) { -+ if (this.renderMinY <= 0.0D) { -+ --par3; - } - -- this.aoBrightnessXYNN = var1.getMixedBrightnessForBlock(this.blockAccess, var2 - 1, var3, var4); -- this.aoBrightnessYZNN = var1.getMixedBrightnessForBlock(this.blockAccess, var2, var3, var4 - 1); -- this.aoBrightnessYZNP = var1.getMixedBrightnessForBlock(this.blockAccess, var2, var3, var4 + 1); -- this.aoBrightnessXYPN = var1.getMixedBrightnessForBlock(this.blockAccess, var2 + 1, var3, var4); -- this.aoLightValueScratchXYNN = var1.getAmbientOcclusionLightValue(this.blockAccess, var2 - 1, var3, var4); -- this.aoLightValueScratchYZNN = var1.getAmbientOcclusionLightValue(this.blockAccess, var2, var3, var4 - 1); -- this.aoLightValueScratchYZNP = var1.getAmbientOcclusionLightValue(this.blockAccess, var2, var3, var4 + 1); -- this.aoLightValueScratchXYPN = var1.getAmbientOcclusionLightValue(this.blockAccess, var2 + 1, var3, var4); -- var16 = Block.canBlockGrass[this.blockAccess.getBlockId(var2 + 1, var3 - 1, var4)]; -- var17 = Block.canBlockGrass[this.blockAccess.getBlockId(var2 - 1, var3 - 1, var4)]; -- var18 = Block.canBlockGrass[this.blockAccess.getBlockId(var2, var3 - 1, var4 + 1)]; -- var19 = Block.canBlockGrass[this.blockAccess.getBlockId(var2, var3 - 1, var4 - 1)]; -- if(!var19 && !var17) { -+ this.aoBrightnessXYNN = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2 - 1, par3, par4); -+ this.aoBrightnessYZNN = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2, par3, par4 - 1); -+ this.aoBrightnessYZNP = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2, par3, par4 + 1); -+ this.aoBrightnessXYPN = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2 + 1, par3, par4); -+ this.aoLightValueScratchXYNN = par1Block.getAmbientOcclusionLightValue(this.blockAccess, par2 - 1, par3, par4); -+ this.aoLightValueScratchYZNN = par1Block.getAmbientOcclusionLightValue(this.blockAccess, par2, par3, par4 - 1); -+ this.aoLightValueScratchYZNP = par1Block.getAmbientOcclusionLightValue(this.blockAccess, par2, par3, par4 + 1); -+ this.aoLightValueScratchXYPN = par1Block.getAmbientOcclusionLightValue(this.blockAccess, par2 + 1, par3, par4); -+ var16 = Block.canBlockGrass[this.blockAccess.getBlockId(par2 + 1, par3 - 1, par4)]; -+ var17 = Block.canBlockGrass[this.blockAccess.getBlockId(par2 - 1, par3 - 1, par4)]; -+ var18 = Block.canBlockGrass[this.blockAccess.getBlockId(par2, par3 - 1, par4 + 1)]; -+ var19 = Block.canBlockGrass[this.blockAccess.getBlockId(par2, par3 - 1, par4 - 1)]; -+ -+ if (!var19 && !var17) { - this.aoLightValueScratchXYZNNN = this.aoLightValueScratchXYNN; - this.aoBrightnessXYZNNN = this.aoBrightnessXYNN; - } else { -- this.aoLightValueScratchXYZNNN = var1.getAmbientOcclusionLightValue(this.blockAccess, var2 - 1, var3, var4 - 1); -- this.aoBrightnessXYZNNN = var1.getMixedBrightnessForBlock(this.blockAccess, var2 - 1, var3, var4 - 1); -+ this.aoLightValueScratchXYZNNN = par1Block.getAmbientOcclusionLightValue(this.blockAccess, par2 - 1, par3, par4 - 1); -+ this.aoBrightnessXYZNNN = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2 - 1, par3, par4 - 1); - } - -- if(!var18 && !var17) { -+ if (!var18 && !var17) { - this.aoLightValueScratchXYZNNP = this.aoLightValueScratchXYNN; - this.aoBrightnessXYZNNP = this.aoBrightnessXYNN; - } else { -- this.aoLightValueScratchXYZNNP = var1.getAmbientOcclusionLightValue(this.blockAccess, var2 - 1, var3, var4 + 1); -- this.aoBrightnessXYZNNP = var1.getMixedBrightnessForBlock(this.blockAccess, var2 - 1, var3, var4 + 1); -+ this.aoLightValueScratchXYZNNP = par1Block.getAmbientOcclusionLightValue(this.blockAccess, par2 - 1, par3, par4 + 1); -+ this.aoBrightnessXYZNNP = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2 - 1, par3, par4 + 1); - } - -- if(!var19 && !var16) { -+ if (!var19 && !var16) { - this.aoLightValueScratchXYZPNN = this.aoLightValueScratchXYPN; - this.aoBrightnessXYZPNN = this.aoBrightnessXYPN; - } else { -- this.aoLightValueScratchXYZPNN = var1.getAmbientOcclusionLightValue(this.blockAccess, var2 + 1, var3, var4 - 1); -- this.aoBrightnessXYZPNN = var1.getMixedBrightnessForBlock(this.blockAccess, var2 + 1, var3, var4 - 1); -+ this.aoLightValueScratchXYZPNN = par1Block.getAmbientOcclusionLightValue(this.blockAccess, par2 + 1, par3, par4 - 1); -+ this.aoBrightnessXYZPNN = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2 + 1, par3, par4 - 1); - } - -- if(!var18 && !var16) { -+ if (!var18 && !var16) { - this.aoLightValueScratchXYZPNP = this.aoLightValueScratchXYPN; - this.aoBrightnessXYZPNP = this.aoBrightnessXYPN; - } else { -- this.aoLightValueScratchXYZPNP = var1.getAmbientOcclusionLightValue(this.blockAccess, var2 + 1, var3, var4 + 1); -- this.aoBrightnessXYZPNP = var1.getMixedBrightnessForBlock(this.blockAccess, var2 + 1, var3, var4 + 1); -+ this.aoLightValueScratchXYZPNP = par1Block.getAmbientOcclusionLightValue(this.blockAccess, par2 + 1, par3, par4 + 1); -+ this.aoBrightnessXYZPNP = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2 + 1, par3, par4 + 1); - } - -- if(this.renderMinY <= 0.0D) { -- ++var3; -+ if (this.renderMinY <= 0.0D) { -+ ++par3; - } - - var20 = var14; -- if(this.renderMinY <= 0.0D || !this.blockAccess.isBlockOpaqueCube(var2, var3 - 1, var4)) { -- var20 = var1.getMixedBrightnessForBlock(this.blockAccess, var2, var3 - 1, var4); -+ -+ if (this.renderMinY <= 0.0D || !this.blockAccess.isBlockOpaqueCube(par2, par3 - 1, par4)) { -+ var20 = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2, par3 - 1, par4); - } - -- var21 = var1.getAmbientOcclusionLightValue(this.blockAccess, var2, var3 - 1, var4); -+ var21 = par1Block.getAmbientOcclusionLightValue(this.blockAccess, par2, par3 - 1, par4); - var9 = (this.aoLightValueScratchXYZNNP + this.aoLightValueScratchXYNN + this.aoLightValueScratchYZNP + var21) / 4.0F; - var12 = (this.aoLightValueScratchYZNP + var21 + this.aoLightValueScratchXYZPNP + this.aoLightValueScratchXYPN) / 4.0F; - var11 = (var21 + this.aoLightValueScratchYZNN + this.aoLightValueScratchXYPN + this.aoLightValueScratchXYZPNN) / 4.0F; -@@ -3387,14 +4022,15 @@ - this.brightnessTopRight = this.getAoBrightness(this.aoBrightnessYZNP, this.aoBrightnessXYZPNP, this.aoBrightnessXYPN, var20); - this.brightnessBottomRight = this.getAoBrightness(this.aoBrightnessYZNN, this.aoBrightnessXYPN, this.aoBrightnessXYZPNN, var20); - this.brightnessBottomLeft = this.getAoBrightness(this.aoBrightnessXYNN, this.aoBrightnessXYZNNN, this.aoBrightnessYZNN, var20); -- if(var13) { -- this.colorRedTopLeft = this.colorRedBottomLeft = this.colorRedBottomRight = this.colorRedTopRight = var5 * 0.5F; -- this.colorGreenTopLeft = this.colorGreenBottomLeft = this.colorGreenBottomRight = this.colorGreenTopRight = var6 * 0.5F; -- this.colorBlueTopLeft = this.colorBlueBottomLeft = this.colorBlueBottomRight = this.colorBlueTopRight = var7 * 0.5F; -+ -+ if (var13) { -+ this.colorRedTopLeft = this.colorRedBottomLeft = this.colorRedBottomRight = this.colorRedTopRight = par5 * RenderPass.getAOBaseMultiplier(0.5F); -+ this.colorGreenTopLeft = this.colorGreenBottomLeft = this.colorGreenBottomRight = this.colorGreenTopRight = par6 * RenderPass.getAOBaseMultiplier(0.5F); -+ this.colorBlueTopLeft = this.colorBlueBottomLeft = this.colorBlueBottomRight = this.colorBlueTopRight = par7 * RenderPass.getAOBaseMultiplier(0.5F); - } else { -- this.colorRedTopLeft = this.colorRedBottomLeft = this.colorRedBottomRight = this.colorRedTopRight = 0.5F; -- this.colorGreenTopLeft = this.colorGreenBottomLeft = this.colorGreenBottomRight = this.colorGreenTopRight = 0.5F; -- this.colorBlueTopLeft = this.colorBlueBottomLeft = this.colorBlueBottomRight = this.colorBlueTopRight = 0.5F; -+ this.colorRedTopLeft = this.colorRedBottomLeft = this.colorRedBottomRight = this.colorRedTopRight = RenderPass.getAOBaseMultiplier(0.5F); -+ this.colorGreenTopLeft = this.colorGreenBottomLeft = this.colorGreenBottomRight = this.colorGreenTopRight = RenderPass.getAOBaseMultiplier(0.5F); -+ this.colorBlueTopLeft = this.colorBlueBottomLeft = this.colorBlueBottomRight = this.colorBlueTopRight = RenderPass.getAOBaseMultiplier(0.5F); - } - - this.colorRedTopLeft *= var9; -@@ -3409,69 +4045,71 @@ - this.colorRedTopRight *= var12; - this.colorGreenTopRight *= var12; - this.colorBlueTopRight *= var12; -- this.renderFaceYNeg(var1, (double)var2, (double)var3, (double)var4, this.getBlockIcon(var1, this.blockAccess, var2, var3, var4, 0)); -+ this.renderFaceYNeg(par1Block, (double)par2, (double)par3, (double)par4, this.getBlockIcon(par1Block, this.blockAccess, par2, par3, par4, 0)); - var8 = true; - } - -- if(this.renderAllFaces || var1.shouldSideBeRendered(this.blockAccess, var2, var3 + 1, var4, 1)) { -- if(this.renderMaxY >= 1.0D) { -- ++var3; -+ if (this.renderAllFaces || RenderPass.shouldSideBeRendered(par1Block, this.blockAccess, par2, par3 + 1, par4, 1)) { -+ if (this.renderMaxY >= 1.0D) { -+ ++par3; - } - -- this.aoBrightnessXYNP = var1.getMixedBrightnessForBlock(this.blockAccess, var2 - 1, var3, var4); -- this.aoBrightnessXYPP = var1.getMixedBrightnessForBlock(this.blockAccess, var2 + 1, var3, var4); -- this.aoBrightnessYZPN = var1.getMixedBrightnessForBlock(this.blockAccess, var2, var3, var4 - 1); -- this.aoBrightnessYZPP = var1.getMixedBrightnessForBlock(this.blockAccess, var2, var3, var4 + 1); -- this.aoLightValueScratchXYNP = var1.getAmbientOcclusionLightValue(this.blockAccess, var2 - 1, var3, var4); -- this.aoLightValueScratchXYPP = var1.getAmbientOcclusionLightValue(this.blockAccess, var2 + 1, var3, var4); -- this.aoLightValueScratchYZPN = var1.getAmbientOcclusionLightValue(this.blockAccess, var2, var3, var4 - 1); -- this.aoLightValueScratchYZPP = var1.getAmbientOcclusionLightValue(this.blockAccess, var2, var3, var4 + 1); -- var16 = Block.canBlockGrass[this.blockAccess.getBlockId(var2 + 1, var3 + 1, var4)]; -- var17 = Block.canBlockGrass[this.blockAccess.getBlockId(var2 - 1, var3 + 1, var4)]; -- var18 = Block.canBlockGrass[this.blockAccess.getBlockId(var2, var3 + 1, var4 + 1)]; -- var19 = Block.canBlockGrass[this.blockAccess.getBlockId(var2, var3 + 1, var4 - 1)]; -- if(!var19 && !var17) { -+ this.aoBrightnessXYNP = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2 - 1, par3, par4); -+ this.aoBrightnessXYPP = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2 + 1, par3, par4); -+ this.aoBrightnessYZPN = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2, par3, par4 - 1); -+ this.aoBrightnessYZPP = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2, par3, par4 + 1); -+ this.aoLightValueScratchXYNP = par1Block.getAmbientOcclusionLightValue(this.blockAccess, par2 - 1, par3, par4); -+ this.aoLightValueScratchXYPP = par1Block.getAmbientOcclusionLightValue(this.blockAccess, par2 + 1, par3, par4); -+ this.aoLightValueScratchYZPN = par1Block.getAmbientOcclusionLightValue(this.blockAccess, par2, par3, par4 - 1); -+ this.aoLightValueScratchYZPP = par1Block.getAmbientOcclusionLightValue(this.blockAccess, par2, par3, par4 + 1); -+ var16 = Block.canBlockGrass[this.blockAccess.getBlockId(par2 + 1, par3 + 1, par4)]; -+ var17 = Block.canBlockGrass[this.blockAccess.getBlockId(par2 - 1, par3 + 1, par4)]; -+ var18 = Block.canBlockGrass[this.blockAccess.getBlockId(par2, par3 + 1, par4 + 1)]; -+ var19 = Block.canBlockGrass[this.blockAccess.getBlockId(par2, par3 + 1, par4 - 1)]; -+ -+ if (!var19 && !var17) { - this.aoLightValueScratchXYZNPN = this.aoLightValueScratchXYNP; - this.aoBrightnessXYZNPN = this.aoBrightnessXYNP; - } else { -- this.aoLightValueScratchXYZNPN = var1.getAmbientOcclusionLightValue(this.blockAccess, var2 - 1, var3, var4 - 1); -- this.aoBrightnessXYZNPN = var1.getMixedBrightnessForBlock(this.blockAccess, var2 - 1, var3, var4 - 1); -+ this.aoLightValueScratchXYZNPN = par1Block.getAmbientOcclusionLightValue(this.blockAccess, par2 - 1, par3, par4 - 1); -+ this.aoBrightnessXYZNPN = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2 - 1, par3, par4 - 1); - } - -- if(!var19 && !var16) { -+ if (!var19 && !var16) { - this.aoLightValueScratchXYZPPN = this.aoLightValueScratchXYPP; - this.aoBrightnessXYZPPN = this.aoBrightnessXYPP; - } else { -- this.aoLightValueScratchXYZPPN = var1.getAmbientOcclusionLightValue(this.blockAccess, var2 + 1, var3, var4 - 1); -- this.aoBrightnessXYZPPN = var1.getMixedBrightnessForBlock(this.blockAccess, var2 + 1, var3, var4 - 1); -+ this.aoLightValueScratchXYZPPN = par1Block.getAmbientOcclusionLightValue(this.blockAccess, par2 + 1, par3, par4 - 1); -+ this.aoBrightnessXYZPPN = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2 + 1, par3, par4 - 1); - } - -- if(!var18 && !var17) { -+ if (!var18 && !var17) { - this.aoLightValueScratchXYZNPP = this.aoLightValueScratchXYNP; - this.aoBrightnessXYZNPP = this.aoBrightnessXYNP; - } else { -- this.aoLightValueScratchXYZNPP = var1.getAmbientOcclusionLightValue(this.blockAccess, var2 - 1, var3, var4 + 1); -- this.aoBrightnessXYZNPP = var1.getMixedBrightnessForBlock(this.blockAccess, var2 - 1, var3, var4 + 1); -+ this.aoLightValueScratchXYZNPP = par1Block.getAmbientOcclusionLightValue(this.blockAccess, par2 - 1, par3, par4 + 1); -+ this.aoBrightnessXYZNPP = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2 - 1, par3, par4 + 1); - } - -- if(!var18 && !var16) { -+ if (!var18 && !var16) { - this.aoLightValueScratchXYZPPP = this.aoLightValueScratchXYPP; - this.aoBrightnessXYZPPP = this.aoBrightnessXYPP; - } else { -- this.aoLightValueScratchXYZPPP = var1.getAmbientOcclusionLightValue(this.blockAccess, var2 + 1, var3, var4 + 1); -- this.aoBrightnessXYZPPP = var1.getMixedBrightnessForBlock(this.blockAccess, var2 + 1, var3, var4 + 1); -+ this.aoLightValueScratchXYZPPP = par1Block.getAmbientOcclusionLightValue(this.blockAccess, par2 + 1, par3, par4 + 1); -+ this.aoBrightnessXYZPPP = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2 + 1, par3, par4 + 1); - } - -- if(this.renderMaxY >= 1.0D) { -- --var3; -+ if (this.renderMaxY >= 1.0D) { -+ --par3; - } - - var20 = var14; -- if(this.renderMaxY >= 1.0D || !this.blockAccess.isBlockOpaqueCube(var2, var3 + 1, var4)) { -- var20 = var1.getMixedBrightnessForBlock(this.blockAccess, var2, var3 + 1, var4); -+ -+ if (this.renderMaxY >= 1.0D || !this.blockAccess.isBlockOpaqueCube(par2, par3 + 1, par4)) { -+ var20 = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2, par3 + 1, par4); - } - -- var21 = var1.getAmbientOcclusionLightValue(this.blockAccess, var2, var3 + 1, var4); -+ var21 = par1Block.getAmbientOcclusionLightValue(this.blockAccess, par2, par3 + 1, par4); - var12 = (this.aoLightValueScratchXYZNPP + this.aoLightValueScratchXYNP + this.aoLightValueScratchYZPP + var21) / 4.0F; - var9 = (this.aoLightValueScratchYZPP + var21 + this.aoLightValueScratchXYZPPP + this.aoLightValueScratchXYPP) / 4.0F; - var10 = (var21 + this.aoLightValueScratchYZPN + this.aoLightValueScratchXYPP + this.aoLightValueScratchXYZPPN) / 4.0F; -@@ -3480,9 +4118,9 @@ - this.brightnessTopLeft = this.getAoBrightness(this.aoBrightnessYZPP, this.aoBrightnessXYZPPP, this.aoBrightnessXYPP, var20); - this.brightnessBottomLeft = this.getAoBrightness(this.aoBrightnessYZPN, this.aoBrightnessXYPP, this.aoBrightnessXYZPPN, var20); - this.brightnessBottomRight = this.getAoBrightness(this.aoBrightnessXYNP, this.aoBrightnessXYZNPN, this.aoBrightnessYZPN, var20); -- this.colorRedTopLeft = this.colorRedBottomLeft = this.colorRedBottomRight = this.colorRedTopRight = var5; -- this.colorGreenTopLeft = this.colorGreenBottomLeft = this.colorGreenBottomRight = this.colorGreenTopRight = var6; -- this.colorBlueTopLeft = this.colorBlueBottomLeft = this.colorBlueBottomRight = this.colorBlueTopRight = var7; -+ this.colorRedTopLeft = this.colorRedBottomLeft = this.colorRedBottomRight = this.colorRedTopRight = par5; -+ this.colorGreenTopLeft = this.colorGreenBottomLeft = this.colorGreenBottomRight = this.colorGreenTopRight = par6; -+ this.colorBlueTopLeft = this.colorBlueBottomLeft = this.colorBlueBottomRight = this.colorBlueTopRight = par7; - this.colorRedTopLeft *= var9; - this.colorGreenTopLeft *= var9; - this.colorBlueTopLeft *= var9; -@@ -3495,70 +4133,73 @@ - this.colorRedTopRight *= var12; - this.colorGreenTopRight *= var12; - this.colorBlueTopRight *= var12; -- this.renderFaceYPos(var1, (double)var2, (double)var3, (double)var4, this.getBlockIcon(var1, this.blockAccess, var2, var3, var4, 1)); -+ this.renderFaceYPos(par1Block, (double)par2, (double)par3, (double)par4, this.getBlockIcon(par1Block, this.blockAccess, par2, par3, par4, 1)); - var8 = true; - } - - Icon var22; -- if(this.renderAllFaces || var1.shouldSideBeRendered(this.blockAccess, var2, var3, var4 - 1, 2)) { -- if(this.renderMinZ <= 0.0D) { -- --var4; -+ -+ if (this.renderAllFaces || RenderPass.shouldSideBeRendered(par1Block, this.blockAccess, par2, par3, par4 - 1, 2)) { -+ if (this.renderMinZ <= 0.0D) { -+ --par4; - } - -- this.aoLightValueScratchXZNN = var1.getAmbientOcclusionLightValue(this.blockAccess, var2 - 1, var3, var4); -- this.aoLightValueScratchYZNN = var1.getAmbientOcclusionLightValue(this.blockAccess, var2, var3 - 1, var4); -- this.aoLightValueScratchYZPN = var1.getAmbientOcclusionLightValue(this.blockAccess, var2, var3 + 1, var4); -- this.aoLightValueScratchXZPN = var1.getAmbientOcclusionLightValue(this.blockAccess, var2 + 1, var3, var4); -- this.aoBrightnessXZNN = var1.getMixedBrightnessForBlock(this.blockAccess, var2 - 1, var3, var4); -- this.aoBrightnessYZNN = var1.getMixedBrightnessForBlock(this.blockAccess, var2, var3 - 1, var4); -- this.aoBrightnessYZPN = var1.getMixedBrightnessForBlock(this.blockAccess, var2, var3 + 1, var4); -- this.aoBrightnessXZPN = var1.getMixedBrightnessForBlock(this.blockAccess, var2 + 1, var3, var4); -- var16 = Block.canBlockGrass[this.blockAccess.getBlockId(var2 + 1, var3, var4 - 1)]; -- var17 = Block.canBlockGrass[this.blockAccess.getBlockId(var2 - 1, var3, var4 - 1)]; -- var18 = Block.canBlockGrass[this.blockAccess.getBlockId(var2, var3 + 1, var4 - 1)]; -- var19 = Block.canBlockGrass[this.blockAccess.getBlockId(var2, var3 - 1, var4 - 1)]; -- if(!var17 && !var19) { -+ this.aoLightValueScratchXZNN = par1Block.getAmbientOcclusionLightValue(this.blockAccess, par2 - 1, par3, par4); -+ this.aoLightValueScratchYZNN = par1Block.getAmbientOcclusionLightValue(this.blockAccess, par2, par3 - 1, par4); -+ this.aoLightValueScratchYZPN = par1Block.getAmbientOcclusionLightValue(this.blockAccess, par2, par3 + 1, par4); -+ this.aoLightValueScratchXZPN = par1Block.getAmbientOcclusionLightValue(this.blockAccess, par2 + 1, par3, par4); -+ this.aoBrightnessXZNN = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2 - 1, par3, par4); -+ this.aoBrightnessYZNN = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2, par3 - 1, par4); -+ this.aoBrightnessYZPN = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2, par3 + 1, par4); -+ this.aoBrightnessXZPN = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2 + 1, par3, par4); -+ var16 = Block.canBlockGrass[this.blockAccess.getBlockId(par2 + 1, par3, par4 - 1)]; -+ var17 = Block.canBlockGrass[this.blockAccess.getBlockId(par2 - 1, par3, par4 - 1)]; -+ var18 = Block.canBlockGrass[this.blockAccess.getBlockId(par2, par3 + 1, par4 - 1)]; -+ var19 = Block.canBlockGrass[this.blockAccess.getBlockId(par2, par3 - 1, par4 - 1)]; -+ -+ if (!var17 && !var19) { - this.aoLightValueScratchXYZNNN = this.aoLightValueScratchXZNN; - this.aoBrightnessXYZNNN = this.aoBrightnessXZNN; - } else { -- this.aoLightValueScratchXYZNNN = var1.getAmbientOcclusionLightValue(this.blockAccess, var2 - 1, var3 - 1, var4); -- this.aoBrightnessXYZNNN = var1.getMixedBrightnessForBlock(this.blockAccess, var2 - 1, var3 - 1, var4); -+ this.aoLightValueScratchXYZNNN = par1Block.getAmbientOcclusionLightValue(this.blockAccess, par2 - 1, par3 - 1, par4); -+ this.aoBrightnessXYZNNN = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2 - 1, par3 - 1, par4); - } - -- if(!var17 && !var18) { -+ if (!var17 && !var18) { - this.aoLightValueScratchXYZNPN = this.aoLightValueScratchXZNN; - this.aoBrightnessXYZNPN = this.aoBrightnessXZNN; - } else { -- this.aoLightValueScratchXYZNPN = var1.getAmbientOcclusionLightValue(this.blockAccess, var2 - 1, var3 + 1, var4); -- this.aoBrightnessXYZNPN = var1.getMixedBrightnessForBlock(this.blockAccess, var2 - 1, var3 + 1, var4); -+ this.aoLightValueScratchXYZNPN = par1Block.getAmbientOcclusionLightValue(this.blockAccess, par2 - 1, par3 + 1, par4); -+ this.aoBrightnessXYZNPN = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2 - 1, par3 + 1, par4); - } - -- if(!var16 && !var19) { -+ if (!var16 && !var19) { - this.aoLightValueScratchXYZPNN = this.aoLightValueScratchXZPN; - this.aoBrightnessXYZPNN = this.aoBrightnessXZPN; - } else { -- this.aoLightValueScratchXYZPNN = var1.getAmbientOcclusionLightValue(this.blockAccess, var2 + 1, var3 - 1, var4); -- this.aoBrightnessXYZPNN = var1.getMixedBrightnessForBlock(this.blockAccess, var2 + 1, var3 - 1, var4); -+ this.aoLightValueScratchXYZPNN = par1Block.getAmbientOcclusionLightValue(this.blockAccess, par2 + 1, par3 - 1, par4); -+ this.aoBrightnessXYZPNN = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2 + 1, par3 - 1, par4); - } - -- if(!var16 && !var18) { -+ if (!var16 && !var18) { - this.aoLightValueScratchXYZPPN = this.aoLightValueScratchXZPN; - this.aoBrightnessXYZPPN = this.aoBrightnessXZPN; - } else { -- this.aoLightValueScratchXYZPPN = var1.getAmbientOcclusionLightValue(this.blockAccess, var2 + 1, var3 + 1, var4); -- this.aoBrightnessXYZPPN = var1.getMixedBrightnessForBlock(this.blockAccess, var2 + 1, var3 + 1, var4); -+ this.aoLightValueScratchXYZPPN = par1Block.getAmbientOcclusionLightValue(this.blockAccess, par2 + 1, par3 + 1, par4); -+ this.aoBrightnessXYZPPN = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2 + 1, par3 + 1, par4); - } - -- if(this.renderMinZ <= 0.0D) { -- ++var4; -+ if (this.renderMinZ <= 0.0D) { -+ ++par4; - } - - var20 = var14; -- if(this.renderMinZ <= 0.0D || !this.blockAccess.isBlockOpaqueCube(var2, var3, var4 - 1)) { -- var20 = var1.getMixedBrightnessForBlock(this.blockAccess, var2, var3, var4 - 1); -+ -+ if (this.renderMinZ <= 0.0D || !this.blockAccess.isBlockOpaqueCube(par2, par3, par4 - 1)) { -+ var20 = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2, par3, par4 - 1); - } - -- var21 = var1.getAmbientOcclusionLightValue(this.blockAccess, var2, var3, var4 - 1); -+ var21 = par1Block.getAmbientOcclusionLightValue(this.blockAccess, par2, par3, par4 - 1); - var9 = (this.aoLightValueScratchXZNN + this.aoLightValueScratchXYZNPN + var21 + this.aoLightValueScratchYZPN) / 4.0F; - var10 = (var21 + this.aoLightValueScratchYZPN + this.aoLightValueScratchXZPN + this.aoLightValueScratchXYZPPN) / 4.0F; - var11 = (this.aoLightValueScratchYZNN + var21 + this.aoLightValueScratchXYZPNN + this.aoLightValueScratchXZPN) / 4.0F; -@@ -3567,14 +4208,15 @@ - this.brightnessBottomLeft = this.getAoBrightness(this.aoBrightnessYZPN, this.aoBrightnessXZPN, this.aoBrightnessXYZPPN, var20); - this.brightnessBottomRight = this.getAoBrightness(this.aoBrightnessYZNN, this.aoBrightnessXYZPNN, this.aoBrightnessXZPN, var20); - this.brightnessTopRight = this.getAoBrightness(this.aoBrightnessXYZNNN, this.aoBrightnessXZNN, this.aoBrightnessYZNN, var20); -- if(var13) { -- this.colorRedTopLeft = this.colorRedBottomLeft = this.colorRedBottomRight = this.colorRedTopRight = var5 * 0.8F; -- this.colorGreenTopLeft = this.colorGreenBottomLeft = this.colorGreenBottomRight = this.colorGreenTopRight = var6 * 0.8F; -- this.colorBlueTopLeft = this.colorBlueBottomLeft = this.colorBlueBottomRight = this.colorBlueTopRight = var7 * 0.8F; -+ -+ if (!var13 ? (!fancyGrass ? CTMUtils.isBetterGrass(this.blockAccess, par1Block, par2, par3, par4, 2) : false) : true) { -+ this.colorRedTopLeft = this.colorRedBottomLeft = this.colorRedBottomRight = this.colorRedTopRight = par5 * RenderPass.getAOBaseMultiplier(0.8F); -+ this.colorGreenTopLeft = this.colorGreenBottomLeft = this.colorGreenBottomRight = this.colorGreenTopRight = par6 * RenderPass.getAOBaseMultiplier(0.8F); -+ this.colorBlueTopLeft = this.colorBlueBottomLeft = this.colorBlueBottomRight = this.colorBlueTopRight = par7 * RenderPass.getAOBaseMultiplier(0.8F); - } else { -- this.colorRedTopLeft = this.colorRedBottomLeft = this.colorRedBottomRight = this.colorRedTopRight = 0.8F; -- this.colorGreenTopLeft = this.colorGreenBottomLeft = this.colorGreenBottomRight = this.colorGreenTopRight = 0.8F; -- this.colorBlueTopLeft = this.colorBlueBottomLeft = this.colorBlueBottomRight = this.colorBlueTopRight = 0.8F; -+ this.colorRedTopLeft = this.colorRedBottomLeft = this.colorRedBottomRight = this.colorRedTopRight = RenderPass.getAOBaseMultiplier(0.8F); -+ this.colorGreenTopLeft = this.colorGreenBottomLeft = this.colorGreenBottomRight = this.colorGreenTopRight = RenderPass.getAOBaseMultiplier(0.8F); -+ this.colorBlueTopLeft = this.colorBlueBottomLeft = this.colorBlueBottomRight = this.colorBlueTopRight = RenderPass.getAOBaseMultiplier(0.8F); - } - - this.colorRedTopLeft *= var9; -@@ -3589,86 +4231,89 @@ - this.colorRedTopRight *= var12; - this.colorGreenTopRight *= var12; - this.colorBlueTopRight *= var12; -- var22 = this.getBlockIcon(var1, this.blockAccess, var2, var3, var4, 2); -- this.renderFaceZNeg(var1, (double)var2, (double)var3, (double)var4, var22); -- if(fancyGrass && var22.getIconName().equals("grass_side") && !this.hasOverrideBlockTexture()) { -- this.colorRedTopLeft *= var5; -- this.colorRedBottomLeft *= var5; -- this.colorRedBottomRight *= var5; -- this.colorRedTopRight *= var5; -- this.colorGreenTopLeft *= var6; -- this.colorGreenBottomLeft *= var6; -- this.colorGreenBottomRight *= var6; -- this.colorGreenTopRight *= var6; -- this.colorBlueTopLeft *= var7; -- this.colorBlueBottomLeft *= var7; -- this.colorBlueBottomRight *= var7; -- this.colorBlueTopRight *= var7; -- this.renderFaceZNeg(var1, (double)var2, (double)var3, (double)var4, BlockGrass.getIconSideOverlay()); -+ var22 = this.getBlockIcon(par1Block, this.blockAccess, par2, par3, par4, 2); -+ this.renderFaceZNeg(par1Block, (double)par2, (double)par3, (double)par4, var22); -+ -+ if (fancyGrass && var22.getIconName().equals("grass_side") && !this.hasOverrideBlockTexture()) { -+ this.colorRedTopLeft *= par5; -+ this.colorRedBottomLeft *= par5; -+ this.colorRedBottomRight *= par5; -+ this.colorRedTopRight *= par5; -+ this.colorGreenTopLeft *= par6; -+ this.colorGreenBottomLeft *= par6; -+ this.colorGreenBottomRight *= par6; -+ this.colorGreenTopRight *= par6; -+ this.colorBlueTopLeft *= par7; -+ this.colorBlueBottomLeft *= par7; -+ this.colorBlueBottomRight *= par7; -+ this.colorBlueTopRight *= par7; -+ this.renderFaceZNeg(par1Block, (double)par2, (double)par3, (double)par4, BlockGrass.getIconSideOverlay()); - } - - var8 = true; - } - -- if(this.renderAllFaces || var1.shouldSideBeRendered(this.blockAccess, var2, var3, var4 + 1, 3)) { -- if(this.renderMaxZ >= 1.0D) { -- ++var4; -+ if (this.renderAllFaces || RenderPass.shouldSideBeRendered(par1Block, this.blockAccess, par2, par3, par4 + 1, 3)) { -+ if (this.renderMaxZ >= 1.0D) { -+ ++par4; - } - -- this.aoLightValueScratchXZNP = var1.getAmbientOcclusionLightValue(this.blockAccess, var2 - 1, var3, var4); -- this.aoLightValueScratchXZPP = var1.getAmbientOcclusionLightValue(this.blockAccess, var2 + 1, var3, var4); -- this.aoLightValueScratchYZNP = var1.getAmbientOcclusionLightValue(this.blockAccess, var2, var3 - 1, var4); -- this.aoLightValueScratchYZPP = var1.getAmbientOcclusionLightValue(this.blockAccess, var2, var3 + 1, var4); -- this.aoBrightnessXZNP = var1.getMixedBrightnessForBlock(this.blockAccess, var2 - 1, var3, var4); -- this.aoBrightnessXZPP = var1.getMixedBrightnessForBlock(this.blockAccess, var2 + 1, var3, var4); -- this.aoBrightnessYZNP = var1.getMixedBrightnessForBlock(this.blockAccess, var2, var3 - 1, var4); -- this.aoBrightnessYZPP = var1.getMixedBrightnessForBlock(this.blockAccess, var2, var3 + 1, var4); -- var16 = Block.canBlockGrass[this.blockAccess.getBlockId(var2 + 1, var3, var4 + 1)]; -- var17 = Block.canBlockGrass[this.blockAccess.getBlockId(var2 - 1, var3, var4 + 1)]; -- var18 = Block.canBlockGrass[this.blockAccess.getBlockId(var2, var3 + 1, var4 + 1)]; -- var19 = Block.canBlockGrass[this.blockAccess.getBlockId(var2, var3 - 1, var4 + 1)]; -- if(!var17 && !var19) { -+ this.aoLightValueScratchXZNP = par1Block.getAmbientOcclusionLightValue(this.blockAccess, par2 - 1, par3, par4); -+ this.aoLightValueScratchXZPP = par1Block.getAmbientOcclusionLightValue(this.blockAccess, par2 + 1, par3, par4); -+ this.aoLightValueScratchYZNP = par1Block.getAmbientOcclusionLightValue(this.blockAccess, par2, par3 - 1, par4); -+ this.aoLightValueScratchYZPP = par1Block.getAmbientOcclusionLightValue(this.blockAccess, par2, par3 + 1, par4); -+ this.aoBrightnessXZNP = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2 - 1, par3, par4); -+ this.aoBrightnessXZPP = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2 + 1, par3, par4); -+ this.aoBrightnessYZNP = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2, par3 - 1, par4); -+ this.aoBrightnessYZPP = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2, par3 + 1, par4); -+ var16 = Block.canBlockGrass[this.blockAccess.getBlockId(par2 + 1, par3, par4 + 1)]; -+ var17 = Block.canBlockGrass[this.blockAccess.getBlockId(par2 - 1, par3, par4 + 1)]; -+ var18 = Block.canBlockGrass[this.blockAccess.getBlockId(par2, par3 + 1, par4 + 1)]; -+ var19 = Block.canBlockGrass[this.blockAccess.getBlockId(par2, par3 - 1, par4 + 1)]; -+ -+ if (!var17 && !var19) { - this.aoLightValueScratchXYZNNP = this.aoLightValueScratchXZNP; - this.aoBrightnessXYZNNP = this.aoBrightnessXZNP; - } else { -- this.aoLightValueScratchXYZNNP = var1.getAmbientOcclusionLightValue(this.blockAccess, var2 - 1, var3 - 1, var4); -- this.aoBrightnessXYZNNP = var1.getMixedBrightnessForBlock(this.blockAccess, var2 - 1, var3 - 1, var4); -+ this.aoLightValueScratchXYZNNP = par1Block.getAmbientOcclusionLightValue(this.blockAccess, par2 - 1, par3 - 1, par4); -+ this.aoBrightnessXYZNNP = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2 - 1, par3 - 1, par4); - } - -- if(!var17 && !var18) { -+ if (!var17 && !var18) { - this.aoLightValueScratchXYZNPP = this.aoLightValueScratchXZNP; - this.aoBrightnessXYZNPP = this.aoBrightnessXZNP; - } else { -- this.aoLightValueScratchXYZNPP = var1.getAmbientOcclusionLightValue(this.blockAccess, var2 - 1, var3 + 1, var4); -- this.aoBrightnessXYZNPP = var1.getMixedBrightnessForBlock(this.blockAccess, var2 - 1, var3 + 1, var4); -+ this.aoLightValueScratchXYZNPP = par1Block.getAmbientOcclusionLightValue(this.blockAccess, par2 - 1, par3 + 1, par4); -+ this.aoBrightnessXYZNPP = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2 - 1, par3 + 1, par4); - } - -- if(!var16 && !var19) { -+ if (!var16 && !var19) { - this.aoLightValueScratchXYZPNP = this.aoLightValueScratchXZPP; - this.aoBrightnessXYZPNP = this.aoBrightnessXZPP; - } else { -- this.aoLightValueScratchXYZPNP = var1.getAmbientOcclusionLightValue(this.blockAccess, var2 + 1, var3 - 1, var4); -- this.aoBrightnessXYZPNP = var1.getMixedBrightnessForBlock(this.blockAccess, var2 + 1, var3 - 1, var4); -+ this.aoLightValueScratchXYZPNP = par1Block.getAmbientOcclusionLightValue(this.blockAccess, par2 + 1, par3 - 1, par4); -+ this.aoBrightnessXYZPNP = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2 + 1, par3 - 1, par4); - } - -- if(!var16 && !var18) { -+ if (!var16 && !var18) { - this.aoLightValueScratchXYZPPP = this.aoLightValueScratchXZPP; - this.aoBrightnessXYZPPP = this.aoBrightnessXZPP; - } else { -- this.aoLightValueScratchXYZPPP = var1.getAmbientOcclusionLightValue(this.blockAccess, var2 + 1, var3 + 1, var4); -- this.aoBrightnessXYZPPP = var1.getMixedBrightnessForBlock(this.blockAccess, var2 + 1, var3 + 1, var4); -+ this.aoLightValueScratchXYZPPP = par1Block.getAmbientOcclusionLightValue(this.blockAccess, par2 + 1, par3 + 1, par4); -+ this.aoBrightnessXYZPPP = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2 + 1, par3 + 1, par4); - } - -- if(this.renderMaxZ >= 1.0D) { -- --var4; -+ if (this.renderMaxZ >= 1.0D) { -+ --par4; - } - - var20 = var14; -- if(this.renderMaxZ >= 1.0D || !this.blockAccess.isBlockOpaqueCube(var2, var3, var4 + 1)) { -- var20 = var1.getMixedBrightnessForBlock(this.blockAccess, var2, var3, var4 + 1); -+ -+ if (this.renderMaxZ >= 1.0D || !this.blockAccess.isBlockOpaqueCube(par2, par3, par4 + 1)) { -+ var20 = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2, par3, par4 + 1); - } - -- var21 = var1.getAmbientOcclusionLightValue(this.blockAccess, var2, var3, var4 + 1); -+ var21 = par1Block.getAmbientOcclusionLightValue(this.blockAccess, par2, par3, par4 + 1); - var9 = (this.aoLightValueScratchXZNP + this.aoLightValueScratchXYZNPP + var21 + this.aoLightValueScratchYZPP) / 4.0F; - var12 = (var21 + this.aoLightValueScratchYZPP + this.aoLightValueScratchXZPP + this.aoLightValueScratchXYZPPP) / 4.0F; - var11 = (this.aoLightValueScratchYZNP + var21 + this.aoLightValueScratchXYZPNP + this.aoLightValueScratchXZPP) / 4.0F; -@@ -3677,14 +4322,15 @@ - this.brightnessTopRight = this.getAoBrightness(this.aoBrightnessYZPP, this.aoBrightnessXZPP, this.aoBrightnessXYZPPP, var20); - this.brightnessBottomRight = this.getAoBrightness(this.aoBrightnessYZNP, this.aoBrightnessXYZPNP, this.aoBrightnessXZPP, var20); - this.brightnessBottomLeft = this.getAoBrightness(this.aoBrightnessXYZNNP, this.aoBrightnessXZNP, this.aoBrightnessYZNP, var20); -- if(var13) { -- this.colorRedTopLeft = this.colorRedBottomLeft = this.colorRedBottomRight = this.colorRedTopRight = var5 * 0.8F; -- this.colorGreenTopLeft = this.colorGreenBottomLeft = this.colorGreenBottomRight = this.colorGreenTopRight = var6 * 0.8F; -- this.colorBlueTopLeft = this.colorBlueBottomLeft = this.colorBlueBottomRight = this.colorBlueTopRight = var7 * 0.8F; -+ -+ if (!var13 ? (!fancyGrass ? CTMUtils.isBetterGrass(this.blockAccess, par1Block, par2, par3, par4, 3) : false) : true) { -+ this.colorRedTopLeft = this.colorRedBottomLeft = this.colorRedBottomRight = this.colorRedTopRight = par5 * RenderPass.getAOBaseMultiplier(0.8F); -+ this.colorGreenTopLeft = this.colorGreenBottomLeft = this.colorGreenBottomRight = this.colorGreenTopRight = par6 * RenderPass.getAOBaseMultiplier(0.8F); -+ this.colorBlueTopLeft = this.colorBlueBottomLeft = this.colorBlueBottomRight = this.colorBlueTopRight = par7 * RenderPass.getAOBaseMultiplier(0.8F); - } else { -- this.colorRedTopLeft = this.colorRedBottomLeft = this.colorRedBottomRight = this.colorRedTopRight = 0.8F; -- this.colorGreenTopLeft = this.colorGreenBottomLeft = this.colorGreenBottomRight = this.colorGreenTopRight = 0.8F; -- this.colorBlueTopLeft = this.colorBlueBottomLeft = this.colorBlueBottomRight = this.colorBlueTopRight = 0.8F; -+ this.colorRedTopLeft = this.colorRedBottomLeft = this.colorRedBottomRight = this.colorRedTopRight = RenderPass.getAOBaseMultiplier(0.8F); -+ this.colorGreenTopLeft = this.colorGreenBottomLeft = this.colorGreenBottomRight = this.colorGreenTopRight = RenderPass.getAOBaseMultiplier(0.8F); -+ this.colorBlueTopLeft = this.colorBlueBottomLeft = this.colorBlueBottomRight = this.colorBlueTopRight = RenderPass.getAOBaseMultiplier(0.8F); - } - - this.colorRedTopLeft *= var9; -@@ -3699,86 +4345,89 @@ - this.colorRedTopRight *= var12; - this.colorGreenTopRight *= var12; - this.colorBlueTopRight *= var12; -- var22 = this.getBlockIcon(var1, this.blockAccess, var2, var3, var4, 3); -- this.renderFaceZPos(var1, (double)var2, (double)var3, (double)var4, this.getBlockIcon(var1, this.blockAccess, var2, var3, var4, 3)); -- if(fancyGrass && var22.getIconName().equals("grass_side") && !this.hasOverrideBlockTexture()) { -- this.colorRedTopLeft *= var5; -- this.colorRedBottomLeft *= var5; -- this.colorRedBottomRight *= var5; -- this.colorRedTopRight *= var5; -- this.colorGreenTopLeft *= var6; -- this.colorGreenBottomLeft *= var6; -- this.colorGreenBottomRight *= var6; -- this.colorGreenTopRight *= var6; -- this.colorBlueTopLeft *= var7; -- this.colorBlueBottomLeft *= var7; -- this.colorBlueBottomRight *= var7; -- this.colorBlueTopRight *= var7; -- this.renderFaceZPos(var1, (double)var2, (double)var3, (double)var4, BlockGrass.getIconSideOverlay()); -+ var22 = this.getBlockIcon(par1Block, this.blockAccess, par2, par3, par4, 3); -+ this.renderFaceZPos(par1Block, (double)par2, (double)par3, (double)par4, this.getBlockIcon(par1Block, this.blockAccess, par2, par3, par4, 3)); -+ -+ if (fancyGrass && var22.getIconName().equals("grass_side") && !this.hasOverrideBlockTexture()) { -+ this.colorRedTopLeft *= par5; -+ this.colorRedBottomLeft *= par5; -+ this.colorRedBottomRight *= par5; -+ this.colorRedTopRight *= par5; -+ this.colorGreenTopLeft *= par6; -+ this.colorGreenBottomLeft *= par6; -+ this.colorGreenBottomRight *= par6; -+ this.colorGreenTopRight *= par6; -+ this.colorBlueTopLeft *= par7; -+ this.colorBlueBottomLeft *= par7; -+ this.colorBlueBottomRight *= par7; -+ this.colorBlueTopRight *= par7; -+ this.renderFaceZPos(par1Block, (double)par2, (double)par3, (double)par4, BlockGrass.getIconSideOverlay()); - } - - var8 = true; - } - -- if(this.renderAllFaces || var1.shouldSideBeRendered(this.blockAccess, var2 - 1, var3, var4, 4)) { -- if(this.renderMinX <= 0.0D) { -- --var2; -+ if (this.renderAllFaces || RenderPass.shouldSideBeRendered(par1Block, this.blockAccess, par2 - 1, par3, par4, 4)) { -+ if (this.renderMinX <= 0.0D) { -+ --par2; - } - -- this.aoLightValueScratchXYNN = var1.getAmbientOcclusionLightValue(this.blockAccess, var2, var3 - 1, var4); -- this.aoLightValueScratchXZNN = var1.getAmbientOcclusionLightValue(this.blockAccess, var2, var3, var4 - 1); -- this.aoLightValueScratchXZNP = var1.getAmbientOcclusionLightValue(this.blockAccess, var2, var3, var4 + 1); -- this.aoLightValueScratchXYNP = var1.getAmbientOcclusionLightValue(this.blockAccess, var2, var3 + 1, var4); -- this.aoBrightnessXYNN = var1.getMixedBrightnessForBlock(this.blockAccess, var2, var3 - 1, var4); -- this.aoBrightnessXZNN = var1.getMixedBrightnessForBlock(this.blockAccess, var2, var3, var4 - 1); -- this.aoBrightnessXZNP = var1.getMixedBrightnessForBlock(this.blockAccess, var2, var3, var4 + 1); -- this.aoBrightnessXYNP = var1.getMixedBrightnessForBlock(this.blockAccess, var2, var3 + 1, var4); -- var16 = Block.canBlockGrass[this.blockAccess.getBlockId(var2 - 1, var3 + 1, var4)]; -- var17 = Block.canBlockGrass[this.blockAccess.getBlockId(var2 - 1, var3 - 1, var4)]; -- var18 = Block.canBlockGrass[this.blockAccess.getBlockId(var2 - 1, var3, var4 - 1)]; -- var19 = Block.canBlockGrass[this.blockAccess.getBlockId(var2 - 1, var3, var4 + 1)]; -- if(!var18 && !var17) { -+ this.aoLightValueScratchXYNN = par1Block.getAmbientOcclusionLightValue(this.blockAccess, par2, par3 - 1, par4); -+ this.aoLightValueScratchXZNN = par1Block.getAmbientOcclusionLightValue(this.blockAccess, par2, par3, par4 - 1); -+ this.aoLightValueScratchXZNP = par1Block.getAmbientOcclusionLightValue(this.blockAccess, par2, par3, par4 + 1); -+ this.aoLightValueScratchXYNP = par1Block.getAmbientOcclusionLightValue(this.blockAccess, par2, par3 + 1, par4); -+ this.aoBrightnessXYNN = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2, par3 - 1, par4); -+ this.aoBrightnessXZNN = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2, par3, par4 - 1); -+ this.aoBrightnessXZNP = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2, par3, par4 + 1); -+ this.aoBrightnessXYNP = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2, par3 + 1, par4); -+ var16 = Block.canBlockGrass[this.blockAccess.getBlockId(par2 - 1, par3 + 1, par4)]; -+ var17 = Block.canBlockGrass[this.blockAccess.getBlockId(par2 - 1, par3 - 1, par4)]; -+ var18 = Block.canBlockGrass[this.blockAccess.getBlockId(par2 - 1, par3, par4 - 1)]; -+ var19 = Block.canBlockGrass[this.blockAccess.getBlockId(par2 - 1, par3, par4 + 1)]; -+ -+ if (!var18 && !var17) { - this.aoLightValueScratchXYZNNN = this.aoLightValueScratchXZNN; - this.aoBrightnessXYZNNN = this.aoBrightnessXZNN; - } else { -- this.aoLightValueScratchXYZNNN = var1.getAmbientOcclusionLightValue(this.blockAccess, var2, var3 - 1, var4 - 1); -- this.aoBrightnessXYZNNN = var1.getMixedBrightnessForBlock(this.blockAccess, var2, var3 - 1, var4 - 1); -+ this.aoLightValueScratchXYZNNN = par1Block.getAmbientOcclusionLightValue(this.blockAccess, par2, par3 - 1, par4 - 1); -+ this.aoBrightnessXYZNNN = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2, par3 - 1, par4 - 1); - } - -- if(!var19 && !var17) { -+ if (!var19 && !var17) { - this.aoLightValueScratchXYZNNP = this.aoLightValueScratchXZNP; - this.aoBrightnessXYZNNP = this.aoBrightnessXZNP; - } else { -- this.aoLightValueScratchXYZNNP = var1.getAmbientOcclusionLightValue(this.blockAccess, var2, var3 - 1, var4 + 1); -- this.aoBrightnessXYZNNP = var1.getMixedBrightnessForBlock(this.blockAccess, var2, var3 - 1, var4 + 1); -+ this.aoLightValueScratchXYZNNP = par1Block.getAmbientOcclusionLightValue(this.blockAccess, par2, par3 - 1, par4 + 1); -+ this.aoBrightnessXYZNNP = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2, par3 - 1, par4 + 1); - } - -- if(!var18 && !var16) { -+ if (!var18 && !var16) { - this.aoLightValueScratchXYZNPN = this.aoLightValueScratchXZNN; - this.aoBrightnessXYZNPN = this.aoBrightnessXZNN; - } else { -- this.aoLightValueScratchXYZNPN = var1.getAmbientOcclusionLightValue(this.blockAccess, var2, var3 + 1, var4 - 1); -- this.aoBrightnessXYZNPN = var1.getMixedBrightnessForBlock(this.blockAccess, var2, var3 + 1, var4 - 1); -+ this.aoLightValueScratchXYZNPN = par1Block.getAmbientOcclusionLightValue(this.blockAccess, par2, par3 + 1, par4 - 1); -+ this.aoBrightnessXYZNPN = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2, par3 + 1, par4 - 1); - } - -- if(!var19 && !var16) { -+ if (!var19 && !var16) { - this.aoLightValueScratchXYZNPP = this.aoLightValueScratchXZNP; - this.aoBrightnessXYZNPP = this.aoBrightnessXZNP; - } else { -- this.aoLightValueScratchXYZNPP = var1.getAmbientOcclusionLightValue(this.blockAccess, var2, var3 + 1, var4 + 1); -- this.aoBrightnessXYZNPP = var1.getMixedBrightnessForBlock(this.blockAccess, var2, var3 + 1, var4 + 1); -+ this.aoLightValueScratchXYZNPP = par1Block.getAmbientOcclusionLightValue(this.blockAccess, par2, par3 + 1, par4 + 1); -+ this.aoBrightnessXYZNPP = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2, par3 + 1, par4 + 1); - } - -- if(this.renderMinX <= 0.0D) { -- ++var2; -+ if (this.renderMinX <= 0.0D) { -+ ++par2; - } - - var20 = var14; -- if(this.renderMinX <= 0.0D || !this.blockAccess.isBlockOpaqueCube(var2 - 1, var3, var4)) { -- var20 = var1.getMixedBrightnessForBlock(this.blockAccess, var2 - 1, var3, var4); -+ -+ if (this.renderMinX <= 0.0D || !this.blockAccess.isBlockOpaqueCube(par2 - 1, par3, par4)) { -+ var20 = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2 - 1, par3, par4); - } - -- var21 = var1.getAmbientOcclusionLightValue(this.blockAccess, var2 - 1, var3, var4); -+ var21 = par1Block.getAmbientOcclusionLightValue(this.blockAccess, par2 - 1, par3, par4); - var12 = (this.aoLightValueScratchXYNN + this.aoLightValueScratchXYZNNP + var21 + this.aoLightValueScratchXZNP) / 4.0F; - var9 = (var21 + this.aoLightValueScratchXZNP + this.aoLightValueScratchXYNP + this.aoLightValueScratchXYZNPP) / 4.0F; - var10 = (this.aoLightValueScratchXZNN + var21 + this.aoLightValueScratchXYZNPN + this.aoLightValueScratchXYNP) / 4.0F; -@@ -3787,14 +4436,15 @@ - this.brightnessTopLeft = this.getAoBrightness(this.aoBrightnessXZNP, this.aoBrightnessXYNP, this.aoBrightnessXYZNPP, var20); - this.brightnessBottomLeft = this.getAoBrightness(this.aoBrightnessXZNN, this.aoBrightnessXYZNPN, this.aoBrightnessXYNP, var20); - this.brightnessBottomRight = this.getAoBrightness(this.aoBrightnessXYZNNN, this.aoBrightnessXYNN, this.aoBrightnessXZNN, var20); -- if(var13) { -- this.colorRedTopLeft = this.colorRedBottomLeft = this.colorRedBottomRight = this.colorRedTopRight = var5 * 0.6F; -- this.colorGreenTopLeft = this.colorGreenBottomLeft = this.colorGreenBottomRight = this.colorGreenTopRight = var6 * 0.6F; -- this.colorBlueTopLeft = this.colorBlueBottomLeft = this.colorBlueBottomRight = this.colorBlueTopRight = var7 * 0.6F; -+ -+ if (!var13 ? (!fancyGrass ? CTMUtils.isBetterGrass(this.blockAccess, par1Block, par2, par3, par4, 4) : false) : true) { -+ this.colorRedTopLeft = this.colorRedBottomLeft = this.colorRedBottomRight = this.colorRedTopRight = par5 * RenderPass.getAOBaseMultiplier(0.6F); -+ this.colorGreenTopLeft = this.colorGreenBottomLeft = this.colorGreenBottomRight = this.colorGreenTopRight = par6 * RenderPass.getAOBaseMultiplier(0.6F); -+ this.colorBlueTopLeft = this.colorBlueBottomLeft = this.colorBlueBottomRight = this.colorBlueTopRight = par7 * RenderPass.getAOBaseMultiplier(0.6F); - } else { -- this.colorRedTopLeft = this.colorRedBottomLeft = this.colorRedBottomRight = this.colorRedTopRight = 0.6F; -- this.colorGreenTopLeft = this.colorGreenBottomLeft = this.colorGreenBottomRight = this.colorGreenTopRight = 0.6F; -- this.colorBlueTopLeft = this.colorBlueBottomLeft = this.colorBlueBottomRight = this.colorBlueTopRight = 0.6F; -+ this.colorRedTopLeft = this.colorRedBottomLeft = this.colorRedBottomRight = this.colorRedTopRight = RenderPass.getAOBaseMultiplier(0.6F); -+ this.colorGreenTopLeft = this.colorGreenBottomLeft = this.colorGreenBottomRight = this.colorGreenTopRight = RenderPass.getAOBaseMultiplier(0.6F); -+ this.colorBlueTopLeft = this.colorBlueBottomLeft = this.colorBlueBottomRight = this.colorBlueTopRight = RenderPass.getAOBaseMultiplier(0.6F); - } - - this.colorRedTopLeft *= var9; -@@ -3809,86 +4459,89 @@ - this.colorRedTopRight *= var12; - this.colorGreenTopRight *= var12; - this.colorBlueTopRight *= var12; -- var22 = this.getBlockIcon(var1, this.blockAccess, var2, var3, var4, 4); -- this.renderFaceXNeg(var1, (double)var2, (double)var3, (double)var4, var22); -- if(fancyGrass && var22.getIconName().equals("grass_side") && !this.hasOverrideBlockTexture()) { -- this.colorRedTopLeft *= var5; -- this.colorRedBottomLeft *= var5; -- this.colorRedBottomRight *= var5; -- this.colorRedTopRight *= var5; -- this.colorGreenTopLeft *= var6; -- this.colorGreenBottomLeft *= var6; -- this.colorGreenBottomRight *= var6; -- this.colorGreenTopRight *= var6; -- this.colorBlueTopLeft *= var7; -- this.colorBlueBottomLeft *= var7; -- this.colorBlueBottomRight *= var7; -- this.colorBlueTopRight *= var7; -- this.renderFaceXNeg(var1, (double)var2, (double)var3, (double)var4, BlockGrass.getIconSideOverlay()); -+ var22 = this.getBlockIcon(par1Block, this.blockAccess, par2, par3, par4, 4); -+ this.renderFaceXNeg(par1Block, (double)par2, (double)par3, (double)par4, var22); -+ -+ if (fancyGrass && var22.getIconName().equals("grass_side") && !this.hasOverrideBlockTexture()) { -+ this.colorRedTopLeft *= par5; -+ this.colorRedBottomLeft *= par5; -+ this.colorRedBottomRight *= par5; -+ this.colorRedTopRight *= par5; -+ this.colorGreenTopLeft *= par6; -+ this.colorGreenBottomLeft *= par6; -+ this.colorGreenBottomRight *= par6; -+ this.colorGreenTopRight *= par6; -+ this.colorBlueTopLeft *= par7; -+ this.colorBlueBottomLeft *= par7; -+ this.colorBlueBottomRight *= par7; -+ this.colorBlueTopRight *= par7; -+ this.renderFaceXNeg(par1Block, (double)par2, (double)par3, (double)par4, BlockGrass.getIconSideOverlay()); - } - - var8 = true; - } - -- if(this.renderAllFaces || var1.shouldSideBeRendered(this.blockAccess, var2 + 1, var3, var4, 5)) { -- if(this.renderMaxX >= 1.0D) { -- ++var2; -+ if (this.renderAllFaces || RenderPass.shouldSideBeRendered(par1Block, this.blockAccess, par2 + 1, par3, par4, 5)) { -+ if (this.renderMaxX >= 1.0D) { -+ ++par2; - } - -- this.aoLightValueScratchXYPN = var1.getAmbientOcclusionLightValue(this.blockAccess, var2, var3 - 1, var4); -- this.aoLightValueScratchXZPN = var1.getAmbientOcclusionLightValue(this.blockAccess, var2, var3, var4 - 1); -- this.aoLightValueScratchXZPP = var1.getAmbientOcclusionLightValue(this.blockAccess, var2, var3, var4 + 1); -- this.aoLightValueScratchXYPP = var1.getAmbientOcclusionLightValue(this.blockAccess, var2, var3 + 1, var4); -- this.aoBrightnessXYPN = var1.getMixedBrightnessForBlock(this.blockAccess, var2, var3 - 1, var4); -- this.aoBrightnessXZPN = var1.getMixedBrightnessForBlock(this.blockAccess, var2, var3, var4 - 1); -- this.aoBrightnessXZPP = var1.getMixedBrightnessForBlock(this.blockAccess, var2, var3, var4 + 1); -- this.aoBrightnessXYPP = var1.getMixedBrightnessForBlock(this.blockAccess, var2, var3 + 1, var4); -- var16 = Block.canBlockGrass[this.blockAccess.getBlockId(var2 + 1, var3 + 1, var4)]; -- var17 = Block.canBlockGrass[this.blockAccess.getBlockId(var2 + 1, var3 - 1, var4)]; -- var18 = Block.canBlockGrass[this.blockAccess.getBlockId(var2 + 1, var3, var4 + 1)]; -- var19 = Block.canBlockGrass[this.blockAccess.getBlockId(var2 + 1, var3, var4 - 1)]; -- if(!var17 && !var19) { -+ this.aoLightValueScratchXYPN = par1Block.getAmbientOcclusionLightValue(this.blockAccess, par2, par3 - 1, par4); -+ this.aoLightValueScratchXZPN = par1Block.getAmbientOcclusionLightValue(this.blockAccess, par2, par3, par4 - 1); -+ this.aoLightValueScratchXZPP = par1Block.getAmbientOcclusionLightValue(this.blockAccess, par2, par3, par4 + 1); -+ this.aoLightValueScratchXYPP = par1Block.getAmbientOcclusionLightValue(this.blockAccess, par2, par3 + 1, par4); -+ this.aoBrightnessXYPN = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2, par3 - 1, par4); -+ this.aoBrightnessXZPN = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2, par3, par4 - 1); -+ this.aoBrightnessXZPP = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2, par3, par4 + 1); -+ this.aoBrightnessXYPP = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2, par3 + 1, par4); -+ var16 = Block.canBlockGrass[this.blockAccess.getBlockId(par2 + 1, par3 + 1, par4)]; -+ var17 = Block.canBlockGrass[this.blockAccess.getBlockId(par2 + 1, par3 - 1, par4)]; -+ var18 = Block.canBlockGrass[this.blockAccess.getBlockId(par2 + 1, par3, par4 + 1)]; -+ var19 = Block.canBlockGrass[this.blockAccess.getBlockId(par2 + 1, par3, par4 - 1)]; -+ -+ if (!var17 && !var19) { - this.aoLightValueScratchXYZPNN = this.aoLightValueScratchXZPN; - this.aoBrightnessXYZPNN = this.aoBrightnessXZPN; - } else { -- this.aoLightValueScratchXYZPNN = var1.getAmbientOcclusionLightValue(this.blockAccess, var2, var3 - 1, var4 - 1); -- this.aoBrightnessXYZPNN = var1.getMixedBrightnessForBlock(this.blockAccess, var2, var3 - 1, var4 - 1); -+ this.aoLightValueScratchXYZPNN = par1Block.getAmbientOcclusionLightValue(this.blockAccess, par2, par3 - 1, par4 - 1); -+ this.aoBrightnessXYZPNN = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2, par3 - 1, par4 - 1); - } - -- if(!var17 && !var18) { -+ if (!var17 && !var18) { - this.aoLightValueScratchXYZPNP = this.aoLightValueScratchXZPP; - this.aoBrightnessXYZPNP = this.aoBrightnessXZPP; - } else { -- this.aoLightValueScratchXYZPNP = var1.getAmbientOcclusionLightValue(this.blockAccess, var2, var3 - 1, var4 + 1); -- this.aoBrightnessXYZPNP = var1.getMixedBrightnessForBlock(this.blockAccess, var2, var3 - 1, var4 + 1); -+ this.aoLightValueScratchXYZPNP = par1Block.getAmbientOcclusionLightValue(this.blockAccess, par2, par3 - 1, par4 + 1); -+ this.aoBrightnessXYZPNP = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2, par3 - 1, par4 + 1); - } - -- if(!var16 && !var19) { -+ if (!var16 && !var19) { - this.aoLightValueScratchXYZPPN = this.aoLightValueScratchXZPN; - this.aoBrightnessXYZPPN = this.aoBrightnessXZPN; - } else { -- this.aoLightValueScratchXYZPPN = var1.getAmbientOcclusionLightValue(this.blockAccess, var2, var3 + 1, var4 - 1); -- this.aoBrightnessXYZPPN = var1.getMixedBrightnessForBlock(this.blockAccess, var2, var3 + 1, var4 - 1); -+ this.aoLightValueScratchXYZPPN = par1Block.getAmbientOcclusionLightValue(this.blockAccess, par2, par3 + 1, par4 - 1); -+ this.aoBrightnessXYZPPN = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2, par3 + 1, par4 - 1); - } - -- if(!var16 && !var18) { -+ if (!var16 && !var18) { - this.aoLightValueScratchXYZPPP = this.aoLightValueScratchXZPP; - this.aoBrightnessXYZPPP = this.aoBrightnessXZPP; - } else { -- this.aoLightValueScratchXYZPPP = var1.getAmbientOcclusionLightValue(this.blockAccess, var2, var3 + 1, var4 + 1); -- this.aoBrightnessXYZPPP = var1.getMixedBrightnessForBlock(this.blockAccess, var2, var3 + 1, var4 + 1); -+ this.aoLightValueScratchXYZPPP = par1Block.getAmbientOcclusionLightValue(this.blockAccess, par2, par3 + 1, par4 + 1); -+ this.aoBrightnessXYZPPP = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2, par3 + 1, par4 + 1); - } - -- if(this.renderMaxX >= 1.0D) { -- --var2; -+ if (this.renderMaxX >= 1.0D) { -+ --par2; - } - - var20 = var14; -- if(this.renderMaxX >= 1.0D || !this.blockAccess.isBlockOpaqueCube(var2 + 1, var3, var4)) { -- var20 = var1.getMixedBrightnessForBlock(this.blockAccess, var2 + 1, var3, var4); -+ -+ if (this.renderMaxX >= 1.0D || !this.blockAccess.isBlockOpaqueCube(par2 + 1, par3, par4)) { -+ var20 = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2 + 1, par3, par4); - } - -- var21 = var1.getAmbientOcclusionLightValue(this.blockAccess, var2 + 1, var3, var4); -+ var21 = par1Block.getAmbientOcclusionLightValue(this.blockAccess, par2 + 1, par3, par4); - var9 = (this.aoLightValueScratchXYPN + this.aoLightValueScratchXYZPNP + var21 + this.aoLightValueScratchXZPP) / 4.0F; - var10 = (this.aoLightValueScratchXYZPNN + this.aoLightValueScratchXYPN + this.aoLightValueScratchXZPN + var21) / 4.0F; - var11 = (this.aoLightValueScratchXZPN + var21 + this.aoLightValueScratchXYZPPN + this.aoLightValueScratchXYPP) / 4.0F; -@@ -3897,14 +4550,15 @@ - this.brightnessTopRight = this.getAoBrightness(this.aoBrightnessXZPP, this.aoBrightnessXYPP, this.aoBrightnessXYZPPP, var20); - this.brightnessBottomRight = this.getAoBrightness(this.aoBrightnessXZPN, this.aoBrightnessXYZPPN, this.aoBrightnessXYPP, var20); - this.brightnessBottomLeft = this.getAoBrightness(this.aoBrightnessXYZPNN, this.aoBrightnessXYPN, this.aoBrightnessXZPN, var20); -- if(var13) { -- this.colorRedTopLeft = this.colorRedBottomLeft = this.colorRedBottomRight = this.colorRedTopRight = var5 * 0.6F; -- this.colorGreenTopLeft = this.colorGreenBottomLeft = this.colorGreenBottomRight = this.colorGreenTopRight = var6 * 0.6F; -- this.colorBlueTopLeft = this.colorBlueBottomLeft = this.colorBlueBottomRight = this.colorBlueTopRight = var7 * 0.6F; -+ -+ if (!var13 ? (!fancyGrass ? CTMUtils.isBetterGrass(this.blockAccess, par1Block, par2, par3, par4, 5) : false) : true) { -+ this.colorRedTopLeft = this.colorRedBottomLeft = this.colorRedBottomRight = this.colorRedTopRight = par5 * RenderPass.getAOBaseMultiplier(0.6F); -+ this.colorGreenTopLeft = this.colorGreenBottomLeft = this.colorGreenBottomRight = this.colorGreenTopRight = par6 * RenderPass.getAOBaseMultiplier(0.6F); -+ this.colorBlueTopLeft = this.colorBlueBottomLeft = this.colorBlueBottomRight = this.colorBlueTopRight = par7 * RenderPass.getAOBaseMultiplier(0.6F); - } else { -- this.colorRedTopLeft = this.colorRedBottomLeft = this.colorRedBottomRight = this.colorRedTopRight = 0.6F; -- this.colorGreenTopLeft = this.colorGreenBottomLeft = this.colorGreenBottomRight = this.colorGreenTopRight = 0.6F; -- this.colorBlueTopLeft = this.colorBlueBottomLeft = this.colorBlueBottomRight = this.colorBlueTopRight = 0.6F; -+ this.colorRedTopLeft = this.colorRedBottomLeft = this.colorRedBottomRight = this.colorRedTopRight = RenderPass.getAOBaseMultiplier(0.6F); -+ this.colorGreenTopLeft = this.colorGreenBottomLeft = this.colorGreenBottomRight = this.colorGreenTopRight = RenderPass.getAOBaseMultiplier(0.6F); -+ this.colorBlueTopLeft = this.colorBlueBottomLeft = this.colorBlueBottomRight = this.colorBlueTopRight = RenderPass.getAOBaseMultiplier(0.6F); - } - - this.colorRedTopLeft *= var9; -@@ -3919,22 +4573,23 @@ - this.colorRedTopRight *= var12; - this.colorGreenTopRight *= var12; - this.colorBlueTopRight *= var12; -- var22 = this.getBlockIcon(var1, this.blockAccess, var2, var3, var4, 5); -- this.renderFaceXPos(var1, (double)var2, (double)var3, (double)var4, var22); -- if(fancyGrass && var22.getIconName().equals("grass_side") && !this.hasOverrideBlockTexture()) { -- this.colorRedTopLeft *= var5; -- this.colorRedBottomLeft *= var5; -- this.colorRedBottomRight *= var5; -- this.colorRedTopRight *= var5; -- this.colorGreenTopLeft *= var6; -- this.colorGreenBottomLeft *= var6; -- this.colorGreenBottomRight *= var6; -- this.colorGreenTopRight *= var6; -- this.colorBlueTopLeft *= var7; -- this.colorBlueBottomLeft *= var7; -- this.colorBlueBottomRight *= var7; -- this.colorBlueTopRight *= var7; -- this.renderFaceXPos(var1, (double)var2, (double)var3, (double)var4, BlockGrass.getIconSideOverlay()); -+ var22 = this.getBlockIcon(par1Block, this.blockAccess, par2, par3, par4, 5); -+ this.renderFaceXPos(par1Block, (double)par2, (double)par3, (double)par4, var22); -+ -+ if (fancyGrass && var22.getIconName().equals("grass_side") && !this.hasOverrideBlockTexture()) { -+ this.colorRedTopLeft *= par5; -+ this.colorRedBottomLeft *= par5; -+ this.colorRedBottomRight *= par5; -+ this.colorRedTopRight *= par5; -+ this.colorGreenTopLeft *= par6; -+ this.colorGreenBottomLeft *= par6; -+ this.colorGreenBottomRight *= par6; -+ this.colorGreenTopRight *= par6; -+ this.colorBlueTopLeft *= par7; -+ this.colorBlueBottomLeft *= par7; -+ this.colorBlueBottomRight *= par7; -+ this.colorBlueTopRight *= par7; -+ this.renderFaceXPos(par1Block, (double)par2, (double)par3, (double)par4, BlockGrass.getIconSideOverlay()); - } - - var8 = true; -@@ -3944,7 +4599,10 @@ - return var8; - } - -- public boolean renderStandardBlockWithAmbientOcclusionPartial(Block var1, int var2, int var3, int var4, float var5, float var6, float var7) { -+ /** -+ * Renders non-full-cube block with ambient occusion. Args: block, x, y, z, red, green, blue (lighting) -+ */ -+ public boolean renderStandardBlockWithAmbientOcclusionPartial(Block par1Block, int par2, int par3, int par4, float par5, float par6, float par7) { - this.enableAO = true; - boolean var8 = false; - float var9 = 0.0F; -@@ -3952,80 +4610,84 @@ - float var11 = 0.0F; - float var12 = 0.0F; - boolean var13 = true; -- int var14 = var1.getMixedBrightnessForBlock(this.blockAccess, var2, var3, var4); -+ int var14 = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2, par3, par4); - Tessellator var15 = Tessellator.instance; - var15.setBrightness(983055); -- if(this.getBlockIcon(var1).getIconName().equals("grass_top")) { -+ -+ if (this.getBlockIcon(par1Block).getIconName().equals("grass_top")) { - var13 = false; -- } else if(this.hasOverrideBlockTexture()) { -+ } else if (this.hasOverrideBlockTexture()) { - var13 = false; - } - -- boolean var16; - boolean var17; -- boolean var18; -+ boolean var16; - boolean var19; -- int var20; -+ boolean var18; - float var21; -- if(this.renderAllFaces || var1.shouldSideBeRendered(this.blockAccess, var2, var3 - 1, var4, 0)) { -- if(this.renderMinY <= 0.0D) { -- --var3; -+ int var20; -+ -+ if (this.renderAllFaces || RenderPass.shouldSideBeRendered(par1Block, this.blockAccess, par2, par3 - 1, par4, 0)) { -+ if (this.renderMinY <= 0.0D) { -+ --par3; - } - -- this.aoBrightnessXYNN = var1.getMixedBrightnessForBlock(this.blockAccess, var2 - 1, var3, var4); -- this.aoBrightnessYZNN = var1.getMixedBrightnessForBlock(this.blockAccess, var2, var3, var4 - 1); -- this.aoBrightnessYZNP = var1.getMixedBrightnessForBlock(this.blockAccess, var2, var3, var4 + 1); -- this.aoBrightnessXYPN = var1.getMixedBrightnessForBlock(this.blockAccess, var2 + 1, var3, var4); -- this.aoLightValueScratchXYNN = var1.getAmbientOcclusionLightValue(this.blockAccess, var2 - 1, var3, var4); -- this.aoLightValueScratchYZNN = var1.getAmbientOcclusionLightValue(this.blockAccess, var2, var3, var4 - 1); -- this.aoLightValueScratchYZNP = var1.getAmbientOcclusionLightValue(this.blockAccess, var2, var3, var4 + 1); -- this.aoLightValueScratchXYPN = var1.getAmbientOcclusionLightValue(this.blockAccess, var2 + 1, var3, var4); -- var16 = Block.canBlockGrass[this.blockAccess.getBlockId(var2 + 1, var3 - 1, var4)]; -- var17 = Block.canBlockGrass[this.blockAccess.getBlockId(var2 - 1, var3 - 1, var4)]; -- var18 = Block.canBlockGrass[this.blockAccess.getBlockId(var2, var3 - 1, var4 + 1)]; -- var19 = Block.canBlockGrass[this.blockAccess.getBlockId(var2, var3 - 1, var4 - 1)]; -- if(!var19 && !var17) { -+ this.aoBrightnessXYNN = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2 - 1, par3, par4); -+ this.aoBrightnessYZNN = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2, par3, par4 - 1); -+ this.aoBrightnessYZNP = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2, par3, par4 + 1); -+ this.aoBrightnessXYPN = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2 + 1, par3, par4); -+ this.aoLightValueScratchXYNN = par1Block.getAmbientOcclusionLightValue(this.blockAccess, par2 - 1, par3, par4); -+ this.aoLightValueScratchYZNN = par1Block.getAmbientOcclusionLightValue(this.blockAccess, par2, par3, par4 - 1); -+ this.aoLightValueScratchYZNP = par1Block.getAmbientOcclusionLightValue(this.blockAccess, par2, par3, par4 + 1); -+ this.aoLightValueScratchXYPN = par1Block.getAmbientOcclusionLightValue(this.blockAccess, par2 + 1, par3, par4); -+ var16 = Block.canBlockGrass[this.blockAccess.getBlockId(par2 + 1, par3 - 1, par4)]; -+ var17 = Block.canBlockGrass[this.blockAccess.getBlockId(par2 - 1, par3 - 1, par4)]; -+ var18 = Block.canBlockGrass[this.blockAccess.getBlockId(par2, par3 - 1, par4 + 1)]; -+ var19 = Block.canBlockGrass[this.blockAccess.getBlockId(par2, par3 - 1, par4 - 1)]; -+ -+ if (!var19 && !var17) { - this.aoLightValueScratchXYZNNN = this.aoLightValueScratchXYNN; - this.aoBrightnessXYZNNN = this.aoBrightnessXYNN; - } else { -- this.aoLightValueScratchXYZNNN = var1.getAmbientOcclusionLightValue(this.blockAccess, var2 - 1, var3, var4 - 1); -- this.aoBrightnessXYZNNN = var1.getMixedBrightnessForBlock(this.blockAccess, var2 - 1, var3, var4 - 1); -+ this.aoLightValueScratchXYZNNN = par1Block.getAmbientOcclusionLightValue(this.blockAccess, par2 - 1, par3, par4 - 1); -+ this.aoBrightnessXYZNNN = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2 - 1, par3, par4 - 1); - } - -- if(!var18 && !var17) { -+ if (!var18 && !var17) { - this.aoLightValueScratchXYZNNP = this.aoLightValueScratchXYNN; - this.aoBrightnessXYZNNP = this.aoBrightnessXYNN; - } else { -- this.aoLightValueScratchXYZNNP = var1.getAmbientOcclusionLightValue(this.blockAccess, var2 - 1, var3, var4 + 1); -- this.aoBrightnessXYZNNP = var1.getMixedBrightnessForBlock(this.blockAccess, var2 - 1, var3, var4 + 1); -+ this.aoLightValueScratchXYZNNP = par1Block.getAmbientOcclusionLightValue(this.blockAccess, par2 - 1, par3, par4 + 1); -+ this.aoBrightnessXYZNNP = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2 - 1, par3, par4 + 1); - } - -- if(!var19 && !var16) { -+ if (!var19 && !var16) { - this.aoLightValueScratchXYZPNN = this.aoLightValueScratchXYPN; - this.aoBrightnessXYZPNN = this.aoBrightnessXYPN; - } else { -- this.aoLightValueScratchXYZPNN = var1.getAmbientOcclusionLightValue(this.blockAccess, var2 + 1, var3, var4 - 1); -- this.aoBrightnessXYZPNN = var1.getMixedBrightnessForBlock(this.blockAccess, var2 + 1, var3, var4 - 1); -+ this.aoLightValueScratchXYZPNN = par1Block.getAmbientOcclusionLightValue(this.blockAccess, par2 + 1, par3, par4 - 1); -+ this.aoBrightnessXYZPNN = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2 + 1, par3, par4 - 1); - } - -- if(!var18 && !var16) { -+ if (!var18 && !var16) { - this.aoLightValueScratchXYZPNP = this.aoLightValueScratchXYPN; - this.aoBrightnessXYZPNP = this.aoBrightnessXYPN; - } else { -- this.aoLightValueScratchXYZPNP = var1.getAmbientOcclusionLightValue(this.blockAccess, var2 + 1, var3, var4 + 1); -- this.aoBrightnessXYZPNP = var1.getMixedBrightnessForBlock(this.blockAccess, var2 + 1, var3, var4 + 1); -+ this.aoLightValueScratchXYZPNP = par1Block.getAmbientOcclusionLightValue(this.blockAccess, par2 + 1, par3, par4 + 1); -+ this.aoBrightnessXYZPNP = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2 + 1, par3, par4 + 1); - } - -- if(this.renderMinY <= 0.0D) { -- ++var3; -+ if (this.renderMinY <= 0.0D) { -+ ++par3; - } - - var20 = var14; -- if(this.renderMinY <= 0.0D || !this.blockAccess.isBlockOpaqueCube(var2, var3 - 1, var4)) { -- var20 = var1.getMixedBrightnessForBlock(this.blockAccess, var2, var3 - 1, var4); -+ -+ if (this.renderMinY <= 0.0D || !this.blockAccess.isBlockOpaqueCube(par2, par3 - 1, par4)) { -+ var20 = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2, par3 - 1, par4); - } - -- var21 = var1.getAmbientOcclusionLightValue(this.blockAccess, var2, var3 - 1, var4); -+ var21 = par1Block.getAmbientOcclusionLightValue(this.blockAccess, par2, par3 - 1, par4); - var9 = (this.aoLightValueScratchXYZNNP + this.aoLightValueScratchXYNN + this.aoLightValueScratchYZNP + var21) / 4.0F; - var12 = (this.aoLightValueScratchYZNP + var21 + this.aoLightValueScratchXYZPNP + this.aoLightValueScratchXYPN) / 4.0F; - var11 = (var21 + this.aoLightValueScratchYZNN + this.aoLightValueScratchXYPN + this.aoLightValueScratchXYZPNN) / 4.0F; -@@ -4034,10 +4696,11 @@ - this.brightnessTopRight = this.getAoBrightness(this.aoBrightnessYZNP, this.aoBrightnessXYZPNP, this.aoBrightnessXYPN, var20); - this.brightnessBottomRight = this.getAoBrightness(this.aoBrightnessYZNN, this.aoBrightnessXYPN, this.aoBrightnessXYZPNN, var20); - this.brightnessBottomLeft = this.getAoBrightness(this.aoBrightnessXYNN, this.aoBrightnessXYZNNN, this.aoBrightnessYZNN, var20); -- if(var13) { -- this.colorRedTopLeft = this.colorRedBottomLeft = this.colorRedBottomRight = this.colorRedTopRight = var5 * 0.5F; -- this.colorGreenTopLeft = this.colorGreenBottomLeft = this.colorGreenBottomRight = this.colorGreenTopRight = var6 * 0.5F; -- this.colorBlueTopLeft = this.colorBlueBottomLeft = this.colorBlueBottomRight = this.colorBlueTopRight = var7 * 0.5F; -+ -+ if (var13) { -+ this.colorRedTopLeft = this.colorRedBottomLeft = this.colorRedBottomRight = this.colorRedTopRight = par5 * 0.5F; -+ this.colorGreenTopLeft = this.colorGreenBottomLeft = this.colorGreenBottomRight = this.colorGreenTopRight = par6 * 0.5F; -+ this.colorBlueTopLeft = this.colorBlueBottomLeft = this.colorBlueBottomRight = this.colorBlueTopRight = par7 * 0.5F; - } else { - this.colorRedTopLeft = this.colorRedBottomLeft = this.colorRedBottomRight = this.colorRedTopRight = 0.5F; - this.colorGreenTopLeft = this.colorGreenBottomLeft = this.colorGreenBottomRight = this.colorGreenTopRight = 0.5F; -@@ -4056,69 +4719,71 @@ - this.colorRedTopRight *= var12; - this.colorGreenTopRight *= var12; - this.colorBlueTopRight *= var12; -- this.renderFaceYNeg(var1, (double)var2, (double)var3, (double)var4, this.getBlockIcon(var1, this.blockAccess, var2, var3, var4, 0)); -+ this.renderFaceYNeg(par1Block, (double)par2, (double)par3, (double)par4, this.getBlockIcon(par1Block, this.blockAccess, par2, par3, par4, 0)); - var8 = true; - } - -- if(this.renderAllFaces || var1.shouldSideBeRendered(this.blockAccess, var2, var3 + 1, var4, 1)) { -- if(this.renderMaxY >= 1.0D) { -- ++var3; -+ if (this.renderAllFaces || RenderPass.shouldSideBeRendered(par1Block, this.blockAccess, par2, par3 + 1, par4, 1)) { -+ if (this.renderMaxY >= 1.0D) { -+ ++par3; - } - -- this.aoBrightnessXYNP = var1.getMixedBrightnessForBlock(this.blockAccess, var2 - 1, var3, var4); -- this.aoBrightnessXYPP = var1.getMixedBrightnessForBlock(this.blockAccess, var2 + 1, var3, var4); -- this.aoBrightnessYZPN = var1.getMixedBrightnessForBlock(this.blockAccess, var2, var3, var4 - 1); -- this.aoBrightnessYZPP = var1.getMixedBrightnessForBlock(this.blockAccess, var2, var3, var4 + 1); -- this.aoLightValueScratchXYNP = var1.getAmbientOcclusionLightValue(this.blockAccess, var2 - 1, var3, var4); -- this.aoLightValueScratchXYPP = var1.getAmbientOcclusionLightValue(this.blockAccess, var2 + 1, var3, var4); -- this.aoLightValueScratchYZPN = var1.getAmbientOcclusionLightValue(this.blockAccess, var2, var3, var4 - 1); -- this.aoLightValueScratchYZPP = var1.getAmbientOcclusionLightValue(this.blockAccess, var2, var3, var4 + 1); -- var16 = Block.canBlockGrass[this.blockAccess.getBlockId(var2 + 1, var3 + 1, var4)]; -- var17 = Block.canBlockGrass[this.blockAccess.getBlockId(var2 - 1, var3 + 1, var4)]; -- var18 = Block.canBlockGrass[this.blockAccess.getBlockId(var2, var3 + 1, var4 + 1)]; -- var19 = Block.canBlockGrass[this.blockAccess.getBlockId(var2, var3 + 1, var4 - 1)]; -- if(!var19 && !var17) { -+ this.aoBrightnessXYNP = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2 - 1, par3, par4); -+ this.aoBrightnessXYPP = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2 + 1, par3, par4); -+ this.aoBrightnessYZPN = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2, par3, par4 - 1); -+ this.aoBrightnessYZPP = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2, par3, par4 + 1); -+ this.aoLightValueScratchXYNP = par1Block.getAmbientOcclusionLightValue(this.blockAccess, par2 - 1, par3, par4); -+ this.aoLightValueScratchXYPP = par1Block.getAmbientOcclusionLightValue(this.blockAccess, par2 + 1, par3, par4); -+ this.aoLightValueScratchYZPN = par1Block.getAmbientOcclusionLightValue(this.blockAccess, par2, par3, par4 - 1); -+ this.aoLightValueScratchYZPP = par1Block.getAmbientOcclusionLightValue(this.blockAccess, par2, par3, par4 + 1); -+ var16 = Block.canBlockGrass[this.blockAccess.getBlockId(par2 + 1, par3 + 1, par4)]; -+ var17 = Block.canBlockGrass[this.blockAccess.getBlockId(par2 - 1, par3 + 1, par4)]; -+ var18 = Block.canBlockGrass[this.blockAccess.getBlockId(par2, par3 + 1, par4 + 1)]; -+ var19 = Block.canBlockGrass[this.blockAccess.getBlockId(par2, par3 + 1, par4 - 1)]; -+ -+ if (!var19 && !var17) { - this.aoLightValueScratchXYZNPN = this.aoLightValueScratchXYNP; - this.aoBrightnessXYZNPN = this.aoBrightnessXYNP; - } else { -- this.aoLightValueScratchXYZNPN = var1.getAmbientOcclusionLightValue(this.blockAccess, var2 - 1, var3, var4 - 1); -- this.aoBrightnessXYZNPN = var1.getMixedBrightnessForBlock(this.blockAccess, var2 - 1, var3, var4 - 1); -+ this.aoLightValueScratchXYZNPN = par1Block.getAmbientOcclusionLightValue(this.blockAccess, par2 - 1, par3, par4 - 1); -+ this.aoBrightnessXYZNPN = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2 - 1, par3, par4 - 1); - } - -- if(!var19 && !var16) { -+ if (!var19 && !var16) { - this.aoLightValueScratchXYZPPN = this.aoLightValueScratchXYPP; - this.aoBrightnessXYZPPN = this.aoBrightnessXYPP; - } else { -- this.aoLightValueScratchXYZPPN = var1.getAmbientOcclusionLightValue(this.blockAccess, var2 + 1, var3, var4 - 1); -- this.aoBrightnessXYZPPN = var1.getMixedBrightnessForBlock(this.blockAccess, var2 + 1, var3, var4 - 1); -+ this.aoLightValueScratchXYZPPN = par1Block.getAmbientOcclusionLightValue(this.blockAccess, par2 + 1, par3, par4 - 1); -+ this.aoBrightnessXYZPPN = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2 + 1, par3, par4 - 1); - } - -- if(!var18 && !var17) { -+ if (!var18 && !var17) { - this.aoLightValueScratchXYZNPP = this.aoLightValueScratchXYNP; - this.aoBrightnessXYZNPP = this.aoBrightnessXYNP; - } else { -- this.aoLightValueScratchXYZNPP = var1.getAmbientOcclusionLightValue(this.blockAccess, var2 - 1, var3, var4 + 1); -- this.aoBrightnessXYZNPP = var1.getMixedBrightnessForBlock(this.blockAccess, var2 - 1, var3, var4 + 1); -+ this.aoLightValueScratchXYZNPP = par1Block.getAmbientOcclusionLightValue(this.blockAccess, par2 - 1, par3, par4 + 1); -+ this.aoBrightnessXYZNPP = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2 - 1, par3, par4 + 1); - } - -- if(!var18 && !var16) { -+ if (!var18 && !var16) { - this.aoLightValueScratchXYZPPP = this.aoLightValueScratchXYPP; - this.aoBrightnessXYZPPP = this.aoBrightnessXYPP; - } else { -- this.aoLightValueScratchXYZPPP = var1.getAmbientOcclusionLightValue(this.blockAccess, var2 + 1, var3, var4 + 1); -- this.aoBrightnessXYZPPP = var1.getMixedBrightnessForBlock(this.blockAccess, var2 + 1, var3, var4 + 1); -+ this.aoLightValueScratchXYZPPP = par1Block.getAmbientOcclusionLightValue(this.blockAccess, par2 + 1, par3, par4 + 1); -+ this.aoBrightnessXYZPPP = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2 + 1, par3, par4 + 1); - } - -- if(this.renderMaxY >= 1.0D) { -- --var3; -+ if (this.renderMaxY >= 1.0D) { -+ --par3; - } - - var20 = var14; -- if(this.renderMaxY >= 1.0D || !this.blockAccess.isBlockOpaqueCube(var2, var3 + 1, var4)) { -- var20 = var1.getMixedBrightnessForBlock(this.blockAccess, var2, var3 + 1, var4); -+ -+ if (this.renderMaxY >= 1.0D || !this.blockAccess.isBlockOpaqueCube(par2, par3 + 1, par4)) { -+ var20 = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2, par3 + 1, par4); - } - -- var21 = var1.getAmbientOcclusionLightValue(this.blockAccess, var2, var3 + 1, var4); -+ var21 = par1Block.getAmbientOcclusionLightValue(this.blockAccess, par2, par3 + 1, par4); - var12 = (this.aoLightValueScratchXYZNPP + this.aoLightValueScratchXYNP + this.aoLightValueScratchYZPP + var21) / 4.0F; - var9 = (this.aoLightValueScratchYZPP + var21 + this.aoLightValueScratchXYZPPP + this.aoLightValueScratchXYPP) / 4.0F; - var10 = (var21 + this.aoLightValueScratchYZPN + this.aoLightValueScratchXYPP + this.aoLightValueScratchXYZPPN) / 4.0F; -@@ -4127,9 +4792,9 @@ - this.brightnessTopLeft = this.getAoBrightness(this.aoBrightnessYZPP, this.aoBrightnessXYZPPP, this.aoBrightnessXYPP, var20); - this.brightnessBottomLeft = this.getAoBrightness(this.aoBrightnessYZPN, this.aoBrightnessXYPP, this.aoBrightnessXYZPPN, var20); - this.brightnessBottomRight = this.getAoBrightness(this.aoBrightnessXYNP, this.aoBrightnessXYZNPN, this.aoBrightnessYZPN, var20); -- this.colorRedTopLeft = this.colorRedBottomLeft = this.colorRedBottomRight = this.colorRedTopRight = var5; -- this.colorGreenTopLeft = this.colorGreenBottomLeft = this.colorGreenBottomRight = this.colorGreenTopRight = var6; -- this.colorBlueTopLeft = this.colorBlueBottomLeft = this.colorBlueBottomRight = this.colorBlueTopRight = var7; -+ this.colorRedTopLeft = this.colorRedBottomLeft = this.colorRedBottomRight = this.colorRedTopRight = par5; -+ this.colorGreenTopLeft = this.colorGreenBottomLeft = this.colorGreenBottomRight = this.colorGreenTopRight = par6; -+ this.colorBlueTopLeft = this.colorBlueBottomLeft = this.colorBlueBottomRight = this.colorBlueTopRight = par7; - this.colorRedTopLeft *= var9; - this.colorGreenTopLeft *= var9; - this.colorBlueTopLeft *= var9; -@@ -4142,78 +4807,81 @@ - this.colorRedTopRight *= var12; - this.colorGreenTopRight *= var12; - this.colorBlueTopRight *= var12; -- this.renderFaceYPos(var1, (double)var2, (double)var3, (double)var4, this.getBlockIcon(var1, this.blockAccess, var2, var3, var4, 1)); -+ this.renderFaceYPos(par1Block, (double)par2, (double)par3, (double)par4, this.getBlockIcon(par1Block, this.blockAccess, par2, par3, par4, 1)); - var8 = true; - } - -- float var22; - float var23; -- float var24; -+ float var22; - float var25; -- int var26; -+ float var24; - int var27; -- int var28; -+ int var26; - int var29; -+ int var28; - Icon var30; -- if(this.renderAllFaces || var1.shouldSideBeRendered(this.blockAccess, var2, var3, var4 - 1, 2)) { -- if(this.renderMinZ <= 0.0D) { -- --var4; -+ -+ if (this.renderAllFaces || RenderPass.shouldSideBeRendered(par1Block, this.blockAccess, par2, par3, par4 - 1, 2)) { -+ if (this.renderMinZ <= 0.0D) { -+ --par4; - } - -- this.aoLightValueScratchXZNN = var1.getAmbientOcclusionLightValue(this.blockAccess, var2 - 1, var3, var4); -- this.aoLightValueScratchYZNN = var1.getAmbientOcclusionLightValue(this.blockAccess, var2, var3 - 1, var4); -- this.aoLightValueScratchYZPN = var1.getAmbientOcclusionLightValue(this.blockAccess, var2, var3 + 1, var4); -- this.aoLightValueScratchXZPN = var1.getAmbientOcclusionLightValue(this.blockAccess, var2 + 1, var3, var4); -- this.aoBrightnessXZNN = var1.getMixedBrightnessForBlock(this.blockAccess, var2 - 1, var3, var4); -- this.aoBrightnessYZNN = var1.getMixedBrightnessForBlock(this.blockAccess, var2, var3 - 1, var4); -- this.aoBrightnessYZPN = var1.getMixedBrightnessForBlock(this.blockAccess, var2, var3 + 1, var4); -- this.aoBrightnessXZPN = var1.getMixedBrightnessForBlock(this.blockAccess, var2 + 1, var3, var4); -- var16 = Block.canBlockGrass[this.blockAccess.getBlockId(var2 + 1, var3, var4 - 1)]; -- var17 = Block.canBlockGrass[this.blockAccess.getBlockId(var2 - 1, var3, var4 - 1)]; -- var18 = Block.canBlockGrass[this.blockAccess.getBlockId(var2, var3 + 1, var4 - 1)]; -- var19 = Block.canBlockGrass[this.blockAccess.getBlockId(var2, var3 - 1, var4 - 1)]; -- if(!var17 && !var19) { -+ this.aoLightValueScratchXZNN = par1Block.getAmbientOcclusionLightValue(this.blockAccess, par2 - 1, par3, par4); -+ this.aoLightValueScratchYZNN = par1Block.getAmbientOcclusionLightValue(this.blockAccess, par2, par3 - 1, par4); -+ this.aoLightValueScratchYZPN = par1Block.getAmbientOcclusionLightValue(this.blockAccess, par2, par3 + 1, par4); -+ this.aoLightValueScratchXZPN = par1Block.getAmbientOcclusionLightValue(this.blockAccess, par2 + 1, par3, par4); -+ this.aoBrightnessXZNN = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2 - 1, par3, par4); -+ this.aoBrightnessYZNN = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2, par3 - 1, par4); -+ this.aoBrightnessYZPN = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2, par3 + 1, par4); -+ this.aoBrightnessXZPN = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2 + 1, par3, par4); -+ var16 = Block.canBlockGrass[this.blockAccess.getBlockId(par2 + 1, par3, par4 - 1)]; -+ var17 = Block.canBlockGrass[this.blockAccess.getBlockId(par2 - 1, par3, par4 - 1)]; -+ var18 = Block.canBlockGrass[this.blockAccess.getBlockId(par2, par3 + 1, par4 - 1)]; -+ var19 = Block.canBlockGrass[this.blockAccess.getBlockId(par2, par3 - 1, par4 - 1)]; -+ -+ if (!var17 && !var19) { - this.aoLightValueScratchXYZNNN = this.aoLightValueScratchXZNN; - this.aoBrightnessXYZNNN = this.aoBrightnessXZNN; - } else { -- this.aoLightValueScratchXYZNNN = var1.getAmbientOcclusionLightValue(this.blockAccess, var2 - 1, var3 - 1, var4); -- this.aoBrightnessXYZNNN = var1.getMixedBrightnessForBlock(this.blockAccess, var2 - 1, var3 - 1, var4); -+ this.aoLightValueScratchXYZNNN = par1Block.getAmbientOcclusionLightValue(this.blockAccess, par2 - 1, par3 - 1, par4); -+ this.aoBrightnessXYZNNN = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2 - 1, par3 - 1, par4); - } - -- if(!var17 && !var18) { -+ if (!var17 && !var18) { - this.aoLightValueScratchXYZNPN = this.aoLightValueScratchXZNN; - this.aoBrightnessXYZNPN = this.aoBrightnessXZNN; - } else { -- this.aoLightValueScratchXYZNPN = var1.getAmbientOcclusionLightValue(this.blockAccess, var2 - 1, var3 + 1, var4); -- this.aoBrightnessXYZNPN = var1.getMixedBrightnessForBlock(this.blockAccess, var2 - 1, var3 + 1, var4); -+ this.aoLightValueScratchXYZNPN = par1Block.getAmbientOcclusionLightValue(this.blockAccess, par2 - 1, par3 + 1, par4); -+ this.aoBrightnessXYZNPN = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2 - 1, par3 + 1, par4); - } - -- if(!var16 && !var19) { -+ if (!var16 && !var19) { - this.aoLightValueScratchXYZPNN = this.aoLightValueScratchXZPN; - this.aoBrightnessXYZPNN = this.aoBrightnessXZPN; - } else { -- this.aoLightValueScratchXYZPNN = var1.getAmbientOcclusionLightValue(this.blockAccess, var2 + 1, var3 - 1, var4); -- this.aoBrightnessXYZPNN = var1.getMixedBrightnessForBlock(this.blockAccess, var2 + 1, var3 - 1, var4); -+ this.aoLightValueScratchXYZPNN = par1Block.getAmbientOcclusionLightValue(this.blockAccess, par2 + 1, par3 - 1, par4); -+ this.aoBrightnessXYZPNN = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2 + 1, par3 - 1, par4); - } - -- if(!var16 && !var18) { -+ if (!var16 && !var18) { - this.aoLightValueScratchXYZPPN = this.aoLightValueScratchXZPN; - this.aoBrightnessXYZPPN = this.aoBrightnessXZPN; - } else { -- this.aoLightValueScratchXYZPPN = var1.getAmbientOcclusionLightValue(this.blockAccess, var2 + 1, var3 + 1, var4); -- this.aoBrightnessXYZPPN = var1.getMixedBrightnessForBlock(this.blockAccess, var2 + 1, var3 + 1, var4); -+ this.aoLightValueScratchXYZPPN = par1Block.getAmbientOcclusionLightValue(this.blockAccess, par2 + 1, par3 + 1, par4); -+ this.aoBrightnessXYZPPN = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2 + 1, par3 + 1, par4); - } - -- if(this.renderMinZ <= 0.0D) { -- ++var4; -+ if (this.renderMinZ <= 0.0D) { -+ ++par4; - } - - var20 = var14; -- if(this.renderMinZ <= 0.0D || !this.blockAccess.isBlockOpaqueCube(var2, var3, var4 - 1)) { -- var20 = var1.getMixedBrightnessForBlock(this.blockAccess, var2, var3, var4 - 1); -+ -+ if (this.renderMinZ <= 0.0D || !this.blockAccess.isBlockOpaqueCube(par2, par3, par4 - 1)) { -+ var20 = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2, par3, par4 - 1); - } - -- var21 = var1.getAmbientOcclusionLightValue(this.blockAccess, var2, var3, var4 - 1); -+ var21 = par1Block.getAmbientOcclusionLightValue(this.blockAccess, par2, par3, par4 - 1); - var22 = (this.aoLightValueScratchXZNN + this.aoLightValueScratchXYZNPN + var21 + this.aoLightValueScratchYZPN) / 4.0F; - var23 = (var21 + this.aoLightValueScratchYZPN + this.aoLightValueScratchXZPN + this.aoLightValueScratchXYZPPN) / 4.0F; - var24 = (this.aoLightValueScratchYZNN + var21 + this.aoLightValueScratchXYZPNN + this.aoLightValueScratchXZPN) / 4.0F; -@@ -4230,10 +4898,11 @@ - this.brightnessBottomLeft = this.mixAoBrightness(var26, var27, var28, var29, this.renderMaxY * (1.0D - this.renderMaxX), this.renderMaxY * this.renderMaxX, (1.0D - this.renderMaxY) * this.renderMaxX, (1.0D - this.renderMaxY) * (1.0D - this.renderMaxX)); - this.brightnessBottomRight = this.mixAoBrightness(var26, var27, var28, var29, this.renderMinY * (1.0D - this.renderMaxX), this.renderMinY * this.renderMaxX, (1.0D - this.renderMinY) * this.renderMaxX, (1.0D - this.renderMinY) * (1.0D - this.renderMaxX)); - this.brightnessTopRight = this.mixAoBrightness(var26, var27, var28, var29, this.renderMinY * (1.0D - this.renderMinX), this.renderMinY * this.renderMinX, (1.0D - this.renderMinY) * this.renderMinX, (1.0D - this.renderMinY) * (1.0D - this.renderMinX)); -- if(var13) { -- this.colorRedTopLeft = this.colorRedBottomLeft = this.colorRedBottomRight = this.colorRedTopRight = var5 * 0.8F; -- this.colorGreenTopLeft = this.colorGreenBottomLeft = this.colorGreenBottomRight = this.colorGreenTopRight = var6 * 0.8F; -- this.colorBlueTopLeft = this.colorBlueBottomLeft = this.colorBlueBottomRight = this.colorBlueTopRight = var7 * 0.8F; -+ -+ if (var13) { -+ this.colorRedTopLeft = this.colorRedBottomLeft = this.colorRedBottomRight = this.colorRedTopRight = par5 * 0.8F; -+ this.colorGreenTopLeft = this.colorGreenBottomLeft = this.colorGreenBottomRight = this.colorGreenTopRight = par6 * 0.8F; -+ this.colorBlueTopLeft = this.colorBlueBottomLeft = this.colorBlueBottomRight = this.colorBlueTopRight = par7 * 0.8F; - } else { - this.colorRedTopLeft = this.colorRedBottomLeft = this.colorRedBottomRight = this.colorRedTopRight = 0.8F; - this.colorGreenTopLeft = this.colorGreenBottomLeft = this.colorGreenBottomRight = this.colorGreenTopRight = 0.8F; -@@ -4252,86 +4921,89 @@ - this.colorRedTopRight *= var12; - this.colorGreenTopRight *= var12; - this.colorBlueTopRight *= var12; -- var30 = this.getBlockIcon(var1, this.blockAccess, var2, var3, var4, 2); -- this.renderFaceZNeg(var1, (double)var2, (double)var3, (double)var4, var30); -- if(fancyGrass && var30.getIconName().equals("grass_side") && !this.hasOverrideBlockTexture()) { -- this.colorRedTopLeft *= var5; -- this.colorRedBottomLeft *= var5; -- this.colorRedBottomRight *= var5; -- this.colorRedTopRight *= var5; -- this.colorGreenTopLeft *= var6; -- this.colorGreenBottomLeft *= var6; -- this.colorGreenBottomRight *= var6; -- this.colorGreenTopRight *= var6; -- this.colorBlueTopLeft *= var7; -- this.colorBlueBottomLeft *= var7; -- this.colorBlueBottomRight *= var7; -- this.colorBlueTopRight *= var7; -- this.renderFaceZNeg(var1, (double)var2, (double)var3, (double)var4, BlockGrass.getIconSideOverlay()); -+ var30 = this.getBlockIcon(par1Block, this.blockAccess, par2, par3, par4, 2); -+ this.renderFaceZNeg(par1Block, (double)par2, (double)par3, (double)par4, var30); -+ -+ if (fancyGrass && var30.getIconName().equals("grass_side") && !this.hasOverrideBlockTexture()) { -+ this.colorRedTopLeft *= par5; -+ this.colorRedBottomLeft *= par5; -+ this.colorRedBottomRight *= par5; -+ this.colorRedTopRight *= par5; -+ this.colorGreenTopLeft *= par6; -+ this.colorGreenBottomLeft *= par6; -+ this.colorGreenBottomRight *= par6; -+ this.colorGreenTopRight *= par6; -+ this.colorBlueTopLeft *= par7; -+ this.colorBlueBottomLeft *= par7; -+ this.colorBlueBottomRight *= par7; -+ this.colorBlueTopRight *= par7; -+ this.renderFaceZNeg(par1Block, (double)par2, (double)par3, (double)par4, BlockGrass.getIconSideOverlay()); - } - - var8 = true; - } - -- if(this.renderAllFaces || var1.shouldSideBeRendered(this.blockAccess, var2, var3, var4 + 1, 3)) { -- if(this.renderMaxZ >= 1.0D) { -- ++var4; -+ if (this.renderAllFaces || RenderPass.shouldSideBeRendered(par1Block, this.blockAccess, par2, par3, par4 + 1, 3)) { -+ if (this.renderMaxZ >= 1.0D) { -+ ++par4; - } - -- this.aoLightValueScratchXZNP = var1.getAmbientOcclusionLightValue(this.blockAccess, var2 - 1, var3, var4); -- this.aoLightValueScratchXZPP = var1.getAmbientOcclusionLightValue(this.blockAccess, var2 + 1, var3, var4); -- this.aoLightValueScratchYZNP = var1.getAmbientOcclusionLightValue(this.blockAccess, var2, var3 - 1, var4); -- this.aoLightValueScratchYZPP = var1.getAmbientOcclusionLightValue(this.blockAccess, var2, var3 + 1, var4); -- this.aoBrightnessXZNP = var1.getMixedBrightnessForBlock(this.blockAccess, var2 - 1, var3, var4); -- this.aoBrightnessXZPP = var1.getMixedBrightnessForBlock(this.blockAccess, var2 + 1, var3, var4); -- this.aoBrightnessYZNP = var1.getMixedBrightnessForBlock(this.blockAccess, var2, var3 - 1, var4); -- this.aoBrightnessYZPP = var1.getMixedBrightnessForBlock(this.blockAccess, var2, var3 + 1, var4); -- var16 = Block.canBlockGrass[this.blockAccess.getBlockId(var2 + 1, var3, var4 + 1)]; -- var17 = Block.canBlockGrass[this.blockAccess.getBlockId(var2 - 1, var3, var4 + 1)]; -- var18 = Block.canBlockGrass[this.blockAccess.getBlockId(var2, var3 + 1, var4 + 1)]; -- var19 = Block.canBlockGrass[this.blockAccess.getBlockId(var2, var3 - 1, var4 + 1)]; -- if(!var17 && !var19) { -+ this.aoLightValueScratchXZNP = par1Block.getAmbientOcclusionLightValue(this.blockAccess, par2 - 1, par3, par4); -+ this.aoLightValueScratchXZPP = par1Block.getAmbientOcclusionLightValue(this.blockAccess, par2 + 1, par3, par4); -+ this.aoLightValueScratchYZNP = par1Block.getAmbientOcclusionLightValue(this.blockAccess, par2, par3 - 1, par4); -+ this.aoLightValueScratchYZPP = par1Block.getAmbientOcclusionLightValue(this.blockAccess, par2, par3 + 1, par4); -+ this.aoBrightnessXZNP = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2 - 1, par3, par4); -+ this.aoBrightnessXZPP = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2 + 1, par3, par4); -+ this.aoBrightnessYZNP = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2, par3 - 1, par4); -+ this.aoBrightnessYZPP = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2, par3 + 1, par4); -+ var16 = Block.canBlockGrass[this.blockAccess.getBlockId(par2 + 1, par3, par4 + 1)]; -+ var17 = Block.canBlockGrass[this.blockAccess.getBlockId(par2 - 1, par3, par4 + 1)]; -+ var18 = Block.canBlockGrass[this.blockAccess.getBlockId(par2, par3 + 1, par4 + 1)]; -+ var19 = Block.canBlockGrass[this.blockAccess.getBlockId(par2, par3 - 1, par4 + 1)]; -+ -+ if (!var17 && !var19) { - this.aoLightValueScratchXYZNNP = this.aoLightValueScratchXZNP; - this.aoBrightnessXYZNNP = this.aoBrightnessXZNP; - } else { -- this.aoLightValueScratchXYZNNP = var1.getAmbientOcclusionLightValue(this.blockAccess, var2 - 1, var3 - 1, var4); -- this.aoBrightnessXYZNNP = var1.getMixedBrightnessForBlock(this.blockAccess, var2 - 1, var3 - 1, var4); -+ this.aoLightValueScratchXYZNNP = par1Block.getAmbientOcclusionLightValue(this.blockAccess, par2 - 1, par3 - 1, par4); -+ this.aoBrightnessXYZNNP = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2 - 1, par3 - 1, par4); - } - -- if(!var17 && !var18) { -+ if (!var17 && !var18) { - this.aoLightValueScratchXYZNPP = this.aoLightValueScratchXZNP; - this.aoBrightnessXYZNPP = this.aoBrightnessXZNP; - } else { -- this.aoLightValueScratchXYZNPP = var1.getAmbientOcclusionLightValue(this.blockAccess, var2 - 1, var3 + 1, var4); -- this.aoBrightnessXYZNPP = var1.getMixedBrightnessForBlock(this.blockAccess, var2 - 1, var3 + 1, var4); -+ this.aoLightValueScratchXYZNPP = par1Block.getAmbientOcclusionLightValue(this.blockAccess, par2 - 1, par3 + 1, par4); -+ this.aoBrightnessXYZNPP = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2 - 1, par3 + 1, par4); - } - -- if(!var16 && !var19) { -+ if (!var16 && !var19) { - this.aoLightValueScratchXYZPNP = this.aoLightValueScratchXZPP; - this.aoBrightnessXYZPNP = this.aoBrightnessXZPP; - } else { -- this.aoLightValueScratchXYZPNP = var1.getAmbientOcclusionLightValue(this.blockAccess, var2 + 1, var3 - 1, var4); -- this.aoBrightnessXYZPNP = var1.getMixedBrightnessForBlock(this.blockAccess, var2 + 1, var3 - 1, var4); -+ this.aoLightValueScratchXYZPNP = par1Block.getAmbientOcclusionLightValue(this.blockAccess, par2 + 1, par3 - 1, par4); -+ this.aoBrightnessXYZPNP = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2 + 1, par3 - 1, par4); - } - -- if(!var16 && !var18) { -+ if (!var16 && !var18) { - this.aoLightValueScratchXYZPPP = this.aoLightValueScratchXZPP; - this.aoBrightnessXYZPPP = this.aoBrightnessXZPP; - } else { -- this.aoLightValueScratchXYZPPP = var1.getAmbientOcclusionLightValue(this.blockAccess, var2 + 1, var3 + 1, var4); -- this.aoBrightnessXYZPPP = var1.getMixedBrightnessForBlock(this.blockAccess, var2 + 1, var3 + 1, var4); -+ this.aoLightValueScratchXYZPPP = par1Block.getAmbientOcclusionLightValue(this.blockAccess, par2 + 1, par3 + 1, par4); -+ this.aoBrightnessXYZPPP = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2 + 1, par3 + 1, par4); - } - -- if(this.renderMaxZ >= 1.0D) { -- --var4; -+ if (this.renderMaxZ >= 1.0D) { -+ --par4; - } - - var20 = var14; -- if(this.renderMaxZ >= 1.0D || !this.blockAccess.isBlockOpaqueCube(var2, var3, var4 + 1)) { -- var20 = var1.getMixedBrightnessForBlock(this.blockAccess, var2, var3, var4 + 1); -+ -+ if (this.renderMaxZ >= 1.0D || !this.blockAccess.isBlockOpaqueCube(par2, par3, par4 + 1)) { -+ var20 = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2, par3, par4 + 1); - } - -- var21 = var1.getAmbientOcclusionLightValue(this.blockAccess, var2, var3, var4 + 1); -+ var21 = par1Block.getAmbientOcclusionLightValue(this.blockAccess, par2, par3, par4 + 1); - var22 = (this.aoLightValueScratchXZNP + this.aoLightValueScratchXYZNPP + var21 + this.aoLightValueScratchYZPP) / 4.0F; - var23 = (var21 + this.aoLightValueScratchYZPP + this.aoLightValueScratchXZPP + this.aoLightValueScratchXYZPPP) / 4.0F; - var24 = (this.aoLightValueScratchYZNP + var21 + this.aoLightValueScratchXYZPNP + this.aoLightValueScratchXZPP) / 4.0F; -@@ -4348,10 +5020,11 @@ - this.brightnessBottomLeft = this.mixAoBrightness(var26, var29, var28, var27, this.renderMinY * (1.0D - this.renderMinX), (1.0D - this.renderMinY) * (1.0D - this.renderMinX), (1.0D - this.renderMinY) * this.renderMinX, this.renderMinY * this.renderMinX); - this.brightnessBottomRight = this.mixAoBrightness(var26, var29, var28, var27, this.renderMinY * (1.0D - this.renderMaxX), (1.0D - this.renderMinY) * (1.0D - this.renderMaxX), (1.0D - this.renderMinY) * this.renderMaxX, this.renderMinY * this.renderMaxX); - this.brightnessTopRight = this.mixAoBrightness(var26, var29, var28, var27, this.renderMaxY * (1.0D - this.renderMaxX), (1.0D - this.renderMaxY) * (1.0D - this.renderMaxX), (1.0D - this.renderMaxY) * this.renderMaxX, this.renderMaxY * this.renderMaxX); -- if(var13) { -- this.colorRedTopLeft = this.colorRedBottomLeft = this.colorRedBottomRight = this.colorRedTopRight = var5 * 0.8F; -- this.colorGreenTopLeft = this.colorGreenBottomLeft = this.colorGreenBottomRight = this.colorGreenTopRight = var6 * 0.8F; -- this.colorBlueTopLeft = this.colorBlueBottomLeft = this.colorBlueBottomRight = this.colorBlueTopRight = var7 * 0.8F; -+ -+ if (var13) { -+ this.colorRedTopLeft = this.colorRedBottomLeft = this.colorRedBottomRight = this.colorRedTopRight = par5 * 0.8F; -+ this.colorGreenTopLeft = this.colorGreenBottomLeft = this.colorGreenBottomRight = this.colorGreenTopRight = par6 * 0.8F; -+ this.colorBlueTopLeft = this.colorBlueBottomLeft = this.colorBlueBottomRight = this.colorBlueTopRight = par7 * 0.8F; - } else { - this.colorRedTopLeft = this.colorRedBottomLeft = this.colorRedBottomRight = this.colorRedTopRight = 0.8F; - this.colorGreenTopLeft = this.colorGreenBottomLeft = this.colorGreenBottomRight = this.colorGreenTopRight = 0.8F; -@@ -4370,86 +5043,89 @@ - this.colorRedTopRight *= var12; - this.colorGreenTopRight *= var12; - this.colorBlueTopRight *= var12; -- var30 = this.getBlockIcon(var1, this.blockAccess, var2, var3, var4, 3); -- this.renderFaceZPos(var1, (double)var2, (double)var3, (double)var4, this.getBlockIcon(var1, this.blockAccess, var2, var3, var4, 3)); -- if(fancyGrass && var30.getIconName().equals("grass_side") && !this.hasOverrideBlockTexture()) { -- this.colorRedTopLeft *= var5; -- this.colorRedBottomLeft *= var5; -- this.colorRedBottomRight *= var5; -- this.colorRedTopRight *= var5; -- this.colorGreenTopLeft *= var6; -- this.colorGreenBottomLeft *= var6; -- this.colorGreenBottomRight *= var6; -- this.colorGreenTopRight *= var6; -- this.colorBlueTopLeft *= var7; -- this.colorBlueBottomLeft *= var7; -- this.colorBlueBottomRight *= var7; -- this.colorBlueTopRight *= var7; -- this.renderFaceZPos(var1, (double)var2, (double)var3, (double)var4, BlockGrass.getIconSideOverlay()); -+ var30 = this.getBlockIcon(par1Block, this.blockAccess, par2, par3, par4, 3); -+ this.renderFaceZPos(par1Block, (double)par2, (double)par3, (double)par4, this.getBlockIcon(par1Block, this.blockAccess, par2, par3, par4, 3)); -+ -+ if (fancyGrass && var30.getIconName().equals("grass_side") && !this.hasOverrideBlockTexture()) { -+ this.colorRedTopLeft *= par5; -+ this.colorRedBottomLeft *= par5; -+ this.colorRedBottomRight *= par5; -+ this.colorRedTopRight *= par5; -+ this.colorGreenTopLeft *= par6; -+ this.colorGreenBottomLeft *= par6; -+ this.colorGreenBottomRight *= par6; -+ this.colorGreenTopRight *= par6; -+ this.colorBlueTopLeft *= par7; -+ this.colorBlueBottomLeft *= par7; -+ this.colorBlueBottomRight *= par7; -+ this.colorBlueTopRight *= par7; -+ this.renderFaceZPos(par1Block, (double)par2, (double)par3, (double)par4, BlockGrass.getIconSideOverlay()); - } - - var8 = true; - } - -- if(this.renderAllFaces || var1.shouldSideBeRendered(this.blockAccess, var2 - 1, var3, var4, 4)) { -- if(this.renderMinX <= 0.0D) { -- --var2; -+ if (this.renderAllFaces || RenderPass.shouldSideBeRendered(par1Block, this.blockAccess, par2 - 1, par3, par4, 4)) { -+ if (this.renderMinX <= 0.0D) { -+ --par2; - } - -- this.aoLightValueScratchXYNN = var1.getAmbientOcclusionLightValue(this.blockAccess, var2, var3 - 1, var4); -- this.aoLightValueScratchXZNN = var1.getAmbientOcclusionLightValue(this.blockAccess, var2, var3, var4 - 1); -- this.aoLightValueScratchXZNP = var1.getAmbientOcclusionLightValue(this.blockAccess, var2, var3, var4 + 1); -- this.aoLightValueScratchXYNP = var1.getAmbientOcclusionLightValue(this.blockAccess, var2, var3 + 1, var4); -- this.aoBrightnessXYNN = var1.getMixedBrightnessForBlock(this.blockAccess, var2, var3 - 1, var4); -- this.aoBrightnessXZNN = var1.getMixedBrightnessForBlock(this.blockAccess, var2, var3, var4 - 1); -- this.aoBrightnessXZNP = var1.getMixedBrightnessForBlock(this.blockAccess, var2, var3, var4 + 1); -- this.aoBrightnessXYNP = var1.getMixedBrightnessForBlock(this.blockAccess, var2, var3 + 1, var4); -- var16 = Block.canBlockGrass[this.blockAccess.getBlockId(var2 - 1, var3 + 1, var4)]; -- var17 = Block.canBlockGrass[this.blockAccess.getBlockId(var2 - 1, var3 - 1, var4)]; -- var18 = Block.canBlockGrass[this.blockAccess.getBlockId(var2 - 1, var3, var4 - 1)]; -- var19 = Block.canBlockGrass[this.blockAccess.getBlockId(var2 - 1, var3, var4 + 1)]; -- if(!var18 && !var17) { -+ this.aoLightValueScratchXYNN = par1Block.getAmbientOcclusionLightValue(this.blockAccess, par2, par3 - 1, par4); -+ this.aoLightValueScratchXZNN = par1Block.getAmbientOcclusionLightValue(this.blockAccess, par2, par3, par4 - 1); -+ this.aoLightValueScratchXZNP = par1Block.getAmbientOcclusionLightValue(this.blockAccess, par2, par3, par4 + 1); -+ this.aoLightValueScratchXYNP = par1Block.getAmbientOcclusionLightValue(this.blockAccess, par2, par3 + 1, par4); -+ this.aoBrightnessXYNN = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2, par3 - 1, par4); -+ this.aoBrightnessXZNN = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2, par3, par4 - 1); -+ this.aoBrightnessXZNP = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2, par3, par4 + 1); -+ this.aoBrightnessXYNP = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2, par3 + 1, par4); -+ var16 = Block.canBlockGrass[this.blockAccess.getBlockId(par2 - 1, par3 + 1, par4)]; -+ var17 = Block.canBlockGrass[this.blockAccess.getBlockId(par2 - 1, par3 - 1, par4)]; -+ var18 = Block.canBlockGrass[this.blockAccess.getBlockId(par2 - 1, par3, par4 - 1)]; -+ var19 = Block.canBlockGrass[this.blockAccess.getBlockId(par2 - 1, par3, par4 + 1)]; -+ -+ if (!var18 && !var17) { - this.aoLightValueScratchXYZNNN = this.aoLightValueScratchXZNN; - this.aoBrightnessXYZNNN = this.aoBrightnessXZNN; - } else { -- this.aoLightValueScratchXYZNNN = var1.getAmbientOcclusionLightValue(this.blockAccess, var2, var3 - 1, var4 - 1); -- this.aoBrightnessXYZNNN = var1.getMixedBrightnessForBlock(this.blockAccess, var2, var3 - 1, var4 - 1); -+ this.aoLightValueScratchXYZNNN = par1Block.getAmbientOcclusionLightValue(this.blockAccess, par2, par3 - 1, par4 - 1); -+ this.aoBrightnessXYZNNN = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2, par3 - 1, par4 - 1); - } - -- if(!var19 && !var17) { -+ if (!var19 && !var17) { - this.aoLightValueScratchXYZNNP = this.aoLightValueScratchXZNP; - this.aoBrightnessXYZNNP = this.aoBrightnessXZNP; - } else { -- this.aoLightValueScratchXYZNNP = var1.getAmbientOcclusionLightValue(this.blockAccess, var2, var3 - 1, var4 + 1); -- this.aoBrightnessXYZNNP = var1.getMixedBrightnessForBlock(this.blockAccess, var2, var3 - 1, var4 + 1); -+ this.aoLightValueScratchXYZNNP = par1Block.getAmbientOcclusionLightValue(this.blockAccess, par2, par3 - 1, par4 + 1); -+ this.aoBrightnessXYZNNP = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2, par3 - 1, par4 + 1); - } - -- if(!var18 && !var16) { -+ if (!var18 && !var16) { - this.aoLightValueScratchXYZNPN = this.aoLightValueScratchXZNN; - this.aoBrightnessXYZNPN = this.aoBrightnessXZNN; - } else { -- this.aoLightValueScratchXYZNPN = var1.getAmbientOcclusionLightValue(this.blockAccess, var2, var3 + 1, var4 - 1); -- this.aoBrightnessXYZNPN = var1.getMixedBrightnessForBlock(this.blockAccess, var2, var3 + 1, var4 - 1); -+ this.aoLightValueScratchXYZNPN = par1Block.getAmbientOcclusionLightValue(this.blockAccess, par2, par3 + 1, par4 - 1); -+ this.aoBrightnessXYZNPN = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2, par3 + 1, par4 - 1); - } - -- if(!var19 && !var16) { -+ if (!var19 && !var16) { - this.aoLightValueScratchXYZNPP = this.aoLightValueScratchXZNP; - this.aoBrightnessXYZNPP = this.aoBrightnessXZNP; - } else { -- this.aoLightValueScratchXYZNPP = var1.getAmbientOcclusionLightValue(this.blockAccess, var2, var3 + 1, var4 + 1); -- this.aoBrightnessXYZNPP = var1.getMixedBrightnessForBlock(this.blockAccess, var2, var3 + 1, var4 + 1); -+ this.aoLightValueScratchXYZNPP = par1Block.getAmbientOcclusionLightValue(this.blockAccess, par2, par3 + 1, par4 + 1); -+ this.aoBrightnessXYZNPP = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2, par3 + 1, par4 + 1); - } - -- if(this.renderMinX <= 0.0D) { -- ++var2; -+ if (this.renderMinX <= 0.0D) { -+ ++par2; - } - - var20 = var14; -- if(this.renderMinX <= 0.0D || !this.blockAccess.isBlockOpaqueCube(var2 - 1, var3, var4)) { -- var20 = var1.getMixedBrightnessForBlock(this.blockAccess, var2 - 1, var3, var4); -+ -+ if (this.renderMinX <= 0.0D || !this.blockAccess.isBlockOpaqueCube(par2 - 1, par3, par4)) { -+ var20 = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2 - 1, par3, par4); - } - -- var21 = var1.getAmbientOcclusionLightValue(this.blockAccess, var2 - 1, var3, var4); -+ var21 = par1Block.getAmbientOcclusionLightValue(this.blockAccess, par2 - 1, par3, par4); - var22 = (this.aoLightValueScratchXYNN + this.aoLightValueScratchXYZNNP + var21 + this.aoLightValueScratchXZNP) / 4.0F; - var23 = (var21 + this.aoLightValueScratchXZNP + this.aoLightValueScratchXYNP + this.aoLightValueScratchXYZNPP) / 4.0F; - var24 = (this.aoLightValueScratchXZNN + var21 + this.aoLightValueScratchXYZNPN + this.aoLightValueScratchXYNP) / 4.0F; -@@ -4466,10 +5142,11 @@ - this.brightnessBottomLeft = this.mixAoBrightness(var27, var28, var29, var26, this.renderMaxY * this.renderMinZ, this.renderMaxY * (1.0D - this.renderMinZ), (1.0D - this.renderMaxY) * (1.0D - this.renderMinZ), (1.0D - this.renderMaxY) * this.renderMinZ); - this.brightnessBottomRight = this.mixAoBrightness(var27, var28, var29, var26, this.renderMinY * this.renderMinZ, this.renderMinY * (1.0D - this.renderMinZ), (1.0D - this.renderMinY) * (1.0D - this.renderMinZ), (1.0D - this.renderMinY) * this.renderMinZ); - this.brightnessTopRight = this.mixAoBrightness(var27, var28, var29, var26, this.renderMinY * this.renderMaxZ, this.renderMinY * (1.0D - this.renderMaxZ), (1.0D - this.renderMinY) * (1.0D - this.renderMaxZ), (1.0D - this.renderMinY) * this.renderMaxZ); -- if(var13) { -- this.colorRedTopLeft = this.colorRedBottomLeft = this.colorRedBottomRight = this.colorRedTopRight = var5 * 0.6F; -- this.colorGreenTopLeft = this.colorGreenBottomLeft = this.colorGreenBottomRight = this.colorGreenTopRight = var6 * 0.6F; -- this.colorBlueTopLeft = this.colorBlueBottomLeft = this.colorBlueBottomRight = this.colorBlueTopRight = var7 * 0.6F; -+ -+ if (var13) { -+ this.colorRedTopLeft = this.colorRedBottomLeft = this.colorRedBottomRight = this.colorRedTopRight = par5 * 0.6F; -+ this.colorGreenTopLeft = this.colorGreenBottomLeft = this.colorGreenBottomRight = this.colorGreenTopRight = par6 * 0.6F; -+ this.colorBlueTopLeft = this.colorBlueBottomLeft = this.colorBlueBottomRight = this.colorBlueTopRight = par7 * 0.6F; - } else { - this.colorRedTopLeft = this.colorRedBottomLeft = this.colorRedBottomRight = this.colorRedTopRight = 0.6F; - this.colorGreenTopLeft = this.colorGreenBottomLeft = this.colorGreenBottomRight = this.colorGreenTopRight = 0.6F; -@@ -4488,86 +5165,89 @@ - this.colorRedTopRight *= var12; - this.colorGreenTopRight *= var12; - this.colorBlueTopRight *= var12; -- var30 = this.getBlockIcon(var1, this.blockAccess, var2, var3, var4, 4); -- this.renderFaceXNeg(var1, (double)var2, (double)var3, (double)var4, var30); -- if(fancyGrass && var30.getIconName().equals("grass_side") && !this.hasOverrideBlockTexture()) { -- this.colorRedTopLeft *= var5; -- this.colorRedBottomLeft *= var5; -- this.colorRedBottomRight *= var5; -- this.colorRedTopRight *= var5; -- this.colorGreenTopLeft *= var6; -- this.colorGreenBottomLeft *= var6; -- this.colorGreenBottomRight *= var6; -- this.colorGreenTopRight *= var6; -- this.colorBlueTopLeft *= var7; -- this.colorBlueBottomLeft *= var7; -- this.colorBlueBottomRight *= var7; -- this.colorBlueTopRight *= var7; -- this.renderFaceXNeg(var1, (double)var2, (double)var3, (double)var4, BlockGrass.getIconSideOverlay()); -+ var30 = this.getBlockIcon(par1Block, this.blockAccess, par2, par3, par4, 4); -+ this.renderFaceXNeg(par1Block, (double)par2, (double)par3, (double)par4, var30); -+ -+ if (fancyGrass && var30.getIconName().equals("grass_side") && !this.hasOverrideBlockTexture()) { -+ this.colorRedTopLeft *= par5; -+ this.colorRedBottomLeft *= par5; -+ this.colorRedBottomRight *= par5; -+ this.colorRedTopRight *= par5; -+ this.colorGreenTopLeft *= par6; -+ this.colorGreenBottomLeft *= par6; -+ this.colorGreenBottomRight *= par6; -+ this.colorGreenTopRight *= par6; -+ this.colorBlueTopLeft *= par7; -+ this.colorBlueBottomLeft *= par7; -+ this.colorBlueBottomRight *= par7; -+ this.colorBlueTopRight *= par7; -+ this.renderFaceXNeg(par1Block, (double)par2, (double)par3, (double)par4, BlockGrass.getIconSideOverlay()); - } - - var8 = true; - } - -- if(this.renderAllFaces || var1.shouldSideBeRendered(this.blockAccess, var2 + 1, var3, var4, 5)) { -- if(this.renderMaxX >= 1.0D) { -- ++var2; -+ if (this.renderAllFaces || RenderPass.shouldSideBeRendered(par1Block, this.blockAccess, par2 + 1, par3, par4, 5)) { -+ if (this.renderMaxX >= 1.0D) { -+ ++par2; - } - -- this.aoLightValueScratchXYPN = var1.getAmbientOcclusionLightValue(this.blockAccess, var2, var3 - 1, var4); -- this.aoLightValueScratchXZPN = var1.getAmbientOcclusionLightValue(this.blockAccess, var2, var3, var4 - 1); -- this.aoLightValueScratchXZPP = var1.getAmbientOcclusionLightValue(this.blockAccess, var2, var3, var4 + 1); -- this.aoLightValueScratchXYPP = var1.getAmbientOcclusionLightValue(this.blockAccess, var2, var3 + 1, var4); -- this.aoBrightnessXYPN = var1.getMixedBrightnessForBlock(this.blockAccess, var2, var3 - 1, var4); -- this.aoBrightnessXZPN = var1.getMixedBrightnessForBlock(this.blockAccess, var2, var3, var4 - 1); -- this.aoBrightnessXZPP = var1.getMixedBrightnessForBlock(this.blockAccess, var2, var3, var4 + 1); -- this.aoBrightnessXYPP = var1.getMixedBrightnessForBlock(this.blockAccess, var2, var3 + 1, var4); -- var16 = Block.canBlockGrass[this.blockAccess.getBlockId(var2 + 1, var3 + 1, var4)]; -- var17 = Block.canBlockGrass[this.blockAccess.getBlockId(var2 + 1, var3 - 1, var4)]; -- var18 = Block.canBlockGrass[this.blockAccess.getBlockId(var2 + 1, var3, var4 + 1)]; -- var19 = Block.canBlockGrass[this.blockAccess.getBlockId(var2 + 1, var3, var4 - 1)]; -- if(!var17 && !var19) { -+ this.aoLightValueScratchXYPN = par1Block.getAmbientOcclusionLightValue(this.blockAccess, par2, par3 - 1, par4); -+ this.aoLightValueScratchXZPN = par1Block.getAmbientOcclusionLightValue(this.blockAccess, par2, par3, par4 - 1); -+ this.aoLightValueScratchXZPP = par1Block.getAmbientOcclusionLightValue(this.blockAccess, par2, par3, par4 + 1); -+ this.aoLightValueScratchXYPP = par1Block.getAmbientOcclusionLightValue(this.blockAccess, par2, par3 + 1, par4); -+ this.aoBrightnessXYPN = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2, par3 - 1, par4); -+ this.aoBrightnessXZPN = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2, par3, par4 - 1); -+ this.aoBrightnessXZPP = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2, par3, par4 + 1); -+ this.aoBrightnessXYPP = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2, par3 + 1, par4); -+ var16 = Block.canBlockGrass[this.blockAccess.getBlockId(par2 + 1, par3 + 1, par4)]; -+ var17 = Block.canBlockGrass[this.blockAccess.getBlockId(par2 + 1, par3 - 1, par4)]; -+ var18 = Block.canBlockGrass[this.blockAccess.getBlockId(par2 + 1, par3, par4 + 1)]; -+ var19 = Block.canBlockGrass[this.blockAccess.getBlockId(par2 + 1, par3, par4 - 1)]; -+ -+ if (!var17 && !var19) { - this.aoLightValueScratchXYZPNN = this.aoLightValueScratchXZPN; - this.aoBrightnessXYZPNN = this.aoBrightnessXZPN; - } else { -- this.aoLightValueScratchXYZPNN = var1.getAmbientOcclusionLightValue(this.blockAccess, var2, var3 - 1, var4 - 1); -- this.aoBrightnessXYZPNN = var1.getMixedBrightnessForBlock(this.blockAccess, var2, var3 - 1, var4 - 1); -+ this.aoLightValueScratchXYZPNN = par1Block.getAmbientOcclusionLightValue(this.blockAccess, par2, par3 - 1, par4 - 1); -+ this.aoBrightnessXYZPNN = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2, par3 - 1, par4 - 1); - } - -- if(!var17 && !var18) { -+ if (!var17 && !var18) { - this.aoLightValueScratchXYZPNP = this.aoLightValueScratchXZPP; - this.aoBrightnessXYZPNP = this.aoBrightnessXZPP; - } else { -- this.aoLightValueScratchXYZPNP = var1.getAmbientOcclusionLightValue(this.blockAccess, var2, var3 - 1, var4 + 1); -- this.aoBrightnessXYZPNP = var1.getMixedBrightnessForBlock(this.blockAccess, var2, var3 - 1, var4 + 1); -+ this.aoLightValueScratchXYZPNP = par1Block.getAmbientOcclusionLightValue(this.blockAccess, par2, par3 - 1, par4 + 1); -+ this.aoBrightnessXYZPNP = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2, par3 - 1, par4 + 1); - } - -- if(!var16 && !var19) { -+ if (!var16 && !var19) { - this.aoLightValueScratchXYZPPN = this.aoLightValueScratchXZPN; - this.aoBrightnessXYZPPN = this.aoBrightnessXZPN; - } else { -- this.aoLightValueScratchXYZPPN = var1.getAmbientOcclusionLightValue(this.blockAccess, var2, var3 + 1, var4 - 1); -- this.aoBrightnessXYZPPN = var1.getMixedBrightnessForBlock(this.blockAccess, var2, var3 + 1, var4 - 1); -+ this.aoLightValueScratchXYZPPN = par1Block.getAmbientOcclusionLightValue(this.blockAccess, par2, par3 + 1, par4 - 1); -+ this.aoBrightnessXYZPPN = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2, par3 + 1, par4 - 1); - } - -- if(!var16 && !var18) { -+ if (!var16 && !var18) { - this.aoLightValueScratchXYZPPP = this.aoLightValueScratchXZPP; - this.aoBrightnessXYZPPP = this.aoBrightnessXZPP; - } else { -- this.aoLightValueScratchXYZPPP = var1.getAmbientOcclusionLightValue(this.blockAccess, var2, var3 + 1, var4 + 1); -- this.aoBrightnessXYZPPP = var1.getMixedBrightnessForBlock(this.blockAccess, var2, var3 + 1, var4 + 1); -+ this.aoLightValueScratchXYZPPP = par1Block.getAmbientOcclusionLightValue(this.blockAccess, par2, par3 + 1, par4 + 1); -+ this.aoBrightnessXYZPPP = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2, par3 + 1, par4 + 1); - } - -- if(this.renderMaxX >= 1.0D) { -- --var2; -+ if (this.renderMaxX >= 1.0D) { -+ --par2; - } - - var20 = var14; -- if(this.renderMaxX >= 1.0D || !this.blockAccess.isBlockOpaqueCube(var2 + 1, var3, var4)) { -- var20 = var1.getMixedBrightnessForBlock(this.blockAccess, var2 + 1, var3, var4); -+ -+ if (this.renderMaxX >= 1.0D || !this.blockAccess.isBlockOpaqueCube(par2 + 1, par3, par4)) { -+ var20 = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2 + 1, par3, par4); - } - -- var21 = var1.getAmbientOcclusionLightValue(this.blockAccess, var2 + 1, var3, var4); -+ var21 = par1Block.getAmbientOcclusionLightValue(this.blockAccess, par2 + 1, par3, par4); - var22 = (this.aoLightValueScratchXYPN + this.aoLightValueScratchXYZPNP + var21 + this.aoLightValueScratchXZPP) / 4.0F; - var23 = (this.aoLightValueScratchXYZPNN + this.aoLightValueScratchXYPN + this.aoLightValueScratchXZPN + var21) / 4.0F; - var24 = (this.aoLightValueScratchXZPN + var21 + this.aoLightValueScratchXYZPPN + this.aoLightValueScratchXYPP) / 4.0F; -@@ -4584,10 +5264,11 @@ - this.brightnessBottomLeft = this.mixAoBrightness(var26, var29, var28, var27, (1.0D - this.renderMinY) * this.renderMinZ, (1.0D - this.renderMinY) * (1.0D - this.renderMinZ), this.renderMinY * (1.0D - this.renderMinZ), this.renderMinY * this.renderMinZ); - this.brightnessBottomRight = this.mixAoBrightness(var26, var29, var28, var27, (1.0D - this.renderMaxY) * this.renderMinZ, (1.0D - this.renderMaxY) * (1.0D - this.renderMinZ), this.renderMaxY * (1.0D - this.renderMinZ), this.renderMaxY * this.renderMinZ); - this.brightnessTopRight = this.mixAoBrightness(var26, var29, var28, var27, (1.0D - this.renderMaxY) * this.renderMaxZ, (1.0D - this.renderMaxY) * (1.0D - this.renderMaxZ), this.renderMaxY * (1.0D - this.renderMaxZ), this.renderMaxY * this.renderMaxZ); -- if(var13) { -- this.colorRedTopLeft = this.colorRedBottomLeft = this.colorRedBottomRight = this.colorRedTopRight = var5 * 0.6F; -- this.colorGreenTopLeft = this.colorGreenBottomLeft = this.colorGreenBottomRight = this.colorGreenTopRight = var6 * 0.6F; -- this.colorBlueTopLeft = this.colorBlueBottomLeft = this.colorBlueBottomRight = this.colorBlueTopRight = var7 * 0.6F; -+ -+ if (var13) { -+ this.colorRedTopLeft = this.colorRedBottomLeft = this.colorRedBottomRight = this.colorRedTopRight = par5 * 0.6F; -+ this.colorGreenTopLeft = this.colorGreenBottomLeft = this.colorGreenBottomRight = this.colorGreenTopRight = par6 * 0.6F; -+ this.colorBlueTopLeft = this.colorBlueBottomLeft = this.colorBlueBottomRight = this.colorBlueTopRight = par7 * 0.6F; - } else { - this.colorRedTopLeft = this.colorRedBottomLeft = this.colorRedBottomRight = this.colorRedTopRight = 0.6F; - this.colorGreenTopLeft = this.colorGreenBottomLeft = this.colorGreenBottomRight = this.colorGreenTopRight = 0.6F; -@@ -4606,22 +5287,23 @@ - this.colorRedTopRight *= var12; - this.colorGreenTopRight *= var12; - this.colorBlueTopRight *= var12; -- var30 = this.getBlockIcon(var1, this.blockAccess, var2, var3, var4, 5); -- this.renderFaceXPos(var1, (double)var2, (double)var3, (double)var4, var30); -- if(fancyGrass && var30.getIconName().equals("grass_side") && !this.hasOverrideBlockTexture()) { -- this.colorRedTopLeft *= var5; -- this.colorRedBottomLeft *= var5; -- this.colorRedBottomRight *= var5; -- this.colorRedTopRight *= var5; -- this.colorGreenTopLeft *= var6; -- this.colorGreenBottomLeft *= var6; -- this.colorGreenBottomRight *= var6; -- this.colorGreenTopRight *= var6; -- this.colorBlueTopLeft *= var7; -- this.colorBlueBottomLeft *= var7; -- this.colorBlueBottomRight *= var7; -- this.colorBlueTopRight *= var7; -- this.renderFaceXPos(var1, (double)var2, (double)var3, (double)var4, BlockGrass.getIconSideOverlay()); -+ var30 = this.getBlockIcon(par1Block, this.blockAccess, par2, par3, par4, 5); -+ this.renderFaceXPos(par1Block, (double)par2, (double)par3, (double)par4, var30); -+ -+ if (fancyGrass && var30.getIconName().equals("grass_side") && !this.hasOverrideBlockTexture()) { -+ this.colorRedTopLeft *= par5; -+ this.colorRedBottomLeft *= par5; -+ this.colorRedBottomRight *= par5; -+ this.colorRedTopRight *= par5; -+ this.colorGreenTopLeft *= par6; -+ this.colorGreenBottomLeft *= par6; -+ this.colorGreenBottomRight *= par6; -+ this.colorGreenTopRight *= par6; -+ this.colorBlueTopLeft *= par7; -+ this.colorBlueBottomLeft *= par7; -+ this.colorBlueBottomRight *= par7; -+ this.colorBlueTopRight *= par7; -+ this.renderFaceXPos(par1Block, (double)par2, (double)par3, (double)par4, BlockGrass.getIconSideOverlay()); - } - - var8 = true; -@@ -4631,29 +5313,35 @@ - return var8; - } - -- private int getAoBrightness(int var1, int var2, int var3, int var4) { -- if(var1 == 0) { -- var1 = var4; -- } -- -- if(var2 == 0) { -- var2 = var4; -- } -- -- if(var3 == 0) { -- var3 = var4; -- } -- -- return var1 + var2 + var3 + var4 >> 2 & 16711935; -+ /** -+ * Get ambient occlusion brightness -+ */ -+ private int getAoBrightness(int par1, int par2, int par3, int par4) { -+ if (par1 == 0) { -+ par1 = par4; -+ } -+ -+ if (par2 == 0) { -+ par2 = par4; -+ } -+ -+ if (par3 == 0) { -+ par3 = par4; -+ } -+ -+ return par1 + par2 + par3 + par4 >> 2 & 16711935; - } - -- private int mixAoBrightness(int var1, int var2, int var3, int var4, double var5, double var7, double var9, double var11) { -- int var13 = (int)((double)(var1 >> 16 & 255) * var5 + (double)(var2 >> 16 & 255) * var7 + (double)(var3 >> 16 & 255) * var9 + (double)(var4 >> 16 & 255) * var11) & 255; -- int var14 = (int)((double)(var1 & 255) * var5 + (double)(var2 & 255) * var7 + (double)(var3 & 255) * var9 + (double)(var4 & 255) * var11) & 255; -+ private int mixAoBrightness(int par1, int par2, int par3, int par4, double par5, double par7, double par9, double par11) { -+ int var13 = (int)((double)(par1 >> 16 & 255) * par5 + (double)(par2 >> 16 & 255) * par7 + (double)(par3 >> 16 & 255) * par9 + (double)(par4 >> 16 & 255) * par11) & 255; -+ int var14 = (int)((double)(par1 & 255) * par5 + (double)(par2 & 255) * par7 + (double)(par3 & 255) * par9 + (double)(par4 & 255) * par11) & 255; - return var13 << 16 | var14; - } - -- public boolean renderStandardBlockWithColorMultiplier(Block var1, int var2, int var3, int var4, float var5, float var6, float var7) { -+ /** -+ * Renders a standard cube block at the given coordinates, with a given color ratio. Args: block, x, y, z, r, g, b -+ */ -+ public boolean renderStandardBlockWithColorMultiplier(Block par1Block, int par2, int par3, int par4, float par5, float par6, float par7) { - this.enableAO = false; - Tessellator var8 = Tessellator.instance; - boolean var9 = false; -@@ -4661,9 +5349,9 @@ - float var11 = 1.0F; - float var12 = 0.8F; - float var13 = 0.6F; -- float var14 = var11 * var5; -- float var15 = var11 * var6; -- float var16 = var11 * var7; -+ float var14 = var11 * par5; -+ float var15 = var11 * par6; -+ float var16 = var11 * par7; - float var17 = var10; - float var18 = var12; - float var19 = var13; -@@ -4673,81 +5361,112 @@ - float var23 = var10; - float var24 = var12; - float var25 = var13; -- if(var1 != Block.grass) { -- var17 = var10 * var5; -- var18 = var12 * var5; -- var19 = var13 * var5; -- var20 = var10 * var6; -- var21 = var12 * var6; -- var22 = var13 * var6; -- var23 = var10 * var7; -- var24 = var12 * var7; -- var25 = var13 * var7; -+ -+ if (par1Block != Block.grass) { -+ var17 = var10 * par5; -+ var18 = var12 * par5; -+ var19 = var13 * par5; -+ var20 = var10 * par6; -+ var21 = var12 * par6; -+ var22 = var13 * par6; -+ var23 = var10 * par7; -+ var24 = var12 * par7; -+ var25 = var13 * par7; - } - -- int var26 = var1.getMixedBrightnessForBlock(this.blockAccess, var2, var3, var4); -- if(this.renderAllFaces || var1.shouldSideBeRendered(this.blockAccess, var2, var3 - 1, var4, 0)) { -- var8.setBrightness(this.renderMinY > 0.0D ? var26 : var1.getMixedBrightnessForBlock(this.blockAccess, var2, var3 - 1, var4)); -+ int var26 = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2, par3, par4); -+ -+ if (this.renderAllFaces || RenderPass.shouldSideBeRendered(par1Block, this.blockAccess, par2, par3 - 1, par4, 0)) { -+ var8.setBrightness(this.renderMinY > 0.0D ? var26 : par1Block.getMixedBrightnessForBlock(this.blockAccess, par2, par3 - 1, par4)); - var8.setColorOpaque_F(var17, var20, var23); -- this.renderFaceYNeg(var1, (double)var2, (double)var3, (double)var4, this.getBlockIcon(var1, this.blockAccess, var2, var3, var4, 0)); -+ this.renderFaceYNeg(par1Block, (double)par2, (double)par3, (double)par4, this.getBlockIcon(par1Block, this.blockAccess, par2, par3, par4, 0)); - var9 = true; - } - -- if(this.renderAllFaces || var1.shouldSideBeRendered(this.blockAccess, var2, var3 + 1, var4, 1)) { -- var8.setBrightness(this.renderMaxY < 1.0D ? var26 : var1.getMixedBrightnessForBlock(this.blockAccess, var2, var3 + 1, var4)); -+ if (this.renderAllFaces || RenderPass.shouldSideBeRendered(par1Block, this.blockAccess, par2, par3 + 1, par4, 1)) { -+ var8.setBrightness(this.renderMaxY < 1.0D ? var26 : par1Block.getMixedBrightnessForBlock(this.blockAccess, par2, par3 + 1, par4)); - var8.setColorOpaque_F(var14, var15, var16); -- this.renderFaceYPos(var1, (double)var2, (double)var3, (double)var4, this.getBlockIcon(var1, this.blockAccess, var2, var3, var4, 1)); -+ this.renderFaceYPos(par1Block, (double)par2, (double)par3, (double)par4, this.getBlockIcon(par1Block, this.blockAccess, par2, par3, par4, 1)); - var9 = true; - } - - Icon var28; -- if(this.renderAllFaces || var1.shouldSideBeRendered(this.blockAccess, var2, var3, var4 - 1, 2)) { -- var8.setBrightness(this.renderMinZ > 0.0D ? var26 : var1.getMixedBrightnessForBlock(this.blockAccess, var2, var3, var4 - 1)); -- var8.setColorOpaque_F(var18, var21, var24); -- var28 = this.getBlockIcon(var1, this.blockAccess, var2, var3, var4, 2); -- this.renderFaceZNeg(var1, (double)var2, (double)var3, (double)var4, var28); -- if(fancyGrass && var28.getIconName().equals("grass_side") && !this.hasOverrideBlockTexture()) { -- var8.setColorOpaque_F(var18 * var5, var21 * var6, var24 * var7); -- this.renderFaceZNeg(var1, (double)var2, (double)var3, (double)var4, BlockGrass.getIconSideOverlay()); -- } -- -- var9 = true; -- } -- -- if(this.renderAllFaces || var1.shouldSideBeRendered(this.blockAccess, var2, var3, var4 + 1, 3)) { -- var8.setBrightness(this.renderMaxZ < 1.0D ? var26 : var1.getMixedBrightnessForBlock(this.blockAccess, var2, var3, var4 + 1)); -- var8.setColorOpaque_F(var18, var21, var24); -- var28 = this.getBlockIcon(var1, this.blockAccess, var2, var3, var4, 3); -- this.renderFaceZPos(var1, (double)var2, (double)var3, (double)var4, var28); -- if(fancyGrass && var28.getIconName().equals("grass_side") && !this.hasOverrideBlockTexture()) { -- var8.setColorOpaque_F(var18 * var5, var21 * var6, var24 * var7); -- this.renderFaceZPos(var1, (double)var2, (double)var3, (double)var4, BlockGrass.getIconSideOverlay()); -- } -- -- var9 = true; -- } -- -- if(this.renderAllFaces || var1.shouldSideBeRendered(this.blockAccess, var2 - 1, var3, var4, 4)) { -- var8.setBrightness(this.renderMinX > 0.0D ? var26 : var1.getMixedBrightnessForBlock(this.blockAccess, var2 - 1, var3, var4)); -- var8.setColorOpaque_F(var19, var22, var25); -- var28 = this.getBlockIcon(var1, this.blockAccess, var2, var3, var4, 4); -- this.renderFaceXNeg(var1, (double)var2, (double)var3, (double)var4, var28); -- if(fancyGrass && var28.getIconName().equals("grass_side") && !this.hasOverrideBlockTexture()) { -- var8.setColorOpaque_F(var19 * var5, var22 * var6, var25 * var7); -- this.renderFaceXNeg(var1, (double)var2, (double)var3, (double)var4, BlockGrass.getIconSideOverlay()); -- } -- -- var9 = true; -- } -- -- if(this.renderAllFaces || var1.shouldSideBeRendered(this.blockAccess, var2 + 1, var3, var4, 5)) { -- var8.setBrightness(this.renderMaxX < 1.0D ? var26 : var1.getMixedBrightnessForBlock(this.blockAccess, var2 + 1, var3, var4)); -- var8.setColorOpaque_F(var19, var22, var25); -- var28 = this.getBlockIcon(var1, this.blockAccess, var2, var3, var4, 5); -- this.renderFaceXPos(var1, (double)var2, (double)var3, (double)var4, var28); -- if(fancyGrass && var28.getIconName().equals("grass_side") && !this.hasOverrideBlockTexture()) { -- var8.setColorOpaque_F(var19 * var5, var22 * var6, var25 * var7); -- this.renderFaceXPos(var1, (double)var2, (double)var3, (double)var4, BlockGrass.getIconSideOverlay()); -+ -+ if (this.renderAllFaces || RenderPass.shouldSideBeRendered(par1Block, this.blockAccess, par2, par3, par4 - 1, 2)) { -+ var8.setBrightness(this.renderMinZ > 0.0D ? var26 : par1Block.getMixedBrightnessForBlock(this.blockAccess, par2, par3, par4 - 1)); -+ -+ if (CTMUtils.isBetterGrass(this.blockAccess, par1Block, par2, par3, par4, 2)) { -+ var8.setColorOpaque_F(var18 * par5, var21 * par6, var24 * par7); -+ } else { -+ var8.setColorOpaque_F(var18, var21, var24); -+ } -+ -+ var28 = this.getBlockIcon(par1Block, this.blockAccess, par2, par3, par4, 2); -+ this.renderFaceZNeg(par1Block, (double)par2, (double)par3, (double)par4, var28); -+ -+ if (fancyGrass && var28.getIconName().equals("grass_side") && !this.hasOverrideBlockTexture()) { -+ var8.setColorOpaque_F(var18 * par5, var21 * par6, var24 * par7); -+ this.renderFaceZNeg(par1Block, (double)par2, (double)par3, (double)par4, BlockGrass.getIconSideOverlay()); -+ } -+ -+ var9 = true; -+ } -+ -+ if (this.renderAllFaces || RenderPass.shouldSideBeRendered(par1Block, this.blockAccess, par2, par3, par4 + 1, 3)) { -+ var8.setBrightness(this.renderMaxZ < 1.0D ? var26 : par1Block.getMixedBrightnessForBlock(this.blockAccess, par2, par3, par4 + 1)); -+ -+ if (CTMUtils.isBetterGrass(this.blockAccess, par1Block, par2, par3, par4, 3)) { -+ var8.setColorOpaque_F(var18 * par5, var21 * par6, var24 * par7); -+ } else { -+ var8.setColorOpaque_F(var18, var21, var24); -+ } -+ -+ var28 = this.getBlockIcon(par1Block, this.blockAccess, par2, par3, par4, 3); -+ this.renderFaceZPos(par1Block, (double)par2, (double)par3, (double)par4, var28); -+ -+ if (fancyGrass && var28.getIconName().equals("grass_side") && !this.hasOverrideBlockTexture()) { -+ var8.setColorOpaque_F(var18 * par5, var21 * par6, var24 * par7); -+ this.renderFaceZPos(par1Block, (double)par2, (double)par3, (double)par4, BlockGrass.getIconSideOverlay()); -+ } -+ -+ var9 = true; -+ } -+ -+ if (this.renderAllFaces || RenderPass.shouldSideBeRendered(par1Block, this.blockAccess, par2 - 1, par3, par4, 4)) { -+ var8.setBrightness(this.renderMinX > 0.0D ? var26 : par1Block.getMixedBrightnessForBlock(this.blockAccess, par2 - 1, par3, par4)); -+ -+ if (CTMUtils.isBetterGrass(this.blockAccess, par1Block, par2, par3, par4, 4)) { -+ var8.setColorOpaque_F(var19 * par5, var22 * par6, var25 * par7); -+ } else { -+ var8.setColorOpaque_F(var19, var22, var25); -+ } -+ -+ var28 = this.getBlockIcon(par1Block, this.blockAccess, par2, par3, par4, 4); -+ this.renderFaceXNeg(par1Block, (double)par2, (double)par3, (double)par4, var28); -+ -+ if (fancyGrass && var28.getIconName().equals("grass_side") && !this.hasOverrideBlockTexture()) { -+ var8.setColorOpaque_F(var19 * par5, var22 * par6, var25 * par7); -+ this.renderFaceXNeg(par1Block, (double)par2, (double)par3, (double)par4, BlockGrass.getIconSideOverlay()); -+ } -+ -+ var9 = true; -+ } -+ -+ if (this.renderAllFaces || RenderPass.shouldSideBeRendered(par1Block, this.blockAccess, par2 + 1, par3, par4, 5)) { -+ var8.setBrightness(this.renderMaxX < 1.0D ? var26 : par1Block.getMixedBrightnessForBlock(this.blockAccess, par2 + 1, par3, par4)); -+ -+ if (CTMUtils.isBetterGrass(this.blockAccess, par1Block, par2, par3, par4, 5)) { -+ var8.setColorOpaque_F(var19 * par5, var22 * par6, var25 * par7); -+ } else { -+ var8.setColorOpaque_F(var19, var22, var25); -+ } -+ -+ var28 = this.getBlockIcon(par1Block, this.blockAccess, par2, par3, par4, 5); -+ this.renderFaceXPos(par1Block, (double)par2, (double)par3, (double)par4, var28); -+ -+ if (fancyGrass && var28.getIconName().equals("grass_side") && !this.hasOverrideBlockTexture()) { -+ var8.setColorOpaque_F(var19 * par5, var22 * par6, var25 * par7); -+ this.renderFaceXPos(par1Block, (double)par2, (double)par3, (double)par4, BlockGrass.getIconSideOverlay()); - } - - var9 = true; -@@ -4756,14 +5475,17 @@ - return var9; - } - -- private boolean renderBlockCocoa(BlockCocoa var1, int var2, int var3, int var4) { -+ /** -+ * Renders a Cocoa block at the given coordinates -+ */ -+ private boolean renderBlockCocoa(BlockCocoa par1BlockCocoa, int par2, int par3, int par4) { - Tessellator var5 = Tessellator.instance; -- var5.setBrightness(var1.getMixedBrightnessForBlock(this.blockAccess, var2, var3, var4)); -+ var5.setBrightness(par1BlockCocoa.getMixedBrightnessForBlock(this.blockAccess, par2, par3, par4)); - var5.setColorOpaque_F(1.0F, 1.0F, 1.0F); -- int var6 = this.blockAccess.getBlockMetadata(var2, var3, var4); -+ int var6 = this.blockAccess.getBlockMetadata(par2, par3, par4); - int var7 = BlockDirectional.getDirection(var6); - int var8 = BlockCocoa.func_72219_c(var6); -- Icon var9 = var1.getCocoaIcon(var8); -+ Icon var9 = par1BlockCocoa.getCocoaIcon(var8); - int var10 = 4 + var8 * 2; - int var11 = 5 + var8 * 2; - double var12 = 15.0D - (double)var10; -@@ -4776,30 +5498,34 @@ - double var26 = (double)var9.getInterpolatedV(var18); - double var28 = 0.0D; - double var30 = 0.0D; -- switch(var7) { -- case 0: -- var28 = 8.0D - (double)(var10 / 2); -- var30 = 15.0D - (double)var10; -- break; -- case 1: -- var28 = 1.0D; -- var30 = 8.0D - (double)(var10 / 2); -- break; -- case 2: -- var28 = 8.0D - (double)(var10 / 2); -- var30 = 1.0D; -- break; -- case 3: -- var28 = 15.0D - (double)var10; -- var30 = 8.0D - (double)(var10 / 2); -+ -+ switch (var7) { -+ case 0: -+ var28 = 8.0D - (double)(var10 / 2); -+ var30 = 15.0D - (double)var10; -+ break; -+ -+ case 1: -+ var28 = 1.0D; -+ var30 = 8.0D - (double)(var10 / 2); -+ break; -+ -+ case 2: -+ var28 = 8.0D - (double)(var10 / 2); -+ var30 = 1.0D; -+ break; -+ -+ case 3: -+ var28 = 15.0D - (double)var10; -+ var30 = 8.0D - (double)(var10 / 2); - } - -- double var32 = (double)var2 + var28 / 16.0D; -- double var34 = (double)var2 + (var28 + (double)var10) / 16.0D; -- double var36 = (double)var3 + (12.0D - (double)var11) / 16.0D; -- double var38 = (double)var3 + 0.75D; -- double var40 = (double)var4 + var30 / 16.0D; -- double var42 = (double)var4 + (var30 + (double)var10) / 16.0D; -+ double var32 = (double)par2 + var28 / 16.0D; -+ double var34 = (double)par2 + (var28 + (double)var10) / 16.0D; -+ double var36 = (double)par3 + (12.0D - (double)var11) / 16.0D; -+ double var38 = (double)par3 + 0.75D; -+ double var40 = (double)par4 + var30 / 16.0D; -+ double var42 = (double)par4 + (var30 + (double)var10) / 16.0D; - var5.addVertexWithUV(var32, var36, var40, var20, var26); - var5.addVertexWithUV(var32, var36, var42, var22, var26); - var5.addVertexWithUV(var32, var38, var42, var22, var24); -@@ -4817,107 +5543,127 @@ - var5.addVertexWithUV(var34, var38, var42, var22, var24); - var5.addVertexWithUV(var32, var38, var42, var20, var24); - int var44 = var10; -- if(var8 >= 2) { -+ -+ if (var8 >= 2) { - var44 = var10 - 1; - } - -- var20 = (double)var9.getMinU(); -- var22 = (double)var9.getInterpolatedU((double)var44); -- var24 = (double)var9.getMinV(); -- var26 = (double)var9.getInterpolatedV((double)var44); -- var5.addVertexWithUV(var32, var38, var42, var20, var26); -- var5.addVertexWithUV(var34, var38, var42, var22, var26); -- var5.addVertexWithUV(var34, var38, var40, var22, var24); -- var5.addVertexWithUV(var32, var38, var40, var20, var24); -- var5.addVertexWithUV(var32, var36, var40, var20, var24); -- var5.addVertexWithUV(var34, var36, var40, var22, var24); -- var5.addVertexWithUV(var34, var36, var42, var22, var26); -- var5.addVertexWithUV(var32, var36, var42, var20, var26); -- var20 = (double)var9.getInterpolatedU(12.0D); -- var22 = (double)var9.getMaxU(); -- var24 = (double)var9.getMinV(); -- var26 = (double)var9.getInterpolatedV(4.0D); -- var28 = 8.0D; -- var30 = 0.0D; -- double var45; -- switch(var7) { -- case 0: -- var28 = 8.0D; -- var30 = 12.0D; -- var45 = var20; -- var20 = var22; -- var22 = var45; -- break; -- case 1: -- var28 = 0.0D; -- var30 = 8.0D; -- break; -- case 2: -+ var9 = CTMUtils.getTile(this, par1BlockCocoa, par2, par3, par4, var9, var5); -+ -+ if (var9 == null) { -+ return false; -+ } else { -+ var5 = TessellatorUtils.getTessellator(var5, var9); -+ var20 = (double)var9.getMinU(); -+ var22 = (double)var9.getInterpolatedU((double)var44); -+ var24 = (double)var9.getMinV(); -+ var26 = (double)var9.getInterpolatedV((double)var44); -+ var5.addVertexWithUV(var32, var38, var42, var20, var26); -+ var5.addVertexWithUV(var34, var38, var42, var22, var26); -+ var5.addVertexWithUV(var34, var38, var40, var22, var24); -+ var5.addVertexWithUV(var32, var38, var40, var20, var24); -+ var5.addVertexWithUV(var32, var36, var40, var20, var24); -+ var5.addVertexWithUV(var34, var36, var40, var22, var24); -+ var5.addVertexWithUV(var34, var36, var42, var22, var26); -+ var5.addVertexWithUV(var32, var36, var42, var20, var26); -+ var20 = (double)var9.getInterpolatedU(12.0D); -+ var22 = (double)var9.getMaxU(); -+ var24 = (double)var9.getMinV(); -+ var26 = (double)var9.getInterpolatedV(4.0D); - var28 = 8.0D; - var30 = 0.0D; -- break; -- case 3: -- var28 = 12.0D; -- var30 = 8.0D; -- var45 = var20; -- var20 = var22; -- var22 = var45; -- } -- -- var32 = (double)var2 + var28 / 16.0D; -- var34 = (double)var2 + (var28 + 4.0D) / 16.0D; -- var36 = (double)var3 + 0.75D; -- var38 = (double)var3 + 1.0D; -- var40 = (double)var4 + var30 / 16.0D; -- var42 = (double)var4 + (var30 + 4.0D) / 16.0D; -- if(var7 != 2 && var7 != 0) { -- if(var7 == 1 || var7 == 3) { -- var5.addVertexWithUV(var34, var36, var40, var20, var26); -- var5.addVertexWithUV(var32, var36, var40, var22, var26); -- var5.addVertexWithUV(var32, var38, var40, var22, var24); -- var5.addVertexWithUV(var34, var38, var40, var20, var24); -- var5.addVertexWithUV(var32, var36, var40, var22, var26); -- var5.addVertexWithUV(var34, var36, var40, var20, var26); -- var5.addVertexWithUV(var34, var38, var40, var20, var24); -- var5.addVertexWithUV(var32, var38, var40, var22, var24); -- } -- } else { -- var5.addVertexWithUV(var32, var36, var40, var22, var26); -- var5.addVertexWithUV(var32, var36, var42, var20, var26); -- var5.addVertexWithUV(var32, var38, var42, var20, var24); -- var5.addVertexWithUV(var32, var38, var40, var22, var24); -- var5.addVertexWithUV(var32, var36, var42, var20, var26); -- var5.addVertexWithUV(var32, var36, var40, var22, var26); -- var5.addVertexWithUV(var32, var38, var40, var22, var24); -- var5.addVertexWithUV(var32, var38, var42, var20, var24); -- } -- -- return true; -+ double var45; -+ -+ switch (var7) { -+ case 0: -+ var28 = 8.0D; -+ var30 = 12.0D; -+ var45 = var20; -+ var20 = var22; -+ var22 = var45; -+ break; -+ -+ case 1: -+ var28 = 0.0D; -+ var30 = 8.0D; -+ break; -+ -+ case 2: -+ var28 = 8.0D; -+ var30 = 0.0D; -+ break; -+ -+ case 3: -+ var28 = 12.0D; -+ var30 = 8.0D; -+ var45 = var20; -+ var20 = var22; -+ var22 = var45; -+ } -+ -+ var32 = (double)par2 + var28 / 16.0D; -+ var34 = (double)par2 + (var28 + 4.0D) / 16.0D; -+ var36 = (double)par3 + 0.75D; -+ var38 = (double)par3 + 1.0D; -+ var40 = (double)par4 + var30 / 16.0D; -+ var42 = (double)par4 + (var30 + 4.0D) / 16.0D; -+ -+ if (var7 != 2 && var7 != 0) { -+ if (var7 == 1 || var7 == 3) { -+ var5.addVertexWithUV(var34, var36, var40, var20, var26); -+ var5.addVertexWithUV(var32, var36, var40, var22, var26); -+ var5.addVertexWithUV(var32, var38, var40, var22, var24); -+ var5.addVertexWithUV(var34, var38, var40, var20, var24); -+ var5.addVertexWithUV(var32, var36, var40, var22, var26); -+ var5.addVertexWithUV(var34, var36, var40, var20, var26); -+ var5.addVertexWithUV(var34, var38, var40, var20, var24); -+ var5.addVertexWithUV(var32, var38, var40, var22, var24); -+ } -+ } else { -+ var5.addVertexWithUV(var32, var36, var40, var22, var26); -+ var5.addVertexWithUV(var32, var36, var42, var20, var26); -+ var5.addVertexWithUV(var32, var38, var42, var20, var24); -+ var5.addVertexWithUV(var32, var38, var40, var22, var24); -+ var5.addVertexWithUV(var32, var36, var42, var20, var26); -+ var5.addVertexWithUV(var32, var36, var40, var22, var26); -+ var5.addVertexWithUV(var32, var38, var40, var22, var24); -+ var5.addVertexWithUV(var32, var38, var42, var20, var24); -+ } -+ -+ return true; -+ } - } - -- private boolean renderBlockBeacon(BlockBeacon var1, int var2, int var3, int var4) { -- float var5 = 3.0F / 16.0F; -+ /** -+ * Renders beacon block -+ */ -+ private boolean renderBlockBeacon(BlockBeacon par1BlockBeacon, int par2, int par3, int par4) { -+ float var5 = 0.1875F; - this.setOverrideBlockTexture(this.getBlockIcon(Block.glass)); - this.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 1.0D); -- this.renderStandardBlock(var1, var2, var3, var4); -+ this.renderStandardBlock(par1BlockBeacon, par2, par3, par4); - this.renderAllFaces = true; - this.setOverrideBlockTexture(this.getBlockIcon(Block.obsidian)); -- this.setRenderBounds(0.125D, (double)0.00625F, 0.125D, 0.875D, (double)var5, 0.875D); -- this.renderStandardBlock(var1, var2, var3, var4); -+ this.setRenderBounds(0.125D, 0.0062500000931322575D, 0.125D, 0.875D, (double)var5, 0.875D); -+ this.renderStandardBlock(par1BlockBeacon, par2, par3, par4); - this.setOverrideBlockTexture(this.getBlockIcon(Block.beacon)); - this.setRenderBounds(0.1875D, (double)var5, 0.1875D, 0.8125D, 0.875D, 0.8125D); -- this.renderStandardBlock(var1, var2, var3, var4); -+ this.renderStandardBlock(par1BlockBeacon, par2, par3, par4); - this.renderAllFaces = false; - this.clearOverrideBlockTexture(); - return true; - } - -- public boolean renderBlockCactus(Block var1, int var2, int var3, int var4) { -- int var5 = var1.colorMultiplier(this.blockAccess, var2, var3, var4); -+ /** -+ * Renders a cactus block at the given coordinates -+ */ -+ public boolean renderBlockCactus(Block par1Block, int par2, int par3, int par4) { -+ int var5 = par1Block.colorMultiplier(this.blockAccess, par2, par3, par4); - float var6 = (float)(var5 >> 16 & 255) / 255.0F; - float var7 = (float)(var5 >> 8 & 255) / 255.0F; - float var8 = (float)(var5 & 255) / 255.0F; -- if(EntityRenderer.anaglyphEnable) { -+ -+ if (EntityRenderer.anaglyphEnable) { - float var9 = (var6 * 30.0F + var7 * 59.0F + var8 * 11.0F) / 100.0F; - float var10 = (var6 * 30.0F + var7 * 70.0F) / 100.0F; - float var11 = (var6 * 30.0F + var8 * 70.0F) / 100.0F; -@@ -4926,207 +5672,221 @@ - var8 = var11; - } - -- return this.renderBlockCactusImpl(var1, var2, var3, var4, var6, var7, var8); -+ return this.renderBlockCactusImpl(par1Block, par2, par3, par4, var6, var7, var8); - } - -- public boolean renderBlockCactusImpl(Block var1, int var2, int var3, int var4, float var5, float var6, float var7) { -+ /** -+ * Render block cactus implementation -+ */ -+ public boolean renderBlockCactusImpl(Block par1Block, int par2, int par3, int par4, float par5, float par6, float par7) { - Tessellator var8 = Tessellator.instance; - boolean var9 = false; - float var10 = 0.5F; - float var11 = 1.0F; - float var12 = 0.8F; - float var13 = 0.6F; -- float var14 = var10 * var5; -- float var15 = var11 * var5; -- float var16 = var12 * var5; -- float var17 = var13 * var5; -- float var18 = var10 * var6; -- float var19 = var11 * var6; -- float var20 = var12 * var6; -- float var21 = var13 * var6; -- float var22 = var10 * var7; -- float var23 = var11 * var7; -- float var24 = var12 * var7; -- float var25 = var13 * var7; -- float var26 = 1.0F / 16.0F; -- int var27 = var1.getMixedBrightnessForBlock(this.blockAccess, var2, var3, var4); -- if(this.renderAllFaces || var1.shouldSideBeRendered(this.blockAccess, var2, var3 - 1, var4, 0)) { -- var8.setBrightness(this.renderMinY > 0.0D ? var27 : var1.getMixedBrightnessForBlock(this.blockAccess, var2, var3 - 1, var4)); -+ float var14 = var10 * par5; -+ float var15 = var11 * par5; -+ float var16 = var12 * par5; -+ float var17 = var13 * par5; -+ float var18 = var10 * par6; -+ float var19 = var11 * par6; -+ float var20 = var12 * par6; -+ float var21 = var13 * par6; -+ float var22 = var10 * par7; -+ float var23 = var11 * par7; -+ float var24 = var12 * par7; -+ float var25 = var13 * par7; -+ float var26 = 0.0625F; -+ int var27 = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2, par3, par4); -+ -+ if (this.renderAllFaces || RenderPass.shouldSideBeRendered(par1Block, this.blockAccess, par2, par3 - 1, par4, 0)) { -+ var8.setBrightness(this.renderMinY > 0.0D ? var27 : par1Block.getMixedBrightnessForBlock(this.blockAccess, par2, par3 - 1, par4)); - var8.setColorOpaque_F(var14, var18, var22); -- this.renderFaceYNeg(var1, (double)var2, (double)var3, (double)var4, this.getBlockIcon(var1, this.blockAccess, var2, var3, var4, 0)); -+ this.renderFaceYNeg(par1Block, (double)par2, (double)par3, (double)par4, this.getBlockIcon(par1Block, this.blockAccess, par2, par3, par4, 0)); - } - -- if(this.renderAllFaces || var1.shouldSideBeRendered(this.blockAccess, var2, var3 + 1, var4, 1)) { -- var8.setBrightness(this.renderMaxY < 1.0D ? var27 : var1.getMixedBrightnessForBlock(this.blockAccess, var2, var3 + 1, var4)); -+ if (this.renderAllFaces || RenderPass.shouldSideBeRendered(par1Block, this.blockAccess, par2, par3 + 1, par4, 1)) { -+ var8.setBrightness(this.renderMaxY < 1.0D ? var27 : par1Block.getMixedBrightnessForBlock(this.blockAccess, par2, par3 + 1, par4)); - var8.setColorOpaque_F(var15, var19, var23); -- this.renderFaceYPos(var1, (double)var2, (double)var3, (double)var4, this.getBlockIcon(var1, this.blockAccess, var2, var3, var4, 1)); -+ this.renderFaceYPos(par1Block, (double)par2, (double)par3, (double)par4, this.getBlockIcon(par1Block, this.blockAccess, par2, par3, par4, 1)); - } - - var8.setBrightness(var27); - var8.setColorOpaque_F(var16, var20, var24); - var8.addTranslation(0.0F, 0.0F, var26); -- this.renderFaceZNeg(var1, (double)var2, (double)var3, (double)var4, this.getBlockIcon(var1, this.blockAccess, var2, var3, var4, 2)); -- var8.addTranslation(0.0F, 0.0F, -var26); -- var8.addTranslation(0.0F, 0.0F, -var26); -- this.renderFaceZPos(var1, (double)var2, (double)var3, (double)var4, this.getBlockIcon(var1, this.blockAccess, var2, var3, var4, 3)); -+ this.renderFaceZNeg(par1Block, (double)par2, (double)par3, (double)par4, this.getBlockIcon(par1Block, this.blockAccess, par2, par3, par4, 2)); -+ var8.addTranslation(0.0F, 0.0F, -var26); -+ var8.addTranslation(0.0F, 0.0F, -var26); -+ this.renderFaceZPos(par1Block, (double)par2, (double)par3, (double)par4, this.getBlockIcon(par1Block, this.blockAccess, par2, par3, par4, 3)); - var8.addTranslation(0.0F, 0.0F, var26); - var8.setColorOpaque_F(var17, var21, var25); - var8.addTranslation(var26, 0.0F, 0.0F); -- this.renderFaceXNeg(var1, (double)var2, (double)var3, (double)var4, this.getBlockIcon(var1, this.blockAccess, var2, var3, var4, 4)); -- var8.addTranslation(-var26, 0.0F, 0.0F); -- var8.addTranslation(-var26, 0.0F, 0.0F); -- this.renderFaceXPos(var1, (double)var2, (double)var3, (double)var4, this.getBlockIcon(var1, this.blockAccess, var2, var3, var4, 5)); -+ this.renderFaceXNeg(par1Block, (double)par2, (double)par3, (double)par4, this.getBlockIcon(par1Block, this.blockAccess, par2, par3, par4, 4)); -+ var8.addTranslation(-var26, 0.0F, 0.0F); -+ var8.addTranslation(-var26, 0.0F, 0.0F); -+ this.renderFaceXPos(par1Block, (double)par2, (double)par3, (double)par4, this.getBlockIcon(par1Block, this.blockAccess, par2, par3, par4, 5)); - var8.addTranslation(var26, 0.0F, 0.0F); - return true; - } - -- public boolean renderBlockFence(BlockFence var1, int var2, int var3, int var4) { -+ public boolean renderBlockFence(BlockFence par1BlockFence, int par2, int par3, int par4) { - boolean var5 = false; -- float var6 = 6.0F / 16.0F; -- float var7 = 10.0F / 16.0F; -+ float var6 = 0.375F; -+ float var7 = 0.625F; - this.setRenderBounds((double)var6, 0.0D, (double)var6, (double)var7, 1.0D, (double)var7); -- this.renderStandardBlock(var1, var2, var3, var4); -+ this.renderStandardBlock(par1BlockFence, par2, par3, par4); - var5 = true; - boolean var8 = false; - boolean var9 = false; -- if(var1.canConnectFenceTo(this.blockAccess, var2 - 1, var3, var4) || var1.canConnectFenceTo(this.blockAccess, var2 + 1, var3, var4)) { -+ -+ if (par1BlockFence.canConnectFenceTo(this.blockAccess, par2 - 1, par3, par4) || par1BlockFence.canConnectFenceTo(this.blockAccess, par2 + 1, par3, par4)) { - var8 = true; - } - -- if(var1.canConnectFenceTo(this.blockAccess, var2, var3, var4 - 1) || var1.canConnectFenceTo(this.blockAccess, var2, var3, var4 + 1)) { -+ if (par1BlockFence.canConnectFenceTo(this.blockAccess, par2, par3, par4 - 1) || par1BlockFence.canConnectFenceTo(this.blockAccess, par2, par3, par4 + 1)) { - var9 = true; - } - -- boolean var10 = var1.canConnectFenceTo(this.blockAccess, var2 - 1, var3, var4); -- boolean var11 = var1.canConnectFenceTo(this.blockAccess, var2 + 1, var3, var4); -- boolean var12 = var1.canConnectFenceTo(this.blockAccess, var2, var3, var4 - 1); -- boolean var13 = var1.canConnectFenceTo(this.blockAccess, var2, var3, var4 + 1); -- if(!var8 && !var9) { -+ boolean var10 = par1BlockFence.canConnectFenceTo(this.blockAccess, par2 - 1, par3, par4); -+ boolean var11 = par1BlockFence.canConnectFenceTo(this.blockAccess, par2 + 1, par3, par4); -+ boolean var12 = par1BlockFence.canConnectFenceTo(this.blockAccess, par2, par3, par4 - 1); -+ boolean var13 = par1BlockFence.canConnectFenceTo(this.blockAccess, par2, par3, par4 + 1); -+ -+ if (!var8 && !var9) { - var8 = true; - } - -- var6 = 7.0F / 16.0F; -- var7 = 9.0F / 16.0F; -- float var14 = 12.0F / 16.0F; -- float var15 = 15.0F / 16.0F; -+ var6 = 0.4375F; -+ var7 = 0.5625F; -+ float var14 = 0.75F; -+ float var15 = 0.9375F; - float var16 = var10 ? 0.0F : var6; - float var17 = var11 ? 1.0F : var7; - float var18 = var12 ? 0.0F : var6; - float var19 = var13 ? 1.0F : var7; -- if(var8) { -- this.setRenderBounds((double)var16, (double)var14, (double)var6, (double)var17, (double)var15, (double)var7); -- this.renderStandardBlock(var1, var2, var3, var4); -- var5 = true; -- } -- -- if(var9) { -- this.setRenderBounds((double)var6, (double)var14, (double)var18, (double)var7, (double)var15, (double)var19); -- this.renderStandardBlock(var1, var2, var3, var4); -- var5 = true; -- } -- -- var14 = 6.0F / 16.0F; -- var15 = 9.0F / 16.0F; -- if(var8) { -- this.setRenderBounds((double)var16, (double)var14, (double)var6, (double)var17, (double)var15, (double)var7); -- this.renderStandardBlock(var1, var2, var3, var4); -- var5 = true; -- } -- -- if(var9) { -- this.setRenderBounds((double)var6, (double)var14, (double)var18, (double)var7, (double)var15, (double)var19); -- this.renderStandardBlock(var1, var2, var3, var4); -- var5 = true; -- } -- -- var1.setBlockBoundsBasedOnState(this.blockAccess, var2, var3, var4); -+ -+ if (var8) { -+ this.setRenderBounds((double)var16, (double)var14, (double)var6, (double)var17, (double)var15, (double)var7); -+ this.renderStandardBlock(par1BlockFence, par2, par3, par4); -+ var5 = true; -+ } -+ -+ if (var9) { -+ this.setRenderBounds((double)var6, (double)var14, (double)var18, (double)var7, (double)var15, (double)var19); -+ this.renderStandardBlock(par1BlockFence, par2, par3, par4); -+ var5 = true; -+ } -+ -+ var14 = 0.375F; -+ var15 = 0.5625F; -+ -+ if (var8) { -+ this.setRenderBounds((double)var16, (double)var14, (double)var6, (double)var17, (double)var15, (double)var7); -+ this.renderStandardBlock(par1BlockFence, par2, par3, par4); -+ var5 = true; -+ } -+ -+ if (var9) { -+ this.setRenderBounds((double)var6, (double)var14, (double)var18, (double)var7, (double)var15, (double)var19); -+ this.renderStandardBlock(par1BlockFence, par2, par3, par4); -+ var5 = true; -+ } -+ -+ par1BlockFence.setBlockBoundsBasedOnState(this.blockAccess, par2, par3, par4); - return var5; - } - -- public boolean renderBlockWall(BlockWall var1, int var2, int var3, int var4) { -- boolean var5 = var1.canConnectWallTo(this.blockAccess, var2 - 1, var3, var4); -- boolean var6 = var1.canConnectWallTo(this.blockAccess, var2 + 1, var3, var4); -- boolean var7 = var1.canConnectWallTo(this.blockAccess, var2, var3, var4 - 1); -- boolean var8 = var1.canConnectWallTo(this.blockAccess, var2, var3, var4 + 1); -+ /** -+ * Renders wall block -+ */ -+ public boolean renderBlockWall(BlockWall par1BlockWall, int par2, int par3, int par4) { -+ boolean var5 = par1BlockWall.canConnectWallTo(this.blockAccess, par2 - 1, par3, par4); -+ boolean var6 = par1BlockWall.canConnectWallTo(this.blockAccess, par2 + 1, par3, par4); -+ boolean var7 = par1BlockWall.canConnectWallTo(this.blockAccess, par2, par3, par4 - 1); -+ boolean var8 = par1BlockWall.canConnectWallTo(this.blockAccess, par2, par3, par4 + 1); - boolean var9 = var7 && var8 && !var5 && !var6; - boolean var10 = !var7 && !var8 && var5 && var6; -- boolean var11 = this.blockAccess.isAirBlock(var2, var3 + 1, var4); -- if((var9 || var10) && var11) { -- if(var9) { -+ boolean var11 = this.blockAccess.isAirBlock(par2, par3 + 1, par4); -+ -+ if ((var9 || var10) && var11) { -+ if (var9) { - this.setRenderBounds(0.3125D, 0.0D, 0.0D, 0.6875D, 0.8125D, 1.0D); -- this.renderStandardBlock(var1, var2, var3, var4); -+ this.renderStandardBlock(par1BlockWall, par2, par3, par4); - } else { - this.setRenderBounds(0.0D, 0.0D, 0.3125D, 1.0D, 0.8125D, 0.6875D); -- this.renderStandardBlock(var1, var2, var3, var4); -+ this.renderStandardBlock(par1BlockWall, par2, par3, par4); - } - } else { - this.setRenderBounds(0.25D, 0.0D, 0.25D, 0.75D, 1.0D, 0.75D); -- this.renderStandardBlock(var1, var2, var3, var4); -- if(var5) { -+ this.renderStandardBlock(par1BlockWall, par2, par3, par4); -+ -+ if (var5) { - this.setRenderBounds(0.0D, 0.0D, 0.3125D, 0.25D, 0.8125D, 0.6875D); -- this.renderStandardBlock(var1, var2, var3, var4); -+ this.renderStandardBlock(par1BlockWall, par2, par3, par4); - } - -- if(var6) { -+ if (var6) { - this.setRenderBounds(0.75D, 0.0D, 0.3125D, 1.0D, 0.8125D, 0.6875D); -- this.renderStandardBlock(var1, var2, var3, var4); -+ this.renderStandardBlock(par1BlockWall, par2, par3, par4); - } - -- if(var7) { -+ if (var7) { - this.setRenderBounds(0.3125D, 0.0D, 0.0D, 0.6875D, 0.8125D, 0.25D); -- this.renderStandardBlock(var1, var2, var3, var4); -+ this.renderStandardBlock(par1BlockWall, par2, par3, par4); - } - -- if(var8) { -+ if (var8) { - this.setRenderBounds(0.3125D, 0.0D, 0.75D, 0.6875D, 0.8125D, 1.0D); -- this.renderStandardBlock(var1, var2, var3, var4); -+ this.renderStandardBlock(par1BlockWall, par2, par3, par4); - } - } - -- var1.setBlockBoundsBasedOnState(this.blockAccess, var2, var3, var4); -+ par1BlockWall.setBlockBoundsBasedOnState(this.blockAccess, par2, par3, par4); - return true; - } - -- public boolean renderBlockDragonEgg(BlockDragonEgg var1, int var2, int var3, int var4) { -+ public boolean renderBlockDragonEgg(BlockDragonEgg par1BlockDragonEgg, int par2, int par3, int par4) { - boolean var5 = false; - int var6 = 0; - -- for(int var7 = 0; var7 < 8; ++var7) { -+ for (int var7 = 0; var7 < 8; ++var7) { - byte var8 = 0; - byte var9 = 1; -- if(var7 == 0) { -+ -+ if (var7 == 0) { - var8 = 2; - } - -- if(var7 == 1) { -+ if (var7 == 1) { - var8 = 3; - } - -- if(var7 == 2) { -+ if (var7 == 2) { - var8 = 4; - } - -- if(var7 == 3) { -+ if (var7 == 3) { - var8 = 5; - var9 = 2; - } - -- if(var7 == 4) { -+ if (var7 == 4) { - var8 = 6; - var9 = 3; - } - -- if(var7 == 5) { -+ if (var7 == 5) { - var8 = 7; - var9 = 5; - } - -- if(var7 == 6) { -+ if (var7 == 6) { - var8 = 6; - var9 = 2; - } - -- if(var7 == 7) { -+ if (var7 == 7) { - var8 = 3; - } - -@@ -5135,7 +5895,7 @@ - float var12 = 1.0F - (float)(var6 + var9) / 16.0F; - var6 += var9; - this.setRenderBounds((double)(0.5F - var10), (double)var12, (double)(0.5F - var10), (double)(0.5F + var10), (double)var11, (double)(0.5F + var10)); -- this.renderStandardBlock(var1, var2, var3, var4); -+ this.renderStandardBlock(par1BlockDragonEgg, par2, par3, par4); - } - - var5 = true; -@@ -5143,193 +5903,199 @@ - return var5; - } - -- public boolean renderBlockFenceGate(BlockFenceGate var1, int var2, int var3, int var4) { -+ /** -+ * Render block fence gate -+ */ -+ public boolean renderBlockFenceGate(BlockFenceGate par1BlockFenceGate, int par2, int par3, int par4) { - boolean var5 = true; -- int var6 = this.blockAccess.getBlockMetadata(var2, var3, var4); -+ int var6 = this.blockAccess.getBlockMetadata(par2, par3, par4); - boolean var7 = BlockFenceGate.isFenceGateOpen(var6); - int var8 = BlockDirectional.getDirection(var6); -- float var9 = 6.0F / 16.0F; -- float var10 = 9.0F / 16.0F; -- float var11 = 12.0F / 16.0F; -- float var12 = 15.0F / 16.0F; -- float var13 = 5.0F / 16.0F; -+ float var9 = 0.375F; -+ float var10 = 0.5625F; -+ float var11 = 0.75F; -+ float var12 = 0.9375F; -+ float var13 = 0.3125F; - float var14 = 1.0F; -- if((var8 == 2 || var8 == 0) && this.blockAccess.getBlockId(var2 - 1, var3, var4) == Block.cobblestoneWall.blockID && this.blockAccess.getBlockId(var2 + 1, var3, var4) == Block.cobblestoneWall.blockID || (var8 == 3 || var8 == 1) && this.blockAccess.getBlockId(var2, var3, var4 - 1) == Block.cobblestoneWall.blockID && this.blockAccess.getBlockId(var2, var3, var4 + 1) == Block.cobblestoneWall.blockID) { -- var9 -= 3.0F / 16.0F; -- var10 -= 3.0F / 16.0F; -- var11 -= 3.0F / 16.0F; -- var12 -= 3.0F / 16.0F; -- var13 -= 3.0F / 16.0F; -- var14 -= 3.0F / 16.0F; -+ -+ if ((var8 == 2 || var8 == 0) && this.blockAccess.getBlockId(par2 - 1, par3, par4) == Block.cobblestoneWall.blockID && this.blockAccess.getBlockId(par2 + 1, par3, par4) == Block.cobblestoneWall.blockID || (var8 == 3 || var8 == 1) && this.blockAccess.getBlockId(par2, par3, par4 - 1) == Block.cobblestoneWall.blockID && this.blockAccess.getBlockId(par2, par3, par4 + 1) == Block.cobblestoneWall.blockID) { -+ var9 -= 0.1875F; -+ var10 -= 0.1875F; -+ var11 -= 0.1875F; -+ var12 -= 0.1875F; -+ var13 -= 0.1875F; -+ var14 -= 0.1875F; - } - - this.renderAllFaces = true; - float var15; -- float var16; - float var17; -+ float var16; - float var18; -- if(var8 != 3 && var8 != 1) { -+ -+ if (var8 != 3 && var8 != 1) { - var15 = 0.0F; -- var16 = 2.0F / 16.0F; -- var17 = 7.0F / 16.0F; -- var18 = 9.0F / 16.0F; -+ var16 = 0.125F; -+ var17 = 0.4375F; -+ var18 = 0.5625F; - this.setRenderBounds((double)var15, (double)var13, (double)var17, (double)var16, (double)var14, (double)var18); -- this.renderStandardBlock(var1, var2, var3, var4); -- var15 = 14.0F / 16.0F; -+ this.renderStandardBlock(par1BlockFenceGate, par2, par3, par4); -+ var15 = 0.875F; - var16 = 1.0F; - this.setRenderBounds((double)var15, (double)var13, (double)var17, (double)var16, (double)var14, (double)var18); -- this.renderStandardBlock(var1, var2, var3, var4); -+ this.renderStandardBlock(par1BlockFenceGate, par2, par3, par4); - } else { - this.uvRotateTop = 1; -- var15 = 7.0F / 16.0F; -- var16 = 9.0F / 16.0F; -+ var15 = 0.4375F; -+ var16 = 0.5625F; - var17 = 0.0F; -- var18 = 2.0F / 16.0F; -+ var18 = 0.125F; - this.setRenderBounds((double)var15, (double)var13, (double)var17, (double)var16, (double)var14, (double)var18); -- this.renderStandardBlock(var1, var2, var3, var4); -- var17 = 14.0F / 16.0F; -+ this.renderStandardBlock(par1BlockFenceGate, par2, par3, par4); -+ var17 = 0.875F; - var18 = 1.0F; - this.setRenderBounds((double)var15, (double)var13, (double)var17, (double)var16, (double)var14, (double)var18); -- this.renderStandardBlock(var1, var2, var3, var4); -+ this.renderStandardBlock(par1BlockFenceGate, par2, par3, par4); - this.uvRotateTop = 0; - } - -- if(var7) { -- if(var8 == 2 || var8 == 0) { -+ if (var7) { -+ if (var8 == 2 || var8 == 0) { - this.uvRotateTop = 1; - } -- -+ - float var19; -- float var20; - float var21; -- if(var8 == 3) { -+ float var20; -+ -+ if (var8 == 3) { - var15 = 0.0F; -- var16 = 2.0F / 16.0F; -- var17 = 14.0F / 16.0F; -+ var16 = 0.125F; -+ var17 = 0.875F; - var18 = 1.0F; -- var19 = 9.0F / 16.0F; -- var20 = 13.0F / 16.0F; -- var21 = 15.0F / 16.0F; -+ var19 = 0.5625F; -+ var20 = 0.8125F; -+ var21 = 0.9375F; - this.setRenderBounds(0.8125D, (double)var9, 0.0D, 0.9375D, (double)var12, 0.125D); -- this.renderStandardBlock(var1, var2, var3, var4); -+ this.renderStandardBlock(par1BlockFenceGate, par2, par3, par4); - this.setRenderBounds(0.8125D, (double)var9, 0.875D, 0.9375D, (double)var12, 1.0D); -- this.renderStandardBlock(var1, var2, var3, var4); -+ this.renderStandardBlock(par1BlockFenceGate, par2, par3, par4); - this.setRenderBounds(0.5625D, (double)var9, 0.0D, 0.8125D, (double)var10, 0.125D); -- this.renderStandardBlock(var1, var2, var3, var4); -+ this.renderStandardBlock(par1BlockFenceGate, par2, par3, par4); - this.setRenderBounds(0.5625D, (double)var9, 0.875D, 0.8125D, (double)var10, 1.0D); -- this.renderStandardBlock(var1, var2, var3, var4); -+ this.renderStandardBlock(par1BlockFenceGate, par2, par3, par4); - this.setRenderBounds(0.5625D, (double)var11, 0.0D, 0.8125D, (double)var12, 0.125D); -- this.renderStandardBlock(var1, var2, var3, var4); -+ this.renderStandardBlock(par1BlockFenceGate, par2, par3, par4); - this.setRenderBounds(0.5625D, (double)var11, 0.875D, 0.8125D, (double)var12, 1.0D); -- this.renderStandardBlock(var1, var2, var3, var4); -- } else if(var8 == 1) { -+ this.renderStandardBlock(par1BlockFenceGate, par2, par3, par4); -+ } else if (var8 == 1) { - var15 = 0.0F; -- var16 = 2.0F / 16.0F; -- var17 = 14.0F / 16.0F; -+ var16 = 0.125F; -+ var17 = 0.875F; - var18 = 1.0F; -- var19 = 1.0F / 16.0F; -- var20 = 3.0F / 16.0F; -- var21 = 7.0F / 16.0F; -- this.setRenderBounds(1.0D / 16.0D, (double)var9, 0.0D, 0.1875D, (double)var12, 0.125D); -- this.renderStandardBlock(var1, var2, var3, var4); -- this.setRenderBounds(1.0D / 16.0D, (double)var9, 0.875D, 0.1875D, (double)var12, 1.0D); -- this.renderStandardBlock(var1, var2, var3, var4); -+ var19 = 0.0625F; -+ var20 = 0.1875F; -+ var21 = 0.4375F; -+ this.setRenderBounds(0.0625D, (double)var9, 0.0D, 0.1875D, (double)var12, 0.125D); -+ this.renderStandardBlock(par1BlockFenceGate, par2, par3, par4); -+ this.setRenderBounds(0.0625D, (double)var9, 0.875D, 0.1875D, (double)var12, 1.0D); -+ this.renderStandardBlock(par1BlockFenceGate, par2, par3, par4); - this.setRenderBounds(0.1875D, (double)var9, 0.0D, 0.4375D, (double)var10, 0.125D); -- this.renderStandardBlock(var1, var2, var3, var4); -+ this.renderStandardBlock(par1BlockFenceGate, par2, par3, par4); - this.setRenderBounds(0.1875D, (double)var9, 0.875D, 0.4375D, (double)var10, 1.0D); -- this.renderStandardBlock(var1, var2, var3, var4); -+ this.renderStandardBlock(par1BlockFenceGate, par2, par3, par4); - this.setRenderBounds(0.1875D, (double)var11, 0.0D, 0.4375D, (double)var12, 0.125D); -- this.renderStandardBlock(var1, var2, var3, var4); -+ this.renderStandardBlock(par1BlockFenceGate, par2, par3, par4); - this.setRenderBounds(0.1875D, (double)var11, 0.875D, 0.4375D, (double)var12, 1.0D); -- this.renderStandardBlock(var1, var2, var3, var4); -- } else if(var8 == 0) { -+ this.renderStandardBlock(par1BlockFenceGate, par2, par3, par4); -+ } else if (var8 == 0) { - var15 = 0.0F; -- var16 = 2.0F / 16.0F; -- var17 = 14.0F / 16.0F; -+ var16 = 0.125F; -+ var17 = 0.875F; - var18 = 1.0F; -- var19 = 9.0F / 16.0F; -- var20 = 13.0F / 16.0F; -- var21 = 15.0F / 16.0F; -+ var19 = 0.5625F; -+ var20 = 0.8125F; -+ var21 = 0.9375F; - this.setRenderBounds(0.0D, (double)var9, 0.8125D, 0.125D, (double)var12, 0.9375D); -- this.renderStandardBlock(var1, var2, var3, var4); -+ this.renderStandardBlock(par1BlockFenceGate, par2, par3, par4); - this.setRenderBounds(0.875D, (double)var9, 0.8125D, 1.0D, (double)var12, 0.9375D); -- this.renderStandardBlock(var1, var2, var3, var4); -+ this.renderStandardBlock(par1BlockFenceGate, par2, par3, par4); - this.setRenderBounds(0.0D, (double)var9, 0.5625D, 0.125D, (double)var10, 0.8125D); -- this.renderStandardBlock(var1, var2, var3, var4); -+ this.renderStandardBlock(par1BlockFenceGate, par2, par3, par4); - this.setRenderBounds(0.875D, (double)var9, 0.5625D, 1.0D, (double)var10, 0.8125D); -- this.renderStandardBlock(var1, var2, var3, var4); -+ this.renderStandardBlock(par1BlockFenceGate, par2, par3, par4); - this.setRenderBounds(0.0D, (double)var11, 0.5625D, 0.125D, (double)var12, 0.8125D); -- this.renderStandardBlock(var1, var2, var3, var4); -+ this.renderStandardBlock(par1BlockFenceGate, par2, par3, par4); - this.setRenderBounds(0.875D, (double)var11, 0.5625D, 1.0D, (double)var12, 0.8125D); -- this.renderStandardBlock(var1, var2, var3, var4); -- } else if(var8 == 2) { -+ this.renderStandardBlock(par1BlockFenceGate, par2, par3, par4); -+ } else if (var8 == 2) { - var15 = 0.0F; -- var16 = 2.0F / 16.0F; -- var17 = 14.0F / 16.0F; -+ var16 = 0.125F; -+ var17 = 0.875F; - var18 = 1.0F; -- var19 = 1.0F / 16.0F; -- var20 = 3.0F / 16.0F; -- var21 = 7.0F / 16.0F; -- this.setRenderBounds(0.0D, (double)var9, 1.0D / 16.0D, 0.125D, (double)var12, 0.1875D); -- this.renderStandardBlock(var1, var2, var3, var4); -- this.setRenderBounds(0.875D, (double)var9, 1.0D / 16.0D, 1.0D, (double)var12, 0.1875D); -- this.renderStandardBlock(var1, var2, var3, var4); -+ var19 = 0.0625F; -+ var20 = 0.1875F; -+ var21 = 0.4375F; -+ this.setRenderBounds(0.0D, (double)var9, 0.0625D, 0.125D, (double)var12, 0.1875D); -+ this.renderStandardBlock(par1BlockFenceGate, par2, par3, par4); -+ this.setRenderBounds(0.875D, (double)var9, 0.0625D, 1.0D, (double)var12, 0.1875D); -+ this.renderStandardBlock(par1BlockFenceGate, par2, par3, par4); - this.setRenderBounds(0.0D, (double)var9, 0.1875D, 0.125D, (double)var10, 0.4375D); -- this.renderStandardBlock(var1, var2, var3, var4); -+ this.renderStandardBlock(par1BlockFenceGate, par2, par3, par4); - this.setRenderBounds(0.875D, (double)var9, 0.1875D, 1.0D, (double)var10, 0.4375D); -- this.renderStandardBlock(var1, var2, var3, var4); -+ this.renderStandardBlock(par1BlockFenceGate, par2, par3, par4); - this.setRenderBounds(0.0D, (double)var11, 0.1875D, 0.125D, (double)var12, 0.4375D); -- this.renderStandardBlock(var1, var2, var3, var4); -+ this.renderStandardBlock(par1BlockFenceGate, par2, par3, par4); - this.setRenderBounds(0.875D, (double)var11, 0.1875D, 1.0D, (double)var12, 0.4375D); -- this.renderStandardBlock(var1, var2, var3, var4); -+ this.renderStandardBlock(par1BlockFenceGate, par2, par3, par4); - } -- } else if(var8 != 3 && var8 != 1) { -- var15 = 6.0F / 16.0F; -+ } else if (var8 != 3 && var8 != 1) { -+ var15 = 0.375F; - var16 = 0.5F; -- var17 = 7.0F / 16.0F; -- var18 = 9.0F / 16.0F; -+ var17 = 0.4375F; -+ var18 = 0.5625F; - this.setRenderBounds((double)var15, (double)var9, (double)var17, (double)var16, (double)var12, (double)var18); -- this.renderStandardBlock(var1, var2, var3, var4); -+ this.renderStandardBlock(par1BlockFenceGate, par2, par3, par4); - var15 = 0.5F; -- var16 = 10.0F / 16.0F; -+ var16 = 0.625F; - this.setRenderBounds((double)var15, (double)var9, (double)var17, (double)var16, (double)var12, (double)var18); -- this.renderStandardBlock(var1, var2, var3, var4); -- var15 = 10.0F / 16.0F; -- var16 = 14.0F / 16.0F; -- this.setRenderBounds((double)var15, (double)var9, (double)var17, (double)var16, (double)var10, (double)var18); -- this.renderStandardBlock(var1, var2, var3, var4); -- this.setRenderBounds((double)var15, (double)var11, (double)var17, (double)var16, (double)var12, (double)var18); -- this.renderStandardBlock(var1, var2, var3, var4); -- var15 = 2.0F / 16.0F; -- var16 = 6.0F / 16.0F; -- this.setRenderBounds((double)var15, (double)var9, (double)var17, (double)var16, (double)var10, (double)var18); -- this.renderStandardBlock(var1, var2, var3, var4); -- this.setRenderBounds((double)var15, (double)var11, (double)var17, (double)var16, (double)var12, (double)var18); -- this.renderStandardBlock(var1, var2, var3, var4); -+ this.renderStandardBlock(par1BlockFenceGate, par2, par3, par4); -+ var15 = 0.625F; -+ var16 = 0.875F; -+ this.setRenderBounds((double)var15, (double)var9, (double)var17, (double)var16, (double)var10, (double)var18); -+ this.renderStandardBlock(par1BlockFenceGate, par2, par3, par4); -+ this.setRenderBounds((double)var15, (double)var11, (double)var17, (double)var16, (double)var12, (double)var18); -+ this.renderStandardBlock(par1BlockFenceGate, par2, par3, par4); -+ var15 = 0.125F; -+ var16 = 0.375F; -+ this.setRenderBounds((double)var15, (double)var9, (double)var17, (double)var16, (double)var10, (double)var18); -+ this.renderStandardBlock(par1BlockFenceGate, par2, par3, par4); -+ this.setRenderBounds((double)var15, (double)var11, (double)var17, (double)var16, (double)var12, (double)var18); -+ this.renderStandardBlock(par1BlockFenceGate, par2, par3, par4); - } else { - this.uvRotateTop = 1; -- var15 = 7.0F / 16.0F; -- var16 = 9.0F / 16.0F; -- var17 = 6.0F / 16.0F; -+ var15 = 0.4375F; -+ var16 = 0.5625F; -+ var17 = 0.375F; - var18 = 0.5F; - this.setRenderBounds((double)var15, (double)var9, (double)var17, (double)var16, (double)var12, (double)var18); -- this.renderStandardBlock(var1, var2, var3, var4); -+ this.renderStandardBlock(par1BlockFenceGate, par2, par3, par4); - var17 = 0.5F; -- var18 = 10.0F / 16.0F; -+ var18 = 0.625F; - this.setRenderBounds((double)var15, (double)var9, (double)var17, (double)var16, (double)var12, (double)var18); -- this.renderStandardBlock(var1, var2, var3, var4); -- var17 = 10.0F / 16.0F; -- var18 = 14.0F / 16.0F; -- this.setRenderBounds((double)var15, (double)var9, (double)var17, (double)var16, (double)var10, (double)var18); -- this.renderStandardBlock(var1, var2, var3, var4); -- this.setRenderBounds((double)var15, (double)var11, (double)var17, (double)var16, (double)var12, (double)var18); -- this.renderStandardBlock(var1, var2, var3, var4); -- var17 = 2.0F / 16.0F; -- var18 = 6.0F / 16.0F; -- this.setRenderBounds((double)var15, (double)var9, (double)var17, (double)var16, (double)var10, (double)var18); -- this.renderStandardBlock(var1, var2, var3, var4); -- this.setRenderBounds((double)var15, (double)var11, (double)var17, (double)var16, (double)var12, (double)var18); -- this.renderStandardBlock(var1, var2, var3, var4); -+ this.renderStandardBlock(par1BlockFenceGate, par2, par3, par4); -+ var17 = 0.625F; -+ var18 = 0.875F; -+ this.setRenderBounds((double)var15, (double)var9, (double)var17, (double)var16, (double)var10, (double)var18); -+ this.renderStandardBlock(par1BlockFenceGate, par2, par3, par4); -+ this.setRenderBounds((double)var15, (double)var11, (double)var17, (double)var16, (double)var12, (double)var18); -+ this.renderStandardBlock(par1BlockFenceGate, par2, par3, par4); -+ var17 = 0.125F; -+ var18 = 0.375F; -+ this.setRenderBounds((double)var15, (double)var9, (double)var17, (double)var16, (double)var10, (double)var18); -+ this.renderStandardBlock(par1BlockFenceGate, par2, par3, par4); -+ this.setRenderBounds((double)var15, (double)var11, (double)var17, (double)var16, (double)var12, (double)var18); -+ this.renderStandardBlock(par1BlockFenceGate, par2, par3, par4); - } - - this.renderAllFaces = false; -@@ -5338,15 +6104,16 @@ - return var5; - } - -- private boolean renderBlockHopper(BlockHopper var1, int var2, int var3, int var4) { -+ private boolean renderBlockHopper(BlockHopper par1BlockHopper, int par2, int par3, int par4) { - Tessellator var5 = Tessellator.instance; -- var5.setBrightness(var1.getMixedBrightnessForBlock(this.blockAccess, var2, var3, var4)); -+ var5.setBrightness(par1BlockHopper.getMixedBrightnessForBlock(this.blockAccess, par2, par3, par4)); - float var6 = 1.0F; -- int var7 = var1.colorMultiplier(this.blockAccess, var2, var3, var4); -+ int var7 = par1BlockHopper.colorMultiplier(this.blockAccess, par2, par3, par4); - float var8 = (float)(var7 >> 16 & 255) / 255.0F; - float var9 = (float)(var7 >> 8 & 255) / 255.0F; - float var10 = (float)(var7 & 255) / 255.0F; -- if(EntityRenderer.anaglyphEnable) { -+ -+ if (EntityRenderer.anaglyphEnable) { - float var11 = (var8 * 30.0F + var9 * 59.0F + var10 * 11.0F) / 100.0F; - float var12 = (var8 * 30.0F + var9 * 70.0F) / 100.0F; - float var13 = (var8 * 30.0F + var10 * 70.0F) / 100.0F; -@@ -5356,52 +6123,55 @@ - } - - var5.setColorOpaque_F(var6 * var8, var6 * var9, var6 * var10); -- return this.renderBlockHopperMetadata(var1, var2, var3, var4, this.blockAccess.getBlockMetadata(var2, var3, var4), false); -+ return this.renderBlockHopperMetadata(par1BlockHopper, par2, par3, par4, this.blockAccess.getBlockMetadata(par2, par3, par4), false); - } - -- private boolean renderBlockHopperMetadata(BlockHopper var1, int var2, int var3, int var4, int var5, boolean var6) { -+ private boolean renderBlockHopperMetadata(BlockHopper par1BlockHopper, int par2, int par3, int par4, int par5, boolean par6) { - Tessellator var7 = Tessellator.instance; -- int var8 = BlockHopper.getDirectionFromMetadata(var5); -+ int var8 = BlockHopper.getDirectionFromMetadata(par5); - double var9 = 0.625D; - this.setRenderBounds(0.0D, var9, 0.0D, 1.0D, 1.0D, 1.0D); -- if(var6) { -+ -+ if (par6) { - var7.startDrawingQuads(); - var7.setNormal(0.0F, -1.0F, 0.0F); -- this.renderFaceYNeg(var1, 0.0D, 0.0D, 0.0D, this.getBlockIconFromSideAndMetadata(var1, 0, var5)); -+ this.renderFaceYNeg(par1BlockHopper, 0.0D, 0.0D, 0.0D, this.getBlockIconFromSideAndMetadata(par1BlockHopper, 0, par5)); - var7.draw(); - var7.startDrawingQuads(); - var7.setNormal(0.0F, 1.0F, 0.0F); -- this.renderFaceYPos(var1, 0.0D, 0.0D, 0.0D, this.getBlockIconFromSideAndMetadata(var1, 1, var5)); -+ this.renderFaceYPos(par1BlockHopper, 0.0D, 0.0D, 0.0D, this.getBlockIconFromSideAndMetadata(par1BlockHopper, 1, par5)); - var7.draw(); - var7.startDrawingQuads(); - var7.setNormal(0.0F, 0.0F, -1.0F); -- this.renderFaceZNeg(var1, 0.0D, 0.0D, 0.0D, this.getBlockIconFromSideAndMetadata(var1, 2, var5)); -+ this.renderFaceZNeg(par1BlockHopper, 0.0D, 0.0D, 0.0D, this.getBlockIconFromSideAndMetadata(par1BlockHopper, 2, par5)); - var7.draw(); - var7.startDrawingQuads(); - var7.setNormal(0.0F, 0.0F, 1.0F); -- this.renderFaceZPos(var1, 0.0D, 0.0D, 0.0D, this.getBlockIconFromSideAndMetadata(var1, 3, var5)); -+ this.renderFaceZPos(par1BlockHopper, 0.0D, 0.0D, 0.0D, this.getBlockIconFromSideAndMetadata(par1BlockHopper, 3, par5)); - var7.draw(); - var7.startDrawingQuads(); - var7.setNormal(-1.0F, 0.0F, 0.0F); -- this.renderFaceXNeg(var1, 0.0D, 0.0D, 0.0D, this.getBlockIconFromSideAndMetadata(var1, 4, var5)); -+ this.renderFaceXNeg(par1BlockHopper, 0.0D, 0.0D, 0.0D, this.getBlockIconFromSideAndMetadata(par1BlockHopper, 4, par5)); - var7.draw(); - var7.startDrawingQuads(); - var7.setNormal(1.0F, 0.0F, 0.0F); -- this.renderFaceXPos(var1, 0.0D, 0.0D, 0.0D, this.getBlockIconFromSideAndMetadata(var1, 5, var5)); -+ this.renderFaceXPos(par1BlockHopper, 0.0D, 0.0D, 0.0D, this.getBlockIconFromSideAndMetadata(par1BlockHopper, 5, par5)); - var7.draw(); - } else { -- this.renderStandardBlock(var1, var2, var3, var4); -+ this.renderStandardBlock(par1BlockHopper, par2, par3, par4); - } - - float var13; -- if(!var6) { -- var7.setBrightness(var1.getMixedBrightnessForBlock(this.blockAccess, var2, var3, var4)); -+ -+ if (!par6) { -+ var7.setBrightness(par1BlockHopper.getMixedBrightnessForBlock(this.blockAccess, par2, par3, par4)); - float var11 = 1.0F; -- int var12 = var1.colorMultiplier(this.blockAccess, var2, var3, var4); -+ int var12 = par1BlockHopper.colorMultiplier(this.blockAccess, par2, par3, par4); - var13 = (float)(var12 >> 16 & 255) / 255.0F; - float var14 = (float)(var12 >> 8 & 255) / 255.0F; - float var15 = (float)(var12 & 255) / 255.0F; -- if(EntityRenderer.anaglyphEnable) { -+ -+ if (EntityRenderer.anaglyphEnable) { - float var16 = (var13 * 30.0F + var14 * 59.0F + var15 * 11.0F) / 100.0F; - float var17 = (var13 * 30.0F + var14 * 70.0F) / 100.0F; - float var18 = (var13 * 30.0F + var15 * 70.0F) / 100.0F; -@@ -5415,96 +6185,99 @@ - - Icon var24 = BlockHopper.getHopperIcon("hopper_outside"); - Icon var25 = BlockHopper.getHopperIcon("hopper_inside"); -- var13 = 2.0F / 16.0F; -- if(var6) { -+ var13 = 0.125F; -+ -+ if (par6) { - var7.startDrawingQuads(); - var7.setNormal(1.0F, 0.0F, 0.0F); -- this.renderFaceXPos(var1, (double)(-1.0F + var13), 0.0D, 0.0D, var24); -+ this.renderFaceXPos(par1BlockHopper, (double)(-1.0F + var13), 0.0D, 0.0D, var24); - var7.draw(); - var7.startDrawingQuads(); - var7.setNormal(-1.0F, 0.0F, 0.0F); -- this.renderFaceXNeg(var1, (double)(1.0F - var13), 0.0D, 0.0D, var24); -+ this.renderFaceXNeg(par1BlockHopper, (double)(1.0F - var13), 0.0D, 0.0D, var24); - var7.draw(); - var7.startDrawingQuads(); - var7.setNormal(0.0F, 0.0F, 1.0F); -- this.renderFaceZPos(var1, 0.0D, 0.0D, (double)(-1.0F + var13), var24); -+ this.renderFaceZPos(par1BlockHopper, 0.0D, 0.0D, (double)(-1.0F + var13), var24); - var7.draw(); - var7.startDrawingQuads(); - var7.setNormal(0.0F, 0.0F, -1.0F); -- this.renderFaceZNeg(var1, 0.0D, 0.0D, (double)(1.0F - var13), var24); -+ this.renderFaceZNeg(par1BlockHopper, 0.0D, 0.0D, (double)(1.0F - var13), var24); - var7.draw(); - var7.startDrawingQuads(); - var7.setNormal(0.0F, 1.0F, 0.0F); -- this.renderFaceYPos(var1, 0.0D, -1.0D + var9, 0.0D, var25); -+ this.renderFaceYPos(par1BlockHopper, 0.0D, -1.0D + var9, 0.0D, var25); - var7.draw(); - } else { -- this.renderFaceXPos(var1, (double)((float)var2 - 1.0F + var13), (double)var3, (double)var4, var24); -- this.renderFaceXNeg(var1, (double)((float)var2 + 1.0F - var13), (double)var3, (double)var4, var24); -- this.renderFaceZPos(var1, (double)var2, (double)var3, (double)((float)var4 - 1.0F + var13), var24); -- this.renderFaceZNeg(var1, (double)var2, (double)var3, (double)((float)var4 + 1.0F - var13), var24); -- this.renderFaceYPos(var1, (double)var2, (double)((float)var3 - 1.0F) + var9, (double)var4, var25); -+ this.renderFaceXPos(par1BlockHopper, (double)((float)par2 - 1.0F + var13), (double)par3, (double)par4, var24); -+ this.renderFaceXNeg(par1BlockHopper, (double)((float)par2 + 1.0F - var13), (double)par3, (double)par4, var24); -+ this.renderFaceZPos(par1BlockHopper, (double)par2, (double)par3, (double)((float)par4 - 1.0F + var13), var24); -+ this.renderFaceZNeg(par1BlockHopper, (double)par2, (double)par3, (double)((float)par4 + 1.0F - var13), var24); -+ this.renderFaceYPos(par1BlockHopper, (double)par2, (double)((float)par3 - 1.0F) + var9, (double)par4, var25); - } - - this.setOverrideBlockTexture(var24); - double var26 = 0.25D; - double var27 = 0.25D; - this.setRenderBounds(var26, var27, var26, 1.0D - var26, var9 - 0.002D, 1.0D - var26); -- if(var6) { -+ -+ if (par6) { - var7.startDrawingQuads(); - var7.setNormal(1.0F, 0.0F, 0.0F); -- this.renderFaceXPos(var1, 0.0D, 0.0D, 0.0D, var24); -+ this.renderFaceXPos(par1BlockHopper, 0.0D, 0.0D, 0.0D, var24); - var7.draw(); - var7.startDrawingQuads(); - var7.setNormal(-1.0F, 0.0F, 0.0F); -- this.renderFaceXNeg(var1, 0.0D, 0.0D, 0.0D, var24); -+ this.renderFaceXNeg(par1BlockHopper, 0.0D, 0.0D, 0.0D, var24); - var7.draw(); - var7.startDrawingQuads(); - var7.setNormal(0.0F, 0.0F, 1.0F); -- this.renderFaceZPos(var1, 0.0D, 0.0D, 0.0D, var24); -+ this.renderFaceZPos(par1BlockHopper, 0.0D, 0.0D, 0.0D, var24); - var7.draw(); - var7.startDrawingQuads(); - var7.setNormal(0.0F, 0.0F, -1.0F); -- this.renderFaceZNeg(var1, 0.0D, 0.0D, 0.0D, var24); -+ this.renderFaceZNeg(par1BlockHopper, 0.0D, 0.0D, 0.0D, var24); - var7.draw(); - var7.startDrawingQuads(); - var7.setNormal(0.0F, 1.0F, 0.0F); -- this.renderFaceYPos(var1, 0.0D, 0.0D, 0.0D, var24); -+ this.renderFaceYPos(par1BlockHopper, 0.0D, 0.0D, 0.0D, var24); - var7.draw(); - var7.startDrawingQuads(); - var7.setNormal(0.0F, -1.0F, 0.0F); -- this.renderFaceYNeg(var1, 0.0D, 0.0D, 0.0D, var24); -+ this.renderFaceYNeg(par1BlockHopper, 0.0D, 0.0D, 0.0D, var24); - var7.draw(); - } else { -- this.renderStandardBlock(var1, var2, var3, var4); -+ this.renderStandardBlock(par1BlockHopper, par2, par3, par4); - } - -- if(!var6) { -+ if (!par6) { - double var20 = 0.375D; - double var22 = 0.25D; - this.setOverrideBlockTexture(var24); -- if(var8 == 0) { -+ -+ if (var8 == 0) { - this.setRenderBounds(var20, 0.0D, var20, 1.0D - var20, 0.25D, 1.0D - var20); -- this.renderStandardBlock(var1, var2, var3, var4); -+ this.renderStandardBlock(par1BlockHopper, par2, par3, par4); - } - -- if(var8 == 2) { -+ if (var8 == 2) { - this.setRenderBounds(var20, var27, 0.0D, 1.0D - var20, var27 + var22, var26); -- this.renderStandardBlock(var1, var2, var3, var4); -+ this.renderStandardBlock(par1BlockHopper, par2, par3, par4); - } - -- if(var8 == 3) { -+ if (var8 == 3) { - this.setRenderBounds(var20, var27, 1.0D - var26, 1.0D - var20, var27 + var22, 1.0D); -- this.renderStandardBlock(var1, var2, var3, var4); -+ this.renderStandardBlock(par1BlockHopper, par2, par3, par4); - } - -- if(var8 == 4) { -+ if (var8 == 4) { - this.setRenderBounds(0.0D, var27, var20, var26, var27 + var22, 1.0D - var20); -- this.renderStandardBlock(var1, var2, var3, var4); -+ this.renderStandardBlock(par1BlockHopper, par2, par3, par4); - } - -- if(var8 == 5) { -+ if (var8 == 5) { - this.setRenderBounds(1.0D - var26, var27, var20, 1.0D, var27 + var22, 1.0D - var20); -- this.renderStandardBlock(var1, var2, var3, var4); -+ this.renderStandardBlock(par1BlockHopper, par2, par3, par4); - } - } - -@@ -5512,29 +6285,37 @@ - return true; - } - -- public boolean renderBlockStairs(BlockStairs var1, int var2, int var3, int var4) { -- var1.func_82541_d(this.blockAccess, var2, var3, var4); -- this.setRenderBoundsFromBlock(var1); -- this.renderStandardBlock(var1, var2, var3, var4); -- boolean var5 = var1.func_82542_g(this.blockAccess, var2, var3, var4); -- this.setRenderBoundsFromBlock(var1); -- this.renderStandardBlock(var1, var2, var3, var4); -- if(var5 && var1.func_82544_h(this.blockAccess, var2, var3, var4)) { -- this.setRenderBoundsFromBlock(var1); -- this.renderStandardBlock(var1, var2, var3, var4); -+ /** -+ * Renders a stair block at the given coordinates -+ */ -+ public boolean renderBlockStairs(BlockStairs par1BlockStairs, int par2, int par3, int par4) { -+ par1BlockStairs.func_82541_d(this.blockAccess, par2, par3, par4); -+ this.setRenderBoundsFromBlock(par1BlockStairs); -+ this.renderStandardBlock(par1BlockStairs, par2, par3, par4); -+ boolean var5 = par1BlockStairs.func_82542_g(this.blockAccess, par2, par3, par4); -+ this.setRenderBoundsFromBlock(par1BlockStairs); -+ this.renderStandardBlock(par1BlockStairs, par2, par3, par4); -+ -+ if (var5 && par1BlockStairs.func_82544_h(this.blockAccess, par2, par3, par4)) { -+ this.setRenderBoundsFromBlock(par1BlockStairs); -+ this.renderStandardBlock(par1BlockStairs, par2, par3, par4); - } - - return true; - } - -- public boolean renderBlockDoor(Block var1, int var2, int var3, int var4) { -+ /** -+ * Renders a door block at the given coordinates -+ */ -+ public boolean renderBlockDoor(Block par1Block, int par2, int par3, int par4) { - Tessellator var5 = Tessellator.instance; -- int var6 = this.blockAccess.getBlockMetadata(var2, var3, var4); -- if((var6 & 8) != 0) { -- if(this.blockAccess.getBlockId(var2, var3 - 1, var4) != var1.blockID) { -+ int var6 = this.blockAccess.getBlockMetadata(par2, par3, par4); -+ -+ if ((var6 & 8) != 0) { -+ if (this.blockAccess.getBlockId(par2, par3 - 1, par4) != par1Block.blockID) { - return false; - } -- } else if(this.blockAccess.getBlockId(var2, var3 + 1, var4) != var1.blockID) { -+ } else if (this.blockAccess.getBlockId(par2, par3 + 1, par4) != par1Block.blockID) { - return false; - } - -@@ -5543,747 +6324,833 @@ - float var9 = 1.0F; - float var10 = 0.8F; - float var11 = 0.6F; -- int var12 = var1.getMixedBrightnessForBlock(this.blockAccess, var2, var3, var4); -- var5.setBrightness(this.renderMinY > 0.0D ? var12 : var1.getMixedBrightnessForBlock(this.blockAccess, var2, var3 - 1, var4)); -+ int var12 = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2, par3, par4); -+ var5.setBrightness(this.renderMinY > 0.0D ? var12 : par1Block.getMixedBrightnessForBlock(this.blockAccess, par2, par3 - 1, par4)); - var5.setColorOpaque_F(var8, var8, var8); -- this.renderFaceYNeg(var1, (double)var2, (double)var3, (double)var4, this.getBlockIcon(var1, this.blockAccess, var2, var3, var4, 0)); -+ this.renderFaceYNeg(par1Block, (double)par2, (double)par3, (double)par4, this.getBlockIcon(par1Block, this.blockAccess, par2, par3, par4, 0)); - var7 = true; -- var5.setBrightness(this.renderMaxY < 1.0D ? var12 : var1.getMixedBrightnessForBlock(this.blockAccess, var2, var3 + 1, var4)); -+ var5.setBrightness(this.renderMaxY < 1.0D ? var12 : par1Block.getMixedBrightnessForBlock(this.blockAccess, par2, par3 + 1, par4)); - var5.setColorOpaque_F(var9, var9, var9); -- this.renderFaceYPos(var1, (double)var2, (double)var3, (double)var4, this.getBlockIcon(var1, this.blockAccess, var2, var3, var4, 1)); -- var7 = true; -- var5.setBrightness(this.renderMinZ > 0.0D ? var12 : var1.getMixedBrightnessForBlock(this.blockAccess, var2, var3, var4 - 1)); -- var5.setColorOpaque_F(var10, var10, var10); -- Icon var14 = this.getBlockIcon(var1, this.blockAccess, var2, var3, var4, 2); -- this.renderFaceZNeg(var1, (double)var2, (double)var3, (double)var4, var14); -- var7 = true; -- this.flipTexture = false; -- var5.setBrightness(this.renderMaxZ < 1.0D ? var12 : var1.getMixedBrightnessForBlock(this.blockAccess, var2, var3, var4 + 1)); -- var5.setColorOpaque_F(var10, var10, var10); -- var14 = this.getBlockIcon(var1, this.blockAccess, var2, var3, var4, 3); -- this.renderFaceZPos(var1, (double)var2, (double)var3, (double)var4, var14); -- var7 = true; -- this.flipTexture = false; -- var5.setBrightness(this.renderMinX > 0.0D ? var12 : var1.getMixedBrightnessForBlock(this.blockAccess, var2 - 1, var3, var4)); -- var5.setColorOpaque_F(var11, var11, var11); -- var14 = this.getBlockIcon(var1, this.blockAccess, var2, var3, var4, 4); -- this.renderFaceXNeg(var1, (double)var2, (double)var3, (double)var4, var14); -- var7 = true; -- this.flipTexture = false; -- var5.setBrightness(this.renderMaxX < 1.0D ? var12 : var1.getMixedBrightnessForBlock(this.blockAccess, var2 + 1, var3, var4)); -- var5.setColorOpaque_F(var11, var11, var11); -- var14 = this.getBlockIcon(var1, this.blockAccess, var2, var3, var4, 5); -- this.renderFaceXPos(var1, (double)var2, (double)var3, (double)var4, var14); -+ this.renderFaceYPos(par1Block, (double)par2, (double)par3, (double)par4, this.getBlockIcon(par1Block, this.blockAccess, par2, par3, par4, 1)); -+ var7 = true; -+ var5.setBrightness(this.renderMinZ > 0.0D ? var12 : par1Block.getMixedBrightnessForBlock(this.blockAccess, par2, par3, par4 - 1)); -+ var5.setColorOpaque_F(var10, var10, var10); -+ Icon var14 = this.getBlockIcon(par1Block, this.blockAccess, par2, par3, par4, 2); -+ this.renderFaceZNeg(par1Block, (double)par2, (double)par3, (double)par4, var14); -+ var7 = true; -+ this.flipTexture = false; -+ var5.setBrightness(this.renderMaxZ < 1.0D ? var12 : par1Block.getMixedBrightnessForBlock(this.blockAccess, par2, par3, par4 + 1)); -+ var5.setColorOpaque_F(var10, var10, var10); -+ var14 = this.getBlockIcon(par1Block, this.blockAccess, par2, par3, par4, 3); -+ this.renderFaceZPos(par1Block, (double)par2, (double)par3, (double)par4, var14); -+ var7 = true; -+ this.flipTexture = false; -+ var5.setBrightness(this.renderMinX > 0.0D ? var12 : par1Block.getMixedBrightnessForBlock(this.blockAccess, par2 - 1, par3, par4)); -+ var5.setColorOpaque_F(var11, var11, var11); -+ var14 = this.getBlockIcon(par1Block, this.blockAccess, par2, par3, par4, 4); -+ this.renderFaceXNeg(par1Block, (double)par2, (double)par3, (double)par4, var14); -+ var7 = true; -+ this.flipTexture = false; -+ var5.setBrightness(this.renderMaxX < 1.0D ? var12 : par1Block.getMixedBrightnessForBlock(this.blockAccess, par2 + 1, par3, par4)); -+ var5.setColorOpaque_F(var11, var11, var11); -+ var14 = this.getBlockIcon(par1Block, this.blockAccess, par2, par3, par4, 5); -+ this.renderFaceXPos(par1Block, (double)par2, (double)par3, (double)par4, var14); - var7 = true; - this.flipTexture = false; - return var7; - } - -- public void renderFaceYNeg(Block var1, double var2, double var4, double var6, Icon var8) { -- Tessellator var9 = Tessellator.instance; -- if(this.hasOverrideBlockTexture()) { -- var8 = this.overrideBlockTexture; -- } -- -- double var10 = (double)var8.getInterpolatedU(this.renderMinX * 16.0D); -- double var12 = (double)var8.getInterpolatedU(this.renderMaxX * 16.0D); -- double var14 = (double)var8.getInterpolatedV(this.renderMinZ * 16.0D); -- double var16 = (double)var8.getInterpolatedV(this.renderMaxZ * 16.0D); -- if(this.renderMinX < 0.0D || this.renderMaxX > 1.0D) { -- var10 = (double)var8.getMinU(); -- var12 = (double)var8.getMaxU(); -- } -- -- if(this.renderMinZ < 0.0D || this.renderMaxZ > 1.0D) { -- var14 = (double)var8.getMinV(); -- var16 = (double)var8.getMaxV(); -- } -- -- double var18 = var12; -- double var20 = var10; -- double var22 = var14; -- double var24 = var16; -- if(this.uvRotateBottom == 2) { -- var10 = (double)var8.getInterpolatedU(this.renderMinZ * 16.0D); -- var14 = (double)var8.getInterpolatedV(16.0D - this.renderMaxX * 16.0D); -- var12 = (double)var8.getInterpolatedU(this.renderMaxZ * 16.0D); -- var16 = (double)var8.getInterpolatedV(16.0D - this.renderMinX * 16.0D); -- var22 = var14; -- var24 = var16; -- var18 = var10; -- var20 = var12; -- var14 = var16; -- var16 = var22; -- } else if(this.uvRotateBottom == 1) { -- var10 = (double)var8.getInterpolatedU(16.0D - this.renderMaxZ * 16.0D); -- var14 = (double)var8.getInterpolatedV(this.renderMinX * 16.0D); -- var12 = (double)var8.getInterpolatedU(16.0D - this.renderMinZ * 16.0D); -- var16 = (double)var8.getInterpolatedV(this.renderMaxX * 16.0D); -- var18 = var12; -- var20 = var10; -- var10 = var12; -- var12 = var20; -- var22 = var16; -- var24 = var14; -- } else if(this.uvRotateBottom == 3) { -- var10 = (double)var8.getInterpolatedU(16.0D - this.renderMinX * 16.0D); -- var12 = (double)var8.getInterpolatedU(16.0D - this.renderMaxX * 16.0D); -- var14 = (double)var8.getInterpolatedV(16.0D - this.renderMinZ * 16.0D); -- var16 = (double)var8.getInterpolatedV(16.0D - this.renderMaxZ * 16.0D); -- var18 = var12; -- var20 = var10; -- var22 = var14; -- var24 = var16; -- } -- -- double var26 = var2 + this.renderMinX; -- double var28 = var2 + this.renderMaxX; -- double var30 = var4 + this.renderMinY; -- double var32 = var6 + this.renderMinZ; -- double var34 = var6 + this.renderMaxZ; -- if(this.enableAO) { -- var9.setColorOpaque_F(this.colorRedTopLeft, this.colorGreenTopLeft, this.colorBlueTopLeft); -- var9.setBrightness(this.brightnessTopLeft); -- var9.addVertexWithUV(var26, var30, var34, var20, var24); -- var9.setColorOpaque_F(this.colorRedBottomLeft, this.colorGreenBottomLeft, this.colorBlueBottomLeft); -- var9.setBrightness(this.brightnessBottomLeft); -- var9.addVertexWithUV(var26, var30, var32, var10, var14); -- var9.setColorOpaque_F(this.colorRedBottomRight, this.colorGreenBottomRight, this.colorBlueBottomRight); -- var9.setBrightness(this.brightnessBottomRight); -- var9.addVertexWithUV(var28, var30, var32, var18, var22); -- var9.setColorOpaque_F(this.colorRedTopRight, this.colorGreenTopRight, this.colorBlueTopRight); -- var9.setBrightness(this.brightnessTopRight); -- var9.addVertexWithUV(var28, var30, var34, var12, var16); -- } else { -- var9.addVertexWithUV(var26, var30, var34, var20, var24); -- var9.addVertexWithUV(var26, var30, var32, var10, var14); -- var9.addVertexWithUV(var28, var30, var32, var18, var22); -- var9.addVertexWithUV(var28, var30, var34, var12, var16); -- } -- -- } -- -- public void renderFaceYPos(Block var1, double var2, double var4, double var6, Icon var8) { -- Tessellator var9 = Tessellator.instance; -- if(this.hasOverrideBlockTexture()) { -- var8 = this.overrideBlockTexture; -- } -- -- double var10 = (double)var8.getInterpolatedU(this.renderMinX * 16.0D); -- double var12 = (double)var8.getInterpolatedU(this.renderMaxX * 16.0D); -- double var14 = (double)var8.getInterpolatedV(this.renderMinZ * 16.0D); -- double var16 = (double)var8.getInterpolatedV(this.renderMaxZ * 16.0D); -- if(this.renderMinX < 0.0D || this.renderMaxX > 1.0D) { -- var10 = (double)var8.getMinU(); -- var12 = (double)var8.getMaxU(); -- } -- -- if(this.renderMinZ < 0.0D || this.renderMaxZ > 1.0D) { -- var14 = (double)var8.getMinV(); -- var16 = (double)var8.getMaxV(); -- } -- -- double var18 = var12; -- double var20 = var10; -- double var22 = var14; -- double var24 = var16; -- if(this.uvRotateTop == 1) { -- var10 = (double)var8.getInterpolatedU(this.renderMinZ * 16.0D); -- var14 = (double)var8.getInterpolatedV(16.0D - this.renderMaxX * 16.0D); -- var12 = (double)var8.getInterpolatedU(this.renderMaxZ * 16.0D); -- var16 = (double)var8.getInterpolatedV(16.0D - this.renderMinX * 16.0D); -- var22 = var14; -- var24 = var16; -- var18 = var10; -- var20 = var12; -- var14 = var16; -- var16 = var22; -- } else if(this.uvRotateTop == 2) { -- var10 = (double)var8.getInterpolatedU(16.0D - this.renderMaxZ * 16.0D); -- var14 = (double)var8.getInterpolatedV(this.renderMinX * 16.0D); -- var12 = (double)var8.getInterpolatedU(16.0D - this.renderMinZ * 16.0D); -- var16 = (double)var8.getInterpolatedV(this.renderMaxX * 16.0D); -- var18 = var12; -- var20 = var10; -- var10 = var12; -- var12 = var20; -- var22 = var16; -- var24 = var14; -- } else if(this.uvRotateTop == 3) { -- var10 = (double)var8.getInterpolatedU(16.0D - this.renderMinX * 16.0D); -- var12 = (double)var8.getInterpolatedU(16.0D - this.renderMaxX * 16.0D); -- var14 = (double)var8.getInterpolatedV(16.0D - this.renderMinZ * 16.0D); -- var16 = (double)var8.getInterpolatedV(16.0D - this.renderMaxZ * 16.0D); -- var18 = var12; -- var20 = var10; -- var22 = var14; -- var24 = var16; -- } -- -- double var26 = var2 + this.renderMinX; -- double var28 = var2 + this.renderMaxX; -- double var30 = var4 + this.renderMaxY; -- double var32 = var6 + this.renderMinZ; -- double var34 = var6 + this.renderMaxZ; -- if(this.enableAO) { -- var9.setColorOpaque_F(this.colorRedTopLeft, this.colorGreenTopLeft, this.colorBlueTopLeft); -- var9.setBrightness(this.brightnessTopLeft); -- var9.addVertexWithUV(var28, var30, var34, var12, var16); -- var9.setColorOpaque_F(this.colorRedBottomLeft, this.colorGreenBottomLeft, this.colorBlueBottomLeft); -- var9.setBrightness(this.brightnessBottomLeft); -- var9.addVertexWithUV(var28, var30, var32, var18, var22); -- var9.setColorOpaque_F(this.colorRedBottomRight, this.colorGreenBottomRight, this.colorBlueBottomRight); -- var9.setBrightness(this.brightnessBottomRight); -- var9.addVertexWithUV(var26, var30, var32, var10, var14); -- var9.setColorOpaque_F(this.colorRedTopRight, this.colorGreenTopRight, this.colorBlueTopRight); -- var9.setBrightness(this.brightnessTopRight); -- var9.addVertexWithUV(var26, var30, var34, var20, var24); -- } else { -- var9.addVertexWithUV(var28, var30, var34, var12, var16); -- var9.addVertexWithUV(var28, var30, var32, var18, var22); -- var9.addVertexWithUV(var26, var30, var32, var10, var14); -- var9.addVertexWithUV(var26, var30, var34, var20, var24); -- } -- -- } -- -- public void renderFaceZNeg(Block var1, double var2, double var4, double var6, Icon var8) { -- Tessellator var9 = Tessellator.instance; -- if(this.hasOverrideBlockTexture()) { -- var8 = this.overrideBlockTexture; -- } -- -- double var10 = (double)var8.getInterpolatedU(this.renderMinX * 16.0D); -- double var12 = (double)var8.getInterpolatedU(this.renderMaxX * 16.0D); -- double var14 = (double)var8.getInterpolatedV(16.0D - this.renderMaxY * 16.0D); -- double var16 = (double)var8.getInterpolatedV(16.0D - this.renderMinY * 16.0D); -- double var18; -- if(this.flipTexture) { -- var18 = var10; -- var10 = var12; -- var12 = var18; -- } -- -- if(this.renderMinX < 0.0D || this.renderMaxX > 1.0D) { -- var10 = (double)var8.getMinU(); -- var12 = (double)var8.getMaxU(); -- } -- -- if(this.renderMinY < 0.0D || this.renderMaxY > 1.0D) { -- var14 = (double)var8.getMinV(); -- var16 = (double)var8.getMaxV(); -- } -- -- var18 = var12; -- double var20 = var10; -- double var22 = var14; -- double var24 = var16; -- if(this.uvRotateEast == 2) { -- var10 = (double)var8.getInterpolatedU(this.renderMinY * 16.0D); -- var14 = (double)var8.getInterpolatedV(16.0D - this.renderMinX * 16.0D); -- var12 = (double)var8.getInterpolatedU(this.renderMaxY * 16.0D); -- var16 = (double)var8.getInterpolatedV(16.0D - this.renderMaxX * 16.0D); -- var22 = var14; -- var24 = var16; -- var18 = var10; -- var20 = var12; -- var14 = var16; -- var16 = var22; -- } else if(this.uvRotateEast == 1) { -- var10 = (double)var8.getInterpolatedU(16.0D - this.renderMaxY * 16.0D); -- var14 = (double)var8.getInterpolatedV(this.renderMaxX * 16.0D); -- var12 = (double)var8.getInterpolatedU(16.0D - this.renderMinY * 16.0D); -- var16 = (double)var8.getInterpolatedV(this.renderMinX * 16.0D); -- var18 = var12; -- var20 = var10; -- var10 = var12; -- var12 = var20; -- var22 = var16; -- var24 = var14; -- } else if(this.uvRotateEast == 3) { -- var10 = (double)var8.getInterpolatedU(16.0D - this.renderMinX * 16.0D); -- var12 = (double)var8.getInterpolatedU(16.0D - this.renderMaxX * 16.0D); -- var14 = (double)var8.getInterpolatedV(this.renderMaxY * 16.0D); -- var16 = (double)var8.getInterpolatedV(this.renderMinY * 16.0D); -- var18 = var12; -- var20 = var10; -- var22 = var14; -- var24 = var16; -- } -- -- double var26 = var2 + this.renderMinX; -- double var28 = var2 + this.renderMaxX; -- double var30 = var4 + this.renderMinY; -- double var32 = var4 + this.renderMaxY; -- double var34 = var6 + this.renderMinZ; -- if(this.enableAO) { -- var9.setColorOpaque_F(this.colorRedTopLeft, this.colorGreenTopLeft, this.colorBlueTopLeft); -- var9.setBrightness(this.brightnessTopLeft); -- var9.addVertexWithUV(var26, var32, var34, var18, var22); -- var9.setColorOpaque_F(this.colorRedBottomLeft, this.colorGreenBottomLeft, this.colorBlueBottomLeft); -- var9.setBrightness(this.brightnessBottomLeft); -- var9.addVertexWithUV(var28, var32, var34, var10, var14); -- var9.setColorOpaque_F(this.colorRedBottomRight, this.colorGreenBottomRight, this.colorBlueBottomRight); -- var9.setBrightness(this.brightnessBottomRight); -- var9.addVertexWithUV(var28, var30, var34, var20, var24); -- var9.setColorOpaque_F(this.colorRedTopRight, this.colorGreenTopRight, this.colorBlueTopRight); -- var9.setBrightness(this.brightnessTopRight); -- var9.addVertexWithUV(var26, var30, var34, var12, var16); -- } else { -- var9.addVertexWithUV(var26, var32, var34, var18, var22); -- var9.addVertexWithUV(var28, var32, var34, var10, var14); -- var9.addVertexWithUV(var28, var30, var34, var20, var24); -- var9.addVertexWithUV(var26, var30, var34, var12, var16); -- } -- -- } -- -- public void renderFaceZPos(Block var1, double var2, double var4, double var6, Icon var8) { -- Tessellator var9 = Tessellator.instance; -- if(this.hasOverrideBlockTexture()) { -- var8 = this.overrideBlockTexture; -- } -- -- double var10 = (double)var8.getInterpolatedU(this.renderMinX * 16.0D); -- double var12 = (double)var8.getInterpolatedU(this.renderMaxX * 16.0D); -- double var14 = (double)var8.getInterpolatedV(16.0D - this.renderMaxY * 16.0D); -- double var16 = (double)var8.getInterpolatedV(16.0D - this.renderMinY * 16.0D); -- double var18; -- if(this.flipTexture) { -- var18 = var10; -- var10 = var12; -- var12 = var18; -- } -- -- if(this.renderMinX < 0.0D || this.renderMaxX > 1.0D) { -- var10 = (double)var8.getMinU(); -- var12 = (double)var8.getMaxU(); -- } -- -- if(this.renderMinY < 0.0D || this.renderMaxY > 1.0D) { -- var14 = (double)var8.getMinV(); -- var16 = (double)var8.getMaxV(); -- } -- -- var18 = var12; -- double var20 = var10; -- double var22 = var14; -- double var24 = var16; -- if(this.uvRotateWest == 1) { -- var10 = (double)var8.getInterpolatedU(this.renderMinY * 16.0D); -- var16 = (double)var8.getInterpolatedV(16.0D - this.renderMinX * 16.0D); -- var12 = (double)var8.getInterpolatedU(this.renderMaxY * 16.0D); -- var14 = (double)var8.getInterpolatedV(16.0D - this.renderMaxX * 16.0D); -- var22 = var14; -- var24 = var16; -- var18 = var10; -- var20 = var12; -- var14 = var16; -- var16 = var22; -- } else if(this.uvRotateWest == 2) { -- var10 = (double)var8.getInterpolatedU(16.0D - this.renderMaxY * 16.0D); -- var14 = (double)var8.getInterpolatedV(this.renderMinX * 16.0D); -- var12 = (double)var8.getInterpolatedU(16.0D - this.renderMinY * 16.0D); -- var16 = (double)var8.getInterpolatedV(this.renderMaxX * 16.0D); -- var18 = var12; -- var20 = var10; -- var10 = var12; -- var12 = var20; -- var22 = var16; -- var24 = var14; -- } else if(this.uvRotateWest == 3) { -- var10 = (double)var8.getInterpolatedU(16.0D - this.renderMinX * 16.0D); -- var12 = (double)var8.getInterpolatedU(16.0D - this.renderMaxX * 16.0D); -- var14 = (double)var8.getInterpolatedV(this.renderMaxY * 16.0D); -- var16 = (double)var8.getInterpolatedV(this.renderMinY * 16.0D); -- var18 = var12; -- var20 = var10; -- var22 = var14; -- var24 = var16; -- } -- -- double var26 = var2 + this.renderMinX; -- double var28 = var2 + this.renderMaxX; -- double var30 = var4 + this.renderMinY; -- double var32 = var4 + this.renderMaxY; -- double var34 = var6 + this.renderMaxZ; -- if(this.enableAO) { -- var9.setColorOpaque_F(this.colorRedTopLeft, this.colorGreenTopLeft, this.colorBlueTopLeft); -- var9.setBrightness(this.brightnessTopLeft); -- var9.addVertexWithUV(var26, var32, var34, var10, var14); -- var9.setColorOpaque_F(this.colorRedBottomLeft, this.colorGreenBottomLeft, this.colorBlueBottomLeft); -- var9.setBrightness(this.brightnessBottomLeft); -- var9.addVertexWithUV(var26, var30, var34, var20, var24); -- var9.setColorOpaque_F(this.colorRedBottomRight, this.colorGreenBottomRight, this.colorBlueBottomRight); -- var9.setBrightness(this.brightnessBottomRight); -- var9.addVertexWithUV(var28, var30, var34, var12, var16); -- var9.setColorOpaque_F(this.colorRedTopRight, this.colorGreenTopRight, this.colorBlueTopRight); -- var9.setBrightness(this.brightnessTopRight); -- var9.addVertexWithUV(var28, var32, var34, var18, var22); -- } else { -- var9.addVertexWithUV(var26, var32, var34, var10, var14); -- var9.addVertexWithUV(var26, var30, var34, var20, var24); -- var9.addVertexWithUV(var28, var30, var34, var12, var16); -- var9.addVertexWithUV(var28, var32, var34, var18, var22); -- } -- -- } -- -- public void renderFaceXNeg(Block var1, double var2, double var4, double var6, Icon var8) { -- Tessellator var9 = Tessellator.instance; -- if(this.hasOverrideBlockTexture()) { -- var8 = this.overrideBlockTexture; -- } -- -- double var10 = (double)var8.getInterpolatedU(this.renderMinZ * 16.0D); -- double var12 = (double)var8.getInterpolatedU(this.renderMaxZ * 16.0D); -- double var14 = (double)var8.getInterpolatedV(16.0D - this.renderMaxY * 16.0D); -- double var16 = (double)var8.getInterpolatedV(16.0D - this.renderMinY * 16.0D); -- double var18; -- if(this.flipTexture) { -- var18 = var10; -- var10 = var12; -- var12 = var18; -- } -- -- if(this.renderMinZ < 0.0D || this.renderMaxZ > 1.0D) { -- var10 = (double)var8.getMinU(); -- var12 = (double)var8.getMaxU(); -- } -- -- if(this.renderMinY < 0.0D || this.renderMaxY > 1.0D) { -- var14 = (double)var8.getMinV(); -- var16 = (double)var8.getMaxV(); -- } -- -- var18 = var12; -- double var20 = var10; -- double var22 = var14; -- double var24 = var16; -- if(this.uvRotateNorth == 1) { -- var10 = (double)var8.getInterpolatedU(this.renderMinY * 16.0D); -- var14 = (double)var8.getInterpolatedV(16.0D - this.renderMaxZ * 16.0D); -- var12 = (double)var8.getInterpolatedU(this.renderMaxY * 16.0D); -- var16 = (double)var8.getInterpolatedV(16.0D - this.renderMinZ * 16.0D); -- var22 = var14; -- var24 = var16; -- var18 = var10; -- var20 = var12; -- var14 = var16; -- var16 = var22; -- } else if(this.uvRotateNorth == 2) { -- var10 = (double)var8.getInterpolatedU(16.0D - this.renderMaxY * 16.0D); -- var14 = (double)var8.getInterpolatedV(this.renderMinZ * 16.0D); -- var12 = (double)var8.getInterpolatedU(16.0D - this.renderMinY * 16.0D); -- var16 = (double)var8.getInterpolatedV(this.renderMaxZ * 16.0D); -- var18 = var12; -- var20 = var10; -- var10 = var12; -- var12 = var20; -- var22 = var16; -- var24 = var14; -- } else if(this.uvRotateNorth == 3) { -- var10 = (double)var8.getInterpolatedU(16.0D - this.renderMinZ * 16.0D); -- var12 = (double)var8.getInterpolatedU(16.0D - this.renderMaxZ * 16.0D); -- var14 = (double)var8.getInterpolatedV(this.renderMaxY * 16.0D); -- var16 = (double)var8.getInterpolatedV(this.renderMinY * 16.0D); -- var18 = var12; -- var20 = var10; -- var22 = var14; -- var24 = var16; -- } -- -- double var26 = var2 + this.renderMinX; -- double var28 = var4 + this.renderMinY; -- double var30 = var4 + this.renderMaxY; -- double var32 = var6 + this.renderMinZ; -- double var34 = var6 + this.renderMaxZ; -- if(this.enableAO) { -- var9.setColorOpaque_F(this.colorRedTopLeft, this.colorGreenTopLeft, this.colorBlueTopLeft); -- var9.setBrightness(this.brightnessTopLeft); -- var9.addVertexWithUV(var26, var30, var34, var18, var22); -- var9.setColorOpaque_F(this.colorRedBottomLeft, this.colorGreenBottomLeft, this.colorBlueBottomLeft); -- var9.setBrightness(this.brightnessBottomLeft); -- var9.addVertexWithUV(var26, var30, var32, var10, var14); -- var9.setColorOpaque_F(this.colorRedBottomRight, this.colorGreenBottomRight, this.colorBlueBottomRight); -- var9.setBrightness(this.brightnessBottomRight); -- var9.addVertexWithUV(var26, var28, var32, var20, var24); -- var9.setColorOpaque_F(this.colorRedTopRight, this.colorGreenTopRight, this.colorBlueTopRight); -- var9.setBrightness(this.brightnessTopRight); -- var9.addVertexWithUV(var26, var28, var34, var12, var16); -- } else { -- var9.addVertexWithUV(var26, var30, var34, var18, var22); -- var9.addVertexWithUV(var26, var30, var32, var10, var14); -- var9.addVertexWithUV(var26, var28, var32, var20, var24); -- var9.addVertexWithUV(var26, var28, var34, var12, var16); -- } -- -- } -- -- public void renderFaceXPos(Block var1, double var2, double var4, double var6, Icon var8) { -- Tessellator var9 = Tessellator.instance; -- if(this.hasOverrideBlockTexture()) { -- var8 = this.overrideBlockTexture; -- } -- -- double var10 = (double)var8.getInterpolatedU(this.renderMinZ * 16.0D); -- double var12 = (double)var8.getInterpolatedU(this.renderMaxZ * 16.0D); -- double var14 = (double)var8.getInterpolatedV(16.0D - this.renderMaxY * 16.0D); -- double var16 = (double)var8.getInterpolatedV(16.0D - this.renderMinY * 16.0D); -- double var18; -- if(this.flipTexture) { -- var18 = var10; -- var10 = var12; -- var12 = var18; -- } -- -- if(this.renderMinZ < 0.0D || this.renderMaxZ > 1.0D) { -- var10 = (double)var8.getMinU(); -- var12 = (double)var8.getMaxU(); -- } -- -- if(this.renderMinY < 0.0D || this.renderMaxY > 1.0D) { -- var14 = (double)var8.getMinV(); -- var16 = (double)var8.getMaxV(); -- } -- -- var18 = var12; -- double var20 = var10; -- double var22 = var14; -- double var24 = var16; -- if(this.uvRotateSouth == 2) { -- var10 = (double)var8.getInterpolatedU(this.renderMinY * 16.0D); -- var14 = (double)var8.getInterpolatedV(16.0D - this.renderMinZ * 16.0D); -- var12 = (double)var8.getInterpolatedU(this.renderMaxY * 16.0D); -- var16 = (double)var8.getInterpolatedV(16.0D - this.renderMaxZ * 16.0D); -- var22 = var14; -- var24 = var16; -- var18 = var10; -- var20 = var12; -- var14 = var16; -- var16 = var22; -- } else if(this.uvRotateSouth == 1) { -- var10 = (double)var8.getInterpolatedU(16.0D - this.renderMaxY * 16.0D); -- var14 = (double)var8.getInterpolatedV(this.renderMaxZ * 16.0D); -- var12 = (double)var8.getInterpolatedU(16.0D - this.renderMinY * 16.0D); -- var16 = (double)var8.getInterpolatedV(this.renderMinZ * 16.0D); -- var18 = var12; -- var20 = var10; -- var10 = var12; -- var12 = var20; -- var22 = var16; -- var24 = var14; -- } else if(this.uvRotateSouth == 3) { -- var10 = (double)var8.getInterpolatedU(16.0D - this.renderMinZ * 16.0D); -- var12 = (double)var8.getInterpolatedU(16.0D - this.renderMaxZ * 16.0D); -- var14 = (double)var8.getInterpolatedV(this.renderMaxY * 16.0D); -- var16 = (double)var8.getInterpolatedV(this.renderMinY * 16.0D); -- var18 = var12; -- var20 = var10; -- var22 = var14; -- var24 = var16; -- } -- -- double var26 = var2 + this.renderMaxX; -- double var28 = var4 + this.renderMinY; -- double var30 = var4 + this.renderMaxY; -- double var32 = var6 + this.renderMinZ; -- double var34 = var6 + this.renderMaxZ; -- if(this.enableAO) { -- var9.setColorOpaque_F(this.colorRedTopLeft, this.colorGreenTopLeft, this.colorBlueTopLeft); -- var9.setBrightness(this.brightnessTopLeft); -- var9.addVertexWithUV(var26, var28, var34, var20, var24); -- var9.setColorOpaque_F(this.colorRedBottomLeft, this.colorGreenBottomLeft, this.colorBlueBottomLeft); -- var9.setBrightness(this.brightnessBottomLeft); -- var9.addVertexWithUV(var26, var28, var32, var12, var16); -- var9.setColorOpaque_F(this.colorRedBottomRight, this.colorGreenBottomRight, this.colorBlueBottomRight); -- var9.setBrightness(this.brightnessBottomRight); -- var9.addVertexWithUV(var26, var30, var32, var18, var22); -- var9.setColorOpaque_F(this.colorRedTopRight, this.colorGreenTopRight, this.colorBlueTopRight); -- var9.setBrightness(this.brightnessTopRight); -- var9.addVertexWithUV(var26, var30, var34, var10, var14); -- } else { -- var9.addVertexWithUV(var26, var28, var34, var20, var24); -- var9.addVertexWithUV(var26, var28, var32, var12, var16); -- var9.addVertexWithUV(var26, var30, var32, var18, var22); -- var9.addVertexWithUV(var26, var30, var34, var10, var14); -- } -- -- } -- -- public void renderBlockAsItem(Block var1, int var2, float var3) { -+ /** -+ * Renders the given texture to the bottom face of the block. Args: block, x, y, z, texture -+ */ -+ public void renderFaceYNeg(Block par1Block, double par2, double par4, double par6, Icon par8Icon) { -+ Tessellator var9 = Tessellator.instance; -+ -+ if (this.hasOverrideBlockTexture()) { -+ par8Icon = this.overrideBlockTexture; -+ } -+ -+ par8Icon = CTMUtils.getTile(this, par1Block, (int)par2, (int)par4, (int)par6, 0, par8Icon, var9); -+ -+ if (par8Icon != null) { -+ var9 = TessellatorUtils.getTessellator(var9, par8Icon); -+ double var10 = (double)par8Icon.getInterpolatedU(this.renderMinX * 16.0D); -+ double var12 = (double)par8Icon.getInterpolatedU(this.renderMaxX * 16.0D); -+ double var14 = (double)par8Icon.getInterpolatedV(this.renderMinZ * 16.0D); -+ double var16 = (double)par8Icon.getInterpolatedV(this.renderMaxZ * 16.0D); -+ -+ if (this.renderMinX < 0.0D || this.renderMaxX > 1.0D) { -+ var10 = (double)par8Icon.getMinU(); -+ var12 = (double)par8Icon.getMaxU(); -+ } -+ -+ if (this.renderMinZ < 0.0D || this.renderMaxZ > 1.0D) { -+ var14 = (double)par8Icon.getMinV(); -+ var16 = (double)par8Icon.getMaxV(); -+ } -+ -+ double var18 = var12; -+ double var20 = var10; -+ double var22 = var14; -+ double var24 = var16; -+ -+ if (this.uvRotateBottom == 2) { -+ var10 = (double)par8Icon.getInterpolatedU(this.renderMinZ * 16.0D); -+ var14 = (double)par8Icon.getInterpolatedV(16.0D - this.renderMaxX * 16.0D); -+ var12 = (double)par8Icon.getInterpolatedU(this.renderMaxZ * 16.0D); -+ var16 = (double)par8Icon.getInterpolatedV(16.0D - this.renderMinX * 16.0D); -+ var22 = var14; -+ var24 = var16; -+ var18 = var10; -+ var20 = var12; -+ var14 = var16; -+ var16 = var22; -+ } else if (this.uvRotateBottom == 1) { -+ var10 = (double)par8Icon.getInterpolatedU(16.0D - this.renderMaxZ * 16.0D); -+ var14 = (double)par8Icon.getInterpolatedV(this.renderMinX * 16.0D); -+ var12 = (double)par8Icon.getInterpolatedU(16.0D - this.renderMinZ * 16.0D); -+ var16 = (double)par8Icon.getInterpolatedV(this.renderMaxX * 16.0D); -+ var18 = var12; -+ var20 = var10; -+ var10 = var12; -+ var12 = var20; -+ var22 = var16; -+ var24 = var14; -+ } else if (this.uvRotateBottom == 3) { -+ var10 = (double)par8Icon.getInterpolatedU(16.0D - this.renderMinX * 16.0D); -+ var12 = (double)par8Icon.getInterpolatedU(16.0D - this.renderMaxX * 16.0D); -+ var14 = (double)par8Icon.getInterpolatedV(16.0D - this.renderMinZ * 16.0D); -+ var16 = (double)par8Icon.getInterpolatedV(16.0D - this.renderMaxZ * 16.0D); -+ var18 = var12; -+ var20 = var10; -+ var22 = var14; -+ var24 = var16; -+ } -+ -+ double var26 = par2 + this.renderMinX; -+ double var28 = par2 + this.renderMaxX; -+ double var30 = par4 + this.renderMinY; -+ double var32 = par6 + this.renderMinZ; -+ double var34 = par6 + this.renderMaxZ; -+ -+ if (this.enableAO) { -+ var9.setColorOpaque_F(this.colorRedTopLeft, this.colorGreenTopLeft, this.colorBlueTopLeft); -+ var9.setBrightness(this.brightnessTopLeft); -+ var9.addVertexWithUV(var26, var30, var34, var20, var24); -+ var9.setColorOpaque_F(this.colorRedBottomLeft, this.colorGreenBottomLeft, this.colorBlueBottomLeft); -+ var9.setBrightness(this.brightnessBottomLeft); -+ var9.addVertexWithUV(var26, var30, var32, var10, var14); -+ var9.setColorOpaque_F(this.colorRedBottomRight, this.colorGreenBottomRight, this.colorBlueBottomRight); -+ var9.setBrightness(this.brightnessBottomRight); -+ var9.addVertexWithUV(var28, var30, var32, var18, var22); -+ var9.setColorOpaque_F(this.colorRedTopRight, this.colorGreenTopRight, this.colorBlueTopRight); -+ var9.setBrightness(this.brightnessTopRight); -+ var9.addVertexWithUV(var28, var30, var34, var12, var16); -+ } else { -+ var9.addVertexWithUV(var26, var30, var34, var20, var24); -+ var9.addVertexWithUV(var26, var30, var32, var10, var14); -+ var9.addVertexWithUV(var28, var30, var32, var18, var22); -+ var9.addVertexWithUV(var28, var30, var34, var12, var16); -+ } -+ } -+ } -+ -+ /** -+ * Renders the given texture to the top face of the block. Args: block, x, y, z, texture -+ */ -+ public void renderFaceYPos(Block par1Block, double par2, double par4, double par6, Icon par8Icon) { -+ Tessellator var9 = Tessellator.instance; -+ -+ if (this.hasOverrideBlockTexture()) { -+ par8Icon = this.overrideBlockTexture; -+ } -+ -+ par8Icon = CTMUtils.getTile(this, par1Block, (int)par2, (int)par4, (int)par6, 1, par8Icon, var9); -+ -+ if (par8Icon != null) { -+ var9 = TessellatorUtils.getTessellator(var9, par8Icon); -+ double var10 = (double)par8Icon.getInterpolatedU(this.renderMinX * 16.0D); -+ double var12 = (double)par8Icon.getInterpolatedU(this.renderMaxX * 16.0D); -+ double var14 = (double)par8Icon.getInterpolatedV(this.renderMinZ * 16.0D); -+ double var16 = (double)par8Icon.getInterpolatedV(this.renderMaxZ * 16.0D); -+ -+ if (this.renderMinX < 0.0D || this.renderMaxX > 1.0D) { -+ var10 = (double)par8Icon.getMinU(); -+ var12 = (double)par8Icon.getMaxU(); -+ } -+ -+ if (this.renderMinZ < 0.0D || this.renderMaxZ > 1.0D) { -+ var14 = (double)par8Icon.getMinV(); -+ var16 = (double)par8Icon.getMaxV(); -+ } -+ -+ double var18 = var12; -+ double var20 = var10; -+ double var22 = var14; -+ double var24 = var16; -+ -+ if (this.uvRotateTop == 1) { -+ var10 = (double)par8Icon.getInterpolatedU(this.renderMinZ * 16.0D); -+ var14 = (double)par8Icon.getInterpolatedV(16.0D - this.renderMaxX * 16.0D); -+ var12 = (double)par8Icon.getInterpolatedU(this.renderMaxZ * 16.0D); -+ var16 = (double)par8Icon.getInterpolatedV(16.0D - this.renderMinX * 16.0D); -+ var22 = var14; -+ var24 = var16; -+ var18 = var10; -+ var20 = var12; -+ var14 = var16; -+ var16 = var22; -+ } else if (this.uvRotateTop == 2) { -+ var10 = (double)par8Icon.getInterpolatedU(16.0D - this.renderMaxZ * 16.0D); -+ var14 = (double)par8Icon.getInterpolatedV(this.renderMinX * 16.0D); -+ var12 = (double)par8Icon.getInterpolatedU(16.0D - this.renderMinZ * 16.0D); -+ var16 = (double)par8Icon.getInterpolatedV(this.renderMaxX * 16.0D); -+ var18 = var12; -+ var20 = var10; -+ var10 = var12; -+ var12 = var20; -+ var22 = var16; -+ var24 = var14; -+ } else if (this.uvRotateTop == 3) { -+ var10 = (double)par8Icon.getInterpolatedU(16.0D - this.renderMinX * 16.0D); -+ var12 = (double)par8Icon.getInterpolatedU(16.0D - this.renderMaxX * 16.0D); -+ var14 = (double)par8Icon.getInterpolatedV(16.0D - this.renderMinZ * 16.0D); -+ var16 = (double)par8Icon.getInterpolatedV(16.0D - this.renderMaxZ * 16.0D); -+ var18 = var12; -+ var20 = var10; -+ var22 = var14; -+ var24 = var16; -+ } -+ -+ double var26 = par2 + this.renderMinX; -+ double var28 = par2 + this.renderMaxX; -+ double var30 = par4 + this.renderMaxY; -+ double var32 = par6 + this.renderMinZ; -+ double var34 = par6 + this.renderMaxZ; -+ -+ if (this.enableAO) { -+ var9.setColorOpaque_F(this.colorRedTopLeft, this.colorGreenTopLeft, this.colorBlueTopLeft); -+ var9.setBrightness(this.brightnessTopLeft); -+ var9.addVertexWithUV(var28, var30, var34, var12, var16); -+ var9.setColorOpaque_F(this.colorRedBottomLeft, this.colorGreenBottomLeft, this.colorBlueBottomLeft); -+ var9.setBrightness(this.brightnessBottomLeft); -+ var9.addVertexWithUV(var28, var30, var32, var18, var22); -+ var9.setColorOpaque_F(this.colorRedBottomRight, this.colorGreenBottomRight, this.colorBlueBottomRight); -+ var9.setBrightness(this.brightnessBottomRight); -+ var9.addVertexWithUV(var26, var30, var32, var10, var14); -+ var9.setColorOpaque_F(this.colorRedTopRight, this.colorGreenTopRight, this.colorBlueTopRight); -+ var9.setBrightness(this.brightnessTopRight); -+ var9.addVertexWithUV(var26, var30, var34, var20, var24); -+ } else { -+ var9.addVertexWithUV(var28, var30, var34, var12, var16); -+ var9.addVertexWithUV(var28, var30, var32, var18, var22); -+ var9.addVertexWithUV(var26, var30, var32, var10, var14); -+ var9.addVertexWithUV(var26, var30, var34, var20, var24); -+ } -+ } -+ } -+ -+ /** -+ * Renders the given texture to the north (z-negative) face of the block. Args: block, x, y, z, texture -+ */ -+ public void renderFaceZNeg(Block par1Block, double par2, double par4, double par6, Icon par8Icon) { -+ Tessellator var9 = Tessellator.instance; -+ -+ if (this.hasOverrideBlockTexture()) { -+ par8Icon = this.overrideBlockTexture; -+ } -+ -+ par8Icon = CTMUtils.getTile(this, par1Block, (int)par2, (int)par4, (int)par6, 2, par8Icon, var9); -+ -+ if (par8Icon != null) { -+ var9 = TessellatorUtils.getTessellator(var9, par8Icon); -+ double var10 = (double)par8Icon.getInterpolatedU(this.renderMinX * 16.0D); -+ double var12 = (double)par8Icon.getInterpolatedU(this.renderMaxX * 16.0D); -+ double var14 = (double)par8Icon.getInterpolatedV(16.0D - this.renderMaxY * 16.0D); -+ double var16 = (double)par8Icon.getInterpolatedV(16.0D - this.renderMinY * 16.0D); -+ double var18; -+ -+ if (this.flipTexture) { -+ var18 = var10; -+ var10 = var12; -+ var12 = var18; -+ } -+ -+ if (this.renderMinX < 0.0D || this.renderMaxX > 1.0D) { -+ var10 = (double)par8Icon.getMinU(); -+ var12 = (double)par8Icon.getMaxU(); -+ } -+ -+ if (this.renderMinY < 0.0D || this.renderMaxY > 1.0D) { -+ var14 = (double)par8Icon.getMinV(); -+ var16 = (double)par8Icon.getMaxV(); -+ } -+ -+ var18 = var12; -+ double var20 = var10; -+ double var22 = var14; -+ double var24 = var16; -+ -+ if (this.uvRotateEast == 2) { -+ var10 = (double)par8Icon.getInterpolatedU(this.renderMinY * 16.0D); -+ var14 = (double)par8Icon.getInterpolatedV(16.0D - this.renderMinX * 16.0D); -+ var12 = (double)par8Icon.getInterpolatedU(this.renderMaxY * 16.0D); -+ var16 = (double)par8Icon.getInterpolatedV(16.0D - this.renderMaxX * 16.0D); -+ var22 = var14; -+ var24 = var16; -+ var18 = var10; -+ var20 = var12; -+ var14 = var16; -+ var16 = var22; -+ } else if (this.uvRotateEast == 1) { -+ var10 = (double)par8Icon.getInterpolatedU(16.0D - this.renderMaxY * 16.0D); -+ var14 = (double)par8Icon.getInterpolatedV(this.renderMaxX * 16.0D); -+ var12 = (double)par8Icon.getInterpolatedU(16.0D - this.renderMinY * 16.0D); -+ var16 = (double)par8Icon.getInterpolatedV(this.renderMinX * 16.0D); -+ var18 = var12; -+ var20 = var10; -+ var10 = var12; -+ var12 = var20; -+ var22 = var16; -+ var24 = var14; -+ } else if (this.uvRotateEast == 3) { -+ var10 = (double)par8Icon.getInterpolatedU(16.0D - this.renderMinX * 16.0D); -+ var12 = (double)par8Icon.getInterpolatedU(16.0D - this.renderMaxX * 16.0D); -+ var14 = (double)par8Icon.getInterpolatedV(this.renderMaxY * 16.0D); -+ var16 = (double)par8Icon.getInterpolatedV(this.renderMinY * 16.0D); -+ var18 = var12; -+ var20 = var10; -+ var22 = var14; -+ var24 = var16; -+ } -+ -+ double var26 = par2 + this.renderMinX; -+ double var28 = par2 + this.renderMaxX; -+ double var30 = par4 + this.renderMinY; -+ double var32 = par4 + this.renderMaxY; -+ double var34 = par6 + this.renderMinZ; -+ -+ if (this.enableAO) { -+ var9.setColorOpaque_F(this.colorRedTopLeft, this.colorGreenTopLeft, this.colorBlueTopLeft); -+ var9.setBrightness(this.brightnessTopLeft); -+ var9.addVertexWithUV(var26, var32, var34, var18, var22); -+ var9.setColorOpaque_F(this.colorRedBottomLeft, this.colorGreenBottomLeft, this.colorBlueBottomLeft); -+ var9.setBrightness(this.brightnessBottomLeft); -+ var9.addVertexWithUV(var28, var32, var34, var10, var14); -+ var9.setColorOpaque_F(this.colorRedBottomRight, this.colorGreenBottomRight, this.colorBlueBottomRight); -+ var9.setBrightness(this.brightnessBottomRight); -+ var9.addVertexWithUV(var28, var30, var34, var20, var24); -+ var9.setColorOpaque_F(this.colorRedTopRight, this.colorGreenTopRight, this.colorBlueTopRight); -+ var9.setBrightness(this.brightnessTopRight); -+ var9.addVertexWithUV(var26, var30, var34, var12, var16); -+ } else { -+ var9.addVertexWithUV(var26, var32, var34, var18, var22); -+ var9.addVertexWithUV(var28, var32, var34, var10, var14); -+ var9.addVertexWithUV(var28, var30, var34, var20, var24); -+ var9.addVertexWithUV(var26, var30, var34, var12, var16); -+ } -+ } -+ } -+ -+ /** -+ * Renders the given texture to the south (z-positive) face of the block. Args: block, x, y, z, texture -+ */ -+ public void renderFaceZPos(Block par1Block, double par2, double par4, double par6, Icon par8Icon) { -+ Tessellator var9 = Tessellator.instance; -+ -+ if (this.hasOverrideBlockTexture()) { -+ par8Icon = this.overrideBlockTexture; -+ } -+ -+ par8Icon = CTMUtils.getTile(this, par1Block, (int)par2, (int)par4, (int)par6, 3, par8Icon, var9); -+ -+ if (par8Icon != null) { -+ var9 = TessellatorUtils.getTessellator(var9, par8Icon); -+ double var10 = (double)par8Icon.getInterpolatedU(this.renderMinX * 16.0D); -+ double var12 = (double)par8Icon.getInterpolatedU(this.renderMaxX * 16.0D); -+ double var14 = (double)par8Icon.getInterpolatedV(16.0D - this.renderMaxY * 16.0D); -+ double var16 = (double)par8Icon.getInterpolatedV(16.0D - this.renderMinY * 16.0D); -+ double var18; -+ -+ if (this.flipTexture) { -+ var18 = var10; -+ var10 = var12; -+ var12 = var18; -+ } -+ -+ if (this.renderMinX < 0.0D || this.renderMaxX > 1.0D) { -+ var10 = (double)par8Icon.getMinU(); -+ var12 = (double)par8Icon.getMaxU(); -+ } -+ -+ if (this.renderMinY < 0.0D || this.renderMaxY > 1.0D) { -+ var14 = (double)par8Icon.getMinV(); -+ var16 = (double)par8Icon.getMaxV(); -+ } -+ -+ var18 = var12; -+ double var20 = var10; -+ double var22 = var14; -+ double var24 = var16; -+ -+ if (this.uvRotateWest == 1) { -+ var10 = (double)par8Icon.getInterpolatedU(this.renderMinY * 16.0D); -+ var16 = (double)par8Icon.getInterpolatedV(16.0D - this.renderMinX * 16.0D); -+ var12 = (double)par8Icon.getInterpolatedU(this.renderMaxY * 16.0D); -+ var14 = (double)par8Icon.getInterpolatedV(16.0D - this.renderMaxX * 16.0D); -+ var22 = var14; -+ var24 = var16; -+ var18 = var10; -+ var20 = var12; -+ var14 = var16; -+ var16 = var22; -+ } else if (this.uvRotateWest == 2) { -+ var10 = (double)par8Icon.getInterpolatedU(16.0D - this.renderMaxY * 16.0D); -+ var14 = (double)par8Icon.getInterpolatedV(this.renderMinX * 16.0D); -+ var12 = (double)par8Icon.getInterpolatedU(16.0D - this.renderMinY * 16.0D); -+ var16 = (double)par8Icon.getInterpolatedV(this.renderMaxX * 16.0D); -+ var18 = var12; -+ var20 = var10; -+ var10 = var12; -+ var12 = var20; -+ var22 = var16; -+ var24 = var14; -+ } else if (this.uvRotateWest == 3) { -+ var10 = (double)par8Icon.getInterpolatedU(16.0D - this.renderMinX * 16.0D); -+ var12 = (double)par8Icon.getInterpolatedU(16.0D - this.renderMaxX * 16.0D); -+ var14 = (double)par8Icon.getInterpolatedV(this.renderMaxY * 16.0D); -+ var16 = (double)par8Icon.getInterpolatedV(this.renderMinY * 16.0D); -+ var18 = var12; -+ var20 = var10; -+ var22 = var14; -+ var24 = var16; -+ } -+ -+ double var26 = par2 + this.renderMinX; -+ double var28 = par2 + this.renderMaxX; -+ double var30 = par4 + this.renderMinY; -+ double var32 = par4 + this.renderMaxY; -+ double var34 = par6 + this.renderMaxZ; -+ -+ if (this.enableAO) { -+ var9.setColorOpaque_F(this.colorRedTopLeft, this.colorGreenTopLeft, this.colorBlueTopLeft); -+ var9.setBrightness(this.brightnessTopLeft); -+ var9.addVertexWithUV(var26, var32, var34, var10, var14); -+ var9.setColorOpaque_F(this.colorRedBottomLeft, this.colorGreenBottomLeft, this.colorBlueBottomLeft); -+ var9.setBrightness(this.brightnessBottomLeft); -+ var9.addVertexWithUV(var26, var30, var34, var20, var24); -+ var9.setColorOpaque_F(this.colorRedBottomRight, this.colorGreenBottomRight, this.colorBlueBottomRight); -+ var9.setBrightness(this.brightnessBottomRight); -+ var9.addVertexWithUV(var28, var30, var34, var12, var16); -+ var9.setColorOpaque_F(this.colorRedTopRight, this.colorGreenTopRight, this.colorBlueTopRight); -+ var9.setBrightness(this.brightnessTopRight); -+ var9.addVertexWithUV(var28, var32, var34, var18, var22); -+ } else { -+ var9.addVertexWithUV(var26, var32, var34, var10, var14); -+ var9.addVertexWithUV(var26, var30, var34, var20, var24); -+ var9.addVertexWithUV(var28, var30, var34, var12, var16); -+ var9.addVertexWithUV(var28, var32, var34, var18, var22); -+ } -+ } -+ } -+ -+ /** -+ * Renders the given texture to the west (x-negative) face of the block. Args: block, x, y, z, texture -+ */ -+ public void renderFaceXNeg(Block par1Block, double par2, double par4, double par6, Icon par8Icon) { -+ Tessellator var9 = Tessellator.instance; -+ -+ if (this.hasOverrideBlockTexture()) { -+ par8Icon = this.overrideBlockTexture; -+ } -+ -+ par8Icon = CTMUtils.getTile(this, par1Block, (int)par2, (int)par4, (int)par6, 4, par8Icon, var9); -+ -+ if (par8Icon != null) { -+ var9 = TessellatorUtils.getTessellator(var9, par8Icon); -+ double var10 = (double)par8Icon.getInterpolatedU(this.renderMinZ * 16.0D); -+ double var12 = (double)par8Icon.getInterpolatedU(this.renderMaxZ * 16.0D); -+ double var14 = (double)par8Icon.getInterpolatedV(16.0D - this.renderMaxY * 16.0D); -+ double var16 = (double)par8Icon.getInterpolatedV(16.0D - this.renderMinY * 16.0D); -+ double var18; -+ -+ if (this.flipTexture) { -+ var18 = var10; -+ var10 = var12; -+ var12 = var18; -+ } -+ -+ if (this.renderMinZ < 0.0D || this.renderMaxZ > 1.0D) { -+ var10 = (double)par8Icon.getMinU(); -+ var12 = (double)par8Icon.getMaxU(); -+ } -+ -+ if (this.renderMinY < 0.0D || this.renderMaxY > 1.0D) { -+ var14 = (double)par8Icon.getMinV(); -+ var16 = (double)par8Icon.getMaxV(); -+ } -+ -+ var18 = var12; -+ double var20 = var10; -+ double var22 = var14; -+ double var24 = var16; -+ -+ if (this.uvRotateNorth == 1) { -+ var10 = (double)par8Icon.getInterpolatedU(this.renderMinY * 16.0D); -+ var14 = (double)par8Icon.getInterpolatedV(16.0D - this.renderMaxZ * 16.0D); -+ var12 = (double)par8Icon.getInterpolatedU(this.renderMaxY * 16.0D); -+ var16 = (double)par8Icon.getInterpolatedV(16.0D - this.renderMinZ * 16.0D); -+ var22 = var14; -+ var24 = var16; -+ var18 = var10; -+ var20 = var12; -+ var14 = var16; -+ var16 = var22; -+ } else if (this.uvRotateNorth == 2) { -+ var10 = (double)par8Icon.getInterpolatedU(16.0D - this.renderMaxY * 16.0D); -+ var14 = (double)par8Icon.getInterpolatedV(this.renderMinZ * 16.0D); -+ var12 = (double)par8Icon.getInterpolatedU(16.0D - this.renderMinY * 16.0D); -+ var16 = (double)par8Icon.getInterpolatedV(this.renderMaxZ * 16.0D); -+ var18 = var12; -+ var20 = var10; -+ var10 = var12; -+ var12 = var20; -+ var22 = var16; -+ var24 = var14; -+ } else if (this.uvRotateNorth == 3) { -+ var10 = (double)par8Icon.getInterpolatedU(16.0D - this.renderMinZ * 16.0D); -+ var12 = (double)par8Icon.getInterpolatedU(16.0D - this.renderMaxZ * 16.0D); -+ var14 = (double)par8Icon.getInterpolatedV(this.renderMaxY * 16.0D); -+ var16 = (double)par8Icon.getInterpolatedV(this.renderMinY * 16.0D); -+ var18 = var12; -+ var20 = var10; -+ var22 = var14; -+ var24 = var16; -+ } -+ -+ double var26 = par2 + this.renderMinX; -+ double var28 = par4 + this.renderMinY; -+ double var30 = par4 + this.renderMaxY; -+ double var32 = par6 + this.renderMinZ; -+ double var34 = par6 + this.renderMaxZ; -+ -+ if (this.enableAO) { -+ var9.setColorOpaque_F(this.colorRedTopLeft, this.colorGreenTopLeft, this.colorBlueTopLeft); -+ var9.setBrightness(this.brightnessTopLeft); -+ var9.addVertexWithUV(var26, var30, var34, var18, var22); -+ var9.setColorOpaque_F(this.colorRedBottomLeft, this.colorGreenBottomLeft, this.colorBlueBottomLeft); -+ var9.setBrightness(this.brightnessBottomLeft); -+ var9.addVertexWithUV(var26, var30, var32, var10, var14); -+ var9.setColorOpaque_F(this.colorRedBottomRight, this.colorGreenBottomRight, this.colorBlueBottomRight); -+ var9.setBrightness(this.brightnessBottomRight); -+ var9.addVertexWithUV(var26, var28, var32, var20, var24); -+ var9.setColorOpaque_F(this.colorRedTopRight, this.colorGreenTopRight, this.colorBlueTopRight); -+ var9.setBrightness(this.brightnessTopRight); -+ var9.addVertexWithUV(var26, var28, var34, var12, var16); -+ } else { -+ var9.addVertexWithUV(var26, var30, var34, var18, var22); -+ var9.addVertexWithUV(var26, var30, var32, var10, var14); -+ var9.addVertexWithUV(var26, var28, var32, var20, var24); -+ var9.addVertexWithUV(var26, var28, var34, var12, var16); -+ } -+ } -+ } -+ -+ /** -+ * Renders the given texture to the east (x-positive) face of the block. Args: block, x, y, z, texture -+ */ -+ public void renderFaceXPos(Block par1Block, double par2, double par4, double par6, Icon par8Icon) { -+ Tessellator var9 = Tessellator.instance; -+ -+ if (this.hasOverrideBlockTexture()) { -+ par8Icon = this.overrideBlockTexture; -+ } -+ -+ par8Icon = CTMUtils.getTile(this, par1Block, (int)par2, (int)par4, (int)par6, 5, par8Icon, var9); -+ -+ if (par8Icon != null) { -+ var9 = TessellatorUtils.getTessellator(var9, par8Icon); -+ double var10 = (double)par8Icon.getInterpolatedU(this.renderMinZ * 16.0D); -+ double var12 = (double)par8Icon.getInterpolatedU(this.renderMaxZ * 16.0D); -+ double var14 = (double)par8Icon.getInterpolatedV(16.0D - this.renderMaxY * 16.0D); -+ double var16 = (double)par8Icon.getInterpolatedV(16.0D - this.renderMinY * 16.0D); -+ double var18; -+ -+ if (this.flipTexture) { -+ var18 = var10; -+ var10 = var12; -+ var12 = var18; -+ } -+ -+ if (this.renderMinZ < 0.0D || this.renderMaxZ > 1.0D) { -+ var10 = (double)par8Icon.getMinU(); -+ var12 = (double)par8Icon.getMaxU(); -+ } -+ -+ if (this.renderMinY < 0.0D || this.renderMaxY > 1.0D) { -+ var14 = (double)par8Icon.getMinV(); -+ var16 = (double)par8Icon.getMaxV(); -+ } -+ -+ var18 = var12; -+ double var20 = var10; -+ double var22 = var14; -+ double var24 = var16; -+ -+ if (this.uvRotateSouth == 2) { -+ var10 = (double)par8Icon.getInterpolatedU(this.renderMinY * 16.0D); -+ var14 = (double)par8Icon.getInterpolatedV(16.0D - this.renderMinZ * 16.0D); -+ var12 = (double)par8Icon.getInterpolatedU(this.renderMaxY * 16.0D); -+ var16 = (double)par8Icon.getInterpolatedV(16.0D - this.renderMaxZ * 16.0D); -+ var22 = var14; -+ var24 = var16; -+ var18 = var10; -+ var20 = var12; -+ var14 = var16; -+ var16 = var22; -+ } else if (this.uvRotateSouth == 1) { -+ var10 = (double)par8Icon.getInterpolatedU(16.0D - this.renderMaxY * 16.0D); -+ var14 = (double)par8Icon.getInterpolatedV(this.renderMaxZ * 16.0D); -+ var12 = (double)par8Icon.getInterpolatedU(16.0D - this.renderMinY * 16.0D); -+ var16 = (double)par8Icon.getInterpolatedV(this.renderMinZ * 16.0D); -+ var18 = var12; -+ var20 = var10; -+ var10 = var12; -+ var12 = var20; -+ var22 = var16; -+ var24 = var14; -+ } else if (this.uvRotateSouth == 3) { -+ var10 = (double)par8Icon.getInterpolatedU(16.0D - this.renderMinZ * 16.0D); -+ var12 = (double)par8Icon.getInterpolatedU(16.0D - this.renderMaxZ * 16.0D); -+ var14 = (double)par8Icon.getInterpolatedV(this.renderMaxY * 16.0D); -+ var16 = (double)par8Icon.getInterpolatedV(this.renderMinY * 16.0D); -+ var18 = var12; -+ var20 = var10; -+ var22 = var14; -+ var24 = var16; -+ } -+ -+ double var26 = par2 + this.renderMaxX; -+ double var28 = par4 + this.renderMinY; -+ double var30 = par4 + this.renderMaxY; -+ double var32 = par6 + this.renderMinZ; -+ double var34 = par6 + this.renderMaxZ; -+ -+ if (this.enableAO) { -+ var9.setColorOpaque_F(this.colorRedTopLeft, this.colorGreenTopLeft, this.colorBlueTopLeft); -+ var9.setBrightness(this.brightnessTopLeft); -+ var9.addVertexWithUV(var26, var28, var34, var20, var24); -+ var9.setColorOpaque_F(this.colorRedBottomLeft, this.colorGreenBottomLeft, this.colorBlueBottomLeft); -+ var9.setBrightness(this.brightnessBottomLeft); -+ var9.addVertexWithUV(var26, var28, var32, var12, var16); -+ var9.setColorOpaque_F(this.colorRedBottomRight, this.colorGreenBottomRight, this.colorBlueBottomRight); -+ var9.setBrightness(this.brightnessBottomRight); -+ var9.addVertexWithUV(var26, var30, var32, var18, var22); -+ var9.setColorOpaque_F(this.colorRedTopRight, this.colorGreenTopRight, this.colorBlueTopRight); -+ var9.setBrightness(this.brightnessTopRight); -+ var9.addVertexWithUV(var26, var30, var34, var10, var14); -+ } else { -+ var9.addVertexWithUV(var26, var28, var34, var20, var24); -+ var9.addVertexWithUV(var26, var28, var32, var12, var16); -+ var9.addVertexWithUV(var26, var30, var32, var18, var22); -+ var9.addVertexWithUV(var26, var30, var34, var10, var14); -+ } -+ } -+ } -+ -+ /** -+ * Is called to render the image of a block on an inventory, as a held item, or as a an item on the ground -+ */ -+ public void renderBlockAsItem(Block par1Block, int par2, float par3) { - Tessellator var4 = Tessellator.instance; -- boolean var5 = var1.blockID == Block.grass.blockID; -- if(var1 == Block.dispenser || var1 == Block.dropper || var1 == Block.furnaceIdle) { -- var2 = 3; -+ boolean var5 = par1Block.blockID == Block.grass.blockID; -+ -+ if (par1Block == Block.dispenser || par1Block == Block.dropper || par1Block == Block.furnaceIdle) { -+ par2 = 3; - } - - int var6; - float var7; - float var8; - float var9; -- if(this.useInventoryTint) { -- var6 = var1.getRenderColor(var2); -- if(var5) { -+ -+ if (this.useInventoryTint) { -+ var6 = par1Block.getRenderColor(par2); -+ -+ if (var5) { - var6 = 16777215; - } - - var7 = (float)(var6 >> 16 & 255) / 255.0F; - var8 = (float)(var6 >> 8 & 255) / 255.0F; - var9 = (float)(var6 & 255) / 255.0F; -- GL11.glColor4f(var7 * var3, var8 * var3, var9 * var3, 1.0F); -+ GL11.glColor4f(var7 * par3, var8 * par3, var9 * par3, 1.0F); - } - -- var6 = var1.getRenderType(); -- this.setRenderBoundsFromBlock(var1); -+ var6 = par1Block.getRenderType(); -+ this.setRenderBoundsFromBlock(par1Block); - int var14; -- if(var6 != 0 && var6 != 31 && var6 != 39 && var6 != 16 && var6 != 26) { -- if(var6 == 1) { -- var4.startDrawingQuads(); -- var4.setNormal(0.0F, -1.0F, 0.0F); -- this.drawCrossedSquares(var1, var2, -0.5D, -0.5D, -0.5D, 1.0F); -- var4.draw(); -- } else if(var6 == 19) { -- var4.startDrawingQuads(); -- var4.setNormal(0.0F, -1.0F, 0.0F); -- var1.setBlockBoundsForItemRender(); -- this.renderBlockStemSmall(var1, var2, this.renderMaxY, -0.5D, -0.5D, -0.5D); -- var4.draw(); -- } else if(var6 == 23) { -- var4.startDrawingQuads(); -- var4.setNormal(0.0F, -1.0F, 0.0F); -- var1.setBlockBoundsForItemRender(); -- var4.draw(); -- } else if(var6 == 13) { -- var1.setBlockBoundsForItemRender(); -+ -+ if (var6 != 0 && var6 != 31 && var6 != 39 && var6 != 16 && var6 != 26) { -+ if (var6 == 1) { -+ var4.startDrawingQuads(); -+ var4.setNormal(0.0F, -1.0F, 0.0F); -+ this.drawCrossedSquares(par1Block, par2, -0.5D, -0.5D, -0.5D, 1.0F); -+ var4.draw(); -+ } else if (var6 == 19) { -+ var4.startDrawingQuads(); -+ var4.setNormal(0.0F, -1.0F, 0.0F); -+ par1Block.setBlockBoundsForItemRender(); -+ this.renderBlockStemSmall(par1Block, par2, this.renderMaxY, -0.5D, -0.5D, -0.5D); -+ var4.draw(); -+ } else if (var6 == 23) { -+ var4.startDrawingQuads(); -+ var4.setNormal(0.0F, -1.0F, 0.0F); -+ par1Block.setBlockBoundsForItemRender(); -+ var4.draw(); -+ } else if (var6 == 13) { -+ par1Block.setBlockBoundsForItemRender(); - GL11.glTranslatef(-0.5F, -0.5F, -0.5F); -- var7 = 1.0F / 16.0F; -+ var7 = 0.0625F; - var4.startDrawingQuads(); - var4.setNormal(0.0F, -1.0F, 0.0F); -- this.renderFaceYNeg(var1, 0.0D, 0.0D, 0.0D, this.getBlockIconFromSide(var1, 0)); -+ CTMUtils.start(); -+ this.renderFaceYNeg(par1Block, 0.0D, 0.0D, 0.0D, CTMUtils.getTile(this, par1Block, 0, var4)); - var4.draw(); - var4.startDrawingQuads(); - var4.setNormal(0.0F, 1.0F, 0.0F); -- this.renderFaceYPos(var1, 0.0D, 0.0D, 0.0D, this.getBlockIconFromSide(var1, 1)); -+ CTMUtils.start(); -+ this.renderFaceYPos(par1Block, 0.0D, 0.0D, 0.0D, CTMUtils.getTile(this, par1Block, 1, var4)); - var4.draw(); - var4.startDrawingQuads(); - var4.setNormal(0.0F, 0.0F, -1.0F); - var4.addTranslation(0.0F, 0.0F, var7); -- this.renderFaceZNeg(var1, 0.0D, 0.0D, 0.0D, this.getBlockIconFromSide(var1, 2)); -+ CTMUtils.start(); -+ this.renderFaceZNeg(par1Block, 0.0D, 0.0D, 0.0D, CTMUtils.getTile(this, par1Block, 2, var4)); - var4.addTranslation(0.0F, 0.0F, -var7); - var4.draw(); - var4.startDrawingQuads(); - var4.setNormal(0.0F, 0.0F, 1.0F); - var4.addTranslation(0.0F, 0.0F, -var7); -- this.renderFaceZPos(var1, 0.0D, 0.0D, 0.0D, this.getBlockIconFromSide(var1, 3)); -+ CTMUtils.start(); -+ this.renderFaceZPos(par1Block, 0.0D, 0.0D, 0.0D, CTMUtils.getTile(this, par1Block, 3, var4)); - var4.addTranslation(0.0F, 0.0F, var7); - var4.draw(); - var4.startDrawingQuads(); - var4.setNormal(-1.0F, 0.0F, 0.0F); - var4.addTranslation(var7, 0.0F, 0.0F); -- this.renderFaceXNeg(var1, 0.0D, 0.0D, 0.0D, this.getBlockIconFromSide(var1, 4)); -+ CTMUtils.start(); -+ this.renderFaceXNeg(par1Block, 0.0D, 0.0D, 0.0D, CTMUtils.getTile(this, par1Block, 4, var4)); - var4.addTranslation(-var7, 0.0F, 0.0F); - var4.draw(); - var4.startDrawingQuads(); - var4.setNormal(1.0F, 0.0F, 0.0F); - var4.addTranslation(-var7, 0.0F, 0.0F); -- this.renderFaceXPos(var1, 0.0D, 0.0D, 0.0D, this.getBlockIconFromSide(var1, 5)); -+ CTMUtils.start(); -+ this.renderFaceXPos(par1Block, 0.0D, 0.0D, 0.0D, CTMUtils.getTile(this, par1Block, 5, var4)); - var4.addTranslation(var7, 0.0F, 0.0F); - var4.draw(); - GL11.glTranslatef(0.5F, 0.5F, 0.5F); -- } else if(var6 == 22) { -+ } else if (var6 == 22) { - GL11.glRotatef(90.0F, 0.0F, 1.0F, 0.0F); - GL11.glTranslatef(-0.5F, -0.5F, -0.5F); -- ChestItemRenderHelper.instance.renderChest(var1, var2, var3); -+ ChestItemRenderHelper.instance.renderChest(par1Block, par2, par3); - GL11.glEnable(GL12.GL_RESCALE_NORMAL); -- } else if(var6 == 6) { -- var4.startDrawingQuads(); -- var4.setNormal(0.0F, -1.0F, 0.0F); -- this.renderBlockCropsImpl(var1, var2, -0.5D, -0.5D, -0.5D); -- var4.draw(); -- } else if(var6 == 2) { -- var4.startDrawingQuads(); -- var4.setNormal(0.0F, -1.0F, 0.0F); -- this.renderTorchAtAngle(var1, -0.5D, -0.5D, -0.5D, 0.0D, 0.0D, 0); -- var4.draw(); -- } else if(var6 == 10) { -- for(var14 = 0; var14 < 2; ++var14) { -- if(var14 == 0) { -+ } else if (var6 == 6) { -+ var4.startDrawingQuads(); -+ var4.setNormal(0.0F, -1.0F, 0.0F); -+ this.renderBlockCropsImpl(par1Block, par2, -0.5D, -0.5D, -0.5D); -+ var4.draw(); -+ } else if (var6 == 2) { -+ var4.startDrawingQuads(); -+ var4.setNormal(0.0F, -1.0F, 0.0F); -+ this.renderTorchAtAngle(par1Block, -0.5D, -0.5D, -0.5D, 0.0D, 0.0D, 0); -+ var4.draw(); -+ } else if (var6 == 10) { -+ for (var14 = 0; var14 < 2; ++var14) { -+ if (var14 == 0) { - this.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 0.5D); - } - -- if(var14 == 1) { -+ if (var14 == 1) { - this.setRenderBounds(0.0D, 0.0D, 0.5D, 1.0D, 0.5D, 1.0D); - } - - GL11.glTranslatef(-0.5F, -0.5F, -0.5F); - var4.startDrawingQuads(); - var4.setNormal(0.0F, -1.0F, 0.0F); -- this.renderFaceYNeg(var1, 0.0D, 0.0D, 0.0D, this.getBlockIconFromSide(var1, 0)); -+ CTMUtils.start(); -+ this.renderFaceYNeg(par1Block, 0.0D, 0.0D, 0.0D, CTMUtils.getTile(this, par1Block, 0, var4)); - var4.draw(); - var4.startDrawingQuads(); - var4.setNormal(0.0F, 1.0F, 0.0F); -- this.renderFaceYPos(var1, 0.0D, 0.0D, 0.0D, this.getBlockIconFromSide(var1, 1)); -+ CTMUtils.start(); -+ this.renderFaceYPos(par1Block, 0.0D, 0.0D, 0.0D, CTMUtils.getTile(this, par1Block, 1, var4)); - var4.draw(); - var4.startDrawingQuads(); - var4.setNormal(0.0F, 0.0F, -1.0F); -- this.renderFaceZNeg(var1, 0.0D, 0.0D, 0.0D, this.getBlockIconFromSide(var1, 2)); -+ CTMUtils.start(); -+ this.renderFaceZNeg(par1Block, 0.0D, 0.0D, 0.0D, CTMUtils.getTile(this, par1Block, 2, var4)); - var4.draw(); - var4.startDrawingQuads(); - var4.setNormal(0.0F, 0.0F, 1.0F); -- this.renderFaceZPos(var1, 0.0D, 0.0D, 0.0D, this.getBlockIconFromSide(var1, 3)); -+ CTMUtils.start(); -+ this.renderFaceZPos(par1Block, 0.0D, 0.0D, 0.0D, CTMUtils.getTile(this, par1Block, 3, var4)); - var4.draw(); - var4.startDrawingQuads(); - var4.setNormal(-1.0F, 0.0F, 0.0F); -- this.renderFaceXNeg(var1, 0.0D, 0.0D, 0.0D, this.getBlockIconFromSide(var1, 4)); -+ CTMUtils.start(); -+ this.renderFaceXNeg(par1Block, 0.0D, 0.0D, 0.0D, CTMUtils.getTile(this, par1Block, 4, var4)); - var4.draw(); - var4.startDrawingQuads(); - var4.setNormal(1.0F, 0.0F, 0.0F); -- this.renderFaceXPos(var1, 0.0D, 0.0D, 0.0D, this.getBlockIconFromSide(var1, 5)); -+ CTMUtils.start(); -+ this.renderFaceXPos(par1Block, 0.0D, 0.0D, 0.0D, CTMUtils.getTile(this, par1Block, 5, var4)); - var4.draw(); - GL11.glTranslatef(0.5F, 0.5F, 0.5F); - } -- } else if(var6 == 27) { -+ } else if (var6 == 27) { - var14 = 0; - GL11.glTranslatef(-0.5F, -0.5F, -0.5F); - var4.startDrawingQuads(); - -- for(int var15 = 0; var15 < 8; ++var15) { -+ for (int var15 = 0; var15 < 8; ++var15) { - byte var16 = 0; - byte var17 = 1; -- if(var15 == 0) { -+ -+ if (var15 == 0) { - var16 = 2; - } - -- if(var15 == 1) { -+ if (var15 == 1) { - var16 = 3; - } - -- if(var15 == 2) { -+ if (var15 == 2) { - var16 = 4; - } - -- if(var15 == 3) { -+ if (var15 == 3) { - var16 = 5; - var17 = 2; - } - -- if(var15 == 4) { -+ if (var15 == 4) { - var16 = 6; - var17 = 3; - } - -- if(var15 == 5) { -+ if (var15 == 5) { - var16 = 7; - var17 = 5; - } - -- if(var15 == 6) { -+ if (var15 == 6) { - var16 = 6; - var17 = 2; - } - -- if(var15 == 7) { -+ if (var15 == 7) { - var16 = 3; - } - -@@ -6293,166 +7160,194 @@ - var14 += var17; - this.setRenderBounds((double)(0.5F - var11), (double)var13, (double)(0.5F - var11), (double)(0.5F + var11), (double)var12, (double)(0.5F + var11)); - var4.setNormal(0.0F, -1.0F, 0.0F); -- this.renderFaceYNeg(var1, 0.0D, 0.0D, 0.0D, this.getBlockIconFromSide(var1, 0)); -+ CTMUtils.start(); -+ this.renderFaceYNeg(par1Block, 0.0D, 0.0D, 0.0D, CTMUtils.getTile(this, par1Block, 0, var4)); - var4.setNormal(0.0F, 1.0F, 0.0F); -- this.renderFaceYPos(var1, 0.0D, 0.0D, 0.0D, this.getBlockIconFromSide(var1, 1)); -+ CTMUtils.start(); -+ this.renderFaceYPos(par1Block, 0.0D, 0.0D, 0.0D, CTMUtils.getTile(this, par1Block, 1, var4)); - var4.setNormal(0.0F, 0.0F, -1.0F); -- this.renderFaceZNeg(var1, 0.0D, 0.0D, 0.0D, this.getBlockIconFromSide(var1, 2)); -+ CTMUtils.start(); -+ this.renderFaceZNeg(par1Block, 0.0D, 0.0D, 0.0D, CTMUtils.getTile(this, par1Block, 2, var4)); - var4.setNormal(0.0F, 0.0F, 1.0F); -- this.renderFaceZPos(var1, 0.0D, 0.0D, 0.0D, this.getBlockIconFromSide(var1, 3)); -+ CTMUtils.start(); -+ this.renderFaceZPos(par1Block, 0.0D, 0.0D, 0.0D, CTMUtils.getTile(this, par1Block, 3, var4)); - var4.setNormal(-1.0F, 0.0F, 0.0F); -- this.renderFaceXNeg(var1, 0.0D, 0.0D, 0.0D, this.getBlockIconFromSide(var1, 4)); -+ CTMUtils.start(); -+ this.renderFaceXNeg(par1Block, 0.0D, 0.0D, 0.0D, CTMUtils.getTile(this, par1Block, 4, var4)); - var4.setNormal(1.0F, 0.0F, 0.0F); -- this.renderFaceXPos(var1, 0.0D, 0.0D, 0.0D, this.getBlockIconFromSide(var1, 5)); -+ CTMUtils.start(); -+ this.renderFaceXPos(par1Block, 0.0D, 0.0D, 0.0D, CTMUtils.getTile(this, par1Block, 5, var4)); - } - - var4.draw(); - GL11.glTranslatef(0.5F, 0.5F, 0.5F); - this.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 1.0D); -- } else if(var6 == 11) { -- for(var14 = 0; var14 < 4; ++var14) { -- var8 = 2.0F / 16.0F; -- if(var14 == 0) { -+ } else if (var6 == 11) { -+ for (var14 = 0; var14 < 4; ++var14) { -+ var8 = 0.125F; -+ -+ if (var14 == 0) { - this.setRenderBounds((double)(0.5F - var8), 0.0D, 0.0D, (double)(0.5F + var8), 1.0D, (double)(var8 * 2.0F)); - } - -- if(var14 == 1) { -+ if (var14 == 1) { - this.setRenderBounds((double)(0.5F - var8), 0.0D, (double)(1.0F - var8 * 2.0F), (double)(0.5F + var8), 1.0D, 1.0D); - } - -- var8 = 1.0F / 16.0F; -- if(var14 == 2) { -+ var8 = 0.0625F; -+ -+ if (var14 == 2) { - this.setRenderBounds((double)(0.5F - var8), (double)(1.0F - var8 * 3.0F), (double)(-var8 * 2.0F), (double)(0.5F + var8), (double)(1.0F - var8), (double)(1.0F + var8 * 2.0F)); - } - -- if(var14 == 3) { -+ if (var14 == 3) { - this.setRenderBounds((double)(0.5F - var8), (double)(0.5F - var8 * 3.0F), (double)(-var8 * 2.0F), (double)(0.5F + var8), (double)(0.5F - var8), (double)(1.0F + var8 * 2.0F)); - } - - GL11.glTranslatef(-0.5F, -0.5F, -0.5F); - var4.startDrawingQuads(); - var4.setNormal(0.0F, -1.0F, 0.0F); -- this.renderFaceYNeg(var1, 0.0D, 0.0D, 0.0D, this.getBlockIconFromSide(var1, 0)); -+ CTMUtils.start(); -+ this.renderFaceYNeg(par1Block, 0.0D, 0.0D, 0.0D, CTMUtils.getTile(this, par1Block, 0, var4)); - var4.draw(); - var4.startDrawingQuads(); - var4.setNormal(0.0F, 1.0F, 0.0F); -- this.renderFaceYPos(var1, 0.0D, 0.0D, 0.0D, this.getBlockIconFromSide(var1, 1)); -+ CTMUtils.start(); -+ this.renderFaceYPos(par1Block, 0.0D, 0.0D, 0.0D, CTMUtils.getTile(this, par1Block, 1, var4)); - var4.draw(); - var4.startDrawingQuads(); - var4.setNormal(0.0F, 0.0F, -1.0F); -- this.renderFaceZNeg(var1, 0.0D, 0.0D, 0.0D, this.getBlockIconFromSide(var1, 2)); -+ CTMUtils.start(); -+ this.renderFaceZNeg(par1Block, 0.0D, 0.0D, 0.0D, CTMUtils.getTile(this, par1Block, 2, var4)); - var4.draw(); - var4.startDrawingQuads(); - var4.setNormal(0.0F, 0.0F, 1.0F); -- this.renderFaceZPos(var1, 0.0D, 0.0D, 0.0D, this.getBlockIconFromSide(var1, 3)); -+ CTMUtils.start(); -+ this.renderFaceZPos(par1Block, 0.0D, 0.0D, 0.0D, CTMUtils.getTile(this, par1Block, 3, var4)); - var4.draw(); - var4.startDrawingQuads(); - var4.setNormal(-1.0F, 0.0F, 0.0F); -- this.renderFaceXNeg(var1, 0.0D, 0.0D, 0.0D, this.getBlockIconFromSide(var1, 4)); -+ CTMUtils.start(); -+ this.renderFaceXNeg(par1Block, 0.0D, 0.0D, 0.0D, CTMUtils.getTile(this, par1Block, 4, var4)); - var4.draw(); - var4.startDrawingQuads(); - var4.setNormal(1.0F, 0.0F, 0.0F); -- this.renderFaceXPos(var1, 0.0D, 0.0D, 0.0D, this.getBlockIconFromSide(var1, 5)); -+ CTMUtils.start(); -+ this.renderFaceXPos(par1Block, 0.0D, 0.0D, 0.0D, CTMUtils.getTile(this, par1Block, 5, var4)); - var4.draw(); - GL11.glTranslatef(0.5F, 0.5F, 0.5F); - } - - this.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 1.0D); -- } else if(var6 == 21) { -- for(var14 = 0; var14 < 3; ++var14) { -- var8 = 1.0F / 16.0F; -- if(var14 == 0) { -- this.setRenderBounds((double)(0.5F - var8), (double)0.3F, 0.0D, (double)(0.5F + var8), 1.0D, (double)(var8 * 2.0F)); -- } -- -- if(var14 == 1) { -- this.setRenderBounds((double)(0.5F - var8), (double)0.3F, (double)(1.0F - var8 * 2.0F), (double)(0.5F + var8), 1.0D, 1.0D); -- } -- -- var8 = 1.0F / 16.0F; -- if(var14 == 2) { -+ } else if (var6 == 21) { -+ for (var14 = 0; var14 < 3; ++var14) { -+ var8 = 0.0625F; -+ -+ if (var14 == 0) { -+ this.setRenderBounds((double)(0.5F - var8), 0.30000001192092896D, 0.0D, (double)(0.5F + var8), 1.0D, (double)(var8 * 2.0F)); -+ } -+ -+ if (var14 == 1) { -+ this.setRenderBounds((double)(0.5F - var8), 0.30000001192092896D, (double)(1.0F - var8 * 2.0F), (double)(0.5F + var8), 1.0D, 1.0D); -+ } -+ -+ var8 = 0.0625F; -+ -+ if (var14 == 2) { - this.setRenderBounds((double)(0.5F - var8), 0.5D, 0.0D, (double)(0.5F + var8), (double)(1.0F - var8), 1.0D); - } - - GL11.glTranslatef(-0.5F, -0.5F, -0.5F); - var4.startDrawingQuads(); - var4.setNormal(0.0F, -1.0F, 0.0F); -- this.renderFaceYNeg(var1, 0.0D, 0.0D, 0.0D, this.getBlockIconFromSide(var1, 0)); -+ CTMUtils.start(); -+ this.renderFaceYNeg(par1Block, 0.0D, 0.0D, 0.0D, CTMUtils.getTile(this, par1Block, 0, var4)); - var4.draw(); - var4.startDrawingQuads(); - var4.setNormal(0.0F, 1.0F, 0.0F); -- this.renderFaceYPos(var1, 0.0D, 0.0D, 0.0D, this.getBlockIconFromSide(var1, 1)); -+ CTMUtils.start(); -+ this.renderFaceYPos(par1Block, 0.0D, 0.0D, 0.0D, CTMUtils.getTile(this, par1Block, 1, var4)); - var4.draw(); - var4.startDrawingQuads(); - var4.setNormal(0.0F, 0.0F, -1.0F); -- this.renderFaceZNeg(var1, 0.0D, 0.0D, 0.0D, this.getBlockIconFromSide(var1, 2)); -+ CTMUtils.start(); -+ this.renderFaceZNeg(par1Block, 0.0D, 0.0D, 0.0D, CTMUtils.getTile(this, par1Block, 2, var4)); - var4.draw(); - var4.startDrawingQuads(); - var4.setNormal(0.0F, 0.0F, 1.0F); -- this.renderFaceZPos(var1, 0.0D, 0.0D, 0.0D, this.getBlockIconFromSide(var1, 3)); -+ CTMUtils.start(); -+ this.renderFaceZPos(par1Block, 0.0D, 0.0D, 0.0D, CTMUtils.getTile(this, par1Block, 3, var4)); - var4.draw(); - var4.startDrawingQuads(); - var4.setNormal(-1.0F, 0.0F, 0.0F); -- this.renderFaceXNeg(var1, 0.0D, 0.0D, 0.0D, this.getBlockIconFromSide(var1, 4)); -+ CTMUtils.start(); -+ this.renderFaceXNeg(par1Block, 0.0D, 0.0D, 0.0D, CTMUtils.getTile(this, par1Block, 4, var4)); - var4.draw(); - var4.startDrawingQuads(); - var4.setNormal(1.0F, 0.0F, 0.0F); -- this.renderFaceXPos(var1, 0.0D, 0.0D, 0.0D, this.getBlockIconFromSide(var1, 5)); -+ CTMUtils.start(); -+ this.renderFaceXPos(par1Block, 0.0D, 0.0D, 0.0D, CTMUtils.getTile(this, par1Block, 5, var4)); - var4.draw(); - GL11.glTranslatef(0.5F, 0.5F, 0.5F); - } -- } else if(var6 == 32) { -- for(var14 = 0; var14 < 2; ++var14) { -- if(var14 == 0) { -+ } else if (var6 == 32) { -+ for (var14 = 0; var14 < 2; ++var14) { -+ if (var14 == 0) { - this.setRenderBounds(0.0D, 0.0D, 0.3125D, 1.0D, 0.8125D, 0.6875D); - } - -- if(var14 == 1) { -+ if (var14 == 1) { - this.setRenderBounds(0.25D, 0.0D, 0.25D, 0.75D, 1.0D, 0.75D); - } - - GL11.glTranslatef(-0.5F, -0.5F, -0.5F); - var4.startDrawingQuads(); - var4.setNormal(0.0F, -1.0F, 0.0F); -- this.renderFaceYNeg(var1, 0.0D, 0.0D, 0.0D, this.getBlockIconFromSideAndMetadata(var1, 0, var2)); -+ CTMUtils.start(); -+ this.renderFaceYNeg(par1Block, 0.0D, 0.0D, 0.0D, CTMUtils.getTile(this, par1Block, 0, par2, var4)); - var4.draw(); - var4.startDrawingQuads(); - var4.setNormal(0.0F, 1.0F, 0.0F); -- this.renderFaceYPos(var1, 0.0D, 0.0D, 0.0D, this.getBlockIconFromSideAndMetadata(var1, 1, var2)); -+ CTMUtils.start(); -+ this.renderFaceYPos(par1Block, 0.0D, 0.0D, 0.0D, CTMUtils.getTile(this, par1Block, 1, par2, var4)); - var4.draw(); - var4.startDrawingQuads(); - var4.setNormal(0.0F, 0.0F, -1.0F); -- this.renderFaceZNeg(var1, 0.0D, 0.0D, 0.0D, this.getBlockIconFromSideAndMetadata(var1, 2, var2)); -+ CTMUtils.start(); -+ this.renderFaceZNeg(par1Block, 0.0D, 0.0D, 0.0D, CTMUtils.getTile(this, par1Block, 2, par2, var4)); - var4.draw(); - var4.startDrawingQuads(); - var4.setNormal(0.0F, 0.0F, 1.0F); -- this.renderFaceZPos(var1, 0.0D, 0.0D, 0.0D, this.getBlockIconFromSideAndMetadata(var1, 3, var2)); -+ CTMUtils.start(); -+ this.renderFaceZPos(par1Block, 0.0D, 0.0D, 0.0D, CTMUtils.getTile(this, par1Block, 3, par2, var4)); - var4.draw(); - var4.startDrawingQuads(); - var4.setNormal(-1.0F, 0.0F, 0.0F); -- this.renderFaceXNeg(var1, 0.0D, 0.0D, 0.0D, this.getBlockIconFromSideAndMetadata(var1, 4, var2)); -+ CTMUtils.start(); -+ this.renderFaceXNeg(par1Block, 0.0D, 0.0D, 0.0D, CTMUtils.getTile(this, par1Block, 4, par2, var4)); - var4.draw(); - var4.startDrawingQuads(); - var4.setNormal(1.0F, 0.0F, 0.0F); -- this.renderFaceXPos(var1, 0.0D, 0.0D, 0.0D, this.getBlockIconFromSideAndMetadata(var1, 5, var2)); -+ CTMUtils.start(); -+ this.renderFaceXPos(par1Block, 0.0D, 0.0D, 0.0D, CTMUtils.getTile(this, par1Block, 5, par2, var4)); - var4.draw(); - GL11.glTranslatef(0.5F, 0.5F, 0.5F); - } - - this.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 1.0D); -- } else if(var6 == 35) { -+ } else if (var6 == 35) { - GL11.glTranslatef(-0.5F, -0.5F, -0.5F); -- this.renderBlockAnvilOrient((BlockAnvil)var1, 0, 0, 0, var2 << 2, true); -+ this.renderBlockAnvilOrient((BlockAnvil)par1Block, 0, 0, 0, par2 << 2, true); - GL11.glTranslatef(0.5F, 0.5F, 0.5F); -- } else if(var6 == 34) { -- for(var14 = 0; var14 < 3; ++var14) { -- if(var14 == 0) { -+ } else if (var6 == 34) { -+ for (var14 = 0; var14 < 3; ++var14) { -+ if (var14 == 0) { - this.setRenderBounds(0.125D, 0.0D, 0.125D, 0.875D, 0.1875D, 0.875D); - this.setOverrideBlockTexture(this.getBlockIcon(Block.obsidian)); -- } else if(var14 == 1) { -+ } else if (var14 == 1) { - this.setRenderBounds(0.1875D, 0.1875D, 0.1875D, 0.8125D, 0.875D, 0.8125D); - this.setOverrideBlockTexture(this.getBlockIcon(Block.beacon)); -- } else if(var14 == 2) { -+ } else if (var14 == 2) { - this.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 1.0D); - this.setOverrideBlockTexture(this.getBlockIcon(Block.glass)); - } -@@ -6460,113 +7355,131 @@ - GL11.glTranslatef(-0.5F, -0.5F, -0.5F); - var4.startDrawingQuads(); - var4.setNormal(0.0F, -1.0F, 0.0F); -- this.renderFaceYNeg(var1, 0.0D, 0.0D, 0.0D, this.getBlockIconFromSideAndMetadata(var1, 0, var2)); -+ CTMUtils.start(); -+ this.renderFaceYNeg(par1Block, 0.0D, 0.0D, 0.0D, CTMUtils.getTile(this, par1Block, 0, par2, var4)); - var4.draw(); - var4.startDrawingQuads(); - var4.setNormal(0.0F, 1.0F, 0.0F); -- this.renderFaceYPos(var1, 0.0D, 0.0D, 0.0D, this.getBlockIconFromSideAndMetadata(var1, 1, var2)); -+ CTMUtils.start(); -+ this.renderFaceYPos(par1Block, 0.0D, 0.0D, 0.0D, CTMUtils.getTile(this, par1Block, 1, par2, var4)); - var4.draw(); - var4.startDrawingQuads(); - var4.setNormal(0.0F, 0.0F, -1.0F); -- this.renderFaceZNeg(var1, 0.0D, 0.0D, 0.0D, this.getBlockIconFromSideAndMetadata(var1, 2, var2)); -+ CTMUtils.start(); -+ this.renderFaceZNeg(par1Block, 0.0D, 0.0D, 0.0D, CTMUtils.getTile(this, par1Block, 2, par2, var4)); - var4.draw(); - var4.startDrawingQuads(); - var4.setNormal(0.0F, 0.0F, 1.0F); -- this.renderFaceZPos(var1, 0.0D, 0.0D, 0.0D, this.getBlockIconFromSideAndMetadata(var1, 3, var2)); -+ CTMUtils.start(); -+ this.renderFaceZPos(par1Block, 0.0D, 0.0D, 0.0D, CTMUtils.getTile(this, par1Block, 3, par2, var4)); - var4.draw(); - var4.startDrawingQuads(); - var4.setNormal(-1.0F, 0.0F, 0.0F); -- this.renderFaceXNeg(var1, 0.0D, 0.0D, 0.0D, this.getBlockIconFromSideAndMetadata(var1, 4, var2)); -+ CTMUtils.start(); -+ this.renderFaceXNeg(par1Block, 0.0D, 0.0D, 0.0D, CTMUtils.getTile(this, par1Block, 4, par2, var4)); - var4.draw(); - var4.startDrawingQuads(); - var4.setNormal(1.0F, 0.0F, 0.0F); -- this.renderFaceXPos(var1, 0.0D, 0.0D, 0.0D, this.getBlockIconFromSideAndMetadata(var1, 5, var2)); -+ CTMUtils.start(); -+ this.renderFaceXPos(par1Block, 0.0D, 0.0D, 0.0D, CTMUtils.getTile(this, par1Block, 5, par2, var4)); - var4.draw(); - GL11.glTranslatef(0.5F, 0.5F, 0.5F); - } - - this.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 1.0D); - this.clearOverrideBlockTexture(); -- } else if(var6 == 38) { -+ } else if (var6 == 38) { - GL11.glTranslatef(-0.5F, -0.5F, -0.5F); -- this.renderBlockHopperMetadata((BlockHopper)var1, 0, 0, 0, 0, true); -+ this.renderBlockHopperMetadata((BlockHopper)par1Block, 0, 0, 0, 0, true); - GL11.glTranslatef(0.5F, 0.5F, 0.5F); - } - } else { -- if(var6 == 16) { -- var2 = 1; -+ if (var6 == 16) { -+ par2 = 1; - } - -- var1.setBlockBoundsForItemRender(); -- this.setRenderBoundsFromBlock(var1); -+ par1Block.setBlockBoundsForItemRender(); -+ this.setRenderBoundsFromBlock(par1Block); - GL11.glRotatef(90.0F, 0.0F, 1.0F, 0.0F); - GL11.glTranslatef(-0.5F, -0.5F, -0.5F); - var4.startDrawingQuads(); - var4.setNormal(0.0F, -1.0F, 0.0F); -- this.renderFaceYNeg(var1, 0.0D, 0.0D, 0.0D, this.getBlockIconFromSideAndMetadata(var1, 0, var2)); -+ CTMUtils.start(); -+ this.renderFaceYNeg(par1Block, 0.0D, 0.0D, 0.0D, CTMUtils.getTile(this, par1Block, 0, par2, var4)); - var4.draw(); -- if(var5 && this.useInventoryTint) { -- var14 = var1.getRenderColor(var2); -+ -+ if (var5 && this.useInventoryTint) { -+ var14 = par1Block.getRenderColor(par2); - var8 = (float)(var14 >> 16 & 255) / 255.0F; - var9 = (float)(var14 >> 8 & 255) / 255.0F; - float var10 = (float)(var14 & 255) / 255.0F; -- GL11.glColor4f(var8 * var3, var9 * var3, var10 * var3, 1.0F); -+ GL11.glColor4f(var8 * par3, var9 * par3, var10 * par3, 1.0F); - } - - var4.startDrawingQuads(); - var4.setNormal(0.0F, 1.0F, 0.0F); -- this.renderFaceYPos(var1, 0.0D, 0.0D, 0.0D, this.getBlockIconFromSideAndMetadata(var1, 1, var2)); -+ CTMUtils.start(); -+ this.renderFaceYPos(par1Block, 0.0D, 0.0D, 0.0D, CTMUtils.getTile(this, par1Block, 1, par2, var4)); - var4.draw(); -- if(var5 && this.useInventoryTint) { -- GL11.glColor4f(var3, var3, var3, 1.0F); -+ -+ if (var5 && this.useInventoryTint) { -+ GL11.glColor4f(par3, par3, par3, 1.0F); - } - - var4.startDrawingQuads(); - var4.setNormal(0.0F, 0.0F, -1.0F); -- this.renderFaceZNeg(var1, 0.0D, 0.0D, 0.0D, this.getBlockIconFromSideAndMetadata(var1, 2, var2)); -+ CTMUtils.start(); -+ this.renderFaceZNeg(par1Block, 0.0D, 0.0D, 0.0D, CTMUtils.getTile(this, par1Block, 2, par2, var4)); - var4.draw(); - var4.startDrawingQuads(); - var4.setNormal(0.0F, 0.0F, 1.0F); -- this.renderFaceZPos(var1, 0.0D, 0.0D, 0.0D, this.getBlockIconFromSideAndMetadata(var1, 3, var2)); -+ CTMUtils.start(); -+ this.renderFaceZPos(par1Block, 0.0D, 0.0D, 0.0D, CTMUtils.getTile(this, par1Block, 3, par2, var4)); - var4.draw(); - var4.startDrawingQuads(); - var4.setNormal(-1.0F, 0.0F, 0.0F); -- this.renderFaceXNeg(var1, 0.0D, 0.0D, 0.0D, this.getBlockIconFromSideAndMetadata(var1, 4, var2)); -+ CTMUtils.start(); -+ this.renderFaceXNeg(par1Block, 0.0D, 0.0D, 0.0D, CTMUtils.getTile(this, par1Block, 4, par2, var4)); - var4.draw(); - var4.startDrawingQuads(); - var4.setNormal(1.0F, 0.0F, 0.0F); -- this.renderFaceXPos(var1, 0.0D, 0.0D, 0.0D, this.getBlockIconFromSideAndMetadata(var1, 5, var2)); -+ CTMUtils.start(); -+ this.renderFaceXPos(par1Block, 0.0D, 0.0D, 0.0D, CTMUtils.getTile(this, par1Block, 5, par2, var4)); - var4.draw(); - GL11.glTranslatef(0.5F, 0.5F, 0.5F); - } - -- } -- -- public static boolean renderItemIn3d(int var0) { -- return var0 == 0 ? true : (var0 == 31 ? true : (var0 == 39 ? true : (var0 == 13 ? true : (var0 == 10 ? true : (var0 == 11 ? true : (var0 == 27 ? true : (var0 == 22 ? true : (var0 == 21 ? true : (var0 == 16 ? true : (var0 == 26 ? true : (var0 == 32 ? true : (var0 == 34 ? true : var0 == 35)))))))))))); -- } -- -- public Icon getBlockIcon(Block var1, IBlockAccess var2, int var3, int var4, int var5, int var6) { -- return this.getIconSafe(var1.getBlockTexture(var2, var3, var4, var5, var6)); -- } -- -- public Icon getBlockIconFromSideAndMetadata(Block var1, int var2, int var3) { -- return this.getIconSafe(var1.getIcon(var2, var3)); -- } -- -- public Icon getBlockIconFromSide(Block var1, int var2) { -- return this.getIconSafe(var1.getBlockTextureFromSide(var2)); -- } -- -- public Icon getBlockIcon(Block var1) { -- return this.getIconSafe(var1.getBlockTextureFromSide(1)); -- } -- -- public Icon getIconSafe(Icon var1) { -- if(var1 == null) { -- var1 = ((TextureMap)Minecraft.getMinecraft().getTextureManager().getTexture(TextureMap.locationBlocksTexture)).getAtlasSprite("missingno"); -+ CTMUtils.finish(); -+ } -+ -+ /** -+ * Checks to see if the item's render type indicates that it should be rendered as a regular block or not. -+ */ -+ public static boolean renderItemIn3d(int par0) { -+ return par0 == 0 ? true : (par0 == 31 ? true : (par0 == 39 ? true : (par0 == 13 ? true : (par0 == 10 ? true : (par0 == 11 ? true : (par0 == 27 ? true : (par0 == 22 ? true : (par0 == 21 ? true : (par0 == 16 ? true : (par0 == 26 ? true : (par0 == 32 ? true : (par0 == 34 ? true : par0 == 35)))))))))))); -+ } -+ -+ public Icon getBlockIcon(Block par1Block, IBlockAccess par2IBlockAccess, int par3, int par4, int par5, int par6) { -+ return this.getIconSafe(par1Block.getBlockTexture(par2IBlockAccess, par3, par4, par5, par6)); -+ } -+ -+ public Icon getBlockIconFromSideAndMetadata(Block par1Block, int par2, int par3) { -+ return this.getIconSafe(par1Block.getIcon(par2, par3)); -+ } -+ -+ public Icon getBlockIconFromSide(Block par1Block, int par2) { -+ return this.getIconSafe(par1Block.getBlockTextureFromSide(par2)); -+ } -+ -+ public Icon getBlockIcon(Block par1Block) { -+ return this.getIconSafe(par1Block.getBlockTextureFromSide(1)); -+ } -+ -+ public Icon getIconSafe(Icon par1Icon) { -+ if (par1Icon == null) { -+ par1Icon = ((TextureMap)Minecraft.getMinecraft().getTextureManager().getTexture(TextureMap.locationBlocksTexture)).getAtlasSprite("missingno"); - } - -- return (Icon)var1; -+ return (Icon)par1Icon; - } - } ---- net/minecraft/src/GuiMemoryErrorScreen.java -+++ net/minecraft/src/GuiMemoryErrorScreen.java -@@ -1,25 +1,38 @@ - package net.minecraft.src; - - public class GuiMemoryErrorScreen extends GuiScreen { -- public void initGui() { -- this.i.clear(); -- this.i.add(new GuiSmallButton(0, this.width / 2 - 155, this.height / 4 + 120 + 12, I18n.getString("gui.toMenu"))); -- this.i.add(new GuiSmallButton(1, this.width / 2 - 155 + 160, this.height / 4 + 120 + 12, I18n.getString("menu.quit"))); -+ -+ /** -+ * Adds the buttons (and other controls) to the screen in question. -+ */ -+ public void initGui() { -+ this.buttonList.clear(); -+ this.buttonList.add(new GuiSmallButton(0, this.width / 2 - 155, this.height / 4 + 120 + 12, I18n.getString("gui.toMenu"))); -+ this.buttonList.add(new GuiSmallButton(1, this.width / 2 - 155 + 160, this.height / 4 + 120 + 12, I18n.getString("menu.quit"))); - } - -- protected void actionPerformed(GuiButton var1) { -- if(var1.id == 0) { -- this.mc.displayGuiScreen(new GuiMainMenu()); -- } else if(var1.id == 1) { -+ /** -+ * Fired when a control is clicked. This is the equivalent of ActionListener.actionPerformed(ActionEvent e). -+ */ -+ protected void actionPerformed(GuiButton par1GuiButton) { -+ if (par1GuiButton.id == 0) { -+ // Spout Start -+ this.mc.displayGuiScreen(new org.spoutcraft.client.gui.mainmenu.MainMenu()); -+ // Spout End -+ } else if (par1GuiButton.id == 1) { - this.mc.shutdown(); - } -- -- } -- -- protected void keyTyped(char var1, int var2) { -- } -- -- public void drawScreen(int var1, int var2, float var3) { -+ } -+ -+ /** -+ * Fired when a key is typed. This is the equivalent of KeyListener.keyTyped(KeyEvent e). -+ */ -+ protected void keyTyped(char par1, int par2) {} -+ -+ /** -+ * Draws the screen and all the components in it. -+ */ -+ public void drawScreen(int par1, int par2, float par3) { - this.drawDefaultBackground(); - this.drawCenteredString(this.fontRenderer, "Out of memory!", this.width / 2, this.height / 4 - 60 + 20, 16777215); - this.drawString(this.fontRenderer, "Minecraft has run out of memory.", this.width / 2 - 140, this.height / 4 - 60 + 60 + 0, 10526880); -@@ -31,6 +44,6 @@ - this.drawString(this.fontRenderer, "We\'ve tried to free up enough memory to let you go back to", this.width / 2 - 140, this.height / 4 - 60 + 60 + 81, 10526880); - this.drawString(this.fontRenderer, "the main menu and back to playing, but this may not have worked.", this.width / 2 - 140, this.height / 4 - 60 + 60 + 90, 10526880); - this.drawString(this.fontRenderer, "Please restart the game if you see this message again.", this.width / 2 - 140, this.height / 4 - 60 + 60 + 99, 10526880); -- super.drawScreen(var1, var2, var3); -+ super.drawScreen(par1, par2, par3); - } - } ---- /dev/null -+++ com/prupe/mcpatcher/Config$ModEntry.java -@@ -1,0 +1,12 @@ -+package com.prupe.mcpatcher; -+ -+import com.prupe.mcpatcher.Config$FileEntry; -+import java.util.List; -+ -+class Config$ModEntry { -+ String type; -+ boolean enabled; -+ String path; -+ String className; -+ List files; -+} ---- net/minecraft/src/EntityMagmaCube.java -+++ net/minecraft/src/EntityMagmaCube.java -@@ -1,32 +1,44 @@ - package net.minecraft.src; - - public class EntityMagmaCube extends EntitySlime { -- public EntityMagmaCube(World var1) { -- super(var1); -+ public EntityMagmaCube(World par1World) { -+ super(par1World); - this.isImmuneToFire = true; - } - - protected void applyEntityAttributes() { - super.applyEntityAttributes(); -- this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setAttribute((double)0.2F); -+ this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setAttribute(0.20000000298023224D); - } - -+ /** -+ * Checks if the entity's current position is a valid location to spawn this entity. -+ */ - public boolean getCanSpawnHere() { - return this.worldObj.difficultySetting > 0 && this.worldObj.checkNoEntityCollision(this.boundingBox) && this.worldObj.getCollidingBoundingBoxes(this, this.boundingBox).isEmpty() && !this.worldObj.isAnyLiquid(this.boundingBox); - } - -+ /** -+ * Returns the current armor value as determined by a call to InventoryPlayer.getTotalArmorValue -+ */ - public int getTotalArmorValue() { - return this.getSlimeSize() * 3; - } - -- public int getBrightnessForRender(float var1) { -+ public int getBrightnessForRender(float par1) { - return 15728880; - } - -- public float getBrightness(float var1) { -+ /** -+ * Gets how bright this entity is. -+ */ -+ public float getBrightness(float par1) { - return 1.0F; - } - -+ /** -+ * Returns the name of a particle effect that may be randomly created by EntitySlime.onUpdate() -+ */ - protected String getSlimeParticle() { - return "flame"; - } -@@ -35,29 +47,43 @@ - return new EntityMagmaCube(this.worldObj); - } - -+ /** -+ * Returns the item ID for the item the mob drops on death. -+ */ - protected int getDropItemId() { - return Item.magmaCream.itemID; - } - -- protected void dropFewItems(boolean var1, int var2) { -+ /** -+ * Drop 0-2 items of this living's type. @param par1 - Whether this entity has recently been hit by a player. @param -+ * par2 - Level of Looting used to kill this mob. -+ */ -+ protected void dropFewItems(boolean par1, int par2) { - int var3 = this.getDropItemId(); -- if(var3 > 0 && this.getSlimeSize() > 1) { -- int var4 = this.ab.nextInt(4) - 2; -- if(var2 > 0) { -- var4 += this.ab.nextInt(var2 + 1); -+ -+ if (var3 > 0 && this.getSlimeSize() > 1) { -+ int var4 = this.rand.nextInt(4) - 2; -+ -+ if (par2 > 0) { -+ var4 += this.rand.nextInt(par2 + 1); - } - -- for(int var5 = 0; var5 < var4; ++var5) { -+ for (int var5 = 0; var5 < var4; ++var5) { - this.dropItem(var3, 1); - } - } -- - } - -+ /** -+ * Returns true if the entity is on fire. Used by render to add the fire effect on rendering. -+ */ - public boolean isBurning() { - return false; - } - -+ /** -+ * Gets the amount of time the slime needs to wait between jumps. -+ */ - protected int getJumpDelay() { - return super.getJumpDelay() * 4; - } -@@ -66,38 +92,64 @@ - this.squishAmount *= 0.9F; - } - -+ /** -+ * Causes this entity to do an upwards motion (jumping). -+ */ - protected void jump() { - this.motionY = (double)(0.42F + (float)this.getSlimeSize() * 0.1F); - this.isAirBorne = true; - } - -- protected void fall(float var1) { -- } -+ /** -+ * Called when the mob is falling. Calculates and applies fall damage. -+ */ -+ protected void fall(float par1) {} - -+ /** -+ * Indicates weather the slime is able to damage the player (based upon the slime's size) -+ */ - protected boolean canDamagePlayer() { - return true; - } - -+ /** -+ * Gets the amount of damage dealt to the player when "attacked" by the slime. -+ */ - protected int getAttackStrength() { - return super.getAttackStrength() + 2; - } - -+ /** -+ * Returns the sound this mob makes when it is hurt. -+ */ - protected String getHurtSound() { - return "mob.slime." + (this.getSlimeSize() > 1 ? "big" : "small"); - } - -+ /** -+ * Returns the sound this mob makes on death. -+ */ - protected String getDeathSound() { - return "mob.slime." + (this.getSlimeSize() > 1 ? "big" : "small"); - } - -+ /** -+ * Returns the name of the sound played when the slime jumps. -+ */ - protected String getJumpSound() { - return this.getSlimeSize() > 1 ? "mob.magmacube.big" : "mob.magmacube.small"; - } - -+ /** -+ * Whether or not the current entity is in lava -+ */ - public boolean handleLavaMovement() { - return false; - } - -+ /** -+ * Returns true if the slime makes a sound when it lands after a jump (based upon the slime's size) -+ */ - protected boolean makesSoundOnLand() { - return true; - } ---- /dev/null -+++ org/spoutcraft/client/packet/PacketAirTime.java -@@ -1,0 +1,65 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.client.packet; -+ -+import java.io.IOException; -+ -+import org.spoutcraft.api.io.SpoutInputStream; -+import org.spoutcraft.api.io.SpoutOutputStream; -+import org.spoutcraft.client.SpoutClient; -+ -+public class PacketAirTime implements SpoutPacket { -+ public int airTime; -+ public int air; -+ -+ public PacketAirTime() { -+ } -+ -+ public PacketAirTime(int maxTime, int time) { -+ this.airTime = maxTime; -+ this.air = time; -+ } -+ -+ public void readData(SpoutInputStream input) throws IOException { -+ this.airTime = input.readInt(); -+ this.air = input.readInt(); -+ } -+ -+ public void writeData(SpoutOutputStream output) throws IOException { -+ output.writeInt(this.airTime); -+ output.writeInt(this.air); -+ } -+ -+ public void run(int id) { -+ SpoutClient.getInstance().getActivePlayer().setMaximumAir(airTime); -+ SpoutClient.getInstance().getActivePlayer().setRemainingAir(air); -+ } -+ -+ public PacketType getPacketType() { -+ return PacketType.PacketAirTime; -+ } -+ -+ public int getVersion() { -+ return 0; -+ } -+ -+ public void failure(int playerId) { -+ } -+} ---- net/minecraft/src/ThreadStatSyncherSend.java -+++ net/minecraft/src/ThreadStatSyncherSend.java -@@ -3,22 +3,22 @@ - import java.util.Map; - - class ThreadStatSyncherSend extends Thread { -- final Map a; -+ final Map field_77483_a; -+ - final StatsSyncher syncher; - -- ThreadStatSyncherSend(StatsSyncher var1, Map var2) { -- this.syncher = var1; -- this.a = var2; -+ ThreadStatSyncherSend(StatsSyncher par1StatsSyncher, Map par2Map) { -+ this.syncher = par1StatsSyncher; -+ this.field_77483_a = par2Map; - } - - public void run() { - try { -- StatsSyncher.func_77414_a(this.syncher, this.a, StatsSyncher.getUnsentDataFile(this.syncher), StatsSyncher.getUnsentTempFile(this.syncher), StatsSyncher.getUnsentOldFile(this.syncher)); -+ StatsSyncher.func_77414_a(this.syncher, this.field_77483_a, StatsSyncher.getUnsentDataFile(this.syncher), StatsSyncher.getUnsentTempFile(this.syncher), StatsSyncher.getUnsentOldFile(this.syncher)); - } catch (Exception var5) { - var5.printStackTrace(); - } finally { - StatsSyncher.setBusy(this.syncher, false); - } -- - } - } ---- net/minecraft/src/ItemSign.java -+++ net/minecraft/src/ItemSign.java -@@ -1,56 +1,61 @@ - package net.minecraft.src; - - public class ItemSign extends Item { -- public ItemSign(int var1) { -- super(var1); -+ public ItemSign(int par1) { -+ super(par1); - this.maxStackSize = 16; - this.setCreativeTab(CreativeTabs.tabDecorations); - } - -- public boolean onItemUse(ItemStack var1, EntityPlayer var2, World var3, int var4, int var5, int var6, int var7, float var8, float var9, float var10) { -- if(var7 == 0) { -+ /** -+ * Callback for item usage. If the item does something special on right clicking, he will have one of those. Return -+ * True if something happen and false if it don't. This is for ITEMS, not BLOCKS -+ */ -+ public boolean onItemUse(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, World par3World, int par4, int par5, int par6, int par7, float par8, float par9, float par10) { -+ if (par7 == 0) { - return false; -- } else if(!var3.getBlockMaterial(var4, var5, var6).isSolid()) { -+ } else if (!par3World.getBlockMaterial(par4, par5, par6).isSolid()) { - return false; - } else { -- if(var7 == 1) { -- ++var5; -- } -- -- if(var7 == 2) { -- --var6; -- } -- -- if(var7 == 3) { -- ++var6; -- } -- -- if(var7 == 4) { -- --var4; -- } -- -- if(var7 == 5) { -- ++var4; -- } -- -- if(!var2.canPlayerEdit(var4, var5, var6, var7, var1)) { -- return false; -- } else if(!Block.signPost.canPlaceBlockAt(var3, var4, var5, var6)) { -- return false; -- } else if(var3.isRemote) { -+ if (par7 == 1) { -+ ++par5; -+ } -+ -+ if (par7 == 2) { -+ --par6; -+ } -+ -+ if (par7 == 3) { -+ ++par6; -+ } -+ -+ if (par7 == 4) { -+ --par4; -+ } -+ -+ if (par7 == 5) { -+ ++par4; -+ } -+ -+ if (!par2EntityPlayer.canPlayerEdit(par4, par5, par6, par7, par1ItemStack)) { -+ return false; -+ } else if (!Block.signPost.canPlaceBlockAt(par3World, par4, par5, par6)) { -+ return false; -+ } else if (par3World.isRemote) { - return true; - } else { -- if(var7 == 1) { -- int var11 = MathHelper.floor_double((double)((var2.rotationYaw + 180.0F) * 16.0F / 360.0F) + 0.5D) & 15; -- var3.setBlock(var4, var5, var6, Block.signPost.blockID, var11, 3); -+ if (par7 == 1) { -+ int var11 = MathHelper.floor_double((double)((par2EntityPlayer.rotationYaw + 180.0F) * 16.0F / 360.0F) + 0.5D) & 15; -+ par3World.setBlock(par4, par5, par6, Block.signPost.blockID, var11, 3); - } else { -- var3.setBlock(var4, var5, var6, Block.signWall.blockID, var7, 3); -+ par3World.setBlock(par4, par5, par6, Block.signWall.blockID, par7, 3); - } - -- --var1.stackSize; -- TileEntitySign var12 = (TileEntitySign)var3.getBlockTileEntity(var4, var5, var6); -- if(var12 != null) { -- var2.displayGUIEditSign(var12); -+ --par1ItemStack.stackSize; -+ TileEntitySign var12 = (TileEntitySign)par3World.getBlockTileEntity(par4, par5, par6); -+ -+ if (var12 != null) { -+ par2EntityPlayer.displayGUIEditSign(var12); - } - - return true; ---- /dev/null -+++ org/spoutcraft/client/gui/settings/controls/InvertMouseButton.java -@@ -1,0 +1,38 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.client.gui.settings.controls; -+ -+import net.minecraft.src.Minecraft; -+ -+import org.spoutcraft.api.gui.GenericCheckBox; -+ -+public class InvertMouseButton extends GenericCheckBox { -+ public InvertMouseButton() { -+ super("Invert Mouse"); -+ setChecked(Minecraft.getMinecraft().gameSettings.invertMouse); -+ setTooltip("Invert Mouse\nInverts the mouse movement."); -+ } -+ -+ @Override -+ public void onButtonClick() { -+ Minecraft.getMinecraft().gameSettings.invertMouse = !Minecraft.getMinecraft().gameSettings.invertMouse; -+ Minecraft.getMinecraft().gameSettings.saveOptions(); -+ } -+} ---- net/minecraft/src/CallableParticleScreenName.java -+++ net/minecraft/src/CallableParticleScreenName.java -@@ -5,8 +5,8 @@ - class CallableParticleScreenName implements Callable { - final Minecraft theMinecraft; - -- CallableParticleScreenName(Minecraft var1) { -- this.theMinecraft = var1; -+ CallableParticleScreenName(Minecraft par1Minecraft) { -+ this.theMinecraft = par1Minecraft; - } - - public String callParticleScreenName() { ---- net/minecraft/src/BlockPoweredOre.java -+++ net/minecraft/src/BlockPoweredOre.java -@@ -1,16 +1,24 @@ - package net.minecraft.src; - - public class BlockPoweredOre extends BlockOreStorage { -- public BlockPoweredOre(int var1) { -- super(var1); -+ public BlockPoweredOre(int par1) { -+ super(par1); - this.setCreativeTab(CreativeTabs.tabRedstone); - } - -+ /** -+ * Can this block provide power. Only wire currently seems to have this change based on its state. -+ */ - public boolean canProvidePower() { - return true; - } - -- public int isProvidingWeakPower(IBlockAccess var1, int var2, int var3, int var4, int var5) { -+ /** -+ * Returns true if the block is emitting indirect/weak redstone power on the specified side. If isBlockNormalCube -+ * returns true, standard redstone propagation rules will apply instead and this will not be called. Args: World, X, Y, -+ * Z, side. Note that the side is reversed - eg it is 1 (up) when checking the bottom of the block. -+ */ -+ public int isProvidingWeakPower(IBlockAccess par1IBlockAccess, int par2, int par3, int par4, int par5) { - return 15; - } - } ---- net/minecraft/src/Packet32EntityLook.java -+++ net/minecraft/src/Packet32EntityLook.java -@@ -9,25 +9,34 @@ - this.rotating = true; - } - -- public Packet32EntityLook(int var1, byte var2, byte var3) { -- super(var1); -- this.yaw = var2; -- this.pitch = var3; -+ public Packet32EntityLook(int par1, byte par2, byte par3) { -+ super(par1); -+ this.yaw = par2; -+ this.pitch = par3; - this.rotating = true; - } - -- public void readPacketData(DataInput var1) throws IOException { -- super.readPacketData(var1); -- this.yaw = var1.readByte(); -- this.pitch = var1.readByte(); -- } -- -- public void writePacketData(DataOutput var1) throws IOException { -- super.writePacketData(var1); -- var1.writeByte(this.yaw); -- var1.writeByte(this.pitch); -- } -- -+ /** -+ * Abstract. Reads the raw packet data from the data stream. -+ */ -+ public void readPacketData(DataInput par1DataInput) throws IOException { -+ super.readPacketData(par1DataInput); -+ this.yaw = par1DataInput.readByte(); -+ this.pitch = par1DataInput.readByte(); -+ } -+ -+ /** -+ * Abstract. Writes the raw packet data to the data stream. -+ */ -+ public void writePacketData(DataOutput par1DataOutput) throws IOException { -+ super.writePacketData(par1DataOutput); -+ par1DataOutput.writeByte(this.yaw); -+ par1DataOutput.writeByte(this.pitch); -+ } -+ -+ /** -+ * Abstract. Return the size of the packet (not counting the header). -+ */ - public int getPacketSize() { - return 6; - } ---- /dev/null -+++ org/spoutcraft/client/player/accessories/Bracelet.java -@@ -1,0 +1,74 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.client.player.accessories; -+ -+import net.minecraft.src.EntityPlayer; -+import net.minecraft.src.ModelBiped; -+import net.minecraft.src.ModelRenderer; -+ -+public class Bracelet extends Accessory{ -+ public ModelRenderer bipedFrontBracelet; -+ public ModelRenderer bipedLeftBracelet; -+ public ModelRenderer bipedBackBracelet; -+ public ModelRenderer bipedRightBracelet; -+ -+ public Bracelet(ModelBiped mb) { -+ super(mb); -+ bipedFrontBracelet = new ModelRenderer(mb, 0, 0); -+ bipedFrontBracelet.addBox(4F, 9F, -3F, 4, 1, 1); -+ bipedLeftBracelet = new ModelRenderer(mb, 10, 0); -+ bipedLeftBracelet.addBox(3F, 9F, -3F, 1, 1, 6); -+ bipedBackBracelet = new ModelRenderer(mb, 0, 2); -+ bipedBackBracelet.addBox(4F, 9F, 2F, 4, 1, 1); -+ bipedBackBracelet.setRotationPoint(0F, 0F, 0F); -+ bipedRightBracelet = new ModelRenderer(mb, 0, 4); -+ bipedRightBracelet.addBox(8F, 9F, -3F, 1, 1, 6); -+ bipedRightBracelet.setRotationPoint(0F, 0F, 0F); -+ } -+ -+ @Override -+ public void render(EntityPlayer plr, float f) { -+ bipedFrontBracelet.rotateAngleY = getModel().bipedLeftArm.rotateAngleY; -+ bipedFrontBracelet.rotateAngleX = getModel().bipedLeftArm.rotateAngleX; -+ bipedFrontBracelet.rotationPointX = 0.0F; -+ bipedFrontBracelet.rotationPointY = 0.0F; -+ bipedFrontBracelet.render(f); -+ bipedLeftBracelet.rotateAngleY = getModel().bipedLeftArm.rotateAngleY; -+ bipedLeftBracelet.rotateAngleX = getModel().bipedLeftArm.rotateAngleX; -+ bipedLeftBracelet.rotationPointX = 0.0F; -+ bipedLeftBracelet.rotationPointY = 0.0F; -+ bipedLeftBracelet.render(f); -+ bipedBackBracelet.rotateAngleY = getModel().bipedLeftArm.rotateAngleY; -+ bipedBackBracelet.rotateAngleX = getModel().bipedLeftArm.rotateAngleX; -+ bipedBackBracelet.rotationPointX = 0.0F; -+ bipedBackBracelet.rotationPointY = 0.0F; -+ bipedBackBracelet.render(f); -+ bipedRightBracelet.rotateAngleY = getModel().bipedLeftArm.rotateAngleY; -+ bipedRightBracelet.rotateAngleX = getModel().bipedLeftArm.rotateAngleX; -+ bipedRightBracelet.rotationPointX = 0.0F; -+ bipedRightBracelet.rotationPointY = 0.0F; -+ bipedRightBracelet.render(f); -+ } -+ -+ @Override -+ public AccessoryType getType() { -+ return AccessoryType.BRACELET; -+ } -+} ---- /dev/null -+++ org/spoutcraft/api/sound/SoundEffect.java -@@ -1,0 +1,654 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.api.sound; -+ -+import java.util.HashMap; -+import java.util.Map; -+ -+public enum SoundEffect { -+ /* Ambient Sound Effects */ -+ CAVE_RANDOM(0, "ambient.cave.cave"), -+ CAVE_MYSTERIOUS(1, "ambient.cave.cave", 0), -+ CAVE_LIGHT_MYSTERIOUS(2, "ambient.cave.cave", 1), -+ CAVE_SHADOW(3, "ambient.cave.cave", 2), -+ CAVE_DEEP(4, "ambient.cave.cave", 3), -+ CAVE_NEW_PASSAGE(5, "ambient.cave.cave", 4), -+ CAVE_PASSING_SHADOW(6, "ambient.cave.cave", 5), -+ CAVE_DARK_SHADOW(7, "ambient.cave.cave", 6), -+ CAVE_FEAR(8, "ambient.cave.cave", 7), -+ CAVE_DARK_MYSTERIOUS(9, "ambient.cave.cave", 8), -+ CAVE_LARGE_FEAR(10, "ambient.cave.cave", 9), -+ CAVE_RUMBLE(11, "ambient.cave.cave", 10), -+ CAVE_SHORT_MYSTERIOUS(12, "ambient.cave.cave", 11), -+ CAVE_MONSTER_ROAR(13, "ambient.cave.cave", 12), -+ -+ WEATHER_RAIN(14, "ambient.weather.rain"), -+ WEATHER_RAIN_1(15, "ambient.weather.rain", 0), -+ WEATHER_RAIN_2(16, "ambient.weather.rain", 1), -+ WEATHER_RAIN_3(17, "ambient.weather.rain", 2), -+ WEATHER_RAIN_4(18, "ambient.weather.rain", 3), -+ -+ WEATHER_THUNDER(19, "ambient.weather.thunder"), -+ WEATHER_THUNDER_1(20, "ambient.weather.thunder", 0), -+ WEATHER_THUNDER_2(21, "ambient.weather.thunder", 1), -+ WEATHER_THUNDER_3(22, "ambient.weather.thunder", 2), -+ -+ /* Damage */ -+ FALL_BIG(23, "damage.fallbig"), -+ FALL_SMALL(24, "damage.fallsmall"), -+ -+ HIT(25, "damage.hit"), -+ HIT_1(26, "damage.hit", 0), -+ HIT_2(27, "damage.hit", 1), -+ HIT_3(28, "damage.hit", 2), -+ -+ /* Dig */ -+ DIG_CLOTH(29, "dig.cloth"), -+ DIG_CLOTH_1(30, "dig.cloth", 0), -+ DIG_CLOTH_2(31, "dig.cloth", 1), -+ DIG_CLOTH_3(32, "dig.cloth", 2), -+ DIG_CLOTH_4(33, "dig.cloth", 3), -+ -+ DIG_GRASS(34, "dig.grass"), -+ DIG_GRASS_1(35, "dig.grass", 0), -+ DIG_GRASS_2(36, "dig.grass", 1), -+ DIG_GRASS_3(37, "dig.grass", 2), -+ DIG_GRASS_4(38, "dig.grass", 3), -+ -+ DIG_GRAVEL(39, "dig.gravel"), -+ DIG_GRAVEL_1(40, "dig.gravel", 0), -+ DIG_GRAVEL_2(41, "dig.gravel", 1), -+ DIG_GRAVEL_3(42, "dig.gravel", 2), -+ DIG_GRAVEL_4(43, "dig.gravel", 3), -+ -+ DIG_SAND(44, "dig.sand"), -+ DIG_SAND_1(45, "dig.sand", 0), -+ DIG_SAND_2(46, "dig.sand", 1), -+ DIG_SAND_3(47, "dig.sand", 2), -+ DIG_SAND_4(48, "dig.sand", 3), -+ -+ DIG_SNOW(49, "dig.snow"), -+ DIG_SNOW_1(50, "dig.snow", 0), -+ DIG_SNOW_2(51, "dig.snow", 1), -+ DIG_SNOW_3(52, "dig.snow", 2), -+ DIG_SNOW_4(53, "dig.snow", 3), -+ -+ DIG_STONE(54, "dig.stone"), -+ DIG_STONE_1(55, "dig.stone", 0), -+ DIG_STONE_2(56, "dig.stone", 1), -+ DIG_STONE_3(57, "dig.stone", 2), -+ DIG_STONE_4(58, "dig.stone", 3), -+ -+ DIG_WOOD(59, "dig.wood"), -+ DIG_WOOD_1(60, "dig.wood", 0), -+ DIG_WOOD_2(61, "dig.wood", 1), -+ DIG_WOOD_3(62, "dig.wood", 2), -+ DIG_WOOD_4(63, "dig.wood", 3), -+ -+ /* Fire */ -+ FIRE(64, "fire.fire"), -+ FIRE_IGNITE(65, "fire.ignite"), -+ -+ /* Fireworks */ -+ FIREWORK_BLAST(66, "fireworks.blast"), -+ FIREWORK_BLAST_FAR(67, "fireworks.blast_far"), -+ FIREWORK_LARGE_BLAST(68, "fireworks.largeBlast"), -+ FIREWORK_LARGE_BLAST_FAR(69, "fireworks.largeBlast_far"), -+ FIREWORK_LAUNCH(70, "fireworks.launch"), -+ FIREWORK_TWINKLE(71, "fireworks.twinkle"), -+ FIREWORK_TWINKLE_FAR(72, "fireworks.twinkle_far"), -+ -+ /* Liquid */ -+ LAVA(73, "liquid.lava"), -+ LAVA_POP(74, "liquid.lavapop"), -+ -+ WATER_SPLASH(75, "liquid.splash"), -+ WATER_SPLASH_1(76, "liquid.splash", 0), -+ WATER_SPLASH_2(77, "liquid.splash", 1), -+ -+ SWIM(78, "liquid.swim"), -+ SWIM_1(79, "liquid.swim", 0), -+ SWIM_2(80, "liquid.swim", 1), -+ SWIM_3(81, "liquid.swim", 2), -+ SWIM_4(82, "liquid.swim", 3), -+ -+ WATER(83, "liquid.water"), -+ -+ /* Minecart */ -+ MINECART_BASE(84, "minecart.base"), -+ MINECART_INSIDE(85, "minecart.inside"), -+ -+ /* Mob Sound Effects */ -+ BAT_DEATH(86, "mob.bat.death"), -+ BAT_HURT(87, "mob.bat.hurt"), -+ BAT_HURT_1(88, "mob.bat.hurt", 0), -+ BAT_HURT_2(89, "mob.bat.hurt", 1), -+ BAT_HURT_3(90, "mob.bat.hurt", 2), -+ BAT_HURT_4(91, "mob.bat.hurt", 3), -+ BAT_IDLE(92, "mob.bat.idle"), -+ BAT_IDLE_1(93, "mob.bat.idle", 0), -+ BAT_IDLE_2(94, "mob.bat.idle", 1), -+ BAT_IDLE_3(95, "mob.bat.idle", 2), -+ BAT_IDLE_4(96, "mob.bat.idle", 3), -+ BAT_LOOP(97, "mob.bat.loop"), -+ BAT_TAKEOFF(98, "mob.bat.takeoff"), -+ -+ BLAZE_BREATHE(99, "mob.blaze.breathe"), -+ BLAZE_BREATHE_1(100, "mob.blaze.breathe", 0), -+ BLAZE_BREATHE_2(101, "mob.blaze.breathe", 1), -+ BLAZE_BREATHE_3(102, "mob.blaze.breathe", 2), -+ BLAZE_BREATHE_4(103, "mob.blaze.breathe", 3), -+ BLAZE_DEATH(104, "mob.blaze.death"), -+ BLAZE_HIT(105, "mob.blaze.hit"), -+ BLAZE_HIT_1(106, "mob.blaze.hit", 0), -+ BLAZE_HIT_2(107, "mob.blaze.hit", 1), -+ BLAZE_HIT_3(108, "mob.blaze.hit", 2), -+ BLAZE_HIT_4(109, "mob.blaze.hit", 3), -+ -+ CAT_HISS(110, "mob.cat.hiss"), -+ CAT_HISS_1(111, "mob.cat.hiss", 0), -+ CAT_HISS_2(112, "mob.cat.hiss", 1), -+ CAT_HISS_3(113, "mob.cat.hiss", 2), -+ CAT_HITT(114, "mob.cat.hitt"), -+ CAT_HITT_1(115, "mob.cat.hitt", 0), -+ CAT_HITT_2(116, "mob.cat.hitt", 1), -+ CAT_HITT_3(117, "mob.cat.hitt", 2), -+ CAT_MEOW(118, "mob.cat.meow"), -+ CAT_MEOW_1(119, "mob.cat.meow", 0), -+ CAT_MEOW_2(120, "mob.cat.meow", 1), -+ CAT_MEOW_3(121, "mob.cat.meow", 2), -+ CAT_MEOW_4(122, "mob.cat.meow", 3), -+ CAT_PURR(123, "mob.cat.purr"), -+ CAT_PURR_1(124, "mob.cat.purr", 0), -+ CAT_PURR_2(125, "mob.cat.purr", 1), -+ CAT_PURR_3(126, "mob.cat.purr", 2), -+ CAT_PURREOW(127, "mob.cat.purreow"), -+ CAT_PURREOW_1(128, "mob.cat.purreow", 0), -+ CAT_PURREOW_2(129, "mob.cat.purreow", 1), -+ -+ CHICKEN_HURT(130, "mob.chicken.hurt"), -+ CHICKEN_HURT_1(131, "mob.chicken.hurt", 0), -+ CHICKEN_HURT_2(132, "mob.chicken.hurt", 1), -+ CHICKEN_PLOP(133, "mob.chicken.plop"), -+ CHICKEN_SAY(134, "mob.chicken.say"), -+ CHICKEN_SAY_1(135, "mob.chicken.say", 0), -+ CHICKEN_SAY_2(136, "mob.chicken.say", 1), -+ CHICKEN_SAY_3(137, "mob.chicken.say", 2), -+ CHICKEN_STEP(138, "mob.chicken.step"), -+ CHICKEN_STEP_1(139, "mob.chicken.step", 0), -+ CHICKEN_STEP_2(140, "mob.chicken.step", 1), -+ -+ COW_HURT(141, "mob.cow.hurt"), -+ COW_HURT_1(142, "mob.cow.hurt", 0), -+ COW_HURT_2(143, "mob.cow.hurt", 1), -+ COW_HURT_3(144, "mob.cow.hurt", 2), -+ COW_SAY(145, "mob.cow.say"), -+ COW_SAY_1(146, "mob.cow.say", 0), -+ COW_SAY_2(147, "mob.cow.say", 1), -+ COW_SAY_3(148, "mob.cow.say", 2), -+ COW_SAY_4(149, "mob.cow.say", 3), -+ COW_STEP(150, "mob.cow.step"), -+ COW_STEP_1(151, "mob.cow.step", 0), -+ COW_STEP_2(152, "mob.cow.step", 1), -+ COW_STEP_3(153, "mob.cow.step", 2), -+ COW_STEP_4(154, "mob.cow.step", 3), -+ -+ CREEPER_DEATH(155, "mob.creeper.death"), -+ CREEPER_SAY(156, "mob.creeper.say"), -+ CREEPER_SAY_1(157, "mob.creeper.say", 0), -+ CREEPER_SAY_2(158, "mob.creeper.say", 1), -+ CREEPER_SAY_3(159, "mob.creeper.say", 2), -+ CREEPER_SAY_4(160, "mob.creeper.say", 3), -+ -+ ENDERDRAGON_END(161, "mob.enderdragon.end"), -+ ENDERDRAGON_GROWL(162, "mob.enderdragon.growl"), -+ ENDERDRAGON_GROWL_1(163, "mob.enderdragon.growl", 0), -+ ENDERDRAGON_GROWL_2(164, "mob.enderdragon.growl", 1), -+ ENDERDRAGON_GROWL_3(165, "mob.enderdragon.growl", 2), -+ ENDERDRAGON_GROWL_4(166, "mob.enderdragon.growl", 3), -+ ENDERDRAGON_HIT(167, "mob.enderdragon.hit"), -+ ENDERDRAGON_HIT_1(168, "mob.enderdragon.hit", 0), -+ ENDERDRAGON_HIT_2(169, "mob.enderdragon.hit", 1), -+ ENDERDRAGON_HIT_3(170, "mob.enderdragon.hit", 2), -+ ENDERDRAGON_HIT_4(171, "mob.enderdragon.hit", 3), -+ ENDERDRAGON_WINGS(172, "mob.enderdragon.wings"), -+ ENDERDRAGON_WINGS_1(173, "mob.enderdragon.wings", 0), -+ ENDERDRAGON_WINGS_2(174, "mob.enderdragon.wings", 1), -+ ENDERDRAGON_WINGS_3(175, "mob.enderdragon.wings", 2), -+ ENDERDRAGON_WINGS_4(176, "mob.enderdragon.wings", 3), -+ ENDERDRAGON_WINGS_5(177, "mob.enderdragon.wings", 4), -+ ENDERDRAGON_WINGS_6(178, "mob.enderdragon.wings", 5), -+ -+ ENDERMEN_DEATH(179, "mob.endermen.death"), -+ ENDERMEN_HIT(180, "mob.endermen.hit"), -+ ENDERMEN_HIT_1(181, "mob.endermen.hit", 0), -+ ENDERMEN_HIT_2(182, "mob.endermen.hit", 1), -+ ENDERMEN_HIT_3(183, "mob.endermen.hit", 2), -+ ENDERMEN_HIT_4(184, "mob.endermen.hit", 3), -+ ENDERMEN_IDLE(185, "mob.endermen.idle"), -+ ENDERMEN_IDLE_1(186, "mob.endermen.idle", 0), -+ ENDERMEN_IDLE_2(187, "mob.endermen.idle", 1), -+ ENDERMEN_IDLE_3(188, "mob.endermen.idle", 2), -+ ENDERMEN_IDLE_4(189, "mob.endermen.idle", 3), -+ ENDERMEN_IDLE_5(190, "mob.endermen.idle", 4), -+ ENDERMEN_PORTAL(191, "mob.endermen.portal"), -+ ENDERMEN_PORTAL_1(192, "mob.endermen.portal", 0), -+ ENDERMEN_PORTAL_2(193, "mob.endermen.portal", 1), -+ ENDERMEN_SCREAM(194, "mob.endermen.scream"), -+ ENDERMEN_SCREAM_1(195, "mob.endermen.scream", 0), -+ ENDERMEN_SCREAM_2(196, "mob.endermen.scream", 1), -+ ENDERMEN_SCREAM_3(197, "mob.endermen.scream", 2), -+ ENDERMEN_SCREAM_4(198, "mob.endermen.scream", 3), -+ ENDERMEN_STARE(199, "mob.endermen.stare"), -+ -+ GHAST_AFFECTIONATE_SCREAM(200, "mob.ghast.affectionate scream"), -+ GHAST_CHARGE(201, "mob.ghast.charge"), -+ GHAST_DEATH(202, "mob.ghast.death"), -+ GHAST_FIREBALL(203, "mob.ghast.fireball"), -+ GHAST_MOAN(204, "mob.ghast.moan"), -+ GHAST_MOAN_1(205, "mob.ghast.moan", 0), -+ GHAST_MOAN_2(206, "mob.ghast.moan", 1), -+ GHAST_MOAN_3(207, "mob.ghast.moan", 2), -+ GHAST_MOAN_4(208, "mob.ghast.moan", 3), -+ GHAST_MOAN_5(209, "mob.ghast.moan", 4), -+ GHAST_MOAN_6(210, "mob.ghast.moan", 5), -+ GHAST_MOAN_7(211, "mob.ghast.moan", 6), -+ GHAST_SCREAM(212, "mob.ghast.scream"), -+ GHAST_SCREAM_1(213, "mob.ghast.scream", 0), -+ GHAST_SCREAM_2(214, "mob.ghast.scream", 1), -+ GHAST_SCREAM_3(215, "mob.ghast.scream", 2), -+ GHAST_SCREAM_4(216, "mob.ghast.scream", 3), -+ GHAST_SCREAM_5(217, "mob.ghast.scream", 4), -+ -+ IRONGOLEM_DEATH(218, "mob.irongolem.death"), -+ IRONGOLEM_HIT(219, "mob.irongolem.hit"), -+ IRONGOLEM_HIT_1(220, "mob.irongolem.hit", 0), -+ IRONGOLEM_HIT_2(221, "mob.irongolem.hit", 1), -+ IRONGOLEM_HIT_3(222, "mob.irongolem.hit", 2), -+ IRONGOLEM_HIT_4(223, "mob.irongolem.hit", 3), -+ IRONGOLEM_THROW(224, "mob.irongolem.throw"), -+ IRONGOLEM_WALK(225, "mob.irongolem.walk"), -+ IRONGOLEM_WALK_1(226, "mob.irongolem.walk", 0), -+ IRONGOLEM_WALK_2(227, "mob.irongolem.walk", 1), -+ IRONGOLEM_WALK_3(228, "mob.irongolem.walk", 2), -+ IRONGOLEM_WALK_4(229, "mob.irongolem.walk", 3), -+ -+ MAGMACUBE_BIG(230, "mob.magmacube.big"), -+ MAGMACUBE_BIG_1(231, "mob.magmacube.big", 0), -+ MAGMACUBE_BIG_2(232, "mob.magmacube.big", 1), -+ MAGMACUBE_BIG_3(233, "mob.magmacube.big", 2), -+ MAGMACUBE_BIG_4(234, "mob.magmacube.big", 3), -+ MAGMACUBE_JUMP(235, "mob.magmacube.jump"), -+ MAGMACUBE_JUMP_1(236, "mob.magmacube.jump", 0), -+ MAGMACUBE_JUMP_2(237, "mob.magmacube.jump", 1), -+ MAGMACUBE_JUMP_3(238, "mob.magmacube.jump", 2), -+ MAGMACUBE_JUMP_4(239, "mob.magmacube.jump", 3), -+ MAGMACUBE_SMALL(240, "mob.magmacube.small"), -+ MAGMACUBE_SMALL_1(241, "mob.magmacube.small", 0), -+ MAGMACUBE_SMALL_2(242, "mob.magmacube.small", 1), -+ MAGMACUBE_SMALL_3(243, "mob.magmacube.small", 2), -+ MAGMACUBE_SMALL_4(244, "mob.magmacube.small", 3), -+ MAGMACUBE_SMALL_5(245, "mob.magmacube.small", 4), -+ -+ PIG_DEATH(246, "mob.pig.death"), -+ PIG_SAY(247, "mob.pig.say"), -+ PIG_SAY_1(248, "mob.pig.say", 0), -+ PIG_SAY_2(249, "mob.pig.say", 1), -+ PIG_SAY_3(250, "mob.pig.say", 2), -+ PIG_STEP(251, "mob.pig.step"), -+ PIG_STEP_1(252, "mob.pig.step", 0), -+ PIG_STEP_2(253, "mob.pig.step", 1), -+ PIG_STEP_3(254, "mob.pig.step", 2), -+ PIG_STEP_4(255, "mob.pig.step", 3), -+ PIG_STEP_5(256, "mob.pig.step", 4), -+ -+ SHEEP_SAY(257, "mob.sheep.say"), -+ SHEEP_SAY_1(258, "mob.sheep.say", 0), -+ SHEEP_SAY_2(259, "mob.sheep.say", 1), -+ SHEEP_SAY_3(260, "mob.sheep.say", 2), -+ SHEEP_SHEAR(261, "mob.sheep.shear"), -+ SHEEP_STEP(262, "mob.sheep.step"), -+ SHEEP_STEP_1(263, "mob.sheep.step", 0), -+ SHEEP_STEP_2(264, "mob.sheep.step", 1), -+ SHEEP_STEP_3(265, "mob.sheep.step", 2), -+ SHEEP_STEP_4(266, "mob.sheep.step", 3), -+ SHEEP_STEP_5(267, "mob.sheep.step", 4), -+ -+ SILVERFISH_HIT(268, "mob.silverfish.hit"), -+ SILVERFISH_HIT_1(269, "mob.silverfish.hit", 0), -+ SILVERFISH_HIT_2(270, "mob.silverfish.hit", 1), -+ SILVERFISH_HIT_3(271, "mob.silverfish.hit", 2), -+ SILVERFISH_KILL(272, "mob.silverfish.kill"), -+ SILVERFISH_SAY(273, "mob.silverfish.say"), -+ SILVERFISH_SAY_1(274, "mob.silverfish.say", 0), -+ SILVERFISH_SAY_2(275, "mob.silverfish.say", 1), -+ SILVERFISH_SAY_3(276, "mob.silverfish.say", 2), -+ SILVERFISH_SAY_4(277, "mob.silverfish.say", 3), -+ SILVERFISH_STEP(278, "mob.silverfish.step"), -+ SILVERFISH_STEP_1(279, "mob.silverfish.step", 0), -+ SILVERFISH_STEP_2(280, "mob.silverfish.step", 1), -+ SILVERFISH_STEP_3(281, "mob.silverfish.step", 2), -+ SILVERFISH_STEP_4(282, "mob.silverfish.step", 3), -+ -+ SKELETON_DEATH(283, "mob.skeleton.death"), -+ SKELETON_HURT(284, "mob.skeleton.hurt"), -+ SKELETON_HURT_1(285, "mob.skeleton.hurt", 0), -+ SKELETON_HURT_2(286, "mob.skeleton.hurt", 1), -+ SKELETON_HURT_3(287, "mob.skeleton.hurt", 2), -+ SKELETON_HURT_4(288, "mob.skeleton.hurt", 3), -+ SKELETON_SAY(289, "mob.skeleton.say"), -+ SKELETON_SAY_1(290, "mob.skeleton.say", 0), -+ SKELETON_SAY_2(291, "mob.skeleton.say", 1), -+ SKELETON_SAY_3(292, "mob.skeleton.say", 2), -+ SKELETON_STEP(293, "mob.skeleton.step"), -+ SKELETON_STEP_1(294, "mob.skeleton.step", 0), -+ SKELETON_STEP_2(295, "mob.skeleton.step", 1), -+ SKELETON_STEP_3(296, "mob.skeleton.step", 2), -+ SKELETON_STEP_4(297, "mob.skeleton.step", 3), -+ -+ SLIME_ATTACK(298, "mob.slime.attack"), -+ SLIME_ATTACK_1(299, "mob.slime.attack", 0), -+ SLIME_ATTACK_2(300, "mob.slime.attack", 1), -+ SLIME_BIG(301, "mob.slime.big"), -+ SLIME_BIG_1(302, "mob.slime.big", 0), -+ SLIME_BIG_2(303, "mob.slime.big", 1), -+ SLIME_BIG_3(304, "mob.slime.big", 2), -+ SLIME_BIG_4(305, "mob.slime.big", 3), -+ SLIME_SMALL(306, "mob.slime.small"), -+ SLIME_SMALL_1(307, "mob.slime.small", 0), -+ SLIME_SMALL_2(308, "mob.slime.small", 1), -+ SLIME_SMALL_3(309, "mob.slime.small", 2), -+ SLIME_SMALL_4(310, "mob.slime.small", 3), -+ SLIME_SMALL_5(311, "mob.slime.small", 4), -+ -+ SPIDER_DEATH(312, "mob.spider.death"), -+ SPIDER_SAY(313, "mob.spider.say"), -+ SPIDER_SAY_1(314, "mob.spider.say", 0), -+ SPIDER_SAY_2(315, "mob.spider.say", 1), -+ SPIDER_SAY_3(316, "mob.spider.say", 2), -+ SPIDER_SAY_4(317, "mob.spider.say", 3), -+ SPIDER_STEP(318, "mob.spider.step"), -+ SPIDER_STEP_1(319, "mob.spider.step", 0), -+ SPIDER_STEP_2(320, "mob.spider.step", 1), -+ SPIDER_STEP_3(321, "mob.spider.step", 2), -+ SPIDER_STEP_4(322, "mob.spider.step", 3), -+ -+ WITHER_DEATH(323, "mob.wither.death"), -+ WITHER_HURT(324, "mob.wither.hurt"), -+ WITHER_HURT_1(325, "mob.wither.hurt", 0), -+ WITHER_HURT_2(326, "mob.wither.hurt", 1), -+ WITHER_HURT_3(327, "mob.wither.hurt", 2), -+ WITHER_HURT_4(328, "mob.wither.hurt", 3), -+ WITHER_IDLE(329, "mob.wither.idle"), -+ WITHER_IDLE_1(330, "mob.wither.idle", 0), -+ WITHER_IDLE_2(331, "mob.wither.idle", 1), -+ WITHER_IDLE_3(332, "mob.wither.idle", 2), -+ WITHER_IDLE_4(333, "mob.wither.idle", 3), -+ WITHER_SHOOT(334, "mob.wither.shoot"), -+ WITHER_SPAWN(335, "mob.wither.spawn"), -+ -+ WOLF_BARK(336, "mob.wolf.bark"), -+ WOLF_BARK_1(337, "mob.wolf.bark", 0), -+ WOLF_BARK_2(338, "mob.wolf.bark", 1), -+ WOLF_BARK_3(339, "mob.wolf.bark", 2), -+ WOLF_DEATH(340, "mob.wolf.death"), -+ WOLF_GROWL(341, "mob.wolf.growl"), -+ WOLF_GROWL_1(342, "mob.wolf.growl", 0), -+ WOLF_GROWL_2(343, "mob.wolf.growl", 1), -+ WOLF_GROWL_3(344, "mob.wolf.growl", 2), -+ WOLF_HOWL(345, "mob.wolf.howl"), -+ WOLF_HOWL_1(346, "mob.wolf.howl", 0), -+ WOLF_HOWL_2(347, "mob.wolf.howl", 1), -+ WOLF_HURT_1(348, "mob.wolf.hurt", 0), -+ WOLF_HURT_2(349, "mob.wolf.hurt", 1), -+ WOLF_HURT_3(350, "mob.wolf.hurt", 2), -+ WOLF_PANTING(351, "mob.wolf.panting"), -+ WOLF_SHAKE(352, "mob.wolf.shake"), -+ WOLF_STEP(353, "mob.wolf.step"), -+ WOLF_STEP_1(354, "mob.wolf.step", 0), -+ WOLF_STEP_2(355, "mob.wolf.step", 1), -+ WOLF_STEP_3(356, "mob.wolf.step", 2), -+ WOLF_STEP_4(357, "mob.wolf.step", 3), -+ WOLF_STEP_5(358, "mob.wolf.step", 4), -+ WOLF_WHINE(359, "mob.wolf.whine"), -+ -+ ZOMBIE_DEATH(360, "mob.zombie.death"), -+ ZOMBIE_HURT(361, "mob.zombie.hurt"), -+ ZOMBIE_HURT_1(362, "mob.zombie.hurt", 0), -+ ZOMBIE_HURT_2(363, "mob.zombie.hurt", 1), -+ ZOMBIE_INFECT(364, "mob.zombie.infect"), -+ ZOMBIE_METAL(365, "mob.zombie.metal"), -+ ZOMBIE_METAL_1(366, "mob.zombie.metal", 0), -+ ZOMBIE_METAL_2(367, "mob.zombie.metal", 1), -+ ZOMBIE_METAL_3(368, "mob.zombie.metal", 2), -+ ZOMBIE_REMEDY(369, "mob.zombie.remedy"), -+ ZOMBIE_SAY(370, "mob.zombie.say"), -+ ZOMBIE_SAY_1(371, "mob.zombie.say", 0), -+ ZOMBIE_SAY_2(372, "mob.zombie.say", 1), -+ ZOMBIE_SAY_3(373, "mob.zombie.say", 2), -+ ZOMBIE_STEP(374, "mob.zombie.step"), -+ ZOMBIE_STEP_1(375, "mob.zombie.step", 0), -+ ZOMBIE_STEP_2(376, "mob.zombie.step", 1), -+ ZOMBIE_STEP_3(377, "mob.zombie.step", 2), -+ ZOMBIE_STEP_4(378, "mob.zombie.step", 3), -+ ZOMBIE_STEP_5(379, "mob.zombie.step", 4), -+ ZOMBIE_UNFECT(380, "mob.zombie.unfect"), -+ ZOMBIE_WOOD(381, "mob.zombie.wood"), -+ ZOMBIE_WOOD_1(382, "mob.zombie.wood", 0), -+ ZOMBIE_WOOD_2(383, "mob.zombie.wood", 1), -+ ZOMBIE_WOOD_3(384, "mob.zombie.wood", 2), -+ ZOMBIE_WOOD_4(385, "mob.zombie.wood", 3), -+ ZOMBIE_WOOD_BREAK(386, "mob.zombie.woodbreak"), -+ -+ ZOMBIEPIG(387, "mob.zombiepig.zpig"), -+ ZOMBIEPIG_1(388, "mob.zombiepig.zpig", 0), -+ ZOMBIEPIG_2(389, "mob.zombiepig.zpig", 1), -+ ZOMBIEPIG_3(390, "mob.zombiepig.zpig", 2), -+ ZOMBIEPIG_4(391, "mob.zombiepig.zpig", 3), -+ ZOMBIEPIG_ANGRY(392, "mob.zombiepig.zpigangry"), -+ ZOMBIEPIG_ANGRY_1(393, "mob.zombiepig.zpigangry", 0), -+ ZOMBIEPIG_ANGRY_2(394, "mob.zombiepig.zpigangry", 1), -+ ZOMBIEPIG_ANGRY_3(395, "mob.zombiepig.zpigangry", 2), -+ ZOMBIEPIG_ANGRY_4(396, "mob.zombiepig.zpigangry", 3), -+ ZOMBIEPIG_DEATH(397, "mob.zombiepig.zpigdeath"), -+ ZOMBIEPIG_HURT(398, "mob.zombiepig.zpighurt"), -+ ZOMBIEPIG_HURT_1(399, "mob.zombiepig.zpighurt", 0), -+ ZOMBIEPIG_HURT_2(400, "mob.zombiepig.zpighurt", 1), -+ -+ /* Notes */ -+ NOTE_BASS(401, "note.bass"), -+ NOTE_BASS_ATTACK(402, "note.bassattack"), -+ NOTE_BASS_DRUM(403, "note.bd"), -+ NOTE_HARP(404, "note.harp"), -+ NOTE_HAT(405, "note.hat"), -+ NOTE_PLING(406, "note.pling"), -+ NOTE_SNARE(407, "note.snare"), -+ -+ /* Portal */ -+ PORTAL(408, "portal.portal"), -+ PORTAL_TRAVEL(409, "portal.travel"), -+ PORTAL_TRIGGER(410, "portal.trigger"), -+ -+ /* Random Sound Effects */ -+ ANVIL_BREAK(411, "random.anvil_break"), -+ ANVIL_LAND(412, "random.anvil_land"), -+ ANVIL_USE(413, "random.anvil_use"), -+ -+ BOW(414, "random.bow"), -+ BOW_HIT(415, "random.bowhit"), -+ BOW_HIT_1(416, "random.bowhit", 0), -+ BOW_HIT_2(417, "random.bowhit", 1), -+ BOW_HIT_3(418, "random.bowhit", 2), -+ BOW_HIT_4(419, "random.bowhit", 3), -+ -+ BREAK(420, "random.break"), -+ BREATH(421, "random.breath"), -+ BURP(422, "random.burp"), -+ CHEST_CLOSE(423, "random.chestclosed"), -+ CHEST_OPEN(424, "random.chestopen"), -+ CLASSIC_HURT(425, "random.classic_hurt"), -+ CLICK(426, "random.click"), -+ DOOR_CLOSE(427, "random.door_close"), -+ DOOR_OPEN(428, "random.door_open"), -+ DRINK(429, "random.drink"), -+ -+ EAT(430, "random.eat"), -+ EAT_1(431, "random.eat", 0), -+ EAT_2(432, "random.eat", 1), -+ EAT_3(433, "random.eat", 2), -+ -+ EXPLODE(434, "randome.explode"), -+ EXPLODE_1(435, "random.explode", 0), -+ EXPLODE_2(436, "random.explode", 1), -+ EXPLODE_3(437, "random.explode", 2), -+ EXPLODE_4(438, "random.explode", 3), -+ -+ FIZZ(439, "random.fizz"), -+ FUSE(440, "random.fuse"), -+ -+ GLASS_BREAK(441, "random.glass"), -+ GLASS_BREAK_1(442, "random.glass", 0), -+ GLASS_BREAK_2(443, "random.glass", 1), -+ GLASS_BREAK_3(444, "random.glass", 2), -+ -+ LEVEL_UP(445, "random.levelup"), -+ ORB(446, "random.orb"), -+ POP(447, "random.pop"), -+ SPLASH(448, "random.splash"), -+ SUCCESSFUL_HIT(449, "random.successful_hit"), -+ WOOD_CLICK(450, "random.wood click"), -+ -+ /* Block Sound Effects */ -+ STEP_CLOTH(451, "step.cloth"), -+ STEP_CLOTH_1(452, "step.cloth", 0), -+ STEP_CLOTH_2(453, "step.cloth", 1), -+ STEP_CLOTH_3(454, "step.cloth", 2), -+ STEP_CLOTH_4(455, "step.cloth", 3), -+ -+ STEP_GRASS(456, "step.grass"), -+ STEP_GRASS_1(457, "step.grass", 0), -+ STEP_GRASS_2(458, "step.grass", 1), -+ STEP_GRASS_3(459, "step.grass", 2), -+ STEP_GRASS_4(460, "step.grass", 3), -+ STEP_GRASS_5(461, "step.grass", 4), -+ STEP_GRASS_6(462, "step.grass", 5), -+ -+ STEP_GRAVEL(463, "step.gravel"), -+ STEP_GRAVEL_1(464, "step.gravel", 0), -+ STEP_GRAVEL_2(465, "step.gravel", 1), -+ STEP_GRAVEL_3(466, "step.gravel", 2), -+ STEP_GRAVEL_4(467, "step.gravel", 3), -+ -+ STEP_LADDER(468, "step.ladder"), -+ STEP_LADDER_1(469, "step.ladder", 0), -+ STEP_LADDER_2(470, "step.ladder", 1), -+ STEP_LADDER_3(471, "step.ladder", 2), -+ STEP_LADDER_4(472, "step.ladder", 3), -+ STEP_LADDER_5(473, "step.ladder", 4), -+ -+ STEP_SAND(474, "step.gravel"), -+ STEP_SAND_1(475, "step.sand", 0), -+ STEP_SAND_2(476, "step.sand", 1), -+ STEP_SAND_3(477, "step.sand", 2), -+ STEP_SAND_4(478, "step.sand", 3), -+ STEP_SAND_5(479, "step.sand", 4), -+ -+ STEP_SNOW(480, "step.snow"), -+ STEP_SNOW_1(481, "step.snow", 0), -+ STEP_SNOW_2(482, "step.snow", 1), -+ STEP_SNOW_3(483, "step.snow", 2), -+ STEP_SNOW_4(484, "step.snow", 3), -+ -+ STEP_STONE(485, "step.stone"), -+ STEP_STONE_1(486, "step.stone", 0), -+ STEP_STONE_2(487, "step.stone", 1), -+ STEP_STONE_3(488, "step.stone", 2), -+ STEP_STONE_4(489, "step.stone", 3), -+ STEP_STONE_5(490, "step.stone", 4), -+ STEP_STONE_6(491, "step.stone", 5), -+ -+ STEP_WOOD(492, "step.wood"), -+ STEP_WOOD_1(493, "step.wood", 0), -+ STEP_WOOD_2(494, "step.wood", 1), -+ STEP_WOOD_3(495, "step.wood", 2), -+ STEP_WOOD_4(496, "step.wood", 3), -+ STEP_WOOD_5(497, "step.wood", 4), -+ STEP_WOOD_6(498, "step.wood", 5), -+ -+ /* Tile */ -+ PISTON_IN(499, "tile.piston.in"), -+ PISTON_OUT(500, "tile.piston.out"), -+ -+ /* Custom */ -+ CUSTOM_EFFECT(501, "custom"); -+ -+ private final int id; -+ private final String name; -+ private final int variationId; -+ private static final Map lookupName = new HashMap(); -+ private static final Map lookupId = new HashMap(); -+ private static int last = 0; -+ -+ SoundEffect(final int id, final String name) { -+ this.id = id; -+ this.name = name; -+ this.variationId = -1; -+ } -+ -+ SoundEffect(final int id, final String name, final int variationId) { -+ this.id = id; -+ this.name = name; -+ this.variationId = variationId; -+ } -+ -+ public int getId() { -+ return id; -+ } -+ -+ public String getName() { -+ return name; -+ } -+ -+ public int getVariationId() { -+ return variationId; -+ } -+ -+ public static SoundEffect getSoundEffectFromId(int id) { -+ return lookupId.get(id); -+ } -+ -+ public static SoundEffect getSoundEffectFromName(String name) { -+ return lookupName.get(name); -+ } -+ -+ public static int getMaxId() { -+ return last; -+ } -+ -+ static { -+ for (SoundEffect i : values()) { -+ lookupName.put(i.getName(), i); -+ lookupId.put(i.getId(), i); -+ if (i.getId() > last) { -+ last = i.getId(); -+ } -+ } -+ } -+} ---- net/minecraft/src/ModelVillager.java -+++ net/minecraft/src/ModelVillager.java -@@ -1,60 +1,78 @@ - package net.minecraft.src; - - public class ModelVillager extends ModelBase { -+ -+ /** The head box of the VillagerModel */ - public ModelRenderer villagerHead; -+ -+ /** The body of the VillagerModel */ - public ModelRenderer villagerBody; -+ -+ /** The arms of the VillagerModel */ - public ModelRenderer villagerArms; -+ -+ /** The right leg of the VillagerModel */ - public ModelRenderer rightVillagerLeg; -+ -+ /** The left leg of the VillagerModel */ - public ModelRenderer leftVillagerLeg; - public ModelRenderer villagerNose; - -- public ModelVillager(float var1) { -- this(var1, 0.0F, 64, 64); -+ public ModelVillager(float par1) { -+ this(par1, 0.0F, 64, 64); - } - -- public ModelVillager(float var1, float var2, int var3, int var4) { -- this.villagerHead = (new ModelRenderer(this)).setTextureSize(var3, var4); -- this.villagerHead.setRotationPoint(0.0F, 0.0F + var2, 0.0F); -- this.villagerHead.setTextureOffset(0, 0).addBox(-4.0F, -10.0F, -4.0F, 8, 10, 8, var1); -- this.villagerNose = (new ModelRenderer(this)).setTextureSize(var3, var4); -- this.villagerNose.setRotationPoint(0.0F, var2 - 2.0F, 0.0F); -- this.villagerNose.setTextureOffset(24, 0).addBox(-1.0F, -1.0F, -6.0F, 2, 4, 2, var1); -+ public ModelVillager(float par1, float par2, int par3, int par4) { -+ this.villagerHead = (new ModelRenderer(this)).setTextureSize(par3, par4); -+ this.villagerHead.setRotationPoint(0.0F, 0.0F + par2, 0.0F); -+ this.villagerHead.setTextureOffset(0, 0).addBox(-4.0F, -10.0F, -4.0F, 8, 10, 8, par1); -+ this.villagerNose = (new ModelRenderer(this)).setTextureSize(par3, par4); -+ this.villagerNose.setRotationPoint(0.0F, par2 - 2.0F, 0.0F); -+ this.villagerNose.setTextureOffset(24, 0).addBox(-1.0F, -1.0F, -6.0F, 2, 4, 2, par1); - this.villagerHead.addChild(this.villagerNose); -- this.villagerBody = (new ModelRenderer(this)).setTextureSize(var3, var4); -- this.villagerBody.setRotationPoint(0.0F, 0.0F + var2, 0.0F); -- this.villagerBody.setTextureOffset(16, 20).addBox(-4.0F, 0.0F, -3.0F, 8, 12, 6, var1); -- this.villagerBody.setTextureOffset(0, 38).addBox(-4.0F, 0.0F, -3.0F, 8, 18, 6, var1 + 0.5F); -- this.villagerArms = (new ModelRenderer(this)).setTextureSize(var3, var4); -- this.villagerArms.setRotationPoint(0.0F, 0.0F + var2 + 2.0F, 0.0F); -- this.villagerArms.setTextureOffset(44, 22).addBox(-8.0F, -2.0F, -2.0F, 4, 8, 4, var1); -- this.villagerArms.setTextureOffset(44, 22).addBox(4.0F, -2.0F, -2.0F, 4, 8, 4, var1); -- this.villagerArms.setTextureOffset(40, 38).addBox(-4.0F, 2.0F, -2.0F, 8, 4, 4, var1); -- this.rightVillagerLeg = (new ModelRenderer(this, 0, 22)).setTextureSize(var3, var4); -- this.rightVillagerLeg.setRotationPoint(-2.0F, 12.0F + var2, 0.0F); -- this.rightVillagerLeg.addBox(-2.0F, 0.0F, -2.0F, 4, 12, 4, var1); -- this.leftVillagerLeg = (new ModelRenderer(this, 0, 22)).setTextureSize(var3, var4); -+ this.villagerBody = (new ModelRenderer(this)).setTextureSize(par3, par4); -+ this.villagerBody.setRotationPoint(0.0F, 0.0F + par2, 0.0F); -+ this.villagerBody.setTextureOffset(16, 20).addBox(-4.0F, 0.0F, -3.0F, 8, 12, 6, par1); -+ this.villagerBody.setTextureOffset(0, 38).addBox(-4.0F, 0.0F, -3.0F, 8, 18, 6, par1 + 0.5F); -+ this.villagerArms = (new ModelRenderer(this)).setTextureSize(par3, par4); -+ this.villagerArms.setRotationPoint(0.0F, 0.0F + par2 + 2.0F, 0.0F); -+ this.villagerArms.setTextureOffset(44, 22).addBox(-8.0F, -2.0F, -2.0F, 4, 8, 4, par1); -+ this.villagerArms.setTextureOffset(44, 22).addBox(4.0F, -2.0F, -2.0F, 4, 8, 4, par1); -+ this.villagerArms.setTextureOffset(40, 38).addBox(-4.0F, 2.0F, -2.0F, 8, 4, 4, par1); -+ this.rightVillagerLeg = (new ModelRenderer(this, 0, 22)).setTextureSize(par3, par4); -+ this.rightVillagerLeg.setRotationPoint(-2.0F, 12.0F + par2, 0.0F); -+ this.rightVillagerLeg.addBox(-2.0F, 0.0F, -2.0F, 4, 12, 4, par1); -+ this.leftVillagerLeg = (new ModelRenderer(this, 0, 22)).setTextureSize(par3, par4); - this.leftVillagerLeg.mirror = true; -- this.leftVillagerLeg.setRotationPoint(2.0F, 12.0F + var2, 0.0F); -- this.leftVillagerLeg.addBox(-2.0F, 0.0F, -2.0F, 4, 12, 4, var1); -- } -- -- public void render(Entity var1, float var2, float var3, float var4, float var5, float var6, float var7) { -- this.setRotationAngles(var2, var3, var4, var5, var6, var7, var1); -- this.villagerHead.render(var7); -- this.villagerBody.render(var7); -- this.rightVillagerLeg.render(var7); -- this.leftVillagerLeg.render(var7); -- this.villagerArms.render(var7); -- } -- -- public void setRotationAngles(float var1, float var2, float var3, float var4, float var5, float var6, Entity var7) { -- this.villagerHead.rotateAngleY = var4 / (180.0F / (float)Math.PI); -- this.villagerHead.rotateAngleX = var5 / (180.0F / (float)Math.PI); -+ this.leftVillagerLeg.setRotationPoint(2.0F, 12.0F + par2, 0.0F); -+ this.leftVillagerLeg.addBox(-2.0F, 0.0F, -2.0F, 4, 12, 4, par1); -+ } -+ -+ /** -+ * Sets the models various rotation angles then renders the model. -+ */ -+ public void render(Entity par1Entity, float par2, float par3, float par4, float par5, float par6, float par7) { -+ this.setRotationAngles(par2, par3, par4, par5, par6, par7, par1Entity); -+ this.villagerHead.render(par7); -+ this.villagerBody.render(par7); -+ this.rightVillagerLeg.render(par7); -+ this.leftVillagerLeg.render(par7); -+ this.villagerArms.render(par7); -+ } -+ -+ /** -+ * Sets the model's various rotation angles. For bipeds, par1 and par2 are used for animating the movement of arms and -+ * legs, where par1 represents the time(so that arms and legs swing back and forth) and par2 represents how "far" arms -+ * and legs can swing at most. -+ */ -+ public void setRotationAngles(float par1, float par2, float par3, float par4, float par5, float par6, Entity par7Entity) { -+ this.villagerHead.rotateAngleY = par4 / (180F / (float)Math.PI); -+ this.villagerHead.rotateAngleX = par5 / (180F / (float)Math.PI); - this.villagerArms.rotationPointY = 3.0F; - this.villagerArms.rotationPointZ = -1.0F; -- this.villagerArms.rotateAngleX = -(12.0F / 16.0F); -- this.rightVillagerLeg.rotateAngleX = MathHelper.cos(var1 * 0.6662F) * 1.4F * var2 * 0.5F; -- this.leftVillagerLeg.rotateAngleX = MathHelper.cos(var1 * 0.6662F + (float)Math.PI) * 1.4F * var2 * 0.5F; -+ this.villagerArms.rotateAngleX = -0.75F; -+ this.rightVillagerLeg.rotateAngleX = MathHelper.cos(par1 * 0.6662F) * 1.4F * par2 * 0.5F; -+ this.leftVillagerLeg.rotateAngleX = MathHelper.cos(par1 * 0.6662F + (float)Math.PI) * 1.4F * par2 * 0.5F; - this.rightVillagerLeg.rotateAngleY = 0.0F; - this.leftVillagerLeg.rotateAngleY = 0.0F; - } ---- net/minecraft/src/BlockLever.java -+++ net/minecraft/src/BlockLever.java -@@ -1,172 +1,220 @@ - package net.minecraft.src; - - public class BlockLever extends Block { -- protected BlockLever(int var1) { -- super(var1, Material.circuits); -+ protected BlockLever(int par1) { -+ super(par1, Material.circuits); - this.setCreativeTab(CreativeTabs.tabRedstone); - } - -- public AxisAlignedBB getCollisionBoundingBoxFromPool(World var1, int var2, int var3, int var4) { -+ /** -+ * Returns a bounding box from the pool of bounding boxes (this means this box can change after the pool has been -+ * cleared to be reused) -+ */ -+ public AxisAlignedBB getCollisionBoundingBoxFromPool(World par1World, int par2, int par3, int par4) { - return null; - } - -+ /** -+ * Is this block (a) opaque and (b) a full 1m cube? This determines whether or not to render the shared face of two -+ * adjacent blocks and also whether the player can attach torches, redstone wire, etc to this block. -+ */ - public boolean isOpaqueCube() { - return false; - } - -+ /** -+ * If this block doesn't render as an ordinary block it will return False (examples: signs, buttons, stairs, etc) -+ */ - public boolean renderAsNormalBlock() { - return false; - } - -+ /** -+ * The type of render function that is called for this block -+ */ - public int getRenderType() { - return 12; - } - -- public boolean canPlaceBlockOnSide(World var1, int var2, int var3, int var4, int var5) { -- return var5 == 0 && var1.isBlockNormalCube(var2, var3 + 1, var4) ? true : (var5 == 1 && var1.doesBlockHaveSolidTopSurface(var2, var3 - 1, var4) ? true : (var5 == 2 && var1.isBlockNormalCube(var2, var3, var4 + 1) ? true : (var5 == 3 && var1.isBlockNormalCube(var2, var3, var4 - 1) ? true : (var5 == 4 && var1.isBlockNormalCube(var2 + 1, var3, var4) ? true : var5 == 5 && var1.isBlockNormalCube(var2 - 1, var3, var4))))); -- } -- -- public boolean canPlaceBlockAt(World var1, int var2, int var3, int var4) { -- return var1.isBlockNormalCube(var2 - 1, var3, var4) ? true : (var1.isBlockNormalCube(var2 + 1, var3, var4) ? true : (var1.isBlockNormalCube(var2, var3, var4 - 1) ? true : (var1.isBlockNormalCube(var2, var3, var4 + 1) ? true : (var1.doesBlockHaveSolidTopSurface(var2, var3 - 1, var4) ? true : var1.isBlockNormalCube(var2, var3 + 1, var4))))); -- } -- -- public int onBlockPlaced(World var1, int var2, int var3, int var4, int var5, float var6, float var7, float var8, int var9) { -- int var11 = var9 & 8; -- int var10 = var9 & 7; -+ /** -+ * checks to see if you can place this block can be placed on that side of a block: BlockLever overrides -+ */ -+ public boolean canPlaceBlockOnSide(World par1World, int par2, int par3, int par4, int par5) { -+ return par5 == 0 && par1World.isBlockNormalCube(par2, par3 + 1, par4) ? true : (par5 == 1 && par1World.doesBlockHaveSolidTopSurface(par2, par3 - 1, par4) ? true : (par5 == 2 && par1World.isBlockNormalCube(par2, par3, par4 + 1) ? true : (par5 == 3 && par1World.isBlockNormalCube(par2, par3, par4 - 1) ? true : (par5 == 4 && par1World.isBlockNormalCube(par2 + 1, par3, par4) ? true : par5 == 5 && par1World.isBlockNormalCube(par2 - 1, par3, par4))))); -+ } -+ -+ /** -+ * Checks to see if its valid to put this block at the specified coordinates. Args: world, x, y, z -+ */ -+ public boolean canPlaceBlockAt(World par1World, int par2, int par3, int par4) { -+ return par1World.isBlockNormalCube(par2 - 1, par3, par4) ? true : (par1World.isBlockNormalCube(par2 + 1, par3, par4) ? true : (par1World.isBlockNormalCube(par2, par3, par4 - 1) ? true : (par1World.isBlockNormalCube(par2, par3, par4 + 1) ? true : (par1World.doesBlockHaveSolidTopSurface(par2, par3 - 1, par4) ? true : par1World.isBlockNormalCube(par2, par3 + 1, par4))))); -+ } -+ -+ /** -+ * Called when a block is placed using its ItemBlock. Args: World, X, Y, Z, side, hitX, hitY, hitZ, block metadata -+ */ -+ public int onBlockPlaced(World par1World, int par2, int par3, int par4, int par5, float par6, float par7, float par8, int par9) { -+ int var11 = par9 & 8; -+ int var10 = par9 & 7; - byte var12 = -1; -- if(var5 == 0 && var1.isBlockNormalCube(var2, var3 + 1, var4)) { -+ -+ if (par5 == 0 && par1World.isBlockNormalCube(par2, par3 + 1, par4)) { - var12 = 0; - } - -- if(var5 == 1 && var1.doesBlockHaveSolidTopSurface(var2, var3 - 1, var4)) { -+ if (par5 == 1 && par1World.doesBlockHaveSolidTopSurface(par2, par3 - 1, par4)) { - var12 = 5; - } - -- if(var5 == 2 && var1.isBlockNormalCube(var2, var3, var4 + 1)) { -+ if (par5 == 2 && par1World.isBlockNormalCube(par2, par3, par4 + 1)) { - var12 = 4; - } - -- if(var5 == 3 && var1.isBlockNormalCube(var2, var3, var4 - 1)) { -+ if (par5 == 3 && par1World.isBlockNormalCube(par2, par3, par4 - 1)) { - var12 = 3; - } - -- if(var5 == 4 && var1.isBlockNormalCube(var2 + 1, var3, var4)) { -+ if (par5 == 4 && par1World.isBlockNormalCube(par2 + 1, par3, par4)) { - var12 = 2; - } - -- if(var5 == 5 && var1.isBlockNormalCube(var2 - 1, var3, var4)) { -+ if (par5 == 5 && par1World.isBlockNormalCube(par2 - 1, par3, par4)) { - var12 = 1; - } - - return var12 + var11; - } - -- public void onBlockPlacedBy(World var1, int var2, int var3, int var4, EntityLivingBase var5, ItemStack var6) { -- int var7 = var1.getBlockMetadata(var2, var3, var4); -+ /** -+ * Called when the block is placed in the world. -+ */ -+ public void onBlockPlacedBy(World par1World, int par2, int par3, int par4, EntityLivingBase par5EntityLivingBase, ItemStack par6ItemStack) { -+ int var7 = par1World.getBlockMetadata(par2, par3, par4); - int var8 = var7 & 7; - int var9 = var7 & 8; -- if(var8 == invertMetadata(1)) { -- if((MathHelper.floor_double((double)(var5.rotationYaw * 4.0F / 360.0F) + 0.5D) & 1) == 0) { -- var1.setBlockMetadata(var2, var3, var4, 5 | var9, 2); -- } else { -- var1.setBlockMetadata(var2, var3, var4, 6 | var9, 2); -- } -- } else if(var8 == invertMetadata(0)) { -- if((MathHelper.floor_double((double)(var5.rotationYaw * 4.0F / 360.0F) + 0.5D) & 1) == 0) { -- var1.setBlockMetadata(var2, var3, var4, 7 | var9, 2); -- } else { -- var1.setBlockMetadata(var2, var3, var4, 0 | var9, 2); -- } -- } -- -- } -- -- public static int invertMetadata(int var0) { -- switch(var0) { -- case 0: -- return 0; -- case 1: -- return 5; -- case 2: -- return 4; -- case 3: -- return 3; -- case 4: -- return 2; -- case 5: -- return 1; -- default: -- return -1; -- } -- } -- -- public void onNeighborBlockChange(World var1, int var2, int var3, int var4, int var5) { -- if(this.checkIfAttachedToBlock(var1, var2, var3, var4)) { -- int var6 = var1.getBlockMetadata(var2, var3, var4) & 7; -+ -+ if (var8 == invertMetadata(1)) { -+ if ((MathHelper.floor_double((double)(par5EntityLivingBase.rotationYaw * 4.0F / 360.0F) + 0.5D) & 1) == 0) { -+ par1World.setBlockMetadataWithNotify(par2, par3, par4, 5 | var9, 2); -+ } else { -+ par1World.setBlockMetadataWithNotify(par2, par3, par4, 6 | var9, 2); -+ } -+ } else if (var8 == invertMetadata(0)) { -+ if ((MathHelper.floor_double((double)(par5EntityLivingBase.rotationYaw * 4.0F / 360.0F) + 0.5D) & 1) == 0) { -+ par1World.setBlockMetadataWithNotify(par2, par3, par4, 7 | var9, 2); -+ } else { -+ par1World.setBlockMetadataWithNotify(par2, par3, par4, 0 | var9, 2); -+ } -+ } -+ } -+ -+ /** -+ * only used in ComponentScatteredFeatureJunglePyramid.addComponentParts" -+ */ -+ public static int invertMetadata(int par0) { -+ switch (par0) { -+ case 0: -+ return 0; -+ -+ case 1: -+ return 5; -+ -+ case 2: -+ return 4; -+ -+ case 3: -+ return 3; -+ -+ case 4: -+ return 2; -+ -+ case 5: -+ return 1; -+ -+ default: -+ return -1; -+ } -+ } -+ -+ /** -+ * Lets the block know when one of its neighbor changes. Doesn't know which neighbor changed (coordinates passed are -+ * their own) Args: x, y, z, neighbor blockID -+ */ -+ public void onNeighborBlockChange(World par1World, int par2, int par3, int par4, int par5) { -+ if (this.checkIfAttachedToBlock(par1World, par2, par3, par4)) { -+ int var6 = par1World.getBlockMetadata(par2, par3, par4) & 7; - boolean var7 = false; -- if(!var1.isBlockNormalCube(var2 - 1, var3, var4) && var6 == 1) { -- var7 = true; -- } -- -- if(!var1.isBlockNormalCube(var2 + 1, var3, var4) && var6 == 2) { -- var7 = true; -- } -- -- if(!var1.isBlockNormalCube(var2, var3, var4 - 1) && var6 == 3) { -- var7 = true; -- } -- -- if(!var1.isBlockNormalCube(var2, var3, var4 + 1) && var6 == 4) { -- var7 = true; -- } -- -- if(!var1.doesBlockHaveSolidTopSurface(var2, var3 - 1, var4) && var6 == 5) { -- var7 = true; -- } -- -- if(!var1.doesBlockHaveSolidTopSurface(var2, var3 - 1, var4) && var6 == 6) { -- var7 = true; -- } -- -- if(!var1.isBlockNormalCube(var2, var3 + 1, var4) && var6 == 0) { -- var7 = true; -- } -- -- if(!var1.isBlockNormalCube(var2, var3 + 1, var4) && var6 == 7) { -- var7 = true; -- } -- -- if(var7) { -- this.dropBlockAsItem(var1, var2, var3, var4, var1.getBlockMetadata(var2, var3, var4), 0); -- var1.setBlockToAir(var2, var3, var4); -+ -+ if (!par1World.isBlockNormalCube(par2 - 1, par3, par4) && var6 == 1) { -+ var7 = true; -+ } -+ -+ if (!par1World.isBlockNormalCube(par2 + 1, par3, par4) && var6 == 2) { -+ var7 = true; -+ } -+ -+ if (!par1World.isBlockNormalCube(par2, par3, par4 - 1) && var6 == 3) { -+ var7 = true; -+ } -+ -+ if (!par1World.isBlockNormalCube(par2, par3, par4 + 1) && var6 == 4) { -+ var7 = true; -+ } -+ -+ if (!par1World.doesBlockHaveSolidTopSurface(par2, par3 - 1, par4) && var6 == 5) { -+ var7 = true; -+ } -+ -+ if (!par1World.doesBlockHaveSolidTopSurface(par2, par3 - 1, par4) && var6 == 6) { -+ var7 = true; -+ } -+ -+ if (!par1World.isBlockNormalCube(par2, par3 + 1, par4) && var6 == 0) { -+ var7 = true; -+ } -+ -+ if (!par1World.isBlockNormalCube(par2, par3 + 1, par4) && var6 == 7) { -+ var7 = true; -+ } -+ -+ if (var7) { -+ this.dropBlockAsItem(par1World, par2, par3, par4, par1World.getBlockMetadata(par2, par3, par4), 0); -+ par1World.setBlockToAir(par2, par3, par4); - } - } -- - } - -- private boolean checkIfAttachedToBlock(World var1, int var2, int var3, int var4) { -- if(!this.canPlaceBlockAt(var1, var2, var3, var4)) { -- this.dropBlockAsItem(var1, var2, var3, var4, var1.getBlockMetadata(var2, var3, var4), 0); -- var1.setBlockToAir(var2, var3, var4); -+ /** -+ * Checks if the block is attached to another block. If it is not, it returns false and drops the block as an item. If -+ * it is it returns true. -+ */ -+ private boolean checkIfAttachedToBlock(World par1World, int par2, int par3, int par4) { -+ if (!this.canPlaceBlockAt(par1World, par2, par3, par4)) { -+ this.dropBlockAsItem(par1World, par2, par3, par4, par1World.getBlockMetadata(par2, par3, par4), 0); -+ par1World.setBlockToAir(par2, par3, par4); - return false; - } else { - return true; - } - } - -- public void setBlockBoundsBasedOnState(IBlockAccess var1, int var2, int var3, int var4) { -- int var5 = var1.getBlockMetadata(var2, var3, var4) & 7; -- float var6 = 3.0F / 16.0F; -- if(var5 == 1) { -+ /** -+ * Updates the blocks bounds based on its current state. Args: world, x, y, z -+ */ -+ public void setBlockBoundsBasedOnState(IBlockAccess par1IBlockAccess, int par2, int par3, int par4) { -+ int var5 = par1IBlockAccess.getBlockMetadata(par2, par3, par4) & 7; -+ float var6 = 0.1875F; -+ -+ if (var5 == 1) { - this.setBlockBounds(0.0F, 0.2F, 0.5F - var6, var6 * 2.0F, 0.8F, 0.5F + var6); -- } else if(var5 == 2) { -+ } else if (var5 == 2) { - this.setBlockBounds(1.0F - var6 * 2.0F, 0.2F, 0.5F - var6, 1.0F, 0.8F, 0.5F + var6); -- } else if(var5 == 3) { -+ } else if (var5 == 3) { - this.setBlockBounds(0.5F - var6, 0.2F, 0.0F, 0.5F + var6, 0.8F, var6 * 2.0F); -- } else if(var5 == 4) { -+ } else if (var5 == 4) { - this.setBlockBounds(0.5F - var6, 0.2F, 1.0F - var6 * 2.0F, 0.5F + var6, 0.8F, 1.0F); -- } else if(var5 != 5 && var5 != 6) { -- if(var5 == 0 || var5 == 7) { -+ } else if (var5 != 5 && var5 != 6) { -+ if (var5 == 0 || var5 == 7) { - var6 = 0.25F; - this.setBlockBounds(0.5F - var6, 0.4F, 0.5F - var6, 0.5F + var6, 1.0F, 0.5F + var6); - } -@@ -174,77 +222,98 @@ - var6 = 0.25F; - this.setBlockBounds(0.5F - var6, 0.0F, 0.5F - var6, 0.5F + var6, 0.6F, 0.5F + var6); - } -- - } - -- public boolean onBlockActivated(World var1, int var2, int var3, int var4, EntityPlayer var5, int var6, float var7, float var8, float var9) { -- if(var1.isRemote) { -+ /** -+ * Called upon block activation (right click on the block.) -+ */ -+ public boolean onBlockActivated(World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer, int par6, float par7, float par8, float par9) { -+ if (par1World.isRemote) { - return true; - } else { -- int var10 = var1.getBlockMetadata(var2, var3, var4); -+ int var10 = par1World.getBlockMetadata(par2, par3, par4); - int var11 = var10 & 7; - int var12 = 8 - (var10 & 8); -- var1.setBlockMetadata(var2, var3, var4, var11 + var12, 3); -- var1.playSoundEffect((double)var2 + 0.5D, (double)var3 + 0.5D, (double)var4 + 0.5D, "random.click", 0.3F, var12 > 0 ? 0.6F : 0.5F); -- var1.notifyBlocksOfNeighborChange(var2, var3, var4, this.blockID); -- if(var11 == 1) { -- var1.notifyBlocksOfNeighborChange(var2 - 1, var3, var4, this.blockID); -- } else if(var11 == 2) { -- var1.notifyBlocksOfNeighborChange(var2 + 1, var3, var4, this.blockID); -- } else if(var11 == 3) { -- var1.notifyBlocksOfNeighborChange(var2, var3, var4 - 1, this.blockID); -- } else if(var11 == 4) { -- var1.notifyBlocksOfNeighborChange(var2, var3, var4 + 1, this.blockID); -- } else if(var11 != 5 && var11 != 6) { -- if(var11 == 0 || var11 == 7) { -- var1.notifyBlocksOfNeighborChange(var2, var3 + 1, var4, this.blockID); -+ par1World.setBlockMetadataWithNotify(par2, par3, par4, var11 + var12, 3); -+ par1World.playSoundEffect((double)par2 + 0.5D, (double)par3 + 0.5D, (double)par4 + 0.5D, "random.click", 0.3F, var12 > 0 ? 0.6F : 0.5F); -+ par1World.notifyBlocksOfNeighborChange(par2, par3, par4, this.blockID); -+ -+ if (var11 == 1) { -+ par1World.notifyBlocksOfNeighborChange(par2 - 1, par3, par4, this.blockID); -+ } else if (var11 == 2) { -+ par1World.notifyBlocksOfNeighborChange(par2 + 1, par3, par4, this.blockID); -+ } else if (var11 == 3) { -+ par1World.notifyBlocksOfNeighborChange(par2, par3, par4 - 1, this.blockID); -+ } else if (var11 == 4) { -+ par1World.notifyBlocksOfNeighborChange(par2, par3, par4 + 1, this.blockID); -+ } else if (var11 != 5 && var11 != 6) { -+ if (var11 == 0 || var11 == 7) { -+ par1World.notifyBlocksOfNeighborChange(par2, par3 + 1, par4, this.blockID); - } - } else { -- var1.notifyBlocksOfNeighborChange(var2, var3 - 1, var4, this.blockID); -+ par1World.notifyBlocksOfNeighborChange(par2, par3 - 1, par4, this.blockID); - } - - return true; - } - } - -- public void breakBlock(World var1, int var2, int var3, int var4, int var5, int var6) { -- if((var6 & 8) > 0) { -- var1.notifyBlocksOfNeighborChange(var2, var3, var4, this.blockID); -- int var7 = var6 & 7; -- if(var7 == 1) { -- var1.notifyBlocksOfNeighborChange(var2 - 1, var3, var4, this.blockID); -- } else if(var7 == 2) { -- var1.notifyBlocksOfNeighborChange(var2 + 1, var3, var4, this.blockID); -- } else if(var7 == 3) { -- var1.notifyBlocksOfNeighborChange(var2, var3, var4 - 1, this.blockID); -- } else if(var7 == 4) { -- var1.notifyBlocksOfNeighborChange(var2, var3, var4 + 1, this.blockID); -- } else if(var7 != 5 && var7 != 6) { -- if(var7 == 0 || var7 == 7) { -- var1.notifyBlocksOfNeighborChange(var2, var3 + 1, var4, this.blockID); -+ /** -+ * Called on server worlds only when the block has been replaced by a different block ID, or the same block with a -+ * different metadata value, but before the new metadata value is set. Args: World, x, y, z, old block ID, old metadata -+ */ -+ public void breakBlock(World par1World, int par2, int par3, int par4, int par5, int par6) { -+ if ((par6 & 8) > 0) { -+ par1World.notifyBlocksOfNeighborChange(par2, par3, par4, this.blockID); -+ int var7 = par6 & 7; -+ -+ if (var7 == 1) { -+ par1World.notifyBlocksOfNeighborChange(par2 - 1, par3, par4, this.blockID); -+ } else if (var7 == 2) { -+ par1World.notifyBlocksOfNeighborChange(par2 + 1, par3, par4, this.blockID); -+ } else if (var7 == 3) { -+ par1World.notifyBlocksOfNeighborChange(par2, par3, par4 - 1, this.blockID); -+ } else if (var7 == 4) { -+ par1World.notifyBlocksOfNeighborChange(par2, par3, par4 + 1, this.blockID); -+ } else if (var7 != 5 && var7 != 6) { -+ if (var7 == 0 || var7 == 7) { -+ par1World.notifyBlocksOfNeighborChange(par2, par3 + 1, par4, this.blockID); - } - } else { -- var1.notifyBlocksOfNeighborChange(var2, var3 - 1, var4, this.blockID); -+ par1World.notifyBlocksOfNeighborChange(par2, par3 - 1, par4, this.blockID); - } - } - -- super.breakBlock(var1, var2, var3, var4, var5, var6); -- } -- -- public int isProvidingWeakPower(IBlockAccess var1, int var2, int var3, int var4, int var5) { -- return (var1.getBlockMetadata(var2, var3, var4) & 8) > 0 ? 15 : 0; -- } -- -- public int isProvidingStrongPower(IBlockAccess var1, int var2, int var3, int var4, int var5) { -- int var6 = var1.getBlockMetadata(var2, var3, var4); -- if((var6 & 8) == 0) { -+ super.breakBlock(par1World, par2, par3, par4, par5, par6); -+ } -+ -+ /** -+ * Returns true if the block is emitting indirect/weak redstone power on the specified side. If isBlockNormalCube -+ * returns true, standard redstone propagation rules will apply instead and this will not be called. Args: World, X, Y, -+ * Z, side. Note that the side is reversed - eg it is 1 (up) when checking the bottom of the block. -+ */ -+ public int isProvidingWeakPower(IBlockAccess par1IBlockAccess, int par2, int par3, int par4, int par5) { -+ return (par1IBlockAccess.getBlockMetadata(par2, par3, par4) & 8) > 0 ? 15 : 0; -+ } -+ -+ /** -+ * Returns true if the block is emitting direct/strong redstone power on the specified side. Args: World, X, Y, Z, -+ * side. Note that the side is reversed - eg it is 1 (up) when checking the bottom of the block. -+ */ -+ public int isProvidingStrongPower(IBlockAccess par1IBlockAccess, int par2, int par3, int par4, int par5) { -+ int var6 = par1IBlockAccess.getBlockMetadata(par2, par3, par4); -+ -+ if ((var6 & 8) == 0) { - return 0; - } else { - int var7 = var6 & 7; -- return var7 == 0 && var5 == 0 ? 15 : (var7 == 7 && var5 == 0 ? 15 : (var7 == 6 && var5 == 1 ? 15 : (var7 == 5 && var5 == 1 ? 15 : (var7 == 4 && var5 == 2 ? 15 : (var7 == 3 && var5 == 3 ? 15 : (var7 == 2 && var5 == 4 ? 15 : (var7 == 1 && var5 == 5 ? 15 : 0))))))); -+ return var7 == 0 && par5 == 0 ? 15 : (var7 == 7 && par5 == 0 ? 15 : (var7 == 6 && par5 == 1 ? 15 : (var7 == 5 && par5 == 1 ? 15 : (var7 == 4 && par5 == 2 ? 15 : (var7 == 3 && par5 == 3 ? 15 : (var7 == 2 && par5 == 4 ? 15 : (var7 == 1 && par5 == 5 ? 15 : 0))))))); - } - } - -+ /** -+ * Can this block provide power. Only wire currently seems to have this change based on its state. -+ */ - public boolean canProvidePower() { - return true; - } ---- net/minecraft/src/ModelHorse.java -+++ net/minecraft/src/ModelHorse.java -@@ -134,11 +134,11 @@ - this.field_110687_G = new ModelRenderer(this, 0, 34); - this.field_110687_G.addBox(-3.0F, 0.0F, 0.0F, 8, 8, 3); - this.field_110687_G.setRotationPoint(-7.5F, 3.0F, 10.0F); -- this.func_110682_a(this.field_110687_G, 0.0F, 1.570796F, 0.0F); -+ this.func_110682_a(this.field_110687_G, 0.0F, ((float)Math.PI / 2F), 0.0F); - this.field_110695_H = new ModelRenderer(this, 0, 47); - this.field_110695_H.addBox(-3.0F, 0.0F, 0.0F, 8, 8, 3); - this.field_110695_H.setRotationPoint(4.5F, 3.0F, 10.0F); -- this.func_110682_a(this.field_110695_H, 0.0F, 1.570796F, 0.0F); -+ this.func_110682_a(this.field_110695_H, 0.0F, ((float)Math.PI / 2F), 0.0F); - this.field_110696_I = new ModelRenderer(this, 80, 0); - this.field_110696_I.addBox(-5.0F, 0.0F, -3.0F, 10, 1, 8); - this.field_110696_I.setRotationPoint(0.0F, 2.0F, 2.0F); -@@ -184,8 +184,11 @@ - this.func_110682_a(this.field_110717_i, 0.5235988F, 0.0F, 0.0F); - } - -- public void render(Entity var1, float var2, float var3, float var4, float var5, float var6, float var7) { -- EntityHorse var8 = (EntityHorse)var1; -+ /** -+ * Sets the models various rotation angles then renders the model. -+ */ -+ public void render(Entity par1Entity, float par2, float par3, float par4, float par5, float par6, float par7) { -+ EntityHorse var8 = (EntityHorse)par1Entity; - int var9 = var8.getHorseType(); - float var10 = var8.getGrassEatingAmount(0.0F); - boolean var11 = var8.isAdultHorse(); -@@ -194,134 +197,146 @@ - boolean var14 = var9 == 1 || var9 == 2; - float var15 = var8.getHorseSize(); - boolean var16 = var8.riddenByEntity != null; -- if(var12) { -- this.field_110717_i.render(var7); -- this.field_110696_I.render(var7); -- this.field_110697_J.render(var7); -- this.field_110698_K.render(var7); -- this.field_110691_L.render(var7); -- this.field_110692_M.render(var7); -- this.field_110693_N.render(var7); -- this.field_110694_O.render(var7); -- this.field_110700_P.render(var7); -- this.field_110699_Q.render(var7); -- if(var16) { -- this.field_110702_R.render(var7); -- this.field_110701_S.render(var7); -+ -+ if (var12) { -+ this.field_110717_i.render(par7); -+ this.field_110696_I.render(par7); -+ this.field_110697_J.render(par7); -+ this.field_110698_K.render(par7); -+ this.field_110691_L.render(par7); -+ this.field_110692_M.render(par7); -+ this.field_110693_N.render(par7); -+ this.field_110694_O.render(par7); -+ this.field_110700_P.render(par7); -+ this.field_110699_Q.render(par7); -+ -+ if (var16) { -+ this.field_110702_R.render(par7); -+ this.field_110701_S.render(par7); - } - } - -- if(!var11) { -+ if (!var11) { - GL11.glPushMatrix(); - GL11.glScalef(var15, 0.5F + var15 * 0.5F, var15); - GL11.glTranslatef(0.0F, 0.95F * (1.0F - var15), 0.0F); - } - -- this.backLeftLeg.render(var7); -- this.backLeftShin.render(var7); -- this.backLeftHoof.render(var7); -- this.backRightLeg.render(var7); -- this.backRightShin.render(var7); -- this.backRightHoof.render(var7); -- this.frontRightLeg.render(var7); -- this.frontLeftShin.render(var7); -- this.frontLeftHoof.render(var7); -- this.field_110684_D.render(var7); -- this.frontRightShin.render(var7); -- this.frontRightHoof.render(var7); -- if(!var11) { -+ this.backLeftLeg.render(par7); -+ this.backLeftShin.render(par7); -+ this.backLeftHoof.render(par7); -+ this.backRightLeg.render(par7); -+ this.backRightShin.render(par7); -+ this.backRightHoof.render(par7); -+ this.frontRightLeg.render(par7); -+ this.frontLeftShin.render(par7); -+ this.frontLeftHoof.render(par7); -+ this.field_110684_D.render(par7); -+ this.frontRightShin.render(par7); -+ this.frontRightHoof.render(par7); -+ -+ if (!var11) { - GL11.glPopMatrix(); - GL11.glPushMatrix(); - GL11.glScalef(var15, var15, var15); - GL11.glTranslatef(0.0F, 1.35F * (1.0F - var15), 0.0F); - } - -- this.body.render(var7); -- this.tailBase.render(var7); -- this.tailMiddle.render(var7); -- this.tailTip.render(var7); -- this.neck.render(var7); -- this.mane.render(var7); -- if(!var11) { -+ this.body.render(par7); -+ this.tailBase.render(par7); -+ this.tailMiddle.render(par7); -+ this.tailTip.render(par7); -+ this.neck.render(par7); -+ this.mane.render(par7); -+ -+ if (!var11) { - GL11.glPopMatrix(); - GL11.glPushMatrix(); - float var17 = 0.5F + var15 * var15 * 0.5F; - GL11.glScalef(var17, var17, var17); -- if(var10 <= 0.0F) { -+ -+ if (var10 <= 0.0F) { - GL11.glTranslatef(0.0F, 1.35F * (1.0F - var15), 0.0F); - } else { - GL11.glTranslatef(0.0F, 0.9F * (1.0F - var15) * var10 + 1.35F * (1.0F - var15) * (1.0F - var10), 0.15F * (1.0F - var15) * var10); - } - } - -- if(var14) { -- this.field_110703_f.render(var7); -- this.field_110704_g.render(var7); -+ if (var14) { -+ this.field_110703_f.render(par7); -+ this.field_110704_g.render(par7); - } else { -- this.horseLeftEar.render(var7); -- this.horseRightEar.render(var7); -+ this.horseLeftEar.render(par7); -+ this.horseRightEar.render(par7); - } - -- this.head.render(var7); -- if(!var11) { -+ this.head.render(par7); -+ -+ if (!var11) { - GL11.glPopMatrix(); - } - -- if(var13) { -- this.field_110687_G.render(var7); -- this.field_110695_H.render(var7); -+ if (var13) { -+ this.field_110687_G.render(par7); -+ this.field_110695_H.render(par7); - } -- -- } -- -- private void func_110682_a(ModelRenderer var1, float var2, float var3, float var4) { -- var1.rotateAngleX = var2; -- var1.rotateAngleY = var3; -- var1.rotateAngleZ = var4; -- } -- -- private float func_110683_a(float var1, float var2, float var3) { -+ } -+ -+ private void func_110682_a(ModelRenderer par1ModelRenderer, float par2, float par3, float par4) { -+ par1ModelRenderer.rotateAngleX = par2; -+ par1ModelRenderer.rotateAngleY = par3; -+ par1ModelRenderer.rotateAngleZ = par4; -+ } -+ -+ private float func_110683_a(float par1, float par2, float par3) { - float var4; -- for(var4 = var2 - var1; var4 < -180.0F; var4 += 360.0F) { -+ -+ for (var4 = par2 - par1; var4 < -180.0F; var4 += 360.0F) { -+ ; - } - -- while(var4 >= 180.0F) { -+ while (var4 >= 180.0F) { - var4 -= 360.0F; - } - -- return var1 + var3 * var4; -+ return par1 + par3 * var4; - } - -- public void setLivingAnimations(EntityLivingBase var1, float var2, float var3, float var4) { -- super.setLivingAnimations(var1, var2, var3, var4); -- float var5 = this.func_110683_a(var1.prevRenderYawOffset, var1.renderYawOffset, var4); -- float var6 = this.func_110683_a(var1.prevRotationYawHead, var1.rotationYawHead, var4); -- float var7 = var1.prevRotationPitch + (var1.rotationPitch - var1.prevRotationPitch) * var4; -+ /** -+ * Used for easily adding entity-dependent animations. The second and third float params here are the same second and -+ * third as in the setRotationAngles method. -+ */ -+ public void setLivingAnimations(EntityLivingBase par1EntityLivingBase, float par2, float par3, float par4) { -+ super.setLivingAnimations(par1EntityLivingBase, par2, par3, par4); -+ float var5 = this.func_110683_a(par1EntityLivingBase.prevRenderYawOffset, par1EntityLivingBase.renderYawOffset, par4); -+ float var6 = this.func_110683_a(par1EntityLivingBase.prevRotationYawHead, par1EntityLivingBase.rotationYawHead, par4); -+ float var7 = par1EntityLivingBase.prevRotationPitch + (par1EntityLivingBase.rotationPitch - par1EntityLivingBase.prevRotationPitch) * par4; - float var8 = var6 - var5; -- float var9 = var7 / 57.29578F; -- if(var8 > 20.0F) { -+ float var9 = var7 / (180F / (float)Math.PI); -+ -+ if (var8 > 20.0F) { - var8 = 20.0F; - } - -- if(var8 < -20.0F) { -+ if (var8 < -20.0F) { - var8 = -20.0F; - } - -- if(var3 > 0.2F) { -- var9 += MathHelper.cos(var2 * 0.4F) * 0.15F * var3; -+ if (par3 > 0.2F) { -+ var9 += MathHelper.cos(par2 * 0.4F) * 0.15F * par3; - } - -- EntityHorse var10 = (EntityHorse)var1; -- float var11 = var10.getGrassEatingAmount(var4); -- float var12 = var10.getRearingAmount(var4); -+ EntityHorse var10 = (EntityHorse)par1EntityLivingBase; -+ float var11 = var10.getGrassEatingAmount(par4); -+ float var12 = var10.getRearingAmount(par4); - float var13 = 1.0F - var12; -- float var14 = var10.func_110201_q(var4); -+ float var14 = var10.func_110201_q(par4); - boolean var15 = var10.field_110278_bp != 0; - boolean var16 = var10.isHorseSaddled(); - boolean var17 = var10.riddenByEntity != null; -- float var18 = (float)var1.ticksExisted + var4; -- float var19 = MathHelper.cos(var2 * 0.6662F + 3.141593F); -- float var20 = var19 * 0.8F * var3; -+ float var18 = (float)par1EntityLivingBase.ticksExisted + par4; -+ float var19 = MathHelper.cos(par2 * 0.6662F + (float)Math.PI); -+ float var20 = var19 * 0.8F * par3; - this.head.rotationPointY = 4.0F; - this.head.rotationPointZ = -10.0F; - this.tailBase.rotationPointY = 3.0F; -@@ -330,16 +345,16 @@ - this.field_110695_H.rotationPointZ = 10.0F; - this.body.rotateAngleX = 0.0F; - this.head.rotateAngleX = 0.5235988F + var9; -- this.head.rotateAngleY = var8 / 57.29578F; -+ this.head.rotateAngleY = var8 / (180F / (float)Math.PI); - this.head.rotateAngleX = var12 * (0.2617994F + var9) + var11 * 2.18166F + (1.0F - Math.max(var12, var11)) * this.head.rotateAngleX; -- this.head.rotateAngleY = var12 * (var8 / 57.29578F) + (1.0F - Math.max(var12, var11)) * this.head.rotateAngleY; -+ this.head.rotateAngleY = var12 * (var8 / (180F / (float)Math.PI)) + (1.0F - Math.max(var12, var11)) * this.head.rotateAngleY; - this.head.rotationPointY = var12 * -6.0F + var11 * 11.0F + (1.0F - Math.max(var12, var11)) * this.head.rotationPointY; - this.head.rotationPointZ = var12 * -1.0F + var11 * -10.0F + (1.0F - Math.max(var12, var11)) * this.head.rotationPointZ; - this.tailBase.rotationPointY = var12 * 9.0F + var13 * this.tailBase.rotationPointY; - this.tailMiddle.rotationPointZ = var12 * 18.0F + var13 * this.tailMiddle.rotationPointZ; - this.field_110695_H.rotationPointY = var12 * 5.5F + var13 * this.field_110695_H.rotationPointY; - this.field_110695_H.rotationPointZ = var12 * 15.0F + var13 * this.field_110695_H.rotationPointZ; -- this.body.rotateAngleX = var12 * -0.7853981F + var13 * this.body.rotateAngleX; -+ this.body.rotateAngleX = var12 * -((float)Math.PI / 4F) + var13 * this.body.rotateAngleX; - this.horseLeftEar.rotationPointY = this.head.rotationPointY; - this.horseRightEar.rotationPointY = this.head.rotationPointY; - this.field_110703_f.rotationPointY = this.head.rotationPointY; -@@ -361,8 +376,8 @@ - this.field_110703_f.rotateAngleX = this.head.rotateAngleX; - this.field_110704_g.rotateAngleX = this.head.rotateAngleX; - this.neck.rotateAngleX = this.head.rotateAngleX; -- this.mouthTop.rotateAngleX = 0.0F - (float)Math.PI * 0.03F * var14; -- this.mouthBottom.rotateAngleX = 0.0F + (float)Math.PI * 0.05F * var14; -+ this.mouthTop.rotateAngleX = 0.0F - 0.09424778F * var14; -+ this.mouthBottom.rotateAngleX = 0.0F + 0.15707964F * var14; - this.mane.rotateAngleX = this.head.rotateAngleX; - this.horseLeftEar.rotateAngleY = this.head.rotateAngleY; - this.horseRightEar.rotateAngleY = this.head.rotateAngleY; -@@ -374,36 +389,36 @@ - this.mane.rotateAngleY = this.head.rotateAngleY; - this.field_110687_G.rotateAngleX = var20 / 5.0F; - this.field_110695_H.rotateAngleX = -var20 / 5.0F; -- float var21 = (float)Math.PI * 0.5F; -- float var22 = (float)Math.PI * 3.0F / 2.0F; -+ float var21 = ((float)Math.PI / 2F); -+ float var22 = ((float)Math.PI * 3F / 2F); - float var23 = -1.0471976F; - float var24 = 0.2617994F * var12; -- float var25 = MathHelper.cos(var18 * 0.6F + 3.141593F); -+ float var25 = MathHelper.cos(var18 * 0.6F + (float)Math.PI); - this.frontRightLeg.rotationPointY = -2.0F * var12 + 9.0F * var13; - this.frontRightLeg.rotationPointZ = -2.0F * var12 + -8.0F * var13; - this.field_110684_D.rotationPointY = this.frontRightLeg.rotationPointY; - this.field_110684_D.rotationPointZ = this.frontRightLeg.rotationPointZ; -- this.backLeftShin.rotationPointY = this.backLeftLeg.rotationPointY + MathHelper.sin((float)Math.PI * 0.5F + var24 + var13 * -var19 * 0.5F * var3) * 7.0F; -- this.backLeftShin.rotationPointZ = this.backLeftLeg.rotationPointZ + MathHelper.cos((float)Math.PI * 3.0F / 2.0F + var24 + var13 * -var19 * 0.5F * var3) * 7.0F; -- this.backRightShin.rotationPointY = this.backRightLeg.rotationPointY + MathHelper.sin((float)Math.PI * 0.5F + var24 + var13 * var19 * 0.5F * var3) * 7.0F; -- this.backRightShin.rotationPointZ = this.backRightLeg.rotationPointZ + MathHelper.cos((float)Math.PI * 3.0F / 2.0F + var24 + var13 * var19 * 0.5F * var3) * 7.0F; -+ this.backLeftShin.rotationPointY = this.backLeftLeg.rotationPointY + MathHelper.sin(((float)Math.PI / 2F) + var24 + var13 * -var19 * 0.5F * par3) * 7.0F; -+ this.backLeftShin.rotationPointZ = this.backLeftLeg.rotationPointZ + MathHelper.cos(((float)Math.PI * 3F / 2F) + var24 + var13 * -var19 * 0.5F * par3) * 7.0F; -+ this.backRightShin.rotationPointY = this.backRightLeg.rotationPointY + MathHelper.sin(((float)Math.PI / 2F) + var24 + var13 * var19 * 0.5F * par3) * 7.0F; -+ this.backRightShin.rotationPointZ = this.backRightLeg.rotationPointZ + MathHelper.cos(((float)Math.PI * 3F / 2F) + var24 + var13 * var19 * 0.5F * par3) * 7.0F; - float var26 = (-1.0471976F + var25) * var12 + var20 * var13; - float var27 = (-1.0471976F + -var25) * var12 + -var20 * var13; -- this.frontLeftShin.rotationPointY = this.frontRightLeg.rotationPointY + MathHelper.sin((float)Math.PI * 0.5F + var26) * 7.0F; -- this.frontLeftShin.rotationPointZ = this.frontRightLeg.rotationPointZ + MathHelper.cos((float)Math.PI * 3.0F / 2.0F + var26) * 7.0F; -- this.frontRightShin.rotationPointY = this.field_110684_D.rotationPointY + MathHelper.sin((float)Math.PI * 0.5F + var27) * 7.0F; -- this.frontRightShin.rotationPointZ = this.field_110684_D.rotationPointZ + MathHelper.cos((float)Math.PI * 3.0F / 2.0F + var27) * 7.0F; -- this.backLeftLeg.rotateAngleX = var24 + -var19 * 0.5F * var3 * var13; -- this.backLeftShin.rotateAngleX = -0.08726646F * var12 + (-var19 * 0.5F * var3 - Math.max(0.0F, var19 * 0.5F * var3)) * var13; -+ this.frontLeftShin.rotationPointY = this.frontRightLeg.rotationPointY + MathHelper.sin(((float)Math.PI / 2F) + var26) * 7.0F; -+ this.frontLeftShin.rotationPointZ = this.frontRightLeg.rotationPointZ + MathHelper.cos(((float)Math.PI * 3F / 2F) + var26) * 7.0F; -+ this.frontRightShin.rotationPointY = this.field_110684_D.rotationPointY + MathHelper.sin(((float)Math.PI / 2F) + var27) * 7.0F; -+ this.frontRightShin.rotationPointZ = this.field_110684_D.rotationPointZ + MathHelper.cos(((float)Math.PI * 3F / 2F) + var27) * 7.0F; -+ this.backLeftLeg.rotateAngleX = var24 + -var19 * 0.5F * par3 * var13; -+ this.backLeftShin.rotateAngleX = -0.08726646F * var12 + (-var19 * 0.5F * par3 - Math.max(0.0F, var19 * 0.5F * par3)) * var13; - this.backLeftHoof.rotateAngleX = this.backLeftShin.rotateAngleX; -- this.backRightLeg.rotateAngleX = var24 + var19 * 0.5F * var3 * var13; -- this.backRightShin.rotateAngleX = -0.08726646F * var12 + (var19 * 0.5F * var3 - Math.max(0.0F, -var19 * 0.5F * var3)) * var13; -+ this.backRightLeg.rotateAngleX = var24 + var19 * 0.5F * par3 * var13; -+ this.backRightShin.rotateAngleX = -0.08726646F * var12 + (var19 * 0.5F * par3 - Math.max(0.0F, -var19 * 0.5F * par3)) * var13; - this.backRightHoof.rotateAngleX = this.backRightShin.rotateAngleX; - this.frontRightLeg.rotateAngleX = var26; -- this.frontLeftShin.rotateAngleX = (this.frontRightLeg.rotateAngleX + (float)Math.PI * Math.max(0.0F, 0.2F + var25 * 0.2F)) * var12 + (var20 + Math.max(0.0F, var19 * 0.5F * var3)) * var13; -+ this.frontLeftShin.rotateAngleX = (this.frontRightLeg.rotateAngleX + (float)Math.PI * Math.max(0.0F, 0.2F + var25 * 0.2F)) * var12 + (var20 + Math.max(0.0F, var19 * 0.5F * par3)) * var13; - this.frontLeftHoof.rotateAngleX = this.frontLeftShin.rotateAngleX; - this.field_110684_D.rotateAngleX = var27; -- this.frontRightShin.rotateAngleX = (this.field_110684_D.rotateAngleX + (float)Math.PI * Math.max(0.0F, 0.2F - var25 * 0.2F)) * var12 + (-var20 + Math.max(0.0F, -var19 * 0.5F * var3)) * var13; -+ this.frontRightShin.rotateAngleX = (this.field_110684_D.rotateAngleX + (float)Math.PI * Math.max(0.0F, 0.2F - var25 * 0.2F)) * var12 + (-var20 + Math.max(0.0F, -var19 * 0.5F * par3)) * var13; - this.frontRightHoof.rotateAngleX = this.frontRightShin.rotateAngleX; - this.backLeftHoof.rotationPointY = this.backLeftShin.rotationPointY; - this.backLeftHoof.rotationPointZ = this.backLeftShin.rotationPointZ; -@@ -413,7 +428,8 @@ - this.frontLeftHoof.rotationPointZ = this.frontLeftShin.rotationPointZ; - this.frontRightHoof.rotationPointY = this.frontRightShin.rotationPointY; - this.frontRightHoof.rotationPointZ = this.frontRightShin.rotationPointZ; -- if(var16) { -+ -+ if (var16) { - this.field_110696_I.rotationPointY = var12 * 0.5F + var13 * 2.0F; - this.field_110696_I.rotationPointZ = var12 * 11.0F + var13 * 2.0F; - this.field_110697_J.rotationPointY = this.field_110696_I.rotationPointY; -@@ -453,7 +469,8 @@ - this.field_110702_R.rotateAngleY = this.head.rotateAngleY; - this.field_110699_Q.rotateAngleY = this.head.rotateAngleY; - this.field_110701_S.rotateAngleY = this.head.rotateAngleY; -- if(var17) { -+ -+ if (var17) { - this.field_110691_L.rotateAngleX = -1.0471976F; - this.field_110692_M.rotateAngleX = -1.0471976F; - this.field_110693_N.rotateAngleX = -1.0471976F; -@@ -474,12 +491,13 @@ - } - } - -- var21 = -1.3089F + var3 * 1.5F; -- if(var21 > 0.0F) { -+ var21 = -1.3089F + par3 * 1.5F; -+ -+ if (var21 > 0.0F) { - var21 = 0.0F; - } - -- if(var15) { -+ if (var15) { - this.tailBase.rotateAngleY = MathHelper.cos(var18 * 0.7F); - var21 = 0.0F; - } else { ---- /dev/null -+++ org/spoutcraft/client/packet/PacketKeyPress.java -@@ -1,0 +1,104 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.client.packet; -+ -+import java.io.IOException; -+ -+import net.minecraft.src.MovementInputFromOptions; -+ -+import org.spoutcraft.api.gui.ScreenType; -+import org.spoutcraft.api.io.SpoutInputStream; -+import org.spoutcraft.api.io.SpoutOutputStream; -+ -+public class PacketKeyPress implements SpoutPacket { -+ public boolean pressDown; -+ public int key; -+ public byte settingKeys[] = new byte[10]; -+ public int screenType = -1; -+ public PacketKeyPress() { -+ } -+ -+ public PacketKeyPress(int key, boolean pressDown, MovementInputFromOptions input) { -+ this.key = key; -+ this.pressDown = pressDown; -+ this.settingKeys[0] = (byte)input.gameSettings.keyBindForward.keyCode; -+ this.settingKeys[1] = (byte)input.gameSettings.keyBindLeft.keyCode; -+ this.settingKeys[2] = (byte)input.gameSettings.keyBindBack.keyCode; -+ this.settingKeys[3] = (byte)input.gameSettings.keyBindRight.keyCode; -+ this.settingKeys[4] = (byte)input.gameSettings.keyBindJump.keyCode; -+ this.settingKeys[5] = (byte)input.gameSettings.keyBindInventory.keyCode; -+ this.settingKeys[6] = (byte)input.gameSettings.keyBindDrop.keyCode; -+ this.settingKeys[7] = (byte)input.gameSettings.keyBindChat.keyCode; -+ this.settingKeys[8] = (byte)input.gameSettings.keyBindToggleFog.keyCode; -+ this.settingKeys[9] = (byte)input.gameSettings.keyBindSneak.keyCode; -+ } -+ -+ public PacketKeyPress(int key, boolean pressDown, MovementInputFromOptions input, ScreenType type) { -+ this.key = key; -+ this.pressDown = pressDown; -+ this.settingKeys[0] = (byte)input.gameSettings.keyBindForward.keyCode; -+ this.settingKeys[1] = (byte)input.gameSettings.keyBindLeft.keyCode; -+ this.settingKeys[2] = (byte)input.gameSettings.keyBindBack.keyCode; -+ this.settingKeys[3] = (byte)input.gameSettings.keyBindRight.keyCode; -+ this.settingKeys[4] = (byte)input.gameSettings.keyBindJump.keyCode; -+ this.settingKeys[5] = (byte)input.gameSettings.keyBindInventory.keyCode; -+ this.settingKeys[6] = (byte)input.gameSettings.keyBindDrop.keyCode; -+ this.settingKeys[7] = (byte)input.gameSettings.keyBindChat.keyCode; -+ this.settingKeys[8] = (byte)input.gameSettings.keyBindToggleFog.keyCode; -+ this.settingKeys[9] = (byte)input.gameSettings.keyBindSneak.keyCode; -+ this.screenType = type.getCode(); -+ } -+ -+ public void readData(SpoutInputStream datainputstream) throws IOException { -+ this.key = datainputstream.readInt(); -+ this.pressDown = datainputstream.readBoolean(); -+ this.screenType = datainputstream.readInt(); -+ for (int i = 0; i < 10; i++) { -+ this.settingKeys[i] = (byte) datainputstream.read(); -+ } -+ } -+ -+ public void writeData(SpoutOutputStream dataoutputstream) throws IOException { -+ dataoutputstream.writeInt(this.key); -+ dataoutputstream.writeBoolean(this.pressDown); -+ dataoutputstream.writeInt(this.screenType); -+ for (int i = 0; i < 10; i++) { -+ dataoutputstream.write(this.settingKeys[i]); -+ } -+ } -+ -+ public void run(int id) { -+ } -+ -+ public int getNumBytes() { -+ return 4 + 1 + 4 + 10; -+ } -+ -+ public PacketType getPacketType() { -+ return PacketType.PacketKeyPress; -+ } -+ -+ public int getVersion() { -+ return 1; -+ } -+ -+ public void failure(int playerId) { -+ } -+} ---- net/minecraft/src/LanServer.java -+++ net/minecraft/src/LanServer.java -@@ -1,24 +1,29 @@ - package net.minecraft.src; - - public class LanServer { -- private String a; -- private String b; -+ private String lanServerMotd; -+ private String lanServerIpPort; -+ -+ /** Last time this LanServer was seen. */ - private long timeLastSeen; - -- public LanServer(String var1, String var2) { -- this.a = var1; -- this.b = var2; -+ public LanServer(String par1Str, String par2Str) { -+ this.lanServerMotd = par1Str; -+ this.lanServerIpPort = par2Str; - this.timeLastSeen = Minecraft.getSystemTime(); - } - - public String getServerMotd() { -- return this.a; -+ return this.lanServerMotd; - } - - public String getServerIpPort() { -- return this.b; -+ return this.lanServerIpPort; - } - -+ /** -+ * Updates the time this LanServer was last seen. -+ */ - public void updateLastSeen() { - this.timeLastSeen = Minecraft.getSystemTime(); - } ---- net/minecraft/src/IRecipe.java -+++ net/minecraft/src/IRecipe.java -@@ -1,10 +1,20 @@ - package net.minecraft.src; - - public interface IRecipe { -+ -+ /** -+ * Used to check if a recipe matches current crafting inventory -+ */ - boolean matches(InventoryCrafting var1, World var2); - -+ /** -+ * Returns an Item that is the result of this recipe -+ */ - ItemStack getCraftingResult(InventoryCrafting var1); - -+ /** -+ * Returns the size of the recipe area -+ */ - int getRecipeSize(); - - ItemStack getRecipeOutput(); ---- net/minecraft/src/BlockSapling.java -+++ net/minecraft/src/BlockSapling.java -@@ -4,121 +4,143 @@ - import java.util.Random; - - public class BlockSapling extends BlockFlower { -- public static final String[] a = new String[]{"oak", "spruce", "birch", "jungle"}; -+ public static final String[] WOOD_TYPES = new String[] {"oak", "spruce", "birch", "jungle"}; - private Icon[] saplingIcon; - -- protected BlockSapling(int var1) { -- super(var1); -+ protected BlockSapling(int par1) { -+ super(par1); - float var2 = 0.4F; - this.setBlockBounds(0.5F - var2, 0.0F, 0.5F - var2, 0.5F + var2, var2 * 2.0F, 0.5F + var2); - this.setCreativeTab(CreativeTabs.tabDecorations); - } - -- public void updateTick(World var1, int var2, int var3, int var4, Random var5) { -- if(!var1.isRemote) { -- super.updateTick(var1, var2, var3, var4, var5); -- if(var1.getBlockLightValue(var2, var3 + 1, var4) >= 9 && var5.nextInt(7) == 0) { -- this.markOrGrowMarked(var1, var2, var3, var4, var5); -+ /** -+ * Ticks the block if it's been scheduled -+ */ -+ public void updateTick(World par1World, int par2, int par3, int par4, Random par5Random) { -+ if (!par1World.isRemote) { -+ super.updateTick(par1World, par2, par3, par4, par5Random); -+ -+ if (par1World.getBlockLightValue(par2, par3 + 1, par4) >= 9 && par5Random.nextInt(7) == 0) { -+ this.markOrGrowMarked(par1World, par2, par3, par4, par5Random); - } -- - } - } - -- public Icon getIcon(int var1, int var2) { -- var2 &= 3; -- return this.saplingIcon[var2]; -+ /** -+ * From the specified side and block metadata retrieves the blocks texture. Args: side, metadata -+ */ -+ public Icon getIcon(int par1, int par2) { -+ par2 &= 3; -+ return this.saplingIcon[par2]; - } - -- public void markOrGrowMarked(World var1, int var2, int var3, int var4, Random var5) { -- int var6 = var1.getBlockMetadata(var2, var3, var4); -- if((var6 & 8) == 0) { -- var1.setBlockMetadata(var2, var3, var4, var6 | 8, 4); -+ public void markOrGrowMarked(World par1World, int par2, int par3, int par4, Random par5Random) { -+ int var6 = par1World.getBlockMetadata(par2, par3, par4); -+ -+ if ((var6 & 8) == 0) { -+ par1World.setBlockMetadataWithNotify(par2, par3, par4, var6 | 8, 4); - } else { -- this.growTree(var1, var2, var3, var4, var5); -+ this.growTree(par1World, par2, par3, par4, par5Random); - } -- - } - -- public void growTree(World var1, int var2, int var3, int var4, Random var5) { -- int var6 = var1.getBlockMetadata(var2, var3, var4) & 3; -+ /** -+ * Attempts to grow a sapling into a tree -+ */ -+ public void growTree(World par1World, int par2, int par3, int par4, Random par5Random) { -+ int var6 = par1World.getBlockMetadata(par2, par3, par4) & 3; - Object var7 = null; - int var8 = 0; - int var9 = 0; - boolean var10 = false; -- if(var6 == 1) { -+ -+ if (var6 == 1) { - var7 = new WorldGenTaiga2(true); -- } else if(var6 == 2) { -+ } else if (var6 == 2) { - var7 = new WorldGenForest(true); -- } else if(var6 == 3) { -- for(var8 = 0; var8 >= -1; --var8) { -- for(var9 = 0; var9 >= -1; --var9) { -- if(this.isSameSapling(var1, var2 + var8, var3, var4 + var9, 3) && this.isSameSapling(var1, var2 + var8 + 1, var3, var4 + var9, 3) && this.isSameSapling(var1, var2 + var8, var3, var4 + var9 + 1, 3) && this.isSameSapling(var1, var2 + var8 + 1, var3, var4 + var9 + 1, 3)) { -- var7 = new WorldGenHugeTrees(true, 10 + var5.nextInt(20), 3, 3); -+ } else if (var6 == 3) { -+ for (var8 = 0; var8 >= -1; --var8) { -+ for (var9 = 0; var9 >= -1; --var9) { -+ if (this.isSameSapling(par1World, par2 + var8, par3, par4 + var9, 3) && this.isSameSapling(par1World, par2 + var8 + 1, par3, par4 + var9, 3) && this.isSameSapling(par1World, par2 + var8, par3, par4 + var9 + 1, 3) && this.isSameSapling(par1World, par2 + var8 + 1, par3, par4 + var9 + 1, 3)) { -+ var7 = new WorldGenHugeTrees(true, 10 + par5Random.nextInt(20), 3, 3); - var10 = true; - break; - } - } - -- if(var7 != null) { -+ if (var7 != null) { - break; - } - } - -- if(var7 == null) { -+ if (var7 == null) { - var9 = 0; -- var8 = var9; -- var7 = new WorldGenTrees(true, 4 + var5.nextInt(7), 3, 3, false); -+ var8 = 0; -+ var7 = new WorldGenTrees(true, 4 + par5Random.nextInt(7), 3, 3, false); - } - } else { - var7 = new WorldGenTrees(true); -- if(var5.nextInt(10) == 0) { -+ -+ if (par5Random.nextInt(10) == 0) { - var7 = new WorldGenBigTree(true); - } - } - -- if(var10) { -- var1.setBlock(var2 + var8, var3, var4 + var9, 0, 0, 4); -- var1.setBlock(var2 + var8 + 1, var3, var4 + var9, 0, 0, 4); -- var1.setBlock(var2 + var8, var3, var4 + var9 + 1, 0, 0, 4); -- var1.setBlock(var2 + var8 + 1, var3, var4 + var9 + 1, 0, 0, 4); -+ if (var10) { -+ par1World.setBlock(par2 + var8, par3, par4 + var9, 0, 0, 4); -+ par1World.setBlock(par2 + var8 + 1, par3, par4 + var9, 0, 0, 4); -+ par1World.setBlock(par2 + var8, par3, par4 + var9 + 1, 0, 0, 4); -+ par1World.setBlock(par2 + var8 + 1, par3, par4 + var9 + 1, 0, 0, 4); - } else { -- var1.setBlock(var2, var3, var4, 0, 0, 4); -+ par1World.setBlock(par2, par3, par4, 0, 0, 4); - } - -- if(!((WorldGenerator)var7).generate(var1, var5, var2 + var8, var3, var4 + var9)) { -- if(var10) { -- var1.setBlock(var2 + var8, var3, var4 + var9, this.blockID, var6, 4); -- var1.setBlock(var2 + var8 + 1, var3, var4 + var9, this.blockID, var6, 4); -- var1.setBlock(var2 + var8, var3, var4 + var9 + 1, this.blockID, var6, 4); -- var1.setBlock(var2 + var8 + 1, var3, var4 + var9 + 1, this.blockID, var6, 4); -+ if (!((WorldGenerator)var7).generate(par1World, par5Random, par2 + var8, par3, par4 + var9)) { -+ if (var10) { -+ par1World.setBlock(par2 + var8, par3, par4 + var9, this.blockID, var6, 4); -+ par1World.setBlock(par2 + var8 + 1, par3, par4 + var9, this.blockID, var6, 4); -+ par1World.setBlock(par2 + var8, par3, par4 + var9 + 1, this.blockID, var6, 4); -+ par1World.setBlock(par2 + var8 + 1, par3, par4 + var9 + 1, this.blockID, var6, 4); - } else { -- var1.setBlock(var2, var3, var4, this.blockID, var6, 4); -+ par1World.setBlock(par2, par3, par4, this.blockID, var6, 4); - } - } -- -- } -- -- public boolean isSameSapling(World var1, int var2, int var3, int var4, int var5) { -- return var1.getBlockId(var2, var3, var4) == this.blockID && (var1.getBlockMetadata(var2, var3, var4) & 3) == var5; -- } -- -- public int damageDropped(int var1) { -- return var1 & 3; -- } -- -- public void getSubBlocks(int var1, CreativeTabs var2, List var3) { -- var3.add(new ItemStack(var1, 1, 0)); -- var3.add(new ItemStack(var1, 1, 1)); -- var3.add(new ItemStack(var1, 1, 2)); -- var3.add(new ItemStack(var1, 1, 3)); -- } -- -- public void registerIcons(IconRegister var1) { -- this.saplingIcon = new Icon[a.length]; -- -- for(int var2 = 0; var2 < this.saplingIcon.length; ++var2) { -- this.saplingIcon[var2] = var1.registerIcon(this.getTextureName() + "_" + a[var2]); -+ } -+ -+ /** -+ * Determines if the same sapling is present at the given location. -+ */ -+ public boolean isSameSapling(World par1World, int par2, int par3, int par4, int par5) { -+ return par1World.getBlockId(par2, par3, par4) == this.blockID && (par1World.getBlockMetadata(par2, par3, par4) & 3) == par5; -+ } -+ -+ /** -+ * Determines the damage on the item the block drops. Used in cloth and wood. -+ */ -+ public int damageDropped(int par1) { -+ return par1 & 3; -+ } -+ -+ /** -+ * returns a list of blocks with the same ID, but different meta (eg: wood returns 4 blocks) -+ */ -+ public void getSubBlocks(int par1, CreativeTabs par2CreativeTabs, List par3List) { -+ par3List.add(new ItemStack(par1, 1, 0)); -+ par3List.add(new ItemStack(par1, 1, 1)); -+ par3List.add(new ItemStack(par1, 1, 2)); -+ par3List.add(new ItemStack(par1, 1, 3)); -+ } -+ -+ /** -+ * When this method is called, your block should register all the icons it needs with the given IconRegister. This is -+ * the only chance you get to register icons. -+ */ -+ public void registerIcons(IconRegister par1IconRegister) { -+ this.saplingIcon = new Icon[WOOD_TYPES.length]; -+ -+ for (int var2 = 0; var2 < this.saplingIcon.length; ++var2) { -+ this.saplingIcon[var2] = par1IconRegister.registerIcon(this.getTextureName() + "_" + WOOD_TYPES[var2]); - } -- - } - } ---- /dev/null -+++ org/spoutcraft/client/packet/PacketWidgetRemove.java -@@ -1,0 +1,80 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.client.packet; -+ -+import java.io.IOException; -+import java.util.UUID; -+ -+import org.spoutcraft.api.gui.InGameHUD; -+import org.spoutcraft.api.gui.PopupScreen; -+import org.spoutcraft.api.gui.Screen; -+import org.spoutcraft.api.gui.Widget; -+import org.spoutcraft.api.io.SpoutInputStream; -+import org.spoutcraft.api.io.SpoutOutputStream; -+import org.spoutcraft.client.SpoutClient; -+ -+public class PacketWidgetRemove implements SpoutPacket { -+ protected UUID screen; -+ protected UUID widget; -+ -+ public PacketWidgetRemove() { -+ } -+ -+ public PacketWidgetRemove(Widget widget, UUID screen) { -+ this.widget = widget.getId(); -+ } -+ -+ public void readData(SpoutInputStream input) throws IOException { -+ widget = input.readUUID(); -+ } -+ -+ public void writeData(SpoutOutputStream output) throws IOException { -+ output.writeUUID(widget); -+ } -+ -+ public void run(int playerId) { -+ InGameHUD mainScreen = SpoutClient.getInstance().getActivePlayer().getMainScreen(); -+ PopupScreen popup = mainScreen.getActivePopup(); -+ -+ Widget w = PacketWidget.allWidgets.get(widget); -+ -+ if (w != null && w.getScreen() != null && !(w instanceof Screen)) { -+ w.getScreen().removeWidget(w); -+ } -+ -+ if (w instanceof PopupScreen && popup.getId().equals(w.getId())) { -+ // Determine if this is a popup screen and if we need to update it -+ mainScreen.closePopup(); -+ } -+ -+ PacketWidget.allWidgets.remove(widget); -+ } -+ -+ public PacketType getPacketType() { -+ return PacketType.PacketWidgetRemove; -+ } -+ -+ public int getVersion() { -+ return 1; -+ } -+ -+ public void failure(int playerId) { -+ } -+} ---- /dev/null -+++ org/spoutcraft/api/gui/EntityWidget.java -@@ -1,0 +1,38 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.api.gui; -+ -+import org.spoutcraft.api.UnsafeClass; -+ -+@UnsafeClass -+public interface EntityWidget extends Widget { -+ /** -+ * Sets the id of this entity -+ * @param id of the entity -+ * @return this -+ */ -+ public EntityWidget setEntityId(int id); -+ -+ /** -+ * Gets the id of this entity -+ * @return the id of this entity -+ */ -+ public int getEntityId(); -+} ---- net/minecraft/src/EnchantmentLootBonus.java -+++ net/minecraft/src/EnchantmentLootBonus.java -@@ -1,28 +1,40 @@ - package net.minecraft.src; - - public class EnchantmentLootBonus extends Enchantment { -- protected EnchantmentLootBonus(int var1, int var2, EnumEnchantmentType var3) { -- super(var1, var2, var3); -+ protected EnchantmentLootBonus(int par1, int par2, EnumEnchantmentType par3EnumEnchantmentType) { -+ super(par1, par2, par3EnumEnchantmentType); - this.setName("lootBonus"); -- if(var3 == EnumEnchantmentType.digger) { -+ -+ if (par3EnumEnchantmentType == EnumEnchantmentType.digger) { - this.setName("lootBonusDigger"); - } -- -- } -- -- public int getMinEnchantability(int var1) { -- return 15 + (var1 - 1) * 9; -- } -- -- public int getMaxEnchantability(int var1) { -- return super.getMinEnchantability(var1) + 50; -- } -- -+ } -+ -+ /** -+ * Returns the minimal value of enchantability needed on the enchantment level passed. -+ */ -+ public int getMinEnchantability(int par1) { -+ return 15 + (par1 - 1) * 9; -+ } -+ -+ /** -+ * Returns the maximum value of enchantability nedded on the enchantment level passed. -+ */ -+ public int getMaxEnchantability(int par1) { -+ return super.getMinEnchantability(par1) + 50; -+ } -+ -+ /** -+ * Returns the maximum level that the enchantment can have. -+ */ - public int getMaxLevel() { - return 3; - } - -- public boolean canApplyTogether(Enchantment var1) { -- return super.canApplyTogether(var1) && var1.effectId != silkTouch.effectId; -+ /** -+ * Determines if the enchantment passed can be applyied together with this enchantment. -+ */ -+ public boolean canApplyTogether(Enchantment par1Enchantment) { -+ return super.canApplyTogether(par1Enchantment) && par1Enchantment.effectId != silkTouch.effectId; - } - } ---- net/minecraft/src/RenderIronGolem.java -+++ net/minecraft/src/RenderIronGolem.java -@@ -5,41 +5,55 @@ - - public class RenderIronGolem extends RenderLiving { - private static final ResourceLocation ironGolemTextures = new ResourceLocation("textures/entity/iron_golem.png"); -- private final ModelIronGolem ironGolemModel = (ModelIronGolem)this.mainModel; -+ -+ /** Iron Golem's Model. */ -+ private final ModelIronGolem ironGolemModel; - - public RenderIronGolem() { - super(new ModelIronGolem(), 0.5F); -- } -- -- public void doRenderIronGolem(EntityIronGolem var1, double var2, double var4, double var6, float var8, float var9) { -- super.doRenderLiving(var1, var2, var4, var6, var8, var9); -- } -- -- protected ResourceLocation getIronGolemTextures(EntityIronGolem var1) { -+ this.ironGolemModel = (ModelIronGolem)this.mainModel; -+ } -+ -+ /** -+ * Renders the Iron Golem. -+ */ -+ public void doRenderIronGolem(EntityIronGolem par1EntityIronGolem, double par2, double par4, double par6, float par8, float par9) { -+ super.doRenderLiving(par1EntityIronGolem, par2, par4, par6, par8, par9); -+ } -+ -+ protected ResourceLocation getIronGolemTextures(EntityIronGolem par1EntityIronGolem) { - return ironGolemTextures; - } - -- protected void rotateIronGolemCorpse(EntityIronGolem var1, float var2, float var3, float var4) { -- super.rotateCorpse(var1, var2, var3, var4); -- if((double)var1.limbSwingAmount >= 0.01D) { -+ /** -+ * Rotates Iron Golem corpse. -+ */ -+ protected void rotateIronGolemCorpse(EntityIronGolem par1EntityIronGolem, float par2, float par3, float par4) { -+ super.rotateCorpse(par1EntityIronGolem, par2, par3, par4); -+ -+ if ((double)par1EntityIronGolem.limbSwingAmount >= 0.01D) { - float var5 = 13.0F; -- float var6 = var1.limbSwing - var1.limbSwingAmount * (1.0F - var4) + 6.0F; -+ float var6 = par1EntityIronGolem.limbSwing - par1EntityIronGolem.limbSwingAmount * (1.0F - par4) + 6.0F; - float var7 = (Math.abs(var6 % var5 - var5 * 0.5F) - var5 * 0.25F) / (var5 * 0.25F); - GL11.glRotatef(6.5F * var7, 0.0F, 0.0F, 1.0F); - } - } - -- protected void renderIronGolemEquippedItems(EntityIronGolem var1, float var2) { -- super.renderEquippedItems(var1, var2); -- if(var1.getHoldRoseTick() != 0) { -+ /** -+ * Renders Iron Golem Equipped items. -+ */ -+ protected void renderIronGolemEquippedItems(EntityIronGolem par1EntityIronGolem, float par2) { -+ super.renderEquippedItems(par1EntityIronGolem, par2); -+ -+ if (par1EntityIronGolem.getHoldRoseTick() != 0) { - GL11.glEnable(GL12.GL_RESCALE_NORMAL); - GL11.glPushMatrix(); - GL11.glRotatef(5.0F + 180.0F * this.ironGolemModel.ironGolemRightArm.rotateAngleX / (float)Math.PI, 1.0F, 0.0F, 0.0F); -- GL11.glTranslatef(-(11.0F / 16.0F), 1.25F, -(15.0F / 16.0F)); -+ GL11.glTranslatef(-0.6875F, 1.25F, -0.9375F); - GL11.glRotatef(90.0F, 1.0F, 0.0F, 0.0F); - float var3 = 0.8F; - GL11.glScalef(var3, -var3, var3); -- int var4 = var1.getBrightnessForRender(var2); -+ int var4 = par1EntityIronGolem.getBrightnessForRender(par2); - int var5 = var4 % 65536; - int var6 = var4 / 65536; - OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, (float)var5 / 1.0F, (float)var6 / 1.0F); -@@ -52,27 +66,36 @@ - } - } - -- public void doRenderLiving(EntityLiving var1, double var2, double var4, double var6, float var8, float var9) { -- this.doRenderIronGolem((EntityIronGolem)var1, var2, var4, var6, var8, var9); -- } -- -- protected void renderEquippedItems(EntityLivingBase var1, float var2) { -- this.renderIronGolemEquippedItems((EntityIronGolem)var1, var2); -- } -- -- protected void rotateCorpse(EntityLivingBase var1, float var2, float var3, float var4) { -- this.rotateIronGolemCorpse((EntityIronGolem)var1, var2, var3, var4); -- } -- -- public void renderPlayer(EntityLivingBase var1, double var2, double var4, double var6, float var8, float var9) { -- this.doRenderIronGolem((EntityIronGolem)var1, var2, var4, var6, var8, var9); -- } -- -- protected ResourceLocation getEntityTexture(Entity var1) { -- return this.getIronGolemTextures((EntityIronGolem)var1); -- } -- -- public void doRender(Entity var1, double var2, double var4, double var6, float var8, float var9) { -- this.doRenderIronGolem((EntityIronGolem)var1, var2, var4, var6, var8, var9); -+ public void doRenderLiving(EntityLiving par1EntityLiving, double par2, double par4, double par6, float par8, float par9) { -+ this.doRenderIronGolem((EntityIronGolem)par1EntityLiving, par2, par4, par6, par8, par9); -+ } -+ -+ protected void renderEquippedItems(EntityLivingBase par1EntityLivingBase, float par2) { -+ this.renderIronGolemEquippedItems((EntityIronGolem)par1EntityLivingBase, par2); -+ } -+ -+ protected void rotateCorpse(EntityLivingBase par1EntityLivingBase, float par2, float par3, float par4) { -+ this.rotateIronGolemCorpse((EntityIronGolem)par1EntityLivingBase, par2, par3, par4); -+ } -+ -+ public void renderPlayer(EntityLivingBase par1EntityLivingBase, double par2, double par4, double par6, float par8, float par9) { -+ this.doRenderIronGolem((EntityIronGolem)par1EntityLivingBase, par2, par4, par6, par8, par9); -+ } -+ -+ /** -+ * Returns the location of an entity's texture. Doesn't seem to be called unless you call Render.bindEntityTexture. -+ */ -+ protected ResourceLocation getEntityTexture(Entity par1Entity) { -+ return this.getIronGolemTextures((EntityIronGolem)par1Entity); -+ } -+ -+ /** -+ * Actually renders the given argument. This is a synthetic bridge method, always casting down its argument and then -+ * handing it off to a worker function which does the actual work. In all probabilty, the class Render is generic -+ * (Render -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.api.material.block; -+ -+import org.spoutcraft.api.material.Liquid; -+ -+public class GenericLiquid extends GenericBlock implements Liquid{ -+ private final boolean flowing; -+ public GenericLiquid(String name, int id, boolean flowing) { -+ super(name, id); -+ this.flowing = flowing; -+ } -+ -+ public boolean isFlowing() { -+ return flowing; -+ } -+} ---- /dev/null -+++ org/spoutcraft/client/gui/minimap/ZanMinimap.java -@@ -1,0 +1,103 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.client.gui.minimap; -+ -+import net.minecraft.src.Minecraft; -+import net.minecraft.src.GuiChat; -+import net.minecraft.src.GuiIngameMenu; -+import net.minecraft.src.GuiSleepMP; -+ -+import org.spoutcraft.api.Spoutcraft; -+import org.spoutcraft.client.SpoutClient; -+import org.spoutcraft.client.gui.settings.GuiAdvancedOptions; -+import org.spoutcraft.client.gui.settings.GuiSimpleOptions; -+ -+/** -+ * Main Zanminimap class where everything happens -+ */ -+public class ZanMinimap { -+ /** -+ * MapCalculator instance, public for things that want to plug into the minimap -+ */ -+ public MapCalculator mapcalc; -+ -+ /** -+ * MapRenderer instance, public for things that want to plug into the minimap -+ */ -+ public MapRenderer renderer; -+ -+ public Map map; -+ -+ public TextureManager texman; -+ -+ /** -+ * Instance, mainly for things that want to plug into the minimap -+ */ -+ public static ZanMinimap instance; -+ -+ public ZanMinimap() { -+ MinimapConfig.initialize(); -+ BlockColor.initDefaultColors(); -+ -+ map = new Map(); -+ texman = new TextureManager(); -+ mapcalc = new MapCalculator(this); -+ renderer = new MapRenderer(this); -+ mapcalc.start(); -+ instance = this; -+ } -+ -+ /** -+ * Heartbeat function called each render by whatever is managing the minimap. -+ * -+ * @param mc Minecraft instance to initialize obfhub.game with -+ */ -+ public void onRenderTick() { -+ if (Minecraft.getMinecraft().thePlayer == null || SpoutClient.getInstance().getRawWorld() == null) { -+ return; -+ } -+ -+ if (Minecraft.getMinecraft().currentScreen != null && !(isTransparentMenu() || isChatMenu())) { -+ return; -+ } -+ -+ if (!MinimapConfig.getInstance().isEnabled()) { -+ return; -+ } -+ -+ if (!Spoutcraft.hasPermission("spout.plugin.minimap")) { -+ return; -+ } -+ -+ int scWidth = Spoutcraft.getRenderDelegate().getScreenWidth(); -+ int scHeight = Spoutcraft.getRenderDelegate().getScreenHeight(); -+ -+ mapcalc.onRenderTick(); -+ renderer.onRenderTick(scWidth, scHeight); -+ } -+ -+ private boolean isTransparentMenu() { -+ return Minecraft.getMinecraft().currentScreen instanceof GuiIngameMenu || Minecraft.getMinecraft().currentScreen instanceof GuiAdvancedOptions || Minecraft.getMinecraft().currentScreen instanceof GuiSimpleOptions || Minecraft.getMinecraft().currentScreen instanceof GuiMinimapMenu || Minecraft.getMinecraft().currentScreen instanceof GuiMoveMinimap; -+ } -+ -+ private boolean isChatMenu() { -+ return Minecraft.getMinecraft().currentScreen instanceof GuiChat || Minecraft.getMinecraft().currentScreen instanceof GuiSleepMP; -+ } -+} ---- net/minecraft/src/LanguageManager.java -+++ net/minecraft/src/LanguageManager.java -@@ -12,32 +12,34 @@ - - public class LanguageManager implements ResourceManagerReloadListener { - private final MetadataSerializer field_135047_b; -- private String c; -+ private String currentLanguage; - protected static final Locale currentLocale = new Locale(); -- private Map d = Maps.newHashMap(); -+ private Map languageMap = Maps.newHashMap(); - -- public LanguageManager(MetadataSerializer var1, String var2) { -- this.field_135047_b = var1; -- this.c = var2; -+ public LanguageManager(MetadataSerializer par1MetadataSerializer, String par2Str) { -+ this.field_135047_b = par1MetadataSerializer; -+ this.currentLanguage = par2Str; - I18n.setLocale(currentLocale); - } - -- public void parseLanguageMetadata(List var1) { -- this.d.clear(); -- Iterator var2 = var1.iterator(); -+ public void parseLanguageMetadata(List par1List) { -+ this.languageMap.clear(); -+ Iterator var2 = par1List.iterator(); - -- while(var2.hasNext()) { -+ while (var2.hasNext()) { - ResourcePack var3 = (ResourcePack)var2.next(); - - try { - LanguageMetadataSection var4 = (LanguageMetadataSection)var3.getPackMetadata(this.field_135047_b, "language"); -- if(var4 != null) { -+ -+ if (var4 != null) { - Iterator var5 = var4.getLanguages().iterator(); - -- while(var5.hasNext()) { -+ while (var5.hasNext()) { - Language var6 = (Language)var5.next(); -- if(!this.d.containsKey(var6.getLanguageCode())) { -- this.d.put(var6.getLanguageCode(), var6); -+ -+ if (!this.languageMap.containsKey(var6.getLanguageCode())) { -+ this.languageMap.put(var6.getLanguageCode(), var6); - } - } - } -@@ -47,17 +49,17 @@ - Minecraft.getMinecraft().getLogAgent().logWarningException("Unable to parse metadata section of resourcepack: " + var3.getPackName(), var8); - } - } -- - } - -- public void onResourceManagerReload(ResourceManager var1) { -- ArrayList var2 = Lists.newArrayList((Object[])(new String[]{"en_US"})); -- if(!"en_US".equals(this.c)) { -- var2.add(this.c); -+ public void onResourceManagerReload(ResourceManager par1ResourceManager) { -+ ArrayList var2 = Lists.newArrayList(new String[] {"en_US"}); -+ -+ if (!"en_US".equals(this.currentLanguage)) { -+ var2.add(this.currentLanguage); - } - -- currentLocale.loadLocaleDataFiles(var1, var2); -- StringTranslate.func_135063_a(currentLocale.a); -+ currentLocale.loadLocaleDataFiles(par1ResourceManager, var2); -+ StringTranslate.func_135063_a(currentLocale.field_135032_a); - } - - public boolean isCurrentLocaleUnicode() { -@@ -68,15 +70,15 @@ - return this.getCurrentLanguage().isBidirectional(); - } - -- public void setCurrentLanguage(Language var1) { -- this.c = var1.getLanguageCode(); -+ public void setCurrentLanguage(Language par1Language) { -+ this.currentLanguage = par1Language.getLanguageCode(); - } - - public Language getCurrentLanguage() { -- return this.d.containsKey(this.c) ? (Language)this.d.get(this.c) : (Language)this.d.get("en_US"); -+ return this.languageMap.containsKey(this.currentLanguage) ? (Language)this.languageMap.get(this.currentLanguage) : (Language)this.languageMap.get("en_US"); - } - - public SortedSet getLanguages() { -- return Sets.newTreeSet((Iterable)this.d.values()); -+ return Sets.newTreeSet(this.languageMap.values()); - } - } ---- net/minecraft/src/ContainerRepairINNER1.java -+++ net/minecraft/src/ContainerRepairINNER1.java -@@ -3,17 +3,23 @@ - class ContainerRepairINNER1 extends InventoryBasic { - final ContainerRepair repairContainer; - -- ContainerRepairINNER1(ContainerRepair var1, String var2, boolean var3, int var4) { -- super(var2, var3, var4); -- this.repairContainer = var1; -+ ContainerRepairINNER1(ContainerRepair par1ContainerRepair, String par2Str, boolean par3, int par4) { -+ super(par2Str, par3, par4); -+ this.repairContainer = par1ContainerRepair; - } - -+ /** -+ * Called when an the contents of an Inventory change, usually -+ */ - public void onInventoryChanged() { - super.onInventoryChanged(); - this.repairContainer.onCraftMatrixChanged(this); - } - -- public boolean isItemValidForSlot(int var1, ItemStack var2) { -+ /** -+ * Returns true if automation is allowed to insert the given stack (ignoring stack size) into the given slot. -+ */ -+ public boolean isItemValidForSlot(int par1, ItemStack par2ItemStack) { - return true; - } - } ---- /dev/null -+++ org/spoutcraft/api/material/SolidBlock.java -@@ -1,0 +1,24 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.api.material; -+ -+public interface SolidBlock extends Block{ -+ public boolean isFallingBlock(); -+} ---- net/minecraft/src/GuiSmallButton.java -+++ net/minecraft/src/GuiSmallButton.java -@@ -3,18 +3,18 @@ - public class GuiSmallButton extends GuiButton { - private final EnumOptions enumOptions; - -- public GuiSmallButton(int var1, int var2, int var3, String var4) { -- this(var1, var2, var3, (EnumOptions)null, var4); -+ public GuiSmallButton(int par1, int par2, int par3, String par4Str) { -+ this(par1, par2, par3, (EnumOptions)null, par4Str); - } - -- public GuiSmallButton(int var1, int var2, int var3, int var4, int var5, String var6) { -- super(var1, var2, var3, var4, var5, var6); -+ public GuiSmallButton(int par1, int par2, int par3, int par4, int par5, String par6Str) { -+ super(par1, par2, par3, par4, par5, par6Str); - this.enumOptions = null; - } - -- public GuiSmallButton(int var1, int var2, int var3, EnumOptions var4, String var5) { -- super(var1, var2, var3, 150, 20, var5); -- this.enumOptions = var4; -+ public GuiSmallButton(int par1, int par2, int par3, EnumOptions par4EnumOptions, String par5Str) { -+ super(par1, par2, par3, 150, 20, par5Str); -+ this.enumOptions = par4EnumOptions; - } - - public EnumOptions returnEnumOptions() { ---- net/minecraft/src/ComponentVillageChurch.java -+++ net/minecraft/src/ComponentVillageChurch.java -@@ -4,102 +4,110 @@ - import java.util.Random; - - public class ComponentVillageChurch extends ComponentVillage { -- public ComponentVillageChurch() { -- } -- -- public ComponentVillageChurch(ComponentVillageStartPiece var1, int var2, Random var3, StructureBoundingBox var4, int var5) { -- super(var1, var2); -- this.coordBaseMode = var5; -- this.boundingBox = var4; -- } -- -- public static ComponentVillageChurch func_74919_a(ComponentVillageStartPiece var0, List var1, Random var2, int var3, int var4, int var5, int var6, int var7) { -- StructureBoundingBox var8 = StructureBoundingBox.getComponentToAddBoundingBox(var3, var4, var5, 0, 0, 0, 5, 12, 9, var6); -- return canVillageGoDeeper(var8) && StructureComponent.findIntersecting(var1, var8) == null ? new ComponentVillageChurch(var0, var7, var2, var8, var6) : null; -- } -- -- public boolean addComponentParts(World var1, Random var2, StructureBoundingBox var3) { -- if(this.field_143015_k < 0) { -- this.field_143015_k = this.getAverageGroundLevel(var1, var3); -- if(this.field_143015_k < 0) { -+ public ComponentVillageChurch() {} -+ -+ public ComponentVillageChurch(ComponentVillageStartPiece par1ComponentVillageStartPiece, int par2, Random par3Random, StructureBoundingBox par4StructureBoundingBox, int par5) { -+ super(par1ComponentVillageStartPiece, par2); -+ this.coordBaseMode = par5; -+ this.boundingBox = par4StructureBoundingBox; -+ } -+ -+ public static ComponentVillageChurch func_74919_a(ComponentVillageStartPiece par0ComponentVillageStartPiece, List par1List, Random par2Random, int par3, int par4, int par5, int par6, int par7) { -+ StructureBoundingBox var8 = StructureBoundingBox.getComponentToAddBoundingBox(par3, par4, par5, 0, 0, 0, 5, 12, 9, par6); -+ return canVillageGoDeeper(var8) && StructureComponent.findIntersecting(par1List, var8) == null ? new ComponentVillageChurch(par0ComponentVillageStartPiece, par7, par2Random, var8, par6) : null; -+ } -+ -+ /** -+ * second Part of Structure generating, this for example places Spiderwebs, Mob Spawners, it closes Mineshafts at the -+ * end, it adds Fences... -+ */ -+ public boolean addComponentParts(World par1World, Random par2Random, StructureBoundingBox par3StructureBoundingBox) { -+ if (this.field_143015_k < 0) { -+ this.field_143015_k = this.getAverageGroundLevel(par1World, par3StructureBoundingBox); -+ -+ if (this.field_143015_k < 0) { - return true; - } - - this.boundingBox.offset(0, this.field_143015_k - this.boundingBox.maxY + 12 - 1, 0); - } - -- this.fillWithBlocks(var1, var3, 1, 1, 1, 3, 3, 7, 0, 0, false); -- this.fillWithBlocks(var1, var3, 1, 5, 1, 3, 9, 3, 0, 0, false); -- this.fillWithBlocks(var1, var3, 1, 0, 0, 3, 0, 8, Block.cobblestone.blockID, Block.cobblestone.blockID, false); -- this.fillWithBlocks(var1, var3, 1, 1, 0, 3, 10, 0, Block.cobblestone.blockID, Block.cobblestone.blockID, false); -- this.fillWithBlocks(var1, var3, 0, 1, 1, 0, 10, 3, Block.cobblestone.blockID, Block.cobblestone.blockID, false); -- this.fillWithBlocks(var1, var3, 4, 1, 1, 4, 10, 3, Block.cobblestone.blockID, Block.cobblestone.blockID, false); -- this.fillWithBlocks(var1, var3, 0, 0, 4, 0, 4, 7, Block.cobblestone.blockID, Block.cobblestone.blockID, false); -- this.fillWithBlocks(var1, var3, 4, 0, 4, 4, 4, 7, Block.cobblestone.blockID, Block.cobblestone.blockID, false); -- this.fillWithBlocks(var1, var3, 1, 1, 8, 3, 4, 8, Block.cobblestone.blockID, Block.cobblestone.blockID, false); -- this.fillWithBlocks(var1, var3, 1, 5, 4, 3, 10, 4, Block.cobblestone.blockID, Block.cobblestone.blockID, false); -- this.fillWithBlocks(var1, var3, 1, 5, 5, 3, 5, 7, Block.cobblestone.blockID, Block.cobblestone.blockID, false); -- this.fillWithBlocks(var1, var3, 0, 9, 0, 4, 9, 4, Block.cobblestone.blockID, Block.cobblestone.blockID, false); -- this.fillWithBlocks(var1, var3, 0, 4, 0, 4, 4, 4, Block.cobblestone.blockID, Block.cobblestone.blockID, false); -- this.placeBlockAtCurrentPosition(var1, Block.cobblestone.blockID, 0, 0, 11, 2, var3); -- this.placeBlockAtCurrentPosition(var1, Block.cobblestone.blockID, 0, 4, 11, 2, var3); -- this.placeBlockAtCurrentPosition(var1, Block.cobblestone.blockID, 0, 2, 11, 0, var3); -- this.placeBlockAtCurrentPosition(var1, Block.cobblestone.blockID, 0, 2, 11, 4, var3); -- this.placeBlockAtCurrentPosition(var1, Block.cobblestone.blockID, 0, 1, 1, 6, var3); -- this.placeBlockAtCurrentPosition(var1, Block.cobblestone.blockID, 0, 1, 1, 7, var3); -- this.placeBlockAtCurrentPosition(var1, Block.cobblestone.blockID, 0, 2, 1, 7, var3); -- this.placeBlockAtCurrentPosition(var1, Block.cobblestone.blockID, 0, 3, 1, 6, var3); -- this.placeBlockAtCurrentPosition(var1, Block.cobblestone.blockID, 0, 3, 1, 7, var3); -- this.placeBlockAtCurrentPosition(var1, Block.stairsCobblestone.blockID, this.getMetadataWithOffset(Block.stairsCobblestone.blockID, 3), 1, 1, 5, var3); -- this.placeBlockAtCurrentPosition(var1, Block.stairsCobblestone.blockID, this.getMetadataWithOffset(Block.stairsCobblestone.blockID, 3), 2, 1, 6, var3); -- this.placeBlockAtCurrentPosition(var1, Block.stairsCobblestone.blockID, this.getMetadataWithOffset(Block.stairsCobblestone.blockID, 3), 3, 1, 5, var3); -- this.placeBlockAtCurrentPosition(var1, Block.stairsCobblestone.blockID, this.getMetadataWithOffset(Block.stairsCobblestone.blockID, 1), 1, 2, 7, var3); -- this.placeBlockAtCurrentPosition(var1, Block.stairsCobblestone.blockID, this.getMetadataWithOffset(Block.stairsCobblestone.blockID, 0), 3, 2, 7, var3); -- this.placeBlockAtCurrentPosition(var1, Block.thinGlass.blockID, 0, 0, 2, 2, var3); -- this.placeBlockAtCurrentPosition(var1, Block.thinGlass.blockID, 0, 0, 3, 2, var3); -- this.placeBlockAtCurrentPosition(var1, Block.thinGlass.blockID, 0, 4, 2, 2, var3); -- this.placeBlockAtCurrentPosition(var1, Block.thinGlass.blockID, 0, 4, 3, 2, var3); -- this.placeBlockAtCurrentPosition(var1, Block.thinGlass.blockID, 0, 0, 6, 2, var3); -- this.placeBlockAtCurrentPosition(var1, Block.thinGlass.blockID, 0, 0, 7, 2, var3); -- this.placeBlockAtCurrentPosition(var1, Block.thinGlass.blockID, 0, 4, 6, 2, var3); -- this.placeBlockAtCurrentPosition(var1, Block.thinGlass.blockID, 0, 4, 7, 2, var3); -- this.placeBlockAtCurrentPosition(var1, Block.thinGlass.blockID, 0, 2, 6, 0, var3); -- this.placeBlockAtCurrentPosition(var1, Block.thinGlass.blockID, 0, 2, 7, 0, var3); -- this.placeBlockAtCurrentPosition(var1, Block.thinGlass.blockID, 0, 2, 6, 4, var3); -- this.placeBlockAtCurrentPosition(var1, Block.thinGlass.blockID, 0, 2, 7, 4, var3); -- this.placeBlockAtCurrentPosition(var1, Block.thinGlass.blockID, 0, 0, 3, 6, var3); -- this.placeBlockAtCurrentPosition(var1, Block.thinGlass.blockID, 0, 4, 3, 6, var3); -- this.placeBlockAtCurrentPosition(var1, Block.thinGlass.blockID, 0, 2, 3, 8, var3); -- this.placeBlockAtCurrentPosition(var1, Block.torchWood.blockID, 0, 2, 4, 7, var3); -- this.placeBlockAtCurrentPosition(var1, Block.torchWood.blockID, 0, 1, 4, 6, var3); -- this.placeBlockAtCurrentPosition(var1, Block.torchWood.blockID, 0, 3, 4, 6, var3); -- this.placeBlockAtCurrentPosition(var1, Block.torchWood.blockID, 0, 2, 4, 5, var3); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 1, 1, 1, 3, 3, 7, 0, 0, false); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 1, 5, 1, 3, 9, 3, 0, 0, false); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 1, 0, 0, 3, 0, 8, Block.cobblestone.blockID, Block.cobblestone.blockID, false); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 1, 1, 0, 3, 10, 0, Block.cobblestone.blockID, Block.cobblestone.blockID, false); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 0, 1, 1, 0, 10, 3, Block.cobblestone.blockID, Block.cobblestone.blockID, false); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 4, 1, 1, 4, 10, 3, Block.cobblestone.blockID, Block.cobblestone.blockID, false); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 0, 0, 4, 0, 4, 7, Block.cobblestone.blockID, Block.cobblestone.blockID, false); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 4, 0, 4, 4, 4, 7, Block.cobblestone.blockID, Block.cobblestone.blockID, false); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 1, 1, 8, 3, 4, 8, Block.cobblestone.blockID, Block.cobblestone.blockID, false); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 1, 5, 4, 3, 10, 4, Block.cobblestone.blockID, Block.cobblestone.blockID, false); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 1, 5, 5, 3, 5, 7, Block.cobblestone.blockID, Block.cobblestone.blockID, false); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 0, 9, 0, 4, 9, 4, Block.cobblestone.blockID, Block.cobblestone.blockID, false); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 0, 4, 0, 4, 4, 4, Block.cobblestone.blockID, Block.cobblestone.blockID, false); -+ this.placeBlockAtCurrentPosition(par1World, Block.cobblestone.blockID, 0, 0, 11, 2, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.cobblestone.blockID, 0, 4, 11, 2, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.cobblestone.blockID, 0, 2, 11, 0, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.cobblestone.blockID, 0, 2, 11, 4, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.cobblestone.blockID, 0, 1, 1, 6, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.cobblestone.blockID, 0, 1, 1, 7, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.cobblestone.blockID, 0, 2, 1, 7, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.cobblestone.blockID, 0, 3, 1, 6, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.cobblestone.blockID, 0, 3, 1, 7, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.stairsCobblestone.blockID, this.getMetadataWithOffset(Block.stairsCobblestone.blockID, 3), 1, 1, 5, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.stairsCobblestone.blockID, this.getMetadataWithOffset(Block.stairsCobblestone.blockID, 3), 2, 1, 6, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.stairsCobblestone.blockID, this.getMetadataWithOffset(Block.stairsCobblestone.blockID, 3), 3, 1, 5, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.stairsCobblestone.blockID, this.getMetadataWithOffset(Block.stairsCobblestone.blockID, 1), 1, 2, 7, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.stairsCobblestone.blockID, this.getMetadataWithOffset(Block.stairsCobblestone.blockID, 0), 3, 2, 7, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.thinGlass.blockID, 0, 0, 2, 2, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.thinGlass.blockID, 0, 0, 3, 2, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.thinGlass.blockID, 0, 4, 2, 2, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.thinGlass.blockID, 0, 4, 3, 2, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.thinGlass.blockID, 0, 0, 6, 2, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.thinGlass.blockID, 0, 0, 7, 2, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.thinGlass.blockID, 0, 4, 6, 2, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.thinGlass.blockID, 0, 4, 7, 2, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.thinGlass.blockID, 0, 2, 6, 0, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.thinGlass.blockID, 0, 2, 7, 0, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.thinGlass.blockID, 0, 2, 6, 4, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.thinGlass.blockID, 0, 2, 7, 4, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.thinGlass.blockID, 0, 0, 3, 6, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.thinGlass.blockID, 0, 4, 3, 6, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.thinGlass.blockID, 0, 2, 3, 8, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.torchWood.blockID, 0, 2, 4, 7, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.torchWood.blockID, 0, 1, 4, 6, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.torchWood.blockID, 0, 3, 4, 6, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.torchWood.blockID, 0, 2, 4, 5, par3StructureBoundingBox); - int var4 = this.getMetadataWithOffset(Block.ladder.blockID, 4); -- - int var5; -- for(var5 = 1; var5 <= 9; ++var5) { -- this.placeBlockAtCurrentPosition(var1, Block.ladder.blockID, var4, 3, var5, 3, var3); -- } -- -- this.placeBlockAtCurrentPosition(var1, 0, 0, 2, 1, 0, var3); -- this.placeBlockAtCurrentPosition(var1, 0, 0, 2, 2, 0, var3); -- this.placeDoorAtCurrentPosition(var1, var3, var2, 2, 1, 0, this.getMetadataWithOffset(Block.doorWood.blockID, 1)); -- if(this.getBlockIdAtCurrentPosition(var1, 2, 0, -1, var3) == 0 && this.getBlockIdAtCurrentPosition(var1, 2, -1, -1, var3) != 0) { -- this.placeBlockAtCurrentPosition(var1, Block.stairsCobblestone.blockID, this.getMetadataWithOffset(Block.stairsCobblestone.blockID, 3), 2, 0, -1, var3); -- } -- -- for(var5 = 0; var5 < 9; ++var5) { -- for(int var6 = 0; var6 < 5; ++var6) { -- this.clearCurrentPositionBlocksUpwards(var1, var6, 12, var5, var3); -- this.fillCurrentPositionBlocksDownwards(var1, Block.cobblestone.blockID, 0, var6, -1, var5, var3); -+ -+ for (var5 = 1; var5 <= 9; ++var5) { -+ this.placeBlockAtCurrentPosition(par1World, Block.ladder.blockID, var4, 3, var5, 3, par3StructureBoundingBox); -+ } -+ -+ this.placeBlockAtCurrentPosition(par1World, 0, 0, 2, 1, 0, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, 0, 0, 2, 2, 0, par3StructureBoundingBox); -+ this.placeDoorAtCurrentPosition(par1World, par3StructureBoundingBox, par2Random, 2, 1, 0, this.getMetadataWithOffset(Block.doorWood.blockID, 1)); -+ -+ if (this.getBlockIdAtCurrentPosition(par1World, 2, 0, -1, par3StructureBoundingBox) == 0 && this.getBlockIdAtCurrentPosition(par1World, 2, -1, -1, par3StructureBoundingBox) != 0) { -+ this.placeBlockAtCurrentPosition(par1World, Block.stairsCobblestone.blockID, this.getMetadataWithOffset(Block.stairsCobblestone.blockID, 3), 2, 0, -1, par3StructureBoundingBox); -+ } -+ -+ for (var5 = 0; var5 < 9; ++var5) { -+ for (int var6 = 0; var6 < 5; ++var6) { -+ this.clearCurrentPositionBlocksUpwards(par1World, var6, 12, var5, par3StructureBoundingBox); -+ this.fillCurrentPositionBlocksDownwards(par1World, Block.cobblestone.blockID, 0, var6, -1, var5, par3StructureBoundingBox); - } - } - -- this.spawnVillagers(var1, var3, 2, 1, 2, 1); -+ this.spawnVillagers(par1World, par3StructureBoundingBox, 2, 1, 2, 1); - return true; - } - -- protected int getVillagerType(int var1) { -+ /** -+ * Returns the villager type to spawn in this component, based on the number of villagers already spawned. -+ */ -+ protected int getVillagerType(int par1) { - return 2; - } - } ---- net/minecraft/src/Packet255KickDisconnect.java -+++ net/minecraft/src/Packet255KickDisconnect.java -@@ -5,36 +5,56 @@ - import java.io.IOException; - - public class Packet255KickDisconnect extends Packet { -- public String a; -- -- public Packet255KickDisconnect() { -- } -- -- public Packet255KickDisconnect(String var1) { -- this.a = var1; -- } -- -- public void readPacketData(DataInput var1) throws IOException { -- this.a = readString(var1, 256); -- } -- -- public void writePacketData(DataOutput var1) throws IOException { -- writeString(this.a, var1); -- } -- -- public void processPacket(NetHandler var1) { -- var1.handleKickDisconnect(this); -- } -- -+ -+ /** Displayed to the client when the connection terminates. */ -+ public String reason; -+ -+ public Packet255KickDisconnect() {} -+ -+ public Packet255KickDisconnect(String par1Str) { -+ this.reason = par1Str; -+ } -+ -+ /** -+ * Abstract. Reads the raw packet data from the data stream. -+ */ -+ public void readPacketData(DataInput par1DataInput) throws IOException { -+ this.reason = readString(par1DataInput, 256); -+ } -+ -+ /** -+ * Abstract. Writes the raw packet data to the data stream. -+ */ -+ public void writePacketData(DataOutput par1DataOutput) throws IOException { -+ writeString(this.reason, par1DataOutput); -+ } -+ -+ /** -+ * Passes this Packet on to the NetHandler for processing. -+ */ -+ public void processPacket(NetHandler par1NetHandler) { -+ par1NetHandler.handleKickDisconnect(this); -+ } -+ -+ /** -+ * Abstract. Return the size of the packet (not counting the header). -+ */ - public int getPacketSize() { -- return this.a.length(); -+ return this.reason.length(); - } - -+ /** -+ * only false for the abstract Packet class, all real packets return true -+ */ - public boolean isRealPacket() { - return true; - } - -- public boolean containsSameEntityIDAs(Packet var1) { -+ /** -+ * eg return packet30entity.entityId == entityId; WARNING : will throw if you compare a packet to a different packet -+ * class -+ */ -+ public boolean containsSameEntityIDAs(Packet par1Packet) { - return true; - } - } ---- net/minecraft/src/ContainerSheep.java -+++ net/minecraft/src/ContainerSheep.java -@@ -3,11 +3,11 @@ - class ContainerSheep extends Container { - final EntitySheep field_90034_a; - -- ContainerSheep(EntitySheep var1) { -- this.field_90034_a = var1; -+ ContainerSheep(EntitySheep par1EntitySheep) { -+ this.field_90034_a = par1EntitySheep; - } - -- public boolean canInteractWith(EntityPlayer var1) { -+ public boolean canInteractWith(EntityPlayer par1EntityPlayer) { - return false; - } - } ---- /dev/null -+++ org/spoutcraft/client/gui/about/GuiAbout.java -@@ -1,0 +1,435 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.client.gui.about; -+ -+import java.awt.Desktop; -+import java.net.URL; -+ -+import org.lwjgl.input.Mouse; -+import org.lwjgl.opengl.GL11; -+import org.newdawn.slick.opengl.Texture; -+ -+import net.minecraft.src.GuiButton; -+import net.minecraft.src.GuiScreen; -+import net.minecraft.src.Minecraft; -+import net.minecraft.src.ResourceLocation; -+import net.minecraft.src.Tessellator; -+ -+import org.spoutcraft.api.gui.Color; -+import org.spoutcraft.api.gui.GenericGradient; -+import org.spoutcraft.api.gui.Gradient; -+import org.spoutcraft.api.gui.RenderUtil; -+import org.spoutcraft.client.SpoutClient; -+import org.spoutcraft.client.io.CustomTextureManager; -+import org.spoutcraft.client.io.FileUtil; -+ -+public class GuiAbout extends GuiScreen { -+ private float scrolled = 0f; -+ private boolean holdingScrollBar = false; -+ private Color background1 = new Color(0.06F, 0.06F, 0.06F, 0.65F); -+ private Color background2 = new Color(0.06F, 0.06F, 0.06F, 0.72F); -+ private Color scrollBarColor = new Color(0.46F, 0.46F, 0.46F, 0.55F); -+ private Color scrollBarColor2 = new Color(0.06F, 0.06F, 0.06F, 0.62F); -+ private Gradient scrollArea = new GenericGradient(); -+ private static final int SCREEN_SIZE = 230; -+ private static final int SCREEN_START = 60; -+ private static final int SCREEN_END = 94; -+ private static final float SCROLL_FACTOR = 10f; -+ Texture spoutcraftTexture = CustomTextureManager.getTextureFromPath(FileUtil.getAssetsDir().getPath()+"/logo/spoutcraft.png"); -+ Texture beastNodeLogo = CustomTextureManager.getTextureFromPath(FileUtil.getAssetsDir().getPath()+"/logo/beastnode.png"); -+ Texture minecraftBizLogo = CustomTextureManager.getTextureFromPath(FileUtil.getAssetsDir().getPath()+"/logo/minecraft_biz.png"); -+ private int sourceY = -1; -+ private int sourceWidth = -1; -+ private boolean hoveringLink = false; -+ private final GuiScreen parent; -+ -+ public GuiAbout(GuiScreen parent) { -+ this.parent = parent; -+ } -+ -+ @Override -+ public void initGui() { -+ this.buttonList.clear(); -+ buttonList.add(new GuiButton(1, this.width / 2 - 50, this.height - 25, 100, 20, "Main Menu")); -+ } -+ -+ @Override -+ public void actionPerformed(GuiButton button) { -+ this.mc.displayGuiScreen(parent); -+ } -+ -+ @Override -+ public void mouseClicked(int mouseX, int mouseY, int click) { -+ holdingScrollBar = false; -+ int height = getInvertedScaledHeight(this.height ); -+ String browseUrl = null; -+ if (mouseX >= this.width - 12 && mouseY <= this.width) { -+ // Do nothing if we clicked on the slider bar itself -+ if (mouseY > height + 16 && mouseY < this.height - 50) { -+ setScrolled(getScrolled() + 0.1f); -+ } else if (mouseY < height && mouseY > 30) { -+ setScrolled(getScrolled() - 0.1f); -+ } else { -+ holdingScrollBar = true; -+ } -+ } else if (this.isInBoundingRect(this.width / 2 + 30, getScaledHeight(15), 33, 147, mouseX, mouseY)) { -+ browseUrl = "http://spout.in/beast"; -+ } else if (this.isInBoundingRect((int)(0.0325f * this.width), (this.height - 40), (int)(44 * 0.4f), (int)(310 * 0.4f), mouseX, mouseY)) { -+ browseUrl = "http://spout.in/minecraft"; -+ } else if (this.isInBoundingRect((this.width - 140), this.height - 45, 32, 128, mouseX, mouseY)) { -+ browseUrl = "http://spout.in/spoutcraft"; -+ } else if (this.isInBoundingRect(this.width / 2 + 30, getScaledHeight(sourceY), 10, sourceWidth, mouseX, mouseY)) { -+ browseUrl = "https://github.com/SpoutDev"; -+ } -+ if (browseUrl != null) { -+ try { -+ URL url = new URL(browseUrl); -+ Desktop.getDesktop().browse(url.toURI()); -+ } catch (Exception e) { } -+ } -+ -+ super.mouseClicked(mouseX, mouseY, click); -+ } -+ -+ @Override -+ public void mouseMovedOrUp(int mouseX, int mouseY, int click) { -+ hoveringLink = false; -+ if (click != 0) { // Still dragging -+ if (holdingScrollBar) { -+ int height = getInvertedScaledHeight(this.height); -+ if (mouseY > height + 16) { -+ setScrolled(getScrolled() + 0.01f); -+ } else if (mouseY < height) { -+ setScrolled(getScrolled() - 0.01f); -+ } -+ } -+ } else { -+ holdingScrollBar = false; -+ } -+ if (this.isInBoundingRect(this.width / 2 + 30, getScaledHeight(sourceY), 10, sourceWidth, mouseX, mouseY)) { -+ hoveringLink = true; -+ } -+ super.mouseMovedOrUp(mouseX, mouseY, click); -+ } -+ -+ @Override -+ public void handleMouseInput() { -+ super.handleMouseInput(); -+ int scroll = Mouse.getEventDWheel(); -+ if (scroll != 0) { -+ setScrolled(getScrolled() - (scroll / (SCROLL_FACTOR * SCREEN_SIZE))); -+ } -+ } -+ -+ public float getScrolled() { -+ return scrolled; -+ } -+ -+ public void setScrolled(float f) { -+ if (f > 1f) { -+ scrolled = 1f; -+ } else if (f < 0f) { -+ scrolled = 0f; -+ } else { -+ scrolled = f; -+ } -+ } -+ -+ public int getScaledHeight(int height) { -+ return SCREEN_END + height - (int)(SCREEN_SIZE * scrolled) - SCREEN_START; -+ } -+ -+ public int getInvertedScaledHeight(int height) { -+ return (int)((this.height - SCREEN_END) * scrolled) + height - this.height + SCREEN_START / 2; -+ } -+ -+ public void drawScaledString(String string, int width, int height, int color) { -+ drawString(this.fontRenderer, string, width, getScaledHeight(height), color); -+ } -+ -+ @Override -+ public void drawScreen(int x, int y, float z) { -+ super.drawBackground(0); -+ GL11.glPushMatrix(); -+ -+ GL11.glDisable(2896 /*GL_LIGHTING*/); -+ GL11.glDisable(2912 /*GL_FOG*/); -+ GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); -+ bg.setTopColor(background1); -+ bg.setBottomColor(background2); -+ bg.setY(30); -+ bg.setHeight(this.height - 50); -+ bg.setX(0); -+ bg.setWidth(this.width - 12); -+ bg.render(); -+ -+ scrollArea.setY(30); -+ scrollArea.setHeight(this.height - 50); -+ scrollArea.setX(this.width - 12); -+ scrollArea.setWidth(16); -+ scrollArea.setTopColor(scrollBarColor); -+ scrollArea.setBottomColor(scrollBarColor2); -+ scrollArea.render(); -+ -+ // Right half -+ int top = 0; -+ drawScaledString("What is Spoutcraft?", this.width / 2 - 200, top, 0xffffff); top += 10; -+ drawScaledString("Spoutcraft is a modification for the", this.width / 2 - 200, top, 0x808080); top += 10; -+ drawScaledString("Minecraft client that plays exactly", this.width / 2 - 200, top, 0x808080); top += 10; -+ drawScaledString("like the official game. Its goal is", this.width / 2 - 200, top, 0x808080); top += 10; -+ drawScaledString("to give developers an easy to use", this.width / 2 - 200, top, 0x808080); top += 10; -+ drawScaledString("platform for building and distributing", this.width / 2 - 200, top, 0x808080); top += 10; -+ drawScaledString("mods, while providing a rich", this.width / 2 - 200, top, 0x808080); top += 10; -+ drawScaledString("gameplay experience for users.", this.width / 2 - 200, top, 0x808080); top += 10; -+ -+ top += 20; -+ -+ drawScaledString("What is Spout?", this.width / 2 - 200, top, 0xffffff); top += 10; -+ drawScaledString("Spout is a Bukkit plugin development", this.width / 2 - 200, top, 0x808080); top += 10; -+ drawScaledString("platform that allows for previously", this.width / 2 - 200, top, 0x808080); top += 10; -+ drawScaledString("impossible tasks, such as custom items", this.width / 2 - 200, top, 0x808080); top += 10; -+ drawScaledString("blocks, mobs, animals, and vehicles. ", this.width / 2 - 200, top, 0x808080); top += 10; -+ -+ top += 20; -+ -+ drawScaledString("Who is SpoutDev?", this.width / 2 - 200, top, 0xffffff); top += 10; -+ drawScaledString("SpoutDev is the team behind Spout, ", this.width / 2 - 200, top, 0x808080); top += 10; -+ drawScaledString("SpoutAPI, Spoutcraft,", this.width / 2 - 200, top, 0x808080); top += 10; -+ drawScaledString("and Spoutcraft Launcher.", this.width / 2 - 200, top, 0x808080); top += 10; -+ -+ top += 20; -+ -+ drawScaledString("Contributors", this.width / 2 - 200, top, 0xffffff); top += 10; -+ drawScaledString("The Bukkit Team - Bukkit Server API", this.width / 2 - 200, top, 0x808080); top += 10; -+ drawScaledString("lahwran - Fast Events Code", this.width / 2 - 200, top, 0x808080); top += 10; -+ drawScaledString("lahwran - Minimap Logic", this.width / 2 - 200, top, 0x808080); top += 10; -+ drawScaledString("Celtic Minstrel - Code", this.width / 2 - 200, top, 0x808080); top += 10; -+ drawScaledString("Zeerix - Threading Code", this.width / 2 - 200, top, 0x808080); top += 10; -+ drawScaledString("Karlthepagan - OptiTick Code", this.width / 2 - 200, top, 0x808080); top += 10; -+ drawScaledString("Kahr - HD Textures Code", this.width / 2 - 200, top, 0x808080); top += 10; -+ drawScaledString("Jeckari - Custom Texture Code", this.width / 2 - 200, top, 0x808080); top += 10; -+ drawScaledString("Rycochet - GUI Code", this.width / 2 - 200, top, 0x808080); top += 10; -+ drawScaledString("knowbuddy - GUI Optimizations", this.width / 2 - 200, top, 0x808080); top += 10; -+ drawScaledString("TomyLobo - Mipmapping Code", this.width / 2 - 200, top, 0x808080); top += 10; -+ drawScaledString("Apache Foundation - Code", this.width / 2 - 200, top, 0x808080); top += 10; -+ drawScaledString("ThVortex - FontRenderer fixes", this.width / 2 - 200, top, 0x808080); top += 10; -+ -+ // Left half -+ top = 0; -+ drawScaledString("Sponsors", this.width / 2 + 30, top, 0xffffff); top += 10; -+ -+ top = 130; -+ -+ drawScaledString("Team", this.width / 2 + 30, top, 0xffffff); top += 10; -+ drawScaledString("Afforess - Lead Developer", this.width / 2 + 30, top, 0x808080); top += 10; -+ drawScaledString("Wulfspider - Co-Lead & Support", this.width / 2 + 30, top, 0x808080); top += 10; -+ drawScaledString("alta189 - Co-Lead & Developer", this.width / 2 + 30, top, 0x808080); top += 10; -+ drawScaledString("Top_Cat - Developer", this.width / 2 + 30, top, 0x808080); top += 10; -+ drawScaledString("raphfrk - Developer", this.width / 2 + 30, top, 0x808080); top += 10; -+ drawScaledString("narrowtux - Developer", this.width / 2 + 30, top, 0x808080); top += 10; -+ drawScaledString("Olloth - Developer", this.width / 2 + 30, top, 0x808080); top += 10; -+ drawScaledString("Rycochet - Developer", this.width / 2 + 30, top, 0x808080); top += 10; -+ drawScaledString("RoyAwesome - Developer", this.width / 2 + 30, top, 0x808080); top += 10; -+ drawScaledString("zml2008 - Developer", this.width / 2 + 30, top, 0x808080); top += 10; -+ drawScaledString("Zidane - Developer", this.width / 2 + 30, top, 0x808080); top += 10; -+ -+ top += 20; -+ -+ drawScaledString("Contact", this.width / 2 + 30, top, 0xffffff); top += 10; -+ drawScaledString("Email: dev@spout.org", this.width / 2 + 30, top, 0x808080); top += 10; -+ drawScaledString("Website: spout.org", this.width / 2 + 30, top, 0x808080); top += 10; -+ drawScaledString("#spout on irc.esper.net", this.width / 2 + 30, top, 0x808080); top += 10; -+ -+ top += 20; -+ -+ drawScaledString("Note", this.width / 2 + 30, top, 0xffffff); top += 10; -+ drawScaledString("Spoutcraft, Spout, and related", this.width / 2 + 30, top, 0x808080); top += 10; -+ drawScaledString("projects are open source. You", this.width / 2 + 30, top, 0x808080); top += 10; -+ drawScaledString("can browse the source code at", this.width / 2 + 30, top, 0x808080); top += 10; -+ sourceY = top; -+ sourceWidth = this.fontRenderer.getStringWidth("https://github.com/SpoutDev"); -+ drawScaledString("https://github.com/SpoutDev", this.width / 2 + 30, sourceY, hoveringLink ? 0x65A5D1 : 0x176093); top += 10; -+ -+ top += 20; -+ -+ int beastNodeX = (this.width / 2 + 30); -+ int beastNodeY = getScaledHeight(15); -+ if (beastNodeLogo != null) { -+ GL11.glPushMatrix(); -+ GL11.glDisable(GL11.GL_DEPTH_TEST); -+ GL11.glEnable(GL11.GL_BLEND); -+ GL11.glDepthMask(false); -+ GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); -+ GL11.glTranslatef(beastNodeX, beastNodeY, 0); // Moves texture into place -+ SpoutClient.getHandle().renderEngine.bindTexture(beastNodeLogo.getTextureID()); -+ GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MIN_FILTER, GL11.GL_NEAREST); -+ GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MAG_FILTER, GL11.GL_NEAREST); -+ Tessellator tessellator = Tessellator.instance; -+ //GL11.glScalef(0.5f, 0.5f, 0.5f); -+ tessellator.startDrawingQuads(); -+ tessellator.addVertexWithUV(0.0D, 33, -90, 0.0D, 0.0D); // Draw corners -+ tessellator.addVertexWithUV(147, 33, -90, beastNodeLogo.getWidth(), 0.0D); -+ tessellator.addVertexWithUV(147, 0.0D, -90, beastNodeLogo.getWidth(), beastNodeLogo.getHeight()); -+ tessellator.addVertexWithUV(0.0D, 0.0D, -90, 0.0D, beastNodeLogo.getHeight()); -+ tessellator.draw(); -+ GL11.glDepthMask(true); -+ GL11.glEnable(GL11.GL_DEPTH_TEST); -+ GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); -+ GL11.glPopMatrix(); -+ } -+ -+ int minecraftBizX = (this.width / 2 + 30); -+ int minecraftBizY = getScaledHeight(85); -+ if (minecraftBizLogo != null) { -+ GL11.glPushMatrix(); -+ GL11.glDisable(GL11.GL_DEPTH_TEST); -+ GL11.glEnable(GL11.GL_BLEND); -+ GL11.glDepthMask(false); -+ GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); -+ GL11.glTranslatef(minecraftBizX, minecraftBizY, 0); // Moves texture into place -+ SpoutClient.getHandle().renderEngine.bindTexture(minecraftBizLogo.getTextureID()); -+ GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MIN_FILTER, GL11.GL_NEAREST); -+ GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MAG_FILTER, GL11.GL_NEAREST); -+ Tessellator tessellator = Tessellator.instance; -+ //GL11.glScalef(0.5f, 0.5f, 0.5f); -+ tessellator.startDrawingQuads(); -+ tessellator.addVertexWithUV(0.0D, 33, -90, 0.0D, 0.0D); // Draw corners -+ tessellator.addVertexWithUV(147, 33, -90, minecraftBizLogo.getWidth(), 0.0D); -+ tessellator.addVertexWithUV(147, 0.0D, -90, minecraftBizLogo.getWidth(), minecraftBizLogo.getHeight()); -+ tessellator.addVertexWithUV(0.0D, 0.0D, -90, 0.0D, minecraftBizLogo.getHeight()); -+ tessellator.draw(); -+ GL11.glDepthMask(true); -+ GL11.glEnable(GL11.GL_DEPTH_TEST); -+ GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); -+ GL11.glPopMatrix(); -+ } -+ -+ // Draw tooltips -+ if (isInBoundingRect(beastNodeX, beastNodeY, 33, 147, x, y)) { -+ drawTooltip( -+ "BeastNode provides high quality Minecraft and web hosting at affordable\n" + -+ "prices and is generously sponsoring the Spout project with its hosting\n" + -+ "& server needs. Mine, build, craft, and chat with your own high quality\n" + -+ "Minecraft server with FREE mumble voice server and web hosting.", x, y); -+ } else if (isInBoundingRect(minecraftBizX, minecraftBizY, 33, 147, x, y)) { -+ drawTooltip( -+ "Your Minecraft community in a new dimension!", x, y); -+ } -+ -+ GL11.glDisable(2896 /*GL_LIGHTING*/); -+ GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); -+ Minecraft.getMinecraft().getTextureManager().bindTexture(new ResourceLocation("gui/gui.png")); -+ RenderUtil.drawTexturedModalRectangle(this.width - 14, getInvertedScaledHeight(this.height), 0, 208, 16, 16, 0f); -+ GL11.glDisable(2912 /*GL_FOG*/); -+ GL11.glDisable(2929 /*GL_DEPTH_TEST*/); -+ this.overlayBackground(0, 30, 255, 255); -+ this.overlayBackground(this.height - 50, this.height, 255, 255); -+ drawCenteredString(this.fontRenderer, "About", this.width / 2, 16, 0xffffff); -+ Minecraft.getMinecraft().getTextureManager().bindTexture(new ResourceLocation("textures/gui/title/mojang.png")); -+ GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); -+ GL11.glPushMatrix(); -+ GL11.glTranslatef((0.0325f * this.width), (this.height - 40), 0); -+ GL11.glScalef(0.4f, 0.4f, 0.4f); -+ this.drawTexturedModalRect(0, 0, 0, 0, 155, 44); -+ this.drawTexturedModalRect(155, 0, 0, 45, 155, 44); -+ GL11.glPopMatrix(); -+ -+ if (spoutcraftTexture != null) { -+ GL11.glPushMatrix(); -+ GL11.glDisable(GL11.GL_DEPTH_TEST); -+ GL11.glDisable(GL11.GL_BLEND); -+ GL11.glDepthMask(false); -+ GL11.glEnable(3008 /*GL_ALPHA_TEST*/); -+ GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); -+ GL11.glTranslatef((this.width - 140), (this.height - 45), 0); // Moves texture into place -+ SpoutClient.getHandle().renderEngine.bindTexture(spoutcraftTexture.getTextureID()); -+ GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MIN_FILTER, GL11.GL_NEAREST); -+ GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MAG_FILTER, GL11.GL_NEAREST); -+ Tessellator tessellator = Tessellator.instance; -+ tessellator.startDrawingQuads(); -+ tessellator.addVertexWithUV(0.0D, 32, -90, 0.0D, 0.0D); // Draw corners -+ tessellator.addVertexWithUV(128, 32, -90, spoutcraftTexture.getWidth(), 0.0D); -+ tessellator.addVertexWithUV(128, 0.0D, -90, spoutcraftTexture.getWidth(), spoutcraftTexture.getHeight()); -+ tessellator.addVertexWithUV(0.0D, 0.0D, -90, 0.0D, spoutcraftTexture.getHeight()); -+ tessellator.draw(); -+ GL11.glDepthMask(true); -+ GL11.glEnable(GL11.GL_DEPTH_TEST); -+ GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); -+ GL11.glPopMatrix(); -+ } -+ -+ drawString(this.fontRenderer, "1.6.4", (int)(this.width * 0.034f), this.height - 20, 0xffffff); -+ drawString(this.fontRenderer, "Copyright Mojang AB", (int)(this.width * 0.034f), this.height - 10, 0x808080); -+ -+ String version = SpoutClient.getClientVersion(); -+ drawString(this.fontRenderer, version, (int)(this.width - 45) - fontRenderer.getStringWidth(version) + fontRenderer.getStringWidth("0"), this.height - 20, 0xffffff); -+ drawString(this.fontRenderer, "Licensed under LGPLv3", (int)(this.width - 129), this.height - 10, 0x808080); -+ -+ ((GuiButton)this.buttonList.get(0)).xPosition = this.width / 2 - 50; -+ ((GuiButton)this.buttonList.get(0)).yPosition = this.height - 25; -+ ((GuiButton)this.buttonList.get(0)).drawButton(this.mc, x, y); -+ //super.drawScreen(x, x, z); -+ -+ // Shadow magic -+ GL11.glEnable(3042 /*GL_BLEND*/); -+ GL11.glBlendFunc(770, 771); -+ GL11.glDisable(3008 /*GL_ALPHA_TEST*/); -+ GL11.glShadeModel(7425 /*GL_SMOOTH*/); -+ GL11.glDisable(3553 /*GL_TEXTURE_2D*/); -+ Tessellator var16 = Tessellator.instance; -+ byte var19 = 4; -+ var16.startDrawingQuads(); -+ var16.setColorRGBA_I(0, 0); -+ var16.addVertexWithUV(0, (double)(30 + var19), 0.0D, 0.0D, 1.0D); -+ var16.addVertexWithUV(this.width - 12, (double)(30 + var19), 0.0D, 1.0D, 1.0D); -+ var16.setColorRGBA_I(0, 255); -+ var16.addVertexWithUV(this.width - 12, 30, 0.0D, 1.0D, 0.0D); -+ var16.addVertexWithUV(0, 30, 0.0D, 0.0D, 0.0D); -+ var16.draw(); -+ var16.startDrawingQuads(); -+ var16.setColorRGBA_I(0, 255); -+ var16.addVertexWithUV(0, this.height - 50, 0.0D, 0.0D, 1.0D); -+ var16.addVertexWithUV(this.width - 12, this.height - 50, 0.0D, 1.0D, 1.0D); -+ var16.setColorRGBA_I(0, 0); -+ var16.addVertexWithUV(this.width - 12, (double)(this.height - 50 - var19), 0.0D, 1.0D, 0.0D); -+ var16.addVertexWithUV(0, (double)(this.height - 50 - var19), 0.0D, 0.0D, 0.0D); -+ var16.draw(); -+ -+ GL11.glEnable(3008 /*GL_ALPHA_TEST*/); -+ -+ GL11.glPopMatrix(); -+ } -+ -+ private void overlayBackground(int var1, int var2, int var3, int var4) { -+ Tessellator var5 = Tessellator.instance; -+ //ToDo: This is the wrong location for this file. -+ Minecraft.getMinecraft().getTextureManager().bindTexture(new ResourceLocation("gui/background.png")); -+ GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); -+ float var6 = 32.0F; -+ var5.startDrawingQuads(); -+ var5.setColorRGBA_I(4210752, var4); -+ var5.addVertexWithUV(0.0D, (double)var2, 0.0D, 0.0D, (double)((float)var2 / var6)); -+ var5.addVertexWithUV((double)this.width, (double)var2, 0.0D, (double)((float)this.width / var6), (double)((float)var2 / var6)); -+ var5.setColorRGBA_I(4210752, var3); -+ var5.addVertexWithUV((double)this.width, (double)var1, 0.0D, (double)((float)this.width / var6), (double)((float)var1 / var6)); -+ var5.addVertexWithUV(0.0D, (double)var1, 0.0D, 0.0D, (double)((float)var1 / var6)); -+ var5.draw(); -+ } -+} ---- /dev/null -+++ org/spoutcraft/api/player/ChatMessage.java -@@ -1,0 +1,218 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.api.player; -+ -+import java.util.regex.Pattern; -+ -+public class ChatMessage { -+ private String unparsedMessage = null; -+ private String message = null; -+ private boolean highlighted = false; -+ private boolean joinMessage = false; -+ private boolean ignoredPerson = false; -+ private String player = null; -+ private int age = 0; -+ -+ static final String messageFormats[] = { -+ "^<(.*)>\\s{0,1}(.*)$", // Vanilla format -+ "^(.*):\\s{0,1}(.*)$", -+ "^(.*)\\s{0,1}\\[.*\\]: (.*)$", // Format for teh cool admin folks -+ "^\\[(.*)\\] (.*)$", // Bukkit console say command ([Server] hello) -+ }; -+ -+ static final Pattern messagePatterns[]; -+ -+ static { -+ messagePatterns = new Pattern[messageFormats.length]; -+ int i = 0; -+ for (String format:messageFormats) { -+ Pattern pattern = Pattern.compile(format); -+ messagePatterns[i] = pattern; -+ i++; -+ } -+ } -+ -+ public ChatMessage(String unparsed, String message, boolean highlighted, String player) { -+ this.unparsedMessage = unparsed; -+ this.message = message; -+ this.highlighted = highlighted; -+ this.player = player; -+ } -+ -+ public ChatMessage(String unparsed, String message, boolean highlighted) { -+ this(unparsed, message, highlighted, null); -+ } -+ -+ public ChatMessage(String unparsed, String message, String player) { -+ this(unparsed, message, false, player); -+ } -+ -+ public ChatMessage(String unparsed, String message) { -+ this(unparsed, message, false, null); -+ } -+ -+ public ChatMessage(String unparsed) { -+ copy(parseMessage(unparsed)); -+ } -+ -+ public ChatMessage(ChatMessage other) { -+ copy(other); -+ } -+ -+ public String getMessage() { -+ return message; -+ } -+ -+ public void setMessage(String message) { -+ this.message = message; -+ } -+ -+ public boolean isHighlighted() { -+ return highlighted; -+ } -+ -+ public void setHighlighted(boolean highlighted) { -+ this.highlighted = highlighted; -+ } -+ -+ public String getPlayer() { -+ return player; -+ } -+ -+ public void setPlayer(String player) { -+ this.player = player; -+ } -+ -+ public String getUnparsedMessage() { -+ return unparsedMessage; -+ } -+ -+ public void setUnparsedMessage(String unparsedMessage) { -+ this.unparsedMessage = unparsedMessage; -+ } -+ -+ public void copy(ChatMessage other) { -+ unparsedMessage = other.unparsedMessage; -+ message = other.message; -+ highlighted = other.highlighted; -+ player = other.player; -+ ignoredPerson = other.ignoredPerson; -+ joinMessage = other.joinMessage; -+ } -+ -+ public ChatMessage clone() { -+ return new ChatMessage(this); -+ } -+ -+ public boolean hasPlayer() { -+ return player != null; -+ } -+ -+ public void reparse() { -+ copy(parseMessage(unparsedMessage)); -+ } -+ -+ public int getAge() { -+ return age; -+ } -+ -+ public boolean isJoinMessage() { -+ return joinMessage; -+ } -+ -+ public void setJoinMessage(boolean joinMessage) { -+ this.joinMessage = joinMessage; -+ } -+ -+ public boolean isIgnoredPerson() { -+ return ignoredPerson; -+ } -+ -+ public void setIgnoredPerson(boolean ignoredPerson) { -+ this.ignoredPerson = ignoredPerson; -+ } -+ -+ public void onTick() { -+ age ++; -+ } -+ -+ public static ChatMessage parseMessage(String unparsed) { -+// String player = null; -+// boolean highlighted = false; -+// unparsed = Spoutcraft.getChatManager().formatChatColors(unparsed); -+// String message = unparsed; -+// for (Pattern p:messagePatterns) { -+// Matcher m = p.matcher(ChatColor.stripColor(unparsed)); -+// if (m.matches()) { -+// player = m.group(1); -+// message = m.group(2); -+// break; -+// } -+// } -+// String playerName = Spoutcraft.getActivePlayer().getName(); -+// if (!playerName.equals(player)) { //Don't highlight our own messages -+// if (message.contains(playerName)) { -+// highlighted = true; -+// } else { -+// for (String highlightWord:Spoutcraft.getChatManager().getWordsToHighlight()) { -+// if (Spoutcraft.getChatManager().isUsingRegex()) { -+// try { -+// if (message.matches(".*" + highlightWord + ".*")) { -+// highlighted = true; -+// break; -+// } -+// } catch (PatternSyntaxException e) {} -+// } else { -+// if (message.contains(highlightWord)) { -+// highlighted = true; -+// break; -+// } -+// } -+// } -+// } -+// } -+// if (player != null) { -+// player = ChatColor.stripColor(player); -+// } -+// ChatMessage ret = new ChatMessage(unparsed, message, highlighted, player); -+// if (message.contains("has joined")) { -+// ret.setJoinMessage(true); -+// } -+// if (ret.hasPlayer()) { -+// for (String name:Spoutcraft.getChatManager().getIgnoredPlayers()) { -+// if (Spoutcraft.getChatManager().isUsingRegex()) { -+// try { -+// if (ret.getPlayer().matches(".*" + name + ".*")) { -+// ret.setIgnoredPerson(true); -+// break; -+// } -+// } catch (PatternSyntaxException e) {} -+// } else { -+// if (ret.getPlayer().equalsIgnoreCase(name)) { -+// ret.setIgnoredPerson(true); -+// break; -+// } -+// } -+// } -+// } -+// return ret; -+ return null; -+ } -+} ---- net/minecraft/src/GuiMultiplayer.java -+++ net/minecraft/src/GuiMultiplayer.java -@@ -10,35 +10,69 @@ - import org.lwjgl.input.Keyboard; - - public class GuiMultiplayer extends GuiScreen { -+ -+ /** Number of outstanding ThreadPollServers threads */ - private static int threadsPending; -- private static Object b = new Object(); -+ -+ /** Lock object for use with synchronized() */ -+ private static Object lock = new Object(); -+ -+ /** -+ * A reference to the screen object that created this. Used for navigating between screens. -+ */ - private GuiScreen parentScreen; -+ -+ /** Slot container for the server list */ - private GuiSlotServer serverSlotContainer; - private ServerList internetServerList; -+ -+ /** Index of the currently selected server */ - private int selectedServer = -1; - private GuiButton field_96289_p; -+ -+ /** The 'Join Server' button */ - private GuiButton buttonSelect; -+ -+ /** The 'Delete' button */ - private GuiButton buttonDelete; -+ -+ /** The 'Delete' button was clicked */ - private boolean deleteClicked; -+ -+ /** The 'Add server' button was clicked */ - private boolean addClicked; -+ -+ /** The 'Edit' button was clicked */ - private boolean editClicked; -+ -+ /** The 'Direct Connect' button was clicked */ - private boolean directClicked; -- private String x; -+ -+ /** This GUI's lag tooltip text or null if no lag icon is being hovered. */ -+ private String lagTooltip; -+ -+ /** Instance of ServerData. */ - private ServerData theServerData; - private LanServerList localNetworkServerList; - private ThreadLanServerFind localServerFindThread; -+ -+ /** How many ticks this Gui is already opened */ - private int ticksOpened; - private boolean field_74024_A; -- private List D = Collections.emptyList(); -+ private List listofLanServers = Collections.emptyList(); - -- public GuiMultiplayer(GuiScreen var1) { -- this.parentScreen = var1; -+ public GuiMultiplayer(GuiScreen par1GuiScreen) { -+ this.parentScreen = par1GuiScreen; - } - -+ /** -+ * Adds the buttons (and other controls) to the screen in question. -+ */ - public void initGui() { - Keyboard.enableRepeatEvents(true); -- this.i.clear(); -- if(!this.field_74024_A) { -+ this.buttonList.clear(); -+ -+ if (!this.field_74024_A) { - this.field_74024_A = true; - this.internetServerList = new ServerList(this.mc); - this.internetServerList.loadServerList(); -@@ -59,44 +93,57 @@ - this.initGuiControls(); - } - -+ /** -+ * Populate the GuiScreen controlList -+ */ - public void initGuiControls() { -- this.i.add(this.field_96289_p = new GuiButton(7, this.width / 2 - 154, this.height - 28, 70, 20, I18n.getString("selectServer.edit"))); -- this.i.add(this.buttonDelete = new GuiButton(2, this.width / 2 - 74, this.height - 28, 70, 20, I18n.getString("selectServer.delete"))); -- this.i.add(this.buttonSelect = new GuiButton(1, this.width / 2 - 154, this.height - 52, 100, 20, I18n.getString("selectServer.select"))); -- this.i.add(new GuiButton(4, this.width / 2 - 50, this.height - 52, 100, 20, I18n.getString("selectServer.direct"))); -- this.i.add(new GuiButton(3, this.width / 2 + 4 + 50, this.height - 52, 100, 20, I18n.getString("selectServer.add"))); -- this.i.add(new GuiButton(8, this.width / 2 + 4, this.height - 28, 70, 20, I18n.getString("selectServer.refresh"))); -- this.i.add(new GuiButton(0, this.width / 2 + 4 + 76, this.height - 28, 75, 20, I18n.getString("gui.cancel"))); -+ this.buttonList.add(this.field_96289_p = new GuiButton(7, this.width / 2 - 154, this.height - 28, 70, 20, I18n.getString("selectServer.edit"))); -+ this.buttonList.add(this.buttonDelete = new GuiButton(2, this.width / 2 - 74, this.height - 28, 70, 20, I18n.getString("selectServer.delete"))); -+ this.buttonList.add(this.buttonSelect = new GuiButton(1, this.width / 2 - 154, this.height - 52, 100, 20, I18n.getString("selectServer.select"))); -+ this.buttonList.add(new GuiButton(4, this.width / 2 - 50, this.height - 52, 100, 20, I18n.getString("selectServer.direct"))); -+ this.buttonList.add(new GuiButton(3, this.width / 2 + 4 + 50, this.height - 52, 100, 20, I18n.getString("selectServer.add"))); -+ this.buttonList.add(new GuiButton(8, this.width / 2 + 4, this.height - 28, 70, 20, I18n.getString("selectServer.refresh"))); -+ this.buttonList.add(new GuiButton(0, this.width / 2 + 4 + 76, this.height - 28, 75, 20, I18n.getString("gui.cancel"))); - boolean var1 = this.selectedServer >= 0 && this.selectedServer < this.serverSlotContainer.getSize(); - this.buttonSelect.enabled = var1; - this.field_96289_p.enabled = var1; - this.buttonDelete.enabled = var1; - } - -+ /** -+ * Called from the main game loop to update the screen. -+ */ - public void updateScreen() { - super.updateScreen(); - ++this.ticksOpened; -- if(this.localNetworkServerList.getWasUpdated()) { -- this.D = this.localNetworkServerList.getLanServers(); -+ -+ if (this.localNetworkServerList.getWasUpdated()) { -+ this.listofLanServers = this.localNetworkServerList.getLanServers(); - this.localNetworkServerList.setWasNotUpdated(); - } -- - } - -+ /** -+ * Called when the screen is unloaded. Used to disable keyboard repeat events -+ */ - public void onGuiClosed() { - Keyboard.enableRepeatEvents(false); -- if(this.localServerFindThread != null) { -+ -+ if (this.localServerFindThread != null) { - this.localServerFindThread.interrupt(); - this.localServerFindThread = null; - } -- - } - -- protected void actionPerformed(GuiButton var1) { -- if(var1.enabled) { -- if(var1.id == 2) { -- String var2 = this.internetServerList.getServerData(this.selectedServer).a; -- if(var2 != null) { -+ /** -+ * Fired when a control is clicked. This is the equivalent of ActionListener.actionPerformed(ActionEvent e). -+ */ -+ protected void actionPerformed(GuiButton par1GuiButton) { -+ if (par1GuiButton.enabled) { -+ if (par1GuiButton.id == 2) { -+ String var2 = this.internetServerList.getServerData(this.selectedServer).serverName; -+ -+ if (var2 != null) { - this.deleteClicked = true; - String var3 = I18n.getString("selectServer.deleteQuestion"); - String var4 = "\'" + var2 + "\' " + I18n.getString("selectServer.deleteWarning"); -@@ -105,134 +152,147 @@ - GuiYesNo var7 = new GuiYesNo(this, var3, var4, var5, var6, this.selectedServer); - this.mc.displayGuiScreen(var7); - } -- } else if(var1.id == 1) { -+ } else if (par1GuiButton.id == 1) { - this.joinServer(this.selectedServer); -- } else if(var1.id == 4) { -+ } else if (par1GuiButton.id == 4) { - this.directClicked = true; - this.mc.displayGuiScreen(new GuiScreenServerList(this, this.theServerData = new ServerData(I18n.getString("selectServer.defaultName"), ""))); -- } else if(var1.id == 3) { -+ } else if (par1GuiButton.id == 3) { - this.addClicked = true; - this.mc.displayGuiScreen(new GuiScreenAddServer(this, this.theServerData = new ServerData(I18n.getString("selectServer.defaultName"), ""))); -- } else if(var1.id == 7) { -+ } else if (par1GuiButton.id == 7) { - this.editClicked = true; - ServerData var8 = this.internetServerList.getServerData(this.selectedServer); -- this.theServerData = new ServerData(var8.a, var8.b); -+ this.theServerData = new ServerData(var8.serverName, var8.serverIP); - this.theServerData.setHideAddress(var8.isHidingAddress()); - this.mc.displayGuiScreen(new GuiScreenAddServer(this, this.theServerData)); -- } else if(var1.id == 0) { -+ } else if (par1GuiButton.id == 0) { - this.mc.displayGuiScreen(this.parentScreen); -- } else if(var1.id == 8) { -+ } else if (par1GuiButton.id == 8) { - this.mc.displayGuiScreen(new GuiMultiplayer(this.parentScreen)); - } else { -- this.serverSlotContainer.actionPerformed(var1); -+ this.serverSlotContainer.actionPerformed(par1GuiButton); - } -- - } - } - -- public void confirmClicked(boolean var1, int var2) { -- if(this.deleteClicked) { -+ public void confirmClicked(boolean par1, int par2) { -+ if (this.deleteClicked) { - this.deleteClicked = false; -- if(var1) { -- this.internetServerList.removeServerData(var2); -+ -+ if (par1) { -+ this.internetServerList.removeServerData(par2); - this.internetServerList.saveServerList(); - this.selectedServer = -1; - } - - this.mc.displayGuiScreen(this); -- } else if(this.directClicked) { -+ } else if (this.directClicked) { - this.directClicked = false; -- if(var1) { -+ -+ if (par1) { - this.connectToServer(this.theServerData); - } else { - this.mc.displayGuiScreen(this); - } -- } else if(this.addClicked) { -+ } else if (this.addClicked) { - this.addClicked = false; -- if(var1) { -+ -+ if (par1) { - this.internetServerList.addServerData(this.theServerData); - this.internetServerList.saveServerList(); - this.selectedServer = -1; - } - - this.mc.displayGuiScreen(this); -- } else if(this.editClicked) { -+ } else if (this.editClicked) { - this.editClicked = false; -- if(var1) { -+ -+ if (par1) { - ServerData var3 = this.internetServerList.getServerData(this.selectedServer); -- var3.a = this.theServerData.a; -- var3.b = this.theServerData.b; -+ var3.serverName = this.theServerData.serverName; -+ var3.serverIP = this.theServerData.serverIP; - var3.setHideAddress(this.theServerData.isHidingAddress()); - this.internetServerList.saveServerList(); - } - - this.mc.displayGuiScreen(this); - } -- - } - -- protected void keyTyped(char var1, int var2) { -+ /** -+ * Fired when a key is typed. This is the equivalent of KeyListener.keyTyped(KeyEvent e). -+ */ -+ protected void keyTyped(char par1, int par2) { - int var3 = this.selectedServer; -- if(var2 == 59) { -+ -+ if (par2 == 59) { - this.mc.gameSettings.hideServerAddress = !this.mc.gameSettings.hideServerAddress; - this.mc.gameSettings.saveOptions(); - } else { -- if(isShiftKeyDown() && var2 == 200) { -- if(var3 > 0 && var3 < this.internetServerList.countServers()) { -+ if (isShiftKeyDown() && par2 == 200) { -+ if (var3 > 0 && var3 < this.internetServerList.countServers()) { - this.internetServerList.swapServers(var3, var3 - 1); - --this.selectedServer; -- if(var3 < this.internetServerList.countServers() - 1) { -+ -+ if (var3 < this.internetServerList.countServers() - 1) { - this.serverSlotContainer.func_77208_b(-this.serverSlotContainer.slotHeight); - } - } -- } else if(isShiftKeyDown() && var2 == 208) { -- if(var3 >= 0 & var3 < this.internetServerList.countServers() - 1) { -+ } else if (isShiftKeyDown() && par2 == 208) { -+ if (var3 >= 0 & var3 < this.internetServerList.countServers() - 1) { - this.internetServerList.swapServers(var3, var3 + 1); - ++this.selectedServer; -- if(var3 > 0) { -+ -+ if (var3 > 0) { - this.serverSlotContainer.func_77208_b(this.serverSlotContainer.slotHeight); - } - } -- } else if(var2 != 28 && var2 != 156) { -- super.keyTyped(var1, var2); -+ } else if (par2 != 28 && par2 != 156) { -+ super.keyTyped(par1, par2); - } else { -- this.actionPerformed((GuiButton)this.i.get(2)); -+ this.actionPerformed((GuiButton)this.buttonList.get(2)); - } -- - } - } - -- public void drawScreen(int var1, int var2, float var3) { -- this.x = null; -+ /** -+ * Draws the screen and all the components in it. -+ */ -+ public void drawScreen(int par1, int par2, float par3) { -+ this.lagTooltip = null; - this.drawDefaultBackground(); -- this.serverSlotContainer.drawScreen(var1, var2, var3); -+ this.serverSlotContainer.drawScreen(par1, par2, par3); - this.drawCenteredString(this.fontRenderer, I18n.getString("multiplayer.title"), this.width / 2, 20, 16777215); -- super.drawScreen(var1, var2, var3); -- if(this.x != null) { -- this.func_74007_a(this.x, var1, var2); -+ super.drawScreen(par1, par2, par3); -+ -+ if (this.lagTooltip != null) { -+ this.func_74007_a(this.lagTooltip, par1, par2); - } -- - } - -- private void joinServer(int var1) { -- if(var1 < this.internetServerList.countServers()) { -- this.connectToServer(this.internetServerList.getServerData(var1)); -+ /** -+ * Join server by slot index -+ */ -+ private void joinServer(int par1) { -+ if (par1 < this.internetServerList.countServers()) { -+ this.connectToServer(this.internetServerList.getServerData(par1)); - } else { -- var1 -= this.internetServerList.countServers(); -- if(var1 < this.D.size()) { -- LanServer var2 = (LanServer)this.D.get(var1); -+ par1 -= this.internetServerList.countServers(); -+ -+ if (par1 < this.listofLanServers.size()) { -+ LanServer var2 = (LanServer)this.listofLanServers.get(par1); - this.connectToServer(new ServerData(var2.getServerMotd(), var2.getServerIpPort())); - } -- - } - } - -- private void connectToServer(ServerData var1) { -- this.mc.displayGuiScreen(new GuiConnecting(this, this.mc, var1)); -+ private void connectToServer(ServerData par1ServerData) { -+ this.mc.displayGuiScreen(new GuiConnecting(this, this.mc, par1ServerData)); - } - -- private static void func_74017_b(ServerData var0) throws IOException { -- ServerAddress var1 = ServerAddress.func_78860_a(var0.b); -+ private static void func_74017_b(ServerData par0ServerData) throws IOException { -+ ServerAddress var1 = ServerAddress.func_78860_a(par0ServerData.serverIP); - Socket var2 = null; - DataInputStream var3 = null; - DataOutputStream var4 = null; -@@ -248,15 +308,16 @@ - Packet254ServerPing var5 = new Packet254ServerPing(78, var1.getIP(), var1.getPort()); - var4.writeByte(var5.getPacketId()); - var5.writePacketData(var4); -- if(var3.read() != 255) { -+ -+ if (var3.read() != 255) { - throw new IOException("Bad message"); - } - - String var6 = Packet.readString(var3, 256); - char[] var7 = var6.toCharArray(); - -- for(int var8 = 0; var8 < var7.length; ++var8) { -- if(var7[var8] != 167 && var7[var8] != 0 && ChatAllowedCharacters.a.indexOf(var7[var8]) < 0) { -+ for (int var8 = 0; var8 < var7.length; ++var8) { -+ if (var7[var8] != 167 && var7[var8] != 0 && ChatAllowedCharacters.allowedCharacters.indexOf(var7[var8]) < 0) { - var7[var8] = 63; - } - } -@@ -265,24 +326,27 @@ - int var9; - int var10; - String[] var27; -- if(var6.startsWith("\u00a7") && var6.length() > 1) { -+ -+ if (var6.startsWith("\u00a7") && var6.length() > 1) { - var27 = var6.substring(1).split("\u0000"); -- if(MathHelper.parseIntWithDefault(var27[0], 0) == 1) { -- var0.d = var27[3]; -- var0.field_82821_f = MathHelper.parseIntWithDefault(var27[1], var0.field_82821_f); -- var0.g = var27[2]; -+ -+ if (MathHelper.parseIntWithDefault(var27[0], 0) == 1) { -+ par0ServerData.serverMOTD = var27[3]; -+ par0ServerData.field_82821_f = MathHelper.parseIntWithDefault(var27[1], par0ServerData.field_82821_f); -+ par0ServerData.gameVersion = var27[2]; - var9 = MathHelper.parseIntWithDefault(var27[4], 0); - var10 = MathHelper.parseIntWithDefault(var27[5], 0); -- if(var9 >= 0 && var10 >= 0) { -- var0.c = EnumChatFormatting.GRAY + "" + var9 + "" + EnumChatFormatting.DARK_GRAY + "/" + EnumChatFormatting.GRAY + var10; -+ -+ if (var9 >= 0 && var10 >= 0) { -+ par0ServerData.populationInfo = EnumChatFormatting.GRAY + "" + var9 + "" + EnumChatFormatting.DARK_GRAY + "/" + EnumChatFormatting.GRAY + var10; - } else { -- var0.c = "" + EnumChatFormatting.DARK_GRAY + "???"; -+ par0ServerData.populationInfo = "" + EnumChatFormatting.DARK_GRAY + "???"; - } - } else { -- var0.g = "???"; -- var0.d = "" + EnumChatFormatting.DARK_GRAY + "???"; -- var0.field_82821_f = 79; -- var0.c = "" + EnumChatFormatting.DARK_GRAY + "???"; -+ par0ServerData.gameVersion = "???"; -+ par0ServerData.serverMOTD = "" + EnumChatFormatting.DARK_GRAY + "???"; -+ par0ServerData.field_82821_f = 79; -+ par0ServerData.populationInfo = "" + EnumChatFormatting.DARK_GRAY + "???"; - } - } else { - var27 = var6.split("\u00a7"); -@@ -294,92 +358,107 @@ - var9 = Integer.parseInt(var27[1]); - var10 = Integer.parseInt(var27[2]); - } catch (Exception var25) { -+ ; - } - -- var0.d = EnumChatFormatting.GRAY + var6; -- if(var9 >= 0 && var10 > 0) { -- var0.c = EnumChatFormatting.GRAY + "" + var9 + "" + EnumChatFormatting.DARK_GRAY + "/" + EnumChatFormatting.GRAY + var10; -+ par0ServerData.serverMOTD = EnumChatFormatting.GRAY + var6; -+ -+ if (var9 >= 0 && var10 > 0) { -+ par0ServerData.populationInfo = EnumChatFormatting.GRAY + "" + var9 + "" + EnumChatFormatting.DARK_GRAY + "/" + EnumChatFormatting.GRAY + var10; - } else { -- var0.c = "" + EnumChatFormatting.DARK_GRAY + "???"; -+ par0ServerData.populationInfo = "" + EnumChatFormatting.DARK_GRAY + "???"; - } - -- var0.g = "1.3"; -- var0.field_82821_f = 77; -+ par0ServerData.gameVersion = "1.3"; -+ par0ServerData.field_82821_f = 77; - } - } finally { - try { -- if(var3 != null) { -+ if (var3 != null) { - var3.close(); - } - } catch (Throwable var24) { -+ ; - } - - try { -- if(var4 != null) { -+ if (var4 != null) { - var4.close(); - } - } catch (Throwable var23) { -+ ; - } - - try { -- if(var2 != null) { -+ if (var2 != null) { - var2.close(); - } - } catch (Throwable var22) { -+ ; - } -- - } -- - } - -- protected void func_74007_a(String var1, int var2, int var3) { -- if(var1 != null) { -- int var4 = var2 + 12; -- int var5 = var3 - 12; -- int var6 = this.fontRenderer.getStringWidth(var1); -+ protected void func_74007_a(String par1Str, int par2, int par3) { -+ if (par1Str != null) { -+ int var4 = par2 + 12; -+ int var5 = par3 - 12; -+ int var6 = this.fontRenderer.getStringWidth(par1Str); - this.drawGradientRect(var4 - 3, var5 - 3, var4 + var6 + 3, var5 + 8 + 3, -1073741824, -1073741824); -- this.fontRenderer.drawStringWithShadow(var1, var4, var5, -1); -+ this.fontRenderer.drawStringWithShadow(par1Str, var4, var5, -1); - } - } - -- static ServerList getInternetServerList(GuiMultiplayer var0) { -- return var0.internetServerList; -- } -- -- static List getListOfLanServers(GuiMultiplayer var0) { -- return var0.D; -- } -- -- static int getSelectedServer(GuiMultiplayer var0) { -- return var0.selectedServer; -- } -- -- static int getAndSetSelectedServer(GuiMultiplayer var0, int var1) { -- return var0.selectedServer = var1; -- } -- -- static GuiButton getButtonSelect(GuiMultiplayer var0) { -- return var0.buttonSelect; -- } -- -- static GuiButton getButtonEdit(GuiMultiplayer var0) { -- return var0.field_96289_p; -- } -- -- static GuiButton getButtonDelete(GuiMultiplayer var0) { -- return var0.buttonDelete; -- } -- -- static void func_74008_b(GuiMultiplayer var0, int var1) { -- var0.joinServer(var1); -- } -- -- static int getTicksOpened(GuiMultiplayer var0) { -- return var0.ticksOpened; -- } -- -+ static ServerList getInternetServerList(GuiMultiplayer par0GuiMultiplayer) { -+ return par0GuiMultiplayer.internetServerList; -+ } -+ -+ static List getListOfLanServers(GuiMultiplayer par0GuiMultiplayer) { -+ return par0GuiMultiplayer.listofLanServers; -+ } -+ -+ static int getSelectedServer(GuiMultiplayer par0GuiMultiplayer) { -+ return par0GuiMultiplayer.selectedServer; -+ } -+ -+ static int getAndSetSelectedServer(GuiMultiplayer par0GuiMultiplayer, int par1) { -+ return par0GuiMultiplayer.selectedServer = par1; -+ } -+ -+ /** -+ * Return buttonSelect GuiButton -+ */ -+ static GuiButton getButtonSelect(GuiMultiplayer par0GuiMultiplayer) { -+ return par0GuiMultiplayer.buttonSelect; -+ } -+ -+ /** -+ * Return buttonEdit GuiButton -+ */ -+ static GuiButton getButtonEdit(GuiMultiplayer par0GuiMultiplayer) { -+ return par0GuiMultiplayer.field_96289_p; -+ } -+ -+ /** -+ * Return buttonDelete GuiButton -+ */ -+ static GuiButton getButtonDelete(GuiMultiplayer par0GuiMultiplayer) { -+ return par0GuiMultiplayer.buttonDelete; -+ } -+ -+ static void func_74008_b(GuiMultiplayer par0GuiMultiplayer, int par1) { -+ par0GuiMultiplayer.joinServer(par1); -+ } -+ -+ static int getTicksOpened(GuiMultiplayer par0GuiMultiplayer) { -+ return par0GuiMultiplayer.ticksOpened; -+ } -+ -+ /** -+ * Returns the lock object for use with synchronized() -+ */ - static Object getLock() { -- return b; -+ return lock; - } - - static int getThreadsPending() { -@@ -390,15 +469,15 @@ - return threadsPending++; - } - -- static void func_82291_a(ServerData var0) throws IOException { -- func_74017_b(var0); -+ static void func_82291_a(ServerData par0ServerData) throws IOException { -+ func_74017_b(par0ServerData); - } - - static int decreaseThreadsPending() { - return threadsPending--; - } - -- static String getAndSetLagTooltip(GuiMultiplayer var0, String var1) { -- return var0.x = var1; -+ static String getAndSetLagTooltip(GuiMultiplayer par0GuiMultiplayer, String par1Str) { -+ return par0GuiMultiplayer.lagTooltip = par1Str; - } - } ---- net/minecraft/src/ModelSilverfish.java -+++ net/minecraft/src/ModelSilverfish.java -@@ -1,21 +1,30 @@ - package net.minecraft.src; - - public class ModelSilverfish extends ModelBase { -+ -+ /** The body parts of the silverfish's model. */ - private ModelRenderer[] silverfishBodyParts = new ModelRenderer[7]; -+ -+ /** The wings (dust-looking sprites) on the silverfish's model. */ - private ModelRenderer[] silverfishWings; - private float[] field_78170_c = new float[7]; -- private static final int[][] silverfishBoxLength = new int[][]{{3, 2, 2}, {4, 3, 2}, {6, 4, 3}, {3, 3, 3}, {2, 2, 3}, {2, 1, 2}, {1, 1, 2}}; -- private static final int[][] silverfishTexturePositions = new int[][]{{0, 0}, {0, 4}, {0, 9}, {0, 16}, {0, 22}, {11, 0}, {13, 4}}; -+ -+ /** The widths, heights, and lengths for the silverfish model boxes. */ -+ private static final int[][] silverfishBoxLength = new int[][] {{3, 2, 2}, {4, 3, 2}, {6, 4, 3}, {3, 3, 3}, {2, 2, 3}, {2, 1, 2}, {1, 1, 2}}; -+ -+ /** The texture positions for the silverfish's model's boxes. */ -+ private static final int[][] silverfishTexturePositions = new int[][] {{0, 0}, {0, 4}, {0, 9}, {0, 16}, {0, 22}, {11, 0}, {13, 4}}; - - public ModelSilverfish() { - float var1 = -3.5F; - -- for(int var2 = 0; var2 < this.silverfishBodyParts.length; ++var2) { -+ for (int var2 = 0; var2 < this.silverfishBodyParts.length; ++var2) { - this.silverfishBodyParts[var2] = new ModelRenderer(this, silverfishTexturePositions[var2][0], silverfishTexturePositions[var2][1]); - this.silverfishBodyParts[var2].addBox((float)silverfishBoxLength[var2][0] * -0.5F, 0.0F, (float)silverfishBoxLength[var2][2] * -0.5F, silverfishBoxLength[var2][0], silverfishBoxLength[var2][1], silverfishBoxLength[var2][2]); - this.silverfishBodyParts[var2].setRotationPoint(0.0F, (float)(24 - silverfishBoxLength[var2][1]), var1); - this.field_78170_c[var2] = var1; -- if(var2 < this.silverfishBodyParts.length - 1) { -+ -+ if (var2 < this.silverfishBodyParts.length - 1) { - var1 += (float)(silverfishBoxLength[var2][2] + silverfishBoxLength[var2 + 1][2]) * 0.5F; - } - } -@@ -32,24 +41,31 @@ - this.silverfishWings[2].setRotationPoint(0.0F, 19.0F, this.field_78170_c[1]); - } - -- public void render(Entity var1, float var2, float var3, float var4, float var5, float var6, float var7) { -- this.setRotationAngles(var2, var3, var4, var5, var6, var7, var1); -- -+ /** -+ * Sets the models various rotation angles then renders the model. -+ */ -+ public void render(Entity par1Entity, float par2, float par3, float par4, float par5, float par6, float par7) { -+ this.setRotationAngles(par2, par3, par4, par5, par6, par7, par1Entity); - int var8; -- for(var8 = 0; var8 < this.silverfishBodyParts.length; ++var8) { -- this.silverfishBodyParts[var8].render(var7); -- } -- -- for(var8 = 0; var8 < this.silverfishWings.length; ++var8) { -- this.silverfishWings[var8].render(var7); -- } -- -+ -+ for (var8 = 0; var8 < this.silverfishBodyParts.length; ++var8) { -+ this.silverfishBodyParts[var8].render(par7); -+ } -+ -+ for (var8 = 0; var8 < this.silverfishWings.length; ++var8) { -+ this.silverfishWings[var8].render(par7); -+ } - } - -- public void setRotationAngles(float var1, float var2, float var3, float var4, float var5, float var6, Entity var7) { -- for(int var8 = 0; var8 < this.silverfishBodyParts.length; ++var8) { -- this.silverfishBodyParts[var8].rotateAngleY = MathHelper.cos(var3 * 0.9F + (float)var8 * 0.15F * (float)Math.PI) * (float)Math.PI * 0.05F * (float)(1 + Math.abs(var8 - 2)); -- this.silverfishBodyParts[var8].rotationPointX = MathHelper.sin(var3 * 0.9F + (float)var8 * 0.15F * (float)Math.PI) * (float)Math.PI * 0.2F * (float)Math.abs(var8 - 2); -+ /** -+ * Sets the model's various rotation angles. For bipeds, par1 and par2 are used for animating the movement of arms and -+ * legs, where par1 represents the time(so that arms and legs swing back and forth) and par2 represents how "far" arms -+ * and legs can swing at most. -+ */ -+ public void setRotationAngles(float par1, float par2, float par3, float par4, float par5, float par6, Entity par7Entity) { -+ for (int var8 = 0; var8 < this.silverfishBodyParts.length; ++var8) { -+ this.silverfishBodyParts[var8].rotateAngleY = MathHelper.cos(par3 * 0.9F + (float)var8 * 0.15F * (float)Math.PI) * (float)Math.PI * 0.05F * (float)(1 + Math.abs(var8 - 2)); -+ this.silverfishBodyParts[var8].rotationPointX = MathHelper.sin(par3 * 0.9F + (float)var8 * 0.15F * (float)Math.PI) * (float)Math.PI * 0.2F * (float)Math.abs(var8 - 2); - } - - this.silverfishWings[0].rotateAngleY = this.silverfishBodyParts[2].rotateAngleY; ---- /dev/null -+++ org/bukkit/util/FileUtil.java -@@ -1,0 +1,55 @@ -+package org.bukkit.util; -+ -+import java.io.File; -+import java.io.FileInputStream; -+import java.io.FileOutputStream; -+import java.io.IOException; -+import java.nio.channels.FileChannel; -+ -+/** -+ * Class containing file utilities -+ */ -+public class FileUtil { -+ /** -+ * This method copies one file to another location -+ * -+ * @param inFile the source filename -+ * @param outFile the target filename -+ * @return true on success -+ */ -+ public static boolean copy(File inFile, File outFile) { -+ if (!inFile.exists()) { -+ return false; -+ } -+ -+ FileChannel in = null; -+ FileChannel out = null; -+ -+ try { -+ in = new FileInputStream(inFile).getChannel(); -+ out = new FileOutputStream(outFile).getChannel(); -+ -+ long pos = 0; -+ long size = in.size(); -+ -+ while (pos < size) { -+ pos += in.transferTo(pos, 10 * 1024 * 1024, out); -+ } -+ } catch (IOException ioe) { -+ return false; -+ } finally { -+ try { -+ if (in != null) { -+ in.close(); -+ } -+ if (out != null) { -+ out.close(); -+ } -+ } catch (IOException ioe) { -+ return false; -+ } -+ } -+ -+ return true; -+ } -+} ---- /dev/null -+++ org/spoutcraft/api/animation/PropertyAnimation.java -@@ -1,0 +1,63 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.api.animation; -+ -+import org.spoutcraft.api.property.PropertyInterface; -+ -+public class PropertyAnimation extends Animation { -+ private String propertyName; -+ private PropertyInterface object; -+ -+ public PropertyAnimation(PropertyInterface object, String property) { -+ propertyName = property; -+ this.object = object; -+ setValueDelegate(new PropertyDelegate(object, propertyName)); -+ Object val = object.getProperty(propertyName); -+ if (val instanceof Animatable) { -+ Animatable value = (Animatable) val; -+ setStartValue(value); -+ setEndValue(value); -+ } else if (val instanceof Number) { -+ Number num = (Number) val; -+ setStartNumber(num); -+ setEndNumber(num); -+ } else { -+ throw new IllegalStateException("Only subclasses of Number or Animatable allowed!"); -+ } -+ } -+ -+ public void setProperty(String name) { -+ propertyName = name; -+ setValueDelegate(new PropertyDelegate(object, propertyName)); -+ } -+ -+ public String getProperty() { -+ return propertyName; -+ } -+ -+ public PropertyInterface getAnimatedObject() { -+ return object; -+ } -+ -+ public void setAnimatedObject(PropertyInterface object) { -+ this.object = object; -+ setValueDelegate(new PropertyDelegate(object, propertyName)); -+ } -+} ---- net/minecraft/src/RenderSlime.java -+++ net/minecraft/src/RenderSlime.java -@@ -6,22 +6,25 @@ - private static final ResourceLocation slimeTextures = new ResourceLocation("textures/entity/slime/slime.png"); - private ModelBase scaleAmount; - -- public RenderSlime(ModelBase var1, ModelBase var2, float var3) { -- super(var1, var3); -- this.scaleAmount = var2; -+ public RenderSlime(ModelBase par1ModelBase, ModelBase par2ModelBase, float par3) { -+ super(par1ModelBase, par3); -+ this.scaleAmount = par2ModelBase; - } - -- protected int shouldSlimeRenderPass(EntitySlime var1, int var2, float var3) { -- if(var1.isInvisible()) { -+ /** -+ * Determines whether Slime Render should pass or not. -+ */ -+ protected int shouldSlimeRenderPass(EntitySlime par1EntitySlime, int par2, float par3) { -+ if (par1EntitySlime.isInvisible()) { - return 0; -- } else if(var2 == 0) { -+ } else if (par2 == 0) { - this.setRenderPassModel(this.scaleAmount); - GL11.glEnable(GL11.GL_NORMALIZE); - GL11.glEnable(GL11.GL_BLEND); - GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); - return 1; - } else { -- if(var2 == 1) { -+ if (par2 == 1) { - GL11.glDisable(GL11.GL_BLEND); - GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - } -@@ -30,26 +33,39 @@ - } - } - -- protected void scaleSlime(EntitySlime var1, float var2) { -- float var3 = (float)var1.getSlimeSize(); -- float var4 = (var1.prevSquishFactor + (var1.squishFactor - var1.prevSquishFactor) * var2) / (var3 * 0.5F + 1.0F); -+ /** -+ * sets the scale for the slime based on getSlimeSize in EntitySlime -+ */ -+ protected void scaleSlime(EntitySlime par1EntitySlime, float par2) { -+ float var3 = (float)par1EntitySlime.getSlimeSize(); -+ float var4 = (par1EntitySlime.prevSquishFactor + (par1EntitySlime.squishFactor - par1EntitySlime.prevSquishFactor) * par2) / (var3 * 0.5F + 1.0F); - float var5 = 1.0F / (var4 + 1.0F); - GL11.glScalef(var5 * var3, 1.0F / var5 * var3, var5 * var3); - } - -- protected ResourceLocation getSlimeTextures(EntitySlime var1) { -+ protected ResourceLocation getSlimeTextures(EntitySlime par1EntitySlime) { - return slimeTextures; - } - -- protected void preRenderCallback(EntityLivingBase var1, float var2) { -- this.scaleSlime((EntitySlime)var1, var2); -- } -- -- protected int shouldRenderPass(EntityLivingBase var1, int var2, float var3) { -- return this.shouldSlimeRenderPass((EntitySlime)var1, var2, var3); -- } -- -- protected ResourceLocation getEntityTexture(Entity var1) { -- return this.getSlimeTextures((EntitySlime)var1); -+ /** -+ * Allows the render to do any OpenGL state modifications necessary before the model is rendered. Args: entityLiving, -+ * partialTickTime -+ */ -+ protected void preRenderCallback(EntityLivingBase par1EntityLivingBase, float par2) { -+ this.scaleSlime((EntitySlime)par1EntityLivingBase, par2); -+ } -+ -+ /** -+ * Queries whether should render the specified pass or not. -+ */ -+ protected int shouldRenderPass(EntityLivingBase par1EntityLivingBase, int par2, float par3) { -+ return this.shouldSlimeRenderPass((EntitySlime)par1EntityLivingBase, par2, par3); -+ } -+ -+ /** -+ * Returns the location of an entity's texture. Doesn't seem to be called unless you call Render.bindEntityTexture. -+ */ -+ protected ResourceLocation getEntityTexture(Entity par1Entity) { -+ return this.getSlimeTextures((EntitySlime)par1Entity); - } - } ---- net/minecraft/src/ThreadOnlineConnect.java -+++ net/minecraft/src/ThreadOnlineConnect.java -@@ -4,45 +4,47 @@ - import java.net.UnknownHostException; - - class ThreadOnlineConnect extends Thread { -- final String a; -+ final String field_96595_a; -+ - final int field_96593_b; -+ - final TaskOnlineConnect field_96594_c; - -- ThreadOnlineConnect(TaskOnlineConnect var1, String var2, int var3) { -- this.field_96594_c = var1; -- this.a = var2; -- this.field_96593_b = var3; -+ ThreadOnlineConnect(TaskOnlineConnect par1TaskOnlineConnect, String par2Str, int par3) { -+ this.field_96594_c = par1TaskOnlineConnect; -+ this.field_96595_a = par2Str; -+ this.field_96593_b = par3; - } - - public void run() { - try { -- TaskOnlineConnect.func_96583_a(this.field_96594_c, new NetClientHandler(this.field_96594_c.getMinecraft(), this.a, this.field_96593_b, TaskOnlineConnect.func_98172_a(this.field_96594_c))); -- if(this.field_96594_c.wasScreenClosed()) { -+ TaskOnlineConnect.func_96583_a(this.field_96594_c, new NetClientHandler(this.field_96594_c.getMinecraft(), this.field_96595_a, this.field_96593_b, TaskOnlineConnect.func_98172_a(this.field_96594_c))); -+ -+ if (this.field_96594_c.wasScreenClosed()) { - return; - } - - this.field_96594_c.setMessage(I18n.getString("mco.connect.authorizing")); -- TaskOnlineConnect.func_96580_a(this.field_96594_c).addToSendQueue(new Packet2ClientProtocol(78, this.field_96594_c.getMinecraft().getSession().getUsername(), this.a, this.field_96593_b)); -+ TaskOnlineConnect.func_96580_a(this.field_96594_c).addToSendQueue(new Packet2ClientProtocol(78, this.field_96594_c.getMinecraft().getSession().getUsername(), this.field_96595_a, this.field_96593_b)); - } catch (UnknownHostException var2) { -- if(this.field_96594_c.wasScreenClosed()) { -+ if (this.field_96594_c.wasScreenClosed()) { - return; - } - -- this.field_96594_c.getMinecraft().displayGuiScreen(new GuiScreenDisconnectedOnline(TaskOnlineConnect.func_98172_a(this.field_96594_c), "connect.failed", "disconnect.genericReason", new Object[]{"Unknown host \'" + this.a + "\'"})); -+ this.field_96594_c.getMinecraft().displayGuiScreen(new GuiScreenDisconnectedOnline(TaskOnlineConnect.func_98172_a(this.field_96594_c), "connect.failed", "disconnect.genericReason", new Object[] {"Unknown host \'" + this.field_96595_a + "\'"})); - } catch (ConnectException var3) { -- if(this.field_96594_c.wasScreenClosed()) { -+ if (this.field_96594_c.wasScreenClosed()) { - return; - } - -- this.field_96594_c.getMinecraft().displayGuiScreen(new GuiScreenDisconnectedOnline(TaskOnlineConnect.func_98172_a(this.field_96594_c), "connect.failed", "disconnect.genericReason", new Object[]{var3.getMessage()})); -+ this.field_96594_c.getMinecraft().displayGuiScreen(new GuiScreenDisconnectedOnline(TaskOnlineConnect.func_98172_a(this.field_96594_c), "connect.failed", "disconnect.genericReason", new Object[] {var3.getMessage()})); - } catch (Exception var4) { -- if(this.field_96594_c.wasScreenClosed()) { -+ if (this.field_96594_c.wasScreenClosed()) { - return; - } - - var4.printStackTrace(); -- this.field_96594_c.getMinecraft().displayGuiScreen(new GuiScreenDisconnectedOnline(TaskOnlineConnect.func_98172_a(this.field_96594_c), "connect.failed", "disconnect.genericReason", new Object[]{var4.toString()})); -+ this.field_96594_c.getMinecraft().displayGuiScreen(new GuiScreenDisconnectedOnline(TaskOnlineConnect.func_98172_a(this.field_96594_c), "connect.failed", "disconnect.genericReason", new Object[] {var4.toString()})); - } -- - } - } ---- net/minecraft/src/MouseHelper.java -+++ net/minecraft/src/MouseHelper.java -@@ -4,15 +4,25 @@ - import org.lwjgl.opengl.Display; - - public class MouseHelper { -+ -+ /** Mouse delta X this frame */ - public int deltaX; -+ -+ /** Mouse delta Y this frame */ - public int deltaY; - -+ /** -+ * Grabs the mouse cursor it doesn't move and isn't seen. -+ */ - public void grabMouseCursor() { - Mouse.setGrabbed(true); - this.deltaX = 0; - this.deltaY = 0; - } - -+ /** -+ * Ungrabs the mouse cursor so it can be moved and set it to the center of the screen -+ */ - public void ungrabMouseCursor() { - Mouse.setCursorPosition(Display.getWidth() / 2, Display.getHeight() / 2); - Mouse.setGrabbed(false); ---- net/minecraft/src/GuiScreenBackupRestoreTask.java -+++ net/minecraft/src/GuiScreenBackupRestoreTask.java -@@ -1,12 +1,16 @@ - package net.minecraft.src; - - class GuiScreenBackupRestoreTask extends TaskLongRunning { -+ -+ /** The backup being restored */ - private final Backup theBackup; -+ -+ /** The screen running this task */ - final GuiScreenBackup theBackupScreen; - -- private GuiScreenBackupRestoreTask(GuiScreenBackup var1, Backup var2) { -- this.theBackupScreen = var1; -- this.theBackup = var2; -+ private GuiScreenBackupRestoreTask(GuiScreenBackup par1GuiScreenBackup, Backup par2Backup) { -+ this.theBackupScreen = par1GuiScreenBackup; -+ this.theBackup = par2Backup; - } - - public void run() { -@@ -14,7 +18,7 @@ - - try { - McoClient var1 = new McoClient(this.getMinecraft().getSession()); -- var1.func_111235_c(GuiScreenBackup.func_110367_b(this.theBackupScreen), this.theBackup.a); -+ var1.func_111235_c(GuiScreenBackup.func_110367_b(this.theBackupScreen), this.theBackup.field_110727_a); - - try { - Thread.sleep(1000L); -@@ -29,10 +33,9 @@ - } catch (Exception var5) { - this.setFailedMessage(var5.getLocalizedMessage()); - } -- - } - -- GuiScreenBackupRestoreTask(GuiScreenBackup var1, Backup var2, GuiScreenBackupDownloadThread var3) { -- this(var1, var2); -+ GuiScreenBackupRestoreTask(GuiScreenBackup par1GuiScreenBackup, Backup par2Backup, GuiScreenBackupDownloadThread par3GuiScreenBackupDownloadThread) { -+ this(par1GuiScreenBackup, par2Backup); - } - } ---- /dev/null -+++ org/spoutcraft/client/gui/settings/controls/VoidFogButton.java -@@ -1,0 +1,48 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.client.gui.settings.controls; -+ -+import org.spoutcraft.api.gui.GenericCheckBox; -+import org.spoutcraft.client.SpoutClient; -+import org.spoutcraft.client.config.Configuration; -+ -+public class VoidFogButton extends GenericCheckBox { -+ public VoidFogButton() { -+ super("Void Fog"); -+ setChecked(Configuration.isVoidFog()); -+ setEnabled(SpoutClient.getInstance().isVoidFogCheat()); -+ setTooltip("Void Fog\nON - A dark fog that obscures vision appears at low\nlevels of the map.\nOFF - normal view distance at all height levels."); -+ } -+ -+ @Override -+ public String getTooltip() { -+ if (!isEnabled()) { -+ return "This option is not allowed by your server, it is considered cheating."; -+ } -+ -+ return super.getTooltip(); -+ } -+ -+ @Override -+ public void onButtonClick() { -+ Configuration.setVoidFog(!Configuration.isVoidFog()); -+ Configuration.write(); -+ } -+} ---- net/minecraft/src/MetadataSerializer.java -+++ net/minecraft/src/MetadataSerializer.java -@@ -2,43 +2,49 @@ - - import com.google.gson.Gson; - import com.google.gson.GsonBuilder; --import com.google.gson.JsonElement; - import com.google.gson.JsonObject; --import java.lang.reflect.Type; - - public class MetadataSerializer { - private final IRegistry metadataSectionSerializerRegistry = new RegistrySimple(); -- private final GsonBuilder b = new GsonBuilder(); -- private Gson c; -- -- public void registerMetadataSectionType(MetadataSectionSerializer var1, Class var2) { -- this.metadataSectionSerializerRegistry.putObject(var1.getSectionName(), new MetadataSerializerRegistration(this, var1, var2, (MetadataSerializerEmptyAnon)null)); -- this.b.registerTypeAdapter(var2, var1); -- this.c = null; -+ private final GsonBuilder gsonBuilder = new GsonBuilder(); -+ -+ /** -+ * Cached Gson instance. Set to null when more sections are registered, and then re-created from the builder. -+ */ -+ private Gson gson; -+ -+ public void registerMetadataSectionType(MetadataSectionSerializer par1MetadataSectionSerializer, Class par2Class) { -+ this.metadataSectionSerializerRegistry.putObject(par1MetadataSectionSerializer.getSectionName(), new MetadataSerializerRegistration(this, par1MetadataSectionSerializer, par2Class, (MetadataSerializerEmptyAnon)null)); -+ this.gsonBuilder.registerTypeAdapter(par2Class, par1MetadataSectionSerializer); -+ this.gson = null; - } - -- public MetadataSection parseMetadataSection(String var1, JsonObject var2) { -- if(var1 == null) { -+ public MetadataSection parseMetadataSection(String par1Str, JsonObject par2JsonObject) { -+ if (par1Str == null) { - throw new IllegalArgumentException("Metadata section name cannot be null"); -- } else if(!var2.has(var1)) { -+ } else if (!par2JsonObject.has(par1Str)) { - return null; -- } else if(!var2.get(var1).isJsonObject()) { -- throw new IllegalArgumentException("Invalid metadata for \'" + var1 + "\' - expected object, found " + var2.get(var1)); -+ } else if (!par2JsonObject.get(par1Str).isJsonObject()) { -+ throw new IllegalArgumentException("Invalid metadata for \'" + par1Str + "\' - expected object, found " + par2JsonObject.get(par1Str)); - } else { -- MetadataSerializerRegistration var3 = (MetadataSerializerRegistration)this.metadataSectionSerializerRegistry.getObject(var1); -- if(var3 == null) { -- throw new IllegalArgumentException("Don\'t know how to handle metadata section \'" + var1 + "\'"); -+ MetadataSerializerRegistration var3 = (MetadataSerializerRegistration)this.metadataSectionSerializerRegistry.getObject(par1Str); -+ -+ if (var3 == null) { -+ throw new IllegalArgumentException("Don\'t know how to handle metadata section \'" + par1Str + "\'"); - } else { -- return (MetadataSection)this.getGson().fromJson((JsonElement)var2.getAsJsonObject(var1), (Type)var3.b); -+ return (MetadataSection)this.getGson().fromJson(par2JsonObject.getAsJsonObject(par1Str), var3.field_110500_b); - } - } - } - -+ /** -+ * Returns a Gson instance with type adapters registered for metadata sections. -+ */ - private Gson getGson() { -- if(this.c == null) { -- this.c = this.b.create(); -+ if (this.gson == null) { -+ this.gson = this.gsonBuilder.create(); - } - -- return this.c; -+ return this.gson; - } - } ---- /dev/null -+++ org/spoutcraft/api/gui/OverlayScreen.java -@@ -1,0 +1,32 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.api.gui; -+ -+import org.spoutcraft.api.UnsafeClass; -+ -+@UnsafeClass -+public interface OverlayScreen extends Screen { -+ /** -+ * Sets the screen type -+ * @param screenType -+ * @return this -+ */ -+ public OverlayScreen setScreenType(ScreenType screenType); -+} ---- /dev/null -+++ org/spoutcraft/api/material/Item.java -@@ -1,0 +1,23 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.api.material; -+ -+public interface Item extends Material{ -+} ---- /dev/null -+++ org/spoutcraft/api/keyboard/KeyBindingPress.java -@@ -1,0 +1,47 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.api.keyboard; -+ -+import org.spoutcraft.api.gui.Keyboard; -+import org.spoutcraft.api.gui.ScreenType; -+ -+public class KeyBindingPress { -+ private Keyboard key; -+ private KeyBinding binding; -+ private ScreenType screen; -+ -+ public KeyBindingPress(Keyboard key, KeyBinding binding, ScreenType screen) { -+ this.key = key; -+ this.binding = binding; -+ this.screen = screen; -+ } -+ -+ public Keyboard getKey() { -+ return key; -+ } -+ -+ public KeyBinding getBinding() { -+ return binding; -+ } -+ -+ public ScreenType getScreen() { -+ return screen; -+ } -+} ---- net/minecraft/src/EntityTameable.java -+++ net/minecraft/src/EntityTameable.java -@@ -3,8 +3,8 @@ - public abstract class EntityTameable extends EntityAnimal implements EntityOwnable { - protected EntityAISit aiSit = new EntityAISit(this); - -- public EntityTameable(World var1) { -- super(var1); -+ public EntityTameable(World par1World) { -+ super(par1World); - } - - protected void entityInit() { -@@ -13,89 +13,99 @@ - this.dataWatcher.addObject(17, ""); - } - -- public void writeEntityToNBT(NBTTagCompound var1) { -- super.writeEntityToNBT(var1); -- if(this.getOwnerName() == null) { -- var1.setString("Owner", ""); -+ /** -+ * (abstract) Protected helper method to write subclass entity data to NBT. -+ */ -+ public void writeEntityToNBT(NBTTagCompound par1NBTTagCompound) { -+ super.writeEntityToNBT(par1NBTTagCompound); -+ -+ if (this.getOwnerName() == null) { -+ par1NBTTagCompound.setString("Owner", ""); - } else { -- var1.setString("Owner", this.getOwnerName()); -+ par1NBTTagCompound.setString("Owner", this.getOwnerName()); - } - -- var1.setBoolean("Sitting", this.isSitting()); -+ par1NBTTagCompound.setBoolean("Sitting", this.isSitting()); - } - -- public void readEntityFromNBT(NBTTagCompound var1) { -- super.readEntityFromNBT(var1); -- String var2 = var1.getString("Owner"); -- if(var2.length() > 0) { -+ /** -+ * (abstract) Protected helper method to read subclass entity data from NBT. -+ */ -+ public void readEntityFromNBT(NBTTagCompound par1NBTTagCompound) { -+ super.readEntityFromNBT(par1NBTTagCompound); -+ String var2 = par1NBTTagCompound.getString("Owner"); -+ -+ if (var2.length() > 0) { - this.setOwner(var2); - this.setTamed(true); - } - -- this.aiSit.setSitting(var1.getBoolean("Sitting")); -- this.setSitting(var1.getBoolean("Sitting")); -+ this.aiSit.setSitting(par1NBTTagCompound.getBoolean("Sitting")); -+ this.setSitting(par1NBTTagCompound.getBoolean("Sitting")); - } - -- protected void playTameEffect(boolean var1) { -+ /** -+ * Play the taming effect, will either be hearts or smoke depending on status -+ */ -+ protected void playTameEffect(boolean par1) { - String var2 = "heart"; -- if(!var1) { -+ -+ if (!par1) { - var2 = "smoke"; - } - -- for(int var3 = 0; var3 < 7; ++var3) { -- double var4 = this.ab.nextGaussian() * 0.02D; -- double var6 = this.ab.nextGaussian() * 0.02D; -- double var8 = this.ab.nextGaussian() * 0.02D; -- this.worldObj.spawnParticle(var2, this.posX + (double)(this.ab.nextFloat() * this.width * 2.0F) - (double)this.width, this.posY + 0.5D + (double)(this.ab.nextFloat() * this.height), this.posZ + (double)(this.ab.nextFloat() * this.width * 2.0F) - (double)this.width, var4, var6, var8); -+ for (int var3 = 0; var3 < 7; ++var3) { -+ double var4 = this.rand.nextGaussian() * 0.02D; -+ double var6 = this.rand.nextGaussian() * 0.02D; -+ double var8 = this.rand.nextGaussian() * 0.02D; -+ this.worldObj.spawnParticle(var2, this.posX + (double)(this.rand.nextFloat() * this.width * 2.0F) - (double)this.width, this.posY + 0.5D + (double)(this.rand.nextFloat() * this.height), this.posZ + (double)(this.rand.nextFloat() * this.width * 2.0F) - (double)this.width, var4, var6, var8); - } -- - } - -- public void handleHealthUpdate(byte var1) { -- if(var1 == 7) { -+ public void handleHealthUpdate(byte par1) { -+ if (par1 == 7) { - this.playTameEffect(true); -- } else if(var1 == 6) { -+ } else if (par1 == 6) { - this.playTameEffect(false); - } else { -- super.handleHealthUpdate(var1); -+ super.handleHealthUpdate(par1); - } -- - } - - public boolean isTamed() { - return (this.dataWatcher.getWatchableObjectByte(16) & 4) != 0; - } - -- public void setTamed(boolean var1) { -+ public void setTamed(boolean par1) { - byte var2 = this.dataWatcher.getWatchableObjectByte(16); -- if(var1) { -+ -+ if (par1) { - this.dataWatcher.updateObject(16, Byte.valueOf((byte)(var2 | 4))); - } else { - this.dataWatcher.updateObject(16, Byte.valueOf((byte)(var2 & -5))); - } -- - } - - public boolean isSitting() { - return (this.dataWatcher.getWatchableObjectByte(16) & 1) != 0; - } - -- public void setSitting(boolean var1) { -+ public void setSitting(boolean par1) { - byte var2 = this.dataWatcher.getWatchableObjectByte(16); -- if(var1) { -+ -+ if (par1) { - this.dataWatcher.updateObject(16, Byte.valueOf((byte)(var2 | 1))); - } else { - this.dataWatcher.updateObject(16, Byte.valueOf((byte)(var2 & -2))); - } -- - } - - public String getOwnerName() { - return this.dataWatcher.getWatchableObjectString(17); - } - -- public void setOwner(String var1) { -- this.dataWatcher.updateObject(17, var1); -+ public void setOwner(String par1Str) { -+ this.dataWatcher.updateObject(17, par1Str); - } - - public EntityLivingBase func_130012_q() { -@@ -106,14 +116,15 @@ - return this.aiSit; - } - -- public boolean func_142018_a(EntityLivingBase var1, EntityLivingBase var2) { -+ public boolean func_142018_a(EntityLivingBase par1EntityLivingBase, EntityLivingBase par2EntityLivingBase) { - return true; - } - - public Team getTeam() { -- if(this.isTamed()) { -+ if (this.isTamed()) { - EntityLivingBase var1 = this.func_130012_q(); -- if(var1 != null) { -+ -+ if (var1 != null) { - return var1.getTeam(); - } - } -@@ -121,19 +132,20 @@ - return super.getTeam(); - } - -- public boolean isOnSameTeam(EntityLivingBase var1) { -- if(this.isTamed()) { -+ public boolean isOnSameTeam(EntityLivingBase par1EntityLivingBase) { -+ if (this.isTamed()) { - EntityLivingBase var2 = this.func_130012_q(); -- if(var1 == var2) { -+ -+ if (par1EntityLivingBase == var2) { - return true; - } - -- if(var2 != null) { -- return var2.isOnSameTeam(var1); -+ if (var2 != null) { -+ return var2.isOnSameTeam(par1EntityLivingBase); - } - } - -- return super.isOnSameTeam(var1); -+ return super.isOnSameTeam(par1EntityLivingBase); - } - - public Entity getOwner() { ---- net/minecraft/src/BlockBrewingStand.java -+++ net/minecraft/src/BlockBrewingStand.java -@@ -4,119 +4,173 @@ - import java.util.Random; - - public class BlockBrewingStand extends BlockContainer { -- private Random a = new Random(); -+ private Random rand = new Random(); - private Icon theIcon; - -- public BlockBrewingStand(int var1) { -- super(var1, Material.iron); -+ public BlockBrewingStand(int par1) { -+ super(par1, Material.iron); - } - -+ /** -+ * Is this block (a) opaque and (b) a full 1m cube? This determines whether or not to render the shared face of two -+ * adjacent blocks and also whether the player can attach torches, redstone wire, etc to this block. -+ */ - public boolean isOpaqueCube() { - return false; - } - -+ /** -+ * The type of render function that is called for this block -+ */ - public int getRenderType() { - return 25; - } - -- public TileEntity createNewTileEntity(World var1) { -+ /** -+ * Returns a new instance of a block's tile entity class. Called on placing the block. -+ */ -+ public TileEntity createNewTileEntity(World par1World) { - return new TileEntityBrewingStand(); - } - -+ /** -+ * If this block doesn't render as an ordinary block it will return False (examples: signs, buttons, stairs, etc) -+ */ - public boolean renderAsNormalBlock() { - return false; - } - -- public void addCollisionBoxesToList(World var1, int var2, int var3, int var4, AxisAlignedBB var5, List var6, Entity var7) { -- this.setBlockBounds(7.0F / 16.0F, 0.0F, 7.0F / 16.0F, 9.0F / 16.0F, 14.0F / 16.0F, 9.0F / 16.0F); -- super.addCollisionBoxesToList(var1, var2, var3, var4, var5, var6, var7); -+ /** -+ * Adds all intersecting collision boxes to a list. (Be sure to only add boxes to the list if they intersect the mask.) -+ * Parameters: World, X, Y, Z, mask, list, colliding entity -+ */ -+ public void addCollisionBoxesToList(World par1World, int par2, int par3, int par4, AxisAlignedBB par5AxisAlignedBB, List par6List, Entity par7Entity) { -+ this.setBlockBounds(0.4375F, 0.0F, 0.4375F, 0.5625F, 0.875F, 0.5625F); -+ super.addCollisionBoxesToList(par1World, par2, par3, par4, par5AxisAlignedBB, par6List, par7Entity); - this.setBlockBoundsForItemRender(); -- super.addCollisionBoxesToList(var1, var2, var3, var4, var5, var6, var7); -+ super.addCollisionBoxesToList(par1World, par2, par3, par4, par5AxisAlignedBB, par6List, par7Entity); - } - -+ /** -+ * Sets the block's bounds for rendering it as an item -+ */ - public void setBlockBoundsForItemRender() { -- this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 2.0F / 16.0F, 1.0F); -+ this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.125F, 1.0F); - } - -- public boolean onBlockActivated(World var1, int var2, int var3, int var4, EntityPlayer var5, int var6, float var7, float var8, float var9) { -- if(var1.isRemote) { -+ /** -+ * Called upon block activation (right click on the block.) -+ */ -+ public boolean onBlockActivated(World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer, int par6, float par7, float par8, float par9) { -+ if (par1World.isRemote) { - return true; - } else { -- TileEntityBrewingStand var10 = (TileEntityBrewingStand)var1.getBlockTileEntity(var2, var3, var4); -- if(var10 != null) { -- var5.displayGUIBrewingStand(var10); -+ TileEntityBrewingStand var10 = (TileEntityBrewingStand)par1World.getBlockTileEntity(par2, par3, par4); -+ -+ if (var10 != null) { -+ par5EntityPlayer.displayGUIBrewingStand(var10); - } - - return true; - } - } - -- public void onBlockPlacedBy(World var1, int var2, int var3, int var4, EntityLivingBase var5, ItemStack var6) { -- if(var6.hasDisplayName()) { -- ((TileEntityBrewingStand)var1.getBlockTileEntity(var2, var3, var4)).func_94131_a(var6.getDisplayName()); -+ /** -+ * Called when the block is placed in the world. -+ */ -+ public void onBlockPlacedBy(World par1World, int par2, int par3, int par4, EntityLivingBase par5EntityLivingBase, ItemStack par6ItemStack) { -+ if (par6ItemStack.hasDisplayName()) { -+ ((TileEntityBrewingStand)par1World.getBlockTileEntity(par2, par3, par4)).func_94131_a(par6ItemStack.getDisplayName()); - } -- -- } -- -- public void randomDisplayTick(World var1, int var2, int var3, int var4, Random var5) { -- double var6 = (double)((float)var2 + 0.4F + var5.nextFloat() * 0.2F); -- double var8 = (double)((float)var3 + 0.7F + var5.nextFloat() * 0.3F); -- double var10 = (double)((float)var4 + 0.4F + var5.nextFloat() * 0.2F); -- var1.spawnParticle("smoke", var6, var8, var10, 0.0D, 0.0D, 0.0D); -- } -- -- public void breakBlock(World var1, int var2, int var3, int var4, int var5, int var6) { -- TileEntity var7 = var1.getBlockTileEntity(var2, var3, var4); -- if(var7 instanceof TileEntityBrewingStand) { -+ } -+ -+ /** -+ * A randomly called display update to be able to add particles or other items for display -+ */ -+ public void randomDisplayTick(World par1World, int par2, int par3, int par4, Random par5Random) { -+ double var6 = (double)((float)par2 + 0.4F + par5Random.nextFloat() * 0.2F); -+ double var8 = (double)((float)par3 + 0.7F + par5Random.nextFloat() * 0.3F); -+ double var10 = (double)((float)par4 + 0.4F + par5Random.nextFloat() * 0.2F); -+ par1World.spawnParticle("smoke", var6, var8, var10, 0.0D, 0.0D, 0.0D); -+ } -+ -+ /** -+ * Called on server worlds only when the block has been replaced by a different block ID, or the same block with a -+ * different metadata value, but before the new metadata value is set. Args: World, x, y, z, old block ID, old metadata -+ */ -+ public void breakBlock(World par1World, int par2, int par3, int par4, int par5, int par6) { -+ TileEntity var7 = par1World.getBlockTileEntity(par2, par3, par4); -+ -+ if (var7 instanceof TileEntityBrewingStand) { - TileEntityBrewingStand var8 = (TileEntityBrewingStand)var7; - -- for(int var9 = 0; var9 < var8.getSizeInventory(); ++var9) { -+ for (int var9 = 0; var9 < var8.getSizeInventory(); ++var9) { - ItemStack var10 = var8.getStackInSlot(var9); -- if(var10 != null) { -- float var11 = this.a.nextFloat() * 0.8F + 0.1F; -- float var12 = this.a.nextFloat() * 0.8F + 0.1F; -- float var13 = this.a.nextFloat() * 0.8F + 0.1F; -- -- while(var10.stackSize > 0) { -- int var14 = this.a.nextInt(21) + 10; -- if(var14 > var10.stackSize) { -+ -+ if (var10 != null) { -+ float var11 = this.rand.nextFloat() * 0.8F + 0.1F; -+ float var12 = this.rand.nextFloat() * 0.8F + 0.1F; -+ float var13 = this.rand.nextFloat() * 0.8F + 0.1F; -+ -+ while (var10.stackSize > 0) { -+ int var14 = this.rand.nextInt(21) + 10; -+ -+ if (var14 > var10.stackSize) { - var14 = var10.stackSize; - } - - var10.stackSize -= var14; -- EntityItem var15 = new EntityItem(var1, (double)((float)var2 + var11), (double)((float)var3 + var12), (double)((float)var4 + var13), new ItemStack(var10.itemID, var14, var10.getItemDamage())); -+ EntityItem var15 = new EntityItem(par1World, (double)((float)par2 + var11), (double)((float)par3 + var12), (double)((float)par4 + var13), new ItemStack(var10.itemID, var14, var10.getItemDamage())); - float var16 = 0.05F; -- var15.motionX = (double)((float)this.a.nextGaussian() * var16); -- var15.motionY = (double)((float)this.a.nextGaussian() * var16 + 0.2F); -- var15.motionZ = (double)((float)this.a.nextGaussian() * var16); -- var1.spawnEntityInWorld(var15); -+ var15.motionX = (double)((float)this.rand.nextGaussian() * var16); -+ var15.motionY = (double)((float)this.rand.nextGaussian() * var16 + 0.2F); -+ var15.motionZ = (double)((float)this.rand.nextGaussian() * var16); -+ par1World.spawnEntityInWorld(var15); - } - } - } - } - -- super.breakBlock(var1, var2, var3, var4, var5, var6); -- } -- -- public int idDropped(int var1, Random var2, int var3) { -- return Item.brewingStand.itemID; -- } -- -- public int idPicked(World var1, int var2, int var3, int var4) { -- return Item.brewingStand.itemID; -- } -- -+ super.breakBlock(par1World, par2, par3, par4, par5, par6); -+ } -+ -+ /** -+ * Returns the ID of the items to drop on destruction. -+ */ -+ public int idDropped(int par1, Random par2Random, int par3) { -+ return Item.brewingStand.itemID; -+ } -+ -+ /** -+ * only called by clickMiddleMouseButton , and passed to inventory.setCurrentItem (along with isCreative) -+ */ -+ public int idPicked(World par1World, int par2, int par3, int par4) { -+ return Item.brewingStand.itemID; -+ } -+ -+ /** -+ * If this returns true, then comparators facing away from this block will use the value from -+ * getComparatorInputOverride instead of the actual redstone signal strength. -+ */ - public boolean hasComparatorInputOverride() { - return true; - } - -- public int getComparatorInputOverride(World var1, int var2, int var3, int var4, int var5) { -- return Container.calcRedstoneFromInventory((IInventory)var1.getBlockTileEntity(var2, var3, var4)); -+ /** -+ * If hasComparatorInputOverride returns true, the return value from this is used instead of the redstone signal -+ * strength when this block inputs to a comparator. -+ */ -+ public int getComparatorInputOverride(World par1World, int par2, int par3, int par4, int par5) { -+ return Container.calcRedstoneFromInventory((IInventory)par1World.getBlockTileEntity(par2, par3, par4)); - } - -- public void registerIcons(IconRegister var1) { -- super.registerIcons(var1); -- this.theIcon = var1.registerIcon(this.getTextureName() + "_base"); -+ /** -+ * When this method is called, your block should register all the icons it needs with the given IconRegister. This is -+ * the only chance you get to register icons. -+ */ -+ public void registerIcons(IconRegister par1IconRegister) { -+ super.registerIcons(par1IconRegister); -+ this.theIcon = par1IconRegister.registerIcon(this.getTextureName() + "_base"); - } - - public Icon getBrewingStandIcon() { ---- net/minecraft/src/EntityCreature.java -+++ net/minecraft/src/EntityCreature.java -@@ -3,42 +3,63 @@ - import java.util.UUID; - - public abstract class EntityCreature extends EntityLiving { -- public static final UUID h = UUID.fromString("E199AD21-BA8A-4C53-8D13-6182D5C69D3A"); -- public static final AttributeModifier field_110181_i = (new AttributeModifier(h, "Fleeing speed bonus", 2.0D, 2)).setSaved(false); -- private PathEntity pathToEntity; -- protected Entity entityToAttack; -+ public static final UUID field_110179_h = UUID.fromString("E199AD21-BA8A-4C53-8D13-6182D5C69D3A"); -+ public static final AttributeModifier field_110181_i = (new AttributeModifier(field_110179_h, "Fleeing speed bonus", 2.0D, 2)).setSaved(false); -+ // Spout Start - private to public -+ public PathEntity pathToEntity; -+ // Spout End -+ -+ /** The Entity this EntityCreature is set to attack. */ -+ // Spout Start - private to public -+ public Entity entityToAttack; -+ // Spout End -+ -+ /** -+ * returns true if a creature has attacked recently only used for creepers and skeletons -+ */ - protected boolean hasAttacked; -+ -+ /** Used to make a creature speed up and wander away when hit. */ - protected int fleeingTick; - private ChunkCoordinates homePosition = new ChunkCoordinates(0, 0, 0); -+ -+ /** If -1 there is no maximum distance */ - private float maximumHomeDistance = -1.0F; - private EntityAIBase field_110178_bs = new EntityAIMoveTowardsRestriction(this, 1.0D); - private boolean field_110180_bt; - -- public EntityCreature(World var1) { -- super(var1); -+ public EntityCreature(World par1World) { -+ super(par1World); - } - -+ /** -+ * Disables a mob's ability to move on its own while true. -+ */ - protected boolean isMovementCeased() { - return false; - } - - protected void updateEntityActionState() { - this.worldObj.theProfiler.startSection("ai"); -- if(this.fleeingTick > 0 && --this.fleeingTick == 0) { -+ -+ if (this.fleeingTick > 0 && --this.fleeingTick == 0) { - AttributeInstance var1 = this.getEntityAttribute(SharedMonsterAttributes.movementSpeed); - var1.removeModifier(field_110181_i); - } - - this.hasAttacked = this.isMovementCeased(); - float var21 = 16.0F; -- if(this.entityToAttack == null) { -+ -+ if (this.entityToAttack == null) { - this.entityToAttack = this.findPlayerToAttack(); -- if(this.entityToAttack != null) { -+ -+ if (this.entityToAttack != null) { - this.pathToEntity = this.worldObj.getPathEntityToEntity(this, this.entityToAttack, var21, true, false, false, true); - } -- } else if(this.entityToAttack.isEntityAlive()) { -+ } else if (this.entityToAttack.isEntityAlive()) { - float var2 = this.entityToAttack.getDistanceToEntity(this); -- if(this.canEntityBeSeen(this.entityToAttack)) { -+ -+ if (this.canEntityBeSeen(this.entityToAttack)) { - this.attackEntity(this.entityToAttack, var2); - } - } else { -@@ -46,26 +67,27 @@ - } - - this.worldObj.theProfiler.endSection(); -- if(this.hasAttacked || this.entityToAttack == null || this.pathToEntity != null && this.ab.nextInt(20) != 0) { -- if(!this.hasAttacked && (this.pathToEntity == null && this.ab.nextInt(180) == 0 || this.ab.nextInt(120) == 0 || this.fleeingTick > 0) && this.entityAge < 100) { -- this.updateWanderPath(); -- } -- } else { -+ -+ if (!this.hasAttacked && this.entityToAttack != null && (this.pathToEntity == null || this.rand.nextInt(20) == 0)) { - this.pathToEntity = this.worldObj.getPathEntityToEntity(this, this.entityToAttack, var21, true, false, false, true); -+ } else if (!this.hasAttacked && (this.pathToEntity == null && this.rand.nextInt(180) == 0 || this.rand.nextInt(120) == 0 || this.fleeingTick > 0) && this.entityAge < 100) { -+ this.updateWanderPath(); - } - - int var22 = MathHelper.floor_double(this.boundingBox.minY + 0.5D); - boolean var3 = this.isInWater(); - boolean var4 = this.handleLavaMovement(); - this.rotationPitch = 0.0F; -- if(this.pathToEntity != null && this.ab.nextInt(100) != 0) { -+ -+ if (this.pathToEntity != null && this.rand.nextInt(100) != 0) { - this.worldObj.theProfiler.startSection("followpath"); - Vec3 var5 = this.pathToEntity.getPosition(this); - double var6 = (double)(this.width * 2.0F); - -- while(var5 != null && var5.squareDistanceTo(this.posX, var5.yCoord, this.posZ) < var6 * var6) { -+ while (var5 != null && var5.squareDistanceTo(this.posX, var5.yCoord, this.posZ) < var6 * var6) { - this.pathToEntity.incrementPathIndex(); -- if(this.pathToEntity.isFinished()) { -+ -+ if (this.pathToEntity.isFinished()) { - var5 = null; - this.pathToEntity = null; - } else { -@@ -74,46 +96,49 @@ - } - - this.isJumping = false; -- if(var5 != null) { -+ -+ if (var5 != null) { - double var8 = var5.xCoord - this.posX; - double var10 = var5.zCoord - this.posZ; - double var12 = var5.yCoord - (double)var22; -- float var14 = (float)(Math.atan2(var10, var8) * 180.0D / (double)((float)Math.PI)) - 90.0F; -+ float var14 = (float)(Math.atan2(var10, var8) * 180.0D / Math.PI) - 90.0F; - float var15 = MathHelper.wrapAngleTo180_float(var14 - this.rotationYaw); - this.moveForward = (float)this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).getAttributeValue(); -- if(var15 > 30.0F) { -+ -+ if (var15 > 30.0F) { - var15 = 30.0F; - } - -- if(var15 < -30.0F) { -+ if (var15 < -30.0F) { - var15 = -30.0F; - } - - this.rotationYaw += var15; -- if(this.hasAttacked && this.entityToAttack != null) { -+ -+ if (this.hasAttacked && this.entityToAttack != null) { - double var16 = this.entityToAttack.posX - this.posX; - double var18 = this.entityToAttack.posZ - this.posZ; - float var20 = this.rotationYaw; -- this.rotationYaw = (float)(Math.atan2(var18, var16) * 180.0D / (double)((float)Math.PI)) - 90.0F; -+ this.rotationYaw = (float)(Math.atan2(var18, var16) * 180.0D / Math.PI) - 90.0F; - var15 = (var20 - this.rotationYaw + 90.0F) * (float)Math.PI / 180.0F; - this.moveStrafing = -MathHelper.sin(var15) * this.moveForward * 1.0F; - this.moveForward = MathHelper.cos(var15) * this.moveForward * 1.0F; - } - -- if(var12 > 0.0D) { -+ if (var12 > 0.0D) { - this.isJumping = true; - } - } - -- if(this.entityToAttack != null) { -+ if (this.entityToAttack != null) { - this.faceEntity(this.entityToAttack, 30.0F, 30.0F); - } - -- if(this.isCollidedHorizontally && !this.hasPath()) { -+ if (this.isCollidedHorizontally && !this.hasPath()) { - this.isJumping = true; - } - -- if(this.ab.nextFloat() < 0.8F && (var3 || var4)) { -+ if (this.rand.nextFloat() < 0.8F && (var3 || var4)) { - this.isJumping = true; - } - -@@ -124,6 +149,9 @@ - } - } - -+ /** -+ * Time remaining during which the Animal is sped up and flees. -+ */ - protected void updateWanderPath() { - this.worldObj.theProfiler.startSection("stroll"); - boolean var1 = false; -@@ -132,12 +160,13 @@ - int var4 = -1; - float var5 = -99999.0F; - -- for(int var6 = 0; var6 < 10; ++var6) { -- int var7 = MathHelper.floor_double(this.posX + (double)this.ab.nextInt(13) - 6.0D); -- int var8 = MathHelper.floor_double(this.posY + (double)this.ab.nextInt(7) - 3.0D); -- int var9 = MathHelper.floor_double(this.posZ + (double)this.ab.nextInt(13) - 6.0D); -+ for (int var6 = 0; var6 < 10; ++var6) { -+ int var7 = MathHelper.floor_double(this.posX + (double)this.rand.nextInt(13) - 6.0D); -+ int var8 = MathHelper.floor_double(this.posY + (double)this.rand.nextInt(7) - 3.0D); -+ int var9 = MathHelper.floor_double(this.posZ + (double)this.rand.nextInt(13) - 6.0D); - float var10 = this.getBlockPathWeight(var7, var8, var9); -- if(var10 > var5) { -+ -+ if (var10 > var5) { - var5 = var10; - var2 = var7; - var3 = var8; -@@ -146,24 +175,37 @@ - } - } - -- if(var1) { -+ if (var1) { - this.pathToEntity = this.worldObj.getEntityPathToXYZ(this, var2, var3, var4, 10.0F, true, false, false, true); - } - - this.worldObj.theProfiler.endSection(); - } - -- protected void attackEntity(Entity var1, float var2) { -- } -+ /** -+ * Basic mob attack. Default to touch of death in EntityCreature. Overridden by each mob to define their attack. -+ */ -+ protected void attackEntity(Entity par1Entity, float par2) {} - -- public float getBlockPathWeight(int var1, int var2, int var3) { -+ /** -+ * Takes a coordinate in and returns a weight to determine how likely this creature will try to path to the block. -+ * Args: x, y, z -+ */ -+ public float getBlockPathWeight(int par1, int par2, int par3) { - return 0.0F; - } - -+ /** -+ * Finds the closest player within 16 blocks to attack, or null if this Entity isn't interested in attacking (Animals, -+ * Spiders at day, peaceful PigZombies). -+ */ - protected Entity findPlayerToAttack() { - return null; - } - -+ /** -+ * Checks if the entity's current position is a valid location to spawn this entity. -+ */ - public boolean getCanSpawnHere() { - int var1 = MathHelper.floor_double(this.posX); - int var2 = MathHelper.floor_double(this.boundingBox.minY); -@@ -171,35 +213,50 @@ - return super.getCanSpawnHere() && this.getBlockPathWeight(var1, var2, var3) >= 0.0F; - } - -+ /** -+ * Returns true if entity has a path to follow -+ */ - public boolean hasPath() { - return this.pathToEntity != null; - } - -- public void setPathToEntity(PathEntity var1) { -- this.pathToEntity = var1; -+ /** -+ * sets the Entities walk path in EntityCreature -+ */ -+ public void setPathToEntity(PathEntity par1PathEntity) { -+ this.pathToEntity = par1PathEntity; - } - -+ /** -+ * Returns current entities target -+ */ - public Entity getEntityToAttack() { - return this.entityToAttack; - } - -- public void setTarget(Entity var1) { -- this.entityToAttack = var1; -+ /** -+ * Sets the entity which is to be attacked. -+ */ -+ public void setTarget(Entity par1Entity) { -+ this.entityToAttack = par1Entity; - } - - public boolean func_110173_bK() { - return this.func_110176_b(MathHelper.floor_double(this.posX), MathHelper.floor_double(this.posY), MathHelper.floor_double(this.posZ)); - } - -- public boolean func_110176_b(int var1, int var2, int var3) { -- return this.maximumHomeDistance == -1.0F ? true : this.homePosition.getDistanceSquared(var1, var2, var3) < this.maximumHomeDistance * this.maximumHomeDistance; -- } -- -- public void setHomeArea(int var1, int var2, int var3, int var4) { -- this.homePosition.set(var1, var2, var3); -- this.maximumHomeDistance = (float)var4; -- } -- -+ public boolean func_110176_b(int par1, int par2, int par3) { -+ return this.maximumHomeDistance == -1.0F ? true : this.homePosition.getDistanceSquared(par1, par2, par3) < this.maximumHomeDistance * this.maximumHomeDistance; -+ } -+ -+ public void setHomeArea(int par1, int par2, int par3, int par4) { -+ this.homePosition.set(par1, par2, par3); -+ this.maximumHomeDistance = (float)par4; -+ } -+ -+ /** -+ * Returns the chunk coordinate object of the home position. -+ */ - public ChunkCoordinates getHomePosition() { - return this.homePosition; - } -@@ -212,36 +269,42 @@ - this.maximumHomeDistance = -1.0F; - } - -+ /** -+ * Returns whether a home area is defined for this entity. -+ */ - public boolean hasHome() { - return this.maximumHomeDistance != -1.0F; - } - - protected void func_110159_bB() { - super.func_110159_bB(); -- if(this.getLeashed() && this.getLeashedToEntity() != null && this.getLeashedToEntity().worldObj == this.worldObj) { -+ -+ if (this.getLeashed() && this.getLeashedToEntity() != null && this.getLeashedToEntity().worldObj == this.worldObj) { - Entity var1 = this.getLeashedToEntity(); - this.setHomeArea((int)var1.posX, (int)var1.posY, (int)var1.posZ, 5); - float var2 = this.getDistanceToEntity(var1); -- if(this instanceof EntityTameable && ((EntityTameable)this).isSitting()) { -- if(var2 > 10.0F) { -+ -+ if (this instanceof EntityTameable && ((EntityTameable)this).isSitting()) { -+ if (var2 > 10.0F) { - this.clearLeashed(true, true); - } - - return; - } - -- if(!this.field_110180_bt) { -+ if (!this.field_110180_bt) { - this.tasks.addTask(2, this.field_110178_bs); - this.getNavigator().setAvoidsWater(false); - this.field_110180_bt = true; - } - - this.func_142017_o(var2); -- if(var2 > 4.0F) { -+ -+ if (var2 > 4.0F) { - this.getNavigator().tryMoveToEntityLiving(var1, 1.0D); - } - -- if(var2 > 6.0F) { -+ if (var2 > 6.0F) { - double var3 = (var1.posX - this.posX) / (double)var2; - double var5 = (var1.posY - this.posY) / (double)var2; - double var7 = (var1.posZ - this.posZ) / (double)var2; -@@ -250,18 +313,16 @@ - this.motionZ += var7 * Math.abs(var7) * 0.4D; - } - -- if(var2 > 10.0F) { -+ if (var2 > 10.0F) { - this.clearLeashed(true, true); - } -- } else if(!this.getLeashed() && this.field_110180_bt) { -+ } else if (!this.getLeashed() && this.field_110180_bt) { - this.field_110180_bt = false; - this.tasks.removeTask(this.field_110178_bs); - this.getNavigator().setAvoidsWater(true); - this.detachHome(); - } -- -- } -- -- protected void func_142017_o(float var1) { -- } -+ } -+ -+ protected void func_142017_o(float par1) {} - } ---- /dev/null -+++ org/spoutcraft/client/gui/settings/controls/TexturesButton.java -@@ -1,0 +1,42 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.client.gui.settings.controls; -+ -+import net.minecraft.src.GuiScreen; -+import net.minecraft.src.GuiScreenTemporaryResourcePackSelect; -+import net.minecraft.src.Minecraft; -+ -+import org.spoutcraft.api.gui.GenericButton; -+import org.spoutcraft.client.config.Configuration; -+import org.spoutcraft.client.SpoutClient; -+ -+public class TexturesButton extends GenericButton { -+ GuiScreen parent; -+ -+ public TexturesButton(GuiScreen parent) { -+ super("Texture Packs"); -+ this.parent = parent; -+ } -+ -+ @Override -+ public void onButtonClick() { -+ SpoutClient.getHandle().displayGuiScreen(new GuiScreenTemporaryResourcePackSelect(parent, Minecraft.getMinecraft().gameSettings)); -+ } -+} ---- net/minecraft/src/EntityAIEatGrass.java -+++ net/minecraft/src/EntityAIEatGrass.java -@@ -3,16 +3,21 @@ - public class EntityAIEatGrass extends EntityAIBase { - private EntityLiving theEntity; - private World theWorld; -+ -+ /** A decrementing tick used for the sheep's head offset and animation. */ - int eatGrassTick; - -- public EntityAIEatGrass(EntityLiving var1) { -- this.theEntity = var1; -- this.theWorld = var1.worldObj; -+ public EntityAIEatGrass(EntityLiving par1EntityLiving) { -+ this.theEntity = par1EntityLiving; -+ this.theWorld = par1EntityLiving.worldObj; - this.setMutexBits(7); - } - -+ /** -+ * Returns whether the EntityAIBase should begin execution. -+ */ - public boolean shouldExecute() { -- if(this.theEntity.getRNG().nextInt(this.theEntity.isChild() ? 50 : 1000) != 0) { -+ if (this.theEntity.getRNG().nextInt(this.theEntity.isChild() ? 50 : 1000) != 0) { - return false; - } else { - int var1 = MathHelper.floor_double(this.theEntity.posX); -@@ -22,16 +27,25 @@ - } - } - -+ /** -+ * Execute a one shot task or start executing a continuous task -+ */ - public void startExecuting() { - this.eatGrassTick = 40; - this.theWorld.setEntityState(this.theEntity, (byte)10); - this.theEntity.getNavigator().clearPathEntity(); - } - -+ /** -+ * Resets the task -+ */ - public void resetTask() { - this.eatGrassTick = 0; - } - -+ /** -+ * Returns whether an in-progress EntityAIBase should continue executing -+ */ - public boolean continueExecuting() { - return this.eatGrassTick > 0; - } -@@ -40,21 +54,25 @@ - return this.eatGrassTick; - } - -+ /** -+ * Updates the task -+ */ - public void updateTask() { - this.eatGrassTick = Math.max(0, this.eatGrassTick - 1); -- if(this.eatGrassTick == 4) { -+ -+ if (this.eatGrassTick == 4) { - int var1 = MathHelper.floor_double(this.theEntity.posX); - int var2 = MathHelper.floor_double(this.theEntity.posY); - int var3 = MathHelper.floor_double(this.theEntity.posZ); -- if(this.theWorld.getBlockId(var1, var2, var3) == Block.tallGrass.blockID) { -+ -+ if (this.theWorld.getBlockId(var1, var2, var3) == Block.tallGrass.blockID) { - this.theWorld.destroyBlock(var1, var2, var3, false); - this.theEntity.eatGrassBonus(); -- } else if(this.theWorld.getBlockId(var1, var2 - 1, var3) == Block.grass.blockID) { -+ } else if (this.theWorld.getBlockId(var1, var2 - 1, var3) == Block.grass.blockID) { - this.theWorld.playAuxSFX(2001, var1, var2 - 1, var3, Block.grass.blockID); - this.theWorld.setBlock(var1, var2 - 1, var3, Block.dirt.blockID, 0, 2); - this.theEntity.eatGrassBonus(); - } -- - } - } - } ---- net/minecraft/src/RenderLightningBolt.java -+++ net/minecraft/src/RenderLightningBolt.java -@@ -4,7 +4,11 @@ - import org.lwjgl.opengl.GL11; - - public class RenderLightningBolt extends Render { -- public void doRenderLightningBolt(EntityLightningBolt var1, double var2, double var4, double var6, float var8, float var9) { -+ -+ /** -+ * Actually renders the lightning bolt. This method is called through the doRender method. -+ */ -+ public void doRenderLightningBolt(EntityLightningBolt par1EntityLightningBolt, double par2, double par4, double par6, float par8, float par9) { - Tessellator var10 = Tessellator.instance; - GL11.glDisable(GL11.GL_TEXTURE_2D); - GL11.glDisable(GL11.GL_LIGHTING); -@@ -14,36 +18,38 @@ - double[] var12 = new double[8]; - double var13 = 0.0D; - double var15 = 0.0D; -- Random var17 = new Random(var1.boltVertex); -+ Random var17 = new Random(par1EntityLightningBolt.boltVertex); - -- for(int var18 = 7; var18 >= 0; --var18) { -+ for (int var18 = 7; var18 >= 0; --var18) { - var11[var18] = var13; - var12[var18] = var15; - var13 += (double)(var17.nextInt(11) - 5); - var15 += (double)(var17.nextInt(11) - 5); - } - -- for(int var45 = 0; var45 < 4; ++var45) { -- Random var46 = new Random(var1.boltVertex); -+ for (int var45 = 0; var45 < 4; ++var45) { -+ Random var46 = new Random(par1EntityLightningBolt.boltVertex); - -- for(int var19 = 0; var19 < 3; ++var19) { -+ for (int var19 = 0; var19 < 3; ++var19) { - int var20 = 7; - int var21 = 0; -- if(var19 > 0) { -+ -+ if (var19 > 0) { - var20 = 7 - var19; - } - -- if(var19 > 0) { -+ if (var19 > 0) { - var21 = var20 - 2; - } - - double var22 = var11[var20] - var13; - double var24 = var12[var20] - var15; - -- for(int var26 = var20; var26 >= var21; --var26) { -+ for (int var26 = var20; var26 >= var21; --var26) { - double var27 = var22; - double var29 = var24; -- if(var19 == 0) { -+ -+ if (var19 == 0) { - var22 += (double)(var46.nextInt(11) - 5); - var24 += (double)(var46.nextInt(11) - 5); - } else { -@@ -55,38 +61,42 @@ - float var31 = 0.5F; - var10.setColorRGBA_F(0.9F * var31, 0.9F * var31, 1.0F * var31, 0.3F); - double var32 = 0.1D + (double)var45 * 0.2D; -- if(var19 == 0) { -+ -+ if (var19 == 0) { - var32 *= (double)var26 * 0.1D + 1.0D; - } - - double var34 = 0.1D + (double)var45 * 0.2D; -- if(var19 == 0) { -+ -+ if (var19 == 0) { - var34 *= (double)(var26 - 1) * 0.1D + 1.0D; - } - -- for(int var36 = 0; var36 < 5; ++var36) { -- double var37 = var2 + 0.5D - var32; -- double var39 = var6 + 0.5D - var32; -- if(var36 == 1 || var36 == 2) { -+ for (int var36 = 0; var36 < 5; ++var36) { -+ double var37 = par2 + 0.5D - var32; -+ double var39 = par6 + 0.5D - var32; -+ -+ if (var36 == 1 || var36 == 2) { - var37 += var32 * 2.0D; - } - -- if(var36 == 2 || var36 == 3) { -+ if (var36 == 2 || var36 == 3) { - var39 += var32 * 2.0D; - } - -- double var41 = var2 + 0.5D - var34; -- double var43 = var6 + 0.5D - var34; -- if(var36 == 1 || var36 == 2) { -+ double var41 = par2 + 0.5D - var34; -+ double var43 = par6 + 0.5D - var34; -+ -+ if (var36 == 1 || var36 == 2) { - var41 += var34 * 2.0D; - } - -- if(var36 == 2 || var36 == 3) { -+ if (var36 == 2 || var36 == 3) { - var43 += var34 * 2.0D; - } - -- var10.addVertex(var41 + var22, var4 + (double)(var26 * 16), var43 + var24); -- var10.addVertex(var37 + var27, var4 + (double)((var26 + 1) * 16), var39 + var29); -+ var10.addVertex(var41 + var22, par4 + (double)(var26 * 16), var43 + var24); -+ var10.addVertex(var37 + var27, par4 + (double)((var26 + 1) * 16), var39 + var29); - } - - var10.draw(); -@@ -99,15 +109,24 @@ - GL11.glEnable(GL11.GL_TEXTURE_2D); - } - -- protected ResourceLocation func_110805_a(EntityLightningBolt var1) { -+ protected ResourceLocation func_110805_a(EntityLightningBolt par1EntityLightningBolt) { - return null; - } - -- protected ResourceLocation getEntityTexture(Entity var1) { -- return this.func_110805_a((EntityLightningBolt)var1); -+ /** -+ * Returns the location of an entity's texture. Doesn't seem to be called unless you call Render.bindEntityTexture. -+ */ -+ protected ResourceLocation getEntityTexture(Entity par1Entity) { -+ return this.func_110805_a((EntityLightningBolt)par1Entity); - } - -- public void doRender(Entity var1, double var2, double var4, double var6, float var8, float var9) { -- this.doRenderLightningBolt((EntityLightningBolt)var1, var2, var4, var6, var8, var9); -+ /** -+ * Actually renders the given argument. This is a synthetic bridge method, always casting down its argument and then -+ * handing it off to a worker function which does the actual work. In all probabilty, the class Render is generic -+ * (Render 0; -- if(var7 != var5) { -- var1.setBlockMetadata(var2, var3, var4, var6 ^ 4, 2); -- var1.playAuxSFXAtEntity((EntityPlayer)null, 1003, var2, var3, var4, 0); -+ -+ if (var7 != par5) { -+ par1World.setBlockMetadataWithNotify(par2, par3, par4, var6 ^ 4, 2); -+ par1World.playAuxSFXAtEntity((EntityPlayer)null, 1003, par2, par3, par4, 0); - } - } - -- public void onNeighborBlockChange(World var1, int var2, int var3, int var4, int var5) { -- if(!var1.isRemote) { -- int var6 = var1.getBlockMetadata(var2, var3, var4); -- int var7 = var2; -- int var8 = var4; -- if((var6 & 3) == 0) { -- var8 = var4 + 1; -+ /** -+ * Lets the block know when one of its neighbor changes. Doesn't know which neighbor changed (coordinates passed are -+ * their own) Args: x, y, z, neighbor blockID -+ */ -+ public void onNeighborBlockChange(World par1World, int par2, int par3, int par4, int par5) { -+ if (!par1World.isRemote) { -+ int var6 = par1World.getBlockMetadata(par2, par3, par4); -+ int var7 = par2; -+ int var8 = par4; -+ -+ if ((var6 & 3) == 0) { -+ var8 = par4 + 1; - } - -- if((var6 & 3) == 1) { -+ if ((var6 & 3) == 1) { - --var8; - } - -- if((var6 & 3) == 2) { -- var7 = var2 + 1; -+ if ((var6 & 3) == 2) { -+ var7 = par2 + 1; - } - -- if((var6 & 3) == 3) { -+ if ((var6 & 3) == 3) { - --var7; - } - -- if(!isValidSupportBlock(var1.getBlockId(var7, var3, var8))) { -- var1.setBlockToAir(var2, var3, var4); -- this.dropBlockAsItem(var1, var2, var3, var4, var6, 0); -- } -- -- boolean var9 = var1.isBlockIndirectlyGettingPowered(var2, var3, var4); -- if(var9 || var5 > 0 && Block.blocksList[var5].canProvidePower()) { -- this.onPoweredBlockChange(var1, var2, var3, var4, var9); -- } -- -+ if (!isValidSupportBlock(par1World.getBlockId(var7, par3, var8))) { -+ par1World.setBlockToAir(par2, par3, par4); -+ this.dropBlockAsItem(par1World, par2, par3, par4, var6, 0); -+ } -+ -+ boolean var9 = par1World.isBlockIndirectlyGettingPowered(par2, par3, par4); -+ -+ if (var9 || par5 > 0 && Block.blocksList[par5].canProvidePower()) { -+ this.onPoweredBlockChange(par1World, par2, par3, par4, var9); -+ } - } - } - -- public MovingObjectPosition collisionRayTrace(World var1, int var2, int var3, int var4, Vec3 var5, Vec3 var6) { -- this.setBlockBoundsBasedOnState(var1, var2, var3, var4); -- return super.collisionRayTrace(var1, var2, var3, var4, var5, var6); -+ /** -+ * Ray traces through the blocks collision from start vector to end vector returning a ray trace hit. Args: world, x, -+ * y, z, startVec, endVec -+ */ -+ public MovingObjectPosition collisionRayTrace(World par1World, int par2, int par3, int par4, Vec3 par5Vec3, Vec3 par6Vec3) { -+ this.setBlockBoundsBasedOnState(par1World, par2, par3, par4); -+ return super.collisionRayTrace(par1World, par2, par3, par4, par5Vec3, par6Vec3); - } - -- public int onBlockPlaced(World var1, int var2, int var3, int var4, int var5, float var6, float var7, float var8, int var9) { -+ /** -+ * Called when a block is placed using its ItemBlock. Args: World, X, Y, Z, side, hitX, hitY, hitZ, block metadata -+ */ -+ public int onBlockPlaced(World par1World, int par2, int par3, int par4, int par5, float par6, float par7, float par8, int par9) { - int var10 = 0; -- if(var5 == 2) { -+ -+ if (par5 == 2) { - var10 = 0; - } - -- if(var5 == 3) { -+ if (par5 == 3) { - var10 = 1; - } - -- if(var5 == 4) { -+ if (par5 == 4) { - var10 = 2; - } - -- if(var5 == 5) { -+ if (par5 == 5) { - var10 = 3; - } - -- if(var5 != 1 && var5 != 0 && var7 > 0.5F) { -+ if (par5 != 1 && par5 != 0 && par7 > 0.5F) { - var10 |= 8; - } - - return var10; - } - -- public boolean canPlaceBlockOnSide(World var1, int var2, int var3, int var4, int var5) { -- if(var5 == 0) { -+ /** -+ * checks to see if you can place this block can be placed on that side of a block: BlockLever overrides -+ */ -+ public boolean canPlaceBlockOnSide(World par1World, int par2, int par3, int par4, int par5) { -+ if (par5 == 0) { - return false; -- } else if(var5 == 1) { -+ } else if (par5 == 1) { - return false; - } else { -- if(var5 == 2) { -- ++var4; -- } -- -- if(var5 == 3) { -- --var4; -- } -- -- if(var5 == 4) { -- ++var2; -- } -- -- if(var5 == 5) { -- --var2; -- } -- -- return isValidSupportBlock(var1.getBlockId(var2, var3, var4)); -+ if (par5 == 2) { -+ ++par4; -+ } -+ -+ if (par5 == 3) { -+ --par4; -+ } -+ -+ if (par5 == 4) { -+ ++par2; -+ } -+ -+ if (par5 == 5) { -+ --par2; -+ } -+ -+ return isValidSupportBlock(par1World.getBlockId(par2, par3, par4)); - } - } - -- public static boolean isTrapdoorOpen(int var0) { -- return (var0 & 4) != 0; -+ public static boolean isTrapdoorOpen(int par0) { -+ return (par0 & 4) != 0; - } - -- private static boolean isValidSupportBlock(int var0) { -- if(var0 <= 0) { -+ /** -+ * Checks if the block ID is a valid support block for the trap door to connect with. If it is not the trapdoor is -+ * dropped into the world. -+ */ -+ private static boolean isValidSupportBlock(int par0) { -+ if (par0 <= 0) { - return false; - } else { -- Block var1 = Block.blocksList[var0]; -+ Block var1 = Block.blocksList[par0]; - return var1 != null && var1.blockMaterial.isOpaque() && var1.renderAsNormalBlock() || var1 == Block.glowStone || var1 instanceof BlockHalfSlab || var1 instanceof BlockStairs; - } - } ---- net/minecraft/src/GuiScreenHorseInventory.java -+++ net/minecraft/src/GuiScreenHorseInventory.java -@@ -10,39 +10,49 @@ - private float field_110416_x; - private float field_110415_y; - -- public GuiScreenHorseInventory(IInventory var1, IInventory var2, EntityHorse var3) { -- super(new ContainerHorseInventory(var1, var2, var3)); -- this.field_110413_u = var1; -- this.field_110412_v = var2; -- this.field_110411_w = var3; -+ public GuiScreenHorseInventory(IInventory par1IInventory, IInventory par2IInventory, EntityHorse par3EntityHorse) { -+ super(new ContainerHorseInventory(par1IInventory, par2IInventory, par3EntityHorse)); -+ this.field_110413_u = par1IInventory; -+ this.field_110412_v = par2IInventory; -+ this.field_110411_w = par3EntityHorse; - this.allowUserInput = false; - } - -- protected void drawGuiContainerForegroundLayer(int var1, int var2) { -+ /** -+ * Draw the foreground layer for the GuiContainer (everything in front of the items) -+ */ -+ protected void drawGuiContainerForegroundLayer(int par1, int par2) { - this.fontRenderer.drawString(this.field_110412_v.isInvNameLocalized() ? this.field_110412_v.getInvName() : I18n.getString(this.field_110412_v.getInvName()), 8, 6, 4210752); - this.fontRenderer.drawString(this.field_110413_u.isInvNameLocalized() ? this.field_110413_u.getInvName() : I18n.getString(this.field_110413_u.getInvName()), 8, this.ySize - 96 + 2, 4210752); - } - -- protected void drawGuiContainerBackgroundLayer(float var1, int var2, int var3) { -+ /** -+ * Draw the background layer for the GuiContainer (everything behind the items) -+ */ -+ protected void drawGuiContainerBackgroundLayer(float par1, int par2, int par3) { - GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - this.mc.getTextureManager().bindTexture(horseGuiTextures); - int var4 = (this.width - this.xSize) / 2; - int var5 = (this.height - this.ySize) / 2; - this.drawTexturedModalRect(var4, var5, 0, 0, this.xSize, this.ySize); -- if(this.field_110411_w.isChested()) { -+ -+ if (this.field_110411_w.isChested()) { - this.drawTexturedModalRect(var4 + 79, var5 + 17, 0, this.ySize, 90, 54); - } - -- if(this.field_110411_w.func_110259_cr()) { -+ if (this.field_110411_w.func_110259_cr()) { - this.drawTexturedModalRect(var4 + 7, var5 + 35, 0, this.ySize + 54, 18, 18); - } - - GuiInventory.func_110423_a(var4 + 51, var5 + 60, 17, (float)(var4 + 51) - this.field_110416_x, (float)(var5 + 75 - 50) - this.field_110415_y, this.field_110411_w); - } - -- public void drawScreen(int var1, int var2, float var3) { -- this.field_110416_x = (float)var1; -- this.field_110415_y = (float)var2; -- super.drawScreen(var1, var2, var3); -+ /** -+ * Draws the screen and all the components in it. -+ */ -+ public void drawScreen(int par1, int par2, float par3) { -+ this.field_110416_x = (float)par1; -+ this.field_110415_y = (float)par2; -+ super.drawScreen(par1, par2, par3); - } - } ---- net/minecraft/src/ComponentNetherBridgeThrone.java -+++ net/minecraft/src/ComponentNetherBridgeThrone.java -@@ -6,68 +6,77 @@ - public class ComponentNetherBridgeThrone extends ComponentNetherBridgePiece { - private boolean hasSpawner; - -- public ComponentNetherBridgeThrone() { -- } -- -- public ComponentNetherBridgeThrone(int var1, Random var2, StructureBoundingBox var3, int var4) { -- super(var1); -- this.coordBaseMode = var4; -- this.boundingBox = var3; -- } -- -- protected void func_143011_b(NBTTagCompound var1) { -- super.func_143011_b(var1); -- this.hasSpawner = var1.getBoolean("Mob"); -- } -- -- protected void func_143012_a(NBTTagCompound var1) { -- super.func_143012_a(var1); -- var1.setBoolean("Mob", this.hasSpawner); -- } -- -- public static ComponentNetherBridgeThrone createValidComponent(List var0, Random var1, int var2, int var3, int var4, int var5, int var6) { -- StructureBoundingBox var7 = StructureBoundingBox.getComponentToAddBoundingBox(var2, var3, var4, -2, 0, 0, 7, 8, 9, var5); -- return isAboveGround(var7) && StructureComponent.findIntersecting(var0, var7) == null ? new ComponentNetherBridgeThrone(var6, var1, var7, var5) : null; -- } -- -- public boolean addComponentParts(World var1, Random var2, StructureBoundingBox var3) { -- this.fillWithBlocks(var1, var3, 0, 2, 0, 6, 7, 7, 0, 0, false); -- this.fillWithBlocks(var1, var3, 1, 0, 0, 5, 1, 7, Block.netherBrick.blockID, Block.netherBrick.blockID, false); -- this.fillWithBlocks(var1, var3, 1, 2, 1, 5, 2, 7, Block.netherBrick.blockID, Block.netherBrick.blockID, false); -- this.fillWithBlocks(var1, var3, 1, 3, 2, 5, 3, 7, Block.netherBrick.blockID, Block.netherBrick.blockID, false); -- this.fillWithBlocks(var1, var3, 1, 4, 3, 5, 4, 7, Block.netherBrick.blockID, Block.netherBrick.blockID, false); -- this.fillWithBlocks(var1, var3, 1, 2, 0, 1, 4, 2, Block.netherBrick.blockID, Block.netherBrick.blockID, false); -- this.fillWithBlocks(var1, var3, 5, 2, 0, 5, 4, 2, Block.netherBrick.blockID, Block.netherBrick.blockID, false); -- this.fillWithBlocks(var1, var3, 1, 5, 2, 1, 5, 3, Block.netherBrick.blockID, Block.netherBrick.blockID, false); -- this.fillWithBlocks(var1, var3, 5, 5, 2, 5, 5, 3, Block.netherBrick.blockID, Block.netherBrick.blockID, false); -- this.fillWithBlocks(var1, var3, 0, 5, 3, 0, 5, 8, Block.netherBrick.blockID, Block.netherBrick.blockID, false); -- this.fillWithBlocks(var1, var3, 6, 5, 3, 6, 5, 8, Block.netherBrick.blockID, Block.netherBrick.blockID, false); -- this.fillWithBlocks(var1, var3, 1, 5, 8, 5, 5, 8, Block.netherBrick.blockID, Block.netherBrick.blockID, false); -- this.placeBlockAtCurrentPosition(var1, Block.netherFence.blockID, 0, 1, 6, 3, var3); -- this.placeBlockAtCurrentPosition(var1, Block.netherFence.blockID, 0, 5, 6, 3, var3); -- this.fillWithBlocks(var1, var3, 0, 6, 3, 0, 6, 8, Block.netherFence.blockID, Block.netherFence.blockID, false); -- this.fillWithBlocks(var1, var3, 6, 6, 3, 6, 6, 8, Block.netherFence.blockID, Block.netherFence.blockID, false); -- this.fillWithBlocks(var1, var3, 1, 6, 8, 5, 7, 8, Block.netherFence.blockID, Block.netherFence.blockID, false); -- this.fillWithBlocks(var1, var3, 2, 8, 8, 4, 8, 8, Block.netherFence.blockID, Block.netherFence.blockID, false); -+ public ComponentNetherBridgeThrone() {} -+ -+ public ComponentNetherBridgeThrone(int par1, Random par2Random, StructureBoundingBox par3StructureBoundingBox, int par4) { -+ super(par1); -+ this.coordBaseMode = par4; -+ this.boundingBox = par3StructureBoundingBox; -+ } -+ -+ protected void func_143011_b(NBTTagCompound par1NBTTagCompound) { -+ super.func_143011_b(par1NBTTagCompound); -+ this.hasSpawner = par1NBTTagCompound.getBoolean("Mob"); -+ } -+ -+ protected void func_143012_a(NBTTagCompound par1NBTTagCompound) { -+ super.func_143012_a(par1NBTTagCompound); -+ par1NBTTagCompound.setBoolean("Mob", this.hasSpawner); -+ } -+ -+ /** -+ * Creates and returns a new component piece. Or null if it could not find enough room to place it. -+ */ -+ public static ComponentNetherBridgeThrone createValidComponent(List par0List, Random par1Random, int par2, int par3, int par4, int par5, int par6) { -+ StructureBoundingBox var7 = StructureBoundingBox.getComponentToAddBoundingBox(par2, par3, par4, -2, 0, 0, 7, 8, 9, par5); -+ return isAboveGround(var7) && StructureComponent.findIntersecting(par0List, var7) == null ? new ComponentNetherBridgeThrone(par6, par1Random, var7, par5) : null; -+ } -+ -+ /** -+ * second Part of Structure generating, this for example places Spiderwebs, Mob Spawners, it closes Mineshafts at the -+ * end, it adds Fences... -+ */ -+ public boolean addComponentParts(World par1World, Random par2Random, StructureBoundingBox par3StructureBoundingBox) { -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 0, 2, 0, 6, 7, 7, 0, 0, false); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 1, 0, 0, 5, 1, 7, Block.netherBrick.blockID, Block.netherBrick.blockID, false); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 1, 2, 1, 5, 2, 7, Block.netherBrick.blockID, Block.netherBrick.blockID, false); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 1, 3, 2, 5, 3, 7, Block.netherBrick.blockID, Block.netherBrick.blockID, false); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 1, 4, 3, 5, 4, 7, Block.netherBrick.blockID, Block.netherBrick.blockID, false); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 1, 2, 0, 1, 4, 2, Block.netherBrick.blockID, Block.netherBrick.blockID, false); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 5, 2, 0, 5, 4, 2, Block.netherBrick.blockID, Block.netherBrick.blockID, false); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 1, 5, 2, 1, 5, 3, Block.netherBrick.blockID, Block.netherBrick.blockID, false); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 5, 5, 2, 5, 5, 3, Block.netherBrick.blockID, Block.netherBrick.blockID, false); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 0, 5, 3, 0, 5, 8, Block.netherBrick.blockID, Block.netherBrick.blockID, false); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 6, 5, 3, 6, 5, 8, Block.netherBrick.blockID, Block.netherBrick.blockID, false); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 1, 5, 8, 5, 5, 8, Block.netherBrick.blockID, Block.netherBrick.blockID, false); -+ this.placeBlockAtCurrentPosition(par1World, Block.netherFence.blockID, 0, 1, 6, 3, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.netherFence.blockID, 0, 5, 6, 3, par3StructureBoundingBox); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 0, 6, 3, 0, 6, 8, Block.netherFence.blockID, Block.netherFence.blockID, false); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 6, 6, 3, 6, 6, 8, Block.netherFence.blockID, Block.netherFence.blockID, false); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 1, 6, 8, 5, 7, 8, Block.netherFence.blockID, Block.netherFence.blockID, false); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 2, 8, 8, 4, 8, 8, Block.netherFence.blockID, Block.netherFence.blockID, false); - int var4; - int var5; -- if(!this.hasSpawner) { -+ -+ if (!this.hasSpawner) { - var4 = this.getYWithOffset(5); - var5 = this.getXWithOffset(3, 5); - int var6 = this.getZWithOffset(3, 5); -- if(var3.isVecInside(var5, var4, var6)) { -+ -+ if (par3StructureBoundingBox.isVecInside(var5, var4, var6)) { - this.hasSpawner = true; -- var1.setBlock(var5, var4, var6, Block.mobSpawner.blockID, 0, 2); -- TileEntityMobSpawner var7 = (TileEntityMobSpawner)var1.getBlockTileEntity(var5, var4, var6); -- if(var7 != null) { -+ par1World.setBlock(var5, var4, var6, Block.mobSpawner.blockID, 0, 2); -+ TileEntityMobSpawner var7 = (TileEntityMobSpawner)par1World.getBlockTileEntity(var5, var4, var6); -+ -+ if (var7 != null) { - var7.getSpawnerLogic().setMobID("Blaze"); - } - } - } - -- for(var4 = 0; var4 <= 6; ++var4) { -- for(var5 = 0; var5 <= 6; ++var5) { -- this.fillCurrentPositionBlocksDownwards(var1, Block.netherBrick.blockID, 0, var4, -1, var5, var3); -+ for (var4 = 0; var4 <= 6; ++var4) { -+ for (var5 = 0; var5 <= 6; ++var5) { -+ this.fillCurrentPositionBlocksDownwards(par1World, Block.netherBrick.blockID, 0, var4, -1, var5, par3StructureBoundingBox); - } - } - ---- net/minecraft/src/StructureMineshaftStart.java -+++ net/minecraft/src/StructureMineshaftStart.java -@@ -3,15 +3,14 @@ - import java.util.Random; - - public class StructureMineshaftStart extends StructureStart { -- public StructureMineshaftStart() { -- } -+ public StructureMineshaftStart() {} - -- public StructureMineshaftStart(World var1, Random var2, int var3, int var4) { -- super(var3, var4); -- ComponentMineshaftRoom var5 = new ComponentMineshaftRoom(0, var2, (var3 << 4) + 2, (var4 << 4) + 2); -- this.a.add(var5); -- var5.buildComponent(var5, this.a, var2); -+ public StructureMineshaftStart(World par1World, Random par2Random, int par3, int par4) { -+ super(par3, par4); -+ ComponentMineshaftRoom var5 = new ComponentMineshaftRoom(0, par2Random, (par3 << 4) + 2, (par4 << 4) + 2); -+ this.components.add(var5); -+ var5.buildComponent(var5, this.components, par2Random); - this.updateBoundingBox(); -- this.markAvailableHeight(var1, var2, 10); -+ this.markAvailableHeight(par1World, par2Random, 10); - } - } ---- net/minecraft/src/CommandServerList.java -+++ net/minecraft/src/CommandServerList.java -@@ -7,16 +7,19 @@ - return "list"; - } - -+ /** -+ * Return the required permission level for this command. -+ */ - public int getRequiredPermissionLevel() { - return 0; - } - -- public String getCommandUsage(ICommandSender var1) { -+ public String getCommandUsage(ICommandSender par1ICommandSender) { - return "commands.players.usage"; - } - -- public void processCommand(ICommandSender var1, String[] var2) { -- var1.sendChatToPlayer(ChatMessageComponent.createFromTranslationWithSubstitutions("commands.players.list", new Object[]{Integer.valueOf(MinecraftServer.getServer().getCurrentPlayerCount()), Integer.valueOf(MinecraftServer.getServer().getMaxPlayers())})); -- var1.sendChatToPlayer(ChatMessageComponent.createFromText(MinecraftServer.getServer().getConfigurationManager().getPlayerListAsString())); -+ public void processCommand(ICommandSender par1ICommandSender, String[] par2ArrayOfStr) { -+ par1ICommandSender.sendChatToPlayer(ChatMessageComponent.createFromTranslationWithSubstitutions("commands.players.list", new Object[] {Integer.valueOf(MinecraftServer.getServer().getCurrentPlayerCount()), Integer.valueOf(MinecraftServer.getServer().getMaxPlayers())})); -+ par1ICommandSender.sendChatToPlayer(ChatMessageComponent.createFromText(MinecraftServer.getServer().getConfigurationManager().getPlayerListAsString())); - } - } ---- net/minecraft/src/Potion.java -+++ net/minecraft/src/Potion.java -@@ -1,16 +1,21 @@ - package net.minecraft.src; - --import com.google.common.collect.Maps; - import java.util.Iterator; - import java.util.Map; --import java.util.UUID; - import java.util.Map.Entry; -+import java.util.UUID; -+ -+import com.google.common.collect.Maps; -+ -+import com.prupe.mcpatcher.cc.ColorizeItem; - - public class Potion { -+ -+ /** The array of potion types. */ - public static final Potion[] potionTypes = new Potion[32]; - public static final Potion field_76423_b = null; -- public static final Potion moveSpeed = (new Potion(1, false, 8171462)).setPotionName("potion.moveSpeed").setIconIndex(0, 0).func_111184_a(SharedMonsterAttributes.movementSpeed, "91AEAA56-376B-4498-935B-2F7F68070635", (double)0.2F, 2); -- public static final Potion moveSlowdown = (new Potion(2, true, 5926017)).setPotionName("potion.moveSlowdown").setIconIndex(1, 0).func_111184_a(SharedMonsterAttributes.movementSpeed, "7107DE5E-7CE8-4030-940E-514C1F160890", (double)-0.15F, 2); -+ public static final Potion moveSpeed = (new Potion(1, false, 8171462)).setPotionName("potion.moveSpeed").setIconIndex(0, 0).func_111184_a(SharedMonsterAttributes.movementSpeed, "91AEAA56-376B-4498-935B-2F7F68070635", 0.20000000298023224D, 2); -+ public static final Potion moveSlowdown = (new Potion(2, true, 5926017)).setPotionName("potion.moveSlowdown").setIconIndex(1, 0).func_111184_a(SharedMonsterAttributes.movementSpeed, "7107DE5E-7CE8-4030-940E-514C1F160890", -0.15000000596046448D, 2); - public static final Potion digSpeed = (new Potion(3, false, 14270531)).setPotionName("potion.digSpeed").setIconIndex(2, 0).setEffectiveness(1.5D); - public static final Potion digSlowdown = (new Potion(4, true, 4866583)).setPotionName("potion.digSlowDown").setIconIndex(3, 0); - public static final Potion damageBoost = (new PotionAttackDamage(5, false, 9643043)).setPotionName("potion.damageBoost").setIconIndex(4, 0).func_111184_a(SharedMonsterAttributes.attackDamage, "648D7064-6A60-4F59-8ABE-C2C23A6DD7A9", 3.0D, 2); -@@ -18,16 +23,36 @@ - public static final Potion harm = (new PotionHealth(7, true, 4393481)).setPotionName("potion.harm"); - public static final Potion jump = (new Potion(8, false, 7889559)).setPotionName("potion.jump").setIconIndex(2, 1); - public static final Potion confusion = (new Potion(9, true, 5578058)).setPotionName("potion.confusion").setIconIndex(3, 1).setEffectiveness(0.25D); -+ -+ /** The regeneration Potion object. */ - public static final Potion regeneration = (new Potion(10, false, 13458603)).setPotionName("potion.regeneration").setIconIndex(7, 0).setEffectiveness(0.25D); - public static final Potion resistance = (new Potion(11, false, 10044730)).setPotionName("potion.resistance").setIconIndex(6, 1); -+ -+ /** The fire resistance Potion object. */ - public static final Potion fireResistance = (new Potion(12, false, 14981690)).setPotionName("potion.fireResistance").setIconIndex(7, 1); -+ -+ /** The water breathing Potion object. */ - public static final Potion waterBreathing = (new Potion(13, false, 3035801)).setPotionName("potion.waterBreathing").setIconIndex(0, 2); -+ -+ /** The invisibility Potion object. */ - public static final Potion invisibility = (new Potion(14, false, 8356754)).setPotionName("potion.invisibility").setIconIndex(0, 1); -+ -+ /** The blindness Potion object. */ - public static final Potion blindness = (new Potion(15, true, 2039587)).setPotionName("potion.blindness").setIconIndex(5, 1).setEffectiveness(0.25D); -+ -+ /** The night vision Potion object. */ - public static final Potion nightVision = (new Potion(16, false, 2039713)).setPotionName("potion.nightVision").setIconIndex(4, 1); -+ -+ /** The hunger Potion object. */ - public static final Potion hunger = (new Potion(17, true, 5797459)).setPotionName("potion.hunger").setIconIndex(1, 1); -+ -+ /** The weakness Potion object. */ - public static final Potion weakness = (new PotionAttackDamage(18, true, 4738376)).setPotionName("potion.weakness").setIconIndex(5, 0).func_111184_a(SharedMonsterAttributes.attackDamage, "22653B89-116E-49DC-9B6B-9971489B5BE5", 2.0D, 0); -+ -+ /** The poison Potion object. */ - public static final Potion poison = (new Potion(19, true, 5149489)).setPotionName("potion.poison").setIconIndex(6, 0).setEffectiveness(0.25D); -+ -+ /** The wither Potion object. */ - public static final Potion wither = (new Potion(20, true, 3484199)).setPotionName("potion.wither").setIconIndex(1, 2).setEffectiveness(0.25D); - public static final Potion field_76434_w = (new PotionHealthBoost(21, false, 16284963)).setPotionName("potion.healthBoost").setIconIndex(2, 2).func_111184_a(SharedMonsterAttributes.maxHealth, "5D6F0BA2-1186-46AC-B896-C61C5CEE99CC", 4.0D, 0); - public static final Potion field_76444_x = (new PotionAbsoption(22, false, 2445989)).setPotionName("potion.absorption").setIconIndex(2, 2); -@@ -40,134 +65,180 @@ - public static final Potion field_76406_E = null; - public static final Potion field_76407_F = null; - public static final Potion field_76408_G = null; -+ -+ /** The Id of a Potion object. */ - public final int id; -- private final Map I = Maps.newHashMap(); -+ private final Map field_111188_I = Maps.newHashMap(); -+ -+ /** -+ * This field indicated if the effect is 'bad' - negative - for the entity. -+ */ - private final boolean isBadEffect; -- private final int liquidColor; -- private String L = ""; -+ -+ /** Is the color of the liquid for this potion. */ -+ public int liquidColor; -+ -+ /** The name of the Potion. */ -+ public String name = ""; -+ -+ /** The index for the icon displayed when the potion effect is active. */ - private int statusIconIndex = -1; - private double effectiveness; - private boolean usable; -- -- protected Potion(int var1, boolean var2, int var3) { -- this.id = var1; -- potionTypes[var1] = this; -- this.isBadEffect = var2; -- if(var2) { -+ public int origColor; -+ -+ protected Potion(int par1, boolean par2, int par3) { -+ this.id = par1; -+ potionTypes[par1] = this; -+ this.isBadEffect = par2; -+ -+ if (par2) { - this.effectiveness = 0.5D; - } else { - this.effectiveness = 1.0D; - } - -- this.liquidColor = var3; -+ this.liquidColor = par3; - } - -- protected Potion setIconIndex(int var1, int var2) { -- this.statusIconIndex = var1 + var2 * 8; -+ /** -+ * Sets the index for the icon displayed in the player's inventory when the status is active. -+ */ -+ protected Potion setIconIndex(int par1, int par2) { -+ this.statusIconIndex = par1 + par2 * 8; - return this; - } - -+ /** -+ * returns the ID of the potion -+ */ - public int getId() { - return this.id; - } - -- public void performEffect(EntityLivingBase var1, int var2) { -- if(this.id == regeneration.id) { -- if(var1.getHealth() < var1.getMaxHealth()) { -- var1.heal(1.0F); -- } -- } else if(this.id == poison.id) { -- if(var1.getHealth() > 1.0F) { -- var1.attackEntityFrom(DamageSource.magic, 1.0F); -- } -- } else if(this.id == wither.id) { -- var1.attackEntityFrom(DamageSource.wither, 1.0F); -- } else if(this.id == hunger.id && var1 instanceof EntityPlayer) { -- ((EntityPlayer)var1).addExhaustion(0.025F * (float)(var2 + 1)); -- } else if(this.id == field_76443_y.id && var1 instanceof EntityPlayer) { -- if(!var1.worldObj.isRemote) { -- ((EntityPlayer)var1).getFoodStats().addStats(var2 + 1, 1.0F); -- } -- } else if((this.id != heal.id || var1.isEntityUndead()) && (this.id != harm.id || !var1.isEntityUndead())) { -- if(this.id == harm.id && !var1.isEntityUndead() || this.id == heal.id && var1.isEntityUndead()) { -- var1.attackEntityFrom(DamageSource.magic, (float)(6 << var2)); -+ public void performEffect(EntityLivingBase par1EntityLivingBase, int par2) { -+ if (this.id == regeneration.id) { -+ if (par1EntityLivingBase.getHealth() < par1EntityLivingBase.getMaxHealth()) { -+ par1EntityLivingBase.heal(1.0F); -+ } -+ } else if (this.id == poison.id) { -+ if (par1EntityLivingBase.getHealth() > 1.0F) { -+ par1EntityLivingBase.attackEntityFrom(DamageSource.magic, 1.0F); -+ } -+ } else if (this.id == wither.id) { -+ par1EntityLivingBase.attackEntityFrom(DamageSource.wither, 1.0F); -+ } else if (this.id == hunger.id && par1EntityLivingBase instanceof EntityPlayer) { -+ ((EntityPlayer)par1EntityLivingBase).addExhaustion(0.025F * (float)(par2 + 1)); -+ } else if (this.id == field_76443_y.id && par1EntityLivingBase instanceof EntityPlayer) { -+ if (!par1EntityLivingBase.worldObj.isRemote) { -+ ((EntityPlayer)par1EntityLivingBase).getFoodStats().addStats(par2 + 1, 1.0F); -+ } -+ } else if ((this.id != heal.id || par1EntityLivingBase.isEntityUndead()) && (this.id != harm.id || !par1EntityLivingBase.isEntityUndead())) { -+ if (this.id == harm.id && !par1EntityLivingBase.isEntityUndead() || this.id == heal.id && par1EntityLivingBase.isEntityUndead()) { -+ par1EntityLivingBase.attackEntityFrom(DamageSource.magic, (float)(6 << par2)); - } - } else { -- var1.heal((float)Math.max(4 << var2, 0)); -+ par1EntityLivingBase.heal((float)Math.max(4 << par2, 0)); - } -- - } - -- public void affectEntity(EntityLivingBase var1, EntityLivingBase var2, int var3, double var4) { -+ /** -+ * Hits the provided entity with this potion's instant effect. -+ */ -+ public void affectEntity(EntityLivingBase par1EntityLivingBase, EntityLivingBase par2EntityLivingBase, int par3, double par4) { - int var6; -- if((this.id != heal.id || var2.isEntityUndead()) && (this.id != harm.id || !var2.isEntityUndead())) { -- if(this.id == harm.id && !var2.isEntityUndead() || this.id == heal.id && var2.isEntityUndead()) { -- var6 = (int)(var4 * (double)(6 << var3) + 0.5D); -- if(var1 == null) { -- var2.attackEntityFrom(DamageSource.magic, (float)var6); -+ -+ if ((this.id != heal.id || par2EntityLivingBase.isEntityUndead()) && (this.id != harm.id || !par2EntityLivingBase.isEntityUndead())) { -+ if (this.id == harm.id && !par2EntityLivingBase.isEntityUndead() || this.id == heal.id && par2EntityLivingBase.isEntityUndead()) { -+ var6 = (int)(par4 * (double)(6 << par3) + 0.5D); -+ -+ if (par1EntityLivingBase == null) { -+ par2EntityLivingBase.attackEntityFrom(DamageSource.magic, (float)var6); - } else { -- var2.attackEntityFrom(DamageSource.causeIndirectMagicDamage(var2, var1), (float)var6); -+ par2EntityLivingBase.attackEntityFrom(DamageSource.causeIndirectMagicDamage(par2EntityLivingBase, par1EntityLivingBase), (float)var6); - } - } - } else { -- var6 = (int)(var4 * (double)(4 << var3) + 0.5D); -- var2.heal((float)var6); -+ var6 = (int)(par4 * (double)(4 << par3) + 0.5D); -+ par2EntityLivingBase.heal((float)var6); - } -- - } - -+ /** -+ * Returns true if the potion has an instant effect instead of a continuous one (eg Harming) -+ */ - public boolean isInstant() { - return false; - } - -- public boolean isReady(int var1, int var2) { -+ /** -+ * checks if Potion effect is ready to be applied this tick. -+ */ -+ public boolean isReady(int par1, int par2) { - int var3; -- if(this.id == regeneration.id) { -- var3 = 50 >> var2; -- return var3 > 0 ? var1 % var3 == 0 : true; -- } else if(this.id == poison.id) { -- var3 = 25 >> var2; -- return var3 > 0 ? var1 % var3 == 0 : true; -- } else if(this.id == wither.id) { -- var3 = 40 >> var2; -- return var3 > 0 ? var1 % var3 == 0 : true; -+ -+ if (this.id == regeneration.id) { -+ var3 = 50 >> par2; -+ return var3 > 0 ? par1 % var3 == 0 : true; -+ } else if (this.id == poison.id) { -+ var3 = 25 >> par2; -+ return var3 > 0 ? par1 % var3 == 0 : true; -+ } else if (this.id == wither.id) { -+ var3 = 40 >> par2; -+ return var3 > 0 ? par1 % var3 == 0 : true; - } else { - return this.id == hunger.id; - } - } - -- public Potion setPotionName(String var1) { -- this.L = var1; -+ /** -+ * Set the potion name. -+ */ -+ public Potion setPotionName(String par1Str) { -+ this.name = par1Str; -+ ColorizeItem.setupPotion(this); - return this; - } - -+ /** -+ * returns the name of the potion -+ */ - public String getName() { -- return this.L; -+ return this.name; - } - -+ /** -+ * Returns true if the potion has a associated status icon to display in then inventory when active. -+ */ - public boolean hasStatusIcon() { - return this.statusIconIndex >= 0; - } - -+ /** -+ * Returns the index for the icon to display when the potion is active. -+ */ - public int getStatusIconIndex() { - return this.statusIconIndex; - } - -+ /** -+ * This method returns true if the potion effect is bad - negative - for the entity. -+ */ - public boolean isBadEffect() { - return this.isBadEffect; - } - -- public static String getDurationString(PotionEffect var0) { -- if(var0.getIsPotionDurationMax()) { -+ public static String getDurationString(PotionEffect par0PotionEffect) { -+ if (par0PotionEffect.getIsPotionDurationMax()) { - return "**:**"; - } else { -- int var1 = var0.getDuration(); -+ int var1 = par0PotionEffect.getDuration(); - return StringUtils.ticksToElapsedTime(var1); - } - } - -- protected Potion setEffectiveness(double var1) { -- this.effectiveness = var1; -+ protected Potion setEffectiveness(double par1) { -+ this.effectiveness = par1; - return this; - } - -@@ -179,49 +250,52 @@ - return this.usable; - } - -+ /** -+ * Returns the color of the potion liquid. -+ */ - public int getLiquidColor() { - return this.liquidColor; - } - -- public Potion func_111184_a(Attribute var1, String var2, double var3, int var5) { -- AttributeModifier var6 = new AttributeModifier(UUID.fromString(var2), this.getName(), var3, var5); -- this.I.put(var1, var6); -+ public Potion func_111184_a(Attribute par1Attribute, String par2Str, double par3, int par5) { -+ AttributeModifier var6 = new AttributeModifier(UUID.fromString(par2Str), this.getName(), par3, par5); -+ this.field_111188_I.put(par1Attribute, var6); - return this; - } - - public Map func_111186_k() { -- return this.I; -+ return this.field_111188_I; - } - -- public void removeAttributesModifiersFromEntity(EntityLivingBase var1, BaseAttributeMap var2, int var3) { -- Iterator var4 = this.I.entrySet().iterator(); -+ public void removeAttributesModifiersFromEntity(EntityLivingBase par1EntityLivingBase, BaseAttributeMap par2BaseAttributeMap, int par3) { -+ Iterator var4 = this.field_111188_I.entrySet().iterator(); - -- while(var4.hasNext()) { -+ while (var4.hasNext()) { - Entry var5 = (Entry)var4.next(); -- AttributeInstance var6 = var2.getAttributeInstance((Attribute)var5.getKey()); -- if(var6 != null) { -+ AttributeInstance var6 = par2BaseAttributeMap.getAttributeInstance((Attribute)var5.getKey()); -+ -+ if (var6 != null) { - var6.removeModifier((AttributeModifier)var5.getValue()); - } - } -- - } - -- public void applyAttributesModifiersToEntity(EntityLivingBase var1, BaseAttributeMap var2, int var3) { -- Iterator var4 = this.I.entrySet().iterator(); -+ public void applyAttributesModifiersToEntity(EntityLivingBase par1EntityLivingBase, BaseAttributeMap par2BaseAttributeMap, int par3) { -+ Iterator var4 = this.field_111188_I.entrySet().iterator(); - -- while(var4.hasNext()) { -+ while (var4.hasNext()) { - Entry var5 = (Entry)var4.next(); -- AttributeInstance var6 = var2.getAttributeInstance((Attribute)var5.getKey()); -- if(var6 != null) { -+ AttributeInstance var6 = par2BaseAttributeMap.getAttributeInstance((Attribute)var5.getKey()); -+ -+ if (var6 != null) { - AttributeModifier var7 = (AttributeModifier)var5.getValue(); - var6.removeModifier(var7); -- var6.applyModifier(new AttributeModifier(var7.getID(), this.getName() + " " + var3, this.func_111183_a(var3, var7), var7.getOperation())); -+ var6.applyModifier(new AttributeModifier(var7.getID(), this.getName() + " " + par3, this.func_111183_a(par3, var7), var7.getOperation())); - } - } -- - } - -- public double func_111183_a(int var1, AttributeModifier var2) { -- return var2.getAmount() * (double)(var1 + 1); -+ public double func_111183_a(int par1, AttributeModifier par2AttributeModifier) { -+ return par2AttributeModifier.getAmount() * (double)(par1 + 1); - } - } ---- net/minecraft/src/BlockRedstoneOre.java -+++ net/minecraft/src/BlockRedstoneOre.java -@@ -5,117 +5,156 @@ - public class BlockRedstoneOre extends Block { - private boolean glowing; - -- public BlockRedstoneOre(int var1, boolean var2) { -- super(var1, Material.rock); -- if(var2) { -+ public BlockRedstoneOre(int par1, boolean par2) { -+ super(par1, Material.rock); -+ -+ if (par2) { - this.setTickRandomly(true); - } - -- this.glowing = var2; -+ this.glowing = par2; - } - -- public int tickRate(World var1) { -+ /** -+ * How many world ticks before ticking -+ */ -+ public int tickRate(World par1World) { - return 30; - } - -- public void onBlockClicked(World var1, int var2, int var3, int var4, EntityPlayer var5) { -- this.glow(var1, var2, var3, var4); -- super.onBlockClicked(var1, var2, var3, var4, var5); -- } -- -- public void onEntityWalking(World var1, int var2, int var3, int var4, Entity var5) { -- this.glow(var1, var2, var3, var4); -- super.onEntityWalking(var1, var2, var3, var4, var5); -- } -- -- public boolean onBlockActivated(World var1, int var2, int var3, int var4, EntityPlayer var5, int var6, float var7, float var8, float var9) { -- this.glow(var1, var2, var3, var4); -- return super.onBlockActivated(var1, var2, var3, var4, var5, var6, var7, var8, var9); -- } -- -- private void glow(World var1, int var2, int var3, int var4) { -- this.sparkle(var1, var2, var3, var4); -- if(this.blockID == Block.oreRedstone.blockID) { -- var1.setBlock(var2, var3, var4, Block.oreRedstoneGlowing.blockID); -- } -- -- } -- -- public void updateTick(World var1, int var2, int var3, int var4, Random var5) { -- if(this.blockID == Block.oreRedstoneGlowing.blockID) { -- var1.setBlock(var2, var3, var4, Block.oreRedstone.blockID); -- } -- -- } -- -- public int idDropped(int var1, Random var2, int var3) { -+ /** -+ * Called when the block is clicked by a player. Args: x, y, z, entityPlayer -+ */ -+ public void onBlockClicked(World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer) { -+ this.glow(par1World, par2, par3, par4); -+ super.onBlockClicked(par1World, par2, par3, par4, par5EntityPlayer); -+ } -+ -+ /** -+ * Called whenever an entity is walking on top of this block. Args: world, x, y, z, entity -+ */ -+ public void onEntityWalking(World par1World, int par2, int par3, int par4, Entity par5Entity) { -+ this.glow(par1World, par2, par3, par4); -+ super.onEntityWalking(par1World, par2, par3, par4, par5Entity); -+ } -+ -+ /** -+ * Called upon block activation (right click on the block.) -+ */ -+ public boolean onBlockActivated(World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer, int par6, float par7, float par8, float par9) { -+ this.glow(par1World, par2, par3, par4); -+ return super.onBlockActivated(par1World, par2, par3, par4, par5EntityPlayer, par6, par7, par8, par9); -+ } -+ -+ /** -+ * The redstone ore glows. -+ */ -+ private void glow(World par1World, int par2, int par3, int par4) { -+ this.sparkle(par1World, par2, par3, par4); -+ -+ if (this.blockID == Block.oreRedstone.blockID) { -+ par1World.setBlock(par2, par3, par4, Block.oreRedstoneGlowing.blockID); -+ } -+ } -+ -+ /** -+ * Ticks the block if it's been scheduled -+ */ -+ public void updateTick(World par1World, int par2, int par3, int par4, Random par5Random) { -+ if (this.blockID == Block.oreRedstoneGlowing.blockID) { -+ par1World.setBlock(par2, par3, par4, Block.oreRedstone.blockID); -+ } -+ } -+ -+ /** -+ * Returns the ID of the items to drop on destruction. -+ */ -+ public int idDropped(int par1, Random par2Random, int par3) { - return Item.redstone.itemID; - } - -- public int quantityDroppedWithBonus(int var1, Random var2) { -- return this.quantityDropped(var2) + var2.nextInt(var1 + 1); -- } -- -- public int quantityDropped(Random var1) { -- return 4 + var1.nextInt(2); -- } -- -- public void dropBlockAsItemWithChance(World var1, int var2, int var3, int var4, int var5, float var6, int var7) { -- super.dropBlockAsItemWithChance(var1, var2, var3, var4, var5, var6, var7); -- if(this.idDropped(var5, var1.s, var7) != this.blockID) { -- int var8 = 1 + var1.s.nextInt(5); -- this.dropXpOnBlockBreak(var1, var2, var3, var4, var8); -- } -- -- } -- -- public void randomDisplayTick(World var1, int var2, int var3, int var4, Random var5) { -- if(this.glowing) { -- this.sparkle(var1, var2, var3, var4); -- } -- -- } -- -- private void sparkle(World var1, int var2, int var3, int var4) { -- Random var5 = var1.s; -- double var6 = 1.0D / 16.0D; -- -- for(int var8 = 0; var8 < 6; ++var8) { -- double var9 = (double)((float)var2 + var5.nextFloat()); -- double var11 = (double)((float)var3 + var5.nextFloat()); -- double var13 = (double)((float)var4 + var5.nextFloat()); -- if(var8 == 0 && !var1.isBlockOpaqueCube(var2, var3 + 1, var4)) { -- var11 = (double)(var3 + 1) + var6; -- } -- -- if(var8 == 1 && !var1.isBlockOpaqueCube(var2, var3 - 1, var4)) { -- var11 = (double)(var3 + 0) - var6; -- } -- -- if(var8 == 2 && !var1.isBlockOpaqueCube(var2, var3, var4 + 1)) { -- var13 = (double)(var4 + 1) + var6; -- } -- -- if(var8 == 3 && !var1.isBlockOpaqueCube(var2, var3, var4 - 1)) { -- var13 = (double)(var4 + 0) - var6; -- } -- -- if(var8 == 4 && !var1.isBlockOpaqueCube(var2 + 1, var3, var4)) { -- var9 = (double)(var2 + 1) + var6; -- } -- -- if(var8 == 5 && !var1.isBlockOpaqueCube(var2 - 1, var3, var4)) { -- var9 = (double)(var2 + 0) - var6; -- } -- -- if(var9 < (double)var2 || var9 > (double)(var2 + 1) || var11 < 0.0D || var11 > (double)(var3 + 1) || var13 < (double)var4 || var13 > (double)(var4 + 1)) { -- var1.spawnParticle("reddust", var9, var11, var13, 0.0D, 0.0D, 0.0D); -- } -- } -- -- } -- -- protected ItemStack createStackedBlock(int var1) { -+ /** -+ * Returns the usual quantity dropped by the block plus a bonus of 1 to 'i' (inclusive). -+ */ -+ public int quantityDroppedWithBonus(int par1, Random par2Random) { -+ return this.quantityDropped(par2Random) + par2Random.nextInt(par1 + 1); -+ } -+ -+ /** -+ * Returns the quantity of items to drop on block destruction. -+ */ -+ public int quantityDropped(Random par1Random) { -+ return 4 + par1Random.nextInt(2); -+ } -+ -+ /** -+ * Drops the block items with a specified chance of dropping the specified items -+ */ -+ public void dropBlockAsItemWithChance(World par1World, int par2, int par3, int par4, int par5, float par6, int par7) { -+ super.dropBlockAsItemWithChance(par1World, par2, par3, par4, par5, par6, par7); -+ -+ if (this.idDropped(par5, par1World.rand, par7) != this.blockID) { -+ int var8 = 1 + par1World.rand.nextInt(5); -+ this.dropXpOnBlockBreak(par1World, par2, par3, par4, var8); -+ } -+ } -+ -+ /** -+ * A randomly called display update to be able to add particles or other items for display -+ */ -+ public void randomDisplayTick(World par1World, int par2, int par3, int par4, Random par5Random) { -+ if (this.glowing) { -+ this.sparkle(par1World, par2, par3, par4); -+ } -+ } -+ -+ /** -+ * The redstone ore sparkles. -+ */ -+ private void sparkle(World par1World, int par2, int par3, int par4) { -+ Random var5 = par1World.rand; -+ double var6 = 0.0625D; -+ -+ for (int var8 = 0; var8 < 6; ++var8) { -+ double var9 = (double)((float)par2 + var5.nextFloat()); -+ double var11 = (double)((float)par3 + var5.nextFloat()); -+ double var13 = (double)((float)par4 + var5.nextFloat()); -+ -+ if (var8 == 0 && !par1World.isBlockOpaqueCube(par2, par3 + 1, par4)) { -+ var11 = (double)(par3 + 1) + var6; -+ } -+ -+ if (var8 == 1 && !par1World.isBlockOpaqueCube(par2, par3 - 1, par4)) { -+ var11 = (double)(par3 + 0) - var6; -+ } -+ -+ if (var8 == 2 && !par1World.isBlockOpaqueCube(par2, par3, par4 + 1)) { -+ var13 = (double)(par4 + 1) + var6; -+ } -+ -+ if (var8 == 3 && !par1World.isBlockOpaqueCube(par2, par3, par4 - 1)) { -+ var13 = (double)(par4 + 0) - var6; -+ } -+ -+ if (var8 == 4 && !par1World.isBlockOpaqueCube(par2 + 1, par3, par4)) { -+ var9 = (double)(par2 + 1) + var6; -+ } -+ -+ if (var8 == 5 && !par1World.isBlockOpaqueCube(par2 - 1, par3, par4)) { -+ var9 = (double)(par2 + 0) - var6; -+ } -+ -+ if (var9 < (double)par2 || var9 > (double)(par2 + 1) || var11 < 0.0D || var11 > (double)(par3 + 1) || var13 < (double)par4 || var13 > (double)(par4 + 1)) { -+ par1World.spawnParticle("reddust", var9, var11, var13, 0.0D, 0.0D, 0.0D); -+ } -+ } -+ } -+ -+ /** -+ * Returns an item stack containing a single instance of the current block type. 'i' is the block's subtype/damage and -+ * is ignored for blocks which do not support subtypes. Blocks which cannot be harvested should return null. -+ */ -+ protected ItemStack createStackedBlock(int par1) { - return new ItemStack(Block.oreRedstone); - } - } ---- net/minecraft/src/EntityHugeExplodeFX.java -+++ net/minecraft/src/EntityHugeExplodeFX.java -@@ -2,28 +2,32 @@ - - public class EntityHugeExplodeFX extends EntityFX { - private int timeSinceStart; -+ -+ /** the maximum time for the explosion */ - private int maximumTime = 8; - -- public EntityHugeExplodeFX(World var1, double var2, double var4, double var6, double var8, double var10, double var12) { -- super(var1, var2, var4, var6, 0.0D, 0.0D, 0.0D); -- } -- -- public void renderParticle(Tessellator var1, float var2, float var3, float var4, float var5, float var6, float var7) { -- } -- -+ public EntityHugeExplodeFX(World par1World, double par2, double par4, double par6, double par8, double par10, double par12) { -+ super(par1World, par2, par4, par6, 0.0D, 0.0D, 0.0D); -+ } -+ -+ public void renderParticle(Tessellator par1Tessellator, float par2, float par3, float par4, float par5, float par6, float par7) {} -+ -+ /** -+ * Called to update the entity's position/logic. -+ */ - public void onUpdate() { -- for(int var1 = 0; var1 < 6; ++var1) { -- double var2 = this.posX + (this.ab.nextDouble() - this.ab.nextDouble()) * 4.0D; -- double var4 = this.posY + (this.ab.nextDouble() - this.ab.nextDouble()) * 4.0D; -- double var6 = this.posZ + (this.ab.nextDouble() - this.ab.nextDouble()) * 4.0D; -+ for (int var1 = 0; var1 < 6; ++var1) { -+ double var2 = this.posX + (this.rand.nextDouble() - this.rand.nextDouble()) * 4.0D; -+ double var4 = this.posY + (this.rand.nextDouble() - this.rand.nextDouble()) * 4.0D; -+ double var6 = this.posZ + (this.rand.nextDouble() - this.rand.nextDouble()) * 4.0D; - this.worldObj.spawnParticle("largeexplode", var2, var4, var6, (double)((float)this.timeSinceStart / (float)this.maximumTime), 0.0D, 0.0D); - } - - ++this.timeSinceStart; -- if(this.timeSinceStart == this.maximumTime) { -+ -+ if (this.timeSinceStart == this.maximumTime) { - this.setDead(); - } -- - } - - public int getFXLayer() { ---- net/minecraft/src/Frustrum.java -+++ net/minecraft/src/Frustrum.java -@@ -6,17 +6,23 @@ - private double yPosition; - private double zPosition; - -- public void setPosition(double var1, double var3, double var5) { -- this.xPosition = var1; -- this.yPosition = var3; -- this.zPosition = var5; -- } -- -- public boolean isBoxInFrustum(double var1, double var3, double var5, double var7, double var9, double var11) { -- return this.clippingHelper.isBoxInFrustum(var1 - this.xPosition, var3 - this.yPosition, var5 - this.zPosition, var7 - this.xPosition, var9 - this.yPosition, var11 - this.zPosition); -- } -- -- public boolean isBoundingBoxInFrustum(AxisAlignedBB var1) { -- return this.isBoxInFrustum(var1.minX, var1.minY, var1.minZ, var1.maxX, var1.maxY, var1.maxZ); -+ public void setPosition(double par1, double par3, double par5) { -+ this.xPosition = par1; -+ this.yPosition = par3; -+ this.zPosition = par5; -+ } -+ -+ /** -+ * Calls the clipping helper. Returns true if the box is inside all 6 clipping planes, otherwise returns false. -+ */ -+ public boolean isBoxInFrustum(double par1, double par3, double par5, double par7, double par9, double par11) { -+ return this.clippingHelper.isBoxInFrustum(par1 - this.xPosition, par3 - this.yPosition, par5 - this.zPosition, par7 - this.xPosition, par9 - this.yPosition, par11 - this.zPosition); -+ } -+ -+ /** -+ * Returns true if the bounding box is inside all 6 clipping planes, otherwise returns false. -+ */ -+ public boolean isBoundingBoxInFrustum(AxisAlignedBB par1AxisAlignedBB) { -+ return this.isBoxInFrustum(par1AxisAlignedBB.minX, par1AxisAlignedBB.minY, par1AxisAlignedBB.minZ, par1AxisAlignedBB.maxX, par1AxisAlignedBB.maxY, par1AxisAlignedBB.maxZ); - } - } ---- net/minecraft/src/StatBasic.java -+++ net/minecraft/src/StatBasic.java -@@ -1,17 +1,20 @@ - package net.minecraft.src; - - public class StatBasic extends StatBase { -- public StatBasic(int var1, String var2, IStatType var3) { -- super(var1, var2, var3); -- } -- -- public StatBasic(int var1, String var2) { -- super(var1, var2); -- } -- -+ public StatBasic(int par1, String par2Str, IStatType par3IStatType) { -+ super(par1, par2Str, par3IStatType); -+ } -+ -+ public StatBasic(int par1, String par2Str) { -+ super(par1, par2Str); -+ } -+ -+ /** -+ * Register the stat into StatList. -+ */ - public StatBase registerStat() { - super.registerStat(); -- StatList.c.add(this); -+ StatList.generalStats.add(this); - return this; - } - } ---- net/minecraft/src/RecipesDyes.java -+++ net/minecraft/src/RecipesDyes.java -@@ -1,32 +1,36 @@ - package net.minecraft.src; - - public class RecipesDyes { -- public void addRecipes(CraftingManager var1) { -+ -+ /** -+ * Adds the dye recipes to the CraftingManager. -+ */ -+ public void addRecipes(CraftingManager par1CraftingManager) { - int var2; -- for(var2 = 0; var2 < 16; ++var2) { -- var1.addShapelessRecipe(new ItemStack(Block.cloth, 1, BlockColored.getDyeFromBlock(var2)), new Object[]{new ItemStack(Item.dyePowder, 1, var2), new ItemStack(Item.itemsList[Block.cloth.blockID], 1, 0)}); -- var1.addRecipe(new ItemStack(Block.stainedClay, 8, BlockColored.getDyeFromBlock(var2)), new Object[]{"###", "#X#", "###", Character.valueOf('#'), new ItemStack(Block.hardenedClay), Character.valueOf('X'), new ItemStack(Item.dyePowder, 1, var2)}); -- } -- -- var1.addShapelessRecipe(new ItemStack(Item.dyePowder, 2, 11), new Object[]{Block.plantYellow}); -- var1.addShapelessRecipe(new ItemStack(Item.dyePowder, 2, 1), new Object[]{Block.plantRed}); -- var1.addShapelessRecipe(new ItemStack(Item.dyePowder, 3, 15), new Object[]{Item.bone}); -- var1.addShapelessRecipe(new ItemStack(Item.dyePowder, 2, 9), new Object[]{new ItemStack(Item.dyePowder, 1, 1), new ItemStack(Item.dyePowder, 1, 15)}); -- var1.addShapelessRecipe(new ItemStack(Item.dyePowder, 2, 14), new Object[]{new ItemStack(Item.dyePowder, 1, 1), new ItemStack(Item.dyePowder, 1, 11)}); -- var1.addShapelessRecipe(new ItemStack(Item.dyePowder, 2, 10), new Object[]{new ItemStack(Item.dyePowder, 1, 2), new ItemStack(Item.dyePowder, 1, 15)}); -- var1.addShapelessRecipe(new ItemStack(Item.dyePowder, 2, 8), new Object[]{new ItemStack(Item.dyePowder, 1, 0), new ItemStack(Item.dyePowder, 1, 15)}); -- var1.addShapelessRecipe(new ItemStack(Item.dyePowder, 2, 7), new Object[]{new ItemStack(Item.dyePowder, 1, 8), new ItemStack(Item.dyePowder, 1, 15)}); -- var1.addShapelessRecipe(new ItemStack(Item.dyePowder, 3, 7), new Object[]{new ItemStack(Item.dyePowder, 1, 0), new ItemStack(Item.dyePowder, 1, 15), new ItemStack(Item.dyePowder, 1, 15)}); -- var1.addShapelessRecipe(new ItemStack(Item.dyePowder, 2, 12), new Object[]{new ItemStack(Item.dyePowder, 1, 4), new ItemStack(Item.dyePowder, 1, 15)}); -- var1.addShapelessRecipe(new ItemStack(Item.dyePowder, 2, 6), new Object[]{new ItemStack(Item.dyePowder, 1, 4), new ItemStack(Item.dyePowder, 1, 2)}); -- var1.addShapelessRecipe(new ItemStack(Item.dyePowder, 2, 5), new Object[]{new ItemStack(Item.dyePowder, 1, 4), new ItemStack(Item.dyePowder, 1, 1)}); -- var1.addShapelessRecipe(new ItemStack(Item.dyePowder, 2, 13), new Object[]{new ItemStack(Item.dyePowder, 1, 5), new ItemStack(Item.dyePowder, 1, 9)}); -- var1.addShapelessRecipe(new ItemStack(Item.dyePowder, 3, 13), new Object[]{new ItemStack(Item.dyePowder, 1, 4), new ItemStack(Item.dyePowder, 1, 1), new ItemStack(Item.dyePowder, 1, 9)}); -- var1.addShapelessRecipe(new ItemStack(Item.dyePowder, 4, 13), new Object[]{new ItemStack(Item.dyePowder, 1, 4), new ItemStack(Item.dyePowder, 1, 1), new ItemStack(Item.dyePowder, 1, 1), new ItemStack(Item.dyePowder, 1, 15)}); -- -- for(var2 = 0; var2 < 16; ++var2) { -- var1.addRecipe(new ItemStack(Block.carpet, 3, var2), new Object[]{"##", Character.valueOf('#'), new ItemStack(Block.cloth, 1, var2)}); -- } -- -+ -+ for (var2 = 0; var2 < 16; ++var2) { -+ par1CraftingManager.addShapelessRecipe(new ItemStack(Block.cloth, 1, BlockColored.getDyeFromBlock(var2)), new Object[] {new ItemStack(Item.dyePowder, 1, var2), new ItemStack(Item.itemsList[Block.cloth.blockID], 1, 0)}); -+ par1CraftingManager.addRecipe(new ItemStack(Block.stainedClay, 8, BlockColored.getDyeFromBlock(var2)), new Object[] {"###", "#X#", "###", '#', new ItemStack(Block.hardenedClay), 'X', new ItemStack(Item.dyePowder, 1, var2)}); -+ } -+ -+ par1CraftingManager.addShapelessRecipe(new ItemStack(Item.dyePowder, 2, 11), new Object[] {Block.plantYellow}); -+ par1CraftingManager.addShapelessRecipe(new ItemStack(Item.dyePowder, 2, 1), new Object[] {Block.plantRed}); -+ par1CraftingManager.addShapelessRecipe(new ItemStack(Item.dyePowder, 3, 15), new Object[] {Item.bone}); -+ par1CraftingManager.addShapelessRecipe(new ItemStack(Item.dyePowder, 2, 9), new Object[] {new ItemStack(Item.dyePowder, 1, 1), new ItemStack(Item.dyePowder, 1, 15)}); -+ par1CraftingManager.addShapelessRecipe(new ItemStack(Item.dyePowder, 2, 14), new Object[] {new ItemStack(Item.dyePowder, 1, 1), new ItemStack(Item.dyePowder, 1, 11)}); -+ par1CraftingManager.addShapelessRecipe(new ItemStack(Item.dyePowder, 2, 10), new Object[] {new ItemStack(Item.dyePowder, 1, 2), new ItemStack(Item.dyePowder, 1, 15)}); -+ par1CraftingManager.addShapelessRecipe(new ItemStack(Item.dyePowder, 2, 8), new Object[] {new ItemStack(Item.dyePowder, 1, 0), new ItemStack(Item.dyePowder, 1, 15)}); -+ par1CraftingManager.addShapelessRecipe(new ItemStack(Item.dyePowder, 2, 7), new Object[] {new ItemStack(Item.dyePowder, 1, 8), new ItemStack(Item.dyePowder, 1, 15)}); -+ par1CraftingManager.addShapelessRecipe(new ItemStack(Item.dyePowder, 3, 7), new Object[] {new ItemStack(Item.dyePowder, 1, 0), new ItemStack(Item.dyePowder, 1, 15), new ItemStack(Item.dyePowder, 1, 15)}); -+ par1CraftingManager.addShapelessRecipe(new ItemStack(Item.dyePowder, 2, 12), new Object[] {new ItemStack(Item.dyePowder, 1, 4), new ItemStack(Item.dyePowder, 1, 15)}); -+ par1CraftingManager.addShapelessRecipe(new ItemStack(Item.dyePowder, 2, 6), new Object[] {new ItemStack(Item.dyePowder, 1, 4), new ItemStack(Item.dyePowder, 1, 2)}); -+ par1CraftingManager.addShapelessRecipe(new ItemStack(Item.dyePowder, 2, 5), new Object[] {new ItemStack(Item.dyePowder, 1, 4), new ItemStack(Item.dyePowder, 1, 1)}); -+ par1CraftingManager.addShapelessRecipe(new ItemStack(Item.dyePowder, 2, 13), new Object[] {new ItemStack(Item.dyePowder, 1, 5), new ItemStack(Item.dyePowder, 1, 9)}); -+ par1CraftingManager.addShapelessRecipe(new ItemStack(Item.dyePowder, 3, 13), new Object[] {new ItemStack(Item.dyePowder, 1, 4), new ItemStack(Item.dyePowder, 1, 1), new ItemStack(Item.dyePowder, 1, 9)}); -+ par1CraftingManager.addShapelessRecipe(new ItemStack(Item.dyePowder, 4, 13), new Object[] {new ItemStack(Item.dyePowder, 1, 4), new ItemStack(Item.dyePowder, 1, 1), new ItemStack(Item.dyePowder, 1, 1), new ItemStack(Item.dyePowder, 1, 15)}); -+ -+ for (var2 = 0; var2 < 16; ++var2) { -+ par1CraftingManager.addRecipe(new ItemStack(Block.carpet, 3, var2), new Object[] {"##", '#', new ItemStack(Block.cloth, 1, var2)}); -+ } - } - } ---- net/minecraft/src/EntityAnimal.java -+++ net/minecraft/src/EntityAnimal.java -@@ -4,75 +4,94 @@ - - public abstract class EntityAnimal extends EntityAgeable implements IAnimals { - private int inLove; -+ -+ /** -+ * This is representation of a counter for reproduction progress. (Note that this is different from the inLove which -+ * represent being in Love-Mode) -+ */ - private int breeding; - -- public EntityAnimal(World var1) { -- super(var1); -+ public EntityAnimal(World par1World) { -+ super(par1World); - } - -+ /** -+ * main AI tick function, replaces updateEntityActionState -+ */ - protected void updateAITick() { -- if(this.getGrowingAge() != 0) { -+ if (this.getGrowingAge() != 0) { - this.inLove = 0; - } - - super.updateAITick(); - } - -+ /** -+ * Called frequently so the entity can update its state every tick as required. For example, zombies and skeletons use -+ * this to react to sunlight and start to burn. -+ */ - public void onLivingUpdate() { - super.onLivingUpdate(); -- if(this.getGrowingAge() != 0) { -+ -+ if (this.getGrowingAge() != 0) { - this.inLove = 0; - } - -- if(this.inLove > 0) { -+ if (this.inLove > 0) { - --this.inLove; - String var1 = "heart"; -- if(this.inLove % 10 == 0) { -- double var2 = this.ab.nextGaussian() * 0.02D; -- double var4 = this.ab.nextGaussian() * 0.02D; -- double var6 = this.ab.nextGaussian() * 0.02D; -- this.worldObj.spawnParticle(var1, this.posX + (double)(this.ab.nextFloat() * this.width * 2.0F) - (double)this.width, this.posY + 0.5D + (double)(this.ab.nextFloat() * this.height), this.posZ + (double)(this.ab.nextFloat() * this.width * 2.0F) - (double)this.width, var2, var4, var6); -+ -+ if (this.inLove % 10 == 0) { -+ double var2 = this.rand.nextGaussian() * 0.02D; -+ double var4 = this.rand.nextGaussian() * 0.02D; -+ double var6 = this.rand.nextGaussian() * 0.02D; -+ this.worldObj.spawnParticle(var1, this.posX + (double)(this.rand.nextFloat() * this.width * 2.0F) - (double)this.width, this.posY + 0.5D + (double)(this.rand.nextFloat() * this.height), this.posZ + (double)(this.rand.nextFloat() * this.width * 2.0F) - (double)this.width, var2, var4, var6); - } - } else { - this.breeding = 0; - } -- - } - -- protected void attackEntity(Entity var1, float var2) { -- if(var1 instanceof EntityPlayer) { -- if(var2 < 3.0F) { -- double var3 = var1.posX - this.posX; -- double var5 = var1.posZ - this.posZ; -- this.rotationYaw = (float)(Math.atan2(var5, var3) * 180.0D / (double)((float)Math.PI)) - 90.0F; -+ /** -+ * Basic mob attack. Default to touch of death in EntityCreature. Overridden by each mob to define their attack. -+ */ -+ protected void attackEntity(Entity par1Entity, float par2) { -+ if (par1Entity instanceof EntityPlayer) { -+ if (par2 < 3.0F) { -+ double var3 = par1Entity.posX - this.posX; -+ double var5 = par1Entity.posZ - this.posZ; -+ this.rotationYaw = (float)(Math.atan2(var5, var3) * 180.0D / Math.PI) - 90.0F; - this.hasAttacked = true; - } - -- EntityPlayer var7 = (EntityPlayer)var1; -- if(var7.getCurrentEquippedItem() == null || !this.isBreedingItem(var7.getCurrentEquippedItem())) { -+ EntityPlayer var7 = (EntityPlayer)par1Entity; -+ -+ if (var7.getCurrentEquippedItem() == null || !this.isBreedingItem(var7.getCurrentEquippedItem())) { - this.entityToAttack = null; - } -- } else if(var1 instanceof EntityAnimal) { -- EntityAnimal var8 = (EntityAnimal)var1; -- if(this.getGrowingAge() > 0 && var8.getGrowingAge() < 0) { -- if((double)var2 < 2.5D) { -+ } else if (par1Entity instanceof EntityAnimal) { -+ EntityAnimal var8 = (EntityAnimal)par1Entity; -+ -+ if (this.getGrowingAge() > 0 && var8.getGrowingAge() < 0) { -+ if ((double)par2 < 2.5D) { - this.hasAttacked = true; - } -- } else if(this.inLove > 0 && var8.inLove > 0) { -- if(var8.entityToAttack == null) { -+ } else if (this.inLove > 0 && var8.inLove > 0) { -+ if (var8.entityToAttack == null) { - var8.entityToAttack = this; - } - -- if(var8.entityToAttack == this && (double)var2 < 3.5D) { -+ if (var8.entityToAttack == this && (double)par2 < 3.5D) { - ++var8.inLove; - ++this.inLove; - ++this.breeding; -- if(this.breeding % 4 == 0) { -- this.worldObj.spawnParticle("heart", this.posX + (double)(this.ab.nextFloat() * this.width * 2.0F) - (double)this.width, this.posY + 0.5D + (double)(this.ab.nextFloat() * this.height), this.posZ + (double)(this.ab.nextFloat() * this.width * 2.0F) - (double)this.width, 0.0D, 0.0D, 0.0D); -+ -+ if (this.breeding % 4 == 0) { -+ this.worldObj.spawnParticle("heart", this.posX + (double)(this.rand.nextFloat() * this.width * 2.0F) - (double)this.width, this.posY + 0.5D + (double)(this.rand.nextFloat() * this.height), this.posZ + (double)(this.rand.nextFloat() * this.width * 2.0F) - (double)this.width, 0.0D, 0.0D, 0.0D); - } - -- if(this.breeding == 60) { -- this.procreate((EntityAnimal)var1); -+ if (this.breeding == 60) { -+ this.procreate((EntityAnimal)par1Entity); - } - } else { - this.breeding = 0; -@@ -82,99 +101,124 @@ - this.entityToAttack = null; - } - } -- - } - -- private void procreate(EntityAnimal var1) { -- EntityAgeable var2 = this.createChild(var1); -- if(var2 != null) { -+ /** -+ * Creates a baby animal according to the animal type of the target at the actual position and spawns 'love' particles. -+ */ -+ private void procreate(EntityAnimal par1EntityAnimal) { -+ EntityAgeable var2 = this.createChild(par1EntityAnimal); -+ -+ if (var2 != null) { - this.setGrowingAge(6000); -- var1.setGrowingAge(6000); -+ par1EntityAnimal.setGrowingAge(6000); - this.inLove = 0; - this.breeding = 0; - this.entityToAttack = null; -- var1.entityToAttack = null; -- var1.breeding = 0; -- var1.inLove = 0; -+ par1EntityAnimal.entityToAttack = null; -+ par1EntityAnimal.breeding = 0; -+ par1EntityAnimal.inLove = 0; - var2.setGrowingAge(-24000); - var2.setLocationAndAngles(this.posX, this.posY, this.posZ, this.rotationYaw, this.rotationPitch); - -- for(int var3 = 0; var3 < 7; ++var3) { -- double var4 = this.ab.nextGaussian() * 0.02D; -- double var6 = this.ab.nextGaussian() * 0.02D; -- double var8 = this.ab.nextGaussian() * 0.02D; -- this.worldObj.spawnParticle("heart", this.posX + (double)(this.ab.nextFloat() * this.width * 2.0F) - (double)this.width, this.posY + 0.5D + (double)(this.ab.nextFloat() * this.height), this.posZ + (double)(this.ab.nextFloat() * this.width * 2.0F) - (double)this.width, var4, var6, var8); -+ for (int var3 = 0; var3 < 7; ++var3) { -+ double var4 = this.rand.nextGaussian() * 0.02D; -+ double var6 = this.rand.nextGaussian() * 0.02D; -+ double var8 = this.rand.nextGaussian() * 0.02D; -+ this.worldObj.spawnParticle("heart", this.posX + (double)(this.rand.nextFloat() * this.width * 2.0F) - (double)this.width, this.posY + 0.5D + (double)(this.rand.nextFloat() * this.height), this.posZ + (double)(this.rand.nextFloat() * this.width * 2.0F) - (double)this.width, var4, var6, var8); - } - - this.worldObj.spawnEntityInWorld(var2); - } -- - } - -- public boolean attackEntityFrom(DamageSource var1, float var2) { -- if(this.isEntityInvulnerable()) { -+ /** -+ * Called when the entity is attacked. -+ */ -+ public boolean attackEntityFrom(DamageSource par1DamageSource, float par2) { -+ if (this.isEntityInvulnerable()) { - return false; - } else { - this.fleeingTick = 60; -- if(!this.isAIEnabled()) { -+ -+ if (!this.isAIEnabled()) { - AttributeInstance var3 = this.getEntityAttribute(SharedMonsterAttributes.movementSpeed); -- if(var3.getModifier(h) == null) { -+ -+ if (var3.getModifier(field_110179_h) == null) { - var3.applyModifier(field_110181_i); - } - } - - this.entityToAttack = null; - this.inLove = 0; -- return super.attackEntityFrom(var1, var2); -+ return super.attackEntityFrom(par1DamageSource, par2); - } - } - -- public float getBlockPathWeight(int var1, int var2, int var3) { -- return this.worldObj.getBlockId(var1, var2 - 1, var3) == Block.grass.blockID ? 10.0F : this.worldObj.getLightBrightness(var1, var2, var3) - 0.5F; -- } -- -- public void writeEntityToNBT(NBTTagCompound var1) { -- super.writeEntityToNBT(var1); -- var1.setInteger("InLove", this.inLove); -- } -- -- public void readEntityFromNBT(NBTTagCompound var1) { -- super.readEntityFromNBT(var1); -- this.inLove = var1.getInteger("InLove"); -- } -- -+ /** -+ * Takes a coordinate in and returns a weight to determine how likely this creature will try to path to the block. -+ * Args: x, y, z -+ */ -+ public float getBlockPathWeight(int par1, int par2, int par3) { -+ return this.worldObj.getBlockId(par1, par2 - 1, par3) == Block.grass.blockID ? 10.0F : this.worldObj.getLightBrightness(par1, par2, par3) - 0.5F; -+ } -+ -+ /** -+ * (abstract) Protected helper method to write subclass entity data to NBT. -+ */ -+ public void writeEntityToNBT(NBTTagCompound par1NBTTagCompound) { -+ super.writeEntityToNBT(par1NBTTagCompound); -+ par1NBTTagCompound.setInteger("InLove", this.inLove); -+ } -+ -+ /** -+ * (abstract) Protected helper method to read subclass entity data from NBT. -+ */ -+ public void readEntityFromNBT(NBTTagCompound par1NBTTagCompound) { -+ super.readEntityFromNBT(par1NBTTagCompound); -+ this.inLove = par1NBTTagCompound.getInteger("InLove"); -+ } -+ -+ /** -+ * Finds the closest player within 16 blocks to attack, or null if this Entity isn't interested in attacking (Animals, -+ * Spiders at day, peaceful PigZombies). -+ */ - protected Entity findPlayerToAttack() { -- if(this.fleeingTick > 0) { -+ if (this.fleeingTick > 0) { - return null; - } else { - float var1 = 8.0F; - List var2; - int var3; - EntityAnimal var4; -- if(this.inLove > 0) { -+ -+ if (this.inLove > 0) { - var2 = this.worldObj.getEntitiesWithinAABB(this.getClass(), this.boundingBox.expand((double)var1, (double)var1, (double)var1)); - -- for(var3 = 0; var3 < var2.size(); ++var3) { -+ for (var3 = 0; var3 < var2.size(); ++var3) { - var4 = (EntityAnimal)var2.get(var3); -- if(var4 != this && var4.inLove > 0) { -+ -+ if (var4 != this && var4.inLove > 0) { - return var4; - } - } -- } else if(this.getGrowingAge() == 0) { -+ } else if (this.getGrowingAge() == 0) { - var2 = this.worldObj.getEntitiesWithinAABB(EntityPlayer.class, this.boundingBox.expand((double)var1, (double)var1, (double)var1)); - -- for(var3 = 0; var3 < var2.size(); ++var3) { -+ for (var3 = 0; var3 < var2.size(); ++var3) { - EntityPlayer var5 = (EntityPlayer)var2.get(var3); -- if(var5.getCurrentEquippedItem() != null && this.isBreedingItem(var5.getCurrentEquippedItem())) { -+ -+ if (var5.getCurrentEquippedItem() != null && this.isBreedingItem(var5.getCurrentEquippedItem())) { - return var5; - } - } -- } else if(this.getGrowingAge() > 0) { -+ } else if (this.getGrowingAge() > 0) { - var2 = this.worldObj.getEntitiesWithinAABB(this.getClass(), this.boundingBox.expand((double)var1, (double)var1, (double)var1)); - -- for(var3 = 0; var3 < var2.size(); ++var3) { -+ for (var3 = 0; var3 < var2.size(); ++var3) { - var4 = (EntityAnimal)var2.get(var3); -- if(var4 != this && var4.getGrowingAge() < 0) { -+ -+ if (var4 != this && var4.getGrowingAge() < 0) { - return var4; - } - } -@@ -184,6 +228,9 @@ - } - } - -+ /** -+ * Checks if the entity's current position is a valid location to spawn this entity. -+ */ - public boolean getCanSpawnHere() { - int var1 = MathHelper.floor_double(this.posX); - int var2 = MathHelper.floor_double(this.boundingBox.minY); -@@ -191,36 +238,54 @@ - return this.worldObj.getBlockId(var1, var2 - 1, var3) == Block.grass.blockID && this.worldObj.getFullBlockLightValue(var1, var2, var3) > 8 && super.getCanSpawnHere(); - } - -+ /** -+ * Get number of ticks, at least during which the living entity will be silent. -+ */ - public int getTalkInterval() { - return 120; - } - -+ /** -+ * Determines if an entity can be despawned, used on idle far away entities -+ */ - protected boolean canDespawn() { - return false; - } - -- protected int getExperiencePoints(EntityPlayer var1) { -- return 1 + this.worldObj.s.nextInt(3); -- } -- -- public boolean isBreedingItem(ItemStack var1) { -- return var1.itemID == Item.wheat.itemID; -- } -- -- public boolean interact(EntityPlayer var1) { -- ItemStack var2 = var1.inventory.getCurrentItem(); -- if(var2 != null && this.isBreedingItem(var2) && this.getGrowingAge() == 0 && this.inLove <= 0) { -- if(!var1.capabilities.isCreativeMode) { -+ /** -+ * Get the experience points the entity currently has. -+ */ -+ protected int getExperiencePoints(EntityPlayer par1EntityPlayer) { -+ return 1 + this.worldObj.rand.nextInt(3); -+ } -+ -+ /** -+ * Checks if the parameter is an item which this animal can be fed to breed it (wheat, carrots or seeds depending on -+ * the animal type) -+ */ -+ public boolean isBreedingItem(ItemStack par1ItemStack) { -+ return par1ItemStack.itemID == Item.wheat.itemID; -+ } -+ -+ /** -+ * Called when a player interacts with a mob. e.g. gets milk from a cow, gets into the saddle on a pig. -+ */ -+ public boolean interact(EntityPlayer par1EntityPlayer) { -+ ItemStack var2 = par1EntityPlayer.inventory.getCurrentItem(); -+ -+ if (var2 != null && this.isBreedingItem(var2) && this.getGrowingAge() == 0 && this.inLove <= 0) { -+ if (!par1EntityPlayer.capabilities.isCreativeMode) { - --var2.stackSize; -- if(var2.stackSize <= 0) { -- var1.inventory.setInventorySlotContents(var1.inventory.currentItem, (ItemStack)null); -+ -+ if (var2.stackSize <= 0) { -+ par1EntityPlayer.inventory.setInventorySlotContents(par1EntityPlayer.inventory.currentItem, (ItemStack)null); - } - } - - this.func_110196_bT(); - return true; - } else { -- return super.interact(var1); -+ return super.interact(par1EntityPlayer); - } - } - -@@ -230,6 +295,9 @@ - this.worldObj.setEntityState(this, (byte)18); - } - -+ /** -+ * Returns if the entity is currently in 'love mode'. -+ */ - public boolean isInLove() { - return this.inLove > 0; - } -@@ -238,21 +306,23 @@ - this.inLove = 0; - } - -- public boolean canMateWith(EntityAnimal var1) { -- return var1 == this ? false : (var1.getClass() != this.getClass() ? false : this.isInLove() && var1.isInLove()); -+ /** -+ * Returns true if the mob is currently able to mate with the specified mob. -+ */ -+ public boolean canMateWith(EntityAnimal par1EntityAnimal) { -+ return par1EntityAnimal == this ? false : (par1EntityAnimal.getClass() != this.getClass() ? false : this.isInLove() && par1EntityAnimal.isInLove()); - } - -- public void handleHealthUpdate(byte var1) { -- if(var1 == 18) { -- for(int var2 = 0; var2 < 7; ++var2) { -- double var3 = this.ab.nextGaussian() * 0.02D; -- double var5 = this.ab.nextGaussian() * 0.02D; -- double var7 = this.ab.nextGaussian() * 0.02D; -- this.worldObj.spawnParticle("heart", this.posX + (double)(this.ab.nextFloat() * this.width * 2.0F) - (double)this.width, this.posY + 0.5D + (double)(this.ab.nextFloat() * this.height), this.posZ + (double)(this.ab.nextFloat() * this.width * 2.0F) - (double)this.width, var3, var5, var7); -+ public void handleHealthUpdate(byte par1) { -+ if (par1 == 18) { -+ for (int var2 = 0; var2 < 7; ++var2) { -+ double var3 = this.rand.nextGaussian() * 0.02D; -+ double var5 = this.rand.nextGaussian() * 0.02D; -+ double var7 = this.rand.nextGaussian() * 0.02D; -+ this.worldObj.spawnParticle("heart", this.posX + (double)(this.rand.nextFloat() * this.width * 2.0F) - (double)this.width, this.posY + 0.5D + (double)(this.rand.nextFloat() * this.height), this.posZ + (double)(this.rand.nextFloat() * this.width * 2.0F) - (double)this.width, var3, var5, var7); - } - } else { -- super.handleHealthUpdate(var1); -+ super.handleHealthUpdate(par1); - } -- - } - } ---- net/minecraft/src/ServerScoreboard.java -+++ net/minecraft/src/ServerScoreboard.java -@@ -9,128 +9,135 @@ - import net.minecraft.server.MinecraftServer; - - public class ServerScoreboard extends Scoreboard { -- private final MinecraftServer a; -- private final Set b = new HashSet(); -+ private final MinecraftServer field_96555_a; -+ private final Set field_96553_b = new HashSet(); - private ScoreboardSaveData field_96554_c; - -- public ServerScoreboard(MinecraftServer var1) { -- this.a = var1; -+ public ServerScoreboard(MinecraftServer par1MinecraftServer) { -+ this.field_96555_a = par1MinecraftServer; - } - -- public void func_96536_a(Score var1) { -- super.func_96536_a(var1); -- if(this.b.contains(var1.func_96645_d())) { -- this.a.getConfigurationManager().sendPacketToAllPlayers(new Packet207SetScore(var1, 0)); -+ public void func_96536_a(Score par1Score) { -+ super.func_96536_a(par1Score); -+ -+ if (this.field_96553_b.contains(par1Score.func_96645_d())) { -+ this.field_96555_a.getConfigurationManager().sendPacketToAllPlayers(new Packet207SetScore(par1Score, 0)); - } - - this.func_96551_b(); - } - -- public void func_96516_a(String var1) { -- super.func_96516_a(var1); -- this.a.getConfigurationManager().sendPacketToAllPlayers(new Packet207SetScore(var1)); -+ public void func_96516_a(String par1Str) { -+ super.func_96516_a(par1Str); -+ this.field_96555_a.getConfigurationManager().sendPacketToAllPlayers(new Packet207SetScore(par1Str)); - this.func_96551_b(); - } - -- public void func_96530_a(int var1, ScoreObjective var2) { -- ScoreObjective var3 = this.func_96539_a(var1); -- super.func_96530_a(var1, var2); -- if(var3 != var2 && var3 != null) { -- if(this.func_96552_h(var3) > 0) { -- this.a.getConfigurationManager().sendPacketToAllPlayers(new Packet208SetDisplayObjective(var1, var2)); -+ public void func_96530_a(int par1, ScoreObjective par2ScoreObjective) { -+ ScoreObjective var3 = this.func_96539_a(par1); -+ super.func_96530_a(par1, par2ScoreObjective); -+ -+ if (var3 != par2ScoreObjective && var3 != null) { -+ if (this.func_96552_h(var3) > 0) { -+ this.field_96555_a.getConfigurationManager().sendPacketToAllPlayers(new Packet208SetDisplayObjective(par1, par2ScoreObjective)); - } else { - this.func_96546_g(var3); - } - } - -- if(var2 != null) { -- if(this.b.contains(var2)) { -- this.a.getConfigurationManager().sendPacketToAllPlayers(new Packet208SetDisplayObjective(var1, var2)); -+ if (par2ScoreObjective != null) { -+ if (this.field_96553_b.contains(par2ScoreObjective)) { -+ this.field_96555_a.getConfigurationManager().sendPacketToAllPlayers(new Packet208SetDisplayObjective(par1, par2ScoreObjective)); - } else { -- this.func_96549_e(var2); -+ this.func_96549_e(par2ScoreObjective); - } - } - - this.func_96551_b(); - } - -- public void addPlayerToTeam(String var1, ScorePlayerTeam var2) { -- super.addPlayerToTeam(var1, var2); -- this.a.getConfigurationManager().sendPacketToAllPlayers(new Packet209SetPlayerTeam(var2, Arrays.asList(new String[]{var1}), 3)); -- this.func_96551_b(); -- } -- -- public void removePlayerFromTeam(String var1, ScorePlayerTeam var2) { -- super.removePlayerFromTeam(var1, var2); -- this.a.getConfigurationManager().sendPacketToAllPlayers(new Packet209SetPlayerTeam(var2, Arrays.asList(new String[]{var1}), 4)); -- this.func_96551_b(); -- } -- -- public void func_96522_a(ScoreObjective var1) { -- super.func_96522_a(var1); -- this.func_96551_b(); -- } -- -- public void func_96532_b(ScoreObjective var1) { -- super.func_96532_b(var1); -- if(this.b.contains(var1)) { -- this.a.getConfigurationManager().sendPacketToAllPlayers(new Packet206SetObjective(var1, 2)); -- } -- -- this.func_96551_b(); -- } -- -- public void func_96533_c(ScoreObjective var1) { -- super.func_96533_c(var1); -- if(this.b.contains(var1)) { -- this.func_96546_g(var1); -- } -- -- this.func_96551_b(); -- } -- -- public void func_96523_a(ScorePlayerTeam var1) { -- super.func_96523_a(var1); -- this.a.getConfigurationManager().sendPacketToAllPlayers(new Packet209SetPlayerTeam(var1, 0)); -- this.func_96551_b(); -- } -- -- public void func_96538_b(ScorePlayerTeam var1) { -- super.func_96538_b(var1); -- this.a.getConfigurationManager().sendPacketToAllPlayers(new Packet209SetPlayerTeam(var1, 2)); -- this.func_96551_b(); -- } -- -- public void func_96513_c(ScorePlayerTeam var1) { -- super.func_96513_c(var1); -- this.a.getConfigurationManager().sendPacketToAllPlayers(new Packet209SetPlayerTeam(var1, 1)); -- this.func_96551_b(); -- } -- -- public void func_96547_a(ScoreboardSaveData var1) { -- this.field_96554_c = var1; -+ public void func_96521_a(String par1Str, ScorePlayerTeam par2ScorePlayerTeam) { -+ super.func_96521_a(par1Str, par2ScorePlayerTeam); -+ this.field_96555_a.getConfigurationManager().sendPacketToAllPlayers(new Packet209SetPlayerTeam(par2ScorePlayerTeam, Arrays.asList(new String[] {par1Str}), 3)); -+ this.func_96551_b(); -+ } -+ -+ /** -+ * Removes the given username from the given ScorePlayerTeam. If the player is not on the team then an -+ * IllegalStateException is thrown. -+ */ -+ public void removePlayerFromTeam(String par1Str, ScorePlayerTeam par2ScorePlayerTeam) { -+ super.removePlayerFromTeam(par1Str, par2ScorePlayerTeam); -+ this.field_96555_a.getConfigurationManager().sendPacketToAllPlayers(new Packet209SetPlayerTeam(par2ScorePlayerTeam, Arrays.asList(new String[] {par1Str}), 4)); -+ this.func_96551_b(); -+ } -+ -+ public void func_96522_a(ScoreObjective par1ScoreObjective) { -+ super.func_96522_a(par1ScoreObjective); -+ this.func_96551_b(); -+ } -+ -+ public void func_96532_b(ScoreObjective par1ScoreObjective) { -+ super.func_96532_b(par1ScoreObjective); -+ -+ if (this.field_96553_b.contains(par1ScoreObjective)) { -+ this.field_96555_a.getConfigurationManager().sendPacketToAllPlayers(new Packet206SetObjective(par1ScoreObjective, 2)); -+ } -+ -+ this.func_96551_b(); -+ } -+ -+ public void func_96533_c(ScoreObjective par1ScoreObjective) { -+ super.func_96533_c(par1ScoreObjective); -+ -+ if (this.field_96553_b.contains(par1ScoreObjective)) { -+ this.func_96546_g(par1ScoreObjective); -+ } -+ -+ this.func_96551_b(); -+ } -+ -+ public void func_96523_a(ScorePlayerTeam par1ScorePlayerTeam) { -+ super.func_96523_a(par1ScorePlayerTeam); -+ this.field_96555_a.getConfigurationManager().sendPacketToAllPlayers(new Packet209SetPlayerTeam(par1ScorePlayerTeam, 0)); -+ this.func_96551_b(); -+ } -+ -+ public void func_96538_b(ScorePlayerTeam par1ScorePlayerTeam) { -+ super.func_96538_b(par1ScorePlayerTeam); -+ this.field_96555_a.getConfigurationManager().sendPacketToAllPlayers(new Packet209SetPlayerTeam(par1ScorePlayerTeam, 2)); -+ this.func_96551_b(); -+ } -+ -+ public void func_96513_c(ScorePlayerTeam par1ScorePlayerTeam) { -+ super.func_96513_c(par1ScorePlayerTeam); -+ this.field_96555_a.getConfigurationManager().sendPacketToAllPlayers(new Packet209SetPlayerTeam(par1ScorePlayerTeam, 1)); -+ this.func_96551_b(); -+ } -+ -+ public void func_96547_a(ScoreboardSaveData par1ScoreboardSaveData) { -+ this.field_96554_c = par1ScoreboardSaveData; - } - - protected void func_96551_b() { -- if(this.field_96554_c != null) { -+ if (this.field_96554_c != null) { - this.field_96554_c.markDirty(); - } -- - } - -- public List func_96550_d(ScoreObjective var1) { -+ public List func_96550_d(ScoreObjective par1ScoreObjective) { - ArrayList var2 = new ArrayList(); -- var2.add(new Packet206SetObjective(var1, 0)); -+ var2.add(new Packet206SetObjective(par1ScoreObjective, 0)); - -- for(int var3 = 0; var3 < 3; ++var3) { -- if(this.func_96539_a(var3) == var1) { -- var2.add(new Packet208SetDisplayObjective(var3, var1)); -+ for (int var3 = 0; var3 < 3; ++var3) { -+ if (this.func_96539_a(var3) == par1ScoreObjective) { -+ var2.add(new Packet208SetDisplayObjective(var3, par1ScoreObjective)); - } - } - -- Iterator var5 = this.func_96534_i(var1).iterator(); -+ Iterator var5 = this.func_96534_i(par1ScoreObjective).iterator(); - -- while(var5.hasNext()) { -+ while (var5.hasNext()) { - Score var4 = (Score)var5.next(); - var2.add(new Packet207SetScore(var4, 0)); - } -@@ -138,58 +145,58 @@ - return var2; - } - -- public void func_96549_e(ScoreObjective var1) { -- List var2 = this.func_96550_d(var1); -- Iterator var3 = this.a.getConfigurationManager().a.iterator(); -+ public void func_96549_e(ScoreObjective par1ScoreObjective) { -+ List var2 = this.func_96550_d(par1ScoreObjective); -+ Iterator var3 = this.field_96555_a.getConfigurationManager().playerEntityList.iterator(); - -- while(var3.hasNext()) { -+ while (var3.hasNext()) { - EntityPlayerMP var4 = (EntityPlayerMP)var3.next(); - Iterator var5 = var2.iterator(); - -- while(var5.hasNext()) { -+ while (var5.hasNext()) { - Packet var6 = (Packet)var5.next(); -- var4.playerNetServerHandler.sendPacket(var6); -+ var4.playerNetServerHandler.sendPacketToPlayer(var6); - } - } - -- this.b.add(var1); -+ this.field_96553_b.add(par1ScoreObjective); - } - -- public List func_96548_f(ScoreObjective var1) { -+ public List func_96548_f(ScoreObjective par1ScoreObjective) { - ArrayList var2 = new ArrayList(); -- var2.add(new Packet206SetObjective(var1, 1)); -+ var2.add(new Packet206SetObjective(par1ScoreObjective, 1)); - -- for(int var3 = 0; var3 < 3; ++var3) { -- if(this.func_96539_a(var3) == var1) { -- var2.add(new Packet208SetDisplayObjective(var3, var1)); -+ for (int var3 = 0; var3 < 3; ++var3) { -+ if (this.func_96539_a(var3) == par1ScoreObjective) { -+ var2.add(new Packet208SetDisplayObjective(var3, par1ScoreObjective)); - } - } - - return var2; - } - -- public void func_96546_g(ScoreObjective var1) { -- List var2 = this.func_96548_f(var1); -- Iterator var3 = this.a.getConfigurationManager().a.iterator(); -+ public void func_96546_g(ScoreObjective par1ScoreObjective) { -+ List var2 = this.func_96548_f(par1ScoreObjective); -+ Iterator var3 = this.field_96555_a.getConfigurationManager().playerEntityList.iterator(); - -- while(var3.hasNext()) { -+ while (var3.hasNext()) { - EntityPlayerMP var4 = (EntityPlayerMP)var3.next(); - Iterator var5 = var2.iterator(); - -- while(var5.hasNext()) { -+ while (var5.hasNext()) { - Packet var6 = (Packet)var5.next(); -- var4.playerNetServerHandler.sendPacket(var6); -+ var4.playerNetServerHandler.sendPacketToPlayer(var6); - } - } - -- this.b.remove(var1); -+ this.field_96553_b.remove(par1ScoreObjective); - } - -- public int func_96552_h(ScoreObjective var1) { -+ public int func_96552_h(ScoreObjective par1ScoreObjective) { - int var2 = 0; - -- for(int var3 = 0; var3 < 3; ++var3) { -- if(this.func_96539_a(var3) == var1) { -+ for (int var3 = 0; var3 < 3; ++var3) { -+ if (this.func_96539_a(var3) == par1ScoreObjective) { - ++var2; - } - } ---- /dev/null -+++ org/spoutcraft/client/gui/settings/controls/FancyWaterButton.java -@@ -1,0 +1,41 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.client.gui.settings.controls; -+ -+import java.util.UUID; -+ -+import org.spoutcraft.client.config.Configuration; -+ -+public class FancyWaterButton extends AutomatedCheckBox { -+ UUID fancyGraphics; -+ public FancyWaterButton(UUID fancyGraphics) { -+ super("Fancy Water"); -+ this.fancyGraphics = fancyGraphics; -+ setChecked(Configuration.isFancyWater()); -+ setTooltip("Fancy Water\nFast - lower quality, faster\nFancy - higher quality, slower\nFast water (1 pass) has some visual artifacts\nFancy water (2 pass) has no visual artifacts"); -+ } -+ -+ @Override -+ public void onButtonClick() { -+ Configuration.setFancyWater(!Configuration.isFancyWater()); -+ Configuration.write(); -+ ((FancyGraphicsButton)getScreen().getWidget(fancyGraphics)).custom = true; -+ } -+} ---- net/minecraft/src/MapGenStructureIO.java -+++ net/minecraft/src/MapGenStructureIO.java -@@ -4,68 +4,70 @@ - import java.util.Map; - - public class MapGenStructureIO { -- private static Map a = new HashMap(); -- private static Map b = new HashMap(); -- private static Map c = new HashMap(); -- private static Map d = new HashMap(); -- -- private static void func_143034_b(Class var0, String var1) { -- a.put(var1, var0); -- b.put(var0, var1); -- } -- -- static void func_143031_a(Class var0, String var1) { -- c.put(var1, var0); -- d.put(var0, var1); -- } -- -- public static String func_143033_a(StructureStart var0) { -- return (String)b.get(var0.getClass()); -- } -- -- public static String func_143036_a(StructureComponent var0) { -- return (String)d.get(var0.getClass()); -- } -- -- public static StructureStart func_143035_a(NBTTagCompound var0, World var1) { -+ private static Map field_143040_a = new HashMap(); -+ private static Map field_143038_b = new HashMap(); -+ private static Map field_143039_c = new HashMap(); -+ private static Map field_143037_d = new HashMap(); -+ -+ private static void func_143034_b(Class par0Class, String par1Str) { -+ field_143040_a.put(par1Str, par0Class); -+ field_143038_b.put(par0Class, par1Str); -+ } -+ -+ static void func_143031_a(Class par0Class, String par1Str) { -+ field_143039_c.put(par1Str, par0Class); -+ field_143037_d.put(par0Class, par1Str); -+ } -+ -+ public static String func_143033_a(StructureStart par0StructureStart) { -+ return (String)field_143038_b.get(par0StructureStart.getClass()); -+ } -+ -+ public static String func_143036_a(StructureComponent par0StructureComponent) { -+ return (String)field_143037_d.get(par0StructureComponent.getClass()); -+ } -+ -+ public static StructureStart func_143035_a(NBTTagCompound par0NBTTagCompound, World par1World) { - StructureStart var2 = null; - - try { -- Class var3 = (Class)a.get(var0.getString("id")); -- if(var3 != null) { -+ Class var3 = (Class)field_143040_a.get(par0NBTTagCompound.getString("id")); -+ -+ if (var3 != null) { - var2 = (StructureStart)var3.newInstance(); - } - } catch (Exception var4) { -- var1.getWorldLogAgent().logWarning("Failed Start with id " + var0.getString("id")); -+ par1World.getWorldLogAgent().logWarning("Failed Start with id " + par0NBTTagCompound.getString("id")); - var4.printStackTrace(); - } - -- if(var2 != null) { -- var2.func_143020_a(var1, var0); -+ if (var2 != null) { -+ var2.func_143020_a(par1World, par0NBTTagCompound); - } else { -- var1.getWorldLogAgent().logWarning("Skipping Structure with id " + var0.getString("id")); -+ par1World.getWorldLogAgent().logWarning("Skipping Structure with id " + par0NBTTagCompound.getString("id")); - } - - return var2; - } - -- public static StructureComponent func_143032_b(NBTTagCompound var0, World var1) { -+ public static StructureComponent func_143032_b(NBTTagCompound par0NBTTagCompound, World par1World) { - StructureComponent var2 = null; - - try { -- Class var3 = (Class)c.get(var0.getString("id")); -- if(var3 != null) { -+ Class var3 = (Class)field_143039_c.get(par0NBTTagCompound.getString("id")); -+ -+ if (var3 != null) { - var2 = (StructureComponent)var3.newInstance(); - } - } catch (Exception var4) { -- var1.getWorldLogAgent().logWarning("Failed Piece with id " + var0.getString("id")); -+ par1World.getWorldLogAgent().logWarning("Failed Piece with id " + par0NBTTagCompound.getString("id")); - var4.printStackTrace(); - } - -- if(var2 != null) { -- var2.func_143009_a(var1, var0); -+ if (var2 != null) { -+ var2.func_143009_a(par1World, par0NBTTagCompound); - } else { -- var1.getWorldLogAgent().logWarning("Skipping Piece with id " + var0.getString("id")); -+ par1World.getWorldLogAgent().logWarning("Skipping Piece with id " + par0NBTTagCompound.getString("id")); - } - - return var2; ---- net/minecraft/src/WeightedRandomMinecart.java -+++ net/minecraft/src/WeightedRandomMinecart.java -@@ -2,25 +2,29 @@ - - public class WeightedRandomMinecart extends WeightedRandomItem { - public final NBTTagCompound field_98222_b; -- public final String c; -+ public final String minecartName; -+ - final MobSpawnerBaseLogic field_98221_d; - -- public WeightedRandomMinecart(MobSpawnerBaseLogic var1, NBTTagCompound var2) { -- super(var2.getInteger("Weight")); -- this.field_98221_d = var1; -- NBTTagCompound var3 = var2.getCompoundTag("Properties"); -- String var4 = var2.getString("Type"); -- if(var4.equals("Minecart")) { -- if(var3 != null) { -- switch(var3.getInteger("Type")) { -- case 0: -- var4 = "MinecartRideable"; -- break; -- case 1: -- var4 = "MinecartChest"; -- break; -- case 2: -- var4 = "MinecartFurnace"; -+ public WeightedRandomMinecart(MobSpawnerBaseLogic par1MobSpawnerBaseLogic, NBTTagCompound par2NBTTagCompound) { -+ super(par2NBTTagCompound.getInteger("Weight")); -+ this.field_98221_d = par1MobSpawnerBaseLogic; -+ NBTTagCompound var3 = par2NBTTagCompound.getCompoundTag("Properties"); -+ String var4 = par2NBTTagCompound.getString("Type"); -+ -+ if (var4.equals("Minecart")) { -+ if (var3 != null) { -+ switch (var3.getInteger("Type")) { -+ case 0: -+ var4 = "MinecartRideable"; -+ break; -+ -+ case 1: -+ var4 = "MinecartChest"; -+ break; -+ -+ case 2: -+ var4 = "MinecartFurnace"; - } - } else { - var4 = "MinecartRideable"; -@@ -28,37 +32,40 @@ - } - - this.field_98222_b = var3; -- this.c = var4; -+ this.minecartName = var4; - } - -- public WeightedRandomMinecart(MobSpawnerBaseLogic var1, NBTTagCompound var2, String var3) { -+ public WeightedRandomMinecart(MobSpawnerBaseLogic par1MobSpawnerBaseLogic, NBTTagCompound par2NBTTagCompound, String par3Str) { - super(1); -- this.field_98221_d = var1; -- if(var3.equals("Minecart")) { -- if(var2 != null) { -- switch(var2.getInteger("Type")) { -- case 0: -- var3 = "MinecartRideable"; -- break; -- case 1: -- var3 = "MinecartChest"; -- break; -- case 2: -- var3 = "MinecartFurnace"; -+ this.field_98221_d = par1MobSpawnerBaseLogic; -+ -+ if (par3Str.equals("Minecart")) { -+ if (par2NBTTagCompound != null) { -+ switch (par2NBTTagCompound.getInteger("Type")) { -+ case 0: -+ par3Str = "MinecartRideable"; -+ break; -+ -+ case 1: -+ par3Str = "MinecartChest"; -+ break; -+ -+ case 2: -+ par3Str = "MinecartFurnace"; - } - } else { -- var3 = "MinecartRideable"; -+ par3Str = "MinecartRideable"; - } - } - -- this.field_98222_b = var2; -- this.c = var3; -+ this.field_98222_b = par2NBTTagCompound; -+ this.minecartName = par3Str; - } - - public NBTTagCompound func_98220_a() { - NBTTagCompound var1 = new NBTTagCompound(); - var1.setCompoundTag("Properties", this.field_98222_b); -- var1.setString("Type", this.c); -+ var1.setString("Type", this.minecartName); - var1.setInteger("Weight", this.itemWeight); - return var1; - } ---- net/minecraft/src/GuiIngame.java -+++ net/minecraft/src/GuiIngame.java -@@ -5,349 +5,456 @@ - import java.util.Iterator; - import java.util.List; - import java.util.Random; -+ - import org.lwjgl.opengl.GL11; - import org.lwjgl.opengl.GL12; -+import org.spoutcraft.api.Spoutcraft; -+import org.spoutcraft.api.gui.InGameHUD; -+import org.spoutcraft.api.material.MaterialData; -+import org.spoutcraft.client.SpoutClient; -+import org.spoutcraft.client.config.Configuration; -+import org.spoutcraft.client.gui.minimap.ZanMinimap; -+import org.spoutcraft.client.inventory.CraftItemStack; - - public class GuiIngame extends Gui { - private static final ResourceLocation vignetteTexPath = new ResourceLocation("textures/misc/vignette.png"); - private static final ResourceLocation widgetsTexPath = new ResourceLocation("textures/gui/widgets.png"); - private static final ResourceLocation pumpkinBlurTexPath = new ResourceLocation("textures/misc/pumpkinblur.png"); - private static final RenderItem itemRenderer = new RenderItem(); -- private final Random f = new Random(); -+ // Spout Start - private to public static final -+ public static final Random rand = new Random(); -+ // Spout End - private final Minecraft mc; -+ -+ /** ChatGUI instance that retains all previous chat data */ - private final GuiNewChat persistantChatGUI; - private int updateCounter; -- private String j = ""; -+ -+ /** The string specifying which record music is playing */ -+ private String recordPlaying = ""; -+ -+ /** How many ticks the record playing message will be displayed */ - private int recordPlayingUpFor; - private boolean recordIsPlaying; -+ -+ /** Previous frame vignette brightness (slowly changes by 1% each frame) */ - public float prevVignetteBrightness = 1.0F; -+ -+ /** Remaining ticks the item highlight should be visible */ - private int remainingHighlightTicks; -+ -+ /** The ItemStack that is currently being highlighted */ - private ItemStack highlightingItemStack; - -- public GuiIngame(Minecraft var1) { -- this.mc = var1; -- this.persistantChatGUI = new GuiNewChat(var1); -- } -- -- public void renderGameOverlay(float var1, boolean var2, int var3, int var4) { -- ScaledResolution var5 = new ScaledResolution(this.mc.gameSettings, this.mc.displayWidth, this.mc.displayHeight); -- int var6 = var5.getScaledWidth(); -- int var7 = var5.getScaledHeight(); -- FontRenderer var8 = this.mc.fontRenderer; -+ public GuiIngame(Minecraft par1Minecraft) { -+ this.mc = par1Minecraft; -+ this.persistantChatGUI = new GuiNewChat(par1Minecraft); -+ } -+ -+ // Spout Start -+ private final ZanMinimap map = new ZanMinimap(); -+ private static boolean needsUpdate = true; -+ -+ public static void dirtySurvival() { -+ needsUpdate = true; -+ } -+ // Spout End -+ -+ /** -+ * Render the ingame overlay with quick icon bar, ... -+ */ -+ // Spout Start - Most of function rewritten -+ // TODO: Rewrite again, it's in a horrible state, I'm surprised it works... -+ public void renderGameOverlay(float f, boolean flag, int i, int j) { -+ InGameHUD mainScreen = SpoutClient.getInstance().getActivePlayer().getMainScreen(); -+ -+ ScaledResolution scaledRes = new ScaledResolution(this.mc.gameSettings, this.mc.displayWidth, this.mc.displayHeight); -+ int screenWidth = scaledRes.getScaledWidth(); -+ int screenHeight = scaledRes.getScaledHeight(); -+ FontRenderer font = this.mc.fontRenderer; - this.mc.entityRenderer.setupOverlayRendering(); - GL11.glEnable(GL11.GL_BLEND); -- if(Minecraft.isFancyGraphicsEnabled()) { -- this.renderVignette(this.mc.thePlayer.getBrightness(var1), var6, var7); -+ -+ if (Minecraft.isFancyGraphicsEnabled()) { -+ this.renderVignette(this.mc.thePlayer.getBrightness(f), screenWidth, screenHeight); - } else { - GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); - } - -- ItemStack var9 = this.mc.thePlayer.inventory.armorItemInSlot(3); -- if(this.mc.gameSettings.thirdPersonView == 0 && var9 != null && var9.itemID == Block.pumpkin.blockID) { -- this.renderPumpkinBlur(var6, var7); -- } -- -- if(!this.mc.thePlayer.isPotionActive(Potion.confusion)) { -- float var10 = this.mc.thePlayer.prevTimeInPortal + (this.mc.thePlayer.timeInPortal - this.mc.thePlayer.prevTimeInPortal) * var1; -- if(var10 > 0.0F) { -- this.func_130015_b(var10, var6, var7); -- } -- } -- -- int var11; -+ ItemStack helmet = this.mc.thePlayer.inventory.armorItemInSlot(3); -+ -+ if (this.mc.gameSettings.thirdPersonView == 0 && helmet != null && helmet.itemID == Block.pumpkin.blockID) { -+ this.renderPumpkinBlur(screenWidth, screenHeight); -+ } -+ -+ if (!this.mc.thePlayer.isPotionActive(Potion.confusion)) { -+ float var10 = this.mc.thePlayer.prevTimeInPortal + (this.mc.thePlayer.timeInPortal - this.mc.thePlayer.prevTimeInPortal) * f; -+ -+ if (var10 > 0.0F) { -+ this.func_130015_b(var10, screenWidth, screenHeight); //renderPortalOverlay -+ } -+ } -+ GL11.glBlendFunc(770, 771); -+ GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); -+ this.mc.getTextureManager().bindTexture(widgetsTexPath); -+ InventoryPlayer var11 = this.mc.thePlayer.inventory; -+ this.zLevel = -90.0F; -+ this.drawTexturedModalRect(screenWidth / 2 - 91, screenHeight - 22, 0, 0, 182, 22); -+ this.drawTexturedModalRect(screenWidth / 2 - 91 - 1 + var11.currentItem * 20, screenHeight - 22 - 1, 0, 22, 24, 22); -+ this.mc.getTextureManager().bindTexture(icons); -+ GL11.glEnable(3042 /* GL_BLEND */); -+ GL11.glBlendFunc(775, 769); -+ this.drawTexturedModalRect(screenWidth / 2 - 7, screenHeight / 2 - 7, 0, 0, 16, 16); -+ GL11.glDisable(3042 /* GL_BLEND */); -+ -+ GuiIngame.rand.setSeed((long) (this.updateCounter * 312871)); -+ int var15; -+ int var17; -+ -+ this.renderBossHealth(); -+ // Toggle visibility if needed -+ if (needsUpdate && mainScreen.getHealthBar().isVisible() == mc.playerController.isInCreativeMode()) { -+ mainScreen.toggleSurvivalHUD(!mc.playerController.isInCreativeMode()); -+ } -+ needsUpdate = false; -+ -+ // Hunger Bar Begin -+ mainScreen.getHungerBar().render(); -+ // Hunger Bar End -+ -+ // Armor Bar Begin -+ mainScreen.getArmorBar().render(); -+ // Armor Bar End -+ -+ // Health Bar Begin -+ mainScreen.getHealthBar().render(); -+ // Health Bar End -+ -+ // Bubble Bar Begin -+ mainScreen.getBubbleBar().render(); -+ // Bubble Bar End -+ -+ // Exp Bar Begin -+ mainScreen.getExpBar().render(); -+ // Exp Bar End -+ -+ map.onRenderTick(); -+ -+ GL11.glDisable(GL11.GL_BLEND); -+ this.mc.mcProfiler.startSection("actionBar"); -+ GL11.glEnable(GL12.GL_RESCALE_NORMAL); -+ RenderHelper.enableGUIStandardItemLighting(); -+ -+ for (var15 = 0; var15 < 9; ++var15) { -+ int x = screenWidth / 2 - 90 + var15 * 20 + 2; -+ var17 = screenHeight - 16 - 3; -+ this.renderInventorySlot(var15, x, var17, f); -+ } -+ -+ RenderHelper.disableStandardItemLighting(); -+ GL11.glDisable(GL12.GL_RESCALE_NORMAL); -+ this.mc.mcProfiler.endSection(); -+ -+ if (this.mc.thePlayer.getSleepTimer() > 0) { -+ GL11.glDisable(2929 /*GL_DEPTH_TEST*/); -+ GL11.glDisable(3008 /*GL_ALPHA_TEST*/); -+ var15 = this.mc.thePlayer.getSleepTimer(); -+ float var26 = (float)var15 / 100.0F; -+ if (var26 > 1.0F) { -+ var26 = 1.0F - (float)(var15 - 100) / 10.0F; -+ } -+ -+ var17 = (int)(220.0F * var26) << 24 | 1052704; -+ this.drawRect(0, 0, screenWidth, screenHeight, var17); -+ GL11.glEnable(3008 /*GL_ALPHA_TEST*/); -+ GL11.glEnable(2929 /*GL_DEPTH_TEST*/); -+ } -+ -+ mainScreen.render(); -+ -+ int var111; -+ var111 = screenWidth / 2 - 91; - int var12; - int var13; -- if(!this.mc.playerController.enableEverythingIsScrewedUpMode()) { -- GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); -- this.mc.getTextureManager().bindTexture(widgetsTexPath); -- InventoryPlayer var31 = this.mc.thePlayer.inventory; -- this.zLevel = -90.0F; -- this.drawTexturedModalRect(var6 / 2 - 91, var7 - 22, 0, 0, 182, 22); -- this.drawTexturedModalRect(var6 / 2 - 91 - 1 + var31.currentItem * 20, var7 - 22 - 1, 0, 22, 24, 22); -- this.mc.getTextureManager().bindTexture(icons); -- GL11.glEnable(GL11.GL_BLEND); -- GL11.glBlendFunc(GL11.GL_ONE_MINUS_DST_COLOR, GL11.GL_ONE_MINUS_SRC_COLOR); -- this.drawTexturedModalRect(var6 / 2 - 7, var7 / 2 - 7, 0, 0, 16, 16); -- GL11.glDisable(GL11.GL_BLEND); -- this.mc.mcProfiler.startSection("bossHealth"); -- this.renderBossHealth(); -- this.mc.mcProfiler.endSection(); -- if(this.mc.playerController.shouldDrawHUD()) { -- this.func_110327_a(var6, var7); -- } -- -- GL11.glDisable(GL11.GL_BLEND); -- this.mc.mcProfiler.startSection("actionBar"); -- GL11.glEnable(GL12.GL_RESCALE_NORMAL); -- RenderHelper.enableGUIStandardItemLighting(); -- -- for(var11 = 0; var11 < 9; ++var11) { -- var12 = var6 / 2 - 90 + var11 * 20 + 2; -- var13 = var7 - 16 - 3; -- this.renderInventorySlot(var11, var12, var13, var1); -- } -- -- RenderHelper.disableStandardItemLighting(); -- GL11.glDisable(GL12.GL_RESCALE_NORMAL); -- this.mc.mcProfiler.endSection(); -- } -- -- int var32; -- if(this.mc.thePlayer.getSleepTimer() > 0) { -- this.mc.mcProfiler.startSection("sleep"); -- GL11.glDisable(GL11.GL_DEPTH_TEST); -- GL11.glDisable(GL11.GL_ALPHA_TEST); -- var32 = this.mc.thePlayer.getSleepTimer(); -- float var33 = (float)var32 / 100.0F; -- if(var33 > 1.0F) { -- var33 = 1.0F - (float)(var32 - 100) / 10.0F; -- } -- -- var12 = (int)(220.0F * var33) << 24 | 1052704; -- drawRect(0, 0, var6, var7, var12); -- GL11.glEnable(GL11.GL_ALPHA_TEST); -- GL11.glEnable(GL11.GL_DEPTH_TEST); -- this.mc.mcProfiler.endSection(); -- } -- -- var32 = 16777215; -- GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); -- var11 = var6 / 2 - 91; - int var14; -- int var15; -+ int var115; -+ int var117; - int var16; -- int var17; -- float var34; -- short var35; -- if(this.mc.thePlayer.isRidingHorse()) { -+ float var33; -+ float var313; -+ short var317; -+ -+ //ToDo: this will need TLC -+ if (this.mc.thePlayer.isRidingHorse()) { - this.mc.mcProfiler.startSection("jumpBar"); - this.mc.getTextureManager().bindTexture(Gui.icons); -- var34 = this.mc.thePlayer.getHorseJumpPower(); -- var35 = 182; -- var14 = (int)(var34 * (float)(var35 + 1)); -- var15 = var7 - 32 + 3; -- this.drawTexturedModalRect(var11, var15, 0, 84, var35, 5); -- if(var14 > 0) { -- this.drawTexturedModalRect(var11, var15, 0, 89, var14, 5); -+ var313 = this.mc.thePlayer.getHorseJumpPower(); -+ var317 = 182; -+ var14 = (int)(var313 * (float)(var317 + 1)); -+ var115 = screenHeight - 32 + 3; -+ this.drawTexturedModalRect(var111, var115, 0, 84, var317, 5); -+ -+ if (var14 > 0) { -+ this.drawTexturedModalRect(var111, var115, 0, 89, var14, 5); - } - - this.mc.mcProfiler.endSection(); -- } else if(this.mc.playerController.func_78763_f()) { -+ } else if (this.mc.playerController.func_78763_f()) { -+ -+ // Spout -> Removed, we have our own. -+ /* - this.mc.mcProfiler.startSection("expBar"); - this.mc.getTextureManager().bindTexture(Gui.icons); - var12 = this.mc.thePlayer.xpBarCap(); -- if(var12 > 0) { -- var35 = 182; -- var14 = (int)(this.mc.thePlayer.experience * (float)(var35 + 1)); -- var15 = var7 - 32 + 3; -- this.drawTexturedModalRect(var11, var15, 0, 64, var35, 5); -- if(var14 > 0) { -- this.drawTexturedModalRect(var11, var15, 0, 69, var14, 5); -+ -+ if (var12 > 0) { -+ var317 = 182; -+ var14 = (int)(this.mc.thePlayer.experience * (float)(var317 + 1)); -+ var115 = screenHeight - 32 + 3; -+ this.drawTexturedModalRect(var111, var115, 0, 64, var317, 5); -+ -+ if (var14 > 0) { -+ this.drawTexturedModalRect(var111, var115, 0, 69, var14, 5); - } - } -+ - - this.mc.mcProfiler.endSection(); -- if(this.mc.thePlayer.experienceLevel > 0) { -+ -+ // Spout Start -> We have our own -+ -+ if (this.mc.thePlayer.experienceLevel > 0) { - this.mc.mcProfiler.startSection("expLevel"); -- boolean var37 = false; -- var14 = var37 ? 16777215 : 8453920; -- String var39 = "" + this.mc.thePlayer.experienceLevel; -- var16 = (var6 - var8.getStringWidth(var39)) / 2; -- var17 = var7 - 31 - 4; -+ boolean var35 = false; -+ var14 = var35 ? 16777215 : 8453920; -+ String var42 = "" + this.mc.thePlayer.experienceLevel; -+ var16 = (screenWidth- font.getStringWidth(var42)) / 2; -+ var117 = screenHeight - 31 - 4; - boolean var18 = false; -- var8.drawString(var39, var16 + 1, var17, 0); -- var8.drawString(var39, var16 - 1, var17, 0); -- var8.drawString(var39, var16, var17 + 1, 0); -- var8.drawString(var39, var16, var17 - 1, 0); -- var8.drawString(var39, var16, var17, var14); -+ font.drawString(var42, var16 + 1, var117, 0); -+ font.drawString(var42, var16 - 1, var117, 0); -+ font.drawString(var42, var16, var117 + 1, 0); -+ font.drawString(var42, var16, var117 - 1, 0); -+ font.drawString(var42, var16, var117, var14); - this.mc.mcProfiler.endSection(); - } -- } -- -- String var36; -- if(this.mc.gameSettings.heldItemTooltips) { -- this.mc.mcProfiler.startSection("toolHighlight"); -- if(this.remainingHighlightTicks > 0 && this.highlightingItemStack != null) { -- var36 = this.highlightingItemStack.getDisplayName(); -- var13 = (var6 - var8.getStringWidth(var36)) / 2; -- var14 = var7 - 59; -- if(!this.mc.playerController.shouldDrawHUD()) { -- var14 += 14; -- } -- -- var15 = (int)((float)this.remainingHighlightTicks * 256.0F / 10.0F); -- if(var15 > 255) { -- var15 = 255; -- } -- -- if(var15 > 0) { -- GL11.glPushMatrix(); -- GL11.glEnable(GL11.GL_BLEND); -- GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); -- var8.drawStringWithShadow(var36, var13, var14, 16777215 + (var15 << 24)); -- GL11.glDisable(GL11.GL_BLEND); -- GL11.glPopMatrix(); -- } -- } -- -- this.mc.mcProfiler.endSection(); -- } -- -- if(this.mc.isDemo()) { -- this.mc.mcProfiler.startSection("demo"); -- var36 = ""; -- if(this.mc.theWorld.getTotalWorldTime() >= 120500L) { -- var36 = I18n.getString("demo.demoExpired"); -- } else { -- var36 = I18n.getStringParams("demo.remainingTime", new Object[]{StringUtils.ticksToElapsedTime((int)(120500L - this.mc.theWorld.getTotalWorldTime()))}); -- } -- -- var13 = var8.getStringWidth(var36); -- var8.drawStringWithShadow(var36, var6 - var13 - 10, 5, 16777215); -- this.mc.mcProfiler.endSection(); -- } -- -- int var21; -- int var22; -- int var23; -- if(this.mc.gameSettings.showDebugInfo) { -+ */ -+ } -+ -+ if (this.mc.gameSettings.showDebugInfo) { - this.mc.mcProfiler.startSection("debug"); - GL11.glPushMatrix(); -- var8.drawStringWithShadow("Minecraft 1.6.4 (" + this.mc.E + ")", 2, 2, 16777215); -- var8.drawStringWithShadow(this.mc.debugInfoRenders(), 2, 12, 16777215); -- var8.drawStringWithShadow(this.mc.getEntityDebug(), 2, 22, 16777215); -- var8.drawStringWithShadow(this.mc.debugInfoEntities(), 2, 32, 16777215); -- var8.drawStringWithShadow(this.mc.getWorldProviderName(), 2, 42, 16777215); -- long var38 = Runtime.getRuntime().maxMemory(); -- long var41 = Runtime.getRuntime().totalMemory(); -- long var43 = Runtime.getRuntime().freeMemory(); -- long var45 = var41 - var43; -- String var20 = "Used memory: " + var45 * 100L / var38 + "% (" + var45 / 1024L / 1024L + "MB) of " + var38 / 1024L / 1024L + "MB"; -- var21 = 14737632; -- this.drawString(var8, var20, var6 - var8.getStringWidth(var20) - 2, 2, 14737632); -- var20 = "Allocated memory: " + var41 * 100L / var38 + "% (" + var41 / 1024L / 1024L + "MB)"; -- this.drawString(var8, var20, var6 - var8.getStringWidth(var20) - 2, 12, 14737632); -- var22 = MathHelper.floor_double(this.mc.thePlayer.posX); -- var23 = MathHelper.floor_double(this.mc.thePlayer.posY); -- int var24 = MathHelper.floor_double(this.mc.thePlayer.posZ); -- this.drawString(var8, String.format("x: %.5f (%d) // c: %d (%d)", new Object[]{Double.valueOf(this.mc.thePlayer.posX), Integer.valueOf(var22), Integer.valueOf(var22 >> 4), Integer.valueOf(var22 & 15)}), 2, 64, 14737632); -- this.drawString(var8, String.format("y: %.3f (feet pos, %.3f eyes pos)", new Object[]{Double.valueOf(this.mc.thePlayer.boundingBox.minY), Double.valueOf(this.mc.thePlayer.posY)}), 2, 72, 14737632); -- this.drawString(var8, String.format("z: %.5f (%d) // c: %d (%d)", new Object[]{Double.valueOf(this.mc.thePlayer.posZ), Integer.valueOf(var24), Integer.valueOf(var24 >> 4), Integer.valueOf(var24 & 15)}), 2, 80, 14737632); -- int var25 = MathHelper.floor_double((double)(this.mc.thePlayer.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3; -- this.drawString(var8, "f: " + var25 + " (" + Direction.c[var25] + ") / " + MathHelper.wrapAngleTo180_float(this.mc.thePlayer.rotationYaw), 2, 88, 14737632); -- if(this.mc.theWorld != null && this.mc.theWorld.blockExists(var22, var23, var24)) { -- Chunk var26 = this.mc.theWorld.getChunkFromBlockCoords(var22, var24); -- this.drawString(var8, "lc: " + (var26.getTopFilledSegment() + 15) + " b: " + var26.getBiomeGenForWorldCoords(var22 & 15, var24 & 15, this.mc.theWorld.getWorldChunkManager()).y + " bl: " + var26.getSavedLightValue(EnumSkyBlock.Block, var22 & 15, var23, var24 & 15) + " sl: " + var26.getSavedLightValue(EnumSkyBlock.Sky, var22 & 15, var23, var24 & 15) + " rl: " + var26.getBlockLightValue(var22 & 15, var23, var24 & 15, 0), 2, 96, 14737632); -+ if (Configuration.getFastDebug() != 2) { -+ font.drawStringWithShadow("Spoutcraft 1.6.4 (" + this.mc.debug + ")", 2, 2, 16777215); -+ font.drawStringWithShadow(this.mc.debugInfoRenders(), 2, 12, 16777215); -+ font.drawStringWithShadow(this.mc.getEntityDebug(), 2, 22, 16777215); -+ font.drawStringWithShadow(this.mc.debugInfoEntities(), 2, 32, 16777215); -+ font.drawStringWithShadow(this.mc.getWorldProviderName(), 2, 42, 16777215); -+ long var41 = Runtime.getRuntime().maxMemory(); -+ long var34 = Runtime.getRuntime().totalMemory(); -+ long var42 = Runtime.getRuntime().freeMemory(); -+ long var43 = var34 - var42; -+ String var45 = "Used memory: " + var43 * 100L / var41 + "% (" + var43 / 1024L / 1024L + "MB) of " + var41 / 1024L / 1024L + "MB"; -+ this.drawString(font, var45, screenWidth - font.getStringWidth(var45) - 2, 2, 14737632); -+ var45 = "Allocated memory: " + var34 * 100L / var41 + "% (" + var34 / 1024L / 1024L + "MB)"; -+ this.drawString(font, var45, screenWidth - font.getStringWidth(var45) - 2, 12, 14737632); -+ int var47 = MathHelper.floor_double(this.mc.thePlayer.posX); -+ int var22 = MathHelper.floor_double(this.mc.thePlayer.posY); -+ int var23 = MathHelper.floor_double(this.mc.thePlayer.posZ); -+ if(SpoutClient.getInstance().isCoordsCheat()) { -+ this.drawString(font, String.format("x: %.5f (%d) // c: %d (%d)", new Object[] {Double.valueOf(this.mc.thePlayer.posX), Integer.valueOf(var47), Integer.valueOf(var47 >> 4), Integer.valueOf(var47 & 15)}), 2, 64, 14737632); -+ this.drawString(font, String.format("y: %.3f (feet pos, %.3f eyes pos)", new Object[] {Double.valueOf(this.mc.thePlayer.boundingBox.minY), Double.valueOf(this.mc.thePlayer.posY)}), 2, 72, 14737632); -+ this.drawString(font, String.format("z: %.5f (%d) // c: %d (%d)", new Object[] {Double.valueOf(this.mc.thePlayer.posZ), Integer.valueOf(var23), Integer.valueOf(var23 >> 4), Integer.valueOf(var23 & 15)}), 2, 80, 14737632); -+ int var24 = MathHelper.floor_double((double)(this.mc.thePlayer.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3; -+ this.drawString(font, "f: " + var24 + " (" + Direction.directions[var24] + ") / " + MathHelper.wrapAngleTo180_float(this.mc.thePlayer.rotationYaw), 2, 88, 14737632); -+ } -+ -+ if (this.mc.theWorld != null && this.mc.theWorld.blockExists(var47, var22, var23)) { -+ Chunk var48 = this.mc.theWorld.getChunkFromBlockCoords(var47, var23); -+ this.drawString(font, "lc: " + (var48.getTopFilledSegment() + 15) + " b: " + var48.getBiomeGenForWorldCoords(var47 & 15, var23 & 15, this.mc.theWorld.getWorldChunkManager()).biomeName + " bl: " + var48.getSavedLightValue(EnumSkyBlock.Block, var47 & 15, var22, var23 & 15) + " sl: " + var48.getSavedLightValue(EnumSkyBlock.Sky, var47 & 15, var22, var23 & 15) + " rl: " + var48.getBlockLightValue(var47 & 15, var22, var23 & 15, 0), 2, 96, 14737632); -+ } -+ -+ this.drawString(font, String.format("ws: %.3f, fs: %.3f, g: %b, fl: %d", new Object[] {Float.valueOf(this.mc.thePlayer.capabilities.getWalkSpeed()), Float.valueOf(this.mc.thePlayer.capabilities.getFlySpeed()), Boolean.valueOf(this.mc.thePlayer.onGround), Integer.valueOf(this.mc.theWorld.getHeightValue(var47, var23))}), 2, 104, 14737632); -+ -+ } else { -+ font.drawStringWithShadow(Integer.toString(Minecraft.framesPerSecond), 4, 2, 0xFFE303); - } -- -- this.drawString(var8, String.format("ws: %.3f, fs: %.3f, g: %b, fl: %d", new Object[]{Float.valueOf(this.mc.thePlayer.capabilities.getWalkSpeed()), Float.valueOf(this.mc.thePlayer.capabilities.getFlySpeed()), Boolean.valueOf(this.mc.thePlayer.onGround), Integer.valueOf(this.mc.theWorld.getHeightValue(var22, var24))}), 2, 104, 14737632); -+ this.mc.mcProfiler.endSection(); - GL11.glPopMatrix(); -- this.mc.mcProfiler.endSection(); -- } -- -- if(this.recordPlayingUpFor > 0) { -- this.mc.mcProfiler.startSection("overlayMessage"); -- var34 = (float)this.recordPlayingUpFor - var1; -- var13 = (int)(var34 * 255.0F / 20.0F); -- if(var13 > 255) { -- var13 = 255; -- } -- -- if(var13 > 8) { -- GL11.glPushMatrix(); -- GL11.glTranslatef((float)(var6 / 2), (float)(var7 - 68), 0.0F); -- GL11.glEnable(GL11.GL_BLEND); -- GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); -- var14 = 16777215; -- if(this.recordIsPlaying) { -- var14 = Color.HSBtoRGB(var34 / 50.0F, 0.7F, 0.6F) & 16777215; -- } -- -- var8.drawString(this.j, -var8.getStringWidth(this.j) / 2, -4, var14 + (var13 << 24 & -16777216)); -- GL11.glDisable(GL11.GL_BLEND); -- GL11.glPopMatrix(); -- } -- -- this.mc.mcProfiler.endSection(); -- } -- -- ScoreObjective var40 = this.mc.theWorld.getScoreboard().func_96539_a(1); -- if(var40 != null) { -- this.func_96136_a(var40, var7, var6, var8); -- } -- -+ -+ if (this.recordPlayingUpFor > 0) { -+ this.mc.mcProfiler.startSection("overlayMessage"); -+ var33 = (float)this.recordPlayingUpFor - f; -+ var12 = (int)(var33 * 256.0F / 20.0F); -+ -+ if (var12 > 255) { -+ var12 = 255; -+ } -+ -+ if (var12 > 0) { -+ GL11.glPushMatrix(); -+ GL11.glTranslatef((float)(screenWidth / 2), (float)(screenHeight - 48), 0.0F); -+ GL11.glEnable(GL11.GL_BLEND); -+ GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); -+ var13 = 16777215; -+ -+ if (this.recordIsPlaying) { -+ var13 = Color.HSBtoRGB(var33 / 50.0F, 0.7F, 0.6F) & 16777215; -+ } -+ -+ font.drawString(this.recordPlaying, -font.getStringWidth(this.recordPlaying) / 2, -4, var13 + (var12 << 24)); -+ GL11.glDisable(GL11.GL_BLEND); -+ GL11.glPopMatrix(); -+ } -+ -+ this.mc.mcProfiler.endSection(); -+ } -+ } - GL11.glEnable(GL11.GL_BLEND); - GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); - GL11.glDisable(GL11.GL_ALPHA_TEST); - GL11.glPushMatrix(); -- GL11.glTranslatef(0.0F, (float)(var7 - 48), 0.0F); -+ -+ int var38; -+ // Spout Start -+ float pHealth; -+ float ppHealth; -+ -+ // Hotbar Text -+ if (Configuration.showHotbarText) { -+ String var35; -+ String custom = null; -+ pHealth = this.mc.thePlayer.getHealth(); -+ ppHealth = this.mc.thePlayer.prevHealth; -+ String var34 = "" + this.mc.thePlayer.experienceLevel; -+ var38 = (screenWidth - font.getStringWidth(var34)) / 2; -+ this.mc.mcProfiler.startSection("toolHighlight"); -+ -+ if (this.remainingHighlightTicks > 0 && this.highlightingItemStack != null) { -+ if (this.highlightingItemStack.itemID == MaterialData.flint.getRawId()) { -+ custom = Spoutcraft.getMaterialManager().getToolTip(new CraftItemStack(this.highlightingItemStack)); -+ } -+ if (custom != null) { -+ String[] split = custom.split("\n"); -+ String newCustom = split[0]; -+ var35 = newCustom; -+ } else { -+ var35 = this.highlightingItemStack.getDisplayName(); -+ } -+ var12 = (screenWidth - font.getStringWidth(var35)) / 2; -+ var13 = screenHeight - 59; -+ -+ if (!mainScreen.getHungerBar().isVisible() || !mainScreen.getHealthBar().isVisible()) { -+ var13 += 8; -+ } -+ if (!mainScreen.getArmorBar().isVisible()) { -+ var13 += 8; -+ } -+ -+ if (!mainScreen.getExpBar().isVisible()) { -+ var13 += 6; -+ } -+ -+ var38 = (int)((float)this.remainingHighlightTicks * 256.0F / 10.0F); -+ -+ if (var38 > 255) { -+ var38 = 255; -+ } -+ -+ if (var38 > 0) { -+ GL11.glPushMatrix(); -+ GL11.glEnable(GL11.GL_BLEND); -+ GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); -+ font.drawStringWithShadow(var35, var12, var13, 16777215 + (var38 << 24)); -+ GL11.glDisable(GL11.GL_BLEND); -+ GL11.glPopMatrix(); -+ } -+ } -+ -+ this.mc.mcProfiler.endSection(); -+ } -+ -+ ScoreObjective var42 = this.mc.theWorld.getScoreboard().func_96539_a(1); -+ -+ if (var42 != null) { -+ this.func_96136_a(var42, screenHeight, screenWidth, font); -+ } -+ -+ GL11.glTranslatef(0.0F, (float)(screenHeight - 48), 0.0F); - this.mc.mcProfiler.startSection("chat"); - this.persistantChatGUI.drawChat(this.updateCounter); - this.mc.mcProfiler.endSection(); - GL11.glPopMatrix(); -- var40 = this.mc.theWorld.getScoreboard().func_96539_a(0); -- if(this.mc.gameSettings.keyBindPlayerList.pressed && (!this.mc.isIntegratedServerRunning() || this.mc.thePlayer.sendQueue.c.size() > 1 || var40 != null)) { -+ var42 = this.mc.theWorld.getScoreboard().func_96539_a(0); -+ -+ if (this.mc.gameSettings.keyBindPlayerList.pressed && (!this.mc.isIntegratedServerRunning() || this.mc.thePlayer.sendQueue.playerInfoList.size() > 1)) { - this.mc.mcProfiler.startSection("playerList"); -- NetClientHandler var42 = this.mc.thePlayer.sendQueue; -- List var44 = var42.c; -- var15 = var42.currentServerMaxPlayers; -- var16 = var15; -- -- for(var17 = 1; var16 > 20; var16 = (var15 + var17 - 1) / var17) { -- ++var17; -- } -- -- int var46 = 300 / var17; -- if(var46 > 150) { -- var46 = 150; -- } -- -- int var19 = (var6 - var17 * var46) / 2; -- byte var47 = 10; -- drawRect(var19 - 1, var47 - 1, var19 + var46 * var17, var47 + 9 * var16, Integer.MIN_VALUE); -- -- for(var21 = 0; var21 < var15; ++var21) { -- var22 = var19 + var21 % var17 * var46; -- var23 = var47 + var21 / var17 * 9; -- drawRect(var22, var23, var22 + var46 - 1, var23 + 8, 553648127); -+ NetClientHandler var37 = this.mc.thePlayer.sendQueue; -+ List var39 = var37.playerInfoList; -+ var13 = var37.currentServerMaxPlayers; -+ int var40 = var13; -+ -+ for (var38 = 1; var40 > 20; var40 = (var13 + var38 - 1) / var38) { -+ ++var38; -+ } -+ -+ var16 = 300 / var38; -+ -+ if (var16 > 150) { -+ var16 = 150; -+ } -+ -+ var117 = (screenWidth - var38 * var16) / 2; -+ byte var44 = 10; -+ drawRect(var117 - 1, var44 - 1, var117 + var16 * var38, var44 + 9 * var40, Integer.MIN_VALUE); -+ -+ for (int var19 = 0; var19 < var13; ++var19) { -+ int var20 = var117 + var19 % var38 * var16; -+ int var47 = var44 + var19 / var38 * 9; -+ drawRect(var20, var47, var20 + var16 - 1, var47 + 8, 553648127); - GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - GL11.glEnable(GL11.GL_ALPHA_TEST); -- if(var21 < var44.size()) { -- GuiPlayerInfo var48 = (GuiPlayerInfo)var44.get(var21); -- ScorePlayerTeam var49 = this.mc.theWorld.getScoreboard().getPlayersTeam(var48.a); -- String var50 = ScorePlayerTeam.formatPlayerName(var49, var48.a); -- var8.drawStringWithShadow(var50, var22, var23, 16777215); -- if(var40 != null) { -- int var27 = var22 + var8.getStringWidth(var50) + 5; -- int var28 = var22 + var46 - 12 - 5; -- if(var28 - var27 > 5) { -- Score var29 = var40.getScoreboard().func_96529_a(var48.a, var40); -- String var30 = EnumChatFormatting.YELLOW + "" + var29.getScorePoints(); -- var8.drawStringWithShadow(var30, var28 - var8.getStringWidth(var30), var23, 16777215); -+ -+ if (var19 < var39.size()) { -+ GuiPlayerInfo var46 = (GuiPlayerInfo)var39.get(var19); -+ ScorePlayerTeam var60 = this.mc.theWorld.getScoreboard().getPlayersTeam(var46.name); -+ String var53 = ScorePlayerTeam.formatPlayerName(var60, var46.name); -+ font.drawStringWithShadow(var53, var20, var47, 16777215); -+ -+ GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); // TODO: might not need this. -+ -+ if (var42 != null) { -+ int var51 = var20 + font.getStringWidth(var53) + 5; -+ int var50 = var20 + var16 - 12 - 5; -+ -+ if (var50 - var51 > 5) { -+ Score var56 = var42.getScoreboard().func_96529_a(var46.name, var42); -+ String var57 = EnumChatFormatting.YELLOW + "" + var56.getScorePoints(); -+ font.drawStringWithShadow(var57, var50 - font.getStringWidth(var57), var47, 16777215); - } - } -- -- GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); -+ - this.mc.getTextureManager().bindTexture(icons); -- byte var51 = 0; -- boolean var52 = false; -- byte var53; -- if(var48.responseTime < 0) { -- var53 = 5; -- } else if(var48.responseTime < 150) { -- var53 = 0; -- } else if(var48.responseTime < 300) { -- var53 = 1; -- } else if(var48.responseTime < 600) { -- var53 = 2; -- } else if(var48.responseTime < 1000) { -- var53 = 3; -+ byte var50 = 0; -+ boolean var48 = false; -+ byte var49; -+ -+ if (var46.responseTime < 0) { -+ var49 = 5; -+ } else if (var46.responseTime < 150) { -+ var49 = 0; -+ } else if (var46.responseTime < 300) { -+ var49 = 1; -+ } else if (var46.responseTime < 600) { -+ var49 = 2; -+ } else if (var46.responseTime < 1000) { -+ var49 = 3; - } else { -- var53 = 4; -+ var49 = 4; - } - - this.zLevel += 100.0F; -- this.drawTexturedModalRect(var22 + var46 - 12, var23, 0 + var51 * 10, 176 + var53 * 8, 10, 8); -+ this.drawTexturedModalRect(var20 + var16 - 12, var47, 0 + var50 * 10, 176 + var49 * 8, 10, 8); - this.zLevel -= 100.0F; - } - } -@@ -358,65 +465,69 @@ - GL11.glEnable(GL11.GL_ALPHA_TEST); - } - -- private void func_96136_a(ScoreObjective var1, int var2, int var3, FontRenderer var4) { -- Scoreboard var5 = var1.getScoreboard(); -- Collection var6 = var5.func_96534_i(var1); -- if(var6.size() <= 15) { -- int var7 = var4.getStringWidth(var1.getDisplayName()); -+ private void func_96136_a(ScoreObjective par1ScoreObjective, int par2, int par3, FontRenderer par4FontRenderer) { -+ Scoreboard var5 = par1ScoreObjective.getScoreboard(); -+ Collection var6 = var5.func_96534_i(par1ScoreObjective); - -+ if (var6.size() <= 15) { -+ int var7 = par4FontRenderer.getStringWidth(par1ScoreObjective.getDisplayName()); - String var11; -- for(Iterator var8 = var6.iterator(); var8.hasNext(); var7 = Math.max(var7, var4.getStringWidth(var11))) { -+ -+ for (Iterator var8 = var6.iterator(); var8.hasNext(); var7 = Math.max(var7, par4FontRenderer.getStringWidth(var11))) { - Score var9 = (Score)var8.next(); - ScorePlayerTeam var10 = var5.getPlayersTeam(var9.getPlayerName()); - var11 = ScorePlayerTeam.formatPlayerName(var10, var9.getPlayerName()) + ": " + EnumChatFormatting.RED + var9.getScorePoints(); - } - -- int var22 = var6.size() * var4.FONT_HEIGHT; -- int var23 = var2 / 2 + var22 / 3; -- byte var24 = 3; -- int var25 = var3 - var7 - var24; -+ int var22 = var6.size() * par4FontRenderer.FONT_HEIGHT; -+ int var23 = par2 / 2 + var22 / 3; -+ byte var25 = 3; -+ int var24 = par3 - var7 - var25; - int var12 = 0; - Iterator var13 = var6.iterator(); - -- while(var13.hasNext()) { -+ while (var13.hasNext()) { - Score var14 = (Score)var13.next(); - ++var12; - ScorePlayerTeam var15 = var5.getPlayersTeam(var14.getPlayerName()); - String var16 = ScorePlayerTeam.formatPlayerName(var15, var14.getPlayerName()); - String var17 = EnumChatFormatting.RED + "" + var14.getScorePoints(); -- int var19 = var23 - var12 * var4.FONT_HEIGHT; -- int var20 = var3 - var24 + 2; -- drawRect(var25 - 2, var19, var20, var19 + var4.FONT_HEIGHT, 1342177280); -- var4.drawString(var16, var25, var19, 553648127); -- var4.drawString(var17, var20 - var4.getStringWidth(var17), var19, 553648127); -- if(var12 == var6.size()) { -- String var21 = var1.getDisplayName(); -- drawRect(var25 - 2, var19 - var4.FONT_HEIGHT - 1, var20, var19 - 1, 1610612736); -- drawRect(var25 - 2, var19 - 1, var20, var19, 1342177280); -- var4.drawString(var21, var25 + var7 / 2 - var4.getStringWidth(var21) / 2, var19 - var4.FONT_HEIGHT, 553648127); -+ int var19 = var23 - var12 * par4FontRenderer.FONT_HEIGHT; -+ int var20 = par3 - var25 + 2; -+ drawRect(var24 - 2, var19, var20, var19 + par4FontRenderer.FONT_HEIGHT, 1342177280); -+ par4FontRenderer.drawString(var16, var24, var19, 553648127); -+ par4FontRenderer.drawString(var17, var20 - par4FontRenderer.getStringWidth(var17), var19, 553648127); -+ -+ if (var12 == var6.size()) { -+ String var21 = par1ScoreObjective.getDisplayName(); -+ drawRect(var24 - 2, var19 - par4FontRenderer.FONT_HEIGHT - 1, var20, var19 - 1, 1610612736); -+ drawRect(var24 - 2, var19 - 1, var20, var19, 1342177280); -+ par4FontRenderer.drawString(var21, var24 + var7 / 2 - par4FontRenderer.getStringWidth(var21) / 2, var19 - par4FontRenderer.FONT_HEIGHT, 553648127); - } - } -- - } - } -+ -+ //ToDo: this is a duplicate method at the moment - -- private void func_110327_a(int var1, int var2) { -+ private void func_110327_a(int par1, int par2) { - boolean var3 = this.mc.thePlayer.hurtResistantTime / 3 % 2 == 1; -- if(this.mc.thePlayer.hurtResistantTime < 10) { -+ -+ if (this.mc.thePlayer.hurtResistantTime < 10) { - var3 = false; - } - - int var4 = MathHelper.ceiling_float_int(this.mc.thePlayer.getHealth()); - int var5 = MathHelper.ceiling_float_int(this.mc.thePlayer.prevHealth); -- this.f.setSeed((long)(this.updateCounter * 312871)); -+ this.rand.setSeed((long)(this.updateCounter * 312871)); - boolean var6 = false; - FoodStats var7 = this.mc.thePlayer.getFoodStats(); - int var8 = var7.getFoodLevel(); - int var9 = var7.getPrevFoodLevel(); - AttributeInstance var10 = this.mc.thePlayer.getEntityAttribute(SharedMonsterAttributes.maxHealth); -- int var11 = var1 / 2 - 91; -- int var12 = var1 / 2 + 91; -- int var13 = var2 - 39; -+ int var11 = par1 / 2 - 91; -+ int var12 = par1 / 2 + 91; -+ int var13 = par2 - 39; - float var14 = (float)var10.getAttributeValue(); - float var15 = this.mc.thePlayer.getAbsorptionAmount(); - int var16 = MathHelper.ceiling_float_int((var14 + var15) / 2.0F / 10.0F); -@@ -425,78 +536,85 @@ - float var19 = var15; - int var20 = this.mc.thePlayer.getTotalArmorValue(); - int var21 = -1; -- if(this.mc.thePlayer.isPotionActive(Potion.regeneration)) { -+ -+ if (this.mc.thePlayer.isPotionActive(Potion.regeneration)) { - var21 = this.updateCounter % MathHelper.ceiling_float_int(var14 + 5.0F); - } - - this.mc.mcProfiler.startSection("armor"); -- -- int var22; - int var23; -- for(var22 = 0; var22 < 10; ++var22) { -- if(var20 > 0) { -+ int var22; -+ -+ for (var22 = 0; var22 < 10; ++var22) { -+ if (var20 > 0) { - var23 = var11 + var22 * 8; -- if(var22 * 2 + 1 < var20) { -+ -+ if (var22 * 2 + 1 < var20) { - this.drawTexturedModalRect(var23, var18, 34, 9, 9, 9); - } - -- if(var22 * 2 + 1 == var20) { -+ if (var22 * 2 + 1 == var20) { - this.drawTexturedModalRect(var23, var18, 25, 9, 9, 9); - } - -- if(var22 * 2 + 1 > var20) { -+ if (var22 * 2 + 1 > var20) { - this.drawTexturedModalRect(var23, var18, 16, 9, 9, 9); - } - } - } - - this.mc.mcProfiler.endStartSection("health"); -- - int var25; -- int var26; - int var27; -- for(var22 = MathHelper.ceiling_float_int((var14 + var15) / 2.0F) - 1; var22 >= 0; --var22) { -+ int var26; -+ -+ for (var22 = MathHelper.ceiling_float_int((var14 + var15) / 2.0F) - 1; var22 >= 0; --var22) { - var23 = 16; -- if(this.mc.thePlayer.isPotionActive(Potion.poison)) { -+ -+ if (this.mc.thePlayer.isPotionActive(Potion.poison)) { - var23 += 36; -- } else if(this.mc.thePlayer.isPotionActive(Potion.wither)) { -+ } else if (this.mc.thePlayer.isPotionActive(Potion.wither)) { - var23 += 72; - } - - byte var24 = 0; -- if(var3) { -+ -+ if (var3) { - var24 = 1; - } - - var25 = MathHelper.ceiling_float_int((float)(var22 + 1) / 10.0F) - 1; - var26 = var11 + var22 % 10 * 8; - var27 = var13 - var25 * var17; -- if(var4 <= 4) { -- var27 += this.f.nextInt(2); -+ -+ if (var4 <= 4) { -+ var27 += this.rand.nextInt(2); - } - -- if(var22 == var21) { -+ if (var22 == var21) { - var27 -= 2; - } - - byte var28 = 0; -- if(this.mc.theWorld.getWorldInfo().isHardcoreModeEnabled()) { -+ -+ if (this.mc.theWorld.getWorldInfo().isHardcoreModeEnabled()) { - var28 = 5; - } - - this.drawTexturedModalRect(var26, var27, 16 + var24 * 9, 9 * var28, 9, 9); -- if(var3) { -- if(var22 * 2 + 1 < var5) { -+ -+ if (var3) { -+ if (var22 * 2 + 1 < var5) { - this.drawTexturedModalRect(var26, var27, var23 + 54, 9 * var28, 9, 9); - } - -- if(var22 * 2 + 1 == var5) { -+ if (var22 * 2 + 1 == var5) { - this.drawTexturedModalRect(var26, var27, var23 + 63, 9 * var28, 9, 9); - } - } - -- if(var19 > 0.0F) { -- if(var19 == var15 && var15 % 2.0F == 1.0F) { -+ if (var19 > 0.0F) { -+ if (var19 == var15 && var15 % 2.0F == 1.0F) { - this.drawTexturedModalRect(var26, var27, var23 + 153, 9 * var28, 9, 9); - } else { - this.drawTexturedModalRect(var26, var27, var23 + 144, 9 * var28, 9, 9); -@@ -504,11 +622,11 @@ - - var19 -= 2.0F; - } else { -- if(var22 * 2 + 1 < var4) { -+ if (var22 * 2 + 1 < var4) { - this.drawTexturedModalRect(var26, var27, var23 + 36, 9 * var28, 9, 9); - } - -- if(var22 * 2 + 1 == var4) { -+ if (var22 * 2 + 1 == var4) { - this.drawTexturedModalRect(var26, var27, var23 + 45, 9 * var28, 9, 9); - } - } -@@ -516,76 +634,82 @@ - - Entity var34 = this.mc.thePlayer.ridingEntity; - int var35; -- if(var34 == null) { -+ -+ if (var34 == null) { - this.mc.mcProfiler.endStartSection("food"); - -- for(var23 = 0; var23 < 10; ++var23) { -+ for (var23 = 0; var23 < 10; ++var23) { - var35 = var13; - var25 = 16; - byte var36 = 0; -- if(this.mc.thePlayer.isPotionActive(Potion.hunger)) { -+ -+ if (this.mc.thePlayer.isPotionActive(Potion.hunger)) { - var25 += 36; - var36 = 13; - } - -- if(this.mc.thePlayer.getFoodStats().getSaturationLevel() <= 0.0F && this.updateCounter % (var8 * 3 + 1) == 0) { -- var35 = var13 + (this.f.nextInt(3) - 1); -+ if (this.mc.thePlayer.getFoodStats().getSaturationLevel() <= 0.0F && this.updateCounter % (var8 * 3 + 1) == 0) { -+ var35 = var13 + (this.rand.nextInt(3) - 1); - } - -- if(var6) { -+ if (var6) { - var36 = 1; - } - - var27 = var12 - var23 * 8 - 9; - this.drawTexturedModalRect(var27, var35, 16 + var36 * 9, 27, 9, 9); -- if(var6) { -- if(var23 * 2 + 1 < var9) { -+ -+ if (var6) { -+ if (var23 * 2 + 1 < var9) { - this.drawTexturedModalRect(var27, var35, var25 + 54, 27, 9, 9); - } - -- if(var23 * 2 + 1 == var9) { -+ if (var23 * 2 + 1 == var9) { - this.drawTexturedModalRect(var27, var35, var25 + 63, 27, 9, 9); - } - } - -- if(var23 * 2 + 1 < var8) { -+ if (var23 * 2 + 1 < var8) { - this.drawTexturedModalRect(var27, var35, var25 + 36, 27, 9, 9); - } - -- if(var23 * 2 + 1 == var8) { -+ if (var23 * 2 + 1 == var8) { - this.drawTexturedModalRect(var27, var35, var25 + 45, 27, 9, 9); - } - } -- } else if(var34 instanceof EntityLivingBase) { -+ } else if (var34 instanceof EntityLivingBase) { - this.mc.mcProfiler.endStartSection("mountHealth"); -- EntityLivingBase var37 = (EntityLivingBase)var34; -- var35 = (int)Math.ceil((double)var37.getHealth()); -- float var38 = var37.getMaxHealth(); -- var26 = (int)(var38 + 0.5F) / 2; -- if(var26 > 30) { -+ EntityLivingBase var38 = (EntityLivingBase)var34; -+ var35 = (int)Math.ceil((double)var38.getHealth()); -+ float var37 = var38.getMaxHealth(); -+ var26 = (int)(var37 + 0.5F) / 2; -+ -+ if (var26 > 30) { - var26 = 30; - } - - var27 = var13; - -- for(int var39 = 0; var26 > 0; var39 += 20) { -+ for (int var39 = 0; var26 > 0; var39 += 20) { - int var29 = Math.min(var26, 10); - var26 -= var29; - -- for(int var30 = 0; var30 < var29; ++var30) { -+ for (int var30 = 0; var30 < var29; ++var30) { - byte var31 = 52; - byte var32 = 0; -- if(var6) { -+ -+ if (var6) { - var32 = 1; - } - - int var33 = var12 - var30 * 8 - 9; - this.drawTexturedModalRect(var33, var27, var31 + var32 * 9, 9, 9, 9); -- if(var30 * 2 + 1 + var39 < var35) { -+ -+ if (var30 * 2 + 1 + var39 < var35) { - this.drawTexturedModalRect(var33, var27, var31 + 36, 9, 9, 9); - } - -- if(var30 * 2 + 1 + var39 == var35) { -+ if (var30 * 2 + 1 + var39 == var35) { - this.drawTexturedModalRect(var33, var27, var31 + 45, 9, 9, 9); - } - } -@@ -595,13 +719,14 @@ - } - - this.mc.mcProfiler.endStartSection("air"); -- if(this.mc.thePlayer.isInsideOfMaterial(Material.water)) { -+ -+ if (this.mc.thePlayer.isInsideOfMaterial(Material.water)) { - var23 = this.mc.thePlayer.getAir(); - var35 = MathHelper.ceiling_double_int((double)(var23 - 2) * 10.0D / 300.0D); - var25 = MathHelper.ceiling_double_int((double)var23 * 10.0D / 300.0D) - var35; - -- for(var26 = 0; var26 < var35 + var25; ++var26) { -- if(var26 < var35) { -+ for (var26 = 0; var26 < var35 + var25; ++var26) { -+ if (var26 < var35) { - this.drawTexturedModalRect(var12 - var26 * 8 - 9, var18, 16, 18, 9, 9); - } else { - this.drawTexturedModalRect(var12 - var26 * 8 - 9, var18, 25, 18, 9, 9); -@@ -612,8 +737,12 @@ - this.mc.mcProfiler.endSection(); - } - -+ -+ /** -+ * Renders dragon's (boss) health on the HUD -+ */ - private void renderBossHealth() { -- if(BossStatus.c != null && BossStatus.statusBarLength > 0) { -+ if (BossStatus.bossName != null && BossStatus.statusBarLength > 0) { - --BossStatus.statusBarLength; - FontRenderer var1 = this.mc.fontRenderer; - ScaledResolution var2 = new ScaledResolution(this.mc.gameSettings, this.mc.displayWidth, this.mc.displayHeight); -@@ -624,18 +753,19 @@ - byte var7 = 12; - this.drawTexturedModalRect(var5, var7, 0, 74, var4, 5); - this.drawTexturedModalRect(var5, var7, 0, 74, var4, 5); -- if(var6 > 0) { -+ -+ if (var6 > 0) { - this.drawTexturedModalRect(var5, var7, 0, 79, var6, 5); - } - -- String var8 = BossStatus.c; -+ String var8 = BossStatus.bossName; - var1.drawStringWithShadow(var8, var3 / 2 - var1.getStringWidth(var8) / 2, var7 - 10, 16777215); - GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - this.mc.getTextureManager().bindTexture(icons); - } - } - -- private void renderPumpkinBlur(int var1, int var2) { -+ private void renderPumpkinBlur(int par1, int par2) { - GL11.glDisable(GL11.GL_DEPTH_TEST); - GL11.glDepthMask(false); - GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); -@@ -644,9 +774,9 @@ - this.mc.getTextureManager().bindTexture(pumpkinBlurTexPath); - Tessellator var3 = Tessellator.instance; - var3.startDrawingQuads(); -- var3.addVertexWithUV(0.0D, (double)var2, -90.0D, 0.0D, 1.0D); -- var3.addVertexWithUV((double)var1, (double)var2, -90.0D, 1.0D, 1.0D); -- var3.addVertexWithUV((double)var1, 0.0D, -90.0D, 1.0D, 0.0D); -+ var3.addVertexWithUV(0.0D, (double)par2, -90.0D, 0.0D, 1.0D); -+ var3.addVertexWithUV((double)par1, (double)par2, -90.0D, 1.0D, 1.0D); -+ var3.addVertexWithUV((double)par1, 0.0D, -90.0D, 1.0D, 0.0D); - var3.addVertexWithUV(0.0D, 0.0D, -90.0D, 0.0D, 0.0D); - var3.draw(); - GL11.glDepthMask(true); -@@ -655,17 +785,21 @@ - GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - } - -- private void renderVignette(float var1, int var2, int var3) { -- var1 = 1.0F - var1; -- if(var1 < 0.0F) { -- var1 = 0.0F; -- } -- -- if(var1 > 1.0F) { -- var1 = 1.0F; -- } -- -- this.prevVignetteBrightness = (float)((double)this.prevVignetteBrightness + (double)(var1 - this.prevVignetteBrightness) * 0.01D); -+ /** -+ * Renders the vignette. Args: vignetteBrightness, width, height -+ */ -+ private void renderVignette(float par1, int par2, int par3) { -+ par1 = 1.0F - par1; -+ -+ if (par1 < 0.0F) { -+ par1 = 0.0F; -+ } -+ -+ if (par1 > 1.0F) { -+ par1 = 1.0F; -+ } -+ -+ this.prevVignetteBrightness = (float)((double)this.prevVignetteBrightness + (double)(par1 - this.prevVignetteBrightness) * 0.01D); - GL11.glDisable(GL11.GL_DEPTH_TEST); - GL11.glDepthMask(false); - GL11.glBlendFunc(GL11.GL_ZERO, GL11.GL_ONE_MINUS_SRC_COLOR); -@@ -673,9 +807,9 @@ - this.mc.getTextureManager().bindTexture(vignetteTexPath); - Tessellator var4 = Tessellator.instance; - var4.startDrawingQuads(); -- var4.addVertexWithUV(0.0D, (double)var3, -90.0D, 0.0D, 1.0D); -- var4.addVertexWithUV((double)var2, (double)var3, -90.0D, 1.0D, 1.0D); -- var4.addVertexWithUV((double)var2, 0.0D, -90.0D, 1.0D, 0.0D); -+ var4.addVertexWithUV(0.0D, (double)par3, -90.0D, 0.0D, 1.0D); -+ var4.addVertexWithUV((double)par2, (double)par3, -90.0D, 1.0D, 1.0D); -+ var4.addVertexWithUV((double)par2, 0.0D, -90.0D, 1.0D, 0.0D); - var4.addVertexWithUV(0.0D, 0.0D, -90.0D, 0.0D, 0.0D); - var4.draw(); - GL11.glDepthMask(true); -@@ -684,18 +818,18 @@ - GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); - } - -- private void func_130015_b(float var1, int var2, int var3) { -- if(var1 < 1.0F) { -- var1 *= var1; -- var1 *= var1; -- var1 = var1 * 0.8F + 0.2F; -+ private void func_130015_b(float par1, int par2, int par3) { -+ if (par1 < 1.0F) { -+ par1 *= par1; -+ par1 *= par1; -+ par1 = par1 * 0.8F + 0.2F; - } - - GL11.glDisable(GL11.GL_ALPHA_TEST); - GL11.glDisable(GL11.GL_DEPTH_TEST); - GL11.glDepthMask(false); - GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); -- GL11.glColor4f(1.0F, 1.0F, 1.0F, var1); -+ GL11.glColor4f(1.0F, 1.0F, 1.0F, par1); - Icon var4 = Block.portal.getBlockTextureFromSide(1); - this.mc.getTextureManager().bindTexture(TextureMap.locationBlocksTexture); - float var5 = var4.getMinU(); -@@ -704,9 +838,9 @@ - float var8 = var4.getMaxV(); - Tessellator var9 = Tessellator.instance; - var9.startDrawingQuads(); -- var9.addVertexWithUV(0.0D, (double)var3, -90.0D, (double)var5, (double)var8); -- var9.addVertexWithUV((double)var2, (double)var3, -90.0D, (double)var7, (double)var8); -- var9.addVertexWithUV((double)var2, 0.0D, -90.0D, (double)var7, (double)var6); -+ var9.addVertexWithUV(0.0D, (double)par3, -90.0D, (double)var5, (double)var8); -+ var9.addVertexWithUV((double)par2, (double)par3, -90.0D, (double)var7, (double)var8); -+ var9.addVertexWithUV((double)par2, 0.0D, -90.0D, (double)var7, (double)var6); - var9.addVertexWithUV(0.0D, 0.0D, -90.0D, (double)var5, (double)var6); - var9.draw(); - GL11.glDepthMask(true); -@@ -715,39 +849,50 @@ - GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - } - -- private void renderInventorySlot(int var1, int var2, int var3, float var4) { -- ItemStack var5 = this.mc.thePlayer.inventory.mainInventory[var1]; -- if(var5 != null) { -- float var6 = (float)var5.animationsToGo - var4; -- if(var6 > 0.0F) { -+ /** -+ * Renders the specified item of the inventory slot at the specified location. Args: slot, x, y, partialTick -+ */ -+ private void renderInventorySlot(int par1, int par2, int par3, float par4) { -+ ItemStack var5 = this.mc.thePlayer.inventory.mainInventory[par1]; -+ -+ if (var5 != null) { -+ float var6 = (float)var5.animationsToGo - par4; -+ -+ if (var6 > 0.0F) { - GL11.glPushMatrix(); - float var7 = 1.0F + var6 / 5.0F; -- GL11.glTranslatef((float)(var2 + 8), (float)(var3 + 12), 0.0F); -+ GL11.glTranslatef((float)(par2 + 8), (float)(par3 + 12), 0.0F); - GL11.glScalef(1.0F / var7, (var7 + 1.0F) / 2.0F, 1.0F); -- GL11.glTranslatef((float)(-(var2 + 8)), (float)(-(var3 + 12)), 0.0F); -+ GL11.glTranslatef((float)(-(par2 + 8)), (float)(-(par3 + 12)), 0.0F); - } - -- itemRenderer.renderItemAndEffectIntoGUI(this.mc.fontRenderer, this.mc.getTextureManager(), var5, var2, var3); -- if(var6 > 0.0F) { -+ itemRenderer.renderItemAndEffectIntoGUI(this.mc.fontRenderer, this.mc.getTextureManager(), var5, par2, par3); -+ -+ if (var6 > 0.0F) { - GL11.glPopMatrix(); - } - -- itemRenderer.renderItemOverlayIntoGUI(this.mc.fontRenderer, this.mc.getTextureManager(), var5, var2, var3); -+ itemRenderer.renderItemOverlayIntoGUI(this.mc.fontRenderer, this.mc.getTextureManager(), var5, par2, par3); - } - } - -+ /** -+ * The update tick for the ingame UI -+ */ - public void updateTick() { -- if(this.recordPlayingUpFor > 0) { -+ if (this.recordPlayingUpFor > 0) { - --this.recordPlayingUpFor; - } - - ++this.updateCounter; -- if(this.mc.thePlayer != null) { -+ -+ if (this.mc.thePlayer != null) { - ItemStack var1 = this.mc.thePlayer.inventory.getCurrentItem(); -- if(var1 == null) { -+ -+ if (var1 == null) { - this.remainingHighlightTicks = 0; -- } else if(this.highlightingItemStack != null && var1.itemID == this.highlightingItemStack.itemID && ItemStack.areItemStackTagsEqual(var1, this.highlightingItemStack) && (var1.isItemStackDamageable() || var1.getItemDamage() == this.highlightingItemStack.getItemDamage())) { -- if(this.remainingHighlightTicks > 0) { -+ } else if (this.highlightingItemStack != null && var1.itemID == this.highlightingItemStack.itemID && ItemStack.areItemStackTagsEqual(var1, this.highlightingItemStack) && (var1.isItemStackDamageable() || var1.getItemDamage() == this.highlightingItemStack.getItemDamage())) { -+ if (this.remainingHighlightTicks > 0) { - --this.remainingHighlightTicks; - } - } else { -@@ -756,19 +901,21 @@ - - this.highlightingItemStack = var1; - } -- -- } -- -- public void setRecordPlayingMessage(String var1) { -- this.func_110326_a("Now playing: " + var1, true); -- } -- -- public void func_110326_a(String var1, boolean var2) { -- this.j = var1; -+ } -+ -+ public void setRecordPlayingMessage(String par1Str) { -+ this.func_110326_a("Now playing: " + par1Str, true); -+ } -+ -+ public void func_110326_a(String par1Str, boolean par2) { -+ this.recordPlaying = par1Str; - this.recordPlayingUpFor = 60; -- this.recordIsPlaying = var2; -+ this.recordIsPlaying = par2; - } -- -+ -+ /** -+ * returns a pointer to the persistant Chat GUI, containing all previous chat messages and such -+ */ - public GuiNewChat getChatGUI() { - return this.persistantChatGUI; - } ---- net/minecraft/src/CallableType.java -+++ net/minecraft/src/CallableType.java -@@ -3,10 +3,12 @@ - import java.util.concurrent.Callable; - - class CallableType implements Callable { -+ -+ /** Reference to the DecitatedServer object. */ - final DedicatedServer theDecitatedServer; - -- CallableType(DedicatedServer var1) { -- this.theDecitatedServer = var1; -+ CallableType(DedicatedServer par1DedicatedServer) { -+ this.theDecitatedServer = par1DedicatedServer; - } - - public String getType() { ---- /dev/null -+++ org/spoutcraft/client/gui/minimap/TextureManager.java -@@ -1,0 +1,99 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.client.gui.minimap; -+ -+import net.minecraft.src.Minecraft; -+ -+import org.spoutcraft.client.io.CustomTextureManager; -+import org.spoutcraft.client.io.FileUtil; -+ -+public class TextureManager { -+ private int glRoundmap = 0; -+ private int glMMArrow = 0; -+ private int glWaypoint = 0; -+ private int glMarker = 0; -+ private int glMinimap = 0; -+ private int glWhiteRoundmap = 0; -+ private int glWhiteMinimap = 0; -+ -+ /** -+ * @param zanMinimap -+ */ -+ public TextureManager() {} -+ -+ public void reset() { -+ glRoundmap = 0; -+ glMMArrow = 0; -+ glWaypoint = 0; -+ glMarker = 0; -+ glMinimap = 0; -+ glWhiteRoundmap = 0; -+ glWhiteMinimap = 0; -+ } -+ -+ public void loadRoundmap() { -+ if (glRoundmap == 0) { -+ glRoundmap = CustomTextureManager.getTextureFromPath(FileUtil.getAssetsDir().getPath()+"/minimap/roundmap.png").getTextureID(); -+ } -+ Minecraft.getMinecraft().renderEngine.bindTexture(glRoundmap); -+ } -+ -+ public void loadMMArrow() { -+ if (glMMArrow == 0) { -+ glMMArrow = CustomTextureManager.getTextureFromPath(FileUtil.getAssetsDir().getPath()+"/minimap/arrow.png").getTextureID(); -+ } -+ Minecraft.getMinecraft().renderEngine.bindTexture(glMMArrow); -+ } -+ -+ public void loadWaypoint() { -+ if (glWaypoint == 0) { -+ glWaypoint = CustomTextureManager.getTextureFromPath(FileUtil.getAssetsDir().getPath()+"/minimap/waypoint.png").getTextureID(); -+ } -+ Minecraft.getMinecraft().renderEngine.bindTexture(glWaypoint); -+ } -+ -+ public void loadMarker() { -+ if (glMarker == 0) { -+ glMarker = CustomTextureManager.getTextureFromPath(FileUtil.getAssetsDir().getPath()+"/minimap/marker.png").getTextureID(); -+ } -+ Minecraft.getMinecraft().renderEngine.bindTexture(glMinimap); -+ } -+ -+ public void loadMinimap() { -+ if (glMinimap == 0) { -+ glMinimap = CustomTextureManager.getTextureFromPath(FileUtil.getAssetsDir().getPath()+"/minimap/squaremap.png").getTextureID(); -+ } -+ Minecraft.getMinecraft().renderEngine.bindTexture(glMinimap); -+ } -+ -+ public void loadWhiteMinimap() { -+ if (glWhiteMinimap == 0) { -+ glWhiteMinimap = CustomTextureManager.getTextureFromPath(FileUtil.getAssetsDir().getPath()+"/minimap/squaremap_white.png").getTextureID(); -+ } -+ Minecraft.getMinecraft().renderEngine.bindTexture(glWhiteMinimap); -+ } -+ -+ public void loadWhiteRoundmap() { -+ if (glWhiteRoundmap == 0) { -+ glWhiteRoundmap = CustomTextureManager.getTextureFromPath(FileUtil.getAssetsDir().getPath()+"/minimap/roundmap_white.png").getTextureID(); -+ } -+ Minecraft.getMinecraft().renderEngine.bindTexture(glWhiteRoundmap); -+ } -+} ---- net/minecraft/src/ScoreboardSaveData.java -+++ net/minecraft/src/ScoreboardSaveData.java -@@ -12,101 +12,103 @@ - this("scoreboard"); - } - -- public ScoreboardSaveData(String var1) { -- super(var1); -+ public ScoreboardSaveData(String par1Str) { -+ super(par1Str); - } - -- public void func_96499_a(Scoreboard var1) { -- this.theScoreboard = var1; -- if(this.field_96506_b != null) { -+ public void func_96499_a(Scoreboard par1Scoreboard) { -+ this.theScoreboard = par1Scoreboard; -+ -+ if (this.field_96506_b != null) { - this.readFromNBT(this.field_96506_b); - } -- - } - -- public void readFromNBT(NBTTagCompound var1) { -- if(this.theScoreboard == null) { -- this.field_96506_b = var1; -+ /** -+ * reads in data from the NBTTagCompound into this MapDataBase -+ */ -+ public void readFromNBT(NBTTagCompound par1NBTTagCompound) { -+ if (this.theScoreboard == null) { -+ this.field_96506_b = par1NBTTagCompound; - } else { -- this.func_96501_b(var1.getTagList("Objectives")); -- this.func_96500_c(var1.getTagList("PlayerScores")); -- if(var1.hasKey("DisplaySlots")) { -- this.func_96504_c(var1.getCompoundTag("DisplaySlots")); -- } -- -- if(var1.hasKey("Teams")) { -- this.func_96498_a(var1.getTagList("Teams")); -- } -- -+ this.func_96501_b(par1NBTTagCompound.getTagList("Objectives")); -+ this.func_96500_c(par1NBTTagCompound.getTagList("PlayerScores")); -+ -+ if (par1NBTTagCompound.hasKey("DisplaySlots")) { -+ this.func_96504_c(par1NBTTagCompound.getCompoundTag("DisplaySlots")); -+ } -+ -+ if (par1NBTTagCompound.hasKey("Teams")) { -+ this.func_96498_a(par1NBTTagCompound.getTagList("Teams")); -+ } - } - } - -- protected void func_96498_a(NBTTagList var1) { -- for(int var2 = 0; var2 < var1.tagCount(); ++var2) { -- NBTTagCompound var3 = (NBTTagCompound)var1.tagAt(var2); -- ScorePlayerTeam var4 = this.theScoreboard.createTeam(var3.getString("Name")); -- var4.setTeamName(var3.getString("DisplayName")); -- var4.setNamePrefix(var3.getString("Prefix")); -- var4.setNameSuffix(var3.getString("Suffix")); -- if(var3.hasKey("AllowFriendlyFire")) { -+ protected void func_96498_a(NBTTagList par1NBTTagList) { -+ for (int var2 = 0; var2 < par1NBTTagList.tagCount(); ++var2) { -+ NBTTagCompound var3 = (NBTTagCompound)par1NBTTagList.tagAt(var2); -+ ScorePlayerTeam var4 = this.theScoreboard.func_96527_f(var3.getString("Name")); -+ var4.func_96664_a(var3.getString("DisplayName")); -+ var4.func_96666_b(var3.getString("Prefix")); -+ var4.func_96662_c(var3.getString("Suffix")); -+ -+ if (var3.hasKey("AllowFriendlyFire")) { - var4.setAllowFriendlyFire(var3.getBoolean("AllowFriendlyFire")); - } - -- if(var3.hasKey("SeeFriendlyInvisibles")) { -- var4.setSeeFriendlyInvisiblesEnabled(var3.getBoolean("SeeFriendlyInvisibles")); -+ if (var3.hasKey("SeeFriendlyInvisibles")) { -+ var4.func_98300_b(var3.getBoolean("SeeFriendlyInvisibles")); - } - - this.func_96502_a(var4, var3.getTagList("Players")); - } -- - } - -- protected void func_96502_a(ScorePlayerTeam var1, NBTTagList var2) { -- for(int var3 = 0; var3 < var2.tagCount(); ++var3) { -- this.theScoreboard.addPlayerToTeam(((NBTTagString)var2.tagAt(var3)).a, var1); -+ protected void func_96502_a(ScorePlayerTeam par1ScorePlayerTeam, NBTTagList par2NBTTagList) { -+ for (int var3 = 0; var3 < par2NBTTagList.tagCount(); ++var3) { -+ this.theScoreboard.func_96521_a(((NBTTagString)par2NBTTagList.tagAt(var3)).data, par1ScorePlayerTeam); - } -- - } - -- protected void func_96504_c(NBTTagCompound var1) { -- for(int var2 = 0; var2 < 3; ++var2) { -- if(var1.hasKey("slot_" + var2)) { -- String var3 = var1.getString("slot_" + var2); -+ protected void func_96504_c(NBTTagCompound par1NBTTagCompound) { -+ for (int var2 = 0; var2 < 3; ++var2) { -+ if (par1NBTTagCompound.hasKey("slot_" + var2)) { -+ String var3 = par1NBTTagCompound.getString("slot_" + var2); - ScoreObjective var4 = this.theScoreboard.getObjective(var3); - this.theScoreboard.func_96530_a(var2, var4); - } - } -- - } - -- protected void func_96501_b(NBTTagList var1) { -- for(int var2 = 0; var2 < var1.tagCount(); ++var2) { -- NBTTagCompound var3 = (NBTTagCompound)var1.tagAt(var2); -- ScoreObjectiveCriteria var4 = (ScoreObjectiveCriteria)ScoreObjectiveCriteria.a.get(var3.getString("CriteriaName")); -+ protected void func_96501_b(NBTTagList par1NBTTagList) { -+ for (int var2 = 0; var2 < par1NBTTagList.tagCount(); ++var2) { -+ NBTTagCompound var3 = (NBTTagCompound)par1NBTTagList.tagAt(var2); -+ ScoreObjectiveCriteria var4 = (ScoreObjectiveCriteria)ScoreObjectiveCriteria.field_96643_a.get(var3.getString("CriteriaName")); - ScoreObjective var5 = this.theScoreboard.func_96535_a(var3.getString("Name"), var4); - var5.setDisplayName(var3.getString("DisplayName")); - } -- - } - -- protected void func_96500_c(NBTTagList var1) { -- for(int var2 = 0; var2 < var1.tagCount(); ++var2) { -- NBTTagCompound var3 = (NBTTagCompound)var1.tagAt(var2); -+ protected void func_96500_c(NBTTagList par1NBTTagList) { -+ for (int var2 = 0; var2 < par1NBTTagList.tagCount(); ++var2) { -+ NBTTagCompound var3 = (NBTTagCompound)par1NBTTagList.tagAt(var2); - ScoreObjective var4 = this.theScoreboard.getObjective(var3.getString("Objective")); - Score var5 = this.theScoreboard.func_96529_a(var3.getString("Name"), var4); - var5.func_96647_c(var3.getInteger("Score")); - } -- - } - -- public void writeToNBT(NBTTagCompound var1) { -- if(this.theScoreboard == null) { -+ /** -+ * write data to NBTTagCompound from this MapDataBase, similar to Entities and TileEntities -+ */ -+ public void writeToNBT(NBTTagCompound par1NBTTagCompound) { -+ if (this.theScoreboard == null) { - MinecraftServer.getServer().getLogAgent().logWarning("Tried to save scoreboard without having a scoreboard..."); - } else { -- var1.setTag("Objectives", this.func_96505_b()); -- var1.setTag("PlayerScores", this.func_96503_e()); -- var1.setTag("Teams", this.func_96496_a()); -- this.func_96497_d(var1); -+ par1NBTTagCompound.setTag("Objectives", this.func_96505_b()); -+ par1NBTTagCompound.setTag("PlayerScores", this.func_96503_e()); -+ par1NBTTagCompound.setTag("Teams", this.func_96496_a()); -+ this.func_96497_d(par1NBTTagCompound); - } - } - -@@ -115,7 +117,7 @@ - Collection var2 = this.theScoreboard.func_96525_g(); - Iterator var3 = var2.iterator(); - -- while(var3.hasNext()) { -+ while (var3.hasNext()) { - ScorePlayerTeam var4 = (ScorePlayerTeam)var3.next(); - NBTTagCompound var5 = new NBTTagCompound(); - var5.setString("Name", var4.func_96661_b()); -@@ -127,7 +129,7 @@ - NBTTagList var6 = new NBTTagList(); - Iterator var7 = var4.getMembershipCollection().iterator(); - -- while(var7.hasNext()) { -+ while (var7.hasNext()) { - String var8 = (String)var7.next(); - var6.appendTag(new NBTTagString("", var8)); - } -@@ -139,22 +141,22 @@ - return var1; - } - -- protected void func_96497_d(NBTTagCompound var1) { -+ protected void func_96497_d(NBTTagCompound par1NBTTagCompound) { - NBTTagCompound var2 = new NBTTagCompound(); - boolean var3 = false; - -- for(int var4 = 0; var4 < 3; ++var4) { -+ for (int var4 = 0; var4 < 3; ++var4) { - ScoreObjective var5 = this.theScoreboard.func_96539_a(var4); -- if(var5 != null) { -+ -+ if (var5 != null) { - var2.setString("slot_" + var4, var5.getName()); - var3 = true; - } - } - -- if(var3) { -- var1.setCompoundTag("DisplaySlots", var2); -+ if (var3) { -+ par1NBTTagCompound.setCompoundTag("DisplaySlots", var2); - } -- - } - - protected NBTTagList func_96505_b() { -@@ -162,7 +164,7 @@ - Collection var2 = this.theScoreboard.getScoreObjectives(); - Iterator var3 = var2.iterator(); - -- while(var3.hasNext()) { -+ while (var3.hasNext()) { - ScoreObjective var4 = (ScoreObjective)var3.next(); - NBTTagCompound var5 = new NBTTagCompound(); - var5.setString("Name", var4.getName()); -@@ -179,7 +181,7 @@ - Collection var2 = this.theScoreboard.func_96528_e(); - Iterator var3 = var2.iterator(); - -- while(var3.hasNext()) { -+ while (var3.hasNext()) { - Score var4 = (Score)var3.next(); - NBTTagCompound var5 = new NBTTagCompound(); - var5.setString("Name", var4.getPlayerName()); ---- /dev/null -+++ org/spoutcraft/client/io/Download.java -@@ -1,0 +1,85 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.client.io; -+ -+import java.io.File; -+import java.io.IOException; -+ -+import org.apache.commons.io.FileUtils; -+ -+public class Download { -+ protected final String filename; -+ protected final File directory; -+ protected final String url; -+ protected final Runnable action; -+ protected int progress = 0; -+ -+ public Download(String filename, File directory, String url, Runnable action) { -+ this.filename = filename; -+ this.directory = directory; -+ this.url = url; -+ this.action = action; -+ } -+ -+ public File getTempFile() { -+ File downloading = new File(FileUtil.getTempDir(), "downloading"); -+ downloading.mkdir(); -+ return new File(downloading, filename); -+ } -+ -+ public boolean isDownloaded() { -+ return (new File(directory, filename)).exists(); -+ } -+ -+ public void move() { -+ File current = getTempFile(); -+ if (current.exists()) { -+ File destination = new File(directory, filename); -+ try { -+ FileUtils.moveFile(current, destination); -+ } catch (IOException e) {} -+ } -+ } -+ -+ public String getDownloadUrl() { -+ return url; -+ } -+ -+ public Runnable getCompletedAction() { -+ return action; -+ } -+ -+ @Override -+ public boolean equals(Object obj) { -+ if (obj instanceof Download) { -+ Download temp = (Download)obj; -+ return temp.filename.equals(this.filename) && temp.directory.getPath().equals(this.directory.getPath()) && temp.url.equals(this.url); -+ } -+ return false; -+ } -+ -+ synchronized public void setProgress(int p) { -+ progress = p; -+ } -+ -+ synchronized public int getProgress() { -+ return progress; -+ } -+} ---- net/minecraft/src/EnumCreatureType.java -+++ net/minecraft/src/EnumCreatureType.java -@@ -6,22 +6,30 @@ - ambient(EntityAmbientCreature.class, 15, Material.air, true, false), - waterCreature(EntityWaterMob.class, 5, Material.water, true, false); - -- private final Class e; -+ /** -+ * The root class of creatures associated with this EnumCreatureType (IMobs for aggressive creatures, EntityAnimals for -+ * friendly ones) -+ */ -+ private final Class creatureClass; - private final int maxNumberOfCreature; - private final Material creatureMaterial; -+ -+ /** A flag indicating whether this creature type is peaceful. */ - private final boolean isPeacefulCreature; -+ -+ /** Whether this creature type is an animal. */ - private final boolean isAnimal; - -- private EnumCreatureType(Class var3, int var4, Material var5, boolean var6, boolean var7) { -- this.e = var3; -- this.maxNumberOfCreature = var4; -- this.creatureMaterial = var5; -- this.isPeacefulCreature = var6; -- this.isAnimal = var7; -+ private EnumCreatureType(Class par3Class, int par4, Material par5Material, boolean par6, boolean par7) { -+ this.creatureClass = par3Class; -+ this.maxNumberOfCreature = par4; -+ this.creatureMaterial = par5Material; -+ this.isPeacefulCreature = par6; -+ this.isAnimal = par7; - } - - public Class getCreatureClass() { -- return this.e; -+ return this.creatureClass; - } - - public int getMaxNumberOfCreature() { -@@ -32,10 +40,16 @@ - return this.creatureMaterial; - } - -+ /** -+ * Gets whether or not this creature type is peaceful. -+ */ - public boolean getPeacefulCreature() { - return this.isPeacefulCreature; - } - -+ /** -+ * Return whether this creature type is an animal. -+ */ - public boolean getAnimal() { - return this.isAnimal; - } ---- net/minecraft/src/TileEntityEnderChest.java -+++ net/minecraft/src/TileEntityEnderChest.java -@@ -1,61 +1,82 @@ - package net.minecraft.src; - - public class TileEntityEnderChest extends TileEntity { -+ -+ /** The current angle of the chest lid (between 0 and 1) */ - public float lidAngle; -+ -+ /** The angle of the chest lid last tick */ - public float prevLidAngle; -+ -+ /** The number of players currently using this ender chest. */ - public int numUsingPlayers; -+ -+ /** Server sync counter (once per 20 ticks) */ - private int ticksSinceSync; - -+ /** -+ * Allows the entity to update its state. Overridden in most subclasses, e.g. the mob spawner uses this to count ticks -+ * and creates a new spawn inside its implementation. -+ */ - public void updateEntity() { - super.updateEntity(); -- if(++this.ticksSinceSync % 20 * 4 == 0) { -+ -+ if (++this.ticksSinceSync % 20 * 4 == 0) { - this.worldObj.addBlockEvent(this.xCoord, this.yCoord, this.zCoord, Block.enderChest.blockID, 1, this.numUsingPlayers); - } - - this.prevLidAngle = this.lidAngle; - float var1 = 0.1F; - double var4; -- if(this.numUsingPlayers > 0 && this.lidAngle == 0.0F) { -+ -+ if (this.numUsingPlayers > 0 && this.lidAngle == 0.0F) { - double var2 = (double)this.xCoord + 0.5D; - var4 = (double)this.zCoord + 0.5D; -- this.worldObj.playSoundEffect(var2, (double)this.yCoord + 0.5D, var4, "random.chestopen", 0.5F, this.worldObj.s.nextFloat() * 0.1F + 0.9F); -+ this.worldObj.playSoundEffect(var2, (double)this.yCoord + 0.5D, var4, "random.chestopen", 0.5F, this.worldObj.rand.nextFloat() * 0.1F + 0.9F); - } - -- if(this.numUsingPlayers == 0 && this.lidAngle > 0.0F || this.numUsingPlayers > 0 && this.lidAngle < 1.0F) { -+ if (this.numUsingPlayers == 0 && this.lidAngle > 0.0F || this.numUsingPlayers > 0 && this.lidAngle < 1.0F) { - float var8 = this.lidAngle; -- if(this.numUsingPlayers > 0) { -+ -+ if (this.numUsingPlayers > 0) { - this.lidAngle += var1; - } else { - this.lidAngle -= var1; - } - -- if(this.lidAngle > 1.0F) { -+ if (this.lidAngle > 1.0F) { - this.lidAngle = 1.0F; - } - - float var3 = 0.5F; -- if(this.lidAngle < var3 && var8 >= var3) { -+ -+ if (this.lidAngle < var3 && var8 >= var3) { - var4 = (double)this.xCoord + 0.5D; - double var6 = (double)this.zCoord + 0.5D; -- this.worldObj.playSoundEffect(var4, (double)this.yCoord + 0.5D, var6, "random.chestclosed", 0.5F, this.worldObj.s.nextFloat() * 0.1F + 0.9F); -+ this.worldObj.playSoundEffect(var4, (double)this.yCoord + 0.5D, var6, "random.chestclosed", 0.5F, this.worldObj.rand.nextFloat() * 0.1F + 0.9F); - } - -- if(this.lidAngle < 0.0F) { -+ if (this.lidAngle < 0.0F) { - this.lidAngle = 0.0F; - } - } -- - } - -- public boolean receiveClientEvent(int var1, int var2) { -- if(var1 == 1) { -- this.numUsingPlayers = var2; -+ /** -+ * Called when a client event is received with the event number and argument, see World.sendClientEvent -+ */ -+ public boolean receiveClientEvent(int par1, int par2) { -+ if (par1 == 1) { -+ this.numUsingPlayers = par2; - return true; - } else { -- return super.receiveClientEvent(var1, var2); -+ return super.receiveClientEvent(par1, par2); - } - } - -+ /** -+ * invalidates a tile entity -+ */ - public void invalidate() { - this.updateContainingBlockInfo(); - super.invalidate(); -@@ -71,7 +92,7 @@ - this.worldObj.addBlockEvent(this.xCoord, this.yCoord, this.zCoord, Block.enderChest.blockID, 1, this.numUsingPlayers); - } - -- public boolean isUseableByPlayer(EntityPlayer var1) { -- return this.worldObj.getBlockTileEntity(this.xCoord, this.yCoord, this.zCoord) != this ? false : var1.getDistanceSq((double)this.xCoord + 0.5D, (double)this.yCoord + 0.5D, (double)this.zCoord + 0.5D) <= 64.0D; -+ public boolean isUseableByPlayer(EntityPlayer par1EntityPlayer) { -+ return this.worldObj.getBlockTileEntity(this.xCoord, this.yCoord, this.zCoord) != this ? false : par1EntityPlayer.getDistanceSq((double)this.xCoord + 0.5D, (double)this.yCoord + 0.5D, (double)this.zCoord + 0.5D) <= 64.0D; - } - } ---- /dev/null -+++ org/spoutcraft/api/Effect.java -@@ -1,0 +1,44 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.api; -+ -+/** -+ * A list of effects that the server is able to send to players. -+ */ -+public enum Effect { -+ BOW_FIRE(1002), -+ CLICK1(1001), -+ CLICK2(1000), -+ DOOR_TOGGLE(1003), -+ EXTINGUISH(1004), -+ RECORD_PLAY(1005), -+ SMOKE(2000), -+ STEP_SOUND(2001); -+ -+ private final int id; -+ -+ Effect(int id) { -+ this.id = id; -+ } -+ -+ public int getId() { -+ return this.id; -+ } -+} ---- net/minecraft/src/ShapedRecipes.java -+++ net/minecraft/src/ShapedRecipes.java -@@ -1,33 +1,46 @@ - package net.minecraft.src; - - public class ShapedRecipes implements IRecipe { -+ -+ /** How many horizontal slots this recipe is wide. */ - private int recipeWidth; -+ -+ /** How many vertical slots this recipe uses. */ - private int recipeHeight; -+ -+ /** Is a array of ItemStack that composes the recipe. */ - private ItemStack[] recipeItems; -+ -+ /** Is the ItemStack that you get when craft the recipe. */ - private ItemStack recipeOutput; -+ -+ /** Is the itemID of the output item that you get when craft the recipe. */ - public final int recipeOutputItemID; - private boolean field_92101_f; - -- public ShapedRecipes(int var1, int var2, ItemStack[] var3, ItemStack var4) { -- this.recipeOutputItemID = var4.itemID; -- this.recipeWidth = var1; -- this.recipeHeight = var2; -- this.recipeItems = var3; -- this.recipeOutput = var4; -+ public ShapedRecipes(int par1, int par2, ItemStack[] par3ArrayOfItemStack, ItemStack par4ItemStack) { -+ this.recipeOutputItemID = par4ItemStack.itemID; -+ this.recipeWidth = par1; -+ this.recipeHeight = par2; -+ this.recipeItems = par3ArrayOfItemStack; -+ this.recipeOutput = par4ItemStack; - } - - public ItemStack getRecipeOutput() { - return this.recipeOutput; - } - -- public boolean matches(InventoryCrafting var1, World var2) { -- for(int var3 = 0; var3 <= 3 - this.recipeWidth; ++var3) { -- for(int var4 = 0; var4 <= 3 - this.recipeHeight; ++var4) { -- if(this.checkMatch(var1, var3, var4, true)) { -+ /** -+ * Used to check if a recipe matches current crafting inventory -+ */ -+ public boolean matches(InventoryCrafting par1InventoryCrafting, World par2World) { -+ for (int var3 = 0; var3 <= 3 - this.recipeWidth; ++var3) { -+ for (int var4 = 0; var4 <= 3 - this.recipeHeight; ++var4) { -+ if (this.checkMatch(par1InventoryCrafting, var3, var4, true)) { - return true; - } - -- if(this.checkMatch(var1, var3, var4, false)) { -+ if (this.checkMatch(par1InventoryCrafting, var3, var4, false)) { - return true; - } - } -@@ -36,31 +49,36 @@ - return false; - } - -- private boolean checkMatch(InventoryCrafting var1, int var2, int var3, boolean var4) { -- for(int var5 = 0; var5 < 3; ++var5) { -- for(int var6 = 0; var6 < 3; ++var6) { -- int var7 = var5 - var2; -- int var8 = var6 - var3; -+ /** -+ * Checks if the region of a crafting inventory is match for the recipe. -+ */ -+ private boolean checkMatch(InventoryCrafting par1InventoryCrafting, int par2, int par3, boolean par4) { -+ for (int var5 = 0; var5 < 3; ++var5) { -+ for (int var6 = 0; var6 < 3; ++var6) { -+ int var7 = var5 - par2; -+ int var8 = var6 - par3; - ItemStack var9 = null; -- if(var7 >= 0 && var8 >= 0 && var7 < this.recipeWidth && var8 < this.recipeHeight) { -- if(var4) { -+ -+ if (var7 >= 0 && var8 >= 0 && var7 < this.recipeWidth && var8 < this.recipeHeight) { -+ if (par4) { - var9 = this.recipeItems[this.recipeWidth - var7 - 1 + var8 * this.recipeWidth]; - } else { - var9 = this.recipeItems[var7 + var8 * this.recipeWidth]; - } - } - -- ItemStack var10 = var1.getStackInRowAndColumn(var5, var6); -- if(var10 != null || var9 != null) { -- if(var10 == null && var9 != null || var10 != null && var9 == null) { -- return false; -- } -- -- if(var9.itemID != var10.itemID) { -- return false; -- } -- -- if(var9.getItemDamage() != Short.MAX_VALUE && var9.getItemDamage() != var10.getItemDamage()) { -+ ItemStack var10 = par1InventoryCrafting.getStackInRowAndColumn(var5, var6); -+ -+ if (var10 != null || var9 != null) { -+ if (var10 == null && var9 != null || var10 != null && var9 == null) { -+ return false; -+ } -+ -+ if (var9.itemID != var10.itemID) { -+ return false; -+ } -+ -+ if (var9.getItemDamage() != 32767 && var9.getItemDamage() != var10.getItemDamage()) { - return false; - } - } -@@ -70,12 +88,17 @@ - return true; - } - -- public ItemStack getCraftingResult(InventoryCrafting var1) { -+ /** -+ * Returns an Item that is the result of this recipe -+ */ -+ public ItemStack getCraftingResult(InventoryCrafting par1InventoryCrafting) { - ItemStack var2 = this.getRecipeOutput().copy(); -- if(this.field_92101_f) { -- for(int var3 = 0; var3 < var1.getSizeInventory(); ++var3) { -- ItemStack var4 = var1.getStackInSlot(var3); -- if(var4 != null && var4.hasTagCompound()) { -+ -+ if (this.field_92101_f) { -+ for (int var3 = 0; var3 < par1InventoryCrafting.getSizeInventory(); ++var3) { -+ ItemStack var4 = par1InventoryCrafting.getStackInSlot(var3); -+ -+ if (var4 != null && var4.hasTagCompound()) { - var2.setTagCompound((NBTTagCompound)var4.stackTagCompound.copy()); - } - } -@@ -84,6 +107,9 @@ - return var2; - } - -+ /** -+ * Returns the size of the recipe area -+ */ - public int getRecipeSize() { - return this.recipeWidth * this.recipeHeight; - } ---- /dev/null -+++ org/spoutcraft/client/player/accessories/Ears.java -@@ -1,0 +1,48 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.client.player.accessories; -+ -+import net.minecraft.src.EntityPlayer; -+import net.minecraft.src.ModelBiped; -+import net.minecraft.src.ModelRenderer; -+ -+public class Ears extends Accessory { -+ public ModelRenderer bipedEars2; -+ -+ public Ears(ModelBiped mb) { -+ super(mb); -+ bipedEars2 = new ModelRenderer(mb, 0, 0); -+ bipedEars2.addBox(-3F, -6F, -1F, 6, 6, 1); -+ } -+ -+ @Override -+ public void render(EntityPlayer plr, float f) { -+ bipedEars2.rotateAngleY = getModel().bipedHead.rotateAngleY; -+ bipedEars2.rotateAngleX = getModel().bipedHead.rotateAngleX; -+ bipedEars2.rotationPointX = 0.0F; -+ bipedEars2.rotationPointY = 0.0F; -+ bipedEars2.render(f); -+ } -+ -+ @Override -+ public AccessoryType getType() { -+ return AccessoryType.EARS; -+ } -+} ---- net/minecraft/src/IntegratedServerListenThread.java -+++ net/minecraft/src/IntegratedServerListenThread.java -@@ -7,30 +7,31 @@ - public class IntegratedServerListenThread extends NetworkListenThread { - private final MemoryConnection netMemoryConnection; - private MemoryConnection theMemoryConnection; -- private String d; -+ private String field_71759_e; - private boolean field_71756_f; - private ServerListenThread myServerListenThread; - -- public IntegratedServerListenThread(IntegratedServer var1) { -- super(var1); -- this.netMemoryConnection = new MemoryConnection(var1.getLogAgent(), (NetHandler)null); -+ public IntegratedServerListenThread(IntegratedServer par1IntegratedServer) throws IOException { -+ super(par1IntegratedServer); -+ this.netMemoryConnection = new MemoryConnection(par1IntegratedServer.getLogAgent(), (NetHandler)null); - } - -- public void func_71754_a(MemoryConnection var1, String var2) { -- this.theMemoryConnection = var1; -- this.d = var2; -+ public void func_71754_a(MemoryConnection par1MemoryConnection, String par2Str) { -+ this.theMemoryConnection = par1MemoryConnection; -+ this.field_71759_e = par2Str; - } - - public String func_71755_c() throws IOException { -- if(this.myServerListenThread == null) { -+ if (this.myServerListenThread == null) { - int var1 = -1; - - try { - var1 = HttpUtil.func_76181_a(); - } catch (IOException var4) { -+ ; - } - -- if(var1 <= 0) { -+ if (var1 <= 0) { - var1 = 25564; - } - -@@ -47,35 +48,42 @@ - - public void stopListening() { - super.stopListening(); -- if(this.myServerListenThread != null) { -+ -+ if (this.myServerListenThread != null) { - this.getIntegratedServer().getLogAgent().logInfo("Stopping server connection"); - this.myServerListenThread.func_71768_b(); - this.myServerListenThread.interrupt(); - this.myServerListenThread = null; - } -- - } - -- public void handleNetworkListenThread() { -- if(this.theMemoryConnection != null) { -- EntityPlayerMP var1 = this.getIntegratedServer().getConfigurationManager().createPlayerForUser(this.d); -- if(var1 != null) { -+ /** -+ * processes packets and pending connections -+ */ -+ public void networkTick() { -+ if (this.theMemoryConnection != null) { -+ EntityPlayerMP var1 = this.getIntegratedServer().getConfigurationManager().createPlayerForUser(this.field_71759_e); -+ -+ if (var1 != null) { - this.netMemoryConnection.pairWith(this.theMemoryConnection); - this.field_71756_f = true; - this.getIntegratedServer().getConfigurationManager().initializeConnectionToPlayer(this.netMemoryConnection, var1); - } - - this.theMemoryConnection = null; -- this.d = null; -+ this.field_71759_e = null; - } - -- if(this.myServerListenThread != null) { -+ if (this.myServerListenThread != null) { - this.myServerListenThread.processPendingConnections(); - } - -- super.handleNetworkListenThread(); -+ super.networkTick(); - } - -+ /** -+ * Gets MinecraftServer instance. -+ */ - public IntegratedServer getIntegratedServer() { - return (IntegratedServer)super.getServer(); - } ---- net/minecraft/src/ServerData.java -+++ net/minecraft/src/ServerData.java -@@ -1,37 +1,56 @@ - package net.minecraft.src; - - public class ServerData { -- public String a; -- public String b; -- public String c; -- public String d; -+ public String serverName; -+ public String serverIP; -+ -+ /** -+ * the string indicating number of players on and capacity of the server that is shown on the server browser (i.e. -+ * "5/20" meaning 5 slots used out of 20 slots total) -+ */ -+ public String populationInfo; -+ -+ /** -+ * (better variable name would be 'hostname') server name as displayed in the server browser's second line (grey text) -+ */ -+ public String serverMOTD; -+ -+ /** last server ping that showed up in the server browser */ - public long pingToServer; - public int field_82821_f = 78; -- public String g = "1.6.4"; -+ -+ /** Game version for this server. */ -+ public String gameVersion = "1.6.4"; - public boolean field_78841_f; - private boolean field_78842_g = true; - private boolean acceptsTextures; -+ -+ /** Whether to hide the IP address for this server. */ - private boolean hideAddress; - -- public ServerData(String var1, String var2) { -- this.a = var1; -- this.b = var2; -+ public ServerData(String par1Str, String par2Str) { -+ this.serverName = par1Str; -+ this.serverIP = par2Str; - } - -+ /** -+ * Returns an NBTTagCompound with the server's name, IP and maybe acceptTextures. -+ */ - public NBTTagCompound getNBTCompound() { - NBTTagCompound var1 = new NBTTagCompound(); -- var1.setString("name", this.a); -- var1.setString("ip", this.b); -+ var1.setString("name", this.serverName); -+ var1.setString("ip", this.serverIP); - var1.setBoolean("hideAddress", this.hideAddress); -- if(!this.field_78842_g) { -+ -+ if (!this.field_78842_g) { - var1.setBoolean("acceptTextures", this.acceptsTextures); - } - - return var1; - } - -- public void setAcceptsTextures(boolean var1) { -- this.acceptsTextures = var1; -+ public void setAcceptsTextures(boolean par1) { -+ this.acceptsTextures = par1; - this.field_78842_g = false; - } - -@@ -39,15 +58,19 @@ - return this.hideAddress; - } - -- public void setHideAddress(boolean var1) { -- this.hideAddress = var1; -+ public void setHideAddress(boolean par1) { -+ this.hideAddress = par1; - } - -- public static ServerData getServerDataFromNBTCompound(NBTTagCompound var0) { -- ServerData var1 = new ServerData(var0.getString("name"), var0.getString("ip")); -- var1.hideAddress = var0.getBoolean("hideAddress"); -- if(var0.hasKey("acceptTextures")) { -- var1.setAcceptsTextures(var0.getBoolean("acceptTextures")); -+ /** -+ * Takes an NBTTagCompound with 'name' and 'ip' keys, returns a ServerData instance. -+ */ -+ public static ServerData getServerDataFromNBTCompound(NBTTagCompound par0NBTTagCompound) { -+ ServerData var1 = new ServerData(par0NBTTagCompound.getString("name"), par0NBTTagCompound.getString("ip")); -+ var1.hideAddress = par0NBTTagCompound.getBoolean("hideAddress"); -+ -+ if (par0NBTTagCompound.hasKey("acceptTextures")) { -+ var1.setAcceptsTextures(par0NBTTagCompound.getBoolean("acceptTextures")); - } - - return var1; ---- /dev/null -+++ org/spoutcraft/api/packet/PacketUtil.java -@@ -1,0 +1,130 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.api.packet; -+ -+import java.io.DataInputStream; -+import java.io.DataOutputStream; -+import java.io.IOException; -+ -+import org.spoutcraft.api.io.SpoutInputStream; -+ -+public abstract class PacketUtil { -+ public static int[] readIntArray(SpoutInputStream input) throws IOException { -+ int length = input.readInt(); -+ if (length > 256) { -+ throw new IllegalArgumentException("Int array exceeded max length (" + length + ")"); -+ } -+ int[] newArray = new int[length]; -+ for (int i = 0; i < length; i++) { -+ newArray[i] = input.readInt(); -+ } -+ return newArray; -+ } -+ -+ public static int[] readIntArray(DataInputStream input) throws IOException { -+ int length = input.readInt(); -+ if (length > 256) { -+ throw new IllegalArgumentException("Int array exceeded max length (" + length + ")"); -+ } -+ int[] newArray = new int[length]; -+ for (int i = 0; i < length; i++) { -+ newArray[i] = input.readInt(); -+ } -+ return newArray; -+ } -+ -+ public static float[] readQuadFloat(SpoutInputStream input) throws IOException { -+ float[] newArray = new float[4]; -+ for (int i = 0; i < 4; i++) { -+ newArray[i] = input.readFloat(); -+ } -+ return newArray; -+ } -+ -+ public static float[] readQuadFloat(DataInputStream input) throws IOException { -+ float[] newArray = new float[4]; -+ for (int i = 0; i < 4; i++) { -+ newArray[i] = input.readFloat(); -+ } -+ return newArray; -+ } -+ -+ public static int getDoubleArrayLength(float[][] doubleArray) { -+ return doubleArray.length * 16; -+ } -+ -+ public static float[][] readDoubleArray(SpoutInputStream input) throws IOException { -+ int length = input.readShort(); -+ if (length > 256) { -+ throw new IllegalArgumentException("Double array exceeded max length (" + length + ")"); -+ } -+ float[][] newDoubleArray = new float[length][]; -+ for (int i = 0; i < length; i++) { -+ newDoubleArray[i] = readQuadFloat(input); -+ } -+ return newDoubleArray; -+ } -+ -+ public static float[][] readDoubleArray(DataInputStream input) throws IOException { -+ int length = input.readShort(); -+ if (length > 256) { -+ throw new IllegalArgumentException("Double array exceeded max length (" + length + ")"); -+ } -+ float[][] newDoubleArray = new float[length][]; -+ for (int i = 0; i < length; i++) { -+ newDoubleArray[i] = readQuadFloat(input); -+ } -+ return newDoubleArray; -+ } -+ -+ public static void writeIntArray(DataOutputStream output, int[] ints) throws IOException { -+ if (ints.length > 256) { -+ throw new IllegalArgumentException("Array containing " + ints.length + " ints passed to writeQuadFloat"); -+ } -+ output.writeInt(ints.length); -+ for (int i = 0; i < ints.length; i++) { -+ output.writeInt(ints[i]); -+ } -+ } -+ -+ public static void writeString(DataOutputStream output, String string) throws IOException { -+ byte[] data = string.getBytes("UTF-8"); -+ output.writeInt(data.length); -+ output.write(data); -+ } -+ -+ public static String readString(DataInputStream input) throws IOException { -+ int length= input.readInt(); -+ byte[] data=new byte[length]; -+ input.readFully(data); -+ String string = new String(data,"UTF-8"); -+ -+ return string; -+ } -+ -+ public static String readString(SpoutInputStream input) throws IOException { -+ int length = input.readInt(); -+ byte[] data = new byte[length]; -+ input.read(data); -+ String string = new String(data,"UTF-8"); -+ -+ return string; -+ } -+} ---- net/minecraft/src/EntityFallingSand.java -+++ net/minecraft/src/EntityFallingSand.java -@@ -6,74 +6,91 @@ - public class EntityFallingSand extends Entity { - public int blockID; - public int metadata; -+ -+ /** How long the block has been falling for. */ - public int fallTime; - public boolean shouldDropItem; - private boolean isBreakingAnvil; - private boolean isAnvil; -+ -+ /** Maximum amount of damage dealt to entities hit by falling block */ - private int fallHurtMax; -+ -+ /** Actual damage dealt to entities hit by falling block */ - private float fallHurtAmount; - public NBTTagCompound fallingBlockTileEntityData; - -- public EntityFallingSand(World var1) { -- super(var1); -- this.shouldDropItem = true; -- this.fallHurtMax = 40; -- this.fallHurtAmount = 2.0F; -- } -- -- public EntityFallingSand(World var1, double var2, double var4, double var6, int var8) { -- this(var1, var2, var4, var6, var8, 0); -- } -- -- public EntityFallingSand(World var1, double var2, double var4, double var6, int var8, int var9) { -- super(var1); -- this.shouldDropItem = true; -- this.fallHurtMax = 40; -- this.fallHurtAmount = 2.0F; -- this.blockID = var8; -- this.metadata = var9; -+ public EntityFallingSand(World par1World) { -+ super(par1World); -+ this.shouldDropItem = true; -+ this.fallHurtMax = 40; -+ this.fallHurtAmount = 2.0F; -+ } -+ -+ public EntityFallingSand(World par1World, double par2, double par4, double par6, int par8) { -+ this(par1World, par2, par4, par6, par8, 0); -+ } -+ -+ public EntityFallingSand(World par1World, double par2, double par4, double par6, int par8, int par9) { -+ super(par1World); -+ this.shouldDropItem = true; -+ this.fallHurtMax = 40; -+ this.fallHurtAmount = 2.0F; -+ this.blockID = par8; -+ this.metadata = par9; - this.preventEntitySpawning = true; - this.setSize(0.98F, 0.98F); - this.yOffset = this.height / 2.0F; -- this.setPosition(var2, var4, var6); -+ this.setPosition(par2, par4, par6); - this.motionX = 0.0D; - this.motionY = 0.0D; - this.motionZ = 0.0D; -- this.prevPosX = var2; -- this.prevPosY = var4; -- this.prevPosZ = var6; -+ this.prevPosX = par2; -+ this.prevPosY = par4; -+ this.prevPosZ = par6; - } - -+ /** -+ * returns if this entity triggers Block.onEntityWalking on the blocks they walk on. used for spiders and wolves to -+ * prevent them from trampling crops -+ */ - protected boolean canTriggerWalking() { - return false; - } - -- protected void entityInit() { -- } -+ protected void entityInit() {} - -+ /** -+ * Returns true if other Entities should be prevented from moving through this Entity. -+ */ - public boolean canBeCollidedWith() { - return !this.isDead; - } - -+ /** -+ * Called to update the entity's position/logic. -+ */ - public void onUpdate() { -- if(this.blockID == 0) { -+ if (this.blockID == 0) { - this.setDead(); - } else { - this.prevPosX = this.posX; - this.prevPosY = this.posY; - this.prevPosZ = this.posZ; - ++this.fallTime; -- this.motionY -= (double)0.04F; -+ this.motionY -= 0.03999999910593033D; - this.moveEntity(this.motionX, this.motionY, this.motionZ); -- this.motionX *= (double)0.98F; -- this.motionY *= (double)0.98F; -- this.motionZ *= (double)0.98F; -- if(!this.worldObj.isRemote) { -+ this.motionX *= 0.9800000190734863D; -+ this.motionY *= 0.9800000190734863D; -+ this.motionZ *= 0.9800000190734863D; -+ -+ if (!this.worldObj.isRemote) { - int var1 = MathHelper.floor_double(this.posX); - int var2 = MathHelper.floor_double(this.posY); - int var3 = MathHelper.floor_double(this.posZ); -- if(this.fallTime == 1) { -- if(this.worldObj.getBlockId(var1, var2, var3) != this.blockID) { -+ -+ if (this.fallTime == 1) { -+ if (this.worldObj.getBlockId(var1, var2, var3) != this.blockID) { - this.setDead(); - return; - } -@@ -81,27 +98,31 @@ - this.worldObj.setBlockToAir(var1, var2, var3); - } - -- if(this.onGround) { -- this.motionX *= (double)0.7F; -- this.motionZ *= (double)0.7F; -+ if (this.onGround) { -+ this.motionX *= 0.699999988079071D; -+ this.motionZ *= 0.699999988079071D; - this.motionY *= -0.5D; -- if(this.worldObj.getBlockId(var1, var2, var3) != Block.pistonMoving.blockID) { -+ -+ if (this.worldObj.getBlockId(var1, var2, var3) != Block.pistonMoving.blockID) { - this.setDead(); -- if(!this.isBreakingAnvil && this.worldObj.canPlaceEntityOnSide(this.blockID, var1, var2, var3, true, 1, (Entity)null, (ItemStack)null) && !BlockSand.canFallBelow(this.worldObj, var1, var2 - 1, var3) && this.worldObj.setBlock(var1, var2, var3, this.blockID, this.metadata, 3)) { -- if(Block.blocksList[this.blockID] instanceof BlockSand) { -+ -+ if (!this.isBreakingAnvil && this.worldObj.canPlaceEntityOnSide(this.blockID, var1, var2, var3, true, 1, (Entity)null, (ItemStack)null) && !BlockSand.canFallBelow(this.worldObj, var1, var2 - 1, var3) && this.worldObj.setBlock(var1, var2, var3, this.blockID, this.metadata, 3)) { -+ if (Block.blocksList[this.blockID] instanceof BlockSand) { - ((BlockSand)Block.blocksList[this.blockID]).onFinishFalling(this.worldObj, var1, var2, var3, this.metadata); - } - -- if(this.fallingBlockTileEntityData != null && Block.blocksList[this.blockID] instanceof ITileEntityProvider) { -+ if (this.fallingBlockTileEntityData != null && Block.blocksList[this.blockID] instanceof ITileEntityProvider) { - TileEntity var4 = this.worldObj.getBlockTileEntity(var1, var2, var3); -- if(var4 != null) { -+ -+ if (var4 != null) { - NBTTagCompound var5 = new NBTTagCompound(); - var4.writeToNBT(var5); - Iterator var6 = this.fallingBlockTileEntityData.getTags().iterator(); - -- while(var6.hasNext()) { -+ while (var6.hasNext()) { - NBTBase var7 = (NBTBase)var6.next(); -- if(!var7.getName().equals("x") && !var7.getName().equals("y") && !var7.getName().equals("z")) { -+ -+ if (!var7.getName().equals("x") && !var7.getName().equals("y") && !var7.getName().equals("z")) { - var5.setTag(var7.getName(), var7.copy()); - } - } -@@ -110,40 +131,44 @@ - var4.onInventoryChanged(); - } - } -- } else if(this.shouldDropItem && !this.isBreakingAnvil) { -+ } else if (this.shouldDropItem && !this.isBreakingAnvil) { - this.entityDropItem(new ItemStack(this.blockID, 1, Block.blocksList[this.blockID].damageDropped(this.metadata)), 0.0F); - } - } -- } else if(this.fallTime > 100 && !this.worldObj.isRemote && (var2 < 1 || var2 > 256) || this.fallTime > 600) { -- if(this.shouldDropItem) { -+ } else if (this.fallTime > 100 && !this.worldObj.isRemote && (var2 < 1 || var2 > 256) || this.fallTime > 600) { -+ if (this.shouldDropItem) { - this.entityDropItem(new ItemStack(this.blockID, 1, Block.blocksList[this.blockID].damageDropped(this.metadata)), 0.0F); - } - - this.setDead(); - } - } -- - } - } - -- protected void fall(float var1) { -- if(this.isAnvil) { -- int var2 = MathHelper.ceiling_float_int(var1 - 1.0F); -- if(var2 > 0) { -+ /** -+ * Called when the mob is falling. Calculates and applies fall damage. -+ */ -+ protected void fall(float par1) { -+ if (this.isAnvil) { -+ int var2 = MathHelper.ceiling_float_int(par1 - 1.0F); -+ -+ if (var2 > 0) { - ArrayList var3 = new ArrayList(this.worldObj.getEntitiesWithinAABBExcludingEntity(this, this.boundingBox)); - DamageSource var4 = this.blockID == Block.anvil.blockID ? DamageSource.anvil : DamageSource.fallingBlock; - Iterator var5 = var3.iterator(); - -- while(var5.hasNext()) { -+ while (var5.hasNext()) { - Entity var6 = (Entity)var5.next(); - var6.attackEntityFrom(var4, (float)Math.min(MathHelper.floor_float((float)var2 * this.fallHurtAmount), this.fallHurtMax)); - } - -- if(this.blockID == Block.anvil.blockID && (double)this.ab.nextFloat() < (double)0.05F + (double)var2 * 0.05D) { -+ if (this.blockID == Block.anvil.blockID && (double)this.rand.nextFloat() < 0.05000000074505806D + (double)var2 * 0.05D) { - int var7 = this.metadata >> 2; - int var8 = this.metadata & 3; - ++var7; -- if(var7 > 2) { -+ -+ if (var7 > 2) { - this.isBreakingAnvil = true; - } else { - this.metadata = var8 | var7 << 2; -@@ -151,53 +176,58 @@ - } - } - } -- - } - -- protected void writeEntityToNBT(NBTTagCompound var1) { -- var1.setByte("Tile", (byte)this.blockID); -- var1.setInteger("TileID", this.blockID); -- var1.setByte("Data", (byte)this.metadata); -- var1.setByte("Time", (byte)this.fallTime); -- var1.setBoolean("DropItem", this.shouldDropItem); -- var1.setBoolean("HurtEntities", this.isAnvil); -- var1.setFloat("FallHurtAmount", this.fallHurtAmount); -- var1.setInteger("FallHurtMax", this.fallHurtMax); -- if(this.fallingBlockTileEntityData != null) { -- var1.setCompoundTag("TileEntityData", this.fallingBlockTileEntityData); -+ /** -+ * (abstract) Protected helper method to write subclass entity data to NBT. -+ */ -+ protected void writeEntityToNBT(NBTTagCompound par1NBTTagCompound) { -+ par1NBTTagCompound.setByte("Tile", (byte)this.blockID); -+ par1NBTTagCompound.setInteger("TileID", this.blockID); -+ par1NBTTagCompound.setByte("Data", (byte)this.metadata); -+ par1NBTTagCompound.setByte("Time", (byte)this.fallTime); -+ par1NBTTagCompound.setBoolean("DropItem", this.shouldDropItem); -+ par1NBTTagCompound.setBoolean("HurtEntities", this.isAnvil); -+ par1NBTTagCompound.setFloat("FallHurtAmount", this.fallHurtAmount); -+ par1NBTTagCompound.setInteger("FallHurtMax", this.fallHurtMax); -+ -+ if (this.fallingBlockTileEntityData != null) { -+ par1NBTTagCompound.setCompoundTag("TileEntityData", this.fallingBlockTileEntityData); - } -- - } - -- protected void readEntityFromNBT(NBTTagCompound var1) { -- if(var1.hasKey("TileID")) { -- this.blockID = var1.getInteger("TileID"); -+ /** -+ * (abstract) Protected helper method to read subclass entity data from NBT. -+ */ -+ protected void readEntityFromNBT(NBTTagCompound par1NBTTagCompound) { -+ if (par1NBTTagCompound.hasKey("TileID")) { -+ this.blockID = par1NBTTagCompound.getInteger("TileID"); - } else { -- this.blockID = var1.getByte("Tile") & 255; -+ this.blockID = par1NBTTagCompound.getByte("Tile") & 255; - } - -- this.metadata = var1.getByte("Data") & 255; -- this.fallTime = var1.getByte("Time") & 255; -- if(var1.hasKey("HurtEntities")) { -- this.isAnvil = var1.getBoolean("HurtEntities"); -- this.fallHurtAmount = var1.getFloat("FallHurtAmount"); -- this.fallHurtMax = var1.getInteger("FallHurtMax"); -- } else if(this.blockID == Block.anvil.blockID) { -+ this.metadata = par1NBTTagCompound.getByte("Data") & 255; -+ this.fallTime = par1NBTTagCompound.getByte("Time") & 255; -+ -+ if (par1NBTTagCompound.hasKey("HurtEntities")) { -+ this.isAnvil = par1NBTTagCompound.getBoolean("HurtEntities"); -+ this.fallHurtAmount = par1NBTTagCompound.getFloat("FallHurtAmount"); -+ this.fallHurtMax = par1NBTTagCompound.getInteger("FallHurtMax"); -+ } else if (this.blockID == Block.anvil.blockID) { - this.isAnvil = true; - } - -- if(var1.hasKey("DropItem")) { -- this.shouldDropItem = var1.getBoolean("DropItem"); -- } -- -- if(var1.hasKey("TileEntityData")) { -- this.fallingBlockTileEntityData = var1.getCompoundTag("TileEntityData"); -- } -- -- if(this.blockID == 0) { -+ if (par1NBTTagCompound.hasKey("DropItem")) { -+ this.shouldDropItem = par1NBTTagCompound.getBoolean("DropItem"); -+ } -+ -+ if (par1NBTTagCompound.hasKey("TileEntityData")) { -+ this.fallingBlockTileEntityData = par1NBTTagCompound.getCompoundTag("TileEntityData"); -+ } -+ -+ if (this.blockID == 0) { - this.blockID = Block.sand.blockID; - } -- - } - - public float getShadowSize() { -@@ -208,17 +238,20 @@ - return this.worldObj; - } - -- public void setIsAnvil(boolean var1) { -- this.isAnvil = var1; -+ public void setIsAnvil(boolean par1) { -+ this.isAnvil = par1; - } - -+ /** -+ * Return whether this entity should be rendered as on fire. -+ */ - public boolean canRenderOnFire() { - return false; - } - -- public void addEntityCrashInfo(CrashReportCategory var1) { -- super.addEntityCrashInfo(var1); -- var1.addCrashSection("Immitating block ID", Integer.valueOf(this.blockID)); -- var1.addCrashSection("Immitating block data", Integer.valueOf(this.metadata)); -+ public void addEntityCrashInfo(CrashReportCategory par1CrashReportCategory) { -+ super.addEntityCrashInfo(par1CrashReportCategory); -+ par1CrashReportCategory.addCrashSection("Immitating block ID", Integer.valueOf(this.blockID)); -+ par1CrashReportCategory.addCrashSection("Immitating block data", Integer.valueOf(this.metadata)); - } - } ---- net/minecraft/src/ComponentStrongholdPrison.java -+++ net/minecraft/src/ComponentStrongholdPrison.java -@@ -4,44 +4,50 @@ - import java.util.Random; - - public class ComponentStrongholdPrison extends ComponentStronghold { -- public ComponentStrongholdPrison() { -- } -- -- public ComponentStrongholdPrison(int var1, Random var2, StructureBoundingBox var3, int var4) { -- super(var1); -- this.coordBaseMode = var4; -- this.field_143013_d = this.getRandomDoor(var2); -- this.boundingBox = var3; -- } -- -- public void buildComponent(StructureComponent var1, List var2, Random var3) { -- this.getNextComponentNormal((ComponentStrongholdStairs2)var1, var2, var3, 1, 1); -- } -- -- public static ComponentStrongholdPrison findValidPlacement(List var0, Random var1, int var2, int var3, int var4, int var5, int var6) { -- StructureBoundingBox var7 = StructureBoundingBox.getComponentToAddBoundingBox(var2, var3, var4, -1, -1, 0, 9, 5, 11, var5); -- return canStrongholdGoDeeper(var7) && StructureComponent.findIntersecting(var0, var7) == null ? new ComponentStrongholdPrison(var6, var1, var7, var5) : null; -- } -- -- public boolean addComponentParts(World var1, Random var2, StructureBoundingBox var3) { -- if(this.isLiquidInStructureBoundingBox(var1, var3)) { -+ public ComponentStrongholdPrison() {} -+ -+ public ComponentStrongholdPrison(int par1, Random par2Random, StructureBoundingBox par3StructureBoundingBox, int par4) { -+ super(par1); -+ this.coordBaseMode = par4; -+ this.field_143013_d = this.getRandomDoor(par2Random); -+ this.boundingBox = par3StructureBoundingBox; -+ } -+ -+ /** -+ * Initiates construction of the Structure Component picked, at the current Location of StructGen -+ */ -+ public void buildComponent(StructureComponent par1StructureComponent, List par2List, Random par3Random) { -+ this.getNextComponentNormal((ComponentStrongholdStairs2)par1StructureComponent, par2List, par3Random, 1, 1); -+ } -+ -+ public static ComponentStrongholdPrison findValidPlacement(List par0List, Random par1Random, int par2, int par3, int par4, int par5, int par6) { -+ StructureBoundingBox var7 = StructureBoundingBox.getComponentToAddBoundingBox(par2, par3, par4, -1, -1, 0, 9, 5, 11, par5); -+ return canStrongholdGoDeeper(var7) && StructureComponent.findIntersecting(par0List, var7) == null ? new ComponentStrongholdPrison(par6, par1Random, var7, par5) : null; -+ } -+ -+ /** -+ * second Part of Structure generating, this for example places Spiderwebs, Mob Spawners, it closes Mineshafts at the -+ * end, it adds Fences... -+ */ -+ public boolean addComponentParts(World par1World, Random par2Random, StructureBoundingBox par3StructureBoundingBox) { -+ if (this.isLiquidInStructureBoundingBox(par1World, par3StructureBoundingBox)) { - return false; - } else { -- this.fillWithRandomizedBlocks(var1, var3, 0, 0, 0, 8, 4, 10, true, var2, StructureStrongholdPieces.getStrongholdStones()); -- this.placeDoor(var1, var2, var3, this.field_143013_d, 1, 1, 0); -- this.fillWithBlocks(var1, var3, 1, 1, 10, 3, 3, 10, 0, 0, false); -- this.fillWithRandomizedBlocks(var1, var3, 4, 1, 1, 4, 3, 1, false, var2, StructureStrongholdPieces.getStrongholdStones()); -- this.fillWithRandomizedBlocks(var1, var3, 4, 1, 3, 4, 3, 3, false, var2, StructureStrongholdPieces.getStrongholdStones()); -- this.fillWithRandomizedBlocks(var1, var3, 4, 1, 7, 4, 3, 7, false, var2, StructureStrongholdPieces.getStrongholdStones()); -- this.fillWithRandomizedBlocks(var1, var3, 4, 1, 9, 4, 3, 9, false, var2, StructureStrongholdPieces.getStrongholdStones()); -- this.fillWithBlocks(var1, var3, 4, 1, 4, 4, 3, 6, Block.fenceIron.blockID, Block.fenceIron.blockID, false); -- this.fillWithBlocks(var1, var3, 5, 1, 5, 7, 3, 5, Block.fenceIron.blockID, Block.fenceIron.blockID, false); -- this.placeBlockAtCurrentPosition(var1, Block.fenceIron.blockID, 0, 4, 3, 2, var3); -- this.placeBlockAtCurrentPosition(var1, Block.fenceIron.blockID, 0, 4, 3, 8, var3); -- this.placeBlockAtCurrentPosition(var1, Block.doorIron.blockID, this.getMetadataWithOffset(Block.doorIron.blockID, 3), 4, 1, 2, var3); -- this.placeBlockAtCurrentPosition(var1, Block.doorIron.blockID, this.getMetadataWithOffset(Block.doorIron.blockID, 3) + 8, 4, 2, 2, var3); -- this.placeBlockAtCurrentPosition(var1, Block.doorIron.blockID, this.getMetadataWithOffset(Block.doorIron.blockID, 3), 4, 1, 8, var3); -- this.placeBlockAtCurrentPosition(var1, Block.doorIron.blockID, this.getMetadataWithOffset(Block.doorIron.blockID, 3) + 8, 4, 2, 8, var3); -+ this.fillWithRandomizedBlocks(par1World, par3StructureBoundingBox, 0, 0, 0, 8, 4, 10, true, par2Random, StructureStrongholdPieces.getStrongholdStones()); -+ this.placeDoor(par1World, par2Random, par3StructureBoundingBox, this.field_143013_d, 1, 1, 0); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 1, 1, 10, 3, 3, 10, 0, 0, false); -+ this.fillWithRandomizedBlocks(par1World, par3StructureBoundingBox, 4, 1, 1, 4, 3, 1, false, par2Random, StructureStrongholdPieces.getStrongholdStones()); -+ this.fillWithRandomizedBlocks(par1World, par3StructureBoundingBox, 4, 1, 3, 4, 3, 3, false, par2Random, StructureStrongholdPieces.getStrongholdStones()); -+ this.fillWithRandomizedBlocks(par1World, par3StructureBoundingBox, 4, 1, 7, 4, 3, 7, false, par2Random, StructureStrongholdPieces.getStrongholdStones()); -+ this.fillWithRandomizedBlocks(par1World, par3StructureBoundingBox, 4, 1, 9, 4, 3, 9, false, par2Random, StructureStrongholdPieces.getStrongholdStones()); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 4, 1, 4, 4, 3, 6, Block.fenceIron.blockID, Block.fenceIron.blockID, false); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 5, 1, 5, 7, 3, 5, Block.fenceIron.blockID, Block.fenceIron.blockID, false); -+ this.placeBlockAtCurrentPosition(par1World, Block.fenceIron.blockID, 0, 4, 3, 2, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.fenceIron.blockID, 0, 4, 3, 8, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.doorIron.blockID, this.getMetadataWithOffset(Block.doorIron.blockID, 3), 4, 1, 2, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.doorIron.blockID, this.getMetadataWithOffset(Block.doorIron.blockID, 3) + 8, 4, 2, 2, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.doorIron.blockID, this.getMetadataWithOffset(Block.doorIron.blockID, 3), 4, 1, 8, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.doorIron.blockID, this.getMetadataWithOffset(Block.doorIron.blockID, 3) + 8, 4, 2, 8, par3StructureBoundingBox); - return true; - } - } ---- /dev/null -+++ org/spoutcraft/client/HDImageBufferDownload.java -@@ -1,0 +1,94 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.client; -+ -+import java.awt.Graphics; -+import java.awt.image.BufferedImage; -+import java.awt.image.DataBufferInt; -+ -+import net.minecraft.src.IImageBuffer; -+ -+public class HDImageBufferDownload implements IImageBuffer { -+ private int imageData[]; -+ private int imageWidth; -+ private int imageHeight; -+ -+ public BufferedImage parseUserSkin(BufferedImage image) { -+ if (image == null) { -+ return null; -+ } -+ -+ try { -+ imageWidth = Math.max(64, image.getWidth(null)); -+ imageHeight = imageWidth / 2; -+ BufferedImage bufferedimage1 = new BufferedImage(imageWidth, imageHeight, 2); -+ Graphics g = bufferedimage1.getGraphics(); -+ g.drawImage(image, 0, 0, null); -+ g.dispose(); -+ imageData = ((DataBufferInt)bufferedimage1.getRaster().getDataBuffer()).getData(); -+ func_884_b(0, 0, imageWidth / 2, imageHeight / 2); -+ func_885_a(imageWidth / 2, 0, imageWidth, imageHeight); -+ func_884_b(0, imageHeight / 2, imageWidth, imageHeight); -+ -+ for (int i = 0; i < imageData.length; i++) { -+ imageData[i] &= 0xFFFFFF; -+ } -+ } -+ catch (Exception e) { -+ return null; -+ } -+ -+ return image; -+ } -+ -+ private void func_885_a(int par1, int par2, int par3, int par4) { -+ if (func_886_c(par1, par2, par3, par4)) { -+ return; -+ } -+ -+ for (int i = par1; i < par3; i++) { -+ for (int j = par2; j < par4; j++) { -+ imageData[i + j * imageWidth] &= 0xffffff; -+ } -+ } -+ } -+ -+ private void func_884_b(int par1, int par2, int par3, int par4) { -+ for (int i = par1; i < par3; i++) { -+ for (int j = par2; j < par4; j++) { -+ imageData[i + j * imageWidth] |= 0x00000000; -+ } -+ } -+ } -+ -+ private boolean func_886_c(int par1, int par2, int par3, int par4) { -+ for (int i = par1; i < par3; i++) { -+ for (int j = par2; j < par4; j++) { -+ int k = imageData[i + j * imageWidth]; -+ -+ if ((k >> 24 & 0xff) < 128) { -+ return true; -+ } -+ } -+ } -+ -+ return false; -+ } -+} ---- /dev/null -+++ org/spoutcraft/client/controls/GuiAmbigousInput.java -@@ -1,0 +1,177 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.client.controls; -+ -+import java.util.ArrayList; -+import java.util.Timer; -+import java.util.TimerTask; -+ -+import net.minecraft.src.GuiScreen; -+import net.minecraft.src.Item; -+ -+import org.spoutcraft.api.ChatColor; -+import org.spoutcraft.api.Spoutcraft; -+import org.spoutcraft.api.gui.Button; -+import org.spoutcraft.api.gui.GenericButton; -+import org.spoutcraft.api.gui.GenericLabel; -+import org.spoutcraft.api.gui.GenericListWidget; -+import org.spoutcraft.api.gui.Label; -+import org.spoutcraft.api.gui.ListWidget; -+import org.spoutcraft.api.gui.ListWidgetItem; -+import org.spoutcraft.api.gui.RenderUtil; -+import org.spoutcraft.api.keyboard.AbstractBinding; -+import org.spoutcraft.client.gui.GuiSpoutScreen; -+import org.spoutcraft.client.gui.ScreenUtil; -+ -+public class GuiAmbigousInput extends GuiSpoutScreen { -+ private Label title; -+ private Button buttonCancel; -+ private GenericListWidget list; -+ protected GuiScreen parent; -+ private ArrayList bindings; -+ private AbstractBinding pressed = null; -+ -+ public GuiAmbigousInput(ArrayList bindings, GuiScreen parent) { -+ this.parent = parent; -+ this.bindings = bindings; -+ } -+ -+ protected void createInstances() { -+ title = new GenericLabel("Ambigous bindings\n" + ChatColor.GRAY + "The key you pressed has multiple bindings assigned.\n" + ChatColor.GRAY + "Please choose which action you want to summon."); -+ buttonCancel = new GenericButton("Cancel"); -+ list = new GenericListWidget(); -+ -+ int i = 1; -+ for (AbstractBinding binding:bindings) { -+ list.addItem(new BindingItem(i, binding)); -+ i++; -+ } -+ -+ getScreen().attachWidgets("Spoutcraft", title, buttonCancel, list); -+ } -+ -+ protected void layoutWidgets() { -+ int swidth = mc.fontRenderer.getStringWidth(title.getText()); -+ title.setGeometry(5, 7, width - 10, 0); -+ int top = 5 + 11 * 3 + 5; -+ -+ list.setGeometry(5, top, width - 10, height - top - 30); -+ -+ top += list.getHeight(); -+ -+ buttonCancel.setGeometry(width - 205, top + 5, 200, 20); -+ -+ list.setFocus(true); -+ list.setSelection(0); -+ } -+ -+ @Override -+ protected void keyTyped(char var1, int var2) { -+ super.keyTyped(var1, var2); -+ try { -+ int i = Integer.valueOf(var1 + ""); -+ if (i == 0) { -+ i = 10; -+ } -+ if (bindings.size() >= i) { -+ AbstractBinding binding = bindings.get(i - 1); -+ summon(binding); -+ } -+ } catch(IllegalArgumentException e) {} -+ } -+ -+ @Override -+ public void buttonClicked(Button btn) { -+ if (btn == buttonCancel) { -+ mc.displayGuiScreen(parent); -+ } -+ } -+ -+ public class BindingItem implements ListWidgetItem { -+ private AbstractBinding binding; -+ private int index; -+ -+ public BindingItem(int index, AbstractBinding binding) { -+ this.binding = binding; -+ this.index = index; -+ } -+ -+ public void setListWidget(ListWidget widget) { -+ // TODO Auto-generated method stub -+ -+ } -+ -+ public ListWidget getListWidget() { -+ // TODO Auto-generated method stub -+ return null; -+ } -+ -+ public int getHeight() { -+ return 13; -+ } -+ -+ public void render(int x, int y, int width, int height) { -+ if (index <= 10) { -+ if (pressed != binding) { -+ RenderUtil.drawRectangle(x + 1, y + 1, x + 12, y + 12, 0xff888888); -+ RenderUtil.drawGradientRectangle(x + 2, y + 2, x + 11, y + 11, 0xffffffff, 0xffaaaaaa); -+ mc.fontRenderer.drawString(index + "", x + 4, y + 3, 0xff333333); -+ } else { -+ RenderUtil.drawRectangle(x + 1, y + 1, x + 12, y + 12, 0xff333333); -+ RenderUtil.drawGradientRectangle(x + 2, y + 2, x + 11, y + 11, 0xff666666, 0xffaaaaaa); -+ mc.fontRenderer.drawString(index + "", x + 4, y + 3, 0xff000000); -+ } -+ } -+ mc.fontRenderer.drawString(binding.getTitle(), x + 15, y + 3, 0xffffffff); -+ } -+ -+ public void onClick(int x, int y, boolean doubleClick) { -+ if (x == -1 && y == -1 && !doubleClick) { -+ return; -+ } -+ summon(binding); -+ if (!doubleClick) { -+ Spoutcraft.getActivePlayer().showAchievement(ChatColor.WHITE + "You can use 1-9", "on your keyboard too", Item.book.itemID); -+ } -+ } -+ -+ public AbstractBinding getBinding() { -+ return binding; -+ } -+ -+ } -+ -+ protected void summon(final AbstractBinding binding) { -+ if (pressed != null) { -+ return; -+ } -+ Timer t = new Timer(); -+ TimerTask task = new TimerTask() { -+ @Override -+ public void run() { -+ mc.displayGuiScreen(parent); -+ binding.summon(binding.getKey(), false, ScreenUtil.getType(parent).getCode()); -+ binding.summon(binding.getKey(), true, ScreenUtil.getType(parent).getCode()); -+ } -+ }; -+ t.schedule(task, 200); -+ pressed = binding; -+ } -+} ---- net/minecraft/src/EnchantmentData.java -+++ net/minecraft/src/EnchantmentData.java -@@ -1,16 +1,20 @@ - package net.minecraft.src; - - public class EnchantmentData extends WeightedRandomItem { -+ -+ /** Enchantment object associated with this EnchantmentData */ - public final Enchantment enchantmentobj; -+ -+ /** Enchantment level associated with this EnchantmentData */ - public final int enchantmentLevel; - -- public EnchantmentData(Enchantment var1, int var2) { -- super(var1.getWeight()); -- this.enchantmentobj = var1; -- this.enchantmentLevel = var2; -+ public EnchantmentData(Enchantment par1Enchantment, int par2) { -+ super(par1Enchantment.getWeight()); -+ this.enchantmentobj = par1Enchantment; -+ this.enchantmentLevel = par2; - } - -- public EnchantmentData(int var1, int var2) { -- this(Enchantment.enchantmentsList[var1], var2); -+ public EnchantmentData(int par1, int par2) { -+ this(Enchantment.enchantmentsList[par1], par2); - } - } ---- net/minecraft/src/EntityCloudFX.java -+++ net/minecraft/src/EntityCloudFX.java -@@ -3,17 +3,17 @@ - public class EntityCloudFX extends EntityFX { - float field_70569_a; - -- public EntityCloudFX(World var1, double var2, double var4, double var6, double var8, double var10, double var12) { -- super(var1, var2, var4, var6, 0.0D, 0.0D, 0.0D); -+ public EntityCloudFX(World par1World, double par2, double par4, double par6, double par8, double par10, double par12) { -+ super(par1World, par2, par4, par6, 0.0D, 0.0D, 0.0D); - float var14 = 2.5F; -- this.motionX *= (double)0.1F; -- this.motionY *= (double)0.1F; -- this.motionZ *= (double)0.1F; -- this.motionX += var8; -- this.motionY += var10; -- this.motionZ += var12; -- this.particleRed = this.particleGreen = this.particleBlue = 1.0F - (float)(Math.random() * (double)0.3F); -- this.particleScale *= 12.0F / 16.0F; -+ this.motionX *= 0.10000000149011612D; -+ this.motionY *= 0.10000000149011612D; -+ this.motionZ *= 0.10000000149011612D; -+ this.motionX += par8; -+ this.motionY += par10; -+ this.motionZ += par12; -+ this.particleRed = this.particleGreen = this.particleBlue = 1.0F - (float)(Math.random() * 0.30000001192092896D); -+ this.particleScale *= 0.75F; - this.particleScale *= var14; - this.field_70569_a = this.particleScale; - this.particleMaxAge = (int)(8.0D / (Math.random() * 0.8D + 0.3D)); -@@ -21,44 +21,49 @@ - this.noClip = false; - } - -- public void renderParticle(Tessellator var1, float var2, float var3, float var4, float var5, float var6, float var7) { -- float var8 = ((float)this.particleAge + var2) / (float)this.particleMaxAge * 32.0F; -- if(var8 < 0.0F) { -+ public void renderParticle(Tessellator par1Tessellator, float par2, float par3, float par4, float par5, float par6, float par7) { -+ float var8 = ((float)this.particleAge + par2) / (float)this.particleMaxAge * 32.0F; -+ -+ if (var8 < 0.0F) { - var8 = 0.0F; - } - -- if(var8 > 1.0F) { -+ if (var8 > 1.0F) { - var8 = 1.0F; - } - - this.particleScale = this.field_70569_a * var8; -- super.renderParticle(var1, var2, var3, var4, var5, var6, var7); -+ super.renderParticle(par1Tessellator, par2, par3, par4, par5, par6, par7); - } - -+ /** -+ * Called to update the entity's position/logic. -+ */ - public void onUpdate() { - this.prevPosX = this.posX; - this.prevPosY = this.posY; - this.prevPosZ = this.posZ; -- if(this.particleAge++ >= this.particleMaxAge) { -+ -+ if (this.particleAge++ >= this.particleMaxAge) { - this.setDead(); - } - - this.setParticleTextureIndex(7 - this.particleAge * 8 / this.particleMaxAge); - this.moveEntity(this.motionX, this.motionY, this.motionZ); -- this.motionX *= (double)0.96F; -- this.motionY *= (double)0.96F; -- this.motionZ *= (double)0.96F; -+ this.motionX *= 0.9599999785423279D; -+ this.motionY *= 0.9599999785423279D; -+ this.motionZ *= 0.9599999785423279D; - EntityPlayer var1 = this.worldObj.getClosestPlayerToEntity(this, 2.0D); -- if(var1 != null && this.posY > var1.boundingBox.minY) { -+ -+ if (var1 != null && this.posY > var1.boundingBox.minY) { - this.posY += (var1.boundingBox.minY - this.posY) * 0.2D; - this.motionY += (var1.motionY - this.motionY) * 0.2D; - this.setPosition(this.posX, this.posY, this.posZ); - } - -- if(this.onGround) { -- this.motionX *= (double)0.7F; -- this.motionZ *= (double)0.7F; -+ if (this.onGround) { -+ this.motionX *= 0.699999988079071D; -+ this.motionZ *= 0.699999988079071D; - } -- - } - } ---- net/minecraft/src/WorldGenCactus.java -+++ net/minecraft/src/WorldGenCactus.java -@@ -3,17 +3,18 @@ - import java.util.Random; - - public class WorldGenCactus extends WorldGenerator { -- public boolean generate(World var1, Random var2, int var3, int var4, int var5) { -- for(int var6 = 0; var6 < 10; ++var6) { -- int var7 = var3 + var2.nextInt(8) - var2.nextInt(8); -- int var8 = var4 + var2.nextInt(4) - var2.nextInt(4); -- int var9 = var5 + var2.nextInt(8) - var2.nextInt(8); -- if(var1.isAirBlock(var7, var8, var9)) { -- int var10 = 1 + var2.nextInt(var2.nextInt(3) + 1); -- -- for(int var11 = 0; var11 < var10; ++var11) { -- if(Block.cactus.canBlockStay(var1, var7, var8 + var11, var9)) { -- var1.setBlock(var7, var8 + var11, var9, Block.cactus.blockID, 0, 2); -+ public boolean generate(World par1World, Random par2Random, int par3, int par4, int par5) { -+ for (int var6 = 0; var6 < 10; ++var6) { -+ int var7 = par3 + par2Random.nextInt(8) - par2Random.nextInt(8); -+ int var8 = par4 + par2Random.nextInt(4) - par2Random.nextInt(4); -+ int var9 = par5 + par2Random.nextInt(8) - par2Random.nextInt(8); -+ -+ if (par1World.isAirBlock(var7, var8, var9)) { -+ int var10 = 1 + par2Random.nextInt(par2Random.nextInt(3) + 1); -+ -+ for (int var11 = 0; var11 < var10; ++var11) { -+ if (Block.cactus.canBlockStay(par1World, var7, var8 + var11, var9)) { -+ par1World.setBlock(var7, var8 + var11, var9, Block.cactus.blockID, 0, 2); - } - } - } ---- net/minecraft/src/WorldGenerator.java -+++ net/minecraft/src/WorldGenerator.java -@@ -3,31 +3,43 @@ - import java.util.Random; - - public abstract class WorldGenerator { -+ -+ /** -+ * Sets wither or not the generator should notify blocks of blocks it changes. When the world is first generated, this -+ * is false, when saplings grow, this is true. -+ */ - private final boolean doBlockNotify; - - public WorldGenerator() { - this.doBlockNotify = false; - } - -- public WorldGenerator(boolean var1) { -- this.doBlockNotify = var1; -+ public WorldGenerator(boolean par1) { -+ this.doBlockNotify = par1; - } - - public abstract boolean generate(World var1, Random var2, int var3, int var4, int var5); - -- public void setScale(double var1, double var3, double var5) { -- } -- -- protected void setBlock(World var1, int var2, int var3, int var4, int var5) { -- this.setBlockAndMetadata(var1, var2, var3, var4, var5, 0); -- } -- -- protected void setBlockAndMetadata(World var1, int var2, int var3, int var4, int var5, int var6) { -- if(this.doBlockNotify) { -- var1.setBlock(var2, var3, var4, var5, var6, 3); -+ /** -+ * Rescales the generator settings, only used in WorldGenBigTree -+ */ -+ public void setScale(double par1, double par3, double par5) {} -+ -+ /** -+ * Sets the block without metadata in the world, notifying neighbors if enabled. -+ */ -+ protected void setBlock(World par1World, int par2, int par3, int par4, int par5) { -+ this.setBlockAndMetadata(par1World, par2, par3, par4, par5, 0); -+ } -+ -+ /** -+ * Sets the block in the world, notifying neighbors if enabled. -+ */ -+ protected void setBlockAndMetadata(World par1World, int par2, int par3, int par4, int par5, int par6) { -+ if (this.doBlockNotify) { -+ par1World.setBlock(par2, par3, par4, par5, par6, 3); - } else { -- var1.setBlock(var2, var3, var4, var5, var6, 2); -+ par1World.setBlock(par2, par3, par4, par5, par6, 2); - } -- - } - } ---- net/minecraft/src/SimpleResource.java -+++ net/minecraft/src/SimpleResource.java -@@ -6,64 +6,64 @@ - import java.io.BufferedReader; - import java.io.InputStream; - import java.io.InputStreamReader; --import java.io.Reader; - import java.util.Map; - import org.apache.commons.io.IOUtils; - - public class SimpleResource implements Resource { -- private final Map a = Maps.newHashMap(); -+ private final Map mapMetadataSections = Maps.newHashMap(); - private final ResourceLocation srResourceLocation; -- private final InputStream c; -- private final InputStream d; -+ private final InputStream resourceInputStream; -+ private final InputStream mcmetaInputStream; - private final MetadataSerializer srMetadataSerializer; - private boolean mcmetaJsonChecked; -- private JsonObject g; -+ private JsonObject mcmetaJson; - -- public SimpleResource(ResourceLocation var1, InputStream var2, InputStream var3, MetadataSerializer var4) { -- this.srResourceLocation = var1; -- this.c = var2; -- this.d = var3; -- this.srMetadataSerializer = var4; -+ public SimpleResource(ResourceLocation par1ResourceLocation, InputStream par2InputStream, InputStream par3InputStream, MetadataSerializer par4MetadataSerializer) { -+ this.srResourceLocation = par1ResourceLocation; -+ this.resourceInputStream = par2InputStream; -+ this.mcmetaInputStream = par3InputStream; -+ this.srMetadataSerializer = par4MetadataSerializer; - } - - public InputStream getInputStream() { -- return this.c; -+ return this.resourceInputStream; - } - - public boolean hasMetadata() { -- return this.d != null; -+ return this.mcmetaInputStream != null; - } - -- public MetadataSection getMetadata(String var1) { -- if(!this.hasMetadata()) { -+ public MetadataSection getMetadata(String par1Str) { -+ if (!this.hasMetadata()) { - return null; - } else { -- if(this.g == null && !this.mcmetaJsonChecked) { -+ if (this.mcmetaJson == null && !this.mcmetaJsonChecked) { - this.mcmetaJsonChecked = true; - BufferedReader var2 = null; - - try { -- var2 = new BufferedReader(new InputStreamReader(this.d)); -- this.g = (new JsonParser()).parse((Reader)var2).getAsJsonObject(); -+ var2 = new BufferedReader(new InputStreamReader(this.mcmetaInputStream)); -+ this.mcmetaJson = (new JsonParser()).parse(var2).getAsJsonObject(); - } finally { -- IOUtils.closeQuietly((Reader)var2); -+ IOUtils.closeQuietly(var2); - } - } - -- MetadataSection var6 = (MetadataSection)this.a.get(var1); -- if(var6 == null) { -- var6 = this.srMetadataSerializer.parseMetadataSection(var1, this.g); -+ MetadataSection var6 = (MetadataSection)this.mapMetadataSections.get(par1Str); -+ -+ if (var6 == null) { -+ var6 = this.srMetadataSerializer.parseMetadataSection(par1Str, this.mcmetaJson); - } - - return var6; - } - } - -- public boolean equals(Object var1) { -- if(this == var1) { -+ public boolean equals(Object par1Obj) { -+ if (this == par1Obj) { - return true; -- } else if(var1 instanceof SimpleResource) { -- SimpleResource var2 = (SimpleResource)var1; -+ } else if (par1Obj instanceof SimpleResource) { -+ SimpleResource var2 = (SimpleResource)par1Obj; - return this.srResourceLocation != null ? this.srResourceLocation.equals(var2.srResourceLocation) : var2.srResourceLocation == null; - } else { - return false; ---- net/minecraft/src/EntityAIControlledByPlayer.java -+++ net/minecraft/src/EntityAIControlledByPlayer.java -@@ -4,47 +4,69 @@ - private final EntityLiving thisEntity; - private final float maxSpeed; - private float currentSpeed; -+ -+ /** Whether the entity's speed is boosted. */ - private boolean speedBoosted; -+ -+ /** -+ * Counter for speed boosting, upon reaching maxSpeedBoostTime the speed boost will be disabled -+ */ - private int speedBoostTime; -+ -+ /** Maximum time the entity's speed should be boosted for. */ - private int maxSpeedBoostTime; - -- public EntityAIControlledByPlayer(EntityLiving var1, float var2) { -- this.thisEntity = var1; -- this.maxSpeed = var2; -+ public EntityAIControlledByPlayer(EntityLiving par1EntityLiving, float par2) { -+ this.thisEntity = par1EntityLiving; -+ this.maxSpeed = par2; - this.setMutexBits(7); - } - -+ /** -+ * Execute a one shot task or start executing a continuous task -+ */ - public void startExecuting() { - this.currentSpeed = 0.0F; - } - -+ /** -+ * Resets the task -+ */ - public void resetTask() { - this.speedBoosted = false; - this.currentSpeed = 0.0F; - } - -+ /** -+ * Returns whether the EntityAIBase should begin execution. -+ */ - public boolean shouldExecute() { - return this.thisEntity.isEntityAlive() && this.thisEntity.riddenByEntity != null && this.thisEntity.riddenByEntity instanceof EntityPlayer && (this.speedBoosted || this.thisEntity.canBeSteered()); - } - -+ /** -+ * Updates the task -+ */ - public void updateTask() { - EntityPlayer var1 = (EntityPlayer)this.thisEntity.riddenByEntity; - EntityCreature var2 = (EntityCreature)this.thisEntity; - float var3 = MathHelper.wrapAngleTo180_float(var1.rotationYaw - this.thisEntity.rotationYaw) * 0.5F; -- if(var3 > 5.0F) { -+ -+ if (var3 > 5.0F) { - var3 = 5.0F; - } - -- if(var3 < -5.0F) { -+ if (var3 < -5.0F) { - var3 = -5.0F; - } - - this.thisEntity.rotationYaw = MathHelper.wrapAngleTo180_float(this.thisEntity.rotationYaw + var3); -- if(this.currentSpeed < this.maxSpeed) { -+ -+ if (this.currentSpeed < this.maxSpeed) { - this.currentSpeed += (this.maxSpeed - this.currentSpeed) * 0.01F; - } - -- if(this.currentSpeed > this.maxSpeed) { -+ if (this.currentSpeed > this.maxSpeed) { - this.currentSpeed = this.maxSpeed; - } - -@@ -52,8 +74,9 @@ - int var5 = MathHelper.floor_double(this.thisEntity.posY); - int var6 = MathHelper.floor_double(this.thisEntity.posZ); - float var7 = this.currentSpeed; -- if(this.speedBoosted) { -- if(this.speedBoostTime++ > this.maxSpeedBoostTime) { -+ -+ if (this.speedBoosted) { -+ if (this.speedBoostTime++ > this.maxSpeedBoostTime) { - this.speedBoosted = false; - } - -@@ -61,10 +84,12 @@ - } - - float var8 = 0.91F; -- if(this.thisEntity.onGround) { -- var8 = 546.0F * 0.1F * 0.1F * 0.1F; -+ -+ if (this.thisEntity.onGround) { -+ var8 = 0.54600006F; - int var9 = this.thisEntity.worldObj.getBlockId(MathHelper.floor_float((float)var4), MathHelper.floor_float((float)var5) - 1, MathHelper.floor_float((float)var6)); -- if(var9 > 0) { -+ -+ if (var9 > 0) { - var8 = Block.blocksList[var9].slipperiness * 0.91F; - } - } -@@ -78,23 +103,25 @@ - float var14 = var7 * var13; - float var15 = -(var14 * var10); - float var16 = var14 * var11; -- if(MathHelper.abs(var15) > MathHelper.abs(var16)) { -- if(var15 < 0.0F) { -+ -+ if (MathHelper.abs(var15) > MathHelper.abs(var16)) { -+ if (var15 < 0.0F) { - var15 -= this.thisEntity.width / 2.0F; - } - -- if(var15 > 0.0F) { -+ if (var15 > 0.0F) { - var15 += this.thisEntity.width / 2.0F; - } - - var16 = 0.0F; - } else { - var15 = 0.0F; -- if(var16 < 0.0F) { -+ -+ if (var16 < 0.0F) { - var16 -= this.thisEntity.width / 2.0F; - } - -- if(var16 > 0.0F) { -+ if (var16 > 0.0F) { - var16 += this.thisEntity.width / 2.0F; - } - } -@@ -102,20 +129,24 @@ - int var17 = MathHelper.floor_double(this.thisEntity.posX + (double)var15); - int var18 = MathHelper.floor_double(this.thisEntity.posZ + (double)var16); - PathPoint var19 = new PathPoint(MathHelper.floor_float(this.thisEntity.width + 1.0F), MathHelper.floor_float(this.thisEntity.height + var1.height + 1.0F), MathHelper.floor_float(this.thisEntity.width + 1.0F)); -- if(var4 != var17 || var6 != var18) { -+ -+ if (var4 != var17 || var6 != var18) { - int var20 = this.thisEntity.worldObj.getBlockId(var4, var5, var6); - int var21 = this.thisEntity.worldObj.getBlockId(var4, var5 - 1, var6); - boolean var22 = this.func_98216_b(var20) || Block.blocksList[var20] == null && this.func_98216_b(var21); -- if(!var22 && PathFinder.func_82565_a(this.thisEntity, var17, var5, var18, var19, false, false, true) == 0 && PathFinder.func_82565_a(this.thisEntity, var4, var5 + 1, var6, var19, false, false, true) == 1 && PathFinder.func_82565_a(this.thisEntity, var17, var5 + 1, var18, var19, false, false, true) == 1) { -+ -+ if (!var22 && PathFinder.func_82565_a(this.thisEntity, var17, var5, var18, var19, false, false, true) == 0 && PathFinder.func_82565_a(this.thisEntity, var4, var5 + 1, var6, var19, false, false, true) == 1 && PathFinder.func_82565_a(this.thisEntity, var17, var5 + 1, var18, var19, false, false, true) == 1) { - var2.getJumpHelper().setJumping(); - } - } - -- if(!var1.capabilities.isCreativeMode && this.currentSpeed >= this.maxSpeed * 0.5F && this.thisEntity.getRNG().nextFloat() < 0.006F && !this.speedBoosted) { -+ if (!var1.capabilities.isCreativeMode && this.currentSpeed >= this.maxSpeed * 0.5F && this.thisEntity.getRNG().nextFloat() < 0.006F && !this.speedBoosted) { - ItemStack var24 = var1.getHeldItem(); -- if(var24 != null && var24.itemID == Item.carrotOnAStick.itemID) { -+ -+ if (var24 != null && var24.itemID == Item.carrotOnAStick.itemID) { - var24.damageItem(1, var1); -- if(var24.stackSize == 0) { -+ -+ if (var24.stackSize == 0) { - ItemStack var25 = new ItemStack(Item.fishingRod); - var25.setTagCompound(var24.stackTagCompound); - var1.inventory.mainInventory[var1.inventory.currentItem] = var25; -@@ -126,20 +157,29 @@ - this.thisEntity.moveEntityWithHeading(0.0F, var7); - } - -- private boolean func_98216_b(int var1) { -- return Block.blocksList[var1] != null && (Block.blocksList[var1].getRenderType() == 10 || Block.blocksList[var1] instanceof BlockHalfSlab); -+ private boolean func_98216_b(int par1) { -+ return Block.blocksList[par1] != null && (Block.blocksList[par1].getRenderType() == 10 || Block.blocksList[par1] instanceof BlockHalfSlab); - } - -+ /** -+ * Return whether the entity's speed is boosted. -+ */ - public boolean isSpeedBoosted() { - return this.speedBoosted; - } - -+ /** -+ * Boost the entity's movement speed. -+ */ - public void boostSpeed() { - this.speedBoosted = true; - this.speedBoostTime = 0; - this.maxSpeedBoostTime = this.thisEntity.getRNG().nextInt(841) + 140; - } - -+ /** -+ * Return whether the entity is being controlled by a player. -+ */ - public boolean isControlledByPlayer() { - return !this.isSpeedBoosted() && this.currentSpeed > this.maxSpeed * 0.3F; - } ---- net/minecraft/src/TileEntityBeaconRenderer.java -+++ net/minecraft/src/TileEntityBeaconRenderer.java -@@ -5,9 +5,13 @@ - public class TileEntityBeaconRenderer extends TileEntitySpecialRenderer { - private static final ResourceLocation field_110629_a = new ResourceLocation("textures/entity/beacon_beam.png"); - -- public void renderTileEntityBeaconAt(TileEntityBeacon var1, double var2, double var4, double var6, float var8) { -- float var9 = var1.func_82125_v_(); -- if(var9 > 0.0F) { -+ /** -+ * Render a beacon tile entity. -+ */ -+ public void renderTileEntityBeaconAt(TileEntityBeacon par1TileEntityBeacon, double par2, double par4, double par6, float par8) { -+ float var9 = par1TileEntityBeacon.func_82125_v_(); -+ -+ if (var9 > 0.0F) { - Tessellator var10 = Tessellator.instance; - this.bindTexture(field_110629_a); - GL11.glTexParameterf(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_WRAP_S, 10497.0F); -@@ -17,42 +21,42 @@ - GL11.glDisable(GL11.GL_BLEND); - GL11.glDepthMask(true); - GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE); -- float var11 = (float)var1.getWorldObj().getTotalWorldTime() + var8; -+ float var11 = (float)par1TileEntityBeacon.getWorldObj().getTotalWorldTime() + par8; - float var12 = -var11 * 0.2F - (float)MathHelper.floor_float(-var11 * 0.1F); - byte var13 = 1; - double var14 = (double)var11 * 0.025D * (1.0D - (double)(var13 & 1) * 2.5D); - var10.startDrawingQuads(); - var10.setColorRGBA(255, 255, 255, 32); - double var16 = (double)var13 * 0.2D; -- double var18 = 0.5D + Math.cos(var14 + Math.PI * 0.75D) * var16; -- double var20 = 0.5D + Math.sin(var14 + Math.PI * 0.75D) * var16; -- double var22 = 0.5D + Math.cos(var14 + Math.PI * 0.25D) * var16; -- double var24 = 0.5D + Math.sin(var14 + Math.PI * 0.25D) * var16; -- double var26 = 0.5D + Math.cos(var14 + Math.PI * 1.25D) * var16; -- double var28 = 0.5D + Math.sin(var14 + Math.PI * 1.25D) * var16; -- double var30 = 0.5D + Math.cos(var14 + Math.PI * 1.75D) * var16; -- double var32 = 0.5D + Math.sin(var14 + Math.PI * 1.75D) * var16; -+ double var18 = 0.5D + Math.cos(var14 + 2.356194490192345D) * var16; -+ double var20 = 0.5D + Math.sin(var14 + 2.356194490192345D) * var16; -+ double var22 = 0.5D + Math.cos(var14 + (Math.PI / 4D)) * var16; -+ double var24 = 0.5D + Math.sin(var14 + (Math.PI / 4D)) * var16; -+ double var26 = 0.5D + Math.cos(var14 + 3.9269908169872414D) * var16; -+ double var28 = 0.5D + Math.sin(var14 + 3.9269908169872414D) * var16; -+ double var30 = 0.5D + Math.cos(var14 + 5.497787143782138D) * var16; -+ double var32 = 0.5D + Math.sin(var14 + 5.497787143782138D) * var16; - double var34 = (double)(256.0F * var9); - double var36 = 0.0D; - double var38 = 1.0D; - double var40 = (double)(-1.0F + var12); - double var42 = (double)(256.0F * var9) * (0.5D / var16) + var40; -- var10.addVertexWithUV(var2 + var18, var4 + var34, var6 + var20, var38, var42); -- var10.addVertexWithUV(var2 + var18, var4, var6 + var20, var38, var40); -- var10.addVertexWithUV(var2 + var22, var4, var6 + var24, var36, var40); -- var10.addVertexWithUV(var2 + var22, var4 + var34, var6 + var24, var36, var42); -- var10.addVertexWithUV(var2 + var30, var4 + var34, var6 + var32, var38, var42); -- var10.addVertexWithUV(var2 + var30, var4, var6 + var32, var38, var40); -- var10.addVertexWithUV(var2 + var26, var4, var6 + var28, var36, var40); -- var10.addVertexWithUV(var2 + var26, var4 + var34, var6 + var28, var36, var42); -- var10.addVertexWithUV(var2 + var22, var4 + var34, var6 + var24, var38, var42); -- var10.addVertexWithUV(var2 + var22, var4, var6 + var24, var38, var40); -- var10.addVertexWithUV(var2 + var30, var4, var6 + var32, var36, var40); -- var10.addVertexWithUV(var2 + var30, var4 + var34, var6 + var32, var36, var42); -- var10.addVertexWithUV(var2 + var26, var4 + var34, var6 + var28, var38, var42); -- var10.addVertexWithUV(var2 + var26, var4, var6 + var28, var38, var40); -- var10.addVertexWithUV(var2 + var18, var4, var6 + var20, var36, var40); -- var10.addVertexWithUV(var2 + var18, var4 + var34, var6 + var20, var36, var42); -+ var10.addVertexWithUV(par2 + var18, par4 + var34, par6 + var20, var38, var42); -+ var10.addVertexWithUV(par2 + var18, par4, par6 + var20, var38, var40); -+ var10.addVertexWithUV(par2 + var22, par4, par6 + var24, var36, var40); -+ var10.addVertexWithUV(par2 + var22, par4 + var34, par6 + var24, var36, var42); -+ var10.addVertexWithUV(par2 + var30, par4 + var34, par6 + var32, var38, var42); -+ var10.addVertexWithUV(par2 + var30, par4, par6 + var32, var38, var40); -+ var10.addVertexWithUV(par2 + var26, par4, par6 + var28, var36, var40); -+ var10.addVertexWithUV(par2 + var26, par4 + var34, par6 + var28, var36, var42); -+ var10.addVertexWithUV(par2 + var22, par4 + var34, par6 + var24, var38, var42); -+ var10.addVertexWithUV(par2 + var22, par4, par6 + var24, var38, var40); -+ var10.addVertexWithUV(par2 + var30, par4, par6 + var32, var36, var40); -+ var10.addVertexWithUV(par2 + var30, par4 + var34, par6 + var32, var36, var42); -+ var10.addVertexWithUV(par2 + var26, par4 + var34, par6 + var28, var38, var42); -+ var10.addVertexWithUV(par2 + var26, par4, par6 + var28, var38, var40); -+ var10.addVertexWithUV(par2 + var18, par4, par6 + var20, var36, var40); -+ var10.addVertexWithUV(par2 + var18, par4 + var34, par6 + var20, var36, var42); - var10.draw(); - GL11.glEnable(GL11.GL_BLEND); - GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); -@@ -72,31 +76,30 @@ - double var33 = 1.0D; - double var35 = (double)(-1.0F + var12); - double var37 = (double)(256.0F * var9) + var35; -- var10.addVertexWithUV(var2 + var44, var4 + var29, var6 + var15, var33, var37); -- var10.addVertexWithUV(var2 + var44, var4, var6 + var15, var33, var35); -- var10.addVertexWithUV(var2 + var17, var4, var6 + var19, var31, var35); -- var10.addVertexWithUV(var2 + var17, var4 + var29, var6 + var19, var31, var37); -- var10.addVertexWithUV(var2 + var25, var4 + var29, var6 + var27, var33, var37); -- var10.addVertexWithUV(var2 + var25, var4, var6 + var27, var33, var35); -- var10.addVertexWithUV(var2 + var21, var4, var6 + var23, var31, var35); -- var10.addVertexWithUV(var2 + var21, var4 + var29, var6 + var23, var31, var37); -- var10.addVertexWithUV(var2 + var17, var4 + var29, var6 + var19, var33, var37); -- var10.addVertexWithUV(var2 + var17, var4, var6 + var19, var33, var35); -- var10.addVertexWithUV(var2 + var25, var4, var6 + var27, var31, var35); -- var10.addVertexWithUV(var2 + var25, var4 + var29, var6 + var27, var31, var37); -- var10.addVertexWithUV(var2 + var21, var4 + var29, var6 + var23, var33, var37); -- var10.addVertexWithUV(var2 + var21, var4, var6 + var23, var33, var35); -- var10.addVertexWithUV(var2 + var44, var4, var6 + var15, var31, var35); -- var10.addVertexWithUV(var2 + var44, var4 + var29, var6 + var15, var31, var37); -+ var10.addVertexWithUV(par2 + var44, par4 + var29, par6 + var15, var33, var37); -+ var10.addVertexWithUV(par2 + var44, par4, par6 + var15, var33, var35); -+ var10.addVertexWithUV(par2 + var17, par4, par6 + var19, var31, var35); -+ var10.addVertexWithUV(par2 + var17, par4 + var29, par6 + var19, var31, var37); -+ var10.addVertexWithUV(par2 + var25, par4 + var29, par6 + var27, var33, var37); -+ var10.addVertexWithUV(par2 + var25, par4, par6 + var27, var33, var35); -+ var10.addVertexWithUV(par2 + var21, par4, par6 + var23, var31, var35); -+ var10.addVertexWithUV(par2 + var21, par4 + var29, par6 + var23, var31, var37); -+ var10.addVertexWithUV(par2 + var17, par4 + var29, par6 + var19, var33, var37); -+ var10.addVertexWithUV(par2 + var17, par4, par6 + var19, var33, var35); -+ var10.addVertexWithUV(par2 + var25, par4, par6 + var27, var31, var35); -+ var10.addVertexWithUV(par2 + var25, par4 + var29, par6 + var27, var31, var37); -+ var10.addVertexWithUV(par2 + var21, par4 + var29, par6 + var23, var33, var37); -+ var10.addVertexWithUV(par2 + var21, par4, par6 + var23, var33, var35); -+ var10.addVertexWithUV(par2 + var44, par4, par6 + var15, var31, var35); -+ var10.addVertexWithUV(par2 + var44, par4 + var29, par6 + var15, var31, var37); - var10.draw(); - GL11.glEnable(GL11.GL_LIGHTING); - GL11.glEnable(GL11.GL_TEXTURE_2D); - GL11.glDepthMask(true); - } -- - } - -- public void renderTileEntityAt(TileEntity var1, double var2, double var4, double var6, float var8) { -- this.renderTileEntityBeaconAt((TileEntityBeacon)var1, var2, var4, var6, var8); -+ public void renderTileEntityAt(TileEntity par1TileEntity, double par2, double par4, double par6, float par8) { -+ this.renderTileEntityBeaconAt((TileEntityBeacon)par1TileEntity, par2, par4, par6, par8); - } - } ---- net/minecraft/src/StitchHolder.java -+++ net/minecraft/src/StitchHolder.java -@@ -7,10 +7,10 @@ - private boolean rotated; - private float scaleFactor = 1.0F; - -- public StitchHolder(TextureAtlasSprite var1) { -- this.theTexture = var1; -- this.width = var1.getIconWidth(); -- this.height = var1.getIconHeight(); -+ public StitchHolder(TextureAtlasSprite par1TextureAtlasSprite) { -+ this.theTexture = par1TextureAtlasSprite; -+ this.width = par1TextureAtlasSprite.getIconWidth(); -+ this.height = par1TextureAtlasSprite.getIconHeight(); - this.rotated = this.ceil16(this.height) > this.ceil16(this.width); - } - -@@ -34,13 +34,13 @@ - return this.rotated; - } - -- private int ceil16(int var1) { -- return (var1 >> 0) + ((var1 & 0) == 0 ? 0 : 1) << 0; -+ private int ceil16(int par1) { -+ return (par1 >> 0) + ((par1 & 0) == 0 ? 0 : 1) << 0; - } - -- public void setNewDimension(int var1) { -- if(this.width > var1 && this.height > var1) { -- this.scaleFactor = (float)var1 / (float)Math.min(this.width, this.height); -+ public void setNewDimension(int par1) { -+ if (this.width > par1 && this.height > par1) { -+ this.scaleFactor = (float)par1 / (float)Math.min(this.width, this.height); - } - } - -@@ -48,26 +48,30 @@ - return "Holder{width=" + this.width + ", height=" + this.height + '}'; - } - -- public int compareToStitchHolder(StitchHolder var1) { -+ /** -+ * See Comparable.compareTo. -+ */ -+ public int compareToStitchHolder(StitchHolder par1StitchHolder) { - int var2; -- if(this.getHeight() == var1.getHeight()) { -- if(this.getWidth() == var1.getWidth()) { -- if(this.theTexture.getIconName() == null) { -- return var1.theTexture.getIconName() == null ? 0 : -1; -+ -+ if (this.getHeight() == par1StitchHolder.getHeight()) { -+ if (this.getWidth() == par1StitchHolder.getWidth()) { -+ if (this.theTexture.getIconName() == null) { -+ return par1StitchHolder.theTexture.getIconName() == null ? 0 : -1; - } - -- return this.theTexture.getIconName().compareTo(var1.theTexture.getIconName()); -+ return this.theTexture.getIconName().compareTo(par1StitchHolder.theTexture.getIconName()); - } - -- var2 = this.getWidth() < var1.getWidth() ? 1 : -1; -+ var2 = this.getWidth() < par1StitchHolder.getWidth() ? 1 : -1; - } else { -- var2 = this.getHeight() < var1.getHeight() ? 1 : -1; -+ var2 = this.getHeight() < par1StitchHolder.getHeight() ? 1 : -1; - } - - return var2; - } - -- public int compareTo(Object var1) { -- return this.compareToStitchHolder((StitchHolder)var1); -+ public int compareTo(Object par1Obj) { -+ return this.compareToStitchHolder((StitchHolder)par1Obj); - } - } ---- net/minecraft/src/StatTypeTime.java -+++ net/minecraft/src/StatTypeTime.java -@@ -1,8 +1,12 @@ - package net.minecraft.src; - - final class StatTypeTime implements IStatType { -- public String format(int var1) { -- double var2 = (double)var1 / 20.0D; -+ -+ /** -+ * Formats a given stat for human consumption. -+ */ -+ public String format(int par1) { -+ double var2 = (double)par1 / 20.0D; - double var4 = var2 / 60.0D; - double var6 = var4 / 60.0D; - double var8 = var6 / 24.0D; ---- net/minecraft/src/CraftingManager.java -+++ net/minecraft/src/CraftingManager.java -@@ -6,9 +6,16 @@ - import java.util.List; - - public class CraftingManager { -+ -+ /** The static instance of this class */ - private static final CraftingManager instance = new CraftingManager(); -- private List b = new ArrayList(); -- -+ -+ /** A list of all the recipes added */ -+ private List recipes = new ArrayList(); -+ -+ /** -+ * Returns the static instance of this class -+ */ - public static final CraftingManager getInstance() { - return instance; - } -@@ -21,188 +28,194 @@ - (new RecipesCrafting()).addRecipes(this); - (new RecipesArmor()).addRecipes(this); - (new RecipesDyes()).addRecipes(this); -- this.b.add(new RecipesArmorDyes()); -- this.b.add(new RecipesMapCloning()); -- this.b.add(new RecipesMapExtending()); -- this.b.add(new RecipeFireworks()); -- this.addRecipe(new ItemStack(Item.paper, 3), new Object[]{"###", Character.valueOf('#'), Item.reed}); -- this.addShapelessRecipe(new ItemStack(Item.book, 1), new Object[]{Item.paper, Item.paper, Item.paper, Item.leather}); -- this.addShapelessRecipe(new ItemStack(Item.writableBook, 1), new Object[]{Item.book, new ItemStack(Item.dyePowder, 1, 0), Item.feather}); -- this.addRecipe(new ItemStack(Block.fence, 2), new Object[]{"###", "###", Character.valueOf('#'), Item.stick}); -- this.addRecipe(new ItemStack(Block.cobblestoneWall, 6, 0), new Object[]{"###", "###", Character.valueOf('#'), Block.cobblestone}); -- this.addRecipe(new ItemStack(Block.cobblestoneWall, 6, 1), new Object[]{"###", "###", Character.valueOf('#'), Block.cobblestoneMossy}); -- this.addRecipe(new ItemStack(Block.netherFence, 6), new Object[]{"###", "###", Character.valueOf('#'), Block.netherBrick}); -- this.addRecipe(new ItemStack(Block.fenceGate, 1), new Object[]{"#W#", "#W#", Character.valueOf('#'), Item.stick, Character.valueOf('W'), Block.planks}); -- this.addRecipe(new ItemStack(Block.jukebox, 1), new Object[]{"###", "#X#", "###", Character.valueOf('#'), Block.planks, Character.valueOf('X'), Item.diamond}); -- this.addRecipe(new ItemStack(Item.leash, 2), new Object[]{"~~ ", "~O ", " ~", Character.valueOf('~'), Item.silk, Character.valueOf('O'), Item.slimeBall}); -- this.addRecipe(new ItemStack(Block.music, 1), new Object[]{"###", "#X#", "###", Character.valueOf('#'), Block.planks, Character.valueOf('X'), Item.redstone}); -- this.addRecipe(new ItemStack(Block.bookShelf, 1), new Object[]{"###", "XXX", "###", Character.valueOf('#'), Block.planks, Character.valueOf('X'), Item.book}); -- this.addRecipe(new ItemStack(Block.blockSnow, 1), new Object[]{"##", "##", Character.valueOf('#'), Item.snowball}); -- this.addRecipe(new ItemStack(Block.snow, 6), new Object[]{"###", Character.valueOf('#'), Block.blockSnow}); -- this.addRecipe(new ItemStack(Block.blockClay, 1), new Object[]{"##", "##", Character.valueOf('#'), Item.clay}); -- this.addRecipe(new ItemStack(Block.brick, 1), new Object[]{"##", "##", Character.valueOf('#'), Item.brick}); -- this.addRecipe(new ItemStack(Block.glowStone, 1), new Object[]{"##", "##", Character.valueOf('#'), Item.glowstone}); -- this.addRecipe(new ItemStack(Block.blockNetherQuartz, 1), new Object[]{"##", "##", Character.valueOf('#'), Item.netherQuartz}); -- this.addRecipe(new ItemStack(Block.cloth, 1), new Object[]{"##", "##", Character.valueOf('#'), Item.silk}); -- this.addRecipe(new ItemStack(Block.tnt, 1), new Object[]{"X#X", "#X#", "X#X", Character.valueOf('X'), Item.gunpowder, Character.valueOf('#'), Block.sand}); -- this.addRecipe(new ItemStack(Block.stoneSingleSlab, 6, 3), new Object[]{"###", Character.valueOf('#'), Block.cobblestone}); -- this.addRecipe(new ItemStack(Block.stoneSingleSlab, 6, 0), new Object[]{"###", Character.valueOf('#'), Block.stone}); -- this.addRecipe(new ItemStack(Block.stoneSingleSlab, 6, 1), new Object[]{"###", Character.valueOf('#'), Block.sandStone}); -- this.addRecipe(new ItemStack(Block.stoneSingleSlab, 6, 4), new Object[]{"###", Character.valueOf('#'), Block.brick}); -- this.addRecipe(new ItemStack(Block.stoneSingleSlab, 6, 5), new Object[]{"###", Character.valueOf('#'), Block.stoneBrick}); -- this.addRecipe(new ItemStack(Block.stoneSingleSlab, 6, 6), new Object[]{"###", Character.valueOf('#'), Block.netherBrick}); -- this.addRecipe(new ItemStack(Block.stoneSingleSlab, 6, 7), new Object[]{"###", Character.valueOf('#'), Block.blockNetherQuartz}); -- this.addRecipe(new ItemStack(Block.woodSingleSlab, 6, 0), new Object[]{"###", Character.valueOf('#'), new ItemStack(Block.planks, 1, 0)}); -- this.addRecipe(new ItemStack(Block.woodSingleSlab, 6, 2), new Object[]{"###", Character.valueOf('#'), new ItemStack(Block.planks, 1, 2)}); -- this.addRecipe(new ItemStack(Block.woodSingleSlab, 6, 1), new Object[]{"###", Character.valueOf('#'), new ItemStack(Block.planks, 1, 1)}); -- this.addRecipe(new ItemStack(Block.woodSingleSlab, 6, 3), new Object[]{"###", Character.valueOf('#'), new ItemStack(Block.planks, 1, 3)}); -- this.addRecipe(new ItemStack(Block.ladder, 3), new Object[]{"# #", "###", "# #", Character.valueOf('#'), Item.stick}); -- this.addRecipe(new ItemStack(Item.doorWood, 1), new Object[]{"##", "##", "##", Character.valueOf('#'), Block.planks}); -- this.addRecipe(new ItemStack(Block.trapdoor, 2), new Object[]{"###", "###", Character.valueOf('#'), Block.planks}); -- this.addRecipe(new ItemStack(Item.doorIron, 1), new Object[]{"##", "##", "##", Character.valueOf('#'), Item.ingotIron}); -- this.addRecipe(new ItemStack(Item.sign, 3), new Object[]{"###", "###", " X ", Character.valueOf('#'), Block.planks, Character.valueOf('X'), Item.stick}); -- this.addRecipe(new ItemStack(Item.cake, 1), new Object[]{"AAA", "BEB", "CCC", Character.valueOf('A'), Item.bucketMilk, Character.valueOf('B'), Item.sugar, Character.valueOf('C'), Item.wheat, Character.valueOf('E'), Item.egg}); -- this.addRecipe(new ItemStack(Item.sugar, 1), new Object[]{"#", Character.valueOf('#'), Item.reed}); -- this.addRecipe(new ItemStack(Block.planks, 4, 0), new Object[]{"#", Character.valueOf('#'), new ItemStack(Block.wood, 1, 0)}); -- this.addRecipe(new ItemStack(Block.planks, 4, 1), new Object[]{"#", Character.valueOf('#'), new ItemStack(Block.wood, 1, 1)}); -- this.addRecipe(new ItemStack(Block.planks, 4, 2), new Object[]{"#", Character.valueOf('#'), new ItemStack(Block.wood, 1, 2)}); -- this.addRecipe(new ItemStack(Block.planks, 4, 3), new Object[]{"#", Character.valueOf('#'), new ItemStack(Block.wood, 1, 3)}); -- this.addRecipe(new ItemStack(Item.stick, 4), new Object[]{"#", "#", Character.valueOf('#'), Block.planks}); -- this.addRecipe(new ItemStack(Block.torchWood, 4), new Object[]{"X", "#", Character.valueOf('X'), Item.coal, Character.valueOf('#'), Item.stick}); -- this.addRecipe(new ItemStack(Block.torchWood, 4), new Object[]{"X", "#", Character.valueOf('X'), new ItemStack(Item.coal, 1, 1), Character.valueOf('#'), Item.stick}); -- this.addRecipe(new ItemStack(Item.bowlEmpty, 4), new Object[]{"# #", " # ", Character.valueOf('#'), Block.planks}); -- this.addRecipe(new ItemStack(Item.glassBottle, 3), new Object[]{"# #", " # ", Character.valueOf('#'), Block.glass}); -- this.addRecipe(new ItemStack(Block.rail, 16), new Object[]{"X X", "X#X", "X X", Character.valueOf('X'), Item.ingotIron, Character.valueOf('#'), Item.stick}); -- this.addRecipe(new ItemStack(Block.railPowered, 6), new Object[]{"X X", "X#X", "XRX", Character.valueOf('X'), Item.ingotGold, Character.valueOf('R'), Item.redstone, Character.valueOf('#'), Item.stick}); -- this.addRecipe(new ItemStack(Block.railActivator, 6), new Object[]{"XSX", "X#X", "XSX", Character.valueOf('X'), Item.ingotIron, Character.valueOf('#'), Block.torchRedstoneActive, Character.valueOf('S'), Item.stick}); -- this.addRecipe(new ItemStack(Block.railDetector, 6), new Object[]{"X X", "X#X", "XRX", Character.valueOf('X'), Item.ingotIron, Character.valueOf('R'), Item.redstone, Character.valueOf('#'), Block.pressurePlateStone}); -- this.addRecipe(new ItemStack(Item.minecartEmpty, 1), new Object[]{"# #", "###", Character.valueOf('#'), Item.ingotIron}); -- this.addRecipe(new ItemStack(Item.cauldron, 1), new Object[]{"# #", "# #", "###", Character.valueOf('#'), Item.ingotIron}); -- this.addRecipe(new ItemStack(Item.brewingStand, 1), new Object[]{" B ", "###", Character.valueOf('#'), Block.cobblestone, Character.valueOf('B'), Item.blazeRod}); -- this.addRecipe(new ItemStack(Block.pumpkinLantern, 1), new Object[]{"A", "B", Character.valueOf('A'), Block.pumpkin, Character.valueOf('B'), Block.torchWood}); -- this.addRecipe(new ItemStack(Item.minecartCrate, 1), new Object[]{"A", "B", Character.valueOf('A'), Block.chest, Character.valueOf('B'), Item.minecartEmpty}); -- this.addRecipe(new ItemStack(Item.minecartPowered, 1), new Object[]{"A", "B", Character.valueOf('A'), Block.furnaceIdle, Character.valueOf('B'), Item.minecartEmpty}); -- this.addRecipe(new ItemStack(Item.tntMinecart, 1), new Object[]{"A", "B", Character.valueOf('A'), Block.tnt, Character.valueOf('B'), Item.minecartEmpty}); -- this.addRecipe(new ItemStack(Item.minecartHopper, 1), new Object[]{"A", "B", Character.valueOf('A'), Block.hopperBlock, Character.valueOf('B'), Item.minecartEmpty}); -- this.addRecipe(new ItemStack(Item.boat, 1), new Object[]{"# #", "###", Character.valueOf('#'), Block.planks}); -- this.addRecipe(new ItemStack(Item.bucketEmpty, 1), new Object[]{"# #", " # ", Character.valueOf('#'), Item.ingotIron}); -- this.addRecipe(new ItemStack(Item.flowerPot, 1), new Object[]{"# #", " # ", Character.valueOf('#'), Item.brick}); -- this.addRecipe(new ItemStack(Item.flintAndSteel, 1), new Object[]{"A ", " B", Character.valueOf('A'), Item.ingotIron, Character.valueOf('B'), Item.flint}); -- this.addRecipe(new ItemStack(Item.bread, 1), new Object[]{"###", Character.valueOf('#'), Item.wheat}); -- this.addRecipe(new ItemStack(Block.stairsWoodOak, 4), new Object[]{"# ", "## ", "###", Character.valueOf('#'), new ItemStack(Block.planks, 1, 0)}); -- this.addRecipe(new ItemStack(Block.stairsWoodBirch, 4), new Object[]{"# ", "## ", "###", Character.valueOf('#'), new ItemStack(Block.planks, 1, 2)}); -- this.addRecipe(new ItemStack(Block.stairsWoodSpruce, 4), new Object[]{"# ", "## ", "###", Character.valueOf('#'), new ItemStack(Block.planks, 1, 1)}); -- this.addRecipe(new ItemStack(Block.stairsWoodJungle, 4), new Object[]{"# ", "## ", "###", Character.valueOf('#'), new ItemStack(Block.planks, 1, 3)}); -- this.addRecipe(new ItemStack(Item.fishingRod, 1), new Object[]{" #", " #X", "# X", Character.valueOf('#'), Item.stick, Character.valueOf('X'), Item.silk}); -- this.addRecipe(new ItemStack(Item.carrotOnAStick, 1), new Object[]{"# ", " X", Character.valueOf('#'), Item.fishingRod, Character.valueOf('X'), Item.carrot}).func_92100_c(); -- this.addRecipe(new ItemStack(Block.stairsCobblestone, 4), new Object[]{"# ", "## ", "###", Character.valueOf('#'), Block.cobblestone}); -- this.addRecipe(new ItemStack(Block.stairsBrick, 4), new Object[]{"# ", "## ", "###", Character.valueOf('#'), Block.brick}); -- this.addRecipe(new ItemStack(Block.stairsStoneBrick, 4), new Object[]{"# ", "## ", "###", Character.valueOf('#'), Block.stoneBrick}); -- this.addRecipe(new ItemStack(Block.stairsNetherBrick, 4), new Object[]{"# ", "## ", "###", Character.valueOf('#'), Block.netherBrick}); -- this.addRecipe(new ItemStack(Block.stairsSandStone, 4), new Object[]{"# ", "## ", "###", Character.valueOf('#'), Block.sandStone}); -- this.addRecipe(new ItemStack(Block.stairsNetherQuartz, 4), new Object[]{"# ", "## ", "###", Character.valueOf('#'), Block.blockNetherQuartz}); -- this.addRecipe(new ItemStack(Item.painting, 1), new Object[]{"###", "#X#", "###", Character.valueOf('#'), Item.stick, Character.valueOf('X'), Block.cloth}); -- this.addRecipe(new ItemStack(Item.itemFrame, 1), new Object[]{"###", "#X#", "###", Character.valueOf('#'), Item.stick, Character.valueOf('X'), Item.leather}); -- this.addRecipe(new ItemStack(Item.appleGold, 1, 0), new Object[]{"###", "#X#", "###", Character.valueOf('#'), Item.ingotGold, Character.valueOf('X'), Item.appleRed}); -- this.addRecipe(new ItemStack(Item.appleGold, 1, 1), new Object[]{"###", "#X#", "###", Character.valueOf('#'), Block.blockGold, Character.valueOf('X'), Item.appleRed}); -- this.addRecipe(new ItemStack(Item.goldenCarrot, 1, 0), new Object[]{"###", "#X#", "###", Character.valueOf('#'), Item.goldNugget, Character.valueOf('X'), Item.carrot}); -- this.addRecipe(new ItemStack(Item.speckledMelon, 1), new Object[]{"###", "#X#", "###", Character.valueOf('#'), Item.goldNugget, Character.valueOf('X'), Item.melon}); -- this.addRecipe(new ItemStack(Block.lever, 1), new Object[]{"X", "#", Character.valueOf('#'), Block.cobblestone, Character.valueOf('X'), Item.stick}); -- this.addRecipe(new ItemStack(Block.tripWireSource, 2), new Object[]{"I", "S", "#", Character.valueOf('#'), Block.planks, Character.valueOf('S'), Item.stick, Character.valueOf('I'), Item.ingotIron}); -- this.addRecipe(new ItemStack(Block.torchRedstoneActive, 1), new Object[]{"X", "#", Character.valueOf('#'), Item.stick, Character.valueOf('X'), Item.redstone}); -- this.addRecipe(new ItemStack(Item.redstoneRepeater, 1), new Object[]{"#X#", "III", Character.valueOf('#'), Block.torchRedstoneActive, Character.valueOf('X'), Item.redstone, Character.valueOf('I'), Block.stone}); -- this.addRecipe(new ItemStack(Item.comparator, 1), new Object[]{" # ", "#X#", "III", Character.valueOf('#'), Block.torchRedstoneActive, Character.valueOf('X'), Item.netherQuartz, Character.valueOf('I'), Block.stone}); -- this.addRecipe(new ItemStack(Item.pocketSundial, 1), new Object[]{" # ", "#X#", " # ", Character.valueOf('#'), Item.ingotGold, Character.valueOf('X'), Item.redstone}); -- this.addRecipe(new ItemStack(Item.compass, 1), new Object[]{" # ", "#X#", " # ", Character.valueOf('#'), Item.ingotIron, Character.valueOf('X'), Item.redstone}); -- this.addRecipe(new ItemStack(Item.emptyMap, 1), new Object[]{"###", "#X#", "###", Character.valueOf('#'), Item.paper, Character.valueOf('X'), Item.compass}); -- this.addRecipe(new ItemStack(Block.stoneButton, 1), new Object[]{"#", Character.valueOf('#'), Block.stone}); -- this.addRecipe(new ItemStack(Block.woodenButton, 1), new Object[]{"#", Character.valueOf('#'), Block.planks}); -- this.addRecipe(new ItemStack(Block.pressurePlateStone, 1), new Object[]{"##", Character.valueOf('#'), Block.stone}); -- this.addRecipe(new ItemStack(Block.pressurePlatePlanks, 1), new Object[]{"##", Character.valueOf('#'), Block.planks}); -- this.addRecipe(new ItemStack(Block.pressurePlateIron, 1), new Object[]{"##", Character.valueOf('#'), Item.ingotIron}); -- this.addRecipe(new ItemStack(Block.pressurePlateGold, 1), new Object[]{"##", Character.valueOf('#'), Item.ingotGold}); -- this.addRecipe(new ItemStack(Block.dispenser, 1), new Object[]{"###", "#X#", "#R#", Character.valueOf('#'), Block.cobblestone, Character.valueOf('X'), Item.bow, Character.valueOf('R'), Item.redstone}); -- this.addRecipe(new ItemStack(Block.dropper, 1), new Object[]{"###", "# #", "#R#", Character.valueOf('#'), Block.cobblestone, Character.valueOf('R'), Item.redstone}); -- this.addRecipe(new ItemStack(Block.pistonBase, 1), new Object[]{"TTT", "#X#", "#R#", Character.valueOf('#'), Block.cobblestone, Character.valueOf('X'), Item.ingotIron, Character.valueOf('R'), Item.redstone, Character.valueOf('T'), Block.planks}); -- this.addRecipe(new ItemStack(Block.pistonStickyBase, 1), new Object[]{"S", "P", Character.valueOf('S'), Item.slimeBall, Character.valueOf('P'), Block.pistonBase}); -- this.addRecipe(new ItemStack(Item.bed, 1), new Object[]{"###", "XXX", Character.valueOf('#'), Block.cloth, Character.valueOf('X'), Block.planks}); -- this.addRecipe(new ItemStack(Block.enchantmentTable, 1), new Object[]{" B ", "D#D", "###", Character.valueOf('#'), Block.obsidian, Character.valueOf('B'), Item.book, Character.valueOf('D'), Item.diamond}); -- this.addRecipe(new ItemStack(Block.anvil, 1), new Object[]{"III", " i ", "iii", Character.valueOf('I'), Block.blockIron, Character.valueOf('i'), Item.ingotIron}); -- this.addShapelessRecipe(new ItemStack(Item.eyeOfEnder, 1), new Object[]{Item.enderPearl, Item.blazePowder}); -- this.addShapelessRecipe(new ItemStack(Item.fireballCharge, 3), new Object[]{Item.gunpowder, Item.blazePowder, Item.coal}); -- this.addShapelessRecipe(new ItemStack(Item.fireballCharge, 3), new Object[]{Item.gunpowder, Item.blazePowder, new ItemStack(Item.coal, 1, 1)}); -- this.addRecipe(new ItemStack(Block.daylightSensor), new Object[]{"GGG", "QQQ", "WWW", Character.valueOf('G'), Block.glass, Character.valueOf('Q'), Item.netherQuartz, Character.valueOf('W'), Block.woodSingleSlab}); -- this.addRecipe(new ItemStack(Block.hopperBlock), new Object[]{"I I", "ICI", " I ", Character.valueOf('I'), Item.ingotIron, Character.valueOf('C'), Block.chest}); -- Collections.sort(this.b, new RecipeSorter(this)); -+ this.recipes.add(new RecipesArmorDyes()); -+ this.recipes.add(new RecipesMapCloning()); -+ this.recipes.add(new RecipesMapExtending()); -+ this.recipes.add(new RecipeFireworks()); -+ this.addRecipe(new ItemStack(Item.paper, 3), new Object[] {"###", '#', Item.reed}); -+ this.addShapelessRecipe(new ItemStack(Item.book, 1), new Object[] {Item.paper, Item.paper, Item.paper, Item.leather}); -+ this.addShapelessRecipe(new ItemStack(Item.writableBook, 1), new Object[] {Item.book, new ItemStack(Item.dyePowder, 1, 0), Item.feather}); -+ this.addRecipe(new ItemStack(Block.fence, 2), new Object[] {"###", "###", '#', Item.stick}); -+ this.addRecipe(new ItemStack(Block.cobblestoneWall, 6, 0), new Object[] {"###", "###", '#', Block.cobblestone}); -+ this.addRecipe(new ItemStack(Block.cobblestoneWall, 6, 1), new Object[] {"###", "###", '#', Block.cobblestoneMossy}); -+ this.addRecipe(new ItemStack(Block.netherFence, 6), new Object[] {"###", "###", '#', Block.netherBrick}); -+ this.addRecipe(new ItemStack(Block.fenceGate, 1), new Object[] {"#W#", "#W#", '#', Item.stick, 'W', Block.planks}); -+ this.addRecipe(new ItemStack(Block.jukebox, 1), new Object[] {"###", "#X#", "###", '#', Block.planks, 'X', Item.diamond}); -+ this.addRecipe(new ItemStack(Item.leash, 2), new Object[] {"~~ ", "~O ", " ~", '~', Item.silk, 'O', Item.slimeBall}); -+ this.addRecipe(new ItemStack(Block.music, 1), new Object[] {"###", "#X#", "###", '#', Block.planks, 'X', Item.redstone}); -+ this.addRecipe(new ItemStack(Block.bookShelf, 1), new Object[] {"###", "XXX", "###", '#', Block.planks, 'X', Item.book}); -+ this.addRecipe(new ItemStack(Block.blockSnow, 1), new Object[] {"##", "##", '#', Item.snowball}); -+ this.addRecipe(new ItemStack(Block.snow, 6), new Object[] {"###", '#', Block.blockSnow}); -+ this.addRecipe(new ItemStack(Block.blockClay, 1), new Object[] {"##", "##", '#', Item.clay}); -+ this.addRecipe(new ItemStack(Block.brick, 1), new Object[] {"##", "##", '#', Item.brick}); -+ this.addRecipe(new ItemStack(Block.glowStone, 1), new Object[] {"##", "##", '#', Item.glowstone}); -+ this.addRecipe(new ItemStack(Block.blockNetherQuartz, 1), new Object[] {"##", "##", '#', Item.netherQuartz}); -+ this.addRecipe(new ItemStack(Block.cloth, 1), new Object[] {"##", "##", '#', Item.silk}); -+ this.addRecipe(new ItemStack(Block.tnt, 1), new Object[] {"X#X", "#X#", "X#X", 'X', Item.gunpowder, '#', Block.sand}); -+ this.addRecipe(new ItemStack(Block.stoneSingleSlab, 6, 3), new Object[] {"###", '#', Block.cobblestone}); -+ this.addRecipe(new ItemStack(Block.stoneSingleSlab, 6, 0), new Object[] {"###", '#', Block.stone}); -+ this.addRecipe(new ItemStack(Block.stoneSingleSlab, 6, 1), new Object[] {"###", '#', Block.sandStone}); -+ this.addRecipe(new ItemStack(Block.stoneSingleSlab, 6, 4), new Object[] {"###", '#', Block.brick}); -+ this.addRecipe(new ItemStack(Block.stoneSingleSlab, 6, 5), new Object[] {"###", '#', Block.stoneBrick}); -+ this.addRecipe(new ItemStack(Block.stoneSingleSlab, 6, 6), new Object[] {"###", '#', Block.netherBrick}); -+ this.addRecipe(new ItemStack(Block.stoneSingleSlab, 6, 7), new Object[] {"###", '#', Block.blockNetherQuartz}); -+ this.addRecipe(new ItemStack(Block.woodSingleSlab, 6, 0), new Object[] {"###", '#', new ItemStack(Block.planks, 1, 0)}); -+ this.addRecipe(new ItemStack(Block.woodSingleSlab, 6, 2), new Object[] {"###", '#', new ItemStack(Block.planks, 1, 2)}); -+ this.addRecipe(new ItemStack(Block.woodSingleSlab, 6, 1), new Object[] {"###", '#', new ItemStack(Block.planks, 1, 1)}); -+ this.addRecipe(new ItemStack(Block.woodSingleSlab, 6, 3), new Object[] {"###", '#', new ItemStack(Block.planks, 1, 3)}); -+ this.addRecipe(new ItemStack(Block.ladder, 3), new Object[] {"# #", "###", "# #", '#', Item.stick}); -+ this.addRecipe(new ItemStack(Item.doorWood, 1), new Object[] {"##", "##", "##", '#', Block.planks}); -+ this.addRecipe(new ItemStack(Block.trapdoor, 2), new Object[] {"###", "###", '#', Block.planks}); -+ this.addRecipe(new ItemStack(Item.doorIron, 1), new Object[] {"##", "##", "##", '#', Item.ingotIron}); -+ this.addRecipe(new ItemStack(Item.sign, 3), new Object[] {"###", "###", " X ", '#', Block.planks, 'X', Item.stick}); -+ this.addRecipe(new ItemStack(Item.cake, 1), new Object[] {"AAA", "BEB", "CCC", 'A', Item.bucketMilk, 'B', Item.sugar, 'C', Item.wheat, 'E', Item.egg}); -+ this.addRecipe(new ItemStack(Item.sugar, 1), new Object[] {"#", '#', Item.reed}); -+ this.addRecipe(new ItemStack(Block.planks, 4, 0), new Object[] {"#", '#', new ItemStack(Block.wood, 1, 0)}); -+ this.addRecipe(new ItemStack(Block.planks, 4, 1), new Object[] {"#", '#', new ItemStack(Block.wood, 1, 1)}); -+ this.addRecipe(new ItemStack(Block.planks, 4, 2), new Object[] {"#", '#', new ItemStack(Block.wood, 1, 2)}); -+ this.addRecipe(new ItemStack(Block.planks, 4, 3), new Object[] {"#", '#', new ItemStack(Block.wood, 1, 3)}); -+ this.addRecipe(new ItemStack(Item.stick, 4), new Object[] {"#", "#", '#', Block.planks}); -+ this.addRecipe(new ItemStack(Block.torchWood, 4), new Object[] {"X", "#", 'X', Item.coal, '#', Item.stick}); -+ this.addRecipe(new ItemStack(Block.torchWood, 4), new Object[] {"X", "#", 'X', new ItemStack(Item.coal, 1, 1), '#', Item.stick}); -+ this.addRecipe(new ItemStack(Item.bowlEmpty, 4), new Object[] {"# #", " # ", '#', Block.planks}); -+ this.addRecipe(new ItemStack(Item.glassBottle, 3), new Object[] {"# #", " # ", '#', Block.glass}); -+ this.addRecipe(new ItemStack(Block.rail, 16), new Object[] {"X X", "X#X", "X X", 'X', Item.ingotIron, '#', Item.stick}); -+ this.addRecipe(new ItemStack(Block.railPowered, 6), new Object[] {"X X", "X#X", "XRX", 'X', Item.ingotGold, 'R', Item.redstone, '#', Item.stick}); -+ this.addRecipe(new ItemStack(Block.railActivator, 6), new Object[] {"XSX", "X#X", "XSX", 'X', Item.ingotIron, '#', Block.torchRedstoneActive, 'S', Item.stick}); -+ this.addRecipe(new ItemStack(Block.railDetector, 6), new Object[] {"X X", "X#X", "XRX", 'X', Item.ingotIron, 'R', Item.redstone, '#', Block.pressurePlateStone}); -+ this.addRecipe(new ItemStack(Item.minecartEmpty, 1), new Object[] {"# #", "###", '#', Item.ingotIron}); -+ this.addRecipe(new ItemStack(Item.cauldron, 1), new Object[] {"# #", "# #", "###", '#', Item.ingotIron}); -+ this.addRecipe(new ItemStack(Item.brewingStand, 1), new Object[] {" B ", "###", '#', Block.cobblestone, 'B', Item.blazeRod}); -+ this.addRecipe(new ItemStack(Block.pumpkinLantern, 1), new Object[] {"A", "B", 'A', Block.pumpkin, 'B', Block.torchWood}); -+ this.addRecipe(new ItemStack(Item.minecartCrate, 1), new Object[] {"A", "B", 'A', Block.chest, 'B', Item.minecartEmpty}); -+ this.addRecipe(new ItemStack(Item.minecartPowered, 1), new Object[] {"A", "B", 'A', Block.furnaceIdle, 'B', Item.minecartEmpty}); -+ this.addRecipe(new ItemStack(Item.minecartTnt, 1), new Object[] {"A", "B", 'A', Block.tnt, 'B', Item.minecartEmpty}); -+ this.addRecipe(new ItemStack(Item.minecartHopper, 1), new Object[] {"A", "B", 'A', Block.hopperBlock, 'B', Item.minecartEmpty}); -+ this.addRecipe(new ItemStack(Item.boat, 1), new Object[] {"# #", "###", '#', Block.planks}); -+ this.addRecipe(new ItemStack(Item.bucketEmpty, 1), new Object[] {"# #", " # ", '#', Item.ingotIron}); -+ this.addRecipe(new ItemStack(Item.flowerPot, 1), new Object[] {"# #", " # ", '#', Item.brick}); -+ this.addRecipe(new ItemStack(Item.flintAndSteel, 1), new Object[] {"A ", " B", 'A', Item.ingotIron, 'B', Item.flint}); -+ this.addRecipe(new ItemStack(Item.bread, 1), new Object[] {"###", '#', Item.wheat}); -+ this.addRecipe(new ItemStack(Block.stairsWoodOak, 4), new Object[] {"# ", "## ", "###", '#', new ItemStack(Block.planks, 1, 0)}); -+ this.addRecipe(new ItemStack(Block.stairsWoodBirch, 4), new Object[] {"# ", "## ", "###", '#', new ItemStack(Block.planks, 1, 2)}); -+ this.addRecipe(new ItemStack(Block.stairsWoodSpruce, 4), new Object[] {"# ", "## ", "###", '#', new ItemStack(Block.planks, 1, 1)}); -+ this.addRecipe(new ItemStack(Block.stairsWoodJungle, 4), new Object[] {"# ", "## ", "###", '#', new ItemStack(Block.planks, 1, 3)}); -+ this.addRecipe(new ItemStack(Item.fishingRod, 1), new Object[] {" #", " #X", "# X", '#', Item.stick, 'X', Item.silk}); -+ this.addRecipe(new ItemStack(Item.carrotOnAStick, 1), new Object[] {"# ", " X", '#', Item.fishingRod, 'X', Item.carrot}).func_92100_c(); -+ this.addRecipe(new ItemStack(Block.stairsCobblestone, 4), new Object[] {"# ", "## ", "###", '#', Block.cobblestone}); -+ this.addRecipe(new ItemStack(Block.stairsBrick, 4), new Object[] {"# ", "## ", "###", '#', Block.brick}); -+ this.addRecipe(new ItemStack(Block.stairsStoneBrick, 4), new Object[] {"# ", "## ", "###", '#', Block.stoneBrick}); -+ this.addRecipe(new ItemStack(Block.stairsNetherBrick, 4), new Object[] {"# ", "## ", "###", '#', Block.netherBrick}); -+ this.addRecipe(new ItemStack(Block.stairsSandStone, 4), new Object[] {"# ", "## ", "###", '#', Block.sandStone}); -+ this.addRecipe(new ItemStack(Block.stairsNetherQuartz, 4), new Object[] {"# ", "## ", "###", '#', Block.blockNetherQuartz}); -+ this.addRecipe(new ItemStack(Item.painting, 1), new Object[] {"###", "#X#", "###", '#', Item.stick, 'X', Block.cloth}); -+ this.addRecipe(new ItemStack(Item.itemFrame, 1), new Object[] {"###", "#X#", "###", '#', Item.stick, 'X', Item.leather}); -+ this.addRecipe(new ItemStack(Item.appleGold, 1, 0), new Object[] {"###", "#X#", "###", '#', Item.ingotGold, 'X', Item.appleRed}); -+ this.addRecipe(new ItemStack(Item.appleGold, 1, 1), new Object[] {"###", "#X#", "###", '#', Block.blockGold, 'X', Item.appleRed}); -+ this.addRecipe(new ItemStack(Item.goldenCarrot, 1, 0), new Object[] {"###", "#X#", "###", '#', Item.goldNugget, 'X', Item.carrot}); -+ this.addRecipe(new ItemStack(Item.speckledMelon, 1), new Object[] {"###", "#X#", "###", '#', Item.goldNugget, 'X', Item.melon}); -+ this.addRecipe(new ItemStack(Block.lever, 1), new Object[] {"X", "#", '#', Block.cobblestone, 'X', Item.stick}); -+ this.addRecipe(new ItemStack(Block.tripWireSource, 2), new Object[] {"I", "S", "#", '#', Block.planks, 'S', Item.stick, 'I', Item.ingotIron}); -+ this.addRecipe(new ItemStack(Block.torchRedstoneActive, 1), new Object[] {"X", "#", '#', Item.stick, 'X', Item.redstone}); -+ this.addRecipe(new ItemStack(Item.redstoneRepeater, 1), new Object[] {"#X#", "III", '#', Block.torchRedstoneActive, 'X', Item.redstone, 'I', Block.stone}); -+ this.addRecipe(new ItemStack(Item.comparator, 1), new Object[] {" # ", "#X#", "III", '#', Block.torchRedstoneActive, 'X', Item.netherQuartz, 'I', Block.stone}); -+ this.addRecipe(new ItemStack(Item.pocketSundial, 1), new Object[] {" # ", "#X#", " # ", '#', Item.ingotGold, 'X', Item.redstone}); -+ this.addRecipe(new ItemStack(Item.compass, 1), new Object[] {" # ", "#X#", " # ", '#', Item.ingotIron, 'X', Item.redstone}); -+ this.addRecipe(new ItemStack(Item.emptyMap, 1), new Object[] {"###", "#X#", "###", '#', Item.paper, 'X', Item.compass}); -+ this.addRecipe(new ItemStack(Block.stoneButton, 1), new Object[] {"#", '#', Block.stone}); -+ this.addRecipe(new ItemStack(Block.woodenButton, 1), new Object[] {"#", '#', Block.planks}); -+ this.addRecipe(new ItemStack(Block.pressurePlateStone, 1), new Object[] {"##", '#', Block.stone}); -+ this.addRecipe(new ItemStack(Block.pressurePlatePlanks, 1), new Object[] {"##", '#', Block.planks}); -+ this.addRecipe(new ItemStack(Block.pressurePlateIron, 1), new Object[] {"##", '#', Item.ingotIron}); -+ this.addRecipe(new ItemStack(Block.pressurePlateGold, 1), new Object[] {"##", '#', Item.ingotGold}); -+ this.addRecipe(new ItemStack(Block.dispenser, 1), new Object[] {"###", "#X#", "#R#", '#', Block.cobblestone, 'X', Item.bow, 'R', Item.redstone}); -+ this.addRecipe(new ItemStack(Block.dropper, 1), new Object[] {"###", "# #", "#R#", '#', Block.cobblestone, 'R', Item.redstone}); -+ this.addRecipe(new ItemStack(Block.pistonBase, 1), new Object[] {"TTT", "#X#", "#R#", '#', Block.cobblestone, 'X', Item.ingotIron, 'R', Item.redstone, 'T', Block.planks}); -+ this.addRecipe(new ItemStack(Block.pistonStickyBase, 1), new Object[] {"S", "P", 'S', Item.slimeBall, 'P', Block.pistonBase}); -+ this.addRecipe(new ItemStack(Item.bed, 1), new Object[] {"###", "XXX", '#', Block.cloth, 'X', Block.planks}); -+ this.addRecipe(new ItemStack(Block.enchantmentTable, 1), new Object[] {" B ", "D#D", "###", '#', Block.obsidian, 'B', Item.book, 'D', Item.diamond}); -+ this.addRecipe(new ItemStack(Block.anvil, 1), new Object[] {"III", " i ", "iii", 'I', Block.blockIron, 'i', Item.ingotIron}); -+ this.addShapelessRecipe(new ItemStack(Item.eyeOfEnder, 1), new Object[] {Item.enderPearl, Item.blazePowder}); -+ this.addShapelessRecipe(new ItemStack(Item.fireballCharge, 3), new Object[] {Item.gunpowder, Item.blazePowder, Item.coal}); -+ this.addShapelessRecipe(new ItemStack(Item.fireballCharge, 3), new Object[] {Item.gunpowder, Item.blazePowder, new ItemStack(Item.coal, 1, 1)}); -+ this.addRecipe(new ItemStack(Block.daylightSensor), new Object[] {"GGG", "QQQ", "WWW", 'G', Block.glass, 'Q', Item.netherQuartz, 'W', Block.woodSingleSlab}); -+ this.addRecipe(new ItemStack(Block.hopperBlock), new Object[] {"I I", "ICI", " I ", 'I', Item.ingotIron, 'C', Block.chest}); -+ Collections.sort(this.recipes, new RecipeSorter(this)); -+ // System.out.println(this.recipes.size() + " recipes"); // Spout Removed?!? - } - -- ShapedRecipes addRecipe(ItemStack var1, Object... var2) { -+ public ShapedRecipes addRecipe(ItemStack par1ItemStack, Object ... par2ArrayOfObj) { - String var3 = ""; - int var4 = 0; - int var5 = 0; - int var6 = 0; -- if(var2[var4] instanceof String[]) { -- String[] var11 = (String[])((String[])var2[var4++]); -- -- for(int var8 = 0; var8 < var11.length; ++var8) { -- String var9 = var11[var8]; -+ -+ if (par2ArrayOfObj[var4] instanceof String[]) { -+ String[] var7 = (String[])((String[])par2ArrayOfObj[var4++]); -+ -+ for (int var8 = 0; var8 < var7.length; ++var8) { -+ String var9 = var7[var8]; - ++var6; - var5 = var9.length(); - var3 = var3 + var9; - } - } else { -- while(var2[var4] instanceof String) { -- String var7 = (String)var2[var4++]; -+ while (par2ArrayOfObj[var4] instanceof String) { -+ String var11 = (String)par2ArrayOfObj[var4++]; - ++var6; -- var5 = var7.length(); -- var3 = var3 + var7; -+ var5 = var11.length(); -+ var3 = var3 + var11; - } - } - - HashMap var12; -- for(var12 = new HashMap(); var4 < var2.length; var4 += 2) { -- Character var13 = (Character)var2[var4]; -- ItemStack var15 = null; -- if(var2[var4 + 1] instanceof Item) { -- var15 = new ItemStack((Item)var2[var4 + 1]); -- } else if(var2[var4 + 1] instanceof Block) { -- var15 = new ItemStack((Block)var2[var4 + 1], 1, Short.MAX_VALUE); -- } else if(var2[var4 + 1] instanceof ItemStack) { -- var15 = (ItemStack)var2[var4 + 1]; -+ -+ for (var12 = new HashMap(); var4 < par2ArrayOfObj.length; var4 += 2) { -+ Character var13 = (Character)par2ArrayOfObj[var4]; -+ ItemStack var14 = null; -+ -+ if (par2ArrayOfObj[var4 + 1] instanceof Item) { -+ var14 = new ItemStack((Item)par2ArrayOfObj[var4 + 1]); -+ } else if (par2ArrayOfObj[var4 + 1] instanceof Block) { -+ var14 = new ItemStack((Block)par2ArrayOfObj[var4 + 1], 1, 32767); -+ } else if (par2ArrayOfObj[var4 + 1] instanceof ItemStack) { -+ var14 = (ItemStack)par2ArrayOfObj[var4 + 1]; - } - -- var12.put(var13, var15); -+ var12.put(var13, var14); - } - -- ItemStack[] var14 = new ItemStack[var5 * var6]; -+ ItemStack[] var15 = new ItemStack[var5 * var6]; - -- for(int var16 = 0; var16 < var5 * var6; ++var16) { -+ for (int var16 = 0; var16 < var5 * var6; ++var16) { - char var10 = var3.charAt(var16); -- if(var12.containsKey(Character.valueOf(var10))) { -- var14[var16] = ((ItemStack)var12.get(Character.valueOf(var10))).copy(); -+ -+ if (var12.containsKey(Character.valueOf(var10))) { -+ var15[var16] = ((ItemStack)var12.get(Character.valueOf(var10))).copy(); - } else { -- var14[var16] = null; -+ var15[var16] = null; - } - } - -- ShapedRecipes var17 = new ShapedRecipes(var5, var6, var14, var1); -- this.b.add(var17); -+ ShapedRecipes var17 = new ShapedRecipes(var5, var6, var15, par1ItemStack); -+ this.recipes.add(var17); - return var17; - } - -- void addShapelessRecipe(ItemStack var1, Object... var2) { -+ public void addShapelessRecipe(ItemStack par1ItemStack, Object ... par2ArrayOfObj) { - ArrayList var3 = new ArrayList(); -- Object[] var4 = var2; -- int var5 = var2.length; -+ Object[] var4 = par2ArrayOfObj; -+ int var5 = par2ArrayOfObj.length; - -- for(int var6 = 0; var6 < var5; ++var6) { -+ for (int var6 = 0; var6 < var5; ++var6) { - Object var7 = var4[var6]; -- if(var7 instanceof ItemStack) { -+ -+ if (var7 instanceof ItemStack) { - var3.add(((ItemStack)var7).copy()); -- } else if(var7 instanceof Item) { -+ } else if (var7 instanceof Item) { - var3.add(new ItemStack((Item)var7)); - } else { -- if(!(var7 instanceof Block)) { -+ if (!(var7 instanceof Block)) { - throw new RuntimeException("Invalid shapeless recipy!"); - } - -@@ -210,23 +223,24 @@ - } - } - -- this.b.add(new ShapelessRecipes(var1, var3)); -+ this.recipes.add(new ShapelessRecipes(par1ItemStack, var3)); - } - -- public ItemStack findMatchingRecipe(InventoryCrafting var1, World var2) { -+ public ItemStack findMatchingRecipe(InventoryCrafting par1InventoryCrafting, World par2World) { - int var3 = 0; - ItemStack var4 = null; - ItemStack var5 = null; -- - int var6; -- for(var6 = 0; var6 < var1.getSizeInventory(); ++var6) { -- ItemStack var7 = var1.getStackInSlot(var6); -- if(var7 != null) { -- if(var3 == 0) { -+ -+ for (var6 = 0; var6 < par1InventoryCrafting.getSizeInventory(); ++var6) { -+ ItemStack var7 = par1InventoryCrafting.getStackInSlot(var6); -+ -+ if (var7 != null) { -+ if (var3 == 0) { - var4 = var7; - } - -- if(var3 == 1) { -+ if (var3 == 1) { - var5 = var7; - } - -@@ -234,22 +248,24 @@ - } - } - -- if(var3 == 2 && var4.itemID == var5.itemID && var4.stackSize == 1 && var5.stackSize == 1 && Item.itemsList[var4.itemID].isDamageable()) { -+ if (var3 == 2 && var4.itemID == var5.itemID && var4.stackSize == 1 && var5.stackSize == 1 && Item.itemsList[var4.itemID].isDamageable()) { - Item var11 = Item.itemsList[var4.itemID]; - int var13 = var11.getMaxDamage() - var4.getItemDamageForDisplay(); - int var8 = var11.getMaxDamage() - var5.getItemDamageForDisplay(); - int var9 = var13 + var8 + var11.getMaxDamage() * 5 / 100; - int var10 = var11.getMaxDamage() - var9; -- if(var10 < 0) { -+ -+ if (var10 < 0) { - var10 = 0; - } - - return new ItemStack(var4.itemID, 1, var10); - } else { -- for(var6 = 0; var6 < this.b.size(); ++var6) { -- IRecipe var12 = (IRecipe)this.b.get(var6); -- if(var12.matches(var1, var2)) { -- return var12.getCraftingResult(var1); -+ for (var6 = 0; var6 < this.recipes.size(); ++var6) { -+ IRecipe var12 = (IRecipe)this.recipes.get(var6); -+ -+ if (var12.matches(par1InventoryCrafting, par2World)) { -+ return var12.getCraftingResult(par1InventoryCrafting); - } - } - -@@ -257,7 +273,10 @@ - } - } - -+ /** -+ * returns the List<> of all recipes -+ */ - public List getRecipeList() { -- return this.b; -+ return this.recipes; - } - } ---- net/minecraft/src/CrashReportCategoryEntry.java -+++ net/minecraft/src/CrashReportCategoryEntry.java -@@ -1,27 +1,27 @@ - package net.minecraft.src; - - class CrashReportCategoryEntry { -- private final String a; -- private final String b; -- -- public CrashReportCategoryEntry(String var1, Object var2) { -- this.a = var1; -- if(var2 == null) { -- this.b = "~~NULL~~"; -- } else if(var2 instanceof Throwable) { -- Throwable var3 = (Throwable)var2; -- this.b = "~~ERROR~~ " + var3.getClass().getSimpleName() + ": " + var3.getMessage(); -+ private final String field_85092_a; -+ private final String field_85091_b; -+ -+ public CrashReportCategoryEntry(String par1Str, Object par2Obj) { -+ this.field_85092_a = par1Str; -+ -+ if (par2Obj == null) { -+ this.field_85091_b = "~~NULL~~"; -+ } else if (par2Obj instanceof Throwable) { -+ Throwable var3 = (Throwable)par2Obj; -+ this.field_85091_b = "~~ERROR~~ " + var3.getClass().getSimpleName() + ": " + var3.getMessage(); - } else { -- this.b = var2.toString(); -+ this.field_85091_b = par2Obj.toString(); - } -- - } - - public String func_85089_a() { -- return this.a; -+ return this.field_85092_a; - } - - public String func_85090_b() { -- return this.b; -+ return this.field_85091_b; - } - } ---- net/minecraft/src/ContainerHorseInventorySlotSaddle.java -+++ net/minecraft/src/ContainerHorseInventorySlotSaddle.java -@@ -3,12 +3,15 @@ - class ContainerHorseInventorySlotSaddle extends Slot { - final ContainerHorseInventory field_111239_a; - -- ContainerHorseInventorySlotSaddle(ContainerHorseInventory var1, IInventory var2, int var3, int var4, int var5) { -- super(var2, var3, var4, var5); -- this.field_111239_a = var1; -+ ContainerHorseInventorySlotSaddle(ContainerHorseInventory par1ContainerHorseInventory, IInventory par2IInventory, int par3, int par4, int par5) { -+ super(par2IInventory, par3, par4, par5); -+ this.field_111239_a = par1ContainerHorseInventory; - } - -- public boolean isItemValid(ItemStack var1) { -- return super.isItemValid(var1) && var1.itemID == Item.saddle.itemID && !this.getHasStack(); -+ /** -+ * Check if the stack is a valid item for this slot. Always true beside for the armor slots. -+ */ -+ public boolean isItemValid(ItemStack par1ItemStack) { -+ return super.isItemValid(par1ItemStack) && par1ItemStack.itemID == Item.saddle.itemID && !this.getHasStack(); - } - } ---- /dev/null -+++ org/spoutcraft/api/gui/Screen.java -@@ -1,0 +1,184 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.api.gui; -+ -+import java.util.Set; -+import java.util.UUID; -+ -+import org.spoutcraft.api.UnsafeClass; -+ -+@UnsafeClass -+public interface Screen extends Widget { -+ /** -+ * Gets an array of all the attached widgets to this screen. Modifying this array will not affect the screen. -+ * -+ * @return array of all widgets -+ */ -+ public Widget[] getAttachedWidgets(); -+ -+ /** -+ * Gets an array of all the attached widgets to this screen, and if recursive, any widgets of screens attached to this screen. -+ * -+ * @param recursive whether to get widgets attached to screens attached to this screen. -+ * @return array of all widgets -+ */ -+ public Widget[] getAttachedWidgets(boolean recursive); -+ -+ /** -+ * Gets a set of all the attached widgets to this screen. Modifying this array will not affect the screen. -+ * -+ * @return set of all widgets -+ */ -+ public Set getAttachedWidgetsAsSet(); -+ -+ /** -+ * Gets a set of all the attached widgets to this screen, and if recursive, any widgets of screens attached to this screen. -+ * -+ * @param recursive whether to get widgets attached to screens attached to this screen. -+ * @return set of all widgets -+ */ -+ public Set getAttachedWidgetsAsSet(boolean recursive); -+ -+ /** -+ * Attaches a widget to this screen -+ * -+ * @param widget to attach -+ * @return screen -+ */ -+ @Deprecated -+ public Screen attachWidget(Widget widget); -+ -+ /** -+ * Attaches a widget to this screen -+ * -+ * @param widget to attach -+ * @param Addon that created this widget -+ * @return screen -+ */ -+ public Screen attachWidget(String addon, Widget widget); -+ -+ /** -+ * Attaches an array of widgets to this screen -+ * -+ * @param addon that created this widget -+ * @param widgets to attach -+ * @return screen -+ */ -+ public Screen attachWidgets(String addon, Widget ...widgets); -+ -+ /** -+ * Removes a widget from this screen -+ * -+ * @param widget to remove -+ * @return screen -+ */ -+ public Screen removeWidget(Widget widget); -+ -+ /** -+ * Is true if the screen has the given widget attached to it. Uses a linear search, takes O(n) time to complete. -+ * -+ * @param widget to search for -+ * @return true if the widget was found -+ */ -+ public boolean containsWidget(Widget widget); -+ -+ /** -+ * Is true if the screen has a widget with the given id attached to it. Uses a linear search, takes O(n) time to complete. -+ * -+ * @param id to search for -+ * @return true if the widget was found -+ */ -+ public boolean containsWidget(UUID id); -+ -+ /** -+ * Gets the widget that is associated with the given id, or null if none was found -+ * -+ * @param id to search for -+ * @return widget, or null if none found. -+ */ -+ public Widget getWidget(UUID id); -+ -+ /** -+ * Replaces any attached widget with the given widget's id with the new widget -+ * -+ * @param widget to replace with -+ * @return true if a widget was replaced -+ */ -+ public boolean updateWidget(Widget widget); -+ -+ /** -+ * Is true if this grey background is visible and rendering on the screen -+ * -+ * @return visible -+ */ -+ public boolean isBgVisible(); -+ -+ /** -+ * Sets the visibility of the grey background. If true, it will render normally. If false, it will not appear on the screen. -+ * -+ * @param enable the visibility -+ * @return the screen -+ */ -+ public Screen setBgVisible(boolean enable); -+ -+ /** -+ * Gets the height of the screen -+ * @return height -+ */ -+ public double getHeight(); -+ -+ /** -+ * Gets the width of the screen -+ * @return width -+ */ -+ public double getWidth(); -+ -+ /** -+ * Gets the screen type of this screen -+ * @return the screen type -+ */ -+ public ScreenType getScreenType(); -+ -+ /** -+ * Internal use only -+ * @param mouseX -+ * @return this screen -+ */ -+ public Screen setMouseX(int mouseX); -+ -+ /** -+ * Internal use only -+ * @param mouseY -+ * @return this screen -+ */ -+ public Screen setMouseY(int mouseY); -+ -+ /** -+ * Gets the x coordinate of the mouse on this screen -+ * @return x coordinate of the mouse -+ */ -+ public int getMouseX(); -+ -+ /** -+ * Gets the y coordinate of the mouse on this screen -+ * @return y coordinate of the mouse -+ */ -+ public int getMouseY(); -+} ---- /dev/null -+++ org/spoutcraft/client/gui/minimap/MapWidgetRenderer.java -@@ -1,0 +1,54 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.client.gui.minimap; -+ -+import java.util.NoSuchElementException; -+import java.util.Queue; -+import java.util.concurrent.LinkedBlockingQueue; -+ -+import org.spoutcraft.api.gui.Point; -+ -+public class MapWidgetRenderer extends Thread { -+ public Queue renderQueue = new LinkedBlockingQueue(); -+ -+ public MapWidgetRenderer() { -+ super(); -+ } -+ -+ @Override -+ public void run() { -+ while (true) { -+ while (!renderQueue.isEmpty()) { -+ try { -+ Point coords = renderQueue.remove(); -+ MapWidget.drawChunk(coords.getX(), coords.getY(), true); -+ } catch(NoSuchElementException e) { -+ break; -+ } catch(Exception e) { -+ continue; -+ } -+ } -+ try { -+ Thread.sleep(200); -+ } catch (InterruptedException e) { -+ } -+ } -+ } -+} ---- net/minecraft/src/CommandServerSaveOn.java -+++ net/minecraft/src/CommandServerSaveOn.java -@@ -7,30 +7,34 @@ - return "save-on"; - } - -+ /** -+ * Return the required permission level for this command. -+ */ - public int getRequiredPermissionLevel() { - return 4; - } - -- public String getCommandUsage(ICommandSender var1) { -+ public String getCommandUsage(ICommandSender par1ICommandSender) { - return "commands.save-on.usage"; - } - -- public void processCommand(ICommandSender var1, String[] var2) { -+ public void processCommand(ICommandSender par1ICommandSender, String[] par2ArrayOfStr) { - MinecraftServer var3 = MinecraftServer.getServer(); - boolean var4 = false; - -- for(int var5 = 0; var5 < var3.worldServers.length; ++var5) { -- if(var3.worldServers[var5] != null) { -+ for (int var5 = 0; var5 < var3.worldServers.length; ++var5) { -+ if (var3.worldServers[var5] != null) { - WorldServer var6 = var3.worldServers[var5]; -- if(var6.levelSaving) { -- var6.levelSaving = false; -+ -+ if (var6.canNotSave) { -+ var6.canNotSave = false; - var4 = true; - } - } - } - -- if(var4) { -- notifyAdmins(var1, "commands.save.enabled", new Object[0]); -+ if (var4) { -+ notifyAdmins(par1ICommandSender, "commands.save.enabled", new Object[0]); - } else { - throw new CommandException("commands.save-on.alreadyOn", new Object[0]); - } ---- /dev/null -+++ org/spoutcraft/client/gui/controls/ShortcutBindingItem.java -@@ -1,0 +1,95 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.client.gui.controls; -+ -+import net.minecraft.src.FontRenderer; -+ -+import org.spoutcraft.client.SpoutClient; -+import org.spoutcraft.client.controls.Shortcut; -+import org.spoutcraft.client.controls.SimpleKeyBindingManager; -+import org.spoutcraft.client.gui.MCRenderDelegate; -+ -+public class ShortcutBindingItem extends ControlsBasicItem { -+ private Shortcut shortcut; -+ private ControlsModel parent; -+ private SimpleKeyBindingManager manager = (SimpleKeyBindingManager) SpoutClient.getInstance().getKeyBindingManager(); -+ public ShortcutBindingItem(Shortcut sh, ControlsModel model) { -+ super(model); -+ this.parent = model; -+ shortcut = sh; -+ } -+ -+ public int getHeight() { -+ return 11; -+ } -+ -+ public void render(int x, int y, int width, int height) { -+ MCRenderDelegate r = (MCRenderDelegate) SpoutClient.getInstance().getRenderDelegate(); -+ FontRenderer font = SpoutClient.getHandle().fontRenderer; -+ font.drawStringWithShadow("S", x + 2, y + 2, 0xff00ff00); -+ int w = font.getStringWidth("S"); -+ String keyString = parent.getEditingItem() == this ? "> <" : shortcut.toString(); -+ int w2 = font.getStringWidth(keyString); -+ font.drawStringWithShadow(keyString, width - w2, y + 2, 0xffcccccc); -+ String fitting = r.getFittingText(getName(), width - w - w2 - 4); -+ font.drawStringWithShadow(fitting, x + w + 4, y + 2, !isConflicting() ? 0xffffffff:0xffff0000); -+ } -+ -+ @Override -+ public void setKey(int id) { -+ shortcut.setKey(id); -+ manager.updateBindings(); -+ manager.save(); -+ } -+ -+ @Override -+ public int getKey() { -+ return shortcut.getKey(); -+ } -+ -+ @Override -+ public boolean useModifiers() { -+ return true; -+ } -+ -+ @Override -+ public boolean useMouseButtons() { -+ return true; -+ } -+ -+ @Override -+ public String getName() { -+ return shortcut.getTitle(); -+ } -+ -+ @Override -+ public void setModifiers(int m) { -+ shortcut.setRawModifiers((byte) m); -+ } -+ -+ @Override -+ public int getModifiers() { -+ return shortcut.getModifiers(); -+ } -+ -+ public Shortcut getShortcut() { -+ return shortcut; -+ } -+} ---- /dev/null -+++ org/spoutcraft/client/packet/PacketCustomBlockOverride.java -@@ -1,0 +1,102 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.client.packet; -+ -+import java.io.IOException; -+ -+import org.spoutcraft.api.Spoutcraft; -+import org.spoutcraft.api.io.SpoutInputStream; -+import org.spoutcraft.api.io.SpoutOutputStream; -+import org.spoutcraft.client.SpoutClient; -+ -+public class PacketCustomBlockOverride implements SpoutPacket { -+ private int x; -+ private short y; -+ private int z; -+ private short blockId; -+ private byte data; -+ -+ public PacketCustomBlockOverride() { -+ } -+ -+ public PacketCustomBlockOverride(int x, int y, int z, Integer blockId, Byte data) { -+ this.x = x; -+ this.y = (short) (y & 0xFFFF); -+ this.z = z; -+ setBlockId(blockId); -+ setBlockData(data); -+ } -+ -+ private void setBlockId(Integer blockId) { -+ if (blockId == null) { -+ this.blockId = -1; -+ } else { -+ this.blockId = blockId.shortValue(); -+ } -+ } -+ -+ protected Integer getBlockId() { -+ return blockId == -1 ? null : Integer.valueOf(blockId); -+ } -+ -+ private void setBlockData(Byte data) { -+ if (data == null) { -+ this.data = -1; -+ } else { -+ this.data = data.byteValue(); -+ } -+ } -+ -+ protected Byte getBlockDatas() { -+ return data == -1 ? null : Byte.valueOf(data); -+ } -+ -+ public void readData(SpoutInputStream input) throws IOException { -+ x = input.readInt(); -+ y = input.readShort(); -+ z = input.readInt(); -+ setBlockId((int)input.readShort()); -+ setBlockData((byte) input.read()); -+ } -+ -+ public void writeData(SpoutOutputStream output) throws IOException { -+ output.writeInt(x); -+ output.writeShort(y); -+ output.writeInt(z); -+ output.writeShort(blockId); -+ output.write(data); -+ } -+ -+ public void run(int PlayerId) { -+ Spoutcraft.getChunkAt(SpoutClient.getInstance().getRawWorld(), x, y, z).setCustomBlockId(x, y, z, blockId); -+ Spoutcraft.getChunkAt(SpoutClient.getInstance().getRawWorld(), x, y, z).setCustomBlockData(x, y, z, data); -+ } -+ -+ public PacketType getPacketType() { -+ return PacketType.PacketCustomBlockOverride; -+ } -+ -+ public int getVersion() { -+ return 3; -+ } -+ -+ public void failure(int playerId) { -+ } -+} ---- /dev/null -+++ org/spoutcraft/client/gui/server/LANModel.java -@@ -1,0 +1,56 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.client.gui.server; -+ -+import java.io.IOException; -+import java.util.Iterator; -+ -+import javax.jmdns.JmDNS; -+ -+public class LANModel extends ServerModel { -+ protected JmDNS dns; -+ private static final String SERVICE = "_pipework._tcp.local."; -+ -+ public LANModel() { -+ try { -+ dns = JmDNS.create(); -+ dns.addServiceListener(SERVICE, new MinecraftServiceListener(this)); -+ //System.out.println("Listening for ZeroConf Service '" + SERVICE + "' ..."); -+ } catch (IOException e) { -+ //e.printStackTrace(); -+ } -+ } -+ -+ protected void addItem(ServerItem item) { -+ items.add(item); -+ item.poll(); -+ } -+ -+ protected void removeItem(String unqalifiedServiceName) { -+ Iterator iter = items.iterator(); -+ while (iter.hasNext()) { -+ ServerItem item = iter.next(); -+ if (unqalifiedServiceName.equals(item.getTitle())) { -+ iter.remove(); -+ return; -+ } -+ } -+ } -+} ---- net/minecraft/src/EntitySmallFireball.java -+++ net/minecraft/src/EntitySmallFireball.java -@@ -1,66 +1,80 @@ - package net.minecraft.src; - - public class EntitySmallFireball extends EntityFireball { -- public EntitySmallFireball(World var1) { -- super(var1); -- this.setSize(5.0F / 16.0F, 5.0F / 16.0F); -- } -- -- public EntitySmallFireball(World var1, EntityLivingBase var2, double var3, double var5, double var7) { -- super(var1, var2, var3, var5, var7); -- this.setSize(5.0F / 16.0F, 5.0F / 16.0F); -- } -- -- public EntitySmallFireball(World var1, double var2, double var4, double var6, double var8, double var10, double var12) { -- super(var1, var2, var4, var6, var8, var10, var12); -- this.setSize(5.0F / 16.0F, 5.0F / 16.0F); -- } -- -- protected void onImpact(MovingObjectPosition var1) { -- if(!this.worldObj.isRemote) { -- if(var1.entityHit != null) { -- if(!var1.entityHit.isImmuneToFire() && var1.entityHit.attackEntityFrom(DamageSource.causeFireballDamage(this, this.shootingEntity), 5.0F)) { -- var1.entityHit.setFire(5); -+ public EntitySmallFireball(World par1World) { -+ super(par1World); -+ this.setSize(0.3125F, 0.3125F); -+ } -+ -+ public EntitySmallFireball(World par1World, EntityLivingBase par2EntityLivingBase, double par3, double par5, double par7) { -+ super(par1World, par2EntityLivingBase, par3, par5, par7); -+ this.setSize(0.3125F, 0.3125F); -+ } -+ -+ public EntitySmallFireball(World par1World, double par2, double par4, double par6, double par8, double par10, double par12) { -+ super(par1World, par2, par4, par6, par8, par10, par12); -+ this.setSize(0.3125F, 0.3125F); -+ } -+ -+ /** -+ * Called when this EntityFireball hits a block or entity. -+ */ -+ protected void onImpact(MovingObjectPosition par1MovingObjectPosition) { -+ if (!this.worldObj.isRemote) { -+ if (par1MovingObjectPosition.entityHit != null) { -+ if (!par1MovingObjectPosition.entityHit.isImmuneToFire() && par1MovingObjectPosition.entityHit.attackEntityFrom(DamageSource.causeFireballDamage(this, this.shootingEntity), 5.0F)) { -+ par1MovingObjectPosition.entityHit.setFire(5); - } - } else { -- int var2 = var1.blockX; -- int var3 = var1.blockY; -- int var4 = var1.blockZ; -- switch(var1.sideHit) { -- case 0: -- --var3; -- break; -- case 1: -- ++var3; -- break; -- case 2: -- --var4; -- break; -- case 3: -- ++var4; -- break; -- case 4: -- --var2; -- break; -- case 5: -- ++var2; -+ int var2 = par1MovingObjectPosition.blockX; -+ int var3 = par1MovingObjectPosition.blockY; -+ int var4 = par1MovingObjectPosition.blockZ; -+ -+ switch (par1MovingObjectPosition.sideHit) { -+ case 0: -+ --var3; -+ break; -+ -+ case 1: -+ ++var3; -+ break; -+ -+ case 2: -+ --var4; -+ break; -+ -+ case 3: -+ ++var4; -+ break; -+ -+ case 4: -+ --var2; -+ break; -+ -+ case 5: -+ ++var2; - } - -- if(this.worldObj.isAirBlock(var2, var3, var4)) { -+ if (this.worldObj.isAirBlock(var2, var3, var4)) { - this.worldObj.setBlock(var2, var3, var4, Block.fire.blockID); - } - } - - this.setDead(); - } -- - } - -+ /** -+ * Returns true if other Entities should be prevented from moving through this Entity. -+ */ - public boolean canBeCollidedWith() { - return false; - } - -- public boolean attackEntityFrom(DamageSource var1, float var2) { -+ /** -+ * Called when the entity is attacked. -+ */ -+ public boolean attackEntityFrom(DamageSource par1DamageSource, float par2) { - return false; - } - } ---- net/minecraft/src/TileEntitySpecialRenderer.java -+++ net/minecraft/src/TileEntitySpecialRenderer.java -@@ -1,24 +1,34 @@ - package net.minecraft.src; - - public abstract class TileEntitySpecialRenderer { -+ -+ /** -+ * The TileEntityRenderer instance associated with this TileEntitySpecialRenderer -+ */ - protected TileEntityRenderer tileEntityRenderer; - - public abstract void renderTileEntityAt(TileEntity var1, double var2, double var4, double var6, float var8); - -- protected void bindTexture(ResourceLocation var1) { -+ protected void bindTexture(ResourceLocation par1ResourceLocation) { - TextureManager var2 = this.tileEntityRenderer.renderEngine; -- if(var2 != null) { -- var2.bindTexture(var1); -+ -+ if (var2 != null) { -+ var2.bindTexture(par1ResourceLocation); - } -- -- } -- -- public void setTileEntityRenderer(TileEntityRenderer var1) { -- this.tileEntityRenderer = var1; -- } -- -- public void onWorldChange(World var1) { -- } -+ } -+ -+ /** -+ * Associate a TileEntityRenderer with this TileEntitySpecialRenderer -+ */ -+ public void setTileEntityRenderer(TileEntityRenderer par1TileEntityRenderer) { -+ this.tileEntityRenderer = par1TileEntityRenderer; -+ } -+ -+ /** -+ * Called when the ingame world being rendered changes (e.g. on world -> nether travel) due to using one renderer per -+ * tile entity type, rather than instance -+ */ -+ public void onWorldChange(World par1World) {} - - public FontRenderer getFontRenderer() { - return this.tileEntityRenderer.getFontRenderer(); ---- net/minecraft/src/BlockMelon.java -+++ net/minecraft/src/BlockMelon.java -@@ -5,34 +5,51 @@ - public class BlockMelon extends Block { - private Icon theIcon; - -- protected BlockMelon(int var1) { -- super(var1, Material.pumpkin); -+ protected BlockMelon(int par1) { -+ super(par1, Material.pumpkin); - this.setCreativeTab(CreativeTabs.tabBlock); - } - -- public Icon getIcon(int var1, int var2) { -- return var1 != 1 && var1 != 0 ? this.blockIcon : this.theIcon; -+ /** -+ * From the specified side and block metadata retrieves the blocks texture. Args: side, metadata -+ */ -+ public Icon getIcon(int par1, int par2) { -+ return par1 != 1 && par1 != 0 ? this.blockIcon : this.theIcon; - } - -- public int idDropped(int var1, Random var2, int var3) { -+ /** -+ * Returns the ID of the items to drop on destruction. -+ */ -+ public int idDropped(int par1, Random par2Random, int par3) { - return Item.melon.itemID; - } - -- public int quantityDropped(Random var1) { -- return 3 + var1.nextInt(5); -+ /** -+ * Returns the quantity of items to drop on block destruction. -+ */ -+ public int quantityDropped(Random par1Random) { -+ return 3 + par1Random.nextInt(5); - } - -- public int quantityDroppedWithBonus(int var1, Random var2) { -- int var3 = this.quantityDropped(var2) + var2.nextInt(1 + var1); -- if(var3 > 9) { -+ /** -+ * Returns the usual quantity dropped by the block plus a bonus of 1 to 'i' (inclusive). -+ */ -+ public int quantityDroppedWithBonus(int par1, Random par2Random) { -+ int var3 = this.quantityDropped(par2Random) + par2Random.nextInt(1 + par1); -+ -+ if (var3 > 9) { - var3 = 9; - } - - return var3; - } - -- public void registerIcons(IconRegister var1) { -- this.blockIcon = var1.registerIcon(this.getTextureName() + "_side"); -- this.theIcon = var1.registerIcon(this.getTextureName() + "_top"); -+ /** -+ * When this method is called, your block should register all the icons it needs with the given IconRegister. This is -+ * the only chance you get to register icons. -+ */ -+ public void registerIcons(IconRegister par1IconRegister) { -+ this.blockIcon = par1IconRegister.registerIcon(this.getTextureName() + "_side"); -+ this.theIcon = par1IconRegister.registerIcon(this.getTextureName() + "_top"); - } - } ---- net/minecraft/src/CallableOSInfo.java -+++ net/minecraft/src/CallableOSInfo.java -@@ -3,10 +3,12 @@ - import java.util.concurrent.Callable; - - class CallableOSInfo implements Callable { -+ -+ /** Reference to the CrashReport object. */ - final CrashReport theCrashReport; - -- CallableOSInfo(CrashReport var1) { -- this.theCrashReport = var1; -+ CallableOSInfo(CrashReport par1CrashReport) { -+ this.theCrashReport = par1CrashReport; - } - - public String getOsAsString() { ---- net/minecraft/src/ValueObjectSubscription.java -+++ net/minecraft/src/ValueObjectSubscription.java -@@ -8,15 +8,17 @@ - public long field_98171_a; - public int field_98170_b; - -- public static ValueObjectSubscription func_98169_a(String var0) { -+ public static ValueObjectSubscription func_98169_a(String par0Str) { - ValueObjectSubscription var1 = new ValueObjectSubscription(); - - try { -- JsonRootNode var2 = (new JdomParser()).parse(var0); -- var1.field_98171_a = Long.parseLong(var2.getNumberValue(new Object[]{"startDate"})); -- var1.field_98170_b = Integer.parseInt(var2.getNumberValue(new Object[]{"daysLeft"})); -+ JsonRootNode var2 = (new JdomParser()).parse(par0Str); -+ var1.field_98171_a = Long.parseLong(var2.getNumberValue(new Object[] {"startDate"})); -+ var1.field_98170_b = Integer.parseInt(var2.getNumberValue(new Object[] {"daysLeft"})); - } catch (InvalidSyntaxException var3) { -+ ; - } catch (IllegalArgumentException var4) { -+ ; - } - - return var1; ---- net/minecraft/src/MD5String.java -+++ net/minecraft/src/MD5String.java -@@ -5,15 +5,20 @@ - import java.security.NoSuchAlgorithmException; - - public class MD5String { -- private String a; -- -- public MD5String(String var1) { -- this.a = var1; -+ -+ /** The salt prepended to the string to be hashed */ -+ private String salt; -+ -+ public MD5String(String par1Str) { -+ this.salt = par1Str; - } - -- public String getMD5String(String var1) { -+ /** -+ * Gets the MD5 string -+ */ -+ public String getMD5String(String par1Str) { - try { -- String var2 = this.a + var1; -+ String var2 = this.salt + par1Str; - MessageDigest var3 = MessageDigest.getInstance("MD5"); - var3.update(var2.getBytes(), 0, var2.length()); - return (new BigInteger(1, var3.digest())).toString(16); ---- /dev/null -+++ org/spoutcraft/client/gui/database/UrlElement.java -@@ -1,0 +1,40 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.client.gui.database; -+ -+public interface UrlElement { -+ /** -+ * Return if the element should be in the URL (as in, is it enabled?) -+ * @return -+ */ -+ boolean isActive(); -+ -+ /** -+ * Should return something like 'key=value&key2=val' -+ * &-signs are inserted automagically. -+ * @return -+ */ -+ String getUrlPart(); -+ -+ /** -+ * Clear so the item won't be active -+ */ -+ void clear(); -+} ---- /dev/null -+++ org/spoutcraft/client/player/accessories/NotchHat.java -@@ -1,0 +1,56 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.client.player.accessories; -+ -+import net.minecraft.src.EntityPlayer; -+import net.minecraft.src.ModelBiped; -+import net.minecraft.src.ModelRenderer; -+ -+public class NotchHat extends Accessory{ -+ public ModelRenderer NotchHatTop; -+ public ModelRenderer NotchHatBottom; -+ -+ public NotchHat(ModelBiped mb) { -+ super(mb); -+ NotchHatTop = new ModelRenderer(mb, 0, 0); -+ NotchHatTop.addBox(-5F, -9F, -5F, 10, 1, 10); -+ NotchHatBottom = new ModelRenderer(mb, 0, 11); -+ NotchHatBottom.addBox(-4F, -13F, -4F, 8, 4, 8); -+ } -+ -+ @Override -+ public void render(EntityPlayer plr, float f) { -+ NotchHatTop.rotateAngleY = getModel().bipedHead.rotateAngleY; -+ NotchHatTop.rotateAngleX = getModel().bipedHead.rotateAngleX; -+ NotchHatTop.rotationPointX = 0.0F; -+ NotchHatTop.rotationPointY = 0.0F; -+ NotchHatTop.render(f); -+ NotchHatBottom.rotateAngleY = getModel().bipedHead.rotateAngleY; -+ NotchHatBottom.rotateAngleX = getModel().bipedHead.rotateAngleX; -+ NotchHatBottom.rotationPointX = 0.0F; -+ NotchHatBottom.rotationPointY = 0.0F; -+ NotchHatBottom.render(f); -+ } -+ -+ @Override -+ public AccessoryType getType() { -+ return AccessoryType.NOTCHHAT; -+ } -+} ---- net/minecraft/src/ComponentStrongholdStraight.java -+++ net/minecraft/src/ComponentStrongholdStraight.java -@@ -7,64 +7,71 @@ - private boolean expandsX; - private boolean expandsZ; - -- public ComponentStrongholdStraight() { -- } -- -- public ComponentStrongholdStraight(int var1, Random var2, StructureBoundingBox var3, int var4) { -- super(var1); -- this.coordBaseMode = var4; -- this.field_143013_d = this.getRandomDoor(var2); -- this.boundingBox = var3; -- this.expandsX = var2.nextInt(2) == 0; -- this.expandsZ = var2.nextInt(2) == 0; -- } -- -- protected void func_143012_a(NBTTagCompound var1) { -- super.func_143012_a(var1); -- var1.setBoolean("Left", this.expandsX); -- var1.setBoolean("Right", this.expandsZ); -- } -- -- protected void func_143011_b(NBTTagCompound var1) { -- super.func_143011_b(var1); -- this.expandsX = var1.getBoolean("Left"); -- this.expandsZ = var1.getBoolean("Right"); -- } -- -- public void buildComponent(StructureComponent var1, List var2, Random var3) { -- this.getNextComponentNormal((ComponentStrongholdStairs2)var1, var2, var3, 1, 1); -- if(this.expandsX) { -- this.getNextComponentX((ComponentStrongholdStairs2)var1, var2, var3, 1, 2); -- } -- -- if(this.expandsZ) { -- this.getNextComponentZ((ComponentStrongholdStairs2)var1, var2, var3, 1, 2); -- } -- -- } -- -- public static ComponentStrongholdStraight findValidPlacement(List var0, Random var1, int var2, int var3, int var4, int var5, int var6) { -- StructureBoundingBox var7 = StructureBoundingBox.getComponentToAddBoundingBox(var2, var3, var4, -1, -1, 0, 5, 5, 7, var5); -- return canStrongholdGoDeeper(var7) && StructureComponent.findIntersecting(var0, var7) == null ? new ComponentStrongholdStraight(var6, var1, var7, var5) : null; -- } -- -- public boolean addComponentParts(World var1, Random var2, StructureBoundingBox var3) { -- if(this.isLiquidInStructureBoundingBox(var1, var3)) { -+ public ComponentStrongholdStraight() {} -+ -+ public ComponentStrongholdStraight(int par1, Random par2Random, StructureBoundingBox par3StructureBoundingBox, int par4) { -+ super(par1); -+ this.coordBaseMode = par4; -+ this.field_143013_d = this.getRandomDoor(par2Random); -+ this.boundingBox = par3StructureBoundingBox; -+ this.expandsX = par2Random.nextInt(2) == 0; -+ this.expandsZ = par2Random.nextInt(2) == 0; -+ } -+ -+ protected void func_143012_a(NBTTagCompound par1NBTTagCompound) { -+ super.func_143012_a(par1NBTTagCompound); -+ par1NBTTagCompound.setBoolean("Left", this.expandsX); -+ par1NBTTagCompound.setBoolean("Right", this.expandsZ); -+ } -+ -+ protected void func_143011_b(NBTTagCompound par1NBTTagCompound) { -+ super.func_143011_b(par1NBTTagCompound); -+ this.expandsX = par1NBTTagCompound.getBoolean("Left"); -+ this.expandsZ = par1NBTTagCompound.getBoolean("Right"); -+ } -+ -+ /** -+ * Initiates construction of the Structure Component picked, at the current Location of StructGen -+ */ -+ public void buildComponent(StructureComponent par1StructureComponent, List par2List, Random par3Random) { -+ this.getNextComponentNormal((ComponentStrongholdStairs2)par1StructureComponent, par2List, par3Random, 1, 1); -+ -+ if (this.expandsX) { -+ this.getNextComponentX((ComponentStrongholdStairs2)par1StructureComponent, par2List, par3Random, 1, 2); -+ } -+ -+ if (this.expandsZ) { -+ this.getNextComponentZ((ComponentStrongholdStairs2)par1StructureComponent, par2List, par3Random, 1, 2); -+ } -+ } -+ -+ public static ComponentStrongholdStraight findValidPlacement(List par0List, Random par1Random, int par2, int par3, int par4, int par5, int par6) { -+ StructureBoundingBox var7 = StructureBoundingBox.getComponentToAddBoundingBox(par2, par3, par4, -1, -1, 0, 5, 5, 7, par5); -+ return canStrongholdGoDeeper(var7) && StructureComponent.findIntersecting(par0List, var7) == null ? new ComponentStrongholdStraight(par6, par1Random, var7, par5) : null; -+ } -+ -+ /** -+ * second Part of Structure generating, this for example places Spiderwebs, Mob Spawners, it closes Mineshafts at the -+ * end, it adds Fences... -+ */ -+ public boolean addComponentParts(World par1World, Random par2Random, StructureBoundingBox par3StructureBoundingBox) { -+ if (this.isLiquidInStructureBoundingBox(par1World, par3StructureBoundingBox)) { - return false; - } else { -- this.fillWithRandomizedBlocks(var1, var3, 0, 0, 0, 4, 4, 6, true, var2, StructureStrongholdPieces.getStrongholdStones()); -- this.placeDoor(var1, var2, var3, this.field_143013_d, 1, 1, 0); -- this.placeDoor(var1, var2, var3, EnumDoor.OPENING, 1, 1, 6); -- this.randomlyPlaceBlock(var1, var3, var2, 0.1F, 1, 2, 1, Block.torchWood.blockID, 0); -- this.randomlyPlaceBlock(var1, var3, var2, 0.1F, 3, 2, 1, Block.torchWood.blockID, 0); -- this.randomlyPlaceBlock(var1, var3, var2, 0.1F, 1, 2, 5, Block.torchWood.blockID, 0); -- this.randomlyPlaceBlock(var1, var3, var2, 0.1F, 3, 2, 5, Block.torchWood.blockID, 0); -- if(this.expandsX) { -- this.fillWithBlocks(var1, var3, 0, 1, 2, 0, 3, 4, 0, 0, false); -+ this.fillWithRandomizedBlocks(par1World, par3StructureBoundingBox, 0, 0, 0, 4, 4, 6, true, par2Random, StructureStrongholdPieces.getStrongholdStones()); -+ this.placeDoor(par1World, par2Random, par3StructureBoundingBox, this.field_143013_d, 1, 1, 0); -+ this.placeDoor(par1World, par2Random, par3StructureBoundingBox, EnumDoor.OPENING, 1, 1, 6); -+ this.randomlyPlaceBlock(par1World, par3StructureBoundingBox, par2Random, 0.1F, 1, 2, 1, Block.torchWood.blockID, 0); -+ this.randomlyPlaceBlock(par1World, par3StructureBoundingBox, par2Random, 0.1F, 3, 2, 1, Block.torchWood.blockID, 0); -+ this.randomlyPlaceBlock(par1World, par3StructureBoundingBox, par2Random, 0.1F, 1, 2, 5, Block.torchWood.blockID, 0); -+ this.randomlyPlaceBlock(par1World, par3StructureBoundingBox, par2Random, 0.1F, 3, 2, 5, Block.torchWood.blockID, 0); -+ -+ if (this.expandsX) { -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 0, 1, 2, 0, 3, 4, 0, 0, false); - } - -- if(this.expandsZ) { -- this.fillWithBlocks(var1, var3, 4, 1, 2, 4, 3, 4, 0, 0, false); -+ if (this.expandsZ) { -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 4, 1, 2, 4, 3, 4, 0, 0, false); - } - - return true; ---- net/minecraft/src/PathFinder.java -+++ net/minecraft/src/PathFinder.java -@@ -1,86 +1,118 @@ - package net.minecraft.src; - - public class PathFinder { -+ -+ /** Used to find obstacles */ - private IBlockAccess worldMap; -+ -+ /** The path being generated */ - private Path path = new Path(); -+ -+ /** The points in the path */ - private IntHashMap pointMap = new IntHashMap(); -+ -+ /** Selection of path points to add to the path */ - private PathPoint[] pathOptions = new PathPoint[32]; -+ -+ /** should the PathFinder go through wodden door blocks */ - private boolean isWoddenDoorAllowed; -+ -+ /** -+ * should the PathFinder disregard BlockMovement type materials in its path -+ */ - private boolean isMovementBlockAllowed; - private boolean isPathingInWater; -+ -+ /** tells the FathFinder to not stop pathing underwater */ - private boolean canEntityDrown; - -- public PathFinder(IBlockAccess var1, boolean var2, boolean var3, boolean var4, boolean var5) { -- this.worldMap = var1; -- this.isWoddenDoorAllowed = var2; -- this.isMovementBlockAllowed = var3; -- this.isPathingInWater = var4; -- this.canEntityDrown = var5; -- } -- -- public PathEntity createEntityPathTo(Entity var1, Entity var2, float var3) { -- return this.createEntityPathTo(var1, var2.posX, var2.boundingBox.minY, var2.posZ, var3); -- } -- -- public PathEntity createEntityPathTo(Entity var1, int var2, int var3, int var4, float var5) { -- return this.createEntityPathTo(var1, (double)((float)var2 + 0.5F), (double)((float)var3 + 0.5F), (double)((float)var4 + 0.5F), var5); -- } -- -- private PathEntity createEntityPathTo(Entity var1, double var2, double var4, double var6, float var8) { -+ public PathFinder(IBlockAccess par1IBlockAccess, boolean par2, boolean par3, boolean par4, boolean par5) { -+ this.worldMap = par1IBlockAccess; -+ this.isWoddenDoorAllowed = par2; -+ this.isMovementBlockAllowed = par3; -+ this.isPathingInWater = par4; -+ this.canEntityDrown = par5; -+ } -+ -+ /** -+ * Creates a path from one entity to another within a minimum distance -+ */ -+ public PathEntity createEntityPathTo(Entity par1Entity, Entity par2Entity, float par3) { -+ return this.createEntityPathTo(par1Entity, par2Entity.posX, par2Entity.boundingBox.minY, par2Entity.posZ, par3); -+ } -+ -+ /** -+ * Creates a path from an entity to a specified location within a minimum distance -+ */ -+ public PathEntity createEntityPathTo(Entity par1Entity, int par2, int par3, int par4, float par5) { -+ return this.createEntityPathTo(par1Entity, (double)((float)par2 + 0.5F), (double)((float)par3 + 0.5F), (double)((float)par4 + 0.5F), par5); -+ } -+ -+ /** -+ * Internal implementation of creating a path from an entity to a point -+ */ -+ private PathEntity createEntityPathTo(Entity par1Entity, double par2, double par4, double par6, float par8) { - this.path.clearPath(); - this.pointMap.clearMap(); - boolean var9 = this.isPathingInWater; -- int var10 = MathHelper.floor_double(var1.boundingBox.minY + 0.5D); -- if(this.canEntityDrown && var1.isInWater()) { -- var10 = (int)var1.boundingBox.minY; -- -- for(int var11 = this.worldMap.getBlockId(MathHelper.floor_double(var1.posX), var10, MathHelper.floor_double(var1.posZ)); var11 == Block.waterMoving.blockID || var11 == Block.waterStill.blockID; var11 = this.worldMap.getBlockId(MathHelper.floor_double(var1.posX), var10, MathHelper.floor_double(var1.posZ))) { -+ int var10 = MathHelper.floor_double(par1Entity.boundingBox.minY + 0.5D); -+ -+ if (this.canEntityDrown && par1Entity.isInWater()) { -+ var10 = (int)par1Entity.boundingBox.minY; -+ -+ for (int var11 = this.worldMap.getBlockId(MathHelper.floor_double(par1Entity.posX), var10, MathHelper.floor_double(par1Entity.posZ)); var11 == Block.waterMoving.blockID || var11 == Block.waterStill.blockID; var11 = this.worldMap.getBlockId(MathHelper.floor_double(par1Entity.posX), var10, MathHelper.floor_double(par1Entity.posZ))) { - ++var10; - } - - var9 = this.isPathingInWater; - this.isPathingInWater = false; - } else { -- var10 = MathHelper.floor_double(var1.boundingBox.minY + 0.5D); -+ var10 = MathHelper.floor_double(par1Entity.boundingBox.minY + 0.5D); - } - -- PathPoint var15 = this.openPoint(MathHelper.floor_double(var1.boundingBox.minX), var10, MathHelper.floor_double(var1.boundingBox.minZ)); -- PathPoint var12 = this.openPoint(MathHelper.floor_double(var2 - (double)(var1.width / 2.0F)), MathHelper.floor_double(var4), MathHelper.floor_double(var6 - (double)(var1.width / 2.0F))); -- PathPoint var13 = new PathPoint(MathHelper.floor_float(var1.width + 1.0F), MathHelper.floor_float(var1.height + 1.0F), MathHelper.floor_float(var1.width + 1.0F)); -- PathEntity var14 = this.addToPath(var1, var15, var12, var13, var8); -+ PathPoint var15 = this.openPoint(MathHelper.floor_double(par1Entity.boundingBox.minX), var10, MathHelper.floor_double(par1Entity.boundingBox.minZ)); -+ PathPoint var12 = this.openPoint(MathHelper.floor_double(par2 - (double)(par1Entity.width / 2.0F)), MathHelper.floor_double(par4), MathHelper.floor_double(par6 - (double)(par1Entity.width / 2.0F))); -+ PathPoint var13 = new PathPoint(MathHelper.floor_float(par1Entity.width + 1.0F), MathHelper.floor_float(par1Entity.height + 1.0F), MathHelper.floor_float(par1Entity.width + 1.0F)); -+ PathEntity var14 = this.addToPath(par1Entity, var15, var12, var13, par8); - this.isPathingInWater = var9; - return var14; - } - -- private PathEntity addToPath(Entity var1, PathPoint var2, PathPoint var3, PathPoint var4, float var5) { -- var2.totalPathDistance = 0.0F; -- var2.distanceToNext = var2.func_75832_b(var3); -- var2.distanceToTarget = var2.distanceToNext; -+ /** -+ * Adds a path from start to end and returns the whole path (args: unused, start, end, unused, maxDistance) -+ */ -+ private PathEntity addToPath(Entity par1Entity, PathPoint par2PathPoint, PathPoint par3PathPoint, PathPoint par4PathPoint, float par5) { -+ par2PathPoint.totalPathDistance = 0.0F; -+ par2PathPoint.distanceToNext = par2PathPoint.func_75832_b(par3PathPoint); -+ par2PathPoint.distanceToTarget = par2PathPoint.distanceToNext; - this.path.clearPath(); -- this.path.addPoint(var2); -- PathPoint var6 = var2; -+ this.path.addPoint(par2PathPoint); -+ PathPoint var6 = par2PathPoint; - -- while(!this.path.isPathEmpty()) { -+ while (!this.path.isPathEmpty()) { - PathPoint var7 = this.path.dequeue(); -- if(var7.equals(var3)) { -- return this.createEntityPath(var2, var3); -+ -+ if (var7.equals(par3PathPoint)) { -+ return this.createEntityPath(par2PathPoint, par3PathPoint); - } - -- if(var7.func_75832_b(var3) < var6.func_75832_b(var3)) { -+ if (var7.func_75832_b(par3PathPoint) < var6.func_75832_b(par3PathPoint)) { - var6 = var7; - } - - var7.isFirst = true; -- int var8 = this.findPathOptions(var1, var7, var4, var3, var5); -+ int var8 = this.findPathOptions(par1Entity, var7, par4PathPoint, par3PathPoint, par5); - -- for(int var9 = 0; var9 < var8; ++var9) { -+ for (int var9 = 0; var9 < var8; ++var9) { - PathPoint var10 = this.pathOptions[var9]; - float var11 = var7.totalPathDistance + var7.func_75832_b(var10); -- if(!var10.isAssigned() || var11 < var10.totalPathDistance) { -+ -+ if (!var10.isAssigned() || var11 < var10.totalPathDistance) { - var10.previous = var7; - var10.totalPathDistance = var11; -- var10.distanceToNext = var10.func_75832_b(var3); -- if(var10.isAssigned()) { -+ var10.distanceToNext = var10.func_75832_b(par3PathPoint); -+ -+ if (var10.isAssigned()) { - this.path.changeDistance(var10, var10.totalPathDistance + var10.distanceToNext); - } else { - var10.distanceToTarget = var10.totalPathDistance + var10.distanceToNext; -@@ -90,83 +122,95 @@ - } - } - -- if(var6 == var2) { -+ if (var6 == par2PathPoint) { - return null; - } else { -- return this.createEntityPath(var2, var6); -+ return this.createEntityPath(par2PathPoint, var6); - } - } - -- private int findPathOptions(Entity var1, PathPoint var2, PathPoint var3, PathPoint var4, float var5) { -+ /** -+ * populates pathOptions with available points and returns the number of options found (args: unused1, currentPoint, -+ * unused2, targetPoint, maxDistance) -+ */ -+ private int findPathOptions(Entity par1Entity, PathPoint par2PathPoint, PathPoint par3PathPoint, PathPoint par4PathPoint, float par5) { - int var6 = 0; - byte var7 = 0; -- if(this.getVerticalOffset(var1, var2.xCoord, var2.yCoord + 1, var2.zCoord, var3) == 1) { -+ -+ if (this.getVerticalOffset(par1Entity, par2PathPoint.xCoord, par2PathPoint.yCoord + 1, par2PathPoint.zCoord, par3PathPoint) == 1) { - var7 = 1; - } - -- PathPoint var8 = this.getSafePoint(var1, var2.xCoord, var2.yCoord, var2.zCoord + 1, var3, var7); -- PathPoint var9 = this.getSafePoint(var1, var2.xCoord - 1, var2.yCoord, var2.zCoord, var3, var7); -- PathPoint var10 = this.getSafePoint(var1, var2.xCoord + 1, var2.yCoord, var2.zCoord, var3, var7); -- PathPoint var11 = this.getSafePoint(var1, var2.xCoord, var2.yCoord, var2.zCoord - 1, var3, var7); -- if(var8 != null && !var8.isFirst && var8.distanceTo(var4) < var5) { -+ PathPoint var8 = this.getSafePoint(par1Entity, par2PathPoint.xCoord, par2PathPoint.yCoord, par2PathPoint.zCoord + 1, par3PathPoint, var7); -+ PathPoint var9 = this.getSafePoint(par1Entity, par2PathPoint.xCoord - 1, par2PathPoint.yCoord, par2PathPoint.zCoord, par3PathPoint, var7); -+ PathPoint var10 = this.getSafePoint(par1Entity, par2PathPoint.xCoord + 1, par2PathPoint.yCoord, par2PathPoint.zCoord, par3PathPoint, var7); -+ PathPoint var11 = this.getSafePoint(par1Entity, par2PathPoint.xCoord, par2PathPoint.yCoord, par2PathPoint.zCoord - 1, par3PathPoint, var7); -+ -+ if (var8 != null && !var8.isFirst && var8.distanceTo(par4PathPoint) < par5) { - this.pathOptions[var6++] = var8; - } - -- if(var9 != null && !var9.isFirst && var9.distanceTo(var4) < var5) { -+ if (var9 != null && !var9.isFirst && var9.distanceTo(par4PathPoint) < par5) { - this.pathOptions[var6++] = var9; - } - -- if(var10 != null && !var10.isFirst && var10.distanceTo(var4) < var5) { -+ if (var10 != null && !var10.isFirst && var10.distanceTo(par4PathPoint) < par5) { - this.pathOptions[var6++] = var10; - } - -- if(var11 != null && !var11.isFirst && var11.distanceTo(var4) < var5) { -+ if (var11 != null && !var11.isFirst && var11.distanceTo(par4PathPoint) < par5) { - this.pathOptions[var6++] = var11; - } - - return var6; - } - -- private PathPoint getSafePoint(Entity var1, int var2, int var3, int var4, PathPoint var5, int var6) { -+ /** -+ * Returns a point that the entity can safely move to -+ */ -+ private PathPoint getSafePoint(Entity par1Entity, int par2, int par3, int par4, PathPoint par5PathPoint, int par6) { - PathPoint var7 = null; -- int var8 = this.getVerticalOffset(var1, var2, var3, var4, var5); -- if(var8 == 2) { -- return this.openPoint(var2, var3, var4); -+ int var8 = this.getVerticalOffset(par1Entity, par2, par3, par4, par5PathPoint); -+ -+ if (var8 == 2) { -+ return this.openPoint(par2, par3, par4); - } else { -- if(var8 == 1) { -- var7 = this.openPoint(var2, var3, var4); -- } -- -- if(var7 == null && var6 > 0 && var8 != -3 && var8 != -4 && this.getVerticalOffset(var1, var2, var3 + var6, var4, var5) == 1) { -- var7 = this.openPoint(var2, var3 + var6, var4); -- var3 += var6; -- } -- -- if(var7 != null) { -+ if (var8 == 1) { -+ var7 = this.openPoint(par2, par3, par4); -+ } -+ -+ if (var7 == null && par6 > 0 && var8 != -3 && var8 != -4 && this.getVerticalOffset(par1Entity, par2, par3 + par6, par4, par5PathPoint) == 1) { -+ var7 = this.openPoint(par2, par3 + par6, par4); -+ par3 += par6; -+ } -+ -+ if (var7 != null) { - int var9 = 0; - int var10 = 0; - -- while(var3 > 0) { -- var10 = this.getVerticalOffset(var1, var2, var3 - 1, var4, var5); -- if(this.isPathingInWater && var10 == -1) { -+ while (par3 > 0) { -+ var10 = this.getVerticalOffset(par1Entity, par2, par3 - 1, par4, par5PathPoint); -+ -+ if (this.isPathingInWater && var10 == -1) { - return null; - } - -- if(var10 != 1) { -+ if (var10 != 1) { - break; - } - -- if(var9++ >= var1.getMaxSafePointTries()) { -+ if (var9++ >= par1Entity.getMaxSafePointTries()) { - return null; - } - -- --var3; -- if(var3 > 0) { -- var7 = this.openPoint(var2, var3, var4); -+ --par3; -+ -+ if (par3 > 0) { -+ var7 = this.openPoint(par2, par3, par4); - } - } - -- if(var10 == -2) { -+ if (var10 == -2) { - return null; - } - } -@@ -175,37 +219,47 @@ - } - } - -- private final PathPoint openPoint(int var1, int var2, int var3) { -- int var4 = PathPoint.makeHash(var1, var2, var3); -+ /** -+ * Returns a mapped point or creates and adds one -+ */ -+ private final PathPoint openPoint(int par1, int par2, int par3) { -+ int var4 = PathPoint.makeHash(par1, par2, par3); - PathPoint var5 = (PathPoint)this.pointMap.lookup(var4); -- if(var5 == null) { -- var5 = new PathPoint(var1, var2, var3); -+ -+ if (var5 == null) { -+ var5 = new PathPoint(par1, par2, par3); - this.pointMap.addKey(var4, var5); - } - - return var5; - } - -- public int getVerticalOffset(Entity var1, int var2, int var3, int var4, PathPoint var5) { -- return func_82565_a(var1, var2, var3, var4, var5, this.isPathingInWater, this.isMovementBlockAllowed, this.isWoddenDoorAllowed); -+ /** -+ * Checks if an entity collides with blocks at a position. Returns 1 if clear, 0 for colliding with any solid block, -1 -+ * for water(if avoiding water) but otherwise clear, -2 for lava, -3 for fence, -4 for closed trapdoor, 2 if otherwise -+ * clear except for open trapdoor or water(if not avoiding) -+ */ -+ public int getVerticalOffset(Entity par1Entity, int par2, int par3, int par4, PathPoint par5PathPoint) { -+ return func_82565_a(par1Entity, par2, par3, par4, par5PathPoint, this.isPathingInWater, this.isMovementBlockAllowed, this.isWoddenDoorAllowed); - } - -- public static int func_82565_a(Entity var0, int var1, int var2, int var3, PathPoint var4, boolean var5, boolean var6, boolean var7) { -+ public static int func_82565_a(Entity par0Entity, int par1, int par2, int par3, PathPoint par4PathPoint, boolean par5, boolean par6, boolean par7) { - boolean var8 = false; - -- for(int var9 = var1; var9 < var1 + var4.xCoord; ++var9) { -- for(int var10 = var2; var10 < var2 + var4.yCoord; ++var10) { -- for(int var11 = var3; var11 < var3 + var4.zCoord; ++var11) { -- int var12 = var0.worldObj.getBlockId(var9, var10, var11); -- if(var12 > 0) { -- if(var12 == Block.trapdoor.blockID) { -+ for (int var9 = par1; var9 < par1 + par4PathPoint.xCoord; ++var9) { -+ for (int var10 = par2; var10 < par2 + par4PathPoint.yCoord; ++var10) { -+ for (int var11 = par3; var11 < par3 + par4PathPoint.zCoord; ++var11) { -+ int var12 = par0Entity.worldObj.getBlockId(var9, var10, var11); -+ -+ if (var12 > 0) { -+ if (var12 == Block.trapdoor.blockID) { - var8 = true; -- } else if(var12 != Block.waterMoving.blockID && var12 != Block.waterStill.blockID) { -- if(!var7 && var12 == Block.doorWood.blockID) { -+ } else if (var12 != Block.waterMoving.blockID && var12 != Block.waterStill.blockID) { -+ if (!par7 && var12 == Block.doorWood.blockID) { - return 0; - } - } else { -- if(var5) { -+ if (par5) { - return -1; - } - -@@ -214,28 +268,31 @@ - - Block var13 = Block.blocksList[var12]; - int var14 = var13.getRenderType(); -- if(var0.worldObj.blockGetRenderType(var9, var10, var11) == 9) { -- int var18 = MathHelper.floor_double(var0.posX); -- int var16 = MathHelper.floor_double(var0.posY); -- int var17 = MathHelper.floor_double(var0.posZ); -- if(var0.worldObj.blockGetRenderType(var18, var16, var17) != 9 && var0.worldObj.blockGetRenderType(var18, var16 - 1, var17) != 9) { -- return -3; -- } -- } else if(!var13.getBlocksMovement(var0.worldObj, var9, var10, var11) && (!var6 || var12 != Block.doorWood.blockID)) { -- if(var14 == 11 || var12 == Block.fenceGate.blockID || var14 == 32) { -- return -3; -- } -- -- if(var12 == Block.trapdoor.blockID) { -+ -+ if (par0Entity.worldObj.blockGetRenderType(var9, var10, var11) == 9) { -+ int var18 = MathHelper.floor_double(par0Entity.posX); -+ int var16 = MathHelper.floor_double(par0Entity.posY); -+ int var17 = MathHelper.floor_double(par0Entity.posZ); -+ -+ if (par0Entity.worldObj.blockGetRenderType(var18, var16, var17) != 9 && par0Entity.worldObj.blockGetRenderType(var18, var16 - 1, var17) != 9) { -+ return -3; -+ } -+ } else if (!var13.getBlocksMovement(par0Entity.worldObj, var9, var10, var11) && (!par6 || var12 != Block.doorWood.blockID)) { -+ if (var14 == 11 || var12 == Block.fenceGate.blockID || var14 == 32) { -+ return -3; -+ } -+ -+ if (var12 == Block.trapdoor.blockID) { - return -4; - } - - Material var15 = var13.blockMaterial; -- if(var15 != Material.lava) { -+ -+ if (var15 != Material.lava) { - return 0; - } - -- if(!var0.handleLavaMovement()) { -+ if (!par0Entity.handleLavaMovement()) { - return -2; - } - } -@@ -247,19 +304,22 @@ - return var8 ? 2 : 1; - } - -- private PathEntity createEntityPath(PathPoint var1, PathPoint var2) { -+ /** -+ * Returns a new PathEntity for a given start and end point -+ */ -+ private PathEntity createEntityPath(PathPoint par1PathPoint, PathPoint par2PathPoint) { - int var3 = 1; -- - PathPoint var4; -- for(var4 = var2; var4.previous != null; var4 = var4.previous) { -+ -+ for (var4 = par2PathPoint; var4.previous != null; var4 = var4.previous) { - ++var3; - } - - PathPoint[] var5 = new PathPoint[var3]; -- var4 = var2; -+ var4 = par2PathPoint; - --var3; - -- for(var5[var3] = var2; var4.previous != null; var5[var3] = var4) { -+ for (var5[var3] = par2PathPoint; var4.previous != null; var5[var3] = var4) { - var4 = var4.previous; - --var3; - } ---- /dev/null -+++ org/spoutcraft/api/animation/Animatable.java -@@ -1,0 +1,24 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.api.animation; -+ -+public interface Animatable { -+ public Animatable getValueAt(double p, Animatable startValue, Animatable endValue); -+} ---- net/minecraft/src/ComponentStrongholdStairs.java -+++ net/minecraft/src/ComponentStrongholdStairs.java -@@ -6,80 +6,90 @@ - public class ComponentStrongholdStairs extends ComponentStronghold { - private boolean field_75024_a; - -- public ComponentStrongholdStairs() { -- } -+ public ComponentStrongholdStairs() {} - -- public ComponentStrongholdStairs(int var1, Random var2, int var3, int var4) { -- super(var1); -+ public ComponentStrongholdStairs(int par1, Random par2Random, int par3, int par4) { -+ super(par1); - this.field_75024_a = true; -- this.coordBaseMode = var2.nextInt(4); -+ this.coordBaseMode = par2Random.nextInt(4); - this.field_143013_d = EnumDoor.OPENING; -- switch(this.coordBaseMode) { -- case 0: -- case 2: -- this.boundingBox = new StructureBoundingBox(var3, 64, var4, var3 + 5 - 1, 74, var4 + 5 - 1); -- break; -- default: -- this.boundingBox = new StructureBoundingBox(var3, 64, var4, var3 + 5 - 1, 74, var4 + 5 - 1); -+ -+ switch (this.coordBaseMode) { -+ case 0: -+ case 2: -+ this.boundingBox = new StructureBoundingBox(par3, 64, par4, par3 + 5 - 1, 74, par4 + 5 - 1); -+ break; -+ -+ default: -+ this.boundingBox = new StructureBoundingBox(par3, 64, par4, par3 + 5 - 1, 74, par4 + 5 - 1); - } -- - } - -- public ComponentStrongholdStairs(int var1, Random var2, StructureBoundingBox var3, int var4) { -- super(var1); -+ public ComponentStrongholdStairs(int par1, Random par2Random, StructureBoundingBox par3StructureBoundingBox, int par4) { -+ super(par1); - this.field_75024_a = false; -- this.coordBaseMode = var4; -- this.field_143013_d = this.getRandomDoor(var2); -- this.boundingBox = var3; -- } -- -- protected void func_143012_a(NBTTagCompound var1) { -- super.func_143012_a(var1); -- var1.setBoolean("Source", this.field_75024_a); -- } -- -- protected void func_143011_b(NBTTagCompound var1) { -- super.func_143011_b(var1); -- this.field_75024_a = var1.getBoolean("Source"); -- } -- -- public void buildComponent(StructureComponent var1, List var2, Random var3) { -- if(this.field_75024_a) { -+ this.coordBaseMode = par4; -+ this.field_143013_d = this.getRandomDoor(par2Random); -+ this.boundingBox = par3StructureBoundingBox; -+ } -+ -+ protected void func_143012_a(NBTTagCompound par1NBTTagCompound) { -+ super.func_143012_a(par1NBTTagCompound); -+ par1NBTTagCompound.setBoolean("Source", this.field_75024_a); -+ } -+ -+ protected void func_143011_b(NBTTagCompound par1NBTTagCompound) { -+ super.func_143011_b(par1NBTTagCompound); -+ this.field_75024_a = par1NBTTagCompound.getBoolean("Source"); -+ } -+ -+ /** -+ * Initiates construction of the Structure Component picked, at the current Location of StructGen -+ */ -+ public void buildComponent(StructureComponent par1StructureComponent, List par2List, Random par3Random) { -+ if (this.field_75024_a) { - StructureStrongholdPieces.setComponentType(ComponentStrongholdCrossing.class); - } - -- this.getNextComponentNormal((ComponentStrongholdStairs2)var1, var2, var3, 1, 1); -- } -- -- public static ComponentStrongholdStairs getStrongholdStairsComponent(List var0, Random var1, int var2, int var3, int var4, int var5, int var6) { -- StructureBoundingBox var7 = StructureBoundingBox.getComponentToAddBoundingBox(var2, var3, var4, -1, -7, 0, 5, 11, 5, var5); -- return canStrongholdGoDeeper(var7) && StructureComponent.findIntersecting(var0, var7) == null ? new ComponentStrongholdStairs(var6, var1, var7, var5) : null; -- } -- -- public boolean addComponentParts(World var1, Random var2, StructureBoundingBox var3) { -- if(this.isLiquidInStructureBoundingBox(var1, var3)) { -+ this.getNextComponentNormal((ComponentStrongholdStairs2)par1StructureComponent, par2List, par3Random, 1, 1); -+ } -+ -+ /** -+ * performs some checks, then gives out a fresh Stairs component -+ */ -+ public static ComponentStrongholdStairs getStrongholdStairsComponent(List par0List, Random par1Random, int par2, int par3, int par4, int par5, int par6) { -+ StructureBoundingBox var7 = StructureBoundingBox.getComponentToAddBoundingBox(par2, par3, par4, -1, -7, 0, 5, 11, 5, par5); -+ return canStrongholdGoDeeper(var7) && StructureComponent.findIntersecting(par0List, var7) == null ? new ComponentStrongholdStairs(par6, par1Random, var7, par5) : null; -+ } -+ -+ /** -+ * second Part of Structure generating, this for example places Spiderwebs, Mob Spawners, it closes Mineshafts at the -+ * end, it adds Fences... -+ */ -+ public boolean addComponentParts(World par1World, Random par2Random, StructureBoundingBox par3StructureBoundingBox) { -+ if (this.isLiquidInStructureBoundingBox(par1World, par3StructureBoundingBox)) { - return false; - } else { -- this.fillWithRandomizedBlocks(var1, var3, 0, 0, 0, 4, 10, 4, true, var2, StructureStrongholdPieces.getStrongholdStones()); -- this.placeDoor(var1, var2, var3, this.field_143013_d, 1, 7, 0); -- this.placeDoor(var1, var2, var3, EnumDoor.OPENING, 1, 1, 4); -- this.placeBlockAtCurrentPosition(var1, Block.stoneBrick.blockID, 0, 2, 6, 1, var3); -- this.placeBlockAtCurrentPosition(var1, Block.stoneBrick.blockID, 0, 1, 5, 1, var3); -- this.placeBlockAtCurrentPosition(var1, Block.stoneSingleSlab.blockID, 0, 1, 6, 1, var3); -- this.placeBlockAtCurrentPosition(var1, Block.stoneBrick.blockID, 0, 1, 5, 2, var3); -- this.placeBlockAtCurrentPosition(var1, Block.stoneBrick.blockID, 0, 1, 4, 3, var3); -- this.placeBlockAtCurrentPosition(var1, Block.stoneSingleSlab.blockID, 0, 1, 5, 3, var3); -- this.placeBlockAtCurrentPosition(var1, Block.stoneBrick.blockID, 0, 2, 4, 3, var3); -- this.placeBlockAtCurrentPosition(var1, Block.stoneBrick.blockID, 0, 3, 3, 3, var3); -- this.placeBlockAtCurrentPosition(var1, Block.stoneSingleSlab.blockID, 0, 3, 4, 3, var3); -- this.placeBlockAtCurrentPosition(var1, Block.stoneBrick.blockID, 0, 3, 3, 2, var3); -- this.placeBlockAtCurrentPosition(var1, Block.stoneBrick.blockID, 0, 3, 2, 1, var3); -- this.placeBlockAtCurrentPosition(var1, Block.stoneSingleSlab.blockID, 0, 3, 3, 1, var3); -- this.placeBlockAtCurrentPosition(var1, Block.stoneBrick.blockID, 0, 2, 2, 1, var3); -- this.placeBlockAtCurrentPosition(var1, Block.stoneBrick.blockID, 0, 1, 1, 1, var3); -- this.placeBlockAtCurrentPosition(var1, Block.stoneSingleSlab.blockID, 0, 1, 2, 1, var3); -- this.placeBlockAtCurrentPosition(var1, Block.stoneBrick.blockID, 0, 1, 1, 2, var3); -- this.placeBlockAtCurrentPosition(var1, Block.stoneSingleSlab.blockID, 0, 1, 1, 3, var3); -+ this.fillWithRandomizedBlocks(par1World, par3StructureBoundingBox, 0, 0, 0, 4, 10, 4, true, par2Random, StructureStrongholdPieces.getStrongholdStones()); -+ this.placeDoor(par1World, par2Random, par3StructureBoundingBox, this.field_143013_d, 1, 7, 0); -+ this.placeDoor(par1World, par2Random, par3StructureBoundingBox, EnumDoor.OPENING, 1, 1, 4); -+ this.placeBlockAtCurrentPosition(par1World, Block.stoneBrick.blockID, 0, 2, 6, 1, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.stoneBrick.blockID, 0, 1, 5, 1, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.stoneSingleSlab.blockID, 0, 1, 6, 1, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.stoneBrick.blockID, 0, 1, 5, 2, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.stoneBrick.blockID, 0, 1, 4, 3, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.stoneSingleSlab.blockID, 0, 1, 5, 3, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.stoneBrick.blockID, 0, 2, 4, 3, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.stoneBrick.blockID, 0, 3, 3, 3, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.stoneSingleSlab.blockID, 0, 3, 4, 3, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.stoneBrick.blockID, 0, 3, 3, 2, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.stoneBrick.blockID, 0, 3, 2, 1, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.stoneSingleSlab.blockID, 0, 3, 3, 1, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.stoneBrick.blockID, 0, 2, 2, 1, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.stoneBrick.blockID, 0, 1, 1, 1, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.stoneSingleSlab.blockID, 0, 1, 2, 1, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.stoneBrick.blockID, 0, 1, 1, 2, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.stoneSingleSlab.blockID, 0, 1, 1, 3, par3StructureBoundingBox); - return true; - } - } ---- net/minecraft/src/BehaviorDispenseArmor.java -+++ net/minecraft/src/BehaviorDispenseArmor.java -@@ -3,28 +3,34 @@ - import java.util.List; - - final class BehaviorDispenseArmor extends BehaviorDefaultDispenseItem { -- protected ItemStack dispenseStack(IBlockSource var1, ItemStack var2) { -- EnumFacing var3 = BlockDispenser.getFacing(var1.getBlockMetadata()); -- int var4 = var1.getXInt() + var3.getFrontOffsetX(); -- int var5 = var1.getYInt() + var3.getFrontOffsetY(); -- int var6 = var1.getZInt() + var3.getFrontOffsetZ(); -+ -+ /** -+ * Dispense the specified stack, play the dispense sound and spawn particles. -+ */ -+ protected ItemStack dispenseStack(IBlockSource par1IBlockSource, ItemStack par2ItemStack) { -+ EnumFacing var3 = BlockDispenser.getFacing(par1IBlockSource.getBlockMetadata()); -+ int var4 = par1IBlockSource.getXInt() + var3.getFrontOffsetX(); -+ int var5 = par1IBlockSource.getYInt() + var3.getFrontOffsetY(); -+ int var6 = par1IBlockSource.getZInt() + var3.getFrontOffsetZ(); - AxisAlignedBB var7 = AxisAlignedBB.getAABBPool().getAABB((double)var4, (double)var5, (double)var6, (double)(var4 + 1), (double)(var5 + 1), (double)(var6 + 1)); -- List var8 = var1.getWorld().selectEntitiesWithinAABB(EntityLivingBase.class, var7, new EntitySelectorArmoredMob(var2)); -- if(var8.size() > 0) { -+ List var8 = par1IBlockSource.getWorld().selectEntitiesWithinAABB(EntityLivingBase.class, var7, new EntitySelectorArmoredMob(par2ItemStack)); -+ -+ if (var8.size() > 0) { - EntityLivingBase var9 = (EntityLivingBase)var8.get(0); - int var10 = var9 instanceof EntityPlayer ? 1 : 0; -- int var11 = EntityLiving.getArmorPosition(var2); -- ItemStack var12 = var2.copy(); -+ int var11 = EntityLiving.getArmorPosition(par2ItemStack); -+ ItemStack var12 = par2ItemStack.copy(); - var12.stackSize = 1; - var9.setCurrentItemOrArmor(var11 - var10, var12); -- if(var9 instanceof EntityLiving) { -+ -+ if (var9 instanceof EntityLiving) { - ((EntityLiving)var9).setEquipmentDropChance(var11, 2.0F); - } - -- --var2.stackSize; -- return var2; -+ --par2ItemStack.stackSize; -+ return par2ItemStack; - } else { -- return super.dispenseStack(var1, var2); -+ return super.dispenseStack(par1IBlockSource, par2ItemStack); - } - } - } ---- net/minecraft/src/IInvBasic.java -+++ net/minecraft/src/IInvBasic.java -@@ -1,5 +1,9 @@ - package net.minecraft.src; - - public interface IInvBasic { -+ -+ /** -+ * Called by InventoryBasic.onInventoryChanged() on a array that is never filled. -+ */ - void onInventoryChanged(InventoryBasic var1); - } ---- net/minecraft/src/EntityHorse.java -+++ net/minecraft/src/EntityHorse.java -@@ -6,13 +6,13 @@ - public class EntityHorse extends EntityAnimal implements IInvBasic { - private static final IEntitySelector horseBreedingSelector = new EntityHorseBredSelector(); - private static final Attribute horseJumpStrength = (new RangedAttribute("horse.jumpStrength", 0.7D, 0.0D, 2.0D)).func_111117_a("Jump Strength").setShouldWatch(true); -- private static final String[] bw = new String[]{null, "textures/entity/horse/armor/horse_armor_iron.png", "textures/entity/horse/armor/horse_armor_gold.png", "textures/entity/horse/armor/horse_armor_diamond.png"}; -- private static final String[] bx = new String[]{"", "meo", "goo", "dio"}; -- private static final int[] armorValues = new int[]{0, 5, 7, 11}; -- private static final String[] bz = new String[]{"textures/entity/horse/horse_white.png", "textures/entity/horse/horse_creamy.png", "textures/entity/horse/horse_chestnut.png", "textures/entity/horse/horse_brown.png", "textures/entity/horse/horse_black.png", "textures/entity/horse/horse_gray.png", "textures/entity/horse/horse_darkbrown.png"}; -- private static final String[] bA = new String[]{"hwh", "hcr", "hch", "hbr", "hbl", "hgr", "hdb"}; -- private static final String[] bB = new String[]{null, "textures/entity/horse/horse_markings_white.png", "textures/entity/horse/horse_markings_whitefield.png", "textures/entity/horse/horse_markings_whitedots.png", "textures/entity/horse/horse_markings_blackdots.png"}; -- private static final String[] bC = new String[]{"", "wo_", "wmo", "wdo", "bdo"}; -+ private static final String[] horseArmorTextures = new String[] {null, "textures/entity/horse/armor/horse_armor_iron.png", "textures/entity/horse/armor/horse_armor_gold.png", "textures/entity/horse/armor/horse_armor_diamond.png"}; -+ private static final String[] field_110273_bx = new String[] {"", "meo", "goo", "dio"}; -+ private static final int[] armorValues = new int[] {0, 5, 7, 11}; -+ private static final String[] horseTextures = new String[] {"textures/entity/horse/horse_white.png", "textures/entity/horse/horse_creamy.png", "textures/entity/horse/horse_chestnut.png", "textures/entity/horse/horse_brown.png", "textures/entity/horse/horse_black.png", "textures/entity/horse/horse_gray.png", "textures/entity/horse/horse_darkbrown.png"}; -+ private static final String[] field_110269_bA = new String[] {"hwh", "hcr", "hch", "hbr", "hbl", "hgr", "hdb"}; -+ private static final String[] horseMarkingTextures = new String[] {null, "textures/entity/horse/horse_markings_white.png", "textures/entity/horse/horse_markings_whitefield.png", "textures/entity/horse/horse_markings_whitedots.png", "textures/entity/horse/horse_markings_blackdots.png"}; -+ private static final String[] field_110292_bC = new String[] {"", "wo_", "wmo", "wdo", "bdo"}; - private int eatingHaystackCounter; - private int openMouthCounter; - private int jumpRearingCounter; -@@ -21,6 +21,10 @@ - protected boolean horseJumping; - private AnimalChest horseChest; - private boolean hasReproduced; -+ -+ /** -+ * "The higher this value, the more likely the horse is to be tamed next time a player rides it." -+ */ - protected int temper; - protected float jumpPower; - private boolean field_110294_bI; -@@ -31,11 +35,11 @@ - private float mouthOpenness; - private float prevMouthOpenness; - private int field_110285_bP; -- private String bQ; -- private String[] bR = new String[3]; -+ private String field_110286_bQ; -+ private String[] field_110280_bR = new String[3]; - -- public EntityHorse(World var1) { -- super(var1); -+ public EntityHorse(World par1World) { -+ super(par1World); - this.setSize(1.4F, 1.6F); - this.isImmuneToFire = false; - this.setChested(false); -@@ -60,17 +64,20 @@ - this.dataWatcher.addObject(22, Integer.valueOf(0)); - } - -- public void setHorseType(int var1) { -- this.dataWatcher.updateObject(19, Byte.valueOf((byte)var1)); -+ public void setHorseType(int par1) { -+ this.dataWatcher.updateObject(19, Byte.valueOf((byte)par1)); - this.func_110230_cF(); - } - -+ /** -+ * returns the horse type -+ */ - public int getHorseType() { - return this.dataWatcher.getWatchableObjectByte(19); - } - -- public void setHorseVariant(int var1) { -- this.dataWatcher.updateObject(20, Integer.valueOf(var1)); -+ public void setHorseVariant(int par1) { -+ this.dataWatcher.updateObject(20, Integer.valueOf(par1)); - this.func_110230_cF(); - } - -@@ -78,39 +85,47 @@ - return this.dataWatcher.getWatchableObjectInt(20); - } - -+ /** -+ * Gets the username of the entity. -+ */ - public String getEntityName() { -- if(this.hasCustomNameTag()) { -+ if (this.hasCustomNameTag()) { - return this.getCustomNameTag(); - } else { - int var1 = this.getHorseType(); -- switch(var1) { -- case 0: -- default: -- return StatCollector.translateToLocal("entity.horse.name"); -- case 1: -- return StatCollector.translateToLocal("entity.donkey.name"); -- case 2: -- return StatCollector.translateToLocal("entity.mule.name"); -- case 3: -- return StatCollector.translateToLocal("entity.zombiehorse.name"); -- case 4: -- return StatCollector.translateToLocal("entity.skeletonhorse.name"); -+ -+ switch (var1) { -+ case 0: -+ default: -+ return StatCollector.translateToLocal("entity.horse.name"); -+ -+ case 1: -+ return StatCollector.translateToLocal("entity.donkey.name"); -+ -+ case 2: -+ return StatCollector.translateToLocal("entity.mule.name"); -+ -+ case 3: -+ return StatCollector.translateToLocal("entity.zombiehorse.name"); -+ -+ case 4: -+ return StatCollector.translateToLocal("entity.skeletonhorse.name"); - } - } - } - -- private boolean getHorseWatchableBoolean(int var1) { -- return (this.dataWatcher.getWatchableObjectInt(16) & var1) != 0; -+ private boolean getHorseWatchableBoolean(int par1) { -+ return (this.dataWatcher.getWatchableObjectInt(16) & par1) != 0; - } - -- private void setHorseWatchableBoolean(int var1, boolean var2) { -+ private void setHorseWatchableBoolean(int par1, boolean par2) { - int var3 = this.dataWatcher.getWatchableObjectInt(16); -- if(var2) { -- this.dataWatcher.updateObject(16, Integer.valueOf(var3 | var1)); -+ -+ if (par2) { -+ this.dataWatcher.updateObject(16, Integer.valueOf(var3 | par1)); - } else { -- this.dataWatcher.updateObject(16, Integer.valueOf(var3 & ~var1)); -+ this.dataWatcher.updateObject(16, Integer.valueOf(var3 & ~par1)); - } -- - } - - public boolean isAdultHorse() { -@@ -129,8 +144,8 @@ - return this.dataWatcher.getWatchableObjectString(21); - } - -- public void setOwnerName(String var1) { -- this.dataWatcher.updateObject(21, var1); -+ public void setOwnerName(String par1Str) { -+ this.dataWatcher.updateObject(21, par1Str); - } - - public float getHorseSize() { -@@ -138,36 +153,37 @@ - return var1 >= 0 ? 1.0F : 0.5F + (float)(-24000 - var1) / -24000.0F * 0.5F; - } - -- public void setScaleForAge(boolean var1) { -- if(var1) { -+ /** -+ * "Sets the scale for an ageable entity according to the boolean parameter, which says if it's a child." -+ */ -+ public void setScaleForAge(boolean par1) { -+ if (par1) { - this.setScale(this.getHorseSize()); - } else { - this.setScale(1.0F); - } -- - } - - public boolean isHorseJumping() { - return this.horseJumping; - } - -- public void setHorseTamed(boolean var1) { -- this.setHorseWatchableBoolean(2, var1); -+ public void setHorseTamed(boolean par1) { -+ this.setHorseWatchableBoolean(2, par1); - } - -- public void setHorseJumping(boolean var1) { -- this.horseJumping = var1; -+ public void setHorseJumping(boolean par1) { -+ this.horseJumping = par1; - } - - public boolean allowLeashing() { - return !this.func_110256_cu() && super.allowLeashing(); - } - -- protected void func_142017_o(float var1) { -- if(var1 > 6.0F && this.isEatingHaystack()) { -+ protected void func_142017_o(float par1) { -+ if (par1 > 6.0F && this.isEatingHaystack()) { - this.setEatingHaystack(false); - } -- - } - - public boolean isChested() { -@@ -178,8 +194,11 @@ - return this.dataWatcher.getWatchableObjectInt(22); - } - -- public int getHorseArmorIndex(ItemStack var1) { -- return var1 == null ? 0 : (var1.itemID == Item.horseArmorIron.itemID ? 1 : (var1.itemID == Item.horseArmorGold.itemID ? 2 : (var1.itemID == Item.horseArmorDiamond.itemID ? 3 : 0))); -+ /** -+ * 0 = iron, 1 = gold, 2 = diamond -+ */ -+ public int getHorseArmorIndex(ItemStack par1ItemStack) { -+ return par1ItemStack == null ? 0 : (par1ItemStack.itemID == Item.horseArmorIron.itemID ? 1 : (par1ItemStack.itemID == Item.horseArmorGold.itemID ? 2 : (par1ItemStack.itemID == Item.horseArmorDiamond.itemID ? 3 : 0))); - } - - public boolean isEatingHaystack() { -@@ -198,50 +217,59 @@ - return this.hasReproduced; - } - -- public void func_110236_r(int var1) { -- this.dataWatcher.updateObject(22, Integer.valueOf(var1)); -+ public void func_110236_r(int par1) { -+ this.dataWatcher.updateObject(22, Integer.valueOf(par1)); - this.func_110230_cF(); - } - -- public void func_110242_l(boolean var1) { -- this.setHorseWatchableBoolean(16, var1); -- } -- -- public void setChested(boolean var1) { -- this.setHorseWatchableBoolean(8, var1); -- } -- -- public void setHasReproduced(boolean var1) { -- this.hasReproduced = var1; -- } -- -- public void setHorseSaddled(boolean var1) { -- this.setHorseWatchableBoolean(4, var1); -+ public void func_110242_l(boolean par1) { -+ this.setHorseWatchableBoolean(16, par1); -+ } -+ -+ public void setChested(boolean par1) { -+ this.setHorseWatchableBoolean(8, par1); -+ } -+ -+ public void setHasReproduced(boolean par1) { -+ this.hasReproduced = par1; -+ } -+ -+ public void setHorseSaddled(boolean par1) { -+ this.setHorseWatchableBoolean(4, par1); - } - - public int getTemper() { - return this.temper; - } - -- public void setTemper(int var1) { -- this.temper = var1; -+ public void setTemper(int par1) { -+ this.temper = par1; - } - -- public int increaseTemper(int var1) { -- int var2 = MathHelper.clamp_int(this.getTemper() + var1, 0, this.getMaxTemper()); -+ public int increaseTemper(int par1) { -+ int var2 = MathHelper.clamp_int(this.getTemper() + par1, 0, this.getMaxTemper()); - this.setTemper(var2); - return var2; - } - -- public boolean attackEntityFrom(DamageSource var1, float var2) { -- Entity var3 = var1.getEntity(); -- return this.riddenByEntity != null && this.riddenByEntity.equals(var3) ? false : super.attackEntityFrom(var1, var2); -+ /** -+ * Called when the entity is attacked. -+ */ -+ public boolean attackEntityFrom(DamageSource par1DamageSource, float par2) { -+ Entity var3 = par1DamageSource.getEntity(); -+ return this.riddenByEntity != null && this.riddenByEntity.equals(var3) ? false : super.attackEntityFrom(par1DamageSource, par2); - } - -+ /** -+ * Returns the current armor value as determined by a call to InventoryPlayer.getTotalArmorValue -+ */ - public int getTotalArmorValue() { - return armorValues[this.func_110241_cb()]; - } - -+ /** -+ * Returns true if this entity should push and be pushed by other entities when colliding. -+ */ - public boolean canBePushed() { - return this.riddenByEntity == null; - } -@@ -254,7 +282,7 @@ - } - - public void dropChests() { -- if(!this.worldObj.isRemote && this.isChested()) { -+ if (!this.worldObj.isRemote && this.isChested()) { - this.dropItem(Block.chest.blockID, 1); - this.setChested(false); - } -@@ -262,46 +290,53 @@ - - private void func_110266_cB() { - this.openHorseMouth(); -- this.worldObj.playSoundAtEntity(this, "eating", 1.0F, 1.0F + (this.ab.nextFloat() - this.ab.nextFloat()) * 0.2F); -+ this.worldObj.playSoundAtEntity(this, "eating", 1.0F, 1.0F + (this.rand.nextFloat() - this.rand.nextFloat()) * 0.2F); - } - -- protected void fall(float var1) { -- if(var1 > 1.0F) { -+ /** -+ * Called when the mob is falling. Calculates and applies fall damage. -+ */ -+ protected void fall(float par1) { -+ if (par1 > 1.0F) { - this.playSound("mob.horse.land", 0.4F, 1.0F); - } - -- int var2 = MathHelper.ceiling_float_int(var1 * 0.5F - 3.0F); -- if(var2 > 0) { -+ int var2 = MathHelper.ceiling_float_int(par1 * 0.5F - 3.0F); -+ -+ if (var2 > 0) { - this.attackEntityFrom(DamageSource.fall, (float)var2); -- if(this.riddenByEntity != null) { -+ -+ if (this.riddenByEntity != null) { - this.riddenByEntity.attackEntityFrom(DamageSource.fall, (float)var2); - } - - int var3 = this.worldObj.getBlockId(MathHelper.floor_double(this.posX), MathHelper.floor_double(this.posY - 0.2D - (double)this.prevRotationYaw), MathHelper.floor_double(this.posZ)); -- if(var3 > 0) { -+ -+ if (var3 > 0) { - StepSound var4 = Block.blocksList[var3].stepSound; -- this.worldObj.playSoundAtEntity(this, var4.getStepSound(), var4.getVolume() * 0.5F, var4.getPitch() * (12.0F / 16.0F)); -+ this.worldObj.playSoundAtEntity(this, var4.getStepSound(), var4.getVolume() * 0.5F, var4.getPitch() * 0.75F); - } -- - } - } - - private int func_110225_cC() { - int var1 = this.getHorseType(); -- return !this.isChested() || var1 != 1 && var1 != 2 ? 2 : 17; -+ return this.isChested() && (var1 == 1 || var1 == 2) ? 17 : 2; - } - - private void func_110226_cD() { - AnimalChest var1 = this.horseChest; - this.horseChest = new AnimalChest("HorseChest", this.func_110225_cC()); - this.horseChest.func_110133_a(this.getEntityName()); -- if(var1 != null) { -+ -+ if (var1 != null) { - var1.func_110132_b(this); - int var2 = Math.min(var1.getSizeInventory(), this.horseChest.getSizeInventory()); - -- for(int var3 = 0; var3 < var2; ++var3) { -+ for (int var3 = 0; var3 < var2; ++var3) { - ItemStack var4 = var1.getStackInSlot(var3); -- if(var4 != null) { -+ -+ if (var4 != null) { - this.horseChest.setInventorySlotContents(var3, var4.copy()); - } - } -@@ -314,46 +349,53 @@ - } - - private void func_110232_cE() { -- if(!this.worldObj.isRemote) { -+ if (!this.worldObj.isRemote) { - this.setHorseSaddled(this.horseChest.getStackInSlot(0) != null); -- if(this.func_110259_cr()) { -+ -+ if (this.func_110259_cr()) { - this.func_110236_r(this.getHorseArmorIndex(this.horseChest.getStackInSlot(1))); - } - } -- - } - -- public void onInventoryChanged(InventoryBasic var1) { -+ /** -+ * Called by InventoryBasic.onInventoryChanged() on a array that is never filled. -+ */ -+ public void onInventoryChanged(InventoryBasic par1InventoryBasic) { - int var2 = this.func_110241_cb(); - boolean var3 = this.isHorseSaddled(); - this.func_110232_cE(); -- if(this.ticksExisted > 20) { -- if(var2 == 0 && var2 != this.func_110241_cb()) { -+ -+ if (this.ticksExisted > 20) { -+ if (var2 == 0 && var2 != this.func_110241_cb()) { - this.playSound("mob.horse.armor", 0.5F, 1.0F); - } - -- if(!var3 && this.isHorseSaddled()) { -+ if (!var3 && this.isHorseSaddled()) { - this.playSound("mob.horse.leather", 0.5F, 1.0F); - } - } -- - } - -+ /** -+ * Checks if the entity's current position is a valid location to spawn this entity. -+ */ - public boolean getCanSpawnHere() { - this.prepareChunkForSpawn(); - return super.getCanSpawnHere(); - } - -- protected EntityHorse getClosestHorse(Entity var1, double var2) { -+ protected EntityHorse getClosestHorse(Entity par1Entity, double par2) { - double var4 = Double.MAX_VALUE; - Entity var6 = null; -- List var7 = this.worldObj.getEntitiesWithinAABBExcludingEntity(var1, var1.boundingBox.addCoord(var2, var2, var2), horseBreedingSelector); -+ List var7 = this.worldObj.getEntitiesWithinAABBExcludingEntity(par1Entity, par1Entity.boundingBox.addCoord(par2, par2, par2), horseBreedingSelector); - Iterator var8 = var7.iterator(); - -- while(var8.hasNext()) { -+ while (var8.hasNext()) { - Entity var9 = (Entity)var8.next(); -- double var10 = var9.getDistanceSq(var1.posX, var1.posY, var1.posZ); -- if(var10 < var4) { -+ double var10 = var9.getDistanceSq(par1Entity.posX, par1Entity.posY, par1Entity.posZ); -+ -+ if (var10 < var4) { - var6 = var9; - var4 = var10; - } -@@ -366,21 +408,31 @@ - return this.getEntityAttribute(horseJumpStrength).getAttributeValue(); - } - -+ /** -+ * Returns the sound this mob makes on death. -+ */ - protected String getDeathSound() { - this.openHorseMouth(); - int var1 = this.getHorseType(); - return var1 == 3 ? "mob.horse.zombie.death" : (var1 == 4 ? "mob.horse.skeleton.death" : (var1 != 1 && var1 != 2 ? "mob.horse.death" : "mob.horse.donkey.death")); - } - -+ /** -+ * Returns the item ID for the item the mob drops on death. -+ */ - protected int getDropItemId() { -- boolean var1 = this.ab.nextInt(4) == 0; -+ boolean var1 = this.rand.nextInt(4) == 0; - int var2 = this.getHorseType(); - return var2 == 4 ? Item.bone.itemID : (var2 == 3 ? (var1 ? 0 : Item.rottenFlesh.itemID) : Item.leather.itemID); - } - -+ /** -+ * Returns the sound this mob makes when it is hurt. -+ */ - protected String getHurtSound() { - this.openHorseMouth(); -- if(this.ab.nextInt(3) == 0) { -+ -+ if (this.rand.nextInt(3) == 0) { - this.makeHorseRear(); - } - -@@ -392,9 +444,13 @@ - return this.getHorseWatchableBoolean(4); - } - -+ /** -+ * Returns the sound this mob makes while it's alive. -+ */ - protected String getLivingSound() { - this.openHorseMouth(); -- if(this.ab.nextInt(10) == 0 && !this.isMovementBlocked()) { -+ -+ if (this.rand.nextInt(10) == 0 && !this.isMovementBlocked()) { - this.makeHorseRear(); - } - -@@ -409,40 +465,49 @@ - return var1 != 3 && var1 != 4 ? (var1 != 1 && var1 != 2 ? "mob.horse.angry" : "mob.horse.donkey.angry") : null; - } - -- protected void playStepSound(int var1, int var2, int var3, int var4) { -- StepSound var5 = Block.blocksList[var4].stepSound; -- if(this.worldObj.getBlockId(var1, var2 + 1, var3) == Block.snow.blockID) { -+ /** -+ * Plays step sound at given x, y, z for the entity -+ */ -+ protected void playStepSound(int par1, int par2, int par3, int par4) { -+ StepSound var5 = Block.blocksList[par4].stepSound; -+ -+ if (this.worldObj.getBlockId(par1, par2 + 1, par3) == Block.snow.blockID) { - var5 = Block.snow.stepSound; - } - -- if(!Block.blocksList[var4].blockMaterial.isLiquid()) { -+ if (!Block.blocksList[par4].blockMaterial.isLiquid()) { - int var6 = this.getHorseType(); -- if(this.riddenByEntity != null && var6 != 1 && var6 != 2) { -+ -+ if (this.riddenByEntity != null && var6 != 1 && var6 != 2) { - ++this.field_110285_bP; -- if(this.field_110285_bP > 5 && this.field_110285_bP % 3 == 0) { -+ -+ if (this.field_110285_bP > 5 && this.field_110285_bP % 3 == 0) { - this.playSound("mob.horse.gallop", var5.getVolume() * 0.15F, var5.getPitch()); -- if(var6 == 0 && this.ab.nextInt(10) == 0) { -+ -+ if (var6 == 0 && this.rand.nextInt(10) == 0) { - this.playSound("mob.horse.breathe", var5.getVolume() * 0.6F, var5.getPitch()); - } -- } else if(this.field_110285_bP <= 5) { -+ } else if (this.field_110285_bP <= 5) { - this.playSound("mob.horse.wood", var5.getVolume() * 0.15F, var5.getPitch()); - } -- } else if(var5 == Block.soundWoodFootstep) { -+ } else if (var5 == Block.soundWoodFootstep) { - this.playSound("mob.horse.soft", var5.getVolume() * 0.15F, var5.getPitch()); - } else { - this.playSound("mob.horse.wood", var5.getVolume() * 0.15F, var5.getPitch()); - } - } -- - } - - protected void applyEntityAttributes() { - super.applyEntityAttributes(); - this.getAttributeMap().func_111150_b(horseJumpStrength); - this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setAttribute(53.0D); -- this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setAttribute((double)0.225F); -+ this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setAttribute(0.22499999403953552D); - } - -+ /** -+ * Will return how many at most can spawn in a chunk at once. -+ */ - public int getMaxSpawnedInChunk() { - return 6; - } -@@ -451,10 +516,16 @@ - return 100; - } - -+ /** -+ * Returns the volume for the sounds this mob makes. -+ */ - protected float getSoundVolume() { - return 0.8F; - } - -+ /** -+ * Get number of ticks, at least during which the living entity will be silent. -+ */ - public int getTalkInterval() { - return 400; - } -@@ -464,156 +535,165 @@ - } - - private void func_110230_cF() { -- this.bQ = null; -+ this.field_110286_bQ = null; - } - - private void setHorseTexturePaths() { -- this.bQ = "horse/"; -- this.bR[0] = null; -- this.bR[1] = null; -- this.bR[2] = null; -+ this.field_110286_bQ = "horse/"; -+ this.field_110280_bR[0] = null; -+ this.field_110280_bR[1] = null; -+ this.field_110280_bR[2] = null; - int var1 = this.getHorseType(); - int var2 = this.getHorseVariant(); - int var3; -- if(var1 == 0) { -+ -+ if (var1 == 0) { - var3 = var2 & 255; -- int var4 = (var2 & '\uff00') >> 8; -- this.bR[0] = bz[var3]; -- this.bQ = this.bQ + bA[var3]; -- this.bR[1] = bB[var4]; -- this.bQ = this.bQ + bC[var4]; -+ int var4 = (var2 & 65280) >> 8; -+ this.field_110280_bR[0] = horseTextures[var3]; -+ this.field_110286_bQ = this.field_110286_bQ + field_110269_bA[var3]; -+ this.field_110280_bR[1] = horseMarkingTextures[var4]; -+ this.field_110286_bQ = this.field_110286_bQ + field_110292_bC[var4]; - } else { -- this.bR[0] = ""; -- this.bQ = this.bQ + "_" + var1 + "_"; -+ this.field_110280_bR[0] = ""; -+ this.field_110286_bQ = this.field_110286_bQ + "_" + var1 + "_"; - } - - var3 = this.func_110241_cb(); -- this.bR[2] = bw[var3]; -- this.bQ = this.bQ + bx[var3]; -+ this.field_110280_bR[2] = horseArmorTextures[var3]; -+ this.field_110286_bQ = this.field_110286_bQ + field_110273_bx[var3]; - } - - public String getHorseTexture() { -- if(this.bQ == null) { -+ if (this.field_110286_bQ == null) { - this.setHorseTexturePaths(); - } - -- return this.bQ; -+ return this.field_110286_bQ; - } - - public String[] getVariantTexturePaths() { -- if(this.bQ == null) { -+ if (this.field_110286_bQ == null) { - this.setHorseTexturePaths(); - } - -- return this.bR; -+ return this.field_110280_bR; - } - -- public void openGUI(EntityPlayer var1) { -- if(!this.worldObj.isRemote && (this.riddenByEntity == null || this.riddenByEntity == var1) && this.isTame()) { -+ public void openGUI(EntityPlayer par1EntityPlayer) { -+ if (!this.worldObj.isRemote && (this.riddenByEntity == null || this.riddenByEntity == par1EntityPlayer) && this.isTame()) { - this.horseChest.func_110133_a(this.getEntityName()); -- var1.displayGUIHorse(this, this.horseChest); -+ par1EntityPlayer.displayGUIHorse(this, this.horseChest); - } -- - } - -- public boolean interact(EntityPlayer var1) { -- ItemStack var2 = var1.inventory.getCurrentItem(); -- if(var2 != null && var2.itemID == Item.monsterPlacer.itemID) { -- return super.interact(var1); -- } else if(!this.isTame() && this.func_110256_cu()) { -+ /** -+ * Called when a player interacts with a mob. e.g. gets milk from a cow, gets into the saddle on a pig. -+ */ -+ public boolean interact(EntityPlayer par1EntityPlayer) { -+ ItemStack var2 = par1EntityPlayer.inventory.getCurrentItem(); -+ -+ if (var2 != null && var2.itemID == Item.monsterPlacer.itemID) { -+ return super.interact(par1EntityPlayer); -+ } else if (!this.isTame() && this.func_110256_cu()) { - return false; -- } else if(this.isTame() && this.isAdultHorse() && var1.isSneaking()) { -- this.openGUI(var1); -+ } else if (this.isTame() && this.isAdultHorse() && par1EntityPlayer.isSneaking()) { -+ this.openGUI(par1EntityPlayer); - return true; -- } else if(this.func_110253_bW() && this.riddenByEntity != null) { -- return super.interact(var1); -+ } else if (this.func_110253_bW() && this.riddenByEntity != null) { -+ return super.interact(par1EntityPlayer); - } else { -- if(var2 != null) { -+ if (var2 != null) { - boolean var3 = false; -- if(this.func_110259_cr()) { -+ -+ if (this.func_110259_cr()) { - byte var4 = -1; -- if(var2.itemID == Item.horseArmorIron.itemID) { -+ -+ if (var2.itemID == Item.horseArmorIron.itemID) { - var4 = 1; -- } else if(var2.itemID == Item.horseArmorGold.itemID) { -+ } else if (var2.itemID == Item.horseArmorGold.itemID) { - var4 = 2; -- } else if(var2.itemID == Item.horseArmorDiamond.itemID) { -+ } else if (var2.itemID == Item.horseArmorDiamond.itemID) { - var4 = 3; - } - -- if(var4 >= 0) { -- if(!this.isTame()) { -+ if (var4 >= 0) { -+ if (!this.isTame()) { - this.makeHorseRearWithSound(); - return true; - } - -- this.openGUI(var1); -+ this.openGUI(par1EntityPlayer); - return true; - } - } - -- if(!var3 && !this.func_110256_cu()) { -+ if (!var3 && !this.func_110256_cu()) { - float var7 = 0.0F; - short var5 = 0; - byte var6 = 0; -- if(var2.itemID == Item.wheat.itemID) { -+ -+ if (var2.itemID == Item.wheat.itemID) { - var7 = 2.0F; - var5 = 60; - var6 = 3; -- } else if(var2.itemID == Item.sugar.itemID) { -+ } else if (var2.itemID == Item.sugar.itemID) { - var7 = 1.0F; - var5 = 30; - var6 = 3; -- } else if(var2.itemID == Item.bread.itemID) { -+ } else if (var2.itemID == Item.bread.itemID) { - var7 = 7.0F; - var5 = 180; - var6 = 3; -- } else if(var2.itemID == Block.hay.blockID) { -+ } else if (var2.itemID == Block.hay.blockID) { - var7 = 20.0F; - var5 = 180; -- } else if(var2.itemID == Item.appleRed.itemID) { -+ } else if (var2.itemID == Item.appleRed.itemID) { - var7 = 3.0F; - var5 = 60; - var6 = 3; -- } else if(var2.itemID == Item.goldenCarrot.itemID) { -+ } else if (var2.itemID == Item.goldenCarrot.itemID) { - var7 = 4.0F; - var5 = 60; - var6 = 5; -- if(this.isTame() && this.getGrowingAge() == 0) { -+ -+ if (this.isTame() && this.getGrowingAge() == 0) { - var3 = true; - this.func_110196_bT(); - } -- } else if(var2.itemID == Item.appleGold.itemID) { -+ } else if (var2.itemID == Item.appleGold.itemID) { - var7 = 10.0F; - var5 = 240; - var6 = 10; -- if(this.isTame() && this.getGrowingAge() == 0) { -+ -+ if (this.isTame() && this.getGrowingAge() == 0) { - var3 = true; - this.func_110196_bT(); - } - } - -- if(this.getHealth() < this.getMaxHealth() && var7 > 0.0F) { -+ if (this.getHealth() < this.getMaxHealth() && var7 > 0.0F) { - this.heal(var7); - var3 = true; - } - -- if(!this.isAdultHorse() && var5 > 0) { -+ if (!this.isAdultHorse() && var5 > 0) { - this.addGrowth(var5); - var3 = true; - } - -- if(var6 > 0 && (var3 || !this.isTame()) && var6 < this.getMaxTemper()) { -+ if (var6 > 0 && (var3 || !this.isTame()) && var6 < this.getMaxTemper()) { - var3 = true; - this.increaseTemper(var6); - } - -- if(var3) { -+ if (var3) { - this.func_110266_cB(); - } - } - -- if(!this.isTame() && !var3) { -- if(var2 != null && var2.func_111282_a(var1, this)) { -+ if (!this.isTame() && !var3) { -+ if (var2 != null && var2.func_111282_a(par1EntityPlayer, this)) { - return true; - } - -@@ -621,49 +701,49 @@ - return true; - } - -- if(!var3 && this.func_110229_cs() && !this.isChested() && var2.itemID == Block.chest.blockID) { -+ if (!var3 && this.func_110229_cs() && !this.isChested() && var2.itemID == Block.chest.blockID) { - this.setChested(true); -- this.playSound("mob.chickenplop", 1.0F, (this.ab.nextFloat() - this.ab.nextFloat()) * 0.2F + 1.0F); -+ this.playSound("mob.chickenplop", 1.0F, (this.rand.nextFloat() - this.rand.nextFloat()) * 0.2F + 1.0F); - var3 = true; - this.func_110226_cD(); - } - -- if(!var3 && this.func_110253_bW() && !this.isHorseSaddled() && var2.itemID == Item.saddle.itemID) { -- this.openGUI(var1); -+ if (!var3 && this.func_110253_bW() && !this.isHorseSaddled() && var2.itemID == Item.saddle.itemID) { -+ this.openGUI(par1EntityPlayer); - return true; - } - -- if(var3) { -- if(!var1.capabilities.isCreativeMode && --var2.stackSize == 0) { -- var1.inventory.setInventorySlotContents(var1.inventory.currentItem, (ItemStack)null); -+ if (var3) { -+ if (!par1EntityPlayer.capabilities.isCreativeMode && --var2.stackSize == 0) { -+ par1EntityPlayer.inventory.setInventorySlotContents(par1EntityPlayer.inventory.currentItem, (ItemStack)null); - } - - return true; - } - } - -- if(this.func_110253_bW() && this.riddenByEntity == null) { -- if(var2 != null && var2.func_111282_a(var1, this)) { -+ if (this.func_110253_bW() && this.riddenByEntity == null) { -+ if (var2 != null && var2.func_111282_a(par1EntityPlayer, this)) { - return true; - } else { -- this.func_110237_h(var1); -+ this.func_110237_h(par1EntityPlayer); - return true; - } - } else { -- return super.interact(var1); -+ return super.interact(par1EntityPlayer); - } - } - } - -- private void func_110237_h(EntityPlayer var1) { -- var1.rotationYaw = this.rotationYaw; -- var1.rotationPitch = this.rotationPitch; -+ private void func_110237_h(EntityPlayer par1EntityPlayer) { -+ par1EntityPlayer.rotationYaw = this.rotationYaw; -+ par1EntityPlayer.rotationPitch = this.rotationPitch; - this.setEatingHaystack(false); - this.setRearing(false); -- if(!this.worldObj.isRemote) { -- var1.mountEntity(this); -- } - -+ if (!this.worldObj.isRemote) { -+ par1EntityPlayer.mountEntity(this); -+ } - } - - public boolean func_110259_cr() { -@@ -675,6 +755,9 @@ - return var1 == 2 || var1 == 1; - } - -+ /** -+ * Dead and sleeping entities cannot move -+ */ - protected boolean isMovementBlocked() { - return this.riddenByEntity != null && this.isHorseSaddled() ? true : this.isEatingHaystack() || this.isRearing(); - } -@@ -688,7 +771,11 @@ - return this.func_110256_cu() || this.getHorseType() == 2; - } - -- public boolean isBreedingItem(ItemStack var1) { -+ /** -+ * Checks if the parameter is an item which this animal can be fed to breed it (wheat, carrots or seeds depending on -+ * the animal type) -+ */ -+ public boolean isBreedingItem(ItemStack par1ItemStack) { - return false; - } - -@@ -696,159 +783,178 @@ - this.field_110278_bp = 1; - } - -- public void onDeath(DamageSource var1) { -- super.onDeath(var1); -- if(!this.worldObj.isRemote) { -+ /** -+ * Called when the mob's health reaches 0. -+ */ -+ public void onDeath(DamageSource par1DamageSource) { -+ super.onDeath(par1DamageSource); -+ -+ if (!this.worldObj.isRemote) { - this.dropChestItems(); - } -- - } - -+ /** -+ * Called frequently so the entity can update its state every tick as required. For example, zombies and skeletons use -+ * this to react to sunlight and start to burn. -+ */ - public void onLivingUpdate() { -- if(this.ab.nextInt(200) == 0) { -+ if (this.rand.nextInt(200) == 0) { - this.func_110210_cH(); - } - - super.onLivingUpdate(); -- if(!this.worldObj.isRemote) { -- if(this.ab.nextInt(900) == 0 && this.deathTime == 0) { -+ -+ if (!this.worldObj.isRemote) { -+ if (this.rand.nextInt(900) == 0 && this.deathTime == 0) { - this.heal(1.0F); - } - -- if(!this.isEatingHaystack() && this.riddenByEntity == null && this.ab.nextInt(300) == 0 && this.worldObj.getBlockId(MathHelper.floor_double(this.posX), MathHelper.floor_double(this.posY) - 1, MathHelper.floor_double(this.posZ)) == Block.grass.blockID) { -+ if (!this.isEatingHaystack() && this.riddenByEntity == null && this.rand.nextInt(300) == 0 && this.worldObj.getBlockId(MathHelper.floor_double(this.posX), MathHelper.floor_double(this.posY) - 1, MathHelper.floor_double(this.posZ)) == Block.grass.blockID) { - this.setEatingHaystack(true); - } - -- if(this.isEatingHaystack() && ++this.eatingHaystackCounter > 50) { -+ if (this.isEatingHaystack() && ++this.eatingHaystackCounter > 50) { - this.eatingHaystackCounter = 0; - this.setEatingHaystack(false); - } - -- if(this.func_110205_ce() && !this.isAdultHorse() && !this.isEatingHaystack()) { -+ if (this.func_110205_ce() && !this.isAdultHorse() && !this.isEatingHaystack()) { - EntityHorse var1 = this.getClosestHorse(this, 16.0D); -- if(var1 != null && this.getDistanceSqToEntity(var1) > 4.0D) { -+ -+ if (var1 != null && this.getDistanceSqToEntity(var1) > 4.0D) { - PathEntity var2 = this.worldObj.getPathEntityToEntity(this, var1, 16.0F, true, false, false, true); - this.setPathToEntity(var2); - } - } - } -- - } - -+ /** -+ * Called to update the entity's position/logic. -+ */ - public void onUpdate() { - super.onUpdate(); -- if(this.worldObj.isRemote && this.dataWatcher.hasObjectChanged()) { -+ -+ if (this.worldObj.isRemote && this.dataWatcher.hasChanges()) { - this.dataWatcher.func_111144_e(); - this.func_110230_cF(); - } - -- if(this.openMouthCounter > 0 && ++this.openMouthCounter > 30) { -+ if (this.openMouthCounter > 0 && ++this.openMouthCounter > 30) { - this.openMouthCounter = 0; - this.setHorseWatchableBoolean(128, false); - } - -- if(!this.worldObj.isRemote && this.jumpRearingCounter > 0 && ++this.jumpRearingCounter > 20) { -+ if (!this.worldObj.isRemote && this.jumpRearingCounter > 0 && ++this.jumpRearingCounter > 20) { - this.jumpRearingCounter = 0; - this.setRearing(false); - } - -- if(this.field_110278_bp > 0 && ++this.field_110278_bp > 8) { -+ if (this.field_110278_bp > 0 && ++this.field_110278_bp > 8) { - this.field_110278_bp = 0; - } - -- if(this.field_110279_bq > 0) { -+ if (this.field_110279_bq > 0) { - ++this.field_110279_bq; -- if(this.field_110279_bq > 300) { -+ -+ if (this.field_110279_bq > 300) { - this.field_110279_bq = 0; - } - } - - this.prevHeadLean = this.headLean; -- if(this.isEatingHaystack()) { -+ -+ if (this.isEatingHaystack()) { - this.headLean += (1.0F - this.headLean) * 0.4F + 0.05F; -- if(this.headLean > 1.0F) { -+ -+ if (this.headLean > 1.0F) { - this.headLean = 1.0F; - } - } else { - this.headLean += (0.0F - this.headLean) * 0.4F - 0.05F; -- if(this.headLean < 0.0F) { -+ -+ if (this.headLean < 0.0F) { - this.headLean = 0.0F; - } - } - - this.prevRearingAmount = this.rearingAmount; -- if(this.isRearing()) { -+ -+ if (this.isRearing()) { - this.prevHeadLean = this.headLean = 0.0F; - this.rearingAmount += (1.0F - this.rearingAmount) * 0.4F + 0.05F; -- if(this.rearingAmount > 1.0F) { -+ -+ if (this.rearingAmount > 1.0F) { - this.rearingAmount = 1.0F; - } - } else { - this.field_110294_bI = false; - this.rearingAmount += (0.8F * this.rearingAmount * this.rearingAmount * this.rearingAmount - this.rearingAmount) * 0.6F - 0.05F; -- if(this.rearingAmount < 0.0F) { -+ -+ if (this.rearingAmount < 0.0F) { - this.rearingAmount = 0.0F; - } - } - - this.prevMouthOpenness = this.mouthOpenness; -- if(this.getHorseWatchableBoolean(128)) { -+ -+ if (this.getHorseWatchableBoolean(128)) { - this.mouthOpenness += (1.0F - this.mouthOpenness) * 0.7F + 0.05F; -- if(this.mouthOpenness > 1.0F) { -+ -+ if (this.mouthOpenness > 1.0F) { - this.mouthOpenness = 1.0F; - } - } else { - this.mouthOpenness += (0.0F - this.mouthOpenness) * 0.7F - 0.05F; -- if(this.mouthOpenness < 0.0F) { -+ -+ if (this.mouthOpenness < 0.0F) { - this.mouthOpenness = 0.0F; - } - } -- - } - - private void openHorseMouth() { -- if(!this.worldObj.isRemote) { -+ if (!this.worldObj.isRemote) { - this.openMouthCounter = 1; - this.setHorseWatchableBoolean(128, true); - } -- - } - - private boolean func_110200_cJ() { - return this.riddenByEntity == null && this.ridingEntity == null && this.isTame() && this.isAdultHorse() && !this.func_110222_cv() && this.getHealth() >= this.getMaxHealth(); - } - -- public void setEating(boolean var1) { -- this.setHorseWatchableBoolean(32, var1); -- } -- -- public void setEatingHaystack(boolean var1) { -- this.setEating(var1); -- } -- -- public void setRearing(boolean var1) { -- if(var1) { -+ public void setEating(boolean par1) { -+ this.setHorseWatchableBoolean(32, par1); -+ } -+ -+ public void setEatingHaystack(boolean par1) { -+ this.setEating(par1); -+ } -+ -+ public void setRearing(boolean par1) { -+ if (par1) { - this.setEatingHaystack(false); - } - -- this.setHorseWatchableBoolean(64, var1); -+ this.setHorseWatchableBoolean(64, par1); - } - - private void makeHorseRear() { -- if(!this.worldObj.isRemote) { -+ if (!this.worldObj.isRemote) { - this.jumpRearingCounter = 1; - this.setRearing(true); - } -- - } - - public void makeHorseRearWithSound() { - this.makeHorseRear(); - String var1 = this.getAngrySoundName(); -- if(var1 != null) { -+ -+ if (var1 != null) { - this.playSound(var1, this.getSoundVolume(), this.getSoundPitch()); - } -- - } - - public void dropChestItems() { -@@ -856,51 +962,57 @@ - this.dropChests(); - } - -- private void dropItemsInChest(Entity var1, AnimalChest var2) { -- if(var2 != null && !this.worldObj.isRemote) { -- for(int var3 = 0; var3 < var2.getSizeInventory(); ++var3) { -- ItemStack var4 = var2.getStackInSlot(var3); -- if(var4 != null) { -+ private void dropItemsInChest(Entity par1Entity, AnimalChest par2AnimalChest) { -+ if (par2AnimalChest != null && !this.worldObj.isRemote) { -+ for (int var3 = 0; var3 < par2AnimalChest.getSizeInventory(); ++var3) { -+ ItemStack var4 = par2AnimalChest.getStackInSlot(var3); -+ -+ if (var4 != null) { - this.entityDropItem(var4, 0.0F); - } - } -- - } - } - -- public boolean setTamedBy(EntityPlayer var1) { -- this.setOwnerName(var1.getCommandSenderName()); -+ public boolean setTamedBy(EntityPlayer par1EntityPlayer) { -+ this.setOwnerName(par1EntityPlayer.getCommandSenderName()); - this.setHorseTamed(true); - return true; - } - -- public void moveEntityWithHeading(float var1, float var2) { -- if(this.riddenByEntity != null && this.isHorseSaddled()) { -+ /** -+ * Moves the entity based on the specified heading. Args: strafe, forward -+ */ -+ public void moveEntityWithHeading(float par1, float par2) { -+ if (this.riddenByEntity != null && this.isHorseSaddled()) { - this.prevRotationYaw = this.rotationYaw = this.riddenByEntity.rotationYaw; - this.rotationPitch = this.riddenByEntity.rotationPitch * 0.5F; - this.setRotation(this.rotationYaw, this.rotationPitch); - this.rotationYawHead = this.renderYawOffset = this.rotationYaw; -- var1 = ((EntityLivingBase)this.riddenByEntity).moveStrafing * 0.5F; -- var2 = ((EntityLivingBase)this.riddenByEntity).moveForward; -- if(var2 <= 0.0F) { -- var2 *= 0.25F; -+ par1 = ((EntityLivingBase)this.riddenByEntity).moveStrafing * 0.5F; -+ par2 = ((EntityLivingBase)this.riddenByEntity).moveForward; -+ -+ if (par2 <= 0.0F) { -+ par2 *= 0.25F; - this.field_110285_bP = 0; - } - -- if(this.onGround && this.jumpPower == 0.0F && this.isRearing() && !this.field_110294_bI) { -- var1 = 0.0F; -- var2 = 0.0F; -+ if (this.onGround && this.jumpPower == 0.0F && this.isRearing() && !this.field_110294_bI) { -+ par1 = 0.0F; -+ par2 = 0.0F; - } - -- if(this.jumpPower > 0.0F && !this.isHorseJumping() && this.onGround) { -+ if (this.jumpPower > 0.0F && !this.isHorseJumping() && this.onGround) { - this.motionY = this.getHorseJumpStrength() * (double)this.jumpPower; -- if(this.isPotionActive(Potion.jump)) { -+ -+ if (this.isPotionActive(Potion.jump)) { - this.motionY += (double)((float)(this.getActivePotionEffect(Potion.jump).getAmplifier() + 1) * 0.1F); - } - - this.setHorseJumping(true); - this.isAirBorne = true; -- if(var2 > 0.0F) { -+ -+ if (par2 > 0.0F) { - float var3 = MathHelper.sin(this.rotationYaw * (float)Math.PI / 180.0F); - float var4 = MathHelper.cos(this.rotationYaw * (float)Math.PI / 180.0F); - this.motionX += (double)(-0.4F * var3 * this.jumpPower); -@@ -913,12 +1025,13 @@ - - this.stepHeight = 1.0F; - this.jumpMovementFactor = this.getAIMoveSpeed() * 0.1F; -- if(!this.worldObj.isRemote) { -+ -+ if (!this.worldObj.isRemote) { - this.setAIMoveSpeed((float)this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).getAttributeValue()); -- super.moveEntityWithHeading(var1, var2); -+ super.moveEntityWithHeading(par1, par2); - } - -- if(this.onGround) { -+ if (this.onGround) { - this.jumpPower = 0.0F; - this.setHorseJumping(false); - } -@@ -927,7 +1040,8 @@ - double var8 = this.posX - this.prevPosX; - double var5 = this.posZ - this.prevPosZ; - float var7 = MathHelper.sqrt_double(var8 * var8 + var5 * var5) * 4.0F; -- if(var7 > 1.0F) { -+ -+ if (var7 > 1.0F) { - var7 = 1.0F; - } - -@@ -936,27 +1050,32 @@ - } else { - this.stepHeight = 0.5F; - this.jumpMovementFactor = 0.02F; -- super.moveEntityWithHeading(var1, var2); -+ super.moveEntityWithHeading(par1, par2); - } - } - -- public void writeEntityToNBT(NBTTagCompound var1) { -- super.writeEntityToNBT(var1); -- var1.setBoolean("EatingHaystack", this.isEatingHaystack()); -- var1.setBoolean("ChestedHorse", this.isChested()); -- var1.setBoolean("HasReproduced", this.getHasReproduced()); -- var1.setBoolean("Bred", this.func_110205_ce()); -- var1.setInteger("Type", this.getHorseType()); -- var1.setInteger("Variant", this.getHorseVariant()); -- var1.setInteger("Temper", this.getTemper()); -- var1.setBoolean("Tame", this.isTame()); -- var1.setString("OwnerName", this.getOwnerName()); -- if(this.isChested()) { -+ /** -+ * (abstract) Protected helper method to write subclass entity data to NBT. -+ */ -+ public void writeEntityToNBT(NBTTagCompound par1NBTTagCompound) { -+ super.writeEntityToNBT(par1NBTTagCompound); -+ par1NBTTagCompound.setBoolean("EatingHaystack", this.isEatingHaystack()); -+ par1NBTTagCompound.setBoolean("ChestedHorse", this.isChested()); -+ par1NBTTagCompound.setBoolean("HasReproduced", this.getHasReproduced()); -+ par1NBTTagCompound.setBoolean("Bred", this.func_110205_ce()); -+ par1NBTTagCompound.setInteger("Type", this.getHorseType()); -+ par1NBTTagCompound.setInteger("Variant", this.getHorseVariant()); -+ par1NBTTagCompound.setInteger("Temper", this.getTemper()); -+ par1NBTTagCompound.setBoolean("Tame", this.isTame()); -+ par1NBTTagCompound.setString("OwnerName", this.getOwnerName()); -+ -+ if (this.isChested()) { - NBTTagList var2 = new NBTTagList(); - -- for(int var3 = 2; var3 < this.horseChest.getSizeInventory(); ++var3) { -+ for (int var3 = 2; var3 < this.horseChest.getSizeInventory(); ++var3) { - ItemStack var4 = this.horseChest.getStackInSlot(var3); -- if(var4 != null) { -+ -+ if (var4 != null) { - NBTTagCompound var5 = new NBTTagCompound(); - var5.setByte("Slot", (byte)var3); - var4.writeToNBT(var5); -@@ -964,79 +1083,91 @@ - } - } - -- var1.setTag("Items", var2); -- } -- -- if(this.horseChest.getStackInSlot(1) != null) { -- var1.setTag("ArmorItem", this.horseChest.getStackInSlot(1).writeToNBT(new NBTTagCompound("ArmorItem"))); -- } -- -- if(this.horseChest.getStackInSlot(0) != null) { -- var1.setTag("SaddleItem", this.horseChest.getStackInSlot(0).writeToNBT(new NBTTagCompound("SaddleItem"))); -- } -- -+ par1NBTTagCompound.setTag("Items", var2); -+ } -+ -+ if (this.horseChest.getStackInSlot(1) != null) { -+ par1NBTTagCompound.setTag("ArmorItem", this.horseChest.getStackInSlot(1).writeToNBT(new NBTTagCompound("ArmorItem"))); -+ } -+ -+ if (this.horseChest.getStackInSlot(0) != null) { -+ par1NBTTagCompound.setTag("SaddleItem", this.horseChest.getStackInSlot(0).writeToNBT(new NBTTagCompound("SaddleItem"))); -+ } - } - -- public void readEntityFromNBT(NBTTagCompound var1) { -- super.readEntityFromNBT(var1); -- this.setEatingHaystack(var1.getBoolean("EatingHaystack")); -- this.func_110242_l(var1.getBoolean("Bred")); -- this.setChested(var1.getBoolean("ChestedHorse")); -- this.setHasReproduced(var1.getBoolean("HasReproduced")); -- this.setHorseType(var1.getInteger("Type")); -- this.setHorseVariant(var1.getInteger("Variant")); -- this.setTemper(var1.getInteger("Temper")); -- this.setHorseTamed(var1.getBoolean("Tame")); -- if(var1.hasKey("OwnerName")) { -- this.setOwnerName(var1.getString("OwnerName")); -+ /** -+ * (abstract) Protected helper method to read subclass entity data from NBT. -+ */ -+ public void readEntityFromNBT(NBTTagCompound par1NBTTagCompound) { -+ super.readEntityFromNBT(par1NBTTagCompound); -+ this.setEatingHaystack(par1NBTTagCompound.getBoolean("EatingHaystack")); -+ this.func_110242_l(par1NBTTagCompound.getBoolean("Bred")); -+ this.setChested(par1NBTTagCompound.getBoolean("ChestedHorse")); -+ this.setHasReproduced(par1NBTTagCompound.getBoolean("HasReproduced")); -+ this.setHorseType(par1NBTTagCompound.getInteger("Type")); -+ this.setHorseVariant(par1NBTTagCompound.getInteger("Variant")); -+ this.setTemper(par1NBTTagCompound.getInteger("Temper")); -+ this.setHorseTamed(par1NBTTagCompound.getBoolean("Tame")); -+ -+ if (par1NBTTagCompound.hasKey("OwnerName")) { -+ this.setOwnerName(par1NBTTagCompound.getString("OwnerName")); - } - - AttributeInstance var2 = this.getAttributeMap().getAttributeInstanceByName("Speed"); -- if(var2 != null) { -+ -+ if (var2 != null) { - this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setAttribute(var2.getBaseValue() * 0.25D); - } - -- if(this.isChested()) { -- NBTTagList var3 = var1.getTagList("Items"); -+ if (this.isChested()) { -+ NBTTagList var3 = par1NBTTagCompound.getTagList("Items"); - this.func_110226_cD(); - -- for(int var4 = 0; var4 < var3.tagCount(); ++var4) { -+ for (int var4 = 0; var4 < var3.tagCount(); ++var4) { - NBTTagCompound var5 = (NBTTagCompound)var3.tagAt(var4); - int var6 = var5.getByte("Slot") & 255; -- if(var6 >= 2 && var6 < this.horseChest.getSizeInventory()) { -+ -+ if (var6 >= 2 && var6 < this.horseChest.getSizeInventory()) { - this.horseChest.setInventorySlotContents(var6, ItemStack.loadItemStackFromNBT(var5)); - } - } - } - - ItemStack var7; -- if(var1.hasKey("ArmorItem")) { -- var7 = ItemStack.loadItemStackFromNBT(var1.getCompoundTag("ArmorItem")); -- if(var7 != null && func_110211_v(var7.itemID)) { -+ -+ if (par1NBTTagCompound.hasKey("ArmorItem")) { -+ var7 = ItemStack.loadItemStackFromNBT(par1NBTTagCompound.getCompoundTag("ArmorItem")); -+ -+ if (var7 != null && func_110211_v(var7.itemID)) { - this.horseChest.setInventorySlotContents(1, var7); - } - } - -- if(var1.hasKey("SaddleItem")) { -- var7 = ItemStack.loadItemStackFromNBT(var1.getCompoundTag("SaddleItem")); -- if(var7 != null && var7.itemID == Item.saddle.itemID) { -+ if (par1NBTTagCompound.hasKey("SaddleItem")) { -+ var7 = ItemStack.loadItemStackFromNBT(par1NBTTagCompound.getCompoundTag("SaddleItem")); -+ -+ if (var7 != null && var7.itemID == Item.saddle.itemID) { - this.horseChest.setInventorySlotContents(0, var7); - } -- } else if(var1.getBoolean("Saddle")) { -+ } else if (par1NBTTagCompound.getBoolean("Saddle")) { - this.horseChest.setInventorySlotContents(0, new ItemStack(Item.saddle)); - } - - this.func_110232_cE(); - } - -- public boolean canMateWith(EntityAnimal var1) { -- if(var1 == this) { -+ /** -+ * Returns true if the mob is currently able to mate with the specified mob. -+ */ -+ public boolean canMateWith(EntityAnimal par1EntityAnimal) { -+ if (par1EntityAnimal == this) { - return false; -- } else if(var1.getClass() != this.getClass()) { -+ } else if (par1EntityAnimal.getClass() != this.getClass()) { - return false; - } else { -- EntityHorse var2 = (EntityHorse)var1; -- if(this.func_110200_cJ() && var2.func_110200_cJ()) { -+ EntityHorse var2 = (EntityHorse)par1EntityAnimal; -+ -+ if (this.func_110200_cJ() && var2.func_110200_cJ()) { - int var3 = this.getHorseType(); - int var4 = var2.getHorseType(); - return var3 == var4 || var3 == 0 && var4 == 1 || var3 == 1 && var4 == 0; -@@ -1046,188 +1177,201 @@ - } - } - -- public EntityAgeable createChild(EntityAgeable var1) { -- EntityHorse var2 = (EntityHorse)var1; -+ public EntityAgeable createChild(EntityAgeable par1EntityAgeable) { -+ EntityHorse var2 = (EntityHorse)par1EntityAgeable; - EntityHorse var3 = new EntityHorse(this.worldObj); - int var4 = this.getHorseType(); - int var5 = var2.getHorseType(); - int var6 = 0; -- if(var4 == var5) { -+ -+ if (var4 == var5) { - var6 = var4; -- } else if(var4 == 0 && var5 == 1 || var4 == 1 && var5 == 0) { -+ } else if (var4 == 0 && var5 == 1 || var4 == 1 && var5 == 0) { - var6 = 2; - } - -- if(var6 == 0) { -- int var8 = this.ab.nextInt(9); -+ if (var6 == 0) { -+ int var8 = this.rand.nextInt(9); - int var7; -- if(var8 < 4) { -+ -+ if (var8 < 4) { - var7 = this.getHorseVariant() & 255; -- } else if(var8 < 8) { -+ } else if (var8 < 8) { - var7 = var2.getHorseVariant() & 255; - } else { -- var7 = this.ab.nextInt(7); -+ var7 = this.rand.nextInt(7); - } - -- int var9 = this.ab.nextInt(5); -- if(var9 < 4) { -- var7 |= this.getHorseVariant() & '\uff00'; -- } else if(var9 < 8) { -- var7 |= var2.getHorseVariant() & '\uff00'; -+ int var9 = this.rand.nextInt(5); -+ -+ if (var9 < 4) { -+ var7 |= this.getHorseVariant() & 65280; -+ } else if (var9 < 8) { -+ var7 |= var2.getHorseVariant() & 65280; - } else { -- var7 |= this.ab.nextInt(5) << 8 & '\uff00'; -+ var7 |= this.rand.nextInt(5) << 8 & 65280; - } - - var3.setHorseVariant(var7); - } - - var3.setHorseType(var6); -- double var14 = this.getEntityAttribute(SharedMonsterAttributes.maxHealth).getBaseValue() + var1.getEntityAttribute(SharedMonsterAttributes.maxHealth).getBaseValue() + (double)this.func_110267_cL(); -+ double var14 = this.getEntityAttribute(SharedMonsterAttributes.maxHealth).getBaseValue() + par1EntityAgeable.getEntityAttribute(SharedMonsterAttributes.maxHealth).getBaseValue() + (double)this.func_110267_cL(); - var3.getEntityAttribute(SharedMonsterAttributes.maxHealth).setAttribute(var14 / 3.0D); -- double var13 = this.getEntityAttribute(horseJumpStrength).getBaseValue() + var1.getEntityAttribute(horseJumpStrength).getBaseValue() + this.func_110245_cM(); -+ double var13 = this.getEntityAttribute(horseJumpStrength).getBaseValue() + par1EntityAgeable.getEntityAttribute(horseJumpStrength).getBaseValue() + this.func_110245_cM(); - var3.getEntityAttribute(horseJumpStrength).setAttribute(var13 / 3.0D); -- double var11 = this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).getBaseValue() + var1.getEntityAttribute(SharedMonsterAttributes.movementSpeed).getBaseValue() + this.func_110203_cN(); -+ double var11 = this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).getBaseValue() + par1EntityAgeable.getEntityAttribute(SharedMonsterAttributes.movementSpeed).getBaseValue() + this.func_110203_cN(); - var3.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setAttribute(var11 / 3.0D); - return var3; - } - -- public EntityLivingData onSpawnWithEgg(EntityLivingData var1) { -- Object var6 = super.onSpawnWithEgg(var1); -+ public EntityLivingData onSpawnWithEgg(EntityLivingData par1EntityLivingData) { -+ Object par1EntityLivingData1 = super.onSpawnWithEgg(par1EntityLivingData); - boolean var2 = false; - int var3 = 0; - int var7; -- if(var6 instanceof EntityHorseGroupData) { -- var7 = ((EntityHorseGroupData)var6).field_111107_a; -- var3 = ((EntityHorseGroupData)var6).field_111106_b & 255 | this.ab.nextInt(5) << 8; -+ -+ if (par1EntityLivingData1 instanceof EntityHorseGroupData) { -+ var7 = ((EntityHorseGroupData)par1EntityLivingData1).field_111107_a; -+ var3 = ((EntityHorseGroupData)par1EntityLivingData1).field_111106_b & 255 | this.rand.nextInt(5) << 8; - } else { -- if(this.ab.nextInt(10) == 0) { -+ if (this.rand.nextInt(10) == 0) { - var7 = 1; - } else { -- int var4 = this.ab.nextInt(7); -- int var5 = this.ab.nextInt(5); -+ int var4 = this.rand.nextInt(7); -+ int var5 = this.rand.nextInt(5); - var7 = 0; - var3 = var4 | var5 << 8; - } - -- var6 = new EntityHorseGroupData(var7, var3); -+ par1EntityLivingData1 = new EntityHorseGroupData(var7, var3); - } - - this.setHorseType(var7); - this.setHorseVariant(var3); -- if(this.ab.nextInt(5) == 0) { -+ -+ if (this.rand.nextInt(5) == 0) { - this.setGrowingAge(-24000); - } - -- if(var7 != 4 && var7 != 3) { -+ if (var7 != 4 && var7 != 3) { - this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setAttribute((double)this.func_110267_cL()); -- if(var7 == 0) { -+ -+ if (var7 == 0) { - this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setAttribute(this.func_110203_cN()); - } else { -- this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setAttribute((double)0.175F); -+ this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setAttribute(0.17499999701976776D); - } - } else { - this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setAttribute(15.0D); -- this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setAttribute((double)0.2F); -+ this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setAttribute(0.20000000298023224D); - } - -- if(var7 != 2 && var7 != 1) { -+ if (var7 != 2 && var7 != 1) { - this.getEntityAttribute(horseJumpStrength).setAttribute(this.func_110245_cM()); - } else { - this.getEntityAttribute(horseJumpStrength).setAttribute(0.5D); - } - - this.setHealth(this.getMaxHealth()); -- return (EntityLivingData)var6; -- } -- -- public float getGrassEatingAmount(float var1) { -- return this.prevHeadLean + (this.headLean - this.prevHeadLean) * var1; -- } -- -- public float getRearingAmount(float var1) { -- return this.prevRearingAmount + (this.rearingAmount - this.prevRearingAmount) * var1; -- } -- -- public float func_110201_q(float var1) { -- return this.prevMouthOpenness + (this.mouthOpenness - this.prevMouthOpenness) * var1; -- } -- -+ return (EntityLivingData)par1EntityLivingData1; -+ } -+ -+ public float getGrassEatingAmount(float par1) { -+ return this.prevHeadLean + (this.headLean - this.prevHeadLean) * par1; -+ } -+ -+ public float getRearingAmount(float par1) { -+ return this.prevRearingAmount + (this.rearingAmount - this.prevRearingAmount) * par1; -+ } -+ -+ public float func_110201_q(float par1) { -+ return this.prevMouthOpenness + (this.mouthOpenness - this.prevMouthOpenness) * par1; -+ } -+ -+ /** -+ * Returns true if the newer Entity AI code should be run -+ */ - protected boolean isAIEnabled() { - return true; - } - -- public void setJumpPower(int var1) { -- if(this.isHorseSaddled()) { -- if(var1 < 0) { -- var1 = 0; -+ public void setJumpPower(int par1) { -+ if (this.isHorseSaddled()) { -+ if (par1 < 0) { -+ par1 = 0; - } else { - this.field_110294_bI = true; - this.makeHorseRear(); - } - -- if(var1 >= 90) { -+ if (par1 >= 90) { - this.jumpPower = 1.0F; - } else { -- this.jumpPower = 0.4F + 0.4F * (float)var1 / 90.0F; -+ this.jumpPower = 0.4F + 0.4F * (float)par1 / 90.0F; - } - } -- - } - -- protected void spawnHorseParticles(boolean var1) { -- String var2 = var1 ? "heart" : "smoke"; -+ /** -+ * "Spawns particles for the horse entity. par1 tells whether to spawn hearts. If it is false, it spawns smoke." -+ */ -+ protected void spawnHorseParticles(boolean par1) { -+ String var2 = par1 ? "heart" : "smoke"; - -- for(int var3 = 0; var3 < 7; ++var3) { -- double var4 = this.ab.nextGaussian() * 0.02D; -- double var6 = this.ab.nextGaussian() * 0.02D; -- double var8 = this.ab.nextGaussian() * 0.02D; -- this.worldObj.spawnParticle(var2, this.posX + (double)(this.ab.nextFloat() * this.width * 2.0F) - (double)this.width, this.posY + 0.5D + (double)(this.ab.nextFloat() * this.height), this.posZ + (double)(this.ab.nextFloat() * this.width * 2.0F) - (double)this.width, var4, var6, var8); -+ for (int var3 = 0; var3 < 7; ++var3) { -+ double var4 = this.rand.nextGaussian() * 0.02D; -+ double var6 = this.rand.nextGaussian() * 0.02D; -+ double var8 = this.rand.nextGaussian() * 0.02D; -+ this.worldObj.spawnParticle(var2, this.posX + (double)(this.rand.nextFloat() * this.width * 2.0F) - (double)this.width, this.posY + 0.5D + (double)(this.rand.nextFloat() * this.height), this.posZ + (double)(this.rand.nextFloat() * this.width * 2.0F) - (double)this.width, var4, var6, var8); - } -- - } - -- public void handleHealthUpdate(byte var1) { -- if(var1 == 7) { -+ public void handleHealthUpdate(byte par1) { -+ if (par1 == 7) { - this.spawnHorseParticles(true); -- } else if(var1 == 6) { -+ } else if (par1 == 6) { - this.spawnHorseParticles(false); - } else { -- super.handleHealthUpdate(var1); -+ super.handleHealthUpdate(par1); - } -- - } - - public void updateRiderPosition() { - super.updateRiderPosition(); -- if(this.prevRearingAmount > 0.0F) { -+ -+ if (this.prevRearingAmount > 0.0F) { - float var1 = MathHelper.sin(this.renderYawOffset * (float)Math.PI / 180.0F); - float var2 = MathHelper.cos(this.renderYawOffset * (float)Math.PI / 180.0F); - float var3 = 0.7F * this.prevRearingAmount; - float var4 = 0.15F * this.prevRearingAmount; - this.riddenByEntity.setPosition(this.posX + (double)(var3 * var1), this.posY + this.getMountedYOffset() + this.riddenByEntity.getYOffset() + (double)var4, this.posZ - (double)(var3 * var2)); -- if(this.riddenByEntity instanceof EntityLivingBase) { -+ -+ if (this.riddenByEntity instanceof EntityLivingBase) { - ((EntityLivingBase)this.riddenByEntity).renderYawOffset = this.renderYawOffset; - } - } -- - } - - private float func_110267_cL() { -- return 15.0F + (float)this.ab.nextInt(8) + (float)this.ab.nextInt(9); -+ return 15.0F + (float)this.rand.nextInt(8) + (float)this.rand.nextInt(9); - } - - private double func_110245_cM() { -- return (double)0.4F + this.ab.nextDouble() * 0.2D + this.ab.nextDouble() * 0.2D + this.ab.nextDouble() * 0.2D; -+ return 0.4000000059604645D + this.rand.nextDouble() * 0.2D + this.rand.nextDouble() * 0.2D + this.rand.nextDouble() * 0.2D; - } - - private double func_110203_cN() { -- return ((double)0.45F + this.ab.nextDouble() * 0.3D + this.ab.nextDouble() * 0.3D + this.ab.nextDouble() * 0.3D) * 0.25D; -- } -- -- public static boolean func_110211_v(int var0) { -- return var0 == Item.horseArmorIron.itemID || var0 == Item.horseArmorGold.itemID || var0 == Item.horseArmorDiamond.itemID; -- } -- -+ return (0.44999998807907104D + this.rand.nextDouble() * 0.3D + this.rand.nextDouble() * 0.3D + this.rand.nextDouble() * 0.3D) * 0.25D; -+ } -+ -+ public static boolean func_110211_v(int par0) { -+ return par0 == Item.horseArmorIron.itemID || par0 == Item.horseArmorGold.itemID || par0 == Item.horseArmorDiamond.itemID; -+ } -+ -+ /** -+ * returns true if this entity is by a ladder, false otherwise -+ */ - public boolean isOnLadder() { - return false; - } ---- net/minecraft/src/IBlockAccess.java -+++ net/minecraft/src/IBlockAccess.java -@@ -1,35 +1,90 @@ - package net.minecraft.src; - - public interface IBlockAccess { -+ -+ /** -+ * Returns the block ID at coords x,y,z -+ */ - int getBlockId(int var1, int var2, int var3); - -+ /** -+ * Returns the TileEntity associated with a given block in X,Y,Z coordinates, or null if no TileEntity exists -+ */ - TileEntity getBlockTileEntity(int var1, int var2, int var3); - -+ /** -+ * Any Light rendered on a 1.8 Block goes through here -+ */ - int getLightBrightnessForSkyBlocks(int var1, int var2, int var3, int var4); - - float getBrightness(int var1, int var2, int var3, int var4); - -+ /** -+ * Returns how bright the block is shown as which is the block's light value looked up in a lookup table (light values -+ * aren't linear for brightness). Args: x, y, z -+ */ - float getLightBrightness(int var1, int var2, int var3); - -+ /** -+ * Returns the block metadata at coords x,y,z -+ */ - int getBlockMetadata(int var1, int var2, int var3); - -+ /** -+ * Returns the block's material. -+ */ - Material getBlockMaterial(int var1, int var2, int var3); - -+ /** -+ * Returns true if the block at the specified coordinates is an opaque cube. Args: x, y, z -+ */ - boolean isBlockOpaqueCube(int var1, int var2, int var3); - -+ /** -+ * Indicate if a material is a normal solid opaque cube. -+ */ - boolean isBlockNormalCube(int var1, int var2, int var3); - -+ /** -+ * Returns true if the block at the specified coordinates is empty -+ */ - boolean isAirBlock(int var1, int var2, int var3); - -+ /** -+ * Gets the biome for a given set of x/z coordinates -+ */ - BiomeGenBase getBiomeGenForCoords(int var1, int var2); - -+ /** -+ * Returns current world height. -+ */ - int getHeight(); - -+ /** -+ * set by !chunk.getAreLevelsEmpty -+ */ - boolean extendedLevelsInChunkCache(); - -+ /** -+ * Returns true if the block at the given coordinate has a solid (buildable) top surface. -+ */ - boolean doesBlockHaveSolidTopSurface(int var1, int var2, int var3); - -+ /** -+ * Return the Vec3Pool object for this world. -+ */ - Vec3Pool getWorldVec3Pool(); - -+ /** -+ * Is this block powering in the specified direction Args: x, y, z, direction -+ */ - int isBlockProvidingPowerTo(int var1, int var2, int var3, int var4); -+ -+ // Spout Start -+ public int getGrassColorCache(int x, int y, int z); -+ public void setGrassColorCache(int x, int y, int z, int color); -+ public int getWaterColorCache(int x, int y, int z); -+ public void setWaterColorCache(int x, int y, int z, int color); -+ public WorldChunkManager getWorldChunkManager(); -+ // Spout End - } ---- net/minecraft/src/StructureComponent.java -+++ net/minecraft/src/StructureComponent.java -@@ -6,14 +6,17 @@ - - public abstract class StructureComponent { - protected StructureBoundingBox boundingBox; -+ -+ /** switches the Coordinate System base off the Bounding Box */ - protected int coordBaseMode; -+ -+ /** The type ID of this component. */ - protected int componentType; - -- public StructureComponent() { -- } -+ public StructureComponent() {} - -- protected StructureComponent(int var1) { -- this.componentType = var1; -+ protected StructureComponent(int par1) { -+ this.componentType = par1; - this.coordBaseMode = -1; - } - -@@ -29,42 +32,54 @@ - - protected abstract void func_143012_a(NBTTagCompound var1); - -- public void func_143009_a(World var1, NBTTagCompound var2) { -- if(var2.hasKey("BB")) { -- this.boundingBox = new StructureBoundingBox(var2.getIntArray("BB")); -+ public void func_143009_a(World par1World, NBTTagCompound par2NBTTagCompound) { -+ if (par2NBTTagCompound.hasKey("BB")) { -+ this.boundingBox = new StructureBoundingBox(par2NBTTagCompound.getIntArray("BB")); - } - -- this.coordBaseMode = var2.getInteger("O"); -- this.componentType = var2.getInteger("GD"); -- this.func_143011_b(var2); -+ this.coordBaseMode = par2NBTTagCompound.getInteger("O"); -+ this.componentType = par2NBTTagCompound.getInteger("GD"); -+ this.func_143011_b(par2NBTTagCompound); - } - - protected abstract void func_143011_b(NBTTagCompound var1); - -- public void buildComponent(StructureComponent var1, List var2, Random var3) { -- } -+ /** -+ * Initiates construction of the Structure Component picked, at the current Location of StructGen -+ */ -+ public void buildComponent(StructureComponent par1StructureComponent, List par2List, Random par3Random) {} - -+ /** -+ * second Part of Structure generating, this for example places Spiderwebs, Mob Spawners, it closes Mineshafts at the -+ * end, it adds Fences... -+ */ - public abstract boolean addComponentParts(World var1, Random var2, StructureBoundingBox var3); - - public StructureBoundingBox getBoundingBox() { - return this.boundingBox; - } - -+ /** -+ * Returns the component type ID of this component. -+ */ - public int getComponentType() { - return this.componentType; - } - -- public static StructureComponent findIntersecting(List var0, StructureBoundingBox var1) { -- Iterator var2 = var0.iterator(); -- -+ /** -+ * Discover if bounding box can fit within the current bounding box object. -+ */ -+ public static StructureComponent findIntersecting(List par0List, StructureBoundingBox par1StructureBoundingBox) { -+ Iterator var2 = par0List.iterator(); - StructureComponent var3; -+ - do { -- if(!var2.hasNext()) { -+ if (!var2.hasNext()) { - return null; - } - - var3 = (StructureComponent)var2.next(); -- } while(var3.getBoundingBox() == null || !var3.getBoundingBox().intersectsWith(var1)); -+ } while (var3.getBoundingBox() == null || !var3.getBoundingBox().intersectsWith(par1StructureBoundingBox)); - - return var3; - } -@@ -73,54 +88,63 @@ - return new ChunkPosition(this.boundingBox.getCenterX(), this.boundingBox.getCenterY(), this.boundingBox.getCenterZ()); - } - -- protected boolean isLiquidInStructureBoundingBox(World var1, StructureBoundingBox var2) { -- int var3 = Math.max(this.boundingBox.minX - 1, var2.minX); -- int var4 = Math.max(this.boundingBox.minY - 1, var2.minY); -- int var5 = Math.max(this.boundingBox.minZ - 1, var2.minZ); -- int var6 = Math.min(this.boundingBox.maxX + 1, var2.maxX); -- int var7 = Math.min(this.boundingBox.maxY + 1, var2.maxY); -- int var8 = Math.min(this.boundingBox.maxZ + 1, var2.maxZ); -- -+ /** -+ * checks the entire StructureBoundingBox for Liquids -+ */ -+ protected boolean isLiquidInStructureBoundingBox(World par1World, StructureBoundingBox par2StructureBoundingBox) { -+ int var3 = Math.max(this.boundingBox.minX - 1, par2StructureBoundingBox.minX); -+ int var4 = Math.max(this.boundingBox.minY - 1, par2StructureBoundingBox.minY); -+ int var5 = Math.max(this.boundingBox.minZ - 1, par2StructureBoundingBox.minZ); -+ int var6 = Math.min(this.boundingBox.maxX + 1, par2StructureBoundingBox.maxX); -+ int var7 = Math.min(this.boundingBox.maxY + 1, par2StructureBoundingBox.maxY); -+ int var8 = Math.min(this.boundingBox.maxZ + 1, par2StructureBoundingBox.maxZ); - int var9; - int var10; - int var11; -- for(var9 = var3; var9 <= var6; ++var9) { -- for(var10 = var5; var10 <= var8; ++var10) { -- var11 = var1.getBlockId(var9, var4, var10); -- if(var11 > 0 && Block.blocksList[var11].blockMaterial.isLiquid()) { -- return true; -- } -- -- var11 = var1.getBlockId(var9, var7, var10); -- if(var11 > 0 && Block.blocksList[var11].blockMaterial.isLiquid()) { -- return true; -- } -- } -- } -- -- for(var9 = var3; var9 <= var6; ++var9) { -- for(var10 = var4; var10 <= var7; ++var10) { -- var11 = var1.getBlockId(var9, var10, var5); -- if(var11 > 0 && Block.blocksList[var11].blockMaterial.isLiquid()) { -- return true; -- } -- -- var11 = var1.getBlockId(var9, var10, var8); -- if(var11 > 0 && Block.blocksList[var11].blockMaterial.isLiquid()) { -- return true; -- } -- } -- } -- -- for(var9 = var5; var9 <= var8; ++var9) { -- for(var10 = var4; var10 <= var7; ++var10) { -- var11 = var1.getBlockId(var3, var10, var9); -- if(var11 > 0 && Block.blocksList[var11].blockMaterial.isLiquid()) { -- return true; -- } -- -- var11 = var1.getBlockId(var6, var10, var9); -- if(var11 > 0 && Block.blocksList[var11].blockMaterial.isLiquid()) { -+ -+ for (var9 = var3; var9 <= var6; ++var9) { -+ for (var10 = var5; var10 <= var8; ++var10) { -+ var11 = par1World.getBlockId(var9, var4, var10); -+ -+ if (var11 > 0 && Block.blocksList[var11].blockMaterial.isLiquid()) { -+ return true; -+ } -+ -+ var11 = par1World.getBlockId(var9, var7, var10); -+ -+ if (var11 > 0 && Block.blocksList[var11].blockMaterial.isLiquid()) { -+ return true; -+ } -+ } -+ } -+ -+ for (var9 = var3; var9 <= var6; ++var9) { -+ for (var10 = var4; var10 <= var7; ++var10) { -+ var11 = par1World.getBlockId(var9, var10, var5); -+ -+ if (var11 > 0 && Block.blocksList[var11].blockMaterial.isLiquid()) { -+ return true; -+ } -+ -+ var11 = par1World.getBlockId(var9, var10, var8); -+ -+ if (var11 > 0 && Block.blocksList[var11].blockMaterial.isLiquid()) { -+ return true; -+ } -+ } -+ } -+ -+ for (var9 = var5; var9 <= var8; ++var9) { -+ for (var10 = var4; var10 <= var7; ++var10) { -+ var11 = par1World.getBlockId(var3, var10, var9); -+ -+ if (var11 > 0 && Block.blocksList[var11].blockMaterial.isLiquid()) { -+ return true; -+ } -+ -+ var11 = par1World.getBlockId(var6, var10, var9); -+ -+ if (var11 > 0 && Block.blocksList[var11].blockMaterial.isLiquid()) { - return true; - } - } -@@ -129,465 +153,517 @@ - return false; - } - -- protected int getXWithOffset(int var1, int var2) { -- switch(this.coordBaseMode) { -- case 0: -- case 2: -- return this.boundingBox.minX + var1; -- case 1: -- return this.boundingBox.maxX - var2; -- case 3: -- return this.boundingBox.minX + var2; -- default: -- return var1; -- } -- } -- -- protected int getYWithOffset(int var1) { -- return this.coordBaseMode == -1 ? var1 : var1 + this.boundingBox.minY; -- } -- -- protected int getZWithOffset(int var1, int var2) { -- switch(this.coordBaseMode) { -- case 0: -- return this.boundingBox.minZ + var2; -- case 1: -- case 3: -- return this.boundingBox.minZ + var1; -- case 2: -- return this.boundingBox.maxZ - var2; -- default: -- return var2; -- } -- } -- -- protected int getMetadataWithOffset(int var1, int var2) { -- if(var1 == Block.rail.blockID) { -- if(this.coordBaseMode == 1 || this.coordBaseMode == 3) { -- if(var2 == 1) { -+ protected int getXWithOffset(int par1, int par2) { -+ switch (this.coordBaseMode) { -+ case 0: -+ case 2: -+ return this.boundingBox.minX + par1; -+ -+ case 1: -+ return this.boundingBox.maxX - par2; -+ -+ case 3: -+ return this.boundingBox.minX + par2; -+ -+ default: -+ return par1; -+ } -+ } -+ -+ protected int getYWithOffset(int par1) { -+ return this.coordBaseMode == -1 ? par1 : par1 + this.boundingBox.minY; -+ } -+ -+ protected int getZWithOffset(int par1, int par2) { -+ switch (this.coordBaseMode) { -+ case 0: -+ return this.boundingBox.minZ + par2; -+ -+ case 1: -+ case 3: -+ return this.boundingBox.minZ + par1; -+ -+ case 2: -+ return this.boundingBox.maxZ - par2; -+ -+ default: -+ return par2; -+ } -+ } -+ -+ /** -+ * Returns the direction-shifted metadata for blocks that require orientation, e.g. doors, stairs, ladders. Parameters: -+ * block ID, original metadata -+ */ -+ protected int getMetadataWithOffset(int par1, int par2) { -+ if (par1 == Block.rail.blockID) { -+ if (this.coordBaseMode == 1 || this.coordBaseMode == 3) { -+ if (par2 == 1) { - return 0; - } - - return 1; - } -- } else if(var1 != Block.doorWood.blockID && var1 != Block.doorIron.blockID) { -- if(var1 != Block.stairsCobblestone.blockID && var1 != Block.stairsWoodOak.blockID && var1 != Block.stairsNetherBrick.blockID && var1 != Block.stairsStoneBrick.blockID && var1 != Block.stairsSandStone.blockID) { -- if(var1 == Block.ladder.blockID) { -- if(this.coordBaseMode == 0) { -- if(var2 == 2) { -- return 3; -- } -- -- if(var2 == 3) { -- return 2; -- } -- } else if(this.coordBaseMode == 1) { -- if(var2 == 2) { -- return 4; -- } -- -- if(var2 == 3) { -- return 5; -- } -- -- if(var2 == 4) { -- return 2; -- } -- -- if(var2 == 5) { -- return 3; -- } -- } else if(this.coordBaseMode == 3) { -- if(var2 == 2) { -- return 5; -- } -- -- if(var2 == 3) { -- return 4; -- } -- -- if(var2 == 4) { -- return 2; -- } -- -- if(var2 == 5) { -- return 3; -- } -- } -- } else if(var1 == Block.stoneButton.blockID) { -- if(this.coordBaseMode == 0) { -- if(var2 == 3) { -- return 4; -- } -- -- if(var2 == 4) { -- return 3; -- } -- } else if(this.coordBaseMode == 1) { -- if(var2 == 3) { -- return 1; -- } -- -- if(var2 == 4) { -- return 2; -- } -- -- if(var2 == 2) { -- return 3; -- } -- -- if(var2 == 1) { -- return 4; -- } -- } else if(this.coordBaseMode == 3) { -- if(var2 == 3) { -- return 2; -- } -- -- if(var2 == 4) { -- return 1; -- } -- -- if(var2 == 2) { -- return 3; -- } -- -- if(var2 == 1) { -- return 4; -- } -- } -- } else if(var1 != Block.tripWireSource.blockID && (Block.blocksList[var1] == null || !(Block.blocksList[var1] instanceof BlockDirectional))) { -- if(var1 == Block.pistonBase.blockID || var1 == Block.pistonStickyBase.blockID || var1 == Block.lever.blockID || var1 == Block.dispenser.blockID) { -- if(this.coordBaseMode == 0) { -- if(var2 == 2 || var2 == 3) { -- return Facing.oppositeSide[var2]; -- } -- } else if(this.coordBaseMode == 1) { -- if(var2 == 2) { -- return 4; -- } -- -- if(var2 == 3) { -- return 5; -- } -- -- if(var2 == 4) { -- return 2; -- } -- -- if(var2 == 5) { -- return 3; -- } -- } else if(this.coordBaseMode == 3) { -- if(var2 == 2) { -- return 5; -- } -- -- if(var2 == 3) { -- return 4; -- } -- -- if(var2 == 4) { -- return 2; -- } -- -- if(var2 == 5) { -- return 3; -- } -- } -- } -- } else if(this.coordBaseMode == 0) { -- if(var2 == 0 || var2 == 2) { -- return Direction.rotateOpposite[var2]; -- } -- } else if(this.coordBaseMode == 1) { -- if(var2 == 2) { -- return 1; -- } -- -- if(var2 == 0) { -- return 3; -- } -- -- if(var2 == 1) { -- return 2; -- } -- -- if(var2 == 3) { -- return 0; -- } -- } else if(this.coordBaseMode == 3) { -- if(var2 == 2) { -- return 3; -- } -- -- if(var2 == 0) { -- return 1; -- } -- -- if(var2 == 1) { -- return 2; -- } -- -- if(var2 == 3) { -- return 0; -- } -- } -- } else if(this.coordBaseMode == 0) { -- if(var2 == 2) { -- return 3; -- } -- -- if(var2 == 3) { -- return 2; -- } -- } else if(this.coordBaseMode == 1) { -- if(var2 == 0) { -- return 2; -- } -- -- if(var2 == 1) { -- return 3; -- } -- -- if(var2 == 2) { -+ } else if (par1 != Block.doorWood.blockID && par1 != Block.doorIron.blockID) { -+ if (par1 != Block.stairsCobblestone.blockID && par1 != Block.stairsWoodOak.blockID && par1 != Block.stairsNetherBrick.blockID && par1 != Block.stairsStoneBrick.blockID && par1 != Block.stairsSandStone.blockID) { -+ if (par1 == Block.ladder.blockID) { -+ if (this.coordBaseMode == 0) { -+ if (par2 == 2) { -+ return 3; -+ } -+ -+ if (par2 == 3) { -+ return 2; -+ } -+ } else if (this.coordBaseMode == 1) { -+ if (par2 == 2) { -+ return 4; -+ } -+ -+ if (par2 == 3) { -+ return 5; -+ } -+ -+ if (par2 == 4) { -+ return 2; -+ } -+ -+ if (par2 == 5) { -+ return 3; -+ } -+ } else if (this.coordBaseMode == 3) { -+ if (par2 == 2) { -+ return 5; -+ } -+ -+ if (par2 == 3) { -+ return 4; -+ } -+ -+ if (par2 == 4) { -+ return 2; -+ } -+ -+ if (par2 == 5) { -+ return 3; -+ } -+ } -+ } else if (par1 == Block.stoneButton.blockID) { -+ if (this.coordBaseMode == 0) { -+ if (par2 == 3) { -+ return 4; -+ } -+ -+ if (par2 == 4) { -+ return 3; -+ } -+ } else if (this.coordBaseMode == 1) { -+ if (par2 == 3) { -+ return 1; -+ } -+ -+ if (par2 == 4) { -+ return 2; -+ } -+ -+ if (par2 == 2) { -+ return 3; -+ } -+ -+ if (par2 == 1) { -+ return 4; -+ } -+ } else if (this.coordBaseMode == 3) { -+ if (par2 == 3) { -+ return 2; -+ } -+ -+ if (par2 == 4) { -+ return 1; -+ } -+ -+ if (par2 == 2) { -+ return 3; -+ } -+ -+ if (par2 == 1) { -+ return 4; -+ } -+ } -+ } else if (par1 != Block.tripWireSource.blockID && (Block.blocksList[par1] == null || !(Block.blocksList[par1] instanceof BlockDirectional))) { -+ if (par1 == Block.pistonBase.blockID || par1 == Block.pistonStickyBase.blockID || par1 == Block.lever.blockID || par1 == Block.dispenser.blockID) { -+ if (this.coordBaseMode == 0) { -+ if (par2 == 2 || par2 == 3) { -+ return Facing.oppositeSide[par2]; -+ } -+ } else if (this.coordBaseMode == 1) { -+ if (par2 == 2) { -+ return 4; -+ } -+ -+ if (par2 == 3) { -+ return 5; -+ } -+ -+ if (par2 == 4) { -+ return 2; -+ } -+ -+ if (par2 == 5) { -+ return 3; -+ } -+ } else if (this.coordBaseMode == 3) { -+ if (par2 == 2) { -+ return 5; -+ } -+ -+ if (par2 == 3) { -+ return 4; -+ } -+ -+ if (par2 == 4) { -+ return 2; -+ } -+ -+ if (par2 == 5) { -+ return 3; -+ } -+ } -+ } -+ } else if (this.coordBaseMode == 0) { -+ if (par2 == 0 || par2 == 2) { -+ return Direction.rotateOpposite[par2]; -+ } -+ } else if (this.coordBaseMode == 1) { -+ if (par2 == 2) { -+ return 1; -+ } -+ -+ if (par2 == 0) { -+ return 3; -+ } -+ -+ if (par2 == 1) { -+ return 2; -+ } -+ -+ if (par2 == 3) { -+ return 0; -+ } -+ } else if (this.coordBaseMode == 3) { -+ if (par2 == 2) { -+ return 3; -+ } -+ -+ if (par2 == 0) { -+ return 1; -+ } -+ -+ if (par2 == 1) { -+ return 2; -+ } -+ -+ if (par2 == 3) { -+ return 0; -+ } -+ } -+ } else if (this.coordBaseMode == 0) { -+ if (par2 == 2) { -+ return 3; -+ } -+ -+ if (par2 == 3) { -+ return 2; -+ } -+ } else if (this.coordBaseMode == 1) { -+ if (par2 == 0) { -+ return 2; -+ } -+ -+ if (par2 == 1) { -+ return 3; -+ } -+ -+ if (par2 == 2) { - return 0; - } - -- if(var2 == 3) { -+ if (par2 == 3) { - return 1; - } -- } else if(this.coordBaseMode == 3) { -- if(var2 == 0) { -+ } else if (this.coordBaseMode == 3) { -+ if (par2 == 0) { - return 2; - } - -- if(var2 == 1) { -+ if (par2 == 1) { - return 3; - } - -- if(var2 == 2) { -+ if (par2 == 2) { - return 1; - } - -- if(var2 == 3) { -+ if (par2 == 3) { - return 0; - } - } -- } else if(this.coordBaseMode == 0) { -- if(var2 == 0) { -+ } else if (this.coordBaseMode == 0) { -+ if (par2 == 0) { - return 2; - } - -- if(var2 == 2) { -+ if (par2 == 2) { - return 0; - } - } else { -- if(this.coordBaseMode == 1) { -- return var2 + 1 & 3; -- } -- -- if(this.coordBaseMode == 3) { -- return var2 + 3 & 3; -- } -- } -- -- return var2; -- } -- -- protected void placeBlockAtCurrentPosition(World var1, int var2, int var3, int var4, int var5, int var6, StructureBoundingBox var7) { -- int var8 = this.getXWithOffset(var4, var6); -- int var9 = this.getYWithOffset(var5); -- int var10 = this.getZWithOffset(var4, var6); -- if(var7.isVecInside(var8, var9, var10)) { -- var1.setBlock(var8, var9, var10, var2, var3, 2); -- } -- } -- -- protected int getBlockIdAtCurrentPosition(World var1, int var2, int var3, int var4, StructureBoundingBox var5) { -- int var6 = this.getXWithOffset(var2, var4); -- int var7 = this.getYWithOffset(var3); -- int var8 = this.getZWithOffset(var2, var4); -- return !var5.isVecInside(var6, var7, var8) ? 0 : var1.getBlockId(var6, var7, var8); -- } -- -- protected void fillWithAir(World var1, StructureBoundingBox var2, int var3, int var4, int var5, int var6, int var7, int var8) { -- for(int var9 = var4; var9 <= var7; ++var9) { -- for(int var10 = var3; var10 <= var6; ++var10) { -- for(int var11 = var5; var11 <= var8; ++var11) { -- this.placeBlockAtCurrentPosition(var1, 0, 0, var10, var9, var11, var2); -- } -- } -- } -- -- } -- -- protected void fillWithBlocks(World var1, StructureBoundingBox var2, int var3, int var4, int var5, int var6, int var7, int var8, int var9, int var10, boolean var11) { -- for(int var12 = var4; var12 <= var7; ++var12) { -- for(int var13 = var3; var13 <= var6; ++var13) { -- for(int var14 = var5; var14 <= var8; ++var14) { -- if(!var11 || this.getBlockIdAtCurrentPosition(var1, var13, var12, var14, var2) != 0) { -- if(var12 != var4 && var12 != var7 && var13 != var3 && var13 != var6 && var14 != var5 && var14 != var8) { -- this.placeBlockAtCurrentPosition(var1, var10, 0, var13, var12, var14, var2); -- } else { -- this.placeBlockAtCurrentPosition(var1, var9, 0, var13, var12, var14, var2); -- } -- } -- } -- } -- } -- -- } -- -- protected void fillWithMetadataBlocks(World var1, StructureBoundingBox var2, int var3, int var4, int var5, int var6, int var7, int var8, int var9, int var10, int var11, int var12, boolean var13) { -- for(int var14 = var4; var14 <= var7; ++var14) { -- for(int var15 = var3; var15 <= var6; ++var15) { -- for(int var16 = var5; var16 <= var8; ++var16) { -- if(!var13 || this.getBlockIdAtCurrentPosition(var1, var15, var14, var16, var2) != 0) { -- if(var14 != var4 && var14 != var7 && var15 != var3 && var15 != var6 && var16 != var5 && var16 != var8) { -- this.placeBlockAtCurrentPosition(var1, var11, var12, var15, var14, var16, var2); -- } else { -- this.placeBlockAtCurrentPosition(var1, var9, var10, var15, var14, var16, var2); -- } -- } -- } -- } -- } -- -- } -- -- protected void fillWithRandomizedBlocks(World var1, StructureBoundingBox var2, int var3, int var4, int var5, int var6, int var7, int var8, boolean var9, Random var10, StructurePieceBlockSelector var11) { -- for(int var12 = var4; var12 <= var7; ++var12) { -- for(int var13 = var3; var13 <= var6; ++var13) { -- for(int var14 = var5; var14 <= var8; ++var14) { -- if(!var9 || this.getBlockIdAtCurrentPosition(var1, var13, var12, var14, var2) != 0) { -- var11.selectBlocks(var10, var13, var12, var14, var12 == var4 || var12 == var7 || var13 == var3 || var13 == var6 || var14 == var5 || var14 == var8); -- this.placeBlockAtCurrentPosition(var1, var11.getSelectedBlockId(), var11.getSelectedBlockMetaData(), var13, var12, var14, var2); -- } -- } -- } -- } -- -- } -- -- protected void randomlyFillWithBlocks(World var1, StructureBoundingBox var2, Random var3, float var4, int var5, int var6, int var7, int var8, int var9, int var10, int var11, int var12, boolean var13) { -- for(int var14 = var6; var14 <= var9; ++var14) { -- for(int var15 = var5; var15 <= var8; ++var15) { -- for(int var16 = var7; var16 <= var10; ++var16) { -- if(var3.nextFloat() <= var4 && (!var13 || this.getBlockIdAtCurrentPosition(var1, var15, var14, var16, var2) != 0)) { -- if(var14 != var6 && var14 != var9 && var15 != var5 && var15 != var8 && var16 != var7 && var16 != var10) { -- this.placeBlockAtCurrentPosition(var1, var12, 0, var15, var14, var16, var2); -- } else { -- this.placeBlockAtCurrentPosition(var1, var11, 0, var15, var14, var16, var2); -- } -- } -- } -- } -- } -- -- } -- -- protected void randomlyPlaceBlock(World var1, StructureBoundingBox var2, Random var3, float var4, int var5, int var6, int var7, int var8, int var9) { -- if(var3.nextFloat() < var4) { -- this.placeBlockAtCurrentPosition(var1, var8, var9, var5, var6, var7, var2); -- } -- -- } -- -- protected void randomlyRareFillWithBlocks(World var1, StructureBoundingBox var2, int var3, int var4, int var5, int var6, int var7, int var8, int var9, boolean var10) { -- float var11 = (float)(var6 - var3 + 1); -- float var12 = (float)(var7 - var4 + 1); -- float var13 = (float)(var8 - var5 + 1); -- float var14 = (float)var3 + var11 / 2.0F; -- float var15 = (float)var5 + var13 / 2.0F; -- -- for(int var16 = var4; var16 <= var7; ++var16) { -- float var17 = (float)(var16 - var4) / var12; -- -- for(int var18 = var3; var18 <= var6; ++var18) { -+ if (this.coordBaseMode == 1) { -+ return par2 + 1 & 3; -+ } -+ -+ if (this.coordBaseMode == 3) { -+ return par2 + 3 & 3; -+ } -+ } -+ -+ return par2; -+ } -+ -+ /** -+ * current Position depends on currently set Coordinates mode, is computed here -+ */ -+ protected void placeBlockAtCurrentPosition(World par1World, int par2, int par3, int par4, int par5, int par6, StructureBoundingBox par7StructureBoundingBox) { -+ int var8 = this.getXWithOffset(par4, par6); -+ int var9 = this.getYWithOffset(par5); -+ int var10 = this.getZWithOffset(par4, par6); -+ -+ if (par7StructureBoundingBox.isVecInside(var8, var9, var10)) { -+ par1World.setBlock(var8, var9, var10, par2, par3, 2); -+ } -+ } -+ -+ protected int getBlockIdAtCurrentPosition(World par1World, int par2, int par3, int par4, StructureBoundingBox par5StructureBoundingBox) { -+ int var6 = this.getXWithOffset(par2, par4); -+ int var7 = this.getYWithOffset(par3); -+ int var8 = this.getZWithOffset(par2, par4); -+ return !par5StructureBoundingBox.isVecInside(var6, var7, var8) ? 0 : par1World.getBlockId(var6, var7, var8); -+ } -+ -+ /** -+ * arguments: (World worldObj, StructureBoundingBox structBB, int minX, int minY, int minZ, int maxX, int maxY, int -+ * maxZ) -+ */ -+ protected void fillWithAir(World par1World, StructureBoundingBox par2StructureBoundingBox, int par3, int par4, int par5, int par6, int par7, int par8) { -+ for (int var9 = par4; var9 <= par7; ++var9) { -+ for (int var10 = par3; var10 <= par6; ++var10) { -+ for (int var11 = par5; var11 <= par8; ++var11) { -+ this.placeBlockAtCurrentPosition(par1World, 0, 0, var10, var9, var11, par2StructureBoundingBox); -+ } -+ } -+ } -+ } -+ -+ /** -+ * arguments: (World worldObj, StructureBoundingBox structBB, int minX, int minY, int minZ, int maxX, int maxY, int -+ * maxZ, int placeBlockId, int replaceBlockId, boolean alwaysreplace) -+ */ -+ protected void fillWithBlocks(World par1World, StructureBoundingBox par2StructureBoundingBox, int par3, int par4, int par5, int par6, int par7, int par8, int par9, int par10, boolean par11) { -+ for (int var12 = par4; var12 <= par7; ++var12) { -+ for (int var13 = par3; var13 <= par6; ++var13) { -+ for (int var14 = par5; var14 <= par8; ++var14) { -+ if (!par11 || this.getBlockIdAtCurrentPosition(par1World, var13, var12, var14, par2StructureBoundingBox) != 0) { -+ if (var12 != par4 && var12 != par7 && var13 != par3 && var13 != par6 && var14 != par5 && var14 != par8) { -+ this.placeBlockAtCurrentPosition(par1World, par10, 0, var13, var12, var14, par2StructureBoundingBox); -+ } else { -+ this.placeBlockAtCurrentPosition(par1World, par9, 0, var13, var12, var14, par2StructureBoundingBox); -+ } -+ } -+ } -+ } -+ } -+ } -+ -+ /** -+ * arguments: (World worldObj, StructureBoundingBox structBB, int minX, int minY, int minZ, int maxX, int maxY, int -+ * maxZ, int placeBlockId, int placeBlockMetadata, int replaceBlockId, int replaceBlockMetadata, boolean alwaysreplace) -+ */ -+ protected void fillWithMetadataBlocks(World par1World, StructureBoundingBox par2StructureBoundingBox, int par3, int par4, int par5, int par6, int par7, int par8, int par9, int par10, int par11, int par12, boolean par13) { -+ for (int var14 = par4; var14 <= par7; ++var14) { -+ for (int var15 = par3; var15 <= par6; ++var15) { -+ for (int var16 = par5; var16 <= par8; ++var16) { -+ if (!par13 || this.getBlockIdAtCurrentPosition(par1World, var15, var14, var16, par2StructureBoundingBox) != 0) { -+ if (var14 != par4 && var14 != par7 && var15 != par3 && var15 != par6 && var16 != par5 && var16 != par8) { -+ this.placeBlockAtCurrentPosition(par1World, par11, par12, var15, var14, var16, par2StructureBoundingBox); -+ } else { -+ this.placeBlockAtCurrentPosition(par1World, par9, par10, var15, var14, var16, par2StructureBoundingBox); -+ } -+ } -+ } -+ } -+ } -+ } -+ -+ /** -+ * arguments: World worldObj, StructureBoundingBox structBB, int minX, int minY, int minZ, int maxX, int maxY, int -+ * maxZ, boolean alwaysreplace, Random rand, StructurePieceBlockSelector blockselector -+ */ -+ protected void fillWithRandomizedBlocks(World par1World, StructureBoundingBox par2StructureBoundingBox, int par3, int par4, int par5, int par6, int par7, int par8, boolean par9, Random par10Random, StructurePieceBlockSelector par11StructurePieceBlockSelector) { -+ for (int var12 = par4; var12 <= par7; ++var12) { -+ for (int var13 = par3; var13 <= par6; ++var13) { -+ for (int var14 = par5; var14 <= par8; ++var14) { -+ if (!par9 || this.getBlockIdAtCurrentPosition(par1World, var13, var12, var14, par2StructureBoundingBox) != 0) { -+ par11StructurePieceBlockSelector.selectBlocks(par10Random, var13, var12, var14, var12 == par4 || var12 == par7 || var13 == par3 || var13 == par6 || var14 == par5 || var14 == par8); -+ this.placeBlockAtCurrentPosition(par1World, par11StructurePieceBlockSelector.getSelectedBlockId(), par11StructurePieceBlockSelector.getSelectedBlockMetaData(), var13, var12, var14, par2StructureBoundingBox); -+ } -+ } -+ } -+ } -+ } -+ -+ /** -+ * arguments: World worldObj, StructureBoundingBox structBB, Random rand, float randLimit, int minX, int minY, int -+ * minZ, int maxX, int maxY, int maxZ, int olaceBlockId, int replaceBlockId, boolean alwaysreplace -+ */ -+ protected void randomlyFillWithBlocks(World par1World, StructureBoundingBox par2StructureBoundingBox, Random par3Random, float par4, int par5, int par6, int par7, int par8, int par9, int par10, int par11, int par12, boolean par13) { -+ for (int var14 = par6; var14 <= par9; ++var14) { -+ for (int var15 = par5; var15 <= par8; ++var15) { -+ for (int var16 = par7; var16 <= par10; ++var16) { -+ if (par3Random.nextFloat() <= par4 && (!par13 || this.getBlockIdAtCurrentPosition(par1World, var15, var14, var16, par2StructureBoundingBox) != 0)) { -+ if (var14 != par6 && var14 != par9 && var15 != par5 && var15 != par8 && var16 != par7 && var16 != par10) { -+ this.placeBlockAtCurrentPosition(par1World, par12, 0, var15, var14, var16, par2StructureBoundingBox); -+ } else { -+ this.placeBlockAtCurrentPosition(par1World, par11, 0, var15, var14, var16, par2StructureBoundingBox); -+ } -+ } -+ } -+ } -+ } -+ } -+ -+ /** -+ * Randomly decides if placing or not. Used for Decoration such as Torches and Spiderwebs -+ */ -+ protected void randomlyPlaceBlock(World par1World, StructureBoundingBox par2StructureBoundingBox, Random par3Random, float par4, int par5, int par6, int par7, int par8, int par9) { -+ if (par3Random.nextFloat() < par4) { -+ this.placeBlockAtCurrentPosition(par1World, par8, par9, par5, par6, par7, par2StructureBoundingBox); -+ } -+ } -+ -+ /** -+ * arguments: World worldObj, StructureBoundingBox structBB, int minX, int minY, int minZ, int maxX, int maxY, int -+ * maxZ, int placeBlockId, boolean alwaysreplace -+ */ -+ protected void randomlyRareFillWithBlocks(World par1World, StructureBoundingBox par2StructureBoundingBox, int par3, int par4, int par5, int par6, int par7, int par8, int par9, boolean par10) { -+ float var11 = (float)(par6 - par3 + 1); -+ float var12 = (float)(par7 - par4 + 1); -+ float var13 = (float)(par8 - par5 + 1); -+ float var14 = (float)par3 + var11 / 2.0F; -+ float var15 = (float)par5 + var13 / 2.0F; -+ -+ for (int var16 = par4; var16 <= par7; ++var16) { -+ float var17 = (float)(var16 - par4) / var12; -+ -+ for (int var18 = par3; var18 <= par6; ++var18) { - float var19 = ((float)var18 - var14) / (var11 * 0.5F); - -- for(int var20 = var5; var20 <= var8; ++var20) { -+ for (int var20 = par5; var20 <= par8; ++var20) { - float var21 = ((float)var20 - var15) / (var13 * 0.5F); -- if(!var10 || this.getBlockIdAtCurrentPosition(var1, var18, var16, var20, var2) != 0) { -+ -+ if (!par10 || this.getBlockIdAtCurrentPosition(par1World, var18, var16, var20, par2StructureBoundingBox) != 0) { - float var22 = var19 * var19 + var17 * var17 + var21 * var21; -- if(var22 <= 1.05F) { -- this.placeBlockAtCurrentPosition(var1, var9, 0, var18, var16, var20, var2); -+ -+ if (var22 <= 1.05F) { -+ this.placeBlockAtCurrentPosition(par1World, par9, 0, var18, var16, var20, par2StructureBoundingBox); - } - } - } - } - } -- - } - -- protected void clearCurrentPositionBlocksUpwards(World var1, int var2, int var3, int var4, StructureBoundingBox var5) { -- int var6 = this.getXWithOffset(var2, var4); -- int var7 = this.getYWithOffset(var3); -- int var8 = this.getZWithOffset(var2, var4); -- if(var5.isVecInside(var6, var7, var8)) { -- while(!var1.isAirBlock(var6, var7, var8) && var7 < 255) { -- var1.setBlock(var6, var7, var8, 0, 0, 2); -+ /** -+ * Deletes all continuous blocks from selected position upwards. Stops at hitting air. -+ */ -+ protected void clearCurrentPositionBlocksUpwards(World par1World, int par2, int par3, int par4, StructureBoundingBox par5StructureBoundingBox) { -+ int var6 = this.getXWithOffset(par2, par4); -+ int var7 = this.getYWithOffset(par3); -+ int var8 = this.getZWithOffset(par2, par4); -+ -+ if (par5StructureBoundingBox.isVecInside(var6, var7, var8)) { -+ while (!par1World.isAirBlock(var6, var7, var8) && var7 < 255) { -+ par1World.setBlock(var6, var7, var8, 0, 0, 2); - ++var7; - } -- - } - } - -- protected void fillCurrentPositionBlocksDownwards(World var1, int var2, int var3, int var4, int var5, int var6, StructureBoundingBox var7) { -- int var8 = this.getXWithOffset(var4, var6); -- int var9 = this.getYWithOffset(var5); -- int var10 = this.getZWithOffset(var4, var6); -- if(var7.isVecInside(var8, var9, var10)) { -- while((var1.isAirBlock(var8, var9, var10) || var1.getBlockMaterial(var8, var9, var10).isLiquid()) && var9 > 1) { -- var1.setBlock(var8, var9, var10, var2, var3, 2); -+ /** -+ * Overwrites air and liquids from selected position downwards, stops at hitting anything else. -+ */ -+ protected void fillCurrentPositionBlocksDownwards(World par1World, int par2, int par3, int par4, int par5, int par6, StructureBoundingBox par7StructureBoundingBox) { -+ int var8 = this.getXWithOffset(par4, par6); -+ int var9 = this.getYWithOffset(par5); -+ int var10 = this.getZWithOffset(par4, par6); -+ -+ if (par7StructureBoundingBox.isVecInside(var8, var9, var10)) { -+ while ((par1World.isAirBlock(var8, var9, var10) || par1World.getBlockMaterial(var8, var9, var10).isLiquid()) && var9 > 1) { -+ par1World.setBlock(var8, var9, var10, par2, par3, 2); - --var9; - } -- -- } -- } -- -- protected boolean generateStructureChestContents(World var1, StructureBoundingBox var2, Random var3, int var4, int var5, int var6, WeightedRandomChestContent[] var7, int var8) { -- int var9 = this.getXWithOffset(var4, var6); -- int var10 = this.getYWithOffset(var5); -- int var11 = this.getZWithOffset(var4, var6); -- if(var2.isVecInside(var9, var10, var11) && var1.getBlockId(var9, var10, var11) != Block.chest.blockID) { -- var1.setBlock(var9, var10, var11, Block.chest.blockID, 0, 2); -- TileEntityChest var12 = (TileEntityChest)var1.getBlockTileEntity(var9, var10, var11); -- if(var12 != null) { -- WeightedRandomChestContent.generateChestContents(var3, var7, var12, var8); -- } -- -- return true; -- } else { -- return false; -- } -- } -- -- protected boolean generateStructureDispenserContents(World var1, StructureBoundingBox var2, Random var3, int var4, int var5, int var6, int var7, WeightedRandomChestContent[] var8, int var9) { -- int var10 = this.getXWithOffset(var4, var6); -- int var11 = this.getYWithOffset(var5); -- int var12 = this.getZWithOffset(var4, var6); -- if(var2.isVecInside(var10, var11, var12) && var1.getBlockId(var10, var11, var12) != Block.dispenser.blockID) { -- var1.setBlock(var10, var11, var12, Block.dispenser.blockID, this.getMetadataWithOffset(Block.dispenser.blockID, var7), 2); -- TileEntityDispenser var13 = (TileEntityDispenser)var1.getBlockTileEntity(var10, var11, var12); -- if(var13 != null) { -- WeightedRandomChestContent.generateDispenserContents(var3, var8, var13, var9); -- } -- -- return true; -- } else { -- return false; -- } -- } -- -- protected void placeDoorAtCurrentPosition(World var1, StructureBoundingBox var2, Random var3, int var4, int var5, int var6, int var7) { -- int var8 = this.getXWithOffset(var4, var6); -- int var9 = this.getYWithOffset(var5); -- int var10 = this.getZWithOffset(var4, var6); -- if(var2.isVecInside(var8, var9, var10)) { -- ItemDoor.placeDoorBlock(var1, var8, var9, var10, var7, Block.doorWood); -- } -- -+ } -+ } -+ -+ /** -+ * Used to generate chests with items in it. ex: Temple Chests, Village Blacksmith Chests, Mineshaft Chests. -+ */ -+ protected boolean generateStructureChestContents(World par1World, StructureBoundingBox par2StructureBoundingBox, Random par3Random, int par4, int par5, int par6, WeightedRandomChestContent[] par7ArrayOfWeightedRandomChestContent, int par8) { -+ int var9 = this.getXWithOffset(par4, par6); -+ int var10 = this.getYWithOffset(par5); -+ int var11 = this.getZWithOffset(par4, par6); -+ -+ if (par2StructureBoundingBox.isVecInside(var9, var10, var11) && par1World.getBlockId(var9, var10, var11) != Block.chest.blockID) { -+ par1World.setBlock(var9, var10, var11, Block.chest.blockID, 0, 2); -+ TileEntityChest var12 = (TileEntityChest)par1World.getBlockTileEntity(var9, var10, var11); -+ -+ if (var12 != null) { -+ WeightedRandomChestContent.generateChestContents(par3Random, par7ArrayOfWeightedRandomChestContent, var12, par8); -+ } -+ -+ return true; -+ } else { -+ return false; -+ } -+ } -+ -+ /** -+ * Used to generate dispenser contents for structures. ex: Jungle Temples. -+ */ -+ protected boolean generateStructureDispenserContents(World par1World, StructureBoundingBox par2StructureBoundingBox, Random par3Random, int par4, int par5, int par6, int par7, WeightedRandomChestContent[] par8ArrayOfWeightedRandomChestContent, int par9) { -+ int var10 = this.getXWithOffset(par4, par6); -+ int var11 = this.getYWithOffset(par5); -+ int var12 = this.getZWithOffset(par4, par6); -+ -+ if (par2StructureBoundingBox.isVecInside(var10, var11, var12) && par1World.getBlockId(var10, var11, var12) != Block.dispenser.blockID) { -+ par1World.setBlock(var10, var11, var12, Block.dispenser.blockID, this.getMetadataWithOffset(Block.dispenser.blockID, par7), 2); -+ TileEntityDispenser var13 = (TileEntityDispenser)par1World.getBlockTileEntity(var10, var11, var12); -+ -+ if (var13 != null) { -+ WeightedRandomChestContent.generateDispenserContents(par3Random, par8ArrayOfWeightedRandomChestContent, var13, par9); -+ } -+ -+ return true; -+ } else { -+ return false; -+ } -+ } -+ -+ protected void placeDoorAtCurrentPosition(World par1World, StructureBoundingBox par2StructureBoundingBox, Random par3Random, int par4, int par5, int par6, int par7) { -+ int var8 = this.getXWithOffset(par4, par6); -+ int var9 = this.getYWithOffset(par5); -+ int var10 = this.getZWithOffset(par4, par6); -+ -+ if (par2StructureBoundingBox.isVecInside(var8, var9, var10)) { -+ ItemDoor.placeDoorBlock(par1World, var8, var9, var10, par7, Block.doorWood); -+ } - } - } ---- net/minecraft/src/EnumRarity.java -+++ net/minecraft/src/EnumRarity.java -@@ -6,11 +6,17 @@ - rare(11, "Rare"), - epic(13, "Epic"); - -+ /** -+ * A decimal representation of the hex color codes of a the color assigned to this rarity type. (13 becomes d as in -+ * \247d which is light purple) -+ */ - public final int rarityColor; -- public final String f; -- -- private EnumRarity(int var3, String var4) { -- this.rarityColor = var3; -- this.f = var4; -+ -+ /** Rarity name. */ -+ public final String rarityName; -+ -+ private EnumRarity(int par3, String par4Str) { -+ this.rarityColor = par3; -+ this.rarityName = par4Str; - } - } ---- /dev/null -+++ org/spoutcraft/api/gui/Polygon.java -@@ -1,0 +1,74 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.api.gui; -+ -+import java.util.LinkedList; -+ -+public interface Polygon extends Widget { -+ /** -+ * Adds a point to the Polygon using the last set color. -+ * @param p the point to add -+ * @return the instance -+ * @throws IllegalStateException when no color has been set before. -+ */ -+ public Polygon addPoint(Point p) throws IllegalStateException; -+ -+ /** -+ * Convenience method for addPolygon(new Point(x,y)) -+ * @param x x-coord of the point -+ * @param y y-coord of the point -+ * @return the instance -+ * @throws IllegalStateException when no color has been set before. -+ */ -+ public Polygon addPoint(int x, int y) throws IllegalStateException; -+ -+ /** -+ * Adds a point to the polygon with a color -+ * @param p the point to add -+ * @param c the color of that point -+ * @return the instance -+ */ -+ public Polygon addPoint(Point p, Color c); -+ -+ /** -+ * Convenience method for addPoint(new Point(x, y), c) -+ * @param x the x-coord of the point -+ * @param y the y-coord of the point -+ * @param c the color of that point -+ * @return the instance -+ */ -+ public Polygon addPoint(int x, int y, Color c); -+ -+ /** -+ * Gets a list of all the points. -+ * This list corresponds to the color list that you get with getColors() -+ * @see getColors() -+ * @return a list of all points attached. -+ */ -+ public LinkedList getPoints(); -+ -+ /** -+ * Gets a list of all the colors. -+ * This list corresponds to the point list that you get with getPoints() -+ * @see getPoints() -+ * @return a list of all colors attached. -+ */ -+ public LinkedList getColors(); -+} ---- net/minecraft/src/EntityAINearestAttackableTargetSelector.java -+++ net/minecraft/src/EntityAINearestAttackableTargetSelector.java -@@ -2,14 +2,18 @@ - - class EntityAINearestAttackableTargetSelector implements IEntitySelector { - final IEntitySelector field_111103_c; -+ - final EntityAINearestAttackableTarget field_111102_d; - -- EntityAINearestAttackableTargetSelector(EntityAINearestAttackableTarget var1, IEntitySelector var2) { -- this.field_111102_d = var1; -- this.field_111103_c = var2; -+ EntityAINearestAttackableTargetSelector(EntityAINearestAttackableTarget par1EntityAINearestAttackableTarget, IEntitySelector par2IEntitySelector) { -+ this.field_111102_d = par1EntityAINearestAttackableTarget; -+ this.field_111103_c = par2IEntitySelector; - } - -- public boolean isEntityApplicable(Entity var1) { -- return !(var1 instanceof EntityLivingBase) ? false : (this.field_111103_c != null && !this.field_111103_c.isEntityApplicable(var1) ? false : this.field_111102_d.isSuitableTarget((EntityLivingBase)var1, false)); -+ /** -+ * Return whether the specified entity is applicable to this filter. -+ */ -+ public boolean isEntityApplicable(Entity par1Entity) { -+ return !(par1Entity instanceof EntityLivingBase) ? false : (this.field_111103_c != null && !this.field_111103_c.isEntityApplicable(par1Entity) ? false : this.field_111102_d.isSuitableTarget((EntityLivingBase)par1Entity, false)); - } - } ---- /dev/null -+++ org/spoutcraft/api/gui/GenericRadioButton.java -@@ -1,0 +1,102 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.api.gui; -+ -+import java.io.IOException; -+import java.util.ArrayList; -+import java.util.List; -+ -+import org.spoutcraft.api.Spoutcraft; -+import org.spoutcraft.api.UnsafeClass; -+import org.spoutcraft.api.io.SpoutInputStream; -+import org.spoutcraft.api.io.SpoutOutputStream; -+ -+@UnsafeClass -+public class GenericRadioButton extends GenericButton implements RadioButton { -+ boolean selected = false; -+ int group = 0; -+ -+ public GenericRadioButton() { -+ super(); -+ } -+ -+ public GenericRadioButton(String text) { -+ super(text); -+ } -+ -+ @Override -+ public void readData(SpoutInputStream input) throws IOException { -+ super.readData(input); -+ selected = input.readBoolean(); -+ group = input.readInt(); -+ } -+ -+ @Override -+ public void writeData(SpoutOutputStream output) throws IOException { -+ super.writeData(output); -+ output.writeBoolean(selected); -+ output.writeInt(group); -+ } -+ -+ @Override -+ public WidgetType getType() { -+ return WidgetType.RadioButton; -+ } -+ -+ @Override -+ public void render() { -+ Spoutcraft.getClient().getRenderDelegate().render(this); -+ } -+ -+ public boolean isSelected() { -+ return selected; -+ } -+ -+ public RadioButton setSelected(boolean selected) { -+ if (selected) { -+ for (RadioButton b:getRadiosInGroup()) { -+ b.setSelected(false); -+ } -+ } -+ this.selected = selected; -+ return this; -+ } -+ -+ public int getGroup() { -+ return group; -+ } -+ -+ public RadioButton setGroup(int group) { -+ this.group = group; -+ return this; -+ } -+ -+ public List getRadiosInGroup() { -+ List ret = new ArrayList(); -+ for (Widget w:getScreen().getAttachedWidgets()) { -+ if (w instanceof RadioButton) { -+ if (((RadioButton)w).getGroup() == group) { -+ ret.add((RadioButton)w); -+ } -+ } -+ } -+ return ret; -+ } -+} ---- net/minecraft/src/RecipesMapCloning.java -+++ net/minecraft/src/RecipesMapCloning.java -@@ -1,21 +1,26 @@ - package net.minecraft.src; - - public class RecipesMapCloning implements IRecipe { -- public boolean matches(InventoryCrafting var1, World var2) { -+ -+ /** -+ * Used to check if a recipe matches current crafting inventory -+ */ -+ public boolean matches(InventoryCrafting par1InventoryCrafting, World par2World) { - int var3 = 0; - ItemStack var4 = null; - -- for(int var5 = 0; var5 < var1.getSizeInventory(); ++var5) { -- ItemStack var6 = var1.getStackInSlot(var5); -- if(var6 != null) { -- if(var6.itemID == Item.map.itemID) { -- if(var4 != null) { -+ for (int var5 = 0; var5 < par1InventoryCrafting.getSizeInventory(); ++var5) { -+ ItemStack var6 = par1InventoryCrafting.getStackInSlot(var5); -+ -+ if (var6 != null) { -+ if (var6.itemID == Item.map.itemID) { -+ if (var4 != null) { - return false; - } - - var4 = var6; - } else { -- if(var6.itemID != Item.emptyMap.itemID) { -+ if (var6.itemID != Item.emptyMap.itemID) { - return false; - } - -@@ -27,21 +32,25 @@ - return var4 != null && var3 > 0; - } - -- public ItemStack getCraftingResult(InventoryCrafting var1) { -+ /** -+ * Returns an Item that is the result of this recipe -+ */ -+ public ItemStack getCraftingResult(InventoryCrafting par1InventoryCrafting) { - int var2 = 0; - ItemStack var3 = null; - -- for(int var4 = 0; var4 < var1.getSizeInventory(); ++var4) { -- ItemStack var5 = var1.getStackInSlot(var4); -- if(var5 != null) { -- if(var5.itemID == Item.map.itemID) { -- if(var3 != null) { -+ for (int var4 = 0; var4 < par1InventoryCrafting.getSizeInventory(); ++var4) { -+ ItemStack var5 = par1InventoryCrafting.getStackInSlot(var4); -+ -+ if (var5 != null) { -+ if (var5.itemID == Item.map.itemID) { -+ if (var3 != null) { - return null; - } - - var3 = var5; - } else { -- if(var5.itemID != Item.emptyMap.itemID) { -+ if (var5.itemID != Item.emptyMap.itemID) { - return null; - } - -@@ -50,9 +59,10 @@ - } - } - -- if(var3 != null && var2 >= 1) { -+ if (var3 != null && var2 >= 1) { - ItemStack var6 = new ItemStack(Item.map, var2 + 1, var3.getItemDamage()); -- if(var3.hasDisplayName()) { -+ -+ if (var3.hasDisplayName()) { - var6.setItemName(var3.getDisplayName()); - } - -@@ -62,6 +72,9 @@ - } - } - -+ /** -+ * Returns the size of the recipe area -+ */ - public int getRecipeSize() { - return 9; - } ---- net/minecraft/src/BlockDetectorRail.java -+++ net/minecraft/src/BlockDetectorRail.java -@@ -6,89 +6,128 @@ - public class BlockDetectorRail extends BlockRailBase { - private Icon[] iconArray; - -- public BlockDetectorRail(int var1) { -- super(var1, true); -+ public BlockDetectorRail(int par1) { -+ super(par1, true); - this.setTickRandomly(true); - } - -- public int tickRate(World var1) { -+ /** -+ * How many world ticks before ticking -+ */ -+ public int tickRate(World par1World) { - return 20; - } - -+ /** -+ * Can this block provide power. Only wire currently seems to have this change based on its state. -+ */ - public boolean canProvidePower() { - return true; - } - -- public void onEntityCollidedWithBlock(World var1, int var2, int var3, int var4, Entity var5) { -- if(!var1.isRemote) { -- int var6 = var1.getBlockMetadata(var2, var3, var4); -- if((var6 & 8) == 0) { -- this.setStateIfMinecartInteractsWithRail(var1, var2, var3, var4, var6); -- } -- } -- } -- -- public void updateTick(World var1, int var2, int var3, int var4, Random var5) { -- if(!var1.isRemote) { -- int var6 = var1.getBlockMetadata(var2, var3, var4); -- if((var6 & 8) != 0) { -- this.setStateIfMinecartInteractsWithRail(var1, var2, var3, var4, var6); -- } -- } -- } -- -- public int isProvidingWeakPower(IBlockAccess var1, int var2, int var3, int var4, int var5) { -- return (var1.getBlockMetadata(var2, var3, var4) & 8) != 0 ? 15 : 0; -- } -- -- public int isProvidingStrongPower(IBlockAccess var1, int var2, int var3, int var4, int var5) { -- return (var1.getBlockMetadata(var2, var3, var4) & 8) == 0 ? 0 : (var5 == 1 ? 15 : 0); -- } -- -- private void setStateIfMinecartInteractsWithRail(World var1, int var2, int var3, int var4, int var5) { -- boolean var6 = (var5 & 8) != 0; -+ /** -+ * Triggered whenever an entity collides with this block (enters into the block). Args: world, x, y, z, entity -+ */ -+ public void onEntityCollidedWithBlock(World par1World, int par2, int par3, int par4, Entity par5Entity) { -+ if (!par1World.isRemote) { -+ int var6 = par1World.getBlockMetadata(par2, par3, par4); -+ -+ if ((var6 & 8) == 0) { -+ this.setStateIfMinecartInteractsWithRail(par1World, par2, par3, par4, var6); -+ } -+ } -+ } -+ -+ /** -+ * Ticks the block if it's been scheduled -+ */ -+ public void updateTick(World par1World, int par2, int par3, int par4, Random par5Random) { -+ if (!par1World.isRemote) { -+ int var6 = par1World.getBlockMetadata(par2, par3, par4); -+ -+ if ((var6 & 8) != 0) { -+ this.setStateIfMinecartInteractsWithRail(par1World, par2, par3, par4, var6); -+ } -+ } -+ } -+ -+ /** -+ * Returns true if the block is emitting indirect/weak redstone power on the specified side. If isBlockNormalCube -+ * returns true, standard redstone propagation rules will apply instead and this will not be called. Args: World, X, Y, -+ * Z, side. Note that the side is reversed - eg it is 1 (up) when checking the bottom of the block. -+ */ -+ public int isProvidingWeakPower(IBlockAccess par1IBlockAccess, int par2, int par3, int par4, int par5) { -+ return (par1IBlockAccess.getBlockMetadata(par2, par3, par4) & 8) != 0 ? 15 : 0; -+ } -+ -+ /** -+ * Returns true if the block is emitting direct/strong redstone power on the specified side. Args: World, X, Y, Z, -+ * side. Note that the side is reversed - eg it is 1 (up) when checking the bottom of the block. -+ */ -+ public int isProvidingStrongPower(IBlockAccess par1IBlockAccess, int par2, int par3, int par4, int par5) { -+ return (par1IBlockAccess.getBlockMetadata(par2, par3, par4) & 8) == 0 ? 0 : (par5 == 1 ? 15 : 0); -+ } -+ -+ /** -+ * Update the detector rail power state if a minecart enter, stays or leave the block. -+ */ -+ private void setStateIfMinecartInteractsWithRail(World par1World, int par2, int par3, int par4, int par5) { -+ boolean var6 = (par5 & 8) != 0; - boolean var7 = false; -- float var8 = 2.0F / 16.0F; -- List var9 = var1.getEntitiesWithinAABB(EntityMinecart.class, AxisAlignedBB.getAABBPool().getAABB((double)((float)var2 + var8), (double)var3, (double)((float)var4 + var8), (double)((float)(var2 + 1) - var8), (double)((float)(var3 + 1) - var8), (double)((float)(var4 + 1) - var8))); -- if(!var9.isEmpty()) { -+ float var8 = 0.125F; -+ List var9 = par1World.getEntitiesWithinAABB(EntityMinecart.class, AxisAlignedBB.getAABBPool().getAABB((double)((float)par2 + var8), (double)par3, (double)((float)par4 + var8), (double)((float)(par2 + 1) - var8), (double)((float)(par3 + 1) - var8), (double)((float)(par4 + 1) - var8))); -+ -+ if (!var9.isEmpty()) { - var7 = true; - } - -- if(var7 && !var6) { -- var1.setBlockMetadata(var2, var3, var4, var5 | 8, 3); -- var1.notifyBlocksOfNeighborChange(var2, var3, var4, this.blockID); -- var1.notifyBlocksOfNeighborChange(var2, var3 - 1, var4, this.blockID); -- var1.markBlockRangeForRenderUpdate(var2, var3, var4, var2, var3, var4); -- } -- -- if(!var7 && var6) { -- var1.setBlockMetadata(var2, var3, var4, var5 & 7, 3); -- var1.notifyBlocksOfNeighborChange(var2, var3, var4, this.blockID); -- var1.notifyBlocksOfNeighborChange(var2, var3 - 1, var4, this.blockID); -- var1.markBlockRangeForRenderUpdate(var2, var3, var4, var2, var3, var4); -- } -- -- if(var7) { -- var1.scheduleBlockUpdate(var2, var3, var4, this.blockID, this.tickRate(var1)); -- } -- -- var1.func_96440_m(var2, var3, var4, this.blockID); -- } -- -- public void onBlockAdded(World var1, int var2, int var3, int var4) { -- super.onBlockAdded(var1, var2, var3, var4); -- this.setStateIfMinecartInteractsWithRail(var1, var2, var3, var4, var1.getBlockMetadata(var2, var3, var4)); -- } -- -+ if (var7 && !var6) { -+ par1World.setBlockMetadataWithNotify(par2, par3, par4, par5 | 8, 3); -+ par1World.notifyBlocksOfNeighborChange(par2, par3, par4, this.blockID); -+ par1World.notifyBlocksOfNeighborChange(par2, par3 - 1, par4, this.blockID); -+ par1World.markBlockRangeForRenderUpdate(par2, par3, par4, par2, par3, par4); -+ } -+ -+ if (!var7 && var6) { -+ par1World.setBlockMetadataWithNotify(par2, par3, par4, par5 & 7, 3); -+ par1World.notifyBlocksOfNeighborChange(par2, par3, par4, this.blockID); -+ par1World.notifyBlocksOfNeighborChange(par2, par3 - 1, par4, this.blockID); -+ par1World.markBlockRangeForRenderUpdate(par2, par3, par4, par2, par3, par4); -+ } -+ -+ if (var7) { -+ par1World.scheduleBlockUpdate(par2, par3, par4, this.blockID, this.tickRate(par1World)); -+ } -+ -+ par1World.func_96440_m(par2, par3, par4, this.blockID); -+ } -+ -+ /** -+ * Called whenever the block is added into the world. Args: world, x, y, z -+ */ -+ public void onBlockAdded(World par1World, int par2, int par3, int par4) { -+ super.onBlockAdded(par1World, par2, par3, par4); -+ this.setStateIfMinecartInteractsWithRail(par1World, par2, par3, par4, par1World.getBlockMetadata(par2, par3, par4)); -+ } -+ -+ /** -+ * If this returns true, then comparators facing away from this block will use the value from -+ * getComparatorInputOverride instead of the actual redstone signal strength. -+ */ - public boolean hasComparatorInputOverride() { - return true; - } - -- public int getComparatorInputOverride(World var1, int var2, int var3, int var4, int var5) { -- if((var1.getBlockMetadata(var2, var3, var4) & 8) > 0) { -- float var6 = 2.0F / 16.0F; -- List var7 = var1.selectEntitiesWithinAABB(EntityMinecart.class, AxisAlignedBB.getAABBPool().getAABB((double)((float)var2 + var6), (double)var3, (double)((float)var4 + var6), (double)((float)(var2 + 1) - var6), (double)((float)(var3 + 1) - var6), (double)((float)(var4 + 1) - var6)), IEntitySelector.selectInventories); -- if(var7.size() > 0) { -+ /** -+ * If hasComparatorInputOverride returns true, the return value from this is used instead of the redstone signal -+ * strength when this block inputs to a comparator. -+ */ -+ public int getComparatorInputOverride(World par1World, int par2, int par3, int par4, int par5) { -+ if ((par1World.getBlockMetadata(par2, par3, par4) & 8) > 0) { -+ float var6 = 0.125F; -+ List var7 = par1World.selectEntitiesWithinAABB(EntityMinecart.class, AxisAlignedBB.getAABBPool().getAABB((double)((float)par2 + var6), (double)par3, (double)((float)par4 + var6), (double)((float)(par2 + 1) - var6), (double)((float)(par3 + 1) - var6), (double)((float)(par4 + 1) - var6)), IEntitySelector.selectInventories); -+ -+ if (var7.size() > 0) { - return Container.calcRedstoneFromInventory((IInventory)var7.get(0)); - } - } -@@ -96,13 +135,20 @@ - return 0; - } - -- public void registerIcons(IconRegister var1) { -+ /** -+ * When this method is called, your block should register all the icons it needs with the given IconRegister. This is -+ * the only chance you get to register icons. -+ */ -+ public void registerIcons(IconRegister par1IconRegister) { - this.iconArray = new Icon[2]; -- this.iconArray[0] = var1.registerIcon(this.getTextureName()); -- this.iconArray[1] = var1.registerIcon(this.getTextureName() + "_powered"); -+ this.iconArray[0] = par1IconRegister.registerIcon(this.getTextureName()); -+ this.iconArray[1] = par1IconRegister.registerIcon(this.getTextureName() + "_powered"); - } - -- public Icon getIcon(int var1, int var2) { -- return (var2 & 8) != 0 ? this.iconArray[1] : this.iconArray[0]; -+ /** -+ * From the specified side and block metadata retrieves the blocks texture. Args: side, metadata -+ */ -+ public Icon getIcon(int par1, int par2) { -+ return (par2 & 8) != 0 ? this.iconArray[1] : this.iconArray[0]; - } - } ---- /dev/null -+++ org/spoutcraft/client/gui/database/SearchField.java -@@ -1,0 +1,51 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.client.gui.database; -+ -+import org.bukkit.ChatColor; -+ -+import org.spoutcraft.api.gui.GenericTextField; -+ -+public class SearchField extends GenericTextField implements UrlElement { -+ private AbstractAPIModel model; -+ -+ public SearchField(AbstractAPIModel model) { -+ setMaximumCharacters(0); -+ this.model = model; -+ setPlaceholder(ChatColor.GRAY + "Search..."); -+ } -+ -+ @Override -+ public void onTypingFinished() { -+ model.updateUrl(); -+ } -+ -+ public boolean isActive() { -+ return !getText().isEmpty(); -+ } -+ -+ public String getUrlPart() { -+ return "terms=" + getText().replaceAll(" ", ","); -+ } -+ -+ public void clear() { -+ setText(""); -+ } -+} ---- net/minecraft/src/EnumGameType.java -+++ net/minecraft/src/EnumGameType.java -@@ -5,57 +5,78 @@ - SURVIVAL(0, "survival"), - CREATIVE(1, "creative"), - ADVENTURE(2, "adventure"); -- - int id; -- String f; -+ String name; - -- private EnumGameType(int var3, String var4) { -- this.id = var3; -- this.f = var4; -+ private EnumGameType(int par3, String par4Str) { -+ this.id = par3; -+ this.name = par4Str; - } - -+ /** -+ * Returns the ID of this game type -+ */ - public int getID() { - return this.id; - } - -+ /** -+ * Returns the name of this game type -+ */ - public String getName() { -- return this.f; -+ return this.name; - } - -- public void configurePlayerCapabilities(PlayerCapabilities var1) { -- if(this == CREATIVE) { -- var1.allowFlying = true; -- var1.isCreativeMode = true; -- var1.disableDamage = true; -+ /** -+ * Configures the player capabilities based on the game type -+ */ -+ public void configurePlayerCapabilities(PlayerCapabilities par1PlayerCapabilities) { -+ if (this == CREATIVE) { -+ par1PlayerCapabilities.allowFlying = true; -+ par1PlayerCapabilities.isCreativeMode = true; -+ par1PlayerCapabilities.disableDamage = true; - } else { -- var1.allowFlying = false; -- var1.isCreativeMode = false; -- var1.disableDamage = false; -- var1.isFlying = false; -+ par1PlayerCapabilities.allowFlying = false; -+ par1PlayerCapabilities.isCreativeMode = false; -+ par1PlayerCapabilities.disableDamage = false; -+ par1PlayerCapabilities.isFlying = false; - } - -- var1.allowEdit = !this.isAdventure(); -+ par1PlayerCapabilities.allowEdit = !this.isAdventure(); - } - -+ /** -+ * Returns true if this is the ADVENTURE game type -+ */ - public boolean isAdventure() { - return this == ADVENTURE; - } - -+ /** -+ * Returns true if this is the CREATIVE game type -+ */ - public boolean isCreative() { - return this == CREATIVE; - } - -+ /** -+ * Returns true if this is the SURVIVAL or ADVENTURE game type -+ */ - public boolean isSurvivalOrAdventure() { - return this == SURVIVAL || this == ADVENTURE; - } - -- public static EnumGameType getByID(int var0) { -+ /** -+ * Returns the game type with the specified ID, or SURVIVAL if none found. Args: id -+ */ -+ public static EnumGameType getByID(int par0) { - EnumGameType[] var1 = values(); - int var2 = var1.length; - -- for(int var3 = 0; var3 < var2; ++var3) { -+ for (int var3 = 0; var3 < var2; ++var3) { - EnumGameType var4 = var1[var3]; -- if(var4.id == var0) { -+ -+ if (var4.id == par0) { - return var4; - } - } -@@ -63,13 +84,17 @@ - return SURVIVAL; - } - -- public static EnumGameType getByName(String var0) { -+ /** -+ * Returns the game type with the specified name, or SURVIVAL if none found. This is case sensitive. Args: name -+ */ -+ public static EnumGameType getByName(String par0Str) { - EnumGameType[] var1 = values(); - int var2 = var1.length; - -- for(int var3 = 0; var3 < var2; ++var3) { -+ for (int var3 = 0; var3 < var2; ++var3) { - EnumGameType var4 = var1[var3]; -- if(var4.f.equals(var0)) { -+ -+ if (var4.name.equals(par0Str)) { - return var4; - } - } ---- net/minecraft/src/DefaultResourcePack.java -+++ net/minecraft/src/DefaultResourcePack.java -@@ -13,62 +13,63 @@ - import javax.imageio.ImageIO; - - public class DefaultResourcePack implements ResourcePack { -- public static final Set a = ImmutableSet.of("minecraft"); -- private final Map b = Maps.newHashMap(); -- private final File c; -+ public static final Set defaultResourceDomains = ImmutableSet.of("minecraft"); -+ private final Map mapResourceFiles = Maps.newHashMap(); -+ public final File fileAssets; - -- public DefaultResourcePack(File var1) { -- this.c = var1; -- this.readAssetsDir(this.c); -+ public DefaultResourcePack(File par1File) { -+ this.fileAssets = par1File; -+ this.readAssetsDir(this.fileAssets); - } - -- public InputStream getInputStream(ResourceLocation var1) throws IOException { -- InputStream var2 = this.getResourceStream(var1); -- if(var2 != null) { -+ public InputStream getInputStream(ResourceLocation par1ResourceLocation) throws IOException { -+ InputStream var2 = this.getResourceStream(par1ResourceLocation); -+ -+ if (var2 != null) { - return var2; - } else { -- File var3 = (File)this.b.get(var1.toString()); -- if(var3 != null) { -+ File var3 = (File)this.mapResourceFiles.get(par1ResourceLocation.toString()); -+ -+ if (var3 != null) { - return new FileInputStream(var3); - } else { -- throw new FileNotFoundException(var1.getResourcePath()); -+ throw new FileNotFoundException(par1ResourceLocation.getResourcePath()); - } - } - } - -- private InputStream getResourceStream(ResourceLocation var1) { -- return DefaultResourcePack.class.getResourceAsStream("/assets/minecraft/" + var1.getResourcePath()); -- } -- -- public void addResourceFile(String var1, File var2) { -- this.b.put((new ResourceLocation(var1)).toString(), var2); -- } -- -- public boolean resourceExists(ResourceLocation var1) { -- return this.getResourceStream(var1) != null || this.b.containsKey(var1.toString()); -+ private InputStream getResourceStream(ResourceLocation par1ResourceLocation) { -+ return DefaultResourcePack.class.getResourceAsStream("/assets/minecraft/" + par1ResourceLocation.getResourcePath()); -+ } -+ -+ public void addResourceFile(String par1Str, File par2File) { -+ this.mapResourceFiles.put((new ResourceLocation(par1Str)).toString(), par2File); -+ } -+ -+ public boolean resourceExists(ResourceLocation par1ResourceLocation) { -+ return this.getResourceStream(par1ResourceLocation) != null || this.mapResourceFiles.containsKey(par1ResourceLocation.toString()); - } - - public Set getResourceDomains() { -- return a; -+ return defaultResourceDomains; - } - -- public void readAssetsDir(File var1) { -- if(var1.isDirectory()) { -- File[] var2 = var1.listFiles(); -+ public void readAssetsDir(File par1File) { -+ if (par1File.isDirectory()) { -+ File[] var2 = par1File.listFiles(); - int var3 = var2.length; - -- for(int var4 = 0; var4 < var3; ++var4) { -+ for (int var4 = 0; var4 < var3; ++var4) { - File var5 = var2[var4]; - this.readAssetsDir(var5); - } - } else { -- this.addResourceFile(AbstractResourcePack.getRelativeName(this.c, var1), var1); -+ this.addResourceFile(AbstractResourcePack.getRelativeName(this.fileAssets, par1File), par1File); - } -- - } - -- public MetadataSection getPackMetadata(MetadataSerializer var1, String var2) throws IOException { -- return AbstractResourcePack.readMetadata(var1, DefaultResourcePack.class.getResourceAsStream("/" + (new ResourceLocation("pack.mcmeta")).getResourcePath()), var2); -+ public MetadataSection getPackMetadata(MetadataSerializer par1MetadataSerializer, String par2Str) throws IOException { -+ return AbstractResourcePack.readMetadata(par1MetadataSerializer, DefaultResourcePack.class.getResourceAsStream("/" + (new ResourceLocation("pack.mcmeta")).getResourcePath()), par2Str); - } - - public BufferedImage getPackImage() throws IOException { ---- net/minecraft/src/Stitcher.java -+++ net/minecraft/src/Stitcher.java -@@ -9,26 +9,28 @@ - import java.util.Set; - - public class Stitcher { -- private final Set a; -- private final List b; -+ private final Set setStitchHolders; -+ private final List stitchSlots; - private int currentWidth; - private int currentHeight; - private final int maxWidth; - private final int maxHeight; - private final boolean forcePowerOf2; -+ -+ /** Max size (width or height) of a single tile */ - private final int maxTileDimension; - -- public Stitcher(int var1, int var2, boolean var3) { -- this(var1, var2, var3, 0); -+ public Stitcher(int par1, int par2, boolean par3) { -+ this(par1, par2, par3, 0); - } - -- public Stitcher(int var1, int var2, boolean var3, int var4) { -- this.a = new HashSet(256); -- this.b = new ArrayList(256); -- this.maxWidth = var1; -- this.maxHeight = var2; -- this.forcePowerOf2 = var3; -- this.maxTileDimension = var4; -+ public Stitcher(int par1, int par2, boolean par3, int par4) { -+ this.setStitchHolders = new HashSet(256); -+ this.stitchSlots = new ArrayList(256); -+ this.maxWidth = par1; -+ this.maxHeight = par2; -+ this.forcePowerOf2 = par3; -+ this.maxTileDimension = par4; - } - - public int getCurrentWidth() { -@@ -39,41 +41,42 @@ - return this.currentHeight; - } - -- public void addSprite(TextureAtlasSprite var1) { -- StitchHolder var2 = new StitchHolder(var1); -- if(this.maxTileDimension > 0) { -+ public void addSprite(TextureAtlasSprite par1TextureAtlasSprite) { -+ StitchHolder var2 = new StitchHolder(par1TextureAtlasSprite); -+ -+ if (this.maxTileDimension > 0) { - var2.setNewDimension(this.maxTileDimension); - } - -- this.a.add(var2); -+ this.setStitchHolders.add(var2); - } - - public void doStitch() { -- StitchHolder[] var1 = (StitchHolder[])this.a.toArray(new StitchHolder[this.a.size()]); -+ StitchHolder[] var1 = (StitchHolder[])this.setStitchHolders.toArray(new StitchHolder[this.setStitchHolders.size()]); - Arrays.sort(var1); - StitchHolder[] var2 = var1; - int var3 = var1.length; - -- for(int var4 = 0; var4 < var3; ++var4) { -+ for (int var4 = 0; var4 < var3; ++var4) { - StitchHolder var5 = var2[var4]; -- if(!this.allocateSlot(var5)) { -- String var6 = String.format("Unable to fit: %s - size: %dx%d - Maybe try a lowerresolution texturepack?", new Object[]{var5.getAtlasSprite().getIconName(), Integer.valueOf(var5.getAtlasSprite().getIconWidth()), Integer.valueOf(var5.getAtlasSprite().getIconHeight())}); -+ -+ if (!this.allocateSlot(var5)) { -+ String var6 = String.format("Unable to fit: %s - size: %dx%d - Maybe try a lowerresolution texturepack?", new Object[] {var5.getAtlasSprite().getIconName(), Integer.valueOf(var5.getAtlasSprite().getIconWidth()), Integer.valueOf(var5.getAtlasSprite().getIconHeight())}); - throw new StitcherException(var5, var6); - } - } - -- if(this.forcePowerOf2) { -+ if (this.forcePowerOf2) { - this.currentWidth = this.getCeilPowerOf2(this.currentWidth); - this.currentHeight = this.getCeilPowerOf2(this.currentHeight); - } -- - } - - public List getStichSlots() { - ArrayList var1 = Lists.newArrayList(); -- Iterator var2 = this.b.iterator(); -+ Iterator var2 = this.stitchSlots.iterator(); - -- while(var2.hasNext()) { -+ while (var2.hasNext()) { - StitchSlot var3 = (StitchSlot)var2.next(); - var3.getAllStitchSlots(var1); - } -@@ -81,7 +84,7 @@ - ArrayList var7 = Lists.newArrayList(); - Iterator var8 = var1.iterator(); - -- while(var8.hasNext()) { -+ while (var8.hasNext()) { - StitchSlot var4 = (StitchSlot)var8.next(); - StitchHolder var5 = var4.getStitchHolder(); - TextureAtlasSprite var6 = var5.getAtlasSprite(); -@@ -92,8 +95,11 @@ - return var7; - } - -- private int getCeilPowerOf2(int var1) { -- int var2 = var1 - 1; -+ /** -+ * Returns power of 2 >= the specified value -+ */ -+ private int getCeilPowerOf2(int par1) { -+ int var2 = par1 - 1; - var2 |= var2 >> 1; - var2 |= var2 >> 2; - var2 |= var2 >> 4; -@@ -102,46 +108,57 @@ - return var2 + 1; - } - -- private boolean allocateSlot(StitchHolder var1) { -- for(int var2 = 0; var2 < this.b.size(); ++var2) { -- if(((StitchSlot)this.b.get(var2)).addSlot(var1)) { -- return true; -- } -- -- var1.rotate(); -- if(((StitchSlot)this.b.get(var2)).addSlot(var1)) { -- return true; -- } -- -- var1.rotate(); -+ /** -+ * Attempts to find space for specified tile -+ */ -+ private boolean allocateSlot(StitchHolder par1StitchHolder) { -+ for (int var2 = 0; var2 < this.stitchSlots.size(); ++var2) { -+ if (((StitchSlot)this.stitchSlots.get(var2)).addSlot(par1StitchHolder)) { -+ return true; -+ } -+ -+ par1StitchHolder.rotate(); -+ -+ if (((StitchSlot)this.stitchSlots.get(var2)).addSlot(par1StitchHolder)) { -+ return true; -+ } -+ -+ par1StitchHolder.rotate(); - } - -- return this.expandAndAllocateSlot(var1); -+ return this.expandAndAllocateSlot(par1StitchHolder); - } - -- private boolean expandAndAllocateSlot(StitchHolder var1) { -- int var2 = Math.min(var1.getHeight(), var1.getWidth()); -+ /** -+ * Expand stitched texture in order to make space for specified tile -+ */ -+ private boolean expandAndAllocateSlot(StitchHolder par1StitchHolder) { -+ int var2 = Math.min(par1StitchHolder.getHeight(), par1StitchHolder.getWidth()); - boolean var3 = this.currentWidth == 0 && this.currentHeight == 0; - boolean var4; -- if(this.forcePowerOf2) { -+ -+ if (this.forcePowerOf2) { - int var5 = this.getCeilPowerOf2(this.currentWidth); - int var6 = this.getCeilPowerOf2(this.currentHeight); - int var7 = this.getCeilPowerOf2(this.currentWidth + var2); - int var8 = this.getCeilPowerOf2(this.currentHeight + var2); - boolean var9 = var7 <= this.maxWidth; - boolean var10 = var8 <= this.maxHeight; -- if(!var9 && !var10) { -+ -+ if (!var9 && !var10) { - return false; - } - -- int var11 = Math.max(var1.getHeight(), var1.getWidth()); -- if(var3 && !var9 && this.getCeilPowerOf2(this.currentHeight + var11) > this.maxHeight) { -+ int var11 = Math.max(par1StitchHolder.getHeight(), par1StitchHolder.getWidth()); -+ -+ if (var3 && !var9 && this.getCeilPowerOf2(this.currentHeight + var11) > this.maxHeight) { - return false; - } - - boolean var12 = var5 != var7; - boolean var13 = var6 != var8; -- if(var12 ^ var13) { -+ -+ if (var12 ^ var13) { - var4 = var12 && var9; - } else { - var4 = var9 && var5 <= var6; -@@ -149,7 +166,8 @@ - } else { - boolean var14 = this.currentWidth + var2 <= this.maxWidth; - boolean var16 = this.currentHeight + var2 <= this.maxHeight; -- if(!var14 && !var16) { -+ -+ if (!var14 && !var16) { - return false; - } - -@@ -157,24 +175,25 @@ - } - - StitchSlot var15; -- if(var4) { -- if(var1.getWidth() > var1.getHeight()) { -- var1.rotate(); -- } -- -- if(this.currentHeight == 0) { -- this.currentHeight = var1.getHeight(); -- } -- -- var15 = new StitchSlot(this.currentWidth, 0, var1.getWidth(), this.currentHeight); -- this.currentWidth += var1.getWidth(); -+ -+ if (var4) { -+ if (par1StitchHolder.getWidth() > par1StitchHolder.getHeight()) { -+ par1StitchHolder.rotate(); -+ } -+ -+ if (this.currentHeight == 0) { -+ this.currentHeight = par1StitchHolder.getHeight(); -+ } -+ -+ var15 = new StitchSlot(this.currentWidth, 0, par1StitchHolder.getWidth(), this.currentHeight); -+ this.currentWidth += par1StitchHolder.getWidth(); - } else { -- var15 = new StitchSlot(0, this.currentHeight, this.currentWidth, var1.getHeight()); -- this.currentHeight += var1.getHeight(); -+ var15 = new StitchSlot(0, this.currentHeight, this.currentWidth, par1StitchHolder.getHeight()); -+ this.currentHeight += par1StitchHolder.getHeight(); - } - -- var15.addSlot(var1); -- this.b.add(var15); -+ var15.addSlot(par1StitchHolder); -+ this.stitchSlots.add(var15); - return true; - } - } ---- net/minecraft/src/CallableScreenName.java -+++ net/minecraft/src/CallableScreenName.java -@@ -5,8 +5,8 @@ - class CallableScreenName implements Callable { - final EntityRenderer entityRender; - -- CallableScreenName(EntityRenderer var1) { -- this.entityRender = var1; -+ CallableScreenName(EntityRenderer par1EntityRenderer) { -+ this.entityRender = par1EntityRenderer; - } - - public String callScreenName() { ---- net/minecraft/src/Direction.java -+++ net/minecraft/src/Direction.java -@@ -1,17 +1,30 @@ - package net.minecraft.src; - - public class Direction { -- public static final int[] offsetX = new int[]{0, -1, 0, 1}; -- public static final int[] offsetZ = new int[]{1, 0, -1, 0}; -- public static final String[] c = new String[]{"SOUTH", "WEST", "NORTH", "EAST"}; -- public static final int[] directionToFacing = new int[]{3, 4, 2, 5}; -- public static final int[] facingToDirection = new int[]{-1, -1, 2, 0, 1, 3}; -- public static final int[] rotateOpposite = new int[]{2, 3, 0, 1}; -- public static final int[] enderEyeMetaToDirection = new int[]{1, 2, 3, 0}; -- public static final int[] rotateLeft = new int[]{3, 0, 1, 2}; -- public static final int[][] bedDirection = new int[][]{{1, 0, 3, 2, 5, 4}, {1, 0, 5, 4, 2, 3}, {1, 0, 2, 3, 4, 5}, {1, 0, 4, 5, 3, 2}}; -- -- public static int getMovementDirection(double var0, double var2) { -- return MathHelper.abs((float)var0) > MathHelper.abs((float)var2) ? (var0 > 0.0D ? 1 : 3) : (var2 > 0.0D ? 2 : 0); -+ public static final int[] offsetX = new int[] {0, -1, 0, 1}; -+ public static final int[] offsetZ = new int[] {1, 0, -1, 0}; -+ public static final String[] directions = new String[] {"SOUTH", "WEST", "NORTH", "EAST"}; -+ -+ /** Maps a Direction value (2D) to a Facing value (3D). */ -+ public static final int[] directionToFacing = new int[] {3, 4, 2, 5}; -+ -+ /** Maps a Facing value (3D) to a Direction value (2D). */ -+ public static final int[] facingToDirection = new int[] { -1, -1, 2, 0, 1, 3}; -+ -+ /** Maps a direction to that opposite of it. */ -+ public static final int[] rotateOpposite = new int[] {2, 3, 0, 1}; -+ -+ /** Maps a direction to that to the right of it. */ -+ public static final int[] rotateRight = new int[] {1, 2, 3, 0}; -+ -+ /** Maps a direction to that to the left of it. */ -+ public static final int[] rotateLeft = new int[] {3, 0, 1, 2}; -+ public static final int[][] bedDirection = new int[][] {{1, 0, 3, 2, 5, 4}, {1, 0, 5, 4, 2, 3}, {1, 0, 2, 3, 4, 5}, {1, 0, 4, 5, 3, 2}}; -+ -+ /** -+ * Returns the movement direction from a velocity vector. -+ */ -+ public static int getMovementDirection(double par0, double par2) { -+ return MathHelper.abs((float)par0) > MathHelper.abs((float)par2) ? (par0 > 0.0D ? 1 : 3) : (par2 > 0.0D ? 2 : 0); - } - } ---- net/minecraft/src/RequestPut.java -+++ net/minecraft/src/RequestPut.java -@@ -5,22 +5,22 @@ - public class RequestPut extends Request { - private byte[] field_96369_c; - -- public RequestPut(String var1, byte[] var2, int var3, int var4) { -- super(var1, var3, var4); -- this.field_96369_c = var2; -+ public RequestPut(String par1Str, byte[] par2ArrayOfByte, int par3, int par4) { -+ super(par1Str, par3, par4); -+ this.field_96369_c = par2ArrayOfByte; - } - - public RequestPut func_96368_f() { - try { -- this.a.setDoOutput(true); -- this.a.setDoInput(true); -- this.a.setRequestMethod("PUT"); -- OutputStream var1 = this.a.getOutputStream(); -+ this.field_96367_a.setDoOutput(true); -+ this.field_96367_a.setDoInput(true); -+ this.field_96367_a.setRequestMethod("PUT"); -+ OutputStream var1 = this.field_96367_a.getOutputStream(); - var1.write(this.field_96369_c); - var1.flush(); - return this; - } catch (Exception var2) { -- throw new ExceptionMcoHttp("Failed URL: " + this.b, var2); -+ throw new ExceptionMcoHttp("Failed URL: " + this.field_96365_b, var2); - } - } - ---- net/minecraft/src/CommandXP.java -+++ net/minecraft/src/CommandXP.java -@@ -8,66 +8,77 @@ - return "xp"; - } - -+ /** -+ * Return the required permission level for this command. -+ */ - public int getRequiredPermissionLevel() { - return 2; - } - -- public String getCommandUsage(ICommandSender var1) { -+ public String getCommandUsage(ICommandSender par1ICommandSender) { - return "commands.xp.usage"; - } - -- public void processCommand(ICommandSender var1, String[] var2) { -- if(var2.length <= 0) { -+ public void processCommand(ICommandSender par1ICommandSender, String[] par2ArrayOfStr) { -+ if (par2ArrayOfStr.length <= 0) { - throw new WrongUsageException("commands.xp.usage", new Object[0]); - } else { -- String var4 = var2[0]; -+ String var4 = par2ArrayOfStr[0]; - boolean var5 = var4.endsWith("l") || var4.endsWith("L"); -- if(var5 && var4.length() > 1) { -+ -+ if (var5 && var4.length() > 1) { - var4 = var4.substring(0, var4.length() - 1); - } - -- int var6 = parseInt(var1, var4); -+ int var6 = parseInt(par1ICommandSender, var4); - boolean var7 = var6 < 0; -- if(var7) { -+ -+ if (var7) { - var6 *= -1; - } - - EntityPlayerMP var3; -- if(var2.length > 1) { -- var3 = getPlayer(var1, var2[1]); -+ -+ if (par2ArrayOfStr.length > 1) { -+ var3 = getPlayer(par1ICommandSender, par2ArrayOfStr[1]); - } else { -- var3 = getCommandSenderAsPlayer(var1); -+ var3 = getCommandSenderAsPlayer(par1ICommandSender); - } - -- if(var5) { -- if(var7) { -+ if (var5) { -+ if (var7) { - var3.addExperienceLevel(-var6); -- notifyAdmins(var1, "commands.xp.success.negative.levels", new Object[]{Integer.valueOf(var6), var3.getEntityName()}); -+ notifyAdmins(par1ICommandSender, "commands.xp.success.negative.levels", new Object[] {Integer.valueOf(var6), var3.getEntityName()}); - } else { - var3.addExperienceLevel(var6); -- notifyAdmins(var1, "commands.xp.success.levels", new Object[]{Integer.valueOf(var6), var3.getEntityName()}); -+ notifyAdmins(par1ICommandSender, "commands.xp.success.levels", new Object[] {Integer.valueOf(var6), var3.getEntityName()}); - } - } else { -- if(var7) { -+ if (var7) { - throw new WrongUsageException("commands.xp.failure.widthdrawXp", new Object[0]); - } - - var3.addExperience(var6); -- notifyAdmins(var1, "commands.xp.success", new Object[]{Integer.valueOf(var6), var3.getEntityName()}); -+ notifyAdmins(par1ICommandSender, "commands.xp.success", new Object[] {Integer.valueOf(var6), var3.getEntityName()}); - } -- - } - } - -- public List addTabCompletionOptions(ICommandSender var1, String[] var2) { -- return var2.length == 2 ? getListOfStringsMatchingLastWord(var2, this.getAllUsernames()) : null; -+ /** -+ * Adds the strings available in this command to the given list of tab completion options. -+ */ -+ public List addTabCompletionOptions(ICommandSender par1ICommandSender, String[] par2ArrayOfStr) { -+ return par2ArrayOfStr.length == 2 ? getListOfStringsMatchingLastWord(par2ArrayOfStr, this.getAllUsernames()) : null; - } - - protected String[] getAllUsernames() { - return MinecraftServer.getServer().getAllUsernames(); - } - -- public boolean isUsernameIndex(String[] var1, int var2) { -- return var2 == 1; -+ /** -+ * Return whether the specified command parameter index is a username parameter. -+ */ -+ public boolean isUsernameIndex(String[] par1ArrayOfStr, int par2) { -+ return par2 == 1; - } - } ---- /dev/null -+++ com/prupe/mcpatcher/cc/ColorizeEntity.java -@@ -1,0 +1,123 @@ -+package com.prupe.mcpatcher.cc; -+ -+import com.prupe.mcpatcher.MCPatcherUtils; -+import com.prupe.mcpatcher.TexturePackAPI; -+import java.util.Properties; -+import java.util.Random; -+import net.minecraft.src.EntityLivingBase; -+import net.minecraft.src.EntitySheep; -+import net.minecraft.src.ItemDye; -+import net.minecraft.src.ResourceLocation; -+ -+public class ColorizeEntity { -+ private static final ResourceLocation LAVA_DROP_COLORS = TexturePackAPI.newMCPatcherResourceLocation("colormap/lavadrop.png"); -+ private static final ResourceLocation MYCELIUM_COLORS = TexturePackAPI.newMCPatcherResourceLocation("colormap/myceliumparticle.png"); -+ private static final ResourceLocation XPORB_COLORS = TexturePackAPI.newMCPatcherResourceLocation("colormap/xporb.png"); -+ static float[] waterBaseColor; -+ private static float[] lavaDropColors; -+ public static float[] portalColor = new float[] {1.0F, 0.3F, 0.9F}; -+ private static final Random random = new Random(); -+ private static int[] myceliumColors; -+ private static int[] xpOrbColors; -+ private static final int[] origDyeColors = (int[])ItemDye.dyeColors.clone(); -+ private static final float[][] origFleeceColors = new float[EntitySheep.fleeceColorTable.length][]; -+ public static final float[][] armorColors = new float[EntitySheep.fleeceColorTable.length][]; -+ public static int undyedLeatherColor; -+ public static final float[][] collarColors = new float[EntitySheep.fleeceColorTable.length][]; -+ -+ static void reset() { -+ waterBaseColor = new float[] {0.2F, 0.3F, 1.0F}; -+ portalColor = new float[] {1.0F, 0.3F, 0.9F}; -+ lavaDropColors = null; -+ System.arraycopy(origDyeColors, 0, ItemDye.dyeColors, 0, origDyeColors.length); -+ -+ for (int i = 0; i < origFleeceColors.length; ++i) { -+ EntitySheep.fleeceColorTable[i] = (float[])origFleeceColors[i].clone(); -+ armorColors[i] = (float[])origFleeceColors[i].clone(); -+ collarColors[i] = (float[])origFleeceColors[i].clone(); -+ } -+ -+ undyedLeatherColor = 10511680; -+ myceliumColors = null; -+ xpOrbColors = null; -+ } -+ -+ static void reloadParticleColors(Properties properties) { -+ Colorizer.loadFloatColor("drop.water", waterBaseColor); -+ Colorizer.loadFloatColor("particle.water", waterBaseColor); -+ Colorizer.loadFloatColor("particle.portal", portalColor); -+ int[] rgb = MCPatcherUtils.getImageRGB(TexturePackAPI.getImage(LAVA_DROP_COLORS)); -+ -+ if (rgb != null) { -+ lavaDropColors = new float[3 * rgb.length]; -+ -+ for (int i = 0; i < rgb.length; ++i) { -+ Colorizer.intToFloat3(rgb[i], lavaDropColors, 3 * i); -+ } -+ } -+ -+ myceliumColors = MCPatcherUtils.getImageRGB(TexturePackAPI.getImage(MYCELIUM_COLORS)); -+ } -+ -+ static void reloadDyeColors(Properties properties) { -+ int i; -+ -+ for (i = 0; i < ItemDye.dyeColors.length; ++i) { -+ Colorizer.loadIntColor("dye." + Colorizer.getStringKey(ItemDye.dyeColorNames, i), ItemDye.dyeColors, i); -+ } -+ -+ for (i = 0; i < EntitySheep.fleeceColorTable.length; ++i) { -+ String key = Colorizer.getStringKey(ItemDye.dyeColorNames, EntitySheep.fleeceColorTable.length - 1 - i); -+ Colorizer.loadFloatColor("sheep." + key, EntitySheep.fleeceColorTable[i]); -+ Colorizer.loadFloatColor("armor." + key, armorColors[i]); -+ Colorizer.loadFloatColor("collar." + key, collarColors[i]); -+ } -+ -+ undyedLeatherColor = Colorizer.loadIntColor("armor.default", undyedLeatherColor); -+ } -+ -+ static void reloadXPOrbColors(Properties properties) { -+ xpOrbColors = MCPatcherUtils.getImageRGB(TexturePackAPI.getImage(XPORB_COLORS)); -+ } -+ -+ public static int colorizeXPOrb(int origColor, float timer) { -+ return xpOrbColors != null && xpOrbColors.length != 0 ? xpOrbColors[(int)((Math.sin((double)timer / 4.0D) + 1.0D) * (double)(xpOrbColors.length - 1) / 2.0D)] : origColor; -+ } -+ -+ public static boolean computeLavaDropColor(int age) { -+ if (lavaDropColors == null) { -+ return false; -+ } else { -+ int offset = 3 * Math.max(Math.min(lavaDropColors.length / 3 - 1, age - 20), 0); -+ System.arraycopy(lavaDropColors, offset, Colorizer.setColor, 0, 3); -+ return true; -+ } -+ } -+ -+ public static boolean computeMyceliumParticleColor() { -+ if (myceliumColors == null) { -+ return false; -+ } else { -+ Colorizer.setColorF(myceliumColors[random.nextInt(myceliumColors.length)]); -+ return true; -+ } -+ } -+ -+ public static int getPotionEffectColor(int defaultColor, EntityLivingBase entity) { -+ return defaultColor == 0 ? defaultColor : entity.overridePotionColor; -+ } -+ -+ static { -+ try { -+ for (int e = 0; e < EntitySheep.fleeceColorTable.length; ++e) { -+ origFleeceColors[e] = (float[])EntitySheep.fleeceColorTable[e].clone(); -+ armorColors[e] = (float[])EntitySheep.fleeceColorTable[e].clone(); -+ collarColors[e] = (float[])EntitySheep.fleeceColorTable[e].clone(); -+ } -+ -+ reset(); -+ } catch (Throwable var1) { -+ var1.printStackTrace(); -+ } -+ } -+} ---- net/minecraft/src/CallablePacketClass.java -+++ net/minecraft/src/CallablePacketClass.java -@@ -4,11 +4,12 @@ - - class CallablePacketClass implements Callable { - final Packet thePacket; -+ - final NetServerHandler theNetServerHandler; - -- CallablePacketClass(NetServerHandler var1, Packet var2) { -- this.theNetServerHandler = var1; -- this.thePacket = var2; -+ CallablePacketClass(NetServerHandler par1NetServerHandler, Packet par2Packet) { -+ this.theNetServerHandler = par1NetServerHandler; -+ this.thePacket = par2Packet; - } - - public String getPacketClass() { ---- net/minecraft/src/PositionImpl.java -+++ net/minecraft/src/PositionImpl.java -@@ -5,10 +5,10 @@ - protected final double y; - protected final double z; - -- public PositionImpl(double var1, double var3, double var5) { -- this.x = var1; -- this.y = var3; -- this.z = var5; -+ public PositionImpl(double par1, double par3, double par5) { -+ this.x = par1; -+ this.y = par3; -+ this.z = par5; - } - - public double getX() { ---- /dev/null -+++ org/spoutcraft/api/gui/Gradient.java -@@ -1,0 +1,70 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.api.gui; -+ -+import org.spoutcraft.api.UnsafeClass; -+ -+@UnsafeClass -+public interface Gradient extends Widget { -+ /** -+ * Gets the top colour of the gradient to render -+ * -+ * @return color -+ */ -+ public Color getTopColor(); -+ -+ /** -+ * Sets the top colour of the gradient to render -+ * -+ * @param color -+ * @return gradient -+ */ -+ public Gradient setTopColor(Color color); -+ -+ /** -+ * Gets the bottom colour of the gradient to render -+ * -+ * @return color -+ */ -+ public Color getBottomColor(); -+ -+ /** -+ * Sets the bottom colour of the gradient to render -+ * -+ * @param color -+ * @return gradient -+ */ -+ public Gradient setBottomColor(Color color); -+ -+ /** -+ * Set the direction the gradient is drawn. -+ * Default is VERTICAL, if using HORIZONTAL then read top as left and bottom as right. -+ * @param axis the orientation to draw in -+ * @return -+ */ -+ public Gradient setOrientation(Orientation axis); -+ -+ /** -+ * Get the direction the gradient is drawn. -+ * Default is VERTICAL, if using HORIZONTAL then read top as left and bottom as right. -+ * @return the orientation being used -+ */ -+ public Orientation getOrientation(); -+} ---- /dev/null -+++ org/spoutcraft/api/gui/HealthBar.java -@@ -1,0 +1,157 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.api.gui; -+ -+import java.io.IOException; -+import java.util.UUID; -+ -+import org.spoutcraft.api.Spoutcraft; -+import org.spoutcraft.api.UnsafeClass; -+import org.spoutcraft.api.io.SpoutInputStream; -+import org.spoutcraft.api.io.SpoutOutputStream; -+ -+@UnsafeClass -+public class HealthBar extends GenericWidget { -+ private int icons = 10; -+ private int iconOffset = 8; -+ private float dangerPercent = 20f; -+ -+ public HealthBar() { -+ super(); -+ setX(427 / 2 - 91); // 122 -+ setY(201); -+ setAnchor(WidgetAnchor.BOTTOM_CENTER); -+ } -+ -+ @Override -+ public void readData(SpoutInputStream input) throws IOException { -+ super.readData(input); -+ setMaxNumHearts(input.readInt()); -+ setIconOffset(input.readInt()); -+ setDangerPercent(input.readFloat()); -+ } -+ -+ @Override -+ public void writeData(SpoutOutputStream output) throws IOException { -+ super.writeData(output); -+ output.writeInt(getMaxNumHearts()); -+ output.writeInt(getIconOffset()); -+ output.writeFloat(getDangerPercent()); -+ } -+ -+ public WidgetType getType() { -+ return WidgetType.HealthBar; -+ } -+ -+ @Override -+ public UUID getId() { -+ return new UUID(0, 4); -+ } -+ -+ @Override -+ public double getScreenX() { -+ double mid = getScreen() != null ? getScreen().getWidth() / 2 : 427 / 2D; -+ double diff = super.getScreenX() - mid - 31; -+ return getScreen() != null ? getScreen().getWidth() / 2D - diff : this.getX(); -+ } -+ -+ @Override -+ public double getScreenY() { -+ int diff = (int) (240 - this.getY()); -+ return getScreen() != null ? getScreen().getHeight() - diff : this.getY(); -+ } -+ -+ public void render() { -+ Spoutcraft.getClient().getRenderDelegate().render(this); -+ } -+ -+ /** -+ * Gets the maximum number of hearts displayed on the HUD. -+ * -+ * Health is scaled to fit the number of hearts appropriately. -+ * -+ * @return hearts displayed -+ */ -+ public int getMaxNumHearts() { -+ return icons; -+ } -+ -+ /** -+ * Sets the maximum number of hearts displayed on the HUD. -+ * -+ * Health is scaled to fit the number of hearts appropriately. -+ * -+ * @param hearts to display -+ * @return this -+ */ -+ public HealthBar setMaxNumHearts(int hearts) { -+ this.icons = hearts; -+ return this; -+ } -+ -+ /** -+ * Gets the number of pixels each heart is offset when drawing the next heart. -+ * -+ * @return pixel offset -+ */ -+ public int getIconOffset() { -+ return iconOffset; -+ } -+ -+ /** -+ * Sets the number of pixels each heart is offset when drawing the next heart. -+ * -+ * @param offset when drawing hearts -+ * @return this -+ */ -+ public HealthBar setIconOffset(int offset) { -+ iconOffset = offset; -+ return this; -+ } -+ -+ /** -+ * Gets the percent of health a player needs to fall to or below in order for the hearts to begin blinking. -+ * -+ * Valid percents are between zero and one hundred, inclusive. -+ * -+ * @return danger percent -+ */ -+ public float getDangerPercent() { -+ return dangerPercent; -+ } -+ -+ /** -+ * Sets the percent of health a player needs to fall to or below in order for the hearts to begin blinking. -+ * -+ * Valid percents are between zero and one hundred, inclusive. -+ * -+ * @param percent -+ * @return this -+ */ -+ public HealthBar setDangerPercent(float percent) { -+ dangerPercent = percent; -+ return this; -+ } -+ -+ @Override -+ public int getVersion() { -+ return super.getVersion() + 1; -+ } -+} ---- net/minecraft/src/SelectionListBase.java -+++ net/minecraft/src/SelectionListBase.java -@@ -18,13 +18,13 @@ - private int field_96623_l = -1; - private long field_96624_m; - -- public SelectionListBase(Minecraft var1, int var2, int var3, int var4, int var5, int var6) { -- this.mc = var1; -- this.field_96616_f = var3; -- this.field_96627_h = var3 + var5; -- this.field_96620_b = var6; -- this.field_96619_e = var2; -- this.field_96617_g = var2 + var4; -+ public SelectionListBase(Minecraft par1Minecraft, int par2, int par3, int par4, int par5, int par6) { -+ this.mc = par1Minecraft; -+ this.field_96616_f = par3; -+ this.field_96627_h = par3 + par5; -+ this.field_96620_b = par6; -+ this.field_96619_e = par2; -+ this.field_96617_g = par2 + par4; - } - - protected abstract int func_96608_a(); -@@ -43,27 +43,27 @@ - - private void func_96614_f() { - int var1 = this.func_96607_d(); -- if(var1 < 0) { -+ -+ if (var1 < 0) { - var1 = 0; - } - -- if(this.field_96626_k < 0.0F) { -+ if (this.field_96626_k < 0.0F) { - this.field_96626_k = 0.0F; - } - -- if(this.field_96626_k > (float)var1) { -+ if (this.field_96626_k > (float)var1) { - this.field_96626_k = (float)var1; - } -- - } - - public int func_96607_d() { - return this.func_96613_b() - (this.field_96627_h - this.field_96616_f - 4); - } - -- public void func_96612_a(int var1, int var2, float var3) { -- this.field_96621_c = var1; -- this.field_96618_d = var2; -+ public void func_96612_a(int par1, int par2, float par3) { -+ this.field_96621_c = par1; -+ this.field_96618_d = par2; - this.func_96611_c(); - int var4 = this.func_96608_a(); - int var5 = this.func_96606_e(); -@@ -73,36 +73,41 @@ - int var11; - int var13; - int var20; -- if(Mouse.isButtonDown(0)) { -- if(this.field_96628_i == -1.0F) { -- boolean var16 = true; -- if(var2 >= this.field_96616_f && var2 <= this.field_96627_h) { -+ -+ if (Mouse.isButtonDown(0)) { -+ if (this.field_96628_i == -1.0F) { -+ boolean var7 = true; -+ -+ if (par2 >= this.field_96616_f && par2 <= this.field_96627_h) { - int var8 = this.field_96619_e + 2; - var9 = this.field_96617_g - 2; -- var10 = var2 - this.field_96616_f + (int)this.field_96626_k - 4; -+ var10 = par2 - this.field_96616_f + (int)this.field_96626_k - 4; - var11 = var10 / this.field_96620_b; -- if(var1 >= var8 && var1 <= var9 && var11 >= 0 && var10 >= 0 && var11 < var4) { -+ -+ if (par1 >= var8 && par1 <= var9 && var11 >= 0 && var10 >= 0 && var11 < var4) { - boolean var12 = var11 == this.field_96623_l && Minecraft.getSystemTime() - this.field_96624_m < 250L; - this.func_96615_a(var11, var12); - this.field_96623_l = var11; - this.field_96624_m = Minecraft.getSystemTime(); -- } else if(var1 >= var8 && var1 <= var9 && var10 < 0) { -- var16 = false; -+ } else if (par1 >= var8 && par1 <= var9 && var10 < 0) { -+ var7 = false; - } - -- if(var1 >= var5 && var1 <= var6) { -+ if (par1 >= var5 && par1 <= var6) { - this.field_96625_j = -1.0F; - var20 = this.func_96607_d(); -- if(var20 < 1) { -+ -+ if (var20 < 1) { - var20 = 1; - } - - var13 = (int)((float)((this.field_96627_h - this.field_96616_f) * (this.field_96627_h - this.field_96616_f)) / (float)this.func_96613_b()); -- if(var13 < 32) { -+ -+ if (var13 < 32) { - var13 = 32; - } - -- if(var13 > this.field_96627_h - this.field_96616_f - 8) { -+ if (var13 > this.field_96627_h - this.field_96616_f - 8) { - var13 = this.field_96627_h - this.field_96616_f - 8; - } - -@@ -111,36 +116,34 @@ - this.field_96625_j = 1.0F; - } - -- if(var16) { -- this.field_96628_i = (float)var2; -+ if (var7) { -+ this.field_96628_i = (float)par2; - } else { - this.field_96628_i = -2.0F; - } - } else { - this.field_96628_i = -2.0F; - } -- } else if(this.field_96628_i >= 0.0F) { -- this.field_96626_k -= ((float)var2 - this.field_96628_i) * this.field_96625_j; -- this.field_96628_i = (float)var2; -+ } else if (this.field_96628_i >= 0.0F) { -+ this.field_96626_k -= ((float)par2 - this.field_96628_i) * this.field_96625_j; -+ this.field_96628_i = (float)par2; - } - } else { -- while(true) { -- if(this.mc.gameSettings.touchscreen || !Mouse.next()) { -- this.field_96628_i = -1.0F; -- break; -- } -+ while (!this.mc.gameSettings.touchscreen && Mouse.next()) { -+ int var16 = Mouse.getEventDWheel(); - -- int var7 = Mouse.getEventDWheel(); -- if(var7 != 0) { -- if(var7 > 0) { -- var7 = -1; -- } else if(var7 < 0) { -- var7 = 1; -+ if (var16 != 0) { -+ if (var16 > 0) { -+ var16 = -1; -+ } else if (var16 < 0) { -+ var16 = 1; - } - -- this.field_96626_k += (float)(var7 * this.field_96620_b / 2); -+ this.field_96626_k += (float)(var16 * this.field_96620_b / 2); - } - } -+ -+ this.field_96628_i = -1.0F; - } - - this.func_96614_f(); -@@ -159,13 +162,14 @@ - var18.draw(); - var9 = this.field_96619_e + 2; - var10 = this.field_96616_f + 4 - (int)this.field_96626_k; -- - int var14; -- for(var11 = 0; var11 < var4; ++var11) { -+ -+ for (var11 = 0; var11 < var4; ++var11) { - var20 = var10 + var11 * this.field_96620_b; - var13 = this.field_96620_b - 4; -- if(var20 + this.field_96620_b <= this.field_96627_h && var20 - 4 >= this.field_96616_f) { -- if(this.func_96609_a(var11)) { -+ -+ if (var20 + this.field_96620_b <= this.field_96627_h && var20 - 4 >= this.field_96616_f) { -+ if (this.func_96609_a(var11)) { - var14 = this.field_96619_e + 2; - int var15 = this.field_96617_g - 2; - GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); -@@ -213,18 +217,21 @@ - var18.addVertexWithUV((double)this.field_96619_e, (double)(this.field_96627_h - var19), 0.0D, 0.0D, 0.0D); - var18.draw(); - var20 = this.func_96607_d(); -- if(var20 > 0) { -+ -+ if (var20 > 0) { - var13 = (this.field_96627_h - this.field_96616_f) * (this.field_96627_h - this.field_96616_f) / this.func_96613_b(); -- if(var13 < 32) { -+ -+ if (var13 < 32) { - var13 = 32; - } - -- if(var13 > this.field_96627_h - this.field_96616_f - 8) { -+ if (var13 > this.field_96627_h - this.field_96616_f - 8) { - var13 = this.field_96627_h - this.field_96616_f - 8; - } - - var14 = (int)this.field_96626_k * (this.field_96627_h - this.field_96616_f - var13) / var20 + this.field_96616_f; -- if(var14 < this.field_96616_f) { -+ -+ if (var14 < this.field_96616_f) { - var14 = this.field_96616_f; - } - ---- /dev/null -+++ org/spoutcraft/client/gui/inventory/CreativeTabCustom.java -@@ -1,0 +1,61 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.client.gui.inventory; -+ -+import java.util.ArrayList; -+import java.util.List; -+ -+import net.minecraft.src.CreativeTabs; -+import net.minecraft.src.Item; -+import net.minecraft.src.ItemStack; -+ -+import org.spoutcraft.api.material.CustomItem; -+import org.spoutcraft.api.material.MaterialData; -+ -+public class CreativeTabCustom extends CreativeTabs{ -+ public CreativeTabCustom(int inty, String string) { -+ super(inty, string); -+ } -+ -+ @Override -+ public Item getTabIconItem() { -+ return Item.flint; -+ } -+ -+ @Override -+ public String getTranslatedTabLabel() { -+ return "Custom Items"; -+ } -+ -+ @Override -+ public void displayAllReleventItems(List par1List) { -+ CustomItem[] iteml = MaterialData.getCustomItems(); -+ List rawDatas = new ArrayList(); -+ -+ for (CustomItem ci : iteml) { -+ if (rawDatas.contains(ci.getRawData())) { -+ continue; -+ } -+ ItemStack is = new ItemStack(ci.getRawId(), 1, ci.getRawData()); -+ rawDatas.add(ci.getRawData()); -+ par1List.add(is); -+ } -+ } -+} ---- net/minecraft/src/BlockChest.java -+++ net/minecraft/src/BlockChest.java -@@ -4,374 +4,453 @@ - import java.util.Random; - - public class BlockChest extends BlockContainer { -- private final Random b = new Random(); -+ private final Random random = new Random(); -+ -+ /** 1 for trapped chests, 0 for normal chests. */ - public final int chestType; - -- protected BlockChest(int var1, int var2) { -- super(var1, Material.wood); -- this.chestType = var2; -+ protected BlockChest(int par1, int par2) { -+ super(par1, Material.wood); -+ this.chestType = par2; - this.setCreativeTab(CreativeTabs.tabDecorations); -- this.setBlockBounds(1.0F / 16.0F, 0.0F, 1.0F / 16.0F, 15.0F / 16.0F, 14.0F / 16.0F, 15.0F / 16.0F); -+ this.setBlockBounds(0.0625F, 0.0F, 0.0625F, 0.9375F, 0.875F, 0.9375F); - } - -+ /** -+ * Is this block (a) opaque and (b) a full 1m cube? This determines whether or not to render the shared face of two -+ * adjacent blocks and also whether the player can attach torches, redstone wire, etc to this block. -+ */ - public boolean isOpaqueCube() { - return false; - } - -+ /** -+ * If this block doesn't render as an ordinary block it will return False (examples: signs, buttons, stairs, etc) -+ */ - public boolean renderAsNormalBlock() { - return false; - } - -+ /** -+ * The type of render function that is called for this block -+ */ - public int getRenderType() { - return 22; - } - -- public void setBlockBoundsBasedOnState(IBlockAccess var1, int var2, int var3, int var4) { -- if(var1.getBlockId(var2, var3, var4 - 1) == this.blockID) { -- this.setBlockBounds(1.0F / 16.0F, 0.0F, 0.0F, 15.0F / 16.0F, 14.0F / 16.0F, 15.0F / 16.0F); -- } else if(var1.getBlockId(var2, var3, var4 + 1) == this.blockID) { -- this.setBlockBounds(1.0F / 16.0F, 0.0F, 1.0F / 16.0F, 15.0F / 16.0F, 14.0F / 16.0F, 1.0F); -- } else if(var1.getBlockId(var2 - 1, var3, var4) == this.blockID) { -- this.setBlockBounds(0.0F, 0.0F, 1.0F / 16.0F, 15.0F / 16.0F, 14.0F / 16.0F, 15.0F / 16.0F); -- } else if(var1.getBlockId(var2 + 1, var3, var4) == this.blockID) { -- this.setBlockBounds(1.0F / 16.0F, 0.0F, 1.0F / 16.0F, 1.0F, 14.0F / 16.0F, 15.0F / 16.0F); -+ /** -+ * Updates the blocks bounds based on its current state. Args: world, x, y, z -+ */ -+ public void setBlockBoundsBasedOnState(IBlockAccess par1IBlockAccess, int par2, int par3, int par4) { -+ if (par1IBlockAccess.getBlockId(par2, par3, par4 - 1) == this.blockID) { -+ this.setBlockBounds(0.0625F, 0.0F, 0.0F, 0.9375F, 0.875F, 0.9375F); -+ } else if (par1IBlockAccess.getBlockId(par2, par3, par4 + 1) == this.blockID) { -+ this.setBlockBounds(0.0625F, 0.0F, 0.0625F, 0.9375F, 0.875F, 1.0F); -+ } else if (par1IBlockAccess.getBlockId(par2 - 1, par3, par4) == this.blockID) { -+ this.setBlockBounds(0.0F, 0.0F, 0.0625F, 0.9375F, 0.875F, 0.9375F); -+ } else if (par1IBlockAccess.getBlockId(par2 + 1, par3, par4) == this.blockID) { -+ this.setBlockBounds(0.0625F, 0.0F, 0.0625F, 1.0F, 0.875F, 0.9375F); - } else { -- this.setBlockBounds(1.0F / 16.0F, 0.0F, 1.0F / 16.0F, 15.0F / 16.0F, 14.0F / 16.0F, 15.0F / 16.0F); -- } -- -- } -- -- public void onBlockAdded(World var1, int var2, int var3, int var4) { -- super.onBlockAdded(var1, var2, var3, var4); -- this.unifyAdjacentChests(var1, var2, var3, var4); -- int var5 = var1.getBlockId(var2, var3, var4 - 1); -- int var6 = var1.getBlockId(var2, var3, var4 + 1); -- int var7 = var1.getBlockId(var2 - 1, var3, var4); -- int var8 = var1.getBlockId(var2 + 1, var3, var4); -- if(var5 == this.blockID) { -- this.unifyAdjacentChests(var1, var2, var3, var4 - 1); -- } -- -- if(var6 == this.blockID) { -- this.unifyAdjacentChests(var1, var2, var3, var4 + 1); -- } -- -- if(var7 == this.blockID) { -- this.unifyAdjacentChests(var1, var2 - 1, var3, var4); -- } -- -- if(var8 == this.blockID) { -- this.unifyAdjacentChests(var1, var2 + 1, var3, var4); -- } -- -- } -- -- public void onBlockPlacedBy(World var1, int var2, int var3, int var4, EntityLivingBase var5, ItemStack var6) { -- int var7 = var1.getBlockId(var2, var3, var4 - 1); -- int var8 = var1.getBlockId(var2, var3, var4 + 1); -- int var9 = var1.getBlockId(var2 - 1, var3, var4); -- int var10 = var1.getBlockId(var2 + 1, var3, var4); -+ this.setBlockBounds(0.0625F, 0.0F, 0.0625F, 0.9375F, 0.875F, 0.9375F); -+ } -+ } -+ -+ /** -+ * Called whenever the block is added into the world. Args: world, x, y, z -+ */ -+ public void onBlockAdded(World par1World, int par2, int par3, int par4) { -+ super.onBlockAdded(par1World, par2, par3, par4); -+ this.unifyAdjacentChests(par1World, par2, par3, par4); -+ int var5 = par1World.getBlockId(par2, par3, par4 - 1); -+ int var6 = par1World.getBlockId(par2, par3, par4 + 1); -+ int var7 = par1World.getBlockId(par2 - 1, par3, par4); -+ int var8 = par1World.getBlockId(par2 + 1, par3, par4); -+ -+ if (var5 == this.blockID) { -+ this.unifyAdjacentChests(par1World, par2, par3, par4 - 1); -+ } -+ -+ if (var6 == this.blockID) { -+ this.unifyAdjacentChests(par1World, par2, par3, par4 + 1); -+ } -+ -+ if (var7 == this.blockID) { -+ this.unifyAdjacentChests(par1World, par2 - 1, par3, par4); -+ } -+ -+ if (var8 == this.blockID) { -+ this.unifyAdjacentChests(par1World, par2 + 1, par3, par4); -+ } -+ } -+ -+ /** -+ * Called when the block is placed in the world. -+ */ -+ public void onBlockPlacedBy(World par1World, int par2, int par3, int par4, EntityLivingBase par5EntityLivingBase, ItemStack par6ItemStack) { -+ int var7 = par1World.getBlockId(par2, par3, par4 - 1); -+ int var8 = par1World.getBlockId(par2, par3, par4 + 1); -+ int var9 = par1World.getBlockId(par2 - 1, par3, par4); -+ int var10 = par1World.getBlockId(par2 + 1, par3, par4); - byte var11 = 0; -- int var12 = MathHelper.floor_double((double)(var5.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3; -- if(var12 == 0) { -+ int var12 = MathHelper.floor_double((double)(par5EntityLivingBase.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3; -+ -+ if (var12 == 0) { - var11 = 2; - } - -- if(var12 == 1) { -+ if (var12 == 1) { - var11 = 5; - } - -- if(var12 == 2) { -+ if (var12 == 2) { - var11 = 3; - } - -- if(var12 == 3) { -+ if (var12 == 3) { - var11 = 4; - } - -- if(var7 != this.blockID && var8 != this.blockID && var9 != this.blockID && var10 != this.blockID) { -- var1.setBlockMetadata(var2, var3, var4, var11, 3); -+ if (var7 != this.blockID && var8 != this.blockID && var9 != this.blockID && var10 != this.blockID) { -+ par1World.setBlockMetadataWithNotify(par2, par3, par4, var11, 3); - } else { -- if((var7 == this.blockID || var8 == this.blockID) && (var11 == 4 || var11 == 5)) { -- if(var7 == this.blockID) { -- var1.setBlockMetadata(var2, var3, var4 - 1, var11, 3); -- } else { -- var1.setBlockMetadata(var2, var3, var4 + 1, var11, 3); -- } -- -- var1.setBlockMetadata(var2, var3, var4, var11, 3); -- } -- -- if((var9 == this.blockID || var10 == this.blockID) && (var11 == 2 || var11 == 3)) { -- if(var9 == this.blockID) { -- var1.setBlockMetadata(var2 - 1, var3, var4, var11, 3); -- } else { -- var1.setBlockMetadata(var2 + 1, var3, var4, var11, 3); -- } -- -- var1.setBlockMetadata(var2, var3, var4, var11, 3); -- } -- } -- -- if(var6.hasDisplayName()) { -- ((TileEntityChest)var1.getBlockTileEntity(var2, var3, var4)).setChestGuiName(var6.getDisplayName()); -- } -- -+ if ((var7 == this.blockID || var8 == this.blockID) && (var11 == 4 || var11 == 5)) { -+ if (var7 == this.blockID) { -+ par1World.setBlockMetadataWithNotify(par2, par3, par4 - 1, var11, 3); -+ } else { -+ par1World.setBlockMetadataWithNotify(par2, par3, par4 + 1, var11, 3); -+ } -+ -+ par1World.setBlockMetadataWithNotify(par2, par3, par4, var11, 3); -+ } -+ -+ if ((var9 == this.blockID || var10 == this.blockID) && (var11 == 2 || var11 == 3)) { -+ if (var9 == this.blockID) { -+ par1World.setBlockMetadataWithNotify(par2 - 1, par3, par4, var11, 3); -+ } else { -+ par1World.setBlockMetadataWithNotify(par2 + 1, par3, par4, var11, 3); -+ } -+ -+ par1World.setBlockMetadataWithNotify(par2, par3, par4, var11, 3); -+ } -+ } -+ -+ if (par6ItemStack.hasDisplayName()) { -+ ((TileEntityChest)par1World.getBlockTileEntity(par2, par3, par4)).setChestGuiName(par6ItemStack.getDisplayName()); -+ } - } - -- public void unifyAdjacentChests(World var1, int var2, int var3, int var4) { -- if(!var1.isRemote) { -- int var5 = var1.getBlockId(var2, var3, var4 - 1); -- int var6 = var1.getBlockId(var2, var3, var4 + 1); -- int var7 = var1.getBlockId(var2 - 1, var3, var4); -- int var8 = var1.getBlockId(var2 + 1, var3, var4); -+ /** -+ * Turns the adjacent chests to a double chest. -+ */ -+ public void unifyAdjacentChests(World par1World, int par2, int par3, int par4) { -+ if (!par1World.isRemote) { -+ int var5 = par1World.getBlockId(par2, par3, par4 - 1); -+ int var6 = par1World.getBlockId(par2, par3, par4 + 1); -+ int var7 = par1World.getBlockId(par2 - 1, par3, par4); -+ int var8 = par1World.getBlockId(par2 + 1, par3, par4); - boolean var9 = true; - int var10; - int var11; - boolean var12; - byte var13; - int var14; -- if(var5 != this.blockID && var6 != this.blockID) { -- if(var7 != this.blockID && var8 != this.blockID) { -+ -+ if (var5 != this.blockID && var6 != this.blockID) { -+ if (var7 != this.blockID && var8 != this.blockID) { - var13 = 3; -- if(Block.opaqueCubeLookup[var5] && !Block.opaqueCubeLookup[var6]) { -+ -+ if (Block.opaqueCubeLookup[var5] && !Block.opaqueCubeLookup[var6]) { - var13 = 3; - } - -- if(Block.opaqueCubeLookup[var6] && !Block.opaqueCubeLookup[var5]) { -+ if (Block.opaqueCubeLookup[var6] && !Block.opaqueCubeLookup[var5]) { - var13 = 2; - } - -- if(Block.opaqueCubeLookup[var7] && !Block.opaqueCubeLookup[var8]) { -+ if (Block.opaqueCubeLookup[var7] && !Block.opaqueCubeLookup[var8]) { - var13 = 5; - } - -- if(Block.opaqueCubeLookup[var8] && !Block.opaqueCubeLookup[var7]) { -+ if (Block.opaqueCubeLookup[var8] && !Block.opaqueCubeLookup[var7]) { - var13 = 4; - } - } else { -- var10 = var1.getBlockId(var7 == this.blockID ? var2 - 1 : var2 + 1, var3, var4 - 1); -- var11 = var1.getBlockId(var7 == this.blockID ? var2 - 1 : var2 + 1, var3, var4 + 1); -+ var10 = par1World.getBlockId(var7 == this.blockID ? par2 - 1 : par2 + 1, par3, par4 - 1); -+ var11 = par1World.getBlockId(var7 == this.blockID ? par2 - 1 : par2 + 1, par3, par4 + 1); - var13 = 3; - var12 = true; -- if(var7 == this.blockID) { -- var14 = var1.getBlockMetadata(var2 - 1, var3, var4); -+ -+ if (var7 == this.blockID) { -+ var14 = par1World.getBlockMetadata(par2 - 1, par3, par4); - } else { -- var14 = var1.getBlockMetadata(var2 + 1, var3, var4); -+ var14 = par1World.getBlockMetadata(par2 + 1, par3, par4); - } - -- if(var14 == 2) { -+ if (var14 == 2) { - var13 = 2; - } - -- if((Block.opaqueCubeLookup[var5] || Block.opaqueCubeLookup[var10]) && !Block.opaqueCubeLookup[var6] && !Block.opaqueCubeLookup[var11]) { -+ if ((Block.opaqueCubeLookup[var5] || Block.opaqueCubeLookup[var10]) && !Block.opaqueCubeLookup[var6] && !Block.opaqueCubeLookup[var11]) { - var13 = 3; - } - -- if((Block.opaqueCubeLookup[var6] || Block.opaqueCubeLookup[var11]) && !Block.opaqueCubeLookup[var5] && !Block.opaqueCubeLookup[var10]) { -+ if ((Block.opaqueCubeLookup[var6] || Block.opaqueCubeLookup[var11]) && !Block.opaqueCubeLookup[var5] && !Block.opaqueCubeLookup[var10]) { - var13 = 2; - } - } - } else { -- var10 = var1.getBlockId(var2 - 1, var3, var5 == this.blockID ? var4 - 1 : var4 + 1); -- var11 = var1.getBlockId(var2 + 1, var3, var5 == this.blockID ? var4 - 1 : var4 + 1); -+ var10 = par1World.getBlockId(par2 - 1, par3, var5 == this.blockID ? par4 - 1 : par4 + 1); -+ var11 = par1World.getBlockId(par2 + 1, par3, var5 == this.blockID ? par4 - 1 : par4 + 1); - var13 = 5; - var12 = true; -- if(var5 == this.blockID) { -- var14 = var1.getBlockMetadata(var2, var3, var4 - 1); -+ -+ if (var5 == this.blockID) { -+ var14 = par1World.getBlockMetadata(par2, par3, par4 - 1); - } else { -- var14 = var1.getBlockMetadata(var2, var3, var4 + 1); -+ var14 = par1World.getBlockMetadata(par2, par3, par4 + 1); - } - -- if(var14 == 4) { -+ if (var14 == 4) { - var13 = 4; - } - -- if((Block.opaqueCubeLookup[var7] || Block.opaqueCubeLookup[var10]) && !Block.opaqueCubeLookup[var8] && !Block.opaqueCubeLookup[var11]) { -+ if ((Block.opaqueCubeLookup[var7] || Block.opaqueCubeLookup[var10]) && !Block.opaqueCubeLookup[var8] && !Block.opaqueCubeLookup[var11]) { - var13 = 5; - } - -- if((Block.opaqueCubeLookup[var8] || Block.opaqueCubeLookup[var11]) && !Block.opaqueCubeLookup[var7] && !Block.opaqueCubeLookup[var10]) { -+ if ((Block.opaqueCubeLookup[var8] || Block.opaqueCubeLookup[var11]) && !Block.opaqueCubeLookup[var7] && !Block.opaqueCubeLookup[var10]) { - var13 = 4; - } - } - -- var1.setBlockMetadata(var2, var3, var4, var13, 3); -+ par1World.setBlockMetadataWithNotify(par2, par3, par4, var13, 3); - } - } - -- public boolean canPlaceBlockAt(World var1, int var2, int var3, int var4) { -+ /** -+ * Checks to see if its valid to put this block at the specified coordinates. Args: world, x, y, z -+ */ -+ public boolean canPlaceBlockAt(World par1World, int par2, int par3, int par4) { - int var5 = 0; -- if(var1.getBlockId(var2 - 1, var3, var4) == this.blockID) { -- ++var5; -- } -- -- if(var1.getBlockId(var2 + 1, var3, var4) == this.blockID) { -- ++var5; -- } -- -- if(var1.getBlockId(var2, var3, var4 - 1) == this.blockID) { -- ++var5; -- } -- -- if(var1.getBlockId(var2, var3, var4 + 1) == this.blockID) { -- ++var5; -- } -- -- return var5 > 1 ? false : (this.isThereANeighborChest(var1, var2 - 1, var3, var4) ? false : (this.isThereANeighborChest(var1, var2 + 1, var3, var4) ? false : (this.isThereANeighborChest(var1, var2, var3, var4 - 1) ? false : !this.isThereANeighborChest(var1, var2, var3, var4 + 1)))); -- } -- -- private boolean isThereANeighborChest(World var1, int var2, int var3, int var4) { -- return var1.getBlockId(var2, var3, var4) != this.blockID ? false : (var1.getBlockId(var2 - 1, var3, var4) == this.blockID ? true : (var1.getBlockId(var2 + 1, var3, var4) == this.blockID ? true : (var1.getBlockId(var2, var3, var4 - 1) == this.blockID ? true : var1.getBlockId(var2, var3, var4 + 1) == this.blockID))); -- } -- -- public void onNeighborBlockChange(World var1, int var2, int var3, int var4, int var5) { -- super.onNeighborBlockChange(var1, var2, var3, var4, var5); -- TileEntityChest var6 = (TileEntityChest)var1.getBlockTileEntity(var2, var3, var4); -- if(var6 != null) { -+ -+ if (par1World.getBlockId(par2 - 1, par3, par4) == this.blockID) { -+ ++var5; -+ } -+ -+ if (par1World.getBlockId(par2 + 1, par3, par4) == this.blockID) { -+ ++var5; -+ } -+ -+ if (par1World.getBlockId(par2, par3, par4 - 1) == this.blockID) { -+ ++var5; -+ } -+ -+ if (par1World.getBlockId(par2, par3, par4 + 1) == this.blockID) { -+ ++var5; -+ } -+ -+ return var5 > 1 ? false : (this.isThereANeighborChest(par1World, par2 - 1, par3, par4) ? false : (this.isThereANeighborChest(par1World, par2 + 1, par3, par4) ? false : (this.isThereANeighborChest(par1World, par2, par3, par4 - 1) ? false : !this.isThereANeighborChest(par1World, par2, par3, par4 + 1)))); -+ } -+ -+ /** -+ * Checks the neighbor blocks to see if there is a chest there. Args: world, x, y, z -+ */ -+ private boolean isThereANeighborChest(World par1World, int par2, int par3, int par4) { -+ return par1World.getBlockId(par2, par3, par4) != this.blockID ? false : (par1World.getBlockId(par2 - 1, par3, par4) == this.blockID ? true : (par1World.getBlockId(par2 + 1, par3, par4) == this.blockID ? true : (par1World.getBlockId(par2, par3, par4 - 1) == this.blockID ? true : par1World.getBlockId(par2, par3, par4 + 1) == this.blockID))); -+ } -+ -+ /** -+ * Lets the block know when one of its neighbor changes. Doesn't know which neighbor changed (coordinates passed are -+ * their own) Args: x, y, z, neighbor blockID -+ */ -+ public void onNeighborBlockChange(World par1World, int par2, int par3, int par4, int par5) { -+ super.onNeighborBlockChange(par1World, par2, par3, par4, par5); -+ TileEntityChest var6 = (TileEntityChest)par1World.getBlockTileEntity(par2, par3, par4); -+ -+ if (var6 != null) { - var6.updateContainingBlockInfo(); - } -- - } - -- public void breakBlock(World var1, int var2, int var3, int var4, int var5, int var6) { -- TileEntityChest var7 = (TileEntityChest)var1.getBlockTileEntity(var2, var3, var4); -- if(var7 != null) { -- for(int var8 = 0; var8 < var7.getSizeInventory(); ++var8) { -+ /** -+ * Called on server worlds only when the block has been replaced by a different block ID, or the same block with a -+ * different metadata value, but before the new metadata value is set. Args: World, x, y, z, old block ID, old metadata -+ */ -+ public void breakBlock(World par1World, int par2, int par3, int par4, int par5, int par6) { -+ TileEntityChest var7 = (TileEntityChest)par1World.getBlockTileEntity(par2, par3, par4); -+ -+ if (var7 != null) { -+ for (int var8 = 0; var8 < var7.getSizeInventory(); ++var8) { - ItemStack var9 = var7.getStackInSlot(var8); -- if(var9 != null) { -- float var10 = this.b.nextFloat() * 0.8F + 0.1F; -- float var11 = this.b.nextFloat() * 0.8F + 0.1F; - -+ if (var9 != null) { -+ float var10 = this.random.nextFloat() * 0.8F + 0.1F; -+ float var11 = this.random.nextFloat() * 0.8F + 0.1F; - EntityItem var14; -- for(float var12 = this.b.nextFloat() * 0.8F + 0.1F; var9.stackSize > 0; var1.spawnEntityInWorld(var14)) { -- int var13 = this.b.nextInt(21) + 10; -- if(var13 > var9.stackSize) { -+ -+ for (float var12 = this.random.nextFloat() * 0.8F + 0.1F; var9.stackSize > 0; par1World.spawnEntityInWorld(var14)) { -+ int var13 = this.random.nextInt(21) + 10; -+ -+ if (var13 > var9.stackSize) { - var13 = var9.stackSize; - } - - var9.stackSize -= var13; -- var14 = new EntityItem(var1, (double)((float)var2 + var10), (double)((float)var3 + var11), (double)((float)var4 + var12), new ItemStack(var9.itemID, var13, var9.getItemDamage())); -+ var14 = new EntityItem(par1World, (double)((float)par2 + var10), (double)((float)par3 + var11), (double)((float)par4 + var12), new ItemStack(var9.itemID, var13, var9.getItemDamage())); - float var15 = 0.05F; -- var14.motionX = (double)((float)this.b.nextGaussian() * var15); -- var14.motionY = (double)((float)this.b.nextGaussian() * var15 + 0.2F); -- var14.motionZ = (double)((float)this.b.nextGaussian() * var15); -- if(var9.hasTagCompound()) { -+ var14.motionX = (double)((float)this.random.nextGaussian() * var15); -+ var14.motionY = (double)((float)this.random.nextGaussian() * var15 + 0.2F); -+ var14.motionZ = (double)((float)this.random.nextGaussian() * var15); -+ -+ if (var9.hasTagCompound()) { - var14.getEntityItem().setTagCompound((NBTTagCompound)var9.getTagCompound().copy()); - } - } - } - } - -- var1.func_96440_m(var2, var3, var4, var5); -- } -- -- super.breakBlock(var1, var2, var3, var4, var5, var6); -- } -- -- public boolean onBlockActivated(World var1, int var2, int var3, int var4, EntityPlayer var5, int var6, float var7, float var8, float var9) { -- if(var1.isRemote) { -- return true; -- } else { -- IInventory var10 = this.getInventory(var1, var2, var3, var4); -- if(var10 != null) { -- var5.displayGUIChest(var10); -- } -- -- return true; -- } -- } -- -- public IInventory getInventory(World var1, int var2, int var3, int var4) { -- Object var5 = (TileEntityChest)var1.getBlockTileEntity(var2, var3, var4); -- if(var5 == null) { -- return null; -- } else if(var1.isBlockNormalCube(var2, var3 + 1, var4)) { -- return null; -- } else if(isOcelotBlockingChest(var1, var2, var3, var4)) { -- return null; -- } else if(var1.getBlockId(var2 - 1, var3, var4) != this.blockID || !var1.isBlockNormalCube(var2 - 1, var3 + 1, var4) && !isOcelotBlockingChest(var1, var2 - 1, var3, var4)) { -- if(var1.getBlockId(var2 + 1, var3, var4) != this.blockID || !var1.isBlockNormalCube(var2 + 1, var3 + 1, var4) && !isOcelotBlockingChest(var1, var2 + 1, var3, var4)) { -- if(var1.getBlockId(var2, var3, var4 - 1) != this.blockID || !var1.isBlockNormalCube(var2, var3 + 1, var4 - 1) && !isOcelotBlockingChest(var1, var2, var3, var4 - 1)) { -- if(var1.getBlockId(var2, var3, var4 + 1) != this.blockID || !var1.isBlockNormalCube(var2, var3 + 1, var4 + 1) && !isOcelotBlockingChest(var1, var2, var3, var4 + 1)) { -- if(var1.getBlockId(var2 - 1, var3, var4) == this.blockID) { -- var5 = new InventoryLargeChest("container.chestDouble", (TileEntityChest)var1.getBlockTileEntity(var2 - 1, var3, var4), (IInventory)var5); -- } -- -- if(var1.getBlockId(var2 + 1, var3, var4) == this.blockID) { -- var5 = new InventoryLargeChest("container.chestDouble", (IInventory)var5, (TileEntityChest)var1.getBlockTileEntity(var2 + 1, var3, var4)); -- } -- -- if(var1.getBlockId(var2, var3, var4 - 1) == this.blockID) { -- var5 = new InventoryLargeChest("container.chestDouble", (TileEntityChest)var1.getBlockTileEntity(var2, var3, var4 - 1), (IInventory)var5); -- } -- -- if(var1.getBlockId(var2, var3, var4 + 1) == this.blockID) { -- var5 = new InventoryLargeChest("container.chestDouble", (IInventory)var5, (TileEntityChest)var1.getBlockTileEntity(var2, var3, var4 + 1)); -- } -- -- return (IInventory)var5; -- } else { -- return null; -- } -- } else { -- return null; -- } -- } else { -- return null; -- } -- } else { -- return null; -- } -- } -- -- public TileEntity createNewTileEntity(World var1) { -+ par1World.func_96440_m(par2, par3, par4, par5); -+ } -+ -+ super.breakBlock(par1World, par2, par3, par4, par5, par6); -+ } -+ -+ /** -+ * Called upon block activation (right click on the block.) -+ */ -+ public boolean onBlockActivated(World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer, int par6, float par7, float par8, float par9) { -+ if (par1World.isRemote) { -+ return true; -+ } else { -+ IInventory var10 = this.getInventory(par1World, par2, par3, par4); -+ -+ if (var10 != null) { -+ par5EntityPlayer.displayGUIChest(var10); -+ } -+ -+ return true; -+ } -+ } -+ -+ /** -+ * Gets the inventory of the chest at the specified coords, accounting for blocks or ocelots on top of the chest, and -+ * double chests. -+ */ -+ public IInventory getInventory(World par1World, int par2, int par3, int par4) { -+ Object var5 = (TileEntityChest)par1World.getBlockTileEntity(par2, par3, par4); -+ -+ if (var5 == null) { -+ return null; -+ } else if (par1World.isBlockNormalCube(par2, par3 + 1, par4)) { -+ return null; -+ } else if (isOcelotBlockingChest(par1World, par2, par3, par4)) { -+ return null; -+ } else if (par1World.getBlockId(par2 - 1, par3, par4) == this.blockID && (par1World.isBlockNormalCube(par2 - 1, par3 + 1, par4) || isOcelotBlockingChest(par1World, par2 - 1, par3, par4))) { -+ return null; -+ } else if (par1World.getBlockId(par2 + 1, par3, par4) == this.blockID && (par1World.isBlockNormalCube(par2 + 1, par3 + 1, par4) || isOcelotBlockingChest(par1World, par2 + 1, par3, par4))) { -+ return null; -+ } else if (par1World.getBlockId(par2, par3, par4 - 1) == this.blockID && (par1World.isBlockNormalCube(par2, par3 + 1, par4 - 1) || isOcelotBlockingChest(par1World, par2, par3, par4 - 1))) { -+ return null; -+ } else if (par1World.getBlockId(par2, par3, par4 + 1) == this.blockID && (par1World.isBlockNormalCube(par2, par3 + 1, par4 + 1) || isOcelotBlockingChest(par1World, par2, par3, par4 + 1))) { -+ return null; -+ } else { -+ if (par1World.getBlockId(par2 - 1, par3, par4) == this.blockID) { -+ var5 = new InventoryLargeChest("container.chestDouble", (TileEntityChest)par1World.getBlockTileEntity(par2 - 1, par3, par4), (IInventory)var5); -+ } -+ -+ if (par1World.getBlockId(par2 + 1, par3, par4) == this.blockID) { -+ var5 = new InventoryLargeChest("container.chestDouble", (IInventory)var5, (TileEntityChest)par1World.getBlockTileEntity(par2 + 1, par3, par4)); -+ } -+ -+ if (par1World.getBlockId(par2, par3, par4 - 1) == this.blockID) { -+ var5 = new InventoryLargeChest("container.chestDouble", (TileEntityChest)par1World.getBlockTileEntity(par2, par3, par4 - 1), (IInventory)var5); -+ } -+ -+ if (par1World.getBlockId(par2, par3, par4 + 1) == this.blockID) { -+ var5 = new InventoryLargeChest("container.chestDouble", (IInventory)var5, (TileEntityChest)par1World.getBlockTileEntity(par2, par3, par4 + 1)); -+ } -+ -+ return (IInventory)var5; -+ } -+ } -+ -+ /** -+ * Returns a new instance of a block's tile entity class. Called on placing the block. -+ */ -+ public TileEntity createNewTileEntity(World par1World) { - TileEntityChest var2 = new TileEntityChest(); - return var2; - } - -+ /** -+ * Can this block provide power. Only wire currently seems to have this change based on its state. -+ */ - public boolean canProvidePower() { - return this.chestType == 1; - } - -- public int isProvidingWeakPower(IBlockAccess var1, int var2, int var3, int var4, int var5) { -- if(!this.canProvidePower()) { -+ /** -+ * Returns true if the block is emitting indirect/weak redstone power on the specified side. If isBlockNormalCube -+ * returns true, standard redstone propagation rules will apply instead and this will not be called. Args: World, X, Y, -+ * Z, side. Note that the side is reversed - eg it is 1 (up) when checking the bottom of the block. -+ */ -+ public int isProvidingWeakPower(IBlockAccess par1IBlockAccess, int par2, int par3, int par4, int par5) { -+ if (!this.canProvidePower()) { - return 0; - } else { -- int var6 = ((TileEntityChest)var1.getBlockTileEntity(var2, var3, var4)).numUsingPlayers; -+ int var6 = ((TileEntityChest)par1IBlockAccess.getBlockTileEntity(par2, par3, par4)).numUsingPlayers; - return MathHelper.clamp_int(var6, 0, 15); - } - } - -- public int isProvidingStrongPower(IBlockAccess var1, int var2, int var3, int var4, int var5) { -- return var5 == 1 ? this.isProvidingWeakPower(var1, var2, var3, var4, var5) : 0; -+ /** -+ * Returns true if the block is emitting direct/strong redstone power on the specified side. Args: World, X, Y, Z, -+ * side. Note that the side is reversed - eg it is 1 (up) when checking the bottom of the block. -+ */ -+ public int isProvidingStrongPower(IBlockAccess par1IBlockAccess, int par2, int par3, int par4, int par5) { -+ return par5 == 1 ? this.isProvidingWeakPower(par1IBlockAccess, par2, par3, par4, par5) : 0; - } - -- private static boolean isOcelotBlockingChest(World var0, int var1, int var2, int var3) { -- Iterator var4 = var0.getEntitiesWithinAABB(EntityOcelot.class, AxisAlignedBB.getAABBPool().getAABB((double)var1, (double)(var2 + 1), (double)var3, (double)(var1 + 1), (double)(var2 + 2), (double)(var3 + 1))).iterator(); -- -+ /** -+ * Looks for a sitting ocelot within certain bounds. Such an ocelot is considered to be blocking access to the chest. -+ */ -+ private static boolean isOcelotBlockingChest(World par0World, int par1, int par2, int par3) { -+ Iterator var4 = par0World.getEntitiesWithinAABB(EntityOcelot.class, AxisAlignedBB.getAABBPool().getAABB((double)par1, (double)(par2 + 1), (double)par3, (double)(par1 + 1), (double)(par2 + 2), (double)(par3 + 1))).iterator(); - EntityOcelot var6; -+ - do { -- if(!var4.hasNext()) { -+ if (!var4.hasNext()) { - return false; - } - - EntityOcelot var5 = (EntityOcelot)var4.next(); - var6 = (EntityOcelot)var5; -- } while(!var6.isSitting()); -+ } while (!var6.isSitting()); - - return true; - } - -+ /** -+ * If this returns true, then comparators facing away from this block will use the value from -+ * getComparatorInputOverride instead of the actual redstone signal strength. -+ */ - public boolean hasComparatorInputOverride() { - return true; - } - -- public int getComparatorInputOverride(World var1, int var2, int var3, int var4, int var5) { -- return Container.calcRedstoneFromInventory(this.getInventory(var1, var2, var3, var4)); -+ /** -+ * If hasComparatorInputOverride returns true, the return value from this is used instead of the redstone signal -+ * strength when this block inputs to a comparator. -+ */ -+ public int getComparatorInputOverride(World par1World, int par2, int par3, int par4, int par5) { -+ return Container.calcRedstoneFromInventory(this.getInventory(par1World, par2, par3, par4)); - } - -- public void registerIcons(IconRegister var1) { -- this.blockIcon = var1.registerIcon("planks_oak"); -+ /** -+ * When this method is called, your block should register all the icons it needs with the given IconRegister. This is -+ * the only chance you get to register icons. -+ */ -+ public void registerIcons(IconRegister par1IconRegister) { -+ this.blockIcon = par1IconRegister.registerIcon("planks_oak"); - } - } ---- net/minecraft/src/CallableServerType.java -+++ net/minecraft/src/CallableServerType.java -@@ -5,8 +5,8 @@ - class CallableServerType implements Callable { - final DedicatedServer theDedicatedServer; - -- CallableServerType(DedicatedServer var1) { -- this.theDedicatedServer = var1; -+ CallableServerType(DedicatedServer par1DedicatedServer) { -+ this.theDedicatedServer = par1DedicatedServer; - } - - public String callServerType() { ---- /dev/null -+++ com/prupe/mcpatcher/ctm/RenderPass$1.java -@@ -1,0 +1,48 @@ -+package com.prupe.mcpatcher.ctm; -+ -+import java.util.Arrays; -+import net.minecraft.src.Block; -+ -+final class RenderPass$1 extends RenderPassAPI { -+ boolean skipDefaultRendering(Block block) { -+ return RenderPass.access$000() > 1; -+ } -+ -+ boolean skipThisRenderPass(Block block, int pass) { -+ if (pass < 0) { -+ pass = block.getRenderBlockPass(); -+ } -+ -+ return pass != RenderPass.access$000(); -+ } -+ -+ void clear() { -+ RenderPass.access$102(1); -+ Arrays.fill(RenderPass.access$200(), -1); -+ Arrays.fill(RenderPass.access$300(), -1); -+ -+ for (int i = 0; i < Block.blocksList.length; ++i) { -+ Block block = Block.blocksList[i]; -+ -+ if (block != null) { -+ RenderPass.access$200()[i] = block.getRenderBlockPass(); -+ } -+ } -+ } -+ -+ void setRenderPassForBlock(Block block, int pass) { -+ if (pass >= 0) { -+ if (pass <= 2) { -+ RenderPass.access$200()[block.blockID] = pass; -+ } else { -+ RenderPass.access$300()[block.blockID] = pass; -+ } -+ -+ RenderPass.access$102(Math.max(RenderPass.access$100(), pass)); -+ } -+ } -+ -+ void finish() { -+ RenderPass.finish(); -+ } -+} ---- /dev/null -+++ com/prupe/mcpatcher/MCPatcherUtils.java -@@ -1,0 +1,410 @@ -+package com.prupe.mcpatcher; -+ -+import java.awt.image.BufferedImage; -+import java.io.Closeable; -+import java.io.File; -+import java.io.IOException; -+import java.io.InputStream; -+import java.lang.reflect.Method; -+import java.util.ArrayList; -+import java.util.Collection; -+import java.util.Map; -+import java.util.Properties; -+import java.util.regex.Matcher; -+import java.util.regex.Pattern; -+import java.util.zip.ZipFile; -+import javax.imageio.ImageIO; -+ -+public class MCPatcherUtils { -+ private static File minecraftDir; -+ private static File gameDir; -+ private static boolean isGame; -+ private static String minecraftVersion; -+ private static String patcherVersion; -+ public static final String EXTENDED_HD = "Extended HD"; -+ public static final String HD_TEXTURES = "HD Textures"; -+ public static final String HD_FONT = "HD Font"; -+ public static final String RANDOM_MOBS = "Random Mobs"; -+ public static final String CUSTOM_COLORS = "Custom Colors"; -+ public static final String CONNECTED_TEXTURES = "Connected Textures"; -+ public static final String BETTER_SKIES = "Better Skies"; -+ public static final String BETTER_GRASS = "Better Grass"; -+ public static final String BETTER_GLASS = "Better Glass"; -+ public static final String CUSTOM_ITEM_TEXTURES = "Custom Item Textures"; -+ public static final String GLSL_SHADERS = "GLSL Shaders"; -+ public static final String BASE_MOD = "__Base"; -+ public static final String BASE_TEXTURE_PACK_MOD = "__TexturePackBase"; -+ public static final String BASE_TILESHEET_MOD = "__TilesheetBase"; -+ public static final String NBT_MOD = "__NBT"; -+ public static final String CUSTOM_ANIMATIONS = "Custom Animations"; -+ public static final String MIPMAP = "Mipmap"; -+ public static final String GL11_CLASS = "org.lwjgl.opengl.GL11"; -+ public static final String UTILS_CLASS = "com.prupe.mcpatcher.MCPatcherUtils"; -+ public static final String LOGGER_CLASS = "com.prupe.mcpatcher.MCLogger"; -+ public static final String CONFIG_CLASS = "com.prupe.mcpatcher.Config"; -+ public static final String JSON_UTILS_CLASS = "com.prupe.mcpatcher.JsonUtils"; -+ public static final String PROFILER_API_CLASS = "com.prupe.mcpatcher.ProfilerAPI"; -+ public static final String INPUT_HANDLER_CLASS = "com.prupe.mcpatcher.InputHandler"; -+ public static final String TEXTURE_PACK_API_CLASS = "com.prupe.mcpatcher.TexturePackAPI"; -+ public static final String TEXTURE_PACK_CHANGE_HANDLER_CLASS = "com.prupe.mcpatcher.TexturePackChangeHandler"; -+ public static final String WEIGHTED_INDEX_CLASS = "com.prupe.mcpatcher.WeightedIndex"; -+ public static final String BLEND_METHOD_CLASS = "com.prupe.mcpatcher.BlendMethod"; -+ public static final String TILE_LOADER_CLASS = "com.prupe.mcpatcher.TileLoader"; -+ public static final String TESSELLATOR_UTILS_CLASS = "com.prupe.mcpatcher.TessellatorUtils"; -+ public static final String AA_HELPER_CLASS = "com.prupe.mcpatcher.hd.AAHelper"; -+ public static final String BORDERED_TEXTURE_CLASS = "com.prupe.mcpatcher.hd.BorderedTexture"; -+ public static final String CUSTOM_ANIMATION_CLASS = "com.prupe.mcpatcher.hd.CustomAnimation"; -+ public static final String FANCY_DIAL_CLASS = "com.prupe.mcpatcher.hd.FancyDial"; -+ public static final String FONT_UTILS_CLASS = "com.prupe.mcpatcher.hd.FontUtils"; -+ public static final String MIPMAP_HELPER_CLASS = "com.prupe.mcpatcher.hd.MipmapHelper"; -+ public static final String FANCY_COMPASS_CLASS = "com.prupe.mcpatcher.hd.FancyCompass"; -+ public static final String TEXTURE_UTILS_CLASS = "com.prupe.mcpatcher.hd.TextureUtils"; -+ public static final String TILE_SIZE_CLASS = "com.prupe.mcpatcher.hd.TileSize"; -+ public static final String NBT_RULE_CLASS = "com.prupe.mcpatcher.NBTRule"; -+ public static final String RANDOM_MOBS_CLASS = "com.prupe.mcpatcher.mob.MobRandomizer"; -+ public static final String MOB_RULE_LIST_CLASS = "com.prupe.mcpatcher.mob.MobRuleList"; -+ public static final String MOB_OVERLAY_CLASS = "com.prupe.mcpatcher.mob.MobOverlay"; -+ public static final String LINE_RENDERER_CLASS = "com.prupe.mcpatcher.mob.LineRenderer"; -+ public static final String COLORIZER_CLASS = "com.prupe.mcpatcher.cc.Colorizer"; -+ public static final String COLORIZE_WORLD_CLASS = "com.prupe.mcpatcher.cc.ColorizeWorld"; -+ public static final String COLORIZE_ITEM_CLASS = "com.prupe.mcpatcher.cc.ColorizeItem"; -+ public static final String COLORIZE_ENTITY_CLASS = "com.prupe.mcpatcher.cc.ColorizeEntity"; -+ public static final String COLORIZE_BLOCK_CLASS = "com.prupe.mcpatcher.cc.ColorizeBlock"; -+ public static final String COLOR_MAP_CLASS = "com.prupe.mcpatcher.cc.ColorMap"; -+ public static final String BIOME_HELPER_CLASS = "com.prupe.mcpatcher.cc.BiomeHelper"; -+ public static final String LIGHTMAP_CLASS = "com.prupe.mcpatcher.cc.Lightmap"; -+ public static final String CTM_UTILS_CLASS = "com.prupe.mcpatcher.ctm.CTMUtils"; -+ public static final String TILE_OVERRIDE_INTERFACE = "com.prupe.mcpatcher.ctm.ITileOverride"; -+ public static final String TILE_OVERRIDE_CLASS = "com.prupe.mcpatcher.ctm.TileOverride"; -+ public static final String TILE_OVERRIDE_IMPL_CLASS = "com.prupe.mcpatcher.ctm.TileOverrideImpl"; -+ public static final String GLASS_PANE_RENDERER_CLASS = "com.prupe.mcpatcher.ctm.GlassPaneRenderer"; -+ public static final String RENDER_PASS_CLASS = "com.prupe.mcpatcher.ctm.RenderPass"; -+ public static final String RENDER_PASS_API_CLASS = "com.prupe.mcpatcher.ctm.RenderPassAPI"; -+ public static final String SUPER_TESSELLATOR_CLASS = "com.prupe.mcpatcher.ctm.SuperTessellator"; -+ public static final String SKY_RENDERER_CLASS = "com.prupe.mcpatcher.sky.SkyRenderer"; -+ public static final String FIREWORKS_HELPER_CLASS = "com.prupe.mcpatcher.sky.FireworksHelper"; -+ public static final String CIT_UTILS_CLASS = "com.prupe.mcpatcher.cit.CITUtils"; -+ public static final String OVERRIDE_BASE_CLASS = "com.prupe.mcpatcher.cit.OverrideBase"; -+ public static final String ITEM_OVERRIDE_CLASS = "com.prupe.mcpatcher.cit.ItemOverride"; -+ public static final String ENCHANTMENT_CLASS = "com.prupe.mcpatcher.cit.Enchantment"; -+ public static final String ENCHANTMENT_LIST_CLASS = "com.prupe.mcpatcher.cit.EnchantmentList"; -+ public static final String ARMOR_OVERRIDE_CLASS = "com.prupe.mcpatcher.cit.ArmorOverride"; -+ public static final String POTION_REPLACER_CLASS = "com.prupe.mcpatcher.cit.PotionReplacer"; -+ public static final String SHADERS_CLASS = "com.prupe.mcpatcher.glsl.Shaders"; -+ public static final String BLANK_PNG = "mcpatcher/blank.png"; -+ -+ static File getDefaultGameDir() { -+ String os = System.getProperty("os.name").toLowerCase(); -+ String baseDir = null; -+ String subDir = ".minecraft"; -+ -+ if (os.contains("win")) { -+ baseDir = System.getenv("APPDATA"); -+ } else if (os.contains("mac")) { -+ subDir = "Library/Application Support/minecraft"; -+ } -+ -+ if (baseDir == null) { -+ baseDir = System.getProperty("user.home"); -+ } -+ -+ return new File(baseDir, subDir); -+ } -+ -+ static boolean setGameDir(File dir) { -+ if (dir != null && dir.isDirectory() && (new File(dir, "assets")).isDirectory() && (new File(dir, "libraries")).isDirectory() && (new File(dir, "versions")).isDirectory() && (new File(dir, "launcher_profiles.json")).isFile()) { -+ minecraftDir = dir.getAbsoluteFile(); -+ } else { -+ minecraftDir = null; -+ } -+ -+ gameDir = minecraftDir; -+ return minecraftDir != null && Config.load(minecraftDir, false); -+ } -+ -+ public static File getMinecraftPath(String ... subdirs) { -+ File f = minecraftDir; -+ String[] arr$ = subdirs; -+ int len$ = subdirs.length; -+ -+ for (int i$ = 0; i$ < len$; ++i$) { -+ String s = arr$[i$]; -+ f = new File(f, s); -+ } -+ -+ return f; -+ } -+ -+ public static File getGamePath(String ... subdirs) { -+ File f = gameDir; -+ String[] arr$ = subdirs; -+ int len$ = subdirs.length; -+ -+ for (int i$ = 0; i$ < len$; ++i$) { -+ String s = arr$[i$]; -+ f = new File(f, s); -+ } -+ -+ return f; -+ } -+ -+ public static boolean isGame() { -+ return isGame; -+ } -+ -+ public static String getStringProperty(Properties properties, String key, String defaultValue) { -+ return properties == null ? defaultValue : properties.getProperty(key, defaultValue).trim(); -+ } -+ -+ public static int getIntProperty(Properties properties, String key, int defaultValue) { -+ if (properties != null) { -+ String value = properties.getProperty(key, "").trim(); -+ -+ if (!value.equals("")) { -+ try { -+ return Integer.parseInt(value); -+ } catch (NumberFormatException var5) { -+ ; -+ } -+ } -+ } -+ -+ return defaultValue; -+ } -+ -+ public static boolean getBooleanProperty(Properties properties, String key, boolean defaultValue) { -+ if (properties != null) { -+ String value = properties.getProperty(key, "").trim().toLowerCase(); -+ -+ if (!value.equals("")) { -+ return Boolean.parseBoolean(value); -+ } -+ } -+ -+ return defaultValue; -+ } -+ -+ public static float getFloatProperty(Properties properties, String key, float defaultValue) { -+ if (properties != null) { -+ String value = properties.getProperty(key, "").trim(); -+ -+ if (!value.equals("")) { -+ try { -+ return Float.parseFloat(value); -+ } catch (NumberFormatException var5) { -+ ; -+ } -+ } -+ } -+ -+ return defaultValue; -+ } -+ -+ public static double getDoubleProperty(Properties properties, String key, double defaultValue) { -+ if (properties != null) { -+ String value = properties.getProperty(key, "").trim(); -+ -+ if (!value.equals("")) { -+ try { -+ return Double.parseDouble(value); -+ } catch (NumberFormatException var6) { -+ ; -+ } -+ } -+ } -+ -+ return defaultValue; -+ } -+ -+ public static void close(Closeable closeable) { -+ if (closeable != null) { -+ try { -+ closeable.close(); -+ } catch (IOException var2) { -+ var2.printStackTrace(); -+ } -+ } -+ } -+ -+ public static void close(ZipFile zip) { -+ if (zip != null) { -+ try { -+ zip.close(); -+ } catch (IOException var2) { -+ var2.printStackTrace(); -+ } -+ } -+ } -+ -+ public static boolean isNullOrEmpty(String s) { -+ return s == null || s.trim().isEmpty(); -+ } -+ -+ public static boolean isNullOrEmpty(Collection c) { -+ return c == null || c.isEmpty(); -+ } -+ -+ public static boolean isNullOrEmpty(Map m) { -+ return m == null || m.isEmpty(); -+ } -+ -+ public static void setMinecraft(File gameDir, File assetsDir, String minecraftVersion, String patcherVersion) { -+ isGame = true; -+ Config.setReadOnly(true); -+ boolean defaultMCDir; -+ -+ if (assetsDir == null) { -+ minecraftDir = getDefaultGameDir(); -+ defaultMCDir = true; -+ } else { -+ minecraftDir = assetsDir.getParentFile().getAbsoluteFile(); -+ defaultMCDir = false; -+ } -+ -+ boolean defaultGameDir; -+ -+ if (gameDir == null) { -+ gameDir = minecraftDir; -+ defaultGameDir = true; -+ } else { -+ gameDir = gameDir.getAbsoluteFile(); -+ defaultGameDir = false; -+ } -+ -+ minecraftVersion = minecraftVersion; -+ patcherVersion = patcherVersion; -+ System.out.println(); -+ System.out.printf("MCPatcherUtils initialized:\n", new Object[0]); -+ System.out.printf("Minecraft directory: %s%s\n", new Object[] {minecraftDir, defaultMCDir ? " (default)" : ""}); -+ System.out.printf("Game directory: %s%s\n", new Object[] {gameDir, defaultGameDir ? " (default)" : ""}); -+ System.out.printf("Minecraft version: %s\n", new Object[] {minecraftVersion}); -+ System.out.printf("MCPatcher version: %s\n", new Object[] {patcherVersion}); -+ System.out.printf("Max heap memory: %.1fMB\n", new Object[] {Float.valueOf((float)Runtime.getRuntime().maxMemory() / 1048576.0F)}); -+ -+ try { -+ Class e = Class.forName("sun.misc.VM"); -+ Method method = e.getDeclaredMethod("maxDirectMemory", new Class[0]); -+ long memory = ((Long)method.invoke((Object)null, new Object[0])).longValue(); -+ System.out.printf("Max direct memory: %.1fMB\n", new Object[] {Float.valueOf((float)memory / 1048576.0F)}); -+ } catch (Throwable var10) { -+ var10.printStackTrace(); -+ } -+ -+ Config.load(minecraftDir, true); -+ //System.out.printf("Launcher profile: %s\n", new Object[] {Config.getInstance().getSelectedProfileName()}); -+ System.out.println(); -+ } -+ -+ public static String getMinecraftVersion() { -+ return minecraftVersion; -+ } -+ -+ public static String getPatcherVersion() { -+ return patcherVersion; -+ } -+ -+ public static BufferedImage readImage(InputStream input) { -+ BufferedImage image = null; -+ -+ if (input != null) { -+ try { -+ image = ImageIO.read(input); -+ } catch (IOException var6) { -+ var6.printStackTrace(); -+ } finally { -+ close((Closeable)input); -+ } -+ } -+ -+ return image; -+ } -+ -+ public static Properties readProperties(InputStream input) { -+ Properties properties = new Properties(); -+ return readProperties(input, properties) ? properties : null; -+ } -+ -+ public static boolean readProperties(InputStream input, Properties properties) { -+ if (input != null && properties != null) { -+ boolean e; -+ -+ try { -+ properties.load(input); -+ e = true; -+ } catch (IOException var6) { -+ var6.printStackTrace(); -+ return false; -+ } finally { -+ close((Closeable)input); -+ } -+ -+ return e; -+ } else { -+ return false; -+ } -+ } -+ -+ public static int[] getImageRGB(BufferedImage image) { -+ if (image == null) { -+ return null; -+ } else { -+ int width = image.getWidth(); -+ int height = image.getHeight(); -+ int[] rgb = new int[width * height]; -+ image.getRGB(0, 0, width, height, rgb, 0, width); -+ return rgb; -+ } -+ } -+ -+ public static int[] parseIntegerList(String list, int minValue, int maxValue) { -+ ArrayList tmpList = new ArrayList(); -+ Pattern p = Pattern.compile("(\\d*)-(\\d*)"); -+ String[] a = list.replace(',', ' ').split("\\s+"); -+ int i = a.length; -+ -+ for (int i$ = 0; i$ < i; ++i$) { -+ String token = a[i$]; -+ -+ try { -+ if (token.matches("\\d+")) { -+ tmpList.add(Integer.valueOf(Integer.parseInt(token))); -+ } else { -+ Matcher e = p.matcher(token); -+ -+ if (e.matches()) { -+ String a1 = e.group(1); -+ String b = e.group(2); -+ int min = a1.equals("") ? minValue : Integer.parseInt(a1); -+ int max = b.equals("") ? maxValue : Integer.parseInt(b); -+ -+ for (int i1 = min; i1 <= max; ++i1) { -+ tmpList.add(Integer.valueOf(i1)); -+ } -+ } -+ } -+ } catch (NumberFormatException var15) { -+ ; -+ } -+ } -+ -+ if (minValue <= maxValue) { -+ int var16 = 0; -+ -+ while (var16 < tmpList.size()) { -+ if (((Integer)tmpList.get(var16)).intValue() >= minValue && ((Integer)tmpList.get(var16)).intValue() <= maxValue) { -+ ++var16; -+ } else { -+ tmpList.remove(var16); -+ } -+ } -+ } -+ -+ int[] var17 = new int[tmpList.size()]; -+ -+ for (i = 0; i < var17.length; ++i) { -+ var17[i] = ((Integer)tmpList.get(i)).intValue(); -+ } -+ -+ return var17; -+ } -+} ---- net/minecraft/src/GuiScreenPendingInvitation.java -+++ net/minecraft/src/GuiScreenPendingInvitation.java -@@ -7,133 +7,143 @@ - public class GuiScreenPendingInvitation extends GuiScreen { - private final GuiScreen field_130061_a; - private GuiScreenPendingInvitationList field_130059_b; -- private List c = Lists.newArrayList(); -+ private List field_130060_c = Lists.newArrayList(); - private int field_130058_d = -1; - -- public GuiScreenPendingInvitation(GuiScreen var1) { -- this.field_130061_a = var1; -+ public GuiScreenPendingInvitation(GuiScreen par1GuiScreen) { -+ this.field_130061_a = par1GuiScreen; - } - -+ /** -+ * Adds the buttons (and other controls) to the screen in question. -+ */ - public void initGui() { - Keyboard.enableRepeatEvents(true); -- this.i.clear(); -+ this.buttonList.clear(); - this.field_130059_b = new GuiScreenPendingInvitationList(this); - (new GuiScreenPendingInvitationINNER1(this)).start(); - this.func_130050_g(); - } - - private void func_130050_g() { -- this.i.add(new GuiButton(1, this.width / 2 - 154, this.height - 52, 153, 20, I18n.getString("mco.invites.button.accept"))); -- this.i.add(new GuiButton(2, this.width / 2 + 6, this.height - 52, 153, 20, I18n.getString("mco.invites.button.reject"))); -- this.i.add(new GuiButton(0, this.width / 2 - 75, this.height - 28, 153, 20, I18n.getString("gui.back"))); -+ this.buttonList.add(new GuiButton(1, this.width / 2 - 154, this.height - 52, 153, 20, I18n.getString("mco.invites.button.accept"))); -+ this.buttonList.add(new GuiButton(2, this.width / 2 + 6, this.height - 52, 153, 20, I18n.getString("mco.invites.button.reject"))); -+ this.buttonList.add(new GuiButton(0, this.width / 2 - 75, this.height - 28, 153, 20, I18n.getString("gui.back"))); - } - -+ /** -+ * Called from the main game loop to update the screen. -+ */ - public void updateScreen() { - super.updateScreen(); - } - -- protected void actionPerformed(GuiButton var1) { -- if(var1.enabled) { -- if(var1.id == 1) { -+ /** -+ * Fired when a control is clicked. This is the equivalent of ActionListener.actionPerformed(ActionEvent e). -+ */ -+ protected void actionPerformed(GuiButton par1GuiButton) { -+ if (par1GuiButton.enabled) { -+ if (par1GuiButton.id == 1) { - this.func_130051_i(); -- } else if(var1.id == 0) { -+ } else if (par1GuiButton.id == 0) { - this.mc.displayGuiScreen(this.field_130061_a); -- } else if(var1.id == 2) { -+ } else if (par1GuiButton.id == 2) { - this.func_130057_h(); - } else { -- this.field_130059_b.actionPerformed(var1); -+ this.field_130059_b.actionPerformed(par1GuiButton); - } -- - } - } - - private void func_130057_h() { -- if(this.field_130058_d >= 0 && this.field_130058_d < this.c.size()) { -+ if (this.field_130058_d >= 0 && this.field_130058_d < this.field_130060_c.size()) { - (new GuiScreenPendingInvitationINNER2(this)).start(); - } -- - } - - private void func_130051_i() { -- if(this.field_130058_d >= 0 && this.field_130058_d < this.c.size()) { -+ if (this.field_130058_d >= 0 && this.field_130058_d < this.field_130060_c.size()) { - (new GuiScreenPendingInvitationINNER3(this)).start(); - } -- - } - - private void func_130047_j() { - int var1 = this.field_130058_d; -- if(this.c.size() - 1 == this.field_130058_d) { -+ -+ if (this.field_130060_c.size() - 1 == this.field_130058_d) { - --this.field_130058_d; - } - -- this.c.remove(var1); -- if(this.c.size() == 0) { -+ this.field_130060_c.remove(var1); -+ -+ if (this.field_130060_c.size() == 0) { - this.field_130058_d = -1; - } -- - } - -- public void drawScreen(int var1, int var2, float var3) { -+ /** -+ * Draws the screen and all the components in it. -+ */ -+ public void drawScreen(int par1, int par2, float par3) { - this.drawDefaultBackground(); -- this.field_130059_b.drawScreen(var1, var2, var3); -+ this.field_130059_b.drawScreen(par1, par2, par3); - this.drawCenteredString(this.fontRenderer, I18n.getString("mco.invites.title"), this.width / 2, 20, 16777215); -- super.drawScreen(var1, var2, var3); -- } -- -- static Minecraft func_130048_a(GuiScreenPendingInvitation var0) { -- return var0.mc; -- } -- -- static List func_130043_a(GuiScreenPendingInvitation var0, List var1) { -- return var0.c = var1; -- } -- -- static Minecraft func_130044_b(GuiScreenPendingInvitation var0) { -- return var0.mc; -- } -- -- static Minecraft func_130041_c(GuiScreenPendingInvitation var0) { -- return var0.mc; -- } -- -- static int func_130049_d(GuiScreenPendingInvitation var0) { -- return var0.field_130058_d; -- } -- -- static List func_130042_e(GuiScreenPendingInvitation var0) { -- return var0.c; -- } -- -- static void func_130040_f(GuiScreenPendingInvitation var0) { -- var0.func_130047_j(); -- } -- -- static Minecraft func_130056_g(GuiScreenPendingInvitation var0) { -- return var0.mc; -- } -- -- static Minecraft func_130046_h(GuiScreenPendingInvitation var0) { -- return var0.mc; -- } -- -- static Minecraft func_130055_i(GuiScreenPendingInvitation var0) { -- return var0.mc; -- } -- -- static Minecraft func_130054_j(GuiScreenPendingInvitation var0) { -- return var0.mc; -- } -- -- static int func_130053_a(GuiScreenPendingInvitation var0, int var1) { -- return var0.field_130058_d = var1; -- } -- -- static FontRenderer func_130045_k(GuiScreenPendingInvitation var0) { -- return var0.fontRenderer; -- } -- -- static FontRenderer func_130052_l(GuiScreenPendingInvitation var0) { -- return var0.fontRenderer; -+ super.drawScreen(par1, par2, par3); -+ } -+ -+ static Minecraft func_130048_a(GuiScreenPendingInvitation par0GuiScreenPendingInvitation) { -+ return par0GuiScreenPendingInvitation.mc; -+ } -+ -+ static List func_130043_a(GuiScreenPendingInvitation par0GuiScreenPendingInvitation, List par1List) { -+ return par0GuiScreenPendingInvitation.field_130060_c = par1List; -+ } -+ -+ static Minecraft func_130044_b(GuiScreenPendingInvitation par0GuiScreenPendingInvitation) { -+ return par0GuiScreenPendingInvitation.mc; -+ } -+ -+ static Minecraft func_130041_c(GuiScreenPendingInvitation par0GuiScreenPendingInvitation) { -+ return par0GuiScreenPendingInvitation.mc; -+ } -+ -+ static int func_130049_d(GuiScreenPendingInvitation par0GuiScreenPendingInvitation) { -+ return par0GuiScreenPendingInvitation.field_130058_d; -+ } -+ -+ static List func_130042_e(GuiScreenPendingInvitation par0GuiScreenPendingInvitation) { -+ return par0GuiScreenPendingInvitation.field_130060_c; -+ } -+ -+ static void func_130040_f(GuiScreenPendingInvitation par0GuiScreenPendingInvitation) { -+ par0GuiScreenPendingInvitation.func_130047_j(); -+ } -+ -+ static Minecraft func_130056_g(GuiScreenPendingInvitation par0GuiScreenPendingInvitation) { -+ return par0GuiScreenPendingInvitation.mc; -+ } -+ -+ static Minecraft func_130046_h(GuiScreenPendingInvitation par0GuiScreenPendingInvitation) { -+ return par0GuiScreenPendingInvitation.mc; -+ } -+ -+ static Minecraft func_130055_i(GuiScreenPendingInvitation par0GuiScreenPendingInvitation) { -+ return par0GuiScreenPendingInvitation.mc; -+ } -+ -+ static Minecraft func_130054_j(GuiScreenPendingInvitation par0GuiScreenPendingInvitation) { -+ return par0GuiScreenPendingInvitation.mc; -+ } -+ -+ static int func_130053_a(GuiScreenPendingInvitation par0GuiScreenPendingInvitation, int par1) { -+ return par0GuiScreenPendingInvitation.field_130058_d = par1; -+ } -+ -+ static FontRenderer func_130045_k(GuiScreenPendingInvitation par0GuiScreenPendingInvitation) { -+ return par0GuiScreenPendingInvitation.fontRenderer; -+ } -+ -+ static FontRenderer func_130052_l(GuiScreenPendingInvitation par0GuiScreenPendingInvitation) { -+ return par0GuiScreenPendingInvitation.fontRenderer; - } - } ---- net/minecraft/src/RecipesMapExtending.java -+++ net/minecraft/src/RecipesMapExtending.java -@@ -2,44 +2,53 @@ - - public class RecipesMapExtending extends ShapedRecipes { - public RecipesMapExtending() { -- super(3, 3, new ItemStack[]{new ItemStack(Item.paper), new ItemStack(Item.paper), new ItemStack(Item.paper), new ItemStack(Item.paper), new ItemStack(Item.map, 0, Short.MAX_VALUE), new ItemStack(Item.paper), new ItemStack(Item.paper), new ItemStack(Item.paper), new ItemStack(Item.paper)}, new ItemStack(Item.emptyMap, 0, 0)); -+ super(3, 3, new ItemStack[] {new ItemStack(Item.paper), new ItemStack(Item.paper), new ItemStack(Item.paper), new ItemStack(Item.paper), new ItemStack(Item.map, 0, 32767), new ItemStack(Item.paper), new ItemStack(Item.paper), new ItemStack(Item.paper), new ItemStack(Item.paper)}, new ItemStack(Item.emptyMap, 0, 0)); - } - -- public boolean matches(InventoryCrafting var1, World var2) { -- if(!super.matches(var1, var2)) { -+ /** -+ * Used to check if a recipe matches current crafting inventory -+ */ -+ public boolean matches(InventoryCrafting par1InventoryCrafting, World par2World) { -+ if (!super.matches(par1InventoryCrafting, par2World)) { - return false; - } else { - ItemStack var3 = null; - -- for(int var4 = 0; var4 < var1.getSizeInventory() && var3 == null; ++var4) { -- ItemStack var5 = var1.getStackInSlot(var4); -- if(var5 != null && var5.itemID == Item.map.itemID) { -+ for (int var4 = 0; var4 < par1InventoryCrafting.getSizeInventory() && var3 == null; ++var4) { -+ ItemStack var5 = par1InventoryCrafting.getStackInSlot(var4); -+ -+ if (var5 != null && var5.itemID == Item.map.itemID) { - var3 = var5; - } - } - -- if(var3 == null) { -+ if (var3 == null) { - return false; - } else { -- MapData var6 = Item.map.getMapData(var3, var2); -+ MapData var6 = Item.map.getMapData(var3, par2World); - return var6 == null ? false : var6.scale < 4; - } - } - } - -- public ItemStack getCraftingResult(InventoryCrafting var1) { -+ /** -+ * Returns an Item that is the result of this recipe -+ */ -+ public ItemStack getCraftingResult(InventoryCrafting par1InventoryCrafting) { - ItemStack var2 = null; - -- for(int var3 = 0; var3 < var1.getSizeInventory() && var2 == null; ++var3) { -- ItemStack var4 = var1.getStackInSlot(var3); -- if(var4 != null && var4.itemID == Item.map.itemID) { -+ for (int var3 = 0; var3 < par1InventoryCrafting.getSizeInventory() && var2 == null; ++var3) { -+ ItemStack var4 = par1InventoryCrafting.getStackInSlot(var3); -+ -+ if (var4 != null && var4.itemID == Item.map.itemID) { - var2 = var4; - } - } - - var2 = var2.copy(); - var2.stackSize = 1; -- if(var2.getTagCompound() == null) { -+ -+ if (var2.getTagCompound() == null) { - var2.setTagCompound(new NBTTagCompound()); - } - ---- net/minecraft/src/PlayerManager.java -+++ net/minecraft/src/PlayerManager.java -@@ -5,121 +5,160 @@ - - public class PlayerManager { - private final WorldServer theWorldServer; -- private final List b = new ArrayList(); -+ -+ /** players in the current instance */ -+ private final List players = new ArrayList(); -+ -+ /** -+ * A map of chunk position (two ints concatenated into a long) to PlayerInstance -+ */ - private final LongHashMap playerInstances = new LongHashMap(); -- private final List d = new ArrayList(); -- private final List e = new ArrayList(); -+ -+ /** -+ * contains a PlayerInstance for every chunk they can see. the "player instance" cotains a list of all players who can -+ * also that chunk -+ */ -+ private final List chunkWatcherWithPlayers = new ArrayList(); -+ -+ /** This field is using when chunk should be processed (every 8000 ticks) */ -+ private final List playerInstanceList = new ArrayList(); -+ -+ /** -+ * Number of chunks the server sends to the client. Valid 3<=x<=15. In server.properties. -+ */ - private final int playerViewRadius; -+ -+ /** time what is using to check if InhabitedTime should be calculated */ - private long previousTotalWorldTime; -- private final int[][] xzDirectionsConst = new int[][]{{1, 0}, {0, 1}, {-1, 0}, {0, -1}}; -- -- public PlayerManager(WorldServer var1, int var2) { -- if(var2 > 15) { -+ -+ /** x, z direction vectors: east, south, west, north */ -+ private final int[][] xzDirectionsConst = new int[][] {{1, 0}, {0, 1}, { -1, 0}, {0, -1}}; -+ -+ public PlayerManager(WorldServer par1WorldServer, int par2) { -+ if (par2 > 15) { - throw new IllegalArgumentException("Too big view radius!"); -- } else if(var2 < 3) { -+ } else if (par2 < 3) { - throw new IllegalArgumentException("Too small view radius!"); - } else { -- this.playerViewRadius = var2; -- this.theWorldServer = var1; -+ this.playerViewRadius = par2; -+ this.theWorldServer = par1WorldServer; - } - } - -- public WorldServer getMinecraftServer() { -+ public WorldServer getWorldServer() { - return this.theWorldServer; - } - -+ /** -+ * updates all the player instances that need to be updated -+ */ - public void updatePlayerInstances() { - long var1 = this.theWorldServer.getTotalWorldTime(); - int var3; - PlayerInstance var4; -- if(var1 - this.previousTotalWorldTime > 8000L) { -+ -+ if (var1 - this.previousTotalWorldTime > 8000L) { - this.previousTotalWorldTime = var1; - -- for(var3 = 0; var3 < this.e.size(); ++var3) { -- var4 = (PlayerInstance)this.e.get(var3); -- var4.onUpdate(); -+ for (var3 = 0; var3 < this.playerInstanceList.size(); ++var3) { -+ var4 = (PlayerInstance)this.playerInstanceList.get(var3); -+ var4.sendChunkUpdate(); - var4.processChunk(); - } - } else { -- for(var3 = 0; var3 < this.d.size(); ++var3) { -- var4 = (PlayerInstance)this.d.get(var3); -- var4.onUpdate(); -+ for (var3 = 0; var3 < this.chunkWatcherWithPlayers.size(); ++var3) { -+ var4 = (PlayerInstance)this.chunkWatcherWithPlayers.get(var3); -+ var4.sendChunkUpdate(); - } - } - -- this.d.clear(); -- if(this.b.isEmpty()) { -+ this.chunkWatcherWithPlayers.clear(); -+ -+ if (this.players.isEmpty()) { - WorldProvider var5 = this.theWorldServer.provider; -- if(!var5.canRespawnHere()) { -+ -+ if (!var5.canRespawnHere()) { - this.theWorldServer.theChunkProviderServer.unloadAllChunks(); - } - } -- - } - -- private PlayerInstance getPlayerInstance(int var1, int var2, boolean var3) { -- long var4 = (long)var1 + 2147483647L | (long)var2 + 2147483647L << 32; -+ private PlayerInstance getOrCreateChunkWatcher(int par1, int par2, boolean par3) { -+ long var4 = (long)par1 + 2147483647L | (long)par2 + 2147483647L << 32; - PlayerInstance var6 = (PlayerInstance)this.playerInstances.getValueByKey(var4); -- if(var6 == null && var3) { -- var6 = new PlayerInstance(this, var1, var2); -+ -+ if (var6 == null && par3) { -+ var6 = new PlayerInstance(this, par1, par2); - this.playerInstances.add(var4, var6); -- this.e.add(var6); -+ this.playerInstanceList.add(var6); - } - - return var6; - } - -- public void markBlockForUpdate(int var1, int var2, int var3) { -- int var4 = var1 >> 4; -- int var5 = var3 >> 4; -- PlayerInstance var6 = this.getPlayerInstance(var4, var5, false); -- if(var6 != null) { -- var6.markBlockNeedsUpdate(var1 & 15, var2, var3 & 15); -+ /** -+ * Called by WorldManager.markBlockForUpdate; marks a block to be resent to clients. -+ */ -+ public void markBlockForUpdate(int par1, int par2, int par3) { -+ int var4 = par1 >> 4; -+ int var5 = par3 >> 4; -+ PlayerInstance var6 = this.getOrCreateChunkWatcher(var4, var5, false); -+ -+ if (var6 != null) { -+ var6.flagChunkForUpdate(par1 & 15, par2, par3 & 15); - } -- - } - -- public void addPlayer(EntityPlayerMP var1) { -- int var2 = (int)var1.posX >> 4; -- int var3 = (int)var1.posZ >> 4; -- var1.managedPosX = var1.posX; -- var1.managedPosZ = var1.posZ; -+ /** -+ * Adds an EntityPlayerMP to the PlayerManager. -+ */ -+ public void addPlayer(EntityPlayerMP par1EntityPlayerMP) { -+ int var2 = (int)par1EntityPlayerMP.posX >> 4; -+ int var3 = (int)par1EntityPlayerMP.posZ >> 4; -+ par1EntityPlayerMP.managedPosX = par1EntityPlayerMP.posX; -+ par1EntityPlayerMP.managedPosZ = par1EntityPlayerMP.posZ; - -- for(int var4 = var2 - this.playerViewRadius; var4 <= var2 + this.playerViewRadius; ++var4) { -- for(int var5 = var3 - this.playerViewRadius; var5 <= var3 + this.playerViewRadius; ++var5) { -- this.getPlayerInstance(var4, var5, true).addPlayer(var1); -+ for (int var4 = var2 - this.playerViewRadius; var4 <= var2 + this.playerViewRadius; ++var4) { -+ for (int var5 = var3 - this.playerViewRadius; var5 <= var3 + this.playerViewRadius; ++var5) { -+ this.getOrCreateChunkWatcher(var4, var5, true).addPlayer(par1EntityPlayerMP); - } - } - -- this.b.add(var1); -- this.filterChunkLoadQueue(var1); -+ this.players.add(par1EntityPlayerMP); -+ this.filterChunkLoadQueue(par1EntityPlayerMP); - } - -- public void filterChunkLoadQueue(EntityPlayerMP var1) { -- ArrayList var2 = new ArrayList(var1.f); -+ /** -+ * Removes all chunks from the given player's chunk load queue that are not in viewing range of the player. -+ */ -+ public void filterChunkLoadQueue(EntityPlayerMP par1EntityPlayerMP) { -+ ArrayList var2 = new ArrayList(par1EntityPlayerMP.loadedChunks); - int var3 = 0; - int var4 = this.playerViewRadius; -- int var5 = (int)var1.posX >> 4; -- int var6 = (int)var1.posZ >> 4; -+ int var5 = (int)par1EntityPlayerMP.posX >> 4; -+ int var6 = (int)par1EntityPlayerMP.posZ >> 4; - int var7 = 0; - int var8 = 0; -- ChunkCoordIntPair var9 = PlayerInstance.getChunkLocation(this.getPlayerInstance(var5, var6, true)); -- var1.f.clear(); -- if(var2.contains(var9)) { -- var1.f.add(var9); -+ ChunkCoordIntPair var9 = PlayerInstance.getChunkLocation(this.getOrCreateChunkWatcher(var5, var6, true)); -+ par1EntityPlayerMP.loadedChunks.clear(); -+ -+ if (var2.contains(var9)) { -+ par1EntityPlayerMP.loadedChunks.add(var9); - } - - int var10; -- for(var10 = 1; var10 <= var4 * 2; ++var10) { -- for(int var11 = 0; var11 < 2; ++var11) { -+ -+ for (var10 = 1; var10 <= var4 * 2; ++var10) { -+ for (int var11 = 0; var11 < 2; ++var11) { - int[] var12 = this.xzDirectionsConst[var3++ % 4]; - -- for(int var13 = 0; var13 < var10; ++var13) { -+ for (int var13 = 0; var13 < var10; ++var13) { - var7 += var12[0]; - var8 += var12[1]; -- var9 = PlayerInstance.getChunkLocation(this.getPlayerInstance(var5 + var7, var6 + var8, true)); -- if(var2.contains(var9)) { -- var1.f.add(var9); -+ var9 = PlayerInstance.getChunkLocation(this.getOrCreateChunkWatcher(var5 + var7, var6 + var8, true)); -+ -+ if (var2.contains(var9)) { -+ par1EntityPlayerMP.loadedChunks.add(var9); - } - } - } -@@ -127,96 +166,116 @@ - - var3 %= 4; - -- for(var10 = 0; var10 < var4 * 2; ++var10) { -+ for (var10 = 0; var10 < var4 * 2; ++var10) { - var7 += this.xzDirectionsConst[var3][0]; - var8 += this.xzDirectionsConst[var3][1]; -- var9 = PlayerInstance.getChunkLocation(this.getPlayerInstance(var5 + var7, var6 + var8, true)); -- if(var2.contains(var9)) { -- var1.f.add(var9); -+ var9 = PlayerInstance.getChunkLocation(this.getOrCreateChunkWatcher(var5 + var7, var6 + var8, true)); -+ -+ if (var2.contains(var9)) { -+ par1EntityPlayerMP.loadedChunks.add(var9); - } - } -- - } - -- public void removePlayer(EntityPlayerMP var1) { -- int var2 = (int)var1.managedPosX >> 4; -- int var3 = (int)var1.managedPosZ >> 4; -- -- for(int var4 = var2 - this.playerViewRadius; var4 <= var2 + this.playerViewRadius; ++var4) { -- for(int var5 = var3 - this.playerViewRadius; var5 <= var3 + this.playerViewRadius; ++var5) { -- PlayerInstance var6 = this.getPlayerInstance(var4, var5, false); -- if(var6 != null) { -- var6.removePlayer(var1); -+ /** -+ * Removes an EntityPlayerMP from the PlayerManager. -+ */ -+ public void removePlayer(EntityPlayerMP par1EntityPlayerMP) { -+ int var2 = (int)par1EntityPlayerMP.managedPosX >> 4; -+ int var3 = (int)par1EntityPlayerMP.managedPosZ >> 4; -+ -+ for (int var4 = var2 - this.playerViewRadius; var4 <= var2 + this.playerViewRadius; ++var4) { -+ for (int var5 = var3 - this.playerViewRadius; var5 <= var3 + this.playerViewRadius; ++var5) { -+ PlayerInstance var6 = this.getOrCreateChunkWatcher(var4, var5, false); -+ -+ if (var6 != null) { -+ var6.removePlayer(par1EntityPlayerMP); - } - } - } - -- this.b.remove(var1); -- } -- -- private boolean overlaps(int var1, int var2, int var3, int var4, int var5) { -- int var6 = var1 - var3; -- int var7 = var2 - var4; -- return var6 >= -var5 && var6 <= var5 ? var7 >= -var5 && var7 <= var5 : false; -- } -- -- public void updateMountedMovingPlayer(EntityPlayerMP var1) { -- int var2 = (int)var1.posX >> 4; -- int var3 = (int)var1.posZ >> 4; -- double var4 = var1.managedPosX - var1.posX; -- double var6 = var1.managedPosZ - var1.posZ; -+ this.players.remove(par1EntityPlayerMP); -+ } -+ -+ /** -+ * Determine if two rectangles centered at the given points overlap for the provided radius. Arguments: x1, z1, x2, z2, -+ * radius. -+ */ -+ private boolean overlaps(int par1, int par2, int par3, int par4, int par5) { -+ int var6 = par1 - par3; -+ int var7 = par2 - par4; -+ return var6 >= -par5 && var6 <= par5 ? var7 >= -par5 && var7 <= par5 : false; -+ } -+ -+ /** -+ * update chunks around a player being moved by server logic (e.g. cart, boat) -+ */ -+ public void updateMountedMovingPlayer(EntityPlayerMP par1EntityPlayerMP) { -+ int var2 = (int)par1EntityPlayerMP.posX >> 4; -+ int var3 = (int)par1EntityPlayerMP.posZ >> 4; -+ double var4 = par1EntityPlayerMP.managedPosX - par1EntityPlayerMP.posX; -+ double var6 = par1EntityPlayerMP.managedPosZ - par1EntityPlayerMP.posZ; - double var8 = var4 * var4 + var6 * var6; -- if(var8 >= 64.0D) { -- int var10 = (int)var1.managedPosX >> 4; -- int var11 = (int)var1.managedPosZ >> 4; -+ -+ if (var8 >= 64.0D) { -+ int var10 = (int)par1EntityPlayerMP.managedPosX >> 4; -+ int var11 = (int)par1EntityPlayerMP.managedPosZ >> 4; - int var12 = this.playerViewRadius; - int var13 = var2 - var10; - int var14 = var3 - var11; -- if(var13 != 0 || var14 != 0) { -- for(int var15 = var2 - var12; var15 <= var2 + var12; ++var15) { -- for(int var16 = var3 - var12; var16 <= var3 + var12; ++var16) { -- if(!this.overlaps(var15, var16, var10, var11, var12)) { -- this.getPlayerInstance(var15, var16, true).addPlayer(var1); -+ -+ if (var13 != 0 || var14 != 0) { -+ for (int var15 = var2 - var12; var15 <= var2 + var12; ++var15) { -+ for (int var16 = var3 - var12; var16 <= var3 + var12; ++var16) { -+ if (!this.overlaps(var15, var16, var10, var11, var12)) { -+ this.getOrCreateChunkWatcher(var15, var16, true).addPlayer(par1EntityPlayerMP); - } - -- if(!this.overlaps(var15 - var13, var16 - var14, var2, var3, var12)) { -- PlayerInstance var17 = this.getPlayerInstance(var15 - var13, var16 - var14, false); -- if(var17 != null) { -- var17.removePlayer(var1); -+ if (!this.overlaps(var15 - var13, var16 - var14, var2, var3, var12)) { -+ PlayerInstance var17 = this.getOrCreateChunkWatcher(var15 - var13, var16 - var14, false); -+ -+ if (var17 != null) { -+ var17.removePlayer(par1EntityPlayerMP); - } - } - } - } - -- this.filterChunkLoadQueue(var1); -- var1.managedPosX = var1.posX; -- var1.managedPosZ = var1.posZ; -+ this.filterChunkLoadQueue(par1EntityPlayerMP); -+ par1EntityPlayerMP.managedPosX = par1EntityPlayerMP.posX; -+ par1EntityPlayerMP.managedPosZ = par1EntityPlayerMP.posZ; - } - } - } - -- public boolean isPlayerWatchingChunk(EntityPlayerMP var1, int var2, int var3) { -- PlayerInstance var4 = this.getPlayerInstance(var2, var3, false); -- return var4 == null ? false : PlayerInstance.getPlayersInChunk(var4).contains(var1) && !var1.f.contains(PlayerInstance.getChunkLocation(var4)); -- } -- -- public static int getFurthestViewableBlock(int var0) { -- return var0 * 16 - 16; -- } -- -- static WorldServer getWorldServer(PlayerManager var0) { -- return var0.theWorldServer; -- } -- -- static LongHashMap getChunkWatchers(PlayerManager var0) { -- return var0.playerInstances; -- } -- -- static List getChunkWatcherList(PlayerManager var0) { -- return var0.e; -- } -- -- static List getChunkWatchersWithPlayers(PlayerManager var0) { -- return var0.d; -+ public boolean isPlayerWatchingChunk(EntityPlayerMP par1EntityPlayerMP, int par2, int par3) { -+ PlayerInstance var4 = this.getOrCreateChunkWatcher(par2, par3, false); -+ return var4 == null ? false : PlayerInstance.getPlayersInChunk(var4).contains(par1EntityPlayerMP) && !par1EntityPlayerMP.loadedChunks.contains(PlayerInstance.getChunkLocation(var4)); -+ } -+ -+ /** -+ * Get the furthest viewable block given player's view distance -+ */ -+ public static int getFurthestViewableBlock(int par0) { -+ return par0 * 16 - 16; -+ } -+ -+ static WorldServer getWorldServer(PlayerManager par0PlayerManager) { -+ return par0PlayerManager.theWorldServer; -+ } -+ -+ static LongHashMap getChunkWatchers(PlayerManager par0PlayerManager) { -+ return par0PlayerManager.playerInstances; -+ } -+ -+ /** -+ * Returns player instances as list -+ */ -+ static List getChunkWatcherList(PlayerManager par0PlayerManager) { -+ return par0PlayerManager.playerInstanceList; -+ } -+ -+ static List getChunkWatchersWithPlayers(PlayerManager par0PlayerManager) { -+ return par0PlayerManager.chunkWatcherWithPlayers; - } - } ---- net/minecraft/src/BlockMycelium.java -+++ net/minecraft/src/BlockMycelium.java -@@ -6,61 +6,80 @@ - private Icon field_94422_a; - private Icon field_94421_b; - -- protected BlockMycelium(int var1) { -- super(var1, Material.grass); -+ protected BlockMycelium(int par1) { -+ super(par1, Material.grass); - this.setTickRandomly(true); - this.setCreativeTab(CreativeTabs.tabBlock); - } - -- public Icon getIcon(int var1, int var2) { -- return var1 == 1 ? this.field_94422_a : (var1 == 0 ? Block.dirt.getBlockTextureFromSide(var1) : this.blockIcon); -+ /** -+ * From the specified side and block metadata retrieves the blocks texture. Args: side, metadata -+ */ -+ public Icon getIcon(int par1, int par2) { -+ return par1 == 1 ? this.field_94422_a : (par1 == 0 ? Block.dirt.getBlockTextureFromSide(par1) : this.blockIcon); - } - -- public Icon getBlockTexture(IBlockAccess var1, int var2, int var3, int var4, int var5) { -- if(var5 == 1) { -+ /** -+ * Retrieves the block texture to use based on the display side. Args: iBlockAccess, x, y, z, side -+ */ -+ public Icon getBlockTexture(IBlockAccess par1IBlockAccess, int par2, int par3, int par4, int par5) { -+ if (par5 == 1) { - return this.field_94422_a; -- } else if(var5 == 0) { -- return Block.dirt.getBlockTextureFromSide(var5); -+ } else if (par5 == 0) { -+ return Block.dirt.getBlockTextureFromSide(par5); - } else { -- Material var6 = var1.getBlockMaterial(var2, var3 + 1, var4); -+ Material var6 = par1IBlockAccess.getBlockMaterial(par2, par3 + 1, par4); - return var6 != Material.snow && var6 != Material.craftedSnow ? this.blockIcon : this.field_94421_b; - } - } - -- public void registerIcons(IconRegister var1) { -- this.blockIcon = var1.registerIcon(this.getTextureName() + "_side"); -- this.field_94422_a = var1.registerIcon(this.getTextureName() + "_top"); -- this.field_94421_b = var1.registerIcon("grass_side_snowed"); -+ /** -+ * When this method is called, your block should register all the icons it needs with the given IconRegister. This is -+ * the only chance you get to register icons. -+ */ -+ public void registerIcons(IconRegister par1IconRegister) { -+ this.blockIcon = par1IconRegister.registerIcon(this.getTextureName() + "_side"); -+ this.field_94422_a = par1IconRegister.registerIcon(this.getTextureName() + "_top"); -+ this.field_94421_b = par1IconRegister.registerIcon("grass_side_snowed"); - } - -- public void updateTick(World var1, int var2, int var3, int var4, Random var5) { -- if(!var1.isRemote) { -- if(var1.getBlockLightValue(var2, var3 + 1, var4) < 4 && Block.lightOpacity[var1.getBlockId(var2, var3 + 1, var4)] > 2) { -- var1.setBlock(var2, var3, var4, Block.dirt.blockID); -- } else if(var1.getBlockLightValue(var2, var3 + 1, var4) >= 9) { -- for(int var6 = 0; var6 < 4; ++var6) { -- int var7 = var2 + var5.nextInt(3) - 1; -- int var8 = var3 + var5.nextInt(5) - 3; -- int var9 = var4 + var5.nextInt(3) - 1; -- int var10 = var1.getBlockId(var7, var8 + 1, var9); -- if(var1.getBlockId(var7, var8, var9) == Block.dirt.blockID && var1.getBlockLightValue(var7, var8 + 1, var9) >= 4 && Block.lightOpacity[var10] <= 2) { -- var1.setBlock(var7, var8, var9, this.blockID); -+ /** -+ * Ticks the block if it's been scheduled -+ */ -+ public void updateTick(World par1World, int par2, int par3, int par4, Random par5Random) { -+ if (!par1World.isRemote) { -+ if (par1World.getBlockLightValue(par2, par3 + 1, par4) < 4 && Block.lightOpacity[par1World.getBlockId(par2, par3 + 1, par4)] > 2) { -+ par1World.setBlock(par2, par3, par4, Block.dirt.blockID); -+ } else if (par1World.getBlockLightValue(par2, par3 + 1, par4) >= 9) { -+ for (int var6 = 0; var6 < 4; ++var6) { -+ int var7 = par2 + par5Random.nextInt(3) - 1; -+ int var8 = par3 + par5Random.nextInt(5) - 3; -+ int var9 = par4 + par5Random.nextInt(3) - 1; -+ int var10 = par1World.getBlockId(var7, var8 + 1, var9); -+ -+ if (par1World.getBlockId(var7, var8, var9) == Block.dirt.blockID && par1World.getBlockLightValue(var7, var8 + 1, var9) >= 4 && Block.lightOpacity[var10] <= 2) { -+ par1World.setBlock(var7, var8, var9, this.blockID); - } - } - } -- -- } -- } -- -- public void randomDisplayTick(World var1, int var2, int var3, int var4, Random var5) { -- super.randomDisplayTick(var1, var2, var3, var4, var5); -- if(var5.nextInt(10) == 0) { -- var1.spawnParticle("townaura", (double)((float)var2 + var5.nextFloat()), (double)((float)var3 + 1.1F), (double)((float)var4 + var5.nextFloat()), 0.0D, 0.0D, 0.0D); -- } -- -- } -- -- public int idDropped(int var1, Random var2, int var3) { -- return Block.dirt.idDropped(0, var2, var3); -+ } -+ } -+ -+ /** -+ * A randomly called display update to be able to add particles or other items for display -+ */ -+ public void randomDisplayTick(World par1World, int par2, int par3, int par4, Random par5Random) { -+ super.randomDisplayTick(par1World, par2, par3, par4, par5Random); -+ -+ if (par5Random.nextInt(10) == 0) { -+ par1World.spawnParticle("townaura", (double)((float)par2 + par5Random.nextFloat()), (double)((float)par3 + 1.1F), (double)((float)par4 + par5Random.nextFloat()), 0.0D, 0.0D, 0.0D); -+ } -+ } -+ -+ /** -+ * Returns the ID of the items to drop on destruction. -+ */ -+ public int idDropped(int par1, Random par2Random, int par3) { -+ return Block.dirt.idDropped(0, par2Random, par3); - } - } ---- net/minecraft/src/IThreadedFileIO.java -+++ net/minecraft/src/IThreadedFileIO.java -@@ -1,5 +1,9 @@ - package net.minecraft.src; - - public interface IThreadedFileIO { -+ -+ /** -+ * Returns a boolean stating if the write was unsuccessful. -+ */ - boolean writeNextIO(); - } ---- net/minecraft/src/ChunkCoordIntPair.java -+++ net/minecraft/src/ChunkCoordIntPair.java -@@ -1,16 +1,23 @@ - package net.minecraft.src; - - public class ChunkCoordIntPair { -+ -+ /** The X position of this Chunk Coordinate Pair */ - public final int chunkXPos; -+ -+ /** The Z position of this Chunk Coordinate Pair */ - public final int chunkZPos; - -- public ChunkCoordIntPair(int var1, int var2) { -- this.chunkXPos = var1; -- this.chunkZPos = var2; -+ public ChunkCoordIntPair(int par1, int par2) { -+ this.chunkXPos = par1; -+ this.chunkZPos = par2; - } - -- public static long chunkXZ2Int(int var0, int var1) { -- return (long)var0 & 4294967295L | ((long)var1 & 4294967295L) << 32; -+ /** -+ * converts a chunk coordinate pair to an integer (suitable for hashing) -+ */ -+ public static long chunkXZ2Int(int par0, int par1) { -+ return (long)par0 & 4294967295L | ((long)par1 & 4294967295L) << 32; - } - - public int hashCode() { -@@ -20,8 +27,8 @@ - return var3 ^ var4; - } - -- public boolean equals(Object var1) { -- ChunkCoordIntPair var2 = (ChunkCoordIntPair)var1; -+ public boolean equals(Object par1Obj) { -+ ChunkCoordIntPair var2 = (ChunkCoordIntPair)par1Obj; - return var2.chunkXPos == this.chunkXPos && var2.chunkZPos == this.chunkZPos; - } - -@@ -33,8 +40,8 @@ - return (this.chunkZPos << 4) + 8; - } - -- public ChunkPosition getChunkPosition(int var1) { -- return new ChunkPosition(this.getCenterXPos(), var1, this.getCenterZPosition()); -+ public ChunkPosition getChunkPosition(int par1) { -+ return new ChunkPosition(this.getCenterXPos(), par1, this.getCenterZPosition()); - } - - public String toString() { ---- net/minecraft/src/BlockOreStorage.java -+++ net/minecraft/src/BlockOreStorage.java -@@ -1,8 +1,8 @@ - package net.minecraft.src; - - public class BlockOreStorage extends Block { -- public BlockOreStorage(int var1) { -- super(var1, Material.iron); -+ public BlockOreStorage(int par1) { -+ super(par1, Material.iron); - this.setCreativeTab(CreativeTabs.tabBlock); - } - } ---- net/minecraft/src/BiomeGenTaiga.java -+++ net/minecraft/src/BiomeGenTaiga.java -@@ -3,14 +3,17 @@ - import java.util.Random; - - public class BiomeGenTaiga extends BiomeGenBase { -- public BiomeGenTaiga(int var1) { -- super(var1); -- this.K.add(new SpawnListEntry(EntityWolf.class, 8, 4, 4)); -+ public BiomeGenTaiga(int par1) { -+ super(par1); -+ this.spawnableCreatureList.add(new SpawnListEntry(EntityWolf.class, 8, 4, 4)); - this.theBiomeDecorator.treesPerChunk = 10; - this.theBiomeDecorator.grassPerChunk = 1; - } - -- public WorldGenerator getRandomWorldGenForTrees(Random var1) { -- return (WorldGenerator)(var1.nextInt(3) == 0 ? new WorldGenTaiga1() : new WorldGenTaiga2(false)); -+ /** -+ * Gets a WorldGen appropriate for this biome. -+ */ -+ public WorldGenerator getRandomWorldGenForTrees(Random par1Random) { -+ return (WorldGenerator)(par1Random.nextInt(3) == 0 ? new WorldGenTaiga1() : new WorldGenTaiga2(false)); - } - } ---- net/minecraft/src/MessageComponentSerializer.java -+++ net/minecraft/src/MessageComponentSerializer.java -@@ -15,9 +15,9 @@ - import java.util.Iterator; - - public class MessageComponentSerializer implements JsonDeserializer, JsonSerializer { -- public ChatMessageComponent deserializeComponent(JsonElement var1, Type var2, JsonDeserializationContext var3) { -+ public ChatMessageComponent deserializeComponent(JsonElement par1JsonElement, Type par2Type, JsonDeserializationContext par3JsonDeserializationContext) { - ChatMessageComponent var4 = new ChatMessageComponent(); -- JsonObject var5 = (JsonObject)var1; -+ JsonObject var5 = (JsonObject)par1JsonElement; - JsonElement var6 = var5.get("text"); - JsonElement var7 = var5.get("translate"); - JsonElement var8 = var5.get("color"); -@@ -25,66 +25,71 @@ - JsonElement var10 = var5.get("italic"); - JsonElement var11 = var5.get("underlined"); - JsonElement var12 = var5.get("obfuscated"); -- if(var8 != null && var8.isJsonPrimitive()) { -+ -+ if (var8 != null && var8.isJsonPrimitive()) { - EnumChatFormatting var13 = EnumChatFormatting.func_96300_b(var8.getAsString()); -- if(var13 == null || !var13.Checks()) { -+ -+ if (var13 == null || !var13.isColor()) { - throw new JsonParseException("Given color (" + var8.getAsString() + ") is not a valid selection"); - } - - var4.setColor(var13); - } - -- if(var9 != null && var9.isJsonPrimitive()) { -+ if (var9 != null && var9.isJsonPrimitive()) { - var4.setBold(Boolean.valueOf(var9.getAsBoolean())); - } - -- if(var10 != null && var10.isJsonPrimitive()) { -+ if (var10 != null && var10.isJsonPrimitive()) { - var4.setItalic(Boolean.valueOf(var10.getAsBoolean())); - } - -- if(var11 != null && var11.isJsonPrimitive()) { -+ if (var11 != null && var11.isJsonPrimitive()) { - var4.setUnderline(Boolean.valueOf(var11.getAsBoolean())); - } - -- if(var12 != null && var12.isJsonPrimitive()) { -+ if (var12 != null && var12.isJsonPrimitive()) { - var4.setObfuscated(Boolean.valueOf(var12.getAsBoolean())); - } - -- if(var6 != null) { -- if(var6.isJsonArray()) { -+ if (var6 != null) { -+ if (var6.isJsonArray()) { - JsonArray var17 = var6.getAsJsonArray(); - Iterator var14 = var17.iterator(); - -- while(var14.hasNext()) { -+ while (var14.hasNext()) { - JsonElement var15 = (JsonElement)var14.next(); -- if(var15.isJsonPrimitive()) { -+ -+ if (var15.isJsonPrimitive()) { - var4.addText(var15.getAsString()); -- } else if(var15.isJsonObject()) { -- var4.appendComponent(this.deserializeComponent(var15, var2, var3)); -+ } else if (var15.isJsonObject()) { -+ var4.appendComponent(this.deserializeComponent(var15, par2Type, par3JsonDeserializationContext)); - } - } -- } else if(var6.isJsonPrimitive()) { -+ } else if (var6.isJsonPrimitive()) { - var4.addText(var6.getAsString()); - } -- } else if(var7 != null && var7.isJsonPrimitive()) { -+ } else if (var7 != null && var7.isJsonPrimitive()) { - JsonElement var18 = var5.get("using"); -- if(var18 != null) { -- if(var18.isJsonArray()) { -+ -+ if (var18 != null) { -+ if (var18.isJsonArray()) { - ArrayList var19 = Lists.newArrayList(); - Iterator var20 = var18.getAsJsonArray().iterator(); - -- while(var20.hasNext()) { -+ while (var20.hasNext()) { - JsonElement var16 = (JsonElement)var20.next(); -- if(var16.isJsonPrimitive()) { -+ -+ if (var16.isJsonPrimitive()) { - var19.add(var16.getAsString()); -- } else if(var16.isJsonObject()) { -- var19.add(this.deserializeComponent(var16, var2, var3)); -+ } else if (var16.isJsonObject()) { -+ var19.add(this.deserializeComponent(var16, par2Type, par3JsonDeserializationContext)); - } - } - - var4.addFormatted(var7.getAsString(), var19.toArray()); -- } else if(var18.isJsonPrimitive()) { -- var4.addFormatted(var7.getAsString(), new Object[]{var18.getAsString()}); -+ } else if (var18.isJsonPrimitive()) { -+ var4.addFormatted(var7.getAsString(), new Object[] {var18.getAsString()}); - } - } else { - var4.addKey(var7.getAsString()); -@@ -94,63 +99,66 @@ - return var4; - } - -- public JsonElement serializeComponent(ChatMessageComponent var1, Type var2, JsonSerializationContext var3) { -+ public JsonElement serializeComponent(ChatMessageComponent par1ChatMessageComponent, Type par2Type, JsonSerializationContext par3JsonSerializationContext) { - JsonObject var4 = new JsonObject(); -- if(var1.getColor() != null) { -- var4.addProperty("color", var1.getColor().func_96297_d()); -- } -- -- if(var1.isBold() != null) { -- var4.addProperty("bold", var1.isBold()); -- } -- -- if(var1.isItalic() != null) { -- var4.addProperty("italic", var1.isItalic()); -- } -- -- if(var1.isUnderline() != null) { -- var4.addProperty("underlined", var1.isUnderline()); -- } -- -- if(var1.isObfuscated() != null) { -- var4.addProperty("obfuscated", var1.isObfuscated()); -- } -- -- if(var1.getText() != null) { -- var4.addProperty("text", var1.getText()); -- } else if(var1.getTranslationKey() != null) { -- var4.addProperty("translate", var1.getTranslationKey()); -- if(var1.getSubComponents() != null && !var1.getSubComponents().isEmpty()) { -- var4.add("using", this.serializeComponentChildren(var1, var2, var3)); -+ -+ if (par1ChatMessageComponent.getColor() != null) { -+ var4.addProperty("color", par1ChatMessageComponent.getColor().func_96297_d()); -+ } -+ -+ if (par1ChatMessageComponent.isBold() != null) { -+ var4.addProperty("bold", par1ChatMessageComponent.isBold()); -+ } -+ -+ if (par1ChatMessageComponent.isItalic() != null) { -+ var4.addProperty("italic", par1ChatMessageComponent.isItalic()); -+ } -+ -+ if (par1ChatMessageComponent.isUnderline() != null) { -+ var4.addProperty("underlined", par1ChatMessageComponent.isUnderline()); -+ } -+ -+ if (par1ChatMessageComponent.isObfuscated() != null) { -+ var4.addProperty("obfuscated", par1ChatMessageComponent.isObfuscated()); -+ } -+ -+ if (par1ChatMessageComponent.getText() != null) { -+ var4.addProperty("text", par1ChatMessageComponent.getText()); -+ } else if (par1ChatMessageComponent.getTranslationKey() != null) { -+ var4.addProperty("translate", par1ChatMessageComponent.getTranslationKey()); -+ -+ if (par1ChatMessageComponent.getSubComponents() != null && !par1ChatMessageComponent.getSubComponents().isEmpty()) { -+ var4.add("using", this.serializeComponentChildren(par1ChatMessageComponent, par2Type, par3JsonSerializationContext)); - } -- } else if(var1.getSubComponents() != null && !var1.getSubComponents().isEmpty()) { -- var4.add("text", this.serializeComponentChildren(var1, var2, var3)); -+ } else if (par1ChatMessageComponent.getSubComponents() != null && !par1ChatMessageComponent.getSubComponents().isEmpty()) { -+ var4.add("text", this.serializeComponentChildren(par1ChatMessageComponent, par2Type, par3JsonSerializationContext)); - } - - return var4; - } - -- private JsonArray serializeComponentChildren(ChatMessageComponent var1, Type var2, JsonSerializationContext var3) { -+ private JsonArray serializeComponentChildren(ChatMessageComponent par1ChatMessageComponent, Type par2Type, JsonSerializationContext par3JsonSerializationContext) { - JsonArray var4 = new JsonArray(); -- Iterator var5 = var1.getSubComponents().iterator(); -+ Iterator var5 = par1ChatMessageComponent.getSubComponents().iterator(); - -- while(var5.hasNext()) { -+ while (var5.hasNext()) { - ChatMessageComponent var6 = (ChatMessageComponent)var5.next(); -- if(var6.getText() != null) { -+ -+ if (var6.getText() != null) { - var4.add(new JsonPrimitive(var6.getText())); - } else { -- var4.add(this.serializeComponent(var6, var2, var3)); -+ var4.add(this.serializeComponent(var6, par2Type, par3JsonSerializationContext)); - } - } - - return var4; - } - -- public Object deserialize(JsonElement var1, Type var2, JsonDeserializationContext var3) { -- return this.deserializeComponent(var1, var2, var3); -+ public Object deserialize(JsonElement par1JsonElement, Type par2Type, JsonDeserializationContext par3JsonDeserializationContext) { -+ return this.deserializeComponent(par1JsonElement, par2Type, par3JsonDeserializationContext); - } - -- public JsonElement serialize(Object var1, Type var2, JsonSerializationContext var3) { -- return this.serializeComponent((ChatMessageComponent)var1, var2, var3); -+ public JsonElement serialize(Object par1Obj, Type par2Type, JsonSerializationContext par3JsonSerializationContext) { -+ return this.serializeComponent((ChatMessageComponent)par1Obj, par2Type, par3JsonSerializationContext); - } - } ---- net/minecraft/src/BlockNetherrack.java -+++ net/minecraft/src/BlockNetherrack.java -@@ -1,8 +1,8 @@ - package net.minecraft.src; - - public class BlockNetherrack extends Block { -- public BlockNetherrack(int var1) { -- super(var1, Material.rock); -+ public BlockNetherrack(int par1) { -+ super(par1, Material.rock); - this.setCreativeTab(CreativeTabs.tabBlock); - } - } ---- /dev/null -+++ org/spoutcraft/client/entity/AbstractProjectile.java -@@ -1,0 +1,37 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.client.entity; -+ -+public abstract class AbstractProjectile extends CraftEntity { -+ private boolean doesBounce; -+ -+ public AbstractProjectile(net.minecraft.src.Entity entity) { -+ super(entity); -+ doesBounce = false; -+ } -+ -+ public boolean doesBounce() { -+ return doesBounce; -+ } -+ -+ public void setBounce(boolean doesBounce) { -+ this.doesBounce = doesBounce; -+ } -+} ---- net/minecraft/src/ItemAnvilBlock.java -+++ net/minecraft/src/ItemAnvilBlock.java -@@ -1,11 +1,14 @@ - package net.minecraft.src; - - public class ItemAnvilBlock extends ItemMultiTextureTile { -- public ItemAnvilBlock(Block var1) { -- super(var1.blockID - 256, var1, BlockAnvil.a); -+ public ItemAnvilBlock(Block par1Block) { -+ super(par1Block.blockID - 256, par1Block, BlockAnvil.statuses); - } - -- public int getMetadata(int var1) { -- return var1 << 2; -+ /** -+ * Returns the metadata of the block which this Item (ItemBlock) can place -+ */ -+ public int getMetadata(int par1) { -+ return par1 << 2; - } - } ---- /dev/null -+++ org/spoutcraft/client/gui/minimap/MinimapModeButton.java -@@ -1,0 +1,68 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.client.gui.minimap; -+ -+import java.util.ArrayList; -+import java.util.List; -+ -+import org.spoutcraft.api.gui.GenericComboBox; -+ -+public class MinimapModeButton extends GenericComboBox { -+ private static final int LIGHTMAP = 0; -+ private static final int CAVEMAP = 1; -+ private static final int HEIGHTMAP = 2; -+ public MinimapModeButton() { -+ setTooltip("Changes the mode of the minimap."); -+ List names = new ArrayList(3); -+ names.add("Light Map"); -+ names.add("Cave Map"); -+ names.add("Height Map"); -+ setItems(names); -+ int selected = HEIGHTMAP; -+ if (MinimapConfig.getInstance().isCavemap()) { -+ selected = CAVEMAP; -+ } -+ if (MinimapConfig.getInstance().isLightmap()) { -+ selected = LIGHTMAP; -+ } -+ setSelection(selected); -+ } -+ -+ @Override -+ public void onSelectionChanged(int i, String text) { -+ switch(i) { -+ case LIGHTMAP: -+ MinimapConfig.getInstance().setLightmap(true); -+ MinimapConfig.getInstance().setCavemap(false); -+ MinimapConfig.getInstance().setHeightmap(false); -+ break; -+ case CAVEMAP: -+ MinimapConfig.getInstance().setLightmap(false); -+ MinimapConfig.getInstance().setCavemap(true); -+ MinimapConfig.getInstance().setHeightmap(false); -+ break; -+ case HEIGHTMAP: -+ MinimapConfig.getInstance().setLightmap(false); -+ MinimapConfig.getInstance().setCavemap(false); -+ MinimapConfig.getInstance().setHeightmap(true); -+ break; -+ } -+ } -+} ---- /dev/null -+++ org/spoutcraft/api/gui/ScreenType.java -@@ -1,0 +1,79 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.api.gui; -+ -+import java.util.HashMap; -+import java.util.Map; -+ -+public enum ScreenType { -+ GAME_SCREEN(0), -+ CHAT_SCREEN(1), -+ CUSTOM_SCREEN(2), -+ PLAYER_INVENTORY(3), -+ CHEST_INVENTORY(4), -+ DISPENSER_INVENTORY(5), -+ FURNACE_INVENTORY(6), -+ INGAME_MENU(7), -+ OPTIONS_MENU(8), -+ VIDEO_SETTINGS_MENU(9), -+ CONTROLS_MENU(10), -+ ACHIEVEMENTS_SCREEN(11), -+ STATISTICS_SCREEN(12), -+ WORKBENCH_INVENTORY(13), -+ SIGN_SCREEN(14), -+ GAME_OVER_SCREEN(15), -+ SLEEP_SCREEN(16), -+ ADD_WAYPOINT(17), -+ BREWING_STAND_INVENTORY(18), -+ PLAYER_INVENTORY_CREATIVE(19), -+ ENCHANTMENT_INVENTORY(20), -+ EDIT_SHORTCUT(21), -+ CHANGE_LANGUAGE(22), -+ MINIMAP_SETTINGS(23), -+ AMBIGUOUS_SHORTCUT(24), -+ CHAT_SETTINGS(25), -+ LIST_EDIT(26), -+ MOVE_MINIMAP(27), -+ OVERVIEW_MAP(28), -+ WIN_GAME(29), -+ CONFIRM_URL(30), -+ UNKNOWN(-1); -+ -+ private final int code; -+ private static Map lookup = new HashMap(); -+ -+ private ScreenType(int code) { -+ this.code = code; -+ } -+ -+ public int getCode() { -+ return code; -+ } -+ -+ public static ScreenType getType(int code) { -+ return lookup.get(code); -+ } -+ -+ static { -+ for (ScreenType type : values()) { -+ lookup.put(type.code, type); -+ } -+ } -+} ---- /dev/null -+++ org/spoutcraft/api/material/item/Coal.java -@@ -1,0 +1,26 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.api.material.item; -+ -+public class Coal extends GenericItem{ -+ public Coal(String name, int id, int data) { -+ super(name, id, data); -+ } -+} ---- net/minecraft/src/ServersideAttributeMap.java -+++ net/minecraft/src/ServersideAttributeMap.java -@@ -8,55 +8,57 @@ - import java.util.Set; - - public class ServersideAttributeMap extends BaseAttributeMap { -- private final Set d = Sets.newHashSet(); -- protected final Map c = new LowerStringMap(); -+ private final Set field_111162_d = Sets.newHashSet(); -+ protected final Map field_111163_c = new LowerStringMap(); - -- public ModifiableAttributeInstance func_111159_c(Attribute var1) { -- return (ModifiableAttributeInstance)super.getAttributeInstance(var1); -+ public ModifiableAttributeInstance func_111159_c(Attribute par1Attribute) { -+ return (ModifiableAttributeInstance)super.getAttributeInstance(par1Attribute); - } - -- public ModifiableAttributeInstance func_111158_b(String var1) { -- AttributeInstance var2 = super.getAttributeInstanceByName(var1); -- if(var2 == null) { -- var2 = (AttributeInstance)this.c.get(var1); -+ public ModifiableAttributeInstance func_111158_b(String par1Str) { -+ AttributeInstance var2 = super.getAttributeInstanceByName(par1Str); -+ -+ if (var2 == null) { -+ var2 = (AttributeInstance)this.field_111163_c.get(par1Str); - } - - return (ModifiableAttributeInstance)var2; - } - -- public AttributeInstance func_111150_b(Attribute var1) { -- if(this.b.containsKey(var1.getAttributeUnlocalizedName())) { -+ public AttributeInstance func_111150_b(Attribute par1Attribute) { -+ if (this.attributesByName.containsKey(par1Attribute.getAttributeUnlocalizedName())) { - throw new IllegalArgumentException("Attribute is already registered!"); - } else { -- ModifiableAttributeInstance var2 = new ModifiableAttributeInstance(this, var1); -- this.b.put(var1.getAttributeUnlocalizedName(), var2); -- if(var1 instanceof RangedAttribute && ((RangedAttribute)var1).func_111116_f() != null) { -- this.c.put(((RangedAttribute)var1).func_111116_f(), var2); -+ ModifiableAttributeInstance var2 = new ModifiableAttributeInstance(this, par1Attribute); -+ this.attributesByName.put(par1Attribute.getAttributeUnlocalizedName(), var2); -+ -+ if (par1Attribute instanceof RangedAttribute && ((RangedAttribute)par1Attribute).func_111116_f() != null) { -+ this.field_111163_c.put(((RangedAttribute)par1Attribute).func_111116_f(), var2); - } - -- this.a.put(var1, var2); -+ this.attributes.put(par1Attribute, var2); - return var2; - } - } - -- public void func_111149_a(ModifiableAttributeInstance var1) { -- if(var1.func_111123_a().getShouldWatch()) { -- this.d.add(var1); -+ public void func_111149_a(ModifiableAttributeInstance par1ModifiableAttributeInstance) { -+ if (par1ModifiableAttributeInstance.func_111123_a().getShouldWatch()) { -+ this.field_111162_d.add(par1ModifiableAttributeInstance); - } -- - } - - public Set func_111161_b() { -- return this.d; -+ return this.field_111162_d; - } - - public Collection func_111160_c() { - HashSet var1 = Sets.newHashSet(); - Iterator var2 = this.getAllAttributes().iterator(); - -- while(var2.hasNext()) { -+ while (var2.hasNext()) { - AttributeInstance var3 = (AttributeInstance)var2.next(); -- if(var3.func_111123_a().getShouldWatch()) { -+ -+ if (var3.func_111123_a().getShouldWatch()) { - var1.add(var3); - } - } -@@ -64,11 +66,11 @@ - return var1; - } - -- public AttributeInstance getAttributeInstanceByName(String var1) { -- return this.func_111158_b(var1); -+ public AttributeInstance getAttributeInstanceByName(String par1Str) { -+ return this.func_111158_b(par1Str); - } - -- public AttributeInstance getAttributeInstance(Attribute var1) { -- return this.func_111159_c(var1); -+ public AttributeInstance getAttributeInstance(Attribute par1Attribute) { -+ return this.func_111159_c(par1Attribute); - } - } ---- net/minecraft/src/EntityHorseGroupData.java -+++ net/minecraft/src/EntityHorseGroupData.java -@@ -4,8 +4,8 @@ - public int field_111107_a; - public int field_111106_b; - -- public EntityHorseGroupData(int var1, int var2) { -- this.field_111107_a = var1; -- this.field_111106_b = var2; -+ public EntityHorseGroupData(int par1, int par2) { -+ this.field_111107_a = par1; -+ this.field_111106_b = par2; - } - } ---- net/minecraft/src/AnvilSaveConverterFileFilter.java -+++ net/minecraft/src/AnvilSaveConverterFileFilter.java -@@ -6,11 +6,11 @@ - class AnvilSaveConverterFileFilter implements FilenameFilter { - final AnvilSaveConverter parent; - -- AnvilSaveConverterFileFilter(AnvilSaveConverter var1) { -- this.parent = var1; -+ AnvilSaveConverterFileFilter(AnvilSaveConverter par1AnvilSaveConverter) { -+ this.parent = par1AnvilSaveConverter; - } - -- public boolean accept(File var1, String var2) { -- return var2.endsWith(".mcr"); -+ public boolean accept(File par1File, String par2Str) { -+ return par2Str.endsWith(".mcr"); - } - } ---- net/minecraft/src/BlockMobSpawner.java -+++ net/minecraft/src/BlockMobSpawner.java -@@ -3,33 +3,52 @@ - import java.util.Random; - - public class BlockMobSpawner extends BlockContainer { -- protected BlockMobSpawner(int var1) { -- super(var1, Material.rock); -+ protected BlockMobSpawner(int par1) { -+ super(par1, Material.rock); - } - -- public TileEntity createNewTileEntity(World var1) { -+ /** -+ * Returns a new instance of a block's tile entity class. Called on placing the block. -+ */ -+ public TileEntity createNewTileEntity(World par1World) { - return new TileEntityMobSpawner(); - } - -- public int idDropped(int var1, Random var2, int var3) { -- return 0; -- } -- -- public int quantityDropped(Random var1) { -- return 0; -- } -- -- public void dropBlockAsItemWithChance(World var1, int var2, int var3, int var4, int var5, float var6, int var7) { -- super.dropBlockAsItemWithChance(var1, var2, var3, var4, var5, var6, var7); -- int var8 = 15 + var1.s.nextInt(15) + var1.s.nextInt(15); -- this.dropXpOnBlockBreak(var1, var2, var3, var4, var8); -- } -- -+ /** -+ * Returns the ID of the items to drop on destruction. -+ */ -+ public int idDropped(int par1, Random par2Random, int par3) { -+ return 0; -+ } -+ -+ /** -+ * Returns the quantity of items to drop on block destruction. -+ */ -+ public int quantityDropped(Random par1Random) { -+ return 0; -+ } -+ -+ /** -+ * Drops the block items with a specified chance of dropping the specified items -+ */ -+ public void dropBlockAsItemWithChance(World par1World, int par2, int par3, int par4, int par5, float par6, int par7) { -+ super.dropBlockAsItemWithChance(par1World, par2, par3, par4, par5, par6, par7); -+ int var8 = 15 + par1World.rand.nextInt(15) + par1World.rand.nextInt(15); -+ this.dropXpOnBlockBreak(par1World, par2, par3, par4, var8); -+ } -+ -+ /** -+ * Is this block (a) opaque and (b) a full 1m cube? This determines whether or not to render the shared face of two -+ * adjacent blocks and also whether the player can attach torches, redstone wire, etc to this block. -+ */ - public boolean isOpaqueCube() { - return false; - } - -- public int idPicked(World var1, int var2, int var3, int var4) { -+ /** -+ * only called by clickMiddleMouseButton , and passed to inventory.setCurrentItem (along with isCreative) -+ */ -+ public int idPicked(World par1World, int par2, int par3, int par4) { - return 0; - } - } ---- net/minecraft/src/GenLayerSmooth.java -+++ net/minecraft/src/GenLayerSmooth.java -@@ -1,44 +1,50 @@ - package net.minecraft.src; - - public class GenLayerSmooth extends GenLayer { -- public GenLayerSmooth(long var1, GenLayer var3) { -- super(var1); -- super.parent = var3; -+ public GenLayerSmooth(long par1, GenLayer par3GenLayer) { -+ super(par1); -+ super.parent = par3GenLayer; - } - -- public int[] getInts(int var1, int var2, int var3, int var4) { -- int var5 = var1 - 1; -- int var6 = var2 - 1; -- int var7 = var3 + 2; -- int var8 = var4 + 2; -+ /** -+ * Returns a list of integer values generated by this layer. These may be interpreted as temperatures, rainfall -+ * amounts, or biomeList[] indices based on the particular GenLayer subclass. -+ */ -+ public int[] getInts(int par1, int par2, int par3, int par4) { -+ int var5 = par1 - 1; -+ int var6 = par2 - 1; -+ int var7 = par3 + 2; -+ int var8 = par4 + 2; - int[] var9 = this.parent.getInts(var5, var6, var7, var8); -- int[] var10 = IntCache.getIntCache(var3 * var4); -+ int[] var10 = IntCache.getIntCache(par3 * par4); - -- for(int var11 = 0; var11 < var4; ++var11) { -- for(int var12 = 0; var12 < var3; ++var12) { -+ for (int var11 = 0; var11 < par4; ++var11) { -+ for (int var12 = 0; var12 < par3; ++var12) { - int var13 = var9[var12 + 0 + (var11 + 1) * var7]; - int var14 = var9[var12 + 2 + (var11 + 1) * var7]; - int var15 = var9[var12 + 1 + (var11 + 0) * var7]; - int var16 = var9[var12 + 1 + (var11 + 2) * var7]; - int var17 = var9[var12 + 1 + (var11 + 1) * var7]; -- if(var13 == var14 && var15 == var16) { -- this.initChunkSeed((long)(var12 + var1), (long)(var11 + var2)); -- if(this.nextInt(2) == 0) { -+ -+ if (var13 == var14 && var15 == var16) { -+ this.initChunkSeed((long)(var12 + par1), (long)(var11 + par2)); -+ -+ if (this.nextInt(2) == 0) { - var17 = var13; - } else { - var17 = var15; - } - } else { -- if(var13 == var14) { -+ if (var13 == var14) { - var17 = var13; - } - -- if(var15 == var16) { -+ if (var15 == var16) { - var17 = var15; - } - } - -- var10[var12 + var11 * var3] = var17; -+ var10[var12 + var11 * par3] = var17; - } - } - ---- net/minecraft/src/EntityDiggingFX.java -+++ net/minecraft/src/EntityDiggingFX.java -@@ -1,22 +1,46 @@ - package net.minecraft.src; - -+import net.minecraft.src.Block; -+import net.minecraft.src.Minecraft; -+ -+import org.newdawn.slick.opengl.Texture; -+import org.spoutcraft.client.item.SpoutItem; -+import org.spoutcraft.api.material.MaterialData; -+import org.spoutcraft.api.block.design.BlockDesign; -+import org.spoutcraft.client.inventory.CraftItemStack; -+import org.spoutcraft.client.io.CustomTextureManager; -+import org.spoutcraft.client.io.FileUtil; -+import org.spoutcraft.client.SpoutClient; -+ - public class EntityDiggingFX extends EntityFX { - private Block blockInstance; -+ -+ // Spout > Lots of things changed in this class. -+ public boolean custom = false; -+ public Texture currentTexture = null; - -- public EntityDiggingFX(World var1, double var2, double var4, double var6, double var8, double var10, double var12, Block var14, int var15) { -- super(var1, var2, var4, var6, var8, var10, var12); -- this.blockInstance = var14; -- this.setParticleIcon(var14.getIcon(0, var15)); -- this.particleGravity = var14.blockParticleGravity; -+ public EntityDiggingFX(World par1World, double par2, double par4, double par6, double par8, double par10, double par12, Block par14Block, int par15) { -+ this(par1World, par2, par4, par6, par8, par10, par12, par14Block, par15, null); -+ } -+ -+ public EntityDiggingFX(World par1World, double par2, double par4, double par6, double par8, double par10, double par12, Block par14Block, int par15, Texture texture) { -+ super(par1World, par2, par4, par6, par8, par10, par12); -+ this.blockInstance = par14Block; -+ this.currentTexture = texture; -+ this.setParticleIcon(par14Block.getIcon(0, par15)); -+ this.particleGravity = par14Block.blockParticleGravity; - this.particleRed = this.particleGreen = this.particleBlue = 0.6F; - this.particleScale /= 2.0F; - } - -- public EntityDiggingFX applyColourMultiplier(int var1, int var2, int var3) { -- if(this.blockInstance == Block.grass) { -+ /** -+ * If the block has a colour multiplier, copies it to this particle and returns this particle. -+ */ -+ public EntityDiggingFX applyColourMultiplier(int par1, int par2, int par3) { -+ if (this.blockInstance == Block.grass) { - return this; - } else { -- int var4 = this.blockInstance.colorMultiplier(this.worldObj, var1, var2, var3); -+ int var4 = this.blockInstance.colorMultiplier(this.worldObj, par1, par2, par3); - this.particleRed *= (float)(var4 >> 16 & 255) / 255.0F; - this.particleGreen *= (float)(var4 >> 8 & 255) / 255.0F; - this.particleBlue *= (float)(var4 & 255) / 255.0F; -@@ -24,11 +48,14 @@ - } - } - -- public EntityDiggingFX applyRenderColor(int var1) { -- if(this.blockInstance == Block.grass) { -+ /** -+ * Creates a new EntityDiggingFX with the block render color applied to the base particle color -+ */ -+ public EntityDiggingFX applyRenderColor(int par1) { -+ if (this.blockInstance == Block.grass) { - return this; - } else { -- int var2 = this.blockInstance.getRenderColor(var1); -+ int var2 = this.blockInstance.getRenderColor(par1); - this.particleRed *= (float)(var2 >> 16 & 255) / 255.0F; - this.particleGreen *= (float)(var2 >> 8 & 255) / 255.0F; - this.particleBlue *= (float)(var2 & 255) / 255.0F; -@@ -40,27 +67,34 @@ - return 1; - } - -- public void renderParticle(Tessellator var1, float var2, float var3, float var4, float var5, float var6, float var7) { -+ public void renderParticle(Tessellator par1Tessellator, float par2, float par3, float par4, float par5, float par6, float par7) { -+ if (this.currentTexture != null) { -+ SpoutClient.getHandle().renderEngine.bindTexture(currentTexture.getTextureID()); -+ } -+ - float var8 = ((float)this.particleTextureIndexX + this.particleTextureJitterX / 4.0F) / 16.0F; -- float var9 = var8 + 0.999F / 64.0F; -+ float var9 = var8 + 0.015609375F; - float var10 = ((float)this.particleTextureIndexY + this.particleTextureJitterY / 4.0F) / 16.0F; -- float var11 = var10 + 0.999F / 64.0F; -+ float var11 = var10 + 0.015609375F; - float var12 = 0.1F * this.particleScale; -- if(this.particleIcon != null) { -+ -+ if (currentTexture == null && this.particleIcon != null) { - var8 = this.particleIcon.getInterpolatedU((double)(this.particleTextureJitterX / 4.0F * 16.0F)); - var9 = this.particleIcon.getInterpolatedU((double)((this.particleTextureJitterX + 1.0F) / 4.0F * 16.0F)); - var10 = this.particleIcon.getInterpolatedV((double)(this.particleTextureJitterY / 4.0F * 16.0F)); - var11 = this.particleIcon.getInterpolatedV((double)((this.particleTextureJitterY + 1.0F) / 4.0F * 16.0F)); - } -+ -+ // ToDo: More work needed here to set the custom X/Y coords of the vertex calculations since we are not using icons for custom blocks. - -- float var13 = (float)(this.prevPosX + (this.posX - this.prevPosX) * (double)var2 - interpPosX); -- float var14 = (float)(this.prevPosY + (this.posY - this.prevPosY) * (double)var2 - interpPosY); -- float var15 = (float)(this.prevPosZ + (this.posZ - this.prevPosZ) * (double)var2 - interpPosZ); -+ float var13 = (float)(this.prevPosX + (this.posX - this.prevPosX) * (double)par2 - interpPosX); -+ float var14 = (float)(this.prevPosY + (this.posY - this.prevPosY) * (double)par2 - interpPosY); -+ float var15 = (float)(this.prevPosZ + (this.posZ - this.prevPosZ) * (double)par2 - interpPosZ); - float var16 = 1.0F; -- var1.setColorOpaque_F(var16 * this.particleRed, var16 * this.particleGreen, var16 * this.particleBlue); -- var1.addVertexWithUV((double)(var13 - var3 * var12 - var6 * var12), (double)(var14 - var4 * var12), (double)(var15 - var5 * var12 - var7 * var12), (double)var8, (double)var11); -- var1.addVertexWithUV((double)(var13 - var3 * var12 + var6 * var12), (double)(var14 + var4 * var12), (double)(var15 - var5 * var12 + var7 * var12), (double)var8, (double)var10); -- var1.addVertexWithUV((double)(var13 + var3 * var12 + var6 * var12), (double)(var14 + var4 * var12), (double)(var15 + var5 * var12 + var7 * var12), (double)var9, (double)var10); -- var1.addVertexWithUV((double)(var13 + var3 * var12 - var6 * var12), (double)(var14 - var4 * var12), (double)(var15 + var5 * var12 - var7 * var12), (double)var9, (double)var11); -+ par1Tessellator.setColorOpaque_F(var16 * this.particleRed, var16 * this.particleGreen, var16 * this.particleBlue); -+ par1Tessellator.addVertexWithUV((double)(var13 - par3 * var12 - par6 * var12), (double)(var14 - par4 * var12), (double)(var15 - par5 * var12 - par7 * var12), (double)var8, (double)var11); -+ par1Tessellator.addVertexWithUV((double)(var13 - par3 * var12 + par6 * var12), (double)(var14 + par4 * var12), (double)(var15 - par5 * var12 + par7 * var12), (double)var8, (double)var10); -+ par1Tessellator.addVertexWithUV((double)(var13 + par3 * var12 + par6 * var12), (double)(var14 + par4 * var12), (double)(var15 + par5 * var12 + par7 * var12), (double)var9, (double)var10); -+ par1Tessellator.addVertexWithUV((double)(var13 + par3 * var12 - par6 * var12), (double)(var14 - par4 * var12), (double)(var15 + par5 * var12 - par7 * var12), (double)var9, (double)var11); - } - } ---- net/minecraft/src/StatCrafting.java -+++ net/minecraft/src/StatCrafting.java -@@ -3,9 +3,9 @@ - public class StatCrafting extends StatBase { - private final int itemID; - -- public StatCrafting(int var1, String var2, int var3) { -- super(var1, var2); -- this.itemID = var3; -+ public StatCrafting(int par1, String par2Str, int par3) { -+ super(par1, par2Str); -+ this.itemID = par3; - } - - public int getItemID() { ---- net/minecraft/src/SyntaxErrorException.java -+++ net/minecraft/src/SyntaxErrorException.java -@@ -5,7 +5,7 @@ - this("commands.generic.snytax", new Object[0]); - } - -- public SyntaxErrorException(String var1, Object... var2) { -- super(var1, var2); -+ public SyntaxErrorException(String par1Str, Object ... par2ArrayOfObj) { -+ super(par1Str, par2ArrayOfObj); - } - } ---- net/minecraft/src/BaseAttributeMap.java -+++ net/minecraft/src/BaseAttributeMap.java -@@ -8,50 +8,49 @@ - import java.util.Map.Entry; - - public abstract class BaseAttributeMap { -- protected final Map a = new HashMap(); -- protected final Map b = new LowerStringMap(); -+ protected final Map attributes = new HashMap(); -+ protected final Map attributesByName = new LowerStringMap(); - -- public AttributeInstance getAttributeInstance(Attribute var1) { -- return (AttributeInstance)this.a.get(var1); -+ public AttributeInstance getAttributeInstance(Attribute par1Attribute) { -+ return (AttributeInstance)this.attributes.get(par1Attribute); - } - -- public AttributeInstance getAttributeInstanceByName(String var1) { -- return (AttributeInstance)this.b.get(var1); -+ public AttributeInstance getAttributeInstanceByName(String par1Str) { -+ return (AttributeInstance)this.attributesByName.get(par1Str); - } - - public abstract AttributeInstance func_111150_b(Attribute var1); - - public Collection getAllAttributes() { -- return this.b.values(); -- } -- -- public void func_111149_a(ModifiableAttributeInstance var1) { -- } -- -- public void removeAttributeModifiers(Multimap var1) { -- Iterator var2 = var1.entries().iterator(); -- -- while(var2.hasNext()) { -+ return this.attributesByName.values(); -+ } -+ -+ public void func_111149_a(ModifiableAttributeInstance par1ModifiableAttributeInstance) {} -+ -+ public void removeAttributeModifiers(Multimap par1Multimap) { -+ Iterator var2 = par1Multimap.entries().iterator(); -+ -+ while (var2.hasNext()) { - Entry var3 = (Entry)var2.next(); - AttributeInstance var4 = this.getAttributeInstanceByName((String)var3.getKey()); -- if(var4 != null) { -+ -+ if (var4 != null) { - var4.removeModifier((AttributeModifier)var3.getValue()); - } - } -- - } - -- public void applyAttributeModifiers(Multimap var1) { -- Iterator var2 = var1.entries().iterator(); -+ public void applyAttributeModifiers(Multimap par1Multimap) { -+ Iterator var2 = par1Multimap.entries().iterator(); - -- while(var2.hasNext()) { -+ while (var2.hasNext()) { - Entry var3 = (Entry)var2.next(); - AttributeInstance var4 = this.getAttributeInstanceByName((String)var3.getKey()); -- if(var4 != null) { -+ -+ if (var4 != null) { - var4.removeModifier((AttributeModifier)var3.getValue()); - var4.applyModifier((AttributeModifier)var3.getValue()); - } - } -- - } - } ---- net/minecraft/src/TileEntityMobSpawner.java -+++ net/minecraft/src/TileEntityMobSpawner.java -@@ -3,21 +3,34 @@ - public class TileEntityMobSpawner extends TileEntity { - private final MobSpawnerBaseLogic field_98050_a = new TileEntityMobSpawnerLogic(this); - -- public void readFromNBT(NBTTagCompound var1) { -- super.readFromNBT(var1); -- this.field_98050_a.readFromNBT(var1); -- } -- -- public void writeToNBT(NBTTagCompound var1) { -- super.writeToNBT(var1); -- this.field_98050_a.writeToNBT(var1); -- } -- -+ /** -+ * Reads a tile entity from NBT. -+ */ -+ public void readFromNBT(NBTTagCompound par1NBTTagCompound) { -+ super.readFromNBT(par1NBTTagCompound); -+ this.field_98050_a.readFromNBT(par1NBTTagCompound); -+ } -+ -+ /** -+ * Writes a tile entity to NBT. -+ */ -+ public void writeToNBT(NBTTagCompound par1NBTTagCompound) { -+ super.writeToNBT(par1NBTTagCompound); -+ this.field_98050_a.writeToNBT(par1NBTTagCompound); -+ } -+ -+ /** -+ * Allows the entity to update its state. Overridden in most subclasses, e.g. the mob spawner uses this to count ticks -+ * and creates a new spawn inside its implementation. -+ */ - public void updateEntity() { - this.field_98050_a.updateSpawner(); - super.updateEntity(); - } - -+ /** -+ * Overriden in a sign to provide the text. -+ */ - public Packet getDescriptionPacket() { - NBTTagCompound var1 = new NBTTagCompound(); - this.writeToNBT(var1); -@@ -25,10 +38,16 @@ - return new Packet132TileEntityData(this.xCoord, this.yCoord, this.zCoord, 1, var1); - } - -- public boolean receiveClientEvent(int var1, int var2) { -- return this.field_98050_a.setDelayToMin(var1) ? true : super.receiveClientEvent(var1, var2); -+ /** -+ * Called when a client event is received with the event number and argument, see World.sendClientEvent -+ */ -+ public boolean receiveClientEvent(int par1, int par2) { -+ return this.field_98050_a.setDelayToMin(par1) ? true : super.receiveClientEvent(par1, par2); - } - -+ /** -+ * Returns the spawner logic associated with this spawner -+ */ - public MobSpawnerBaseLogic getSpawnerLogic() { - return this.field_98050_a; - } ---- net/minecraft/src/EnumOptionsHelper.java -+++ net/minecraft/src/EnumOptionsHelper.java -@@ -7,72 +7,85 @@ - try { - enumOptionsMappingHelperArray[EnumOptions.INVERT_MOUSE.ordinal()] = 1; - } catch (NoSuchFieldError var14) { -+ ; - } - - try { - enumOptionsMappingHelperArray[EnumOptions.VIEW_BOBBING.ordinal()] = 2; - } catch (NoSuchFieldError var13) { -+ ; - } - - try { - enumOptionsMappingHelperArray[EnumOptions.ANAGLYPH.ordinal()] = 3; - } catch (NoSuchFieldError var12) { -+ ; - } - - try { - enumOptionsMappingHelperArray[EnumOptions.ADVANCED_OPENGL.ordinal()] = 4; - } catch (NoSuchFieldError var11) { -+ ; - } - - try { - enumOptionsMappingHelperArray[EnumOptions.RENDER_CLOUDS.ordinal()] = 5; - } catch (NoSuchFieldError var10) { -+ ; - } - - try { - enumOptionsMappingHelperArray[EnumOptions.CHAT_COLOR.ordinal()] = 6; - } catch (NoSuchFieldError var9) { -+ ; - } - - try { - enumOptionsMappingHelperArray[EnumOptions.CHAT_LINKS.ordinal()] = 7; - } catch (NoSuchFieldError var8) { -+ ; - } - - try { - enumOptionsMappingHelperArray[EnumOptions.CHAT_LINKS_PROMPT.ordinal()] = 8; - } catch (NoSuchFieldError var7) { -+ ; - } - - try { - enumOptionsMappingHelperArray[EnumOptions.USE_SERVER_TEXTURES.ordinal()] = 9; - } catch (NoSuchFieldError var6) { -+ ; - } - - try { - enumOptionsMappingHelperArray[EnumOptions.SNOOPER_ENABLED.ordinal()] = 10; - } catch (NoSuchFieldError var5) { -+ ; - } - - try { - enumOptionsMappingHelperArray[EnumOptions.USE_FULLSCREEN.ordinal()] = 11; - } catch (NoSuchFieldError var4) { -+ ; - } - - try { - enumOptionsMappingHelperArray[EnumOptions.ENABLE_VSYNC.ordinal()] = 12; - } catch (NoSuchFieldError var3) { -+ ; - } - - try { - enumOptionsMappingHelperArray[EnumOptions.SHOW_CAPE.ordinal()] = 13; - } catch (NoSuchFieldError var2) { -+ ; - } - - try { - enumOptionsMappingHelperArray[EnumOptions.TOUCHSCREEN.ordinal()] = 14; - } catch (NoSuchFieldError var1) { -+ ; - } -- - } - } ---- /dev/null -+++ org/spoutcraft/client/gui/settings/controls/FavorPerformanceButton.java -@@ -1,0 +1,41 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.client.gui.settings.controls; -+ -+import org.spoutcraft.api.gui.Color; -+import org.spoutcraft.api.gui.GenericRadioButton; -+import org.spoutcraft.api.gui.Label; -+import org.spoutcraft.client.config.Configuration; -+ -+public class FavorPerformanceButton extends GenericRadioButton { -+ Label label; -+ public FavorPerformanceButton(String title, Label label) { -+ super(title); -+ this.label = label; -+ } -+ -+ @Override -+ public void onButtonClick() { -+ Configuration.setAutomatePerformance(true); -+ Configuration.setAutomateMode(0); -+ Configuration.write(); -+ label.setTextColor(new Color(1F, 1F, 1F, 1F)); -+ } -+} ---- net/minecraft/src/EntityAIHurtByTarget.java -+++ net/minecraft/src/EntityAIHurtByTarget.java -@@ -7,28 +7,36 @@ - boolean entityCallsForHelp; - private int field_142052_b; - -- public EntityAIHurtByTarget(EntityCreature var1, boolean var2) { -- super(var1, false); -- this.entityCallsForHelp = var2; -+ public EntityAIHurtByTarget(EntityCreature par1EntityCreature, boolean par2) { -+ super(par1EntityCreature, false); -+ this.entityCallsForHelp = par2; - this.setMutexBits(1); - } - -+ /** -+ * Returns whether the EntityAIBase should begin execution. -+ */ - public boolean shouldExecute() { - int var1 = this.taskOwner.func_142015_aE(); - return var1 != this.field_142052_b && this.isSuitableTarget(this.taskOwner.getAITarget(), false); - } - -+ /** -+ * Execute a one shot task or start executing a continuous task -+ */ - public void startExecuting() { - this.taskOwner.setAttackTarget(this.taskOwner.getAITarget()); - this.field_142052_b = this.taskOwner.func_142015_aE(); -- if(this.entityCallsForHelp) { -+ -+ if (this.entityCallsForHelp) { - double var1 = this.getTargetDistance(); - List var3 = this.taskOwner.worldObj.getEntitiesWithinAABB(this.taskOwner.getClass(), AxisAlignedBB.getAABBPool().getAABB(this.taskOwner.posX, this.taskOwner.posY, this.taskOwner.posZ, this.taskOwner.posX + 1.0D, this.taskOwner.posY + 1.0D, this.taskOwner.posZ + 1.0D).expand(var1, 10.0D, var1)); - Iterator var4 = var3.iterator(); - -- while(var4.hasNext()) { -+ while (var4.hasNext()) { - EntityCreature var5 = (EntityCreature)var4.next(); -- if(this.taskOwner != var5 && var5.getAttackTarget() == null && !var5.isOnSameTeam(this.taskOwner.getAITarget())) { -+ -+ if (this.taskOwner != var5 && var5.getAttackTarget() == null && !var5.isOnSameTeam(this.taskOwner.getAITarget())) { - var5.setAttackTarget(this.taskOwner.getAITarget()); - } - } ---- net/minecraft/src/AbstractTexture.java -+++ net/minecraft/src/AbstractTexture.java -@@ -1,13 +1,26 @@ - package net.minecraft.src; - -+import org.lwjgl.opengl.GL11; -+ - public abstract class AbstractTexture implements TextureObject { -- protected int glTextureId = -1; -+ public int glTextureId = -1; - - public int getGlTextureId() { -- if(this.glTextureId == -1) { -+ if (this.glTextureId == -1) { - this.glTextureId = TextureUtil.glGenTextures(); - } - - return this.glTextureId; -+ } -+ -+ public void unloadGLTexture() { -+ if (this.glTextureId >= 0) { -+ GL11.glDeleteTextures(this.glTextureId); -+ this.glTextureId = -1; -+ } -+ } -+ -+ public void finalize() { -+ this.unloadGLTexture(); - } - } ---- net/minecraft/src/ItemRecord.java -+++ net/minecraft/src/ItemRecord.java -@@ -5,29 +5,40 @@ - import java.util.Map; - - public class ItemRecord extends Item { -- private static final Map b = new HashMap(); -- public final String a; -- -- protected ItemRecord(int var1, String var2) { -- super(var1); -- this.a = var2; -+ -+ /** List of all record items and their names. */ -+ private static final Map records = new HashMap(); -+ -+ /** The name of the record. */ -+ public final String recordName; -+ -+ protected ItemRecord(int par1, String par2Str) { -+ super(par1); -+ this.recordName = par2Str; - this.maxStackSize = 1; - this.setCreativeTab(CreativeTabs.tabMisc); -- b.put(var2, this); -+ records.put(par2Str, this); - } - -- public Icon getIconFromDamage(int var1) { -+ /** -+ * Gets an icon index based on an item's damage value -+ */ -+ public Icon getIconFromDamage(int par1) { - return this.itemIcon; - } - -- public boolean onItemUse(ItemStack var1, EntityPlayer var2, World var3, int var4, int var5, int var6, int var7, float var8, float var9, float var10) { -- if(var3.getBlockId(var4, var5, var6) == Block.jukebox.blockID && var3.getBlockMetadata(var4, var5, var6) == 0) { -- if(var3.isRemote) { -+ /** -+ * Callback for item usage. If the item does something special on right clicking, he will have one of those. Return -+ * True if something happen and false if it don't. This is for ITEMS, not BLOCKS -+ */ -+ public boolean onItemUse(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, World par3World, int par4, int par5, int par6, int par7, float par8, float par9, float par10) { -+ if (par3World.getBlockId(par4, par5, par6) == Block.jukebox.blockID && par3World.getBlockMetadata(par4, par5, par6) == 0) { -+ if (par3World.isRemote) { - return true; - } else { -- ((BlockJukeBox)Block.jukebox).insertRecord(var3, var4, var5, var6, var1); -- var3.playAuxSFXAtEntity((EntityPlayer)null, 1005, var4, var5, var6, this.itemID); -- --var1.stackSize; -+ ((BlockJukeBox)Block.jukebox).insertRecord(par3World, par4, par5, par6, par1ItemStack); -+ par3World.playAuxSFXAtEntity((EntityPlayer)null, 1005, par4, par5, par6, this.itemID); -+ --par1ItemStack.stackSize; - return true; - } - } else { -@@ -35,19 +46,31 @@ - } - } - -- public void addInformation(ItemStack var1, EntityPlayer var2, List var3, boolean var4) { -- var3.add(this.getRecordTitle()); -+ /** -+ * allows items to add custom lines of information to the mouseover description -+ */ -+ public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4) { -+ par3List.add(this.getRecordTitle()); - } - -+ /** -+ * Return the title for this record. -+ */ - public String getRecordTitle() { -- return "C418 - " + this.a; -+ return "C418 - " + this.recordName; - } - -- public EnumRarity getRarity(ItemStack var1) { -+ /** -+ * Return an item rarity from EnumRarity -+ */ -+ public EnumRarity getRarity(ItemStack par1ItemStack) { - return EnumRarity.rare; - } - -- public static ItemRecord getRecord(String var0) { -- return (ItemRecord)b.get(var0); -+ /** -+ * Return the record item corresponding to the given name. -+ */ -+ public static ItemRecord getRecord(String par0Str) { -+ return (ItemRecord)records.get(par0Str); - } - } ---- net/minecraft/src/EntityLightningBolt.java -+++ net/minecraft/src/EntityLightningBolt.java -@@ -3,88 +3,114 @@ - import java.util.List; - - public class EntityLightningBolt extends EntityWeatherEffect { -+ -+ /** -+ * Declares which state the lightning bolt is in. Whether it's in the air, hit the ground, etc. -+ */ - private int lightningState; -+ -+ /** -+ * A random long that is used to change the vertex of the lightning rendered in RenderLightningBolt -+ */ - public long boltVertex; -+ -+ /** -+ * Determines the time before the EntityLightningBolt is destroyed. It is a random integer decremented over time. -+ */ - private int boltLivingTime; - -- public EntityLightningBolt(World var1, double var2, double var4, double var6) { -- super(var1); -- this.setLocationAndAngles(var2, var4, var6, 0.0F, 0.0F); -+ public EntityLightningBolt(World par1World, double par2, double par4, double par6) { -+ super(par1World); -+ this.setLocationAndAngles(par2, par4, par6, 0.0F, 0.0F); - this.lightningState = 2; -- this.boltVertex = this.ab.nextLong(); -- this.boltLivingTime = this.ab.nextInt(3) + 1; -- if(!var1.isRemote && var1.getGameRules().getGameRuleBooleanValue("doFireTick") && var1.difficultySetting >= 2 && var1.doChunksNearChunkExist(MathHelper.floor_double(var2), MathHelper.floor_double(var4), MathHelper.floor_double(var6), 10)) { -- int var8 = MathHelper.floor_double(var2); -- int var9 = MathHelper.floor_double(var4); -- int var10 = MathHelper.floor_double(var6); -- if(var1.getBlockId(var8, var9, var10) == 0 && Block.fire.canPlaceBlockAt(var1, var8, var9, var10)) { -- var1.setBlock(var8, var9, var10, Block.fire.blockID); -+ this.boltVertex = this.rand.nextLong(); -+ this.boltLivingTime = this.rand.nextInt(3) + 1; -+ -+ if (!par1World.isRemote && par1World.getGameRules().getGameRuleBooleanValue("doFireTick") && par1World.difficultySetting >= 2 && par1World.doChunksNearChunkExist(MathHelper.floor_double(par2), MathHelper.floor_double(par4), MathHelper.floor_double(par6), 10)) { -+ int var8 = MathHelper.floor_double(par2); -+ int var9 = MathHelper.floor_double(par4); -+ int var10 = MathHelper.floor_double(par6); -+ -+ if (par1World.getBlockId(var8, var9, var10) == 0 && Block.fire.canPlaceBlockAt(par1World, var8, var9, var10)) { -+ par1World.setBlock(var8, var9, var10, Block.fire.blockID); - } - -- for(var8 = 0; var8 < 4; ++var8) { -- var9 = MathHelper.floor_double(var2) + this.ab.nextInt(3) - 1; -- var10 = MathHelper.floor_double(var4) + this.ab.nextInt(3) - 1; -- int var11 = MathHelper.floor_double(var6) + this.ab.nextInt(3) - 1; -- if(var1.getBlockId(var9, var10, var11) == 0 && Block.fire.canPlaceBlockAt(var1, var9, var10, var11)) { -- var1.setBlock(var9, var10, var11, Block.fire.blockID); -+ for (var8 = 0; var8 < 4; ++var8) { -+ var9 = MathHelper.floor_double(par2) + this.rand.nextInt(3) - 1; -+ var10 = MathHelper.floor_double(par4) + this.rand.nextInt(3) - 1; -+ int var11 = MathHelper.floor_double(par6) + this.rand.nextInt(3) - 1; -+ -+ if (par1World.getBlockId(var9, var10, var11) == 0 && Block.fire.canPlaceBlockAt(par1World, var9, var10, var11)) { -+ par1World.setBlock(var9, var10, var11, Block.fire.blockID); - } - } - } -- - } - -+ /** -+ * Called to update the entity's position/logic. -+ */ - public void onUpdate() { - super.onUpdate(); -- if(this.lightningState == 2) { -- this.worldObj.playSoundEffect(this.posX, this.posY, this.posZ, "ambient.weather.thunder", 10000.0F, 0.8F + this.ab.nextFloat() * 0.2F); -- this.worldObj.playSoundEffect(this.posX, this.posY, this.posZ, "random.explode", 2.0F, 0.5F + this.ab.nextFloat() * 0.2F); -+ -+ if (this.lightningState == 2) { -+ this.worldObj.playSoundEffect(this.posX, this.posY, this.posZ, "ambient.weather.thunder", 10000.0F, 0.8F + this.rand.nextFloat() * 0.2F); -+ this.worldObj.playSoundEffect(this.posX, this.posY, this.posZ, "random.explode", 2.0F, 0.5F + this.rand.nextFloat() * 0.2F); - } - - --this.lightningState; -- if(this.lightningState < 0) { -- if(this.boltLivingTime == 0) { -+ -+ if (this.lightningState < 0) { -+ if (this.boltLivingTime == 0) { - this.setDead(); -- } else if(this.lightningState < -this.ab.nextInt(10)) { -+ } else if (this.lightningState < -this.rand.nextInt(10)) { - --this.boltLivingTime; - this.lightningState = 1; -- this.boltVertex = this.ab.nextLong(); -- if(!this.worldObj.isRemote && this.worldObj.getGameRules().getGameRuleBooleanValue("doFireTick") && this.worldObj.doChunksNearChunkExist(MathHelper.floor_double(this.posX), MathHelper.floor_double(this.posY), MathHelper.floor_double(this.posZ), 10)) { -+ this.boltVertex = this.rand.nextLong(); -+ -+ if (!this.worldObj.isRemote && this.worldObj.getGameRules().getGameRuleBooleanValue("doFireTick") && this.worldObj.doChunksNearChunkExist(MathHelper.floor_double(this.posX), MathHelper.floor_double(this.posY), MathHelper.floor_double(this.posZ), 10)) { - int var1 = MathHelper.floor_double(this.posX); - int var2 = MathHelper.floor_double(this.posY); - int var3 = MathHelper.floor_double(this.posZ); -- if(this.worldObj.getBlockId(var1, var2, var3) == 0 && Block.fire.canPlaceBlockAt(this.worldObj, var1, var2, var3)) { -+ -+ if (this.worldObj.getBlockId(var1, var2, var3) == 0 && Block.fire.canPlaceBlockAt(this.worldObj, var1, var2, var3)) { - this.worldObj.setBlock(var1, var2, var3, Block.fire.blockID); - } - } - } - } - -- if(this.lightningState >= 0) { -- if(this.worldObj.isRemote) { -+ if (this.lightningState >= 0) { -+ if (this.worldObj.isRemote) { - this.worldObj.lastLightningBolt = 2; - } else { - double var6 = 3.0D; - List var7 = this.worldObj.getEntitiesWithinAABBExcludingEntity(this, AxisAlignedBB.getAABBPool().getAABB(this.posX - var6, this.posY - var6, this.posZ - var6, this.posX + var6, this.posY + 6.0D + var6, this.posZ + var6)); - -- for(int var4 = 0; var4 < var7.size(); ++var4) { -+ for (int var4 = 0; var4 < var7.size(); ++var4) { - Entity var5 = (Entity)var7.get(var4); - var5.onStruckByLightning(this); - } - } - } -- -- } -- -- protected void entityInit() { -- } -- -- protected void readEntityFromNBT(NBTTagCompound var1) { -- } -- -- protected void writeEntityToNBT(NBTTagCompound var1) { -- } -- -- public boolean isInRangeToRenderVec3D(Vec3 var1) { -+ } -+ -+ protected void entityInit() {} -+ -+ /** -+ * (abstract) Protected helper method to read subclass entity data from NBT. -+ */ -+ protected void readEntityFromNBT(NBTTagCompound par1NBTTagCompound) {} -+ -+ /** -+ * (abstract) Protected helper method to write subclass entity data to NBT. -+ */ -+ protected void writeEntityToNBT(NBTTagCompound par1NBTTagCompound) {} -+ -+ /** -+ * Checks using a Vec3d to determine if this entity is within range of that vector to be rendered. Args: vec3D -+ */ -+ public boolean isInRangeToRenderVec3D(Vec3 par1Vec3) { - return this.lightningState >= 0; - } - } ---- net/minecraft/client/ClientBrandRetriever.java -+++ net/minecraft/client/ClientBrandRetriever.java -@@ -2,6 +2,6 @@ - - public class ClientBrandRetriever { - public static String getClientModName() { -- return "vanilla"; -+ return "spoutcraft"; - } - } ---- net/minecraft/src/WorldClientINNER3.java -+++ net/minecraft/src/WorldClientINNER3.java -@@ -5,8 +5,8 @@ - class WorldClientINNER3 implements Callable { - final WorldClient theWorldClient; - -- WorldClientINNER3(WorldClient var1) { -- this.theWorldClient = var1; -+ WorldClientINNER3(WorldClient par1WorldClient) { -+ this.theWorldClient = par1WorldClient; - } - - public String func_142026_a() { ---- net/minecraft/src/CreativeTabTools.java -+++ net/minecraft/src/CreativeTabTools.java -@@ -1,10 +1,13 @@ - package net.minecraft.src; - - final class CreativeTabTools extends CreativeTabs { -- CreativeTabTools(int var1, String var2) { -- super(var1, var2); -+ CreativeTabTools(int par1, String par2Str) { -+ super(par1, par2Str); - } - -+ /** -+ * the itemID for the item to be displayed on the tab -+ */ - public int getTabIconItemIndex() { - return Item.swordGold.itemID; - } ---- net/minecraft/src/GuiButtonMerchant.java -+++ net/minecraft/src/GuiButtonMerchant.java -@@ -3,27 +3,35 @@ - import org.lwjgl.opengl.GL11; - - class GuiButtonMerchant extends GuiButton { -+ -+ /** -+ * If true, then next page button will face to right, if false then next page button will face to left. -+ */ - private final boolean mirrored; - -- public GuiButtonMerchant(int var1, int var2, int var3, boolean var4) { -- super(var1, var2, var3, 12, 19, ""); -- this.mirrored = var4; -+ public GuiButtonMerchant(int par1, int par2, int par3, boolean par4) { -+ super(par1, par2, par3, 12, 19, ""); -+ this.mirrored = par4; - } - -- public void drawButton(Minecraft var1, int var2, int var3) { -- if(this.drawButton) { -- var1.getTextureManager().bindTexture(GuiMerchant.func_110417_h()); -+ /** -+ * Draws this button to the screen. -+ */ -+ public void drawButton(Minecraft par1Minecraft, int par2, int par3) { -+ if (this.drawButton) { -+ par1Minecraft.getTextureManager().bindTexture(GuiMerchant.func_110417_h()); - GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); -- boolean var4 = var2 >= this.xPosition && var3 >= this.yPosition && var2 < this.xPosition + this.width && var3 < this.yPosition + this.height; -+ boolean var4 = par2 >= this.xPosition && par3 >= this.yPosition && par2 < this.xPosition + this.width && par3 < this.yPosition + this.height; - int var5 = 0; - int var6 = 176; -- if(!this.enabled) { -+ -+ if (!this.enabled) { - var6 += this.width * 2; -- } else if(var4) { -+ } else if (var4) { - var6 += this.width; - } - -- if(!this.mirrored) { -+ if (!this.mirrored) { - var5 += this.height; - } - ---- net/minecraft/src/AnvilSaveConverter.java -+++ net/minecraft/src/AnvilSaveConverter.java -@@ -1,8 +1,6 @@ - package net.minecraft.src; - --import java.io.DataInput; - import java.io.DataInputStream; --import java.io.DataOutput; - import java.io.DataOutputStream; - import java.io.File; - import java.io.IOException; -@@ -14,26 +12,29 @@ - import net.minecraft.server.MinecraftServer; - - public class AnvilSaveConverter extends SaveFormatOld { -- public AnvilSaveConverter(File var1) { -- super(var1); -+ public AnvilSaveConverter(File par1File) { -+ super(par1File); - } - - public List getSaveList() throws AnvilConverterException { -- if(this.a != null && this.a.exists() && this.a.isDirectory()) { -+ if (this.savesDirectory != null && this.savesDirectory.exists() && this.savesDirectory.isDirectory()) { - ArrayList var1 = new ArrayList(); -- File[] var2 = this.a.listFiles(); -+ File[] var2 = this.savesDirectory.listFiles(); - File[] var3 = var2; - int var4 = var2.length; - -- for(int var5 = 0; var5 < var4; ++var5) { -+ for (int var5 = 0; var5 < var4; ++var5) { - File var6 = var3[var5]; -- if(var6.isDirectory()) { -+ -+ if (var6.isDirectory()) { - String var7 = var6.getName(); - WorldInfo var8 = this.getWorldInfo(var7); -- if(var8 != null && (var8.getSaveVersion() == 19132 || var8.getSaveVersion() == 19133)) { -+ -+ if (var8 != null && (var8.getSaveVersion() == 19132 || var8.getSaveVersion() == 19133)) { - boolean var9 = var8.getSaveVersion() != this.getSaveVersion(); - String var10 = var8.getWorldName(); -- if(var10 == null || MathHelper.stringNullOrLengthZero(var10)) { -+ -+ if (var10 == null || MathHelper.stringNullOrLengthZero(var10)) { - var10 = var7; - } - -@@ -57,121 +58,143 @@ - RegionFileCache.clearRegionFileReferences(); - } - -- public ISaveHandler getSaveLoader(String var1, boolean var2) { -- return new AnvilSaveHandler(this.a, var1, var2); -+ /** -+ * Returns back a loader for the specified save directory -+ */ -+ public ISaveHandler getSaveLoader(String par1Str, boolean par2) { -+ return new AnvilSaveHandler(this.savesDirectory, par1Str, par2); - } - -- public boolean isOldMapFormat(String var1) { -- WorldInfo var2 = this.getWorldInfo(var1); -+ /** -+ * Checks if the save directory uses the old map format -+ */ -+ public boolean isOldMapFormat(String par1Str) { -+ WorldInfo var2 = this.getWorldInfo(par1Str); - return var2 != null && var2.getSaveVersion() != this.getSaveVersion(); - } - -- public boolean convertMapFormat(String var1, IProgressUpdate var2) { -- var2.setLoadingProgress(0); -+ /** -+ * Converts the specified map to the new map format. Args: worldName, loadingScreen -+ */ -+ public boolean convertMapFormat(String par1Str, IProgressUpdate par2IProgressUpdate) { -+ par2IProgressUpdate.setLoadingProgress(0); - ArrayList var3 = new ArrayList(); - ArrayList var4 = new ArrayList(); - ArrayList var5 = new ArrayList(); -- File var6 = new File(this.a, var1); -+ File var6 = new File(this.savesDirectory, par1Str); - File var7 = new File(var6, "DIM-1"); - File var8 = new File(var6, "DIM1"); - MinecraftServer.getServer().getLogAgent().logInfo("Scanning folders..."); - this.addRegionFilesToCollection(var6, var3); -- if(var7.exists()) { -+ -+ if (var7.exists()) { - this.addRegionFilesToCollection(var7, var4); - } - -- if(var8.exists()) { -+ if (var8.exists()) { - this.addRegionFilesToCollection(var8, var5); - } - - int var9 = var3.size() + var4.size() + var5.size(); - MinecraftServer.getServer().getLogAgent().logInfo("Total conversion count is " + var9); -- WorldInfo var10 = this.getWorldInfo(var1); -+ WorldInfo var10 = this.getWorldInfo(par1Str); - Object var11 = null; -- if(var10.getTerrainType() == WorldType.FLAT) { -+ -+ if (var10.getTerrainType() == WorldType.FLAT) { - var11 = new WorldChunkManagerHell(BiomeGenBase.plains, 0.5F, 0.5F); - } else { - var11 = new WorldChunkManager(var10.getSeed(), var10.getTerrainType()); - } - -- this.convertFile(new File(var6, "region"), var3, (WorldChunkManager)var11, 0, var9, var2); -- this.convertFile(new File(var7, "region"), var4, new WorldChunkManagerHell(BiomeGenBase.hell, 1.0F, 0.0F), var3.size(), var9, var2); -- this.convertFile(new File(var8, "region"), var5, new WorldChunkManagerHell(BiomeGenBase.sky, 0.5F, 0.0F), var3.size() + var4.size(), var9, var2); -+ this.convertFile(new File(var6, "region"), var3, (WorldChunkManager)var11, 0, var9, par2IProgressUpdate); -+ this.convertFile(new File(var7, "region"), var4, new WorldChunkManagerHell(BiomeGenBase.hell, 1.0F, 0.0F), var3.size(), var9, par2IProgressUpdate); -+ this.convertFile(new File(var8, "region"), var5, new WorldChunkManagerHell(BiomeGenBase.sky, 0.5F, 0.0F), var3.size() + var4.size(), var9, par2IProgressUpdate); - var10.setSaveVersion(19133); -- if(var10.getTerrainType() == WorldType.DEFAULT_1_1) { -+ -+ if (var10.getTerrainType() == WorldType.DEFAULT_1_1) { - var10.setTerrainType(WorldType.DEFAULT); - } - -- this.createFile(var1); -- ISaveHandler var12 = this.getSaveLoader(var1, false); -+ this.createFile(par1Str); -+ ISaveHandler var12 = this.getSaveLoader(par1Str, false); - var12.saveWorldInfo(var10); - return true; - } - -- private void createFile(String var1) { -- File var2 = new File(this.a, var1); -- if(!var2.exists()) { -+ /** -+ * par: filename for the level.dat_mcr backup -+ */ -+ private void createFile(String par1Str) { -+ File var2 = new File(this.savesDirectory, par1Str); -+ -+ if (!var2.exists()) { - System.out.println("Warning: Unable to create level.dat_mcr backup"); - } else { - File var3 = new File(var2, "level.dat"); -- if(!var3.exists()) { -+ -+ if (!var3.exists()) { - System.out.println("Warning: Unable to create level.dat_mcr backup"); - } else { - File var4 = new File(var2, "level.dat_mcr"); -- if(!var3.renameTo(var4)) { -+ -+ if (!var3.renameTo(var4)) { - System.out.println("Warning: Unable to create level.dat_mcr backup"); - } -- - } - } - } - -- private void convertFile(File var1, Iterable var2, WorldChunkManager var3, int var4, int var5, IProgressUpdate var6) { -- Iterator var7 = var2.iterator(); -+ private void convertFile(File par1File, Iterable par2Iterable, WorldChunkManager par3WorldChunkManager, int par4, int par5, IProgressUpdate par6IProgressUpdate) { -+ Iterator var7 = par2Iterable.iterator(); - -- while(var7.hasNext()) { -+ while (var7.hasNext()) { - File var8 = (File)var7.next(); -- this.convertChunks(var1, var8, var3, var4, var5, var6); -- ++var4; -- int var9 = (int)Math.round(100.0D * (double)var4 / (double)var5); -- var6.setLoadingProgress(var9); -+ this.convertChunks(par1File, var8, par3WorldChunkManager, par4, par5, par6IProgressUpdate); -+ ++par4; -+ int var9 = (int)Math.round(100.0D * (double)par4 / (double)par5); -+ par6IProgressUpdate.setLoadingProgress(var9); - } -- - } - -- private void convertChunks(File var1, File var2, WorldChunkManager var3, int var4, int var5, IProgressUpdate var6) { -+ /** -+ * copies a 32x32 chunk set from par2File to par1File, via AnvilConverterData -+ */ -+ private void convertChunks(File par1File, File par2File, WorldChunkManager par3WorldChunkManager, int par4, int par5, IProgressUpdate par6IProgressUpdate) { - try { -- String var7 = var2.getName(); -- RegionFile var8 = new RegionFile(var2); -- RegionFile var9 = new RegionFile(new File(var1, var7.substring(0, var7.length() - ".mcr".length()) + ".mca")); -+ String var7 = par2File.getName(); -+ RegionFile var8 = new RegionFile(par2File); -+ RegionFile var9 = new RegionFile(new File(par1File, var7.substring(0, var7.length() - ".mcr".length()) + ".mca")); - -- for(int var10 = 0; var10 < 32; ++var10) { -+ for (int var10 = 0; var10 < 32; ++var10) { - int var11; -- for(var11 = 0; var11 < 32; ++var11) { -- if(var8.isChunkSaved(var10, var11) && !var9.isChunkSaved(var10, var11)) { -+ -+ for (var11 = 0; var11 < 32; ++var11) { -+ if (var8.isChunkSaved(var10, var11) && !var9.isChunkSaved(var10, var11)) { - DataInputStream var12 = var8.getChunkDataInputStream(var10, var11); -- if(var12 == null) { -+ -+ if (var12 == null) { - MinecraftServer.getServer().getLogAgent().logWarning("Failed to fetch input stream"); - } else { -- NBTTagCompound var13 = CompressedStreamTools.read((DataInput)var12); -+ NBTTagCompound var13 = CompressedStreamTools.read(var12); - var12.close(); - NBTTagCompound var14 = var13.getCompoundTag("Level"); - AnvilConverterData var15 = ChunkLoader.load(var14); - NBTTagCompound var16 = new NBTTagCompound(); - NBTTagCompound var17 = new NBTTagCompound(); - var16.setTag("Level", var17); -- ChunkLoader.convertToAnvilFormat(var15, var17, var3); -+ ChunkLoader.convertToAnvilFormat(var15, var17, par3WorldChunkManager); - DataOutputStream var18 = var9.getChunkDataOutputStream(var10, var11); -- CompressedStreamTools.write(var16, (DataOutput)var18); -+ CompressedStreamTools.write(var16, var18); - var18.close(); - } - } - } - -- var11 = (int)Math.round(100.0D * (double)(var4 * 1024) / (double)(var5 * 1024)); -- int var20 = (int)Math.round(100.0D * (double)((var10 + 1) * 32 + var4 * 1024) / (double)(var5 * 1024)); -- if(var20 > var11) { -- var6.setLoadingProgress(var20); -+ var11 = (int)Math.round(100.0D * (double)(par4 * 1024) / (double)(par5 * 1024)); -+ int var20 = (int)Math.round(100.0D * (double)((var10 + 1) * 32 + par4 * 1024) / (double)(par5 * 1024)); -+ -+ if (var20 > var11) { -+ par6IProgressUpdate.setLoadingProgress(var20); - } - } - -@@ -180,15 +203,17 @@ - } catch (IOException var19) { - var19.printStackTrace(); - } -- - } - -- private void addRegionFilesToCollection(File var1, Collection var2) { -- File var3 = new File(var1, "region"); -+ /** -+ * filters the files in the par1 directory, and adds them to the par2 collections -+ */ -+ private void addRegionFilesToCollection(File par1File, Collection par2Collection) { -+ File var3 = new File(par1File, "region"); - File[] var4 = var3.listFiles(new AnvilSaveConverterFileFilter(this)); -- if(var4 != null) { -- Collections.addAll(var2, var4); -- } - -+ if (var4 != null) { -+ Collections.addAll(par2Collection, var4); -+ } - } - } ---- /dev/null -+++ org/spoutcraft/client/gui/server/DeleteFavoriteButton.java -@@ -1,0 +1,36 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.client.gui.server; -+ -+import org.spoutcraft.client.gui.SafeButton; -+ -+public class DeleteFavoriteButton extends SafeButton { -+ private GuiFavorites parent; -+ -+ public DeleteFavoriteButton(GuiFavorites parent) { -+ this.parent = parent; -+ setText("Delete"); -+ } -+ -+ @Override -+ protected void executeAction() { -+ parent.deleteCurrentFavorite(); -+ } -+} ---- net/minecraft/src/DispenserBehaviorEgg.java -+++ net/minecraft/src/DispenserBehaviorEgg.java -@@ -1,7 +1,11 @@ - package net.minecraft.src; - - final class DispenserBehaviorEgg extends BehaviorProjectileDispense { -- protected IProjectile getProjectileEntity(World var1, IPosition var2) { -- return new EntityEgg(var1, var2.getX(), var2.getY(), var2.getZ()); -+ -+ /** -+ * Return the projectile entity spawned by this dispense behavior. -+ */ -+ protected IProjectile getProjectileEntity(World par1World, IPosition par2IPosition) { -+ return new EntityEgg(par1World, par2IPosition.getX(), par2IPosition.getY(), par2IPosition.getZ()); - } - } ---- /dev/null -+++ org/spoutcraft/api/gui/GenericListView.java -@@ -1,0 +1,128 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.api.gui; -+ -+public class GenericListView extends GenericListWidget implements ListWidget { -+ private AbstractListModel model; -+ private int selected = -1; -+ -+ public GenericListView(AbstractListModel model) { -+ setModel(model); -+ } -+ -+ public void setModel(AbstractListModel model) { -+ if (this.model != null) this.model.removeView(this); -+ this.model = model; -+ if (this.model != null) this.model.addView(this); -+ } -+ -+ public AbstractListModel getModel() { -+ return model; -+ } -+ -+ @Override -+ public int getSize() { -+ return model.getSize(); -+ } -+ -+ public WidgetType getType() { -+ return WidgetType.ListView; -+ } -+ -+ public ListWidgetItem[] getItems() { -+ ListWidgetItem items[] = new ListWidgetItem[model.getSize()]; -+ for (int i = 0; i < model.getSize(); i++) { -+ items[i] = model.getItem(i); -+ } -+ return items; -+ } -+ -+ @Override -+ public ListWidgetItem getItem(int n) { -+ return model.getItem(n); -+ } -+ -+ public ListWidget addItem(ListWidgetItem item) { -+ return this; -+ } -+ -+ public boolean removeItem(ListWidgetItem item) { -+ return false; -+ } -+ -+ public void clear() { -+ } -+ -+ public ListWidgetItem getSelectedItem() { -+ if (getSelectedRow() < 0 || getSelectedRow() >= getSize()) return null; -+ return model.getItem(getSelectedRow()); -+ } -+ -+ public int getSelectedRow() { -+ return selected; -+ } -+ -+ public ListWidget setSelection(int n) { -+ if (n < -1) { -+ n = -1; -+ } -+ if (n >= model.getSize()) { -+ n = model.getSize() - 1; -+ } -+ selected = n; -+ if (n != -1) { -+ ensureVisible(getItemRect(n)); -+ } -+ -+ return this; -+ } -+ -+ public ListWidget clearSelection() { -+ selected = -1; -+ return this; -+ } -+ -+ public boolean isSelected(int n) { -+ return n == selected; -+ } -+ -+ public boolean isSelected(ListWidgetItem item) { -+ return item == getSelectedItem(); -+ } -+ -+ public ListWidget shiftSelection(int n) { -+ if (selected + n < 0) n = 0; -+ setSelection(selected + n); -+ return this; -+ } -+ -+ @Override -+ public void onSelected(int item, boolean doubleClick) { -+ model.onSelected(item, doubleClick); -+ } -+ -+ public void sizeChanged() { -+ cachedTotalHeight = -1; -+ if (selected + 1 > model.getSize()) { -+ selected = model.getSize() - 1; -+ setScrollPosition(Orientation.VERTICAL, getMaximumScrollPosition(Orientation.VERTICAL)); -+ } -+ } -+} ---- net/minecraft/src/CommandTime.java -+++ net/minecraft/src/CommandTime.java -@@ -8,35 +8,39 @@ - return "time"; - } - -+ /** -+ * Return the required permission level for this command. -+ */ - public int getRequiredPermissionLevel() { - return 2; - } - -- public String getCommandUsage(ICommandSender var1) { -+ public String getCommandUsage(ICommandSender par1ICommandSender) { - return "commands.time.usage"; - } - -- public void processCommand(ICommandSender var1, String[] var2) { -- if(var2.length > 1) { -+ public void processCommand(ICommandSender par1ICommandSender, String[] par2ArrayOfStr) { -+ if (par2ArrayOfStr.length > 1) { - int var3; -- if(var2[0].equals("set")) { -- if(var2[1].equals("day")) { -+ -+ if (par2ArrayOfStr[0].equals("set")) { -+ if (par2ArrayOfStr[1].equals("day")) { - var3 = 0; -- } else if(var2[1].equals("night")) { -+ } else if (par2ArrayOfStr[1].equals("night")) { - var3 = 12500; - } else { -- var3 = parseIntWithMin(var1, var2[1], 0); -+ var3 = parseIntWithMin(par1ICommandSender, par2ArrayOfStr[1], 0); - } - -- this.setTime(var1, var3); -- notifyAdmins(var1, "commands.time.set", new Object[]{Integer.valueOf(var3)}); -+ this.setTime(par1ICommandSender, var3); -+ notifyAdmins(par1ICommandSender, "commands.time.set", new Object[] {Integer.valueOf(var3)}); - return; - } - -- if(var2[0].equals("add")) { -- var3 = parseIntWithMin(var1, var2[1], 0); -- this.addTime(var1, var3); -- notifyAdmins(var1, "commands.time.added", new Object[]{Integer.valueOf(var3)}); -+ if (par2ArrayOfStr[0].equals("add")) { -+ var3 = parseIntWithMin(par1ICommandSender, par2ArrayOfStr[1], 0); -+ this.addTime(par1ICommandSender, var3); -+ notifyAdmins(par1ICommandSender, "commands.time.added", new Object[] {Integer.valueOf(var3)}); - return; - } - } -@@ -44,22 +48,29 @@ - throw new WrongUsageException("commands.time.usage", new Object[0]); - } - -- public List addTabCompletionOptions(ICommandSender var1, String[] var2) { -- return var2.length == 1 ? getListOfStringsMatchingLastWord(var2, new String[]{"set", "add"}) : (var2.length == 2 && var2[0].equals("set") ? getListOfStringsMatchingLastWord(var2, new String[]{"day", "night"}) : null); -+ /** -+ * Adds the strings available in this command to the given list of tab completion options. -+ */ -+ public List addTabCompletionOptions(ICommandSender par1ICommandSender, String[] par2ArrayOfStr) { -+ return par2ArrayOfStr.length == 1 ? getListOfStringsMatchingLastWord(par2ArrayOfStr, new String[] {"set", "add"}): (par2ArrayOfStr.length == 2 && par2ArrayOfStr[0].equals("set") ? getListOfStringsMatchingLastWord(par2ArrayOfStr, new String[] {"day", "night"}): null); - } - -- protected void setTime(ICommandSender var1, int var2) { -- for(int var3 = 0; var3 < MinecraftServer.getServer().worldServers.length; ++var3) { -- MinecraftServer.getServer().worldServers[var3].setWorldTime((long)var2); -+ /** -+ * Set the time in the server object. -+ */ -+ protected void setTime(ICommandSender par1ICommandSender, int par2) { -+ for (int var3 = 0; var3 < MinecraftServer.getServer().worldServers.length; ++var3) { -+ MinecraftServer.getServer().worldServers[var3].setWorldTime((long)par2); - } -- - } - -- protected void addTime(ICommandSender var1, int var2) { -- for(int var3 = 0; var3 < MinecraftServer.getServer().worldServers.length; ++var3) { -+ /** -+ * Adds (or removes) time in the server object. -+ */ -+ protected void addTime(ICommandSender par1ICommandSender, int par2) { -+ for (int var3 = 0; var3 < MinecraftServer.getServer().worldServers.length; ++var3) { - WorldServer var4 = MinecraftServer.getServer().worldServers[var3]; -- var4.setWorldTime(var4.getWorldTime() + (long)var2); -+ var4.setWorldTime(var4.getWorldTime() + (long)par2); - } -- - } - } ---- /dev/null -+++ org/spoutcraft/client/gui/settings/controls/FancyFogButton.java -@@ -1,0 +1,41 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.client.gui.settings.controls; -+ -+import java.util.UUID; -+ -+import org.spoutcraft.client.config.Configuration; -+ -+public class FancyFogButton extends AutomatedCheckBox { -+ UUID fancyGraphics; -+ public FancyFogButton(UUID fancyGraphics) { -+ super("Fancy Fog"); -+ this.fancyGraphics = fancyGraphics; -+ setChecked(Configuration.isFancyFog()); -+ setTooltip("Fog type\nFast - faster fog\nFancy - slower fog, looks better\nThe fancy fog is available only if it is supported by the\ngraphic card."); -+ } -+ -+ @Override -+ public void onButtonClick() { -+ Configuration.setFancyFog(!Configuration.isFancyFog()); -+ Configuration.write(); -+ ((FancyGraphicsButton)getScreen().getWidget(fancyGraphics)).custom = true; -+ } -+} ---- net/minecraft/src/DispenserBehaviorPotionProjectile.java -+++ net/minecraft/src/DispenserBehaviorPotionProjectile.java -@@ -2,15 +2,19 @@ - - class DispenserBehaviorPotionProjectile extends BehaviorProjectileDispense { - final ItemStack potionItemStack; -+ - final DispenserBehaviorPotion dispenserPotionBehavior; - -- DispenserBehaviorPotionProjectile(DispenserBehaviorPotion var1, ItemStack var2) { -- this.dispenserPotionBehavior = var1; -- this.potionItemStack = var2; -+ DispenserBehaviorPotionProjectile(DispenserBehaviorPotion par1DispenserBehaviorPotion, ItemStack par2ItemStack) { -+ this.dispenserPotionBehavior = par1DispenserBehaviorPotion; -+ this.potionItemStack = par2ItemStack; - } - -- protected IProjectile getProjectileEntity(World var1, IPosition var2) { -- return new EntityPotion(var1, var2.getX(), var2.getY(), var2.getZ(), this.potionItemStack.copy()); -+ /** -+ * Return the projectile entity spawned by this dispense behavior. -+ */ -+ protected IProjectile getProjectileEntity(World par1World, IPosition par2IPosition) { -+ return new EntityPotion(par1World, par2IPosition.getX(), par2IPosition.getY(), par2IPosition.getZ(), this.potionItemStack.copy()); - } - - protected float func_82498_a() { ---- /dev/null -+++ com/prupe/mcpatcher/ctm/TileOverride.java -@@ -1,0 +1,756 @@ -+package com.prupe.mcpatcher.ctm; -+ -+import com.prupe.mcpatcher.MCLogger; -+import com.prupe.mcpatcher.MCPatcherUtils; -+import com.prupe.mcpatcher.TexturePackAPI; -+import com.prupe.mcpatcher.TileLoader; -+import com.prupe.mcpatcher.ctm.TileOverrideImpl$CTM; -+import com.prupe.mcpatcher.ctm.TileOverrideImpl$Fixed; -+import com.prupe.mcpatcher.ctm.TileOverrideImpl$Horizontal; -+import com.prupe.mcpatcher.ctm.TileOverrideImpl$HorizontalVertical; -+import com.prupe.mcpatcher.ctm.TileOverrideImpl$Random1; -+import com.prupe.mcpatcher.ctm.TileOverrideImpl$Repeat; -+import com.prupe.mcpatcher.ctm.TileOverrideImpl$Top; -+import com.prupe.mcpatcher.ctm.TileOverrideImpl$Vertical; -+import com.prupe.mcpatcher.ctm.TileOverrideImpl$VerticalHorizontal; -+import java.lang.reflect.Method; -+import java.util.ArrayList; -+import java.util.BitSet; -+import java.util.HashSet; -+import java.util.List; -+import java.util.Properties; -+import java.util.Set; -+import java.util.regex.Matcher; -+import java.util.regex.Pattern; -+import net.minecraft.src.Block; -+import net.minecraft.src.IBlockAccess; -+import net.minecraft.src.Icon; -+import net.minecraft.src.ResourceLocation; -+ -+abstract class TileOverride implements ITileOverride { -+ private static final MCLogger logger = MCLogger.getLogger("Connected Textures", "CTM"); -+ static final int BOTTOM_FACE = 0; -+ static final int TOP_FACE = 1; -+ static final int NORTH_FACE = 2; -+ static final int SOUTH_FACE = 3; -+ static final int WEST_FACE = 4; -+ static final int EAST_FACE = 5; -+ static final int REL_L = 0; -+ static final int REL_DL = 1; -+ static final int REL_D = 2; -+ static final int REL_DR = 3; -+ static final int REL_R = 4; -+ static final int REL_UR = 5; -+ static final int REL_U = 6; -+ static final int REL_UL = 7; -+ private static final int META_MASK = 65535; -+ private static final int ORIENTATION_U_D = 0; -+ private static final int ORIENTATION_E_W = 65536; -+ private static final int ORIENTATION_N_S = 131072; -+ private static final int ORIENTATION_E_W_2 = 196608; -+ private static final int ORIENTATION_N_S_2 = 262144; -+ private static final int[][] ROTATE_UV_MAP = new int[][] {{4, 5, 2, 3, 1, 0, 2, -2, 2, -2, 0, 0}, {2, 3, 1, 0, 4, 5, 0, 0, 0, 0, -2, 2}, {4, 5, 2, 3, 1, 0, 2, -2, -2, -2, 0, 0}, {2, 3, 1, 0, 4, 5, 0, 0, 0, 0, -2, -2}}; -+ private static final int[] GO_DOWN = new int[] {0, -1, 0}; -+ private static final int[] GO_UP = new int[] {0, 1, 0}; -+ private static final int[] GO_NORTH = new int[] {0, 0, -1}; -+ private static final int[] GO_SOUTH = new int[] {0, 0, 1}; -+ private static final int[] GO_WEST = new int[] { -1, 0, 0}; -+ private static final int[] GO_EAST = new int[] {1, 0, 0}; -+ private static final int[][] NORMALS = new int[][] {GO_DOWN, GO_UP, GO_NORTH, GO_SOUTH, GO_WEST, GO_EAST}; -+ protected static final int[][][] NEIGHBOR_OFFSET = new int[][][] {{GO_WEST, add(GO_WEST, GO_SOUTH), GO_SOUTH, add(GO_EAST, GO_SOUTH), GO_EAST, add(GO_EAST, GO_NORTH), GO_NORTH, add(GO_WEST, GO_NORTH)}, {GO_WEST, add(GO_WEST, GO_SOUTH), GO_SOUTH, add(GO_EAST, GO_SOUTH), GO_EAST, add(GO_EAST, GO_NORTH), GO_NORTH, add(GO_WEST, GO_NORTH)}, {GO_EAST, add(GO_EAST, GO_DOWN), GO_DOWN, add(GO_WEST, GO_DOWN), GO_WEST, add(GO_WEST, GO_UP), GO_UP, add(GO_EAST, GO_UP)}, {GO_WEST, add(GO_WEST, GO_DOWN), GO_DOWN, add(GO_EAST, GO_DOWN), GO_EAST, add(GO_EAST, GO_UP), GO_UP, add(GO_WEST, GO_UP)}, {GO_NORTH, add(GO_NORTH, GO_DOWN), GO_DOWN, add(GO_SOUTH, GO_DOWN), GO_SOUTH, add(GO_SOUTH, GO_UP), GO_UP, add(GO_NORTH, GO_UP)}, {GO_SOUTH, add(GO_SOUTH, GO_DOWN), GO_DOWN, add(GO_NORTH, GO_DOWN), GO_NORTH, add(GO_NORTH, GO_UP), GO_UP, add(GO_SOUTH, GO_UP)}}; -+ private static final int CONNECT_BY_BLOCK = 0; -+ private static final int CONNECT_BY_TILE = 1; -+ private static final int CONNECT_BY_MATERIAL = 2; -+ private static Method parseBiomeList; -+ private static Method getBiomeIDAt; -+ private final ResourceLocation propertiesFile; -+ private final String texturesDirectory; -+ private final String baseFilename; -+ private final TileLoader tileLoader; -+ private final int renderPass; -+ private final int weight; -+ private final Set matchBlocks; -+ private final Set matchTiles; -+ private final int faces; -+ private final int metadata; -+ private final int connectType; -+ private final boolean innerSeams; -+ private final BitSet biomes; -+ private final int minHeight; -+ private final int maxHeight; -+ private final List tileNames = new ArrayList(); -+ protected Icon[] icons; -+ private boolean disabled; -+ private int[] reorient; -+ private int rotateUV; -+ protected boolean rotateTop; -+ -+ static TileOverride create(ResourceLocation propertiesFile, TileLoader tileLoader) { -+ if (propertiesFile == null) { -+ return null; -+ } else { -+ Properties properties = TexturePackAPI.getProperties(propertiesFile); -+ -+ if (properties == null) { -+ return null; -+ } else { -+ String method = properties.getProperty("method", "default").trim().toLowerCase(); -+ Object override = null; -+ -+ if (!method.equals("default") && !method.equals("glass") && !method.equals("ctm")) { -+ if (method.equals("random")) { -+ override = new TileOverrideImpl$Random1(propertiesFile, properties, tileLoader); -+ -+ if (((TileOverride)override).getNumberOfTiles() == 1) { -+ override = new TileOverrideImpl$Fixed(propertiesFile, properties, tileLoader); -+ } -+ } else if (!method.equals("fixed") && !method.equals("static")) { -+ if (!method.equals("bookshelf") && !method.equals("horizontal")) { -+ if (!method.equals("horizontal+vertical") && !method.equals("h+v")) { -+ if (method.equals("vertical")) { -+ override = new TileOverrideImpl$Vertical(propertiesFile, properties, tileLoader); -+ } else if (!method.equals("vertical+horizontal") && !method.equals("v+h")) { -+ if (!method.equals("sandstone") && !method.equals("top")) { -+ if (!method.equals("repeat") && !method.equals("pattern")) { -+ logger.error("%s: unknown method \"%s\"", new Object[] {propertiesFile, method}); -+ } else { -+ override = new TileOverrideImpl$Repeat(propertiesFile, properties, tileLoader); -+ } -+ } else { -+ override = new TileOverrideImpl$Top(propertiesFile, properties, tileLoader); -+ } -+ } else { -+ override = new TileOverrideImpl$VerticalHorizontal(propertiesFile, properties, tileLoader); -+ } -+ } else { -+ override = new TileOverrideImpl$HorizontalVertical(propertiesFile, properties, tileLoader); -+ } -+ } else { -+ override = new TileOverrideImpl$Horizontal(propertiesFile, properties, tileLoader); -+ } -+ } else { -+ override = new TileOverrideImpl$Fixed(propertiesFile, properties, tileLoader); -+ } -+ } else { -+ override = new TileOverrideImpl$CTM(propertiesFile, properties, tileLoader); -+ } -+ -+ if (override != null && !((TileOverride)override).disabled) { -+ String status = ((TileOverride)override).checkTileMap(); -+ -+ if (status != null) { -+ ((TileOverride)override).error("invalid %s tile map: %s", new Object[] {((TileOverride)override).getMethod(), status}); -+ } -+ } -+ -+ return (TileOverride)(override != null && !((TileOverride)override).disabled ? override : null); -+ } -+ } -+ } -+ -+ protected TileOverride(ResourceLocation propertiesFile, Properties properties, TileLoader tileLoader) { -+ this.propertiesFile = propertiesFile; -+ this.texturesDirectory = propertiesFile.getResourcePath().replaceFirst("/[^/]*$", ""); -+ this.baseFilename = propertiesFile.getResourcePath().replaceFirst(".*/", "").replaceFirst("\\.properties$", ""); -+ this.tileLoader = tileLoader; -+ this.loadIcons(properties); -+ -+ if (this.tileNames.isEmpty()) { -+ this.error("no images found in %s/", new Object[] {this.texturesDirectory}); -+ } -+ -+ String[] mappings = new String[Block.blocksList.length]; -+ int flags; -+ -+ for (flags = 0; flags < Block.blocksList.length; ++flags) { -+ Block meta = Block.blocksList[flags]; -+ -+ if (meta != null) { -+ mappings[flags] = meta.getUnlocalizedName(); -+ } -+ } -+ -+ this.matchBlocks = this.getIDList(properties, "matchBlocks", "block", mappings); -+ this.matchTiles = this.getIDList(properties, "matchTiles"); -+ -+ if (this.matchBlocks.isEmpty() && this.matchTiles.isEmpty()) { -+ this.matchTiles.add(this.baseFilename); -+ } -+ -+ flags = 0; -+ String[] var13 = properties.getProperty("faces", "all").trim().toLowerCase().split("\\s+"); -+ int connectType1 = var13.length; -+ int biomeList; -+ -+ for (biomeList = 0; biomeList < connectType1; ++biomeList) { -+ String e = var13[biomeList]; -+ -+ if (e.equals("bottom")) { -+ flags |= 1; -+ } else if (e.equals("top")) { -+ flags |= 2; -+ } else if (e.equals("north")) { -+ flags |= 4; -+ } else if (e.equals("south")) { -+ flags |= 8; -+ } else if (e.equals("east")) { -+ flags |= 32; -+ } else if (e.equals("west")) { -+ flags |= 16; -+ } else if (!e.equals("side") && !e.equals("sides")) { -+ if (e.equals("all")) { -+ flags = -1; -+ } -+ } else { -+ flags |= 60; -+ } -+ } -+ -+ this.faces = flags; -+ int var12 = 0; -+ int[] var14 = MCPatcherUtils.parseIntegerList(properties.getProperty("metadata", "0-31"), 0, 31); -+ biomeList = var14.length; -+ -+ for (int var16 = 0; var16 < biomeList; ++var16) { -+ int i = var14[var16]; -+ var12 |= 1 << i; -+ } -+ -+ this.metadata = var12; -+ String var15 = properties.getProperty("connect", "").trim().toLowerCase(); -+ -+ if (var15.equals("")) { -+ this.connectType = this.matchTiles.isEmpty() ? 0 : 1; -+ } else if (var15.equals("block")) { -+ this.connectType = 0; -+ } else if (var15.equals("tile")) { -+ this.connectType = 1; -+ } else if (var15.equals("material")) { -+ this.connectType = 2; -+ } else { -+ this.error("invalid connect type %s", new Object[] {var15}); -+ this.connectType = 0; -+ } -+ -+ this.innerSeams = MCPatcherUtils.getBooleanProperty(properties, "innerSeams", false); -+ String var17 = properties.getProperty("biomes", ""); -+ -+ if (var17.isEmpty()) { -+ this.biomes = null; -+ } else { -+ this.biomes = new BitSet(); -+ -+ if (parseBiomeList != null) { -+ try { -+ parseBiomeList.invoke((Object)null, new Object[] {var17, this.biomes}); -+ } catch (Throwable var11) { -+ var11.printStackTrace(); -+ parseBiomeList = null; -+ } -+ } -+ } -+ -+ this.minHeight = MCPatcherUtils.getIntProperty(properties, "minHeight", -1); -+ this.maxHeight = MCPatcherUtils.getIntProperty(properties, "maxHeight", Integer.MAX_VALUE); -+ this.renderPass = MCPatcherUtils.getIntProperty(properties, "renderPass", -1); -+ -+ if (this.renderPass > 3) { -+ this.error("renderPass must be 0-3", new Object[0]); -+ } else if (this.renderPass >= 0 && !this.matchTiles.isEmpty()) { -+ this.error("renderPass=%d must be block-based not tile-based", new Object[] {Integer.valueOf(this.renderPass)}); -+ } -+ -+ this.weight = MCPatcherUtils.getIntProperty(properties, "weight", 0); -+ } -+ -+ private boolean addIcon(ResourceLocation resource) { -+ this.tileNames.add(resource); -+ return this.tileLoader.preloadTile(resource, this.renderPass > 2); -+ } -+ -+ private void loadIcons(Properties properties) { -+ this.tileNames.clear(); -+ String tileList = properties.getProperty("tiles", "").trim(); -+ -+ if (tileList.equals("")) { -+ int range = 0; -+ -+ while (true) { -+ ResourceLocation arr$ = TileLoader.parseTileAddress(this.propertiesFile, String.valueOf(range)); -+ -+ if (!TexturePackAPI.hasResource(arr$) || !this.addIcon(arr$)) { -+ break; -+ } -+ -+ ++range; -+ } -+ } else { -+ Pattern var14 = Pattern.compile("(\\d+)-(\\d+)"); -+ String[] var15 = tileList.split("\\s+"); -+ int len$ = var15.length; -+ -+ for (int i$ = 0; i$ < len$; ++i$) { -+ String token = var15[i$]; -+ Matcher matcher = var14.matcher(token); -+ -+ if (!token.equals("")) { -+ if (matcher.matches()) { -+ try { -+ int resource = Integer.parseInt(matcher.group(1)); -+ int to = Integer.parseInt(matcher.group(2)); -+ -+ for (int i = resource; i <= to; ++i) { -+ ResourceLocation resource1 = TileLoader.parseTileAddress(this.propertiesFile, String.valueOf(i)); -+ -+ if (TexturePackAPI.hasResource(resource1)) { -+ this.addIcon(resource1); -+ } else { -+ this.warn("could not find image %s", new Object[] {resource1}); -+ // ToDO: -+ //this.tileNames.add((Object)null); -+ } -+ } -+ } catch (NumberFormatException var13) { -+ var13.printStackTrace(); -+ } -+ } else { -+ ResourceLocation var16 = TileLoader.parseTileAddress(this.propertiesFile, token); -+ -+ if (var16 == null) { -+ // ToDo: -+ this.tileNames.add((ResourceLocation)null); -+ } else if (TexturePackAPI.hasResource(var16)) { -+ this.addIcon(var16); -+ } else { -+ this.warn("could not find image %s", new Object[] {var16}); -+ // ToDO: -+ //this.tileNames.add((Object)null); -+ } -+ } -+ } -+ } -+ } -+ } -+ -+ private Set getIDList(Properties properties, String key, String type, String[] mappings) { -+ HashSet list = new HashSet(); -+ String property = properties.getProperty(key, ""); -+ String[] m = property.split("\\s+"); -+ int e = m.length; -+ label53: -+ -+ for (int i$ = 0; i$ < e; ++i$) { -+ String token = m[i$]; -+ -+ if (!token.equals("")) { -+ int i; -+ -+ if (token.matches("\\d+")) { -+ try { -+ i = Integer.parseInt(token); -+ -+ if (i >= 0 && i < mappings.length) { -+ list.add(Integer.valueOf(i)); -+ } else { -+ this.warn("%s value %d is out of range", new Object[] {key, Integer.valueOf(i)}); -+ } -+ } catch (NumberFormatException var13) { -+ var13.printStackTrace(); -+ } -+ } else { -+ for (i = 0; i < mappings.length; ++i) { -+ if (token.equals(mappings[i])) { -+ list.add(Integer.valueOf(i)); -+ continue label53; -+ } -+ } -+ -+ this.warn("unknown %s value %s", new Object[] {key, token}); -+ } -+ } -+ } -+ -+ if (list.isEmpty()) { -+ Matcher var14 = Pattern.compile(type + "(\\d+)").matcher(this.baseFilename); -+ -+ if (var14.find()) { -+ try { -+ list.add(Integer.valueOf(Integer.parseInt(var14.group(1)))); -+ } catch (NumberFormatException var12) { -+ var12.printStackTrace(); -+ } -+ } -+ } -+ -+ return list; -+ } -+ -+ private Set getIDList(Properties properties, String key) { -+ HashSet list = new HashSet(); -+ String property = properties.getProperty(key, ""); -+ String[] arr$ = property.split("\\s+"); -+ int len$ = arr$.length; -+ -+ for (int i$ = 0; i$ < len$; ++i$) { -+ String token = arr$[i$]; -+ -+ if (!token.equals("")) { -+ if (token.contains("/")) { -+ if (!token.endsWith(".png")) { -+ token = token + ".png"; -+ } -+ -+ ResourceLocation resource = TexturePackAPI.parseResourceLocation(this.propertiesFile, token); -+ -+ if (resource != null) { -+ list.add(resource.toString()); -+ } -+ } else { -+ list.add(token); -+ } -+ } -+ } -+ -+ return list; -+ } -+ -+ private static int[] add(int[] a, int[] b) { -+ if (a.length != b.length) { -+ throw new RuntimeException("arrays to add are not same length"); -+ } else { -+ int[] c = new int[a.length]; -+ -+ for (int i = 0; i < c.length; ++i) { -+ c[i] = a[i] + b[i]; -+ } -+ -+ return c; -+ } -+ } -+ -+ protected int getNumberOfTiles() { -+ return this.tileNames.size(); -+ } -+ -+ String checkTileMap() { -+ return null; -+ } -+ -+ boolean requiresFace() { -+ return false; -+ } -+ -+ public String toString() { -+ return String.format("%s[%s]", new Object[] {this.getMethod(), this.propertiesFile}); -+ } -+ -+ public final void registerIcons() { -+ this.icons = new Icon[this.tileNames.size()]; -+ -+ for (int i = 0; i < this.icons.length; ++i) { -+ this.icons[i] = this.tileLoader.getIcon((ResourceLocation)this.tileNames.get(i)); -+ } -+ } -+ -+ final void error(String format, Object ... params) { -+ if (this.propertiesFile != null) { -+ logger.error(this.propertiesFile + ": " + format, params); -+ } -+ -+ this.disabled = true; -+ } -+ -+ final void warn(String format, Object ... params) { -+ if (this.propertiesFile != null) { -+ logger.warning(this.propertiesFile + ": " + format, params); -+ } -+ } -+ -+ public final boolean isDisabled() { -+ return this.disabled; -+ } -+ -+ public final Set getMatchingBlocks() { -+ return this.matchBlocks; -+ } -+ -+ public final Set getMatchingTiles() { -+ return this.matchTiles; -+ } -+ -+ public final int getRenderPass() { -+ return this.renderPass; -+ } -+ -+ public final int getWeight() { -+ return this.weight; -+ } -+ -+ public int compareTo(ITileOverride o) { -+ int result = o.getWeight() - this.getWeight(); -+ return result != 0 ? result : (o instanceof TileOverride ? this.baseFilename.compareTo(((TileOverride)o).baseFilename) : -1); -+ } -+ -+ final boolean shouldConnect(IBlockAccess blockAccess, Block block, Icon icon, int i, int j, int k, int face, int[] offset) { -+ int blockID = block.blockID; -+ int metadata = blockAccess.getBlockMetadata(i, j, k); -+ i += offset[0]; -+ j += offset[1]; -+ k += offset[2]; -+ int neighborID = blockAccess.getBlockId(i, j, k); -+ int neighborMeta = blockAccess.getBlockMetadata(i, j, k); -+ Block neighbor = Block.blocksList[neighborID]; -+ -+ if (this.exclude(neighbor, face, neighborMeta)) { -+ return false; -+ } else { -+ int orientation = getOrientationFromMetadata(block, metadata); -+ int neighborOrientation = getOrientationFromMetadata(neighbor, neighborMeta); -+ -+ if ((orientation & -65536) != (neighborOrientation & -65536)) { -+ return false; -+ } else if (this.metadata != -1 && (orientation & 65535) != (neighborOrientation & 65535)) { -+ return false; -+ } else { -+ if (face >= 0 && this.innerSeams) { -+ int[] normal = NORMALS[face]; -+ -+ if (!neighbor.shouldSideBeRendered(blockAccess, i + normal[0], j + normal[1], k + normal[2], face)) { -+ return false; -+ } -+ } -+ -+ switch (this.connectType) { -+ case 0: -+ return neighborID == blockID; -+ -+ case 1: -+ return neighbor.getBlockTexture(blockAccess, i, j, k, face) == icon; -+ -+ case 2: -+ return block.blockMaterial == neighbor.blockMaterial; -+ -+ default: -+ return false; -+ } -+ } -+ } -+ } -+ -+ final int reorient(int face) { -+ return face >= 0 && face <= 5 && this.reorient != null ? this.reorient[face] : face; -+ } -+ -+ final int rotateUV(int neighbor) { -+ return neighbor + this.rotateUV & 7; -+ } -+ -+ final boolean exclude(Block block, int face, int metadata) { -+ if (block == null) { -+ return true; -+ } else if ((this.faces & 1 << this.reorient(face)) == 0) { -+ return true; -+ } else { -+ if (this.metadata != -1 && metadata >= 0 && metadata < 32) { -+ int altMetadata = getOrientationFromMetadata(block, metadata) & 65535; -+ -+ if ((this.metadata & (1 << metadata | 1 << altMetadata)) == 0) { -+ return true; -+ } -+ } -+ -+ return false; -+ } -+ } -+ -+ private static int getOrientationFromMetadata(Block block, int metadata) { -+ int newMeta = metadata; -+ int orientation = 0; -+ -+ switch (block.getRenderType()) { -+ case 31: -+ switch (metadata & 12) { -+ case 0: -+ newMeta = metadata & -13; -+ return orientation | newMeta; -+ -+ case 4: -+ newMeta = metadata & -13; -+ orientation = 65536; -+ return orientation | newMeta; -+ -+ case 8: -+ newMeta = metadata & -13; -+ orientation = 131072; -+ return orientation | newMeta; -+ -+ default: -+ return orientation | newMeta; -+ } -+ -+ case 39: -+ switch (metadata) { -+ case 3: -+ newMeta = 2; -+ orientation = 196608; -+ break; -+ -+ case 4: -+ newMeta = 2; -+ orientation = 262144; -+ } -+ } -+ -+ return orientation | newMeta; -+ } -+ -+ private void setupOrientation(int orientation, int face) { -+ switch (orientation & -65536) { -+ case 65536: -+ this.reorient = ROTATE_UV_MAP[0]; -+ this.rotateUV = ROTATE_UV_MAP[0][face + 6]; -+ this.rotateTop = true; -+ break; -+ -+ case 131072: -+ this.reorient = ROTATE_UV_MAP[1]; -+ this.rotateUV = ROTATE_UV_MAP[1][face + 6]; -+ this.rotateTop = false; -+ break; -+ -+ case 196608: -+ this.reorient = ROTATE_UV_MAP[2]; -+ this.rotateUV = ROTATE_UV_MAP[2][face + 6]; -+ this.rotateTop = true; -+ break; -+ -+ case 262144: -+ this.reorient = ROTATE_UV_MAP[3]; -+ this.rotateUV = ROTATE_UV_MAP[3][face + 6]; -+ this.rotateTop = false; -+ break; -+ -+ default: -+ this.reorient = null; -+ this.rotateUV = 0; -+ this.rotateTop = false; -+ } -+ } -+ -+ private static int remapFaceByRenderType(Block block, int metadata, int face) { -+ switch (block.getRenderType()) { -+ case 8: -+ switch (metadata) { -+ case 2: -+ case 3: -+ case 4: -+ case 5: -+ return metadata; -+ -+ default: -+ return face; -+ } -+ -+ case 20: -+ switch (metadata) { -+ case 1: -+ return 2; -+ -+ case 2: -+ return 5; -+ -+ case 3: -+ case 5: -+ case 6: -+ case 7: -+ default: -+ break; -+ -+ case 4: -+ return 3; -+ -+ case 8: -+ return 4; -+ } -+ } -+ -+ return face; -+ } -+ -+ public final Icon getTile(IBlockAccess blockAccess, Block block, Icon origIcon, int i, int j, int k, int face) { -+ if (this.icons == null) { -+ this.error("no images loaded, disabling", new Object[0]); -+ return null; -+ } else if (face < 0 && this.requiresFace()) { -+ this.error("method=%s is not supported for non-standard blocks", new Object[] {this.getMethod()}); -+ return null; -+ } else if (block != null && !RenderPassAPI.instance.skipThisRenderPass(block, this.renderPass)) { -+ int metadata = blockAccess.getBlockMetadata(i, j, k); -+ this.setupOrientation(getOrientationFromMetadata(block, metadata), face); -+ face = remapFaceByRenderType(block, metadata, face); -+ -+ if (this.exclude(block, face, metadata)) { -+ return null; -+ } else if (j >= this.minHeight && j <= this.maxHeight) { -+ if (this.biomes != null) { -+ if (getBiomeIDAt == null) { -+ return null; -+ } -+ -+ try { -+ int e = ((Integer)getBiomeIDAt.invoke((Object)null, new Object[] {Integer.valueOf(i), Integer.valueOf(j), Integer.valueOf(k)})).intValue(); -+ -+ if (!this.biomes.get(e)) { -+ return null; -+ } -+ } catch (Throwable var10) { -+ var10.printStackTrace(); -+ getBiomeIDAt = null; -+ } -+ } -+ -+ return this.getTileImpl(blockAccess, block, origIcon, i, j, k, face); -+ } else { -+ return null; -+ } -+ } else { -+ return null; -+ } -+ } -+ -+ public final Icon getTile(Block block, Icon origIcon, int face, int metadata) { -+ if (this.icons == null) { -+ this.error("no images loaded, disabling", new Object[0]); -+ return null; -+ } else if (face < 0 && this.requiresFace()) { -+ this.error("method=%s is not supported for non-standard blocks", new Object[] {this.getMethod()}); -+ return null; -+ } else if (this.minHeight < 0 && this.maxHeight >= Integer.MAX_VALUE && this.biomes == null) { -+ this.setupOrientation(getOrientationFromMetadata(block, metadata), face); -+ return this.exclude(block, face, metadata) ? null : this.getTileImpl(block, origIcon, face, metadata); -+ } else { -+ return null; -+ } -+ } -+ -+ abstract String getMethod(); -+ -+ abstract Icon getTileImpl(IBlockAccess var1, Block var2, Icon var3, int var4, int var5, int var6, int var7); -+ -+ abstract Icon getTileImpl(Block var1, Icon var2, int var3, int var4); -+ -+ static { -+ try { -+ Class e = Class.forName("com.prupe.mcpatcher.cc.BiomeHelper"); -+ parseBiomeList = e.getDeclaredMethod("parseBiomeList", new Class[] {String.class, BitSet.class}); -+ getBiomeIDAt = e.getDeclaredMethod("getBiomeIDAt", new Class[] {Integer.TYPE, Integer.TYPE, Integer.TYPE}); -+ parseBiomeList.setAccessible(true); -+ getBiomeIDAt.setAccessible(true); -+ logger.fine("biome integration active", new Object[0]); -+ } catch (Throwable var1) { -+ parseBiomeList = null; -+ getBiomeIDAt = null; -+ logger.warning("biome integration failed", new Object[0]); -+ } -+ } -+} ---- net/minecraft/src/CallableGLInfo.java -+++ net/minecraft/src/CallableGLInfo.java -@@ -4,10 +4,12 @@ - import org.lwjgl.opengl.GL11; - - class CallableGLInfo implements Callable { -+ -+ /** The Minecraft instance. */ - final Minecraft mc; - -- CallableGLInfo(Minecraft var1) { -- this.mc = var1; -+ CallableGLInfo(Minecraft par1Minecraft) { -+ this.mc = par1Minecraft; - } - - public String getTexturePack() { ---- net/minecraft/src/FilterIMob.java -+++ net/minecraft/src/FilterIMob.java -@@ -1,7 +1,11 @@ - package net.minecraft.src; - - final class FilterIMob implements IEntitySelector { -- public boolean isEntityApplicable(Entity var1) { -- return var1 instanceof IMob; -+ -+ /** -+ * Return whether the specified entity is applicable to this filter. -+ */ -+ public boolean isEntityApplicable(Entity par1Entity) { -+ return par1Entity instanceof IMob; - } - } ---- /dev/null -+++ org/spoutcraft/client/entity/CraftTextEntity.java -@@ -1,0 +1,63 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.client.entity; -+ -+import org.spoutcraft.api.util.FixedLocation; -+import org.spoutcraft.client.SpoutClient; -+ -+public class CraftTextEntity extends CraftEntity{ -+ public CraftTextEntity(FixedLocation location) { -+ super(location); -+ handle = new EntityText(SpoutClient.getInstance().getRawWorld()); -+ teleport(location); -+ } -+ -+ public CraftTextEntity(EntityText handle) { -+ super(handle); -+ } -+ -+ public EntityText getHandle() { -+ return (EntityText)handle; -+ } -+ -+ public String getText() { -+ return getHandle().getText(); -+ } -+ -+ public void setText(String text) { -+ getHandle().setText(text); -+ } -+ -+ public boolean isRotatingWithPlayer() { -+ return getHandle().isRotateWithPlayer(); -+ } -+ -+ public void setRotatingWithPlayer(boolean flag) { -+ getHandle().setRotateWithPlayer(flag); -+ } -+ -+ public float getScale() { -+ return getHandle().getScale(); -+ } -+ -+ public void setScale(float s) { -+ getHandle().setScale(s); -+ } -+} ---- net/minecraft/src/ModelCreeper.java -+++ net/minecraft/src/ModelCreeper.java -@@ -13,47 +13,55 @@ - this(0.0F); - } - -- public ModelCreeper(float var1) { -+ public ModelCreeper(float par1) { - byte var2 = 4; - this.head = new ModelRenderer(this, 0, 0); -- this.head.addBox(-4.0F, -8.0F, -4.0F, 8, 8, 8, var1); -+ this.head.addBox(-4.0F, -8.0F, -4.0F, 8, 8, 8, par1); - this.head.setRotationPoint(0.0F, (float)var2, 0.0F); - this.field_78133_b = new ModelRenderer(this, 32, 0); -- this.field_78133_b.addBox(-4.0F, -8.0F, -4.0F, 8, 8, 8, var1 + 0.5F); -+ this.field_78133_b.addBox(-4.0F, -8.0F, -4.0F, 8, 8, 8, par1 + 0.5F); - this.field_78133_b.setRotationPoint(0.0F, (float)var2, 0.0F); - this.body = new ModelRenderer(this, 16, 16); -- this.body.addBox(-4.0F, 0.0F, -2.0F, 8, 12, 4, var1); -+ this.body.addBox(-4.0F, 0.0F, -2.0F, 8, 12, 4, par1); - this.body.setRotationPoint(0.0F, (float)var2, 0.0F); - this.leg1 = new ModelRenderer(this, 0, 16); -- this.leg1.addBox(-2.0F, 0.0F, -2.0F, 4, 6, 4, var1); -+ this.leg1.addBox(-2.0F, 0.0F, -2.0F, 4, 6, 4, par1); - this.leg1.setRotationPoint(-2.0F, (float)(12 + var2), 4.0F); - this.leg2 = new ModelRenderer(this, 0, 16); -- this.leg2.addBox(-2.0F, 0.0F, -2.0F, 4, 6, 4, var1); -+ this.leg2.addBox(-2.0F, 0.0F, -2.0F, 4, 6, 4, par1); - this.leg2.setRotationPoint(2.0F, (float)(12 + var2), 4.0F); - this.leg3 = new ModelRenderer(this, 0, 16); -- this.leg3.addBox(-2.0F, 0.0F, -2.0F, 4, 6, 4, var1); -+ this.leg3.addBox(-2.0F, 0.0F, -2.0F, 4, 6, 4, par1); - this.leg3.setRotationPoint(-2.0F, (float)(12 + var2), -4.0F); - this.leg4 = new ModelRenderer(this, 0, 16); -- this.leg4.addBox(-2.0F, 0.0F, -2.0F, 4, 6, 4, var1); -+ this.leg4.addBox(-2.0F, 0.0F, -2.0F, 4, 6, 4, par1); - this.leg4.setRotationPoint(2.0F, (float)(12 + var2), -4.0F); - } - -- public void render(Entity var1, float var2, float var3, float var4, float var5, float var6, float var7) { -- this.setRotationAngles(var2, var3, var4, var5, var6, var7, var1); -- this.head.render(var7); -- this.body.render(var7); -- this.leg1.render(var7); -- this.leg2.render(var7); -- this.leg3.render(var7); -- this.leg4.render(var7); -+ /** -+ * Sets the models various rotation angles then renders the model. -+ */ -+ public void render(Entity par1Entity, float par2, float par3, float par4, float par5, float par6, float par7) { -+ this.setRotationAngles(par2, par3, par4, par5, par6, par7, par1Entity); -+ this.head.render(par7); -+ this.body.render(par7); -+ this.leg1.render(par7); -+ this.leg2.render(par7); -+ this.leg3.render(par7); -+ this.leg4.render(par7); - } - -- public void setRotationAngles(float var1, float var2, float var3, float var4, float var5, float var6, Entity var7) { -- this.head.rotateAngleY = var4 / (180.0F / (float)Math.PI); -- this.head.rotateAngleX = var5 / (180.0F / (float)Math.PI); -- this.leg1.rotateAngleX = MathHelper.cos(var1 * 0.6662F) * 1.4F * var2; -- this.leg2.rotateAngleX = MathHelper.cos(var1 * 0.6662F + (float)Math.PI) * 1.4F * var2; -- this.leg3.rotateAngleX = MathHelper.cos(var1 * 0.6662F + (float)Math.PI) * 1.4F * var2; -- this.leg4.rotateAngleX = MathHelper.cos(var1 * 0.6662F) * 1.4F * var2; -+ /** -+ * Sets the model's various rotation angles. For bipeds, par1 and par2 are used for animating the movement of arms and -+ * legs, where par1 represents the time(so that arms and legs swing back and forth) and par2 represents how "far" arms -+ * and legs can swing at most. -+ */ -+ public void setRotationAngles(float par1, float par2, float par3, float par4, float par5, float par6, Entity par7Entity) { -+ this.head.rotateAngleY = par4 / (180F / (float)Math.PI); -+ this.head.rotateAngleX = par5 / (180F / (float)Math.PI); -+ this.leg1.rotateAngleX = MathHelper.cos(par1 * 0.6662F) * 1.4F * par2; -+ this.leg2.rotateAngleX = MathHelper.cos(par1 * 0.6662F + (float)Math.PI) * 1.4F * par2; -+ this.leg3.rotateAngleX = MathHelper.cos(par1 * 0.6662F + (float)Math.PI) * 1.4F * par2; -+ this.leg4.rotateAngleX = MathHelper.cos(par1 * 0.6662F) * 1.4F * par2; - } - } ---- net/minecraft/src/CallableChunkPosHash.java -+++ net/minecraft/src/CallableChunkPosHash.java -@@ -4,13 +4,15 @@ - - class CallableChunkPosHash implements Callable { - final int field_85165_a; -+ - final int field_85163_b; -+ - final MapGenStructure theMapStructureGenerator; - -- CallableChunkPosHash(MapGenStructure var1, int var2, int var3) { -- this.theMapStructureGenerator = var1; -- this.field_85165_a = var2; -- this.field_85163_b = var3; -+ CallableChunkPosHash(MapGenStructure par1MapGenStructure, int par2, int par3) { -+ this.theMapStructureGenerator = par1MapGenStructure; -+ this.field_85165_a = par2; -+ this.field_85163_b = par3; - } - - public String callChunkPositionHash() { ---- net/minecraft/src/Profiler.java -+++ net/minecraft/src/Profiler.java -@@ -8,117 +8,151 @@ - import java.util.Map; - - public class Profiler { -- private final List b = new ArrayList(); -- private final List c = new ArrayList(); -+ -+ /** List of parent sections */ -+ private final List sectionList = new ArrayList(); -+ -+ /** List of timestamps (System.nanoTime) */ -+ private final List timestampList = new ArrayList(); -+ -+ /** Flag profiling enabled */ - public boolean profilingEnabled; -- private String d = ""; -- private final Map e = new HashMap(); -- -+ -+ /** Current profiling section */ -+ private String profilingSection = ""; -+ -+ /** Profiling map */ -+ private final Map profilingMap = new HashMap(); -+ -+ /** -+ * Clear profiling. -+ */ - public void clearProfiling() { -- this.e.clear(); -- this.d = ""; -- this.b.clear(); -+ this.profilingMap.clear(); -+ this.profilingSection = ""; -+ this.sectionList.clear(); - } - -- public void startSection(String var1) { -- if(this.profilingEnabled) { -- if(this.d.length() > 0) { -- this.d = this.d + "."; -+ /** -+ * Start section -+ */ -+ public void startSection(String par1Str) { -+ // Spout Start -+ if (this.profilingEnabled && Thread.currentThread() == Minecraft.mainThread) { -+ // Spout End -+ if (this.profilingSection.length() > 0) { -+ this.profilingSection = this.profilingSection + "."; - } - -- this.d = this.d + var1; -- this.b.add(this.d); -- this.c.add(Long.valueOf(System.nanoTime())); -+ this.profilingSection = this.profilingSection + par1Str; -+ this.sectionList.add(this.profilingSection); -+ this.timestampList.add(Long.valueOf(System.nanoTime())); - } - } - -+ /** -+ * End section -+ */ - public void endSection() { -- if(this.profilingEnabled) { -+ // Spout Start -+ if (this.profilingEnabled && Thread.currentThread() == Minecraft.mainThread) { -+ // Spout End - long var1 = System.nanoTime(); -- long var3 = ((Long)this.c.remove(this.c.size() - 1)).longValue(); -- this.b.remove(this.b.size() - 1); -+ long var3 = ((Long)this.timestampList.remove(this.timestampList.size() - 1)).longValue(); -+ this.sectionList.remove(this.sectionList.size() - 1); - long var5 = var1 - var3; -- if(this.e.containsKey(this.d)) { -- this.e.put(this.d, Long.valueOf(((Long)this.e.get(this.d)).longValue() + var5)); -+ -+ if (this.profilingMap.containsKey(this.profilingSection)) { -+ this.profilingMap.put(this.profilingSection, Long.valueOf(((Long)this.profilingMap.get(this.profilingSection)).longValue() + var5)); - } else { -- this.e.put(this.d, Long.valueOf(var5)); -- } -- -- if(var5 > 100000000L) { -- System.out.println("Something\'s taking too long! \'" + this.d + "\' took aprox " + (double)var5 / 1000000.0D + " ms"); -- } -- -- this.d = !this.b.isEmpty() ? (String)this.b.get(this.b.size() - 1) : ""; -+ this.profilingMap.put(this.profilingSection, Long.valueOf(var5)); -+ } -+ -+ if (var5 > 100000000L) { -+ System.out.println("Something\'s taking too long! \'" + this.profilingSection + "\' took aprox " + (double)var5 / 1000000.0D + " ms"); -+ } -+ -+ this.profilingSection = !this.sectionList.isEmpty() ? (String)this.sectionList.get(this.sectionList.size() - 1) : ""; - } - } - -- public List getProfilingData(String var1) { -- if(!this.profilingEnabled) { -+ /** -+ * Get profiling data -+ */ -+ public List getProfilingData(String par1Str) { -+ if (!this.profilingEnabled) { - return null; - } else { -- long var3 = this.e.containsKey("root") ? ((Long)this.e.get("root")).longValue() : 0L; -- long var5 = this.e.containsKey(var1) ? ((Long)this.e.get(var1)).longValue() : -1L; -+ long var3 = this.profilingMap.containsKey("root") ? ((Long)this.profilingMap.get("root")).longValue() : 0L; -+ long var5 = this.profilingMap.containsKey(par1Str) ? ((Long)this.profilingMap.get(par1Str)).longValue() : -1L; - ArrayList var7 = new ArrayList(); -- if(var1.length() > 0) { -- var1 = var1 + "."; -+ -+ if (par1Str.length() > 0) { -+ par1Str = par1Str + "."; - } - - long var8 = 0L; -- Iterator var10 = this.e.keySet().iterator(); -+ Iterator var10 = this.profilingMap.keySet().iterator(); - -- while(var10.hasNext()) { -+ while (var10.hasNext()) { - String var11 = (String)var10.next(); -- if(var11.length() > var1.length() && var11.startsWith(var1) && var11.indexOf(".", var1.length() + 1) < 0) { -- var8 += ((Long)this.e.get(var11)).longValue(); -+ -+ if (var11.length() > par1Str.length() && var11.startsWith(par1Str) && var11.indexOf(".", par1Str.length() + 1) < 0) { -+ var8 += ((Long)this.profilingMap.get(var11)).longValue(); - } - } - -- float var20 = (float)var8; -- if(var8 < var5) { -+ float var21 = (float)var8; -+ -+ if (var8 < var5) { - var8 = var5; - } - -- if(var3 < var8) { -+ if (var3 < var8) { - var3 = var8; - } - -- Iterator var21 = this.e.keySet().iterator(); -- -+ Iterator var20 = this.profilingMap.keySet().iterator(); - String var12; -- while(var21.hasNext()) { -- var12 = (String)var21.next(); -- if(var12.length() > var1.length() && var12.startsWith(var1) && var12.indexOf(".", var1.length() + 1) < 0) { -- long var13 = ((Long)this.e.get(var12)).longValue(); -+ -+ while (var20.hasNext()) { -+ var12 = (String)var20.next(); -+ -+ if (var12.length() > par1Str.length() && var12.startsWith(par1Str) && var12.indexOf(".", par1Str.length() + 1) < 0) { -+ long var13 = ((Long)this.profilingMap.get(var12)).longValue(); - double var15 = (double)var13 * 100.0D / (double)var8; - double var17 = (double)var13 * 100.0D / (double)var3; -- String var19 = var12.substring(var1.length()); -+ String var19 = var12.substring(par1Str.length()); - var7.add(new ProfilerResult(var19, var15, var17)); - } - } - -- var21 = this.e.keySet().iterator(); -+ var20 = this.profilingMap.keySet().iterator(); - -- while(var21.hasNext()) { -- var12 = (String)var21.next(); -- this.e.put(var12, Long.valueOf(((Long)this.e.get(var12)).longValue() * 999L / 1000L)); -+ while (var20.hasNext()) { -+ var12 = (String)var20.next(); -+ this.profilingMap.put(var12, Long.valueOf(((Long)this.profilingMap.get(var12)).longValue() * 999L / 1000L)); - } - -- if((float)var8 > var20) { -- var7.add(new ProfilerResult("unspecified", (double)((float)var8 - var20) * 100.0D / (double)var8, (double)((float)var8 - var20) * 100.0D / (double)var3)); -+ if ((float)var8 > var21) { -+ var7.add(new ProfilerResult("unspecified", (double)((float)var8 - var21) * 100.0D / (double)var8, (double)((float)var8 - var21) * 100.0D / (double)var3)); - } - - Collections.sort(var7); -- var7.add(0, new ProfilerResult(var1, 100.0D, (double)var8 * 100.0D / (double)var3)); -+ var7.add(0, new ProfilerResult(par1Str, 100.0D, (double)var8 * 100.0D / (double)var3)); - return var7; - } - } - -- public void endStartSection(String var1) { -+ /** -+ * End current section and start a new section -+ */ -+ public void endStartSection(String par1Str) { - this.endSection(); -- this.startSection(var1); -+ this.startSection(par1Str); - } - - public String getNameOfLastSection() { -- return this.b.size() == 0 ? "[UNKNOWN]" : (String)this.b.get(this.b.size() - 1); -+ return this.sectionList.size() == 0 ? "[UNKNOWN]" : (String)this.sectionList.get(this.sectionList.size() - 1); - } - } ---- net/minecraft/src/EntityPickupFX.java -+++ net/minecraft/src/EntityPickupFX.java -@@ -7,32 +7,34 @@ - private Entity entityPickingUp; - private int age; - private int maxAge; -+ -+ /** renamed from yOffset to fix shadowing Entity.yOffset */ - private float yOffs; - -- public EntityPickupFX(World var1, Entity var2, Entity var3, float var4) { -- super(var1, var2.posX, var2.posY, var2.posZ, var2.motionX, var2.motionY, var2.motionZ); -- this.entityToPickUp = var2; -- this.entityPickingUp = var3; -+ public EntityPickupFX(World par1World, Entity par2Entity, Entity par3Entity, float par4) { -+ super(par1World, par2Entity.posX, par2Entity.posY, par2Entity.posZ, par2Entity.motionX, par2Entity.motionY, par2Entity.motionZ); -+ this.entityToPickUp = par2Entity; -+ this.entityPickingUp = par3Entity; - this.maxAge = 3; -- this.yOffs = var4; -+ this.yOffs = par4; - } - -- public void renderParticle(Tessellator var1, float var2, float var3, float var4, float var5, float var6, float var7) { -- float var8 = ((float)this.age + var2) / (float)this.maxAge; -+ public void renderParticle(Tessellator par1Tessellator, float par2, float par3, float par4, float par5, float par6, float par7) { -+ float var8 = ((float)this.age + par2) / (float)this.maxAge; - var8 *= var8; - double var9 = this.entityToPickUp.posX; - double var11 = this.entityToPickUp.posY; - double var13 = this.entityToPickUp.posZ; -- double var15 = this.entityPickingUp.lastTickPosX + (this.entityPickingUp.posX - this.entityPickingUp.lastTickPosX) * (double)var2; -- double var17 = this.entityPickingUp.lastTickPosY + (this.entityPickingUp.posY - this.entityPickingUp.lastTickPosY) * (double)var2 + (double)this.yOffs; -- double var19 = this.entityPickingUp.lastTickPosZ + (this.entityPickingUp.posZ - this.entityPickingUp.lastTickPosZ) * (double)var2; -+ double var15 = this.entityPickingUp.lastTickPosX + (this.entityPickingUp.posX - this.entityPickingUp.lastTickPosX) * (double)par2; -+ double var17 = this.entityPickingUp.lastTickPosY + (this.entityPickingUp.posY - this.entityPickingUp.lastTickPosY) * (double)par2 + (double)this.yOffs; -+ double var19 = this.entityPickingUp.lastTickPosZ + (this.entityPickingUp.posZ - this.entityPickingUp.lastTickPosZ) * (double)par2; - double var21 = var9 + (var15 - var9) * (double)var8; - double var23 = var11 + (var17 - var11) * (double)var8; - double var25 = var13 + (var19 - var13) * (double)var8; - int var27 = MathHelper.floor_double(var21); - int var28 = MathHelper.floor_double(var23 + (double)(this.yOffset / 2.0F)); - int var29 = MathHelper.floor_double(var25); -- int var30 = this.getBrightnessForRender(var2); -+ int var30 = this.getBrightnessForRender(par2); - int var31 = var30 % 65536; - int var32 = var30 / 65536; - OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, (float)var31 / 1.0F, (float)var32 / 1.0F); -@@ -40,15 +42,18 @@ - var21 -= interpPosX; - var23 -= interpPosY; - var25 -= interpPosZ; -- RenderManager.instance.renderEntityWithPosYaw(this.entityToPickUp, (double)((float)var21), (double)((float)var23), (double)((float)var25), this.entityToPickUp.rotationYaw, var2); -+ RenderManager.instance.renderEntityWithPosYaw(this.entityToPickUp, (double)((float)var21), (double)((float)var23), (double)((float)var25), this.entityToPickUp.rotationYaw, par2); - } - -+ /** -+ * Called to update the entity's position/logic. -+ */ - public void onUpdate() { - ++this.age; -- if(this.age == this.maxAge) { -+ -+ if (this.age == this.maxAge) { - this.setDead(); - } -- - } - - public int getFXLayer() { ---- net/minecraft/src/InventoryPlayer.java -+++ net/minecraft/src/InventoryPlayer.java -@@ -1,29 +1,55 @@ - package net.minecraft.src; - - public class InventoryPlayer implements IInventory { -+ -+ /** -+ * An array of 36 item stacks indicating the main player inventory (including the visible bar). -+ */ - public ItemStack[] mainInventory = new ItemStack[36]; -+ -+ /** An array of 4 item stacks containing the currently worn armor pieces. */ - public ItemStack[] armorInventory = new ItemStack[4]; -+ -+ /** The index of the currently held item (0-8). */ - public int currentItem; -+ -+ /** The current ItemStack. */ - private ItemStack currentItemStack; -+ -+ /** The player whose inventory this is. */ - public EntityPlayer player; - private ItemStack itemStack; -+ -+ /** -+ * Set true whenever the inventory changes. Nothing sets it false so you will have to write your own code to check it -+ * and reset the value. -+ */ - public boolean inventoryChanged; - -- public InventoryPlayer(EntityPlayer var1) { -- this.player = var1; -+ public InventoryPlayer(EntityPlayer par1EntityPlayer) { -+ this.player = par1EntityPlayer; - } - -+ /** -+ * Returns the item stack currently held by the player. -+ */ - public ItemStack getCurrentItem() { - return this.currentItem < 9 && this.currentItem >= 0 ? this.mainInventory[this.currentItem] : null; - } - -+ /** -+ * Get the size of the player hotbar inventory -+ */ - public static int getHotbarSize() { - return 9; - } - -- private int getInventorySlotContainItem(int var1) { -- for(int var2 = 0; var2 < this.mainInventory.length; ++var2) { -- if(this.mainInventory[var2] != null && this.mainInventory[var2].itemID == var1) { -+ /** -+ * Returns a slot index in main inventory containing a specific itemID -+ */ -+ private int getInventorySlotContainItem(int par1) { -+ for (int var2 = 0; var2 < this.mainInventory.length; ++var2) { -+ if (this.mainInventory[var2] != null && this.mainInventory[var2].itemID == par1) { - return var2; - } - } -@@ -31,9 +57,9 @@ - return -1; - } - -- private int getInventorySlotContainItemAndDamage(int var1, int var2) { -- for(int var3 = 0; var3 < this.mainInventory.length; ++var3) { -- if(this.mainInventory[var3] != null && this.mainInventory[var3].itemID == var1 && this.mainInventory[var3].getItemDamage() == var2) { -+ private int getInventorySlotContainItemAndDamage(int par1, int par2) { -+ for (int var3 = 0; var3 < this.mainInventory.length; ++var3) { -+ if (this.mainInventory[var3] != null && this.mainInventory[var3].itemID == par1 && this.mainInventory[var3].getItemDamage() == par2) { - return var3; - } - } -@@ -41,9 +67,12 @@ - return -1; - } - -- private int storeItemStack(ItemStack var1) { -- for(int var2 = 0; var2 < this.mainInventory.length; ++var2) { -- if(this.mainInventory[var2] != null && this.mainInventory[var2].itemID == var1.itemID && this.mainInventory[var2].isStackable() && this.mainInventory[var2].stackSize < this.mainInventory[var2].getMaxStackSize() && this.mainInventory[var2].stackSize < this.getInventoryStackLimit() && (!this.mainInventory[var2].getHasSubtypes() || this.mainInventory[var2].getItemDamage() == var1.getItemDamage()) && ItemStack.areItemStackTagsEqual(this.mainInventory[var2], var1)) { -+ /** -+ * stores an itemstack in the users inventory -+ */ -+ private int storeItemStack(ItemStack par1ItemStack) { -+ for (int var2 = 0; var2 < this.mainInventory.length; ++var2) { -+ if (this.mainInventory[var2] != null && this.mainInventory[var2].itemID == par1ItemStack.itemID && this.mainInventory[var2].isStackable() && this.mainInventory[var2].stackSize < this.mainInventory[var2].getMaxStackSize() && this.mainInventory[var2].stackSize < this.getInventoryStackLimit() && (!this.mainInventory[var2].getHasSubtypes() || this.mainInventory[var2].getItemDamage() == par1ItemStack.getItemDamage()) && ItemStack.areItemStackTagsEqual(this.mainInventory[var2], par1ItemStack)) { - return var2; - } - } -@@ -51,9 +80,12 @@ - return -1; - } - -+ /** -+ * Returns the first item stack that is empty. -+ */ - public int getFirstEmptyStack() { -- for(int var1 = 0; var1 < this.mainInventory.length; ++var1) { -- if(this.mainInventory[var1] == null) { -+ for (int var1 = 0; var1 < this.mainInventory.length; ++var1) { -+ if (this.mainInventory[var1] == null) { - return var1; - } - } -@@ -61,76 +93,88 @@ - return -1; - } - -- public void setCurrentItem(int var1, int var2, boolean var3, boolean var4) { -+ /** -+ * Sets a specific itemID as the current item being held (only if it exists on the hotbar) -+ */ -+ public void setCurrentItem(int par1, int par2, boolean par3, boolean par4) { - boolean var5 = true; - this.currentItemStack = this.getCurrentItem(); - int var7; -- if(var3) { -- var7 = this.getInventorySlotContainItemAndDamage(var1, var2); -+ -+ if (par3) { -+ var7 = this.getInventorySlotContainItemAndDamage(par1, par2); - } else { -- var7 = this.getInventorySlotContainItem(var1); -+ var7 = this.getInventorySlotContainItem(par1); - } - -- if(var7 >= 0 && var7 < 9) { -+ if (var7 >= 0 && var7 < 9) { - this.currentItem = var7; - } else { -- if(var4 && var1 > 0) { -+ if (par4 && par1 > 0) { - int var6 = this.getFirstEmptyStack(); -- if(var6 >= 0 && var6 < 9) { -+ -+ if (var6 >= 0 && var6 < 9) { - this.currentItem = var6; - } - -- this.func_70439_a(Item.itemsList[var1], var2); -+ this.func_70439_a(Item.itemsList[par1], par2); - } -- - } - } - -- public void changeCurrentItem(int var1) { -- if(var1 > 0) { -- var1 = 1; -- } -- -- if(var1 < 0) { -- var1 = -1; -- } -- -- for(this.currentItem -= var1; this.currentItem < 0; this.currentItem += 9) { -- } -- -- while(this.currentItem >= 9) { -+ /** -+ * Switch the current item to the next one or the previous one -+ */ -+ public void changeCurrentItem(int par1) { -+ if (par1 > 0) { -+ par1 = 1; -+ } -+ -+ if (par1 < 0) { -+ par1 = -1; -+ } -+ -+ for (this.currentItem -= par1; this.currentItem < 0; this.currentItem += 9) { -+ ; -+ } -+ -+ while (this.currentItem >= 9) { - this.currentItem -= 9; - } -- - } - -- public int clearInventory(int var1, int var2) { -+ /** -+ * Clear this player's inventory, using the specified ID and metadata as filters or -1 for no filter. -+ */ -+ public int clearInventory(int par1, int par2) { - int var3 = 0; -- - int var4; - ItemStack var5; -- for(var4 = 0; var4 < this.mainInventory.length; ++var4) { -+ -+ for (var4 = 0; var4 < this.mainInventory.length; ++var4) { - var5 = this.mainInventory[var4]; -- if(var5 != null && (var1 <= -1 || var5.itemID == var1) && (var2 <= -1 || var5.getItemDamage() == var2)) { -+ -+ if (var5 != null && (par1 <= -1 || var5.itemID == par1) && (par2 <= -1 || var5.getItemDamage() == par2)) { - var3 += var5.stackSize; - this.mainInventory[var4] = null; - } - } - -- for(var4 = 0; var4 < this.armorInventory.length; ++var4) { -+ for (var4 = 0; var4 < this.armorInventory.length; ++var4) { - var5 = this.armorInventory[var4]; -- if(var5 != null && (var1 <= -1 || var5.itemID == var1) && (var2 <= -1 || var5.getItemDamage() == var2)) { -+ -+ if (var5 != null && (par1 <= -1 || var5.itemID == par1) && (par2 <= -1 || var5.getItemDamage() == par2)) { - var3 += var5.stackSize; - this.armorInventory[var4] = null; - } - } - -- if(this.itemStack != null) { -- if(var1 > -1 && this.itemStack.itemID != var1) { -+ if (this.itemStack != null) { -+ if (par1 > -1 && this.itemStack.itemID != par1) { - return var3; - } - -- if(var2 > -1 && this.itemStack.getItemDamage() != var2) { -+ if (par2 > -1 && this.itemStack.getItemDamage() != par2) { - return var3; - } - -@@ -141,65 +185,74 @@ - return var3; - } - -- public void func_70439_a(Item var1, int var2) { -- if(var1 != null) { -- if(this.currentItemStack != null && this.currentItemStack.isItemEnchantable() && this.getInventorySlotContainItemAndDamage(this.currentItemStack.itemID, this.currentItemStack.getItemDamageForDisplay()) == this.currentItem) { -+ public void func_70439_a(Item par1Item, int par2) { -+ if (par1Item != null) { -+ if (this.currentItemStack != null && this.currentItemStack.isItemEnchantable() && this.getInventorySlotContainItemAndDamage(this.currentItemStack.itemID, this.currentItemStack.getItemDamageForDisplay()) == this.currentItem) { - return; - } - -- int var3 = this.getInventorySlotContainItemAndDamage(var1.itemID, var2); -- if(var3 >= 0) { -+ int var3 = this.getInventorySlotContainItemAndDamage(par1Item.itemID, par2); -+ -+ if (var3 >= 0) { - int var4 = this.mainInventory[var3].stackSize; - this.mainInventory[var3] = this.mainInventory[this.currentItem]; -- this.mainInventory[this.currentItem] = new ItemStack(Item.itemsList[var1.itemID], var4, var2); -+ this.mainInventory[this.currentItem] = new ItemStack(Item.itemsList[par1Item.itemID], var4, par2); - } else { -- this.mainInventory[this.currentItem] = new ItemStack(Item.itemsList[var1.itemID], 1, var2); -+ this.mainInventory[this.currentItem] = new ItemStack(Item.itemsList[par1Item.itemID], 1, par2); - } - } -- - } - -- private int storePartialItemStack(ItemStack var1) { -- int var2 = var1.itemID; -- int var3 = var1.stackSize; -+ /** -+ * This function stores as many items of an ItemStack as possible in a matching slot and returns the quantity of left -+ * over items. -+ */ -+ private int storePartialItemStack(ItemStack par1ItemStack) { -+ int var2 = par1ItemStack.itemID; -+ int var3 = par1ItemStack.stackSize; - int var4; -- if(var1.getMaxStackSize() == 1) { -+ -+ if (par1ItemStack.getMaxStackSize() == 1) { - var4 = this.getFirstEmptyStack(); -- if(var4 < 0) { -+ -+ if (var4 < 0) { - return var3; - } else { -- if(this.mainInventory[var4] == null) { -- this.mainInventory[var4] = ItemStack.copyItemStack(var1); -+ if (this.mainInventory[var4] == null) { -+ this.mainInventory[var4] = ItemStack.copyItemStack(par1ItemStack); - } - - return 0; - } - } else { -- var4 = this.storeItemStack(var1); -- if(var4 < 0) { -+ var4 = this.storeItemStack(par1ItemStack); -+ -+ if (var4 < 0) { - var4 = this.getFirstEmptyStack(); - } - -- if(var4 < 0) { -+ if (var4 < 0) { - return var3; - } else { -- if(this.mainInventory[var4] == null) { -- this.mainInventory[var4] = new ItemStack(var2, 0, var1.getItemDamage()); -- if(var1.hasTagCompound()) { -- this.mainInventory[var4].setTagCompound((NBTTagCompound)var1.getTagCompound().copy()); -+ if (this.mainInventory[var4] == null) { -+ this.mainInventory[var4] = new ItemStack(var2, 0, par1ItemStack.getItemDamage()); -+ -+ if (par1ItemStack.hasTagCompound()) { -+ this.mainInventory[var4].setTagCompound((NBTTagCompound)par1ItemStack.getTagCompound().copy()); - } - } - - int var5 = var3; -- if(var3 > this.mainInventory[var4].getMaxStackSize() - this.mainInventory[var4].stackSize) { -+ -+ if (var3 > this.mainInventory[var4].getMaxStackSize() - this.mainInventory[var4].stackSize) { - var5 = this.mainInventory[var4].getMaxStackSize() - this.mainInventory[var4].stackSize; - } - -- if(var5 > this.getInventoryStackLimit() - this.mainInventory[var4].stackSize) { -+ if (var5 > this.getInventoryStackLimit() - this.mainInventory[var4].stackSize) { - var5 = this.getInventoryStackLimit() - this.mainInventory[var4].stackSize; - } - -- if(var5 == 0) { -+ if (var5 == 0) { - return var3; - } else { - var3 -= var5; -@@ -211,21 +264,28 @@ - } - } - -+ /** -+ * Decrement the number of animations remaining. Only called on client side. This is used to handle the animation of -+ * receiving a block. -+ */ - public void decrementAnimations() { -- for(int var1 = 0; var1 < this.mainInventory.length; ++var1) { -- if(this.mainInventory[var1] != null) { -+ for (int var1 = 0; var1 < this.mainInventory.length; ++var1) { -+ if (this.mainInventory[var1] != null) { - this.mainInventory[var1].updateAnimation(this.player.worldObj, this.player, var1, this.currentItem == var1); - } - } -- - } - -- public boolean consumeInventoryItem(int var1) { -- int var2 = this.getInventorySlotContainItem(var1); -- if(var2 < 0) { -+ /** -+ * removed one item of specified itemID from inventory (if it is in a stack, the stack size will reduce with 1) -+ */ -+ public boolean consumeInventoryItem(int par1) { -+ int var2 = this.getInventorySlotContainItem(par1); -+ -+ if (var2 < 0) { - return false; - } else { -- if(--this.mainInventory[var2].stackSize <= 0) { -+ if (--this.mainInventory[var2].stackSize <= 0) { - this.mainInventory[var2] = null; - } - -@@ -233,73 +293,88 @@ - } - } - -- public boolean hasItem(int var1) { -- int var2 = this.getInventorySlotContainItem(var1); -+ /** -+ * Get if a specifiied item id is inside the inventory. -+ */ -+ public boolean hasItem(int par1) { -+ int var2 = this.getInventorySlotContainItem(par1); - return var2 >= 0; - } - -- public boolean addItemStackToInventory(ItemStack var1) { -- if(var1 == null) { -+ /** -+ * Adds the item stack to the inventory, returns false if it is impossible. -+ */ -+ public boolean addItemStackToInventory(ItemStack par1ItemStack) { -+ if (par1ItemStack == null) { - return false; -- } else if(var1.stackSize == 0) { -+ } else if (par1ItemStack.stackSize == 0) { - return false; - } else { - try { - int var2; -- if(var1.isItemDamaged()) { -+ -+ if (par1ItemStack.isItemDamaged()) { - var2 = this.getFirstEmptyStack(); -- if(var2 >= 0) { -- this.mainInventory[var2] = ItemStack.copyItemStack(var1); -+ -+ if (var2 >= 0) { -+ this.mainInventory[var2] = ItemStack.copyItemStack(par1ItemStack); - this.mainInventory[var2].animationsToGo = 5; -- var1.stackSize = 0; -+ par1ItemStack.stackSize = 0; - return true; -- } else if(this.player.capabilities.isCreativeMode) { -- var1.stackSize = 0; -+ } else if (this.player.capabilities.isCreativeMode) { -+ par1ItemStack.stackSize = 0; - return true; - } else { - return false; - } - } else { - do { -- var2 = var1.stackSize; -- var1.stackSize = this.storePartialItemStack(var1); -- } while(var1.stackSize > 0 && var1.stackSize < var2); -+ var2 = par1ItemStack.stackSize; -+ par1ItemStack.stackSize = this.storePartialItemStack(par1ItemStack); -+ } while (par1ItemStack.stackSize > 0 && par1ItemStack.stackSize < var2); - -- if(var1.stackSize == var2 && this.player.capabilities.isCreativeMode) { -- var1.stackSize = 0; -+ if (par1ItemStack.stackSize == var2 && this.player.capabilities.isCreativeMode) { -+ par1ItemStack.stackSize = 0; - return true; - } else { -- return var1.stackSize < var2; -+ return par1ItemStack.stackSize < var2; - } - } - } catch (Throwable var5) { - CrashReport var3 = CrashReport.makeCrashReport(var5, "Adding item to inventory"); - CrashReportCategory var4 = var3.makeCategory("Item being added"); -- var4.addCrashSection("Item ID", Integer.valueOf(var1.itemID)); -- var4.addCrashSection("Item data", Integer.valueOf(var1.getItemDamage())); -- var4.addCrashSectionCallable("Item name", new CallableItemName(this, var1)); -+ var4.addCrashSection("Item ID", Integer.valueOf(par1ItemStack.itemID)); -+ var4.addCrashSection("Item data", Integer.valueOf(par1ItemStack.getItemDamage())); -+ var4.addCrashSectionCallable("Item name", new CallableItemName(this, par1ItemStack)); - throw new ReportedException(var3); - } - } - } - -- public ItemStack decrStackSize(int var1, int var2) { -+ /** -+ * Removes from an inventory slot (first arg) up to a specified number (second arg) of items and returns them in a new -+ * stack. -+ */ -+ public ItemStack decrStackSize(int par1, int par2) { - ItemStack[] var3 = this.mainInventory; -- if(var1 >= this.mainInventory.length) { -+ -+ if (par1 >= this.mainInventory.length) { - var3 = this.armorInventory; -- var1 -= this.mainInventory.length; -+ par1 -= this.mainInventory.length; - } - -- if(var3[var1] != null) { -+ if (var3[par1] != null) { - ItemStack var4; -- if(var3[var1].stackSize <= var2) { -- var4 = var3[var1]; -- var3[var1] = null; -+ -+ if (var3[par1].stackSize <= par2) { -+ var4 = var3[par1]; -+ var3[par1] = null; - return var4; - } else { -- var4 = var3[var1].splitStack(var2); -- if(var3[var1].stackSize == 0) { -- var3[var1] = null; -+ var4 = var3[par1].splitStack(par2); -+ -+ if (var3[par1].stackSize == 0) { -+ var3[par1] = null; - } - - return var4; -@@ -309,130 +384,178 @@ - } - } - -- public ItemStack getStackInSlotOnClosing(int var1) { -+ /** -+ * When some containers are closed they call this on each slot, then drop whatever it returns as an EntityItem - like -+ * when you close a workbench GUI. -+ */ -+ public ItemStack getStackInSlotOnClosing(int par1) { - ItemStack[] var2 = this.mainInventory; -- if(var1 >= this.mainInventory.length) { -+ -+ if (par1 >= this.mainInventory.length) { - var2 = this.armorInventory; -- var1 -= this.mainInventory.length; -+ par1 -= this.mainInventory.length; - } - -- if(var2[var1] != null) { -- ItemStack var3 = var2[var1]; -- var2[var1] = null; -+ if (var2[par1] != null) { -+ ItemStack var3 = var2[par1]; -+ var2[par1] = null; - return var3; - } else { - return null; - } - } - -- public void setInventorySlotContents(int var1, ItemStack var2) { -+ /** -+ * Sets the given item stack to the specified slot in the inventory (can be crafting or armor sections). -+ */ -+ public void setInventorySlotContents(int par1, ItemStack par2ItemStack) { - ItemStack[] var3 = this.mainInventory; -- if(var1 >= var3.length) { -- var1 -= var3.length; -+ -+ if (par1 >= var3.length) { -+ par1 -= var3.length; - var3 = this.armorInventory; - } - -- var3[var1] = var2; -+ var3[par1] = par2ItemStack; - } - -- public float getStrVsBlock(Block var1) { -+ /** -+ * Gets the strength of the current item (tool) against the specified block, 1.0f if not holding anything. -+ */ -+ public float getStrVsBlock(Block par1Block) { - float var2 = 1.0F; -- if(this.mainInventory[this.currentItem] != null) { -- var2 *= this.mainInventory[this.currentItem].getStrVsBlock(var1); -+ -+ if (this.mainInventory[this.currentItem] != null) { -+ var2 *= this.mainInventory[this.currentItem].getStrVsBlock(par1Block); - } - - return var2; - } - -- public NBTTagList writeToNBT(NBTTagList var1) { -+ /** -+ * Writes the inventory out as a list of compound tags. This is where the slot indices are used (+100 for armor, +80 -+ * for crafting). -+ */ -+ public NBTTagList writeToNBT(NBTTagList par1NBTTagList) { - int var2; - NBTTagCompound var3; -- for(var2 = 0; var2 < this.mainInventory.length; ++var2) { -- if(this.mainInventory[var2] != null) { -+ -+ for (var2 = 0; var2 < this.mainInventory.length; ++var2) { -+ if (this.mainInventory[var2] != null) { - var3 = new NBTTagCompound(); - var3.setByte("Slot", (byte)var2); - this.mainInventory[var2].writeToNBT(var3); -- var1.appendTag(var3); -+ par1NBTTagList.appendTag(var3); - } - } - -- for(var2 = 0; var2 < this.armorInventory.length; ++var2) { -- if(this.armorInventory[var2] != null) { -+ for (var2 = 0; var2 < this.armorInventory.length; ++var2) { -+ if (this.armorInventory[var2] != null) { - var3 = new NBTTagCompound(); - var3.setByte("Slot", (byte)(var2 + 100)); - this.armorInventory[var2].writeToNBT(var3); -- var1.appendTag(var3); -+ par1NBTTagList.appendTag(var3); - } - } - -- return var1; -+ return par1NBTTagList; - } - -- public void readFromNBT(NBTTagList var1) { -+ /** -+ * Reads from the given tag list and fills the slots in the inventory with the correct items. -+ */ -+ public void readFromNBT(NBTTagList par1NBTTagList) { - this.mainInventory = new ItemStack[36]; - this.armorInventory = new ItemStack[4]; - -- for(int var2 = 0; var2 < var1.tagCount(); ++var2) { -- NBTTagCompound var3 = (NBTTagCompound)var1.tagAt(var2); -+ for (int var2 = 0; var2 < par1NBTTagList.tagCount(); ++var2) { -+ NBTTagCompound var3 = (NBTTagCompound)par1NBTTagList.tagAt(var2); - int var4 = var3.getByte("Slot") & 255; - ItemStack var5 = ItemStack.loadItemStackFromNBT(var3); -- if(var5 != null) { -- if(var4 >= 0 && var4 < this.mainInventory.length) { -+ -+ if (var5 != null) { -+ if (var4 >= 0 && var4 < this.mainInventory.length) { - this.mainInventory[var4] = var5; - } - -- if(var4 >= 100 && var4 < this.armorInventory.length + 100) { -+ if (var4 >= 100 && var4 < this.armorInventory.length + 100) { - this.armorInventory[var4 - 100] = var5; - } - } - } -- - } - -+ /** -+ * Returns the number of slots in the inventory. -+ */ - public int getSizeInventory() { - return this.mainInventory.length + 4; - } - -- public ItemStack getStackInSlot(int var1) { -+ /** -+ * Returns the stack in slot i -+ */ -+ public ItemStack getStackInSlot(int par1) { - ItemStack[] var2 = this.mainInventory; -- if(var1 >= var2.length) { -- var1 -= var2.length; -+ -+ if (par1 >= var2.length) { -+ par1 -= var2.length; - var2 = this.armorInventory; - } - -- return var2[var1]; -+ return var2[par1]; - } - -+ /** -+ * Returns the name of the inventory. -+ */ - public String getInvName() { - return "container.inventory"; - } - -+ /** -+ * If this returns false, the inventory name will be used as an unlocalized name, and translated into the player's -+ * language. Otherwise it will be used directly. -+ */ - public boolean isInvNameLocalized() { - return false; - } - -+ /** -+ * Returns the maximum stack size for a inventory slot. Seems to always be 64, possibly will be extended. *Isn't this -+ * more of a set than a get?* -+ */ - public int getInventoryStackLimit() { - return 64; - } - -- public boolean canHarvestBlock(Block var1) { -- if(var1.blockMaterial.isToolNotRequired()) { -+ /** -+ * Returns whether the current item (tool) can harvest from the specified block (actually get a result). -+ */ -+ public boolean canHarvestBlock(Block par1Block) { -+ if (par1Block.blockMaterial.isToolNotRequired()) { - return true; - } else { - ItemStack var2 = this.getStackInSlot(this.currentItem); -- return var2 != null ? var2.canHarvestBlock(var1) : false; -+ return var2 != null ? var2.canHarvestBlock(par1Block) : false; - } - } - -- public ItemStack armorItemInSlot(int var1) { -- return this.armorInventory[var1]; -+ /** -+ * returns a player armor item (as itemstack) contained in specified armor slot. -+ */ -+ public ItemStack armorItemInSlot(int par1) { -+ return this.armorInventory[par1]; - } - -+ /** -+ * Based on the damage values and maximum damage values of each armor item, returns the current armor value. -+ */ - public int getTotalArmorValue() { - int var1 = 0; - -- for(int var2 = 0; var2 < this.armorInventory.length; ++var2) { -- if(this.armorInventory[var2] != null && this.armorInventory[var2].getItem() instanceof ItemArmor) { -+ for (int var2 = 0; var2 < this.armorInventory.length; ++var2) { -+ if (this.armorInventory[var2] != null && this.armorInventory[var2].getItem() instanceof ItemArmor) { - int var3 = ((ItemArmor)this.armorInventory[var2].getItem()).damageReduceAmount; - var1 += var3; - } -@@ -441,67 +564,84 @@ - return var1; - } - -- public void damageArmor(float var1) { -- var1 /= 4.0F; -- if(var1 < 1.0F) { -- var1 = 1.0F; -+ /** -+ * Damages armor in each slot by the specified amount. -+ */ -+ public void damageArmor(float par1) { -+ par1 /= 4.0F; -+ -+ if (par1 < 1.0F) { -+ par1 = 1.0F; - } - -- for(int var2 = 0; var2 < this.armorInventory.length; ++var2) { -- if(this.armorInventory[var2] != null && this.armorInventory[var2].getItem() instanceof ItemArmor) { -- this.armorInventory[var2].damageItem((int)var1, this.player); -- if(this.armorInventory[var2].stackSize == 0) { -+ for (int var2 = 0; var2 < this.armorInventory.length; ++var2) { -+ if (this.armorInventory[var2] != null && this.armorInventory[var2].getItem() instanceof ItemArmor) { -+ this.armorInventory[var2].damageItem((int)par1, this.player); -+ -+ if (this.armorInventory[var2].stackSize == 0) { - this.armorInventory[var2] = null; - } - } - } -- - } - -+ /** -+ * Drop all armor and main inventory items. -+ */ - public void dropAllItems() { - int var1; -- for(var1 = 0; var1 < this.mainInventory.length; ++var1) { -- if(this.mainInventory[var1] != null) { -+ -+ for (var1 = 0; var1 < this.mainInventory.length; ++var1) { -+ if (this.mainInventory[var1] != null) { - this.player.dropPlayerItemWithRandomChoice(this.mainInventory[var1], true); - this.mainInventory[var1] = null; - } - } - -- for(var1 = 0; var1 < this.armorInventory.length; ++var1) { -- if(this.armorInventory[var1] != null) { -+ for (var1 = 0; var1 < this.armorInventory.length; ++var1) { -+ if (this.armorInventory[var1] != null) { - this.player.dropPlayerItemWithRandomChoice(this.armorInventory[var1], true); - this.armorInventory[var1] = null; - } - } -- - } - -+ /** -+ * Called when an the contents of an Inventory change, usually -+ */ - public void onInventoryChanged() { - this.inventoryChanged = true; - } - -- public void setItemStack(ItemStack var1) { -- this.itemStack = var1; -+ public void setItemStack(ItemStack par1ItemStack) { -+ this.itemStack = par1ItemStack; - } - - public ItemStack getItemStack() { - return this.itemStack; - } - -- public boolean isUseableByPlayer(EntityPlayer var1) { -- return this.player.isDead ? false : var1.getDistanceSqToEntity(this.player) <= 64.0D; -+ /** -+ * Do not make give this method the name canInteractWith because it clashes with Container -+ */ -+ public boolean isUseableByPlayer(EntityPlayer par1EntityPlayer) { -+ return this.player.isDead ? false : par1EntityPlayer.getDistanceSqToEntity(this.player) <= 64.0D; - } - -- public boolean hasItemStack(ItemStack var1) { -+ /** -+ * Returns true if the specified ItemStack exists in the inventory. -+ */ -+ public boolean hasItemStack(ItemStack par1ItemStack) { - int var2; -- for(var2 = 0; var2 < this.armorInventory.length; ++var2) { -- if(this.armorInventory[var2] != null && this.armorInventory[var2].isItemEqual(var1)) { -+ -+ for (var2 = 0; var2 < this.armorInventory.length; ++var2) { -+ if (this.armorInventory[var2] != null && this.armorInventory[var2].isItemEqual(par1ItemStack)) { - return true; - } - } - -- for(var2 = 0; var2 < this.mainInventory.length; ++var2) { -- if(this.mainInventory[var2] != null && this.mainInventory[var2].isItemEqual(var1)) { -+ for (var2 = 0; var2 < this.mainInventory.length; ++var2) { -+ if (this.mainInventory[var2] != null && this.mainInventory[var2].isItemEqual(par1ItemStack)) { - return true; - } - } -@@ -509,26 +649,31 @@ - return false; - } - -- public void openChest() { -- } -- -- public void closeChest() { -- } -- -- public boolean isItemValidForSlot(int var1, ItemStack var2) { -+ public void openChest() {} -+ -+ public void closeChest() {} -+ -+ /** -+ * Returns true if automation is allowed to insert the given stack (ignoring stack size) into the given slot. -+ */ -+ public boolean isItemValidForSlot(int par1, ItemStack par2ItemStack) { - return true; - } - -- public void copyInventory(InventoryPlayer var1) { -+ /** -+ * Copy the ItemStack contents from another InventoryPlayer instance -+ */ -+ public void copyInventory(InventoryPlayer par1InventoryPlayer) { - int var2; -- for(var2 = 0; var2 < this.mainInventory.length; ++var2) { -- this.mainInventory[var2] = ItemStack.copyItemStack(var1.mainInventory[var2]); -- } -- -- for(var2 = 0; var2 < this.armorInventory.length; ++var2) { -- this.armorInventory[var2] = ItemStack.copyItemStack(var1.armorInventory[var2]); -- } -- -- this.currentItem = var1.currentItem; -+ -+ for (var2 = 0; var2 < this.mainInventory.length; ++var2) { -+ this.mainInventory[var2] = ItemStack.copyItemStack(par1InventoryPlayer.mainInventory[var2]); -+ } -+ -+ for (var2 = 0; var2 < this.armorInventory.length; ++var2) { -+ this.armorInventory[var2] = ItemStack.copyItemStack(par1InventoryPlayer.armorInventory[var2]); -+ } -+ -+ this.currentItem = par1InventoryPlayer.currentItem; - } - } ---- net/minecraft/src/Session.java -+++ net/minecraft/src/Session.java -@@ -1,19 +1,19 @@ - package net.minecraft.src; - - public class Session { -- private final String a; -- private final String b; -+ private final String username; -+ private final String sessionId; - -- public Session(String var1, String var2) { -- this.a = var1; -- this.b = var2; -+ public Session(String par1Str, String par2Str) { -+ this.username = par1Str; -+ this.sessionId = par2Str; - } - - public String getUsername() { -- return this.a; -+ return this.username; - } - - public String getSessionID() { -- return this.b; -+ return this.sessionId; - } - } ---- /dev/null -+++ org/spoutcraft/client/gui/controls/DeleteControlButton.java -@@ -1,0 +1,40 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.client.gui.controls; -+ -+import org.spoutcraft.client.gui.SafeButton; -+ -+public class DeleteControlButton extends SafeButton { -+ private GuiControls parent; -+ -+ public DeleteControlButton(GuiControls parent) { -+ setText("Delete"); -+ this.parent = parent; -+ } -+ -+ @Override -+ protected void executeAction() { -+ parent.deleteCurrentControl(); -+ } -+ -+ public void setReallyShown(boolean show) { -+ this.reallyShown = show; -+ } -+} ---- /dev/null -+++ org/spoutcraft/api/gui/PasswordTextProcessor.java -@@ -1,0 +1,205 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.api.gui; -+ -+import java.util.Iterator; -+ -+import org.spoutcraft.api.Spoutcraft; -+import org.spoutcraft.api.UnsafeClass; -+ -+@UnsafeClass -+public class PasswordTextProcessor implements TextProcessor { -+ protected static final char CHAR_ASTERISK = '*'; -+ -+ protected int charLimit = 0; -+ protected int width = 0; -+ protected int cursor = 0; -+ protected StringBuffer textBuffer = new StringBuffer(); -+ protected MinecraftFont font = Spoutcraft.getClient().getRenderDelegate().getMinecraftFont(); -+ protected final int CHAR_ASTERISK_WIDTH = font.getTextWidth(String.valueOf(CHAR_ASTERISK)); -+ protected int maxAsteriskChars = 0; -+ -+ public PasswordTextProcessor() { -+ } -+ -+ public void clear() { -+ textBuffer.delete(0, textBuffer.length()); -+ cursor = 0; -+ } -+ -+ public int getCursor() { -+ return cursor; -+ } -+ -+ public void setCursor(int cursor) { -+ this.cursor = cursor; -+ correctCursor(); -+ } -+ -+ protected void correctCursor() { -+ cursor = Math.max(0, Math.min(cursor, textBuffer.length())); -+ } -+ -+ public int[] getCursor2D() { -+ return new int[] { 0, cursor }; -+ } -+ -+ public int getMaximumCharacters() { -+ return charLimit; -+ } -+ -+ public void setMaximumCharacters(int max) { -+ this.charLimit = max; -+ } -+ -+ public int getMaximumLines() { -+ return 1; -+ } -+ -+ public void setMaximumLines(int max) { -+ // Ignore (can only be 1) -+ } -+ -+ public String getText() { -+ return textBuffer.toString(); -+ } -+ -+ public void setText(String str) { -+ clear(); -+ if (str.length() > 0) { -+ if (charLimit > 0 && str.length() > charLimit) { -+ str = str.substring(0, charLimit); -+ } -+ if (str.length() > maxAsteriskChars) { -+ str = str.substring(0, maxAsteriskChars); -+ } -+ textBuffer.append(str); -+ cursor = textBuffer.length(); -+ } -+ } -+ -+ protected boolean isRangeValid(int start, int end) { -+ return start >= 0 && end <= textBuffer.length() && start < end; -+ } -+ -+ protected boolean insert(char c) { -+ if (textBuffer.length() + 1 > maxAsteriskChars || (charLimit > 0 && textBuffer.length() >= charLimit)) { -+ return false; -+ } -+ textBuffer.insert(cursor++, c); -+ return true; -+ } -+ -+ protected boolean delete(int start, int end, int cursorPos) { -+ if (isRangeValid(start, end)) { -+ textBuffer.delete(start, end); -+ cursor = cursorPos; -+ correctCursor(); -+ return true; -+ } -+ return false; -+ } -+ -+ public int getWidth() { -+ return width; -+ } -+ -+ public void setWidth(int width) { -+ this.width = width; -+ maxAsteriskChars = (int) Math.floor(width / CHAR_ASTERISK_WIDTH); -+ } -+ -+ public Iterator iterator() { -+ final char[] hiddenText = new char[textBuffer.length()]; -+ for (int i = 0; i < textBuffer.length(); ++i) { -+ hiddenText[i] = CHAR_ASTERISK; -+ } -+ -+ Iterator iter = new Iterator() { -+ int iteratorPos = 0; -+ String s = new String(hiddenText); -+ -+ public void remove() { -+ } -+ -+ public String next() { -+ ++iteratorPos; -+ return s; -+ } -+ -+ public boolean hasNext() { -+ return iteratorPos == 0; -+ } -+ }; -+ return iter; -+ } -+ -+ public boolean handleInput(char key, int keyId) { -+ boolean ctrl = Keyboard.isKeyDown(Keyboard.KEY_LCONTROL) || Keyboard.isKeyDown(Keyboard.KEY_RCONTROL); -+ if (keyId == Keyboard.KEY_BACK.getKeyCode()) { -+ if (ctrl) { -+ return delete(0, cursor, 0); -+ } else { -+ return delete(cursor - 1, cursor, cursor - 1); -+ } -+ } -+ if (keyId == Keyboard.KEY_DELETE.getKeyCode()) { -+ if (ctrl) { -+ return delete(cursor, textBuffer.length(), cursor); -+ } else { -+ return delete(cursor, cursor + 1, cursor); -+ } -+ } -+ if (keyId == Keyboard.KEY_UP.getKeyCode() || keyId == Keyboard.KEY_HOME.getKeyCode()) { -+ cursor = 0; -+ return false; -+ } -+ if (keyId == Keyboard.KEY_LEFT.getKeyCode()) { -+ if (ctrl) { -+ cursor = 0; -+ } else { -+ cursor = Math.max(0, --cursor); -+ } -+ return false; -+ } -+ if (keyId == Keyboard.KEY_DOWN.getKeyCode() || keyId == Keyboard.KEY_END.getKeyCode()) { -+ cursor = textBuffer.length(); -+ return false; -+ } -+ if (keyId == Keyboard.KEY_RIGHT.getKeyCode()) { -+ if (ctrl) { -+ cursor = textBuffer.length(); -+ } else { -+ cursor = Math.min(textBuffer.length(), ++cursor); -+ } -+ return false; -+ } -+ if (keyId == Keyboard.KEY_D.getKeyCode() || keyId == Keyboard.KEY_C.getKeyCode()) { -+ if (ctrl) { -+ clear(); -+ return true; -+ } -+ } -+ if (font.isAllowedChar(key)) { -+ return insert(key); -+ } -+ return false; -+ } -+} ---- net/minecraft/src/Packet56MapChunks.java -+++ net/minecraft/src/Packet56MapChunks.java -@@ -13,29 +13,38 @@ - private int[] chunkPosZ; - public int[] field_73590_a; - public int[] field_73588_b; -+ -+ /** The compressed chunk data buffer */ - private byte[] chunkDataBuffer; - private byte[][] field_73584_f; -+ -+ /** total size of the compressed data */ - private int dataLength; -+ -+ /** -+ * Whether or not the chunk data contains a light nibble array. This is true in the main world, false in the end + -+ * nether. -+ */ - private boolean skyLightSent; - private static byte[] chunkDataNotCompressed = new byte[0]; - -- public Packet56MapChunks() { -- } -+ public Packet56MapChunks() {} - -- public Packet56MapChunks(List var1) { -- int var2 = var1.size(); -+ public Packet56MapChunks(List par1List) { -+ int var2 = par1List.size(); - this.chunkPostX = new int[var2]; - this.chunkPosZ = new int[var2]; - this.field_73590_a = new int[var2]; - this.field_73588_b = new int[var2]; - this.field_73584_f = new byte[var2][]; -- this.skyLightSent = !var1.isEmpty() && !((Chunk)var1.get(0)).worldObj.provider.hasNoSky; -+ this.skyLightSent = !par1List.isEmpty() && !((Chunk)par1List.get(0)).worldObj.provider.hasNoSky; - int var3 = 0; - -- for(int var4 = 0; var4 < var2; ++var4) { -- Chunk var5 = (Chunk)var1.get(var4); -- Packet51MapChunkData var6 = Packet51MapChunk.getMapChunkData(var5, true, '\uffff'); -- if(chunkDataNotCompressed.length < var3 + var6.compressedData.length) { -+ for (int var4 = 0; var4 < var2; ++var4) { -+ Chunk var5 = (Chunk)par1List.get(var4); -+ Packet51MapChunkData var6 = Packet51MapChunk.getMapChunkData(var5, true, 65535); -+ -+ if (chunkDataNotCompressed.length < var3 + var6.compressedData.length) { - byte[] var7 = new byte[var3 + var6.compressedData.length]; - System.arraycopy(chunkDataNotCompressed, 0, var7, 0, chunkDataNotCompressed.length); - chunkDataNotCompressed = var7; -@@ -60,23 +69,26 @@ - } finally { - var11.end(); - } -- - } - -- public void readPacketData(DataInput var1) throws IOException { -- short var2 = var1.readShort(); -- this.dataLength = var1.readInt(); -- this.skyLightSent = var1.readBoolean(); -+ /** -+ * Abstract. Reads the raw packet data from the data stream. -+ */ -+ public void readPacketData(DataInput par1DataInput) throws IOException { -+ short var2 = par1DataInput.readShort(); -+ this.dataLength = par1DataInput.readInt(); -+ this.skyLightSent = par1DataInput.readBoolean(); - this.chunkPostX = new int[var2]; - this.chunkPosZ = new int[var2]; - this.field_73590_a = new int[var2]; - this.field_73588_b = new int[var2]; - this.field_73584_f = new byte[var2][]; -- if(chunkDataNotCompressed.length < this.dataLength) { -+ -+ if (chunkDataNotCompressed.length < this.dataLength) { - chunkDataNotCompressed = new byte[this.dataLength]; - } - -- var1.readFully(chunkDataNotCompressed, 0, this.dataLength); -+ par1DataInput.readFully(chunkDataNotCompressed, 0, this.dataLength); - byte[] var3 = new byte[196864 * var2]; - Inflater var4 = new Inflater(); - var4.setInput(chunkDataNotCompressed, 0, this.dataLength); -@@ -91,23 +103,24 @@ - - int var5 = 0; - -- for(int var6 = 0; var6 < var2; ++var6) { -- this.chunkPostX[var6] = var1.readInt(); -- this.chunkPosZ[var6] = var1.readInt(); -- this.field_73590_a[var6] = var1.readShort(); -- this.field_73588_b[var6] = var1.readShort(); -+ for (int var6 = 0; var6 < var2; ++var6) { -+ this.chunkPostX[var6] = par1DataInput.readInt(); -+ this.chunkPosZ[var6] = par1DataInput.readInt(); -+ this.field_73590_a[var6] = par1DataInput.readShort(); -+ this.field_73588_b[var6] = par1DataInput.readShort(); - int var7 = 0; - int var8 = 0; -- - int var9; -- for(var9 = 0; var9 < 16; ++var9) { -+ -+ for (var9 = 0; var9 < 16; ++var9) { - var7 += this.field_73590_a[var6] >> var9 & 1; - var8 += this.field_73588_b[var6] >> var9 & 1; - } - - var9 = 2048 * 4 * var7 + 256; - var9 += 2048 * var8; -- if(this.skyLightSent) { -+ -+ if (this.skyLightSent) { - var9 += 2048 * var7; - } - -@@ -115,45 +128,52 @@ - System.arraycopy(var3, var5, this.field_73584_f[var6], 0, var9); - var5 += var9; - } -- - } - -- public void writePacketData(DataOutput var1) throws IOException { -- var1.writeShort(this.chunkPostX.length); -- var1.writeInt(this.dataLength); -- var1.writeBoolean(this.skyLightSent); -- var1.write(this.chunkDataBuffer, 0, this.dataLength); -+ /** -+ * Abstract. Writes the raw packet data to the data stream. -+ */ -+ public void writePacketData(DataOutput par1DataOutput) throws IOException { -+ par1DataOutput.writeShort(this.chunkPostX.length); -+ par1DataOutput.writeInt(this.dataLength); -+ par1DataOutput.writeBoolean(this.skyLightSent); -+ par1DataOutput.write(this.chunkDataBuffer, 0, this.dataLength); - -- for(int var2 = 0; var2 < this.chunkPostX.length; ++var2) { -- var1.writeInt(this.chunkPostX[var2]); -- var1.writeInt(this.chunkPosZ[var2]); -- var1.writeShort((short)(this.field_73590_a[var2] & '\uffff')); -- var1.writeShort((short)(this.field_73588_b[var2] & '\uffff')); -+ for (int var2 = 0; var2 < this.chunkPostX.length; ++var2) { -+ par1DataOutput.writeInt(this.chunkPostX[var2]); -+ par1DataOutput.writeInt(this.chunkPosZ[var2]); -+ par1DataOutput.writeShort((short)(this.field_73590_a[var2] & 65535)); -+ par1DataOutput.writeShort((short)(this.field_73588_b[var2] & 65535)); - } -- -- } -- -- public void processPacket(NetHandler var1) { -- var1.handleMapChunks(this); -- } -- -+ } -+ -+ /** -+ * Passes this Packet on to the NetHandler for processing. -+ */ -+ public void processPacket(NetHandler par1NetHandler) { -+ par1NetHandler.handleMapChunks(this); -+ } -+ -+ /** -+ * Abstract. Return the size of the packet (not counting the header). -+ */ - public int getPacketSize() { - return 6 + this.dataLength + 12 * this.getNumberOfChunkInPacket(); - } - -- public int getChunkPosX(int var1) { -- return this.chunkPostX[var1]; -+ public int getChunkPosX(int par1) { -+ return this.chunkPostX[par1]; - } - -- public int getChunkPosZ(int var1) { -- return this.chunkPosZ[var1]; -+ public int getChunkPosZ(int par1) { -+ return this.chunkPosZ[par1]; - } - - public int getNumberOfChunkInPacket() { - return this.chunkPostX.length; - } - -- public byte[] getChunkCompressedData(int var1) { -- return this.field_73584_f[var1]; -+ public byte[] getChunkCompressedData(int par1) { -+ return this.field_73584_f[par1]; - } - } ---- net/minecraft/src/Packet253ServerAuthData.java -+++ net/minecraft/src/Packet253ServerAuthData.java -@@ -6,45 +6,56 @@ - import java.security.PublicKey; - - public class Packet253ServerAuthData extends Packet { -- private String a; -- private PublicKey b; -+ private String serverId; -+ private PublicKey publicKey; - private byte[] verifyToken = new byte[0]; - -- public Packet253ServerAuthData() { -- } -- -- public Packet253ServerAuthData(String var1, PublicKey var2, byte[] var3) { -- this.a = var1; -- this.b = var2; -- this.verifyToken = var3; -- } -- -- public void readPacketData(DataInput var1) throws IOException { -- this.a = readString(var1, 20); -- this.b = CryptManager.decodePublicKey(readBytesFromStream(var1)); -- this.verifyToken = readBytesFromStream(var1); -- } -- -- public void writePacketData(DataOutput var1) throws IOException { -- writeString(this.a, var1); -- writeByteArray(var1, this.b.getEncoded()); -- writeByteArray(var1, this.verifyToken); -- } -- -- public void processPacket(NetHandler var1) { -- var1.handleServerAuthData(this); -- } -- -+ public Packet253ServerAuthData() {} -+ -+ public Packet253ServerAuthData(String par1Str, PublicKey par2PublicKey, byte[] par3ArrayOfByte) { -+ this.serverId = par1Str; -+ this.publicKey = par2PublicKey; -+ this.verifyToken = par3ArrayOfByte; -+ } -+ -+ /** -+ * Abstract. Reads the raw packet data from the data stream. -+ */ -+ public void readPacketData(DataInput par1DataInput) throws IOException { -+ this.serverId = readString(par1DataInput, 20); -+ this.publicKey = CryptManager.decodePublicKey(readBytesFromStream(par1DataInput)); -+ this.verifyToken = readBytesFromStream(par1DataInput); -+ } -+ -+ /** -+ * Abstract. Writes the raw packet data to the data stream. -+ */ -+ public void writePacketData(DataOutput par1DataOutput) throws IOException { -+ writeString(this.serverId, par1DataOutput); -+ writeByteArray(par1DataOutput, this.publicKey.getEncoded()); -+ writeByteArray(par1DataOutput, this.verifyToken); -+ } -+ -+ /** -+ * Passes this Packet on to the NetHandler for processing. -+ */ -+ public void processPacket(NetHandler par1NetHandler) { -+ par1NetHandler.handleServerAuthData(this); -+ } -+ -+ /** -+ * Abstract. Return the size of the packet (not counting the header). -+ */ - public int getPacketSize() { -- return 2 + this.a.length() * 2 + 2 + this.b.getEncoded().length + 2 + this.verifyToken.length; -+ return 2 + this.serverId.length() * 2 + 2 + this.publicKey.getEncoded().length + 2 + this.verifyToken.length; - } - - public String getServerId() { -- return this.a; -+ return this.serverId; - } - - public PublicKey getPublicKey() { -- return this.b; -+ return this.publicKey; - } - - public byte[] getVerifyToken() { ---- net/minecraft/src/Packet52MultiBlockChange.java -+++ net/minecraft/src/Packet52MultiBlockChange.java -@@ -7,9 +7,17 @@ - import java.io.IOException; - - public class Packet52MultiBlockChange extends Packet { -+ -+ /** Chunk X position. */ - public int xPosition; -+ -+ /** Chunk Z position. */ - public int zPosition; -+ -+ /** The metadata for each block changed. */ - public byte[] metadataArray; -+ -+ /** The size of the arrays. */ - public int size; - private static byte[] field_73449_e = new byte[0]; - -@@ -17,34 +25,36 @@ - this.isChunkDataPacket = true; - } - -- public Packet52MultiBlockChange(int var1, int var2, short[] var3, int var4, World var5) { -+ public Packet52MultiBlockChange(int par1, int par2, short[] par3ArrayOfShort, int par4, World par5World) { - this.isChunkDataPacket = true; -- this.xPosition = var1; -- this.zPosition = var2; -- this.size = var4; -- int var6 = 4 * var4; -- Chunk var7 = var5.getChunkFromChunkCoords(var1, var2); -+ this.xPosition = par1; -+ this.zPosition = par2; -+ this.size = par4; -+ int var6 = 4 * par4; -+ Chunk var7 = par5World.getChunkFromChunkCoords(par1, par2); - - try { -- if(var4 >= 64) { -- this.field_98193_m.logInfo("ChunkTilesUpdatePacket compress " + var4); -- if(field_73449_e.length < var6) { -+ if (par4 >= 64) { -+ this.field_98193_m.logInfo("ChunkTilesUpdatePacket compress " + par4); -+ -+ if (field_73449_e.length < var6) { - field_73449_e = new byte[var6]; - } - } else { - ByteArrayOutputStream var8 = new ByteArrayOutputStream(var6); - DataOutputStream var9 = new DataOutputStream(var8); - -- for(int var10 = 0; var10 < var4; ++var10) { -- int var11 = var3[var10] >> 12 & 15; -- int var12 = var3[var10] >> 8 & 15; -- int var13 = var3[var10] & 255; -- var9.writeShort(var3[var10]); -+ for (int var10 = 0; var10 < par4; ++var10) { -+ int var11 = par3ArrayOfShort[var10] >> 12 & 15; -+ int var12 = par3ArrayOfShort[var10] >> 8 & 15; -+ int var13 = par3ArrayOfShort[var10] & 255; -+ var9.writeShort(par3ArrayOfShort[var10]); - var9.writeShort((short)((var7.getBlockID(var11, var13, var12) & 4095) << 4 | var7.getBlockMetadata(var11, var13, var12) & 15)); - } - - this.metadataArray = var8.toByteArray(); -- if(this.metadataArray.length != var6) { -+ -+ if (this.metadataArray.length != var6) { - throw new RuntimeException("Expected length " + var6 + " doesn\'t match received length " + this.metadataArray.length); - } - } -@@ -52,38 +62,49 @@ - this.field_98193_m.logSevereException("Couldn\'t create chunk packet", var14); - this.metadataArray = null; - } -- - } - -- public void readPacketData(DataInput var1) throws IOException { -- this.xPosition = var1.readInt(); -- this.zPosition = var1.readInt(); -- this.size = var1.readShort() & '\uffff'; -- int var2 = var1.readInt(); -- if(var2 > 0) { -+ /** -+ * Abstract. Reads the raw packet data from the data stream. -+ */ -+ public void readPacketData(DataInput par1DataInput) throws IOException { -+ this.xPosition = par1DataInput.readInt(); -+ this.zPosition = par1DataInput.readInt(); -+ this.size = par1DataInput.readShort() & 65535; -+ int var2 = par1DataInput.readInt(); -+ -+ if (var2 > 0) { - this.metadataArray = new byte[var2]; -- var1.readFully(this.metadataArray); -+ par1DataInput.readFully(this.metadataArray); - } -- - } - -- public void writePacketData(DataOutput var1) throws IOException { -- var1.writeInt(this.xPosition); -- var1.writeInt(this.zPosition); -- var1.writeShort((short)this.size); -- if(this.metadataArray != null) { -- var1.writeInt(this.metadataArray.length); -- var1.write(this.metadataArray); -+ /** -+ * Abstract. Writes the raw packet data to the data stream. -+ */ -+ public void writePacketData(DataOutput par1DataOutput) throws IOException { -+ par1DataOutput.writeInt(this.xPosition); -+ par1DataOutput.writeInt(this.zPosition); -+ par1DataOutput.writeShort((short)this.size); -+ -+ if (this.metadataArray != null) { -+ par1DataOutput.writeInt(this.metadataArray.length); -+ par1DataOutput.write(this.metadataArray); - } else { -- var1.writeInt(0); -+ par1DataOutput.writeInt(0); - } -- -- } -- -- public void processPacket(NetHandler var1) { -- var1.handleMultiBlockChange(this); -- } -- -+ } -+ -+ /** -+ * Passes this Packet on to the NetHandler for processing. -+ */ -+ public void processPacket(NetHandler par1NetHandler) { -+ par1NetHandler.handleMultiBlockChange(this); -+ } -+ -+ /** -+ * Abstract. Return the size of the packet (not counting the header). -+ */ - public int getPacketSize() { - return 10 + this.size * 4; - } ---- net/minecraft/src/CommandServerKick.java -+++ net/minecraft/src/CommandServerKick.java -@@ -8,41 +8,48 @@ - return "kick"; - } - -+ /** -+ * Return the required permission level for this command. -+ */ - public int getRequiredPermissionLevel() { - return 3; - } - -- public String getCommandUsage(ICommandSender var1) { -+ public String getCommandUsage(ICommandSender par1ICommandSender) { - return "commands.kick.usage"; - } - -- public void processCommand(ICommandSender var1, String[] var2) { -- if(var2.length > 0 && var2[0].length() > 1) { -- EntityPlayerMP var3 = MinecraftServer.getServer().getConfigurationManager().getPlayerEntity(var2[0]); -+ public void processCommand(ICommandSender par1ICommandSender, String[] par2ArrayOfStr) { -+ if (par2ArrayOfStr.length > 0 && par2ArrayOfStr[0].length() > 1) { -+ EntityPlayerMP var3 = MinecraftServer.getServer().getConfigurationManager().getPlayerForUsername(par2ArrayOfStr[0]); - String var4 = "Kicked by an operator."; - boolean var5 = false; -- if(var3 == null) { -+ -+ if (var3 == null) { - throw new PlayerNotFoundException(); - } else { -- if(var2.length >= 2) { -- var4 = func_82360_a(var1, var2, 1); -+ if (par2ArrayOfStr.length >= 2) { -+ var4 = func_82360_a(par1ICommandSender, par2ArrayOfStr, 1); - var5 = true; - } - -- var3.playerNetServerHandler.kickPlayer(var4); -- if(var5) { -- notifyAdmins(var1, "commands.kick.success.reason", new Object[]{var3.getEntityName(), var4}); -+ var3.playerNetServerHandler.kickPlayerFromServer(var4); -+ -+ if (var5) { -+ notifyAdmins(par1ICommandSender, "commands.kick.success.reason", new Object[] {var3.getEntityName(), var4}); - } else { -- notifyAdmins(var1, "commands.kick.success", new Object[]{var3.getEntityName()}); -+ notifyAdmins(par1ICommandSender, "commands.kick.success", new Object[] {var3.getEntityName()}); - } -- - } - } else { - throw new WrongUsageException("commands.kick.usage", new Object[0]); - } - } - -- public List addTabCompletionOptions(ICommandSender var1, String[] var2) { -- return var2.length >= 1 ? getListOfStringsMatchingLastWord(var2, MinecraftServer.getServer().getAllUsernames()) : null; -+ /** -+ * Adds the strings available in this command to the given list of tab completion options. -+ */ -+ public List addTabCompletionOptions(ICommandSender par1ICommandSender, String[] par2ArrayOfStr) { -+ return par2ArrayOfStr.length >= 1 ? getListOfStringsMatchingLastWord(par2ArrayOfStr, MinecraftServer.getServer().getAllUsernames()) : null; - } - } ---- /dev/null -+++ org/bukkit/util/config/ConfigurationException.java -@@ -1,0 +1,16 @@ -+package org.bukkit.util.config; -+ -+/** -+ * Configuration exception. -+ */ -+public class ConfigurationException extends Exception { -+ private static final long serialVersionUID = -2442886939908724203L; -+ -+ public ConfigurationException() { -+ super(); -+ } -+ -+ public ConfigurationException(String msg) { -+ super(msg); -+ } -+} ---- net/minecraft/src/EnchantmentNameParts.java -+++ net/minecraft/src/EnchantmentNameParts.java -@@ -3,26 +3,38 @@ - import java.util.Random; - - public class EnchantmentNameParts { -+ -+ /** The static instance of this class. */ - public static final EnchantmentNameParts instance = new EnchantmentNameParts(); -- private Random b = new Random(); -- private String[] c = "the elder scrolls klaatu berata niktu xyzzy bless curse light darkness fire air earth water hot dry cold wet ignite snuff embiggen twist shorten stretch fiddle destroy imbue galvanize enchant free limited range of towards inside sphere cube self other ball mental physical grow shrink demon elemental spirit animal creature beast humanoid undead fresh stale ".split(" "); -- -+ -+ /** The RNG used to generate enchant names. */ -+ private Random rand = new Random(); -+ -+ /** List of words used to generate an enchant name. */ -+ private String[] wordList = "the elder scrolls klaatu berata niktu xyzzy bless curse light darkness fire air earth water hot dry cold wet ignite snuff embiggen twist shorten stretch fiddle destroy imbue galvanize enchant free limited range of towards inside sphere cube self other ball mental physical grow shrink demon elemental spirit animal creature beast humanoid undead fresh stale ".split(" "); -+ -+ /** -+ * Generates a random enchant name. -+ */ - public String generateRandomEnchantName() { -- int var1 = this.b.nextInt(2) + 3; -+ int var1 = this.rand.nextInt(2) + 3; - String var2 = ""; - -- for(int var3 = 0; var3 < var1; ++var3) { -- if(var3 > 0) { -+ for (int var3 = 0; var3 < var1; ++var3) { -+ if (var3 > 0) { - var2 = var2 + " "; - } - -- var2 = var2 + this.c[this.b.nextInt(this.c.length)]; -+ var2 = var2 + this.wordList[this.rand.nextInt(this.wordList.length)]; - } - - return var2; - } - -- public void setRandSeed(long var1) { -- this.b.setSeed(var1); -+ /** -+ * Sets the seed for the enchant name RNG. -+ */ -+ public void setRandSeed(long par1) { -+ this.rand.setSeed(par1); - } - } ---- net/minecraft/src/BiomeGenMushroomIsland.java -+++ net/minecraft/src/BiomeGenMushroomIsland.java -@@ -1,17 +1,17 @@ - package net.minecraft.src; - - public class BiomeGenMushroomIsland extends BiomeGenBase { -- public BiomeGenMushroomIsland(int var1) { -- super(var1); -+ public BiomeGenMushroomIsland(int par1) { -+ super(par1); - this.theBiomeDecorator.treesPerChunk = -100; - this.theBiomeDecorator.flowersPerChunk = -100; - this.theBiomeDecorator.grassPerChunk = -100; - this.theBiomeDecorator.mushroomsPerChunk = 1; - this.theBiomeDecorator.bigMushroomsPerChunk = 1; - this.topBlock = (byte)Block.mycelium.blockID; -- this.J.clear(); -- this.K.clear(); -- this.L.clear(); -- this.K.add(new SpawnListEntry(EntityMooshroom.class, 8, 4, 8)); -+ this.spawnableMonsterList.clear(); -+ this.spawnableCreatureList.clear(); -+ this.spawnableWaterCreatureList.clear(); -+ this.spawnableCreatureList.add(new SpawnListEntry(EntityMooshroom.class, 8, 4, 8)); - } - } ---- /dev/null -+++ org/spoutcraft/api/gui/ScrollBarPolicy.java -@@ -1,0 +1,58 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.api.gui; -+ -+import java.util.HashMap; -+ -+public enum ScrollBarPolicy { -+ /** -+ * Shows the scrollbar when getMaximumScrollPosition is greater than 0 -+ */ -+ SHOW_IF_NEEDED(0), -+ /** -+ * Never show the scrollbar. However, you'll still be able to scroll with the scroll wheel or your trackpad or with arrow keys if the widget implemented that (like the list widget). -+ */ -+ SHOW_NEVER(1), -+ /** -+ * Always show the scrollbar -+ */ -+ SHOW_ALWAYS(2), -+ ; -+ -+ private final int id; -+ private static HashMap ids = new HashMap(); -+ ScrollBarPolicy(int id) { -+ this.id = id; -+ } -+ -+ public int getId() { -+ return id; -+ } -+ -+ public static ScrollBarPolicy getById(int id) { -+ return ids.get(id); -+ } -+ -+ static { -+ for (ScrollBarPolicy s:values()) { -+ ids.put(s.id, s); -+ } -+ } -+} ---- net/minecraft/src/ConvertingProgressUpdate.java -+++ net/minecraft/src/ConvertingProgressUpdate.java -@@ -4,24 +4,32 @@ - - public class ConvertingProgressUpdate implements IProgressUpdate { - private long field_96245_b; -- final MinecraftServer a; -- -- public ConvertingProgressUpdate(MinecraftServer var1) { -- this.a = var1; -- this.field_96245_b = MinecraftServer.getCurrentTimeMillis(); -- } -- -- public void displaySavingString(String var1) { -- } -- -- public void setLoadingProgress(int var1) { -- if(MinecraftServer.getCurrentTimeMillis() - this.field_96245_b >= 1000L) { -- this.field_96245_b = MinecraftServer.getCurrentTimeMillis(); -- this.a.getLogAgent().logInfo("Converting... " + var1 + "%"); -+ -+ /** Reference to the MinecraftServer object. */ -+ final MinecraftServer mcServer; -+ -+ public ConvertingProgressUpdate(MinecraftServer par1MinecraftServer) { -+ this.mcServer = par1MinecraftServer; -+ this.field_96245_b = MinecraftServer.getSystemTimeMillis(); -+ } -+ -+ /** -+ * "Saving level", or the loading,or downloading equivelent -+ */ -+ public void displayProgressMessage(String par1Str) {} -+ -+ /** -+ * Updates the progress bar on the loading screen to the specified amount. Args: loadProgress -+ */ -+ public void setLoadingProgress(int par1) { -+ if (MinecraftServer.getSystemTimeMillis() - this.field_96245_b >= 1000L) { -+ this.field_96245_b = MinecraftServer.getSystemTimeMillis(); -+ this.mcServer.getLogAgent().logInfo("Converting... " + par1 + "%"); - } -- -- } -- -- public void displayLoadingString(String var1) { -- } -+ } -+ -+ /** -+ * This is called with "Working..." by resetProgressAndMessage -+ */ -+ public void resetProgresAndWorkingMessage(String par1Str) {} - } ---- net/minecraft/src/ItemFirework.java -+++ net/minecraft/src/ItemFirework.java -@@ -4,16 +4,21 @@ - import java.util.List; - - public class ItemFirework extends Item { -- public ItemFirework(int var1) { -- super(var1); -+ public ItemFirework(int par1) { -+ super(par1); - } - -- public boolean onItemUse(ItemStack var1, EntityPlayer var2, World var3, int var4, int var5, int var6, int var7, float var8, float var9, float var10) { -- if(!var3.isRemote) { -- EntityFireworkRocket var11 = new EntityFireworkRocket(var3, (double)((float)var4 + var8), (double)((float)var5 + var9), (double)((float)var6 + var10), var1); -- var3.spawnEntityInWorld(var11); -- if(!var2.capabilities.isCreativeMode) { -- --var1.stackSize; -+ /** -+ * Callback for item usage. If the item does something special on right clicking, he will have one of those. Return -+ * True if something happen and false if it don't. This is for ITEMS, not BLOCKS -+ */ -+ public boolean onItemUse(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, World par3World, int par4, int par5, int par6, int par7, float par8, float par9, float par10) { -+ if (!par3World.isRemote) { -+ EntityFireworkRocket var11 = new EntityFireworkRocket(par3World, (double)((float)par4 + par8), (double)((float)par5 + par9), (double)((float)par6 + par10), par1ItemStack); -+ par3World.spawnEntityInWorld(var11); -+ -+ if (!par2EntityPlayer.capabilities.isCreativeMode) { -+ --par1ItemStack.stackSize; - } - - return true; -@@ -22,30 +27,35 @@ - } - } - -- public void addInformation(ItemStack var1, EntityPlayer var2, List var3, boolean var4) { -- if(var1.hasTagCompound()) { -- NBTTagCompound var5 = var1.getTagCompound().getCompoundTag("Fireworks"); -- if(var5 != null) { -- if(var5.hasKey("Flight")) { -- var3.add(StatCollector.translateToLocal("item.fireworks.flight") + " " + var5.getByte("Flight")); -+ /** -+ * allows items to add custom lines of information to the mouseover description -+ */ -+ public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4) { -+ if (par1ItemStack.hasTagCompound()) { -+ NBTTagCompound var5 = par1ItemStack.getTagCompound().getCompoundTag("Fireworks"); -+ -+ if (var5 != null) { -+ if (var5.hasKey("Flight")) { -+ par3List.add(StatCollector.translateToLocal("item.fireworks.flight") + " " + var5.getByte("Flight")); - } - - NBTTagList var6 = var5.getTagList("Explosions"); -- if(var6 != null && var6.tagCount() > 0) { -- for(int var7 = 0; var7 < var6.tagCount(); ++var7) { -+ -+ if (var6 != null && var6.tagCount() > 0) { -+ for (int var7 = 0; var7 < var6.tagCount(); ++var7) { - NBTTagCompound var8 = (NBTTagCompound)var6.tagAt(var7); - ArrayList var9 = new ArrayList(); - ItemFireworkCharge.func_92107_a(var8, var9); -- if(var9.size() > 0) { -- for(int var10 = 1; var10 < var9.size(); ++var10) { -+ -+ if (var9.size() > 0) { -+ for (int var10 = 1; var10 < var9.size(); ++var10) { - var9.set(var10, " " + (String)var9.get(var10)); - } - -- var3.addAll(var9); -+ par3List.addAll(var9); - } - } - } -- - } - } - } ---- /dev/null -+++ org/spoutcraft/client/gui/about/TextSection.java -@@ -1,0 +1,84 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.client.gui.about; -+ -+import java.util.List; -+ -+import org.spoutcraft.api.gui.Color; -+import org.spoutcraft.api.gui.GenericLabel; -+import org.spoutcraft.api.gui.Label; -+import org.spoutcraft.api.gui.Widget; -+ -+public class TextSection extends Section { -+ private GenericLabel labelText = new GenericLabel(); -+ -+ public TextSection() { -+ labelText.setWidth(100); -+ labelText.setWrapLines(true); -+ labelText.setTextColor(new Color(0xaaaaaa)); -+ } -+ -+ @Override -+ public void setX(int x) { -+ super.setX(x); -+ labelText.setX(x); -+ } -+ -+ @Override -+ public void setY(int y) { -+ super.setY(y); -+ labelText.setY(super.getHeight() + 5 + y); -+ } -+ -+ public String getText() { -+ return labelText.getText(); -+ } -+ -+ public Label setText(String text) { -+ return labelText.setText(text); -+ } -+ -+ @Override -+ public void update() { -+ super.update(); -+ labelText.setWidth(getWidth()); -+ labelText.recalculateLines(); -+ } -+ -+ @Override -+ public int getHeight() { -+ return (int) (super.getHeight() + labelText.getHeight() + 5); -+ } -+ -+ @Override -+ public void init(GuiNewAbout screen, String title, Object yaml) { -+ setTitle(title); -+ if (yaml instanceof String) { -+ setText((String) yaml); -+ } -+ } -+ -+ @Override -+ public List getWidgets() { -+ List ret = super.getWidgets(); -+ ret.add(labelText); -+ return ret; -+ } -+} ---- net/minecraft/src/McoServerListUpdateTask.java -+++ net/minecraft/src/McoServerListUpdateTask.java -@@ -7,27 +7,28 @@ - - class McoServerListUpdateTask extends TimerTask { - private McoClient field_140066_b; -+ - final McoServerList field_140067_a; - -- private McoServerListUpdateTask(McoServerList var1) { -- this.field_140067_a = var1; -+ private McoServerListUpdateTask(McoServerList par1McoServerList) { -+ this.field_140067_a = par1McoServerList; - } - - public void run() { -- if(!McoServerList.func_98249_b(this.field_140067_a)) { -+ if (!McoServerList.func_98249_b(this.field_140067_a)) { - this.func_140064_c(); - this.func_140062_a(); - this.func_140063_b(); - } -- - } - - private void func_140062_a() { - try { -- if(McoServerList.func_100014_a(this.field_140067_a) != null) { -+ if (McoServerList.func_100014_a(this.field_140067_a) != null) { - this.field_140066_b = new McoClient(McoServerList.func_100014_a(this.field_140067_a)); -- List var1 = this.field_140066_b.func_96382_a().a; -- if(var1 != null) { -+ List var1 = this.field_140066_b.func_96382_a().field_96430_d; -+ -+ if (var1 != null) { - this.func_140065_a(var1); - McoServerList.func_98247_a(this.field_140067_a, var1); - } -@@ -37,24 +38,22 @@ - } catch (IOException var3) { - Minecraft.getMinecraft().getLogAgent().logWarning("Realms: could not parse response from server"); - } -- - } - - private void func_140063_b() { - try { -- if(McoServerList.func_100014_a(this.field_140067_a) != null) { -+ if (McoServerList.func_100014_a(this.field_140067_a) != null) { - int var1 = this.field_140066_b.func_130106_e(); - McoServerList.func_130122_a(this.field_140067_a, var1); - } - } catch (ExceptionMcoService var2) { - Minecraft.getMinecraft().getLogAgent().logSevere(var2.toString()); - } -- - } - - private void func_140064_c() { - try { -- if(McoServerList.func_100014_a(this.field_140067_a) != null) { -+ if (McoServerList.func_100014_a(this.field_140067_a) != null) { - McoClient var1 = new McoClient(McoServerList.func_100014_a(this.field_140067_a)); - McoServerList.func_140057_b(this.field_140067_a, var1.func_96379_c()); - } -@@ -62,14 +61,13 @@ - Minecraft.getMinecraft().getLogAgent().logSevere(var2.toString()); - McoServerList.func_140057_b(this.field_140067_a, 0); - } -- -- } -- -- private void func_140065_a(List var1) { -- Collections.sort(var1, new McoServerListUpdateTaskComparator(this, McoServerList.func_100014_a(this.field_140067_a).getUsername(), (McoServerListEmptyAnon)null)); -- } -- -- McoServerListUpdateTask(McoServerList var1, McoServerListEmptyAnon var2) { -- this(var1); -+ } -+ -+ private void func_140065_a(List par1List) { -+ Collections.sort(par1List, new McoServerListUpdateTaskComparator(this, McoServerList.func_100014_a(this.field_140067_a).getUsername(), (McoServerListEmptyAnon)null)); -+ } -+ -+ McoServerListUpdateTask(McoServerList par1McoServerList, McoServerListEmptyAnon par2McoServerListEmptyAnon) { -+ this(par1McoServerList); - } - } ---- /dev/null -+++ org/spoutcraft/client/gui/settings/controls/BrightnessSlider.java -@@ -1,0 +1,50 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.client.gui.settings.controls; -+ -+import net.minecraft.src.Minecraft; -+ -+import org.spoutcraft.api.gui.GenericSlider; -+import org.spoutcraft.client.config.Configuration; -+ -+public class BrightnessSlider extends GenericSlider { -+ public BrightnessSlider() { -+ super("Brightness"); -+ setSliderPosition(Configuration.getBrightnessSlider()); -+ setTooltip("Increases the brightness of darker objects\nOFF - standard brightness\n100% - maximum brightness for darker objects\nThis options does not change the brightness of\nfully black objects"); -+ } -+ -+ @Override -+ public void onSliderDrag(float oldPos, float newPos) { -+ Configuration.setBrightnessSlider(newPos); -+ Configuration.write(); -+ Minecraft.getMinecraft().gameSettings.gammaSetting = Configuration.getBrightnessSlider(); -+ } -+ -+ public String getText() { -+ if (getSliderPosition() == 0F) { -+ return "Brightness: Moody"; -+ } -+ if (getSliderPosition() == 1F) { -+ return "Brightness: Bright"; -+ } -+ return "Brightness: " + (int)(this.getSliderPosition() * 100) + "%"; -+ } -+} ---- net/minecraft/src/RenderWitch.java -+++ net/minecraft/src/RenderWitch.java -@@ -4,58 +4,63 @@ - - public class RenderWitch extends RenderLiving { - private static final ResourceLocation witchTextures = new ResourceLocation("textures/entity/witch.png"); -- private final ModelWitch witchModel = (ModelWitch)this.mainModel; -+ private final ModelWitch witchModel; - - public RenderWitch() { - super(new ModelWitch(0.0F), 0.5F); -+ this.witchModel = (ModelWitch)this.mainModel; - } - -- public void func_82412_a(EntityWitch var1, double var2, double var4, double var6, float var8, float var9) { -- ItemStack var10 = var1.getHeldItem(); -+ public void func_82412_a(EntityWitch par1EntityWitch, double par2, double par4, double par6, float par8, float par9) { -+ ItemStack var10 = par1EntityWitch.getHeldItem(); - this.witchModel.field_82900_g = var10 != null; -- super.doRenderLiving(var1, var2, var4, var6, var8, var9); -+ super.doRenderLiving(par1EntityWitch, par2, par4, par6, par8, par9); - } - -- protected ResourceLocation getWitchTextures(EntityWitch var1) { -+ protected ResourceLocation getWitchTextures(EntityWitch par1EntityWitch) { - return witchTextures; - } - -- protected void func_82411_a(EntityWitch var1, float var2) { -+ protected void func_82411_a(EntityWitch par1EntityWitch, float par2) { - float var3 = 1.0F; - GL11.glColor3f(var3, var3, var3); -- super.renderEquippedItems(var1, var2); -- ItemStack var4 = var1.getHeldItem(); -- if(var4 != null) { -+ super.renderEquippedItems(par1EntityWitch, par2); -+ ItemStack var4 = par1EntityWitch.getHeldItem(); -+ -+ if (var4 != null) { - GL11.glPushMatrix(); - float var5; -- if(this.mainModel.isChild) { -+ -+ if (this.mainModel.isChild) { - var5 = 0.5F; -- GL11.glTranslatef(0.0F, 10.0F / 16.0F, 0.0F); -+ GL11.glTranslatef(0.0F, 0.625F, 0.0F); - GL11.glRotatef(-20.0F, -1.0F, 0.0F, 0.0F); - GL11.glScalef(var5, var5, var5); - } - -- this.witchModel.villagerNose.postRender(1.0F / 16.0F); -- GL11.glTranslatef(-(1.0F / 16.0F), 0.53125F, 0.21875F); -- if(var4.itemID < 256 && RenderBlocks.renderItemIn3d(Block.blocksList[var4.itemID].getRenderType())) { -+ this.witchModel.villagerNose.postRender(0.0625F); -+ GL11.glTranslatef(-0.0625F, 0.53125F, 0.21875F); -+ -+ if (var4.itemID < 256 && RenderBlocks.renderItemIn3d(Block.blocksList[var4.itemID].getRenderType())) { - var5 = 0.5F; -- GL11.glTranslatef(0.0F, 3.0F / 16.0F, -(5.0F / 16.0F)); -- var5 *= 12.0F / 16.0F; -+ GL11.glTranslatef(0.0F, 0.1875F, -0.3125F); -+ var5 *= 0.75F; - GL11.glRotatef(20.0F, 1.0F, 0.0F, 0.0F); - GL11.glRotatef(45.0F, 0.0F, 1.0F, 0.0F); - GL11.glScalef(var5, -var5, var5); -- } else if(var4.itemID == Item.bow.itemID) { -- var5 = 10.0F / 16.0F; -- GL11.glTranslatef(0.0F, 2.0F / 16.0F, 5.0F / 16.0F); -+ } else if (var4.itemID == Item.bow.itemID) { -+ var5 = 0.625F; -+ GL11.glTranslatef(0.0F, 0.125F, 0.3125F); - GL11.glRotatef(-20.0F, 0.0F, 1.0F, 0.0F); - GL11.glScalef(var5, -var5, var5); - GL11.glRotatef(-100.0F, 1.0F, 0.0F, 0.0F); - GL11.glRotatef(45.0F, 0.0F, 1.0F, 0.0F); -- } else if(Item.itemsList[var4.itemID].isFull3D()) { -- var5 = 10.0F / 16.0F; -- if(Item.itemsList[var4.itemID].shouldRotateAroundWhenRendering()) { -+ } else if (Item.itemsList[var4.itemID].isFull3D()) { -+ var5 = 0.625F; -+ -+ if (Item.itemsList[var4.itemID].shouldRotateAroundWhenRendering()) { - GL11.glRotatef(180.0F, 0.0F, 0.0F, 1.0F); -- GL11.glTranslatef(0.0F, -(2.0F / 16.0F), 0.0F); -+ GL11.glTranslatef(0.0F, -0.125F, 0.0F); - } - - this.func_82410_b(); -@@ -63,8 +68,8 @@ - GL11.glRotatef(-100.0F, 1.0F, 0.0F, 0.0F); - GL11.glRotatef(45.0F, 0.0F, 1.0F, 0.0F); - } else { -- var5 = 6.0F / 16.0F; -- GL11.glTranslatef(0.25F, 3.0F / 16.0F, -(3.0F / 16.0F)); -+ var5 = 0.375F; -+ GL11.glTranslatef(0.25F, 0.1875F, -0.1875F); - GL11.glScalef(var5, var5, var5); - GL11.glRotatef(60.0F, 0.0F, 0.0F, 1.0F); - GL11.glRotatef(-90.0F, 1.0F, 0.0F, 0.0F); -@@ -73,46 +78,59 @@ - - GL11.glRotatef(-15.0F, 1.0F, 0.0F, 0.0F); - GL11.glRotatef(40.0F, 0.0F, 0.0F, 1.0F); -- this.renderManager.itemRenderer.renderItem(var1, var4, 0); -- if(var4.getItem().requiresMultipleRenderPasses()) { -- this.renderManager.itemRenderer.renderItem(var1, var4, 1); -+ this.renderManager.itemRenderer.renderItem(par1EntityWitch, var4, 0); -+ -+ if (var4.getItem().requiresMultipleRenderPasses()) { -+ this.renderManager.itemRenderer.renderItem(par1EntityWitch, var4, 1); - } - - GL11.glPopMatrix(); - } -- - } - - protected void func_82410_b() { -- GL11.glTranslatef(0.0F, 3.0F / 16.0F, 0.0F); -+ GL11.glTranslatef(0.0F, 0.1875F, 0.0F); - } - -- protected void func_82409_b(EntityWitch var1, float var2) { -- float var3 = 15.0F / 16.0F; -+ protected void func_82409_b(EntityWitch par1EntityWitch, float par2) { -+ float var3 = 0.9375F; - GL11.glScalef(var3, var3, var3); - } - -- public void doRenderLiving(EntityLiving var1, double var2, double var4, double var6, float var8, float var9) { -- this.func_82412_a((EntityWitch)var1, var2, var4, var6, var8, var9); -- } -- -- protected void preRenderCallback(EntityLivingBase var1, float var2) { -- this.func_82409_b((EntityWitch)var1, var2); -- } -- -- protected void renderEquippedItems(EntityLivingBase var1, float var2) { -- this.func_82411_a((EntityWitch)var1, var2); -- } -- -- public void renderPlayer(EntityLivingBase var1, double var2, double var4, double var6, float var8, float var9) { -- this.func_82412_a((EntityWitch)var1, var2, var4, var6, var8, var9); -- } -- -- protected ResourceLocation getEntityTexture(Entity var1) { -- return this.getWitchTextures((EntityWitch)var1); -- } -- -- public void doRender(Entity var1, double var2, double var4, double var6, float var8, float var9) { -- this.func_82412_a((EntityWitch)var1, var2, var4, var6, var8, var9); -+ public void doRenderLiving(EntityLiving par1EntityLiving, double par2, double par4, double par6, float par8, float par9) { -+ this.func_82412_a((EntityWitch)par1EntityLiving, par2, par4, par6, par8, par9); -+ } -+ -+ /** -+ * Allows the render to do any OpenGL state modifications necessary before the model is rendered. Args: entityLiving, -+ * partialTickTime -+ */ -+ protected void preRenderCallback(EntityLivingBase par1EntityLivingBase, float par2) { -+ this.func_82409_b((EntityWitch)par1EntityLivingBase, par2); -+ } -+ -+ protected void renderEquippedItems(EntityLivingBase par1EntityLivingBase, float par2) { -+ this.func_82411_a((EntityWitch)par1EntityLivingBase, par2); -+ } -+ -+ public void renderPlayer(EntityLivingBase par1EntityLivingBase, double par2, double par4, double par6, float par8, float par9) { -+ this.func_82412_a((EntityWitch)par1EntityLivingBase, par2, par4, par6, par8, par9); -+ } -+ -+ /** -+ * Returns the location of an entity's texture. Doesn't seem to be called unless you call Render.bindEntityTexture. -+ */ -+ protected ResourceLocation getEntityTexture(Entity par1Entity) { -+ return this.getWitchTextures((EntityWitch)par1Entity); -+ } -+ -+ /** -+ * Actually renders the given argument. This is a synthetic bridge method, always casting down its argument and then -+ * handing it off to a worker function which does the actual work. In all probabilty, the class Render is generic -+ * (Render Public -+ public ItemStack itemInUse; -+ -+ /** -+ * This field starts off equal to getMaxItemUseDuration and is decremented on each tick -+ */ - private int itemInUseCount; - protected float speedOnGround = 0.1F; - protected float speedInAir = 0.02F; - private int field_82249_h; -+ -+ /** -+ * An instance of a fishing rod's hook. If this isn't null, the icon image of the fishing rod is slightly different -+ */ - public EntityFishHook fishEntity; -+ // Spout Start -+ public boolean sneakToggle = false; -+ public boolean runToggle = false; -+ public boolean treadWaterToggle = false; -+ public boolean autoforwardToggle = false; -+ public boolean autoBackwardToggle = false; -+ public MovementInput movementInput = new MovementInputFromOptions(SpoutClient.getHandle().gameSettings); // Spout - always have an instance! -+ public VIP vip = null; -+ // Spout End - -- public EntityPlayer(World var1, String var2) { -- super(var1); -- this.bu = var2; -- this.inventoryContainer = new ContainerPlayer(this.inventory, !var1.isRemote, this); -+ public EntityPlayer(World par1World, String par2Str) { -+ super(par1World); -+ this.username = par2Str; -+ this.inventoryContainer = new ContainerPlayer(this.inventory, !par1World.isRemote, this); - this.openContainer = this.inventoryContainer; - this.yOffset = 1.62F; -- ChunkCoordinates var3 = var1.getSpawnPoint(); -- this.setLocationAndAngles((double)var3.posX + 0.5D, (double)(var3.posY + 1), (double)var3.posZ + 0.5D, 0.0F, 0.0F); -+ ChunkCoordinates var3 = par1World.getSpawnPoint(); -+ this.setLocationAndAngles((double)var3.posX + 0.5D, (double)(var3.posY + 1), (double)var3.posZ + 0.5D, 0.0F, 0.0F); - this.field_70741_aB = 180.0F; -- this.fireResistance = 20; -+ this.fireResistance = 20; - } - - protected void applyEntityAttributes() { -@@ -65,24 +159,36 @@ - this.dataWatcher.addObject(18, Integer.valueOf(0)); - } - -+ /** -+ * returns the ItemStack containing the itemInUse -+ */ - public ItemStack getItemInUse() { - return this.itemInUse; - } - -+ /** -+ * Returns the item in use count -+ */ - public int getItemInUseCount() { - return this.itemInUseCount; - } - -+ /** -+ * Checks if the entity is currently using an item (e.g., bow, food, sword) by holding down the useItemButton -+ */ - public boolean isUsingItem() { - return this.itemInUse != null; - } - -+ /** -+ * gets the duration for how long the current itemInUse has been in use -+ */ - public int getItemInUseDuration() { - return this.isUsingItem() ? this.itemInUse.getMaxItemUseDuration() - this.itemInUseCount : 0; - } - - public void stopUsingItem() { -- if(this.itemInUse != null) { -+ if (this.itemInUse != null) { - this.itemInUse.onPlayerStoppedUsing(this.worldObj, this, this.itemInUseCount); - } - -@@ -92,25 +198,29 @@ - public void clearItemInUse() { - this.itemInUse = null; - this.itemInUseCount = 0; -- if(!this.worldObj.isRemote) { -+ -+ if (!this.worldObj.isRemote) { - this.setEating(false); - } -- - } - - public boolean isBlocking() { - return this.isUsingItem() && Item.itemsList[this.itemInUse.itemID].getItemUseAction(this.itemInUse) == EnumAction.block; - } - -+ /** -+ * Called to update the entity's position/logic. -+ */ - public void onUpdate() { -- if(this.itemInUse != null) { -+ if (this.itemInUse != null) { - ItemStack var1 = this.inventory.getCurrentItem(); -- if(var1 == this.itemInUse) { -- if(this.itemInUseCount <= 25 && this.itemInUseCount % 4 == 0) { -+ -+ if (var1 == this.itemInUse) { -+ if (this.itemInUseCount <= 25 && this.itemInUseCount % 4 == 0) { - this.updateItemUse(var1, 5); - } - -- if(--this.itemInUseCount == 0 && !this.worldObj.isRemote) { -+ if (--this.itemInUseCount == 0 && !this.worldObj.isRemote) { - this.onItemUseFinish(); - } - } else { -@@ -118,37 +228,40 @@ - } - } - -- if(this.xpCooldown > 0) { -+ if (this.xpCooldown > 0) { - --this.xpCooldown; - } - -- if(this.isPlayerSleeping()) { -+ if (this.isPlayerSleeping()) { - ++this.sleepTimer; -- if(this.sleepTimer > 100) { -+ -+ if (this.sleepTimer > 100) { - this.sleepTimer = 100; - } - -- if(!this.worldObj.isRemote) { -- if(!this.isInBed()) { -+ if (!this.worldObj.isRemote) { -+ if (!this.isInBed()) { - this.wakeUpPlayer(true, true, false); -- } else if(this.worldObj.isDaytime()) { -+ } else if (this.worldObj.isDaytime()) { - this.wakeUpPlayer(false, true, true); - } - } -- } else if(this.sleepTimer > 0) { -+ } else if (this.sleepTimer > 0) { - ++this.sleepTimer; -- if(this.sleepTimer >= 110) { -+ -+ if (this.sleepTimer >= 110) { - this.sleepTimer = 0; - } - } - - super.onUpdate(); -- if(!this.worldObj.isRemote && this.openContainer != null && !this.openContainer.canInteractWith(this)) { -+ -+ if (!this.worldObj.isRemote && this.openContainer != null && !this.openContainer.canInteractWith(this)) { - this.closeScreen(); - this.openContainer = this.inventoryContainer; - } - -- if(this.isBurning() && this.capabilities.disableDamage) { -+ if (this.isBurning() && this.capabilities.disableDamage) { - this.extinguish(); - } - -@@ -159,27 +272,28 @@ - double var3 = this.posY - this.field_71095_bQ; - double var5 = this.posZ - this.field_71085_bR; - double var7 = 10.0D; -- if(var9 > var7) { -+ -+ if (var9 > var7) { - this.field_71091_bM = this.field_71094_bP = this.posX; - } - -- if(var5 > var7) { -+ if (var5 > var7) { - this.field_71097_bO = this.field_71085_bR = this.posZ; - } - -- if(var3 > var7) { -+ if (var3 > var7) { - this.field_71096_bN = this.field_71095_bQ = this.posY; - } - -- if(var9 < -var7) { -+ if (var9 < -var7) { - this.field_71091_bM = this.field_71094_bP = this.posX; - } - -- if(var5 < -var7) { -+ if (var5 < -var7) { - this.field_71097_bO = this.field_71085_bR = this.posZ; - } - -- if(var3 < -var7) { -+ if (var3 < -var7) { - this.field_71096_bN = this.field_71095_bQ = this.posY; - } - -@@ -187,102 +301,145 @@ - this.field_71085_bR += var5 * 0.25D; - this.field_71095_bQ += var3 * 0.25D; - this.addStat(StatList.minutesPlayedStat, 1); -- if(this.ridingEntity == null) { -+ -+ if (this.ridingEntity == null) { - this.startMinecartRidingCoordinate = null; - } - -- if(!this.worldObj.isRemote) { -+ if (!this.worldObj.isRemote) { - this.foodStats.onUpdate(this); - } -- - } - -+ /** -+ * Return the amount of time this entity should stay in a portal before being transported. -+ */ - public int getMaxInPortalTime() { - return this.capabilities.disableDamage ? 0 : 80; - } - -+ /** -+ * Return the amount of cooldown before this entity can use a portal again. -+ */ - public int getPortalCooldown() { - return 10; - } - -- public void playSound(String var1, float var2, float var3) { -- this.worldObj.playSoundToNearExcept(this, var1, var2, var3); -+ public void playSound(String par1Str, float par2, float par3) { -+ this.worldObj.playSoundToNearExcept(this, par1Str, par2, par3); - } - -- protected void updateItemUse(ItemStack var1, int var2) { -- if(var1.getItemUseAction() == EnumAction.drink) { -- this.playSound("random.drink", 0.5F, this.worldObj.s.nextFloat() * 0.1F + 0.9F); -+ /** -+ * Plays sounds and makes particles for item in use state -+ */ -+ protected void updateItemUse(ItemStack par1ItemStack, int par2) { -+ if (par1ItemStack.getItemUseAction() == EnumAction.drink) { -+ this.playSound("random.drink", 0.5F, this.worldObj.rand.nextFloat() * 0.1F + 0.9F); - } - -- if(var1.getItemUseAction() == EnumAction.eat) { -- for(int var3 = 0; var3 < var2; ++var3) { -- Vec3 var4 = this.worldObj.getWorldVec3Pool().getVecFromPool(((double)this.ab.nextFloat() - 0.5D) * 0.1D, Math.random() * 0.1D + 0.1D, 0.0D); -+ if (par1ItemStack.getItemUseAction() == EnumAction.eat) { -+ for (int var3 = 0; var3 < par2; ++var3) { -+ Vec3 var4 = this.worldObj.getWorldVec3Pool().getVecFromPool(((double)this.rand.nextFloat() - 0.5D) * 0.1D, Math.random() * 0.1D + 0.1D, 0.0D); - var4.rotateAroundX(-this.rotationPitch * (float)Math.PI / 180.0F); - var4.rotateAroundY(-this.rotationYaw * (float)Math.PI / 180.0F); -- Vec3 var5 = this.worldObj.getWorldVec3Pool().getVecFromPool(((double)this.ab.nextFloat() - 0.5D) * 0.3D, (double)(-this.ab.nextFloat()) * 0.6D - 0.3D, 0.6D); -+ Vec3 var5 = this.worldObj.getWorldVec3Pool().getVecFromPool(((double)this.rand.nextFloat() - 0.5D) * 0.3D, (double)(-this.rand.nextFloat()) * 0.6D - 0.3D, 0.6D); - var5.rotateAroundX(-this.rotationPitch * (float)Math.PI / 180.0F); - var5.rotateAroundY(-this.rotationYaw * (float)Math.PI / 180.0F); - var5 = var5.addVector(this.posX, this.posY + (double)this.getEyeHeight(), this.posZ); -- this.worldObj.spawnParticle("iconcrack_" + var1.getItem().itemID, var5.xCoord, var5.yCoord, var5.zCoord, var4.xCoord, var4.yCoord + 0.05D, var4.zCoord); -+ // Spout Start -+ if (par1ItemStack.itemID == 318) { -+ BlockDesign design = null; -+ Texture texture = null; -+ org.spoutcraft.api.material.CustomItem item = MaterialData.getCustomItem(par1ItemStack.getItemDamage()); -+ if (item != null) { -+ String textureURI = item.getTexture(); -+ if (textureURI == null) { -+ org.spoutcraft.api.material.CustomBlock block = MaterialData.getCustomBlock(par1ItemStack.getItemDamage()); -+ design = block != null ? block.getBlockDesign() : null; -+ textureURI = design != null ? design.getTextureURL() : null; -+ } -+ if (textureURI != null) { -+ texture = CustomTextureManager.getTextureFromUrl(item.getAddon(), textureURI); -+ } -+ } -+ this.worldObj.spawnParticle("iconcrack_" + par1ItemStack.getItem().itemID, var5.xCoord, var5.yCoord, var5.zCoord, var4.xCoord, var4.yCoord + 0.05D, var4.zCoord, texture); -+ } else { -+ this.worldObj.spawnParticle("iconcrack_" + par1ItemStack.getItem().itemID, var5.xCoord, var5.yCoord, var5.zCoord, var4.xCoord, var4.yCoord + 0.05D, var4.zCoord); -+ } -+ // Spout End - } - -- this.playSound("random.eat", 0.5F + 0.5F * (float)this.ab.nextInt(2), (this.ab.nextFloat() - this.ab.nextFloat()) * 0.2F + 1.0F); -+ this.playSound("random.eat", 0.5F + 0.5F * (float)this.rand.nextInt(2), (this.rand.nextFloat() - this.rand.nextFloat()) * 0.2F + 1.0F); - } -- - } - -+ /** -+ * Used for when item use count runs out, ie: eating completed -+ */ - protected void onItemUseFinish() { -- if(this.itemInUse != null) { -+ if (this.itemInUse != null) { - this.updateItemUse(this.itemInUse, 16); - int var1 = this.itemInUse.stackSize; - ItemStack var2 = this.itemInUse.onFoodEaten(this.worldObj, this); -- if(var2 != this.itemInUse || var2 != null && var2.stackSize != var1) { -+ -+ if (var2 != this.itemInUse || var2 != null && var2.stackSize != var1) { - this.inventory.mainInventory[this.inventory.currentItem] = var2; -- if(var2.stackSize == 0) { -+ -+ if (var2.stackSize == 0) { - this.inventory.mainInventory[this.inventory.currentItem] = null; - } - } - - this.clearItemInUse(); - } -- - } - -- public void handleHealthUpdate(byte var1) { -- if(var1 == 9) { -+ public void handleHealthUpdate(byte par1) { -+ if (par1 == 9) { - this.onItemUseFinish(); - } else { -- super.handleHealthUpdate(var1); -+ super.handleHealthUpdate(par1); - } -- - } - -+ /** -+ * Dead and sleeping entities cannot move -+ */ - protected boolean isMovementBlocked() { - return this.getHealth() <= 0.0F || this.isPlayerSleeping(); - } - -+ /** -+ * sets current screen to null (used on escape buttons of GUIs) -+ */ - protected void closeScreen() { - this.openContainer = this.inventoryContainer; - } - -- public void mountEntity(Entity var1) { -- if(this.ridingEntity != null && var1 == null) { -- if(!this.worldObj.isRemote) { -+ /** -+ * Called when a player mounts an entity. e.g. mounts a pig, mounts a boat. -+ */ -+ public void mountEntity(Entity par1Entity) { -+ if (this.ridingEntity != null && par1Entity == null) { -+ if (!this.worldObj.isRemote) { - this.dismountEntity(this.ridingEntity); - } - -- if(this.ridingEntity != null) { -+ if (this.ridingEntity != null) { - this.ridingEntity.riddenByEntity = null; - } - - this.ridingEntity = null; - } else { -- super.mountEntity(var1); -+ super.mountEntity(par1Entity); - } - } - -+ /** -+ * Handles updating while being ridden by an entity -+ */ - public void updateRidden() { -- if(!this.worldObj.isRemote && this.isSneaking()) { -+ if (!this.worldObj.isRemote && this.isSneaking()) { - this.mountEntity((Entity)null); - this.setSneaking(false); - } else { -@@ -295,15 +452,19 @@ - this.prevCameraYaw = this.cameraYaw; - this.cameraYaw = 0.0F; - this.addMountedMovementStat(this.posX - var1, this.posY - var3, this.posZ - var5); -- if(this.ridingEntity instanceof EntityPig) { -+ -+ if (this.ridingEntity instanceof EntityPig) { - this.rotationPitch = var8; - this.rotationYaw = var7; - this.renderYawOffset = ((EntityPig)this.ridingEntity).renderYawOffset; - } -- - } - } - -+ /** -+ * Keeps moving the entity up so it isn't colliding with blocks and other requirements for this entity to be spawned -+ * (only actually used on players though its also on Entity) -+ */ - public void preparePlayerToSpawn() { - this.yOffset = 1.62F; - this.setSize(0.6F, 1.8F); -@@ -317,97 +478,120 @@ - this.updateArmSwingProgress(); - } - -+ /** -+ * Called frequently so the entity can update its state every tick as required. For example, zombies and skeletons use -+ * this to react to sunlight and start to burn. -+ */ - public void onLivingUpdate() { -- if(this.flyToggleTimer > 0) { -+ if (this.flyToggleTimer > 0) { - --this.flyToggleTimer; - } - -- if(this.worldObj.difficultySetting == 0 && this.getHealth() < this.getMaxHealth() && this.worldObj.getGameRules().getGameRuleBooleanValue("naturalRegeneration") && this.ticksExisted % 20 * 12 == 0) { -+ if (this.worldObj.difficultySetting == 0 && this.getHealth() < this.getMaxHealth() && this.worldObj.getGameRules().getGameRuleBooleanValue("naturalRegeneration") && this.ticksExisted % 20 * 12 == 0) { - this.heal(1.0F); - } - - this.inventory.decrementAnimations(); - this.prevCameraYaw = this.cameraYaw; - super.onLivingUpdate(); -+ - AttributeInstance var1 = this.getEntityAttribute(SharedMonsterAttributes.movementSpeed); -- if(!this.worldObj.isRemote) { -+ -+ if (!this.worldObj.isRemote) { - var1.setAttribute((double)this.capabilities.getWalkSpeed()); - } - - this.jumpMovementFactor = this.speedInAir; -- if(this.isSprinting()) { -+ -+ // Spout Start - No sprinting while moving backwards -+ if (this.isSprinting() && this.movementInput.moveForward >= 0F) { -+ // Spout End - this.jumpMovementFactor = (float)((double)this.jumpMovementFactor + (double)this.speedInAir * 0.3D); - } - - this.setAIMoveSpeed((float)var1.getAttributeValue()); - float var2 = MathHelper.sqrt_double(this.motionX * this.motionX + this.motionZ * this.motionZ); -- float var3 = (float)Math.atan(-this.motionY * (double)0.2F) * 15.0F; -- if(var2 > 0.1F) { -+ float var3 = (float)Math.atan(-this.motionY * 0.20000000298023224D) * 15.0F; -+ -+ if (var2 > 0.1F) { - var2 = 0.1F; - } - -- if(!this.onGround || this.getHealth() <= 0.0F) { -+ if (!this.onGround || this.getHealth() <= 0.0F) { - var2 = 0.0F; - } - -- if(this.onGround || this.getHealth() <= 0.0F) { -+ if (this.onGround || this.getHealth() <= 0.0F) { - var3 = 0.0F; - } - - this.cameraYaw += (var2 - this.cameraYaw) * 0.4F; - this.cameraPitch += (var3 - this.cameraPitch) * 0.8F; -- if(this.getHealth() > 0.0F) { -+ -+ if (this.getHealth() > 0.0F) { - AxisAlignedBB var4 = null; -- if(this.ridingEntity != null && !this.ridingEntity.isDead) { -+ -+ if (this.ridingEntity != null && !this.ridingEntity.isDead) { - var4 = this.boundingBox.func_111270_a(this.ridingEntity.boundingBox).expand(1.0D, 0.0D, 1.0D); - } else { - var4 = this.boundingBox.expand(1.0D, 0.5D, 1.0D); - } - - List var5 = this.worldObj.getEntitiesWithinAABBExcludingEntity(this, var4); -- if(var5 != null) { -- for(int var6 = 0; var6 < var5.size(); ++var6) { -+ -+ if (var5 != null) { -+ for (int var6 = 0; var6 < var5.size(); ++var6) { - Entity var7 = (Entity)var5.get(var6); -- if(!var7.isDead) { -+ -+ if (!var7.isDead) { - this.collideWithPlayer(var7); - } - } - } - } -- - } - -- private void collideWithPlayer(Entity var1) { -- var1.onCollideWithPlayer(this); -+ private void collideWithPlayer(Entity par1Entity) { -+ par1Entity.onCollideWithPlayer(this); - } - - public int getScore() { - return this.dataWatcher.getWatchableObjectInt(18); - } - -- public void setScore(int var1) { -- this.dataWatcher.updateObject(18, Integer.valueOf(var1)); -+ /** -+ * Set player's score -+ */ -+ public void setScore(int par1) { -+ this.dataWatcher.updateObject(18, Integer.valueOf(par1)); - } - -- public void addScore(int var1) { -+ /** -+ * Add to player's score -+ */ -+ public void addScore(int par1) { - int var2 = this.getScore(); -- this.dataWatcher.updateObject(18, Integer.valueOf(var2 + var1)); -+ this.dataWatcher.updateObject(18, Integer.valueOf(var2 + par1)); - } - -- public void onDeath(DamageSource var1) { -- super.onDeath(var1); -+ /** -+ * Called when the mob's health reaches 0. -+ */ -+ public void onDeath(DamageSource par1DamageSource) { -+ super.onDeath(par1DamageSource); - this.setSize(0.2F, 0.2F); - this.setPosition(this.posX, this.posY, this.posZ); -- this.motionY = (double)0.1F; -- if(this.bu.equals("Notch")) { -+ this.motionY = 0.10000000149011612D; -+ -+ if (this.username.equals("Notch")) { - this.dropPlayerItemWithRandomChoice(new ItemStack(Item.appleRed, 1), true); - } - -- if(!this.worldObj.getGameRules().getGameRuleBooleanValue("keepInventory")) { -+ if (!this.worldObj.getGameRules().getGameRuleBooleanValue("keepInventory")) { - this.inventory.dropAllItems(); - } - -- if(var1 != null) { -+ if (par1DamageSource != null) { - this.motionX = (double)(-MathHelper.cos((this.attackedAtYaw + this.rotationYaw) * (float)Math.PI / 180.0F) * 0.1F); - this.motionZ = (double)(-MathHelper.sin((this.attackedAtYaw + this.rotationYaw) * (float)Math.PI / 180.0F) * 0.1F); - } else { -@@ -418,10 +602,15 @@ - this.addStat(StatList.deathsStat, 1); - } - -- public void addToPlayerScore(Entity var1, int var2) { -- this.addScore(var2); -+ /** -+ * Adds a value to the player score. Currently not actually used and the entity passed in does nothing. Args: entity, -+ * scoreToAdd -+ */ -+ public void addToPlayerScore(Entity par1Entity, int par2) { -+ this.addScore(par2); - Collection var3 = this.getWorldScoreboard().func_96520_a(ScoreObjectiveCriteria.totalKillCount); -- if(var1 instanceof EntityPlayer) { -+ -+ if (par1Entity instanceof EntityPlayer) { - this.addStat(StatList.playerKillsStat, 1); - var3.addAll(this.getWorldScoreboard().func_96520_a(ScoreObjectiveCriteria.playerKillCount)); - } else { -@@ -430,48 +619,58 @@ - - Iterator var4 = var3.iterator(); - -- while(var4.hasNext()) { -+ while (var4.hasNext()) { - ScoreObjective var5 = (ScoreObjective)var4.next(); - Score var6 = this.getWorldScoreboard().func_96529_a(this.getEntityName(), var5); - var6.func_96648_a(); - } -- -- } -- -- public EntityItem dropOneItem(boolean var1) { -- return this.dropPlayerItemWithRandomChoice(this.inventory.decrStackSize(this.inventory.currentItem, var1 && this.inventory.getCurrentItem() != null ? this.inventory.getCurrentItem().stackSize : 1), false); -- } -- -- public EntityItem dropPlayerItem(ItemStack var1) { -- return this.dropPlayerItemWithRandomChoice(var1, false); -- } -- -- public EntityItem dropPlayerItemWithRandomChoice(ItemStack var1, boolean var2) { -- if(var1 == null) { -+ } -+ -+ /** -+ * Called when player presses the drop item key -+ */ -+ public EntityItem dropOneItem(boolean par1) { -+ return this.dropPlayerItemWithRandomChoice(this.inventory.decrStackSize(this.inventory.currentItem, par1 && this.inventory.getCurrentItem() != null ? this.inventory.getCurrentItem().stackSize : 1), false); -+ } -+ -+ /** -+ * Args: itemstack - called when player drops an item stack that's not in his inventory (like items still placed in a -+ * workbench while the workbench'es GUI gets closed) -+ */ -+ public EntityItem dropPlayerItem(ItemStack par1ItemStack) { -+ return this.dropPlayerItemWithRandomChoice(par1ItemStack, false); -+ } -+ -+ /** -+ * Args: itemstack, flag -+ */ -+ public EntityItem dropPlayerItemWithRandomChoice(ItemStack par1ItemStack, boolean par2) { -+ if (par1ItemStack == null) { - return null; -- } else if(var1.stackSize == 0) { -+ } else if (par1ItemStack.stackSize == 0) { - return null; - } else { -- EntityItem var3 = new EntityItem(this.worldObj, this.posX, this.posY - (double)0.3F + (double)this.getEyeHeight(), this.posZ, var1); -+ EntityItem var3 = new EntityItem(this.worldObj, this.posX, this.posY - 0.30000001192092896D + (double)this.getEyeHeight(), this.posZ, par1ItemStack); - var3.delayBeforeCanPickup = 40; - float var4 = 0.1F; - float var5; -- if(var2) { -- var5 = this.ab.nextFloat() * 0.5F; -- float var6 = this.ab.nextFloat() * (float)Math.PI * 2.0F; -+ -+ if (par2) { -+ var5 = this.rand.nextFloat() * 0.5F; -+ float var6 = this.rand.nextFloat() * (float)Math.PI * 2.0F; - var3.motionX = (double)(-MathHelper.sin(var6) * var5); - var3.motionZ = (double)(MathHelper.cos(var6) * var5); -- var3.motionY = (double)0.2F; -+ var3.motionY = 0.20000000298023224D; - } else { - var4 = 0.3F; - var3.motionX = (double)(-MathHelper.sin(this.rotationYaw / 180.0F * (float)Math.PI) * MathHelper.cos(this.rotationPitch / 180.0F * (float)Math.PI) * var4); - var3.motionZ = (double)(MathHelper.cos(this.rotationYaw / 180.0F * (float)Math.PI) * MathHelper.cos(this.rotationPitch / 180.0F * (float)Math.PI) * var4); - var3.motionY = (double)(-MathHelper.sin(this.rotationPitch / 180.0F * (float)Math.PI) * var4 + 0.1F); - var4 = 0.02F; -- var5 = this.ab.nextFloat() * (float)Math.PI * 2.0F; -- var4 *= this.ab.nextFloat(); -+ var5 = this.rand.nextFloat() * (float)Math.PI * 2.0F; -+ var4 *= this.rand.nextFloat(); - var3.motionX += Math.cos((double)var5) * (double)var4; -- var3.motionY += (double)((this.ab.nextFloat() - this.ab.nextFloat()) * 0.1F); -+ var3.motionY += (double)((this.rand.nextFloat() - this.rand.nextFloat()) * 0.1F); - var3.motionZ += Math.sin((double)var5) * (double)var4; - } - -@@ -481,18 +680,27 @@ - } - } - -- protected void joinEntityItemWithWorld(EntityItem var1) { -- this.worldObj.spawnEntityInWorld(var1); -+ /** -+ * Joins the passed in entity item with the world. Args: entityItem -+ */ -+ protected void joinEntityItemWithWorld(EntityItem par1EntityItem) { -+ this.worldObj.spawnEntityInWorld(par1EntityItem); - } - -- public float getCurrentPlayerStrVsBlock(Block var1, boolean var2) { -- float var3 = this.inventory.getStrVsBlock(var1); -- if(var3 > 1.0F) { -+ /** -+ * Returns how strong the player is against the specified block at this moment -+ */ -+ public float getCurrentPlayerStrVsBlock(Block par1Block, boolean par2) { -+ float var3 = this.inventory.getStrVsBlock(par1Block); -+ -+ if (var3 > 1.0F) { - int var4 = EnchantmentHelper.getEfficiencyModifier(this); - ItemStack var5 = this.inventory.getCurrentItem(); -- if(var4 > 0 && var5 != null) { -+ -+ if (var4 > 0 && var5 != null) { - float var6 = (float)(var4 * var4 + 1); -- if(!var5.canHarvestBlock(var1) && var3 <= 1.0F) { -+ -+ if (!var5.canHarvestBlock(par1Block) && var3 <= 1.0F) { - var3 += var6 * 0.08F; - } else { - var3 += var6; -@@ -500,175 +708,204 @@ - } - } - -- if(this.isPotionActive(Potion.digSpeed)) { -+ if (this.isPotionActive(Potion.digSpeed)) { - var3 *= 1.0F + (float)(this.getActivePotionEffect(Potion.digSpeed).getAmplifier() + 1) * 0.2F; - } - -- if(this.isPotionActive(Potion.digSlowdown)) { -+ if (this.isPotionActive(Potion.digSlowdown)) { - var3 *= 1.0F - (float)(this.getActivePotionEffect(Potion.digSlowdown).getAmplifier() + 1) * 0.2F; - } - -- if(this.isInsideOfMaterial(Material.water) && !EnchantmentHelper.getAquaAffinityModifier(this)) { -+ if (this.isInsideOfMaterial(Material.water) && !EnchantmentHelper.getAquaAffinityModifier(this)) { - var3 /= 5.0F; - } - -- if(!this.onGround) { -+ if (!this.onGround) { - var3 /= 5.0F; - } - - return var3; - } - -- public boolean canHarvestBlock(Block var1) { -- return this.inventory.canHarvestBlock(var1); -+ /** -+ * Checks if the player has the ability to harvest a block (checks current inventory item for a tool if necessary) -+ */ -+ public boolean canHarvestBlock(Block par1Block) { -+ return this.inventory.canHarvestBlock(par1Block); - } - -- public void readEntityFromNBT(NBTTagCompound var1) { -- super.readEntityFromNBT(var1); -- NBTTagList var2 = var1.getTagList("Inventory"); -+ /** -+ * (abstract) Protected helper method to read subclass entity data from NBT. -+ */ -+ public void readEntityFromNBT(NBTTagCompound par1NBTTagCompound) { -+ super.readEntityFromNBT(par1NBTTagCompound); -+ NBTTagList var2 = par1NBTTagCompound.getTagList("Inventory"); - this.inventory.readFromNBT(var2); -- this.inventory.currentItem = var1.getInteger("SelectedItemSlot"); -- this.sleeping = var1.getBoolean("Sleeping"); -- this.sleepTimer = var1.getShort("SleepTimer"); -- this.experience = var1.getFloat("XpP"); -- this.experienceLevel = var1.getInteger("XpLevel"); -- this.experienceTotal = var1.getInteger("XpTotal"); -- this.setScore(var1.getInteger("Score")); -- if(this.sleeping) { -+ this.inventory.currentItem = par1NBTTagCompound.getInteger("SelectedItemSlot"); -+ this.sleeping = par1NBTTagCompound.getBoolean("Sleeping"); -+ this.sleepTimer = par1NBTTagCompound.getShort("SleepTimer"); -+ this.experience = par1NBTTagCompound.getFloat("XpP"); -+ this.experienceLevel = par1NBTTagCompound.getInteger("XpLevel"); -+ this.experienceTotal = par1NBTTagCompound.getInteger("XpTotal"); -+ this.setScore(par1NBTTagCompound.getInteger("Score")); -+ -+ if (this.sleeping) { - this.playerLocation = new ChunkCoordinates(MathHelper.floor_double(this.posX), MathHelper.floor_double(this.posY), MathHelper.floor_double(this.posZ)); - this.wakeUpPlayer(true, true, false); - } - -- if(var1.hasKey("SpawnX") && var1.hasKey("SpawnY") && var1.hasKey("SpawnZ")) { -- this.spawnChunk = new ChunkCoordinates(var1.getInteger("SpawnX"), var1.getInteger("SpawnY"), var1.getInteger("SpawnZ")); -- this.spawnForced = var1.getBoolean("SpawnForced"); -+ if (par1NBTTagCompound.hasKey("SpawnX") && par1NBTTagCompound.hasKey("SpawnY") && par1NBTTagCompound.hasKey("SpawnZ")) { -+ this.spawnChunk = new ChunkCoordinates(par1NBTTagCompound.getInteger("SpawnX"), par1NBTTagCompound.getInteger("SpawnY"), par1NBTTagCompound.getInteger("SpawnZ")); -+ this.spawnForced = par1NBTTagCompound.getBoolean("SpawnForced"); - } - -- this.foodStats.readNBT(var1); -- this.capabilities.readCapabilitiesFromNBT(var1); -- if(var1.hasKey("EnderItems")) { -- NBTTagList var3 = var1.getTagList("EnderItems"); -+ this.foodStats.readNBT(par1NBTTagCompound); -+ this.capabilities.readCapabilitiesFromNBT(par1NBTTagCompound); -+ -+ if (par1NBTTagCompound.hasKey("EnderItems")) { -+ NBTTagList var3 = par1NBTTagCompound.getTagList("EnderItems"); - this.theInventoryEnderChest.loadInventoryFromNBT(var3); - } -- - } - -- public void writeEntityToNBT(NBTTagCompound var1) { -- super.writeEntityToNBT(var1); -- var1.setTag("Inventory", this.inventory.writeToNBT(new NBTTagList())); -- var1.setInteger("SelectedItemSlot", this.inventory.currentItem); -- var1.setBoolean("Sleeping", this.sleeping); -- var1.setShort("SleepTimer", (short)this.sleepTimer); -- var1.setFloat("XpP", this.experience); -- var1.setInteger("XpLevel", this.experienceLevel); -- var1.setInteger("XpTotal", this.experienceTotal); -- var1.setInteger("Score", this.getScore()); -- if(this.spawnChunk != null) { -- var1.setInteger("SpawnX", this.spawnChunk.posX); -- var1.setInteger("SpawnY", this.spawnChunk.posY); -- var1.setInteger("SpawnZ", this.spawnChunk.posZ); -- var1.setBoolean("SpawnForced", this.spawnForced); -+ /** -+ * (abstract) Protected helper method to write subclass entity data to NBT. -+ */ -+ public void writeEntityToNBT(NBTTagCompound par1NBTTagCompound) { -+ super.writeEntityToNBT(par1NBTTagCompound); -+ par1NBTTagCompound.setTag("Inventory", this.inventory.writeToNBT(new NBTTagList())); -+ par1NBTTagCompound.setInteger("SelectedItemSlot", this.inventory.currentItem); -+ par1NBTTagCompound.setBoolean("Sleeping", this.sleeping); -+ par1NBTTagCompound.setShort("SleepTimer", (short)this.sleepTimer); -+ par1NBTTagCompound.setFloat("XpP", this.experience); -+ par1NBTTagCompound.setInteger("XpLevel", this.experienceLevel); -+ par1NBTTagCompound.setInteger("XpTotal", this.experienceTotal); -+ par1NBTTagCompound.setInteger("Score", this.getScore()); -+ -+ if (this.spawnChunk != null) { -+ par1NBTTagCompound.setInteger("SpawnX", this.spawnChunk.posX); -+ par1NBTTagCompound.setInteger("SpawnY", this.spawnChunk.posY); -+ par1NBTTagCompound.setInteger("SpawnZ", this.spawnChunk.posZ); -+ par1NBTTagCompound.setBoolean("SpawnForced", this.spawnForced); - } - -- this.foodStats.writeNBT(var1); -- this.capabilities.writeCapabilitiesToNBT(var1); -- var1.setTag("EnderItems", this.theInventoryEnderChest.saveInventoryToNBT()); -- } -- -- public void displayGUIChest(IInventory var1) { -- } -- -- public void displayGUIHopper(TileEntityHopper var1) { -- } -- -- public void displayGUIHopperMinecart(EntityMinecartHopper var1) { -- } -- -- public void displayGUIHorse(EntityHorse var1, IInventory var2) { -- } -- -- public void displayGUIEnchantment(int var1, int var2, int var3, String var4) { -- } -- -- public void displayGUIAnvil(int var1, int var2, int var3) { -- } -- -- public void displayGUIWorkbench(int var1, int var2, int var3) { -- } -+ this.foodStats.writeNBT(par1NBTTagCompound); -+ this.capabilities.writeCapabilitiesToNBT(par1NBTTagCompound); -+ par1NBTTagCompound.setTag("EnderItems", this.theInventoryEnderChest.saveInventoryToNBT()); -+ } -+ -+ /** -+ * Displays the GUI for interacting with a chest inventory. Args: chestInventory -+ */ -+ public void displayGUIChest(IInventory par1IInventory) {} -+ -+ public void displayGUIHopper(TileEntityHopper par1TileEntityHopper) {} -+ -+ public void displayGUIHopperMinecart(EntityMinecartHopper par1EntityMinecartHopper) {} -+ -+ public void displayGUIHorse(EntityHorse par1EntityHorse, IInventory par2IInventory) {} -+ -+ public void displayGUIEnchantment(int par1, int par2, int par3, String par4Str) {} -+ -+ /** -+ * Displays the GUI for interacting with an anvil. -+ */ -+ public void displayGUIAnvil(int par1, int par2, int par3) {} -+ -+ /** -+ * Displays the crafting GUI for a workbench. -+ */ -+ public void displayGUIWorkbench(int par1, int par2, int par3) {} - - public float getEyeHeight() { - return 0.12F; - } - -+ /** -+ * sets the players height back to normal after doing things like sleeping and dieing -+ */ - protected void resetHeight() { - this.yOffset = 1.62F; - } - -- public boolean attackEntityFrom(DamageSource var1, float var2) { -- if(this.isEntityInvulnerable()) { -+ /** -+ * Called when the entity is attacked. -+ */ -+ public boolean attackEntityFrom(DamageSource par1DamageSource, float par2) { -+ if (this.isEntityInvulnerable()) { - return false; -- } else if(this.capabilities.disableDamage && !var1.canHarmInCreative()) { -+ } else if (this.capabilities.disableDamage && !par1DamageSource.canHarmInCreative()) { - return false; - } else { - this.entityAge = 0; -- if(this.getHealth() <= 0.0F) { -+ -+ if (this.getHealth() <= 0.0F) { - return false; - } else { -- if(this.isPlayerSleeping() && !this.worldObj.isRemote) { -+ if (this.isPlayerSleeping() && !this.worldObj.isRemote) { - this.wakeUpPlayer(true, true, false); - } - -- if(var1.isDifficultyScaled()) { -- if(this.worldObj.difficultySetting == 0) { -- var2 = 0.0F; -- } -- -- if(this.worldObj.difficultySetting == 1) { -- var2 = var2 / 2.0F + 1.0F; -- } -- -- if(this.worldObj.difficultySetting == 3) { -- var2 = var2 * 3.0F / 2.0F; -+ if (par1DamageSource.isDifficultyScaled()) { -+ if (this.worldObj.difficultySetting == 0) { -+ par2 = 0.0F; -+ } -+ -+ if (this.worldObj.difficultySetting == 1) { -+ par2 = par2 / 2.0F + 1.0F; -+ } -+ -+ if (this.worldObj.difficultySetting == 3) { -+ par2 = par2 * 3.0F / 2.0F; - } - } - -- if(var2 == 0.0F) { -+ if (par2 == 0.0F) { - return false; - } else { -- Entity var3 = var1.getEntity(); -- if(var3 instanceof EntityArrow && ((EntityArrow)var3).shootingEntity != null) { -+ Entity var3 = par1DamageSource.getEntity(); -+ -+ if (var3 instanceof EntityArrow && ((EntityArrow)var3).shootingEntity != null) { - var3 = ((EntityArrow)var3).shootingEntity; - } - -- this.addStat(StatList.damageTakenStat, Math.round(var2 * 10.0F)); -- return super.attackEntityFrom(var1, var2); -+ this.addStat(StatList.damageTakenStat, Math.round(par2 * 10.0F)); -+ return super.attackEntityFrom(par1DamageSource, par2); - } - } - } - } - -- public boolean canAttackPlayer(EntityPlayer var1) { -+ public boolean canAttackPlayer(EntityPlayer par1EntityPlayer) { - Team var2 = this.getTeam(); -- Team var3 = var1.getTeam(); -+ Team var3 = par1EntityPlayer.getTeam(); - return var2 == null ? true : (!var2.isSameTeam(var3) ? true : var2.getAllowFriendlyFire()); - } - -- protected void damageArmor(float var1) { -- this.inventory.damageArmor(var1); -+ protected void damageArmor(float par1) { -+ this.inventory.damageArmor(par1); - } - -+ /** -+ * Returns the current armor value as determined by a call to InventoryPlayer.getTotalArmorValue -+ */ - public int getTotalArmorValue() { - return this.inventory.getTotalArmorValue(); - } - -+ /** -+ * When searching for vulnerable players, if a player is invisible, the return value of this is the chance of seeing -+ * them anyway. -+ */ - public float getArmorVisibility() { - int var1 = 0; - ItemStack[] var2 = this.inventory.armorInventory; - int var3 = var2.length; - -- for(int var4 = 0; var4 < var3; ++var4) { -+ for (int var4 = 0; var4 < var3; ++var4) { - ItemStack var5 = var2[var4]; -- if(var5 != null) { -+ -+ if (var5 != null) { - ++var1; - } - } -@@ -676,58 +913,77 @@ - return (float)var1 / (float)this.inventory.armorInventory.length; - } - -- protected void damageEntity(DamageSource var1, float var2) { -- if(!this.isEntityInvulnerable()) { -- if(!var1.isUnblockable() && this.isBlocking() && var2 > 0.0F) { -- var2 = (1.0F + var2) * 0.5F; -+ /** -+ * Deals damage to the entity. If its a EntityPlayer then will take damage from the armor first and then health second -+ * with the reduced value. Args: damageAmount -+ */ -+ // Spout Start - protected to public -+ public void damageEntity(DamageSource par1DamageSource, float par2) { -+ // Spout End -+ if (!this.isEntityInvulnerable()) { -+ if (!par1DamageSource.isUnblockable() && this.isBlocking() && par2 > 0.0F) { -+ par2 = (1.0F + par2) * 0.5F; - } - -- var2 = this.applyArmorCalculations(var1, var2); -- var2 = this.applyPotionDamageCalculations(var1, var2); -- float var3 = var2; -- var2 = Math.max(var2 - this.getAbsorptionAmount(), 0.0F); -- this.setAbsorptionAmount(this.getAbsorptionAmount() - (var3 - var2)); -- if(var2 != 0.0F) { -- this.addExhaustion(var1.getHungerDamage()); -+ par2 = this.applyArmorCalculations(par1DamageSource, par2); -+ par2 = this.applyPotionDamageCalculations(par1DamageSource, par2); -+ float var3 = par2; -+ par2 = Math.max(par2 - this.getAbsorptionAmount(), 0.0F); -+ this.setAbsorptionAmount(this.getAbsorptionAmount() - (var3 - par2)); -+ -+ if (par2 != 0.0F) { -+ this.addExhaustion(par1DamageSource.getHungerDamage()); - float var4 = this.getHealth(); -- this.setHealth(this.getHealth() - var2); -- this.func_110142_aN().func_94547_a(var1, var4, var2); -+ this.setHealth(this.getHealth() - par2); -+ this.func_110142_aN().func_94547_a(par1DamageSource, var4, par2); - } - } - } - -- public void displayGUIFurnace(TileEntityFurnace var1) { -- } -- -- public void displayGUIDispenser(TileEntityDispenser var1) { -- } -- -- public void displayGUIEditSign(TileEntity var1) { -- } -- -- public void displayGUIBrewingStand(TileEntityBrewingStand var1) { -- } -- -- public void displayGUIBeacon(TileEntityBeacon var1) { -- } -- -- public void displayGUIMerchant(IMerchant var1, String var2) { -- } -- -- public void displayGUIBook(ItemStack var1) { -- } -- -- public boolean interactWith(Entity var1) { -+ /** -+ * Displays the furnace GUI for the passed in furnace entity. Args: tileEntityFurnace -+ */ -+ public void displayGUIFurnace(TileEntityFurnace par1TileEntityFurnace) {} -+ -+ /** -+ * Displays the dipsenser GUI for the passed in dispenser entity. Args: TileEntityDispenser -+ */ -+ public void displayGUIDispenser(TileEntityDispenser par1TileEntityDispenser) {} -+ -+ /** -+ * Displays the GUI for editing a sign. Args: tileEntitySign -+ */ -+ public void displayGUIEditSign(TileEntity par1TileEntity) {} -+ -+ /** -+ * Displays the GUI for interacting with a brewing stand. -+ */ -+ public void displayGUIBrewingStand(TileEntityBrewingStand par1TileEntityBrewingStand) {} -+ -+ /** -+ * Displays the GUI for interacting with a beacon. -+ */ -+ public void displayGUIBeacon(TileEntityBeacon par1TileEntityBeacon) {} -+ -+ public void displayGUIMerchant(IMerchant par1IMerchant, String par2Str) {} -+ -+ /** -+ * Displays the GUI for interacting with a book. -+ */ -+ public void displayGUIBook(ItemStack par1ItemStack) {} -+ -+ public boolean interactWith(Entity par1Entity) { - ItemStack var2 = this.getCurrentEquippedItem(); - ItemStack var3 = var2 != null ? var2.copy() : null; -- if(!var1.interactFirst(this)) { -- if(var2 != null && var1 instanceof EntityLivingBase) { -- if(this.capabilities.isCreativeMode) { -+ -+ if (!par1Entity.interactFirst(this)) { -+ if (var2 != null && par1Entity instanceof EntityLivingBase) { -+ if (this.capabilities.isCreativeMode) { - var2 = var3; - } - -- if(var2.func_111282_a(this, (EntityLivingBase)var1)) { -- if(var2.stackSize <= 0 && !this.capabilities.isCreativeMode) { -+ if (var2.func_111282_a(this, (EntityLivingBase)par1Entity)) { -+ if (var2.stackSize <= 0 && !this.capabilities.isCreativeMode) { - this.destroyCurrentEquippedItem(); - } - -@@ -737,10 +993,10 @@ - - return false; - } else { -- if(var2 != null && var2 == this.getCurrentEquippedItem()) { -- if(var2.stackSize <= 0 && !this.capabilities.isCreativeMode) { -+ if (var2 != null && var2 == this.getCurrentEquippedItem()) { -+ if (var2.stackSize <= 0 && !this.capabilities.isCreativeMode) { - this.destroyCurrentEquippedItem(); -- } else if(var2.stackSize < var3.stackSize && this.capabilities.isCreativeMode) { -+ } else if (var2.stackSize < var3.stackSize && this.capabilities.isCreativeMode) { - var2.stackSize = var3.stackSize; - } - } -@@ -749,224 +1005,269 @@ - } - } - -+ /** -+ * Returns the currently being used item by the player. -+ */ - public ItemStack getCurrentEquippedItem() { - return this.inventory.getCurrentItem(); - } - -+ /** -+ * Destroys the currently equipped item from the player's inventory. -+ */ - public void destroyCurrentEquippedItem() { - this.inventory.setInventorySlotContents(this.inventory.currentItem, (ItemStack)null); - } - -+ /** -+ * Returns the Y Offset of this entity. -+ */ - public double getYOffset() { - return (double)(this.yOffset - 0.5F); - } - -- public void attackTargetEntityWithCurrentItem(Entity var1) { -- if(var1.canAttackWithItem()) { -- if(!var1.hitByEntity(this)) { -+ /** -+ * Attacks for the player the targeted entity with the currently equipped item. The equipped item has hitEntity called -+ * on it. Args: targetEntity -+ */ -+ public void attackTargetEntityWithCurrentItem(Entity par1Entity) { -+ if (par1Entity.canAttackWithItem()) { -+ if (!par1Entity.hitByEntity(this)) { - float var2 = (float)this.getEntityAttribute(SharedMonsterAttributes.attackDamage).getAttributeValue(); - int var3 = 0; - float var4 = 0.0F; -- if(var1 instanceof EntityLivingBase) { -- var4 = EnchantmentHelper.getEnchantmentModifierLiving(this, (EntityLivingBase)var1); -- var3 += EnchantmentHelper.getKnockbackModifier(this, (EntityLivingBase)var1); -+ -+ if (par1Entity instanceof EntityLivingBase) { -+ var4 = EnchantmentHelper.getEnchantmentModifierLiving(this, (EntityLivingBase)par1Entity); -+ var3 += EnchantmentHelper.getKnockbackModifier(this, (EntityLivingBase)par1Entity); - } - -- if(this.isSprinting()) { -+ if (this.isSprinting()) { - ++var3; - } - -- if(var2 > 0.0F || var4 > 0.0F) { -- boolean var5 = this.fallDistance > 0.0F && !this.onGround && !this.isOnLadder() && !this.isInWater() && !this.isPotionActive(Potion.blindness) && this.ridingEntity == null && var1 instanceof EntityLivingBase; -- if(var5 && var2 > 0.0F) { -+ if (var2 > 0.0F || var4 > 0.0F) { -+ boolean var5 = this.fallDistance > 0.0F && !this.onGround && !this.isOnLadder() && !this.isInWater() && !this.isPotionActive(Potion.blindness) && this.ridingEntity == null && par1Entity instanceof EntityLivingBase; -+ -+ if (var5 && var2 > 0.0F) { - var2 *= 1.5F; - } - - var2 += var4; - boolean var6 = false; - int var7 = EnchantmentHelper.getFireAspectModifier(this); -- if(var1 instanceof EntityLivingBase && var7 > 0 && !var1.isBurning()) { -+ -+ if (par1Entity instanceof EntityLivingBase && var7 > 0 && !par1Entity.isBurning()) { - var6 = true; -- var1.setFire(1); -+ par1Entity.setFire(1); - } - -- boolean var8 = var1.attackEntityFrom(DamageSource.causePlayerDamage(this), var2); -- if(var8) { -- if(var3 > 0) { -- var1.addVelocity((double)(-MathHelper.sin(this.rotationYaw * (float)Math.PI / 180.0F) * (float)var3 * 0.5F), 0.1D, (double)(MathHelper.cos(this.rotationYaw * (float)Math.PI / 180.0F) * (float)var3 * 0.5F)); -+ boolean var8 = par1Entity.attackEntityFrom(DamageSource.causePlayerDamage(this), var2); -+ -+ if (var8) { -+ if (var3 > 0) { -+ par1Entity.addVelocity((double)(-MathHelper.sin(this.rotationYaw * (float)Math.PI / 180.0F) * (float)var3 * 0.5F), 0.1D, (double)(MathHelper.cos(this.rotationYaw * (float)Math.PI / 180.0F) * (float)var3 * 0.5F)); - this.motionX *= 0.6D; - this.motionZ *= 0.6D; - this.setSprinting(false); - } - -- if(var5) { -- this.onCriticalHit(var1); -- } -- -- if(var4 > 0.0F) { -- this.onEnchantmentCritical(var1); -- } -- -- if(var2 >= 18.0F) { -+ if (var5) { -+ this.onCriticalHit(par1Entity); -+ } -+ -+ if (var4 > 0.0F) { -+ this.onEnchantmentCritical(par1Entity); -+ } -+ -+ if (var2 >= 18.0F) { - this.triggerAchievement(AchievementList.overkill); - } - -- this.setLastAttacker(var1); -- if(var1 instanceof EntityLivingBase) { -- EnchantmentThorns.func_92096_a(this, (EntityLivingBase)var1, this.ab); -+ this.setLastAttacker(par1Entity); -+ -+ if (par1Entity instanceof EntityLivingBase) { -+ EnchantmentThorns.func_92096_a(this, (EntityLivingBase)par1Entity, this.rand); - } - } - - ItemStack var9 = this.getCurrentEquippedItem(); -- Object var10 = var1; -- if(var1 instanceof EntityDragonPart) { -- IEntityMultiPart var11 = ((EntityDragonPart)var1).entityDragonObj; -- if(var11 != null && var11 instanceof EntityLivingBase) { -+ Object var10 = par1Entity; -+ -+ if (par1Entity instanceof EntityDragonPart) { -+ IEntityMultiPart var11 = ((EntityDragonPart)par1Entity).entityDragonObj; -+ -+ if (var11 != null && var11 instanceof EntityLivingBase) { - var10 = (EntityLivingBase)var11; - } - } - -- if(var9 != null && var10 instanceof EntityLivingBase) { -+ if (var9 != null && var10 instanceof EntityLivingBase) { - var9.hitEntity((EntityLivingBase)var10, this); -- if(var9.stackSize <= 0) { -+ -+ if (var9.stackSize <= 0) { - this.destroyCurrentEquippedItem(); - } - } - -- if(var1 instanceof EntityLivingBase) { -+ if (par1Entity instanceof EntityLivingBase) { - this.addStat(StatList.damageDealtStat, Math.round(var2 * 10.0F)); -- if(var7 > 0 && var8) { -- var1.setFire(var7 * 4); -- } else if(var6) { -- var1.extinguish(); -+ -+ if (var7 > 0 && var8) { -+ par1Entity.setFire(var7 * 4); -+ } else if (var6) { -+ par1Entity.extinguish(); - } - } - - this.addExhaustion(0.3F); - } -- - } - } - } - -- public void onCriticalHit(Entity var1) { -- } -- -- public void onEnchantmentCritical(Entity var1) { -- } -- -- public void respawnPlayer() { -- } -- -+ /** -+ * Called when the player performs a critical hit on the Entity. Args: entity that was hit critically -+ */ -+ public void onCriticalHit(Entity par1Entity) {} -+ -+ public void onEnchantmentCritical(Entity par1Entity) {} -+ -+ public void respawnPlayer() {} -+ -+ /** -+ * Will get destroyed next tick. -+ */ - public void setDead() { - super.setDead(); - this.inventoryContainer.onContainerClosed(this); -- if(this.openContainer != null) { -+ -+ if (this.openContainer != null) { - this.openContainer.onContainerClosed(this); - } -- - } - -+ /** -+ * Checks if this entity is inside of an opaque block -+ */ - public boolean isEntityInsideOpaqueBlock() { - return !this.sleeping && super.isEntityInsideOpaqueBlock(); - } - -- public EnumStatus sleepInBedAt(int var1, int var2, int var3) { -- if(!this.worldObj.isRemote) { -- if(this.isPlayerSleeping() || !this.isEntityAlive()) { -+ /** -+ * Attempts to have the player sleep in a bed at the specified location. -+ */ -+ public EnumStatus sleepInBedAt(int par1, int par2, int par3) { -+ if (!this.worldObj.isRemote) { -+ if (this.isPlayerSleeping() || !this.isEntityAlive()) { - return EnumStatus.OTHER_PROBLEM; - } - -- if(!this.worldObj.provider.isSurfaceWorld()) { -+ if (!this.worldObj.provider.isSurfaceWorld()) { - return EnumStatus.NOT_POSSIBLE_HERE; - } - -- if(this.worldObj.isDaytime()) { -+ if (this.worldObj.isDaytime()) { - return EnumStatus.NOT_POSSIBLE_NOW; - } - -- if(Math.abs(this.posX - (double)var1) > 3.0D || Math.abs(this.posY - (double)var2) > 2.0D || Math.abs(this.posZ - (double)var3) > 3.0D) { -+ if (Math.abs(this.posX - (double)par1) > 3.0D || Math.abs(this.posY - (double)par2) > 2.0D || Math.abs(this.posZ - (double)par3) > 3.0D) { - return EnumStatus.TOO_FAR_AWAY; - } - - double var4 = 8.0D; - double var6 = 5.0D; -- List var8 = this.worldObj.getEntitiesWithinAABB(EntityMob.class, AxisAlignedBB.getAABBPool().getAABB((double)var1 - var4, (double)var2 - var6, (double)var3 - var4, (double)var1 + var4, (double)var2 + var6, (double)var3 + var4)); -- if(!var8.isEmpty()) { -+ List var8 = this.worldObj.getEntitiesWithinAABB(EntityMob.class, AxisAlignedBB.getAABBPool().getAABB((double)par1 - var4, (double)par2 - var6, (double)par3 - var4, (double)par1 + var4, (double)par2 + var6, (double)par3 + var4)); -+ -+ if (!var8.isEmpty()) { - return EnumStatus.NOT_SAFE; - } - } - -- if(this.isRiding()) { -+ if (this.isRiding()) { - this.mountEntity((Entity)null); - } - - this.setSize(0.2F, 0.2F); - this.yOffset = 0.2F; -- if(this.worldObj.blockExists(var1, var2, var3)) { -- int var9 = this.worldObj.getBlockMetadata(var1, var2, var3); -- int var5 = BlockBed.getDirection(var9); -- float var10 = 0.5F; -+ -+ if (this.worldObj.blockExists(par1, par2, par3)) { -+ int var10 = this.worldObj.getBlockMetadata(par1, par2, par3); -+ int var5 = BlockBed.getDirection(var10); -+ float var9 = 0.5F; - float var7 = 0.5F; -- switch(var5) { -+ -+ switch (var5) { - case 0: - var7 = 0.9F; - break; -+ - case 1: -- var10 = 0.1F; -+ var9 = 0.1F; - break; -+ - case 2: - var7 = 0.1F; - break; -+ - case 3: -- var10 = 0.9F; -+ var9 = 0.9F; - } - - this.func_71013_b(var5); -- this.setPosition((double)((float)var1 + var10), (double)((float)var2 + 15.0F / 16.0F), (double)((float)var3 + var7)); -+ this.setPosition((double)((float)par1 + var9), (double)((float)par2 + 0.9375F), (double)((float)par3 + var7)); - } else { -- this.setPosition((double)((float)var1 + 0.5F), (double)((float)var2 + 15.0F / 16.0F), (double)((float)var3 + 0.5F)); -+ this.setPosition((double)((float)par1 + 0.5F), (double)((float)par2 + 0.9375F), (double)((float)par3 + 0.5F)); - } - - this.sleeping = true; - this.sleepTimer = 0; -- this.playerLocation = new ChunkCoordinates(var1, var2, var3); -+ this.playerLocation = new ChunkCoordinates(par1, par2, par3); - this.motionX = this.motionZ = this.motionY = 0.0D; -- if(!this.worldObj.isRemote) { -+ -+ if (!this.worldObj.isRemote) { - this.worldObj.updateAllPlayersSleepingFlag(); - } - - return EnumStatus.OK; - } - -- private void func_71013_b(int var1) { -+ private void func_71013_b(int par1) { - this.field_71079_bU = 0.0F; - this.field_71089_bV = 0.0F; -- switch(var1) { -+ -+ switch (par1) { - case 0: - this.field_71089_bV = -1.8F; - break; -+ - case 1: - this.field_71079_bU = 1.8F; - break; -+ - case 2: - this.field_71089_bV = 1.8F; - break; -+ - case 3: - this.field_71079_bU = -1.8F; - } -- - } - -- public void wakeUpPlayer(boolean var1, boolean var2, boolean var3) { -+ /** -+ * Wake up the player if they're sleeping. -+ */ -+ public void wakeUpPlayer(boolean par1, boolean par2, boolean par3) { - this.setSize(0.6F, 1.8F); - this.resetHeight(); - ChunkCoordinates var4 = this.playerLocation; - ChunkCoordinates var5 = this.playerLocation; -- if(var4 != null && this.worldObj.getBlockId(var4.posX, var4.posY, var4.posZ) == Block.bed.blockID) { -+ -+ if (var4 != null && this.worldObj.getBlockId(var4.posX, var4.posY, var4.posZ) == Block.bed.blockID) { - BlockBed.setBedOccupied(this.worldObj, var4.posX, var4.posY, var4.posZ, false); - var5 = BlockBed.getNearestEmptyChunkCoordinates(this.worldObj, var4.posX, var4.posY, var4.posZ, 0); -- if(var5 == null) { -+ -+ if (var5 == null) { - var5 = new ChunkCoordinates(var4.posX, var4.posY + 1, var4.posZ); - } - -@@ -974,55 +1275,69 @@ - } - - this.sleeping = false; -- if(!this.worldObj.isRemote && var2) { -+ -+ if (!this.worldObj.isRemote && par2) { - this.worldObj.updateAllPlayersSleepingFlag(); - } - -- if(var1) { -+ if (par1) { - this.sleepTimer = 0; - } else { - this.sleepTimer = 100; - } - -- if(var3) { -+ if (par3) { - this.setSpawnChunk(this.playerLocation, false); - } -- - } - -+ /** -+ * Checks if the player is currently in a bed -+ */ - private boolean isInBed() { - return this.worldObj.getBlockId(this.playerLocation.posX, this.playerLocation.posY, this.playerLocation.posZ) == Block.bed.blockID; - } - -- public static ChunkCoordinates verifyRespawnCoordinates(World var0, ChunkCoordinates var1, boolean var2) { -- IChunkProvider var3 = var0.getChunkProvider(); -- var3.loadChunk(var1.posX - 3 >> 4, var1.posZ - 3 >> 4); -- var3.loadChunk(var1.posX + 3 >> 4, var1.posZ - 3 >> 4); -- var3.loadChunk(var1.posX - 3 >> 4, var1.posZ + 3 >> 4); -- var3.loadChunk(var1.posX + 3 >> 4, var1.posZ + 3 >> 4); -- if(var0.getBlockId(var1.posX, var1.posY, var1.posZ) == Block.bed.blockID) { -- ChunkCoordinates var8 = BlockBed.getNearestEmptyChunkCoordinates(var0, var1.posX, var1.posY, var1.posZ, 0); -+ /** -+ * Ensure that a block enabling respawning exists at the specified coordinates and find an empty space nearby to spawn. -+ */ -+ public static ChunkCoordinates verifyRespawnCoordinates(World par0World, ChunkCoordinates par1ChunkCoordinates, boolean par2) { -+ IChunkProvider var3 = par0World.getChunkProvider(); -+ var3.loadChunk(par1ChunkCoordinates.posX - 3 >> 4, par1ChunkCoordinates.posZ - 3 >> 4); -+ var3.loadChunk(par1ChunkCoordinates.posX + 3 >> 4, par1ChunkCoordinates.posZ - 3 >> 4); -+ var3.loadChunk(par1ChunkCoordinates.posX - 3 >> 4, par1ChunkCoordinates.posZ + 3 >> 4); -+ var3.loadChunk(par1ChunkCoordinates.posX + 3 >> 4, par1ChunkCoordinates.posZ + 3 >> 4); -+ -+ if (par0World.getBlockId(par1ChunkCoordinates.posX, par1ChunkCoordinates.posY, par1ChunkCoordinates.posZ) == Block.bed.blockID) { -+ ChunkCoordinates var8 = BlockBed.getNearestEmptyChunkCoordinates(par0World, par1ChunkCoordinates.posX, par1ChunkCoordinates.posY, par1ChunkCoordinates.posZ, 0); - return var8; - } else { -- Material var4 = var0.getBlockMaterial(var1.posX, var1.posY, var1.posZ); -- Material var5 = var0.getBlockMaterial(var1.posX, var1.posY + 1, var1.posZ); -+ Material var4 = par0World.getBlockMaterial(par1ChunkCoordinates.posX, par1ChunkCoordinates.posY, par1ChunkCoordinates.posZ); -+ Material var5 = par0World.getBlockMaterial(par1ChunkCoordinates.posX, par1ChunkCoordinates.posY + 1, par1ChunkCoordinates.posZ); - boolean var6 = !var4.isSolid() && !var4.isLiquid(); - boolean var7 = !var5.isSolid() && !var5.isLiquid(); -- return var2 && var6 && var7 ? var1 : null; -+ return par2 && var6 && var7 ? par1ChunkCoordinates : null; - } - } - -+ /** -+ * Returns the orientation of the bed in degrees. -+ */ - public float getBedOrientationInDegrees() { -- if(this.playerLocation != null) { -+ if (this.playerLocation != null) { - int var1 = this.worldObj.getBlockMetadata(this.playerLocation.posX, this.playerLocation.posY, this.playerLocation.posZ); - int var2 = BlockBed.getDirection(var1); -- switch(var2) { -+ -+ switch (var2) { - case 0: - return 90.0F; -+ - case 1: - return 0.0F; -+ - case 2: - return 270.0F; -+ - case 3: - return 180.0F; - } -@@ -1031,10 +1346,16 @@ - return 0.0F; - } - -+ /** -+ * Returns whether player is sleeping or not -+ */ - public boolean isPlayerSleeping() { - return this.sleeping; - } - -+ /** -+ * Returns whether or not the player is asleep and the screen has fully faded. -+ */ - public boolean isPlayerFullyAsleep() { - return this.sleeping && this.sleepTimer >= 100; - } -@@ -1043,23 +1364,28 @@ - return this.sleepTimer; - } - -- protected boolean getHideCape(int var1) { -- return (this.dataWatcher.getWatchableObjectByte(16) & 1 << var1) != 0; -+ protected boolean getHideCape(int par1) { -+ return (this.dataWatcher.getWatchableObjectByte(16) & 1 << par1) != 0; - } - -- protected void setHideCape(int var1, boolean var2) { -+ protected void setHideCape(int par1, boolean par2) { - byte var3 = this.dataWatcher.getWatchableObjectByte(16); -- if(var2) { -- this.dataWatcher.updateObject(16, Byte.valueOf((byte)(var3 | 1 << var1))); -+ -+ if (par2) { -+ this.dataWatcher.updateObject(16, Byte.valueOf((byte)(var3 | 1 << par1))); - } else { -- this.dataWatcher.updateObject(16, Byte.valueOf((byte)(var3 & ~(1 << var1)))); -+ this.dataWatcher.updateObject(16, Byte.valueOf((byte)(var3 & ~(1 << par1)))); - } -- -- } -- -- public void addChatMessage(String var1) { -- } -- -+ } -+ -+ /** -+ * Add a chat message to the player -+ */ -+ public void addChatMessage(String par1Str) {} -+ -+ /** -+ * Returns the location of the bed the player will respawn at, or null if the player has not slept in a bed. -+ */ - public ChunkCoordinates getBedLocation() { - return this.spawnChunk; - } -@@ -1068,161 +1394,207 @@ - return this.spawnForced; - } - -- public void setSpawnChunk(ChunkCoordinates var1, boolean var2) { -- if(var1 != null) { -- this.spawnChunk = new ChunkCoordinates(var1); -- this.spawnForced = var2; -+ /** -+ * Defines a spawn coordinate to player spawn. Used by bed after the player sleep on it. -+ */ -+ public void setSpawnChunk(ChunkCoordinates par1ChunkCoordinates, boolean par2) { -+ if (par1ChunkCoordinates != null) { -+ this.spawnChunk = new ChunkCoordinates(par1ChunkCoordinates); -+ this.spawnForced = par2; - } else { - this.spawnChunk = null; - this.spawnForced = false; - } -- -- } -- -- public void triggerAchievement(StatBase var1) { -- this.addStat(var1, 1); -- } -- -- public void addStat(StatBase var1, int var2) { -- } -- -+ } -+ -+ /** -+ * Will trigger the specified trigger. -+ */ -+ public void triggerAchievement(StatBase par1StatBase) { -+ this.addStat(par1StatBase, 1); -+ } -+ -+ /** -+ * Adds a value to a statistic field. -+ */ -+ public void addStat(StatBase par1StatBase, int par2) {} -+ -+ /** -+ * Causes this entity to do an upwards motion (jumping). -+ */ - protected void jump() { - super.jump(); - this.addStat(StatList.jumpStat, 1); -- if(this.isSprinting()) { -+ -+ if (this.isSprinting()) { - this.addExhaustion(0.8F); - } else { - this.addExhaustion(0.2F); - } -- - } - -- public void moveEntityWithHeading(float var1, float var2) { -+ /** -+ * Moves the entity based on the specified heading. Args: strafe, forward -+ */ -+ public void moveEntityWithHeading(float par1, float par2) { - double var3 = this.posX; - double var5 = this.posY; - double var7 = this.posZ; -- if(this.capabilities.isFlying && this.ridingEntity == null) { -+ -+ if (this.capabilities.isFlying && this.ridingEntity == null) { - double var9 = this.motionY; - float var11 = this.jumpMovementFactor; - this.jumpMovementFactor = this.capabilities.getFlySpeed(); -- super.moveEntityWithHeading(var1, var2); -+ // Spout Start -+ if (SpoutClient.getInstance().isFlySpeedCheat()) { -+ jumpMovementFactor *= Configuration.getFlightSpeedFactor(); -+ } -+ // Spout End -+ super.moveEntityWithHeading(par1, par2); - this.motionY = var9 * 0.6D; - this.jumpMovementFactor = var11; - } else { -- super.moveEntityWithHeading(var1, var2); -+ super.moveEntityWithHeading(par1, par2); - } - - this.addMovementStat(this.posX - var3, this.posY - var5, this.posZ - var7); - } - -+ /** -+ * the movespeed used for the new AI system -+ */ - public float getAIMoveSpeed() { - return (float)this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).getAttributeValue(); - } - -- public void addMovementStat(double var1, double var3, double var5) { -- if(this.ridingEntity == null) { -+ /** -+ * Adds a value to a movement statistic field - like run, walk, swin or climb. -+ */ -+ public void addMovementStat(double par1, double par3, double par5) { -+ if (this.ridingEntity == null) { - int var7; -- if(this.isInsideOfMaterial(Material.water)) { -- var7 = Math.round(MathHelper.sqrt_double(var1 * var1 + var3 * var3 + var5 * var5) * 100.0F); -- if(var7 > 0) { -+ -+ if (this.isInsideOfMaterial(Material.water)) { -+ var7 = Math.round(MathHelper.sqrt_double(par1 * par1 + par3 * par3 + par5 * par5) * 100.0F); -+ -+ if (var7 > 0) { - this.addStat(StatList.distanceDoveStat, var7); - this.addExhaustion(0.015F * (float)var7 * 0.01F); - } -- } else if(this.isInWater()) { -- var7 = Math.round(MathHelper.sqrt_double(var1 * var1 + var5 * var5) * 100.0F); -- if(var7 > 0) { -+ } else if (this.isInWater()) { -+ var7 = Math.round(MathHelper.sqrt_double(par1 * par1 + par5 * par5) * 100.0F); -+ -+ if (var7 > 0) { - this.addStat(StatList.distanceSwumStat, var7); - this.addExhaustion(0.015F * (float)var7 * 0.01F); - } -- } else if(this.isOnLadder()) { -- if(var3 > 0.0D) { -- this.addStat(StatList.distanceClimbedStat, (int)Math.round(var3 * 100.0D)); -+ } else if (this.isOnLadder()) { -+ if (par3 > 0.0D) { -+ this.addStat(StatList.distanceClimbedStat, (int)Math.round(par3 * 100.0D)); - } -- } else if(this.onGround) { -- var7 = Math.round(MathHelper.sqrt_double(var1 * var1 + var5 * var5) * 100.0F); -- if(var7 > 0) { -+ } else if (this.onGround) { -+ var7 = Math.round(MathHelper.sqrt_double(par1 * par1 + par5 * par5) * 100.0F); -+ -+ if (var7 > 0) { - this.addStat(StatList.distanceWalkedStat, var7); -- if(this.isSprinting()) { -- this.addExhaustion(10.0F * 0.01F * (float)var7 * 0.01F); -+ -+ if (this.isSprinting()) { -+ this.addExhaustion(0.099999994F * (float)var7 * 0.01F); - } else { - this.addExhaustion(0.01F * (float)var7 * 0.01F); - } - } - } else { -- var7 = Math.round(MathHelper.sqrt_double(var1 * var1 + var5 * var5) * 100.0F); -- if(var7 > 25) { -+ var7 = Math.round(MathHelper.sqrt_double(par1 * par1 + par5 * par5) * 100.0F); -+ -+ if (var7 > 25) { - this.addStat(StatList.distanceFlownStat, var7); - } - } -- - } - } - -- private void addMountedMovementStat(double var1, double var3, double var5) { -- if(this.ridingEntity != null) { -- int var7 = Math.round(MathHelper.sqrt_double(var1 * var1 + var3 * var3 + var5 * var5) * 100.0F); -- if(var7 > 0) { -- if(this.ridingEntity instanceof EntityMinecart) { -+ /** -+ * Adds a value to a mounted movement statistic field - by minecart, boat, or pig. -+ */ -+ private void addMountedMovementStat(double par1, double par3, double par5) { -+ if (this.ridingEntity != null) { -+ int var7 = Math.round(MathHelper.sqrt_double(par1 * par1 + par3 * par3 + par5 * par5) * 100.0F); -+ -+ if (var7 > 0) { -+ if (this.ridingEntity instanceof EntityMinecart) { - this.addStat(StatList.distanceByMinecartStat, var7); -- if(this.startMinecartRidingCoordinate == null) { -+ -+ if (this.startMinecartRidingCoordinate == null) { - this.startMinecartRidingCoordinate = new ChunkCoordinates(MathHelper.floor_double(this.posX), MathHelper.floor_double(this.posY), MathHelper.floor_double(this.posZ)); -- } else if((double)this.startMinecartRidingCoordinate.getDistanceSquared(MathHelper.floor_double(this.posX), MathHelper.floor_double(this.posY), MathHelper.floor_double(this.posZ)) >= 1000000.0D) { -+ } else if ((double)this.startMinecartRidingCoordinate.getDistanceSquared(MathHelper.floor_double(this.posX), MathHelper.floor_double(this.posY), MathHelper.floor_double(this.posZ)) >= 1000000.0D) { - this.addStat(AchievementList.onARail, 1); - } -- } else if(this.ridingEntity instanceof EntityBoat) { -+ } else if (this.ridingEntity instanceof EntityBoat) { - this.addStat(StatList.distanceByBoatStat, var7); -- } else if(this.ridingEntity instanceof EntityPig) { -+ } else if (this.ridingEntity instanceof EntityPig) { - this.addStat(StatList.distanceByPigStat, var7); - } - } - } -- - } - -- protected void fall(float var1) { -- if(!this.capabilities.allowFlying) { -- if(var1 >= 2.0F) { -- this.addStat(StatList.distanceFallenStat, (int)Math.round((double)var1 * 100.0D)); -+ /** -+ * Called when the mob is falling. Calculates and applies fall damage. -+ */ -+ protected void fall(float par1) { -+ if (!this.capabilities.allowFlying) { -+ if (par1 >= 2.0F) { -+ this.addStat(StatList.distanceFallenStat, (int)Math.round((double)par1 * 100.0D)); - } - -- super.fall(var1); -+ super.fall(par1); - } - } - -- public void onKillEntity(EntityLivingBase var1) { -- if(var1 instanceof IMob) { -+ /** -+ * This method gets called when the entity kills another one. -+ */ -+ public void onKillEntity(EntityLivingBase par1EntityLivingBase) { -+ if (par1EntityLivingBase instanceof IMob) { - this.triggerAchievement(AchievementList.killEnemy); - } -- - } - -+ /** -+ * Sets the Entity inside a web block. -+ */ - public void setInWeb() { -- if(!this.capabilities.isFlying) { -+ if (!this.capabilities.isFlying) { - super.setInWeb(); - } -- - } - -- public Icon getItemIcon(ItemStack var1, int var2) { -- Icon var3 = super.getItemIcon(var1, var2); -- if(var1.itemID == Item.fishingRod.itemID && this.fishEntity != null) { -+ /** -+ * Gets the Icon Index of the item currently held -+ */ -+ public Icon getItemIcon(ItemStack par1ItemStack, int par2) { -+ Icon var3 = super.getItemIcon(par1ItemStack, par2); -+ -+ if (par1ItemStack.itemID == Item.fishingRod.itemID && this.fishEntity != null) { - var3 = Item.fishingRod.func_94597_g(); - } else { -- if(var1.getItem().requiresMultipleRenderPasses()) { -- return var1.getItem().getIconFromDamageForRenderPass(var1.getItemDamage(), var2); -+ if (par1ItemStack.getItem().requiresMultipleRenderPasses()) { -+ return par1ItemStack.getItem().getIconFromDamageForRenderPass(par1ItemStack.getItemDamage(), par2); - } - -- if(this.itemInUse != null && var1.itemID == Item.bow.itemID) { -- int var4 = var1.getMaxItemUseDuration() - this.itemInUseCount; -- if(var4 >= 18) { -+ if (this.itemInUse != null && par1ItemStack.itemID == Item.bow.itemID) { -+ int var4 = par1ItemStack.getMaxItemUseDuration() - this.itemInUseCount; -+ -+ if (var4 >= 18) { - return Item.bow.getItemIconForUseDuration(2); - } - -- if(var4 > 13) { -+ if (var4 > 13) { - return Item.bow.getItemIconForUseDuration(1); - } - -- if(var4 > 0) { -+ if (var4 > 0) { - return Item.bow.getItemIconForUseDuration(0); - } - } -@@ -1231,92 +1603,119 @@ - return var3; - } - -- public ItemStack getCurrentArmor(int var1) { -- return this.inventory.armorItemInSlot(var1); -+ public ItemStack getCurrentArmor(int par1) { -+ return this.inventory.armorItemInSlot(par1); - } - -- public void addExperience(int var1) { -- this.addScore(var1); -+ /** -+ * This method increases the player's current amount of experience. -+ */ -+ public void addExperience(int par1) { -+ this.addScore(par1); - int var2 = Integer.MAX_VALUE - this.experienceTotal; -- if(var1 > var2) { -- var1 = var2; -+ -+ if (par1 > var2) { -+ par1 = var2; - } - -- this.experience += (float)var1 / (float)this.xpBarCap(); -+ this.experience += (float)par1 / (float)this.xpBarCap(); - -- for(this.experienceTotal += var1; this.experience >= 1.0F; this.experience /= (float)this.xpBarCap()) { -+ for (this.experienceTotal += par1; this.experience >= 1.0F; this.experience /= (float)this.xpBarCap()) { - this.experience = (this.experience - 1.0F) * (float)this.xpBarCap(); - this.addExperienceLevel(1); - } -- - } - -- public void addExperienceLevel(int var1) { -- this.experienceLevel += var1; -- if(this.experienceLevel < 0) { -+ /** -+ * Add experience levels to this player. -+ */ -+ public void addExperienceLevel(int par1) { -+ this.experienceLevel += par1; -+ -+ if (this.experienceLevel < 0) { - this.experienceLevel = 0; - this.experience = 0.0F; - this.experienceTotal = 0; - } - -- if(var1 > 0 && this.experienceLevel % 5 == 0 && (float)this.field_82249_h < (float)this.ticksExisted - 100.0F) { -+ if (par1 > 0 && this.experienceLevel % 5 == 0 && (float)this.field_82249_h < (float)this.ticksExisted - 100.0F) { - float var2 = this.experienceLevel > 30 ? 1.0F : (float)this.experienceLevel / 30.0F; -- this.worldObj.playSoundAtEntity(this, "random.levelup", var2 * (12.0F / 16.0F), 1.0F); -+ this.worldObj.playSoundAtEntity(this, "random.levelup", var2 * 0.75F, 1.0F); - this.field_82249_h = this.ticksExisted; - } -- - } - -+ /** -+ * This method returns the cap amount of experience that the experience bar can hold. With each level, the experience -+ * cap on the player's experience bar is raised by 10. -+ */ - public int xpBarCap() { - return this.experienceLevel >= 30 ? 62 + (this.experienceLevel - 30) * 7 : (this.experienceLevel >= 15 ? 17 + (this.experienceLevel - 15) * 3 : 17); - } - -- public void addExhaustion(float var1) { -- if(!this.capabilities.disableDamage) { -- if(!this.worldObj.isRemote) { -- this.foodStats.addExhaustion(var1); -+ /** -+ * increases exhaustion level by supplied amount -+ */ -+ public void addExhaustion(float par1) { -+ if (!this.capabilities.disableDamage) { -+ if (!this.worldObj.isRemote) { -+ this.foodStats.addExhaustion(par1); - } -- - } - } - -+ /** -+ * Returns the player's FoodStats object. -+ */ - public FoodStats getFoodStats() { - return this.foodStats; - } - -- public boolean canEat(boolean var1) { -- return (var1 || this.foodStats.needFood()) && !this.capabilities.disableDamage; -+ public boolean canEat(boolean par1) { -+ return (par1 || this.foodStats.needFood()) && !this.capabilities.disableDamage; - } - -+ /** -+ * Checks if the player's health is not full and not zero. -+ */ - public boolean shouldHeal() { - return this.getHealth() > 0.0F && this.getHealth() < this.getMaxHealth(); - } - -- public void setItemInUse(ItemStack var1, int var2) { -- if(var1 != this.itemInUse) { -- this.itemInUse = var1; -- this.itemInUseCount = var2; -- if(!this.worldObj.isRemote) { -+ /** -+ * sets the itemInUse when the use item button is clicked. Args: itemstack, int maxItemUseDuration -+ */ -+ public void setItemInUse(ItemStack par1ItemStack, int par2) { -+ if (par1ItemStack != this.itemInUse) { -+ this.itemInUse = par1ItemStack; -+ this.itemInUseCount = par2; -+ -+ if (!this.worldObj.isRemote) { - this.setEating(true); - } -- - } - } - -- public boolean isCurrentToolAdventureModeExempt(int var1, int var2, int var3) { -- if(this.capabilities.allowEdit) { -+ /** -+ * Returns true if the given block can be mined with the current tool in adventure mode. -+ */ -+ public boolean isCurrentToolAdventureModeExempt(int par1, int par2, int par3) { -+ if (this.capabilities.allowEdit) { - return true; - } else { -- int var4 = this.worldObj.getBlockId(var1, var2, var3); -- if(var4 > 0) { -+ int var4 = this.worldObj.getBlockId(par1, par2, par3); -+ -+ if (var4 > 0) { - Block var5 = Block.blocksList[var4]; -- if(var5.blockMaterial.isAdventureModeExempt()) { -+ -+ if (var5.blockMaterial.isAdventureModeExempt()) { - return true; - } - -- if(this.getCurrentEquippedItem() != null) { -+ if (this.getCurrentEquippedItem() != null) { - ItemStack var6 = this.getCurrentEquippedItem(); -- if(var6.canHarvestBlock(var5) || var6.getStrVsBlock(var5) > 1.0F) { -+ -+ if (var6.canHarvestBlock(var5) || var6.getStrVsBlock(var5) > 1.0F) { - return true; - } - } -@@ -1326,12 +1725,15 @@ - } - } - -- public boolean canPlayerEdit(int var1, int var2, int var3, int var4, ItemStack var5) { -- return this.capabilities.allowEdit ? true : (var5 != null ? var5.canEditBlocks() : false); -+ public boolean canPlayerEdit(int par1, int par2, int par3, int par4, ItemStack par5ItemStack) { -+ return this.capabilities.allowEdit ? true : (par5ItemStack != null ? par5ItemStack.canEditBlocks() : false); - } - -- protected int getExperiencePoints(EntityPlayer var1) { -- if(this.worldObj.getGameRules().getGameRuleBooleanValue("keepInventory")) { -+ /** -+ * Get the experience points the entity currently has. -+ */ -+ protected int getExperiencePoints(EntityPlayer par1EntityPlayer) { -+ if (this.worldObj.getGameRules().getGameRuleBooleanValue("keepInventory")) { - return 0; - } else { - int var2 = this.experienceLevel * 7; -@@ -1339,83 +1741,151 @@ - } - } - -+ /** -+ * Only use is to identify if class is an instance of player for experience dropping -+ */ - protected boolean isPlayer() { - return true; - } - -+ /** -+ * Gets the username of the entity. -+ */ - public String getEntityName() { -- return this.bu; -+ return this.username; - } - - public boolean getAlwaysRenderNameTagForRender() { - return true; - } - -- public void clonePlayer(EntityPlayer var1, boolean var2) { -- if(var2) { -- this.inventory.copyInventory(var1.inventory); -- this.setHealth(var1.getHealth()); -- this.foodStats = var1.foodStats; -- this.experienceLevel = var1.experienceLevel; -- this.experienceTotal = var1.experienceTotal; -- this.experience = var1.experience; -- this.setScore(var1.getScore()); -- this.teleportDirection = var1.teleportDirection; -- } else if(this.worldObj.getGameRules().getGameRuleBooleanValue("keepInventory")) { -- this.inventory.copyInventory(var1.inventory); -- this.experienceLevel = var1.experienceLevel; -- this.experienceTotal = var1.experienceTotal; -- this.experience = var1.experience; -- this.setScore(var1.getScore()); -- } -- -- this.theInventoryEnderChest = var1.theInventoryEnderChest; -- } -- -+ /** -+ * Copies the values from the given player into this player if boolean par2 is true. Always clones Ender Chest -+ * Inventory. -+ */ -+ public void clonePlayer(EntityPlayer par1EntityPlayer, boolean par2) { -+ if (par2) { -+ this.inventory.copyInventory(par1EntityPlayer.inventory); -+ this.setHealth(par1EntityPlayer.getHealth()); -+ this.foodStats = par1EntityPlayer.foodStats; -+ this.experienceLevel = par1EntityPlayer.experienceLevel; -+ this.experienceTotal = par1EntityPlayer.experienceTotal; -+ this.experience = par1EntityPlayer.experience; -+ this.setScore(par1EntityPlayer.getScore()); -+ this.teleportDirection = par1EntityPlayer.teleportDirection; -+ } else if (this.worldObj.getGameRules().getGameRuleBooleanValue("keepInventory")) { -+ this.inventory.copyInventory(par1EntityPlayer.inventory); -+ this.experienceLevel = par1EntityPlayer.experienceLevel; -+ this.experienceTotal = par1EntityPlayer.experienceTotal; -+ this.experience = par1EntityPlayer.experience; -+ this.setScore(par1EntityPlayer.getScore()); -+ } -+ -+ this.theInventoryEnderChest = par1EntityPlayer.theInventoryEnderChest; -+ } -+ // Spout Start - Added back handle key press -+ public void handleKeyPress(int i, boolean keyReleased) { -+ } -+ -+ public boolean isTreadingWater() { -+ return (this.inWater || this.partiallyInWater) && this.treadWaterToggle; -+ } -+ // Spout End -+ -+ // Spout Start - Easter egg -+ public void doFancyStuff() { -+ if (isSneaking()) { -+ return; -+ } -+ if (Minecraft.getMinecraft().isGamePaused) { -+ return; -+ } -+ if (Minecraft.getMinecraft().thePlayer.getDistanceSqToEntity(this) > 16) { -+ return; -+ } -+ -+ if (vip != null) { -+ for (Entry particle : vip.getParticles().entrySet()) { -+ if (rand.nextInt(particle.getValue()) == 0) { -+ Minecraft.getMinecraft().renderGlobal.spawnParticle(particle.getKey(), posX + rand.nextFloat() - 0.5, boundingBox.minY + Math.max(0, rand.nextFloat() - 0.25F), posZ + rand.nextFloat() - 0.5, 0, 0, 0.0F); -+ } -+ } -+ } -+ } -+ // Spout End -+ -+ /** -+ * returns if this entity triggers Block.onEntityWalking on the blocks they walk on. used for spiders and wolves to -+ * prevent them from trampling crops -+ */ - protected boolean canTriggerWalking() { - return !this.capabilities.isFlying; - } - -- public void sendPlayerAbilities() { -- } -- -- public void setGameType(EnumGameType var1) { -- } -- -+ /** -+ * Sends the player's abilities to the server (if there is one). -+ */ -+ public void sendPlayerAbilities() {} -+ -+ /** -+ * Sets the player's game mode and sends it to them. -+ */ -+ public void setGameType(EnumGameType par1EnumGameType) {} -+ -+ /** -+ * Gets the name of this command sender (usually username, but possibly "Rcon") -+ */ - public String getCommandSenderName() { -- return this.bu; -+ return this.username; - } - - public World getEntityWorld() { - return this.worldObj; - } - -+ /** -+ * Returns the InventoryEnderChest of this player. -+ */ - public InventoryEnderChest getInventoryEnderChest() { - return this.theInventoryEnderChest; - } - -- public ItemStack getEquipmentInSlot(int var1) { -- return var1 == 0 ? this.inventory.getCurrentItem() : this.inventory.armorInventory[var1 - 1]; -+ /** -+ * 0 = item, 1-n is armor -+ */ -+ public ItemStack getCurrentItemOrArmor(int par1) { -+ return par1 == 0 ? this.inventory.getCurrentItem() : this.inventory.armorInventory[par1 - 1]; - } - -+ /** -+ * Returns the item that this EntityLiving is holding, if any. -+ */ - public ItemStack getHeldItem() { - return this.inventory.getCurrentItem(); - } - -- public void setCurrentItemOrArmor(int var1, ItemStack var2) { -- this.inventory.armorInventory[var1] = var2; -+ /** -+ * Sets the held item, or an armor slot. Slot 0 is held item. Slot 1-4 is armor. Params: Item, slot -+ */ -+ public void setCurrentItemOrArmor(int par1, ItemStack par2ItemStack) { -+ this.inventory.armorInventory[par1] = par2ItemStack; - } - -- public boolean isInvisibleToPlayer(EntityPlayer var1) { -- if(!this.isInvisible()) { -+ /** -+ * Only used by renderer in EntityLivingBase subclasses.\nDetermines if an entity is visible or not to a specfic -+ * player, if the entity is normally invisible.\nFor EntityLivingBase subclasses, returning false when invisible will -+ * render the entity semitransparent. -+ */ -+ public boolean isInvisibleToPlayer(EntityPlayer par1EntityPlayer) { -+ if (!this.isInvisible()) { - return false; - } else { - Team var2 = this.getTeam(); -- return var2 == null || var1 == null || var1.getTeam() != var2 || !var2.func_98297_h(); -+ return var2 == null || par1EntityPlayer == null || par1EntityPlayer.getTeam() != var2 || !var2.func_98297_h(); - } - } - -- public ItemStack[] getInventory() { -+ public ItemStack[] getLastActiveItems() { - return this.inventory.armorInventory; - } - -@@ -1432,22 +1902,25 @@ - } - - public Team getTeam() { -- return this.getWorldScoreboard().getPlayersTeam(this.bu); -+ return this.getWorldScoreboard().getPlayersTeam(this.username); - } - -+ /** -+ * Returns the translated name of the entity. -+ */ - public String getTranslatedEntityName() { -- return ScorePlayerTeam.formatPlayerName(this.getTeam(), this.bu); -+ return ScorePlayerTeam.formatPlayerName(this.getTeam(), this.username); - } - -- public void setAbsorptionAmount(float var1) { -- if(var1 < 0.0F) { -- var1 = 0.0F; -+ public void setAbsorptionAmount(float par1) { -+ if (par1 < 0.0F) { -+ par1 = 0.0F; - } - -- this.getDataWatcher().updateObject(17, Float.valueOf(var1)); -+ this.getDataWatcher().updateObject(17, Float.valueOf(par1)); - } - - public float getAbsorptionAmount() { - return this.getDataWatcher().getWatchableObjectFloat(17); -- } -+ } - } ---- net/minecraft/src/BlockPressurePlate.java -+++ net/minecraft/src/BlockPressurePlate.java -@@ -4,41 +4,55 @@ - import java.util.List; - - public class BlockPressurePlate extends BlockBasePressurePlate { -+ -+ /** The mob type that can trigger this pressure plate. */ - private EnumMobType triggerMobType; - -- protected BlockPressurePlate(int var1, String var2, Material var3, EnumMobType var4) { -- super(var1, var2, var3); -- this.triggerMobType = var4; -- } -- -- protected int getMetaFromWeight(int var1) { -- return var1 > 0 ? 1 : 0; -- } -- -- protected int getPowerSupply(int var1) { -- return var1 == 1 ? 15 : 0; -- } -- -- protected int getPlateState(World var1, int var2, int var3, int var4) { -+ protected BlockPressurePlate(int par1, String par2Str, Material par3Material, EnumMobType par4EnumMobType) { -+ super(par1, par2Str, par3Material); -+ this.triggerMobType = par4EnumMobType; -+ } -+ -+ /** -+ * Argument is weight (0-15). Return the metadata to be set because of it. -+ */ -+ protected int getMetaFromWeight(int par1) { -+ return par1 > 0 ? 1 : 0; -+ } -+ -+ /** -+ * Argument is metadata. Returns power level (0-15) -+ */ -+ protected int getPowerSupply(int par1) { -+ return par1 == 1 ? 15 : 0; -+ } -+ -+ /** -+ * Returns the current state of the pressure plate. Returns a value between 0 and 15 based on the number of items on -+ * it. -+ */ -+ protected int getPlateState(World par1World, int par2, int par3, int par4) { - List var5 = null; -- if(this.triggerMobType == EnumMobType.everything) { -- var5 = var1.getEntitiesWithinAABBExcludingEntity((Entity)null, this.getSensitiveAABB(var2, var3, var4)); -- } -- -- if(this.triggerMobType == EnumMobType.mobs) { -- var5 = var1.getEntitiesWithinAABB(EntityLivingBase.class, this.getSensitiveAABB(var2, var3, var4)); -- } -- -- if(this.triggerMobType == EnumMobType.players) { -- var5 = var1.getEntitiesWithinAABB(EntityPlayer.class, this.getSensitiveAABB(var2, var3, var4)); -- } -- -- if(var5 != null && !var5.isEmpty()) { -+ -+ if (this.triggerMobType == EnumMobType.everything) { -+ var5 = par1World.getEntitiesWithinAABBExcludingEntity((Entity)null, this.getSensitiveAABB(par2, par3, par4)); -+ } -+ -+ if (this.triggerMobType == EnumMobType.mobs) { -+ var5 = par1World.getEntitiesWithinAABB(EntityLivingBase.class, this.getSensitiveAABB(par2, par3, par4)); -+ } -+ -+ if (this.triggerMobType == EnumMobType.players) { -+ var5 = par1World.getEntitiesWithinAABB(EntityPlayer.class, this.getSensitiveAABB(par2, par3, par4)); -+ } -+ -+ if (var5 != null && !var5.isEmpty()) { - Iterator var6 = var5.iterator(); - -- while(var6.hasNext()) { -+ while (var6.hasNext()) { - Entity var7 = (Entity)var6.next(); -- if(!var7.doesEntityNotTriggerPressurePlate()) { -+ -+ if (!var7.doesEntityNotTriggerPressurePlate()) { - return 15; - } - } ---- net/minecraft/src/ComponentNetherBridgeEnd.java -+++ net/minecraft/src/ComponentNetherBridgeEnd.java -@@ -6,58 +6,61 @@ - public class ComponentNetherBridgeEnd extends ComponentNetherBridgePiece { - private int fillSeed; - -- public ComponentNetherBridgeEnd() { -- } -- -- public ComponentNetherBridgeEnd(int var1, Random var2, StructureBoundingBox var3, int var4) { -- super(var1); -- this.coordBaseMode = var4; -- this.boundingBox = var3; -- this.fillSeed = var2.nextInt(); -- } -- -- public static ComponentNetherBridgeEnd func_74971_a(List var0, Random var1, int var2, int var3, int var4, int var5, int var6) { -- StructureBoundingBox var7 = StructureBoundingBox.getComponentToAddBoundingBox(var2, var3, var4, -1, -3, 0, 5, 10, 8, var5); -- return isAboveGround(var7) && StructureComponent.findIntersecting(var0, var7) == null ? new ComponentNetherBridgeEnd(var6, var1, var7, var5) : null; -- } -- -- protected void func_143011_b(NBTTagCompound var1) { -- super.func_143011_b(var1); -- this.fillSeed = var1.getInteger("Seed"); -- } -- -- protected void func_143012_a(NBTTagCompound var1) { -- super.func_143012_a(var1); -- var1.setInteger("Seed", this.fillSeed); -- } -- -- public boolean addComponentParts(World var1, Random var2, StructureBoundingBox var3) { -+ public ComponentNetherBridgeEnd() {} -+ -+ public ComponentNetherBridgeEnd(int par1, Random par2Random, StructureBoundingBox par3StructureBoundingBox, int par4) { -+ super(par1); -+ this.coordBaseMode = par4; -+ this.boundingBox = par3StructureBoundingBox; -+ this.fillSeed = par2Random.nextInt(); -+ } -+ -+ public static ComponentNetherBridgeEnd func_74971_a(List par0List, Random par1Random, int par2, int par3, int par4, int par5, int par6) { -+ StructureBoundingBox var7 = StructureBoundingBox.getComponentToAddBoundingBox(par2, par3, par4, -1, -3, 0, 5, 10, 8, par5); -+ return isAboveGround(var7) && StructureComponent.findIntersecting(par0List, var7) == null ? new ComponentNetherBridgeEnd(par6, par1Random, var7, par5) : null; -+ } -+ -+ protected void func_143011_b(NBTTagCompound par1NBTTagCompound) { -+ super.func_143011_b(par1NBTTagCompound); -+ this.fillSeed = par1NBTTagCompound.getInteger("Seed"); -+ } -+ -+ protected void func_143012_a(NBTTagCompound par1NBTTagCompound) { -+ super.func_143012_a(par1NBTTagCompound); -+ par1NBTTagCompound.setInteger("Seed", this.fillSeed); -+ } -+ -+ /** -+ * second Part of Structure generating, this for example places Spiderwebs, Mob Spawners, it closes Mineshafts at the -+ * end, it adds Fences... -+ */ -+ public boolean addComponentParts(World par1World, Random par2Random, StructureBoundingBox par3StructureBoundingBox) { - Random var4 = new Random((long)this.fillSeed); -- - int var5; - int var6; - int var7; -- for(var5 = 0; var5 <= 4; ++var5) { -- for(var6 = 3; var6 <= 4; ++var6) { -+ -+ for (var5 = 0; var5 <= 4; ++var5) { -+ for (var6 = 3; var6 <= 4; ++var6) { - var7 = var4.nextInt(8); -- this.fillWithBlocks(var1, var3, var5, var6, 0, var5, var6, var7, Block.netherBrick.blockID, Block.netherBrick.blockID, false); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, var5, var6, 0, var5, var6, var7, Block.netherBrick.blockID, Block.netherBrick.blockID, false); - } - } - - var5 = var4.nextInt(8); -- this.fillWithBlocks(var1, var3, 0, 5, 0, 0, 5, var5, Block.netherBrick.blockID, Block.netherBrick.blockID, false); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 0, 5, 0, 0, 5, var5, Block.netherBrick.blockID, Block.netherBrick.blockID, false); - var5 = var4.nextInt(8); -- this.fillWithBlocks(var1, var3, 4, 5, 0, 4, 5, var5, Block.netherBrick.blockID, Block.netherBrick.blockID, false); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 4, 5, 0, 4, 5, var5, Block.netherBrick.blockID, Block.netherBrick.blockID, false); - -- for(var5 = 0; var5 <= 4; ++var5) { -+ for (var5 = 0; var5 <= 4; ++var5) { - var6 = var4.nextInt(5); -- this.fillWithBlocks(var1, var3, var5, 2, 0, var5, 2, var6, Block.netherBrick.blockID, Block.netherBrick.blockID, false); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, var5, 2, 0, var5, 2, var6, Block.netherBrick.blockID, Block.netherBrick.blockID, false); - } - -- for(var5 = 0; var5 <= 4; ++var5) { -- for(var6 = 0; var6 <= 1; ++var6) { -+ for (var5 = 0; var5 <= 4; ++var5) { -+ for (var6 = 0; var6 <= 1; ++var6) { - var7 = var4.nextInt(3); -- this.fillWithBlocks(var1, var3, var5, var6, 0, var5, var6, var7, Block.netherBrick.blockID, Block.netherBrick.blockID, false); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, var5, var6, 0, var5, var6, var7, Block.netherBrick.blockID, Block.netherBrick.blockID, false); - } - } - ---- net/minecraft/src/BlockCarpet.java -+++ net/minecraft/src/BlockCarpet.java -@@ -3,83 +3,125 @@ - import java.util.List; - - public class BlockCarpet extends Block { -- protected BlockCarpet(int var1) { -- super(var1, Material.materialCarpet); -- this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F / 16.0F, 1.0F); -+ protected BlockCarpet(int par1) { -+ super(par1, Material.materialCarpet); -+ this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.0625F, 1.0F); - this.setTickRandomly(true); - this.setCreativeTab(CreativeTabs.tabDecorations); - this.func_111047_d(0); - } - -- public Icon getIcon(int var1, int var2) { -- return Block.cloth.getIcon(var1, var2); -+ /** -+ * From the specified side and block metadata retrieves the blocks texture. Args: side, metadata -+ */ -+ public Icon getIcon(int par1, int par2) { -+ return Block.cloth.getIcon(par1, par2); - } - -- public AxisAlignedBB getCollisionBoundingBoxFromPool(World var1, int var2, int var3, int var4) { -+ /** -+ * Returns a bounding box from the pool of bounding boxes (this means this box can change after the pool has been -+ * cleared to be reused) -+ */ -+ public AxisAlignedBB getCollisionBoundingBoxFromPool(World par1World, int par2, int par3, int par4) { - byte var5 = 0; -- float var6 = 1.0F / 16.0F; -- return AxisAlignedBB.getAABBPool().getAABB((double)var2 + this.minX, (double)var3 + this.minY, (double)var4 + this.minZ, (double)var2 + this.maxX, (double)((float)var3 + (float)var5 * var6), (double)var4 + this.maxZ); -+ float var6 = 0.0625F; -+ return AxisAlignedBB.getAABBPool().getAABB((double)par2 + this.minX, (double)par3 + this.minY, (double)par4 + this.minZ, (double)par2 + this.maxX, (double)((float)par3 + (float)var5 * var6), (double)par4 + this.maxZ); - } - -+ /** -+ * Is this block (a) opaque and (b) a full 1m cube? This determines whether or not to render the shared face of two -+ * adjacent blocks and also whether the player can attach torches, redstone wire, etc to this block. -+ */ - public boolean isOpaqueCube() { - return false; - } - -+ /** -+ * If this block doesn't render as an ordinary block it will return False (examples: signs, buttons, stairs, etc) -+ */ - public boolean renderAsNormalBlock() { - return false; - } - -+ /** -+ * Sets the block's bounds for rendering it as an item -+ */ - public void setBlockBoundsForItemRender() { - this.func_111047_d(0); - } - -- public void setBlockBoundsBasedOnState(IBlockAccess var1, int var2, int var3, int var4) { -- this.func_111047_d(var1.getBlockMetadata(var2, var3, var4)); -+ /** -+ * Updates the blocks bounds based on its current state. Args: world, x, y, z -+ */ -+ public void setBlockBoundsBasedOnState(IBlockAccess par1IBlockAccess, int par2, int par3, int par4) { -+ this.func_111047_d(par1IBlockAccess.getBlockMetadata(par2, par3, par4)); - } - -- protected void func_111047_d(int var1) { -+ protected void func_111047_d(int par1) { - byte var2 = 0; - float var3 = (float)(1 * (1 + var2)) / 16.0F; - this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, var3, 1.0F); - } - -- public boolean canPlaceBlockAt(World var1, int var2, int var3, int var4) { -- return super.canPlaceBlockAt(var1, var2, var3, var4) && this.canBlockStay(var1, var2, var3, var4); -- } -- -- public void onNeighborBlockChange(World var1, int var2, int var3, int var4, int var5) { -- this.func_111046_k(var1, var2, var3, var4); -- } -- -- private boolean func_111046_k(World var1, int var2, int var3, int var4) { -- if(!this.canBlockStay(var1, var2, var3, var4)) { -- this.dropBlockAsItem(var1, var2, var3, var4, var1.getBlockMetadata(var2, var3, var4), 0); -- var1.setBlockToAir(var2, var3, var4); -+ /** -+ * Checks to see if its valid to put this block at the specified coordinates. Args: world, x, y, z -+ */ -+ public boolean canPlaceBlockAt(World par1World, int par2, int par3, int par4) { -+ return super.canPlaceBlockAt(par1World, par2, par3, par4) && this.canBlockStay(par1World, par2, par3, par4); -+ } -+ -+ /** -+ * Lets the block know when one of its neighbor changes. Doesn't know which neighbor changed (coordinates passed are -+ * their own) Args: x, y, z, neighbor blockID -+ */ -+ public void onNeighborBlockChange(World par1World, int par2, int par3, int par4, int par5) { -+ this.func_111046_k(par1World, par2, par3, par4); -+ } -+ -+ private boolean func_111046_k(World par1World, int par2, int par3, int par4) { -+ if (!this.canBlockStay(par1World, par2, par3, par4)) { -+ this.dropBlockAsItem(par1World, par2, par3, par4, par1World.getBlockMetadata(par2, par3, par4), 0); -+ par1World.setBlockToAir(par2, par3, par4); - return false; - } else { - return true; - } - } - -- public boolean canBlockStay(World var1, int var2, int var3, int var4) { -- return !var1.isAirBlock(var2, var3 - 1, var4); -- } -- -- public boolean shouldSideBeRendered(IBlockAccess var1, int var2, int var3, int var4, int var5) { -- return var5 == 1 ? true : super.shouldSideBeRendered(var1, var2, var3, var4, var5); -- } -- -- public int damageDropped(int var1) { -- return var1; -- } -- -- public void getSubBlocks(int var1, CreativeTabs var2, List var3) { -- for(int var4 = 0; var4 < 16; ++var4) { -- var3.add(new ItemStack(var1, 1, var4)); -+ /** -+ * Can this block stay at this position. Similar to canPlaceBlockAt except gets checked often with plants. -+ */ -+ public boolean canBlockStay(World par1World, int par2, int par3, int par4) { -+ return !par1World.isAirBlock(par2, par3 - 1, par4); -+ } -+ -+ /** -+ * Returns true if the given side of this block type should be rendered, if the adjacent block is at the given -+ * coordinates. Args: blockAccess, x, y, z, side -+ */ -+ public boolean shouldSideBeRendered(IBlockAccess par1IBlockAccess, int par2, int par3, int par4, int par5) { -+ return par5 == 1 ? true : super.shouldSideBeRendered(par1IBlockAccess, par2, par3, par4, par5); -+ } -+ -+ /** -+ * Determines the damage on the item the block drops. Used in cloth and wood. -+ */ -+ public int damageDropped(int par1) { -+ return par1; -+ } -+ -+ /** -+ * returns a list of blocks with the same ID, but different meta (eg: wood returns 4 blocks) -+ */ -+ public void getSubBlocks(int par1, CreativeTabs par2CreativeTabs, List par3List) { -+ for (int var4 = 0; var4 < 16; ++var4) { -+ par3List.add(new ItemStack(par1, 1, var4)); - } -- -- } -- -- public void registerIcons(IconRegister var1) { -- } -+ } -+ -+ /** -+ * When this method is called, your block should register all the icons it needs with the given IconRegister. This is -+ * the only chance you get to register icons. -+ */ -+ public void registerIcons(IconRegister par1IconRegister) {} - } ---- net/minecraft/src/BossStatus.java -+++ net/minecraft/src/BossStatus.java -@@ -3,13 +3,13 @@ - public final class BossStatus { - public static float healthScale; - public static int statusBarLength; -- public static String c; -+ public static String bossName; - public static boolean field_82825_d; - -- public static void setBossStatus(IBossDisplayData var0, boolean var1) { -- healthScale = var0.getHealth() / var0.getMaxHealth(); -+ public static void setBossStatus(IBossDisplayData par0IBossDisplayData, boolean par1) { -+ healthScale = par0IBossDisplayData.getHealth() / par0IBossDisplayData.getMaxHealth(); - statusBarLength = 100; -- c = var0.getEntityName(); -- field_82825_d = var1; -+ bossName = par0IBossDisplayData.getEntityName(); -+ field_82825_d = par1; - } - } ---- net/minecraft/src/BlockHalfSlab.java -+++ net/minecraft/src/BlockHalfSlab.java -@@ -6,11 +6,12 @@ - public abstract class BlockHalfSlab extends Block { - protected final boolean isDoubleSlab; - -- public BlockHalfSlab(int var1, boolean var2, Material var3) { -- super(var1, var3); -- this.isDoubleSlab = var2; -- if(var2) { -- opaqueCubeLookup[var1] = true; -+ public BlockHalfSlab(int par1, boolean par2, Material par3Material) { -+ super(par1, par3Material); -+ this.isDoubleSlab = par2; -+ -+ if (par2) { -+ opaqueCubeLookup[par1] = true; - } else { - this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.5F, 1.0F); - } -@@ -18,79 +19,120 @@ - this.setLightOpacity(255); - } - -- public void setBlockBoundsBasedOnState(IBlockAccess var1, int var2, int var3, int var4) { -- if(this.isDoubleSlab) { -+ /** -+ * Updates the blocks bounds based on its current state. Args: world, x, y, z -+ */ -+ public void setBlockBoundsBasedOnState(IBlockAccess par1IBlockAccess, int par2, int par3, int par4) { -+ if (this.isDoubleSlab) { - this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F); - } else { -- boolean var5 = (var1.getBlockMetadata(var2, var3, var4) & 8) != 0; -- if(var5) { -+ boolean var5 = (par1IBlockAccess.getBlockMetadata(par2, par3, par4) & 8) != 0; -+ -+ if (var5) { - this.setBlockBounds(0.0F, 0.5F, 0.0F, 1.0F, 1.0F, 1.0F); - } else { - this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.5F, 1.0F); - } - } -- - } - -+ /** -+ * Sets the block's bounds for rendering it as an item -+ */ - public void setBlockBoundsForItemRender() { -- if(this.isDoubleSlab) { -+ if (this.isDoubleSlab) { - this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F); - } else { - this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.5F, 1.0F); - } -- -- } -- -- public void addCollisionBoxesToList(World var1, int var2, int var3, int var4, AxisAlignedBB var5, List var6, Entity var7) { -- this.setBlockBoundsBasedOnState(var1, var2, var3, var4); -- super.addCollisionBoxesToList(var1, var2, var3, var4, var5, var6, var7); -- } -- -+ } -+ -+ /** -+ * Adds all intersecting collision boxes to a list. (Be sure to only add boxes to the list if they intersect the mask.) -+ * Parameters: World, X, Y, Z, mask, list, colliding entity -+ */ -+ public void addCollisionBoxesToList(World par1World, int par2, int par3, int par4, AxisAlignedBB par5AxisAlignedBB, List par6List, Entity par7Entity) { -+ this.setBlockBoundsBasedOnState(par1World, par2, par3, par4); -+ super.addCollisionBoxesToList(par1World, par2, par3, par4, par5AxisAlignedBB, par6List, par7Entity); -+ } -+ -+ /** -+ * Is this block (a) opaque and (b) a full 1m cube? This determines whether or not to render the shared face of two -+ * adjacent blocks and also whether the player can attach torches, redstone wire, etc to this block. -+ */ - public boolean isOpaqueCube() { - return this.isDoubleSlab; - } - -- public int onBlockPlaced(World var1, int var2, int var3, int var4, int var5, float var6, float var7, float var8, int var9) { -- return this.isDoubleSlab ? var9 : (var5 != 0 && (var5 == 1 || (double)var7 <= 0.5D) ? var9 : var9 | 8); -+ /** -+ * Called when a block is placed using its ItemBlock. Args: World, X, Y, Z, side, hitX, hitY, hitZ, block metadata -+ */ -+ public int onBlockPlaced(World par1World, int par2, int par3, int par4, int par5, float par6, float par7, float par8, int par9) { -+ return this.isDoubleSlab ? par9 : (par5 != 0 && (par5 == 1 || (double)par7 <= 0.5D) ? par9 : par9 | 8); - } - -- public int quantityDropped(Random var1) { -+ /** -+ * Returns the quantity of items to drop on block destruction. -+ */ -+ public int quantityDropped(Random par1Random) { - return this.isDoubleSlab ? 2 : 1; - } - -- public int damageDropped(int var1) { -- return var1 & 7; -+ /** -+ * Determines the damage on the item the block drops. Used in cloth and wood. -+ */ -+ public int damageDropped(int par1) { -+ return par1 & 7; - } - -+ /** -+ * If this block doesn't render as an ordinary block it will return False (examples: signs, buttons, stairs, etc) -+ */ - public boolean renderAsNormalBlock() { - return this.isDoubleSlab; - } - -- public boolean shouldSideBeRendered(IBlockAccess var1, int var2, int var3, int var4, int var5) { -- if(this.isDoubleSlab) { -- return super.shouldSideBeRendered(var1, var2, var3, var4, var5); -- } else if(var5 != 1 && var5 != 0 && !super.shouldSideBeRendered(var1, var2, var3, var4, var5)) { -+ /** -+ * Returns true if the given side of this block type should be rendered, if the adjacent block is at the given -+ * coordinates. Args: blockAccess, x, y, z, side -+ */ -+ public boolean shouldSideBeRendered(IBlockAccess par1IBlockAccess, int par2, int par3, int par4, int par5) { -+ if (this.isDoubleSlab) { -+ return super.shouldSideBeRendered(par1IBlockAccess, par2, par3, par4, par5); -+ } else if (par5 != 1 && par5 != 0 && !super.shouldSideBeRendered(par1IBlockAccess, par2, par3, par4, par5)) { - return false; - } else { -- int var6 = var2 + Facing.offsetsXForSide[Facing.oppositeSide[var5]]; -- int var7 = var3 + Facing.offsetsYForSide[Facing.oppositeSide[var5]]; -- int var8 = var4 + Facing.offsetsZForSide[Facing.oppositeSide[var5]]; -- boolean var9 = (var1.getBlockMetadata(var6, var7, var8) & 8) != 0; -- return var9 ? (var5 == 0 ? true : (var5 == 1 && super.shouldSideBeRendered(var1, var2, var3, var4, var5) ? true : !isBlockSingleSlab(var1.getBlockId(var2, var3, var4)) || (var1.getBlockMetadata(var2, var3, var4) & 8) == 0)) : (var5 == 1 ? true : (var5 == 0 && super.shouldSideBeRendered(var1, var2, var3, var4, var5) ? true : !isBlockSingleSlab(var1.getBlockId(var2, var3, var4)) || (var1.getBlockMetadata(var2, var3, var4) & 8) != 0)); -+ int var6 = par2 + Facing.offsetsXForSide[Facing.oppositeSide[par5]]; -+ int var7 = par3 + Facing.offsetsYForSide[Facing.oppositeSide[par5]]; -+ int var8 = par4 + Facing.offsetsZForSide[Facing.oppositeSide[par5]]; -+ boolean var9 = (par1IBlockAccess.getBlockMetadata(var6, var7, var8) & 8) != 0; -+ return var9 ? (par5 == 0 ? true : (par5 == 1 && super.shouldSideBeRendered(par1IBlockAccess, par2, par3, par4, par5) ? true : !isBlockSingleSlab(par1IBlockAccess.getBlockId(par2, par3, par4)) || (par1IBlockAccess.getBlockMetadata(par2, par3, par4) & 8) == 0)) : (par5 == 1 ? true : (par5 == 0 && super.shouldSideBeRendered(par1IBlockAccess, par2, par3, par4, par5) ? true : !isBlockSingleSlab(par1IBlockAccess.getBlockId(par2, par3, par4)) || (par1IBlockAccess.getBlockMetadata(par2, par3, par4) & 8) != 0)); - } - } - -- private static boolean isBlockSingleSlab(int var0) { -- return var0 == Block.stoneSingleSlab.blockID || var0 == Block.woodSingleSlab.blockID; -+ /** -+ * Takes a block ID, returns true if it's the same as the ID for a stone or wooden single slab. -+ */ -+ private static boolean isBlockSingleSlab(int par0) { -+ return par0 == Block.stoneSingleSlab.blockID || par0 == Block.woodSingleSlab.blockID; - } - -+ /** -+ * Returns the slab block name with step type. -+ */ - public abstract String getFullSlabName(int var1); - -- public int getDamageValue(World var1, int var2, int var3, int var4) { -- return super.getDamageValue(var1, var2, var3, var4) & 7; -+ /** -+ * Get the block's damage value (for use with pick block). -+ */ -+ public int getDamageValue(World par1World, int par2, int par3, int par4) { -+ return super.getDamageValue(par1World, par2, par3, par4) & 7; - } - -- public int idPicked(World var1, int var2, int var3, int var4) { -+ /** -+ * only called by clickMiddleMouseButton , and passed to inventory.setCurrentItem (along with isCreative) -+ */ -+ public int idPicked(World par1World, int par2, int par3, int par4) { - return isBlockSingleSlab(this.blockID) ? this.blockID : (this.blockID == Block.stoneDoubleSlab.blockID ? Block.stoneSingleSlab.blockID : (this.blockID == Block.woodDoubleSlab.blockID ? Block.woodSingleSlab.blockID : Block.stoneSingleSlab.blockID)); - } - } ---- /dev/null -+++ org/spoutcraft/client/gui/database/AbstractAPIModel.java -@@ -1,0 +1,239 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.client.gui.database; -+ -+import java.io.BufferedReader; -+import java.io.IOException; -+import java.io.InputStreamReader; -+import java.net.URL; -+import java.net.URLConnection; -+import java.util.ArrayList; -+import java.util.HashMap; -+import java.util.LinkedList; -+import java.util.List; -+ -+import org.yaml.snakeyaml.Yaml; -+ -+import org.bukkit.ChatColor; -+ -+import org.spoutcraft.api.gui.AbstractListModel; -+import org.spoutcraft.api.gui.GenericListWidgetItem; -+import org.spoutcraft.api.gui.ListWidgetItem; -+import org.spoutcraft.client.SpoutClient; -+import org.spoutcraft.client.gui.database.UrlElement; -+ -+public abstract class AbstractAPIModel extends AbstractListModel { -+ protected List urlElements = new LinkedList(); -+ protected String API = ""; -+ protected boolean loading = false; -+ protected Thread currentLoader = null; -+ protected int lastPage = 1; -+ protected String currentUrl = ""; -+ protected boolean moreItems = false; -+ protected GenericListWidgetItem itemLoadNextItems = null; -+ protected ArrayList apiData = null; -+ protected GuiAPIDisplay currentGui = null; -+ protected List effectiveCache = null; -+ protected List entries = new ArrayList(); -+ -+ public void loadNextPage() { -+ lastPage++; -+ refreshAPIData(getCurrentUrl(), lastPage, false); -+ } -+ -+ protected List getEffectiveList() { -+ List ret = new ArrayList(); -+ -+ for (ListWidgetItem item:entries) { -+ ret.add(item); -+ } -+ -+ if (moreItems) { -+ itemLoadNextItems = new GenericListWidgetItem("More items on the server.", "Click to load", ""); -+ ret.add(itemLoadNextItems); -+ } -+ return ret; -+ } -+ -+ @Override -+ public ListWidgetItem getItem(int row) { -+ if (effectiveCache == null) { -+ effectiveCache = getEffectiveList(); -+ sizeChanged(); -+ } -+ if (row < 0 || row >= effectiveCache.size()) { -+ return null; -+ } -+ return effectiveCache.get(row); -+ } -+ -+ @Override -+ public int getSize() { -+ if (effectiveCache == null) { -+ effectiveCache = getEffectiveList(); -+ sizeChanged(); -+ } -+ return effectiveCache.size(); -+ } -+ -+ public void refreshAPIData(final String url, final int page, final boolean clear) { -+ currentUrl = url; -+ if (currentLoader != null && currentLoader.isAlive()) { -+ currentLoader.interrupt(); -+ System.out.println("Stopped previous loading"); -+ } -+ -+ currentLoader = new Thread() { -+ @SuppressWarnings("unchecked") -+ @Override -+ public void run() { -+ BufferedReader reader = null; -+ try { -+ System.setProperty("http.agent", ""); -+ setLoading(true); -+ //long start = System.currentTimeMillis(); -+ URL url1 = new URL(url + "&page=" + page); -+ //System.out.println("Loading " + url1.toString()); -+ URLConnection conn = url1.openConnection(); -+ conn.setRequestProperty("User-Agent", "Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.4; en-US; rv:1.9.2.2) Gecko/20100316 Firefox/3.6.2"); -+ -+ reader = new BufferedReader(new InputStreamReader(conn.getInputStream())); -+ -+ Yaml yaml = new Yaml(); -+ ArrayList yamlObj = (ArrayList) yaml.load(reader); -+ //System.out.println("Loaded in " + (System.currentTimeMillis() - start) + " ms"); -+ apiData = yamlObj; -+ HashMap hash = (HashMap) apiData.remove(0); -+ int after = Integer.valueOf((String) hash.get("after")); -+ moreItems = after > 0; -+ -+ refreshList(clear); -+ -+ } catch (IOException e1) { -+ e1.printStackTrace(); -+ // Put a fancy error message on the list! -+ clear(); -+ effectiveCache = new LinkedList(); -+ //String error = e1.getClass().getSimpleName().replaceAll("Exception", ""); -+ //error = error.replaceAll("([A-Z])", " $1").trim(); -+ effectiveCache.add(new GenericListWidgetItem(ChatColor.RED + "Could not load items!", e1.getMessage(), "")); -+ return; -+ } catch (Exception e) { -+ } -+ finally { -+ setLoading(false); -+ try { -+ reader.close(); -+ } catch (Exception e) { -+ } -+ } -+ } -+ }; -+ currentLoader.start(); -+ } -+ -+ public void clear() { -+ entries.clear(); -+ if (effectiveCache != null) { -+ effectiveCache.clear(); -+ } -+ moreItems = false; -+ } -+ -+ protected abstract void refreshList(boolean clear); -+ -+ public boolean isLoading() { -+ return loading; -+ } -+ -+ public void setLoading(boolean l) { -+ loading = l; -+ if (currentGui != null) { -+ currentGui.updateButtons(); -+ } -+ } -+ -+ public void clearElementFilters() { -+ for (UrlElement element: urlElements) { -+ element.clear(); -+ } -+ } -+ -+ public void addUrlElement(UrlElement el) { -+ urlElements.add(el); -+ } -+ -+ public void clearUrlElements() { -+ urlElements.clear(); -+ } -+ -+ public GuiAPIDisplay getCurrentGui() { -+ return currentGui; -+ } -+ -+ public void updateUrl() { -+ String url = API + "?"; -+ int i = 0; -+ for (UrlElement element:urlElements) { -+ if (element.isActive()) { -+ if (i > 0) { -+ url+="&"; -+ } -+ url += element.getUrlPart(); -+ i++; // Only increment for active elements -+ } -+ } -+ if (i != 0) { -+ refreshAPIData(url, 0, true); -+ } -+ } -+ -+ public void update() { -+ effectiveCache = null; -+ } -+ -+ public void setCurrentGui(GuiAPIDisplay gui) { -+ currentGui = gui; -+ } -+ -+ public abstract String getDefaultUrl(); -+ -+ public String getCurrentUrl() { -+ return currentUrl; -+ } -+ -+ public ArrayList getAPIData() { -+ synchronized (apiData) { -+ return apiData; -+ } -+ } -+ -+ @Override -+ public void onSelected(int item, boolean doubleClick) { -+ if (currentGui != null) { -+ currentGui.updateButtons(); -+ } -+ if (effectiveCache.get(item) == itemLoadNextItems) { -+ loadNextPage(); -+ itemLoadNextItems.setTitle("Loading ..."); -+ itemLoadNextItems.setText("Please wait ..."); -+ } -+ } -+} ---- net/minecraft/src/ChunkProviderClient.java -+++ net/minecraft/src/ChunkProviderClient.java -@@ -1,79 +1,154 @@ - package net.minecraft.src; - --import java.util.ArrayList; - import java.util.List; - -+import gnu.trove.map.hash.TLongObjectHashMap; -+ -+// Spout -+// Spout End -+ - public class ChunkProviderClient implements IChunkProvider { -+ -+ /** -+ * The completely empty chunk used by ChunkProviderClient when chunkMapping doesn't contain the requested coordinates. -+ */ - private Chunk blankChunk; -- private LongHashMap chunkMapping = new LongHashMap(); -- private List c = new ArrayList(); -+ -+ /** -+ * The mapping between ChunkCoordinates and Chunks that ChunkProviderClient maintains. -+ */ -+ // Spout Start -+ private TLongObjectHashMap chunkMapping = new TLongObjectHashMap(1000); -+ // Spout End -+ /** -+ * This may have been intended to be an iterable version of all currently loaded chunks (MultiplayerChunkCache), with -+ * identical contents to chunkMapping's values. However it is never actually added to. -+ */ -+ // Spout Start - Unused -+ //private List chunkListing = new ArrayList(); -+ // Spout End -+ -+ /** Reference to the World object. */ - private World worldObj; - -- public ChunkProviderClient(World var1) { -- this.blankChunk = new EmptyChunk(var1, 0, 0); -- this.worldObj = var1; -+ public ChunkProviderClient(World par1World) { -+ this.blankChunk = new EmptyChunk(par1World, 0, 0); -+ this.worldObj = par1World; -+ // Spout Start -+ chunkMapping.setAutoCompactionFactor(0.0F); -+ // Spout End - } - -+ /** -+ * Checks to see if a chunk exists at x, y -+ */ -+ // Spout Start - public boolean chunkExists(int var1, int var2) { -- return true; -+ return this != null ? true : this.chunkMapping.containsKey(ChunkCoordIntPair.chunkXZ2Int(var1, var2)); -+ // Spout End - } - -- public void unloadChunk(int var1, int var2) { -- Chunk var3 = this.provideChunk(var1, var2); -- if(!var3.isEmpty()) { -+ /** -+ * Unload chunk from ChunkProviderClient's hashmap. Called in response to a Packet50PreChunk with its mode field set to -+ * false -+ */ -+ public void unloadChunk(int par1, int par2) { -+ Chunk var3 = this.provideChunk(par1, par2); -+ -+ if (!var3.isEmpty()) { - var3.onChunkUnload(); - } - -- this.chunkMapping.remove(ChunkCoordIntPair.chunkXZ2Int(var1, var2)); -- this.c.remove(var3); -+ this.chunkMapping.remove(ChunkCoordIntPair.chunkXZ2Int(par1, par2)); -+ // Spout Start - Unused -+ //this.chunkListing.remove(var3); -+ // Spout End - } - -- public Chunk loadChunk(int var1, int var2) { -- Chunk var3 = new Chunk(this.worldObj, var1, var2); -- this.chunkMapping.add(ChunkCoordIntPair.chunkXZ2Int(var1, var2), var3); -+ /** -+ * loads or generates the chunk at the chunk location specified -+ */ -+ public Chunk loadChunk(int par1, int par2) { -+ Chunk var3 = new Chunk(this.worldObj, par1, par2); -+ // Spout Start -+ this.chunkMapping.put(ChunkCoordIntPair.chunkXZ2Int(par1, par2), var3); -+ // Spout End - var3.isChunkLoaded = true; - return var3; - } - -+ /** -+ * Will return back a chunk, if it doesn't exist and its not a MP client it will generates all the blocks for the -+ * specified chunk from the map seed and chunk seed -+ */ -+ // Spout Start - public - public Chunk provideChunk(int var1, int var2) { -- Chunk var3 = (Chunk)this.chunkMapping.getValueByKey(ChunkCoordIntPair.chunkXZ2Int(var1, var2)); -+ Chunk var3 = (Chunk)this.chunkMapping.get(ChunkCoordIntPair.chunkXZ2Int(var1, var2)); -+ // Spout End - return var3 == null ? this.blankChunk : var3; - } - -- public boolean saveChunks(boolean var1, IProgressUpdate var2) { -+ /** -+ * Two modes of operation: if passed true, save all Chunks in one go. If passed false, save up to two chunks. Return -+ * true if all chunks have been saved. -+ */ -+ public boolean saveChunks(boolean par1, IProgressUpdate par2IProgressUpdate) { - return true; - } -- -- public void saveExtraData() { -- } -- -+ -+ /** -+ * Save extra data not associated with any Chunk. Not saved during autosave, only during world unload. Currently -+ * unimplemented. -+ */ -+ public void saveExtraData() {} -+ -+ /** -+ * Unloads chunks that are marked to be unloaded. This is not guaranteed to unload every such chunk. -+ */ - public boolean unloadQueuedChunks() { - return false; - } - -+ /** -+ * Returns if the IChunkProvider supports saving. -+ */ - public boolean canSave() { - return false; - } - -- public void populate(IChunkProvider var1, int var2, int var3) { -- } -+ /** -+ * Populates chunk with ores etc etc -+ */ -+ public void populate(IChunkProvider par1IChunkProvider, int par2, int par3) {} - -+ /** -+ * Converts the instance data to a readable string. -+ */ - public String makeString() { -- return "MultiplayerChunkCache: " + this.chunkMapping.getNumHashElements(); -+ // Spout Start -+ return "MultiplayerChunkCache: " + this.chunkMapping.size(); -+ // Spout End - } - -- public List getPossibleCreatures(EnumCreatureType var1, int var2, int var3, int var4) { -+ /** -+ * Returns a list of creatures of the specified type that can spawn at the given location. -+ */ -+ public List getPossibleCreatures(EnumCreatureType par1EnumCreatureType, int par2, int par3, int par4) { - return null; - } - -- public ChunkPosition findClosestStructure(World var1, String var2, int var3, int var4, int var5) { -+ /** -+ * Returns the location of the closest structure of the specified type. If not found returns null. -+ */ -+ public ChunkPosition findClosestStructure(World par1World, String par2Str, int par3, int par4, int par5) { - return null; - } - - public int getLoadedChunkCount() { -- return this.c.size(); -+ // Spout Start - Was this.chunkListing.size(); -+ return chunkMapping.size(); -+ // Spout End - } - -- public void recreateStructures(int var1, int var2) { -- } -+ public void recreateStructures(int par1, int par2) {} - } ---- net/minecraft/src/DispenserBehaviorFire.java -+++ net/minecraft/src/DispenserBehaviorFire.java -@@ -3,33 +3,40 @@ - final class DispenserBehaviorFire extends BehaviorDefaultDispenseItem { - private boolean field_96466_b = true; - -- protected ItemStack dispenseStack(IBlockSource var1, ItemStack var2) { -- EnumFacing var3 = BlockDispenser.getFacing(var1.getBlockMetadata()); -- World var4 = var1.getWorld(); -- int var5 = var1.getXInt() + var3.getFrontOffsetX(); -- int var6 = var1.getYInt() + var3.getFrontOffsetY(); -- int var7 = var1.getZInt() + var3.getFrontOffsetZ(); -- if(var4.isAirBlock(var5, var6, var7)) { -+ /** -+ * Dispense the specified stack, play the dispense sound and spawn particles. -+ */ -+ protected ItemStack dispenseStack(IBlockSource par1IBlockSource, ItemStack par2ItemStack) { -+ EnumFacing var3 = BlockDispenser.getFacing(par1IBlockSource.getBlockMetadata()); -+ World var4 = par1IBlockSource.getWorld(); -+ int var5 = par1IBlockSource.getXInt() + var3.getFrontOffsetX(); -+ int var6 = par1IBlockSource.getYInt() + var3.getFrontOffsetY(); -+ int var7 = par1IBlockSource.getZInt() + var3.getFrontOffsetZ(); -+ -+ if (var4.isAirBlock(var5, var6, var7)) { - var4.setBlock(var5, var6, var7, Block.fire.blockID); -- if(var2.attemptDamageItem(1, var4.s)) { -- var2.stackSize = 0; -+ -+ if (par2ItemStack.attemptDamageItem(1, var4.rand)) { -+ par2ItemStack.stackSize = 0; - } -- } else if(var4.getBlockId(var5, var6, var7) == Block.tnt.blockID) { -+ } else if (var4.getBlockId(var5, var6, var7) == Block.tnt.blockID) { - Block.tnt.onBlockDestroyedByPlayer(var4, var5, var6, var7, 1); - var4.setBlockToAir(var5, var6, var7); - } else { - this.field_96466_b = false; - } - -- return var2; -+ return par2ItemStack; - } - -- protected void playDispenseSound(IBlockSource var1) { -- if(this.field_96466_b) { -- var1.getWorld().playAuxSFX(1000, var1.getXInt(), var1.getYInt(), var1.getZInt(), 0); -+ /** -+ * Play the dispense sound from the specified block. -+ */ -+ protected void playDispenseSound(IBlockSource par1IBlockSource) { -+ if (this.field_96466_b) { -+ par1IBlockSource.getWorld().playAuxSFX(1000, par1IBlockSource.getXInt(), par1IBlockSource.getYInt(), par1IBlockSource.getZInt(), 0); - } else { -- var1.getWorld().playAuxSFX(1001, var1.getXInt(), var1.getYInt(), var1.getZInt(), 0); -+ par1IBlockSource.getWorld().playAuxSFX(1001, par1IBlockSource.getXInt(), par1IBlockSource.getYInt(), par1IBlockSource.getZInt(), 0); - } -- - } - } ---- net/minecraft/src/EntityAIFleeSun.java -+++ net/minecraft/src/EntityAIFleeSun.java -@@ -10,23 +10,27 @@ - private double movementSpeed; - private World theWorld; - -- public EntityAIFleeSun(EntityCreature var1, double var2) { -- this.theCreature = var1; -- this.movementSpeed = var2; -- this.theWorld = var1.worldObj; -+ public EntityAIFleeSun(EntityCreature par1EntityCreature, double par2) { -+ this.theCreature = par1EntityCreature; -+ this.movementSpeed = par2; -+ this.theWorld = par1EntityCreature.worldObj; - this.setMutexBits(1); - } - -+ /** -+ * Returns whether the EntityAIBase should begin execution. -+ */ - public boolean shouldExecute() { -- if(!this.theWorld.isDaytime()) { -- return false; -- } else if(!this.theCreature.isBurning()) { -- return false; -- } else if(!this.theWorld.canBlockSeeTheSky(MathHelper.floor_double(this.theCreature.posX), (int)this.theCreature.boundingBox.minY, MathHelper.floor_double(this.theCreature.posZ))) { -+ if (!this.theWorld.isDaytime()) { -+ return false; -+ } else if (!this.theCreature.isBurning()) { -+ return false; -+ } else if (!this.theWorld.canBlockSeeTheSky(MathHelper.floor_double(this.theCreature.posX), (int)this.theCreature.boundingBox.minY, MathHelper.floor_double(this.theCreature.posZ))) { - return false; - } else { - Vec3 var1 = this.findPossibleShelter(); -- if(var1 == null) { -+ -+ if (var1 == null) { - return false; - } else { - this.shelterX = var1.xCoord; -@@ -37,10 +41,16 @@ - } - } - -+ /** -+ * Returns whether an in-progress EntityAIBase should continue executing -+ */ - public boolean continueExecuting() { - return !this.theCreature.getNavigator().noPath(); - } - -+ /** -+ * Execute a one shot task or start executing a continuous task -+ */ - public void startExecuting() { - this.theCreature.getNavigator().tryMoveToXYZ(this.shelterX, this.shelterY, this.shelterZ, this.movementSpeed); - } -@@ -48,11 +58,12 @@ - private Vec3 findPossibleShelter() { - Random var1 = this.theCreature.getRNG(); - -- for(int var2 = 0; var2 < 10; ++var2) { -+ for (int var2 = 0; var2 < 10; ++var2) { - int var3 = MathHelper.floor_double(this.theCreature.posX + (double)var1.nextInt(20) - 10.0D); - int var4 = MathHelper.floor_double(this.theCreature.boundingBox.minY + (double)var1.nextInt(6) - 3.0D); - int var5 = MathHelper.floor_double(this.theCreature.posZ + (double)var1.nextInt(20) - 10.0D); -- if(!this.theWorld.canBlockSeeTheSky(var3, var4, var5) && this.theCreature.getBlockPathWeight(var3, var4, var5) < 0.0F) { -+ -+ if (!this.theWorld.canBlockSeeTheSky(var3, var4, var5) && this.theCreature.getBlockPathWeight(var3, var4, var5) < 0.0F) { - return this.theWorld.getWorldVec3Pool().getVecFromPool((double)var3, (double)var4, (double)var5); - } - } ---- /dev/null -+++ org/spoutcraft/client/util/PersistentMap.java -@@ -1,0 +1,118 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.client.util; -+ -+import java.io.File; -+import java.io.IOException; -+import java.util.HashMap; -+import java.util.concurrent.ConcurrentLinkedQueue; -+ -+import org.spoutcraft.client.io.FileMap; -+ -+public class PersistentMap { -+ private final FileMap f; -+ private final CacheMap cache = new CacheMap(); -+ private final HashMap overwriteBackup = new HashMap(); -+ private final ConcurrentLinkedQueue overwriteQueue = new ConcurrentLinkedQueue(); -+ private final long size; -+ -+ public PersistentMap(File dir, String filename, long size, int entries) throws IOException { -+ f = new FileMap(dir, filename, size, entries); -+ this.size = size; -+ } -+ -+ public byte[] get(Long key, byte[] data) throws IOException { -+ byte[] value = cache.get(key); -+ if (value != null) { -+ return value; -+ } -+ value = overwriteBackup.get(key); -+ if (value != null) { -+ return value; -+ } -+ value = f.readByHash(key, data); -+ -+ return value; -+ } -+ -+ public void wipeFile() throws IOException { -+ f.wipe(); -+ } -+ -+ public void reset() { -+ overwriteQueue.clear(); -+ overwriteBackup.clear(); -+ } -+ -+ public Integer getIndex(long key) { -+ return f.hashToIndex(key); -+ } -+ -+ public Long getHash(int index) { -+ return f.indexToHash(index); -+ } -+ -+ public void put(Long key, byte[] data) throws IOException { -+ Integer index = f.hashToIndex(key); -+ if (index != null) { -+ return; -+ } -+ index = f.getIndex(); -+ f.incrementIndex(); -+ Long oldHash = f.indexToHash(index); -+ byte[] oldData = new byte[(int)size]; -+ oldData = f.readByIndex(index, oldData); -+ if (oldData != null) { -+ overwriteBackup.put(oldHash, oldData); -+ overwriteQueue.add(oldHash); -+ } -+ f.write(index, key, data); -+ -+ if (!cache.contains(key)) { -+ byte[] dataCopy = new byte[data.length]; -+ System.arraycopy(data, 0, dataCopy, 0, data.length); -+ cache.put(key, dataCopy); -+ } -+ } -+ -+ public Long getOverwritten() { -+ return overwriteQueue.poll(); -+ } -+ -+ public byte[] removeOverwriteBackup(Long key) { -+ cache.remove(key); -+ return overwriteBackup.remove(key); -+ } -+ -+ public boolean corruptionTest(long hash) { -+ Integer index = f.hashToIndex(hash); -+ try { -+ if (index != null) { -+ f.corruptIndex(index); -+ return true; -+ } else { -+ System.out.println(hash + " doesn't exist, cannot corrupt"); -+ return false; -+ } -+ } catch (IOException e) { -+ return false; -+ } -+ } -+} ---- net/minecraft/src/CommandServerTp.java -+++ net/minecraft/src/CommandServerTp.java -@@ -8,62 +8,73 @@ - return "tp"; - } - -+ /** -+ * Return the required permission level for this command. -+ */ - public int getRequiredPermissionLevel() { - return 2; - } - -- public String getCommandUsage(ICommandSender var1) { -+ public String getCommandUsage(ICommandSender par1ICommandSender) { - return "commands.tp.usage"; - } - -- public void processCommand(ICommandSender var1, String[] var2) { -- if(var2.length < 1) { -+ public void processCommand(ICommandSender par1ICommandSender, String[] par2ArrayOfStr) { -+ if (par2ArrayOfStr.length < 1) { - throw new WrongUsageException("commands.tp.usage", new Object[0]); - } else { - EntityPlayerMP var3; -- if(var2.length != 2 && var2.length != 4) { -- var3 = getCommandSenderAsPlayer(var1); -+ -+ if (par2ArrayOfStr.length != 2 && par2ArrayOfStr.length != 4) { -+ var3 = getCommandSenderAsPlayer(par1ICommandSender); - } else { -- var3 = getPlayer(var1, var2[0]); -- if(var3 == null) { -+ var3 = getPlayer(par1ICommandSender, par2ArrayOfStr[0]); -+ -+ if (var3 == null) { - throw new PlayerNotFoundException(); - } - } - -- if(var2.length != 3 && var2.length != 4) { -- if(var2.length == 1 || var2.length == 2) { -- EntityPlayerMP var11 = getPlayer(var1, var2[var2.length - 1]); -- if(var11 == null) { -+ if (par2ArrayOfStr.length != 3 && par2ArrayOfStr.length != 4) { -+ if (par2ArrayOfStr.length == 1 || par2ArrayOfStr.length == 2) { -+ EntityPlayerMP var11 = getPlayer(par1ICommandSender, par2ArrayOfStr[par2ArrayOfStr.length - 1]); -+ -+ if (var11 == null) { - throw new PlayerNotFoundException(); - } - -- if(var11.worldObj != var3.worldObj) { -- notifyAdmins(var1, "commands.tp.notSameDimension", new Object[0]); -+ if (var11.worldObj != var3.worldObj) { -+ notifyAdmins(par1ICommandSender, "commands.tp.notSameDimension", new Object[0]); - return; - } - - var3.mountEntity((Entity)null); - var3.playerNetServerHandler.setPlayerLocation(var11.posX, var11.posY, var11.posZ, var11.rotationYaw, var11.rotationPitch); -- notifyAdmins(var1, "commands.tp.success", new Object[]{var3.getEntityName(), var11.getEntityName()}); -+ notifyAdmins(par1ICommandSender, "commands.tp.success", new Object[] {var3.getEntityName(), var11.getEntityName()}); - } -- } else if(var3.worldObj != null) { -- int var4 = var2.length - 3; -- double var5 = func_110666_a(var1, var3.posX, var2[var4++]); -- double var7 = func_110665_a(var1, var3.posY, var2[var4++], 0, 0); -- double var9 = func_110666_a(var1, var3.posZ, var2[var4++]); -+ } else if (var3.worldObj != null) { -+ int var4 = par2ArrayOfStr.length - 3; -+ double var5 = func_110666_a(par1ICommandSender, var3.posX, par2ArrayOfStr[var4++]); -+ double var7 = func_110665_a(par1ICommandSender, var3.posY, par2ArrayOfStr[var4++], 0, 0); -+ double var9 = func_110666_a(par1ICommandSender, var3.posZ, par2ArrayOfStr[var4++]); - var3.mountEntity((Entity)null); - var3.setPositionAndUpdate(var5, var7, var9); -- notifyAdmins(var1, "commands.tp.success.coordinates", new Object[]{var3.getEntityName(), Double.valueOf(var5), Double.valueOf(var7), Double.valueOf(var9)}); -+ notifyAdmins(par1ICommandSender, "commands.tp.success.coordinates", new Object[] {var3.getEntityName(), Double.valueOf(var5), Double.valueOf(var7), Double.valueOf(var9)}); - } -- - } - } - -- public List addTabCompletionOptions(ICommandSender var1, String[] var2) { -- return var2.length != 1 && var2.length != 2 ? null : getListOfStringsMatchingLastWord(var2, MinecraftServer.getServer().getAllUsernames()); -+ /** -+ * Adds the strings available in this command to the given list of tab completion options. -+ */ -+ public List addTabCompletionOptions(ICommandSender par1ICommandSender, String[] par2ArrayOfStr) { -+ return par2ArrayOfStr.length != 1 && par2ArrayOfStr.length != 2 ? null : getListOfStringsMatchingLastWord(par2ArrayOfStr, MinecraftServer.getServer().getAllUsernames()); - } - -- public boolean isUsernameIndex(String[] var1, int var2) { -- return var2 == 0; -+ /** -+ * Return whether the specified command parameter index is a username parameter. -+ */ -+ public boolean isUsernameIndex(String[] par1ArrayOfStr, int par2) { -+ return par2 == 0; - } - } ---- /dev/null -+++ org/spoutcraft/api/property/PropertyObject.java -@@ -1,0 +1,47 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.api.property; -+ -+import java.util.HashMap; -+ -+public class PropertyObject implements PropertyInterface { -+ private HashMap properties = new HashMap(); -+ -+ protected void addProperty(String name, Property delegate) { -+ properties.put(name, delegate); -+ } -+ -+ public Object getProperty(String name) { -+ if (properties.containsKey(name)) { -+ return properties.get(name).get(); -+ } -+ return null; -+ } -+ -+ public void setProperty(String name, Object value) { -+ if (properties.containsKey(name)) { -+ properties.get(name).set(value); -+ } -+ } -+ -+ public Property getPropertyDelegate(String name) { -+ return properties.get(name); -+ } -+} ---- net/minecraft/src/DispenserBehaviorTNT.java -+++ net/minecraft/src/DispenserBehaviorTNT.java -@@ -1,15 +1,19 @@ - package net.minecraft.src; - - final class DispenserBehaviorTNT extends BehaviorDefaultDispenseItem { -- protected ItemStack dispenseStack(IBlockSource var1, ItemStack var2) { -- EnumFacing var3 = BlockDispenser.getFacing(var1.getBlockMetadata()); -- World var4 = var1.getWorld(); -- int var5 = var1.getXInt() + var3.getFrontOffsetX(); -- int var6 = var1.getYInt() + var3.getFrontOffsetY(); -- int var7 = var1.getZInt() + var3.getFrontOffsetZ(); -+ -+ /** -+ * Dispense the specified stack, play the dispense sound and spawn particles. -+ */ -+ protected ItemStack dispenseStack(IBlockSource par1IBlockSource, ItemStack par2ItemStack) { -+ EnumFacing var3 = BlockDispenser.getFacing(par1IBlockSource.getBlockMetadata()); -+ World var4 = par1IBlockSource.getWorld(); -+ int var5 = par1IBlockSource.getXInt() + var3.getFrontOffsetX(); -+ int var6 = par1IBlockSource.getYInt() + var3.getFrontOffsetY(); -+ int var7 = par1IBlockSource.getZInt() + var3.getFrontOffsetZ(); - EntityTNTPrimed var8 = new EntityTNTPrimed(var4, (double)((float)var5 + 0.5F), (double)((float)var6 + 0.5F), (double)((float)var7 + 0.5F), (EntityLivingBase)null); - var4.spawnEntityInWorld(var8); -- --var2.stackSize; -- return var2; -+ --par2ItemStack.stackSize; -+ return par2ItemStack; - } - } ---- net/minecraft/src/GuiCreateFlatWorld.java -+++ net/minecraft/src/GuiCreateFlatWorld.java -@@ -4,54 +4,61 @@ - private static RenderItem theRenderItem = new RenderItem(); - private final GuiCreateWorld createWorldGui; - private FlatGeneratorInfo theFlatGeneratorInfo = FlatGeneratorInfo.getDefaultFlatGenerator(); -- private String d; -- private String e; -- private String p; -+ private String customizationTitle; -+ private String layerMaterialLabel; -+ private String heightLabel; - private GuiCreateFlatWorldListSlot createFlatWorldListSlotGui; - private GuiButton buttonAddLayer; - private GuiButton buttonEditLayer; - private GuiButton buttonRemoveLayer; - -- public GuiCreateFlatWorld(GuiCreateWorld var1, String var2) { -- this.createWorldGui = var1; -- this.setFlatGeneratorInfo(var2); -+ public GuiCreateFlatWorld(GuiCreateWorld par1GuiCreateWorld, String par2Str) { -+ this.createWorldGui = par1GuiCreateWorld; -+ this.setFlatGeneratorInfo(par2Str); - } - - public String getFlatGeneratorInfo() { - return this.theFlatGeneratorInfo.toString(); - } - -- public void setFlatGeneratorInfo(String var1) { -- this.theFlatGeneratorInfo = FlatGeneratorInfo.createFlatGeneratorFromString(var1); -+ public void setFlatGeneratorInfo(String par1Str) { -+ this.theFlatGeneratorInfo = FlatGeneratorInfo.createFlatGeneratorFromString(par1Str); - } - -+ /** -+ * Adds the buttons (and other controls) to the screen in question. -+ */ - public void initGui() { -- this.i.clear(); -- this.d = I18n.getString("createWorld.customize.flat.title"); -- this.e = I18n.getString("createWorld.customize.flat.tile"); -- this.p = I18n.getString("createWorld.customize.flat.height"); -+ this.buttonList.clear(); -+ this.customizationTitle = I18n.getString("createWorld.customize.flat.title"); -+ this.layerMaterialLabel = I18n.getString("createWorld.customize.flat.tile"); -+ this.heightLabel = I18n.getString("createWorld.customize.flat.height"); - this.createFlatWorldListSlotGui = new GuiCreateFlatWorldListSlot(this); -- this.i.add(this.buttonAddLayer = new GuiButton(2, this.width / 2 - 154, this.height - 52, 100, 20, I18n.getString("createWorld.customize.flat.addLayer") + " (NYI)")); -- this.i.add(this.buttonEditLayer = new GuiButton(3, this.width / 2 - 50, this.height - 52, 100, 20, I18n.getString("createWorld.customize.flat.editLayer") + " (NYI)")); -- this.i.add(this.buttonRemoveLayer = new GuiButton(4, this.width / 2 - 155, this.height - 52, 150, 20, I18n.getString("createWorld.customize.flat.removeLayer"))); -- this.i.add(new GuiButton(0, this.width / 2 - 155, this.height - 28, 150, 20, I18n.getString("gui.done"))); -- this.i.add(new GuiButton(5, this.width / 2 + 5, this.height - 52, 150, 20, I18n.getString("createWorld.customize.presets"))); -- this.i.add(new GuiButton(1, this.width / 2 + 5, this.height - 28, 150, 20, I18n.getString("gui.cancel"))); -+ this.buttonList.add(this.buttonAddLayer = new GuiButton(2, this.width / 2 - 154, this.height - 52, 100, 20, I18n.getString("createWorld.customize.flat.addLayer") + " (NYI)")); -+ this.buttonList.add(this.buttonEditLayer = new GuiButton(3, this.width / 2 - 50, this.height - 52, 100, 20, I18n.getString("createWorld.customize.flat.editLayer") + " (NYI)")); -+ this.buttonList.add(this.buttonRemoveLayer = new GuiButton(4, this.width / 2 - 155, this.height - 52, 150, 20, I18n.getString("createWorld.customize.flat.removeLayer"))); -+ this.buttonList.add(new GuiButton(0, this.width / 2 - 155, this.height - 28, 150, 20, I18n.getString("gui.done"))); -+ this.buttonList.add(new GuiButton(5, this.width / 2 + 5, this.height - 52, 150, 20, I18n.getString("createWorld.customize.presets"))); -+ this.buttonList.add(new GuiButton(1, this.width / 2 + 5, this.height - 28, 150, 20, I18n.getString("gui.cancel"))); - this.buttonAddLayer.drawButton = this.buttonEditLayer.drawButton = false; - this.theFlatGeneratorInfo.func_82645_d(); - this.func_82270_g(); - } - -- protected void actionPerformed(GuiButton var1) { -+ /** -+ * Fired when a control is clicked. This is the equivalent of ActionListener.actionPerformed(ActionEvent e). -+ */ -+ protected void actionPerformed(GuiButton par1GuiButton) { - int var2 = this.theFlatGeneratorInfo.getFlatLayers().size() - this.createFlatWorldListSlotGui.field_82454_a - 1; -- if(var1.id == 1) { -- this.mc.displayGuiScreen(this.createWorldGui); -- } else if(var1.id == 0) { -- this.createWorldGui.a = this.getFlatGeneratorInfo(); -- this.mc.displayGuiScreen(this.createWorldGui); -- } else if(var1.id == 5) { -+ -+ if (par1GuiButton.id == 1) { -+ this.mc.displayGuiScreen(this.createWorldGui); -+ } else if (par1GuiButton.id == 0) { -+ this.createWorldGui.generatorOptionsToUse = this.getFlatGeneratorInfo(); -+ this.mc.displayGuiScreen(this.createWorldGui); -+ } else if (par1GuiButton.id == 5) { - this.mc.displayGuiScreen(new GuiFlatPresets(this)); -- } else if(var1.id == 4 && this.func_82272_i()) { -+ } else if (par1GuiButton.id == 4 && this.func_82272_i()) { - this.theFlatGeneratorInfo.getFlatLayers().remove(var2); - this.createFlatWorldListSlotGui.field_82454_a = Math.min(this.createFlatWorldListSlotGui.field_82454_a, this.theFlatGeneratorInfo.getFlatLayers().size() - 1); - } -@@ -72,21 +79,24 @@ - return this.createFlatWorldListSlotGui.field_82454_a > -1 && this.createFlatWorldListSlotGui.field_82454_a < this.theFlatGeneratorInfo.getFlatLayers().size(); - } - -- public void drawScreen(int var1, int var2, float var3) { -+ /** -+ * Draws the screen and all the components in it. -+ */ -+ public void drawScreen(int par1, int par2, float par3) { - this.drawDefaultBackground(); -- this.createFlatWorldListSlotGui.drawScreen(var1, var2, var3); -- this.drawCenteredString(this.fontRenderer, this.d, this.width / 2, 8, 16777215); -+ this.createFlatWorldListSlotGui.drawScreen(par1, par2, par3); -+ this.drawCenteredString(this.fontRenderer, this.customizationTitle, this.width / 2, 8, 16777215); - int var4 = this.width / 2 - 92 - 16; -- this.drawString(this.fontRenderer, this.e, var4, 32, 16777215); -- this.drawString(this.fontRenderer, this.p, var4 + 2 + 213 - this.fontRenderer.getStringWidth(this.p), 32, 16777215); -- super.drawScreen(var1, var2, var3); -+ this.drawString(this.fontRenderer, this.layerMaterialLabel, var4, 32, 16777215); -+ this.drawString(this.fontRenderer, this.heightLabel, var4 + 2 + 213 - this.fontRenderer.getStringWidth(this.heightLabel), 32, 16777215); -+ super.drawScreen(par1, par2, par3); - } - - static RenderItem getRenderItem() { - return theRenderItem; - } - -- static FlatGeneratorInfo func_82271_a(GuiCreateFlatWorld var0) { -- return var0.theFlatGeneratorInfo; -+ static FlatGeneratorInfo func_82271_a(GuiCreateFlatWorld par0GuiCreateFlatWorld) { -+ return par0GuiCreateFlatWorld.theFlatGeneratorInfo; - } - } ---- net/minecraft/src/BlockSign.java -+++ net/minecraft/src/BlockSign.java -@@ -3,125 +3,168 @@ - import java.util.Random; - - public class BlockSign extends BlockContainer { -- private Class a; -+ private Class signEntityClass; -+ -+ /** Whether this is a freestanding sign or a wall-mounted sign */ - private boolean isFreestanding; - -- protected BlockSign(int var1, Class var2, boolean var3) { -- super(var1, Material.wood); -- this.isFreestanding = var3; -- this.a = var2; -+ protected BlockSign(int par1, Class par2Class, boolean par3) { -+ super(par1, Material.wood); -+ this.isFreestanding = par3; -+ this.signEntityClass = par2Class; - float var4 = 0.25F; - float var5 = 1.0F; - this.setBlockBounds(0.5F - var4, 0.0F, 0.5F - var4, 0.5F + var4, var5, 0.5F + var4); - } - -- public Icon getIcon(int var1, int var2) { -- return Block.planks.getBlockTextureFromSide(var1); -+ /** -+ * From the specified side and block metadata retrieves the blocks texture. Args: side, metadata -+ */ -+ public Icon getIcon(int par1, int par2) { -+ return Block.planks.getBlockTextureFromSide(par1); - } - -- public AxisAlignedBB getCollisionBoundingBoxFromPool(World var1, int var2, int var3, int var4) { -+ /** -+ * Returns a bounding box from the pool of bounding boxes (this means this box can change after the pool has been -+ * cleared to be reused) -+ */ -+ public AxisAlignedBB getCollisionBoundingBoxFromPool(World par1World, int par2, int par3, int par4) { - return null; - } - -- public AxisAlignedBB getSelectedBoundingBoxFromPool(World var1, int var2, int var3, int var4) { -- this.setBlockBoundsBasedOnState(var1, var2, var3, var4); -- return super.getSelectedBoundingBoxFromPool(var1, var2, var3, var4); -+ /** -+ * Returns the bounding box of the wired rectangular prism to render. -+ */ -+ public AxisAlignedBB getSelectedBoundingBoxFromPool(World par1World, int par2, int par3, int par4) { -+ this.setBlockBoundsBasedOnState(par1World, par2, par3, par4); -+ return super.getSelectedBoundingBoxFromPool(par1World, par2, par3, par4); - } - -- public void setBlockBoundsBasedOnState(IBlockAccess var1, int var2, int var3, int var4) { -- if(!this.isFreestanding) { -- int var5 = var1.getBlockMetadata(var2, var3, var4); -- float var6 = 9.0F / 32.0F; -- float var7 = 25.0F / 32.0F; -+ /** -+ * Updates the blocks bounds based on its current state. Args: world, x, y, z -+ */ -+ public void setBlockBoundsBasedOnState(IBlockAccess par1IBlockAccess, int par2, int par3, int par4) { -+ if (!this.isFreestanding) { -+ int var5 = par1IBlockAccess.getBlockMetadata(par2, par3, par4); -+ float var6 = 0.28125F; -+ float var7 = 0.78125F; - float var8 = 0.0F; - float var9 = 1.0F; -- float var10 = 2.0F / 16.0F; -+ float var10 = 0.125F; - this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F); -- if(var5 == 2) { -+ -+ if (var5 == 2) { - this.setBlockBounds(var8, var6, 1.0F - var10, var9, var7, 1.0F); - } - -- if(var5 == 3) { -+ if (var5 == 3) { - this.setBlockBounds(var8, var6, 0.0F, var9, var7, var10); - } - -- if(var5 == 4) { -+ if (var5 == 4) { - this.setBlockBounds(1.0F - var10, var6, var8, 1.0F, var7, var9); - } - -- if(var5 == 5) { -+ if (var5 == 5) { - this.setBlockBounds(0.0F, var6, var8, var10, var7, var9); - } -- - } - } - -+ /** -+ * The type of render function that is called for this block -+ */ - public int getRenderType() { - return -1; - } - -+ /** -+ * If this block doesn't render as an ordinary block it will return False (examples: signs, buttons, stairs, etc) -+ */ - public boolean renderAsNormalBlock() { - return false; - } - -- public boolean getBlocksMovement(IBlockAccess var1, int var2, int var3, int var4) { -+ public boolean getBlocksMovement(IBlockAccess par1IBlockAccess, int par2, int par3, int par4) { - return true; - } - -+ /** -+ * Is this block (a) opaque and (b) a full 1m cube? This determines whether or not to render the shared face of two -+ * adjacent blocks and also whether the player can attach torches, redstone wire, etc to this block. -+ */ - public boolean isOpaqueCube() { - return false; - } - -- public TileEntity createNewTileEntity(World var1) { -+ /** -+ * Returns a new instance of a block's tile entity class. Called on placing the block. -+ */ -+ public TileEntity createNewTileEntity(World par1World) { - try { -- return (TileEntity)this.a.newInstance(); -+ return (TileEntity)this.signEntityClass.newInstance(); - } catch (Exception var3) { - throw new RuntimeException(var3); - } - } - -- public int idDropped(int var1, Random var2, int var3) { -+ /** -+ * Returns the ID of the items to drop on destruction. -+ */ -+ public int idDropped(int par1, Random par2Random, int par3) { - return Item.sign.itemID; - } - -- public void onNeighborBlockChange(World var1, int var2, int var3, int var4, int var5) { -+ /** -+ * Lets the block know when one of its neighbor changes. Doesn't know which neighbor changed (coordinates passed are -+ * their own) Args: x, y, z, neighbor blockID -+ */ -+ public void onNeighborBlockChange(World par1World, int par2, int par3, int par4, int par5) { - boolean var6 = false; -- if(this.isFreestanding) { -- if(!var1.getBlockMaterial(var2, var3 - 1, var4).isSolid()) { -+ -+ if (this.isFreestanding) { -+ if (!par1World.getBlockMaterial(par2, par3 - 1, par4).isSolid()) { - var6 = true; - } - } else { -- int var7 = var1.getBlockMetadata(var2, var3, var4); -+ int var7 = par1World.getBlockMetadata(par2, par3, par4); - var6 = true; -- if(var7 == 2 && var1.getBlockMaterial(var2, var3, var4 + 1).isSolid()) { -- var6 = false; -- } -- -- if(var7 == 3 && var1.getBlockMaterial(var2, var3, var4 - 1).isSolid()) { -- var6 = false; -- } -- -- if(var7 == 4 && var1.getBlockMaterial(var2 + 1, var3, var4).isSolid()) { -- var6 = false; -- } -- -- if(var7 == 5 && var1.getBlockMaterial(var2 - 1, var3, var4).isSolid()) { -- var6 = false; -- } -- } -- -- if(var6) { -- this.dropBlockAsItem(var1, var2, var3, var4, var1.getBlockMetadata(var2, var3, var4), 0); -- var1.setBlockToAir(var2, var3, var4); -- } -- -- super.onNeighborBlockChange(var1, var2, var3, var4, var5); -+ -+ if (var7 == 2 && par1World.getBlockMaterial(par2, par3, par4 + 1).isSolid()) { -+ var6 = false; -+ } -+ -+ if (var7 == 3 && par1World.getBlockMaterial(par2, par3, par4 - 1).isSolid()) { -+ var6 = false; -+ } -+ -+ if (var7 == 4 && par1World.getBlockMaterial(par2 + 1, par3, par4).isSolid()) { -+ var6 = false; -+ } -+ -+ if (var7 == 5 && par1World.getBlockMaterial(par2 - 1, par3, par4).isSolid()) { -+ var6 = false; -+ } -+ } -+ -+ if (var6) { -+ this.dropBlockAsItem(par1World, par2, par3, par4, par1World.getBlockMetadata(par2, par3, par4), 0); -+ par1World.setBlockToAir(par2, par3, par4); -+ } -+ -+ super.onNeighborBlockChange(par1World, par2, par3, par4, par5); - } - -- public int idPicked(World var1, int var2, int var3, int var4) { -+ /** -+ * only called by clickMiddleMouseButton , and passed to inventory.setCurrentItem (along with isCreative) -+ */ -+ public int idPicked(World par1World, int par2, int par3, int par4) { - return Item.sign.itemID; - } - -- public void registerIcons(IconRegister var1) { -- } -+ /** -+ * When this method is called, your block should register all the icons it needs with the given IconRegister. This is -+ * the only chance you get to register icons. -+ */ -+ public void registerIcons(IconRegister par1IconRegister) {} - } ---- /dev/null -+++ org/spoutcraft/client/packet/PacketPlaySound.java -@@ -1,0 +1,103 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.client.packet; -+ -+import java.io.IOException; -+ -+import net.minecraft.src.EntityPlayer; -+import net.minecraft.src.SoundManager; -+ -+import org.spoutcraft.api.io.SpoutInputStream; -+import org.spoutcraft.api.io.SpoutOutputStream; -+import org.spoutcraft.api.sound.Music; -+import org.spoutcraft.api.sound.SoundEffect; -+import org.spoutcraft.client.SpoutClient; -+ -+public class PacketPlaySound implements SpoutPacket { -+ short soundId; -+ boolean location = false; -+ int x, y, z; -+ int volume, distance; -+ -+ public PacketPlaySound() { -+ } -+ -+ public int getNumBytes() { -+ return 23; -+ } -+ -+ public void readData(SpoutInputStream input) throws IOException { -+ soundId = input.readShort(); -+ location = input.readBoolean(); -+ x = input.readInt(); -+ y = input.readInt(); -+ z = input.readInt(); -+ distance = input.readInt(); -+ volume = input.readInt(); -+ } -+ -+ public void writeData(SpoutOutputStream output) throws IOException { -+ output.writeShort(soundId); -+ output.writeBoolean(location); -+ if (!location) { -+ output.writeInt(-1); -+ output.writeInt(-1); -+ output.writeInt(-1); -+ output.writeInt(-1); -+ } else { -+ output.writeInt(x); -+ output.writeInt(y); -+ output.writeInt(z); -+ output.writeInt(distance); -+ } -+ output.writeInt(volume); -+ } -+ -+ public void run(int entityId) { -+ EntityPlayer e = SpoutClient.getInstance().getPlayerFromId(entityId); -+ if (e != null) { -+ SoundManager sndManager = SpoutClient.getHandle().sndManager; -+ if (soundId > -1 && soundId <= SoundEffect.getMaxId()) { -+ SoundEffect effect = SoundEffect.getSoundEffectFromId(soundId); -+ if (!location) { -+ sndManager.playSoundFX(effect.getName(), 0.5F, 0.7F, effect.getVariationId(), volume / 100F); -+ } else { -+ sndManager.playSound(effect.getName(), x, y, z, 0.5F, (distance / 16F), effect.getVariationId(), volume / 100F); -+ } -+ } -+ soundId -= (1 + SoundEffect.getMaxId()); -+ if (soundId > -1 && soundId <= Music.getMaxId()) { -+ Music music = Music.getMusicFromId(soundId); -+ sndManager.playMusic(music.getName(), music.getSoundId(), volume / 100F); -+ } -+ } -+ } -+ -+ public PacketType getPacketType() { -+ return PacketType.PacketPlaySound; -+ } -+ -+ public int getVersion() { -+ return 0; -+ } -+ -+ public void failure(int playerId) { -+ } -+} ---- net/minecraft/src/MovingObjectPosition.java -+++ net/minecraft/src/MovingObjectPosition.java -@@ -1,26 +1,43 @@ - package net.minecraft.src; - - public class MovingObjectPosition { -+ -+ /** What type of ray trace hit was this? 0 = block, 1 = entity */ - public EnumMovingObjectType typeOfHit; -+ -+ /** x coordinate of the block ray traced against */ - public int blockX; -+ -+ /** y coordinate of the block ray traced against */ - public int blockY; -+ -+ /** z coordinate of the block ray traced against */ - public int blockZ; -+ -+ /** -+ * Which side was hit. If its -1 then it went the full length of the ray trace. Bottom = 0, Top = 1, East = 2, West = -+ * 3, North = 4, South = 5. -+ */ - public int sideHit; -+ -+ /** The vector position of the hit */ - public Vec3 hitVec; -+ -+ /** The hit entity */ - public Entity entityHit; - -- public MovingObjectPosition(int var1, int var2, int var3, int var4, Vec3 var5) { -+ public MovingObjectPosition(int par1, int par2, int par3, int par4, Vec3 par5Vec3) { - this.typeOfHit = EnumMovingObjectType.TILE; -- this.blockX = var1; -- this.blockY = var2; -- this.blockZ = var3; -- this.sideHit = var4; -- this.hitVec = var5.myVec3LocalPool.getVecFromPool(var5.xCoord, var5.yCoord, var5.zCoord); -+ this.blockX = par1; -+ this.blockY = par2; -+ this.blockZ = par3; -+ this.sideHit = par4; -+ this.hitVec = par5Vec3.myVec3LocalPool.getVecFromPool(par5Vec3.xCoord, par5Vec3.yCoord, par5Vec3.zCoord); - } - -- public MovingObjectPosition(Entity var1) { -+ public MovingObjectPosition(Entity par1Entity) { - this.typeOfHit = EnumMovingObjectType.ENTITY; -- this.entityHit = var1; -- this.hitVec = var1.worldObj.getWorldVec3Pool().getVecFromPool(var1.posX, var1.posY, var1.posZ); -+ this.entityHit = par1Entity; -+ this.hitVec = par1Entity.worldObj.getWorldVec3Pool().getVecFromPool(par1Entity.posX, par1Entity.posY, par1Entity.posZ); - } - } ---- net/minecraft/src/ModifiableAttributeInstance.java -+++ net/minecraft/src/ModifiableAttributeInstance.java -@@ -12,22 +12,21 @@ - public class ModifiableAttributeInstance implements AttributeInstance { - private final BaseAttributeMap field_111138_a; - private final Attribute field_111136_b; -- private final Map c = Maps.newHashMap(); -- private final Map d = Maps.newHashMap(); -- private final Map e = Maps.newHashMap(); -+ private final Map field_111137_c = Maps.newHashMap(); -+ private final Map field_111134_d = Maps.newHashMap(); -+ private final Map field_111135_e = Maps.newHashMap(); - private double baseValue; - private boolean field_111133_g = true; - private double field_111139_h; - -- public ModifiableAttributeInstance(BaseAttributeMap var1, Attribute var2) { -- this.field_111138_a = var1; -- this.field_111136_b = var2; -- this.baseValue = var2.getDefaultValue(); -+ public ModifiableAttributeInstance(BaseAttributeMap par1BaseAttributeMap, Attribute par2Attribute) { -+ this.field_111138_a = par1BaseAttributeMap; -+ this.field_111136_b = par2Attribute; -+ this.baseValue = par2Attribute.getDefaultValue(); - -- for(int var3 = 0; var3 < 3; ++var3) { -- this.c.put(Integer.valueOf(var3), new HashSet()); -+ for (int var3 = 0; var3 < 3; ++var3) { -+ this.field_111137_c.put(Integer.valueOf(var3), new HashSet()); - } -- - } - - public Attribute func_111123_a() { -@@ -38,44 +37,48 @@ - return this.baseValue; - } - -- public void setAttribute(double var1) { -- if(var1 != this.getBaseValue()) { -- this.baseValue = var1; -+ public void setAttribute(double par1) { -+ if (par1 != this.getBaseValue()) { -+ this.baseValue = par1; - this.func_111131_f(); - } - } - -- public Collection func_111130_a(int var1) { -- return (Collection)this.c.get(Integer.valueOf(var1)); -+ public Collection func_111130_a(int par1) { -+ return (Collection)this.field_111137_c.get(Integer.valueOf(par1)); - } - - public Collection func_111122_c() { - HashSet var1 = new HashSet(); - -- for(int var2 = 0; var2 < 3; ++var2) { -+ for (int var2 = 0; var2 < 3; ++var2) { - var1.addAll(this.func_111130_a(var2)); - } - - return var1; - } - -- public AttributeModifier getModifier(UUID var1) { -- return (AttributeModifier)this.e.get(var1); -+ /** -+ * Returns attribute modifier, if any, by the given UUID -+ */ -+ public AttributeModifier getModifier(UUID par1UUID) { -+ return (AttributeModifier)this.field_111135_e.get(par1UUID); - } - -- public void applyModifier(AttributeModifier var1) { -- if(this.getModifier(var1.getID()) != null) { -+ public void applyModifier(AttributeModifier par1AttributeModifier) { -+ if (this.getModifier(par1AttributeModifier.getID()) != null) { - throw new IllegalArgumentException("Modifier is already applied on this attribute!"); - } else { -- Object var2 = (Set)this.d.get(var1.getName()); -- if(var2 == null) { -+ Object var2 = (Set)this.field_111134_d.get(par1AttributeModifier.getName()); -+ -+ if (var2 == null) { - var2 = new HashSet(); -- this.d.put(var1.getName(), var2); -+ this.field_111134_d.put(par1AttributeModifier.getName(), var2); - } - -- ((Set)this.c.get(Integer.valueOf(var1.getOperation()))).add(var1); -- ((Set)var2).add(var1); -- this.e.put(var1.getID(), var1); -+ ((Set)this.field_111137_c.get(Integer.valueOf(par1AttributeModifier.getOperation()))).add(par1AttributeModifier); -+ ((Set)var2).add(par1AttributeModifier); -+ this.field_111135_e.put(par1AttributeModifier.getID(), par1AttributeModifier); - this.func_111131_f(); - } - } -@@ -85,40 +88,42 @@ - this.field_111138_a.func_111149_a(this); - } - -- public void removeModifier(AttributeModifier var1) { -- for(int var2 = 0; var2 < 3; ++var2) { -- Set var3 = (Set)this.c.get(Integer.valueOf(var2)); -- var3.remove(var1); -+ public void removeModifier(AttributeModifier par1AttributeModifier) { -+ for (int var2 = 0; var2 < 3; ++var2) { -+ Set var3 = (Set)this.field_111137_c.get(Integer.valueOf(var2)); -+ var3.remove(par1AttributeModifier); - } - -- Set var4 = (Set)this.d.get(var1.getName()); -- if(var4 != null) { -- var4.remove(var1); -- if(var4.isEmpty()) { -- this.d.remove(var1.getName()); -+ Set var4 = (Set)this.field_111134_d.get(par1AttributeModifier.getName()); -+ -+ if (var4 != null) { -+ var4.remove(par1AttributeModifier); -+ -+ if (var4.isEmpty()) { -+ this.field_111134_d.remove(par1AttributeModifier.getName()); - } - } - -- this.e.remove(var1.getID()); -+ this.field_111135_e.remove(par1AttributeModifier.getID()); - this.func_111131_f(); - } - - public void func_142049_d() { - Collection var1 = this.func_111122_c(); -- if(var1 != null) { -+ -+ if (var1 != null) { - ArrayList var4 = new ArrayList(var1); - Iterator var2 = var4.iterator(); - -- while(var2.hasNext()) { -+ while (var2.hasNext()) { - AttributeModifier var3 = (AttributeModifier)var2.next(); - this.removeModifier(var3); - } -- - } - } - - public double getAttributeValue() { -- if(this.field_111133_g) { -+ if (this.field_111133_g) { - this.field_111139_h = this.func_111129_g(); - this.field_111133_g = false; - } -@@ -128,21 +133,21 @@ - - private double func_111129_g() { - double var1 = this.getBaseValue(); -- - AttributeModifier var4; -- for(Iterator var3 = this.func_111130_a(0).iterator(); var3.hasNext(); var1 += var4.getAmount()) { -+ -+ for (Iterator var3 = this.func_111130_a(0).iterator(); var3.hasNext(); var1 += var4.getAmount()) { - var4 = (AttributeModifier)var3.next(); - } - - double var7 = var1; -- - Iterator var5; - AttributeModifier var6; -- for(var5 = this.func_111130_a(1).iterator(); var5.hasNext(); var7 += var1 * var6.getAmount()) { -+ -+ for (var5 = this.func_111130_a(1).iterator(); var5.hasNext(); var7 += var1 * var6.getAmount()) { - var6 = (AttributeModifier)var5.next(); - } - -- for(var5 = this.func_111130_a(2).iterator(); var5.hasNext(); var7 *= 1.0D + var6.getAmount()) { -+ for (var5 = this.func_111130_a(2).iterator(); var5.hasNext(); var7 *= 1.0D + var6.getAmount()) { - var6 = (AttributeModifier)var5.next(); - } - ---- /dev/null -+++ Start.java -@@ -1,0 +1,17 @@ -+import java.io.File; -+import java.lang.reflect.Field; -+import java.util.Arrays; -+ -+import net.minecraft.client.main.Main; -+ -+public class Start { -+ public static void main(String[] args) { -+ Main.main(concat(new String[] {"--version", "mcp"}, args)); -+ } -+ -+ public static T[] concat(T[] first, T[] second) { -+ T[] result = Arrays.copyOf(first, first.length + second.length); -+ System.arraycopy(second, 0, result, first.length, second.length); -+ return result; -+ } -+} ---- net/minecraft/src/EntityAILookIdle.java -+++ net/minecraft/src/EntityAILookIdle.java -@@ -1,31 +1,53 @@ - package net.minecraft.src; - - public class EntityAILookIdle extends EntityAIBase { -+ -+ /** The entity that is looking idle. */ - private EntityLiving idleEntity; -+ -+ /** X offset to look at */ - private double lookX; -+ -+ /** Z offset to look at */ - private double lookZ; -+ -+ /** -+ * A decrementing tick that stops the entity from being idle once it reaches 0. -+ */ - private int idleTime; - -- public EntityAILookIdle(EntityLiving var1) { -- this.idleEntity = var1; -+ public EntityAILookIdle(EntityLiving par1EntityLiving) { -+ this.idleEntity = par1EntityLiving; - this.setMutexBits(3); - } - -+ /** -+ * Returns whether the EntityAIBase should begin execution. -+ */ - public boolean shouldExecute() { - return this.idleEntity.getRNG().nextFloat() < 0.02F; - } - -+ /** -+ * Returns whether an in-progress EntityAIBase should continue executing -+ */ - public boolean continueExecuting() { - return this.idleTime >= 0; - } - -+ /** -+ * Execute a one shot task or start executing a continuous task -+ */ - public void startExecuting() { -- double var1 = Math.PI * 2.0D * this.idleEntity.getRNG().nextDouble(); -+ double var1 = (Math.PI * 2D) * this.idleEntity.getRNG().nextDouble(); - this.lookX = Math.cos(var1); - this.lookZ = Math.sin(var1); - this.idleTime = 20 + this.idleEntity.getRNG().nextInt(20); - } - -+ /** -+ * Updates the task -+ */ - public void updateTask() { - --this.idleTime; - this.idleEntity.getLookHelper().setLookPosition(this.idleEntity.posX + this.lookX, this.idleEntity.posY + (double)this.idleEntity.getEyeHeight(), this.idleEntity.posZ + this.lookZ, 10.0F, (float)this.idleEntity.getVerticalFaceSpeed()); ---- net/minecraft/src/Packet206SetObjective.java -+++ net/minecraft/src/Packet206SetObjective.java -@@ -5,36 +5,51 @@ - import java.io.IOException; - - public class Packet206SetObjective extends Packet { -- public String a; -- public String b; -+ public String objectiveName; -+ public String objectiveDisplayName; -+ -+ /** -+ * 0 to create scoreboard, 1 to remove scoreboard, 2 to update display text. -+ */ - public int change; - -- public Packet206SetObjective() { -- } -- -- public Packet206SetObjective(ScoreObjective var1, int var2) { -- this.a = var1.getName(); -- this.b = var1.getDisplayName(); -- this.change = var2; -- } -- -- public void readPacketData(DataInput var1) throws IOException { -- this.a = readString(var1, 16); -- this.b = readString(var1, 32); -- this.change = var1.readByte(); -- } -- -- public void writePacketData(DataOutput var1) throws IOException { -- writeString(this.a, var1); -- writeString(this.b, var1); -- var1.writeByte(this.change); -- } -- -- public void processPacket(NetHandler var1) { -- var1.handleSetObjective(this); -- } -- -+ public Packet206SetObjective() {} -+ -+ public Packet206SetObjective(ScoreObjective par1ScoreObjective, int par2) { -+ this.objectiveName = par1ScoreObjective.getName(); -+ this.objectiveDisplayName = par1ScoreObjective.getDisplayName(); -+ this.change = par2; -+ } -+ -+ /** -+ * Abstract. Reads the raw packet data from the data stream. -+ */ -+ public void readPacketData(DataInput par1DataInput) throws IOException { -+ this.objectiveName = readString(par1DataInput, 16); -+ this.objectiveDisplayName = readString(par1DataInput, 32); -+ this.change = par1DataInput.readByte(); -+ } -+ -+ /** -+ * Abstract. Writes the raw packet data to the data stream. -+ */ -+ public void writePacketData(DataOutput par1DataOutput) throws IOException { -+ writeString(this.objectiveName, par1DataOutput); -+ writeString(this.objectiveDisplayName, par1DataOutput); -+ par1DataOutput.writeByte(this.change); -+ } -+ -+ /** -+ * Passes this Packet on to the NetHandler for processing. -+ */ -+ public void processPacket(NetHandler par1NetHandler) { -+ par1NetHandler.handleSetObjective(this); -+ } -+ -+ /** -+ * Abstract. Return the size of the packet (not counting the header). -+ */ - public int getPacketSize() { -- return 2 + this.a.length() + 2 + this.b.length() + 1; -+ return 2 + this.objectiveName.length() + 2 + this.objectiveDisplayName.length() + 1; - } - } ---- net/minecraft/src/ItemGlassBottle.java -+++ net/minecraft/src/ItemGlassBottle.java -@@ -1,48 +1,56 @@ - package net.minecraft.src; - - public class ItemGlassBottle extends Item { -- public ItemGlassBottle(int var1) { -- super(var1); -+ public ItemGlassBottle(int par1) { -+ super(par1); - this.setCreativeTab(CreativeTabs.tabBrewing); - } - -- public Icon getIconFromDamage(int var1) { -+ /** -+ * Gets an icon index based on an item's damage value -+ */ -+ public Icon getIconFromDamage(int par1) { - return Item.potion.getIconFromDamage(0); - } - -- public ItemStack onItemRightClick(ItemStack var1, World var2, EntityPlayer var3) { -- MovingObjectPosition var4 = this.getMovingObjectPositionFromPlayer(var2, var3, true); -- if(var4 == null) { -- return var1; -+ /** -+ * Called whenever this item is equipped and the right mouse button is pressed. Args: itemStack, world, entityPlayer -+ */ -+ public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) { -+ MovingObjectPosition var4 = this.getMovingObjectPositionFromPlayer(par2World, par3EntityPlayer, true); -+ -+ if (var4 == null) { -+ return par1ItemStack; - } else { -- if(var4.typeOfHit == EnumMovingObjectType.TILE) { -+ if (var4.typeOfHit == EnumMovingObjectType.TILE) { - int var5 = var4.blockX; - int var6 = var4.blockY; - int var7 = var4.blockZ; -- if(!var2.canMineBlock(var3, var5, var6, var7)) { -- return var1; -- } -- -- if(!var3.canPlayerEdit(var5, var6, var7, var4.sideHit, var1)) { -- return var1; -- } -- -- if(var2.getBlockMaterial(var5, var6, var7) == Material.water) { -- --var1.stackSize; -- if(var1.stackSize <= 0) { -+ -+ if (!par2World.canMineBlock(par3EntityPlayer, var5, var6, var7)) { -+ return par1ItemStack; -+ } -+ -+ if (!par3EntityPlayer.canPlayerEdit(var5, var6, var7, var4.sideHit, par1ItemStack)) { -+ return par1ItemStack; -+ } -+ -+ if (par2World.getBlockMaterial(var5, var6, var7) == Material.water) { -+ --par1ItemStack.stackSize; -+ -+ if (par1ItemStack.stackSize <= 0) { - return new ItemStack(Item.potion); - } - -- if(!var3.inventory.addItemStackToInventory(new ItemStack(Item.potion))) { -- var3.dropPlayerItem(new ItemStack(Item.potion.itemID, 1, 0)); -+ if (!par3EntityPlayer.inventory.addItemStackToInventory(new ItemStack(Item.potion))) { -+ par3EntityPlayer.dropPlayerItem(new ItemStack(Item.potion.itemID, 1, 0)); - } - } - } - -- return var1; -+ return par1ItemStack; - } - } - -- public void registerIcons(IconRegister var1) { -- } -+ public void registerIcons(IconRegister par1IconRegister) {} - } ---- /dev/null -+++ org/spoutcraft/client/DataMiningThread.java -@@ -1,0 +1,122 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.client; -+ -+import java.io.BufferedReader; -+import java.io.File; -+import java.io.InputStreamReader; -+import java.net.HttpURLConnection; -+import java.net.URL; -+ -+import net.minecraft.src.World; -+ -+import org.spoutcraft.client.io.FileUtil; -+ -+public class DataMiningThread extends Thread { -+ private volatile boolean onLogin = false; -+ private volatile boolean multiplayer = false; -+ private boolean runOnce = false; -+ private static DataMiningThread instance = null; -+ -+ public DataMiningThread() { -+ instance = this; -+ } -+ -+ public static DataMiningThread getInstance() { -+ return instance; -+ } -+ -+ public void onLogin() { -+ onLogin = true; -+ } -+ -+ private void doLogin() { -+ onRunOnce(); -+ if (SpoutClient.getInstance().getServerVersion() > 0) { -+ onSpoutLogin(); -+ } else { -+ onVanillaLogin(); -+ } -+ } -+ -+ private void doSinglePlayer() { -+ onRunOnce(); -+ pingLink("http://bit.ly/spoutsp"); -+ } -+ -+ private void onRunOnce() { -+ File runOnce = new File(FileUtil.getConfigDir(), "runonce"); -+ if (!runOnce.exists()) { -+ try { -+ runOnce.createNewFile(); -+ pingLink("http://bit.ly/spoutcraftinstall"); -+ } catch (Exception e) { -+ } -+ } -+ } -+ -+ private void onSpoutLogin() { -+ pingLink("http://bit.ly/spoutcraftlogin"); -+ } -+ -+ private void onVanillaLogin() { -+ pingLink("http://bit.ly/vanillalogin"); -+ } -+ -+ private void pingLink(String Url) { -+ try { -+ URL url = new URL(Url); -+ HttpURLConnection con = (HttpURLConnection)(url.openConnection()); -+ System.setProperty("http.agent", ""); // Spoofing the user agent is required to track stats -+ con.setRequestProperty("User-Agent", "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/534.30 (KHTML, like Gecko) Chrome/12.0.742.100 Safari/534.30"); -+ BufferedReader in = new BufferedReader(new InputStreamReader(con.getInputStream())); -+ String str; -+ while ((str = in.readLine()) != null); -+ in.close(); -+ } catch (Exception e) {} -+ } -+ -+ public void run() { -+ while (true) { -+ try { -+ sleep(10000); -+ } -+ catch (InterruptedException e1) {} -+ if (onLogin) { -+ doLogin(); -+ onLogin = false; -+ } -+ World world = SpoutClient.getHandle().theWorld; -+ if (world != null) { -+ if (!runOnce) { -+ multiplayer = world.isRemote; -+ runOnce = true; -+ onRunOnce(); -+ } -+ if (multiplayer != world.isRemote) { -+ if (world.isRemote) { -+ doSinglePlayer(); -+ } -+ multiplayer = world.isRemote; -+ } -+ } -+ } -+ } -+} ---- net/minecraft/src/ISidedInventory.java -+++ net/minecraft/src/ISidedInventory.java -@@ -1,9 +1,20 @@ - package net.minecraft.src; - - public interface ISidedInventory extends IInventory { -- int[] getSlotsForFace(int var1); -- -+ -+ /** -+ * Returns an array containing the indices of the slots that can be accessed by automation on the given side of this -+ * block. -+ */ -+ int[] getAccessibleSlotsFromSide(int var1); -+ -+ /** -+ * Returns true if automation can insert the given item in the given slot from the given side. Args: Slot, item, side -+ */ - boolean canInsertItem(int var1, ItemStack var2, int var3); - -+ /** -+ * Returns true if automation can extract the given item in the given slot from the given side. Args: Slot, item, side -+ */ - boolean canExtractItem(int var1, ItemStack var2, int var3); - } ---- /dev/null -+++ org/spoutcraft/client/controls/SimpleKeyBindingManager.java -@@ -1,0 +1,340 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.client.controls; -+ -+import java.io.File; -+import java.io.FileReader; -+import java.io.FileWriter; -+import java.io.IOException; -+import java.util.ArrayList; -+import java.util.Collections; -+import java.util.HashMap; -+import java.util.List; -+ -+import org.yaml.snakeyaml.Yaml; -+import org.yaml.snakeyaml.introspector.BeanAccess; -+ -+import org.lwjgl.input.Keyboard; -+ -+import net.minecraft.src.Block; -+import net.minecraft.src.GuiChat; -+import net.minecraft.src.GuiScreen; -+ -+import org.spoutcraft.api.Spoutcraft; -+import org.spoutcraft.api.gui.ScreenType; -+import org.spoutcraft.api.keyboard.AbstractBinding; -+import org.spoutcraft.api.keyboard.KeyBinding; -+import org.spoutcraft.api.keyboard.KeyBindingManager; -+import org.spoutcraft.api.keyboard.KeyBindingPress; -+import org.spoutcraft.client.SpoutClient; -+import org.spoutcraft.client.gui.controls.GuiControls; -+import org.spoutcraft.client.io.FileUtil; -+import org.spoutcraft.client.packet.PacketKeyBinding; -+ -+public class SimpleKeyBindingManager implements KeyBindingManager { -+ private ArrayList bindings; -+ private ArrayList shortcuts = new ArrayList(); -+ private HashMap> bindingsForKey = new HashMap>(); -+ public static final int MOUSE_OFFSET = -100; -+ -+ public SimpleKeyBindingManager() { -+ } -+ -+ public void registerControl(KeyBinding binding) { -+ KeyBinding result = null; -+ for (KeyBinding check:bindings) { -+ if (check.getId().equals(binding.getId()) && check.getAddonName().equals(binding.getAddonName())) { -+ result = check; -+ } -+ } -+ if (result != null) { -+ result.takeChanges(binding); -+ } else { -+ bindings.add(binding); -+ } -+ updateBindings(); -+ save(); -+ } -+ -+ public void registerShortcut(Shortcut shortcut) { -+ shortcuts.add(shortcut); -+ updateBindings(); -+ save(); -+ } -+ -+ public void unregisterShortcut(Shortcut shortcut) { -+ if (shortcut == null) { -+ return; -+ } -+ shortcuts.remove(shortcut); -+ if (bindingsForKey.get(shortcut.getKey()) == null) { -+ return; -+ } -+ bindingsForKey.get(shortcut.getKey()).remove(shortcut); -+ save(); -+ } -+ -+ public void unregisterControl(KeyBinding binding) { -+ if (binding == null) { -+ return; -+ } -+ bindings.remove(binding); -+ if (bindingsForKey.get(binding.getKey()) == null) { -+ return; -+ } -+ bindingsForKey.get(binding.getKey()).remove(binding); -+ save(); -+ } -+ -+ public void updateBindings() { -+ if (bindings == null) { -+ bindings = new ArrayList(); -+ } -+ if (shortcuts == null) { -+ shortcuts = new ArrayList(); -+ } -+ -+ bindingsForKey.clear(); -+ for (KeyBinding binding:bindings) { -+ ArrayList bindings = bindingsForKey.get(binding.getKey()); -+ if (bindings == null) { -+ bindings = new ArrayList(); -+ bindingsForKey.put(binding.getKey(), bindings); -+ } -+ bindings.add(binding); -+ } -+ for (Shortcut binding:shortcuts) { -+ ArrayList bindings = bindingsForKey.get(binding.getKey()); -+ if (bindings == null) { -+ bindings = new ArrayList(); -+ bindingsForKey.put(binding.getKey(), bindings); -+ } -+ bindings.add(binding); -+ } -+ } -+ -+ public void save() { -+ Yaml yaml = new Yaml(); -+ yaml.setBeanAccess(BeanAccess.FIELD); // To ignore transient fields -+ try { -+ // KeyBindings saving -+ FileWriter writer = new FileWriter(getBindingsFile()); -+ ArrayList kbsave = new ArrayList(); -+ for (KeyBinding binding:bindings) { -+ HashMap item = new HashMap(); -+ item.put("key", binding.getKey()); -+ item.put("id", binding.getId()); -+ item.put("description", binding.getDescription()); -+ item.put("addonName", binding.getAddonName()); -+ item.put("modifiers", binding.getModifiers()); -+ kbsave.add(item); -+ } -+ yaml.dump(kbsave, writer); -+ -+ // Shortcuts saving -+ writer = new FileWriter(getShortcutsFile()); -+ ArrayList shsave = new ArrayList(); -+ for (Shortcut sh:shortcuts) { -+ HashMap item = new HashMap(); -+ item.put("title", sh.getTitle()); -+ item.put("key", sh.getKey()); -+ item.put("modifiers", sh.getModifiers()); -+ item.put("commands", sh.getCommands()); -+ item.put("delay", sh.getDelay()); -+ shsave.add(item); -+ } -+ yaml.dump(shsave, writer); -+ } catch (IOException e) { -+ e.printStackTrace(); -+ } -+ } -+ -+ private File getBindingsFile() throws IOException { -+ File file = new File(FileUtil.getConfigDir(), "bindings.yml"); -+ if (!file.exists()) { -+ file.createNewFile(); -+ } -+ return file; -+ } -+ -+ private File getShortcutsFile() throws IOException { -+ File file = new File(FileUtil.getConfigDir(), "shortcuts.yml"); -+ if (!file.exists()) { -+ file.createNewFile(); -+ } -+ return file; -+ } -+ -+ @SuppressWarnings("unchecked") -+ public void load() { -+ Yaml yaml = new Yaml(); -+ try { -+ bindings = new ArrayList(); -+ ArrayList kbsave = yaml.loadAs(new FileReader(getBindingsFile()), ArrayList.class); -+ if (kbsave == null) { -+ kbsave = new ArrayList(); -+ } -+ for (Object obj:kbsave) { -+ HashMap item = (HashMap) obj; -+ int key = (Integer) item.get("key"); -+ String id, description, addonName; -+ id = (String) item.get("id"); -+ description = (String) item.get("description"); -+ byte modifiers = 0; -+ if (item.containsKey("modifiers")) { -+ modifiers = (byte)(int)(Integer) item.get("modifiers"); -+ } -+ if (item.containsKey("addonName")) { -+ addonName = (String) item.get("addonName"); -+ } else if (item.containsKey("plugin")) { -+ addonName = (String) item.get("plugin"); -+ } else { -+ continue; // Invalid item -+ } -+ KeyBinding binding = new KeyBinding(key, addonName, id, description); -+ binding.setRawModifiers(modifiers); -+ bindings.add(binding); -+ } -+ } catch (Exception e) { -+ e.printStackTrace(); -+ bindings = new ArrayList(); -+ } -+ try { -+ shortcuts.clear(); -+ ArrayList shsave = yaml.loadAs(new FileReader(getShortcutsFile()), ArrayList.class); -+ if (shsave == null) { -+ shsave = new ArrayList(); -+ } -+ for (Object obj:shsave) { -+ HashMap item = (HashMap) obj; -+ Shortcut sh = new Shortcut(); -+ sh.setTitle((String)item.get("title")); -+ sh.setKey((Integer)item.get("key")); -+ sh.setCommands((ArrayList)item.get("commands")); -+ if (item.containsKey("modifiers")) { -+ sh.setRawModifiers((byte)(int)(Integer)item.get("modifiers")); -+ } -+ if (item.containsKey("delay")) { -+ sh.setDelay((Integer) item.get("delay")); -+ } -+ shortcuts.add(sh); -+ } -+ } catch (Exception e) { -+ e.printStackTrace(); -+ shortcuts = new ArrayList(); -+ } -+ updateBindings(); -+ } -+ -+ public void pressKey(int key, boolean keyPressed, int screen) { -+ if (SpoutClient.getHandle().currentScreen instanceof GuiAmbigousInput || SpoutClient.getHandle().currentScreen instanceof GuiControls) { -+ return; -+ } -+ if (bindingsForKey.containsKey(key)) { -+ ArrayList bindings = bindingsForKey.get(key); -+ ArrayList effective = new ArrayList(); -+ for (AbstractBinding b:bindings) { -+ if (b.matches(key, getPressedModifiers())) { -+ effective.add(b); -+ } -+ } -+ if (effective.size() == 0) { -+ return; -+ } else if (effective.size() == 1) { -+ effective.iterator().next().summon(key, !keyPressed, screen); -+ } else if (screen == 0 || (getPressedModifiers() != 0 && getPressedModifiers() != AbstractBinding.MOD_SHIFT)) { -+ GuiScreen parent = SpoutClient.getHandle().currentScreen; -+ SpoutClient.getHandle().displayGuiScreen(new GuiAmbigousInput(effective, parent)); -+ } else { -+ GuiScreen parent = SpoutClient.getHandle().currentScreen; -+ if (!(parent instanceof GuiChat)) { -+ Spoutcraft.getActivePlayer().showAchievement("Multiple Bindings ...", "are assigned to Key " + Keyboard.getKeyName(key), Block.workbench.blockID); -+ } -+ } -+ } -+ } -+ -+ public static boolean isModifierKey(int key) { -+ if (key == Keyboard.KEY_LSHIFT -+ || key == Keyboard.KEY_RSHIFT -+ || key == Keyboard.KEY_LMENU -+ || key == Keyboard.KEY_RMENU -+ || key == Keyboard.KEY_LCONTROL -+ || key == Keyboard.KEY_RCONTROL -+ || key == Keyboard.KEY_LMETA -+ || key == Keyboard.KEY_RMETA) { -+ return true; -+ } -+ return false; -+ } -+ -+ public List getAllBindings() { -+ return Collections.unmodifiableList(bindings); -+ } -+ -+ public List getAllShortcuts() { -+ return Collections.unmodifiableList(shortcuts); -+ } -+ -+ public static void setModifiersToShortcut(Shortcut sh) { -+ if (Keyboard.isKeyDown(Keyboard.KEY_LSHIFT) || Keyboard.isKeyDown(Keyboard.KEY_RSHIFT)) { -+ sh.setModifier(AbstractBinding.MOD_SHIFT, true); -+ } -+ if (Keyboard.isKeyDown(Keyboard.KEY_LCONTROL) || Keyboard.isKeyDown(Keyboard.KEY_RCONTROL)) { -+ sh.setModifier(AbstractBinding.MOD_CTRL, true); -+ } -+ if (Keyboard.isKeyDown(Keyboard.KEY_LMENU) || Keyboard.isKeyDown(Keyboard.KEY_RMENU)) { -+ sh.setModifier(AbstractBinding.MOD_ALT, true); -+ } -+ if (Keyboard.isKeyDown(Keyboard.KEY_LMETA) || Keyboard.isKeyDown(Keyboard.KEY_RMETA)) { -+ sh.setModifier(AbstractBinding.MOD_SUPER, true); -+ } -+ } -+ -+ public static byte getPressedModifiers() { -+ byte res = 0; -+ if (Keyboard.isKeyDown(Keyboard.KEY_LSHIFT) || Keyboard.isKeyDown(Keyboard.KEY_RSHIFT)) { -+ res|=Shortcut.MOD_SHIFT; -+ } -+ if (Keyboard.isKeyDown(Keyboard.KEY_LCONTROL) || Keyboard.isKeyDown(Keyboard.KEY_RCONTROL)) { -+ res|=Shortcut.MOD_CTRL; -+ } -+ if (Keyboard.isKeyDown(Keyboard.KEY_LMENU) || Keyboard.isKeyDown(Keyboard.KEY_RMENU)) { -+ res|=Shortcut.MOD_ALT; -+ } -+ if (Keyboard.isKeyDown(Keyboard.KEY_LMETA) || Keyboard.isKeyDown(Keyboard.KEY_RMETA)) { -+ res|=Shortcut.MOD_SUPER; -+ } -+ return res; -+ } -+ -+ public void summon(KeyBinding binding, int key, boolean keyReleased, int screen) { -+ if (binding.getDelegate() == null && binding.getUniqueId() != null) { // Server-side -+ SpoutClient.getInstance().getPacketManager().sendSpoutPacket(new PacketKeyBinding(binding, key, !keyReleased, screen)); -+ } else if (binding.getDelegate() != null) { // Client-side -+ KeyBindingPress event = new KeyBindingPress(org.spoutcraft.api.gui.Keyboard.getKey(key), binding, ScreenType.getType(screen)); -+ if (!keyReleased) { -+ binding.getDelegate().onKeyPress(event); -+ } else { -+ binding.getDelegate().onKeyRelease(event); -+ } -+ } -+ } -+} ---- net/minecraft/src/IEntitySelector.java -+++ net/minecraft/src/IEntitySelector.java -@@ -4,5 +4,8 @@ - IEntitySelector selectAnything = new EntitySelectorAlive(); - IEntitySelector selectInventories = new EntitySelectorInventory(); - -+ /** -+ * Return whether the specified entity is applicable to this filter. -+ */ - boolean isEntityApplicable(Entity var1); - } ---- net/minecraft/src/WorldProviderSurface.java -+++ net/minecraft/src/WorldProviderSurface.java -@@ -1,6 +1,10 @@ - package net.minecraft.src; - - public class WorldProviderSurface extends WorldProvider { -+ -+ /** -+ * Returns the dimension's name, e.g. "The End", "Nether", or "Overworld". -+ */ - public String getDimensionName() { - return "Overworld"; - } ---- /dev/null -+++ org/spoutcraft/client/gui/controls/ControlsModel.java -@@ -1,0 +1,148 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.client.gui.controls; -+ -+import java.util.LinkedList; -+import java.util.List; -+ -+import net.minecraft.src.GameSettings; -+import net.minecraft.src.KeyBinding; -+ -+import org.spoutcraft.api.gui.AbstractListModel; -+import org.spoutcraft.client.SpoutClient; -+import org.spoutcraft.client.controls.Shortcut; -+import org.spoutcraft.client.controls.SimpleKeyBindingManager; -+ -+public class ControlsModel extends AbstractListModel { -+ private GuiControls gui; -+ protected GameSettings options = SpoutClient.getHandle().gameSettings; -+ private List items = new LinkedList(); -+ private SimpleKeyBindingManager manager = (SimpleKeyBindingManager) SpoutClient.getInstance().getKeyBindingManager(); -+ private boolean editing = false; -+ private ControlsBasicItem lastEdit = null; -+ -+ public ControlsModel(GuiControls gui) { -+ this.gui = gui; -+ } -+ -+ public void refresh() { -+ items.clear(); -+ -+ if (gui.checkVanilla.isChecked()) { -+ // Minecraft controls -+ int n = 0; -+ for (KeyBinding binding:options.keyBindings) { -+ items.add(new VanillaBindingItem(n, binding, this)); -+ n++; -+ } -+ } -+ -+ if (gui.checkSpoutcraft.isChecked()) { -+ // Spoutcraft controls -+ for (KeyBinding binding:options.spoutcraftBindings) { -+ items.add(new SpoutcraftBindingItem(binding, this)); -+ } -+ } -+ -+ if (gui.checkCustom.isChecked()) { -+ // Custom plugin controls -+ for (org.spoutcraft.api.keyboard.KeyBinding binding:manager.getAllBindings()) { -+ items.add(new KeyBindingItem(binding, this)); -+ } -+ } -+ -+ if (gui.checkShortcuts.isChecked()) { -+ // User shortcuts -+ for (Shortcut sh:manager.getAllShortcuts()) { -+ items.add(new ShortcutBindingItem(sh, this)); -+ } -+ } -+ -+ // Check for conflicting keys -+ outer: for (ControlsBasicItem item1:items) { -+ for (ControlsBasicItem item2:items) { -+ if (!item1.equals(item2)) { -+ item1.setConflicting(item1.conflicts(item2)); -+ if (item1.isConflicting()) { -+ continue outer; -+ } -+ } -+ } -+ } -+ -+ if (!gui.search.getText().isEmpty()) { -+ for (int i = 0; i < items.size(); i++) { -+ ControlsBasicItem item = items.get(i); -+ if (!item.getName().toLowerCase().contains(gui.search.getText().toLowerCase())) { -+ items.remove(i); -+ i--; -+ } -+ } -+ } -+ -+ sizeChanged(); -+ } -+ -+ public void setCurrentGui(GuiControls gui) { -+ this.gui = gui; -+ } -+ -+ @Override -+ public ControlsBasicItem getItem(int row) { -+ if (row < 0 || row >= items.size()) { -+ return null; -+ } -+ return items.get(row); -+ } -+ -+ @Override -+ public int getSize() { -+ return items.size(); -+ } -+ -+ @Override -+ public void onSelected(int item, boolean doubleClick) { -+ } -+ -+ protected void onItemClicked(ControlsBasicItem item, boolean doubleClicked) { -+ if (doubleClicked) { -+ editing = !editing; -+ if (item != lastEdit) { -+ editing = true; -+ } -+ lastEdit = item; -+ } -+ gui.updateButtons(); -+ } -+ -+ public void setEditing(ControlsBasicItem item) { -+ editing = true; -+ lastEdit = item; -+ } -+ -+ public ControlsBasicItem getEditingItem() { -+ return editing?lastEdit:null; -+ } -+ -+ public void finishEdit() { -+ editing = false; -+ refresh(); -+ } -+} ---- net/minecraft/src/ThreadedFileIOBase.java -+++ net/minecraft/src/ThreadedFileIOBase.java -@@ -5,8 +5,10 @@ - import java.util.List; - - public class ThreadedFileIOBase implements Runnable { -+ -+ /** Instance of ThreadedFileIOBase */ - public static final ThreadedFileIOBase threadedIOInstance = new ThreadedFileIOBase(); -- private List b = Collections.synchronizedList(new ArrayList()); -+ private List threadedIOQueue = Collections.synchronizedList(new ArrayList()); - private volatile long writeQueuedCounter; - private volatile long savedIOCounter; - private volatile boolean isThreadWaiting; -@@ -18,17 +20,21 @@ - } - - public void run() { -- while(true) { -+ while (true) { - this.processQueue(); - } - } - -+ /** -+ * Process the items that are in the queue -+ */ - private void processQueue() { -- for(int var1 = 0; var1 < this.b.size(); ++var1) { -- IThreadedFileIO var2 = (IThreadedFileIO)this.b.get(var1); -+ for (int var1 = 0; var1 < this.threadedIOQueue.size(); ++var1) { -+ IThreadedFileIO var2 = (IThreadedFileIO)this.threadedIOQueue.get(var1); - boolean var3 = var2.writeNextIO(); -- if(!var3) { -- this.b.remove(var1--); -+ -+ if (!var3) { -+ this.threadedIOQueue.remove(var1--); - ++this.savedIOCounter; - } - -@@ -39,27 +45,29 @@ - } - } - -- if(this.b.isEmpty()) { -+ if (this.threadedIOQueue.isEmpty()) { - try { - Thread.sleep(25L); - } catch (InterruptedException var5) { - var5.printStackTrace(); - } - } -- - } - -- public void queueIO(IThreadedFileIO var1) { -- if(!this.b.contains(var1)) { -+ /** -+ * threaded io -+ */ -+ public void queueIO(IThreadedFileIO par1IThreadedFileIO) { -+ if (!this.threadedIOQueue.contains(par1IThreadedFileIO)) { - ++this.writeQueuedCounter; -- this.b.add(var1); -+ this.threadedIOQueue.add(par1IThreadedFileIO); - } - } - - public void waitForFinish() throws InterruptedException { - this.isThreadWaiting = true; - -- while(this.writeQueuedCounter != this.savedIOCounter) { -+ while (this.writeQueuedCounter != this.savedIOCounter) { - Thread.sleep(10L); - } - ---- net/minecraft/src/Packet17Sleep.java -+++ net/minecraft/src/Packet17Sleep.java -@@ -11,37 +11,48 @@ - public int bedZ; - public int field_73622_e; - -- public Packet17Sleep() { -- } -- -- public Packet17Sleep(Entity var1, int var2, int var3, int var4, int var5) { -- this.field_73622_e = var2; -- this.bedX = var3; -- this.bedY = var4; -- this.bedZ = var5; -- this.entityID = var1.entityId; -- } -- -- public void readPacketData(DataInput var1) throws IOException { -- this.entityID = var1.readInt(); -- this.field_73622_e = var1.readByte(); -- this.bedX = var1.readInt(); -- this.bedY = var1.readByte(); -- this.bedZ = var1.readInt(); -- } -- -- public void writePacketData(DataOutput var1) throws IOException { -- var1.writeInt(this.entityID); -- var1.writeByte(this.field_73622_e); -- var1.writeInt(this.bedX); -- var1.writeByte(this.bedY); -- var1.writeInt(this.bedZ); -- } -- -- public void processPacket(NetHandler var1) { -- var1.handleSleep(this); -- } -- -+ public Packet17Sleep() {} -+ -+ public Packet17Sleep(Entity par1Entity, int par2, int par3, int par4, int par5) { -+ this.field_73622_e = par2; -+ this.bedX = par3; -+ this.bedY = par4; -+ this.bedZ = par5; -+ this.entityID = par1Entity.entityId; -+ } -+ -+ /** -+ * Abstract. Reads the raw packet data from the data stream. -+ */ -+ public void readPacketData(DataInput par1DataInput) throws IOException { -+ this.entityID = par1DataInput.readInt(); -+ this.field_73622_e = par1DataInput.readByte(); -+ this.bedX = par1DataInput.readInt(); -+ this.bedY = par1DataInput.readByte(); -+ this.bedZ = par1DataInput.readInt(); -+ } -+ -+ /** -+ * Abstract. Writes the raw packet data to the data stream. -+ */ -+ public void writePacketData(DataOutput par1DataOutput) throws IOException { -+ par1DataOutput.writeInt(this.entityID); -+ par1DataOutput.writeByte(this.field_73622_e); -+ par1DataOutput.writeInt(this.bedX); -+ par1DataOutput.writeByte(this.bedY); -+ par1DataOutput.writeInt(this.bedZ); -+ } -+ -+ /** -+ * Passes this Packet on to the NetHandler for processing. -+ */ -+ public void processPacket(NetHandler par1NetHandler) { -+ par1NetHandler.handleSleep(this); -+ } -+ -+ /** -+ * Abstract. Return the size of the packet (not counting the header). -+ */ - public int getPacketSize() { - return 14; - } ---- net/minecraft/src/CallableModded.java -+++ net/minecraft/src/CallableModded.java -@@ -4,12 +4,17 @@ - import net.minecraft.client.ClientBrandRetriever; - - class CallableModded implements Callable { -+ -+ /** Reference to the Minecraft object. */ - final Minecraft mc; - -- CallableModded(Minecraft var1) { -- this.mc = var1; -+ CallableModded(Minecraft par1Minecraft) { -+ this.mc = par1Minecraft; - } - -+ /** -+ * Gets if Client Profiler (aka Snooper) is enabled. -+ */ - public String getClientProfilerEnabled() { - String var1 = ClientBrandRetriever.getClientModName(); - return !var1.equals("vanilla") ? "Definitely; Client brand changed to \'" + var1 + "\'" : (Minecraft.class.getSigners() == null ? "Very likely; Jar signature invalidated" : "Probably not. Jar signature remains and client brand is untouched."); ---- net/minecraft/src/BlockRail.java -+++ net/minecraft/src/BlockRail.java -@@ -3,23 +3,29 @@ - public class BlockRail extends BlockRailBase { - private Icon theIcon; - -- protected BlockRail(int var1) { -- super(var1, false); -- } -- -- public Icon getIcon(int var1, int var2) { -- return var2 >= 6 ? this.theIcon : this.blockIcon; -- } -- -- public void registerIcons(IconRegister var1) { -- super.registerIcons(var1); -- this.theIcon = var1.registerIcon(this.getTextureName() + "_turned"); -- } -- -- protected void func_94358_a(World var1, int var2, int var3, int var4, int var5, int var6, int var7) { -- if(var7 > 0 && Block.blocksList[var7].canProvidePower() && (new BlockBaseRailLogic(this, var1, var2, var3, var4)).getNumberOfAdjacentTracks() == 3) { -- this.refreshTrackShape(var1, var2, var3, var4, false); -+ protected BlockRail(int par1) { -+ super(par1, false); -+ } -+ -+ /** -+ * From the specified side and block metadata retrieves the blocks texture. Args: side, metadata -+ */ -+ public Icon getIcon(int par1, int par2) { -+ return par2 >= 6 ? this.theIcon : this.blockIcon; -+ } -+ -+ /** -+ * When this method is called, your block should register all the icons it needs with the given IconRegister. This is -+ * the only chance you get to register icons. -+ */ -+ public void registerIcons(IconRegister par1IconRegister) { -+ super.registerIcons(par1IconRegister); -+ this.theIcon = par1IconRegister.registerIcon(this.getTextureName() + "_turned"); -+ } -+ -+ protected void func_94358_a(World par1World, int par2, int par3, int par4, int par5, int par6, int par7) { -+ if (par7 > 0 && Block.blocksList[par7].canProvidePower() && (new BlockBaseRailLogic(this, par1World, par2, par3, par4)).getNumberOfAdjacentTracks() == 3) { -+ this.refreshTrackShape(par1World, par2, par3, par4, false); - } -- - } - } ---- /dev/null -+++ com/prupe/mcpatcher/ctm/CTMUtils$TileOverrideIterator.java -@@ -1,0 +1,111 @@ -+package com.prupe.mcpatcher.ctm; -+ -+import java.util.HashSet; -+import java.util.Iterator; -+import java.util.Set; -+import net.minecraft.src.Block; -+import net.minecraft.src.Icon; -+ -+abstract class CTMUtils$TileOverrideIterator implements Iterator { -+ private final Block block; -+ private Icon currentIcon; -+ private ITileOverride[] blockOverrides; -+ private ITileOverride[] iconOverrides; -+ private final Set skipOverrides = new HashSet(); -+ private int blockPos; -+ private int iconPos; -+ private boolean foundNext; -+ private ITileOverride nextOverride; -+ private ITileOverride lastMatchedOverride; -+ -+ CTMUtils$TileOverrideIterator(Block block, Icon icon) { -+ this.block = block; -+ this.currentIcon = icon; -+ this.blockOverrides = CTMUtils.access$100()[block.blockID]; -+ this.iconOverrides = (ITileOverride[])CTMUtils.access$200().get(this.currentIcon.getIconName()); -+ } -+ -+ private void resetForNextPass() { -+ this.blockOverrides = null; -+ this.iconOverrides = (ITileOverride[])CTMUtils.access$200().get(this.currentIcon.getIconName()); -+ this.blockPos = 0; -+ this.iconPos = 0; -+ this.foundNext = false; -+ } -+ -+ public boolean hasNext() { -+ if (this.foundNext) { -+ return true; -+ } else { -+ if (this.iconOverrides != null) { -+ while (this.iconPos < this.iconOverrides.length) { -+ if (this.checkOverride(this.iconOverrides[this.iconPos++])) { -+ return true; -+ } -+ } -+ } -+ -+ if (this.blockOverrides != null) { -+ while (this.blockPos < this.blockOverrides.length) { -+ if (this.checkOverride(this.blockOverrides[this.blockPos++])) { -+ return true; -+ } -+ } -+ } -+ -+ return false; -+ } -+ } -+ -+ public ITileOverride next() { -+ if (!this.foundNext) { -+ throw new IllegalStateException("next called before hasNext() == true"); -+ } else { -+ this.foundNext = false; -+ return this.nextOverride; -+ } -+ } -+ -+ public void remove() { -+ throw new UnsupportedOperationException("remove not supported"); -+ } -+ -+ private boolean checkOverride(ITileOverride override) { -+ if (override != null && !override.isDisabled() && !this.skipOverrides.contains(override)) { -+ this.foundNext = true; -+ this.nextOverride = override; -+ return true; -+ } else { -+ return false; -+ } -+ } -+ -+ ITileOverride go() { -+ for (int pass = 0; pass < CTMUtils.access$1000(); ++pass) { -+ ITileOverride override; -+ Icon newIcon; -+ -+ do { -+ if (!this.hasNext()) { -+ return this.lastMatchedOverride; -+ } -+ -+ override = this.next(); -+ newIcon = this.getTile(override, this.block, this.currentIcon); -+ } while (newIcon == null); -+ -+ this.lastMatchedOverride = override; -+ this.skipOverrides.add(override); -+ this.currentIcon = newIcon; -+ this.resetForNextPass(); -+ } -+ -+ return this.lastMatchedOverride; -+ } -+ -+ Icon getIcon() { -+ return this.currentIcon; -+ } -+ -+ abstract Icon getTile(ITileOverride var1, Block var2, Icon var3); -+} ---- /dev/null -+++ org/spoutcraft/client/player/accessories/Accessory.java -@@ -1,0 +1,44 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.client.player.accessories; -+ -+import net.minecraft.src.EntityPlayer; -+import net.minecraft.src.ModelBiped; -+ -+public abstract class Accessory { -+ private ModelBiped model; -+ -+ public Accessory(ModelBiped model) { -+ this.model = model; -+ } -+ -+ public ModelBiped getModel() { -+ return model; -+ } -+ -+ public void render(EntityPlayer player, float f) { -+ } -+ -+ public void render(EntityPlayer player, float f, float par2) { -+ render(player, f); -+ } -+ -+ public abstract AccessoryType getType(); -+} ---- net/minecraft/src/EntityEnderCrystal.java -+++ net/minecraft/src/EntityEnderCrystal.java -@@ -1,23 +1,29 @@ - package net.minecraft.src; - - public class EntityEnderCrystal extends Entity { -+ -+ /** Used to create the rotation animation when rendering the crystal. */ - public int innerRotation; - public int health; - -- public EntityEnderCrystal(World var1) { -- super(var1); -+ public EntityEnderCrystal(World par1World) { -+ super(par1World); - this.preventEntitySpawning = true; - this.setSize(2.0F, 2.0F); - this.yOffset = this.height / 2.0F; - this.health = 5; -- this.innerRotation = this.ab.nextInt(100000); -- } -- -- public EntityEnderCrystal(World var1, double var2, double var4, double var6) { -- this(var1); -- this.setPosition(var2, var4, var6); -- } -- -+ this.innerRotation = this.rand.nextInt(100000); -+ } -+ -+ public EntityEnderCrystal(World par1World, double par2, double par4, double par6) { -+ this(par1World); -+ this.setPosition(par2, par4, par6); -+ } -+ -+ /** -+ * returns if this entity triggers Block.onEntityWalking on the blocks they walk on. used for spiders and wolves to -+ * prevent them from trampling crops -+ */ - protected boolean canTriggerWalking() { - return false; - } -@@ -26,6 +32,9 @@ - this.dataWatcher.addObject(8, Integer.valueOf(this.health)); - } - -+ /** -+ * Called to update the entity's position/logic. -+ */ - public void onUpdate() { - this.prevPosX = this.posX; - this.prevPosY = this.posY; -@@ -35,35 +44,47 @@ - int var1 = MathHelper.floor_double(this.posX); - int var2 = MathHelper.floor_double(this.posY); - int var3 = MathHelper.floor_double(this.posZ); -- if(this.worldObj.getBlockId(var1, var2, var3) != Block.fire.blockID) { -+ -+ if (this.worldObj.getBlockId(var1, var2, var3) != Block.fire.blockID) { - this.worldObj.setBlock(var1, var2, var3, Block.fire.blockID); - } -- -- } -- -- protected void writeEntityToNBT(NBTTagCompound var1) { -- } -- -- protected void readEntityFromNBT(NBTTagCompound var1) { -- } -+ } -+ -+ /** -+ * (abstract) Protected helper method to write subclass entity data to NBT. -+ */ -+ protected void writeEntityToNBT(NBTTagCompound par1NBTTagCompound) {} -+ -+ /** -+ * (abstract) Protected helper method to read subclass entity data from NBT. -+ */ -+ protected void readEntityFromNBT(NBTTagCompound par1NBTTagCompound) {} - - public float getShadowSize() { - return 0.0F; - } - -+ /** -+ * Returns true if other Entities should be prevented from moving through this Entity. -+ */ - public boolean canBeCollidedWith() { - return true; - } - -- public boolean attackEntityFrom(DamageSource var1, float var2) { -- if(this.isEntityInvulnerable()) { -+ /** -+ * Called when the entity is attacked. -+ */ -+ public boolean attackEntityFrom(DamageSource par1DamageSource, float par2) { -+ if (this.isEntityInvulnerable()) { - return false; - } else { -- if(!this.isDead && !this.worldObj.isRemote) { -+ if (!this.isDead && !this.worldObj.isRemote) { - this.health = 0; -- if(this.health <= 0) { -+ -+ if (this.health <= 0) { - this.setDead(); -- if(!this.worldObj.isRemote) { -+ -+ if (!this.worldObj.isRemote) { - this.worldObj.createExplosion((Entity)null, this.posX, this.posY, this.posZ, 6.0F, true); - } - } ---- net/minecraft/src/ItemEnderPearl.java -+++ net/minecraft/src/ItemEnderPearl.java -@@ -1,23 +1,27 @@ - package net.minecraft.src; - - public class ItemEnderPearl extends Item { -- public ItemEnderPearl(int var1) { -- super(var1); -+ public ItemEnderPearl(int par1) { -+ super(par1); - this.maxStackSize = 16; - this.setCreativeTab(CreativeTabs.tabMisc); - } - -- public ItemStack onItemRightClick(ItemStack var1, World var2, EntityPlayer var3) { -- if(var3.capabilities.isCreativeMode) { -- return var1; -+ /** -+ * Called whenever this item is equipped and the right mouse button is pressed. Args: itemStack, world, entityPlayer -+ */ -+ public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) { -+ if (par3EntityPlayer.capabilities.isCreativeMode) { -+ return par1ItemStack; - } else { -- --var1.stackSize; -- var2.playSoundAtEntity(var3, "random.bow", 0.5F, 0.4F / (f.nextFloat() * 0.4F + 0.8F)); -- if(!var2.isRemote) { -- var2.spawnEntityInWorld(new EntityEnderPearl(var2, var3)); -+ --par1ItemStack.stackSize; -+ par2World.playSoundAtEntity(par3EntityPlayer, "random.bow", 0.5F, 0.4F / (itemRand.nextFloat() * 0.4F + 0.8F)); -+ -+ if (!par2World.isRemote) { -+ par2World.spawnEntityInWorld(new EntityEnderPearl(par2World, par3EntityPlayer)); - } - -- return var1; -+ return par1ItemStack; - } - } - } ---- /dev/null -+++ org/spoutcraft/client/special/YAMLResource.java -@@ -1,0 +1,27 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.client.special; -+ -+import org.bukkit.util.config.Configuration; -+ -+public interface YAMLResource { -+ public Configuration getYAML(); -+ public boolean updateYAML(); -+} ---- net/minecraft/src/BlockEnderChest.java -+++ net/minecraft/src/BlockEnderChest.java -@@ -3,69 +3,96 @@ - import java.util.Random; - - public class BlockEnderChest extends BlockContainer { -- protected BlockEnderChest(int var1) { -- super(var1, Material.rock); -+ protected BlockEnderChest(int par1) { -+ super(par1, Material.rock); - this.setCreativeTab(CreativeTabs.tabDecorations); -- this.setBlockBounds(1.0F / 16.0F, 0.0F, 1.0F / 16.0F, 15.0F / 16.0F, 14.0F / 16.0F, 15.0F / 16.0F); -+ this.setBlockBounds(0.0625F, 0.0F, 0.0625F, 0.9375F, 0.875F, 0.9375F); - } - -+ /** -+ * Is this block (a) opaque and (b) a full 1m cube? This determines whether or not to render the shared face of two -+ * adjacent blocks and also whether the player can attach torches, redstone wire, etc to this block. -+ */ - public boolean isOpaqueCube() { - return false; - } - -+ /** -+ * If this block doesn't render as an ordinary block it will return False (examples: signs, buttons, stairs, etc) -+ */ - public boolean renderAsNormalBlock() { - return false; - } - -+ /** -+ * The type of render function that is called for this block -+ */ - public int getRenderType() { - return 22; - } - -- public int idDropped(int var1, Random var2, int var3) { -+ /** -+ * Returns the ID of the items to drop on destruction. -+ */ -+ public int idDropped(int par1, Random par2Random, int par3) { - return Block.obsidian.blockID; - } - -- public int quantityDropped(Random var1) { -+ /** -+ * Returns the quantity of items to drop on block destruction. -+ */ -+ public int quantityDropped(Random par1Random) { - return 8; - } - -+ /** -+ * Return true if a player with Silk Touch can harvest this block directly, and not its normal drops. -+ */ - protected boolean canSilkHarvest() { - return true; - } - -- public void onBlockPlacedBy(World var1, int var2, int var3, int var4, EntityLivingBase var5, ItemStack var6) { -+ /** -+ * Called when the block is placed in the world. -+ */ -+ public void onBlockPlacedBy(World par1World, int par2, int par3, int par4, EntityLivingBase par5EntityLivingBase, ItemStack par6ItemStack) { - byte var7 = 0; -- int var8 = MathHelper.floor_double((double)(var5.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3; -- if(var8 == 0) { -+ int var8 = MathHelper.floor_double((double)(par5EntityLivingBase.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3; -+ -+ if (var8 == 0) { - var7 = 2; - } - -- if(var8 == 1) { -+ if (var8 == 1) { - var7 = 5; - } - -- if(var8 == 2) { -+ if (var8 == 2) { - var7 = 3; - } - -- if(var8 == 3) { -+ if (var8 == 3) { - var7 = 4; - } - -- var1.setBlockMetadata(var2, var3, var4, var7, 2); -+ par1World.setBlockMetadataWithNotify(par2, par3, par4, var7, 2); - } - -- public boolean onBlockActivated(World var1, int var2, int var3, int var4, EntityPlayer var5, int var6, float var7, float var8, float var9) { -- InventoryEnderChest var10 = var5.getInventoryEnderChest(); -- TileEntityEnderChest var11 = (TileEntityEnderChest)var1.getBlockTileEntity(var2, var3, var4); -- if(var10 != null && var11 != null) { -- if(var1.isBlockNormalCube(var2, var3 + 1, var4)) { -+ /** -+ * Called upon block activation (right click on the block.) -+ */ -+ public boolean onBlockActivated(World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer, int par6, float par7, float par8, float par9) { -+ InventoryEnderChest var10 = par5EntityPlayer.getInventoryEnderChest(); -+ TileEntityEnderChest var11 = (TileEntityEnderChest)par1World.getBlockTileEntity(par2, par3, par4); -+ -+ if (var10 != null && var11 != null) { -+ if (par1World.isBlockNormalCube(par2, par3 + 1, par4)) { - return true; -- } else if(var1.isRemote) { -+ } else if (par1World.isRemote) { - return true; - } else { - var10.setAssociatedChest(var11); -- var5.displayGUIChest(var10); -+ par5EntityPlayer.displayGUIChest(var10); - return true; - } - } else { -@@ -73,33 +100,42 @@ - } - } - -- public TileEntity createNewTileEntity(World var1) { -+ /** -+ * Returns a new instance of a block's tile entity class. Called on placing the block. -+ */ -+ public TileEntity createNewTileEntity(World par1World) { - return new TileEntityEnderChest(); - } - -- public void randomDisplayTick(World var1, int var2, int var3, int var4, Random var5) { -- for(int var6 = 0; var6 < 3; ++var6) { -- double var10000 = (double)((float)var2 + var5.nextFloat()); -- double var9 = (double)((float)var3 + var5.nextFloat()); -- var10000 = (double)((float)var4 + var5.nextFloat()); -+ /** -+ * A randomly called display update to be able to add particles or other items for display -+ */ -+ public void randomDisplayTick(World par1World, int par2, int par3, int par4, Random par5Random) { -+ for (int var6 = 0; var6 < 3; ++var6) { -+ double var10000 = (double)((float)par2 + par5Random.nextFloat()); -+ double var9 = (double)((float)par3 + par5Random.nextFloat()); -+ var10000 = (double)((float)par4 + par5Random.nextFloat()); - double var13 = 0.0D; - double var15 = 0.0D; - double var17 = 0.0D; -- int var19 = var5.nextInt(2) * 2 - 1; -- int var20 = var5.nextInt(2) * 2 - 1; -- var13 = ((double)var5.nextFloat() - 0.5D) * 0.125D; -- var15 = ((double)var5.nextFloat() - 0.5D) * 0.125D; -- var17 = ((double)var5.nextFloat() - 0.5D) * 0.125D; -- double var11 = (double)var4 + 0.5D + 0.25D * (double)var20; -- var17 = (double)(var5.nextFloat() * 1.0F * (float)var20); -- double var7 = (double)var2 + 0.5D + 0.25D * (double)var19; -- var13 = (double)(var5.nextFloat() * 1.0F * (float)var19); -- var1.spawnParticle("portal", var7, var9, var11, var13, var15, var17); -+ int var19 = par5Random.nextInt(2) * 2 - 1; -+ int var20 = par5Random.nextInt(2) * 2 - 1; -+ var13 = ((double)par5Random.nextFloat() - 0.5D) * 0.125D; -+ var15 = ((double)par5Random.nextFloat() - 0.5D) * 0.125D; -+ var17 = ((double)par5Random.nextFloat() - 0.5D) * 0.125D; -+ double var11 = (double)par4 + 0.5D + 0.25D * (double)var20; -+ var17 = (double)(par5Random.nextFloat() * 1.0F * (float)var20); -+ double var7 = (double)par2 + 0.5D + 0.25D * (double)var19; -+ var13 = (double)(par5Random.nextFloat() * 1.0F * (float)var19); -+ par1World.spawnParticle("portal", var7, var9, var11, var13, var15, var17); - } -- - } - -- public void registerIcons(IconRegister var1) { -- this.blockIcon = var1.registerIcon("obsidian"); -+ /** -+ * When this method is called, your block should register all the icons it needs with the given IconRegister. This is -+ * the only chance you get to register icons. -+ */ -+ public void registerIcons(IconRegister par1IconRegister) { -+ this.blockIcon = par1IconRegister.registerIcon("obsidian"); - } - } ---- net/minecraft/src/GuiEditSign.java -+++ net/minecraft/src/GuiEditSign.java -@@ -3,97 +3,222 @@ - import org.lwjgl.input.Keyboard; - import org.lwjgl.opengl.GL11; - -+import org.bukkit.ChatColor; -+ -+import org.spoutcraft.api.Spoutcraft; -+ - public class GuiEditSign extends GuiScreen { -- private static final String b = ChatAllowedCharacters.a; -- protected String a = "Edit sign message:"; -+ -+ /** -+ * This String is just a local copy of the characters allowed in text rendering of minecraft. -+ */ -+ private static final String allowedCharacters = ChatAllowedCharacters.allowedCharacters; -+ -+ /** The title string that is displayed in the top-center of the screen. */ -+ protected String screenTitle = "Edit sign message:"; -+ -+ /** Reference to the sign object. */ - private TileEntitySign entitySign; -+ -+ /** Counts the number of screen updates. */ - private int updateCounter; -+ -+ /** The number of the line that is being edited. */ - private int editLine; -+ -+ /** "Done" button for the GUI. */ - private GuiButton doneBtn; - -- public GuiEditSign(TileEntitySign var1) { -- this.entitySign = var1; -+ // Spout Start -+ private int editColumn; -+ // Spout End -+ -+ public GuiEditSign(TileEntitySign par1TileEntitySign) { -+ this.entitySign = par1TileEntitySign; - } - -+ /** -+ * Adds the buttons (and other controls) to the screen in question. -+ */ - public void initGui() { -- this.i.clear(); -+ this.buttonList.clear(); - Keyboard.enableRepeatEvents(true); -- this.i.add(this.doneBtn = new GuiButton(0, this.width / 2 - 100, this.height / 4 + 120, "Done")); -+ this.buttonList.add(this.doneBtn = new GuiButton(0, this.width / 2 - 100, this.height / 4 + 120, "Done")); - this.entitySign.setEditable(false); - } - -+ /** -+ * Called when the screen is unloaded. Used to disable keyboard repeat events -+ */ - public void onGuiClosed() { -+ // Spout Start -+ entitySign.lineBeingEdited = -1; -+ entitySign.columnBeingEdited = -1; -+ entitySign.recalculateText(); -+ // Colorize text -+ if (sendAsUnicode()) { -+ for (int i = 0; i < entitySign.signText.length; i++) { -+ if (entitySign.signText[i] != null) -+ entitySign.signText[i] = entitySign.signText[i].replaceAll("(&([a-fA-F0-9]))", "\u00A7$2"); -+ } -+ } -+ // Spout End - Keyboard.enableRepeatEvents(false); - NetClientHandler var1 = this.mc.getNetHandler(); -- if(var1 != null) { -- var1.addToSendQueue(new Packet130UpdateSign(this.entitySign.xCoord, this.entitySign.yCoord, this.entitySign.zCoord, this.entitySign.a)); -+ -+ if (var1 != null) { -+ var1.addToSendQueue(new Packet130UpdateSign(this.entitySign.xCoord, this.entitySign.yCoord, this.entitySign.zCoord, this.entitySign.signText)); - } - - this.entitySign.setEditable(true); - } - -+ /** -+ * Called from the main game loop to update the screen. -+ */ - public void updateScreen() { - ++this.updateCounter; - } - -- protected void actionPerformed(GuiButton var1) { -- if(var1.enabled) { -- if(var1.id == 0) { -+ /** -+ * Fired when a control is clicked. This is the equivalent of ActionListener.actionPerformed(ActionEvent e). -+ */ -+ protected void actionPerformed(GuiButton par1GuiButton) { -+ if (par1GuiButton.enabled) { -+ if (par1GuiButton.id == 0) { -+ // Spout Start -+ if (!Spoutcraft.hasPermission("spout.plugin.signcolors")) { -+ for (int i = 0; i < entitySign.signText.length; i++) { -+ entitySign.signText[i] = ChatColor.stripColor(entitySign.signText[i]); -+ } -+ } -+ // Spout End - this.entitySign.onInventoryChanged(); - this.mc.displayGuiScreen((GuiScreen)null); - } -- - } - } - -- protected void keyTyped(char var1, int var2) { -- if(var2 == 200) { -+ /** -+ * Fired when a key is typed. This is the equivalent of KeyListener.keyTyped(KeyEvent e). -+ */ -+ // Spout Start - Rewritten Method -+ protected void keyTyped(char par1, int par2) { -+ if (par2 == 200) { // Up - this.editLine = this.editLine - 1 & 3; -+ editColumn = entitySign.signText[editLine].length(); - } - -- if(var2 == 208 || var2 == 28 || var2 == 156) { -+ if (par2 == 208 || par2 == 28 || par2 == 156) { // Down - this.editLine = this.editLine + 1 & 3; -- } -- -- if(var2 == 14 && this.entitySign.a[this.editLine].length() > 0) { -- this.entitySign.a[this.editLine] = this.entitySign.a[this.editLine].substring(0, this.entitySign.a[this.editLine].length() - 1); -- } -- -- if(b.indexOf(var1) >= 0 && this.entitySign.a[this.editLine].length() < 15) { -- this.entitySign.a[this.editLine] = this.entitySign.a[this.editLine] + var1; -- } -- -- if(var2 == 1) { -- this.actionPerformed(this.doneBtn); -- } -- -+ editColumn = entitySign.signText[editLine].length(); -+ } -+ -+ if (par2 == 205) { // Right -+ editColumn++; -+ if (editColumn > entitySign.signText[editLine].length()) { -+ editColumn--; -+ } -+ } -+ -+ if (par2 == 203) {// Left -+ editColumn--; -+ if (editColumn < 0) { -+ editColumn = 0; -+ } -+ } -+ -+ if (par2 == 14 && this.entitySign.signText[this.editLine].length() > 0) { // Backspace -+ String line = entitySign.signText[editLine]; -+ int endColumnStart = Math.min(editColumn, line.length()); -+ String before = ""; -+ if (endColumnStart > 0) { -+ before = line.substring(0, endColumnStart); -+ } -+ String after = ""; -+ if (line.length() - editColumn > 0) { -+ after = line.substring(editColumn, line.length()); -+ } -+ if (before.length() > 0) { -+ before = before.substring(0, before.length() - 1); -+ line = before + after; -+ entitySign.signText[editLine] = line; -+ endColumnStart--; -+ editColumn = endColumnStart; -+ if (editColumn < 0) { -+ editColumn = 0; -+ } -+ } -+ } -+ -+ if ((allowedCharacters.indexOf(par1) > -1 || par1 > 32) && this.entitySign.signText[this.editLine].length() < 15) { // Enter -+ String line = entitySign.signText[editLine]; -+ -+ // Prevent out of bounds on the substring call -+ int endColumnStart = Math.min(editColumn, line.length()); -+ String before = ""; -+ if (endColumnStart > 0) { -+ before = line.substring(0, endColumnStart); -+ } -+ String after = ""; -+ if (line.length() - endColumnStart > 0) { -+ after = line.substring(endColumnStart, line.length()); -+ } -+ before += par1; -+ line = before + after; -+ entitySign.signText[editLine] = line; -+ endColumnStart++; -+ editColumn = endColumnStart; -+ } -+ -+ if (par2 == 211) { // Delete -+ String line = entitySign.signText[editLine]; -+ String before = line.substring(0, editColumn); -+ String after = ""; -+ if (line.length() - editColumn > 0) { -+ after = line.substring(editColumn, line.length()); -+ } -+ if (after.length() > 0) { -+ after = after.substring(1, after.length()); -+ line = before + after; -+ entitySign.signText[editLine] = line; -+ } -+ } -+ -+ entitySign.recalculateText(); - } -+ // Spout End - -- public void drawScreen(int var1, int var2, float var3) { -+ /** -+ * Draws the screen and all the components in it. -+ */ -+ public void drawScreen(int par1, int par2, float par3) { - this.drawDefaultBackground(); -- this.drawCenteredString(this.fontRenderer, this.a, this.width / 2, 40, 16777215); -+ this.drawCenteredString(this.fontRenderer, this.screenTitle, this.width / 2, 40, 16777215); - GL11.glPushMatrix(); - GL11.glTranslatef((float)(this.width / 2), 0.0F, 50.0F); - float var4 = 93.75F; - GL11.glScalef(-var4, -var4, -var4); - GL11.glRotatef(180.0F, 0.0F, 1.0F, 0.0F); - Block var5 = this.entitySign.getBlockType(); -- if(var5 == Block.signPost) { -+ -+ if (var5 == Block.signPost) { - float var6 = (float)(this.entitySign.getBlockMetadata() * 360) / 16.0F; - GL11.glRotatef(var6, 0.0F, 1.0F, 0.0F); - GL11.glTranslatef(0.0F, -1.0625F, 0.0F); - } else { - int var8 = this.entitySign.getBlockMetadata(); - float var7 = 0.0F; -- if(var8 == 2) { -+ -+ if (var8 == 2) { - var7 = 180.0F; - } - -- if(var8 == 4) { -+ if (var8 == 4) { - var7 = 90.0F; - } - -- if(var8 == 5) { -+ if (var8 == 5) { - var7 = -90.0F; - } - -@@ -101,13 +226,25 @@ - GL11.glTranslatef(0.0F, -1.0625F, 0.0F); - } - -- if(this.updateCounter / 6 % 2 == 0) { -- this.entitySign.lineBeingEdited = this.editLine; -- } -+ // Spout Start -+ //if(this.updateCounter / 6 % 2 == 0) { -+ this.entitySign.lineBeingEdited = this.editLine; -+ entitySign.columnBeingEdited = editColumn; -+ //} -+ // Spout End - - TileEntityRenderer.instance.renderTileEntityAt(this.entitySign, -0.5D, -0.75D, -0.5D, 0.0F); - this.entitySign.lineBeingEdited = -1; -+ // Spout Start -+ entitySign.columnBeingEdited = -1; -+ // Spout End - GL11.glPopMatrix(); -- super.drawScreen(var1, var2, var3); -- } -+ super.drawScreen(par1, par2, par3); -+ } -+ -+ // Spout Start -+ public boolean sendAsUnicode() { -+ return !this.mc.theWorld.isRemote; -+ } -+ // Spout End - } ---- /dev/null -+++ org/spoutcraft/client/gui/minimap/DeathpointsCheckBox.java -@@ -1,0 +1,35 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.client.gui.minimap; -+ -+import org.spoutcraft.api.gui.GenericCheckBox; -+ -+public class DeathpointsCheckBox extends GenericCheckBox { -+ public DeathpointsCheckBox() { -+ super("Deathpoints"); -+ setChecked(MinimapConfig.getInstance().isDeathpoints()); -+ setTooltip("Deathpoints\nAdd waypoints to the map every time you die, with\na timestamp of when you died. Deathpoints can\n be removed and altered like regular waypoints."); -+ } -+ -+ @Override -+ public void onButtonClick() { -+ MinimapConfig.getInstance().setDeathpoints(isChecked()); -+ } -+} ---- /dev/null -+++ org/spoutcraft/client/gui/MCRenderDelegate.java -@@ -1,0 +1,973 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.client.gui; -+ -+import java.nio.IntBuffer; -+import java.util.HashMap; -+import java.util.Iterator; -+import java.util.UUID; -+ -+import gnu.trove.map.TObjectIntMap; -+import gnu.trove.map.hash.TIntObjectHashMap; -+import gnu.trove.map.hash.TObjectIntHashMap; -+import org.apache.commons.lang3.builder.HashCodeBuilder; -+ -+import org.lwjgl.opengl.ContextCapabilities; -+import org.lwjgl.opengl.EXTFramebufferObject; -+import org.lwjgl.opengl.GL11; -+import org.lwjgl.opengl.GL12; -+import org.lwjgl.opengl.GL14; -+import org.lwjgl.opengl.GL30; -+import org.lwjgl.opengl.GLContext; -+import org.newdawn.slick.opengl.Texture; -+ -+import net.minecraft.src.Minecraft; -+import net.minecraft.src.Entity; -+import net.minecraft.src.FontRenderer; -+import net.minecraft.src.FoodStats; -+import net.minecraft.src.GuiButton; -+import net.minecraft.src.GuiIngame; -+import net.minecraft.src.Material; -+import net.minecraft.src.Potion; -+import net.minecraft.src.ResourceLocation; -+import net.minecraft.src.RenderHelper; -+import net.minecraft.src.RenderManager; -+import net.minecraft.src.ScaledResolution; -+import net.minecraft.src.Tessellator; -+ -+import org.spoutcraft.api.gui.ArmorBar; -+import org.spoutcraft.api.gui.BubbleBar; -+import org.spoutcraft.api.gui.Button; -+import org.spoutcraft.api.gui.Color; -+import org.spoutcraft.api.gui.Control; -+import org.spoutcraft.api.gui.ExpBar; -+import org.spoutcraft.api.gui.GenericBitmap; -+import org.spoutcraft.api.gui.GenericButton; -+import org.spoutcraft.api.gui.GenericCheckBox; -+import org.spoutcraft.api.gui.GenericComboBox; -+import org.spoutcraft.api.gui.GenericEntityWidget; -+import org.spoutcraft.api.gui.GenericGradient; -+import org.spoutcraft.api.gui.GenericItemWidget; -+import org.spoutcraft.api.gui.GenericLabel; -+import org.spoutcraft.api.gui.GenericListWidget; -+import org.spoutcraft.api.gui.GenericListWidgetItem; -+import org.spoutcraft.api.gui.GenericRadioButton; -+import org.spoutcraft.api.gui.GenericScrollArea; -+import org.spoutcraft.api.gui.GenericScrollable; -+import org.spoutcraft.api.gui.GenericSlider; -+import org.spoutcraft.api.gui.GenericSlot; -+import org.spoutcraft.api.gui.GenericTextField; -+import org.spoutcraft.api.gui.GenericTexture; -+import org.spoutcraft.api.gui.HealthBar; -+import org.spoutcraft.api.gui.HungerBar; -+import org.spoutcraft.api.gui.ListWidgetItem; -+import org.spoutcraft.api.gui.MinecraftFont; -+import org.spoutcraft.api.gui.MinecraftTessellator; -+import org.spoutcraft.api.gui.Orientation; -+import org.spoutcraft.api.gui.RenderDelegate; -+import org.spoutcraft.api.gui.RenderPriority; -+import org.spoutcraft.api.gui.RenderUtil; -+import org.spoutcraft.api.gui.Widget; -+import org.spoutcraft.api.gui.WidgetAnchor; -+import org.spoutcraft.api.inventory.ItemStack; -+import org.spoutcraft.api.material.MaterialData; -+import org.spoutcraft.client.SpoutClient; -+import org.spoutcraft.client.io.CustomTextureManager; -+import org.spoutcraft.client.io.FileUtil; -+ -+public class MCRenderDelegate implements RenderDelegate { -+ private Color scrollBarColor = new Color(0.26F, 0.26F, 0.26F, 0.33F); -+ private Color scrollBarColor2 = new Color(0.1F, 0.1F, 0.1F, 0.38F); -+ public static boolean shouldRenderCursor = false; -+ protected final RenderItemCustom renderer; -+ protected HashMap customFields = new HashMap(); -+ protected TObjectIntMap bitmapId = new TObjectIntHashMap(); -+ MinecraftFont font = new MinecraftFontWrapper(); -+ MinecraftTessellator tessellator = new MinecraftTessellatorWrapper(); -+ TIntObjectHashMap optimalWidth = new TIntObjectHashMap(); -+ -+ public MCRenderDelegate() { -+ renderer = new RenderItemCustom(); -+ renderer.setRenderManager(RenderManager.instance); -+ } -+ -+ public void downloadTexture(String plugin, String url) { -+ CustomTextureManager.downloadTexture(plugin, url); -+ } -+ -+ public int getScreenHeight() { -+ ScaledResolution resolution = new ScaledResolution(SpoutClient.getHandle().gameSettings, SpoutClient.getHandle().displayWidth, SpoutClient.getHandle().displayHeight); -+ return resolution.getScaledHeight(); -+ } -+ -+ public int getScreenWidth() { -+ ScaledResolution resolution = new ScaledResolution(SpoutClient.getHandle().gameSettings, SpoutClient.getHandle().displayWidth, SpoutClient.getHandle().displayHeight); -+ return resolution.getScaledWidth(); -+ } -+ -+ public int getTextWidth(String text) { -+ return Minecraft.getMinecraft().fontRenderer.getStringWidth(text); -+ } -+ -+ public void render(ArmorBar bar) { -+ float armorPercent = Minecraft.getMinecraft().thePlayer.inventory.getTotalArmorValue() / 0.2f; -+ if (bar.isVisible() && bar.getMaxNumShields() > 0) { -+ int y = (int) bar.getScreenY(); -+ float armorPercentPerIcon = 100f / bar.getMaxNumShields(); -+ for (int icon = 0; icon < bar.getMaxNumShields(); icon++) { -+ if (armorPercent > 0 || bar.isAlwaysVisible()) { -+ int x = (int) bar.getScreenX() + icon * bar.getIconOffset(); -+ boolean full = (icon + 1) * armorPercentPerIcon <= armorPercent; -+ boolean half = (icon + 1) * armorPercentPerIcon < armorPercent + armorPercentPerIcon; -+ if (full) { // White armor (filled in) -+ RenderUtil.drawTexturedModalRectangle(x, y, 34, 9, 9, 9, 0f); -+ } else if (half) { // Half filled in -+ RenderUtil.drawTexturedModalRectangle(x, y, 25, 9, 9, 9, 0f); -+ } else { -+ RenderUtil.drawTexturedModalRectangle(x, y, 16, 9, 9, 9, 0f); -+ } -+ } -+ } -+ } -+ } -+ -+ public void render(BubbleBar bar) { -+ if (Minecraft.getMinecraft().thePlayer.isInsideOfMaterial(Material.water)) { -+ int bubbles = (int) Math.ceil(((double) (Minecraft.getMinecraft().thePlayer.getAir() - 2) * bar.getMaxNumBubbles()) / (Minecraft.getMinecraft().thePlayer.maxAir)); -+ int poppingBubbles = (int) Math.ceil(((double) Minecraft.getMinecraft().thePlayer.getAir() * bar.getMaxNumBubbles()) / (Minecraft.getMinecraft().thePlayer.maxAir)) - bubbles; -+ if (bar.isVisible()) { -+ for (int bubble = 0; bubble < bubbles + poppingBubbles; bubble++) { -+ if (bubble < bubbles) { -+ RenderUtil.drawTexturedModalRectangle((int) bar.getScreenX() - bubble * bar.getIconOffset(), (int) bar.getScreenY(), 16, 18, 9, 9, 0f); -+ } else { -+ RenderUtil.drawTexturedModalRectangle((int) bar.getScreenX() - bubble * bar.getIconOffset(), (int) bar.getScreenY(), 25, 18, 9, 9, 0f); -+ } -+ } -+ } -+ } -+ } -+ -+ public void render(GenericButton button) { -+ if (button.isVisible()) { -+ FontRenderer font = Minecraft.getMinecraft().fontRenderer; -+ Minecraft.getMinecraft().renderEngine.bindTexture(new ResourceLocation("textures/gui/widgets.png")); -+ GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); -+ GL11.glTranslatef((float) Math.floor(button.getScreenX()), (float) Math.floor(button.getScreenY()), 0); -+ float width = (float) (button.getWidth() < 200 ? button.getWidth() : 200); -+ GL11.glScalef((float) button.getWidth() / width, (float) button.getHeight() / 20f, 1); -+ -+ String text = getFittingText(button.getText(), (int) button.getInnerWidth()); -+ -+ int hoverState = getHoverState(button, isHovering(button)); -+ RenderUtil.drawTexturedModalRectangle(0, 0, 0, 46 + hoverState * 20, (int) Math.ceil(width / 2), 20, 0f); -+ RenderUtil.drawTexturedModalRectangle((int) Math.floor(width / 2), 0, 200 - (int) Math.ceil(width / 2), 46 + hoverState * 20, (int) Math.ceil(width / 2), 20, 0f); -+ Color color = getColor(button); -+ -+ int left = 5; -+ WidgetAnchor align = button.getAlign(); -+ if (align == WidgetAnchor.TOP_CENTER || align == WidgetAnchor.CENTER_CENTER || align == WidgetAnchor.BOTTOM_CENTER) { -+ left = (int) ((width / 2) - (font.getStringWidth(text) / 2)); -+ } else if (align == WidgetAnchor.TOP_RIGHT || align == WidgetAnchor.CENTER_RIGHT || align == WidgetAnchor.BOTTOM_RIGHT) { -+ left = (int) (width - font.getStringWidth(text)) - 5; -+ } -+ -+ GL11.glPushMatrix(); -+ float scale = button.getScale(); -+ GL11.glScalef(scale, scale, scale); -+ font.drawStringWithShadow(text, left, 6, color.toInt()); -+ GL11.glPopMatrix(); -+ } -+ } -+ -+ protected boolean isHovering(Widget widget) { -+ double mouseX = widget.getScreen().getMouseX(); -+ double mouseY = widget.getScreen().getMouseY(); -+ -+ boolean hovering = mouseX >= widget.getActualX() && mouseY >= widget.getActualY() && mouseX < widget.getActualX() + widget.getWidth() && mouseY < widget.getActualY() + widget.getHeight(); -+ return hovering; -+ } -+ -+ protected int getHoverState(Control control, boolean hover) { -+ int state = 1; -+ if (!control.isEnabled()) { -+ state = 0; -+ } else if (hover) { -+ state = 2; -+ } -+ -+ return state; -+ } -+ -+ public void render(GenericGradient gradient) { -+ GL11.glDisable(GL11.GL_TEXTURE_2D); -+ GL11.glEnable(GL11.GL_BLEND); -+ GL11.glDisable(GL11.GL_ALPHA_TEST); -+ GL11.glBlendFunc(770, 771); -+ GL11.glShadeModel(GL11.GL_SMOOTH); -+ Tessellator tessellator = Tessellator.instance; -+ tessellator.startDrawingQuads(); -+ boolean VERT = gradient.getOrientation() == Orientation.VERTICAL; -+ tessellator.setColorRGBA_F(gradient.getTopColor().getRedF(), gradient.getTopColor().getGreenF(), gradient.getTopColor().getBlueF(), gradient.getTopColor().getAlphaF()); -+ tessellator.addVertex((VERT ? gradient.getWidth() : 0) + gradient.getScreenX(), (VERT ? 0 : gradient.getHeight()) + gradient.getScreenY(), 0.0D); -+ tessellator.addVertex(gradient.getScreenX(), gradient.getScreenY(), 0.0D); -+ tessellator.setColorRGBA_F(gradient.getBottomColor().getRedF(), gradient.getBottomColor().getGreenF(), gradient.getBottomColor().getBlueF(), gradient.getBottomColor().getAlphaF()); -+ tessellator.addVertex((VERT ? 0 : gradient.getWidth()) + gradient.getScreenX(), (VERT ? gradient.getHeight() : 0) + gradient.getScreenY(), 0.0D); -+ tessellator.addVertex(gradient.getWidth() + gradient.getScreenX(), gradient.getHeight() + gradient.getScreenY(), 0.0D); -+ tessellator.draw(); -+ GL11.glShadeModel(GL11.GL_FLAT); -+ GL11.glDisable(GL11.GL_BLEND); -+ GL11.glEnable(GL11.GL_ALPHA_TEST); -+ GL11.glEnable(GL11.GL_TEXTURE_2D); -+ } -+ -+ public void render(GenericItemWidget item) { -+ GL11.glDepthFunc(515); -+ RenderHelper.enableGUIStandardItemLighting(); -+ GL11.glDisable(GL11.GL_DEPTH_TEST); -+ GL11.glEnable(GL11.GL_TEXTURE_2D); -+ GL11.glEnable(GL11.GL_COLOR_MATERIAL); -+ GL11.glPushMatrix(); -+ GL11.glTranslatef((float) item.getScreenX(), (float) item.getScreenY(), 0); -+ if (item.getAnchor() == WidgetAnchor.SCALE) { -+ GL11.glScalef((float) (item.getScreen().getWidth() / 427f), (float) (item.getScreen().getHeight() / 240f), 1); -+ } -+ GL11.glScaled(item.getWidth() / 16D, item.getHeight() / 16D, 1); -+ int id = item.getTypeId(); -+ int data = item.getData(); -+ if (MaterialData.getCustomItem(id) != null) { -+ int temp = id; -+ id = 318; -+ data = temp; -+ } -+ GL11.glColor4f(1.0f, 1.0f, 1.0f, 1.0f); -+ renderer.renderItemIntoGUI(SpoutClient.getHandle().fontRenderer, SpoutClient.getHandle().renderEngine, new net.minecraft.src.ItemStack(id, 1, data), 0, 0); -+ GL11.glPopMatrix(); -+ GL11.glScaled(16D / item.getWidth(), 16D / item.getHeight(), 1); -+ GL11.glEnable(GL11.GL_DEPTH_TEST); -+ RenderHelper.disableStandardItemLighting(); -+ } -+ -+ public void render(GenericLabel label) { -+ FontRenderer font = SpoutClient.getHandle().fontRenderer; -+ String lines[] = label.getLines(); -+ -+ double swidth = label.getTextWidth(); -+ double sheight = label.getTextHeight(); -+ -+ GL11.glPushMatrix(); -+ -+ double top = label.getScreenY(); -+ -+ WidgetAnchor align = label.getAlign(); -+ if (align == WidgetAnchor.CENTER_LEFT || align == WidgetAnchor.CENTER_CENTER || align == WidgetAnchor.CENTER_RIGHT) { -+ top -= (int) (label.isAuto() ? label.getActualHeight() : label.getHeight()) / 2; -+ } else if (align == WidgetAnchor.BOTTOM_LEFT || align == WidgetAnchor.BOTTOM_CENTER || align == WidgetAnchor.BOTTOM_RIGHT) { -+ top -= (int) (label.isAuto() ? label.getActualHeight() : label.getHeight()); -+ } -+ -+ double aleft = label.getScreenX(); -+ if (align == WidgetAnchor.TOP_CENTER || align == WidgetAnchor.CENTER_CENTER || align == WidgetAnchor.BOTTOM_CENTER) { -+ aleft -= (int) (label.isAuto() ? label.getActualWidth() : label.getWidth()) / 2; -+ } else if (align == WidgetAnchor.TOP_RIGHT || align == WidgetAnchor.CENTER_RIGHT || align == WidgetAnchor.BOTTOM_RIGHT) { -+ aleft -= (int) (label.isAuto() ? label.getActualWidth() : label.getWidth()); -+ } -+ -+ GL11.glTranslatef((float) Math.floor(aleft), (float) Math.floor(top), 0); -+ if (!label.isAuto()) { -+ GL11.glScalef((float) (label.getWidth() / swidth), (float) (label.getHeight() / sheight), 1); -+ } else if (label.getAnchor() == WidgetAnchor.SCALE) { -+ GL11.glScalef((float) (label.getScreen().getWidth() / 427f), (float) (label.getScreen().getHeight() / 240f), 1); -+ } -+ -+ for (int i = 0; i < lines.length; i++) { -+ double left = 0; -+ -+ if (align == WidgetAnchor.TOP_CENTER || align == WidgetAnchor.CENTER_CENTER || align == WidgetAnchor.BOTTOM_CENTER) { -+ left = (swidth / 2) - (font.getStringWidth(lines[i]) / 2); -+ } else if (align == WidgetAnchor.TOP_RIGHT || align == WidgetAnchor.CENTER_RIGHT || align == WidgetAnchor.BOTTOM_RIGHT) { -+ left = swidth - font.getStringWidth(lines[i]); -+ } -+ -+ float scale = label.getScale(); -+ float reset = 1 / scale; -+ GL11.glScalef(scale, scale, scale); -+ if (label.hasShadow()) { -+ font.drawStringWithShadow(lines[i], (int) left, i * 10, label.getTextColor().toInt()); -+ } else { -+ font.drawString(lines[i], (int) left, i * 10, label.getTextColor().toInt()); -+ } -+ GL11.glScalef(reset, reset, reset); -+ } -+ GL11.glPopMatrix(); -+ GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); -+ } -+ -+ public void render(GenericSlider slider) { -+ if (slider.isVisible()) { -+ Minecraft.getMinecraft().renderEngine.bindTexture(new ResourceLocation("textures/gui/widgets.png")); -+ GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); -+ float width = (float) (slider.getWidth() < 200 ? slider.getWidth() : 200); -+ GL11.glTranslatef((float) slider.getScreenX(), (float) slider.getScreenY(), 0); -+ GL11.glScalef((float) slider.getWidth() / width, (float) slider.getHeight() / 20f, 1); -+ -+ double mouseX = slider.getScreen().getMouseX(); -+ -+ RenderUtil.drawTexturedModalRectangle(0, 0, 0, 46, (int) Math.ceil(width / 2), 20, 0f); -+ RenderUtil.drawTexturedModalRectangle((int) Math.floor(width / 2), 0, 200 - (int) Math.ceil(width / 2), 46, (int) Math.ceil(width / 2), 20, 0f); -+ -+ if (slider.isDragging()) { -+ slider.setSliderPosition((float) (mouseX - (slider.getScreenX() + 4)) / (float) (slider.getWidth() - 8)); -+ } -+ -+ GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); -+ width -= 8; -+ RenderUtil.drawTexturedModalRectangle((int) (slider.getSliderPosition() * width), 0, 0, 66, 4, 20, 0f); -+ RenderUtil.drawTexturedModalRectangle((int) (slider.getSliderPosition() * width) + 4, 0, 196, 66, 4, 20, 0f); -+ -+ Color color = slider.getTextColor(); -+ if (!slider.isEnabled()) { -+ color = slider.getDisabledColor(); -+ } -+ -+ int left = 5; -+ WidgetAnchor align = slider.getAlign(); -+ if (align == WidgetAnchor.TOP_CENTER || align == WidgetAnchor.CENTER_CENTER || align == WidgetAnchor.BOTTOM_CENTER) { -+ left = (int) ((width / 2) - (font.getTextWidth(slider.getText()) / 2)); -+ } else if (align == WidgetAnchor.TOP_RIGHT || align == WidgetAnchor.CENTER_RIGHT || align == WidgetAnchor.BOTTOM_RIGHT) { -+ left = (int) (width - font.getTextWidth(slider.getText())) - 5; -+ } -+ -+ GL11.glPushMatrix(); -+ float scale = slider.getScale(); -+ GL11.glScalef(scale, scale, scale); -+ font.drawString(slider.getText(), left, 6, color.toInt()); -+ GL11.glPopMatrix(); -+ } -+ } -+ -+ public void render(GenericTextField textField) { -+ FontRenderer font = SpoutClient.getHandle().fontRenderer; -+ RenderUtil.drawRectangle((int) (textField.getScreenX() - 1), (int) (textField.getScreenY() - 1), (int) (textField.getScreenX() + textField.getWidth() + 1), (int) (textField.getScreenY() + textField.getHeight() + 1), textField.getBorderColor().toInt()); -+ RenderUtil.drawRectangle((int) textField.getScreenX(), (int) textField.getScreenY(), (int) (textField.getScreenX() + textField.getWidth()), (int) (textField.getScreenY() + textField.getHeight()), textField.getFieldColor().toInt()); -+ -+ int x = (int) (textField.getScreenX() + GenericTextField.PADDING); -+ int y = (int) (textField.getScreenY() + GenericTextField.PADDING); -+ int color = textField.isEnabled() ? textField.getColor().toInt() : textField.getDisabledColor().toInt(); -+ int[] cursor = textField.getTextProcessor().getCursor2D(); -+ int lineNum = 0; -+ int cursorOffset = 0; -+ if (textField.getText().length() != 0) { -+ String line; -+ Iterator iter = textField.getTextProcessor().iterator(); -+ -+ while (iter.hasNext()) { -+ line = iter.next(); -+ if (lineNum == cursor[0]) { -+ cursorOffset = font.getStringWidth(line.substring(0, cursor[1])); -+ } -+ font.drawStringWithShadow(line, x, y + (GenericTextField.LINE_HEIGHT + GenericTextField.LINE_SPACING) * lineNum++, color); -+ } -+ } else if (!textField.isFocus()) { -+ font.drawStringWithShadow(textField.getPlaceholder(), x, y, color); -+ } -+ boolean showCursor = textField.isEnabled() && textField.isFocus() && shouldRenderCursor; -+ if (showCursor) { -+ font.drawStringWithShadow("_", x + cursorOffset, y + (GenericTextField.LINE_HEIGHT + GenericTextField.LINE_SPACING) * cursor[0] + 1, color); -+ } -+ -+ } -+ -+ public void render(GenericTexture texture) { -+ String addon = texture.getAddon(); -+ String url = texture.getUrl(); -+ org.newdawn.slick.opengl.Texture textureBinding; -+ if (texture.isLocal()) { -+ textureBinding = CustomTextureManager.getTextureFromPath(url); -+ } else { -+ textureBinding = CustomTextureManager.getTextureFromUrl(addon, url); -+ } -+ -+ if (textureBinding != null) { -+ if (texture.getOriginalHeight() != textureBinding.getImageWidth() || texture.getOriginalWidth() != textureBinding.getImageHeight()) { -+ texture.setOriginalWidth(textureBinding.getImageWidth()); -+ texture.setOriginalHeight(textureBinding.getImageHeight()); -+ } -+ if (texture.getFinishDelegate() != null) { -+ texture.getFinishDelegate().run(); -+ texture.setFinishDelegate(null); -+ } -+ -+ GL11.glTranslatef((float) texture.getScreenX(), (float) texture.getScreenY(), 0); // moves texture into place -+ drawTexture(textureBinding, (int) texture.getWidth(), (int) texture.getHeight(), texture.isDrawingAlphaChannel(), texture.getLeft(), texture.getTop()); -+ } -+ } -+ -+ public void render(GenericBitmap bitmap) { -+ int textureId; -+ if (bitmapId.containsKey(bitmap)) { -+ textureId = bitmapId.get(bitmap); -+ } else { -+ IntBuffer tmp = IntBuffer.allocate(1); -+ GL11.glGenTextures(tmp); -+ textureId = tmp.get(0); -+ bitmapId.put(bitmap, textureId); -+ } -+ int width = (int) bitmap.getActualWidth(); -+ int height = (int) bitmap.getActualHeight(); -+ int left = bitmap.getLeft(); -+ int top = bitmap.getTop(); -+ GL11.glTexImage2D(GL11.GL_TEXTURE_2D, 0, GL11.GL_RGBA, bitmap.getRawWidth(), bitmap.getRawHeight(), 0, GL11.GL_RGBA, GL11.GL_UNSIGNED_BYTE, bitmap.getBuffer()); -+ GL11.glTranslatef((float) bitmap.getScreenX(), (float) bitmap.getScreenY(), 0); // moves texture into place -+ GL11.glPushMatrix(); -+ GL11.glDisable(GL11.GL_DEPTH_TEST); -+ GL11.glEnable(GL11.GL_BLEND); -+ GL11.glBlendFunc(770, 771); -+ GL11.glDepthMask(false); -+ bindColor(new Color(1.0F, 1.0F, 1.0F)); -+ SpoutClient.getHandle().renderEngine.bindTexture(textureId); -+ GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MIN_FILTER, GL11.GL_NEAREST); -+ GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MAG_FILTER, GL11.GL_NEAREST); -+ double tLeft = 0, tTop = 0, rWidth = bitmap.getWidth(), rHeight = bitmap.getHeight(), tWidth = rWidth, tHeight = rHeight; -+ if (top >= 0 && left >= 0) { -+ tWidth = Math.min(tWidth, width); -+ tHeight = Math.min(tHeight, height); -+ tLeft = Math.min(Math.max(0, left), rWidth); -+ tTop = Math.min(Math.max(0, top), rHeight); -+ } -+ Tessellator tessellator = Tessellator.instance; -+ tessellator.startDrawingQuads(); -+ tessellator.addVertexWithUV(0.0D, height, -90, tLeft, tTop); // draw corners -+ tessellator.addVertexWithUV(width, height, -90, tWidth, tTop); -+ tessellator.addVertexWithUV(width, 0.0D, -90, tWidth, tHeight); -+ tessellator.addVertexWithUV(0.0D, 0.0D, -90, tLeft, tHeight); -+ tessellator.draw(); -+ GL11.glDepthMask(true); -+ GL11.glEnable(GL11.GL_DEPTH_TEST); -+ GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); -+ GL11.glPopMatrix(); -+ GL11.glDisable(GL11.GL_BLEND); -+ } -+ -+ public void render(HealthBar bar) { -+ float health = Minecraft.getMinecraft().thePlayer.getHealth(); -+ boolean whiteOutlinedHearts = Minecraft.getMinecraft().thePlayer.hurtResistantTime / 3 % 2 == 1; -+ if (Minecraft.getMinecraft().thePlayer.hurtResistantTime < 10) { -+ whiteOutlinedHearts = false; -+ } -+ float healthPercent = health / 0.2f; -+ int y = (int) bar.getScreenY(); -+ float healthPercentPerIcon = 100f / bar.getMaxNumHearts(); -+ if (bar.isVisible() && bar.getMaxNumHearts() > 0) { -+ for (int icon = 0; icon < bar.getMaxNumHearts(); ++icon) { -+ boolean full = (icon + 1) * healthPercentPerIcon <= healthPercent; -+ boolean half = (icon + 1) * healthPercentPerIcon < healthPercent + healthPercentPerIcon; -+ int x = (int) bar.getScreenX() + icon * bar.getIconOffset(); -+ -+ int iconType = 16; -+ -+ if (Minecraft.getMinecraft().thePlayer.isPotionActive(Potion.poison)) { -+ iconType += 36; -+ } -+ -+ byte hardcore = 0; -+ if (Minecraft.getMinecraft().theWorld.getWorldInfo().isHardcoreModeEnabled()) { -+ hardcore = 5 * 9; -+ } -+ -+ int oldY = y; -+ if (healthPercent <= bar.getDangerPercent()) { -+ y += GuiIngame.rand.nextInt(2); -+ } -+ -+ RenderUtil.drawTexturedModalRectangle(x, y, 16 + (whiteOutlinedHearts ? 1 : 0) * 9, hardcore, 9, 9, 0f); -+ if (whiteOutlinedHearts) { -+ if (full) { -+ RenderUtil.drawTexturedModalRectangle(x, y, iconType + 54, hardcore, 9, 9, 0f); -+ } else if (half) { -+ RenderUtil.drawTexturedModalRectangle(x, y, iconType + 63, hardcore, 9, 9, 0f); -+ } -+ } -+ -+ if (full) { -+ RenderUtil.drawTexturedModalRectangle(x, y, iconType + 36, hardcore, 9, 9, 0f); -+ } else if (half) { -+ RenderUtil.drawTexturedModalRectangle(x, y, iconType + 45, hardcore, 9, 9, 0f); -+ } -+ -+ y = oldY; -+ } -+ } -+ } -+ -+ public void render(GenericEntityWidget entityWidget) { -+ Entity entity = SpoutClient.getInstance().getEntityFromId(entityWidget.getEntityId()); -+ if (entity != null) { -+ GL11.glEnable(32826); -+ GL11.glEnable(GL11.GL_COLOR_MATERIAL); -+ GL11.glPushMatrix(); -+ GL11.glTranslated(entityWidget.getX() + entityWidget.getWidth() / 2, entityWidget.getY() + entityWidget.getHeight(), 50F); -+ RenderHelper.enableStandardItemLighting(); -+ float f1 = (float) Math.min(entityWidget.getWidth(), entityWidget.getHeight()); -+ GL11.glScalef(-f1, f1, f1); -+ GL11.glRotatef(180.0F, 0.0F, 0.0F, 1.0F); -+ GL11.glRotatef(entity.prevRotationYaw, 0, 1.0F, 0); -+ RenderHelper.enableStandardItemLighting(); -+ RenderManager.instance.playerViewY = 180F; -+ RenderManager.instance.renderEntityWithPosYaw(entity, 0.0D, 0.0D, 0.0D, 0.0F, 1.0F); -+ GL11.glPopMatrix(); -+ RenderHelper.disableStandardItemLighting(); -+ GL11.glDisable(32826); -+ } -+ } -+ -+ public MinecraftFont getMinecraftFont() { -+ return font; -+ } -+ -+ public MinecraftTessellator getTessellator() { -+ return tessellator; -+ } -+ -+ public void render(HungerBar bar) { -+ FoodStats foodStats = Minecraft.getMinecraft().thePlayer.getFoodStats(); -+ -+ int foodLevel = foodStats.getFoodLevel(); -+ float foodPercent = foodLevel / 0.2f; -+ float foodPercentPerIcon = 100f / bar.getNumOfIcons(); -+ -+ if (bar.isVisible() && bar.getNumOfIcons() > 0) { -+ int foodIcon = 16; -+ byte foodOutline = 0; -+ -+ if (Minecraft.getMinecraft().thePlayer.isPotionActive(Potion.hunger)) { -+ foodIcon += 36; -+ foodOutline = 13; -+ } -+ -+ for (int icon = 0; icon < bar.getNumOfIcons(); icon++) { -+ int x = (int) bar.getScreenX() - icon * bar.getIconOffset(); -+ int y = (int) bar.getScreenY(); -+ -+ if (Minecraft.getMinecraft().thePlayer.getFoodStats().getSaturationLevel() <= 0.0F && bar.getUpdateCounter() % (foodLevel * 3 + 1) == 0) { -+ y += GuiIngame.rand.nextInt(3) - 1; -+ } -+ -+ RenderUtil.drawTexturedModalRectangle(x, y, 16 + foodOutline * 9, 27, 9, 9, 0f); -+ -+ if ((icon + 1) * foodPercentPerIcon <= foodPercent) { -+ RenderUtil.drawTexturedModalRectangle(x, y, foodIcon + 36, 27, 9, 9, 0f); -+ } else if ((icon + 1) * foodPercentPerIcon < foodPercent + foodPercentPerIcon) { -+ RenderUtil.drawTexturedModalRectangle(x, y, foodIcon + 45, 27, 9, 9, 0f); -+ } -+ } -+ } -+ -+ } -+ -+ public void render(ExpBar bar) { -+ if (bar.isVisible()) { -+ int expCap = Minecraft.getMinecraft().thePlayer.xpBarCap(); -+ if (expCap > 0) { -+ int x = (int) bar.getScreenX(); -+ int y = (int) bar.getScreenY(); -+ int exp = (int) (Minecraft.getMinecraft().thePlayer.experience * 183.0F); -+ RenderUtil.drawTexturedModalRectangle(x, y, 0, 64, 182, 5, 0f); -+ if (exp > 0) { -+ RenderUtil.drawTexturedModalRectangle(x, y, 0, 69, exp, 5, 0f); -+ } -+ } -+ -+ if (Minecraft.getMinecraft().playerController.func_78763_f() && Minecraft.getMinecraft().thePlayer.experienceLevel > 0) { -+ int color = 8453920; -+ String level = "" + Minecraft.getMinecraft().thePlayer.experienceLevel; -+ FontRenderer font = SpoutClient.getHandle().fontRenderer; -+ int x = (int) (bar.getScreenX() + (183 / 2) - (font.getStringWidth(level) / 2)); -+ int y = (int) bar.getScreenY() - 6; -+ font.drawString(level, x + 1, y, 0); -+ font.drawString(level, x - 1, y, 0); -+ font.drawString(level, x, y + 1, 0); -+ font.drawString(level, x, y - 1, 0); -+ font.drawString(level, x, y, color); -+ } -+ } -+ } -+ -+ public void render(GenericCheckBox checkBox) { -+ if (checkBox.isVisible()) { -+ GL11.glAlphaFunc(GL11.GL_GREATER, 0.01F); -+ Texture checkBoxCross = CustomTextureManager.getTextureFromPath(FileUtil.getAssetsDir().getPath()+"/ui/box_check.png"); -+ GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); -+ GL11.glTranslatef((float) Math.floor(checkBox.getScreenX()), (float) Math.floor(checkBox.getScreenY()), 0); -+ renderBaseBox(checkBox, true); -+ FontRenderer font = SpoutClient.getHandle().fontRenderer; -+ Color color = getColor(checkBox); -+ if (!checkBox.isChecked()) { -+ color.setAlpha(0.2F); -+ } else { -+ color.setRed(0).setGreen(1).setBlue(0); -+ } -+ drawTexture(checkBoxCross, 20, 20, color, true); -+ font.drawString(checkBox.getText(), 22, 7, getColor(checkBox).toInt()); -+ } -+ } -+ -+ public void render(GenericRadioButton radioButton) { -+ if (radioButton.isVisible()) { -+ Texture radio = CustomTextureManager.getTextureFromPath(FileUtil.getAssetsDir().getPath()+"/ui/box_radio.png"); -+ GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); -+ GL11.glTranslatef((float) Math.floor(radioButton.getScreenX()), (float) Math.floor(radioButton.getScreenY()), 0); -+ renderBaseBox(radioButton, true); -+ FontRenderer font = SpoutClient.getHandle().fontRenderer; -+ Color color = getColor(radioButton); -+ if (!radioButton.isSelected()) { -+ color.setAlpha(0.2F); -+ } -+ drawTexture(radio, 20, 20, color, true); -+ font.drawString(radioButton.getText(), 22, 7, getColor(radioButton).toInt()); -+ } -+ } -+ -+ public void renderBaseBox(Control box) { -+ renderBaseBox(box, false); -+ } -+ -+ public void renderBaseBox(Control box, boolean blend) { -+ Texture usedTexture = null; -+ if (box.isEnabled() && isHovering(box)) { -+ usedTexture = CustomTextureManager.getTextureFromPath(FileUtil.getAssetsDir().getPath()+"/ui/box_hover.png"); -+ } else if (box.isEnabled()) { -+ usedTexture = CustomTextureManager.getTextureFromPath(FileUtil.getAssetsDir().getPath()+"/ui/box_normal.png"); -+ } else { -+ usedTexture = CustomTextureManager.getTextureFromPath(FileUtil.getAssetsDir().getPath()+"/ui/box_disabled.png"); -+ } -+ drawTexture(usedTexture, 20, 20, blend); -+ } -+ -+ private static final Color white = new Color(1.0F, 1.0F, 1.0F); -+ public void drawTexture(Texture textureBinding, int width, int height) { -+ drawTexture(textureBinding, width, height, white, false, -1, -1, false); -+ } -+ -+ public void drawTexture(Texture textureBinding, int width, int height, int left, int top) { -+ drawTexture(textureBinding, width, height, white, false, left, top, false); -+ } -+ -+ public void drawTexture(Texture textureBinding, int width, int height, boolean blend) { -+ drawTexture(textureBinding, width, height, white, blend, -1, -1, false); -+ } -+ -+ public void drawTexture(Texture textureBinding, int width, int height, boolean blend, int left, int top) { -+ drawTexture(textureBinding, width, height, white, blend, left, top, false); -+ } -+ -+ public void drawTexture(Texture textureBinding, int width, int height, boolean blend, int left, int top, boolean mipmap) { -+ drawTexture(textureBinding, width, height, white, blend, left, top, mipmap); -+ } -+ -+ public void drawTexture(Texture textureBinding, int width, int height, Color color) { -+ drawTexture(textureBinding, width, height, color, false, -1, -1, false); -+ } -+ -+ public void drawTexture(Texture textureBinding, int width, int height, Color color, int left, int top) { -+ drawTexture(textureBinding, width, height, color, false, left, top, false); -+ } -+ -+ public void drawTexture(Texture textureBinding, int width, int height, Color color, boolean blend) { -+ drawTexture(textureBinding, width, height, color, blend, -1, -1, false); -+ } -+ -+ public void drawTexture(Texture textureBinding, int width, int height, Color color, boolean blend, int left, int top, boolean mipmap) { -+ drawTexture(textureBinding, width, height, color, blend, left, top, mipmap, GL11.GL_NEAREST); -+ } -+ -+ public void drawTexture(Texture textureBinding, int width, int height, Color color, boolean blend, int left, int top, boolean mipmap, int filter) { -+ if (textureBinding == null) { -+ return; -+ } -+ GL11.glPushMatrix(); -+ GL11.glDisable(GL11.GL_DEPTH_TEST); -+ boolean wasBlend = GL11.glGetBoolean(GL11.GL_BLEND); -+ if (blend) { -+ GL11.glEnable(GL11.GL_BLEND); -+ GL11.glBlendFunc(770, 771); -+ } -+ GL11.glDepthMask(false); -+ bindColor(color); -+ SpoutClient.getHandle().renderEngine.bindTexture(textureBinding.getTextureID()); -+ GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MIN_FILTER, filter); -+ GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MAG_FILTER, filter); -+ if (mipmap) { -+ GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MIN_FILTER, GL11.GL_NEAREST_MIPMAP_LINEAR); -+ GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL12.GL_TEXTURE_MAX_LOD, 8); -+ -+ ContextCapabilities capabilities = GLContext.getCapabilities(); -+ if (capabilities.OpenGL30) { -+ GL30.glGenerateMipmap(GL11.GL_TEXTURE_2D); -+ } else if (capabilities.GL_EXT_framebuffer_object) { -+ EXTFramebufferObject.glGenerateMipmapEXT(GL11.GL_TEXTURE_2D); -+ } else if (capabilities.OpenGL14) { -+ GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL14.GL_GENERATE_MIPMAP, GL11.GL_TRUE); -+ } -+ } -+ -+ double tLeft = 0, tTop = 0, rWidth = textureBinding.getWidth(), rHeight = textureBinding.getHeight(), tWidth = rWidth, tHeight = rHeight; -+ if (top >= 0 && left >= 0) { -+ tWidth = Math.min(tWidth, (width/(double) textureBinding.getImageWidth()) * textureBinding.getWidth()); -+ tHeight = Math.min(tHeight, (height/(double)textureBinding.getImageHeight()) * textureBinding.getHeight()); -+ tLeft = Math.min(Math.max(0, (left/(double)textureBinding.getImageWidth())) * textureBinding.getWidth(), rWidth); -+ tTop = Math.min(Math.max(0, (top/(double)textureBinding.getImageHeight()) * textureBinding.getHeight()), rHeight); -+ } -+ tHeight = -tHeight; -+ tTop = rHeight - tTop; -+ -+ Tessellator tessellator = Tessellator.instance; -+ tessellator.startDrawingQuads(); -+ tessellator.addVertexWithUV(0.0D, height, -90, tLeft, tTop + tHeight); // draw corners -+ tessellator.addVertexWithUV(width, height, -90, tLeft + tWidth, tTop + tHeight); -+ tessellator.addVertexWithUV(width, 0.0D, -90, tLeft + tWidth, tTop); -+ tessellator.addVertexWithUV(0.0D, 0.0D, -90, tLeft, tTop); -+ -+ tessellator.draw(); -+ GL11.glDepthMask(true); -+ GL11.glEnable(GL11.GL_DEPTH_TEST); -+ GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); -+ GL11.glPopMatrix(); -+ if (blend && !wasBlend) { -+ GL11.glDisable(GL11.GL_BLEND); -+ } -+ } -+ -+ public Color getColor(Button c) { -+ if (c.isEnabled() && isHovering(c)) { -+ return c.getHoverColor().clone(); -+ } else if (c.isEnabled()) { -+ return c.getColor().clone(); -+ } else { -+ return c.getDisabledColor().clone(); -+ } -+ } -+ -+ protected void bindColor(Color c) { -+ GL11.glColor4f(c.getRedF(), c.getGreenF(), c.getBlueF(), c.getAlphaF()); -+ } -+ -+ public void render(GenericListWidgetItem lwi, int x, int y, int width, int height) { -+ if (lwi.getIconUrl() != null && !lwi.getIconUrl().isEmpty()) { -+ Texture t = CustomTextureManager.getTextureFromUrl(lwi.getIconUrl()); -+ if (t != null) { -+ int maxHeight = height - 4; -+ float f = (float) t.getImageWidth() / (float) t.getImageHeight(); -+ int w = (int) (maxHeight * f); -+ GL11.glTranslated(6, (y+2), 0); -+ drawTexture(t, maxHeight, w); -+ GL11.glTranslated(-6, (-(y+2)), 0); -+ -+ x += 2 + w; -+ } -+ } -+ FontRenderer font = SpoutClient.getHandle().fontRenderer; -+ font.drawString(lwi.getTitle(), x + 2, y + 2, new Color(1.0F, 1.0F, 1.0F).toInt()); -+ font.drawString(lwi.getText(), x + 2, y + 2 + 8, new Color(0.8F, 0.8F, 0.8F).toInt()); -+ } -+ -+ private void scissorWidget(Widget widget) { -+ double x = widget.getActualX() + widget.getWidth(), y = widget.getActualY() + widget.getHeight(), width = widget.getWidth(), height = widget.getHeight(); -+ double screenHeight; -+ screenHeight = getScreenHeight(); -+ int windowWidth = SpoutClient.getHandle().displayWidth, windowHeight = SpoutClient.getHandle().displayHeight; -+ ScaledResolution scale = new ScaledResolution(SpoutClient.getHandle().gameSettings, windowWidth, windowHeight); -+ double scaleFactor = scale.getScaleFactor(); -+ height = height * scaleFactor; -+ width = width * scaleFactor; -+ x *= scaleFactor; -+ y *= scaleFactor; -+ screenHeight *= scaleFactor; -+ x = x - width; -+ y = screenHeight - y; -+ GL11.glScissor((int) x, (int) y, (int) width, (int) height); -+ } -+ -+ public void render(GenericScrollable gs) { -+ int scrollTop = gs.getScrollPosition(Orientation.VERTICAL); -+ int scrollLeft = gs.getScrollPosition(Orientation.HORIZONTAL); -+ GL11.glTranslated(gs.getScreenX(), gs.getScreenY(), 0); -+ GL11.glEnable(GL11.GL_SCISSOR_TEST); -+ scissorWidget(gs); -+ RenderUtil.drawRectangle(0, 0, (int) gs.getWidth(), (int) gs.getHeight(), gs.getBackgroundColor().toInt()); -+ GL11.glPushMatrix(); -+ GL11.glTranslated(-scrollLeft, -scrollTop, 0); -+ GL11.glPushMatrix(); -+ -+ // Render scrollarea contents -+ gs.renderContents(); -+ -+ GL11.glPopMatrix(); -+ GL11.glPopMatrix(); -+ GL11.glDisable(GL11.GL_SCISSOR_TEST); -+ GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); -+ -+ GL11.glDisable(2896 /*GL_LIGHTING*/); -+ GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); -+ // Draw scrollbars -+ if (gs.needsScrollBar(Orientation.HORIZONTAL)) { -+ Minecraft.getMinecraft().getTextureManager().bindTexture(new ResourceLocation("textures/gui/container/creative_inventory/tabs.png")); -+ double scrollX = 0; -+ double p = (double) scrollLeft / (double) gs.getMaximumScrollPosition(Orientation.HORIZONTAL); -+ scrollX = 3 + p * (gs.getViewportSize(Orientation.HORIZONTAL) - 16.0 - 6); -+ RenderUtil.drawGradientRectangle(0, (int) gs.getHeight() - 16, (int) gs.getWidth(), (int) gs.getHeight(), scrollBarColor.toInt(), scrollBarColor2.toInt()); -+ GL11.glColor3f(1.0f, 1.0f, 1.0f); -+ RenderUtil.drawTexturedModalRectangle((int) scrollX, (int) (gs.getHeight() - 16), 232, 0, 12, 15, 0f); -+ } -+ if (gs.needsScrollBar(Orientation.VERTICAL)) { -+ Minecraft.getMinecraft().getTextureManager().bindTexture(new ResourceLocation("textures/gui/container/creative_inventory/tabs.png")); -+ double scrollY = 0; -+ double p = (double) scrollTop / (double) gs.getMaximumScrollPosition(Orientation.VERTICAL); -+ scrollY = 3 + p * (gs.getViewportSize(Orientation.VERTICAL) - 16.0 - 6); -+ RenderUtil.drawGradientRectangle((int) gs.getWidth() - 16, 0, (int) gs.getWidth(), (int) gs.getHeight(), scrollBarColor.toInt(), scrollBarColor2.toInt()); -+ GL11.glColor3f(1.0f, 1.0f, 1.0f); -+ RenderUtil.drawTexturedModalRectangle((int) (gs.getWidth() - 16), (int) scrollY, 232, 0, 12, 15, 0f); -+ RenderUtil.drawGradientRectangle(0, -1, (int) gs.getWidth(), 5, new Color(0.0F, 0.0F, 0.0F, 1.0F).toInt(), new Color(0.0F, 0.0F, 0.0F, 0.0F).toInt()); -+ RenderUtil.drawGradientRectangle(0, (int) gs.getHeight() - 5, (int) gs.getWidth() + 1, (int) gs.getHeight(), new Color(0.0F, 0.0F, 0.0F, 0.0F).toInt(), new Color(0.0F, 0.0F, 0.0F, 1.0F).toInt()); -+ } -+ } -+ -+ public void renderContents(GenericListWidget lw) { -+ int scrollTop = lw.getScrollPosition(Orientation.VERTICAL); -+ int scrollBottom = (int) (scrollTop + lw.getHeight() + 5); -+ GL11.glTranslated(0, 5, 0); -+ int currentHeight = 0; -+ for (ListWidgetItem item : lw.getItems()) { -+ // Only render visible items -+ if (currentHeight >= scrollTop - item.getHeight() && currentHeight <= scrollBottom) { -+ // Draw selection border -+ if (lw.isSelected(item)) { -+ RenderUtil.drawRectangle(4, currentHeight - 1, lw.getViewportSize(Orientation.HORIZONTAL) - 3, currentHeight - 1 + item.getHeight() + 2, new Color(1.0F, 1.0F, 1.0F).toInt()); -+ RenderUtil.drawRectangle(5, currentHeight, lw.getViewportSize(Orientation.HORIZONTAL) - 4, currentHeight + item.getHeight(), new Color(0.0F, 0.0F, 0.0F).toInt()); -+ } -+ -+ // Render actual item -+ GL11.glPushMatrix(); -+ item.render(5, currentHeight, lw.getViewportSize(Orientation.HORIZONTAL) - 9, item.getHeight()); -+ GL11.glPopMatrix(); -+ } -+ -+ currentHeight += item.getHeight(); -+ } -+ } -+ -+ public void renderContents(GenericScrollArea genericScrollArea) { -+ for (RenderPriority priority : RenderPriority.values()) { -+ for (Widget w : genericScrollArea.getAttachedWidgets()) { -+ if (w.getPriority() == priority) { -+ GL11.glPushMatrix(); -+ w.render(); -+ GL11.glPopMatrix(); -+ } -+ } -+ } -+ } -+ -+ public String getFittingText(String text, int width) { -+ if (width <= 1) { -+ return text; -+ } -+ int hash = (new HashCodeBuilder()).append(text).append(width).toHashCode(); -+ if (optimalWidth.contains(hash)) { -+ return optimalWidth.get(hash); -+ } -+ FontRenderer font = SpoutClient.getHandle().fontRenderer; -+ String t = new String(text); -+ int remove = 0; -+ while (font.getStringWidth(t) > width) { -+ remove++; -+ t = text.substring(0, Math.max(0, text.length() - 1 - remove)) + "..."; -+ } -+ optimalWidth.put(hash, t); -+ return t; -+ } -+ -+ public void render(GenericComboBox comboBox) { -+ if (comboBox.isVisible()) { -+ comboBox.setInnerWidth((int) comboBox.getWidth() - 16); -+ render((GenericButton) comboBox); -+ Texture text; -+ if (comboBox.isOpen()) { -+ text = CustomTextureManager.getTextureFromPath(FileUtil.getAssetsDir().getPath()+"/ui/box_ascending.png"); -+ } else { -+ text = CustomTextureManager.getTextureFromPath(FileUtil.getAssetsDir().getPath()+"/ui/box_descending.png"); -+ } -+ GL11.glTranslated(comboBox.getWidth() - 16, 3, 0); -+ RenderUtil.drawRectangle(0, -3, 16, (int) comboBox.getHeight()-3, 0x33000000); -+ drawTexture(text, 16, 16, getColor(comboBox), true); -+ } -+ } -+ -+ public void render(GenericSlot genericSlot) { -+ if (!genericSlot.isVisible()) { -+ return; -+ } -+ ItemStack item = genericSlot.getItem(); -+ -+ GL11.glDepthFunc(515); -+ RenderHelper.enableGUIStandardItemLighting(); -+ GL11.glDisable(GL11.GL_DEPTH_TEST); -+ GL11.glEnable(GL11.GL_TEXTURE_2D); -+ GL11.glEnable(GL11.GL_COLOR_MATERIAL); -+ GL11.glPushMatrix(); -+ GL11.glTranslatef((float) genericSlot.getScreenX(), (float) genericSlot.getScreenY(), 0); -+ if (genericSlot.getAnchor() == WidgetAnchor.SCALE) { -+ GL11.glScalef((float) (genericSlot.getScreen().getWidth() / 427f), (float) (genericSlot.getScreen().getHeight() / 240f), 1); -+ } -+ GL11.glScaled(genericSlot.getWidth() / 16D, genericSlot.getHeight() / 16D, 1); -+ -+ if (item.getTypeId() != 0) { -+ GL11.glColor4f(1.0f, 1.0f, 1.0f, 1.0f); -+ int id = item.getTypeId(); -+ int data = item.getDurability(); -+ if (MaterialData.getCustomItem(id) != null) { -+ int temp = id; -+ id = 318; -+ data = temp; -+ } -+ renderer.renderItemIntoGUI(SpoutClient.getHandle().fontRenderer, SpoutClient.getHandle().renderEngine, new net.minecraft.src.ItemStack(id, !genericSlot.doesRenderAmount() ? 0 : item.getAmount(), data), 0, 0); -+ renderer.renderItemOverlayIntoGUI(SpoutClient.getHandle().fontRenderer, SpoutClient.getHandle().renderEngine, new net.minecraft.src.ItemStack(id, !genericSlot.doesRenderAmount() ? 0 : item.getAmount(), data), 0, 0); -+ } -+ GL11.glEnable(GL11.GL_LIGHTING); -+ RenderHelper.disableStandardItemLighting(); -+ if (isHovering(genericSlot)) RenderUtil.drawRectangle(0, 0, 16, 16, 0x88ffffff); -+ GL11.glPopMatrix(); -+ } -+ -+ public boolean bindTexture(String path) { -+ Texture tex = CustomTextureManager.getTextureFromPath(path); -+ if (tex != null) { -+ tex.bind(); -+ } -+ return tex != null; -+ } -+ -+ public boolean bindTexture(String addon, String path) { -+ Texture tex = CustomTextureManager.getTextureFromUrl(addon, path); -+ if (tex != null) { -+ tex.bind(); -+ } -+ return tex != null; -+ } -+} ---- net/minecraft/src/EntityMinecartMobSpawner.java -+++ net/minecraft/src/EntityMinecartMobSpawner.java -@@ -1,14 +1,16 @@ - package net.minecraft.src; - - public class EntityMinecartMobSpawner extends EntityMinecart { -+ -+ /** Mob spawner logic for this spawner minecart. */ - private final MobSpawnerBaseLogic mobSpawnerLogic = new EntityMinecartMobSpawnerLogic(this); - -- public EntityMinecartMobSpawner(World var1) { -- super(var1); -+ public EntityMinecartMobSpawner(World par1World) { -+ super(par1World); - } - -- public EntityMinecartMobSpawner(World var1, double var2, double var4, double var6) { -- super(var1, var2, var4, var6); -+ public EntityMinecartMobSpawner(World par1World, double par2, double par4, double par6) { -+ super(par1World, par2, par4, par6); - } - - public int getMinecartType() { -@@ -19,20 +21,29 @@ - return Block.mobSpawner; - } - -- protected void readEntityFromNBT(NBTTagCompound var1) { -- super.readEntityFromNBT(var1); -- this.mobSpawnerLogic.readFromNBT(var1); -- } -- -- protected void writeEntityToNBT(NBTTagCompound var1) { -- super.writeEntityToNBT(var1); -- this.mobSpawnerLogic.writeToNBT(var1); -- } -- -- public void handleHealthUpdate(byte var1) { -- this.mobSpawnerLogic.setDelayToMin(var1); -- } -- -+ /** -+ * (abstract) Protected helper method to read subclass entity data from NBT. -+ */ -+ protected void readEntityFromNBT(NBTTagCompound par1NBTTagCompound) { -+ super.readEntityFromNBT(par1NBTTagCompound); -+ this.mobSpawnerLogic.readFromNBT(par1NBTTagCompound); -+ } -+ -+ /** -+ * (abstract) Protected helper method to write subclass entity data to NBT. -+ */ -+ protected void writeEntityToNBT(NBTTagCompound par1NBTTagCompound) { -+ super.writeEntityToNBT(par1NBTTagCompound); -+ this.mobSpawnerLogic.writeToNBT(par1NBTTagCompound); -+ } -+ -+ public void handleHealthUpdate(byte par1) { -+ this.mobSpawnerLogic.setDelayToMin(par1); -+ } -+ -+ /** -+ * Called to update the entity's position/logic. -+ */ - public void onUpdate() { - super.onUpdate(); - this.mobSpawnerLogic.updateSpawner(); ---- net/minecraft/src/WorldGenPumpkin.java -+++ net/minecraft/src/WorldGenPumpkin.java -@@ -3,13 +3,14 @@ - import java.util.Random; - - public class WorldGenPumpkin extends WorldGenerator { -- public boolean generate(World var1, Random var2, int var3, int var4, int var5) { -- for(int var6 = 0; var6 < 64; ++var6) { -- int var7 = var3 + var2.nextInt(8) - var2.nextInt(8); -- int var8 = var4 + var2.nextInt(4) - var2.nextInt(4); -- int var9 = var5 + var2.nextInt(8) - var2.nextInt(8); -- if(var1.isAirBlock(var7, var8, var9) && var1.getBlockId(var7, var8 - 1, var9) == Block.grass.blockID && Block.pumpkin.canPlaceBlockAt(var1, var7, var8, var9)) { -- var1.setBlock(var7, var8, var9, Block.pumpkin.blockID, var2.nextInt(4), 2); -+ public boolean generate(World par1World, Random par2Random, int par3, int par4, int par5) { -+ for (int var6 = 0; var6 < 64; ++var6) { -+ int var7 = par3 + par2Random.nextInt(8) - par2Random.nextInt(8); -+ int var8 = par4 + par2Random.nextInt(4) - par2Random.nextInt(4); -+ int var9 = par5 + par2Random.nextInt(8) - par2Random.nextInt(8); -+ -+ if (par1World.isAirBlock(var7, var8, var9) && par1World.getBlockId(var7, var8 - 1, var9) == Block.grass.blockID && Block.pumpkin.canPlaceBlockAt(par1World, var7, var8, var9)) { -+ par1World.setBlock(var7, var8, var9, Block.pumpkin.blockID, par2Random.nextInt(4), 2); - } - } - ---- /dev/null -+++ org/spoutcraft/client/gui/database/SortButton.java -@@ -1,0 +1,123 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.client.gui.database; -+ -+import org.lwjgl.opengl.GL11; -+import org.newdawn.slick.opengl.Texture; -+ -+import net.minecraft.src.FontRenderer; -+ -+import org.spoutcraft.api.gui.Color; -+import org.spoutcraft.api.gui.GenericRadioButton; -+import org.spoutcraft.api.gui.RadioButton; -+import org.spoutcraft.client.SpoutClient; -+import org.spoutcraft.client.gui.MCRenderDelegate; -+import org.spoutcraft.client.io.CustomTextureManager; -+import org.spoutcraft.client.io.FileUtil; -+ -+public class SortButton extends GenericRadioButton implements UrlElement { -+ boolean topdown = true; -+ boolean preferredOrder = true; -+ boolean allowSorting = true; -+ boolean firstClick = false; -+ -+ protected AbstractAPIModel model; -+ String url; -+ -+ public SortButton(String text, String urlPart, AbstractAPIModel model) { -+ super(text); -+ url = urlPart; -+ this.model = model; -+ } -+ -+ public SortButton(String text, String baseUrl, boolean preferredOrder, AbstractAPIModel model) { -+ super(text); -+ url = baseUrl; -+ this.preferredOrder = preferredOrder; -+ this.model = model; -+ } -+ -+ @Override -+ public void onButtonClick() { -+ if (isSelected() && !firstClick) { -+ topdown = !topdown; -+ } -+ updateUrl(); -+ firstClick = false; -+ } -+ -+ @Override -+ public RadioButton setSelected(boolean b) { -+ if (!isSelected() && b) { -+ topdown = preferredOrder; -+ firstClick = true; -+ } -+ super.setSelected(b); -+ return this; -+ } -+ -+ private void updateUrl() { -+ model.updateUrl(); -+ } -+ -+ public void setAllowSorting(boolean b) { -+ allowSorting = b; -+ } -+ -+ @Override -+ public void render() { -+ if (!allowSorting) { -+ super.render(); -+ } else { -+ MCRenderDelegate r = (MCRenderDelegate) SpoutClient.getInstance().getRenderDelegate(); -+ String texture = ""; -+ if (isSelected() && topdown || !isSelected() && preferredOrder) { -+ texture = "/ui/box_ascending.png"; -+ } else { -+ texture = "/ui/box_descending.png"; -+ } -+ Texture direction = CustomTextureManager.getTextureFromPath(FileUtil.getAssetsDir().getPath() + texture); -+ GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); -+ GL11.glTranslatef((float) getScreenX(), (float) getScreenY(), 0); -+ r.renderBaseBox(this, true); -+ FontRenderer font = SpoutClient.getHandle().fontRenderer; -+ Color color = r.getColor(this); -+ if (!isSelected()) { -+ color.setAlpha(0.2F); -+ } -+ r.drawTexture(direction, 20, 20, color, true); -+ font.drawString(getText(), 22, 7, r.getColor(this).toInt()); -+ } -+ } -+ -+ public boolean isActive() { -+ return isSelected(); -+ } -+ -+ public String getUrlPart() { -+ String dir = topdown ? "asc" : "desc"; -+ String surl = url + (allowSorting ? "&order=" + dir : ""); -+ return surl; -+ } -+ -+ public void clear() { -+ setSelected(false); -+ } -+} ---- net/minecraft/src/RenderWither.java -+++ net/minecraft/src/RenderWither.java -@@ -5,49 +5,51 @@ - public class RenderWither extends RenderLiving { - private static final ResourceLocation invulnerableWitherTextures = new ResourceLocation("textures/entity/wither/wither_invulnerable.png"); - private static final ResourceLocation witherTextures = new ResourceLocation("textures/entity/wither/wither.png"); -- private int field_82419_a = ((ModelWither)this.mainModel).func_82903_a(); -+ private int field_82419_a; - - public RenderWither() { - super(new ModelWither(), 1.0F); -+ this.field_82419_a = ((ModelWither)this.mainModel).func_82903_a(); - } - -- public void func_82418_a(EntityWither var1, double var2, double var4, double var6, float var8, float var9) { -- BossStatus.setBossStatus(var1, true); -+ public void func_82418_a(EntityWither par1EntityWither, double par2, double par4, double par6, float par8, float par9) { -+ BossStatus.setBossStatus(par1EntityWither, true); - int var10 = ((ModelWither)this.mainModel).func_82903_a(); -- if(var10 != this.field_82419_a) { -+ -+ if (var10 != this.field_82419_a) { - this.field_82419_a = var10; - this.mainModel = new ModelWither(); - } - -- super.doRenderLiving(var1, var2, var4, var6, var8, var9); -+ super.doRenderLiving(par1EntityWither, par2, par4, par6, par8, par9); - } - -- protected ResourceLocation func_110911_a(EntityWither var1) { -- int var2 = var1.func_82212_n(); -+ protected ResourceLocation func_110911_a(EntityWither par1EntityWither) { -+ int var2 = par1EntityWither.func_82212_n(); - return var2 > 0 && (var2 > 80 || var2 / 5 % 2 != 1) ? invulnerableWitherTextures : witherTextures; - } - -- protected void func_82415_a(EntityWither var1, float var2) { -- int var3 = var1.func_82212_n(); -- if(var3 > 0) { -- float var4 = 2.0F - ((float)var3 - var2) / 220.0F * 0.5F; -+ protected void func_82415_a(EntityWither par1EntityWither, float par2) { -+ int var3 = par1EntityWither.func_82212_n(); -+ -+ if (var3 > 0) { -+ float var4 = 2.0F - ((float)var3 - par2) / 220.0F * 0.5F; - GL11.glScalef(var4, var4, var4); - } else { - GL11.glScalef(2.0F, 2.0F, 2.0F); - } -- - } - -- protected int func_82417_a(EntityWither var1, int var2, float var3) { -- if(var1.isArmored()) { -- if(var1.isInvisible()) { -+ protected int func_82417_a(EntityWither par1EntityWither, int par2, float par3) { -+ if (par1EntityWither.isArmored()) { -+ if (par1EntityWither.isInvisible()) { - GL11.glDepthMask(false); - } else { - GL11.glDepthMask(true); - } - -- if(var2 == 1) { -- float var4 = (float)var1.ticksExisted + var3; -+ if (par2 == 1) { -+ float var4 = (float)par1EntityWither.ticksExisted + par3; - this.bindTexture(invulnerableWitherTextures); - GL11.glMatrixMode(GL11.GL_TEXTURE); - GL11.glLoadIdentity(); -@@ -66,7 +68,7 @@ - return 1; - } - -- if(var2 == 2) { -+ if (par2 == 2) { - GL11.glMatrixMode(GL11.GL_TEXTURE); - GL11.glLoadIdentity(); - GL11.glMatrixMode(GL11.GL_MODELVIEW); -@@ -78,35 +80,51 @@ - return -1; - } - -- protected int func_82416_b(EntityWither var1, int var2, float var3) { -+ protected int func_82416_b(EntityWither par1EntityWither, int par2, float par3) { - return -1; - } - -- public void doRenderLiving(EntityLiving var1, double var2, double var4, double var6, float var8, float var9) { -- this.func_82418_a((EntityWither)var1, var2, var4, var6, var8, var9); -- } -- -- protected void preRenderCallback(EntityLivingBase var1, float var2) { -- this.func_82415_a((EntityWither)var1, var2); -- } -- -- protected int shouldRenderPass(EntityLivingBase var1, int var2, float var3) { -- return this.func_82417_a((EntityWither)var1, var2, var3); -- } -- -- protected int inheritRenderPass(EntityLivingBase var1, int var2, float var3) { -- return this.func_82416_b((EntityWither)var1, var2, var3); -- } -- -- public void renderPlayer(EntityLivingBase var1, double var2, double var4, double var6, float var8, float var9) { -- this.func_82418_a((EntityWither)var1, var2, var4, var6, var8, var9); -- } -- -- protected ResourceLocation getEntityTexture(Entity var1) { -- return this.func_110911_a((EntityWither)var1); -- } -- -- public void doRender(Entity var1, double var2, double var4, double var6, float var8, float var9) { -- this.func_82418_a((EntityWither)var1, var2, var4, var6, var8, var9); -+ public void doRenderLiving(EntityLiving par1EntityLiving, double par2, double par4, double par6, float par8, float par9) { -+ this.func_82418_a((EntityWither)par1EntityLiving, par2, par4, par6, par8, par9); -+ } -+ -+ /** -+ * Allows the render to do any OpenGL state modifications necessary before the model is rendered. Args: entityLiving, -+ * partialTickTime -+ */ -+ protected void preRenderCallback(EntityLivingBase par1EntityLivingBase, float par2) { -+ this.func_82415_a((EntityWither)par1EntityLivingBase, par2); -+ } -+ -+ /** -+ * Queries whether should render the specified pass or not. -+ */ -+ protected int shouldRenderPass(EntityLivingBase par1EntityLivingBase, int par2, float par3) { -+ return this.func_82417_a((EntityWither)par1EntityLivingBase, par2, par3); -+ } -+ -+ protected int inheritRenderPass(EntityLivingBase par1EntityLivingBase, int par2, float par3) { -+ return this.func_82416_b((EntityWither)par1EntityLivingBase, par2, par3); -+ } -+ -+ public void renderPlayer(EntityLivingBase par1EntityLivingBase, double par2, double par4, double par6, float par8, float par9) { -+ this.func_82418_a((EntityWither)par1EntityLivingBase, par2, par4, par6, par8, par9); -+ } -+ -+ /** -+ * Returns the location of an entity's texture. Doesn't seem to be called unless you call Render.bindEntityTexture. -+ */ -+ protected ResourceLocation getEntityTexture(Entity par1Entity) { -+ return this.func_110911_a((EntityWither)par1Entity); -+ } -+ -+ /** -+ * Actually renders the given argument. This is a synthetic bridge method, always casting down its argument and then -+ * handing it off to a worker function which does the actual work. In all probabilty, the class Render is generic -+ * (Render= this.val$weights[index]; ++index) { -+ m -= this.val$weights[index]; -+ } -+ -+ return index; -+ } -+ -+ public String toString() { -+ StringBuilder sb = new StringBuilder(); -+ sb.append("%("); -+ -+ for (int i = 0; i < this.val$weights.length; ++i) { -+ if (i > 0) { -+ sb.append(", "); -+ } -+ -+ sb.append(String.format("%.1f", new Object[] {Double.valueOf(100.0D * (double)this.val$weights[i] / (double)this.val$sum)})); -+ } -+ -+ sb.append(")"); -+ return sb.toString(); -+ } -+} ---- /dev/null -+++ org/spoutcraft/api/material/item/Potion.java -@@ -1,0 +1,26 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.api.material.item; -+ -+public class Potion extends GenericItem{ -+ public Potion(String name, int id, int data) { -+ super(name, id, data); -+ } -+} ---- net/minecraft/src/CommandDefaultGameMode.java -+++ net/minecraft/src/CommandDefaultGameMode.java -@@ -8,30 +8,30 @@ - return "defaultgamemode"; - } - -- public String getCommandUsage(ICommandSender var1) { -+ public String getCommandUsage(ICommandSender par1ICommandSender) { - return "commands.defaultgamemode.usage"; - } - -- public void processCommand(ICommandSender var1, String[] var2) { -- if(var2.length > 0) { -- EnumGameType var3 = this.getGameModeFromCommand(var1, var2[0]); -+ public void processCommand(ICommandSender par1ICommandSender, String[] par2ArrayOfStr) { -+ if (par2ArrayOfStr.length > 0) { -+ EnumGameType var3 = this.getGameModeFromCommand(par1ICommandSender, par2ArrayOfStr[0]); - this.setGameType(var3); -- notifyAdmins(var1, "commands.defaultgamemode.success", new Object[]{ChatMessageComponent.createFromTranslationKey("gameMode." + var3.getName())}); -+ notifyAdmins(par1ICommandSender, "commands.defaultgamemode.success", new Object[] {ChatMessageComponent.createFromTranslationKey("gameMode." + var3.getName())}); - } else { - throw new WrongUsageException("commands.defaultgamemode.usage", new Object[0]); - } - } - -- protected void setGameType(EnumGameType var1) { -+ protected void setGameType(EnumGameType par1EnumGameType) { - MinecraftServer var2 = MinecraftServer.getServer(); -- var2.setGameType(var1); -+ var2.setGameType(par1EnumGameType); - EntityPlayerMP var4; -- if(var2.getForceGamemode()) { -- for(Iterator var3 = MinecraftServer.getServer().getConfigurationManager().a.iterator(); var3.hasNext(); var4.fallDistance = 0.0F) { -+ -+ if (var2.getForceGamemode()) { -+ for (Iterator var3 = MinecraftServer.getServer().getConfigurationManager().playerEntityList.iterator(); var3.hasNext(); var4.fallDistance = 0.0F) { - var4 = (EntityPlayerMP)var3.next(); -- var4.setGameType(var1); -+ var4.setGameType(par1EnumGameType); - } - } -- - } - } ---- /dev/null -+++ org/spoutcraft/api/gui/ExpBar.java -@@ -1,0 +1,66 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.api.gui; -+ -+import java.util.UUID; -+ -+import org.spoutcraft.api.Spoutcraft; -+import org.spoutcraft.api.UnsafeClass; -+ -+@UnsafeClass -+public class ExpBar extends GenericWidget { -+ public ExpBar() { -+ super(); -+ setX(427 / 2 - 91); // 122 -+ setY(211); -+ setAnchor(WidgetAnchor.BOTTOM_CENTER); -+ } -+ -+ @Override -+ public double getScreenX() { -+ double mid = getScreen() != null ? getScreen().getWidth() / 2 : 427 / 2D; -+ double diff = super.getScreenX() - mid - 31; -+ return getScreen() != null ? getScreen().getWidth() / 2D - diff : this.getX(); -+ } -+ -+ @Override -+ public double getScreenY() { -+ int diff = (int) (240 - this.getY()); -+ return getScreen() != null ? getScreen().getHeight() - diff : this.getY(); -+ } -+ -+ @Override -+ public UUID getId() { -+ return new UUID(0, 6); -+ } -+ -+ public WidgetType getType() { -+ return WidgetType.ExpBar; -+ } -+ -+ public void render() { -+ Spoutcraft.getClient().getRenderDelegate().render(this); -+ } -+ -+ @Override -+ public int getVersion() { -+ return super.getVersion() + 1; -+ } -+} ---- net/minecraft/src/RenderChicken.java -+++ net/minecraft/src/RenderChicken.java -@@ -3,41 +3,53 @@ - public class RenderChicken extends RenderLiving { - private static final ResourceLocation chickenTextures = new ResourceLocation("textures/entity/chicken.png"); - -- public RenderChicken(ModelBase var1, float var2) { -- super(var1, var2); -- } -- -- public void renderChicken(EntityChicken var1, double var2, double var4, double var6, float var8, float var9) { -- super.doRenderLiving(var1, var2, var4, var6, var8, var9); -- } -- -- protected ResourceLocation getChickenTextures(EntityChicken var1) { -+ public RenderChicken(ModelBase par1ModelBase, float par2) { -+ super(par1ModelBase, par2); -+ } -+ -+ public void renderChicken(EntityChicken par1EntityChicken, double par2, double par4, double par6, float par8, float par9) { -+ super.doRenderLiving(par1EntityChicken, par2, par4, par6, par8, par9); -+ } -+ -+ protected ResourceLocation getChickenTextures(EntityChicken par1EntityChicken) { - return chickenTextures; - } - -- protected float getWingRotation(EntityChicken var1, float var2) { -- float var3 = var1.field_70888_h + (var1.field_70886_e - var1.field_70888_h) * var2; -- float var4 = var1.field_70884_g + (var1.destPos - var1.field_70884_g) * var2; -+ protected float getWingRotation(EntityChicken par1EntityChicken, float par2) { -+ float var3 = par1EntityChicken.field_70888_h + (par1EntityChicken.field_70886_e - par1EntityChicken.field_70888_h) * par2; -+ float var4 = par1EntityChicken.field_70884_g + (par1EntityChicken.destPos - par1EntityChicken.field_70884_g) * par2; - return (MathHelper.sin(var3) + 1.0F) * var4; - } - -- public void doRenderLiving(EntityLiving var1, double var2, double var4, double var6, float var8, float var9) { -- this.renderChicken((EntityChicken)var1, var2, var4, var6, var8, var9); -- } -- -- protected float handleRotationFloat(EntityLivingBase var1, float var2) { -- return this.getWingRotation((EntityChicken)var1, var2); -- } -- -- public void renderPlayer(EntityLivingBase var1, double var2, double var4, double var6, float var8, float var9) { -- this.renderChicken((EntityChicken)var1, var2, var4, var6, var8, var9); -- } -- -- protected ResourceLocation getEntityTexture(Entity var1) { -- return this.getChickenTextures((EntityChicken)var1); -- } -- -- public void doRender(Entity var1, double var2, double var4, double var6, float var8, float var9) { -- this.renderChicken((EntityChicken)var1, var2, var4, var6, var8, var9); -+ public void doRenderLiving(EntityLiving par1EntityLiving, double par2, double par4, double par6, float par8, float par9) { -+ this.renderChicken((EntityChicken)par1EntityLiving, par2, par4, par6, par8, par9); -+ } -+ -+ /** -+ * Defines what float the third param in setRotationAngles of ModelBase is -+ */ -+ protected float handleRotationFloat(EntityLivingBase par1EntityLivingBase, float par2) { -+ return this.getWingRotation((EntityChicken)par1EntityLivingBase, par2); -+ } -+ -+ public void renderPlayer(EntityLivingBase par1EntityLivingBase, double par2, double par4, double par6, float par8, float par9) { -+ this.renderChicken((EntityChicken)par1EntityLivingBase, par2, par4, par6, par8, par9); -+ } -+ -+ /** -+ * Returns the location of an entity's texture. Doesn't seem to be called unless you call Render.bindEntityTexture. -+ */ -+ protected ResourceLocation getEntityTexture(Entity par1Entity) { -+ return this.getChickenTextures((EntityChicken)par1Entity); -+ } -+ -+ /** -+ * Actually renders the given argument. This is a synthetic bridge method, always casting down its argument and then -+ * handing it off to a worker function which does the actual work. In all probabilty, the class Render is generic -+ * (Render= 73) { -- this.b = readString(var1, 255); -- this.field_140053_c = var1.readInt(); -+ par1DataInput.readByte(); -+ readString(par1DataInput, 255); -+ par1DataInput.readShort(); -+ this.readSuccessfully = par1DataInput.readByte(); -+ -+ if (this.readSuccessfully >= 73) { -+ this.field_140052_b = readString(par1DataInput, 255); -+ this.field_140053_c = par1DataInput.readInt(); - } - } catch (Throwable var3) { -- this.b = ""; -+ this.field_140052_b = ""; - } - } catch (Throwable var4) { - this.readSuccessfully = 0; -- this.b = ""; -+ this.field_140052_b = ""; - } -- -- } -- -- public void writePacketData(DataOutput var1) throws IOException { -- var1.writeByte(1); -- var1.writeByte(field_140051_d); -- Packet.writeString("MC|PingHost", var1); -- var1.writeShort(3 + 2 * this.b.length() + 4); -- var1.writeByte(this.readSuccessfully); -- Packet.writeString(this.b, var1); -- var1.writeInt(this.field_140053_c); -- } -- -- public void processPacket(NetHandler var1) { -- var1.handleServerPing(this); -- } -- -+ } -+ -+ /** -+ * Abstract. Writes the raw packet data to the data stream. -+ */ -+ public void writePacketData(DataOutput par1DataOutput) throws IOException { -+ par1DataOutput.writeByte(1); -+ par1DataOutput.writeByte(field_140051_d); -+ Packet.writeString("MC|PingHost", par1DataOutput); -+ par1DataOutput.writeShort(3 + 2 * this.field_140052_b.length() + 4); -+ par1DataOutput.writeByte(this.readSuccessfully); -+ Packet.writeString(this.field_140052_b, par1DataOutput); -+ par1DataOutput.writeInt(this.field_140053_c); -+ } -+ -+ /** -+ * Passes this Packet on to the NetHandler for processing. -+ */ -+ public void processPacket(NetHandler par1NetHandler) { -+ par1NetHandler.handleServerPing(this); -+ } -+ -+ /** -+ * Abstract. Return the size of the packet (not counting the header). -+ */ - public int getPacketSize() { -- return 3 + this.b.length() * 2 + 4; -+ return 3 + this.field_140052_b.length() * 2 + 4; - } - - public boolean func_140050_d() { ---- net/minecraft/src/EntityAILookAtTradePlayer.java -+++ net/minecraft/src/EntityAILookAtTradePlayer.java -@@ -3,13 +3,16 @@ - public class EntityAILookAtTradePlayer extends EntityAIWatchClosest { - private final EntityVillager theMerchant; - -- public EntityAILookAtTradePlayer(EntityVillager var1) { -- super(var1, EntityPlayer.class, 8.0F); -- this.theMerchant = var1; -+ public EntityAILookAtTradePlayer(EntityVillager par1EntityVillager) { -+ super(par1EntityVillager, EntityPlayer.class, 8.0F); -+ this.theMerchant = par1EntityVillager; - } - -+ /** -+ * Returns whether the EntityAIBase should begin execution. -+ */ - public boolean shouldExecute() { -- if(this.theMerchant.isTrading()) { -+ if (this.theMerchant.isTrading()) { - this.closestEntity = this.theMerchant.getCustomer(); - return true; - } else { ---- net/minecraft/src/TextureAtlasSprite.java -+++ net/minecraft/src/TextureAtlasSprite.java -@@ -1,6 +1,8 @@ - package net.minecraft.src; - - import com.google.common.collect.Lists; -+import com.prupe.mcpatcher.hd.AAHelper; -+import com.prupe.mcpatcher.hd.MipmapHelper; - import java.awt.image.BufferedImage; - import java.io.IOException; - import java.io.InputStream; -@@ -10,8 +12,8 @@ - import javax.imageio.ImageIO; - - public class TextureAtlasSprite implements Icon { -- private final String i; -- protected List a = Lists.newArrayList(); -+ private final String iconName; -+ public List framesTextureData = Lists.newArrayList(); - private AnimationMetadataSection animationMetadata; - protected boolean rotated; - protected int originX; -@@ -24,186 +26,220 @@ - private float maxV; - protected int frameCounter; - protected int tickCounter; -- -- protected TextureAtlasSprite(String var1) { -- this.i = var1; -- } -- -- public void initSprite(int var1, int var2, int var3, int var4, boolean var5) { -- this.originX = var3; -- this.originY = var4; -- this.rotated = var5; -- float var6 = (float)((double)0.01F / (double)var1); -- float var7 = (float)((double)0.01F / (double)var2); -- this.minU = (float)var3 / (float)((double)var1) + var6; -- this.maxU = (float)(var3 + this.width) / (float)((double)var1) - var6; -- this.minV = (float)var4 / (float)var2 + var7; -- this.maxV = (float)(var4 + this.height) / (float)var2 - var7; -- } -- -- public void copyFrom(TextureAtlasSprite var1) { -- this.originX = var1.originX; -- this.originY = var1.originY; -- this.width = var1.width; -- this.height = var1.height; -- this.rotated = var1.rotated; -- this.minU = var1.minU; -- this.maxU = var1.maxU; -- this.minV = var1.minV; -- this.maxV = var1.maxV; -- } -- -+ public List mipmaps = null; -+ -+ public TextureAtlasSprite(String par1Str) { -+ this.iconName = par1Str; -+ } -+ -+ public void initSprite(int par1, int par2, int par3, int par4, boolean par5) { -+ this.originX = par3; -+ this.originY = par4; -+ this.rotated = par5; -+ float var6 = (float)(0.009999999776482582D / (double)par1); -+ float var7 = (float)(0.009999999776482582D / (double)par2); -+ this.minU = (float)par3 / (float)((double)par1) + var6; -+ this.maxU = (float)(par3 + this.width) / (float)((double)par1) - var6; -+ this.minV = (float)par4 / (float)par2 + var7; -+ this.maxV = (float)(par4 + this.height) / (float)par2 - var7; -+ } -+ -+ public void copyFrom(TextureAtlasSprite par1TextureAtlasSprite) { -+ this.originX = par1TextureAtlasSprite.originX; -+ this.originY = par1TextureAtlasSprite.originY; -+ this.width = par1TextureAtlasSprite.width; -+ this.height = par1TextureAtlasSprite.height; -+ this.rotated = par1TextureAtlasSprite.rotated; -+ this.minU = par1TextureAtlasSprite.minU; -+ this.maxU = par1TextureAtlasSprite.maxU; -+ this.minV = par1TextureAtlasSprite.minV; -+ this.maxV = par1TextureAtlasSprite.maxV; -+ } -+ -+ /** -+ * Returns the X position of this icon on its texture sheet, in pixels. -+ */ - public int getOriginX() { - return this.originX; - } - -+ /** -+ * Returns the Y position of this icon on its texture sheet, in pixels. -+ */ - public int getOriginY() { - return this.originY; - } - -+ /** -+ * Returns the width of the icon, in pixels. -+ */ - public int getIconWidth() { - return this.width; - } - -+ /** -+ * Returns the height of the icon, in pixels. -+ */ - public int getIconHeight() { - return this.height; - } - -+ /** -+ * Returns the minimum U coordinate to use when rendering with this icon. -+ */ - public float getMinU() { - return this.minU; - } - -+ /** -+ * Returns the maximum U coordinate to use when rendering with this icon. -+ */ - public float getMaxU() { - return this.maxU; - } - -- public float getInterpolatedU(double var1) { -+ /** -+ * Gets a U coordinate on the icon. 0 returns uMin and 16 returns uMax. Other arguments return in-between values. -+ */ -+ public float getInterpolatedU(double par1) { - float var3 = this.maxU - this.minU; -- return this.minU + var3 * (float)var1 / 16.0F; -+ return this.minU + var3 * (float)par1 / 16.0F; - } - -+ /** -+ * Returns the minimum V coordinate to use when rendering with this icon. -+ */ - public float getMinV() { - return this.minV; - } - -+ /** -+ * Returns the maximum V coordinate to use when rendering with this icon. -+ */ - public float getMaxV() { - return this.maxV; - } - -- public float getInterpolatedV(double var1) { -+ /** -+ * Gets a V coordinate on the icon. 0 returns vMin and 16 returns vMax. Other arguments return in-between values. -+ */ -+ public float getInterpolatedV(double par1) { - float var3 = this.maxV - this.minV; -- return this.minV + var3 * ((float)var1 / 16.0F); -+ return this.minV + var3 * ((float)par1 / 16.0F); - } - - public String getIconName() { -- return this.i; -+ return this.iconName; - } - - public void updateAnimation() { - ++this.tickCounter; -- if(this.tickCounter >= this.animationMetadata.getFrameTimeSingle(this.frameCounter)) { -+ -+ if (this.tickCounter >= this.animationMetadata.getFrameTimeSingle(this.frameCounter)) { - int var1 = this.animationMetadata.getFrameIndex(this.frameCounter); -- int var2 = this.animationMetadata.getFrameCount() == 0 ? this.a.size() : this.animationMetadata.getFrameCount(); -+ int var2 = this.animationMetadata.getFrameCount() == 0 ? this.framesTextureData.size() : this.animationMetadata.getFrameCount(); - this.frameCounter = (this.frameCounter + 1) % var2; - this.tickCounter = 0; - int var3 = this.animationMetadata.getFrameIndex(this.frameCounter); -- if(var1 != var3 && var3 >= 0 && var3 < this.a.size()) { -- TextureUtil.uploadTextureSub((int[])this.a.get(var3), this.width, this.height, this.originX, this.originY, false, false); -+ -+ if (var1 != var3 && var3 >= 0 && var3 < this.framesTextureData.size()) { -+ MipmapHelper.copySubTexture(this, var3); - } - } -- - } - -- public int[] getFrameTextureData(int var1) { -- return (int[])this.a.get(var1); -+ public int[] getFrameTextureData(int par1) { -+ return (int[])this.framesTextureData.get(par1); - } - - public int getFrameCount() { -- return this.a.size(); -- } -- -- public void setIconWidth(int var1) { -- this.width = var1; -- } -- -- public void setIconHeight(int var1) { -- this.height = var1; -- } -- -- public void loadSprite(Resource var1) throws IOException { -+ List var1 = this.framesTextureData; -+ return var1 != null ? var1.size() : 1; -+ } -+ -+ public void setIconWidth(int par1) { -+ this.width = par1; -+ } -+ -+ public void setIconHeight(int par1) { -+ this.height = par1; -+ } -+ -+ public void loadSprite(Resource par1Resource) throws IOException { - this.resetSprite(); -- InputStream var2 = var1.getInputStream(); -- AnimationMetadataSection var3 = (AnimationMetadataSection)var1.getMetadata("animation"); -- BufferedImage var4 = ImageIO.read(var2); -+ InputStream var2 = par1Resource.getInputStream(); -+ AnimationMetadataSection var3 = (AnimationMetadataSection)par1Resource.getMetadata("animation"); -+ BufferedImage var4 = AAHelper.addBorder(this, par1Resource, ImageIO.read(var2)); - this.height = var4.getHeight(); - this.width = var4.getWidth(); - int[] var5 = new int[this.height * this.width]; - var4.getRGB(0, 0, this.width, this.height, var5, 0, this.width); -- if(var3 == null) { -- if(this.height != this.width) { -+ -+ if (var3 == null) { -+ if (this.height != this.width) { - throw new RuntimeException("broken aspect ratio and not an animation"); - } - -- this.a.add(var5); -+ this.framesTextureData.add(var5); - } else { - int var6 = this.height / this.width; - int var7 = this.width; - int var8 = this.width; - this.height = this.width; - int var10; -- if(var3.getFrameCount() > 0) { -+ -+ if (var3.getFrameCount() > 0) { - Iterator var9 = var3.getFrameIndexSet().iterator(); - -- while(var9.hasNext()) { -+ while (var9.hasNext()) { - var10 = ((Integer)var9.next()).intValue(); -- if(var10 >= var6) { -+ -+ if (var10 >= var6) { - throw new RuntimeException("invalid frameindex " + var10); - } - - this.allocateFrameTextureData(var10); -- this.a.set(var10, getFrameTextureData(var5, var7, var8, var10)); -+ this.framesTextureData.set(var10, getFrameTextureData(var5, var7, var8, var10)); - } - - this.animationMetadata = var3; - } else { - ArrayList var11 = Lists.newArrayList(); - -- for(var10 = 0; var10 < var6; ++var10) { -- this.a.add(getFrameTextureData(var5, var7, var8, var10)); -+ for (var10 = 0; var10 < var6; ++var10) { -+ this.framesTextureData.add(getFrameTextureData(var5, var7, var8, var10)); - var11.add(new AnimationFrame(var10, -1)); - } - - this.animationMetadata = new AnimationMetadataSection(var11, this.width, this.height, var3.getFrameTime()); - } - } -- - } - -- private void allocateFrameTextureData(int var1) { -- if(this.a.size() <= var1) { -- for(int var2 = this.a.size(); var2 <= var1; ++var2) { -- this.a.add((Object)null); -+ private void allocateFrameTextureData(int par1) { -+ if (this.framesTextureData.size() <= par1) { -+ for (int var2 = this.framesTextureData.size(); var2 <= par1; ++var2) { -+ this.framesTextureData.add((Object)null); - } -- - } - } - -- private static int[] getFrameTextureData(int[] var0, int var1, int var2, int var3) { -- int[] var4 = new int[var1 * var2]; -- System.arraycopy(var0, var3 * var4.length, var4, 0, var4.length); -+ private static int[] getFrameTextureData(int[] par0ArrayOfInteger, int par1, int par2, int par3) { -+ int[] var4 = new int[par1 * par2]; -+ System.arraycopy(par0ArrayOfInteger, par3 * var4.length, var4, 0, var4.length); - return var4; - } - - public void clearFramesTextureData() { -- this.a.clear(); -+ this.framesTextureData.clear(); - } - - public boolean hasAnimationMetadata() { - return this.animationMetadata != null; - } - -- public void setFramesTextureData(List var1) { -- this.a = var1; -+ public void setFramesTextureData(List par1List) { -+ this.framesTextureData = par1List; - } - - private void resetSprite() { -@@ -214,6 +250,6 @@ - } - - public String toString() { -- return "TextureAtlasSprite{name=\'" + this.i + '\'' + ", frameCount=" + this.a.size() + ", rotated=" + this.rotated + ", x=" + this.originX + ", y=" + this.originY + ", height=" + this.height + ", width=" + this.width + ", u0=" + this.minU + ", u1=" + this.maxU + ", v0=" + this.minV + ", v1=" + this.maxV + '}'; -+ return "TextureAtlasSprite{name=\'" + this.iconName + '\'' + ", frameCount=" + this.framesTextureData.size() + ", rotated=" + this.rotated + ", x=" + this.originX + ", y=" + this.originY + ", height=" + this.height + ", width=" + this.width + ", u0=" + this.minU + ", u1=" + this.maxU + ", v0=" + this.minV + ", v1=" + this.maxV + '}'; - } - } ---- net/minecraft/src/EnumOptions.java -+++ net/minecraft/src/EnumOptions.java -@@ -33,18 +33,18 @@ - CHAT_WIDTH("options.chat.width", true, false), - CHAT_HEIGHT_FOCUSED("options.chat.height.focused", true, false), - CHAT_HEIGHT_UNFOCUSED("options.chat.height.unfocused", true, false); -- - private final boolean enumFloat; - private final boolean enumBoolean; -- private final String I; -+ private final String enumString; - -- public static EnumOptions getEnumOptions(int var0) { -+ public static EnumOptions getEnumOptions(int par0) { - EnumOptions[] var1 = values(); - int var2 = var1.length; - -- for(int var3 = 0; var3 < var2; ++var3) { -+ for (int var3 = 0; var3 < var2; ++var3) { - EnumOptions var4 = var1[var3]; -- if(var4.returnEnumOrdinal() == var0) { -+ -+ if (var4.returnEnumOrdinal() == par0) { - return var4; - } - } -@@ -52,10 +52,10 @@ - return null; - } - -- private EnumOptions(String var3, boolean var4, boolean var5) { -- this.I = var3; -- this.enumFloat = var4; -- this.enumBoolean = var5; -+ private EnumOptions(String par3Str, boolean par4, boolean par5) { -+ this.enumString = par3Str; -+ this.enumFloat = par4; -+ this.enumBoolean = par5; - } - - public boolean getEnumFloat() { -@@ -71,6 +71,6 @@ - } - - public String getEnumString() { -- return this.I; -+ return this.enumString; - } - } ---- net/minecraft/src/CallableMouseLocation.java -+++ net/minecraft/src/CallableMouseLocation.java -@@ -5,17 +5,19 @@ - - class CallableMouseLocation implements Callable { - final int field_90026_a; -+ - final int field_90024_b; -+ - final EntityRenderer theEntityRenderer; - -- CallableMouseLocation(EntityRenderer var1, int var2, int var3) { -- this.theEntityRenderer = var1; -- this.field_90026_a = var2; -- this.field_90024_b = var3; -+ CallableMouseLocation(EntityRenderer par1EntityRenderer, int par2, int par3) { -+ this.theEntityRenderer = par1EntityRenderer; -+ this.field_90026_a = par2; -+ this.field_90024_b = par3; - } - - public String callMouseLocation() { -- return String.format("Scaled: (%d, %d). Absolute: (%d, %d)", new Object[]{Integer.valueOf(this.field_90026_a), Integer.valueOf(this.field_90024_b), Integer.valueOf(Mouse.getX()), Integer.valueOf(Mouse.getY())}); -+ return String.format("Scaled: (%d, %d). Absolute: (%d, %d)", new Object[] {Integer.valueOf(this.field_90026_a), Integer.valueOf(this.field_90024_b), Integer.valueOf(Mouse.getX()), Integer.valueOf(Mouse.getY())}); - } - - public Object call() { ---- net/minecraft/src/TileEntityCommandBlock.java -+++ net/minecraft/src/TileEntityCommandBlock.java -@@ -4,65 +4,96 @@ - - public class TileEntityCommandBlock extends TileEntity implements ICommandSender { - private int succesCount; -- private String b = ""; -- private String c = "@"; -- -- public void setCommand(String var1) { -- this.b = var1; -+ -+ /** The command this block will execute when powered. */ -+ private String command = ""; -+ -+ /** The name of command sender (usually username, but possibly "Rcon") */ -+ private String commandSenderName = "@"; -+ -+ /** -+ * Sets the command this block will execute when powered. -+ */ -+ public void setCommand(String par1Str) { -+ this.command = par1Str; - this.onInventoryChanged(); - } - -+ /** -+ * Return the command this command block is set to execute. -+ */ - public String getCommand() { -- return this.b; -+ return this.command; - } - -- public int executeCommandOnPowered(World var1) { -- if(var1.isRemote) { -+ /** -+ * Execute the command, called when the command block is powered. -+ */ -+ public int executeCommandOnPowered(World par1World) { -+ if (par1World.isRemote) { - return 0; - } else { - MinecraftServer var2 = MinecraftServer.getServer(); -- if(var2 != null && var2.isCommandBlockEnabled()) { -+ -+ if (var2 != null && var2.isCommandBlockEnabled()) { - ICommandManager var3 = var2.getCommandManager(); -- return var3.executeCommand(this, this.b); -+ return var3.executeCommand(this, this.command); - } else { - return 0; - } - } - } - -+ /** -+ * Gets the name of this command sender (usually username, but possibly "Rcon") -+ */ - public String getCommandSenderName() { -- return this.c; -- } -- -- public void setCommandSenderName(String var1) { -- this.c = var1; -- } -- -- public void sendChatToPlayer(ChatMessageComponent var1) { -- } -- -- public boolean canCommandSenderUseCommand(int var1, String var2) { -- return var1 <= 2; -- } -- -- public void writeToNBT(NBTTagCompound var1) { -- super.writeToNBT(var1); -- var1.setString("Command", this.b); -- var1.setInteger("SuccessCount", this.succesCount); -- var1.setString("CustomName", this.c); -- } -- -- public void readFromNBT(NBTTagCompound var1) { -- super.readFromNBT(var1); -- this.b = var1.getString("Command"); -- this.succesCount = var1.getInteger("SuccessCount"); -- if(var1.hasKey("CustomName")) { -- this.c = var1.getString("CustomName"); -+ return this.commandSenderName; -+ } -+ -+ /** -+ * Sets the name of the command sender -+ */ -+ public void setCommandSenderName(String par1Str) { -+ this.commandSenderName = par1Str; -+ } -+ -+ public void sendChatToPlayer(ChatMessageComponent par1ChatMessageComponent) {} -+ -+ /** -+ * Returns true if the command sender is allowed to use the given command. -+ */ -+ public boolean canCommandSenderUseCommand(int par1, String par2Str) { -+ return par1 <= 2; -+ } -+ -+ /** -+ * Writes a tile entity to NBT. -+ */ -+ public void writeToNBT(NBTTagCompound par1NBTTagCompound) { -+ super.writeToNBT(par1NBTTagCompound); -+ par1NBTTagCompound.setString("Command", this.command); -+ par1NBTTagCompound.setInteger("SuccessCount", this.succesCount); -+ par1NBTTagCompound.setString("CustomName", this.commandSenderName); -+ } -+ -+ /** -+ * Reads a tile entity from NBT. -+ */ -+ public void readFromNBT(NBTTagCompound par1NBTTagCompound) { -+ super.readFromNBT(par1NBTTagCompound); -+ this.command = par1NBTTagCompound.getString("Command"); -+ this.succesCount = par1NBTTagCompound.getInteger("SuccessCount"); -+ -+ if (par1NBTTagCompound.hasKey("CustomName")) { -+ this.commandSenderName = par1NBTTagCompound.getString("CustomName"); - } -- - } - -- public ChunkCoordinates getCommandSenderPosition() { -+ /** -+ * Return the position for this command sender. -+ */ -+ public ChunkCoordinates getPlayerCoordinates() { - return new ChunkCoordinates(this.xCoord, this.yCoord, this.zCoord); - } - -@@ -70,17 +101,20 @@ - return this.getWorldObj(); - } - -+ /** -+ * Overriden in a sign to provide the text. -+ */ - public Packet getDescriptionPacket() { - NBTTagCompound var1 = new NBTTagCompound(); - this.writeToNBT(var1); - return new Packet132TileEntityData(this.xCoord, this.yCoord, this.zCoord, 2, var1); - } - -- public int getSignalStrength() { -+ public int func_96103_d() { - return this.succesCount; - } - -- public void setSignalStrength(int var1) { -- this.succesCount = var1; -+ public void func_96102_a(int par1) { -+ this.succesCount = par1; - } - } ---- net/minecraft/src/PlayerNotFoundException.java -+++ net/minecraft/src/PlayerNotFoundException.java -@@ -5,7 +5,7 @@ - this("commands.generic.player.notFound", new Object[0]); - } - -- public PlayerNotFoundException(String var1, Object... var2) { -- super(var1, var2); -+ public PlayerNotFoundException(String par1Str, Object ... par2ArrayOfObj) { -+ super(par1Str, par2ArrayOfObj); - } - } ---- net/minecraft/src/ItemArmor.java -+++ net/minecraft/src/ItemArmor.java -@@ -1,35 +1,55 @@ - package net.minecraft.src; - -+// MCPatcher Start -+import com.prupe.mcpatcher.cc.ColorizeEntity; -+// MCPatcher End -+ - public class ItemArmor extends Item { -- private static final int[] maxDamageArray = new int[]{11, 16, 15, 13}; -- private static final String[] cC = new String[]{"leather_helmet_overlay", "leather_chestplate_overlay", "leather_leggings_overlay", "leather_boots_overlay"}; -- public static final String[] a = new String[]{"empty_armor_slot_helmet", "empty_armor_slot_chestplate", "empty_armor_slot_leggings", "empty_armor_slot_boots"}; -+ -+ /** Holds the 'base' maxDamage that each armorType have. */ -+ private static final int[] maxDamageArray = new int[] {11, 16, 15, 13}; -+ private static final String[] field_94606_cu = new String[] {"leather_helmet_overlay", "leather_chestplate_overlay", "leather_leggings_overlay", "leather_boots_overlay"}; -+ public static final String[] field_94603_a = new String[] {"empty_armor_slot_helmet", "empty_armor_slot_chestplate", "empty_armor_slot_leggings", "empty_armor_slot_boots"}; - private static final IBehaviorDispenseItem field_96605_cw = new BehaviorDispenseArmor(); -+ -+ /** -+ * Stores the armor type: 0 is helmet, 1 is plate, 2 is legs and 3 is boots -+ */ - public final int armorType; -+ -+ /** Holds the amount of damage that the armor reduces at full durability. */ - public final int damageReduceAmount; -+ -+ /** -+ * Used on RenderPlayer to select the correspondent armor to be rendered on the player: 0 is cloth, 1 is chain, 2 is -+ * iron, 3 is diamond and 4 is gold. -+ */ - public final int renderIndex; -+ -+ /** The EnumArmorMaterial used for this ItemArmor */ - private final EnumArmorMaterial material; - private Icon field_94605_cw; - private Icon field_94604_cx; - -- public ItemArmor(int var1, EnumArmorMaterial var2, int var3, int var4) { -- super(var1); -- this.material = var2; -- this.armorType = var4; -- this.renderIndex = var3; -- this.damageReduceAmount = var2.getDamageReductionAmount(var4); -- this.setMaxDamage(var2.getDurability(var4)); -+ public ItemArmor(int par1, EnumArmorMaterial par2EnumArmorMaterial, int par3, int par4) { -+ super(par1); -+ this.material = par2EnumArmorMaterial; -+ this.armorType = par4; -+ this.renderIndex = par3; -+ this.damageReduceAmount = par2EnumArmorMaterial.getDamageReductionAmount(par4); -+ this.setMaxDamage(par2EnumArmorMaterial.getDurability(par4)); - this.maxStackSize = 1; - this.setCreativeTab(CreativeTabs.tabCombat); - BlockDispenser.dispenseBehaviorRegistry.putObject(this, field_96605_cw); - } - -- public int getColorFromItemStack(ItemStack var1, int var2) { -- if(var2 > 0) { -+ public int getColorFromItemStack(ItemStack par1ItemStack, int par2) { -+ if (par2 > 0) { - return 16777215; - } else { -- int var3 = this.getColor(var1); -- if(var3 < 0) { -+ int var3 = this.getColor(par1ItemStack); -+ -+ if (var3 < 0) { - var3 = 16777215; - } - -@@ -41,107 +61,149 @@ - return this.material == EnumArmorMaterial.CLOTH; - } - -+ /** -+ * Return the enchantability factor of the item, most of the time is based on material. -+ */ - public int getItemEnchantability() { - return this.material.getEnchantability(); - } - -+ /** -+ * Return the armor material for this armor item. -+ */ - public EnumArmorMaterial getArmorMaterial() { - return this.material; - } - -- public boolean hasColor(ItemStack var1) { -- return this.material != EnumArmorMaterial.CLOTH ? false : (!var1.hasTagCompound() ? false : (!var1.getTagCompound().hasKey("display") ? false : var1.getTagCompound().getCompoundTag("display").hasKey("color"))); -+ /** -+ * Return whether the specified armor ItemStack has a color. -+ */ -+ public boolean hasColor(ItemStack par1ItemStack) { -+ return this.material != EnumArmorMaterial.CLOTH ? false : (!par1ItemStack.hasTagCompound() ? false : (!par1ItemStack.getTagCompound().hasKey("display") ? false : par1ItemStack.getTagCompound().getCompoundTag("display").hasKey("color"))); - } - -- public int getColor(ItemStack var1) { -- if(this.material != EnumArmorMaterial.CLOTH) { -+ /** -+ * Return the color for the specified armor ItemStack. -+ */ -+ public int getColor(ItemStack par1ItemStack) { -+ if (this.material != EnumArmorMaterial.CLOTH) { - return -1; - } else { -- NBTTagCompound var2 = var1.getTagCompound(); -- if(var2 == null) { -- return 10511680; -+ NBTTagCompound var2 = par1ItemStack.getTagCompound(); -+ -+ if (var2 == null) { -+ // MCPatcher Start -+ return ColorizeEntity.undyedLeatherColor; -+ // MCPatcher End - } else { - NBTTagCompound var3 = var2.getCompoundTag("display"); -- return var3 == null ? 10511680 : (var3.hasKey("color") ? var3.getInteger("color") : 10511680); -+ // MCPatcher Start -+ return var3 == null ? ColorizeEntity.undyedLeatherColor : (var3.hasKey("color") ? var3.getInteger("color") : ColorizeEntity.undyedLeatherColor); -+ // MCPatcher End - } - } - } - -- public Icon getIconFromDamageForRenderPass(int var1, int var2) { -- return var2 == 1 ? this.field_94605_cw : super.getIconFromDamageForRenderPass(var1, var2); -+ /** -+ * Gets an icon index based on an item's damage value and the given render pass -+ */ -+ public Icon getIconFromDamageForRenderPass(int par1, int par2) { -+ return par2 == 1 ? this.field_94605_cw : super.getIconFromDamageForRenderPass(par1, par2); - } - -- public void removeColor(ItemStack var1) { -- if(this.material == EnumArmorMaterial.CLOTH) { -- NBTTagCompound var2 = var1.getTagCompound(); -- if(var2 != null) { -+ /** -+ * Remove the color from the specified armor ItemStack. -+ */ -+ public void removeColor(ItemStack par1ItemStack) { -+ if (this.material == EnumArmorMaterial.CLOTH) { -+ NBTTagCompound var2 = par1ItemStack.getTagCompound(); -+ -+ if (var2 != null) { - NBTTagCompound var3 = var2.getCompoundTag("display"); -- if(var3.hasKey("color")) { -+ -+ if (var3.hasKey("color")) { - var3.removeTag("color"); - } -- - } - } - } - -- public void func_82813_b(ItemStack var1, int var2) { -- if(this.material != EnumArmorMaterial.CLOTH) { -+ public void func_82813_b(ItemStack par1ItemStack, int par2) { -+ if (this.material != EnumArmorMaterial.CLOTH) { - throw new UnsupportedOperationException("Can\'t dye non-leather!"); - } else { -- NBTTagCompound var3 = var1.getTagCompound(); -- if(var3 == null) { -+ NBTTagCompound var3 = par1ItemStack.getTagCompound(); -+ -+ if (var3 == null) { - var3 = new NBTTagCompound(); -- var1.setTagCompound(var3); -+ par1ItemStack.setTagCompound(var3); - } - - NBTTagCompound var4 = var3.getCompoundTag("display"); -- if(!var3.hasKey("display")) { -+ -+ if (!var3.hasKey("display")) { - var3.setCompoundTag("display", var4); - } - -- var4.setInteger("color", var2); -- } -- } -- -- public boolean getIsRepairable(ItemStack var1, ItemStack var2) { -- return this.material.getArmorCraftingMaterial() == var2.itemID ? true : super.getIsRepairable(var1, var2); -- } -- -- public void registerIcons(IconRegister var1) { -- super.registerIcons(var1); -- if(this.material == EnumArmorMaterial.CLOTH) { -- this.field_94605_cw = var1.registerIcon(cC[this.armorType]); -- } -- -- this.field_94604_cx = var1.registerIcon(a[this.armorType]); -- } -- -- public ItemStack onItemRightClick(ItemStack var1, World var2, EntityPlayer var3) { -- int var4 = EntityLiving.getArmorPosition(var1) - 1; -- ItemStack var5 = var3.getCurrentArmor(var4); -- if(var5 == null) { -- var3.setCurrentItemOrArmor(var4, var1.copy()); -- var1.stackSize = 0; -- } -- -- return var1; -- } -- -- public static Icon func_94602_b(int var0) { -- switch(var0) { -- case 0: -- return Item.helmetDiamond.field_94604_cx; -- case 1: -- return Item.plateDiamond.field_94604_cx; -- case 2: -- return Item.legsDiamond.field_94604_cx; -- case 3: -- return Item.bootsDiamond.field_94604_cx; -- default: -- return null; -- } -- } -- -+ var4.setInteger("color", par2); -+ } -+ } -+ -+ /** -+ * Return whether this item is repairable in an anvil. -+ */ -+ public boolean getIsRepairable(ItemStack par1ItemStack, ItemStack par2ItemStack) { -+ return this.material.getArmorCraftingMaterial() == par2ItemStack.itemID ? true : super.getIsRepairable(par1ItemStack, par2ItemStack); -+ } -+ -+ public void registerIcons(IconRegister par1IconRegister) { -+ super.registerIcons(par1IconRegister); -+ -+ if (this.material == EnumArmorMaterial.CLOTH) { -+ this.field_94605_cw = par1IconRegister.registerIcon(field_94606_cu[this.armorType]); -+ } -+ -+ this.field_94604_cx = par1IconRegister.registerIcon(field_94603_a[this.armorType]); -+ } -+ -+ /** -+ * Called whenever this item is equipped and the right mouse button is pressed. Args: itemStack, world, entityPlayer -+ */ -+ public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) { -+ int var4 = EntityLiving.getArmorPosition(par1ItemStack) - 1; -+ ItemStack var5 = par3EntityPlayer.getCurrentArmor(var4); -+ -+ if (var5 == null) { -+ par3EntityPlayer.setCurrentItemOrArmor(var4, par1ItemStack.copy()); -+ par1ItemStack.stackSize = 0; -+ } -+ -+ return par1ItemStack; -+ } -+ -+ public static Icon func_94602_b(int par0) { -+ switch (par0) { -+ case 0: -+ return Item.helmetDiamond.field_94604_cx; -+ -+ case 1: -+ return Item.plateDiamond.field_94604_cx; -+ -+ case 2: -+ return Item.legsDiamond.field_94604_cx; -+ -+ case 3: -+ return Item.bootsDiamond.field_94604_cx; -+ -+ default: -+ return null; -+ } -+ } -+ -+ /** -+ * Returns the 'max damage' factor array for the armor, each piece of armor have a durability factor (that gets -+ * multiplied by armor material factor) -+ */ - static int[] getMaxDamageArray() { - return maxDamageArray; - } ---- /dev/null -+++ org/spoutcraft/client/packet/PacketManager.java -@@ -1,0 +1,79 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.client.packet; -+ -+import net.minecraft.src.Minecraft; -+import net.minecraft.src.EntityClientPlayerMP; -+import net.minecraft.src.Packet; -+import net.minecraft.src.Packet250CustomPayload; -+ -+import org.spoutcraft.client.SpoutClient; -+ -+public class PacketManager { -+ private static Minecraft mc; -+ -+ public PacketManager() { -+ PacketManager.mc = SpoutClient.getHandle(); -+ } -+ -+ /** -+ * Sends the packet to the plugin when it is enabled on the server -+ * @param packet the Packet to send -+ * @returns if the sending was successful -+ */ -+ public boolean sendSpoutPacket(SpoutPacket packet) { -+ if (mc.thePlayer instanceof EntityClientPlayerMP && SpoutClient.getInstance().isSpoutEnabled()) { -+ EntityClientPlayerMP player = (EntityClientPlayerMP)mc.thePlayer; -+ player.sendQueue.addToSendQueue(new CustomPacket(packet)); -+ return true; -+ } -+ return false; -+ } -+ -+ /** -+ * Sends a minecraft custom packet to the server -+ * -+ * @param channel the channel name -+ * @param data the data array -+ */ -+ public void sendCustomPacket(String channel, byte[] data) { -+ sendPacket(new Packet250CustomPayload(channel, data)); -+ } -+ -+ private void sendPacket(Packet packet) { -+ EntityClientPlayerMP player = (EntityClientPlayerMP)mc.thePlayer; -+ if (player != null) { -+ player.sendQueue.addToSendQueue(packet); -+ } -+ } -+ -+ /** -+ * Sends the packet to the plugin when it is enabled on the server and has version >= pluginVersion -+ * @param packet the Packet to send -+ * @param pluginVersion the minimum version of the plugin -+ * @returns if the sending was successful -+ */ -+ public boolean sendSpoutPacket(SpoutPacket packet, int pluginVersion) { -+ if (SpoutClient.getInstance().getServerVersion() >= pluginVersion) { -+ return sendSpoutPacket(packet); -+ } -+ return false; -+ } -+} ---- net/minecraft/src/ItemSnowball.java -+++ net/minecraft/src/ItemSnowball.java -@@ -1,22 +1,26 @@ - package net.minecraft.src; - - public class ItemSnowball extends Item { -- public ItemSnowball(int var1) { -- super(var1); -+ public ItemSnowball(int par1) { -+ super(par1); - this.maxStackSize = 16; - this.setCreativeTab(CreativeTabs.tabMisc); - } - -- public ItemStack onItemRightClick(ItemStack var1, World var2, EntityPlayer var3) { -- if(!var3.capabilities.isCreativeMode) { -- --var1.stackSize; -- } -- -- var2.playSoundAtEntity(var3, "random.bow", 0.5F, 0.4F / (f.nextFloat() * 0.4F + 0.8F)); -- if(!var2.isRemote) { -- var2.spawnEntityInWorld(new EntitySnowball(var2, var3)); -- } -- -- return var1; -+ /** -+ * Called whenever this item is equipped and the right mouse button is pressed. Args: itemStack, world, entityPlayer -+ */ -+ public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) { -+ if (!par3EntityPlayer.capabilities.isCreativeMode) { -+ --par1ItemStack.stackSize; -+ } -+ -+ par2World.playSoundAtEntity(par3EntityPlayer, "random.bow", 0.5F, 0.4F / (itemRand.nextFloat() * 0.4F + 0.8F)); -+ -+ if (!par2World.isRemote) { -+ par2World.spawnEntityInWorld(new EntitySnowball(par2World, par3EntityPlayer)); -+ } -+ -+ return par1ItemStack; - } - } ---- net/minecraft/src/ModelSnowMan.java -+++ net/minecraft/src/ModelSnowMan.java -@@ -27,11 +27,16 @@ - this.bottomBody.setRotationPoint(0.0F, 0.0F + var1 + 20.0F, 0.0F); - } - -- public void setRotationAngles(float var1, float var2, float var3, float var4, float var5, float var6, Entity var7) { -- super.setRotationAngles(var1, var2, var3, var4, var5, var6, var7); -- this.head.rotateAngleY = var4 / (180.0F / (float)Math.PI); -- this.head.rotateAngleX = var5 / (180.0F / (float)Math.PI); -- this.body.rotateAngleY = var4 / (180.0F / (float)Math.PI) * 0.25F; -+ /** -+ * Sets the model's various rotation angles. For bipeds, par1 and par2 are used for animating the movement of arms and -+ * legs, where par1 represents the time(so that arms and legs swing back and forth) and par2 represents how "far" arms -+ * and legs can swing at most. -+ */ -+ public void setRotationAngles(float par1, float par2, float par3, float par4, float par5, float par6, Entity par7Entity) { -+ super.setRotationAngles(par1, par2, par3, par4, par5, par6, par7Entity); -+ this.head.rotateAngleY = par4 / (180F / (float)Math.PI); -+ this.head.rotateAngleX = par5 / (180F / (float)Math.PI); -+ this.body.rotateAngleY = par4 / (180F / (float)Math.PI) * 0.25F; - float var8 = MathHelper.sin(this.body.rotateAngleY); - float var9 = MathHelper.cos(this.body.rotateAngleY); - this.rightHand.rotateAngleZ = 1.0F; -@@ -44,12 +49,15 @@ - this.leftHand.rotationPointZ = var8 * 5.0F; - } - -- public void render(Entity var1, float var2, float var3, float var4, float var5, float var6, float var7) { -- this.setRotationAngles(var2, var3, var4, var5, var6, var7, var1); -- this.body.render(var7); -- this.bottomBody.render(var7); -- this.head.render(var7); -- this.rightHand.render(var7); -- this.leftHand.render(var7); -+ /** -+ * Sets the models various rotation angles then renders the model. -+ */ -+ public void render(Entity par1Entity, float par2, float par3, float par4, float par5, float par6, float par7) { -+ this.setRotationAngles(par2, par3, par4, par5, par6, par7, par1Entity); -+ this.body.render(par7); -+ this.bottomBody.render(par7); -+ this.head.render(par7); -+ this.rightHand.render(par7); -+ this.leftHand.render(par7); - } - } ---- net/minecraft/src/ValueObject.java -+++ net/minecraft/src/ValueObject.java -@@ -9,12 +9,14 @@ - Field[] var2 = this.getClass().getFields(); - int var3 = var2.length; - -- for(int var4 = 0; var4 < var3; ++var4) { -+ for (int var4 = 0; var4 < var3; ++var4) { - Field var5 = var2[var4]; -- if(!func_96394_a(var5)) { -+ -+ if (!func_96394_a(var5)) { - try { - var1.append(var5.getName()).append("=").append(var5.get(this)).append(" "); - } catch (IllegalAccessException var7) { -+ ; - } - } - } -@@ -24,7 +26,7 @@ - return var1.toString(); - } - -- private static boolean func_96394_a(Field var0) { -- return Modifier.isStatic(var0.getModifiers()); -+ private static boolean func_96394_a(Field par0Field) { -+ return Modifier.isStatic(par0Field.getModifiers()); - } - } ---- /dev/null -+++ org/spoutcraft/client/gui/settings/controls/ConnectedTexturesButton.java -@@ -1,0 +1,50 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.client.gui.settings.controls; -+ -+import com.prupe.mcpatcher.TexturePackChangeHandler; -+ -+import net.minecraft.src.Minecraft; -+ -+import org.spoutcraft.client.SpoutClient; -+import org.spoutcraft.client.config.Configuration; -+ -+public class ConnectedTexturesButton extends AutomatedCheckBox { -+ public ConnectedTexturesButton() { -+ super("Connected Textures"); -+ setChecked(Configuration.isConnectedTextures()); -+ setTooltip("Connects textures of identical blocks next to each other for aesthetics.\n\nCertain texture packs may add additional enhancements"); -+ } -+ -+ @Override -+ public void onButtonClick() { -+ Configuration.setConnectedTextures(!Configuration.isConnectedTextures()); -+ Configuration.write(); -+ -+ Minecraft game = SpoutClient.getHandle(); -+ TexturePackChangeHandler.earlyInitialize("com.prupe.mcpatcher.mob.CTMUtils", "reset"); -+ TexturePackChangeHandler.beforeChange1(true); -+ game.refreshResources(); -+ TexturePackChangeHandler.afterChange1(true); -+ if (Minecraft.getMinecraft().theWorld != null) { -+ Minecraft.getMinecraft().renderGlobal.updateAllRenderers(); -+ } -+ } -+} ---- net/minecraft/src/PotionAbsoption.java -+++ net/minecraft/src/PotionAbsoption.java -@@ -1,17 +1,17 @@ - package net.minecraft.src; - - public class PotionAbsoption extends Potion { -- protected PotionAbsoption(int var1, boolean var2, int var3) { -- super(var1, var2, var3); -- } -- -- public void removeAttributesModifiersFromEntity(EntityLivingBase var1, BaseAttributeMap var2, int var3) { -- var1.setAbsorptionAmount(var1.getAbsorptionAmount() - (float)(4 * (var3 + 1))); -- super.removeAttributesModifiersFromEntity(var1, var2, var3); -- } -- -- public void applyAttributesModifiersToEntity(EntityLivingBase var1, BaseAttributeMap var2, int var3) { -- var1.setAbsorptionAmount(var1.getAbsorptionAmount() + (float)(4 * (var3 + 1))); -- super.applyAttributesModifiersToEntity(var1, var2, var3); -+ protected PotionAbsoption(int par1, boolean par2, int par3) { -+ super(par1, par2, par3); -+ } -+ -+ public void removeAttributesModifiersFromEntity(EntityLivingBase par1EntityLivingBase, BaseAttributeMap par2BaseAttributeMap, int par3) { -+ par1EntityLivingBase.setAbsorptionAmount(par1EntityLivingBase.getAbsorptionAmount() - (float)(4 * (par3 + 1))); -+ super.removeAttributesModifiersFromEntity(par1EntityLivingBase, par2BaseAttributeMap, par3); -+ } -+ -+ public void applyAttributesModifiersToEntity(EntityLivingBase par1EntityLivingBase, BaseAttributeMap par2BaseAttributeMap, int par3) { -+ par1EntityLivingBase.setAbsorptionAmount(par1EntityLivingBase.getAbsorptionAmount() + (float)(4 * (par3 + 1))); -+ super.applyAttributesModifiersToEntity(par1EntityLivingBase, par2BaseAttributeMap, par3); - } - } ---- net/minecraft/src/StructureStrongholdStart.java -+++ net/minecraft/src/StructureStrongholdStart.java -@@ -4,24 +4,23 @@ - import java.util.Random; - - public class StructureStrongholdStart extends StructureStart { -- public StructureStrongholdStart() { -- } -+ public StructureStrongholdStart() {} - -- public StructureStrongholdStart(World var1, Random var2, int var3, int var4) { -- super(var3, var4); -+ public StructureStrongholdStart(World par1World, Random par2Random, int par3, int par4) { -+ super(par3, par4); - StructureStrongholdPieces.prepareStructurePieces(); -- ComponentStrongholdStairs2 var5 = new ComponentStrongholdStairs2(0, var2, (var3 << 4) + 2, (var4 << 4) + 2); -- this.a.add(var5); -- var5.buildComponent(var5, this.a, var2); -- List var6 = var5.c; -+ ComponentStrongholdStairs2 var5 = new ComponentStrongholdStairs2(0, par2Random, (par3 << 4) + 2, (par4 << 4) + 2); -+ this.components.add(var5); -+ var5.buildComponent(var5, this.components, par2Random); -+ List var6 = var5.field_75026_c; - -- while(!var6.isEmpty()) { -- int var7 = var2.nextInt(var6.size()); -+ while (!var6.isEmpty()) { -+ int var7 = par2Random.nextInt(var6.size()); - StructureComponent var8 = (StructureComponent)var6.remove(var7); -- var8.buildComponent(var5, this.a, var2); -+ var8.buildComponent(var5, this.components, par2Random); - } - - this.updateBoundingBox(); -- this.markAvailableHeight(var1, var2, 10); -+ this.markAvailableHeight(par1World, par2Random, 10); - } - } ---- net/minecraft/src/WorldGenLiquids.java -+++ net/minecraft/src/WorldGenLiquids.java -@@ -3,59 +3,63 @@ - import java.util.Random; - - public class WorldGenLiquids extends WorldGenerator { -+ -+ /** The ID of the liquid block used in this liquid generator. */ - private int liquidBlockId; - -- public WorldGenLiquids(int var1) { -- this.liquidBlockId = var1; -+ public WorldGenLiquids(int par1) { -+ this.liquidBlockId = par1; - } - -- public boolean generate(World var1, Random var2, int var3, int var4, int var5) { -- if(var1.getBlockId(var3, var4 + 1, var5) != Block.stone.blockID) { -- return false; -- } else if(var1.getBlockId(var3, var4 - 1, var5) != Block.stone.blockID) { -- return false; -- } else if(var1.getBlockId(var3, var4, var5) != 0 && var1.getBlockId(var3, var4, var5) != Block.stone.blockID) { -+ public boolean generate(World par1World, Random par2Random, int par3, int par4, int par5) { -+ if (par1World.getBlockId(par3, par4 + 1, par5) != Block.stone.blockID) { -+ return false; -+ } else if (par1World.getBlockId(par3, par4 - 1, par5) != Block.stone.blockID) { -+ return false; -+ } else if (par1World.getBlockId(par3, par4, par5) != 0 && par1World.getBlockId(par3, par4, par5) != Block.stone.blockID) { - return false; - } else { - int var6 = 0; -- if(var1.getBlockId(var3 - 1, var4, var5) == Block.stone.blockID) { -- ++var6; -- } -- -- if(var1.getBlockId(var3 + 1, var4, var5) == Block.stone.blockID) { -- ++var6; -- } -- -- if(var1.getBlockId(var3, var4, var5 - 1) == Block.stone.blockID) { -- ++var6; -- } -- -- if(var1.getBlockId(var3, var4, var5 + 1) == Block.stone.blockID) { -+ -+ if (par1World.getBlockId(par3 - 1, par4, par5) == Block.stone.blockID) { -+ ++var6; -+ } -+ -+ if (par1World.getBlockId(par3 + 1, par4, par5) == Block.stone.blockID) { -+ ++var6; -+ } -+ -+ if (par1World.getBlockId(par3, par4, par5 - 1) == Block.stone.blockID) { -+ ++var6; -+ } -+ -+ if (par1World.getBlockId(par3, par4, par5 + 1) == Block.stone.blockID) { - ++var6; - } - - int var7 = 0; -- if(var1.isAirBlock(var3 - 1, var4, var5)) { -- ++var7; -- } -- -- if(var1.isAirBlock(var3 + 1, var4, var5)) { -- ++var7; -- } -- -- if(var1.isAirBlock(var3, var4, var5 - 1)) { -- ++var7; -- } -- -- if(var1.isAirBlock(var3, var4, var5 + 1)) { -- ++var7; -- } -- -- if(var6 == 3 && var7 == 1) { -- var1.setBlock(var3, var4, var5, this.liquidBlockId, 0, 2); -- var1.scheduledUpdatesAreImmediate = true; -- Block.blocksList[this.liquidBlockId].updateTick(var1, var3, var4, var5, var2); -- var1.scheduledUpdatesAreImmediate = false; -+ -+ if (par1World.isAirBlock(par3 - 1, par4, par5)) { -+ ++var7; -+ } -+ -+ if (par1World.isAirBlock(par3 + 1, par4, par5)) { -+ ++var7; -+ } -+ -+ if (par1World.isAirBlock(par3, par4, par5 - 1)) { -+ ++var7; -+ } -+ -+ if (par1World.isAirBlock(par3, par4, par5 + 1)) { -+ ++var7; -+ } -+ -+ if (var6 == 3 && var7 == 1) { -+ par1World.setBlock(par3, par4, par5, this.liquidBlockId, 0, 2); -+ par1World.scheduledUpdatesAreImmediate = true; -+ Block.blocksList[this.liquidBlockId].updateTick(par1World, par3, par4, par5, par2Random); -+ par1World.scheduledUpdatesAreImmediate = false; - } - - return true; ---- /dev/null -+++ com/prupe/mcpatcher/MCLogger.java -@@ -1,0 +1,156 @@ -+package com.prupe.mcpatcher; -+ -+import com.prupe.mcpatcher.MCLogger$1; -+import com.prupe.mcpatcher.MCLogger$ErrorLevel; -+import java.util.HashMap; -+import java.util.logging.Level; -+import java.util.logging.Logger; -+ -+public class MCLogger { -+ private static final HashMap allLoggers = new HashMap(); -+ public static final Level ERROR = new MCLogger$ErrorLevel(); -+ private static final long FLOOD_INTERVAL = 1000L; -+ private static final long FLOOD_REPORT_INTERVAL = 5000L; -+ private static final int FLOOD_LIMIT = 100; -+ private static final int FLOOD_LEVEL = Level.CONFIG.intValue(); -+ private final String logPrefix; -+ private final Logger logger; -+ private boolean flooding; -+ private long lastFloodReport; -+ private int floodCount; -+ private long lastMessage = System.currentTimeMillis(); -+ private boolean enabled = false; -+ -+ public static MCLogger getLogger(String category) { -+ return getLogger(category, category); -+ } -+ -+ public static synchronized MCLogger getLogger(String category, String logPrefix) { -+ MCLogger logger = (MCLogger)allLoggers.get(category); -+ -+ if (logger == null) { -+ logger = new MCLogger(category, logPrefix); -+ allLoggers.put(category, logger); -+ } -+ -+ return logger; -+ } -+ -+ private MCLogger(String category, String logPrefix) { -+ this.logPrefix = logPrefix; -+ this.logger = Logger.getLogger(category); -+ this.logger.setLevel(Config.getLogLevel(category)); -+ this.logger.setUseParentHandlers(false); -+ this.logger.addHandler(new MCLogger$1(this)); -+ } -+ -+ private boolean checkFlood() { -+ long now = System.currentTimeMillis(); -+ boolean showFloodMessage = false; -+ -+ if (now - this.lastMessage > 1000L) { -+ if (this.flooding) { -+ this.reportFlooding(now); -+ this.flooding = false; -+ } else { -+ this.floodCount = 0; -+ } -+ } else if (this.flooding && now - this.lastFloodReport > 5000L) { -+ this.reportFlooding(now); -+ showFloodMessage = true; -+ } -+ -+ this.lastMessage = now; -+ ++this.floodCount; -+ -+ if (this.flooding) { -+ return showFloodMessage; -+ } else if (this.floodCount > 100) { -+ this.flooding = true; -+ this.lastFloodReport = now; -+ this.reportFlooding(now); -+ return false; -+ } else { -+ return true; -+ } -+ } -+ -+ private void reportFlooding(long now) { -+ if (this.floodCount > 0) { -+ this.logger.log(Level.WARNING, String.format("%d flood messages dropped in the last %ds", new Object[] {Integer.valueOf(this.floodCount), Long.valueOf((now - this.lastFloodReport) / 1000L)})); -+ } -+ -+ this.floodCount = 0; -+ this.lastFloodReport = now; -+ } -+ -+ public boolean isLoggable(Level level) { -+ return this.logger.isLoggable(level); -+ } -+ -+ public void setLevel(Level level) { -+ this.logger.setLevel(level); -+ } -+ -+ public void log(Level level, String format, Object ... params) { -+ if (this.isLoggable(level)) { -+ if (level.intValue() >= FLOOD_LEVEL && !this.checkFlood()) { -+ return; -+ } -+ -+ this.logger.log(level, String.format(format, params)); -+ } -+ } -+ -+ public void severe(String format, Object ... params) { -+ if (enabled) { -+ this.log(Level.SEVERE, format, params); -+ } -+ } -+ -+ public void error(String format, Object ... params) { -+ if (enabled) { -+ this.log(ERROR, format, params); -+ } -+ } -+ -+ public void warning(String format, Object ... params) { -+ if (enabled) { -+ this.log(Level.WARNING, format, params); -+ } -+ } -+ -+ public void info(String format, Object ... params) { -+ if (enabled) { -+ this.log(Level.INFO, format, params); -+ } -+ } -+ -+ public void config(String format, Object ... params) { -+ if (enabled) { -+ this.log(Level.CONFIG, format, params); -+ } -+ } -+ -+ public void fine(String format, Object ... params) { -+ if (enabled) { -+ this.log(Level.FINE, format, params); -+ } -+ } -+ -+ public void finer(String format, Object ... params) { -+ if (enabled) { -+ this.log(Level.FINER, format, params); -+ } -+ } -+ -+ public void finest(String format, Object ... params) { -+ if (enabled) { -+ this.log(Level.FINEST, format, params); -+ } -+ } -+ -+ static String access$000(MCLogger x0) { -+ return x0.logPrefix; -+ } -+} ---- /dev/null -+++ org/spoutcraft/api/keyboard/BindingExecutionDelegate.java -@@ -1,0 +1,45 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.api.keyboard; -+ -+public abstract class BindingExecutionDelegate { -+ @Deprecated -+ public void onKeyPress(int key, KeyBinding binding) { -+ } -+ @Deprecated -+ public void onKeyRelease(int key, KeyBinding binding) { -+ } -+ -+ /** -+ * Called when the Keybinding is pressed. -+ * Please check event.getScreen() when you don't want handle this binding on other screens than the main screen. -+ * @param event -+ */ -+ public void onKeyPress(KeyBindingPress event) { -+ } -+ -+ /** -+ * Called when the Keybinding is released. -+ * Please check event.getScreen() when you don't want handle this binding on other screens than the main screen. -+ * @param event -+ */ -+ public void onKeyRelease(KeyBindingPress event) { -+ } -+} ---- net/minecraft/src/GuiCreateWorld.java -+++ net/minecraft/src/GuiCreateWorld.java -@@ -7,153 +7,213 @@ - private GuiScreen parentGuiScreen; - private GuiTextField textboxWorldName; - private GuiTextField textboxSeed; -- private String e; -- private String p = "survival"; -+ private String folderName; -+ -+ /** hardcore', 'creative' or 'survival */ -+ private String gameMode = "survival"; - private boolean generateStructures = true; - private boolean commandsAllowed; -+ -+ /** True iif player has clicked buttonAllowCommands at least once */ - private boolean commandsToggled; -+ -+ /** toggles when GUIButton 7 is pressed */ - private boolean bonusItems; -+ -+ /** True if and only if gameMode.equals("hardcore") */ - private boolean isHardcore; - private boolean createClicked; -+ -+ /** -+ * True if the extra options (Seed box, structure toggle button, world type button, etc.) are being shown -+ */ - private boolean moreOptions; -+ -+ /** The GUIButton that you click to change game modes. */ - private GuiButton buttonGameMode; -+ -+ /** -+ * The GUIButton that you click to get to options like the seed when creating a world. -+ */ - private GuiButton moreWorldOptions; -+ -+ /** The GuiButton in the 'More World Options' screen. Toggles ON/OFF */ - private GuiButton buttonGenerateStructures; - private GuiButton buttonBonusItems; -+ -+ /** The GuiButton in the more world options screen. */ - private GuiButton buttonWorldType; - private GuiButton buttonAllowCommands; -+ -+ /** GuiButton in the more world options screen. */ - private GuiButton buttonCustomize; -- private String E; -- private String F; -- private String G; -- private String H; -+ -+ /** The first line of text describing the currently selected game mode. */ -+ private String gameModeDescriptionLine1; -+ -+ /** The second line of text describing the currently selected game mode. */ -+ private String gameModeDescriptionLine2; -+ -+ /** The current textboxSeed text */ -+ private String seed; -+ -+ /** E.g. New World, Neue Welt, Nieuwe wereld, Neuvo Mundo */ -+ private String localizedNewWorldText; - private int worldTypeId; -- public String a = ""; -- private static final String[] J = new String[]{"CON", "COM", "PRN", "AUX", "CLOCK$", "NUL", "COM1", "COM2", "COM3", "COM4", "COM5", "COM6", "COM7", "COM8", "COM9", "LPT1", "LPT2", "LPT3", "LPT4", "LPT5", "LPT6", "LPT7", "LPT8", "LPT9"}; -- -- public GuiCreateWorld(GuiScreen var1) { -- this.parentGuiScreen = var1; -- this.G = ""; -- this.H = I18n.getString("selectWorld.newWorld"); -+ -+ /** Generator options to use when creating the world. */ -+ public String generatorOptionsToUse = ""; -+ -+ /** -+ * If the world name is one of these, it'll be surrounded with underscores. -+ */ -+ private static final String[] ILLEGAL_WORLD_NAMES = new String[] {"CON", "COM", "PRN", "AUX", "CLOCK$", "NUL", "COM1", "COM2", "COM3", "COM4", "COM5", "COM6", "COM7", "COM8", "COM9", "LPT1", "LPT2", "LPT3", "LPT4", "LPT5", "LPT6", "LPT7", "LPT8", "LPT9"}; -+ -+ public GuiCreateWorld(GuiScreen par1GuiScreen) { -+ this.parentGuiScreen = par1GuiScreen; -+ this.seed = ""; -+ this.localizedNewWorldText = I18n.getString("selectWorld.newWorld"); - } - -+ /** -+ * Called from the main game loop to update the screen. -+ */ - public void updateScreen() { - this.textboxWorldName.updateCursorCounter(); - this.textboxSeed.updateCursorCounter(); - } - -+ /** -+ * Adds the buttons (and other controls) to the screen in question. -+ */ - public void initGui() { - Keyboard.enableRepeatEvents(true); -- this.i.clear(); -- this.i.add(new GuiButton(0, this.width / 2 - 155, this.height - 28, 150, 20, I18n.getString("selectWorld.create"))); -- this.i.add(new GuiButton(1, this.width / 2 + 5, this.height - 28, 150, 20, I18n.getString("gui.cancel"))); -- this.i.add(this.buttonGameMode = new GuiButton(2, this.width / 2 - 75, 115, 150, 20, I18n.getString("selectWorld.gameMode"))); -- this.i.add(this.moreWorldOptions = new GuiButton(3, this.width / 2 - 75, 187, 150, 20, I18n.getString("selectWorld.moreWorldOptions"))); -- this.i.add(this.buttonGenerateStructures = new GuiButton(4, this.width / 2 - 155, 100, 150, 20, I18n.getString("selectWorld.mapFeatures"))); -+ this.buttonList.clear(); -+ this.buttonList.add(new GuiButton(0, this.width / 2 - 155, this.height - 28, 150, 20, I18n.getString("selectWorld.create"))); -+ this.buttonList.add(new GuiButton(1, this.width / 2 + 5, this.height - 28, 150, 20, I18n.getString("gui.cancel"))); -+ this.buttonList.add(this.buttonGameMode = new GuiButton(2, this.width / 2 - 75, 115, 150, 20, I18n.getString("selectWorld.gameMode"))); -+ this.buttonList.add(this.moreWorldOptions = new GuiButton(3, this.width / 2 - 75, 187, 150, 20, I18n.getString("selectWorld.moreWorldOptions"))); -+ this.buttonList.add(this.buttonGenerateStructures = new GuiButton(4, this.width / 2 - 155, 100, 150, 20, I18n.getString("selectWorld.mapFeatures"))); - this.buttonGenerateStructures.drawButton = false; -- this.i.add(this.buttonBonusItems = new GuiButton(7, this.width / 2 + 5, 151, 150, 20, I18n.getString("selectWorld.bonusItems"))); -+ this.buttonList.add(this.buttonBonusItems = new GuiButton(7, this.width / 2 + 5, 151, 150, 20, I18n.getString("selectWorld.bonusItems"))); - this.buttonBonusItems.drawButton = false; -- this.i.add(this.buttonWorldType = new GuiButton(5, this.width / 2 + 5, 100, 150, 20, I18n.getString("selectWorld.mapType"))); -+ this.buttonList.add(this.buttonWorldType = new GuiButton(5, this.width / 2 + 5, 100, 150, 20, I18n.getString("selectWorld.mapType"))); - this.buttonWorldType.drawButton = false; -- this.i.add(this.buttonAllowCommands = new GuiButton(6, this.width / 2 - 155, 151, 150, 20, I18n.getString("selectWorld.allowCommands"))); -+ this.buttonList.add(this.buttonAllowCommands = new GuiButton(6, this.width / 2 - 155, 151, 150, 20, I18n.getString("selectWorld.allowCommands"))); - this.buttonAllowCommands.drawButton = false; -- this.i.add(this.buttonCustomize = new GuiButton(8, this.width / 2 + 5, 120, 150, 20, I18n.getString("selectWorld.customizeType"))); -+ this.buttonList.add(this.buttonCustomize = new GuiButton(8, this.width / 2 + 5, 120, 150, 20, I18n.getString("selectWorld.customizeType"))); - this.buttonCustomize.drawButton = false; - this.textboxWorldName = new GuiTextField(this.fontRenderer, this.width / 2 - 100, 60, 200, 20); - this.textboxWorldName.setFocused(true); -- this.textboxWorldName.setText(this.H); -+ this.textboxWorldName.setText(this.localizedNewWorldText); - this.textboxSeed = new GuiTextField(this.fontRenderer, this.width / 2 - 100, 60, 200, 20); -- this.textboxSeed.setText(this.G); -+ this.textboxSeed.setText(this.seed); - this.func_82288_a(this.moreOptions); - this.makeUseableName(); - this.updateButtonText(); - } - -+ /** -+ * Makes a the name for a world save folder based on your world name, replacing specific characters for _s and -+ * appending -s to the end until a free name is available. -+ */ - private void makeUseableName() { -- this.e = this.textboxWorldName.getText().trim(); -+ this.folderName = this.textboxWorldName.getText().trim(); - char[] var1 = ChatAllowedCharacters.allowedCharactersArray; - int var2 = var1.length; - -- for(int var3 = 0; var3 < var2; ++var3) { -+ for (int var3 = 0; var3 < var2; ++var3) { - char var4 = var1[var3]; -- this.e = this.e.replace(var4, '_'); -- } -- -- if(MathHelper.stringNullOrLengthZero(this.e)) { -- this.e = "World"; -- } -- -- this.e = func_73913_a(this.mc.getSaveLoader(), this.e); -+ this.folderName = this.folderName.replace(var4, '_'); -+ } -+ -+ if (MathHelper.stringNullOrLengthZero(this.folderName)) { -+ this.folderName = "World"; -+ } -+ -+ this.folderName = func_73913_a(this.mc.getSaveLoader(), this.folderName); - } - - private void updateButtonText() { -- this.buttonGameMode.f = I18n.getString("selectWorld.gameMode") + " " + I18n.getString("selectWorld.gameMode." + this.p); -- this.E = I18n.getString("selectWorld.gameMode." + this.p + ".line1"); -- this.F = I18n.getString("selectWorld.gameMode." + this.p + ".line2"); -- this.buttonGenerateStructures.f = I18n.getString("selectWorld.mapFeatures") + " "; -- if(this.generateStructures) { -- this.buttonGenerateStructures.f = this.buttonGenerateStructures.f + I18n.getString("options.on"); -- } else { -- this.buttonGenerateStructures.f = this.buttonGenerateStructures.f + I18n.getString("options.off"); -- } -- -- this.buttonBonusItems.f = I18n.getString("selectWorld.bonusItems") + " "; -- if(this.bonusItems && !this.isHardcore) { -- this.buttonBonusItems.f = this.buttonBonusItems.f + I18n.getString("options.on"); -- } else { -- this.buttonBonusItems.f = this.buttonBonusItems.f + I18n.getString("options.off"); -- } -- -- this.buttonWorldType.f = I18n.getString("selectWorld.mapType") + " " + I18n.getString(WorldType.worldTypes[this.worldTypeId].getTranslateName()); -- this.buttonAllowCommands.f = I18n.getString("selectWorld.allowCommands") + " "; -- if(this.commandsAllowed && !this.isHardcore) { -- this.buttonAllowCommands.f = this.buttonAllowCommands.f + I18n.getString("options.on"); -- } else { -- this.buttonAllowCommands.f = this.buttonAllowCommands.f + I18n.getString("options.off"); -- } -- -+ this.buttonGameMode.displayString = I18n.getString("selectWorld.gameMode") + " " + I18n.getString("selectWorld.gameMode." + this.gameMode); -+ this.gameModeDescriptionLine1 = I18n.getString("selectWorld.gameMode." + this.gameMode + ".line1"); -+ this.gameModeDescriptionLine2 = I18n.getString("selectWorld.gameMode." + this.gameMode + ".line2"); -+ this.buttonGenerateStructures.displayString = I18n.getString("selectWorld.mapFeatures") + " "; -+ -+ if (this.generateStructures) { -+ this.buttonGenerateStructures.displayString = this.buttonGenerateStructures.displayString + I18n.getString("options.on"); -+ } else { -+ this.buttonGenerateStructures.displayString = this.buttonGenerateStructures.displayString + I18n.getString("options.off"); -+ } -+ -+ this.buttonBonusItems.displayString = I18n.getString("selectWorld.bonusItems") + " "; -+ -+ if (this.bonusItems && !this.isHardcore) { -+ this.buttonBonusItems.displayString = this.buttonBonusItems.displayString + I18n.getString("options.on"); -+ } else { -+ this.buttonBonusItems.displayString = this.buttonBonusItems.displayString + I18n.getString("options.off"); -+ } -+ -+ this.buttonWorldType.displayString = I18n.getString("selectWorld.mapType") + " " + I18n.getString(WorldType.worldTypes[this.worldTypeId].getTranslateName()); -+ this.buttonAllowCommands.displayString = I18n.getString("selectWorld.allowCommands") + " "; -+ -+ if (this.commandsAllowed && !this.isHardcore) { -+ this.buttonAllowCommands.displayString = this.buttonAllowCommands.displayString + I18n.getString("options.on"); -+ } else { -+ this.buttonAllowCommands.displayString = this.buttonAllowCommands.displayString + I18n.getString("options.off"); -+ } - } - -- public static String func_73913_a(ISaveFormat var0, String var1) { -- var1 = var1.replaceAll("[\\./\"]", "_"); -- String[] var2 = J; -+ public static String func_73913_a(ISaveFormat par0ISaveFormat, String par1Str) { -+ par1Str = par1Str.replaceAll("[\\./\"]", "_"); -+ String[] var2 = ILLEGAL_WORLD_NAMES; - int var3 = var2.length; - -- for(int var4 = 0; var4 < var3; ++var4) { -+ for (int var4 = 0; var4 < var3; ++var4) { - String var5 = var2[var4]; -- if(var1.equalsIgnoreCase(var5)) { -- var1 = "_" + var1 + "_"; -+ -+ if (par1Str.equalsIgnoreCase(var5)) { -+ par1Str = "_" + par1Str + "_"; - } - } - -- while(var0.getWorldInfo(var1) != null) { -- var1 = var1 + "-"; -+ while (par0ISaveFormat.getWorldInfo(par1Str) != null) { -+ par1Str = par1Str + "-"; - } - -- return var1; -+ return par1Str; - } - -+ /** -+ * Called when the screen is unloaded. Used to disable keyboard repeat events -+ */ - public void onGuiClosed() { - Keyboard.enableRepeatEvents(false); - } - -- protected void actionPerformed(GuiButton var1) { -- if(var1.enabled) { -- if(var1.id == 1) { -+ /** -+ * Fired when a control is clicked. This is the equivalent of ActionListener.actionPerformed(ActionEvent e). -+ */ -+ protected void actionPerformed(GuiButton par1GuiButton) { -+ if (par1GuiButton.enabled) { -+ if (par1GuiButton.id == 1) { - this.mc.displayGuiScreen(this.parentGuiScreen); -- } else if(var1.id == 0) { -+ } else if (par1GuiButton.id == 0) { - this.mc.displayGuiScreen((GuiScreen)null); -- if(this.createClicked) { -+ -+ if (this.createClicked) { - return; - } - - this.createClicked = true; - long var2 = (new Random()).nextLong(); - String var4 = this.textboxSeed.getText(); -- if(!MathHelper.stringNullOrLengthZero(var4)) { -+ -+ if (!MathHelper.stringNullOrLengthZero(var4)) { - try { - long var5 = Long.parseLong(var4); -- if(var5 != 0L) { -+ -+ if (var5 != 0L) { - var2 = var5; - } - } catch (NumberFormatException var7) { -@@ -161,50 +221,51 @@ - } - } - -- EnumGameType var8 = EnumGameType.getByName(this.p); -+ EnumGameType var8 = EnumGameType.getByName(this.gameMode); - WorldSettings var6 = new WorldSettings(var2, var8, this.generateStructures, this.isHardcore, WorldType.worldTypes[this.worldTypeId]); -- var6.func_82750_a(this.a); -- if(this.bonusItems && !this.isHardcore) { -+ var6.func_82750_a(this.generatorOptionsToUse); -+ -+ if (this.bonusItems && !this.isHardcore) { - var6.enableBonusChest(); - } - -- if(this.commandsAllowed && !this.isHardcore) { -+ if (this.commandsAllowed && !this.isHardcore) { - var6.enableCommands(); - } - -- this.mc.launchIntegratedServer(this.e, this.textboxWorldName.getText().trim(), var6); -+ this.mc.launchIntegratedServer(this.folderName, this.textboxWorldName.getText().trim(), var6); - this.mc.statFileWriter.readStat(StatList.createWorldStat, 1); -- } else if(var1.id == 3) { -+ } else if (par1GuiButton.id == 3) { - this.func_82287_i(); -- } else if(var1.id == 2) { -- if(this.p.equals("survival")) { -- if(!this.commandsToggled) { -+ } else if (par1GuiButton.id == 2) { -+ if (this.gameMode.equals("survival")) { -+ if (!this.commandsToggled) { - this.commandsAllowed = false; - } - - this.isHardcore = false; -- this.p = "hardcore"; -+ this.gameMode = "hardcore"; - this.isHardcore = true; - this.buttonAllowCommands.enabled = false; - this.buttonBonusItems.enabled = false; - this.updateButtonText(); -- } else if(this.p.equals("hardcore")) { -- if(!this.commandsToggled) { -+ } else if (this.gameMode.equals("hardcore")) { -+ if (!this.commandsToggled) { - this.commandsAllowed = true; - } - - this.isHardcore = false; -- this.p = "creative"; -+ this.gameMode = "creative"; - this.updateButtonText(); - this.isHardcore = false; - this.buttonAllowCommands.enabled = true; - this.buttonBonusItems.enabled = true; - } else { -- if(!this.commandsToggled) { -+ if (!this.commandsToggled) { - this.commandsAllowed = false; - } - -- this.p = "survival"; -+ this.gameMode = "survival"; - this.updateButtonText(); - this.buttonAllowCommands.enabled = true; - this.buttonBonusItems.enabled = true; -@@ -212,36 +273,37 @@ - } - - this.updateButtonText(); -- } else if(var1.id == 4) { -+ } else if (par1GuiButton.id == 4) { - this.generateStructures = !this.generateStructures; - this.updateButtonText(); -- } else if(var1.id == 7) { -+ } else if (par1GuiButton.id == 7) { - this.bonusItems = !this.bonusItems; - this.updateButtonText(); -- } else if(var1.id == 5) { -+ } else if (par1GuiButton.id == 5) { - ++this.worldTypeId; -- if(this.worldTypeId >= WorldType.worldTypes.length) { -+ -+ if (this.worldTypeId >= WorldType.worldTypes.length) { - this.worldTypeId = 0; - } - -- while(WorldType.worldTypes[this.worldTypeId] == null || !WorldType.worldTypes[this.worldTypeId].getCanBeCreated()) { -+ while (WorldType.worldTypes[this.worldTypeId] == null || !WorldType.worldTypes[this.worldTypeId].getCanBeCreated()) { - ++this.worldTypeId; -- if(this.worldTypeId >= WorldType.worldTypes.length) { -+ -+ if (this.worldTypeId >= WorldType.worldTypes.length) { - this.worldTypeId = 0; - } - } - -- this.a = ""; -+ this.generatorOptionsToUse = ""; - this.updateButtonText(); - this.func_82288_a(this.moreOptions); -- } else if(var1.id == 6) { -+ } else if (par1GuiButton.id == 6) { - this.commandsToggled = true; - this.commandsAllowed = !this.commandsAllowed; - this.updateButtonText(); -- } else if(var1.id == 8) { -- this.mc.displayGuiScreen(new GuiCreateFlatWorld(this, this.a)); -+ } else if (par1GuiButton.id == 8) { -+ this.mc.displayGuiScreen(new GuiCreateFlatWorld(this, this.generatorOptionsToUse)); - } -- - } - } - -@@ -249,53 +311,63 @@ - this.func_82288_a(!this.moreOptions); - } - -- private void func_82288_a(boolean var1) { -- this.moreOptions = var1; -+ private void func_82288_a(boolean par1) { -+ this.moreOptions = par1; - this.buttonGameMode.drawButton = !this.moreOptions; - this.buttonGenerateStructures.drawButton = this.moreOptions; - this.buttonBonusItems.drawButton = this.moreOptions; - this.buttonWorldType.drawButton = this.moreOptions; - this.buttonAllowCommands.drawButton = this.moreOptions; - this.buttonCustomize.drawButton = this.moreOptions && WorldType.worldTypes[this.worldTypeId] == WorldType.FLAT; -- if(this.moreOptions) { -- this.moreWorldOptions.f = I18n.getString("gui.done"); -+ -+ if (this.moreOptions) { -+ this.moreWorldOptions.displayString = I18n.getString("gui.done"); - } else { -- this.moreWorldOptions.f = I18n.getString("selectWorld.moreWorldOptions"); -+ this.moreWorldOptions.displayString = I18n.getString("selectWorld.moreWorldOptions"); - } -- - } - -- protected void keyTyped(char var1, int var2) { -- if(this.textboxWorldName.isFocused() && !this.moreOptions) { -- this.textboxWorldName.textboxKeyTyped(var1, var2); -- this.H = this.textboxWorldName.getText(); -- } else if(this.textboxSeed.isFocused() && this.moreOptions) { -- this.textboxSeed.textboxKeyTyped(var1, var2); -- this.G = this.textboxSeed.getText(); -- } -- -- if(var2 == 28 || var2 == 156) { -- this.actionPerformed((GuiButton)this.i.get(0)); -- } -- -- ((GuiButton)this.i.get(0)).enabled = this.textboxWorldName.getText().length() > 0; -+ /** -+ * Fired when a key is typed. This is the equivalent of KeyListener.keyTyped(KeyEvent e). -+ */ -+ protected void keyTyped(char par1, int par2) { -+ if (this.textboxWorldName.isFocused() && !this.moreOptions) { -+ this.textboxWorldName.textboxKeyTyped(par1, par2); -+ this.localizedNewWorldText = this.textboxWorldName.getText(); -+ } else if (this.textboxSeed.isFocused() && this.moreOptions) { -+ this.textboxSeed.textboxKeyTyped(par1, par2); -+ this.seed = this.textboxSeed.getText(); -+ } -+ -+ if (par2 == 28 || par2 == 156) { -+ this.actionPerformed((GuiButton)this.buttonList.get(0)); -+ } -+ -+ ((GuiButton)this.buttonList.get(0)).enabled = this.textboxWorldName.getText().length() > 0; - this.makeUseableName(); - } - -- protected void mouseClicked(int var1, int var2, int var3) { -- super.mouseClicked(var1, var2, var3); -- if(this.moreOptions) { -- this.textboxSeed.mouseClicked(var1, var2, var3); -+ /** -+ * Called when the mouse is clicked. -+ */ -+ protected void mouseClicked(int par1, int par2, int par3) { -+ super.mouseClicked(par1, par2, par3); -+ -+ if (this.moreOptions) { -+ this.textboxSeed.mouseClicked(par1, par2, par3); - } else { -- this.textboxWorldName.mouseClicked(var1, var2, var3); -+ this.textboxWorldName.mouseClicked(par1, par2, par3); - } -- - } - -- public void drawScreen(int var1, int var2, float var3) { -+ /** -+ * Draws the screen and all the components in it. -+ */ -+ public void drawScreen(int par1, int par2, float par3) { - this.drawDefaultBackground(); - this.drawCenteredString(this.fontRenderer, I18n.getString("selectWorld.create"), this.width / 2, 20, 16777215); -- if(this.moreOptions) { -+ -+ if (this.moreOptions) { - this.drawString(this.fontRenderer, I18n.getString("selectWorld.enterSeed"), this.width / 2 - 100, 47, 10526880); - this.drawString(this.fontRenderer, I18n.getString("selectWorld.seedInfo"), this.width / 2 - 100, 85, 10526880); - this.drawString(this.fontRenderer, I18n.getString("selectWorld.mapFeatures.info"), this.width / 2 - 150, 122, 10526880); -@@ -303,29 +375,29 @@ - this.textboxSeed.drawTextBox(); - } else { - this.drawString(this.fontRenderer, I18n.getString("selectWorld.enterName"), this.width / 2 - 100, 47, 10526880); -- this.drawString(this.fontRenderer, I18n.getString("selectWorld.resultFolder") + " " + this.e, this.width / 2 - 100, 85, 10526880); -+ this.drawString(this.fontRenderer, I18n.getString("selectWorld.resultFolder") + " " + this.folderName, this.width / 2 - 100, 85, 10526880); - this.textboxWorldName.drawTextBox(); -- this.drawString(this.fontRenderer, this.E, this.width / 2 - 100, 137, 10526880); -- this.drawString(this.fontRenderer, this.F, this.width / 2 - 100, 149, 10526880); -+ this.drawString(this.fontRenderer, this.gameModeDescriptionLine1, this.width / 2 - 100, 137, 10526880); -+ this.drawString(this.fontRenderer, this.gameModeDescriptionLine2, this.width / 2 - 100, 149, 10526880); - } - -- super.drawScreen(var1, var2, var3); -+ super.drawScreen(par1, par2, par3); - } - -- public void func_82286_a(WorldInfo var1) { -- this.H = I18n.getStringParams("selectWorld.newWorld.copyOf", new Object[]{var1.getWorldName()}); -- this.G = var1.getSeed() + ""; -- this.worldTypeId = var1.getTerrainType().getWorldTypeID(); -- this.a = var1.getGeneratorOptions(); -- this.generateStructures = var1.isMapFeaturesEnabled(); -- this.commandsAllowed = var1.areCommandsAllowed(); -- if(var1.isHardcoreModeEnabled()) { -- this.p = "hardcore"; -- } else if(var1.getGameType().isSurvivalOrAdventure()) { -- this.p = "survival"; -- } else if(var1.getGameType().isCreative()) { -- this.p = "creative"; -- } -+ public void func_82286_a(WorldInfo par1WorldInfo) { -+ this.localizedNewWorldText = I18n.getStringParams("selectWorld.newWorld.copyOf", new Object[] {par1WorldInfo.getWorldName()}); -+ this.seed = par1WorldInfo.getSeed() + ""; -+ this.worldTypeId = par1WorldInfo.getTerrainType().getWorldTypeID(); -+ this.generatorOptionsToUse = par1WorldInfo.getGeneratorOptions(); -+ this.generateStructures = par1WorldInfo.isMapFeaturesEnabled(); -+ this.commandsAllowed = par1WorldInfo.areCommandsAllowed(); - -+ if (par1WorldInfo.isHardcoreModeEnabled()) { -+ this.gameMode = "hardcore"; -+ } else if (par1WorldInfo.getGameType().isSurvivalOrAdventure()) { -+ this.gameMode = "survival"; -+ } else if (par1WorldInfo.getGameType().isCreative()) { -+ this.gameMode = "creative"; -+ } - } - } ---- net/minecraft/src/BlockGlowStone.java -+++ net/minecraft/src/BlockGlowStone.java -@@ -3,20 +3,29 @@ - import java.util.Random; - - public class BlockGlowStone extends Block { -- public BlockGlowStone(int var1, Material var2) { -- super(var1, var2); -+ public BlockGlowStone(int par1, Material par2Material) { -+ super(par1, par2Material); - this.setCreativeTab(CreativeTabs.tabBlock); - } - -- public int quantityDroppedWithBonus(int var1, Random var2) { -- return MathHelper.clamp_int(this.quantityDropped(var2) + var2.nextInt(var1 + 1), 1, 4); -- } -- -- public int quantityDropped(Random var1) { -- return 2 + var1.nextInt(3); -- } -- -- public int idDropped(int var1, Random var2, int var3) { -+ /** -+ * Returns the usual quantity dropped by the block plus a bonus of 1 to 'i' (inclusive). -+ */ -+ public int quantityDroppedWithBonus(int par1, Random par2Random) { -+ return MathHelper.clamp_int(this.quantityDropped(par2Random) + par2Random.nextInt(par1 + 1), 1, 4); -+ } -+ -+ /** -+ * Returns the quantity of items to drop on block destruction. -+ */ -+ public int quantityDropped(Random par1Random) { -+ return 2 + par1Random.nextInt(3); -+ } -+ -+ /** -+ * Returns the ID of the items to drop on destruction. -+ */ -+ public int idDropped(int par1, Random par2Random, int par3) { - return Item.glowstone.itemID; - } - } ---- net/minecraft/src/NetServerHandler.java -+++ net/minecraft/src/NetServerHandler.java -@@ -9,111 +9,144 @@ - import net.minecraft.server.MinecraftServer; - - public class NetServerHandler extends NetHandler { -+ -+ /** The underlying network manager for this server handler. */ - public final INetworkManager netManager; -- private final MinecraftServer d; -+ -+ /** Reference to the MinecraftServer object. */ -+ private final MinecraftServer mcServer; -+ -+ /** This is set to true whenever a player disconnects from the server. */ - public boolean connectionClosed; -+ -+ /** Reference to the EntityPlayerMP object. */ - public EntityPlayerMP playerEntity; -+ -+ /** incremented each tick */ - private int currentTicks; -- private int playerInAirTime; -+ -+ /** -+ * player is kicked if they float for over 80 ticks without flying enabled -+ */ -+ private int ticksForFloatKick; - private boolean field_72584_h; - private int keepAliveRandomID; - private long keepAliveTimeSent; -- private static Random j = new Random(); -+ private static Random randomGenerator = new Random(); - private long ticksOfLastKeepAlive; - private int chatSpamThresholdCount; - private int creativeItemCreationSpamThresholdTally; -+ -+ /** The last known x position for this connection. */ - private double lastPosX; -+ -+ /** The last known y position for this connection. */ - private double lastPosY; -+ -+ /** The last known z position for this connection. */ - private double lastPosZ; -+ -+ /** is true when the player has moved since his last movement packet */ - private boolean hasMoved = true; - private IntHashMap field_72586_s = new IntHashMap(); - -- public NetServerHandler(MinecraftServer var1, INetworkManager var2, EntityPlayerMP var3) { -- this.d = var1; -- this.netManager = var2; -- var2.setNetHandler(this); -- this.playerEntity = var3; -- var3.playerNetServerHandler = this; -+ public NetServerHandler(MinecraftServer par1MinecraftServer, INetworkManager par2INetworkManager, EntityPlayerMP par3EntityPlayerMP) { -+ this.mcServer = par1MinecraftServer; -+ this.netManager = par2INetworkManager; -+ par2INetworkManager.setNetHandler(this); -+ this.playerEntity = par3EntityPlayerMP; -+ par3EntityPlayerMP.playerNetServerHandler = this; - } - -- public void handlePackets() { -+ /** -+ * run once each game tick -+ */ -+ public void networkTick() { - this.field_72584_h = false; - ++this.currentTicks; -- this.d.theProfiler.startSection("packetflow"); -+ this.mcServer.theProfiler.startSection("packetflow"); - this.netManager.processReadPackets(); -- this.d.theProfiler.endStartSection("keepAlive"); -- if((long)this.currentTicks - this.ticksOfLastKeepAlive > 20L) { -+ this.mcServer.theProfiler.endStartSection("keepAlive"); -+ -+ if ((long)this.currentTicks - this.ticksOfLastKeepAlive > 20L) { - this.ticksOfLastKeepAlive = (long)this.currentTicks; - this.keepAliveTimeSent = System.nanoTime() / 1000000L; -- this.keepAliveRandomID = j.nextInt(); -- this.sendPacket(new Packet0KeepAlive(this.keepAliveRandomID)); -+ this.keepAliveRandomID = randomGenerator.nextInt(); -+ this.sendPacketToPlayer(new Packet0KeepAlive(this.keepAliveRandomID)); - } - -- if(this.chatSpamThresholdCount > 0) { -+ if (this.chatSpamThresholdCount > 0) { - --this.chatSpamThresholdCount; - } - -- if(this.creativeItemCreationSpamThresholdTally > 0) { -+ if (this.creativeItemCreationSpamThresholdTally > 0) { - --this.creativeItemCreationSpamThresholdTally; - } - -- this.d.theProfiler.endStartSection("playerTick"); -- this.d.theProfiler.endSection(); -+ this.mcServer.theProfiler.endStartSection("playerTick"); -+ this.mcServer.theProfiler.endSection(); - } - -- public void kickPlayer(String var1) { -- if(!this.connectionClosed) { -+ public void kickPlayerFromServer(String par1Str) { -+ if (!this.connectionClosed) { - this.playerEntity.mountEntityAndWakeUp(); -- this.sendPacket(new Packet255KickDisconnect(var1)); -+ this.sendPacketToPlayer(new Packet255KickDisconnect(par1Str)); - this.netManager.serverShutdown(); -- this.d.getConfigurationManager().sendChatMsg(ChatMessageComponent.createFromTranslationWithSubstitutions("multiplayer.player.left", new Object[]{this.playerEntity.getTranslatedEntityName()}).setColor(EnumChatFormatting.YELLOW)); -- this.d.getConfigurationManager().playerLoggedOut(this.playerEntity); -+ this.mcServer.getConfigurationManager().sendChatMsg(ChatMessageComponent.createFromTranslationWithSubstitutions("multiplayer.player.left", new Object[] {this.playerEntity.getTranslatedEntityName()}).setColor(EnumChatFormatting.YELLOW)); -+ this.mcServer.getConfigurationManager().playerLoggedOut(this.playerEntity); - this.connectionClosed = true; - } - } - -- public void func_110774_a(Packet27PlayerInput var1) { -- this.playerEntity.setEntityActionState(var1.func_111010_d(), var1.func_111012_f(), var1.func_111013_g(), var1.func_111011_h()); -+ public void func_110774_a(Packet27PlayerInput par1Packet27PlayerInput) { -+ this.playerEntity.setEntityActionState(par1Packet27PlayerInput.func_111010_d(), par1Packet27PlayerInput.func_111012_f(), par1Packet27PlayerInput.func_111013_g(), par1Packet27PlayerInput.func_111011_h()); - } - -- public void handleFlying(Packet10Flying var1) { -- WorldServer var2 = this.d.worldServerForDimension(this.playerEntity.dimension); -+ public void handleFlying(Packet10Flying par1Packet10Flying) { -+ WorldServer var2 = this.mcServer.worldServerForDimension(this.playerEntity.dimension); - this.field_72584_h = true; -- if(!this.playerEntity.playerConqueredTheEnd) { -+ -+ if (!this.playerEntity.playerConqueredTheEnd) { - double var3; -- if(!this.hasMoved) { -- var3 = var1.yPosition - this.lastPosY; -- if(var1.xPosition == this.lastPosX && var3 * var3 < 0.01D && var1.zPosition == this.lastPosZ) { -+ -+ if (!this.hasMoved) { -+ var3 = par1Packet10Flying.yPosition - this.lastPosY; -+ -+ if (par1Packet10Flying.xPosition == this.lastPosX && var3 * var3 < 0.01D && par1Packet10Flying.zPosition == this.lastPosZ) { - this.hasMoved = true; - } - } - -- if(this.hasMoved) { -+ if (this.hasMoved) { - double var5; - double var7; - double var9; -- if(this.playerEntity.ridingEntity != null) { -+ -+ if (this.playerEntity.ridingEntity != null) { - float var34 = this.playerEntity.rotationYaw; - float var4 = this.playerEntity.rotationPitch; - this.playerEntity.ridingEntity.updateRiderPosition(); - var5 = this.playerEntity.posX; - var7 = this.playerEntity.posY; - var9 = this.playerEntity.posZ; -- if(var1.rotating) { -- var34 = var1.yaw; -- var4 = var1.pitch; -+ -+ if (par1Packet10Flying.rotating) { -+ var34 = par1Packet10Flying.yaw; -+ var4 = par1Packet10Flying.pitch; - } - -- this.playerEntity.onGround = var1.onGround; -+ this.playerEntity.onGround = par1Packet10Flying.onGround; - this.playerEntity.onUpdateEntity(); - this.playerEntity.ySize = 0.0F; - this.playerEntity.setPositionAndRotation(var5, var7, var9, var34, var4); -- if(this.playerEntity.ridingEntity != null) { -+ -+ if (this.playerEntity.ridingEntity != null) { - this.playerEntity.ridingEntity.updateRiderPosition(); - } - -- this.d.getConfigurationManager().serverUpdateMountedMovingPlayer(this.playerEntity); -- if(this.hasMoved) { -+ this.mcServer.getConfigurationManager().serverUpdateMountedMovingPlayer(this.playerEntity); -+ -+ if (this.hasMoved) { - this.lastPosX = this.playerEntity.posX; - this.lastPosY = this.playerEntity.posY; - this.lastPosZ = this.playerEntity.posZ; -@@ -123,7 +156,7 @@ - return; - } - -- if(this.playerEntity.isPlayerSleeping()) { -+ if (this.playerEntity.isPlayerSleeping()) { - this.playerEntity.onUpdateEntity(); - this.playerEntity.setPositionAndRotation(this.lastPosX, this.lastPosY, this.lastPosZ, this.playerEntity.rotationYaw, this.playerEntity.rotationPitch); - var2.updateEntity(this.playerEntity); -@@ -139,37 +172,41 @@ - var9 = this.playerEntity.posZ; - float var11 = this.playerEntity.rotationYaw; - float var12 = this.playerEntity.rotationPitch; -- if(var1.moving && var1.yPosition == -999.0D && var1.stance == -999.0D) { -- var1.moving = false; -+ -+ if (par1Packet10Flying.moving && par1Packet10Flying.yPosition == -999.0D && par1Packet10Flying.stance == -999.0D) { -+ par1Packet10Flying.moving = false; - } - - double var13; -- if(var1.moving) { -- var5 = var1.xPosition; -- var7 = var1.yPosition; -- var9 = var1.zPosition; -- var13 = var1.stance - var1.yPosition; -- if(!this.playerEntity.isPlayerSleeping() && (var13 > 1.65D || var13 < 0.1D)) { -- this.kickPlayer("Illegal stance"); -- this.d.getLogAgent().logWarning(this.playerEntity.getCommandSenderName() + " had an illegal stance: " + var13); -+ -+ if (par1Packet10Flying.moving) { -+ var5 = par1Packet10Flying.xPosition; -+ var7 = par1Packet10Flying.yPosition; -+ var9 = par1Packet10Flying.zPosition; -+ var13 = par1Packet10Flying.stance - par1Packet10Flying.yPosition; -+ -+ if (!this.playerEntity.isPlayerSleeping() && (var13 > 1.65D || var13 < 0.1D)) { -+ this.kickPlayerFromServer("Illegal stance"); -+ this.mcServer.getLogAgent().logWarning(this.playerEntity.getCommandSenderName() + " had an illegal stance: " + var13); - return; - } - -- if(Math.abs(var1.xPosition) > 3.2E7D || Math.abs(var1.zPosition) > 3.2E7D) { -- this.kickPlayer("Illegal position"); -+ if (Math.abs(par1Packet10Flying.xPosition) > 3.2E7D || Math.abs(par1Packet10Flying.zPosition) > 3.2E7D) { -+ this.kickPlayerFromServer("Illegal position"); - return; - } - } - -- if(var1.rotating) { -- var11 = var1.yaw; -- var12 = var1.pitch; -+ if (par1Packet10Flying.rotating) { -+ var11 = par1Packet10Flying.yaw; -+ var12 = par1Packet10Flying.pitch; - } - - this.playerEntity.onUpdateEntity(); - this.playerEntity.ySize = 0.0F; - this.playerEntity.setPositionAndRotation(this.lastPosX, this.lastPosY, this.lastPosZ, var11, var12); -- if(!this.hasMoved) { -+ -+ if (!this.hasMoved) { - return; - } - -@@ -180,361 +217,397 @@ - double var21 = Math.min(Math.abs(var15), Math.abs(this.playerEntity.motionY)); - double var23 = Math.min(Math.abs(var17), Math.abs(this.playerEntity.motionZ)); - double var25 = var19 * var19 + var21 * var21 + var23 * var23; -- if(var25 > 100.0D && (!this.d.isSinglePlayer() || !this.d.getServerOwner().equals(this.playerEntity.getCommandSenderName()))) { -- this.d.getLogAgent().logWarning(this.playerEntity.getCommandSenderName() + " moved too quickly! " + var13 + "," + var15 + "," + var17 + " (" + var19 + ", " + var21 + ", " + var23 + ")"); -+ -+ if (var25 > 100.0D && (!this.mcServer.isSinglePlayer() || !this.mcServer.getServerOwner().equals(this.playerEntity.getCommandSenderName()))) { -+ this.mcServer.getLogAgent().logWarning(this.playerEntity.getCommandSenderName() + " moved too quickly! " + var13 + "," + var15 + "," + var17 + " (" + var19 + ", " + var21 + ", " + var23 + ")"); - this.setPlayerLocation(this.lastPosX, this.lastPosY, this.lastPosZ, this.playerEntity.rotationYaw, this.playerEntity.rotationPitch); - return; - } - -- float var27 = 1.0F / 16.0F; -+ float var27 = 0.0625F; - boolean var28 = var2.getCollidingBoundingBoxes(this.playerEntity, this.playerEntity.boundingBox.copy().contract((double)var27, (double)var27, (double)var27)).isEmpty(); -- if(this.playerEntity.onGround && !var1.onGround && var15 > 0.0D) { -+ -+ if (this.playerEntity.onGround && !par1Packet10Flying.onGround && var15 > 0.0D) { - this.playerEntity.addExhaustion(0.2F); - } - - this.playerEntity.moveEntity(var13, var15, var17); -- this.playerEntity.onGround = var1.onGround; -+ this.playerEntity.onGround = par1Packet10Flying.onGround; - this.playerEntity.addMovementStat(var13, var15, var17); - double var29 = var15; - var13 = var5 - this.playerEntity.posX; - var15 = var7 - this.playerEntity.posY; -- if(var15 > -0.5D || var15 < 0.5D) { -+ -+ if (var15 > -0.5D || var15 < 0.5D) { - var15 = 0.0D; - } - - var17 = var9 - this.playerEntity.posZ; - var25 = var13 * var13 + var15 * var15 + var17 * var17; - boolean var31 = false; -- if(var25 > 1.0D / 16.0D && !this.playerEntity.isPlayerSleeping() && !this.playerEntity.theItemInWorldManager.isCreative()) { -+ -+ if (var25 > 0.0625D && !this.playerEntity.isPlayerSleeping() && !this.playerEntity.theItemInWorldManager.isCreative()) { - var31 = true; -- this.d.getLogAgent().logWarning(this.playerEntity.getCommandSenderName() + " moved wrongly!"); -+ this.mcServer.getLogAgent().logWarning(this.playerEntity.getCommandSenderName() + " moved wrongly!"); - } - - this.playerEntity.setPositionAndRotation(var5, var7, var9, var11, var12); - boolean var32 = var2.getCollidingBoundingBoxes(this.playerEntity, this.playerEntity.boundingBox.copy().contract((double)var27, (double)var27, (double)var27)).isEmpty(); -- if(var28 && (var31 || !var32) && !this.playerEntity.isPlayerSleeping()) { -+ -+ if (var28 && (var31 || !var32) && !this.playerEntity.isPlayerSleeping()) { - this.setPlayerLocation(this.lastPosX, this.lastPosY, this.lastPosZ, var11, var12); - return; - } - - AxisAlignedBB var33 = this.playerEntity.boundingBox.copy().expand((double)var27, (double)var27, (double)var27).addCoord(0.0D, -0.55D, 0.0D); -- if(!this.d.isFlightAllowed() && !this.playerEntity.theItemInWorldManager.isCreative() && !var2.checkBlockCollision(var33)) { -- if(var29 >= -0.03125D) { -- ++this.playerInAirTime; -- if(this.playerInAirTime > 80) { -- this.d.getLogAgent().logWarning(this.playerEntity.getCommandSenderName() + " was kicked for floating too long!"); -- this.kickPlayer("Flying is not enabled on this server"); -+ -+ if (!this.mcServer.isFlightAllowed() && !this.playerEntity.theItemInWorldManager.isCreative() && !var2.checkBlockCollision(var33)) { -+ if (var29 >= -0.03125D) { -+ ++this.ticksForFloatKick; -+ -+ if (this.ticksForFloatKick > 80) { -+ this.mcServer.getLogAgent().logWarning(this.playerEntity.getCommandSenderName() + " was kicked for floating too long!"); -+ this.kickPlayerFromServer("Flying is not enabled on this server"); - return; - } - } - } else { -- this.playerInAirTime = 0; -+ this.ticksForFloatKick = 0; - } - -- this.playerEntity.onGround = var1.onGround; -- this.d.getConfigurationManager().serverUpdateMountedMovingPlayer(this.playerEntity); -- this.playerEntity.handleFalling(this.playerEntity.posY - var3, var1.onGround); -- } else if(this.currentTicks % 20 == 0) { -+ this.playerEntity.onGround = par1Packet10Flying.onGround; -+ this.mcServer.getConfigurationManager().serverUpdateMountedMovingPlayer(this.playerEntity); -+ this.playerEntity.updateFlyingState(this.playerEntity.posY - var3, par1Packet10Flying.onGround); -+ } else if (this.currentTicks % 20 == 0) { - this.setPlayerLocation(this.lastPosX, this.lastPosY, this.lastPosZ, this.playerEntity.rotationYaw, this.playerEntity.rotationPitch); - } -- - } - } - -- public void setPlayerLocation(double var1, double var3, double var5, float var7, float var8) { -+ /** -+ * Moves the player to the specified destination and rotation -+ */ -+ public void setPlayerLocation(double par1, double par3, double par5, float par7, float par8) { - this.hasMoved = false; -- this.lastPosX = var1; -- this.lastPosY = var3; -- this.lastPosZ = var5; -- this.playerEntity.setPositionAndRotation(var1, var3, var5, var7, var8); -- this.playerEntity.playerNetServerHandler.sendPacket(new Packet13PlayerLookMove(var1, var3 + (double)1.62F, var3, var5, var7, var8, false)); -+ this.lastPosX = par1; -+ this.lastPosY = par3; -+ this.lastPosZ = par5; -+ this.playerEntity.setPositionAndRotation(par1, par3, par5, par7, par8); -+ this.playerEntity.playerNetServerHandler.sendPacketToPlayer(new Packet13PlayerLookMove(par1, par3 + 1.6200000047683716D, par3, par5, par7, par8, false)); - } - -- public void handleBlockDig(Packet14BlockDig var1) { -- WorldServer var2 = this.d.worldServerForDimension(this.playerEntity.dimension); -+ public void handleBlockDig(Packet14BlockDig par1Packet14BlockDig) { -+ WorldServer var2 = this.mcServer.worldServerForDimension(this.playerEntity.dimension); - this.playerEntity.func_143004_u(); -- if(var1.status == 4) { -+ -+ if (par1Packet14BlockDig.status == 4) { - this.playerEntity.dropOneItem(false); -- } else if(var1.status == 3) { -+ } else if (par1Packet14BlockDig.status == 3) { - this.playerEntity.dropOneItem(true); -- } else if(var1.status == 5) { -+ } else if (par1Packet14BlockDig.status == 5) { - this.playerEntity.stopUsingItem(); - } else { - boolean var3 = false; -- if(var1.status == 0) { -- var3 = true; -- } -- -- if(var1.status == 1) { -- var3 = true; -- } -- -- if(var1.status == 2) { -- var3 = true; -- } -- -- int var4 = var1.xPosition; -- int var5 = var1.yPosition; -- int var6 = var1.zPosition; -- if(var3) { -+ -+ if (par1Packet14BlockDig.status == 0) { -+ var3 = true; -+ } -+ -+ if (par1Packet14BlockDig.status == 1) { -+ var3 = true; -+ } -+ -+ if (par1Packet14BlockDig.status == 2) { -+ var3 = true; -+ } -+ -+ int var4 = par1Packet14BlockDig.xPosition; -+ int var5 = par1Packet14BlockDig.yPosition; -+ int var6 = par1Packet14BlockDig.zPosition; -+ -+ if (var3) { - double var7 = this.playerEntity.posX - ((double)var4 + 0.5D); - double var9 = this.playerEntity.posY - ((double)var5 + 0.5D) + 1.5D; - double var11 = this.playerEntity.posZ - ((double)var6 + 0.5D); - double var13 = var7 * var7 + var9 * var9 + var11 * var11; -- if(var13 > 36.0D) { -+ -+ if (var13 > 36.0D) { - return; - } - -- if(var5 >= this.d.getBuildLimit()) { -+ if (var5 >= this.mcServer.getBuildLimit()) { - return; - } - } - -- if(var1.status == 0) { -- if(!this.d.isBlockProtected(var2, var4, var5, var6, this.playerEntity)) { -- this.playerEntity.theItemInWorldManager.onBlockClicked(var4, var5, var6, var1.face); -+ if (par1Packet14BlockDig.status == 0) { -+ if (!this.mcServer.isBlockProtected(var2, var4, var5, var6, this.playerEntity)) { -+ this.playerEntity.theItemInWorldManager.onBlockClicked(var4, var5, var6, par1Packet14BlockDig.face); - } else { -- this.playerEntity.playerNetServerHandler.sendPacket(new Packet53BlockChange(var4, var5, var6, var2)); -- } -- } else if(var1.status == 2) { -- this.playerEntity.theItemInWorldManager.blockRemoving(var4, var5, var6); -- if(var2.getBlockId(var4, var5, var6) != 0) { -- this.playerEntity.playerNetServerHandler.sendPacket(new Packet53BlockChange(var4, var5, var6, var2)); -- } -- } else if(var1.status == 1) { -+ this.playerEntity.playerNetServerHandler.sendPacketToPlayer(new Packet53BlockChange(var4, var5, var6, var2)); -+ } -+ } else if (par1Packet14BlockDig.status == 2) { -+ this.playerEntity.theItemInWorldManager.uncheckedTryHarvestBlock(var4, var5, var6); -+ -+ if (var2.getBlockId(var4, var5, var6) != 0) { -+ this.playerEntity.playerNetServerHandler.sendPacketToPlayer(new Packet53BlockChange(var4, var5, var6, var2)); -+ } -+ } else if (par1Packet14BlockDig.status == 1) { - this.playerEntity.theItemInWorldManager.cancelDestroyingBlock(var4, var5, var6); -- if(var2.getBlockId(var4, var5, var6) != 0) { -- this.playerEntity.playerNetServerHandler.sendPacket(new Packet53BlockChange(var4, var5, var6, var2)); -+ -+ if (var2.getBlockId(var4, var5, var6) != 0) { -+ this.playerEntity.playerNetServerHandler.sendPacketToPlayer(new Packet53BlockChange(var4, var5, var6, var2)); - } - } -- - } - } - -- public void handlePlace(Packet15Place var1) { -- WorldServer var2 = this.d.worldServerForDimension(this.playerEntity.dimension); -+ public void handlePlace(Packet15Place par1Packet15Place) { -+ WorldServer var2 = this.mcServer.worldServerForDimension(this.playerEntity.dimension); - ItemStack var3 = this.playerEntity.inventory.getCurrentItem(); - boolean var4 = false; -- int var5 = var1.getXPosition(); -- int var6 = var1.getYPosition(); -- int var7 = var1.getZPosition(); -- int var8 = var1.getDirection(); -+ int var5 = par1Packet15Place.getXPosition(); -+ int var6 = par1Packet15Place.getYPosition(); -+ int var7 = par1Packet15Place.getZPosition(); -+ int var8 = par1Packet15Place.getDirection(); - this.playerEntity.func_143004_u(); -- if(var1.getDirection() == 255) { -- if(var3 == null) { -+ -+ if (par1Packet15Place.getDirection() == 255) { -+ if (var3 == null) { - return; - } - - this.playerEntity.theItemInWorldManager.tryUseItem(this.playerEntity, var2, var3); -- } else if(var1.getYPosition() < this.d.getBuildLimit() - 1 || var1.getDirection() != 1 && var1.getYPosition() < this.d.getBuildLimit()) { -- if(this.hasMoved && this.playerEntity.getDistanceSq((double)var5 + 0.5D, (double)var6 + 0.5D, (double)var7 + 0.5D) < 64.0D && !this.d.isBlockProtected(var2, var5, var6, var7, this.playerEntity)) { -- this.playerEntity.theItemInWorldManager.activateBlockOrUseItem(this.playerEntity, var2, var3, var5, var6, var7, var8, var1.getXOffset(), var1.getYOffset(), var1.getZOffset()); -- } -- -+ } else if (par1Packet15Place.getYPosition() >= this.mcServer.getBuildLimit() - 1 && (par1Packet15Place.getDirection() == 1 || par1Packet15Place.getYPosition() >= this.mcServer.getBuildLimit())) { -+ this.playerEntity.playerNetServerHandler.sendPacketToPlayer(new Packet3Chat(ChatMessageComponent.createFromTranslationWithSubstitutions("build.tooHigh", new Object[] {Integer.valueOf(this.mcServer.getBuildLimit())}).setColor(EnumChatFormatting.RED))); - var4 = true; - } else { -- this.playerEntity.playerNetServerHandler.sendPacket(new Packet3Chat(ChatMessageComponent.createFromTranslationWithSubstitutions("build.tooHigh", new Object[]{Integer.valueOf(this.d.getBuildLimit())}).setColor(EnumChatFormatting.RED))); -+ if (this.hasMoved && this.playerEntity.getDistanceSq((double)var5 + 0.5D, (double)var6 + 0.5D, (double)var7 + 0.5D) < 64.0D && !this.mcServer.isBlockProtected(var2, var5, var6, var7, this.playerEntity)) { -+ this.playerEntity.theItemInWorldManager.activateBlockOrUseItem(this.playerEntity, var2, var3, var5, var6, var7, var8, par1Packet15Place.getXOffset(), par1Packet15Place.getYOffset(), par1Packet15Place.getZOffset()); -+ } -+ - var4 = true; - } - -- if(var4) { -- this.playerEntity.playerNetServerHandler.sendPacket(new Packet53BlockChange(var5, var6, var7, var2)); -- if(var8 == 0) { -+ if (var4) { -+ this.playerEntity.playerNetServerHandler.sendPacketToPlayer(new Packet53BlockChange(var5, var6, var7, var2)); -+ -+ if (var8 == 0) { - --var6; - } - -- if(var8 == 1) { -+ if (var8 == 1) { - ++var6; - } - -- if(var8 == 2) { -+ if (var8 == 2) { - --var7; - } - -- if(var8 == 3) { -+ if (var8 == 3) { - ++var7; - } - -- if(var8 == 4) { -+ if (var8 == 4) { - --var5; - } - -- if(var8 == 5) { -+ if (var8 == 5) { - ++var5; - } - -- this.playerEntity.playerNetServerHandler.sendPacket(new Packet53BlockChange(var5, var6, var7, var2)); -+ this.playerEntity.playerNetServerHandler.sendPacketToPlayer(new Packet53BlockChange(var5, var6, var7, var2)); - } - - var3 = this.playerEntity.inventory.getCurrentItem(); -- if(var3 != null && var3.stackSize == 0) { -+ -+ if (var3 != null && var3.stackSize == 0) { - this.playerEntity.inventory.mainInventory[this.playerEntity.inventory.currentItem] = null; - var3 = null; - } - -- if(var3 == null || var3.getMaxItemUseDuration() == 0) { -- this.playerEntity.isChangingQuantityOnly = true; -+ if (var3 == null || var3.getMaxItemUseDuration() == 0) { -+ this.playerEntity.playerInventoryBeingManipulated = true; - this.playerEntity.inventory.mainInventory[this.playerEntity.inventory.currentItem] = ItemStack.copyItemStack(this.playerEntity.inventory.mainInventory[this.playerEntity.inventory.currentItem]); - Slot var9 = this.playerEntity.openContainer.getSlotFromInventory(this.playerEntity.inventory, this.playerEntity.inventory.currentItem); - this.playerEntity.openContainer.detectAndSendChanges(); -- this.playerEntity.isChangingQuantityOnly = false; -- if(!ItemStack.areItemStacksEqual(this.playerEntity.inventory.getCurrentItem(), var1.getItemStack())) { -- this.sendPacket(new Packet103SetSlot(this.playerEntity.openContainer.windowId, var9.slotNumber, this.playerEntity.inventory.getCurrentItem())); -+ this.playerEntity.playerInventoryBeingManipulated = false; -+ -+ if (!ItemStack.areItemStacksEqual(this.playerEntity.inventory.getCurrentItem(), par1Packet15Place.getItemStack())) { -+ this.sendPacketToPlayer(new Packet103SetSlot(this.playerEntity.openContainer.windowId, var9.slotNumber, this.playerEntity.inventory.getCurrentItem())); - } - } -- - } - -- public void handleErrorMessage(String var1, Object[] var2) { -- this.d.getLogAgent().logInfo(this.playerEntity.getCommandSenderName() + " lost connection: " + var1); -- this.d.getConfigurationManager().sendChatMsg(ChatMessageComponent.createFromTranslationWithSubstitutions("multiplayer.player.left", new Object[]{this.playerEntity.getTranslatedEntityName()}).setColor(EnumChatFormatting.YELLOW)); -- this.d.getConfigurationManager().playerLoggedOut(this.playerEntity); -+ public void handleErrorMessage(String par1Str, Object[] par2ArrayOfObj) { -+ this.mcServer.getLogAgent().logInfo(this.playerEntity.getCommandSenderName() + " lost connection: " + par1Str); -+ this.mcServer.getConfigurationManager().sendChatMsg(ChatMessageComponent.createFromTranslationWithSubstitutions("multiplayer.player.left", new Object[] {this.playerEntity.getTranslatedEntityName()}).setColor(EnumChatFormatting.YELLOW)); -+ this.mcServer.getConfigurationManager().playerLoggedOut(this.playerEntity); - this.connectionClosed = true; -- if(this.d.isSinglePlayer() && this.playerEntity.getCommandSenderName().equals(this.d.getServerOwner())) { -- this.d.getLogAgent().logInfo("Stopping singleplayer server as player logged out"); -- this.d.initiateShutdown(); -+ -+ if (this.mcServer.isSinglePlayer() && this.playerEntity.getCommandSenderName().equals(this.mcServer.getServerOwner())) { -+ this.mcServer.getLogAgent().logInfo("Stopping singleplayer server as player logged out"); -+ this.mcServer.initiateShutdown(); - } -- -- } -- -- public void unexpectedPacket(Packet var1) { -- this.d.getLogAgent().logWarning(this.getClass() + " wasn\'t prepared to deal with a " + var1.getClass()); -- this.kickPlayer("Protocol error, unexpected packet"); -- } -- -- public void sendPacket(Packet var1) { -- if(var1 instanceof Packet3Chat) { -- Packet3Chat var2 = (Packet3Chat)var1; -+ } -+ -+ /** -+ * Default handler called for packets that don't have their own handlers in NetClientHandler; currentlly does nothing. -+ */ -+ public void unexpectedPacket(Packet par1Packet) { -+ this.mcServer.getLogAgent().logWarning(this.getClass() + " wasn\'t prepared to deal with a " + par1Packet.getClass()); -+ this.kickPlayerFromServer("Protocol error, unexpected packet"); -+ } -+ -+ /** -+ * addToSendQueue. if it is a chat packet, check before sending it -+ */ -+ public void sendPacketToPlayer(Packet par1Packet) { -+ if (par1Packet instanceof Packet3Chat) { -+ Packet3Chat var2 = (Packet3Chat)par1Packet; - int var3 = this.playerEntity.getChatVisibility(); -- if(var3 == 2) { -+ -+ if (var3 == 2) { - return; - } - -- if(var3 == 1 && !var2.getIsServer()) { -+ if (var3 == 1 && !var2.getIsServer()) { - return; - } - } - - try { -- this.netManager.addToSendQueue(var1); -+ this.netManager.addToSendQueue(par1Packet); - } catch (Throwable var5) { - CrashReport var6 = CrashReport.makeCrashReport(var5, "Sending packet"); - CrashReportCategory var4 = var6.makeCategory("Packet being sent"); -- var4.addCrashSectionCallable("Packet ID", new CallablePacketID(this, var1)); -- var4.addCrashSectionCallable("Packet class", new CallablePacketClass(this, var1)); -+ var4.addCrashSectionCallable("Packet ID", new CallablePacketID(this, par1Packet)); -+ var4.addCrashSectionCallable("Packet class", new CallablePacketClass(this, par1Packet)); - throw new ReportedException(var6); - } - } - -- public void handleBlockItemSwitch(Packet16BlockItemSwitch var1) { -- if(var1.id >= 0 && var1.id < InventoryPlayer.getHotbarSize()) { -- this.playerEntity.inventory.currentItem = var1.id; -+ public void handleBlockItemSwitch(Packet16BlockItemSwitch par1Packet16BlockItemSwitch) { -+ if (par1Packet16BlockItemSwitch.id >= 0 && par1Packet16BlockItemSwitch.id < InventoryPlayer.getHotbarSize()) { -+ this.playerEntity.inventory.currentItem = par1Packet16BlockItemSwitch.id; - this.playerEntity.func_143004_u(); - } else { -- this.d.getLogAgent().logWarning(this.playerEntity.getCommandSenderName() + " tried to set an invalid carried item"); -+ this.mcServer.getLogAgent().logWarning(this.playerEntity.getCommandSenderName() + " tried to set an invalid carried item"); - } - } - -- public void handleChat(Packet3Chat var1) { -- if(this.playerEntity.getChatVisibility() == 2) { -- this.sendPacket(new Packet3Chat(ChatMessageComponent.createFromTranslationKey("chat.cannotSend").setColor(EnumChatFormatting.RED))); -+ public void handleChat(Packet3Chat par1Packet3Chat) { -+ if (this.playerEntity.getChatVisibility() == 2) { -+ this.sendPacketToPlayer(new Packet3Chat(ChatMessageComponent.createFromTranslationKey("chat.cannotSend").setColor(EnumChatFormatting.RED))); - } else { - this.playerEntity.func_143004_u(); -- String var2 = var1.a; -- if(var2.length() > 100) { -- this.kickPlayer("Chat message too long"); -+ String var2 = par1Packet3Chat.message; -+ -+ if (var2.length() > 100) { -+ this.kickPlayerFromServer("Chat message too long"); - } else { - var2 = org.apache.commons.lang3.StringUtils.normalizeSpace(var2); - -- for(int var3 = 0; var3 < var2.length(); ++var3) { -- if(!ChatAllowedCharacters.isAllowedCharacter(var2.charAt(var3))) { -- this.kickPlayer("Illegal characters in chat"); -+ for (int var3 = 0; var3 < var2.length(); ++var3) { -+ if (!ChatAllowedCharacters.isAllowedCharacter(var2.charAt(var3))) { -+ this.kickPlayerFromServer("Illegal characters in chat"); - return; - } - } - -- if(var2.startsWith("/")) { -+ if (var2.startsWith("/")) { - this.handleSlashCommand(var2); - } else { -- if(this.playerEntity.getChatVisibility() == 1) { -- this.sendPacket(new Packet3Chat(ChatMessageComponent.createFromTranslationKey("chat.cannotSend").setColor(EnumChatFormatting.RED))); -+ if (this.playerEntity.getChatVisibility() == 1) { -+ this.sendPacketToPlayer(new Packet3Chat(ChatMessageComponent.createFromTranslationKey("chat.cannotSend").setColor(EnumChatFormatting.RED))); - return; - } - -- ChatMessageComponent var4 = ChatMessageComponent.createFromTranslationWithSubstitutions("chat.type.text", new Object[]{this.playerEntity.getTranslatedEntityName(), var2}); -- this.d.getConfigurationManager().func_110459_a(var4, false); -+ ChatMessageComponent var4 = ChatMessageComponent.createFromTranslationWithSubstitutions("chat.type.text", new Object[] {this.playerEntity.getTranslatedEntityName(), var2}); -+ this.mcServer.getConfigurationManager().func_110459_a(var4, false); - } - - this.chatSpamThresholdCount += 20; -- if(this.chatSpamThresholdCount > 200 && !this.d.getConfigurationManager().isPlayerOpped(this.playerEntity.getCommandSenderName())) { -- this.kickPlayer("disconnect.spam"); -+ -+ if (this.chatSpamThresholdCount > 200 && !this.mcServer.getConfigurationManager().isPlayerOpped(this.playerEntity.getCommandSenderName())) { -+ this.kickPlayerFromServer("disconnect.spam"); - } -- - } - } - } - -- private void handleSlashCommand(String var1) { -- this.d.getCommandManager().executeCommand(this.playerEntity, var1); -+ /** -+ * Processes a / command -+ */ -+ private void handleSlashCommand(String par1Str) { -+ this.mcServer.getCommandManager().executeCommand(this.playerEntity, par1Str); - } - -- public void handleAnimation(Packet18Animation var1) { -+ public void handleAnimation(Packet18Animation par1Packet18Animation) { - this.playerEntity.func_143004_u(); -- if(var1.animate == 1) { -+ -+ if (par1Packet18Animation.animate == 1) { - this.playerEntity.swingItem(); - } -- - } - -- public void handleEntityAction(Packet19EntityAction var1) { -+ /** -+ * runs registerPacket on the given Packet19EntityAction -+ */ -+ public void handleEntityAction(Packet19EntityAction par1Packet19EntityAction) { - this.playerEntity.func_143004_u(); -- if(var1.action == 1) { -+ -+ if (par1Packet19EntityAction.action == 1) { - this.playerEntity.setSneaking(true); -- } else if(var1.action == 2) { -+ } else if (par1Packet19EntityAction.action == 2) { - this.playerEntity.setSneaking(false); -- } else if(var1.action == 4) { -+ } else if (par1Packet19EntityAction.action == 4) { - this.playerEntity.setSprinting(true); -- } else if(var1.action == 5) { -+ } else if (par1Packet19EntityAction.action == 5) { - this.playerEntity.setSprinting(false); -- } else if(var1.action == 3) { -+ } else if (par1Packet19EntityAction.action == 3) { - this.playerEntity.wakeUpPlayer(false, true, true); - this.hasMoved = false; -- } else if(var1.action == 6) { -- if(this.playerEntity.ridingEntity != null && this.playerEntity.ridingEntity instanceof EntityHorse) { -- ((EntityHorse)this.playerEntity.ridingEntity).setJumpPower(var1.auxData); -+ } else if (par1Packet19EntityAction.action == 6) { -+ if (this.playerEntity.ridingEntity != null && this.playerEntity.ridingEntity instanceof EntityHorse) { -+ ((EntityHorse)this.playerEntity.ridingEntity).setJumpPower(par1Packet19EntityAction.auxData); - } -- } else if(var1.action == 7 && this.playerEntity.ridingEntity != null && this.playerEntity.ridingEntity instanceof EntityHorse) { -+ } else if (par1Packet19EntityAction.action == 7 && this.playerEntity.ridingEntity != null && this.playerEntity.ridingEntity instanceof EntityHorse) { - ((EntityHorse)this.playerEntity.ridingEntity).openGUI(this.playerEntity); - } -- - } - -- public void handleKickDisconnect(Packet255KickDisconnect var1) { -+ public void handleKickDisconnect(Packet255KickDisconnect par1Packet255KickDisconnect) { - this.netManager.networkShutdown("disconnect.quitting", new Object[0]); - } - -- public int getNumChunkDataPackets() { -- return this.netManager.getNumChunkDataPackets(); -+ /** -+ * returns 0 for memoryMapped connections -+ */ -+ public int packetSize() { -+ return this.netManager.packetSize(); - } - -- public void handleUseEntity(Packet7UseEntity var1) { -- WorldServer var2 = this.d.worldServerForDimension(this.playerEntity.dimension); -- Entity var3 = var2.getEntityByID(var1.targetEntity); -+ public void handleUseEntity(Packet7UseEntity par1Packet7UseEntity) { -+ WorldServer var2 = this.mcServer.worldServerForDimension(this.playerEntity.dimension); -+ Entity var3 = var2.getEntityByID(par1Packet7UseEntity.targetEntity); - this.playerEntity.func_143004_u(); -- if(var3 != null) { -+ -+ if (var3 != null) { - boolean var4 = this.playerEntity.canEntityBeSeen(var3); - double var5 = 36.0D; -- if(!var4) { -+ -+ if (!var4) { - var5 = 9.0D; - } - -- if(this.playerEntity.getDistanceSqToEntity(var3) < var5) { -- if(var1.isLeftClick == 0) { -+ if (this.playerEntity.getDistanceSqToEntity(var3) < var5) { -+ if (par1Packet7UseEntity.isLeftClick == 0) { - this.playerEntity.interactWith(var3); -- } else if(var1.isLeftClick == 1) { -- if(var3 instanceof EntityItem || var3 instanceof EntityXPOrb || var3 instanceof EntityArrow || var3 == this.playerEntity) { -- this.kickPlayer("Attempting to attack an invalid entity"); -- this.d.logWarning("Player " + this.playerEntity.getCommandSenderName() + " tried to attack an invalid entity"); -+ } else if (par1Packet7UseEntity.isLeftClick == 1) { -+ if (var3 instanceof EntityItem || var3 instanceof EntityXPOrb || var3 instanceof EntityArrow || var3 == this.playerEntity) { -+ this.kickPlayerFromServer("Attempting to attack an invalid entity"); -+ this.mcServer.logWarning("Player " + this.playerEntity.getCommandSenderName() + " tried to attack an invalid entity"); - return; - } - -@@ -542,223 +615,255 @@ - } - } - } -- - } - -- public void handleClientCommand(Packet205ClientCommand var1) { -+ public void handleClientCommand(Packet205ClientCommand par1Packet205ClientCommand) { - this.playerEntity.func_143004_u(); -- if(var1.forceRespawn == 1) { -- if(this.playerEntity.playerConqueredTheEnd) { -- this.playerEntity = this.d.getConfigurationManager().recreatePlayerEntity(this.playerEntity, 0, true); -- } else if(this.playerEntity.getServerForPlayer().getWorldInfo().isHardcoreModeEnabled()) { -- if(this.d.isSinglePlayer() && this.playerEntity.getCommandSenderName().equals(this.d.getServerOwner())) { -- this.playerEntity.playerNetServerHandler.kickPlayer("You have died. Game over, man, it\'s game over!"); -- this.d.deleteWorldAndStopServer(); -+ -+ if (par1Packet205ClientCommand.forceRespawn == 1) { -+ if (this.playerEntity.playerConqueredTheEnd) { -+ this.playerEntity = this.mcServer.getConfigurationManager().respawnPlayer(this.playerEntity, 0, true); -+ } else if (this.playerEntity.getServerForPlayer().getWorldInfo().isHardcoreModeEnabled()) { -+ if (this.mcServer.isSinglePlayer() && this.playerEntity.getCommandSenderName().equals(this.mcServer.getServerOwner())) { -+ this.playerEntity.playerNetServerHandler.kickPlayerFromServer("You have died. Game over, man, it\'s game over!"); -+ this.mcServer.deleteWorldAndStopServer(); - } else { - BanEntry var2 = new BanEntry(this.playerEntity.getCommandSenderName()); - var2.setBanReason("Death in Hardcore"); -- this.d.getConfigurationManager().getBannedPlayers().put(var2); -- this.playerEntity.playerNetServerHandler.kickPlayer("You have died. Game over, man, it\'s game over!"); -+ this.mcServer.getConfigurationManager().getBannedPlayers().put(var2); -+ this.playerEntity.playerNetServerHandler.kickPlayerFromServer("You have died. Game over, man, it\'s game over!"); - } - } else { -- if(this.playerEntity.getHealth() > 0.0F) { -+ if (this.playerEntity.getHealth() > 0.0F) { - return; - } - -- this.playerEntity = this.d.getConfigurationManager().recreatePlayerEntity(this.playerEntity, 0, false); -+ this.playerEntity = this.mcServer.getConfigurationManager().respawnPlayer(this.playerEntity, 0, false); - } - } -- - } - -+ /** -+ * If this returns false, all packets will be queued for the main thread to handle, even if they would otherwise be -+ * processed asynchronously. Used to avoid processing packets on the client before the world has been downloaded (which -+ * happens on the main thread) -+ */ - public boolean canProcessPacketsAsync() { - return true; - } - -- public void handleRespawn(Packet9Respawn var1) { -- } -+ /** -+ * respawns the player -+ */ -+ public void handleRespawn(Packet9Respawn par1Packet9Respawn) {} - -- public void handleCloseWindow(Packet101CloseWindow var1) { -+ public void handleCloseWindow(Packet101CloseWindow par1Packet101CloseWindow) { - this.playerEntity.closeContainer(); - } - -- public void handleWindowClick(Packet102WindowClick var1) { -+ public void handleWindowClick(Packet102WindowClick par1Packet102WindowClick) { - this.playerEntity.func_143004_u(); -- if(this.playerEntity.openContainer.windowId == var1.window_Id && this.playerEntity.openContainer.getCanCraft(this.playerEntity)) { -- ItemStack var2 = this.playerEntity.openContainer.slotClick(var1.inventorySlot, var1.mouseClick, var1.holdingShift, this.playerEntity); -- if(ItemStack.areItemStacksEqual(var1.itemStack, var2)) { -- this.playerEntity.playerNetServerHandler.sendPacket(new Packet106Transaction(var1.window_Id, var1.action, true)); -- this.playerEntity.isChangingQuantityOnly = true; -+ -+ if (this.playerEntity.openContainer.windowId == par1Packet102WindowClick.window_Id && this.playerEntity.openContainer.isPlayerNotUsingContainer(this.playerEntity)) { -+ ItemStack var2 = this.playerEntity.openContainer.slotClick(par1Packet102WindowClick.inventorySlot, par1Packet102WindowClick.mouseClick, par1Packet102WindowClick.holdingShift, this.playerEntity); -+ -+ if (ItemStack.areItemStacksEqual(par1Packet102WindowClick.itemStack, var2)) { -+ this.playerEntity.playerNetServerHandler.sendPacketToPlayer(new Packet106Transaction(par1Packet102WindowClick.window_Id, par1Packet102WindowClick.action, true)); -+ this.playerEntity.playerInventoryBeingManipulated = true; - this.playerEntity.openContainer.detectAndSendChanges(); - this.playerEntity.updateHeldItem(); -- this.playerEntity.isChangingQuantityOnly = false; -+ this.playerEntity.playerInventoryBeingManipulated = false; - } else { -- this.field_72586_s.addKey(this.playerEntity.openContainer.windowId, Short.valueOf(var1.action)); -- this.playerEntity.playerNetServerHandler.sendPacket(new Packet106Transaction(var1.window_Id, var1.action, false)); -- this.playerEntity.openContainer.setCanCraft(this.playerEntity, false); -+ this.field_72586_s.addKey(this.playerEntity.openContainer.windowId, Short.valueOf(par1Packet102WindowClick.action)); -+ this.playerEntity.playerNetServerHandler.sendPacketToPlayer(new Packet106Transaction(par1Packet102WindowClick.window_Id, par1Packet102WindowClick.action, false)); -+ this.playerEntity.openContainer.setPlayerIsPresent(this.playerEntity, false); - ArrayList var3 = new ArrayList(); - -- for(int var4 = 0; var4 < this.playerEntity.openContainer.c.size(); ++var4) { -- var3.add(((Slot)this.playerEntity.openContainer.c.get(var4)).getStack()); -+ for (int var4 = 0; var4 < this.playerEntity.openContainer.inventorySlots.size(); ++var4) { -+ var3.add(((Slot)this.playerEntity.openContainer.inventorySlots.get(var4)).getStack()); - } - -- this.playerEntity.updateCraftingInventory(this.playerEntity.openContainer, var3); -+ this.playerEntity.sendContainerAndContentsToPlayer(this.playerEntity.openContainer, var3); - } - } -- - } - -- public void handleEnchantItem(Packet108EnchantItem var1) { -+ public void handleEnchantItem(Packet108EnchantItem par1Packet108EnchantItem) { - this.playerEntity.func_143004_u(); -- if(this.playerEntity.openContainer.windowId == var1.windowId && this.playerEntity.openContainer.getCanCraft(this.playerEntity)) { -- this.playerEntity.openContainer.enchantItem(this.playerEntity, var1.enchantment); -+ -+ if (this.playerEntity.openContainer.windowId == par1Packet108EnchantItem.windowId && this.playerEntity.openContainer.isPlayerNotUsingContainer(this.playerEntity)) { -+ this.playerEntity.openContainer.enchantItem(this.playerEntity, par1Packet108EnchantItem.enchantment); - this.playerEntity.openContainer.detectAndSendChanges(); - } -- - } - -- public void handleCreativeSetSlot(Packet107CreativeSetSlot var1) { -- if(this.playerEntity.theItemInWorldManager.isCreative()) { -- boolean var2 = var1.slot < 0; -- ItemStack var3 = var1.itemStack; -- boolean var4 = var1.slot >= 1 && var1.slot < 36 + InventoryPlayer.getHotbarSize(); -+ /** -+ * Handle a creative slot packet. -+ */ -+ public void handleCreativeSetSlot(Packet107CreativeSetSlot par1Packet107CreativeSetSlot) { -+ if (this.playerEntity.theItemInWorldManager.isCreative()) { -+ boolean var2 = par1Packet107CreativeSetSlot.slot < 0; -+ ItemStack var3 = par1Packet107CreativeSetSlot.itemStack; -+ boolean var4 = par1Packet107CreativeSetSlot.slot >= 1 && par1Packet107CreativeSetSlot.slot < 36 + InventoryPlayer.getHotbarSize(); - boolean var5 = var3 == null || var3.itemID < Item.itemsList.length && var3.itemID >= 0 && Item.itemsList[var3.itemID] != null; - boolean var6 = var3 == null || var3.getItemDamage() >= 0 && var3.getItemDamage() >= 0 && var3.stackSize <= 64 && var3.stackSize > 0; -- if(var4 && var5 && var6) { -- if(var3 == null) { -- this.playerEntity.inventoryContainer.putStackInSlot(var1.slot, (ItemStack)null); -+ -+ if (var4 && var5 && var6) { -+ if (var3 == null) { -+ this.playerEntity.inventoryContainer.putStackInSlot(par1Packet107CreativeSetSlot.slot, (ItemStack)null); - } else { -- this.playerEntity.inventoryContainer.putStackInSlot(var1.slot, var3); -+ this.playerEntity.inventoryContainer.putStackInSlot(par1Packet107CreativeSetSlot.slot, var3); - } - -- this.playerEntity.inventoryContainer.setCanCraft(this.playerEntity, true); -- } else if(var2 && var5 && var6 && this.creativeItemCreationSpamThresholdTally < 200) { -+ this.playerEntity.inventoryContainer.setPlayerIsPresent(this.playerEntity, true); -+ } else if (var2 && var5 && var6 && this.creativeItemCreationSpamThresholdTally < 200) { - this.creativeItemCreationSpamThresholdTally += 20; - EntityItem var7 = this.playerEntity.dropPlayerItem(var3); -- if(var7 != null) { -+ -+ if (var7 != null) { - var7.setAgeToCreativeDespawnTime(); - } - } - } -- - } - -- public void handleTransaction(Packet106Transaction var1) { -+ public void handleTransaction(Packet106Transaction par1Packet106Transaction) { - Short var2 = (Short)this.field_72586_s.lookup(this.playerEntity.openContainer.windowId); -- if(var2 != null && var1.shortWindowId == var2.shortValue() && this.playerEntity.openContainer.windowId == var1.windowId && !this.playerEntity.openContainer.getCanCraft(this.playerEntity)) { -- this.playerEntity.openContainer.setCanCraft(this.playerEntity, true); -+ -+ if (var2 != null && par1Packet106Transaction.shortWindowId == var2.shortValue() && this.playerEntity.openContainer.windowId == par1Packet106Transaction.windowId && !this.playerEntity.openContainer.isPlayerNotUsingContainer(this.playerEntity)) { -+ this.playerEntity.openContainer.setPlayerIsPresent(this.playerEntity, true); - } -- - } - -- public void handleUpdateSign(Packet130UpdateSign var1) { -+ /** -+ * Updates Client side signs -+ */ -+ public void handleUpdateSign(Packet130UpdateSign par1Packet130UpdateSign) { - this.playerEntity.func_143004_u(); -- WorldServer var2 = this.d.worldServerForDimension(this.playerEntity.dimension); -- if(var2.blockExists(var1.xPosition, var1.yPosition, var1.zPosition)) { -- TileEntity var3 = var2.getBlockTileEntity(var1.xPosition, var1.yPosition, var1.zPosition); -- if(var3 instanceof TileEntitySign) { -+ WorldServer var2 = this.mcServer.worldServerForDimension(this.playerEntity.dimension); -+ -+ if (var2.blockExists(par1Packet130UpdateSign.xPosition, par1Packet130UpdateSign.yPosition, par1Packet130UpdateSign.zPosition)) { -+ TileEntity var3 = var2.getBlockTileEntity(par1Packet130UpdateSign.xPosition, par1Packet130UpdateSign.yPosition, par1Packet130UpdateSign.zPosition); -+ -+ if (var3 instanceof TileEntitySign) { - TileEntitySign var4 = (TileEntitySign)var3; -- if(!var4.isEditable() || var4.func_142009_b() != this.playerEntity) { -- this.d.logWarning("Player " + this.playerEntity.getCommandSenderName() + " just tried to change non-editable sign"); -+ -+ if (!var4.isEditable() || var4.func_142009_b() != this.playerEntity) { -+ this.mcServer.logWarning("Player " + this.playerEntity.getCommandSenderName() + " just tried to change non-editable sign"); - return; - } - } - - int var6; - int var8; -- for(var8 = 0; var8 < 4; ++var8) { -+ -+ for (var8 = 0; var8 < 4; ++var8) { - boolean var5 = true; -- if(var1.d[var8].length() > 15) { -+ -+ if (par1Packet130UpdateSign.signLines[var8].length() > 15) { - var5 = false; - } else { -- for(var6 = 0; var6 < var1.d[var8].length(); ++var6) { -- if(ChatAllowedCharacters.a.indexOf(var1.d[var8].charAt(var6)) < 0) { -+ for (var6 = 0; var6 < par1Packet130UpdateSign.signLines[var8].length(); ++var6) { -+ if (ChatAllowedCharacters.allowedCharacters.indexOf(par1Packet130UpdateSign.signLines[var8].charAt(var6)) < 0) { - var5 = false; - } - } - } - -- if(!var5) { -- var1.d[var8] = "!?"; -+ if (!var5) { -+ par1Packet130UpdateSign.signLines[var8] = "!?"; - } - } - -- if(var3 instanceof TileEntitySign) { -- var8 = var1.xPosition; -- int var9 = var1.yPosition; -- var6 = var1.zPosition; -+ if (var3 instanceof TileEntitySign) { -+ var8 = par1Packet130UpdateSign.xPosition; -+ int var9 = par1Packet130UpdateSign.yPosition; -+ var6 = par1Packet130UpdateSign.zPosition; - TileEntitySign var7 = (TileEntitySign)var3; -- System.arraycopy(var1.d, 0, var7.a, 0, 4); -+ System.arraycopy(par1Packet130UpdateSign.signLines, 0, var7.signText, 0, 4); - var7.onInventoryChanged(); - var2.markBlockForUpdate(var8, var9, var6); - } - } -- - } - -- public void handleKeepAlive(Packet0KeepAlive var1) { -- if(var1.randomId == this.keepAliveRandomID) { -+ /** -+ * Handle a keep alive packet. -+ */ -+ public void handleKeepAlive(Packet0KeepAlive par1Packet0KeepAlive) { -+ if (par1Packet0KeepAlive.randomId == this.keepAliveRandomID) { - int var2 = (int)(System.nanoTime() / 1000000L - this.keepAliveTimeSent); - this.playerEntity.ping = (this.playerEntity.ping * 3 + var2) / 4; - } -- - } - -+ /** -+ * determine if it is a server handler -+ */ - public boolean isServerHandler() { - return true; - } - -- public void handlePlayerAbilities(Packet202PlayerAbilities var1) { -- this.playerEntity.capabilities.isFlying = var1.getFlying() && this.playerEntity.capabilities.allowFlying; -+ /** -+ * Handle a player abilities packet. -+ */ -+ public void handlePlayerAbilities(Packet202PlayerAbilities par1Packet202PlayerAbilities) { -+ this.playerEntity.capabilities.isFlying = par1Packet202PlayerAbilities.getFlying() && this.playerEntity.capabilities.allowFlying; - } - -- public void handleAutoComplete(Packet203AutoComplete var1) { -+ public void handleAutoComplete(Packet203AutoComplete par1Packet203AutoComplete) { - StringBuilder var2 = new StringBuilder(); -- - String var4; -- for(Iterator var3 = this.d.getPossibleCompletions(this.playerEntity, var1.getText()).iterator(); var3.hasNext(); var2.append(var4)) { -+ -+ for (Iterator var3 = this.mcServer.getPossibleCompletions(this.playerEntity, par1Packet203AutoComplete.getText()).iterator(); var3.hasNext(); var2.append(var4)) { - var4 = (String)var3.next(); -- if(var2.length() > 0) { -+ -+ if (var2.length() > 0) { - var2.append("\u0000"); - } - } - -- this.playerEntity.playerNetServerHandler.sendPacket(new Packet203AutoComplete(var2.toString())); -- } -- -- public void handleClientInfo(Packet204ClientInfo var1) { -- this.playerEntity.updateClientInfo(var1); -- } -- -- public void handleCustomPayload(Packet250CustomPayload var1) { -+ this.playerEntity.playerNetServerHandler.sendPacketToPlayer(new Packet203AutoComplete(var2.toString())); -+ } -+ -+ public void handleClientInfo(Packet204ClientInfo par1Packet204ClientInfo) { -+ this.playerEntity.updateClientInfo(par1Packet204ClientInfo); -+ } -+ -+ public void handleCustomPayload(Packet250CustomPayload par1Packet250CustomPayload) { - DataInputStream var2; - ItemStack var3; - ItemStack var4; -- if("MC|BEdit".equals(var1.a)) { -+ -+ if ("MC|BEdit".equals(par1Packet250CustomPayload.channel)) { - try { -- var2 = new DataInputStream(new ByteArrayInputStream(var1.data)); -+ var2 = new DataInputStream(new ByteArrayInputStream(par1Packet250CustomPayload.data)); - var3 = Packet.readItemStack(var2); -- if(!ItemWritableBook.validBookTagPages(var3.getTagCompound())) { -+ -+ if (!ItemWritableBook.validBookTagPages(var3.getTagCompound())) { - throw new IOException("Invalid book tag!"); - } - - var4 = this.playerEntity.inventory.getCurrentItem(); -- if(var3 != null && var3.itemID == Item.writableBook.itemID && var3.itemID == var4.itemID) { -+ -+ if (var3 != null && var3.itemID == Item.writableBook.itemID && var3.itemID == var4.itemID) { - var4.setTagInfo("pages", var3.getTagCompound().getTagList("pages")); - } - } catch (Exception var12) { - var12.printStackTrace(); - } -- } else if("MC|BSign".equals(var1.a)) { -+ } else if ("MC|BSign".equals(par1Packet250CustomPayload.channel)) { - try { -- var2 = new DataInputStream(new ByteArrayInputStream(var1.data)); -+ var2 = new DataInputStream(new ByteArrayInputStream(par1Packet250CustomPayload.data)); - var3 = Packet.readItemStack(var2); -- if(!ItemEditableBook.validBookTagContents(var3.getTagCompound())) { -+ -+ if (!ItemEditableBook.validBookTagContents(var3.getTagCompound())) { - throw new IOException("Invalid book tag!"); - } - - var4 = this.playerEntity.inventory.getCurrentItem(); -- if(var3 != null && var3.itemID == Item.writtenBook.itemID && var4.itemID == Item.writableBook.itemID) { -+ -+ if (var3 != null && var3.itemID == Item.writtenBook.itemID && var4.itemID == Item.writableBook.itemID) { - var4.setTagInfo("author", new NBTTagString("author", this.playerEntity.getCommandSenderName())); - var4.setTagInfo("title", new NBTTagString("title", var3.getTagCompound().getString("title"))); - var4.setTagInfo("pages", var3.getTagCompound().getTagList("pages")); -@@ -769,12 +874,14 @@ - } - } else { - int var13; -- if("MC|TrSel".equals(var1.a)) { -+ -+ if ("MC|TrSel".equals(par1Packet250CustomPayload.channel)) { - try { -- var2 = new DataInputStream(new ByteArrayInputStream(var1.data)); -+ var2 = new DataInputStream(new ByteArrayInputStream(par1Packet250CustomPayload.data)); - var13 = var2.readInt(); - Container var15 = this.playerEntity.openContainer; -- if(var15 instanceof ContainerMerchant) { -+ -+ if (var15 instanceof ContainerMerchant) { - ((ContainerMerchant)var15).setCurrentRecipeIndex(var13); - } - } catch (Exception var10) { -@@ -782,21 +889,23 @@ - } - } else { - int var17; -- if("MC|AdvCdm".equals(var1.a)) { -- if(!this.d.isCommandBlockEnabled()) { -+ -+ if ("MC|AdvCdm".equals(par1Packet250CustomPayload.channel)) { -+ if (!this.mcServer.isCommandBlockEnabled()) { - this.playerEntity.sendChatToPlayer(ChatMessageComponent.createFromTranslationKey("advMode.notEnabled")); -- } else if(this.playerEntity.canCommandSenderUseCommand(2, "") && this.playerEntity.capabilities.isCreativeMode) { -+ } else if (this.playerEntity.canCommandSenderUseCommand(2, "") && this.playerEntity.capabilities.isCreativeMode) { - try { -- var2 = new DataInputStream(new ByteArrayInputStream(var1.data)); -+ var2 = new DataInputStream(new ByteArrayInputStream(par1Packet250CustomPayload.data)); - var13 = var2.readInt(); - var17 = var2.readInt(); - int var5 = var2.readInt(); - String var6 = Packet.readString(var2, 256); - TileEntity var7 = this.playerEntity.worldObj.getBlockTileEntity(var13, var17, var5); -- if(var7 != null && var7 instanceof TileEntityCommandBlock) { -+ -+ if (var7 != null && var7 instanceof TileEntityCommandBlock) { - ((TileEntityCommandBlock)var7).setCommand(var6); - this.playerEntity.worldObj.markBlockForUpdate(var13, var17, var5); -- this.playerEntity.sendChatToPlayer(ChatMessageComponent.createFromTranslationWithSubstitutions("advMode.setCommand.success", new Object[]{var6})); -+ this.playerEntity.sendChatToPlayer(ChatMessageComponent.createFromTranslationWithSubstitutions("advMode.setCommand.success", new Object[] {var6})); - } - } catch (Exception var9) { - var9.printStackTrace(); -@@ -804,15 +913,16 @@ - } else { - this.playerEntity.sendChatToPlayer(ChatMessageComponent.createFromTranslationKey("advMode.notAllowed")); - } -- } else if("MC|Beacon".equals(var1.a)) { -- if(this.playerEntity.openContainer instanceof ContainerBeacon) { -+ } else if ("MC|Beacon".equals(par1Packet250CustomPayload.channel)) { -+ if (this.playerEntity.openContainer instanceof ContainerBeacon) { - try { -- var2 = new DataInputStream(new ByteArrayInputStream(var1.data)); -+ var2 = new DataInputStream(new ByteArrayInputStream(par1Packet250CustomPayload.data)); - var13 = var2.readInt(); - var17 = var2.readInt(); - ContainerBeacon var18 = (ContainerBeacon)this.playerEntity.openContainer; - Slot var19 = var18.getSlot(0); -- if(var19.getHasStack()) { -+ -+ if (var19.getHasStack()) { - var19.decrStackSize(1); - TileEntityBeacon var20 = var18.getBeacon(); - var20.setPrimaryEffect(var13); -@@ -823,11 +933,13 @@ - var8.printStackTrace(); - } - } -- } else if("MC|ItemName".equals(var1.a) && this.playerEntity.openContainer instanceof ContainerRepair) { -+ } else if ("MC|ItemName".equals(par1Packet250CustomPayload.channel) && this.playerEntity.openContainer instanceof ContainerRepair) { - ContainerRepair var14 = (ContainerRepair)this.playerEntity.openContainer; -- if(var1.data != null && var1.data.length >= 1) { -- String var16 = ChatAllowedCharacters.filerAllowedCharacters(new String(var1.data)); -- if(var16.length() <= 30) { -+ -+ if (par1Packet250CustomPayload.data != null && par1Packet250CustomPayload.data.length >= 1) { -+ String var16 = ChatAllowedCharacters.filerAllowedCharacters(new String(par1Packet250CustomPayload.data)); -+ -+ if (var16.length() <= 30) { - var14.updateItemName(var16); - } - } else { -@@ -836,7 +948,6 @@ - } - } - } -- - } - - public boolean isConnectionClosed() { ---- net/minecraft/src/EnchantmentArrowFire.java -+++ net/minecraft/src/EnchantmentArrowFire.java -@@ -1,19 +1,28 @@ - package net.minecraft.src; - - public class EnchantmentArrowFire extends Enchantment { -- public EnchantmentArrowFire(int var1, int var2) { -- super(var1, var2, EnumEnchantmentType.bow); -+ public EnchantmentArrowFire(int par1, int par2) { -+ super(par1, par2, EnumEnchantmentType.bow); - this.setName("arrowFire"); - } - -- public int getMinEnchantability(int var1) { -+ /** -+ * Returns the minimal value of enchantability needed on the enchantment level passed. -+ */ -+ public int getMinEnchantability(int par1) { - return 20; - } - -- public int getMaxEnchantability(int var1) { -+ /** -+ * Returns the maximum value of enchantability nedded on the enchantment level passed. -+ */ -+ public int getMaxEnchantability(int par1) { - return 50; - } - -+ /** -+ * Returns the maximum level that the enchantment can have. -+ */ - public int getMaxLevel() { - return 1; - } ---- /dev/null -+++ org/spoutcraft/api/util/UniqueItemStringMap.java -@@ -1,0 +1,155 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.api.util; -+ -+import java.util.Set; -+import java.util.concurrent.ConcurrentHashMap; -+import java.util.concurrent.atomic.AtomicInteger; -+ -+public class UniqueItemStringMap { -+ private static final ConcurrentHashMap reverse = new ConcurrentHashMap(); -+ private static final ConcurrentHashMap reverseStable = new ConcurrentHashMap(); -+ private static final ConcurrentHashMap forward = new ConcurrentHashMap(); -+ -+ private static final AtomicInteger idCounter = new AtomicInteger(1024); -+ -+ /*private static Configuration config; -+ -+ public static void setConfigFile(Configuration config) { -+ UniqueItemStringMap.config = config; -+ List keys = config.getKeys(); -+ -+ for (String key : keys) { -+ Integer id = getIdFromFile(decodeKey(key)); -+ if (id != null) { -+ forward.put(key, id); -+ reverse.put(id, key); -+ reverseStable.put(id, key); -+ } -+ } -+ } -+ -+ private static Integer getIdFromFile(String key) { -+ synchronized(config) { -+ key = encodeKey(key); -+ if (config.getProperty(key) == null) { -+ return null; -+ } else { -+ int id = config.getInt(key, -1); -+ if (id == -1) { -+ config.removeProperty(key); -+ return null; -+ } else { -+ return id; -+ } -+ } -+ } -+ } -+ -+ private static void setIdInFile(String key, int id) { -+ synchronized(config) { -+ key = encodeKey(key); -+ config.setProperty(key, id); -+ config.save(); -+ } -+ }*/ -+ -+ private static String encodeKey(String key) { -+ key = key.replace("*", "-*-"); -+ return key.replace(".", "**"); -+ } -+ -+ private static String decodeKey(String key) { -+ key = key.replace("**", "."); -+ return key.replace("-*-", "*"); -+ } -+ -+ public static Set getIds() { -+ return reverse.keySet(); -+ } -+ -+ /** -+ * Associates a unique id for each string -+ * -+ * These associations persist over reloads and server restarts -+ * -+ * @param string the string to be associated -+ * @return the id associated with the string. -+ */ -+ public static int getId(String string) { -+ string = encodeKey(string); -+ -+ Integer id = null; -+ -+ boolean success = false; -+ int testId = idCounter.incrementAndGet() & 0x0FFFF; -+ -+ while (!success || id == null) { -+ id = forward.get(string); -+ if (id != null) { -+ return id; -+ } -+ -+ if (reverse.containsKey(testId)) { // ID already in use -+ testId = idCounter.incrementAndGet() & 0x0FFFF; -+ if (testId == 65535 || testId < 1024) { -+ throw new RuntimeException("[Spout] Out of custom item ids"); -+ } -+ continue; -+ } -+ -+ String oldString = reverse.putIfAbsent(testId, string); -+ -+ if (oldString == null) { // Reverse link success -+ Integer oldId = forward.putIfAbsent(string, testId); -+ if (oldId != null) { // Forward link failed -+ reverse.remove(testId, string); // Remove reverse link -+ continue; -+ } -+ id = testId; -+ } else { // Reverse link failed -+ continue; -+ } -+ -+ reverseStable.put(testId, string); -+ -+ //setIdInFile(decodeKey(string), id); -+ -+ success = true; -+ -+ } -+ -+ return id; -+ } -+ -+ /** -+ * Returns the id associated with a string -+ * -+ * These associations persist over reloads and server restarts -+ * -+ * Note: . characters are replaced with * characters -+ * -+ * @param id the id -+ * @return the string associated with the id, or null if no string is associated -+ */ -+ public static String getString(int id) { -+ return decodeKey(reverseStable.get(id)); -+ } -+} ---- net/minecraft/src/WeightedRandomItem.java -+++ net/minecraft/src/WeightedRandomItem.java -@@ -1,9 +1,13 @@ - package net.minecraft.src; - - public class WeightedRandomItem { -+ -+ /** -+ * The Weight is how often the item is chosen(higher number is higher chance(lower is lower)) -+ */ - protected int itemWeight; - -- public WeightedRandomItem(int var1) { -- this.itemWeight = var1; -+ public WeightedRandomItem(int par1) { -+ this.itemWeight = par1; - } - } ---- net/minecraft/src/GenLayerAddIsland.java -+++ net/minecraft/src/GenLayerAddIsland.java -@@ -1,67 +1,71 @@ - package net.minecraft.src; - - public class GenLayerAddIsland extends GenLayer { -- public GenLayerAddIsland(long var1, GenLayer var3) { -- super(var1); -- this.parent = var3; -+ public GenLayerAddIsland(long par1, GenLayer par3GenLayer) { -+ super(par1); -+ this.parent = par3GenLayer; - } - -- public int[] getInts(int var1, int var2, int var3, int var4) { -- int var5 = var1 - 1; -- int var6 = var2 - 1; -- int var7 = var3 + 2; -- int var8 = var4 + 2; -+ /** -+ * Returns a list of integer values generated by this layer. These may be interpreted as temperatures, rainfall -+ * amounts, or biomeList[] indices based on the particular GenLayer subclass. -+ */ -+ public int[] getInts(int par1, int par2, int par3, int par4) { -+ int var5 = par1 - 1; -+ int var6 = par2 - 1; -+ int var7 = par3 + 2; -+ int var8 = par4 + 2; - int[] var9 = this.parent.getInts(var5, var6, var7, var8); -- int[] var10 = IntCache.getIntCache(var3 * var4); -+ int[] var10 = IntCache.getIntCache(par3 * par4); - -- for(int var11 = 0; var11 < var4; ++var11) { -- for(int var12 = 0; var12 < var3; ++var12) { -+ for (int var11 = 0; var11 < par4; ++var11) { -+ for (int var12 = 0; var12 < par3; ++var12) { - int var13 = var9[var12 + 0 + (var11 + 0) * var7]; - int var14 = var9[var12 + 2 + (var11 + 0) * var7]; - int var15 = var9[var12 + 0 + (var11 + 2) * var7]; - int var16 = var9[var12 + 2 + (var11 + 2) * var7]; - int var17 = var9[var12 + 1 + (var11 + 1) * var7]; -- this.initChunkSeed((long)(var12 + var1), (long)(var11 + var2)); -- if(var17 != 0 || var13 == 0 && var14 == 0 && var15 == 0 && var16 == 0) { -- if(var17 > 0 && (var13 == 0 || var14 == 0 || var15 == 0 || var16 == 0)) { -- if(this.nextInt(5) == 0) { -- if(var17 == BiomeGenBase.icePlains.biomeID) { -- var10[var12 + var11 * var3] = BiomeGenBase.frozenOcean.biomeID; -- } else { -- var10[var12 + var11 * var3] = 0; -- } -- } else { -- var10[var12 + var11 * var3] = var17; -- } -- } else { -- var10[var12 + var11 * var3] = var17; -- } -- } else { -+ this.initChunkSeed((long)(var12 + par1), (long)(var11 + par2)); -+ -+ if (var17 == 0 && (var13 != 0 || var14 != 0 || var15 != 0 || var16 != 0)) { - int var18 = 1; - int var19 = 1; -- if(var13 != 0 && this.nextInt(var18++) == 0) { -+ -+ if (var13 != 0 && this.nextInt(var18++) == 0) { - var19 = var13; - } - -- if(var14 != 0 && this.nextInt(var18++) == 0) { -+ if (var14 != 0 && this.nextInt(var18++) == 0) { - var19 = var14; - } - -- if(var15 != 0 && this.nextInt(var18++) == 0) { -+ if (var15 != 0 && this.nextInt(var18++) == 0) { - var19 = var15; - } - -- if(var16 != 0 && this.nextInt(var18++) == 0) { -+ if (var16 != 0 && this.nextInt(var18++) == 0) { - var19 = var16; - } - -- if(this.nextInt(3) == 0) { -- var10[var12 + var11 * var3] = var19; -- } else if(var19 == BiomeGenBase.icePlains.biomeID) { -- var10[var12 + var11 * var3] = BiomeGenBase.frozenOcean.biomeID; -- } else { -- var10[var12 + var11 * var3] = 0; -- } -+ if (this.nextInt(3) == 0) { -+ var10[var12 + var11 * par3] = var19; -+ } else if (var19 == BiomeGenBase.icePlains.biomeID) { -+ var10[var12 + var11 * par3] = BiomeGenBase.frozenOcean.biomeID; -+ } else { -+ var10[var12 + var11 * par3] = 0; -+ } -+ } else if (var17 > 0 && (var13 == 0 || var14 == 0 || var15 == 0 || var16 == 0)) { -+ if (this.nextInt(5) == 0) { -+ if (var17 == BiomeGenBase.icePlains.biomeID) { -+ var10[var12 + var11 * par3] = BiomeGenBase.frozenOcean.biomeID; -+ } else { -+ var10[var12 + var11 * par3] = 0; -+ } -+ } else { -+ var10[var12 + var11 * par3] = var17; -+ } -+ } else { -+ var10[var12 + var11 * par3] = var17; - } - } - } ---- net/minecraft/src/Packet41EntityEffect.java -+++ net/minecraft/src/Packet41EntityEffect.java -@@ -7,56 +7,79 @@ - public class Packet41EntityEffect extends Packet { - public int entityId; - public byte effectId; -+ -+ /** The effect's amplifier. */ - public byte effectAmplifier; - public short duration; - -- public Packet41EntityEffect() { -- } -- -- public Packet41EntityEffect(int var1, PotionEffect var2) { -- this.entityId = var1; -- this.effectId = (byte)(var2.getPotionID() & 255); -- this.effectAmplifier = (byte)(var2.getAmplifier() & 255); -- if(var2.getDuration() > Short.MAX_VALUE) { -- this.duration = Short.MAX_VALUE; -+ public Packet41EntityEffect() {} -+ -+ public Packet41EntityEffect(int par1, PotionEffect par2PotionEffect) { -+ this.entityId = par1; -+ this.effectId = (byte)(par2PotionEffect.getPotionID() & 255); -+ this.effectAmplifier = (byte)(par2PotionEffect.getAmplifier() & 255); -+ -+ if (par2PotionEffect.getDuration() > 32767) { -+ this.duration = 32767; - } else { -- this.duration = (short)var2.getDuration(); -+ this.duration = (short)par2PotionEffect.getDuration(); - } -- -- } -- -- public void readPacketData(DataInput var1) throws IOException { -- this.entityId = var1.readInt(); -- this.effectId = var1.readByte(); -- this.effectAmplifier = var1.readByte(); -- this.duration = var1.readShort(); -- } -- -- public void writePacketData(DataOutput var1) throws IOException { -- var1.writeInt(this.entityId); -- var1.writeByte(this.effectId); -- var1.writeByte(this.effectAmplifier); -- var1.writeShort(this.duration); -- } -- -+ } -+ -+ /** -+ * Abstract. Reads the raw packet data from the data stream. -+ */ -+ public void readPacketData(DataInput par1DataInput) throws IOException { -+ this.entityId = par1DataInput.readInt(); -+ this.effectId = par1DataInput.readByte(); -+ this.effectAmplifier = par1DataInput.readByte(); -+ this.duration = par1DataInput.readShort(); -+ } -+ -+ /** -+ * Abstract. Writes the raw packet data to the data stream. -+ */ -+ public void writePacketData(DataOutput par1DataOutput) throws IOException { -+ par1DataOutput.writeInt(this.entityId); -+ par1DataOutput.writeByte(this.effectId); -+ par1DataOutput.writeByte(this.effectAmplifier); -+ par1DataOutput.writeShort(this.duration); -+ } -+ -+ /** -+ * Returns true if duration is at maximum, false otherwise. -+ */ - public boolean isDurationMax() { -- return this.duration == Short.MAX_VALUE; -- } -- -- public void processPacket(NetHandler var1) { -- var1.handleEntityEffect(this); -- } -- -+ return this.duration == 32767; -+ } -+ -+ /** -+ * Passes this Packet on to the NetHandler for processing. -+ */ -+ public void processPacket(NetHandler par1NetHandler) { -+ par1NetHandler.handleEntityEffect(this); -+ } -+ -+ /** -+ * Abstract. Return the size of the packet (not counting the header). -+ */ - public int getPacketSize() { - return 8; - } - -+ /** -+ * only false for the abstract Packet class, all real packets return true -+ */ - public boolean isRealPacket() { - return true; - } - -- public boolean containsSameEntityIDAs(Packet var1) { -- Packet41EntityEffect var2 = (Packet41EntityEffect)var1; -+ /** -+ * eg return packet30entity.entityId == entityId; WARNING : will throw if you compare a packet to a different packet -+ * class -+ */ -+ public boolean containsSameEntityIDAs(Packet par1Packet) { -+ Packet41EntityEffect var2 = (Packet41EntityEffect)par1Packet; - return var2.entityId == this.entityId && var2.effectId == this.effectId; - } - } ---- net/minecraft/src/EntityAINearestAttackableTargetSorter.java -+++ net/minecraft/src/EntityAINearestAttackableTargetSorter.java -@@ -5,17 +5,17 @@ - public class EntityAINearestAttackableTargetSorter implements Comparator { - private final Entity theEntity; - -- public EntityAINearestAttackableTargetSorter(Entity var1) { -- this.theEntity = var1; -+ public EntityAINearestAttackableTargetSorter(Entity par1Entity) { -+ this.theEntity = par1Entity; - } - -- public int compareDistanceSq(Entity var1, Entity var2) { -- double var3 = this.theEntity.getDistanceSqToEntity(var1); -- double var5 = this.theEntity.getDistanceSqToEntity(var2); -+ public int compareDistanceSq(Entity par1Entity, Entity par2Entity) { -+ double var3 = this.theEntity.getDistanceSqToEntity(par1Entity); -+ double var5 = this.theEntity.getDistanceSqToEntity(par2Entity); - return var3 < var5 ? -1 : (var3 > var5 ? 1 : 0); - } - -- public int compare(Object var1, Object var2) { -- return this.compareDistanceSq((Entity)var1, (Entity)var2); -+ public int compare(Object par1Obj, Object par2Obj) { -+ return this.compareDistanceSq((Entity)par1Obj, (Entity)par2Obj); - } - } ---- net/minecraft/src/ModelSign.java -+++ net/minecraft/src/ModelSign.java -@@ -1,7 +1,11 @@ - package net.minecraft.src; - - public class ModelSign extends ModelBase { -+ -+ /** The board on a sign that has the writing on it. */ - public ModelRenderer signBoard = new ModelRenderer(this, 0, 0); -+ -+ /** The stick a sign stands on. */ - public ModelRenderer signStick; - - public ModelSign() { -@@ -10,8 +14,11 @@ - this.signStick.addBox(-1.0F, -2.0F, -1.0F, 2, 14, 2, 0.0F); - } - -+ /** -+ * Renders the sign model through TileEntitySignRenderer -+ */ - public void renderSign() { -- this.signBoard.render(1.0F / 16.0F); -- this.signStick.render(1.0F / 16.0F); -+ this.signBoard.render(0.0625F); -+ this.signStick.render(0.0625F); - } - } ---- net/minecraft/src/TcpConnection.java -+++ net/minecraft/src/TcpConnection.java -@@ -17,106 +17,174 @@ - import java.util.concurrent.ConcurrentLinkedQueue; - import java.util.concurrent.atomic.AtomicInteger; - import javax.crypto.SecretKey; -+ - import net.minecraft.server.MinecraftServer; - -+// Spout -+import org.spoutcraft.client.SpoutClient; -+import org.spoutcraft.client.gui.precache.GuiPrecache; -+// End Spout -+ - public class TcpConnection implements INetworkManager { -- public static AtomicInteger a = new AtomicInteger(); -- public static AtomicInteger b = new AtomicInteger(); -- private final Object h; -+ public static AtomicInteger field_74471_a = new AtomicInteger(); -+ public static AtomicInteger field_74469_b = new AtomicInteger(); -+ -+ /** The object used for synchronization on the send queue. */ -+ private final Object sendQueueLock; -+ -+ /** Log agent for TCP connection */ - private final ILogAgent tcpConLogAgent; -- private Socket j; -- private final SocketAddress k; -- private volatile DataInputStream l; -- private volatile DataOutputStream m; -+ -+ /** The socket used by this network manager. */ -+ private Socket networkSocket; -+ -+ /** The InetSocketAddress of the remote endpoint */ -+ private final SocketAddress remoteSocketAddress; -+ -+ /** The input stream connected to the socket. */ -+ private volatile DataInputStream socketInputStream; -+ -+ /** The output stream connected to the socket. */ -+ private volatile DataOutputStream socketOutputStream; -+ -+ /** Whether the network is currently operational. */ - private volatile boolean isRunning; -+ -+ /** -+ * Whether this network manager is currently terminating (and should ignore further errors). -+ */ - private volatile boolean isTerminating; -- private Queue p; -- private List q; -- private List r; -+ -+ /** -+ * Linked list of packets that have been read and are awaiting processing. -+ */ -+ private Queue readPackets; -+ -+ /** Linked list of packets awaiting sending. */ -+ private List dataPackets; -+ -+ /** Linked list of packets with chunk data that are awaiting sending. */ -+ private List chunkDataPackets; -+ -+ /** A reference to the NetHandler object. */ - private NetHandler theNetHandler; -+ -+ /** -+ * Whether this server is currently terminating. If this is a client, this is always false. -+ */ - private boolean isServerTerminating; -- private Thread u; -- private Thread v; -- private String w; -- private Object[] x; -+ -+ /** The thread used for writing. */ -+ private Thread writeThread; -+ -+ /** The thread used for reading. */ -+ private Thread readThread; -+ -+ /** A String indicating why the network has shutdown. */ -+ private String terminationReason; -+ -+ /** Contains shutdown description (internal error, etc.) as string array */ -+ private Object[] shutdownDescription; - private int field_74490_x; -+ -+ /** -+ * The length in bytes of the packets in both send queues (data and chunkData). -+ */ - private int sendQueueByteLength; - public static int[] field_74470_c = new int[256]; - public static int[] field_74467_d = new int[256]; - public int field_74468_e; - boolean isInputBeingDecrypted; - boolean isOutputEncrypted; -- private SecretKey A; -- private PrivateKey B; -+ private SecretKey sharedKeyForEncryption; -+ private PrivateKey field_74463_A; -+ -+ /** -+ * Delay for sending pending chunk data packets (as opposed to pending non-chunk data packets) -+ */ - private int chunkDataPacketsDelay; - -- public TcpConnection(ILogAgent var1, Socket var2, String var3, NetHandler var4) { -- this(var1, var2, var3, var4, (PrivateKey)null); -+ public TcpConnection(ILogAgent par1ILogAgent, Socket par2Socket, String par3Str, NetHandler par4NetHandler) throws IOException { -+ this(par1ILogAgent, par2Socket, par3Str, par4NetHandler, (PrivateKey)null); - } - -- public TcpConnection(ILogAgent var1, Socket var2, String var3, NetHandler var4, PrivateKey var5) { -- this.h = new Object(); -+ public TcpConnection(ILogAgent par1ILogAgent, Socket par2Socket, String par3Str, NetHandler par4NetHandler, PrivateKey par5PrivateKey) throws IOException { -+ this.sendQueueLock = new Object(); - this.isRunning = true; -- this.p = new ConcurrentLinkedQueue(); -- this.q = Collections.synchronizedList(new ArrayList()); -- this.r = Collections.synchronizedList(new ArrayList()); -- this.w = ""; -+ this.readPackets = new ConcurrentLinkedQueue(); -+ this.dataPackets = Collections.synchronizedList(new ArrayList()); -+ this.chunkDataPackets = Collections.synchronizedList(new ArrayList()); -+ this.terminationReason = ""; - this.chunkDataPacketsDelay = 50; -- this.B = var5; -- this.j = var2; -- this.tcpConLogAgent = var1; -- this.k = var2.getRemoteSocketAddress(); -- this.theNetHandler = var4; -+ this.field_74463_A = par5PrivateKey; -+ this.networkSocket = par2Socket; -+ this.tcpConLogAgent = par1ILogAgent; -+ this.remoteSocketAddress = par2Socket.getRemoteSocketAddress(); -+ this.theNetHandler = par4NetHandler; - - try { -- var2.setSoTimeout(30000); -- var2.setTrafficClass(24); -+ par2Socket.setSoTimeout(30000); -+ par2Socket.setTrafficClass(24); - } catch (SocketException var7) { - System.err.println(var7.getMessage()); - } - -- this.l = new DataInputStream(var2.getInputStream()); -- this.m = new DataOutputStream(new BufferedOutputStream(var2.getOutputStream(), 5120)); -- this.v = new TcpReaderThread(this, var3 + " read thread"); -- this.u = new TcpWriterThread(this, var3 + " write thread"); -- this.v.start(); -- this.u.start(); -+ this.socketInputStream = new DataInputStream(par2Socket.getInputStream()); -+ this.socketOutputStream = new DataOutputStream(new BufferedOutputStream(par2Socket.getOutputStream(), 5120)); -+ this.readThread = new TcpReaderThread(this, par3Str + " read thread"); -+ this.writeThread = new TcpWriterThread(this, par3Str + " write thread"); -+ this.readThread.start(); -+ this.writeThread.start(); - } - - public void closeConnections() { - this.wakeThreads(); -- this.u = null; -- this.v = null; -- } -- -- public void setNetHandler(NetHandler var1) { -- this.theNetHandler = var1; -- } -- -- public void addToSendQueue(Packet var1) { -- if(!this.isServerTerminating) { -- Object var2 = this.h; -- synchronized(var2) { -- this.sendQueueByteLength += var1.getPacketSize() + 1; -- this.q.add(var1); -+ this.writeThread = null; -+ this.readThread = null; -+ } -+ -+ /** -+ * Sets the NetHandler for this NetworkManager. Server-only. -+ */ -+ public void setNetHandler(NetHandler par1NetHandler) { -+ this.theNetHandler = par1NetHandler; -+ } -+ -+ /** -+ * Adds the packet to the correct send queue (chunk data packets go to a separate queue). -+ */ -+ public void addToSendQueue(Packet par1Packet) { -+ if (!this.isServerTerminating) { -+ Object var2 = this.sendQueueLock; -+ -+ synchronized (this.sendQueueLock) { -+ this.sendQueueByteLength += par1Packet.getPacketSize() + 1; -+ this.dataPackets.add(par1Packet); - } - } - } - -+ /** -+ * Sends a data packet if there is one to send, or sends a chunk data packet if there is one and the counter is up, or -+ * does nothing. -+ */ - private boolean sendPacket() { - boolean var1 = false; - - try { -- int[] var10000; -- int var10001; - Packet var2; -- if(this.field_74468_e == 0 || !this.q.isEmpty() && MinecraftServer.getCurrentTimeMillis() - ((Packet)this.q.get(0)).creationTimeMillis >= (long)this.field_74468_e) { -+ int var10001; -+ int[] var10000; -+ -+ if (this.field_74468_e == 0 || !this.dataPackets.isEmpty() && MinecraftServer.getSystemTimeMillis() - ((Packet)this.dataPackets.get(0)).creationTimeMillis >= (long)this.field_74468_e) { - var2 = this.func_74460_a(false); -- if(var2 != null) { -- Packet.writePacket(var2, this.m); -- if(var2 instanceof Packet252SharedKey && !this.isOutputEncrypted) { -- if(!this.theNetHandler.isServerHandler()) { -- this.A = ((Packet252SharedKey)var2).getSharedKey(); -+ -+ if (var2 != null) { -+ Packet.writePacket(var2, this.socketOutputStream); -+ -+ if (var2 instanceof Packet252SharedKey && !this.isOutputEncrypted) { -+ if (!this.theNetHandler.isServerHandler()) { -+ this.sharedKeyForEncryption = ((Packet252SharedKey)var2).getSharedKey(); - } - - this.encryptOuputStream(); -@@ -129,10 +197,11 @@ - } - } - -- if(this.chunkDataPacketsDelay-- <= 0 && (this.field_74468_e == 0 || !this.r.isEmpty() && MinecraftServer.getCurrentTimeMillis() - ((Packet)this.r.get(0)).creationTimeMillis >= (long)this.field_74468_e)) { -+ if (this.chunkDataPacketsDelay-- <= 0 && (this.field_74468_e == 0 || !this.chunkDataPackets.isEmpty() && MinecraftServer.getSystemTimeMillis() - ((Packet)this.chunkDataPackets.get(0)).creationTimeMillis >= (long)this.field_74468_e)) { - var2 = this.func_74460_a(true); -- if(var2 != null) { -- Packet.writePacket(var2, this.m); -+ -+ if (var2 != null) { -+ Packet.writePacket(var2, this.socketOutputStream); - var10000 = field_74467_d; - var10001 = var2.getPacketId(); - var10000[var10001] += var2.getPacketSize() + 1; -@@ -143,7 +212,7 @@ - - return var1; - } catch (Exception var3) { -- if(!this.isTerminating) { -+ if (!this.isTerminating) { - this.onNetworkError(var3); - } - -@@ -151,15 +220,17 @@ - } - } - -- private Packet func_74460_a(boolean var1) { -+ private Packet func_74460_a(boolean par1) { - Packet var2 = null; -- List var3 = var1 ? this.r : this.q; -- Object var4 = this.h; -- synchronized(var4) { -- while(!var3.isEmpty() && var2 == null) { -+ List var3 = par1 ? this.chunkDataPackets : this.dataPackets; -+ Object var4 = this.sendQueueLock; -+ -+ synchronized (this.sendQueueLock) { -+ while (!var3.isEmpty() && var2 == null) { - var2 = (Packet)var3.remove(0); - this.sendQueueByteLength -= var2.getPacketSize() + 1; -- if(this.func_74454_a(var2, var1)) { -+ -+ if (this.func_74454_a(var2, par1)) { - var2 = null; - } - } -@@ -168,46 +239,58 @@ - } - } - -- private boolean func_74454_a(Packet var1, boolean var2) { -- if(!var1.isRealPacket()) { -+ private boolean func_74454_a(Packet par1Packet, boolean par2) { -+ if (!par1Packet.isRealPacket()) { - return false; - } else { -- List var3 = var2 ? this.r : this.q; -+ List var3 = par2 ? this.chunkDataPackets : this.dataPackets; - Iterator var4 = var3.iterator(); -- - Packet var5; -+ - do { -- if(!var4.hasNext()) { -+ if (!var4.hasNext()) { - return false; - } - - var5 = (Packet)var4.next(); -- } while(var5.getPacketId() != var1.getPacketId()); -+ } while (var5.getPacketId() != par1Packet.getPacketId()); - -- return var1.containsSameEntityIDAs(var5); -+ return par1Packet.containsSameEntityIDAs(var5); - } - } - -+ /** -+ * Wakes reader and writer threads -+ */ - public void wakeThreads() { -- if(this.v != null) { -- this.v.interrupt(); -- } -- -- if(this.u != null) { -- this.u.interrupt(); -- } -- -+ if (this.readThread != null) { -+ this.readThread.interrupt(); -+ } -+ -+ if (this.writeThread != null) { -+ this.writeThread.interrupt(); -+ } - } - -+ /** -+ * Reads a single packet from the input stream and adds it to the read queue. If no packet is read, it shuts down the -+ * network. -+ */ - private boolean readPacket() { - boolean var1 = false; - - try { -- Packet var2 = Packet.readPacket(this.tcpConLogAgent, this.l, this.theNetHandler.isServerHandler(), this.j); -- if(var2 != null) { -- if(var2 instanceof Packet252SharedKey && !this.isInputBeingDecrypted) { -- if(this.theNetHandler.isServerHandler()) { -- this.A = ((Packet252SharedKey)var2).getSharedKey(this.B); -+ // Spout Start -+ if (this.isTerminating) { -+ return false; -+ } -+ // Spout End -+ Packet var2 = Packet.readPacket(this.tcpConLogAgent, this.socketInputStream, this.theNetHandler.isServerHandler(), this.networkSocket); -+ -+ if (var2 != null) { -+ if (var2 instanceof Packet252SharedKey && !this.isInputBeingDecrypted) { -+ if (this.theNetHandler.isServerHandler()) { -+ this.sharedKeyForEncryption = ((Packet252SharedKey)var2).getSharedKey(this.field_74463_A); - } - - this.decryptInputStream(); -@@ -216,12 +299,13 @@ - int[] var10000 = field_74470_c; - int var10001 = var2.getPacketId(); - var10000[var10001] += var2.getPacketSize() + 1; -- if(!this.isServerTerminating) { -- if(var2.canProcessAsync() && this.theNetHandler.canProcessPacketsAsync()) { -+ -+ if (!this.isServerTerminating) { -+ if (var2.canProcessAsync() && this.theNetHandler.canProcessPacketsAsync()) { - this.field_74490_x = 0; - var2.processPacket(this.theNetHandler); - } else { -- this.p.add(var2); -+ this.readPackets.add(var2); - } - } - -@@ -232,7 +316,7 @@ - - return var1; - } catch (Exception var3) { -- if(!this.isTerminating) { -+ if (!this.isTerminating) { - this.onNetworkError(var3); - } - -@@ -240,48 +324,64 @@ - } - } - -- private void onNetworkError(Exception var1) { -- var1.printStackTrace(); -- this.networkShutdown("disconnect.genericReason", new Object[]{"Internal exception: " + var1.toString()}); -+ /** -+ * Used to report network errors and causes a network shutdown. -+ */ -+ private void onNetworkError(Exception par1Exception) { -+ par1Exception.printStackTrace(); -+ this.networkShutdown("disconnect.genericReason", new Object[] {"Internal exception: " + par1Exception.toString()}); - } - -- public void networkShutdown(String var1, Object... var2) { -- if(this.isRunning) { -+ /** -+ * Shuts down the network with the specified reason. Closes all streams and sockets, spawns NetworkMasterThread to stop -+ * reading and writing threads. -+ */ -+ public void networkShutdown(String par1Str, Object ... par2ArrayOfObj) { -+ if (this.isRunning) { - this.isTerminating = true; -- this.w = var1; -- this.x = var2; -+ this.terminationReason = par1Str; -+ this.shutdownDescription = par2ArrayOfObj; - this.isRunning = false; - (new TcpMasterThread(this)).start(); - - try { -- this.l.close(); -+ this.socketInputStream.close(); - } catch (Throwable var6) { -+ ; - } - - try { -- this.m.close(); -+ this.socketOutputStream.close(); - } catch (Throwable var5) { -+ ; - } - - try { -- this.j.close(); -+ this.networkSocket.close(); - } catch (Throwable var4) { -+ ; - } - -- this.l = null; -- this.m = null; -- this.j = null; -+ this.socketInputStream = null; -+ this.socketOutputStream = null; -+ this.networkSocket = null; - } - } - -+ /** -+ * Checks timeouts and processes all pending read packets. -+ */ - public void processReadPackets() { -- if(this.sendQueueByteLength > 2097152) { -+ if (this.sendQueueByteLength > 2097152) { - this.networkShutdown("disconnect.overflow", new Object[0]); - } - -- if(this.p.isEmpty()) { -- if(this.field_74490_x++ == 1200) { -- this.networkShutdown("disconnect.timeout", new Object[0]); -+ if (this.readPackets.isEmpty()) { -+ // Spout (added if check for GuiPrecache so empty KeepAlive packets from server don't cause disconnect) -+ if (!(SpoutClient.getHandle().currentScreen instanceof GuiPrecache)) { -+ if (this.field_74490_x++ == 1200) { -+ this.networkShutdown("disconnect.timeout", new Object[0]); -+ } - } - } else { - this.field_74490_x = 0; -@@ -289,87 +389,124 @@ - - int var1 = 1000; - -- while(var1-- >= 0) { -- Packet var2 = (Packet)this.p.poll(); -- if(var2 != null && !this.theNetHandler.isConnectionClosed()) { -+ while (var1-- >= 0) { -+ Packet var2 = (Packet)this.readPackets.poll(); -+ -+ if (var2 != null && !this.theNetHandler.isConnectionClosed()) { - var2.processPacket(this.theNetHandler); - } - } - - this.wakeThreads(); -- if(this.isTerminating && this.p.isEmpty()) { -- this.theNetHandler.handleErrorMessage(this.w, this.x); -+ -+ if (this.isTerminating && this.readPackets.isEmpty()) { -+ this.theNetHandler.handleErrorMessage(this.terminationReason, this.shutdownDescription); - } -- -- } -- -- public SocketAddress getRemoteAddress() { -- return this.k; -- } -- -+ } -+ -+ /** -+ * Return the InetSocketAddress of the remote endpoint -+ */ -+ public SocketAddress getSocketAddress() { -+ return this.remoteSocketAddress; -+ } -+ -+ /** -+ * Shuts down the server. (Only actually used on the server) -+ */ - public void serverShutdown() { -- if(!this.isServerTerminating) { -+ if (!this.isServerTerminating) { - this.wakeThreads(); - this.isServerTerminating = true; -- this.v.interrupt(); -+ this.readThread.interrupt(); - (new TcpMonitorThread(this)).start(); - } - } - - private void decryptInputStream() throws IOException { - this.isInputBeingDecrypted = true; -- InputStream var1 = this.j.getInputStream(); -- this.l = new DataInputStream(CryptManager.decryptInputStream(this.A, var1)); -+ InputStream var1 = this.networkSocket.getInputStream(); -+ this.socketInputStream = new DataInputStream(CryptManager.decryptInputStream(this.sharedKeyForEncryption, var1)); - } - -+ /** -+ * flushes the stream and replaces it with an encryptedOutputStream -+ */ - private void encryptOuputStream() throws IOException { -- this.m.flush(); -+ this.socketOutputStream.flush(); - this.isOutputEncrypted = true; -- BufferedOutputStream var1 = new BufferedOutputStream(CryptManager.encryptOuputStream(this.A, this.j.getOutputStream()), 5120); -- this.m = new DataOutputStream(var1); -+ BufferedOutputStream var1 = new BufferedOutputStream(CryptManager.encryptOuputStream(this.sharedKeyForEncryption, this.networkSocket.getOutputStream()), 5120); -+ this.socketOutputStream = new DataOutputStream(var1); - } - -- public int getNumChunkDataPackets() { -- return this.r.size(); -+ /** -+ * returns 0 for memoryConnections -+ */ -+ public int packetSize() { -+ return this.chunkDataPackets.size(); - } - - public Socket getSocket() { -- return this.j; -- } -- -- static boolean isRunning(TcpConnection var0) { -- return var0.isRunning; -- } -- -- static boolean isServerTerminating(TcpConnection var0) { -- return var0.isServerTerminating; -- } -- -- static boolean readNetworkPacket(TcpConnection var0) { -- return var0.readPacket(); -- } -- -- static boolean sendNetworkPacket(TcpConnection var0) { -- return var0.sendPacket(); -- } -- -- static DataOutputStream getOutputStream(TcpConnection var0) { -- return var0.m; -- } -- -- static boolean isTerminating(TcpConnection var0) { -- return var0.isTerminating; -- } -- -- static void sendError(TcpConnection var0, Exception var1) { -- var0.onNetworkError(var1); -- } -- -- static Thread getReadThread(TcpConnection var0) { -- return var0.v; -- } -- -- static Thread getWriteThread(TcpConnection var0) { -- return var0.u; -+ return this.networkSocket; -+ } -+ -+ /** -+ * Whether the network is operational. -+ */ -+ static boolean isRunning(TcpConnection par0TcpConnection) { -+ return par0TcpConnection.isRunning; -+ } -+ -+ /** -+ * Is the server terminating? Client side aways returns false. -+ */ -+ static boolean isServerTerminating(TcpConnection par0TcpConnection) { -+ return par0TcpConnection.isServerTerminating; -+ } -+ -+ /** -+ * Static accessor to readPacket. -+ */ -+ static boolean readNetworkPacket(TcpConnection par0TcpConnection) { -+ return par0TcpConnection.readPacket(); -+ } -+ -+ /** -+ * Static accessor to sendPacket. -+ */ -+ static boolean sendNetworkPacket(TcpConnection par0TcpConnection) { -+ return par0TcpConnection.sendPacket(); -+ } -+ -+ static DataOutputStream getOutputStream(TcpConnection par0TcpConnection) { -+ return par0TcpConnection.socketOutputStream; -+ } -+ -+ /** -+ * Gets whether the Network manager is terminating. -+ */ -+ static boolean isTerminating(TcpConnection par0TcpConnection) { -+ return par0TcpConnection.isTerminating; -+ } -+ -+ /** -+ * Sends the network manager an error -+ */ -+ static void sendError(TcpConnection par0TcpConnection, Exception par1Exception) { -+ par0TcpConnection.onNetworkError(par1Exception); -+ } -+ -+ /** -+ * Returns the read thread. -+ */ -+ static Thread getReadThread(TcpConnection par0TcpConnection) { -+ return par0TcpConnection.readThread; -+ } -+ -+ /** -+ * Returns the write thread. -+ */ -+ static Thread getWriteThread(TcpConnection par0TcpConnection) { -+ return par0TcpConnection.writeThread; - } - } ---- net/minecraft/src/ThreadOnlineScreen.java -+++ net/minecraft/src/ThreadOnlineScreen.java -@@ -3,14 +3,15 @@ - class ThreadOnlineScreen extends Thread { - final GuiScreenOnlineServers field_98173_a; - -- ThreadOnlineScreen(GuiScreenOnlineServers var1) { -- this.field_98173_a = var1; -+ ThreadOnlineScreen(GuiScreenOnlineServers par1GuiScreenOnlineServers) { -+ this.field_98173_a = par1GuiScreenOnlineServers; - } - - public void run() { - try { - McoServer var1 = GuiScreenOnlineServers.func_140011_a(this.field_98173_a, GuiScreenOnlineServers.func_140041_a(this.field_98173_a)); -- if(var1 != null) { -+ -+ if (var1 != null) { - McoClient var2 = new McoClient(GuiScreenOnlineServers.func_98075_b(this.field_98173_a).getSession()); - GuiScreenOnlineServers.func_140040_h().func_140058_a(var1); - GuiScreenOnlineServers.func_140013_c(this.field_98173_a).remove(var1); -@@ -22,6 +23,5 @@ - } catch (ExceptionMcoService var3) { - GuiScreenOnlineServers.func_98076_f(this.field_98173_a).getLogAgent().logSevere(var3.toString()); - } -- - } - } ---- net/minecraft/src/CallableLvl1.java -+++ net/minecraft/src/CallableLvl1.java -@@ -4,16 +4,18 @@ - - class CallableLvl1 implements Callable { - final int field_85179_a; -+ -+ /** Reference to the World object. */ - final World theWorld; - -- CallableLvl1(World var1, int var2) { -- this.theWorld = var1; -- this.field_85179_a = var2; -+ CallableLvl1(World par1World, int par2) { -+ this.theWorld = par1World; -+ this.field_85179_a = par2; - } - - public String getWorldEntitiesAsString() { - try { -- return String.format("ID #%d (%s // %s)", new Object[]{Integer.valueOf(this.field_85179_a), Block.blocksList[this.field_85179_a].getUnlocalizedName(), Block.blocksList[this.field_85179_a].getClass().getCanonicalName()}); -+ return String.format("ID #%d (%s // %s)", new Object[] {Integer.valueOf(this.field_85179_a), Block.blocksList[this.field_85179_a].getUnlocalizedName(), Block.blocksList[this.field_85179_a].getClass().getCanonicalName()}); - } catch (Throwable var2) { - return "ID #" + this.field_85179_a; - } ---- net/minecraft/src/ItemPickaxe.java -+++ net/minecraft/src/ItemPickaxe.java -@@ -1,17 +1,26 @@ - package net.minecraft.src; - - public class ItemPickaxe extends ItemTool { -- private static Block[] blocksEffectiveAgainst = new Block[]{Block.cobblestone, Block.stoneDoubleSlab, Block.stoneSingleSlab, Block.stone, Block.sandStone, Block.cobblestoneMossy, Block.oreIron, Block.blockIron, Block.oreCoal, Block.blockGold, Block.oreGold, Block.oreDiamond, Block.blockDiamond, Block.ice, Block.netherrack, Block.oreLapis, Block.blockLapis, Block.oreRedstone, Block.oreRedstoneGlowing, Block.rail, Block.railDetector, Block.railPowered, Block.railActivator}; -- -- protected ItemPickaxe(int var1, EnumToolMaterial var2) { -- super(var1, 2.0F, var2, blocksEffectiveAgainst); -- } -- -- public boolean canHarvestBlock(Block var1) { -- return var1 == Block.obsidian ? this.toolMaterial.getHarvestLevel() == 3 : (var1 != Block.blockDiamond && var1 != Block.oreDiamond ? (var1 != Block.oreEmerald && var1 != Block.blockEmerald ? (var1 != Block.blockGold && var1 != Block.oreGold ? (var1 != Block.blockIron && var1 != Block.oreIron ? (var1 != Block.blockLapis && var1 != Block.oreLapis ? (var1 != Block.oreRedstone && var1 != Block.oreRedstoneGlowing ? (var1.blockMaterial == Material.rock ? true : (var1.blockMaterial == Material.iron ? true : var1.blockMaterial == Material.anvil)) : this.toolMaterial.getHarvestLevel() >= 2) : this.toolMaterial.getHarvestLevel() >= 1) : this.toolMaterial.getHarvestLevel() >= 1) : this.toolMaterial.getHarvestLevel() >= 2) : this.toolMaterial.getHarvestLevel() >= 2) : this.toolMaterial.getHarvestLevel() >= 2); -- } -- -- public float getStrVsBlock(ItemStack var1, Block var2) { -- return var2 == null || var2.blockMaterial != Material.iron && var2.blockMaterial != Material.anvil && var2.blockMaterial != Material.rock ? super.getStrVsBlock(var1, var2) : this.efficiencyOnProperMaterial; -+ -+ /** an array of the blocks this pickaxe is effective against */ -+ private static Block[] blocksEffectiveAgainst = new Block[] {Block.cobblestone, Block.stoneDoubleSlab, Block.stoneSingleSlab, Block.stone, Block.sandStone, Block.cobblestoneMossy, Block.oreIron, Block.blockIron, Block.oreCoal, Block.blockGold, Block.oreGold, Block.oreDiamond, Block.blockDiamond, Block.ice, Block.netherrack, Block.oreLapis, Block.blockLapis, Block.oreRedstone, Block.oreRedstoneGlowing, Block.rail, Block.railDetector, Block.railPowered, Block.railActivator}; -+ -+ protected ItemPickaxe(int par1, EnumToolMaterial par2EnumToolMaterial) { -+ super(par1, 2.0F, par2EnumToolMaterial, blocksEffectiveAgainst); -+ } -+ -+ /** -+ * Returns if the item (tool) can harvest results from the block type. -+ */ -+ public boolean canHarvestBlock(Block par1Block) { -+ return par1Block == Block.obsidian ? this.toolMaterial.getHarvestLevel() == 3 : (par1Block != Block.blockDiamond && par1Block != Block.oreDiamond ? (par1Block != Block.oreEmerald && par1Block != Block.blockEmerald ? (par1Block != Block.blockGold && par1Block != Block.oreGold ? (par1Block != Block.blockIron && par1Block != Block.oreIron ? (par1Block != Block.blockLapis && par1Block != Block.oreLapis ? (par1Block != Block.oreRedstone && par1Block != Block.oreRedstoneGlowing ? (par1Block.blockMaterial == Material.rock ? true : (par1Block.blockMaterial == Material.iron ? true : par1Block.blockMaterial == Material.anvil)) : this.toolMaterial.getHarvestLevel() >= 2) : this.toolMaterial.getHarvestLevel() >= 1) : this.toolMaterial.getHarvestLevel() >= 1) : this.toolMaterial.getHarvestLevel() >= 2) : this.toolMaterial.getHarvestLevel() >= 2) : this.toolMaterial.getHarvestLevel() >= 2); -+ } -+ -+ /** -+ * Returns the strength of the stack against a given block. 1.0F base, (Quality+1)*2 if correct blocktype, 1.5F if -+ * sword -+ */ -+ public float getStrVsBlock(ItemStack par1ItemStack, Block par2Block) { -+ return par2Block != null && (par2Block.blockMaterial == Material.iron || par2Block.blockMaterial == Material.anvil || par2Block.blockMaterial == Material.rock) ? this.efficiencyOnProperMaterial : super.getStrVsBlock(par1ItemStack, par2Block); - } - } ---- net/minecraft/src/RenderSheep.java -+++ net/minecraft/src/RenderSheep.java -@@ -2,36 +2,52 @@ - - import org.lwjgl.opengl.GL11; - -+import com.prupe.mcpatcher.mob.MobRandomizer; -+ -+import org.spoutcraft.client.config.Configuration; - public class RenderSheep extends RenderLiving { - private static final ResourceLocation sheepTextures = new ResourceLocation("textures/entity/sheep/sheep_fur.png"); - private static final ResourceLocation shearedSheepTextures = new ResourceLocation("textures/entity/sheep/sheep.png"); -- -- public RenderSheep(ModelBase var1, ModelBase var2, float var3) { -- super(var1, var3); -- this.setRenderPassModel(var2); -+ public RenderSheep(ModelBase par1ModelBase, ModelBase par2ModelBase, float par3) { -+ super(par1ModelBase, par3); -+ this.setRenderPassModel(par2ModelBase); - } - -- protected int setWoolColorAndRender(EntitySheep var1, int var2, float var3) { -- if(var2 == 0 && !var1.getSheared()) { -- this.bindTexture(sheepTextures); -+ protected int setWoolColorAndRender(EntitySheep par1EntitySheep, int par2, float par3) { -+ if (par2 == 0 && !par1EntitySheep.getSheared()) { -+ // Spout Start -+ if (Configuration.isRandomMobTextures()) { -+ this.bindTexture(MobRandomizer.randomTexture((EntityLivingBase)par1EntitySheep, sheepTextures)); -+ } else { -+ //ToDo: Spoutcraft API borked -+ //loadTexture(par1EntitySheep.getCustomTexture(org.spoutcraft.api.entity.EntitySkinType.SHEEP_FUR, "/mob/sheep_fur.png")); -+ } -+ // Spout End -+ - float var4 = 1.0F; -- int var5 = var1.getFleeceColor(); -+ int var5 = par1EntitySheep.getFleeceColor(); - GL11.glColor3f(var4 * EntitySheep.fleeceColorTable[var5][0], var4 * EntitySheep.fleeceColorTable[var5][1], var4 * EntitySheep.fleeceColorTable[var5][2]); - return 1; - } else { - return -1; - } - } -- -- protected ResourceLocation func_110883_a(EntitySheep var1) { -+ -+ protected ResourceLocation func_110883_a(EntitySheep par1EntitySheep) { - return shearedSheepTextures; - } - -- protected int shouldRenderPass(EntityLivingBase var1, int var2, float var3) { -- return this.setWoolColorAndRender((EntitySheep)var1, var2, var3); -+ /** -+ * Queries whether should render the specified pass or not. -+ */ -+ protected int shouldRenderPass(EntityLivingBase par1EntityLivingBase, int par2, float par3) { -+ return this.setWoolColorAndRender((EntitySheep)par1EntityLivingBase, par2, par3); - } - -- protected ResourceLocation getEntityTexture(Entity var1) { -- return this.func_110883_a((EntitySheep)var1); -+ /** -+ * Returns the location of an entity's texture. Doesn't seem to be called unless you call Render.bindEntityTexture. -+ */ -+ protected ResourceLocation getEntityTexture(Entity par1Entity) { -+ return this.func_110883_a((EntitySheep)par1Entity); - } - } ---- /dev/null -+++ org/spoutcraft/client/gui/minimap/ShowEntitiesCheckbox.java -@@ -1,0 +1,37 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.client.gui.minimap; -+ -+import org.spoutcraft.api.gui.CheckBox; -+import org.spoutcraft.api.gui.GenericCheckBox; -+ -+public class ShowEntitiesCheckbox extends GenericCheckBox { -+ public ShowEntitiesCheckbox() { -+ setText("Show Mobs"); -+ setChecked(MinimapConfig.getInstance().isShowingEntities()); -+ } -+ -+ @Override -+ public CheckBox setChecked(boolean checked) { -+ MinimapConfig.getInstance().setShowEntities(checked); -+ MinimapConfig.getInstance().save(); -+ return super.setChecked(checked); -+ } -+} ---- net/minecraft/src/ThreadLoginVerifier.java -+++ net/minecraft/src/ThreadLoginVerifier.java -@@ -7,10 +7,12 @@ - import java.net.URLEncoder; - - class ThreadLoginVerifier extends Thread { -+ -+ /** The login handler that spawned this thread. */ - final NetLoginHandler loginHandler; - -- ThreadLoginVerifier(NetLoginHandler var1) { -- this.loginHandler = var1; -+ ThreadLoginVerifier(NetLoginHandler par1NetLoginHandler) { -+ this.loginHandler = par1NetLoginHandler; - } - - public void run() { -@@ -20,16 +22,16 @@ - BufferedReader var3 = new BufferedReader(new InputStreamReader(var2.openConnection(NetLoginHandler.getLoginMinecraftServer(this.loginHandler).getServerProxy()).getInputStream())); - String var4 = var3.readLine(); - var3.close(); -- if(!"YES".equals(var4)) { -- this.loginHandler.kickUser("Failed to verify username!"); -+ -+ if (!"YES".equals(var4)) { -+ this.loginHandler.raiseErrorAndDisconnect("Failed to verify username!"); - return; - } - - NetLoginHandler.func_72531_a(this.loginHandler, true); - } catch (Exception var5) { -- this.loginHandler.kickUser("Failed to verify username! [internal error " + var5 + "]"); -+ this.loginHandler.raiseErrorAndDisconnect("Failed to verify username! [internal error " + var5 + "]"); - var5.printStackTrace(); - } -- - } - } ---- net/minecraft/src/ComponentStrongholdChestCorridor.java -+++ net/minecraft/src/ComponentStrongholdChestCorridor.java -@@ -4,63 +4,72 @@ - import java.util.Random; - - public class ComponentStrongholdChestCorridor extends ComponentStronghold { -- private static final WeightedRandomChestContent[] strongholdChestContents = new WeightedRandomChestContent[]{new WeightedRandomChestContent(Item.enderPearl.itemID, 0, 1, 1, 10), new WeightedRandomChestContent(Item.diamond.itemID, 0, 1, 3, 3), new WeightedRandomChestContent(Item.ingotIron.itemID, 0, 1, 5, 10), new WeightedRandomChestContent(Item.ingotGold.itemID, 0, 1, 3, 5), new WeightedRandomChestContent(Item.redstone.itemID, 0, 4, 9, 5), new WeightedRandomChestContent(Item.bread.itemID, 0, 1, 3, 15), new WeightedRandomChestContent(Item.appleRed.itemID, 0, 1, 3, 15), new WeightedRandomChestContent(Item.pickaxeIron.itemID, 0, 1, 1, 5), new WeightedRandomChestContent(Item.swordIron.itemID, 0, 1, 1, 5), new WeightedRandomChestContent(Item.plateIron.itemID, 0, 1, 1, 5), new WeightedRandomChestContent(Item.helmetIron.itemID, 0, 1, 1, 5), new WeightedRandomChestContent(Item.legsIron.itemID, 0, 1, 1, 5), new WeightedRandomChestContent(Item.bootsIron.itemID, 0, 1, 1, 5), new WeightedRandomChestContent(Item.appleGold.itemID, 0, 1, 1, 1), new WeightedRandomChestContent(Item.saddle.itemID, 0, 1, 1, 1), new WeightedRandomChestContent(Item.horseArmorIron.itemID, 0, 1, 1, 1), new WeightedRandomChestContent(Item.horseArmorGold.itemID, 0, 1, 1, 1), new WeightedRandomChestContent(Item.horseArmorDiamond.itemID, 0, 1, 1, 1)}; -+ -+ /** List of items that Stronghold chests can contain. */ -+ private static final WeightedRandomChestContent[] strongholdChestContents = new WeightedRandomChestContent[] {new WeightedRandomChestContent(Item.enderPearl.itemID, 0, 1, 1, 10), new WeightedRandomChestContent(Item.diamond.itemID, 0, 1, 3, 3), new WeightedRandomChestContent(Item.ingotIron.itemID, 0, 1, 5, 10), new WeightedRandomChestContent(Item.ingotGold.itemID, 0, 1, 3, 5), new WeightedRandomChestContent(Item.redstone.itemID, 0, 4, 9, 5), new WeightedRandomChestContent(Item.bread.itemID, 0, 1, 3, 15), new WeightedRandomChestContent(Item.appleRed.itemID, 0, 1, 3, 15), new WeightedRandomChestContent(Item.pickaxeIron.itemID, 0, 1, 1, 5), new WeightedRandomChestContent(Item.swordIron.itemID, 0, 1, 1, 5), new WeightedRandomChestContent(Item.plateIron.itemID, 0, 1, 1, 5), new WeightedRandomChestContent(Item.helmetIron.itemID, 0, 1, 1, 5), new WeightedRandomChestContent(Item.legsIron.itemID, 0, 1, 1, 5), new WeightedRandomChestContent(Item.bootsIron.itemID, 0, 1, 1, 5), new WeightedRandomChestContent(Item.appleGold.itemID, 0, 1, 1, 1), new WeightedRandomChestContent(Item.saddle.itemID, 0, 1, 1, 1), new WeightedRandomChestContent(Item.horseArmorIron.itemID, 0, 1, 1, 1), new WeightedRandomChestContent(Item.horseArmorGold.itemID, 0, 1, 1, 1), new WeightedRandomChestContent(Item.horseArmorDiamond.itemID, 0, 1, 1, 1)}; - private boolean hasMadeChest; - -- public ComponentStrongholdChestCorridor() { -- } -- -- public ComponentStrongholdChestCorridor(int var1, Random var2, StructureBoundingBox var3, int var4) { -- super(var1); -- this.coordBaseMode = var4; -- this.field_143013_d = this.getRandomDoor(var2); -- this.boundingBox = var3; -- } -- -- protected void func_143012_a(NBTTagCompound var1) { -- super.func_143012_a(var1); -- var1.setBoolean("Chest", this.hasMadeChest); -- } -- -- protected void func_143011_b(NBTTagCompound var1) { -- super.func_143011_b(var1); -- this.hasMadeChest = var1.getBoolean("Chest"); -- } -- -- public void buildComponent(StructureComponent var1, List var2, Random var3) { -- this.getNextComponentNormal((ComponentStrongholdStairs2)var1, var2, var3, 1, 1); -- } -- -- public static ComponentStrongholdChestCorridor findValidPlacement(List var0, Random var1, int var2, int var3, int var4, int var5, int var6) { -- StructureBoundingBox var7 = StructureBoundingBox.getComponentToAddBoundingBox(var2, var3, var4, -1, -1, 0, 5, 5, 7, var5); -- return canStrongholdGoDeeper(var7) && StructureComponent.findIntersecting(var0, var7) == null ? new ComponentStrongholdChestCorridor(var6, var1, var7, var5) : null; -- } -- -- public boolean addComponentParts(World var1, Random var2, StructureBoundingBox var3) { -- if(this.isLiquidInStructureBoundingBox(var1, var3)) { -+ public ComponentStrongholdChestCorridor() {} -+ -+ public ComponentStrongholdChestCorridor(int par1, Random par2Random, StructureBoundingBox par3StructureBoundingBox, int par4) { -+ super(par1); -+ this.coordBaseMode = par4; -+ this.field_143013_d = this.getRandomDoor(par2Random); -+ this.boundingBox = par3StructureBoundingBox; -+ } -+ -+ protected void func_143012_a(NBTTagCompound par1NBTTagCompound) { -+ super.func_143012_a(par1NBTTagCompound); -+ par1NBTTagCompound.setBoolean("Chest", this.hasMadeChest); -+ } -+ -+ protected void func_143011_b(NBTTagCompound par1NBTTagCompound) { -+ super.func_143011_b(par1NBTTagCompound); -+ this.hasMadeChest = par1NBTTagCompound.getBoolean("Chest"); -+ } -+ -+ /** -+ * Initiates construction of the Structure Component picked, at the current Location of StructGen -+ */ -+ public void buildComponent(StructureComponent par1StructureComponent, List par2List, Random par3Random) { -+ this.getNextComponentNormal((ComponentStrongholdStairs2)par1StructureComponent, par2List, par3Random, 1, 1); -+ } -+ -+ public static ComponentStrongholdChestCorridor findValidPlacement(List par0List, Random par1Random, int par2, int par3, int par4, int par5, int par6) { -+ StructureBoundingBox var7 = StructureBoundingBox.getComponentToAddBoundingBox(par2, par3, par4, -1, -1, 0, 5, 5, 7, par5); -+ return canStrongholdGoDeeper(var7) && StructureComponent.findIntersecting(par0List, var7) == null ? new ComponentStrongholdChestCorridor(par6, par1Random, var7, par5) : null; -+ } -+ -+ /** -+ * second Part of Structure generating, this for example places Spiderwebs, Mob Spawners, it closes Mineshafts at the -+ * end, it adds Fences... -+ */ -+ public boolean addComponentParts(World par1World, Random par2Random, StructureBoundingBox par3StructureBoundingBox) { -+ if (this.isLiquidInStructureBoundingBox(par1World, par3StructureBoundingBox)) { - return false; - } else { -- this.fillWithRandomizedBlocks(var1, var3, 0, 0, 0, 4, 4, 6, true, var2, StructureStrongholdPieces.getStrongholdStones()); -- this.placeDoor(var1, var2, var3, this.field_143013_d, 1, 1, 0); -- this.placeDoor(var1, var2, var3, EnumDoor.OPENING, 1, 1, 6); -- this.fillWithBlocks(var1, var3, 3, 1, 2, 3, 1, 4, Block.stoneBrick.blockID, Block.stoneBrick.blockID, false); -- this.placeBlockAtCurrentPosition(var1, Block.stoneSingleSlab.blockID, 5, 3, 1, 1, var3); -- this.placeBlockAtCurrentPosition(var1, Block.stoneSingleSlab.blockID, 5, 3, 1, 5, var3); -- this.placeBlockAtCurrentPosition(var1, Block.stoneSingleSlab.blockID, 5, 3, 2, 2, var3); -- this.placeBlockAtCurrentPosition(var1, Block.stoneSingleSlab.blockID, 5, 3, 2, 4, var3); -- -+ this.fillWithRandomizedBlocks(par1World, par3StructureBoundingBox, 0, 0, 0, 4, 4, 6, true, par2Random, StructureStrongholdPieces.getStrongholdStones()); -+ this.placeDoor(par1World, par2Random, par3StructureBoundingBox, this.field_143013_d, 1, 1, 0); -+ this.placeDoor(par1World, par2Random, par3StructureBoundingBox, EnumDoor.OPENING, 1, 1, 6); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 3, 1, 2, 3, 1, 4, Block.stoneBrick.blockID, Block.stoneBrick.blockID, false); -+ this.placeBlockAtCurrentPosition(par1World, Block.stoneSingleSlab.blockID, 5, 3, 1, 1, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.stoneSingleSlab.blockID, 5, 3, 1, 5, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.stoneSingleSlab.blockID, 5, 3, 2, 2, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.stoneSingleSlab.blockID, 5, 3, 2, 4, par3StructureBoundingBox); - int var4; -- for(var4 = 2; var4 <= 4; ++var4) { -- this.placeBlockAtCurrentPosition(var1, Block.stoneSingleSlab.blockID, 5, 2, 1, var4, var3); -+ -+ for (var4 = 2; var4 <= 4; ++var4) { -+ this.placeBlockAtCurrentPosition(par1World, Block.stoneSingleSlab.blockID, 5, 2, 1, var4, par3StructureBoundingBox); - } - -- if(!this.hasMadeChest) { -+ if (!this.hasMadeChest) { - var4 = this.getYWithOffset(2); - int var5 = this.getXWithOffset(3, 3); - int var6 = this.getZWithOffset(3, 3); -- if(var3.isVecInside(var5, var4, var6)) { -+ -+ if (par3StructureBoundingBox.isVecInside(var5, var4, var6)) { - this.hasMadeChest = true; -- this.generateStructureChestContents(var1, var3, var2, 3, 2, 3, WeightedRandomChestContent.func_92080_a(strongholdChestContents, new WeightedRandomChestContent[]{Item.enchantedBook.func_92114_b(var2)}), 2 + var2.nextInt(2)); -+ this.generateStructureChestContents(par1World, par3StructureBoundingBox, par2Random, 3, 2, 3, WeightedRandomChestContent.func_92080_a(strongholdChestContents, new WeightedRandomChestContent[] {Item.enchantedBook.func_92114_b(par2Random)}), 2 + par2Random.nextInt(2)); - } - } - ---- /dev/null -+++ org/spoutcraft/client/controls/Shortcut.java -@@ -1,0 +1,112 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.client.controls; -+ -+import java.io.Serializable; -+import java.util.ArrayList; -+import java.util.List; -+ -+import net.minecraft.src.EntityClientPlayerMP; -+import net.minecraft.src.Packet3Chat; -+ -+import org.spoutcraft.api.keyboard.AbstractBinding; -+import org.spoutcraft.client.SpoutClient; -+ -+public class Shortcut extends AbstractBinding implements Serializable { -+ private static final long serialVersionUID = 4365592803468257957L; -+ -+ private String title = ""; -+ private ArrayList commands = new ArrayList(); -+ private int delay = 0; -+ -+ public Shortcut() { -+ } -+ -+ public void addCommand(String cmd) { -+ commands.add(cmd); -+ } -+ -+ public List getCommands() { -+ return commands; -+ } -+ -+ public void clear() { -+ commands.clear(); -+ } -+ -+ public void removeCommand(int i) { -+ commands.remove(i); -+ } -+ -+ public void setTitle(String title) { -+ this.title = title; -+ } -+ -+ public String getTitle() { -+ return title; -+ } -+ -+ public void setCommands(ArrayList commands) { -+ this.commands = commands; -+ } -+ -+ public void setDelay(int delay) { -+ this.delay = delay; -+ } -+ -+ public int getDelay() { -+ return delay; -+ } -+ -+ @Override -+ public boolean equals(Object obj) { -+ if (this == obj) { -+ return true; -+ } -+ if (obj == null) { -+ return false; -+ } -+ if (getClass() != obj.getClass()) { -+ return false; -+ } -+ return false; -+ } -+ -+ @Override -+ public void summon(int key, final boolean keyReleased, final int screen) { -+ new Thread() { -+ public void run() { -+ if (keyReleased && screen == 0) { -+ for (String cmd:getCommands()) { -+ if (SpoutClient.getHandle().isMultiplayerWorld()) { -+ EntityClientPlayerMP player = (EntityClientPlayerMP)SpoutClient.getHandle().thePlayer; -+ player.sendQueue.addToSendQueue(new Packet3Chat(cmd)); -+ } -+ if (delay > 0) { -+ try { -+ sleep(delay); -+ } catch (InterruptedException e) {} -+ } -+ } -+ } -+ }; -+ }.start(); -+ } -+} ---- net/minecraft/src/StructureScatteredFeatureStart.java -+++ net/minecraft/src/StructureScatteredFeatureStart.java -@@ -3,23 +3,23 @@ - import java.util.Random; - - public class StructureScatteredFeatureStart extends StructureStart { -- public StructureScatteredFeatureStart() { -- } -- -- public StructureScatteredFeatureStart(World var1, Random var2, int var3, int var4) { -- super(var3, var4); -- BiomeGenBase var5 = var1.getBiomeGenForCoords(var3 * 16 + 8, var4 * 16 + 8); -- if(var5 != BiomeGenBase.jungle && var5 != BiomeGenBase.jungleHills) { -- if(var5 == BiomeGenBase.swampland) { -- ComponentScatteredFeatureSwampHut var7 = new ComponentScatteredFeatureSwampHut(var2, var3 * 16, var4 * 16); -- this.a.add(var7); -+ public StructureScatteredFeatureStart() {} -+ -+ public StructureScatteredFeatureStart(World par1World, Random par2Random, int par3, int par4) { -+ super(par3, par4); -+ BiomeGenBase var5 = par1World.getBiomeGenForCoords(par3 * 16 + 8, par4 * 16 + 8); -+ -+ if (var5 != BiomeGenBase.jungle && var5 != BiomeGenBase.jungleHills) { -+ if (var5 == BiomeGenBase.swampland) { -+ ComponentScatteredFeatureSwampHut var7 = new ComponentScatteredFeatureSwampHut(par2Random, par3 * 16, par4 * 16); -+ this.components.add(var7); - } else { -- ComponentScatteredFeatureDesertPyramid var8 = new ComponentScatteredFeatureDesertPyramid(var2, var3 * 16, var4 * 16); -- this.a.add(var8); -+ ComponentScatteredFeatureDesertPyramid var8 = new ComponentScatteredFeatureDesertPyramid(par2Random, par3 * 16, par4 * 16); -+ this.components.add(var8); - } - } else { -- ComponentScatteredFeatureJunglePyramid var6 = new ComponentScatteredFeatureJunglePyramid(var2, var3 * 16, var4 * 16); -- this.a.add(var6); -+ ComponentScatteredFeatureJunglePyramid var6 = new ComponentScatteredFeatureJunglePyramid(par2Random, par3 * 16, par4 * 16); -+ this.components.add(var6); - } - - this.updateBoundingBox(); ---- /dev/null -+++ org/spoutcraft/client/gui/server/ServerListModel.java -@@ -1,0 +1,155 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.client.gui.server; -+ -+import java.io.BufferedReader; -+import java.io.IOException; -+import java.io.InputStreamReader; -+import java.io.UnsupportedEncodingException; -+import java.net.MalformedURLException; -+import java.net.URL; -+import java.net.URLDecoder; -+import java.util.ArrayList; -+import java.util.Collections; -+import java.util.HashMap; -+import java.util.LinkedList; -+import java.util.List; -+ -+import gnu.trove.map.hash.TIntObjectHashMap; -+import org.yaml.snakeyaml.Yaml; -+ -+import org.spoutcraft.api.gui.GenericListView; -+import org.spoutcraft.api.gui.ListWidgetItem; -+import org.spoutcraft.api.gui.Orientation; -+import org.spoutcraft.client.SpoutClient; -+import org.spoutcraft.client.gui.database.AbstractAPIModel; -+ -+public class ServerListModel extends AbstractAPIModel { -+ protected TIntObjectHashMap dbEntries = new TIntObjectHashMap(); -+ protected List countries = new LinkedList(); -+ -+ public ServerListModel() { -+ API = "http://servers.spout.org/api2.php"; -+ //refreshAPIData(API + "?random", 0, true); -+ //loadCountries(); -+ } -+ -+ public String getAPI() { -+ return API; -+ } -+ -+ private void loadCountries() { -+ new Thread() { -+ public void run() { -+ //long start = System.currentTimeMillis(); -+ URL url1; -+ try { -+ url1 = new URL(API + "?countries"); -+ } catch (MalformedURLException e) { -+ return; -+ } -+ //System.out.println("Loading " + url1.toString()); -+ BufferedReader reader; -+ try { -+ reader = new BufferedReader(new InputStreamReader(url1.openStream())); -+ } catch (IOException e1) { -+ System.out.println(e1.getClass().toString()); -+ return; -+ } -+ Yaml yaml = new Yaml(); -+ ArrayList yamlObj = (ArrayList) yaml.load(reader); -+ //System.out.println("Loaded in " + (System.currentTimeMillis() - start) + " ms"); -+ synchronized (countries) { -+ countries.clear(); -+ for (String c:yamlObj) { -+ if (!c.trim().isEmpty()) { -+ countries.add(c); -+ } -+ } -+ } -+ try { -+ reader.close(); -+ } catch (IOException e) { -+ return; -+ } -+ } -+ }.start(); -+ } -+ -+ public String getDefaultUrl() { -+ return API + "?featured"; -+ } -+ -+ /** -+ * Processes loaded API data. -+ * @param clear -+ */ -+ protected void refreshList(boolean clear) { -+ if (clear) { -+ lastPage = 0; -+ entries.clear(); -+ for (GenericListView view:getViews()) { -+ view.setScrollPosition(Orientation.VERTICAL, 0); -+ } -+ } -+ for (Object item:apiData) { -+ try { -+ HashMap hash = (HashMap) item; -+ String name = URLDecoder.decode((String) hash.get("name"), "UTF-8"); -+ name = name.replaceAll("\\&\\;", "&"); -+ int uid = Integer.valueOf((String)hash.get("uniqueid")); -+ int port = Integer.valueOf((String)hash.get("port")); -+ String adress = (String) hash.get("ip"); -+ byte accessType = Byte.valueOf((String) hash.get("whitelist")); -+ String country = (String) hash.get("country"); -+ String version = URLDecoder.decode((String) hash.get("mcversion"), "UTF-8"); -+ ServerItem server = new ServerItem(name, adress, port, uid, version); -+ server.setFavorite(false); -+ server.setCountry(country); -+ server.setAccessType(accessType); -+ entries.add(server); -+ } catch(UnsupportedEncodingException e) {} -+ catch(Exception e2) { continue; } -+ } -+ update(); -+ } -+ -+ public ServerDataBaseEntry getServerDBEntry(int uid) { -+ if (dbEntries.contains(uid)) { -+ return dbEntries.get(uid); -+ } else { -+ return null; -+ } -+ } -+ -+ public List getServers() { -+ ArrayList servers = new ArrayList(); -+ for (ListWidgetItem item:entries) { -+ if (item instanceof ServerItem) { -+ servers.add((ServerItem)item); -+ } -+ } -+ return servers; -+ } -+ -+ public List getCountries() { -+ return Collections.unmodifiableList(countries); -+ } -+} ---- net/minecraft/src/McoServer.java -+++ net/minecraft/src/McoServer.java -@@ -13,97 +13,100 @@ - - public class McoServer { - public long field_96408_a; -- public String b; -- public String c; -- public String d; -- public String e; -- public List f; -- public String g; -+ public String field_96406_b; -+ public String field_96407_c; -+ public String field_96404_d; -+ public String field_96405_e; -+ public List field_96402_f; -+ public String field_96403_g; - public boolean field_98166_h; - public int field_110729_i; - public int field_110728_j; - public int field_104063_i; - public int field_96415_h; -- public String m = ""; -+ public String field_96414_k = ""; - public boolean field_96411_l; - public boolean field_102022_m; - public long field_96412_m; -- private String q; -- private String r; -+ private String field_96409_n; -+ private String field_96410_o; - - public String func_96397_a() { -- if(this.q == null) { -+ if (this.field_96409_n == null) { - try { -- this.q = URLDecoder.decode(this.c, "UTF-8"); -+ this.field_96409_n = URLDecoder.decode(this.field_96407_c, "UTF-8"); - } catch (UnsupportedEncodingException var2) { -- this.q = this.c; -+ this.field_96409_n = this.field_96407_c; - } - } - -- return this.q; -+ return this.field_96409_n; - } - - public String func_96398_b() { -- if(this.r == null) { -+ if (this.field_96410_o == null) { - try { -- this.r = URLDecoder.decode(this.b, "UTF-8"); -+ this.field_96410_o = URLDecoder.decode(this.field_96406_b, "UTF-8"); - } catch (UnsupportedEncodingException var2) { -- this.r = this.b; -+ this.field_96410_o = this.field_96406_b; - } - } - -- return this.r; -- } -- -- public void func_96399_a(String var1) { -- this.b = var1; -- this.r = null; -- } -- -- public void func_96400_b(String var1) { -- this.c = var1; -- this.q = null; -- } -- -- public void func_96401_a(McoServer var1) { -- this.m = var1.m; -- this.field_96412_m = var1.field_96412_m; -- this.field_96411_l = var1.field_96411_l; -- this.field_96415_h = var1.field_96415_h; -+ return this.field_96410_o; -+ } -+ -+ public void func_96399_a(String par1Str) { -+ this.field_96406_b = par1Str; -+ this.field_96410_o = null; -+ } -+ -+ public void func_96400_b(String par1Str) { -+ this.field_96407_c = par1Str; -+ this.field_96409_n = null; -+ } -+ -+ public void func_96401_a(McoServer par1McoServer) { -+ this.field_96414_k = par1McoServer.field_96414_k; -+ this.field_96412_m = par1McoServer.field_96412_m; -+ this.field_96411_l = par1McoServer.field_96411_l; -+ this.field_96415_h = par1McoServer.field_96415_h; - this.field_102022_m = true; - } - -- public static McoServer func_98163_a(JsonNode var0) { -+ public static McoServer func_98163_a(JsonNode par0JsonNode) { - McoServer var1 = new McoServer(); - - try { -- var1.field_96408_a = Long.parseLong(var0.getNumberValue(new Object[]{"id"})); -- var1.b = var0.getStringValue(new Object[]{"name"}); -- var1.c = var0.getStringValue(new Object[]{"motd"}); -- var1.d = var0.getStringValue(new Object[]{"state"}); -- var1.e = var0.getStringValue(new Object[]{"owner"}); -- if(var0.isArrayNode(new Object[]{"invited"})) { -- var1.f = func_98164_a(var0.getArrayNode(new Object[]{"invited"})); -- } else { -- var1.f = new ArrayList(); -- } -- -- var1.field_104063_i = Integer.parseInt(var0.getNumberValue(new Object[]{"daysLeft"})); -- var1.g = var0.getStringValue(new Object[]{"ip"}); -- var1.field_98166_h = var0.getBooleanValue(new Object[]{"expired"}).booleanValue(); -- var1.field_110729_i = Integer.parseInt(var0.getNumberValue(new Object[]{"difficulty"})); -- var1.field_110728_j = Integer.parseInt(var0.getNumberValue(new Object[]{"gameMode"})); -+ var1.field_96408_a = Long.parseLong(par0JsonNode.getNumberValue(new Object[] {"id"})); -+ var1.field_96406_b = par0JsonNode.getStringValue(new Object[] {"name"}); -+ var1.field_96407_c = par0JsonNode.getStringValue(new Object[] {"motd"}); -+ var1.field_96404_d = par0JsonNode.getStringValue(new Object[] {"state"}); -+ var1.field_96405_e = par0JsonNode.getStringValue(new Object[] {"owner"}); -+ -+ if (par0JsonNode.isArrayNode(new Object[] {"invited"})) { -+ var1.field_96402_f = func_98164_a(par0JsonNode.getArrayNode(new Object[] {"invited"})); -+ } -+ else { -+ var1.field_96402_f = new ArrayList(); -+ } -+ -+ var1.field_104063_i = Integer.parseInt(par0JsonNode.getNumberValue(new Object[] {"daysLeft"})); -+ var1.field_96403_g = par0JsonNode.getStringValue(new Object[] {"ip"}); -+ var1.field_98166_h = par0JsonNode.getBooleanValue(new Object[] {"expired"}).booleanValue(); -+ var1.field_110729_i = Integer.parseInt(par0JsonNode.getNumberValue(new Object[] {"difficulty"})); -+ var1.field_110728_j = Integer.parseInt(par0JsonNode.getNumberValue(new Object[] {"gameMode"})); - } catch (IllegalArgumentException var3) { -+ ; - } - - return var1; - } - -- private static List func_98164_a(List var0) { -+ private static List func_98164_a(List par0List) { - ArrayList var1 = new ArrayList(); -- Iterator var2 = var0.iterator(); -+ Iterator var2 = par0List.iterator(); - -- while(var2.hasNext()) { -+ while (var2.hasNext()) { - JsonNode var3 = (JsonNode)var2.next(); - var1.add(var3.getStringValue(new Object[0])); - } -@@ -111,31 +114,32 @@ - return var1; - } - -- public static McoServer func_98165_c(String var0) { -+ public static McoServer func_98165_c(String par0Str) { - McoServer var1 = new McoServer(); - - try { -- var1 = func_98163_a((new JdomParser()).parse(var0)); -+ var1 = func_98163_a((new JdomParser()).parse(par0Str)); - } catch (InvalidSyntaxException var3) { -+ ; - } - - return var1; - } - - public int hashCode() { -- return (new HashCodeBuilder(17, 37)).append(this.field_96408_a).append((Object)this.b).append((Object)this.c).append((Object)this.d).append((Object)this.e).append(this.field_98166_h).toHashCode(); -+ return (new HashCodeBuilder(17, 37)).append(this.field_96408_a).append(this.field_96406_b).append(this.field_96407_c).append(this.field_96404_d).append(this.field_96405_e).append(this.field_98166_h).toHashCode(); - } - -- public boolean equals(Object var1) { -- if(var1 == null) { -+ public boolean equals(Object par1Obj) { -+ if (par1Obj == null) { - return false; -- } else if(var1 == this) { -+ } else if (par1Obj == this) { - return true; -- } else if(var1.getClass() != this.getClass()) { -+ } else if (par1Obj.getClass() != this.getClass()) { - return false; - } else { -- McoServer var2 = (McoServer)var1; -- return (new EqualsBuilder()).append(this.field_96408_a, var2.field_96408_a).append((Object)this.b, (Object)var2.b).append((Object)this.c, (Object)var2.c).append((Object)this.d, (Object)var2.d).append((Object)this.e, (Object)var2.e).append(this.field_98166_h, var2.field_98166_h).isEquals(); -+ McoServer var2 = (McoServer)par1Obj; -+ return (new EqualsBuilder()).append(this.field_96408_a, var2.field_96408_a).append(this.field_96406_b, var2.field_96406_b).append(this.field_96407_c, var2.field_96407_c).append(this.field_96404_d, var2.field_96404_d).append(this.field_96405_e, var2.field_96405_e).append(this.field_98166_h, var2.field_98166_h).isEquals(); - } - } - } ---- /dev/null -+++ org/spoutcraft/api/material/Plant.java -@@ -1,0 +1,28 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.api.material; -+ -+public interface Plant extends Block{ -+ public boolean isHasGrowthStages(); -+ -+ public int getNumGrowthStages(); -+ -+ public int getMinimumLightToGrow(); -+} ---- /dev/null -+++ org/spoutcraft/client/gui/controls/ControlsSearch.java -@@ -1,0 +1,38 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.client.gui.controls; -+ -+import org.bukkit.ChatColor; -+ -+import org.spoutcraft.api.gui.GenericTextField; -+ -+public class ControlsSearch extends GenericTextField { -+ private GuiControls gui; -+ -+ public ControlsSearch(GuiControls gui) { -+ this.gui = gui; -+ setPlaceholder(ChatColor.GRAY + "Search"); -+ } -+ -+ @Override -+ public void onTextFieldChange() { -+ gui.getModel().refresh(); -+ } -+} ---- net/minecraft/src/ItemEditableBook.java -+++ net/minecraft/src/ItemEditableBook.java -@@ -3,55 +3,65 @@ - import java.util.List; - - public class ItemEditableBook extends Item { -- public ItemEditableBook(int var1) { -- super(var1); -+ public ItemEditableBook(int par1) { -+ super(par1); - this.setMaxStackSize(1); - } - -- public static boolean validBookTagContents(NBTTagCompound var0) { -- if(!ItemWritableBook.validBookTagPages(var0)) { -+ public static boolean validBookTagContents(NBTTagCompound par0NBTTagCompound) { -+ if (!ItemWritableBook.validBookTagPages(par0NBTTagCompound)) { - return false; -- } else if(!var0.hasKey("title")) { -+ } else if (!par0NBTTagCompound.hasKey("title")) { - return false; - } else { -- String var1 = var0.getString("title"); -- return var1 != null && var1.length() <= 16 ? var0.hasKey("author") : false; -+ String var1 = par0NBTTagCompound.getString("title"); -+ return var1 != null && var1.length() <= 16 ? par0NBTTagCompound.hasKey("author") : false; - } - } - -- public String getItemDisplayName(ItemStack var1) { -- if(var1.hasTagCompound()) { -- NBTTagCompound var2 = var1.getTagCompound(); -+ public String getItemDisplayName(ItemStack par1ItemStack) { -+ if (par1ItemStack.hasTagCompound()) { -+ NBTTagCompound var2 = par1ItemStack.getTagCompound(); - NBTTagString var3 = (NBTTagString)var2.getTag("title"); -- if(var3 != null) { -+ -+ if (var3 != null) { - return var3.toString(); - } - } - -- return super.getItemDisplayName(var1); -+ return super.getItemDisplayName(par1ItemStack); - } - -- public void addInformation(ItemStack var1, EntityPlayer var2, List var3, boolean var4) { -- if(var1.hasTagCompound()) { -- NBTTagCompound var5 = var1.getTagCompound(); -+ /** -+ * allows items to add custom lines of information to the mouseover description -+ */ -+ public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4) { -+ if (par1ItemStack.hasTagCompound()) { -+ NBTTagCompound var5 = par1ItemStack.getTagCompound(); - NBTTagString var6 = (NBTTagString)var5.getTag("author"); -- if(var6 != null) { -- var3.add(EnumChatFormatting.GRAY + String.format(StatCollector.translateToLocalFormatted("book.byAuthor", new Object[]{var6.a}), new Object[0])); -+ -+ if (var6 != null) { -+ par3List.add(EnumChatFormatting.GRAY + String.format(StatCollector.translateToLocalFormatted("book.byAuthor", new Object[] {var6.data}), new Object[0])); - } - } -- -- } -- -- public ItemStack onItemRightClick(ItemStack var1, World var2, EntityPlayer var3) { -- var3.displayGUIBook(var1); -- return var1; -- } -- -+ } -+ -+ /** -+ * Called whenever this item is equipped and the right mouse button is pressed. Args: itemStack, world, entityPlayer -+ */ -+ public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) { -+ par3EntityPlayer.displayGUIBook(par1ItemStack); -+ return par1ItemStack; -+ } -+ -+ /** -+ * If this function returns true (or the item is damageable), the ItemStack's NBT tag will be sent to the client. -+ */ - public boolean getShareTag() { - return true; - } - -- public boolean hasEffect(ItemStack var1) { -+ public boolean hasEffect(ItemStack par1ItemStack) { - return true; - } - } ---- net/minecraft/src/BlockDaylightDetector.java -+++ net/minecraft/src/BlockDaylightDetector.java -@@ -5,78 +5,114 @@ - public class BlockDaylightDetector extends BlockContainer { - private Icon[] iconArray = new Icon[2]; - -- public BlockDaylightDetector(int var1) { -- super(var1, Material.wood); -- this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 6.0F / 16.0F, 1.0F); -+ public BlockDaylightDetector(int par1) { -+ super(par1, Material.wood); -+ this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.375F, 1.0F); - this.setCreativeTab(CreativeTabs.tabRedstone); - } - -- public void setBlockBoundsBasedOnState(IBlockAccess var1, int var2, int var3, int var4) { -- this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 6.0F / 16.0F, 1.0F); -- } -- -- public int isProvidingWeakPower(IBlockAccess var1, int var2, int var3, int var4, int var5) { -- return var1.getBlockMetadata(var2, var3, var4); -- } -- -- public void updateTick(World var1, int var2, int var3, int var4, Random var5) { -- } -- -- public void onNeighborBlockChange(World var1, int var2, int var3, int var4, int var5) { -- } -- -- public void onBlockAdded(World var1, int var2, int var3, int var4) { -- } -- -- public void updateLightLevel(World var1, int var2, int var3, int var4) { -- if(!var1.provider.hasNoSky) { -- int var5 = var1.getBlockMetadata(var2, var3, var4); -- int var6 = var1.getSavedLightValue(EnumSkyBlock.Sky, var2, var3, var4) - var1.skylightSubtracted; -- float var7 = var1.getCelestialAngleRadians(1.0F); -- if(var7 < (float)Math.PI) { -+ /** -+ * Updates the blocks bounds based on its current state. Args: world, x, y, z -+ */ -+ public void setBlockBoundsBasedOnState(IBlockAccess par1IBlockAccess, int par2, int par3, int par4) { -+ this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.375F, 1.0F); -+ } -+ -+ /** -+ * Returns true if the block is emitting indirect/weak redstone power on the specified side. If isBlockNormalCube -+ * returns true, standard redstone propagation rules will apply instead and this will not be called. Args: World, X, Y, -+ * Z, side. Note that the side is reversed - eg it is 1 (up) when checking the bottom of the block. -+ */ -+ public int isProvidingWeakPower(IBlockAccess par1IBlockAccess, int par2, int par3, int par4, int par5) { -+ return par1IBlockAccess.getBlockMetadata(par2, par3, par4); -+ } -+ -+ /** -+ * Ticks the block if it's been scheduled -+ */ -+ public void updateTick(World par1World, int par2, int par3, int par4, Random par5Random) {} -+ -+ /** -+ * Lets the block know when one of its neighbor changes. Doesn't know which neighbor changed (coordinates passed are -+ * their own) Args: x, y, z, neighbor blockID -+ */ -+ public void onNeighborBlockChange(World par1World, int par2, int par3, int par4, int par5) {} -+ -+ /** -+ * Called whenever the block is added into the world. Args: world, x, y, z -+ */ -+ public void onBlockAdded(World par1World, int par2, int par3, int par4) {} -+ -+ public void updateLightLevel(World par1World, int par2, int par3, int par4) { -+ if (!par1World.provider.hasNoSky) { -+ int var5 = par1World.getBlockMetadata(par2, par3, par4); -+ int var6 = par1World.getSavedLightValue(EnumSkyBlock.Sky, par2, par3, par4) - par1World.skylightSubtracted; -+ float var7 = par1World.getCelestialAngleRadians(1.0F); -+ -+ if (var7 < (float)Math.PI) { - var7 += (0.0F - var7) * 0.2F; - } else { -- var7 += ((float)Math.PI * 2.0F - var7) * 0.2F; -+ var7 += (((float)Math.PI * 2F) - var7) * 0.2F; - } - - var6 = Math.round((float)var6 * MathHelper.cos(var7)); -- if(var6 < 0) { -+ -+ if (var6 < 0) { - var6 = 0; - } - -- if(var6 > 15) { -+ if (var6 > 15) { - var6 = 15; - } - -- if(var5 != var6) { -- var1.setBlockMetadata(var2, var3, var4, var6, 3); -+ if (var5 != var6) { -+ par1World.setBlockMetadataWithNotify(par2, par3, par4, var6, 3); - } -- - } - } - -+ /** -+ * If this block doesn't render as an ordinary block it will return False (examples: signs, buttons, stairs, etc) -+ */ - public boolean renderAsNormalBlock() { - return false; - } - -+ /** -+ * Is this block (a) opaque and (b) a full 1m cube? This determines whether or not to render the shared face of two -+ * adjacent blocks and also whether the player can attach torches, redstone wire, etc to this block. -+ */ - public boolean isOpaqueCube() { - return false; - } - -+ /** -+ * Can this block provide power. Only wire currently seems to have this change based on its state. -+ */ - public boolean canProvidePower() { - return true; - } - -- public TileEntity createNewTileEntity(World var1) { -+ /** -+ * Returns a new instance of a block's tile entity class. Called on placing the block. -+ */ -+ public TileEntity createNewTileEntity(World par1World) { - return new TileEntityDaylightDetector(); - } - -- public Icon getIcon(int var1, int var2) { -- return var1 == 1 ? this.iconArray[0] : this.iconArray[1]; -+ /** -+ * From the specified side and block metadata retrieves the blocks texture. Args: side, metadata -+ */ -+ public Icon getIcon(int par1, int par2) { -+ return par1 == 1 ? this.iconArray[0] : this.iconArray[1]; - } - -- public void registerIcons(IconRegister var1) { -- this.iconArray[0] = var1.registerIcon(this.getTextureName() + "_top"); -- this.iconArray[1] = var1.registerIcon(this.getTextureName() + "_side"); -+ /** -+ * When this method is called, your block should register all the icons it needs with the given IconRegister. This is -+ * the only chance you get to register icons. -+ */ -+ public void registerIcons(IconRegister par1IconRegister) { -+ this.iconArray[0] = par1IconRegister.registerIcon(this.getTextureName() + "_top"); -+ this.iconArray[1] = par1IconRegister.registerIcon(this.getTextureName() + "_side"); - } - } ---- net/minecraft/src/GuiScreenDisconnectedOnline.java -+++ net/minecraft/src/GuiScreenDisconnectedOnline.java -@@ -4,51 +4,62 @@ - import java.util.List; - - public class GuiScreenDisconnectedOnline extends GuiScreen { -- private String a; -- private String b; -- private Object[] c; -- private List d; -+ private String field_98113_a; -+ private String field_98111_b; -+ private Object[] field_98112_c; -+ private List field_98110_d; - private final GuiScreen field_98114_n; - -- public GuiScreenDisconnectedOnline(GuiScreen var1, String var2, String var3, Object... var4) { -- this.field_98114_n = var1; -- this.a = I18n.getString(var2); -- this.b = var3; -- this.c = var4; -- } -- -- protected void keyTyped(char var1, int var2) { -- } -- -+ public GuiScreenDisconnectedOnline(GuiScreen par1GuiScreen, String par2Str, String par3Str, Object ... par4ArrayOfObj) { -+ this.field_98114_n = par1GuiScreen; -+ this.field_98113_a = I18n.getString(par2Str); -+ this.field_98111_b = par3Str; -+ this.field_98112_c = par4ArrayOfObj; -+ } -+ -+ /** -+ * Fired when a key is typed. This is the equivalent of KeyListener.keyTyped(KeyEvent e). -+ */ -+ protected void keyTyped(char par1, int par2) {} -+ -+ /** -+ * Adds the buttons (and other controls) to the screen in question. -+ */ - public void initGui() { -- this.i.clear(); -- this.i.add(new GuiButton(0, this.width / 2 - 100, this.height / 4 + 120 + 12, I18n.getString("gui.back"))); -- if(this.c != null) { -- this.d = this.fontRenderer.listFormattedStringToWidth(I18n.getStringParams(this.b, this.c), this.width - 50); -+ this.buttonList.clear(); -+ this.buttonList.add(new GuiButton(0, this.width / 2 - 100, this.height / 4 + 120 + 12, I18n.getString("gui.back"))); -+ -+ if (this.field_98112_c != null) { -+ this.field_98110_d = this.fontRenderer.listFormattedStringToWidth(I18n.getStringParams(this.field_98111_b, this.field_98112_c), this.width - 50); - } else { -- this.d = this.fontRenderer.listFormattedStringToWidth(I18n.getString(this.b), this.width - 50); -+ this.field_98110_d = this.fontRenderer.listFormattedStringToWidth(I18n.getString(this.field_98111_b), this.width - 50); - } -- - } - -- protected void actionPerformed(GuiButton var1) { -- if(var1.id == 0) { -+ /** -+ * Fired when a control is clicked. This is the equivalent of ActionListener.actionPerformed(ActionEvent e). -+ */ -+ protected void actionPerformed(GuiButton par1GuiButton) { -+ if (par1GuiButton.id == 0) { - this.mc.displayGuiScreen(this.field_98114_n); - } -- - } - -- public void drawScreen(int var1, int var2, float var3) { -+ /** -+ * Draws the screen and all the components in it. -+ */ -+ public void drawScreen(int par1, int par2, float par3) { - this.drawDefaultBackground(); -- this.drawCenteredString(this.fontRenderer, this.a, this.width / 2, this.height / 2 - 50, 11184810); -+ this.drawCenteredString(this.fontRenderer, this.field_98113_a, this.width / 2, this.height / 2 - 50, 11184810); - int var4 = this.height / 2 - 30; -- if(this.d != null) { -- for(Iterator var5 = this.d.iterator(); var5.hasNext(); var4 += this.fontRenderer.FONT_HEIGHT) { -+ -+ if (this.field_98110_d != null) { -+ for (Iterator var5 = this.field_98110_d.iterator(); var5.hasNext(); var4 += this.fontRenderer.FONT_HEIGHT) { - String var6 = (String)var5.next(); - this.drawCenteredString(this.fontRenderer, var6, this.width / 2, var4, 16777215); - } - } - -- super.drawScreen(var1, var2, var3); -+ super.drawScreen(par1, par2, par3); - } - } ---- net/minecraft/src/ComponentStrongholdPortalRoom.java -+++ net/minecraft/src/ComponentStrongholdPortalRoom.java -@@ -6,118 +6,130 @@ - public class ComponentStrongholdPortalRoom extends ComponentStronghold { - private boolean hasSpawner; - -- public ComponentStrongholdPortalRoom() { -- } -- -- public ComponentStrongholdPortalRoom(int var1, Random var2, StructureBoundingBox var3, int var4) { -- super(var1); -- this.coordBaseMode = var4; -- this.boundingBox = var3; -- } -- -- protected void func_143012_a(NBTTagCompound var1) { -- super.func_143012_a(var1); -- var1.setBoolean("Mob", this.hasSpawner); -- } -- -- protected void func_143011_b(NBTTagCompound var1) { -- super.func_143011_b(var1); -- this.hasSpawner = var1.getBoolean("Mob"); -- } -- -- public void buildComponent(StructureComponent var1, List var2, Random var3) { -- if(var1 != null) { -- ((ComponentStrongholdStairs2)var1).strongholdPortalRoom = this; -+ public ComponentStrongholdPortalRoom() {} -+ -+ public ComponentStrongholdPortalRoom(int par1, Random par2Random, StructureBoundingBox par3StructureBoundingBox, int par4) { -+ super(par1); -+ this.coordBaseMode = par4; -+ this.boundingBox = par3StructureBoundingBox; -+ } -+ -+ protected void func_143012_a(NBTTagCompound par1NBTTagCompound) { -+ super.func_143012_a(par1NBTTagCompound); -+ par1NBTTagCompound.setBoolean("Mob", this.hasSpawner); -+ } -+ -+ protected void func_143011_b(NBTTagCompound par1NBTTagCompound) { -+ super.func_143011_b(par1NBTTagCompound); -+ this.hasSpawner = par1NBTTagCompound.getBoolean("Mob"); -+ } -+ -+ /** -+ * Initiates construction of the Structure Component picked, at the current Location of StructGen -+ */ -+ public void buildComponent(StructureComponent par1StructureComponent, List par2List, Random par3Random) { -+ if (par1StructureComponent != null) { -+ ((ComponentStrongholdStairs2)par1StructureComponent).strongholdPortalRoom = this; - } -- -- } -- -- public static ComponentStrongholdPortalRoom findValidPlacement(List var0, Random var1, int var2, int var3, int var4, int var5, int var6) { -- StructureBoundingBox var7 = StructureBoundingBox.getComponentToAddBoundingBox(var2, var3, var4, -4, -1, 0, 11, 8, 16, var5); -- return canStrongholdGoDeeper(var7) && StructureComponent.findIntersecting(var0, var7) == null ? new ComponentStrongholdPortalRoom(var6, var1, var7, var5) : null; -- } -- -- public boolean addComponentParts(World var1, Random var2, StructureBoundingBox var3) { -- this.fillWithRandomizedBlocks(var1, var3, 0, 0, 0, 10, 7, 15, false, var2, StructureStrongholdPieces.getStrongholdStones()); -- this.placeDoor(var1, var2, var3, EnumDoor.GRATES, 4, 1, 0); -+ } -+ -+ public static ComponentStrongholdPortalRoom findValidPlacement(List par0List, Random par1Random, int par2, int par3, int par4, int par5, int par6) { -+ StructureBoundingBox var7 = StructureBoundingBox.getComponentToAddBoundingBox(par2, par3, par4, -4, -1, 0, 11, 8, 16, par5); -+ return canStrongholdGoDeeper(var7) && StructureComponent.findIntersecting(par0List, var7) == null ? new ComponentStrongholdPortalRoom(par6, par1Random, var7, par5) : null; -+ } -+ -+ /** -+ * second Part of Structure generating, this for example places Spiderwebs, Mob Spawners, it closes Mineshafts at the -+ * end, it adds Fences... -+ */ -+ public boolean addComponentParts(World par1World, Random par2Random, StructureBoundingBox par3StructureBoundingBox) { -+ this.fillWithRandomizedBlocks(par1World, par3StructureBoundingBox, 0, 0, 0, 10, 7, 15, false, par2Random, StructureStrongholdPieces.getStrongholdStones()); -+ this.placeDoor(par1World, par2Random, par3StructureBoundingBox, EnumDoor.GRATES, 4, 1, 0); - byte var4 = 6; -- this.fillWithRandomizedBlocks(var1, var3, 1, var4, 1, 1, var4, 14, false, var2, StructureStrongholdPieces.getStrongholdStones()); -- this.fillWithRandomizedBlocks(var1, var3, 9, var4, 1, 9, var4, 14, false, var2, StructureStrongholdPieces.getStrongholdStones()); -- this.fillWithRandomizedBlocks(var1, var3, 2, var4, 1, 8, var4, 2, false, var2, StructureStrongholdPieces.getStrongholdStones()); -- this.fillWithRandomizedBlocks(var1, var3, 2, var4, 14, 8, var4, 14, false, var2, StructureStrongholdPieces.getStrongholdStones()); -- this.fillWithRandomizedBlocks(var1, var3, 1, 1, 1, 2, 1, 4, false, var2, StructureStrongholdPieces.getStrongholdStones()); -- this.fillWithRandomizedBlocks(var1, var3, 8, 1, 1, 9, 1, 4, false, var2, StructureStrongholdPieces.getStrongholdStones()); -- this.fillWithBlocks(var1, var3, 1, 1, 1, 1, 1, 3, Block.lavaMoving.blockID, Block.lavaMoving.blockID, false); -- this.fillWithBlocks(var1, var3, 9, 1, 1, 9, 1, 3, Block.lavaMoving.blockID, Block.lavaMoving.blockID, false); -- this.fillWithRandomizedBlocks(var1, var3, 3, 1, 8, 7, 1, 12, false, var2, StructureStrongholdPieces.getStrongholdStones()); -- this.fillWithBlocks(var1, var3, 4, 1, 9, 6, 1, 11, Block.lavaMoving.blockID, Block.lavaMoving.blockID, false); -- -+ this.fillWithRandomizedBlocks(par1World, par3StructureBoundingBox, 1, var4, 1, 1, var4, 14, false, par2Random, StructureStrongholdPieces.getStrongholdStones()); -+ this.fillWithRandomizedBlocks(par1World, par3StructureBoundingBox, 9, var4, 1, 9, var4, 14, false, par2Random, StructureStrongholdPieces.getStrongholdStones()); -+ this.fillWithRandomizedBlocks(par1World, par3StructureBoundingBox, 2, var4, 1, 8, var4, 2, false, par2Random, StructureStrongholdPieces.getStrongholdStones()); -+ this.fillWithRandomizedBlocks(par1World, par3StructureBoundingBox, 2, var4, 14, 8, var4, 14, false, par2Random, StructureStrongholdPieces.getStrongholdStones()); -+ this.fillWithRandomizedBlocks(par1World, par3StructureBoundingBox, 1, 1, 1, 2, 1, 4, false, par2Random, StructureStrongholdPieces.getStrongholdStones()); -+ this.fillWithRandomizedBlocks(par1World, par3StructureBoundingBox, 8, 1, 1, 9, 1, 4, false, par2Random, StructureStrongholdPieces.getStrongholdStones()); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 1, 1, 1, 1, 1, 3, Block.lavaMoving.blockID, Block.lavaMoving.blockID, false); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 9, 1, 1, 9, 1, 3, Block.lavaMoving.blockID, Block.lavaMoving.blockID, false); -+ this.fillWithRandomizedBlocks(par1World, par3StructureBoundingBox, 3, 1, 8, 7, 1, 12, false, par2Random, StructureStrongholdPieces.getStrongholdStones()); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 4, 1, 9, 6, 1, 11, Block.lavaMoving.blockID, Block.lavaMoving.blockID, false); - int var5; -- for(var5 = 3; var5 < 14; var5 += 2) { -- this.fillWithBlocks(var1, var3, 0, 3, var5, 0, 4, var5, Block.fenceIron.blockID, Block.fenceIron.blockID, false); -- this.fillWithBlocks(var1, var3, 10, 3, var5, 10, 4, var5, Block.fenceIron.blockID, Block.fenceIron.blockID, false); -+ -+ for (var5 = 3; var5 < 14; var5 += 2) { -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 0, 3, var5, 0, 4, var5, Block.fenceIron.blockID, Block.fenceIron.blockID, false); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 10, 3, var5, 10, 4, var5, Block.fenceIron.blockID, Block.fenceIron.blockID, false); - } - -- for(var5 = 2; var5 < 9; var5 += 2) { -- this.fillWithBlocks(var1, var3, var5, 3, 15, var5, 4, 15, Block.fenceIron.blockID, Block.fenceIron.blockID, false); -+ for (var5 = 2; var5 < 9; var5 += 2) { -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, var5, 3, 15, var5, 4, 15, Block.fenceIron.blockID, Block.fenceIron.blockID, false); - } - - var5 = this.getMetadataWithOffset(Block.stairsStoneBrick.blockID, 3); -- this.fillWithRandomizedBlocks(var1, var3, 4, 1, 5, 6, 1, 7, false, var2, StructureStrongholdPieces.getStrongholdStones()); -- this.fillWithRandomizedBlocks(var1, var3, 4, 2, 6, 6, 2, 7, false, var2, StructureStrongholdPieces.getStrongholdStones()); -- this.fillWithRandomizedBlocks(var1, var3, 4, 3, 7, 6, 3, 7, false, var2, StructureStrongholdPieces.getStrongholdStones()); -+ this.fillWithRandomizedBlocks(par1World, par3StructureBoundingBox, 4, 1, 5, 6, 1, 7, false, par2Random, StructureStrongholdPieces.getStrongholdStones()); -+ this.fillWithRandomizedBlocks(par1World, par3StructureBoundingBox, 4, 2, 6, 6, 2, 7, false, par2Random, StructureStrongholdPieces.getStrongholdStones()); -+ this.fillWithRandomizedBlocks(par1World, par3StructureBoundingBox, 4, 3, 7, 6, 3, 7, false, par2Random, StructureStrongholdPieces.getStrongholdStones()); - -- for(int var6 = 4; var6 <= 6; ++var6) { -- this.placeBlockAtCurrentPosition(var1, Block.stairsStoneBrick.blockID, var5, var6, 1, 4, var3); -- this.placeBlockAtCurrentPosition(var1, Block.stairsStoneBrick.blockID, var5, var6, 2, 5, var3); -- this.placeBlockAtCurrentPosition(var1, Block.stairsStoneBrick.blockID, var5, var6, 3, 6, var3); -+ for (int var6 = 4; var6 <= 6; ++var6) { -+ this.placeBlockAtCurrentPosition(par1World, Block.stairsStoneBrick.blockID, var5, var6, 1, 4, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.stairsStoneBrick.blockID, var5, var6, 2, 5, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.stairsStoneBrick.blockID, var5, var6, 3, 6, par3StructureBoundingBox); - } - - byte var14 = 2; - byte var7 = 0; - byte var8 = 3; - byte var9 = 1; -- switch(this.coordBaseMode) { -- case 0: -- var14 = 0; -- var7 = 2; -- break; -- case 1: -- var14 = 1; -- var7 = 3; -- var8 = 0; -- var9 = 2; -- case 2: -- default: -- break; -- case 3: -- var14 = 3; -- var7 = 1; -- var8 = 0; -- var9 = 2; -+ -+ switch (this.coordBaseMode) { -+ case 0: -+ var14 = 0; -+ var7 = 2; -+ break; -+ -+ case 1: -+ var14 = 1; -+ var7 = 3; -+ var8 = 0; -+ var9 = 2; -+ -+ case 2: -+ default: -+ break; -+ -+ case 3: -+ var14 = 3; -+ var7 = 1; -+ var8 = 0; -+ var9 = 2; - } - -- this.placeBlockAtCurrentPosition(var1, Block.endPortalFrame.blockID, var14 + (var2.nextFloat() > 0.9F ? 4 : 0), 4, 3, 8, var3); -- this.placeBlockAtCurrentPosition(var1, Block.endPortalFrame.blockID, var14 + (var2.nextFloat() > 0.9F ? 4 : 0), 5, 3, 8, var3); -- this.placeBlockAtCurrentPosition(var1, Block.endPortalFrame.blockID, var14 + (var2.nextFloat() > 0.9F ? 4 : 0), 6, 3, 8, var3); -- this.placeBlockAtCurrentPosition(var1, Block.endPortalFrame.blockID, var7 + (var2.nextFloat() > 0.9F ? 4 : 0), 4, 3, 12, var3); -- this.placeBlockAtCurrentPosition(var1, Block.endPortalFrame.blockID, var7 + (var2.nextFloat() > 0.9F ? 4 : 0), 5, 3, 12, var3); -- this.placeBlockAtCurrentPosition(var1, Block.endPortalFrame.blockID, var7 + (var2.nextFloat() > 0.9F ? 4 : 0), 6, 3, 12, var3); -- this.placeBlockAtCurrentPosition(var1, Block.endPortalFrame.blockID, var8 + (var2.nextFloat() > 0.9F ? 4 : 0), 3, 3, 9, var3); -- this.placeBlockAtCurrentPosition(var1, Block.endPortalFrame.blockID, var8 + (var2.nextFloat() > 0.9F ? 4 : 0), 3, 3, 10, var3); -- this.placeBlockAtCurrentPosition(var1, Block.endPortalFrame.blockID, var8 + (var2.nextFloat() > 0.9F ? 4 : 0), 3, 3, 11, var3); -- this.placeBlockAtCurrentPosition(var1, Block.endPortalFrame.blockID, var9 + (var2.nextFloat() > 0.9F ? 4 : 0), 7, 3, 9, var3); -- this.placeBlockAtCurrentPosition(var1, Block.endPortalFrame.blockID, var9 + (var2.nextFloat() > 0.9F ? 4 : 0), 7, 3, 10, var3); -- this.placeBlockAtCurrentPosition(var1, Block.endPortalFrame.blockID, var9 + (var2.nextFloat() > 0.9F ? 4 : 0), 7, 3, 11, var3); -- if(!this.hasSpawner) { -+ this.placeBlockAtCurrentPosition(par1World, Block.endPortalFrame.blockID, var14 + (par2Random.nextFloat() > 0.9F ? 4 : 0), 4, 3, 8, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.endPortalFrame.blockID, var14 + (par2Random.nextFloat() > 0.9F ? 4 : 0), 5, 3, 8, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.endPortalFrame.blockID, var14 + (par2Random.nextFloat() > 0.9F ? 4 : 0), 6, 3, 8, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.endPortalFrame.blockID, var7 + (par2Random.nextFloat() > 0.9F ? 4 : 0), 4, 3, 12, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.endPortalFrame.blockID, var7 + (par2Random.nextFloat() > 0.9F ? 4 : 0), 5, 3, 12, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.endPortalFrame.blockID, var7 + (par2Random.nextFloat() > 0.9F ? 4 : 0), 6, 3, 12, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.endPortalFrame.blockID, var8 + (par2Random.nextFloat() > 0.9F ? 4 : 0), 3, 3, 9, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.endPortalFrame.blockID, var8 + (par2Random.nextFloat() > 0.9F ? 4 : 0), 3, 3, 10, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.endPortalFrame.blockID, var8 + (par2Random.nextFloat() > 0.9F ? 4 : 0), 3, 3, 11, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.endPortalFrame.blockID, var9 + (par2Random.nextFloat() > 0.9F ? 4 : 0), 7, 3, 9, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.endPortalFrame.blockID, var9 + (par2Random.nextFloat() > 0.9F ? 4 : 0), 7, 3, 10, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.endPortalFrame.blockID, var9 + (par2Random.nextFloat() > 0.9F ? 4 : 0), 7, 3, 11, par3StructureBoundingBox); -+ -+ if (!this.hasSpawner) { - int var13 = this.getYWithOffset(3); - int var10 = this.getXWithOffset(5, 6); - int var11 = this.getZWithOffset(5, 6); -- if(var3.isVecInside(var10, var13, var11)) { -+ -+ if (par3StructureBoundingBox.isVecInside(var10, var13, var11)) { - this.hasSpawner = true; -- var1.setBlock(var10, var13, var11, Block.mobSpawner.blockID, 0, 2); -- TileEntityMobSpawner var12 = (TileEntityMobSpawner)var1.getBlockTileEntity(var10, var13, var11); -- if(var12 != null) { -+ par1World.setBlock(var10, var13, var11, Block.mobSpawner.blockID, 0, 2); -+ TileEntityMobSpawner var12 = (TileEntityMobSpawner)par1World.getBlockTileEntity(var10, var13, var11); -+ -+ if (var12 != null) { - var12.getSpawnerLogic().setMobID("Silverfish"); - } - } ---- /dev/null -+++ org/spoutcraft/api/animation/OutQuadAnimationProgress.java -@@ -1,0 +1,36 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.api.animation; -+ -+public class OutQuadAnimationProgress implements AnimationProgress { -+ private int strength; -+ -+ public OutQuadAnimationProgress() { -+ this(2); -+ } -+ -+ public OutQuadAnimationProgress(int strength) { -+ this.strength = strength; -+ } -+ -+ public double getValueAt(double progress) { -+ return -Math.abs(Math.pow(progress - 1, strength)) + 1; -+ } -+} ---- net/minecraft/src/MovementInputFromOptions.java -+++ net/minecraft/src/MovementInputFromOptions.java -@@ -1,37 +1,72 @@ - package net.minecraft.src; - - public class MovementInputFromOptions extends MovementInput { -- private GameSettings gameSettings; -+ // Spout Start - private to public -+ public GameSettings gameSettings; -+ // Spout End - -- public MovementInputFromOptions(GameSettings var1) { -- this.gameSettings = var1; -+ public MovementInputFromOptions(GameSettings par1GameSettings) { -+ this.gameSettings = par1GameSettings; - } - -- public void updatePlayerMoveState() { -+ // Spout Start - Keep parameter -+ public void updatePlayerMoveState(EntityPlayer par1EntityPlayer) { -+ // Spout End - this.moveStrafe = 0.0F; - this.moveForward = 0.0F; -- if(this.gameSettings.keyBindForward.pressed) { -+ -+ // Spout Start - Forward toggle -+ if (this.gameSettings.keyBindForward.pressed || par1EntityPlayer.autoforwardToggle) { -+ // Spout End - ++this.moveForward; - } - -- if(this.gameSettings.keyBindBack.pressed) { -+ // Spout Start - Forward toggle -+ if (this.gameSettings.keyBindBack.pressed || par1EntityPlayer.autoBackwardToggle) { -+ // Spout End - --this.moveForward; - } - -- if(this.gameSettings.keyBindLeft.pressed) { -+ if (this.gameSettings.keyBindLeft.pressed) { - ++this.moveStrafe; - } - -- if(this.gameSettings.keyBindRight.pressed) { -+ if (this.gameSettings.keyBindRight.pressed) { - --this.moveStrafe; - } -+ // Spout Start -+ this.flyingDown = this.gameSettings.keyFlyDown.pressed; -+ this.flyingUp = this.gameSettings.keyFlyUp.pressed; -+ if (par1EntityPlayer.capabilities.isFlying) { -+ this.moveStrafe = 0.0F; -+ this.moveForward = 0.0F; -+ -+ if (this.gameSettings.keyFlyForward.pressed || par1EntityPlayer.autoforwardToggle) { -+ ++this.moveForward; -+ } -+ -+ if (this.gameSettings.keyFlyBack.pressed) { -+ --this.moveForward; -+ } -+ -+ if (this.gameSettings.keyFlyLeft.pressed) { -+ ++this.moveStrafe; -+ } -+ -+ if (this.gameSettings.keyFlyRight.pressed) { -+ --this.moveStrafe; -+ } -+ } -+ // Spout End - - this.jump = this.gameSettings.keyBindJump.pressed; -- this.sneak = this.gameSettings.keyBindSneak.pressed; -- if(this.sneak) { -+ // Spout Start - Sneak toggle -+ this.sneak = this.gameSettings.keyBindSneak.pressed || par1EntityPlayer.sneakToggle; -+ // Spout End -+ -+ if (this.sneak) { - this.moveStrafe = (float)((double)this.moveStrafe * 0.3D); - this.moveForward = (float)((double)this.moveForward * 0.3D); - } -- - } - } ---- /dev/null -+++ com/prupe/mcpatcher/ctm/TileOverrideImpl$Fixed.java -@@ -1,0 +1,30 @@ -+package com.prupe.mcpatcher.ctm; -+ -+import com.prupe.mcpatcher.TileLoader; -+import java.util.Properties; -+import net.minecraft.src.Block; -+import net.minecraft.src.IBlockAccess; -+import net.minecraft.src.Icon; -+import net.minecraft.src.ResourceLocation; -+ -+final class TileOverrideImpl$Fixed extends TileOverride { -+ TileOverrideImpl$Fixed(ResourceLocation filePrefix, Properties properties, TileLoader tileLoader) { -+ super(filePrefix, properties, tileLoader); -+ } -+ -+ String getMethod() { -+ return "fixed"; -+ } -+ -+ String checkTileMap() { -+ return this.getNumberOfTiles() == 1 ? null : "requires exactly 1 tile"; -+ } -+ -+ Icon getTileImpl(IBlockAccess blockAccess, Block block, Icon origIcon, int i, int j, int k, int face) { -+ return this.icons[0]; -+ } -+ -+ Icon getTileImpl(Block block, Icon origIcon, int face, int metadata) { -+ return this.icons[0]; -+ } -+} ---- /dev/null -+++ org/spoutcraft/api/Achievement.java -@@ -1,0 +1,82 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.api; -+ -+import java.util.HashMap; -+import java.util.Map; -+ -+public enum Achievement { -+ OPEN_INVENTORY(0), -+ MINE_WOOD(1), -+ BUILD_WORKBENCH(2), -+ BUILD_PICKAXE(3), -+ BUILD_FURNACE(4), -+ ACQUIRE_IRON(5), -+ BUILD_HOE(6), -+ MAKE_BREAD(7), -+ BAKE_CAKE(8), -+ BUILD_BETTER_PICKAXE(9), -+ COOK_FISH(10), -+ ON_A_RAIL(11), -+ BUILD_SWORD(12), -+ KILL_ENEMY(13), -+ KILL_COW(14), -+ FLY_PIG(15); -+ -+ /** -+ * The offset used to distinguish Achievements and Statistics -+ */ -+ public final static int STATISTIC_OFFSET = 5242880; -+ private final static Map achievements = new HashMap(); -+ private final int id; -+ -+ private Achievement(int id) { -+ this.id = STATISTIC_OFFSET + id; -+ } -+ -+ /** -+ * Gets the ID for this achievement. -+ * -+ * Note that this is offset using {@link #STATISTIC_OFFSET} -+ * -+ * @return ID of this achievement -+ */ -+ public int getId() { -+ return id; -+ } -+ -+ /** -+ * Gets the achievement associated with the given ID. -+ * -+ * Note that the ID must already be offset using {@link #STATISTIC_OFFSET} -+ * -+ * @param id ID of the achievement to return -+ * @return Achievement with the given ID -+ */ -+ public static Achievement getAchievement(int id) { -+ return achievements.get(id); -+ } -+ -+ static { -+ for (Achievement ach : values()) { -+ achievements.put(ach.getId(), ach); -+ } -+ } -+} ---- net/minecraft/src/ComponentNetherBridgeEntrance.java -+++ net/minecraft/src/ComponentNetherBridgeEntrance.java -@@ -4,97 +4,107 @@ - import java.util.Random; - - public class ComponentNetherBridgeEntrance extends ComponentNetherBridgePiece { -- public ComponentNetherBridgeEntrance() { -- } -- -- public ComponentNetherBridgeEntrance(int var1, Random var2, StructureBoundingBox var3, int var4) { -- super(var1); -- this.coordBaseMode = var4; -- this.boundingBox = var3; -- } -- -- public void buildComponent(StructureComponent var1, List var2, Random var3) { -- this.getNextComponentNormal((ComponentNetherBridgeStartPiece)var1, var2, var3, 5, 3, true); -- } -- -- public static ComponentNetherBridgeEntrance createValidComponent(List var0, Random var1, int var2, int var3, int var4, int var5, int var6) { -- StructureBoundingBox var7 = StructureBoundingBox.getComponentToAddBoundingBox(var2, var3, var4, -5, -3, 0, 13, 14, 13, var5); -- return isAboveGround(var7) && StructureComponent.findIntersecting(var0, var7) == null ? new ComponentNetherBridgeEntrance(var6, var1, var7, var5) : null; -- } -- -- public boolean addComponentParts(World var1, Random var2, StructureBoundingBox var3) { -- this.fillWithBlocks(var1, var3, 0, 3, 0, 12, 4, 12, Block.netherBrick.blockID, Block.netherBrick.blockID, false); -- this.fillWithBlocks(var1, var3, 0, 5, 0, 12, 13, 12, 0, 0, false); -- this.fillWithBlocks(var1, var3, 0, 5, 0, 1, 12, 12, Block.netherBrick.blockID, Block.netherBrick.blockID, false); -- this.fillWithBlocks(var1, var3, 11, 5, 0, 12, 12, 12, Block.netherBrick.blockID, Block.netherBrick.blockID, false); -- this.fillWithBlocks(var1, var3, 2, 5, 11, 4, 12, 12, Block.netherBrick.blockID, Block.netherBrick.blockID, false); -- this.fillWithBlocks(var1, var3, 8, 5, 11, 10, 12, 12, Block.netherBrick.blockID, Block.netherBrick.blockID, false); -- this.fillWithBlocks(var1, var3, 5, 9, 11, 7, 12, 12, Block.netherBrick.blockID, Block.netherBrick.blockID, false); -- this.fillWithBlocks(var1, var3, 2, 5, 0, 4, 12, 1, Block.netherBrick.blockID, Block.netherBrick.blockID, false); -- this.fillWithBlocks(var1, var3, 8, 5, 0, 10, 12, 1, Block.netherBrick.blockID, Block.netherBrick.blockID, false); -- this.fillWithBlocks(var1, var3, 5, 9, 0, 7, 12, 1, Block.netherBrick.blockID, Block.netherBrick.blockID, false); -- this.fillWithBlocks(var1, var3, 2, 11, 2, 10, 12, 10, Block.netherBrick.blockID, Block.netherBrick.blockID, false); -- this.fillWithBlocks(var1, var3, 5, 8, 0, 7, 8, 0, Block.netherFence.blockID, Block.netherFence.blockID, false); -- -+ public ComponentNetherBridgeEntrance() {} -+ -+ public ComponentNetherBridgeEntrance(int par1, Random par2Random, StructureBoundingBox par3StructureBoundingBox, int par4) { -+ super(par1); -+ this.coordBaseMode = par4; -+ this.boundingBox = par3StructureBoundingBox; -+ } -+ -+ /** -+ * Initiates construction of the Structure Component picked, at the current Location of StructGen -+ */ -+ public void buildComponent(StructureComponent par1StructureComponent, List par2List, Random par3Random) { -+ this.getNextComponentNormal((ComponentNetherBridgeStartPiece)par1StructureComponent, par2List, par3Random, 5, 3, true); -+ } -+ -+ /** -+ * Creates and returns a new component piece. Or null if it could not find enough room to place it. -+ */ -+ public static ComponentNetherBridgeEntrance createValidComponent(List par0List, Random par1Random, int par2, int par3, int par4, int par5, int par6) { -+ StructureBoundingBox var7 = StructureBoundingBox.getComponentToAddBoundingBox(par2, par3, par4, -5, -3, 0, 13, 14, 13, par5); -+ return isAboveGround(var7) && StructureComponent.findIntersecting(par0List, var7) == null ? new ComponentNetherBridgeEntrance(par6, par1Random, var7, par5) : null; -+ } -+ -+ /** -+ * second Part of Structure generating, this for example places Spiderwebs, Mob Spawners, it closes Mineshafts at the -+ * end, it adds Fences... -+ */ -+ public boolean addComponentParts(World par1World, Random par2Random, StructureBoundingBox par3StructureBoundingBox) { -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 0, 3, 0, 12, 4, 12, Block.netherBrick.blockID, Block.netherBrick.blockID, false); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 0, 5, 0, 12, 13, 12, 0, 0, false); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 0, 5, 0, 1, 12, 12, Block.netherBrick.blockID, Block.netherBrick.blockID, false); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 11, 5, 0, 12, 12, 12, Block.netherBrick.blockID, Block.netherBrick.blockID, false); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 2, 5, 11, 4, 12, 12, Block.netherBrick.blockID, Block.netherBrick.blockID, false); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 8, 5, 11, 10, 12, 12, Block.netherBrick.blockID, Block.netherBrick.blockID, false); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 5, 9, 11, 7, 12, 12, Block.netherBrick.blockID, Block.netherBrick.blockID, false); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 2, 5, 0, 4, 12, 1, Block.netherBrick.blockID, Block.netherBrick.blockID, false); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 8, 5, 0, 10, 12, 1, Block.netherBrick.blockID, Block.netherBrick.blockID, false); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 5, 9, 0, 7, 12, 1, Block.netherBrick.blockID, Block.netherBrick.blockID, false); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 2, 11, 2, 10, 12, 10, Block.netherBrick.blockID, Block.netherBrick.blockID, false); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 5, 8, 0, 7, 8, 0, Block.netherFence.blockID, Block.netherFence.blockID, false); - int var4; -- for(var4 = 1; var4 <= 11; var4 += 2) { -- this.fillWithBlocks(var1, var3, var4, 10, 0, var4, 11, 0, Block.netherFence.blockID, Block.netherFence.blockID, false); -- this.fillWithBlocks(var1, var3, var4, 10, 12, var4, 11, 12, Block.netherFence.blockID, Block.netherFence.blockID, false); -- this.fillWithBlocks(var1, var3, 0, 10, var4, 0, 11, var4, Block.netherFence.blockID, Block.netherFence.blockID, false); -- this.fillWithBlocks(var1, var3, 12, 10, var4, 12, 11, var4, Block.netherFence.blockID, Block.netherFence.blockID, false); -- this.placeBlockAtCurrentPosition(var1, Block.netherBrick.blockID, 0, var4, 13, 0, var3); -- this.placeBlockAtCurrentPosition(var1, Block.netherBrick.blockID, 0, var4, 13, 12, var3); -- this.placeBlockAtCurrentPosition(var1, Block.netherBrick.blockID, 0, 0, 13, var4, var3); -- this.placeBlockAtCurrentPosition(var1, Block.netherBrick.blockID, 0, 12, 13, var4, var3); -- this.placeBlockAtCurrentPosition(var1, Block.netherFence.blockID, 0, var4 + 1, 13, 0, var3); -- this.placeBlockAtCurrentPosition(var1, Block.netherFence.blockID, 0, var4 + 1, 13, 12, var3); -- this.placeBlockAtCurrentPosition(var1, Block.netherFence.blockID, 0, 0, 13, var4 + 1, var3); -- this.placeBlockAtCurrentPosition(var1, Block.netherFence.blockID, 0, 12, 13, var4 + 1, var3); -- } -- -- this.placeBlockAtCurrentPosition(var1, Block.netherFence.blockID, 0, 0, 13, 0, var3); -- this.placeBlockAtCurrentPosition(var1, Block.netherFence.blockID, 0, 0, 13, 12, var3); -- this.placeBlockAtCurrentPosition(var1, Block.netherFence.blockID, 0, 0, 13, 0, var3); -- this.placeBlockAtCurrentPosition(var1, Block.netherFence.blockID, 0, 12, 13, 0, var3); -- -- for(var4 = 3; var4 <= 9; var4 += 2) { -- this.fillWithBlocks(var1, var3, 1, 7, var4, 1, 8, var4, Block.netherFence.blockID, Block.netherFence.blockID, false); -- this.fillWithBlocks(var1, var3, 11, 7, var4, 11, 8, var4, Block.netherFence.blockID, Block.netherFence.blockID, false); -- } -- -- this.fillWithBlocks(var1, var3, 4, 2, 0, 8, 2, 12, Block.netherBrick.blockID, Block.netherBrick.blockID, false); -- this.fillWithBlocks(var1, var3, 0, 2, 4, 12, 2, 8, Block.netherBrick.blockID, Block.netherBrick.blockID, false); -- this.fillWithBlocks(var1, var3, 4, 0, 0, 8, 1, 3, Block.netherBrick.blockID, Block.netherBrick.blockID, false); -- this.fillWithBlocks(var1, var3, 4, 0, 9, 8, 1, 12, Block.netherBrick.blockID, Block.netherBrick.blockID, false); -- this.fillWithBlocks(var1, var3, 0, 0, 4, 3, 1, 8, Block.netherBrick.blockID, Block.netherBrick.blockID, false); -- this.fillWithBlocks(var1, var3, 9, 0, 4, 12, 1, 8, Block.netherBrick.blockID, Block.netherBrick.blockID, false); -- -+ -+ for (var4 = 1; var4 <= 11; var4 += 2) { -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, var4, 10, 0, var4, 11, 0, Block.netherFence.blockID, Block.netherFence.blockID, false); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, var4, 10, 12, var4, 11, 12, Block.netherFence.blockID, Block.netherFence.blockID, false); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 0, 10, var4, 0, 11, var4, Block.netherFence.blockID, Block.netherFence.blockID, false); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 12, 10, var4, 12, 11, var4, Block.netherFence.blockID, Block.netherFence.blockID, false); -+ this.placeBlockAtCurrentPosition(par1World, Block.netherBrick.blockID, 0, var4, 13, 0, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.netherBrick.blockID, 0, var4, 13, 12, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.netherBrick.blockID, 0, 0, 13, var4, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.netherBrick.blockID, 0, 12, 13, var4, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.netherFence.blockID, 0, var4 + 1, 13, 0, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.netherFence.blockID, 0, var4 + 1, 13, 12, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.netherFence.blockID, 0, 0, 13, var4 + 1, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.netherFence.blockID, 0, 12, 13, var4 + 1, par3StructureBoundingBox); -+ } -+ -+ this.placeBlockAtCurrentPosition(par1World, Block.netherFence.blockID, 0, 0, 13, 0, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.netherFence.blockID, 0, 0, 13, 12, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.netherFence.blockID, 0, 0, 13, 0, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.netherFence.blockID, 0, 12, 13, 0, par3StructureBoundingBox); -+ -+ for (var4 = 3; var4 <= 9; var4 += 2) { -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 1, 7, var4, 1, 8, var4, Block.netherFence.blockID, Block.netherFence.blockID, false); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 11, 7, var4, 11, 8, var4, Block.netherFence.blockID, Block.netherFence.blockID, false); -+ } -+ -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 4, 2, 0, 8, 2, 12, Block.netherBrick.blockID, Block.netherBrick.blockID, false); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 0, 2, 4, 12, 2, 8, Block.netherBrick.blockID, Block.netherBrick.blockID, false); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 4, 0, 0, 8, 1, 3, Block.netherBrick.blockID, Block.netherBrick.blockID, false); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 4, 0, 9, 8, 1, 12, Block.netherBrick.blockID, Block.netherBrick.blockID, false); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 0, 0, 4, 3, 1, 8, Block.netherBrick.blockID, Block.netherBrick.blockID, false); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 9, 0, 4, 12, 1, 8, Block.netherBrick.blockID, Block.netherBrick.blockID, false); - int var5; -- for(var4 = 4; var4 <= 8; ++var4) { -- for(var5 = 0; var5 <= 2; ++var5) { -- this.fillCurrentPositionBlocksDownwards(var1, Block.netherBrick.blockID, 0, var4, -1, var5, var3); -- this.fillCurrentPositionBlocksDownwards(var1, Block.netherBrick.blockID, 0, var4, -1, 12 - var5, var3); -- } -- } -- -- for(var4 = 0; var4 <= 2; ++var4) { -- for(var5 = 4; var5 <= 8; ++var5) { -- this.fillCurrentPositionBlocksDownwards(var1, Block.netherBrick.blockID, 0, var4, -1, var5, var3); -- this.fillCurrentPositionBlocksDownwards(var1, Block.netherBrick.blockID, 0, 12 - var4, -1, var5, var3); -- } -- } -- -- this.fillWithBlocks(var1, var3, 5, 5, 5, 7, 5, 7, Block.netherBrick.blockID, Block.netherBrick.blockID, false); -- this.fillWithBlocks(var1, var3, 6, 1, 6, 6, 4, 6, 0, 0, false); -- this.placeBlockAtCurrentPosition(var1, Block.netherBrick.blockID, 0, 6, 0, 6, var3); -- this.placeBlockAtCurrentPosition(var1, Block.lavaMoving.blockID, 0, 6, 5, 6, var3); -+ -+ for (var4 = 4; var4 <= 8; ++var4) { -+ for (var5 = 0; var5 <= 2; ++var5) { -+ this.fillCurrentPositionBlocksDownwards(par1World, Block.netherBrick.blockID, 0, var4, -1, var5, par3StructureBoundingBox); -+ this.fillCurrentPositionBlocksDownwards(par1World, Block.netherBrick.blockID, 0, var4, -1, 12 - var5, par3StructureBoundingBox); -+ } -+ } -+ -+ for (var4 = 0; var4 <= 2; ++var4) { -+ for (var5 = 4; var5 <= 8; ++var5) { -+ this.fillCurrentPositionBlocksDownwards(par1World, Block.netherBrick.blockID, 0, var4, -1, var5, par3StructureBoundingBox); -+ this.fillCurrentPositionBlocksDownwards(par1World, Block.netherBrick.blockID, 0, 12 - var4, -1, var5, par3StructureBoundingBox); -+ } -+ } -+ -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 5, 5, 5, 7, 5, 7, Block.netherBrick.blockID, Block.netherBrick.blockID, false); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 6, 1, 6, 6, 4, 6, 0, 0, false); -+ this.placeBlockAtCurrentPosition(par1World, Block.netherBrick.blockID, 0, 6, 0, 6, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.lavaMoving.blockID, 0, 6, 5, 6, par3StructureBoundingBox); - var4 = this.getXWithOffset(6, 6); - var5 = this.getYWithOffset(5); - int var6 = this.getZWithOffset(6, 6); -- if(var3.isVecInside(var4, var5, var6)) { -- var1.scheduledUpdatesAreImmediate = true; -- Block.blocksList[Block.lavaMoving.blockID].updateTick(var1, var4, var5, var6, var2); -- var1.scheduledUpdatesAreImmediate = false; -+ -+ if (par3StructureBoundingBox.isVecInside(var4, var5, var6)) { -+ par1World.scheduledUpdatesAreImmediate = true; -+ Block.blocksList[Block.lavaMoving.blockID].updateTick(par1World, var4, var5, var6, par2Random); -+ par1World.scheduledUpdatesAreImmediate = false; - } - - return true; ---- net/minecraft/src/InventoryCraftResult.java -+++ net/minecraft/src/InventoryCraftResult.java -@@ -1,26 +1,45 @@ - package net.minecraft.src; - - public class InventoryCraftResult implements IInventory { -+ -+ /** A list of one item containing the result of the crafting formula */ - private ItemStack[] stackResult = new ItemStack[1]; - -+ /** -+ * Returns the number of slots in the inventory. -+ */ - public int getSizeInventory() { - return 1; - } - -- public ItemStack getStackInSlot(int var1) { -+ /** -+ * Returns the stack in slot i -+ */ -+ public ItemStack getStackInSlot(int par1) { - return this.stackResult[0]; - } - -+ /** -+ * Returns the name of the inventory. -+ */ - public String getInvName() { - return "Result"; - } - -+ /** -+ * If this returns false, the inventory name will be used as an unlocalized name, and translated into the player's -+ * language. Otherwise it will be used directly. -+ */ - public boolean isInvNameLocalized() { - return false; - } - -- public ItemStack decrStackSize(int var1, int var2) { -- if(this.stackResult[0] != null) { -+ /** -+ * Removes from an inventory slot (first arg) up to a specified number (second arg) of items and returns them in a new -+ * stack. -+ */ -+ public ItemStack decrStackSize(int par1, int par2) { -+ if (this.stackResult[0] != null) { - ItemStack var3 = this.stackResult[0]; - this.stackResult[0] = null; - return var3; -@@ -29,8 +48,12 @@ - } - } - -- public ItemStack getStackInSlotOnClosing(int var1) { -- if(this.stackResult[0] != null) { -+ /** -+ * When some containers are closed they call this on each slot, then drop whatever it returns as an EntityItem - like -+ * when you close a workbench GUI. -+ */ -+ public ItemStack getStackInSlotOnClosing(int par1) { -+ if (this.stackResult[0] != null) { - ItemStack var2 = this.stackResult[0]; - this.stackResult[0] = null; - return var2; -@@ -39,28 +62,41 @@ - } - } - -- public void setInventorySlotContents(int var1, ItemStack var2) { -- this.stackResult[0] = var2; -+ /** -+ * Sets the given item stack to the specified slot in the inventory (can be crafting or armor sections). -+ */ -+ public void setInventorySlotContents(int par1, ItemStack par2ItemStack) { -+ this.stackResult[0] = par2ItemStack; - } - -+ /** -+ * Returns the maximum stack size for a inventory slot. Seems to always be 64, possibly will be extended. *Isn't this -+ * more of a set than a get?* -+ */ - public int getInventoryStackLimit() { - return 64; - } - -- public void onInventoryChanged() { -- } -+ /** -+ * Called when an the contents of an Inventory change, usually -+ */ -+ public void onInventoryChanged() {} - -- public boolean isUseableByPlayer(EntityPlayer var1) { -+ /** -+ * Do not make give this method the name canInteractWith because it clashes with Container -+ */ -+ public boolean isUseableByPlayer(EntityPlayer par1EntityPlayer) { - return true; - } - -- public void openChest() { -- } -- -- public void closeChest() { -- } -- -- public boolean isItemValidForSlot(int var1, ItemStack var2) { -+ public void openChest() {} -+ -+ public void closeChest() {} -+ -+ /** -+ * Returns true if automation is allowed to insert the given stack (ignoring stack size) into the given slot. -+ */ -+ public boolean isItemValidForSlot(int par1, ItemStack par2ItemStack) { - return true; - } - } ---- net/minecraft/src/Packet55BlockDestroy.java -+++ net/minecraft/src/Packet55BlockDestroy.java -@@ -5,73 +5,116 @@ - import java.io.IOException; - - public class Packet55BlockDestroy extends Packet { -+ -+ /** Entity breaking the block */ - private int entityId; -+ -+ /** X posiiton of the block */ - private int posX; -+ -+ /** Y position of the block */ - private int posY; -+ -+ /** Z position of the block */ - private int posZ; -+ -+ /** How far destroyed this block is */ - private int destroyedStage; - -- public Packet55BlockDestroy() { -- } -- -- public Packet55BlockDestroy(int var1, int var2, int var3, int var4, int var5) { -- this.entityId = var1; -- this.posX = var2; -- this.posY = var3; -- this.posZ = var4; -- this.destroyedStage = var5; -- } -- -- public void readPacketData(DataInput var1) throws IOException { -- this.entityId = var1.readInt(); -- this.posX = var1.readInt(); -- this.posY = var1.readInt(); -- this.posZ = var1.readInt(); -- this.destroyedStage = var1.readUnsignedByte(); -- } -- -- public void writePacketData(DataOutput var1) throws IOException { -- var1.writeInt(this.entityId); -- var1.writeInt(this.posX); -- var1.writeInt(this.posY); -- var1.writeInt(this.posZ); -- var1.write(this.destroyedStage); -- } -- -- public void processPacket(NetHandler var1) { -- var1.handleBlockDestroy(this); -- } -- -+ public Packet55BlockDestroy() {} -+ -+ public Packet55BlockDestroy(int par1, int par2, int par3, int par4, int par5) { -+ this.entityId = par1; -+ this.posX = par2; -+ this.posY = par3; -+ this.posZ = par4; -+ this.destroyedStage = par5; -+ } -+ -+ /** -+ * Abstract. Reads the raw packet data from the data stream. -+ */ -+ public void readPacketData(DataInput par1DataInput) throws IOException { -+ this.entityId = par1DataInput.readInt(); -+ this.posX = par1DataInput.readInt(); -+ this.posY = par1DataInput.readInt(); -+ this.posZ = par1DataInput.readInt(); -+ this.destroyedStage = par1DataInput.readUnsignedByte(); -+ } -+ -+ /** -+ * Abstract. Writes the raw packet data to the data stream. -+ */ -+ public void writePacketData(DataOutput par1DataOutput) throws IOException { -+ par1DataOutput.writeInt(this.entityId); -+ par1DataOutput.writeInt(this.posX); -+ par1DataOutput.writeInt(this.posY); -+ par1DataOutput.writeInt(this.posZ); -+ par1DataOutput.write(this.destroyedStage); -+ } -+ -+ /** -+ * Passes this Packet on to the NetHandler for processing. -+ */ -+ public void processPacket(NetHandler par1NetHandler) { -+ par1NetHandler.handleBlockDestroy(this); -+ } -+ -+ /** -+ * Abstract. Return the size of the packet (not counting the header). -+ */ - public int getPacketSize() { - return 13; - } - -+ /** -+ * Gets the ID of the entity breaking the block -+ */ - public int getEntityId() { - return this.entityId; - } - -+ /** -+ * Gets the X position of the block -+ */ - public int getPosX() { - return this.posX; - } - -+ /** -+ * Gets the Y position of the block -+ */ - public int getPosY() { - return this.posY; - } - -+ /** -+ * Gets the Z position of the block -+ */ - public int getPosZ() { - return this.posZ; - } - -+ /** -+ * Gets how far destroyed this block is -+ */ - public int getDestroyedStage() { - return this.destroyedStage; - } - -+ /** -+ * only false for the abstract Packet class, all real packets return true -+ */ - public boolean isRealPacket() { - return true; - } - -- public boolean containsSameEntityIDAs(Packet var1) { -- Packet55BlockDestroy var2 = (Packet55BlockDestroy)var1; -+ /** -+ * eg return packet30entity.entityId == entityId; WARNING : will throw if you compare a packet to a different packet -+ * class -+ */ -+ public boolean containsSameEntityIDAs(Packet par1Packet) { -+ Packet55BlockDestroy var2 = (Packet55BlockDestroy)par1Packet; - return var2.entityId == this.entityId; - } - } ---- net/minecraft/src/MaterialPortal.java -+++ net/minecraft/src/MaterialPortal.java -@@ -1,18 +1,24 @@ - package net.minecraft.src; - - public class MaterialPortal extends Material { -- public MaterialPortal(MapColor var1) { -- super(var1); -+ public MaterialPortal(MapColor par1MapColor) { -+ super(par1MapColor); - } - - public boolean isSolid() { - return false; - } - -+ /** -+ * Will prevent grass from growing on dirt underneath and kill any grass below it if it returns true -+ */ - public boolean getCanBlockGrass() { - return false; - } - -+ /** -+ * Returns if this material is considered solid or not -+ */ - public boolean blocksMovement() { - return false; - } ---- net/minecraft/src/GenLayerAddSnow.java -+++ net/minecraft/src/GenLayerAddSnow.java -@@ -1,34 +1,40 @@ - package net.minecraft.src; - - public class GenLayerAddSnow extends GenLayer { -- public GenLayerAddSnow(long var1, GenLayer var3) { -- super(var1); -- this.parent = var3; -+ public GenLayerAddSnow(long par1, GenLayer par3GenLayer) { -+ super(par1); -+ this.parent = par3GenLayer; - } - -- public int[] getInts(int var1, int var2, int var3, int var4) { -- int var5 = var1 - 1; -- int var6 = var2 - 1; -- int var7 = var3 + 2; -- int var8 = var4 + 2; -+ /** -+ * Returns a list of integer values generated by this layer. These may be interpreted as temperatures, rainfall -+ * amounts, or biomeList[] indices based on the particular GenLayer subclass. -+ */ -+ public int[] getInts(int par1, int par2, int par3, int par4) { -+ int var5 = par1 - 1; -+ int var6 = par2 - 1; -+ int var7 = par3 + 2; -+ int var8 = par4 + 2; - int[] var9 = this.parent.getInts(var5, var6, var7, var8); -- int[] var10 = IntCache.getIntCache(var3 * var4); -+ int[] var10 = IntCache.getIntCache(par3 * par4); - -- for(int var11 = 0; var11 < var4; ++var11) { -- for(int var12 = 0; var12 < var3; ++var12) { -+ for (int var11 = 0; var11 < par4; ++var11) { -+ for (int var12 = 0; var12 < par3; ++var12) { - int var13 = var9[var12 + 1 + (var11 + 1) * var7]; -- this.initChunkSeed((long)(var12 + var1), (long)(var11 + var2)); -- if(var13 == 0) { -- var10[var12 + var11 * var3] = 0; -+ this.initChunkSeed((long)(var12 + par1), (long)(var11 + par2)); -+ -+ if (var13 == 0) { -+ var10[var12 + var11 * par3] = 0; - } else { - int var14 = this.nextInt(5); -- if(var14 == 0) { -+ -+ if (var14 == 0) { - var14 = BiomeGenBase.icePlains.biomeID; - } else { - var14 = 1; - } - -- var10[var12 + var11 * var3] = var14; -+ var10[var12 + var11 * par3] = var14; - } - } - } ---- net/minecraft/src/Packet20NamedEntitySpawn.java -+++ net/minecraft/src/Packet20NamedEntitySpawn.java -@@ -6,70 +6,97 @@ - import java.util.List; - - public class Packet20NamedEntitySpawn extends Packet { -+ -+ /** The entity ID, in this case it's the player ID. */ - public int entityId; -- public String b; -+ -+ /** The player's name. */ -+ public String name; -+ -+ /** The player's X position. */ - public int xPosition; -+ -+ /** The player's Y position. */ - public int yPosition; -+ -+ /** The player's Z position. */ - public int zPosition; -+ -+ /** The player's rotation. */ - public byte rotation; -+ -+ /** The player's pitch. */ - public byte pitch; -+ -+ /** The current item the player is holding. */ - public int currentItem; - private DataWatcher metadata; -- private List j; -- -- public Packet20NamedEntitySpawn() { -- } -- -- public Packet20NamedEntitySpawn(EntityPlayer var1) { -- this.entityId = var1.entityId; -- this.b = var1.getCommandSenderName(); -- this.xPosition = MathHelper.floor_double(var1.posX * 32.0D); -- this.yPosition = MathHelper.floor_double(var1.posY * 32.0D); -- this.zPosition = MathHelper.floor_double(var1.posZ * 32.0D); -- this.rotation = (byte)((int)(var1.rotationYaw * 256.0F / 360.0F)); -- this.pitch = (byte)((int)(var1.rotationPitch * 256.0F / 360.0F)); -- ItemStack var2 = var1.inventory.getCurrentItem(); -+ private List metadataWatchableObjects; -+ -+ public Packet20NamedEntitySpawn() {} -+ -+ public Packet20NamedEntitySpawn(EntityPlayer par1EntityPlayer) { -+ this.entityId = par1EntityPlayer.entityId; -+ this.name = par1EntityPlayer.getCommandSenderName(); -+ this.xPosition = MathHelper.floor_double(par1EntityPlayer.posX * 32.0D); -+ this.yPosition = MathHelper.floor_double(par1EntityPlayer.posY * 32.0D); -+ this.zPosition = MathHelper.floor_double(par1EntityPlayer.posZ * 32.0D); -+ this.rotation = (byte)((int)(par1EntityPlayer.rotationYaw * 256.0F / 360.0F)); -+ this.pitch = (byte)((int)(par1EntityPlayer.rotationPitch * 256.0F / 360.0F)); -+ ItemStack var2 = par1EntityPlayer.inventory.getCurrentItem(); - this.currentItem = var2 == null ? 0 : var2.itemID; -- this.metadata = var1.getDataWatcher(); -- } -- -- public void readPacketData(DataInput var1) throws IOException { -- this.entityId = var1.readInt(); -- this.b = readString(var1, 16); -- this.xPosition = var1.readInt(); -- this.yPosition = var1.readInt(); -- this.zPosition = var1.readInt(); -- this.rotation = var1.readByte(); -- this.pitch = var1.readByte(); -- this.currentItem = var1.readShort(); -- this.j = DataWatcher.readWatchableObjects(var1); -- } -- -- public void writePacketData(DataOutput var1) throws IOException { -- var1.writeInt(this.entityId); -- writeString(this.b, var1); -- var1.writeInt(this.xPosition); -- var1.writeInt(this.yPosition); -- var1.writeInt(this.zPosition); -- var1.writeByte(this.rotation); -- var1.writeByte(this.pitch); -- var1.writeShort(this.currentItem); -- this.metadata.writeWatchableObjects(var1); -- } -- -- public void processPacket(NetHandler var1) { -- var1.handleNamedEntitySpawn(this); -- } -- -+ this.metadata = par1EntityPlayer.getDataWatcher(); -+ } -+ -+ /** -+ * Abstract. Reads the raw packet data from the data stream. -+ */ -+ public void readPacketData(DataInput par1DataInput) throws IOException { -+ this.entityId = par1DataInput.readInt(); -+ this.name = readString(par1DataInput, 16); -+ this.xPosition = par1DataInput.readInt(); -+ this.yPosition = par1DataInput.readInt(); -+ this.zPosition = par1DataInput.readInt(); -+ this.rotation = par1DataInput.readByte(); -+ this.pitch = par1DataInput.readByte(); -+ this.currentItem = par1DataInput.readShort(); -+ this.metadataWatchableObjects = DataWatcher.readWatchableObjects(par1DataInput); -+ } -+ -+ /** -+ * Abstract. Writes the raw packet data to the data stream. -+ */ -+ public void writePacketData(DataOutput par1DataOutput) throws IOException { -+ par1DataOutput.writeInt(this.entityId); -+ writeString(this.name, par1DataOutput); -+ par1DataOutput.writeInt(this.xPosition); -+ par1DataOutput.writeInt(this.yPosition); -+ par1DataOutput.writeInt(this.zPosition); -+ par1DataOutput.writeByte(this.rotation); -+ par1DataOutput.writeByte(this.pitch); -+ par1DataOutput.writeShort(this.currentItem); -+ this.metadata.writeWatchableObjects(par1DataOutput); -+ } -+ -+ /** -+ * Passes this Packet on to the NetHandler for processing. -+ */ -+ public void processPacket(NetHandler par1NetHandler) { -+ par1NetHandler.handleNamedEntitySpawn(this); -+ } -+ -+ /** -+ * Abstract. Return the size of the packet (not counting the header). -+ */ - public int getPacketSize() { - return 28; - } - - public List getWatchedMetadata() { -- if(this.j == null) { -- this.j = this.metadata.getAllWatched(); -+ if (this.metadataWatchableObjects == null) { -+ this.metadataWatchableObjects = this.metadata.getAllWatched(); - } - -- return this.j; -+ return this.metadataWatchableObjects; - } - } ---- net/minecraft/src/RenderSquid.java -+++ net/minecraft/src/RenderSquid.java -@@ -5,53 +5,71 @@ - public class RenderSquid extends RenderLiving { - private static final ResourceLocation squidTextures = new ResourceLocation("textures/entity/squid.png"); - -- public RenderSquid(ModelBase var1, float var2) { -- super(var1, var2); -- } -- -- public void renderLivingSquid(EntitySquid var1, double var2, double var4, double var6, float var8, float var9) { -- super.doRenderLiving(var1, var2, var4, var6, var8, var9); -- } -- -- protected ResourceLocation getSquidTextures(EntitySquid var1) { -+ public RenderSquid(ModelBase par1ModelBase, float par2) { -+ super(par1ModelBase, par2); -+ } -+ -+ /** -+ * Renders the Living Squid. -+ */ -+ public void renderLivingSquid(EntitySquid par1EntitySquid, double par2, double par4, double par6, float par8, float par9) { -+ super.doRenderLiving(par1EntitySquid, par2, par4, par6, par8, par9); -+ } -+ -+ protected ResourceLocation getSquidTextures(EntitySquid par1EntitySquid) { - return squidTextures; - } - -- protected void rotateSquidsCorpse(EntitySquid var1, float var2, float var3, float var4) { -- float var5 = var1.prevSquidPitch + (var1.squidPitch - var1.prevSquidPitch) * var4; -- float var6 = var1.prevSquidYaw + (var1.squidYaw - var1.prevSquidYaw) * var4; -+ /** -+ * Rotates the Squid's corpse. -+ */ -+ protected void rotateSquidsCorpse(EntitySquid par1EntitySquid, float par2, float par3, float par4) { -+ float var5 = par1EntitySquid.prevSquidPitch + (par1EntitySquid.squidPitch - par1EntitySquid.prevSquidPitch) * par4; -+ float var6 = par1EntitySquid.prevSquidYaw + (par1EntitySquid.squidYaw - par1EntitySquid.prevSquidYaw) * par4; - GL11.glTranslatef(0.0F, 0.5F, 0.0F); -- GL11.glRotatef(180.0F - var3, 0.0F, 1.0F, 0.0F); -+ GL11.glRotatef(180.0F - par3, 0.0F, 1.0F, 0.0F); - GL11.glRotatef(var5, 1.0F, 0.0F, 0.0F); - GL11.glRotatef(var6, 0.0F, 1.0F, 0.0F); - GL11.glTranslatef(0.0F, -1.2F, 0.0F); - } - -- protected float handleRotationFloat(EntitySquid var1, float var2) { -- return var1.lastTentacleAngle + (var1.tentacleAngle - var1.lastTentacleAngle) * var2; -- } -- -- public void doRenderLiving(EntityLiving var1, double var2, double var4, double var6, float var8, float var9) { -- this.renderLivingSquid((EntitySquid)var1, var2, var4, var6, var8, var9); -- } -- -- protected float handleRotationFloat(EntityLivingBase var1, float var2) { -- return this.handleRotationFloat((EntitySquid)var1, var2); -- } -- -- protected void rotateCorpse(EntityLivingBase var1, float var2, float var3, float var4) { -- this.rotateSquidsCorpse((EntitySquid)var1, var2, var3, var4); -- } -- -- public void renderPlayer(EntityLivingBase var1, double var2, double var4, double var6, float var8, float var9) { -- this.renderLivingSquid((EntitySquid)var1, var2, var4, var6, var8, var9); -- } -- -- protected ResourceLocation getEntityTexture(Entity var1) { -- return this.getSquidTextures((EntitySquid)var1); -- } -- -- public void doRender(Entity var1, double var2, double var4, double var6, float var8, float var9) { -- this.renderLivingSquid((EntitySquid)var1, var2, var4, var6, var8, var9); -+ protected float handleRotationFloat(EntitySquid par1EntitySquid, float par2) { -+ return par1EntitySquid.prevTentacleAngle + (par1EntitySquid.tentacleAngle - par1EntitySquid.prevTentacleAngle) * par2; -+ } -+ -+ public void doRenderLiving(EntityLiving par1EntityLiving, double par2, double par4, double par6, float par8, float par9) { -+ this.renderLivingSquid((EntitySquid)par1EntityLiving, par2, par4, par6, par8, par9); -+ } -+ -+ /** -+ * Defines what float the third param in setRotationAngles of ModelBase is -+ */ -+ protected float handleRotationFloat(EntityLivingBase par1EntityLivingBase, float par2) { -+ return this.handleRotationFloat((EntitySquid)par1EntityLivingBase, par2); -+ } -+ -+ protected void rotateCorpse(EntityLivingBase par1EntityLivingBase, float par2, float par3, float par4) { -+ this.rotateSquidsCorpse((EntitySquid)par1EntityLivingBase, par2, par3, par4); -+ } -+ -+ public void renderPlayer(EntityLivingBase par1EntityLivingBase, double par2, double par4, double par6, float par8, float par9) { -+ this.renderLivingSquid((EntitySquid)par1EntityLivingBase, par2, par4, par6, par8, par9); -+ } -+ -+ /** -+ * Returns the location of an entity's texture. Doesn't seem to be called unless you call Render.bindEntityTexture. -+ */ -+ protected ResourceLocation getEntityTexture(Entity par1Entity) { -+ return this.getSquidTextures((EntitySquid)par1Entity); -+ } -+ -+ /** -+ * Actually renders the given argument. This is a synthetic bridge method, always casting down its argument and then -+ * handing it off to a worker function which does the actual work. In all probabilty, the class Render is generic -+ * (Render -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.client.gui.minimap; -+ -+import java.awt.image.BufferedImage; -+import java.awt.image.Raster; -+import java.util.LinkedList; -+ -+public class Map { -+ /** -+ * Used to track world changes and force a rerender when the world -+ * changes. -+ */ -+ public String lastRenderedWorld = ""; -+ -+ /** -+ * Used to track dimension changes and force a rerender when the dimension -+ * changes. -+ */ -+ public int lastRenderedDimension = 0; -+ -+ /** -+ * X coordinate of the player on last render -+ */ -+ private double playerX = Integer.MAX_VALUE; -+ -+ /** -+ * Z coordinate of the player on last render -+ */ -+ private double playerZ = Integer.MAX_VALUE; -+ -+ /** -+ * Zoom level currently rendering at at - used in case zoom changes in the -+ * middle of rendering a map frame -+ */ -+ public int zoom = -1; -+ -+ public boolean square; -+ -+ /** -+ * How many blocks to x+ to shift the map rendering from the origin of the -+ * center chunk -+ */ -+ public int originOffsetX = 0; -+ -+ /** -+ * How many blocks to z+ to shift the map rendering from the origin of the -+ * center chunk -+ */ -+ public int originOffsetY = 0; -+ -+ public int timer = 0; -+ -+ public int imageSize = 276 * 2; -+ -+ public int updatedist = 4; -+ -+ // Denotes the width or the diameter of a map -+ public static final int ZOOM_2 = 256; -+ public static final int ZOOM_1 = 128; -+ public static final int ZOOM_0 = 64; -+ -+ public int renderSize = 256; -+ -+ public int renderOff = 128; // Used instead of dividing renderSize by two -+ -+ /** -+ * Map image to which the map is rendered to. -+ */ -+ public final ImageManager colorimg; -+ -+ public final ImageManager heightimg; -+ -+ public final ImageManager lightimg; -+ -+ public LinkedList watchedEntities = new LinkedList(); -+ -+ public Map(int size) { -+ imageSize = size; -+ colorimg = new ImageManager(imageSize, imageSize, BufferedImage.TYPE_INT_ARGB); -+ heightimg = new ImageManager(imageSize, imageSize, BufferedImage.TYPE_INT_ARGB); -+ lightimg = new ImageManager(imageSize, imageSize, BufferedImage.TYPE_INT_ARGB); -+ } -+ -+ public Map() { -+ this(276 * 2); -+ } -+ -+ /** -+ * Take an array index and wrap it to the size of the array, properly -+ * dealing with negative values -+ * @param index index to wrap -+ * @param arraysize size of array to wrap to -+ * @return wrapped index -+ */ -+ private final int wrapIndex(int index, int arraysize) { -+ if (index < 0) { -+ return arraysize + ((index+1) % arraysize) - 1; -+ } else { -+ return index % arraysize; -+ } -+ } -+ -+ public final int toImageX(int worldz) { -+ return worldz; // return wrapIndex((int) (( -(worldz - playerZ)) + originOffsetX), imageSize); -+ } -+ -+ public final int toImageY(int worldx) { -+ return worldx; // return wrapIndex( (int) ((worldx - playerX) + originOffsetY), imageSize); -+ } -+ -+ public void setColorPixel(int worldx, int worldz, int color24) { -+ colorimg.setRGB(toImageX(worldz), toImageY(worldx), color24); -+ } -+ -+ public void clearColorPixel(int worldx, int worldz) { -+ colorimg.setARGB(toImageX(worldz), toImageY(worldx), 0); -+ } -+ -+ public void setHeightPixel(int worldx, int worldz, int height) { -+ heightimg.setRGB(toImageX(worldz), toImageY(worldx), height | height << 8 | height << 16); -+ } -+ -+ public void setLightPixel(int worldx, int worldz, int light) { -+ lightimg.setRGB(toImageX(worldz), toImageY(worldx), light | light << 8 | light << 16); -+ } -+ -+ public void loadColorImage() { -+ colorimg.loadGLImage(); -+ } -+ -+ public void loadHeightImage() { -+ heightimg.loadGLImage(); -+ } -+ -+ public void loadLightImage() { -+ lightimg.loadGLImage(); -+ } -+ -+ public Raster getColorRaster() { -+ return colorimg.image.getRaster(); -+ } -+ -+ public void clear() { -+ for (int i = 0; i < imageSize; i++) { -+ for (int j = 0; j < imageSize; j++) { -+ colorimg.setARGB(i, j, 0); -+ lightimg.setARGB(i, j, 0); -+ heightimg.setARGB(i, j, 0); -+ } -+ } -+ } -+ -+ public void update(double playerx, double playerz) { -+ this.playerX = playerx; -+ this.playerZ = playerz; -+ originOffsetX = wrapIndex((int) -this.playerZ, imageSize); -+ originOffsetY = wrapIndex((int) this.playerX, imageSize); -+ } -+ -+ public double getPlayerX() { -+ return playerX; -+ } -+ -+ public double getPlayerZ() { -+ return playerZ; -+ } -+ -+ public boolean isDirty(double newPlayerX, double newPlayerZ) { -+ return Math.abs(playerX - newPlayerX) > updatedist || Math.abs(playerZ - newPlayerZ) > updatedist || timer > 300 || zoom != MinimapConfig.getInstance().getZoom() || square != MinimapConfig.getInstance().isSquare(); -+ } -+ -+ public float getRenderScale() { -+ float displaydist = (float) (Math.pow(2, zoom) * 32); -+ return (float)imageSize / displaydist; -+ } -+ -+ /** -+ * @return -+ */ -+ public double getCurrOffsetX(double playerZ) { -+ double wrapped = wrapIndex(((int) -playerZ), imageSize); -+ double leftover = 0; // playerZ - ((double)(int)playerZ); -+ return (wrapped+leftover)/2; -+ } -+ public double getCurrOffsetY(double playerX) { -+ double wrapped = wrapIndex(((int) playerX), imageSize); -+ double leftover = 0; // playerX - ((double)(int)playerX); -+ return (wrapped+leftover)/2; -+ } -+} ---- net/minecraft/src/FlatGeneratorInfo.java -+++ net/minecraft/src/FlatGeneratorInfo.java -@@ -8,109 +8,125 @@ - import java.util.Map.Entry; - - public class FlatGeneratorInfo { -- private final List a = new ArrayList(); -- private final Map b = new HashMap(); -+ -+ /** List of layers on this preset. */ -+ private final List flatLayers = new ArrayList(); -+ -+ /** List of world features enabled on this preset. */ -+ private final Map worldFeatures = new HashMap(); - private int biomeToUse; - -+ /** -+ * Return the biome used on this preset. -+ */ - public int getBiome() { - return this.biomeToUse; - } - -- public void setBiome(int var1) { -- this.biomeToUse = var1; -+ /** -+ * Set the biome used on this preset. -+ */ -+ public void setBiome(int par1) { -+ this.biomeToUse = par1; - } - -+ /** -+ * Return the list of world features enabled on this preset. -+ */ - public Map getWorldFeatures() { -- return this.b; -+ return this.worldFeatures; - } - -+ /** -+ * Return the list of layers on this preset. -+ */ - public List getFlatLayers() { -- return this.a; -+ return this.flatLayers; - } - - public void func_82645_d() { - int var1 = 0; -- - FlatLayerInfo var3; -- for(Iterator var2 = this.a.iterator(); var2.hasNext(); var1 += var3.getLayerCount()) { -+ -+ for (Iterator var2 = this.flatLayers.iterator(); var2.hasNext(); var1 += var3.getLayerCount()) { - var3 = (FlatLayerInfo)var2.next(); - var3.setMinY(var1); - } -- - } - - public String toString() { - StringBuilder var1 = new StringBuilder(); - var1.append(2); - var1.append(";"); -- - int var2; -- for(var2 = 0; var2 < this.a.size(); ++var2) { -- if(var2 > 0) { -+ -+ for (var2 = 0; var2 < this.flatLayers.size(); ++var2) { -+ if (var2 > 0) { - var1.append(","); - } - -- var1.append(((FlatLayerInfo)this.a.get(var2)).toString()); -+ var1.append(((FlatLayerInfo)this.flatLayers.get(var2)).toString()); - } - - var1.append(";"); - var1.append(this.biomeToUse); -- if(!this.b.isEmpty()) { -+ -+ if (!this.worldFeatures.isEmpty()) { - var1.append(";"); - var2 = 0; -- Iterator var3 = this.b.entrySet().iterator(); -- -- while(true) { -- Map var5; -- do { -- if(!var3.hasNext()) { -- return var1.toString(); -- } -- -- Entry var4 = (Entry)var3.next(); -- if(var2++ > 0) { -- var1.append(","); -- } -- -- var1.append(((String)var4.getKey()).toLowerCase()); -- var5 = (Map)var4.getValue(); -- } while(var5.isEmpty()); -- -- var1.append("("); -- int var6 = 0; -- Iterator var7 = var5.entrySet().iterator(); -- -- while(var7.hasNext()) { -- Entry var8 = (Entry)var7.next(); -- if(var6++ > 0) { -- var1.append(" "); -- } -- -- var1.append((String)var8.getKey()); -- var1.append("="); -- var1.append((String)var8.getValue()); -- } -- -- var1.append(")"); -+ Iterator var3 = this.worldFeatures.entrySet().iterator(); -+ -+ while (var3.hasNext()) { -+ Entry var4 = (Entry)var3.next(); -+ -+ if (var2++ > 0) { -+ var1.append(","); -+ } -+ -+ var1.append(((String)var4.getKey()).toLowerCase()); -+ Map var5 = (Map)var4.getValue(); -+ -+ if (!var5.isEmpty()) { -+ var1.append("("); -+ int var6 = 0; -+ Iterator var7 = var5.entrySet().iterator(); -+ -+ while (var7.hasNext()) { -+ Entry var8 = (Entry)var7.next(); -+ -+ if (var6++ > 0) { -+ var1.append(" "); -+ } -+ -+ var1.append((String)var8.getKey()); -+ var1.append("="); -+ var1.append((String)var8.getValue()); -+ } -+ -+ var1.append(")"); -+ } - } - } else { - var1.append(";"); -- return var1.toString(); - } -+ -+ return var1.toString(); - } - -- private static FlatLayerInfo func_82646_a(String var0, int var1) { -- String[] var2 = var0.split("x", 2); -+ private static FlatLayerInfo func_82646_a(String par0Str, int par1) { -+ String[] var2 = par0Str.split("x", 2); - int var3 = 1; - int var5 = 0; -- if(var2.length == 2) { -+ -+ if (var2.length == 2) { - try { - var3 = Integer.parseInt(var2[0]); -- if(var1 + var3 >= 256) { -- var3 = 256 - var1; -+ -+ if (par1 + var3 >= 256) { -+ var3 = 256 - par1; - } - -- if(var3 < 0) { -+ if (var3 < 0) { - var3 = 0; - } - } catch (Throwable var7) { -@@ -119,20 +135,22 @@ - } - - int var4; -+ - try { - String var6 = var2[var2.length - 1]; - var2 = var6.split(":", 2); - var4 = Integer.parseInt(var2[0]); -- if(var2.length > 1) { -+ -+ if (var2.length > 1) { - var5 = Integer.parseInt(var2[1]); - } - -- if(Block.blocksList[var4] == null) { -+ if (Block.blocksList[var4] == null) { - var4 = 0; - var5 = 0; - } - -- if(var5 < 0 || var5 > 15) { -+ if (var5 < 0 || var5 > 15) { - var5 = 0; - } - } catch (Throwable var8) { -@@ -140,22 +158,23 @@ - } - - FlatLayerInfo var9 = new FlatLayerInfo(var3, var4, var5); -- var9.setMinY(var1); -+ var9.setMinY(par1); - return var9; - } - -- private static List func_82652_b(String var0) { -- if(var0 != null && var0.length() >= 1) { -+ private static List func_82652_b(String par0Str) { -+ if (par0Str != null && par0Str.length() >= 1) { - ArrayList var1 = new ArrayList(); -- String[] var2 = var0.split(","); -+ String[] var2 = par0Str.split(","); - int var3 = 0; - String[] var4 = var2; - int var5 = var2.length; - -- for(int var6 = 0; var6 < var5; ++var6) { -+ for (int var6 = 0; var6 < var5; ++var6) { - String var7 = var4[var6]; - FlatLayerInfo var8 = func_82646_a(var7, var3); -- if(var8 == null) { -+ -+ if (var8 == null) { - return null; - } - -@@ -169,42 +188,49 @@ - } - } - -- public static FlatGeneratorInfo createFlatGeneratorFromString(String var0) { -- if(var0 == null) { -+ public static FlatGeneratorInfo createFlatGeneratorFromString(String par0Str) { -+ if (par0Str == null) { - return getDefaultFlatGenerator(); - } else { -- String[] var1 = var0.split(";", -1); -+ String[] var1 = par0Str.split(";", -1); - int var2 = var1.length == 1 ? 0 : MathHelper.parseIntWithDefault(var1[0], 0); -- if(var2 >= 0 && var2 <= 2) { -+ -+ if (var2 >= 0 && var2 <= 2) { - FlatGeneratorInfo var3 = new FlatGeneratorInfo(); - int var4 = var1.length == 1 ? 0 : 1; - List var5 = func_82652_b(var1[var4++]); -- if(var5 != null && !var5.isEmpty()) { -+ -+ if (var5 != null && !var5.isEmpty()) { - var3.getFlatLayers().addAll(var5); - var3.func_82645_d(); - int var6 = BiomeGenBase.plains.biomeID; -- if(var2 > 0 && var1.length > var4) { -+ -+ if (var2 > 0 && var1.length > var4) { - var6 = MathHelper.parseIntWithDefault(var1[var4++], var6); - } - - var3.setBiome(var6); -- if(var2 > 0 && var1.length > var4) { -+ -+ if (var2 > 0 && var1.length > var4) { - String[] var7 = var1[var4++].toLowerCase().split(","); - String[] var8 = var7; - int var9 = var7.length; - -- for(int var10 = 0; var10 < var9; ++var10) { -+ for (int var10 = 0; var10 < var9; ++var10) { - String var11 = var8[var10]; - String[] var12 = var11.split("\\(", 2); - HashMap var13 = new HashMap(); -- if(var12[0].length() > 0) { -+ -+ if (var12[0].length() > 0) { - var3.getWorldFeatures().put(var12[0], var13); -- if(var12.length > 1 && var12[1].endsWith(")") && var12[1].length() > 1) { -+ -+ if (var12.length > 1 && var12[1].endsWith(")") && var12[1].length() > 1) { - String[] var14 = var12[1].substring(0, var12[1].length() - 1).split(" "); - -- for(int var15 = 0; var15 < var14.length; ++var15) { -+ for (int var15 = 0; var15 < var14.length; ++var15) { - String[] var16 = var14[var15].split("=", 2); -- if(var16.length == 2) { -+ -+ if (var16.length == 2) { - var13.put(var16[0], var16[1]); - } - } ---- /dev/null -+++ org/spoutcraft/api/Statistic.java -@@ -1,0 +1,76 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.api; -+ -+import java.util.HashMap; -+import java.util.Map; -+ -+public enum Statistic { -+ DAMAGE_DEALT(2020), -+ DAMAGE_TAKEN(2021), -+ DEATHS(2022), -+ MOB_KILLS(2023), -+ PLAYER_KILLS(2024), -+ FISH_CAUGHT(2025), -+ MINE_BLOCK(16777216, true), -+ USE_ITEM(6908288, false), -+ BREAK_ITEM(16973824, true); -+ -+ private final static Map statistics = new HashMap(); -+ private final int id; -+ private final boolean isSubstat; -+ private final boolean isBlock; -+ -+ private Statistic(int id) { -+ this(id, false, false); -+ } -+ -+ private Statistic(int id, boolean isBlock) { -+ this(id, true, isBlock); -+ } -+ -+ private Statistic(int id, boolean isSubstat, boolean isBlock) { -+ this.id = id; -+ this.isSubstat = isSubstat; -+ this.isBlock = isBlock; -+ } -+ -+ public int getId() { -+ return id; -+ } -+ -+ public boolean isSubstatistic() { -+ return isSubstat; -+ } -+ -+ public boolean isBlock() { -+ return isSubstat && isBlock; -+ } -+ -+ public static Statistic getStatistic(int id) { -+ return statistics.get(id); -+ } -+ -+ static { -+ for (Statistic stat : values()) { -+ statistics.put(stat.getId(), stat); -+ } -+ } -+} ---- net/minecraft/src/BlockRedstoneWire.java -+++ net/minecraft/src/BlockRedstoneWire.java -@@ -5,355 +5,465 @@ - import java.util.Random; - import java.util.Set; - -+import com.prupe.mcpatcher.cc.ColorizeBlock; -+import com.prupe.mcpatcher.cc.Colorizer; -+ - public class BlockRedstoneWire extends Block { -+ -+ /** -+ * When false, power transmission methods do not look at other redstone wires. Used internally during -+ * updateCurrentStrength. -+ */ - private boolean wiresProvidePower = true; -- private Set b = new HashSet(); -+ private Set blocksNeedingUpdate = new HashSet(); - private Icon field_94413_c; - private Icon field_94410_cO; - private Icon field_94411_cP; - private Icon field_94412_cQ; - -- public BlockRedstoneWire(int var1) { -- super(var1, Material.circuits); -- this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F / 16.0F, 1.0F); -+ public BlockRedstoneWire(int par1) { -+ super(par1, Material.circuits); -+ this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.0625F, 1.0F); - } - -- public AxisAlignedBB getCollisionBoundingBoxFromPool(World var1, int var2, int var3, int var4) { -+ /** -+ * Returns a bounding box from the pool of bounding boxes (this means this box can change after the pool has been -+ * cleared to be reused) -+ */ -+ public AxisAlignedBB getCollisionBoundingBoxFromPool(World par1World, int par2, int par3, int par4) { - return null; - } - -+ /** -+ * Is this block (a) opaque and (b) a full 1m cube? This determines whether or not to render the shared face of two -+ * adjacent blocks and also whether the player can attach torches, redstone wire, etc to this block. -+ */ - public boolean isOpaqueCube() { - return false; - } - -+ /** -+ * If this block doesn't render as an ordinary block it will return False (examples: signs, buttons, stairs, etc) -+ */ - public boolean renderAsNormalBlock() { - return false; - } - -+ /** -+ * The type of render function that is called for this block -+ */ - public int getRenderType() { - return 5; - } - -- public int colorMultiplier(IBlockAccess var1, int var2, int var3, int var4) { -- return 8388608; -- } -- -- public boolean canPlaceBlockAt(World var1, int var2, int var3, int var4) { -- return var1.doesBlockHaveSolidTopSurface(var2, var3 - 1, var4) || var1.getBlockId(var2, var3 - 1, var4) == Block.glowStone.blockID; -- } -- -- private void updateAndPropagateCurrentStrength(World var1, int var2, int var3, int var4) { -- this.calculateCurrentChanges(var1, var2, var3, var4, var2, var3, var4); -- ArrayList var5 = new ArrayList(this.b); -- this.b.clear(); -- -- for(int var6 = 0; var6 < var5.size(); ++var6) { -+ /** -+ * Returns a integer with hex for 0xrrggbb with this color multiplied against the blocks color. Note only called when -+ * first determining what to render. -+ */ -+ public int colorMultiplier(IBlockAccess par1IBlockAccess, int par2, int par3, int par4) { -+ // MCPatcher Start -+ return ColorizeBlock.colorizeRedstoneWire(par1IBlockAccess, par2, par3, par4, 8388608); -+ // MCPatcher End -+ } -+ -+ /** -+ * Checks to see if its valid to put this block at the specified coordinates. Args: world, x, y, z -+ */ -+ public boolean canPlaceBlockAt(World par1World, int par2, int par3, int par4) { -+ return par1World.doesBlockHaveSolidTopSurface(par2, par3 - 1, par4) || par1World.getBlockId(par2, par3 - 1, par4) == Block.glowStone.blockID; -+ } -+ -+ /** -+ * Sets the strength of the wire current (0-15) for this block based on neighboring blocks and propagates to -+ * neighboring redstone wires -+ */ -+ private void updateAndPropagateCurrentStrength(World par1World, int par2, int par3, int par4) { -+ this.calculateCurrentChanges(par1World, par2, par3, par4, par2, par3, par4); -+ ArrayList var5 = new ArrayList(this.blocksNeedingUpdate); -+ this.blocksNeedingUpdate.clear(); -+ -+ for (int var6 = 0; var6 < var5.size(); ++var6) { - ChunkPosition var7 = (ChunkPosition)var5.get(var6); -- var1.notifyBlocksOfNeighborChange(var7.x, var7.y, var7.z, this.blockID); -+ par1World.notifyBlocksOfNeighborChange(var7.x, var7.y, var7.z, this.blockID); - } -- - } - -- private void calculateCurrentChanges(World var1, int var2, int var3, int var4, int var5, int var6, int var7) { -- int var8 = var1.getBlockMetadata(var2, var3, var4); -+ private void calculateCurrentChanges(World par1World, int par2, int par3, int par4, int par5, int par6, int par7) { -+ int var8 = par1World.getBlockMetadata(par2, par3, par4); - byte var9 = 0; -- int var15 = this.getMaxCurrentStrength(var1, var5, var6, var7, var9); -+ int var15 = this.getMaxCurrentStrength(par1World, par5, par6, par7, var9); - this.wiresProvidePower = false; -- int var10 = var1.getStrongestIndirectPower(var2, var3, var4); -+ int var10 = par1World.getStrongestIndirectPower(par2, par3, par4); - this.wiresProvidePower = true; -- if(var10 > 0 && var10 > var15 - 1) { -+ -+ if (var10 > 0 && var10 > var15 - 1) { - var15 = var10; - } - - int var11 = 0; - -- for(int var12 = 0; var12 < 4; ++var12) { -- int var13 = var2; -- int var14 = var4; -- if(var12 == 0) { -- var13 = var2 - 1; -+ for (int var12 = 0; var12 < 4; ++var12) { -+ int var13 = par2; -+ int var14 = par4; -+ -+ if (var12 == 0) { -+ var13 = par2 - 1; - } - -- if(var12 == 1) { -+ if (var12 == 1) { - ++var13; - } - -- if(var12 == 2) { -- var14 = var4 - 1; -+ if (var12 == 2) { -+ var14 = par4 - 1; - } - -- if(var12 == 3) { -+ if (var12 == 3) { - ++var14; - } - -- if(var13 != var5 || var14 != var7) { -- var11 = this.getMaxCurrentStrength(var1, var13, var3, var14, var11); -+ if (var13 != par5 || var14 != par7) { -+ var11 = this.getMaxCurrentStrength(par1World, var13, par3, var14, var11); - } - -- if(var1.isBlockNormalCube(var13, var3, var14) && !var1.isBlockNormalCube(var2, var3 + 1, var4)) { -- if((var13 != var5 || var14 != var7) && var3 >= var6) { -- var11 = this.getMaxCurrentStrength(var1, var13, var3 + 1, var14, var11); -+ if (par1World.isBlockNormalCube(var13, par3, var14) && !par1World.isBlockNormalCube(par2, par3 + 1, par4)) { -+ if ((var13 != par5 || var14 != par7) && par3 >= par6) { -+ var11 = this.getMaxCurrentStrength(par1World, var13, par3 + 1, var14, var11); - } -- } else if(!var1.isBlockNormalCube(var13, var3, var14) && (var13 != var5 || var14 != var7) && var3 <= var6) { -- var11 = this.getMaxCurrentStrength(var1, var13, var3 - 1, var14, var11); -+ } else if (!par1World.isBlockNormalCube(var13, par3, var14) && (var13 != par5 || var14 != par7) && par3 <= par6) { -+ var11 = this.getMaxCurrentStrength(par1World, var13, par3 - 1, var14, var11); - } - } - -- if(var11 > var15) { -+ if (var11 > var15) { - var15 = var11 - 1; -- } else if(var15 > 0) { -+ } else if (var15 > 0) { - --var15; - } else { - var15 = 0; - } - -- if(var10 > var15 - 1) { -+ if (var10 > var15 - 1) { - var15 = var10; - } - -- if(var8 != var15) { -- var1.setBlockMetadata(var2, var3, var4, var15, 2); -- this.b.add(new ChunkPosition(var2, var3, var4)); -- this.b.add(new ChunkPosition(var2 - 1, var3, var4)); -- this.b.add(new ChunkPosition(var2 + 1, var3, var4)); -- this.b.add(new ChunkPosition(var2, var3 - 1, var4)); -- this.b.add(new ChunkPosition(var2, var3 + 1, var4)); -- this.b.add(new ChunkPosition(var2, var3, var4 - 1)); -- this.b.add(new ChunkPosition(var2, var3, var4 + 1)); -- } -- -- } -- -- private void notifyWireNeighborsOfNeighborChange(World var1, int var2, int var3, int var4) { -- if(var1.getBlockId(var2, var3, var4) == this.blockID) { -- var1.notifyBlocksOfNeighborChange(var2, var3, var4, this.blockID); -- var1.notifyBlocksOfNeighborChange(var2 - 1, var3, var4, this.blockID); -- var1.notifyBlocksOfNeighborChange(var2 + 1, var3, var4, this.blockID); -- var1.notifyBlocksOfNeighborChange(var2, var3, var4 - 1, this.blockID); -- var1.notifyBlocksOfNeighborChange(var2, var3, var4 + 1, this.blockID); -- var1.notifyBlocksOfNeighborChange(var2, var3 - 1, var4, this.blockID); -- var1.notifyBlocksOfNeighborChange(var2, var3 + 1, var4, this.blockID); -- } -- } -- -- public void onBlockAdded(World var1, int var2, int var3, int var4) { -- super.onBlockAdded(var1, var2, var3, var4); -- if(!var1.isRemote) { -- this.updateAndPropagateCurrentStrength(var1, var2, var3, var4); -- var1.notifyBlocksOfNeighborChange(var2, var3 + 1, var4, this.blockID); -- var1.notifyBlocksOfNeighborChange(var2, var3 - 1, var4, this.blockID); -- this.notifyWireNeighborsOfNeighborChange(var1, var2 - 1, var3, var4); -- this.notifyWireNeighborsOfNeighborChange(var1, var2 + 1, var3, var4); -- this.notifyWireNeighborsOfNeighborChange(var1, var2, var3, var4 - 1); -- this.notifyWireNeighborsOfNeighborChange(var1, var2, var3, var4 + 1); -- if(var1.isBlockNormalCube(var2 - 1, var3, var4)) { -- this.notifyWireNeighborsOfNeighborChange(var1, var2 - 1, var3 + 1, var4); -- } else { -- this.notifyWireNeighborsOfNeighborChange(var1, var2 - 1, var3 - 1, var4); -- } -- -- if(var1.isBlockNormalCube(var2 + 1, var3, var4)) { -- this.notifyWireNeighborsOfNeighborChange(var1, var2 + 1, var3 + 1, var4); -- } else { -- this.notifyWireNeighborsOfNeighborChange(var1, var2 + 1, var3 - 1, var4); -- } -- -- if(var1.isBlockNormalCube(var2, var3, var4 - 1)) { -- this.notifyWireNeighborsOfNeighborChange(var1, var2, var3 + 1, var4 - 1); -- } else { -- this.notifyWireNeighborsOfNeighborChange(var1, var2, var3 - 1, var4 - 1); -- } -- -- if(var1.isBlockNormalCube(var2, var3, var4 + 1)) { -- this.notifyWireNeighborsOfNeighborChange(var1, var2, var3 + 1, var4 + 1); -- } else { -- this.notifyWireNeighborsOfNeighborChange(var1, var2, var3 - 1, var4 + 1); -- } -- -- } -- } -- -- public void breakBlock(World var1, int var2, int var3, int var4, int var5, int var6) { -- super.breakBlock(var1, var2, var3, var4, var5, var6); -- if(!var1.isRemote) { -- var1.notifyBlocksOfNeighborChange(var2, var3 + 1, var4, this.blockID); -- var1.notifyBlocksOfNeighborChange(var2, var3 - 1, var4, this.blockID); -- var1.notifyBlocksOfNeighborChange(var2 + 1, var3, var4, this.blockID); -- var1.notifyBlocksOfNeighborChange(var2 - 1, var3, var4, this.blockID); -- var1.notifyBlocksOfNeighborChange(var2, var3, var4 + 1, this.blockID); -- var1.notifyBlocksOfNeighborChange(var2, var3, var4 - 1, this.blockID); -- this.updateAndPropagateCurrentStrength(var1, var2, var3, var4); -- this.notifyWireNeighborsOfNeighborChange(var1, var2 - 1, var3, var4); -- this.notifyWireNeighborsOfNeighborChange(var1, var2 + 1, var3, var4); -- this.notifyWireNeighborsOfNeighborChange(var1, var2, var3, var4 - 1); -- this.notifyWireNeighborsOfNeighborChange(var1, var2, var3, var4 + 1); -- if(var1.isBlockNormalCube(var2 - 1, var3, var4)) { -- this.notifyWireNeighborsOfNeighborChange(var1, var2 - 1, var3 + 1, var4); -- } else { -- this.notifyWireNeighborsOfNeighborChange(var1, var2 - 1, var3 - 1, var4); -- } -- -- if(var1.isBlockNormalCube(var2 + 1, var3, var4)) { -- this.notifyWireNeighborsOfNeighborChange(var1, var2 + 1, var3 + 1, var4); -- } else { -- this.notifyWireNeighborsOfNeighborChange(var1, var2 + 1, var3 - 1, var4); -- } -- -- if(var1.isBlockNormalCube(var2, var3, var4 - 1)) { -- this.notifyWireNeighborsOfNeighborChange(var1, var2, var3 + 1, var4 - 1); -- } else { -- this.notifyWireNeighborsOfNeighborChange(var1, var2, var3 - 1, var4 - 1); -- } -- -- if(var1.isBlockNormalCube(var2, var3, var4 + 1)) { -- this.notifyWireNeighborsOfNeighborChange(var1, var2, var3 + 1, var4 + 1); -- } else { -- this.notifyWireNeighborsOfNeighborChange(var1, var2, var3 - 1, var4 + 1); -- } -- -- } -- } -- -- private int getMaxCurrentStrength(World var1, int var2, int var3, int var4, int var5) { -- if(var1.getBlockId(var2, var3, var4) != this.blockID) { -- return var5; -+ if (var8 != var15) { -+ par1World.setBlockMetadataWithNotify(par2, par3, par4, var15, 2); -+ this.blocksNeedingUpdate.add(new ChunkPosition(par2, par3, par4)); -+ this.blocksNeedingUpdate.add(new ChunkPosition(par2 - 1, par3, par4)); -+ this.blocksNeedingUpdate.add(new ChunkPosition(par2 + 1, par3, par4)); -+ this.blocksNeedingUpdate.add(new ChunkPosition(par2, par3 - 1, par4)); -+ this.blocksNeedingUpdate.add(new ChunkPosition(par2, par3 + 1, par4)); -+ this.blocksNeedingUpdate.add(new ChunkPosition(par2, par3, par4 - 1)); -+ this.blocksNeedingUpdate.add(new ChunkPosition(par2, par3, par4 + 1)); -+ } -+ } -+ -+ /** -+ * Calls World.notifyBlocksOfNeighborChange() for all neighboring blocks, but only if the given block is a redstone -+ * wire. -+ */ -+ private void notifyWireNeighborsOfNeighborChange(World par1World, int par2, int par3, int par4) { -+ if (par1World.getBlockId(par2, par3, par4) == this.blockID) { -+ par1World.notifyBlocksOfNeighborChange(par2, par3, par4, this.blockID); -+ par1World.notifyBlocksOfNeighborChange(par2 - 1, par3, par4, this.blockID); -+ par1World.notifyBlocksOfNeighborChange(par2 + 1, par3, par4, this.blockID); -+ par1World.notifyBlocksOfNeighborChange(par2, par3, par4 - 1, this.blockID); -+ par1World.notifyBlocksOfNeighborChange(par2, par3, par4 + 1, this.blockID); -+ par1World.notifyBlocksOfNeighborChange(par2, par3 - 1, par4, this.blockID); -+ par1World.notifyBlocksOfNeighborChange(par2, par3 + 1, par4, this.blockID); -+ } -+ } -+ -+ /** -+ * Called whenever the block is added into the world. Args: world, x, y, z -+ */ -+ public void onBlockAdded(World par1World, int par2, int par3, int par4) { -+ super.onBlockAdded(par1World, par2, par3, par4); -+ -+ if (!par1World.isRemote) { -+ this.updateAndPropagateCurrentStrength(par1World, par2, par3, par4); -+ par1World.notifyBlocksOfNeighborChange(par2, par3 + 1, par4, this.blockID); -+ par1World.notifyBlocksOfNeighborChange(par2, par3 - 1, par4, this.blockID); -+ this.notifyWireNeighborsOfNeighborChange(par1World, par2 - 1, par3, par4); -+ this.notifyWireNeighborsOfNeighborChange(par1World, par2 + 1, par3, par4); -+ this.notifyWireNeighborsOfNeighborChange(par1World, par2, par3, par4 - 1); -+ this.notifyWireNeighborsOfNeighborChange(par1World, par2, par3, par4 + 1); -+ -+ if (par1World.isBlockNormalCube(par2 - 1, par3, par4)) { -+ this.notifyWireNeighborsOfNeighborChange(par1World, par2 - 1, par3 + 1, par4); -+ } else { -+ this.notifyWireNeighborsOfNeighborChange(par1World, par2 - 1, par3 - 1, par4); -+ } -+ -+ if (par1World.isBlockNormalCube(par2 + 1, par3, par4)) { -+ this.notifyWireNeighborsOfNeighborChange(par1World, par2 + 1, par3 + 1, par4); -+ } else { -+ this.notifyWireNeighborsOfNeighborChange(par1World, par2 + 1, par3 - 1, par4); -+ } -+ -+ if (par1World.isBlockNormalCube(par2, par3, par4 - 1)) { -+ this.notifyWireNeighborsOfNeighborChange(par1World, par2, par3 + 1, par4 - 1); -+ } else { -+ this.notifyWireNeighborsOfNeighborChange(par1World, par2, par3 - 1, par4 - 1); -+ } -+ -+ if (par1World.isBlockNormalCube(par2, par3, par4 + 1)) { -+ this.notifyWireNeighborsOfNeighborChange(par1World, par2, par3 + 1, par4 + 1); -+ } else { -+ this.notifyWireNeighborsOfNeighborChange(par1World, par2, par3 - 1, par4 + 1); -+ } -+ } -+ } -+ -+ /** -+ * Called on server worlds only when the block has been replaced by a different block ID, or the same block with a -+ * different metadata value, but before the new metadata value is set. Args: World, x, y, z, old block ID, old metadata -+ */ -+ public void breakBlock(World par1World, int par2, int par3, int par4, int par5, int par6) { -+ super.breakBlock(par1World, par2, par3, par4, par5, par6); -+ -+ if (!par1World.isRemote) { -+ par1World.notifyBlocksOfNeighborChange(par2, par3 + 1, par4, this.blockID); -+ par1World.notifyBlocksOfNeighborChange(par2, par3 - 1, par4, this.blockID); -+ par1World.notifyBlocksOfNeighborChange(par2 + 1, par3, par4, this.blockID); -+ par1World.notifyBlocksOfNeighborChange(par2 - 1, par3, par4, this.blockID); -+ par1World.notifyBlocksOfNeighborChange(par2, par3, par4 + 1, this.blockID); -+ par1World.notifyBlocksOfNeighborChange(par2, par3, par4 - 1, this.blockID); -+ this.updateAndPropagateCurrentStrength(par1World, par2, par3, par4); -+ this.notifyWireNeighborsOfNeighborChange(par1World, par2 - 1, par3, par4); -+ this.notifyWireNeighborsOfNeighborChange(par1World, par2 + 1, par3, par4); -+ this.notifyWireNeighborsOfNeighborChange(par1World, par2, par3, par4 - 1); -+ this.notifyWireNeighborsOfNeighborChange(par1World, par2, par3, par4 + 1); -+ -+ if (par1World.isBlockNormalCube(par2 - 1, par3, par4)) { -+ this.notifyWireNeighborsOfNeighborChange(par1World, par2 - 1, par3 + 1, par4); -+ } else { -+ this.notifyWireNeighborsOfNeighborChange(par1World, par2 - 1, par3 - 1, par4); -+ } -+ -+ if (par1World.isBlockNormalCube(par2 + 1, par3, par4)) { -+ this.notifyWireNeighborsOfNeighborChange(par1World, par2 + 1, par3 + 1, par4); -+ } else { -+ this.notifyWireNeighborsOfNeighborChange(par1World, par2 + 1, par3 - 1, par4); -+ } -+ -+ if (par1World.isBlockNormalCube(par2, par3, par4 - 1)) { -+ this.notifyWireNeighborsOfNeighborChange(par1World, par2, par3 + 1, par4 - 1); -+ } else { -+ this.notifyWireNeighborsOfNeighborChange(par1World, par2, par3 - 1, par4 - 1); -+ } -+ -+ if (par1World.isBlockNormalCube(par2, par3, par4 + 1)) { -+ this.notifyWireNeighborsOfNeighborChange(par1World, par2, par3 + 1, par4 + 1); -+ } else { -+ this.notifyWireNeighborsOfNeighborChange(par1World, par2, par3 - 1, par4 + 1); -+ } -+ } -+ } -+ -+ /** -+ * Returns the current strength at the specified block if it is greater than the passed value, or the passed value -+ * otherwise. Signature: (world, x, y, z, strength) -+ */ -+ // Spout Start - private to public -+ public int getMaxCurrentStrength(World par1World, int par2, int par3, int par4, int par5) { -+ // Spout End -+ if (par1World.getBlockId(par2, par3, par4) != this.blockID) { -+ return par5; - } else { -- int var6 = var1.getBlockMetadata(var2, var3, var4); -- return var6 > var5 ? var6 : var5; -+ int var6 = par1World.getBlockMetadata(par2, par3, par4); -+ return var6 > par5 ? var6 : par5; - } - } - -- public void onNeighborBlockChange(World var1, int var2, int var3, int var4, int var5) { -- if(!var1.isRemote) { -- boolean var6 = this.canPlaceBlockAt(var1, var2, var3, var4); -- if(var6) { -- this.updateAndPropagateCurrentStrength(var1, var2, var3, var4); -+ /** -+ * Lets the block know when one of its neighbor changes. Doesn't know which neighbor changed (coordinates passed are -+ * their own) Args: x, y, z, neighbor blockID -+ */ -+ public void onNeighborBlockChange(World par1World, int par2, int par3, int par4, int par5) { -+ if (!par1World.isRemote) { -+ boolean var6 = this.canPlaceBlockAt(par1World, par2, par3, par4); -+ -+ if (var6) { -+ this.updateAndPropagateCurrentStrength(par1World, par2, par3, par4); - } else { -- this.dropBlockAsItem(var1, var2, var3, var4, 0, 0); -- var1.setBlockToAir(var2, var3, var4); -+ this.dropBlockAsItem(par1World, par2, par3, par4, 0, 0); -+ par1World.setBlockToAir(par2, par3, par4); - } - -- super.onNeighborBlockChange(var1, var2, var3, var4, var5); -+ super.onNeighborBlockChange(par1World, par2, par3, par4, par5); - } - } - -- public int idDropped(int var1, Random var2, int var3) { -+ /** -+ * Returns the ID of the items to drop on destruction. -+ */ -+ public int idDropped(int par1, Random par2Random, int par3) { - return Item.redstone.itemID; - } - -- public int isProvidingStrongPower(IBlockAccess var1, int var2, int var3, int var4, int var5) { -- return !this.wiresProvidePower ? 0 : this.isProvidingWeakPower(var1, var2, var3, var4, var5); -+ /** -+ * Returns true if the block is emitting direct/strong redstone power on the specified side. Args: World, X, Y, Z, -+ * side. Note that the side is reversed - eg it is 1 (up) when checking the bottom of the block. -+ */ -+ public int isProvidingStrongPower(IBlockAccess par1IBlockAccess, int par2, int par3, int par4, int par5) { -+ return !this.wiresProvidePower ? 0 : this.isProvidingWeakPower(par1IBlockAccess, par2, par3, par4, par5); - } - -- public int isProvidingWeakPower(IBlockAccess var1, int var2, int var3, int var4, int var5) { -- if(!this.wiresProvidePower) { -+ /** -+ * Returns true if the block is emitting indirect/weak redstone power on the specified side. If isBlockNormalCube -+ * returns true, standard redstone propagation rules will apply instead and this will not be called. Args: World, X, Y, -+ * Z, side. Note that the side is reversed - eg it is 1 (up) when checking the bottom of the block. -+ */ -+ public int isProvidingWeakPower(IBlockAccess par1IBlockAccess, int par2, int par3, int par4, int par5) { -+ if (!this.wiresProvidePower) { - return 0; - } else { -- int var6 = var1.getBlockMetadata(var2, var3, var4); -- if(var6 == 0) { -+ int var6 = par1IBlockAccess.getBlockMetadata(par2, par3, par4); -+ -+ if (var6 == 0) { - return 0; -- } else if(var5 == 1) { -+ } else if (par5 == 1) { - return var6; - } else { -- boolean var7 = isPoweredOrRepeater(var1, var2 - 1, var3, var4, 1) || !var1.isBlockNormalCube(var2 - 1, var3, var4) && isPoweredOrRepeater(var1, var2 - 1, var3 - 1, var4, -1); -- boolean var8 = isPoweredOrRepeater(var1, var2 + 1, var3, var4, 3) || !var1.isBlockNormalCube(var2 + 1, var3, var4) && isPoweredOrRepeater(var1, var2 + 1, var3 - 1, var4, -1); -- boolean var9 = isPoweredOrRepeater(var1, var2, var3, var4 - 1, 2) || !var1.isBlockNormalCube(var2, var3, var4 - 1) && isPoweredOrRepeater(var1, var2, var3 - 1, var4 - 1, -1); -- boolean var10 = isPoweredOrRepeater(var1, var2, var3, var4 + 1, 0) || !var1.isBlockNormalCube(var2, var3, var4 + 1) && isPoweredOrRepeater(var1, var2, var3 - 1, var4 + 1, -1); -- if(!var1.isBlockNormalCube(var2, var3 + 1, var4)) { -- if(var1.isBlockNormalCube(var2 - 1, var3, var4) && isPoweredOrRepeater(var1, var2 - 1, var3 + 1, var4, -1)) { -+ boolean var7 = isPoweredOrRepeater(par1IBlockAccess, par2 - 1, par3, par4, 1) || !par1IBlockAccess.isBlockNormalCube(par2 - 1, par3, par4) && isPoweredOrRepeater(par1IBlockAccess, par2 - 1, par3 - 1, par4, -1); -+ boolean var8 = isPoweredOrRepeater(par1IBlockAccess, par2 + 1, par3, par4, 3) || !par1IBlockAccess.isBlockNormalCube(par2 + 1, par3, par4) && isPoweredOrRepeater(par1IBlockAccess, par2 + 1, par3 - 1, par4, -1); -+ boolean var9 = isPoweredOrRepeater(par1IBlockAccess, par2, par3, par4 - 1, 2) || !par1IBlockAccess.isBlockNormalCube(par2, par3, par4 - 1) && isPoweredOrRepeater(par1IBlockAccess, par2, par3 - 1, par4 - 1, -1); -+ boolean var10 = isPoweredOrRepeater(par1IBlockAccess, par2, par3, par4 + 1, 0) || !par1IBlockAccess.isBlockNormalCube(par2, par3, par4 + 1) && isPoweredOrRepeater(par1IBlockAccess, par2, par3 - 1, par4 + 1, -1); -+ -+ if (!par1IBlockAccess.isBlockNormalCube(par2, par3 + 1, par4)) { -+ if (par1IBlockAccess.isBlockNormalCube(par2 - 1, par3, par4) && isPoweredOrRepeater(par1IBlockAccess, par2 - 1, par3 + 1, par4, -1)) { - var7 = true; - } - -- if(var1.isBlockNormalCube(var2 + 1, var3, var4) && isPoweredOrRepeater(var1, var2 + 1, var3 + 1, var4, -1)) { -+ if (par1IBlockAccess.isBlockNormalCube(par2 + 1, par3, par4) && isPoweredOrRepeater(par1IBlockAccess, par2 + 1, par3 + 1, par4, -1)) { - var8 = true; - } - -- if(var1.isBlockNormalCube(var2, var3, var4 - 1) && isPoweredOrRepeater(var1, var2, var3 + 1, var4 - 1, -1)) { -+ if (par1IBlockAccess.isBlockNormalCube(par2, par3, par4 - 1) && isPoweredOrRepeater(par1IBlockAccess, par2, par3 + 1, par4 - 1, -1)) { - var9 = true; - } - -- if(var1.isBlockNormalCube(var2, var3, var4 + 1) && isPoweredOrRepeater(var1, var2, var3 + 1, var4 + 1, -1)) { -+ if (par1IBlockAccess.isBlockNormalCube(par2, par3, par4 + 1) && isPoweredOrRepeater(par1IBlockAccess, par2, par3 + 1, par4 + 1, -1)) { - var10 = true; - } - } - -- return !var9 && !var8 && !var7 && !var10 && var5 >= 2 && var5 <= 5 ? var6 : (var5 == 2 && var9 && !var7 && !var8 ? var6 : (var5 == 3 && var10 && !var7 && !var8 ? var6 : (var5 == 4 && var7 && !var9 && !var10 ? var6 : (var5 == 5 && var8 && !var9 && !var10 ? var6 : 0)))); -+ return !var9 && !var8 && !var7 && !var10 && par5 >= 2 && par5 <= 5 ? var6 : (par5 == 2 && var9 && !var7 && !var8 ? var6 : (par5 == 3 && var10 && !var7 && !var8 ? var6 : (par5 == 4 && var7 && !var9 && !var10 ? var6 : (par5 == 5 && var8 && !var9 && !var10 ? var6 : 0)))); - } - } - } - -+ /** -+ * Can this block provide power. Only wire currently seems to have this change based on its state. -+ */ - public boolean canProvidePower() { - return this.wiresProvidePower; - } - -- public void randomDisplayTick(World var1, int var2, int var3, int var4, Random var5) { -- int var6 = var1.getBlockMetadata(var2, var3, var4); -- if(var6 > 0) { -- double var7 = (double)var2 + 0.5D + ((double)var5.nextFloat() - 0.5D) * 0.2D; -- double var9 = (double)((float)var3 + 1.0F / 16.0F); -- double var11 = (double)var4 + 0.5D + ((double)var5.nextFloat() - 0.5D) * 0.2D; -- float var13 = (float)var6 / 15.0F; -- float var14 = var13 * 0.6F + 0.4F; -- if(var6 == 0) { -- var14 = 0.0F; -+ /** -+ * A randomly called display update to be able to add particles or other items for display -+ */ -+ public void randomDisplayTick(World par1World, int par2, int par3, int par4, Random par5Random) { -+ int var6 = par1World.getBlockMetadata(par2, par3, par4); -+ -+ if (var6 > 0) { -+ double var7 = (double)par2 + 0.5D + ((double)par5Random.nextFloat() - 0.5D) * 0.2D; -+ double var9 = (double)((float)par3 + 0.0625F); -+ double var11 = (double)par4 + 0.5D + ((double)par5Random.nextFloat() - 0.5D) * 0.2D; -+ // MCPatcher Start -+ float var16; -+ float var14; -+ float var15; -+ -+ if (ColorizeBlock.computeRedstoneWireColor(var6)) { -+ var14 = Colorizer.setColor[0]; -+ var15 = Colorizer.setColor[1]; -+ var16 = Colorizer.setColor[2]; -+ } else { -+ float var13 = (float)var6 / 15.0F; -+ var14 = var13 * 0.6F + 0.4F; -+ -+ if (var6 == 0) { -+ var14 = 0.0F; -+ } -+ -+ var15 = var13 * var13 * 0.7F - 0.5F; -+ var16 = var13 * var13 * 0.6F - 0.7F; - } -+ // MCPatcher End - -- float var15 = var13 * var13 * 0.7F - 0.5F; -- float var16 = var13 * var13 * 0.6F - 0.7F; -- if(var15 < 0.0F) { -+ if (var15 < 0.0F) { - var15 = 0.0F; - } - -- if(var16 < 0.0F) { -+ if (var16 < 0.0F) { - var16 = 0.0F; - } - -- var1.spawnParticle("reddust", var7, var9, var11, (double)var14, (double)var15, (double)var16); -+ par1World.spawnParticle("reddust", var7, var9, var11, (double)var14, (double)var15, (double)var16); - } -- - } - -- public static boolean isPowerProviderOrWire(IBlockAccess var0, int var1, int var2, int var3, int var4) { -- int var5 = var0.getBlockId(var1, var2, var3); -- if(var5 == Block.redstoneWire.blockID) { -+ /** -+ * Returns true if redstone wire can connect to the specified block. Params: World, X, Y, Z, side (not a normal notch- -+ * side, this can be 0, 1, 2, 3 or -1) -+ */ -+ public static boolean isPowerProviderOrWire(IBlockAccess par0IBlockAccess, int par1, int par2, int par3, int par4) { -+ int var5 = par0IBlockAccess.getBlockId(par1, par2, par3); -+ -+ if (var5 == Block.redstoneWire.blockID) { - return true; -- } else if(var5 == 0) { -+ } else if (var5 == 0) { - return false; -- } else if(!Block.redstoneRepeaterIdle.func_94487_f(var5)) { -- return Block.blocksList[var5].canProvidePower() && var4 != -1; -+ } else if (!Block.redstoneRepeaterIdle.func_94487_f(var5)) { -+ return Block.blocksList[var5].canProvidePower() && par4 != -1; - } else { -- int var6 = var0.getBlockMetadata(var1, var2, var3); -- return var4 == (var6 & 3) || var4 == Direction.rotateOpposite[var6 & 3]; -+ int var6 = par0IBlockAccess.getBlockMetadata(par1, par2, par3); -+ return par4 == (var6 & 3) || par4 == Direction.rotateOpposite[var6 & 3]; - } - } - -- public static boolean isPoweredOrRepeater(IBlockAccess var0, int var1, int var2, int var3, int var4) { -- if(isPowerProviderOrWire(var0, var1, var2, var3, var4)) { -+ /** -+ * Returns true if the block coordinate passed can provide power, or is a redstone wire, or if its a repeater that is -+ * powered. -+ */ -+ public static boolean isPoweredOrRepeater(IBlockAccess par0IBlockAccess, int par1, int par2, int par3, int par4) { -+ if (isPowerProviderOrWire(par0IBlockAccess, par1, par2, par3, par4)) { - return true; - } else { -- int var5 = var0.getBlockId(var1, var2, var3); -- if(var5 == Block.redstoneRepeaterActive.blockID) { -- int var6 = var0.getBlockMetadata(var1, var2, var3); -- return var4 == (var6 & 3); -+ int var5 = par0IBlockAccess.getBlockId(par1, par2, par3); -+ -+ if (var5 == Block.redstoneRepeaterActive.blockID) { -+ int var6 = par0IBlockAccess.getBlockMetadata(par1, par2, par3); -+ return par4 == (var6 & 3); - } else { - return false; - } - } - } - -- public int idPicked(World var1, int var2, int var3, int var4) { -+ /** -+ * only called by clickMiddleMouseButton , and passed to inventory.setCurrentItem (along with isCreative) -+ */ -+ public int idPicked(World par1World, int par2, int par3, int par4) { - return Item.redstone.itemID; - } - -- public void registerIcons(IconRegister var1) { -- this.field_94413_c = var1.registerIcon(this.getTextureName() + "_" + "cross"); -- this.field_94410_cO = var1.registerIcon(this.getTextureName() + "_" + "line"); -- this.field_94411_cP = var1.registerIcon(this.getTextureName() + "_" + "cross_overlay"); -- this.field_94412_cQ = var1.registerIcon(this.getTextureName() + "_" + "line_overlay"); -+ /** -+ * When this method is called, your block should register all the icons it needs with the given IconRegister. This is -+ * the only chance you get to register icons. -+ */ -+ public void registerIcons(IconRegister par1IconRegister) { -+ this.field_94413_c = par1IconRegister.registerIcon(this.getTextureName() + "_" + "cross"); -+ this.field_94410_cO = par1IconRegister.registerIcon(this.getTextureName() + "_" + "line"); -+ this.field_94411_cP = par1IconRegister.registerIcon(this.getTextureName() + "_" + "cross_overlay"); -+ this.field_94412_cQ = par1IconRegister.registerIcon(this.getTextureName() + "_" + "line_overlay"); - this.blockIcon = this.field_94413_c; - } - -- public static Icon getRedstoneWireIcon(String var0) { -- return var0.equals("cross") ? Block.redstoneWire.field_94413_c : (var0.equals("line") ? Block.redstoneWire.field_94410_cO : (var0.equals("cross_overlay") ? Block.redstoneWire.field_94411_cP : (var0.equals("line_overlay") ? Block.redstoneWire.field_94412_cQ : null))); -+ public static Icon getRedstoneWireIcon(String par0Str) { -+ return par0Str.equals("cross") ? Block.redstoneWire.field_94413_c : (par0Str.equals("line") ? Block.redstoneWire.field_94410_cO : (par0Str.equals("cross_overlay") ? Block.redstoneWire.field_94411_cP : (par0Str.equals("line_overlay") ? Block.redstoneWire.field_94412_cQ : null))); - } - } ---- /dev/null -+++ org/spoutcraft/api/block/design/Quad.java -@@ -1,0 +1,102 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.api.block.design; -+ -+public class Quad { -+ private int index; -+ private SubTexture texture; -+ private Vertex[] vertexes = new Vertex[4]; -+ -+ /** -+ * Creates a new quad with the following vertexes at the specified index -+ * -+ * @param index of the quad -+ * @param texture Subtexture to use -+ * @param v1 first vertex -+ * @param v2 second vertex -+ * @param v3 third vertex -+ * @param v4 fourth vertex -+ */ -+ public Quad(int index, SubTexture texture, Vertex v1, Vertex v2, Vertex v3, Vertex v4) { -+ this(index, texture); -+ vertexes[0] = v1; -+ vertexes[1] = v2; -+ vertexes[2] = v3; -+ vertexes[3] = v4; -+ } -+ -+ /** -+ * Creates an empty quad at index based on the SubTexture -+ * -+ * @param index of the quad -+ * @param texture -+ */ -+ public Quad(int index, SubTexture texture) { -+ this.index = index; -+ this.texture = texture; -+ } -+ -+ /** -+ * Adds a vertex to the quad with the SubTexture properties of this quad -+ * -+ * @param index of the vertex -+ * @param x value of the vertex -+ * @param y value of the vertex -+ * @param z value of the vertex -+ * @return this -+ */ -+ public Quad addVertex(int vertex, float x, float y, float z) { -+ if (vertex < 0 || vertex > 3) { -+ throw new IllegalArgumentException("Invalid vertex index: " + vertex); -+ } -+ vertexes[vertex] = new Vertex(vertex, index, x, y, z, texture); -+ return this; -+ } -+ -+ /** -+ * Adds a vertex to the quad -+ * -+ * @param vertex to add -+ * @return this -+ */ -+ public Quad addVertex(Vertex vertex) { -+ vertexes[vertex.getIndex()] = vertex; -+ -+ return this; -+ } -+ -+ /** -+ * Gets the vertex of the specified index -+ * -+ * @param index of the vertex -+ * @return the vertex -+ */ -+ public Vertex getVertex(int index) { -+ if (index < 0 || index > 3) { -+ throw new IllegalArgumentException("Invalid vertex index: " + index); -+ } -+ -+ return vertexes[index]; -+ } -+ -+ public int getIndex() { -+ return index; -+ } -+} ---- net/minecraft/src/CallableTileEntityName.java -+++ net/minecraft/src/CallableTileEntityName.java -@@ -5,8 +5,8 @@ - class CallableTileEntityName implements Callable { - final TileEntity theTileEntity; - -- CallableTileEntityName(TileEntity var1) { -- this.theTileEntity = var1; -+ CallableTileEntityName(TileEntity par1TileEntity) { -+ this.theTileEntity = par1TileEntity; - } - - public String callTileEntityName() { ---- net/minecraft/src/EnchantmentProtection.java -+++ net/minecraft/src/EnchantmentProtection.java -@@ -1,70 +1,112 @@ - package net.minecraft.src; - - public class EnchantmentProtection extends Enchantment { -- private static final String[] C = new String[]{"all", "fire", "fall", "explosion", "projectile"}; -- private static final int[] baseEnchantability = new int[]{1, 10, 5, 5, 3}; -- private static final int[] levelEnchantability = new int[]{11, 8, 6, 8, 6}; -- private static final int[] thresholdEnchantability = new int[]{20, 12, 10, 12, 15}; -+ -+ /** Holds the name to be translated of each protection type. */ -+ private static final String[] protectionName = new String[] {"all", "fire", "fall", "explosion", "projectile"}; -+ -+ /** -+ * Holds the base factor of enchantability needed to be able to use the enchant. -+ */ -+ private static final int[] baseEnchantability = new int[] {1, 10, 5, 5, 3}; -+ -+ /** -+ * Holds how much each level increased the enchantability factor to be able to use this enchant. -+ */ -+ private static final int[] levelEnchantability = new int[] {11, 8, 6, 8, 6}; -+ -+ /** -+ * Used on the formula of base enchantability, this is the 'window' factor of values to be able to use thing enchant. -+ */ -+ private static final int[] thresholdEnchantability = new int[] {20, 12, 10, 12, 15}; -+ -+ /** -+ * Defines the type of protection of the enchantment, 0 = all, 1 = fire, 2 = fall (feather fall), 3 = explosion and 4 = -+ * projectile. -+ */ - public final int protectionType; - -- public EnchantmentProtection(int var1, int var2, int var3) { -- super(var1, var2, EnumEnchantmentType.armor); -- this.protectionType = var3; -- if(var3 == 2) { -+ public EnchantmentProtection(int par1, int par2, int par3) { -+ super(par1, par2, EnumEnchantmentType.armor); -+ this.protectionType = par3; -+ -+ if (par3 == 2) { - this.type = EnumEnchantmentType.armor_feet; - } -- -- } -- -- public int getMinEnchantability(int var1) { -- return baseEnchantability[this.protectionType] + (var1 - 1) * levelEnchantability[this.protectionType]; -- } -- -- public int getMaxEnchantability(int var1) { -- return this.getMinEnchantability(var1) + thresholdEnchantability[this.protectionType]; -- } -- -+ } -+ -+ /** -+ * Returns the minimal value of enchantability needed on the enchantment level passed. -+ */ -+ public int getMinEnchantability(int par1) { -+ return baseEnchantability[this.protectionType] + (par1 - 1) * levelEnchantability[this.protectionType]; -+ } -+ -+ /** -+ * Returns the maximum value of enchantability nedded on the enchantment level passed. -+ */ -+ public int getMaxEnchantability(int par1) { -+ return this.getMinEnchantability(par1) + thresholdEnchantability[this.protectionType]; -+ } -+ -+ /** -+ * Returns the maximum level that the enchantment can have. -+ */ - public int getMaxLevel() { - return 4; - } - -- public int calcModifierDamage(int var1, DamageSource var2) { -- if(var2.canHarmInCreative()) { -+ /** -+ * Calculates de damage protection of the enchantment based on level and damage source passed. -+ */ -+ public int calcModifierDamage(int par1, DamageSource par2DamageSource) { -+ if (par2DamageSource.canHarmInCreative()) { - return 0; - } else { -- float var3 = (float)(6 + var1 * var1) / 3.0F; -- return this.protectionType == 0 ? MathHelper.floor_float(var3 * (12.0F / 16.0F)) : (this.protectionType == 1 && var2.isFireDamage() ? MathHelper.floor_float(var3 * 1.25F) : (this.protectionType == 2 && var2 == DamageSource.fall ? MathHelper.floor_float(var3 * 2.5F) : (this.protectionType == 3 && var2.isExplosion() ? MathHelper.floor_float(var3 * 1.5F) : (this.protectionType == 4 && var2.isProjectile() ? MathHelper.floor_float(var3 * 1.5F) : 0)))); -+ float var3 = (float)(6 + par1 * par1) / 3.0F; -+ return this.protectionType == 0 ? MathHelper.floor_float(var3 * 0.75F) : (this.protectionType == 1 && par2DamageSource.isFireDamage() ? MathHelper.floor_float(var3 * 1.25F) : (this.protectionType == 2 && par2DamageSource == DamageSource.fall ? MathHelper.floor_float(var3 * 2.5F) : (this.protectionType == 3 && par2DamageSource.isExplosion() ? MathHelper.floor_float(var3 * 1.5F) : (this.protectionType == 4 && par2DamageSource.isProjectile() ? MathHelper.floor_float(var3 * 1.5F) : 0)))); - } - } - -+ /** -+ * Return the name of key in translation table of this enchantment. -+ */ - public String getName() { -- return "enchantment.protect." + C[this.protectionType]; -+ return "enchantment.protect." + protectionName[this.protectionType]; - } - -- public boolean canApplyTogether(Enchantment var1) { -- if(var1 instanceof EnchantmentProtection) { -- EnchantmentProtection var2 = (EnchantmentProtection)var1; -+ /** -+ * Determines if the enchantment passed can be applyied together with this enchantment. -+ */ -+ public boolean canApplyTogether(Enchantment par1Enchantment) { -+ if (par1Enchantment instanceof EnchantmentProtection) { -+ EnchantmentProtection var2 = (EnchantmentProtection)par1Enchantment; - return var2.protectionType == this.protectionType ? false : this.protectionType == 2 || var2.protectionType == 2; - } else { -- return super.canApplyTogether(var1); -- } -- } -- -- public static int getFireTimeForEntity(Entity var0, int var1) { -- int var2 = EnchantmentHelper.getMaxEnchantmentLevel(Enchantment.fireProtection.effectId, var0.getInventory()); -- if(var2 > 0) { -- var1 -= MathHelper.floor_float((float)var1 * (float)var2 * 0.15F); -- } -- -- return var1; -- } -- -- public static double func_92092_a(Entity var0, double var1) { -- int var3 = EnchantmentHelper.getMaxEnchantmentLevel(Enchantment.blastProtection.effectId, var0.getInventory()); -- if(var3 > 0) { -- var1 -= (double)MathHelper.floor_double(var1 * (double)((float)var3 * 0.15F)); -- } -- -- return var1; -+ return super.canApplyTogether(par1Enchantment); -+ } -+ } -+ -+ /** -+ * Gets the amount of ticks an entity should be set fire, adjusted for fire protection. -+ */ -+ public static int getFireTimeForEntity(Entity par0Entity, int par1) { -+ int var2 = EnchantmentHelper.getMaxEnchantmentLevel(Enchantment.fireProtection.effectId, par0Entity.getLastActiveItems()); -+ -+ if (var2 > 0) { -+ par1 -= MathHelper.floor_float((float)par1 * (float)var2 * 0.15F); -+ } -+ -+ return par1; -+ } -+ -+ public static double func_92092_a(Entity par0Entity, double par1) { -+ int var3 = EnchantmentHelper.getMaxEnchantmentLevel(Enchantment.blastProtection.effectId, par0Entity.getLastActiveItems()); -+ -+ if (var3 > 0) { -+ par1 -= (double)MathHelper.floor_double(par1 * (double)((float)var3 * 0.15F)); -+ } -+ -+ return par1; - } - } ---- /dev/null -+++ org/spoutcraft/client/gui/settings/controls/FieldOfViewSlider.java -@@ -1,0 +1,49 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.client.gui.settings.controls; -+ -+import net.minecraft.src.Minecraft; -+ -+import org.spoutcraft.api.gui.GenericSlider; -+ -+public class FieldOfViewSlider extends GenericSlider { -+ public FieldOfViewSlider() { -+ super("Field of View"); -+ setSliderPosition(Minecraft.getMinecraft().gameSettings.fovSetting); -+ setTooltip("Field of View\nAdjusts the field of view in game."); -+ } -+ -+ @Override -+ public void onSliderDrag(float old, float newPos) { -+ Minecraft.getMinecraft().gameSettings.fovSetting = newPos; -+ Minecraft.getMinecraft().gameSettings.saveOptions(); -+ } -+ -+ public String getText() { -+ String message = String.valueOf((70 + (int)(this.getSliderPosition() * 40))); -+ if (this.getSliderPosition() == 0) { -+ message = "Normal"; -+ } -+ if (this.getSliderPosition() == 1) { -+ message = "Quake Pro"; -+ } -+ return "FOV: " + message; -+ } -+} ---- net/minecraft/src/EntityExpBottle.java -+++ net/minecraft/src/EntityExpBottle.java -@@ -1,18 +1,21 @@ - package net.minecraft.src; - - public class EntityExpBottle extends EntityThrowable { -- public EntityExpBottle(World var1) { -- super(var1); -- } -- -- public EntityExpBottle(World var1, EntityLivingBase var2) { -- super(var1, var2); -- } -- -- public EntityExpBottle(World var1, double var2, double var4, double var6) { -- super(var1, var2, var4, var6); -- } -- -+ public EntityExpBottle(World par1World) { -+ super(par1World); -+ } -+ -+ public EntityExpBottle(World par1World, EntityLivingBase par2EntityLivingBase) { -+ super(par1World, par2EntityLivingBase); -+ } -+ -+ public EntityExpBottle(World par1World, double par2, double par4, double par6) { -+ super(par1World, par2, par4, par6); -+ } -+ -+ /** -+ * Gets the amount of gravity to apply to the thrown entity with each tick. -+ */ - protected float getGravityVelocity() { - return 0.07F; - } -@@ -25,12 +28,15 @@ - return -20.0F; - } - -- protected void onImpact(MovingObjectPosition var1) { -- if(!this.worldObj.isRemote) { -+ /** -+ * Called when this EntityThrowable hits a block or entity. -+ */ -+ protected void onImpact(MovingObjectPosition par1MovingObjectPosition) { -+ if (!this.worldObj.isRemote) { - this.worldObj.playAuxSFX(2002, (int)Math.round(this.posX), (int)Math.round(this.posY), (int)Math.round(this.posZ), 0); -- int var2 = 3 + this.worldObj.s.nextInt(5) + this.worldObj.s.nextInt(5); -+ int var2 = 3 + this.worldObj.rand.nextInt(5) + this.worldObj.rand.nextInt(5); - -- while(var2 > 0) { -+ while (var2 > 0) { - int var3 = EntityXPOrb.getXPSplit(var2); - var2 -= var3; - this.worldObj.spawnEntityInWorld(new EntityXPOrb(this.worldObj, this.posX, this.posY, this.posZ, var3)); -@@ -38,6 +44,5 @@ - - this.setDead(); - } -- - } - } ---- net/minecraft/src/ItemMonsterPlacer.java -+++ net/minecraft/src/ItemMonsterPlacer.java -@@ -3,59 +3,73 @@ - import java.util.Iterator; - import java.util.List; - -+import com.prupe.mcpatcher.cc.ColorizeItem; -+ - public class ItemMonsterPlacer extends Item { - private Icon theIcon; - -- public ItemMonsterPlacer(int var1) { -- super(var1); -+ public ItemMonsterPlacer(int par1) { -+ super(par1); - this.setHasSubtypes(true); - this.setCreativeTab(CreativeTabs.tabMisc); - } - -- public String getItemDisplayName(ItemStack var1) { -+ public String getItemDisplayName(ItemStack par1ItemStack) { - String var2 = ("" + StatCollector.translateToLocal(this.getUnlocalizedName() + ".name")).trim(); -- String var3 = EntityList.getStringFromID(var1.getItemDamage()); -- if(var3 != null) { -+ String var3 = EntityList.getStringFromID(par1ItemStack.getItemDamage()); -+ -+ if (var3 != null) { - var2 = var2 + " " + StatCollector.translateToLocal("entity." + var3 + ".name"); - } - - return var2; - } - -- public int getColorFromItemStack(ItemStack var1, int var2) { -- EntityEggInfo var3 = (EntityEggInfo)EntityList.a.get(Integer.valueOf(var1.getItemDamage())); -- return var3 != null ? (var2 == 0 ? var3.primaryColor : var3.secondaryColor) : 16777215; -+ public int getColorFromItemStack(ItemStack par1ItemStack, int par2) { -+ EntityEggInfo var3 = (EntityEggInfo)EntityList.entityEggs.get(Integer.valueOf(par1ItemStack.getItemDamage())); -+ // MCPatcher Start -+ return var3 != null ? (par2 == 0 ? ColorizeItem.colorizeSpawnerEgg(var3.primaryColor, par1ItemStack.getItemDamage(), par2) : ColorizeItem.colorizeSpawnerEgg(var3.secondaryColor, par1ItemStack.getItemDamage(), par2)) : ColorizeItem.colorizeSpawnerEgg(16777215, par1ItemStack.getItemDamage(), par2); -+ // MCPatcher End - } - - public boolean requiresMultipleRenderPasses() { - return true; - } - -- public Icon getIconFromDamageForRenderPass(int var1, int var2) { -- return var2 > 0 ? this.theIcon : super.getIconFromDamageForRenderPass(var1, var2); -+ /** -+ * Gets an icon index based on an item's damage value and the given render pass -+ */ -+ public Icon getIconFromDamageForRenderPass(int par1, int par2) { -+ return par2 > 0 ? this.theIcon : super.getIconFromDamageForRenderPass(par1, par2); - } - -- public boolean onItemUse(ItemStack var1, EntityPlayer var2, World var3, int var4, int var5, int var6, int var7, float var8, float var9, float var10) { -- if(var3.isRemote) { -+ /** -+ * Callback for item usage. If the item does something special on right clicking, he will have one of those. Return -+ * True if something happen and false if it don't. This is for ITEMS, not BLOCKS -+ */ -+ public boolean onItemUse(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, World par3World, int par4, int par5, int par6, int par7, float par8, float par9, float par10) { -+ if (par3World.isRemote) { - return true; - } else { -- int var11 = var3.getBlockId(var4, var5, var6); -- var4 += Facing.offsetsXForSide[var7]; -- var5 += Facing.offsetsYForSide[var7]; -- var6 += Facing.offsetsZForSide[var7]; -+ int var11 = par3World.getBlockId(par4, par5, par6); -+ par4 += Facing.offsetsXForSide[par7]; -+ par5 += Facing.offsetsYForSide[par7]; -+ par6 += Facing.offsetsZForSide[par7]; - double var12 = 0.0D; -- if(var7 == 1 && Block.blocksList[var11] != null && Block.blocksList[var11].getRenderType() == 11) { -+ -+ if (par7 == 1 && Block.blocksList[var11] != null && Block.blocksList[var11].getRenderType() == 11) { - var12 = 0.5D; - } - -- Entity var14 = spawnCreature(var3, var1.getItemDamage(), (double)var4 + 0.5D, (double)var5 + var12, (double)var6 + 0.5D); -- if(var14 != null) { -- if(var14 instanceof EntityLivingBase && var1.hasDisplayName()) { -- ((EntityLiving)var14).setCustomNameTag(var1.getDisplayName()); -+ Entity var14 = spawnCreature(par3World, par1ItemStack.getItemDamage(), (double)par4 + 0.5D, (double)par5 + var12, (double)par6 + 0.5D); -+ -+ if (var14 != null) { -+ if (var14 instanceof EntityLivingBase && par1ItemStack.hasDisplayName()) { -+ ((EntityLiving)var14).setCustomNameTag(par1ItemStack.getDisplayName()); - } - -- if(!var2.capabilities.isCreativeMode) { -- --var1.stackSize; -+ if (!par2EntityPlayer.capabilities.isCreativeMode) { -+ --par1ItemStack.stackSize; - } - } - -@@ -63,60 +77,71 @@ - } - } - -- public ItemStack onItemRightClick(ItemStack var1, World var2, EntityPlayer var3) { -- if(var2.isRemote) { -- return var1; -+ /** -+ * Called whenever this item is equipped and the right mouse button is pressed. Args: itemStack, world, entityPlayer -+ */ -+ public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) { -+ if (par2World.isRemote) { -+ return par1ItemStack; - } else { -- MovingObjectPosition var4 = this.getMovingObjectPositionFromPlayer(var2, var3, true); -- if(var4 == null) { -- return var1; -+ MovingObjectPosition var4 = this.getMovingObjectPositionFromPlayer(par2World, par3EntityPlayer, true); -+ -+ if (var4 == null) { -+ return par1ItemStack; - } else { -- if(var4.typeOfHit == EnumMovingObjectType.TILE) { -+ if (var4.typeOfHit == EnumMovingObjectType.TILE) { - int var5 = var4.blockX; - int var6 = var4.blockY; - int var7 = var4.blockZ; -- if(!var2.canMineBlock(var3, var5, var6, var7)) { -- return var1; -- } -- -- if(!var3.canPlayerEdit(var5, var6, var7, var4.sideHit, var1)) { -- return var1; -- } -- -- if(var2.getBlockMaterial(var5, var6, var7) == Material.water) { -- Entity var8 = spawnCreature(var2, var1.getItemDamage(), (double)var5, (double)var6, (double)var7); -- if(var8 != null) { -- if(var8 instanceof EntityLivingBase && var1.hasDisplayName()) { -- ((EntityLiving)var8).setCustomNameTag(var1.getDisplayName()); -+ -+ if (!par2World.canMineBlock(par3EntityPlayer, var5, var6, var7)) { -+ return par1ItemStack; -+ } -+ -+ if (!par3EntityPlayer.canPlayerEdit(var5, var6, var7, var4.sideHit, par1ItemStack)) { -+ return par1ItemStack; -+ } -+ -+ if (par2World.getBlockMaterial(var5, var6, var7) == Material.water) { -+ Entity var8 = spawnCreature(par2World, par1ItemStack.getItemDamage(), (double)var5, (double)var6, (double)var7); -+ -+ if (var8 != null) { -+ if (var8 instanceof EntityLivingBase && par1ItemStack.hasDisplayName()) { -+ ((EntityLiving)var8).setCustomNameTag(par1ItemStack.getDisplayName()); - } - -- if(!var3.capabilities.isCreativeMode) { -- --var1.stackSize; -+ if (!par3EntityPlayer.capabilities.isCreativeMode) { -+ --par1ItemStack.stackSize; - } - } - } - } - -- return var1; -+ return par1ItemStack; - } - } - } -- -- public static Entity spawnCreature(World var0, int var1, double var2, double var4, double var6) { -- if(!EntityList.a.containsKey(Integer.valueOf(var1))) { -+ -+ /** -+ * Spawns the creature specified by the egg's type in the location specified by the last three parameters. Parameters: -+ * world, entityID, x, y, z. -+ */ -+ public static Entity spawnCreature(World par0World, int par1, double par2, double par4, double par6) { -+ if (!EntityList.entityEggs.containsKey(Integer.valueOf(par1))) { - return null; - } else { - Entity var8 = null; - -- for(int var9 = 0; var9 < 1; ++var9) { -- var8 = EntityList.createEntityByID(var1, var0); -- if(var8 != null && var8 instanceof EntityLivingBase) { -+ for (int var9 = 0; var9 < 1; ++var9) { -+ var8 = EntityList.createEntityByID(par1, par0World); -+ -+ if (var8 != null && var8 instanceof EntityLivingBase) { - EntityLiving var10 = (EntityLiving)var8; -- var8.setLocationAndAngles(var2, var4, var6, MathHelper.wrapAngleTo180_float(var0.s.nextFloat() * 360.0F), 0.0F); -+ var8.setLocationAndAngles(par2, par4, par6, MathHelper.wrapAngleTo180_float(par0World.rand.nextFloat() * 360.0F), 0.0F); - var10.rotationYawHead = var10.rotationYaw; - var10.renderYawOffset = var10.rotationYaw; - var10.onSpawnWithEgg((EntityLivingData)null); -- var0.spawnEntityInWorld(var8); -+ par0World.spawnEntityInWorld(var8); - var10.playLivingSound(); - } - } -@@ -125,18 +150,20 @@ - } - } - -- public void getSubItems(int var1, CreativeTabs var2, List var3) { -- Iterator var4 = EntityList.a.values().iterator(); -+ /** -+ * returns a list of items with the same ID, but different meta (eg: dye returns 16 items) -+ */ -+ public void getSubItems(int par1, CreativeTabs par2CreativeTabs, List par3List) { -+ Iterator var4 = EntityList.entityEggs.values().iterator(); - -- while(var4.hasNext()) { -+ while (var4.hasNext()) { - EntityEggInfo var5 = (EntityEggInfo)var4.next(); -- var3.add(new ItemStack(var1, 1, var5.spawnedID)); -+ par3List.add(new ItemStack(par1, 1, var5.spawnedID)); - } -- - } - -- public void registerIcons(IconRegister var1) { -- super.registerIcons(var1); -- this.theIcon = var1.registerIcon(this.getIconString() + "_overlay"); -+ public void registerIcons(IconRegister par1IconRegister) { -+ super.registerIcons(par1IconRegister); -+ this.theIcon = par1IconRegister.registerIcon(this.getIconString() + "_overlay"); - } - } ---- net/minecraft/src/BiomeCacheBlock.java -+++ net/minecraft/src/BiomeCacheBlock.java -@@ -1,27 +1,44 @@ - package net.minecraft.src; - - public class BiomeCacheBlock { -+ -+ /** An array of chunk temperatures saved by this cache. */ - public float[] temperatureValues; -+ -+ /** An array of chunk rainfall values saved by this cache. */ - public float[] rainfallValues; -+ -+ /** The array of biome types stored in this BiomeCacheBlock. */ - public BiomeGenBase[] biomes; -+ -+ /** The x coordinate of the BiomeCacheBlock. */ - public int xPosition; -+ -+ /** The z coordinate of the BiomeCacheBlock. */ - public int zPosition; -+ -+ /** The last time this BiomeCacheBlock was accessed, in milliseconds. */ - public long lastAccessTime; -+ -+ /** The BiomeCache object that contains this BiomeCacheBlock */ - final BiomeCache theBiomeCache; - -- public BiomeCacheBlock(BiomeCache var1, int var2, int var3) { -- this.theBiomeCache = var1; -+ public BiomeCacheBlock(BiomeCache par1BiomeCache, int par2, int par3) { -+ this.theBiomeCache = par1BiomeCache; - this.temperatureValues = new float[256]; - this.rainfallValues = new float[256]; - this.biomes = new BiomeGenBase[256]; -- this.xPosition = var2; -- this.zPosition = var3; -- BiomeCache.getChunkManager(var1).getTemperatures(this.temperatureValues, var2 << 4, var3 << 4, 16, 16); -- BiomeCache.getChunkManager(var1).getRainfall(this.rainfallValues, var2 << 4, var3 << 4, 16, 16); -- BiomeCache.getChunkManager(var1).getBiomeGenAt(this.biomes, var2 << 4, var3 << 4, 16, 16, false); -+ this.xPosition = par2; -+ this.zPosition = par3; -+ BiomeCache.getChunkManager(par1BiomeCache).getTemperatures(this.temperatureValues, par2 << 4, par3 << 4, 16, 16); -+ BiomeCache.getChunkManager(par1BiomeCache).getRainfall(this.rainfallValues, par2 << 4, par3 << 4, 16, 16); -+ BiomeCache.getChunkManager(par1BiomeCache).getBiomeGenAt(this.biomes, par2 << 4, par3 << 4, 16, 16, false); - } - -- public BiomeGenBase getBiomeGenAt(int var1, int var2) { -- return this.biomes[var1 & 15 | (var2 & 15) << 4]; -+ /** -+ * Returns the BiomeGenBase related to the x, z position from the cache block. -+ */ -+ public BiomeGenBase getBiomeGenAt(int par1, int par2) { -+ return this.biomes[par1 & 15 | (par2 & 15) << 4]; - } - } ---- net/minecraft/src/RenderBlaze.java -+++ net/minecraft/src/RenderBlaze.java -@@ -2,39 +2,50 @@ - - public class RenderBlaze extends RenderLiving { - private static final ResourceLocation blazeTextures = new ResourceLocation("textures/entity/blaze.png"); -- private int field_77068_a = ((ModelBlaze)this.mainModel).func_78104_a(); -+ private int field_77068_a; - - public RenderBlaze() { - super(new ModelBlaze(), 0.5F); -+ this.field_77068_a = ((ModelBlaze)this.mainModel).func_78104_a(); - } - -- public void renderBlaze(EntityBlaze var1, double var2, double var4, double var6, float var8, float var9) { -+ public void renderBlaze(EntityBlaze par1EntityBlaze, double par2, double par4, double par6, float par8, float par9) { - int var10 = ((ModelBlaze)this.mainModel).func_78104_a(); -- if(var10 != this.field_77068_a) { -+ -+ if (var10 != this.field_77068_a) { - this.field_77068_a = var10; - this.mainModel = new ModelBlaze(); - } - -- super.doRenderLiving(var1, var2, var4, var6, var8, var9); -+ super.doRenderLiving(par1EntityBlaze, par2, par4, par6, par8, par9); - } - -- protected ResourceLocation getBlazeTextures(EntityBlaze var1) { -+ protected ResourceLocation getBlazeTextures(EntityBlaze par1EntityBlaze) { - return blazeTextures; - } - -- public void doRenderLiving(EntityLiving var1, double var2, double var4, double var6, float var8, float var9) { -- this.renderBlaze((EntityBlaze)var1, var2, var4, var6, var8, var9); -- } -- -- public void renderPlayer(EntityLivingBase var1, double var2, double var4, double var6, float var8, float var9) { -- this.renderBlaze((EntityBlaze)var1, var2, var4, var6, var8, var9); -- } -- -- protected ResourceLocation getEntityTexture(Entity var1) { -- return this.getBlazeTextures((EntityBlaze)var1); -- } -- -- public void doRender(Entity var1, double var2, double var4, double var6, float var8, float var9) { -- this.renderBlaze((EntityBlaze)var1, var2, var4, var6, var8, var9); -+ public void doRenderLiving(EntityLiving par1EntityLiving, double par2, double par4, double par6, float par8, float par9) { -+ this.renderBlaze((EntityBlaze)par1EntityLiving, par2, par4, par6, par8, par9); -+ } -+ -+ public void renderPlayer(EntityLivingBase par1EntityLivingBase, double par2, double par4, double par6, float par8, float par9) { -+ this.renderBlaze((EntityBlaze)par1EntityLivingBase, par2, par4, par6, par8, par9); -+ } -+ -+ /** -+ * Returns the location of an entity's texture. Doesn't seem to be called unless you call Render.bindEntityTexture. -+ */ -+ protected ResourceLocation getEntityTexture(Entity par1Entity) { -+ return this.getBlazeTextures((EntityBlaze)par1Entity); -+ } -+ -+ /** -+ * Actually renders the given argument. This is a synthetic bridge method, always casting down its argument and then -+ * handing it off to a worker function which does the actual work. In all probabilty, the class Render is generic -+ * (Render -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.client.packet; -+ -+import java.io.IOException; -+ -+import net.minecraft.src.GuiEditSign; -+import net.minecraft.src.TileEntity; -+import net.minecraft.src.TileEntitySign; -+import net.minecraft.src.World; -+ -+import org.spoutcraft.api.io.SpoutInputStream; -+import org.spoutcraft.api.io.SpoutOutputStream; -+import org.spoutcraft.client.SpoutClient; -+ -+public class PacketOpenSignGUI implements SpoutPacket { -+ int x,y,z; -+ -+ public int getNumBytes() { -+ return 12; // Never be too lazy to calculate ! -+ } -+ -+ public void readData(SpoutInputStream input) throws IOException { -+ x = input.readInt(); -+ y = input.readInt(); -+ z = input.readInt(); -+ } -+ -+ public void writeData(SpoutOutputStream output) throws IOException { -+ output.writeInt(x); -+ output.writeInt(y); -+ output.writeInt(z); -+ } -+ -+ public void run(int playerId) { -+ World world = SpoutClient.getHandle().theWorld; -+ TileEntity te = world.getBlockTileEntity(x, y, z); -+ if (te != null && te instanceof TileEntitySign) { -+ TileEntitySign sign = (TileEntitySign)te; -+ GuiEditSign gui = new GuiEditSign(sign); -+ SpoutClient.getHandle().displayGuiScreen(gui); -+ } -+ } -+ -+ public void failure(int playerId) { -+ } -+ -+ public PacketType getPacketType() { -+ return PacketType.PacketOpenSignGUI; -+ } -+ -+ public int getVersion() { -+ return 0; -+ } -+} ---- net/minecraft/src/WorldGenReed.java -+++ net/minecraft/src/WorldGenReed.java -@@ -3,17 +3,18 @@ - import java.util.Random; - - public class WorldGenReed extends WorldGenerator { -- public boolean generate(World var1, Random var2, int var3, int var4, int var5) { -- for(int var6 = 0; var6 < 20; ++var6) { -- int var7 = var3 + var2.nextInt(4) - var2.nextInt(4); -- int var8 = var4; -- int var9 = var5 + var2.nextInt(4) - var2.nextInt(4); -- if(var1.isAirBlock(var7, var4, var9) && (var1.getBlockMaterial(var7 - 1, var4 - 1, var9) == Material.water || var1.getBlockMaterial(var7 + 1, var4 - 1, var9) == Material.water || var1.getBlockMaterial(var7, var4 - 1, var9 - 1) == Material.water || var1.getBlockMaterial(var7, var4 - 1, var9 + 1) == Material.water)) { -- int var10 = 2 + var2.nextInt(var2.nextInt(3) + 1); -- -- for(int var11 = 0; var11 < var10; ++var11) { -- if(Block.reed.canBlockStay(var1, var7, var8 + var11, var9)) { -- var1.setBlock(var7, var8 + var11, var9, Block.reed.blockID, 0, 2); -+ public boolean generate(World par1World, Random par2Random, int par3, int par4, int par5) { -+ for (int var6 = 0; var6 < 20; ++var6) { -+ int var7 = par3 + par2Random.nextInt(4) - par2Random.nextInt(4); -+ int var8 = par4; -+ int var9 = par5 + par2Random.nextInt(4) - par2Random.nextInt(4); -+ -+ if (par1World.isAirBlock(var7, par4, var9) && (par1World.getBlockMaterial(var7 - 1, par4 - 1, var9) == Material.water || par1World.getBlockMaterial(var7 + 1, par4 - 1, var9) == Material.water || par1World.getBlockMaterial(var7, par4 - 1, var9 - 1) == Material.water || par1World.getBlockMaterial(var7, par4 - 1, var9 + 1) == Material.water)) { -+ int var10 = 2 + par2Random.nextInt(par2Random.nextInt(3) + 1); -+ -+ for (int var11 = 0; var11 < var10; ++var11) { -+ if (Block.reed.canBlockStay(par1World, var7, var8 + var11, var9)) { -+ par1World.setBlock(var7, var8 + var11, var9, Block.reed.blockID, 0, 2); - } - } - } ---- net/minecraft/src/BlockButton.java -+++ net/minecraft/src/BlockButton.java -@@ -4,252 +4,326 @@ - import java.util.Random; - - public abstract class BlockButton extends Block { -+ -+ /** Whether this button is sensible to arrows, used by wooden buttons. */ - private final boolean sensible; - -- protected BlockButton(int var1, boolean var2) { -- super(var1, Material.circuits); -+ protected BlockButton(int par1, boolean par2) { -+ super(par1, Material.circuits); - this.setTickRandomly(true); - this.setCreativeTab(CreativeTabs.tabRedstone); -- this.sensible = var2; -+ this.sensible = par2; - } - -- public AxisAlignedBB getCollisionBoundingBoxFromPool(World var1, int var2, int var3, int var4) { -+ /** -+ * Returns a bounding box from the pool of bounding boxes (this means this box can change after the pool has been -+ * cleared to be reused) -+ */ -+ public AxisAlignedBB getCollisionBoundingBoxFromPool(World par1World, int par2, int par3, int par4) { - return null; - } - -- public int tickRate(World var1) { -+ /** -+ * How many world ticks before ticking -+ */ -+ public int tickRate(World par1World) { - return this.sensible ? 30 : 20; - } - -+ /** -+ * Is this block (a) opaque and (b) a full 1m cube? This determines whether or not to render the shared face of two -+ * adjacent blocks and also whether the player can attach torches, redstone wire, etc to this block. -+ */ - public boolean isOpaqueCube() { - return false; - } - -+ /** -+ * If this block doesn't render as an ordinary block it will return False (examples: signs, buttons, stairs, etc) -+ */ - public boolean renderAsNormalBlock() { - return false; - } - -- public boolean canPlaceBlockOnSide(World var1, int var2, int var3, int var4, int var5) { -- return var5 == 2 && var1.isBlockNormalCube(var2, var3, var4 + 1) ? true : (var5 == 3 && var1.isBlockNormalCube(var2, var3, var4 - 1) ? true : (var5 == 4 && var1.isBlockNormalCube(var2 + 1, var3, var4) ? true : var5 == 5 && var1.isBlockNormalCube(var2 - 1, var3, var4))); -- } -- -- public boolean canPlaceBlockAt(World var1, int var2, int var3, int var4) { -- return var1.isBlockNormalCube(var2 - 1, var3, var4) ? true : (var1.isBlockNormalCube(var2 + 1, var3, var4) ? true : (var1.isBlockNormalCube(var2, var3, var4 - 1) ? true : var1.isBlockNormalCube(var2, var3, var4 + 1))); -- } -- -- public int onBlockPlaced(World var1, int var2, int var3, int var4, int var5, float var6, float var7, float var8, int var9) { -- int var10 = var1.getBlockMetadata(var2, var3, var4); -+ /** -+ * checks to see if you can place this block can be placed on that side of a block: BlockLever overrides -+ */ -+ public boolean canPlaceBlockOnSide(World par1World, int par2, int par3, int par4, int par5) { -+ return par5 == 2 && par1World.isBlockNormalCube(par2, par3, par4 + 1) ? true : (par5 == 3 && par1World.isBlockNormalCube(par2, par3, par4 - 1) ? true : (par5 == 4 && par1World.isBlockNormalCube(par2 + 1, par3, par4) ? true : par5 == 5 && par1World.isBlockNormalCube(par2 - 1, par3, par4))); -+ } -+ -+ /** -+ * Checks to see if its valid to put this block at the specified coordinates. Args: world, x, y, z -+ */ -+ public boolean canPlaceBlockAt(World par1World, int par2, int par3, int par4) { -+ return par1World.isBlockNormalCube(par2 - 1, par3, par4) ? true : (par1World.isBlockNormalCube(par2 + 1, par3, par4) ? true : (par1World.isBlockNormalCube(par2, par3, par4 - 1) ? true : par1World.isBlockNormalCube(par2, par3, par4 + 1))); -+ } -+ -+ /** -+ * Called when a block is placed using its ItemBlock. Args: World, X, Y, Z, side, hitX, hitY, hitZ, block metadata -+ */ -+ public int onBlockPlaced(World par1World, int par2, int par3, int par4, int par5, float par6, float par7, float par8, int par9) { -+ int var10 = par1World.getBlockMetadata(par2, par3, par4); - int var11 = var10 & 8; - var10 &= 7; -- if(var5 == 2 && var1.isBlockNormalCube(var2, var3, var4 + 1)) { -+ -+ if (par5 == 2 && par1World.isBlockNormalCube(par2, par3, par4 + 1)) { - var10 = 4; -- } else if(var5 == 3 && var1.isBlockNormalCube(var2, var3, var4 - 1)) { -+ } else if (par5 == 3 && par1World.isBlockNormalCube(par2, par3, par4 - 1)) { - var10 = 3; -- } else if(var5 == 4 && var1.isBlockNormalCube(var2 + 1, var3, var4)) { -+ } else if (par5 == 4 && par1World.isBlockNormalCube(par2 + 1, par3, par4)) { - var10 = 2; -- } else if(var5 == 5 && var1.isBlockNormalCube(var2 - 1, var3, var4)) { -+ } else if (par5 == 5 && par1World.isBlockNormalCube(par2 - 1, par3, par4)) { - var10 = 1; - } else { -- var10 = this.getOrientation(var1, var2, var3, var4); -+ var10 = this.getOrientation(par1World, par2, par3, par4); - } - - return var10 + var11; - } - -- private int getOrientation(World var1, int var2, int var3, int var4) { -- return var1.isBlockNormalCube(var2 - 1, var3, var4) ? 1 : (var1.isBlockNormalCube(var2 + 1, var3, var4) ? 2 : (var1.isBlockNormalCube(var2, var3, var4 - 1) ? 3 : (var1.isBlockNormalCube(var2, var3, var4 + 1) ? 4 : 1))); -+ /** -+ * Get side which this button is facing. -+ */ -+ private int getOrientation(World par1World, int par2, int par3, int par4) { -+ return par1World.isBlockNormalCube(par2 - 1, par3, par4) ? 1 : (par1World.isBlockNormalCube(par2 + 1, par3, par4) ? 2 : (par1World.isBlockNormalCube(par2, par3, par4 - 1) ? 3 : (par1World.isBlockNormalCube(par2, par3, par4 + 1) ? 4 : 1))); - } - -- public void onNeighborBlockChange(World var1, int var2, int var3, int var4, int var5) { -- if(this.redundantCanPlaceBlockAt(var1, var2, var3, var4)) { -- int var6 = var1.getBlockMetadata(var2, var3, var4) & 7; -+ /** -+ * Lets the block know when one of its neighbor changes. Doesn't know which neighbor changed (coordinates passed are -+ * their own) Args: x, y, z, neighbor blockID -+ */ -+ public void onNeighborBlockChange(World par1World, int par2, int par3, int par4, int par5) { -+ if (this.redundantCanPlaceBlockAt(par1World, par2, par3, par4)) { -+ int var6 = par1World.getBlockMetadata(par2, par3, par4) & 7; - boolean var7 = false; -- if(!var1.isBlockNormalCube(var2 - 1, var3, var4) && var6 == 1) { -- var7 = true; -- } -- -- if(!var1.isBlockNormalCube(var2 + 1, var3, var4) && var6 == 2) { -- var7 = true; -- } -- -- if(!var1.isBlockNormalCube(var2, var3, var4 - 1) && var6 == 3) { -- var7 = true; -- } -- -- if(!var1.isBlockNormalCube(var2, var3, var4 + 1) && var6 == 4) { -- var7 = true; -- } -- -- if(var7) { -- this.dropBlockAsItem(var1, var2, var3, var4, var1.getBlockMetadata(var2, var3, var4), 0); -- var1.setBlockToAir(var2, var3, var4); -+ -+ if (!par1World.isBlockNormalCube(par2 - 1, par3, par4) && var6 == 1) { -+ var7 = true; -+ } -+ -+ if (!par1World.isBlockNormalCube(par2 + 1, par3, par4) && var6 == 2) { -+ var7 = true; -+ } -+ -+ if (!par1World.isBlockNormalCube(par2, par3, par4 - 1) && var6 == 3) { -+ var7 = true; -+ } -+ -+ if (!par1World.isBlockNormalCube(par2, par3, par4 + 1) && var6 == 4) { -+ var7 = true; -+ } -+ -+ if (var7) { -+ this.dropBlockAsItem(par1World, par2, par3, par4, par1World.getBlockMetadata(par2, par3, par4), 0); -+ par1World.setBlockToAir(par2, par3, par4); - } - } -- - } - -- private boolean redundantCanPlaceBlockAt(World var1, int var2, int var3, int var4) { -- if(!this.canPlaceBlockAt(var1, var2, var3, var4)) { -- this.dropBlockAsItem(var1, var2, var3, var4, var1.getBlockMetadata(var2, var3, var4), 0); -- var1.setBlockToAir(var2, var3, var4); -+ /** -+ * This method is redundant, check it out... -+ */ -+ private boolean redundantCanPlaceBlockAt(World par1World, int par2, int par3, int par4) { -+ if (!this.canPlaceBlockAt(par1World, par2, par3, par4)) { -+ this.dropBlockAsItem(par1World, par2, par3, par4, par1World.getBlockMetadata(par2, par3, par4), 0); -+ par1World.setBlockToAir(par2, par3, par4); - return false; - } else { - return true; - } - } - -- public void setBlockBoundsBasedOnState(IBlockAccess var1, int var2, int var3, int var4) { -- int var5 = var1.getBlockMetadata(var2, var3, var4); -+ /** -+ * Updates the blocks bounds based on its current state. Args: world, x, y, z -+ */ -+ public void setBlockBoundsBasedOnState(IBlockAccess par1IBlockAccess, int par2, int par3, int par4) { -+ int var5 = par1IBlockAccess.getBlockMetadata(par2, par3, par4); - this.func_82534_e(var5); - } - -- private void func_82534_e(int var1) { -- int var2 = var1 & 7; -- boolean var3 = (var1 & 8) > 0; -- float var4 = 6.0F / 16.0F; -- float var5 = 10.0F / 16.0F; -- float var6 = 3.0F / 16.0F; -- float var7 = 2.0F / 16.0F; -- if(var3) { -- var7 = 1.0F / 16.0F; -+ private void func_82534_e(int par1) { -+ int var2 = par1 & 7; -+ boolean var3 = (par1 & 8) > 0; -+ float var4 = 0.375F; -+ float var5 = 0.625F; -+ float var6 = 0.1875F; -+ float var7 = 0.125F; -+ -+ if (var3) { -+ var7 = 0.0625F; - } - -- if(var2 == 1) { -+ if (var2 == 1) { - this.setBlockBounds(0.0F, var4, 0.5F - var6, var7, var5, 0.5F + var6); -- } else if(var2 == 2) { -+ } else if (var2 == 2) { - this.setBlockBounds(1.0F - var7, var4, 0.5F - var6, 1.0F, var5, 0.5F + var6); -- } else if(var2 == 3) { -+ } else if (var2 == 3) { - this.setBlockBounds(0.5F - var6, var4, 0.0F, 0.5F + var6, var5, var7); -- } else if(var2 == 4) { -+ } else if (var2 == 4) { - this.setBlockBounds(0.5F - var6, var4, 1.0F - var7, 0.5F + var6, var5, 1.0F); - } -- -- } -- -- public void onBlockClicked(World var1, int var2, int var3, int var4, EntityPlayer var5) { -- } -- -- public boolean onBlockActivated(World var1, int var2, int var3, int var4, EntityPlayer var5, int var6, float var7, float var8, float var9) { -- int var10 = var1.getBlockMetadata(var2, var3, var4); -+ } -+ -+ /** -+ * Called when the block is clicked by a player. Args: x, y, z, entityPlayer -+ */ -+ public void onBlockClicked(World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer) {} -+ -+ /** -+ * Called upon block activation (right click on the block.) -+ */ -+ public boolean onBlockActivated(World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer, int par6, float par7, float par8, float par9) { -+ int var10 = par1World.getBlockMetadata(par2, par3, par4); - int var11 = var10 & 7; - int var12 = 8 - (var10 & 8); -- if(var12 == 0) { -+ -+ if (var12 == 0) { - return true; - } else { -- var1.setBlockMetadata(var2, var3, var4, var11 + var12, 3); -- var1.markBlockRangeForRenderUpdate(var2, var3, var4, var2, var3, var4); -- var1.playSoundEffect((double)var2 + 0.5D, (double)var3 + 0.5D, (double)var4 + 0.5D, "random.click", 0.3F, 0.6F); -- this.func_82536_d(var1, var2, var3, var4, var11); -- var1.scheduleBlockUpdate(var2, var3, var4, this.blockID, this.tickRate(var1)); -+ par1World.setBlockMetadataWithNotify(par2, par3, par4, var11 + var12, 3); -+ par1World.markBlockRangeForRenderUpdate(par2, par3, par4, par2, par3, par4); -+ par1World.playSoundEffect((double)par2 + 0.5D, (double)par3 + 0.5D, (double)par4 + 0.5D, "random.click", 0.3F, 0.6F); -+ this.func_82536_d(par1World, par2, par3, par4, var11); -+ par1World.scheduleBlockUpdate(par2, par3, par4, this.blockID, this.tickRate(par1World)); - return true; - } - } - -- public void breakBlock(World var1, int var2, int var3, int var4, int var5, int var6) { -- if((var6 & 8) > 0) { -- int var7 = var6 & 7; -- this.func_82536_d(var1, var2, var3, var4, var7); -+ /** -+ * Called on server worlds only when the block has been replaced by a different block ID, or the same block with a -+ * different metadata value, but before the new metadata value is set. Args: World, x, y, z, old block ID, old metadata -+ */ -+ public void breakBlock(World par1World, int par2, int par3, int par4, int par5, int par6) { -+ if ((par6 & 8) > 0) { -+ int var7 = par6 & 7; -+ this.func_82536_d(par1World, par2, par3, par4, var7); - } - -- super.breakBlock(var1, var2, var3, var4, var5, var6); -- } -- -- public int isProvidingWeakPower(IBlockAccess var1, int var2, int var3, int var4, int var5) { -- return (var1.getBlockMetadata(var2, var3, var4) & 8) > 0 ? 15 : 0; -- } -- -- public int isProvidingStrongPower(IBlockAccess var1, int var2, int var3, int var4, int var5) { -- int var6 = var1.getBlockMetadata(var2, var3, var4); -- if((var6 & 8) == 0) { -+ super.breakBlock(par1World, par2, par3, par4, par5, par6); -+ } -+ -+ /** -+ * Returns true if the block is emitting indirect/weak redstone power on the specified side. If isBlockNormalCube -+ * returns true, standard redstone propagation rules will apply instead and this will not be called. Args: World, X, Y, -+ * Z, side. Note that the side is reversed - eg it is 1 (up) when checking the bottom of the block. -+ */ -+ public int isProvidingWeakPower(IBlockAccess par1IBlockAccess, int par2, int par3, int par4, int par5) { -+ return (par1IBlockAccess.getBlockMetadata(par2, par3, par4) & 8) > 0 ? 15 : 0; -+ } -+ -+ /** -+ * Returns true if the block is emitting direct/strong redstone power on the specified side. Args: World, X, Y, Z, -+ * side. Note that the side is reversed - eg it is 1 (up) when checking the bottom of the block. -+ */ -+ public int isProvidingStrongPower(IBlockAccess par1IBlockAccess, int par2, int par3, int par4, int par5) { -+ int var6 = par1IBlockAccess.getBlockMetadata(par2, par3, par4); -+ -+ if ((var6 & 8) == 0) { - return 0; - } else { - int var7 = var6 & 7; -- return var7 == 5 && var5 == 1 ? 15 : (var7 == 4 && var5 == 2 ? 15 : (var7 == 3 && var5 == 3 ? 15 : (var7 == 2 && var5 == 4 ? 15 : (var7 == 1 && var5 == 5 ? 15 : 0)))); -+ return var7 == 5 && par5 == 1 ? 15 : (var7 == 4 && par5 == 2 ? 15 : (var7 == 3 && par5 == 3 ? 15 : (var7 == 2 && par5 == 4 ? 15 : (var7 == 1 && par5 == 5 ? 15 : 0)))); - } - } - -+ /** -+ * Can this block provide power. Only wire currently seems to have this change based on its state. -+ */ - public boolean canProvidePower() { - return true; - } - -- public void updateTick(World var1, int var2, int var3, int var4, Random var5) { -- if(!var1.isRemote) { -- int var6 = var1.getBlockMetadata(var2, var3, var4); -- if((var6 & 8) != 0) { -- if(this.sensible) { -- this.func_82535_o(var1, var2, var3, var4); -+ /** -+ * Ticks the block if it's been scheduled -+ */ -+ public void updateTick(World par1World, int par2, int par3, int par4, Random par5Random) { -+ if (!par1World.isRemote) { -+ int var6 = par1World.getBlockMetadata(par2, par3, par4); -+ -+ if ((var6 & 8) != 0) { -+ if (this.sensible) { -+ this.func_82535_o(par1World, par2, par3, par4); - } else { -- var1.setBlockMetadata(var2, var3, var4, var6 & 7, 3); -+ par1World.setBlockMetadataWithNotify(par2, par3, par4, var6 & 7, 3); - int var7 = var6 & 7; -- this.func_82536_d(var1, var2, var3, var4, var7); -- var1.playSoundEffect((double)var2 + 0.5D, (double)var3 + 0.5D, (double)var4 + 0.5D, "random.click", 0.3F, 0.5F); -- var1.markBlockRangeForRenderUpdate(var2, var3, var4, var2, var3, var4); -+ this.func_82536_d(par1World, par2, par3, par4, var7); -+ par1World.playSoundEffect((double)par2 + 0.5D, (double)par3 + 0.5D, (double)par4 + 0.5D, "random.click", 0.3F, 0.5F); -+ par1World.markBlockRangeForRenderUpdate(par2, par3, par4, par2, par3, par4); - } -- - } - } - } - -+ /** -+ * Sets the block's bounds for rendering it as an item -+ */ - public void setBlockBoundsForItemRender() { -- float var1 = 3.0F / 16.0F; -- float var2 = 2.0F / 16.0F; -- float var3 = 2.0F / 16.0F; -+ float var1 = 0.1875F; -+ float var2 = 0.125F; -+ float var3 = 0.125F; - this.setBlockBounds(0.5F - var1, 0.5F - var2, 0.5F - var3, 0.5F + var1, 0.5F + var2, 0.5F + var3); - } - -- public void onEntityCollidedWithBlock(World var1, int var2, int var3, int var4, Entity var5) { -- if(!var1.isRemote) { -- if(this.sensible) { -- if((var1.getBlockMetadata(var2, var3, var4) & 8) == 0) { -- this.func_82535_o(var1, var2, var3, var4); -+ /** -+ * Triggered whenever an entity collides with this block (enters into the block). Args: world, x, y, z, entity -+ */ -+ public void onEntityCollidedWithBlock(World par1World, int par2, int par3, int par4, Entity par5Entity) { -+ if (!par1World.isRemote) { -+ if (this.sensible) { -+ if ((par1World.getBlockMetadata(par2, par3, par4) & 8) == 0) { -+ this.func_82535_o(par1World, par2, par3, par4); - } - } - } - } - -- private void func_82535_o(World var1, int var2, int var3, int var4) { -- int var5 = var1.getBlockMetadata(var2, var3, var4); -+ private void func_82535_o(World par1World, int par2, int par3, int par4) { -+ int var5 = par1World.getBlockMetadata(par2, par3, par4); - int var6 = var5 & 7; - boolean var7 = (var5 & 8) != 0; - this.func_82534_e(var5); -- List var9 = var1.getEntitiesWithinAABB(EntityArrow.class, AxisAlignedBB.getAABBPool().getAABB((double)var2 + this.minX, (double)var3 + this.minY, (double)var4 + this.minZ, (double)var2 + this.maxX, (double)var3 + this.maxY, (double)var4 + this.maxZ)); -+ List var9 = par1World.getEntitiesWithinAABB(EntityArrow.class, AxisAlignedBB.getAABBPool().getAABB((double)par2 + this.minX, (double)par3 + this.minY, (double)par4 + this.minZ, (double)par2 + this.maxX, (double)par3 + this.maxY, (double)par4 + this.maxZ)); - boolean var8 = !var9.isEmpty(); -- if(var8 && !var7) { -- var1.setBlockMetadata(var2, var3, var4, var6 | 8, 3); -- this.func_82536_d(var1, var2, var3, var4, var6); -- var1.markBlockRangeForRenderUpdate(var2, var3, var4, var2, var3, var4); -- var1.playSoundEffect((double)var2 + 0.5D, (double)var3 + 0.5D, (double)var4 + 0.5D, "random.click", 0.3F, 0.6F); -- } -- -- if(!var8 && var7) { -- var1.setBlockMetadata(var2, var3, var4, var6, 3); -- this.func_82536_d(var1, var2, var3, var4, var6); -- var1.markBlockRangeForRenderUpdate(var2, var3, var4, var2, var3, var4); -- var1.playSoundEffect((double)var2 + 0.5D, (double)var3 + 0.5D, (double)var4 + 0.5D, "random.click", 0.3F, 0.5F); -- } -- -- if(var8) { -- var1.scheduleBlockUpdate(var2, var3, var4, this.blockID, this.tickRate(var1)); -- } -- -+ -+ if (var8 && !var7) { -+ par1World.setBlockMetadataWithNotify(par2, par3, par4, var6 | 8, 3); -+ this.func_82536_d(par1World, par2, par3, par4, var6); -+ par1World.markBlockRangeForRenderUpdate(par2, par3, par4, par2, par3, par4); -+ par1World.playSoundEffect((double)par2 + 0.5D, (double)par3 + 0.5D, (double)par4 + 0.5D, "random.click", 0.3F, 0.6F); -+ } -+ -+ if (!var8 && var7) { -+ par1World.setBlockMetadataWithNotify(par2, par3, par4, var6, 3); -+ this.func_82536_d(par1World, par2, par3, par4, var6); -+ par1World.markBlockRangeForRenderUpdate(par2, par3, par4, par2, par3, par4); -+ par1World.playSoundEffect((double)par2 + 0.5D, (double)par3 + 0.5D, (double)par4 + 0.5D, "random.click", 0.3F, 0.5F); -+ } -+ -+ if (var8) { -+ par1World.scheduleBlockUpdate(par2, par3, par4, this.blockID, this.tickRate(par1World)); -+ } - } - -- private void func_82536_d(World var1, int var2, int var3, int var4, int var5) { -- var1.notifyBlocksOfNeighborChange(var2, var3, var4, this.blockID); -- if(var5 == 1) { -- var1.notifyBlocksOfNeighborChange(var2 - 1, var3, var4, this.blockID); -- } else if(var5 == 2) { -- var1.notifyBlocksOfNeighborChange(var2 + 1, var3, var4, this.blockID); -- } else if(var5 == 3) { -- var1.notifyBlocksOfNeighborChange(var2, var3, var4 - 1, this.blockID); -- } else if(var5 == 4) { -- var1.notifyBlocksOfNeighborChange(var2, var3, var4 + 1, this.blockID); -+ private void func_82536_d(World par1World, int par2, int par3, int par4, int par5) { -+ par1World.notifyBlocksOfNeighborChange(par2, par3, par4, this.blockID); -+ -+ if (par5 == 1) { -+ par1World.notifyBlocksOfNeighborChange(par2 - 1, par3, par4, this.blockID); -+ } else if (par5 == 2) { -+ par1World.notifyBlocksOfNeighborChange(par2 + 1, par3, par4, this.blockID); -+ } else if (par5 == 3) { -+ par1World.notifyBlocksOfNeighborChange(par2, par3, par4 - 1, this.blockID); -+ } else if (par5 == 4) { -+ par1World.notifyBlocksOfNeighborChange(par2, par3, par4 + 1, this.blockID); - } else { -- var1.notifyBlocksOfNeighborChange(var2, var3 - 1, var4, this.blockID); -+ par1World.notifyBlocksOfNeighborChange(par2, par3 - 1, par4, this.blockID); - } -- -- } -- -- public void registerIcons(IconRegister var1) { -- } -+ } -+ -+ /** -+ * When this method is called, your block should register all the icons it needs with the given IconRegister. This is -+ * the only chance you get to register icons. -+ */ -+ public void registerIcons(IconRegister par1IconRegister) {} - } ---- net/minecraft/src/ValueObjectList.java -+++ net/minecraft/src/ValueObjectList.java -@@ -9,24 +9,27 @@ - import java.util.List; - - public class ValueObjectList extends ValueObject { -- public List a; -+ public List field_96430_d; - -- public static ValueObjectList func_98161_a(String var0) { -+ public static ValueObjectList func_98161_a(String par0Str) { - ValueObjectList var1 = new ValueObjectList(); -- var1.a = new ArrayList(); -+ var1.field_96430_d = new ArrayList(); - - try { -- JsonRootNode var2 = (new JdomParser()).parse(var0); -- if(var2.isArrayNode(new Object[]{"servers"})) { -- Iterator var3 = var2.getArrayNode(new Object[]{"servers"}).iterator(); -- -- while(var3.hasNext()) { -+ JsonRootNode var2 = (new JdomParser()).parse(par0Str); -+ -+ if (var2.isArrayNode(new Object[] {"servers"})) { -+ Iterator var3 = var2.getArrayNode(new Object[] {"servers"}).iterator(); -+ -+ while (var3.hasNext()) { - JsonNode var4 = (JsonNode)var3.next(); -- var1.a.add(McoServer.func_98163_a(var4)); -+ var1.field_96430_d.add(McoServer.func_98163_a(var4)); - } - } - } catch (InvalidSyntaxException var5) { -+ ; - } catch (IllegalArgumentException var6) { -+ ; - } - - return var1; ---- /dev/null -+++ com/prupe/mcpatcher/MCLogger$ErrorLevel.java -@@ -1,0 +1,9 @@ -+package com.prupe.mcpatcher; -+ -+import java.util.logging.Level; -+ -+class MCLogger$ErrorLevel extends Level { -+ protected MCLogger$ErrorLevel() { -+ super("ERROR", (Level.WARNING.intValue() + Level.SEVERE.intValue()) / 2); -+ } -+} ---- net/minecraft/src/MinecraftException.java -+++ net/minecraft/src/MinecraftException.java -@@ -1,7 +1,7 @@ - package net.minecraft.src; - - public class MinecraftException extends Exception { -- public MinecraftException(String var1) { -- super(var1); -+ public MinecraftException(String par1Str) { -+ super(par1Str); - } - } ---- net/minecraft/src/CryptManager.java -+++ net/minecraft/src/CryptManager.java -@@ -34,13 +34,17 @@ - import org.bouncycastle.jce.provider.BouncyCastleProvider; - - public class CryptManager { -+ -+ /** -+ * Generate a new shared secret AES key from a secure random source -+ */ - public static SecretKey createNewSharedKey() { - CipherKeyGenerator var0 = new CipherKeyGenerator(); - var0.init(new KeyGenerationParameters(new SecureRandom(), 128)); - return new SecretKeySpec(var0.generateKey(), "AES"); - } - -- public static KeyPair generateKeyPair() { -+ public static KeyPair createNewKeyPair() { - try { - KeyPairGenerator var0 = KeyPairGenerator.getInstance("RSA"); - var0.initialize(1024); -@@ -52,22 +56,28 @@ - } - } - -- public static byte[] getServerIdHash(String var0, PublicKey var1, SecretKey var2) { -+ /** -+ * Compute a serverId hash for use by sendSessionRequest() -+ */ -+ public static byte[] getServerIdHash(String par0Str, PublicKey par1PublicKey, SecretKey par2SecretKey) { - try { -- return digestOperation("SHA-1", new byte[][]{var0.getBytes("ISO_8859_1"), var2.getEncoded(), var1.getEncoded()}); -+ return digestOperation("SHA-1", new byte[][] {par0Str.getBytes("ISO_8859_1"), par2SecretKey.getEncoded(), par1PublicKey.getEncoded()}); - } catch (UnsupportedEncodingException var4) { - var4.printStackTrace(); - return null; - } - } - -- private static byte[] digestOperation(String var0, byte[]... var1) { -+ /** -+ * Compute a message digest on arbitrary byte[] data -+ */ -+ private static byte[] digestOperation(String par0Str, byte[] ... par1ArrayOfByte) { - try { -- MessageDigest var2 = MessageDigest.getInstance(var0); -- byte[][] var3 = var1; -- int var4 = var1.length; -+ MessageDigest var2 = MessageDigest.getInstance(par0Str); -+ byte[][] var3 = par1ArrayOfByte; -+ int var4 = par1ArrayOfByte.length; - -- for(int var5 = 0; var5 < var4; ++var5) { -+ for (int var5 = 0; var5 < var4; ++var5) { - byte[] var6 = var3[var5]; - var2.update(var6); - } -@@ -79,9 +89,12 @@ - } - } - -- public static PublicKey decodePublicKey(byte[] var0) { -+ /** -+ * Create a new PublicKey from encoded X.509 data -+ */ -+ public static PublicKey decodePublicKey(byte[] par0ArrayOfByte) { - try { -- X509EncodedKeySpec var1 = new X509EncodedKeySpec(var0); -+ X509EncodedKeySpec var1 = new X509EncodedKeySpec(par0ArrayOfByte); - KeyFactory var2 = KeyFactory.getInstance("RSA"); - return var2.generatePublic(var1); - } catch (NoSuchAlgorithmException var3) { -@@ -94,21 +107,33 @@ - return null; - } - -- public static SecretKey decryptSharedKey(PrivateKey var0, byte[] var1) { -- return new SecretKeySpec(decryptData(var0, var1), "AES"); -- } -- -- public static byte[] encryptData(Key var0, byte[] var1) { -- return cipherOperation(1, var0, var1); -- } -- -- public static byte[] decryptData(Key var0, byte[] var1) { -- return cipherOperation(2, var0, var1); -- } -- -- private static byte[] cipherOperation(int var0, Key var1, byte[] var2) { -+ /** -+ * Decrypt shared secret AES key using RSA private key -+ */ -+ public static SecretKey decryptSharedKey(PrivateKey par0PrivateKey, byte[] par1ArrayOfByte) { -+ return new SecretKeySpec(decryptData(par0PrivateKey, par1ArrayOfByte), "AES"); -+ } -+ -+ /** -+ * Encrypt byte[] data with RSA public key -+ */ -+ public static byte[] encryptData(Key par0Key, byte[] par1ArrayOfByte) { -+ return cipherOperation(1, par0Key, par1ArrayOfByte); -+ } -+ -+ /** -+ * Decrypt byte[] data with RSA private key -+ */ -+ public static byte[] decryptData(Key par0Key, byte[] par1ArrayOfByte) { -+ return cipherOperation(2, par0Key, par1ArrayOfByte); -+ } -+ -+ /** -+ * Encrypt or decrypt byte[] data using the specified key -+ */ -+ private static byte[] cipherOperation(int par0, Key par1Key, byte[] par2ArrayOfByte) { - try { -- return createTheCipherInstance(var0, var1.getAlgorithm(), var1).doFinal(var2); -+ return createTheCipherInstance(par0, par1Key.getAlgorithm(), par1Key).doFinal(par2ArrayOfByte); - } catch (IllegalBlockSizeException var4) { - var4.printStackTrace(); - } catch (BadPaddingException var5) { -@@ -119,10 +144,13 @@ - return null; - } - -- private static Cipher createTheCipherInstance(int var0, String var1, Key var2) { -+ /** -+ * Creates the Cipher Instance. -+ */ -+ private static Cipher createTheCipherInstance(int par0, String par1Str, Key par2Key) { - try { -- Cipher var3 = Cipher.getInstance(var1); -- var3.init(var0, var2); -+ Cipher var3 = Cipher.getInstance(par1Str); -+ var3.init(par0, par2Key); - return var3; - } catch (InvalidKeyException var4) { - var4.printStackTrace(); -@@ -136,18 +164,21 @@ - return null; - } - -- private static BufferedBlockCipher createBufferedBlockCipher(boolean var0, Key var1) { -+ /** -+ * Create a new BufferedBlockCipher instance -+ */ -+ private static BufferedBlockCipher createBufferedBlockCipher(boolean par0, Key par1Key) { - BufferedBlockCipher var2 = new BufferedBlockCipher(new CFBBlockCipher(new AESFastEngine(), 8)); -- var2.init(var0, new ParametersWithIV(new KeyParameter(var1.getEncoded()), var1.getEncoded(), 0, 16)); -+ var2.init(par0, new ParametersWithIV(new KeyParameter(par1Key.getEncoded()), par1Key.getEncoded(), 0, 16)); - return var2; - } - -- public static OutputStream encryptOuputStream(SecretKey var0, OutputStream var1) { -- return new CipherOutputStream(var1, createBufferedBlockCipher(true, var0)); -+ public static OutputStream encryptOuputStream(SecretKey par0SecretKey, OutputStream par1OutputStream) { -+ return new CipherOutputStream(par1OutputStream, createBufferedBlockCipher(true, par0SecretKey)); - } - -- public static InputStream decryptInputStream(SecretKey var0, InputStream var1) { -- return new CipherInputStream(var1, createBufferedBlockCipher(false, var0)); -+ public static InputStream decryptInputStream(SecretKey par0SecretKey, InputStream par1InputStream) { -+ return new CipherInputStream(par1InputStream, createBufferedBlockCipher(false, par0SecretKey)); - } - - static { ---- /dev/null -+++ org/spoutcraft/client/inventory/SimpleShapelessRecipe.java -@@ -1,0 +1,61 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.client.inventory; -+ -+import java.util.ArrayList; -+ -+import net.minecraft.src.CraftingManager; -+ -+import org.spoutcraft.api.inventory.ItemStack; -+import org.spoutcraft.api.inventory.ShapelessRecipe; -+import org.spoutcraft.api.material.Material; -+ -+public class SimpleShapelessRecipe extends ShapelessRecipe implements SpoutcraftRecipe { -+ public SimpleShapelessRecipe(ItemStack result) { -+ super(result); -+ } -+ -+ public static SimpleShapelessRecipe fromSpoutRecipe(ShapelessRecipe recipe) { -+ if (recipe instanceof SimpleShapelessRecipe) { -+ return (SimpleShapelessRecipe) recipe; -+ } -+ SimpleShapelessRecipe ret = new SimpleShapelessRecipe(recipe.getResult()); -+ for (Material ingred : recipe.getIngredientList()) { -+ ret.addIngredient(ingred); -+ } -+ return ret; -+ } -+ -+ public void addToCraftingManager() { -+ ArrayList ingred = this.getIngredientList(); -+ Object[] data = new Object[ingred.size()]; -+ int i = 0; -+ for (Material mdata : ingred) { -+ int id = mdata.getRawId(); -+ int dmg = mdata.getRawData(); -+ data[i] = new net.minecraft.src.ItemStack(id, 1, dmg); -+ i++; -+ } -+ int id = this.getResult().getTypeId(); -+ int amount = this.getResult().getAmount(); -+ short durability = this.getResult().getDurability(); -+ CraftingManager.getInstance().addShapelessRecipe(new net.minecraft.src.ItemStack(id, amount, durability), data); -+ } -+} ---- net/minecraft/src/GuiSlotStatsItem.java -+++ net/minecraft/src/GuiSlotStatsItem.java -@@ -4,66 +4,69 @@ - import java.util.Iterator; - - class GuiSlotStatsItem extends GuiSlotStats { -+ -+ /** Instance of GuiStats. */ - final GuiStats slotGuiStats; - -- public GuiSlotStatsItem(GuiStats var1) { -- super(var1); -- this.slotGuiStats = var1; -- this.h = new ArrayList(); -- Iterator var2 = StatList.d.iterator(); -+ public GuiSlotStatsItem(GuiStats par1GuiStats) { -+ super(par1GuiStats); -+ this.slotGuiStats = par1GuiStats; -+ this.field_77266_h = new ArrayList(); -+ Iterator var2 = StatList.itemStats.iterator(); - -- while(var2.hasNext()) { -+ while (var2.hasNext()) { - StatCrafting var3 = (StatCrafting)var2.next(); - boolean var4 = false; - int var5 = var3.getItemID(); -- if(GuiStats.getStatsFileWriter(var1).writeStat(var3) > 0) { -- var4 = true; -- } else if(StatList.objectBreakStats[var5] != null && GuiStats.getStatsFileWriter(var1).writeStat(StatList.objectBreakStats[var5]) > 0) { -- var4 = true; -- } else if(StatList.objectCraftStats[var5] != null && GuiStats.getStatsFileWriter(var1).writeStat(StatList.objectCraftStats[var5]) > 0) { -- var4 = true; -- } -- -- if(var4) { -- this.h.add(var3); -- } -- } -- -- this.i = new SorterStatsItem(this, var1); -- } -- -- protected void func_77222_a(int var1, int var2, Tessellator var3) { -- super.func_77222_a(var1, var2, var3); -- if(this.field_77262_g == 0) { -- GuiStats.drawSprite(this.slotGuiStats, var1 + 115 - 18 + 1, var2 + 1 + 1, 72, 18); -- } else { -- GuiStats.drawSprite(this.slotGuiStats, var1 + 115 - 18, var2 + 1, 72, 18); -- } -- -- if(this.field_77262_g == 1) { -- GuiStats.drawSprite(this.slotGuiStats, var1 + 165 - 18 + 1, var2 + 1 + 1, 18, 18); -- } else { -- GuiStats.drawSprite(this.slotGuiStats, var1 + 165 - 18, var2 + 1, 18, 18); -- } -- -- if(this.field_77262_g == 2) { -- GuiStats.drawSprite(this.slotGuiStats, var1 + 215 - 18 + 1, var2 + 1 + 1, 36, 18); -- } else { -- GuiStats.drawSprite(this.slotGuiStats, var1 + 215 - 18, var2 + 1, 36, 18); -- } -- -- } -- -- protected void drawSlot(int var1, int var2, int var3, int var4, Tessellator var5) { -- StatCrafting var6 = this.func_77257_d(var1); -+ -+ if (GuiStats.getStatsFileWriter(par1GuiStats).writeStat(var3) > 0) { -+ var4 = true; -+ } else if (StatList.objectBreakStats[var5] != null && GuiStats.getStatsFileWriter(par1GuiStats).writeStat(StatList.objectBreakStats[var5]) > 0) { -+ var4 = true; -+ } else if (StatList.objectCraftStats[var5] != null && GuiStats.getStatsFileWriter(par1GuiStats).writeStat(StatList.objectCraftStats[var5]) > 0) { -+ var4 = true; -+ } -+ -+ if (var4) { -+ this.field_77266_h.add(var3); -+ } -+ } -+ -+ this.field_77267_i = new SorterStatsItem(this, par1GuiStats); -+ } -+ -+ protected void func_77222_a(int par1, int par2, Tessellator par3Tessellator) { -+ super.func_77222_a(par1, par2, par3Tessellator); -+ -+ if (this.field_77262_g == 0) { -+ GuiStats.drawSprite(this.slotGuiStats, par1 + 115 - 18 + 1, par2 + 1 + 1, 72, 18); -+ } else { -+ GuiStats.drawSprite(this.slotGuiStats, par1 + 115 - 18, par2 + 1, 72, 18); -+ } -+ -+ if (this.field_77262_g == 1) { -+ GuiStats.drawSprite(this.slotGuiStats, par1 + 165 - 18 + 1, par2 + 1 + 1, 18, 18); -+ } else { -+ GuiStats.drawSprite(this.slotGuiStats, par1 + 165 - 18, par2 + 1, 18, 18); -+ } -+ -+ if (this.field_77262_g == 2) { -+ GuiStats.drawSprite(this.slotGuiStats, par1 + 215 - 18 + 1, par2 + 1 + 1, 36, 18); -+ } else { -+ GuiStats.drawSprite(this.slotGuiStats, par1 + 215 - 18, par2 + 1, 36, 18); -+ } -+ } -+ -+ protected void drawSlot(int par1, int par2, int par3, int par4, Tessellator par5Tessellator) { -+ StatCrafting var6 = this.func_77257_d(par1); - int var7 = var6.getItemID(); -- GuiStats.drawItemSprite(this.slotGuiStats, var2 + 40, var3, var7); -- this.func_77260_a((StatCrafting)StatList.objectBreakStats[var7], var2 + 115, var3, var1 % 2 == 0); -- this.func_77260_a((StatCrafting)StatList.objectCraftStats[var7], var2 + 165, var3, var1 % 2 == 0); -- this.func_77260_a(var6, var2 + 215, var3, var1 % 2 == 0); -+ GuiStats.drawItemSprite(this.slotGuiStats, par2 + 40, par3, var7); -+ this.func_77260_a((StatCrafting)StatList.objectBreakStats[var7], par2 + 115, par3, par1 % 2 == 0); -+ this.func_77260_a((StatCrafting)StatList.objectCraftStats[var7], par2 + 165, par3, par1 % 2 == 0); -+ this.func_77260_a(var6, par2 + 215, par3, par1 % 2 == 0); - } - -- protected String func_77258_c(int var1) { -- return var1 == 1 ? "stat.crafted" : (var1 == 2 ? "stat.used" : "stat.depleted"); -+ protected String func_77258_c(int par1) { -+ return par1 == 1 ? "stat.crafted" : (par1 == 2 ? "stat.used" : "stat.depleted"); - } - } ---- net/minecraft/src/RandomPositionGenerator.java -+++ net/minecraft/src/RandomPositionGenerator.java -@@ -3,53 +3,75 @@ - import java.util.Random; - - public class RandomPositionGenerator { -+ -+ /** -+ * used to store a driection when the user passes a point to move towards or away from. WARNING: NEVER THREAD SAFE. -+ * MULTIPLE findTowards and findAway calls, will share this var -+ */ - private static Vec3 staticVector = Vec3.createVectorHelper(0.0D, 0.0D, 0.0D); - -- public static Vec3 findRandomTarget(EntityCreature var0, int var1, int var2) { -- return findRandomTargetBlock(var0, var1, var2, (Vec3)null); -- } -- -- public static Vec3 findRandomTargetBlockTowards(EntityCreature var0, int var1, int var2, Vec3 var3) { -- staticVector.xCoord = var3.xCoord - var0.posX; -- staticVector.yCoord = var3.yCoord - var0.posY; -- staticVector.zCoord = var3.zCoord - var0.posZ; -- return findRandomTargetBlock(var0, var1, var2, staticVector); -- } -- -- public static Vec3 findRandomTargetBlockAwayFrom(EntityCreature var0, int var1, int var2, Vec3 var3) { -- staticVector.xCoord = var0.posX - var3.xCoord; -- staticVector.yCoord = var0.posY - var3.yCoord; -- staticVector.zCoord = var0.posZ - var3.zCoord; -- return findRandomTargetBlock(var0, var1, var2, staticVector); -- } -- -- private static Vec3 findRandomTargetBlock(EntityCreature var0, int var1, int var2, Vec3 var3) { -- Random var4 = var0.getRNG(); -+ /** -+ * finds a random target within par1(x,z) and par2 (y) blocks -+ */ -+ public static Vec3 findRandomTarget(EntityCreature par0EntityCreature, int par1, int par2) { -+ return findRandomTargetBlock(par0EntityCreature, par1, par2, (Vec3)null); -+ } -+ -+ /** -+ * finds a random target within par1(x,z) and par2 (y) blocks in the direction of the point par3 -+ */ -+ public static Vec3 findRandomTargetBlockTowards(EntityCreature par0EntityCreature, int par1, int par2, Vec3 par3Vec3) { -+ staticVector.xCoord = par3Vec3.xCoord - par0EntityCreature.posX; -+ staticVector.yCoord = par3Vec3.yCoord - par0EntityCreature.posY; -+ staticVector.zCoord = par3Vec3.zCoord - par0EntityCreature.posZ; -+ return findRandomTargetBlock(par0EntityCreature, par1, par2, staticVector); -+ } -+ -+ /** -+ * finds a random target within par1(x,z) and par2 (y) blocks in the reverse direction of the point par3 -+ */ -+ public static Vec3 findRandomTargetBlockAwayFrom(EntityCreature par0EntityCreature, int par1, int par2, Vec3 par3Vec3) { -+ staticVector.xCoord = par0EntityCreature.posX - par3Vec3.xCoord; -+ staticVector.yCoord = par0EntityCreature.posY - par3Vec3.yCoord; -+ staticVector.zCoord = par0EntityCreature.posZ - par3Vec3.zCoord; -+ return findRandomTargetBlock(par0EntityCreature, par1, par2, staticVector); -+ } -+ -+ /** -+ * searches 10 blocks at random in a within par1(x,z) and par2 (y) distance, ignores those not in the direction of -+ * par3Vec3, then points to the tile for which creature.getBlockPathWeight returns the highest number -+ */ -+ private static Vec3 findRandomTargetBlock(EntityCreature par0EntityCreature, int par1, int par2, Vec3 par3Vec3) { -+ Random var4 = par0EntityCreature.getRNG(); - boolean var5 = false; - int var6 = 0; - int var7 = 0; - int var8 = 0; - float var9 = -99999.0F; - boolean var10; -- if(var0.hasHome()) { -- double var11 = (double)(var0.getHomePosition().getDistanceSquared(MathHelper.floor_double(var0.posX), MathHelper.floor_double(var0.posY), MathHelper.floor_double(var0.posZ)) + 4.0F); -- double var13 = (double)(var0.func_110174_bM() + (float)var1); -+ -+ if (par0EntityCreature.hasHome()) { -+ double var11 = (double)(par0EntityCreature.getHomePosition().getDistanceSquared(MathHelper.floor_double(par0EntityCreature.posX), MathHelper.floor_double(par0EntityCreature.posY), MathHelper.floor_double(par0EntityCreature.posZ)) + 4.0F); -+ double var13 = (double)(par0EntityCreature.func_110174_bM() + (float)par1); - var10 = var11 < var13 * var13; - } else { - var10 = false; - } - -- for(int var16 = 0; var16 < 10; ++var16) { -- int var12 = var4.nextInt(2 * var1) - var1; -- int var17 = var4.nextInt(2 * var2) - var2; -- int var14 = var4.nextInt(2 * var1) - var1; -- if(var3 == null || (double)var12 * var3.xCoord + (double)var14 * var3.zCoord >= 0.0D) { -- var12 += MathHelper.floor_double(var0.posX); -- var17 += MathHelper.floor_double(var0.posY); -- var14 += MathHelper.floor_double(var0.posZ); -- if(!var10 || var0.func_110176_b(var12, var17, var14)) { -- float var15 = var0.getBlockPathWeight(var12, var17, var14); -- if(var15 > var9) { -+ for (int var16 = 0; var16 < 10; ++var16) { -+ int var12 = var4.nextInt(2 * par1) - par1; -+ int var17 = var4.nextInt(2 * par2) - par2; -+ int var14 = var4.nextInt(2 * par1) - par1; -+ -+ if (par3Vec3 == null || (double)var12 * par3Vec3.xCoord + (double)var14 * par3Vec3.zCoord >= 0.0D) { -+ var12 += MathHelper.floor_double(par0EntityCreature.posX); -+ var17 += MathHelper.floor_double(par0EntityCreature.posY); -+ var14 += MathHelper.floor_double(par0EntityCreature.posZ); -+ -+ if (!var10 || par0EntityCreature.func_110176_b(var12, var17, var14)) { -+ float var15 = par0EntityCreature.getBlockPathWeight(var12, var17, var14); -+ -+ if (var15 > var9) { - var9 = var15; - var6 = var12; - var7 = var17; -@@ -60,8 +82,8 @@ - } - } - -- if(var5) { -- return var0.worldObj.getWorldVec3Pool().getVecFromPool((double)var6, (double)var7, (double)var8); -+ if (var5) { -+ return par0EntityCreature.worldObj.getWorldVec3Pool().getVecFromPool((double)var6, (double)var7, (double)var8); - } else { - return null; - } ---- net/minecraft/src/BlockWoodSlab.java -+++ net/minecraft/src/BlockWoodSlab.java -@@ -4,42 +4,62 @@ - import java.util.Random; - - public class BlockWoodSlab extends BlockHalfSlab { -- public static final String[] b = new String[]{"oak", "spruce", "birch", "jungle"}; -- -- public BlockWoodSlab(int var1, boolean var2) { -- super(var1, var2, Material.wood); -+ -+ /** The type of tree this slab came from. */ -+ public static final String[] woodType = new String[] {"oak", "spruce", "birch", "jungle"}; -+ -+ public BlockWoodSlab(int par1, boolean par2) { -+ super(par1, par2, Material.wood); - this.setCreativeTab(CreativeTabs.tabBlock); - } - -- public Icon getIcon(int var1, int var2) { -- return Block.planks.getIcon(var1, var2 & 7); -+ /** -+ * From the specified side and block metadata retrieves the blocks texture. Args: side, metadata -+ */ -+ public Icon getIcon(int par1, int par2) { -+ return Block.planks.getIcon(par1, par2 & 7); - } - -- public int idDropped(int var1, Random var2, int var3) { -+ /** -+ * Returns the ID of the items to drop on destruction. -+ */ -+ public int idDropped(int par1, Random par2Random, int par3) { - return Block.woodSingleSlab.blockID; - } - -- protected ItemStack createStackedBlock(int var1) { -- return new ItemStack(Block.woodSingleSlab.blockID, 2, var1 & 7); -+ /** -+ * Returns an item stack containing a single instance of the current block type. 'i' is the block's subtype/damage and -+ * is ignored for blocks which do not support subtypes. Blocks which cannot be harvested should return null. -+ */ -+ protected ItemStack createStackedBlock(int par1) { -+ return new ItemStack(Block.woodSingleSlab.blockID, 2, par1 & 7); - } - -- public String getFullSlabName(int var1) { -- if(var1 < 0 || var1 >= b.length) { -- var1 = 0; -+ /** -+ * Returns the slab block name with step type. -+ */ -+ public String getFullSlabName(int par1) { -+ if (par1 < 0 || par1 >= woodType.length) { -+ par1 = 0; - } - -- return super.getUnlocalizedName() + "." + b[var1]; -+ return super.getUnlocalizedName() + "." + woodType[par1]; - } - -- public void getSubBlocks(int var1, CreativeTabs var2, List var3) { -- if(var1 != Block.woodDoubleSlab.blockID) { -- for(int var4 = 0; var4 < 4; ++var4) { -- var3.add(new ItemStack(var1, 1, var4)); -+ /** -+ * returns a list of blocks with the same ID, but different meta (eg: wood returns 4 blocks) -+ */ -+ public void getSubBlocks(int par1, CreativeTabs par2CreativeTabs, List par3List) { -+ if (par1 != Block.woodDoubleSlab.blockID) { -+ for (int var4 = 0; var4 < 4; ++var4) { -+ par3List.add(new ItemStack(par1, 1, var4)); - } -- - } - } - -- public void registerIcons(IconRegister var1) { -- } -+ /** -+ * When this method is called, your block should register all the icons it needs with the given IconRegister. This is -+ * the only chance you get to register icons. -+ */ -+ public void registerIcons(IconRegister par1IconRegister) {} - } ---- /dev/null -+++ org/spoutcraft/api/gui/Container.java -@@ -1,0 +1,128 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.api.gui; -+ -+import org.spoutcraft.api.UnsafeClass; -+ -+@UnsafeClass -+public interface Container extends Widget { -+ /** -+ * Adds a single widget to a container -+ * @param child The widget to add -+ * @return Widget -+ */ -+ public Container addChild(Widget child); -+ -+ /** -+ * Adds a single widget to a container -+ * @param index The position to insert it, use -1 for append -+ * @param child The widget to add -+ * @return Widget -+ */ -+ public Container insertChild(int index, Widget child); -+ -+ /** -+ * Adds a list of children to a container. -+ * @param children The widgets to add -+ * @return -+ */ -+ public Container addChildren(Widget... children); -+ -+ /** -+ * Removes a single widget from this container -+ * @param child The widget to add -+ * @return -+ */ -+ public Container removeChild(Widget child); -+ -+ /** -+ * Get a list of widgets inside this container. -+ * @return -+ */ -+ public Widget[] getChildren(); -+ -+ /** -+ * Set the automatic layout type for children, triggered by setWidth() or setHeight() -+ * @param type ContainerType.VERTICAL, .HORIZONTAL or .OVERLAY -+ * @return the container -+ */ -+ public Container setLayout(ContainerType type); -+ -+ /** -+ * Get the automatic layout type for children -+ * @return the type of container -+ */ -+ public ContainerType getLayout(); -+ -+ /** -+ * Force the container to re-layout all non-fixed children. -+ * Unless you specifically need to update the layout at this instant, -+ * you should use use deferLayout() instead. -+ * This will re-position and resize all child elements. -+ * @return -+ */ -+ public Container updateLayout(); -+ -+ /** -+ * Automatically call updateLayout during the next onTick. -+ * This is automatically called when anything changes that would affect the container layout. -+ * NOTE: Subclasses should ensure they don't prevent Container.onTick() from running. -+ * @return -+ */ -+ public Container deferLayout(); -+ -+ /** -+ * Set the contents alignment. -+ * @return -+ */ -+ public Container setAlign(WidgetAnchor anchor); -+ -+ /** -+ * Get the contents alignment. -+ * @return -+ */ -+ public WidgetAnchor getAlign(); -+ -+ /** -+ * Reverse the drawing order (right to left or bottom to top). -+ * @param reverse Set to reverse direction -+ * @return -+ */ -+ public Container setReverse(boolean reverse); -+ -+ /** -+ * If this is drawing in reverse order. -+ * @return -+ */ -+ public boolean getReverse(); -+ -+ /** -+ * Determines if children expand to fill width and height -+ * @param auto -+ * @return -+ */ -+ public Container setAuto(boolean auto); -+ -+ /** -+ * True if the children will expand to fill width and height -+ * @return -+ */ -+ public boolean isAuto(); -+} ---- /dev/null -+++ org/spoutcraft/api/io/SpoutOutputStream.java -@@ -1,0 +1,174 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.api.io; -+ -+import java.io.OutputStream; -+import java.nio.ByteBuffer; -+import java.util.UUID; -+ -+import org.spoutcraft.api.gui.Color; -+import org.spoutcraft.api.inventory.ItemStack; -+import org.spoutcraft.api.material.Material; -+import org.spoutcraft.api.util.Location; -+import org.spoutcraft.api.util.Vector; -+ -+public class SpoutOutputStream extends OutputStream{ -+ ByteBuffer buffer = ByteBuffer.allocate(1024); -+ public SpoutOutputStream() { -+ } -+ -+ public void writeLocation(Location location) { -+ this.writeDouble(location.getX()); -+ this.writeDouble(location.getY()); -+ this.writeDouble(location.getZ()); -+ this.writeFloat((float) location.getPitch()); -+ this.writeFloat((float) location.getYaw()); -+ this.writeLong(0); -+ this.writeLong(0); -+ } -+ -+ public void writeVector(Vector vector) { -+ this.writeDouble(vector.getX()); -+ this.writeDouble(vector.getY()); -+ this.writeDouble(vector.getZ()); -+ } -+ -+ public void writeItemStack(ItemStack item) { -+ this.writeInt(item.getTypeId()); -+ this.writeShort(item.getDurability()); -+ this.writeShort((short)item.getAmount()); -+ } -+ -+ public void writeMaterial(Material material) { -+ this.writeInt(material.getRawId()); -+ this.writeShort((short) material.getRawData()); -+ } -+ -+ public void writeUUID(UUID uuid) { -+ this.writeLong(uuid.getLeastSignificantBits()); -+ this.writeLong(uuid.getMostSignificantBits()); -+ } -+ -+ @Override -+ public void write(byte[] b) { -+ while (buffer.remaining() < b.length) { -+ expand(); -+ } -+ buffer.put(b); -+ } -+ -+ @Override -+ public void write(byte[] b, int len, int off) { -+ while (buffer.remaining() < b.length) { -+ expand(); -+ } -+ buffer.put(b, len, off); -+ } -+ -+ @Override -+ public void write(int b) { -+ if (buffer.remaining() < 1) { -+ expand(); -+ } -+ buffer.put((byte)b); -+ } -+ -+ public void writeShort(short s) { -+ if (buffer.remaining() < 2) { -+ expand(); -+ } -+ buffer.putShort(s); -+ } -+ -+ public void writeInt(int i) { -+ if (buffer.remaining() < 4) { -+ expand(); -+ } -+ buffer.putInt(i); -+ } -+ -+ public void writeLong(long l) { -+ if (buffer.remaining() < 8) { -+ expand(); -+ } -+ buffer.putLong(l); -+ } -+ -+ public void writeFloat(float f) { -+ if (buffer.remaining() < 4) { -+ expand(); -+ } -+ buffer.putFloat(f); -+ } -+ -+ public void writeDouble(double d) { -+ if (buffer.remaining() < 8) { -+ expand(); -+ } -+ buffer.putDouble(d); -+ } -+ -+ public void writeChar(char ch) { -+ if (buffer.remaining() < 2) { -+ expand(); -+ } -+ buffer.putChar(ch); -+ } -+ -+ public void writeString(String s) { -+ while (buffer.remaining() < (2 + s.length() * 2)) { -+ expand(); -+ } -+ buffer.putShort((short) s.length()); -+ for (int i = 0; i < s.length(); i++) { -+ buffer.putChar(s.charAt(i)); -+ } -+ } -+ -+ public void writeBoolean(boolean b) { -+ write(b ? 1 : 0); -+ } -+ -+ public static final byte FLAG_COLORINVALID = 1; -+ public static final byte FLAG_COLOROVERRIDE = 2; -+ public void writeColor(Color c) { -+ byte flags = 0x0; -+ -+ if (c.getRedF() == -1F) { -+ flags |= FLAG_COLORINVALID; -+ } else if (c.getRedF() == -2F) { -+ flags |= FLAG_COLOROVERRIDE; -+ } -+ -+ write(flags); -+ writeInt(c.toInt()); -+ } -+ -+ public ByteBuffer getRawBuffer() { -+ return buffer; -+ } -+ -+ private void expand() { -+ ByteBuffer replacement = ByteBuffer.allocate(buffer.capacity() * 2); -+ replacement.put(buffer.array()); -+ replacement.position(buffer.position()); -+ buffer = replacement; -+ } -+} ---- net/minecraft/src/ThreadClientSleep.java -+++ net/minecraft/src/ThreadClientSleep.java -@@ -1,20 +1,22 @@ - package net.minecraft.src; - - class ThreadClientSleep extends Thread { -+ -+ /** A reference to the Minecraft object. */ - final Minecraft mc; - -- ThreadClientSleep(Minecraft var1, String var2) { -- super(var2); -- this.mc = var1; -+ ThreadClientSleep(Minecraft par1Minecraft, String par2Str) { -+ super(par2Str); -+ this.mc = par1Minecraft; - } - - public void run() { -- while(this.mc.running) { -+ while (this.mc.running) { - try { - Thread.sleep(2147483647L); - } catch (InterruptedException var2) { -+ ; - } - } -- - } - } ---- net/minecraft/src/AnvilChunkLoaderPending.java -+++ net/minecraft/src/AnvilChunkLoaderPending.java -@@ -4,8 +4,8 @@ - public final ChunkCoordIntPair chunkCoordinate; - public final NBTTagCompound nbtTags; - -- public AnvilChunkLoaderPending(ChunkCoordIntPair var1, NBTTagCompound var2) { -- this.chunkCoordinate = var1; -- this.nbtTags = var2; -+ public AnvilChunkLoaderPending(ChunkCoordIntPair par1ChunkCoordIntPair, NBTTagCompound par2NBTTagCompound) { -+ this.chunkCoordinate = par1ChunkCoordIntPair; -+ this.nbtTags = par2NBTTagCompound; - } - } ---- net/minecraft/src/ThreadPollServers.java -+++ net/minecraft/src/ThreadPollServers.java -@@ -6,18 +6,20 @@ - import java.net.UnknownHostException; - - class ThreadPollServers extends Thread { -+ -+ /** An Instnace of ServerData. */ - final ServerData pollServersServerData; -+ -+ /** Slot container for the server list */ - final GuiSlotServer serverSlotContainer; - -- ThreadPollServers(GuiSlotServer var1, ServerData var2) { -- this.serverSlotContainer = var1; -- this.pollServersServerData = var2; -+ ThreadPollServers(GuiSlotServer par1GuiSlotServer, ServerData par2ServerData) { -+ this.serverSlotContainer = par1GuiSlotServer; -+ this.pollServersServerData = par2ServerData; - } - - public void run() { - boolean var27 = false; -- -- Object var41; - label183: { - label184: { - label185: { -@@ -25,7 +27,7 @@ - label187: { - try { - var27 = true; -- this.pollServersServerData.d = EnumChatFormatting.DARK_GRAY + "Polling.."; -+ this.pollServersServerData.serverMOTD = EnumChatFormatting.DARK_GRAY + "Polling.."; - long var1 = System.nanoTime(); - GuiMultiplayer.func_82291_a(this.pollServersServerData); - long var3 = System.nanoTime(); -@@ -34,76 +36,68 @@ - break label183; - } catch (UnknownHostException var35) { - this.pollServersServerData.pingToServer = -1L; -- this.pollServersServerData.d = EnumChatFormatting.DARK_RED + "Can\'t resolve hostname"; -+ this.pollServersServerData.serverMOTD = EnumChatFormatting.DARK_RED + "Can\'t resolve hostname"; - var27 = false; -+ break label184; - } catch (SocketTimeoutException var36) { - this.pollServersServerData.pingToServer = -1L; -- this.pollServersServerData.d = EnumChatFormatting.DARK_RED + "Can\'t reach server"; -+ this.pollServersServerData.serverMOTD = EnumChatFormatting.DARK_RED + "Can\'t reach server"; - var27 = false; -- break label187; - } catch (ConnectException var37) { - this.pollServersServerData.pingToServer = -1L; -- this.pollServersServerData.d = EnumChatFormatting.DARK_RED + "Can\'t reach server"; -+ this.pollServersServerData.serverMOTD = EnumChatFormatting.DARK_RED + "Can\'t reach server"; - var27 = false; -- break label186; -+ break label187; - } catch (IOException var38) { - this.pollServersServerData.pingToServer = -1L; -- this.pollServersServerData.d = EnumChatFormatting.DARK_RED + "Communication error"; -+ this.pollServersServerData.serverMOTD = EnumChatFormatting.DARK_RED + "Communication error"; - var27 = false; -- break label185; -+ break label186; - } catch (Exception var39) { - this.pollServersServerData.pingToServer = -1L; -- this.pollServersServerData.d = "ERROR: " + var39.getClass(); -+ this.pollServersServerData.serverMOTD = "ERROR: " + var39.getClass(); - var27 = false; -- break label184; -+ break label185; - } finally { -- if(var27) { -- Object var12 = GuiMultiplayer.getLock(); -- synchronized(var12) { -+ if (var27) { -+ synchronized (GuiMultiplayer.getLock()) { - GuiMultiplayer.decreaseThreadsPending(); - } - } - } - -- var41 = GuiMultiplayer.getLock(); -- synchronized(var41) { -+ synchronized (GuiMultiplayer.getLock()) { - GuiMultiplayer.decreaseThreadsPending(); - return; - } - } - -- var41 = GuiMultiplayer.getLock(); -- synchronized(var41) { -+ synchronized (GuiMultiplayer.getLock()) { - GuiMultiplayer.decreaseThreadsPending(); - return; - } - } - -- var41 = GuiMultiplayer.getLock(); -- synchronized(var41) { -+ synchronized (GuiMultiplayer.getLock()) { - GuiMultiplayer.decreaseThreadsPending(); - return; - } - } - -- var41 = GuiMultiplayer.getLock(); -- synchronized(var41) { -+ synchronized (GuiMultiplayer.getLock()) { - GuiMultiplayer.decreaseThreadsPending(); - return; - } - } - -- var41 = GuiMultiplayer.getLock(); -- synchronized(var41) { -+ synchronized (GuiMultiplayer.getLock()) { - GuiMultiplayer.decreaseThreadsPending(); - return; - } - } - -- var41 = GuiMultiplayer.getLock(); -- synchronized(var41) { -+ synchronized (GuiMultiplayer.getLock()) { - GuiMultiplayer.decreaseThreadsPending(); - } -- - } - } ---- net/minecraft/src/WorldGenGlowStone2.java -+++ net/minecraft/src/WorldGenGlowStone2.java -@@ -3,54 +3,56 @@ - import java.util.Random; - - public class WorldGenGlowStone2 extends WorldGenerator { -- public boolean generate(World var1, Random var2, int var3, int var4, int var5) { -- if(!var1.isAirBlock(var3, var4, var5)) { -+ public boolean generate(World par1World, Random par2Random, int par3, int par4, int par5) { -+ if (!par1World.isAirBlock(par3, par4, par5)) { - return false; -- } else if(var1.getBlockId(var3, var4 + 1, var5) != Block.netherrack.blockID) { -+ } else if (par1World.getBlockId(par3, par4 + 1, par5) != Block.netherrack.blockID) { - return false; - } else { -- var1.setBlock(var3, var4, var5, Block.glowStone.blockID, 0, 2); -- -- for(int var6 = 0; var6 < 1500; ++var6) { -- int var7 = var3 + var2.nextInt(8) - var2.nextInt(8); -- int var8 = var4 - var2.nextInt(12); -- int var9 = var5 + var2.nextInt(8) - var2.nextInt(8); -- if(var1.getBlockId(var7, var8, var9) == 0) { -+ par1World.setBlock(par3, par4, par5, Block.glowStone.blockID, 0, 2); -+ -+ for (int var6 = 0; var6 < 1500; ++var6) { -+ int var7 = par3 + par2Random.nextInt(8) - par2Random.nextInt(8); -+ int var8 = par4 - par2Random.nextInt(12); -+ int var9 = par5 + par2Random.nextInt(8) - par2Random.nextInt(8); -+ -+ if (par1World.getBlockId(var7, var8, var9) == 0) { - int var10 = 0; - -- for(int var11 = 0; var11 < 6; ++var11) { -+ for (int var11 = 0; var11 < 6; ++var11) { - int var12 = 0; -- if(var11 == 0) { -- var12 = var1.getBlockId(var7 - 1, var8, var9); -- } -- -- if(var11 == 1) { -- var12 = var1.getBlockId(var7 + 1, var8, var9); -- } -- -- if(var11 == 2) { -- var12 = var1.getBlockId(var7, var8 - 1, var9); -- } -- -- if(var11 == 3) { -- var12 = var1.getBlockId(var7, var8 + 1, var9); -- } -- -- if(var11 == 4) { -- var12 = var1.getBlockId(var7, var8, var9 - 1); -- } -- -- if(var11 == 5) { -- var12 = var1.getBlockId(var7, var8, var9 + 1); -- } -- -- if(var12 == Block.glowStone.blockID) { -+ -+ if (var11 == 0) { -+ var12 = par1World.getBlockId(var7 - 1, var8, var9); -+ } -+ -+ if (var11 == 1) { -+ var12 = par1World.getBlockId(var7 + 1, var8, var9); -+ } -+ -+ if (var11 == 2) { -+ var12 = par1World.getBlockId(var7, var8 - 1, var9); -+ } -+ -+ if (var11 == 3) { -+ var12 = par1World.getBlockId(var7, var8 + 1, var9); -+ } -+ -+ if (var11 == 4) { -+ var12 = par1World.getBlockId(var7, var8, var9 - 1); -+ } -+ -+ if (var11 == 5) { -+ var12 = par1World.getBlockId(var7, var8, var9 + 1); -+ } -+ -+ if (var12 == Block.glowStone.blockID) { - ++var10; - } - } - -- if(var10 == 1) { -- var1.setBlock(var7, var8, var9, Block.glowStone.blockID, 0, 2); -+ if (var10 == 1) { -+ par1World.setBlock(var7, var8, var9, Block.glowStone.blockID, 0, 2); - } - } - } ---- net/minecraft/src/EntityNoteFX.java -+++ net/minecraft/src/EntityNoteFX.java -@@ -3,62 +3,68 @@ - public class EntityNoteFX extends EntityFX { - float noteParticleScale; - -- public EntityNoteFX(World var1, double var2, double var4, double var6, double var8, double var10, double var12) { -- this(var1, var2, var4, var6, var8, var10, var12, 2.0F); -+ public EntityNoteFX(World par1World, double par2, double par4, double par6, double par8, double par10, double par12) { -+ this(par1World, par2, par4, par6, par8, par10, par12, 2.0F); - } - -- public EntityNoteFX(World var1, double var2, double var4, double var6, double var8, double var10, double var12, float var14) { -- super(var1, var2, var4, var6, 0.0D, 0.0D, 0.0D); -- this.motionX *= (double)0.01F; -- this.motionY *= (double)0.01F; -- this.motionZ *= (double)0.01F; -+ public EntityNoteFX(World par1World, double par2, double par4, double par6, double par8, double par10, double par12, float par14) { -+ super(par1World, par2, par4, par6, 0.0D, 0.0D, 0.0D); -+ this.motionX *= 0.009999999776482582D; -+ this.motionY *= 0.009999999776482582D; -+ this.motionZ *= 0.009999999776482582D; - this.motionY += 0.2D; -- this.particleRed = MathHelper.sin(((float)var8 + 0.0F) * (float)Math.PI * 2.0F) * 0.65F + 0.35F; -- this.particleGreen = MathHelper.sin(((float)var8 + 1.0F / 3.0F) * (float)Math.PI * 2.0F) * 0.65F + 0.35F; -- this.particleBlue = MathHelper.sin(((float)var8 + 2.0F / 3.0F) * (float)Math.PI * 2.0F) * 0.65F + 0.35F; -- this.particleScale *= 12.0F / 16.0F; -- this.particleScale *= var14; -+ this.particleRed = MathHelper.sin(((float)par8 + 0.0F) * (float)Math.PI * 2.0F) * 0.65F + 0.35F; -+ this.particleGreen = MathHelper.sin(((float)par8 + 0.33333334F) * (float)Math.PI * 2.0F) * 0.65F + 0.35F; -+ this.particleBlue = MathHelper.sin(((float)par8 + 0.6666667F) * (float)Math.PI * 2.0F) * 0.65F + 0.35F; -+ this.particleScale *= 0.75F; -+ this.particleScale *= par14; - this.noteParticleScale = this.particleScale; - this.particleMaxAge = 6; - this.noClip = false; - this.setParticleTextureIndex(64); - } - -- public void renderParticle(Tessellator var1, float var2, float var3, float var4, float var5, float var6, float var7) { -- float var8 = ((float)this.particleAge + var2) / (float)this.particleMaxAge * 32.0F; -- if(var8 < 0.0F) { -+ public void renderParticle(Tessellator par1Tessellator, float par2, float par3, float par4, float par5, float par6, float par7) { -+ float var8 = ((float)this.particleAge + par2) / (float)this.particleMaxAge * 32.0F; -+ -+ if (var8 < 0.0F) { - var8 = 0.0F; - } - -- if(var8 > 1.0F) { -+ if (var8 > 1.0F) { - var8 = 1.0F; - } - - this.particleScale = this.noteParticleScale * var8; -- super.renderParticle(var1, var2, var3, var4, var5, var6, var7); -+ super.renderParticle(par1Tessellator, par2, par3, par4, par5, par6, par7); - } - -+ /** -+ * Called to update the entity's position/logic. -+ */ - public void onUpdate() { - this.prevPosX = this.posX; - this.prevPosY = this.posY; - this.prevPosZ = this.posZ; -- if(this.particleAge++ >= this.particleMaxAge) { -+ -+ if (this.particleAge++ >= this.particleMaxAge) { - this.setDead(); - } - - this.moveEntity(this.motionX, this.motionY, this.motionZ); -- if(this.posY == this.prevPosY) { -+ -+ if (this.posY == this.prevPosY) { - this.motionX *= 1.1D; - this.motionZ *= 1.1D; - } - -- this.motionX *= (double)0.66F; -- this.motionY *= (double)0.66F; -- this.motionZ *= (double)0.66F; -- if(this.onGround) { -- this.motionX *= (double)0.7F; -- this.motionZ *= (double)0.7F; -- } -+ this.motionX *= 0.6600000262260437D; -+ this.motionY *= 0.6600000262260437D; -+ this.motionZ *= 0.6600000262260437D; - -+ if (this.onGround) { -+ this.motionX *= 0.699999988079071D; -+ this.motionZ *= 0.699999988079071D; -+ } - } - } ---- net/minecraft/src/ModelEnderman.java -+++ net/minecraft/src/ModelEnderman.java -@@ -1,7 +1,11 @@ - package net.minecraft.src; - - public class ModelEnderman extends ModelBiped { -+ -+ /** Is the enderman carrying a block? */ - public boolean isCarrying; -+ -+ /** Is the enderman attacking an entity? */ - public boolean isAttacking; - - public ModelEnderman() { -@@ -30,8 +34,13 @@ - this.bipedLeftLeg.setRotationPoint(2.0F, 12.0F + var1, 0.0F); - } - -- public void setRotationAngles(float var1, float var2, float var3, float var4, float var5, float var6, Entity var7) { -- super.setRotationAngles(var1, var2, var3, var4, var5, var6, var7); -+ /** -+ * Sets the model's various rotation angles. For bipeds, par1 and par2 are used for animating the movement of arms and -+ * legs, where par1 represents the time(so that arms and legs swing back and forth) and par2 represents how "far" arms -+ * and legs can swing at most. -+ */ -+ public void setRotationAngles(float par1, float par2, float par3, float par4, float par5, float par6, Entity par7Entity) { -+ super.setRotationAngles(par1, par2, par3, par4, par5, par6, par7Entity); - this.bipedHead.showModel = true; - float var8 = -14.0F; - this.bipedBody.rotateAngleX = 0.0F; -@@ -44,39 +53,40 @@ - this.bipedRightLeg.rotateAngleX = (float)((double)this.bipedRightLeg.rotateAngleX * 0.5D); - this.bipedLeftLeg.rotateAngleX = (float)((double)this.bipedLeftLeg.rotateAngleX * 0.5D); - float var9 = 0.4F; -- if(this.bipedRightArm.rotateAngleX > var9) { -+ -+ if (this.bipedRightArm.rotateAngleX > var9) { - this.bipedRightArm.rotateAngleX = var9; - } - -- if(this.bipedLeftArm.rotateAngleX > var9) { -+ if (this.bipedLeftArm.rotateAngleX > var9) { - this.bipedLeftArm.rotateAngleX = var9; - } - -- if(this.bipedRightArm.rotateAngleX < -var9) { -+ if (this.bipedRightArm.rotateAngleX < -var9) { - this.bipedRightArm.rotateAngleX = -var9; - } - -- if(this.bipedLeftArm.rotateAngleX < -var9) { -+ if (this.bipedLeftArm.rotateAngleX < -var9) { - this.bipedLeftArm.rotateAngleX = -var9; - } - -- if(this.bipedRightLeg.rotateAngleX > var9) { -+ if (this.bipedRightLeg.rotateAngleX > var9) { - this.bipedRightLeg.rotateAngleX = var9; - } - -- if(this.bipedLeftLeg.rotateAngleX > var9) { -+ if (this.bipedLeftLeg.rotateAngleX > var9) { - this.bipedLeftLeg.rotateAngleX = var9; - } - -- if(this.bipedRightLeg.rotateAngleX < -var9) { -+ if (this.bipedRightLeg.rotateAngleX < -var9) { - this.bipedRightLeg.rotateAngleX = -var9; - } - -- if(this.bipedLeftLeg.rotateAngleX < -var9) { -+ if (this.bipedLeftLeg.rotateAngleX < -var9) { - this.bipedLeftLeg.rotateAngleX = -var9; - } - -- if(this.isCarrying) { -+ if (this.isCarrying) { - this.bipedRightArm.rotateAngleX = -0.5F; - this.bipedLeftArm.rotateAngleX = -0.5F; - this.bipedRightArm.rotateAngleZ = 0.05F; -@@ -97,10 +107,10 @@ - this.bipedHeadwear.rotateAngleX = this.bipedHead.rotateAngleX; - this.bipedHeadwear.rotateAngleY = this.bipedHead.rotateAngleY; - this.bipedHeadwear.rotateAngleZ = this.bipedHead.rotateAngleZ; -- if(this.isAttacking) { -+ -+ if (this.isAttacking) { - float var10 = 1.0F; - this.bipedHead.rotationPointY -= var10 * 5.0F; - } -- - } - } ---- net/minecraft/src/EntityAIMoveTowardsRestriction.java -+++ net/minecraft/src/EntityAIMoveTowardsRestriction.java -@@ -7,19 +7,23 @@ - private double movePosZ; - private double movementSpeed; - -- public EntityAIMoveTowardsRestriction(EntityCreature var1, double var2) { -- this.theEntity = var1; -- this.movementSpeed = var2; -+ public EntityAIMoveTowardsRestriction(EntityCreature par1EntityCreature, double par2) { -+ this.theEntity = par1EntityCreature; -+ this.movementSpeed = par2; - this.setMutexBits(1); - } - -+ /** -+ * Returns whether the EntityAIBase should begin execution. -+ */ - public boolean shouldExecute() { -- if(this.theEntity.func_110173_bK()) { -+ if (this.theEntity.func_110173_bK()) { - return false; - } else { - ChunkCoordinates var1 = this.theEntity.getHomePosition(); - Vec3 var2 = RandomPositionGenerator.findRandomTargetBlockTowards(this.theEntity, 16, 7, this.theEntity.worldObj.getWorldVec3Pool().getVecFromPool((double)var1.posX, (double)var1.posY, (double)var1.posZ)); -- if(var2 == null) { -+ -+ if (var2 == null) { - return false; - } else { - this.movePosX = var2.xCoord; -@@ -30,10 +34,16 @@ - } - } - -+ /** -+ * Returns whether an in-progress EntityAIBase should continue executing -+ */ - public boolean continueExecuting() { - return !this.theEntity.getNavigator().noPath(); - } - -+ /** -+ * Execute a one shot task or start executing a continuous task -+ */ - public void startExecuting() { - this.theEntity.getNavigator().tryMoveToXYZ(this.movePosX, this.movePosY, this.movePosZ, this.movementSpeed); - } ---- net/minecraft/src/RenderSnowMan.java -+++ net/minecraft/src/RenderSnowMan.java -@@ -2,43 +2,63 @@ - - import org.lwjgl.opengl.GL11; - -+import com.prupe.mcpatcher.mob.MobOverlay; -+ - public class RenderSnowMan extends RenderLiving { - private static final ResourceLocation snowManTextures = new ResourceLocation("textures/entity/snowman.png"); -- private ModelSnowMan snowmanModel = (ModelSnowMan)this.mainModel; -+ /** A reference to the Snowman model in RenderSnowMan. */ -+ private ModelSnowMan snowmanModel; - - public RenderSnowMan() { - super(new ModelSnowMan(), 0.5F); -+ this.snowmanModel = (ModelSnowMan)super.mainModel; - this.setRenderPassModel(this.snowmanModel); - } - -- protected void renderSnowmanPumpkin(EntitySnowman var1, float var2) { -- super.renderEquippedItems(var1, var2); -+ /** -+ * Renders this snowman's pumpkin. -+ */ -+ protected void renderSnowmanPumpkin(EntitySnowman par1EntitySnowman, float par2) { -+ super.renderEquippedItems(par1EntitySnowman, par2); - ItemStack var3 = new ItemStack(Block.pumpkin, 1); -- if(var3 != null && var3.getItem().itemID < 256) { -+ -+ if (var3 != null && var3.getItem().itemID < 256) { - GL11.glPushMatrix(); -- this.snowmanModel.head.postRender(1.0F / 16.0F); -- if(RenderBlocks.renderItemIn3d(Block.blocksList[var3.itemID].getRenderType())) { -- float var4 = 10.0F / 16.0F; -- GL11.glTranslatef(0.0F, -(11.0F / 32.0F), 0.0F); -+ this.snowmanModel.head.postRender(0.0625F); -+ -+ if (RenderBlocks.renderItemIn3d(Block.blocksList[var3.itemID].getRenderType())) { -+ float var4 = 0.625F; -+ GL11.glTranslatef(0.0F, -0.34375F, 0.0F); - GL11.glRotatef(90.0F, 0.0F, 1.0F, 0.0F); - GL11.glScalef(var4, -var4, var4); - } - -- this.renderManager.itemRenderer.renderItem(var1, var3, 0); -+ // MCPatcher Start -+ if (MobOverlay.setupSnowman(par1EntitySnowman)) { -+ this.bindTexture(MobOverlay.snowmanOverlayTexture); -+ MobOverlay.renderSnowmanOverlay(); -+ } else { -+ this.renderManager.itemRenderer.renderItem(par1EntitySnowman, var3, 0); -+ } -+ // MCPatcher End -+ - GL11.glPopMatrix(); - } -- - } - -- protected ResourceLocation getSnowManTextures(EntitySnowman var1) { -+ -+ protected ResourceLocation getSnowManTextures(EntitySnowman par1EntitySnowman) { - return snowManTextures; - } - -- protected void renderEquippedItems(EntityLivingBase var1, float var2) { -- this.renderSnowmanPumpkin((EntitySnowman)var1, var2); -+ protected void renderEquippedItems(EntityLivingBase par1EntityLivingBase, float par2) { -+ this.renderSnowmanPumpkin((EntitySnowman)par1EntityLivingBase, par2); - } - -- protected ResourceLocation getEntityTexture(Entity var1) { -- return this.getSnowManTextures((EntitySnowman)var1); -+ /** -+ * Returns the location of an entity's texture. Doesn't seem to be called unless you call Render.bindEntityTexture. -+ */ -+ protected ResourceLocation getEntityTexture(Entity par1Entity) { -+ return this.getSnowManTextures((EntitySnowman)par1Entity); - } - } ---- net/minecraft/src/EntityHeartFX.java -+++ net/minecraft/src/EntityHeartFX.java -@@ -3,59 +3,65 @@ - public class EntityHeartFX extends EntityFX { - float particleScaleOverTime; - -- public EntityHeartFX(World var1, double var2, double var4, double var6, double var8, double var10, double var12) { -- this(var1, var2, var4, var6, var8, var10, var12, 2.0F); -+ public EntityHeartFX(World par1World, double par2, double par4, double par6, double par8, double par10, double par12) { -+ this(par1World, par2, par4, par6, par8, par10, par12, 2.0F); - } - -- public EntityHeartFX(World var1, double var2, double var4, double var6, double var8, double var10, double var12, float var14) { -- super(var1, var2, var4, var6, 0.0D, 0.0D, 0.0D); -- this.motionX *= (double)0.01F; -- this.motionY *= (double)0.01F; -- this.motionZ *= (double)0.01F; -+ public EntityHeartFX(World par1World, double par2, double par4, double par6, double par8, double par10, double par12, float par14) { -+ super(par1World, par2, par4, par6, 0.0D, 0.0D, 0.0D); -+ this.motionX *= 0.009999999776482582D; -+ this.motionY *= 0.009999999776482582D; -+ this.motionZ *= 0.009999999776482582D; - this.motionY += 0.1D; -- this.particleScale *= 12.0F / 16.0F; -- this.particleScale *= var14; -+ this.particleScale *= 0.75F; -+ this.particleScale *= par14; - this.particleScaleOverTime = this.particleScale; - this.particleMaxAge = 16; - this.noClip = false; - this.setParticleTextureIndex(80); - } - -- public void renderParticle(Tessellator var1, float var2, float var3, float var4, float var5, float var6, float var7) { -- float var8 = ((float)this.particleAge + var2) / (float)this.particleMaxAge * 32.0F; -- if(var8 < 0.0F) { -+ public void renderParticle(Tessellator par1Tessellator, float par2, float par3, float par4, float par5, float par6, float par7) { -+ float var8 = ((float)this.particleAge + par2) / (float)this.particleMaxAge * 32.0F; -+ -+ if (var8 < 0.0F) { - var8 = 0.0F; - } - -- if(var8 > 1.0F) { -+ if (var8 > 1.0F) { - var8 = 1.0F; - } - - this.particleScale = this.particleScaleOverTime * var8; -- super.renderParticle(var1, var2, var3, var4, var5, var6, var7); -+ super.renderParticle(par1Tessellator, par2, par3, par4, par5, par6, par7); - } - -+ /** -+ * Called to update the entity's position/logic. -+ */ - public void onUpdate() { - this.prevPosX = this.posX; - this.prevPosY = this.posY; - this.prevPosZ = this.posZ; -- if(this.particleAge++ >= this.particleMaxAge) { -+ -+ if (this.particleAge++ >= this.particleMaxAge) { - this.setDead(); - } - - this.moveEntity(this.motionX, this.motionY, this.motionZ); -- if(this.posY == this.prevPosY) { -+ -+ if (this.posY == this.prevPosY) { - this.motionX *= 1.1D; - this.motionZ *= 1.1D; - } - -- this.motionX *= (double)0.86F; -- this.motionY *= (double)0.86F; -- this.motionZ *= (double)0.86F; -- if(this.onGround) { -- this.motionX *= (double)0.7F; -- this.motionZ *= (double)0.7F; -- } -+ this.motionX *= 0.8600000143051147D; -+ this.motionY *= 0.8600000143051147D; -+ this.motionZ *= 0.8600000143051147D; - -+ if (this.onGround) { -+ this.motionX *= 0.699999988079071D; -+ this.motionZ *= 0.699999988079071D; -+ } - } - } ---- net/minecraft/src/ExceptionMcoHttp.java -+++ net/minecraft/src/ExceptionMcoHttp.java -@@ -1,7 +1,7 @@ - package net.minecraft.src; - - public class ExceptionMcoHttp extends RuntimeException { -- public ExceptionMcoHttp(String var1, Exception var2) { -- super(var1, var2); -+ public ExceptionMcoHttp(String par1Str, Exception par2Exception) { -+ super(par1Str, par2Exception); - } - } ---- net/minecraft/src/LogAgent.java -+++ net/minecraft/src/LogAgent.java -@@ -7,73 +7,75 @@ - import java.util.logging.Logger; - - public class LogAgent implements ILogAgent { -- private final Logger a; -- private final String b; -- private final String c; -- private final String d; -+ private final Logger serverLogger; -+ private final String logFile; -+ private final String loggerName; -+ private final String loggerPrefix; - -- public LogAgent(String var1, String var2, String var3) { -- this.a = Logger.getLogger(var1); -- this.c = var1; -- this.d = var2; -- this.b = var3; -+ public LogAgent(String par1Str, String par2Str, String par3Str) { -+ this.serverLogger = Logger.getLogger(par1Str); -+ this.loggerName = par1Str; -+ this.loggerPrefix = par2Str; -+ this.logFile = par3Str; - this.setupLogger(); - } - -+ /** -+ * Sets up the logger for usage. -+ */ - private void setupLogger() { -- this.a.setUseParentHandlers(false); -- Handler[] var1 = this.a.getHandlers(); -+ this.serverLogger.setUseParentHandlers(false); -+ Handler[] var1 = this.serverLogger.getHandlers(); - int var2 = var1.length; - -- for(int var3 = 0; var3 < var2; ++var3) { -+ for (int var3 = 0; var3 < var2; ++var3) { - Handler var4 = var1[var3]; -- this.a.removeHandler(var4); -+ this.serverLogger.removeHandler(var4); - } - - LogFormatter var6 = new LogFormatter(this, (LogAgentEmptyAnon)null); - ConsoleHandler var7 = new ConsoleHandler(); - var7.setFormatter(var6); -- this.a.addHandler(var7); -+ this.serverLogger.addHandler(var7); - - try { -- FileHandler var8 = new FileHandler(this.b, true); -+ FileHandler var8 = new FileHandler(this.logFile, true); - var8.setFormatter(var6); -- this.a.addHandler(var8); -+ this.serverLogger.addHandler(var8); - } catch (Exception var5) { -- this.a.log(Level.WARNING, "Failed to log " + this.c + " to " + this.b, var5); -+ this.serverLogger.log(Level.WARNING, "Failed to log " + this.loggerName + " to " + this.logFile, var5); - } -- -- } -- -- public void logInfo(String var1) { -- this.a.log(Level.INFO, var1); -- } -- -- public void logWarning(String var1) { -- this.a.log(Level.WARNING, var1); -- } -- -- public void logWarningFormatted(String var1, Object... var2) { -- this.a.log(Level.WARNING, var1, var2); -- } -- -- public void logWarningException(String var1, Throwable var2) { -- this.a.log(Level.WARNING, var1, var2); -- } -- -- public void logSevere(String var1) { -- this.a.log(Level.SEVERE, var1); -- } -- -- public void logSevereException(String var1, Throwable var2) { -- this.a.log(Level.SEVERE, var1, var2); -- } -- -- public void logFine(String var1) { -- this.a.log(Level.FINE, var1); -- } -- -- static String func_98237_a(LogAgent var0) { -- return var0.d; -+ } -+ -+ public void logInfo(String par1Str) { -+ this.serverLogger.log(Level.INFO, par1Str); -+ } -+ -+ public void logWarning(String par1Str) { -+ this.serverLogger.log(Level.WARNING, par1Str); -+ } -+ -+ public void logWarningFormatted(String par1Str, Object ... par2ArrayOfObj) { -+ this.serverLogger.log(Level.WARNING, par1Str, par2ArrayOfObj); -+ } -+ -+ public void logWarningException(String par1Str, Throwable par2Throwable) { -+ this.serverLogger.log(Level.WARNING, par1Str, par2Throwable); -+ } -+ -+ public void logSevere(String par1Str) { -+ this.serverLogger.log(Level.SEVERE, par1Str); -+ } -+ -+ public void logSevereException(String par1Str, Throwable par2Throwable) { -+ this.serverLogger.log(Level.SEVERE, par1Str, par2Throwable); -+ } -+ -+ public void logFine(String par1Str) { -+ this.serverLogger.log(Level.FINE, par1Str); -+ } -+ -+ static String func_98237_a(LogAgent par0LogAgent) { -+ return par0LogAgent.loggerPrefix; - } - } ---- net/minecraft/src/ItemNameTag.java -+++ net/minecraft/src/ItemNameTag.java -@@ -1,22 +1,25 @@ - package net.minecraft.src; - - public class ItemNameTag extends Item { -- public ItemNameTag(int var1) { -- super(var1); -+ public ItemNameTag(int par1) { -+ super(par1); - this.setCreativeTab(CreativeTabs.tabTools); - } - -- public boolean itemInteractionForEntity(ItemStack var1, EntityPlayer var2, EntityLivingBase var3) { -- if(!var1.hasDisplayName()) { -+ /** -+ * Returns true if the item can be used on the given entity, e.g. shears on sheep. -+ */ -+ public boolean itemInteractionForEntity(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, EntityLivingBase par3EntityLivingBase) { -+ if (!par1ItemStack.hasDisplayName()) { - return false; -- } else if(var3 instanceof EntityLiving) { -- EntityLiving var4 = (EntityLiving)var3; -- var4.setCustomNameTag(var1.getDisplayName()); -+ } else if (par3EntityLivingBase instanceof EntityLiving) { -+ EntityLiving var4 = (EntityLiving)par3EntityLivingBase; -+ var4.setCustomNameTag(par1ItemStack.getDisplayName()); - var4.func_110163_bv(); -- --var1.stackSize; -+ --par1ItemStack.stackSize; - return true; - } else { -- return super.itemInteractionForEntity(var1, var2, var3); -+ return super.itemInteractionForEntity(par1ItemStack, par2EntityPlayer, par3EntityLivingBase); - } - } - } ---- net/minecraft/src/GuiRenameWorld.java -+++ net/minecraft/src/GuiRenameWorld.java -@@ -5,66 +5,86 @@ - public class GuiRenameWorld extends GuiScreen { - private GuiScreen parentGuiScreen; - private GuiTextField theGuiTextField; -- private final String c; -+ private final String worldName; - -- public GuiRenameWorld(GuiScreen var1, String var2) { -- this.parentGuiScreen = var1; -- this.c = var2; -+ public GuiRenameWorld(GuiScreen par1GuiScreen, String par2Str) { -+ this.parentGuiScreen = par1GuiScreen; -+ this.worldName = par2Str; - } - -+ /** -+ * Called from the main game loop to update the screen. -+ */ - public void updateScreen() { - this.theGuiTextField.updateCursorCounter(); - } - -+ /** -+ * Adds the buttons (and other controls) to the screen in question. -+ */ - public void initGui() { - Keyboard.enableRepeatEvents(true); -- this.i.clear(); -- this.i.add(new GuiButton(0, this.width / 2 - 100, this.height / 4 + 96 + 12, I18n.getString("selectWorld.renameButton"))); -- this.i.add(new GuiButton(1, this.width / 2 - 100, this.height / 4 + 120 + 12, I18n.getString("gui.cancel"))); -+ this.buttonList.clear(); -+ this.buttonList.add(new GuiButton(0, this.width / 2 - 100, this.height / 4 + 96 + 12, I18n.getString("selectWorld.renameButton"))); -+ this.buttonList.add(new GuiButton(1, this.width / 2 - 100, this.height / 4 + 120 + 12, I18n.getString("gui.cancel"))); - ISaveFormat var1 = this.mc.getSaveLoader(); -- WorldInfo var2 = var1.getWorldInfo(this.c); -+ WorldInfo var2 = var1.getWorldInfo(this.worldName); - String var3 = var2.getWorldName(); - this.theGuiTextField = new GuiTextField(this.fontRenderer, this.width / 2 - 100, 60, 200, 20); - this.theGuiTextField.setFocused(true); - this.theGuiTextField.setText(var3); - } - -+ /** -+ * Called when the screen is unloaded. Used to disable keyboard repeat events -+ */ - public void onGuiClosed() { - Keyboard.enableRepeatEvents(false); - } - -- protected void actionPerformed(GuiButton var1) { -- if(var1.enabled) { -- if(var1.id == 1) { -+ /** -+ * Fired when a control is clicked. This is the equivalent of ActionListener.actionPerformed(ActionEvent e). -+ */ -+ protected void actionPerformed(GuiButton par1GuiButton) { -+ if (par1GuiButton.enabled) { -+ if (par1GuiButton.id == 1) { - this.mc.displayGuiScreen(this.parentGuiScreen); -- } else if(var1.id == 0) { -+ } else if (par1GuiButton.id == 0) { - ISaveFormat var2 = this.mc.getSaveLoader(); -- var2.renameWorld(this.c, this.theGuiTextField.getText().trim()); -+ var2.renameWorld(this.worldName, this.theGuiTextField.getText().trim()); - this.mc.displayGuiScreen(this.parentGuiScreen); - } -- -- } -- } -- -- protected void keyTyped(char var1, int var2) { -- this.theGuiTextField.textboxKeyTyped(var1, var2); -- ((GuiButton)this.i.get(0)).enabled = this.theGuiTextField.getText().trim().length() > 0; -- if(var2 == 28 || var2 == 156) { -- this.actionPerformed((GuiButton)this.i.get(0)); -- } -- -- } -- -- protected void mouseClicked(int var1, int var2, int var3) { -- super.mouseClicked(var1, var2, var3); -- this.theGuiTextField.mouseClicked(var1, var2, var3); -- } -- -- public void drawScreen(int var1, int var2, float var3) { -+ } -+ } -+ -+ /** -+ * Fired when a key is typed. This is the equivalent of KeyListener.keyTyped(KeyEvent e). -+ */ -+ protected void keyTyped(char par1, int par2) { -+ this.theGuiTextField.textboxKeyTyped(par1, par2); -+ ((GuiButton)this.buttonList.get(0)).enabled = this.theGuiTextField.getText().trim().length() > 0; -+ -+ if (par2 == 28 || par2 == 156) { -+ this.actionPerformed((GuiButton)this.buttonList.get(0)); -+ } -+ } -+ -+ /** -+ * Called when the mouse is clicked. -+ */ -+ protected void mouseClicked(int par1, int par2, int par3) { -+ super.mouseClicked(par1, par2, par3); -+ this.theGuiTextField.mouseClicked(par1, par2, par3); -+ } -+ -+ /** -+ * Draws the screen and all the components in it. -+ */ -+ public void drawScreen(int par1, int par2, float par3) { - this.drawDefaultBackground(); - this.drawCenteredString(this.fontRenderer, I18n.getString("selectWorld.renameTitle"), this.width / 2, 20, 16777215); - this.drawString(this.fontRenderer, I18n.getString("selectWorld.enterName"), this.width / 2 - 100, 47, 10526880); - this.theGuiTextField.drawTextBox(); -- super.drawScreen(var1, var2, var3); -+ super.drawScreen(par1, par2, par3); - } - } ---- net/minecraft/src/GuiScreenTemporaryResourcePackSelectSelectionList.java -+++ net/minecraft/src/GuiScreenTemporaryResourcePackSelectSelectionList.java -@@ -7,43 +7,56 @@ - class GuiScreenTemporaryResourcePackSelectSelectionList extends GuiSlot { - private final ResourcePackRepository field_110511_b; - private ResourceLocation field_110513_h; -+ - final GuiScreenTemporaryResourcePackSelect field_110512_a; - -- public GuiScreenTemporaryResourcePackSelectSelectionList(GuiScreenTemporaryResourcePackSelect var1, ResourcePackRepository var2) { -- super(GuiScreenTemporaryResourcePackSelect.func_110344_a(var1), var1.width, var1.height, 32, var1.height - 55 + 4, 36); -- this.field_110512_a = var1; -- this.field_110511_b = var2; -- var2.updateRepositoryEntriesAll(); -+ public GuiScreenTemporaryResourcePackSelectSelectionList(GuiScreenTemporaryResourcePackSelect par1GuiScreenTemporaryResourcePackSelect, ResourcePackRepository par2ResourcePackRepository) { -+ super(GuiScreenTemporaryResourcePackSelect.func_110344_a(par1GuiScreenTemporaryResourcePackSelect), par1GuiScreenTemporaryResourcePackSelect.width, par1GuiScreenTemporaryResourcePackSelect.height, 32, par1GuiScreenTemporaryResourcePackSelect.height - 55 + 4, 36); -+ this.field_110512_a = par1GuiScreenTemporaryResourcePackSelect; -+ this.field_110511_b = par2ResourcePackRepository; -+ par2ResourcePackRepository.updateRepositoryEntriesAll(); - } - -+ /** -+ * Gets the size of the current slot list. -+ */ - protected int getSize() { - return 1 + this.field_110511_b.getRepositoryEntriesAll().size(); - } - -- protected void elementClicked(int var1, boolean var2) { -+ /** -+ * the element in the slot that was clicked, boolean for wether it was double clicked or not -+ */ -+ protected void elementClicked(int par1, boolean par2) { - List var3 = this.field_110511_b.getRepositoryEntriesAll(); - - try { -- if(var1 == 0) { -+ if (par1 == 0) { - throw new RuntimeException("This is so horrible ;D"); - } - -- this.field_110511_b.setRepositoryEntries(new ResourcePackRepositoryEntry[]{(ResourcePackRepositoryEntry)var3.get(var1 - 1)}); -+ this.field_110511_b.setRepositoryEntries(new ResourcePackRepositoryEntry[] {(ResourcePackRepositoryEntry)var3.get(par1 - 1)}); - GuiScreenTemporaryResourcePackSelect.func_110341_b(this.field_110512_a).refreshResources(); - } catch (Exception var5) { - this.field_110511_b.setRepositoryEntries(new ResourcePackRepositoryEntry[0]); - GuiScreenTemporaryResourcePackSelect.func_110339_c(this.field_110512_a).refreshResources(); - } - -- GuiScreenTemporaryResourcePackSelect.func_110345_d(this.field_110512_a).gameSettings.m = this.field_110511_b.getResourcePackName(); -+ GuiScreenTemporaryResourcePackSelect.func_110345_d(this.field_110512_a).gameSettings.skin = this.field_110511_b.getResourcePackName(); - GuiScreenTemporaryResourcePackSelect.func_110334_e(this.field_110512_a).gameSettings.saveOptions(); - } - -- protected boolean isSelected(int var1) { -+ /** -+ * returns true if the element passed in is currently selected -+ */ -+ protected boolean isSelected(int par1) { - List var2 = this.field_110511_b.getRepositoryEntries(); -- return var1 == 0 ? var2.isEmpty() : var2.contains(this.field_110511_b.getRepositoryEntriesAll().get(var1 - 1)); -+ return par1 == 0 ? var2.isEmpty() : var2.contains(this.field_110511_b.getRepositoryEntriesAll().get(par1 - 1)); - } - -+ /** -+ * return the height of the content being scrolled -+ */ - protected int getContentHeight() { - return this.getSize() * 36; - } -@@ -52,57 +65,59 @@ - this.field_110512_a.drawDefaultBackground(); - } - -- protected void drawSlot(int var1, int var2, int var3, int var4, Tessellator var5) { -+ protected void drawSlot(int par1, int par2, int par3, int par4, Tessellator par5Tessellator) { - TextureManager var6 = GuiScreenTemporaryResourcePackSelect.func_110340_f(this.field_110512_a).getTextureManager(); -- if(var1 == 0) { -+ -+ if (par1 == 0) { - try { - ResourcePack var12 = this.field_110511_b.rprDefaultResourcePack; - PackMetadataSection var13 = (PackMetadataSection)var12.getPackMetadata(this.field_110511_b.rprMetadataSerializer, "pack"); -- if(this.field_110513_h == null) { -+ -+ if (this.field_110513_h == null) { - this.field_110513_h = var6.getDynamicTextureLocation("texturepackicon", new DynamicTexture(var12.getPackImage())); - } - - var6.bindTexture(this.field_110513_h); - GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); -- var5.startDrawingQuads(); -- var5.setColorOpaque_I(16777215); -- var5.addVertexWithUV((double)var2, (double)(var3 + var4), 0.0D, 0.0D, 1.0D); -- var5.addVertexWithUV((double)(var2 + 32), (double)(var3 + var4), 0.0D, 1.0D, 1.0D); -- var5.addVertexWithUV((double)(var2 + 32), (double)var3, 0.0D, 1.0D, 0.0D); -- var5.addVertexWithUV((double)var2, (double)var3, 0.0D, 0.0D, 0.0D); -- var5.draw(); -- this.field_110512_a.drawString(GuiScreenTemporaryResourcePackSelect.func_130017_g(this.field_110512_a), "Default", var2 + 32 + 2, var3 + 1, 16777215); -- this.field_110512_a.drawString(GuiScreenTemporaryResourcePackSelect.func_130016_h(this.field_110512_a), var13.getPackDescription(), var2 + 32 + 2, var3 + 12 + 10, 8421504); -+ par5Tessellator.startDrawingQuads(); -+ par5Tessellator.setColorOpaque_I(16777215); -+ par5Tessellator.addVertexWithUV((double)par2, (double)(par3 + par4), 0.0D, 0.0D, 1.0D); -+ par5Tessellator.addVertexWithUV((double)(par2 + 32), (double)(par3 + par4), 0.0D, 1.0D, 1.0D); -+ par5Tessellator.addVertexWithUV((double)(par2 + 32), (double)par3, 0.0D, 1.0D, 0.0D); -+ par5Tessellator.addVertexWithUV((double)par2, (double)par3, 0.0D, 0.0D, 0.0D); -+ par5Tessellator.draw(); -+ this.field_110512_a.drawString(GuiScreenTemporaryResourcePackSelect.func_130017_g(this.field_110512_a), "Default", par2 + 32 + 2, par3 + 1, 16777215); -+ this.field_110512_a.drawString(GuiScreenTemporaryResourcePackSelect.func_130016_h(this.field_110512_a), var13.getPackDescription(), par2 + 32 + 2, par3 + 12 + 10, 8421504); - } catch (IOException var11) { -+ ; - } -- - } else { -- ResourcePackRepositoryEntry var7 = (ResourcePackRepositoryEntry)this.field_110511_b.getRepositoryEntriesAll().get(var1 - 1); -+ ResourcePackRepositoryEntry var7 = (ResourcePackRepositoryEntry)this.field_110511_b.getRepositoryEntriesAll().get(par1 - 1); - var7.bindTexturePackIcon(var6); - GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); -- var5.startDrawingQuads(); -- var5.setColorOpaque_I(16777215); -- var5.addVertexWithUV((double)var2, (double)(var3 + var4), 0.0D, 0.0D, 1.0D); -- var5.addVertexWithUV((double)(var2 + 32), (double)(var3 + var4), 0.0D, 1.0D, 1.0D); -- var5.addVertexWithUV((double)(var2 + 32), (double)var3, 0.0D, 1.0D, 0.0D); -- var5.addVertexWithUV((double)var2, (double)var3, 0.0D, 0.0D, 0.0D); -- var5.draw(); -+ par5Tessellator.startDrawingQuads(); -+ par5Tessellator.setColorOpaque_I(16777215); -+ par5Tessellator.addVertexWithUV((double)par2, (double)(par3 + par4), 0.0D, 0.0D, 1.0D); -+ par5Tessellator.addVertexWithUV((double)(par2 + 32), (double)(par3 + par4), 0.0D, 1.0D, 1.0D); -+ par5Tessellator.addVertexWithUV((double)(par2 + 32), (double)par3, 0.0D, 1.0D, 0.0D); -+ par5Tessellator.addVertexWithUV((double)par2, (double)par3, 0.0D, 0.0D, 0.0D); -+ par5Tessellator.draw(); - String var8 = var7.getResourcePackName(); -- if(var8.length() > 32) { -+ -+ if (var8.length() > 32) { - var8 = var8.substring(0, 32).trim() + "..."; - } - -- this.field_110512_a.drawString(GuiScreenTemporaryResourcePackSelect.func_110337_i(this.field_110512_a), var8, var2 + 32 + 2, var3 + 1, 16777215); -+ this.field_110512_a.drawString(GuiScreenTemporaryResourcePackSelect.func_110337_i(this.field_110512_a), var8, par2 + 32 + 2, par3 + 1, 16777215); - List var9 = GuiScreenTemporaryResourcePackSelect.func_110335_j(this.field_110512_a).listFormattedStringToWidth(var7.getTexturePackDescription(), 183); - -- for(int var10 = 0; var10 < 2 && var10 < var9.size(); ++var10) { -- this.field_110512_a.drawString(GuiScreenTemporaryResourcePackSelect.func_110338_k(this.field_110512_a), (String)var9.get(var10), var2 + 32 + 2, var3 + 12 + 10 * var10, 8421504); -+ for (int var10 = 0; var10 < 2 && var10 < var9.size(); ++var10) { -+ this.field_110512_a.drawString(GuiScreenTemporaryResourcePackSelect.func_110338_k(this.field_110512_a), (String)var9.get(var10), par2 + 32 + 2, par3 + 12 + 10 * var10, 8421504); - } -- - } - } - -- static ResourcePackRepository func_110510_a(GuiScreenTemporaryResourcePackSelectSelectionList var0) { -- return var0.field_110511_b; -+ static ResourcePackRepository func_110510_a(GuiScreenTemporaryResourcePackSelectSelectionList par0GuiScreenTemporaryResourcePackSelectSelectionList) { -+ return par0GuiScreenTemporaryResourcePackSelectSelectionList.field_110511_b; - } - } ---- net/minecraft/src/GuiChat.java -+++ net/minecraft/src/GuiChat.java -@@ -4,27 +4,47 @@ - import java.util.ArrayList; - import java.util.Iterator; - import java.util.List; -+ - import org.lwjgl.input.Keyboard; - import org.lwjgl.input.Mouse; - -+import org.bukkit.ChatColor; -+ -+import org.spoutcraft.client.config.Configuration; -+ - public class GuiChat extends GuiScreen { -- private String b = ""; -+ private String field_73898_b = ""; -+ -+ /** -+ * keeps position of which chat message you will select when you press up, (does not increase for duplicated messages -+ * sent immediately after each other) -+ */ - private int sentHistoryCursor = -1; - private boolean field_73897_d; - private boolean field_73905_m; - private int field_73903_n; -- private List q = new ArrayList(); -- private URI r; -+ private List field_73904_o = new ArrayList(); -+ -+ /** used to pass around the URI to various dialogues and to the host os */ -+ private URI clickedURI; -+ -+ /** Chat entry field */ - protected GuiTextField inputField; -- private String s = ""; -- -- public GuiChat() { -- } -- -- public GuiChat(String var1) { -- this.s = var1; -- } -- -+ -+ /** -+ * is the text that appears when you press the chat key and the input box appears pre-filled -+ */ -+ private String defaultInputFieldText = ""; -+ -+ public GuiChat() {} -+ -+ public GuiChat(String par1Str) { -+ this.defaultInputFieldText = par1Str; -+ } -+ -+ /** -+ * Adds the buttons (and other controls) to the screen in question. -+ */ - public void initGui() { - Keyboard.enableRepeatEvents(true); - this.sentHistoryCursor = this.mc.ingameGUI.getChatGUI().getSentMessages().size(); -@@ -32,84 +52,103 @@ - this.inputField.setMaxStringLength(100); - this.inputField.setEnableBackgroundDrawing(false); - this.inputField.setFocused(true); -- this.inputField.setText(this.s); -+ this.inputField.setText(this.defaultInputFieldText); - this.inputField.setCanLoseFocus(false); - } - -+ /** -+ * Called when the screen is unloaded. Used to disable keyboard repeat events -+ */ - public void onGuiClosed() { - Keyboard.enableRepeatEvents(false); - this.mc.ingameGUI.getChatGUI().resetScroll(); - } - -+ /** -+ * Called from the main game loop to update the screen. -+ */ - public void updateScreen() { - this.inputField.updateCursorCounter(); - } - -- protected void keyTyped(char var1, int var2) { -+ /** -+ * Fired when a key is typed. This is the equivalent of KeyListener.keyTyped(KeyEvent e). -+ */ -+ protected void keyTyped(char par1, int par2) { - this.field_73905_m = false; -- if(var2 == 15) { -+ -+ if (par2 == 15) { - this.completePlayerName(); - } else { - this.field_73897_d = false; - } - -- if(var2 == 1) { -+ if (par2 == 1) { - this.mc.displayGuiScreen((GuiScreen)null); -- } else if(var2 != 28 && var2 != 156) { -- if(var2 == 200) { -+ } else if (par2 != 28 && par2 != 156) { -+ if (par2 == 200) { - this.getSentHistory(-1); -- } else if(var2 == 208) { -+ } else if (par2 == 208) { - this.getSentHistory(1); -- } else if(var2 == 201) { -+ } else if (par2 == 201) { - this.mc.ingameGUI.getChatGUI().scroll(this.mc.ingameGUI.getChatGUI().func_96127_i() - 1); -- } else if(var2 == 209) { -+ } else if (par2 == 209) { - this.mc.ingameGUI.getChatGUI().scroll(-this.mc.ingameGUI.getChatGUI().func_96127_i() + 1); - } else { -- this.inputField.textboxKeyTyped(var1, var2); -+ this.inputField.textboxKeyTyped(par1, par2); - } - } else { - String var3 = this.inputField.getText().trim(); -- if(var3.length() > 0) { -+ -+ if (var3.length() > 0) { - this.mc.ingameGUI.getChatGUI().addToSentMessages(var3); -- if(!this.mc.handleClientCommand(var3)) { -+ -+ if (!this.mc.handleClientCommand(var3)) { - this.mc.thePlayer.sendChatMessage(var3); - } - } -- -- this.mc.displayGuiScreen((GuiScreen)null); -+ -+ this.mc.displayGuiScreen((GuiScreen)null); - } -- - } - -+ /** -+ * Handles mouse input. -+ */ - public void handleMouseInput() { - super.handleMouseInput(); - int var1 = Mouse.getEventDWheel(); -- if(var1 != 0) { -- if(var1 > 1) { -+ -+ if (var1 != 0) { -+ if (var1 > 1) { - var1 = 1; - } - -- if(var1 < -1) { -+ if (var1 < -1) { - var1 = -1; - } - -- if(!isShiftKeyDown()) { -+ if (!isShiftKeyDown()) { - var1 *= 7; - } - - this.mc.ingameGUI.getChatGUI().scroll(var1); - } -- - } - -- protected void mouseClicked(int var1, int var2, int var3) { -- if(var3 == 0 && this.mc.gameSettings.chatLinks) { -+ /** -+ * Called when the mouse is clicked. -+ */ -+ protected void mouseClicked(int par1, int par2, int par3) { -+ if (par3 == 0 && this.mc.gameSettings.chatLinks) { - ChatClickData var4 = this.mc.ingameGUI.getChatGUI().func_73766_a(Mouse.getX(), Mouse.getY()); -- if(var4 != null) { -+ -+ if (var4 != null) { - URI var5 = var4.getURI(); -- if(var5 != null) { -- if(this.mc.gameSettings.chatLinksPrompt) { -- this.r = var5; -+ -+ if (var5 != null) { -+ if (this.mc.gameSettings.chatLinksPrompt) { -+ this.clickedURI = var5; - this.mc.displayGuiScreen(new GuiConfirmOpenLink(this, var4.getClickedUrl(), 0, false)); - } else { - this.func_73896_a(var5); -@@ -120,48 +159,52 @@ - } - } - -- this.inputField.mouseClicked(var1, var2, var3); -- super.mouseClicked(var1, var2, var3); -+ this.inputField.mouseClicked(par1, par2, par3); -+ super.mouseClicked(par1, par2, par3); - } - -- public void confirmClicked(boolean var1, int var2) { -- if(var2 == 0) { -- if(var1) { -- this.func_73896_a(this.r); -+ public void confirmClicked(boolean par1, int par2) { -+ if (par2 == 0) { -+ if (par1) { -+ this.func_73896_a(this.clickedURI); - } - -- this.r = null; -+ this.clickedURI = null; - this.mc.displayGuiScreen(this); - } -- - } - -- private void func_73896_a(URI var1) { -+ private void func_73896_a(URI par1URI) { - try { - Class var2 = Class.forName("java.awt.Desktop"); - Object var3 = var2.getMethod("getDesktop", new Class[0]).invoke((Object)null, new Object[0]); -- var2.getMethod("browse", new Class[]{URI.class}).invoke(var3, new Object[]{var1}); -+ var2.getMethod("browse", new Class[] {URI.class}).invoke(var3, new Object[] {par1URI}); - } catch (Throwable var4) { - var4.printStackTrace(); - } -- - } - -+ /** -+ * Autocompletes player name -+ */ - public void completePlayerName() { - String var3; -- if(this.field_73897_d) { -+ -+ if (this.field_73897_d) { - this.inputField.deleteFromCursor(this.inputField.func_73798_a(-1, this.inputField.getCursorPosition(), false) - this.inputField.getCursorPosition()); -- if(this.field_73903_n >= this.q.size()) { -+ -+ if (this.field_73903_n >= this.field_73904_o.size()) { - this.field_73903_n = 0; - } - } else { - int var1 = this.inputField.func_73798_a(-1, this.inputField.getCursorPosition(), false); -- this.q.clear(); -+ this.field_73904_o.clear(); - this.field_73903_n = 0; - String var2 = this.inputField.getText().substring(var1).toLowerCase(); - var3 = this.inputField.getText().substring(0, this.inputField.getCursorPosition()); - this.func_73893_a(var3, var2); -- if(this.q.isEmpty()) { -+ -+ if (this.field_73904_o.isEmpty()) { - return; - } - -@@ -169,12 +212,13 @@ - this.inputField.deleteFromCursor(var1 - this.inputField.getCursorPosition()); - } - -- if(this.q.size() > 1) { -+ if (this.field_73904_o.size() > 1) { - StringBuilder var4 = new StringBuilder(); - -- for(Iterator var5 = this.q.iterator(); var5.hasNext(); var4.append(var3)) { -+ for (Iterator var5 = this.field_73904_o.iterator(); var5.hasNext(); var4.append(var3)) { - var3 = (String)var5.next(); -- if(var4.length() > 0) { -+ -+ if (var4.length() > 0) { - var4.append(", "); - } - } -@@ -182,34 +226,39 @@ - this.mc.ingameGUI.getChatGUI().printChatMessageWithOptionalDeletion(var4.toString(), 1); - } - -- this.inputField.writeText((String)this.q.get(this.field_73903_n++)); -+ this.inputField.writeText((String)this.field_73904_o.get(this.field_73903_n++)); - } - -- private void func_73893_a(String var1, String var2) { -- if(var1.length() >= 1) { -- this.mc.thePlayer.sendQueue.addToSendQueue(new Packet203AutoComplete(var1)); -+ private void func_73893_a(String par1Str, String par2Str) { -+ if (par1Str.length() >= 1) { -+ this.mc.thePlayer.sendQueue.addToSendQueue(new Packet203AutoComplete(par1Str)); - this.field_73905_m = true; - } - } - -- public void getSentHistory(int var1) { -- int var2 = this.sentHistoryCursor + var1; -+ /** -+ * input is relative and is applied directly to the sentHistoryCursor so -1 is the previous message, 1 is the next -+ * message from the current cursor position -+ */ -+ public void getSentHistory(int par1) { -+ int var2 = this.sentHistoryCursor + par1; - int var3 = this.mc.ingameGUI.getChatGUI().getSentMessages().size(); -- if(var2 < 0) { -+ -+ if (var2 < 0) { - var2 = 0; - } - -- if(var2 > var3) { -+ if (var2 > var3) { - var2 = var3; - } - -- if(var2 != this.sentHistoryCursor) { -- if(var2 == var3) { -+ if (var2 != this.sentHistoryCursor) { -+ if (var2 == var3) { - this.sentHistoryCursor = var3; -- this.inputField.setText(this.b); -+ this.inputField.setText(this.field_73898_b); - } else { -- if(this.sentHistoryCursor == var3) { -- this.b = this.inputField.getText(); -+ if (this.sentHistoryCursor == var3) { -+ this.field_73898_b = this.inputField.getText(); - } - - this.inputField.setText((String)this.mc.ingameGUI.getChatGUI().getSentMessages().get(var2)); -@@ -218,33 +267,67 @@ - } - } - -- public void drawScreen(int var1, int var2, float var3) { -+ /** -+ * Draws the screen and all the components in it. -+ */ -+ public void drawScreen(int par1, int par2, float par3) { - drawRect(2, this.height - 14, this.width - 2, this.height - 2, Integer.MIN_VALUE); - this.inputField.drawTextBox(); -- super.drawScreen(var1, var2, var3); -+ // Spout Start -+ if (Configuration.isShowingChatColorAssist()) { -+ for(int c = 0; c < 16; c++) { -+ ChatColor value = ChatColor.getByCode(c); -+ String name = value.name().toLowerCase(); -+ boolean lastUnderscore = true; -+ String parsedName = ""; -+ for(int chr = 0; chr < name.length(); chr++) { -+ char ch = name.charAt(chr); -+ if(lastUnderscore) { -+ ch = Character.toUpperCase(ch); -+ } -+ if(ch == '_') { -+ lastUnderscore = true; -+ ch = ' '; -+ } else { -+ lastUnderscore = false; -+ } -+ parsedName += ch; -+ } -+ char code = (char) ('0' + c); -+ if(c >= 10) { -+ code = (char) ('a' + c - 10); -+ } -+ fontRenderer.drawStringWithShadow("&" + code + " - " + value + parsedName, width - 90, 70 + c * 10, 0xffffffff); -+ } -+ } -+ // Spout End -+ super.drawScreen(par1, par2, par3); - } - -- public void func_73894_a(String[] var1) { -- if(this.field_73905_m) { -- this.q.clear(); -- String[] var2 = var1; -- int var3 = var1.length; -+ public void func_73894_a(String[] par1ArrayOfStr) { -+ if (this.field_73905_m) { -+ this.field_73904_o.clear(); -+ String[] var2 = par1ArrayOfStr; -+ int var3 = par1ArrayOfStr.length; - -- for(int var4 = 0; var4 < var3; ++var4) { -+ for (int var4 = 0; var4 < var3; ++var4) { - String var5 = var2[var4]; -- if(var5.length() > 0) { -- this.q.add(var5); -+ -+ if (var5.length() > 0) { -+ this.field_73904_o.add(var5); - } - } - -- if(this.q.size() > 0) { -+ if (this.field_73904_o.size() > 0) { - this.field_73897_d = true; - this.completePlayerName(); - } - } -- - } - -+ /** -+ * Returns true if this GUI should pause the game when it is displayed in single-player -+ */ - public boolean doesGuiPauseGame() { - return false; - } ---- net/minecraft/src/BlockEnchantmentTable.java -+++ net/minecraft/src/BlockEnchantmentTable.java -@@ -6,75 +6,100 @@ - private Icon field_94461_a; - private Icon field_94460_b; - -- protected BlockEnchantmentTable(int var1) { -- super(var1, Material.rock); -- this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 12.0F / 16.0F, 1.0F); -+ protected BlockEnchantmentTable(int par1) { -+ super(par1, Material.rock); -+ this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.75F, 1.0F); - this.setLightOpacity(0); - this.setCreativeTab(CreativeTabs.tabDecorations); - } - -+ /** -+ * If this block doesn't render as an ordinary block it will return False (examples: signs, buttons, stairs, etc) -+ */ - public boolean renderAsNormalBlock() { - return false; - } - -- public void randomDisplayTick(World var1, int var2, int var3, int var4, Random var5) { -- super.randomDisplayTick(var1, var2, var3, var4, var5); -+ /** -+ * A randomly called display update to be able to add particles or other items for display -+ */ -+ public void randomDisplayTick(World par1World, int par2, int par3, int par4, Random par5Random) { -+ super.randomDisplayTick(par1World, par2, par3, par4, par5Random); - -- for(int var6 = var2 - 2; var6 <= var2 + 2; ++var6) { -- for(int var7 = var4 - 2; var7 <= var4 + 2; ++var7) { -- if(var6 > var2 - 2 && var6 < var2 + 2 && var7 == var4 - 1) { -- var7 = var4 + 2; -+ for (int var6 = par2 - 2; var6 <= par2 + 2; ++var6) { -+ for (int var7 = par4 - 2; var7 <= par4 + 2; ++var7) { -+ if (var6 > par2 - 2 && var6 < par2 + 2 && var7 == par4 - 1) { -+ var7 = par4 + 2; - } - -- if(var5.nextInt(16) == 0) { -- for(int var8 = var3; var8 <= var3 + 1; ++var8) { -- if(var1.getBlockId(var6, var8, var7) == Block.bookShelf.blockID) { -- if(!var1.isAirBlock((var6 - var2) / 2 + var2, var8, (var7 - var4) / 2 + var4)) { -+ if (par5Random.nextInt(16) == 0) { -+ for (int var8 = par3; var8 <= par3 + 1; ++var8) { -+ if (par1World.getBlockId(var6, var8, var7) == Block.bookShelf.blockID) { -+ if (!par1World.isAirBlock((var6 - par2) / 2 + par2, var8, (var7 - par4) / 2 + par4)) { - break; - } - -- var1.spawnParticle("enchantmenttable", (double)var2 + 0.5D, (double)var3 + 2.0D, (double)var4 + 0.5D, (double)((float)(var6 - var2) + var5.nextFloat()) - 0.5D, (double)((float)(var8 - var3) - var5.nextFloat() - 1.0F), (double)((float)(var7 - var4) + var5.nextFloat()) - 0.5D); -+ par1World.spawnParticle("enchantmenttable", (double)par2 + 0.5D, (double)par3 + 2.0D, (double)par4 + 0.5D, (double)((float)(var6 - par2) + par5Random.nextFloat()) - 0.5D, (double)((float)(var8 - par3) - par5Random.nextFloat() - 1.0F), (double)((float)(var7 - par4) + par5Random.nextFloat()) - 0.5D); - } - } - } - } - } -- - } - -+ /** -+ * Is this block (a) opaque and (b) a full 1m cube? This determines whether or not to render the shared face of two -+ * adjacent blocks and also whether the player can attach torches, redstone wire, etc to this block. -+ */ - public boolean isOpaqueCube() { - return false; - } - -- public Icon getIcon(int var1, int var2) { -- return var1 == 0 ? this.field_94460_b : (var1 == 1 ? this.field_94461_a : this.blockIcon); -+ /** -+ * From the specified side and block metadata retrieves the blocks texture. Args: side, metadata -+ */ -+ public Icon getIcon(int par1, int par2) { -+ return par1 == 0 ? this.field_94460_b : (par1 == 1 ? this.field_94461_a : this.blockIcon); - } - -- public TileEntity createNewTileEntity(World var1) { -+ /** -+ * Returns a new instance of a block's tile entity class. Called on placing the block. -+ */ -+ public TileEntity createNewTileEntity(World par1World) { - return new TileEntityEnchantmentTable(); - } - -- public boolean onBlockActivated(World var1, int var2, int var3, int var4, EntityPlayer var5, int var6, float var7, float var8, float var9) { -- if(var1.isRemote) { -+ /** -+ * Called upon block activation (right click on the block.) -+ */ -+ public boolean onBlockActivated(World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer, int par6, float par7, float par8, float par9) { -+ if (par1World.isRemote) { - return true; - } else { -- TileEntityEnchantmentTable var10 = (TileEntityEnchantmentTable)var1.getBlockTileEntity(var2, var3, var4); -- var5.displayGUIEnchantment(var2, var3, var4, var10.func_94135_b() ? var10.func_94133_a() : null); -+ TileEntityEnchantmentTable var10 = (TileEntityEnchantmentTable)par1World.getBlockTileEntity(par2, par3, par4); -+ par5EntityPlayer.displayGUIEnchantment(par2, par3, par4, var10.func_94135_b() ? var10.func_94133_a() : null); - return true; - } - } - -- public void onBlockPlacedBy(World var1, int var2, int var3, int var4, EntityLivingBase var5, ItemStack var6) { -- super.onBlockPlacedBy(var1, var2, var3, var4, var5, var6); -- if(var6.hasDisplayName()) { -- ((TileEntityEnchantmentTable)var1.getBlockTileEntity(var2, var3, var4)).func_94134_a(var6.getDisplayName()); -+ /** -+ * Called when the block is placed in the world. -+ */ -+ public void onBlockPlacedBy(World par1World, int par2, int par3, int par4, EntityLivingBase par5EntityLivingBase, ItemStack par6ItemStack) { -+ super.onBlockPlacedBy(par1World, par2, par3, par4, par5EntityLivingBase, par6ItemStack); -+ -+ if (par6ItemStack.hasDisplayName()) { -+ ((TileEntityEnchantmentTable)par1World.getBlockTileEntity(par2, par3, par4)).func_94134_a(par6ItemStack.getDisplayName()); - } -- - } - -- public void registerIcons(IconRegister var1) { -- this.blockIcon = var1.registerIcon(this.getTextureName() + "_" + "side"); -- this.field_94461_a = var1.registerIcon(this.getTextureName() + "_" + "top"); -- this.field_94460_b = var1.registerIcon(this.getTextureName() + "_" + "bottom"); -+ /** -+ * When this method is called, your block should register all the icons it needs with the given IconRegister. This is -+ * the only chance you get to register icons. -+ */ -+ public void registerIcons(IconRegister par1IconRegister) { -+ this.blockIcon = par1IconRegister.registerIcon(this.getTextureName() + "_" + "side"); -+ this.field_94461_a = par1IconRegister.registerIcon(this.getTextureName() + "_" + "top"); -+ this.field_94460_b = par1IconRegister.registerIcon(this.getTextureName() + "_" + "bottom"); - } - } ---- /dev/null -+++ org/spoutcraft/client/player/accessories/AccessoryHandler.java -@@ -1,0 +1,196 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.client.player.accessories; -+ -+import java.util.HashMap; -+import java.util.HashSet; -+import java.util.Map; -+import java.util.Set; -+ -+import org.apache.commons.lang3.tuple.Pair; -+import org.bukkit.ChatColor; -+ -+import net.minecraft.src.Minecraft; -+import net.minecraft.src.EntityPlayer; -+import net.minecraft.src.ModelBiped; -+import net.minecraft.src.RenderManager; -+import net.minecraft.src.RenderPlayer; -+import net.minecraft.src.TextureManager; -+import net.minecraft.src.ResourceLocation; -+import net.minecraft.src.ThreadDownloadImageData; -+import net.minecraft.src.TextureObject; -+ -+import org.spoutcraft.client.HDImageBufferDownload; -+import org.spoutcraft.client.special.Resources; -+import org.spoutcraft.client.special.VIP; -+ -+public class AccessoryHandler { -+ private static Map>> sacs = new HashMap>>(); -+ private static Set downloaded = new HashSet(); -+ private static RenderPlayer renderer = (RenderPlayer) RenderManager.instance.entityRenderMap.get(EntityPlayer.class); -+ private static ModelBiped modelBipedMain = ((RenderPlayer) RenderManager.instance.entityRenderMap.get(EntityPlayer.class)).modelBipedMain; -+ -+ private AccessoryHandler() { -+ } -+ -+ public static void addAccessory(String player, Accessory n, String url) { -+ TextureManager tm= Minecraft.getMinecraft().getTextureManager(); -+ Object texture = new ThreadDownloadImageData(url, (ResourceLocation)null, new HDImageBufferDownload()); -+ tm.loadTexture(new ResourceLocation("accessories/" + n.getType().toString()), (TextureObject)texture); -+ -+ Set> acs = sacs.get(player); -+ if (acs == null) { -+ acs = new HashSet>(); -+ } -+ -+ Set> toRemove = new HashSet>(); -+ for (Pair pr : acs) { -+ if (pr.getLeft().getType().equals(n.getType())) { -+ toRemove.add(pr); -+ } -+ } -+ -+ acs.removeAll(toRemove); -+ acs.add(Pair.of(n, url)); -+ sacs.put(player, acs); -+ } -+ -+ public static void renderAllAccessories(EntityPlayer player, float f, float par2) { -+ Set> acs = sacs.get(player.username); -+ if (acs == null) { -+ return; -+ } -+ for (Pair a : acs) { -+ RenderManager.instance.renderEngine.bindTexture(new ResourceLocation("accessories/" + a.getLeft().getType().toString())); -+ a.getLeft().render(player, f, par2); -+ } -+ } -+ -+ public static void addVIPAccessoriesFor(EntityPlayer player) { -+ String cleanUserName = ChatColor.stripColor(player.username); -+ VIP vip = Resources.getVIP(cleanUserName); -+ if (vip == null) { -+ return; -+ } -+ Map vAcs = vip.Accessories(); -+ if (vAcs == null) { -+ return; -+ } -+ String that = vAcs.get("tophat"); -+ String nhat = vAcs.get("notchhat"); -+ String brace = vAcs.get("bracelet"); -+ String wings = vAcs.get("wings"); -+ String ears = vAcs.get("ears"); -+ String glasses = vAcs.get("sunglasses"); -+ String tail = vAcs.get("tail"); -+ if (that != null) { -+ addAccessory(player.username, new TopHat(modelBipedMain), that); -+ } -+ if (nhat != null) { -+ addAccessory(player.username, new NotchHat(modelBipedMain), nhat); -+ } -+ if (brace != null) { -+ addAccessory(player.username, new Bracelet(modelBipedMain), brace); -+ } -+ if (wings != null) { -+ addAccessory(player.username, new Wings(modelBipedMain), wings); -+ } -+ if (ears != null) { -+ addAccessory(player.username, new Ears(modelBipedMain), ears); -+ } -+ if (glasses != null) { -+ addAccessory(player.username, new Sunglasses(modelBipedMain), glasses); -+ } -+ if (tail != null) { -+ addAccessory(player.username, new Tail(modelBipedMain), tail); -+ } -+ } -+ -+ public static void addAccessoryType(String player, AccessoryType type, String url) { -+ Set> acs = sacs.get(player); -+ if (acs == null) { -+ acs = new HashSet>(); -+ sacs.put(player, acs); -+ } -+ Accessory toCreate; -+ switch (type) { -+ case BRACELET: -+ toCreate = new Bracelet(modelBipedMain); -+ break; -+ case EARS: -+ toCreate = new Ears(modelBipedMain); -+ break; -+ case NOTCHHAT: -+ toCreate = new NotchHat(modelBipedMain); -+ break; -+ case SUNGLASSES: -+ toCreate = new Sunglasses(modelBipedMain); -+ break; -+ case TAIL: -+ toCreate = new Tail(modelBipedMain); -+ break; -+ case TOPHAT: -+ toCreate = new TopHat(modelBipedMain); -+ break; -+ case WINGS: -+ toCreate = new Wings(modelBipedMain); -+ break; -+ default: -+ toCreate = null; -+ break; -+ } -+ if (toCreate != null) { -+ addAccessory(player, toCreate, url); -+ } -+ } -+ -+ public static void removeAccessoryType(String player, AccessoryType type) { -+ Set> acs = sacs.get(player); -+ if (acs == null) { -+ return; -+ } -+ Pair toRemove = null; -+ for (Pair accessory : acs) { -+ if (accessory.getLeft().getType().equals(type)) { -+ toRemove = accessory; -+ break; -+ } -+ } -+ acs.remove(toRemove); -+ } -+ -+ public static boolean isHandled(String username) { -+ return sacs.containsKey(username); -+ } -+ -+ public static boolean hasAccessory(String username, AccessoryType type) { -+ if (!sacs.containsKey(username)) { -+ return false; -+ } -+ -+ for (Pair accessory : sacs.get(username)) { -+ if (accessory.getLeft().getType().equals(type)) { -+ return true; -+ } -+ } -+ -+ return false; -+ } -+} ---- net/minecraft/src/ItemRenderer.java -+++ net/minecraft/src/ItemRenderer.java -@@ -1,179 +1,264 @@ - package net.minecraft.src; - -+import java.util.Random; -+ - import org.lwjgl.opengl.GL11; - import org.lwjgl.opengl.GL12; -+import org.newdawn.slick.opengl.Texture; -+ -+import com.prupe.mcpatcher.cc.ColorizeBlock; -+ -+import org.spoutcraft.api.block.design.BlockDesign; -+import org.spoutcraft.api.material.MaterialData; -+import org.spoutcraft.client.SpoutClient; -+import org.spoutcraft.client.io.CustomTextureManager; -+ -+// Spout Start -+//Spout End - - public class ItemRenderer { - private static final ResourceLocation RES_ITEM_GLINT = new ResourceLocation("textures/misc/enchanted_item_glint.png"); - private static final ResourceLocation RES_MAP_BACKGROUND = new ResourceLocation("textures/map/map_background.png"); - private static final ResourceLocation RES_UNDERWATER_OVERLAY = new ResourceLocation("textures/misc/underwater.png"); -+ -+ /** A reference to the Minecraft object. */ - private Minecraft mc; - private ItemStack itemToRender; -+ -+ /** -+ * How far the current item has been equipped (0 disequipped and 1 fully up) -+ */ - private float equippedProgress; - private float prevEquippedProgress; -+ -+ /** Instance of RenderBlocks. */ - private RenderBlocks renderBlocksInstance = new RenderBlocks(); - public final MapItemRenderer mapItemRenderer; -+ -+ /** The index of the currently held item (0-8, or -1 if not yet updated) */ - private int equippedItemSlot = -1; -+ // Spout Start -+ private Random rand = new Random(); -+ // Spout End - -- public ItemRenderer(Minecraft var1) { -- this.mc = var1; -- this.mapItemRenderer = new MapItemRenderer(var1.gameSettings, var1.getTextureManager()); -+ public ItemRenderer(Minecraft par1Minecraft) { -+ this.mc = par1Minecraft; -+ this.mapItemRenderer = new MapItemRenderer(par1Minecraft.gameSettings, par1Minecraft.getTextureManager()); - } - -- public void renderItem(EntityLivingBase var1, ItemStack var2, int var3) { -+ /** -+ * Renders the item stack for being in an entity's hand Args: itemStack -+ */ -+ public void renderItem(EntityLivingBase par1EntityLivingBase, ItemStack par2ItemStack, int par3) { - GL11.glPushMatrix(); -- TextureManager var4 = this.mc.getTextureManager(); -- if(var2.getItemSpriteNumber() == 0 && var2.itemID < Block.blocksList.length && Block.blocksList[var2.itemID] != null && RenderBlocks.renderItemIn3d(Block.blocksList[var2.itemID].getRenderType())) { -- var4.bindTexture(var4.getResourceLocation(0)); -- this.renderBlocksInstance.renderBlockAsItem(Block.blocksList[var2.itemID], var2.getItemDamage(), 1.0F); -+ TextureManager var99 = this.mc.getTextureManager(); -+ // Spout Start -+ Block var4block = Block.blocksList[par2ItemStack.itemID]; -+ boolean custom = false; -+ BlockDesign design = null; -+ if (par2ItemStack.itemID == 318) { -+ org.spoutcraft.api.material.CustomItem item = MaterialData.getCustomItem(par2ItemStack.getItemDamage()); -+ if (item != null) { -+ String textureURI = item.getTexture(); -+ if (textureURI == null) { -+ org.spoutcraft.api.material.CustomBlock block = MaterialData.getCustomBlock(par2ItemStack.getItemDamage()); -+ design = block != null ? block.getBlockDesign() : null; -+ textureURI = design != null ? design.getTextureURL() : null; -+ } -+ if (textureURI != null) { -+ Texture texture = CustomTextureManager.getTextureFromUrl(item.getAddon(), textureURI); -+ if (texture != null) { -+ SpoutClient.getHandle().renderEngine.bindTexture(texture.getTextureID()); -+ custom = true; -+ } -+ } -+ } -+ } -+ -+ if (!custom) { -+ if (par2ItemStack.itemID < 256) { -+ this.mc.getTextureManager().bindTexture(TextureMap.locationBlocksTexture); -+ } else { -+ this.mc.getTextureManager().bindTexture(TextureMap.locationItemsTexture); -+ } -+ } -+ -+ if (design != null) { -+ GL11.glDisable(GL11.GL_LIGHTING); -+ design.renderItemstack(null, -0.5F, -0.5F, -0.5F, 0, 1F, rand); -+ GL11.glEnable(GL11.GL_LIGHTING); -+ } -+ else if(var4block != null && RenderBlocks.renderItemIn3d(var4block.getRenderType())) { -+ this.renderBlocksInstance.renderBlockAsItem(Block.blocksList[par2ItemStack.itemID], par2ItemStack.getItemDamage(), 1.0F); - } else { -- Icon var5 = var1.getItemIcon(var2, var3); -- if(var5 == null) { -+ Tessellator var5 = Tessellator.instance; -+ -+ Icon var4 = par1EntityLivingBase.getItemIcon(par2ItemStack, par3); -+ if (var4 == null) { - GL11.glPopMatrix(); - return; - } - -- var4.bindTexture(var4.getResourceLocation(var2.getItemSpriteNumber())); -- Tessellator var6 = Tessellator.instance; -- float var7 = var5.getMinU(); -- float var8 = var5.getMaxU(); -- float var9 = var5.getMinV(); -- float var10 = var5.getMaxV(); -- float var11 = 0.0F; -- float var12 = 0.3F; -+ float var6 = var4.getMinU(); -+ float var7 = var4.getMaxU(); -+ float var8 = var4.getMinV(); -+ float var9 = var4.getMaxV(); -+ float var10 = 0.0F; -+ float var11 = 0.3F; -+ if (custom){ -+ var6 = 0; -+ var7 = 1; -+ var8 = 1; -+ var9 = 0; -+ } -+ // Spout end -+ //ToDo: may need this -+ //var99.bindTexture(var4.getResourceLocation(par2ItemStack.getItemSpriteNumber())); - GL11.glEnable(GL12.GL_RESCALE_NORMAL); -- GL11.glTranslatef(-var11, -var12, 0.0F); -- float var13 = 1.5F; -- GL11.glScalef(var13, var13, var13); -+ GL11.glTranslatef(-var10, -var11, 0.0F); -+ float var12 = 1.5F; -+ GL11.glScalef(var12, var12, var12); - GL11.glRotatef(50.0F, 0.0F, 1.0F, 0.0F); - GL11.glRotatef(335.0F, 0.0F, 0.0F, 1.0F); -- GL11.glTranslatef(-(15.0F / 16.0F), -(1.0F / 16.0F), 0.0F); -- renderItemIn2D(var6, var8, var9, var7, var10, var5.getIconWidth(), var5.getIconHeight(), 1.0F / 16.0F); -- if(var2.hasEffect() && var3 == 0) { -+ GL11.glTranslatef(-0.9375F, -0.0625F, 0.0F); -+ -+ if (par2ItemStack != null) { -+ ColorizeBlock.colorizeWaterBlockGL(par2ItemStack.itemID); -+ } -+ -+ renderItemIn2D(var5, var7, var8, var6, var9, var4.getIconWidth(), var4.getIconHeight(), 0.0625F); -+ -+ if (par2ItemStack != null && par2ItemStack.hasEffect() && par3 == 0) { - GL11.glDepthFunc(GL11.GL_EQUAL); - GL11.glDisable(GL11.GL_LIGHTING); -- var4.bindTexture(RES_ITEM_GLINT); -+ var99.bindTexture(RES_ITEM_GLINT); - GL11.glEnable(GL11.GL_BLEND); - GL11.glBlendFunc(GL11.GL_SRC_COLOR, GL11.GL_ONE); -- float var14 = 0.76F; -- GL11.glColor4f(0.5F * var14, 0.25F * var14, 0.8F * var14, 1.0F); -+ float var13 = 0.76F; -+ GL11.glColor4f(0.5F * var13, 0.25F * var13, 0.8F * var13, 1.0F); - GL11.glMatrixMode(GL11.GL_TEXTURE); - GL11.glPushMatrix(); -- float var15 = 2.0F / 16.0F; -- GL11.glScalef(var15, var15, var15); -- float var16 = (float)(Minecraft.getSystemTime() % 3000L) / 3000.0F * 8.0F; -- GL11.glTranslatef(var16, 0.0F, 0.0F); -+ float var14 = 0.125F; -+ GL11.glScalef(var14, var14, var14); -+ float var15 = (float)(Minecraft.getSystemTime() % 3000L) / 3000.0F * 8.0F; -+ GL11.glTranslatef(var15, 0.0F, 0.0F); - GL11.glRotatef(-50.0F, 0.0F, 0.0F, 1.0F); -- renderItemIn2D(var6, 0.0F, 0.0F, 1.0F, 1.0F, 256, 256, 1.0F / 16.0F); -+ renderItemIn2D(var5, 0.0F, 0.0F, 1.0F, 1.0F, 256, 256, 0.0625F); - GL11.glPopMatrix(); - GL11.glPushMatrix(); -- GL11.glScalef(var15, var15, var15); -- var16 = (float)(Minecraft.getSystemTime() % 4873L) / 4873.0F * 8.0F; -- GL11.glTranslatef(-var16, 0.0F, 0.0F); -+ GL11.glScalef(var14, var14, var14); -+ var15 = (float)(Minecraft.getSystemTime() % 4873L) / 4873.0F * 8.0F; -+ GL11.glTranslatef(-var15, 0.0F, 0.0F); - GL11.glRotatef(10.0F, 0.0F, 0.0F, 1.0F); -- renderItemIn2D(var6, 0.0F, 0.0F, 1.0F, 1.0F, 256, 256, 1.0F / 16.0F); -+ renderItemIn2D(var5, 0.0F, 0.0F, 1.0F, 1.0F, 256, 256, 0.0625F); - GL11.glPopMatrix(); - GL11.glMatrixMode(GL11.GL_MODELVIEW); - GL11.glDisable(GL11.GL_BLEND); - GL11.glEnable(GL11.GL_LIGHTING); - GL11.glDepthFunc(GL11.GL_LEQUAL); - } -- - GL11.glDisable(GL12.GL_RESCALE_NORMAL); - } - - GL11.glPopMatrix(); - } - -- public static void renderItemIn2D(Tessellator var0, float var1, float var2, float var3, float var4, int var5, int var6, float var7) { -- var0.startDrawingQuads(); -- var0.setNormal(0.0F, 0.0F, 1.0F); -- var0.addVertexWithUV(0.0D, 0.0D, 0.0D, (double)var1, (double)var4); -- var0.addVertexWithUV(1.0D, 0.0D, 0.0D, (double)var3, (double)var4); -- var0.addVertexWithUV(1.0D, 1.0D, 0.0D, (double)var3, (double)var2); -- var0.addVertexWithUV(0.0D, 1.0D, 0.0D, (double)var1, (double)var2); -- var0.draw(); -- var0.startDrawingQuads(); -- var0.setNormal(0.0F, 0.0F, -1.0F); -- var0.addVertexWithUV(0.0D, 1.0D, (double)(0.0F - var7), (double)var1, (double)var2); -- var0.addVertexWithUV(1.0D, 1.0D, (double)(0.0F - var7), (double)var3, (double)var2); -- var0.addVertexWithUV(1.0D, 0.0D, (double)(0.0F - var7), (double)var3, (double)var4); -- var0.addVertexWithUV(0.0D, 0.0D, (double)(0.0F - var7), (double)var1, (double)var4); -- var0.draw(); -- float var8 = 0.5F * (var1 - var3) / (float)var5; -- float var9 = 0.5F * (var4 - var2) / (float)var6; -- var0.startDrawingQuads(); -- var0.setNormal(-1.0F, 0.0F, 0.0F); -- -+ // MCPatcher Start -+ /** -+ * Renders an item held in hand as a 2D texture with thickness -+ */ -+ public static void renderItemIn2D(Tessellator par0Tessellator, float par1, float par2, float par3, float par4, int par5, int par6, float par7) { -+ par0Tessellator.startDrawingQuads(); -+ par0Tessellator.setNormal(0.0F, 0.0F, 1.0F); -+ par0Tessellator.addVertexWithUV(0.0D, 0.0D, 0.0D, (double)par1, (double)par4); -+ par0Tessellator.addVertexWithUV(1.0D, 0.0D, 0.0D, (double)par3, (double)par4); -+ par0Tessellator.addVertexWithUV(1.0D, 1.0D, 0.0D, (double)par3, (double)par2); -+ par0Tessellator.addVertexWithUV(0.0D, 1.0D, 0.0D, (double)par1, (double)par2); -+ par0Tessellator.draw(); -+ par0Tessellator.startDrawingQuads(); -+ par0Tessellator.setNormal(0.0F, 0.0F, -1.0F); -+ par0Tessellator.addVertexWithUV(0.0D, 1.0D, (double)(0.0F - par7), (double)par1, (double)par2); -+ par0Tessellator.addVertexWithUV(1.0D, 1.0D, (double)(0.0F - par7), (double)par3, (double)par2); -+ par0Tessellator.addVertexWithUV(1.0D, 0.0D, (double)(0.0F - par7), (double)par3, (double)par4); -+ par0Tessellator.addVertexWithUV(0.0D, 0.0D, (double)(0.0F - par7), (double)par1, (double)par4); -+ par0Tessellator.draw(); -+ float var8 = 0.5F * (par1 - par3) / (float)par5; -+ float var9 = 0.5F * (par4 - par2) / (float)par6; -+ par0Tessellator.startDrawingQuads(); -+ par0Tessellator.setNormal(-1.0F, 0.0F, 0.0F); - int var10; - float var11; - float var12; -- for(var10 = 0; var10 < var5; ++var10) { -- var11 = (float)var10 / (float)var5; -- var12 = var1 + (var3 - var1) * var11 - var8; -- var0.addVertexWithUV((double)var11, 0.0D, (double)(0.0F - var7), (double)var12, (double)var4); -- var0.addVertexWithUV((double)var11, 0.0D, 0.0D, (double)var12, (double)var4); -- var0.addVertexWithUV((double)var11, 1.0D, 0.0D, (double)var12, (double)var2); -- var0.addVertexWithUV((double)var11, 1.0D, (double)(0.0F - var7), (double)var12, (double)var2); -+ -+ for (var10 = 0; var10 < par5; ++var10) { -+ var11 = (float)var10 / (float)par5; -+ var12 = par1 + (par3 - par1) * var11 - var8; -+ par0Tessellator.addVertexWithUV((double)var11, 0.0D, (double)(0.0F - par7), (double)var12, (double)par4); -+ par0Tessellator.addVertexWithUV((double)var11, 0.0D, 0.0D, (double)var12, (double)par4); -+ par0Tessellator.addVertexWithUV((double)var11, 1.0D, 0.0D, (double)var12, (double)par2); -+ par0Tessellator.addVertexWithUV((double)var11, 1.0D, (double)(0.0F - par7), (double)var12, (double)par2); - } - -- var0.draw(); -- var0.startDrawingQuads(); -- var0.setNormal(1.0F, 0.0F, 0.0F); -- -+ par0Tessellator.draw(); -+ par0Tessellator.startDrawingQuads(); -+ par0Tessellator.setNormal(1.0F, 0.0F, 0.0F); - float var13; -- for(var10 = 0; var10 < var5; ++var10) { -- var11 = (float)var10 / (float)var5; -- var12 = var1 + (var3 - var1) * var11 - var8; -- var13 = var11 + 1.0F / (float)var5; -- var0.addVertexWithUV((double)var13, 1.0D, (double)(0.0F - var7), (double)var12, (double)var2); -- var0.addVertexWithUV((double)var13, 1.0D, 0.0D, (double)var12, (double)var2); -- var0.addVertexWithUV((double)var13, 0.0D, 0.0D, (double)var12, (double)var4); -- var0.addVertexWithUV((double)var13, 0.0D, (double)(0.0F - var7), (double)var12, (double)var4); -- } -- -- var0.draw(); -- var0.startDrawingQuads(); -- var0.setNormal(0.0F, 1.0F, 0.0F); -- -- for(var10 = 0; var10 < var6; ++var10) { -- var11 = (float)var10 / (float)var6; -- var12 = var4 + (var2 - var4) * var11 - var9; -- var13 = var11 + 1.0F / (float)var6; -- var0.addVertexWithUV(0.0D, (double)var13, 0.0D, (double)var1, (double)var12); -- var0.addVertexWithUV(1.0D, (double)var13, 0.0D, (double)var3, (double)var12); -- var0.addVertexWithUV(1.0D, (double)var13, (double)(0.0F - var7), (double)var3, (double)var12); -- var0.addVertexWithUV(0.0D, (double)var13, (double)(0.0F - var7), (double)var1, (double)var12); -- } -- -- var0.draw(); -- var0.startDrawingQuads(); -- var0.setNormal(0.0F, -1.0F, 0.0F); -- -- for(var10 = 0; var10 < var6; ++var10) { -- var11 = (float)var10 / (float)var6; -- var12 = var4 + (var2 - var4) * var11 - var9; -- var0.addVertexWithUV(1.0D, (double)var11, 0.0D, (double)var3, (double)var12); -- var0.addVertexWithUV(0.0D, (double)var11, 0.0D, (double)var1, (double)var12); -- var0.addVertexWithUV(0.0D, (double)var11, (double)(0.0F - var7), (double)var1, (double)var12); -- var0.addVertexWithUV(1.0D, (double)var11, (double)(0.0F - var7), (double)var3, (double)var12); -- } -- -- var0.draw(); -+ -+ for (var10 = 0; var10 < par5; ++var10) { -+ var11 = (float)var10 / (float)par5; -+ var12 = par1 + (par3 - par1) * var11 - var8; -+ var13 = var11 + 1.0F / (float)par5; -+ par0Tessellator.addVertexWithUV((double)var13, 1.0D, (double)(0.0F - par7), (double)var12, (double)par2); -+ par0Tessellator.addVertexWithUV((double)var13, 1.0D, 0.0D, (double)var12, (double)par2); -+ par0Tessellator.addVertexWithUV((double)var13, 0.0D, 0.0D, (double)var12, (double)par4); -+ par0Tessellator.addVertexWithUV((double)var13, 0.0D, (double)(0.0F - par7), (double)var12, (double)par4); -+ } -+ -+ par0Tessellator.draw(); -+ par0Tessellator.startDrawingQuads(); -+ par0Tessellator.setNormal(0.0F, 1.0F, 0.0F); -+ -+ for (var10 = 0; var10 < par6; ++var10) { -+ var11 = (float)var10 / (float)par6; -+ var12 = par4 + (par2 - par4) * var11 - var9; -+ var13 = var11 + 1.0F / (float)par6; -+ par0Tessellator.addVertexWithUV(0.0D, (double)var13, 0.0D, (double)par1, (double)var12); -+ par0Tessellator.addVertexWithUV(1.0D, (double)var13, 0.0D, (double)par3, (double)var12); -+ par0Tessellator.addVertexWithUV(1.0D, (double)var13, (double)(0.0F - par7), (double)par3, (double)var12); -+ par0Tessellator.addVertexWithUV(0.0D, (double)var13, (double)(0.0F - par7), (double)par1, (double)var12); -+ } -+ -+ par0Tessellator.draw(); -+ par0Tessellator.startDrawingQuads(); -+ par0Tessellator.setNormal(0.0F, -1.0F, 0.0F); -+ -+ for (var10 = 0; var10 < par6; ++var10) { -+ var11 = (float)var10 / (float)par6; -+ var12 = par4 + (par2 - par4) * var11 - var9; -+ par0Tessellator.addVertexWithUV(1.0D, (double)var11, 0.0D, (double)par3, (double)var12); -+ par0Tessellator.addVertexWithUV(0.0D, (double)var11, 0.0D, (double)par1, (double)var12); -+ par0Tessellator.addVertexWithUV(0.0D, (double)var11, (double)(0.0F - par7), (double)par1, (double)var12); -+ par0Tessellator.addVertexWithUV(1.0D, (double)var11, (double)(0.0F - par7), (double)par3, (double)var12); -+ } -+ -+ par0Tessellator.draw(); - } - -- public void renderItemInFirstPerson(float var1) { -- float var2 = this.prevEquippedProgress + (this.equippedProgress - this.prevEquippedProgress) * var1; -+ /** -+ * Renders the active item in the player's hand when in first person mode. Args: partialTickTime -+ */ -+ public void renderItemInFirstPerson(float par1) { -+ float var2 = this.prevEquippedProgress + (this.equippedProgress - this.prevEquippedProgress) * par1; - EntityClientPlayerMP var3 = this.mc.thePlayer; -- float var4 = var3.prevRotationPitch + (var3.rotationPitch - var3.prevRotationPitch) * var1; -+ float var4 = var3.prevRotationPitch + (var3.rotationPitch - var3.prevRotationPitch) * par1; - GL11.glPushMatrix(); - GL11.glRotatef(var4, 1.0F, 0.0F, 0.0F); -- GL11.glRotatef(var3.prevRotationYaw + (var3.rotationYaw - var3.prevRotationYaw) * var1, 0.0F, 1.0F, 0.0F); -+ GL11.glRotatef(var3.prevRotationYaw + (var3.rotationYaw - var3.prevRotationYaw) * par1, 0.0F, 1.0F, 0.0F); - RenderHelper.enableStandardItemLighting(); - GL11.glPopMatrix(); - EntityPlayerSP var5 = (EntityPlayerSP)var3; -- float var6 = var5.prevRenderArmPitch + (var5.renderArmPitch - var5.prevRenderArmPitch) * var1; -- float var7 = var5.prevRenderArmYaw + (var5.renderArmYaw - var5.prevRenderArmYaw) * var1; -+ float var6 = var5.prevRenderArmPitch + (var5.renderArmPitch - var5.prevRenderArmPitch) * par1; -+ float var7 = var5.prevRenderArmYaw + (var5.renderArmYaw - var5.prevRenderArmYaw) * par1; - GL11.glRotatef((var3.rotationPitch - var6) * 0.1F, 1.0F, 0.0F, 0.0F); - GL11.glRotatef((var3.rotationYaw - var7) * 0.1F, 0.0F, 1.0F, 0.0F); - ItemStack var8 = this.itemToRender; -@@ -185,14 +270,15 @@ - OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, (float)var11 / 1.0F, (float)var12 / 1.0F); - GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - float var13; -- float var21; -- float var23; -- if(var8 != null) { -+ float var20; -+ float var22; -+ -+ if (var8 != null) { - var10 = Item.itemsList[var8.itemID].getColorFromItemStack(var8, 0); -- var21 = (float)(var10 >> 16 & 255) / 255.0F; -- var23 = (float)(var10 >> 8 & 255) / 255.0F; -+ var20 = (float)(var10 >> 16 & 255) / 255.0F; -+ var22 = (float)(var10 >> 8 & 255) / 255.0F; - var13 = (float)(var10 & 255) / 255.0F; -- GL11.glColor4f(var9 * var21, var9 * var23, var9 * var13, 1.0F); -+ GL11.glColor4f(var9 * var20, var9 * var22, var9 * var13, 1.0F); - } else { - GL11.glColor4f(var9, var9, var9, 1.0F); - } -@@ -200,33 +286,35 @@ - float var14; - float var15; - float var16; -- float var20; -- Render var26; -- RenderPlayer var28; -- if(var8 != null && var8.itemID == Item.map.itemID) { -+ float var21; -+ Render var27; -+ RenderPlayer var26; -+ -+ if (var8 != null && var8.itemID == Item.map.itemID) { - GL11.glPushMatrix(); -- var20 = 0.8F; -- var21 = var3.getSwingProgress(var1); -- var23 = MathHelper.sin(var21 * (float)Math.PI); -- var13 = MathHelper.sin(MathHelper.sqrt_float(var21) * (float)Math.PI); -- GL11.glTranslatef(-var13 * 0.4F, MathHelper.sin(MathHelper.sqrt_float(var21) * (float)Math.PI * 2.0F) * 0.2F, -var23 * 0.2F); -- var21 = 1.0F - var4 / 45.0F + 0.1F; -- if(var21 < 0.0F) { -- var21 = 0.0F; -- } -- -- if(var21 > 1.0F) { -- var21 = 1.0F; -- } -- -- var21 = -MathHelper.cos(var21 * (float)Math.PI) * 0.5F + 0.5F; -- GL11.glTranslatef(0.0F, 0.0F * var20 - (1.0F - var2) * 1.2F - var21 * 0.5F + 0.04F, -0.9F * var20); -+ var21 = 0.8F; -+ var20 = var3.getSwingProgress(par1); -+ var22 = MathHelper.sin(var20 * (float)Math.PI); -+ var13 = MathHelper.sin(MathHelper.sqrt_float(var20) * (float)Math.PI); -+ GL11.glTranslatef(-var13 * 0.4F, MathHelper.sin(MathHelper.sqrt_float(var20) * (float)Math.PI * 2.0F) * 0.2F, -var22 * 0.2F); -+ var20 = 1.0F - var4 / 45.0F + 0.1F; -+ -+ if (var20 < 0.0F) { -+ var20 = 0.0F; -+ } -+ -+ if (var20 > 1.0F) { -+ var20 = 1.0F; -+ } -+ -+ var20 = -MathHelper.cos(var20 * (float)Math.PI) * 0.5F + 0.5F; -+ GL11.glTranslatef(0.0F, 0.0F * var21 - (1.0F - var2) * 1.2F - var20 * 0.5F + 0.04F, -0.9F * var21); - GL11.glRotatef(90.0F, 0.0F, 1.0F, 0.0F); -- GL11.glRotatef(var21 * -85.0F, 0.0F, 0.0F, 1.0F); -+ GL11.glRotatef(var20 * -85.0F, 0.0F, 0.0F, 1.0F); - GL11.glEnable(GL12.GL_RESCALE_NORMAL); - this.mc.getTextureManager().bindTexture(var3.getLocationSkin()); - -- for(var12 = 0; var12 < 2; ++var12) { -+ for (var12 = 0; var12 < 2; ++var12) { - int var24 = var12 * 2 - 1; - GL11.glPushMatrix(); - GL11.glTranslatef(-0.0F, -0.6F, 1.1F * (float)var24); -@@ -234,17 +322,17 @@ - GL11.glRotatef(-90.0F, 0.0F, 0.0F, 1.0F); - GL11.glRotatef(59.0F, 0.0F, 0.0F, 1.0F); - GL11.glRotatef((float)(-65 * var24), 0.0F, 1.0F, 0.0F); -- var26 = RenderManager.instance.getEntityRenderObject(this.mc.thePlayer); -- var28 = (RenderPlayer)var26; -+ var27 = RenderManager.instance.getEntityRenderObject(this.mc.thePlayer); -+ var26 = (RenderPlayer)var27; - var16 = 1.0F; - GL11.glScalef(var16, var16, var16); -- var28.renderFirstPersonArm(this.mc.thePlayer); -+ var26.renderFirstPersonArm(this.mc.thePlayer); - GL11.glPopMatrix(); - } - -- var23 = var3.getSwingProgress(var1); -- var13 = MathHelper.sin(var23 * var23 * (float)Math.PI); -- var14 = MathHelper.sin(MathHelper.sqrt_float(var23) * (float)Math.PI); -+ var22 = var3.getSwingProgress(par1); -+ var13 = MathHelper.sin(var22 * var22 * (float)Math.PI); -+ var14 = MathHelper.sin(MathHelper.sqrt_float(var22) * (float)Math.PI); - GL11.glRotatef(-var13 * 20.0F, 0.0F, 1.0F, 0.0F); - GL11.glRotatef(-var14 * 20.0F, 0.0F, 0.0F, 1.0F); - GL11.glRotatef(-var14 * 80.0F, 1.0F, 0.0F, 0.0F); -@@ -256,80 +344,86 @@ - var16 = 0.015625F; - GL11.glScalef(var16, var16, var16); - this.mc.getTextureManager().bindTexture(RES_MAP_BACKGROUND); -- Tessellator var29 = Tessellator.instance; -+ Tessellator var30 = Tessellator.instance; - GL11.glNormal3f(0.0F, 0.0F, -1.0F); -- var29.startDrawingQuads(); -- byte var30 = 7; -- var29.addVertexWithUV((double)(0 - var30), (double)(128 + var30), 0.0D, 0.0D, 1.0D); -- var29.addVertexWithUV((double)(128 + var30), (double)(128 + var30), 0.0D, 1.0D, 1.0D); -- var29.addVertexWithUV((double)(128 + var30), (double)(0 - var30), 0.0D, 1.0D, 0.0D); -- var29.addVertexWithUV((double)(0 - var30), (double)(0 - var30), 0.0D, 0.0D, 0.0D); -- var29.draw(); -+ var30.startDrawingQuads(); -+ byte var29 = 7; -+ var30.addVertexWithUV((double)(0 - var29), (double)(128 + var29), 0.0D, 0.0D, 1.0D); -+ var30.addVertexWithUV((double)(128 + var29), (double)(128 + var29), 0.0D, 1.0D, 1.0D); -+ var30.addVertexWithUV((double)(128 + var29), (double)(0 - var29), 0.0D, 1.0D, 0.0D); -+ var30.addVertexWithUV((double)(0 - var29), (double)(0 - var29), 0.0D, 0.0D, 0.0D); -+ var30.draw(); - MapData var19 = Item.map.getMapData(var8, this.mc.theWorld); -- if(var19 != null) { -+ -+ if (var19 != null) { - this.mapItemRenderer.renderMap(this.mc.thePlayer, this.mc.getTextureManager(), var19); - } - - GL11.glPopMatrix(); -- } else if(var8 != null) { -+ } else if (var8 != null) { - GL11.glPushMatrix(); -- var20 = 0.8F; -- if(var3.getItemInUseCount() > 0) { -- EnumAction var22 = var8.getItemUseAction(); -- if(var22 == EnumAction.eat || var22 == EnumAction.drink) { -- var23 = (float)var3.getItemInUseCount() - var1 + 1.0F; -- var13 = 1.0F - var23 / (float)var8.getMaxItemUseDuration(); -+ var21 = 0.8F; -+ -+ if (var3.getItemInUseCount() > 0) { -+ EnumAction var23 = var8.getItemUseAction(); -+ -+ if (var23 == EnumAction.eat || var23 == EnumAction.drink) { -+ var22 = (float)var3.getItemInUseCount() - par1 + 1.0F; -+ var13 = 1.0F - var22 / (float)var8.getMaxItemUseDuration(); - var14 = 1.0F - var13; - var14 = var14 * var14 * var14; - var14 = var14 * var14 * var14; - var14 = var14 * var14 * var14; - var15 = 1.0F - var14; -- GL11.glTranslatef(0.0F, MathHelper.abs(MathHelper.cos(var23 / 4.0F * (float)Math.PI) * 0.1F) * (float)((double)var13 > 0.2D ? 1 : 0), 0.0F); -+ GL11.glTranslatef(0.0F, MathHelper.abs(MathHelper.cos(var22 / 4.0F * (float)Math.PI) * 0.1F) * (float)((double)var13 > 0.2D ? 1 : 0), 0.0F); - GL11.glTranslatef(var15 * 0.6F, -var15 * 0.5F, 0.0F); - GL11.glRotatef(var15 * 90.0F, 0.0F, 1.0F, 0.0F); - GL11.glRotatef(var15 * 10.0F, 1.0F, 0.0F, 0.0F); - GL11.glRotatef(var15 * 30.0F, 0.0F, 0.0F, 1.0F); - } - } else { -- var21 = var3.getSwingProgress(var1); -- var23 = MathHelper.sin(var21 * (float)Math.PI); -- var13 = MathHelper.sin(MathHelper.sqrt_float(var21) * (float)Math.PI); -- GL11.glTranslatef(-var13 * 0.4F, MathHelper.sin(MathHelper.sqrt_float(var21) * (float)Math.PI * 2.0F) * 0.2F, -var23 * 0.2F); -+ var20 = var3.getSwingProgress(par1); -+ var22 = MathHelper.sin(var20 * (float)Math.PI); -+ var13 = MathHelper.sin(MathHelper.sqrt_float(var20) * (float)Math.PI); -+ GL11.glTranslatef(-var13 * 0.4F, MathHelper.sin(MathHelper.sqrt_float(var20) * (float)Math.PI * 2.0F) * 0.2F, -var22 * 0.2F); - } - -- GL11.glTranslatef(0.7F * var20, -0.65F * var20 - (1.0F - var2) * 0.6F, -0.9F * var20); -+ GL11.glTranslatef(0.7F * var21, -0.65F * var21 - (1.0F - var2) * 0.6F, -0.9F * var21); - GL11.glRotatef(45.0F, 0.0F, 1.0F, 0.0F); - GL11.glEnable(GL12.GL_RESCALE_NORMAL); -- var21 = var3.getSwingProgress(var1); -- var23 = MathHelper.sin(var21 * var21 * (float)Math.PI); -- var13 = MathHelper.sin(MathHelper.sqrt_float(var21) * (float)Math.PI); -- GL11.glRotatef(-var23 * 20.0F, 0.0F, 1.0F, 0.0F); -+ var20 = var3.getSwingProgress(par1); -+ var22 = MathHelper.sin(var20 * var20 * (float)Math.PI); -+ var13 = MathHelper.sin(MathHelper.sqrt_float(var20) * (float)Math.PI); -+ GL11.glRotatef(-var22 * 20.0F, 0.0F, 1.0F, 0.0F); - GL11.glRotatef(-var13 * 20.0F, 0.0F, 0.0F, 1.0F); - GL11.glRotatef(-var13 * 80.0F, 1.0F, 0.0F, 0.0F); - var14 = 0.4F; - GL11.glScalef(var14, var14, var14); - float var17; - float var18; -- if(var3.getItemInUseCount() > 0) { -+ -+ if (var3.getItemInUseCount() > 0) { - EnumAction var25 = var8.getItemUseAction(); -- if(var25 == EnumAction.block) { -+ -+ if (var25 == EnumAction.block) { - GL11.glTranslatef(-0.5F, 0.2F, 0.0F); - GL11.glRotatef(30.0F, 0.0F, 1.0F, 0.0F); - GL11.glRotatef(-80.0F, 1.0F, 0.0F, 0.0F); - GL11.glRotatef(60.0F, 0.0F, 1.0F, 0.0F); -- } else if(var25 == EnumAction.bow) { -+ } else if (var25 == EnumAction.bow) { - GL11.glRotatef(-18.0F, 0.0F, 0.0F, 1.0F); - GL11.glRotatef(-12.0F, 0.0F, 1.0F, 0.0F); - GL11.glRotatef(-8.0F, 1.0F, 0.0F, 0.0F); - GL11.glTranslatef(-0.9F, 0.2F, 0.0F); -- var16 = (float)var8.getMaxItemUseDuration() - ((float)var3.getItemInUseCount() - var1 + 1.0F); -+ var16 = (float)var8.getMaxItemUseDuration() - ((float)var3.getItemInUseCount() - par1 + 1.0F); - var17 = var16 / 20.0F; - var17 = (var17 * var17 + var17 * 2.0F) / 3.0F; -- if(var17 > 1.0F) { -+ -+ if (var17 > 1.0F) { - var17 = 1.0F; - } - -- if(var17 > 0.1F) { -+ if (var17 > 0.1F) { - GL11.glTranslatef(0.0F, MathHelper.sin((var16 - 0.1F) * 1.3F) * 0.01F * (var17 - 0.1F), 0.0F); - } - -@@ -345,16 +439,16 @@ - } - } - -- if(var8.getItem().shouldRotateAroundWhenRendering()) { -+ if (var8.getItem().shouldRotateAroundWhenRendering()) { - GL11.glRotatef(180.0F, 0.0F, 1.0F, 0.0F); - } - -- if(var8.getItem().requiresMultipleRenderPasses()) { -+ if (var8.getItem().requiresMultipleRenderPasses()) { - this.renderItem(var3, var8, 0); -- int var27 = Item.itemsList[var8.itemID].getColorFromItemStack(var8, 1); -- var16 = (float)(var27 >> 16 & 255) / 255.0F; -- var17 = (float)(var27 >> 8 & 255) / 255.0F; -- var18 = (float)(var27 & 255) / 255.0F; -+ int var28 = Item.itemsList[var8.itemID].getColorFromItemStack(var8, 1); -+ var16 = (float)(var28 >> 16 & 255) / 255.0F; -+ var17 = (float)(var28 >> 8 & 255) / 255.0F; -+ var18 = (float)(var28 & 255) / 255.0F; - GL11.glColor4f(var9 * var16, var9 * var17, var9 * var18, 1.0F); - this.renderItem(var3, var8, 1); - } else { -@@ -362,21 +456,21 @@ - } - - GL11.glPopMatrix(); -- } else if(!var3.isInvisible()) { -+ } else if (!var3.isInvisible()) { - GL11.glPushMatrix(); -- var20 = 0.8F; -- var21 = var3.getSwingProgress(var1); -- var23 = MathHelper.sin(var21 * (float)Math.PI); -- var13 = MathHelper.sin(MathHelper.sqrt_float(var21) * (float)Math.PI); -- GL11.glTranslatef(-var13 * 0.3F, MathHelper.sin(MathHelper.sqrt_float(var21) * (float)Math.PI * 2.0F) * 0.4F, -var23 * 0.4F); -- GL11.glTranslatef(0.8F * var20, -(12.0F / 16.0F) * var20 - (1.0F - var2) * 0.6F, -0.9F * var20); -+ var21 = 0.8F; -+ var20 = var3.getSwingProgress(par1); -+ var22 = MathHelper.sin(var20 * (float)Math.PI); -+ var13 = MathHelper.sin(MathHelper.sqrt_float(var20) * (float)Math.PI); -+ GL11.glTranslatef(-var13 * 0.3F, MathHelper.sin(MathHelper.sqrt_float(var20) * (float)Math.PI * 2.0F) * 0.4F, -var22 * 0.4F); -+ GL11.glTranslatef(0.8F * var21, -0.75F * var21 - (1.0F - var2) * 0.6F, -0.9F * var21); - GL11.glRotatef(45.0F, 0.0F, 1.0F, 0.0F); - GL11.glEnable(GL12.GL_RESCALE_NORMAL); -- var21 = var3.getSwingProgress(var1); -- var23 = MathHelper.sin(var21 * var21 * (float)Math.PI); -- var13 = MathHelper.sin(MathHelper.sqrt_float(var21) * (float)Math.PI); -+ var20 = var3.getSwingProgress(par1); -+ var22 = MathHelper.sin(var20 * var20 * (float)Math.PI); -+ var13 = MathHelper.sin(MathHelper.sqrt_float(var20) * (float)Math.PI); - GL11.glRotatef(var13 * 70.0F, 0.0F, 1.0F, 0.0F); -- GL11.glRotatef(-var23 * 20.0F, 0.0F, 0.0F, 1.0F); -+ GL11.glRotatef(-var22 * 20.0F, 0.0F, 0.0F, 1.0F); - this.mc.getTextureManager().bindTexture(var3.getLocationSkin()); - GL11.glTranslatef(-1.0F, 3.6F, 3.5F); - GL11.glRotatef(120.0F, 0.0F, 0.0F, 1.0F); -@@ -384,11 +478,11 @@ - GL11.glRotatef(-135.0F, 0.0F, 1.0F, 0.0F); - GL11.glScalef(1.0F, 1.0F, 1.0F); - GL11.glTranslatef(5.6F, 0.0F, 0.0F); -- var26 = RenderManager.instance.getEntityRenderObject(this.mc.thePlayer); -- var28 = (RenderPlayer)var26; -+ var27 = RenderManager.instance.getEntityRenderObject(this.mc.thePlayer); -+ var26 = (RenderPlayer)var27; - var16 = 1.0F; - GL11.glScalef(var16, var16, var16); -- var28.renderFirstPersonArm(this.mc.thePlayer); -+ var26.renderFirstPersonArm(this.mc.thePlayer); - GL11.glPopMatrix(); - } - -@@ -396,46 +490,55 @@ - RenderHelper.disableStandardItemLighting(); - } - -- public void renderOverlays(float var1) { -+ /** -+ * Renders all the overlays that are in first person mode. Args: partialTickTime -+ */ -+ public void renderOverlays(float par1) { - GL11.glDisable(GL11.GL_ALPHA_TEST); -- if(this.mc.thePlayer.isBurning()) { -- this.renderFireInFirstPerson(var1); -+ -+ if (this.mc.thePlayer.isBurning()) { -+ this.renderFireInFirstPerson(par1); - } - -- if(this.mc.thePlayer.isEntityInsideOpaqueBlock()) { -+ if (this.mc.thePlayer.isEntityInsideOpaqueBlock()) { - int var2 = MathHelper.floor_double(this.mc.thePlayer.posX); - int var3 = MathHelper.floor_double(this.mc.thePlayer.posY); -- int var4 = MathHelper.floor_double(this.mc.thePlayer.posZ); -+ int var4 = MathHelper.floor_double(this.mc.thePlayer.posZ); - int var5 = this.mc.theWorld.getBlockId(var2, var3, var4); -- if(this.mc.theWorld.isBlockNormalCube(var2, var3, var4)) { -- this.renderInsideOfBlock(var1, Block.blocksList[var5].getBlockTextureFromSide(2)); -+ -+ if (this.mc.theWorld.isBlockNormalCube(var2, var3, var4)) { -+ this.renderInsideOfBlock(par1, Block.blocksList[var5].getBlockTextureFromSide(2)); - } else { -- for(int var6 = 0; var6 < 8; ++var6) { -+ for (int var6 = 0; var6 < 8; ++var6) { - float var7 = ((float)((var6 >> 0) % 2) - 0.5F) * this.mc.thePlayer.width * 0.9F; - float var8 = ((float)((var6 >> 1) % 2) - 0.5F) * this.mc.thePlayer.height * 0.2F; - float var9 = ((float)((var6 >> 2) % 2) - 0.5F) * this.mc.thePlayer.width * 0.9F; - int var10 = MathHelper.floor_float((float)var2 + var7); - int var11 = MathHelper.floor_float((float)var3 + var8); - int var12 = MathHelper.floor_float((float)var4 + var9); -- if(this.mc.theWorld.isBlockNormalCube(var10, var11, var12)) { -+ -+ if (this.mc.theWorld.isBlockNormalCube(var10, var11, var12)) { - var5 = this.mc.theWorld.getBlockId(var10, var11, var12); - } - } - } - -- if(Block.blocksList[var5] != null) { -- this.renderInsideOfBlock(var1, Block.blocksList[var5].getBlockTextureFromSide(2)); -+ if (Block.blocksList[var5] != null) { -+ this.renderInsideOfBlock(par1, Block.blocksList[var5].getBlockTextureFromSide(2)); - } - } - -- if(this.mc.thePlayer.isInsideOfMaterial(Material.water)) { -- this.renderWarpedTextureOverlay(var1); -+ if (this.mc.thePlayer.isInsideOfMaterial(Material.water)) { -+ this.renderWarpedTextureOverlay(par1); - } - - GL11.glEnable(GL11.GL_ALPHA_TEST); - } - -- private void renderInsideOfBlock(float var1, Icon var2) { -+ /** -+ * Renders the texture of the block the player is inside as an overlay. Args: partialTickTime, blockTextureIndex -+ */ -+ private void renderInsideOfBlock(float par1, Icon par2Icon) { - this.mc.getTextureManager().bindTexture(TextureMap.locationBlocksTexture); - Tessellator var3 = Tessellator.instance; - float var4 = 0.1F; -@@ -446,10 +549,10 @@ - float var7 = -1.0F; - float var8 = 1.0F; - float var9 = -0.5F; -- float var10 = var2.getMinU(); -- float var11 = var2.getMaxU(); -- float var12 = var2.getMinV(); -- float var13 = var2.getMaxV(); -+ float var10 = par2Icon.getMinU(); -+ float var11 = par2Icon.getMaxU(); -+ float var12 = par2Icon.getMinV(); -+ float var13 = par2Icon.getMaxV(); - var3.startDrawingQuads(); - var3.addVertexWithUV((double)var5, (double)var7, (double)var9, (double)var11, (double)var13); - var3.addVertexWithUV((double)var6, (double)var7, (double)var9, (double)var10, (double)var13); -@@ -460,10 +563,14 @@ - GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - } - -- private void renderWarpedTextureOverlay(float var1) { -+ /** -+ * Renders a texture that warps around based on the direction the player is looking. Texture needs to be bound before -+ * being called. Used for the water overlay. Args: parialTickTime -+ */ -+ private void renderWarpedTextureOverlay(float par1) { - this.mc.getTextureManager().bindTexture(RES_UNDERWATER_OVERLAY); - Tessellator var2 = Tessellator.instance; -- float var3 = this.mc.thePlayer.getBrightness(var1); -+ float var3 = this.mc.thePlayer.getBrightness(par1); - GL11.glColor4f(var3, var3, var3, 0.5F); - GL11.glEnable(GL11.GL_BLEND); - GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); -@@ -487,14 +594,17 @@ - GL11.glDisable(GL11.GL_BLEND); - } - -- private void renderFireInFirstPerson(float var1) { -+ /** -+ * Renders the fire on the screen for first person mode. Arg: partialTickTime -+ */ -+ private void renderFireInFirstPerson(float par1) { - Tessellator var2 = Tessellator.instance; - GL11.glColor4f(1.0F, 1.0F, 1.0F, 0.9F); - GL11.glEnable(GL11.GL_BLEND); - GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); - float var3 = 1.0F; - -- for(int var4 = 0; var4 < 2; ++var4) { -+ for (int var4 = 0; var4 < 2; ++var4) { - GL11.glPushMatrix(); - Icon var5 = Block.fire.getFireIcon(1); - this.mc.getTextureManager().bindTexture(TextureMap.locationBlocksTexture); -@@ -527,11 +637,12 @@ - EntityClientPlayerMP var1 = this.mc.thePlayer; - ItemStack var2 = var1.inventory.getCurrentItem(); - boolean var3 = this.equippedItemSlot == var1.inventory.currentItem && var2 == this.itemToRender; -- if(this.itemToRender == null && var2 == null) { -+ -+ if (this.itemToRender == null && var2 == null) { - var3 = true; - } - -- if(var2 != null && this.itemToRender != null && var2 != this.itemToRender && var2.itemID == this.itemToRender.itemID && var2.getItemDamage() == this.itemToRender.getItemDamage()) { -+ if (var2 != null && this.itemToRender != null && var2 != this.itemToRender && var2.itemID == this.itemToRender.itemID && var2.getItemDamage() == this.itemToRender.getItemDamage()) { - this.itemToRender = var2; - var3 = true; - } -@@ -539,26 +650,33 @@ - float var4 = 0.4F; - float var5 = var3 ? 1.0F : 0.0F; - float var6 = var5 - this.equippedProgress; -- if(var6 < -var4) { -+ -+ if (var6 < -var4) { - var6 = -var4; - } - -- if(var6 > var4) { -+ if (var6 > var4) { - var6 = var4; - } - - this.equippedProgress += var6; -- if(this.equippedProgress < 0.1F) { -+ -+ if (this.equippedProgress < 0.1F) { - this.itemToRender = var2; - this.equippedItemSlot = var1.inventory.currentItem; - } -- - } - -+ /** -+ * Resets equippedProgress -+ */ - public void resetEquippedProgress() { - this.equippedProgress = 0.0F; - } - -+ /** -+ * Resets equippedProgress -+ */ - public void resetEquippedProgress2() { - this.equippedProgress = 0.0F; - } ---- net/minecraft/src/SoundUpdaterMinecart.java -+++ net/minecraft/src/SoundUpdaterMinecart.java -@@ -2,7 +2,11 @@ - - public class SoundUpdaterMinecart implements IUpdatePlayerListBox { - private final SoundManager theSoundManager; -+ -+ /** Minecart which sound is being updated. */ - private final EntityMinecart theMinecart; -+ -+ /** The player that is getting the minecart sound updates. */ - private final EntityPlayerSP thePlayer; - private boolean playerSPRidingMinecart; - private boolean minecartIsDead; -@@ -13,12 +17,15 @@ - private float minecartRideSoundVolume; - private double minecartSpeed; - -- public SoundUpdaterMinecart(SoundManager var1, EntityMinecart var2, EntityPlayerSP var3) { -- this.theSoundManager = var1; -- this.theMinecart = var2; -- this.thePlayer = var3; -+ public SoundUpdaterMinecart(SoundManager par1SoundManager, EntityMinecart par2EntityMinecart, EntityPlayerSP par3EntityPlayerSP) { -+ this.theSoundManager = par1SoundManager; -+ this.theMinecart = par2EntityMinecart; -+ this.thePlayer = par3EntityPlayerSP; - } - -+ /** -+ * Updates the JList with a new model. -+ */ - public void update() { - boolean var1 = false; - boolean var2 = this.playerSPRidingMinecart; -@@ -32,83 +39,86 @@ - this.minecartIsDead = this.theMinecart.isDead; - this.minecartSpeed = (double)MathHelper.sqrt_double(this.theMinecart.motionX * this.theMinecart.motionX + this.theMinecart.motionZ * this.theMinecart.motionZ); - this.minecartIsMoving = this.minecartSpeed >= 0.01D; -- if(var2 && !this.playerSPRidingMinecart) { -+ -+ if (var2 && !this.playerSPRidingMinecart) { - this.theSoundManager.stopEntitySound(this.thePlayer); - } - -- if(this.minecartIsDead || !this.silent && this.minecartMoveSoundVolume == 0.0F && this.minecartRideSoundVolume == 0.0F) { -- if(!var3) { -+ if (this.minecartIsDead || !this.silent && this.minecartMoveSoundVolume == 0.0F && this.minecartRideSoundVolume == 0.0F) { -+ if (!var3) { - this.theSoundManager.stopEntitySound(this.theMinecart); -- if(var2 || this.playerSPRidingMinecart) { -+ -+ if (var2 || this.playerSPRidingMinecart) { - this.theSoundManager.stopEntitySound(this.thePlayer); - } - } - - this.silent = true; -- if(this.minecartIsDead) { -+ -+ if (this.minecartIsDead) { - return; - } - } - -- if(!this.theSoundManager.isEntitySoundPlaying(this.theMinecart) && this.minecartMoveSoundVolume > 0.0F) { -+ if (!this.theSoundManager.isEntitySoundPlaying(this.theMinecart) && this.minecartMoveSoundVolume > 0.0F) { - this.theSoundManager.playEntitySound("minecart.base", this.theMinecart, this.minecartMoveSoundVolume, this.minecartSoundPitch, false); - this.silent = false; - var1 = true; - } - -- if(this.playerSPRidingMinecart && !this.theSoundManager.isEntitySoundPlaying(this.thePlayer) && this.minecartRideSoundVolume > 0.0F) { -+ if (this.playerSPRidingMinecart && !this.theSoundManager.isEntitySoundPlaying(this.thePlayer) && this.minecartRideSoundVolume > 0.0F) { - this.theSoundManager.playEntitySound("minecart.inside", this.thePlayer, this.minecartRideSoundVolume, 1.0F, true); - this.silent = false; - var1 = true; - } - -- if(this.minecartIsMoving) { -- if(this.minecartSoundPitch < 1.0F) { -+ if (this.minecartIsMoving) { -+ if (this.minecartSoundPitch < 1.0F) { - this.minecartSoundPitch += 0.0025F; - } - -- if(this.minecartSoundPitch > 1.0F) { -+ if (this.minecartSoundPitch > 1.0F) { - this.minecartSoundPitch = 1.0F; - } - - float var10 = MathHelper.clamp_float((float)this.minecartSpeed, 0.0F, 4.0F) / 4.0F; -- this.minecartRideSoundVolume = 0.0F + var10 * (12.0F / 16.0F); -+ this.minecartRideSoundVolume = 0.0F + var10 * 0.75F; - var10 = MathHelper.clamp_float(var10 * 2.0F, 0.0F, 1.0F); - this.minecartMoveSoundVolume = 0.0F + var10 * 0.7F; -- } else if(var4) { -+ } else if (var4) { - this.minecartMoveSoundVolume = 0.0F; - this.minecartSoundPitch = 0.0F; - this.minecartRideSoundVolume = 0.0F; - } - -- if(!this.silent) { -- if(this.minecartSoundPitch != var6) { -+ if (!this.silent) { -+ if (this.minecartSoundPitch != var6) { - this.theSoundManager.setEntitySoundPitch(this.theMinecart, this.minecartSoundPitch); - } - -- if(this.minecartMoveSoundVolume != var5) { -+ if (this.minecartMoveSoundVolume != var5) { - this.theSoundManager.setEntitySoundVolume(this.theMinecart, this.minecartMoveSoundVolume); - } - -- if(this.minecartRideSoundVolume != var7) { -+ if (this.minecartRideSoundVolume != var7) { - this.theSoundManager.setEntitySoundVolume(this.thePlayer, this.minecartRideSoundVolume); - } - } - -- if(!var1 && (this.minecartMoveSoundVolume > 0.0F || this.minecartRideSoundVolume > 0.0F)) { -+ if (!var1 && (this.minecartMoveSoundVolume > 0.0F || this.minecartRideSoundVolume > 0.0F)) { - this.theSoundManager.updateSoundLocation(this.theMinecart); -- if(this.playerSPRidingMinecart) { -+ -+ if (this.playerSPRidingMinecart) { - this.theSoundManager.updateSoundLocation(this.thePlayer, this.theMinecart); - } - } else { -- if(this.theSoundManager.isEntitySoundPlaying(this.theMinecart)) { -+ if (this.theSoundManager.isEntitySoundPlaying(this.theMinecart)) { - this.theSoundManager.stopEntitySound(this.theMinecart); - } - -- if(this.playerSPRidingMinecart && this.theSoundManager.isEntitySoundPlaying(this.thePlayer)) { -+ if (this.playerSPRidingMinecart && this.theSoundManager.isEntitySoundPlaying(this.thePlayer)) { - this.theSoundManager.stopEntitySound(this.thePlayer); - } - } -- - } - } ---- net/minecraft/src/ComponentVillageStartPiece.java -+++ net/minecraft/src/ComponentVillageStartPiece.java -@@ -6,22 +6,30 @@ - - public class ComponentVillageStartPiece extends ComponentVillageWell { - public WorldChunkManager worldChunkMngr; -+ -+ /** Boolean that determines if the village is in a desert or not. */ - public boolean inDesert; -+ -+ /** World terrain type, 0 for normal, 1 for flap map */ - public int terrainType; - public StructureVillagePieceWeight structVillagePieceWeight; -- public List e; -- public List i = new ArrayList(); -- public List j = new ArrayList(); -- -- public ComponentVillageStartPiece() { -- } -- -- public ComponentVillageStartPiece(WorldChunkManager var1, int var2, Random var3, int var4, int var5, List var6, int var7) { -- super((ComponentVillageStartPiece)null, 0, var3, var4, var5); -- this.worldChunkMngr = var1; -- this.e = var6; -- this.terrainType = var7; -- BiomeGenBase var8 = var1.getBiomeGenAt(var4, var5); -+ -+ /** -+ * Contains List of all spawnable Structure Piece Weights. If no more Pieces of a type can be spawned, they are removed -+ * from this list -+ */ -+ public List structureVillageWeightedPieceList; -+ public List field_74932_i = new ArrayList(); -+ public List field_74930_j = new ArrayList(); -+ -+ public ComponentVillageStartPiece() {} -+ -+ public ComponentVillageStartPiece(WorldChunkManager par1WorldChunkManager, int par2, Random par3Random, int par4, int par5, List par6List, int par7) { -+ super((ComponentVillageStartPiece)null, 0, par3Random, par4, par5); -+ this.worldChunkMngr = par1WorldChunkManager; -+ this.structureVillageWeightedPieceList = par6List; -+ this.terrainType = par7; -+ BiomeGenBase var8 = par1WorldChunkManager.getBiomeGenAt(par4, par5); - this.inDesert = var8 == BiomeGenBase.desert || var8 == BiomeGenBase.desertHills; - } - ---- /dev/null -+++ com/prupe/mcpatcher/ctm/CTMUtils$3.java -@@ -1,0 +1,21 @@ -+package com.prupe.mcpatcher.ctm; -+ -+import com.prupe.mcpatcher.ctm.CTMUtils$TileOverrideIterator; -+import net.minecraft.src.Block; -+import net.minecraft.src.Icon; -+ -+final class CTMUtils$3 extends CTMUtils$TileOverrideIterator { -+ final int val$face; -+ -+ final int val$metadata; -+ -+ CTMUtils$3(Block x0, Icon x1, int var3, int var4) { -+ super(x0, x1); -+ this.val$face = var3; -+ this.val$metadata = var4; -+ } -+ -+ Icon getTile(ITileOverride override, Block block, Icon currentIcon) { -+ return override.getTile(block, currentIcon, this.val$face, this.val$metadata); -+ } -+} ---- net/minecraft/src/GuiControls.java -+++ net/minecraft/src/GuiControls.java -@@ -1,95 +1,128 @@ - package net.minecraft.src; - - public class GuiControls extends GuiScreen { -+ -+ /** -+ * A reference to the screen object that created this. Used for navigating between screens. -+ */ - private GuiScreen parentScreen; -- protected String a = "Controls"; -+ -+ /** The title string that is displayed in the top-center of the screen. */ -+ protected String screenTitle = "Controls"; -+ -+ /** Reference to the GameSettings object. */ - private GameSettings options; -+ -+ /** The ID of the button that has been pressed. */ - private int buttonId = -1; - -- public GuiControls(GuiScreen var1, GameSettings var2) { -- this.parentScreen = var1; -- this.options = var2; -+ public GuiControls(GuiScreen par1GuiScreen, GameSettings par2GameSettings) { -+ this.parentScreen = par1GuiScreen; -+ this.options = par2GameSettings; - } - -+ /** -+ * Gets the distance from the left border of the window to left border of the controls screen -+ */ - private int getLeftBorder() { - return this.width / 2 - 155; - } - -+ /** -+ * Adds the buttons (and other controls) to the screen in question. -+ */ - public void initGui() { - int var1 = this.getLeftBorder(); - -- for(int var2 = 0; var2 < this.options.keyBindings.length; ++var2) { -- this.i.add(new GuiSmallButton(var2, var1 + var2 % 2 * 160, this.height / 6 + 24 * (var2 >> 1), 70, 20, this.options.getOptionDisplayString(var2))); -+ for (int var2 = 0; var2 < this.options.keyBindings.length; ++var2) { -+ this.buttonList.add(new GuiSmallButton(var2, var1 + var2 % 2 * 160, this.height / 6 + 24 * (var2 >> 1), 70, 20, this.options.getOptionDisplayString(var2))); - } - -- this.i.add(new GuiButton(200, this.width / 2 - 100, this.height / 6 + 168, I18n.getString("gui.done"))); -- this.a = I18n.getString("controls.title"); -+ this.buttonList.add(new GuiButton(200, this.width / 2 - 100, this.height / 6 + 168, I18n.getString("gui.done"))); -+ this.screenTitle = I18n.getString("controls.title"); - } - -- protected void actionPerformed(GuiButton var1) { -- for(int var2 = 0; var2 < this.options.keyBindings.length; ++var2) { -- ((GuiButton)this.i.get(var2)).f = this.options.getOptionDisplayString(var2); -+ /** -+ * Fired when a control is clicked. This is the equivalent of ActionListener.actionPerformed(ActionEvent e). -+ */ -+ protected void actionPerformed(GuiButton par1GuiButton) { -+ for (int var2 = 0; var2 < this.options.keyBindings.length; ++var2) { -+ ((GuiButton)this.buttonList.get(var2)).displayString = this.options.getOptionDisplayString(var2); - } - -- if(var1.id == 200) { -+ if (par1GuiButton.id == 200) { - this.mc.displayGuiScreen(this.parentScreen); - } else { -- this.buttonId = var1.id; -- var1.f = "> " + this.options.getOptionDisplayString(var1.id) + " <"; -- } -- -- } -- -- protected void mouseClicked(int var1, int var2, int var3) { -- if(this.buttonId >= 0) { -- this.options.setKeyBinding(this.buttonId, -100 + var3); -- ((GuiButton)this.i.get(this.buttonId)).f = this.options.getOptionDisplayString(this.buttonId); -- this.buttonId = -1; -- KeyBinding.resetKeyBindingArrayAndHash(); -- } else { -- super.mouseClicked(var1, var2, var3); -- } -- -- } -- -- protected void keyTyped(char var1, int var2) { -- if(this.buttonId >= 0) { -- this.options.setKeyBinding(this.buttonId, var2); -- ((GuiButton)this.i.get(this.buttonId)).f = this.options.getOptionDisplayString(this.buttonId); -- this.buttonId = -1; -- KeyBinding.resetKeyBindingArrayAndHash(); -- } else { -- super.keyTyped(var1, var2); -- } -- -- } -- -- public void drawScreen(int var1, int var2, float var3) { -+ this.buttonId = par1GuiButton.id; -+ par1GuiButton.displayString = "> " + this.options.getOptionDisplayString(par1GuiButton.id) + " <"; -+ } -+ } -+ -+ /** -+ * Called when the mouse is clicked. -+ */ -+ protected void mouseClicked(int par1, int par2, int par3) { -+ if (this.buttonId >= 0) { -+ this.options.setKeyBinding(this.buttonId, -100 + par3); -+ ((GuiButton)this.buttonList.get(this.buttonId)).displayString = this.options.getOptionDisplayString(this.buttonId); -+ this.buttonId = -1; -+ KeyBinding.resetKeyBindingArrayAndHash(); -+ } else { -+ super.mouseClicked(par1, par2, par3); -+ } -+ } -+ -+ /** -+ * Fired when a key is typed. This is the equivalent of KeyListener.keyTyped(KeyEvent e). -+ */ -+ protected void keyTyped(char par1, int par2) { -+ if (this.buttonId >= 0) { -+ this.options.setKeyBinding(this.buttonId, par2); -+ ((GuiButton)this.buttonList.get(this.buttonId)).displayString = this.options.getOptionDisplayString(this.buttonId); -+ this.buttonId = -1; -+ KeyBinding.resetKeyBindingArrayAndHash(); -+ } else { -+ super.keyTyped(par1, par2); -+ } -+ } -+ -+ /** -+ * Draws the screen and all the components in it. -+ */ -+ public void drawScreen(int par1, int par2, float par3) { - this.drawDefaultBackground(); -- this.drawCenteredString(this.fontRenderer, this.a, this.width / 2, 20, 16777215); -+ this.drawCenteredString(this.fontRenderer, this.screenTitle, this.width / 2, 20, 16777215); - int var4 = this.getLeftBorder(); -+ int var5 = 0; - -- for(int var5 = 0; var5 < this.options.keyBindings.length; ++var5) { -+ while (var5 < this.options.keyBindings.length) { - boolean var6 = false; -- -- for(int var7 = 0; var7 < this.options.keyBindings.length; ++var7) { -- if(var7 != var5 && this.options.keyBindings[var5].keyCode == this.options.keyBindings[var7].keyCode) { -+ int var7 = 0; -+ -+ while (true) { -+ if (var7 < this.options.keyBindings.length) { -+ if (var7 == var5 || this.options.keyBindings[var5].keyCode != this.options.keyBindings[var7].keyCode) { -+ ++var7; -+ continue; -+ } -+ - var6 = true; -- break; -- } -- } -- -- if(this.buttonId == var5) { -- ((GuiButton)this.i.get(var5)).f = "" + EnumChatFormatting.WHITE + "> " + EnumChatFormatting.YELLOW + "??? " + EnumChatFormatting.WHITE + "<"; -- } else if(var6) { -- ((GuiButton)this.i.get(var5)).f = EnumChatFormatting.RED + this.options.getOptionDisplayString(var5); -- } else { -- ((GuiButton)this.i.get(var5)).f = this.options.getOptionDisplayString(var5); -- } -- -- this.drawString(this.fontRenderer, this.options.getKeyBindingDescription(var5), var4 + var5 % 2 * 160 + 70 + 6, this.height / 6 + 24 * (var5 >> 1) + 7, -1); -+ } -+ -+ if (this.buttonId == var5) { -+ ((GuiButton)this.buttonList.get(var5)).displayString = "" + EnumChatFormatting.WHITE + "> " + EnumChatFormatting.YELLOW + "??? " + EnumChatFormatting.WHITE + "<"; -+ } else if (var6) { -+ ((GuiButton)this.buttonList.get(var5)).displayString = EnumChatFormatting.RED + this.options.getOptionDisplayString(var5); -+ } else { -+ ((GuiButton)this.buttonList.get(var5)).displayString = this.options.getOptionDisplayString(var5); -+ } -+ -+ this.drawString(this.fontRenderer, this.options.getKeyBindingDescription(var5), var4 + var5 % 2 * 160 + 70 + 6, this.height / 6 + 24 * (var5 >> 1) + 7, -1); -+ ++var5; -+ break; -+ } - } - -- super.drawScreen(var1, var2, var3); -+ super.drawScreen(par1, par2, par3); - } - } ---- net/minecraft/src/BlockNote.java -+++ net/minecraft/src/BlockNote.java -@@ -1,73 +1,92 @@ - package net.minecraft.src; - - public class BlockNote extends BlockContainer { -- public BlockNote(int var1) { -- super(var1, Material.wood); -+ public BlockNote(int par1) { -+ super(par1, Material.wood); - this.setCreativeTab(CreativeTabs.tabRedstone); - } - -- public void onNeighborBlockChange(World var1, int var2, int var3, int var4, int var5) { -- boolean var6 = var1.isBlockIndirectlyGettingPowered(var2, var3, var4); -- TileEntityNote var7 = (TileEntityNote)var1.getBlockTileEntity(var2, var3, var4); -- if(var7 != null && var7.previousRedstoneState != var6) { -- if(var6) { -- var7.triggerNote(var1, var2, var3, var4); -+ /** -+ * Lets the block know when one of its neighbor changes. Doesn't know which neighbor changed (coordinates passed are -+ * their own) Args: x, y, z, neighbor blockID -+ */ -+ public void onNeighborBlockChange(World par1World, int par2, int par3, int par4, int par5) { -+ boolean var6 = par1World.isBlockIndirectlyGettingPowered(par2, par3, par4); -+ TileEntityNote var7 = (TileEntityNote)par1World.getBlockTileEntity(par2, par3, par4); -+ -+ if (var7 != null && var7.previousRedstoneState != var6) { -+ if (var6) { -+ var7.triggerNote(par1World, par2, par3, par4); - } - - var7.previousRedstoneState = var6; - } -- - } - -- public boolean onBlockActivated(World var1, int var2, int var3, int var4, EntityPlayer var5, int var6, float var7, float var8, float var9) { -- if(var1.isRemote) { -+ /** -+ * Called upon block activation (right click on the block.) -+ */ -+ public boolean onBlockActivated(World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer, int par6, float par7, float par8, float par9) { -+ if (par1World.isRemote) { - return true; - } else { -- TileEntityNote var10 = (TileEntityNote)var1.getBlockTileEntity(var2, var3, var4); -- if(var10 != null) { -+ TileEntityNote var10 = (TileEntityNote)par1World.getBlockTileEntity(par2, par3, par4); -+ -+ if (var10 != null) { - var10.changePitch(); -- var10.triggerNote(var1, var2, var3, var4); -+ var10.triggerNote(par1World, par2, par3, par4); - } - - return true; - } - } - -- public void onBlockClicked(World var1, int var2, int var3, int var4, EntityPlayer var5) { -- if(!var1.isRemote) { -- TileEntityNote var6 = (TileEntityNote)var1.getBlockTileEntity(var2, var3, var4); -- if(var6 != null) { -- var6.triggerNote(var1, var2, var3, var4); -+ /** -+ * Called when the block is clicked by a player. Args: x, y, z, entityPlayer -+ */ -+ public void onBlockClicked(World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer) { -+ if (!par1World.isRemote) { -+ TileEntityNote var6 = (TileEntityNote)par1World.getBlockTileEntity(par2, par3, par4); -+ -+ if (var6 != null) { -+ var6.triggerNote(par1World, par2, par3, par4); - } -- - } - } - -- public TileEntity createNewTileEntity(World var1) { -+ /** -+ * Returns a new instance of a block's tile entity class. Called on placing the block. -+ */ -+ public TileEntity createNewTileEntity(World par1World) { - return new TileEntityNote(); - } - -- public boolean onBlockEventReceived(World var1, int var2, int var3, int var4, int var5, int var6) { -- float var7 = (float)Math.pow(2.0D, (double)(var6 - 12) / 12.0D); -+ /** -+ * Called when the block receives a BlockEvent - see World.addBlockEvent. By default, passes it on to the tile entity -+ * at this location. Args: world, x, y, z, blockID, EventID, event parameter -+ */ -+ public boolean onBlockEventReceived(World par1World, int par2, int par3, int par4, int par5, int par6) { -+ float var7 = (float)Math.pow(2.0D, (double)(par6 - 12) / 12.0D); - String var8 = "harp"; -- if(var5 == 1) { -+ -+ if (par5 == 1) { - var8 = "bd"; - } - -- if(var5 == 2) { -+ if (par5 == 2) { - var8 = "snare"; - } - -- if(var5 == 3) { -+ if (par5 == 3) { - var8 = "hat"; - } - -- if(var5 == 4) { -+ if (par5 == 4) { - var8 = "bassattack"; - } - -- var1.playSoundEffect((double)var2 + 0.5D, (double)var3 + 0.5D, (double)var4 + 0.5D, "note." + var8, 3.0F, var7); -- var1.spawnParticle("note", (double)var2 + 0.5D, (double)var3 + 1.2D, (double)var4 + 0.5D, (double)var6 / 24.0D, 0.0D, 0.0D); -+ par1World.playSoundEffect((double)par2 + 0.5D, (double)par3 + 0.5D, (double)par4 + 0.5D, "note." + var8, 3.0F, var7); -+ par1World.spawnParticle("note", (double)par2 + 0.5D, (double)par3 + 1.2D, (double)par4 + 0.5D, (double)par6 / 24.0D, 0.0D, 0.0D); - return true; - } - } ---- net/minecraft/src/BlockRotatedPillar.java -+++ net/minecraft/src/BlockRotatedPillar.java -@@ -3,55 +3,80 @@ - public abstract class BlockRotatedPillar extends Block { - protected Icon field_111051_a; - -- protected BlockRotatedPillar(int var1, Material var2) { -- super(var1, var2); -+ protected BlockRotatedPillar(int par1, Material par2Material) { -+ super(par1, par2Material); - } - -+ /** -+ * The type of render function that is called for this block -+ */ - public int getRenderType() { - return 31; - } - -- public int onBlockPlaced(World var1, int var2, int var3, int var4, int var5, float var6, float var7, float var8, int var9) { -- int var10 = var9 & 3; -+ /** -+ * Called when a block is placed using its ItemBlock. Args: World, X, Y, Z, side, hitX, hitY, hitZ, block metadata -+ */ -+ public int onBlockPlaced(World par1World, int par2, int par3, int par4, int par5, float par6, float par7, float par8, int par9) { -+ int var10 = par9 & 3; - byte var11 = 0; -- switch(var5) { -- case 0: -- case 1: -- var11 = 0; -- break; -- case 2: -- case 3: -- var11 = 8; -- break; -- case 4: -- case 5: -- var11 = 4; -+ -+ switch (par5) { -+ case 0: -+ case 1: -+ var11 = 0; -+ break; -+ -+ case 2: -+ case 3: -+ var11 = 8; -+ break; -+ -+ case 4: -+ case 5: -+ var11 = 4; - } - - return var10 | var11; - } - -- public Icon getIcon(int var1, int var2) { -- int var3 = var2 & 12; -- int var4 = var2 & 3; -- return var3 != 0 || var1 != 1 && var1 != 0 ? (var3 != 4 || var1 != 5 && var1 != 4 ? (var3 != 8 || var1 != 2 && var1 != 3 ? this.getSideIcon(var4) : this.getEndIcon(var4)) : this.getEndIcon(var4)) : this.getEndIcon(var4); -+ /** -+ * From the specified side and block metadata retrieves the blocks texture. Args: side, metadata -+ */ -+ public Icon getIcon(int par1, int par2) { -+ int var3 = par2 & 12; -+ int var4 = par2 & 3; -+ return var3 == 0 && (par1 == 1 || par1 == 0) ? this.getEndIcon(var4) : (var3 == 4 && (par1 == 5 || par1 == 4) ? this.getEndIcon(var4) : (var3 == 8 && (par1 == 2 || par1 == 3) ? this.getEndIcon(var4) : this.getSideIcon(var4))); - } - -+ /** -+ * The icon for the side of the block. -+ */ - protected abstract Icon getSideIcon(int var1); - -- protected Icon getEndIcon(int var1) { -+ /** -+ * The icon for the tops and bottoms of the block. -+ */ -+ protected Icon getEndIcon(int par1) { - return this.field_111051_a; - } - -- public int damageDropped(int var1) { -- return var1 & 3; -- } -- -- public int func_111050_e(int var1) { -- return var1 & 3; -- } -- -- protected ItemStack createStackedBlock(int var1) { -- return new ItemStack(this.blockID, 1, this.func_111050_e(var1)); -+ /** -+ * Determines the damage on the item the block drops. Used in cloth and wood. -+ */ -+ public int damageDropped(int par1) { -+ return par1 & 3; -+ } -+ -+ public int func_111050_e(int par1) { -+ return par1 & 3; -+ } -+ -+ /** -+ * Returns an item stack containing a single instance of the current block type. 'i' is the block's subtype/damage and -+ * is ignored for blocks which do not support subtypes. Blocks which cannot be harvested should return null. -+ */ -+ protected ItemStack createStackedBlock(int par1) { -+ return new ItemStack(this.blockID, 1, this.func_111050_e(par1)); - } - } ---- net/minecraft/src/BlockBaseRailLogic.java -+++ net/minecraft/src/BlockBaseRailLogic.java -@@ -9,19 +9,23 @@ - private int railY; - private int railZ; - private final boolean isStraightRail; -- private List g; -+ -+ /** The chunk position the rail is at. */ -+ private List railChunkPosition; -+ - final BlockRailBase theRail; - -- public BlockBaseRailLogic(BlockRailBase var1, World var2, int var3, int var4, int var5) { -- this.theRail = var1; -- this.g = new ArrayList(); -- this.logicWorld = var2; -- this.railX = var3; -- this.railY = var4; -- this.railZ = var5; -- int var6 = var2.getBlockId(var3, var4, var5); -- int var7 = var2.getBlockMetadata(var3, var4, var5); -- if(((BlockRailBase)Block.blocksList[var6]).isPowered) { -+ public BlockBaseRailLogic(BlockRailBase par1BlockRailBase, World par2World, int par3, int par4, int par5) { -+ this.theRail = par1BlockRailBase; -+ this.railChunkPosition = new ArrayList(); -+ this.logicWorld = par2World; -+ this.railX = par3; -+ this.railY = par4; -+ this.railZ = par5; -+ int var6 = par2World.getBlockId(par3, par4, par5); -+ int var7 = par2World.getBlockMetadata(par3, par4, par5); -+ -+ if (((BlockRailBase)Block.blocksList[var6]).isPowered) { - this.isStraightRail = true; - var7 &= -9; - } else { -@@ -31,66 +35,70 @@ - this.setBasicRail(var7); - } - -- private void setBasicRail(int var1) { -- this.g.clear(); -- if(var1 == 0) { -- this.g.add(new ChunkPosition(this.railX, this.railY, this.railZ - 1)); -- this.g.add(new ChunkPosition(this.railX, this.railY, this.railZ + 1)); -- } else if(var1 == 1) { -- this.g.add(new ChunkPosition(this.railX - 1, this.railY, this.railZ)); -- this.g.add(new ChunkPosition(this.railX + 1, this.railY, this.railZ)); -- } else if(var1 == 2) { -- this.g.add(new ChunkPosition(this.railX - 1, this.railY, this.railZ)); -- this.g.add(new ChunkPosition(this.railX + 1, this.railY + 1, this.railZ)); -- } else if(var1 == 3) { -- this.g.add(new ChunkPosition(this.railX - 1, this.railY + 1, this.railZ)); -- this.g.add(new ChunkPosition(this.railX + 1, this.railY, this.railZ)); -- } else if(var1 == 4) { -- this.g.add(new ChunkPosition(this.railX, this.railY + 1, this.railZ - 1)); -- this.g.add(new ChunkPosition(this.railX, this.railY, this.railZ + 1)); -- } else if(var1 == 5) { -- this.g.add(new ChunkPosition(this.railX, this.railY, this.railZ - 1)); -- this.g.add(new ChunkPosition(this.railX, this.railY + 1, this.railZ + 1)); -- } else if(var1 == 6) { -- this.g.add(new ChunkPosition(this.railX + 1, this.railY, this.railZ)); -- this.g.add(new ChunkPosition(this.railX, this.railY, this.railZ + 1)); -- } else if(var1 == 7) { -- this.g.add(new ChunkPosition(this.railX - 1, this.railY, this.railZ)); -- this.g.add(new ChunkPosition(this.railX, this.railY, this.railZ + 1)); -- } else if(var1 == 8) { -- this.g.add(new ChunkPosition(this.railX - 1, this.railY, this.railZ)); -- this.g.add(new ChunkPosition(this.railX, this.railY, this.railZ - 1)); -- } else if(var1 == 9) { -- this.g.add(new ChunkPosition(this.railX + 1, this.railY, this.railZ)); -- this.g.add(new ChunkPosition(this.railX, this.railY, this.railZ - 1)); -- } -+ private void setBasicRail(int par1) { -+ this.railChunkPosition.clear(); - -+ if (par1 == 0) { -+ this.railChunkPosition.add(new ChunkPosition(this.railX, this.railY, this.railZ - 1)); -+ this.railChunkPosition.add(new ChunkPosition(this.railX, this.railY, this.railZ + 1)); -+ } else if (par1 == 1) { -+ this.railChunkPosition.add(new ChunkPosition(this.railX - 1, this.railY, this.railZ)); -+ this.railChunkPosition.add(new ChunkPosition(this.railX + 1, this.railY, this.railZ)); -+ } else if (par1 == 2) { -+ this.railChunkPosition.add(new ChunkPosition(this.railX - 1, this.railY, this.railZ)); -+ this.railChunkPosition.add(new ChunkPosition(this.railX + 1, this.railY + 1, this.railZ)); -+ } else if (par1 == 3) { -+ this.railChunkPosition.add(new ChunkPosition(this.railX - 1, this.railY + 1, this.railZ)); -+ this.railChunkPosition.add(new ChunkPosition(this.railX + 1, this.railY, this.railZ)); -+ } else if (par1 == 4) { -+ this.railChunkPosition.add(new ChunkPosition(this.railX, this.railY + 1, this.railZ - 1)); -+ this.railChunkPosition.add(new ChunkPosition(this.railX, this.railY, this.railZ + 1)); -+ } else if (par1 == 5) { -+ this.railChunkPosition.add(new ChunkPosition(this.railX, this.railY, this.railZ - 1)); -+ this.railChunkPosition.add(new ChunkPosition(this.railX, this.railY + 1, this.railZ + 1)); -+ } else if (par1 == 6) { -+ this.railChunkPosition.add(new ChunkPosition(this.railX + 1, this.railY, this.railZ)); -+ this.railChunkPosition.add(new ChunkPosition(this.railX, this.railY, this.railZ + 1)); -+ } else if (par1 == 7) { -+ this.railChunkPosition.add(new ChunkPosition(this.railX - 1, this.railY, this.railZ)); -+ this.railChunkPosition.add(new ChunkPosition(this.railX, this.railY, this.railZ + 1)); -+ } else if (par1 == 8) { -+ this.railChunkPosition.add(new ChunkPosition(this.railX - 1, this.railY, this.railZ)); -+ this.railChunkPosition.add(new ChunkPosition(this.railX, this.railY, this.railZ - 1)); -+ } else if (par1 == 9) { -+ this.railChunkPosition.add(new ChunkPosition(this.railX + 1, this.railY, this.railZ)); -+ this.railChunkPosition.add(new ChunkPosition(this.railX, this.railY, this.railZ - 1)); -+ } - } - - private void refreshConnectedTracks() { -- for(int var1 = 0; var1 < this.g.size(); ++var1) { -- BlockBaseRailLogic var2 = this.getRailLogic((ChunkPosition)this.g.get(var1)); -- if(var2 != null && var2.isRailChunkPositionCorrect(this)) { -- this.g.set(var1, new ChunkPosition(var2.railX, var2.railY, var2.railZ)); -+ for (int var1 = 0; var1 < this.railChunkPosition.size(); ++var1) { -+ BlockBaseRailLogic var2 = this.getRailLogic((ChunkPosition)this.railChunkPosition.get(var1)); -+ -+ if (var2 != null && var2.isRailChunkPositionCorrect(this)) { -+ this.railChunkPosition.set(var1, new ChunkPosition(var2.railX, var2.railY, var2.railZ)); - } else { -- this.g.remove(var1--); -+ this.railChunkPosition.remove(var1--); - } - } -- -- } -- -- private boolean isMinecartTrack(int var1, int var2, int var3) { -- return BlockRailBase.isRailBlockAt(this.logicWorld, var1, var2, var3) ? true : (BlockRailBase.isRailBlockAt(this.logicWorld, var1, var2 + 1, var3) ? true : BlockRailBase.isRailBlockAt(this.logicWorld, var1, var2 - 1, var3)); -- } -- -- private BlockBaseRailLogic getRailLogic(ChunkPosition var1) { -- return BlockRailBase.isRailBlockAt(this.logicWorld, var1.x, var1.y, var1.z) ? new BlockBaseRailLogic(this.theRail, this.logicWorld, var1.x, var1.y, var1.z) : (BlockRailBase.isRailBlockAt(this.logicWorld, var1.x, var1.y + 1, var1.z) ? new BlockBaseRailLogic(this.theRail, this.logicWorld, var1.x, var1.y + 1, var1.z) : (BlockRailBase.isRailBlockAt(this.logicWorld, var1.x, var1.y - 1, var1.z) ? new BlockBaseRailLogic(this.theRail, this.logicWorld, var1.x, var1.y - 1, var1.z) : null)); -- } -- -- private boolean isRailChunkPositionCorrect(BlockBaseRailLogic var1) { -- for(int var2 = 0; var2 < this.g.size(); ++var2) { -- ChunkPosition var3 = (ChunkPosition)this.g.get(var2); -- if(var3.x == var1.railX && var3.z == var1.railZ) { -+ } -+ -+ private boolean isMinecartTrack(int par1, int par2, int par3) { -+ return BlockRailBase.isRailBlockAt(this.logicWorld, par1, par2, par3) ? true : (BlockRailBase.isRailBlockAt(this.logicWorld, par1, par2 + 1, par3) ? true : BlockRailBase.isRailBlockAt(this.logicWorld, par1, par2 - 1, par3)); -+ } -+ -+ private BlockBaseRailLogic getRailLogic(ChunkPosition par1ChunkPosition) { -+ return BlockRailBase.isRailBlockAt(this.logicWorld, par1ChunkPosition.x, par1ChunkPosition.y, par1ChunkPosition.z) ? new BlockBaseRailLogic(this.theRail, this.logicWorld, par1ChunkPosition.x, par1ChunkPosition.y, par1ChunkPosition.z) : (BlockRailBase.isRailBlockAt(this.logicWorld, par1ChunkPosition.x, par1ChunkPosition.y + 1, par1ChunkPosition.z) ? new BlockBaseRailLogic(this.theRail, this.logicWorld, par1ChunkPosition.x, par1ChunkPosition.y + 1, par1ChunkPosition.z) : (BlockRailBase.isRailBlockAt(this.logicWorld, par1ChunkPosition.x, par1ChunkPosition.y - 1, par1ChunkPosition.z) ? new BlockBaseRailLogic(this.theRail, this.logicWorld, par1ChunkPosition.x, par1ChunkPosition.y - 1, par1ChunkPosition.z) : null)); -+ } -+ -+ /** -+ * Checks if the rail is at the chunk position it is expected to be. -+ */ -+ private boolean isRailChunkPositionCorrect(BlockBaseRailLogic par1BlockBaseRailLogic) { -+ for (int var2 = 0; var2 < this.railChunkPosition.size(); ++var2) { -+ ChunkPosition var3 = (ChunkPosition)this.railChunkPosition.get(var2); -+ -+ if (var3.x == par1BlockBaseRailLogic.railX && var3.z == par1BlockBaseRailLogic.railZ) { - return true; - } - } -@@ -98,10 +106,11 @@ - return false; - } - -- private boolean isPartOfTrack(int var1, int var2, int var3) { -- for(int var4 = 0; var4 < this.g.size(); ++var4) { -- ChunkPosition var5 = (ChunkPosition)this.g.get(var4); -- if(var5.x == var1 && var5.z == var3) { -+ private boolean isPartOfTrack(int par1, int par2, int par3) { -+ for (int var4 = 0; var4 < this.railChunkPosition.size(); ++var4) { -+ ChunkPosition var5 = (ChunkPosition)this.railChunkPosition.get(var4); -+ -+ if (var5.x == par1 && var5.z == par3) { - return true; - } - } -@@ -111,97 +120,101 @@ - - protected int getNumberOfAdjacentTracks() { - int var1 = 0; -- if(this.isMinecartTrack(this.railX, this.railY, this.railZ - 1)) { -- ++var1; -- } -- -- if(this.isMinecartTrack(this.railX, this.railY, this.railZ + 1)) { -- ++var1; -- } -- -- if(this.isMinecartTrack(this.railX - 1, this.railY, this.railZ)) { -- ++var1; -- } -- -- if(this.isMinecartTrack(this.railX + 1, this.railY, this.railZ)) { -+ -+ if (this.isMinecartTrack(this.railX, this.railY, this.railZ - 1)) { -+ ++var1; -+ } -+ -+ if (this.isMinecartTrack(this.railX, this.railY, this.railZ + 1)) { -+ ++var1; -+ } -+ -+ if (this.isMinecartTrack(this.railX - 1, this.railY, this.railZ)) { -+ ++var1; -+ } -+ -+ if (this.isMinecartTrack(this.railX + 1, this.railY, this.railZ)) { - ++var1; - } - - return var1; - } - -- private boolean canConnectTo(BlockBaseRailLogic var1) { -- return this.isRailChunkPositionCorrect(var1) ? true : (this.g.size() == 2 ? false : (this.g.isEmpty() ? true : true)); -+ private boolean canConnectTo(BlockBaseRailLogic par1BlockBaseRailLogic) { -+ return this.isRailChunkPositionCorrect(par1BlockBaseRailLogic) ? true : (this.railChunkPosition.size() == 2 ? false : (this.railChunkPosition.isEmpty() ? true : true)); - } - -- private void connectToNeighbor(BlockBaseRailLogic var1) { -- this.g.add(new ChunkPosition(var1.railX, var1.railY, var1.railZ)); -+ private void connectToNeighbor(BlockBaseRailLogic par1BlockBaseRailLogic) { -+ this.railChunkPosition.add(new ChunkPosition(par1BlockBaseRailLogic.railX, par1BlockBaseRailLogic.railY, par1BlockBaseRailLogic.railZ)); - boolean var2 = this.isPartOfTrack(this.railX, this.railY, this.railZ - 1); - boolean var3 = this.isPartOfTrack(this.railX, this.railY, this.railZ + 1); - boolean var4 = this.isPartOfTrack(this.railX - 1, this.railY, this.railZ); - boolean var5 = this.isPartOfTrack(this.railX + 1, this.railY, this.railZ); - byte var6 = -1; -- if(var2 || var3) { -+ -+ if (var2 || var3) { - var6 = 0; - } - -- if(var4 || var5) { -+ if (var4 || var5) { - var6 = 1; - } - -- if(!this.isStraightRail) { -- if(var3 && var5 && !var2 && !var4) { -+ if (!this.isStraightRail) { -+ if (var3 && var5 && !var2 && !var4) { - var6 = 6; - } - -- if(var3 && var4 && !var2 && !var5) { -+ if (var3 && var4 && !var2 && !var5) { - var6 = 7; - } - -- if(var2 && var4 && !var3 && !var5) { -+ if (var2 && var4 && !var3 && !var5) { - var6 = 8; - } - -- if(var2 && var5 && !var3 && !var4) { -+ if (var2 && var5 && !var3 && !var4) { - var6 = 9; - } - } - -- if(var6 == 0) { -- if(BlockRailBase.isRailBlockAt(this.logicWorld, this.railX, this.railY + 1, this.railZ - 1)) { -+ if (var6 == 0) { -+ if (BlockRailBase.isRailBlockAt(this.logicWorld, this.railX, this.railY + 1, this.railZ - 1)) { - var6 = 4; - } - -- if(BlockRailBase.isRailBlockAt(this.logicWorld, this.railX, this.railY + 1, this.railZ + 1)) { -+ if (BlockRailBase.isRailBlockAt(this.logicWorld, this.railX, this.railY + 1, this.railZ + 1)) { - var6 = 5; - } - } - -- if(var6 == 1) { -- if(BlockRailBase.isRailBlockAt(this.logicWorld, this.railX + 1, this.railY + 1, this.railZ)) { -+ if (var6 == 1) { -+ if (BlockRailBase.isRailBlockAt(this.logicWorld, this.railX + 1, this.railY + 1, this.railZ)) { - var6 = 2; - } - -- if(BlockRailBase.isRailBlockAt(this.logicWorld, this.railX - 1, this.railY + 1, this.railZ)) { -+ if (BlockRailBase.isRailBlockAt(this.logicWorld, this.railX - 1, this.railY + 1, this.railZ)) { - var6 = 3; - } - } - -- if(var6 < 0) { -+ if (var6 < 0) { - var6 = 0; - } - - int var7 = var6; -- if(this.isStraightRail) { -+ -+ if (this.isStraightRail) { - var7 = this.logicWorld.getBlockMetadata(this.railX, this.railY, this.railZ) & 8 | var6; - } - -- this.logicWorld.setBlockMetadata(this.railX, this.railY, this.railZ, var7, 3); -+ this.logicWorld.setBlockMetadataWithNotify(this.railX, this.railY, this.railZ, var7, 3); - } - -- private boolean canConnectFrom(int var1, int var2, int var3) { -- BlockBaseRailLogic var4 = this.getRailLogic(new ChunkPosition(var1, var2, var3)); -- if(var4 == null) { -+ private boolean canConnectFrom(int par1, int par2, int par3) { -+ BlockBaseRailLogic var4 = this.getRailLogic(new ChunkPosition(par1, par2, par3)); -+ -+ if (var4 == null) { - return false; - } else { - var4.refreshConnectedTracks(); -@@ -209,127 +222,130 @@ - } - } - -- public void func_94511_a(boolean var1, boolean var2) { -+ public void func_94511_a(boolean par1, boolean par2) { - boolean var3 = this.canConnectFrom(this.railX, this.railY, this.railZ - 1); - boolean var4 = this.canConnectFrom(this.railX, this.railY, this.railZ + 1); - boolean var5 = this.canConnectFrom(this.railX - 1, this.railY, this.railZ); - boolean var6 = this.canConnectFrom(this.railX + 1, this.railY, this.railZ); - byte var7 = -1; -- if((var3 || var4) && !var5 && !var6) { -+ -+ if ((var3 || var4) && !var5 && !var6) { - var7 = 0; - } - -- if((var5 || var6) && !var3 && !var4) { -+ if ((var5 || var6) && !var3 && !var4) { - var7 = 1; - } - -- if(!this.isStraightRail) { -- if(var4 && var6 && !var3 && !var5) { -+ if (!this.isStraightRail) { -+ if (var4 && var6 && !var3 && !var5) { - var7 = 6; - } - -- if(var4 && var5 && !var3 && !var6) { -+ if (var4 && var5 && !var3 && !var6) { - var7 = 7; - } - -- if(var3 && var5 && !var4 && !var6) { -+ if (var3 && var5 && !var4 && !var6) { - var7 = 8; - } - -- if(var3 && var6 && !var4 && !var5) { -+ if (var3 && var6 && !var4 && !var5) { - var7 = 9; - } - } - -- if(var7 == -1) { -- if(var3 || var4) { -+ if (var7 == -1) { -+ if (var3 || var4) { - var7 = 0; - } - -- if(var5 || var6) { -+ if (var5 || var6) { - var7 = 1; - } - -- if(!this.isStraightRail) { -- if(var1) { -- if(var4 && var6) { -+ if (!this.isStraightRail) { -+ if (par1) { -+ if (var4 && var6) { - var7 = 6; - } - -- if(var5 && var4) { -+ if (var5 && var4) { - var7 = 7; - } - -- if(var6 && var3) { -+ if (var6 && var3) { - var7 = 9; - } - -- if(var3 && var5) { -+ if (var3 && var5) { - var7 = 8; - } - } else { -- if(var3 && var5) { -+ if (var3 && var5) { - var7 = 8; - } - -- if(var6 && var3) { -+ if (var6 && var3) { - var7 = 9; - } - -- if(var5 && var4) { -+ if (var5 && var4) { - var7 = 7; - } - -- if(var4 && var6) { -+ if (var4 && var6) { - var7 = 6; - } - } - } - } - -- if(var7 == 0) { -- if(BlockRailBase.isRailBlockAt(this.logicWorld, this.railX, this.railY + 1, this.railZ - 1)) { -+ if (var7 == 0) { -+ if (BlockRailBase.isRailBlockAt(this.logicWorld, this.railX, this.railY + 1, this.railZ - 1)) { - var7 = 4; - } - -- if(BlockRailBase.isRailBlockAt(this.logicWorld, this.railX, this.railY + 1, this.railZ + 1)) { -+ if (BlockRailBase.isRailBlockAt(this.logicWorld, this.railX, this.railY + 1, this.railZ + 1)) { - var7 = 5; - } - } - -- if(var7 == 1) { -- if(BlockRailBase.isRailBlockAt(this.logicWorld, this.railX + 1, this.railY + 1, this.railZ)) { -+ if (var7 == 1) { -+ if (BlockRailBase.isRailBlockAt(this.logicWorld, this.railX + 1, this.railY + 1, this.railZ)) { - var7 = 2; - } - -- if(BlockRailBase.isRailBlockAt(this.logicWorld, this.railX - 1, this.railY + 1, this.railZ)) { -+ if (BlockRailBase.isRailBlockAt(this.logicWorld, this.railX - 1, this.railY + 1, this.railZ)) { - var7 = 3; - } - } - -- if(var7 < 0) { -+ if (var7 < 0) { - var7 = 0; - } - - this.setBasicRail(var7); - int var8 = var7; -- if(this.isStraightRail) { -+ -+ if (this.isStraightRail) { - var8 = this.logicWorld.getBlockMetadata(this.railX, this.railY, this.railZ) & 8 | var7; - } - -- if(var2 || this.logicWorld.getBlockMetadata(this.railX, this.railY, this.railZ) != var8) { -- this.logicWorld.setBlockMetadata(this.railX, this.railY, this.railZ, var8, 3); -- -- for(int var9 = 0; var9 < this.g.size(); ++var9) { -- BlockBaseRailLogic var10 = this.getRailLogic((ChunkPosition)this.g.get(var9)); -- if(var10 != null) { -+ if (par2 || this.logicWorld.getBlockMetadata(this.railX, this.railY, this.railZ) != var8) { -+ this.logicWorld.setBlockMetadataWithNotify(this.railX, this.railY, this.railZ, var8, 3); -+ -+ for (int var9 = 0; var9 < this.railChunkPosition.size(); ++var9) { -+ BlockBaseRailLogic var10 = this.getRailLogic((ChunkPosition)this.railChunkPosition.get(var9)); -+ -+ if (var10 != null) { - var10.refreshConnectedTracks(); -- if(var10.canConnectTo(this)) { -+ -+ if (var10.canConnectTo(this)) { - var10.connectToNeighbor(this); - } - } - } - } -- - } - } ---- net/minecraft/src/Container.java -+++ net/minecraft/src/Container.java -@@ -7,71 +7,106 @@ - import java.util.Set; - - public abstract class Container { -- public List b = new ArrayList(); -- public List c = new ArrayList(); -+ -+ /** the list of all items(stacks) for the corresponding slot */ -+ public List inventoryItemStacks = new ArrayList(); -+ -+ /** the list of all slots in the inventory */ -+ public List inventorySlots = new ArrayList(); - public int windowId; - private short transactionID; - private int field_94535_f = -1; - private int field_94536_g; -- private final Set h = new HashSet(); -- protected List e = new ArrayList(); -- private Set i = new HashSet(); -- -- protected Slot addSlotToContainer(Slot var1) { -- var1.slotNumber = this.c.size(); -- this.c.add(var1); -- this.b.add((Object)null); -- return var1; -- } -- -- public void onCraftGuiOpened(ICrafting var1) { -- if(this.e.contains(var1)) { -+ private final Set field_94537_h = new HashSet(); -+ -+ /** -+ * list of all people that need to be notified when this craftinventory changes -+ */ -+ protected List crafters = new ArrayList(); -+ private Set playerList = new HashSet(); -+ -+ /** -+ * the slot is assumed empty -+ */ -+ -+ // Spout Start - Inventory sorting -+ public IInventory getIInventory() { -+ return null; -+ } -+ -+ public boolean isSortableInventory() { -+ return false; -+ } -+ // Spout End -+ -+ protected Slot addSlotToContainer(Slot par1Slot) { -+ par1Slot.slotNumber = this.inventorySlots.size(); -+ this.inventorySlots.add(par1Slot); -+ this.inventoryItemStacks.add((Object)null); -+ return par1Slot; -+ } -+ -+ public void addCraftingToCrafters(ICrafting par1ICrafting) { -+ if (this.crafters.contains(par1ICrafting)) { - throw new IllegalArgumentException("Listener already listening"); - } else { -- this.e.add(var1); -- var1.updateCraftingInventory(this, this.getInventory()); -+ this.crafters.add(par1ICrafting); -+ par1ICrafting.sendContainerAndContentsToPlayer(this, this.getInventory()); - this.detectAndSendChanges(); - } - } - -- public void removeCraftingFromCrafters(ICrafting var1) { -- this.e.remove(var1); -+ /** -+ * Remove this crafting listener from the listener list. -+ */ -+ public void removeCraftingFromCrafters(ICrafting par1ICrafting) { -+ this.crafters.remove(par1ICrafting); - } - -+ /** -+ * returns a list if itemStacks, for each slot. -+ */ - public List getInventory() { - ArrayList var1 = new ArrayList(); - -- for(int var2 = 0; var2 < this.c.size(); ++var2) { -- var1.add(((Slot)this.c.get(var2)).getStack()); -+ for (int var2 = 0; var2 < this.inventorySlots.size(); ++var2) { -+ var1.add(((Slot)this.inventorySlots.get(var2)).getStack()); - } - - return var1; - } - -+ /** -+ * Looks for changes made in the container, sends them to every listener. -+ */ - public void detectAndSendChanges() { -- for(int var1 = 0; var1 < this.c.size(); ++var1) { -- ItemStack var2 = ((Slot)this.c.get(var1)).getStack(); -- ItemStack var3 = (ItemStack)this.b.get(var1); -- if(!ItemStack.areItemStacksEqual(var3, var2)) { -+ for (int var1 = 0; var1 < this.inventorySlots.size(); ++var1) { -+ ItemStack var2 = ((Slot)this.inventorySlots.get(var1)).getStack(); -+ ItemStack var3 = (ItemStack)this.inventoryItemStacks.get(var1); -+ -+ if (!ItemStack.areItemStacksEqual(var3, var2)) { - var3 = var2 == null ? null : var2.copy(); -- this.b.set(var1, var3); -+ this.inventoryItemStacks.set(var1, var3); - -- for(int var4 = 0; var4 < this.e.size(); ++var4) { -- ((ICrafting)this.e.get(var4)).sendSlotContents(this, var1, var3); -+ for (int var4 = 0; var4 < this.crafters.size(); ++var4) { -+ ((ICrafting)this.crafters.get(var4)).sendSlotContents(this, var1, var3); - } - } - } -- - } - -- public boolean enchantItem(EntityPlayer var1, int var2) { -+ /** -+ * enchants the item on the table using the specified slot; also deducts XP from player -+ */ -+ public boolean enchantItem(EntityPlayer par1EntityPlayer, int par2) { - return false; - } - -- public Slot getSlotFromInventory(IInventory var1, int var2) { -- for(int var3 = 0; var3 < this.c.size(); ++var3) { -- Slot var4 = (Slot)this.c.get(var3); -- if(var4.isHere(var1, var2)) { -+ public Slot getSlotFromInventory(IInventory par1IInventory, int par2) { -+ for (int var3 = 0; var3 < this.inventorySlots.size(); ++var3) { -+ Slot var4 = (Slot)this.inventorySlots.get(var3); -+ -+ if (var4.isSlotInInventory(par1IInventory, par2)) { - return var4; - } - } -@@ -79,57 +114,66 @@ - return null; - } - -- public Slot getSlot(int var1) { -- return (Slot)this.c.get(var1); -+ public Slot getSlot(int par1) { -+ return (Slot)this.inventorySlots.get(par1); - } - -- public ItemStack transferStackInSlot(EntityPlayer var1, int var2) { -- Slot var3 = (Slot)this.c.get(var2); -+ /** -+ * Called when a player shift-clicks on a slot. You must override this or you will crash when someone does that. -+ */ -+ public ItemStack transferStackInSlot(EntityPlayer par1EntityPlayer, int par2) { -+ Slot var3 = (Slot)this.inventorySlots.get(par2); - return var3 != null ? var3.getStack() : null; - } - -- public ItemStack slotClick(int var1, int var2, int var3, EntityPlayer var4) { -+ public ItemStack slotClick(int par1, int par2, int par3, EntityPlayer par4EntityPlayer) { - ItemStack var5 = null; -- InventoryPlayer var6 = var4.inventory; -+ InventoryPlayer var6 = par4EntityPlayer.inventory; - int var9; - ItemStack var17; -- if(var3 == 5) { -+ -+ if (par3 == 5) { - int var7 = this.field_94536_g; -- this.field_94536_g = func_94532_c(var2); -- if((var7 != 1 || this.field_94536_g != 2) && var7 != this.field_94536_g) { -- this.func_94533_d(); -- } else if(var6.getItemStack() == null) { -- this.func_94533_d(); -- } else if(this.field_94536_g == 0) { -- this.field_94535_f = func_94529_b(var2); -- if(func_94528_d(this.field_94535_f)) { -+ this.field_94536_g = func_94532_c(par2); -+ -+ if ((var7 != 1 || this.field_94536_g != 2) && var7 != this.field_94536_g) { -+ this.func_94533_d(); -+ } else if (var6.getItemStack() == null) { -+ this.func_94533_d(); -+ } else if (this.field_94536_g == 0) { -+ this.field_94535_f = func_94529_b(par2); -+ -+ if (func_94528_d(this.field_94535_f)) { - this.field_94536_g = 1; -- this.h.clear(); -+ this.field_94537_h.clear(); - } else { - this.func_94533_d(); - } -- } else if(this.field_94536_g == 1) { -- Slot var8 = (Slot)this.c.get(var1); -- if(var8 != null && func_94527_a(var8, var6.getItemStack(), true) && var8.isItemValid(var6.getItemStack()) && var6.getItemStack().stackSize > this.h.size() && this.canDragIntoSlot(var8)) { -- this.h.add(var8); -+ } else if (this.field_94536_g == 1) { -+ Slot var8 = (Slot)this.inventorySlots.get(par1); -+ -+ if (var8 != null && func_94527_a(var8, var6.getItemStack(), true) && var8.isItemValid(var6.getItemStack()) && var6.getItemStack().stackSize > this.field_94537_h.size() && this.canDragIntoSlot(var8)) { -+ this.field_94537_h.add(var8); - } -- } else if(this.field_94536_g == 2) { -- if(!this.h.isEmpty()) { -+ } else if (this.field_94536_g == 2) { -+ if (!this.field_94537_h.isEmpty()) { - var17 = var6.getItemStack().copy(); - var9 = var6.getItemStack().stackSize; -- Iterator var10 = this.h.iterator(); -+ Iterator var10 = this.field_94537_h.iterator(); - -- while(var10.hasNext()) { -+ while (var10.hasNext()) { - Slot var11 = (Slot)var10.next(); -- if(var11 != null && func_94527_a(var11, var6.getItemStack(), true) && var11.isItemValid(var6.getItemStack()) && var6.getItemStack().stackSize >= this.h.size() && this.canDragIntoSlot(var11)) { -+ -+ if (var11 != null && func_94527_a(var11, var6.getItemStack(), true) && var11.isItemValid(var6.getItemStack()) && var6.getItemStack().stackSize >= this.field_94537_h.size() && this.canDragIntoSlot(var11)) { - ItemStack var12 = var17.copy(); - int var13 = var11.getHasStack() ? var11.getStack().stackSize : 0; -- func_94525_a(this.h, this.field_94535_f, var12, var13); -- if(var12.stackSize > var12.getMaxStackSize()) { -+ func_94525_a(this.field_94537_h, this.field_94535_f, var12, var13); -+ -+ if (var12.stackSize > var12.getMaxStackSize()) { - var12.stackSize = var12.getMaxStackSize(); - } - -- if(var12.stackSize > var11.getSlotStackLimit()) { -+ if (var12.stackSize > var11.getSlotStackLimit()) { - var12.stackSize = var11.getSlotStackLimit(); - } - -@@ -139,7 +183,8 @@ - } - - var17.stackSize = var9; -- if(var17.stackSize <= 0) { -+ -+ if (var17.stackSize <= 0) { - var17 = null; - } - -@@ -150,112 +195,125 @@ - } else { - this.func_94533_d(); - } -- } else if(this.field_94536_g != 0) { -+ } else if (this.field_94536_g != 0) { - this.func_94533_d(); - } else { - Slot var16; -- int var19; -- ItemStack var22; -- if((var3 == 0 || var3 == 1) && (var2 == 0 || var2 == 1)) { -- if(var1 == -999) { -- if(var6.getItemStack() != null && var1 == -999) { -- if(var2 == 0) { -- var4.dropPlayerItem(var6.getItemStack()); -+ int var21; -+ ItemStack var23; -+ -+ if ((par3 == 0 || par3 == 1) && (par2 == 0 || par2 == 1)) { -+ if (par1 == -999) { -+ if (var6.getItemStack() != null && par1 == -999) { -+ if (par2 == 0) { -+ par4EntityPlayer.dropPlayerItem(var6.getItemStack()); - var6.setItemStack((ItemStack)null); - } - -- if(var2 == 1) { -- var4.dropPlayerItem(var6.getItemStack().splitStack(1)); -- if(var6.getItemStack().stackSize == 0) { -+ if (par2 == 1) { -+ par4EntityPlayer.dropPlayerItem(var6.getItemStack().splitStack(1)); -+ -+ if (var6.getItemStack().stackSize == 0) { - var6.setItemStack((ItemStack)null); - } - } - } -- } else if(var3 == 1) { -- if(var1 < 0) { -+ } else if (par3 == 1) { -+ if (par1 < 0) { - return null; - } - -- var16 = (Slot)this.c.get(var1); -- if(var16 != null && var16.canTakeStack(var4)) { -- var17 = this.transferStackInSlot(var4, var1); -- if(var17 != null) { -+ var16 = (Slot)this.inventorySlots.get(par1); -+ -+ if (var16 != null && var16.canTakeStack(par4EntityPlayer)) { -+ var17 = this.transferStackInSlot(par4EntityPlayer, par1); -+ -+ if (var17 != null) { - var9 = var17.itemID; - var5 = var17.copy(); -- if(var16 != null && var16.getStack() != null && var16.getStack().itemID == var9) { -- this.retrySlotClick(var1, var2, true, var4); -+ -+ if (var16 != null && var16.getStack() != null && var16.getStack().itemID == var9) { -+ this.retrySlotClick(par1, par2, true, par4EntityPlayer); - } - } - } - } else { -- if(var1 < 0) { -+ if (par1 < 0) { - return null; - } - -- var16 = (Slot)this.c.get(var1); -- if(var16 != null) { -+ var16 = (Slot)this.inventorySlots.get(par1); -+ -+ if (var16 != null) { - var17 = var16.getStack(); -- ItemStack var20 = var6.getItemStack(); -- if(var17 != null) { -+ ItemStack var19 = var6.getItemStack(); -+ -+ if (var17 != null) { - var5 = var17.copy(); - } - -- if(var17 == null) { -- if(var20 != null && var16.isItemValid(var20)) { -- var19 = var2 == 0 ? var20.stackSize : 1; -- if(var19 > var16.getSlotStackLimit()) { -- var19 = var16.getSlotStackLimit(); -- } -- -- if(var20.stackSize >= var19) { -- var16.putStack(var20.splitStack(var19)); -- } -- -- if(var20.stackSize == 0) { -+ if (var17 == null) { -+ if (var19 != null && var16.isItemValid(var19)) { -+ var21 = par2 == 0 ? var19.stackSize : 1; -+ -+ if (var21 > var16.getSlotStackLimit()) { -+ var21 = var16.getSlotStackLimit(); -+ } -+ -+ if (var19.stackSize >= var21) { -+ var16.putStack(var19.splitStack(var21)); -+ } -+ -+ if (var19.stackSize == 0) { - var6.setItemStack((ItemStack)null); - } - } -- } else if(var16.canTakeStack(var4)) { -- if(var20 == null) { -- var19 = var2 == 0 ? var17.stackSize : (var17.stackSize + 1) / 2; -- var22 = var16.decrStackSize(var19); -- var6.setItemStack(var22); -- if(var17.stackSize == 0) { -+ } else if (var16.canTakeStack(par4EntityPlayer)) { -+ if (var19 == null) { -+ var21 = par2 == 0 ? var17.stackSize : (var17.stackSize + 1) / 2; -+ var23 = var16.decrStackSize(var21); -+ var6.setItemStack(var23); -+ -+ if (var17.stackSize == 0) { - var16.putStack((ItemStack)null); - } - -- var16.onPickupFromSlot(var4, var6.getItemStack()); -- } else if(var16.isItemValid(var20)) { -- if(var17.itemID == var20.itemID && var17.getItemDamage() == var20.getItemDamage() && ItemStack.areItemStackTagsEqual(var17, var20)) { -- var19 = var2 == 0 ? var20.stackSize : 1; -- if(var19 > var16.getSlotStackLimit() - var17.stackSize) { -- var19 = var16.getSlotStackLimit() - var17.stackSize; -- } -- -- if(var19 > var20.getMaxStackSize() - var17.stackSize) { -- var19 = var20.getMaxStackSize() - var17.stackSize; -- } -- -- var20.splitStack(var19); -- if(var20.stackSize == 0) { -+ var16.onPickupFromSlot(par4EntityPlayer, var6.getItemStack()); -+ } else if (var16.isItemValid(var19)) { -+ if (var17.itemID == var19.itemID && var17.getItemDamage() == var19.getItemDamage() && ItemStack.areItemStackTagsEqual(var17, var19)) { -+ var21 = par2 == 0 ? var19.stackSize : 1; -+ -+ if (var21 > var16.getSlotStackLimit() - var17.stackSize) { -+ var21 = var16.getSlotStackLimit() - var17.stackSize; -+ } -+ -+ if (var21 > var19.getMaxStackSize() - var17.stackSize) { -+ var21 = var19.getMaxStackSize() - var17.stackSize; -+ } -+ -+ var19.splitStack(var21); -+ -+ if (var19.stackSize == 0) { - var6.setItemStack((ItemStack)null); - } - -- var17.stackSize += var19; -- } else if(var20.stackSize <= var16.getSlotStackLimit()) { -- var16.putStack(var20); -+ var17.stackSize += var21; -+ } else if (var19.stackSize <= var16.getSlotStackLimit()) { -+ var16.putStack(var19); - var6.setItemStack(var17); - } -- } else if(var17.itemID == var20.itemID && var20.getMaxStackSize() > 1 && (!var17.getHasSubtypes() || var17.getItemDamage() == var20.getItemDamage()) && ItemStack.areItemStackTagsEqual(var17, var20)) { -- var19 = var17.stackSize; -- if(var19 > 0 && var19 + var20.stackSize <= var20.getMaxStackSize()) { -- var20.stackSize += var19; -- var17 = var16.decrStackSize(var19); -- if(var17.stackSize == 0) { -+ } else if (var17.itemID == var19.itemID && var19.getMaxStackSize() > 1 && (!var17.getHasSubtypes() || var17.getItemDamage() == var19.getItemDamage()) && ItemStack.areItemStackTagsEqual(var17, var19)) { -+ var21 = var17.stackSize; -+ -+ if (var21 > 0 && var21 + var19.stackSize <= var19.getMaxStackSize()) { -+ var19.stackSize += var21; -+ var17 = var16.decrStackSize(var21); -+ -+ if (var17.stackSize == 0) { - var16.putStack((ItemStack)null); - } - -- var16.onPickupFromSlot(var4, var6.getItemStack()); -+ var16.onPickupFromSlot(par4EntityPlayer, var6.getItemStack()); - } - } - } -@@ -263,70 +321,78 @@ - var16.onSlotChanged(); - } - } -- } else if(var3 == 2 && var2 >= 0 && var2 < 9) { -- var16 = (Slot)this.c.get(var1); -- if(var16.canTakeStack(var4)) { -- var17 = var6.getStackInSlot(var2); -+ } else if (par3 == 2 && par2 >= 0 && par2 < 9) { -+ var16 = (Slot)this.inventorySlots.get(par1); -+ -+ if (var16.canTakeStack(par4EntityPlayer)) { -+ var17 = var6.getStackInSlot(par2); - boolean var18 = var17 == null || var16.inventory == var6 && var16.isItemValid(var17); -- var19 = -1; -- if(!var18) { -- var19 = var6.getFirstEmptyStack(); -- var18 |= var19 > -1; -+ var21 = -1; -+ -+ if (!var18) { -+ var21 = var6.getFirstEmptyStack(); -+ var18 |= var21 > -1; - } - -- if(var16.getHasStack() && var18) { -- var22 = var16.getStack(); -- var6.setInventorySlotContents(var2, var22.copy()); -- if((var16.inventory != var6 || !var16.isItemValid(var17)) && var17 != null) { -- if(var19 > -1) { -+ if (var16.getHasStack() && var18) { -+ var23 = var16.getStack(); -+ var6.setInventorySlotContents(par2, var23.copy()); -+ -+ if ((var16.inventory != var6 || !var16.isItemValid(var17)) && var17 != null) { -+ if (var21 > -1) { - var6.addItemStackToInventory(var17); -- var16.decrStackSize(var22.stackSize); -+ var16.decrStackSize(var23.stackSize); - var16.putStack((ItemStack)null); -- var16.onPickupFromSlot(var4, var22); -+ var16.onPickupFromSlot(par4EntityPlayer, var23); - } - } else { -- var16.decrStackSize(var22.stackSize); -+ var16.decrStackSize(var23.stackSize); - var16.putStack(var17); -- var16.onPickupFromSlot(var4, var22); -+ var16.onPickupFromSlot(par4EntityPlayer, var23); - } -- } else if(!var16.getHasStack() && var17 != null && var16.isItemValid(var17)) { -- var6.setInventorySlotContents(var2, (ItemStack)null); -+ } else if (!var16.getHasStack() && var17 != null && var16.isItemValid(var17)) { -+ var6.setInventorySlotContents(par2, (ItemStack)null); - var16.putStack(var17); - } - } -- } else if(var3 == 3 && var4.capabilities.isCreativeMode && var6.getItemStack() == null && var1 >= 0) { -- var16 = (Slot)this.c.get(var1); -- if(var16 != null && var16.getHasStack()) { -+ } else if (par3 == 3 && par4EntityPlayer.capabilities.isCreativeMode && var6.getItemStack() == null && par1 >= 0) { -+ var16 = (Slot)this.inventorySlots.get(par1); -+ -+ if (var16 != null && var16.getHasStack()) { - var17 = var16.getStack().copy(); - var17.stackSize = var17.getMaxStackSize(); - var6.setItemStack(var17); - } -- } else if(var3 == 4 && var6.getItemStack() == null && var1 >= 0) { -- var16 = (Slot)this.c.get(var1); -- if(var16 != null && var16.getHasStack() && var16.canTakeStack(var4)) { -- var17 = var16.decrStackSize(var2 == 0 ? 1 : var16.getStack().stackSize); -- var16.onPickupFromSlot(var4, var17); -- var4.dropPlayerItem(var17); -+ } else if (par3 == 4 && var6.getItemStack() == null && par1 >= 0) { -+ var16 = (Slot)this.inventorySlots.get(par1); -+ -+ if (var16 != null && var16.getHasStack() && var16.canTakeStack(par4EntityPlayer)) { -+ var17 = var16.decrStackSize(par2 == 0 ? 1 : var16.getStack().stackSize); -+ var16.onPickupFromSlot(par4EntityPlayer, var17); -+ par4EntityPlayer.dropPlayerItem(var17); - } -- } else if(var3 == 6 && var1 >= 0) { -- var16 = (Slot)this.c.get(var1); -+ } else if (par3 == 6 && par1 >= 0) { -+ var16 = (Slot)this.inventorySlots.get(par1); - var17 = var6.getItemStack(); -- if(var17 != null && (var16 == null || !var16.getHasStack() || !var16.canTakeStack(var4))) { -- var9 = var2 == 0 ? 0 : this.c.size() - 1; -- var19 = var2 == 0 ? 1 : -1; -- -- for(int var21 = 0; var21 < 2; ++var21) { -- for(int var23 = var9; var23 >= 0 && var23 < this.c.size() && var17.stackSize < var17.getMaxStackSize(); var23 += var19) { -- Slot var24 = (Slot)this.c.get(var23); -- if(var24.getHasStack() && func_94527_a(var24, var17, true) && var24.canTakeStack(var4) && this.func_94530_a(var17, var24) && (var21 != 0 || var24.getStack().stackSize != var24.getStack().getMaxStackSize())) { -+ -+ if (var17 != null && (var16 == null || !var16.getHasStack() || !var16.canTakeStack(par4EntityPlayer))) { -+ var9 = par2 == 0 ? 0 : this.inventorySlots.size() - 1; -+ var21 = par2 == 0 ? 1 : -1; -+ -+ for (int var20 = 0; var20 < 2; ++var20) { -+ for (int var22 = var9; var22 >= 0 && var22 < this.inventorySlots.size() && var17.stackSize < var17.getMaxStackSize(); var22 += var21) { -+ Slot var24 = (Slot)this.inventorySlots.get(var22); -+ -+ if (var24.getHasStack() && func_94527_a(var24, var17, true) && var24.canTakeStack(par4EntityPlayer) && this.func_94530_a(var17, var24) && (var20 != 0 || var24.getStack().stackSize != var24.getStack().getMaxStackSize())) { - int var14 = Math.min(var17.getMaxStackSize() - var17.stackSize, var24.getStack().stackSize); - ItemStack var15 = var24.decrStackSize(var14); - var17.stackSize += var14; -- if(var15.stackSize <= 0) { -+ -+ if (var15.stackSize <= 0) { - var24.putStack((ItemStack)null); - } - -- var24.onPickupFromSlot(var4, var15); -+ var24.onPickupFromSlot(par4EntityPlayer, var15); - } - } - } -@@ -339,189 +405,223 @@ - return var5; - } - -- public boolean func_94530_a(ItemStack var1, Slot var2) { -+ public boolean func_94530_a(ItemStack par1ItemStack, Slot par2Slot) { - return true; - } - -- protected void retrySlotClick(int var1, int var2, boolean var3, EntityPlayer var4) { -- this.slotClick(var1, var2, 1, var4); -+ protected void retrySlotClick(int par1, int par2, boolean par3, EntityPlayer par4EntityPlayer) { -+ this.slotClick(par1, par2, 1, par4EntityPlayer); - } - -- public void onContainerClosed(EntityPlayer var1) { -- InventoryPlayer var2 = var1.inventory; -- if(var2.getItemStack() != null) { -- var1.dropPlayerItem(var2.getItemStack()); -+ /** -+ * Called when the container is closed. -+ */ -+ public void onContainerClosed(EntityPlayer par1EntityPlayer) { -+ InventoryPlayer var2 = par1EntityPlayer.inventory; -+ -+ if (var2.getItemStack() != null) { -+ par1EntityPlayer.dropPlayerItem(var2.getItemStack()); - var2.setItemStack((ItemStack)null); - } -- -- } -- -- public void onCraftMatrixChanged(IInventory var1) { -- this.detectAndSendChanges(); -- } -- -- public void putStackInSlot(int var1, ItemStack var2) { -- this.getSlot(var1).putStack(var2); -- } -- -- public void putStacksInSlots(ItemStack[] var1) { -- for(int var2 = 0; var2 < var1.length; ++var2) { -- this.getSlot(var2).putStack(var1[var2]); -- } -- -- } -- -- public void updateProgressBar(int var1, int var2) { -- } -- -- public short getNextTransactionID(InventoryPlayer var1) { -- ++this.transactionID; -- return this.transactionID; -- } -- -- public boolean getCanCraft(EntityPlayer var1) { -- return !this.i.contains(var1); -- } -- -- public void setCanCraft(EntityPlayer var1, boolean var2) { -- if(var2) { -- this.i.remove(var1); -- } else { -- this.i.add(var1); -- } -- -- } -- -- public abstract boolean canInteractWith(EntityPlayer var1); -- -- protected boolean mergeItemStack(ItemStack var1, int var2, int var3, boolean var4) { -- boolean var5 = false; -- int var6 = var2; -- if(var4) { -- var6 = var3 - 1; -- } -- -- Slot var7; -- ItemStack var8; -- if(var1.isStackable()) { -- while(var1.stackSize > 0 && (!var4 && var6 < var3 || var4 && var6 >= var2)) { -- var7 = (Slot)this.c.get(var6); -- var8 = var7.getStack(); -- if(var8 != null && var8.itemID == var1.itemID && (!var1.getHasSubtypes() || var1.getItemDamage() == var8.getItemDamage()) && ItemStack.areItemStackTagsEqual(var1, var8)) { -- int var9 = var8.stackSize + var1.stackSize; -- if(var9 <= var1.getMaxStackSize()) { -- var1.stackSize = 0; -- var8.stackSize = var9; -- var7.onSlotChanged(); -- var5 = true; -- } else if(var8.stackSize < var1.getMaxStackSize()) { -- var1.stackSize -= var1.getMaxStackSize() - var8.stackSize; -- var8.stackSize = var1.getMaxStackSize(); -- var7.onSlotChanged(); -- var5 = true; -- } -- } -- -- if(var4) { -- --var6; -- } else { -- ++var6; -- } -- } -- } -- -- if(var1.stackSize > 0) { -- if(var4) { -- var6 = var3 - 1; -- } else { -- var6 = var2; -- } -- -- while(!var4 && var6 < var3 || var4 && var6 >= var2) { -- var7 = (Slot)this.c.get(var6); -- var8 = var7.getStack(); -- if(var8 == null) { -- var7.putStack(var1.copy()); -- var7.onSlotChanged(); -- var1.stackSize = 0; -- var5 = true; -- break; -- } -- -- if(var4) { -- --var6; -- } else { -- ++var6; -- } -- } -- } -- -- return var5; -- } -- -- public static int func_94529_b(int var0) { -- return var0 >> 2 & 3; -- } -- -- public static int func_94532_c(int var0) { -- return var0 & 3; -- } -- -- public static int func_94534_d(int var0, int var1) { -- return var0 & 3 | (var1 & 3) << 2; -- } -- -- public static boolean func_94528_d(int var0) { -- return var0 == 0 || var0 == 1; -- } -- -- protected void func_94533_d() { -- this.field_94536_g = 0; -- this.h.clear(); -- } -- -- public static boolean func_94527_a(Slot var0, ItemStack var1, boolean var2) { -- boolean var3 = var0 == null || !var0.getHasStack(); -- if(var0 != null && var0.getHasStack() && var1 != null && var1.isItemEqual(var0.getStack()) && ItemStack.areItemStackTagsEqual(var0.getStack(), var1)) { -- var3 |= var0.getStack().stackSize + (var2 ? 0 : var1.stackSize) <= var1.getMaxStackSize(); -- } -- -- return var3; -- } -- -- public static void func_94525_a(Set var0, int var1, ItemStack var2, int var3) { -- switch(var1) { -- case 0: -- var2.stackSize = MathHelper.floor_float((float)var2.stackSize / (float)var0.size()); -- break; -- case 1: -- var2.stackSize = 1; -- } -- -- var2.stackSize += var3; -- } -- -- public boolean canDragIntoSlot(Slot var1) { -- return true; -- } -- -- public static int calcRedstoneFromInventory(IInventory var0) { -- if(var0 == null) { -- return 0; -- } else { -- int var1 = 0; -- float var2 = 0.0F; -- -- for(int var3 = 0; var3 < var0.getSizeInventory(); ++var3) { -- ItemStack var4 = var0.getStackInSlot(var3); -- if(var4 != null) { -- var2 += (float)var4.stackSize / (float)Math.min(var0.getInventoryStackLimit(), var4.getMaxStackSize()); -- ++var1; -- } -- } -- -- var2 /= (float)var0.getSizeInventory(); -- return MathHelper.floor_float(var2 * 14.0F) + (var1 > 0 ? 1 : 0); -- } -- } -+ } -+ -+ /** -+ * Callback for when the crafting matrix is changed. -+ */ -+ public void onCraftMatrixChanged(IInventory par1IInventory) { -+ this.detectAndSendChanges(); -+ } -+ -+ /** -+ * args: slotID, itemStack to put in slot -+ */ -+ public void putStackInSlot(int par1, ItemStack par2ItemStack) { -+ this.getSlot(par1).putStack(par2ItemStack); -+ } -+ -+ /** -+ * places itemstacks in first x slots, x being aitemstack.lenght -+ */ -+ public void putStacksInSlots(ItemStack[] par1ArrayOfItemStack) { -+ for (int var2 = 0; var2 < par1ArrayOfItemStack.length; ++var2) { -+ this.getSlot(var2).putStack(par1ArrayOfItemStack[var2]); -+ } -+ } -+ -+ public void updateProgressBar(int par1, int par2) {} -+ -+ /** -+ * Gets a unique transaction ID. Parameter is unused. -+ */ -+ public short getNextTransactionID(InventoryPlayer par1InventoryPlayer) { -+ ++this.transactionID; -+ return this.transactionID; -+ } -+ -+ /** -+ * NotUsing because adding a player twice is an error -+ */ -+ public boolean isPlayerNotUsingContainer(EntityPlayer par1EntityPlayer) { -+ return !this.playerList.contains(par1EntityPlayer); -+ } -+ -+ /** -+ * adds or removes the player from the container based on par2 -+ */ -+ public void setPlayerIsPresent(EntityPlayer par1EntityPlayer, boolean par2) { -+ if (par2) { -+ this.playerList.remove(par1EntityPlayer); -+ } else { -+ this.playerList.add(par1EntityPlayer); -+ } -+ } -+ -+ public abstract boolean canInteractWith(EntityPlayer var1); -+ -+ /** -+ * merges provided ItemStack with the first avaliable one in the container/player inventory -+ */ -+ protected boolean mergeItemStack(ItemStack par1ItemStack, int par2, int par3, boolean par4) { -+ boolean var5 = false; -+ int var6 = par2; -+ -+ if (par4) { -+ var6 = par3 - 1; -+ } -+ -+ Slot var7; -+ ItemStack var8; -+ -+ if (par1ItemStack.isStackable()) { -+ while (par1ItemStack.stackSize > 0 && (!par4 && var6 < par3 || par4 && var6 >= par2)) { -+ var7 = (Slot)this.inventorySlots.get(var6); -+ var8 = var7.getStack(); -+ -+ if (var8 != null && var8.itemID == par1ItemStack.itemID && (!par1ItemStack.getHasSubtypes() || par1ItemStack.getItemDamage() == var8.getItemDamage()) && ItemStack.areItemStackTagsEqual(par1ItemStack, var8)) { -+ int var9 = var8.stackSize + par1ItemStack.stackSize; -+ -+ if (var9 <= par1ItemStack.getMaxStackSize()) { -+ par1ItemStack.stackSize = 0; -+ var8.stackSize = var9; -+ var7.onSlotChanged(); -+ var5 = true; -+ } else if (var8.stackSize < par1ItemStack.getMaxStackSize()) { -+ par1ItemStack.stackSize -= par1ItemStack.getMaxStackSize() - var8.stackSize; -+ var8.stackSize = par1ItemStack.getMaxStackSize(); -+ var7.onSlotChanged(); -+ var5 = true; -+ } -+ } -+ -+ if (par4) { -+ --var6; -+ } else { -+ ++var6; -+ } -+ } -+ } -+ -+ if (par1ItemStack.stackSize > 0) { -+ if (par4) { -+ var6 = par3 - 1; -+ } else { -+ var6 = par2; -+ } -+ -+ while (!par4 && var6 < par3 || par4 && var6 >= par2) { -+ var7 = (Slot)this.inventorySlots.get(var6); -+ var8 = var7.getStack(); -+ -+ if (var8 == null) { -+ var7.putStack(par1ItemStack.copy()); -+ var7.onSlotChanged(); -+ par1ItemStack.stackSize = 0; -+ var5 = true; -+ break; -+ } -+ -+ if (par4) { -+ --var6; -+ } else { -+ ++var6; -+ } -+ } -+ } -+ -+ return var5; -+ } -+ -+ public static int func_94529_b(int par0) { -+ return par0 >> 2 & 3; -+ } -+ -+ public static int func_94532_c(int par0) { -+ return par0 & 3; -+ } -+ -+ public static int func_94534_d(int par0, int par1) { -+ return par0 & 3 | (par1 & 3) << 2; -+ } -+ -+ public static boolean func_94528_d(int par0) { -+ return par0 == 0 || par0 == 1; -+ } -+ -+ protected void func_94533_d() { -+ this.field_94536_g = 0; -+ this.field_94537_h.clear(); -+ } -+ -+ public static boolean func_94527_a(Slot par0Slot, ItemStack par1ItemStack, boolean par2) { -+ boolean var3 = par0Slot == null || !par0Slot.getHasStack(); -+ -+ if (par0Slot != null && par0Slot.getHasStack() && par1ItemStack != null && par1ItemStack.isItemEqual(par0Slot.getStack()) && ItemStack.areItemStackTagsEqual(par0Slot.getStack(), par1ItemStack)) { -+ int var10002 = par2 ? 0 : par1ItemStack.stackSize; -+ var3 |= par0Slot.getStack().stackSize + var10002 <= par1ItemStack.getMaxStackSize(); -+ } -+ -+ return var3; -+ } -+ -+ public static void func_94525_a(Set par0Set, int par1, ItemStack par2ItemStack, int par3) { -+ switch (par1) { -+ case 0: -+ par2ItemStack.stackSize = MathHelper.floor_float((float)par2ItemStack.stackSize / (float)par0Set.size()); -+ break; -+ -+ case 1: -+ par2ItemStack.stackSize = 1; -+ } -+ -+ par2ItemStack.stackSize += par3; -+ } -+ -+ /** -+ * Returns true if the player can "drag-spilt" items into this slot,. returns true by default. Called to check if the -+ * slot can be added to a list of Slots to split the held ItemStack across. -+ */ -+ public boolean canDragIntoSlot(Slot par1Slot) { -+ return true; -+ } -+ -+ public static int calcRedstoneFromInventory(IInventory par0IInventory) { -+ if (par0IInventory == null) { -+ return 0; -+ } else { -+ int var1 = 0; -+ float var2 = 0.0F; -+ -+ for (int var3 = 0; var3 < par0IInventory.getSizeInventory(); ++var3) { -+ ItemStack var4 = par0IInventory.getStackInSlot(var3); -+ -+ if (var4 != null) { -+ var2 += (float)var4.stackSize / (float)Math.min(par0IInventory.getInventoryStackLimit(), var4.getMaxStackSize()); -+ ++var1; -+ } -+ } -+ -+ var2 /= (float)par0IInventory.getSizeInventory(); -+ return MathHelper.floor_float(var2 * 14.0F) + (var1 > 0 ? 1 : 0); -+ } -+ } - } ---- net/minecraft/src/PackMetadataSection.java -+++ net/minecraft/src/PackMetadataSection.java -@@ -1,16 +1,16 @@ - package net.minecraft.src; - - public class PackMetadataSection implements MetadataSection { -- private final String a; -+ private final String packDescription; - private final int packFormat; - -- public PackMetadataSection(String var1, int var2) { -- this.a = var1; -- this.packFormat = var2; -+ public PackMetadataSection(String par1Str, int par2) { -+ this.packDescription = par1Str; -+ this.packFormat = par2; - } - - public String getPackDescription() { -- return this.a; -+ return this.packDescription; - } - - public int getPackFormat() { ---- net/minecraft/src/GuiSlotLanguage.java -+++ net/minecraft/src/GuiSlotLanguage.java -@@ -7,44 +7,56 @@ - import java.util.Map; - - class GuiSlotLanguage extends GuiSlot { -- private final List b; -- private final Map h; -+ private final List field_77251_g; -+ private final Map field_77253_h; -+ - final GuiLanguage languageGui; - -- public GuiSlotLanguage(GuiLanguage var1) { -- super(var1.mc, var1.width, var1.height, 32, var1.height - 65 + 4, 18); -- this.languageGui = var1; -- this.b = Lists.newArrayList(); -- this.h = Maps.newHashMap(); -- Iterator var2 = GuiLanguage.func_135011_a(var1).getLanguages().iterator(); -+ public GuiSlotLanguage(GuiLanguage par1GuiLanguage) { -+ super(par1GuiLanguage.mc, par1GuiLanguage.width, par1GuiLanguage.height, 32, par1GuiLanguage.height - 65 + 4, 18); -+ this.languageGui = par1GuiLanguage; -+ this.field_77251_g = Lists.newArrayList(); -+ this.field_77253_h = Maps.newHashMap(); -+ Iterator var2 = GuiLanguage.func_135011_a(par1GuiLanguage).getLanguages().iterator(); - -- while(var2.hasNext()) { -+ while (var2.hasNext()) { - Language var3 = (Language)var2.next(); -- this.h.put(var3.getLanguageCode(), var3); -- this.b.add(var3.getLanguageCode()); -+ this.field_77253_h.put(var3.getLanguageCode(), var3); -+ this.field_77251_g.add(var3.getLanguageCode()); - } -- - } - -+ /** -+ * Gets the size of the current slot list. -+ */ - protected int getSize() { -- return this.b.size(); -+ return this.field_77251_g.size(); - } - -- protected void elementClicked(int var1, boolean var2) { -- Language var3 = (Language)this.h.get(this.b.get(var1)); -+ /** -+ * the element in the slot that was clicked, boolean for wether it was double clicked or not -+ */ -+ protected void elementClicked(int par1, boolean par2) { -+ Language var3 = (Language)this.field_77253_h.get(this.field_77251_g.get(par1)); - GuiLanguage.func_135011_a(this.languageGui).setCurrentLanguage(var3); -- GuiLanguage.getGameSettings(this.languageGui).an = var3.getLanguageCode(); -+ GuiLanguage.getGameSettings(this.languageGui).language = var3.getLanguageCode(); - this.languageGui.mc.refreshResources(); - this.languageGui.fontRenderer.setUnicodeFlag(GuiLanguage.func_135011_a(this.languageGui).isCurrentLocaleUnicode()); - this.languageGui.fontRenderer.setBidiFlag(GuiLanguage.func_135011_a(this.languageGui).isCurrentLanguageBidirectional()); -- GuiLanguage.getDoneButton(this.languageGui).f = I18n.getString("gui.done"); -+ GuiLanguage.getDoneButton(this.languageGui).displayString = I18n.getString("gui.done"); - GuiLanguage.getGameSettings(this.languageGui).saveOptions(); - } - -- protected boolean isSelected(int var1) { -- return ((String)this.b.get(var1)).equals(GuiLanguage.func_135011_a(this.languageGui).getCurrentLanguage().getLanguageCode()); -+ /** -+ * returns true if the element passed in is currently selected -+ */ -+ protected boolean isSelected(int par1) { -+ return ((String)this.field_77251_g.get(par1)).equals(GuiLanguage.func_135011_a(this.languageGui).getCurrentLanguage().getLanguageCode()); - } - -+ /** -+ * return the height of the content being scrolled -+ */ - protected int getContentHeight() { - return this.getSize() * 18; - } -@@ -53,9 +65,9 @@ - this.languageGui.drawDefaultBackground(); - } - -- protected void drawSlot(int var1, int var2, int var3, int var4, Tessellator var5) { -+ protected void drawSlot(int par1, int par2, int par3, int par4, Tessellator par5Tessellator) { - this.languageGui.fontRenderer.setBidiFlag(true); -- this.languageGui.drawCenteredString(this.languageGui.fontRenderer, ((Language)this.h.get(this.b.get(var1))).toString(), this.languageGui.width / 2, var3 + 1, 16777215); -+ this.languageGui.drawCenteredString(this.languageGui.fontRenderer, ((Language)this.field_77253_h.get(this.field_77251_g.get(par1))).toString(), this.languageGui.width / 2, par3 + 1, 16777215); - this.languageGui.fontRenderer.setBidiFlag(GuiLanguage.func_135011_a(this.languageGui).getCurrentLanguage().isBidirectional()); - } - } ---- /dev/null -+++ org/spoutcraft/api/gui/Keyboard.java -@@ -1,0 +1,206 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.api.gui; -+ -+import java.util.HashMap; -+import java.util.Map; -+ -+public enum Keyboard { -+ CHAR_NONE(0), -+ KEY_NONE(0), -+ KEY_ESCAPE(1), -+ KEY_1(2), -+ KEY_2(3), -+ KEY_3(4), -+ KEY_4(5), -+ KEY_5(6), -+ KEY_6(7), -+ KEY_7(8), -+ KEY_8(9), -+ KEY_9(10), -+ KEY_0(11), -+ KEY_MINUS(12), -+ KEY_EQUALS(13), -+ KEY_BACK(14), -+ KEY_TAB(15), -+ KEY_Q(16), -+ KEY_W(17), -+ KEY_E(18), -+ KEY_R(19), -+ KEY_T(20), -+ KEY_Y(21), -+ KEY_U(22), -+ KEY_I(23), -+ KEY_O(24), -+ KEY_P(25), -+ KEY_LBRACKET(26), -+ KEY_RBRACKET(27), -+ KEY_RETURN(28), -+ KEY_LCONTROL(29), -+ KEY_A(30), -+ KEY_S(31), -+ KEY_D(32), -+ KEY_F(33), -+ KEY_G(34), -+ KEY_H(35), -+ KEY_J(36), -+ KEY_K(37), -+ KEY_L(38), -+ KEY_SEMICOLON(39), -+ KEY_APOSTROPHE(40), -+ KEY_GRAVE(41), -+ KEY_LSHIFT(42), -+ KEY_BACKSLASH(43), -+ KEY_Z(44), -+ KEY_X(45), -+ KEY_C(46), -+ KEY_V(47), -+ KEY_B(48), -+ KEY_N(49), -+ KEY_M(50), -+ KEY_COMMA(51), -+ KEY_PERIOD(52), -+ KEY_SLASH(53), -+ KEY_RSHIFT(54), -+ KEY_MULTIPLY(55), -+ KEY_LMENU(56), -+ KEY_SPACE(57), -+ KEY_CAPITAL(58), -+ KEY_F1(59), -+ KEY_F2(60), -+ KEY_F3(61), -+ KEY_F4(62), -+ KEY_F5(63), -+ KEY_F6(64), -+ KEY_F7(65), -+ KEY_F8(66), -+ KEY_F9(67), -+ KEY_F10(68), -+ KEY_NUMLOCK(69), -+ KEY_SCROLL(70), -+ KEY_NUMPAD7(71), -+ KEY_NUMPAD8(72), -+ KEY_NUMPAD9(73), -+ KEY_SUBTRACT(74), -+ KEY_NUMPAD4(75), -+ KEY_NUMPAD5(76), -+ KEY_NUMPAD6(77), -+ KEY_ADD(78), -+ KEY_NUMPAD1(79), -+ KEY_NUMPAD2(80), -+ KEY_NUMPAD3(81), -+ KEY_NUMPAD0(82), -+ KEY_DECIMAL(83), -+ KEY_F11(87), -+ KEY_F12(88), -+ KEY_F13(100), -+ KEY_F14(101), -+ KEY_F15(102), -+ KEY_KANA(112), -+ KEY_CONVERT(121), -+ KEY_NOCONVERT(123), -+ KEY_YEN(125), -+ KEY_NUMPADEQUALS(141), -+ KEY_CIRCUMFLEX(144), -+ KEY_AT(145), -+ KEY_COLON(146), -+ KEY_UNDERLINE(147), -+ KEY_KANJI(148), -+ KEY_STOP(149), -+ KEY_AX(150), -+ KEY_UNLABELED(151), -+ KEY_NUMPADENTER(156), -+ KEY_RCONTROL(157), -+ KEY_NUMPADCOMMA(179), -+ KEY_DIVIDE(181), -+ KEY_SYSRQ(183), -+ KEY_RMENU(184), -+ KEY_PAUSE(197), -+ KEY_HOME(199), -+ KEY_UP(200), -+ KEY_PRIOR(201), -+ KEY_LEFT(203), -+ KEY_RIGHT(205), -+ KEY_END(207), -+ KEY_DOWN(208), -+ KEY_NEXT(209), -+ KEY_INSERT(210), -+ KEY_DELETE(211), -+ KEY_LMETA(219), -+ KEY_LWIN(219), -+ KEY_RMETA(220), -+ KEY_RWIN(220), -+ KEY_APPS(221), -+ KEY_POWER(222), -+ KEY_SLEEP(223), -+ KEYBOARD_SIZE(256), -+ MOUSE_RIGHT(-99), -+ MOUSE_LEFT(-100), -+ MOUSE_MIDDLE(-98), -+ KEY_UNKNOWN(-1); -+ -+ private final int keyCode; -+ private static final Map lookupKeyCode = new HashMap(); -+ -+ Keyboard(final int i) { -+ this.keyCode = i; -+ } -+ -+ public int getKeyCode() { -+ return keyCode; -+ } -+ -+ public static Keyboard getKey(int key) { -+ if (lookupKeyCode.containsKey(key)) { -+ return lookupKeyCode.get(key); -+ } -+ // Some computers report signed/unsigned values incorrectly -+ if (lookupKeyCode.containsKey(256 + key)) { -+ return lookupKeyCode.get(256 + key); -+ } -+ return KEY_UNKNOWN; -+ } -+ -+ static { -+ for (Keyboard key : values()) { -+ lookupKeyCode.put(key.keyCode, key); -+ } -+ } -+ -+ private static KeyManager manager; -+ -+ public static void setKeyManager(KeyManager manager) { -+ if (Keyboard.manager == null) { -+ Keyboard.manager = manager; -+ } -+ } -+ -+ public static boolean isKeyDown(Keyboard key) { -+ return manager.isKeyDown(key); -+ } -+ -+ public static boolean isRepeatingEvents() { -+ return manager.isRepeatingEvents(); -+ } -+ -+ public static void setRepeatingEvents(boolean repeat) { -+ manager.setRepeatingEvents(repeat); -+ } -+} ---- net/minecraft/src/ContainerBeacon.java -+++ net/minecraft/src/ContainerBeacon.java -@@ -2,102 +2,113 @@ - - public class ContainerBeacon extends Container { - private TileEntityBeacon theBeacon; -+ -+ /** -+ * This beacon's slot where you put in Emerald, Diamond, Gold or Iron Ingot. -+ */ - private final SlotBeacon beaconSlot; - private int field_82865_g; - private int field_82867_h; - private int field_82868_i; - -- public ContainerBeacon(InventoryPlayer var1, TileEntityBeacon var2) { -- this.theBeacon = var2; -- this.addSlotToContainer(this.beaconSlot = new SlotBeacon(this, var2, 0, 136, 110)); -+ public ContainerBeacon(InventoryPlayer par1InventoryPlayer, TileEntityBeacon par2TileEntityBeacon) { -+ this.theBeacon = par2TileEntityBeacon; -+ this.addSlotToContainer(this.beaconSlot = new SlotBeacon(this, par2TileEntityBeacon, 0, 136, 110)); - byte var3 = 36; - short var4 = 137; -- - int var5; -- for(var5 = 0; var5 < 3; ++var5) { -- for(int var6 = 0; var6 < 9; ++var6) { -- this.addSlotToContainer(new Slot(var1, var6 + var5 * 9 + 9, var3 + var6 * 18, var4 + var5 * 18)); -+ -+ for (var5 = 0; var5 < 3; ++var5) { -+ for (int var6 = 0; var6 < 9; ++var6) { -+ this.addSlotToContainer(new Slot(par1InventoryPlayer, var6 + var5 * 9 + 9, var3 + var6 * 18, var4 + var5 * 18)); - } - } - -- for(var5 = 0; var5 < 9; ++var5) { -- this.addSlotToContainer(new Slot(var1, var5, var3 + var5 * 18, 58 + var4)); -- } -- -- this.field_82865_g = var2.getLevels(); -- this.field_82867_h = var2.getPrimaryEffect(); -- this.field_82868_i = var2.getSecondaryEffect(); -- } -- -- public void onCraftGuiOpened(ICrafting var1) { -- super.onCraftGuiOpened(var1); -- var1.sendProgressBarUpdate(this, 0, this.field_82865_g); -- var1.sendProgressBarUpdate(this, 1, this.field_82867_h); -- var1.sendProgressBarUpdate(this, 2, this.field_82868_i); -- } -- -- public void updateProgressBar(int var1, int var2) { -- if(var1 == 0) { -- this.theBeacon.setLevels(var2); -- } -- -- if(var1 == 1) { -- this.theBeacon.setPrimaryEffect(var2); -- } -- -- if(var1 == 2) { -- this.theBeacon.setSecondaryEffect(var2); -- } -- -- } -- -+ for (var5 = 0; var5 < 9; ++var5) { -+ this.addSlotToContainer(new Slot(par1InventoryPlayer, var5, var3 + var5 * 18, 58 + var4)); -+ } -+ -+ this.field_82865_g = par2TileEntityBeacon.getLevels(); -+ this.field_82867_h = par2TileEntityBeacon.getPrimaryEffect(); -+ this.field_82868_i = par2TileEntityBeacon.getSecondaryEffect(); -+ } -+ -+ public void addCraftingToCrafters(ICrafting par1ICrafting) { -+ super.addCraftingToCrafters(par1ICrafting); -+ par1ICrafting.sendProgressBarUpdate(this, 0, this.field_82865_g); -+ par1ICrafting.sendProgressBarUpdate(this, 1, this.field_82867_h); -+ par1ICrafting.sendProgressBarUpdate(this, 2, this.field_82868_i); -+ } -+ -+ public void updateProgressBar(int par1, int par2) { -+ if (par1 == 0) { -+ this.theBeacon.setLevels(par2); -+ } -+ -+ if (par1 == 1) { -+ this.theBeacon.setPrimaryEffect(par2); -+ } -+ -+ if (par1 == 2) { -+ this.theBeacon.setSecondaryEffect(par2); -+ } -+ } -+ -+ /** -+ * Returns the Tile Entity behind this beacon inventory / container -+ */ - public TileEntityBeacon getBeacon() { - return this.theBeacon; - } - -- public boolean canInteractWith(EntityPlayer var1) { -- return this.theBeacon.isUseableByPlayer(var1); -+ public boolean canInteractWith(EntityPlayer par1EntityPlayer) { -+ return this.theBeacon.isUseableByPlayer(par1EntityPlayer); - } - -- public ItemStack transferStackInSlot(EntityPlayer var1, int var2) { -+ /** -+ * Called when a player shift-clicks on a slot. You must override this or you will crash when someone does that. -+ */ -+ public ItemStack transferStackInSlot(EntityPlayer par1EntityPlayer, int par2) { - ItemStack var3 = null; -- Slot var4 = (Slot)this.c.get(var2); -- if(var4 != null && var4.getHasStack()) { -+ Slot var4 = (Slot)this.inventorySlots.get(par2); -+ -+ if (var4 != null && var4.getHasStack()) { - ItemStack var5 = var4.getStack(); - var3 = var5.copy(); -- if(var2 == 0) { -- if(!this.mergeItemStack(var5, 1, 37, true)) { -+ -+ if (par2 == 0) { -+ if (!this.mergeItemStack(var5, 1, 37, true)) { - return null; - } - - var4.onSlotChange(var5, var3); -- } else if(!this.beaconSlot.getHasStack() && this.beaconSlot.isItemValid(var5) && var5.stackSize == 1) { -- if(!this.mergeItemStack(var5, 0, 1, false)) { -- return null; -- } -- } else if(var2 >= 1 && var2 < 28) { -- if(!this.mergeItemStack(var5, 28, 37, false)) { -- return null; -- } -- } else if(var2 >= 28 && var2 < 37) { -- if(!this.mergeItemStack(var5, 1, 28, false)) { -- return null; -- } -- } else if(!this.mergeItemStack(var5, 1, 37, false)) { -+ } else if (!this.beaconSlot.getHasStack() && this.beaconSlot.isItemValid(var5) && var5.stackSize == 1) { -+ if (!this.mergeItemStack(var5, 0, 1, false)) { -+ return null; -+ } -+ } else if (par2 >= 1 && par2 < 28) { -+ if (!this.mergeItemStack(var5, 28, 37, false)) { -+ return null; -+ } -+ } else if (par2 >= 28 && par2 < 37) { -+ if (!this.mergeItemStack(var5, 1, 28, false)) { -+ return null; -+ } -+ } else if (!this.mergeItemStack(var5, 1, 37, false)) { - return null; - } - -- if(var5.stackSize == 0) { -+ if (var5.stackSize == 0) { - var4.putStack((ItemStack)null); - } else { - var4.onSlotChanged(); - } - -- if(var5.stackSize == var3.stackSize) { -+ if (var5.stackSize == var3.stackSize) { - return null; - } - -- var4.onPickupFromSlot(var1, var5); -+ var4.onPickupFromSlot(par1EntityPlayer, var5); - } - - return var3; ---- net/minecraft/src/ChatAllowedCharacters.java -+++ net/minecraft/src/ChatAllowedCharacters.java -@@ -4,9 +4,21 @@ - import java.io.InputStreamReader; - - public class ChatAllowedCharacters { -- public static final String a = getAllowedCharacters(); -- public static final char[] allowedCharactersArray = new char[]{'/', '\n', '\r', '\t', '\u0000', '\f', '`', '?', '*', '\\', '<', '>', '|', '\"', ':'}; -- -+ -+ /** -+ * This String have the characters allowed in any text drawing of minecraft. -+ */ -+ public static final String allowedCharacters = getAllowedCharacters(); -+ -+ /** -+ * Array of the special characters that are allowed in any text drawing of Minecraft. -+ */ -+ public static final char[] allowedCharactersArray = new char[] {'/', '\n', '\r', '\t', '\u0000', '\f', '`', '?', '*', '\\', '<', '>', '|', '\"', ':'}; -+ -+ /** -+ * Load the font.txt resource file, that is on UTF-8 format. This file contains the characters that minecraft can -+ * render Strings on screen. -+ */ - private static String getAllowedCharacters() { - String var0 = ""; - -@@ -14,35 +26,36 @@ - BufferedReader var1 = new BufferedReader(new InputStreamReader(ChatAllowedCharacters.class.getResourceAsStream("/font.txt"), "UTF-8")); - String var2 = ""; - -- while(true) { -- var2 = var1.readLine(); -- if(var2 == null) { -- var1.close(); -- break; -- } -- -- if(!var2.startsWith("#")) { -+ while ((var2 = var1.readLine()) != null) { -+ if (!var2.startsWith("#")) { - var0 = var0 + var2; - } - } -+ -+ var1.close(); - } catch (Exception var3) { -+ ; - } - - return var0; - } - -- public static final boolean isAllowedCharacter(char var0) { -- return var0 != 167 && (a.indexOf(var0) >= 0 || var0 > 32); -+ public static final boolean isAllowedCharacter(char par0) { -+ return par0 != 167 && (allowedCharacters.indexOf(par0) >= 0 || par0 > 32); - } - -- public static String filerAllowedCharacters(String var0) { -+ /** -+ * Filter string by only keeping those characters for which isAllowedCharacter() returns true. -+ */ -+ public static String filerAllowedCharacters(String par0Str) { - StringBuilder var1 = new StringBuilder(); -- char[] var2 = var0.toCharArray(); -+ char[] var2 = par0Str.toCharArray(); - int var3 = var2.length; - -- for(int var4 = 0; var4 < var3; ++var4) { -+ for (int var4 = 0; var4 < var3; ++var4) { - char var5 = var2[var4]; -- if(isAllowedCharacter(var5)) { -+ -+ if (isAllowedCharacter(var5)) { - var1.append(var5); - } - } ---- /dev/null -+++ org/spoutcraft/client/packet/PacketKeyBinding.java -@@ -1,0 +1,77 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.client.packet; -+ -+import java.io.IOException; -+import java.util.UUID; -+ -+import org.spoutcraft.api.io.SpoutInputStream; -+import org.spoutcraft.api.io.SpoutOutputStream; -+import org.spoutcraft.api.keyboard.KeyBinding; -+import org.spoutcraft.client.SpoutClient; -+ -+public class PacketKeyBinding implements SpoutPacket { -+ private String id; -+ private String plugin; -+ private String description; -+ private int key; -+ private boolean pressed; -+ private UUID uniqueId; -+ -+ public PacketKeyBinding() { -+ } -+ -+ public PacketKeyBinding(KeyBinding binding, int key, boolean pressed, int screen) { -+ this.key = key; -+ this.pressed = pressed; -+ this.uniqueId = binding.getUniqueId(); -+ } -+ -+ public void readData(SpoutInputStream input) throws IOException { -+ id = input.readString(); -+ description = input.readString(); -+ plugin = input.readString(); -+ key = input.readInt(); -+ uniqueId = new UUID(input.readLong(), input.readLong()); -+ } -+ -+ public void writeData(SpoutOutputStream output) throws IOException { -+ output.writeInt(key); -+ output.writeBoolean(pressed); -+ output.writeLong(uniqueId.getMostSignificantBits()); -+ output.writeLong(uniqueId.getLeastSignificantBits()); -+ } -+ -+ public void run(int playerId) { -+ KeyBinding binding = new KeyBinding(key, plugin, id, description); -+ binding.setUniqueId(uniqueId); -+ SpoutClient.getInstance().getKeyBindingManager().registerControl(binding); -+ } -+ -+ public void failure(int playerId) {} -+ -+ public PacketType getPacketType() { -+ return PacketType.PacketKeyBinding; -+ } -+ -+ public int getVersion() { -+ return 0; -+ } -+} ---- net/minecraft/src/EntityAIRestrictSun.java -+++ net/minecraft/src/EntityAIRestrictSun.java -@@ -3,18 +3,27 @@ - public class EntityAIRestrictSun extends EntityAIBase { - private EntityCreature theEntity; - -- public EntityAIRestrictSun(EntityCreature var1) { -- this.theEntity = var1; -+ public EntityAIRestrictSun(EntityCreature par1EntityCreature) { -+ this.theEntity = par1EntityCreature; - } - -+ /** -+ * Returns whether the EntityAIBase should begin execution. -+ */ - public boolean shouldExecute() { - return this.theEntity.worldObj.isDaytime(); - } - -+ /** -+ * Execute a one shot task or start executing a continuous task -+ */ - public void startExecuting() { - this.theEntity.getNavigator().setAvoidSun(true); - } - -+ /** -+ * Resets the task -+ */ - public void resetTask() { - this.theEntity.getNavigator().setAvoidSun(false); - } ---- net/minecraft/src/SlotMerchantResult.java -+++ net/minecraft/src/SlotMerchantResult.java -@@ -1,53 +1,75 @@ - package net.minecraft.src; - - public class SlotMerchantResult extends Slot { -+ -+ /** Merchant's inventory. */ - private final InventoryMerchant theMerchantInventory; -+ -+ /** The Player whos trying to buy/sell stuff. */ - private EntityPlayer thePlayer; - private int field_75231_g; -+ -+ /** "Instance" of the Merchant. */ - private final IMerchant theMerchant; - -- public SlotMerchantResult(EntityPlayer var1, IMerchant var2, InventoryMerchant var3, int var4, int var5, int var6) { -- super(var3, var4, var5, var6); -- this.thePlayer = var1; -- this.theMerchant = var2; -- this.theMerchantInventory = var3; -+ public SlotMerchantResult(EntityPlayer par1EntityPlayer, IMerchant par2IMerchant, InventoryMerchant par3InventoryMerchant, int par4, int par5, int par6) { -+ super(par3InventoryMerchant, par4, par5, par6); -+ this.thePlayer = par1EntityPlayer; -+ this.theMerchant = par2IMerchant; -+ this.theMerchantInventory = par3InventoryMerchant; - } - -- public boolean isItemValid(ItemStack var1) { -+ /** -+ * Check if the stack is a valid item for this slot. Always true beside for the armor slots. -+ */ -+ public boolean isItemValid(ItemStack par1ItemStack) { - return false; - } - -- public ItemStack decrStackSize(int var1) { -- if(this.getHasStack()) { -- this.field_75231_g += Math.min(var1, this.getStack().stackSize); -+ /** -+ * Decrease the size of the stack in slot (first int arg) by the amount of the second int arg. Returns the new stack. -+ */ -+ public ItemStack decrStackSize(int par1) { -+ if (this.getHasStack()) { -+ this.field_75231_g += Math.min(par1, this.getStack().stackSize); - } - -- return super.decrStackSize(var1); -- } -- -- protected void onCrafting(ItemStack var1, int var2) { -- this.field_75231_g += var2; -- this.onCrafting(var1); -- } -- -- protected void onCrafting(ItemStack var1) { -- var1.onCrafting(this.thePlayer.worldObj, this.thePlayer, this.field_75231_g); -+ return super.decrStackSize(par1); -+ } -+ -+ /** -+ * the itemStack passed in is the output - ie, iron ingots, and pickaxes, not ore and wood. Typically increases an -+ * internal count then calls onCrafting(item). -+ */ -+ protected void onCrafting(ItemStack par1ItemStack, int par2) { -+ this.field_75231_g += par2; -+ this.onCrafting(par1ItemStack); -+ } -+ -+ /** -+ * the itemStack passed in is the output - ie, iron ingots, and pickaxes, not ore and wood. -+ */ -+ protected void onCrafting(ItemStack par1ItemStack) { -+ par1ItemStack.onCrafting(this.thePlayer.worldObj, this.thePlayer, this.field_75231_g); - this.field_75231_g = 0; - } - -- public void onPickupFromSlot(EntityPlayer var1, ItemStack var2) { -- this.onCrafting(var2); -+ public void onPickupFromSlot(EntityPlayer par1EntityPlayer, ItemStack par2ItemStack) { -+ this.onCrafting(par2ItemStack); - MerchantRecipe var3 = this.theMerchantInventory.getCurrentRecipe(); -- if(var3 != null) { -+ -+ if (var3 != null) { - ItemStack var4 = this.theMerchantInventory.getStackInSlot(0); - ItemStack var5 = this.theMerchantInventory.getStackInSlot(1); -- if(this.func_75230_a(var3, var4, var5) || this.func_75230_a(var3, var5, var4)) { -+ -+ if (this.func_75230_a(var3, var4, var5) || this.func_75230_a(var3, var5, var4)) { - this.theMerchant.useRecipe(var3); -- if(var4 != null && var4.stackSize <= 0) { -+ -+ if (var4 != null && var4.stackSize <= 0) { - var4 = null; - } - -- if(var5 != null && var5.stackSize <= 0) { -+ if (var5 != null && var5.stackSize <= 0) { - var5 = null; - } - -@@ -55,21 +77,21 @@ - this.theMerchantInventory.setInventorySlotContents(1, var5); - } - } -- - } - -- private boolean func_75230_a(MerchantRecipe var1, ItemStack var2, ItemStack var3) { -- ItemStack var4 = var1.getItemToBuy(); -- ItemStack var5 = var1.getSecondItemToBuy(); -- if(var2 != null && var2.itemID == var4.itemID) { -- if(var5 != null && var3 != null && var5.itemID == var3.itemID) { -- var2.stackSize -= var4.stackSize; -- var3.stackSize -= var5.stackSize; -+ private boolean func_75230_a(MerchantRecipe par1MerchantRecipe, ItemStack par2ItemStack, ItemStack par3ItemStack) { -+ ItemStack var4 = par1MerchantRecipe.getItemToBuy(); -+ ItemStack var5 = par1MerchantRecipe.getSecondItemToBuy(); -+ -+ if (par2ItemStack != null && par2ItemStack.itemID == var4.itemID) { -+ if (var5 != null && par3ItemStack != null && var5.itemID == par3ItemStack.itemID) { -+ par2ItemStack.stackSize -= var4.stackSize; -+ par3ItemStack.stackSize -= var5.stackSize; - return true; - } - -- if(var5 == null && var3 == null) { -- var2.stackSize -= var4.stackSize; -+ if (var5 == null && par3ItemStack == null) { -+ par2ItemStack.stackSize -= var4.stackSize; - return true; - } - } ---- net/minecraft/src/ModelIronGolem.java -+++ net/minecraft/src/ModelIronGolem.java -@@ -1,86 +1,111 @@ - package net.minecraft.src; - - public class ModelIronGolem extends ModelBase { -+ -+ /** The head model for the iron golem. */ - public ModelRenderer ironGolemHead; -+ -+ /** The body model for the iron golem. */ - public ModelRenderer ironGolemBody; -+ -+ /** The right arm model for the iron golem. */ - public ModelRenderer ironGolemRightArm; -+ -+ /** The left arm model for the iron golem. */ - public ModelRenderer ironGolemLeftArm; -+ -+ /** The left leg model for the Iron Golem. */ - public ModelRenderer ironGolemLeftLeg; -+ -+ /** The right leg model for the Iron Golem. */ - public ModelRenderer ironGolemRightLeg; - - public ModelIronGolem() { - this(0.0F); - } - -- public ModelIronGolem(float var1) { -- this(var1, -7.0F); -+ public ModelIronGolem(float par1) { -+ this(par1, -7.0F); - } - -- public ModelIronGolem(float var1, float var2) { -+ public ModelIronGolem(float par1, float par2) { - short var3 = 128; - short var4 = 128; - this.ironGolemHead = (new ModelRenderer(this)).setTextureSize(var3, var4); -- this.ironGolemHead.setRotationPoint(0.0F, 0.0F + var2, -2.0F); -- this.ironGolemHead.setTextureOffset(0, 0).addBox(-4.0F, -12.0F, -5.5F, 8, 10, 8, var1); -- this.ironGolemHead.setTextureOffset(24, 0).addBox(-1.0F, -5.0F, -7.5F, 2, 4, 2, var1); -+ this.ironGolemHead.setRotationPoint(0.0F, 0.0F + par2, -2.0F); -+ this.ironGolemHead.setTextureOffset(0, 0).addBox(-4.0F, -12.0F, -5.5F, 8, 10, 8, par1); -+ this.ironGolemHead.setTextureOffset(24, 0).addBox(-1.0F, -5.0F, -7.5F, 2, 4, 2, par1); - this.ironGolemBody = (new ModelRenderer(this)).setTextureSize(var3, var4); -- this.ironGolemBody.setRotationPoint(0.0F, 0.0F + var2, 0.0F); -- this.ironGolemBody.setTextureOffset(0, 40).addBox(-9.0F, -2.0F, -6.0F, 18, 12, 11, var1); -- this.ironGolemBody.setTextureOffset(0, 70).addBox(-4.5F, 10.0F, -3.0F, 9, 5, 6, var1 + 0.5F); -+ this.ironGolemBody.setRotationPoint(0.0F, 0.0F + par2, 0.0F); -+ this.ironGolemBody.setTextureOffset(0, 40).addBox(-9.0F, -2.0F, -6.0F, 18, 12, 11, par1); -+ this.ironGolemBody.setTextureOffset(0, 70).addBox(-4.5F, 10.0F, -3.0F, 9, 5, 6, par1 + 0.5F); - this.ironGolemRightArm = (new ModelRenderer(this)).setTextureSize(var3, var4); - this.ironGolemRightArm.setRotationPoint(0.0F, -7.0F, 0.0F); -- this.ironGolemRightArm.setTextureOffset(60, 21).addBox(-13.0F, -2.5F, -3.0F, 4, 30, 6, var1); -+ this.ironGolemRightArm.setTextureOffset(60, 21).addBox(-13.0F, -2.5F, -3.0F, 4, 30, 6, par1); - this.ironGolemLeftArm = (new ModelRenderer(this)).setTextureSize(var3, var4); - this.ironGolemLeftArm.setRotationPoint(0.0F, -7.0F, 0.0F); -- this.ironGolemLeftArm.setTextureOffset(60, 58).addBox(9.0F, -2.5F, -3.0F, 4, 30, 6, var1); -+ this.ironGolemLeftArm.setTextureOffset(60, 58).addBox(9.0F, -2.5F, -3.0F, 4, 30, 6, par1); - this.ironGolemLeftLeg = (new ModelRenderer(this, 0, 22)).setTextureSize(var3, var4); -- this.ironGolemLeftLeg.setRotationPoint(-4.0F, 18.0F + var2, 0.0F); -- this.ironGolemLeftLeg.setTextureOffset(37, 0).addBox(-3.5F, -3.0F, -3.0F, 6, 16, 5, var1); -+ this.ironGolemLeftLeg.setRotationPoint(-4.0F, 18.0F + par2, 0.0F); -+ this.ironGolemLeftLeg.setTextureOffset(37, 0).addBox(-3.5F, -3.0F, -3.0F, 6, 16, 5, par1); - this.ironGolemRightLeg = (new ModelRenderer(this, 0, 22)).setTextureSize(var3, var4); - this.ironGolemRightLeg.mirror = true; -- this.ironGolemRightLeg.setTextureOffset(60, 0).setRotationPoint(5.0F, 18.0F + var2, 0.0F); -- this.ironGolemRightLeg.addBox(-3.5F, -3.0F, -3.0F, 6, 16, 5, var1); -- } -- -- public void render(Entity var1, float var2, float var3, float var4, float var5, float var6, float var7) { -- this.setRotationAngles(var2, var3, var4, var5, var6, var7, var1); -- this.ironGolemHead.render(var7); -- this.ironGolemBody.render(var7); -- this.ironGolemLeftLeg.render(var7); -- this.ironGolemRightLeg.render(var7); -- this.ironGolemRightArm.render(var7); -- this.ironGolemLeftArm.render(var7); -- } -- -- public void setRotationAngles(float var1, float var2, float var3, float var4, float var5, float var6, Entity var7) { -- this.ironGolemHead.rotateAngleY = var4 / (180.0F / (float)Math.PI); -- this.ironGolemHead.rotateAngleX = var5 / (180.0F / (float)Math.PI); -- this.ironGolemLeftLeg.rotateAngleX = -1.5F * this.func_78172_a(var1, 13.0F) * var2; -- this.ironGolemRightLeg.rotateAngleX = 1.5F * this.func_78172_a(var1, 13.0F) * var2; -+ this.ironGolemRightLeg.setTextureOffset(60, 0).setRotationPoint(5.0F, 18.0F + par2, 0.0F); -+ this.ironGolemRightLeg.addBox(-3.5F, -3.0F, -3.0F, 6, 16, 5, par1); -+ } -+ -+ /** -+ * Sets the models various rotation angles then renders the model. -+ */ -+ public void render(Entity par1Entity, float par2, float par3, float par4, float par5, float par6, float par7) { -+ this.setRotationAngles(par2, par3, par4, par5, par6, par7, par1Entity); -+ this.ironGolemHead.render(par7); -+ this.ironGolemBody.render(par7); -+ this.ironGolemLeftLeg.render(par7); -+ this.ironGolemRightLeg.render(par7); -+ this.ironGolemRightArm.render(par7); -+ this.ironGolemLeftArm.render(par7); -+ } -+ -+ /** -+ * Sets the model's various rotation angles. For bipeds, par1 and par2 are used for animating the movement of arms and -+ * legs, where par1 represents the time(so that arms and legs swing back and forth) and par2 represents how "far" arms -+ * and legs can swing at most. -+ */ -+ public void setRotationAngles(float par1, float par2, float par3, float par4, float par5, float par6, Entity par7Entity) { -+ this.ironGolemHead.rotateAngleY = par4 / (180F / (float)Math.PI); -+ this.ironGolemHead.rotateAngleX = par5 / (180F / (float)Math.PI); -+ this.ironGolemLeftLeg.rotateAngleX = -1.5F * this.func_78172_a(par1, 13.0F) * par2; -+ this.ironGolemRightLeg.rotateAngleX = 1.5F * this.func_78172_a(par1, 13.0F) * par2; - this.ironGolemLeftLeg.rotateAngleY = 0.0F; - this.ironGolemRightLeg.rotateAngleY = 0.0F; - } - -- public void setLivingAnimations(EntityLivingBase var1, float var2, float var3, float var4) { -- EntityIronGolem var5 = (EntityIronGolem)var1; -+ /** -+ * Used for easily adding entity-dependent animations. The second and third float params here are the same second and -+ * third as in the setRotationAngles method. -+ */ -+ public void setLivingAnimations(EntityLivingBase par1EntityLivingBase, float par2, float par3, float par4) { -+ EntityIronGolem var5 = (EntityIronGolem)par1EntityLivingBase; - int var6 = var5.getAttackTimer(); -- if(var6 > 0) { -- this.ironGolemRightArm.rotateAngleX = -2.0F + 1.5F * this.func_78172_a((float)var6 - var4, 10.0F); -- this.ironGolemLeftArm.rotateAngleX = -2.0F + 1.5F * this.func_78172_a((float)var6 - var4, 10.0F); -+ -+ if (var6 > 0) { -+ this.ironGolemRightArm.rotateAngleX = -2.0F + 1.5F * this.func_78172_a((float)var6 - par4, 10.0F); -+ this.ironGolemLeftArm.rotateAngleX = -2.0F + 1.5F * this.func_78172_a((float)var6 - par4, 10.0F); - } else { - int var7 = var5.getHoldRoseTick(); -- if(var7 > 0) { -+ -+ if (var7 > 0) { - this.ironGolemRightArm.rotateAngleX = -0.8F + 0.025F * this.func_78172_a((float)var7, 70.0F); - this.ironGolemLeftArm.rotateAngleX = 0.0F; - } else { -- this.ironGolemRightArm.rotateAngleX = (-0.2F + 1.5F * this.func_78172_a(var2, 13.0F)) * var3; -- this.ironGolemLeftArm.rotateAngleX = (-0.2F - 1.5F * this.func_78172_a(var2, 13.0F)) * var3; -+ this.ironGolemRightArm.rotateAngleX = (-0.2F + 1.5F * this.func_78172_a(par2, 13.0F)) * par3; -+ this.ironGolemLeftArm.rotateAngleX = (-0.2F - 1.5F * this.func_78172_a(par2, 13.0F)) * par3; - } - } -- - } - -- private float func_78172_a(float var1, float var2) { -- return (Math.abs(var1 % var2 - var2 * 0.5F) - var2 * 0.25F) / (var2 * 0.25F); -+ private float func_78172_a(float par1, float par2) { -+ return (Math.abs(par1 % par2 - par2 * 0.5F) - par2 * 0.25F) / (par2 * 0.25F); - } - } ---- net/minecraft/src/BiomeGenPlains.java -+++ net/minecraft/src/BiomeGenPlains.java -@@ -1,9 +1,9 @@ - package net.minecraft.src; - - public class BiomeGenPlains extends BiomeGenBase { -- protected BiomeGenPlains(int var1) { -- super(var1); -- this.K.add(new SpawnListEntry(EntityHorse.class, 5, 2, 6)); -+ protected BiomeGenPlains(int par1) { -+ super(par1); -+ this.spawnableCreatureList.add(new SpawnListEntry(EntityHorse.class, 5, 2, 6)); - this.theBiomeDecorator.treesPerChunk = -999; - this.theBiomeDecorator.flowersPerChunk = 4; - this.theBiomeDecorator.grassPerChunk = 10; ---- net/minecraft/src/ModelGhast.java -+++ net/minecraft/src/ModelGhast.java -@@ -14,7 +14,7 @@ - this.body.rotationPointY += (float)(24 + var1); - Random var2 = new Random(1660L); - -- for(int var3 = 0; var3 < this.tentacles.length; ++var3) { -+ for (int var3 = 0; var3 < this.tentacles.length; ++var3) { - this.tentacles[var3] = new ModelRenderer(this, 0, 0); - float var4 = (((float)(var3 % 3) - (float)(var3 / 3 % 2) * 0.5F + 0.25F) / 2.0F * 2.0F - 1.0F) * 5.0F; - float var5 = ((float)(var3 / 3) / 2.0F * 2.0F - 1.0F) * 5.0F; -@@ -24,27 +24,33 @@ - this.tentacles[var3].rotationPointZ = var5; - this.tentacles[var3].rotationPointY = (float)(31 + var1); - } -- - } - -- public void setRotationAngles(float var1, float var2, float var3, float var4, float var5, float var6, Entity var7) { -- for(int var8 = 0; var8 < this.tentacles.length; ++var8) { -- this.tentacles[var8].rotateAngleX = 0.2F * MathHelper.sin(var3 * 0.3F + (float)var8) + 0.4F; -+ /** -+ * Sets the model's various rotation angles. For bipeds, par1 and par2 are used for animating the movement of arms and -+ * legs, where par1 represents the time(so that arms and legs swing back and forth) and par2 represents how "far" arms -+ * and legs can swing at most. -+ */ -+ public void setRotationAngles(float par1, float par2, float par3, float par4, float par5, float par6, Entity par7Entity) { -+ for (int var8 = 0; var8 < this.tentacles.length; ++var8) { -+ this.tentacles[var8].rotateAngleX = 0.2F * MathHelper.sin(par3 * 0.3F + (float)var8) + 0.4F; - } -- - } - -- public void render(Entity var1, float var2, float var3, float var4, float var5, float var6, float var7) { -- this.setRotationAngles(var2, var3, var4, var5, var6, var7, var1); -+ /** -+ * Sets the models various rotation angles then renders the model. -+ */ -+ public void render(Entity par1Entity, float par2, float par3, float par4, float par5, float par6, float par7) { -+ this.setRotationAngles(par2, par3, par4, par5, par6, par7, par1Entity); - GL11.glPushMatrix(); - GL11.glTranslatef(0.0F, 0.6F, 0.0F); -- this.body.render(var7); -+ this.body.render(par7); - ModelRenderer[] var8 = this.tentacles; - int var9 = var8.length; - -- for(int var10 = 0; var10 < var9; ++var10) { -+ for (int var10 = 0; var10 < var9; ++var10) { - ModelRenderer var11 = var8[var10]; -- var11.render(var7); -+ var11.render(par7); - } - - GL11.glPopMatrix(); ---- /dev/null -+++ org/spoutcraft/api/gui/GenericWidget.java -@@ -1,0 +1,658 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.api.gui; -+ -+import java.io.IOException; -+import java.util.UUID; -+ -+import org.spoutcraft.api.Spoutcraft; -+import org.spoutcraft.api.UnsafeClass; -+import org.spoutcraft.api.io.SpoutInputStream; -+import org.spoutcraft.api.io.SpoutOutputStream; -+import org.spoutcraft.api.property.Property; -+import org.spoutcraft.api.property.PropertyObject; -+ -+@UnsafeClass -+public abstract class GenericWidget extends PropertyObject implements Widget { -+ /** -+ * Set if this is Spoutcraft (client), cleared if it is Spout (server)... -+ */ -+ static final protected transient boolean isSpoutcraft = true; -+ protected Rectangle geometry = new Rectangle(0, 0, 0, 0); -+ protected boolean visible = true; -+ protected transient Screen screen = null; -+ protected RenderPriority priority = RenderPriority.Normal; -+ protected UUID id = UUID.randomUUID(); -+ protected String tooltip = ""; -+ protected WidgetAnchor anchor = WidgetAnchor.TOP_LEFT; -+ protected String addon = "Spoutcraft"; -+ // Client side layout -+ protected Container container = null; -+ protected boolean fixed = false; -+ protected int marginTop = 0, marginRight = 0, marginBottom = 0, marginLeft = 0; -+ protected int minWidth = 0, maxWidth = 427, minHeight = 0, maxHeight = 240; -+ protected int orig_x = 0, orig_y = 0; -+ // Animation -+ protected WidgetAnim animType = WidgetAnim.NONE; -+ protected float animValue = 1f; -+ protected short animCount = 0; -+ protected short animTicks = 20; -+ protected final byte ANIM_REPEAT = (1<<0); -+ protected final byte ANIM_RESET = (1<<1); -+ protected final byte ANIM_RUNNING = (1<<2); -+ protected final byte ANIM_STOPPING = (1<<3); -+ protected byte animFlags = 0; -+ protected transient int animTick = 0; // Current tick -+ protected transient int animFrame = 0; // Current frame -+ protected transient int animStart = 0; // Start value per type -+ -+ public GenericWidget() { -+ initProperties(); -+ } -+ -+ private void initProperties() { -+ addProperty("geometry", new Property() { -+ public void set(Object value) { -+ setGeometry((Rectangle) value); -+ } -+ -+ public Object get() { -+ return getGeometry(); -+ } -+ }); -+ } -+ -+ final public boolean isSpoutcraft() { -+ return isSpoutcraft; -+ } -+ -+ public int getVersion() { -+ return 6; -+ } -+ -+ public GenericWidget(int X, int Y, int width, int height) { -+ setGeometry(new Rectangle(X, Y, width, height)); -+ initProperties(); -+ } -+ -+ public Widget setAnchor(WidgetAnchor anchor) { -+ this.anchor = anchor; -+ return this; -+ } -+ -+ public WidgetAnchor getAnchor() { -+ return anchor; -+ } -+ -+ public void readData(SpoutInputStream input) throws IOException { -+ setX(input.readInt()); -+ setY(input.readInt()); -+ setWidth(input.readInt()); -+ setHeight(input.readInt()); -+ setAnchor(WidgetAnchor.getAnchorFromId(input.read())); -+ setVisible(input.readBoolean()); -+ setPriority(RenderPriority.getRenderPriorityFromId(input.readInt())); -+ setTooltip(input.readString()); -+ setAddon(input.readString()); -+ setAddon(addon); -+ animType = WidgetAnim.getAnimationFromId(input.read()); -+ animFlags = (byte) input.read(); -+ animValue = input.readFloat(); -+ animTicks = input.readShort(); -+ animCount = input.readShort(); -+ } -+ -+ public void writeData(SpoutOutputStream output) throws IOException { -+ output.writeInt(getX()); -+ output.writeInt(getY()); -+ output.writeInt((int) getActualWidth()); -+ output.writeInt((int) getActualHeight()); -+ output.write(getAnchor().getId()); -+ output.writeBoolean(isVisible()); -+ output.writeInt(priority.getId()); -+ output.writeString(getTooltip()); -+ output.writeString(getAddon()); -+ output.write(animType.getId()); -+ output.write(animFlags); -+ output.writeFloat(animValue); -+ output.writeShort(animTicks); -+ output.writeShort(animCount); -+ } -+ -+ public String getAddon() { -+ return addon; -+ } -+ -+ public Widget setAddon(String addon) { -+ if (addon != null) { -+ this.addon = addon; -+ } -+ return this; -+ } -+ -+ public UUID getId() { -+ return id; -+ } -+ -+ public void setId(UUID id) { -+ this.id = id; -+ } -+ -+ public Screen getScreen() { -+ return screen; -+ } -+ -+ public Widget setScreen(Screen screen) { -+// System.out.println("Screen of " +this + " set to " + screen); -+ this.screen = screen; -+ return this; -+ } -+ -+ public Widget setScreen(String addon, Screen screen) { -+ if (this.screen != null && screen != null && screen != this.screen) { -+ this.screen.removeWidget(this); -+ } -+ this.screen = screen; -+ if (addon != null) { -+ this.addon = addon; -+ } -+ return this; -+ } -+ -+ public RenderPriority getPriority() { -+ return priority; -+ } -+ -+ public Widget setPriority(RenderPriority priority) { -+ this.priority = priority; -+ return this; -+ } -+ -+ public double getActualWidth() { -+ return getGeometry().getWidth(); -+ } -+ -+ public Widget setWidth(int width) { -+ getGeometry().setWidth(width); -+ return this; -+ } -+ -+ public double getActualHeight() { -+ return getGeometry().getHeight(); -+ } -+ -+ public double getWidth() { -+ return anchor == WidgetAnchor.SCALE ? (getActualWidth() * (getScreen() != null ? (getScreen().getWidth() / 427f) : 1)) : getActualWidth(); -+ } -+ -+ public double getHeight() { -+ return anchor == WidgetAnchor.SCALE ? (getActualHeight() * (getScreen() != null ? (getScreen().getHeight() / 240f) : 1)) : getActualHeight(); -+ } -+ -+ public Widget setHeight(int height) { -+ getGeometry().setHeight(height); -+ return this; -+ } -+ -+ public int getX() { -+ return getGeometry().getX(); -+ } -+ -+ public int getY() { -+ return getGeometry().getY(); -+ } -+ -+ public double getScreenX() { -+ double left = getX() * (anchor == WidgetAnchor.SCALE ? (getScreen() != null ? (getScreen().getWidth() / 427f) : 1) : 1); -+ switch (anchor) { -+ case TOP_CENTER: -+ case CENTER_CENTER: -+ case BOTTOM_CENTER: -+ left += getScreenWidth() / 2; -+ break; -+ case TOP_RIGHT: -+ case CENTER_RIGHT: -+ case BOTTOM_RIGHT: -+ left += getScreenWidth(); -+ break; -+ } -+ return left; -+ } -+ -+ public double getScreenY() { -+ double top = getY() * (anchor == WidgetAnchor.SCALE ? (getScreen() != null ? (getScreen().getHeight() / 240f) : 1) : 1); -+ switch (anchor) { -+ case CENTER_LEFT: -+ case CENTER_CENTER: -+ case CENTER_RIGHT: -+ top += getScreenHeight() / 2; -+ break; -+ case BOTTOM_LEFT: -+ case BOTTOM_CENTER: -+ case BOTTOM_RIGHT: -+ top += getScreenHeight(); -+ break; -+ } -+ return top; -+ } -+ -+ private double getScreenWidth() { -+ if (getScreen() == null) { -+ return Spoutcraft.getRenderDelegate().getScreenWidth(); -+ } -+ return getScreen().getWidth(); -+ } -+ -+ private double getScreenHeight() { -+ if (getScreen() == null) { -+ return Spoutcraft.getRenderDelegate().getScreenHeight(); -+ } -+ return getScreen().getHeight(); -+ } -+ -+ public Widget setX(int pos) { -+ getGeometry().setX(pos); -+ return this; -+ } -+ -+ public Widget setY(int pos) { -+ getGeometry().setY(pos); -+ return this; -+ } -+ -+ public Widget shiftXPos(int modX) { -+ setX(getX() + modX); -+ return this; -+ } -+ -+ public Widget shiftYPos(int modY) { -+ setY(getY() + modY); -+ return this; -+ } -+ -+ public boolean isVisible() { -+ return visible; -+ } -+ -+ public Widget setVisible(boolean enable) { -+ visible = enable; -+ return this; -+ } -+ -+ @Override -+ public int hashCode() { -+ return getId().hashCode(); -+ } -+ -+ @Override -+ public boolean equals(Object other) { -+ return other instanceof Widget && other.hashCode() == hashCode(); -+ } -+ -+ public void onTick() { -+ } -+ -+ public Widget setTooltip(String t) { -+ tooltip = t; -+ return this; -+ } -+ -+ public String getTooltip() { -+ return tooltip; -+ } -+ -+ public Container getContainer() { -+ return container; -+ } -+ -+ public boolean hasContainer() { -+ return container != null; -+ } -+ -+ public void setContainer(Container container) { -+ if (this.container != null && container != null && container != this.container) { -+ this.container.removeChild(this); -+ } -+ this.container = container; -+ } -+ -+ public Widget setFixed(boolean fixed) { -+ if (this.fixed != fixed) { -+ this.fixed = fixed; -+ updateSize(); -+ } -+ return this; -+ } -+ -+ public boolean isFixed() { -+ return fixed; -+ } -+ -+ public Widget setMargin(int marginAll) { -+ return setMargin(marginAll, marginAll, marginAll, marginAll); -+ } -+ -+ public Widget setMargin(int marginTopBottom, int marginLeftRight) { -+ return setMargin(marginTopBottom, marginLeftRight, marginTopBottom, marginLeftRight); -+ } -+ -+ public Widget setMargin(int marginTop, int marginLeftRight, int marginBottom) { -+ return setMargin(marginTop, marginLeftRight, marginBottom, marginLeftRight); -+ } -+ -+ public Widget setMargin(int marginTop, int marginRight, int marginBottom, int marginLeft) { -+ if (this.marginTop != marginTop || this.marginRight != marginRight || this.marginBottom != marginBottom || this.marginLeft != marginLeft) { -+ this.marginTop = marginTop; -+ this.marginRight = marginRight; -+ this.marginBottom = marginBottom; -+ this.marginLeft = marginLeft; -+ updateSize(); -+ } -+ return this; -+ } -+ -+ public Widget setMarginTop(int marginTop) { -+ if (this.marginTop != marginTop) { -+ this.marginTop = marginTop; -+ updateSize(); -+ } -+ return this; -+ } -+ -+ public Widget setMarginRight(int marginRight) { -+ if (this.marginRight != marginRight) { -+ this.marginRight = marginRight; -+ updateSize(); -+ } -+ return this; -+ } -+ -+ public Widget setMarginBottom(int marginBottom) { -+ if (this.marginBottom != marginBottom) { -+ this.marginBottom = marginBottom; -+ updateSize(); -+ } -+ return this; -+ } -+ -+ public Widget setMarginLeft(int marginLeft) { -+ if (this.marginLeft != marginLeft) { -+ this.marginLeft = marginLeft; -+ updateSize(); -+ } -+ return this; -+ } -+ -+ public int getMarginTop() { -+ return marginTop; -+ } -+ -+ public int getMarginRight() { -+ return marginRight; -+ } -+ -+ public int getMarginBottom() { -+ return marginBottom; -+ } -+ -+ public int getMarginLeft() { -+ return marginLeft; -+ } -+ -+ public Widget setMinWidth(int min) { -+ min = Math.max(min, 0); -+ if (minWidth != min) { -+ minWidth = min; -+ updateSize(); -+ setWidth((int) getWidth()); // Enforce our new size if needed -+ } -+ return this; -+ } -+ -+ public int getMinWidth() { -+ return minWidth; -+ } -+ -+ public Widget setMaxWidth(int max) { -+ max = max <= 0 ? 427 : max; -+ if (maxWidth != max) { -+ maxWidth = max; -+ updateSize(); -+ setWidth((int) getWidth()); // Enforce our new size if needed -+ } -+ return this; -+ } -+ -+ public int getMaxWidth() { -+ return maxWidth; -+ } -+ -+ public Widget setMinHeight(int min) { -+ min = Math.max(min, 0); -+ if (minHeight != min) { -+ minHeight = min; -+ updateSize(); -+ setHeight((int) getHeight()); // Enforce our new size if needed -+ } -+ return this; -+ } -+ -+ public int getMinHeight() { -+ return minHeight; -+ } -+ -+ public Widget setMaxHeight(int max) { -+ max = max <= 0 ? 240 : max; -+ if (maxHeight != max) { -+ maxHeight = max; -+ updateSize(); -+ setHeight((int) getHeight()); // Enforce our new size if needed -+ } -+ return this; -+ } -+ -+ public int getMaxHeight() { -+ return maxHeight; -+ } -+ -+ public Widget savePos() { -+ orig_x = getX(); -+ orig_y = getY(); -+ return this; -+ } -+ -+ public Widget restorePos() { -+ setX(orig_x); -+ setY(orig_y); -+ return this; -+ } -+ -+ public Widget copy() { -+ try { -+ Widget copy = getType().getWidgetClass().newInstance(); -+ copy.setGeometry(getGeometry().clone()) // -+ .setVisible(isVisible()) // -+ .setPriority(getPriority()) // -+ .setTooltip(getTooltip()) // -+ .setAnchor(getAnchor()) // -+ .setMargin(getMarginTop(), getMarginRight(), getMarginBottom(), getMarginLeft()) // -+ .setMinWidth(getMinWidth()) // -+ .setMaxWidth(getMaxWidth()) // -+ .setMinHeight(getMinHeight()) // -+ .setMaxHeight(getMaxHeight()) // -+ .setFixed(isFixed()) // -+ .animate(animType, animValue, animCount, animTicks, (animFlags & ANIM_REPEAT) != 0, (animFlags & ANIM_RESET) != 0); -+ return copy; -+ } catch (Exception e) { -+ throw new IllegalStateException("Unable to create a copy of " + getClass() + ". Does it have a valid widget type?"); -+ } -+ } -+ -+ public Widget updateSize() { -+ if (container != null) { -+ container.updateSize(); -+ } -+ return this; -+ } -+ -+ public double getActualX() { -+ if (screen == null) { -+ return getScreenX(); -+ } else { -+ if (screen instanceof ScrollArea) { -+ ScrollArea sa = (ScrollArea) screen; -+ return getScreenX() - sa.getScrollPosition(Orientation.HORIZONTAL) + sa.getScreenX(); -+ } else { -+ return getScreenX();// + screen.getScreenX(); -+ } -+ } -+ } -+ -+ public double getActualY() { -+ if (screen == null) { -+ return getScreenY(); -+ } else { -+ if (screen instanceof ScrollArea) { -+ ScrollArea sa = (ScrollArea) screen; -+ return getScreenY() - sa.getScrollPosition(Orientation.VERTICAL) + sa.getScreenY(); -+ } else { -+ return getScreenY();// + screen.getScreenY(); -+ } -+ } -+ } -+ -+ public Widget animate(WidgetAnim type, float value, short count, short ticks) { -+ animate(type, value, count, ticks, true, true); -+ return this; -+ } -+ -+ public Widget animate(WidgetAnim type, float value, short count, short ticks, boolean repeat) { -+ animate(type, value, count, ticks, repeat, true); -+ return this; -+ } -+ -+ public Widget animate(WidgetAnim type, float value, short count, short ticks, boolean repeat, boolean reset) { -+ if (!type.check(this)) { -+ throw new UnsupportedOperationException("Cannot use Animation." + type.name() + " on " + getType().toString()); -+ } -+ animType = type; -+ animValue = value; -+ animCount = count; -+ animTicks = ticks; -+ animFlags = (byte) ((repeat ? ANIM_REPEAT : 0) | (reset ? ANIM_RESET : 0)); -+ animTick = 0; -+ animFrame = 0; -+ return this; -+ } -+ -+ public Widget animateStart() { -+ if (animType != WidgetAnim.NONE) { -+ animFlags |= ANIM_RUNNING; -+ switch (animType) { -+ case POS_X: -+ animStart = getX(); -+ break; -+ case POS_Y: -+ animStart = getY(); -+ break; -+ case WIDTH: -+ animStart = (int) getWidth(); -+ break; -+ case HEIGHT: -+ animStart = (int) getHeight(); -+ break; -+ case OFFSET_LEFT: -+ animStart = ((Texture) this).getLeft(); -+ break; -+ case OFFSET_TOP: -+ animStart = ((Texture) this).getTop(); -+ break; -+ } -+ animStart -= animFrame * animCount; -+ } -+ return this; -+ } -+ -+ public Widget animateStop(boolean finish) { -+ if ((animFlags & ANIM_RUNNING) != 0 && finish) { -+ animFlags |= ANIM_STOPPING; -+ } else { -+ animFlags &= ~ANIM_RUNNING; -+ } -+ return this; -+ } -+ -+ public void onAnimate() { -+ if ((animFlags & ANIM_RUNNING) == 0 || animTicks == 0 || ++animTick % animTicks != 0) { -+ return; -+ } -+ // We're running, and it's ready for our next frame... -+ if (++animFrame == animCount) { -+ animFrame = 0; -+ if ((animFlags & ANIM_STOPPING) != 0 || (animFlags & ANIM_REPEAT) == 0) { -+ animFlags &= ~ANIM_RUNNING; -+ if ((animFlags & ANIM_RESET) == 0) { -+ return; -+ } -+ } -+ } -+ int value = animStart + (int)Math.floor(animFrame * animValue); -+ switch (animType) { -+ case POS_X: -+ setX(value); -+ break; -+ case POS_Y: -+ setY(value); -+ break; -+ case WIDTH: -+ setWidth(value); -+ break; -+ case HEIGHT: -+ setHeight(value); -+ break; -+ case OFFSET_LEFT: -+ ((Texture) this).setLeft(value); -+ break; -+ case OFFSET_TOP: -+ ((Texture) this).setTop(value); -+ break; -+ } -+ } -+ -+ public void onAnimateStop() { -+ } -+ -+ public Rectangle getGeometry() { -+ return geometry; -+ } -+ -+ public Widget setGeometry(Rectangle geometry) { -+ this.geometry = geometry; -+ return this; -+ } -+ -+ public Widget setGeometry(int x, int y, int width, int height) { -+ getGeometry().setX(x); -+ getGeometry().setY(y); -+ getGeometry().setWidth(width); -+ getGeometry().setHeight(height); -+ return this; -+ } -+} ---- net/minecraft/src/EntityAIMoveIndoors.java -+++ net/minecraft/src/EntityAIMoveIndoors.java -@@ -6,20 +6,24 @@ - private int insidePosX = -1; - private int insidePosZ = -1; - -- public EntityAIMoveIndoors(EntityCreature var1) { -- this.entityObj = var1; -+ public EntityAIMoveIndoors(EntityCreature par1EntityCreature) { -+ this.entityObj = par1EntityCreature; - this.setMutexBits(1); - } - -+ /** -+ * Returns whether the EntityAIBase should begin execution. -+ */ - public boolean shouldExecute() { -- if((!this.entityObj.worldObj.isDaytime() || this.entityObj.worldObj.isRaining()) && !this.entityObj.worldObj.provider.hasNoSky) { -- if(this.entityObj.getRNG().nextInt(50) != 0) { -+ if ((!this.entityObj.worldObj.isDaytime() || this.entityObj.worldObj.isRaining()) && !this.entityObj.worldObj.provider.hasNoSky) { -+ if (this.entityObj.getRNG().nextInt(50) != 0) { - return false; -- } else if(this.insidePosX != -1 && this.entityObj.getDistanceSq((double)this.insidePosX, this.entityObj.posY, (double)this.insidePosZ) < 4.0D) { -+ } else if (this.insidePosX != -1 && this.entityObj.getDistanceSq((double)this.insidePosX, this.entityObj.posY, (double)this.insidePosZ) < 4.0D) { - return false; - } else { - Village var1 = this.entityObj.worldObj.villageCollectionObj.findNearestVillage(MathHelper.floor_double(this.entityObj.posX), MathHelper.floor_double(this.entityObj.posY), MathHelper.floor_double(this.entityObj.posZ), 14); -- if(var1 == null) { -+ -+ if (var1 == null) { - return false; - } else { - this.doorInfo = var1.findNearestDoorUnrestricted(MathHelper.floor_double(this.entityObj.posX), MathHelper.floor_double(this.entityObj.posY), MathHelper.floor_double(this.entityObj.posZ)); -@@ -31,23 +35,33 @@ - } - } - -+ /** -+ * Returns whether an in-progress EntityAIBase should continue executing -+ */ - public boolean continueExecuting() { - return !this.entityObj.getNavigator().noPath(); - } - -+ /** -+ * Execute a one shot task or start executing a continuous task -+ */ - public void startExecuting() { - this.insidePosX = -1; -- if(this.entityObj.getDistanceSq((double)this.doorInfo.getInsidePosX(), (double)this.doorInfo.posY, (double)this.doorInfo.getInsidePosZ()) > 256.0D) { -+ -+ if (this.entityObj.getDistanceSq((double)this.doorInfo.getInsidePosX(), (double)this.doorInfo.posY, (double)this.doorInfo.getInsidePosZ()) > 256.0D) { - Vec3 var1 = RandomPositionGenerator.findRandomTargetBlockTowards(this.entityObj, 14, 3, this.entityObj.worldObj.getWorldVec3Pool().getVecFromPool((double)this.doorInfo.getInsidePosX() + 0.5D, (double)this.doorInfo.getInsidePosY(), (double)this.doorInfo.getInsidePosZ() + 0.5D)); -- if(var1 != null) { -+ -+ if (var1 != null) { - this.entityObj.getNavigator().tryMoveToXYZ(var1.xCoord, var1.yCoord, var1.zCoord, 1.0D); - } - } else { - this.entityObj.getNavigator().tryMoveToXYZ((double)this.doorInfo.getInsidePosX() + 0.5D, (double)this.doorInfo.getInsidePosY(), (double)this.doorInfo.getInsidePosZ() + 0.5D, 1.0D); - } -- - } - -+ /** -+ * Resets the task -+ */ - public void resetTask() { - this.insidePosX = this.doorInfo.getInsidePosX(); - this.insidePosZ = this.doorInfo.getInsidePosZ(); ---- net/minecraft/src/GuiScreenBook.java -+++ net/minecraft/src/GuiScreenBook.java -@@ -7,73 +7,93 @@ - - public class GuiScreenBook extends GuiScreen { - private static final ResourceLocation bookGuiTextures = new ResourceLocation("textures/gui/book.png"); -+ -+ /** The player editing the book */ - private final EntityPlayer editingPlayer; - private final ItemStack itemstackBook; -+ -+ /** Whether the book is signed or can still be edited */ - private final boolean bookIsUnsigned; - private boolean bookModified; - private boolean editingTitle; -+ -+ /** Update ticks since the gui was opened */ - private int updateCount; - private int bookImageWidth = 192; - private int bookImageHeight = 192; - private int bookTotalPages = 1; - private int currPage; - private NBTTagList bookPages; -- private String w = ""; -+ private String bookTitle = ""; - private GuiButtonNextPage buttonNextPage; - private GuiButtonNextPage buttonPreviousPage; - private GuiButton buttonDone; -+ -+ /** The GuiButton to sign this book. */ - private GuiButton buttonSign; - private GuiButton buttonFinalize; - private GuiButton buttonCancel; - -- public GuiScreenBook(EntityPlayer var1, ItemStack var2, boolean var3) { -- this.editingPlayer = var1; -- this.itemstackBook = var2; -- this.bookIsUnsigned = var3; -- if(var2.hasTagCompound()) { -- NBTTagCompound var4 = var2.getTagCompound(); -+ public GuiScreenBook(EntityPlayer par1EntityPlayer, ItemStack par2ItemStack, boolean par3) { -+ this.editingPlayer = par1EntityPlayer; -+ this.itemstackBook = par2ItemStack; -+ this.bookIsUnsigned = par3; -+ -+ if (par2ItemStack.hasTagCompound()) { -+ NBTTagCompound var4 = par2ItemStack.getTagCompound(); - this.bookPages = var4.getTagList("pages"); -- if(this.bookPages != null) { -+ -+ if (this.bookPages != null) { - this.bookPages = (NBTTagList)this.bookPages.copy(); - this.bookTotalPages = this.bookPages.tagCount(); -- if(this.bookTotalPages < 1) { -+ -+ if (this.bookTotalPages < 1) { - this.bookTotalPages = 1; - } - } - } - -- if(this.bookPages == null && var3) { -+ if (this.bookPages == null && par3) { - this.bookPages = new NBTTagList("pages"); - this.bookPages.appendTag(new NBTTagString("1", "")); - this.bookTotalPages = 1; - } -- - } - -+ /** -+ * Called from the main game loop to update the screen. -+ */ - public void updateScreen() { - super.updateScreen(); - ++this.updateCount; - } - -+ /** -+ * Adds the buttons (and other controls) to the screen in question. -+ */ - public void initGui() { -- this.i.clear(); -+ this.buttonList.clear(); - Keyboard.enableRepeatEvents(true); -- if(this.bookIsUnsigned) { -- this.i.add(this.buttonSign = new GuiButton(3, this.width / 2 - 100, 4 + this.bookImageHeight, 98, 20, I18n.getString("book.signButton"))); -- this.i.add(this.buttonDone = new GuiButton(0, this.width / 2 + 2, 4 + this.bookImageHeight, 98, 20, I18n.getString("gui.done"))); -- this.i.add(this.buttonFinalize = new GuiButton(5, this.width / 2 - 100, 4 + this.bookImageHeight, 98, 20, I18n.getString("book.finalizeButton"))); -- this.i.add(this.buttonCancel = new GuiButton(4, this.width / 2 + 2, 4 + this.bookImageHeight, 98, 20, I18n.getString("gui.cancel"))); -+ -+ if (this.bookIsUnsigned) { -+ this.buttonList.add(this.buttonSign = new GuiButton(3, this.width / 2 - 100, 4 + this.bookImageHeight, 98, 20, I18n.getString("book.signButton"))); -+ this.buttonList.add(this.buttonDone = new GuiButton(0, this.width / 2 + 2, 4 + this.bookImageHeight, 98, 20, I18n.getString("gui.done"))); -+ this.buttonList.add(this.buttonFinalize = new GuiButton(5, this.width / 2 - 100, 4 + this.bookImageHeight, 98, 20, I18n.getString("book.finalizeButton"))); -+ this.buttonList.add(this.buttonCancel = new GuiButton(4, this.width / 2 + 2, 4 + this.bookImageHeight, 98, 20, I18n.getString("gui.cancel"))); - } else { -- this.i.add(this.buttonDone = new GuiButton(0, this.width / 2 - 100, 4 + this.bookImageHeight, 200, 20, I18n.getString("gui.done"))); -+ this.buttonList.add(this.buttonDone = new GuiButton(0, this.width / 2 - 100, 4 + this.bookImageHeight, 200, 20, I18n.getString("gui.done"))); - } - - int var1 = (this.width - this.bookImageWidth) / 2; - byte var2 = 2; -- this.i.add(this.buttonNextPage = new GuiButtonNextPage(1, var1 + 120, var2 + 154, true)); -- this.i.add(this.buttonPreviousPage = new GuiButtonNextPage(2, var1 + 38, var2 + 154, false)); -+ this.buttonList.add(this.buttonNextPage = new GuiButtonNextPage(1, var1 + 120, var2 + 154, true)); -+ this.buttonList.add(this.buttonPreviousPage = new GuiButtonNextPage(2, var1 + 38, var2 + 154, false)); - this.updateButtons(); - } - -+ /** -+ * Called when the screen is unloaded. Used to disable keyboard repeat events -+ */ - public void onGuiClosed() { - Keyboard.enableRepeatEvents(false); - } -@@ -82,28 +102,29 @@ - this.buttonNextPage.drawButton = !this.editingTitle && (this.currPage < this.bookTotalPages - 1 || this.bookIsUnsigned); - this.buttonPreviousPage.drawButton = !this.editingTitle && this.currPage > 0; - this.buttonDone.drawButton = !this.bookIsUnsigned || !this.editingTitle; -- if(this.bookIsUnsigned) { -+ -+ if (this.bookIsUnsigned) { - this.buttonSign.drawButton = !this.editingTitle; - this.buttonCancel.drawButton = this.editingTitle; - this.buttonFinalize.drawButton = this.editingTitle; -- this.buttonFinalize.enabled = this.w.trim().length() > 0; -+ this.buttonFinalize.enabled = this.bookTitle.trim().length() > 0; - } -- - } - -- private void sendBookToServer(boolean var1) { -- if(this.bookIsUnsigned && this.bookModified) { -- if(this.bookPages != null) { -- while(this.bookPages.tagCount() > 1) { -+ private void sendBookToServer(boolean par1) { -+ if (this.bookIsUnsigned && this.bookModified) { -+ if (this.bookPages != null) { -+ while (this.bookPages.tagCount() > 1) { - NBTTagString var2 = (NBTTagString)this.bookPages.tagAt(this.bookPages.tagCount() - 1); -- if(var2.a != null && var2.a.length() != 0) { -+ -+ if (var2.data != null && var2.data.length() != 0) { - break; - } - - this.bookPages.removeTag(this.bookPages.tagCount() - 1); - } - -- if(this.itemstackBook.hasTagCompound()) { -+ if (this.itemstackBook.hasTagCompound()) { - NBTTagCompound var7 = this.itemstackBook.getTagCompound(); - var7.setTag("pages", this.bookPages); - } else { -@@ -111,10 +132,11 @@ - } - - String var8 = "MC|BEdit"; -- if(var1) { -+ -+ if (par1) { - var8 = "MC|BSign"; - this.itemstackBook.setTagInfo("author", new NBTTagString("author", this.editingPlayer.getCommandSenderName())); -- this.itemstackBook.setTagInfo("title", new NBTTagString("title", this.w.trim())); -+ this.itemstackBook.setTagInfo("title", new NBTTagString("title", this.bookTitle.trim())); - this.itemstackBook.itemID = Item.writtenBook.itemID; - } - -@@ -128,34 +150,37 @@ - var6.printStackTrace(); - } - } -- - } - } - -- protected void actionPerformed(GuiButton var1) { -- if(var1.enabled) { -- if(var1.id == 0) { -+ /** -+ * Fired when a control is clicked. This is the equivalent of ActionListener.actionPerformed(ActionEvent e). -+ */ -+ protected void actionPerformed(GuiButton par1GuiButton) { -+ if (par1GuiButton.enabled) { -+ if (par1GuiButton.id == 0) { - this.mc.displayGuiScreen((GuiScreen)null); - this.sendBookToServer(false); -- } else if(var1.id == 3 && this.bookIsUnsigned) { -+ } else if (par1GuiButton.id == 3 && this.bookIsUnsigned) { - this.editingTitle = true; -- } else if(var1.id == 1) { -- if(this.currPage < this.bookTotalPages - 1) { -+ } else if (par1GuiButton.id == 1) { -+ if (this.currPage < this.bookTotalPages - 1) { - ++this.currPage; -- } else if(this.bookIsUnsigned) { -+ } else if (this.bookIsUnsigned) { - this.addNewPage(); -- if(this.currPage < this.bookTotalPages - 1) { -+ -+ if (this.currPage < this.bookTotalPages - 1) { - ++this.currPage; - } - } -- } else if(var1.id == 2) { -- if(this.currPage > 0) { -+ } else if (par1GuiButton.id == 2) { -+ if (this.currPage > 0) { - --this.currPage; - } -- } else if(var1.id == 5 && this.editingTitle) { -+ } else if (par1GuiButton.id == 5 && this.editingTitle) { - this.sendBookToServer(true); - this.mc.displayGuiScreen((GuiScreen)null); -- } else if(var1.id == 4 && this.editingTitle) { -+ } else if (par1GuiButton.id == 4 && this.editingTitle) { - this.editingTitle = false; - } - -@@ -164,80 +189,91 @@ - } - - private void addNewPage() { -- if(this.bookPages != null && this.bookPages.tagCount() < 50) { -+ if (this.bookPages != null && this.bookPages.tagCount() < 50) { - this.bookPages.appendTag(new NBTTagString("" + (this.bookTotalPages + 1), "")); - ++this.bookTotalPages; - this.bookModified = true; - } - } - -- protected void keyTyped(char var1, int var2) { -- super.keyTyped(var1, var2); -- if(this.bookIsUnsigned) { -- if(this.editingTitle) { -- this.func_74162_c(var1, var2); -+ /** -+ * Fired when a key is typed. This is the equivalent of KeyListener.keyTyped(KeyEvent e). -+ */ -+ protected void keyTyped(char par1, int par2) { -+ super.keyTyped(par1, par2); -+ -+ if (this.bookIsUnsigned) { -+ if (this.editingTitle) { -+ this.func_74162_c(par1, par2); - } else { -- this.keyTypedInBook(var1, var2); -+ this.keyTypedInBook(par1, par2); - } -- -- } -- } -- -- private void keyTypedInBook(char var1, int var2) { -- switch(var1) { -- case '\u0016': -- this.func_74160_b(GuiScreen.getClipboardString()); -- return; -- default: -- switch(var2) { -+ } -+ } -+ -+ /** -+ * Processes keystrokes when editing the text of a book -+ */ -+ private void keyTypedInBook(char par1, int par2) { -+ switch (par1) { -+ case 22: -+ this.func_74160_b(GuiScreen.getClipboardString()); -+ return; -+ -+ default: -+ switch (par2) { -+ case 14: -+ String var3 = this.func_74158_i(); -+ -+ if (var3.length() > 0) { -+ this.func_74159_a(var3.substring(0, var3.length() - 1)); -+ } -+ -+ return; -+ -+ case 28: -+ case 156: -+ this.func_74160_b("\n"); -+ return; -+ -+ default: -+ if (ChatAllowedCharacters.isAllowedCharacter(par1)) { -+ this.func_74160_b(Character.toString(par1)); -+ } -+ } -+ } -+ } -+ -+ private void func_74162_c(char par1, int par2) { -+ switch (par2) { - case 14: -- String var3 = this.func_74158_i(); -- if(var3.length() > 0) { -- this.func_74159_a(var3.substring(0, var3.length() - 1)); -+ if (!this.bookTitle.isEmpty()) { -+ this.bookTitle = this.bookTitle.substring(0, this.bookTitle.length() - 1); -+ this.updateButtons(); - } - - return; -+ - case 28: - case 156: -- this.func_74160_b("\n"); -+ if (!this.bookTitle.isEmpty()) { -+ this.sendBookToServer(true); -+ this.mc.displayGuiScreen((GuiScreen)null); -+ } -+ - return; -+ - default: -- if(ChatAllowedCharacters.isAllowedCharacter(var1)) { -- this.func_74160_b(Character.toString(var1)); -+ if (this.bookTitle.length() < 16 && ChatAllowedCharacters.isAllowedCharacter(par1)) { -+ this.bookTitle = this.bookTitle + Character.toString(par1); -+ this.updateButtons(); -+ this.bookModified = true; - } -- } -- } -- } -- -- private void func_74162_c(char var1, int var2) { -- switch(var2) { -- case 14: -- if(!this.w.isEmpty()) { -- this.w = this.w.substring(0, this.w.length() - 1); -- this.updateButtons(); -- } -- -- return; -- case 28: -- case 156: -- if(!this.w.isEmpty()) { -- this.sendBookToServer(true); -- this.mc.displayGuiScreen((GuiScreen)null); -- } -- -- return; -- default: -- if(this.w.length() < 16 && ChatAllowedCharacters.isAllowedCharacter(var1)) { -- this.w = this.w + Character.toString(var1); -- this.updateButtons(); -- this.bookModified = true; -- } -- - } - } - - private String func_74158_i() { -- if(this.bookPages != null && this.currPage >= 0 && this.currPage < this.bookPages.tagCount()) { -+ if (this.bookPages != null && this.currPage >= 0 && this.currPage < this.bookPages.tagCount()) { - NBTTagString var1 = (NBTTagString)this.bookPages.tagAt(this.currPage); - return var1.toString(); - } else { -@@ -245,26 +281,28 @@ - } - } - -- private void func_74159_a(String var1) { -- if(this.bookPages != null && this.currPage >= 0 && this.currPage < this.bookPages.tagCount()) { -+ private void func_74159_a(String par1Str) { -+ if (this.bookPages != null && this.currPage >= 0 && this.currPage < this.bookPages.tagCount()) { - NBTTagString var2 = (NBTTagString)this.bookPages.tagAt(this.currPage); -- var2.a = var1; -+ var2.data = par1Str; - this.bookModified = true; - } -- - } - -- private void func_74160_b(String var1) { -+ private void func_74160_b(String par1Str) { - String var2 = this.func_74158_i(); -- String var3 = var2 + var1; -+ String var3 = var2 + par1Str; - int var4 = this.fontRenderer.splitStringWidth(var3 + "" + EnumChatFormatting.BLACK + "_", 118); -- if(var4 <= 118 && var3.length() < 256) { -+ -+ if (var4 <= 118 && var3.length() < 256) { - this.func_74159_a(var3); - } -- - } - -- public void drawScreen(int var1, int var2, float var3) { -+ /** -+ * Draws the screen and all the components in it. -+ */ -+ public void drawScreen(int par1, int par2, float par3) { - GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - this.mc.getTextureManager().bindTexture(bookGuiTextures); - int var4 = (this.width - this.bookImageWidth) / 2; -@@ -273,10 +311,12 @@ - String var6; - String var7; - int var8; -- if(this.editingTitle) { -- var6 = this.w; -- if(this.bookIsUnsigned) { -- if(this.updateCount / 6 % 2 == 0) { -+ -+ if (this.editingTitle) { -+ var6 = this.bookTitle; -+ -+ if (this.bookIsUnsigned) { -+ if (this.updateCount / 6 % 2 == 0) { - var6 = var6 + "" + EnumChatFormatting.BLACK + "_"; - } else { - var6 = var6 + "" + EnumChatFormatting.GRAY + "_"; -@@ -288,23 +328,24 @@ - this.fontRenderer.drawString(var7, var4 + 36 + (116 - var8) / 2, var5 + 16 + 16, 0); - int var9 = this.fontRenderer.getStringWidth(var6); - this.fontRenderer.drawString(var6, var4 + 36 + (116 - var9) / 2, var5 + 48, 0); -- String var10 = String.format(I18n.getString("book.byAuthor"), new Object[]{this.editingPlayer.getCommandSenderName()}); -+ String var10 = String.format(I18n.getString("book.byAuthor"), new Object[] {this.editingPlayer.getCommandSenderName()}); - int var11 = this.fontRenderer.getStringWidth(var10); - this.fontRenderer.drawString(EnumChatFormatting.DARK_GRAY + var10, var4 + 36 + (116 - var11) / 2, var5 + 48 + 10, 0); - String var12 = I18n.getString("book.finalizeWarning"); - this.fontRenderer.drawSplitString(var12, var4 + 36, var5 + 80, 116, 0); - } else { -- var6 = String.format(I18n.getString("book.pageIndicator"), new Object[]{Integer.valueOf(this.currPage + 1), Integer.valueOf(this.bookTotalPages)}); -+ var6 = String.format(I18n.getString("book.pageIndicator"), new Object[] {Integer.valueOf(this.currPage + 1), Integer.valueOf(this.bookTotalPages)}); - var7 = ""; -- if(this.bookPages != null && this.currPage >= 0 && this.currPage < this.bookPages.tagCount()) { -+ -+ if (this.bookPages != null && this.currPage >= 0 && this.currPage < this.bookPages.tagCount()) { - NBTTagString var13 = (NBTTagString)this.bookPages.tagAt(this.currPage); - var7 = var13.toString(); - } - -- if(this.bookIsUnsigned) { -- if(this.fontRenderer.getBidiFlag()) { -+ if (this.bookIsUnsigned) { -+ if (this.fontRenderer.getBidiFlag()) { - var7 = var7 + "_"; -- } else if(this.updateCount / 6 % 2 == 0) { -+ } else if (this.updateCount / 6 % 2 == 0) { - var7 = var7 + "" + EnumChatFormatting.BLACK + "_"; - } else { - var7 = var7 + "" + EnumChatFormatting.GRAY + "_"; -@@ -316,7 +357,7 @@ - this.fontRenderer.drawSplitString(var7, var4 + 36, var5 + 16 + 16, 116, 0); - } - -- super.drawScreen(var1, var2, var3); -+ super.drawScreen(par1, par2, par3); - } - - static ResourceLocation func_110404_g() { ---- net/minecraft/src/BlockReed.java -+++ net/minecraft/src/BlockReed.java -@@ -3,74 +3,111 @@ - import java.util.Random; - - public class BlockReed extends Block { -- protected BlockReed(int var1) { -- super(var1, Material.plants); -- float var2 = 6.0F / 16.0F; -+ protected BlockReed(int par1) { -+ super(par1, Material.plants); -+ float var2 = 0.375F; - this.setBlockBounds(0.5F - var2, 0.0F, 0.5F - var2, 0.5F + var2, 1.0F, 0.5F + var2); - this.setTickRandomly(true); - } - -- public void updateTick(World var1, int var2, int var3, int var4, Random var5) { -- if(var1.isAirBlock(var2, var3 + 1, var4)) { -+ /** -+ * Ticks the block if it's been scheduled -+ */ -+ public void updateTick(World par1World, int par2, int par3, int par4, Random par5Random) { -+ if (par1World.isAirBlock(par2, par3 + 1, par4)) { - int var6; -- for(var6 = 1; var1.getBlockId(var2, var3 - var6, var4) == this.blockID; ++var6) { -+ -+ for (var6 = 1; par1World.getBlockId(par2, par3 - var6, par4) == this.blockID; ++var6) { -+ ; - } - -- if(var6 < 3) { -- int var7 = var1.getBlockMetadata(var2, var3, var4); -- if(var7 == 15) { -- var1.setBlock(var2, var3 + 1, var4, this.blockID); -- var1.setBlockMetadata(var2, var3, var4, 0, 4); -+ if (var6 < 3) { -+ int var7 = par1World.getBlockMetadata(par2, par3, par4); -+ -+ if (var7 == 15) { -+ par1World.setBlock(par2, par3 + 1, par4, this.blockID); -+ par1World.setBlockMetadataWithNotify(par2, par3, par4, 0, 4); - } else { -- var1.setBlockMetadata(var2, var3, var4, var7 + 1, 4); -+ par1World.setBlockMetadataWithNotify(par2, par3, par4, var7 + 1, 4); - } - } - } -- -- } -- -- public boolean canPlaceBlockAt(World var1, int var2, int var3, int var4) { -- int var5 = var1.getBlockId(var2, var3 - 1, var4); -- return var5 == this.blockID ? true : (var5 != Block.grass.blockID && var5 != Block.dirt.blockID && var5 != Block.sand.blockID ? false : (var1.getBlockMaterial(var2 - 1, var3 - 1, var4) == Material.water ? true : (var1.getBlockMaterial(var2 + 1, var3 - 1, var4) == Material.water ? true : (var1.getBlockMaterial(var2, var3 - 1, var4 - 1) == Material.water ? true : var1.getBlockMaterial(var2, var3 - 1, var4 + 1) == Material.water)))); -- } -- -- public void onNeighborBlockChange(World var1, int var2, int var3, int var4, int var5) { -- this.checkBlockCoordValid(var1, var2, var3, var4); -- } -- -- protected final void checkBlockCoordValid(World var1, int var2, int var3, int var4) { -- if(!this.canBlockStay(var1, var2, var3, var4)) { -- this.dropBlockAsItem(var1, var2, var3, var4, var1.getBlockMetadata(var2, var3, var4), 0); -- var1.setBlockToAir(var2, var3, var4); -+ } -+ -+ /** -+ * Checks to see if its valid to put this block at the specified coordinates. Args: world, x, y, z -+ */ -+ public boolean canPlaceBlockAt(World par1World, int par2, int par3, int par4) { -+ int var5 = par1World.getBlockId(par2, par3 - 1, par4); -+ return var5 == this.blockID ? true : (var5 != Block.grass.blockID && var5 != Block.dirt.blockID && var5 != Block.sand.blockID ? false : (par1World.getBlockMaterial(par2 - 1, par3 - 1, par4) == Material.water ? true : (par1World.getBlockMaterial(par2 + 1, par3 - 1, par4) == Material.water ? true : (par1World.getBlockMaterial(par2, par3 - 1, par4 - 1) == Material.water ? true : par1World.getBlockMaterial(par2, par3 - 1, par4 + 1) == Material.water)))); -+ } -+ -+ /** -+ * Lets the block know when one of its neighbor changes. Doesn't know which neighbor changed (coordinates passed are -+ * their own) Args: x, y, z, neighbor blockID -+ */ -+ public void onNeighborBlockChange(World par1World, int par2, int par3, int par4, int par5) { -+ this.checkBlockCoordValid(par1World, par2, par3, par4); -+ } -+ -+ /** -+ * Checks if current block pos is valid, if not, breaks the block as dropable item. Used for reed and cactus. -+ */ -+ protected final void checkBlockCoordValid(World par1World, int par2, int par3, int par4) { -+ if (!this.canBlockStay(par1World, par2, par3, par4)) { -+ this.dropBlockAsItem(par1World, par2, par3, par4, par1World.getBlockMetadata(par2, par3, par4), 0); -+ par1World.setBlockToAir(par2, par3, par4); - } -- -- } -- -- public boolean canBlockStay(World var1, int var2, int var3, int var4) { -- return this.canPlaceBlockAt(var1, var2, var3, var4); -- } -- -- public AxisAlignedBB getCollisionBoundingBoxFromPool(World var1, int var2, int var3, int var4) { -+ } -+ -+ /** -+ * Can this block stay at this position. Similar to canPlaceBlockAt except gets checked often with plants. -+ */ -+ public boolean canBlockStay(World par1World, int par2, int par3, int par4) { -+ return this.canPlaceBlockAt(par1World, par2, par3, par4); -+ } -+ -+ /** -+ * Returns a bounding box from the pool of bounding boxes (this means this box can change after the pool has been -+ * cleared to be reused) -+ */ -+ public AxisAlignedBB getCollisionBoundingBoxFromPool(World par1World, int par2, int par3, int par4) { - return null; - } - -- public int idDropped(int var1, Random var2, int var3) { -+ /** -+ * Returns the ID of the items to drop on destruction. -+ */ -+ public int idDropped(int par1, Random par2Random, int par3) { - return Item.reed.itemID; - } - -+ /** -+ * Is this block (a) opaque and (b) a full 1m cube? This determines whether or not to render the shared face of two -+ * adjacent blocks and also whether the player can attach torches, redstone wire, etc to this block. -+ */ - public boolean isOpaqueCube() { - return false; - } - -+ /** -+ * If this block doesn't render as an ordinary block it will return False (examples: signs, buttons, stairs, etc) -+ */ - public boolean renderAsNormalBlock() { - return false; - } - -+ /** -+ * The type of render function that is called for this block -+ */ - public int getRenderType() { - return 1; - } - -- public int idPicked(World var1, int var2, int var3, int var4) { -+ /** -+ * only called by clickMiddleMouseButton , and passed to inventory.setCurrentItem (along with isCreative) -+ */ -+ public int idPicked(World par1World, int par2, int par3, int par4) { - return Item.reed.itemID; - } - } ---- net/minecraft/src/RenderBiped.java -+++ net/minecraft/src/RenderBiped.java -@@ -1,7 +1,9 @@ - package net.minecraft.src; - --import com.google.common.collect.Maps; - import java.util.Map; -+ -+import com.google.common.collect.Maps; -+ - import org.lwjgl.opengl.GL11; - - public class RenderBiped extends RenderLiving { -@@ -9,17 +11,19 @@ - protected float field_77070_b; - protected ModelBiped field_82423_g; - protected ModelBiped field_82425_h; -- private static final Map k = Maps.newHashMap(); -- private static final String[] l = new String[]{"leather", "chainmail", "iron", "diamond", "gold"}; -- -- public RenderBiped(ModelBiped var1, float var2) { -- this(var1, var2, 1.0F); -+ private static final Map field_110859_k = Maps.newHashMap(); -+ -+ /** List of armor texture filenames. */ -+ private static final String[] bipedArmorFilenamePrefix = new String[] {"leather", "chainmail", "iron", "diamond", "gold"}; -+ -+ public RenderBiped(ModelBiped par1ModelBiped, float par2) { -+ this(par1ModelBiped, par2, 1.0F); - } - -- public RenderBiped(ModelBiped var1, float var2, float var3) { -- super(var1, var2); -- this.modelBipedMain = var1; -- this.field_77070_b = var3; -+ public RenderBiped(ModelBiped par1ModelBiped, float par2, float par3) { -+ super(par1ModelBiped, par2); -+ this.modelBipedMain = par1ModelBiped; -+ this.field_77070_b = par3; - this.func_82421_b(); - } - -@@ -28,48 +32,53 @@ - this.field_82425_h = new ModelBiped(0.5F); - } - -- public static ResourceLocation func_110857_a(ItemArmor var0, int var1) { -- return func_110858_a(var0, var1, (String)null); -+ public static ResourceLocation func_110857_a(ItemArmor par0ItemArmor, int par1) { -+ return func_110858_a(par0ItemArmor, par1, (String)null); - } - -- public static ResourceLocation func_110858_a(ItemArmor var0, int var1, String var2) { -- String var3 = String.format("textures/models/armor/%s_layer_%d%s.png", new Object[]{l[var0.renderIndex], Integer.valueOf(var1 == 2 ? 2 : 1), var2 == null ? "" : String.format("_%s", new Object[]{var2})}); -- ResourceLocation var4 = (ResourceLocation)k.get(var3); -- if(var4 == null) { -+ public static ResourceLocation func_110858_a(ItemArmor par0ItemArmor, int par1, String par2Str) { -+ String var3 = String.format("textures/models/armor/%s_layer_%d%s.png", new Object[] {bipedArmorFilenamePrefix[par0ItemArmor.renderIndex], Integer.valueOf(par1 == 2 ? 2 : 1), par2Str == null ? "" : String.format("_%s", new Object[]{par2Str})}); -+ ResourceLocation var4 = (ResourceLocation)field_110859_k.get(var3); -+ -+ if (var4 == null) { - var4 = new ResourceLocation(var3); -- k.put(var3, var4); -+ field_110859_k.put(var3, var4); - } - - return var4; - } - -- protected int func_130006_a(EntityLiving var1, int var2, float var3) { -- ItemStack var4 = var1.func_130225_q(3 - var2); -- if(var4 != null) { -+ protected int func_130006_a(EntityLiving par1EntityLiving, int par2, float par3) { -+ ItemStack var4 = par1EntityLiving.func_130225_q(3 - par2); -+ -+ if (var4 != null) { - Item var5 = var4.getItem(); -- if(var5 instanceof ItemArmor) { -+ -+ if (var5 instanceof ItemArmor) { - ItemArmor var6 = (ItemArmor)var5; -- this.bindTexture(func_110857_a(var6, var2)); -- ModelBiped var7 = var2 == 2 ? this.field_82425_h : this.field_82423_g; -- var7.bipedHead.showModel = var2 == 0; -- var7.bipedHeadwear.showModel = var2 == 0; -- var7.bipedBody.showModel = var2 == 1 || var2 == 2; -- var7.bipedRightArm.showModel = var2 == 1; -- var7.bipedLeftArm.showModel = var2 == 1; -- var7.bipedRightLeg.showModel = var2 == 2 || var2 == 3; -- var7.bipedLeftLeg.showModel = var2 == 2 || var2 == 3; -+ this.bindTexture(func_110857_a(var6, par2)); -+ ModelBiped var7 = par2 == 2 ? this.field_82425_h : this.field_82423_g; -+ var7.bipedHead.showModel = par2 == 0; -+ var7.bipedHeadwear.showModel = par2 == 0; -+ var7.bipedBody.showModel = par2 == 1 || par2 == 2; -+ var7.bipedRightArm.showModel = par2 == 1; -+ var7.bipedLeftArm.showModel = par2 == 1; -+ var7.bipedRightLeg.showModel = par2 == 2 || par2 == 3; -+ var7.bipedLeftLeg.showModel = par2 == 2 || par2 == 3; - this.setRenderPassModel(var7); - var7.onGround = this.mainModel.onGround; - var7.isRiding = this.mainModel.isRiding; - var7.isChild = this.mainModel.isChild; - float var8 = 1.0F; -- if(var6.getArmorMaterial() == EnumArmorMaterial.CLOTH) { -+ -+ if (var6.getArmorMaterial() == EnumArmorMaterial.CLOTH) { - int var9 = var6.getColor(var4); - float var10 = (float)(var9 >> 16 & 255) / 255.0F; - float var11 = (float)(var9 >> 8 & 255) / 255.0F; - float var12 = (float)(var9 & 255) / 255.0F; - GL11.glColor3f(var8 * var10, var8 * var11, var8 * var12); -- if(var4.isItemEnchanted()) { -+ -+ if (var4.isItemEnchanted()) { - return 31; - } - -@@ -77,7 +86,8 @@ - } - - GL11.glColor3f(var8, var8, var8); -- if(var4.isItemEnchanted()) { -+ -+ if (var4.isItemEnchanted()) { - return 15; - } - -@@ -88,68 +98,73 @@ - return -1; - } - -- protected void func_130013_c(EntityLiving var1, int var2, float var3) { -- ItemStack var4 = var1.func_130225_q(3 - var2); -- if(var4 != null) { -+ protected void func_130013_c(EntityLiving par1EntityLiving, int par2, float par3) { -+ ItemStack var4 = par1EntityLiving.func_130225_q(3 - par2); -+ -+ if (var4 != null) { - Item var5 = var4.getItem(); -- if(var5 instanceof ItemArmor) { -- this.bindTexture(func_110858_a((ItemArmor)var5, var2, "overlay")); -+ -+ if (var5 instanceof ItemArmor) { -+ this.bindTexture(func_110858_a((ItemArmor)var5, par2, "overlay")); - float var6 = 1.0F; - GL11.glColor3f(var6, var6, var6); - } - } -- - } - -- public void doRenderLiving(EntityLiving var1, double var2, double var4, double var6, float var8, float var9) { -+ public void doRenderLiving(EntityLiving par1EntityLiving, double par2, double par4, double par6, float par8, float par9) { - float var10 = 1.0F; - GL11.glColor3f(var10, var10, var10); -- ItemStack var11 = var1.getHeldItem(); -- this.func_82420_a(var1, var11); -- double var12 = var4 - (double)var1.yOffset; -- if(var1.isSneaking()) { -+ ItemStack var11 = par1EntityLiving.getHeldItem(); -+ this.func_82420_a(par1EntityLiving, var11); -+ double var12 = par4 - (double)par1EntityLiving.yOffset; -+ -+ if (par1EntityLiving.isSneaking()) { - var12 -= 0.125D; - } - -- super.doRenderLiving(var1, var2, var12, var6, var8, var9); -+ super.doRenderLiving(par1EntityLiving, par2, var12, par6, par8, par9); - this.field_82423_g.aimedBow = this.field_82425_h.aimedBow = this.modelBipedMain.aimedBow = false; - this.field_82423_g.isSneak = this.field_82425_h.isSneak = this.modelBipedMain.isSneak = false; - this.field_82423_g.heldItemRight = this.field_82425_h.heldItemRight = this.modelBipedMain.heldItemRight = 0; - } - -- protected ResourceLocation func_110856_a(EntityLiving var1) { -+ protected ResourceLocation func_110856_a(EntityLiving par1EntityLiving) { - return null; - } - -- protected void func_82420_a(EntityLiving var1, ItemStack var2) { -- this.field_82423_g.heldItemRight = this.field_82425_h.heldItemRight = this.modelBipedMain.heldItemRight = var2 != null ? 1 : 0; -- this.field_82423_g.isSneak = this.field_82425_h.isSneak = this.modelBipedMain.isSneak = var1.isSneaking(); -+ protected void func_82420_a(EntityLiving par1EntityLiving, ItemStack par2ItemStack) { -+ this.field_82423_g.heldItemRight = this.field_82425_h.heldItemRight = this.modelBipedMain.heldItemRight = par2ItemStack != null ? 1 : 0; -+ this.field_82423_g.isSneak = this.field_82425_h.isSneak = this.modelBipedMain.isSneak = par1EntityLiving.isSneaking(); - } - -- protected void func_130005_c(EntityLiving var1, float var2) { -+ protected void func_130005_c(EntityLiving par1EntityLiving, float par2) { - float var3 = 1.0F; - GL11.glColor3f(var3, var3, var3); -- super.renderEquippedItems(var1, var2); -- ItemStack var4 = var1.getHeldItem(); -- ItemStack var5 = var1.func_130225_q(3); -+ super.renderEquippedItems(par1EntityLiving, par2); -+ ItemStack var4 = par1EntityLiving.getHeldItem(); -+ ItemStack var5 = par1EntityLiving.func_130225_q(3); - float var6; -- if(var5 != null) { -+ -+ if (var5 != null) { - GL11.glPushMatrix(); -- this.modelBipedMain.bipedHead.postRender(1.0F / 16.0F); -- if(var5.getItem().itemID < 256) { -- if(RenderBlocks.renderItemIn3d(Block.blocksList[var5.itemID].getRenderType())) { -- var6 = 10.0F / 16.0F; -+ this.modelBipedMain.bipedHead.postRender(0.0625F); -+ -+ if (var5.getItem().itemID < 256) { -+ if (RenderBlocks.renderItemIn3d(Block.blocksList[var5.itemID].getRenderType())) { -+ var6 = 0.625F; - GL11.glTranslatef(0.0F, -0.25F, 0.0F); - GL11.glRotatef(90.0F, 0.0F, 1.0F, 0.0F); - GL11.glScalef(var6, -var6, -var6); - } - -- this.renderManager.itemRenderer.renderItem(var1, var5, 0); -- } else if(var5.getItem().itemID == Item.skull.itemID) { -+ this.renderManager.itemRenderer.renderItem(par1EntityLiving, var5, 0); -+ } else if (var5.getItem().itemID == Item.skull.itemID) { - var6 = 1.0625F; - GL11.glScalef(var6, -var6, -var6); - String var7 = ""; -- if(var5.hasTagCompound() && var5.getTagCompound().hasKey("SkullOwner")) { -+ -+ if (var5.hasTagCompound() && var5.getTagCompound().hasKey("SkullOwner")) { - var7 = var5.getTagCompound().getString("SkullOwner"); - } - -@@ -159,36 +174,39 @@ - GL11.glPopMatrix(); - } - -- if(var4 != null) { -+ if (var4 != null) { - GL11.glPushMatrix(); -- if(this.mainModel.isChild) { -+ -+ if (this.mainModel.isChild) { - var6 = 0.5F; -- GL11.glTranslatef(0.0F, 10.0F / 16.0F, 0.0F); -+ GL11.glTranslatef(0.0F, 0.625F, 0.0F); - GL11.glRotatef(-20.0F, -1.0F, 0.0F, 0.0F); - GL11.glScalef(var6, var6, var6); - } - -- this.modelBipedMain.bipedRightArm.postRender(1.0F / 16.0F); -- GL11.glTranslatef(-(1.0F / 16.0F), 7.0F / 16.0F, 1.0F / 16.0F); -- if(var4.itemID < 256 && RenderBlocks.renderItemIn3d(Block.blocksList[var4.itemID].getRenderType())) { -+ this.modelBipedMain.bipedRightArm.postRender(0.0625F); -+ GL11.glTranslatef(-0.0625F, 0.4375F, 0.0625F); -+ -+ if (var4.itemID < 256 && RenderBlocks.renderItemIn3d(Block.blocksList[var4.itemID].getRenderType())) { - var6 = 0.5F; -- GL11.glTranslatef(0.0F, 3.0F / 16.0F, -(5.0F / 16.0F)); -- var6 *= 12.0F / 16.0F; -+ GL11.glTranslatef(0.0F, 0.1875F, -0.3125F); -+ var6 *= 0.75F; - GL11.glRotatef(20.0F, 1.0F, 0.0F, 0.0F); - GL11.glRotatef(45.0F, 0.0F, 1.0F, 0.0F); - GL11.glScalef(-var6, -var6, var6); -- } else if(var4.itemID == Item.bow.itemID) { -- var6 = 10.0F / 16.0F; -- GL11.glTranslatef(0.0F, 2.0F / 16.0F, 5.0F / 16.0F); -+ } else if (var4.itemID == Item.bow.itemID) { -+ var6 = 0.625F; -+ GL11.glTranslatef(0.0F, 0.125F, 0.3125F); - GL11.glRotatef(-20.0F, 0.0F, 1.0F, 0.0F); - GL11.glScalef(var6, -var6, var6); - GL11.glRotatef(-100.0F, 1.0F, 0.0F, 0.0F); - GL11.glRotatef(45.0F, 0.0F, 1.0F, 0.0F); -- } else if(Item.itemsList[var4.itemID].isFull3D()) { -- var6 = 10.0F / 16.0F; -- if(Item.itemsList[var4.itemID].shouldRotateAroundWhenRendering()) { -+ } else if (Item.itemsList[var4.itemID].isFull3D() || var4.itemID == Item.flint.itemID && org.spoutcraft.api.material.MaterialData.getCustomItem(var4.getItemDamage()) instanceof org.spoutcraft.api.material.Tool) { -+ var6 = 0.625F; -+ -+ if (Item.itemsList[var4.itemID].shouldRotateAroundWhenRendering()) { - GL11.glRotatef(180.0F, 0.0F, 0.0F, 1.0F); -- GL11.glTranslatef(0.0F, -(2.0F / 16.0F), 0.0F); -+ GL11.glTranslatef(0.0F, -0.125F, 0.0F); - } - - this.func_82422_c(); -@@ -196,49 +214,61 @@ - GL11.glRotatef(-100.0F, 1.0F, 0.0F, 0.0F); - GL11.glRotatef(45.0F, 0.0F, 1.0F, 0.0F); - } else { -- var6 = 6.0F / 16.0F; -- GL11.glTranslatef(0.25F, 3.0F / 16.0F, -(3.0F / 16.0F)); -+ var6 = 0.375F; -+ GL11.glTranslatef(0.25F, 0.1875F, -0.1875F); - GL11.glScalef(var6, var6, var6); - GL11.glRotatef(60.0F, 0.0F, 0.0F, 1.0F); - GL11.glRotatef(-90.0F, 1.0F, 0.0F, 0.0F); - GL11.glRotatef(20.0F, 0.0F, 0.0F, 1.0F); - } - -- this.renderManager.itemRenderer.renderItem(var1, var4, 0); -- if(var4.getItem().requiresMultipleRenderPasses()) { -- this.renderManager.itemRenderer.renderItem(var1, var4, 1); -+ this.renderManager.itemRenderer.renderItem(par1EntityLiving, var4, 0); -+ -+ if (var4.getItem().requiresMultipleRenderPasses()) { -+ this.renderManager.itemRenderer.renderItem(par1EntityLiving, var4, 1); - } - - GL11.glPopMatrix(); - } -- - } - - protected void func_82422_c() { -- GL11.glTranslatef(0.0F, 3.0F / 16.0F, 0.0F); -- } -- -- protected void func_82439_b(EntityLivingBase var1, int var2, float var3) { -- this.func_130013_c((EntityLiving)var1, var2, var3); -- } -- -- protected int shouldRenderPass(EntityLivingBase var1, int var2, float var3) { -- return this.func_130006_a((EntityLiving)var1, var2, var3); -- } -- -- protected void renderEquippedItems(EntityLivingBase var1, float var2) { -- this.func_130005_c((EntityLiving)var1, var2); -- } -- -- public void renderPlayer(EntityLivingBase var1, double var2, double var4, double var6, float var8, float var9) { -- this.doRenderLiving((EntityLiving)var1, var2, var4, var6, var8, var9); -- } -- -- protected ResourceLocation getEntityTexture(Entity var1) { -- return this.func_110856_a((EntityLiving)var1); -- } -- -- public void doRender(Entity var1, double var2, double var4, double var6, float var8, float var9) { -- this.doRenderLiving((EntityLiving)var1, var2, var4, var6, var8, var9); -+ GL11.glTranslatef(0.0F, 0.1875F, 0.0F); -+ } -+ -+ protected void func_82439_b(EntityLivingBase par1EntityLivingBase, int par2, float par3) { -+ this.func_130013_c((EntityLiving)par1EntityLivingBase, par2, par3); -+ } -+ -+ /** -+ * Queries whether should render the specified pass or not. -+ */ -+ protected int shouldRenderPass(EntityLivingBase par1EntityLivingBase, int par2, float par3) { -+ return this.func_130006_a((EntityLiving)par1EntityLivingBase, par2, par3); -+ } -+ -+ protected void renderEquippedItems(EntityLivingBase par1EntityLivingBase, float par2) { -+ this.func_130005_c((EntityLiving)par1EntityLivingBase, par2); -+ } -+ -+ public void renderPlayer(EntityLivingBase par1EntityLivingBase, double par2, double par4, double par6, float par8, float par9) { -+ this.doRenderLiving((EntityLiving)par1EntityLivingBase, par2, par4, par6, par8, par9); -+ } -+ -+ /** -+ * Returns the location of an entity's texture. Doesn't seem to be called unless you call Render.bindEntityTexture. -+ */ -+ protected ResourceLocation getEntityTexture(Entity par1Entity) { -+ return this.func_110856_a((EntityLiving)par1Entity); -+ } -+ -+ /** -+ * Actually renders the given argument. This is a synthetic bridge method, always casting down its argument and then -+ * handing it off to a worker function which does the actual work. In all probabilty, the class Render is generic -+ * (Render -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.client; -+ -+import java.util.Comparator; -+ -+import net.minecraft.src.ItemStack; -+ -+import org.spoutcraft.api.material.MaterialData; -+ -+public class MCItemStackComparator implements Comparator { -+ final boolean byName; -+ public MCItemStackComparator() { -+ this(false); -+ } -+ public MCItemStackComparator(boolean byName) { -+ this.byName = byName; -+ } -+ public int compare(ItemStack o1, ItemStack o2) { -+ if (o1 == null && o2 == null) { -+ return 0; -+ } -+ if (o1 != null && o2 == null) { -+ return o1.itemID; -+ } -+ if (o2 != null && o1 == null) { -+ return -o2.itemID; -+ } -+ if (byName) { -+ org.spoutcraft.api.material.Material other1 = MaterialData.getMaterial(o1.itemID, (short)(o1.getItemDamage())); -+ org.spoutcraft.api.material.Material other2 = MaterialData.getMaterial(o2.itemID, (short)(o2.getItemDamage())); -+ if (other1 == null && other2 == null) { -+ return 0; -+ } -+ if (other1 != null && other2 == null) { -+ return o1.itemID; -+ } -+ if (other2 != null && other1 == null) { -+ return -o2.itemID; -+ } -+ return other1.getName().compareTo(other2.getName()); -+ } else { -+ int idDiff = o1.itemID - o2.itemID; -+ int dataDiff = o1.getItemDamage() - o2.getItemDamage(); -+ return idDiff * 1000 - dataDiff; -+ } -+ } -+ -+ public int compare(Object o1, Object o2) { -+ return compare((ItemStack)o1, (ItemStack)o2); -+ } -+} ---- net/minecraft/src/ContainerBrewingStand.java -+++ net/minecraft/src/ContainerBrewingStand.java -@@ -2,40 +2,51 @@ - - public class ContainerBrewingStand extends Container { - private TileEntityBrewingStand tileBrewingStand; -+ -+ /** Instance of Slot. */ - private final Slot theSlot; - private int brewTime; - -- public ContainerBrewingStand(InventoryPlayer var1, TileEntityBrewingStand var2) { -- this.tileBrewingStand = var2; -- this.addSlotToContainer(new SlotBrewingStandPotion(var1.player, var2, 0, 56, 46)); -- this.addSlotToContainer(new SlotBrewingStandPotion(var1.player, var2, 1, 79, 53)); -- this.addSlotToContainer(new SlotBrewingStandPotion(var1.player, var2, 2, 102, 46)); -- this.theSlot = this.addSlotToContainer(new SlotBrewingStandIngredient(this, var2, 3, 79, 17)); -- -+ public ContainerBrewingStand(InventoryPlayer par1InventoryPlayer, TileEntityBrewingStand par2TileEntityBrewingStand) { -+ this.tileBrewingStand = par2TileEntityBrewingStand; -+ this.addSlotToContainer(new SlotBrewingStandPotion(par1InventoryPlayer.player, par2TileEntityBrewingStand, 0, 56, 46)); -+ this.addSlotToContainer(new SlotBrewingStandPotion(par1InventoryPlayer.player, par2TileEntityBrewingStand, 1, 79, 53)); -+ this.addSlotToContainer(new SlotBrewingStandPotion(par1InventoryPlayer.player, par2TileEntityBrewingStand, 2, 102, 46)); -+ this.theSlot = this.addSlotToContainer(new SlotBrewingStandIngredient(this, par2TileEntityBrewingStand, 3, 79, 17)); - int var3; -- for(var3 = 0; var3 < 3; ++var3) { -- for(int var4 = 0; var4 < 9; ++var4) { -- this.addSlotToContainer(new Slot(var1, var4 + var3 * 9 + 9, 8 + var4 * 18, 84 + var3 * 18)); -+ -+ for (var3 = 0; var3 < 3; ++var3) { -+ for (int var4 = 0; var4 < 9; ++var4) { -+ this.addSlotToContainer(new Slot(par1InventoryPlayer, var4 + var3 * 9 + 9, 8 + var4 * 18, 84 + var3 * 18)); - } - } - -- for(var3 = 0; var3 < 9; ++var3) { -- this.addSlotToContainer(new Slot(var1, var3, 8 + var3 * 18, 142)); -+ for (var3 = 0; var3 < 9; ++var3) { -+ this.addSlotToContainer(new Slot(par1InventoryPlayer, var3, 8 + var3 * 18, 142)); - } -- -- } -- -- public void onCraftGuiOpened(ICrafting var1) { -- super.onCraftGuiOpened(var1); -- var1.sendProgressBarUpdate(this, 0, this.tileBrewingStand.getBrewTime()); -- } -- -+ } -+ -+ // Spout Start -+ public IInventory getIInventory() { -+ return tileBrewingStand; -+ } -+ // Spout End -+ -+ public void addCraftingToCrafters(ICrafting par1ICrafting) { -+ super.addCraftingToCrafters(par1ICrafting); -+ par1ICrafting.sendProgressBarUpdate(this, 0, this.tileBrewingStand.getBrewTime()); -+ } -+ -+ /** -+ * Looks for changes made in the container, sends them to every listener. -+ */ - public void detectAndSendChanges() { - super.detectAndSendChanges(); - -- for(int var1 = 0; var1 < this.e.size(); ++var1) { -- ICrafting var2 = (ICrafting)this.e.get(var1); -- if(this.brewTime != this.tileBrewingStand.getBrewTime()) { -+ for (int var1 = 0; var1 < this.crafters.size(); ++var1) { -+ ICrafting var2 = (ICrafting)this.crafters.get(var1); -+ -+ if (this.brewTime != this.tileBrewingStand.getBrewTime()) { - var2.sendProgressBarUpdate(this, 0, this.tileBrewingStand.getBrewTime()); - } - } -@@ -43,62 +54,66 @@ - this.brewTime = this.tileBrewingStand.getBrewTime(); - } - -- public void updateProgressBar(int var1, int var2) { -- if(var1 == 0) { -- this.tileBrewingStand.setBrewTime(var2); -+ public void updateProgressBar(int par1, int par2) { -+ if (par1 == 0) { -+ this.tileBrewingStand.setBrewTime(par2); - } -- -- } -- -- public boolean canInteractWith(EntityPlayer var1) { -- return this.tileBrewingStand.isUseableByPlayer(var1); -- } -- -- public ItemStack transferStackInSlot(EntityPlayer var1, int var2) { -+ } -+ -+ public boolean canInteractWith(EntityPlayer par1EntityPlayer) { -+ return this.tileBrewingStand.isUseableByPlayer(par1EntityPlayer); -+ } -+ -+ /** -+ * Called when a player shift-clicks on a slot. You must override this or you will crash when someone does that. -+ */ -+ public ItemStack transferStackInSlot(EntityPlayer par1EntityPlayer, int par2) { - ItemStack var3 = null; -- Slot var4 = (Slot)this.c.get(var2); -- if(var4 != null && var4.getHasStack()) { -+ Slot var4 = (Slot)this.inventorySlots.get(par2); -+ -+ if (var4 != null && var4.getHasStack()) { - ItemStack var5 = var4.getStack(); - var3 = var5.copy(); -- if((var2 < 0 || var2 > 2) && var2 != 3) { -- if(!this.theSlot.getHasStack() && this.theSlot.isItemValid(var5)) { -- if(!this.mergeItemStack(var5, 3, 4, false)) { -- return null; -- } -- } else if(SlotBrewingStandPotion.canHoldPotion(var3)) { -- if(!this.mergeItemStack(var5, 0, 3, false)) { -- return null; -- } -- } else if(var2 >= 4 && var2 < 31) { -- if(!this.mergeItemStack(var5, 31, 40, false)) { -- return null; -- } -- } else if(var2 >= 31 && var2 < 40) { -- if(!this.mergeItemStack(var5, 4, 31, false)) { -- return null; -- } -- } else if(!this.mergeItemStack(var5, 4, 40, false)) { -+ -+ if ((par2 < 0 || par2 > 2) && par2 != 3) { -+ if (!this.theSlot.getHasStack() && this.theSlot.isItemValid(var5)) { -+ if (!this.mergeItemStack(var5, 3, 4, false)) { -+ return null; -+ } -+ } else if (SlotBrewingStandPotion.canHoldPotion(var3)) { -+ if (!this.mergeItemStack(var5, 0, 3, false)) { -+ return null; -+ } -+ } else if (par2 >= 4 && par2 < 31) { -+ if (!this.mergeItemStack(var5, 31, 40, false)) { -+ return null; -+ } -+ } else if (par2 >= 31 && par2 < 40) { -+ if (!this.mergeItemStack(var5, 4, 31, false)) { -+ return null; -+ } -+ } else if (!this.mergeItemStack(var5, 4, 40, false)) { - return null; - } - } else { -- if(!this.mergeItemStack(var5, 4, 40, true)) { -+ if (!this.mergeItemStack(var5, 4, 40, true)) { - return null; - } - - var4.onSlotChange(var5, var3); - } - -- if(var5.stackSize == 0) { -+ if (var5.stackSize == 0) { - var4.putStack((ItemStack)null); - } else { - var4.onSlotChanged(); - } - -- if(var5.stackSize == var3.stackSize) { -+ if (var5.stackSize == var3.stackSize) { - return null; - } - -- var4.onPickupFromSlot(var1, var5); -+ var4.onPickupFromSlot(par1EntityPlayer, var5); - } - - return var3; ---- net/minecraft/src/ServerCommandScoreboard.java -+++ net/minecraft/src/ServerCommandScoreboard.java -@@ -14,145 +14,148 @@ - return "scoreboard"; - } - -+ /** -+ * Return the required permission level for this command. -+ */ - public int getRequiredPermissionLevel() { - return 2; - } - -- public String getCommandUsage(ICommandSender var1) { -+ public String getCommandUsage(ICommandSender par1ICommandSender) { - return "commands.scoreboard.usage"; - } - -- public void processCommand(ICommandSender var1, String[] var2) { -- if(var2.length >= 1) { -- if(var2[0].equalsIgnoreCase("objectives")) { -- if(var2.length == 1) { -+ public void processCommand(ICommandSender par1ICommandSender, String[] par2ArrayOfStr) { -+ if (par2ArrayOfStr.length >= 1) { -+ if (par2ArrayOfStr[0].equalsIgnoreCase("objectives")) { -+ if (par2ArrayOfStr.length == 1) { - throw new WrongUsageException("commands.scoreboard.objectives.usage", new Object[0]); - } - -- if(var2[1].equalsIgnoreCase("list")) { -- this.getObjectivesList(var1); -- } else if(var2[1].equalsIgnoreCase("add")) { -- if(var2.length < 4) { -+ if (par2ArrayOfStr[1].equalsIgnoreCase("list")) { -+ this.getObjectivesList(par1ICommandSender); -+ } else if (par2ArrayOfStr[1].equalsIgnoreCase("add")) { -+ if (par2ArrayOfStr.length < 4) { - throw new WrongUsageException("commands.scoreboard.objectives.add.usage", new Object[0]); - } - -- this.addObjective(var1, var2, 2); -- } else if(var2[1].equalsIgnoreCase("remove")) { -- if(var2.length != 3) { -+ this.addObjective(par1ICommandSender, par2ArrayOfStr, 2); -+ } else if (par2ArrayOfStr[1].equalsIgnoreCase("remove")) { -+ if (par2ArrayOfStr.length != 3) { - throw new WrongUsageException("commands.scoreboard.objectives.remove.usage", new Object[0]); - } - -- this.removeObjective(var1, var2[2]); -+ this.removeObjective(par1ICommandSender, par2ArrayOfStr[2]); - } else { -- if(!var2[1].equalsIgnoreCase("setdisplay")) { -+ if (!par2ArrayOfStr[1].equalsIgnoreCase("setdisplay")) { - throw new WrongUsageException("commands.scoreboard.objectives.usage", new Object[0]); - } - -- if(var2.length != 3 && var2.length != 4) { -+ if (par2ArrayOfStr.length != 3 && par2ArrayOfStr.length != 4) { - throw new WrongUsageException("commands.scoreboard.objectives.setdisplay.usage", new Object[0]); - } - -- this.setObjectivesDisplay(var1, var2, 2); -+ this.setObjectivesDisplay(par1ICommandSender, par2ArrayOfStr, 2); - } - - return; - } - -- if(var2[0].equalsIgnoreCase("players")) { -- if(var2.length == 1) { -+ if (par2ArrayOfStr[0].equalsIgnoreCase("players")) { -+ if (par2ArrayOfStr.length == 1) { - throw new WrongUsageException("commands.scoreboard.players.usage", new Object[0]); - } - -- if(var2[1].equalsIgnoreCase("list")) { -- if(var2.length > 3) { -+ if (par2ArrayOfStr[1].equalsIgnoreCase("list")) { -+ if (par2ArrayOfStr.length > 3) { - throw new WrongUsageException("commands.scoreboard.players.list.usage", new Object[0]); - } - -- this.listPlayers(var1, var2, 2); -- } else if(var2[1].equalsIgnoreCase("add")) { -- if(var2.length != 5) { -+ this.listPlayers(par1ICommandSender, par2ArrayOfStr, 2); -+ } else if (par2ArrayOfStr[1].equalsIgnoreCase("add")) { -+ if (par2ArrayOfStr.length != 5) { - throw new WrongUsageException("commands.scoreboard.players.add.usage", new Object[0]); - } - -- this.setPlayerScore(var1, var2, 2); -- } else if(var2[1].equalsIgnoreCase("remove")) { -- if(var2.length != 5) { -+ this.setPlayerScore(par1ICommandSender, par2ArrayOfStr, 2); -+ } else if (par2ArrayOfStr[1].equalsIgnoreCase("remove")) { -+ if (par2ArrayOfStr.length != 5) { - throw new WrongUsageException("commands.scoreboard.players.remove.usage", new Object[0]); - } - -- this.setPlayerScore(var1, var2, 2); -- } else if(var2[1].equalsIgnoreCase("set")) { -- if(var2.length != 5) { -+ this.setPlayerScore(par1ICommandSender, par2ArrayOfStr, 2); -+ } else if (par2ArrayOfStr[1].equalsIgnoreCase("set")) { -+ if (par2ArrayOfStr.length != 5) { - throw new WrongUsageException("commands.scoreboard.players.set.usage", new Object[0]); - } - -- this.setPlayerScore(var1, var2, 2); -+ this.setPlayerScore(par1ICommandSender, par2ArrayOfStr, 2); - } else { -- if(!var2[1].equalsIgnoreCase("reset")) { -+ if (!par2ArrayOfStr[1].equalsIgnoreCase("reset")) { - throw new WrongUsageException("commands.scoreboard.players.usage", new Object[0]); - } - -- if(var2.length != 3) { -+ if (par2ArrayOfStr.length != 3) { - throw new WrongUsageException("commands.scoreboard.players.reset.usage", new Object[0]); - } - -- this.resetPlayerScore(var1, var2, 2); -+ this.resetPlayerScore(par1ICommandSender, par2ArrayOfStr, 2); - } - - return; - } - -- if(var2[0].equalsIgnoreCase("teams")) { -- if(var2.length == 1) { -+ if (par2ArrayOfStr[0].equalsIgnoreCase("teams")) { -+ if (par2ArrayOfStr.length == 1) { - throw new WrongUsageException("commands.scoreboard.teams.usage", new Object[0]); - } - -- if(var2[1].equalsIgnoreCase("list")) { -- if(var2.length > 3) { -+ if (par2ArrayOfStr[1].equalsIgnoreCase("list")) { -+ if (par2ArrayOfStr.length > 3) { - throw new WrongUsageException("commands.scoreboard.teams.list.usage", new Object[0]); - } - -- this.getTeamList(var1, var2, 2); -- } else if(var2[1].equalsIgnoreCase("add")) { -- if(var2.length < 3) { -+ this.getTeamList(par1ICommandSender, par2ArrayOfStr, 2); -+ } else if (par2ArrayOfStr[1].equalsIgnoreCase("add")) { -+ if (par2ArrayOfStr.length < 3) { - throw new WrongUsageException("commands.scoreboard.teams.add.usage", new Object[0]); - } - -- this.addTeam(var1, var2, 2); -- } else if(var2[1].equalsIgnoreCase("remove")) { -- if(var2.length != 3) { -+ this.addTeam(par1ICommandSender, par2ArrayOfStr, 2); -+ } else if (par2ArrayOfStr[1].equalsIgnoreCase("remove")) { -+ if (par2ArrayOfStr.length != 3) { - throw new WrongUsageException("commands.scoreboard.teams.remove.usage", new Object[0]); - } - -- this.removeTeam(var1, var2, 2); -- } else if(var2[1].equalsIgnoreCase("empty")) { -- if(var2.length != 3) { -+ this.removeTeam(par1ICommandSender, par2ArrayOfStr, 2); -+ } else if (par2ArrayOfStr[1].equalsIgnoreCase("empty")) { -+ if (par2ArrayOfStr.length != 3) { - throw new WrongUsageException("commands.scoreboard.teams.empty.usage", new Object[0]); - } - -- this.emptyTeam(var1, var2, 2); -- } else if(var2[1].equalsIgnoreCase("join")) { -- if(var2.length < 4 && (var2.length != 3 || !(var1 instanceof EntityPlayer))) { -+ this.emptyTeam(par1ICommandSender, par2ArrayOfStr, 2); -+ } else if (par2ArrayOfStr[1].equalsIgnoreCase("join")) { -+ if (par2ArrayOfStr.length < 4 && (par2ArrayOfStr.length != 3 || !(par1ICommandSender instanceof EntityPlayer))) { - throw new WrongUsageException("commands.scoreboard.teams.join.usage", new Object[0]); - } - -- this.joinTeam(var1, var2, 2); -- } else if(var2[1].equalsIgnoreCase("leave")) { -- if(var2.length < 3 && !(var1 instanceof EntityPlayer)) { -+ this.joinTeam(par1ICommandSender, par2ArrayOfStr, 2); -+ } else if (par2ArrayOfStr[1].equalsIgnoreCase("leave")) { -+ if (par2ArrayOfStr.length < 3 && !(par1ICommandSender instanceof EntityPlayer)) { - throw new WrongUsageException("commands.scoreboard.teams.leave.usage", new Object[0]); - } - -- this.leaveTeam(var1, var2, 2); -+ this.leaveTeam(par1ICommandSender, par2ArrayOfStr, 2); - } else { -- if(!var2[1].equalsIgnoreCase("option")) { -+ if (!par2ArrayOfStr[1].equalsIgnoreCase("option")) { - throw new WrongUsageException("commands.scoreboard.teams.usage", new Object[0]); - } - -- if(var2.length != 4 && var2.length != 5) { -+ if (par2ArrayOfStr.length != 4 && par2ArrayOfStr.length != 5) { - throw new WrongUsageException("commands.scoreboard.teams.option.usage", new Object[0]); - } - -- this.setTeamOption(var1, var2, 2); -+ this.setTeamOption(par1ICommandSender, par2ArrayOfStr, 2); - } - - return; -@@ -166,50 +169,64 @@ - return MinecraftServer.getServer().worldServerForDimension(0).getScoreboard(); - } - -- protected ScoreObjective getScoreObjective(String var1, boolean var2) { -+ /** -+ * User-safe version of Scoreboard.getObjective, does checks against the objective not being found and whether it's -+ * read-only or not. If true, the second parameter makes the function throw an exception if the objective is read-only. -+ */ -+ protected ScoreObjective getScoreObjective(String par1Str, boolean par2) { - Scoreboard var3 = this.getScoreboardFromWorldServer(); -- ScoreObjective var4 = var3.getObjective(var1); -- if(var4 == null) { -- throw new CommandException("commands.scoreboard.objectiveNotFound", new Object[]{var1}); -- } else if(var2 && var4.getCriteria().isReadOnly()) { -- throw new CommandException("commands.scoreboard.objectiveReadOnly", new Object[]{var1}); -+ ScoreObjective var4 = var3.getObjective(par1Str); -+ -+ if (var4 == null) { -+ throw new CommandException("commands.scoreboard.objectiveNotFound", new Object[] {par1Str}); -+ } else if (par2 && var4.getCriteria().isReadOnly()) { -+ throw new CommandException("commands.scoreboard.objectiveReadOnly", new Object[] {par1Str}); - } else { - return var4; - } - } - -- protected ScorePlayerTeam getTeam(String var1) { -+ /** -+ * Returns the ScorePlayerTeam for the given team name. -+ */ -+ protected ScorePlayerTeam getTeam(String par1Str) { - Scoreboard var2 = this.getScoreboardFromWorldServer(); -- ScorePlayerTeam var3 = var2.func_96508_e(var1); -- if(var3 == null) { -- throw new CommandException("commands.scoreboard.teamNotFound", new Object[]{var1}); -+ ScorePlayerTeam var3 = var2.func_96508_e(par1Str); -+ -+ if (var3 == null) { -+ throw new CommandException("commands.scoreboard.teamNotFound", new Object[] {par1Str}); - } else { - return var3; - } - } - -- protected void addObjective(ICommandSender var1, String[] var2, int var3) { -- String var4 = var2[var3++]; -- String var5 = var2[var3++]; -+ /** -+ * Handler for the 'scoreboard objectives add' command. -+ */ -+ protected void addObjective(ICommandSender par1ICommandSender, String[] par2ArrayOfStr, int par3) { -+ String var4 = par2ArrayOfStr[par3++]; -+ String var5 = par2ArrayOfStr[par3++]; - Scoreboard var6 = this.getScoreboardFromWorldServer(); -- ScoreObjectiveCriteria var7 = (ScoreObjectiveCriteria)ScoreObjectiveCriteria.a.get(var5); -- if(var7 == null) { -- String[] var9 = (String[])ScoreObjectiveCriteria.a.keySet().toArray(new String[0]); -- throw new WrongUsageException("commands.scoreboard.objectives.add.wrongType", new Object[]{joinNiceString(var9)}); -- } else if(var6.getObjective(var4) != null) { -- throw new CommandException("commands.scoreboard.objectives.add.alreadyExists", new Object[]{var4}); -- } else if(var4.length() > 16) { -- throw new SyntaxErrorException("commands.scoreboard.objectives.add.tooLong", new Object[]{var4, Integer.valueOf(16)}); -- } else if(var4.length() == 0) { -+ ScoreObjectiveCriteria var7 = (ScoreObjectiveCriteria)ScoreObjectiveCriteria.field_96643_a.get(var5); -+ -+ if (var7 == null) { -+ String[] var9 = (String[])ScoreObjectiveCriteria.field_96643_a.keySet().toArray(new String[0]); -+ throw new WrongUsageException("commands.scoreboard.objectives.add.wrongType", new Object[] {joinNiceString(var9)}); -+ } else if (var6.getObjective(var4) != null) { -+ throw new CommandException("commands.scoreboard.objectives.add.alreadyExists", new Object[] {var4}); -+ } else if (var4.length() > 16) { -+ throw new SyntaxErrorException("commands.scoreboard.objectives.add.tooLong", new Object[] {var4, Integer.valueOf(16)}); -+ } else if (var4.length() == 0) { - throw new WrongUsageException("commands.scoreboard.objectives.add.usage", new Object[0]); - } else { -- if(var2.length > var3) { -- String var8 = func_82360_a(var1, var2, var3); -- if(var8.length() > 32) { -- throw new SyntaxErrorException("commands.scoreboard.objectives.add.displayTooLong", new Object[]{var8, Integer.valueOf(32)}); -+ if (par2ArrayOfStr.length > par3) { -+ String var8 = func_82360_a(par1ICommandSender, par2ArrayOfStr, par3); -+ -+ if (var8.length() > 32) { -+ throw new SyntaxErrorException("commands.scoreboard.objectives.add.displayTooLong", new Object[] {var8, Integer.valueOf(32)}); - } - -- if(var8.length() > 0) { -+ if (var8.length() > 0) { - var6.func_96535_a(var4, var7).setDisplayName(var8); - } else { - var6.func_96535_a(var4, var7); -@@ -218,154 +235,182 @@ - var6.func_96535_a(var4, var7); - } - -- notifyAdmins(var1, "commands.scoreboard.objectives.add.success", new Object[]{var4}); -+ notifyAdmins(par1ICommandSender, "commands.scoreboard.objectives.add.success", new Object[] {var4}); - } - } - -- protected void addTeam(ICommandSender var1, String[] var2, int var3) { -- String var4 = var2[var3++]; -+ /** -+ * Handler for the 'scoreboard teams add' command. -+ */ -+ protected void addTeam(ICommandSender par1ICommandSender, String[] par2ArrayOfStr, int par3) { -+ String var4 = par2ArrayOfStr[par3++]; - Scoreboard var5 = this.getScoreboardFromWorldServer(); -- if(var5.func_96508_e(var4) != null) { -- throw new CommandException("commands.scoreboard.teams.add.alreadyExists", new Object[]{var4}); -- } else if(var4.length() > 16) { -- throw new SyntaxErrorException("commands.scoreboard.teams.add.tooLong", new Object[]{var4, Integer.valueOf(16)}); -- } else if(var4.length() == 0) { -+ -+ if (var5.func_96508_e(var4) != null) { -+ throw new CommandException("commands.scoreboard.teams.add.alreadyExists", new Object[] {var4}); -+ } else if (var4.length() > 16) { -+ throw new SyntaxErrorException("commands.scoreboard.teams.add.tooLong", new Object[] {var4, Integer.valueOf(16)}); -+ } else if (var4.length() == 0) { - throw new WrongUsageException("commands.scoreboard.teams.add.usage", new Object[0]); - } else { -- if(var2.length > var3) { -- String var6 = func_82360_a(var1, var2, var3); -- if(var6.length() > 32) { -- throw new SyntaxErrorException("commands.scoreboard.teams.add.displayTooLong", new Object[]{var6, Integer.valueOf(32)}); -+ if (par2ArrayOfStr.length > par3) { -+ String var6 = func_82360_a(par1ICommandSender, par2ArrayOfStr, par3); -+ -+ if (var6.length() > 32) { -+ throw new SyntaxErrorException("commands.scoreboard.teams.add.displayTooLong", new Object[] {var6, Integer.valueOf(32)}); - } - -- if(var6.length() > 0) { -- var5.createTeam(var4).setTeamName(var6); -+ if (var6.length() > 0) { -+ var5.func_96527_f(var4).func_96664_a(var6); - } else { -- var5.createTeam(var4); -+ var5.func_96527_f(var4); - } - } else { -- var5.createTeam(var4); -+ var5.func_96527_f(var4); - } - -- notifyAdmins(var1, "commands.scoreboard.teams.add.success", new Object[]{var4}); -+ notifyAdmins(par1ICommandSender, "commands.scoreboard.teams.add.success", new Object[] {var4}); - } - } - -- protected void setTeamOption(ICommandSender var1, String[] var2, int var3) { -- ScorePlayerTeam var4 = this.getTeam(var2[var3++]); -- String var5 = var2[var3++].toLowerCase(); -- if(!var5.equalsIgnoreCase("color") && !var5.equalsIgnoreCase("friendlyfire") && !var5.equalsIgnoreCase("seeFriendlyInvisibles")) { -+ /** -+ * Handler for the 'scoreboard teams option' command. -+ */ -+ protected void setTeamOption(ICommandSender par1ICommandSender, String[] par2ArrayOfStr, int par3) { -+ ScorePlayerTeam var4 = this.getTeam(par2ArrayOfStr[par3++]); -+ String var5 = par2ArrayOfStr[par3++].toLowerCase(); -+ -+ if (!var5.equalsIgnoreCase("color") && !var5.equalsIgnoreCase("friendlyfire") && !var5.equalsIgnoreCase("seeFriendlyInvisibles")) { - throw new WrongUsageException("commands.scoreboard.teams.option.usage", new Object[0]); -- } else if(var2.length == 4) { -- if(var5.equalsIgnoreCase("color")) { -- throw new WrongUsageException("commands.scoreboard.teams.option.noValue", new Object[]{var5, func_96333_a(EnumChatFormatting.func_96296_a(true, false))}); -- } else if(!var5.equalsIgnoreCase("friendlyfire") && !var5.equalsIgnoreCase("seeFriendlyInvisibles")) { -+ } else if (par2ArrayOfStr.length == 4) { -+ if (var5.equalsIgnoreCase("color")) { -+ throw new WrongUsageException("commands.scoreboard.teams.option.noValue", new Object[] {var5, func_96333_a(EnumChatFormatting.func_96296_a(true, false))}); -+ } else if (!var5.equalsIgnoreCase("friendlyfire") && !var5.equalsIgnoreCase("seeFriendlyInvisibles")) { - throw new WrongUsageException("commands.scoreboard.teams.option.usage", new Object[0]); - } else { -- throw new WrongUsageException("commands.scoreboard.teams.option.noValue", new Object[]{var5, func_96333_a(Arrays.asList(new String[]{"true", "false"}))}); -+ throw new WrongUsageException("commands.scoreboard.teams.option.noValue", new Object[] {var5, func_96333_a(Arrays.asList(new String[]{"true", "false"}))}); - } - } else { -- String var6 = var2[var3++]; -- if(var5.equalsIgnoreCase("color")) { -+ String var6 = par2ArrayOfStr[par3++]; -+ -+ if (var5.equalsIgnoreCase("color")) { - EnumChatFormatting var7 = EnumChatFormatting.func_96300_b(var6); -- if(var6 == null) { -- throw new WrongUsageException("commands.scoreboard.teams.option.noValue", new Object[]{var5, func_96333_a(EnumChatFormatting.func_96296_a(true, false))}); -+ -+ if (var6 == null) { -+ throw new WrongUsageException("commands.scoreboard.teams.option.noValue", new Object[] {var5, func_96333_a(EnumChatFormatting.func_96296_a(true, false))}); - } - -- var4.setNamePrefix(var7.toString()); -- var4.setNameSuffix(EnumChatFormatting.RESET.toString()); -- } else if(var5.equalsIgnoreCase("friendlyfire")) { -- if(!var6.equalsIgnoreCase("true") && !var6.equalsIgnoreCase("false")) { -- throw new WrongUsageException("commands.scoreboard.teams.option.noValue", new Object[]{var5, func_96333_a(Arrays.asList(new String[]{"true", "false"}))}); -+ var4.func_96666_b(var7.toString()); -+ var4.func_96662_c(EnumChatFormatting.RESET.toString()); -+ } else if (var5.equalsIgnoreCase("friendlyfire")) { -+ if (!var6.equalsIgnoreCase("true") && !var6.equalsIgnoreCase("false")) { -+ throw new WrongUsageException("commands.scoreboard.teams.option.noValue", new Object[] {var5, func_96333_a(Arrays.asList(new String[]{"true", "false"}))}); - } - - var4.setAllowFriendlyFire(var6.equalsIgnoreCase("true")); -- } else if(var5.equalsIgnoreCase("seeFriendlyInvisibles")) { -- if(!var6.equalsIgnoreCase("true") && !var6.equalsIgnoreCase("false")) { -- throw new WrongUsageException("commands.scoreboard.teams.option.noValue", new Object[]{var5, func_96333_a(Arrays.asList(new String[]{"true", "false"}))}); -+ } else if (var5.equalsIgnoreCase("seeFriendlyInvisibles")) { -+ if (!var6.equalsIgnoreCase("true") && !var6.equalsIgnoreCase("false")) { -+ throw new WrongUsageException("commands.scoreboard.teams.option.noValue", new Object[] {var5, func_96333_a(Arrays.asList(new String[]{"true", "false"}))}); - } - -- var4.setSeeFriendlyInvisiblesEnabled(var6.equalsIgnoreCase("true")); -+ var4.func_98300_b(var6.equalsIgnoreCase("true")); - } - -- notifyAdmins(var1, "commands.scoreboard.teams.option.success", new Object[]{var5, var4.func_96661_b(), var6}); -+ notifyAdmins(par1ICommandSender, "commands.scoreboard.teams.option.success", new Object[] {var5, var4.func_96661_b(), var6}); - } - } - -- protected void removeTeam(ICommandSender var1, String[] var2, int var3) { -+ /** -+ * Handler for the 'scoreboard teams remove' command. -+ */ -+ protected void removeTeam(ICommandSender par1ICommandSender, String[] par2ArrayOfStr, int par3) { - Scoreboard var4 = this.getScoreboardFromWorldServer(); -- ScorePlayerTeam var5 = this.getTeam(var2[var3++]); -+ ScorePlayerTeam var5 = this.getTeam(par2ArrayOfStr[par3++]); - var4.func_96511_d(var5); -- notifyAdmins(var1, "commands.scoreboard.teams.remove.success", new Object[]{var5.func_96661_b()}); -+ notifyAdmins(par1ICommandSender, "commands.scoreboard.teams.remove.success", new Object[] {var5.func_96661_b()}); - } - -- protected void getTeamList(ICommandSender var1, String[] var2, int var3) { -+ /** -+ * Handler for the 'scoreboard teams list' command. -+ */ -+ protected void getTeamList(ICommandSender par1ICommandSender, String[] par2ArrayOfStr, int par3) { - Scoreboard var4 = this.getScoreboardFromWorldServer(); -- if(var2.length > var3) { -- ScorePlayerTeam var5 = this.getTeam(var2[var3++]); -+ -+ if (par2ArrayOfStr.length > par3) { -+ ScorePlayerTeam var5 = this.getTeam(par2ArrayOfStr[par3++]); - Collection var6 = var5.getMembershipCollection(); -- if(var6.size() <= 0) { -- throw new CommandException("commands.scoreboard.teams.list.player.empty", new Object[]{var5.func_96661_b()}); -+ -+ if (var6.size() <= 0) { -+ throw new CommandException("commands.scoreboard.teams.list.player.empty", new Object[] {var5.func_96661_b()}); - } - -- var1.sendChatToPlayer(ChatMessageComponent.createFromTranslationWithSubstitutions("commands.scoreboard.teams.list.player.count", new Object[]{Integer.valueOf(var6.size()), var5.func_96661_b()}).setColor(EnumChatFormatting.DARK_GREEN)); -- var1.sendChatToPlayer(ChatMessageComponent.createFromText(joinNiceString(var6.toArray()))); -+ par1ICommandSender.sendChatToPlayer(ChatMessageComponent.createFromTranslationWithSubstitutions("commands.scoreboard.teams.list.player.count", new Object[] {Integer.valueOf(var6.size()), var5.func_96661_b()}).setColor(EnumChatFormatting.DARK_GREEN)); -+ par1ICommandSender.sendChatToPlayer(ChatMessageComponent.createFromText(joinNiceString(var6.toArray()))); - } else { - Collection var8 = var4.func_96525_g(); -- if(var8.size() <= 0) { -+ -+ if (var8.size() <= 0) { - throw new CommandException("commands.scoreboard.teams.list.empty", new Object[0]); - } - -- var1.sendChatToPlayer(ChatMessageComponent.createFromTranslationWithSubstitutions("commands.scoreboard.teams.list.count", new Object[]{Integer.valueOf(var8.size())}).setColor(EnumChatFormatting.DARK_GREEN)); -+ par1ICommandSender.sendChatToPlayer(ChatMessageComponent.createFromTranslationWithSubstitutions("commands.scoreboard.teams.list.count", new Object[] {Integer.valueOf(var8.size())}).setColor(EnumChatFormatting.DARK_GREEN)); - Iterator var9 = var8.iterator(); - -- while(var9.hasNext()) { -+ while (var9.hasNext()) { - ScorePlayerTeam var7 = (ScorePlayerTeam)var9.next(); -- var1.sendChatToPlayer(ChatMessageComponent.createFromTranslationWithSubstitutions("commands.scoreboard.teams.list.entry", new Object[]{var7.func_96661_b(), var7.func_96669_c(), Integer.valueOf(var7.getMembershipCollection().size())})); -+ par1ICommandSender.sendChatToPlayer(ChatMessageComponent.createFromTranslationWithSubstitutions("commands.scoreboard.teams.list.entry", new Object[] {var7.func_96661_b(), var7.func_96669_c(), Integer.valueOf(var7.getMembershipCollection().size())})); - } - } -- - } - -- protected void joinTeam(ICommandSender var1, String[] var2, int var3) { -+ /** -+ * Handler for the 'scoreboard teams join' command. -+ */ -+ protected void joinTeam(ICommandSender par1ICommandSender, String[] par2ArrayOfStr, int par3) { - Scoreboard var4 = this.getScoreboardFromWorldServer(); -- ScorePlayerTeam var5 = var4.func_96508_e(var2[var3++]); -+ ScorePlayerTeam var5 = var4.func_96508_e(par2ArrayOfStr[par3++]); - HashSet var6 = new HashSet(); - String var7; -- if(var1 instanceof EntityPlayer && var3 == var2.length) { -- var7 = getCommandSenderAsPlayer(var1).getEntityName(); -- var4.addPlayerToTeam(var7, var5); -+ -+ if (par1ICommandSender instanceof EntityPlayer && par3 == par2ArrayOfStr.length) { -+ var7 = getCommandSenderAsPlayer(par1ICommandSender).getEntityName(); -+ var4.func_96521_a(var7, var5); - var6.add(var7); - } else { -- while(var3 < var2.length) { -- var7 = func_96332_d(var1, var2[var3++]); -- var4.addPlayerToTeam(var7, var5); -+ while (par3 < par2ArrayOfStr.length) { -+ var7 = func_96332_d(par1ICommandSender, par2ArrayOfStr[par3++]); -+ var4.func_96521_a(var7, var5); - var6.add(var7); - } - } - -- if(!var6.isEmpty()) { -- notifyAdmins(var1, "commands.scoreboard.teams.join.success", new Object[]{Integer.valueOf(var6.size()), var5.func_96661_b(), joinNiceString(var6.toArray(new String[0]))}); -+ if (!var6.isEmpty()) { -+ notifyAdmins(par1ICommandSender, "commands.scoreboard.teams.join.success", new Object[] {Integer.valueOf(var6.size()), var5.func_96661_b(), joinNiceString(var6.toArray(new String[0]))}); - } -- - } - -- protected void leaveTeam(ICommandSender var1, String[] var2, int var3) { -+ /** -+ * Handler for the 'scoreboard teams leave' command. -+ */ -+ protected void leaveTeam(ICommandSender par1ICommandSender, String[] par2ArrayOfStr, int par3) { - Scoreboard var4 = this.getScoreboardFromWorldServer(); - HashSet var5 = new HashSet(); - HashSet var6 = new HashSet(); - String var7; -- if(var1 instanceof EntityPlayer && var3 == var2.length) { -- var7 = getCommandSenderAsPlayer(var1).getEntityName(); -- if(var4.removePlayerFromTeams(var7)) { -+ -+ if (par1ICommandSender instanceof EntityPlayer && par3 == par2ArrayOfStr.length) { -+ var7 = getCommandSenderAsPlayer(par1ICommandSender).getEntityName(); -+ -+ if (var4.func_96524_g(var7)) { - var5.add(var7); - } else { - var6.add(var7); - } - } else { -- while(var3 < var2.length) { -- var7 = func_96332_d(var1, var2[var3++]); -- if(var4.removePlayerFromTeams(var7)) { -+ while (par3 < par2ArrayOfStr.length) { -+ var7 = func_96332_d(par1ICommandSender, par2ArrayOfStr[par3++]); -+ -+ if (var4.func_96524_g(var7)) { - var5.add(var7); - } else { - var6.add(var7); -@@ -373,216 +418,245 @@ - } - } - -- if(!var5.isEmpty()) { -- notifyAdmins(var1, "commands.scoreboard.teams.leave.success", new Object[]{Integer.valueOf(var5.size()), joinNiceString(var5.toArray(new String[0]))}); -+ if (!var5.isEmpty()) { -+ notifyAdmins(par1ICommandSender, "commands.scoreboard.teams.leave.success", new Object[] {Integer.valueOf(var5.size()), joinNiceString(var5.toArray(new String[0]))}); - } - -- if(!var6.isEmpty()) { -- throw new CommandException("commands.scoreboard.teams.leave.failure", new Object[]{Integer.valueOf(var6.size()), joinNiceString(var6.toArray(new String[0]))}); -+ if (!var6.isEmpty()) { -+ throw new CommandException("commands.scoreboard.teams.leave.failure", new Object[] {Integer.valueOf(var6.size()), joinNiceString(var6.toArray(new String[0]))}); - } - } - -- protected void emptyTeam(ICommandSender var1, String[] var2, int var3) { -+ /** -+ * Handler for the 'scoreboard teams empty' command. -+ */ -+ protected void emptyTeam(ICommandSender par1ICommandSender, String[] par2ArrayOfStr, int par3) { - Scoreboard var4 = this.getScoreboardFromWorldServer(); -- ScorePlayerTeam var5 = this.getTeam(var2[var3++]); -+ ScorePlayerTeam var5 = this.getTeam(par2ArrayOfStr[par3++]); - ArrayList var6 = new ArrayList(var5.getMembershipCollection()); -- if(var6.isEmpty()) { -- throw new CommandException("commands.scoreboard.teams.empty.alreadyEmpty", new Object[]{var5.func_96661_b()}); -+ -+ if (var6.isEmpty()) { -+ throw new CommandException("commands.scoreboard.teams.empty.alreadyEmpty", new Object[] {var5.func_96661_b()}); - } else { - Iterator var7 = var6.iterator(); - -- while(var7.hasNext()) { -+ while (var7.hasNext()) { - String var8 = (String)var7.next(); - var4.removePlayerFromTeam(var8, var5); - } - -- notifyAdmins(var1, "commands.scoreboard.teams.empty.success", new Object[]{Integer.valueOf(var6.size()), var5.func_96661_b()}); -+ notifyAdmins(par1ICommandSender, "commands.scoreboard.teams.empty.success", new Object[] {Integer.valueOf(var6.size()), var5.func_96661_b()}); - } - } - -- protected void removeObjective(ICommandSender var1, String var2) { -+ /** -+ * Handler for the 'scoreboard objectives remove' command. -+ */ -+ protected void removeObjective(ICommandSender par1ICommandSender, String par2Str) { - Scoreboard var3 = this.getScoreboardFromWorldServer(); -- ScoreObjective var4 = this.getScoreObjective(var2, false); -+ ScoreObjective var4 = this.getScoreObjective(par2Str, false); - var3.func_96519_k(var4); -- notifyAdmins(var1, "commands.scoreboard.objectives.remove.success", new Object[]{var2}); -+ notifyAdmins(par1ICommandSender, "commands.scoreboard.objectives.remove.success", new Object[] {par2Str}); - } - -- protected void getObjectivesList(ICommandSender var1) { -+ /** -+ * Handler for the 'scoreboard objectives list' command. -+ */ -+ protected void getObjectivesList(ICommandSender par1ICommandSender) { - Scoreboard var2 = this.getScoreboardFromWorldServer(); - Collection var3 = var2.getScoreObjectives(); -- if(var3.size() <= 0) { -+ -+ if (var3.size() <= 0) { - throw new CommandException("commands.scoreboard.objectives.list.empty", new Object[0]); - } else { -- var1.sendChatToPlayer(ChatMessageComponent.createFromTranslationWithSubstitutions("commands.scoreboard.objectives.list.count", new Object[]{Integer.valueOf(var3.size())}).setColor(EnumChatFormatting.DARK_GREEN)); -+ par1ICommandSender.sendChatToPlayer(ChatMessageComponent.createFromTranslationWithSubstitutions("commands.scoreboard.objectives.list.count", new Object[] {Integer.valueOf(var3.size())}).setColor(EnumChatFormatting.DARK_GREEN)); - Iterator var4 = var3.iterator(); - -- while(var4.hasNext()) { -+ while (var4.hasNext()) { - ScoreObjective var5 = (ScoreObjective)var4.next(); -- var1.sendChatToPlayer(ChatMessageComponent.createFromTranslationWithSubstitutions("commands.scoreboard.objectives.list.entry", new Object[]{var5.getName(), var5.getDisplayName(), var5.getCriteria().func_96636_a()})); -+ par1ICommandSender.sendChatToPlayer(ChatMessageComponent.createFromTranslationWithSubstitutions("commands.scoreboard.objectives.list.entry", new Object[] {var5.getName(), var5.getDisplayName(), var5.getCriteria().func_96636_a()})); - } -- - } - } - -- protected void setObjectivesDisplay(ICommandSender var1, String[] var2, int var3) { -+ /** -+ * Handler for the 'scoreboard objectives setdisplay' command. -+ */ -+ protected void setObjectivesDisplay(ICommandSender par1ICommandSender, String[] par2ArrayOfStr, int par3) { - Scoreboard var4 = this.getScoreboardFromWorldServer(); -- String var5 = var2[var3++]; -+ String var5 = par2ArrayOfStr[par3++]; - int var6 = Scoreboard.getObjectiveDisplaySlotNumber(var5); - ScoreObjective var7 = null; -- if(var2.length == 4) { -- var7 = this.getScoreObjective(var2[var3++], false); -+ -+ if (par2ArrayOfStr.length == 4) { -+ var7 = this.getScoreObjective(par2ArrayOfStr[par3++], false); - } - -- if(var6 < 0) { -- throw new CommandException("commands.scoreboard.objectives.setdisplay.invalidSlot", new Object[]{var5}); -+ if (var6 < 0) { -+ throw new CommandException("commands.scoreboard.objectives.setdisplay.invalidSlot", new Object[] {var5}); - } else { - var4.func_96530_a(var6, var7); -- if(var7 != null) { -- notifyAdmins(var1, "commands.scoreboard.objectives.setdisplay.successSet", new Object[]{Scoreboard.getObjectiveDisplaySlot(var6), var7.getName()}); -+ -+ if (var7 != null) { -+ notifyAdmins(par1ICommandSender, "commands.scoreboard.objectives.setdisplay.successSet", new Object[] {Scoreboard.getObjectiveDisplaySlot(var6), var7.getName()}); - } else { -- notifyAdmins(var1, "commands.scoreboard.objectives.setdisplay.successCleared", new Object[]{Scoreboard.getObjectiveDisplaySlot(var6)}); -+ notifyAdmins(par1ICommandSender, "commands.scoreboard.objectives.setdisplay.successCleared", new Object[] {Scoreboard.getObjectiveDisplaySlot(var6)}); - } -- - } - } - -- protected void listPlayers(ICommandSender var1, String[] var2, int var3) { -+ /** -+ * Handler for the 'scoreboard players list' command. -+ */ -+ protected void listPlayers(ICommandSender par1ICommandSender, String[] par2ArrayOfStr, int par3) { - Scoreboard var4 = this.getScoreboardFromWorldServer(); -- if(var2.length > var3) { -- String var5 = func_96332_d(var1, var2[var3++]); -+ -+ if (par2ArrayOfStr.length > par3) { -+ String var5 = func_96332_d(par1ICommandSender, par2ArrayOfStr[par3++]); - Map var6 = var4.func_96510_d(var5); -- if(var6.size() <= 0) { -- throw new CommandException("commands.scoreboard.players.list.player.empty", new Object[]{var5}); -+ -+ if (var6.size() <= 0) { -+ throw new CommandException("commands.scoreboard.players.list.player.empty", new Object[] {var5}); - } - -- var1.sendChatToPlayer(ChatMessageComponent.createFromTranslationWithSubstitutions("commands.scoreboard.players.list.player.count", new Object[]{Integer.valueOf(var6.size()), var5}).setColor(EnumChatFormatting.DARK_GREEN)); -+ par1ICommandSender.sendChatToPlayer(ChatMessageComponent.createFromTranslationWithSubstitutions("commands.scoreboard.players.list.player.count", new Object[] {Integer.valueOf(var6.size()), var5}).setColor(EnumChatFormatting.DARK_GREEN)); - Iterator var7 = var6.values().iterator(); - -- while(var7.hasNext()) { -+ while (var7.hasNext()) { - Score var8 = (Score)var7.next(); -- var1.sendChatToPlayer(ChatMessageComponent.createFromTranslationWithSubstitutions("commands.scoreboard.players.list.player.entry", new Object[]{Integer.valueOf(var8.getScorePoints()), var8.func_96645_d().getDisplayName(), var8.func_96645_d().getName()})); -+ par1ICommandSender.sendChatToPlayer(ChatMessageComponent.createFromTranslationWithSubstitutions("commands.scoreboard.players.list.player.entry", new Object[] {Integer.valueOf(var8.getScorePoints()), var8.func_96645_d().getDisplayName(), var8.func_96645_d().getName()})); - } - } else { - Collection var9 = var4.getObjectiveNames(); -- if(var9.size() <= 0) { -+ -+ if (var9.size() <= 0) { - throw new CommandException("commands.scoreboard.players.list.empty", new Object[0]); - } - -- var1.sendChatToPlayer(ChatMessageComponent.createFromTranslationWithSubstitutions("commands.scoreboard.players.list.count", new Object[]{Integer.valueOf(var9.size())}).setColor(EnumChatFormatting.DARK_GREEN)); -- var1.sendChatToPlayer(ChatMessageComponent.createFromText(joinNiceString(var9.toArray()))); -+ par1ICommandSender.sendChatToPlayer(ChatMessageComponent.createFromTranslationWithSubstitutions("commands.scoreboard.players.list.count", new Object[] {Integer.valueOf(var9.size())}).setColor(EnumChatFormatting.DARK_GREEN)); -+ par1ICommandSender.sendChatToPlayer(ChatMessageComponent.createFromText(joinNiceString(var9.toArray()))); - } -- - } - -- protected void setPlayerScore(ICommandSender var1, String[] var2, int var3) { -- String var4 = var2[var3 - 1]; -- String var5 = func_96332_d(var1, var2[var3++]); -- ScoreObjective var6 = this.getScoreObjective(var2[var3++], true); -- int var7 = var4.equalsIgnoreCase("set") ? parseInt(var1, var2[var3++]) : parseIntWithMin(var1, var2[var3++], 1); -+ /** -+ * Handler for the 'scoreboard players [add|remove|set]' commands. -+ */ -+ protected void setPlayerScore(ICommandSender par1ICommandSender, String[] par2ArrayOfStr, int par3) { -+ String var4 = par2ArrayOfStr[par3 - 1]; -+ String var5 = func_96332_d(par1ICommandSender, par2ArrayOfStr[par3++]); -+ ScoreObjective var6 = this.getScoreObjective(par2ArrayOfStr[par3++], true); -+ int var7 = var4.equalsIgnoreCase("set") ? parseInt(par1ICommandSender, par2ArrayOfStr[par3++]) : parseIntWithMin(par1ICommandSender, par2ArrayOfStr[par3++], 1); - Scoreboard var8 = this.getScoreboardFromWorldServer(); - Score var9 = var8.func_96529_a(var5, var6); -- if(var4.equalsIgnoreCase("set")) { -+ -+ if (var4.equalsIgnoreCase("set")) { - var9.func_96647_c(var7); -- } else if(var4.equalsIgnoreCase("add")) { -+ } else if (var4.equalsIgnoreCase("add")) { - var9.func_96649_a(var7); - } else { - var9.func_96646_b(var7); - } - -- notifyAdmins(var1, "commands.scoreboard.players.set.success", new Object[]{var6.getName(), var5, Integer.valueOf(var9.getScorePoints())}); -+ notifyAdmins(par1ICommandSender, "commands.scoreboard.players.set.success", new Object[] {var6.getName(), var5, Integer.valueOf(var9.getScorePoints())}); - } - -- protected void resetPlayerScore(ICommandSender var1, String[] var2, int var3) { -+ /** -+ * Handler for the 'scoreboard players reset' command. -+ */ -+ protected void resetPlayerScore(ICommandSender par1ICommandSender, String[] par2ArrayOfStr, int par3) { - Scoreboard var4 = this.getScoreboardFromWorldServer(); -- String var5 = func_96332_d(var1, var2[var3++]); -+ String var5 = func_96332_d(par1ICommandSender, par2ArrayOfStr[par3++]); - var4.func_96515_c(var5); -- notifyAdmins(var1, "commands.scoreboard.players.reset.success", new Object[]{var5}); -+ notifyAdmins(par1ICommandSender, "commands.scoreboard.players.reset.success", new Object[] {var5}); - } - -- public List addTabCompletionOptions(ICommandSender var1, String[] var2) { -- if(var2.length == 1) { -- return getListOfStringsMatchingLastWord(var2, new String[]{"objectives", "players", "teams"}); -+ /** -+ * Adds the strings available in this command to the given list of tab completion options. -+ */ -+ public List addTabCompletionOptions(ICommandSender par1ICommandSender, String[] par2ArrayOfStr) { -+ if (par2ArrayOfStr.length == 1) { -+ return getListOfStringsMatchingLastWord(par2ArrayOfStr, new String[] {"objectives", "players", "teams"}); - } else { -- if(var2[0].equalsIgnoreCase("objectives")) { -- if(var2.length == 2) { -- return getListOfStringsMatchingLastWord(var2, new String[]{"list", "add", "remove", "setdisplay"}); -- } -- -- if(var2[1].equalsIgnoreCase("add")) { -- if(var2.length == 4) { -- return getListOfStringsFromIterableMatchingLastWord(var2, ScoreObjectiveCriteria.a.keySet()); -- } -- } else if(var2[1].equalsIgnoreCase("remove")) { -- if(var2.length == 3) { -- return getListOfStringsFromIterableMatchingLastWord(var2, this.getScoreObjectivesList(false)); -- } -- } else if(var2[1].equalsIgnoreCase("setdisplay")) { -- if(var2.length == 3) { -- return getListOfStringsMatchingLastWord(var2, new String[]{"list", "sidebar", "belowName"}); -- } -- -- if(var2.length == 4) { -- return getListOfStringsFromIterableMatchingLastWord(var2, this.getScoreObjectivesList(false)); -- } -- } -- } else if(var2[0].equalsIgnoreCase("players")) { -- if(var2.length == 2) { -- return getListOfStringsMatchingLastWord(var2, new String[]{"set", "add", "remove", "reset", "list"}); -- } -- -- if(!var2[1].equalsIgnoreCase("set") && !var2[1].equalsIgnoreCase("add") && !var2[1].equalsIgnoreCase("remove")) { -- if((var2[1].equalsIgnoreCase("reset") || var2[1].equalsIgnoreCase("list")) && var2.length == 3) { -- return getListOfStringsFromIterableMatchingLastWord(var2, this.getScoreboardFromWorldServer().getObjectiveNames()); -- } -- } else { -- if(var2.length == 3) { -- return getListOfStringsMatchingLastWord(var2, MinecraftServer.getServer().getAllUsernames()); -- } -- -- if(var2.length == 4) { -- return getListOfStringsFromIterableMatchingLastWord(var2, this.getScoreObjectivesList(true)); -- } -- } -- } else if(var2[0].equalsIgnoreCase("teams")) { -- if(var2.length == 2) { -- return getListOfStringsMatchingLastWord(var2, new String[]{"add", "remove", "join", "leave", "empty", "list", "option"}); -- } -- -- if(var2[1].equalsIgnoreCase("join")) { -- if(var2.length == 3) { -- return getListOfStringsFromIterableMatchingLastWord(var2, this.getScoreboardFromWorldServer().func_96531_f()); -- } -- -- if(var2.length >= 4) { -- return getListOfStringsMatchingLastWord(var2, MinecraftServer.getServer().getAllUsernames()); -- } -- } else { -- if(var2[1].equalsIgnoreCase("leave")) { -- return getListOfStringsMatchingLastWord(var2, MinecraftServer.getServer().getAllUsernames()); -- } -- -- if(!var2[1].equalsIgnoreCase("empty") && !var2[1].equalsIgnoreCase("list") && !var2[1].equalsIgnoreCase("remove")) { -- if(var2[1].equalsIgnoreCase("option")) { -- if(var2.length == 3) { -- return getListOfStringsFromIterableMatchingLastWord(var2, this.getScoreboardFromWorldServer().func_96531_f()); -- } -- -- if(var2.length == 4) { -- return getListOfStringsMatchingLastWord(var2, new String[]{"color", "friendlyfire", "seeFriendlyInvisibles"}); -- } -- -- if(var2.length == 5) { -- if(var2[3].equalsIgnoreCase("color")) { -- return getListOfStringsFromIterableMatchingLastWord(var2, EnumChatFormatting.func_96296_a(true, false)); -+ if (par2ArrayOfStr[0].equalsIgnoreCase("objectives")) { -+ if (par2ArrayOfStr.length == 2) { -+ return getListOfStringsMatchingLastWord(par2ArrayOfStr, new String[] {"list", "add", "remove", "setdisplay"}); -+ } -+ -+ if (par2ArrayOfStr[1].equalsIgnoreCase("add")) { -+ if (par2ArrayOfStr.length == 4) { -+ return getListOfStringsFromIterableMatchingLastWord(par2ArrayOfStr, ScoreObjectiveCriteria.field_96643_a.keySet()); -+ } -+ } else if (par2ArrayOfStr[1].equalsIgnoreCase("remove")) { -+ if (par2ArrayOfStr.length == 3) { -+ return getListOfStringsFromIterableMatchingLastWord(par2ArrayOfStr, this.getScoreObjectivesList(false)); -+ } -+ } else if (par2ArrayOfStr[1].equalsIgnoreCase("setdisplay")) { -+ if (par2ArrayOfStr.length == 3) { -+ return getListOfStringsMatchingLastWord(par2ArrayOfStr, new String[] {"list", "sidebar", "belowName"}); -+ } -+ -+ if (par2ArrayOfStr.length == 4) { -+ return getListOfStringsFromIterableMatchingLastWord(par2ArrayOfStr, this.getScoreObjectivesList(false)); -+ } -+ } -+ } else if (par2ArrayOfStr[0].equalsIgnoreCase("players")) { -+ if (par2ArrayOfStr.length == 2) { -+ return getListOfStringsMatchingLastWord(par2ArrayOfStr, new String[] {"set", "add", "remove", "reset", "list"}); -+ } -+ -+ if (!par2ArrayOfStr[1].equalsIgnoreCase("set") && !par2ArrayOfStr[1].equalsIgnoreCase("add") && !par2ArrayOfStr[1].equalsIgnoreCase("remove")) { -+ if ((par2ArrayOfStr[1].equalsIgnoreCase("reset") || par2ArrayOfStr[1].equalsIgnoreCase("list")) && par2ArrayOfStr.length == 3) { -+ return getListOfStringsFromIterableMatchingLastWord(par2ArrayOfStr, this.getScoreboardFromWorldServer().getObjectiveNames()); -+ } -+ } else { -+ if (par2ArrayOfStr.length == 3) { -+ return getListOfStringsMatchingLastWord(par2ArrayOfStr, MinecraftServer.getServer().getAllUsernames()); -+ } -+ -+ if (par2ArrayOfStr.length == 4) { -+ return getListOfStringsFromIterableMatchingLastWord(par2ArrayOfStr, this.getScoreObjectivesList(true)); -+ } -+ } -+ } else if (par2ArrayOfStr[0].equalsIgnoreCase("teams")) { -+ if (par2ArrayOfStr.length == 2) { -+ return getListOfStringsMatchingLastWord(par2ArrayOfStr, new String[] {"add", "remove", "join", "leave", "empty", "list", "option"}); -+ } -+ -+ if (par2ArrayOfStr[1].equalsIgnoreCase("join")) { -+ if (par2ArrayOfStr.length == 3) { -+ return getListOfStringsFromIterableMatchingLastWord(par2ArrayOfStr, this.getScoreboardFromWorldServer().func_96531_f()); -+ } -+ -+ if (par2ArrayOfStr.length >= 4) { -+ return getListOfStringsMatchingLastWord(par2ArrayOfStr, MinecraftServer.getServer().getAllUsernames()); -+ } -+ } else { -+ if (par2ArrayOfStr[1].equalsIgnoreCase("leave")) { -+ return getListOfStringsMatchingLastWord(par2ArrayOfStr, MinecraftServer.getServer().getAllUsernames()); -+ } -+ -+ if (!par2ArrayOfStr[1].equalsIgnoreCase("empty") && !par2ArrayOfStr[1].equalsIgnoreCase("list") && !par2ArrayOfStr[1].equalsIgnoreCase("remove")) { -+ if (par2ArrayOfStr[1].equalsIgnoreCase("option")) { -+ if (par2ArrayOfStr.length == 3) { -+ return getListOfStringsFromIterableMatchingLastWord(par2ArrayOfStr, this.getScoreboardFromWorldServer().func_96531_f()); -+ } -+ -+ if (par2ArrayOfStr.length == 4) { -+ return getListOfStringsMatchingLastWord(par2ArrayOfStr, new String[] {"color", "friendlyfire", "seeFriendlyInvisibles"}); -+ } -+ -+ if (par2ArrayOfStr.length == 5) { -+ if (par2ArrayOfStr[3].equalsIgnoreCase("color")) { -+ return getListOfStringsFromIterableMatchingLastWord(par2ArrayOfStr, EnumChatFormatting.func_96296_a(true, false)); - } - -- if(var2[3].equalsIgnoreCase("friendlyfire") || var2[3].equalsIgnoreCase("seeFriendlyInvisibles")) { -- return getListOfStringsMatchingLastWord(var2, new String[]{"true", "false"}); -+ if (par2ArrayOfStr[3].equalsIgnoreCase("friendlyfire") || par2ArrayOfStr[3].equalsIgnoreCase("seeFriendlyInvisibles")) { -+ return getListOfStringsMatchingLastWord(par2ArrayOfStr, new String[] {"true", "false"}); - } - } - } -- } else if(var2.length == 3) { -- return getListOfStringsFromIterableMatchingLastWord(var2, this.getScoreboardFromWorldServer().func_96531_f()); -+ } else if (par2ArrayOfStr.length == 3) { -+ return getListOfStringsFromIterableMatchingLastWord(par2ArrayOfStr, this.getScoreboardFromWorldServer().func_96531_f()); - } - } - } -@@ -591,26 +665,29 @@ - } - } - -- protected List getScoreObjectivesList(boolean var1) { -+ /** -+ * If the parameter is true, does not return read-only entries. -+ */ -+ protected List getScoreObjectivesList(boolean par1) { - Collection var2 = this.getScoreboardFromWorldServer().getScoreObjectives(); - ArrayList var3 = new ArrayList(); - Iterator var4 = var2.iterator(); - -- while(true) { -- ScoreObjective var5; -- do { -- if(!var4.hasNext()) { -- return var3; -- } -- -- var5 = (ScoreObjective)var4.next(); -- } while(var1 && var5.getCriteria().isReadOnly()); -- -- var3.add(var5.getName()); -+ while (var4.hasNext()) { -+ ScoreObjective var5 = (ScoreObjective)var4.next(); -+ -+ if (!par1 || !var5.getCriteria().isReadOnly()) { -+ var3.add(var5.getName()); -+ } - } -+ -+ return var3; - } - -- public boolean isUsernameIndex(String[] var1, int var2) { -- return var1[0].equalsIgnoreCase("players") ? var2 == 2 : (!var1[0].equalsIgnoreCase("teams") ? false : var2 == 2 || var2 == 3); -+ /** -+ * Return whether the specified command parameter index is a username parameter. -+ */ -+ public boolean isUsernameIndex(String[] par1ArrayOfStr, int par2) { -+ return par1ArrayOfStr[0].equalsIgnoreCase("players") ? par2 == 2 : (!par1ArrayOfStr[0].equalsIgnoreCase("teams") ? false : par2 == 2 || par2 == 3); - } - } ---- net/minecraft/src/ComponentVillageTorch.java -+++ net/minecraft/src/ComponentVillageTorch.java -@@ -4,39 +4,43 @@ - import java.util.Random; - - public class ComponentVillageTorch extends ComponentVillage { -- public ComponentVillageTorch() { -- } -- -- public ComponentVillageTorch(ComponentVillageStartPiece var1, int var2, Random var3, StructureBoundingBox var4, int var5) { -- super(var1, var2); -- this.coordBaseMode = var5; -- this.boundingBox = var4; -- } -- -- public static StructureBoundingBox func_74904_a(ComponentVillageStartPiece var0, List var1, Random var2, int var3, int var4, int var5, int var6) { -- StructureBoundingBox var7 = StructureBoundingBox.getComponentToAddBoundingBox(var3, var4, var5, 0, 0, 0, 3, 4, 2, var6); -- return StructureComponent.findIntersecting(var1, var7) != null ? null : var7; -- } -- -- public boolean addComponentParts(World var1, Random var2, StructureBoundingBox var3) { -- if(this.field_143015_k < 0) { -- this.field_143015_k = this.getAverageGroundLevel(var1, var3); -- if(this.field_143015_k < 0) { -+ public ComponentVillageTorch() {} -+ -+ public ComponentVillageTorch(ComponentVillageStartPiece par1ComponentVillageStartPiece, int par2, Random par3Random, StructureBoundingBox par4StructureBoundingBox, int par5) { -+ super(par1ComponentVillageStartPiece, par2); -+ this.coordBaseMode = par5; -+ this.boundingBox = par4StructureBoundingBox; -+ } -+ -+ public static StructureBoundingBox func_74904_a(ComponentVillageStartPiece par0ComponentVillageStartPiece, List par1List, Random par2Random, int par3, int par4, int par5, int par6) { -+ StructureBoundingBox var7 = StructureBoundingBox.getComponentToAddBoundingBox(par3, par4, par5, 0, 0, 0, 3, 4, 2, par6); -+ return StructureComponent.findIntersecting(par1List, var7) != null ? null : var7; -+ } -+ -+ /** -+ * second Part of Structure generating, this for example places Spiderwebs, Mob Spawners, it closes Mineshafts at the -+ * end, it adds Fences... -+ */ -+ public boolean addComponentParts(World par1World, Random par2Random, StructureBoundingBox par3StructureBoundingBox) { -+ if (this.field_143015_k < 0) { -+ this.field_143015_k = this.getAverageGroundLevel(par1World, par3StructureBoundingBox); -+ -+ if (this.field_143015_k < 0) { - return true; - } - - this.boundingBox.offset(0, this.field_143015_k - this.boundingBox.maxY + 4 - 1, 0); - } - -- this.fillWithBlocks(var1, var3, 0, 0, 0, 2, 3, 1, 0, 0, false); -- this.placeBlockAtCurrentPosition(var1, Block.fence.blockID, 0, 1, 0, 0, var3); -- this.placeBlockAtCurrentPosition(var1, Block.fence.blockID, 0, 1, 1, 0, var3); -- this.placeBlockAtCurrentPosition(var1, Block.fence.blockID, 0, 1, 2, 0, var3); -- this.placeBlockAtCurrentPosition(var1, Block.cloth.blockID, 15, 1, 3, 0, var3); -- this.placeBlockAtCurrentPosition(var1, Block.torchWood.blockID, 0, 0, 3, 0, var3); -- this.placeBlockAtCurrentPosition(var1, Block.torchWood.blockID, 0, 1, 3, 1, var3); -- this.placeBlockAtCurrentPosition(var1, Block.torchWood.blockID, 0, 2, 3, 0, var3); -- this.placeBlockAtCurrentPosition(var1, Block.torchWood.blockID, 0, 1, 3, -1, var3); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 0, 0, 0, 2, 3, 1, 0, 0, false); -+ this.placeBlockAtCurrentPosition(par1World, Block.fence.blockID, 0, 1, 0, 0, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.fence.blockID, 0, 1, 1, 0, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.fence.blockID, 0, 1, 2, 0, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.cloth.blockID, 15, 1, 3, 0, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.torchWood.blockID, 0, 0, 3, 0, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.torchWood.blockID, 0, 1, 3, 1, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.torchWood.blockID, 0, 2, 3, 0, par3StructureBoundingBox); -+ this.placeBlockAtCurrentPosition(par1World, Block.torchWood.blockID, 0, 1, 3, -1, par3StructureBoundingBox); - return true; - } - } ---- /dev/null -+++ org/spoutcraft/api/util/MutableVector.java -@@ -1,0 +1,617 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.api.util; -+ -+import java.util.Random; -+ -+/** -+ * Represents a mutable vector. Because the components of Vectors are mutable, storing Vectors long term may be dangerous if passing code modifies the Vector later. If you want to keep around a Vector, it may be wise to call clone() in order to get a copy. -+ */ -+public class MutableVector implements Vector { -+ private static Random random = new Random(); -+ -+ /** -+ * Threshold for fuzzy equals(). -+ */ -+ private static final double epsilon = 0.000001; -+ -+ protected double x; -+ protected double y; -+ protected double z; -+ -+ /** -+ * Construct the vector with all components as 0. -+ */ -+ public MutableVector() { -+ this.x = 0; -+ this.y = 0; -+ this.z = 0; -+ } -+ -+ /** -+ * Construct the vector with provided integer components. -+ * -+ * @param x -+ * @param y -+ * @param z -+ */ -+ public MutableVector(int x, int y, int z) { -+ this.x = x; -+ this.y = y; -+ this.z = z; -+ } -+ -+ /** -+ * Construct the vector with provided double components. -+ * -+ * @param x -+ * @param y -+ * @param z -+ */ -+ public MutableVector(double x, double y, double z) { -+ this.x = x; -+ this.y = y; -+ this.z = z; -+ } -+ -+ /** -+ * Construct the vector with provided float components. -+ * -+ * @param x -+ * @param y -+ * @param z -+ */ -+ public MutableVector(float x, float y, float z) { -+ this.x = x; -+ this.y = y; -+ this.z = z; -+ } -+ -+ /** -+ * Adds the vector by another. -+ * -+ * @param vec -+ * @return the same vector -+ */ -+ public Vector add(Vector vec) { -+ x += vec.getX(); -+ y += vec.getY(); -+ z += vec.getZ(); -+ return this; -+ } -+ -+ /** -+ * Subtracts the vector by another. -+ * -+ * @param vec -+ * @return the same vector -+ */ -+ public Vector subtract(Vector vec) { -+ x -= vec.getX(); -+ y -= vec.getY(); -+ z -= vec.getZ(); -+ return this; -+ } -+ -+ /** -+ * Multiplies the vector by another. -+ * -+ * @param vec -+ * @return the same vector -+ */ -+ public Vector multiply(Vector vec) { -+ x *= vec.getX(); -+ y *= vec.getY(); -+ z *= vec.getZ(); -+ return this; -+ } -+ -+ /** -+ * Divides the vector by another. -+ * -+ * @param vec -+ * @return the same vector -+ */ -+ public Vector divide(Vector vec) { -+ x /= vec.getX(); -+ y /= vec.getY(); -+ z /= vec.getZ(); -+ return this; -+ } -+ -+ /** -+ * Copies another vector -+ * -+ * @param vec -+ * @return the same vector -+ */ -+ public Vector copy(Vector vec) { -+ x = vec.getX(); -+ y = vec.getY(); -+ z = vec.getZ(); -+ return this; -+ } -+ -+ /** -+ * Gets the magnitude of the vector, defined as sqrt(x^2+y^2+z^2). The value of this method is not cached and uses a costly square-root function, so do not repeatedly call this method to get the vector's magnitude. NaN will be returned if the inner result of the sqrt() function overflows, which will be caused if the length is too long. -+ * -+ * @return the magnitude -+ */ -+ public double length() { -+ return Math.sqrt(Math.pow(x, 2) + Math.pow(y, 2) + Math.pow(z, 2)); -+ } -+ -+ /** -+ * Gets the magnitude of the vector squared. -+ * -+ * @return the magnitude -+ */ -+ public double lengthSquared() { -+ return Math.pow(x, 2) + Math.pow(y, 2) + Math.pow(z, 2); -+ } -+ -+ /** -+ * Get the distance between this vector and another. The value of this method is not cached and uses a costly square-root function, so do not repeatedly call this method to get the vector's magnitude. NaN will be returned if the inner result of the sqrt() function overflows, which will be caused if the distance is too long. -+ * -+ * @return the distance -+ */ -+ public double distance(Vector o) { -+ return Math.sqrt(Math.pow(x - o.getX(), 2) + Math.pow(y - o.getY(), 2) + Math.pow(z - o.getZ(), 2)); -+ } -+ -+ /** -+ * Get the squared distance between this vector and another. -+ * -+ * @return the distance -+ */ -+ public double distanceSquared(Vector o) { -+ return Math.pow(x - o.getX(), 2) + Math.pow(y - o.getY(), 2) + Math.pow(z - o.getZ(), 2); -+ } -+ -+ /** -+ * Gets the angle between this vector and another in radians. -+ * -+ * @param other -+ * @return angle in radians -+ */ -+ public float angle(Vector other) { -+ double dot = dot(other) / (length() * other.length()); -+ -+ return (float) Math.acos(dot); -+ } -+ -+ /** -+ * Sets this vector to the midpoint between this vector and another. -+ * -+ * @param other -+ * @return this same vector (now a midpoint) -+ */ -+ public Vector midpoint(Vector other) { -+ x = (x + other.getX()) / 2; -+ y = (y + other.getY()) / 2; -+ z = (z + other.getZ()) / 2; -+ return this; -+ } -+ -+ /** -+ * Gets a new midpoint vector between this vector and another. -+ * -+ * @param other -+ * @return a new midpoint vector -+ */ -+ public Vector getMidpoint(Vector other) { -+ x = (x + other.getX()) / 2; -+ y = (y + other.getY()) / 2; -+ z = (z + other.getZ()) / 2; -+ return new MutableVector(x, y, z); -+ } -+ -+ /** -+ * Performs scalar multiplication, multiplying all components with a scalar. -+ * -+ * @param m -+ * @return the same vector -+ */ -+ public Vector multiply(int m) { -+ x *= m; -+ y *= m; -+ z *= m; -+ return this; -+ } -+ -+ /** -+ * Performs scalar multiplication, multiplying all components with a scalar. -+ * -+ * @param m -+ * @return the same vector -+ */ -+ public Vector multiply(double m) { -+ x *= m; -+ y *= m; -+ z *= m; -+ return this; -+ } -+ -+ /** -+ * Performs scalar multiplication, multiplying all components with a scalar. -+ * -+ * @param m -+ * @return the same vector -+ */ -+ public Vector multiply(float m) { -+ x *= m; -+ y *= m; -+ z *= m; -+ return this; -+ } -+ -+ /** -+ * Calculates the dot product of this vector with another. The dot product is defined as x1*x2+y1*y2+z1*z2. The returned value is a scalar. -+ * -+ * @param other -+ * @return dot product -+ */ -+ public double dot(Vector other) { -+ return x * other.getX() + y * other.getY() + z * other.getZ(); -+ } -+ -+ /** -+ * Calculates the cross product of this vector with another. The cross product is defined as: -+ * -+ * x = y1 * z2 - y2 * z1
-+ * y = z1 * x2 - z2 * x1
-+ * z = x1 * y2 - x2 * y1 -+ * -+ * @param o -+ * @return the same vector -+ */ -+ public Vector crossProduct(Vector o) { -+ double newX = y * o.getZ() - o.getY() * z; -+ double newY = z * o.getX() - o.getZ() * x; -+ double newZ = x * o.getY() - o.getX() * y; -+ -+ x = newX; -+ y = newY; -+ z = newZ; -+ return this; -+ } -+ -+ /** -+ * Converts this vector to a unit vector (a vector with length of 1). -+ * -+ * @return the same vector -+ */ -+ public Vector normalize() { -+ double length = length(); -+ -+ x /= length; -+ y /= length; -+ z /= length; -+ -+ return this; -+ } -+ -+ /** -+ * Zero this vector's components. -+ * -+ * @return the same vector -+ */ -+ public Vector zero() { -+ x = 0; -+ y = 0; -+ z = 0; -+ return this; -+ } -+ -+ /** -+ * Returns whether this vector is in an axis-aligned bounding box. The minimum and maximum vectors given must be truly the minimum and maximum X, Y and Z components. -+ * -+ * @param min -+ * @param max -+ * @return whether this vector is in the AABB -+ */ -+ public boolean isInAABB(Vector min, Vector max) { -+ return x >= min.getX() && x <= max.getX() && y >= min.getY() && y <= max.getY() && z >= min.getZ() && z <= max.getZ(); -+ } -+ -+ /** -+ * Returns whether this vector is within a sphere. -+ * -+ * @param origin -+ * @param radius -+ * @return whether this vector is in the sphere -+ */ -+ public boolean isInSphere(Vector origin, double radius) { -+ return (Math.pow(origin.getX() - x, 2) + Math.pow(origin.getY() - y, 2) + Math.pow(origin.getZ() - z, 2)) <= Math.pow(radius, 2); -+ } -+ -+ /** -+ * Gets the X component. -+ * -+ * @return -+ */ -+ public double getX() { -+ return x; -+ } -+ -+ /** -+ * Gets the floored value of the X component, indicating the block that this vector is contained with. -+ * -+ * @return block X -+ */ -+ public int getBlockX() { -+ return (int) Math.floor(x); -+ } -+ -+ /** -+ * Gets the Y component. -+ * -+ * @return -+ */ -+ public double getY() { -+ return y; -+ } -+ -+ /** -+ * Gets the floored value of the Y component, indicating the block that this vector is contained with. -+ * -+ * @return block y -+ */ -+ public int getBlockY() { -+ return (int) Math.floor(y); -+ } -+ -+ /** -+ * Gets the Z component. -+ * -+ * @return -+ */ -+ public double getZ() { -+ return z; -+ } -+ -+ /** -+ * Gets the floored value of the Z component, indicating the block that this vector is contained with. -+ * -+ * @return block z -+ */ -+ public int getBlockZ() { -+ return (int) Math.floor(z); -+ } -+ -+ /** -+ * Set the X component. -+ * -+ * @param x -+ * @return x -+ */ -+ public Vector setX(int x) { -+ this.x = x; -+ return this; -+ } -+ -+ /** -+ * Set the X component. -+ * -+ * @param x -+ * @return x -+ */ -+ public Vector setX(double x) { -+ this.x = x; -+ return this; -+ } -+ -+ /** -+ * Set the X component. -+ * -+ * @param x -+ * @return x -+ */ -+ public Vector setX(float x) { -+ this.x = x; -+ return this; -+ } -+ -+ /** -+ * Set the Y component. -+ * -+ * @param y -+ * @return y -+ */ -+ public Vector setY(int y) { -+ this.y = y; -+ return this; -+ } -+ -+ /** -+ * Set the Y component. -+ * -+ * @param y -+ * @return y -+ */ -+ public Vector setY(double y) { -+ this.y = y; -+ return this; -+ } -+ -+ /** -+ * Set the Y component. -+ * -+ * @param y -+ * @return y -+ */ -+ public Vector setY(float y) { -+ this.y = y; -+ return this; -+ } -+ -+ /** -+ * Set the Z component. -+ * -+ * @param z -+ * @return z -+ */ -+ public Vector setZ(int z) { -+ this.z = z; -+ return this; -+ } -+ -+ /** -+ * Set the Z component. -+ * -+ * @param z -+ * @return z -+ */ -+ public Vector setZ(double z) { -+ this.z = z; -+ return this; -+ } -+ -+ /** -+ * Set the Z component. -+ * -+ * @param z -+ * @return z -+ */ -+ public Vector setZ(float z) { -+ this.z = z; -+ return this; -+ } -+ -+ /** -+ * Checks to see if two objects are equal. -+ * -+ * Only two Vectors can ever return true. This method uses a fuzzy match to account for floating point errors. The epsilon can be retrieved with epsilon. -+ */ -+ @Override -+ public boolean equals(Object obj) { -+ if (!(obj instanceof Vector)) { -+ return false; -+ } -+ -+ Vector other = (Vector) obj; -+ -+ return Math.abs(x - other.getX()) < epsilon && Math.abs(y - other.getY()) < epsilon && Math.abs(z - other.getZ()) < epsilon && (this.getClass().equals(obj.getClass())); -+ } -+ -+ /** -+ * Returns a hash code for this vector -+ * -+ * @return hash code -+ */ -+ @Override -+ public int hashCode() { -+ int hash = 7; -+ -+ hash = 79 * hash + (int) (Double.doubleToLongBits(this.x) ^ (Double.doubleToLongBits(this.x) >>> 32)); -+ hash = 79 * hash + (int) (Double.doubleToLongBits(this.y) ^ (Double.doubleToLongBits(this.y) >>> 32)); -+ hash = 79 * hash + (int) (Double.doubleToLongBits(this.z) ^ (Double.doubleToLongBits(this.z) >>> 32)); -+ return hash; -+ } -+ -+ /** -+ * Get a new vector. -+ * -+ * @return vector -+ */ -+ @Override -+ public Vector clone() { -+ Vector v; -+ try { -+ v = (Vector) super.clone(); -+ v.setX(x); -+ v.setY(y); -+ v.setZ(z); -+ return v; -+ } catch (CloneNotSupportedException e) { -+ e.printStackTrace(); -+ } -+ return null; -+ } -+ -+ /** -+ * Returns this vector's components as x,y,z. -+ * -+ */ -+ @Override -+ public String toString() { -+ return x + "," + y + "," + z; -+ } -+ -+ /** -+ * Gets a Location version of this vector with yaw and pitch being 0. -+ * -+ * @param world -+ * @return the location -+ */ -+ public Location toLocation() { -+ return new MutableLocation(x, y, z); -+ } -+ -+ /** -+ * Gets a Location version of this vector. -+ * -+ * @param world -+ * @return the location -+ */ -+ public Location toLocation(float yaw, float pitch) { -+ return new MutableLocation(x, y, z, yaw, pitch); -+ } -+ -+ /** -+ * Get the threshold used for equals(). -+ * -+ * @return -+ */ -+ public static double getEpsilon() { -+ return epsilon; -+ } -+ -+ /** -+ * Gets the minimum components of two vectors. -+ * -+ * @param v1 -+ * @param v2 -+ * @return minimum -+ */ -+ public static Vector getMinimum(Vector v1, Vector v2) { -+ return new MutableVector(Math.min(v1.getX(), v2.getX()), Math.min(v1.getY(), v2.getY()), Math.min(v1.getZ(), v2.getZ())); -+ } -+ -+ /** -+ * Gets the maximum components of two vectors. -+ * -+ * @param v1 -+ * @param v2 -+ * @return maximum -+ */ -+ public static Vector getMaximum(Vector v1, Vector v2) { -+ return new MutableVector(Math.max(v1.getX(), v2.getZ()), Math.max(v1.getY(), v2.getY()), Math.max(v1.getZ(), v2.getZ())); -+ } -+ -+ /** -+ * Gets a random vector with components having a random value between 0 and 1. -+ * -+ * @return -+ */ -+ public static Vector getRandom() { -+ return new MutableVector(random.nextDouble(), random.nextDouble(), random.nextDouble()); -+ } -+} ---- /dev/null -+++ org/spoutcraft/client/gui/settings/controls/HotbarQuickKeysButton.java -@@ -1,0 +1,37 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.client.gui.settings.controls; -+ -+import org.spoutcraft.api.gui.GenericCheckBox; -+import org.spoutcraft.client.config.Configuration; -+ -+public class HotbarQuickKeysButton extends GenericCheckBox { -+ public HotbarQuickKeysButton() { -+ super("Num Keys Switch Items"); -+ setChecked(Configuration.isHotbarQuickKeysEnabled()); -+ setTooltip("The 0-9 keys switch through the hotbar items\nOFF - 0-9 keys do not switch through hotbar items\nON - (Default) 0-9 keys switch through hotbar items"); -+ } -+ -+ @Override -+ public void onButtonClick() { -+ Configuration.setHotbarQuickKeysEnabled(!Configuration.isHotbarQuickKeysEnabled()); -+ Configuration.write(); -+ } -+} ---- net/minecraft/src/ItemTool.java -+++ net/minecraft/src/ItemTool.java -@@ -3,25 +3,35 @@ - import com.google.common.collect.Multimap; - - public class ItemTool extends Item { -+ -+ /** Array of blocks the tool has extra effect against. */ - private Block[] blocksEffectiveAgainst; - protected float efficiencyOnProperMaterial = 4.0F; -+ -+ /** Damage versus entities. */ - private float damageVsEntity; -+ -+ /** The material this tool is made from. */ - protected EnumToolMaterial toolMaterial; - -- protected ItemTool(int var1, float var2, EnumToolMaterial var3, Block[] var4) { -- super(var1); -- this.toolMaterial = var3; -- this.blocksEffectiveAgainst = var4; -+ protected ItemTool(int par1, float par2, EnumToolMaterial par3EnumToolMaterial, Block[] par4ArrayOfBlock) { -+ super(par1); -+ this.toolMaterial = par3EnumToolMaterial; -+ this.blocksEffectiveAgainst = par4ArrayOfBlock; - this.maxStackSize = 1; -- this.setMaxDamage(var3.getMaxUses()); -- this.efficiencyOnProperMaterial = var3.getEfficiencyOnProperMaterial(); -- this.damageVsEntity = var2 + var3.getDamageVsEntity(); -+ this.setMaxDamage(par3EnumToolMaterial.getMaxUses()); -+ this.efficiencyOnProperMaterial = par3EnumToolMaterial.getEfficiencyOnProperMaterial(); -+ this.damageVsEntity = par2 + par3EnumToolMaterial.getDamageVsEntity(); - this.setCreativeTab(CreativeTabs.tabTools); - } - -- public float getStrVsBlock(ItemStack var1, Block var2) { -- for(int var3 = 0; var3 < this.blocksEffectiveAgainst.length; ++var3) { -- if(this.blocksEffectiveAgainst[var3] == var2) { -+ /** -+ * Returns the strength of the stack against a given block. 1.0F base, (Quality+1)*2 if correct blocktype, 1.5F if -+ * sword -+ */ -+ public float getStrVsBlock(ItemStack par1ItemStack, Block par2Block) { -+ for (int var3 = 0; var3 < this.blocksEffectiveAgainst.length; ++var3) { -+ if (this.blocksEffectiveAgainst[var3] == par2Block) { - return this.efficiencyOnProperMaterial; - } - } -@@ -29,38 +39,57 @@ - return 1.0F; - } - -- public boolean hitEntity(ItemStack var1, EntityLivingBase var2, EntityLivingBase var3) { -- var1.damageItem(2, var3); -+ /** -+ * Current implementations of this method in child classes do not use the entry argument beside ev. They just raise the -+ * damage on the stack. -+ */ -+ public boolean hitEntity(ItemStack par1ItemStack, EntityLivingBase par2EntityLivingBase, EntityLivingBase par3EntityLivingBase) { -+ par1ItemStack.damageItem(2, par3EntityLivingBase); - return true; - } - -- public boolean onBlockDestroyed(ItemStack var1, World var2, int var3, int var4, int var5, int var6, EntityLivingBase var7) { -- if((double)Block.blocksList[var3].getBlockHardness(var2, var4, var5, var6) != 0.0D) { -- var1.damageItem(1, var7); -+ public boolean onBlockDestroyed(ItemStack par1ItemStack, World par2World, int par3, int par4, int par5, int par6, EntityLivingBase par7EntityLivingBase) { -+ if ((double)Block.blocksList[par3].getBlockHardness(par2World, par4, par5, par6) != 0.0D) { -+ par1ItemStack.damageItem(1, par7EntityLivingBase); - } - - return true; - } - -+ /** -+ * Returns True is the item is renderer in full 3D when hold. -+ */ - public boolean isFull3D() { - return true; - } - -+ /** -+ * Return the enchantability factor of the item, most of the time is based on material. -+ */ - public int getItemEnchantability() { - return this.toolMaterial.getEnchantability(); - } - -+ /** -+ * Return the name for this tool's material. -+ */ - public String getToolMaterialName() { - return this.toolMaterial.toString(); - } - -- public boolean getIsRepairable(ItemStack var1, ItemStack var2) { -- return this.toolMaterial.getToolCraftingMaterial() == var2.itemID ? true : super.getIsRepairable(var1, var2); -+ /** -+ * Return whether this item is repairable in an anvil. -+ */ -+ public boolean getIsRepairable(ItemStack par1ItemStack, ItemStack par2ItemStack) { -+ return this.toolMaterial.getToolCraftingMaterial() == par2ItemStack.itemID ? true : super.getIsRepairable(par1ItemStack, par2ItemStack); - } - -+ /** -+ * Gets a map of item attribute modifiers, used by ItemSword to increase hit damage. -+ */ - public Multimap getItemAttributeModifiers() { - Multimap var1 = super.getItemAttributeModifiers(); -- var1.put(SharedMonsterAttributes.attackDamage.getAttributeUnlocalizedName(), new AttributeModifier(e, "Tool modifier", (double)this.damageVsEntity, 0)); -+ var1.put(SharedMonsterAttributes.attackDamage.getAttributeUnlocalizedName(), new AttributeModifier(field_111210_e, "Tool modifier", (double)this.damageVsEntity, 0)); - return var1; - } - } ---- net/minecraft/src/EntityMinecartContainer.java -+++ net/minecraft/src/EntityMinecartContainer.java -@@ -2,60 +2,75 @@ - - public abstract class EntityMinecartContainer extends EntityMinecart implements IInventory { - private ItemStack[] minecartContainerItems = new ItemStack[36]; -+ -+ /** -+ * When set to true, the minecart will drop all items when setDead() is called. When false (such as when travelling -+ * dimensions) it preserves its contents. -+ */ - private boolean dropContentsWhenDead = true; - -- public EntityMinecartContainer(World var1) { -- super(var1); -- } -- -- public EntityMinecartContainer(World var1, double var2, double var4, double var6) { -- super(var1, var2, var4, var6); -- } -- -- public void killMinecart(DamageSource var1) { -- super.killMinecart(var1); -- -- for(int var2 = 0; var2 < this.getSizeInventory(); ++var2) { -+ public EntityMinecartContainer(World par1World) { -+ super(par1World); -+ } -+ -+ public EntityMinecartContainer(World par1World, double par2, double par4, double par6) { -+ super(par1World, par2, par4, par6); -+ } -+ -+ public void killMinecart(DamageSource par1DamageSource) { -+ super.killMinecart(par1DamageSource); -+ -+ for (int var2 = 0; var2 < this.getSizeInventory(); ++var2) { - ItemStack var3 = this.getStackInSlot(var2); -- if(var3 != null) { -- float var4 = this.ab.nextFloat() * 0.8F + 0.1F; -- float var5 = this.ab.nextFloat() * 0.8F + 0.1F; -- float var6 = this.ab.nextFloat() * 0.8F + 0.1F; -- -- while(var3.stackSize > 0) { -- int var7 = this.ab.nextInt(21) + 10; -- if(var7 > var3.stackSize) { -+ -+ if (var3 != null) { -+ float var4 = this.rand.nextFloat() * 0.8F + 0.1F; -+ float var5 = this.rand.nextFloat() * 0.8F + 0.1F; -+ float var6 = this.rand.nextFloat() * 0.8F + 0.1F; -+ -+ while (var3.stackSize > 0) { -+ int var7 = this.rand.nextInt(21) + 10; -+ -+ if (var7 > var3.stackSize) { - var7 = var3.stackSize; - } - - var3.stackSize -= var7; - EntityItem var8 = new EntityItem(this.worldObj, this.posX + (double)var4, this.posY + (double)var5, this.posZ + (double)var6, new ItemStack(var3.itemID, var7, var3.getItemDamage())); - float var9 = 0.05F; -- var8.motionX = (double)((float)this.ab.nextGaussian() * var9); -- var8.motionY = (double)((float)this.ab.nextGaussian() * var9 + 0.2F); -- var8.motionZ = (double)((float)this.ab.nextGaussian() * var9); -+ var8.motionX = (double)((float)this.rand.nextGaussian() * var9); -+ var8.motionY = (double)((float)this.rand.nextGaussian() * var9 + 0.2F); -+ var8.motionZ = (double)((float)this.rand.nextGaussian() * var9); - this.worldObj.spawnEntityInWorld(var8); - } - } - } -- -- } -- -- public ItemStack getStackInSlot(int var1) { -- return this.minecartContainerItems[var1]; -- } -- -- public ItemStack decrStackSize(int var1, int var2) { -- if(this.minecartContainerItems[var1] != null) { -+ } -+ -+ /** -+ * Returns the stack in slot i -+ */ -+ public ItemStack getStackInSlot(int par1) { -+ return this.minecartContainerItems[par1]; -+ } -+ -+ /** -+ * Removes from an inventory slot (first arg) up to a specified number (second arg) of items and returns them in a new -+ * stack. -+ */ -+ public ItemStack decrStackSize(int par1, int par2) { -+ if (this.minecartContainerItems[par1] != null) { - ItemStack var3; -- if(this.minecartContainerItems[var1].stackSize <= var2) { -- var3 = this.minecartContainerItems[var1]; -- this.minecartContainerItems[var1] = null; -+ -+ if (this.minecartContainerItems[par1].stackSize <= par2) { -+ var3 = this.minecartContainerItems[par1]; -+ this.minecartContainerItems[par1] = null; - return var3; - } else { -- var3 = this.minecartContainerItems[var1].splitStack(var2); -- if(this.minecartContainerItems[var1].stackSize == 0) { -- this.minecartContainerItems[var1] = null; -+ var3 = this.minecartContainerItems[par1].splitStack(par2); -+ -+ if (this.minecartContainerItems[par1].stackSize == 0) { -+ this.minecartContainerItems[par1] = null; - } - - return var3; -@@ -65,79 +80,108 @@ - } - } - -- public ItemStack getStackInSlotOnClosing(int var1) { -- if(this.minecartContainerItems[var1] != null) { -- ItemStack var2 = this.minecartContainerItems[var1]; -- this.minecartContainerItems[var1] = null; -+ /** -+ * When some containers are closed they call this on each slot, then drop whatever it returns as an EntityItem - like -+ * when you close a workbench GUI. -+ */ -+ public ItemStack getStackInSlotOnClosing(int par1) { -+ if (this.minecartContainerItems[par1] != null) { -+ ItemStack var2 = this.minecartContainerItems[par1]; -+ this.minecartContainerItems[par1] = null; - return var2; - } else { - return null; - } - } - -- public void setInventorySlotContents(int var1, ItemStack var2) { -- this.minecartContainerItems[var1] = var2; -- if(var2 != null && var2.stackSize > this.getInventoryStackLimit()) { -- var2.stackSize = this.getInventoryStackLimit(); -+ /** -+ * Sets the given item stack to the specified slot in the inventory (can be crafting or armor sections). -+ */ -+ public void setInventorySlotContents(int par1, ItemStack par2ItemStack) { -+ this.minecartContainerItems[par1] = par2ItemStack; -+ -+ if (par2ItemStack != null && par2ItemStack.stackSize > this.getInventoryStackLimit()) { -+ par2ItemStack.stackSize = this.getInventoryStackLimit(); - } -- -- } -- -- public void onInventoryChanged() { -- } -- -- public boolean isUseableByPlayer(EntityPlayer var1) { -- return this.isDead ? false : var1.getDistanceSqToEntity(this) <= 64.0D; -- } -- -- public void openChest() { -- } -- -- public void closeChest() { -- } -- -- public boolean isItemValidForSlot(int var1, ItemStack var2) { -+ } -+ -+ /** -+ * Called when an the contents of an Inventory change, usually -+ */ -+ public void onInventoryChanged() {} -+ -+ /** -+ * Do not make give this method the name canInteractWith because it clashes with Container -+ */ -+ public boolean isUseableByPlayer(EntityPlayer par1EntityPlayer) { -+ return this.isDead ? false : par1EntityPlayer.getDistanceSqToEntity(this) <= 64.0D; -+ } -+ -+ public void openChest() {} -+ -+ public void closeChest() {} -+ -+ /** -+ * Returns true if automation is allowed to insert the given stack (ignoring stack size) into the given slot. -+ */ -+ public boolean isItemValidForSlot(int par1, ItemStack par2ItemStack) { - return true; - } - -+ /** -+ * Returns the name of the inventory. -+ */ - public String getInvName() { - return this.isInvNameLocalized() ? this.func_95999_t() : "container.minecart"; - } - -+ /** -+ * Returns the maximum stack size for a inventory slot. Seems to always be 64, possibly will be extended. *Isn't this -+ * more of a set than a get?* -+ */ - public int getInventoryStackLimit() { - return 64; - } - -- public void travelToDimension(int var1) { -+ /** -+ * Teleports the entity to another dimension. Params: Dimension number to teleport to -+ */ -+ public void travelToDimension(int par1) { - this.dropContentsWhenDead = false; -- super.travelToDimension(var1); -+ super.travelToDimension(par1); - } - -+ /** -+ * Will get destroyed next tick. -+ */ - public void setDead() { -- if(this.dropContentsWhenDead) { -- for(int var1 = 0; var1 < this.getSizeInventory(); ++var1) { -+ if (this.dropContentsWhenDead) { -+ for (int var1 = 0; var1 < this.getSizeInventory(); ++var1) { - ItemStack var2 = this.getStackInSlot(var1); -- if(var2 != null) { -- float var3 = this.ab.nextFloat() * 0.8F + 0.1F; -- float var4 = this.ab.nextFloat() * 0.8F + 0.1F; -- float var5 = this.ab.nextFloat() * 0.8F + 0.1F; -- -- while(var2.stackSize > 0) { -- int var6 = this.ab.nextInt(21) + 10; -- if(var6 > var2.stackSize) { -+ -+ if (var2 != null) { -+ float var3 = this.rand.nextFloat() * 0.8F + 0.1F; -+ float var4 = this.rand.nextFloat() * 0.8F + 0.1F; -+ float var5 = this.rand.nextFloat() * 0.8F + 0.1F; -+ -+ while (var2.stackSize > 0) { -+ int var6 = this.rand.nextInt(21) + 10; -+ -+ if (var6 > var2.stackSize) { - var6 = var2.stackSize; - } - - var2.stackSize -= var6; - EntityItem var7 = new EntityItem(this.worldObj, this.posX + (double)var3, this.posY + (double)var4, this.posZ + (double)var5, new ItemStack(var2.itemID, var6, var2.getItemDamage())); -- if(var2.hasTagCompound()) { -+ -+ if (var2.hasTagCompound()) { - var7.getEntityItem().setTagCompound((NBTTagCompound)var2.getTagCompound().copy()); - } - - float var8 = 0.05F; -- var7.motionX = (double)((float)this.ab.nextGaussian() * var8); -- var7.motionY = (double)((float)this.ab.nextGaussian() * var8 + 0.2F); -- var7.motionZ = (double)((float)this.ab.nextGaussian() * var8); -+ var7.motionX = (double)((float)this.rand.nextGaussian() * var8); -+ var7.motionY = (double)((float)this.rand.nextGaussian() * var8 + 0.2F); -+ var7.motionZ = (double)((float)this.rand.nextGaussian() * var8); - this.worldObj.spawnEntityInWorld(var7); - } - } -@@ -147,12 +191,15 @@ - super.setDead(); - } - -- protected void writeEntityToNBT(NBTTagCompound var1) { -- super.writeEntityToNBT(var1); -+ /** -+ * (abstract) Protected helper method to write subclass entity data to NBT. -+ */ -+ protected void writeEntityToNBT(NBTTagCompound par1NBTTagCompound) { -+ super.writeEntityToNBT(par1NBTTagCompound); - NBTTagList var2 = new NBTTagList(); - -- for(int var3 = 0; var3 < this.minecartContainerItems.length; ++var3) { -- if(this.minecartContainerItems[var3] != null) { -+ for (int var3 = 0; var3 < this.minecartContainerItems.length; ++var3) { -+ if (this.minecartContainerItems[var3] != null) { - NBTTagCompound var4 = new NBTTagCompound(); - var4.setByte("Slot", (byte)var3); - this.minecartContainerItems[var3].writeToNBT(var4); -@@ -160,27 +207,33 @@ - } - } - -- var1.setTag("Items", var2); -+ par1NBTTagCompound.setTag("Items", var2); - } - -- protected void readEntityFromNBT(NBTTagCompound var1) { -- super.readEntityFromNBT(var1); -- NBTTagList var2 = var1.getTagList("Items"); -+ /** -+ * (abstract) Protected helper method to read subclass entity data from NBT. -+ */ -+ protected void readEntityFromNBT(NBTTagCompound par1NBTTagCompound) { -+ super.readEntityFromNBT(par1NBTTagCompound); -+ NBTTagList var2 = par1NBTTagCompound.getTagList("Items"); - this.minecartContainerItems = new ItemStack[this.getSizeInventory()]; - -- for(int var3 = 0; var3 < var2.tagCount(); ++var3) { -+ for (int var3 = 0; var3 < var2.tagCount(); ++var3) { - NBTTagCompound var4 = (NBTTagCompound)var2.tagAt(var3); - int var5 = var4.getByte("Slot") & 255; -- if(var5 >= 0 && var5 < this.minecartContainerItems.length) { -+ -+ if (var5 >= 0 && var5 < this.minecartContainerItems.length) { - this.minecartContainerItems[var5] = ItemStack.loadItemStackFromNBT(var4); - } - } -- - } - -- public boolean interactFirst(EntityPlayer var1) { -- if(!this.worldObj.isRemote) { -- var1.displayGUIChest(this); -+ /** -+ * First layer of player interaction -+ */ -+ public boolean interactFirst(EntityPlayer par1EntityPlayer) { -+ if (!this.worldObj.isRemote) { -+ par1EntityPlayer.displayGUIChest(this); - } - - return true; ---- /dev/null -+++ org/spoutcraft/client/gui/server/ServerDataBaseEntry.java -@@ -1,0 +1,28 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.client.gui.server; -+ -+public class ServerDataBaseEntry { -+ public String name; -+ public String ip; -+ public int port; -+ public String forumpost; -+ public String icon; -+} ---- /dev/null -+++ org/spoutcraft/client/inventory/SimpleMaterialManager.java -@@ -1,0 +1,303 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.client.inventory; -+ -+import java.util.ArrayList; -+import java.util.List; -+ -+import gnu.trove.map.hash.TIntByteHashMap; -+import gnu.trove.map.hash.TIntIntHashMap; -+ -+import net.minecraft.src.Minecraft; -+import net.minecraft.src.Item; -+ -+import org.spoutcraft.api.inventory.ItemStack; -+import org.spoutcraft.api.inventory.MaterialManager; -+import org.spoutcraft.api.inventory.Recipe; -+import org.spoutcraft.api.inventory.ShapedRecipe; -+import org.spoutcraft.api.inventory.ShapelessRecipe; -+import org.spoutcraft.api.material.CustomBlock; -+import org.spoutcraft.api.material.Material; -+import org.spoutcraft.api.material.MaterialData; -+import org.spoutcraft.api.util.map.TIntPairFloatHashMap; -+import org.spoutcraft.api.util.map.TIntPairObjectHashMap; -+ -+public class SimpleMaterialManager implements MaterialManager { -+ private final TIntPairFloatHashMap originalHardness = new TIntPairFloatHashMap(); -+ private final TIntPairFloatHashMap originalFriction = new TIntPairFloatHashMap(); -+ private final TIntByteHashMap originalOpacity = new TIntByteHashMap(); -+ private final TIntIntHashMap originalLight = new TIntIntHashMap(); -+ -+ private final TIntPairObjectHashMap customNames = new TIntPairObjectHashMap(100); -+ private final TIntPairObjectHashMap customTextures = new TIntPairObjectHashMap(100); -+ private final TIntPairObjectHashMap customTexturesPlugin = new TIntPairObjectHashMap(100); -+ -+ public float getFriction(org.spoutcraft.api.material.Block block) { -+ int id = block.getRawId(); -+ if (block instanceof CustomBlock) { -+ id = ((CustomBlock) block).getBlockId(); -+ } -+ -+ return net.minecraft.src.Block.blocksList[id].slipperiness; -+ } -+ -+ public void setFriction(org.spoutcraft.api.material.Block block, float friction) { -+ int id = block.getRawId(); -+ int data = block.getRawData(); -+ if (block instanceof CustomBlock) { -+ id = ((CustomBlock) block).getBlockId(); -+ } -+ if (!originalFriction.containsKey(id, data)) { -+ originalFriction.put(id, data, getFriction(block)); -+ } -+ net.minecraft.src.Block.blocksList[id].slipperiness = friction; -+ } -+ -+ public void resetFriction(org.spoutcraft.api.material.Block block) { -+ int id = block.getRawId(); -+ int data = block.getRawData(); -+ if (block instanceof CustomBlock) { -+ id = ((CustomBlock) block).getBlockId(); -+ } -+ if (originalFriction.containsKey(id, data)) { -+ setFriction(block, originalFriction.get(id, data)); -+ originalFriction.remove(id, data); -+ } -+ } -+ -+ public float getHardness(org.spoutcraft.api.material.Block block) { -+ int id = block.getRawId(); -+ if (block instanceof CustomBlock) { -+ id = ((CustomBlock) block).getBlockId(); -+ } -+ return net.minecraft.src.Block.blocksList[id].getHardness(); -+ } -+ -+ public void setHardness(org.spoutcraft.api.material.Block block, float hardness) { -+ int id = block.getRawId(); -+ if (block instanceof CustomBlock) { -+ id = ((CustomBlock) block).getBlockId(); -+ } -+ net.minecraft.src.Block.blocksList[id].blockHardness = hardness; -+ } -+ -+ public void resetHardness(org.spoutcraft.api.material.Block block) { -+ int id = block.getRawId(); -+ int data = block.getRawData(); -+ if (block instanceof CustomBlock) { -+ id = ((CustomBlock) block).getBlockId(); -+ } -+ if (originalHardness.containsKey(id, data)) { -+ setHardness(block, originalHardness.get(id, data)); -+ originalHardness.remove(id, data); -+ } -+ } -+ -+ public boolean isOpaque(org.spoutcraft.api.material.Block block) { -+ int id = block.getRawId(); -+ if (block instanceof CustomBlock) { -+ id = ((CustomBlock) block).getBlockId(); -+ } -+ return net.minecraft.src.Block.opaqueCubeLookup[id]; -+ } -+ -+ public void setOpaque(org.spoutcraft.api.material.Block block, boolean opacity) { -+ int id = block.getRawId(); -+ if (block instanceof CustomBlock) { -+ id = ((CustomBlock) block).getBlockId(); -+ } -+ if (!originalOpacity.containsKey(id)) { -+ originalOpacity.put(id, (byte) (isOpaque(block) ? 1 : 0)); -+ } -+ net.minecraft.src.Block.opaqueCubeLookup[id] = opacity; -+ } -+ -+ public void resetOpacity(org.spoutcraft.api.material.Block block) { -+ int id = block.getRawId(); -+ if (block instanceof CustomBlock) { -+ id = ((CustomBlock) block).getBlockId(); -+ } -+ if (originalOpacity.containsKey(id)) { -+ setOpaque(block, originalOpacity.get(id) != 0); -+ originalOpacity.remove(id); -+ } -+ } -+ -+ public int getLightLevel(org.spoutcraft.api.material.Block block) { -+ int id = block.getRawId(); -+ if (block instanceof CustomBlock) { -+ id = ((CustomBlock) block).getBlockId(); -+ } -+ return net.minecraft.src.Block.lightValue[id]; -+ } -+ -+ public void setLightLevel(org.spoutcraft.api.material.Block block, int level) { -+ int id = block.getRawId(); -+ if (block instanceof CustomBlock) { -+ id = ((CustomBlock) block).getBlockId(); -+ } -+ if (!originalLight.containsKey(id)) { -+ originalLight.put(id, getLightLevel(block)); -+ } -+ net.minecraft.src.Block.lightValue[id] = level; -+ } -+ -+ public void resetLightLevel(org.spoutcraft.api.material.Block block) { -+ int id = block.getRawId(); -+ if (block instanceof CustomBlock) { -+ id = ((CustomBlock) block).getBlockId(); -+ } -+ if (originalLight.containsKey(id)) { -+ setLightLevel(block, originalLight.get(id)); -+ originalLight.remove(id); -+ } -+ } -+ -+ public void setItemName(Material item, String name) { -+ customNames.put(item.getRawId(), item.getRawData(), name); -+ } -+ -+ public void resetName(Material item) { -+ int id = item.getRawId(); -+ int data = item.getRawData(); -+ if (customNames.containsKey(id, data)) { -+ customNames.remove(id, data); -+ } -+ } -+ -+ public void setItemTexture(Material item, String addon, String texture) { -+ int id = item.getRawId(); -+ int data = item.getRawData(); -+ String addonName = addon; -+ customTextures.put(id, data, texture); -+ if (addonName == null) { -+ customTexturesPlugin.remove(id, data); -+ } else { -+ customTexturesPlugin.put(id, data, addonName); -+ } -+ } -+ -+ public String getCustomItemTexture(Material item) { -+ if (item == null) return null; -+ int id = item.getRawId(); -+ int data = item.getRawData(); -+ if (customTextures.containsKey(id, data)) { -+ return (String) customTextures.get(id, data); -+ } -+ return null; -+ } -+ -+ public String getCustomItemTextureAddon(Material item) { -+ if (item == null) return null; -+ int id = item.getRawId(); -+ int data = item.getRawData(); -+ if (customTexturesPlugin.containsKey(id, data)) { -+ return (String) customTexturesPlugin.get(id, data); -+ } -+ return null; -+ } -+ -+ public void resetTexture(Material item) { -+ int id = item.getRawId(); -+ int data = item.getRawData(); -+ if (customTextures.containsKey(id, data)) { -+ customTextures.remove(id, data); -+ } -+ } -+ -+ public void reset() { -+ for (Material next : MaterialData.getMaterials()) { -+ if (next instanceof org.spoutcraft.api.material.Block) { -+ org.spoutcraft.api.material.Block block = (org.spoutcraft.api.material.Block)next; -+ resetFriction(block); -+ resetHardness(block); -+ resetOpacity(block); -+ resetLightLevel(block); -+ } -+ } -+ } -+ -+ public boolean registerRecipe(Recipe recipe) { -+ SpoutcraftRecipe toAdd; -+ -+ if (recipe instanceof ShapedRecipe) { -+ toAdd = SimpleShapedRecipe.fromSpoutRecipe((ShapedRecipe) recipe); -+ } else if (recipe instanceof ShapelessRecipe) { -+ toAdd = SimpleShapelessRecipe.fromSpoutRecipe((ShapelessRecipe) recipe); -+ } else { -+ return false; -+ } -+ -+ toAdd.addToCraftingManager(); -+ return true; -+ } -+ -+ @SuppressWarnings("unchecked") -+ @Override -+ public String getToolTip(ItemStack is) { -+ net.minecraft.src.ItemStack itemstack = null; -+ if (is instanceof CraftItemStack) { -+ itemstack = ((CraftItemStack)is).item; -+ } -+ else { -+ itemstack = is.asNMSItenStack(); -+ } -+ -+ Item rawItem = Item.itemsList[itemstack.itemID]; -+ List list; -+ if (rawItem != null) { -+ list = itemstack.getTooltip(Minecraft.getMinecraft().thePlayer, Minecraft.getMinecraft().gameSettings.advancedItemTooltips); -+ } else { -+ list = new ArrayList(); -+ } -+ -+ if (itemstack.itemID == MaterialData.flint.getRawId()) { -+ Material item = MaterialData.getMaterial(is.getTypeId(), is.getDurability()); -+ String custom = item != null ? String.format(item.getName(), String.valueOf(is.getDurability())) : null; -+ if (custom != null && is.getTypeId() != Item.potion.itemID) { -+ if (list.size() > 0) { -+ list.set(0, custom); -+ } else { -+ list.add(custom); -+ } -+ } -+ } -+ if (list.size() > 0) { -+ String tooltip = ""; -+ int lines = 0; -+ for (int i = 0; i < list.size(); i++) { -+ String s = (String)list.get(i); -+ if (i == 0 && rawItem!=null) { -+ if (itemstack != null && itemstack.hasDisplayName()) { -+ s = "\u00a7o" + itemstack.getDisplayName() + "\u00a7r"; -+ } -+ s = (new StringBuilder()).append("\247").append(Integer.toHexString(itemstack.getRarity().rarityColor)).append(s).toString(); -+ } else { -+ s = (new StringBuilder()).append("\2477").append(s).toString(); -+ } -+ tooltip += s + "\n"; -+ lines++; -+ } -+ tooltip = tooltip.trim(); -+ return tooltip; -+ } -+ return ""; -+ } -+} ---- net/minecraft/src/GuiScreenDemo.java -+++ net/minecraft/src/GuiScreenDemo.java -@@ -6,37 +6,50 @@ - public class GuiScreenDemo extends GuiScreen { - private static final ResourceLocation field_110407_a = new ResourceLocation("textures/gui/demo_background.png"); - -+ /** -+ * Adds the buttons (and other controls) to the screen in question. -+ */ - public void initGui() { -- this.i.clear(); -+ this.buttonList.clear(); - byte var1 = -16; -- this.i.add(new GuiButton(1, this.width / 2 - 116, this.height / 2 + 62 + var1, 114, 20, I18n.getString("demo.help.buy"))); -- this.i.add(new GuiButton(2, this.width / 2 + 2, this.height / 2 + 62 + var1, 114, 20, I18n.getString("demo.help.later"))); -+ this.buttonList.add(new GuiButton(1, this.width / 2 - 116, this.height / 2 + 62 + var1, 114, 20, I18n.getString("demo.help.buy"))); -+ this.buttonList.add(new GuiButton(2, this.width / 2 + 2, this.height / 2 + 62 + var1, 114, 20, I18n.getString("demo.help.later"))); - } - -- protected void actionPerformed(GuiButton var1) { -- switch(var1.id) { -- case 1: -- var1.enabled = false; -- -- try { -- Class var2 = Class.forName("java.awt.Desktop"); -- Object var3 = var2.getMethod("getDesktop", new Class[0]).invoke((Object)null, new Object[0]); -- var2.getMethod("browse", new Class[]{URI.class}).invoke(var3, new Object[]{new URI("http://www.minecraft.net/store?source=demo")}); -- } catch (Throwable var4) { -- var4.printStackTrace(); -- } -- break; -- case 2: -- this.mc.displayGuiScreen((GuiScreen)null); -- this.mc.setIngameFocus(); -+ /** -+ * Fired when a control is clicked. This is the equivalent of ActionListener.actionPerformed(ActionEvent e). -+ */ -+ protected void actionPerformed(GuiButton par1GuiButton) { -+ switch (par1GuiButton.id) { -+ case 1: -+ par1GuiButton.enabled = false; -+ -+ try { -+ Class var2 = Class.forName("java.awt.Desktop"); -+ Object var3 = var2.getMethod("getDesktop", new Class[0]).invoke((Object)null, new Object[0]); -+ var2.getMethod("browse", new Class[] {URI.class}).invoke(var3, new Object[] {new URI("http://www.minecraft.net/store?source=demo")}); -+ } catch (Throwable var4) { -+ var4.printStackTrace(); -+ } -+ -+ break; -+ -+ case 2: -+ this.mc.displayGuiScreen((GuiScreen)null); -+ this.mc.setIngameFocus(); - } -- - } - -+ /** -+ * Called from the main game loop to update the screen. -+ */ - public void updateScreen() { - super.updateScreen(); - } - -+ /** -+ * Draws either a gradient over the background screen (when it exists) or a flat gradient over background.png -+ */ - public void drawDefaultBackground() { - super.drawDefaultBackground(); - GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); -@@ -46,18 +59,21 @@ - this.drawTexturedModalRect(var1, var2, 0, 0, 248, 166); - } - -- public void drawScreen(int var1, int var2, float var3) { -+ /** -+ * Draws the screen and all the components in it. -+ */ -+ public void drawScreen(int par1, int par2, float par3) { - this.drawDefaultBackground(); - int var4 = (this.width - 248) / 2 + 10; - int var5 = (this.height - 166) / 2 + 8; - this.fontRenderer.drawString(I18n.getString("demo.help.title"), var4, var5, 2039583); - var5 += 12; - GameSettings var6 = this.mc.gameSettings; -- this.fontRenderer.drawString(I18n.getStringParams("demo.help.movementShort", new Object[]{GameSettings.getKeyDisplayString(var6.keyBindForward.keyCode), GameSettings.getKeyDisplayString(var6.keyBindLeft.keyCode), GameSettings.getKeyDisplayString(var6.keyBindBack.keyCode), GameSettings.getKeyDisplayString(var6.keyBindRight.keyCode)}), var4, var5, 5197647); -+ this.fontRenderer.drawString(I18n.getStringParams("demo.help.movementShort", new Object[] {GameSettings.getKeyDisplayString(var6.keyBindForward.keyCode), GameSettings.getKeyDisplayString(var6.keyBindLeft.keyCode), GameSettings.getKeyDisplayString(var6.keyBindBack.keyCode), GameSettings.getKeyDisplayString(var6.keyBindRight.keyCode)}), var4, var5, 5197647); - this.fontRenderer.drawString(I18n.getString("demo.help.movementMouse"), var4, var5 + 12, 5197647); -- this.fontRenderer.drawString(I18n.getStringParams("demo.help.jump", new Object[]{GameSettings.getKeyDisplayString(var6.keyBindJump.keyCode)}), var4, var5 + 24, 5197647); -- this.fontRenderer.drawString(I18n.getStringParams("demo.help.inventory", new Object[]{GameSettings.getKeyDisplayString(var6.keyBindInventory.keyCode)}), var4, var5 + 36, 5197647); -+ this.fontRenderer.drawString(I18n.getStringParams("demo.help.jump", new Object[] {GameSettings.getKeyDisplayString(var6.keyBindJump.keyCode)}), var4, var5 + 24, 5197647); -+ this.fontRenderer.drawString(I18n.getStringParams("demo.help.inventory", new Object[] {GameSettings.getKeyDisplayString(var6.keyBindInventory.keyCode)}), var4, var5 + 36, 5197647); - this.fontRenderer.drawSplitString(I18n.getString("demo.help.fullWrapped"), var4, var5 + 68, 218, 2039583); -- super.drawScreen(var1, var2, var3); -+ super.drawScreen(par1, par2, par3); - } - } ---- /dev/null -+++ com/prupe/mcpatcher/TexturePackAPI$2.java -@@ -1,0 +1,10 @@ -+package com.prupe.mcpatcher; -+ -+import java.util.Comparator; -+import net.minecraft.src.ResourceLocation; -+ -+final class TexturePackAPI$2 implements Comparator { -+ public int compare(ResourceLocation o1, ResourceLocation o2) { -+ return o1.getResourcePath().compareTo(o2.getResourcePath()); -+ } -+} ---- net/minecraft/src/EnumArmorMaterial.java -+++ net/minecraft/src/EnumArmorMaterial.java -@@ -7,28 +7,53 @@ - GOLD(7, new int[]{2, 5, 3, 1}, 25), - DIAMOND(33, new int[]{3, 8, 6, 3}, 10); - -+ /** -+ * Holds the maximum damage factor (each piece multiply this by it's own value) of the material, this is the item -+ * damage (how much can absorb before breaks) -+ */ - private int maxDamageFactor; -+ -+ /** -+ * Holds the damage reduction (each 1 points is half a shield on gui) of each piece of armor (helmet, plate, legs and -+ * boots) -+ */ - private int[] damageReductionAmountArray; -+ -+ /** Return the enchantability factor of the material */ - private int enchantability; - -- private EnumArmorMaterial(int var3, int[] var4, int var5) { -- this.maxDamageFactor = var3; -- this.damageReductionAmountArray = var4; -- this.enchantability = var5; -- } -- -- public int getDurability(int var1) { -- return ItemArmor.getMaxDamageArray()[var1] * this.maxDamageFactor; -- } -- -- public int getDamageReductionAmount(int var1) { -- return this.damageReductionAmountArray[var1]; -- } -- -+ private EnumArmorMaterial(int par3, int[] par4ArrayOfInteger, int par5) { -+ this.maxDamageFactor = par3; -+ this.damageReductionAmountArray = par4ArrayOfInteger; -+ this.enchantability = par5; -+ } -+ -+ /** -+ * Returns the durability for a armor slot of for this type. -+ */ -+ public int getDurability(int par1) { -+ return ItemArmor.getMaxDamageArray()[par1] * this.maxDamageFactor; -+ } -+ -+ /** -+ * Return the damage reduction (each 1 point is a half a shield on gui) of the piece index passed (0 = helmet, 1 = -+ * plate, 2 = legs and 3 = boots) -+ */ -+ public int getDamageReductionAmount(int par1) { -+ return this.damageReductionAmountArray[par1]; -+ } -+ -+ /** -+ * Return the enchantability factor of the material. -+ */ - public int getEnchantability() { - return this.enchantability; - } - -+ /** -+ * Return the crafting material for this armor material, used to determine the item that can be used to repair an armor -+ * piece with an anvil -+ */ - public int getArmorCraftingMaterial() { - return this == CLOTH ? Item.leather.itemID : (this == CHAIN ? Item.ingotIron.itemID : (this == GOLD ? Item.ingotGold.itemID : (this == IRON ? Item.ingotIron.itemID : (this == DIAMOND ? Item.diamond.itemID : 0)))); - } ---- net/minecraft/src/RConOutputStream.java -+++ net/minecraft/src/RConOutputStream.java -@@ -5,36 +5,58 @@ - import java.io.IOException; - - public class RConOutputStream { -- private ByteArrayOutputStream a; -- private DataOutputStream b; -- -- public RConOutputStream(int var1) { -- this.a = new ByteArrayOutputStream(var1); -- this.b = new DataOutputStream(this.a); -- } -- -- public void writeByteArray(byte[] var1) throws IOException { -- this.b.write(var1, 0, var1.length); -- } -- -- public void writeString(String var1) throws IOException { -- this.b.writeBytes(var1); -- this.b.write(0); -- } -- -- public void writeInt(int var1) throws IOException { -- this.b.write(var1); -- } -- -- public void writeShort(short var1) throws IOException { -- this.b.writeShort(Short.reverseBytes(var1)); -- } -- -+ -+ /** Output stream */ -+ private ByteArrayOutputStream byteArrayOutput; -+ -+ /** ByteArrayOutputStream wrapper */ -+ private DataOutputStream output; -+ -+ public RConOutputStream(int par1) { -+ this.byteArrayOutput = new ByteArrayOutputStream(par1); -+ this.output = new DataOutputStream(this.byteArrayOutput); -+ } -+ -+ /** -+ * Writes the given byte array to the output stream -+ */ -+ public void writeByteArray(byte[] par1ArrayOfByte) throws IOException { -+ this.output.write(par1ArrayOfByte, 0, par1ArrayOfByte.length); -+ } -+ -+ /** -+ * Writes the given String to the output stream -+ */ -+ public void writeString(String par1Str) throws IOException { -+ this.output.writeBytes(par1Str); -+ this.output.write(0); -+ } -+ -+ /** -+ * Writes the given int to the output stream -+ */ -+ public void writeInt(int par1) throws IOException { -+ this.output.write(par1); -+ } -+ -+ /** -+ * Writes the given short to the output stream -+ */ -+ public void writeShort(short par1) throws IOException { -+ this.output.writeShort(Short.reverseBytes(par1)); -+ } -+ -+ /** -+ * Returns the contents of the output stream as a byte array -+ */ - public byte[] toByteArray() { -- return this.a.toByteArray(); -+ return this.byteArrayOutput.toByteArray(); - } - -+ /** -+ * Resets the byte array output. -+ */ - public void reset() { -- this.a.reset(); -+ this.byteArrayOutput.reset(); - } - } ---- /dev/null -+++ org/bukkit/util/Java15Compat.java -@@ -1,0 +1,21 @@ -+package org.bukkit.util; -+ -+import java.lang.reflect.Array; -+ -+public class Java15Compat { -+ @SuppressWarnings("unchecked") -+ public static T[] Arrays_copyOfRange(T[] original, int start, int end) { -+ if ((original.length >= start) && (0 <= start)) { -+ if (start <= end) { -+ int length = end - start; -+ int copyLength = Math.min(length, original.length - start); -+ Object[] copy = (Object[]) (Object[]) Array.newInstance(original.getClass().getComponentType(), length); -+ -+ System.arraycopy(original, start, copy, 0, copyLength); -+ return (T[]) copy; -+ } -+ throw new IllegalArgumentException(); -+ } -+ throw new ArrayIndexOutOfBoundsException(); -+ } -+} ---- net/minecraft/src/BlockHay.java -+++ net/minecraft/src/BlockHay.java -@@ -1,21 +1,31 @@ - package net.minecraft.src; - - public class BlockHay extends BlockRotatedPillar { -- public BlockHay(int var1) { -- super(var1, Material.grass); -+ public BlockHay(int par1) { -+ super(par1, Material.grass); - this.setCreativeTab(CreativeTabs.tabBlock); - } - -+ /** -+ * The type of render function that is called for this block -+ */ - public int getRenderType() { - return 31; - } - -- protected Icon getSideIcon(int var1) { -+ /** -+ * The icon for the side of the block. -+ */ -+ protected Icon getSideIcon(int par1) { - return this.blockIcon; - } - -- public void registerIcons(IconRegister var1) { -- this.field_111051_a = var1.registerIcon(this.getTextureName() + "_top"); -- this.blockIcon = var1.registerIcon(this.getTextureName() + "_side"); -+ /** -+ * When this method is called, your block should register all the icons it needs with the given IconRegister. This is -+ * the only chance you get to register icons. -+ */ -+ public void registerIcons(IconRegister par1IconRegister) { -+ this.field_111051_a = par1IconRegister.registerIcon(this.getTextureName() + "_top"); -+ this.blockIcon = par1IconRegister.registerIcon(this.getTextureName() + "_side"); - } - } ---- net/minecraft/src/ItemMinecart.java -+++ net/minecraft/src/ItemMinecart.java -@@ -4,27 +4,33 @@ - private static final IBehaviorDispenseItem dispenserMinecartBehavior = new BehaviorDispenseMinecart(); - public int minecartType; - -- public ItemMinecart(int var1, int var2) { -- super(var1); -+ public ItemMinecart(int par1, int par2) { -+ super(par1); - this.maxStackSize = 1; -- this.minecartType = var2; -+ this.minecartType = par2; - this.setCreativeTab(CreativeTabs.tabTransport); - BlockDispenser.dispenseBehaviorRegistry.putObject(this, dispenserMinecartBehavior); - } - -- public boolean onItemUse(ItemStack var1, EntityPlayer var2, World var3, int var4, int var5, int var6, int var7, float var8, float var9, float var10) { -- int var11 = var3.getBlockId(var4, var5, var6); -- if(BlockRailBase.isRailBlock(var11)) { -- if(!var3.isRemote) { -- EntityMinecart var12 = EntityMinecart.createMinecart(var3, (double)((float)var4 + 0.5F), (double)((float)var5 + 0.5F), (double)((float)var6 + 0.5F), this.minecartType); -- if(var1.hasDisplayName()) { -- var12.setMinecartName(var1.getDisplayName()); -+ /** -+ * Callback for item usage. If the item does something special on right clicking, he will have one of those. Return -+ * True if something happen and false if it don't. This is for ITEMS, not BLOCKS -+ */ -+ public boolean onItemUse(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, World par3World, int par4, int par5, int par6, int par7, float par8, float par9, float par10) { -+ int var11 = par3World.getBlockId(par4, par5, par6); -+ -+ if (BlockRailBase.isRailBlock(var11)) { -+ if (!par3World.isRemote) { -+ EntityMinecart var12 = EntityMinecart.createMinecart(par3World, (double)((float)par4 + 0.5F), (double)((float)par5 + 0.5F), (double)((float)par6 + 0.5F), this.minecartType); -+ -+ if (par1ItemStack.hasDisplayName()) { -+ var12.setMinecartName(par1ItemStack.getDisplayName()); - } - -- var3.spawnEntityInWorld(var12); -+ par3World.spawnEntityInWorld(var12); - } - -- --var1.stackSize; -+ --par1ItemStack.stackSize; - return true; - } else { - return false; ---- /dev/null -+++ org/spoutcraft/client/gui/database/FilterButton.java -@@ -1,0 +1,59 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.client.gui.database; -+ -+import org.spoutcraft.api.gui.CheckBox; -+import org.spoutcraft.api.gui.GenericCheckBox; -+ -+public class FilterButton extends GenericCheckBox implements UrlElement { -+ protected AbstractAPIModel model; -+ protected String url = ""; -+ -+ public FilterButton(String text, String url, AbstractAPIModel model) { -+ super(text); -+ this.url = url; -+ this.model = model; -+ } -+ -+ public CheckBox setChecked(boolean check, boolean update) { -+ super.setChecked(check); -+ if (update) { -+ model.updateUrl(); -+ } -+ return this; -+ } -+ -+ @Override -+ public CheckBox setChecked(boolean b) { -+ return setChecked(b, true); -+ } -+ -+ public boolean isActive() { -+ return isChecked(); -+ } -+ -+ public String getUrlPart() { -+ return url; -+ } -+ -+ public void clear() { -+ setChecked(false); -+ } -+} ---- net/minecraft/src/GuiSleepMP.java -+++ net/minecraft/src/GuiSleepMP.java -@@ -1,37 +1,49 @@ - package net.minecraft.src; - - public class GuiSleepMP extends GuiChat { -+ -+ /** -+ * Adds the buttons (and other controls) to the screen in question. -+ */ - public void initGui() { - super.initGui(); -- this.i.add(new GuiButton(1, this.width / 2 - 100, this.height - 40, I18n.getString("multiplayer.stopSleeping"))); -+ this.buttonList.add(new GuiButton(1, this.width / 2 - 100, this.height - 40, I18n.getString("multiplayer.stopSleeping"))); - } - -- protected void keyTyped(char var1, int var2) { -- if(var2 == 1) { -+ /** -+ * Fired when a key is typed. This is the equivalent of KeyListener.keyTyped(KeyEvent e). -+ */ -+ protected void keyTyped(char par1, int par2) { -+ if (par2 == 1) { - this.wakeEntity(); -- } else if(var2 != 28 && var2 != 156) { -- super.keyTyped(var1, var2); -+ } else if (par2 != 28 && par2 != 156) { -+ super.keyTyped(par1, par2); - } else { - String var3 = this.inputField.getText().trim(); -- if(var3.length() > 0) { -+ -+ if (var3.length() > 0) { - this.mc.thePlayer.sendChatMessage(var3); - } - - this.inputField.setText(""); - this.mc.ingameGUI.getChatGUI().resetScroll(); - } -- - } - -- protected void actionPerformed(GuiButton var1) { -- if(var1.id == 1) { -+ /** -+ * Fired when a control is clicked. This is the equivalent of ActionListener.actionPerformed(ActionEvent e). -+ */ -+ protected void actionPerformed(GuiButton par1GuiButton) { -+ if (par1GuiButton.id == 1) { - this.wakeEntity(); - } else { -- super.actionPerformed(var1); -+ super.actionPerformed(par1GuiButton); - } -- - } - -+ /** -+ * Wakes the entity from the bed -+ */ - private void wakeEntity() { - NetClientHandler var1 = this.mc.thePlayer.sendQueue; - var1.addToSendQueue(new Packet19EntityAction(this.mc.thePlayer, 3)); ---- /dev/null -+++ org/spoutcraft/client/packet/CompressablePacket.java -@@ -1,0 +1,28 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.client.packet; -+ -+public interface CompressablePacket extends SpoutPacket { -+ public void compress(); -+ -+ public void decompress(); -+ -+ public boolean isCompressed(); -+} ---- /dev/null -+++ org/spoutcraft/api/material/block/LongGrass.java -@@ -1,0 +1,40 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.api.material.block; -+ -+import org.spoutcraft.api.material.Plant; -+ -+public class LongGrass extends GenericBlock implements Plant{ -+ public LongGrass(String name, int id, int data) { -+ super(name, id, data); -+ } -+ -+ public boolean isHasGrowthStages() { -+ return false; -+ } -+ -+ public int getNumGrowthStages() { -+ return 0; -+ } -+ -+ public int getMinimumLightToGrow() { -+ return 0; -+ } -+} ---- net/minecraft/src/StepSoundSand.java -+++ net/minecraft/src/StepSoundSand.java -@@ -1,10 +1,13 @@ - package net.minecraft.src; - - final class StepSoundSand extends StepSound { -- StepSoundSand(String var1, float var2, float var3) { -- super(var1, var2, var3); -+ StepSoundSand(String par1Str, float par2, float par3) { -+ super(par1Str, par2, par3); - } - -+ /** -+ * Used when a block breaks, EXA: Player break, Shep eating grass, etc.. -+ */ - public String getBreakSound() { - return "dig.wood"; - } ---- /dev/null -+++ org/spoutcraft/client/item/SpoutItem.java -@@ -1,0 +1,149 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.client.item; -+ -+import net.minecraft.src.Block; -+import net.minecraft.src.EntityPlayer; -+import net.minecraft.src.EnumAction; -+import net.minecraft.src.Item; -+import net.minecraft.src.ItemStack; -+import net.minecraft.src.World; -+ -+import org.spoutcraft.api.Spoutcraft; -+import org.spoutcraft.api.material.CustomBlock; -+import org.spoutcraft.api.material.CustomItem; -+import org.spoutcraft.api.material.Food; -+import org.spoutcraft.api.material.MaterialData; -+ -+public class SpoutItem extends Item { -+ public SpoutItem(int blockId) { -+ super(blockId); -+ this.setHasSubtypes(true); -+ } -+ -+ @Override -+ public ItemStack onItemRightClick(ItemStack item, World world, EntityPlayer player) { -+ CustomItem customItem = MaterialData.getCustomItem(item.getItemDamage()); -+ if (customItem instanceof Food) { -+ if (player.canEat(false)) { -+ player.setItemInUse(item, 32); -+ } else { -+ player.setEating(true); -+ } -+ } -+ return item; -+ } -+ -+ @Override -+ public EnumAction getItemUseAction(ItemStack item) { -+ CustomItem customItem = MaterialData.getCustomItem(item.getItemDamage()); -+ if (customItem instanceof Food) { -+ return EnumAction.eat; -+ } -+ return EnumAction.none; -+ } -+ -+ @Override -+ public boolean onItemUse(ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int face, float xOffset, float yOffset, float zOffset) { -+ if (stack.itemID == MaterialData.flint.getRawId()) { -+ int damage = stack.getItemDamage(); -+ if (damage >= 1024) { -+ CustomBlock block = MaterialData.getCustomBlock(damage); -+ // Item with no block component, return success -+ if (block == null) { -+ return true; -+ } -+ if (onItemUse(stack, block, player, world, x, y, z, face, xOffset, yOffset, zOffset)) { -+ return true; -+ } -+ return false; -+ } -+ } -+ return super.onItemUse(stack, player, world, x, y, z, face, xOffset, yOffset, zOffset); -+ } -+ -+ // From ItemBlock.onItemUse class -+ public boolean onItemUse(ItemStack item, CustomBlock block, EntityPlayer player, World world, int x, int y, int z, int side, float xOffset, float yOffset, float zOffset) { -+ int var11 = world.getBlockId(x, y, z); -+ -+ if (var11 == Block.snow.blockID && (world.getBlockMetadata(x, y, z) & 7) < 1) { -+ side = 1; -+ } else if (var11 != Block.vine.blockID && var11 != Block.tallGrass.blockID && var11 != Block.deadBush.blockID) { -+ if (side == 0) { -+ --y; -+ } -+ -+ if (side == 1) { -+ ++y; -+ } -+ -+ if (side == 2) { -+ --z; -+ } -+ -+ if (side == 3) { -+ ++z; -+ } -+ -+ if (side == 4) { -+ --x; -+ } -+ -+ if (side == 5) { -+ ++x; -+ } -+ } -+ -+ int id = block.getBlockId(); -+ -+ if (item.stackSize == 0) { -+ return false; -+ } else if (!player.canPlayerEdit(x, y, z, side, item)) { -+ return false; -+ } else if (y == 255) { -+ return false; -+ } else if (world.canPlaceEntityOnSide(id, x, y, z, false, side, player, item)) { -+ Block var12 = Block.blocksList[id]; -+ int var13 = this.getMetadata(item.getItemDamage()); -+ int var14 = Block.blocksList[id].onBlockPlaced(world, x, y, z, side, xOffset, yOffset, zOffset, var13); -+ -+ if (world.setBlock(x, y, z, id, var14, 3)) { -+ if (world.getBlockId(x, y, z) == id) { -+ Block.blocksList[id].onBlockPlacedBy(world, x, y, z, player, item); -+ Block.blocksList[id].onPostBlockPlaced(world, x, y, z, var14); -+ } -+ Spoutcraft.getChunkAt(world, x, y, z).setCustomBlockId(x, y, z, (short) block.getCustomId()); -+ -+ world.playSoundEffect((double) ((float) x + 0.5F), (double) ((float) y + 0.5F), (double) ((float) z + 0.5F), var12.stepSound.getPlaceSound(), (var12.stepSound.getVolume() + 1.0F) / 2.0F, var12.stepSound.getPitch() * 0.8F); -+ --item.stackSize; -+ } -+ -+ return true; -+ } else { -+ return false; -+ } -+ -+ } -+ -+ @Override -+ public boolean hasEffect(ItemStack par1ItemStack) { -+ return itemID == MaterialData.flint.getRawId() ? false : super.hasEffect(par1ItemStack); -+ } -+} ---- net/minecraft/src/RenderSpider.java -+++ net/minecraft/src/RenderSpider.java -@@ -2,35 +2,51 @@ - - import org.lwjgl.opengl.GL11; - -+import com.prupe.mcpatcher.mob.MobRandomizer; -+ -+import org.spoutcraft.client.config.Configuration; - public class RenderSpider extends RenderLiving { - private static final ResourceLocation spiderEyesTextures = new ResourceLocation("textures/entity/spider_eyes.png"); - private static final ResourceLocation spiderTextures = new ResourceLocation("textures/entity/spider/spider.png"); -- -+ - public RenderSpider() { - super(new ModelSpider(), 1.0F); - this.setRenderPassModel(new ModelSpider()); - } - -- protected float setSpiderDeathMaxRotation(EntitySpider var1) { -+ protected float setSpiderDeathMaxRotation(EntitySpider par1EntitySpider) { - return 180.0F; - } - -- protected int setSpiderEyeBrightness(EntitySpider var1, int var2, float var3) { -- if(var2 != 0) { -+ /** -+ * Sets the spider's glowing eyes -+ */ -+ protected int setSpiderEyeBrightness(EntitySpider par1EntitySpider, int par2, float par3) { -+ if (par2 != 0) { - return -1; - } else { -- this.bindTexture(spiderEyesTextures); -+ // Spout Start -+ if (Configuration.isRandomMobTextures()) { -+ // MCPatcher Start -+ this.bindTexture(MobRandomizer.randomTexture((EntityLivingBase)par1EntitySpider, spiderEyesTextures)); -+ // MCPatcher End -+ } else { -+ //ToDo: Spoutcraft API borked. -+ //loadTexture(par1EntitySpider.getCustomTexture(org.spoutcraft.api.entity.EntitySkinType.SPIDER_EYES, "/mob/spider_eyes.png")); -+ } -+ // Spout End - float var4 = 1.0F; - GL11.glEnable(GL11.GL_BLEND); - GL11.glDisable(GL11.GL_ALPHA_TEST); - GL11.glBlendFunc(GL11.GL_ONE, GL11.GL_ONE); -- if(var1.isInvisible()) { -+ -+ if (par1EntitySpider.isInvisible()) { - GL11.glDepthMask(false); - } else { - GL11.glDepthMask(true); - } - -- char var5 = '\uf0f0'; -+ char var5 = 61680; - int var6 = var5 % 65536; - int var7 = var5 / 65536; - OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, (float)var6 / 1.0F, (float)var7 / 1.0F); -@@ -40,19 +56,25 @@ - } - } - -- protected ResourceLocation getSpiderTextures(EntitySpider var1) { -+ protected ResourceLocation getSpiderTextures(EntitySpider par1EntitySpider) { - return spiderTextures; - } - -- protected float getDeathMaxRotation(EntityLivingBase var1) { -- return this.setSpiderDeathMaxRotation((EntitySpider)var1); -- } -- -- protected int shouldRenderPass(EntityLivingBase var1, int var2, float var3) { -- return this.setSpiderEyeBrightness((EntitySpider)var1, var2, var3); -- } -- -- protected ResourceLocation getEntityTexture(Entity var1) { -- return this.getSpiderTextures((EntitySpider)var1); -+ protected float getDeathMaxRotation(EntityLivingBase par1EntityLivingBase) { -+ return this.setSpiderDeathMaxRotation((EntitySpider)par1EntityLivingBase); -+ } -+ -+ /** -+ * Queries whether should render the specified pass or not. -+ */ -+ protected int shouldRenderPass(EntityLivingBase par1EntityLivingBase, int par2, float par3) { -+ return this.setSpiderEyeBrightness((EntitySpider)par1EntityLivingBase, par2, par3); -+ } -+ -+ /** -+ * Returns the location of an entity's texture. Doesn't seem to be called unless you call Render.bindEntityTexture. -+ */ -+ protected ResourceLocation getEntityTexture(Entity par1Entity) { -+ return this.getSpiderTextures((EntitySpider)par1Entity); - } - } ---- net/minecraft/src/CommandSpreadPlayers.java -+++ net/minecraft/src/CommandSpreadPlayers.java -@@ -17,40 +17,46 @@ - return "spreadplayers"; - } - -+ /** -+ * Return the required permission level for this command. -+ */ - public int getRequiredPermissionLevel() { - return 2; - } - -- public String getCommandUsage(ICommandSender var1) { -+ public String getCommandUsage(ICommandSender par1ICommandSender) { - return "commands.spreadplayers.usage"; - } - -- public void processCommand(ICommandSender var1, String[] var2) { -- if(var2.length < 6) { -+ public void processCommand(ICommandSender par1ICommandSender, String[] par2ArrayOfStr) { -+ if (par2ArrayOfStr.length < 6) { - throw new WrongUsageException("commands.spreadplayers.usage", new Object[0]); - } else { - byte var3 = 0; - int var16 = var3 + 1; -- double var4 = func_110666_a(var1, Double.NaN, var2[var3]); -- double var6 = func_110666_a(var1, Double.NaN, var2[var16++]); -- double var8 = func_110664_a(var1, var2[var16++], 0.0D); -- double var10 = func_110664_a(var1, var2[var16++], var8 + 1.0D); -- boolean var12 = func_110662_c(var1, var2[var16++]); -+ double var4 = func_110666_a(par1ICommandSender, Double.NaN, par2ArrayOfStr[var3]); -+ double var6 = func_110666_a(par1ICommandSender, Double.NaN, par2ArrayOfStr[var16++]); -+ double var8 = func_110664_a(par1ICommandSender, par2ArrayOfStr[var16++], 0.0D); -+ double var10 = func_110664_a(par1ICommandSender, par2ArrayOfStr[var16++], var8 + 1.0D); -+ boolean var12 = func_110662_c(par1ICommandSender, par2ArrayOfStr[var16++]); - ArrayList var13 = Lists.newArrayList(); - -- while(true) { -- while(var16 < var2.length) { -- String var14 = var2[var16++]; -- if(PlayerSelector.hasArguments(var14)) { -- EntityPlayerMP[] var17 = PlayerSelector.matchPlayers(var1, var14); -- if(var17 == null || var17.length == 0) { -+ while (true) { -+ while (var16 < par2ArrayOfStr.length) { -+ String var14 = par2ArrayOfStr[var16++]; -+ -+ if (PlayerSelector.hasArguments(var14)) { -+ EntityPlayerMP[] var17 = PlayerSelector.matchPlayers(par1ICommandSender, var14); -+ -+ if (var17 == null || var17.length == 0) { - throw new PlayerNotFoundException(); - } - - Collections.addAll(var13, var17); - } else { -- EntityPlayerMP var15 = MinecraftServer.getServer().getConfigurationManager().getPlayerEntity(var14); -- if(var15 == null) { -+ EntityPlayerMP var15 = MinecraftServer.getServer().getConfigurationManager().getPlayerForUsername(var14); -+ -+ if (var15 == null) { - throw new PlayerNotFoundException(); - } - -@@ -58,40 +64,41 @@ - } - } - -- if(var13.isEmpty()) { -+ if (var13.isEmpty()) { - throw new PlayerNotFoundException(); - } - -- var1.sendChatToPlayer(ChatMessageComponent.createFromTranslationWithSubstitutions("commands.spreadplayers.spreading." + (var12 ? "teams" : "players"), new Object[]{func_110663_b(var13), Double.valueOf(var4), Double.valueOf(var6), Double.valueOf(var8), Double.valueOf(var10)})); -- this.func_110669_a(var1, var13, new CommandSpreadPlayersPosition(var4, var6), var8, var10, ((EntityLivingBase)var13.get(0)).worldObj, var12); -+ par1ICommandSender.sendChatToPlayer(ChatMessageComponent.createFromTranslationWithSubstitutions("commands.spreadplayers.spreading." + (var12 ? "teams" : "players"), new Object[] {func_110663_b(var13), Double.valueOf(var4), Double.valueOf(var6), Double.valueOf(var8), Double.valueOf(var10)})); -+ this.func_110669_a(par1ICommandSender, var13, new CommandSpreadPlayersPosition(var4, var6), var8, var10, ((EntityLivingBase)var13.get(0)).worldObj, var12); - return; - } - } - } - -- private void func_110669_a(ICommandSender var1, List var2, CommandSpreadPlayersPosition var3, double var4, double var6, World var8, boolean var9) { -+ private void func_110669_a(ICommandSender par1ICommandSender, List par2List, CommandSpreadPlayersPosition par3CommandSpreadPlayersPosition, double par4, double par6, World par8World, boolean par9) { - Random var10 = new Random(); -- double var11 = var3.field_111101_a - var6; -- double var13 = var3.field_111100_b - var6; -- double var15 = var3.field_111101_a + var6; -- double var17 = var3.field_111100_b + var6; -- CommandSpreadPlayersPosition[] var19 = this.func_110670_a(var10, var9 ? this.func_110667_a(var2) : var2.size(), var11, var13, var15, var17); -- int var20 = this.func_110668_a(var3, var4, var8, var10, var11, var13, var15, var17, var19, var9); -- double var21 = this.func_110671_a(var2, var8, var19, var9); -- notifyAdmins(var1, "commands.spreadplayers.success." + (var9 ? "teams" : "players"), new Object[]{Integer.valueOf(var19.length), Double.valueOf(var3.field_111101_a), Double.valueOf(var3.field_111100_b)}); -- if(var19.length > 1) { -- var1.sendChatToPlayer(ChatMessageComponent.createFromTranslationWithSubstitutions("commands.spreadplayers.info." + (var9 ? "teams" : "players"), new Object[]{String.format("%.2f", new Object[]{Double.valueOf(var21)}), Integer.valueOf(var20)})); -+ double var11 = par3CommandSpreadPlayersPosition.field_111101_a - par6; -+ double var13 = par3CommandSpreadPlayersPosition.field_111100_b - par6; -+ double var15 = par3CommandSpreadPlayersPosition.field_111101_a + par6; -+ double var17 = par3CommandSpreadPlayersPosition.field_111100_b + par6; -+ CommandSpreadPlayersPosition[] var19 = this.func_110670_a(var10, par9 ? this.func_110667_a(par2List) : par2List.size(), var11, var13, var15, var17); -+ int var20 = this.func_110668_a(par3CommandSpreadPlayersPosition, par4, par8World, var10, var11, var13, var15, var17, var19, par9); -+ double var21 = this.func_110671_a(par2List, par8World, var19, par9); -+ notifyAdmins(par1ICommandSender, "commands.spreadplayers.success." + (par9 ? "teams" : "players"), new Object[] {Integer.valueOf(var19.length), Double.valueOf(par3CommandSpreadPlayersPosition.field_111101_a), Double.valueOf(par3CommandSpreadPlayersPosition.field_111100_b)}); -+ -+ if (var19.length > 1) { -+ par1ICommandSender.sendChatToPlayer(ChatMessageComponent.createFromTranslationWithSubstitutions("commands.spreadplayers.info." + (par9 ? "teams" : "players"), new Object[] {String.format("%.2f", new Object[]{Double.valueOf(var21)}), Integer.valueOf(var20)})); - } -- - } - -- private int func_110667_a(List var1) { -+ private int func_110667_a(List par1List) { - HashSet var2 = Sets.newHashSet(); -- Iterator var3 = var1.iterator(); -+ Iterator var3 = par1List.iterator(); - -- while(var3.hasNext()) { -+ while (var3.hasNext()) { - EntityLivingBase var4 = (EntityLivingBase)var3.next(); -- if(var4 instanceof EntityPlayer) { -+ -+ if (var4 instanceof EntityPlayer) { - var2.add(((EntityPlayer)var4).getTeam()); - } else { - var2.add((Object)null); -@@ -101,28 +108,29 @@ - return var2.size(); - } - -- private int func_110668_a(CommandSpreadPlayersPosition var1, double var2, World var4, Random var5, double var6, double var8, double var10, double var12, CommandSpreadPlayersPosition[] var14, boolean var15) { -+ private int func_110668_a(CommandSpreadPlayersPosition par1CommandSpreadPlayersPosition, double par2, World par4World, Random par5Random, double par6, double par8, double par10, double par12, CommandSpreadPlayersPosition[] par14ArrayOfCommandSpreadPlayersPosition, boolean par15) { - boolean var16 = true; -- double var18 = (double)Float.MAX_VALUE; -- -+ double var18 = 3.4028234663852886E38D; - int var17; -- for(var17 = 0; var17 < 10000 && var16; ++var17) { -+ -+ for (var17 = 0; var17 < 10000 && var16; ++var17) { - var16 = false; -- var18 = (double)Float.MAX_VALUE; -- -+ var18 = 3.4028234663852886E38D; - int var22; - CommandSpreadPlayersPosition var23; -- for(int var20 = 0; var20 < var14.length; ++var20) { -- CommandSpreadPlayersPosition var21 = var14[var20]; -+ -+ for (int var20 = 0; var20 < par14ArrayOfCommandSpreadPlayersPosition.length; ++var20) { -+ CommandSpreadPlayersPosition var21 = par14ArrayOfCommandSpreadPlayersPosition[var20]; - var22 = 0; - var23 = new CommandSpreadPlayersPosition(); - -- for(int var24 = 0; var24 < var14.length; ++var24) { -- if(var20 != var24) { -- CommandSpreadPlayersPosition var25 = var14[var24]; -+ for (int var24 = 0; var24 < par14ArrayOfCommandSpreadPlayersPosition.length; ++var24) { -+ if (var20 != var24) { -+ CommandSpreadPlayersPosition var25 = par14ArrayOfCommandSpreadPlayersPosition[var24]; - double var26 = var21.func_111099_a(var25); - var18 = Math.min(var26, var18); -- if(var26 < var2) { -+ -+ if (var26 < par2) { - ++var22; - var23.field_111101_a += var25.field_111101_a - var21.field_111101_a; - var23.field_111100_b += var25.field_111100_b - var21.field_111100_b; -@@ -130,71 +138,75 @@ - } - } - -- if(var22 > 0) { -+ if (var22 > 0) { - var23.field_111101_a /= (double)var22; - var23.field_111100_b /= (double)var22; - double var30 = (double)var23.func_111096_b(); -- if(var30 > 0.0D) { -+ -+ if (var30 > 0.0D) { - var23.func_111095_a(); - var21.func_111094_b(var23); - } else { -- var21.func_111097_a(var5, var6, var8, var10, var12); -+ var21.func_111097_a(par5Random, par6, par8, par10, par12); - } - - var16 = true; - } - -- if(var21.func_111093_a(var6, var8, var10, var12)) { -+ if (var21.func_111093_a(par6, par8, par10, par12)) { - var16 = true; - } - } - -- if(!var16) { -- CommandSpreadPlayersPosition[] var28 = var14; -- int var29 = var14.length; -+ if (!var16) { -+ CommandSpreadPlayersPosition[] var28 = par14ArrayOfCommandSpreadPlayersPosition; -+ int var29 = par14ArrayOfCommandSpreadPlayersPosition.length; - -- for(var22 = 0; var22 < var29; ++var22) { -+ for (var22 = 0; var22 < var29; ++var22) { - var23 = var28[var22]; -- if(!var23.func_111098_b(var4)) { -- var23.func_111097_a(var5, var6, var8, var10, var12); -+ -+ if (!var23.func_111098_b(par4World)) { -+ var23.func_111097_a(par5Random, par6, par8, par10, par12); - var16 = true; - } - } - } - } - -- if(var17 >= 10000) { -- throw new CommandException("commands.spreadplayers.failure." + (var15 ? "teams" : "players"), new Object[]{Integer.valueOf(var14.length), Double.valueOf(var1.field_111101_a), Double.valueOf(var1.field_111100_b), String.format("%.2f", new Object[]{Double.valueOf(var18)})}); -+ if (var17 >= 10000) { -+ throw new CommandException("commands.spreadplayers.failure." + (par15 ? "teams" : "players"), new Object[] {Integer.valueOf(par14ArrayOfCommandSpreadPlayersPosition.length), Double.valueOf(par1CommandSpreadPlayersPosition.field_111101_a), Double.valueOf(par1CommandSpreadPlayersPosition.field_111100_b), String.format("%.2f", new Object[]{Double.valueOf(var18)})}); - } else { - return var17; - } - } - -- private double func_110671_a(List var1, World var2, CommandSpreadPlayersPosition[] var3, boolean var4) { -+ private double func_110671_a(List par1List, World par2World, CommandSpreadPlayersPosition[] par3ArrayOfCommandSpreadPlayersPosition, boolean par4) { - double var5 = 0.0D; - int var7 = 0; - HashMap var8 = Maps.newHashMap(); - -- for(int var9 = 0; var9 < var1.size(); ++var9) { -- EntityLivingBase var10 = (EntityLivingBase)var1.get(var9); -+ for (int var9 = 0; var9 < par1List.size(); ++var9) { -+ EntityLivingBase var10 = (EntityLivingBase)par1List.get(var9); - CommandSpreadPlayersPosition var11; -- if(var4) { -+ -+ if (par4) { - Team var12 = var10 instanceof EntityPlayer ? ((EntityPlayer)var10).getTeam() : null; -- if(!var8.containsKey(var12)) { -- var8.put(var12, var3[var7++]); -+ -+ if (!var8.containsKey(var12)) { -+ var8.put(var12, par3ArrayOfCommandSpreadPlayersPosition[var7++]); - } - - var11 = (CommandSpreadPlayersPosition)var8.get(var12); - } else { -- var11 = var3[var7++]; -+ var11 = par3ArrayOfCommandSpreadPlayersPosition[var7++]; - } - -- var10.setPositionAndUpdate((double)((float)MathHelper.floor_double(var11.field_111101_a) + 0.5F), (double)var11.func_111092_a(var2), (double)MathHelper.floor_double(var11.field_111100_b) + 0.5D); -+ var10.setPositionAndUpdate((double)((float)MathHelper.floor_double(var11.field_111101_a) + 0.5F), (double)var11.func_111092_a(par2World), (double)MathHelper.floor_double(var11.field_111100_b) + 0.5D); - double var17 = Double.MAX_VALUE; - -- for(int var14 = 0; var14 < var3.length; ++var14) { -- if(var11 != var3[var14]) { -- double var15 = var11.func_111099_a(var3[var14]); -+ for (int var14 = 0; var14 < par3ArrayOfCommandSpreadPlayersPosition.length; ++var14) { -+ if (var11 != par3ArrayOfCommandSpreadPlayersPosition[var14]) { -+ double var15 = var11.func_111099_a(par3ArrayOfCommandSpreadPlayersPosition[var14]); - var17 = Math.min(var15, var17); - } - } -@@ -202,16 +214,16 @@ - var5 += var17; - } - -- var5 /= (double)var1.size(); -+ var5 /= (double)par1List.size(); - return var5; - } - -- private CommandSpreadPlayersPosition[] func_110670_a(Random var1, int var2, double var3, double var5, double var7, double var9) { -- CommandSpreadPlayersPosition[] var11 = new CommandSpreadPlayersPosition[var2]; -+ private CommandSpreadPlayersPosition[] func_110670_a(Random par1Random, int par2, double par3, double par5, double par7, double par9) { -+ CommandSpreadPlayersPosition[] var11 = new CommandSpreadPlayersPosition[par2]; - -- for(int var12 = 0; var12 < var11.length; ++var12) { -+ for (int var12 = 0; var12 < var11.length; ++var12) { - CommandSpreadPlayersPosition var13 = new CommandSpreadPlayersPosition(); -- var13.func_111097_a(var1, var3, var5, var7, var9); -+ var13.func_111097_a(par1Random, par3, par5, par7, par9); - var11[var12] = var13; - } - ---- net/minecraft/src/WorldChunkManagerHell.java -+++ net/minecraft/src/WorldChunkManagerHell.java -@@ -5,65 +5,96 @@ - import java.util.Random; - - public class WorldChunkManagerHell extends WorldChunkManager { -- private BiomeGenBase biomeGenerator; -+ -+ /** this is the sole biome to utilize for this world */ -+ private BiomeGenBase biomeToUse; - private float hellTemperature; -+ -+ /** The rainfall in the world */ - private float rainfall; - -- public WorldChunkManagerHell(BiomeGenBase var1, float var2, float var3) { -- this.biomeGenerator = var1; -- this.hellTemperature = var2; -- this.rainfall = var3; -- } -- -- public BiomeGenBase getBiomeGenAt(int var1, int var2) { -- return this.biomeGenerator; -- } -- -- public BiomeGenBase[] getBiomesForGeneration(BiomeGenBase[] var1, int var2, int var3, int var4, int var5) { -- if(var1 == null || var1.length < var4 * var5) { -- var1 = new BiomeGenBase[var4 * var5]; -- } -- -- Arrays.fill(var1, 0, var4 * var5, this.biomeGenerator); -- return var1; -- } -- -- public float[] getTemperatures(float[] var1, int var2, int var3, int var4, int var5) { -- if(var1 == null || var1.length < var4 * var5) { -- var1 = new float[var4 * var5]; -- } -- -- Arrays.fill(var1, 0, var4 * var5, this.hellTemperature); -- return var1; -- } -- -- public float[] getRainfall(float[] var1, int var2, int var3, int var4, int var5) { -- if(var1 == null || var1.length < var4 * var5) { -- var1 = new float[var4 * var5]; -- } -- -- Arrays.fill(var1, 0, var4 * var5, this.rainfall); -- return var1; -- } -- -- public BiomeGenBase[] loadBlockGeneratorData(BiomeGenBase[] var1, int var2, int var3, int var4, int var5) { -- if(var1 == null || var1.length < var4 * var5) { -- var1 = new BiomeGenBase[var4 * var5]; -- } -- -- Arrays.fill(var1, 0, var4 * var5, this.biomeGenerator); -- return var1; -- } -- -- public BiomeGenBase[] getBiomeGenAt(BiomeGenBase[] var1, int var2, int var3, int var4, int var5, boolean var6) { -- return this.loadBlockGeneratorData(var1, var2, var3, var4, var5); -- } -- -- public ChunkPosition findBiomePosition(int var1, int var2, int var3, List var4, Random var5) { -- return var4.contains(this.biomeGenerator) ? new ChunkPosition(var1 - var3 + var5.nextInt(var3 * 2 + 1), 0, var2 - var3 + var5.nextInt(var3 * 2 + 1)) : null; -- } -- -- public boolean areBiomesViable(int var1, int var2, int var3, List var4) { -- return var4.contains(this.biomeGenerator); -+ public WorldChunkManagerHell(BiomeGenBase par1BiomeGenBase, float par2, float par3) { -+ this.biomeToUse = par1BiomeGenBase; -+ this.hellTemperature = par2; -+ this.rainfall = par3; -+ } -+ -+ /** -+ * Returns the BiomeGenBase related to the x, z position on the world. -+ */ -+ public BiomeGenBase getBiomeGenAt(int par1, int par2) { -+ return this.biomeToUse; -+ } -+ -+ /** -+ * Returns an array of biomes for the location input. -+ */ -+ public BiomeGenBase[] getBiomesForGeneration(BiomeGenBase[] par1ArrayOfBiomeGenBase, int par2, int par3, int par4, int par5) { -+ if (par1ArrayOfBiomeGenBase == null || par1ArrayOfBiomeGenBase.length < par4 * par5) { -+ par1ArrayOfBiomeGenBase = new BiomeGenBase[par4 * par5]; -+ } -+ -+ Arrays.fill(par1ArrayOfBiomeGenBase, 0, par4 * par5, this.biomeToUse); -+ return par1ArrayOfBiomeGenBase; -+ } -+ -+ /** -+ * Returns a list of temperatures to use for the specified blocks. Args: listToReuse, x, y, width, length -+ */ -+ public float[] getTemperatures(float[] par1ArrayOfFloat, int par2, int par3, int par4, int par5) { -+ if (par1ArrayOfFloat == null || par1ArrayOfFloat.length < par4 * par5) { -+ par1ArrayOfFloat = new float[par4 * par5]; -+ } -+ -+ Arrays.fill(par1ArrayOfFloat, 0, par4 * par5, this.hellTemperature); -+ return par1ArrayOfFloat; -+ } -+ -+ /** -+ * Returns a list of rainfall values for the specified blocks. Args: listToReuse, x, z, width, length. -+ */ -+ public float[] getRainfall(float[] par1ArrayOfFloat, int par2, int par3, int par4, int par5) { -+ if (par1ArrayOfFloat == null || par1ArrayOfFloat.length < par4 * par5) { -+ par1ArrayOfFloat = new float[par4 * par5]; -+ } -+ -+ Arrays.fill(par1ArrayOfFloat, 0, par4 * par5, this.rainfall); -+ return par1ArrayOfFloat; -+ } -+ -+ /** -+ * Returns biomes to use for the blocks and loads the other data like temperature and humidity onto the -+ * WorldChunkManager Args: oldBiomeList, x, z, width, depth -+ */ -+ public BiomeGenBase[] loadBlockGeneratorData(BiomeGenBase[] par1ArrayOfBiomeGenBase, int par2, int par3, int par4, int par5) { -+ if (par1ArrayOfBiomeGenBase == null || par1ArrayOfBiomeGenBase.length < par4 * par5) { -+ par1ArrayOfBiomeGenBase = new BiomeGenBase[par4 * par5]; -+ } -+ -+ Arrays.fill(par1ArrayOfBiomeGenBase, 0, par4 * par5, this.biomeToUse); -+ return par1ArrayOfBiomeGenBase; -+ } -+ -+ /** -+ * Return a list of biomes for the specified blocks. Args: listToReuse, x, y, width, length, cacheFlag (if false, don't -+ * check biomeCache to avoid infinite loop in BiomeCacheBlock) -+ */ -+ public BiomeGenBase[] getBiomeGenAt(BiomeGenBase[] par1ArrayOfBiomeGenBase, int par2, int par3, int par4, int par5, boolean par6) { -+ return this.loadBlockGeneratorData(par1ArrayOfBiomeGenBase, par2, par3, par4, par5); -+ } -+ -+ /** -+ * Finds a valid position within a range, that is in one of the listed biomes. Searches {par1,par2} +-par3 blocks. -+ * Strongly favors positive y positions. -+ */ -+ public ChunkPosition findBiomePosition(int par1, int par2, int par3, List par4List, Random par5Random) { -+ return par4List.contains(this.biomeToUse) ? new ChunkPosition(par1 - par3 + par5Random.nextInt(par3 * 2 + 1), 0, par2 - par3 + par5Random.nextInt(par3 * 2 + 1)) : null; -+ } -+ -+ /** -+ * checks given Chunk's Biomes against List of allowed ones -+ */ -+ public boolean areBiomesViable(int par1, int par2, int par3, List par4List) { -+ return par4List.contains(this.biomeToUse); - } - } ---- /dev/null -+++ org/spoutcraft/client/packet/PacketAllowVisualCheats.java -@@ -1,0 +1,132 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.client.packet; -+ -+import java.io.IOException; -+ -+import org.spoutcraft.api.io.SpoutInputStream; -+import org.spoutcraft.api.io.SpoutOutputStream; -+import org.spoutcraft.client.SpoutClient; -+ -+public class PacketAllowVisualCheats implements SpoutPacket { -+ private boolean cheatsky = false; -+ private boolean forcesky = false; -+ private boolean showsky = true; -+ private boolean cheatclearwater = false; -+ private boolean forceclearwater = false; -+ private boolean showclearwater = false; -+ private boolean cheatstars = false; -+ private boolean forcestars = false; -+ private boolean showstars = true; -+ private boolean cheatweather = false; -+ private boolean forceweather = false; -+ private boolean showweather = true; -+ private boolean time = false; -+ private boolean coords = false; -+ private boolean entitylabel = false; -+ private boolean cheatvoidfog = false; -+ private boolean forcevoidfog = false; -+ private boolean showvoidfog = true; -+ private boolean flyspeed = false; -+ -+ public PacketAllowVisualCheats() { -+ } -+ -+ public PacketAllowVisualCheats(boolean tsky, boolean fsky, boolean ssky, boolean tclearwater, boolean fclearwater, boolean sclearwater, boolean tstars, boolean fstars, boolean sstars, boolean tweather, boolean fweather, boolean sweather, boolean ttime, boolean tcoords, boolean tentitylabel, boolean tvoidfog, boolean fvoidfog, boolean svoidfog, boolean tflyspeed) { -+ this.cheatsky = tsky; -+ this.forcesky = fsky; -+ this.showsky = ssky; -+ this.cheatclearwater = tclearwater; -+ this.forceclearwater = fclearwater; -+ this.showclearwater = sclearwater; -+ this.cheatstars = tstars; -+ this.forcestars = fstars; -+ this.showstars = sstars; -+ this.cheatweather = tweather; -+ this.forceweather = fweather; -+ this.showweather = sweather; -+ this.time = ttime; -+ this.coords = tcoords; -+ this.entitylabel = tentitylabel; -+ this.cheatvoidfog = tvoidfog; -+ this.forcevoidfog = fvoidfog; -+ this.showvoidfog = svoidfog; -+ this.flyspeed = tflyspeed; -+ } -+ -+ public void readData(SpoutInputStream input) throws IOException { -+ cheatsky = input.readBoolean(); -+ forcesky = input.readBoolean(); -+ showsky = input.readBoolean(); -+ cheatclearwater = input.readBoolean(); -+ forceclearwater = input.readBoolean(); -+ showclearwater = input.readBoolean(); -+ cheatstars = input.readBoolean(); -+ forcestars = input.readBoolean(); -+ showstars = input.readBoolean(); -+ cheatweather = input.readBoolean(); -+ forceweather = input.readBoolean(); -+ showweather = input.readBoolean(); -+ time = input.readBoolean(); -+ coords = input.readBoolean(); -+ entitylabel = input.readBoolean(); -+ cheatvoidfog = input.readBoolean(); -+ forcevoidfog = input.readBoolean(); -+ showvoidfog = input.readBoolean(); -+ flyspeed = input.readBoolean(); -+ } -+ -+ public void writeData(SpoutOutputStream output) throws IOException { -+ output.writeBoolean(cheatsky); -+ output.writeBoolean(forcesky); -+ output.writeBoolean(showsky); -+ output.writeBoolean(cheatclearwater); -+ output.writeBoolean(forceclearwater); -+ output.writeBoolean(showclearwater); -+ output.writeBoolean(cheatstars); -+ output.writeBoolean(forcestars); -+ output.writeBoolean(showstars); -+ output.writeBoolean(cheatweather); -+ output.writeBoolean(forceweather); -+ output.writeBoolean(showweather); -+ output.writeBoolean(time); -+ output.writeBoolean(coords); -+ output.writeBoolean(entitylabel); -+ output.writeBoolean(cheatvoidfog); -+ output.writeBoolean(forcevoidfog); -+ output.writeBoolean(showvoidfog); -+ output.writeBoolean(flyspeed); -+ } -+ -+ public void run(int playerId) { -+ SpoutClient.getInstance().setVisualCheats(cheatsky, forcesky, showsky, cheatclearwater, forceclearwater, showclearwater, cheatstars, forcestars, showstars, cheatweather, forceweather, showweather, time, coords, entitylabel, cheatvoidfog, forcevoidfog, showvoidfog, flyspeed); -+ } -+ -+ public PacketType getPacketType() { -+ return PacketType.PacketAllowVisualCheats; -+ } -+ -+ public int getVersion() { -+ return 4; -+ } -+ -+ public void failure(int playerId) { -+ } -+} ---- net/minecraft/src/GuiWorldSlot.java -+++ net/minecraft/src/GuiWorldSlot.java -@@ -5,32 +5,44 @@ - class GuiWorldSlot extends GuiSlot { - final GuiSelectWorld parentWorldGui; - -- public GuiWorldSlot(GuiSelectWorld var1) { -- super(var1.mc, var1.width, var1.height, 32, var1.height - 64, 36); -- this.parentWorldGui = var1; -+ public GuiWorldSlot(GuiSelectWorld par1GuiSelectWorld) { -+ super(par1GuiSelectWorld.mc, par1GuiSelectWorld.width, par1GuiSelectWorld.height, 32, par1GuiSelectWorld.height - 64, 36); -+ this.parentWorldGui = par1GuiSelectWorld; - } - -+ /** -+ * Gets the size of the current slot list. -+ */ - protected int getSize() { - return GuiSelectWorld.getSize(this.parentWorldGui).size(); - } - -- protected void elementClicked(int var1, boolean var2) { -- GuiSelectWorld.onElementSelected(this.parentWorldGui, var1); -+ /** -+ * the element in the slot that was clicked, boolean for wether it was double clicked or not -+ */ -+ protected void elementClicked(int par1, boolean par2) { -+ GuiSelectWorld.onElementSelected(this.parentWorldGui, par1); - boolean var3 = GuiSelectWorld.getSelectedWorld(this.parentWorldGui) >= 0 && GuiSelectWorld.getSelectedWorld(this.parentWorldGui) < this.getSize(); - GuiSelectWorld.getSelectButton(this.parentWorldGui).enabled = var3; - GuiSelectWorld.getRenameButton(this.parentWorldGui).enabled = var3; - GuiSelectWorld.getDeleteButton(this.parentWorldGui).enabled = var3; - GuiSelectWorld.func_82312_f(this.parentWorldGui).enabled = var3; -- if(var2 && var3) { -- this.parentWorldGui.selectWorld(var1); -+ -+ if (par2 && var3) { -+ this.parentWorldGui.selectWorld(par1); - } -- -- } -- -- protected boolean isSelected(int var1) { -- return var1 == GuiSelectWorld.getSelectedWorld(this.parentWorldGui); -- } -- -+ } -+ -+ /** -+ * returns true if the element passed in is currently selected -+ */ -+ protected boolean isSelected(int par1) { -+ return par1 == GuiSelectWorld.getSelectedWorld(this.parentWorldGui); -+ } -+ -+ /** -+ * return the height of the content being scrolled -+ */ - protected int getContentHeight() { - return GuiSelectWorld.getSize(this.parentWorldGui).size() * 36; - } -@@ -39,32 +51,35 @@ - this.parentWorldGui.drawDefaultBackground(); - } - -- protected void drawSlot(int var1, int var2, int var3, int var4, Tessellator var5) { -- SaveFormatComparator var6 = (SaveFormatComparator)GuiSelectWorld.getSize(this.parentWorldGui).get(var1); -+ protected void drawSlot(int par1, int par2, int par3, int par4, Tessellator par5Tessellator) { -+ SaveFormatComparator var6 = (SaveFormatComparator)GuiSelectWorld.getSize(this.parentWorldGui).get(par1); - String var7 = var6.getDisplayName(); -- if(var7 == null || MathHelper.stringNullOrLengthZero(var7)) { -- var7 = GuiSelectWorld.func_82313_g(this.parentWorldGui) + " " + (var1 + 1); -+ -+ if (var7 == null || MathHelper.stringNullOrLengthZero(var7)) { -+ var7 = GuiSelectWorld.func_82313_g(this.parentWorldGui) + " " + (par1 + 1); - } - - String var8 = var6.getFileName(); - var8 = var8 + " (" + GuiSelectWorld.func_82315_h(this.parentWorldGui).format(new Date(var6.getLastTimePlayed())); - var8 = var8 + ")"; - String var9 = ""; -- if(var6.requiresConversion()) { -+ -+ if (var6.requiresConversion()) { - var9 = GuiSelectWorld.func_82311_i(this.parentWorldGui) + " " + var9; - } else { - var9 = GuiSelectWorld.func_82314_j(this.parentWorldGui)[var6.getEnumGameType().getID()]; -- if(var6.isHardcoreModeEnabled()) { -+ -+ if (var6.isHardcoreModeEnabled()) { - var9 = EnumChatFormatting.DARK_RED + I18n.getString("gameMode.hardcore") + EnumChatFormatting.RESET; - } - -- if(var6.getCheatsEnabled()) { -+ if (var6.getCheatsEnabled()) { - var9 = var9 + ", " + I18n.getString("selectWorld.cheats"); - } - } - -- this.parentWorldGui.drawString(this.parentWorldGui.fontRenderer, var7, var2 + 2, var3 + 1, 16777215); -- this.parentWorldGui.drawString(this.parentWorldGui.fontRenderer, var8, var2 + 2, var3 + 12, 8421504); -- this.parentWorldGui.drawString(this.parentWorldGui.fontRenderer, var9, var2 + 2, var3 + 12 + 10, 8421504); -+ this.parentWorldGui.drawString(this.parentWorldGui.fontRenderer, var7, par2 + 2, par3 + 1, 16777215); -+ this.parentWorldGui.drawString(this.parentWorldGui.fontRenderer, var8, par2 + 2, par3 + 12, 8421504); -+ this.parentWorldGui.drawString(this.parentWorldGui.fontRenderer, var9, par2 + 2, par3 + 12 + 10, 8421504); - } - } ---- /dev/null -+++ com/prupe/mcpatcher/hd/FancyDial$Layer.java -@@ -1,0 +1,35 @@ -+package com.prupe.mcpatcher.hd; -+ -+import com.prupe.mcpatcher.BlendMethod; -+import net.minecraft.src.ResourceLocation; -+ -+class FancyDial$Layer { -+ final ResourceLocation textureName; -+ final float scaleX; -+ final float scaleY; -+ final float offsetX; -+ final float offsetY; -+ final float rotationMultiplier; -+ final float rotationOffset; -+ final BlendMethod blendMethod; -+ final boolean debug; -+ -+ final FancyDial this$0; -+ -+ FancyDial$Layer(FancyDial var1, ResourceLocation textureName, float scaleX, float scaleY, float offsetX, float offsetY, float rotationMultiplier, float rotationOffset, BlendMethod blendMethod, boolean debug) { -+ this.this$0 = var1; -+ this.textureName = textureName; -+ this.scaleX = scaleX; -+ this.scaleY = scaleY; -+ this.offsetX = offsetX; -+ this.offsetY = offsetY; -+ this.rotationMultiplier = rotationMultiplier; -+ this.rotationOffset = rotationOffset; -+ this.blendMethod = blendMethod; -+ this.debug = debug; -+ } -+ -+ public String toString() { -+ return String.format("Layer{%s %f %f %+f %+f x%f}", new Object[] {this.textureName, Float.valueOf(this.scaleX), Float.valueOf(this.scaleY), Float.valueOf(this.offsetX), Float.valueOf(this.offsetY), Float.valueOf(this.rotationMultiplier)}); -+ } -+} ---- net/minecraft/src/MapGenStructureData.java -+++ net/minecraft/src/MapGenStructureData.java -@@ -3,26 +3,32 @@ - public class MapGenStructureData extends WorldSavedData { - private NBTTagCompound field_143044_a = new NBTTagCompound("Features"); - -- public MapGenStructureData(String var1) { -- super(var1); -- } -- -- public void readFromNBT(NBTTagCompound var1) { -- this.field_143044_a = var1.getCompoundTag("Features"); -- } -- -- public void writeToNBT(NBTTagCompound var1) { -- var1.setTag("Features", this.field_143044_a); -- } -- -- public void func_143043_a(NBTTagCompound var1, int var2, int var3) { -- String var4 = this.func_143042_b(var2, var3); -- var1.setName(var4); -- this.field_143044_a.setTag(var4, var1); -- } -- -- public String func_143042_b(int var1, int var2) { -- return "[" + var1 + "," + var2 + "]"; -+ public MapGenStructureData(String par1Str) { -+ super(par1Str); -+ } -+ -+ /** -+ * reads in data from the NBTTagCompound into this MapDataBase -+ */ -+ public void readFromNBT(NBTTagCompound par1NBTTagCompound) { -+ this.field_143044_a = par1NBTTagCompound.getCompoundTag("Features"); -+ } -+ -+ /** -+ * write data to NBTTagCompound from this MapDataBase, similar to Entities and TileEntities -+ */ -+ public void writeToNBT(NBTTagCompound par1NBTTagCompound) { -+ par1NBTTagCompound.setTag("Features", this.field_143044_a); -+ } -+ -+ public void func_143043_a(NBTTagCompound par1NBTTagCompound, int par2, int par3) { -+ String var4 = this.func_143042_b(par2, par3); -+ par1NBTTagCompound.setName(var4); -+ this.field_143044_a.setTag(var4, par1NBTTagCompound); -+ } -+ -+ public String func_143042_b(int par1, int par2) { -+ return "[" + par1 + "," + par2 + "]"; - } - - public NBTTagCompound func_143041_a() { ---- /dev/null -+++ org/spoutcraft/api/gui/Color.java -@@ -1,0 +1,173 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.api.gui; -+ -+import org.spoutcraft.api.animation.Animatable; -+ -+public final class Color implements Animatable { -+ private short red; -+ private short green; -+ private short blue; -+ private short alpha = 255; -+ -+ public Color(float r, float g, float b) { -+ setRed(r); -+ setGreen(g); -+ setBlue(b); -+ } -+ -+ public Color(float r, float g, float b, float a) { -+ setRed(r); -+ setGreen(g); -+ setBlue(b); -+ setAlpha(a); -+ } -+ -+ public Color(short r, short g, short b) { -+ red = r; -+ green = g; -+ blue = b; -+ } -+ -+ public Color(short r, short g, short b, short a) { -+ red = r; -+ green = g; -+ blue = b; -+ alpha = a; -+ } -+ -+ public Color(int argb) { -+ alpha = (short) (argb >>> 24); -+ red = (short) ((argb & 0xFF0000) >>> 16); -+ green = (short) ((argb & 0xFF00) >>> 8); -+ blue = (short) (argb & 0xFF); -+ } -+ -+ public float getRedF() { -+ return red / 255F; -+ } -+ -+ public float getGreenF() { -+ return green / 255F; -+ } -+ -+ public float getBlueF() { -+ return blue / 255F; -+ } -+ -+ public float getAlphaF() { -+ return alpha / 255F; -+ } -+ -+ public short getRedB() { -+ return red; -+ } -+ -+ public short getGreenB() { -+ return green; -+ } -+ -+ public short getBlueB() { -+ return blue; -+ } -+ -+ public short getAlphaB() { -+ return alpha; -+ } -+ -+ public int getRedI() { -+ return (int)red; -+ } -+ -+ public int getGreenI() { -+ return (int)green; -+ } -+ -+ public int getBlueI() { -+ return (int)blue; -+ } -+ -+ public int getAlphaI() { -+ return (int)alpha; -+ } -+ -+ public Color setRed(float r) { -+ red = (short) (r * 255); -+ return this; -+ } -+ -+ public Color setGreen(float g) { -+ green = (short) (g * 255); -+ return this; -+ } -+ -+ public Color setBlue(float b) { -+ blue = (short) (b * 255); -+ return this; -+ } -+ -+ public Color setAlpha(float a) { -+ alpha = (short) (a * 255); -+ return this; -+ } -+ -+ public Color clone() { -+ return new Color(red, green, blue, alpha); -+ } -+ -+ public String toString() { -+ return "r: " + red + " g: " + green + " b: " + blue + " a: " + alpha; -+ } -+ -+ public boolean isInvalid() { -+ return red == -1 || red / 255 == -1; -+ } -+ -+ public boolean isOverride() { -+ return red == -2 || red / 255 == -2; -+ } -+ -+ public static Color invalid() { -+ return new Color(-1, -1, -1); -+ } -+ -+ public static Color override() { -+ return new Color(-2, -2, -2); -+ } -+ -+ public int toInt() { -+ return (getAlphaI() & 0xFF) << 24 | (getRedI() & 0xFF) << 16 | (getGreenI() & 0xFF) << 8 | (getBlueI() & 0xFF); -+ } -+ -+ public Animatable getValueAt(double p, Animatable startValue, Animatable endValue) { -+ short r, g, b, a; -+ Color p1 = (Color) startValue; -+ Color p2 = (Color) endValue; -+ r = p1.red; -+ g = p1.green; -+ b = p1.blue; -+ a = p1.alpha; -+ r += (p2.red - r) * p; -+ g += (p2.green - g) * p; -+ b += (p2.blue - b) * p; -+ a += (p2.alpha - a) * p; -+ return new Color(r, g, b, a); -+ } -+} ---- /dev/null -+++ org/spoutcraft/client/gui/ButtonUpdater.java -@@ -1,0 +1,24 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.client.gui; -+ -+public interface ButtonUpdater { -+ public void updateButtons(); -+} ---- net/minecraft/src/WorldGenWaterlily.java -+++ net/minecraft/src/WorldGenWaterlily.java -@@ -3,13 +3,14 @@ - import java.util.Random; - - public class WorldGenWaterlily extends WorldGenerator { -- public boolean generate(World var1, Random var2, int var3, int var4, int var5) { -- for(int var6 = 0; var6 < 10; ++var6) { -- int var7 = var3 + var2.nextInt(8) - var2.nextInt(8); -- int var8 = var4 + var2.nextInt(4) - var2.nextInt(4); -- int var9 = var5 + var2.nextInt(8) - var2.nextInt(8); -- if(var1.isAirBlock(var7, var8, var9) && Block.waterlily.canPlaceBlockAt(var1, var7, var8, var9)) { -- var1.setBlock(var7, var8, var9, Block.waterlily.blockID, 0, 2); -+ public boolean generate(World par1World, Random par2Random, int par3, int par4, int par5) { -+ for (int var6 = 0; var6 < 10; ++var6) { -+ int var7 = par3 + par2Random.nextInt(8) - par2Random.nextInt(8); -+ int var8 = par4 + par2Random.nextInt(4) - par2Random.nextInt(4); -+ int var9 = par5 + par2Random.nextInt(8) - par2Random.nextInt(8); -+ -+ if (par1World.isAirBlock(var7, var8, var9) && Block.waterlily.canPlaceBlockAt(par1World, var7, var8, var9)) { -+ par1World.setBlock(var7, var8, var9, Block.waterlily.blockID, 0, 2); - } - } - ---- net/minecraft/src/ComponentNetherBridgeCorridor4.java -+++ net/minecraft/src/ComponentNetherBridgeCorridor4.java -@@ -4,54 +4,64 @@ - import java.util.Random; - - public class ComponentNetherBridgeCorridor4 extends ComponentNetherBridgePiece { -- public ComponentNetherBridgeCorridor4() { -- } -- -- public ComponentNetherBridgeCorridor4(int var1, Random var2, StructureBoundingBox var3, int var4) { -- super(var1); -- this.coordBaseMode = var4; -- this.boundingBox = var3; -- } -- -- public void buildComponent(StructureComponent var1, List var2, Random var3) { -+ public ComponentNetherBridgeCorridor4() {} -+ -+ public ComponentNetherBridgeCorridor4(int par1, Random par2Random, StructureBoundingBox par3StructureBoundingBox, int par4) { -+ super(par1); -+ this.coordBaseMode = par4; -+ this.boundingBox = par3StructureBoundingBox; -+ } -+ -+ /** -+ * Initiates construction of the Structure Component picked, at the current Location of StructGen -+ */ -+ public void buildComponent(StructureComponent par1StructureComponent, List par2List, Random par3Random) { - byte var4 = 1; -- if(this.coordBaseMode == 1 || this.coordBaseMode == 2) { -+ -+ if (this.coordBaseMode == 1 || this.coordBaseMode == 2) { - var4 = 5; - } - -- this.getNextComponentX((ComponentNetherBridgeStartPiece)var1, var2, var3, 0, var4, var3.nextInt(8) > 0); -- this.getNextComponentZ((ComponentNetherBridgeStartPiece)var1, var2, var3, 0, var4, var3.nextInt(8) > 0); -- } -- -- public static ComponentNetherBridgeCorridor4 createValidComponent(List var0, Random var1, int var2, int var3, int var4, int var5, int var6) { -- StructureBoundingBox var7 = StructureBoundingBox.getComponentToAddBoundingBox(var2, var3, var4, -3, 0, 0, 9, 7, 9, var5); -- return isAboveGround(var7) && StructureComponent.findIntersecting(var0, var7) == null ? new ComponentNetherBridgeCorridor4(var6, var1, var7, var5) : null; -- } -- -- public boolean addComponentParts(World var1, Random var2, StructureBoundingBox var3) { -- this.fillWithBlocks(var1, var3, 0, 0, 0, 8, 1, 8, Block.netherBrick.blockID, Block.netherBrick.blockID, false); -- this.fillWithBlocks(var1, var3, 0, 2, 0, 8, 5, 8, 0, 0, false); -- this.fillWithBlocks(var1, var3, 0, 6, 0, 8, 6, 5, Block.netherBrick.blockID, Block.netherBrick.blockID, false); -- this.fillWithBlocks(var1, var3, 0, 2, 0, 2, 5, 0, Block.netherBrick.blockID, Block.netherBrick.blockID, false); -- this.fillWithBlocks(var1, var3, 6, 2, 0, 8, 5, 0, Block.netherBrick.blockID, Block.netherBrick.blockID, false); -- this.fillWithBlocks(var1, var3, 1, 3, 0, 1, 4, 0, Block.netherFence.blockID, Block.netherFence.blockID, false); -- this.fillWithBlocks(var1, var3, 7, 3, 0, 7, 4, 0, Block.netherFence.blockID, Block.netherFence.blockID, false); -- this.fillWithBlocks(var1, var3, 0, 2, 4, 8, 2, 8, Block.netherBrick.blockID, Block.netherBrick.blockID, false); -- this.fillWithBlocks(var1, var3, 1, 1, 4, 2, 2, 4, 0, 0, false); -- this.fillWithBlocks(var1, var3, 6, 1, 4, 7, 2, 4, 0, 0, false); -- this.fillWithBlocks(var1, var3, 0, 3, 8, 8, 3, 8, Block.netherFence.blockID, Block.netherFence.blockID, false); -- this.fillWithBlocks(var1, var3, 0, 3, 6, 0, 3, 7, Block.netherFence.blockID, Block.netherFence.blockID, false); -- this.fillWithBlocks(var1, var3, 8, 3, 6, 8, 3, 7, Block.netherFence.blockID, Block.netherFence.blockID, false); -- this.fillWithBlocks(var1, var3, 0, 3, 4, 0, 5, 5, Block.netherBrick.blockID, Block.netherBrick.blockID, false); -- this.fillWithBlocks(var1, var3, 8, 3, 4, 8, 5, 5, Block.netherBrick.blockID, Block.netherBrick.blockID, false); -- this.fillWithBlocks(var1, var3, 1, 3, 5, 2, 5, 5, Block.netherBrick.blockID, Block.netherBrick.blockID, false); -- this.fillWithBlocks(var1, var3, 6, 3, 5, 7, 5, 5, Block.netherBrick.blockID, Block.netherBrick.blockID, false); -- this.fillWithBlocks(var1, var3, 1, 4, 5, 1, 5, 5, Block.netherFence.blockID, Block.netherFence.blockID, false); -- this.fillWithBlocks(var1, var3, 7, 4, 5, 7, 5, 5, Block.netherFence.blockID, Block.netherFence.blockID, false); -- -- for(int var4 = 0; var4 <= 5; ++var4) { -- for(int var5 = 0; var5 <= 8; ++var5) { -- this.fillCurrentPositionBlocksDownwards(var1, Block.netherBrick.blockID, 0, var5, -1, var4, var3); -+ this.getNextComponentX((ComponentNetherBridgeStartPiece)par1StructureComponent, par2List, par3Random, 0, var4, par3Random.nextInt(8) > 0); -+ this.getNextComponentZ((ComponentNetherBridgeStartPiece)par1StructureComponent, par2List, par3Random, 0, var4, par3Random.nextInt(8) > 0); -+ } -+ -+ /** -+ * Creates and returns a new component piece. Or null if it could not find enough room to place it. -+ */ -+ public static ComponentNetherBridgeCorridor4 createValidComponent(List par0List, Random par1Random, int par2, int par3, int par4, int par5, int par6) { -+ StructureBoundingBox var7 = StructureBoundingBox.getComponentToAddBoundingBox(par2, par3, par4, -3, 0, 0, 9, 7, 9, par5); -+ return isAboveGround(var7) && StructureComponent.findIntersecting(par0List, var7) == null ? new ComponentNetherBridgeCorridor4(par6, par1Random, var7, par5) : null; -+ } -+ -+ /** -+ * second Part of Structure generating, this for example places Spiderwebs, Mob Spawners, it closes Mineshafts at the -+ * end, it adds Fences... -+ */ -+ public boolean addComponentParts(World par1World, Random par2Random, StructureBoundingBox par3StructureBoundingBox) { -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 0, 0, 0, 8, 1, 8, Block.netherBrick.blockID, Block.netherBrick.blockID, false); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 0, 2, 0, 8, 5, 8, 0, 0, false); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 0, 6, 0, 8, 6, 5, Block.netherBrick.blockID, Block.netherBrick.blockID, false); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 0, 2, 0, 2, 5, 0, Block.netherBrick.blockID, Block.netherBrick.blockID, false); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 6, 2, 0, 8, 5, 0, Block.netherBrick.blockID, Block.netherBrick.blockID, false); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 1, 3, 0, 1, 4, 0, Block.netherFence.blockID, Block.netherFence.blockID, false); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 7, 3, 0, 7, 4, 0, Block.netherFence.blockID, Block.netherFence.blockID, false); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 0, 2, 4, 8, 2, 8, Block.netherBrick.blockID, Block.netherBrick.blockID, false); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 1, 1, 4, 2, 2, 4, 0, 0, false); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 6, 1, 4, 7, 2, 4, 0, 0, false); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 0, 3, 8, 8, 3, 8, Block.netherFence.blockID, Block.netherFence.blockID, false); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 0, 3, 6, 0, 3, 7, Block.netherFence.blockID, Block.netherFence.blockID, false); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 8, 3, 6, 8, 3, 7, Block.netherFence.blockID, Block.netherFence.blockID, false); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 0, 3, 4, 0, 5, 5, Block.netherBrick.blockID, Block.netherBrick.blockID, false); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 8, 3, 4, 8, 5, 5, Block.netherBrick.blockID, Block.netherBrick.blockID, false); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 1, 3, 5, 2, 5, 5, Block.netherBrick.blockID, Block.netherBrick.blockID, false); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 6, 3, 5, 7, 5, 5, Block.netherBrick.blockID, Block.netherBrick.blockID, false); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 1, 4, 5, 1, 5, 5, Block.netherFence.blockID, Block.netherFence.blockID, false); -+ this.fillWithBlocks(par1World, par3StructureBoundingBox, 7, 4, 5, 7, 5, 5, Block.netherFence.blockID, Block.netherFence.blockID, false); -+ -+ for (int var4 = 0; var4 <= 5; ++var4) { -+ for (int var5 = 0; var5 <= 8; ++var5) { -+ this.fillCurrentPositionBlocksDownwards(par1World, Block.netherBrick.blockID, 0, var5, -1, var4, par3StructureBoundingBox); - } - } - ---- net/minecraft/src/RenderEntity.java -+++ net/minecraft/src/RenderEntity.java -@@ -3,13 +3,23 @@ - import org.lwjgl.opengl.GL11; - - public class RenderEntity extends Render { -- public void doRender(Entity var1, double var2, double var4, double var6, float var8, float var9) { -+ -+ /** -+ * Actually renders the given argument. This is a synthetic bridge method, always casting down its argument and then -+ * handing it off to a worker function which does the actual work. In all probabilty, the class Render is generic -+ * (Render var2) { -+ if (var4 > var2) { - var4 = var2; - } - -- if(var6 > var2) { -+ if (var6 > var2) { - var6 = var2; - } - -- if(var8 > var2) { -+ if (var8 > var2) { - var8 = var2; - } - - this.velocityX = (int)(var4 * 8000.0D); - this.velocityY = (int)(var6 * 8000.0D); - this.velocityZ = (int)(var8 * 8000.0D); -- this.metaData = var1.getDataWatcher(); -- } -- -- public void readPacketData(DataInput var1) throws IOException { -- this.entityId = var1.readInt(); -- this.type = var1.readByte() & 255; -- this.xPosition = var1.readInt(); -- this.yPosition = var1.readInt(); -- this.zPosition = var1.readInt(); -- this.yaw = var1.readByte(); -- this.pitch = var1.readByte(); -- this.headYaw = var1.readByte(); -- this.velocityX = var1.readShort(); -- this.velocityY = var1.readShort(); -- this.velocityZ = var1.readShort(); -- this.u = DataWatcher.readWatchableObjects(var1); -- } -- -- public void writePacketData(DataOutput var1) throws IOException { -- var1.writeInt(this.entityId); -- var1.writeByte(this.type & 255); -- var1.writeInt(this.xPosition); -- var1.writeInt(this.yPosition); -- var1.writeInt(this.zPosition); -- var1.writeByte(this.yaw); -- var1.writeByte(this.pitch); -- var1.writeByte(this.headYaw); -- var1.writeShort(this.velocityX); -- var1.writeShort(this.velocityY); -- var1.writeShort(this.velocityZ); -- this.metaData.writeWatchableObjects(var1); -- } -- -- public void processPacket(NetHandler var1) { -- var1.handleMobSpawn(this); -- } -- -+ this.metaData = par1EntityLivingBase.getDataWatcher(); -+ } -+ -+ /** -+ * Abstract. Reads the raw packet data from the data stream. -+ */ -+ public void readPacketData(DataInput par1DataInput) throws IOException { -+ this.entityId = par1DataInput.readInt(); -+ this.type = par1DataInput.readByte() & 255; -+ this.xPosition = par1DataInput.readInt(); -+ this.yPosition = par1DataInput.readInt(); -+ this.zPosition = par1DataInput.readInt(); -+ this.yaw = par1DataInput.readByte(); -+ this.pitch = par1DataInput.readByte(); -+ this.headYaw = par1DataInput.readByte(); -+ this.velocityX = par1DataInput.readShort(); -+ this.velocityY = par1DataInput.readShort(); -+ this.velocityZ = par1DataInput.readShort(); -+ this.metadata = DataWatcher.readWatchableObjects(par1DataInput); -+ } -+ -+ /** -+ * Abstract. Writes the raw packet data to the data stream. -+ */ -+ public void writePacketData(DataOutput par1DataOutput) throws IOException { -+ par1DataOutput.writeInt(this.entityId); -+ par1DataOutput.writeByte(this.type & 255); -+ par1DataOutput.writeInt(this.xPosition); -+ par1DataOutput.writeInt(this.yPosition); -+ par1DataOutput.writeInt(this.zPosition); -+ par1DataOutput.writeByte(this.yaw); -+ par1DataOutput.writeByte(this.pitch); -+ par1DataOutput.writeByte(this.headYaw); -+ par1DataOutput.writeShort(this.velocityX); -+ par1DataOutput.writeShort(this.velocityY); -+ par1DataOutput.writeShort(this.velocityZ); -+ this.metaData.writeWatchableObjects(par1DataOutput); -+ } -+ -+ /** -+ * Passes this Packet on to the NetHandler for processing. -+ */ -+ public void processPacket(NetHandler par1NetHandler) { -+ par1NetHandler.handleMobSpawn(this); -+ } -+ -+ /** -+ * Abstract. Return the size of the packet (not counting the header). -+ */ - public int getPacketSize() { - return 26; - } - - public List getMetadata() { -- if(this.u == null) { -- this.u = this.metaData.getAllWatched(); -+ if (this.metadata == null) { -+ this.metadata = this.metaData.getAllWatched(); - } - -- return this.u; -+ return this.metadata; - } - } ---- net/minecraft/src/CommandServerPardonIp.java -+++ net/minecraft/src/CommandServerPardonIp.java -@@ -9,24 +9,31 @@ - return "pardon-ip"; - } - -+ /** -+ * Return the required permission level for this command. -+ */ - public int getRequiredPermissionLevel() { - return 3; - } - -- public boolean canCommandSenderUseCommand(ICommandSender var1) { -- return MinecraftServer.getServer().getConfigurationManager().getBannedIPs().isListActive() && super.canCommandSenderUseCommand(var1); -+ /** -+ * Returns true if the given command sender is allowed to use this command. -+ */ -+ public boolean canCommandSenderUseCommand(ICommandSender par1ICommandSender) { -+ return MinecraftServer.getServer().getConfigurationManager().getBannedIPs().isListActive() && super.canCommandSenderUseCommand(par1ICommandSender); - } - -- public String getCommandUsage(ICommandSender var1) { -+ public String getCommandUsage(ICommandSender par1ICommandSender) { - return "commands.unbanip.usage"; - } - -- public void processCommand(ICommandSender var1, String[] var2) { -- if(var2.length == 1 && var2[0].length() > 1) { -- Matcher var3 = CommandServerBanIp.a.matcher(var2[0]); -- if(var3.matches()) { -- MinecraftServer.getServer().getConfigurationManager().getBannedIPs().remove(var2[0]); -- notifyAdmins(var1, "commands.unbanip.success", new Object[]{var2[0]}); -+ public void processCommand(ICommandSender par1ICommandSender, String[] par2ArrayOfStr) { -+ if (par2ArrayOfStr.length == 1 && par2ArrayOfStr[0].length() > 1) { -+ Matcher var3 = CommandServerBanIp.IPv4Pattern.matcher(par2ArrayOfStr[0]); -+ -+ if (var3.matches()) { -+ MinecraftServer.getServer().getConfigurationManager().getBannedIPs().remove(par2ArrayOfStr[0]); -+ notifyAdmins(par1ICommandSender, "commands.unbanip.success", new Object[] {par2ArrayOfStr[0]}); - } else { - throw new SyntaxErrorException("commands.unbanip.invalid", new Object[0]); - } -@@ -35,7 +42,10 @@ - } - } - -- public List addTabCompletionOptions(ICommandSender var1, String[] var2) { -- return var2.length == 1 ? getListOfStringsFromIterableMatchingLastWord(var2, MinecraftServer.getServer().getConfigurationManager().getBannedIPs().getBannedList().keySet()) : null; -+ /** -+ * Adds the strings available in this command to the given list of tab completion options. -+ */ -+ public List addTabCompletionOptions(ICommandSender par1ICommandSender, String[] par2ArrayOfStr) { -+ return par2ArrayOfStr.length == 1 ? getListOfStringsFromIterableMatchingLastWord(par2ArrayOfStr, MinecraftServer.getServer().getConfigurationManager().getBannedIPs().getBannedList().keySet()) : null; - } - } ---- net/minecraft/src/SlotBrewingStandPotion.java -+++ net/minecraft/src/SlotBrewingStandPotion.java -@@ -1,30 +1,42 @@ - package net.minecraft.src; - - class SlotBrewingStandPotion extends Slot { -+ -+ /** The player that has this container open. */ - private EntityPlayer player; - -- public SlotBrewingStandPotion(EntityPlayer var1, IInventory var2, int var3, int var4, int var5) { -- super(var2, var3, var4, var5); -- this.player = var1; -- } -- -- public boolean isItemValid(ItemStack var1) { -- return canHoldPotion(var1); -- } -- -+ public SlotBrewingStandPotion(EntityPlayer par1EntityPlayer, IInventory par2IInventory, int par3, int par4, int par5) { -+ super(par2IInventory, par3, par4, par5); -+ this.player = par1EntityPlayer; -+ } -+ -+ /** -+ * Check if the stack is a valid item for this slot. Always true beside for the armor slots. -+ */ -+ public boolean isItemValid(ItemStack par1ItemStack) { -+ return canHoldPotion(par1ItemStack); -+ } -+ -+ /** -+ * Returns the maximum stack size for a given slot (usually the same as getInventoryStackLimit(), but 1 in the case of -+ * armor slots) -+ */ - public int getSlotStackLimit() { - return 1; - } - -- public void onPickupFromSlot(EntityPlayer var1, ItemStack var2) { -- if(var2.itemID == Item.potion.itemID && var2.getItemDamage() > 0) { -+ public void onPickupFromSlot(EntityPlayer par1EntityPlayer, ItemStack par2ItemStack) { -+ if (par2ItemStack.itemID == Item.potion.itemID && par2ItemStack.getItemDamage() > 0) { - this.player.addStat(AchievementList.potion, 1); - } - -- super.onPickupFromSlot(var1, var2); -+ super.onPickupFromSlot(par1EntityPlayer, par2ItemStack); - } - -- public static boolean canHoldPotion(ItemStack var0) { -- return var0 != null && (var0.itemID == Item.potion.itemID || var0.itemID == Item.glassBottle.itemID); -+ /** -+ * Returns true if this itemstack can be filled with a potion -+ */ -+ public static boolean canHoldPotion(ItemStack par0ItemStack) { -+ return par0ItemStack != null && (par0ItemStack.itemID == Item.potion.itemID || par0ItemStack.itemID == Item.glassBottle.itemID); - } - } ---- net/minecraft/src/GuiFlatPresetsItem.java -+++ net/minecraft/src/GuiFlatPresetsItem.java -@@ -1,13 +1,19 @@ - package net.minecraft.src; - - class GuiFlatPresetsItem { -+ -+ /** ID for the item used as icon for this preset. */ - public int iconId; -- public String b; -- public String c; -- -- public GuiFlatPresetsItem(int var1, String var2, String var3) { -- this.iconId = var1; -- this.b = var2; -- this.c = var3; -+ -+ /** Name for this preset. */ -+ public String presetName; -+ -+ /** Data for this preset. */ -+ public String presetData; -+ -+ public GuiFlatPresetsItem(int par1, String par2Str, String par3Str) { -+ this.iconId = par1; -+ this.presetName = par2Str; -+ this.presetData = par3Str; - } - } ---- net/minecraft/src/EntityHanging.java -+++ net/minecraft/src/EntityHanging.java -@@ -10,33 +10,33 @@ - public int yPosition; - public int zPosition; - -- public EntityHanging(World var1) { -- super(var1); -+ public EntityHanging(World par1World) { -+ super(par1World); - this.yOffset = 0.0F; - this.setSize(0.5F, 0.5F); - } - -- public EntityHanging(World var1, int var2, int var3, int var4, int var5) { -- this(var1); -- this.xPosition = var2; -- this.yPosition = var3; -- this.zPosition = var4; -- } -- -- protected void entityInit() { -- } -- -- public void setDirection(int var1) { -- this.hangingDirection = var1; -- this.prevRotationYaw = this.rotationYaw = (float)(var1 * 90); -+ public EntityHanging(World par1World, int par2, int par3, int par4, int par5) { -+ this(par1World); -+ this.xPosition = par2; -+ this.yPosition = par3; -+ this.zPosition = par4; -+ } -+ -+ protected void entityInit() {} -+ -+ public void setDirection(int par1) { -+ this.hangingDirection = par1; -+ this.prevRotationYaw = this.rotationYaw = (float)(par1 * 90); - float var2 = (float)this.getWidthPixels(); - float var3 = (float)this.getHeightPixels(); - float var4 = (float)this.getWidthPixels(); -- if(var1 != 2 && var1 != 0) { -+ -+ if (par1 != 2 && par1 != 0) { - var2 = 0.5F; - } else { - var4 = 0.5F; -- this.rotationYaw = this.prevRotationYaw = (float)(Direction.rotateOpposite[var1] * 90); -+ this.rotationYaw = this.prevRotationYaw = (float)(Direction.rotateOpposite[par1] * 90); - } - - var2 /= 32.0F; -@@ -45,36 +45,37 @@ - float var5 = (float)this.xPosition + 0.5F; - float var6 = (float)this.yPosition + 0.5F; - float var7 = (float)this.zPosition + 0.5F; -- float var8 = 9.0F / 16.0F; -- if(var1 == 2) { -+ float var8 = 0.5625F; -+ -+ if (par1 == 2) { - var7 -= var8; - } - -- if(var1 == 1) { -+ if (par1 == 1) { - var5 -= var8; - } - -- if(var1 == 0) { -+ if (par1 == 0) { - var7 += var8; - } - -- if(var1 == 3) { -+ if (par1 == 3) { - var5 += var8; - } - -- if(var1 == 2) { -+ if (par1 == 2) { - var5 -= this.func_70517_b(this.getWidthPixels()); - } - -- if(var1 == 1) { -+ if (par1 == 1) { - var7 += this.func_70517_b(this.getWidthPixels()); - } - -- if(var1 == 0) { -+ if (par1 == 0) { - var5 += this.func_70517_b(this.getWidthPixels()); - } - -- if(var1 == 3) { -+ if (par1 == 3) { - var7 -= this.func_70517_b(this.getWidthPixels()); - } - -@@ -84,26 +85,33 @@ - this.boundingBox.setBounds((double)(var5 - var2 - var9), (double)(var6 - var3 - var9), (double)(var7 - var4 - var9), (double)(var5 + var2 + var9), (double)(var6 + var3 + var9), (double)(var7 + var4 + var9)); - } - -- private float func_70517_b(int var1) { -- return var1 == 32 ? 0.5F : (var1 == 64 ? 0.5F : 0.0F); -+ private float func_70517_b(int par1) { -+ return par1 == 32 ? 0.5F : (par1 == 64 ? 0.5F : 0.0F); - } - -+ /** -+ * Called to update the entity's position/logic. -+ */ - public void onUpdate() { - this.prevPosX = this.posX; - this.prevPosY = this.posY; - this.prevPosZ = this.posZ; -- if(this.tickCounter1++ == 100 && !this.worldObj.isRemote) { -+ -+ if (this.tickCounter1++ == 100 && !this.worldObj.isRemote) { - this.tickCounter1 = 0; -- if(!this.isDead && !this.onValidSurface()) { -+ -+ if (!this.isDead && !this.onValidSurface()) { - this.setDead(); - this.onBroken((Entity)null); - } - } -- - } - -+ /** -+ * checks to make sure painting can be placed there -+ */ - public boolean onValidSurface() { -- if(!this.worldObj.getCollidingBoundingBoxes(this, this.boundingBox).isEmpty()) { -+ if (!this.worldObj.getCollidingBoundingBoxes(this, this.boundingBox).isEmpty()) { - return false; - } else { - int var1 = Math.max(1, this.getWidthPixels() / 16); -@@ -111,34 +119,36 @@ - int var3 = this.xPosition; - int var4 = this.yPosition; - int var5 = this.zPosition; -- if(this.hangingDirection == 2) { -+ -+ if (this.hangingDirection == 2) { - var3 = MathHelper.floor_double(this.posX - (double)((float)this.getWidthPixels() / 32.0F)); - } - -- if(this.hangingDirection == 1) { -+ if (this.hangingDirection == 1) { - var5 = MathHelper.floor_double(this.posZ - (double)((float)this.getWidthPixels() / 32.0F)); - } - -- if(this.hangingDirection == 0) { -+ if (this.hangingDirection == 0) { - var3 = MathHelper.floor_double(this.posX - (double)((float)this.getWidthPixels() / 32.0F)); - } - -- if(this.hangingDirection == 3) { -+ if (this.hangingDirection == 3) { - var5 = MathHelper.floor_double(this.posZ - (double)((float)this.getWidthPixels() / 32.0F)); - } - - var4 = MathHelper.floor_double(this.posY - (double)((float)this.getHeightPixels() / 32.0F)); - -- for(int var6 = 0; var6 < var1; ++var6) { -- for(int var7 = 0; var7 < var2; ++var7) { -+ for (int var6 = 0; var6 < var1; ++var6) { -+ for (int var7 = 0; var7 < var2; ++var7) { - Material var8; -- if(this.hangingDirection != 2 && this.hangingDirection != 0) { -+ -+ if (this.hangingDirection != 2 && this.hangingDirection != 0) { - var8 = this.worldObj.getBlockMaterial(this.xPosition, var4 + var7, var5 + var6); - } else { - var8 = this.worldObj.getBlockMaterial(var3 + var6, var4 + var7, this.zPosition); - } - -- if(!var8.isSolid()) { -+ if (!var8.isSolid()) { - return false; - } - } -@@ -146,101 +156,126 @@ - - List var9 = this.worldObj.getEntitiesWithinAABBExcludingEntity(this, this.boundingBox); - Iterator var10 = var9.iterator(); -- - Entity var11; -+ - do { -- if(!var10.hasNext()) { -+ if (!var10.hasNext()) { - return true; - } - - var11 = (Entity)var10.next(); -- } while(!(var11 instanceof EntityHanging)); -+ } while (!(var11 instanceof EntityHanging)); - - return false; - } - } - -+ /** -+ * Returns true if other Entities should be prevented from moving through this Entity. -+ */ - public boolean canBeCollidedWith() { - return true; - } - -- public boolean hitByEntity(Entity var1) { -- return var1 instanceof EntityPlayer ? this.attackEntityFrom(DamageSource.causePlayerDamage((EntityPlayer)var1), 0.0F) : false; -+ /** -+ * Called when a player attacks an entity. If this returns true the attack will not happen. -+ */ -+ public boolean hitByEntity(Entity par1Entity) { -+ return par1Entity instanceof EntityPlayer ? this.attackEntityFrom(DamageSource.causePlayerDamage((EntityPlayer)par1Entity), 0.0F) : false; - } - -- public boolean attackEntityFrom(DamageSource var1, float var2) { -- if(this.isEntityInvulnerable()) { -+ /** -+ * Called when the entity is attacked. -+ */ -+ public boolean attackEntityFrom(DamageSource par1DamageSource, float par2) { -+ if (this.isEntityInvulnerable()) { - return false; - } else { -- if(!this.isDead && !this.worldObj.isRemote) { -+ if (!this.isDead && !this.worldObj.isRemote) { - this.setDead(); - this.setBeenAttacked(); -- this.onBroken(var1.getEntity()); -+ this.onBroken(par1DamageSource.getEntity()); - } - - return true; - } - } - -- public void moveEntity(double var1, double var3, double var5) { -- if(!this.worldObj.isRemote && !this.isDead && var1 * var1 + var3 * var3 + var5 * var5 > 0.0D) { -- this.setDead(); -- this.onBroken((Entity)null); -- } -- -- } -- -- public void addVelocity(double var1, double var3, double var5) { -- if(!this.worldObj.isRemote && !this.isDead && var1 * var1 + var3 * var3 + var5 * var5 > 0.0D) { -- this.setDead(); -- this.onBroken((Entity)null); -- } -- -- } -- -- public void writeEntityToNBT(NBTTagCompound var1) { -- var1.setByte("Direction", (byte)this.hangingDirection); -- var1.setInteger("TileX", this.xPosition); -- var1.setInteger("TileY", this.yPosition); -- var1.setInteger("TileZ", this.zPosition); -- switch(this.hangingDirection) { -- case 0: -- var1.setByte("Dir", (byte)2); -- break; -- case 1: -- var1.setByte("Dir", (byte)1); -- break; -- case 2: -- var1.setByte("Dir", (byte)0); -- break; -- case 3: -- var1.setByte("Dir", (byte)3); -- } -- -- } -- -- public void readEntityFromNBT(NBTTagCompound var1) { -- if(var1.hasKey("Direction")) { -- this.hangingDirection = var1.getByte("Direction"); -- } else { -- switch(var1.getByte("Dir")) { -+ /** -+ * Tries to moves the entity by the passed in displacement. Args: x, y, z -+ */ -+ public void moveEntity(double par1, double par3, double par5) { -+ if (!this.worldObj.isRemote && !this.isDead && par1 * par1 + par3 * par3 + par5 * par5 > 0.0D) { -+ this.setDead(); -+ this.onBroken((Entity)null); -+ } -+ } -+ -+ /** -+ * Adds to the current velocity of the entity. Args: x, y, z -+ */ -+ public void addVelocity(double par1, double par3, double par5) { -+ if (!this.worldObj.isRemote && !this.isDead && par1 * par1 + par3 * par3 + par5 * par5 > 0.0D) { -+ this.setDead(); -+ this.onBroken((Entity)null); -+ } -+ } -+ -+ /** -+ * (abstract) Protected helper method to write subclass entity data to NBT. -+ */ -+ public void writeEntityToNBT(NBTTagCompound par1NBTTagCompound) { -+ par1NBTTagCompound.setByte("Direction", (byte)this.hangingDirection); -+ par1NBTTagCompound.setInteger("TileX", this.xPosition); -+ par1NBTTagCompound.setInteger("TileY", this.yPosition); -+ par1NBTTagCompound.setInteger("TileZ", this.zPosition); -+ -+ switch (this.hangingDirection) { - case 0: -- this.hangingDirection = 2; -+ par1NBTTagCompound.setByte("Dir", (byte)2); - break; -+ - case 1: -- this.hangingDirection = 1; -+ par1NBTTagCompound.setByte("Dir", (byte)1); - break; -+ - case 2: -- this.hangingDirection = 0; -+ par1NBTTagCompound.setByte("Dir", (byte)0); - break; -+ - case 3: -- this.hangingDirection = 3; -+ par1NBTTagCompound.setByte("Dir", (byte)3); -+ } -+ } -+ -+ /** -+ * (abstract) Protected helper method to read subclass entity data from NBT. -+ */ -+ public void readEntityFromNBT(NBTTagCompound par1NBTTagCompound) { -+ if (par1NBTTagCompound.hasKey("Direction")) { -+ this.hangingDirection = par1NBTTagCompound.getByte("Direction"); -+ } else { -+ switch (par1NBTTagCompound.getByte("Dir")) { -+ case 0: -+ this.hangingDirection = 2; -+ break; -+ -+ case 1: -+ this.hangingDirection = 1; -+ break; -+ -+ case 2: -+ this.hangingDirection = 0; -+ break; -+ -+ case 3: -+ this.hangingDirection = 3; - } - } - -- this.xPosition = var1.getInteger("TileX"); -- this.yPosition = var1.getInteger("TileY"); -- this.zPosition = var1.getInteger("TileZ"); -+ this.xPosition = par1NBTTagCompound.getInteger("TileX"); -+ this.yPosition = par1NBTTagCompound.getInteger("TileY"); -+ this.zPosition = par1NBTTagCompound.getInteger("TileZ"); - this.setDirection(this.hangingDirection); - } - -@@ -248,6 +283,9 @@ - - public abstract int getHeightPixels(); - -+ /** -+ * Called when this entity is broken. Entity parameter may be null. -+ */ - public abstract void onBroken(Entity var1); - - protected boolean shouldSetPosAfterLoading() { ---- /dev/null -+++ org/spoutcraft/api/inventory/Inventory.java -@@ -1,0 +1,237 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.api.inventory; -+ -+import java.util.HashMap; -+ -+import org.spoutcraft.api.material.Material; -+ -+/** -+ * Interface to the various inventories -+ */ -+public interface Inventory { -+ /** -+ * Returns the size of the inventory -+ * -+ * @return The inventory size -+ */ -+ public int getSize(); -+ -+ /** -+ * Return the name of the inventory -+ * -+ * @return The inventory name -+ */ -+ public String getName(); -+ -+ /** -+ * Get the ItemStack found in the slot at the given index -+ * -+ * @param index The index of the Slot's ItemStack to return -+ * @return The ItemStack in the slot -+ */ -+ public ItemStack getItem(int index); -+ -+ /** -+ * Stores the ItemStack at the given index -+ * -+ * @param index The index where to put the ItemStack -+ * @param item The ItemStack to set -+ */ -+ public void setItem(int index, ItemStack item); -+ -+ /** -+ * Stores the given ItemStacks in the inventory. -+ * -+ * This will try to fill existing stacks and empty slots as good as it can. -+ * It will return a HashMap of what it couldn't fit. -+ * -+ * @param items The ItemStacks to add -+ * @return -+ */ -+ public HashMap addItem(ItemStack... items); -+ -+ /** -+ * Removes the given ItemStacks from the inventory. -+ * -+ * It will try to remove 'as much as possible' from the types and amounts you -+ * give as arguments. It will return a HashMap of what it couldn't remove. -+ * -+ * @param items The ItemStacks to remove -+ * @return -+ */ -+ public HashMap removeItem(ItemStack... items); -+ -+ /** -+ * Get all ItemStacks from the inventory -+ * -+ * @return All the ItemStacks from all slots -+ */ -+ public ItemStack[] getContents(); -+ -+ /** -+ * Set the inventory's contents -+ * -+ * @return All the ItemStacks from all slots -+ */ -+ public void setContents(ItemStack[] items); -+ -+ /** -+ * Check if the inventory contains any ItemStacks with the given materialId -+ * -+ * @param materialId The materialId to check for -+ * @return If any ItemStacks were found -+ */ -+ public boolean contains(int materialId); -+ -+ /** -+ * Check if the inventory contains any ItemStacks with the given material -+ * -+ * @param material The material to check for -+ * @return If any ItemStacks were found -+ */ -+ public boolean contains(Material material); -+ -+ /** -+ * Check if the inventory contains any ItemStacks matching the given ItemStack -+ * This will only match if both the type and the amount of the stack match -+ * -+ * @param item The ItemStack to match against -+ * @return If any matching ItemStacks were found -+ */ -+ public boolean contains(ItemStack item); -+ -+ /** -+ * Check if the inventory contains any ItemStacks with the given materialId and at least the minimum amount specified -+ * -+ * @param materialId The materialId to check for -+ * @param amount The minimum amount to look for -+ * @return If any ItemStacks were found -+ */ -+ public boolean contains(int materialId, int amount); -+ -+ /** -+ * Check if the inventory contains any ItemStacks with the given material and at least the minimum amount specified -+ * -+ * @param material The material to check for -+ * @return If any ItemStacks were found -+ */ -+ public boolean contains(Material material, int amount); -+ -+ /** -+ * Check if the inventory contains any ItemStacks matching the given ItemStack and at least the minimum amount specified -+ * This will only match if both the type and the amount of the stack match -+ * -+ * @param item The ItemStack to match against -+ * @return If any matching ItemStacks were found -+ */ -+ public boolean contains(ItemStack item, int amount); -+ -+ /** -+ * Find all slots in the inventory containing any ItemStacks with the given materialId -+ * -+ * @param materialId The materialId to look for -+ * @return The Slots found. -+ */ -+ public HashMap all(int materialId); -+ -+ /** -+ * Find all slots in the inventory containing any ItemStacks with the given material -+ * -+ * @param materialId The material to look for -+ * @return The Slots found. -+ */ -+ public HashMap all(Material material); -+ -+ /** -+ * Find all slots in the inventory containing any ItemStacks with the given ItemStack -+ * This will only match slots if both the type and the amount of the stack match -+ * -+ * @param item The ItemStack to match against -+ * @return The Slots found. -+ */ -+ public HashMap all(ItemStack item); -+ -+ /** -+ * Find the first slot in the inventory containing an ItemStack with the given materialId -+ * -+ * @param materialId The materialId to look for -+ * @return The Slot found. -+ */ -+ public int first(int materialId); -+ -+ /** -+ * Find the first slot in the inventory containing an ItemStack with the given material -+ * -+ * @param materialId The material to look for -+ * @return The Slot found. -+ */ -+ public int first(Material material); -+ -+ /** -+ * Find the first slot in the inventory containing an ItemStack with the given stack -+ * This will only match a slot if both the type and the amount of the stack match -+ * -+ * @param item The ItemStack to match against -+ * @return The Slot found. -+ */ -+ public int first(ItemStack item); -+ -+ /** -+ * Find the first empty Slot. -+ * -+ * @return The first empty Slot found. -+ */ -+ public int firstEmpty(); -+ -+ /** -+ * Remove all stacks in the inventory matching the given materialId. -+ * -+ * @param materialId The material to remove -+ */ -+ public void remove(int materialId); -+ -+ /** -+ * Remove all stacks in the inventory matching the given material. -+ * -+ * @param material The material to remove -+ */ -+ public void remove(Material material); -+ -+ /** -+ * Remove all stacks in the inventory matching the given stack. -+ * This will only match a slot if both the type and the amount of the stack match -+ * -+ * @param item The ItemStack to match against -+ */ -+ public void remove(ItemStack item); -+ -+ /** -+ * Clear out a particular slot in the index -+ * -+ * @param index The index to empty. -+ */ -+ public void clear(int index); -+ -+ /** -+ * Clear out the whole index -+ */ -+ public void clear(); -+} ---- net/minecraft/src/EntityAIMoveThroughVillage.java -+++ net/minecraft/src/EntityAIMoveThroughVillage.java -@@ -7,40 +7,50 @@ - public class EntityAIMoveThroughVillage extends EntityAIBase { - private EntityCreature theEntity; - private double movementSpeed; -+ -+ /** The PathNavigate of our entity. */ - private PathEntity entityPathNavigate; - private VillageDoorInfo doorInfo; - private boolean isNocturnal; -- private List f = new ArrayList(); -+ private List doorList = new ArrayList(); - -- public EntityAIMoveThroughVillage(EntityCreature var1, double var2, boolean var4) { -- this.theEntity = var1; -- this.movementSpeed = var2; -- this.isNocturnal = var4; -+ public EntityAIMoveThroughVillage(EntityCreature par1EntityCreature, double par2, boolean par4) { -+ this.theEntity = par1EntityCreature; -+ this.movementSpeed = par2; -+ this.isNocturnal = par4; - this.setMutexBits(1); - } - -+ /** -+ * Returns whether the EntityAIBase should begin execution. -+ */ - public boolean shouldExecute() { - this.func_75414_f(); -- if(this.isNocturnal && this.theEntity.worldObj.isDaytime()) { -+ -+ if (this.isNocturnal && this.theEntity.worldObj.isDaytime()) { - return false; - } else { - Village var1 = this.theEntity.worldObj.villageCollectionObj.findNearestVillage(MathHelper.floor_double(this.theEntity.posX), MathHelper.floor_double(this.theEntity.posY), MathHelper.floor_double(this.theEntity.posZ), 0); -- if(var1 == null) { -+ -+ if (var1 == null) { - return false; - } else { - this.doorInfo = this.func_75412_a(var1); -- if(this.doorInfo == null) { -+ -+ if (this.doorInfo == null) { - return false; - } else { - boolean var2 = this.theEntity.getNavigator().getCanBreakDoors(); - this.theEntity.getNavigator().setBreakDoors(false); - this.entityPathNavigate = this.theEntity.getNavigator().getPathToXYZ((double)this.doorInfo.posX, (double)this.doorInfo.posY, (double)this.doorInfo.posZ); - this.theEntity.getNavigator().setBreakDoors(var2); -- if(this.entityPathNavigate != null) { -+ -+ if (this.entityPathNavigate != null) { - return true; - } else { - Vec3 var3 = RandomPositionGenerator.findRandomTargetBlockTowards(this.theEntity, 10, 7, this.theEntity.worldObj.getWorldVec3Pool().getVecFromPool((double)this.doorInfo.posX, (double)this.doorInfo.posY, (double)this.doorInfo.posZ)); -- if(var3 == null) { -+ -+ if (var3 == null) { - return false; - } else { - this.theEntity.getNavigator().setBreakDoors(false); -@@ -54,8 +64,11 @@ - } - } - -+ /** -+ * Returns whether an in-progress EntityAIBase should continue executing -+ */ - public boolean continueExecuting() { -- if(this.theEntity.getNavigator().noPath()) { -+ if (this.theEntity.getNavigator().noPath()) { - return false; - } else { - float var1 = this.theEntity.width + 4.0F; -@@ -63,27 +76,33 @@ - } - } - -+ /** -+ * Execute a one shot task or start executing a continuous task -+ */ - public void startExecuting() { - this.theEntity.getNavigator().setPath(this.entityPathNavigate, this.movementSpeed); - } - -+ /** -+ * Resets the task -+ */ - public void resetTask() { -- if(this.theEntity.getNavigator().noPath() || this.theEntity.getDistanceSq((double)this.doorInfo.posX, (double)this.doorInfo.posY, (double)this.doorInfo.posZ) < 16.0D) { -- this.f.add(this.doorInfo); -+ if (this.theEntity.getNavigator().noPath() || this.theEntity.getDistanceSq((double)this.doorInfo.posX, (double)this.doorInfo.posY, (double)this.doorInfo.posZ) < 16.0D) { -+ this.doorList.add(this.doorInfo); - } -- - } - -- private VillageDoorInfo func_75412_a(Village var1) { -+ private VillageDoorInfo func_75412_a(Village par1Village) { - VillageDoorInfo var2 = null; - int var3 = Integer.MAX_VALUE; -- List var4 = var1.getVillageDoorInfoList(); -+ List var4 = par1Village.getVillageDoorInfoList(); - Iterator var5 = var4.iterator(); - -- while(var5.hasNext()) { -+ while (var5.hasNext()) { - VillageDoorInfo var6 = (VillageDoorInfo)var5.next(); - int var7 = var6.getDistanceSquared(MathHelper.floor_double(this.theEntity.posX), MathHelper.floor_double(this.theEntity.posY), MathHelper.floor_double(this.theEntity.posZ)); -- if(var7 < var3 && !this.func_75413_a(var6)) { -+ -+ if (var7 < var3 && !this.func_75413_a(var6)) { - var2 = var6; - var3 = var7; - } -@@ -92,25 +111,24 @@ - return var2; - } - -- private boolean func_75413_a(VillageDoorInfo var1) { -- Iterator var2 = this.f.iterator(); -- -+ private boolean func_75413_a(VillageDoorInfo par1VillageDoorInfo) { -+ Iterator var2 = this.doorList.iterator(); - VillageDoorInfo var3; -+ - do { -- if(!var2.hasNext()) { -+ if (!var2.hasNext()) { - return false; - } - - var3 = (VillageDoorInfo)var2.next(); -- } while(var1.posX != var3.posX || var1.posY != var3.posY || var1.posZ != var3.posZ); -+ } while (par1VillageDoorInfo.posX != var3.posX || par1VillageDoorInfo.posY != var3.posY || par1VillageDoorInfo.posZ != var3.posZ); - - return true; - } - - private void func_75414_f() { -- if(this.f.size() > 15) { -- this.f.remove(0); -+ if (this.doorList.size() > 15) { -+ this.doorList.remove(0); - } -- - } - } ---- net/minecraft/src/RendererLivingEntity.java -+++ net/minecraft/src/RendererLivingEntity.java -@@ -1,114 +1,145 @@ - package net.minecraft.src; - - import java.util.Random; -+ -+ - import org.lwjgl.opengl.GL11; - import org.lwjgl.opengl.GL12; -+import org.bukkit.ChatColor; -+import org.spoutcraft.client.SpoutClient; -+import org.spoutcraft.client.config.Configuration; -+import org.spoutcraft.client.player.accessories.AccessoryHandler; -+import org.spoutcraft.client.player.accessories.AccessoryType; -+import org.spoutcraft.client.special.VIP; -+import org.spoutcraft.client.special.Resources; - - public abstract class RendererLivingEntity extends Render { - private static final ResourceLocation RES_ITEM_GLINT = new ResourceLocation("textures/misc/enchanted_item_glint.png"); - protected ModelBase mainModel; -+ -+ /** The model to be used during the render passes. */ - protected ModelBase renderPassModel; - -- public RendererLivingEntity(ModelBase var1, float var2) { -- this.mainModel = var1; -- this.shadowSize = var2; -- } -- -- public void setRenderPassModel(ModelBase var1) { -- this.renderPassModel = var1; -- } -- -- private float interpolateRotation(float var1, float var2, float var3) { -+ public RendererLivingEntity(ModelBase par1ModelBase, float par2) { -+ this.mainModel = par1ModelBase; -+ this.shadowSize = par2; -+ } -+ -+ /** -+ * Sets the model to be used in the current render pass (the first render pass is done after the primary model is -+ * rendered) Args: model -+ */ -+ public void setRenderPassModel(ModelBase par1ModelBase) { -+ this.renderPassModel = par1ModelBase; -+ } -+ -+ /** -+ * Returns a rotation angle that is inbetween two other rotation angles. par1 and par2 are the angles between which to -+ * interpolate, par3 is probably a float between 0.0 and 1.0 that tells us where "between" the two angles we are. -+ * Example: par1 = 30, par2 = 50, par3 = 0.5, then return = 40 -+ */ -+ private float interpolateRotation(float par1, float par2, float par3) { - float var4; -- for(var4 = var2 - var1; var4 < -180.0F; var4 += 360.0F) { -+ -+ for (var4 = par2 - par1; var4 < -180.0F; var4 += 360.0F) { -+ ; - } - -- while(var4 >= 180.0F) { -+ while (var4 >= 180.0F) { - var4 -= 360.0F; - } - -- return var1 + var3 * var4; -+ return par1 + par3 * var4; - } - -- public void doRenderLiving(EntityLivingBase var1, double var2, double var4, double var6, float var8, float var9) { -+ public void doRenderLiving(EntityLivingBase par1EntityLivingBase, double par2, double par4, double par6, float par8, float par9) { - GL11.glPushMatrix(); - GL11.glDisable(GL11.GL_CULL_FACE); -- this.mainModel.onGround = this.renderSwingProgress(var1, var9); -- if(this.renderPassModel != null) { -+ this.mainModel.onGround = this.renderSwingProgress(par1EntityLivingBase, par9); -+ -+ if (this.renderPassModel != null) { - this.renderPassModel.onGround = this.mainModel.onGround; - } - -- this.mainModel.isRiding = var1.isRiding(); -- if(this.renderPassModel != null) { -+ this.mainModel.isRiding = par1EntityLivingBase.isRiding(); -+ -+ if (this.renderPassModel != null) { - this.renderPassModel.isRiding = this.mainModel.isRiding; - } - -- this.mainModel.isChild = var1.isChild(); -- if(this.renderPassModel != null) { -+ this.mainModel.isChild = par1EntityLivingBase.isChild(); -+ -+ if (this.renderPassModel != null) { - this.renderPassModel.isChild = this.mainModel.isChild; - } - - try { -- float var10 = this.interpolateRotation(var1.prevRenderYawOffset, var1.renderYawOffset, var9); -- float var11 = this.interpolateRotation(var1.prevRotationYawHead, var1.rotationYawHead, var9); -+ float var10 = this.interpolateRotation(par1EntityLivingBase.prevRenderYawOffset, par1EntityLivingBase.renderYawOffset, par9); -+ float var11 = this.interpolateRotation(par1EntityLivingBase.prevRotationYawHead, par1EntityLivingBase.rotationYawHead, par9); - float var13; -- if(var1.isRiding() && var1.ridingEntity instanceof EntityLivingBase) { -- EntityLivingBase var12 = (EntityLivingBase)var1.ridingEntity; -- var10 = this.interpolateRotation(var12.prevRenderYawOffset, var12.renderYawOffset, var9); -+ -+ if (par1EntityLivingBase.isRiding() && par1EntityLivingBase.ridingEntity instanceof EntityLivingBase) { -+ EntityLivingBase var12 = (EntityLivingBase)par1EntityLivingBase.ridingEntity; -+ var10 = this.interpolateRotation(var12.prevRenderYawOffset, var12.renderYawOffset, par9); - var13 = MathHelper.wrapAngleTo180_float(var11 - var10); -- if(var13 < -85.0F) { -+ -+ if (var13 < -85.0F) { - var13 = -85.0F; - } - -- if(var13 >= 85.0F) { -+ if (var13 >= 85.0F) { - var13 = 85.0F; - } - - var10 = var11 - var13; -- if(var13 * var13 > 2500.0F) { -+ -+ if (var13 * var13 > 2500.0F) { - var10 += var13 * 0.2F; - } - } - -- float var26 = var1.prevRotationPitch + (var1.rotationPitch - var1.prevRotationPitch) * var9; -- this.renderLivingAt(var1, var2, var4, var6); -- var13 = this.handleRotationFloat(var1, var9); -- this.rotateCorpse(var1, var13, var10, var9); -- float var14 = 1.0F / 16.0F; -+ float var26 = par1EntityLivingBase.prevRotationPitch + (par1EntityLivingBase.rotationPitch - par1EntityLivingBase.prevRotationPitch) * par9; -+ this.renderLivingAt(par1EntityLivingBase, par2, par4, par6); -+ var13 = this.handleRotationFloat(par1EntityLivingBase, par9); -+ this.rotateCorpse(par1EntityLivingBase, var13, var10, par9); -+ float var14 = 0.0625F; - GL11.glEnable(GL12.GL_RESCALE_NORMAL); - GL11.glScalef(-1.0F, -1.0F, 1.0F); -- this.preRenderCallback(var1, var9); -+ this.preRenderCallback(par1EntityLivingBase, par9); - GL11.glTranslatef(0.0F, -24.0F * var14 - 0.0078125F, 0.0F); -- float var15 = var1.prevLimbSwingAmount + (var1.limbSwingAmount - var1.prevLimbSwingAmount) * var9; -- float var16 = var1.limbSwing - var1.limbSwingAmount * (1.0F - var9); -- if(var1.isChild()) { -+ float var15 = par1EntityLivingBase.prevLimbSwingAmount + (par1EntityLivingBase.limbSwingAmount - par1EntityLivingBase.prevLimbSwingAmount) * par9; -+ float var16 = par1EntityLivingBase.limbSwing - par1EntityLivingBase.limbSwingAmount * (1.0F - par9); -+ -+ if (par1EntityLivingBase.isChild()) { - var16 *= 3.0F; - } - -- if(var15 > 1.0F) { -+ if (var15 > 1.0F) { - var15 = 1.0F; - } - - GL11.glEnable(GL11.GL_ALPHA_TEST); -- this.mainModel.setLivingAnimations(var1, var16, var15, var9); -- this.renderModel(var1, var16, var15, var13, var11 - var10, var26, var14); -- -- int var18; -+ this.mainModel.setLivingAnimations(par1EntityLivingBase, var16, var15, par9); -+ this.renderModel(par1EntityLivingBase, var16, var15, var13, var11 - var10, var26, var14); - float var19; -+ int var18; - float var20; - float var22; -- for(int var17 = 0; var17 < 4; ++var17) { -- var18 = this.shouldRenderPass(var1, var17, var9); -- if(var18 > 0) { -- this.renderPassModel.setLivingAnimations(var1, var16, var15, var9); -- this.renderPassModel.render(var1, var16, var15, var13, var11 - var10, var26, var14); -- if((var18 & 240) == 16) { -- this.func_82408_c(var1, var17, var9); -- this.renderPassModel.render(var1, var16, var15, var13, var11 - var10, var26, var14); -+ -+ for (int var17 = 0; var17 < 4; ++var17) { -+ var18 = this.shouldRenderPass(par1EntityLivingBase, var17, par9); -+ -+ if (var18 > 0) { -+ this.renderPassModel.setLivingAnimations(par1EntityLivingBase, var16, var15, par9); -+ this.renderPassModel.render(par1EntityLivingBase, var16, var15, var13, var11 - var10, var26, var14); -+ -+ if ((var18 & 240) == 16) { -+ this.func_82408_c(par1EntityLivingBase, var17, par9); -+ this.renderPassModel.render(par1EntityLivingBase, var16, var15, var13, var11 - var10, var26, var14); - } - -- if((var18 & 15) == 15) { -- var19 = (float)var1.ticksExisted + var9; -+ if ((var18 & 15) == 15) { -+ var19 = (float)par1EntityLivingBase.ticksExisted + par9; - this.bindTexture(RES_ITEM_GLINT); - GL11.glEnable(GL11.GL_BLEND); - var20 = 0.5F; -@@ -116,7 +147,7 @@ - GL11.glDepthFunc(GL11.GL_EQUAL); - GL11.glDepthMask(false); - -- for(int var21 = 0; var21 < 2; ++var21) { -+ for (int var21 = 0; var21 < 2; ++var21) { - GL11.glDisable(GL11.GL_LIGHTING); - var22 = 0.76F; - GL11.glColor4f(0.5F * var22, 0.25F * var22, 0.8F * var22, 1.0F); -@@ -124,12 +155,12 @@ - GL11.glMatrixMode(GL11.GL_TEXTURE); - GL11.glLoadIdentity(); - float var23 = var19 * (0.001F + (float)var21 * 0.003F) * 20.0F; -- float var24 = 1.0F / 3.0F; -+ float var24 = 0.33333334F; - GL11.glScalef(var24, var24, var24); - GL11.glRotatef(30.0F - (float)var21 * 60.0F, 0.0F, 0.0F, 1.0F); - GL11.glTranslatef(0.0F, var23, 0.0F); - GL11.glMatrixMode(GL11.GL_MODELVIEW); -- this.renderPassModel.render(var1, var16, var15, var13, var11 - var10, var26, var14); -+ this.renderPassModel.render(par1EntityLivingBase, var16, var15, var13, var11 - var10, var26, var14); - } - - GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); -@@ -148,42 +179,44 @@ - } - - GL11.glDepthMask(true); -- this.renderEquippedItems(var1, var9); -- float var27 = var1.getBrightness(var9); -- var18 = this.getColorMultiplier(var1, var27, var9); -+ this.renderEquippedItems(par1EntityLivingBase, par9); -+ float var27 = par1EntityLivingBase.getBrightness(par9); -+ var18 = this.getColorMultiplier(par1EntityLivingBase, var27, par9); - OpenGlHelper.setActiveTexture(OpenGlHelper.lightmapTexUnit); - GL11.glDisable(GL11.GL_TEXTURE_2D); - OpenGlHelper.setActiveTexture(OpenGlHelper.defaultTexUnit); -- if((var18 >> 24 & 255) > 0 || var1.hurtTime > 0 || var1.deathTime > 0) { -+ -+ if ((var18 >> 24 & 255) > 0 || par1EntityLivingBase.hurtTime > 0 || par1EntityLivingBase.deathTime > 0) { - GL11.glDisable(GL11.GL_TEXTURE_2D); - GL11.glDisable(GL11.GL_ALPHA_TEST); - GL11.glEnable(GL11.GL_BLEND); - GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); - GL11.glDepthFunc(GL11.GL_EQUAL); -- if(var1.hurtTime > 0 || var1.deathTime > 0) { -+ -+ if (par1EntityLivingBase.hurtTime > 0 || par1EntityLivingBase.deathTime > 0) { - GL11.glColor4f(var27, 0.0F, 0.0F, 0.4F); -- this.mainModel.render(var1, var16, var15, var13, var11 - var10, var26, var14); -+ this.mainModel.render(par1EntityLivingBase, var16, var15, var13, var11 - var10, var26, var14); - -- for(int var28 = 0; var28 < 4; ++var28) { -- if(this.inheritRenderPass(var1, var28, var9) >= 0) { -+ for (int var28 = 0; var28 < 4; ++var28) { -+ if (this.inheritRenderPass(par1EntityLivingBase, var28, par9) >= 0) { - GL11.glColor4f(var27, 0.0F, 0.0F, 0.4F); -- this.renderPassModel.render(var1, var16, var15, var13, var11 - var10, var26, var14); -+ this.renderPassModel.render(par1EntityLivingBase, var16, var15, var13, var11 - var10, var26, var14); - } - } - } - -- if((var18 >> 24 & 255) > 0) { -+ if ((var18 >> 24 & 255) > 0) { - var19 = (float)(var18 >> 16 & 255) / 255.0F; - var20 = (float)(var18 >> 8 & 255) / 255.0F; -- float var29 = (float)(var18 & 255) / 255.0F; -+ float var30 = (float)(var18 & 255) / 255.0F; - var22 = (float)(var18 >> 24 & 255) / 255.0F; -- GL11.glColor4f(var19, var20, var29, var22); -- this.mainModel.render(var1, var16, var15, var13, var11 - var10, var26, var14); -+ GL11.glColor4f(var19, var20, var30, var22); -+ this.mainModel.render(par1EntityLivingBase, var16, var15, var13, var11 - var10, var26, var14); - -- for(int var30 = 0; var30 < 4; ++var30) { -- if(this.inheritRenderPass(var1, var30, var9) >= 0) { -- GL11.glColor4f(var19, var20, var29, var22); -- this.renderPassModel.render(var1, var16, var15, var13, var11 - var10, var26, var14); -+ for (int var29 = 0; var29 < 4; ++var29) { -+ if (this.inheritRenderPass(par1EntityLivingBase, var29, par9) >= 0) { -+ GL11.glColor4f(var19, var20, var30, var22); -+ this.renderPassModel.render(par1EntityLivingBase, var16, var15, var13, var11 - var10, var26, var14); - } - } - } -@@ -204,78 +237,92 @@ - OpenGlHelper.setActiveTexture(OpenGlHelper.defaultTexUnit); - GL11.glEnable(GL11.GL_CULL_FACE); - GL11.glPopMatrix(); -- this.passSpecialRender(var1, var2, var4, var6); -+ this.passSpecialRender(par1EntityLivingBase, par2, par4, par6); - } - -- protected void renderModel(EntityLivingBase var1, float var2, float var3, float var4, float var5, float var6, float var7) { -- this.bindEntityTexture(var1); -- if(!var1.isInvisible()) { -- this.mainModel.render(var1, var2, var3, var4, var5, var6, var7); -- } else if(!var1.isInvisibleToPlayer(Minecraft.getMinecraft().thePlayer)) { -+ /** -+ * Renders the model in RenderLiving -+ */ -+ protected void renderModel(EntityLivingBase par1EntityLivingBase, float par2, float par3, float par4, float par5, float par6, float par7) { -+ this.bindEntityTexture(par1EntityLivingBase); -+ -+ if (!par1EntityLivingBase.isInvisible()) { -+ this.mainModel.render(par1EntityLivingBase, par2, par3, par4, par5, par6, par7); -+ } else if (!par1EntityLivingBase.isInvisibleToPlayer(Minecraft.getMinecraft().thePlayer)) { - GL11.glPushMatrix(); - GL11.glColor4f(1.0F, 1.0F, 1.0F, 0.15F); - GL11.glDepthMask(false); - GL11.glEnable(GL11.GL_BLEND); - GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); - GL11.glAlphaFunc(GL11.GL_GREATER, 0.003921569F); -- this.mainModel.render(var1, var2, var3, var4, var5, var6, var7); -+ this.mainModel.render(par1EntityLivingBase, par2, par3, par4, par5, par6, par7); - GL11.glDisable(GL11.GL_BLEND); - GL11.glAlphaFunc(GL11.GL_GREATER, 0.1F); - GL11.glPopMatrix(); - GL11.glDepthMask(true); - } else { -- this.mainModel.setRotationAngles(var2, var3, var4, var5, var6, var7, var1); -+ this.mainModel.setRotationAngles(par2, par3, par4, par5, par6, par7, par1EntityLivingBase); - } -- -- } -- -- protected void renderLivingAt(EntityLivingBase var1, double var2, double var4, double var6) { -- GL11.glTranslatef((float)var2, (float)var4, (float)var6); -- } -- -- protected void rotateCorpse(EntityLivingBase var1, float var2, float var3, float var4) { -- GL11.glRotatef(180.0F - var3, 0.0F, 1.0F, 0.0F); -- if(var1.deathTime > 0) { -- float var5 = ((float)var1.deathTime + var4 - 1.0F) / 20.0F * 1.6F; -+ } -+ -+ /** -+ * Sets a simple glTranslate on a LivingEntity. -+ */ -+ protected void renderLivingAt(EntityLivingBase par1EntityLivingBase, double par2, double par4, double par6) { -+ GL11.glTranslatef((float)par2, (float)par4, (float)par6); -+ } -+ -+ protected void rotateCorpse(EntityLivingBase par1EntityLivingBase, float par2, float par3, float par4) { -+ GL11.glRotatef(180.0F - par3, 0.0F, 1.0F, 0.0F); -+ -+ if (par1EntityLivingBase.deathTime > 0) { -+ float var5 = ((float)par1EntityLivingBase.deathTime + par4 - 1.0F) / 20.0F * 1.6F; - var5 = MathHelper.sqrt_float(var5); -- if(var5 > 1.0F) { -+ -+ if (var5 > 1.0F) { - var5 = 1.0F; - } - -- GL11.glRotatef(var5 * this.getDeathMaxRotation(var1), 0.0F, 0.0F, 1.0F); -+ GL11.glRotatef(var5 * this.getDeathMaxRotation(par1EntityLivingBase), 0.0F, 0.0F, 1.0F); - } else { -- String var6 = EnumChatFormatting.func_110646_a(var1.getEntityName()); -- if((var6.equals("Dinnerbone") || var6.equals("Grumm")) && (!(var1 instanceof EntityPlayer) || !((EntityPlayer)var1).getHideCape())) { -- GL11.glTranslatef(0.0F, var1.height + 0.1F, 0.0F); -+ String var6 = EnumChatFormatting.func_110646_a(par1EntityLivingBase.getEntityName()); -+ -+ if ((var6.equals("Dinnerbone") || var6.equals("Grumm")) && (!(par1EntityLivingBase instanceof EntityPlayer) || !((EntityPlayer)par1EntityLivingBase).getHideCape())) { -+ GL11.glTranslatef(0.0F, par1EntityLivingBase.height + 0.1F, 0.0F); - GL11.glRotatef(180.0F, 0.0F, 0.0F, 1.0F); - } - } -- -- } -- -- protected float renderSwingProgress(EntityLivingBase var1, float var2) { -- return var1.getSwingProgress(var2); -- } -- -- protected float handleRotationFloat(EntityLivingBase var1, float var2) { -- return (float)var1.ticksExisted + var2; -- } -- -- protected void renderEquippedItems(EntityLivingBase var1, float var2) { -- } -- -- protected void renderArrowsStuckInEntity(EntityLivingBase var1, float var2) { -- int var3 = var1.getArrowCountInEntity(); -- if(var3 > 0) { -- EntityArrow var4 = new EntityArrow(var1.worldObj, var1.posX, var1.posY, var1.posZ); -- Random var5 = new Random((long)var1.entityId); -+ } -+ -+ protected float renderSwingProgress(EntityLivingBase par1EntityLivingBase, float par2) { -+ return par1EntityLivingBase.getSwingProgress(par2); -+ } -+ -+ /** -+ * Defines what float the third param in setRotationAngles of ModelBase is -+ */ -+ protected float handleRotationFloat(EntityLivingBase par1EntityLivingBase, float par2) { -+ return (float)par1EntityLivingBase.ticksExisted + par2; -+ } -+ -+ protected void renderEquippedItems(EntityLivingBase par1EntityLivingBase, float par2) {} -+ -+ /** -+ * renders arrows the Entity has been attacked with, attached to it -+ */ -+ protected void renderArrowsStuckInEntity(EntityLivingBase par1EntityLivingBase, float par2) { -+ int var3 = par1EntityLivingBase.getArrowCountInEntity(); -+ -+ if (var3 > 0) { -+ EntityArrow var4 = new EntityArrow(par1EntityLivingBase.worldObj, par1EntityLivingBase.posX, par1EntityLivingBase.posY, par1EntityLivingBase.posZ); -+ Random var5 = new Random((long)par1EntityLivingBase.entityId); - RenderHelper.disableStandardItemLighting(); - -- for(int var6 = 0; var6 < var3; ++var6) { -+ for (int var6 = 0; var6 < var3; ++var6) { - GL11.glPushMatrix(); - ModelRenderer var7 = this.mainModel.getRandomModelBox(var5); -- ModelBox var8 = (ModelBox)var7.l.get(var5.nextInt(var7.l.size())); -- var7.postRender(1.0F / 16.0F); -+ ModelBox var8 = (ModelBox)var7.cubeList.get(var5.nextInt(var7.cubeList.size())); -+ var7.postRender(0.0625F); - float var9 = var5.nextFloat(); - float var10 = var5.nextFloat(); - float var11 = var5.nextFloat(); -@@ -290,110 +337,194 @@ - var10 *= -1.0F; - var11 *= -1.0F; - float var15 = MathHelper.sqrt_float(var9 * var9 + var11 * var11); -- var4.prevRotationYaw = var4.rotationYaw = (float)(Math.atan2((double)var9, (double)var11) * 180.0D / (double)((float)Math.PI)); -- var4.prevRotationPitch = var4.rotationPitch = (float)(Math.atan2((double)var10, (double)var15) * 180.0D / (double)((float)Math.PI)); -+ var4.prevRotationYaw = var4.rotationYaw = (float)(Math.atan2((double)var9, (double)var11) * 180.0D / Math.PI); -+ var4.prevRotationPitch = var4.rotationPitch = (float)(Math.atan2((double)var10, (double)var15) * 180.0D / Math.PI); - double var16 = 0.0D; - double var18 = 0.0D; - double var20 = 0.0D; - float var22 = 0.0F; -- this.renderManager.renderEntityWithPosYaw(var4, var16, var18, var20, var22, var2); -+ this.renderManager.renderEntityWithPosYaw(var4, var16, var18, var20, var22, par2); - GL11.glPopMatrix(); - } - - RenderHelper.enableStandardItemLighting(); - } -- -- } -- -- protected int inheritRenderPass(EntityLivingBase var1, int var2, float var3) { -- return this.shouldRenderPass(var1, var2, var3); -- } -- -- protected int shouldRenderPass(EntityLivingBase var1, int var2, float var3) { -+ } -+ -+ protected int inheritRenderPass(EntityLivingBase par1EntityLivingBase, int par2, float par3) { -+ return this.shouldRenderPass(par1EntityLivingBase, par2, par3); -+ } -+ -+ /** -+ * Queries whether should render the specified pass or not. -+ */ -+ protected int shouldRenderPass(EntityLivingBase par1EntityLivingBase, int par2, float par3) { - return -1; - } - -- protected void func_82408_c(EntityLivingBase var1, int var2, float var3) { -- } -+ protected void func_82408_c(EntityLivingBase par1EntityLivingBase, int par2, float par3) {} - -- protected float getDeathMaxRotation(EntityLivingBase var1) { -+ protected float getDeathMaxRotation(EntityLivingBase par1EntityLivingBase) { - return 90.0F; - } - -- protected int getColorMultiplier(EntityLivingBase var1, float var2, float var3) { -+ /** -+ * Returns an ARGB int color back. Args: entityLiving, lightBrightness, partialTickTime -+ */ -+ protected int getColorMultiplier(EntityLivingBase par1EntityLivingBase, float par2, float par3) { - return 0; - } - -- protected void preRenderCallback(EntityLivingBase var1, float var2) { -- } -- -- protected void passSpecialRender(EntityLivingBase var1, double var2, double var4, double var6) { -- if(this.func_110813_b(var1)) { -- float var8 = 1.6F; -- float var9 = (float)(1.0D / 60.0D) * var8; -- double var10 = var1.getDistanceSqToEntity(this.renderManager.livingPlayer); -- float var12 = var1.isSneaking() ? 32.0F : 64.0F; -- if(var10 < (double)(var12 * var12)) { -- String var13 = var1.getTranslatedEntityName(); -- if(var1.isSneaking()) { -- FontRenderer var14 = this.getFontRendererFromRenderManager(); -- GL11.glPushMatrix(); -- GL11.glTranslatef((float)var2 + 0.0F, (float)var4 + var1.height + 0.5F, (float)var6); -- GL11.glNormal3f(0.0F, 1.0F, 0.0F); -- GL11.glRotatef(-this.renderManager.playerViewY, 0.0F, 1.0F, 0.0F); -- GL11.glRotatef(this.renderManager.playerViewX, 1.0F, 0.0F, 0.0F); -- GL11.glScalef(-var9, -var9, var9); -- GL11.glDisable(GL11.GL_LIGHTING); -- GL11.glTranslatef(0.0F, 0.25F / var9, 0.0F); -- GL11.glDepthMask(false); -- GL11.glEnable(GL11.GL_BLEND); -- GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); -- Tessellator var15 = Tessellator.instance; -- GL11.glDisable(GL11.GL_TEXTURE_2D); -- var15.startDrawingQuads(); -- int var16 = var14.getStringWidth(var13) / 2; -- var15.setColorRGBA_F(0.0F, 0.0F, 0.0F, 0.25F); -- var15.addVertex((double)(-var16 - 1), -1.0D, 0.0D); -- var15.addVertex((double)(-var16 - 1), 8.0D, 0.0D); -- var15.addVertex((double)(var16 + 1), 8.0D, 0.0D); -- var15.addVertex((double)(var16 + 1), -1.0D, 0.0D); -- var15.draw(); -- GL11.glEnable(GL11.GL_TEXTURE_2D); -- GL11.glDepthMask(true); -- var14.drawString(var13, -var14.getStringWidth(var13) / 2, 0, 553648127); -- GL11.glEnable(GL11.GL_LIGHTING); -- GL11.glDisable(GL11.GL_BLEND); -- GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); -- GL11.glPopMatrix(); -- } else { -- this.func_96449_a(var1, var2, var4, var6, var13, var9, var10); -+ /** -+ * Allows the render to do any OpenGL state modifications necessary before the model is rendered. Args: entityLiving, -+ * partialTickTime -+ */ -+ protected void preRenderCallback(EntityLivingBase par1EntityLivingBase, float par2) {} -+ -+ /** -+ * Passes the specialRender and renders it -+ */ -+ -+ protected boolean specialRender(EntityLivingBase par1EntityLivingBase) { -+ return Minecraft.isGuiEnabled() && par1EntityLivingBase != this.renderManager.livingPlayer && !par1EntityLivingBase.isInvisibleToPlayer(Minecraft.getMinecraft().thePlayer) && par1EntityLivingBase.riddenByEntity == null; -+ } -+ -+ protected void passSpecialRender(EntityLivingBase par1EntityLiving, double par2, double par4, double par6) { -+ // Spout Start -+ if (!(par1EntityLiving instanceof EntityPlayer)) { -+ if (Minecraft.isDebugInfoEnabled() && SpoutClient.getInstance().isEntityLabelCheat()) { -+ this.renderLivingLabel(par1EntityLiving, Integer.toString(par1EntityLiving.entityId), par2, par4, par6, 64); // Debug Entity ID -+ } else if (Configuration.displayEntityNamesinRange) { -+ String title = par1EntityLiving.getTranslatedEntityName(); -+ if (Configuration.displayAnimalHeatinColor && par1EntityLiving instanceof EntityAnimal) { -+ EntityAnimal animal = (EntityAnimal) par1EntityLiving; -+ if (animal.getGrowingAge() == 0 && !animal.isInLove()) { // Animal is in heat. -+ title = ChatColor.DARK_AQUA + title; -+ } -+ } -+ if (title != null && !title.equals("[hide]")) { -+ String lines[] = title.split("\\n"); -+ for (int i = 0; i < lines.length; i++){ -+ renderLivingLabel(par1EntityLiving, lines[i], par2, par4 + (0.275D * (lines.length - i - 1)), par6, 8); // Render Entity Name @ 64 sqft distance and below. -+ } -+ } -+ } -+ } else if (par1EntityLiving instanceof EntityPlayer) { -+ EntityPlayer par1EntityPlayer = (EntityPlayer) par1EntityLiving; -+ -+ if (!par1EntityPlayer.isInvisible()) { -+ if(Minecraft.isGuiEnabled() && (par1EntityPlayer != this.renderManager.livingPlayer || (Minecraft.theMinecraft.gameSettings.thirdPersonView != 0 && Minecraft.theMinecraft.currentScreen == null))) { -+ float var8 = 1.6F; -+ float var9 = 0.016666668F * var8; -+ double var10 = par1EntityPlayer.getDistanceSqToEntity(this.renderManager.livingPlayer); -+ float var12 = par1EntityPlayer.isSneaking() ? 32.0F : 64.0F; -+ String title = par1EntityPlayer.getDisplayName(); -+ if (var10 < (double)(var12 * var12)) { -+ String cleanUserName = ChatColor.stripColor(par1EntityPlayer.username); -+ VIP vip = Resources.getVIP(cleanUserName); -+ float var92 = 0.0F; -+ if (vip != null) { -+ title = vip.getTitle(); -+ var92 = vip.getScale(); -+ } else { -+ if (par1EntityPlayer.displayName != null) { -+ title = par1EntityPlayer.displayName; -+ } else { -+ title = par1EntityPlayer.getEntityName(); -+ } -+ } -+ float alpha = 0.25F; -+ -+ if (!Configuration.displayPlayerNames3rdPerson && par1EntityPlayer == this.renderManager.livingPlayer) { -+ return; -+ } -+ -+ if (!title.equals("[hide]")) { -+ String lines[] = title.split("\\n"); -+ double y = par4; -+ for (int line = 0; line < lines.length; line++) { -+ title = lines[line]; -+ par4 = y + (0.275D * (lines.length - line - 1)); -+ -+ if (AccessoryHandler.hasAccessory(par1EntityPlayer.username, AccessoryType.NOTCHHAT)) { -+ par4 = par4 + 0.275d; -+ } else if (AccessoryHandler.hasAccessory(par1EntityPlayer.username, AccessoryType.TOPHAT)) { -+ par4 = par4 + 0.5d; -+ } -+ -+ if (var92 > 0.9375F) { -+ par4 = par4 + 0.5D; -+ } else if (var92 < 0.86F && var92 != 0.0F) { -+ par4 = par4 - 0.25D; -+ } -+ -+ if (!par1EntityPlayer.isSneaking()) { -+ if (par1EntityPlayer.isPlayerSleeping()) { -+ this.renderLivingLabel(par1EntityPlayer, title, par2, par4 - 1.5D, par6, 64); -+ } else { -+ this.renderLivingLabel(par1EntityPlayer, title, par2, par4, par6, 64); -+ } -+ } else { -+ title = org.bukkit.ChatColor.stripColor(title); //strip colors when sneaking -+ FontRenderer var14 = this.getFontRendererFromRenderManager(); -+ GL11.glPushMatrix(); -+ GL11.glTranslatef((float)par2 + 0.0F, (float)par4 + 2.3F, (float)par6); -+ GL11.glNormal3f(0.0F, 1.0F, 0.0F); -+ GL11.glRotatef(-this.renderManager.playerViewY, 0.0F, 1.0F, 0.0F); -+ GL11.glRotatef(this.renderManager.playerViewX, 1.0F, 0.0F, 0.0F); -+ GL11.glScalef(-var9, -var9, var9); -+ GL11.glDisable(GL11.GL_LIGHTING); -+ GL11.glTranslatef(0.0F, 0.25F / var9, 0.0F); -+ GL11.glDepthMask(false); -+ -+ GL11.glEnable(GL11.GL_BLEND); -+ GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); -+ Tessellator var15 = Tessellator.instance; -+ GL11.glDisable(GL11.GL_TEXTURE_2D); -+ var15.startDrawingQuads(); -+ int var16 = var14.getStringWidth(title) / 2; -+ var15.setColorRGBA_F(0.0F, 0.0F, 0.0F, 0.25F); -+ var15.addVertex((double)(-var16 - 1), -1.0D, 0.0D); -+ var15.addVertex((double)(-var16 - 1), 8.0D, 0.0D); -+ var15.addVertex((double)(var16 + 1), 8.0D, 0.0D); -+ var15.addVertex((double)(var16 + 1), -1.0D, 0.0D); -+ var15.draw(); -+ GL11.glEnable(GL11.GL_TEXTURE_2D); -+ GL11.glDepthMask(true); -+ var14.drawString(title, -var14.getStringWidth(title) / 2, 0, 553648127); -+ GL11.glEnable(GL11.GL_LIGHTING); -+ GL11.glDisable(GL11.GL_BLEND); -+ GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); -+ GL11.glPopMatrix(); -+ } -+ } -+ } -+ } - } - } - } -- -- } -- -- protected boolean func_110813_b(EntityLivingBase var1) { -- return Minecraft.isGuiEnabled() && var1 != this.renderManager.livingPlayer && !var1.isInvisibleToPlayer(Minecraft.getMinecraft().thePlayer) && var1.riddenByEntity == null; -- } -- -- protected void func_96449_a(EntityLivingBase var1, double var2, double var4, double var6, String var8, float var9, double var10) { -- if(var1.isPlayerSleeping()) { -- this.renderLivingLabel(var1, var8, var2, var4 - 1.5D, var6, 64); -+ // Spout End -+ } -+ -+ protected void func_96449_a(EntityLivingBase par1EntityLivingBase, double par2, double par4, double par6, String par8Str, float par9, double par10) { -+ if (par1EntityLivingBase.isPlayerSleeping()) { -+ this.renderLivingLabel(par1EntityLivingBase, par8Str, par2, par4 - 1.5D, par6, 64); - } else { -- this.renderLivingLabel(var1, var8, var2, var4, var6, 64); -+ this.renderLivingLabel(par1EntityLivingBase, par8Str, par2, par4, par6, 64); - } -- - } - -- protected void renderLivingLabel(EntityLivingBase var1, String var2, double var3, double var5, double var7, int var9) { -- double var10 = var1.getDistanceSqToEntity(this.renderManager.livingPlayer); -- if(var10 <= (double)(var9 * var9)) { -+ /** -+ * Draws the debug or playername text above a living -+ */ -+ protected void renderLivingLabel(EntityLivingBase par1EntityLivingBase, String par2Str, double par3, double par5, double par7, int par9) { -+ double var10 = par1EntityLivingBase.getDistanceSqToEntity(this.renderManager.livingPlayer); -+ if (var10 <= (double)(par9 * par9)) { - FontRenderer var12 = this.getFontRendererFromRenderManager(); - float var13 = 1.6F; -- float var14 = (float)(1.0D / 60.0D) * var13; -+ float var14 = 0.016666668F * var13; - GL11.glPushMatrix(); -- GL11.glTranslatef((float)var3 + 0.0F, (float)var5 + var1.height + 0.5F, (float)var7); -+ GL11.glTranslatef((float)par3 + 0.0F, (float)par5 + par1EntityLivingBase.height + 0.5F, (float)par7); - GL11.glNormal3f(0.0F, 1.0F, 0.0F); - GL11.glRotatef(-this.renderManager.playerViewY, 0.0F, 1.0F, 0.0F); - GL11.glRotatef(this.renderManager.playerViewX, 1.0F, 0.0F, 0.0F); -@@ -405,13 +536,14 @@ - GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); - Tessellator var15 = Tessellator.instance; - byte var16 = 0; -- if(var2.equals("deadmau5")) { -+ -+ if (par2Str.equals("deadmau5")) { - var16 = -10; - } - - GL11.glDisable(GL11.GL_TEXTURE_2D); - var15.startDrawingQuads(); -- int var17 = var12.getStringWidth(var2) / 2; -+ int var17 = var12.getStringWidth(par2Str) / 2; - var15.setColorRGBA_F(0.0F, 0.0F, 0.0F, 0.25F); - var15.addVertex((double)(-var17 - 1), (double)(-1 + var16), 0.0D); - var15.addVertex((double)(-var17 - 1), (double)(8 + var16), 0.0D); -@@ -419,10 +551,10 @@ - var15.addVertex((double)(var17 + 1), (double)(-1 + var16), 0.0D); - var15.draw(); - GL11.glEnable(GL11.GL_TEXTURE_2D); -- var12.drawString(var2, -var12.getStringWidth(var2) / 2, var16, 553648127); -+ var12.drawString(par2Str, -var12.getStringWidth(par2Str) / 2, var16, 553648127); - GL11.glEnable(GL11.GL_DEPTH_TEST); - GL11.glDepthMask(true); -- var12.drawString(var2, -var12.getStringWidth(var2) / 2, var16, -1); -+ var12.drawString(par2Str, -var12.getStringWidth(par2Str) / 2, var16, -1); - GL11.glEnable(GL11.GL_LIGHTING); - GL11.glDisable(GL11.GL_BLEND); - GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); -@@ -430,7 +562,13 @@ - } - } - -- public void doRender(Entity var1, double var2, double var4, double var6, float var8, float var9) { -- this.doRenderLiving((EntityLivingBase)var1, var2, var4, var6, var8, var9); -+ /** -+ * Actually renders the given argument. This is a synthetic bridge method, always casting down its argument and then -+ * handing it off to a worker function which does the actual work. In all probabilty, the class Render is generic -+ * (Render 0) { -- MinecraftServer.getServer().getConfigurationManager().addOp(var2[0]); -- notifyAdmins(var1, "commands.op.success", new Object[]{var2[0]}); -+ public void processCommand(ICommandSender par1ICommandSender, String[] par2ArrayOfStr) { -+ if (par2ArrayOfStr.length == 1 && par2ArrayOfStr[0].length() > 0) { -+ MinecraftServer.getServer().getConfigurationManager().addOp(par2ArrayOfStr[0]); -+ notifyAdmins(par1ICommandSender, "commands.op.success", new Object[] {par2ArrayOfStr[0]}); - } else { - throw new WrongUsageException("commands.op.usage", new Object[0]); - } - } - -- public List addTabCompletionOptions(ICommandSender var1, String[] var2) { -- if(var2.length == 1) { -- String var3 = var2[var2.length - 1]; -+ /** -+ * Adds the strings available in this command to the given list of tab completion options. -+ */ -+ public List addTabCompletionOptions(ICommandSender par1ICommandSender, String[] par2ArrayOfStr) { -+ if (par2ArrayOfStr.length == 1) { -+ String var3 = par2ArrayOfStr[par2ArrayOfStr.length - 1]; - ArrayList var4 = new ArrayList(); - String[] var5 = MinecraftServer.getServer().getAllUsernames(); - int var6 = var5.length; - -- for(int var7 = 0; var7 < var6; ++var7) { -+ for (int var7 = 0; var7 < var6; ++var7) { - String var8 = var5[var7]; -- if(!MinecraftServer.getServer().getConfigurationManager().isPlayerOpped(var8) && doesStringStartWith(var3, var8)) { -+ -+ if (!MinecraftServer.getServer().getConfigurationManager().isPlayerOpped(var8) && doesStringStartWith(var3, var8)) { - var4.add(var8); - } - } ---- net/minecraft/src/CreativeTabMaterial.java -+++ net/minecraft/src/CreativeTabMaterial.java -@@ -1,10 +1,13 @@ - package net.minecraft.src; - - final class CreativeTabMaterial extends CreativeTabs { -- CreativeTabMaterial(int var1, String var2) { -- super(var1, var2); -+ CreativeTabMaterial(int par1, String par2Str) { -+ super(par1, par2Str); - } - -+ /** -+ * the itemID for the item to be displayed on the tab -+ */ - public int getTabIconItemIndex() { - return Item.stick.itemID; - } ---- net/minecraft/src/EntityPainting.java -+++ net/minecraft/src/EntityPainting.java -@@ -5,70 +5,79 @@ - public class EntityPainting extends EntityHanging { - public EnumArt art; - -- public EntityPainting(World var1) { -- super(var1); -+ public EntityPainting(World par1World) { -+ super(par1World); - } - -- public EntityPainting(World var1, int var2, int var3, int var4, int var5) { -- super(var1, var2, var3, var4, var5); -+ public EntityPainting(World par1World, int par2, int par3, int par4, int par5) { -+ super(par1World, par2, par3, par4, par5); - ArrayList var6 = new ArrayList(); - EnumArt[] var7 = EnumArt.values(); - int var8 = var7.length; - -- for(int var9 = 0; var9 < var8; ++var9) { -+ for (int var9 = 0; var9 < var8; ++var9) { - EnumArt var10 = var7[var9]; - this.art = var10; -- this.setDirection(var5); -- if(this.onValidSurface()) { -+ this.setDirection(par5); -+ -+ if (this.onValidSurface()) { - var6.add(var10); - } - } - -- if(!var6.isEmpty()) { -- this.art = (EnumArt)var6.get(this.ab.nextInt(var6.size())); -+ if (!var6.isEmpty()) { -+ this.art = (EnumArt)var6.get(this.rand.nextInt(var6.size())); - } - -- this.setDirection(var5); -+ this.setDirection(par5); - } - -- public EntityPainting(World var1, int var2, int var3, int var4, int var5, String var6) { -- this(var1, var2, var3, var4, var5); -+ public EntityPainting(World par1World, int par2, int par3, int par4, int par5, String par6Str) { -+ this(par1World, par2, par3, par4, par5); - EnumArt[] var7 = EnumArt.values(); - int var8 = var7.length; - -- for(int var9 = 0; var9 < var8; ++var9) { -+ for (int var9 = 0; var9 < var8; ++var9) { - EnumArt var10 = var7[var9]; -- if(var10.B.equals(var6)) { -+ -+ if (var10.title.equals(par6Str)) { - this.art = var10; - break; - } - } - -- this.setDirection(var5); -- } -- -- public void writeEntityToNBT(NBTTagCompound var1) { -- var1.setString("Motive", this.art.B); -- super.writeEntityToNBT(var1); -- } -- -- public void readEntityFromNBT(NBTTagCompound var1) { -- String var2 = var1.getString("Motive"); -+ this.setDirection(par5); -+ } -+ -+ /** -+ * (abstract) Protected helper method to write subclass entity data to NBT. -+ */ -+ public void writeEntityToNBT(NBTTagCompound par1NBTTagCompound) { -+ par1NBTTagCompound.setString("Motive", this.art.title); -+ super.writeEntityToNBT(par1NBTTagCompound); -+ } -+ -+ /** -+ * (abstract) Protected helper method to read subclass entity data from NBT. -+ */ -+ public void readEntityFromNBT(NBTTagCompound par1NBTTagCompound) { -+ String var2 = par1NBTTagCompound.getString("Motive"); - EnumArt[] var3 = EnumArt.values(); - int var4 = var3.length; - -- for(int var5 = 0; var5 < var4; ++var5) { -+ for (int var5 = 0; var5 < var4; ++var5) { - EnumArt var6 = var3[var5]; -- if(var6.B.equals(var2)) { -+ -+ if (var6.title.equals(var2)) { - this.art = var6; - } - } - -- if(this.art == null) { -+ if (this.art == null) { - this.art = EnumArt.Kebab; - } - -- super.readEntityFromNBT(var1); -+ super.readEntityFromNBT(par1NBTTagCompound); - } - - public int getWidthPixels() { -@@ -79,10 +88,14 @@ - return this.art.sizeY; - } - -- public void onBroken(Entity var1) { -- if(var1 instanceof EntityPlayer) { -- EntityPlayer var2 = (EntityPlayer)var1; -- if(var2.capabilities.isCreativeMode) { -+ /** -+ * Called when this entity is broken. Entity parameter may be null. -+ */ -+ public void onBroken(Entity par1Entity) { -+ if (par1Entity instanceof EntityPlayer) { -+ EntityPlayer var2 = (EntityPlayer)par1Entity; -+ -+ if (var2.capabilities.isCreativeMode) { - return; - } - } ---- net/minecraft/src/EntityTrackerEntry.java -+++ net/minecraft/src/EntityTrackerEntry.java -@@ -7,416 +7,454 @@ - import java.util.Set; - - public class EntityTrackerEntry { -- public Entity trackedEntity; -- public int trackingDistanceThreshold; -+ public Entity myEntity; -+ public int blocksDistanceThreshold; -+ -+ /** check for sync when ticks % updateFrequency==0 */ - public int updateFrequency; -- public int encodedPosX; -- public int encodedPosY; -- public int encodedPosZ; -- public int encodedRotationYaw; -- public int encodedRotationPitch; -+ public int lastScaledXPosition; -+ public int lastScaledYPosition; -+ public int lastScaledZPosition; -+ public int lastYaw; -+ public int lastPitch; - public int lastHeadMotion; -- public double lastTrackedEntityMotionX; -- public double lastTrackedEntityMotionY; -+ public double motionX; -+ public double motionY; - public double motionZ; -- public int updateCounter; -- private double lastTrackedEntityPosX; -- private double lastTrackedEntityPosY; -- private double lastTrackedEntityPosZ; -- private boolean firstUpdateDone; -+ public int ticks; -+ private double posX; -+ private double posY; -+ private double posZ; -+ -+ /** set to true on first sendLocationToClients */ -+ private boolean isDataInitialized; - private boolean sendVelocityUpdates; -+ -+ /** -+ * every 400 ticks a full teleport packet is sent, rather than just a "move me +x" command, so that position remains -+ * fully synced. -+ */ - private int ticksSinceLastForcedTeleport; - private Entity field_85178_v; - private boolean ridingEntity; - public boolean playerEntitiesUpdated; -- public Set o = new HashSet(); -- -- public EntityTrackerEntry(Entity var1, int var2, int var3, boolean var4) { -- this.trackedEntity = var1; -- this.trackingDistanceThreshold = var2; -- this.updateFrequency = var3; -- this.sendVelocityUpdates = var4; -- this.encodedPosX = MathHelper.floor_double(var1.posX * 32.0D); -- this.encodedPosY = MathHelper.floor_double(var1.posY * 32.0D); -- this.encodedPosZ = MathHelper.floor_double(var1.posZ * 32.0D); -- this.encodedRotationYaw = MathHelper.floor_float(var1.rotationYaw * 256.0F / 360.0F); -- this.encodedRotationPitch = MathHelper.floor_float(var1.rotationPitch * 256.0F / 360.0F); -- this.lastHeadMotion = MathHelper.floor_float(var1.getRotationYawHead() * 256.0F / 360.0F); -+ -+ /** -+ * Holds references to all the players that are currently receiving position updates for this entity. -+ */ -+ public Set trackingPlayers = new HashSet(); -+ -+ public EntityTrackerEntry(Entity par1Entity, int par2, int par3, boolean par4) { -+ this.myEntity = par1Entity; -+ this.blocksDistanceThreshold = par2; -+ this.updateFrequency = par3; -+ this.sendVelocityUpdates = par4; -+ this.lastScaledXPosition = MathHelper.floor_double(par1Entity.posX * 32.0D); -+ this.lastScaledYPosition = MathHelper.floor_double(par1Entity.posY * 32.0D); -+ this.lastScaledZPosition = MathHelper.floor_double(par1Entity.posZ * 32.0D); -+ this.lastYaw = MathHelper.floor_float(par1Entity.rotationYaw * 256.0F / 360.0F); -+ this.lastPitch = MathHelper.floor_float(par1Entity.rotationPitch * 256.0F / 360.0F); -+ this.lastHeadMotion = MathHelper.floor_float(par1Entity.getRotationYawHead() * 256.0F / 360.0F); - } - -- public boolean equals(Object var1) { -- return var1 instanceof EntityTrackerEntry ? ((EntityTrackerEntry)var1).trackedEntity.entityId == this.trackedEntity.entityId : false; -+ public boolean equals(Object par1Obj) { -+ return par1Obj instanceof EntityTrackerEntry ? ((EntityTrackerEntry)par1Obj).myEntity.entityId == this.myEntity.entityId : false; - } - - public int hashCode() { -- return this.trackedEntity.entityId; -+ return this.myEntity.entityId; - } - -- public void updatePlayerList(List var1) { -+ /** -+ * also sends velocity, rotation, and riding info. -+ */ -+ public void sendLocationToAllClients(List par1List) { - this.playerEntitiesUpdated = false; -- if(!this.firstUpdateDone || this.trackedEntity.getDistanceSq(this.lastTrackedEntityPosX, this.lastTrackedEntityPosY, this.lastTrackedEntityPosZ) > 16.0D) { -- this.lastTrackedEntityPosX = this.trackedEntity.posX; -- this.lastTrackedEntityPosY = this.trackedEntity.posY; -- this.lastTrackedEntityPosZ = this.trackedEntity.posZ; -- this.firstUpdateDone = true; -+ -+ if (!this.isDataInitialized || this.myEntity.getDistanceSq(this.posX, this.posY, this.posZ) > 16.0D) { -+ this.posX = this.myEntity.posX; -+ this.posY = this.myEntity.posY; -+ this.posZ = this.myEntity.posZ; -+ this.isDataInitialized = true; - this.playerEntitiesUpdated = true; -- this.updatePlayerEntities(var1); -- } -- -- if(this.field_85178_v != this.trackedEntity.ridingEntity || this.trackedEntity.ridingEntity != null && this.updateCounter % 60 == 0) { -- this.field_85178_v = this.trackedEntity.ridingEntity; -- this.sendPacketToTrackedPlayers(new Packet39AttachEntity(0, this.trackedEntity, this.trackedEntity.ridingEntity)); -- } -- -- if(this.trackedEntity instanceof EntityItemFrame && this.updateCounter % 10 == 0) { -- EntityItemFrame var23 = (EntityItemFrame)this.trackedEntity; -+ this.sendEventsToPlayers(par1List); -+ } -+ -+ if (this.field_85178_v != this.myEntity.ridingEntity || this.myEntity.ridingEntity != null && this.ticks % 60 == 0) { -+ this.field_85178_v = this.myEntity.ridingEntity; -+ this.sendPacketToAllTrackingPlayers(new Packet39AttachEntity(0, this.myEntity, this.myEntity.ridingEntity)); -+ } -+ -+ if (this.myEntity instanceof EntityItemFrame && this.ticks % 10 == 0) { -+ EntityItemFrame var23 = (EntityItemFrame)this.myEntity; - ItemStack var24 = var23.getDisplayedItem(); -- if(var24 != null && var24.getItem() instanceof ItemMap) { -- MapData var26 = Item.map.getMapData(var24, this.trackedEntity.worldObj); -- Iterator var27 = var1.iterator(); -- -- while(var27.hasNext()) { -+ -+ if (var24 != null && var24.getItem() instanceof ItemMap) { -+ MapData var26 = Item.map.getMapData(var24, this.myEntity.worldObj); -+ Iterator var27 = par1List.iterator(); -+ -+ while (var27.hasNext()) { - EntityPlayer var28 = (EntityPlayer)var27.next(); - EntityPlayerMP var29 = (EntityPlayerMP)var28; - var26.updateVisiblePlayers(var29, var24); -- if(var29.playerNetServerHandler.getNumChunkDataPackets() <= 5) { -- Packet var30 = Item.map.getUpdatePacket(var24, this.trackedEntity.worldObj, var29); -- if(var30 != null) { -- var29.playerNetServerHandler.sendPacket(var30); -+ -+ if (var29.playerNetServerHandler.packetSize() <= 5) { -+ Packet var30 = Item.map.createMapDataPacket(var24, this.myEntity.worldObj, var29); -+ -+ if (var30 != null) { -+ var29.playerNetServerHandler.sendPacketToPlayer(var30); - } - } - } - } - - this.func_111190_b(); -- } else if(this.updateCounter % this.updateFrequency == 0 || this.trackedEntity.isAirBorne || this.trackedEntity.getDataWatcher().hasObjectChanged()) { -+ } else if (this.ticks % this.updateFrequency == 0 || this.myEntity.isAirBorne || this.myEntity.getDataWatcher().hasChanges()) { - int var2; - int var3; -- if(this.trackedEntity.ridingEntity == null) { -+ -+ if (this.myEntity.ridingEntity == null) { - ++this.ticksSinceLastForcedTeleport; -- var2 = this.trackedEntity.myEntitySize.multiplyBy32AndRound(this.trackedEntity.posX); -- var3 = MathHelper.floor_double(this.trackedEntity.posY * 32.0D); -- int var25 = this.trackedEntity.myEntitySize.multiplyBy32AndRound(this.trackedEntity.posZ); -- int var5 = MathHelper.floor_float(this.trackedEntity.rotationYaw * 256.0F / 360.0F); -- int var6 = MathHelper.floor_float(this.trackedEntity.rotationPitch * 256.0F / 360.0F); -- int var7 = var2 - this.encodedPosX; -- int var8 = var3 - this.encodedPosY; -- int var9 = var25 - this.encodedPosZ; -+ var2 = this.myEntity.myEntitySize.multiplyBy32AndRound(this.myEntity.posX); -+ var3 = MathHelper.floor_double(this.myEntity.posY * 32.0D); -+ int var4 = this.myEntity.myEntitySize.multiplyBy32AndRound(this.myEntity.posZ); -+ int var5 = MathHelper.floor_float(this.myEntity.rotationYaw * 256.0F / 360.0F); -+ int var6 = MathHelper.floor_float(this.myEntity.rotationPitch * 256.0F / 360.0F); -+ int var7 = var2 - this.lastScaledXPosition; -+ int var8 = var3 - this.lastScaledYPosition; -+ int var9 = var4 - this.lastScaledZPosition; - Object var10 = null; -- boolean var11 = Math.abs(var7) >= 4 || Math.abs(var8) >= 4 || Math.abs(var9) >= 4 || this.updateCounter % 60 == 0; -- boolean var12 = Math.abs(var5 - this.encodedRotationYaw) >= 4 || Math.abs(var6 - this.encodedRotationPitch) >= 4; -- if(this.updateCounter > 0 || this.trackedEntity instanceof EntityArrow) { -- if(var7 >= -128 && var7 < 128 && var8 >= -128 && var8 < 128 && var9 >= -128 && var9 < 128 && this.ticksSinceLastForcedTeleport <= 400 && !this.ridingEntity) { -- if(var11 && var12) { -- var10 = new Packet33RelEntityMoveLook(this.trackedEntity.entityId, (byte)var7, (byte)var8, (byte)var9, (byte)var5, (byte)var6); -- } else if(var11) { -- var10 = new Packet31RelEntityMove(this.trackedEntity.entityId, (byte)var7, (byte)var8, (byte)var9); -- } else if(var12) { -- var10 = new Packet32EntityLook(this.trackedEntity.entityId, (byte)var5, (byte)var6); -+ boolean var11 = Math.abs(var7) >= 4 || Math.abs(var8) >= 4 || Math.abs(var9) >= 4 || this.ticks % 60 == 0; -+ boolean var12 = Math.abs(var5 - this.lastYaw) >= 4 || Math.abs(var6 - this.lastPitch) >= 4; -+ -+ if (this.ticks > 0 || this.myEntity instanceof EntityArrow) { -+ if (var7 >= -128 && var7 < 128 && var8 >= -128 && var8 < 128 && var9 >= -128 && var9 < 128 && this.ticksSinceLastForcedTeleport <= 400 && !this.ridingEntity) { -+ if (var11 && var12) { -+ var10 = new Packet33RelEntityMoveLook(this.myEntity.entityId, (byte)var7, (byte)var8, (byte)var9, (byte)var5, (byte)var6); -+ } else if (var11) { -+ var10 = new Packet31RelEntityMove(this.myEntity.entityId, (byte)var7, (byte)var8, (byte)var9); -+ } else if (var12) { -+ var10 = new Packet32EntityLook(this.myEntity.entityId, (byte)var5, (byte)var6); - } - } else { - this.ticksSinceLastForcedTeleport = 0; -- var10 = new Packet34EntityTeleport(this.trackedEntity.entityId, var2, var3, var25, (byte)var5, (byte)var6); -+ var10 = new Packet34EntityTeleport(this.myEntity.entityId, var2, var3, var4, (byte)var5, (byte)var6); - } - } - -- if(this.sendVelocityUpdates) { -- double var13 = this.trackedEntity.motionX - this.lastTrackedEntityMotionX; -- double var15 = this.trackedEntity.motionY - this.lastTrackedEntityMotionY; -- double var17 = this.trackedEntity.motionZ - this.motionZ; -+ if (this.sendVelocityUpdates) { -+ double var13 = this.myEntity.motionX - this.motionX; -+ double var15 = this.myEntity.motionY - this.motionY; -+ double var17 = this.myEntity.motionZ - this.motionZ; - double var19 = 0.02D; - double var21 = var13 * var13 + var15 * var15 + var17 * var17; -- if(var21 > var19 * var19 || var21 > 0.0D && this.trackedEntity.motionX == 0.0D && this.trackedEntity.motionY == 0.0D && this.trackedEntity.motionZ == 0.0D) { -- this.lastTrackedEntityMotionX = this.trackedEntity.motionX; -- this.lastTrackedEntityMotionY = this.trackedEntity.motionY; -- this.motionZ = this.trackedEntity.motionZ; -- this.sendPacketToTrackedPlayers(new Packet28EntityVelocity(this.trackedEntity.entityId, this.lastTrackedEntityMotionX, this.lastTrackedEntityMotionY, this.motionZ)); -+ -+ if (var21 > var19 * var19 || var21 > 0.0D && this.myEntity.motionX == 0.0D && this.myEntity.motionY == 0.0D && this.myEntity.motionZ == 0.0D) { -+ this.motionX = this.myEntity.motionX; -+ this.motionY = this.myEntity.motionY; -+ this.motionZ = this.myEntity.motionZ; -+ this.sendPacketToAllTrackingPlayers(new Packet28EntityVelocity(this.myEntity.entityId, this.motionX, this.motionY, this.motionZ)); - } - } - -- if(var10 != null) { -- this.sendPacketToTrackedPlayers((Packet)var10); -+ if (var10 != null) { -+ this.sendPacketToAllTrackingPlayers((Packet)var10); - } - - this.func_111190_b(); -- if(var11) { -- this.encodedPosX = var2; -- this.encodedPosY = var3; -- this.encodedPosZ = var25; -+ -+ if (var11) { -+ this.lastScaledXPosition = var2; -+ this.lastScaledYPosition = var3; -+ this.lastScaledZPosition = var4; - } - -- if(var12) { -- this.encodedRotationYaw = var5; -- this.encodedRotationPitch = var6; -+ if (var12) { -+ this.lastYaw = var5; -+ this.lastPitch = var6; - } - - this.ridingEntity = false; - } else { -- var2 = MathHelper.floor_float(this.trackedEntity.rotationYaw * 256.0F / 360.0F); -- var3 = MathHelper.floor_float(this.trackedEntity.rotationPitch * 256.0F / 360.0F); -- boolean var4 = Math.abs(var2 - this.encodedRotationYaw) >= 4 || Math.abs(var3 - this.encodedRotationPitch) >= 4; -- if(var4) { -- this.sendPacketToTrackedPlayers(new Packet32EntityLook(this.trackedEntity.entityId, (byte)var2, (byte)var3)); -- this.encodedRotationYaw = var2; -- this.encodedRotationPitch = var3; -+ var2 = MathHelper.floor_float(this.myEntity.rotationYaw * 256.0F / 360.0F); -+ var3 = MathHelper.floor_float(this.myEntity.rotationPitch * 256.0F / 360.0F); -+ boolean var25 = Math.abs(var2 - this.lastYaw) >= 4 || Math.abs(var3 - this.lastPitch) >= 4; -+ -+ if (var25) { -+ this.sendPacketToAllTrackingPlayers(new Packet32EntityLook(this.myEntity.entityId, (byte)var2, (byte)var3)); -+ this.lastYaw = var2; -+ this.lastPitch = var3; - } - -- this.encodedPosX = this.trackedEntity.myEntitySize.multiplyBy32AndRound(this.trackedEntity.posX); -- this.encodedPosY = MathHelper.floor_double(this.trackedEntity.posY * 32.0D); -- this.encodedPosZ = this.trackedEntity.myEntitySize.multiplyBy32AndRound(this.trackedEntity.posZ); -+ this.lastScaledXPosition = this.myEntity.myEntitySize.multiplyBy32AndRound(this.myEntity.posX); -+ this.lastScaledYPosition = MathHelper.floor_double(this.myEntity.posY * 32.0D); -+ this.lastScaledZPosition = this.myEntity.myEntitySize.multiplyBy32AndRound(this.myEntity.posZ); - this.func_111190_b(); - this.ridingEntity = true; - } - -- var2 = MathHelper.floor_float(this.trackedEntity.getRotationYawHead() * 256.0F / 360.0F); -- if(Math.abs(var2 - this.lastHeadMotion) >= 4) { -- this.sendPacketToTrackedPlayers(new Packet35EntityHeadRotation(this.trackedEntity.entityId, (byte)var2)); -+ var2 = MathHelper.floor_float(this.myEntity.getRotationYawHead() * 256.0F / 360.0F); -+ -+ if (Math.abs(var2 - this.lastHeadMotion) >= 4) { -+ this.sendPacketToAllTrackingPlayers(new Packet35EntityHeadRotation(this.myEntity.entityId, (byte)var2)); - this.lastHeadMotion = var2; - } - -- this.trackedEntity.isAirBorne = false; -- } -- -- ++this.updateCounter; -- if(this.trackedEntity.velocityChanged) { -- this.sendPacketToTrackedPlayersAndTrackedEntity(new Packet28EntityVelocity(this.trackedEntity)); -- this.trackedEntity.velocityChanged = false; -- } -- -+ this.myEntity.isAirBorne = false; -+ } -+ -+ ++this.ticks; -+ -+ if (this.myEntity.velocityChanged) { -+ this.sendPacketToAllAssociatedPlayers(new Packet28EntityVelocity(this.myEntity)); -+ this.myEntity.velocityChanged = false; -+ } - } - - private void func_111190_b() { -- DataWatcher var1 = this.trackedEntity.getDataWatcher(); -- if(var1.hasObjectChanged()) { -- this.sendPacketToTrackedPlayersAndTrackedEntity(new Packet40EntityMetadata(this.trackedEntity.entityId, var1, false)); -+ DataWatcher var1 = this.myEntity.getDataWatcher(); -+ -+ if (var1.hasChanges()) { -+ this.sendPacketToAllAssociatedPlayers(new Packet40EntityMetadata(this.myEntity.entityId, var1, false)); - } - -- if(this.trackedEntity instanceof EntityLivingBase) { -- ServersideAttributeMap var2 = (ServersideAttributeMap)((EntityLivingBase)this.trackedEntity).getAttributeMap(); -+ if (this.myEntity instanceof EntityLivingBase) { -+ ServersideAttributeMap var2 = (ServersideAttributeMap)((EntityLivingBase)this.myEntity).getAttributeMap(); - Set var3 = var2.func_111161_b(); -- if(!var3.isEmpty()) { -- this.sendPacketToTrackedPlayersAndTrackedEntity(new Packet44UpdateAttributes(this.trackedEntity.entityId, var3)); -+ -+ if (!var3.isEmpty()) { -+ this.sendPacketToAllAssociatedPlayers(new Packet44UpdateAttributes(this.myEntity.entityId, var3)); - } - - var3.clear(); - } -- - } - -- public void sendPacketToTrackedPlayers(Packet var1) { -- Iterator var2 = this.o.iterator(); -+ /** -+ * if this is a player, then it is not informed -+ */ -+ public void sendPacketToAllTrackingPlayers(Packet par1Packet) { -+ Iterator var2 = this.trackingPlayers.iterator(); - -- while(var2.hasNext()) { -+ while (var2.hasNext()) { - EntityPlayerMP var3 = (EntityPlayerMP)var2.next(); -- var3.playerNetServerHandler.sendPacket(var1); -- } -- -- } -- -- public void sendPacketToTrackedPlayersAndTrackedEntity(Packet var1) { -- this.sendPacketToTrackedPlayers(var1); -- if(this.trackedEntity instanceof EntityPlayerMP) { -- ((EntityPlayerMP)this.trackedEntity).playerNetServerHandler.sendPacket(var1); -- } -- -- } -- -- public void sendDestroyEntityPacketToTrackedPlayers() { -- Iterator var1 = this.o.iterator(); -- -- while(var1.hasNext()) { -+ var3.playerNetServerHandler.sendPacketToPlayer(par1Packet); -+ } -+ } -+ -+ /** -+ * if this is a player, then it recieves the message also -+ */ -+ public void sendPacketToAllAssociatedPlayers(Packet par1Packet) { -+ this.sendPacketToAllTrackingPlayers(par1Packet); -+ -+ if (this.myEntity instanceof EntityPlayerMP) { -+ ((EntityPlayerMP)this.myEntity).playerNetServerHandler.sendPacketToPlayer(par1Packet); -+ } -+ } -+ -+ public void informAllAssociatedPlayersOfItemDestruction() { -+ Iterator var1 = this.trackingPlayers.iterator(); -+ -+ while (var1.hasNext()) { - EntityPlayerMP var2 = (EntityPlayerMP)var1.next(); -- var2.g.add(Integer.valueOf(this.trackedEntity.entityId)); -- } -- -- } -- -- public void removeFromTrackedPlayers(EntityPlayerMP var1) { -- if(this.o.contains(var1)) { -- var1.g.add(Integer.valueOf(this.trackedEntity.entityId)); -- this.o.remove(var1); -- } -- -- } -- -- public void updatePlayerEntity(EntityPlayerMP var1) { -- if(var1 != this.trackedEntity) { -- double var2 = var1.posX - (double)(this.encodedPosX / 32); -- double var4 = var1.posZ - (double)(this.encodedPosZ / 32); -- if(var2 >= (double)(-this.trackingDistanceThreshold) && var2 <= (double)this.trackingDistanceThreshold && var4 >= (double)(-this.trackingDistanceThreshold) && var4 <= (double)this.trackingDistanceThreshold) { -- if(!this.o.contains(var1) && (this.isPlayerWatchingThisChunk(var1) || this.trackedEntity.forceSpawn)) { -- this.o.add(var1); -- Packet var6 = this.getSpawnPacket(); -- var1.playerNetServerHandler.sendPacket(var6); -- if(!this.trackedEntity.getDataWatcher().getIsBlank()) { -- var1.playerNetServerHandler.sendPacket(new Packet40EntityMetadata(this.trackedEntity.entityId, this.trackedEntity.getDataWatcher(), true)); -+ var2.destroyedItemsNetCache.add(Integer.valueOf(this.myEntity.entityId)); -+ } -+ } -+ -+ public void removeFromWatchingList(EntityPlayerMP par1EntityPlayerMP) { -+ if (this.trackingPlayers.contains(par1EntityPlayerMP)) { -+ par1EntityPlayerMP.destroyedItemsNetCache.add(Integer.valueOf(this.myEntity.entityId)); -+ this.trackingPlayers.remove(par1EntityPlayerMP); -+ } -+ } -+ -+ /** -+ * if the player is more than the distance threshold (typically 64) then the player is removed instead -+ */ -+ public void tryStartWachingThis(EntityPlayerMP par1EntityPlayerMP) { -+ if (par1EntityPlayerMP != this.myEntity) { -+ double var2 = par1EntityPlayerMP.posX - (double)(this.lastScaledXPosition / 32); -+ double var4 = par1EntityPlayerMP.posZ - (double)(this.lastScaledZPosition / 32); -+ -+ if (var2 >= (double)(-this.blocksDistanceThreshold) && var2 <= (double)this.blocksDistanceThreshold && var4 >= (double)(-this.blocksDistanceThreshold) && var4 <= (double)this.blocksDistanceThreshold) { -+ if (!this.trackingPlayers.contains(par1EntityPlayerMP) && (this.isPlayerWatchingThisChunk(par1EntityPlayerMP) || this.myEntity.forceSpawn)) { -+ this.trackingPlayers.add(par1EntityPlayerMP); -+ Packet var6 = this.getPacketForThisEntity(); -+ par1EntityPlayerMP.playerNetServerHandler.sendPacketToPlayer(var6); -+ -+ if (!this.myEntity.getDataWatcher().getIsBlank()) { -+ par1EntityPlayerMP.playerNetServerHandler.sendPacketToPlayer(new Packet40EntityMetadata(this.myEntity.entityId, this.myEntity.getDataWatcher(), true)); - } - -- if(this.trackedEntity instanceof EntityLivingBase) { -- ServersideAttributeMap var7 = (ServersideAttributeMap)((EntityLivingBase)this.trackedEntity).getAttributeMap(); -+ if (this.myEntity instanceof EntityLivingBase) { -+ ServersideAttributeMap var7 = (ServersideAttributeMap)((EntityLivingBase)this.myEntity).getAttributeMap(); - Collection var8 = var7.func_111160_c(); -- if(!var8.isEmpty()) { -- var1.playerNetServerHandler.sendPacket(new Packet44UpdateAttributes(this.trackedEntity.entityId, var8)); -+ -+ if (!var8.isEmpty()) { -+ par1EntityPlayerMP.playerNetServerHandler.sendPacketToPlayer(new Packet44UpdateAttributes(this.myEntity.entityId, var8)); - } - } - -- this.lastTrackedEntityMotionX = this.trackedEntity.motionX; -- this.lastTrackedEntityMotionY = this.trackedEntity.motionY; -- this.motionZ = this.trackedEntity.motionZ; -- if(this.sendVelocityUpdates && !(var6 instanceof Packet24MobSpawn)) { -- var1.playerNetServerHandler.sendPacket(new Packet28EntityVelocity(this.trackedEntity.entityId, this.trackedEntity.motionX, this.trackedEntity.motionY, this.trackedEntity.motionZ)); -- } -- -- if(this.trackedEntity.ridingEntity != null) { -- var1.playerNetServerHandler.sendPacket(new Packet39AttachEntity(0, this.trackedEntity, this.trackedEntity.ridingEntity)); -- } -- -- if(this.trackedEntity instanceof EntityLiving && ((EntityLiving)this.trackedEntity).getLeashedToEntity() != null) { -- var1.playerNetServerHandler.sendPacket(new Packet39AttachEntity(1, this.trackedEntity, ((EntityLiving)this.trackedEntity).getLeashedToEntity())); -- } -- -- if(this.trackedEntity instanceof EntityLivingBase) { -- for(int var10 = 0; var10 < 5; ++var10) { -- ItemStack var12 = ((EntityLivingBase)this.trackedEntity).getEquipmentInSlot(var10); -- if(var12 != null) { -- var1.playerNetServerHandler.sendPacket(new Packet5PlayerInventory(this.trackedEntity.entityId, var10, var12)); -+ this.motionX = this.myEntity.motionX; -+ this.motionY = this.myEntity.motionY; -+ this.motionZ = this.myEntity.motionZ; -+ -+ if (this.sendVelocityUpdates && !(var6 instanceof Packet24MobSpawn)) { -+ par1EntityPlayerMP.playerNetServerHandler.sendPacketToPlayer(new Packet28EntityVelocity(this.myEntity.entityId, this.myEntity.motionX, this.myEntity.motionY, this.myEntity.motionZ)); -+ } -+ -+ if (this.myEntity.ridingEntity != null) { -+ par1EntityPlayerMP.playerNetServerHandler.sendPacketToPlayer(new Packet39AttachEntity(0, this.myEntity, this.myEntity.ridingEntity)); -+ } -+ -+ if (this.myEntity instanceof EntityLiving && ((EntityLiving)this.myEntity).getLeashedToEntity() != null) { -+ par1EntityPlayerMP.playerNetServerHandler.sendPacketToPlayer(new Packet39AttachEntity(1, this.myEntity, ((EntityLiving)this.myEntity).getLeashedToEntity())); -+ } -+ -+ if (this.myEntity instanceof EntityLivingBase) { -+ for (int var10 = 0; var10 < 5; ++var10) { -+ ItemStack var12 = ((EntityLivingBase)this.myEntity).getCurrentItemOrArmor(var10); -+ -+ if (var12 != null) { -+ par1EntityPlayerMP.playerNetServerHandler.sendPacketToPlayer(new Packet5PlayerInventory(this.myEntity.entityId, var10, var12)); - } - } - } - -- if(this.trackedEntity instanceof EntityPlayer) { -- EntityPlayer var11 = (EntityPlayer)this.trackedEntity; -- if(var11.isPlayerSleeping()) { -- var1.playerNetServerHandler.sendPacket(new Packet17Sleep(this.trackedEntity, 0, MathHelper.floor_double(this.trackedEntity.posX), MathHelper.floor_double(this.trackedEntity.posY), MathHelper.floor_double(this.trackedEntity.posZ))); -+ if (this.myEntity instanceof EntityPlayer) { -+ EntityPlayer var11 = (EntityPlayer)this.myEntity; -+ -+ if (var11.isPlayerSleeping()) { -+ par1EntityPlayerMP.playerNetServerHandler.sendPacketToPlayer(new Packet17Sleep(this.myEntity, 0, MathHelper.floor_double(this.myEntity.posX), MathHelper.floor_double(this.myEntity.posY), MathHelper.floor_double(this.myEntity.posZ))); - } - } - -- if(this.trackedEntity instanceof EntityLivingBase) { -- EntityLivingBase var13 = (EntityLivingBase)this.trackedEntity; -+ if (this.myEntity instanceof EntityLivingBase) { -+ EntityLivingBase var13 = (EntityLivingBase)this.myEntity; - Iterator var14 = var13.getActivePotionEffects().iterator(); - -- while(var14.hasNext()) { -+ while (var14.hasNext()) { - PotionEffect var9 = (PotionEffect)var14.next(); -- var1.playerNetServerHandler.sendPacket(new Packet41EntityEffect(this.trackedEntity.entityId, var9)); -+ par1EntityPlayerMP.playerNetServerHandler.sendPacketToPlayer(new Packet41EntityEffect(this.myEntity.entityId, var9)); - } - } - } -- } else if(this.o.contains(var1)) { -- this.o.remove(var1); -- var1.g.add(Integer.valueOf(this.trackedEntity.entityId)); -+ } else if (this.trackingPlayers.contains(par1EntityPlayerMP)) { -+ this.trackingPlayers.remove(par1EntityPlayerMP); -+ par1EntityPlayerMP.destroyedItemsNetCache.add(Integer.valueOf(this.myEntity.entityId)); - } -- -- } -- } -- -- private boolean isPlayerWatchingThisChunk(EntityPlayerMP var1) { -- return var1.getServerForPlayer().getPlayerManager().isPlayerWatchingChunk(var1, this.trackedEntity.chunkCoordX, this.trackedEntity.chunkCoordZ); -- } -- -- public void updatePlayerEntities(List var1) { -- for(int var2 = 0; var2 < var1.size(); ++var2) { -- this.updatePlayerEntity((EntityPlayerMP)var1.get(var2)); -- } -- -- } -- -- private Packet getSpawnPacket() { -- if(this.trackedEntity.isDead) { -- this.trackedEntity.worldObj.getWorldLogAgent().logWarning("Fetching addPacket for removed entity"); -- } -- -- if(this.trackedEntity instanceof EntityItem) { -- return new Packet23VehicleSpawn(this.trackedEntity, 2, 1); -- } else if(this.trackedEntity instanceof EntityPlayerMP) { -- return new Packet20NamedEntitySpawn((EntityPlayer)this.trackedEntity); -- } else if(this.trackedEntity instanceof EntityMinecart) { -- EntityMinecart var9 = (EntityMinecart)this.trackedEntity; -- return new Packet23VehicleSpawn(this.trackedEntity, 10, var9.getMinecartType()); -- } else if(this.trackedEntity instanceof EntityBoat) { -- return new Packet23VehicleSpawn(this.trackedEntity, 1); -- } else if(!(this.trackedEntity instanceof IAnimals) && !(this.trackedEntity instanceof EntityDragon)) { -- if(this.trackedEntity instanceof EntityFishHook) { -- EntityPlayer var8 = ((EntityFishHook)this.trackedEntity).angler; -- return new Packet23VehicleSpawn(this.trackedEntity, 90, var8 != null ? var8.entityId : this.trackedEntity.entityId); -- } else if(this.trackedEntity instanceof EntityArrow) { -- Entity var7 = ((EntityArrow)this.trackedEntity).shootingEntity; -- return new Packet23VehicleSpawn(this.trackedEntity, 60, var7 != null ? var7.entityId : this.trackedEntity.entityId); -- } else if(this.trackedEntity instanceof EntitySnowball) { -- return new Packet23VehicleSpawn(this.trackedEntity, 61); -- } else if(this.trackedEntity instanceof EntityPotion) { -- return new Packet23VehicleSpawn(this.trackedEntity, 73, ((EntityPotion)this.trackedEntity).getPotionDamage()); -- } else if(this.trackedEntity instanceof EntityExpBottle) { -- return new Packet23VehicleSpawn(this.trackedEntity, 75); -- } else if(this.trackedEntity instanceof EntityEnderPearl) { -- return new Packet23VehicleSpawn(this.trackedEntity, 65); -- } else if(this.trackedEntity instanceof EntityEnderEye) { -- return new Packet23VehicleSpawn(this.trackedEntity, 72); -- } else if(this.trackedEntity instanceof EntityFireworkRocket) { -- return new Packet23VehicleSpawn(this.trackedEntity, 76); -+ } -+ } -+ -+ private boolean isPlayerWatchingThisChunk(EntityPlayerMP par1EntityPlayerMP) { -+ return par1EntityPlayerMP.getServerForPlayer().getPlayerManager().isPlayerWatchingChunk(par1EntityPlayerMP, this.myEntity.chunkCoordX, this.myEntity.chunkCoordZ); -+ } -+ -+ public void sendEventsToPlayers(List par1List) { -+ for (int var2 = 0; var2 < par1List.size(); ++var2) { -+ this.tryStartWachingThis((EntityPlayerMP)par1List.get(var2)); -+ } -+ } -+ -+ private Packet getPacketForThisEntity() { -+ if (this.myEntity.isDead) { -+ this.myEntity.worldObj.getWorldLogAgent().logWarning("Fetching addPacket for removed entity"); -+ } -+ -+ if (this.myEntity instanceof EntityItem) { -+ return new Packet23VehicleSpawn(this.myEntity, 2, 1); -+ } else if (this.myEntity instanceof EntityPlayerMP) { -+ return new Packet20NamedEntitySpawn((EntityPlayer)this.myEntity); -+ } else if (this.myEntity instanceof EntityMinecart) { -+ EntityMinecart var9 = (EntityMinecart)this.myEntity; -+ return new Packet23VehicleSpawn(this.myEntity, 10, var9.getMinecartType()); -+ } else if (this.myEntity instanceof EntityBoat) { -+ return new Packet23VehicleSpawn(this.myEntity, 1); -+ } else if (!(this.myEntity instanceof IAnimals) && !(this.myEntity instanceof EntityDragon)) { -+ if (this.myEntity instanceof EntityFishHook) { -+ EntityPlayer var8 = ((EntityFishHook)this.myEntity).angler; -+ return new Packet23VehicleSpawn(this.myEntity, 90, var8 != null ? var8.entityId : this.myEntity.entityId); -+ } else if (this.myEntity instanceof EntityArrow) { -+ Entity var7 = ((EntityArrow)this.myEntity).shootingEntity; -+ return new Packet23VehicleSpawn(this.myEntity, 60, var7 != null ? var7.entityId : this.myEntity.entityId); -+ } else if (this.myEntity instanceof EntitySnowball) { -+ return new Packet23VehicleSpawn(this.myEntity, 61); -+ } else if (this.myEntity instanceof EntityPotion) { -+ return new Packet23VehicleSpawn(this.myEntity, 73, ((EntityPotion)this.myEntity).getPotionDamage()); -+ } else if (this.myEntity instanceof EntityExpBottle) { -+ return new Packet23VehicleSpawn(this.myEntity, 75); -+ } else if (this.myEntity instanceof EntityEnderPearl) { -+ return new Packet23VehicleSpawn(this.myEntity, 65); -+ } else if (this.myEntity instanceof EntityEnderEye) { -+ return new Packet23VehicleSpawn(this.myEntity, 72); -+ } else if (this.myEntity instanceof EntityFireworkRocket) { -+ return new Packet23VehicleSpawn(this.myEntity, 76); - } else { - Packet23VehicleSpawn var2; -- if(this.trackedEntity instanceof EntityFireball) { -- EntityFireball var6 = (EntityFireball)this.trackedEntity; -+ -+ if (this.myEntity instanceof EntityFireball) { -+ EntityFireball var6 = (EntityFireball)this.myEntity; - var2 = null; - byte var3 = 63; -- if(this.trackedEntity instanceof EntitySmallFireball) { -+ -+ if (this.myEntity instanceof EntitySmallFireball) { - var3 = 64; -- } else if(this.trackedEntity instanceof EntityWitherSkull) { -+ } else if (this.myEntity instanceof EntityWitherSkull) { - var3 = 66; - } - -- if(var6.shootingEntity != null) { -- var2 = new Packet23VehicleSpawn(this.trackedEntity, var3, ((EntityFireball)this.trackedEntity).shootingEntity.entityId); -+ if (var6.shootingEntity != null) { -+ var2 = new Packet23VehicleSpawn(this.myEntity, var3, ((EntityFireball)this.myEntity).shootingEntity.entityId); - } else { -- var2 = new Packet23VehicleSpawn(this.trackedEntity, var3, 0); -+ var2 = new Packet23VehicleSpawn(this.myEntity, var3, 0); - } - - var2.speedX = (int)(var6.accelerationX * 8000.0D); - var2.speedY = (int)(var6.accelerationY * 8000.0D); - var2.speedZ = (int)(var6.accelerationZ * 8000.0D); - return var2; -- } else if(this.trackedEntity instanceof EntityEgg) { -- return new Packet23VehicleSpawn(this.trackedEntity, 62); -- } else if(this.trackedEntity instanceof EntityTNTPrimed) { -- return new Packet23VehicleSpawn(this.trackedEntity, 50); -- } else if(this.trackedEntity instanceof EntityEnderCrystal) { -- return new Packet23VehicleSpawn(this.trackedEntity, 51); -- } else if(this.trackedEntity instanceof EntityFallingSand) { -- EntityFallingSand var5 = (EntityFallingSand)this.trackedEntity; -- return new Packet23VehicleSpawn(this.trackedEntity, 70, var5.blockID | var5.metadata << 16); -- } else if(this.trackedEntity instanceof EntityPainting) { -- return new Packet25EntityPainting((EntityPainting)this.trackedEntity); -- } else if(this.trackedEntity instanceof EntityItemFrame) { -- EntityItemFrame var4 = (EntityItemFrame)this.trackedEntity; -- var2 = new Packet23VehicleSpawn(this.trackedEntity, 71, var4.hangingDirection); -+ } else if (this.myEntity instanceof EntityEgg) { -+ return new Packet23VehicleSpawn(this.myEntity, 62); -+ } else if (this.myEntity instanceof EntityTNTPrimed) { -+ return new Packet23VehicleSpawn(this.myEntity, 50); -+ } else if (this.myEntity instanceof EntityEnderCrystal) { -+ return new Packet23VehicleSpawn(this.myEntity, 51); -+ } else if (this.myEntity instanceof EntityFallingSand) { -+ EntityFallingSand var5 = (EntityFallingSand)this.myEntity; -+ return new Packet23VehicleSpawn(this.myEntity, 70, var5.blockID | var5.metadata << 16); -+ } else if (this.myEntity instanceof EntityPainting) { -+ return new Packet25EntityPainting((EntityPainting)this.myEntity); -+ } else if (this.myEntity instanceof EntityItemFrame) { -+ EntityItemFrame var4 = (EntityItemFrame)this.myEntity; -+ var2 = new Packet23VehicleSpawn(this.myEntity, 71, var4.hangingDirection); - var2.xPosition = MathHelper.floor_float((float)(var4.xPosition * 32)); - var2.yPosition = MathHelper.floor_float((float)(var4.yPosition * 32)); - var2.zPosition = MathHelper.floor_float((float)(var4.zPosition * 32)); - return var2; -- } else if(this.trackedEntity instanceof EntityLeashKnot) { -- EntityLeashKnot var1 = (EntityLeashKnot)this.trackedEntity; -- var2 = new Packet23VehicleSpawn(this.trackedEntity, 77); -+ } else if (this.myEntity instanceof EntityLeashKnot) { -+ EntityLeashKnot var1 = (EntityLeashKnot)this.myEntity; -+ var2 = new Packet23VehicleSpawn(this.myEntity, 77); - var2.xPosition = MathHelper.floor_float((float)(var1.xPosition * 32)); - var2.yPosition = MathHelper.floor_float((float)(var1.yPosition * 32)); - var2.zPosition = MathHelper.floor_float((float)(var1.zPosition * 32)); - return var2; -- } else if(this.trackedEntity instanceof EntityXPOrb) { -- return new Packet26EntityExpOrb((EntityXPOrb)this.trackedEntity); -+ } else if (this.myEntity instanceof EntityXPOrb) { -+ return new Packet26EntityExpOrb((EntityXPOrb)this.myEntity); - } else { -- throw new IllegalArgumentException("Don\'t know how to add " + this.trackedEntity.getClass() + "!"); -+ throw new IllegalArgumentException("Don\'t know how to add " + this.myEntity.getClass() + "!"); - } - } - } else { -- this.lastHeadMotion = MathHelper.floor_float(this.trackedEntity.getRotationYawHead() * 256.0F / 360.0F); -- return new Packet24MobSpawn((EntityLivingBase)this.trackedEntity); -+ this.lastHeadMotion = MathHelper.floor_float(this.myEntity.getRotationYawHead() * 256.0F / 360.0F); -+ return new Packet24MobSpawn((EntityLivingBase)this.myEntity); - } - } - -- public void removeTrackedPlayerSymmetric(EntityPlayerMP var1) { -- if(this.o.contains(var1)) { -- this.o.remove(var1); -- var1.g.add(Integer.valueOf(this.trackedEntity.entityId)); -+ public void removePlayerFromTracker(EntityPlayerMP par1EntityPlayerMP) { -+ if (this.trackingPlayers.contains(par1EntityPlayerMP)) { -+ this.trackingPlayers.remove(par1EntityPlayerMP); -+ par1EntityPlayerMP.destroyedItemsNetCache.add(Integer.valueOf(this.myEntity.entityId)); - } -- - } - } ---- /dev/null -+++ org/spoutcraft/api/util/FixedLocation.java -@@ -1,0 +1,49 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.api.util; -+ -+public interface FixedLocation extends FixedVector { -+ /** -+ * Gets the yaw of this location -+ * -+ * @return Yaw -+ */ -+ public double getYaw(); -+ -+ /** -+ * Gets the pitch of this location -+ * -+ * @return Pitch -+ */ -+ public double getPitch(); -+ -+ /** -+ * Gets a Vector pointing in the direction that this Location is facing -+ * -+ * @return Vector -+ */ -+ public Vector getDirection(); -+ -+ /** -+ * Creates a vector with the properties of this location -+ * @return vector -+ */ -+ public Vector toVector(); -+} ---- /dev/null -+++ org/spoutcraft/api/gui/PositionOrientation.java -@@ -1,0 +1,31 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.api.gui; -+ -+/** -+ * This enum can be used to distinguish between position and alignment states. -+ */ -+public enum PositionOrientation { -+ TOP, -+ LEFT, -+ RIGHT, -+ BOTTOM, -+ ; -+} ---- net/minecraft/src/EntityCritFX.java -+++ net/minecraft/src/EntityCritFX.java -@@ -3,62 +3,67 @@ - public class EntityCritFX extends EntityFX { - float initialParticleScale; - -- public EntityCritFX(World var1, double var2, double var4, double var6, double var8, double var10, double var12) { -- this(var1, var2, var4, var6, var8, var10, var12, 1.0F); -+ public EntityCritFX(World par1World, double par2, double par4, double par6, double par8, double par10, double par12) { -+ this(par1World, par2, par4, par6, par8, par10, par12, 1.0F); - } - -- public EntityCritFX(World var1, double var2, double var4, double var6, double var8, double var10, double var12, float var14) { -- super(var1, var2, var4, var6, 0.0D, 0.0D, 0.0D); -- this.motionX *= (double)0.1F; -- this.motionY *= (double)0.1F; -- this.motionZ *= (double)0.1F; -- this.motionX += var8 * 0.4D; -- this.motionY += var10 * 0.4D; -- this.motionZ += var12 * 0.4D; -- this.particleRed = this.particleGreen = this.particleBlue = (float)(Math.random() * (double)0.3F + (double)0.6F); -- this.particleScale *= 12.0F / 16.0F; -- this.particleScale *= var14; -+ public EntityCritFX(World par1World, double par2, double par4, double par6, double par8, double par10, double par12, float par14) { -+ super(par1World, par2, par4, par6, 0.0D, 0.0D, 0.0D); -+ this.motionX *= 0.10000000149011612D; -+ this.motionY *= 0.10000000149011612D; -+ this.motionZ *= 0.10000000149011612D; -+ this.motionX += par8 * 0.4D; -+ this.motionY += par10 * 0.4D; -+ this.motionZ += par12 * 0.4D; -+ this.particleRed = this.particleGreen = this.particleBlue = (float)(Math.random() * 0.30000001192092896D + 0.6000000238418579D); -+ this.particleScale *= 0.75F; -+ this.particleScale *= par14; - this.initialParticleScale = this.particleScale; - this.particleMaxAge = (int)(6.0D / (Math.random() * 0.8D + 0.6D)); -- this.particleMaxAge = (int)((float)this.particleMaxAge * var14); -+ this.particleMaxAge = (int)((float)this.particleMaxAge * par14); - this.noClip = false; - this.setParticleTextureIndex(65); - this.onUpdate(); - } - -- public void renderParticle(Tessellator var1, float var2, float var3, float var4, float var5, float var6, float var7) { -- float var8 = ((float)this.particleAge + var2) / (float)this.particleMaxAge * 32.0F; -- if(var8 < 0.0F) { -+ public void renderParticle(Tessellator par1Tessellator, float par2, float par3, float par4, float par5, float par6, float par7) { -+ float var8 = ((float)this.particleAge + par2) / (float)this.particleMaxAge * 32.0F; -+ -+ if (var8 < 0.0F) { - var8 = 0.0F; - } - -- if(var8 > 1.0F) { -+ if (var8 > 1.0F) { - var8 = 1.0F; - } - - this.particleScale = this.initialParticleScale * var8; -- super.renderParticle(var1, var2, var3, var4, var5, var6, var7); -+ super.renderParticle(par1Tessellator, par2, par3, par4, par5, par6, par7); - } - -+ /** -+ * Called to update the entity's position/logic. -+ */ - public void onUpdate() { - this.prevPosX = this.posX; - this.prevPosY = this.posY; - this.prevPosZ = this.posZ; -- if(this.particleAge++ >= this.particleMaxAge) { -+ -+ if (this.particleAge++ >= this.particleMaxAge) { - this.setDead(); - } - - this.moveEntity(this.motionX, this.motionY, this.motionZ); - this.particleGreen = (float)((double)this.particleGreen * 0.96D); - this.particleBlue = (float)((double)this.particleBlue * 0.9D); -- this.motionX *= (double)0.7F; -- this.motionY *= (double)0.7F; -- this.motionZ *= (double)0.7F; -- this.motionY -= (double)0.02F; -- if(this.onGround) { -- this.motionX *= (double)0.7F; -- this.motionZ *= (double)0.7F; -- } -+ this.motionX *= 0.699999988079071D; -+ this.motionY *= 0.699999988079071D; -+ this.motionZ *= 0.699999988079071D; -+ this.motionY -= 0.019999999552965164D; - -+ if (this.onGround) { -+ this.motionX *= 0.699999988079071D; -+ this.motionZ *= 0.699999988079071D; -+ } - } - } ---- net/minecraft/src/PotionHelper.java -+++ net/minecraft/src/PotionHelper.java -@@ -6,54 +6,75 @@ - import java.util.Iterator; - import java.util.List; - -+import com.prupe.mcpatcher.cc.ColorizeItem; -+ - public class PotionHelper { -- public static final String a = null; -- public static final String b; -- public static final String c = "+0-1-2-3&4-4+13"; -- public static final String d; -- public static final String e; -- public static final String f; -- public static final String g; -- public static final String h; -- public static final String i; -- public static final String j; -- public static final String k; -- public static final String l; -- private static final HashMap m = new HashMap(); -- private static final HashMap n = new HashMap(); -- private static final HashMap o; -- private static final String[] p; -- -- public static boolean checkFlag(int var0, int var1) { -- return (var0 & 1 << var1) != 0; -- } -- -- private static int isFlagSet(int var0, int var1) { -- return checkFlag(var0, var1) ? 1 : 0; -- } -- -- private static int isFlagUnset(int var0, int var1) { -- return checkFlag(var0, var1) ? 0 : 1; -- } -- -- public static int func_77909_a(int var0) { -- return func_77908_a(var0, 5, 4, 3, 2, 1); -- } -- -- public static int calcPotionLiquidColor(Collection var0) { -- int var1 = 3694022; -- if(var0 != null && !var0.isEmpty()) { -+ public static final String field_77924_a = null; -+ public static final String sugarEffect; -+ public static final String ghastTearEffect = "+0-1-2-3&4-4+13"; -+ public static final String spiderEyeEffect; -+ public static final String fermentedSpiderEyeEffect; -+ public static final String speckledMelonEffect; -+ public static final String blazePowderEffect; -+ public static final String magmaCreamEffect; -+ public static final String redstoneEffect; -+ public static final String glowstoneEffect; -+ public static final String gunpowderEffect; -+ public static final String goldenCarrotEffect; -+ private static final HashMap potionRequirements = new HashMap(); -+ -+ /** Potion effect amplifier map */ -+ private static final HashMap potionAmplifiers = new HashMap(); -+ public static final HashMap field_77925_n; -+ -+ /** An array of possible potion prefix names, as translation IDs. */ -+ private static final String[] potionPrefixes; -+ -+ /** -+ * Is the bit given set to 1? -+ */ -+ public static boolean checkFlag(int par0, int par1) { -+ return (par0 & 1 << par1) != 0; -+ } -+ -+ /** -+ * Returns 1 if the flag is set, 0 if it is not set. -+ */ -+ private static int isFlagSet(int par0, int par1) { -+ return checkFlag(par0, par1) ? 1 : 0; -+ } -+ -+ /** -+ * Returns 0 if the flag is set, 1 if it is not set. -+ */ -+ private static int isFlagUnset(int par0, int par1) { -+ return checkFlag(par0, par1) ? 0 : 1; -+ } -+ -+ public static int func_77909_a(int par0) { -+ return func_77908_a(par0, 5, 4, 3, 2, 1); -+ } -+ -+ /** -+ * Given a {@link Collection}<{@link PotionEffect}> will return an Integer color. -+ */ -+ public static int calcPotionLiquidColor(Collection par0Collection) { -+ // MCPatcher Start -+ int var1 = ColorizeItem.getWaterBottleColor(); -+ // MCPatcher End -+ -+ if (par0Collection != null && !par0Collection.isEmpty()) { - float var2 = 0.0F; - float var3 = 0.0F; - float var4 = 0.0F; - float var5 = 0.0F; -- Iterator var6 = var0.iterator(); -+ Iterator var6 = par0Collection.iterator(); - -- while(var6.hasNext()) { -+ while (var6.hasNext()) { - PotionEffect var7 = (PotionEffect)var6.next(); - int var8 = Potion.potionTypes[var7.getPotionID()].getLiquidColor(); - -- for(int var9 = 0; var9 <= var7.getAmplifier(); ++var9) { -+ for (int var9 = 0; var9 <= var7.getAmplifier(); ++var9) { - var2 += (float)(var8 >> 16 & 255) / 255.0F; - var3 += (float)(var8 >> 8 & 255) / 255.0F; - var4 += (float)(var8 >> 0 & 255) / 255.0F; -@@ -70,97 +91,106 @@ - } - } - -- public static boolean func_82817_b(Collection var0) { -- Iterator var1 = var0.iterator(); -- -+ public static boolean func_82817_b(Collection par0Collection) { -+ Iterator var1 = par0Collection.iterator(); - PotionEffect var2; -+ - do { -- if(!var1.hasNext()) { -+ if (!var1.hasNext()) { - return true; - } - - var2 = (PotionEffect)var1.next(); -- } while(var2.getIsAmbient()); -+ } while (var2.getIsAmbient()); - - return false; - } - -- public static int func_77915_a(int var0, boolean var1) { -- if(!var1) { -- if(o.containsKey(Integer.valueOf(var0))) { -- return ((Integer)o.get(Integer.valueOf(var0))).intValue(); -+ public static int func_77915_a(int par0, boolean par1) { -+ if (!par1) { -+ if (field_77925_n.containsKey(Integer.valueOf(par0))) { -+ return ((Integer)field_77925_n.get(Integer.valueOf(par0))).intValue(); - } else { -- int var2 = calcPotionLiquidColor(getPotionEffects(var0, false)); -- o.put(Integer.valueOf(var0), Integer.valueOf(var2)); -+ int var2 = calcPotionLiquidColor(getPotionEffects(par0, false)); -+ field_77925_n.put(Integer.valueOf(par0), Integer.valueOf(var2)); - return var2; - } - } else { -- return calcPotionLiquidColor(getPotionEffects(var0, var1)); -+ return calcPotionLiquidColor(getPotionEffects(par0, par1)); - } - } - -- public static String func_77905_c(int var0) { -- int var1 = func_77909_a(var0); -- return p[var1]; -+ public static String func_77905_c(int par0) { -+ int var1 = func_77909_a(par0); -+ return potionPrefixes[var1]; - } - -- private static int func_77904_a(boolean var0, boolean var1, boolean var2, int var3, int var4, int var5, int var6) { -+ private static int func_77904_a(boolean par0, boolean par1, boolean par2, int par3, int par4, int par5, int par6) { - int var7 = 0; -- if(var0) { -- var7 = isFlagUnset(var6, var4); -- } else if(var3 != -1) { -- if(var3 == 0 && countSetFlags(var6) == var4) { -- var7 = 1; -- } else if(var3 == 1 && countSetFlags(var6) > var4) { -- var7 = 1; -- } else if(var3 == 2 && countSetFlags(var6) < var4) { -+ -+ if (par0) { -+ var7 = isFlagUnset(par6, par4); -+ } else if (par3 != -1) { -+ if (par3 == 0 && countSetFlags(par6) == par4) { -+ var7 = 1; -+ } else if (par3 == 1 && countSetFlags(par6) > par4) { -+ var7 = 1; -+ } else if (par3 == 2 && countSetFlags(par6) < par4) { - var7 = 1; - } - } else { -- var7 = isFlagSet(var6, var4); -- } -- -- if(var1) { -- var7 *= var5; -- } -- -- if(var2) { -+ var7 = isFlagSet(par6, par4); -+ } -+ -+ if (par1) { -+ var7 *= par5; -+ } -+ -+ if (par2) { - var7 *= -1; - } - - return var7; - } - -- private static int countSetFlags(int var0) { -+ /** -+ * Count the number of bits in an integer set to ON. -+ */ -+ private static int countSetFlags(int par0) { - int var1; -- for(var1 = 0; var0 > 0; ++var1) { -- var0 &= var0 - 1; -+ -+ for (var1 = 0; par0 > 0; ++var1) { -+ par0 &= par0 - 1; - } - - return var1; - } - -- private static int parsePotionEffects(String var0, int var1, int var2, int var3) { -- if(var1 < var0.length() && var2 >= 0 && var1 < var2) { -- int var4 = var0.indexOf(124, var1); -+ private static int parsePotionEffects(String par0Str, int par1, int par2, int par3) { -+ if (par1 < par0Str.length() && par2 >= 0 && par1 < par2) { -+ int var4 = par0Str.indexOf(124, par1); - int var5; - int var17; -- if(var4 >= 0 && var4 < var2) { -- var5 = parsePotionEffects(var0, var1, var4 - 1, var3); -- if(var5 > 0) { -+ -+ if (var4 >= 0 && var4 < par2) { -+ var5 = parsePotionEffects(par0Str, par1, var4 - 1, par3); -+ -+ if (var5 > 0) { - return var5; - } else { -- var17 = parsePotionEffects(var0, var4 + 1, var2, var3); -+ var17 = parsePotionEffects(par0Str, var4 + 1, par2, par3); - return var17 > 0 ? var17 : 0; - } - } else { -- var5 = var0.indexOf(38, var1); -- if(var5 >= 0 && var5 < var2) { -- var17 = parsePotionEffects(var0, var1, var5 - 1, var3); -- if(var17 <= 0) { -+ var5 = par0Str.indexOf(38, par1); -+ -+ if (var5 >= 0 && var5 < par2) { -+ var17 = parsePotionEffects(par0Str, par1, var5 - 1, par3); -+ -+ if (var17 <= 0) { - return 0; - } else { -- int var18 = parsePotionEffects(var0, var5 + 1, var2, var3); -+ int var18 = parsePotionEffects(par0Str, var5 + 1, par2, par3); - return var18 <= 0 ? 0 : (var17 > var18 ? var17 : var18); - } - } else { -@@ -174,10 +204,11 @@ - int var13 = 0; - int var14 = 0; - -- for(int var15 = var1; var15 < var2; ++var15) { -- char var16 = var0.charAt(var15); -- if(var16 >= 48 && var16 <= 57) { -- if(var6) { -+ for (int var15 = par1; var15 < par2; ++var15) { -+ char var16 = par0Str.charAt(var15); -+ -+ if (var16 >= 48 && var16 <= 57) { -+ if (var6) { - var13 = var16 - 48; - var7 = true; - } else { -@@ -185,72 +216,73 @@ - var12 += var16 - 48; - var8 = true; - } -- } else if(var16 == 42) { -+ } else if (var16 == 42) { - var6 = true; -- } else if(var16 == 33) { -- if(var8) { -- var14 += func_77904_a(var9, var7, var10, var11, var12, var13, var3); -+ } else if (var16 == 33) { -+ if (var8) { -+ var14 += func_77904_a(var9, var7, var10, var11, var12, var13, par3); - var9 = false; -- var10 = var9; -- var6 = var9; -- var7 = var9; -- var8 = var9; -+ var10 = false; -+ var6 = false; -+ var7 = false; -+ var8 = false; - var13 = 0; -- var12 = var13; -+ var12 = 0; - var11 = -1; - } - - var9 = true; -- } else if(var16 == 45) { -- if(var8) { -- var14 += func_77904_a(var9, var7, var10, var11, var12, var13, var3); -+ } else if (var16 == 45) { -+ if (var8) { -+ var14 += func_77904_a(var9, var7, var10, var11, var12, var13, par3); - var9 = false; -- var6 = var9; -- var7 = var9; -- var8 = var9; -+ var10 = false; -+ var6 = false; -+ var7 = false; -+ var8 = false; - var13 = 0; -- var12 = var13; -+ var12 = 0; - var11 = -1; - } - - var10 = true; -- } else if(var16 != 61 && var16 != 60 && var16 != 62) { -- if(var16 == 43 && var8) { -- var14 += func_77904_a(var9, var7, var10, var11, var12, var13, var3); -+ } else if (var16 != 61 && var16 != 60 && var16 != 62) { -+ if (var16 == 43 && var8) { -+ var14 += func_77904_a(var9, var7, var10, var11, var12, var13, par3); - var9 = false; -- var10 = var9; -- var6 = var9; -- var7 = var9; -- var8 = var9; -+ var10 = false; -+ var6 = false; -+ var7 = false; -+ var8 = false; - var13 = 0; -- var12 = var13; -+ var12 = 0; - var11 = -1; - } - } else { -- if(var8) { -- var14 += func_77904_a(var9, var7, var10, var11, var12, var13, var3); -+ if (var8) { -+ var14 += func_77904_a(var9, var7, var10, var11, var12, var13, par3); - var9 = false; -- var10 = var9; -- var6 = var9; -- var7 = var9; -- var8 = var9; -+ var10 = false; -+ var6 = false; -+ var7 = false; -+ var8 = false; - var13 = 0; -- var12 = var13; -+ var12 = 0; - var11 = -1; - } - -- if(var16 == 61) { -+ if (var16 == 61) { - var11 = 0; -- } else if(var16 == 60) { -+ } else if (var16 == 60) { - var11 = 2; -- } else if(var16 == 62) { -+ } else if (var16 == 62) { - var11 = 1; - } - } - } - -- if(var8) { -- var14 += func_77904_a(var9, var7, var10, var11, var12, var13, var3); -+ if (var8) { -+ var14 += func_77904_a(var9, var7, var10, var11, var12, var13, par3); - } - - return var14; -@@ -261,44 +293,54 @@ - } - } - -- public static List getPotionEffects(int var0, boolean var1) { -+ /** -+ * Returns a list of effects for the specified potion damage value. -+ */ -+ public static List getPotionEffects(int par0, boolean par1) { - ArrayList var2 = null; - Potion[] var3 = Potion.potionTypes; - int var4 = var3.length; - -- for(int var5 = 0; var5 < var4; ++var5) { -+ for (int var5 = 0; var5 < var4; ++var5) { - Potion var6 = var3[var5]; -- if(var6 != null && (!var6.isUsable() || var1)) { -- String var7 = (String)m.get(Integer.valueOf(var6.getId())); -- if(var7 != null) { -- int var8 = parsePotionEffects(var7, 0, var7.length(), var0); -- if(var8 > 0) { -+ -+ if (var6 != null && (!var6.isUsable() || par1)) { -+ String var7 = (String)potionRequirements.get(Integer.valueOf(var6.getId())); -+ -+ if (var7 != null) { -+ int var8 = parsePotionEffects(var7, 0, var7.length(), par0); -+ -+ if (var8 > 0) { - int var9 = 0; -- String var10 = (String)n.get(Integer.valueOf(var6.getId())); -- if(var10 != null) { -- var9 = parsePotionEffects(var10, 0, var10.length(), var0); -- if(var9 < 0) { -+ String var10 = (String)potionAmplifiers.get(Integer.valueOf(var6.getId())); -+ -+ if (var10 != null) { -+ var9 = parsePotionEffects(var10, 0, var10.length(), par0); -+ -+ if (var9 < 0) { - var9 = 0; - } - } - -- if(var6.isInstant()) { -+ if (var6.isInstant()) { - var8 = 1; - } else { - var8 = 1200 * (var8 * 3 + (var8 - 1) * 2); - var8 >>= var9; - var8 = (int)Math.round((double)var8 * var6.getEffectiveness()); -- if((var0 & 16384) != 0) { -+ -+ if ((par0 & 16384) != 0) { - var8 = (int)Math.round((double)var8 * 0.75D + 0.5D); - } - } - -- if(var2 == null) { -+ if (var2 == null) { - var2 = new ArrayList(); - } - - PotionEffect var11 = new PotionEffect(var6.getId(), var8, var9); -- if((var0 & 16384) != 0) { -+ -+ if ((par0 & 16384) != 0) { - var11.setSplashPotion(true); - } - -@@ -311,77 +353,89 @@ - return var2; - } - -- private static int brewBitOperations(int var0, int var1, boolean var2, boolean var3, boolean var4) { -- if(var4) { -- if(!checkFlag(var0, var1)) { -+ /** -+ * Does bit operations for brewPotionData, given data, the index of the bit being operated upon, whether the bit will -+ * be removed, whether the bit will be toggled (NOT), or whether the data field will be set to 0 if the bit is not -+ * present. -+ */ -+ private static int brewBitOperations(int par0, int par1, boolean par2, boolean par3, boolean par4) { -+ if (par4) { -+ if (!checkFlag(par0, par1)) { - return 0; - } -- } else if(var2) { -- var0 &= ~(1 << var1); -- } else if(var3) { -- if((var0 & 1 << var1) == 0) { -- var0 |= 1 << var1; -+ } else if (par2) { -+ par0 &= ~(1 << par1); -+ } else if (par3) { -+ if ((par0 & 1 << par1) == 0) { -+ par0 |= 1 << par1; - } else { -- var0 &= ~(1 << var1); -+ par0 &= ~(1 << par1); - } - } else { -- var0 |= 1 << var1; -+ par0 |= 1 << par1; - } - -- return var0; -+ return par0; - } - -- public static int applyIngredient(int var0, String var1) { -+ /** -+ * Generate a data value for a potion, given its previous data value and the encoded string of new effects it will -+ * receive -+ */ -+ public static int applyIngredient(int par0, String par1Str) { - byte var2 = 0; -- int var3 = var1.length(); -+ int var3 = par1Str.length(); - boolean var4 = false; - boolean var5 = false; - boolean var6 = false; - boolean var7 = false; - int var8 = 0; - -- for(int var9 = var2; var9 < var3; ++var9) { -- char var10 = var1.charAt(var9); -- if(var10 >= 48 && var10 <= 57) { -+ for (int var9 = var2; var9 < var3; ++var9) { -+ char var10 = par1Str.charAt(var9); -+ -+ if (var10 >= 48 && var10 <= 57) { - var8 *= 10; - var8 += var10 - 48; - var4 = true; -- } else if(var10 == 33) { -- if(var4) { -- var0 = brewBitOperations(var0, var8, var6, var5, var7); -+ } else if (var10 == 33) { -+ if (var4) { -+ par0 = brewBitOperations(par0, var8, var6, var5, var7); - var7 = false; -- var6 = var7; -- var4 = var7; -+ var5 = false; -+ var6 = false; -+ var4 = false; - var8 = 0; - } - - var5 = true; -- } else if(var10 == 45) { -- if(var4) { -- var0 = brewBitOperations(var0, var8, var6, var5, var7); -+ } else if (var10 == 45) { -+ if (var4) { -+ par0 = brewBitOperations(par0, var8, var6, var5, var7); - var7 = false; -- var5 = var7; -- var4 = var7; -+ var5 = false; -+ var6 = false; -+ var4 = false; - var8 = 0; - } - - var6 = true; -- } else if(var10 == 43) { -- if(var4) { -- var0 = brewBitOperations(var0, var8, var6, var5, var7); -+ } else if (var10 == 43) { -+ if (var4) { -+ par0 = brewBitOperations(par0, var8, var6, var5, var7); - var7 = false; -- var5 = var7; -- var6 = var7; -- var4 = var7; -+ var5 = false; -+ var6 = false; -+ var4 = false; - var8 = 0; - } -- } else if(var10 == 38) { -- if(var4) { -- var0 = brewBitOperations(var0, var8, var6, var5, var7); -+ } else if (var10 == 38) { -+ if (var4) { -+ par0 = brewBitOperations(par0, var8, var6, var5, var7); - var7 = false; -- var5 = var7; -- var6 = var7; -- var4 = var7; -+ var5 = false; -+ var6 = false; -+ var4 = false; - var8 = 0; - } - -@@ -389,48 +443,48 @@ - } - } - -- if(var4) { -- var0 = brewBitOperations(var0, var8, var6, var5, var7); -+ if (var4) { -+ par0 = brewBitOperations(par0, var8, var6, var5, var7); - } - -- return var0 & Short.MAX_VALUE; -+ return par0 & 32767; - } - -- public static int func_77908_a(int var0, int var1, int var2, int var3, int var4, int var5) { -- return (checkFlag(var0, var1) ? 16 : 0) | (checkFlag(var0, var2) ? 8 : 0) | (checkFlag(var0, var3) ? 4 : 0) | (checkFlag(var0, var4) ? 2 : 0) | (checkFlag(var0, var5) ? 1 : 0); -+ public static int func_77908_a(int par0, int par1, int par2, int par3, int par4, int par5) { -+ return (checkFlag(par0, par1) ? 16 : 0) | (checkFlag(par0, par2) ? 8 : 0) | (checkFlag(par0, par3) ? 4 : 0) | (checkFlag(par0, par4) ? 2 : 0) | (checkFlag(par0, par5) ? 1 : 0); - } - - static { -- m.put(Integer.valueOf(Potion.regeneration.getId()), "0 & !1 & !2 & !3 & 0+6"); -- b = "-0+1-2-3&4-4+13"; -- m.put(Integer.valueOf(Potion.moveSpeed.getId()), "!0 & 1 & !2 & !3 & 1+6"); -- h = "+0+1-2-3&4-4+13"; -- m.put(Integer.valueOf(Potion.fireResistance.getId()), "0 & 1 & !2 & !3 & 0+6"); -- f = "+0-1+2-3&4-4+13"; -- m.put(Integer.valueOf(Potion.heal.getId()), "0 & !1 & 2 & !3"); -- d = "-0-1+2-3&4-4+13"; -- m.put(Integer.valueOf(Potion.poison.getId()), "!0 & !1 & 2 & !3 & 2+6"); -- e = "-0+3-4+13"; -- m.put(Integer.valueOf(Potion.weakness.getId()), "!0 & !1 & !2 & 3 & 3+6"); -- m.put(Integer.valueOf(Potion.harm.getId()), "!0 & !1 & 2 & 3"); -- m.put(Integer.valueOf(Potion.moveSlowdown.getId()), "!0 & 1 & !2 & 3 & 3+6"); -- g = "+0-1-2+3&4-4+13"; -- m.put(Integer.valueOf(Potion.damageBoost.getId()), "0 & !1 & !2 & 3 & 3+6"); -- l = "-0+1+2-3+13&4-4"; -- m.put(Integer.valueOf(Potion.nightVision.getId()), "!0 & 1 & 2 & !3 & 2+6"); -- m.put(Integer.valueOf(Potion.invisibility.getId()), "!0 & 1 & 2 & 3 & 2+6"); -- j = "+5-6-7"; -- n.put(Integer.valueOf(Potion.moveSpeed.getId()), "5"); -- n.put(Integer.valueOf(Potion.digSpeed.getId()), "5"); -- n.put(Integer.valueOf(Potion.damageBoost.getId()), "5"); -- n.put(Integer.valueOf(Potion.regeneration.getId()), "5"); -- n.put(Integer.valueOf(Potion.harm.getId()), "5"); -- n.put(Integer.valueOf(Potion.heal.getId()), "5"); -- n.put(Integer.valueOf(Potion.resistance.getId()), "5"); -- n.put(Integer.valueOf(Potion.poison.getId()), "5"); -- i = "-5+6-7"; -- k = "+14&13-13"; -- o = new HashMap(); -- p = new String[]{"potion.prefix.mundane", "potion.prefix.uninteresting", "potion.prefix.bland", "potion.prefix.clear", "potion.prefix.milky", "potion.prefix.diffuse", "potion.prefix.artless", "potion.prefix.thin", "potion.prefix.awkward", "potion.prefix.flat", "potion.prefix.bulky", "potion.prefix.bungling", "potion.prefix.buttered", "potion.prefix.smooth", "potion.prefix.suave", "potion.prefix.debonair", "potion.prefix.thick", "potion.prefix.elegant", "potion.prefix.fancy", "potion.prefix.charming", "potion.prefix.dashing", "potion.prefix.refined", "potion.prefix.cordial", "potion.prefix.sparkling", "potion.prefix.potent", "potion.prefix.foul", "potion.prefix.odorless", "potion.prefix.rank", "potion.prefix.harsh", "potion.prefix.acrid", "potion.prefix.gross", "potion.prefix.stinky"}; -+ potionRequirements.put(Integer.valueOf(Potion.regeneration.getId()), "0 & !1 & !2 & !3 & 0+6"); -+ sugarEffect = "-0+1-2-3&4-4+13"; -+ potionRequirements.put(Integer.valueOf(Potion.moveSpeed.getId()), "!0 & 1 & !2 & !3 & 1+6"); -+ magmaCreamEffect = "+0+1-2-3&4-4+13"; -+ potionRequirements.put(Integer.valueOf(Potion.fireResistance.getId()), "0 & 1 & !2 & !3 & 0+6"); -+ speckledMelonEffect = "+0-1+2-3&4-4+13"; -+ potionRequirements.put(Integer.valueOf(Potion.heal.getId()), "0 & !1 & 2 & !3"); -+ spiderEyeEffect = "-0-1+2-3&4-4+13"; -+ potionRequirements.put(Integer.valueOf(Potion.poison.getId()), "!0 & !1 & 2 & !3 & 2+6"); -+ fermentedSpiderEyeEffect = "-0+3-4+13"; -+ potionRequirements.put(Integer.valueOf(Potion.weakness.getId()), "!0 & !1 & !2 & 3 & 3+6"); -+ potionRequirements.put(Integer.valueOf(Potion.harm.getId()), "!0 & !1 & 2 & 3"); -+ potionRequirements.put(Integer.valueOf(Potion.moveSlowdown.getId()), "!0 & 1 & !2 & 3 & 3+6"); -+ blazePowderEffect = "+0-1-2+3&4-4+13"; -+ potionRequirements.put(Integer.valueOf(Potion.damageBoost.getId()), "0 & !1 & !2 & 3 & 3+6"); -+ goldenCarrotEffect = "-0+1+2-3+13&4-4"; -+ potionRequirements.put(Integer.valueOf(Potion.nightVision.getId()), "!0 & 1 & 2 & !3 & 2+6"); -+ potionRequirements.put(Integer.valueOf(Potion.invisibility.getId()), "!0 & 1 & 2 & 3 & 2+6"); -+ glowstoneEffect = "+5-6-7"; -+ potionAmplifiers.put(Integer.valueOf(Potion.moveSpeed.getId()), "5"); -+ potionAmplifiers.put(Integer.valueOf(Potion.digSpeed.getId()), "5"); -+ potionAmplifiers.put(Integer.valueOf(Potion.damageBoost.getId()), "5"); -+ potionAmplifiers.put(Integer.valueOf(Potion.regeneration.getId()), "5"); -+ potionAmplifiers.put(Integer.valueOf(Potion.harm.getId()), "5"); -+ potionAmplifiers.put(Integer.valueOf(Potion.heal.getId()), "5"); -+ potionAmplifiers.put(Integer.valueOf(Potion.resistance.getId()), "5"); -+ potionAmplifiers.put(Integer.valueOf(Potion.poison.getId()), "5"); -+ redstoneEffect = "-5+6-7"; -+ gunpowderEffect = "+14&13-13"; -+ field_77925_n = new HashMap(); -+ potionPrefixes = new String[] {"potion.prefix.mundane", "potion.prefix.uninteresting", "potion.prefix.bland", "potion.prefix.clear", "potion.prefix.milky", "potion.prefix.diffuse", "potion.prefix.artless", "potion.prefix.thin", "potion.prefix.awkward", "potion.prefix.flat", "potion.prefix.bulky", "potion.prefix.bungling", "potion.prefix.buttered", "potion.prefix.smooth", "potion.prefix.suave", "potion.prefix.debonair", "potion.prefix.thick", "potion.prefix.elegant", "potion.prefix.fancy", "potion.prefix.charming", "potion.prefix.dashing", "potion.prefix.refined", "potion.prefix.cordial", "potion.prefix.sparkling", "potion.prefix.potent", "potion.prefix.foul", "potion.prefix.odorless", "potion.prefix.rank", "potion.prefix.harsh", "potion.prefix.acrid", "potion.prefix.gross", "potion.prefix.stinky"}; - } - } ---- net/minecraft/src/BlockFarmland.java -+++ net/minecraft/src/BlockFarmland.java -@@ -6,61 +6,84 @@ - private Icon field_94441_a; - private Icon field_94440_b; - -- protected BlockFarmland(int var1) { -- super(var1, Material.ground); -+ protected BlockFarmland(int par1) { -+ super(par1, Material.ground); - this.setTickRandomly(true); -- this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 15.0F / 16.0F, 1.0F); -+ this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.9375F, 1.0F); - this.setLightOpacity(255); - } - -- public AxisAlignedBB getCollisionBoundingBoxFromPool(World var1, int var2, int var3, int var4) { -- return AxisAlignedBB.getAABBPool().getAABB((double)(var2 + 0), (double)(var3 + 0), (double)(var4 + 0), (double)(var2 + 1), (double)(var3 + 1), (double)(var4 + 1)); -+ /** -+ * Returns a bounding box from the pool of bounding boxes (this means this box can change after the pool has been -+ * cleared to be reused) -+ */ -+ public AxisAlignedBB getCollisionBoundingBoxFromPool(World par1World, int par2, int par3, int par4) { -+ return AxisAlignedBB.getAABBPool().getAABB((double)(par2 + 0), (double)(par3 + 0), (double)(par4 + 0), (double)(par2 + 1), (double)(par3 + 1), (double)(par4 + 1)); - } - -+ /** -+ * Is this block (a) opaque and (b) a full 1m cube? This determines whether or not to render the shared face of two -+ * adjacent blocks and also whether the player can attach torches, redstone wire, etc to this block. -+ */ - public boolean isOpaqueCube() { - return false; - } - -+ /** -+ * If this block doesn't render as an ordinary block it will return False (examples: signs, buttons, stairs, etc) -+ */ - public boolean renderAsNormalBlock() { - return false; - } - -- public Icon getIcon(int var1, int var2) { -- return var1 == 1 ? (var2 > 0 ? this.field_94441_a : this.field_94440_b) : Block.dirt.getBlockTextureFromSide(var1); -+ /** -+ * From the specified side and block metadata retrieves the blocks texture. Args: side, metadata -+ */ -+ public Icon getIcon(int par1, int par2) { -+ return par1 == 1 ? (par2 > 0 ? this.field_94441_a : this.field_94440_b) : Block.dirt.getBlockTextureFromSide(par1); - } - -- public void updateTick(World var1, int var2, int var3, int var4, Random var5) { -- if(!this.isWaterNearby(var1, var2, var3, var4) && !var1.canLightningStrikeAt(var2, var3 + 1, var4)) { -- int var6 = var1.getBlockMetadata(var2, var3, var4); -- if(var6 > 0) { -- var1.setBlockMetadata(var2, var3, var4, var6 - 1, 2); -- } else if(!this.isCropsNearby(var1, var2, var3, var4)) { -- var1.setBlock(var2, var3, var4, Block.dirt.blockID); -+ /** -+ * Ticks the block if it's been scheduled -+ */ -+ public void updateTick(World par1World, int par2, int par3, int par4, Random par5Random) { -+ if (!this.isWaterNearby(par1World, par2, par3, par4) && !par1World.canLightningStrikeAt(par2, par3 + 1, par4)) { -+ int var6 = par1World.getBlockMetadata(par2, par3, par4); -+ -+ if (var6 > 0) { -+ par1World.setBlockMetadataWithNotify(par2, par3, par4, var6 - 1, 2); -+ } else if (!this.isCropsNearby(par1World, par2, par3, par4)) { -+ par1World.setBlock(par2, par3, par4, Block.dirt.blockID); - } - } else { -- var1.setBlockMetadata(var2, var3, var4, 7, 2); -+ par1World.setBlockMetadataWithNotify(par2, par3, par4, 7, 2); - } -- - } - -- public void onFallenUpon(World var1, int var2, int var3, int var4, Entity var5, float var6) { -- if(!var1.isRemote && var1.s.nextFloat() < var6 - 0.5F) { -- if(!(var5 instanceof EntityPlayer) && !var1.getGameRules().getGameRuleBooleanValue("mobGriefing")) { -+ /** -+ * Block's chance to react to an entity falling on it. -+ */ -+ public void onFallenUpon(World par1World, int par2, int par3, int par4, Entity par5Entity, float par6) { -+ if (!par1World.isRemote && par1World.rand.nextFloat() < par6 - 0.5F) { -+ if (!(par5Entity instanceof EntityPlayer) && !par1World.getGameRules().getGameRuleBooleanValue("mobGriefing")) { - return; - } - -- var1.setBlock(var2, var3, var4, Block.dirt.blockID); -+ par1World.setBlock(par2, par3, par4, Block.dirt.blockID); - } -- - } - -- private boolean isCropsNearby(World var1, int var2, int var3, int var4) { -+ /** -+ * returns true if there is at least one cropblock nearby (x-1 to x+1, y+1, z-1 to z+1) -+ */ -+ private boolean isCropsNearby(World par1World, int par2, int par3, int par4) { - byte var5 = 0; - -- for(int var6 = var2 - var5; var6 <= var2 + var5; ++var6) { -- for(int var7 = var4 - var5; var7 <= var4 + var5; ++var7) { -- int var8 = var1.getBlockId(var6, var3 + 1, var7); -- if(var8 == Block.crops.blockID || var8 == Block.melonStem.blockID || var8 == Block.pumpkinStem.blockID || var8 == Block.potato.blockID || var8 == Block.carrot.blockID) { -+ for (int var6 = par2 - var5; var6 <= par2 + var5; ++var6) { -+ for (int var7 = par4 - var5; var7 <= par4 + var5; ++var7) { -+ int var8 = par1World.getBlockId(var6, par3 + 1, var7); -+ -+ if (var8 == Block.crops.blockID || var8 == Block.melonStem.blockID || var8 == Block.pumpkinStem.blockID || var8 == Block.potato.blockID || var8 == Block.carrot.blockID) { - return true; - } - } -@@ -69,11 +92,14 @@ - return false; - } - -- private boolean isWaterNearby(World var1, int var2, int var3, int var4) { -- for(int var5 = var2 - 4; var5 <= var2 + 4; ++var5) { -- for(int var6 = var3; var6 <= var3 + 1; ++var6) { -- for(int var7 = var4 - 4; var7 <= var4 + 4; ++var7) { -- if(var1.getBlockMaterial(var5, var6, var7) == Material.water) { -+ /** -+ * returns true if there's water nearby (x-4 to x+4, y to y+1, k-4 to k+4) -+ */ -+ private boolean isWaterNearby(World par1World, int par2, int par3, int par4) { -+ for (int var5 = par2 - 4; var5 <= par2 + 4; ++var5) { -+ for (int var6 = par3; var6 <= par3 + 1; ++var6) { -+ for (int var7 = par4 - 4; var7 <= par4 + 4; ++var7) { -+ if (par1World.getBlockMaterial(var5, var6, var7) == Material.water) { - return true; - } - } -@@ -83,25 +109,39 @@ - return false; - } - -- public void onNeighborBlockChange(World var1, int var2, int var3, int var4, int var5) { -- super.onNeighborBlockChange(var1, var2, var3, var4, var5); -- Material var6 = var1.getBlockMaterial(var2, var3 + 1, var4); -- if(var6.isSolid()) { -- var1.setBlock(var2, var3, var4, Block.dirt.blockID); -+ /** -+ * Lets the block know when one of its neighbor changes. Doesn't know which neighbor changed (coordinates passed are -+ * their own) Args: x, y, z, neighbor blockID -+ */ -+ public void onNeighborBlockChange(World par1World, int par2, int par3, int par4, int par5) { -+ super.onNeighborBlockChange(par1World, par2, par3, par4, par5); -+ Material var6 = par1World.getBlockMaterial(par2, par3 + 1, par4); -+ -+ if (var6.isSolid()) { -+ par1World.setBlock(par2, par3, par4, Block.dirt.blockID); - } -- -- } -- -- public int idDropped(int var1, Random var2, int var3) { -- return Block.dirt.idDropped(0, var2, var3); -- } -- -- public int idPicked(World var1, int var2, int var3, int var4) { -+ } -+ -+ /** -+ * Returns the ID of the items to drop on destruction. -+ */ -+ public int idDropped(int par1, Random par2Random, int par3) { -+ return Block.dirt.idDropped(0, par2Random, par3); -+ } -+ -+ /** -+ * only called by clickMiddleMouseButton , and passed to inventory.setCurrentItem (along with isCreative) -+ */ -+ public int idPicked(World par1World, int par2, int par3, int par4) { - return Block.dirt.blockID; - } - -- public void registerIcons(IconRegister var1) { -- this.field_94441_a = var1.registerIcon(this.getTextureName() + "_wet"); -- this.field_94440_b = var1.registerIcon(this.getTextureName() + "_dry"); -+ /** -+ * When this method is called, your block should register all the icons it needs with the given IconRegister. This is -+ * the only chance you get to register icons. -+ */ -+ public void registerIcons(IconRegister par1IconRegister) { -+ this.field_94441_a = par1IconRegister.registerIcon(this.getTextureName() + "_wet"); -+ this.field_94440_b = par1IconRegister.registerIcon(this.getTextureName() + "_dry"); - } - } ---- net/minecraft/src/CommandGameRule.java -+++ net/minecraft/src/CommandGameRule.java -@@ -8,49 +8,59 @@ - return "gamerule"; - } - -+ /** -+ * Return the required permission level for this command. -+ */ - public int getRequiredPermissionLevel() { - return 2; - } - -- public String getCommandUsage(ICommandSender var1) { -+ public String getCommandUsage(ICommandSender par1ICommandSender) { - return "commands.gamerule.usage"; - } - -- public void processCommand(ICommandSender var1, String[] var2) { -+ public void processCommand(ICommandSender par1ICommandSender, String[] par2ArrayOfStr) { - String var6; -- if(var2.length == 2) { -- var6 = var2[0]; -- String var7 = var2[1]; -+ -+ if (par2ArrayOfStr.length == 2) { -+ var6 = par2ArrayOfStr[0]; -+ String var7 = par2ArrayOfStr[1]; - GameRules var8 = this.getGameRules(); -- if(var8.hasRule(var6)) { -+ -+ if (var8.hasRule(var6)) { - var8.setOrCreateGameRule(var6, var7); -- notifyAdmins(var1, "commands.gamerule.success", new Object[0]); -+ notifyAdmins(par1ICommandSender, "commands.gamerule.success", new Object[0]); - } else { -- notifyAdmins(var1, "commands.gamerule.norule", new Object[]{var6}); -+ notifyAdmins(par1ICommandSender, "commands.gamerule.norule", new Object[] {var6}); - } -- -- } else if(var2.length == 1) { -- var6 = var2[0]; -+ } else if (par2ArrayOfStr.length == 1) { -+ var6 = par2ArrayOfStr[0]; - GameRules var4 = this.getGameRules(); -- if(var4.hasRule(var6)) { -+ -+ if (var4.hasRule(var6)) { - String var5 = var4.getGameRuleStringValue(var6); -- var1.sendChatToPlayer(ChatMessageComponent.createFromText(var6).addText(" = ").addText(var5)); -+ par1ICommandSender.sendChatToPlayer(ChatMessageComponent.createFromText(var6).addText(" = ").addText(var5)); - } else { -- notifyAdmins(var1, "commands.gamerule.norule", new Object[]{var6}); -+ notifyAdmins(par1ICommandSender, "commands.gamerule.norule", new Object[] {var6}); - } -- -- } else if(var2.length == 0) { -+ } else if (par2ArrayOfStr.length == 0) { - GameRules var3 = this.getGameRules(); -- var1.sendChatToPlayer(ChatMessageComponent.createFromText(joinNiceString(var3.getRules()))); -+ par1ICommandSender.sendChatToPlayer(ChatMessageComponent.createFromText(joinNiceString(var3.getRules()))); - } else { - throw new WrongUsageException("commands.gamerule.usage", new Object[0]); - } - } - -- public List addTabCompletionOptions(ICommandSender var1, String[] var2) { -- return var2.length == 1 ? getListOfStringsMatchingLastWord(var2, this.getGameRules().getRules()) : (var2.length == 2 ? getListOfStringsMatchingLastWord(var2, new String[]{"true", "false"}) : null); -+ /** -+ * Adds the strings available in this command to the given list of tab completion options. -+ */ -+ public List addTabCompletionOptions(ICommandSender par1ICommandSender, String[] par2ArrayOfStr) { -+ return par2ArrayOfStr.length == 1 ? getListOfStringsMatchingLastWord(par2ArrayOfStr, this.getGameRules().getRules()) : (par2ArrayOfStr.length == 2 ? getListOfStringsMatchingLastWord(par2ArrayOfStr, new String[] {"true", "false"}): null); - } - -+ /** -+ * Return the game rule set this command should be able to manipulate. -+ */ - private GameRules getGameRules() { - return MinecraftServer.getServer().worldServerForDimension(0).getGameRules(); - } ---- net/minecraft/src/PotionAttackDamage.java -+++ net/minecraft/src/PotionAttackDamage.java -@@ -1,11 +1,11 @@ - package net.minecraft.src; - - public class PotionAttackDamage extends Potion { -- protected PotionAttackDamage(int var1, boolean var2, int var3) { -- super(var1, var2, var3); -+ protected PotionAttackDamage(int par1, boolean par2, int par3) { -+ super(par1, par2, par3); - } - -- public double func_111183_a(int var1, AttributeModifier var2) { -- return this.id == Potion.weakness.id ? (double)(-0.5F * (float)(var1 + 1)) : 1.3D * (double)(var1 + 1); -+ public double func_111183_a(int par1, AttributeModifier par2AttributeModifier) { -+ return this.id == Potion.weakness.id ? (double)(-0.5F * (float)(par1 + 1)) : 1.3D * (double)(par1 + 1); - } - } ---- net/minecraft/src/WorldGenDesertWells.java -+++ net/minecraft/src/WorldGenDesertWells.java -@@ -3,67 +3,69 @@ - import java.util.Random; - - public class WorldGenDesertWells extends WorldGenerator { -- public boolean generate(World var1, Random var2, int var3, int var4, int var5) { -- while(var1.isAirBlock(var3, var4, var5) && var4 > 2) { -- --var4; -+ public boolean generate(World par1World, Random par2Random, int par3, int par4, int par5) { -+ while (par1World.isAirBlock(par3, par4, par5) && par4 > 2) { -+ --par4; - } - -- int var6 = var1.getBlockId(var3, var4, var5); -- if(var6 != Block.sand.blockID) { -+ int var6 = par1World.getBlockId(par3, par4, par5); -+ -+ if (var6 != Block.sand.blockID) { - return false; - } else { - int var7; - int var8; -- for(var7 = -2; var7 <= 2; ++var7) { -- for(var8 = -2; var8 <= 2; ++var8) { -- if(var1.isAirBlock(var3 + var7, var4 - 1, var5 + var8) && var1.isAirBlock(var3 + var7, var4 - 2, var5 + var8)) { -+ -+ for (var7 = -2; var7 <= 2; ++var7) { -+ for (var8 = -2; var8 <= 2; ++var8) { -+ if (par1World.isAirBlock(par3 + var7, par4 - 1, par5 + var8) && par1World.isAirBlock(par3 + var7, par4 - 2, par5 + var8)) { - return false; - } - } - } - -- for(var7 = -1; var7 <= 0; ++var7) { -- for(var8 = -2; var8 <= 2; ++var8) { -- for(int var9 = -2; var9 <= 2; ++var9) { -- var1.setBlock(var3 + var8, var4 + var7, var5 + var9, Block.sandStone.blockID, 0, 2); -- } -- } -- } -- -- var1.setBlock(var3, var4, var5, Block.waterMoving.blockID, 0, 2); -- var1.setBlock(var3 - 1, var4, var5, Block.waterMoving.blockID, 0, 2); -- var1.setBlock(var3 + 1, var4, var5, Block.waterMoving.blockID, 0, 2); -- var1.setBlock(var3, var4, var5 - 1, Block.waterMoving.blockID, 0, 2); -- var1.setBlock(var3, var4, var5 + 1, Block.waterMoving.blockID, 0, 2); -- -- for(var7 = -2; var7 <= 2; ++var7) { -- for(var8 = -2; var8 <= 2; ++var8) { -- if(var7 == -2 || var7 == 2 || var8 == -2 || var8 == 2) { -- var1.setBlock(var3 + var7, var4 + 1, var5 + var8, Block.sandStone.blockID, 0, 2); -- } -- } -- } -- -- var1.setBlock(var3 + 2, var4 + 1, var5, Block.stoneSingleSlab.blockID, 1, 2); -- var1.setBlock(var3 - 2, var4 + 1, var5, Block.stoneSingleSlab.blockID, 1, 2); -- var1.setBlock(var3, var4 + 1, var5 + 2, Block.stoneSingleSlab.blockID, 1, 2); -- var1.setBlock(var3, var4 + 1, var5 - 2, Block.stoneSingleSlab.blockID, 1, 2); -- -- for(var7 = -1; var7 <= 1; ++var7) { -- for(var8 = -1; var8 <= 1; ++var8) { -- if(var7 == 0 && var8 == 0) { -- var1.setBlock(var3 + var7, var4 + 4, var5 + var8, Block.sandStone.blockID, 0, 2); -+ for (var7 = -1; var7 <= 0; ++var7) { -+ for (var8 = -2; var8 <= 2; ++var8) { -+ for (int var9 = -2; var9 <= 2; ++var9) { -+ par1World.setBlock(par3 + var8, par4 + var7, par5 + var9, Block.sandStone.blockID, 0, 2); -+ } -+ } -+ } -+ -+ par1World.setBlock(par3, par4, par5, Block.waterMoving.blockID, 0, 2); -+ par1World.setBlock(par3 - 1, par4, par5, Block.waterMoving.blockID, 0, 2); -+ par1World.setBlock(par3 + 1, par4, par5, Block.waterMoving.blockID, 0, 2); -+ par1World.setBlock(par3, par4, par5 - 1, Block.waterMoving.blockID, 0, 2); -+ par1World.setBlock(par3, par4, par5 + 1, Block.waterMoving.blockID, 0, 2); -+ -+ for (var7 = -2; var7 <= 2; ++var7) { -+ for (var8 = -2; var8 <= 2; ++var8) { -+ if (var7 == -2 || var7 == 2 || var8 == -2 || var8 == 2) { -+ par1World.setBlock(par3 + var7, par4 + 1, par5 + var8, Block.sandStone.blockID, 0, 2); -+ } -+ } -+ } -+ -+ par1World.setBlock(par3 + 2, par4 + 1, par5, Block.stoneSingleSlab.blockID, 1, 2); -+ par1World.setBlock(par3 - 2, par4 + 1, par5, Block.stoneSingleSlab.blockID, 1, 2); -+ par1World.setBlock(par3, par4 + 1, par5 + 2, Block.stoneSingleSlab.blockID, 1, 2); -+ par1World.setBlock(par3, par4 + 1, par5 - 2, Block.stoneSingleSlab.blockID, 1, 2); -+ -+ for (var7 = -1; var7 <= 1; ++var7) { -+ for (var8 = -1; var8 <= 1; ++var8) { -+ if (var7 == 0 && var8 == 0) { -+ par1World.setBlock(par3 + var7, par4 + 4, par5 + var8, Block.sandStone.blockID, 0, 2); - } else { -- var1.setBlock(var3 + var7, var4 + 4, var5 + var8, Block.stoneSingleSlab.blockID, 1, 2); -+ par1World.setBlock(par3 + var7, par4 + 4, par5 + var8, Block.stoneSingleSlab.blockID, 1, 2); - } - } - } - -- for(var7 = 1; var7 <= 3; ++var7) { -- var1.setBlock(var3 - 1, var4 + var7, var5 - 1, Block.sandStone.blockID, 0, 2); -- var1.setBlock(var3 - 1, var4 + var7, var5 + 1, Block.sandStone.blockID, 0, 2); -- var1.setBlock(var3 + 1, var4 + var7, var5 - 1, Block.sandStone.blockID, 0, 2); -- var1.setBlock(var3 + 1, var4 + var7, var5 + 1, Block.sandStone.blockID, 0, 2); -+ for (var7 = 1; var7 <= 3; ++var7) { -+ par1World.setBlock(par3 - 1, par4 + var7, par5 - 1, Block.sandStone.blockID, 0, 2); -+ par1World.setBlock(par3 - 1, par4 + var7, par5 + 1, Block.sandStone.blockID, 0, 2); -+ par1World.setBlock(par3 + 1, par4 + var7, par5 - 1, Block.sandStone.blockID, 0, 2); -+ par1World.setBlock(par3 + 1, par4 + var7, par5 + 1, Block.sandStone.blockID, 0, 2); - } - - return true; ---- net/minecraft/src/GameSettings.java -+++ net/minecraft/src/GameSettings.java -@@ -5,18 +5,23 @@ - import java.io.FileReader; - import java.io.FileWriter; - import java.io.PrintWriter; -+ - import org.lwjgl.input.Keyboard; - import org.lwjgl.input.Mouse; - import org.lwjgl.opengl.Display; - - public class GameSettings { -- private static final String[] ao = new String[]{"options.renderDistance.far", "options.renderDistance.normal", "options.renderDistance.short", "options.renderDistance.tiny"}; -- private static final String[] ap = new String[]{"options.difficulty.peaceful", "options.difficulty.easy", "options.difficulty.normal", "options.difficulty.hard"}; -- private static final String[] aq = new String[]{"options.guiScale.auto", "options.guiScale.small", "options.guiScale.normal", "options.guiScale.large"}; -- private static final String[] ar = new String[]{"options.chat.visibility.full", "options.chat.visibility.system", "options.chat.visibility.hidden"}; -- private static final String[] as = new String[]{"options.particles.all", "options.particles.decreased", "options.particles.minimal"}; -- private static final String[] at = new String[]{"performance.max", "performance.balanced", "performance.powersaver"}; -- private static final String[] au = new String[]{"options.ao.off", "options.ao.min", "options.ao.max"}; -+ private static final String[] RENDER_DISTANCES = new String[] {"options.renderDistance.far", "options.renderDistance.normal", "options.renderDistance.short", "options.renderDistance.tiny"}; -+ private static final String[] DIFFICULTIES = new String[] {"options.difficulty.peaceful", "options.difficulty.easy", "options.difficulty.normal", "options.difficulty.hard"}; -+ -+ /** GUI scale values */ -+ private static final String[] GUISCALES = new String[] {"options.guiScale.auto", "options.guiScale.small", "options.guiScale.normal", "options.guiScale.large"}; -+ private static final String[] CHAT_VISIBILITIES = new String[] {"options.chat.visibility.full", "options.chat.visibility.system", "options.chat.visibility.hidden"}; -+ private static final String[] PARTICLES = new String[] {"options.particles.all", "options.particles.decreased", "options.particles.minimal"}; -+ -+ /** Limit framerate labels */ -+ private static final String[] LIMIT_FRAMERATES = new String[] {"performance.max", "performance.balanced", "performance.powersaver"}; -+ private static final String[] AMBIENT_OCCLUSIONS = new String[] {"options.ao.off", "options.ao.min", "options.ao.max"}; - public float musicVolume = 1.0F; - public float soundVolume = 1.0F; - public float mouseSensitivity = 0.5F; -@@ -24,12 +29,20 @@ - public int renderDistance; - public boolean viewBobbing = true; - public boolean anaglyph; -+ -+ /** Advanced OpenGL */ - public boolean advancedOpengl; - public int limitFramerate = 1; - public boolean fancyGraphics = true; -+ -+ /** Smooth Lighting */ - public int ambientOcclusion = 2; -+ -+ /** Clouds flag */ - public boolean clouds = true; -- public String m = "Default"; -+ -+ /** The name of the selected texture pack. */ -+ public String skin = "Default"; - public int chatVisibility; - public boolean chatColours = true; - public boolean chatLinks = true; -@@ -40,8 +53,16 @@ - public boolean fullScreen; - public boolean enableVsync = true; - public boolean hideServerAddress; -+ -+ /** -+ * Whether to show advanced information on item tooltips, toggled by F3+H -+ */ - public boolean advancedItemTooltips; -+ -+ /** Whether to pause when the game loses focus, toggled by F3+P */ - public boolean pauseOnLostFocus = true; -+ -+ /** Whether to show your cape */ - public boolean showCape = true; - public boolean touchscreen; - public int overrideWidth; -@@ -50,7 +71,7 @@ - public float chatScale = 1.0F; - public float chatWidth = 1.0F; - public float chatHeightUnfocused = 0.44366196F; -- public float chatHeightFocused = 1.0F; -+ public float chatHeightFocused = 1.0F; - public KeyBinding keyBindForward = new KeyBinding("key.forward", 17); - public KeyBinding keyBindLeft = new KeyBinding("key.left", 30); - public KeyBinding keyBindBack = new KeyBinding("key.back", 31); -@@ -65,200 +86,267 @@ - public KeyBinding keyBindPlayerList = new KeyBinding("key.playerlist", 15); - public KeyBinding keyBindPickBlock = new KeyBinding("key.pickItem", -98); - public KeyBinding keyBindCommand = new KeyBinding("key.command", 53); -- public KeyBinding[] keyBindings = new KeyBinding[]{this.keyBindAttack, this.keyBindUseItem, this.keyBindForward, this.keyBindLeft, this.keyBindBack, this.keyBindRight, this.keyBindJump, this.keyBindSneak, this.keyBindDrop, this.keyBindInventory, this.keyBindChat, this.keyBindPlayerList, this.keyBindPickBlock, this.keyBindCommand}; -+ // Spout Start -+ public KeyBinding keyBindToggleFog = new KeyBinding("Toggle Fog", Keyboard.KEY_F); -+ public final KeyBinding keySneakToggle = new KeyBinding("Sneak Toggle", Keyboard.KEY_LCONTROL); -+ public final KeyBinding keyRunToggle = new KeyBinding("Run Toggle", Keyboard.KEY_RCONTROL); -+ public final KeyBinding keyTreadWaterToggle = new KeyBinding("Tread Water Toggle", Keyboard.KEY_Z); -+ public final KeyBinding keyAutoForward = new KeyBinding("Forward Toggle", Keyboard.KEY_G); -+ public final KeyBinding keyAutoBackward = new KeyBinding("Backward Toggle", Keyboard.KEY_H); -+ public final KeyBinding keyFlyToggle = new KeyBinding("Fly Toggle", Keyboard.KEY_O); -+ public final KeyBinding keyFlyForward = new KeyBinding("Fly Foward", 17); -+ public final KeyBinding keyFlyLeft = new KeyBinding("Fly Left", 30); -+ public final KeyBinding keyFlyBack = new KeyBinding("Fly Back", 31); -+ public final KeyBinding keyFlyRight = new KeyBinding("Fly Right", 32); -+ public final KeyBinding keyFlyUp = new KeyBinding("Fly Up", Keyboard.KEY_SPACE); -+ public final KeyBinding keyFlyDown = new KeyBinding("Fly Down", Keyboard.KEY_LSHIFT); -+ public final KeyBinding keyWaypoint = new KeyBinding("Overview Map", Keyboard.KEY_P); -+ public final KeyBinding keyHideChat = new KeyBinding("Hide Chat", Keyboard.KEY_M); -+ public final KeyBinding[] spoutcraftBindings = {keyBindToggleFog, keySneakToggle, keyRunToggle, keyTreadWaterToggle, keyAutoForward, -+ keyAutoBackward, keyFlyToggle, keyFlyForward, keyFlyLeft, keyFlyBack, keyFlyRight, keyFlyUp, keyFlyDown, keyWaypoint, keyHideChat}; -+ // Spout End -+ public KeyBinding[] keyBindings; - protected Minecraft mc; -- private File av; -- public int difficulty = 2; -+ private File optionsFile; -+ public int difficulty; - public boolean hideGUI; - public int thirdPersonView; -+ -+ /** true if debug info should be displayed instead of version */ - public boolean showDebugInfo; - public boolean showDebugProfilerChart; -- public String ad = ""; -+ -+ /** The lastServer string. */ -+ public String lastServer; -+ -+ /** No clipping for singleplayer */ - public boolean noclip; -+ -+ /** Smooth Camera Toggle */ - public boolean smoothCamera; - public boolean debugCamEnable; -- public float noclipRate = 1.0F; -- public float debugCamRate = 1.0F; -+ -+ /** No clipping movement rate */ -+ public float noclipRate; -+ -+ /** Change rate for debug camera */ -+ public float debugCamRate; - public float fovSetting; - public float gammaSetting; -+ -+ /** GUI scale */ - public int guiScale; -+ -+ /** Determines amount of particles. 0 = All, 1 = Decreased, 2 = Minimal */ - public int particleSetting; -- public String an = "en_US"; -- -- public GameSettings(Minecraft var1, File var2) { -- this.mc = var1; -- this.av = new File(var2, "options.txt"); -+ -+ /** Game settings language */ -+ public String language; -+ -+ public GameSettings(Minecraft par1Minecraft, File par2File) { -+ this.keyBindings = new KeyBinding[] {this.keyBindAttack, this.keyBindUseItem, this.keyBindForward, this.keyBindLeft, this.keyBindBack, this.keyBindRight, this.keyBindJump, this.keyBindSneak, this.keyBindDrop, this.keyBindInventory, this.keyBindChat, this.keyBindPlayerList, this.keyBindPickBlock, this.keyBindCommand}; -+ this.difficulty = 2; -+ this.lastServer = ""; -+ this.noclipRate = 1.0F; -+ this.debugCamRate = 1.0F; -+ this.language = "en_US"; -+ this.mc = par1Minecraft; -+ this.optionsFile = new File(par2File, "options.txt"); - this.loadOptions(); - } - - public GameSettings() { -- } -- -- public String getKeyBindingDescription(int var1) { -- return I18n.getString(this.keyBindings[var1].c); -- } -- -- public String getOptionDisplayString(int var1) { -- int var2 = this.keyBindings[var1].keyCode; -+ this.keyBindings = new KeyBinding[] {this.keyBindAttack, this.keyBindUseItem, this.keyBindForward, this.keyBindLeft, this.keyBindBack, this.keyBindRight, this.keyBindJump, this.keyBindSneak, this.keyBindDrop, this.keyBindInventory, this.keyBindChat, this.keyBindPlayerList, this.keyBindPickBlock, this.keyBindCommand}; -+ this.difficulty = 2; -+ this.lastServer = ""; -+ this.noclipRate = 1.0F; -+ this.debugCamRate = 1.0F; -+ this.language = "en_US"; -+ } -+ -+ public String getKeyBindingDescription(int par1) { -+ return I18n.getString(this.keyBindings[par1].keyDescription); -+ } -+ -+ /** -+ * The string that appears inside the button/slider in the options menu. -+ */ -+ public String getOptionDisplayString(int par1) { -+ int var2 = this.keyBindings[par1].keyCode; - return getKeyDisplayString(var2); - } - -- public static String getKeyDisplayString(int var0) { -- return var0 < 0 ? I18n.getStringParams("key.mouseButton", new Object[]{Integer.valueOf(var0 + 101)}) : Keyboard.getKeyName(var0); -- } -- -- public static boolean isKeyDown(KeyBinding var0) { -- return var0.keyCode < 0 ? Mouse.isButtonDown(var0.keyCode + 100) : Keyboard.isKeyDown(var0.keyCode); -- } -- -- public void setKeyBinding(int var1, int var2) { -- this.keyBindings[var1].keyCode = var2; -+ /** -+ * Represents a key or mouse button as a string. Args: key -+ */ -+ public static String getKeyDisplayString(int par0) { -+ return par0 < 0 ? I18n.getStringParams("key.mouseButton", new Object[] {Integer.valueOf(par0 + 101)}): Keyboard.getKeyName(par0); -+ } -+ -+ /** -+ * Returns whether the specified key binding is currently being pressed. -+ */ -+ public static boolean isKeyDown(KeyBinding par0KeyBinding) { -+ return par0KeyBinding.keyCode < 0 ? Mouse.isButtonDown(par0KeyBinding.keyCode + 100) : Keyboard.isKeyDown(par0KeyBinding.keyCode); -+ } -+ -+ /** -+ * Sets a key binding. -+ */ -+ public void setKeyBinding(int par1, int par2) { -+ this.keyBindings[par1].keyCode = par2; - this.saveOptions(); - } - -- public void setOptionFloatValue(EnumOptions var1, float var2) { -- if(var1 == EnumOptions.MUSIC) { -- this.musicVolume = var2; -- this.mc.sndManager.onSoundOptionsChanged(); -- } -- -- if(var1 == EnumOptions.SOUND) { -- this.soundVolume = var2; -- this.mc.sndManager.onSoundOptionsChanged(); -- } -- -- if(var1 == EnumOptions.SENSITIVITY) { -- this.mouseSensitivity = var2; -- } -- -- if(var1 == EnumOptions.FOV) { -- this.fovSetting = var2; -- } -- -- if(var1 == EnumOptions.GAMMA) { -- this.gammaSetting = var2; -- } -- -- if(var1 == EnumOptions.CHAT_OPACITY) { -- this.chatOpacity = var2; -- this.mc.ingameGUI.getChatGUI().func_96132_b(); -- } -- -- if(var1 == EnumOptions.CHAT_HEIGHT_FOCUSED) { -- this.chatHeightFocused = var2; -- this.mc.ingameGUI.getChatGUI().func_96132_b(); -- } -- -- if(var1 == EnumOptions.CHAT_HEIGHT_UNFOCUSED) { -- this.chatHeightUnfocused = var2; -- this.mc.ingameGUI.getChatGUI().func_96132_b(); -- } -- -- if(var1 == EnumOptions.CHAT_WIDTH) { -- this.chatWidth = var2; -- this.mc.ingameGUI.getChatGUI().func_96132_b(); -- } -- -- if(var1 == EnumOptions.CHAT_SCALE) { -- this.chatScale = var2; -- this.mc.ingameGUI.getChatGUI().func_96132_b(); -- } -- -+ /** -+ * If the specified option is controlled by a slider (float value), this will set the float value. -+ */ -+ public void setOptionFloatValue(EnumOptions par1EnumOptions, float par2) { -+ if (par1EnumOptions == EnumOptions.MUSIC) { -+ this.musicVolume = par2; -+ this.mc.sndManager.onSoundOptionsChanged(); -+ } -+ -+ if (par1EnumOptions == EnumOptions.SOUND) { -+ this.soundVolume = par2; -+ this.mc.sndManager.onSoundOptionsChanged(); -+ } -+ -+ if (par1EnumOptions == EnumOptions.SENSITIVITY) { -+ this.mouseSensitivity = par2; -+ } -+ -+ if (par1EnumOptions == EnumOptions.FOV) { -+ this.fovSetting = par2; -+ } -+ -+ if (par1EnumOptions == EnumOptions.GAMMA) { -+ this.gammaSetting = par2; -+ } -+ -+ if (par1EnumOptions == EnumOptions.CHAT_OPACITY) { -+ this.chatOpacity = par2; -+ this.mc.ingameGUI.getChatGUI().func_96132_b(); -+ } -+ -+ if (par1EnumOptions == EnumOptions.CHAT_HEIGHT_FOCUSED) { -+ this.chatHeightFocused = par2; -+ this.mc.ingameGUI.getChatGUI().func_96132_b(); -+ } -+ -+ if (par1EnumOptions == EnumOptions.CHAT_HEIGHT_UNFOCUSED) { -+ this.chatHeightUnfocused = par2; -+ this.mc.ingameGUI.getChatGUI().func_96132_b(); -+ } -+ -+ if (par1EnumOptions == EnumOptions.CHAT_WIDTH) { -+ this.chatWidth = par2; -+ this.mc.ingameGUI.getChatGUI().func_96132_b(); -+ } -+ -+ if (par1EnumOptions == EnumOptions.CHAT_SCALE) { -+ this.chatScale = par2; -+ this.mc.ingameGUI.getChatGUI().func_96132_b(); -+ } - } - -- public void setOptionValue(EnumOptions var1, int var2) { -- if(var1 == EnumOptions.INVERT_MOUSE) { -+ /** -+ * For non-float options. Toggles the option on/off, or cycles through the list i.e. render distances. -+ */ -+ public void setOptionValue(EnumOptions par1EnumOptions, int par2) { -+ if (par1EnumOptions == EnumOptions.INVERT_MOUSE) { - this.invertMouse = !this.invertMouse; - } - -- if(var1 == EnumOptions.RENDER_DISTANCE) { -- this.renderDistance = this.renderDistance + var2 & 3; -- } -- -- if(var1 == EnumOptions.GUI_SCALE) { -- this.guiScale = this.guiScale + var2 & 3; -- } -- -- if(var1 == EnumOptions.PARTICLES) { -- this.particleSetting = (this.particleSetting + var2) % 3; -- } -- -- if(var1 == EnumOptions.VIEW_BOBBING) { -+ if (par1EnumOptions == EnumOptions.RENDER_DISTANCE) { -+ this.renderDistance = this.renderDistance + par2 & 3; -+ } -+ -+ if (par1EnumOptions == EnumOptions.GUI_SCALE) { -+ this.guiScale = this.guiScale + par2 & 3; -+ } -+ -+ if (par1EnumOptions == EnumOptions.PARTICLES) { -+ this.particleSetting = (this.particleSetting + par2) % 3; -+ } -+ -+ if (par1EnumOptions == EnumOptions.VIEW_BOBBING) { - this.viewBobbing = !this.viewBobbing; - } - -- if(var1 == EnumOptions.RENDER_CLOUDS) { -+ if (par1EnumOptions == EnumOptions.RENDER_CLOUDS) { - this.clouds = !this.clouds; - } - -- if(var1 == EnumOptions.ADVANCED_OPENGL) { -+ if (par1EnumOptions == EnumOptions.ADVANCED_OPENGL) { - this.advancedOpengl = !this.advancedOpengl; - this.mc.renderGlobal.loadRenderers(); - } - -- if(var1 == EnumOptions.ANAGLYPH) { -+ if (par1EnumOptions == EnumOptions.ANAGLYPH) { - this.anaglyph = !this.anaglyph; - this.mc.refreshResources(); - } - -- if(var1 == EnumOptions.FRAMERATE_LIMIT) { -- this.limitFramerate = (this.limitFramerate + var2 + 3) % 3; -- } -- -- if(var1 == EnumOptions.DIFFICULTY) { -- this.difficulty = this.difficulty + var2 & 3; -- } -- -- if(var1 == EnumOptions.GRAPHICS) { -+ if (par1EnumOptions == EnumOptions.FRAMERATE_LIMIT) { -+ this.limitFramerate = (this.limitFramerate + par2 + 3) % 3; -+ } -+ -+ if (par1EnumOptions == EnumOptions.DIFFICULTY) { -+ this.difficulty = this.difficulty + par2 & 3; -+ } -+ -+ if (par1EnumOptions == EnumOptions.GRAPHICS) { - this.fancyGraphics = !this.fancyGraphics; - this.mc.renderGlobal.loadRenderers(); - } - -- if(var1 == EnumOptions.AMBIENT_OCCLUSION) { -- this.ambientOcclusion = (this.ambientOcclusion + var2) % 3; -+ if (par1EnumOptions == EnumOptions.AMBIENT_OCCLUSION) { -+ this.ambientOcclusion = (this.ambientOcclusion + par2) % 3; - this.mc.renderGlobal.loadRenderers(); - } - -- if(var1 == EnumOptions.CHAT_VISIBILITY) { -- this.chatVisibility = (this.chatVisibility + var2) % 3; -+ if (par1EnumOptions == EnumOptions.CHAT_VISIBILITY) { -+ this.chatVisibility = (this.chatVisibility + par2) % 3; - } - -- if(var1 == EnumOptions.CHAT_COLOR) { -+ if (par1EnumOptions == EnumOptions.CHAT_COLOR) { - this.chatColours = !this.chatColours; - } - -- if(var1 == EnumOptions.CHAT_LINKS) { -+ if (par1EnumOptions == EnumOptions.CHAT_LINKS) { - this.chatLinks = !this.chatLinks; - } - -- if(var1 == EnumOptions.CHAT_LINKS_PROMPT) { -+ if (par1EnumOptions == EnumOptions.CHAT_LINKS_PROMPT) { - this.chatLinksPrompt = !this.chatLinksPrompt; - } - -- if(var1 == EnumOptions.USE_SERVER_TEXTURES) { -+ if (par1EnumOptions == EnumOptions.USE_SERVER_TEXTURES) { - this.serverTextures = !this.serverTextures; - } - -- if(var1 == EnumOptions.SNOOPER_ENABLED) { -+ if (par1EnumOptions == EnumOptions.SNOOPER_ENABLED) { - this.snooperEnabled = !this.snooperEnabled; - } - -- if(var1 == EnumOptions.SHOW_CAPE) { -+ if (par1EnumOptions == EnumOptions.SHOW_CAPE) { - this.showCape = !this.showCape; - } - -- if(var1 == EnumOptions.TOUCHSCREEN) { -+ if (par1EnumOptions == EnumOptions.TOUCHSCREEN) { - this.touchscreen = !this.touchscreen; - } - -- if(var1 == EnumOptions.USE_FULLSCREEN) { -+ if (par1EnumOptions == EnumOptions.USE_FULLSCREEN) { - this.fullScreen = !this.fullScreen; -- if(this.mc.isFullScreen() != this.fullScreen) { -+ -+ if (this.mc.isFullScreen() != this.fullScreen) { - this.mc.toggleFullscreen(); - } - } - -- if(var1 == EnumOptions.ENABLE_VSYNC) { -+ if (par1EnumOptions == EnumOptions.ENABLE_VSYNC) { - this.enableVsync = !this.enableVsync; - Display.setVSyncEnabled(this.enableVsync); - } -@@ -266,77 +354,99 @@ - this.saveOptions(); - } - -- public float getOptionFloatValue(EnumOptions var1) { -- return var1 == EnumOptions.FOV ? this.fovSetting : (var1 == EnumOptions.GAMMA ? this.gammaSetting : (var1 == EnumOptions.MUSIC ? this.musicVolume : (var1 == EnumOptions.SOUND ? this.soundVolume : (var1 == EnumOptions.SENSITIVITY ? this.mouseSensitivity : (var1 == EnumOptions.CHAT_OPACITY ? this.chatOpacity : (var1 == EnumOptions.CHAT_HEIGHT_FOCUSED ? this.chatHeightFocused : (var1 == EnumOptions.CHAT_HEIGHT_UNFOCUSED ? this.chatHeightUnfocused : (var1 == EnumOptions.CHAT_SCALE ? this.chatScale : (var1 == EnumOptions.CHAT_WIDTH ? this.chatWidth : 0.0F))))))))); -- } -- -- public boolean getOptionOrdinalValue(EnumOptions var1) { -- switch(EnumOptionsHelper.enumOptionsMappingHelperArray[var1.ordinal()]) { -- case 1: -- return this.invertMouse; -- case 2: -- return this.viewBobbing; -- case 3: -- return this.anaglyph; -- case 4: -- return this.advancedOpengl; -- case 5: -- return this.clouds; -- case 6: -- return this.chatColours; -- case 7: -- return this.chatLinks; -- case 8: -- return this.chatLinksPrompt; -- case 9: -- return this.serverTextures; -- case 10: -- return this.snooperEnabled; -- case 11: -- return this.fullScreen; -- case 12: -- return this.enableVsync; -- case 13: -- return this.showCape; -- case 14: -- return this.touchscreen; -- default: -- return false; -- } -- } -- -- private static String getTranslation(String[] var0, int var1) { -- if(var1 < 0 || var1 >= var0.length) { -- var1 = 0; -- } -- -- return I18n.getString(var0[var1]); -- } -- -- public String getKeyBinding(EnumOptions var1) { -- String var2 = I18n.getString(var1.getEnumString()) + ": "; -- if(var1.getEnumFloat()) { -- float var5 = this.getOptionFloatValue(var1); -- return var1 == EnumOptions.SENSITIVITY ? (var5 == 0.0F ? var2 + I18n.getString("options.sensitivity.min") : (var5 == 1.0F ? var2 + I18n.getString("options.sensitivity.max") : var2 + (int)(var5 * 200.0F) + "%")) : (var1 == EnumOptions.FOV ? (var5 == 0.0F ? var2 + I18n.getString("options.fov.min") : (var5 == 1.0F ? var2 + I18n.getString("options.fov.max") : var2 + (int)(70.0F + var5 * 40.0F))) : (var1 == EnumOptions.GAMMA ? (var5 == 0.0F ? var2 + I18n.getString("options.gamma.min") : (var5 == 1.0F ? var2 + I18n.getString("options.gamma.max") : var2 + "+" + (int)(var5 * 100.0F) + "%")) : (var1 == EnumOptions.CHAT_OPACITY ? var2 + (int)(var5 * 90.0F + 10.0F) + "%" : (var1 == EnumOptions.CHAT_HEIGHT_UNFOCUSED ? var2 + GuiNewChat.func_96130_b(var5) + "px" : (var1 == EnumOptions.CHAT_HEIGHT_FOCUSED ? var2 + GuiNewChat.func_96130_b(var5) + "px" : (var1 == EnumOptions.CHAT_WIDTH ? var2 + GuiNewChat.func_96128_a(var5) + "px" : (var5 == 0.0F ? var2 + I18n.getString("options.off") : var2 + (int)(var5 * 100.0F) + "%"))))))); -- } else if(var1.getEnumBoolean()) { -- boolean var4 = this.getOptionOrdinalValue(var1); -+ public float getOptionFloatValue(EnumOptions par1EnumOptions) { -+ return par1EnumOptions == EnumOptions.FOV ? this.fovSetting : (par1EnumOptions == EnumOptions.GAMMA ? this.gammaSetting : (par1EnumOptions == EnumOptions.MUSIC ? this.musicVolume : (par1EnumOptions == EnumOptions.SOUND ? this.soundVolume : (par1EnumOptions == EnumOptions.SENSITIVITY ? this.mouseSensitivity : (par1EnumOptions == EnumOptions.CHAT_OPACITY ? this.chatOpacity : (par1EnumOptions == EnumOptions.CHAT_HEIGHT_FOCUSED ? this.chatHeightFocused : (par1EnumOptions == EnumOptions.CHAT_HEIGHT_UNFOCUSED ? this.chatHeightUnfocused : (par1EnumOptions == EnumOptions.CHAT_SCALE ? this.chatScale : (par1EnumOptions == EnumOptions.CHAT_WIDTH ? this.chatWidth : 0.0F))))))))); -+ } -+ -+ public boolean getOptionOrdinalValue(EnumOptions par1EnumOptions) { -+ switch (EnumOptionsHelper.enumOptionsMappingHelperArray[par1EnumOptions.ordinal()]) { -+ case 1: -+ return this.invertMouse; -+ -+ case 2: -+ return this.viewBobbing; -+ -+ case 3: -+ return this.anaglyph; -+ -+ case 4: -+ return this.advancedOpengl; -+ -+ case 5: -+ return this.clouds; -+ -+ case 6: -+ return this.chatColours; -+ -+ case 7: -+ return this.chatLinks; -+ -+ case 8: -+ return this.chatLinksPrompt; -+ -+ case 9: -+ return this.serverTextures; -+ -+ case 10: -+ return this.snooperEnabled; -+ -+ case 11: -+ return this.fullScreen; -+ -+ case 12: -+ return this.enableVsync; -+ -+ case 13: -+ return this.showCape; -+ -+ case 14: -+ return this.touchscreen; -+ -+ default: -+ return false; -+ } -+ } -+ -+ /** -+ * Returns the translation of the given index in the given String array. If the index is smaller than 0 or greater -+ * than/equal to the length of the String array, it is changed to 0. -+ */ -+ private static String getTranslation(String[] par0ArrayOfStr, int par1) { -+ if (par1 < 0 || par1 >= par0ArrayOfStr.length) { -+ par1 = 0; -+ } -+ -+ return I18n.getString(par0ArrayOfStr[par1]); -+ } -+ -+ /** -+ * Gets a key binding. -+ */ -+ public String getKeyBinding(EnumOptions par1EnumOptions) { -+ String var2 = I18n.getString(par1EnumOptions.getEnumString()) + ": "; -+ -+ if (par1EnumOptions.getEnumFloat()) { -+ float var5 = this.getOptionFloatValue(par1EnumOptions); -+ return par1EnumOptions == EnumOptions.SENSITIVITY ? (var5 == 0.0F ? var2 + I18n.getString("options.sensitivity.min") : (var5 == 1.0F ? var2 + I18n.getString("options.sensitivity.max") : var2 + (int)(var5 * 200.0F) + "%")) : (par1EnumOptions == EnumOptions.FOV ? (var5 == 0.0F ? var2 + I18n.getString("options.fov.min") : (var5 == 1.0F ? var2 + I18n.getString("options.fov.max") : var2 + (int)(70.0F + var5 * 40.0F))) : (par1EnumOptions == EnumOptions.GAMMA ? (var5 == 0.0F ? var2 + I18n.getString("options.gamma.min") : (var5 == 1.0F ? var2 + I18n.getString("options.gamma.max") : var2 + "+" + (int)(var5 * 100.0F) + "%")) : (par1EnumOptions == EnumOptions.CHAT_OPACITY ? var2 + (int)(var5 * 90.0F + 10.0F) + "%" : (par1EnumOptions == EnumOptions.CHAT_HEIGHT_UNFOCUSED ? var2 + GuiNewChat.func_96130_b(var5) + "px" : (par1EnumOptions == EnumOptions.CHAT_HEIGHT_FOCUSED ? var2 + GuiNewChat.func_96130_b(var5) + "px" : (par1EnumOptions == EnumOptions.CHAT_WIDTH ? var2 + GuiNewChat.func_96128_a(var5) + "px" : (var5 == 0.0F ? var2 + I18n.getString("options.off") : var2 + (int)(var5 * 100.0F) + "%"))))))); -+ } else if (par1EnumOptions.getEnumBoolean()) { -+ boolean var4 = this.getOptionOrdinalValue(par1EnumOptions); - return var4 ? var2 + I18n.getString("options.on") : var2 + I18n.getString("options.off"); -- } else if(var1 == EnumOptions.RENDER_DISTANCE) { -- return var2 + getTranslation(ao, this.renderDistance); -- } else if(var1 == EnumOptions.DIFFICULTY) { -- return var2 + getTranslation(ap, this.difficulty); -- } else if(var1 == EnumOptions.GUI_SCALE) { -- return var2 + getTranslation(aq, this.guiScale); -- } else if(var1 == EnumOptions.CHAT_VISIBILITY) { -- return var2 + getTranslation(ar, this.chatVisibility); -- } else if(var1 == EnumOptions.PARTICLES) { -- return var2 + getTranslation(as, this.particleSetting); -- } else if(var1 == EnumOptions.FRAMERATE_LIMIT) { -- return var2 + getTranslation(at, this.limitFramerate); -- } else if(var1 == EnumOptions.AMBIENT_OCCLUSION) { -- return var2 + getTranslation(au, this.ambientOcclusion); -- } else if(var1 == EnumOptions.GRAPHICS) { -- if(this.fancyGraphics) { -+ } else if (par1EnumOptions == EnumOptions.RENDER_DISTANCE) { -+ return var2 + getTranslation(RENDER_DISTANCES, this.renderDistance); -+ } else if (par1EnumOptions == EnumOptions.DIFFICULTY) { -+ return var2 + getTranslation(DIFFICULTIES, this.difficulty); -+ } else if (par1EnumOptions == EnumOptions.GUI_SCALE) { -+ return var2 + getTranslation(GUISCALES, this.guiScale); -+ } else if (par1EnumOptions == EnumOptions.CHAT_VISIBILITY) { -+ return var2 + getTranslation(CHAT_VISIBILITIES, this.chatVisibility); -+ } else if (par1EnumOptions == EnumOptions.PARTICLES) { -+ return var2 + getTranslation(PARTICLES, this.particleSetting); -+ } else if (par1EnumOptions == EnumOptions.FRAMERATE_LIMIT) { -+ return var2 + getTranslation(LIMIT_FRAMERATES, this.limitFramerate); -+ } else if (par1EnumOptions == EnumOptions.AMBIENT_OCCLUSION) { -+ return var2 + getTranslation(AMBIENT_OCCLUSIONS, this.ambientOcclusion); -+ } else if (par1EnumOptions == EnumOptions.GRAPHICS) { -+ if (this.fancyGraphics) { - return var2 + I18n.getString("options.graphics.fancy"); - } else { - String var3 = "options.graphics.fast"; -@@ -347,218 +457,230 @@ - } - } - -+ /** -+ * Loads the options from the options file. It appears that this has replaced the previous 'loadOptions' -+ */ - public void loadOptions() { - try { -- if(!this.av.exists()) { -+ if (!this.optionsFile.exists()) { - return; - } - -- BufferedReader var1 = new BufferedReader(new FileReader(this.av)); -+ BufferedReader var1 = new BufferedReader(new FileReader(this.optionsFile)); - String var2 = ""; - -- while(true) { -- var2 = var1.readLine(); -- if(var2 == null) { -- KeyBinding.resetKeyBindingArrayAndHash(); -- var1.close(); -- break; -- } -- -+ while ((var2 = var1.readLine()) != null) { - try { - String[] var3 = var2.split(":"); -- if(var3[0].equals("music")) { -+ -+ if (var3[0].equals("music")) { - this.musicVolume = this.parseFloat(var3[1]); - } - -- if(var3[0].equals("sound")) { -+ if (var3[0].equals("sound")) { - this.soundVolume = this.parseFloat(var3[1]); - } - -- if(var3[0].equals("mouseSensitivity")) { -+ if (var3[0].equals("mouseSensitivity")) { - this.mouseSensitivity = this.parseFloat(var3[1]); - } - -- if(var3[0].equals("fov")) { -+ if (var3[0].equals("fov")) { - this.fovSetting = this.parseFloat(var3[1]); - } - -- if(var3[0].equals("gamma")) { -+ if (var3[0].equals("gamma")) { - this.gammaSetting = this.parseFloat(var3[1]); - } - -- if(var3[0].equals("invertYMouse")) { -+ if (var3[0].equals("invertYMouse")) { - this.invertMouse = var3[1].equals("true"); - } - -- if(var3[0].equals("viewDistance")) { -+ if (var3[0].equals("viewDistance")) { - this.renderDistance = Integer.parseInt(var3[1]); - } - -- if(var3[0].equals("guiScale")) { -+ if (var3[0].equals("guiScale")) { - this.guiScale = Integer.parseInt(var3[1]); - } - -- if(var3[0].equals("particles")) { -+ if (var3[0].equals("particles")) { - this.particleSetting = Integer.parseInt(var3[1]); - } - -- if(var3[0].equals("bobView")) { -+ if (var3[0].equals("bobView")) { - this.viewBobbing = var3[1].equals("true"); - } - -- if(var3[0].equals("anaglyph3d")) { -+ if (var3[0].equals("anaglyph3d")) { - this.anaglyph = var3[1].equals("true"); - } - -- if(var3[0].equals("advancedOpengl")) { -+ if (var3[0].equals("advancedOpengl")) { - this.advancedOpengl = var3[1].equals("true"); - } - -- if(var3[0].equals("fpsLimit")) { -+ if (var3[0].equals("fpsLimit")) { - this.limitFramerate = Integer.parseInt(var3[1]); - } - -- if(var3[0].equals("difficulty")) { -+ if (var3[0].equals("difficulty")) { - this.difficulty = Integer.parseInt(var3[1]); - } - -- if(var3[0].equals("fancyGraphics")) { -+ if (var3[0].equals("fancyGraphics")) { - this.fancyGraphics = var3[1].equals("true"); - } - -- if(var3[0].equals("ao")) { -- if(var3[1].equals("true")) { -+ if (var3[0].equals("ao")) { -+ if (var3[1].equals("true")) { - this.ambientOcclusion = 2; -- } else if(var3[1].equals("false")) { -+ } else if (var3[1].equals("false")) { - this.ambientOcclusion = 0; - } else { - this.ambientOcclusion = Integer.parseInt(var3[1]); - } - } - -- if(var3[0].equals("clouds")) { -+ if (var3[0].equals("clouds")) { - this.clouds = var3[1].equals("true"); - } - -- if(var3[0].equals("skin")) { -- this.m = var3[1]; -- } -- -- if(var3[0].equals("lastServer") && var3.length >= 2) { -- this.ad = var2.substring(var2.indexOf(58) + 1); -- } -- -- if(var3[0].equals("lang") && var3.length >= 2) { -- this.an = var3[1]; -- } -- -- if(var3[0].equals("chatVisibility")) { -+ if (var3[0].equals("skin")) { -+ this.skin = var3[1]; -+ } -+ -+ if (var3[0].equals("lastServer") && var3.length >= 2) { -+ this.lastServer = var2.substring(var2.indexOf(58) + 1); -+ } -+ -+ if (var3[0].equals("lang") && var3.length >= 2) { -+ this.language = var3[1]; -+ } -+ -+ if (var3[0].equals("chatVisibility")) { - this.chatVisibility = Integer.parseInt(var3[1]); - } - -- if(var3[0].equals("chatColors")) { -+ if (var3[0].equals("chatColors")) { - this.chatColours = var3[1].equals("true"); - } - -- if(var3[0].equals("chatLinks")) { -+ if (var3[0].equals("chatLinks")) { - this.chatLinks = var3[1].equals("true"); - } - -- if(var3[0].equals("chatLinksPrompt")) { -+ if (var3[0].equals("chatLinksPrompt")) { - this.chatLinksPrompt = var3[1].equals("true"); - } - -- if(var3[0].equals("chatOpacity")) { -+ if (var3[0].equals("chatOpacity")) { - this.chatOpacity = this.parseFloat(var3[1]); - } - -- if(var3[0].equals("serverTextures")) { -+ if (var3[0].equals("serverTextures")) { - this.serverTextures = var3[1].equals("true"); - } - -- if(var3[0].equals("snooperEnabled")) { -+ if (var3[0].equals("snooperEnabled")) { - this.snooperEnabled = var3[1].equals("true"); - } - -- if(var3[0].equals("fullscreen")) { -+ if (var3[0].equals("fullscreen")) { - this.fullScreen = var3[1].equals("true"); - } - -- if(var3[0].equals("enableVsync")) { -+ if (var3[0].equals("enableVsync")) { - this.enableVsync = var3[1].equals("true"); - } - -- if(var3[0].equals("hideServerAddress")) { -+ if (var3[0].equals("hideServerAddress")) { - this.hideServerAddress = var3[1].equals("true"); - } - -- if(var3[0].equals("advancedItemTooltips")) { -+ if (var3[0].equals("advancedItemTooltips")) { - this.advancedItemTooltips = var3[1].equals("true"); - } - -- if(var3[0].equals("pauseOnLostFocus")) { -+ if (var3[0].equals("pauseOnLostFocus")) { - this.pauseOnLostFocus = var3[1].equals("true"); - } - -- if(var3[0].equals("showCape")) { -+ if (var3[0].equals("showCape")) { - this.showCape = var3[1].equals("true"); - } - -- if(var3[0].equals("touchscreen")) { -+ if (var3[0].equals("touchscreen")) { - this.touchscreen = var3[1].equals("true"); - } - -- if(var3[0].equals("overrideHeight")) { -+ if (var3[0].equals("overrideHeight")) { - this.overrideHeight = Integer.parseInt(var3[1]); - } - -- if(var3[0].equals("overrideWidth")) { -+ if (var3[0].equals("overrideWidth")) { - this.overrideWidth = Integer.parseInt(var3[1]); - } - -- if(var3[0].equals("heldItemTooltips")) { -+ if (var3[0].equals("heldItemTooltips")) { - this.heldItemTooltips = var3[1].equals("true"); - } - -- if(var3[0].equals("chatHeightFocused")) { -+ if (var3[0].equals("chatHeightFocused")) { - this.chatHeightFocused = this.parseFloat(var3[1]); - } - -- if(var3[0].equals("chatHeightUnfocused")) { -+ if (var3[0].equals("chatHeightUnfocused")) { - this.chatHeightUnfocused = this.parseFloat(var3[1]); - } - -- if(var3[0].equals("chatScale")) { -+ if (var3[0].equals("chatScale")) { - this.chatScale = this.parseFloat(var3[1]); - } - -- if(var3[0].equals("chatWidth")) { -+ if (var3[0].equals("chatWidth")) { - this.chatWidth = this.parseFloat(var3[1]); - } - -- for(int var4 = 0; var4 < this.keyBindings.length; ++var4) { -- if(var3[0].equals("key_" + this.keyBindings[var4].c)) { -+ for (int var4 = 0; var4 < this.keyBindings.length; ++var4) { -+ if (var3[0].equals("key_" + this.keyBindings[var4].keyDescription)) { - this.keyBindings[var4].keyCode = Integer.parseInt(var3[1]); - } - } -+ // Spout Start -+ for (int key = 0; key < this.spoutcraftBindings.length; ++key) { -+ if (var3[0].equals("key_" + this.spoutcraftBindings[key].keyDescription)) { -+ this.spoutcraftBindings[key].keyCode = Integer.parseInt(var3[1]); -+ } -+ } -+ // Spout End - } catch (Exception var5) { - this.mc.getLogAgent().logWarning("Skipping bad option: " + var2); - } - } -+ -+ KeyBinding.resetKeyBindingArrayAndHash(); -+ var1.close(); - } catch (Exception var6) { - this.mc.getLogAgent().logWarning("Failed to load options"); - var6.printStackTrace(); - } -- -- } -- -- private float parseFloat(String var1) { -- return var1.equals("true") ? 1.0F : (var1.equals("false") ? 0.0F : Float.parseFloat(var1)); -- } -- -+ } -+ -+ /** -+ * Parses a string into a float. -+ */ -+ private float parseFloat(String par1Str) { -+ return par1Str.equals("true") ? 1.0F : (par1Str.equals("false") ? 0.0F : Float.parseFloat(par1Str)); -+ } -+ -+ /** -+ * Saves the options to the options file. -+ */ - public void saveOptions() { - try { -- PrintWriter var1 = new PrintWriter(new FileWriter(this.av)); -+ PrintWriter var1 = new PrintWriter(new FileWriter(this.optionsFile)); - var1.println("music:" + this.musicVolume); - var1.println("sound:" + this.soundVolume); - var1.println("invertYMouse:" + this.invertMouse); -@@ -576,9 +698,9 @@ - var1.println("fancyGraphics:" + this.fancyGraphics); - var1.println("ao:" + this.ambientOcclusion); - var1.println("clouds:" + this.clouds); -- var1.println("skin:" + this.m); -- var1.println("lastServer:" + this.ad); -- var1.println("lang:" + this.an); -+ var1.println("skin:" + this.skin); -+ var1.println("lastServer:" + this.lastServer); -+ var1.println("lang:" + this.language); - var1.println("chatVisibility:" + this.chatVisibility); - var1.println("chatColors:" + this.chatColours); - var1.println("chatLinks:" + this.chatLinks); -@@ -599,28 +721,37 @@ - var1.println("chatHeightFocused:" + this.chatHeightFocused); - var1.println("chatHeightUnfocused:" + this.chatHeightUnfocused); - var1.println("chatScale:" + this.chatScale); -- var1.println("chatWidth:" + this.chatWidth); -+ var1.println("chatWidth:" + this.chatWidth); - -- for(int var2 = 0; var2 < this.keyBindings.length; ++var2) { -- var1.println("key_" + this.keyBindings[var2].c + ":" + this.keyBindings[var2].keyCode); -- } -+ for (int var2 = 0; var2 < this.keyBindings.length; ++var2) { -+ var1.println("key_" + this.keyBindings[var2].keyDescription + ":" + this.keyBindings[var2].keyCode); -+ } -+ // Spout Start -+ for (int key = 0; key < this.spoutcraftBindings.length; ++key) { -+ var1.println("key_" + this.spoutcraftBindings[key].keyDescription + ":" + this.spoutcraftBindings[key].keyCode); -+ } -+ // Spout End - - var1.close(); - } catch (Exception var3) { - this.mc.getLogAgent().logWarning("Failed to save options"); - var3.printStackTrace(); - } -- - this.sendSettingsToServer(); - } - -+ /** -+ * Send a client info packet with settings information to the server -+ */ - public void sendSettingsToServer() { -- if(this.mc.thePlayer != null) { -- this.mc.thePlayer.sendQueue.addToSendQueue(new Packet204ClientInfo(this.an, this.renderDistance, this.chatVisibility, this.chatColours, this.difficulty, this.showCape)); -+ if (this.mc.thePlayer != null) { -+ this.mc.thePlayer.sendQueue.addToSendQueue(new Packet204ClientInfo(this.language, this.renderDistance, this.chatVisibility, this.chatColours, this.difficulty, this.showCape)); - } -- - } - -+ /** -+ * Should render clouds -+ */ - public boolean shouldRenderClouds() { - return this.renderDistance < 2 && this.clouds; - } ---- /dev/null -+++ org/spoutcraft/client/packet/ScreenAction.java -@@ -1,0 +1,45 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.client.packet; -+ -+public enum ScreenAction { -+ Open(0), -+ Close(1), -+ Force_Close(2), -+ ; -+ -+ private final byte id; -+ ScreenAction(int id) { -+ this.id = (byte)id; -+ } -+ -+ public int getId() { -+ return id; -+ } -+ -+ public static ScreenAction getScreenActionFromId(int id) { -+ for (ScreenAction action : values()) { -+ if (action.getId() == id) { -+ return action; -+ } -+ } -+ return null; -+ } -+} ---- /dev/null -+++ org/spoutcraft/client/io/FileMap.java -@@ -1,0 +1,223 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.client.io; -+ -+import java.io.File; -+import java.io.IOException; -+import java.io.RandomAccessFile; -+import java.util.concurrent.ConcurrentHashMap; -+import java.util.concurrent.atomic.AtomicLong; -+ -+import org.spoutcraft.client.chunkcache.PartitionChunk; -+ -+public class FileMap { -+ private final long size; -+ private final int entries; -+ private int index; -+ private final RandomAccessFile dataFile; -+ private final RandomAccessFile FATFile; -+ private final RandomAccessFile indexFile; -+ private final AtomicLong[] hashes; -+ private final ConcurrentHashMap FAT = new ConcurrentHashMap(); -+ -+ public FileMap(File dir, String filename, long size, int entries) throws IOException { -+ this.size = size; -+ this.entries = entries; -+ -+ dataFile = new RandomAccessFile(new File(dir, filename + ".dat"), "rw"); -+ FATFile = new RandomAccessFile(new File(dir, filename + ".fat"), "rw"); -+ indexFile = new RandomAccessFile(new File(dir, filename + ".index"), "rw"); -+ -+ if (dataFile.length() < size*entries) { -+ dataFile.setLength(this.size * this.entries); -+ } -+ -+ if (FATFile.length() < entries*8) { -+ FATFile.setLength(entries*8); -+ FATFile.seek(0); -+ FATFile.write(new byte[entries*8]); -+ } -+ -+ hashes = new AtomicLong[entries]; -+ FATFile.seek(0); -+ for (int i = 0; i < entries; i++) { -+ long hash = FATFile.readLong(); -+ hashes[i] = new AtomicLong(hash); -+ FAT.put(hash, i); -+ } -+ -+ if (indexFile.length() < 4) { -+ indexFile.setLength(4); -+ indexFile.seek(0); -+ indexFile.writeInt(0); -+ } -+ -+ index = readIndex(); -+ } -+ -+ public void close() throws IOException { -+ dataFile.close(); -+ FATFile.close(); -+ indexFile.close(); -+ } -+ -+ public void wipe() throws IOException { -+ for (int i = 0; i < entries; i++) { -+ FATFile.seek(0); -+ FATFile.write(new byte[entries*8]); -+ } -+ } -+ -+ public void write(int index, long hash, byte[] data) throws IOException { -+ if (data == null) { -+ throw new IllegalArgumentException("Null data passed to FileIO.write()"); -+ } -+ if (data.length != size) { -+ throw new IllegalArgumentException("Data array of incorrect length (" + data.length + ") passed to FileIO.write()"); -+ } -+ if (PartitionChunk.hash(data) != hash) { -+ throw new IllegalArgumentException("Hash mismatch for data passed to FileIO.write()"); -+ } -+ if (index < 0) { -+ throw new IllegalArgumentException("negative index"); -+ } -+ index = index % entries; -+ long oldHash = hashes[index].get(); -+ FAT.remove(oldHash, index); -+ -+ writeFAT(index, hash); -+ writeData(index, data); -+ } -+ -+ public byte[] readByIndex(int index, byte[] data) throws IOException { -+ if (index < 0) { -+ throw new IllegalArgumentException("negative index"); -+ } -+ index = index % entries; -+ long hash = readFAT(index); -+ data = readData(index, data); -+ long dataHash = PartitionChunk.hash(data); -+ if (dataHash != hash) { -+ return null; -+ } else { -+ return data; -+ } -+ } -+ -+ public byte[] readByHash(long hash, byte[] data) throws IOException { -+ Integer index = hashToIndex(hash); -+ if (index == null || index < 0) { -+ return null; -+ } -+ index = index % entries; -+ data = readData(index, data); -+ long dataHash = PartitionChunk.hash(data); -+ if (dataHash != hash) { -+ this.writeFAT(index, 0); -+ return null; -+ } else { -+ return data; -+ } -+ } -+ -+ public Integer hashToIndex(long hash) { -+ return FAT.get(hash); -+ } -+ -+ public int getIndex() { -+ return index % entries; -+ } -+ -+ public long indexToHash(int index) { -+ if (index < 0) { -+ index = -index; -+ index = index % entries; -+ index = entries - index; -+ index = index % entries; -+ } -+ index = index % entries; -+ return hashes[index].get(); -+ } -+ -+ public void setIndex(int index) throws IOException { -+ this.index = index % entries; -+ writeIndex(this.index); -+ } -+ -+ public void incrementIndex() throws IOException { -+ setIndex(index + 1); -+ writeIndex(index); -+ } -+ -+ public int readIndex() throws IOException { -+ indexFile.seek(0); -+ return indexFile.readInt(); -+ } -+ -+ public void writeIndex(int index) throws IOException { -+ indexFile.seek(0); -+ indexFile.writeInt(index % entries); -+ } -+ -+ private long readFAT(int index) throws IOException { -+ FATFile.seek((index % entries)*8); -+ return FATFile.readLong(); -+ } -+ -+ private void writeFAT(int index, long hash) throws IOException { -+ index = index % entries; -+ Long oldHash = hashes[index].get(); -+ FAT.remove(oldHash); -+ hashes[index].set(hash); -+ if (hash != 0) { -+ FAT.put(hash, index); -+ } -+ -+ FATFile.seek(index*8); -+ FATFile.writeLong(hash); -+ } -+ -+ private byte[] readData(int index, byte[] data) throws IOException { -+ index = index % entries; -+ dataFile.seek(size*index); -+ if (data == null || data.length != size) { -+ data = new byte[(int)size]; -+ } -+ dataFile.readFully(data); -+ return data; -+ } -+ -+ private void writeData(int index, byte[] data) throws IOException { -+ index = index % entries; -+ dataFile.seek(size*index); -+ if (data == null || data.length != size) { -+ throw new IllegalArgumentException("Incorrect byte array length"); -+ } else { -+ dataFile.write(data); -+ } -+ } -+ -+ public void corruptIndex(int index) throws IOException { -+ System.out.println("Corrupting index: " + index); -+ byte[] data = readData(index, null); -+ data[123] = (byte)(data[123] + 1); -+ writeData(index, data); -+ } -+} ---- net/minecraft/src/BlockStationary.java -+++ net/minecraft/src/BlockStationary.java -@@ -3,76 +3,85 @@ - import java.util.Random; - - public class BlockStationary extends BlockFluid { -- protected BlockStationary(int var1, Material var2) { -- super(var1, var2); -+ protected BlockStationary(int par1, Material par2Material) { -+ super(par1, par2Material); - this.setTickRandomly(false); -- if(var2 == Material.lava) { -+ -+ if (par2Material == Material.lava) { - this.setTickRandomly(true); - } -- - } - -- public boolean getBlocksMovement(IBlockAccess var1, int var2, int var3, int var4) { -+ public boolean getBlocksMovement(IBlockAccess par1IBlockAccess, int par2, int par3, int par4) { - return this.blockMaterial != Material.lava; - } - -- public void onNeighborBlockChange(World var1, int var2, int var3, int var4, int var5) { -- super.onNeighborBlockChange(var1, var2, var3, var4, var5); -- if(var1.getBlockId(var2, var3, var4) == this.blockID) { -- this.setNotStationary(var1, var2, var3, var4); -+ /** -+ * Lets the block know when one of its neighbor changes. Doesn't know which neighbor changed (coordinates passed are -+ * their own) Args: x, y, z, neighbor blockID -+ */ -+ public void onNeighborBlockChange(World par1World, int par2, int par3, int par4, int par5) { -+ super.onNeighborBlockChange(par1World, par2, par3, par4, par5); -+ -+ if (par1World.getBlockId(par2, par3, par4) == this.blockID) { -+ this.setNotStationary(par1World, par2, par3, par4); - } -- -- } -- -- private void setNotStationary(World var1, int var2, int var3, int var4) { -- int var5 = var1.getBlockMetadata(var2, var3, var4); -- var1.setBlock(var2, var3, var4, this.blockID - 1, var5, 2); -- var1.scheduleBlockUpdate(var2, var3, var4, this.blockID - 1, this.tickRate(var1)); -- } -- -- public void updateTick(World var1, int var2, int var3, int var4, Random var5) { -- if(this.blockMaterial == Material.lava) { -- int var6 = var5.nextInt(3); -- int var7 = 0; -- -- while(true) { -- int var8; -- if(var7 >= var6) { -- if(var6 == 0) { -- var7 = var2; -- var8 = var4; -- -- for(int var9 = 0; var9 < 3; ++var9) { -- var2 = var7 + var5.nextInt(3) - 1; -- var4 = var8 + var5.nextInt(3) - 1; -- if(var1.isAirBlock(var2, var3 + 1, var4) && this.isFlammable(var1, var2, var3, var4)) { -- var1.setBlock(var2, var3 + 1, var4, Block.fire.blockID); -- } -- } -- } -- break; -- } -- -- var2 += var5.nextInt(3) - 1; -- ++var3; -- var4 += var5.nextInt(3) - 1; -- var8 = var1.getBlockId(var2, var3, var4); -- if(var8 == 0) { -- if(this.isFlammable(var1, var2 - 1, var3, var4) || this.isFlammable(var1, var2 + 1, var3, var4) || this.isFlammable(var1, var2, var3, var4 - 1) || this.isFlammable(var1, var2, var3, var4 + 1) || this.isFlammable(var1, var2, var3 - 1, var4) || this.isFlammable(var1, var2, var3 + 1, var4)) { -- var1.setBlock(var2, var3, var4, Block.fire.blockID); -+ } -+ -+ /** -+ * Changes the block ID to that of an updating fluid. -+ */ -+ private void setNotStationary(World par1World, int par2, int par3, int par4) { -+ int var5 = par1World.getBlockMetadata(par2, par3, par4); -+ par1World.setBlock(par2, par3, par4, this.blockID - 1, var5, 2); -+ par1World.scheduleBlockUpdate(par2, par3, par4, this.blockID - 1, this.tickRate(par1World)); -+ } -+ -+ /** -+ * Ticks the block if it's been scheduled -+ */ -+ public void updateTick(World par1World, int par2, int par3, int par4, Random par5Random) { -+ if (this.blockMaterial == Material.lava) { -+ int var6 = par5Random.nextInt(3); -+ int var7; -+ int var8; -+ -+ for (var7 = 0; var7 < var6; ++var7) { -+ par2 += par5Random.nextInt(3) - 1; -+ ++par3; -+ par4 += par5Random.nextInt(3) - 1; -+ var8 = par1World.getBlockId(par2, par3, par4); -+ -+ if (var8 == 0) { -+ if (this.isFlammable(par1World, par2 - 1, par3, par4) || this.isFlammable(par1World, par2 + 1, par3, par4) || this.isFlammable(par1World, par2, par3, par4 - 1) || this.isFlammable(par1World, par2, par3, par4 + 1) || this.isFlammable(par1World, par2, par3 - 1, par4) || this.isFlammable(par1World, par2, par3 + 1, par4)) { -+ par1World.setBlock(par2, par3, par4, Block.fire.blockID); - return; - } -- } else if(Block.blocksList[var8].blockMaterial.blocksMovement()) { -+ } else if (Block.blocksList[var8].blockMaterial.blocksMovement()) { - return; - } -- -- ++var7; -+ } -+ -+ if (var6 == 0) { -+ var7 = par2; -+ var8 = par4; -+ -+ for (int var9 = 0; var9 < 3; ++var9) { -+ par2 = var7 + par5Random.nextInt(3) - 1; -+ par4 = var8 + par5Random.nextInt(3) - 1; -+ -+ if (par1World.isAirBlock(par2, par3 + 1, par4) && this.isFlammable(par1World, par2, par3, par4)) { -+ par1World.setBlock(par2, par3 + 1, par4, Block.fire.blockID); -+ } -+ } - } - } -- - } - -- private boolean isFlammable(World var1, int var2, int var3, int var4) { -- return var1.getBlockMaterial(var2, var3, var4).getCanBurn(); -+ /** -+ * Checks to see if the block is flammable. -+ */ -+ private boolean isFlammable(World par1World, int par2, int par3, int par4) { -+ return par1World.getBlockMaterial(par2, par3, par4).getCanBurn(); - } - } ---- net/minecraft/src/TileEntityPiston.java -+++ net/minecraft/src/TileEntityPiston.java -@@ -7,36 +7,50 @@ - public class TileEntityPiston extends TileEntity { - private int storedBlockID; - private int storedMetadata; -+ -+ /** the side the front of the piston is on */ - private int storedOrientation; -+ -+ /** if this piston is extending or not */ - private boolean extending; - private boolean shouldHeadBeRendered; - private float progress; -+ -+ /** the progress in (de)extending */ - private float lastProgress; -- private List h = new ArrayList(); -- -- public TileEntityPiston() { -- } -- -- public TileEntityPiston(int var1, int var2, int var3, boolean var4, boolean var5) { -- this.storedBlockID = var1; -- this.storedMetadata = var2; -- this.storedOrientation = var3; -- this.extending = var4; -- this.shouldHeadBeRendered = var5; -+ private List pushedObjects = new ArrayList(); -+ -+ public TileEntityPiston() {} -+ -+ public TileEntityPiston(int par1, int par2, int par3, boolean par4, boolean par5) { -+ this.storedBlockID = par1; -+ this.storedMetadata = par2; -+ this.storedOrientation = par3; -+ this.extending = par4; -+ this.shouldHeadBeRendered = par5; - } - - public int getStoredBlockID() { - return this.storedBlockID; - } - -+ /** -+ * Returns block data at the location of this entity (client-only). -+ */ - public int getBlockMetadata() { - return this.storedMetadata; - } - -+ /** -+ * Returns true if a piston is extending -+ */ - public boolean isExtending() { - return this.extending; - } - -+ /** -+ * Returns the orientation of the piston as an int -+ */ - public int getPistonOrientation() { - return this.storedOrientation; - } -@@ -45,103 +59,122 @@ - return this.shouldHeadBeRendered; - } - -- public float getProgress(float var1) { -- if(var1 > 1.0F) { -- var1 = 1.0F; -+ /** -+ * Get interpolated progress value (between lastProgress and progress) given the fractional time between ticks as an -+ * argument. -+ */ -+ public float getProgress(float par1) { -+ if (par1 > 1.0F) { -+ par1 = 1.0F; - } - -- return this.lastProgress + (this.progress - this.lastProgress) * var1; -- } -- -- public float getOffsetX(float var1) { -- return this.extending ? (this.getProgress(var1) - 1.0F) * (float)Facing.offsetsXForSide[this.storedOrientation] : (1.0F - this.getProgress(var1)) * (float)Facing.offsetsXForSide[this.storedOrientation]; -- } -- -- public float getOffsetY(float var1) { -- return this.extending ? (this.getProgress(var1) - 1.0F) * (float)Facing.offsetsYForSide[this.storedOrientation] : (1.0F - this.getProgress(var1)) * (float)Facing.offsetsYForSide[this.storedOrientation]; -- } -- -- public float getOffsetZ(float var1) { -- return this.extending ? (this.getProgress(var1) - 1.0F) * (float)Facing.offsetsZForSide[this.storedOrientation] : (1.0F - this.getProgress(var1)) * (float)Facing.offsetsZForSide[this.storedOrientation]; -- } -- -- private void updatePushedObjects(float var1, float var2) { -- if(this.extending) { -- var1 = 1.0F - var1; -+ return this.lastProgress + (this.progress - this.lastProgress) * par1; -+ } -+ -+ public float getOffsetX(float par1) { -+ return this.extending ? (this.getProgress(par1) - 1.0F) * (float)Facing.offsetsXForSide[this.storedOrientation] : (1.0F - this.getProgress(par1)) * (float)Facing.offsetsXForSide[this.storedOrientation]; -+ } -+ -+ public float getOffsetY(float par1) { -+ return this.extending ? (this.getProgress(par1) - 1.0F) * (float)Facing.offsetsYForSide[this.storedOrientation] : (1.0F - this.getProgress(par1)) * (float)Facing.offsetsYForSide[this.storedOrientation]; -+ } -+ -+ public float getOffsetZ(float par1) { -+ return this.extending ? (this.getProgress(par1) - 1.0F) * (float)Facing.offsetsZForSide[this.storedOrientation] : (1.0F - this.getProgress(par1)) * (float)Facing.offsetsZForSide[this.storedOrientation]; -+ } -+ -+ private void updatePushedObjects(float par1, float par2) { -+ if (this.extending) { -+ par1 = 1.0F - par1; - } else { -- --var1; -+ --par1; - } - -- AxisAlignedBB var3 = Block.pistonMoving.getAxisAlignedBB(this.worldObj, this.xCoord, this.yCoord, this.zCoord, this.storedBlockID, var1, this.storedOrientation); -- if(var3 != null) { -+ AxisAlignedBB var3 = Block.pistonMoving.getAxisAlignedBB(this.worldObj, this.xCoord, this.yCoord, this.zCoord, this.storedBlockID, par1, this.storedOrientation); -+ -+ if (var3 != null) { - List var4 = this.worldObj.getEntitiesWithinAABBExcludingEntity((Entity)null, var3); -- if(!var4.isEmpty()) { -- this.h.addAll(var4); -- Iterator var5 = this.h.iterator(); -- -- while(var5.hasNext()) { -+ -+ if (!var4.isEmpty()) { -+ this.pushedObjects.addAll(var4); -+ Iterator var5 = this.pushedObjects.iterator(); -+ -+ while (var5.hasNext()) { - Entity var6 = (Entity)var5.next(); -- var6.moveEntity((double)(var2 * (float)Facing.offsetsXForSide[this.storedOrientation]), (double)(var2 * (float)Facing.offsetsYForSide[this.storedOrientation]), (double)(var2 * (float)Facing.offsetsZForSide[this.storedOrientation])); -+ var6.moveEntity((double)(par2 * (float)Facing.offsetsXForSide[this.storedOrientation]), (double)(par2 * (float)Facing.offsetsYForSide[this.storedOrientation]), (double)(par2 * (float)Facing.offsetsZForSide[this.storedOrientation])); - } - -- this.h.clear(); -+ this.pushedObjects.clear(); - } - } -- - } - -+ /** -+ * removes a pistons tile entity (and if the piston is moving, stops it) -+ */ - public void clearPistonTileEntity() { -- if(this.lastProgress < 1.0F && this.worldObj != null) { -+ if (this.lastProgress < 1.0F && this.worldObj != null) { - this.lastProgress = this.progress = 1.0F; - this.worldObj.removeBlockTileEntity(this.xCoord, this.yCoord, this.zCoord); - this.invalidate(); -- if(this.worldObj.getBlockId(this.xCoord, this.yCoord, this.zCoord) == Block.pistonMoving.blockID) { -+ -+ if (this.worldObj.getBlockId(this.xCoord, this.yCoord, this.zCoord) == Block.pistonMoving.blockID) { - this.worldObj.setBlock(this.xCoord, this.yCoord, this.zCoord, this.storedBlockID, this.storedMetadata, 3); - this.worldObj.notifyBlockOfNeighborChange(this.xCoord, this.yCoord, this.zCoord, this.storedBlockID); - } - } -- - } - -+ /** -+ * Allows the entity to update its state. Overridden in most subclasses, e.g. the mob spawner uses this to count ticks -+ * and creates a new spawn inside its implementation. -+ */ - public void updateEntity() { - this.lastProgress = this.progress; -- if(this.lastProgress >= 1.0F) { -+ -+ if (this.lastProgress >= 1.0F) { - this.updatePushedObjects(1.0F, 0.25F); - this.worldObj.removeBlockTileEntity(this.xCoord, this.yCoord, this.zCoord); - this.invalidate(); -- if(this.worldObj.getBlockId(this.xCoord, this.yCoord, this.zCoord) == Block.pistonMoving.blockID) { -+ -+ if (this.worldObj.getBlockId(this.xCoord, this.yCoord, this.zCoord) == Block.pistonMoving.blockID) { - this.worldObj.setBlock(this.xCoord, this.yCoord, this.zCoord, this.storedBlockID, this.storedMetadata, 3); - this.worldObj.notifyBlockOfNeighborChange(this.xCoord, this.yCoord, this.zCoord, this.storedBlockID); - } -- - } else { - this.progress += 0.5F; -- if(this.progress >= 1.0F) { -+ -+ if (this.progress >= 1.0F) { - this.progress = 1.0F; - } - -- if(this.extending) { -- this.updatePushedObjects(this.progress, this.progress - this.lastProgress + 1.0F / 16.0F); -+ if (this.extending) { -+ this.updatePushedObjects(this.progress, this.progress - this.lastProgress + 0.0625F); - } -- - } - } - -- public void readFromNBT(NBTTagCompound var1) { -- super.readFromNBT(var1); -- this.storedBlockID = var1.getInteger("blockId"); -- this.storedMetadata = var1.getInteger("blockData"); -- this.storedOrientation = var1.getInteger("facing"); -- this.lastProgress = this.progress = var1.getFloat("progress"); -- this.extending = var1.getBoolean("extending"); -+ /** -+ * Reads a tile entity from NBT. -+ */ -+ public void readFromNBT(NBTTagCompound par1NBTTagCompound) { -+ super.readFromNBT(par1NBTTagCompound); -+ this.storedBlockID = par1NBTTagCompound.getInteger("blockId"); -+ this.storedMetadata = par1NBTTagCompound.getInteger("blockData"); -+ this.storedOrientation = par1NBTTagCompound.getInteger("facing"); -+ this.lastProgress = this.progress = par1NBTTagCompound.getFloat("progress"); -+ this.extending = par1NBTTagCompound.getBoolean("extending"); - } - -- public void writeToNBT(NBTTagCompound var1) { -- super.writeToNBT(var1); -- var1.setInteger("blockId", this.storedBlockID); -- var1.setInteger("blockData", this.storedMetadata); -- var1.setInteger("facing", this.storedOrientation); -- var1.setFloat("progress", this.lastProgress); -- var1.setBoolean("extending", this.extending); -+ /** -+ * Writes a tile entity to NBT. -+ */ -+ public void writeToNBT(NBTTagCompound par1NBTTagCompound) { -+ super.writeToNBT(par1NBTTagCompound); -+ par1NBTTagCompound.setInteger("blockId", this.storedBlockID); -+ par1NBTTagCompound.setInteger("blockData", this.storedMetadata); -+ par1NBTTagCompound.setInteger("facing", this.storedOrientation); -+ par1NBTTagCompound.setFloat("progress", this.lastProgress); -+ par1NBTTagCompound.setBoolean("extending", this.extending); - } - } ---- /dev/null -+++ org/spoutcraft/api/animation/PropertyDelegate.java -@@ -1,0 +1,39 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.api.animation; -+ -+import org.spoutcraft.api.property.Property; -+import org.spoutcraft.api.property.PropertyInterface; -+ -+public class PropertyDelegate implements ValueSetDelegate { -+ private Property delegate; -+ -+ public PropertyDelegate(PropertyInterface object, String property) { -+ delegate = object.getPropertyDelegate(property); -+ } -+ -+ public void set(Animatable value) { -+ delegate.set(value); -+ } -+ -+ public void set(Number value) { -+ delegate.set(value); -+ } -+} ---- net/minecraft/src/GuiVideoSettings.java -+++ net/minecraft/src/GuiVideoSettings.java -@@ -2,29 +2,43 @@ - - public class GuiVideoSettings extends GuiScreen { - private GuiScreen parentGuiScreen; -- protected String a = "Video Settings"; -+ -+ /** The title string that is displayed in the top-center of the screen. */ -+ protected String screenTitle = "Video Settings"; -+ -+ /** GUI game settings */ - private GameSettings guiGameSettings; -+ -+ /** -+ * True if the system is 64-bit (using a simple indexOf test on a system property) -+ */ - private boolean is64bit; -- private static EnumOptions[] videoOptions = new EnumOptions[]{EnumOptions.GRAPHICS, EnumOptions.RENDER_DISTANCE, EnumOptions.AMBIENT_OCCLUSION, EnumOptions.FRAMERATE_LIMIT, EnumOptions.ANAGLYPH, EnumOptions.VIEW_BOBBING, EnumOptions.GUI_SCALE, EnumOptions.ADVANCED_OPENGL, EnumOptions.GAMMA, EnumOptions.RENDER_CLOUDS, EnumOptions.PARTICLES, EnumOptions.USE_SERVER_TEXTURES, EnumOptions.USE_FULLSCREEN, EnumOptions.ENABLE_VSYNC}; -- -- public GuiVideoSettings(GuiScreen var1, GameSettings var2) { -- this.parentGuiScreen = var1; -- this.guiGameSettings = var2; -+ -+ /** An array of all of EnumOption's video options. */ -+ private static EnumOptions[] videoOptions = new EnumOptions[] {EnumOptions.GRAPHICS, EnumOptions.RENDER_DISTANCE, EnumOptions.AMBIENT_OCCLUSION, EnumOptions.FRAMERATE_LIMIT, EnumOptions.ANAGLYPH, EnumOptions.VIEW_BOBBING, EnumOptions.GUI_SCALE, EnumOptions.ADVANCED_OPENGL, EnumOptions.GAMMA, EnumOptions.RENDER_CLOUDS, EnumOptions.PARTICLES, EnumOptions.USE_SERVER_TEXTURES, EnumOptions.USE_FULLSCREEN, EnumOptions.ENABLE_VSYNC}; -+ -+ public GuiVideoSettings(GuiScreen par1GuiScreen, GameSettings par2GameSettings) { -+ this.parentGuiScreen = par1GuiScreen; -+ this.guiGameSettings = par2GameSettings; - } - -+ /** -+ * Adds the buttons (and other controls) to the screen in question. -+ */ - public void initGui() { -- this.a = I18n.getString("options.videoTitle"); -- this.i.clear(); -- this.i.add(new GuiButton(200, this.width / 2 - 100, this.height / 6 + 168, I18n.getString("gui.done"))); -+ this.screenTitle = I18n.getString("options.videoTitle"); -+ this.buttonList.clear(); -+ this.buttonList.add(new GuiButton(200, this.width / 2 - 100, this.height / 6 + 168, I18n.getString("gui.done"))); - this.is64bit = false; -- String[] var1 = new String[]{"sun.arch.data.model", "com.ibm.vm.bitmode", "os.arch"}; -+ String[] var1 = new String[] {"sun.arch.data.model", "com.ibm.vm.bitmode", "os.arch"}; - String[] var2 = var1; - int var3 = var1.length; - -- for(int var4 = 0; var4 < var3; ++var4) { -+ for (int var4 = 0; var4 < var3; ++var4) { - String var5 = var2[var4]; - String var6 = System.getProperty(var5); -- if(var6 != null && var6.contains("64")) { -+ -+ if (var6 != null && var6.contains("64")) { - this.is64bit = true; - break; - } -@@ -35,50 +49,57 @@ - EnumOptions[] var9 = videoOptions; - int var10 = var9.length; - -- for(int var11 = 0; var11 < var10; ++var11) { -+ for (int var11 = 0; var11 < var10; ++var11) { - EnumOptions var7 = var9[var11]; -- if(var7.getEnumFloat()) { -- this.i.add(new GuiSlider(var7.returnEnumOrdinal(), this.width / 2 - 155 + var8 % 2 * 160, this.height / 7 + var3 + 24 * (var8 >> 1), var7, this.guiGameSettings.getKeyBinding(var7), this.guiGameSettings.getOptionFloatValue(var7))); -+ -+ if (var7.getEnumFloat()) { -+ this.buttonList.add(new GuiSlider(var7.returnEnumOrdinal(), this.width / 2 - 155 + var8 % 2 * 160, this.height / 7 + var3 + 24 * (var8 >> 1), var7, this.guiGameSettings.getKeyBinding(var7), this.guiGameSettings.getOptionFloatValue(var7))); - } else { -- this.i.add(new GuiSmallButton(var7.returnEnumOrdinal(), this.width / 2 - 155 + var8 % 2 * 160, this.height / 7 + var3 + 24 * (var8 >> 1), var7, this.guiGameSettings.getKeyBinding(var7))); -+ this.buttonList.add(new GuiSmallButton(var7.returnEnumOrdinal(), this.width / 2 - 155 + var8 % 2 * 160, this.height / 7 + var3 + 24 * (var8 >> 1), var7, this.guiGameSettings.getKeyBinding(var7))); - } - - ++var8; - } -- - } - -- protected void actionPerformed(GuiButton var1) { -- if(var1.enabled) { -+ /** -+ * Fired when a control is clicked. This is the equivalent of ActionListener.actionPerformed(ActionEvent e). -+ */ -+ protected void actionPerformed(GuiButton par1GuiButton) { -+ if (par1GuiButton.enabled) { - int var2 = this.guiGameSettings.guiScale; -- if(var1.id < 100 && var1 instanceof GuiSmallButton) { -- this.guiGameSettings.setOptionValue(((GuiSmallButton)var1).returnEnumOptions(), 1); -- var1.f = this.guiGameSettings.getKeyBinding(EnumOptions.getEnumOptions(var1.id)); -+ -+ if (par1GuiButton.id < 100 && par1GuiButton instanceof GuiSmallButton) { -+ this.guiGameSettings.setOptionValue(((GuiSmallButton)par1GuiButton).returnEnumOptions(), 1); -+ par1GuiButton.displayString = this.guiGameSettings.getKeyBinding(EnumOptions.getEnumOptions(par1GuiButton.id)); - } - -- if(var1.id == 200) { -+ if (par1GuiButton.id == 200) { - this.mc.gameSettings.saveOptions(); - this.mc.displayGuiScreen(this.parentGuiScreen); - } - -- if(this.guiGameSettings.guiScale != var2) { -+ if (this.guiGameSettings.guiScale != var2) { - ScaledResolution var3 = new ScaledResolution(this.mc.gameSettings, this.mc.displayWidth, this.mc.displayHeight); - int var4 = var3.getScaledWidth(); - int var5 = var3.getScaledHeight(); - this.setWorldAndResolution(this.mc, var4, var5); - } -- - } - } - -- public void drawScreen(int var1, int var2, float var3) { -+ /** -+ * Draws the screen and all the components in it. -+ */ -+ public void drawScreen(int par1, int par2, float par3) { - this.drawDefaultBackground(); -- this.drawCenteredString(this.fontRenderer, this.a, this.width / 2, this.is64bit ? 20 : 5, 16777215); -- if(!this.is64bit && this.guiGameSettings.renderDistance == 0) { -+ this.drawCenteredString(this.fontRenderer, this.screenTitle, this.width / 2, this.is64bit ? 20 : 5, 16777215); -+ -+ if (!this.is64bit && this.guiGameSettings.renderDistance == 0) { - this.drawCenteredString(this.fontRenderer, I18n.getString("options.farWarning1"), this.width / 2, this.height / 6 + 144 + 1, 11468800); - this.drawCenteredString(this.fontRenderer, I18n.getString("options.farWarning2"), this.width / 2, this.height / 6 + 144 + 13, 11468800); - } - -- super.drawScreen(var1, var2, var3); -+ super.drawScreen(par1, par2, par3); - } - } ---- /dev/null -+++ org/spoutcraft/client/packet/PacketSlotClick.java -@@ -1,0 +1,78 @@ -+/* -+ * This file is part of Spoutcraft. -+ * -+ * Copyright (c) 2011 SpoutcraftDev -+ * Spoutcraft is licensed under the GNU Lesser General Public License. -+ * -+ * Spoutcraft is free software: you can redistribute it and/or modify -+ * it under the terms of the GNU Lesser General Public License as published by -+ * the Free Software Foundation, either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * Spoutcraft is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see . -+ */ -+package org.spoutcraft.client.packet; -+ -+import java.io.IOException; -+import java.util.UUID; -+ -+import org.spoutcraft.api.gui.Slot; -+import org.spoutcraft.api.io.SpoutInputStream; -+import org.spoutcraft.api.io.SpoutOutputStream; -+ -+public class PacketSlotClick implements SpoutPacket { -+ private UUID screen; -+ private UUID slot; -+ private int mouseClick; -+ private boolean holdingShift; -+ -+ public PacketSlotClick() { -+ } -+ -+ public PacketSlotClick(Slot slot, int mouseClick, boolean holdingShift) { -+ screen = slot.getScreen().getId(); -+ this.slot = slot.getId(); -+ this.mouseClick = mouseClick; -+ this.holdingShift = holdingShift; -+ } -+ -+ public void readData(SpoutInputStream input) throws IOException { -+ long msb = input.readLong(); -+ long lsb = input.readLong(); -+ screen = new UUID(msb,lsb); -+ msb = input.readLong(); -+ lsb = input.readLong(); -+ slot = new UUID(msb,lsb); -+ mouseClick = input.read(); -+ holdingShift = input.readBoolean(); -+ } -+ -+ public void writeData(SpoutOutputStream output) throws IOException { -+ output.writeLong(screen.getMostSignificantBits()); -+ output.writeLong(screen.getLeastSignificantBits()); // 16 -+ output.writeLong(slot.getMostSignificantBits()); -+ output.writeLong(slot.getLeastSignificantBits()); // 32 -+ output.write(mouseClick); // mouseClick will usually be 0 (left) or 1 (right) - so this is safe unless the mouse has... 257 buttons :P -+ output.writeBoolean(holdingShift);//34 -+ } -+ -+ public void run(int playerId) { -+ } -+ -+ public void failure(int playerId) { -+ } -+ -+ public PacketType getPacketType() { -+ return PacketType.PacketSlotClick; -+ } -+ -+ public int getVersion() { -+ return 0; -+ } -+} ---- net/minecraft/src/ModelZombieVillager.java -+++ net/minecraft/src/ModelZombieVillager.java -@@ -5,40 +5,45 @@ - this(0.0F, 0.0F, false); - } - -- public ModelZombieVillager(float var1, float var2, boolean var3) { -- super(var1, 0.0F, 64, var3 ? 32 : 64); -- if(var3) { -+ public ModelZombieVillager(float par1, float par2, boolean par3) { -+ super(par1, 0.0F, 64, par3 ? 32 : 64); -+ -+ if (par3) { - this.bipedHead = new ModelRenderer(this, 0, 0); -- this.bipedHead.addBox(-4.0F, -10.0F, -4.0F, 8, 6, 8, var1); -- this.bipedHead.setRotationPoint(0.0F, 0.0F + var2, 0.0F); -+ this.bipedHead.addBox(-4.0F, -10.0F, -4.0F, 8, 6, 8, par1); -+ this.bipedHead.setRotationPoint(0.0F, 0.0F + par2, 0.0F); - } else { - this.bipedHead = new ModelRenderer(this); -- this.bipedHead.setRotationPoint(0.0F, 0.0F + var2, 0.0F); -- this.bipedHead.setTextureOffset(0, 32).addBox(-4.0F, -10.0F, -4.0F, 8, 10, 8, var1); -- this.bipedHead.setTextureOffset(24, 32).addBox(-1.0F, -3.0F, -6.0F, 2, 4, 2, var1); -+ this.bipedHead.setRotationPoint(0.0F, 0.0F + par2, 0.0F); -+ this.bipedHead.setTextureOffset(0, 32).addBox(-4.0F, -10.0F, -4.0F, 8, 10, 8, par1); -+ this.bipedHead.setTextureOffset(24, 32).addBox(-1.0F, -3.0F, -6.0F, 2, 4, 2, par1); - } -- - } - - public int func_82897_a() { - return 10; - } - -- public void setRotationAngles(float var1, float var2, float var3, float var4, float var5, float var6, Entity var7) { -- super.setRotationAngles(var1, var2, var3, var4, var5, var6, var7); -+ /** -+ * Sets the model's various rotation angles. For bipeds, par1 and par2 are used for animating the movement of arms and -+ * legs, where par1 represents the time(so that arms and legs swing back and forth) and par2 represents how "far" arms -+ * and legs can swing at most. -+ */ -+ public void setRotationAngles(float par1, float par2, float par3, float par4, float par5, float par6, Entity par7Entity) { -+ super.setRotationAngles(par1, par2, par3, par4, par5, par6, par7Entity); - float var8 = MathHelper.sin(this.onGround * (float)Math.PI); - float var9 = MathHelper.sin((1.0F - (1.0F - this.onGround) * (1.0F - this.onGround)) * (float)Math.PI); - this.bipedRightArm.rotateAngleZ = 0.0F; - this.bipedLeftArm.rotateAngleZ = 0.0F; - this.bipedRightArm.rotateAngleY = -(0.1F - var8 * 0.6F); - this.bipedLeftArm.rotateAngleY = 0.1F - var8 * 0.6F; -- this.bipedRightArm.rotateAngleX = (float)Math.PI * -0.5F; -- this.bipedLeftArm.rotateAngleX = (float)Math.PI * -0.5F; -+ this.bipedRightArm.rotateAngleX = -((float)Math.PI / 2F); -+ this.bipedLeftArm.rotateAngleX = -((float)Math.PI / 2F); - this.bipedRightArm.rotateAngleX -= var8 * 1.2F - var9 * 0.4F; - this.bipedLeftArm.rotateAngleX -= var8 * 1.2F - var9 * 0.4F; -- this.bipedRightArm.rotateAngleZ += MathHelper.cos(var3 * 0.09F) * 0.05F + 0.05F; -- this.bipedLeftArm.rotateAngleZ -= MathHelper.cos(var3 * 0.09F) * 0.05F + 0.05F; -- this.bipedRightArm.rotateAngleX += MathHelper.sin(var3 * 0.067F) * 0.05F; -- this.bipedLeftArm.rotateAngleX -= MathHelper.sin(var3 * 0.067F) * 0.05F; -+ this.bipedRightArm.rotateAngleZ += MathHelper.cos(par3 * 0.09F) * 0.05F + 0.05F; -+ this.bipedLeftArm.rotateAngleZ -= MathHelper.cos(par3 * 0.09F) * 0.05F + 0.05F; -+ this.bipedRightArm.rotateAngleX += MathHelper.sin(par3 * 0.067F) * 0.05F; -+ this.bipedLeftArm.rotateAngleX -= MathHelper.sin(par3 * 0.067F) * 0.05F; - } - } ---- net/minecraft/src/Packet201PlayerInfo.java -+++ net/minecraft/src/Packet201PlayerInfo.java -@@ -5,36 +5,51 @@ - import java.io.IOException; - - public class Packet201PlayerInfo extends Packet { -- public String a; -+ -+ /** The player's name. */ -+ public String playerName; -+ -+ /** Byte that tells whether the player is connected. */ - public boolean isConnected; - public int ping; - -- public Packet201PlayerInfo() { -- } -- -- public Packet201PlayerInfo(String var1, boolean var2, int var3) { -- this.a = var1; -- this.isConnected = var2; -- this.ping = var3; -- } -- -- public void readPacketData(DataInput var1) throws IOException { -- this.a = readString(var1, 16); -- this.isConnected = var1.readByte() != 0; -- this.ping = var1.readShort(); -- } -- -- public void writePacketData(DataOutput var1) throws IOException { -- writeString(this.a, var1); -- var1.writeByte(this.isConnected ? 1 : 0); -- var1.writeShort(this.ping); -- } -- -- public void processPacket(NetHandler var1) { -- var1.handlePlayerInfo(this); -- } -- -+ public Packet201PlayerInfo() {} -+ -+ public Packet201PlayerInfo(String par1Str, boolean par2, int par3) { -+ this.playerName = par1Str; -+ this.isConnected = par2; -+ this.ping = par3; -+ } -+ -+ /** -+ * Abstract. Reads the raw packet data from the data stream. -+ */ -+ public void readPacketData(DataInput par1DataInput) throws IOException { -+ this.playerName = readString(par1DataInput, 16); -+ this.isConnected = par1DataInput.readByte() != 0; -+ this.ping = par1DataInput.readShort(); -+ } -+ -+ /** -+ * Abstract. Writes the raw packet data to the data stream. -+ */ -+ public void writePacketData(DataOutput par1DataOutput) throws IOException { -+ writeString(this.playerName, par1DataOutput); -+ par1DataOutput.writeByte(this.isConnected ? 1 : 0); -+ par1DataOutput.writeShort(this.ping); -+ } -+ -+ /** -+ * Passes this Packet on to the NetHandler for processing. -+ */ -+ public void processPacket(NetHandler par1NetHandler) { -+ par1NetHandler.handlePlayerInfo(this); -+ } -+ -+ /** -+ * Abstract. Return the size of the packet (not counting the header). -+ */ - public int getPacketSize() { -- return this.a.length() + 2 + 1 + 2; -+ return this.playerName.length() + 2 + 1 + 2; - } - } ---- net/minecraft/src/EntityAIWander.java -+++ net/minecraft/src/EntityAIWander.java -@@ -7,20 +7,24 @@ - private double zPosition; - private double speed; - -- public EntityAIWander(EntityCreature var1, double var2) { -- this.entity = var1; -- this.speed = var2; -+ public EntityAIWander(EntityCreature par1EntityCreature, double par2) { -+ this.entity = par1EntityCreature; -+ this.speed = par2; - this.setMutexBits(1); - } - -+ /** -+ * Returns whether the EntityAIBase should begin execution. -+ */ - public boolean shouldExecute() { -- if(this.entity.getAge() >= 100) { -+ if (this.entity.getAge() >= 100) { - return false; -- } else if(this.entity.getRNG().nextInt(120) != 0) { -+ } else if (this.entity.getRNG().nextInt(120) != 0) { - return false; - } else { - Vec3 var1 = RandomPositionGenerator.findRandomTarget(this.entity, 10, 7); -- if(var1 == null) { -+ -+ if (var1 == null) { - return false; - } else { - this.xPosition = var1.xCoord; -@@ -31,10 +35,16 @@ - } - } - -+ /** -+ * Returns whether an in-progress EntityAIBase should continue executing -+ */ - public boolean continueExecuting() { - return !this.entity.getNavigator().noPath(); - } - -+ /** -+ * Execute a one shot task or start executing a continuous task -+ */ - public void startExecuting() { - this.entity.getNavigator().tryMoveToXYZ(this.xPosition, this.yPosition, this.zPosition, this.speed); - } ---- net/minecraft/src/EntityLivingBase.java -+++ net/minecraft/src/EntityLivingBase.java -@@ -1,5 +1,8 @@ - package net.minecraft.src; - -+import com.prupe.mcpatcher.cc.ColorizeEntity; -+import com.prupe.mcpatcher.mob.MobRandomizer$ExtraInfo; -+ - import java.util.Collection; - import java.util.HashMap; - import java.util.Iterator; -@@ -7,26 +10,56 @@ - import java.util.Random; - import java.util.UUID; - -+ -+//Spout Start -+import org.spoutcraft.api.entity.EntitySkinType; -+import org.spoutcraft.api.material.CustomBlock; -+import org.spoutcraft.api.material.MaterialData; -+import org.spoutcraft.client.entity.EntityData; -+import org.spoutcraft.client.io.CustomTextureManager; -+//Spout End -+ - public abstract class EntityLivingBase extends Entity { -- private static final UUID b = UUID.fromString("662A6B8D-DA3E-4C1C-8813-96EA6097278D"); -- private static final AttributeModifier sprintingSpeedBoostModifier = (new AttributeModifier(b, "Sprinting speed boost", (double)0.3F, 2)).setSaved(false); -+ private static final UUID sprintingSpeedBoostModifierUUID = UUID.fromString("662A6B8D-DA3E-4C1C-8813-96EA6097278D"); -+ private static final AttributeModifier sprintingSpeedBoostModifier = (new AttributeModifier(sprintingSpeedBoostModifierUUID, "Sprinting speed boost", 0.30000001192092896D, 2)).setSaved(false); - private BaseAttributeMap attributeMap; - private final CombatTracker _combatTracker = new CombatTracker(this); -- private final HashMap f = new HashMap(); -+ private final HashMap activePotionsMap = new HashMap(); -+ -+ /** The equipment this mob was previously wearing, used for syncing. */ - private final ItemStack[] previousEquipment = new ItemStack[5]; -+ -+ /** Whether an arm swing is currently in progress. */ - public boolean isSwingInProgress; - public int swingProgressInt; - public int arrowHitTimer; - public float prevHealth; -+ -+ /** -+ * The amount of time remaining this entity should act 'hurt'. (Visual appearance of red tint) -+ */ - public int hurtTime; -+ -+ /** What the hurt time was max set to last. */ - public int maxHurtTime; -+ -+ /** The yaw at which this entity was last attacked from. */ - public float attackedAtYaw; -+ -+ /** -+ * The amount of time remaining this entity should act 'dead', i.e. have a corpse in the world. -+ */ - public int deathTime; - public int attackTime; - public float prevSwingProgress; - public float swingProgress; - public float prevLimbSwingAmount; - public float limbSwingAmount; -+ -+ /** -+ * Only relevant when limbYaw is not 0(the entity is moving). Influences where in its swing legs and arms currently -+ * are. -+ */ - public float limbSwing; - public int maxHurtResistantTime = 20; - public float prevCameraPitch; -@@ -35,48 +68,111 @@ - public float field_70770_ap; - public float renderYawOffset; - public float prevRenderYawOffset; -+ -+ /** Entity head rotation yaw */ - public float rotationYawHead; -+ -+ /** Entity head rotation yaw at previous tick */ - public float prevRotationYawHead; -+ -+ /** -+ * A factor used to determine how far this entity will move each tick if it is jumping or falling. -+ */ - public float jumpMovementFactor = 0.02F; -+ -+ /** The most recent player that has attacked this entity */ - protected EntityPlayer attackingPlayer; -+ -+ /** -+ * Set to 60 when hit by the player or the player's wolf, then decrements. Used to determine whether the entity should -+ * drop items on death. -+ */ - protected int recentlyHit; -+ -+ /** -+ * This gets set on entity death, but never used. Looks like a duplicate of isDead -+ */ - protected boolean dead; -+ -+ /** Holds the living entity age, used to control the despawn. */ - protected int entityAge; - protected float field_70768_au; - protected float field_110154_aX; - protected float field_70764_aw; - protected float field_70763_ax; - protected float field_70741_aB; -+ -+ /** The score value of the Mob, the amount of points the mob is worth. */ - protected int scoreValue; -- protected float lastDamage; -+ -+ /** -+ * Damage taken in the last hit. Mobs are resistant to damage less than this for a short time after taking damage. -+ */ -+ -+ //Spout Start -+ protected String texture = "/mob/char.png"; -+ public float lastDamage; -+ private EntityData entityData = new EntityData(); -+ public String username = null; -+ public String displayName = null; -+ public int maxAir = 300; -+ // Spout End -+ -+ /** used to check whether entity is jumping. */ - protected boolean isJumping; - public float moveStrafing; - public float moveForward; - protected float randomYawVelocity; -+ -+ /** -+ * The number of updates over which the new position and rotation are to be applied to the entity. -+ */ - protected int newPosRotationIncrements; -+ -+ /** The new X position to be applied to the entity. */ - protected double newPosX; -+ -+ /** The new Y position to be applied to the entity. */ - protected double newPosY; - protected double newPosZ; -+ -+ /** The new yaw rotation to be applied to the entity. */ - protected double newRotationYaw; -+ -+ /** The new yaw rotation to be applied to the entity. */ - protected double newRotationPitch; -+ -+ /** Whether the DataWatcher needs to be updated with the active potions */ - private boolean potionsNeedUpdate = true; -+ -+ /** is only being set, has no uses as of MC 1.1 */ - private EntityLivingBase entityLivingToAttack; - private int revengeTimer; - private EntityLivingBase lastAttacker; -+ -+ /** Holds the value of ticksExisted when setLastAttacker was last called. */ - private int lastAttackerTime; -+ -+ /** -+ * A factor used to determine how far this entity will move each tick if it is walking on land. Adjusted by speed, and -+ * slipperiness of the current block. -+ */ - private float landMovementFactor; -+ -+ /** Number of ticks since last jump */ - private int jumpTicks; - private float field_110151_bq; -+ public int overridePotionColor; - -- public EntityLivingBase(World var1) { -- super(var1); -+ public EntityLivingBase(World par1World) { -+ super(par1World); - this.applyEntityAttributes(); - this.setHealth(this.getMaxHealth()); - this.preventEntitySpawning = true; - this.field_70770_ap = (float)(Math.random() + 1.0D) * 0.01F; - this.setPosition(this.posX, this.posY, this.posZ); - this.field_70769_ao = (float)Math.random() * 12398.0F; -- this.rotationYaw = (float)(Math.random() * (double)((float)Math.PI) * 2.0D); -+ this.rotationYaw = (float)(Math.random() * Math.PI * 2.0D); - this.rotationYawHead = this.rotationYaw; - this.stepHeight = 0.5F; - } -@@ -92,64 +188,76 @@ - this.getAttributeMap().func_111150_b(SharedMonsterAttributes.maxHealth); - this.getAttributeMap().func_111150_b(SharedMonsterAttributes.knockbackResistance); - this.getAttributeMap().func_111150_b(SharedMonsterAttributes.movementSpeed); -- if(!this.isAIEnabled()) { -- this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setAttribute((double)0.1F); -+ -+ if (!this.isAIEnabled()) { -+ this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setAttribute(0.10000000149011612D); - } -- - } - -- protected void updateFallState(double var1, boolean var3) { -- if(!this.isInWater()) { -+ /** -+ * Takes in the distance the entity has fallen this tick and whether its on the ground to update the fall distance and -+ * deal fall damage if landing on the ground. Args: distanceFallenThisTick, onGround -+ */ -+ protected void updateFallState(double par1, boolean par3) { -+ if (!this.isInWater()) { - this.handleWaterMovement(); - } - -- if(var3 && this.fallDistance > 0.0F) { -+ if (par3 && this.fallDistance > 0.0F) { - int var4 = MathHelper.floor_double(this.posX); -- int var5 = MathHelper.floor_double(this.posY - (double)0.2F - (double)this.yOffset); -+ int var5 = MathHelper.floor_double(this.posY - 0.20000000298023224D - (double)this.yOffset); - int var6 = MathHelper.floor_double(this.posZ); - int var7 = this.worldObj.getBlockId(var4, var5, var6); -- if(var7 == 0) { -+ -+ if (var7 == 0) { - int var8 = this.worldObj.blockGetRenderType(var4, var5 - 1, var6); -- if(var8 == 11 || var8 == 32 || var8 == 21) { -+ -+ if (var8 == 11 || var8 == 32 || var8 == 21) { - var7 = this.worldObj.getBlockId(var4, var5 - 1, var6); - } - } - -- if(var7 > 0) { -+ if (var7 > 0) { - Block.blocksList[var7].onFallenUpon(this.worldObj, var4, var5, var6, this, this.fallDistance); - } - } - -- super.updateFallState(var1, var3); -+ super.updateFallState(par1, par3); - } - - public boolean canBreatheUnderwater() { - return false; - } - -+ /** -+ * Gets called every tick from main Entity class -+ */ - public void onEntityUpdate() { - this.prevSwingProgress = this.swingProgress; - super.onEntityUpdate(); - this.worldObj.theProfiler.startSection("livingEntityBaseTick"); -- if(this.isEntityAlive() && this.isEntityInsideOpaqueBlock()) { -+ -+ if (this.isEntityAlive() && this.isEntityInsideOpaqueBlock()) { - this.attackEntityFrom(DamageSource.inWall, 1.0F); - } - -- if(this.isImmuneToFire() || this.worldObj.isRemote) { -+ if (this.isImmuneToFire() || this.worldObj.isRemote) { - this.extinguish(); - } - - boolean var1 = this instanceof EntityPlayer && ((EntityPlayer)this).capabilities.disableDamage; -- if(this.isEntityAlive() && this.isInsideOfMaterial(Material.water)) { -- if(!this.canBreatheUnderwater() && !this.isPotionActive(Potion.waterBreathing.id) && !var1) { -+ -+ if (this.isEntityAlive() && this.isInsideOfMaterial(Material.water)) { -+ if (!this.canBreatheUnderwater() && !this.isPotionActive(Potion.waterBreathing.id) && !var1) { - this.setAir(this.decreaseAirSupply(this.getAir())); -- if(this.getAir() == -20) { -+ -+ if (this.getAir() == -20) { - this.setAir(0); - -- for(int var2 = 0; var2 < 8; ++var2) { -- float var3 = this.ab.nextFloat() - this.ab.nextFloat(); -- float var4 = this.ab.nextFloat() - this.ab.nextFloat(); -- float var5 = this.ab.nextFloat() - this.ab.nextFloat(); -+ for (int var2 = 0; var2 < 8; ++var2) { -+ float var3 = this.rand.nextFloat() - this.rand.nextFloat(); -+ float var4 = this.rand.nextFloat() - this.rand.nextFloat(); -+ float var5 = this.rand.nextFloat() - this.rand.nextFloat(); - this.worldObj.spawnParticle("bubble", this.posX + (double)var3, this.posY + (double)var4, this.posZ + (double)var5, this.motionX, this.motionY, this.motionZ); - } - -@@ -158,41 +266,45 @@ - } - - this.extinguish(); -- if(!this.worldObj.isRemote && this.isRiding() && this.ridingEntity instanceof EntityLivingBase) { -+ -+ if (!this.worldObj.isRemote && this.isRiding() && this.ridingEntity instanceof EntityLivingBase) { - this.mountEntity((Entity)null); - } - } else { -- this.setAir(300); -+ // Spout Start - 300 to maxAir -+ this.setAir(maxAir); -+ // Spout End - } - - this.prevCameraPitch = this.cameraPitch; -- if(this.attackTime > 0) { -+ -+ if (this.attackTime > 0) { - --this.attackTime; - } - -- if(this.hurtTime > 0) { -+ if (this.hurtTime > 0) { - --this.hurtTime; - } - -- if(this.hurtResistantTime > 0) { -+ if (this.hurtResistantTime > 0) { - --this.hurtResistantTime; - } - -- if(this.getHealth() <= 0.0F) { -+ if (this.getHealth() <= 0.0F) { - this.onDeathUpdate(); - } - -- if(this.recentlyHit > 0) { -+ if (this.recentlyHit > 0) { - --this.recentlyHit; - } else { - this.attackingPlayer = null; - } - -- if(this.lastAttacker != null && !this.lastAttacker.isEntityAlive()) { -+ if (this.lastAttacker != null && !this.lastAttacker.isEntityAlive()) { - this.lastAttacker = null; - } - -- if(this.entityLivingToAttack != null && !this.entityLivingToAttack.isEntityAlive()) { -+ if (this.entityLivingToAttack != null && !this.entityLivingToAttack.isEntityAlive()) { - this.setRevengeTarget((EntityLivingBase)null); - } - -@@ -205,18 +317,26 @@ - this.worldObj.theProfiler.endSection(); - } - -+ /** -+ * If Animal, checks if the age timer is negative -+ */ - public boolean isChild() { - return false; - } - -+ /** -+ * handles entity death timer, experience orb and particle creation -+ */ - protected void onDeathUpdate() { - ++this.deathTime; -- if(this.deathTime == 20) { -+ -+ if (this.deathTime == 20) { - int var1; -- if(!this.worldObj.isRemote && (this.recentlyHit > 0 || this.isPlayer()) && !this.isChild() && this.worldObj.getGameRules().getGameRuleBooleanValue("doMobLoot")) { -+ -+ if (!this.worldObj.isRemote && (this.recentlyHit > 0 || this.isPlayer()) && !this.isChild() && this.worldObj.getGameRules().getGameRuleBooleanValue("doMobLoot")) { - var1 = this.getExperiencePoints(this.attackingPlayer); - -- while(var1 > 0) { -+ while (var1 > 0) { - int var2 = EntityXPOrb.getXPSplit(var1); - var1 -= var2; - this.worldObj.spawnEntityInWorld(new EntityXPOrb(this.worldObj, this.posX, this.posY, this.posZ, var2)); -@@ -225,31 +345,39 @@ - - this.setDead(); - -- for(var1 = 0; var1 < 20; ++var1) { -- double var8 = this.ab.nextGaussian() * 0.02D; -- double var4 = this.ab.nextGaussian() * 0.02D; -- double var6 = this.ab.nextGaussian() * 0.02D; -- this.worldObj.spawnParticle("explode", this.posX + (double)(this.ab.nextFloat() * this.width * 2.0F) - (double)this.width, this.posY + (double)(this.ab.nextFloat() * this.height), this.posZ + (double)(this.ab.nextFloat() * this.width * 2.0F) - (double)this.width, var8, var4, var6); -+ for (var1 = 0; var1 < 20; ++var1) { -+ double var8 = this.rand.nextGaussian() * 0.02D; -+ double var4 = this.rand.nextGaussian() * 0.02D; -+ double var6 = this.rand.nextGaussian() * 0.02D; -+ this.worldObj.spawnParticle("explode", this.posX + (double)(this.rand.nextFloat() * this.width * 2.0F) - (double)this.width, this.posY + (double)(this.rand.nextFloat() * this.height), this.posZ + (double)(this.rand.nextFloat() * this.width * 2.0F) - (double)this.width, var8, var4, var6); - } - } -- - } - -- protected int decreaseAirSupply(int var1) { -+ /** -+ * Decrements the entity's air supply when underwater -+ */ -+ protected int decreaseAirSupply(int par1) { - int var2 = EnchantmentHelper.getRespiration(this); -- return var2 > 0 && this.ab.nextInt(var2 + 1) > 0 ? var1 : var1 - 1; -+ return var2 > 0 && this.rand.nextInt(var2 + 1) > 0 ? par1 : par1 - 1; - } - -- protected int getExperiencePoints(EntityPlayer var1) { -+ /** -+ * Get the experience points the entity currently has. -+ */ -+ protected int getExperiencePoints(EntityPlayer par1EntityPlayer) { - return 0; - } - -+ /** -+ * Only use is to identify if class is an instance of player for experience dropping -+ */ - protected boolean isPlayer() { - return false; - } - - public Random getRNG() { -- return this.ab; -+ return this.rand; - } - - public EntityLivingBase getAITarget() { -@@ -260,8 +388,8 @@ - return this.revengeTimer; - } - -- public void setRevengeTarget(EntityLivingBase var1) { -- this.entityLivingToAttack = var1; -+ public void setRevengeTarget(EntityLivingBase par1EntityLivingBase) { -+ this.entityLivingToAttack = par1EntityLivingBase; - this.revengeTimer = this.ticksExisted; - } - -@@ -273,9 +401,9 @@ - return this.lastAttackerTime; - } - -- public void setLastAttacker(Entity var1) { -- if(var1 instanceof EntityLivingBase) { -- this.lastAttacker = (EntityLivingBase)var1; -+ public void setLastAttacker(Entity par1Entity) { -+ if (par1Entity instanceof EntityLivingBase) { -+ this.lastAttacker = (EntityLivingBase)par1Entity; - } else { - this.lastAttacker = null; - } -@@ -287,189 +415,209 @@ - return this.entityAge; - } - -- public void writeEntityToNBT(NBTTagCompound var1) { -- var1.setFloat("HealF", this.getHealth()); -- var1.setShort("Health", (short)((int)Math.ceil((double)this.getHealth()))); -- var1.setShort("HurtTime", (short)this.hurtTime); -- var1.setShort("DeathTime", (short)this.deathTime); -- var1.setShort("AttackTime", (short)this.attackTime); -- var1.setFloat("AbsorptionAmount", this.getAbsorptionAmount()); -- ItemStack[] var2 = this.getInventory(); -+ /** -+ * (abstract) Protected helper method to write subclass entity data to NBT. -+ */ -+ public void writeEntityToNBT(NBTTagCompound par1NBTTagCompound) { -+ MobRandomizer$ExtraInfo.writeToNBT(this, par1NBTTagCompound); -+ par1NBTTagCompound.setFloat("HealF", this.getHealth()); -+ par1NBTTagCompound.setShort("Health", (short)((int)Math.ceil((double)this.getHealth()))); -+ par1NBTTagCompound.setShort("HurtTime", (short)this.hurtTime); -+ par1NBTTagCompound.setShort("DeathTime", (short)this.deathTime); -+ par1NBTTagCompound.setShort("AttackTime", (short)this.attackTime); -+ par1NBTTagCompound.setFloat("AbsorptionAmount", this.getAbsorptionAmount()); -+ ItemStack[] var2 = this.getLastActiveItems(); - int var3 = var2.length; -- - int var4; - ItemStack var5; -- for(var4 = 0; var4 < var3; ++var4) { -+ -+ for (var4 = 0; var4 < var3; ++var4) { - var5 = var2[var4]; -- if(var5 != null) { -+ -+ if (var5 != null) { - this.attributeMap.removeAttributeModifiers(var5.getAttributeModifiers()); - } - } - -- var1.setTag("Attributes", SharedMonsterAttributes.func_111257_a(this.getAttributeMap())); -- var2 = this.getInventory(); -+ par1NBTTagCompound.setTag("Attributes", SharedMonsterAttributes.func_111257_a(this.getAttributeMap())); -+ var2 = this.getLastActiveItems(); - var3 = var2.length; - -- for(var4 = 0; var4 < var3; ++var4) { -+ for (var4 = 0; var4 < var3; ++var4) { - var5 = var2[var4]; -- if(var5 != null) { -+ -+ if (var5 != null) { - this.attributeMap.applyAttributeModifiers(var5.getAttributeModifiers()); - } - } - -- if(!this.f.isEmpty()) { -+ if (!this.activePotionsMap.isEmpty()) { - NBTTagList var6 = new NBTTagList(); -- Iterator var7 = this.f.values().iterator(); -+ Iterator var7 = this.activePotionsMap.values().iterator(); - -- while(var7.hasNext()) { -+ while (var7.hasNext()) { - PotionEffect var8 = (PotionEffect)var7.next(); - var6.appendTag(var8.writeCustomPotionEffectToNBT(new NBTTagCompound())); - } - -- var1.setTag("ActiveEffects", var6); -+ par1NBTTagCompound.setTag("ActiveEffects", var6); - } -- - } - -- public void readEntityFromNBT(NBTTagCompound var1) { -- this.setAbsorptionAmount(var1.getFloat("AbsorptionAmount")); -- if(var1.hasKey("Attributes") && this.worldObj != null && !this.worldObj.isRemote) { -- SharedMonsterAttributes.func_111260_a(this.getAttributeMap(), var1.getTagList("Attributes"), this.worldObj == null ? null : this.worldObj.getWorldLogAgent()); -+ /** -+ * (abstract) Protected helper method to read subclass entity data from NBT. -+ */ -+ public void readEntityFromNBT(NBTTagCompound par1NBTTagCompound) { -+ MobRandomizer$ExtraInfo.readFromNBT(this, par1NBTTagCompound); -+ this.setAbsorptionAmount(par1NBTTagCompound.getFloat("AbsorptionAmount")); -+ -+ if (par1NBTTagCompound.hasKey("Attributes") && this.worldObj != null && !this.worldObj.isRemote) { -+ SharedMonsterAttributes.func_111260_a(this.getAttributeMap(), par1NBTTagCompound.getTagList("Attributes"), this.worldObj == null ? null : this.worldObj.getWorldLogAgent()); - } - -- if(var1.hasKey("ActiveEffects")) { -- NBTTagList var2 = var1.getTagList("ActiveEffects"); -+ if (par1NBTTagCompound.hasKey("ActiveEffects")) { -+ NBTTagList var2 = par1NBTTagCompound.getTagList("ActiveEffects"); - -- for(int var3 = 0; var3 < var2.tagCount(); ++var3) { -+ for (int var3 = 0; var3 < var2.tagCount(); ++var3) { - NBTTagCompound var4 = (NBTTagCompound)var2.tagAt(var3); - PotionEffect var5 = PotionEffect.readCustomPotionEffectFromNBT(var4); -- this.f.put(Integer.valueOf(var5.getPotionID()), var5); -+ this.activePotionsMap.put(Integer.valueOf(var5.getPotionID()), var5); - } - } - -- if(var1.hasKey("HealF")) { -- this.setHealth(var1.getFloat("HealF")); -+ if (par1NBTTagCompound.hasKey("HealF")) { -+ this.setHealth(par1NBTTagCompound.getFloat("HealF")); - } else { -- NBTBase var6 = var1.getTag("Health"); -- if(var6 == null) { -+ NBTBase var6 = par1NBTTagCompound.getTag("Health"); -+ -+ if (var6 == null) { - this.setHealth(this.getMaxHealth()); -- } else if(var6.getId() == 5) { -+ } else if (var6.getId() == 5) { - this.setHealth(((NBTTagFloat)var6).data); -- } else if(var6.getId() == 2) { -+ } else if (var6.getId() == 2) { - this.setHealth((float)((NBTTagShort)var6).data); - } - } - -- this.hurtTime = var1.getShort("HurtTime"); -- this.deathTime = var1.getShort("DeathTime"); -- this.attackTime = var1.getShort("AttackTime"); -+ this.hurtTime = par1NBTTagCompound.getShort("HurtTime"); -+ this.deathTime = par1NBTTagCompound.getShort("DeathTime"); -+ this.attackTime = par1NBTTagCompound.getShort("AttackTime"); - } - - protected void updatePotionEffects() { -- Iterator var1 = this.f.keySet().iterator(); -+ Iterator var1 = this.activePotionsMap.keySet().iterator(); - -- while(var1.hasNext()) { -+ while (var1.hasNext()) { - Integer var2 = (Integer)var1.next(); -- PotionEffect var3 = (PotionEffect)this.f.get(var2); -- if(!var3.onUpdate(this)) { -- if(!this.worldObj.isRemote) { -+ PotionEffect var3 = (PotionEffect)this.activePotionsMap.get(var2); -+ -+ if (!var3.onUpdate(this)) { -+ if (!this.worldObj.isRemote) { - var1.remove(); - this.onFinishedPotionEffect(var3); - } -- } else if(var3.getDuration() % 600 == 0) { -+ } else if (var3.getDuration() % 600 == 0) { - this.onChangedPotionEffect(var3, false); - } - } - - int var11; -- if(this.potionsNeedUpdate) { -- if(!this.worldObj.isRemote) { -- if(this.f.isEmpty()) { -- this.dataWatcher.updateObject(8, Byte.valueOf((byte)0)); -- this.dataWatcher.updateObject(7, Integer.valueOf(0)); -- this.setInvisible(false); -- } else { -- var11 = PotionHelper.calcPotionLiquidColor(this.f.values()); -- this.dataWatcher.updateObject(8, Byte.valueOf((byte)(PotionHelper.func_82817_b(this.f.values()) ? 1 : 0))); -- this.dataWatcher.updateObject(7, Integer.valueOf(var11)); -- this.setInvisible(this.isPotionActive(Potion.invisibility.id)); -- } -+ -+ if (this.potionsNeedUpdate) { -+ if (this.activePotionsMap.isEmpty()) { -+ this.dataWatcher.updateObject(8, Byte.valueOf((byte)0)); -+ this.dataWatcher.updateObject(7, Integer.valueOf(0)); -+ this.overridePotionColor = 0; -+ this.setInvisible(false); -+ } else { -+ var11 = PotionHelper.calcPotionLiquidColor(this.activePotionsMap.values()); -+ this.dataWatcher.updateObject(8, Byte.valueOf((byte)(PotionHelper.func_82817_b(this.activePotionsMap.values()) ? 1 : 0))); -+ this.dataWatcher.updateObject(7, Integer.valueOf(var11)); -+ this.overridePotionColor = var11; -+ this.setInvisible(this.isPotionActive(Potion.invisibility.id)); - } - - this.potionsNeedUpdate = false; - } - -- var11 = this.dataWatcher.getWatchableObjectInt(7); -+ var11 = ColorizeEntity.getPotionEffectColor(this.dataWatcher.getWatchableObjectInt(7), this); - boolean var12 = this.dataWatcher.getWatchableObjectByte(8) > 0; -- if(var11 > 0) { -+ -+ if (var11 > 0) { - boolean var4 = false; -- if(!this.isInvisible()) { -- var4 = this.ab.nextBoolean(); -+ -+ if (!this.isInvisible()) { -+ var4 = this.rand.nextBoolean(); - } else { -- var4 = this.ab.nextInt(15) == 0; -- } -- -- if(var12) { -- var4 &= this.ab.nextInt(5) == 0; -- } -- -- if(var4 && var11 > 0) { -+ var4 = this.rand.nextInt(15) == 0; -+ } -+ -+ if (var12) { -+ var4 &= this.rand.nextInt(5) == 0; -+ } -+ -+ if (var4 && var11 > 0) { - double var5 = (double)(var11 >> 16 & 255) / 255.0D; - double var7 = (double)(var11 >> 8 & 255) / 255.0D; - double var9 = (double)(var11 >> 0 & 255) / 255.0D; -- this.worldObj.spawnParticle(var12 ? "mobSpellAmbient" : "mobSpell", this.posX + (this.ab.nextDouble() - 0.5D) * (double)this.width, this.posY + this.ab.nextDouble() * (double)this.height - (double)this.yOffset, this.posZ + (this.ab.nextDouble() - 0.5D) * (double)this.width, var5, var7, var9); -+ this.worldObj.spawnParticle(var12 ? "mobSpellAmbient" : "mobSpell", this.posX + (this.rand.nextDouble() - 0.5D) * (double)this.width, this.posY + this.rand.nextDouble() * (double)this.height - (double)this.yOffset, this.posZ + (this.rand.nextDouble() - 0.5D) * (double)this.width, var5, var7, var9); - } - } -- - } - - public void clearActivePotions() { -- Iterator var1 = this.f.keySet().iterator(); -+ Iterator var1 = this.activePotionsMap.keySet().iterator(); - -- while(var1.hasNext()) { -+ while (var1.hasNext()) { - Integer var2 = (Integer)var1.next(); -- PotionEffect var3 = (PotionEffect)this.f.get(var2); -- if(!this.worldObj.isRemote) { -+ PotionEffect var3 = (PotionEffect)this.activePotionsMap.get(var2); -+ -+ if (!this.worldObj.isRemote) { - var1.remove(); - this.onFinishedPotionEffect(var3); - } - } -- - } - - public Collection getActivePotionEffects() { -- return this.f.values(); -- } -- -- public boolean isPotionActive(int var1) { -- return this.f.containsKey(Integer.valueOf(var1)); -- } -- -- public boolean isPotionActive(Potion var1) { -- return this.f.containsKey(Integer.valueOf(var1.id)); -- } -- -- public PotionEffect getActivePotionEffect(Potion var1) { -- return (PotionEffect)this.f.get(Integer.valueOf(var1.id)); -- } -- -- public void addPotionEffect(PotionEffect var1) { -- if(this.isPotionApplicable(var1)) { -- if(this.f.containsKey(Integer.valueOf(var1.getPotionID()))) { -- ((PotionEffect)this.f.get(Integer.valueOf(var1.getPotionID()))).combine(var1); -- this.onChangedPotionEffect((PotionEffect)this.f.get(Integer.valueOf(var1.getPotionID())), true); -+ return this.activePotionsMap.values(); -+ } -+ -+ public boolean isPotionActive(int par1) { -+ return this.activePotionsMap.containsKey(Integer.valueOf(par1)); -+ } -+ -+ public boolean isPotionActive(Potion par1Potion) { -+ return this.activePotionsMap.containsKey(Integer.valueOf(par1Potion.id)); -+ } -+ -+ /** -+ * returns the PotionEffect for the supplied Potion if it is active, null otherwise. -+ */ -+ public PotionEffect getActivePotionEffect(Potion par1Potion) { -+ return (PotionEffect)this.activePotionsMap.get(Integer.valueOf(par1Potion.id)); -+ } -+ -+ /** -+ * adds a PotionEffect to the entity -+ */ -+ public void addPotionEffect(PotionEffect par1PotionEffect) { -+ if (this.isPotionApplicable(par1PotionEffect)) { -+ if (this.activePotionsMap.containsKey(Integer.valueOf(par1PotionEffect.getPotionID()))) { -+ ((PotionEffect)this.activePotionsMap.get(Integer.valueOf(par1PotionEffect.getPotionID()))).combine(par1PotionEffect); -+ this.onChangedPotionEffect((PotionEffect)this.activePotionsMap.get(Integer.valueOf(par1PotionEffect.getPotionID())), true); - } else { -- this.f.put(Integer.valueOf(var1.getPotionID()), var1); -- this.onNewPotionEffect(var1); -+ this.activePotionsMap.put(Integer.valueOf(par1PotionEffect.getPotionID()), par1PotionEffect); -+ this.onNewPotionEffect(par1PotionEffect); - } -- - } - } - -- public boolean isPotionApplicable(PotionEffect var1) { -- if(this.getCreatureAttribute() == EnumCreatureAttribute.UNDEAD) { -- int var2 = var1.getPotionID(); -- if(var2 == Potion.regeneration.id || var2 == Potion.poison.id) { -+ public boolean isPotionApplicable(PotionEffect par1PotionEffect) { -+ if (this.getCreatureAttribute() == EnumCreatureAttribute.UNDEAD) { -+ int var2 = par1PotionEffect.getPotionID(); -+ -+ if (var2 == Potion.regeneration.id || var2 == Potion.poison.id) { - return false; - } - } -@@ -477,145 +625,165 @@ - return true; - } - -+ /** -+ * Returns true if this entity is undead. -+ */ - public boolean isEntityUndead() { - return this.getCreatureAttribute() == EnumCreatureAttribute.UNDEAD; - } - -- public void removePotionEffectClient(int var1) { -- this.f.remove(Integer.valueOf(var1)); -+ /** -+ * Remove the speified potion effect from this entity. -+ */ -+ public void removePotionEffectClient(int par1) { -+ this.activePotionsMap.remove(Integer.valueOf(par1)); - } - -- public void removePotionEffect(int var1) { -- PotionEffect var2 = (PotionEffect)this.f.remove(Integer.valueOf(var1)); -- if(var2 != null) { -+ /** -+ * Remove the specified potion effect from this entity. -+ */ -+ public void removePotionEffect(int par1) { -+ PotionEffect var2 = (PotionEffect)this.activePotionsMap.remove(Integer.valueOf(par1)); -+ -+ if (var2 != null) { - this.onFinishedPotionEffect(var2); - } -- -- } -- -- protected void onNewPotionEffect(PotionEffect var1) { -- this.potionsNeedUpdate = true; -- if(!this.worldObj.isRemote) { -- Potion.potionTypes[var1.getPotionID()].applyAttributesModifiersToEntity(this, this.getAttributeMap(), var1.getAmplifier()); -- } -- -- } -- -- protected void onChangedPotionEffect(PotionEffect var1, boolean var2) { -- this.potionsNeedUpdate = true; -- if(var2 && !this.worldObj.isRemote) { -- Potion.potionTypes[var1.getPotionID()].removeAttributesModifiersFromEntity(this, this.getAttributeMap(), var1.getAmplifier()); -- Potion.potionTypes[var1.getPotionID()].applyAttributesModifiersToEntity(this, this.getAttributeMap(), var1.getAmplifier()); -- } -- -- } -- -- protected void onFinishedPotionEffect(PotionEffect var1) { -- this.potionsNeedUpdate = true; -- if(!this.worldObj.isRemote) { -- Potion.potionTypes[var1.getPotionID()].removeAttributesModifiersFromEntity(this, this.getAttributeMap(), var1.getAmplifier()); -- } -- -- } -- -- public void heal(float var1) { -+ } -+ -+ protected void onNewPotionEffect(PotionEffect par1PotionEffect) { -+ this.potionsNeedUpdate = true; -+ -+ if (!this.worldObj.isRemote) { -+ Potion.potionTypes[par1PotionEffect.getPotionID()].applyAttributesModifiersToEntity(this, this.getAttributeMap(), par1PotionEffect.getAmplifier()); -+ } -+ } -+ -+ protected void onChangedPotionEffect(PotionEffect par1PotionEffect, boolean par2) { -+ this.potionsNeedUpdate = true; -+ -+ if (par2 && !this.worldObj.isRemote) { -+ Potion.potionTypes[par1PotionEffect.getPotionID()].removeAttributesModifiersFromEntity(this, this.getAttributeMap(), par1PotionEffect.getAmplifier()); -+ Potion.potionTypes[par1PotionEffect.getPotionID()].applyAttributesModifiersToEntity(this, this.getAttributeMap(), par1PotionEffect.getAmplifier()); -+ } -+ } -+ -+ protected void onFinishedPotionEffect(PotionEffect par1PotionEffect) { -+ this.potionsNeedUpdate = true; -+ -+ if (!this.worldObj.isRemote) { -+ Potion.potionTypes[par1PotionEffect.getPotionID()].removeAttributesModifiersFromEntity(this, this.getAttributeMap(), par1PotionEffect.getAmplifier()); -+ } -+ } -+ -+ /** -+ * Heal living entity (param: amount of half-hearts) -+ */ -+ public void heal(float par1) { - float var2 = this.getHealth(); -- if(var2 > 0.0F) { -- this.setHealth(var2 + var1); -- } - -+ if (var2 > 0.0F) { -+ this.setHealth(var2 + par1); -+ } - } - - public final float getHealth() { - return this.dataWatcher.getWatchableObjectFloat(6); - } - -- public void setHealth(float var1) { -- this.dataWatcher.updateObject(6, Float.valueOf(MathHelper.clamp_float(var1, 0.0F, this.getMaxHealth()))); -+ public void setHealth(float par1) { -+ this.dataWatcher.updateObject(6, Float.valueOf(MathHelper.clamp_float(par1, 0.0F, this.getMaxHealth()))); - } - -- public boolean attackEntityFrom(DamageSource var1, float var2) { -- if(this.isEntityInvulnerable()) { -+ /** -+ * Called when the entity is attacked. -+ */ -+ public boolean attackEntityFrom(DamageSource par1DamageSource, float par2) { -+ if (this.isEntityInvulnerable()) { - return false; -- } else if(this.worldObj.isRemote) { -+ } else if (this.worldObj.isRemote) { - return false; - } else { - this.entityAge = 0; -- if(this.getHealth() <= 0.0F) { -+ -+ if (this.getHealth() <= 0.0F) { - return false; -- } else if(var1.isFireDamage() && this.isPotionActive(Potion.fireResistance)) { -+ } else if (par1DamageSource.isFireDamage() && this.isPotionActive(Potion.fireResistance)) { - return false; - } else { -- if((var1 == DamageSource.anvil || var1 == DamageSource.fallingBlock) && this.getEquipmentInSlot(4) != null) { -- this.getEquipmentInSlot(4).damageItem((int)(var2 * 4.0F + this.ab.nextFloat() * var2 * 2.0F), this); -- var2 *= 12.0F / 16.0F; -+ if ((par1DamageSource == DamageSource.anvil || par1DamageSource == DamageSource.fallingBlock) && this.getCurrentItemOrArmor(4) != null) { -+ this.getCurrentItemOrArmor(4).damageItem((int)(par2 * 4.0F + this.rand.nextFloat() * par2 * 2.0F), this); -+ par2 *= 0.75F; - } - - this.limbSwingAmount = 1.5F; - boolean var3 = true; -- if((float)this.hurtResistantTime > (float)this.maxHurtResistantTime / 2.0F) { -- if(var2 <= this.lastDamage) { -+ -+ if ((float)this.hurtResistantTime > (float)this.maxHurtResistantTime / 2.0F) { -+ if (par2 <= this.lastDamage) { - return false; - } - -- this.damageEntity(var1, var2 - this.lastDamage); -- this.lastDamage = var2; -+ this.damageEntity(par1DamageSource, par2 - this.lastDamage); -+ this.lastDamage = par2; - var3 = false; - } else { -- this.lastDamage = var2; -+ this.lastDamage = par2; - this.prevHealth = this.getHealth(); - this.hurtResistantTime = this.maxHurtResistantTime; -- this.damageEntity(var1, var2); -+ this.damageEntity(par1DamageSource, par2); - this.hurtTime = this.maxHurtTime = 10; - } - - this.attackedAtYaw = 0.0F; -- Entity var4 = var1.getEntity(); -- if(var4 != null) { -- if(var4 instanceof EntityLivingBase) { -+ Entity var4 = par1DamageSource.getEntity(); -+ -+ if (var4 != null) { -+ if (var4 instanceof EntityLivingBase) { - this.setRevengeTarget((EntityLivingBase)var4); - } - -- if(var4 instanceof EntityPlayer) { -+ if (var4 instanceof EntityPlayer) { - this.recentlyHit = 100; - this.attackingPlayer = (EntityPlayer)var4; -- } else if(var4 instanceof EntityWolf) { -+ } else if (var4 instanceof EntityWolf) { - EntityWolf var5 = (EntityWolf)var4; -- if(var5.isTamed()) { -+ -+ if (var5.isTamed()) { - this.recentlyHit = 100; - this.attackingPlayer = null; - } - } - } - -- if(var3) { -+ if (var3) { - this.worldObj.setEntityState(this, (byte)2); -- if(var1 != DamageSource.drown) { -+ -+ if (par1DamageSource != DamageSource.drown) { - this.setBeenAttacked(); - } - -- if(var4 != null) { -+ if (var4 != null) { - double var9 = var4.posX - this.posX; -- - double var7; -- for(var7 = var4.posZ - this.posZ; var9 * var9 + var7 * var7 < 1.0E-4D; var7 = (Math.random() - Math.random()) * 0.01D) { -+ -+ for (var7 = var4.posZ - this.posZ; var9 * var9 + var7 * var7 < 1.0E-4D; var7 = (Math.random() - Math.random()) * 0.01D) { - var9 = (Math.random() - Math.random()) * 0.01D; - } - -- this.attackedAtYaw = (float)(Math.atan2(var7, var9) * 180.0D / (double)((float)Math.PI)) - this.rotationYaw; -- this.knockBack(var4, var2, var9, var7); -+ this.attackedAtYaw = (float)(Math.atan2(var7, var9) * 180.0D / Math.PI) - this.rotationYaw; -+ this.knockBack(var4, par2, var9, var7); - } else { - this.attackedAtYaw = (float)((int)(Math.random() * 2.0D) * 180); - } - } - -- if(this.getHealth() <= 0.0F) { -- if(var3) { -+ if (this.getHealth() <= 0.0F) { -+ if (var3) { - this.playSound(this.getDeathSound(), this.getSoundVolume(), this.getSoundPitch()); - } - -- this.onDeath(var1); -- } else if(var3) { -+ this.onDeath(par1DamageSource); -+ } else if (var3) { - this.playSound(this.getHurtSound(), this.getSoundVolume(), this.getSoundPitch()); - } - -@@ -624,46 +792,56 @@ - } - } - -- public void renderBrokenItemStack(ItemStack var1) { -- this.playSound("random.break", 0.8F, 0.8F + this.worldObj.s.nextFloat() * 0.4F); -+ /** -+ * Renders broken item particles using the given ItemStack -+ */ -+ public void renderBrokenItemStack(ItemStack par1ItemStack) { -+ this.playSound("random.break", 0.8F, 0.8F + this.worldObj.rand.nextFloat() * 0.4F); - -- for(int var2 = 0; var2 < 5; ++var2) { -- Vec3 var3 = this.worldObj.getWorldVec3Pool().getVecFromPool(((double)this.ab.nextFloat() - 0.5D) * 0.1D, Math.random() * 0.1D + 0.1D, 0.0D); -+ for (int var2 = 0; var2 < 5; ++var2) { -+ Vec3 var3 = this.worldObj.getWorldVec3Pool().getVecFromPool(((double)this.rand.nextFloat() - 0.5D) * 0.1D, Math.random() * 0.1D + 0.1D, 0.0D); - var3.rotateAroundX(-this.rotationPitch * (float)Math.PI / 180.0F); - var3.rotateAroundY(-this.rotationYaw * (float)Math.PI / 180.0F); -- Vec3 var4 = this.worldObj.getWorldVec3Pool().getVecFromPool(((double)this.ab.nextFloat() - 0.5D) * 0.3D, (double)(-this.ab.nextFloat()) * 0.6D - 0.3D, 0.6D); -+ Vec3 var4 = this.worldObj.getWorldVec3Pool().getVecFromPool(((double)this.rand.nextFloat() - 0.5D) * 0.3D, (double)(-this.rand.nextFloat()) * 0.6D - 0.3D, 0.6D); - var4.rotateAroundX(-this.rotationPitch * (float)Math.PI / 180.0F); - var4.rotateAroundY(-this.rotationYaw * (float)Math.PI / 180.0F); - var4 = var4.addVector(this.posX, this.posY + (double)this.getEyeHeight(), this.posZ); -- this.worldObj.spawnParticle("iconcrack_" + var1.getItem().itemID, var4.xCoord, var4.yCoord, var4.zCoord, var3.xCoord, var3.yCoord + 0.05D, var3.zCoord); -+ this.worldObj.spawnParticle("iconcrack_" + par1ItemStack.getItem().itemID, var4.xCoord, var4.yCoord, var4.zCoord, var3.xCoord, var3.yCoord + 0.05D, var3.zCoord); - } -- - } - -- public void onDeath(DamageSource var1) { -- Entity var2 = var1.getEntity(); -+ /** -+ * Called when the mob's health reaches 0. -+ */ -+ public void onDeath(DamageSource par1DamageSource) { -+ Entity var2 = par1DamageSource.getEntity(); - EntityLivingBase var3 = this.func_94060_bK(); -- if(this.scoreValue >= 0 && var3 != null) { -+ -+ if (this.scoreValue >= 0 && var3 != null) { - var3.addToPlayerScore(this, this.scoreValue); - } - -- if(var2 != null) { -+ if (var2 != null) { - var2.onKillEntity(this); - } - - this.dead = true; -- if(!this.worldObj.isRemote) { -+ -+ if (!this.worldObj.isRemote) { - int var4 = 0; -- if(var2 instanceof EntityPlayer) { -+ -+ if (var2 instanceof EntityPlayer) { - var4 = EnchantmentHelper.getLootingModifier((EntityLivingBase)var2); - } - -- if(!this.isChild() && this.worldObj.getGameRules().getGameRuleBooleanValue("doMobLoot")) { -+ if (!this.isChild() && this.worldObj.getGameRules().getGameRuleBooleanValue("doMobLoot")) { - this.dropFewItems(this.recentlyHit > 0, var4); - this.dropEquipment(this.recentlyHit > 0, var4); -- if(this.recentlyHit > 0) { -- int var5 = this.ab.nextInt(200) - var4; -- if(var5 < 5) { -+ -+ if (this.recentlyHit > 0) { -+ int var5 = this.rand.nextInt(200) - var4; -+ -+ if (var5 < 5) { - this.dropRareDrop(var5 <= 0 ? 1 : 0); - } - } -@@ -673,41 +851,57 @@ - this.worldObj.setEntityState(this, (byte)3); - } - -- protected void dropEquipment(boolean var1, int var2) { -- } -+ /** -+ * Drop the equipment for this entity. -+ */ -+ protected void dropEquipment(boolean par1, int par2) {} - -- public void knockBack(Entity var1, float var2, double var3, double var5) { -- if(this.ab.nextDouble() >= this.getEntityAttribute(SharedMonsterAttributes.knockbackResistance).getAttributeValue()) { -+ /** -+ * knocks back this entity -+ */ -+ public void knockBack(Entity par1Entity, float par2, double par3, double par5) { -+ if (this.rand.nextDouble() >= this.getEntityAttribute(SharedMonsterAttributes.knockbackResistance).getAttributeValue()) { - this.isAirBorne = true; -- float var7 = MathHelper.sqrt_double(var3 * var3 + var5 * var5); -+ float var7 = MathHelper.sqrt_double(par3 * par3 + par5 * par5); - float var8 = 0.4F; - this.motionX /= 2.0D; - this.motionY /= 2.0D; - this.motionZ /= 2.0D; -- this.motionX -= var3 / (double)var7 * (double)var8; -+ this.motionX -= par3 / (double)var7 * (double)var8; - this.motionY += (double)var8; -- this.motionZ -= var5 / (double)var7 * (double)var8; -- if(this.motionY > (double)0.4F) { -- this.motionY = (double)0.4F; -+ this.motionZ -= par5 / (double)var7 * (double)var8; -+ -+ if (this.motionY > 0.4000000059604645D) { -+ this.motionY = 0.4000000059604645D; - } -- - } - } - -+ /** -+ * Returns the sound this mob makes when it is hurt. -+ */ - protected String getHurtSound() { - return "damage.hit"; - } - -+ /** -+ * Returns the sound this mob makes on death. -+ */ - protected String getDeathSound() { - return "damage.hit"; - } - -- protected void dropRareDrop(int var1) { -- } -- -- protected void dropFewItems(boolean var1, int var2) { -- } -- -+ protected void dropRareDrop(int par1) {} -+ -+ /** -+ * Drop 0-2 items of this living's type. @param par1 - Whether this entity has recently been hit by a player. @param -+ * par2 - Level of Looting used to kill this mob. -+ */ -+ protected void dropFewItems(boolean par1, int par2) {} -+ -+ /** -+ * returns true if this entity is by a ladder, false otherwise -+ */ - public boolean isOnLadder() { - int var1 = MathHelper.floor_double(this.posX); - int var2 = MathHelper.floor_double(this.boundingBox.minY); -@@ -716,45 +910,62 @@ - return var4 == Block.ladder.blockID || var4 == Block.vine.blockID; - } - -+ /** -+ * Checks whether target entity is alive. -+ */ - public boolean isEntityAlive() { - return !this.isDead && this.getHealth() > 0.0F; - } - -- protected void fall(float var1) { -- super.fall(var1); -+ /** -+ * Called when the mob is falling. Calculates and applies fall damage. -+ */ -+ protected void fall(float par1) { -+ super.fall(par1); -+ // Spout Start - Gravity mod -+ par1 *= getData().getGravityMod(); -+ // Spout End - PotionEffect var2 = this.getActivePotionEffect(Potion.jump); - float var3 = var2 != null ? (float)(var2.getAmplifier() + 1) : 0.0F; -- int var4 = MathHelper.ceiling_float_int(var1 - 3.0F - var3); -- if(var4 > 0) { -- if(var4 > 4) { -+ int var4 = MathHelper.ceiling_float_int(par1 - 3.0F - var3); -+ -+ if (var4 > 0) { -+ if (var4 > 4) { - this.playSound("damage.fallbig", 1.0F, 1.0F); - } else { - this.playSound("damage.fallsmall", 1.0F, 1.0F); - } - - this.attackEntityFrom(DamageSource.fall, (float)var4); -- int var5 = this.worldObj.getBlockId(MathHelper.floor_double(this.posX), MathHelper.floor_double(this.posY - (double)0.2F - (double)this.yOffset), MathHelper.floor_double(this.posZ)); -- if(var5 > 0) { -+ int var5 = this.worldObj.getBlockId(MathHelper.floor_double(this.posX), MathHelper.floor_double(this.posY - 0.20000000298023224D - (double)this.yOffset), MathHelper.floor_double(this.posZ)); -+ -+ if (var5 > 0) { - StepSound var6 = Block.blocksList[var5].stepSound; -- this.playSound(var6.getStepSound(), var6.getVolume() * 0.5F, var6.getPitch() * (12.0F / 16.0F)); -+ this.playSound(var6.getStepSound(), var6.getVolume() * 0.5F, var6.getPitch() * 0.75F); - } - } -- - } - -+ /** -+ * Setups the entity to do the hurt animation. Only used by packets in multiplayer. -+ */ - public void performHurtAnimation() { - this.hurtTime = this.maxHurtTime = 10; - this.attackedAtYaw = 0.0F; - } - -+ /** -+ * Returns the current armor value as determined by a call to InventoryPlayer.getTotalArmorValue -+ */ - public int getTotalArmorValue() { - int var1 = 0; -- ItemStack[] var2 = this.getInventory(); -+ ItemStack[] var2 = this.getLastActiveItems(); - int var3 = var2.length; - -- for(int var4 = 0; var4 < var3; ++var4) { -+ for (int var4 = 0; var4 < var3; ++var4) { - ItemStack var5 = var2[var4]; -- if(var5 != null && var5.getItem() instanceof ItemArmor) { -+ -+ if (var5 != null && var5.getItem() instanceof ItemArmor) { - int var6 = ((ItemArmor)var5.getItem()).damageReduceAmount; - var1 += var6; - } -@@ -763,65 +974,78 @@ - return var1; - } - -- protected void damageArmor(float var1) { -- } -+ protected void damageArmor(float par1) {} - -- protected float applyArmorCalculations(DamageSource var1, float var2) { -- if(!var1.isUnblockable()) { -+ /** -+ * Reduces damage, depending on armor -+ */ -+ protected float applyArmorCalculations(DamageSource par1DamageSource, float par2) { -+ if (!par1DamageSource.isUnblockable()) { - int var3 = 25 - this.getTotalArmorValue(); -- float var4 = var2 * (float)var3; -- this.damageArmor(var2); -- var2 = var4 / 25.0F; -+ float var4 = par2 * (float)var3; -+ this.damageArmor(par2); -+ par2 = var4 / 25.0F; - } - -- return var2; -+ return par2; - } - -- protected float applyPotionDamageCalculations(DamageSource var1, float var2) { -- if(this instanceof EntityZombie) { -- var2 = var2; -+ /** -+ * Reduces damage, depending on potions -+ */ -+ protected float applyPotionDamageCalculations(DamageSource par1DamageSource, float par2) { -+ if (this instanceof EntityZombie) { -+ par2 = par2; - } - - int var3; - int var4; - float var5; -- if(this.isPotionActive(Potion.resistance) && var1 != DamageSource.outOfWorld) { -+ -+ if (this.isPotionActive(Potion.resistance) && par1DamageSource != DamageSource.outOfWorld) { - var3 = (this.getActivePotionEffect(Potion.resistance).getAmplifier() + 1) * 5; - var4 = 25 - var3; -- var5 = var2 * (float)var4; -- var2 = var5 / 25.0F; -+ var5 = par2 * (float)var4; -+ par2 = var5 / 25.0F; - } - -- if(var2 <= 0.0F) { -+ if (par2 <= 0.0F) { - return 0.0F; - } else { -- var3 = EnchantmentHelper.getEnchantmentModifierDamage(this.getInventory(), var1); -- if(var3 > 20) { -+ var3 = EnchantmentHelper.getEnchantmentModifierDamage(this.getLastActiveItems(), par1DamageSource); -+ -+ if (var3 > 20) { - var3 = 20; - } - -- if(var3 > 0 && var3 <= 20) { -+ if (var3 > 0 && var3 <= 20) { - var4 = 25 - var3; -- var5 = var2 * (float)var4; -- var2 = var5 / 25.0F; -+ var5 = par2 * (float)var4; -+ par2 = var5 / 25.0F; - } - -- return var2; -+ return par2; - } - } - -- protected void damageEntity(DamageSource var1, float var2) { -- if(!this.isEntityInvulnerable()) { -- var2 = this.applyArmorCalculations(var1, var2); -- var2 = this.applyPotionDamageCalculations(var1, var2); -- float var3 = var2; -- var2 = Math.max(var2 - this.getAbsorptionAmount(), 0.0F); -- this.setAbsorptionAmount(this.getAbsorptionAmount() - (var3 - var2)); -- if(var2 != 0.0F) { -+ /** -+ * Deals damage to the entity. If its a EntityPlayer then will take damage from the armor first and then health second -+ * with the reduced value. Args: damageAmount -+ */ -+ // Spout Start Protected > Public -+ public void damageEntity(DamageSource par1DamageSource, float par2) { -+ if (!this.isEntityInvulnerable()) { -+ par2 = this.applyArmorCalculations(par1DamageSource, par2); -+ par2 = this.applyPotionDamageCalculations(par1DamageSource, par2); -+ float var3 = par2; -+ par2 = Math.max(par2 - this.getAbsorptionAmount(), 0.0F); -+ this.setAbsorptionAmount(this.getAbsorptionAmount() - (var3 - par2)); -+ -+ if (par2 != 0.0F) { - float var4 = this.getHealth(); -- this.setHealth(var4 - var2); -- this.func_110142_aN().func_94547_a(var1, var4, var2); -- this.setAbsorptionAmount(this.getAbsorptionAmount() - var2); -+ this.setHealth(var4 - par2); -+ this.func_110142_aN().func_94547_a(par1DamageSource, var4, par2); -+ this.setAbsorptionAmount(this.getAbsorptionAmount() - par2); - } - } - } -@@ -838,56 +1062,76 @@ - return (float)this.getEntityAttribute(SharedMonsterAttributes.maxHealth).getAttributeValue(); - } - -+ /** -+ * counts the amount of arrows stuck in the entity. getting hit by arrows increases this, used in rendering -+ */ - public final int getArrowCountInEntity() { - return this.dataWatcher.getWatchableObjectByte(9); - } - -- public final void setArrowCountInEntity(int var1) { -- this.dataWatcher.updateObject(9, Byte.valueOf((byte)var1)); -+ /** -+ * sets the amount of arrows stuck in the entity. used for rendering those -+ */ -+ public final void setArrowCountInEntity(int par1) { -+ this.dataWatcher.updateObject(9, Byte.valueOf((byte)par1)); - } - -+ /** -+ * Returns an integer indicating the end point of the swing animation, used by {@link #swingProgress} to provide a -+ * progress indicator. Takes dig speed enchantments into account. -+ */ - private int getArmSwingAnimationEnd() { - return this.isPotionActive(Potion.digSpeed) ? 6 - (1 + this.getActivePotionEffect(Potion.digSpeed).getAmplifier()) * 1 : (this.isPotionActive(Potion.digSlowdown) ? 6 + (1 + this.getActivePotionEffect(Potion.digSlowdown).getAmplifier()) * 2 : 6); - } - -+ /** -+ * Swings the item the player is holding. -+ */ - public void swingItem() { -- if(!this.isSwingInProgress || this.swingProgressInt >= this.getArmSwingAnimationEnd() / 2 || this.swingProgressInt < 0) { -+ if (!this.isSwingInProgress || this.swingProgressInt >= this.getArmSwingAnimationEnd() / 2 || this.swingProgressInt < 0) { - this.swingProgressInt = -1; - this.isSwingInProgress = true; -- if(this.worldObj instanceof WorldServer) { -- ((WorldServer)this.worldObj).getEntityTracker().sendPacketToTrackedPlayers(this, new Packet18Animation(this, 1)); -+ -+ if (this.worldObj instanceof WorldServer) { -+ ((WorldServer)this.worldObj).getEntityTracker().sendPacketToAllPlayersTrackingEntity(this, new Packet18Animation(this, 1)); - } - } -- - } - -- public void handleHealthUpdate(byte var1) { -- if(var1 == 2) { -+ public void handleHealthUpdate(byte par1) { -+ if (par1 == 2) { - this.limbSwingAmount = 1.5F; - this.hurtResistantTime = this.maxHurtResistantTime; - this.hurtTime = this.maxHurtTime = 10; - this.attackedAtYaw = 0.0F; -- this.playSound(this.getHurtSound(), this.getSoundVolume(), (this.ab.nextFloat() - this.ab.nextFloat()) * 0.2F + 1.0F); -+ this.playSound(this.getHurtSound(), this.getSoundVolume(), (this.rand.nextFloat() - this.rand.nextFloat()) * 0.2F + 1.0F); - this.attackEntityFrom(DamageSource.generic, 0.0F); -- } else if(var1 == 3) { -- this.playSound(this.getDeathSound(), this.getSoundVolume(), (this.ab.nextFloat() - this.ab.nextFloat()) * 0.2F + 1.0F); -+ } else if (par1 == 3) { -+ this.playSound(this.getDeathSound(), this.getSoundVolume(), (this.rand.nextFloat() - this.rand.nextFloat()) * 0.2F + 1.0F); - this.setHealth(0.0F); - this.onDeath(DamageSource.generic); - } else { -- super.handleHealthUpdate(var1); -+ super.handleHealthUpdate(par1); - } -- - } - -+ /** -+ * sets the dead flag. Used when you fall off the bottom of the world. -+ */ - protected void kill() { - this.attackEntityFrom(DamageSource.outOfWorld, 4.0F); - } - -+ /** -+ * Updates the arm swing progress counters and animation progress -+ */ - protected void updateArmSwingProgress() { - int var1 = this.getArmSwingAnimationEnd(); -- if(this.isSwingInProgress) { -+ -+ if (this.isSwingInProgress) { - ++this.swingProgressInt; -- if(this.swingProgressInt >= var1) { -+ -+ if (this.swingProgressInt >= var1) { - this.swingProgressInt = 0; - this.isSwingInProgress = false; - } -@@ -898,77 +1142,108 @@ - this.swingProgress = (float)this.swingProgressInt / (float)var1; - } - -- public AttributeInstance getEntityAttribute(Attribute var1) { -- return this.getAttributeMap().getAttributeInstance(var1); -+ public AttributeInstance getEntityAttribute(Attribute par1Attribute) { -+ return this.getAttributeMap().getAttributeInstance(par1Attribute); - } - - public BaseAttributeMap getAttributeMap() { -- if(this.attributeMap == null) { -+ if (this.attributeMap == null) { - this.attributeMap = new ServersideAttributeMap(); - } - - return this.attributeMap; - } - -+ /** -+ * Get this Entity's EnumCreatureAttribute -+ */ - public EnumCreatureAttribute getCreatureAttribute() { - return EnumCreatureAttribute.UNDEFINED; - } - -+ /** -+ * Returns the item that this EntityLiving is holding, if any. -+ */ - public abstract ItemStack getHeldItem(); - -- public abstract ItemStack getEquipmentInSlot(int var1); -+ /** -+ * 0 = item, 1-n is armor -+ */ -+ public abstract ItemStack getCurrentItemOrArmor(int var1); - -+ /** -+ * Sets the held item, or an armor slot. Slot 0 is held item. Slot 1-4 is armor. Params: Item, slot -+ */ - public abstract void setCurrentItemOrArmor(int var1, ItemStack var2); - -- public void setSprinting(boolean var1) { -- super.setSprinting(var1); -+ /** -+ * Set sprinting switch for Entity. -+ */ -+ public void setSprinting(boolean par1) { -+ super.setSprinting(par1); - AttributeInstance var2 = this.getEntityAttribute(SharedMonsterAttributes.movementSpeed); -- if(var2.getModifier(b) != null) { -+ -+ if (var2.getModifier(sprintingSpeedBoostModifierUUID) != null) { - var2.removeModifier(sprintingSpeedBoostModifier); - } - -- if(var1) { -+ if (par1) { - var2.applyModifier(sprintingSpeedBoostModifier); - } -- - } - -- public abstract ItemStack[] getInventory(); -+ public abstract ItemStack[] getLastActiveItems(); - -+ /** -+ * Returns the volume for the sounds this mob makes. -+ */ - protected float getSoundVolume() { - return 1.0F; - } - -+ /** -+ * Gets the pitch of living sounds in living entities. -+ */ - protected float getSoundPitch() { -- return this.isChild() ? (this.ab.nextFloat() - this.ab.nextFloat()) * 0.2F + 1.5F : (this.ab.nextFloat() - this.ab.nextFloat()) * 0.2F + 1.0F; -+ return this.isChild() ? (this.rand.nextFloat() - this.rand.nextFloat()) * 0.2F + 1.5F : (this.rand.nextFloat() - this.rand.nextFloat()) * 0.2F + 1.0F; - } - -+ /** -+ * Dead and sleeping entities cannot move -+ */ - protected boolean isMovementBlocked() { - return this.getHealth() <= 0.0F; - } - -- public void setPositionAndUpdate(double var1, double var3, double var5) { -- this.setLocationAndAngles(var1, var3, var5, this.rotationYaw, this.rotationPitch); -+ /** -+ * Move the entity to the coordinates informed, but keep yaw/pitch values. -+ */ -+ public void setPositionAndUpdate(double par1, double par3, double par5) { -+ this.setLocationAndAngles(par1, par3, par5, this.rotationYaw, this.rotationPitch); - } - -- public void dismountEntity(Entity var1) { -- double var3 = var1.posX; -- double var5 = var1.boundingBox.minY + (double)var1.height; -- double var7 = var1.posZ; -+ /** -+ * Moves the entity to a position out of the way of its mount. -+ */ -+ public void dismountEntity(Entity par1Entity) { -+ double var3 = par1Entity.posX; -+ double var5 = par1Entity.boundingBox.minY + (double)par1Entity.height; -+ double var7 = par1Entity.posZ; - -- for(double var9 = -1.5D; var9 < 2.0D; ++var9) { -- for(double var11 = -1.5D; var11 < 2.0D; ++var11) { -- if(var9 != 0.0D || var11 != 0.0D) { -+ for (double var9 = -1.5D; var9 < 2.0D; ++var9) { -+ for (double var11 = -1.5D; var11 < 2.0D; ++var11) { -+ if (var9 != 0.0D || var11 != 0.0D) { - int var13 = (int)(this.posX + var9); - int var14 = (int)(this.posZ + var11); - AxisAlignedBB var2 = this.boundingBox.getOffsetBoundingBox(var9, 1.0D, var11); -- if(this.worldObj.getCollidingBlockBounds(var2).isEmpty()) { -- if(this.worldObj.doesBlockHaveSolidTopSurface(var13, (int)this.posY, var14)) { -+ -+ if (this.worldObj.getCollidingBlockBounds(var2).isEmpty()) { -+ if (this.worldObj.doesBlockHaveSolidTopSurface(var13, (int)this.posY, var14)) { - this.setPositionAndUpdate(this.posX + var9, this.posY + 1.0D, this.posZ + var11); - return; - } - -- if(this.worldObj.doesBlockHaveSolidTopSurface(var13, (int)this.posY - 1, var14) || this.worldObj.getBlockMaterial(var13, (int)this.posY - 1, var14) == Material.water) { -+ if (this.worldObj.doesBlockHaveSolidTopSurface(var13, (int)this.posY - 1, var14) || this.worldObj.getBlockMaterial(var13, (int)this.posY - 1, var14) == Material.water) { - var3 = this.posX + var9; - var5 = this.posY + 1.0D; - var7 = this.posZ + var11; -@@ -985,18 +1260,28 @@ - return false; - } - -- public Icon getItemIcon(ItemStack var1, int var2) { -- return var1.getIconIndex(); -+ /** -+ * Gets the Icon Index of the item currently held -+ */ -+ public Icon getItemIcon(ItemStack par1ItemStack, int par2) { -+ return par1ItemStack.getIconIndex(); - } - -+ /** -+ * Causes this entity to do an upwards motion (jumping). -+ */ - protected void jump() { -- this.motionY = (double)0.42F; -- if(this.isPotionActive(Potion.jump)) { -+ -+ // Spout Start - Added jumping modifier -+ this.motionY = 0.41999998688697815D * getData().getJumpingMod(); -+ // Spout End -+ -+ if (this.isPotionActive(Potion.jump)) { - this.motionY += (double)((float)(this.getActivePotionEffect(Potion.jump).getAmplifier() + 1) * 0.1F); - } - -- if(this.isSprinting()) { -- float var1 = this.rotationYaw * ((float)Math.PI / 180.0F); -+ if (this.isSprinting()) { -+ float var1 = this.rotationYaw * 0.017453292F; - this.motionX -= (double)(MathHelper.sin(var1) * 0.2F); - this.motionZ += (double)(MathHelper.cos(var1) * 0.2F); - } -@@ -1004,114 +1289,161 @@ - this.isAirBorne = true; - } - -- public void moveEntityWithHeading(float var1, float var2) { -- double var3; -- if(!this.isInWater() || this instanceof EntityPlayer && ((EntityPlayer)this).capabilities.isFlying) { -- if(!this.handleLavaMovement() || this instanceof EntityPlayer && ((EntityPlayer)this).capabilities.isFlying) { -- float var8 = 0.91F; -- if(this.onGround) { -- var8 = 546.0F * 0.1F * 0.1F * 0.1F; -- int var4 = this.worldObj.getBlockId(MathHelper.floor_double(this.posX), MathHelper.floor_double(this.boundingBox.minY) - 1, MathHelper.floor_double(this.posZ)); -- if(var4 > 0) { -- var8 = Block.blocksList[var4].slipperiness * 0.91F; -- } -- } -- -- float var9 = 0.16277136F / (var8 * var8 * var8); -- float var5; -- if(this.onGround) { -- var5 = this.getAIMoveSpeed() * var9; -- } else { -- var5 = this.jumpMovementFactor; -- } -- -- this.moveFlying(var1, var2, var5); -- var8 = 0.91F; -- if(this.onGround) { -- var8 = 546.0F * 0.1F * 0.1F * 0.1F; -- int var6 = this.worldObj.getBlockId(MathHelper.floor_double(this.posX), MathHelper.floor_double(this.boundingBox.minY) - 1, MathHelper.floor_double(this.posZ)); -- if(var6 > 0) { -- var8 = Block.blocksList[var6].slipperiness * 0.91F; -- } -- } -- -- if(this.isOnLadder()) { -- float var11 = 0.15F; -- if(this.motionX < (double)(-var11)) { -- this.motionX = (double)(-var11); -- } -- -- if(this.motionX > (double)var11) { -- this.motionX = (double)var11; -- } -- -- if(this.motionZ < (double)(-var11)) { -- this.motionZ = (double)(-var11); -- } -- -- if(this.motionZ > (double)var11) { -- this.motionZ = (double)var11; -- } -- -- this.fallDistance = 0.0F; -- if(this.motionY < -0.15D) { -- this.motionY = -0.15D; -- } -- -- boolean var7 = this.isSneaking() && this instanceof EntityPlayer; -- if(var7 && this.motionY < 0.0D) { -- this.motionY = 0.0D; -- } -- } -- -- this.moveEntity(this.motionX, this.motionY, this.motionZ); -- if(this.isCollidedHorizontally && this.isOnLadder()) { -- this.motionY = 0.2D; -- } -- -- if(this.worldObj.isRemote && (!this.worldObj.blockExists((int)this.posX, 0, (int)this.posZ) || !this.worldObj.getChunkFromBlockCoords((int)this.posX, (int)this.posZ).isChunkLoaded)) { -- if(this.posY > 0.0D) { -- this.motionY = -0.1D; -- } else { -- this.motionY = 0.0D; -- } -- } else { -- this.motionY -= 0.08D; -- } -- -- this.motionY *= (double)0.98F; -- this.motionX *= (double)var8; -- this.motionZ *= (double)var8; -- } else { -- var3 = this.posY; -- this.moveFlying(var1, var2, 0.02F); -- this.moveEntity(this.motionX, this.motionY, this.motionZ); -- this.motionX *= 0.5D; -- this.motionY *= 0.5D; -- this.motionZ *= 0.5D; -- this.motionY -= 0.02D; -- if(this.isCollidedHorizontally && this.isOffsetPositionInLiquid(this.motionX, this.motionY + (double)0.6F - this.posY + var3, this.motionZ)) { -- this.motionY = (double)0.3F; -- } -+ /** -+ * Moves the entity based on the specified heading. Args: strafe, forward -+ */ -+ public void moveEntityWithHeading(float par1, float par2) { -+ double var10; -+ -+ if (this.isInWater() && (!(this instanceof EntityPlayer) || !((EntityPlayer)this).capabilities.isFlying)) { -+ var10 = this.posY; -+ // Spout Start - Swimming mod -+ this.moveFlying(par1, par2, ((float) ((this.isAIEnabled() ? 0.04F : 0.02F) * getData().getSwimmingMod()))); -+ // Spout End -+ this.moveEntity(this.motionX, this.motionY, this.motionZ); -+ this.motionX *= 0.800000011920929D; -+ this.motionY *= 0.800000011920929D; -+ this.motionZ *= 0.800000011920929D; -+ // Spout Start - Added gravity modifier -+ this.motionY -= 0.02D * getData().getGravityMod(); -+ // Spout End -+ -+ if (this.isCollidedHorizontally && this.isOffsetPositionInLiquid(this.motionX, this.motionY + 0.6000000238418579D - this.posY + var10, this.motionZ)) { -+ this.motionY = 0.30000001192092896D; - } -- } else { -- var3 = this.posY; -- this.moveFlying(var1, var2, this.isAIEnabled() ? 0.04F : 0.02F); -+ } else if (this.handleLavaMovement() && (!(this instanceof EntityPlayer) || !((EntityPlayer)this).capabilities.isFlying)) { -+ var10 = this.posY; -+ // Spout Start - Added swimming modifier -+ this.moveFlying(par1, par2, (float)(0.02F * getData().getSwimmingMod())); -+ // Spout End - this.moveEntity(this.motionX, this.motionY, this.motionZ); -- this.motionX *= (double)0.8F; -- this.motionY *= (double)0.8F; -- this.motionZ *= (double)0.8F; -+ this.motionX *= 0.5D; -+ this.motionY *= 0.5D; -+ this.motionZ *= 0.5D; - this.motionY -= 0.02D; -- if(this.isCollidedHorizontally && this.isOffsetPositionInLiquid(this.motionX, this.motionY + (double)0.6F - this.posY + var3, this.motionZ)) { -- this.motionY = (double)0.3F; -- } -+ -+ if (this.isCollidedHorizontally && this.isOffsetPositionInLiquid(this.motionX, this.motionY + 0.6000000238418579D - this.posY + var10, this.motionZ)) { -+ this.motionY = 0.30000001192092896D; -+ } -+ } else { -+ float var3 = 0.91F; -+ -+ if (this.onGround) { -+ var3 = 0.54600006F; -+ int var4 = this.worldObj.getBlockId(MathHelper.floor_double(this.posX), MathHelper.floor_double(this.boundingBox.minY) - 1, MathHelper.floor_double(this.posZ)); -+ -+ if (var4 > 0) { -+ var3 = Block.blocksList[var4].slipperiness * 0.91F; -+ } -+ } -+ -+ float var8 = 0.16277136F / (var3 * var3 * var3); -+ float var5; -+ -+ if (this.onGround) { -+ if (this.isAIEnabled()) { -+ // Spout Start -+ var5 = (float) (this.getAIMoveSpeed() * getData().getWalkingMod()); -+ // Spout End -+ } else { -+ // Spout Start -+ var5 = (float) (this.landMovementFactor * getData().getWalkingMod()); -+ // Spout End -+ } -+ -+ var5 *= var8; -+ } else { -+ // Spout Start - Added AirSpeed modifier -+ var5 = (float) (this.jumpMovementFactor * getData().getAirspeedMod()); -+ // Spout End -+ } -+ -+ this.moveFlying(par1, par2, var5); -+ var3 = 0.91F; -+ -+ if (this.onGround) { -+ var3 = 0.54600006F; -+ int var6 = this.worldObj.getBlockId(MathHelper.floor_double(this.posX), MathHelper.floor_double(this.boundingBox.minY) - 1, MathHelper.floor_double(this.posZ)); -+ -+ if (var6 > 0) { -+ var3 = Block.blocksList[var6].slipperiness * 0.91F; -+ // Spout Start -+ int x = MathHelper.floor_double(this.posX); -+ int y = MathHelper.floor_double(this.boundingBox.minY) - 1; -+ int z = MathHelper.floor_double(this.posZ); -+ org.spoutcraft.client.block.SpoutcraftChunk chunk = org.spoutcraft.api.Spoutcraft.getChunkAt(worldObj, x, y, z); -+ short customId = chunk.getCustomBlockId(x, y, z); -+ if (customId > 0) { -+ CustomBlock block = MaterialData.getCustomBlock(customId); -+ if (block != null) { -+ var3 = block.getFriction() * 0.98F; -+ } -+ } -+ // Spout End -+ } -+ } -+ -+ if (this.isOnLadder()) { -+ float var11 = 0.15F; -+ -+ if (this.motionX < (double)(-var11)) { -+ this.motionX = (double)(-var11); -+ } -+ -+ if (this.motionX > (double)var11) { -+ this.motionX = (double)var11; -+ } -+ -+ if (this.motionZ < (double)(-var11)) { -+ this.motionZ = (double)(-var11); -+ } -+ -+ if (this.motionZ > (double)var11) { -+ this.motionZ = (double)var11; -+ } -+ -+ this.fallDistance = 0.0F; -+ -+ if (this.motionY < -0.15D) { -+ this.motionY = -0.15D; -+ } -+ -+ boolean var7 = this.isSneaking() && this instanceof EntityPlayer; -+ -+ if (var7 && this.motionY < 0.0D) { -+ this.motionY = 0.0D; -+ } -+ } -+ -+ this.moveEntity(this.motionX, this.motionY, this.motionZ); -+ -+ if (this.isCollidedHorizontally && this.isOnLadder()) { -+ this.motionY = 0.2D; -+ } -+ -+ if (this.worldObj.isRemote && (!this.worldObj.blockExists((int)this.posX, 0, (int)this.posZ) || !this.worldObj.getChunkFromBlockCoords((int)this.posX, (int)this.posZ).isChunkLoaded)) { -+ if (this.posY > 0.0D) { -+ this.motionY = -0.1D; -+ } else { -+ this.motionY = 0.0D; -+ } -+ } else { -+ // Spout Start - Added gravity modifier -+ this.motionY -= 0.08D * getData().getGravityMod(); -+ // Spout End -+ } -+ -+ this.motionY *= 0.9800000190734863D; -+ this.motionX *= (double)var3; -+ this.motionZ *= (double)var3; - } - - this.prevLimbSwingAmount = this.limbSwingAmount; -- var3 = this.posX - this.prevPosX; -- double var10 = this.posZ - this.prevPosZ; -- float var12 = MathHelper.sqrt_double(var3 * var3 + var10 * var10) * 4.0F; -- if(var12 > 1.0F) { -+ var10 = this.posX - this.prevPosX; -+ double var9 = this.posZ - this.prevPosZ; -+ float var12 = MathHelper.sqrt_double(var10 * var10 + var9 * var9) * 4.0F; -+ -+ if (var12 > 1.0F) { - var12 = 1.0F; - } - -@@ -1119,52 +1451,72 @@ - this.limbSwing += this.limbSwingAmount; - } - -+ /** -+ * Returns true if the newer Entity AI code should be run -+ */ - protected boolean isAIEnabled() { - return false; - } - -+ /** -+ * the movespeed used for the new AI system -+ */ - public float getAIMoveSpeed() { - return this.isAIEnabled() ? this.landMovementFactor : 0.1F; - } - -- public void setAIMoveSpeed(float var1) { -- this.landMovementFactor = var1; -+ /** -+ * set the movespeed used for the new AI system -+ */ -+ public void setAIMoveSpeed(float par1) { -+ this.landMovementFactor = par1; - } - -- public boolean attackEntityAsMob(Entity var1) { -- this.setLastAttacker(var1); -+ public boolean attackEntityAsMob(Entity par1Entity) { -+ this.setLastAttacker(par1Entity); - return false; - } - -+ /** -+ * Returns whether player is sleeping or not -+ */ - public boolean isPlayerSleeping() { - return false; - } - -+ /** -+ * Called to update the entity's position/logic. -+ */ - public void onUpdate() { - super.onUpdate(); -- if(!this.worldObj.isRemote) { -+ -+ if (!this.worldObj.isRemote) { - int var1 = this.getArrowCountInEntity(); -- if(var1 > 0) { -- if(this.arrowHitTimer <= 0) { -+ -+ if (var1 > 0) { -+ if (this.arrowHitTimer <= 0) { - this.arrowHitTimer = 20 * (30 - var1); - } - - --this.arrowHitTimer; -- if(this.arrowHitTimer <= 0) { -+ -+ if (this.arrowHitTimer <= 0) { - this.setArrowCountInEntity(var1 - 1); - } - } - -- for(int var2 = 0; var2 < 5; ++var2) { -+ for (int var2 = 0; var2 < 5; ++var2) { - ItemStack var3 = this.previousEquipment[var2]; -- ItemStack var4 = this.getEquipmentInSlot(var2); -- if(!ItemStack.areItemStacksEqual(var4, var3)) { -- ((WorldServer)this.worldObj).getEntityTracker().sendPacketToTrackedPlayers(this, new Packet5PlayerInventory(this.entityId, var2, var4)); -- if(var3 != null) { -+ ItemStack var4 = this.getCurrentItemOrArmor(var2); -+ -+ if (!ItemStack.areItemStacksEqual(var4, var3)) { -+ ((WorldServer)this.worldObj).getEntityTracker().sendPacketToAllPlayersTrackingEntity(this, new Packet5PlayerInventory(this.entityId, var2, var4)); -+ -+ if (var3 != null) { - this.attributeMap.removeAttributeModifiers(var3.getAttributeModifiers()); - } - -- if(var4 != null) { -+ if (var4 != null) { - this.attributeMap.applyAttributeModifiers(var4.getAttributeModifiers()); - } - -@@ -1181,17 +1533,18 @@ - float var7 = 0.0F; - this.field_70768_au = this.field_110154_aX; - float var8 = 0.0F; -- if(var5 > 0.0025000002F) { -+ -+ if (var5 > 0.0025000002F) { - var8 = 1.0F; - var7 = (float)Math.sqrt((double)var5) * 3.0F; - var6 = (float)Math.atan2(var10, var9) * 180.0F / (float)Math.PI - 90.0F; - } - -- if(this.swingProgress > 0.0F) { -+ if (this.swingProgress > 0.0F) { - var6 = this.rotationYaw; - } - -- if(!this.onGround) { -+ if (!this.onGround) { - var8 = 0.0F; - } - -@@ -1201,35 +1554,35 @@ - this.worldObj.theProfiler.endSection(); - this.worldObj.theProfiler.startSection("rangeChecks"); - -- while(this.rotationYaw - this.prevRotationYaw < -180.0F) { -+ while (this.rotationYaw - this.prevRotationYaw < -180.0F) { - this.prevRotationYaw -= 360.0F; - } - -- while(this.rotationYaw - this.prevRotationYaw >= 180.0F) { -+ while (this.rotationYaw - this.prevRotationYaw >= 180.0F) { - this.prevRotationYaw += 360.0F; - } - -- while(this.renderYawOffset - this.prevRenderYawOffset < -180.0F) { -+ while (this.renderYawOffset - this.prevRenderYawOffset < -180.0F) { - this.prevRenderYawOffset -= 360.0F; - } - -- while(this.renderYawOffset - this.prevRenderYawOffset >= 180.0F) { -+ while (this.renderYawOffset - this.prevRenderYawOffset >= 180.0F) { - this.prevRenderYawOffset += 360.0F; - } - -- while(this.rotationPitch - this.prevRotationPitch < -180.0F) { -+ while (this.rotationPitch - this.prevRotationPitch < -180.0F) { - this.prevRotationPitch -= 360.0F; - } - -- while(this.rotationPitch - this.prevRotationPitch >= 180.0F) { -+ while (this.rotationPitch - this.prevRotationPitch >= 180.0F) { - this.prevRotationPitch += 360.0F; - } - -- while(this.rotationYawHead - this.prevRotationYawHead < -180.0F) { -+ while (this.rotationYawHead - this.prevRotationYawHead < -180.0F) { - this.prevRotationYawHead -= 360.0F; - } - -- while(this.rotationYawHead - this.prevRotationYawHead >= 180.0F) { -+ while (this.rotationYawHead - this.prevRotationYawHead >= 180.0F) { - this.prevRotationYawHead += 360.0F; - } - -@@ -1237,37 +1590,43 @@ - this.field_70764_aw += var7; - } - -- protected float func_110146_f(float var1, float var2) { -- float var3 = MathHelper.wrapAngleTo180_float(var1 - this.renderYawOffset); -+ protected float func_110146_f(float par1, float par2) { -+ float var3 = MathHelper.wrapAngleTo180_float(par1 - this.renderYawOffset); - this.renderYawOffset += var3 * 0.3F; - float var4 = MathHelper.wrapAngleTo180_float(this.rotationYaw - this.renderYawOffset); - boolean var5 = var4 < -90.0F || var4 >= 90.0F; -- if(var4 < -75.0F) { -+ -+ if (var4 < -75.0F) { - var4 = -75.0F; - } - -- if(var4 >= 75.0F) { -+ if (var4 >= 75.0F) { - var4 = 75.0F; - } - - this.renderYawOffset = this.rotationYaw - var4; -- if(var4 * var4 > 2500.0F) { -+ -+ if (var4 * var4 > 2500.0F) { - this.renderYawOffset += var4 * 0.2F; - } - -- if(var5) { -- var2 *= -1.0F; -+ if (var5) { -+ par2 *= -1.0F; - } - -- return var2; -+ return par2; - } - -+ /** -+ * Called frequently so the entity can update its state every tick as required. For example, zombies and skeletons use -+ * this to react to sunlight and start to burn. -+ */ - public void onLivingUpdate() { -- if(this.jumpTicks > 0) { -+ if (this.jumpTicks > 0) { - --this.jumpTicks; - } - -- if(this.newPosRotationIncrements > 0) { -+ if (this.newPosRotationIncrements > 0) { - double var1 = this.posX + (this.newPosX - this.posX) / (double)this.newPosRotationIncrements; - double var3 = this.posY + (this.newPosY - this.posY) / (double)this.newPosRotationIncrements; - double var5 = this.posZ + (this.newPosZ - this.posZ) / (double)this.newPosRotationIncrements; -@@ -1277,32 +1636,33 @@ - --this.newPosRotationIncrements; - this.setPosition(var1, var3, var5); - this.setRotation(this.rotationYaw, this.rotationPitch); -- } else if(!this.isClientWorld()) { -+ } else if (!this.isClientWorld()) { - this.motionX *= 0.98D; - this.motionY *= 0.98D; - this.motionZ *= 0.98D; - } - -- if(Math.abs(this.motionX) < 0.005D) { -+ if (Math.abs(this.motionX) < 0.005D) { - this.motionX = 0.0D; - } - -- if(Math.abs(this.motionY) < 0.005D) { -+ if (Math.abs(this.motionY) < 0.005D) { - this.motionY = 0.0D; - } - -- if(Math.abs(this.motionZ) < 0.005D) { -+ if (Math.abs(this.motionZ) < 0.005D) { - this.motionZ = 0.0D; - } - - this.worldObj.theProfiler.startSection("ai"); -- if(this.isMovementBlocked()) { -+ -+ if (this.isMovementBlocked()) { - this.isJumping = false; - this.moveStrafing = 0.0F; - this.moveForward = 0.0F; - this.randomYawVelocity = 0.0F; -- } else if(this.isClientWorld()) { -- if(this.isAIEnabled()) { -+ } else if (this.isClientWorld()) { -+ if (this.isAIEnabled()) { - this.worldObj.theProfiler.startSection("newAi"); - this.updateAITasks(); - this.worldObj.theProfiler.endSection(); -@@ -1316,14 +1676,15 @@ - - this.worldObj.theProfiler.endSection(); - this.worldObj.theProfiler.startSection("jump"); -- if(this.isJumping) { -- if(!this.isInWater() && !this.handleLavaMovement()) { -- if(this.onGround && this.jumpTicks == 0) { -+ -+ if (this.isJumping) { -+ if (!this.isInWater() && !this.handleLavaMovement()) { -+ if (this.onGround && this.jumpTicks == 0) { - this.jump(); - this.jumpTicks = 10; - } - } else { -- this.motionY += (double)0.04F; -+ this.motionY += 0.03999999910593033D; - } - } else { - this.jumpTicks = 0; -@@ -1337,33 +1698,37 @@ - this.moveEntityWithHeading(this.moveStrafing, this.moveForward); - this.worldObj.theProfiler.endSection(); - this.worldObj.theProfiler.startSection("push"); -- if(!this.worldObj.isRemote) { -+ -+ if (!this.worldObj.isRemote) { - this.collideWithNearbyEntities(); - } - - this.worldObj.theProfiler.endSection(); - } - -- protected void updateAITasks() { -- } -+ protected void updateAITasks() {} - - protected void collideWithNearbyEntities() { -- List var1 = this.worldObj.getEntitiesWithinAABBExcludingEntity(this, this.boundingBox.expand((double)0.2F, 0.0D, (double)0.2F)); -- if(var1 != null && !var1.isEmpty()) { -- for(int var2 = 0; var2 < var1.size(); ++var2) { -+ List var1 = this.worldObj.getEntitiesWithinAABBExcludingEntity(this, this.boundingBox.expand(0.20000000298023224D, 0.0D, 0.20000000298023224D)); -+ -+ if (var1 != null && !var1.isEmpty()) { -+ for (int var2 = 0; var2 < var1.size(); ++var2) { - Entity var3 = (Entity)var1.get(var2); -- if(var3.canBePushed()) { -+ -+ if (var3.canBePushed()) { - this.collideWithEntity(var3); - } - } - } -- -- } -- -- protected void collideWithEntity(Entity var1) { -- var1.applyEntityCollision(this); -- } -- -+ } -+ -+ protected void collideWithEntity(Entity par1Entity) { -+ par1Entity.applyEntityCollision(this); -+ } -+ -+ /** -+ * Handles updating while being ridden by an entity -+ */ - public void updateRidden() { - super.updateRidden(); - this.field_70768_au = this.field_110154_aX; -@@ -1371,110 +1736,148 @@ - this.fallDistance = 0.0F; - } - -- public void setPositionAndRotation2(double var1, double var3, double var5, float var7, float var8, int var9) { -+ /** -+ * Sets the position and rotation. Only difference from the other one is no bounding on the rotation. Args: posX, posY, -+ * posZ, yaw, pitch -+ */ -+ public void setPositionAndRotation2(double par1, double par3, double par5, float par7, float par8, int par9) { - this.yOffset = 0.0F; -- this.newPosX = var1; -- this.newPosY = var3; -- this.newPosZ = var5; -- this.newRotationYaw = (double)var7; -- this.newRotationPitch = (double)var8; -- this.newPosRotationIncrements = var9; -+ this.newPosX = par1; -+ this.newPosY = par3; -+ this.newPosZ = par5; -+ this.newRotationYaw = (double)par7; -+ this.newRotationPitch = (double)par8; -+ this.newPosRotationIncrements = par9; - } - -- protected void updateAITick() { -- } -+ /** -+ * main AI tick function, replaces updateEntityActionState -+ */ -+ protected void updateAITick() {} - - protected void updateEntityActionState() { - ++this.entityAge; - } - -- public void setJumping(boolean var1) { -- this.isJumping = var1; -+ public void setJumping(boolean par1) { -+ this.isJumping = par1; - } - -- public void onItemPickup(Entity var1, int var2) { -- if(!var1.isDead && !this.worldObj.isRemote) { -+ /** -+ * Called whenever an item is picked up from walking over it. Args: pickedUpEntity, stackSize -+ */ -+ public void onItemPickup(Entity par1Entity, int par2) { -+ if (!par1Entity.isDead && !this.worldObj.isRemote) { - EntityTracker var3 = ((WorldServer)this.worldObj).getEntityTracker(); -- if(var1 instanceof EntityItem) { -- var3.sendPacketToTrackedPlayers(var1, new Packet22Collect(var1.entityId, this.entityId)); -- } -- -- if(var1 instanceof EntityArrow) { -- var3.sendPacketToTrackedPlayers(var1, new Packet22Collect(var1.entityId, this.entityId)); -- } -- -- if(var1 instanceof EntityXPOrb) { -- var3.sendPacketToTrackedPlayers(var1, new Packet22Collect(var1.entityId, this.entityId)); -+ -+ if (par1Entity instanceof EntityItem) { -+ var3.sendPacketToAllPlayersTrackingEntity(par1Entity, new Packet22Collect(par1Entity.entityId, this.entityId)); -+ } -+ -+ if (par1Entity instanceof EntityArrow) { -+ var3.sendPacketToAllPlayersTrackingEntity(par1Entity, new Packet22Collect(par1Entity.entityId, this.entityId)); -+ } -+ -+ if (par1Entity instanceof EntityXPOrb) { -+ var3.sendPacketToAllPlayersTrackingEntity(par1Entity, new Packet22Collect(par1Entity.entityId, this.entityId)); - } - } -- -- } -- -- public boolean canEntityBeSeen(Entity var1) { -- return this.worldObj.rayTraceBlocks(this.worldObj.getWorldVec3Pool().getVecFromPool(this.posX, this.posY + (double)this.getEyeHeight(), this.posZ), this.worldObj.getWorldVec3Pool().getVecFromPool(var1.posX, var1.posY + (double)var1.getEyeHeight(), var1.posZ)) == null; -- } -- -+ } -+ -+ /** -+ * returns true if the entity provided in the argument can be seen. (Raytrace) -+ */ -+ public boolean canEntityBeSeen(Entity par1Entity) { -+ return this.worldObj.clip(this.worldObj.getWorldVec3Pool().getVecFromPool(this.posX, this.posY + (double)this.getEyeHeight(), this.posZ), this.worldObj.getWorldVec3Pool().getVecFromPool(par1Entity.posX, par1Entity.posY + (double)par1Entity.getEyeHeight(), par1Entity.posZ)) == null; -+ } -+ -+ /** -+ * returns a (normalized) vector of where this entity is looking -+ */ - public Vec3 getLookVec() { - return this.getLook(1.0F); - } - -- public Vec3 getLook(float var1) { -+ /** -+ * interpolated look vector -+ */ -+ public Vec3 getLook(float par1) { - float var2; - float var3; - float var4; - float var5; -- if(var1 == 1.0F) { -- var2 = MathHelper.cos(-this.rotationYaw * ((float)Math.PI / 180.0F) - (float)Math.PI); -- var3 = MathHelper.sin(-this.rotationYaw * ((float)Math.PI / 180.0F) - (float)Math.PI); -- var4 = -MathHelper.cos(-this.rotationPitch * ((float)Math.PI / 180.0F)); -- var5 = MathHelper.sin(-this.rotationPitch * ((float)Math.PI / 180.0F)); -+ -+ if (par1 == 1.0F) { -+ var2 = MathHelper.cos(-this.rotationYaw * 0.017453292F - (float)Math.PI); -+ var3 = MathHelper.sin(-this.rotationYaw * 0.017453292F - (float)Math.PI); -+ var4 = -MathHelper.cos(-this.rotationPitch * 0.017453292F); -+ var5 = MathHelper.sin(-this.rotationPitch * 0.017453292F); - return this.worldObj.getWorldVec3Pool().getVecFromPool((double)(var3 * var4), (double)var5, (double)(var2 * var4)); - } else { -- var2 = this.prevRotationPitch + (this.rotationPitch - this.prevRotationPitch) * var1; -- var3 = this.prevRotationYaw + (this.rotationYaw - this.prevRotationYaw) * var1; -- var4 = MathHelper.cos(-var3 * ((float)Math.PI / 180.0F) - (float)Math.PI); -- var5 = MathHelper.sin(-var3 * ((float)Math.PI / 180.0F) - (float)Math.PI); -- float var6 = -MathHelper.cos(-var2 * ((float)Math.PI / 180.0F)); -- float var7 = MathHelper.sin(-var2 * ((float)Math.PI / 180.0F)); -+ var2 = this.prevRotationPitch + (this.rotationPitch - this.prevRotationPitch) * par1; -+ var3 = this.prevRotationYaw + (this.rotationYaw - this.prevRotationYaw) * par1; -+ var4 = MathHelper.cos(-var3 * 0.017453292F - (float)Math.PI); -+ var5 = MathHelper.sin(-var3 * 0.017453292F - (float)Math.PI); -+ float var6 = -MathHelper.cos(-var2 * 0.017453292F); -+ float var7 = MathHelper.sin(-var2 * 0.017453292F); - return this.worldObj.getWorldVec3Pool().getVecFromPool((double)(var5 * var6), (double)var7, (double)(var4 * var6)); - } - } - -- public float getSwingProgress(float var1) { -+ /** -+ * Returns where in the swing animation the living entity is (from 0 to 1). Args: partialTickTime -+ */ -+ public float getSwingProgress(float par1) { - float var2 = this.swingProgress - this.prevSwingProgress; -- if(var2 < 0.0F) { -+ -+ if (var2 < 0.0F) { - ++var2; - } - -- return this.prevSwingProgress + var2 * var1; -+ return this.prevSwingProgress + var2 * par1; - } - -- public Vec3 getPosition(float var1) { -- if(var1 == 1.0F) { -+ /** -+ * interpolated position vector -+ */ -+ public Vec3 getPosition(float par1) { -+ if (par1 == 1.0F) { - return this.worldObj.getWorldVec3Pool().getVecFromPool(this.posX, this.posY, this.posZ); - } else { -- double var2 = this.prevPosX + (this.posX - this.prevPosX) * (double)var1; -- double var4 = this.prevPosY + (this.posY - this.prevPosY) * (double)var1; -- double var6 = this.prevPosZ + (this.posZ - this.prevPosZ) * (double)var1; -+ double var2 = this.prevPosX + (this.posX - this.prevPosX) * (double)par1; -+ double var4 = this.prevPosY + (this.posY - this.prevPosY) * (double)par1; -+ double var6 = this.prevPosZ + (this.posZ - this.prevPosZ) * (double)par1; - return this.worldObj.getWorldVec3Pool().getVecFromPool(var2, var4, var6); - } - } - -- public MovingObjectPosition rayTrace(double var1, float var3) { -- Vec3 var4 = this.getPosition(var3); -- Vec3 var5 = this.getLook(var3); -- Vec3 var6 = var4.addVector(var5.xCoord * var1, var5.yCoord * var1, var5.zCoord * var1); -- return this.worldObj.rayTraceBlocks(var4, var6); -+ /** -+ * Performs a ray trace for the distance specified and using the partial tick time. Args: distance, partialTickTime -+ */ -+ public MovingObjectPosition rayTrace(double par1, float par3) { -+ Vec3 var4 = this.getPosition(par3); -+ Vec3 var5 = this.getLook(par3); -+ Vec3 var6 = var4.addVector(var5.xCoord * par1, var5.yCoord * par1, var5.zCoord * par1); -+ return this.worldObj.clip(var4, var6); - } - -+ /** -+ * Returns whether the entity is in a local (client) world -+ */ - public boolean isClientWorld() { - return !this.worldObj.isRemote; - } - -+ /** -+ * Returns true if other Entities should be prevented from moving through this Entity. -+ */ - public boolean canBeCollidedWith() { - return !this.isDead; - } - -+ /** -+ * Returns true if this entity should push and be pushed by other entities when colliding. -+ */ - public boolean canBePushed() { - return !this.isDead; - } -@@ -1483,39 +1886,105 @@ - return this.height * 0.85F; - } - -+ /** -+ * Sets that this entity has been attacked. -+ */ - protected void setBeenAttacked() { -- this.velocityChanged = this.ab.nextDouble() >= this.getEntityAttribute(SharedMonsterAttributes.knockbackResistance).getAttributeValue(); -+ this.velocityChanged = this.rand.nextDouble() >= this.getEntityAttribute(SharedMonsterAttributes.knockbackResistance).getAttributeValue(); - } - - public float getRotationYawHead() { - return this.rotationYawHead; - } - -- public void setRotationYawHead(float var1) { -- this.rotationYawHead = var1; -+ /** -+ * Sets the head's yaw rotation of the entity. -+ */ -+ public void setRotationYawHead(float par1) { -+ this.rotationYawHead = par1; - } - - public float getAbsorptionAmount() { - return this.field_110151_bq; - } - -- public void setAbsorptionAmount(float var1) { -- if(var1 < 0.0F) { -- var1 = 0.0F; -+ public void setAbsorptionAmount(float par1) { -+ if (par1 < 0.0F) { -+ par1 = 0.0F; - } - -- this.field_110151_bq = var1; -+ this.field_110151_bq = par1; - } - - public Team getTeam() { - return null; - } - -- public boolean isOnSameTeam(EntityLivingBase var1) { -- return this.isOnTeam(var1.getTeam()); -- } -- -- public boolean isOnTeam(Team var1) { -- return this.getTeam() != null ? this.getTeam().isSameTeam(var1) : false; -- } -+ public boolean isOnSameTeam(EntityLivingBase par1EntityLivingBase) { -+ return this.isOnTeam(par1EntityLivingBase.getTeam()); -+ } -+ -+ /** -+ * Returns true if the entity is on a specific team. -+ */ -+ public boolean isOnTeam(Team par1Team) { -+ return this.getTeam() != null ? this.getTeam().isSameTeam(par1Team) : false; -+ } -+ -+ // Spout Start -+ public EntityData getData() { -+ return entityData; -+ } -+ -+ public void setData(EntityData e) { -+ this.entityData = e; -+ } -+ -+ public String getCustomTextureUrl(byte id){ -+ if (getData().getCustomTextures() == null) { -+ return null; -+ } -+ return getData().getCustomTextures().get(id); -+ } -+ -+ public String getCustomTexture(byte id){ -+ if(getCustomTextureUrl(id) != null ) { -+ return CustomTextureManager.getTexturePathFromUrl(getCustomTextureUrl(id)); -+ } -+ return null; -+ } -+ -+ public String getCustomTexture(EntitySkinType type, String def) { -+ String tex = getCustomTexture(type.getId()); -+ if (tex == null) { -+ tex = def; -+ } -+ return tex; -+ } -+ -+ public void setCustomTexture(String url, byte id){ -+ if (url != null) { -+ CustomTextureManager.downloadTexture(url); -+ } -+ if (getData().getCustomTextures() != null) { -+ getData().getCustomTextures().put(id, url); -+ } -+ } -+ -+ public void setTextureToRender(byte textureToRender) { -+ getData().setTextureToRender(textureToRender); -+ } -+ -+ public byte getTextureToRender() { -+ return getData().getTextureToRender(); -+ } -+ -+ public void setDisplayName(String var1) { -+ this.displayName = var1; -+ } -+ -+ public String getDisplayName() { -+ return this.displayName; -+ } -+ // Spout End - } ---- net/minecraft/src/CommandPlaySound.java -+++ net/minecraft/src/CommandPlaySound.java -@@ -5,57 +5,62 @@ - return "playsound"; - } - -+ /** -+ * Return the required permission level for this command. -+ */ - public int getRequiredPermissionLevel() { - return 2; - } - -- public String getCommandUsage(ICommandSender var1) { -+ public String getCommandUsage(ICommandSender par1ICommandSender) { - return "commands.playsound.usage"; - } - -- public void processCommand(ICommandSender var1, String[] var2) { -- if(var2.length < 2) { -- throw new WrongUsageException(this.getCommandUsage(var1), new Object[0]); -+ public void processCommand(ICommandSender par1ICommandSender, String[] par2ArrayOfStr) { -+ if (par2ArrayOfStr.length < 2) { -+ throw new WrongUsageException(this.getCommandUsage(par1ICommandSender), new Object[0]); - } else { - byte var3 = 0; - int var36 = var3 + 1; -- String var4 = var2[var3]; -- EntityPlayerMP var5 = getPlayer(var1, var2[var36++]); -- double var6 = (double)var5.getCommandSenderPosition().posX; -- double var8 = (double)var5.getCommandSenderPosition().posY; -- double var10 = (double)var5.getCommandSenderPosition().posZ; -+ String var4 = par2ArrayOfStr[var3]; -+ EntityPlayerMP var5 = getPlayer(par1ICommandSender, par2ArrayOfStr[var36++]); -+ double var6 = (double)var5.getPlayerCoordinates().posX; -+ double var8 = (double)var5.getPlayerCoordinates().posY; -+ double var10 = (double)var5.getPlayerCoordinates().posZ; - double var12 = 1.0D; - double var14 = 1.0D; - double var16 = 0.0D; -- if(var2.length > var36) { -- var6 = func_110666_a(var1, var6, var2[var36++]); -- } -- -- if(var2.length > var36) { -- var8 = func_110665_a(var1, var8, var2[var36++], 0, 0); -- } -- -- if(var2.length > var36) { -- var10 = func_110666_a(var1, var10, var2[var36++]); -- } -- -- if(var2.length > var36) { -- var12 = func_110661_a(var1, var2[var36++], 0.0D, (double)Float.MAX_VALUE); -- } -- -- if(var2.length > var36) { -- var14 = func_110661_a(var1, var2[var36++], 0.0D, 2.0D); -- } -- -- if(var2.length > var36) { -- var16 = func_110661_a(var1, var2[var36++], 0.0D, 1.0D); -+ -+ if (par2ArrayOfStr.length > var36) { -+ var6 = func_110666_a(par1ICommandSender, var6, par2ArrayOfStr[var36++]); -+ } -+ -+ if (par2ArrayOfStr.length > var36) { -+ var8 = func_110665_a(par1ICommandSender, var8, par2ArrayOfStr[var36++], 0, 0); -+ } -+ -+ if (par2ArrayOfStr.length > var36) { -+ var10 = func_110666_a(par1ICommandSender, var10, par2ArrayOfStr[var36++]); -+ } -+ -+ if (par2ArrayOfStr.length > var36) { -+ var12 = func_110661_a(par1ICommandSender, par2ArrayOfStr[var36++], 0.0D, 3.4028234663852886E38D); -+ } -+ -+ if (par2ArrayOfStr.length > var36) { -+ var14 = func_110661_a(par1ICommandSender, par2ArrayOfStr[var36++], 0.0D, 2.0D); -+ } -+ -+ if (par2ArrayOfStr.length > var36) { -+ var16 = func_110661_a(par1ICommandSender, par2ArrayOfStr[var36++], 0.0D, 1.0D); - } - - double var18 = var12 > 1.0D ? var12 * 16.0D : 16.0D; - double var20 = var5.getDistance(var6, var8, var10); -- if(var20 > var18) { -- if(var16 <= 0.0D) { -- throw new CommandException("commands.playsound.playerTooFar", new Object[]{var5.getEntityName()}); -+ -+ if (var20 > var18) { -+ if (var16 <= 0.0D) { -+ throw new CommandException("commands.playsound.playerTooFar", new Object[] {var5.getEntityName()}); - } - - double var22 = var6 - var5.posX; -@@ -65,22 +70,26 @@ - double var30 = var5.posX; - double var32 = var5.posY; - double var34 = var5.posZ; -- if(var28 > 0.0D) { -+ -+ if (var28 > 0.0D) { - var30 += var22 / var28 * 2.0D; - var32 += var24 / var28 * 2.0D; - var34 += var26 / var28 * 2.0D; - } - -- var5.playerNetServerHandler.sendPacket(new Packet62LevelSound(var4, var30, var32, var34, (float)var16, (float)var14)); -+ var5.playerNetServerHandler.sendPacketToPlayer(new Packet62LevelSound(var4, var30, var32, var34, (float)var16, (float)var14)); - } else { -- var5.playerNetServerHandler.sendPacket(new Packet62LevelSound(var4, var6, var8, var10, (float)var12, (float)var14)); -+ var5.playerNetServerHandler.sendPacketToPlayer(new Packet62LevelSound(var4, var6, var8, var10, (float)var12, (float)var14)); - } - -- notifyAdmins(var1, "commands.playsound.success", new Object[]{var4, var5.getEntityName()}); -+ notifyAdmins(par1ICommandSender, "commands.playsound.success", new Object[] {var4, var5.getEntityName()}); - } - } - -- public boolean isUsernameIndex(String[] var1, int var2) { -- return var2 == 1; -+ /** -+ * Return whether the specified command parameter index is a username parameter. -+ */ -+ public boolean isUsernameIndex(String[] par1ArrayOfStr, int par2) { -+ return par2 == 1; - } - } ---- net/minecraft/src/ChunkCoordinates.java -+++ net/minecraft/src/ChunkCoordinates.java -@@ -2,29 +2,32 @@ - - public class ChunkCoordinates implements Comparable { - public int posX; -+ -+ /** the y coordinate */ - public int posY; -+ -+ /** the z coordinate */ - public int posZ; - -- public ChunkCoordinates() { -- } -- -- public ChunkCoordinates(int var1, int var2, int var3) { -- this.posX = var1; -- this.posY = var2; -- this.posZ = var3; -- } -- -- public ChunkCoordinates(ChunkCoordinates var1) { -- this.posX = var1.posX; -- this.posY = var1.posY; -- this.posZ = var1.posZ; -- } -- -- public boolean equals(Object var1) { -- if(!(var1 instanceof ChunkCoordinates)) { -+ public ChunkCoordinates() {} -+ -+ public ChunkCoordinates(int par1, int par2, int par3) { -+ this.posX = par1; -+ this.posY = par2; -+ this.posZ = par3; -+ } -+ -+ public ChunkCoordinates(ChunkCoordinates par1ChunkCoordinates) { -+ this.posX = par1ChunkCoordinates.posX; -+ this.posY = par1ChunkCoordinates.posY; -+ this.posZ = par1ChunkCoordinates.posZ; -+ } -+ -+ public boolean equals(Object par1Obj) { -+ if (!(par1Obj instanceof ChunkCoordinates)) { - return false; - } else { -- ChunkCoordinates var2 = (ChunkCoordinates)var1; -+ ChunkCoordinates var2 = (ChunkCoordinates)par1Obj; - return this.posX == var2.posX && this.posY == var2.posY && this.posZ == var2.posZ; - } - } -@@ -33,28 +36,37 @@ - return this.posX + this.posZ << 8 + this.posY << 16; - } - -- public int compareChunkCoordinate(ChunkCoordinates var1) { -- return this.posY == var1.posY ? (this.posZ == var1.posZ ? this.posX - var1.posX : this.posZ - var1.posZ) : this.posY - var1.posY; -- } -- -- public void set(int var1, int var2, int var3) { -- this.posX = var1; -- this.posY = var2; -- this.posZ = var3; -- } -- -- public float getDistanceSquared(int var1, int var2, int var3) { -- float var4 = (float)(this.posX - var1); -- float var5 = (float)(this.posY - var2); -- float var6 = (float)(this.posZ - var3); -+ /** -+ * Compare the coordinate with another coordinate -+ */ -+ public int compareChunkCoordinate(ChunkCoordinates par1ChunkCoordinates) { -+ return this.posY == par1ChunkCoordinates.posY ? (this.posZ == par1ChunkCoordinates.posZ ? this.posX - par1ChunkCoordinates.posX : this.posZ - par1ChunkCoordinates.posZ) : this.posY - par1ChunkCoordinates.posY; -+ } -+ -+ public void set(int par1, int par2, int par3) { -+ this.posX = par1; -+ this.posY = par2; -+ this.posZ = par3; -+ } -+ -+ /** -+ * Returns the squared distance between this coordinates and the coordinates given as argument. -+ */ -+ public float getDistanceSquared(int par1, int par2, int par3) { -+ float var4 = (float)(this.posX - par1); -+ float var5 = (float)(this.posY - par2); -+ float var6 = (float)(this.posZ - par3); - return var4 * var4 + var5 * var5 + var6 * var6; - } - -- public float getDistanceSquaredToChunkCoordinates(ChunkCoordinates var1) { -- return this.getDistanceSquared(var1.posX, var1.posY, var1.posZ); -+ /** -+ * Return the squared distance between this coordinates and the ChunkCoordinates given as argument. -+ */ -+ public float getDistanceSquaredToChunkCoordinates(ChunkCoordinates par1ChunkCoordinates) { -+ return this.getDistanceSquared(par1ChunkCoordinates.posX, par1ChunkCoordinates.posY, par1ChunkCoordinates.posZ); - } - -- public int compareTo(Object var1) { -- return this.compareChunkCoordinate((ChunkCoordinates)var1); -+ public int compareTo(Object par1Obj) { -+ return this.compareChunkCoordinate((ChunkCoordinates)par1Obj); - } - } diff --git a/patch-index.json b/patch-index.json new file mode 100644 index 0000000..ef80c9a --- /dev/null +++ b/patch-index.json @@ -0,0 +1,2129 @@ +[ + "patches/net/minecraft/src/CallableIntCache.java.patch", + "patches/org/spoutcraft/api/gui/ServerPlayerList.java.patch", + "patches/net/minecraft/src/Facing.java.patch", + "patches/net/minecraft/src/ComponentMineshaftStairs.java.patch", + "patches/org/spoutcraft/client/gui/controls/SpoutcraftBindingItem.java.patch", + "patches/net/minecraft/src/ItemBlock.java.patch", + "patches/net/minecraft/src/EntityAIFollowOwner.java.patch", + "patches/net/minecraft/src/EntityAIVillagerMate.java.patch", + "patches/net/minecraft/src/EntityDamageSource.java.patch", + "patches/net/minecraft/src/LanguageMetadataSectionSerializer.java.patch", + "patches/net/minecraft/src/GuiScreenOnlineServersSubscreen.java.patch", + "patches/net/minecraft/src/ChunkProviderServer.java.patch", + "patches/org/spoutcraft/client/gui/about/GuiNewAbout.java.patch", + "patches/org/spoutcraft/api/util/MutableLocation.java.patch", + "patches/net/minecraft/src/BlockPane.java.patch", + "patches/net/minecraft/src/CommandServerSaveOff.java.patch", + "patches/net/minecraft/src/AABBPool.java.patch", + "patches/org/spoutcraft/api/material/item/GenericFood.java.patch", + "patches/net/minecraft/src/GenLayerShore.java.patch", + "patches/net/minecraft/src/StructureStrongholdPieceWeight.java.patch", + "patches/net/minecraft/src/EntityMoveHelper.java.patch", + "patches/com/prupe/mcpatcher/mob/MobRandomizer.java.patch", + "patches/net/minecraft/src/CommandGive.java.patch", + "patches/net/minecraft/src/EnchantmentArrowInfinite.java.patch", + "patches/net/minecraft/src/MapItemRenderer.java.patch", + "patches/org/spoutcraft/client/pluginloader/ClassLoader.java.patch", + "patches/org/spoutcraft/client/gui/GuiSpoutScreen.java.patch", + "patches/net/minecraft/src/Packet13PlayerLookMove.java.patch", + "patches/net/minecraft/src/EntityEgg.java.patch", + "patches/org/spoutcraft/client/gui/settings/controls/BetterGrassButton.java.patch", + "patches/net/minecraft/src/ItemEmptyMap.java.patch", + "patches/org/spoutcraft/api/gui/Button.java.patch", + "patches/org/spoutcraft/client/gui/minimap/MapCalculator.java.patch", + "patches/org/spoutcraft/api/material/block/GenericCubeCustomBlock.java.patch", + "patches/net/minecraft/src/StructureStrongholdPieces.java.patch", + "patches/net/minecraft/src/Packet200Statistic.java.patch", + "patches/net/minecraft/src/RenderSnowball.java.patch", + "patches/org/spoutcraft/client/gui/settings/controls/ChatColorAssistButton.java.patch", + "patches/net/minecraft/src/CallableJVMFlags.java.patch", + "patches/net/minecraft/src/NibbleArrayReader.java.patch", + "patches/net/minecraft/src/CommandException.java.patch", + "patches/net/minecraft/src/ContainerDispenser.java.patch", + "patches/net/minecraft/src/BlockOre.java.patch", + "patches/net/minecraft/src/GuiScreenBackup.java.patch", + "patches/org/spoutcraft/client/block/SpoutcraftChunk.java.patch", + "patches/net/minecraft/src/WorldGenTallGrass.java.patch", + "patches/net/minecraft/src/Packet204ClientInfo.java.patch", + "patches/org/spoutcraft/client/packet/PacketSpawnTextEntity.java.patch", + "patches/org/spoutcraft/api/gui/GenericTextField.java.patch", + "patches/net/minecraft/src/CallableMPL1.java.patch", + "patches/net/minecraft/src/ClippingHelperImpl.java.patch", + "patches/net/minecraft/src/ModelSheep2.java.patch", + "patches/org/spoutcraft/client/gui/settings/controls/SnooperButton.java.patch", + "patches/net/minecraft/src/BlockCauldron.java.patch", + "patches/net/minecraft/src/ChunkProviderFlat.java.patch", + "patches/net/minecraft/src/TextureManager.java.patch", + "patches/net/minecraft/src/GLAllocation.java.patch", + "patches/net/minecraft/src/DispenserBehaviorFilledBucket.java.patch", + "patches/net/minecraft/src/CommandNotFoundException.java.patch", + "patches/net/minecraft/src/RequestGet.java.patch", + "patches/org/spoutcraft/client/gui/settings/controls/ControlsButton.java.patch", + "patches/net/minecraft/src/IServer.java.patch", + "patches/net/minecraft/src/Request.java.patch", + "patches/org/spoutcraft/api/gui/WidgetManager.java.patch", + "patches/net/minecraft/src/ItemEnderEye.java.patch", + "patches/net/minecraft/src/IWorldAccess.java.patch", + "patches/net/minecraft/src/MapGenVillage.java.patch", + "patches/net/minecraft/src/RenderManager.java.patch", + "patches/org/spoutcraft/client/gui/controls/GuiCommandsSlot.java.patch", + "patches/org/spoutcraft/client/packet/PacketBlockData.java.patch", + "patches/net/minecraft/src/Packet103SetSlot.java.patch", + "patches/net/minecraft/src/BlockEndPortalFrame.java.patch", + "patches/net/minecraft/src/EntityAICreeperSwell.java.patch", + "patches/net/minecraft/src/VillageCollection.java.patch", + "patches/net/minecraft/src/WorldGenHugeTrees.java.patch", + "patches/net/minecraft/src/TextureOffset.java.patch", + "patches/net/minecraft/src/CommandEffect.java.patch", + "patches/net/minecraft/src/EntityFireworkOverlayFX.java.patch", + "patches/net/minecraft/src/EnchantmentKnockback.java.patch", + "patches/net/minecraft/src/TextureCompass.java.patch", + "patches/net/minecraft/src/Teleporter.java.patch", + "patches/net/minecraft/src/BlockTorch.java.patch", + "patches/net/minecraft/src/ProfilerResult.java.patch", + "patches/net/minecraft/src/StructureNetherBridgePieceWeight.java.patch", + "patches/net/minecraft/src/StructureStrongholdPieceWeight3.java.patch", + "patches/net/minecraft/src/ScoreDummyCriteria.java.patch", + "patches/net/minecraft/src/RenderEnderman.java.patch", + "patches/net/minecraft/src/BlockDragonEgg.java.patch", + "patches/com/prupe/mcpatcher/Config$VersionEntry.java.patch", + "patches/net/minecraft/src/BiomeGenDesert.java.patch", + "patches/net/minecraft/src/ModelEnderCrystal.java.patch", + "patches/org/spoutcraft/client/gui/minimap/ScaleToggleCheckBox.java.patch", + "patches/net/minecraft/src/RenderPlayer.java.patch", + "patches/net/minecraft/src/CreativeTabRedstone.java.patch", + "patches/net/minecraft/src/Packet252SharedKey.java.patch", + "patches/net/minecraft/src/RenderMagmaCube.java.patch", + "patches/org/spoutcraft/client/packet/PacketPreCacheCompleted.java.patch", + "patches/org/spoutcraft/api/gui/GenericItemWidget.java.patch", + "patches/net/minecraft/src/SaveHandler.java.patch", + "patches/org/spoutcraft/client/gui/server/MinecraftServiceListener.java.patch", + "patches/com/prupe/mcpatcher/ctm/TileOverrideImpl.java.patch", + "patches/org/spoutcraft/api/gui/ArmorBar.java.patch", + "patches/net/minecraft/src/RenderSkeleton.java.patch", + "patches/org/spoutcraft/client/inventory/CraftInventory.java.patch", + "patches/org/spoutcraft/api/inventory/ShapelessRecipe.java.patch", + "patches/net/minecraft/src/GuiScreenCreateOnlineWorld.java.patch", + "patches/net/minecraft/src/GuiScreenEditOnlineWorld.java.patch", + "patches/net/minecraft/src/WorldGenTrees.java.patch", + "patches/net/minecraft/src/ChunkProviderHell.java.patch", + "patches/net/minecraft/src/Packet2ClientProtocol.java.patch", + "patches/org/spoutcraft/api/gui/SolidBackground.java.patch", + "patches/net/minecraft/src/EmptyChunk.java.patch", + "patches/net/minecraft/src/ServerBlockEventList.java.patch", + "patches/net/minecraft/src/StatCollector.java.patch", + "patches/net/minecraft/src/ItemDoor.java.patch", + "patches/net/minecraft/src/NibbleArray.java.patch", + "patches/net/minecraft/src/RenderMinecart.java.patch", + "patches/org/spoutcraft/api/material/block/Air.java.patch", + "patches/net/minecraft/src/ModelChest.java.patch", + "patches/net/minecraft/src/RecipesArmorDyes.java.patch", + "patches/net/minecraft/src/EntityDragonPart.java.patch", + "patches/net/minecraft/src/GuiBeaconButtonConfirm.java.patch", + "patches/net/minecraft/src/Team.java.patch", + "patches/org/spoutcraft/api/inventory/ShapedRecipe.java.patch", + "patches/net/minecraft/src/RequestPost.java.patch", + "patches/net/minecraft/src/GuiDownloadTerrain.java.patch", + "patches/org/spoutcraft/client/packet/PacketMusicChange.java.patch", + "patches/net/minecraft/src/BaseMetadataSectionSerializer.java.patch", + "patches/com/prupe/mcpatcher/Config.java.patch", + "patches/org/spoutcraft/client/packet/PacketEntityInformation.java.patch", + "patches/net/minecraft/src/BaseAttribute.java.patch", + "patches/net/minecraft/src/TileEntitySignRenderer.java.patch", + "patches/net/minecraft/src/CommandHandler.java.patch", + "patches/org/spoutcraft/api/gui/TextProcessor.java.patch", + "patches/net/minecraft/src/CommandServerSay.java.patch", + "patches/net/minecraft/src/EntityIronGolem.java.patch", + "patches/org/spoutcraft/client/gui/about/TableSection.java.patch", + "patches/net/minecraft/src/ModelLeashKnot.java.patch", + "patches/net/minecraft/src/SlotFurnace.java.patch", + "patches/org/spoutcraft/api/gui/GenericContainer.java.patch", + "patches/net/minecraft/src/WorldProvider.java.patch", + "patches/net/minecraft/src/AnimationMetadataSection.java.patch", + "patches/net/minecraft/src/EntitySorter.java.patch", + "patches/net/minecraft/src/PotionEffect.java.patch", + "patches/net/minecraft/src/BlockPumpkin.java.patch", + "patches/net/minecraft/src/Vec3.java.patch", + "patches/org/spoutcraft/api/block/design/Vertex.java.patch", + "patches/org/spoutcraft/api/material/Block.java.patch", + "patches/net/minecraft/src/EntityEnderPearl.java.patch", + "patches/net/minecraft/src/RenderLeashKnot.java.patch", + "patches/net/minecraft/src/EntityFlameFX.java.patch", + "patches/org/spoutcraft/client/gui/server/ServerSlot.java.patch", + "patches/net/minecraft/src/GenLayer.java.patch", + "patches/org/spoutcraft/api/gui/GenericEntityWidget.java.patch", + "patches/net/minecraft/src/NoiseGeneratorPerlin.java.patch", + "patches/org/spoutcraft/api/TreeType.java.patch", + "patches/net/minecraft/src/ComponentNetherBridgePiece.java.patch", + "patches/org/spoutcraft/client/entity/CraftCameraEntity.java.patch", + "patches/net/minecraft/src/NBTBase.java.patch", + "patches/net/minecraft/src/BlockEventData.java.patch", + "patches/org/spoutcraft/api/util/Vector.java.patch", + "patches/net/minecraft/src/ContainerHorseInventorySlotArmor.java.patch", + "patches/net/minecraft/src/CreativeCrafting.java.patch", + "patches/net/minecraft/src/EntityEnderman.java.patch", + "patches/org/spoutcraft/client/special/BaseYAMLResource.java.patch", + "patches/net/minecraft/src/StructureBoundingBox.java.patch", + "patches/net/minecraft/src/ICommandManager.java.patch", + "patches/org/spoutcraft/client/gui/minimap/ColorToggleCheckBox.java.patch", + "patches/net/minecraft/src/Icon.java.patch", + "patches/net/minecraft/src/CrashReport.java.patch", + "patches/net/minecraft/src/TextureMetadataSectionSerializer.java.patch", + "patches/net/minecraft/src/CommandServerBanlist.java.patch", + "patches/org/spoutcraft/client/gui/settings/controls/FancyWeatherButton.java.patch", + "patches/net/minecraft/src/CallableSuspiciousClasses.java.patch", + "patches/net/minecraft/src/CrashReportCategory.java.patch", + "patches/org/spoutcraft/api/material/block/DoubleSlabs.java.patch", + "patches/net/minecraft/src/ModelMagmaCube.java.patch", + "patches/net/minecraft/src/TileEntityEnderChestRenderer.java.patch", + "patches/org/spoutcraft/client/gui/error/GuiUnexpectedError.java.patch", + "patches/net/minecraft/src/ChunkProviderGenerate.java.patch", + "patches/net/minecraft/src/ItemFlintAndSteel.java.patch", + "patches/net/minecraft/src/NBTTagShort.java.patch", + "patches/net/minecraft/src/EntitySnowball.java.patch", + "patches/net/minecraft/src/EntityLavaFX.java.patch", + "patches/org/spoutcraft/client/gui/controls/GuiControls.java.patch", + "patches/net/minecraft/src/ComponentVillageField.java.patch", + "patches/net/minecraft/src/BlockWeb.java.patch", + "patches/net/minecraft/src/CallableConnectionName.java.patch", + "patches/net/minecraft/src/BlockTripWireSource.java.patch", + "patches/com/prupe/mcpatcher/TexturePackChangeHandler.java.patch", + "patches/net/minecraft/src/ICamera.java.patch", + "patches/net/minecraft/src/Packet18Animation.java.patch", + "patches/org/spoutcraft/api/gui/MinecraftTessellator.java.patch", + "patches/net/minecraft/src/CallableType2.java.patch", + "patches/net/minecraft/src/GuiPlayerInfo.java.patch", + "patches/org/spoutcraft/client/gui/settings/controls/SmoothLightingSlider.java.patch", + "patches/net/minecraft/src/EnchantmentThorns.java.patch", + "patches/net/minecraft/src/GuiContainer.java.patch", + "patches/net/minecraft/src/RenderWolf.java.patch", + "patches/net/minecraft/src/EntitySelectorInventory.java.patch", + "patches/net/minecraft/src/GenLayerAddMushroomIsland.java.patch", + "patches/org/spoutcraft/client/gui/settings/controls/SkyToggleButton.java.patch", + "patches/net/minecraft/src/RenderBat.java.patch", + "patches/org/spoutcraft/client/entity/CraftEntityFactory.java.patch", + "patches/net/minecraft/src/Packet71Weather.java.patch", + "patches/org/spoutcraft/api/material/item/GenericArmor.java.patch", + "patches/org/spoutcraft/api/inventory/MaterialManager.java.patch", + "patches/net/minecraft/src/GameRuleValue.java.patch", + "patches/org/spoutcraft/api/gui/GenericSlider.java.patch", + "patches/net/minecraft/src/Packet131MapData.java.patch", + "patches/net/minecraft/src/CallableLevelDimension.java.patch", + "patches/net/minecraft/src/LanguageMetadataSection.java.patch", + "patches/net/minecraft/src/EnumFacing.java.patch", + "patches/com/prupe/mcpatcher/cc/Lightmap.java.patch", + "patches/net/minecraft/src/GuiParticle.java.patch", + "patches/net/minecraft/src/WorldServer.java.patch", + "patches/org/spoutcraft/client/gui/server/CountryButton.java.patch", + "patches/org/spoutcraft/client/packet/PacketGenericTool.java.patch", + "patches/net/minecraft/src/CommandServerBanIp.java.patch", + "patches/net/minecraft/src/StatList.java.patch", + "patches/org/spoutcraft/client/player/accessories/TopHat.java.patch", + "patches/net/minecraft/src/BlockWall.java.patch", + "patches/org/spoutcraft/client/gui/settings/controls/FancyItemsButton.java.patch", + "patches/net/minecraft/src/ExceptionRetryCall.java.patch", + "patches/net/minecraft/src/WorldGenSand.java.patch", + "patches/net/minecraft/src/RenderLiving.java.patch", + "patches/net/minecraft/src/WorldClient.java.patch", + "patches/org/spoutcraft/client/gui/minimap/CoordsToggleCheckBox.java.patch", + "patches/org/spoutcraft/api/inventory/Recipe.java.patch", + "patches/net/minecraft/src/ItemColored.java.patch", + "patches/net/minecraft/src/ComponentStrongholdRoomCrossing.java.patch", + "patches/net/minecraft/src/RenderEndPortal.java.patch", + "patches/net/minecraft/src/BlockStairs.java.patch", + "patches/net/minecraft/src/GuiWinGame.java.patch", + "patches/org/spoutcraft/client/inventory/ItemData.java.patch", + "patches/net/minecraft/src/ModelSquid.java.patch", + "patches/net/minecraft/src/RecipesArmor.java.patch", + "patches/org/spoutcraft/client/gui/minimap/ResetButton.java.patch", + "patches/net/minecraft/src/BlockWood.java.patch", + "patches/org/spoutcraft/api/gui/GenericSlot.java.patch", + "patches/org/spoutcraft/api/block/design/GenericBlockDesign.java.patch", + "patches/net/minecraft/src/ItemEgg.java.patch", + "patches/net/minecraft/src/WorldTemplateList.java.patch", + "patches/net/minecraft/src/ContainerWorkbench.java.patch", + "patches/net/minecraft/src/McoServerAddress.java.patch", + "patches/net/minecraft/src/ContainerPlayer.java.patch", + "patches/org/spoutcraft/client/gui/settings/controls/FancyGraphicsButton.java.patch", + "patches/net/minecraft/src/InventoryMerchant.java.patch", + "patches/net/minecraft/src/Timer.java.patch", + "patches/net/minecraft/src/CommandBase.java.patch", + "patches/net/minecraft/src/Packet12PlayerLook.java.patch", + "patches/org/spoutcraft/client/packet/PacketSendPrecache.java.patch", + "patches/org/spoutcraft/client/gui/settings/controls/RenderDistanceButton.java.patch", + "patches/net/minecraft/src/MaterialTransparent.java.patch", + "patches/net/minecraft/src/EntityGiantZombie.java.patch", + "patches/net/minecraft/src/CommandSetPlayerTimeout.java.patch", + "patches/net/minecraft/src/ResourceLocation.java.patch", + "patches/org/spoutcraft/client/util/NetworkUtils.java.patch", + "patches/net/minecraft/src/ThreadDownloadImage.java.patch", + "patches/net/minecraft/src/Packet70GameEvent.java.patch", + "patches/org/spoutcraft/client/gui/settings/controls/AutosaveButton.java.patch", + "patches/net/minecraft/src/Packet4UpdateTime.java.patch", + "patches/net/minecraft/src/MerchantRecipe.java.patch", + "patches/net/minecraft/src/ItemLeash.java.patch", + "patches/net/minecraft/src/Packet100OpenWindow.java.patch", + "patches/org/spoutcraft/client/gui/minimap/GuiAdvancedEntitySettings.java.patch", + "patches/net/minecraft/src/CreativeTabs.java.patch", + "patches/net/minecraft/src/Hopper.java.patch", + "patches/net/minecraft/src/GuiButtonLanguage.java.patch", + "patches/net/minecraft/src/CommandSpreadPlayersPosition.java.patch", + "patches/net/minecraft/src/BlockPistonMoving.java.patch", + "patches/net/minecraft/src/EnumSkyBlock.java.patch", + "patches/net/minecraft/src/GuiSlotStatsGeneral.java.patch", + "patches/net/minecraft/src/EntityAIOwnerHurtTarget.java.patch", + "patches/org/spoutcraft/client/player/ClientPlayer.java.patch", + "patches/net/minecraft/src/BlockBeacon.java.patch", + "patches/net/minecraft/src/CallableUpdatingScreenName.java.patch", + "patches/net/minecraft/src/RenderZombie.java.patch", + "patches/org/spoutcraft/client/entity/CraftLivingEntity.java.patch", + "patches/net/minecraft/src/Packet61DoorChange.java.patch", + "patches/net/minecraft/src/RConUtils.java.patch", + "patches/org/spoutcraft/client/packet/PacketClipboardText.java.patch", + "patches/net/minecraft/src/BlockDispenser.java.patch", + "patches/com/prupe/mcpatcher/hd/AAHelper.java.patch", + "patches/net/minecraft/src/EntitySelectorArmoredMob.java.patch", + "patches/net/minecraft/src/BlockNetherStalk.java.patch", + "patches/net/minecraft/src/RenderGiantZombie.java.patch", + "patches/net/minecraft/src/RegistryDefaulted.java.patch", + "patches/net/minecraft/src/EntityWeatherEffect.java.patch", + "patches/net/minecraft/src/ServerCommandManager.java.patch", + "patches/net/minecraft/src/CommandServerStop.java.patch", + "patches/net/minecraft/src/ScoreObjective.java.patch", + "patches/com/prupe/mcpatcher/sky/SkyRenderer.java.patch", + "patches/net/minecraft/src/GuiTextField.java.patch", + "patches/org/spoutcraft/api/material/block/Slab.java.patch", + "patches/net/minecraft/src/CommandGameMode.java.patch", + "patches/net/minecraft/src/EntityXPOrb.java.patch", + "patches/net/minecraft/src/ResourcePackRepository.java.patch", + "patches/net/minecraft/src/ComponentStrongholdRightTurn.java.patch", + "patches/net/minecraft/src/WorldInfo.java.patch", + "patches/net/minecraft/src/MinecraftINNER13.java.patch", + "patches/net/minecraft/src/BlockPressurePlateWeighted.java.patch", + "patches/net/minecraft/src/BlockButtonWood.java.patch", + "patches/net/minecraft/src/ItemCoal.java.patch", + "patches/net/minecraft/src/Packet33RelEntityMoveLook.java.patch", + "patches/org/spoutcraft/api/material/Weapon.java.patch", + "patches/net/minecraft/src/ChunkLoader.java.patch", + "patches/org/spoutcraft/api/util/MutableIntegerVector.java.patch", + "patches/net/minecraft/src/StructureNetherBridgePieces.java.patch", + "patches/org/spoutcraft/api/keyboard/AbstractBinding.java.patch", + "patches/net/minecraft/src/EntitySkeleton.java.patch", + "patches/org/spoutcraft/api/gui/ComboBox.java.patch", + "patches/net/minecraft/src/Packet9Respawn.java.patch", + "patches/org/spoutcraft/api/player/ChatManager.java.patch", + "patches/net/minecraft/src/Scoreboard.java.patch", + "patches/com/prupe/mcpatcher/cc/ColorizeItem.java.patch", + "patches/net/minecraft/src/BanEntry.java.patch", + "patches/net/minecraft/src/RConThreadQuery.java.patch", + "patches/org/spoutcraft/client/gui/settings/controls/AutomatedCheckBox.java.patch", + "patches/org/spoutcraft/client/gui/database/GuiAPIDisplay.java.patch", + "patches/net/minecraft/src/LanServerList.java.patch", + "patches/net/minecraft/src/ItemRedstone.java.patch", + "patches/org/spoutcraft/client/gui/settings/controls/WaterBiomeColorsButton.java.patch", + "patches/net/minecraft/src/ResourcePackRepositoryEntry.java.patch", + "patches/org/spoutcraft/client/gui/server/ServerListInfo.java.patch", + "patches/net/minecraft/src/GuiBrewingStand.java.patch", + "patches/org/spoutcraft/client/packet/PacketPermissionUpdate.java.patch", + "patches/org/spoutcraft/client/gui/settings/controls/SmoothFPSButton.java.patch", + "patches/net/minecraft/src/RecipeFireworks.java.patch", + "patches/org/spoutcraft/api/gui/GenericPopup.java.patch", + "patches/net/minecraft/src/DispenserBehaviorMobEgg.java.patch", + "patches/com/prupe/mcpatcher/TileLoader$1.java.patch", + "patches/net/minecraft/src/Entity.java.patch", + "patches/net/minecraft/src/ComponentNetherBridgeCorridor.java.patch", + "patches/net/minecraft/src/EntityDropParticleFX.java.patch", + "patches/net/minecraft/src/DispenserBehaviorSnowball.java.patch", + "patches/net/minecraft/src/DerivedWorldInfo.java.patch", + "patches/org/spoutcraft/api/material/block/Sapling.java.patch", + "patches/net/minecraft/src/ItemFireworkCharge.java.patch", + "patches/org/spoutcraft/api/gui/Control.java.patch", + "patches/org/spoutcraft/client/gui/settings/controls/FlightSpeedSlider.java.patch", + "patches/net/minecraft/src/RenderMooshroom.java.patch", + "patches/net/minecraft/src/NetClientHandler.java.patch", + "patches/org/spoutcraft/api/util/FixedVector.java.patch", + "patches/net/minecraft/src/DedicatedServerListenThread.java.patch", + "patches/org/spoutcraft/client/packet/PacketScreenAction.java.patch", + "patches/net/minecraft/src/IMob.java.patch", + "patches/org/spoutcraft/api/gui/Rectangle.java.patch", + "patches/net/minecraft/src/EntityAIBeg.java.patch", + "patches/net/minecraft/src/ItemBow.java.patch", + "patches/org/spoutcraft/api/gui/ListWidgetItem.java.patch", + "patches/net/minecraft/src/PlayerControllerMP.java.patch", + "patches/org/spoutcraft/api/gui/RenderUtil.java.patch", + "patches/net/minecraft/src/RecipesIngots.java.patch", + "patches/org/spoutcraft/api/gui/Texture.java.patch", + "patches/net/minecraft/src/SlotArmor.java.patch", + "patches/net/minecraft/src/StringUtils.java.patch", + "patches/com/prupe/mcpatcher/sky/SkyRenderer$1.java.patch", + "patches/net/minecraft/src/EnchantmentDamage.java.patch", + "patches/org/spoutcraft/client/entity/CraftEntity.java.patch", + "patches/org/spoutcraft/api/material/item/GenericTool.java.patch", + "patches/net/minecraft/src/ServerCommand.java.patch", + "patches/net/minecraft/src/IUpdatePlayerListBox.java.patch", + "patches/net/minecraft/src/StatStringFormatKeyInv.java.patch", + "patches/net/minecraft/src/Packet35EntityHeadRotation.java.patch", + "patches/net/minecraft/src/BlockRedstoneTorch.java.patch", + "patches/net/minecraft/src/SelectionListInvited.java.patch", + "patches/org/spoutcraft/client/gui/settings/controls/ServerLightButton.java.patch", + "patches/net/minecraft/src/EntityItemFrame.java.patch", + "patches/net/minecraft/src/ModelSpider.java.patch", + "patches/net/minecraft/src/BlockSandStone.java.patch", + "patches/net/minecraft/src/ItemSkull.java.patch", + "patches/org/spoutcraft/client/gui/minimap/HeightMapCheckBox.java.patch", + "patches/net/minecraft/src/EntityAITempt.java.patch", + "patches/net/minecraft/src/RenderHorse.java.patch", + "patches/net/minecraft/src/Language.java.patch", + "patches/net/minecraft/src/EnchantmentOxygen.java.patch", + "patches/org/spoutcraft/client/gui/ScreenUtil.java.patch", + "patches/org/spoutcraft/client/packet/PacketValidatePrecache.java.patch", + "patches/org/spoutcraft/api/Art.java.patch", + "patches/net/minecraft/src/MetadataSerializerRegistration.java.patch", + "patches/com/prupe/mcpatcher/hd/FontUtils.java.patch", + "patches/org/spoutcraft/client/inventory/SpoutcraftRecipe.java.patch", + "patches/net/minecraft/src/DedicatedPlayerList.java.patch", + "patches/net/minecraft/src/ItemBoat.java.patch", + "patches/org/spoutcraft/api/gui/InGameHUD.java.patch", + "patches/net/minecraft/src/InventoryLargeChest.java.patch", + "patches/net/minecraft/src/ComponentNetherBridgeCrossing3.java.patch", + "patches/net/minecraft/src/AttributeInstance.java.patch", + "patches/net/minecraft/src/RenderEnchantmentTable.java.patch", + "patches/net/minecraft/src/EntityGolem.java.patch", + "patches/net/minecraft/src/PacketCount.java.patch", + "patches/org/spoutcraft/api/gui/KeyManager.java.patch", + "patches/net/minecraft/src/BlockHopper.java.patch", + "patches/org/spoutcraft/client/gui/server/ServerItem.java.patch", + "patches/org/spoutcraft/client/gui/server/GuiFavorites.java.patch", + "patches/org/spoutcraft/api/material/Liquid.java.patch", + "patches/net/minecraft/src/EntitySnowShovelFX.java.patch", + "patches/net/minecraft/src/RenderTNTPrimed.java.patch", + "patches/org/spoutcraft/api/gui/Slider.java.patch", + "patches/org/spoutcraft/client/special/Holiday.java.patch", + "patches/net/minecraft/src/ModelWitch.java.patch", + "patches/org/spoutcraft/client/gui/settings/controls/ChatButton.java.patch", + "patches/net/minecraft/src/EntityAITradePlayer.java.patch", + "patches/net/minecraft/src/AnvilChunkLoader.java.patch", + "patches/net/minecraft/src/Packet16BlockItemSwitch.java.patch", + "patches/net/minecraft/src/BlockGravel.java.patch", + "patches/net/minecraft/src/ComponentNetherBridgeCorridor2.java.patch", + "patches/net/minecraft/src/EntityMinecartFurnace.java.patch", + "patches/net/minecraft/src/ThreadStatSyncherReceive.java.patch", + "patches/org/spoutcraft/client/gui/settings/controls/DisplayPlayerNames3rdPersonButton.java.patch", + "patches/org/spoutcraft/client/player/accessories/PacketAccessory.java.patch", + "patches/net/minecraft/src/GuiScreenSubscription.java.patch", + "patches/net/minecraft/src/ModelSkeleton.java.patch", + "patches/net/minecraft/src/ComponentVillageHouse4_Garden.java.patch", + "patches/com/prupe/mcpatcher/mob/MobRuleList.java.patch", + "patches/org/spoutcraft/client/spoutworth/SpoutWorth.java.patch", + "patches/net/minecraft/src/WorldProviderHell.java.patch", + "patches/net/minecraft/src/Packet44UpdateAttributes.java.patch", + "patches/net/minecraft/src/GuiScreenPendingInvitationList.java.patch", + "patches/net/minecraft/src/CreativeTabDeco.java.patch", + "patches/org/spoutcraft/client/special/VIP.java.patch", + "patches/org/spoutcraft/client/packet/PacketSendLink.java.patch", + "patches/net/minecraft/src/EntityTracker.java.patch", + "patches/net/minecraft/src/Packet203AutoComplete.java.patch", + "patches/org/spoutcraft/client/ScheduledTextFieldUpdate.java.patch", + "patches/org/spoutcraft/api/inventory/InventoryBuilder.java.patch", + "patches/org/spoutcraft/client/ClipboardThread.java.patch", + "patches/org/spoutcraft/api/material/item/GenericCustomItem.java.patch", + "patches/net/minecraft/src/EntityWitherAttackFilter.java.patch", + "patches/com/prupe/mcpatcher/TessellatorUtils.java.patch", + "patches/net/minecraft/src/EntityPlayerMP.java.patch", + "patches/net/minecraft/src/GuiScreen.java.patch", + "patches/net/minecraft/src/ItemHangingEntity.java.patch", + "patches/net/minecraft/src/RenderHelper.java.patch", + "patches/net/minecraft/src/CallableTexturePack.java.patch", + "patches/net/minecraft/src/ContainerEnchantment.java.patch", + "patches/org/spoutcraft/client/packet/PacketItemName.java.patch", + "patches/net/minecraft/src/GuiCreateFlatWorldListSlot.java.patch", + "patches/net/minecraft/src/EntityZombie.java.patch", + "patches/net/minecraft/src/BlockLeaves.java.patch", + "patches/net/minecraft/src/CallableClientProfiler.java.patch", + "patches/net/minecraft/src/TileEntityMobSpawnerRenderer.java.patch", + "patches/org/spoutcraft/api/gui/GenericPolygon.java.patch", + "patches/net/minecraft/src/CommandServerBan.java.patch", + "patches/net/minecraft/src/ItemBed.java.patch", + "patches/org/spoutcraft/api/material/MaterialData.java.patch", + "patches/net/minecraft/src/Packet5PlayerInventory.java.patch", + "patches/net/minecraft/src/TaskWorldCreation.java.patch", + "patches/net/minecraft/src/EntitySheep.java.patch", + "patches/net/minecraft/src/EntityLargeFireball.java.patch", + "patches/net/minecraft/src/GuiCommandBlock.java.patch", + "patches/com/prupe/mcpatcher/ctm/GlassPaneRenderer.java.patch", + "patches/net/minecraft/src/GuiNewChat.java.patch", + "patches/net/minecraft/src/FontRenderer.java.patch", + "patches/org/spoutcraft/client/SpoutVersion.java.patch", + "patches/org/spoutcraft/api/gui/AbstractListModel.java.patch", + "patches/net/minecraft/src/Packet25EntityPainting.java.patch", + "patches/net/minecraft/src/WorldGenFlowers.java.patch", + "patches/net/minecraft/src/ComponentScatteredFeature.java.patch", + "patches/net/minecraft/src/GuiChest.java.patch", + "patches/net/minecraft/src/ItemDye.java.patch", + "patches/net/minecraft/src/CommandServerEmote.java.patch", + "patches/com/prupe/mcpatcher/cc/ColorizeBlock.java.patch", + "patches/net/minecraft/src/GenLayerVoronoiZoom.java.patch", + "patches/net/minecraft/src/CommandShowSeed.java.patch", + "patches/net/minecraft/src/EntityAIPlay.java.patch", + "patches/net/minecraft/src/TileEntityBrewingStand.java.patch", + "patches/net/minecraft/src/ComponentVillageRoadPiece.java.patch", + "patches/net/minecraft/src/RConThreadBase.java.patch", + "patches/net/minecraft/src/ComponentVillageHouse3.java.patch", + "patches/org/spoutcraft/api/gui/BasicLabel.java.patch", + "patches/net/minecraft/src/PendingInvitesList.java.patch", + "patches/net/minecraft/src/NetworkListenThread.java.patch", + "patches/org/spoutcraft/client/gui/settings/controls/FancyLightingButton.java.patch", + "patches/net/minecraft/src/NBTTagInt.java.patch", + "patches/net/minecraft/src/ItemSword.java.patch", + "patches/net/minecraft/src/EntityAIPanic.java.patch", + "patches/net/minecraft/src/ComponentMineshaftCross.java.patch", + "patches/net/minecraft/src/EntitySelectorAlive.java.patch", + "patches/org/spoutcraft/client/packet/PacketControlAction.java.patch", + "patches/net/minecraft/src/MapGenStronghold.java.patch", + "patches/net/minecraft/src/GuiSlotOnlineServerList.java.patch", + "patches/net/minecraft/src/Packet0KeepAlive.java.patch", + "patches/net/minecraft/src/BiomeGenEnd.java.patch", + "patches/net/minecraft/src/GrassColorReloadListener.java.patch", + "patches/net/minecraft/src/Slot.java.patch", + "patches/org/spoutcraft/client/gui/settings/controls/WeatherToggleButton.java.patch", + "patches/org/spoutcraft/api/gui/Label.java.patch", + "patches/net/minecraft/src/SoundManager.java.patch", + "patches/net/minecraft/src/GuiFurnace.java.patch", + "patches/net/minecraft/src/FontMetadataSection.java.patch", + "patches/com/prupe/mcpatcher/TexturePackChangeHandler$1.java.patch", + "patches/net/minecraft/src/StructureStart.java.patch", + "patches/org/spoutcraft/client/gui/UpdatingComboBox.java.patch", + "patches/net/minecraft/src/EntityWolf.java.patch", + "patches/org/spoutcraft/api/gui/Scrollable.java.patch", + "patches/net/minecraft/src/ThreadLanServerFind.java.patch", + "patches/net/minecraft/src/ContainerHorseInventory.java.patch", + "patches/net/minecraft/src/Packet8UpdateHealth.java.patch", + "patches/org/spoutcraft/client/gui/minimap/Waypoint.java.patch", + "patches/net/minecraft/src/RenderCow.java.patch", + "patches/net/minecraft/src/TcpReaderThread.java.patch", + "patches/net/minecraft/src/CallableLevelStorageVersion.java.patch", + "patches/org/spoutcraft/client/gui/server/AccessTypeFilter.java.patch", + "patches/net/minecraft/src/EnumEnchantmentType.java.patch", + "patches/net/minecraft/src/CallableTileEntityID.java.patch", + "patches/org/spoutcraft/client/gui/settings/controls/AntiAliasingButton.java.patch", + "patches/net/minecraft/src/EntityLiving.java.patch", + "patches/org/spoutcraft/client/entity/EntityText.java.patch", + "patches/net/minecraft/src/BiomeEndDecorator.java.patch", + "patches/net/minecraft/src/EntityBreakingFX.java.patch", + "patches/net/minecraft/src/EntityAIOcelotAttack.java.patch", + "patches/net/minecraft/src/ComponentScatteredFeatureSwampHut.java.patch", + "patches/net/minecraft/src/ItemMultiTextureTile.java.patch", + "patches/net/minecraft/src/ItemMap.java.patch", + "patches/org/spoutcraft/api/gui/GenericGradient.java.patch", + "patches/org/spoutcraft/client/gui/controls/KeyBindingItem.java.patch", + "patches/net/minecraft/src/ItemLilyPad.java.patch", + "patches/net/minecraft/src/ItemMapBase.java.patch", + "patches/net/minecraft/src/CallableJavaInfo.java.patch", + "patches/org/spoutcraft/api/gui/GenericOverlayScreen.java.patch", + "patches/net/minecraft/src/EnumArt.java.patch", + "patches/net/minecraft/src/RenderPig.java.patch", + "patches/net/minecraft/src/CommandServerMessage.java.patch", + "patches/org/spoutcraft/api/material/block/GenericBlock.java.patch", + "patches/net/minecraft/src/GuiScreenClientOutdated.java.patch", + "patches/net/minecraft/src/PositionTextureVertex.java.patch", + "patches/net/minecraft/src/ThreadLanServerPing.java.patch", + "patches/net/minecraft/src/RConThreadClient.java.patch", + "patches/net/minecraft/src/RenderDragon.java.patch", + "patches/org/spoutcraft/api/gui/Point.java.patch", + "patches/org/spoutcraft/client/gui/settings/controls/PerformanceButton.java.patch", + "patches/net/minecraft/src/RenderVillager.java.patch", + "patches/net/minecraft/src/Backup.java.patch", + "patches/net/minecraft/src/NextTickListEntry.java.patch", + "patches/org/spoutcraft/client/gui/minimap/EntityVisibilityCheckbox.java.patch", + "patches/org/spoutcraft/api/gui/GenericControl.java.patch", + "patches/net/minecraft/src/GuiScreenBackupDownloadThread.java.patch", + "patches/net/minecraft/src/NBTTagEnd.java.patch", + "patches/net/minecraft/src/CommandServerWhitelist.java.patch", + "patches/org/spoutcraft/client/inventory/InventoryUtil.java.patch", + "patches/org/spoutcraft/client/gui/InGameScreen.java.patch", + "patches/net/minecraft/src/ItemEnchantedBook.java.patch", + "patches/org/spoutcraft/api/animation/ValueSetDelegate.java.patch", + "patches/com/prupe/mcpatcher/ctm/CTMUtils$1.java.patch", + "patches/net/minecraft/src/RenderSorter.java.patch", + "patches/net/minecraft/src/ComponentMineshaftCorridor.java.patch", + "patches/net/minecraft/server/MinecraftServer.java.patch", + "patches/net/minecraft/src/WorldProviderEnd.java.patch", + "patches/org/spoutcraft/client/gui/controls/VanillaBindingItem.java.patch", + "patches/net/minecraft/src/WorldGenTaiga1.java.patch", + "patches/org/spoutcraft/client/gui/settings/controls/ReplaceBlocksButton.java.patch", + "patches/net/minecraft/src/ModelBox.java.patch", + "patches/net/minecraft/src/Packet23VehicleSpawn.java.patch", + "patches/net/minecraft/src/ItemLeaves.java.patch", + "patches/net/minecraft/src/BlockPistonExtension.java.patch", + "patches/org/spoutcraft/api/material/block/Solid.java.patch", + "patches/net/minecraft/src/EntityAIBase.java.patch", + "patches/net/minecraft/src/ItemBucketMilk.java.patch", + "patches/net/minecraft/src/MapGenBase.java.patch", + "patches/net/minecraft/src/WorldGenGlowStone1.java.patch", + "patches/net/minecraft/src/DispenserBehaviorExperience.java.patch", + "patches/net/minecraft/src/GuiErrorScreen.java.patch", + "patches/net/minecraft/src/BlockTallGrass.java.patch", + "patches/net/minecraft/src/StatTypeSimple.java.patch", + "patches/org/bukkit/util/config/ConfigurationNode.java.patch", + "patches/net/minecraft/src/NBTTagLong.java.patch", + "patches/net/minecraft/src/PathNavigate.java.patch", + "patches/org/spoutcraft/api/gui/TextField.java.patch", + "patches/net/minecraft/src/NBTTagCompound.java.patch", + "patches/net/minecraft/src/MapStorage.java.patch", + "patches/org/spoutcraft/client/gui/settings/controls/FancyCloudsButton.java.patch", + "patches/net/minecraft/src/BlockLog.java.patch", + "patches/org/spoutcraft/client/gui/settings/controls/TimeButton.java.patch", + "patches/net/minecraft/src/CallableParticlePositionInfo.java.patch", + "patches/net/minecraft/src/MaterialLogic.java.patch", + "patches/net/minecraft/src/ModelRenderer.java.patch", + "patches/net/minecraft/src/PlayerUsageSnooperThread.java.patch", + "patches/net/minecraft/src/CallableTagCompound1.java.patch", + "patches/org/spoutcraft/api/Client.java.patch", + "patches/net/minecraft/src/WeightedRandom.java.patch", + "patches/net/minecraft/src/ItemSpade.java.patch", + "patches/net/minecraft/src/DemoWorldServer.java.patch", + "patches/net/minecraft/src/EntityVillager.java.patch", + "patches/net/minecraft/src/GenLayerRiverInit.java.patch", + "patches/net/minecraft/src/PotionHealth.java.patch", + "patches/net/minecraft/src/EntityJumpHelper.java.patch", + "patches/org/spoutcraft/api/gui/GenericListWidget.java.patch", + "patches/org/spoutcraft/api/util/Location.java.patch", + "patches/com/prupe/mcpatcher/ctm/RenderPass$2.java.patch", + "patches/net/minecraft/src/BlockFlowing.java.patch", + "patches/org/spoutcraft/client/packet/PacketNotification.java.patch", + "patches/net/minecraft/src/ItemCloth.java.patch", + "patches/net/minecraft/src/World.java.patch", + "patches/net/minecraft/src/RenderArrow.java.patch", + "patches/org/spoutcraft/api/Instrument.java.patch", + "patches/net/minecraft/src/GuiConfirmOpenLink.java.patch", + "patches/net/minecraft/src/TextureMap.java.patch", + "patches/org/spoutcraft/client/gui/settings/controls/SignDistanceButton.java.patch", + "patches/net/minecraft/src/CommandClearInventory.java.patch", + "patches/net/minecraft/src/ItemSimpleFoiled.java.patch", + "patches/net/minecraft/src/EntityAuraFX.java.patch", + "patches/net/minecraft/src/EntityPig.java.patch", + "patches/net/minecraft/src/BlockSnow.java.patch", + "patches/net/minecraft/src/FallbackResourceManager.java.patch", + "patches/net/minecraft/src/EntityRenderer.java.patch", + "patches/net/minecraft/src/CallableStructureType.java.patch", + "patches/org/spoutcraft/client/gui/server/GuiServerInfo.java.patch", + "patches/org/spoutcraft/client/sound/QueuedSound.java.patch", + "patches/net/minecraft/src/GuiDisconnected.java.patch", + "patches/org/spoutcraft/client/player/accessories/Sunglasses.java.patch", + "patches/net/minecraft/src/StatFileWriter.java.patch", + "patches/net/minecraft/src/AnvilSaveHandler.java.patch", + "patches/org/spoutcraft/client/gui/minimap/ZoomModeButton.java.patch", + "patches/net/minecraft/src/StitchSlot.java.patch", + "patches/net/minecraft/src/EntityLeashKnot.java.patch", + "patches/net/minecraft/src/CallableLaunchedVersion.java.patch", + "patches/net/minecraft/src/ItemFireball.java.patch", + "patches/net/minecraft/src/EntityAIRestrictOpenDoor.java.patch", + "patches/net/minecraft/src/ItemCarrotOnAStick.java.patch", + "patches/net/minecraft/src/CallableBlockType.java.patch", + "patches/com/prupe/mcpatcher/Config$FileEntry.java.patch", + "patches/org/spoutcraft/client/player/accessories/Tail.java.patch", + "patches/net/minecraft/src/EntityArrow.java.patch", + "patches/org/spoutcraft/client/gui/settings/controls/FarViewButton.java.patch", + "patches/net/minecraft/src/BlockQuartz.java.patch", + "patches/net/minecraft/src/PendingInvite.java.patch", + "patches/net/minecraft/src/ScoreComparator.java.patch", + "patches/net/minecraft/src/Packet3Chat.java.patch", + "patches/org/spoutcraft/api/keyboard/KeyBindingManager.java.patch", + "patches/net/minecraft/src/DispenserBehaviorPotion.java.patch", + "patches/net/minecraft/src/EntityWither.java.patch", + "patches/org/spoutcraft/api/material/Food.java.patch", + "patches/org/spoutcraft/api/inventory/PlayerInventory.java.patch", + "patches/net/minecraft/src/Packet1Login.java.patch", + "patches/net/minecraft/src/CallableLvl3.java.patch", + "patches/net/minecraft/src/WorldRenderer.java.patch", + "patches/net/minecraft/src/SaveHandlerMP.java.patch", + "patches/net/minecraft/src/GuiSlotServer.java.patch", + "patches/net/minecraft/src/EntityAILeapAtTarget.java.patch", + "patches/org/spoutcraft/client/packet/PacketBiomeWeather.java.patch", + "patches/net/minecraft/src/TileEntityDispenser.java.patch", + "patches/net/minecraft/src/ItemPiston.java.patch", + "patches/net/minecraft/src/CreativeTabTransport.java.patch", + "patches/net/minecraft/src/SaveFormatOld.java.patch", + "patches/net/minecraft/src/StitcherException.java.patch", + "patches/net/minecraft/src/TcpMasterThread.java.patch", + "patches/net/minecraft/src/EntityAIWatchClosest.java.patch", + "patches/net/minecraft/src/EntitySplashFX.java.patch", + "patches/net/minecraft/src/SimpleTexture.java.patch", + "patches/com/prupe/mcpatcher/cc/ColorizeWorld.java.patch", + "patches/net/minecraft/src/GuiConnecting.java.patch", + "patches/net/minecraft/src/BlockEndPortal.java.patch", + "patches/net/minecraft/src/CallableEntityType.java.patch", + "patches/net/minecraft/src/BlockSkull.java.patch", + "patches/com/prupe/mcpatcher/hd/CustomAnimation$1.java.patch", + "patches/com/prupe/mcpatcher/ctm/TileOverrideImpl$CTM.java.patch", + "patches/com/prupe/mcpatcher/ctm/TileOverrideImpl$Random1.java.patch", + "patches/net/minecraft/src/CommandSetSpawnpoint.java.patch", + "patches/net/minecraft/src/ContainerMerchant.java.patch", + "patches/org/spoutcraft/client/gui/minimap/GuiOverviewMap.java.patch", + "patches/net/minecraft/src/DemoWorldManager.java.patch", + "patches/net/minecraft/src/CallableLevelSpawnLocation.java.patch", + "patches/net/minecraft/src/IRangedAttackMob.java.patch", + "patches/net/minecraft/src/BlockDeadBush.java.patch", + "patches/net/minecraft/src/ChatClickData.java.patch", + "patches/org/spoutcraft/api/gui/WidgetAnim.java.patch", + "patches/net/minecraft/src/EntityDragon.java.patch", + "patches/net/minecraft/src/ComponentStrongholdStairsStraight.java.patch", + "patches/org/spoutcraft/client/io/DownloadAssets.java.patch", + "patches/net/minecraft/src/GuiScreenMcoWorldTemplateSelectionList.java.patch", + "patches/net/minecraft/src/ItemHoe.java.patch", + "patches/net/minecraft/src/GenLayerFuzzyZoom.java.patch", + "patches/net/minecraft/src/AnvilConverterData.java.patch", + "patches/net/minecraft/src/GuiScreenResetWorld.java.patch", + "patches/net/minecraft/src/ComponentMineshaftRoom.java.patch", + "patches/net/minecraft/src/SlotEnchantmentTable.java.patch", + "patches/net/minecraft/src/GuiScreenMcoWorldTemplateDownloadThread.java.patch", + "patches/net/minecraft/src/TileEntitySign.java.patch", + "patches/net/minecraft/src/GuiBeaconButtonCancel.java.patch", + "patches/net/minecraft/src/BlockJukeBox.java.patch", + "patches/net/minecraft/src/CommandToggleDownfall.java.patch", + "patches/org/spoutcraft/client/gui/settings/controls/FancyParticlesButton.java.patch", + "patches/net/minecraft/src/StructureVillagePieceWeight.java.patch", + "patches/org/spoutcraft/client/gui/settings/controls/SoundEffectsSlider.java.patch", + "patches/net/minecraft/src/TileEntitySkullRenderer.java.patch", + "patches/net/minecraft/src/WorldGenSwamp.java.patch", + "patches/org/spoutcraft/client/util/CacheMap.java.patch", + "patches/net/minecraft/src/EntityAIWatchClosest2.java.patch", + "patches/net/minecraft/src/ContainerHopper.java.patch", + "patches/net/minecraft/src/EntitySpider.java.patch", + "patches/net/minecraft/src/BlockPotato.java.patch", + "patches/org/spoutcraft/client/packet/PacketCustomBlockChunkOverride.java.patch", + "patches/net/minecraft/src/ComponentVillageWell.java.patch", + "patches/net/minecraft/src/BlockClay.java.patch", + "patches/net/minecraft/src/ItemPotion.java.patch", + "patches/net/minecraft/src/ItemAppleGold.java.patch", + "patches/org/spoutcraft/api/material/item/Dye.java.patch", + "patches/org/spoutcraft/client/packet/PacketGenericBlock.java.patch", + "patches/org/spoutcraft/client/packet/PacketCacheDeleteFile.java.patch", + "patches/net/minecraft/src/CommandKill.java.patch", + "patches/net/minecraft/src/ComponentVillageWoodHut.java.patch", + "patches/net/minecraft/src/WorldTemplate.java.patch", + "patches/net/minecraft/src/MapGenScatteredFeature.java.patch", + "patches/net/minecraft/src/BlockIce.java.patch", + "patches/org/spoutcraft/api/gui/ContainerType.java.patch", + "patches/com/prupe/mcpatcher/hd/FontUtils$1.java.patch", + "patches/net/minecraft/src/Packet130UpdateSign.java.patch", + "patches/net/minecraft/src/EnchantmentDurability.java.patch", + "patches/net/minecraft/src/Tuple.java.patch", + "patches/net/minecraft/src/RenderItemFrame.java.patch", + "patches/net/minecraft/src/DataWatcher.java.patch", + "patches/com/prupe/mcpatcher/BlendMethod.java.patch", + "patches/org/spoutcraft/api/gui/GenericBitmap.java.patch", + "patches/net/minecraft/src/GuiHopper.java.patch", + "patches/com/prupe/mcpatcher/ctm/RenderPassAPI.java.patch", + "patches/org/spoutcraft/client/PacketDecompressionThread.java.patch", + "patches/net/minecraft/src/CallableScreenSize.java.patch", + "patches/net/minecraft/src/CallableLevelGeneratorOptions.java.patch", + "patches/net/minecraft/src/Packet60Explosion.java.patch", + "patches/org/spoutcraft/client/gui/minimap/MinimapConfig.java.patch", + "patches/net/minecraft/src/ContainerRepair.java.patch", + "patches/org/spoutcraft/client/gui/controls/GuiEditShortcut.java.patch", + "patches/org/spoutcraft/api/animation/AnimationProgress.java.patch", + "patches/net/minecraft/src/Packet62LevelSound.java.patch", + "patches/net/minecraft/src/GuiEnchantment.java.patch", + "patches/org/spoutcraft/client/gui/FilterModel.java.patch", + "patches/org/spoutcraft/api/material/block/Grass.java.patch", + "patches/net/minecraft/src/BiomeGenRiver.java.patch", + "patches/net/minecraft/src/TaskLongRunning.java.patch", + "patches/net/minecraft/src/CallableTagCompound2.java.patch", + "patches/org/spoutcraft/client/gui/settings/controls/ManualSelectionButton.java.patch", + "patches/net/minecraft/src/TileEntityMobSpawnerLogic.java.patch", + "patches/net/minecraft/src/EntityExplodeFX.java.patch", + "patches/net/minecraft/src/AnvilConverterException.java.patch", + "patches/org/spoutcraft/client/gui/server/FavoritesModel.java.patch", + "patches/com/prupe/mcpatcher/cc/ColorMap.java.patch", + "patches/org/spoutcraft/client/io/FileDownloadThread.java.patch", + "patches/net/minecraft/src/EntityAITargetNonTamed.java.patch", + "patches/org/spoutcraft/api/gui/BubbleBar.java.patch", + "patches/org/spoutcraft/client/gui/settings/controls/HotbarTextButton.java.patch", + "patches/net/minecraft/src/EntityBat.java.patch", + "patches/net/minecraft/src/TileEntity.java.patch", + "patches/net/minecraft/src/MemoryConnection.java.patch", + "patches/net/minecraft/src/StructurePieceBlockSelector.java.patch", + "patches/net/minecraft/src/Vec3Pool.java.patch", + "patches/org/spoutcraft/api/gui/ScrollArea.java.patch", + "patches/net/minecraft/src/ItemReed.java.patch", + "patches/net/minecraft/src/GuiScreenSelectLocation.java.patch", + "patches/net/minecraft/src/ItemBucket.java.patch", + "patches/net/minecraft/src/PackMetadataSectionSerializer.java.patch", + "patches/org/spoutcraft/api/animation/InQuadAnimationProgress.java.patch", + "patches/net/minecraft/src/CallableClientMemoryStats.java.patch", + "patches/net/minecraft/src/EnchantmentFireAspect.java.patch", + "patches/net/minecraft/src/IBehaviorDispenseItem.java.patch", + "patches/org/spoutcraft/client/util/MapEntry.java.patch", + "patches/net/minecraft/src/IntHashMapEntry.java.patch", + "patches/org/spoutcraft/client/gui/RenderItemCustom.java.patch", + "patches/net/minecraft/src/EntityMinecartEmpty.java.patch", + "patches/com/prupe/mcpatcher/Config$ProfileEntry.java.patch", + "patches/org/spoutcraft/client/player/SpoutPlayer.java.patch", + "patches/net/minecraft/src/CommandWeather.java.patch", + "patches/net/minecraft/src/TextureUtil.java.patch", + "patches/net/minecraft/src/EntityFireworkRocket.java.patch", + "patches/org/spoutcraft/api/util/FastVector.java.patch", + "patches/org/spoutcraft/client/chunkcache/SimpleFileCache.java.patch", + "patches/net/minecraft/src/CallableCrashMemoryReport.java.patch", + "patches/org/spoutcraft/api/block/design/GenericCubeBlockDesign.java.patch", + "patches/org/spoutcraft/client/packet/PacketCustomBlockDesign.java.patch", + "patches/org/spoutcraft/api/gui/GenericButton.java.patch", + "patches/net/minecraft/src/CommandHelp.java.patch", + "patches/net/minecraft/src/ComponentNetherBridgeCrossing2.java.patch", + "patches/org/spoutcraft/client/gui/settings/controls/AdvancedOpenGLButton.java.patch", + "patches/net/minecraft/src/BanList.java.patch", + "patches/net/minecraft/src/FoliageColorReloadListener.java.patch", + "patches/net/minecraft/src/SorterStatsItem.java.patch", + "patches/net/minecraft/src/EnchantmentArrowDamage.java.patch", + "patches/net/minecraft/src/ITileEntityProvider.java.patch", + "patches/net/minecraft/src/CallableJavaInfo2.java.patch", + "patches/com/prupe/mcpatcher/ctm/TileOverrideImpl$VerticalHorizontal.java.patch", + "patches/net/minecraft/src/CallablePacketID.java.patch", + "patches/net/minecraft/src/CommandServerDeop.java.patch", + "patches/org/spoutcraft/api/gui/HungerBar.java.patch", + "patches/net/minecraft/src/CreativeTabCombat.java.patch", + "patches/net/minecraft/src/EntityAIAvoidEntity.java.patch", + "patches/org/spoutcraft/client/config/SettingsHandler.java.patch", + "patches/net/minecraft/src/Packet106Transaction.java.patch", + "patches/net/minecraft/src/GuiYesNo.java.patch", + "patches/net/minecraft/src/SharedMonsterAttributes.java.patch", + "patches/net/minecraft/src/GuiMerchant.java.patch", + "patches/org/spoutcraft/api/gui/ListWidget.java.patch", + "patches/net/minecraft/src/Packet101CloseWindow.java.patch", + "patches/org/spoutcraft/api/inventory/ItemStack.java.patch", + "patches/net/minecraft/src/AbstractResourcePack.java.patch", + "patches/org/spoutcraft/api/BlockChangeDelegate.java.patch", + "patches/net/minecraft/src/ComponentNetherBridgeStairs.java.patch", + "patches/net/minecraft/src/RegistrySimple.java.patch", + "patches/net/minecraft/src/Chunk.java.patch", + "patches/net/minecraft/src/ModelSkeletonHead.java.patch", + "patches/net/minecraft/src/PlayerPositionComparator.java.patch", + "patches/org/spoutcraft/client/gui/database/RandomButton.java.patch", + "patches/net/minecraft/src/ComponentStrongholdCorridor.java.patch", + "patches/net/minecraft/src/AxisAlignedBB.java.patch", + "patches/net/minecraft/src/RenderCaveSpider.java.patch", + "patches/net/minecraft/src/Locale.java.patch", + "patches/net/minecraft/src/Packet34EntityTeleport.java.patch", + "patches/org/spoutcraft/api/player/RenderDistance.java.patch", + "patches/org/spoutcraft/api/gui/CheckBox.java.patch", + "patches/com/prupe/mcpatcher/ctm/CTMUtils$2.java.patch", + "patches/net/minecraft/src/BlockFlowerPot.java.patch", + "patches/org/spoutcraft/api/property/PropertyInterface.java.patch", + "patches/net/minecraft/src/StructureScatteredFeatureStones.java.patch", + "patches/net/minecraft/src/ModelQuadruped.java.patch", + "patches/net/minecraft/src/BlockStoneBrick.java.patch", + "patches/org/spoutcraft/api/material/item/GenericCustomFood.java.patch", + "patches/net/minecraft/src/EntityWitherSkull.java.patch", + "patches/net/minecraft/src/RegionFileChunkBuffer.java.patch", + "patches/net/minecraft/src/NumberInvalidException.java.patch", + "patches/org/spoutcraft/client/gui/minimap/MapWidget.java.patch", + "patches/org/spoutcraft/client/entity/RenderText.java.patch", + "patches/net/minecraft/src/EntityBodyHelper.java.patch", + "patches/net/minecraft/src/WorldGenDeadBush.java.patch", + "patches/net/minecraft/src/Packet39AttachEntity.java.patch", + "patches/org/spoutcraft/api/block/design/BlockDesign.java.patch", + "patches/net/minecraft/src/EntitySilverfish.java.patch", + "patches/net/minecraft/src/GuiButtonNextPage.java.patch", + "patches/net/minecraft/src/BiomeGenSwamp.java.patch", + "patches/org/spoutcraft/api/gui/Orientation.java.patch", + "patches/net/minecraft/src/RenderWitherSkull.java.patch", + "patches/net/minecraft/src/TileEntityDaylightDetector.java.patch", + "patches/net/minecraft/src/EnchantmentArrowKnockback.java.patch", + "patches/org/spoutcraft/client/gui/SimpleWidgetManager.java.patch", + "patches/net/minecraft/src/CombatTracker.java.patch", + "patches/net/minecraft/src/ComponentStrongholdLibrary.java.patch", + "patches/net/minecraft/src/TileEntityDropper.java.patch", + "patches/org/spoutcraft/api/gui/GenericTexture.java.patch", + "patches/net/minecraft/src/WorldGeneratorBonusChest.java.patch", + "patches/net/minecraft/src/IntegratedPlayerList.java.patch", + "patches/net/minecraft/src/RenderTntMinecart.java.patch", + "patches/net/minecraft/src/PortalPosition.java.patch", + "patches/org/spoutcraft/client/gui/settings/controls/DisplayCustomParticlesButton.java.patch", + "patches/net/minecraft/src/AchievementMap.java.patch", + "patches/org/spoutcraft/client/packet/PacketGenericFood.java.patch", + "patches/net/minecraft/src/Packet.java.patch", + "patches/net/minecraft/src/GuiScreenBackupSelectionList.java.patch", + "patches/net/minecraft/src/GameWindowListener.java.patch", + "patches/net/minecraft/src/ItemSeeds.java.patch", + "patches/net/minecraft/src/TaskOnlineConnect.java.patch", + "patches/net/minecraft/src/EnumChatFormatting.java.patch", + "patches/org/spoutcraft/api/player/BiomeManager.java.patch", + "patches/net/minecraft/src/RenderGlobal.java.patch", + "patches/net/minecraft/src/BlockWorkbench.java.patch", + "patches/net/minecraft/src/CreativeTabBrewing.java.patch", + "patches/org/spoutcraft/api/animation/LogarithmicAnimationProgress.java.patch", + "patches/org/spoutcraft/client/entity/EntityCamera.java.patch", + "patches/org/spoutcraft/api/io/SpoutInputStream.java.patch", + "patches/org/spoutcraft/api/AnimatableLocation.java.patch", + "patches/net/minecraft/src/EntityAILookAtVillager.java.patch", + "patches/org/spoutcraft/api/material/Tool.java.patch", + "patches/net/minecraft/src/FurnaceRecipes.java.patch", + "patches/net/minecraft/src/GuiLanguage.java.patch", + "patches/org/spoutcraft/client/gui/minimap/MapRenderer.java.patch", + "patches/com/prupe/mcpatcher/sky/SkyRenderer$Layer.java.patch", + "patches/org/spoutcraft/client/config/Configuration.java.patch", + "patches/net/minecraft/src/BlockSnowBlock.java.patch", + "patches/net/minecraft/src/RecipesTools.java.patch", + "patches/net/minecraft/src/BlockStep.java.patch", + "patches/net/minecraft/src/Material.java.patch", + "patches/net/minecraft/src/SoundPoolEntry.java.patch", + "patches/org/spoutcraft/client/gui/CustomScreen.java.patch", + "patches/org/spoutcraft/client/gui/controls/ControlsCheckBox.java.patch", + "patches/net/minecraft/src/ScreenShotHelper.java.patch", + "patches/net/minecraft/src/BiomeGenHell.java.patch", + "patches/net/minecraft/src/IChunkProvider.java.patch", + "patches/net/minecraft/src/MainProxyAuthenticator.java.patch", + "patches/net/minecraft/src/LongHashMap.java.patch", + "patches/org/spoutcraft/client/packet/PacketFullVersion.java.patch", + "patches/org/spoutcraft/client/ChunkComparator.java.patch", + "patches/org/spoutcraft/client/gui/settings/GuiAdvancedOptions.java.patch", + "patches/net/minecraft/src/BehaviorProjectileDispense.java.patch", + "patches/com/prupe/mcpatcher/ctm/TileOverrideImpl$Top.java.patch", + "patches/net/minecraft/src/InventoryBasic.java.patch", + "patches/net/minecraft/src/GuiAchievements.java.patch", + "patches/net/minecraft/src/EffectRenderer.java.patch", + "patches/net/minecraft/src/IStatType.java.patch", + "patches/org/spoutcraft/client/packet/PacketMovementModifiers.java.patch", + "patches/net/minecraft/src/ChunkPosition.java.patch", + "patches/net/minecraft/src/GuiRepair.java.patch", + "patches/net/minecraft/src/PlayerSelector.java.patch", + "patches/net/minecraft/src/EntityCrit2FX.java.patch", + "patches/net/minecraft/src/McoServerListUpdateTaskComparator.java.patch", + "patches/org/spoutcraft/api/material/block/GenericCustomBlock.java.patch", + "patches/net/minecraft/src/EntitySmokeFX.java.patch", + "patches/org/spoutcraft/client/packet/PacketCacheFile.java.patch", + "patches/net/minecraft/src/EntityZombieGroupData.java.patch", + "patches/net/minecraft/src/ModelSlime.java.patch", + "patches/net/minecraft/src/LongHashMapEntry.java.patch", + "patches/com/prupe/mcpatcher/ctm/TileOverrideImpl$HorizontalVertical.java.patch", + "patches/org/bukkit/ChatColor.java.patch", + "patches/org/spoutcraft/api/gui/GenericComboBox.java.patch", + "patches/net/minecraft/src/Particle.java.patch", + "patches/org/spoutcraft/api/animation/Animation.java.patch", + "patches/net/minecraft/src/CallableLevelWeather.java.patch", + "patches/org/spoutcraft/client/gui/settings/controls/FavorAppearanceButton.java.patch", + "patches/net/minecraft/src/MapGenMineshaft.java.patch", + "patches/net/minecraft/src/LayeredTexture.java.patch", + "patches/com/prupe/mcpatcher/mob/MobRandomizer$ExtraInfo.java.patch", + "patches/org/spoutcraft/client/gui/settings/controls/OptimalGameplayButton.java.patch", + "patches/net/minecraft/src/ModelMinecart.java.patch", + "patches/net/minecraft/src/TileEntityRenderer.java.patch", + "patches/net/minecraft/src/BiomeGenBase.java.patch", + "patches/org/spoutcraft/client/gui/settings/controls/RandomMobTextureButton.java.patch", + "patches/net/minecraft/src/EntityDamageSourceIndirect.java.patch", + "patches/net/minecraft/src/TcpWriterThread.java.patch", + "patches/org/spoutcraft/api/gui/DirtBackground.java.patch", + "patches/net/minecraft/src/CommandServerSaveAll.java.patch", + "patches/net/minecraft/src/ModelOcelot.java.patch", + "patches/net/minecraft/src/BlockFire.java.patch", + "patches/net/minecraft/src/WorldGenShrub.java.patch", + "patches/net/minecraft/src/WorldType.java.patch", + "patches/net/minecraft/client/main/Main.java.patch", + "patches/net/minecraft/src/WorldGenBigTree.java.patch", + "patches/net/minecraft/src/Packet28EntityVelocity.java.patch", + "patches/net/minecraft/src/WorldGenLakes.java.patch", + "patches/net/minecraft/src/DispenserBehaviorEmptyBucket.java.patch", + "patches/net/minecraft/src/ResourcePackRepositoryFilter.java.patch", + "patches/org/spoutcraft/client/io/CRCManager.java.patch", + "patches/org/spoutcraft/client/gui/mainmenu/MainMenu.java.patch", + "patches/net/minecraft/src/Packet40EntityMetadata.java.patch", + "patches/net/minecraft/src/EntityAIAttackOnCollide.java.patch", + "patches/net/minecraft/src/Packet208SetDisplayObjective.java.patch", + "patches/net/minecraft/src/WorldGenFire.java.patch", + "patches/net/minecraft/src/WorldGenClay.java.patch", + "patches/net/minecraft/src/ServerList.java.patch", + "patches/com/prupe/mcpatcher/hd/FancyDial.java.patch", + "patches/org/spoutcraft/client/gui/settings/controls/ResetButton.java.patch", + "patches/net/minecraft/src/BlockLadder.java.patch", + "patches/net/minecraft/src/Gui.java.patch", + "patches/net/minecraft/src/WorldGenForest.java.patch", + "patches/org/spoutcraft/client/player/accessories/AccessoryType.java.patch", + "patches/com/prupe/mcpatcher/ProfilerAPI.java.patch", + "patches/net/minecraft/src/DedicatedServerSleepThread.java.patch", + "patches/org/spoutcraft/api/util/map/TIntPairIntHashMap.java.patch", + "patches/net/minecraft/src/McoServerList.java.patch", + "patches/net/minecraft/src/ILogAgent.java.patch", + "patches/org/spoutcraft/client/gui/minimap/BlockColor.java.patch", + "patches/net/minecraft/src/EnchantmentModifierLiving.java.patch", + "patches/net/minecraft/src/GuiSnooper.java.patch", + "patches/net/minecraft/src/WeightedRandomChestContent.java.patch", + "patches/net/minecraft/src/BlockBookshelf.java.patch", + "patches/org/spoutcraft/client/packet/PacketParticle.java.patch", + "patches/net/minecraft/src/GuiSlot.java.patch", + "patches/org/spoutcraft/api/gui/GenericRectangle.java.patch", + "patches/org/spoutcraft/api/gui/GenericListWidgetItem.java.patch", + "patches/net/minecraft/src/VillageAgressor.java.patch", + "patches/net/minecraft/src/EntityThrowable.java.patch", + "patches/net/minecraft/src/RangedAttribute.java.patch", + "patches/net/minecraft/src/Packet30Entity.java.patch", + "patches/net/minecraft/src/WorldGenVines.java.patch", + "patches/net/minecraft/src/CallableLevelSeed.java.patch", + "patches/net/minecraft/src/CreativeTabSearch.java.patch", + "patches/net/minecraft/src/ComponentScatteredFeatureDesertPyramid.java.patch", + "patches/org/spoutcraft/client/packet/PacketChunkRefresh.java.patch", + "patches/net/minecraft/src/RedstoneUpdateInfo.java.patch", + "patches/net/minecraft/src/ServerConfigurationManager.java.patch", + "patches/net/minecraft/src/Packet107CreativeSetSlot.java.patch", + "patches/net/minecraft/src/ItemSnow.java.patch", + "patches/net/minecraft/src/CommandServerPardon.java.patch", + "patches/org/spoutcraft/client/packet/PacketOpenScreen.java.patch", + "patches/net/minecraft/src/EntityEnderEye.java.patch", + "patches/org/spoutcraft/api/gui/GenericLabel.java.patch", + "patches/net/minecraft/src/FontMetadataSectionSerializer.java.patch", + "patches/net/minecraft/src/GuiButtonLink.java.patch", + "patches/com/prupe/mcpatcher/WeightedIndex$1.java.patch", + "patches/net/minecraft/src/EntityAIOwnerHurtByTarget.java.patch", + "patches/org/spoutcraft/client/gui/settings/controls/OptimizedLightingUpdatesButton.java.patch", + "patches/org/spoutcraft/api/GameMode.java.patch", + "patches/net/minecraft/src/INetworkManager.java.patch", + "patches/net/minecraft/src/Render.java.patch", + "patches/org/spoutcraft/client/packet/CustomPacket.java.patch", + "patches/org/spoutcraft/client/util/UniqueItemStringMap.java.patch", + "patches/net/minecraft/src/Item.java.patch", + "patches/net/minecraft/src/BlockCarrot.java.patch", + "patches/net/minecraft/src/ComponentVillageHall.java.patch", + "patches/net/minecraft/src/CallableTileEntityData.java.patch", + "patches/net/minecraft/src/CallableLevelTime.java.patch", + "patches/net/minecraft/src/MapInfo.java.patch", + "patches/net/minecraft/src/ModelBiped.java.patch", + "patches/net/minecraft/src/EntityFlying.java.patch", + "patches/org/spoutcraft/client/VersionFile.java.patch", + "patches/net/minecraft/src/TileEntityEnchantmentTable.java.patch", + "patches/com/prupe/mcpatcher/ctm/RenderPass.java.patch", + "patches/org/spoutcraft/client/gui/settings/controls/FastDebugInfoButton.java.patch", + "patches/net/minecraft/src/ISaveFormat.java.patch", + "patches/net/minecraft/src/GuiCrafting.java.patch", + "patches/net/minecraft/src/OpenGlCapsChecker.java.patch", + "patches/net/minecraft/src/EntityFireworkSparkFX.java.patch", + "patches/org/spoutcraft/api/gui/GenericCheckBox.java.patch", + "patches/net/minecraft/src/BlockFenceGate.java.patch", + "patches/net/minecraft/src/GuiScreenPendingInvitationINNER2.java.patch", + "patches/net/minecraft/src/RenderPainting.java.patch", + "patches/net/minecraft/src/IntCache.java.patch", + "patches/org/spoutcraft/client/packet/PacketWaypoint.java.patch", + "patches/net/minecraft/src/StepSound.java.patch", + "patches/org/spoutcraft/client/special/Resources.java.patch", + "patches/net/minecraft/src/BlockTNT.java.patch", + "patches/net/minecraft/src/EntityAIOcelotSit.java.patch", + "patches/net/minecraft/src/MapGenStructure.java.patch", + "patches/net/minecraft/src/EntityTNTPrimed.java.patch", + "patches/org/spoutcraft/client/gui/server/ServerModel.java.patch", + "patches/org/spoutcraft/client/gui/ClientTexture.java.patch", + "patches/org/spoutcraft/client/packet/SpoutPacket.java.patch", + "patches/net/minecraft/src/ComponentVillageHouse1.java.patch", + "patches/org/spoutcraft/client/packet/PacketSkinURL.java.patch", + "patches/net/minecraft/src/ComponentNetherBridgeStartPiece.java.patch", + "patches/net/minecraft/src/EntityAIBreakDoor.java.patch", + "patches/net/minecraft/src/Packet205ClientCommand.java.patch", + "patches/net/minecraft/src/ItemSaddle.java.patch", + "patches/net/minecraft/src/SaveFormatComparator.java.patch", + "patches/net/minecraft/src/ICommand.java.patch", + "patches/net/minecraft/src/MetadataSectionSerializer.java.patch", + "patches/net/minecraft/src/AbstractClientPlayer.java.patch", + "patches/net/minecraft/src/ComponentVillagePathGen.java.patch", + "patches/net/minecraft/src/ServerListenThread.java.patch", + "patches/org/spoutcraft/client/TileEntityComparator.java.patch", + "patches/net/minecraft/src/BlockButtonStone.java.patch", + "patches/net/minecraft/src/ContainerCreative.java.patch", + "patches/com/prupe/mcpatcher/ctm/TileOverrideImpl$Vertical.java.patch", + "patches/net/minecraft/src/SoundPoolURLConnection.java.patch", + "patches/net/minecraft/src/StepSoundStone.java.patch", + "patches/net/minecraft/src/EntityEggInfo.java.patch", + "patches/net/minecraft/src/EntityWaterMob.java.patch", + "patches/net/minecraft/src/WrongUsageException.java.patch", + "patches/net/minecraft/src/ShapelessRecipes.java.patch", + "patches/org/spoutcraft/client/chunkcache/PartitionChunk.java.patch", + "patches/net/minecraft/src/PotionHealthBoost.java.patch", + "patches/net/minecraft/src/EntityAIDoorInteract.java.patch", + "patches/net/minecraft/src/ContainerChest.java.patch", + "patches/net/minecraft/src/ModelWolf.java.patch", + "patches/org/spoutcraft/api/MPOnly.java.patch", + "patches/net/minecraft/src/EntityAITasks.java.patch", + "patches/org/spoutcraft/client/inventory/CraftItemStack.java.patch", + "patches/net/minecraft/src/FlatLayerInfo.java.patch", + "patches/org/spoutcraft/api/util/FastLocation.java.patch", + "patches/net/minecraft/src/RenderMinecartMobSpawner.java.patch", + "patches/net/minecraft/src/GenLayerZoom.java.patch", + "patches/net/minecraft/src/GuiGameOver.java.patch", + "patches/net/minecraft/src/EntityAgeable.java.patch", + "patches/net/minecraft/src/HttpUtil.java.patch", + "patches/net/minecraft/src/BackupList.java.patch", + "patches/net/minecraft/src/BiomeCache.java.patch", + "patches/net/minecraft/src/GuiSnooperList.java.patch", + "patches/net/minecraft/src/BlockCake.java.patch", + "patches/net/minecraft/src/EntityAmbientCreature.java.patch", + "patches/net/minecraft/src/CallableServerMemoryStats.java.patch", + "patches/net/minecraft/src/RenderGhast.java.patch", + "patches/net/minecraft/src/MouseFilter.java.patch", + "patches/net/minecraft/src/TexturedQuad.java.patch", + "patches/net/minecraft/src/PathPoint.java.patch", + "patches/net/minecraft/src/LoadingScreenRenderer.java.patch", + "patches/org/spoutcraft/api/gui/GenericTextProcessor.java.patch", + "patches/net/minecraft/src/BlockLockedChest.java.patch", + "patches/org/spoutcraft/client/gui/minimap/ImageManager.java.patch", + "patches/net/minecraft/src/RecipesCrafting.java.patch", + "patches/net/minecraft/src/EntityFishHook.java.patch", + "patches/net/minecraft/src/Packet44UpdateAttributesSnapshot.java.patch", + "patches/net/minecraft/src/DispenserBehaviorFireworks.java.patch", + "patches/org/spoutcraft/api/property/Property.java.patch", + "patches/net/minecraft/src/IntHashMap.java.patch", + "patches/net/minecraft/src/BlockSoulSand.java.patch", + "patches/net/minecraft/src/ModelBlaze.java.patch", + "patches/net/minecraft/src/BlockMushroomCap.java.patch", + "patches/net/minecraft/src/EntityMooshroom.java.patch", + "patches/net/minecraft/src/BlockStem.java.patch", + "patches/net/minecraft/src/ComponentNetherBridgeNetherStalkRoom.java.patch", + "patches/org/spoutcraft/client/gui/minimap/TintType.java.patch", + "patches/net/minecraft/src/EntitySuspendFX.java.patch", + "patches/net/minecraft/src/BlockColored.java.patch", + "patches/org/spoutcraft/api/ChatColor.java.patch", + "patches/net/minecraft/src/GenLayerBiome.java.patch", + "patches/net/minecraft/src/EntityMinecart.java.patch", + "patches/net/minecraft/src/ContainerFurnace.java.patch", + "patches/net/minecraft/src/PlayerCapabilities.java.patch", + "patches/net/minecraft/src/MaterialWeb.java.patch", + "patches/org/spoutcraft/client/io/CustomTextureManager.java.patch", + "patches/net/minecraft/src/BlockMushroom.java.patch", + "patches/net/minecraft/src/ModelBook.java.patch", + "patches/org/spoutcraft/client/gui/settings/controls/SensitivitySlider.java.patch", + "patches/net/minecraft/src/BlockCactus.java.patch", + "patches/org/spoutcraft/client/entity/EntityData.java.patch", + "patches/net/minecraft/src/AnimationFrame.java.patch", + "patches/net/minecraft/src/BlockAnvil.java.patch", + "patches/net/minecraft/src/BlockCrops.java.patch", + "patches/net/minecraft/src/ActiveRenderInfo.java.patch", + "patches/net/minecraft/src/CallableMemoryInfo.java.patch", + "patches/net/minecraft/src/GuiBeaconButton.java.patch", + "patches/org/spoutcraft/client/io/FileUtil.java.patch", + "patches/net/minecraft/src/MerchantRecipeList.java.patch", + "patches/net/minecraft/src/ModelBase.java.patch", + "patches/org/spoutcraft/api/entity/EntitySkinType.java.patch", + "patches/net/minecraft/src/ColorizerGrass.java.patch", + "patches/net/minecraft/src/BlockGlass.java.patch", + "patches/net/minecraft/src/EnumDoorHelper.java.patch", + "patches/net/minecraft/src/RenderList.java.patch", + "patches/net/minecraft/src/EntityAISwimming.java.patch", + "patches/net/minecraft/src/EntityPortalFX.java.patch", + "patches/net/minecraft/src/I18n.java.patch", + "patches/org/spoutcraft/api/gui/Bitmap.java.patch", + "patches/net/minecraft/src/GuiSlotStatsBlock.java.patch", + "patches/net/minecraft/src/Packet209SetPlayerTeam.java.patch", + "patches/net/minecraft/src/GuiScreenOnlineServers.java.patch", + "patches/net/minecraft/src/DestroyBlockProgress.java.patch", + "patches/net/minecraft/src/GuiIngameMenu.java.patch", + "patches/net/minecraft/src/WorldGenBigMushroom.java.patch", + "patches/net/minecraft/src/ThreadConnectToServer.java.patch", + "patches/net/minecraft/src/BiomeGenBeach.java.patch", + "patches/org/spoutcraft/client/packet/PacketComboBox.java.patch", + "patches/net/minecraft/src/EntityReddustFX.java.patch", + "patches/org/spoutcraft/api/material/item/GenericItem.java.patch", + "patches/net/minecraft/src/IconFlipped.java.patch", + "patches/net/minecraft/src/ModelBat.java.patch", + "patches/net/minecraft/src/DispenserBehaviorFireball.java.patch", + "patches/net/minecraft/src/BiomeGenSnow.java.patch", + "patches/net/minecraft/src/ScreenChatOptions.java.patch", + "patches/net/minecraft/src/EntityLargeExplodeFX.java.patch", + "patches/net/minecraft/src/GuiSlider.java.patch", + "patches/net/minecraft/src/StatsSyncher.java.patch", + "patches/net/minecraft/src/StatTypeFloat.java.patch", + "patches/net/minecraft/src/LogFormatter.java.patch", + "patches/org/spoutcraft/client/gui/SimpleKeyManager.java.patch", + "patches/org/spoutcraft/client/gui/settings/controls/DifficultyButton.java.patch", + "patches/net/minecraft/src/NetLoginHandler.java.patch", + "patches/com/prupe/mcpatcher/WeightedIndex.java.patch", + "patches/net/minecraft/src/IPlayerFileData.java.patch", + "patches/net/minecraft/src/RecipesFood.java.patch", + "patches/net/minecraft/src/BlockLeavesBase.java.patch", + "patches/net/minecraft/src/RenderBoat.java.patch", + "patches/org/spoutcraft/api/gui/GenericScreen.java.patch", + "patches/net/minecraft/src/CommandServerPublishLocal.java.patch", + "patches/org/spoutcraft/client/gui/settings/controls/DisplayAnimalHeatinColorButton.java.patch", + "patches/net/minecraft/src/NBTTagList.java.patch", + "patches/net/minecraft/src/EnchantmentUntouching.java.patch", + "patches/net/minecraft/src/DedicatedServer.java.patch", + "patches/net/minecraft/src/KeyBinding.java.patch", + "patches/net/minecraft/src/ModelDragon.java.patch", + "patches/net/minecraft/src/CallableBlockLocation.java.patch", + "patches/com/prupe/mcpatcher/ctm/TileOverrideImpl$Repeat.java.patch", + "patches/net/minecraft/src/GuiInventory.java.patch", + "patches/net/minecraft/src/ISaveHandler.java.patch", + "patches/net/minecraft/src/GenLayerRiverMix.java.patch", + "patches/net/minecraft/src/ServerAddress.java.patch", + "patches/net/minecraft/src/CommandEnchant.java.patch", + "patches/net/minecraft/src/WatchableObject.java.patch", + "patches/net/minecraft/src/WorldGenDungeons.java.patch", + "patches/org/spoutcraft/api/material/item/GenericCustomTool.java.patch", + "patches/net/minecraft/src/GuiMainMenu.java.patch", + "patches/org/spoutcraft/client/gui/settings/GuiSimpleOptions.java.patch", + "patches/net/minecraft/src/ChunkCache.java.patch", + "patches/org/spoutcraft/client/gui/SafeButton.java.patch", + "patches/net/minecraft/src/ScoreHealthCriteria.java.patch", + "patches/org/spoutcraft/client/gui/minimap/BackgroundCheckBox.java.patch", + "patches/net/minecraft/src/ThreadDownloadImageDataINNER1.java.patch", + "patches/org/spoutcraft/client/precache/PrecacheManager.java.patch", + "patches/net/minecraft/src/CommandDebug.java.patch", + "patches/net/minecraft/src/GuiSlotStats.java.patch", + "patches/net/minecraft/src/SimpleReloadableResourceManagerINNER1.java.patch", + "patches/org/spoutcraft/client/gui/server/GuiAddFavorite.java.patch", + "patches/org/spoutcraft/client/gui/settings/controls/FancyGrassButton.java.patch", + "patches/net/minecraft/src/Packet54PlayNoteBlock.java.patch", + "patches/net/minecraft/src/EntitySpellParticleFX.java.patch", + "patches/net/minecraft/src/ScaledResolution.java.patch", + "patches/net/minecraft/src/SpiderEffectsGroupData.java.patch", + "patches/net/minecraft/src/EntityFootStepFX.java.patch", + "patches/net/minecraft/src/EntityAIMate.java.patch", + "patches/net/minecraft/src/Packet10Flying.java.patch", + "patches/org/spoutcraft/client/gui/MinecraftFontWrapper.java.patch", + "patches/net/minecraft/src/BlockRedstoneLogic.java.patch", + "patches/org/spoutcraft/client/gui/settings/controls/DelayedTooltipCheckbox.java.patch", + "patches/net/minecraft/src/ItemExpBottle.java.patch", + "patches/org/spoutcraft/client/gui/server/GuiServerList.java.patch", + "patches/com/prupe/mcpatcher/hd/BorderedTexture.java.patch", + "patches/net/minecraft/src/EntityAIRunAroundLikeCrazy.java.patch", + "patches/net/minecraft/src/IPlayerUsage.java.patch", + "patches/net/minecraft/src/Packet26EntityExpOrb.java.patch", + "patches/net/minecraft/src/RConThreadMain.java.patch", + "patches/com/prupe/mcpatcher/TileLoader.java.patch", + "patches/net/minecraft/src/MathHelper.java.patch", + "patches/net/minecraft/src/IEnchantmentModifier.java.patch", + "patches/net/minecraft/src/ComparatorClassSorter.java.patch", + "patches/net/minecraft/src/EntityFireworkStarterFX.java.patch", + "patches/org/spoutcraft/client/gui/GuiTextDialog.java.patch", + "patches/org/spoutcraft/client/packet/PacketFocusUpdate.java.patch", + "patches/org/spoutcraft/client/precache/PrecacheTuple.java.patch", + "patches/org/spoutcraft/client/config/MipMapUtils.java.patch", + "patches/net/minecraft/src/EntityCow.java.patch", + "patches/net/minecraft/src/BlockComparator.java.patch", + "patches/com/prupe/mcpatcher/mob/LineRenderer.java.patch", + "patches/net/minecraft/src/EntityCreeper.java.patch", + "patches/net/minecraft/src/EntityMob.java.patch", + "patches/net/minecraft/src/BlockFlower.java.patch", + "patches/net/minecraft/src/Packet104WindowItems.java.patch", + "patches/net/minecraft/src/CallableBlockDataValue.java.patch", + "patches/net/minecraft/src/CallableMinecraftVersion.java.patch", + "patches/net/minecraft/src/ScoreObjectiveCriteria.java.patch", + "patches/net/minecraft/src/ScheduledSound.java.patch", + "patches/net/minecraft/src/ComponentStrongholdCrossing.java.patch", + "patches/net/minecraft/src/InventoryEnderChest.java.patch", + "patches/net/minecraft/src/Achievement.java.patch", + "patches/com/prupe/mcpatcher/mob/MobRuleList$MobRuleEntry.java.patch", + "patches/net/minecraft/src/BlockCocoa.java.patch", + "patches/net/minecraft/src/NBTTagFloat.java.patch", + "patches/net/minecraft/src/CallableIsModded.java.patch", + "patches/net/minecraft/src/Packet14BlockDig.java.patch", + "patches/net/minecraft/src/CallableEntityName.java.patch", + "patches/net/minecraft/src/CallableMPL2.java.patch", + "patches/org/spoutcraft/client/gui/minimap/GuiMoveMinimap.java.patch", + "patches/org/spoutcraft/client/gui/settings/controls/StarsToggleButton.java.patch", + "patches/net/minecraft/src/EntityAIArrowAttack.java.patch", + "patches/net/minecraft/src/CallableType3.java.patch", + "patches/org/spoutcraft/client/gui/server/SpoutServerData.java.patch", + "patches/net/minecraft/src/BlockDirt.java.patch", + "patches/org/spoutcraft/client/entity/CraftHumanEntity.java.patch", + "patches/net/minecraft/src/GenLayerSwampRivers.java.patch", + "patches/net/minecraft/src/TextureManagerINNER1.java.patch", + "patches/net/minecraft/src/BlockPortal.java.patch", + "patches/net/minecraft/src/EntityOcelot.java.patch", + "patches/net/minecraft/src/ComponentStrongholdLeftTurn.java.patch", + "patches/org/spoutcraft/api/material/item/GenericWeapon.java.patch", + "patches/net/minecraft/src/EntityAITarget.java.patch", + "patches/net/minecraft/src/RenderCreeper.java.patch", + "patches/org/spoutcraft/client/gui/FilterItem.java.patch", + "patches/net/minecraft/src/TileEntityFurnace.java.patch", + "patches/org/spoutcraft/client/gui/server/PollResult.java.patch", + "patches/net/minecraft/src/StructureNetherBridgeStart.java.patch", + "patches/net/minecraft/src/TileEntityRecordPlayer.java.patch", + "patches/net/minecraft/src/TileEntityRendererPiston.java.patch", + "patches/net/minecraft/src/ItemFishingRod.java.patch", + "patches/net/minecraft/src/BiomeGenForest.java.patch", + "patches/com/prupe/mcpatcher/MCLogger$1.java.patch", + "patches/org/spoutcraft/client/gui/settings/controls/FancyTreesButton.java.patch", + "patches/net/minecraft/src/SlotBrewingStandIngredient.java.patch", + "patches/net/minecraft/src/EntityPigZombie.java.patch", + "patches/net/minecraft/src/ItemWritableBook.java.patch", + "patches/org/spoutcraft/client/packet/PacketAlert.java.patch", + "patches/net/minecraft/src/ComponentNetherBridgeStraight.java.patch", + "patches/net/minecraft/src/GuiScreenInvite.java.patch", + "patches/net/minecraft/src/EntityCaveSpider.java.patch", + "patches/net/minecraft/src/GenLayerRiver.java.patch", + "patches/org/spoutcraft/client/gui/minimap/WatchedEntity.java.patch", + "patches/net/minecraft/src/ThreadMinecraftServer.java.patch", + "patches/net/minecraft/src/WorldGenSpikes.java.patch", + "patches/net/minecraft/src/EntityMinecartMobSpawnerLogic.java.patch", + "patches/net/minecraft/src/CallableItemName.java.patch", + "patches/net/minecraft/src/Enchantment.java.patch", + "patches/net/minecraft/src/GuiScreenConfigureWorld.java.patch", + "patches/com/prupe/mcpatcher/mob/MobRandomizer$1.java.patch", + "patches/org/spoutcraft/client/gui/minimap/DirectionsToggleCheckBox.java.patch", + "patches/net/minecraft/src/EntityEnchantmentTableParticleFX.java.patch", + "patches/org/spoutcraft/client/gui/settings/controls/MipMapSlider.java.patch", + "patches/org/spoutcraft/client/entity/EntityTexture.java.patch", + "patches/net/minecraft/src/PropertyManager.java.patch", + "patches/net/minecraft/src/TaskResetWorld.java.patch", + "patches/net/minecraft/src/TextureMetadataSection.java.patch", + "patches/net/minecraft/src/ClippingHelper.java.patch", + "patches/net/minecraft/src/EntityAIMoveTowardsTarget.java.patch", + "patches/net/minecraft/src/Packet202PlayerAbilities.java.patch", + "patches/net/minecraft/src/ItemSeedFood.java.patch", + "patches/net/minecraft/src/MapGenNetherBridge.java.patch", + "patches/net/minecraft/src/Packet42RemoveEntityEffect.java.patch", + "patches/com/prupe/mcpatcher/ctm/TileOverrideImpl$BetterGrass.java.patch", + "patches/net/minecraft/src/StatTypeDistance.java.patch", + "patches/net/minecraft/src/CreativeTabInventory.java.patch", + "patches/net/minecraft/src/MovementInput.java.patch", + "patches/net/minecraft/src/SoundManagerINNER1.java.patch", + "patches/net/minecraft/src/RegionFile.java.patch", + "patches/net/minecraft/src/EnumEntitySize.java.patch", + "patches/net/minecraft/src/EntityBoat.java.patch", + "patches/net/minecraft/src/ThreadConnectToOnlineServer.java.patch", + "patches/net/minecraft/src/GenLayerHills.java.patch", + "patches/org/spoutcraft/api/material/block/Wool.java.patch", + "patches/net/minecraft/src/RenderXPOrb.java.patch", + "patches/org/spoutcraft/api/gui/GenericScrollable.java.patch", + "patches/net/minecraft/src/CallableLevelGenerator.java.patch", + "patches/org/spoutcraft/client/gui/MinecraftTessellatorWrapper.java.patch", + "patches/net/minecraft/src/EntityList.java.patch", + "patches/net/minecraft/src/EntityMinecartHopper.java.patch", + "patches/net/minecraft/src/IProgressUpdate.java.patch", + "patches/net/minecraft/src/RecipeSorter.java.patch", + "patches/org/spoutcraft/api/gui/GenericScrollArea.java.patch", + "patches/net/minecraft/src/BlockFence.java.patch", + "patches/net/minecraft/src/ItemBook.java.patch", + "patches/org/spoutcraft/client/gui/settings/controls/ClearWaterToggleButton.java.patch", + "patches/net/minecraft/src/FileResourcePack.java.patch", + "patches/net/minecraft/src/Explosion.java.patch", + "patches/net/minecraft/src/ChunkProviderEnd.java.patch", + "patches/com/prupe/mcpatcher/sky/FireworksHelper.java.patch", + "patches/org/spoutcraft/api/material/Material.java.patch", + "patches/net/minecraft/src/NoiseGeneratorOctaves.java.patch", + "patches/org/spoutcraft/api/gui/ChatBar.java.patch", + "patches/com/prupe/mcpatcher/sky/SkyRenderer$WorldEntry.java.patch", + "patches/net/minecraft/src/BlockDropper.java.patch", + "patches/net/minecraft/src/MapCoord.java.patch", + "patches/net/minecraft/src/BiomeGenJungle.java.patch", + "patches/org/spoutcraft/client/inventory/SimpleShapedRecipe.java.patch", + "patches/net/minecraft/src/EntityFX.java.patch", + "patches/net/minecraft/src/BlockBreakable.java.patch", + "patches/net/minecraft/src/CommandDifficulty.java.patch", + "patches/com/prupe/mcpatcher/hd/MipmapHelper.java.patch", + "patches/org/spoutcraft/api/Spoutcraft.java.patch", + "patches/net/minecraft/src/ItemSoup.java.patch", + "patches/net/minecraft/src/RenderFireball.java.patch", + "patches/net/minecraft/src/BlockPistonBase.java.patch", + "patches/net/minecraft/src/ComponentNetherBridgeCorridor5.java.patch", + "patches/net/minecraft/src/WorldGenTaiga2.java.patch", + "patches/net/minecraft/src/GuiScreenConfirmationType.java.patch", + "patches/net/minecraft/src/MaterialLiquid.java.patch", + "patches/net/minecraft/src/EntityOtherPlayerMP.java.patch", + "patches/net/minecraft/src/OpenGlHelper.java.patch", + "patches/net/minecraft/src/EntitySnowman.java.patch", + "patches/net/minecraft/src/Path.java.patch", + "patches/net/minecraft/src/EntityRainFX.java.patch", + "patches/net/minecraft/src/EntityAIDefendVillage.java.patch", + "patches/net/minecraft/src/EntityBubbleFX.java.patch", + "patches/net/minecraft/src/TileEntityHopper.java.patch", + "patches/org/spoutcraft/client/gui/settings/controls/LanguagesButton.java.patch", + "patches/org/spoutcraft/client/packet/PacketRequestPrecache.java.patch", + "patches/net/minecraft/src/ComponentStrongholdStairs2.java.patch", + "patches/net/minecraft/src/BlockSourceImpl.java.patch", + "patches/net/minecraft/src/GuiButton.java.patch", + "patches/org/spoutcraft/api/gui/Widget.java.patch", + "patches/net/minecraft/src/Packet6SpawnPosition.java.patch", + "patches/com/prupe/mcpatcher/TexturePackAPI$1.java.patch", + "patches/org/spoutcraft/client/packet/PacketType.java.patch", + "patches/org/spoutcraft/api/gui/RenderDelegate.java.patch", + "patches/net/minecraft/src/EntityAISit.java.patch", + "patches/org/spoutcraft/client/packet/PacketCustomMultiBlockOverride.java.patch", + "patches/net/minecraft/src/DedicatedServerCommandThread.java.patch", + "patches/net/minecraft/src/ImageBufferDownload.java.patch", + "patches/net/minecraft/src/WorldSavedData.java.patch", + "patches/net/minecraft/src/BlockLilyPad.java.patch", + "patches/net/minecraft/src/StructureStrongholdPieceWeight2.java.patch", + "patches/net/minecraft/src/DispenserBehaviorBoat.java.patch", + "patches/net/minecraft/src/EnumToolMaterial.java.patch", + "patches/net/minecraft/src/BehaviorDispenseMinecart.java.patch", + "patches/net/minecraft/src/WorldChunkManager.java.patch", + "patches/net/minecraft/src/AnimalChest.java.patch", + "patches/net/minecraft/src/CallableIsFeatureChunk.java.patch", + "patches/org/spoutcraft/client/packet/PacketWidget.java.patch", + "patches/net/minecraft/src/ModelPig.java.patch", + "patches/net/minecraft/src/GuiOptions.java.patch", + "patches/org/spoutcraft/client/gui/minimap/SquareToggleCheckBox.java.patch", + "patches/net/minecraft/src/EntityPlayerSP.java.patch", + "patches/net/minecraft/src/GuiAchievement.java.patch", + "patches/net/minecraft/src/Minecraft.java.patch", + "patches/net/minecraft/src/LowerStringMap.java.patch", + "patches/org/spoutcraft/client/gui/server/GuiStaticServerList.java.patch", + "patches/net/minecraft/src/EntityAIFollowGolem.java.patch", + "patches/net/minecraft/src/TileEntityComparator.java.patch", + "patches/net/minecraft/src/BlockSand.java.patch", + "patches/org/spoutcraft/client/player/SimpleBiomeManager.java.patch", + "patches/net/minecraft/src/TextureClock.java.patch", + "patches/net/minecraft/src/SlotBeacon.java.patch", + "patches/com/prupe/mcpatcher/MCLogger$1$1.java.patch", + "patches/net/minecraft/src/ComponentVillageHouse2.java.patch", + "patches/net/minecraft/src/DispenserBehaviorArrow.java.patch", + "patches/net/minecraft/src/RenderOcelot.java.patch", + "patches/org/spoutcraft/api/animation/LinearAnimationProgress.java.patch", + "patches/net/minecraft/src/Packet11PlayerPosition.java.patch", + "patches/org/spoutcraft/api/player/SkyManager.java.patch", + "patches/net/minecraft/src/EntityAITaskEntry.java.patch", + "patches/net/minecraft/src/CombatEntry.java.patch", + "patches/net/minecraft/src/IChunkLoader.java.patch", + "patches/net/minecraft/src/GuiScreenPendingInvitationINNER3.java.patch", + "patches/net/minecraft/src/BlockFluid.java.patch", + "patches/net/minecraft/src/GenLayerIsland.java.patch", + "patches/net/minecraft/src/ComponentVillageField2.java.patch", + "patches/org/spoutcraft/api/gui/ItemWidget.java.patch", + "patches/net/minecraft/src/BlockRedstoneRepeater.java.patch", + "patches/net/minecraft/src/WorldGenHellLava.java.patch", + "patches/org/spoutcraft/api/material/Armor.java.patch", + "patches/net/minecraft/src/Score.java.patch", + "patches/org/spoutcraft/client/gui/minimap/MinimapUtils.java.patch", + "patches/org/spoutcraft/api/gui/RadioButton.java.patch", + "patches/net/minecraft/src/SpawnListEntry.java.patch", + "patches/org/spoutcraft/api/gui/Slot.java.patch", + "patches/org/spoutcraft/api/material/block/Tree.java.patch", + "patches/org/spoutcraft/api/animation/ExponentialAnimationProgress.java.patch", + "patches/net/minecraft/src/RConConsoleSource.java.patch", + "patches/org/spoutcraft/client/gui/minimap/MinimapToggleCheckBox.java.patch", + "patches/org/spoutcraft/client/gui/settings/controls/ViewBobbingButton.java.patch", + "patches/net/minecraft/src/SimpleReloadableResourceManager.java.patch", + "patches/org/spoutcraft/client/gui/minimap/ScanRadiusSlider.java.patch", + "patches/net/minecraft/src/InventoryCrafting.java.patch", + "patches/org/spoutcraft/api/SPOnly.java.patch", + "patches/org/spoutcraft/client/chunkcache/HeightMapAgent.java.patch", + "patches/net/minecraft/src/WorldGenMinable.java.patch", + "patches/net/minecraft/src/IRegistry.java.patch", + "patches/net/minecraft/src/ExceptionMcoService.java.patch", + "patches/org/spoutcraft/client/gui/settings/controls/AmbientOcclusionButton.java.patch", + "patches/net/minecraft/src/BlockRailPowered.java.patch", + "patches/net/minecraft/src/EntityAIOpenDoor.java.patch", + "patches/net/minecraft/src/ChestItemRenderHelper.java.patch", + "patches/net/minecraft/src/ComponentScatteredFeatureJunglePyramid.java.patch", + "patches/net/minecraft/src/ItemStack.java.patch", + "patches/com/prupe/mcpatcher/cc/Colorizer.java.patch", + "patches/org/spoutcraft/client/packet/PacketScreenshot.java.patch", + "patches/net/minecraft/src/EntitySquid.java.patch", + "patches/net/minecraft/src/SlotCreativeInventory.java.patch", + "patches/net/minecraft/src/ScorePlayerTeam.java.patch", + "patches/net/minecraft/src/EntityChicken.java.patch", + "patches/org/spoutcraft/api/gui/PopupScreen.java.patch", + "patches/net/minecraft/src/EntityAIAvoidEntitySelector.java.patch", + "patches/org/spoutcraft/client/SpoutcraftWorld.java.patch", + "patches/net/minecraft/src/BlockRedstoneLight.java.patch", + "patches/net/minecraft/src/IInventory.java.patch", + "patches/net/minecraft/src/ExtendedBlockStorage.java.patch", + "patches/com/prupe/mcpatcher/hd/CustomAnimation.java.patch", + "patches/net/minecraft/src/BlockSponge.java.patch", + "patches/net/minecraft/src/GuiShareToLan.java.patch", + "patches/net/minecraft/src/NBTTagByteArray.java.patch", + "patches/net/minecraft/src/EntityLookHelper.java.patch", + "patches/net/minecraft/src/GuiScreenAddServer.java.patch", + "patches/net/minecraft/src/SpawnerAnimals.java.patch", + "patches/net/minecraft/src/EnchantmentWaterWorker.java.patch", + "patches/net/minecraft/src/ModelZombie.java.patch", + "patches/net/minecraft/src/CallableServerProfiler.java.patch", + "patches/net/minecraft/src/BiomeGenOcean.java.patch", + "patches/org/spoutcraft/client/gui/error/GuiConnectionLost.java.patch", + "patches/net/minecraft/src/ComponentNetherBridgeCorridor3.java.patch", + "patches/net/minecraft/src/ItemSlab.java.patch", + "patches/net/minecraft/src/BlockBed.java.patch", + "patches/net/minecraft/src/EntityMinecartChest.java.patch", + "patches/net/minecraft/src/StringTranslate.java.patch", + "patches/org/spoutcraft/api/material/CustomItem.java.patch", + "patches/com/prupe/mcpatcher/mob/MobOverlay.java.patch", + "patches/net/minecraft/src/IntegratedServer.java.patch", + "patches/net/minecraft/src/CallableLevelGamemode.java.patch", + "patches/org/spoutcraft/api/NotImplemented.java.patch", + "patches/net/minecraft/src/EntityMinecartTNT.java.patch", + "patches/net/minecraft/src/Packet250CustomPayload.java.patch", + "patches/org/spoutcraft/client/gui/about/ImageSection.java.patch", + "patches/net/minecraft/src/GuiContainerCreative.java.patch", + "patches/net/minecraft/src/GuiScreenMcoWorldTemplate.java.patch", + "patches/net/minecraft/src/EntityClientPlayerMP.java.patch", + "patches/net/minecraft/src/EntityAINearestAttackableTarget.java.patch", + "patches/net/minecraft/src/ItemBlockWithMetadata.java.patch", + "patches/net/minecraft/src/StructureMineshaftPieces.java.patch", + "patches/net/minecraft/src/StatPlaceholder.java.patch", + "patches/org/spoutcraft/client/packet/PacketPreCacheFile.java.patch", + "patches/net/minecraft/src/TcpMonitorThread.java.patch", + "patches/net/minecraft/src/CallableLvl2.java.patch", + "patches/net/minecraft/src/NetHandler.java.patch", + "patches/net/minecraft/src/GuiScreenServerList.java.patch", + "patches/net/minecraft/src/IAdminCommand.java.patch", + "patches/net/minecraft/src/MapGenCavesHell.java.patch", + "patches/org/spoutcraft/client/gui/settings/controls/Anaglyph3DButton.java.patch", + "patches/org/spoutcraft/client/gui/server/StaticServerModel.java.patch", + "patches/org/spoutcraft/client/packet/PacketSky.java.patch", + "patches/net/minecraft/src/IStatStringFormat.java.patch", + "patches/net/minecraft/src/SoundPoolProtocolHandler.java.patch", + "patches/org/spoutcraft/client/packet/PacketEntityTitle.java.patch", + "patches/org/spoutcraft/api/UnsafeClass.java.patch", + "patches/net/minecraft/src/ReportedException.java.patch", + "patches/net/minecraft/src/RequestDelete.java.patch", + "patches/org/spoutcraft/client/gui/settings/controls/GuiScaleButton.java.patch", + "patches/net/minecraft/src/PlayerInstance.java.patch", + "patches/net/minecraft/src/Packet133TileEditorOpen.java.patch", + "patches/org/spoutcraft/client/gui/settings/controls/DisplayEntityNamesinRangeButton.java.patch", + "patches/net/minecraft/src/BlockObsidian.java.patch", + "patches/net/minecraft/src/IProjectile.java.patch", + "patches/org/spoutcraft/client/chunkcache/HeightMap.java.patch", + "patches/net/minecraft/src/ItemAxe.java.patch", + "patches/net/minecraft/src/EnchantmentHelper.java.patch", + "patches/org/spoutcraft/client/inventory/CraftInventoryPlayer.java.patch", + "patches/net/minecraft/src/BehaviorDefaultDispenseItem.java.patch", + "patches/net/minecraft/src/RConThreadQueryAuth.java.patch", + "patches/net/minecraft/src/NBTTagDouble.java.patch", + "patches/net/minecraft/src/InventoryEffectRenderer.java.patch", + "patches/net/minecraft/src/FoodStats.java.patch", + "patches/net/minecraft/src/AttributeModifier.java.patch", + "patches/org/spoutcraft/api/UnsafeConstructor.java.patch", + "patches/net/minecraft/src/GuiScreenLongRunningTask.java.patch", + "patches/net/minecraft/src/Village.java.patch", + "patches/org/spoutcraft/client/packet/PacketStopMusic.java.patch", + "patches/org/spoutcraft/client/gui/server/ServerTab.java.patch", + "patches/net/minecraft/src/ChatLine.java.patch", + "patches/net/minecraft/src/EnchantmentModifierDamage.java.patch", + "patches/net/minecraft/src/SorterStatsBlock.java.patch", + "patches/net/minecraft/src/ItemShears.java.patch", + "patches/net/minecraft/src/BlockCommandBlock.java.patch", + "patches/net/minecraft/src/BiomeDecorator.java.patch", + "patches/org/spoutcraft/api/gui/ChatTextBox.java.patch", + "patches/org/bukkit/util/config/Configuration.java.patch", + "patches/net/minecraft/src/GuiScreenConfirmation.java.patch", + "patches/net/minecraft/src/RenderSilverfish.java.patch", + "patches/net/minecraft/src/Block.java.patch", + "patches/org/spoutcraft/api/Note.java.patch", + "patches/net/minecraft/src/ComponentStronghold.java.patch", + "patches/com/prupe/mcpatcher/ctm/ITileOverride.java.patch", + "patches/net/minecraft/src/EnumEntitySizeHelper.java.patch", + "patches/org/spoutcraft/api/util/map/TIntPairFloatHashMap.java.patch", + "patches/com/prupe/mcpatcher/ctm/CTMUtils.java.patch", + "patches/org/spoutcraft/client/chunkcache/HeightMapSaveThread.java.patch", + "patches/com/prupe/mcpatcher/cc/BiomeHelper.java.patch", + "patches/org/spoutcraft/client/SpoutClient.java.patch", + "patches/net/minecraft/src/PlayerUsageSnooper.java.patch", + "patches/net/minecraft/src/ModelWither.java.patch", + "patches/net/minecraft/src/RenderEnderCrystal.java.patch", + "patches/com/prupe/mcpatcher/InputHandler.java.patch", + "patches/org/spoutcraft/client/packet/PacketGenericItem.java.patch", + "patches/org/spoutcraft/client/packet/PacketSetVelocity.java.patch", + "patches/net/minecraft/src/GuiFlatPresets.java.patch", + "patches/net/minecraft/src/NpcMerchant.java.patch", + "patches/org/spoutcraft/client/packet/PacketDownloadMusic.java.patch", + "patches/org/spoutcraft/client/entity/RenderTexture.java.patch", + "patches/net/minecraft/src/MapGenCaves.java.patch", + "patches/org/spoutcraft/client/gui/error/PasteBinAPI.java.patch", + "patches/net/minecraft/src/MobSpawnerBaseLogic.java.patch", + "patches/org/spoutcraft/api/keyboard/KeyBinding.java.patch", + "patches/net/minecraft/src/ComponentVillage.java.patch", + "patches/org/spoutcraft/client/gui/settings/controls/MinimapButton.java.patch", + "patches/org/spoutcraft/client/packet/PacketRenderDistance.java.patch", + "patches/net/minecraft/src/Packet105UpdateProgressbar.java.patch", + "patches/net/minecraft/src/Packet102WindowClick.java.patch", + "patches/org/spoutcraft/client/gui/LinkButton.java.patch", + "patches/org/spoutcraft/client/gui/settings/controls/ReplaceToolsButton.java.patch", + "patches/net/minecraft/src/EntityFireball.java.patch", + "patches/net/minecraft/src/DispenserBehaviorDye.java.patch", + "patches/net/minecraft/src/EntitySenses.java.patch", + "patches/net/minecraft/src/CompressedStreamTools.java.patch", + "patches/net/minecraft/src/RegionFileCache.java.patch", + "patches/net/minecraft/src/NBTTagByte.java.patch", + "patches/net/minecraft/src/Packet27PlayerInput.java.patch", + "patches/net/minecraft/src/VillageSiege.java.patch", + "patches/net/minecraft/src/GuiSelectWorld.java.patch", + "patches/net/minecraft/src/ContainerRepairINNER2.java.patch", + "patches/org/spoutcraft/client/gui/minimap/GuiMinimapMenu.java.patch", + "patches/net/minecraft/src/Packet15Place.java.patch", + "patches/org/spoutcraft/api/material/block/StoneBricks.java.patch", + "patches/net/minecraft/src/BehaviorDispenseItemProvider.java.patch", + "patches/org/spoutcraft/client/packet/PacketEntitySkin.java.patch", + "patches/net/minecraft/src/Tessellator.java.patch", + "patches/net/minecraft/src/McoClient.java.patch", + "patches/com/prupe/mcpatcher/cc/Colorizer$1.java.patch", + "patches/net/minecraft/src/ChatMessageComponent.java.patch", + "patches/net/minecraft/src/EntitySlime.java.patch", + "patches/net/minecraft/src/TileEntityChest.java.patch", + "patches/net/minecraft/src/BlockGrass.java.patch", + "patches/net/minecraft/src/TileEntityChestRenderer.java.patch", + "patches/net/minecraft/src/ICommandSender.java.patch", + "patches/net/minecraft/src/Packet29DestroyEntity.java.patch", + "patches/net/minecraft/src/SoundPool.java.patch", + "patches/net/minecraft/src/RenderFallingSand.java.patch", + "patches/net/minecraft/src/Packet63WorldParticles.java.patch", + "patches/net/minecraft/src/EntityBlaze.java.patch", + "patches/net/minecraft/src/BlockFurnace.java.patch", + "patches/net/minecraft/src/IBossDisplayData.java.patch", + "patches/net/minecraft/src/TileEntityBeacon.java.patch", + "patches/net/minecraft/src/CreativeTabFood.java.patch", + "patches/net/minecraft/src/EntityAIFollowParent.java.patch", + "patches/net/minecraft/src/AnimationMetadataSectionSerializer.java.patch", + "patches/org/spoutcraft/client/gui/settings/controls/MusicSlider.java.patch", + "patches/net/minecraft/src/FolderResourcePack.java.patch", + "patches/net/minecraft/src/EntityPotion.java.patch", + "patches/net/minecraft/src/SlotCrafting.java.patch", + "patches/net/minecraft/src/Packet22Collect.java.patch", + "patches/org/spoutcraft/api/block/design/Texture.java.patch", + "patches/net/minecraft/src/Packet53BlockChange.java.patch", + "patches/org/spoutcraft/client/player/SimpleSkyManager.java.patch", + "patches/net/minecraft/src/BlockRailBase.java.patch", + "patches/net/minecraft/src/RunnableTitleScreen.java.patch", + "patches/net/minecraft/src/Packet51MapChunk.java.patch", + "patches/net/minecraft/src/ColorizerFoliage.java.patch", + "patches/org/spoutcraft/api/gui/RenderPriority.java.patch", + "patches/net/minecraft/src/GuiDispenser.java.patch", + "patches/com/prupe/mcpatcher/TexturePackAPI.java.patch", + "patches/org/spoutcraft/api/UnsafeMethod.java.patch", + "patches/org/spoutcraft/client/gui/settings/controls/ServerTexturesButton.java.patch", + "patches/org/spoutcraft/client/gui/minimap/GuiAddWaypoint.java.patch", + "patches/org/spoutcraft/client/gui/settings/controls/AutomatedButton.java.patch", + "patches/net/minecraft/src/StepSoundAnvil.java.patch", + "patches/org/spoutcraft/api/gui/MinecraftFont.java.patch", + "patches/net/minecraft/src/WorldSettings.java.patch", + "patches/net/minecraft/src/AchievementList.java.patch", + "patches/net/minecraft/src/CallableEntityTracker.java.patch", + "patches/org/spoutcraft/client/player/accessories/Wings.java.patch", + "patches/com/prupe/mcpatcher/JsonUtils.java.patch", + "patches/net/minecraft/src/MapColor.java.patch", + "patches/net/minecraft/src/TileEntitySkull.java.patch", + "patches/org/spoutcraft/client/gui/server/ServerManager.java.patch", + "patches/net/minecraft/src/BlockTripWire.java.patch", + "patches/org/spoutcraft/api/material/item/SpawnEgg.java.patch", + "patches/net/minecraft/src/VillageDoorInfo.java.patch", + "patches/net/minecraft/src/Packet108EnchantItem.java.patch", + "patches/org/spoutcraft/client/gui/about/Section.java.patch", + "patches/net/minecraft/src/DamageSource.java.patch", + "patches/net/minecraft/src/CreativeTabMisc.java.patch", + "patches/net/minecraft/src/PathEntity.java.patch", + "patches/net/minecraft/src/Packet43Experience.java.patch", + "patches/net/minecraft/src/TileEntityNote.java.patch", + "patches/net/minecraft/src/MapGenRavine.java.patch", + "patches/net/minecraft/src/WorldManager.java.patch", + "patches/net/minecraft/src/RenderFish.java.patch", + "patches/org/spoutcraft/api/material/CustomBlock.java.patch", + "patches/net/minecraft/src/BlockBasePressurePlate.java.patch", + "patches/net/minecraft/src/Packet7UseEntity.java.patch", + "patches/net/minecraft/src/BlockDoor.java.patch", + "patches/net/minecraft/src/BlockDirectional.java.patch", + "patches/net/minecraft/src/ThreadDownloadImageData.java.patch", + "patches/net/minecraft/src/Packet38EntityStatus.java.patch", + "patches/org/spoutcraft/api/gui/WidgetAnchor.java.patch", + "patches/net/minecraft/src/BlockVine.java.patch", + "patches/org/spoutcraft/api/gui/WidgetType.java.patch", + "patches/net/minecraft/src/BlockStone.java.patch", + "patches/net/minecraft/src/RenderItem.java.patch", + "patches/net/minecraft/src/MapData.java.patch", + "patches/net/minecraft/src/GuiBeacon.java.patch", + "patches/net/minecraft/src/ResourcePackFileNotFoundException.java.patch", + "patches/net/minecraft/src/CallableLWJGLVersion.java.patch", + "patches/net/minecraft/src/GuiFlatPresetsListSlot.java.patch", + "patches/net/minecraft/src/EntityHorseBredSelector.java.patch", + "patches/net/minecraft/src/EntityGhast.java.patch", + "patches/net/minecraft/src/WorldServerMulti.java.patch", + "patches/net/minecraft/src/GuiStats.java.patch", + "patches/org/spoutcraft/api/util/map/TIntPairObjectHashMap.java.patch", + "patches/net/minecraft/src/StatBase.java.patch", + "patches/net/minecraft/src/ModelSheep1.java.patch", + "patches/net/minecraft/src/CallableIsServerModded.java.patch", + "patches/net/minecraft/src/Packet19EntityAction.java.patch", + "patches/net/minecraft/src/StructureVillagePieces.java.patch", + "patches/net/minecraft/src/WorldClientINNER4.java.patch", + "patches/org/spoutcraft/api/block/design/SubTexture.java.patch", + "patches/net/minecraft/src/StructureStrongholdStones.java.patch", + "patches/net/minecraft/src/Packet132TileEntityData.java.patch", + "patches/net/minecraft/src/DynamicTexture.java.patch", + "patches/org/spoutcraft/client/ReconnectManager.java.patch", + "patches/net/minecraft/src/BlockContainer.java.patch", + "patches/net/minecraft/src/Packet207SetScore.java.patch", + "patches/org/spoutcraft/client/gui/settings/controls/ChunkRenderSpeed.java.patch", + "patches/net/minecraft/src/GuiScreenTemporaryResourcePackSelect.java.patch", + "patches/net/minecraft/src/ItemInWorldManager.java.patch", + "patches/org/spoutcraft/client/gui/settings/controls/BiomeColorsButton.java.patch", + "patches/net/minecraft/src/BlockSilverfish.java.patch", + "patches/net/minecraft/src/EntityWitch.java.patch", + "patches/net/minecraft/src/Packet31RelEntityMove.java.patch", + "patches/net/minecraft/src/GuiScreenPendingInvitationINNER1.java.patch", + "patches/net/minecraft/src/RecipesWeapons.java.patch", + "patches/net/minecraft/src/StructureVillageStart.java.patch", + "patches/net/minecraft/src/ComponentNetherBridgeCrossing.java.patch", + "patches/net/minecraft/src/EntityItem.java.patch", + "patches/org/spoutcraft/client/gui/precache/GuiPrecache.java.patch", + "patches/net/minecraft/src/CreativeTabBlock.java.patch", + "patches/net/minecraft/src/ModelChicken.java.patch", + "patches/net/minecraft/src/EnchantmentDigging.java.patch", + "patches/com/prupe/mcpatcher/ctm/TileOverrideImpl$Horizontal.java.patch", + "patches/net/minecraft/src/NBTTagIntArray.java.patch", + "patches/net/minecraft/src/NBTTagString.java.patch", + "patches/org/spoutcraft/api/sound/Music.java.patch", + "patches/net/minecraft/src/ModelBoat.java.patch", + "patches/net/minecraft/src/ItemFood.java.patch", + "patches/net/minecraft/src/GuiBeaconButtonPower.java.patch", + "patches/net/minecraft/src/ICrafting.java.patch", + "patches/net/minecraft/src/BiomeGenHills.java.patch", + "patches/org/spoutcraft/client/gui/controls/ControlsBasicItem.java.patch", + "patches/net/minecraft/src/RenderBlocks.java.patch", + "patches/net/minecraft/src/GuiMemoryErrorScreen.java.patch", + "patches/com/prupe/mcpatcher/Config$ModEntry.java.patch", + "patches/net/minecraft/src/EntityMagmaCube.java.patch", + "patches/org/spoutcraft/client/packet/PacketAirTime.java.patch", + "patches/net/minecraft/src/ThreadStatSyncherSend.java.patch", + "patches/net/minecraft/src/ItemSign.java.patch", + "patches/org/spoutcraft/client/gui/settings/controls/InvertMouseButton.java.patch", + "patches/net/minecraft/src/CallableParticleScreenName.java.patch", + "patches/net/minecraft/src/BlockPoweredOre.java.patch", + "patches/net/minecraft/src/Packet32EntityLook.java.patch", + "patches/org/spoutcraft/client/player/accessories/Bracelet.java.patch", + "patches/org/spoutcraft/api/sound/SoundEffect.java.patch", + "patches/net/minecraft/src/ModelVillager.java.patch", + "patches/net/minecraft/src/BlockLever.java.patch", + "patches/net/minecraft/src/ModelHorse.java.patch", + "patches/org/spoutcraft/client/packet/PacketKeyPress.java.patch", + "patches/net/minecraft/src/LanServer.java.patch", + "patches/net/minecraft/src/IRecipe.java.patch", + "patches/net/minecraft/src/BlockSapling.java.patch", + "patches/org/spoutcraft/client/packet/PacketWidgetRemove.java.patch", + "patches/org/spoutcraft/api/gui/EntityWidget.java.patch", + "patches/net/minecraft/src/EnchantmentLootBonus.java.patch", + "patches/net/minecraft/src/RenderIronGolem.java.patch", + "patches/org/spoutcraft/api/material/block/GenericLiquid.java.patch", + "patches/org/spoutcraft/client/gui/minimap/ZanMinimap.java.patch", + "patches/net/minecraft/src/LanguageManager.java.patch", + "patches/net/minecraft/src/ContainerRepairINNER1.java.patch", + "patches/org/spoutcraft/api/material/SolidBlock.java.patch", + "patches/net/minecraft/src/GuiSmallButton.java.patch", + "patches/net/minecraft/src/ComponentVillageChurch.java.patch", + "patches/net/minecraft/src/Packet255KickDisconnect.java.patch", + "patches/net/minecraft/src/ContainerSheep.java.patch", + "patches/org/spoutcraft/client/gui/about/GuiAbout.java.patch", + "patches/org/spoutcraft/api/player/ChatMessage.java.patch", + "patches/net/minecraft/src/GuiMultiplayer.java.patch", + "patches/net/minecraft/src/ModelSilverfish.java.patch", + "patches/org/bukkit/util/FileUtil.java.patch", + "patches/org/spoutcraft/api/animation/PropertyAnimation.java.patch", + "patches/net/minecraft/src/RenderSlime.java.patch", + "patches/net/minecraft/src/ThreadOnlineConnect.java.patch", + "patches/net/minecraft/src/MouseHelper.java.patch", + "patches/net/minecraft/src/GuiScreenBackupRestoreTask.java.patch", + "patches/org/spoutcraft/client/gui/settings/controls/VoidFogButton.java.patch", + "patches/net/minecraft/src/MetadataSerializer.java.patch", + "patches/org/spoutcraft/api/gui/OverlayScreen.java.patch", + "patches/org/spoutcraft/api/material/Item.java.patch", + "patches/org/spoutcraft/api/keyboard/KeyBindingPress.java.patch", + "patches/net/minecraft/src/EntityTameable.java.patch", + "patches/net/minecraft/src/BlockBrewingStand.java.patch", + "patches/net/minecraft/src/EntityCreature.java.patch", + "patches/org/spoutcraft/client/gui/settings/controls/TexturesButton.java.patch", + "patches/net/minecraft/src/EntityAIEatGrass.java.patch", + "patches/net/minecraft/src/RenderLightningBolt.java.patch", + "patches/net/minecraft/src/BlockTrapDoor.java.patch", + "patches/net/minecraft/src/GuiScreenHorseInventory.java.patch", + "patches/net/minecraft/src/ComponentNetherBridgeThrone.java.patch", + "patches/net/minecraft/src/StructureMineshaftStart.java.patch", + "patches/net/minecraft/src/CommandServerList.java.patch", + "patches/net/minecraft/src/Potion.java.patch", + "patches/net/minecraft/src/BlockRedstoneOre.java.patch", + "patches/net/minecraft/src/EntityHugeExplodeFX.java.patch", + "patches/net/minecraft/src/Frustrum.java.patch", + "patches/net/minecraft/src/StatBasic.java.patch", + "patches/net/minecraft/src/RecipesDyes.java.patch", + "patches/net/minecraft/src/EntityAnimal.java.patch", + "patches/net/minecraft/src/ServerScoreboard.java.patch", + "patches/org/spoutcraft/client/gui/settings/controls/FancyWaterButton.java.patch", + "patches/net/minecraft/src/MapGenStructureIO.java.patch", + "patches/net/minecraft/src/WeightedRandomMinecart.java.patch", + "patches/net/minecraft/src/GuiIngame.java.patch", + "patches/net/minecraft/src/CallableType.java.patch", + "patches/org/spoutcraft/client/gui/minimap/TextureManager.java.patch", + "patches/net/minecraft/src/ScoreboardSaveData.java.patch", + "patches/org/spoutcraft/client/io/Download.java.patch", + "patches/net/minecraft/src/EnumCreatureType.java.patch", + "patches/net/minecraft/src/TileEntityEnderChest.java.patch", + "patches/org/spoutcraft/api/Effect.java.patch", + "patches/net/minecraft/src/ShapedRecipes.java.patch", + "patches/org/spoutcraft/client/player/accessories/Ears.java.patch", + "patches/net/minecraft/src/IntegratedServerListenThread.java.patch", + "patches/net/minecraft/src/ServerData.java.patch", + "patches/org/spoutcraft/api/packet/PacketUtil.java.patch", + "patches/net/minecraft/src/EntityFallingSand.java.patch", + "patches/net/minecraft/src/ComponentStrongholdPrison.java.patch", + "patches/org/spoutcraft/client/HDImageBufferDownload.java.patch", + "patches/org/spoutcraft/client/controls/GuiAmbigousInput.java.patch", + "patches/net/minecraft/src/EnchantmentData.java.patch", + "patches/net/minecraft/src/EntityCloudFX.java.patch", + "patches/net/minecraft/src/WorldGenCactus.java.patch", + "patches/net/minecraft/src/WorldGenerator.java.patch", + "patches/net/minecraft/src/SimpleResource.java.patch", + "patches/net/minecraft/src/EntityAIControlledByPlayer.java.patch", + "patches/net/minecraft/src/TileEntityBeaconRenderer.java.patch", + "patches/net/minecraft/src/StitchHolder.java.patch", + "patches/net/minecraft/src/StatTypeTime.java.patch", + "patches/net/minecraft/src/CraftingManager.java.patch", + "patches/net/minecraft/src/CrashReportCategoryEntry.java.patch", + "patches/net/minecraft/src/ContainerHorseInventorySlotSaddle.java.patch", + "patches/org/spoutcraft/api/gui/Screen.java.patch", + "patches/org/spoutcraft/client/gui/minimap/MapWidgetRenderer.java.patch", + "patches/net/minecraft/src/CommandServerSaveOn.java.patch", + "patches/org/spoutcraft/client/gui/controls/ShortcutBindingItem.java.patch", + "patches/org/spoutcraft/client/packet/PacketCustomBlockOverride.java.patch", + "patches/org/spoutcraft/client/gui/server/LANModel.java.patch", + "patches/net/minecraft/src/EntitySmallFireball.java.patch", + "patches/net/minecraft/src/TileEntitySpecialRenderer.java.patch", + "patches/net/minecraft/src/BlockMelon.java.patch", + "patches/net/minecraft/src/CallableOSInfo.java.patch", + "patches/net/minecraft/src/ValueObjectSubscription.java.patch", + "patches/net/minecraft/src/MD5String.java.patch", + "patches/org/spoutcraft/client/gui/database/UrlElement.java.patch", + "patches/org/spoutcraft/client/player/accessories/NotchHat.java.patch", + "patches/net/minecraft/src/ComponentStrongholdStraight.java.patch", + "patches/net/minecraft/src/PathFinder.java.patch", + "patches/org/spoutcraft/api/animation/Animatable.java.patch", + "patches/net/minecraft/src/ComponentStrongholdStairs.java.patch", + "patches/net/minecraft/src/BehaviorDispenseArmor.java.patch", + "patches/net/minecraft/src/IInvBasic.java.patch", + "patches/net/minecraft/src/EntityHorse.java.patch", + "patches/net/minecraft/src/IBlockAccess.java.patch", + "patches/net/minecraft/src/StructureComponent.java.patch", + "patches/net/minecraft/src/EnumRarity.java.patch", + "patches/org/spoutcraft/api/gui/Polygon.java.patch", + "patches/net/minecraft/src/EntityAINearestAttackableTargetSelector.java.patch", + "patches/org/spoutcraft/api/gui/GenericRadioButton.java.patch", + "patches/net/minecraft/src/RecipesMapCloning.java.patch", + "patches/net/minecraft/src/BlockDetectorRail.java.patch", + "patches/org/spoutcraft/client/gui/database/SearchField.java.patch", + "patches/net/minecraft/src/EnumGameType.java.patch", + "patches/net/minecraft/src/DefaultResourcePack.java.patch", + "patches/net/minecraft/src/Stitcher.java.patch", + "patches/net/minecraft/src/CallableScreenName.java.patch", + "patches/net/minecraft/src/Direction.java.patch", + "patches/net/minecraft/src/RequestPut.java.patch", + "patches/net/minecraft/src/CommandXP.java.patch", + "patches/com/prupe/mcpatcher/cc/ColorizeEntity.java.patch", + "patches/net/minecraft/src/CallablePacketClass.java.patch", + "patches/net/minecraft/src/PositionImpl.java.patch", + "patches/org/spoutcraft/api/gui/Gradient.java.patch", + "patches/org/spoutcraft/api/gui/HealthBar.java.patch", + "patches/net/minecraft/src/SelectionListBase.java.patch", + "patches/org/spoutcraft/client/gui/inventory/CreativeTabCustom.java.patch", + "patches/net/minecraft/src/BlockChest.java.patch", + "patches/net/minecraft/src/CallableServerType.java.patch", + "patches/com/prupe/mcpatcher/ctm/RenderPass$1.java.patch", + "patches/com/prupe/mcpatcher/MCPatcherUtils.java.patch", + "patches/net/minecraft/src/GuiScreenPendingInvitation.java.patch", + "patches/net/minecraft/src/RecipesMapExtending.java.patch", + "patches/net/minecraft/src/PlayerManager.java.patch", + "patches/net/minecraft/src/BlockMycelium.java.patch", + "patches/net/minecraft/src/IThreadedFileIO.java.patch", + "patches/net/minecraft/src/ChunkCoordIntPair.java.patch", + "patches/net/minecraft/src/BlockOreStorage.java.patch", + "patches/net/minecraft/src/BiomeGenTaiga.java.patch", + "patches/net/minecraft/src/MessageComponentSerializer.java.patch", + "patches/net/minecraft/src/BlockNetherrack.java.patch", + "patches/org/spoutcraft/client/entity/AbstractProjectile.java.patch", + "patches/net/minecraft/src/ItemAnvilBlock.java.patch", + "patches/org/spoutcraft/client/gui/minimap/MinimapModeButton.java.patch", + "patches/org/spoutcraft/api/gui/ScreenType.java.patch", + "patches/org/spoutcraft/api/material/item/Coal.java.patch", + "patches/net/minecraft/src/ServersideAttributeMap.java.patch", + "patches/net/minecraft/src/EntityHorseGroupData.java.patch", + "patches/net/minecraft/src/AnvilSaveConverterFileFilter.java.patch", + "patches/net/minecraft/src/BlockMobSpawner.java.patch", + "patches/net/minecraft/src/GenLayerSmooth.java.patch", + "patches/net/minecraft/src/EntityDiggingFX.java.patch", + "patches/net/minecraft/src/StatCrafting.java.patch", + "patches/net/minecraft/src/SyntaxErrorException.java.patch", + "patches/net/minecraft/src/BaseAttributeMap.java.patch", + "patches/net/minecraft/src/TileEntityMobSpawner.java.patch", + "patches/net/minecraft/src/EnumOptionsHelper.java.patch", + "patches/org/spoutcraft/client/gui/settings/controls/FavorPerformanceButton.java.patch", + "patches/net/minecraft/src/EntityAIHurtByTarget.java.patch", + "patches/net/minecraft/src/AbstractTexture.java.patch", + "patches/net/minecraft/src/ItemRecord.java.patch", + "patches/net/minecraft/src/EntityLightningBolt.java.patch", + "patches/net/minecraft/client/ClientBrandRetriever.java.patch", + "patches/net/minecraft/src/WorldClientINNER3.java.patch", + "patches/net/minecraft/src/CreativeTabTools.java.patch", + "patches/net/minecraft/src/GuiButtonMerchant.java.patch", + "patches/net/minecraft/src/AnvilSaveConverter.java.patch", + "patches/org/spoutcraft/client/gui/server/DeleteFavoriteButton.java.patch", + "patches/net/minecraft/src/DispenserBehaviorEgg.java.patch", + "patches/org/spoutcraft/api/gui/GenericListView.java.patch", + "patches/net/minecraft/src/CommandTime.java.patch", + "patches/org/spoutcraft/client/gui/settings/controls/FancyFogButton.java.patch", + "patches/net/minecraft/src/DispenserBehaviorPotionProjectile.java.patch", + "patches/com/prupe/mcpatcher/ctm/TileOverride.java.patch", + "patches/net/minecraft/src/CallableGLInfo.java.patch", + "patches/net/minecraft/src/FilterIMob.java.patch", + "patches/org/spoutcraft/client/entity/CraftTextEntity.java.patch", + "patches/net/minecraft/src/ModelCreeper.java.patch", + "patches/net/minecraft/src/CallableChunkPosHash.java.patch", + "patches/net/minecraft/src/Profiler.java.patch", + "patches/net/minecraft/src/EntityPickupFX.java.patch", + "patches/net/minecraft/src/InventoryPlayer.java.patch", + "patches/net/minecraft/src/Session.java.patch", + "patches/org/spoutcraft/client/gui/controls/DeleteControlButton.java.patch", + "patches/org/spoutcraft/api/gui/PasswordTextProcessor.java.patch", + "patches/net/minecraft/src/Packet56MapChunks.java.patch", + "patches/net/minecraft/src/Packet253ServerAuthData.java.patch", + "patches/net/minecraft/src/Packet52MultiBlockChange.java.patch", + "patches/net/minecraft/src/CommandServerKick.java.patch", + "patches/org/bukkit/util/config/ConfigurationException.java.patch", + "patches/net/minecraft/src/EnchantmentNameParts.java.patch", + "patches/net/minecraft/src/BiomeGenMushroomIsland.java.patch", + "patches/org/spoutcraft/api/gui/ScrollBarPolicy.java.patch", + "patches/net/minecraft/src/ConvertingProgressUpdate.java.patch", + "patches/net/minecraft/src/ItemFirework.java.patch", + "patches/org/spoutcraft/client/gui/about/TextSection.java.patch", + "patches/net/minecraft/src/McoServerListUpdateTask.java.patch", + "patches/org/spoutcraft/client/gui/settings/controls/BrightnessSlider.java.patch", + "patches/net/minecraft/src/RenderWitch.java.patch", + "patches/net/minecraft/src/ServerCommandTestFor.java.patch", + "patches/net/minecraft/src/EntityPlayer.java.patch", + "patches/net/minecraft/src/BlockPressurePlate.java.patch", + "patches/net/minecraft/src/ComponentNetherBridgeEnd.java.patch", + "patches/net/minecraft/src/BlockCarpet.java.patch", + "patches/net/minecraft/src/BossStatus.java.patch", + "patches/net/minecraft/src/BlockHalfSlab.java.patch", + "patches/org/spoutcraft/client/gui/database/AbstractAPIModel.java.patch", + "patches/net/minecraft/src/ChunkProviderClient.java.patch", + "patches/net/minecraft/src/DispenserBehaviorFire.java.patch", + "patches/net/minecraft/src/EntityAIFleeSun.java.patch", + "patches/org/spoutcraft/client/util/PersistentMap.java.patch", + "patches/net/minecraft/src/CommandServerTp.java.patch", + "patches/org/spoutcraft/api/property/PropertyObject.java.patch", + "patches/net/minecraft/src/DispenserBehaviorTNT.java.patch", + "patches/net/minecraft/src/GuiCreateFlatWorld.java.patch", + "patches/net/minecraft/src/BlockSign.java.patch", + "patches/org/spoutcraft/client/packet/PacketPlaySound.java.patch", + "patches/net/minecraft/src/MovingObjectPosition.java.patch", + "patches/net/minecraft/src/ModifiableAttributeInstance.java.patch", + "patches/Start.java.patch", + "patches/net/minecraft/src/EntityAILookIdle.java.patch", + "patches/net/minecraft/src/Packet206SetObjective.java.patch", + "patches/net/minecraft/src/ItemGlassBottle.java.patch", + "patches/org/spoutcraft/client/DataMiningThread.java.patch", + "patches/net/minecraft/src/ISidedInventory.java.patch", + "patches/org/spoutcraft/client/controls/SimpleKeyBindingManager.java.patch", + "patches/net/minecraft/src/IEntitySelector.java.patch", + "patches/net/minecraft/src/WorldProviderSurface.java.patch", + "patches/org/spoutcraft/client/gui/controls/ControlsModel.java.patch", + "patches/net/minecraft/src/ThreadedFileIOBase.java.patch", + "patches/net/minecraft/src/Packet17Sleep.java.patch", + "patches/net/minecraft/src/CallableModded.java.patch", + "patches/net/minecraft/src/BlockRail.java.patch", + "patches/com/prupe/mcpatcher/ctm/CTMUtils$TileOverrideIterator.java.patch", + "patches/org/spoutcraft/client/player/accessories/Accessory.java.patch", + "patches/net/minecraft/src/EntityEnderCrystal.java.patch", + "patches/net/minecraft/src/ItemEnderPearl.java.patch", + "patches/org/spoutcraft/client/special/YAMLResource.java.patch", + "patches/net/minecraft/src/BlockEnderChest.java.patch", + "patches/net/minecraft/src/GuiEditSign.java.patch", + "patches/org/spoutcraft/client/gui/minimap/DeathpointsCheckBox.java.patch", + "patches/org/spoutcraft/client/gui/MCRenderDelegate.java.patch", + "patches/net/minecraft/src/EntityMinecartMobSpawner.java.patch", + "patches/net/minecraft/src/WorldGenPumpkin.java.patch", + "patches/org/spoutcraft/client/gui/database/SortButton.java.patch", + "patches/net/minecraft/src/RenderWither.java.patch", + "patches/com/prupe/mcpatcher/WeightedIndex$2.java.patch", + "patches/org/spoutcraft/api/material/item/Potion.java.patch", + "patches/net/minecraft/src/CommandDefaultGameMode.java.patch", + "patches/org/spoutcraft/api/gui/ExpBar.java.patch", + "patches/net/minecraft/src/RenderChicken.java.patch", + "patches/net/minecraft/src/GameRules.java.patch", + "patches/net/minecraft/src/Packet254ServerPing.java.patch", + "patches/net/minecraft/src/EntityAILookAtTradePlayer.java.patch", + "patches/net/minecraft/src/TextureAtlasSprite.java.patch", + "patches/net/minecraft/src/EnumOptions.java.patch", + "patches/net/minecraft/src/CallableMouseLocation.java.patch", + "patches/net/minecraft/src/TileEntityCommandBlock.java.patch", + "patches/net/minecraft/src/PlayerNotFoundException.java.patch", + "patches/net/minecraft/src/ItemArmor.java.patch", + "patches/org/spoutcraft/client/packet/PacketManager.java.patch", + "patches/net/minecraft/src/ItemSnowball.java.patch", + "patches/net/minecraft/src/ModelSnowMan.java.patch", + "patches/net/minecraft/src/ValueObject.java.patch", + "patches/org/spoutcraft/client/gui/settings/controls/ConnectedTexturesButton.java.patch", + "patches/net/minecraft/src/PotionAbsoption.java.patch", + "patches/net/minecraft/src/StructureStrongholdStart.java.patch", + "patches/net/minecraft/src/WorldGenLiquids.java.patch", + "patches/com/prupe/mcpatcher/MCLogger.java.patch", + "patches/org/spoutcraft/api/keyboard/BindingExecutionDelegate.java.patch", + "patches/net/minecraft/src/GuiCreateWorld.java.patch", + "patches/net/minecraft/src/BlockGlowStone.java.patch", + "patches/net/minecraft/src/NetServerHandler.java.patch", + "patches/net/minecraft/src/EnchantmentArrowFire.java.patch", + "patches/org/spoutcraft/api/util/UniqueItemStringMap.java.patch", + "patches/net/minecraft/src/WeightedRandomItem.java.patch", + "patches/net/minecraft/src/GenLayerAddIsland.java.patch", + "patches/net/minecraft/src/Packet41EntityEffect.java.patch", + "patches/net/minecraft/src/EntityAINearestAttackableTargetSorter.java.patch", + "patches/net/minecraft/src/ModelSign.java.patch", + "patches/net/minecraft/src/TcpConnection.java.patch", + "patches/net/minecraft/src/ThreadOnlineScreen.java.patch", + "patches/net/minecraft/src/CallableLvl1.java.patch", + "patches/net/minecraft/src/ItemPickaxe.java.patch", + "patches/net/minecraft/src/RenderSheep.java.patch", + "patches/org/spoutcraft/client/gui/minimap/ShowEntitiesCheckbox.java.patch", + "patches/net/minecraft/src/ThreadLoginVerifier.java.patch", + "patches/net/minecraft/src/ComponentStrongholdChestCorridor.java.patch", + "patches/org/spoutcraft/client/controls/Shortcut.java.patch", + "patches/net/minecraft/src/StructureScatteredFeatureStart.java.patch", + "patches/org/spoutcraft/client/gui/server/ServerListModel.java.patch", + "patches/net/minecraft/src/McoServer.java.patch", + "patches/org/spoutcraft/api/material/Plant.java.patch", + "patches/org/spoutcraft/client/gui/controls/ControlsSearch.java.patch", + "patches/net/minecraft/src/ItemEditableBook.java.patch", + "patches/net/minecraft/src/BlockDaylightDetector.java.patch", + "patches/net/minecraft/src/GuiScreenDisconnectedOnline.java.patch", + "patches/net/minecraft/src/ComponentStrongholdPortalRoom.java.patch", + "patches/org/spoutcraft/api/animation/OutQuadAnimationProgress.java.patch", + "patches/net/minecraft/src/MovementInputFromOptions.java.patch", + "patches/com/prupe/mcpatcher/ctm/TileOverrideImpl$Fixed.java.patch", + "patches/org/spoutcraft/api/Achievement.java.patch", + "patches/net/minecraft/src/ComponentNetherBridgeEntrance.java.patch", + "patches/net/minecraft/src/InventoryCraftResult.java.patch", + "patches/net/minecraft/src/Packet55BlockDestroy.java.patch", + "patches/net/minecraft/src/MaterialPortal.java.patch", + "patches/net/minecraft/src/GenLayerAddSnow.java.patch", + "patches/net/minecraft/src/Packet20NamedEntitySpawn.java.patch", + "patches/net/minecraft/src/RenderSquid.java.patch", + "patches/org/spoutcraft/client/gui/minimap/Map.java.patch", + "patches/net/minecraft/src/FlatGeneratorInfo.java.patch", + "patches/org/spoutcraft/api/Statistic.java.patch", + "patches/net/minecraft/src/BlockRedstoneWire.java.patch", + "patches/org/spoutcraft/api/block/design/Quad.java.patch", + "patches/net/minecraft/src/CallableTileEntityName.java.patch", + "patches/net/minecraft/src/EnchantmentProtection.java.patch", + "patches/org/spoutcraft/client/gui/settings/controls/FieldOfViewSlider.java.patch", + "patches/net/minecraft/src/EntityExpBottle.java.patch", + "patches/net/minecraft/src/ItemMonsterPlacer.java.patch", + "patches/net/minecraft/src/BiomeCacheBlock.java.patch", + "patches/net/minecraft/src/RenderBlaze.java.patch", + "patches/org/spoutcraft/client/packet/PacketOpenSignGUI.java.patch", + "patches/net/minecraft/src/WorldGenReed.java.patch", + "patches/net/minecraft/src/BlockButton.java.patch", + "patches/net/minecraft/src/ValueObjectList.java.patch", + "patches/com/prupe/mcpatcher/MCLogger$ErrorLevel.java.patch", + "patches/net/minecraft/src/MinecraftException.java.patch", + "patches/net/minecraft/src/CryptManager.java.patch", + "patches/org/spoutcraft/client/inventory/SimpleShapelessRecipe.java.patch", + "patches/net/minecraft/src/GuiSlotStatsItem.java.patch", + "patches/net/minecraft/src/RandomPositionGenerator.java.patch", + "patches/net/minecraft/src/BlockWoodSlab.java.patch", + "patches/org/spoutcraft/api/gui/Container.java.patch", + "patches/org/spoutcraft/api/io/SpoutOutputStream.java.patch", + "patches/net/minecraft/src/ThreadClientSleep.java.patch", + "patches/net/minecraft/src/AnvilChunkLoaderPending.java.patch", + "patches/net/minecraft/src/ThreadPollServers.java.patch", + "patches/net/minecraft/src/WorldGenGlowStone2.java.patch", + "patches/net/minecraft/src/EntityNoteFX.java.patch", + "patches/net/minecraft/src/ModelEnderman.java.patch", + "patches/net/minecraft/src/EntityAIMoveTowardsRestriction.java.patch", + "patches/net/minecraft/src/RenderSnowMan.java.patch", + "patches/net/minecraft/src/EntityHeartFX.java.patch", + "patches/net/minecraft/src/ExceptionMcoHttp.java.patch", + "patches/net/minecraft/src/LogAgent.java.patch", + "patches/net/minecraft/src/ItemNameTag.java.patch", + "patches/net/minecraft/src/GuiRenameWorld.java.patch", + "patches/net/minecraft/src/GuiScreenTemporaryResourcePackSelectSelectionList.java.patch", + "patches/net/minecraft/src/GuiChat.java.patch", + "patches/net/minecraft/src/BlockEnchantmentTable.java.patch", + "patches/org/spoutcraft/client/player/accessories/AccessoryHandler.java.patch", + "patches/net/minecraft/src/ItemRenderer.java.patch", + "patches/net/minecraft/src/SoundUpdaterMinecart.java.patch", + "patches/net/minecraft/src/ComponentVillageStartPiece.java.patch", + "patches/com/prupe/mcpatcher/ctm/CTMUtils$3.java.patch", + "patches/net/minecraft/src/GuiControls.java.patch", + "patches/net/minecraft/src/BlockNote.java.patch", + "patches/net/minecraft/src/BlockRotatedPillar.java.patch", + "patches/net/minecraft/src/BlockBaseRailLogic.java.patch", + "patches/net/minecraft/src/Container.java.patch", + "patches/net/minecraft/src/PackMetadataSection.java.patch", + "patches/net/minecraft/src/GuiSlotLanguage.java.patch", + "patches/org/spoutcraft/api/gui/Keyboard.java.patch", + "patches/net/minecraft/src/ContainerBeacon.java.patch", + "patches/net/minecraft/src/ChatAllowedCharacters.java.patch", + "patches/org/spoutcraft/client/packet/PacketKeyBinding.java.patch", + "patches/net/minecraft/src/EntityAIRestrictSun.java.patch", + "patches/net/minecraft/src/SlotMerchantResult.java.patch", + "patches/net/minecraft/src/ModelIronGolem.java.patch", + "patches/net/minecraft/src/BiomeGenPlains.java.patch", + "patches/net/minecraft/src/ModelGhast.java.patch", + "patches/org/spoutcraft/api/gui/GenericWidget.java.patch", + "patches/net/minecraft/src/EntityAIMoveIndoors.java.patch", + "patches/net/minecraft/src/GuiScreenBook.java.patch", + "patches/net/minecraft/src/BlockReed.java.patch", + "patches/net/minecraft/src/RenderBiped.java.patch", + "patches/org/spoutcraft/client/MCItemStackComparator.java.patch", + "patches/net/minecraft/src/ContainerBrewingStand.java.patch", + "patches/net/minecraft/src/ServerCommandScoreboard.java.patch", + "patches/net/minecraft/src/ComponentVillageTorch.java.patch", + "patches/org/spoutcraft/api/util/MutableVector.java.patch", + "patches/org/spoutcraft/client/gui/settings/controls/HotbarQuickKeysButton.java.patch", + "patches/net/minecraft/src/ItemTool.java.patch", + "patches/net/minecraft/src/EntityMinecartContainer.java.patch", + "patches/org/spoutcraft/client/gui/server/ServerDataBaseEntry.java.patch", + "patches/org/spoutcraft/client/inventory/SimpleMaterialManager.java.patch", + "patches/net/minecraft/src/GuiScreenDemo.java.patch", + "patches/com/prupe/mcpatcher/TexturePackAPI$2.java.patch", + "patches/net/minecraft/src/EnumArmorMaterial.java.patch", + "patches/net/minecraft/src/RConOutputStream.java.patch", + "patches/org/bukkit/util/Java15Compat.java.patch", + "patches/net/minecraft/src/BlockHay.java.patch", + "patches/net/minecraft/src/ItemMinecart.java.patch", + "patches/org/spoutcraft/client/gui/database/FilterButton.java.patch", + "patches/net/minecraft/src/GuiSleepMP.java.patch", + "patches/org/spoutcraft/client/packet/CompressablePacket.java.patch", + "patches/org/spoutcraft/api/material/block/LongGrass.java.patch", + "patches/net/minecraft/src/StepSoundSand.java.patch", + "patches/org/spoutcraft/client/item/SpoutItem.java.patch", + "patches/net/minecraft/src/RenderSpider.java.patch", + "patches/net/minecraft/src/CommandSpreadPlayers.java.patch", + "patches/net/minecraft/src/WorldChunkManagerHell.java.patch", + "patches/org/spoutcraft/client/packet/PacketAllowVisualCheats.java.patch", + "patches/net/minecraft/src/GuiWorldSlot.java.patch", + "patches/com/prupe/mcpatcher/hd/FancyDial$Layer.java.patch", + "patches/net/minecraft/src/MapGenStructureData.java.patch", + "patches/org/spoutcraft/api/gui/Color.java.patch", + "patches/org/spoutcraft/client/gui/ButtonUpdater.java.patch", + "patches/net/minecraft/src/WorldGenWaterlily.java.patch", + "patches/net/minecraft/src/ComponentNetherBridgeCorridor4.java.patch", + "patches/net/minecraft/src/RenderEntity.java.patch", + "patches/net/minecraft/src/Packet24MobSpawn.java.patch", + "patches/net/minecraft/src/CommandServerPardonIp.java.patch", + "patches/net/minecraft/src/SlotBrewingStandPotion.java.patch", + "patches/net/minecraft/src/GuiFlatPresetsItem.java.patch", + "patches/net/minecraft/src/EntityHanging.java.patch", + "patches/org/spoutcraft/api/inventory/Inventory.java.patch", + "patches/net/minecraft/src/EntityAIMoveThroughVillage.java.patch", + "patches/net/minecraft/src/RendererLivingEntity.java.patch", + "patches/net/minecraft/src/SlotEnchantment.java.patch", + "patches/net/minecraft/src/CommandServerOp.java.patch", + "patches/net/minecraft/src/CreativeTabMaterial.java.patch", + "patches/net/minecraft/src/EntityPainting.java.patch", + "patches/net/minecraft/src/EntityTrackerEntry.java.patch", + "patches/org/spoutcraft/api/util/FixedLocation.java.patch", + "patches/org/spoutcraft/api/gui/PositionOrientation.java.patch", + "patches/net/minecraft/src/EntityCritFX.java.patch", + "patches/net/minecraft/src/PotionHelper.java.patch", + "patches/net/minecraft/src/BlockFarmland.java.patch", + "patches/net/minecraft/src/CommandGameRule.java.patch", + "patches/net/minecraft/src/PotionAttackDamage.java.patch", + "patches/net/minecraft/src/WorldGenDesertWells.java.patch", + "patches/net/minecraft/src/GameSettings.java.patch", + "patches/org/spoutcraft/client/packet/ScreenAction.java.patch", + "patches/org/spoutcraft/client/io/FileMap.java.patch", + "patches/net/minecraft/src/BlockStationary.java.patch", + "patches/net/minecraft/src/TileEntityPiston.java.patch", + "patches/org/spoutcraft/api/animation/PropertyDelegate.java.patch", + "patches/net/minecraft/src/GuiVideoSettings.java.patch", + "patches/org/spoutcraft/client/packet/PacketSlotClick.java.patch", + "patches/net/minecraft/src/ModelZombieVillager.java.patch", + "patches/net/minecraft/src/Packet201PlayerInfo.java.patch", + "patches/net/minecraft/src/EntityAIWander.java.patch", + "patches/net/minecraft/src/EntityLivingBase.java.patch", + "patches/net/minecraft/src/CommandPlaySound.java.patch", + "patches/net/minecraft/src/ChunkCoordinates.java.patch" +] \ No newline at end of file diff --git a/patch-reformatter.py b/patch-reformatter.py new file mode 100644 index 0000000..8a77dfd --- /dev/null +++ b/patch-reformatter.py @@ -0,0 +1,52 @@ +import os +import json +import patch_ng + +from os import path + +patch = patch_ng.fromfile("client.patch") + +def s(data): + if isinstance(data, bytes): + return data.decode("utf-8") + + return data + +def dump_to_str(data: patch_ng.Patch): + out = "" + + for headline in data.header: + out += s(headline).rstrip('\n') + "\n" + + out += '--- ' + s(data.source) + "\n" + out += '+++ ' + s(data.target) + "\n" + + for h in data.hunks: + out += '@@ -%s,%s +%s,%s @@' % (s(h.startsrc), s(h.linessrc), s(h.starttgt), s(h.linestgt)) + "\n" + + for line in h.text: + out += s(line).rstrip('\n') + "\n" + + return s(out) + +root = "patches" +index = [] + +for item in patch: + item: patch_ng.Patch = item + data = dump_to_str(item) + out_path = s(item.target) + ".patch" + full_path = root + "/" + out_path + + if not path.exists(path.dirname(full_path)): + os.makedirs(path.dirname(full_path)) + + with open(full_path, "w") as f: + f.write(data) + + index.append(full_path) + +with open("patch-index.json", "w") as f: + f.write(json.dumps(index, indent=4)) + +print("Successfully reformatted " + str(len(index)) + " patches!") diff --git a/patches/Start.java.patch b/patches/Start.java.patch new file mode 100644 index 0000000..f3f7b18 --- /dev/null +++ b/patches/Start.java.patch @@ -0,0 +1,20 @@ +--- /dev/null ++++ Start.java +@@ -1,0 +1,17 @@ ++import java.io.File; ++import java.lang.reflect.Field; ++import java.util.Arrays; ++ ++import net.minecraft.client.main.Main; ++ ++public class Start { ++ public static void main(String[] args) { ++ Main.main(concat(new String[] {"--version", "mcp"}, args)); ++ } ++ ++ public static T[] concat(T[] first, T[] second) { ++ T[] result = Arrays.copyOf(first, first.length + second.length); ++ System.arraycopy(second, 0, result, first.length, second.length); ++ return result; ++ } ++} diff --git a/patches/com/prupe/mcpatcher/BlendMethod.java.patch b/patches/com/prupe/mcpatcher/BlendMethod.java.patch new file mode 100644 index 0000000..391e6ed --- /dev/null +++ b/patches/com/prupe/mcpatcher/BlendMethod.java.patch @@ -0,0 +1,112 @@ +--- /dev/null ++++ com/prupe/mcpatcher/BlendMethod.java +@@ -1,0 +1,109 @@ ++package com.prupe.mcpatcher; ++ ++import org.lwjgl.opengl.GL11; ++ ++public class BlendMethod { ++ public static final BlendMethod ALPHA = new BlendMethod("alpha", 770, 771, true, false, true); ++ public static final BlendMethod ADD = new BlendMethod("add", 770, 1, true, false, true); ++ public static final BlendMethod SUBTRACT = new BlendMethod("subtract", 775, 0, true, true, false); ++ public static final BlendMethod MULTIPLY = new BlendMethod("multiply", 774, 771, true, true, true); ++ public static final BlendMethod DODGE = new BlendMethod("dodge", 1, 1, true, true, false); ++ public static final BlendMethod BURN = new BlendMethod("burn", 0, 769, true, true, false); ++ public static final BlendMethod SCREEN = new BlendMethod("screen", 1, 769, true, true, false); ++ public static final BlendMethod OVERLAY = new BlendMethod("overlay", 774, 768, true, true, false); ++ public static final BlendMethod REPLACE = new BlendMethod("replace", 0, 0, false, false, true); ++ private final int srcBlend; ++ private final int dstBlend; ++ private final String name; ++ private final boolean blend; ++ private final boolean fadeRGB; ++ private final boolean fadeAlpha; ++ ++ public static BlendMethod parse(String text) { ++ text = text.toLowerCase().trim(); ++ ++ if (text.equals("alpha")) { ++ return ALPHA; ++ } else if (text.equals("add")) { ++ return ADD; ++ } else if (text.equals("subtract")) { ++ return SUBTRACT; ++ } else if (text.equals("multiply")) { ++ return MULTIPLY; ++ } else if (text.equals("dodge")) { ++ return DODGE; ++ } else if (text.equals("burn")) { ++ return BURN; ++ } else if (text.equals("screen")) { ++ return SCREEN; ++ } else if (!text.equals("overlay") && !text.equals("color")) { ++ if (text.equals("replace")) { ++ return REPLACE; ++ } else { ++ String[] tokens = text.split("\\s+"); ++ ++ if (tokens.length >= 2) { ++ try { ++ int e = Integer.parseInt(tokens[0]); ++ int dstBlend = Integer.parseInt(tokens[1]); ++ return new BlendMethod("custom(" + e + "," + dstBlend + ")", e, dstBlend, true, true, false); ++ } catch (NumberFormatException var4) { ++ ; ++ } ++ } ++ ++ return null; ++ } ++ } else { ++ return OVERLAY; ++ } ++ } ++ ++ private BlendMethod(String name, int srcBlend, int dstBlend, boolean blend, boolean fadeRGB, boolean fadeAlpha) { ++ this.name = name; ++ this.srcBlend = srcBlend; ++ this.dstBlend = dstBlend; ++ this.blend = blend; ++ this.fadeRGB = fadeRGB; ++ this.fadeAlpha = fadeAlpha; ++ } ++ ++ public String toString() { ++ return this.name; ++ } ++ ++ public void applyFade(float fade) { ++ if (this.fadeRGB && this.fadeAlpha) { ++ GL11.glColor4f(fade, fade, fade, fade); ++ } else if (this.fadeRGB) { ++ GL11.glColor4f(fade, fade, fade, 1.0F); ++ } else if (this.fadeAlpha) { ++ GL11.glColor4f(1.0F, 1.0F, 1.0F, fade); ++ } ++ } ++ ++ public void applyAlphaTest() { ++ if (this.blend) { ++ GL11.glDisable(GL11.GL_ALPHA_TEST); ++ } else { ++ GL11.glEnable(GL11.GL_ALPHA_TEST); ++ } ++ } ++ ++ public void applyBlending() { ++ if (this.blend) { ++ GL11.glEnable(GL11.GL_BLEND); ++ GL11.glBlendFunc(this.srcBlend, this.dstBlend); ++ } else { ++ GL11.glDisable(GL11.GL_BLEND); ++ } ++ } ++ ++ public boolean isColorBased() { ++ return this.fadeRGB; ++ } ++ ++ public boolean canFade() { ++ return this.blend && (this.fadeAlpha || this.fadeRGB); ++ } ++} diff --git a/patches/com/prupe/mcpatcher/Config$FileEntry.java.patch b/patches/com/prupe/mcpatcher/Config$FileEntry.java.patch new file mode 100644 index 0000000..106a440 --- /dev/null +++ b/patches/com/prupe/mcpatcher/Config$FileEntry.java.patch @@ -0,0 +1,16 @@ +--- /dev/null ++++ com/prupe/mcpatcher/Config$FileEntry.java +@@ -1,0 +1,13 @@ ++package com.prupe.mcpatcher; ++ ++class Config$FileEntry { ++ String from; ++ String to; ++ ++ private Config$FileEntry() {} ++ ++ Config$FileEntry(String from, String to) { ++ this.from = from; ++ this.to = to; ++ } ++} diff --git a/patches/com/prupe/mcpatcher/Config$ModEntry.java.patch b/patches/com/prupe/mcpatcher/Config$ModEntry.java.patch new file mode 100644 index 0000000..ae748e5 --- /dev/null +++ b/patches/com/prupe/mcpatcher/Config$ModEntry.java.patch @@ -0,0 +1,15 @@ +--- /dev/null ++++ com/prupe/mcpatcher/Config$ModEntry.java +@@ -1,0 +1,12 @@ ++package com.prupe.mcpatcher; ++ ++import com.prupe.mcpatcher.Config$FileEntry; ++import java.util.List; ++ ++class Config$ModEntry { ++ String type; ++ boolean enabled; ++ String path; ++ String className; ++ List files; ++} diff --git a/patches/com/prupe/mcpatcher/Config$ProfileEntry.java.patch b/patches/com/prupe/mcpatcher/Config$ProfileEntry.java.patch new file mode 100644 index 0000000..46f0c28 --- /dev/null +++ b/patches/com/prupe/mcpatcher/Config$ProfileEntry.java.patch @@ -0,0 +1,29 @@ +--- /dev/null ++++ com/prupe/mcpatcher/Config$ProfileEntry.java +@@ -1,0 +1,26 @@ ++package com.prupe.mcpatcher; ++ ++import com.prupe.mcpatcher.Config$VersionEntry; ++import java.util.LinkedHashMap; ++ ++class Config$ProfileEntry { ++ String original; ++ String version; ++ LinkedHashMap> config = new LinkedHashMap(); ++ LinkedHashMap versions = new LinkedHashMap(); ++ ++ private LinkedHashMap getModConfig(String mod) { ++ LinkedHashMap map = (LinkedHashMap)this.config.get(mod); ++ ++ if (map == null) { ++ map = new LinkedHashMap(); ++ this.config.put(mod, map); ++ } ++ ++ return map; ++ } ++ ++ static LinkedHashMap access$000(Config$ProfileEntry x0, String x1) { ++ return x0.getModConfig(x1); ++ } ++} diff --git a/patches/com/prupe/mcpatcher/Config$VersionEntry.java.patch b/patches/com/prupe/mcpatcher/Config$VersionEntry.java.patch new file mode 100644 index 0000000..68b13a4 --- /dev/null +++ b/patches/com/prupe/mcpatcher/Config$VersionEntry.java.patch @@ -0,0 +1,12 @@ +--- /dev/null ++++ com/prupe/mcpatcher/Config$VersionEntry.java +@@ -1,0 +1,9 @@ ++package com.prupe.mcpatcher; ++ ++import com.prupe.mcpatcher.Config$ModEntry; ++import java.util.LinkedHashMap; ++ ++class Config$VersionEntry { ++ String original; ++ LinkedHashMap mods = new LinkedHashMap(); ++} diff --git a/patches/com/prupe/mcpatcher/Config.java.patch b/patches/com/prupe/mcpatcher/Config.java.patch new file mode 100644 index 0000000..634d23a --- /dev/null +++ b/patches/com/prupe/mcpatcher/Config.java.patch @@ -0,0 +1,267 @@ +--- /dev/null ++++ com/prupe/mcpatcher/Config.java +@@ -1,0 +1,264 @@ ++package com.prupe.mcpatcher; ++ ++import com.google.gson.JsonElement; ++import com.google.gson.JsonObject; ++import com.prupe.mcpatcher.Config$ModEntry; ++import com.prupe.mcpatcher.Config$ProfileEntry; ++import com.prupe.mcpatcher.Config$VersionEntry; ++import java.io.File; ++import java.util.Collection; ++import java.util.HashMap; ++import java.util.Iterator; ++import java.util.LinkedHashMap; ++import java.util.Map; ++import java.util.Map.Entry; ++import java.util.logging.Level; ++ ++public class Config { ++ private static Config instance = new Config(); ++ private static File jsonFile; ++ private static boolean readOnly; ++ public static final String MCPATCHER_PROPERTIES = "mcpatcher.properties"; ++ public static final String MCPATCHER_JSON = "mcpatcher.json"; ++ public static final String LAUNCHER_JSON = "launcher_profiles.json"; ++ public static final String VERSIONS_JSON = "versions.json"; ++ static final String TAG_MINECRAFT_VERSION = "minecraftVersion"; ++ static final String TAG_PATCHER_VERSION = "patcherVersion"; ++ static final String TAG_PRE_PATCH_STATE = "prePatchState"; ++ static final String TAG_MODIFIED_CLASSES = "modifiedClasses"; ++ static final String TAG_ADDED_CLASSES = "addedClasses"; ++ static final String VAL_BUILTIN = "builtIn"; ++ static final String VAL_EXTERNAL_ZIP = "externalZip"; ++ static final String VAL_EXTERNAL_JAR = "externalJar"; ++ private static final String TAG_SELECTED_PROFILE = "selectedProfile"; ++ public static final String MCPATCHER_PROFILE_NAME = "MCPatcher"; ++ private static final int VAL_FORMAT_CURRENT = 1; ++ private static final int VAL_FORMAT_MIN = 1; ++ private static final int VAL_FORMAT_MAX = 1; ++ transient String selectedProfile = "MCPatcher"; ++ int format = 1; ++ String patcherVersion; ++ boolean betaWarningShown; ++ boolean selectPatchedProfile = true; ++ boolean fetchRemoteVersionList = true; ++ boolean extraProfiling; ++ String lastModDirectory; ++ LinkedHashMap logging = new LinkedHashMap(); ++ LinkedHashMap profiles = new LinkedHashMap(); ++ ++ static boolean load(File minecraftDir, boolean isGame) { ++ jsonFile = new File(minecraftDir, "mcpatcher.json"); ++ instance = (Config)JsonUtils.parseJson(jsonFile, Config.class); ++ ++ if (instance != null && instance.format > 0) { ++ if (instance.format < 1) { ++ instance.format = 1; ++ save(); ++ } else if (instance.format > 1) { ++ setReadOnly(true); ++ } ++ } else { ++ instance = new Config(); ++ ++ if (isGame) { ++ // Spout Removed ++ //System.out.printf("WARNING: configuration file %s not found, using defaults\n", new Object[] {jsonFile}); ++ } ++ ++ save(); ++ } ++ // Spout Nullified because we don't use profiles. ++ //String profile = getSelectedLauncherProfile(minecraftDir); ++ String profile = null; ++ ++ if (MCPatcherUtils.isNullOrEmpty(profile)) { ++ if (isGame) { ++ // Spout Removed ++ //System.out.printf("WARNING: could not determine selected profile, defaulting to %s\n", new Object[] {"MCPatcher"}); ++ } ++ ++ profile = "MCPatcher"; ++ } else if (!instance.profiles.containsKey(profile) && isGame) { ++ // Spout Removed ++ //System.out.printf("WARNING: selected profile \'%s\' not found, using defaults\n", new Object[] {profile}); ++ } ++ ++ instance.selectedProfile = profile; ++ return true; ++ } ++ ++ static boolean save() { ++ boolean success = false; ++ ++ if (jsonFile != null && !readOnly) { ++ JsonUtils.writeJson((Object)instance, jsonFile); ++ } ++ ++ return success; ++ } ++ ++ private static String getSelectedLauncherProfile(File minecraftDir) { ++ File path = new File(minecraftDir, "launcher_profiles.json"); ++ JsonObject json = JsonUtils.parseJson(path); ++ ++ if (json != null) { ++ JsonElement element = json.get("selectedProfile"); ++ ++ if (element != null && element.isJsonPrimitive()) { ++ return element.getAsString(); ++ } ++ } ++ ++ return null; ++ } ++ ++ public static Config getInstance() { ++ return instance; ++ } ++ ++ public static void setReadOnly(boolean readOnly) { ++ readOnly = readOnly; ++ } ++ ++ static Level getLogLevel(String category) { ++ Level level = Level.INFO; ++ String value = (String)instance.logging.get(category); ++ ++ if (value != null) { ++ try { ++ level = Level.parse(value.trim().toUpperCase()); ++ } catch (Throwable var4) { ++ ; ++ } ++ } ++ ++ setLogLevel(category, level); ++ return level; ++ } ++ ++ static void setLogLevel(String category, Level level) { ++ instance.logging.put(category, level.toString().toUpperCase()); ++ } ++ ++ public static String getString(String mod, String tag, Object defaultValue) { ++ LinkedHashMap modConfig = instance.getModConfig(mod); ++ String value = (String)modConfig.get(tag); ++ ++ if (value == null) { ++ modConfig.put(tag, defaultValue.toString()); ++ return defaultValue.toString(); ++ } else { ++ return value; ++ } ++ } ++ ++ public static int getInt(String mod, String tag, int defaultValue) { ++ int value; ++ ++ try { ++ value = Integer.parseInt(getString(mod, tag, Integer.valueOf(defaultValue))); ++ } catch (NumberFormatException var5) { ++ value = defaultValue; ++ } ++ ++ return value; ++ } ++ ++ public static boolean getBoolean(String mod, String tag, boolean defaultValue) { ++ String value = getString(mod, tag, Boolean.valueOf(defaultValue)).toLowerCase(); ++ return value.equals("false") ? false : (value.equals("true") ? true : defaultValue); ++ } ++ ++ public static void set(String mod, String tag, Object value) { ++ if (value == null) { ++ remove(mod, tag); ++ } else { ++ instance.getModConfig(mod).put(tag, value.toString()); ++ } ++ } ++ ++ public static void remove(String mod, String tag) { ++ instance.getModConfig(mod).remove(tag); ++ } ++ ++ String getSelectedProfileName() { ++ if (MCPatcherUtils.isNullOrEmpty(this.selectedProfile)) { ++ this.selectedProfile = "MCPatcher"; ++ } ++ ++ return this.selectedProfile; ++ } ++ ++ Config$ProfileEntry getSelectedProfile() { ++ Config$ProfileEntry profile = (Config$ProfileEntry)this.profiles.get(this.getSelectedProfileName()); ++ ++ if (profile == null) { ++ profile = new Config$ProfileEntry(); ++ this.profiles.put(this.selectedProfile, profile); ++ } ++ ++ return profile; ++ } ++ ++ Config$VersionEntry getSelectedVersion() { ++ Config$ProfileEntry profile = this.getSelectedProfile(); ++ Config$VersionEntry version = (Config$VersionEntry)profile.versions.get(profile.version); ++ ++ if (version == null) { ++ version = new Config$VersionEntry(); ++ profile.versions.put(profile.version, version); ++ } ++ ++ return version; ++ } ++ ++ Config$ModEntry getModEntry(String mod) { ++ return (Config$ModEntry)this.getSelectedVersion().mods.get(mod); ++ } ++ ++ Collection getModEntries() { ++ return this.getSelectedVersion().mods.values(); ++ } ++ ++ private LinkedHashMap getModConfig(String mod) { ++ return Config$ProfileEntry.access$000(this.getSelectedProfile(), mod); ++ } ++ ++ void removeMod(String mod) { ++ this.getSelectedProfile().config.remove(mod); ++ this.getSelectedVersion().mods.remove(mod); ++ } ++ ++ void removeProfile(String name) { ++ if (!name.equals(this.selectedProfile)) { ++ this.profiles.remove(name); ++ } ++ } ++ ++ void removeVersion(String name) { ++ if (!name.equals(this.getSelectedProfile().version)) { ++ this.getSelectedProfile().versions.remove(name); ++ } ++ } ++ ++ Map getPatchedVersionMap() { ++ HashMap map = new HashMap(); ++ Iterator i$ = this.profiles.values().iterator(); ++ ++ while (i$.hasNext()) { ++ Config$ProfileEntry profile = (Config$ProfileEntry)i$.next(); ++ profile.versions.remove((Object)null); ++ profile.versions.remove(""); ++ Iterator i$1 = profile.versions.entrySet().iterator(); ++ ++ while (i$1.hasNext()) { ++ Entry entry = (Entry)i$1.next(); ++ String patchedVersion = (String)entry.getKey(); ++ String unpatchedVersion = ((Config$VersionEntry)entry.getValue()).original; ++ map.put(patchedVersion, unpatchedVersion); ++ } ++ } ++ ++ return map; ++ } ++} diff --git a/patches/com/prupe/mcpatcher/InputHandler.java.patch b/patches/com/prupe/mcpatcher/InputHandler.java.patch new file mode 100644 index 0000000..f4b73a4 --- /dev/null +++ b/patches/com/prupe/mcpatcher/InputHandler.java.patch @@ -0,0 +1,57 @@ +--- /dev/null ++++ com/prupe/mcpatcher/InputHandler.java +@@ -1,0 +1,54 @@ ++package com.prupe.mcpatcher; ++ ++import java.util.BitSet; ++import org.lwjgl.input.Keyboard; ++ ++public class InputHandler { ++ private final BitSet keysDown = new BitSet(); ++ private final String name; ++ private final boolean enabled; ++ ++ public InputHandler(String name, boolean enabled) { ++ this.name = name; ++ this.enabled = enabled; ++ } ++ ++ public String getName() { ++ return this.name; ++ } ++ ++ public boolean isEnabled() { ++ return this.enabled; ++ } ++ ++ public boolean isKeyPressed(int key) { ++ if (this.enabled) { ++ if (Keyboard.isKeyDown(key)) { ++ if (!this.keysDown.get(key)) { ++ this.keysDown.set(key); ++ return true; ++ } ++ } else { ++ this.keysDown.clear(key); ++ } ++ } ++ ++ return false; ++ } ++ ++ public boolean isKeyDown(int key) { ++ return this.enabled && Keyboard.isKeyDown(key); ++ } ++ ++ public String toString() { ++ StringBuilder sb = new StringBuilder(); ++ sb.append("InputUtils{").append(this.name).append(':'); ++ ++ for (int i = this.keysDown.nextSetBit(0); i >= 0; i = this.keysDown.nextSetBit(i + 1)) { ++ sb.append(' ').append(Keyboard.getKeyName(i)); ++ } ++ ++ sb.append('}'); ++ return sb.toString(); ++ } ++} diff --git a/patches/com/prupe/mcpatcher/JsonUtils.java.patch b/patches/com/prupe/mcpatcher/JsonUtils.java.patch new file mode 100644 index 0000000..bdb370b --- /dev/null +++ b/patches/com/prupe/mcpatcher/JsonUtils.java.patch @@ -0,0 +1,137 @@ +--- /dev/null ++++ com/prupe/mcpatcher/JsonUtils.java +@@ -1,0 +1,134 @@ ++package com.prupe.mcpatcher; ++ ++import com.google.gson.Gson; ++import com.google.gson.GsonBuilder; ++import com.google.gson.JsonElement; ++import com.google.gson.JsonObject; ++import com.google.gson.JsonParser; ++import java.io.Closeable; ++import java.io.File; ++import java.io.FileInputStream; ++import java.io.FileReader; ++import java.io.InputStream; ++import java.io.InputStreamReader; ++import java.io.PrintWriter; ++ ++public class JsonUtils { ++ public static Gson newGson() { ++ GsonBuilder builder = new GsonBuilder(); ++ builder.setPrettyPrinting(); ++ return builder.create(); ++ } ++ ++ public static T parseJson(File path, Class cl) { ++ if (path != null && path.isFile() && path.length() > 0L) { ++ FileInputStream input = null; ++ Object var4; ++ ++ try { ++ input = new FileInputStream(path); ++ Object e = parseJson((InputStream)input, cl); ++ // ToDo: return e; [incompatible types] ++ return null; ++ } catch (Throwable var8) { ++ var8.printStackTrace(); ++ var4 = null; ++ } finally { ++ MCPatcherUtils.close((Closeable)input); ++ } ++//ToDo: ++ return null; //var4 ++ } else { ++ return null; ++ } ++ } ++ ++ public static T parseJson(InputStream input, Class cl) { ++ if (input == null) { ++ return null; ++ } else { ++ try { ++ InputStreamReader e = new InputStreamReader(input); ++ return newGson().fromJson(e, cl); ++ } catch (Throwable var3) { ++ var3.printStackTrace(); ++ return null; ++ } ++ } ++ } ++ ++ public static JsonObject parseJson(File path) { ++ FileReader input = null; ++ JsonObject var3; ++ ++ try { ++ input = new FileReader(path); ++ JsonParser e = new JsonParser(); ++ var3 = e.parse(input).getAsJsonObject(); ++ return var3; ++ } catch (Throwable var7) { ++ var7.printStackTrace(); ++ var3 = null; ++ } finally { ++ MCPatcherUtils.close((Closeable)input); ++ } ++ ++ return var3; ++ } ++ ++ public static boolean writeJson(JsonElement json, File path) { ++ PrintWriter output = null; ++ boolean var4; ++ ++ try { ++ output = new PrintWriter(path); ++ Gson e = newGson(); ++ e.toJson(json, output); ++ output.println(); ++ var4 = true; ++ return var4; ++ } catch (Throwable var8) { ++ var8.printStackTrace(); ++ MCPatcherUtils.close((Closeable)output); ++ path.delete(); ++ var4 = false; ++ } finally { ++ MCPatcherUtils.close((Closeable)output); ++ } ++ ++ return var4; ++ } ++ ++ public static boolean writeJson(Object object, File path) { ++ PrintWriter output = null; ++ boolean var4; ++ ++ try { ++ output = new PrintWriter(path); ++ Gson e = newGson(); ++ e.toJson(object, object.getClass(), output); ++ output.println(); ++ var4 = true; ++ return var4; ++ } catch (Throwable var8) { ++ var8.printStackTrace(); ++ MCPatcherUtils.close((Closeable)output); ++ path.delete(); ++ var4 = false; ++ } finally { ++ MCPatcherUtils.close((Closeable)output); ++ } ++ ++ return var4; ++ } ++ ++ public static T cloneJson(T json) { ++ //return (new JsonParser()).parse(json.toString()); ++ return null; ++ } ++ ++ public static T cloneJson(T json, Class jsonClass) { ++ Gson gson = newGson(); ++ return gson.fromJson(gson.toJson(json, jsonClass), jsonClass); ++ } ++} diff --git a/patches/com/prupe/mcpatcher/MCLogger$1$1.java.patch b/patches/com/prupe/mcpatcher/MCLogger$1$1.java.patch new file mode 100644 index 0000000..7ccfb5f --- /dev/null +++ b/patches/com/prupe/mcpatcher/MCLogger$1$1.java.patch @@ -0,0 +1,34 @@ +--- /dev/null ++++ com/prupe/mcpatcher/MCLogger$1$1.java +@@ -1,0 +1,31 @@ ++package com.prupe.mcpatcher; ++ ++import com.prupe.mcpatcher.MCLogger$1; ++import java.util.logging.Formatter; ++import java.util.logging.Level; ++import java.util.logging.LogRecord; ++ ++class MCLogger$1$1 extends Formatter { ++ final MCLogger$1 this$1; ++ ++ MCLogger$1$1(MCLogger$1 var1) { ++ this.this$1 = var1; ++ } ++ ++ public String format(LogRecord record) { ++ Level level = record.getLevel(); ++ ++ if (level == Level.CONFIG) { ++ return record.getMessage(); ++ } else { ++ String message = record.getMessage(); ++ String prefix; ++ ++ for (prefix = ""; message.startsWith("\n"); message = message.substring(1)) { ++ prefix = prefix + "\n"; ++ } ++ ++ return prefix + "[" + MCLogger.access$000(this.this$1.this$0) + "] " + level.toString() + ": " + message; ++ } ++ } ++} diff --git a/patches/com/prupe/mcpatcher/MCLogger$1.java.patch b/patches/com/prupe/mcpatcher/MCLogger$1.java.patch new file mode 100644 index 0000000..443fbf9 --- /dev/null +++ b/patches/com/prupe/mcpatcher/MCLogger$1.java.patch @@ -0,0 +1,28 @@ +--- /dev/null ++++ com/prupe/mcpatcher/MCLogger$1.java +@@ -1,0 +1,25 @@ ++package com.prupe.mcpatcher; ++ ++import com.prupe.mcpatcher.MCLogger$1$1; ++import java.util.logging.Formatter; ++import java.util.logging.Handler; ++import java.util.logging.LogRecord; ++ ++class MCLogger$1 extends Handler { ++ private final Formatter formatter; ++ ++ final MCLogger this$0; ++ ++ MCLogger$1(MCLogger var1) { ++ this.this$0 = var1; ++ this.formatter = new MCLogger$1$1(this); ++ } ++ ++ public void publish(LogRecord record) { ++ System.out.println(this.formatter.format(record)); ++ } ++ ++ public void flush() {} ++ ++ public void close() throws SecurityException {} ++} diff --git a/patches/com/prupe/mcpatcher/MCLogger$ErrorLevel.java.patch b/patches/com/prupe/mcpatcher/MCLogger$ErrorLevel.java.patch new file mode 100644 index 0000000..e0e4758 --- /dev/null +++ b/patches/com/prupe/mcpatcher/MCLogger$ErrorLevel.java.patch @@ -0,0 +1,12 @@ +--- /dev/null ++++ com/prupe/mcpatcher/MCLogger$ErrorLevel.java +@@ -1,0 +1,9 @@ ++package com.prupe.mcpatcher; ++ ++import java.util.logging.Level; ++ ++class MCLogger$ErrorLevel extends Level { ++ protected MCLogger$ErrorLevel() { ++ super("ERROR", (Level.WARNING.intValue() + Level.SEVERE.intValue()) / 2); ++ } ++} diff --git a/patches/com/prupe/mcpatcher/MCLogger.java.patch b/patches/com/prupe/mcpatcher/MCLogger.java.patch new file mode 100644 index 0000000..3cc7a5f --- /dev/null +++ b/patches/com/prupe/mcpatcher/MCLogger.java.patch @@ -0,0 +1,159 @@ +--- /dev/null ++++ com/prupe/mcpatcher/MCLogger.java +@@ -1,0 +1,156 @@ ++package com.prupe.mcpatcher; ++ ++import com.prupe.mcpatcher.MCLogger$1; ++import com.prupe.mcpatcher.MCLogger$ErrorLevel; ++import java.util.HashMap; ++import java.util.logging.Level; ++import java.util.logging.Logger; ++ ++public class MCLogger { ++ private static final HashMap allLoggers = new HashMap(); ++ public static final Level ERROR = new MCLogger$ErrorLevel(); ++ private static final long FLOOD_INTERVAL = 1000L; ++ private static final long FLOOD_REPORT_INTERVAL = 5000L; ++ private static final int FLOOD_LIMIT = 100; ++ private static final int FLOOD_LEVEL = Level.CONFIG.intValue(); ++ private final String logPrefix; ++ private final Logger logger; ++ private boolean flooding; ++ private long lastFloodReport; ++ private int floodCount; ++ private long lastMessage = System.currentTimeMillis(); ++ private boolean enabled = false; ++ ++ public static MCLogger getLogger(String category) { ++ return getLogger(category, category); ++ } ++ ++ public static synchronized MCLogger getLogger(String category, String logPrefix) { ++ MCLogger logger = (MCLogger)allLoggers.get(category); ++ ++ if (logger == null) { ++ logger = new MCLogger(category, logPrefix); ++ allLoggers.put(category, logger); ++ } ++ ++ return logger; ++ } ++ ++ private MCLogger(String category, String logPrefix) { ++ this.logPrefix = logPrefix; ++ this.logger = Logger.getLogger(category); ++ this.logger.setLevel(Config.getLogLevel(category)); ++ this.logger.setUseParentHandlers(false); ++ this.logger.addHandler(new MCLogger$1(this)); ++ } ++ ++ private boolean checkFlood() { ++ long now = System.currentTimeMillis(); ++ boolean showFloodMessage = false; ++ ++ if (now - this.lastMessage > 1000L) { ++ if (this.flooding) { ++ this.reportFlooding(now); ++ this.flooding = false; ++ } else { ++ this.floodCount = 0; ++ } ++ } else if (this.flooding && now - this.lastFloodReport > 5000L) { ++ this.reportFlooding(now); ++ showFloodMessage = true; ++ } ++ ++ this.lastMessage = now; ++ ++this.floodCount; ++ ++ if (this.flooding) { ++ return showFloodMessage; ++ } else if (this.floodCount > 100) { ++ this.flooding = true; ++ this.lastFloodReport = now; ++ this.reportFlooding(now); ++ return false; ++ } else { ++ return true; ++ } ++ } ++ ++ private void reportFlooding(long now) { ++ if (this.floodCount > 0) { ++ this.logger.log(Level.WARNING, String.format("%d flood messages dropped in the last %ds", new Object[] {Integer.valueOf(this.floodCount), Long.valueOf((now - this.lastFloodReport) / 1000L)})); ++ } ++ ++ this.floodCount = 0; ++ this.lastFloodReport = now; ++ } ++ ++ public boolean isLoggable(Level level) { ++ return this.logger.isLoggable(level); ++ } ++ ++ public void setLevel(Level level) { ++ this.logger.setLevel(level); ++ } ++ ++ public void log(Level level, String format, Object ... params) { ++ if (this.isLoggable(level)) { ++ if (level.intValue() >= FLOOD_LEVEL && !this.checkFlood()) { ++ return; ++ } ++ ++ this.logger.log(level, String.format(format, params)); ++ } ++ } ++ ++ public void severe(String format, Object ... params) { ++ if (enabled) { ++ this.log(Level.SEVERE, format, params); ++ } ++ } ++ ++ public void error(String format, Object ... params) { ++ if (enabled) { ++ this.log(ERROR, format, params); ++ } ++ } ++ ++ public void warning(String format, Object ... params) { ++ if (enabled) { ++ this.log(Level.WARNING, format, params); ++ } ++ } ++ ++ public void info(String format, Object ... params) { ++ if (enabled) { ++ this.log(Level.INFO, format, params); ++ } ++ } ++ ++ public void config(String format, Object ... params) { ++ if (enabled) { ++ this.log(Level.CONFIG, format, params); ++ } ++ } ++ ++ public void fine(String format, Object ... params) { ++ if (enabled) { ++ this.log(Level.FINE, format, params); ++ } ++ } ++ ++ public void finer(String format, Object ... params) { ++ if (enabled) { ++ this.log(Level.FINER, format, params); ++ } ++ } ++ ++ public void finest(String format, Object ... params) { ++ if (enabled) { ++ this.log(Level.FINEST, format, params); ++ } ++ } ++ ++ static String access$000(MCLogger x0) { ++ return x0.logPrefix; ++ } ++} diff --git a/patches/com/prupe/mcpatcher/MCPatcherUtils.java.patch b/patches/com/prupe/mcpatcher/MCPatcherUtils.java.patch new file mode 100644 index 0000000..8d37daf --- /dev/null +++ b/patches/com/prupe/mcpatcher/MCPatcherUtils.java.patch @@ -0,0 +1,413 @@ +--- /dev/null ++++ com/prupe/mcpatcher/MCPatcherUtils.java +@@ -1,0 +1,410 @@ ++package com.prupe.mcpatcher; ++ ++import java.awt.image.BufferedImage; ++import java.io.Closeable; ++import java.io.File; ++import java.io.IOException; ++import java.io.InputStream; ++import java.lang.reflect.Method; ++import java.util.ArrayList; ++import java.util.Collection; ++import java.util.Map; ++import java.util.Properties; ++import java.util.regex.Matcher; ++import java.util.regex.Pattern; ++import java.util.zip.ZipFile; ++import javax.imageio.ImageIO; ++ ++public class MCPatcherUtils { ++ private static File minecraftDir; ++ private static File gameDir; ++ private static boolean isGame; ++ private static String minecraftVersion; ++ private static String patcherVersion; ++ public static final String EXTENDED_HD = "Extended HD"; ++ public static final String HD_TEXTURES = "HD Textures"; ++ public static final String HD_FONT = "HD Font"; ++ public static final String RANDOM_MOBS = "Random Mobs"; ++ public static final String CUSTOM_COLORS = "Custom Colors"; ++ public static final String CONNECTED_TEXTURES = "Connected Textures"; ++ public static final String BETTER_SKIES = "Better Skies"; ++ public static final String BETTER_GRASS = "Better Grass"; ++ public static final String BETTER_GLASS = "Better Glass"; ++ public static final String CUSTOM_ITEM_TEXTURES = "Custom Item Textures"; ++ public static final String GLSL_SHADERS = "GLSL Shaders"; ++ public static final String BASE_MOD = "__Base"; ++ public static final String BASE_TEXTURE_PACK_MOD = "__TexturePackBase"; ++ public static final String BASE_TILESHEET_MOD = "__TilesheetBase"; ++ public static final String NBT_MOD = "__NBT"; ++ public static final String CUSTOM_ANIMATIONS = "Custom Animations"; ++ public static final String MIPMAP = "Mipmap"; ++ public static final String GL11_CLASS = "org.lwjgl.opengl.GL11"; ++ public static final String UTILS_CLASS = "com.prupe.mcpatcher.MCPatcherUtils"; ++ public static final String LOGGER_CLASS = "com.prupe.mcpatcher.MCLogger"; ++ public static final String CONFIG_CLASS = "com.prupe.mcpatcher.Config"; ++ public static final String JSON_UTILS_CLASS = "com.prupe.mcpatcher.JsonUtils"; ++ public static final String PROFILER_API_CLASS = "com.prupe.mcpatcher.ProfilerAPI"; ++ public static final String INPUT_HANDLER_CLASS = "com.prupe.mcpatcher.InputHandler"; ++ public static final String TEXTURE_PACK_API_CLASS = "com.prupe.mcpatcher.TexturePackAPI"; ++ public static final String TEXTURE_PACK_CHANGE_HANDLER_CLASS = "com.prupe.mcpatcher.TexturePackChangeHandler"; ++ public static final String WEIGHTED_INDEX_CLASS = "com.prupe.mcpatcher.WeightedIndex"; ++ public static final String BLEND_METHOD_CLASS = "com.prupe.mcpatcher.BlendMethod"; ++ public static final String TILE_LOADER_CLASS = "com.prupe.mcpatcher.TileLoader"; ++ public static final String TESSELLATOR_UTILS_CLASS = "com.prupe.mcpatcher.TessellatorUtils"; ++ public static final String AA_HELPER_CLASS = "com.prupe.mcpatcher.hd.AAHelper"; ++ public static final String BORDERED_TEXTURE_CLASS = "com.prupe.mcpatcher.hd.BorderedTexture"; ++ public static final String CUSTOM_ANIMATION_CLASS = "com.prupe.mcpatcher.hd.CustomAnimation"; ++ public static final String FANCY_DIAL_CLASS = "com.prupe.mcpatcher.hd.FancyDial"; ++ public static final String FONT_UTILS_CLASS = "com.prupe.mcpatcher.hd.FontUtils"; ++ public static final String MIPMAP_HELPER_CLASS = "com.prupe.mcpatcher.hd.MipmapHelper"; ++ public static final String FANCY_COMPASS_CLASS = "com.prupe.mcpatcher.hd.FancyCompass"; ++ public static final String TEXTURE_UTILS_CLASS = "com.prupe.mcpatcher.hd.TextureUtils"; ++ public static final String TILE_SIZE_CLASS = "com.prupe.mcpatcher.hd.TileSize"; ++ public static final String NBT_RULE_CLASS = "com.prupe.mcpatcher.NBTRule"; ++ public static final String RANDOM_MOBS_CLASS = "com.prupe.mcpatcher.mob.MobRandomizer"; ++ public static final String MOB_RULE_LIST_CLASS = "com.prupe.mcpatcher.mob.MobRuleList"; ++ public static final String MOB_OVERLAY_CLASS = "com.prupe.mcpatcher.mob.MobOverlay"; ++ public static final String LINE_RENDERER_CLASS = "com.prupe.mcpatcher.mob.LineRenderer"; ++ public static final String COLORIZER_CLASS = "com.prupe.mcpatcher.cc.Colorizer"; ++ public static final String COLORIZE_WORLD_CLASS = "com.prupe.mcpatcher.cc.ColorizeWorld"; ++ public static final String COLORIZE_ITEM_CLASS = "com.prupe.mcpatcher.cc.ColorizeItem"; ++ public static final String COLORIZE_ENTITY_CLASS = "com.prupe.mcpatcher.cc.ColorizeEntity"; ++ public static final String COLORIZE_BLOCK_CLASS = "com.prupe.mcpatcher.cc.ColorizeBlock"; ++ public static final String COLOR_MAP_CLASS = "com.prupe.mcpatcher.cc.ColorMap"; ++ public static final String BIOME_HELPER_CLASS = "com.prupe.mcpatcher.cc.BiomeHelper"; ++ public static final String LIGHTMAP_CLASS = "com.prupe.mcpatcher.cc.Lightmap"; ++ public static final String CTM_UTILS_CLASS = "com.prupe.mcpatcher.ctm.CTMUtils"; ++ public static final String TILE_OVERRIDE_INTERFACE = "com.prupe.mcpatcher.ctm.ITileOverride"; ++ public static final String TILE_OVERRIDE_CLASS = "com.prupe.mcpatcher.ctm.TileOverride"; ++ public static final String TILE_OVERRIDE_IMPL_CLASS = "com.prupe.mcpatcher.ctm.TileOverrideImpl"; ++ public static final String GLASS_PANE_RENDERER_CLASS = "com.prupe.mcpatcher.ctm.GlassPaneRenderer"; ++ public static final String RENDER_PASS_CLASS = "com.prupe.mcpatcher.ctm.RenderPass"; ++ public static final String RENDER_PASS_API_CLASS = "com.prupe.mcpatcher.ctm.RenderPassAPI"; ++ public static final String SUPER_TESSELLATOR_CLASS = "com.prupe.mcpatcher.ctm.SuperTessellator"; ++ public static final String SKY_RENDERER_CLASS = "com.prupe.mcpatcher.sky.SkyRenderer"; ++ public static final String FIREWORKS_HELPER_CLASS = "com.prupe.mcpatcher.sky.FireworksHelper"; ++ public static final String CIT_UTILS_CLASS = "com.prupe.mcpatcher.cit.CITUtils"; ++ public static final String OVERRIDE_BASE_CLASS = "com.prupe.mcpatcher.cit.OverrideBase"; ++ public static final String ITEM_OVERRIDE_CLASS = "com.prupe.mcpatcher.cit.ItemOverride"; ++ public static final String ENCHANTMENT_CLASS = "com.prupe.mcpatcher.cit.Enchantment"; ++ public static final String ENCHANTMENT_LIST_CLASS = "com.prupe.mcpatcher.cit.EnchantmentList"; ++ public static final String ARMOR_OVERRIDE_CLASS = "com.prupe.mcpatcher.cit.ArmorOverride"; ++ public static final String POTION_REPLACER_CLASS = "com.prupe.mcpatcher.cit.PotionReplacer"; ++ public static final String SHADERS_CLASS = "com.prupe.mcpatcher.glsl.Shaders"; ++ public static final String BLANK_PNG = "mcpatcher/blank.png"; ++ ++ static File getDefaultGameDir() { ++ String os = System.getProperty("os.name").toLowerCase(); ++ String baseDir = null; ++ String subDir = ".minecraft"; ++ ++ if (os.contains("win")) { ++ baseDir = System.getenv("APPDATA"); ++ } else if (os.contains("mac")) { ++ subDir = "Library/Application Support/minecraft"; ++ } ++ ++ if (baseDir == null) { ++ baseDir = System.getProperty("user.home"); ++ } ++ ++ return new File(baseDir, subDir); ++ } ++ ++ static boolean setGameDir(File dir) { ++ if (dir != null && dir.isDirectory() && (new File(dir, "assets")).isDirectory() && (new File(dir, "libraries")).isDirectory() && (new File(dir, "versions")).isDirectory() && (new File(dir, "launcher_profiles.json")).isFile()) { ++ minecraftDir = dir.getAbsoluteFile(); ++ } else { ++ minecraftDir = null; ++ } ++ ++ gameDir = minecraftDir; ++ return minecraftDir != null && Config.load(minecraftDir, false); ++ } ++ ++ public static File getMinecraftPath(String ... subdirs) { ++ File f = minecraftDir; ++ String[] arr$ = subdirs; ++ int len$ = subdirs.length; ++ ++ for (int i$ = 0; i$ < len$; ++i$) { ++ String s = arr$[i$]; ++ f = new File(f, s); ++ } ++ ++ return f; ++ } ++ ++ public static File getGamePath(String ... subdirs) { ++ File f = gameDir; ++ String[] arr$ = subdirs; ++ int len$ = subdirs.length; ++ ++ for (int i$ = 0; i$ < len$; ++i$) { ++ String s = arr$[i$]; ++ f = new File(f, s); ++ } ++ ++ return f; ++ } ++ ++ public static boolean isGame() { ++ return isGame; ++ } ++ ++ public static String getStringProperty(Properties properties, String key, String defaultValue) { ++ return properties == null ? defaultValue : properties.getProperty(key, defaultValue).trim(); ++ } ++ ++ public static int getIntProperty(Properties properties, String key, int defaultValue) { ++ if (properties != null) { ++ String value = properties.getProperty(key, "").trim(); ++ ++ if (!value.equals("")) { ++ try { ++ return Integer.parseInt(value); ++ } catch (NumberFormatException var5) { ++ ; ++ } ++ } ++ } ++ ++ return defaultValue; ++ } ++ ++ public static boolean getBooleanProperty(Properties properties, String key, boolean defaultValue) { ++ if (properties != null) { ++ String value = properties.getProperty(key, "").trim().toLowerCase(); ++ ++ if (!value.equals("")) { ++ return Boolean.parseBoolean(value); ++ } ++ } ++ ++ return defaultValue; ++ } ++ ++ public static float getFloatProperty(Properties properties, String key, float defaultValue) { ++ if (properties != null) { ++ String value = properties.getProperty(key, "").trim(); ++ ++ if (!value.equals("")) { ++ try { ++ return Float.parseFloat(value); ++ } catch (NumberFormatException var5) { ++ ; ++ } ++ } ++ } ++ ++ return defaultValue; ++ } ++ ++ public static double getDoubleProperty(Properties properties, String key, double defaultValue) { ++ if (properties != null) { ++ String value = properties.getProperty(key, "").trim(); ++ ++ if (!value.equals("")) { ++ try { ++ return Double.parseDouble(value); ++ } catch (NumberFormatException var6) { ++ ; ++ } ++ } ++ } ++ ++ return defaultValue; ++ } ++ ++ public static void close(Closeable closeable) { ++ if (closeable != null) { ++ try { ++ closeable.close(); ++ } catch (IOException var2) { ++ var2.printStackTrace(); ++ } ++ } ++ } ++ ++ public static void close(ZipFile zip) { ++ if (zip != null) { ++ try { ++ zip.close(); ++ } catch (IOException var2) { ++ var2.printStackTrace(); ++ } ++ } ++ } ++ ++ public static boolean isNullOrEmpty(String s) { ++ return s == null || s.trim().isEmpty(); ++ } ++ ++ public static boolean isNullOrEmpty(Collection c) { ++ return c == null || c.isEmpty(); ++ } ++ ++ public static boolean isNullOrEmpty(Map m) { ++ return m == null || m.isEmpty(); ++ } ++ ++ public static void setMinecraft(File gameDir, File assetsDir, String minecraftVersion, String patcherVersion) { ++ isGame = true; ++ Config.setReadOnly(true); ++ boolean defaultMCDir; ++ ++ if (assetsDir == null) { ++ minecraftDir = getDefaultGameDir(); ++ defaultMCDir = true; ++ } else { ++ minecraftDir = assetsDir.getParentFile().getAbsoluteFile(); ++ defaultMCDir = false; ++ } ++ ++ boolean defaultGameDir; ++ ++ if (gameDir == null) { ++ gameDir = minecraftDir; ++ defaultGameDir = true; ++ } else { ++ gameDir = gameDir.getAbsoluteFile(); ++ defaultGameDir = false; ++ } ++ ++ minecraftVersion = minecraftVersion; ++ patcherVersion = patcherVersion; ++ System.out.println(); ++ System.out.printf("MCPatcherUtils initialized:\n", new Object[0]); ++ System.out.printf("Minecraft directory: %s%s\n", new Object[] {minecraftDir, defaultMCDir ? " (default)" : ""}); ++ System.out.printf("Game directory: %s%s\n", new Object[] {gameDir, defaultGameDir ? " (default)" : ""}); ++ System.out.printf("Minecraft version: %s\n", new Object[] {minecraftVersion}); ++ System.out.printf("MCPatcher version: %s\n", new Object[] {patcherVersion}); ++ System.out.printf("Max heap memory: %.1fMB\n", new Object[] {Float.valueOf((float)Runtime.getRuntime().maxMemory() / 1048576.0F)}); ++ ++ try { ++ Class e = Class.forName("sun.misc.VM"); ++ Method method = e.getDeclaredMethod("maxDirectMemory", new Class[0]); ++ long memory = ((Long)method.invoke((Object)null, new Object[0])).longValue(); ++ System.out.printf("Max direct memory: %.1fMB\n", new Object[] {Float.valueOf((float)memory / 1048576.0F)}); ++ } catch (Throwable var10) { ++ var10.printStackTrace(); ++ } ++ ++ Config.load(minecraftDir, true); ++ //System.out.printf("Launcher profile: %s\n", new Object[] {Config.getInstance().getSelectedProfileName()}); ++ System.out.println(); ++ } ++ ++ public static String getMinecraftVersion() { ++ return minecraftVersion; ++ } ++ ++ public static String getPatcherVersion() { ++ return patcherVersion; ++ } ++ ++ public static BufferedImage readImage(InputStream input) { ++ BufferedImage image = null; ++ ++ if (input != null) { ++ try { ++ image = ImageIO.read(input); ++ } catch (IOException var6) { ++ var6.printStackTrace(); ++ } finally { ++ close((Closeable)input); ++ } ++ } ++ ++ return image; ++ } ++ ++ public static Properties readProperties(InputStream input) { ++ Properties properties = new Properties(); ++ return readProperties(input, properties) ? properties : null; ++ } ++ ++ public static boolean readProperties(InputStream input, Properties properties) { ++ if (input != null && properties != null) { ++ boolean e; ++ ++ try { ++ properties.load(input); ++ e = true; ++ } catch (IOException var6) { ++ var6.printStackTrace(); ++ return false; ++ } finally { ++ close((Closeable)input); ++ } ++ ++ return e; ++ } else { ++ return false; ++ } ++ } ++ ++ public static int[] getImageRGB(BufferedImage image) { ++ if (image == null) { ++ return null; ++ } else { ++ int width = image.getWidth(); ++ int height = image.getHeight(); ++ int[] rgb = new int[width * height]; ++ image.getRGB(0, 0, width, height, rgb, 0, width); ++ return rgb; ++ } ++ } ++ ++ public static int[] parseIntegerList(String list, int minValue, int maxValue) { ++ ArrayList tmpList = new ArrayList(); ++ Pattern p = Pattern.compile("(\\d*)-(\\d*)"); ++ String[] a = list.replace(',', ' ').split("\\s+"); ++ int i = a.length; ++ ++ for (int i$ = 0; i$ < i; ++i$) { ++ String token = a[i$]; ++ ++ try { ++ if (token.matches("\\d+")) { ++ tmpList.add(Integer.valueOf(Integer.parseInt(token))); ++ } else { ++ Matcher e = p.matcher(token); ++ ++ if (e.matches()) { ++ String a1 = e.group(1); ++ String b = e.group(2); ++ int min = a1.equals("") ? minValue : Integer.parseInt(a1); ++ int max = b.equals("") ? maxValue : Integer.parseInt(b); ++ ++ for (int i1 = min; i1 <= max; ++i1) { ++ tmpList.add(Integer.valueOf(i1)); ++ } ++ } ++ } ++ } catch (NumberFormatException var15) { ++ ; ++ } ++ } ++ ++ if (minValue <= maxValue) { ++ int var16 = 0; ++ ++ while (var16 < tmpList.size()) { ++ if (((Integer)tmpList.get(var16)).intValue() >= minValue && ((Integer)tmpList.get(var16)).intValue() <= maxValue) { ++ ++var16; ++ } else { ++ tmpList.remove(var16); ++ } ++ } ++ } ++ ++ int[] var17 = new int[tmpList.size()]; ++ ++ for (i = 0; i < var17.length; ++i) { ++ var17[i] = ((Integer)tmpList.get(i)).intValue(); ++ } ++ ++ return var17; ++ } ++} diff --git a/patches/com/prupe/mcpatcher/ProfilerAPI.java.patch b/patches/com/prupe/mcpatcher/ProfilerAPI.java.patch new file mode 100644 index 0000000..8cc0a29 --- /dev/null +++ b/patches/com/prupe/mcpatcher/ProfilerAPI.java.patch @@ -0,0 +1,28 @@ +--- /dev/null ++++ com/prupe/mcpatcher/ProfilerAPI.java +@@ -1,0 +1,25 @@ ++package com.prupe.mcpatcher; ++ ++import net.minecraft.src.Minecraft; ++ ++public class ProfilerAPI { ++ private static final boolean enable = Config.getInstance().extraProfiling; ++ ++ public static void startSection(String name) { ++ if (enable) { ++ Minecraft.getMinecraft().mcProfiler.startSection(name); ++ } ++ } ++ ++ public static void endStartSection(String name) { ++ if (enable) { ++ Minecraft.getMinecraft().mcProfiler.endStartSection(name); ++ } ++ } ++ ++ public static void endSection() { ++ if (enable) { ++ Minecraft.getMinecraft().mcProfiler.endSection(); ++ } ++ } ++} diff --git a/patches/com/prupe/mcpatcher/TessellatorUtils.java.patch b/patches/com/prupe/mcpatcher/TessellatorUtils.java.patch new file mode 100644 index 0000000..f8199d6 --- /dev/null +++ b/patches/com/prupe/mcpatcher/TessellatorUtils.java.patch @@ -0,0 +1,207 @@ +--- /dev/null ++++ com/prupe/mcpatcher/TessellatorUtils.java +@@ -1,0 +1,204 @@ ++package com.prupe.mcpatcher; ++ ++import java.lang.reflect.Field; ++import java.lang.reflect.Modifier; ++import java.util.ArrayList; ++import java.util.HashMap; ++import java.util.Iterator; ++import java.util.Map; ++import java.util.WeakHashMap; ++import net.minecraft.src.Icon; ++import net.minecraft.src.Tessellator; ++import net.minecraft.src.TextureMap; ++ ++public class TessellatorUtils { ++ private static final MCLogger logger = MCLogger.getLogger("Tilesheet"); ++ private static final Integer MAGIC_VALUE = Integer.valueOf(305419896); ++ private static final Map textureMapNames = new WeakHashMap(); ++ private static final Map iconMap = new HashMap(); ++ private static Field[] fieldsToCopy; ++ public static boolean haveBufferSize; ++ ++ public static void clearDefaultTextureMap(Tessellator tessellator) { ++ tessellator.textureMap = null; ++ } ++ ++ public static Tessellator getTessellator(Tessellator tessellator, Icon icon) { ++ TextureMap textureMap = (TextureMap)iconMap.get(icon); ++ ++ if (textureMap == null) { ++ return tessellator; ++ } else { ++ Tessellator newTessellator = (Tessellator)tessellator.children.get(textureMap); ++ ++ if (newTessellator == null) { ++ String mapName = (String)textureMapNames.get(textureMap); ++ ++ if (mapName == null) { ++ mapName = textureMap.toString(); ++ } ++ ++ logger.fine("new Tessellator for texture map %s gl texture %d", new Object[] {mapName, Integer.valueOf(textureMap.glTextureId)}); ++ newTessellator = new Tessellator(2097152); ++ copyFields(tessellator, newTessellator, true); ++ newTessellator.textureMap = textureMap; ++ tessellator.children.put(textureMap, newTessellator); ++ } else { ++ copyFields(tessellator, newTessellator, false); ++ } ++ ++ return newTessellator; ++ } ++ } ++ ++ static void registerTextureMap(TextureMap textureMap, String name) { ++ textureMapNames.put(textureMap, name); ++ } ++ ++ static void registerIcon(TextureMap textureMap, Icon icon) { ++ iconMap.put(icon, textureMap); ++ } ++ ++ private static Field[] getFieldsToCopy(Tessellator tessellator) { ++ int saveBufferSize; ++ ++ if (haveBufferSize) { ++ saveBufferSize = tessellator.bufferSize; ++ tessellator.bufferSize = MAGIC_VALUE.intValue(); ++ } else { ++ saveBufferSize = 0; ++ } ++ ++ int saveVertexCount = tessellator.vertexCount; ++ int saveAddedVertices = tessellator.addedVertices; ++ int saveRawBufferIndex = tessellator.rawBufferIndex; ++ tessellator.vertexCount = MAGIC_VALUE.intValue(); ++ tessellator.addedVertices = MAGIC_VALUE.intValue(); ++ tessellator.rawBufferIndex = MAGIC_VALUE.intValue(); ++ ArrayList fields = new ArrayList(); ++ Field[] arr$ = Tessellator.class.getDeclaredFields(); ++ int len$ = arr$.length; ++ ++ for (int i$ = 0; i$ < len$; ++i$) { ++ Field f = arr$[i$]; ++ ++ try { ++ Class e = f.getType(); ++ int modifiers = f.getModifiers(); ++ ++ if (!Modifier.isStatic(modifiers) && e.isPrimitive() && !f.getName().equals("rawBufferSize")) { ++ f.setAccessible(true); ++ ++ if (e != Integer.TYPE || !MAGIC_VALUE.equals(f.get(tessellator))) { ++ logger.finest("copy %s %s %s", new Object[] {Modifier.toString(f.getModifiers()), f.getType().toString(), f.getName()}); ++ fields.add(f); ++ } ++ } ++ } catch (Throwable var12) { ++ var12.printStackTrace(); ++ } ++ } ++ ++ if (!haveBufferSize) { ++ tessellator.bufferSize = saveBufferSize; ++ } ++ ++ tessellator.vertexCount = saveVertexCount; ++ tessellator.addedVertices = saveAddedVertices; ++ tessellator.rawBufferIndex = saveRawBufferIndex; ++ return (Field[])fields.toArray(new Field[fields.size()]); ++ } ++ ++ private static void copyFields(Tessellator a, Tessellator b, boolean isNew) { ++ if (fieldsToCopy == null) { ++ fieldsToCopy = getFieldsToCopy(a); ++ } ++ ++ Field[] arr$ = fieldsToCopy; ++ int len$ = arr$.length; ++ ++ for (int i$ = 0; i$ < len$; ++i$) { ++ Field field = arr$[i$]; ++ ++ try { ++ Object e = field.get(a); ++ ++ if (isNew) { ++ logger.finest("copy %s %s %s = %s", new Object[] {Modifier.toString(field.getModifiers()), field.getType(), field.getName(), e}); ++ } ++ ++ field.set(b, e); ++ } catch (IllegalAccessException var8) { ++ var8.printStackTrace(); ++ } ++ } ++ ++ if (a.isDrawing && !b.isDrawing) { ++ b.startDrawing(a.drawMode); ++ } else if (!a.isDrawing && b.isDrawing) { ++ b.reset(); ++ } ++ } ++ ++ static void clear(Tessellator tessellator) { ++ Iterator i$ = tessellator.children.values().iterator(); ++ ++ while (i$.hasNext()) { ++ Tessellator child = (Tessellator)i$.next(); ++ clear(child); ++ } ++ ++ tessellator.children.clear(); ++ textureMapNames.clear(); ++ iconMap.clear(); ++ } ++ ++ public static void resetChildren(Tessellator tessellator) { ++ Iterator i$ = tessellator.children.values().iterator(); ++ ++ while (i$.hasNext()) { ++ Tessellator child = (Tessellator)i$.next(); ++ child.reset(); ++ } ++ } ++ ++ public static int drawChildren(int sum, Tessellator tessellator) { ++ Tessellator child; ++ ++ for (Iterator i$ = tessellator.children.values().iterator(); i$.hasNext(); sum += child.draw()) { ++ child = (Tessellator)i$.next(); ++ } ++ ++ return sum; ++ } ++ ++ public static void startDrawingChildren(Tessellator tessellator, int drawMode) { ++ Iterator i$ = tessellator.children.values().iterator(); ++ ++ while (i$.hasNext()) { ++ Tessellator child = (Tessellator)i$.next(); ++ child.startDrawing(drawMode); ++ } ++ } ++ ++ private static String toString(Tessellator tessellator) { ++ if (tessellator == null) { ++ return "Tessellator{null}"; ++ } else { ++ String desc = tessellator.toString(); ++ TextureMap textureMap = tessellator.textureMap; ++ ++ if (textureMap != null) { ++ String mapName = (String)textureMapNames.get(textureMap); ++ ++ if (mapName == null) { ++ desc = textureMap.toString(); ++ } else { ++ desc = mapName; ++ } ++ } ++ ++ return String.format("Tessellator{%s, isDrawing=%s, %d children}", new Object[] {desc, Boolean.valueOf(tessellator.isDrawing), Integer.valueOf(tessellator.children.size())}); ++ } ++ } ++} diff --git a/patches/com/prupe/mcpatcher/TexturePackAPI$1.java.patch b/patches/com/prupe/mcpatcher/TexturePackAPI$1.java.patch new file mode 100644 index 0000000..98aac84 --- /dev/null +++ b/patches/com/prupe/mcpatcher/TexturePackAPI$1.java.patch @@ -0,0 +1,35 @@ +--- /dev/null ++++ com/prupe/mcpatcher/TexturePackAPI$1.java +@@ -1,0 +1,32 @@ ++package com.prupe.mcpatcher; ++ ++import java.util.Comparator; ++import net.minecraft.src.ResourceLocation; ++ ++final class TexturePackAPI$1 implements Comparator { ++ final boolean val$sortByFilename; ++ ++ TexturePackAPI$1(boolean var1) { ++ this.val$sortByFilename = var1; ++ } ++ ++ public int compare(ResourceLocation o1, ResourceLocation o2) { ++ String n1 = o1.getResourceDomain(); ++ String n2 = o2.getResourceDomain(); ++ int result = n1.compareTo(n2); ++ ++ if (result != 0) { ++ return result; ++ } else { ++ String f1 = o1.getResourcePath(); ++ String f2 = o2.getResourcePath(); ++ ++ if (this.val$sortByFilename) { ++ f1 = f1.replaceAll(".*/", "").replaceFirst("\\.properties", ""); ++ f2 = f2.replaceAll(".*/", "").replaceFirst("\\.properties", ""); ++ } ++ ++ return f1.compareTo(f2); ++ } ++ } ++} diff --git a/patches/com/prupe/mcpatcher/TexturePackAPI$2.java.patch b/patches/com/prupe/mcpatcher/TexturePackAPI$2.java.patch new file mode 100644 index 0000000..85d2909 --- /dev/null +++ b/patches/com/prupe/mcpatcher/TexturePackAPI$2.java.patch @@ -0,0 +1,13 @@ +--- /dev/null ++++ com/prupe/mcpatcher/TexturePackAPI$2.java +@@ -1,0 +1,10 @@ ++package com.prupe.mcpatcher; ++ ++import java.util.Comparator; ++import net.minecraft.src.ResourceLocation; ++ ++final class TexturePackAPI$2 implements Comparator { ++ public int compare(ResourceLocation o1, ResourceLocation o2) { ++ return o1.getResourcePath().compareTo(o2.getResourcePath()); ++ } ++} diff --git a/patches/com/prupe/mcpatcher/TexturePackAPI.java.patch b/patches/com/prupe/mcpatcher/TexturePackAPI.java.patch new file mode 100644 index 0000000..f5d1ce6 --- /dev/null +++ b/patches/com/prupe/mcpatcher/TexturePackAPI.java.patch @@ -0,0 +1,373 @@ +--- /dev/null ++++ com/prupe/mcpatcher/TexturePackAPI.java +@@ -1,0 +1,370 @@ ++package com.prupe.mcpatcher; ++ ++import com.prupe.mcpatcher.TexturePackAPI$1; ++import java.awt.image.BufferedImage; ++import java.io.Closeable; ++import java.io.File; ++import java.io.IOException; ++import java.io.InputStream; ++import java.util.ArrayList; ++import java.util.Collection; ++import java.util.Collections; ++import java.util.HashSet; ++import java.util.Iterator; ++import java.util.List; ++import java.util.Properties; ++import java.util.Set; ++import java.util.Map.Entry; ++import java.util.regex.Pattern; ++import java.util.zip.ZipEntry; ++import java.util.zip.ZipFile; ++import javax.imageio.ImageIO; ++import net.minecraft.src.AbstractResourcePack; ++import net.minecraft.src.AbstractTexture; ++import net.minecraft.src.DefaultResourcePack; ++import net.minecraft.src.DynamicTexture; ++import net.minecraft.src.FallbackResourceManager; ++import net.minecraft.src.FileResourcePack; ++import net.minecraft.src.Minecraft; ++import net.minecraft.src.ResourceLocation; ++import net.minecraft.src.ResourceManager; ++import net.minecraft.src.ResourcePack; ++import net.minecraft.src.SimpleReloadableResourceManager; ++import net.minecraft.src.TextureManager; ++import net.minecraft.src.TextureMap; ++import net.minecraft.src.TextureObject; ++import org.lwjgl.opengl.GL11; ++ ++public class TexturePackAPI { ++ private static final MCLogger logger = MCLogger.getLogger("Texture Pack"); ++ public static final String DEFAULT_NAMESPACE = "minecraft"; ++ public static final String MCPATCHER_SUBDIR = "mcpatcher/"; ++ public static TexturePackAPI instance = new TexturePackAPI(); ++ ++ public static List getResourcePacks(String namespace) { ++ ArrayList list = new ArrayList(); ++ ResourceManager resourceManager = getResourceManager(); ++ ++ if (resourceManager instanceof SimpleReloadableResourceManager) { ++ Iterator i$ = ((SimpleReloadableResourceManager)resourceManager).domainResourceManagers.entrySet().iterator(); ++ ++ while (i$.hasNext()) { ++ Entry entry = (Entry)i$.next(); ++ ++ if (namespace == null || namespace.equals(entry.getKey())) { ++ FallbackResourceManager resourceManager1 = (FallbackResourceManager)entry.getValue(); ++ list.addAll(resourceManager1.resourcePacks); ++ } ++ } ++ } ++ ++ Collections.reverse(list); ++ return list; ++ } ++ ++ public static Set getNamespaces() { ++ HashSet set = new HashSet(); ++ ResourceManager resourceManager = getResourceManager(); ++ ++ if (resourceManager instanceof SimpleReloadableResourceManager) { ++ set.addAll(((SimpleReloadableResourceManager)resourceManager).domainResourceManagers.keySet()); ++ } ++ ++ return set; ++ } ++ ++ public static ResourceManager getResourceManager() { ++ return Minecraft.getMinecraft().getResourceManager(); ++ } ++ ++ public static boolean isDefaultTexturePack() { ++ return getResourcePacks("minecraft").size() <= 1; ++ } ++ ++ public static InputStream getInputStream(ResourceLocation resource) { ++ return resource == null ? null : instance.getInputStreamImpl(resource); ++ } ++ ++ public static boolean hasResource(ResourceLocation resource) { ++ if (resource == null) { ++ return false; ++ } else if (resource.getResourcePath().endsWith(".png")) { ++ return getImage(resource) != null; ++ } else if (resource.getResourcePath().endsWith(".properties")) { ++ return getProperties(resource) != null; ++ } else { ++ InputStream is = getInputStream(resource); ++ MCPatcherUtils.close((Closeable)is); ++ return is != null; ++ } ++ } ++ ++ public static BufferedImage getImage(ResourceLocation resource) { ++ return resource == null ? null : instance.getImageImpl(resource); ++ } ++ ++ public static Properties getProperties(ResourceLocation resource) { ++ Properties properties = new Properties(); ++ return getProperties(resource, properties) ? properties : null; ++ } ++ ++ public static boolean getProperties(ResourceLocation resource, Properties properties) { ++ return resource != null && instance.getPropertiesImpl(resource, properties); ++ } ++ ++ public static ResourceLocation transformResourceLocation(ResourceLocation resource, String oldExt, String newExt) { ++ return new ResourceLocation(resource.getResourceDomain(), resource.getResourcePath().replaceFirst(Pattern.quote(oldExt) + "$", newExt)); ++ } ++ ++ public static ResourceLocation parseResourceLocation(ResourceLocation baseResource, String path) { ++ if (path != null && !path.equals("")) { ++ boolean absolute = false; ++ ++ if (path.startsWith("%blur%")) { ++ path = path.substring(6); ++ } ++ ++ if (path.startsWith("%clamp%")) { ++ path = path.substring(7); ++ } ++ ++ if (path.startsWith("/")) { ++ path = path.substring(1); ++ absolute = true; ++ } ++ ++ if (path.startsWith("assets/minecraft/")) { ++ path = path.substring(17); ++ absolute = true; ++ } ++ ++ int colon = path.indexOf(58); ++ return colon >= 0 ? new ResourceLocation(path.substring(0, colon), path.substring(colon + 1)) : (path.startsWith("~/") ? new ResourceLocation(baseResource.getResourceDomain(), "mcpatcher/" + path.substring(2)) : (path.startsWith("./") ? new ResourceLocation(baseResource.getResourceDomain(), baseResource.getResourcePath().replaceFirst("[^/]+$", "") + path.substring(2)) : (!absolute && !path.contains("/") ? new ResourceLocation(baseResource.getResourceDomain(), baseResource.getResourcePath().replaceFirst("[^/]+$", "") + path) : new ResourceLocation(baseResource.getResourceDomain(), path)))); ++ } else { ++ return null; ++ } ++ } ++ ++ public static ResourceLocation newMCPatcherResourceLocation(String path) { ++ return new ResourceLocation("mcpatcher/" + path); ++ } ++ ++ public static List listResources(String directory, String suffix, boolean recursive, boolean directories, boolean sortByFilename) { ++ return listResources((String)null, directory, suffix, recursive, directories, sortByFilename); ++ } ++ ++ public static List listResources(String namespace, String directory, String suffix, boolean recursive, boolean directories, boolean sortByFilename) { ++ if (suffix == null) { ++ suffix = ""; ++ } ++ ++ ArrayList resources = new ArrayList(); ++ ++ if (MCPatcherUtils.isNullOrEmpty(namespace)) { ++ Iterator i$ = getNamespaces().iterator(); ++ ++ while (i$.hasNext()) { ++ String namespace1 = (String)i$.next(); ++ findResources(namespace1, directory, suffix, recursive, directories, resources); ++ } ++ } else { ++ findResources(namespace, directory, suffix, recursive, directories, resources); ++ } ++ ++ Collections.sort(resources, new TexturePackAPI$1(sortByFilename)); ++ return resources; ++ } ++ ++ private static void findResources(String namespace, String directory, String suffix, boolean recursive, boolean directories, Collection resources) { ++ Iterator i$ = getResourcePacks(namespace).iterator(); ++ ++ while (i$.hasNext()) { ++ ResourcePack resourcePack = (ResourcePack)i$.next(); ++ ++ if (resourcePack instanceof FileResourcePack) { ++ ZipFile base = ((FileResourcePack)resourcePack).resourcePackZipFile; ++ ++ if (base != null) { ++ findResources(base, namespace, "assets/" + namespace, directory, suffix, recursive, directories, resources); ++ } ++ } else { ++ File base1; ++ ++ if (resourcePack instanceof DefaultResourcePack) { ++ if ("minecraft".equals(namespace)) { ++ base1 = ((DefaultResourcePack)resourcePack).fileAssets; ++ ++ if (base1 != null && base1.isDirectory()) { ++ findResources(base1, namespace, directory, suffix, recursive, directories, resources); ++ } ++ } ++ } else if (resourcePack instanceof AbstractResourcePack) { ++ base1 = ((AbstractResourcePack)resourcePack).resourcePackFile; ++ ++ if (base1 != null && base1.isDirectory()) { ++ base1 = new File(base1, "assets/" + namespace); ++ ++ if (base1.isDirectory()) { ++ findResources(base1, namespace, directory, suffix, recursive, directories, resources); ++ } ++ } ++ } ++ } ++ } ++ } ++ ++ private static void findResources(ZipFile zipFile, String namespace, String root, String directory, String suffix, boolean recursive, boolean directories, Collection resources) { ++ String base = root + "/" + directory; ++ Iterator i$ = Collections.list(zipFile.entries()).iterator(); ++ ++ while (i$.hasNext()) { ++ ZipEntry entry = (ZipEntry)i$.next(); ++ ++ if (entry.isDirectory() == directories) { ++ String name = entry.getName().replaceFirst("^/", ""); ++ ++ if (name.startsWith(base) && name.endsWith(suffix)) { ++ if (directory.equals("")) { ++ if (recursive || !name.contains("/")) { ++ resources.add(new ResourceLocation(namespace, name)); ++ } ++ } else { ++ String subpath = name.substring(base.length()); ++ ++ if ((subpath.equals("") || subpath.startsWith("/")) && (recursive || subpath.equals("") || !subpath.substring(1).contains("/"))) { ++ resources.add(new ResourceLocation(namespace, name.substring(root.length() + 1))); ++ } ++ } ++ } ++ } ++ } ++ } ++ ++ private static void findResources(File base, String namespace, String directory, String suffix, boolean recursive, boolean directories, Collection resources) { ++ File subdirectory = new File(base, directory); ++ String[] list = subdirectory.list(); ++ ++ if (list != null) { ++ String pathComponent = directory.equals("") ? "" : directory + "/"; ++ String[] arr$ = list; ++ int len$ = list.length; ++ ++ for (int i$ = 0; i$ < len$; ++i$) { ++ String s = arr$[i$]; ++ File entry = new File(subdirectory, s); ++ String resourceName = pathComponent + s; ++ ++ if (entry.isDirectory()) { ++ if (directories && s.endsWith(suffix)) { ++ resources.add(new ResourceLocation(namespace, resourceName)); ++ } ++ ++ if (recursive) { ++ findResources(base, namespace, pathComponent + s, suffix, recursive, directories, resources); ++ } ++ } else if (s.endsWith(suffix) && !directories) { ++ resources.add(new ResourceLocation(namespace, resourceName)); ++ } ++ } ++ } ++ } ++ ++ public static int getTextureIfLoaded(ResourceLocation resource) { ++ if (resource == null) { ++ return -1; ++ } else { ++ TextureObject texture = Minecraft.getMinecraft().getTextureManager().getTexture(resource); ++ return texture instanceof AbstractTexture ? ((AbstractTexture)texture).glTextureId : -1; ++ } ++ } ++ ++ public static boolean isTextureLoaded(ResourceLocation resource) { ++ return getTextureIfLoaded(resource) >= 0; ++ } ++ ++ public static TextureObject getTextureObject(ResourceLocation resource) { ++ return Minecraft.getMinecraft().getTextureManager().getTexture(resource); ++ } ++ ++ public static void bindTexture(ResourceLocation resource) { ++ Minecraft.getMinecraft().getTextureManager().bindTexture(resource); ++ } ++ ++ public static void bindTexture(int texture) { ++ if (texture >= 0) { ++ GL11.glBindTexture(GL11.GL_TEXTURE_2D, texture); ++ } ++ } ++ ++ public static void unloadTexture(ResourceLocation resource) { ++ TextureManager textureManager = Minecraft.getMinecraft().getTextureManager(); ++ TextureObject texture = textureManager.getTexture(resource); ++ ++ if (texture != null && !(texture instanceof TextureMap) && !(texture instanceof DynamicTexture)) { ++ if (texture instanceof AbstractTexture) { ++ ((AbstractTexture)texture).unloadGLTexture(); ++ } ++ ++ logger.finer("unloading texture %s", new Object[] {resource}); ++ textureManager.mapTextureObjects.remove(resource); ++ } ++ } ++ ++ public static void deleteTexture(int texture) { ++ if (texture >= 0) { ++ GL11.glDeleteTextures(texture); ++ } ++ } ++ ++ protected InputStream getInputStreamImpl(ResourceLocation resource) { ++ try { ++ return Minecraft.getMinecraft().getResourceManager().getResource(resource).getInputStream(); ++ } catch (IOException var3) { ++ return null; ++ } ++ } ++ ++ protected BufferedImage getImageImpl(ResourceLocation resource) { ++ InputStream input = getInputStream(resource); ++ BufferedImage image = null; ++ ++ if (input != null) { ++ try { ++ image = ImageIO.read(input); ++ } catch (IOException var8) { ++ logger.error("could not read %s", new Object[] {resource}); ++ var8.printStackTrace(); ++ } finally { ++ MCPatcherUtils.close((Closeable)input); ++ } ++ } ++ ++ return image; ++ } ++ ++ protected boolean getPropertiesImpl(ResourceLocation resource, Properties properties) { ++ if (properties != null) { ++ InputStream input = getInputStream(resource); ++ boolean e; ++ ++ try { ++ if (input == null) { ++ return false; ++ } ++ ++ properties.load(input); ++ e = true; ++ } catch (IOException var8) { ++ logger.error("could not read %s", new Object[] {resource}); ++ var8.printStackTrace(); ++ return false; ++ } finally { ++ MCPatcherUtils.close((Closeable)input); ++ } ++ ++ return e; ++ } else { ++ return false; ++ } ++ } ++} diff --git a/patches/com/prupe/mcpatcher/TexturePackChangeHandler$1.java.patch b/patches/com/prupe/mcpatcher/TexturePackChangeHandler$1.java.patch new file mode 100644 index 0000000..1f27ad1 --- /dev/null +++ b/patches/com/prupe/mcpatcher/TexturePackChangeHandler$1.java.patch @@ -0,0 +1,12 @@ +--- /dev/null ++++ com/prupe/mcpatcher/TexturePackChangeHandler$1.java +@@ -1,0 +1,9 @@ ++package com.prupe.mcpatcher; ++ ++import java.util.Comparator; ++ ++final class TexturePackChangeHandler$1 implements Comparator { ++ public int compare(TexturePackChangeHandler o1, TexturePackChangeHandler o2) { ++ return o1.order - o2.order; ++ } ++} diff --git a/patches/com/prupe/mcpatcher/TexturePackChangeHandler.java.patch b/patches/com/prupe/mcpatcher/TexturePackChangeHandler.java.patch new file mode 100644 index 0000000..ba05e26 --- /dev/null +++ b/patches/com/prupe/mcpatcher/TexturePackChangeHandler.java.patch @@ -0,0 +1,221 @@ +--- /dev/null ++++ com/prupe/mcpatcher/TexturePackChangeHandler.java +@@ -1,0 +1,218 @@ ++package com.prupe.mcpatcher; ++ ++import com.prupe.mcpatcher.TexturePackChangeHandler$1; ++import java.util.ArrayList; ++import java.util.Collections; ++import java.util.HashSet; ++import java.util.Iterator; ++import java.util.List; ++import java.util.Set; ++import java.util.Map.Entry; ++import net.minecraft.src.Minecraft; ++import net.minecraft.src.ResourceLocation; ++import net.minecraft.src.ResourcePack; ++import net.minecraft.src.SimpleTexture; ++import net.minecraft.src.TextureManager; ++import net.minecraft.src.TextureObject; ++ ++public abstract class TexturePackChangeHandler { ++ private static final MCLogger logger = MCLogger.getLogger("Texture Pack"); ++ private static final ArrayList handlers = new ArrayList(); ++ private static boolean initializing; ++ private static boolean changing; ++ private static long startTime; ++ private static long startMem; ++ private boolean updateNeeded; ++ protected final String name; ++ protected final int order; ++ ++ public TexturePackChangeHandler(String name, int order) { ++ this.name = name; ++ this.order = order; ++ } ++ ++ public void initialize() { ++ this.beforeChange(); ++ this.afterChange(); ++ } ++ ++ public void refresh() { ++ this.beforeChange(); ++ this.afterChange(); ++ } ++ ++ public abstract void beforeChange(); ++ ++ public abstract void afterChange(); ++ ++ public void afterChange2() {} ++ ++ protected void setUpdateNeeded(boolean updateNeeded) { ++ this.updateNeeded = updateNeeded; ++ } ++ ++ public static void scheduleTexturePackRefresh() { ++ // ToDO: ++ //Minecraft.getMinecraft().scheduleTexturePackRefresh(); ++ } ++ ++ public static void register(TexturePackChangeHandler handler) { ++ if (handler != null) { ++ if (Minecraft.getMinecraft().getResourceManager() != null) { ++ try { ++ logger.info("initializing %s...", new Object[] {handler.name}); ++ handler.initialize(); ++ } catch (Throwable var2) { ++ var2.printStackTrace(); ++ logger.severe("%s initialization failed", new Object[] {handler.name}); ++ } ++ } ++ ++ handlers.add(handler); ++ logger.fine("registered texture pack handler %s, priority %d", new Object[] {handler.name, Integer.valueOf(handler.order)}); ++ Collections.sort(handlers, new TexturePackChangeHandler$1()); ++ } ++ } ++ ++ public static void earlyInitialize(String className, String methodName) { ++ try { ++ logger.fine("calling %s.%s", new Object[] {className, methodName}); ++ Class.forName(className).getDeclaredMethod(methodName, new Class[0]).invoke((Object)null, new Object[0]); ++ } catch (Throwable var3) { ++ ; ++ } ++ } ++ ++ public static void checkForTexturePackChange() { ++ Iterator i$ = handlers.iterator(); ++ ++ while (i$.hasNext()) { ++ TexturePackChangeHandler handler = (TexturePackChangeHandler)i$.next(); ++ ++ if (handler.updateNeeded) { ++ handler.updateNeeded = false; ++ ++ try { ++ logger.info("refreshing %s...", new Object[] {handler.name}); ++ handler.refresh(); ++ } catch (Throwable var3) { ++ var3.printStackTrace(); ++ logger.severe("%s refresh failed", new Object[] {handler.name}); ++ } ++ } ++ } ++ } ++ ++ public static void beforeChange1(boolean initializing1) { ++ logger.finer("beforeChange1(%s) initializing=%s changing=%s", new Object[] {Boolean.valueOf(initializing1), Boolean.valueOf(initializing), Boolean.valueOf(changing)}); ++ ++ if (initializing1) { ++ logger.finer("skipping beforeChange1 because we are still initializing", new Object[0]); ++ initializing = true; ++ } else if (changing && !initializing) { ++ (new RuntimeException("unexpected recursive call to TexturePackChangeHandler")).printStackTrace(); ++ } else { ++ changing = true; ++ startTime = System.currentTimeMillis(); ++ Runtime runtime = Runtime.getRuntime(); ++ startMem = runtime.totalMemory() - runtime.freeMemory(); ++ List resourcePacks = TexturePackAPI.getResourcePacks((String)null); ++ logger.fine("%s resource packs (%d selected):", new Object[] {initializing ? "initializing" : "changing", Integer.valueOf(resourcePacks.size())}); ++ Iterator namespaces = resourcePacks.iterator(); ++ ++ while (namespaces.hasNext()) { ++ ResourcePack textureManager = (ResourcePack)namespaces.next(); ++ logger.fine("resource pack: %s", new Object[] {textureManager.getPackName()}); ++ } ++ ++ Set namespaces1 = TexturePackAPI.getNamespaces(); ++ logger.fine("%d resource namespaces:", new Object[] {Integer.valueOf(namespaces1.size())}); ++ Iterator textureManager1 = namespaces1.iterator(); ++ ++ while (textureManager1.hasNext()) { ++ String texturesToUnload = (String)textureManager1.next(); ++ logger.fine("namespace: %s", new Object[] {texturesToUnload}); ++ } ++ ++ textureManager1 = handlers.iterator(); ++ ++ while (textureManager1.hasNext()) { ++ TexturePackChangeHandler texturesToUnload1 = (TexturePackChangeHandler)textureManager1.next(); ++ ++ try { ++ logger.info("refreshing %s (pre)...", new Object[] {texturesToUnload1.name}); ++ texturesToUnload1.beforeChange(); ++ } catch (Throwable var10) { ++ var10.printStackTrace(); ++ logger.severe("%s.beforeChange failed", new Object[] {texturesToUnload1.name}); ++ } ++ } ++ ++ TextureManager textureManager2 = Minecraft.getMinecraft().getTextureManager(); ++ ++ if (textureManager2 != null) { ++ HashSet texturesToUnload2 = new HashSet(); ++ Iterator i$ = textureManager2.mapTextureObjects.entrySet().iterator(); ++ ++ while (i$.hasNext()) { ++ Entry resource = (Entry)i$.next(); ++ ResourceLocation resource1 = (ResourceLocation)resource.getKey(); ++ TextureObject texture = (TextureObject)resource.getValue(); ++ ++ if (texture instanceof SimpleTexture && !TexturePackAPI.hasResource(resource1)) { ++ texturesToUnload2.add(resource1); ++ } ++ } ++ ++ i$ = texturesToUnload2.iterator(); ++ ++ while (i$.hasNext()) { ++ ResourceLocation resource2 = (ResourceLocation)i$.next(); ++ TexturePackAPI.unloadTexture(resource2); ++ } ++ } ++ } ++ } ++ ++ public static void afterChange1(boolean initializing1) { ++ logger.finer("afterChange1(%s) initializing=%s changing=%s", new Object[] {Boolean.valueOf(initializing1), Boolean.valueOf(initializing), Boolean.valueOf(changing)}); ++ ++ if (initializing && !initializing1) { ++ logger.finer("deferring afterChange1 because we are still initializing", new Object[0]); ++ } else { ++ Iterator timeDiff = handlers.iterator(); ++ TexturePackChangeHandler handler; ++ ++ while (timeDiff.hasNext()) { ++ handler = (TexturePackChangeHandler)timeDiff.next(); ++ ++ try { ++ logger.info("refreshing %s (post)...", new Object[] {handler.name}); ++ handler.afterChange(); ++ } catch (Throwable var7) { ++ var7.printStackTrace(); ++ logger.severe("%s.afterChange failed", new Object[] {handler.name}); ++ } ++ } ++ ++ for (int var8 = handlers.size() - 1; var8 >= 0; --var8) { ++ handler = (TexturePackChangeHandler)handlers.get(var8); ++ ++ try { ++ handler.afterChange2(); ++ } catch (Throwable var6) { ++ var6.printStackTrace(); ++ logger.severe("%s.afterChange2 failed", new Object[] {handler.name}); ++ } ++ } ++ ++ System.gc(); ++ long var9 = System.currentTimeMillis() - startTime; ++ Runtime runtime = Runtime.getRuntime(); ++ long memDiff = runtime.totalMemory() - runtime.freeMemory() - startMem; ++ logger.info("done (%.3fs elapsed, mem usage %+.1fMB)\n", new Object[] {Double.valueOf((double)var9 / 1000.0D), Double.valueOf((double)memDiff / 1048576.0D)}); ++ changing = false; ++ initializing = false; ++ } ++ } ++} diff --git a/patches/com/prupe/mcpatcher/TileLoader$1.java.patch b/patches/com/prupe/mcpatcher/TileLoader$1.java.patch new file mode 100644 index 0000000..3034085 --- /dev/null +++ b/patches/com/prupe/mcpatcher/TileLoader$1.java.patch @@ -0,0 +1,89 @@ +--- /dev/null ++++ com/prupe/mcpatcher/TileLoader$1.java +@@ -1,0 +1,86 @@ ++package com.prupe.mcpatcher; ++ ++import java.io.IOException; ++import java.util.Iterator; ++ ++import net.minecraft.src.Tessellator; ++import net.minecraft.src.TextureMap; ++ ++final class TileLoader$1 extends TexturePackChangeHandler { ++ TileLoader$1(String x0, int x1) { ++ super(x0, x1); ++ } ++ ++ public void initialize() {} ++ ++ public void beforeChange() { ++ TileLoader.access$002(true); ++ TessellatorUtils.clear(Tessellator.instance); ++ Iterator i$ = TileLoader.access$100().iterator(); ++ ++ while (i$.hasNext()) { ++ TextureMap textureMap = (TextureMap)i$.next(); ++ ++ try { ++ textureMap.unloadGLTexture(); ++ } catch (Throwable var4) { ++ var4.printStackTrace(); ++ } ++ } ++ ++ TileLoader.access$100().clear(); ++ TileLoader.access$200().clear(); ++ TileLoader.access$300().clear(); ++ } ++ ++ public void afterChange() { ++ while (true) { ++ Iterator i$ = TileLoader.access$200().iterator(); ++ ++ while (true) { ++ if (i$.hasNext()) { ++ TileLoader loader = (TileLoader)i$.next(); ++ ++ if (TileLoader.access$400(loader).isEmpty()) { ++ continue; ++ } ++ ++ if (!loader.allowOverflow || TileLoader.access$500() <= 0) { ++ loader.subLogger.warning("could not load all %s tiles (%d remaining)", new Object[] {loader.mapName, Integer.valueOf(TileLoader.access$400(loader).size())}); ++ TileLoader.access$400(loader).clear(); ++ break; ++ } ++ ++ TileLoader.access$602(false); ++ String mapName = loader.mapName + "_overflow" + TileLoader.access$704(loader); ++ TileLoader.access$800().fine("new TextureAtlas(%s)", new Object[] {mapName}); ++ TextureMap map = new TextureMap(2, mapName); ++ try { ++ map.loadTexture(TexturePackAPI.getResourceManager()); ++ } catch (IOException e) { ++ // TODO Auto-generated catch block ++ e.printStackTrace(); ++ } ++ if (TileLoader.access$600()) { ++ TileLoader.access$100().add(map); ++ break; ++ } ++ ++ TileLoader.access$800().severe("TileLoader.registerIcons was never called! Possible conflict in TextureAtlas.class", new Object[0]); ++ } ++ ++ TileLoader.access$002(false); ++ return; ++ } ++ } ++ } ++ ++ public void afterChange2() { ++ Iterator i$ = TileLoader.access$200().iterator(); ++ ++ while (i$.hasNext()) { ++ TileLoader loader = (TileLoader)i$.next(); ++ loader.finish(); ++ } ++ } ++} diff --git a/patches/com/prupe/mcpatcher/TileLoader.java.patch b/patches/com/prupe/mcpatcher/TileLoader.java.patch new file mode 100644 index 0000000..5d9663f --- /dev/null +++ b/patches/com/prupe/mcpatcher/TileLoader.java.patch @@ -0,0 +1,408 @@ +--- /dev/null ++++ com/prupe/mcpatcher/TileLoader.java +@@ -1,0 +1,405 @@ ++package com.prupe.mcpatcher; ++ ++import com.prupe.mcpatcher.TileLoader$1; ++import java.awt.Color; ++import java.awt.Graphics; ++import java.awt.image.BufferedImage; ++import java.io.FileNotFoundException; ++import java.io.IOException; ++import java.util.ArrayList; ++import java.util.Collection; ++import java.util.HashMap; ++import java.util.HashSet; ++import java.util.Iterator; ++import java.util.List; ++import java.util.Map; ++import java.util.Set; ++import net.minecraft.src.Icon; ++import net.minecraft.src.Minecraft; ++import net.minecraft.src.ResourceLocation; ++import net.minecraft.src.Tessellator; ++import net.minecraft.src.TextureAtlasSprite; ++import net.minecraft.src.TextureMap; ++ ++public class TileLoader { ++ private static final MCLogger logger = MCLogger.getLogger("Tilesheet"); ++ private static final List loaders = new ArrayList(); ++ private static final ResourceLocation BLANK_RESOURCE = new ResourceLocation("mcpatcher/blank.png"); ++ private static final boolean debugTextures = Config.getBoolean("Connected Textures", "debugTextures", false); ++ private static final int splitTextures = Config.getInt("Connected Textures", "splitTextures", 1); ++ private static final Map specialTextures = new HashMap(); ++ private static final TexturePackChangeHandler changeHandler; ++ private static boolean changeHandlerCalled; ++ private static boolean registerIconsCalled; ++ private static final Set overflowMaps = new HashSet(); ++ private static final int OVERFLOW_TEXTURE_MAP_INDEX = 2; ++ private static final long MAX_TILESHEET_SIZE; ++ protected final String mapName; ++ protected final boolean allowOverflow; ++ protected final MCLogger subLogger; ++ private int overflowIndex; ++ private TextureMap baseTextureMap; ++ private Map baseTexturesByName; ++ private final Set tilesToRegister = new HashSet(); ++ private final Map tileImages = new HashMap(); ++ private final Map iconMap = new HashMap(); ++ ++ public static void registerIcons(TextureMap textureMap, String mapName, Map map) { ++ logger.fine("before registerIcons(%s) %d icons", new Object[] {mapName, Integer.valueOf(map.size())}); ++ mapName = mapName.replaceFirst("/$", ""); ++ registerIconsCalled = true; ++ ++ if (!changeHandlerCalled) { ++ logger.severe("beforeChange was not called, invoking directly", new Object[0]); ++ changeHandler.beforeChange(); ++ } ++ ++ TessellatorUtils.registerTextureMap(textureMap, mapName); ++ Iterator i$ = loaders.iterator(); ++ ++ while (i$.hasNext()) { ++ TileLoader loader = (TileLoader)i$.next(); ++ ++ if (loader.baseTextureMap == null && mapName.equals(loader.mapName)) { ++ loader.baseTextureMap = textureMap; ++ loader.baseTexturesByName = map; ++ } ++ ++ if (loader.isForThisMap(mapName) && !loader.tilesToRegister.isEmpty()) { ++ loader.subLogger.fine("adding icons to %s (%d remaining)", new Object[] {mapName, Integer.valueOf(loader.tilesToRegister.size()), mapName}); ++ ++ while (!loader.tilesToRegister.isEmpty() && loader.registerOneIcon(textureMap, mapName, map)) { ++ ; ++ } ++ ++ loader.subLogger.fine("done adding icons to %s (%d remaining)", new Object[] {mapName, Integer.valueOf(loader.tilesToRegister.size()), mapName}); ++ } ++ } ++ ++ logger.fine("after registerIcons(%s) %d icons", new Object[] {mapName, Integer.valueOf(map.size())}); ++ } ++ ++ public static String getOverridePath(String prefix, String name, String ext) { ++ String path; ++ ++ if (name.endsWith(".png")) { ++ path = name.replaceFirst("\\.[^.]+$", "") + ext; ++ } else { ++ path = prefix; ++ ++ if (!prefix.endsWith("/")) { ++ path = prefix + "/"; ++ } ++ ++ path = path + name; ++ path = path + ext; ++ } ++ ++ logger.finer("getOverridePath(%s, %s, %s) -> %s", new Object[] {prefix, name, ext, path}); ++ return path; ++ } ++ ++ public static boolean isSpecialTexture(TextureMap map, String texture, String special) { ++ return special.equals(texture) || special.equals(specialTextures.get(texture)); ++ } ++ ++ public static BufferedImage getOverrideImage(ResourceLocation resource) throws IOException { ++ Iterator i$ = loaders.iterator(); ++ BufferedImage image; ++ ++ do { ++ if (!i$.hasNext()) { ++ image = TexturePackAPI.getImage(resource); ++ ++ if (image == null) { ++ throw new FileNotFoundException(resource + " not found"); ++ } ++ ++ return image; ++ } ++ ++ TileLoader loader = (TileLoader)i$.next(); ++ image = (BufferedImage)loader.tileImages.get(resource); ++ } while (image == null); ++ ++ return image; ++ } ++ ++ public static void updateAnimations() { ++ Iterator i$ = overflowMaps.iterator(); ++ ++ while (i$.hasNext()) { ++ TextureMap textureMap = (TextureMap)i$.next(); ++ textureMap.updateAnimations(); ++ } ++ } ++ ++ public static BufferedImage generateDebugTexture(String text, int width, int height, boolean alternate) { ++ BufferedImage image = new BufferedImage(width, height, 2); ++ Graphics graphics = image.getGraphics(); ++ graphics.setColor(alternate ? new Color(0, 255, 255, 128) : Color.WHITE); ++ graphics.fillRect(0, 0, width, height); ++ graphics.setColor(alternate ? Color.RED : Color.BLACK); ++ int ypos = 10; ++ ++ if (alternate) { ++ ypos += height / 2; ++ } ++ ++ int charsPerRow = width / 8; ++ ++ if (charsPerRow <= 0) { ++ return image; ++ } else { ++ while (text.length() % charsPerRow != 0) { ++ text = text + " "; ++ } ++ ++ while (ypos < height && !text.equals("")) { ++ graphics.drawString(text.substring(0, charsPerRow), 1, ypos); ++ ypos += graphics.getFont().getSize(); ++ text = text.substring(charsPerRow); ++ } ++ ++ return image; ++ } ++ } ++ ++ static void init() {} ++ ++ public static ResourceLocation getBlocksAtlas() { ++ return TextureMap.locationBlocksTexture; ++ } ++ ++ public static ResourceLocation getItemsAtlas() { ++ return TextureMap.locationItemsTexture; ++ } ++ ++ public TileLoader(String mapName, boolean allowOverflow, MCLogger logger) { ++ this.mapName = mapName; ++ this.allowOverflow = allowOverflow; ++ this.subLogger = logger; ++ loaders.add(this); ++ } ++ ++ private static long getTextureSize(TextureAtlasSprite texture) { ++ return texture == null ? 0L : (long)(4 * texture.getIconWidth() * texture.getIconHeight()); ++ } ++ ++ private static long getTextureSize(Collection textures) { ++ long size = 0L; ++ TextureAtlasSprite texture; ++ ++ for (Iterator i$ = textures.iterator(); i$.hasNext(); size += getTextureSize(texture)) { ++ texture = (TextureAtlasSprite)i$.next(); ++ } ++ ++ return size; ++ } ++ ++ public static ResourceLocation getDefaultAddress(ResourceLocation propertiesAddress) { ++ return TexturePackAPI.transformResourceLocation(propertiesAddress, ".properties", ".png"); ++ } ++ ++ public static ResourceLocation parseTileAddress(ResourceLocation propertiesAddress, String value) { ++ if (value == null) { ++ return null; ++ } else if (value.equals("blank")) { ++ return BLANK_RESOURCE; ++ } else if (!value.equals("null") && !value.equals("none") && !value.equals("default") && !value.equals("")) { ++ if (!value.endsWith(".png")) { ++ value = value + ".png"; ++ } ++ ++ return TexturePackAPI.parseResourceLocation(propertiesAddress, value); ++ } else { ++ return null; ++ } ++ } ++ ++ public boolean preloadTile(ResourceLocation resource, boolean alternate, String special) { ++ if (this.tileImages.containsKey(resource)) { ++ return true; ++ } else { ++ BufferedImage image = null; ++ ++ if (!debugTextures) { ++ image = TexturePackAPI.getImage(resource); ++ ++ if (image == null) { ++ this.subLogger.warning("missing %s", new Object[] {resource}); ++ } ++ } ++ ++ if (image == null) { ++ image = generateDebugTexture(resource.getResourcePath(), 64, 64, alternate); ++ } ++ ++ this.tilesToRegister.add(resource); ++ this.tileImages.put(resource, image); ++ ++ if (special != null) { ++ specialTextures.put(resource.toString(), special); ++ } ++ ++ return true; ++ } ++ } ++ ++ public boolean preloadTile(ResourceLocation resource, boolean alternate) { ++ return this.preloadTile(resource, alternate, (String)null); ++ } ++ ++ protected boolean isForThisMap(String mapName) { ++ return this.allowOverflow && splitTextures > 1 ? mapName.startsWith(this.mapName + "_overflow") : mapName.startsWith(this.mapName); ++ } ++ ++ private boolean registerDefaultIcon(String name) { ++ if (name.startsWith(this.mapName) && name.endsWith(".png") && this.baseTextureMap != null) { ++ String defaultName = name.substring(this.mapName.length()).replaceFirst("\\.png$", ""); ++ TextureAtlasSprite texture = (TextureAtlasSprite)this.baseTexturesByName.get(defaultName); ++ ++ if (texture != null) { ++ this.subLogger.finer("%s -> existing icon %s", new Object[] {name, defaultName}); ++ this.iconMap.put(name, texture); ++ return true; ++ } ++ } ++ ++ return false; ++ } ++ ++ private boolean registerOneIcon(TextureMap textureMap, String mapName, Map map) { ++ ResourceLocation resource = (ResourceLocation)this.tilesToRegister.iterator().next(); ++ String name = resource.toString(); ++ ++ if (this.registerDefaultIcon(name)) { ++ this.tilesToRegister.remove(resource); ++ return true; ++ } else { ++ BufferedImage image = (BufferedImage)this.tileImages.get(resource); ++ ++ if (image == null) { ++ this.subLogger.error("tile for %s unexpectedly missing", new Object[] {resource}); ++ this.tilesToRegister.remove(resource); ++ return true; ++ } else { ++ int width = image.getWidth(); ++ int height = image.getHeight(); ++ long currentSize = getTextureSize(map.values()); ++ long newSize = (long)(4 * width * width); ++ ++ if (newSize + currentSize > MAX_TILESHEET_SIZE) { ++ float icon1 = (float)currentSize / 1048576.0F; ++ ++ if (currentSize <= 0L) { ++ this.subLogger.error("%s too big for any tilesheet (%.1fMB), dropping", new Object[] {name, Float.valueOf(icon1)}); ++ this.tilesToRegister.remove(resource); ++ return true; ++ } else { ++ this.subLogger.warning("%s nearly full (%.1fMB), will start a new tilesheet", new Object[] {mapName, Float.valueOf(icon1)}); ++ return false; ++ } ++ } else { ++ Icon icon = textureMap.registerIcon(name); ++ map.put(name, (TextureAtlasSprite)icon); ++ ++ if (mapName.contains("_overflow")) { ++ TessellatorUtils.registerIcon(textureMap, icon); ++ } ++ ++ this.iconMap.put(name, icon); ++ String extra = width == height ? "" : ", " + height / width + " frames"; ++ this.subLogger.finer("%s -> %s icon %dx%d%s", new Object[] {name, mapName, Integer.valueOf(width), Integer.valueOf(width), extra}); ++ this.tilesToRegister.remove(resource); ++ return true; ++ } ++ } ++ } ++ } ++ ++ public void finish() { ++ this.tilesToRegister.clear(); ++ this.tileImages.clear(); ++ } ++ ++ public Icon getIcon(String name) { ++ if (name != null && !name.equals("")) { ++ Icon icon = (Icon)this.iconMap.get(name); ++ ++ if (icon == null && this.baseTexturesByName != null) { ++ icon = (Icon)this.baseTexturesByName.get(name); ++ } ++ ++ return icon; ++ } else { ++ return null; ++ } ++ } ++ ++ public Icon getIcon(ResourceLocation resource) { ++ return resource == null ? null : this.getIcon(resource.toString()); ++ } ++ ++ public boolean setDefaultTextureMap(Tessellator tessellator) { ++ tessellator.textureMap = this.baseTextureMap; ++ return this.baseTextureMap != null; ++ } ++ ++ static boolean access$002(boolean x0) { ++ changeHandlerCalled = x0; ++ return x0; ++ } ++ ++ static Set access$100() { ++ return overflowMaps; ++ } ++ ++ static List access$200() { ++ return loaders; ++ } ++ ++ static Map access$300() { ++ return specialTextures; ++ } ++ ++ static Set access$400(TileLoader x0) { ++ return x0.tilesToRegister; ++ } ++ ++ static int access$500() { ++ return splitTextures; ++ } ++ ++ static boolean access$602(boolean x0) { ++ registerIconsCalled = x0; ++ return x0; ++ } ++ ++ static int access$704(TileLoader x0) { ++ return ++x0.overflowIndex; ++ } ++ ++ static MCLogger access$800() { ++ return logger; ++ } ++ ++ static boolean access$600() { ++ return registerIconsCalled; ++ } ++ ++ static { ++ long maxSize = 4096L; ++ ++ try { ++ maxSize = (long)Minecraft.getGLMaximumTextureSize(); ++ } catch (Throwable var3) { ++ var3.printStackTrace(); ++ } ++ ++ MAX_TILESHEET_SIZE = maxSize * maxSize * 4L * 7L / 8L; ++ logger.config("max texture size is %dx%d (%.1fMB)", new Object[] {Long.valueOf(maxSize), Long.valueOf(maxSize), Float.valueOf((float)MAX_TILESHEET_SIZE / 1048576.0F)}); ++ changeHandler = new TileLoader$1("Tilesheet API", 2); ++ TexturePackChangeHandler.register(changeHandler); ++ } ++} diff --git a/patches/com/prupe/mcpatcher/WeightedIndex$1.java.patch b/patches/com/prupe/mcpatcher/WeightedIndex$1.java.patch new file mode 100644 index 0000000..ca2b829 --- /dev/null +++ b/patches/com/prupe/mcpatcher/WeightedIndex$1.java.patch @@ -0,0 +1,18 @@ +--- /dev/null ++++ com/prupe/mcpatcher/WeightedIndex$1.java +@@ -1,0 +1,15 @@ ++package com.prupe.mcpatcher; ++ ++final class WeightedIndex$1 extends WeightedIndex { ++ WeightedIndex$1(int x0) { ++ super(x0); ++ } ++ ++ public int choose(long key) { ++ return this.mod(key, this.size); ++ } ++ ++ public String toString() { ++ return "unweighted"; ++ } ++} diff --git a/patches/com/prupe/mcpatcher/WeightedIndex$2.java.patch b/patches/com/prupe/mcpatcher/WeightedIndex$2.java.patch new file mode 100644 index 0000000..10fe5d7 --- /dev/null +++ b/patches/com/prupe/mcpatcher/WeightedIndex$2.java.patch @@ -0,0 +1,43 @@ +--- /dev/null ++++ com/prupe/mcpatcher/WeightedIndex$2.java +@@ -1,0 +1,40 @@ ++package com.prupe.mcpatcher; ++ ++final class WeightedIndex$2 extends WeightedIndex { ++ final int val$sum; ++ ++ final int[] val$weights; ++ ++ WeightedIndex$2(int x0, int var2, int[] var3) { ++ super(x0); ++ this.val$sum = var2; ++ this.val$weights = var3; ++ } ++ ++ public int choose(long key) { ++ int m = this.mod(key, this.val$sum); ++ int index; ++ ++ for (index = 0; index < this.size - 1 && m >= this.val$weights[index]; ++index) { ++ m -= this.val$weights[index]; ++ } ++ ++ return index; ++ } ++ ++ public String toString() { ++ StringBuilder sb = new StringBuilder(); ++ sb.append("%("); ++ ++ for (int i = 0; i < this.val$weights.length; ++i) { ++ if (i > 0) { ++ sb.append(", "); ++ } ++ ++ sb.append(String.format("%.1f", new Object[] {Double.valueOf(100.0D * (double)this.val$weights[i] / (double)this.val$sum)})); ++ } ++ ++ sb.append(")"); ++ return sb.toString(); ++ } ++} diff --git a/patches/com/prupe/mcpatcher/WeightedIndex.java.patch b/patches/com/prupe/mcpatcher/WeightedIndex.java.patch new file mode 100644 index 0000000..ff72940 --- /dev/null +++ b/patches/com/prupe/mcpatcher/WeightedIndex.java.patch @@ -0,0 +1,82 @@ +--- /dev/null ++++ com/prupe/mcpatcher/WeightedIndex.java +@@ -1,0 +1,79 @@ ++package com.prupe.mcpatcher; ++ ++import com.prupe.mcpatcher.WeightedIndex$1; ++import com.prupe.mcpatcher.WeightedIndex$2; ++ ++public abstract class WeightedIndex { ++ private static final long K1 = -5435081209227447693L; ++ private static final long KMUL = -7070675565921424023L; ++ final int size; ++ ++ public static WeightedIndex create(int size) { ++ return size <= 0 ? null : new WeightedIndex$1(size); ++ } ++ ++ public static WeightedIndex create(int size, String weightList) { ++ if (size > 0 && weightList != null) { ++ int[] weights = new int[size]; ++ int sum1 = 0; ++ boolean useWeight = false; ++ String[] list = weightList.trim().split("\\s+"); ++ ++ for (int sum = 0; sum < size; ++sum) { ++ if (sum < list.length && list[sum].matches("^\\d+$")) { ++ weights[sum] = Math.max(Integer.parseInt(list[sum]), 0); ++ } else { ++ weights[sum] = 1; ++ } ++ ++ if (sum > 0 && weights[sum] != weights[0]) { ++ useWeight = true; ++ } ++ ++ sum1 += weights[sum]; ++ } ++ ++ if (useWeight && sum1 > 0) { ++ return new WeightedIndex$2(size, sum1, weights); ++ } else { ++ return create(size); ++ } ++ } else { ++ return create(size); ++ } ++ } ++ ++ protected WeightedIndex(int size) { ++ this.size = size; ++ } ++ ++ protected final int mod(long n, int modulus) { ++ return (int)((n >> 32 ^ n) & 2147483647L) % modulus; ++ } ++ ++ public abstract int choose(long var1); ++ ++ public static long hash128To64(int i, int j, int k, int l) { ++ return hash128To64((long)i << 32 | (long)j, (long)k << 32 | (long)l); ++ } ++ ++ public static long hash128To64(long a, long b) { ++ a = shiftMix(a * -5435081209227447693L) * -5435081209227447693L; ++ long c = b * -5435081209227447693L + mix128to64(a, b); ++ long d = shiftMix(a + b); ++ a = mix128to64(a, c); ++ b = mix128to64(d, b); ++ return a ^ b ^ mix128to64(b, a); ++ } ++ ++ private static long shiftMix(long val) { ++ return val ^ val >>> 47; ++ } ++ ++ private static long mix128to64(long u, long v) { ++ long a = shiftMix((u ^ v) * -7070675565921424023L); ++ long b = shiftMix((u ^ a) * -7070675565921424023L); ++ b *= -7070675565921424023L; ++ return b; ++ } ++} diff --git a/patches/com/prupe/mcpatcher/cc/BiomeHelper.java.patch b/patches/com/prupe/mcpatcher/cc/BiomeHelper.java.patch new file mode 100644 index 0000000..26cc8ff --- /dev/null +++ b/patches/com/prupe/mcpatcher/cc/BiomeHelper.java.patch @@ -0,0 +1,91 @@ +--- /dev/null ++++ com/prupe/mcpatcher/cc/BiomeHelper.java +@@ -1,0 +1,88 @@ ++package com.prupe.mcpatcher.cc; ++ ++import com.prupe.mcpatcher.MCLogger; ++import com.prupe.mcpatcher.MCPatcherUtils; ++import java.lang.reflect.Method; ++import java.util.BitSet; ++import net.minecraft.src.BiomeGenBase; ++import net.minecraft.src.Minecraft; ++ ++class BiomeHelper { ++ private static final MCLogger logger = MCLogger.getLogger("Custom Colors"); ++ private static Method getWaterColorMultiplier; ++ private static BiomeGenBase lastBiome; ++ private static int lastI; ++ private static int lastK; ++ ++ static void parseBiomeList(String list, BitSet bits) { ++ if (!MCPatcherUtils.isNullOrEmpty(list)) { ++ String[] arr$ = list.toLowerCase().split("\\s+"); ++ int len$ = arr$.length; ++ ++ for (int i$ = 0; i$ < len$; ++i$) { ++ String s = arr$[i$]; ++ ++ if (!s.isEmpty()) { ++ BiomeGenBase[] arr$1 = BiomeGenBase.biomeList; ++ int len$1 = arr$1.length; ++ ++ for (int i$1 = 0; i$1 < len$1; ++i$1) { ++ BiomeGenBase biome = arr$1[i$1]; ++ ++ if (biome != null && biome.biomeName != null && s.equals(biome.biomeName.toLowerCase().replace(" ", ""))) { ++ bits.set(biome.biomeID); ++ } ++ } ++ } ++ } ++ } ++ } ++ ++ static int getBiomeIDAt(int i, int j, int k) { ++ BiomeGenBase biome = getBiomeGenAt(i, j, k); ++ return biome == null ? BiomeGenBase.biomeList.length : biome.biomeID; ++ } ++ ++ static BiomeGenBase getBiomeGenAt(int i, int j, int k) { ++ if (lastBiome == null || i != lastI || k != lastK) { ++ lastI = i; ++ lastK = k; ++ lastBiome = Minecraft.getMinecraft().theWorld.getBiomeGenForCoords(i, k); ++ } ++ ++ return lastBiome; ++ } ++ ++ static float getTemperature(int i, int j, int k) { ++ return getBiomeGenAt(i, j, k).getFloatTemperature(); ++ } ++ ++ static float getRainfall(int i, int j, int k) { ++ return getBiomeGenAt(i, j, k).getFloatRainfall(); ++ } ++ ++ static int getWaterColorMultiplier(int i, int j, int k) { ++ BiomeGenBase biome = getBiomeGenAt(i, j, k); ++ ++ if (getWaterColorMultiplier != null) { ++ try { ++ return ((Integer)getWaterColorMultiplier.invoke(biome, new Object[0])).intValue(); ++ } catch (Throwable var5) { ++ var5.printStackTrace(); ++ getWaterColorMultiplier = null; ++ } ++ } ++ ++ return biome.waterColorMultiplier; ++ } ++ ++ static { ++ try { ++ getWaterColorMultiplier = BiomeGenBase.class.getDeclaredMethod("getWaterColorMultiplier", new Class[0]); ++ getWaterColorMultiplier.setAccessible(true); ++ logger.config("forge getWaterColorMultiplier detected", new Object[0]); ++ } catch (NoSuchMethodException var1) { ++ ; ++ } ++ } ++} diff --git a/patches/com/prupe/mcpatcher/cc/ColorMap.java.patch b/patches/com/prupe/mcpatcher/cc/ColorMap.java.patch new file mode 100644 index 0000000..a11a040 --- /dev/null +++ b/patches/com/prupe/mcpatcher/cc/ColorMap.java.patch @@ -0,0 +1,105 @@ +--- /dev/null ++++ com/prupe/mcpatcher/cc/ColorMap.java +@@ -1,0 +1,102 @@ ++package com.prupe.mcpatcher.cc; ++ ++import com.prupe.mcpatcher.MCLogger; ++import com.prupe.mcpatcher.MCPatcherUtils; ++import com.prupe.mcpatcher.TexturePackAPI; ++import java.util.Arrays; ++import net.minecraft.src.ResourceLocation; ++ ++final class ColorMap { ++ private static final MCLogger logger = MCLogger.getLogger("Custom Colors"); ++ private static final int COLORMAP_SIZE = 256; ++ private static final float COLORMAP_SCALE = 255.0F; ++ private int[] map; ++ private int mapDefault; ++ private int lastBlendI = Integer.MIN_VALUE; ++ private int lastBlendK = Integer.MAX_VALUE; ++ private final float[] lastBlendResult = new float[3]; ++ ++ static int getX(double temperature, double rainfall) { ++ return (int)(255.0D * (1.0D - Colorizer.clamp(temperature))); ++ } ++ ++ static int getY(double temperature, double rainfall) { ++ return (int)(255.0D * (1.0D - Colorizer.clamp(rainfall) * Colorizer.clamp(temperature))); ++ } ++ ++ static float getBlockMetaKey(int blockID, int metadata) { ++ return (float)blockID + (float)(metadata & 255) / 256.0F; ++ } ++ ++ ColorMap(int defaultColor) { ++ this.mapDefault = defaultColor; ++ } ++ ++ void loadColorMap(boolean useCustom, ResourceLocation resource) { ++ if (useCustom) { ++ this.map = MCPatcherUtils.getImageRGB(TexturePackAPI.getImage(resource)); ++ ++ if (this.map != null) { ++ if (this.map.length != 65536) { ++ logger.error("%s must be %dx%d", new Object[] {resource, Integer.valueOf(256), Integer.valueOf(256)}); ++ this.map = null; ++ } else { ++ this.mapDefault = this.colorize(16777215, 0.5D, 1.0D); ++ logger.fine("using %s, default color %06x", new Object[] {resource, Integer.valueOf(this.mapDefault)}); ++ } ++ } ++ } ++ } ++ ++ boolean isCustom() { ++ return this.map != null; ++ } ++ ++ void clear() { ++ this.map = null; ++ } ++ ++ int colorize() { ++ return this.mapDefault; ++ } ++ ++ int colorize(int defaultColor) { ++ return this.map == null ? defaultColor : this.mapDefault; ++ } ++ ++ int colorize(int defaultColor, double temperature, double rainfall) { ++ return this.map == null ? defaultColor : this.map[256 * getY(temperature, rainfall) + getX(temperature, rainfall)]; ++ } ++ ++ int colorize(int defaultColor, int i, int j, int k) { ++ return this.colorize(defaultColor, (double)BiomeHelper.getTemperature(i, j, k), (double)BiomeHelper.getRainfall(i, j, k)); ++ } ++ ++ void colorizeWithBlending(int i, int j, int k, int radius, float[] result) { ++ if (i == this.lastBlendI && k == this.lastBlendK) { ++ System.arraycopy(this.lastBlendResult, 0, result, 0, 3); ++ } else { ++ Arrays.fill(result, 0.0F); ++ int diameter; ++ ++ for (diameter = -radius; diameter <= radius; ++diameter) { ++ for (int scale = -radius; scale <= radius; ++scale) { ++ int rgb = this.colorize(this.mapDefault, i + diameter, j, k + scale); ++ Colorizer.intToFloat3(rgb, this.lastBlendResult); ++ result[0] += this.lastBlendResult[0]; ++ result[1] += this.lastBlendResult[1]; ++ result[2] += this.lastBlendResult[2]; ++ } ++ } ++ ++ diameter = 2 * radius + 1; ++ float var9 = 1.0F / (float)(diameter * diameter); ++ result[0] *= var9; ++ result[1] *= var9; ++ result[2] *= var9; ++ System.arraycopy(result, 0, this.lastBlendResult, 0, 3); ++ this.lastBlendI = i; ++ this.lastBlendK = k; ++ } ++ } ++} diff --git a/patches/com/prupe/mcpatcher/cc/ColorizeBlock.java.patch b/patches/com/prupe/mcpatcher/cc/ColorizeBlock.java.patch new file mode 100644 index 0000000..e322f10 --- /dev/null +++ b/patches/com/prupe/mcpatcher/cc/ColorizeBlock.java.patch @@ -0,0 +1,310 @@ +--- /dev/null ++++ com/prupe/mcpatcher/cc/ColorizeBlock.java +@@ -1,0 +1,307 @@ ++package com.prupe.mcpatcher.cc; ++ ++import com.prupe.mcpatcher.Config; ++import com.prupe.mcpatcher.MCLogger; ++import com.prupe.mcpatcher.MCPatcherUtils; ++import com.prupe.mcpatcher.TexturePackAPI; ++import java.util.Arrays; ++import java.util.HashMap; ++import java.util.Iterator; ++import java.util.Map; ++import java.util.Properties; ++import java.util.Map.Entry; ++import net.minecraft.src.Block; ++import net.minecraft.src.IBlockAccess; ++import net.minecraft.src.ResourceLocation; ++import org.lwjgl.opengl.GL11; ++ ++public class ColorizeBlock { ++ private static final MCLogger logger = MCLogger.getLogger("Custom Colors"); ++ private static final ResourceLocation REDSTONE_COLORS = TexturePackAPI.newMCPatcherResourceLocation("colormap/redstone.png"); ++ private static final ResourceLocation STEM_COLORS = TexturePackAPI.newMCPatcherResourceLocation("colormap/stem.png"); ++ private static final ResourceLocation PUMPKIN_STEM_COLORS = TexturePackAPI.newMCPatcherResourceLocation("colormap/pumpkinstem.png"); ++ private static final ResourceLocation MELON_STEM_COLORS = TexturePackAPI.newMCPatcherResourceLocation("colormap/melonstem.png"); ++ private static final ResourceLocation SWAMPGRASSCOLOR = TexturePackAPI.newMCPatcherResourceLocation("colormap/swampgrass.png"); ++ private static final ResourceLocation SWAMPFOLIAGECOLOR = TexturePackAPI.newMCPatcherResourceLocation("colormap/swampfoliage.png"); ++ private static final ResourceLocation PINECOLOR = TexturePackAPI.newMCPatcherResourceLocation("colormap/pine.png"); ++ private static final ResourceLocation BIRCHCOLOR = TexturePackAPI.newMCPatcherResourceLocation("colormap/birch.png"); ++ private static final ResourceLocation FOLIAGECOLOR = TexturePackAPI.newMCPatcherResourceLocation("colormap/foliage.png"); ++ private static final ResourceLocation WATERCOLOR = TexturePackAPI.newMCPatcherResourceLocation("colormap/water.png"); ++ private static final ResourceLocation UNDERWATERCOLOR = TexturePackAPI.newMCPatcherResourceLocation("colormap/underwater.png"); ++ private static final ResourceLocation FOGCOLOR0 = TexturePackAPI.newMCPatcherResourceLocation("colormap/fog0.png"); ++ private static final ResourceLocation SKYCOLOR0 = TexturePackAPI.newMCPatcherResourceLocation("colormap/sky0.png"); ++ private static final String PALETTE_BLOCK_KEY = "palette.block."; ++ private static final int BLOCK_ID_PUMPKIN_STEM = 104; ++ private static final int BLOCK_ID_MELON_STEM = 105; ++ private static final ColorMap[] blockColorMaps = new ColorMap[Block.blocksList.length]; ++ private static final Map blockMetaColorMaps = new HashMap(); ++ private static int lilypadColor; ++ private static float[][] redstoneColor; ++ private static int[] pumpkinStemColors; ++ private static int[] melonStemColors; ++ private static final int blockBlendRadius = Config.getInt("Custom Colors", "blockBlendRadius", 1); ++ private static final float blockBlendScale = (float)Math.pow((double)(2 * blockBlendRadius + 1), -2.0D); ++ public static float[] waterColor; ++ ++ static void reset() { ++ Colorizer.fixedColorMaps[0] = new ColorMap(5131854); ++ Colorizer.fixedColorMaps[1] = new ColorMap(5131854); ++ Colorizer.fixedColorMaps[2] = new ColorMap(6396257); ++ Colorizer.fixedColorMaps[3] = new ColorMap(8431445); ++ Colorizer.fixedColorMaps[4] = new ColorMap(4764952); ++ Colorizer.fixedColorMaps[5] = new ColorMap(16777215); ++ Colorizer.fixedColorMaps[6] = new ColorMap(329011); ++ Colorizer.fixedColorMaps[7] = new ColorMap(12638463); ++ Colorizer.fixedColorMaps[8] = new ColorMap(16777215); ++ Arrays.fill(blockColorMaps, (Object)null); ++ blockMetaColorMaps.clear(); ++ lilypadColor = 2129968; ++ waterColor = new float[] {0.2F, 0.3F, 1.0F}; ++ redstoneColor = (float[][])null; ++ pumpkinStemColors = null; ++ melonStemColors = null; ++ } ++ ++ static void reloadColorMaps(Properties properties) { ++ Colorizer.fixedColorMaps[0].loadColorMap(Colorizer.useSwampColors, SWAMPGRASSCOLOR); ++ Colorizer.fixedColorMaps[1].loadColorMap(Colorizer.useSwampColors, SWAMPFOLIAGECOLOR); ++ Colorizer.fixedColorMaps[2].loadColorMap(Colorizer.useTreeColors, PINECOLOR); ++ Colorizer.fixedColorMaps[3].loadColorMap(Colorizer.useTreeColors, BIRCHCOLOR); ++ Colorizer.fixedColorMaps[4].loadColorMap(Colorizer.useTreeColors, FOLIAGECOLOR); ++ Colorizer.fixedColorMaps[4].clear(); ++ Colorizer.fixedColorMaps[5].loadColorMap(Colorizer.useWaterColors, WATERCOLOR); ++ Colorizer.fixedColorMaps[6].loadColorMap(Colorizer.useWaterColors, UNDERWATERCOLOR); ++ Colorizer.fixedColorMaps[7].loadColorMap(Colorizer.useFogColors, FOGCOLOR0); ++ Colorizer.fixedColorMaps[8].loadColorMap(Colorizer.useFogColors, SKYCOLOR0); ++ } ++ ++ static void reloadSwampColors(Properties properties) { ++ int[] temp = new int[] {lilypadColor}; ++ Colorizer.loadIntColor("lilypad", temp, 0); ++ lilypadColor = temp[0]; ++ } ++ ++ static void reloadBlockColors(Properties properties) { ++ Iterator i$ = properties.entrySet().iterator(); ++ ++ while (i$.hasNext()) { ++ Entry entry = (Entry)i$.next(); ++ ++ if (entry.getKey() instanceof String && entry.getValue() instanceof String) { ++ String key = (String)entry.getKey(); ++ String value = (String)entry.getValue(); ++ ++ if (key.startsWith("palette.block.")) { ++ ResourceLocation address = TexturePackAPI.parseResourceLocation(Colorizer.COLOR_PROPERTIES, key.substring("palette.block.".length()).trim()); ++ ++ if (address != null) { ++ ColorMap colorMap = new ColorMap(16777215); ++ colorMap.loadColorMap(true, address); ++ ++ if (colorMap.isCustom()) { ++ String[] arr$ = value.split("\\s+"); ++ int len$ = arr$.length; ++ ++ for (int i$1 = 0; i$1 < len$; ++i$1) { ++ String idString = arr$[i$1]; ++ String[] tokens = idString.split(":"); ++ int[] tokensInt = new int[tokens.length]; ++ ++ try { ++ for (int e = 0; e < tokens.length; ++e) { ++ tokensInt[e] = Integer.parseInt(tokens[e]); ++ } ++ } catch (NumberFormatException var14) { ++ continue; ++ } ++ ++ switch (tokensInt.length) { ++ case 1: ++ if (tokensInt[0] < 0 || tokensInt[0] >= blockColorMaps.length) { ++ continue; ++ } ++ ++ blockColorMaps[tokensInt[0]] = colorMap; ++ break; ++ ++ case 2: ++ blockMetaColorMaps.put(Float.valueOf(ColorMap.getBlockMetaKey(tokensInt[0], tokensInt[1])), colorMap); ++ break; ++ ++ default: ++ continue; ++ } ++ ++ logger.finer("using %s for block %s, default color %06x", new Object[] {key, idString, Integer.valueOf(colorMap.colorize())}); ++ } ++ } ++ } ++ } ++ } ++ } ++ } ++ ++ static void reloadRedstoneColors(Properties properties) { ++ int[] rgb = MCPatcherUtils.getImageRGB(TexturePackAPI.getImage(REDSTONE_COLORS)); ++ ++ if (rgb != null && rgb.length >= 16) { ++ redstoneColor = new float[16][]; ++ ++ for (int i = 0; i < 16; ++i) { ++ float[] f = new float[3]; ++ Colorizer.intToFloat3(rgb[i], f); ++ redstoneColor[i] = f; ++ } ++ } ++ } ++ ++ static void reloadStemColors(Properties properties) { ++ int[] stemColors = getStemRGB(STEM_COLORS); ++ pumpkinStemColors = getStemRGB(PUMPKIN_STEM_COLORS); ++ ++ if (pumpkinStemColors == null) { ++ pumpkinStemColors = stemColors; ++ } ++ ++ melonStemColors = getStemRGB(MELON_STEM_COLORS); ++ ++ if (melonStemColors == null) { ++ melonStemColors = stemColors; ++ } ++ } ++ ++ private static int[] getStemRGB(ResourceLocation resource) { ++ int[] rgb = MCPatcherUtils.getImageRGB(TexturePackAPI.getImage(resource)); ++ return rgb != null && rgb.length >= 8 ? rgb : null; ++ } ++ ++ public static int colorizeBiome(int defaultColor, int index, double temperature, double rainfall) { ++ return Colorizer.fixedColorMaps[index].colorize(defaultColor, temperature, rainfall); ++ } ++ ++ public static int colorizeBiome(int defaultColor, int index) { ++ return Colorizer.fixedColorMaps[index].colorize(defaultColor); ++ } ++ ++ public static int colorizeBiome(int defaultColor, int index, int i, int j, int k) { ++ return Colorizer.fixedColorMaps[index].colorize(defaultColor, i, j, k); ++ } ++ ++ public static int colorizeBiomeWithBlending(int defaultColor, int index, int i, int j, int k) { ++ return colorizeWithBlending(Colorizer.fixedColorMaps[index], defaultColor, i, j, k); ++ } ++ ++ public static int colorizeWater(Object dummy, int i, int k) { ++ return Colorizer.fixedColorMaps[5].colorize(BiomeHelper.getWaterColorMultiplier(i, 64, k), i, 64, k); ++ } ++ ++ public static int colorizeBlock(Block block, int i, int j, int k, int metadata) { ++ ColorMap colorMap = null; ++ ++ if (!blockMetaColorMaps.isEmpty()) { ++ colorMap = (ColorMap)blockMetaColorMaps.get(Float.valueOf(ColorMap.getBlockMetaKey(block.blockID, metadata))); ++ } ++ ++ if (colorMap == null && block.blockID >= 0 && block.blockID < blockColorMaps.length) { ++ colorMap = blockColorMaps[block.blockID]; ++ } ++ ++ return colorizeWithBlending(colorMap, 16777215, i, j, k); ++ } ++ ++ private static int colorizeWithBlending(ColorMap colorMap, int defaultColor, int i, int j, int k) { ++ if (colorMap != null && colorMap.isCustom() && blockBlendRadius > 0) { ++ float[] f = new float[3]; ++ colorMap.colorizeWithBlending(i, j, k, blockBlendRadius, f); ++ return Colorizer.float3ToInt(f); ++ } else { ++ return defaultColor; ++ } ++ } ++ ++ public static int colorizeBlock(Block block) { ++ ColorMap colorMap = blockColorMaps[block.blockID]; ++ return colorMap == null ? 16777215 : colorMap.colorize(16777215); ++ } ++ ++ public static int colorizeStem(int defaultColor, Block block, int blockMetadata) { ++ int[] colors; ++ ++ switch (block.blockID) { ++ case 104: ++ colors = pumpkinStemColors; ++ break; ++ ++ case 105: ++ colors = melonStemColors; ++ break; ++ ++ default: ++ return defaultColor; ++ } ++ ++ return colors == null ? defaultColor : colors[blockMetadata & 7]; ++ } ++ ++ public static int getLilyPadColor() { ++ return lilypadColor; ++ } ++ ++ public static int getItemColorFromDamage(int defaultColor, int blockID, int damage) { ++ return blockID != 8 && blockID != 9 ? defaultColor : colorizeBiome(defaultColor, 5); ++ } ++ ++ public static boolean computeRedstoneWireColor(int current) { ++ if (redstoneColor == null) { ++ return false; ++ } else { ++ System.arraycopy(redstoneColor[Math.max(Math.min(current, 15), 0)], 0, Colorizer.setColor, 0, 3); ++ return true; ++ } ++ } ++ ++ public static int colorizeRedstoneWire(IBlockAccess blockAccess, int i, int j, int k, int defaultColor) { ++ if (redstoneColor == null) { ++ return defaultColor; ++ } else { ++ int metadata = Math.max(Math.min(blockAccess.getBlockMetadata(i, j, k), 15), 0); ++ return Colorizer.float3ToInt(redstoneColor[metadata]); ++ } ++ } ++ ++ public static boolean computeWaterColor(double x, double y, double z) { ++ if (Colorizer.useParticleColors && Colorizer.fixedColorMaps[5].isCustom()) { ++ int rgb = colorizeBiome(16777215, 5, (int)x, (int)y, (int)z); ++ float[] multiplier = new float[3]; ++ Colorizer.intToFloat3(rgb, multiplier); ++ ++ for (int i = 0; i < 3; ++i) { ++ waterColor[i] = multiplier[i] * ColorizeEntity.waterBaseColor[i]; ++ } ++ ++ return true; ++ } else { ++ return false; ++ } ++ } ++ ++ public static void computeWaterColor() { ++ int rgb = colorizeBiome(16777215, 5); ++ Colorizer.intToFloat3(rgb, waterColor); ++ } ++ ++ public static void colorizeWaterBlockGL(int blockID) { ++ if (blockID == 8 || blockID == 9) { ++ computeWaterColor(); ++ GL11.glColor4f(waterColor[0], waterColor[1], waterColor[2], 1.0F); ++ } ++ } ++ ++ static { ++ try { ++ reset(); ++ } catch (Throwable var1) { ++ var1.printStackTrace(); ++ } ++ } ++} diff --git a/patches/com/prupe/mcpatcher/cc/ColorizeEntity.java.patch b/patches/com/prupe/mcpatcher/cc/ColorizeEntity.java.patch new file mode 100644 index 0000000..8c2153f --- /dev/null +++ b/patches/com/prupe/mcpatcher/cc/ColorizeEntity.java.patch @@ -0,0 +1,126 @@ +--- /dev/null ++++ com/prupe/mcpatcher/cc/ColorizeEntity.java +@@ -1,0 +1,123 @@ ++package com.prupe.mcpatcher.cc; ++ ++import com.prupe.mcpatcher.MCPatcherUtils; ++import com.prupe.mcpatcher.TexturePackAPI; ++import java.util.Properties; ++import java.util.Random; ++import net.minecraft.src.EntityLivingBase; ++import net.minecraft.src.EntitySheep; ++import net.minecraft.src.ItemDye; ++import net.minecraft.src.ResourceLocation; ++ ++public class ColorizeEntity { ++ private static final ResourceLocation LAVA_DROP_COLORS = TexturePackAPI.newMCPatcherResourceLocation("colormap/lavadrop.png"); ++ private static final ResourceLocation MYCELIUM_COLORS = TexturePackAPI.newMCPatcherResourceLocation("colormap/myceliumparticle.png"); ++ private static final ResourceLocation XPORB_COLORS = TexturePackAPI.newMCPatcherResourceLocation("colormap/xporb.png"); ++ static float[] waterBaseColor; ++ private static float[] lavaDropColors; ++ public static float[] portalColor = new float[] {1.0F, 0.3F, 0.9F}; ++ private static final Random random = new Random(); ++ private static int[] myceliumColors; ++ private static int[] xpOrbColors; ++ private static final int[] origDyeColors = (int[])ItemDye.dyeColors.clone(); ++ private static final float[][] origFleeceColors = new float[EntitySheep.fleeceColorTable.length][]; ++ public static final float[][] armorColors = new float[EntitySheep.fleeceColorTable.length][]; ++ public static int undyedLeatherColor; ++ public static final float[][] collarColors = new float[EntitySheep.fleeceColorTable.length][]; ++ ++ static void reset() { ++ waterBaseColor = new float[] {0.2F, 0.3F, 1.0F}; ++ portalColor = new float[] {1.0F, 0.3F, 0.9F}; ++ lavaDropColors = null; ++ System.arraycopy(origDyeColors, 0, ItemDye.dyeColors, 0, origDyeColors.length); ++ ++ for (int i = 0; i < origFleeceColors.length; ++i) { ++ EntitySheep.fleeceColorTable[i] = (float[])origFleeceColors[i].clone(); ++ armorColors[i] = (float[])origFleeceColors[i].clone(); ++ collarColors[i] = (float[])origFleeceColors[i].clone(); ++ } ++ ++ undyedLeatherColor = 10511680; ++ myceliumColors = null; ++ xpOrbColors = null; ++ } ++ ++ static void reloadParticleColors(Properties properties) { ++ Colorizer.loadFloatColor("drop.water", waterBaseColor); ++ Colorizer.loadFloatColor("particle.water", waterBaseColor); ++ Colorizer.loadFloatColor("particle.portal", portalColor); ++ int[] rgb = MCPatcherUtils.getImageRGB(TexturePackAPI.getImage(LAVA_DROP_COLORS)); ++ ++ if (rgb != null) { ++ lavaDropColors = new float[3 * rgb.length]; ++ ++ for (int i = 0; i < rgb.length; ++i) { ++ Colorizer.intToFloat3(rgb[i], lavaDropColors, 3 * i); ++ } ++ } ++ ++ myceliumColors = MCPatcherUtils.getImageRGB(TexturePackAPI.getImage(MYCELIUM_COLORS)); ++ } ++ ++ static void reloadDyeColors(Properties properties) { ++ int i; ++ ++ for (i = 0; i < ItemDye.dyeColors.length; ++i) { ++ Colorizer.loadIntColor("dye." + Colorizer.getStringKey(ItemDye.dyeColorNames, i), ItemDye.dyeColors, i); ++ } ++ ++ for (i = 0; i < EntitySheep.fleeceColorTable.length; ++i) { ++ String key = Colorizer.getStringKey(ItemDye.dyeColorNames, EntitySheep.fleeceColorTable.length - 1 - i); ++ Colorizer.loadFloatColor("sheep." + key, EntitySheep.fleeceColorTable[i]); ++ Colorizer.loadFloatColor("armor." + key, armorColors[i]); ++ Colorizer.loadFloatColor("collar." + key, collarColors[i]); ++ } ++ ++ undyedLeatherColor = Colorizer.loadIntColor("armor.default", undyedLeatherColor); ++ } ++ ++ static void reloadXPOrbColors(Properties properties) { ++ xpOrbColors = MCPatcherUtils.getImageRGB(TexturePackAPI.getImage(XPORB_COLORS)); ++ } ++ ++ public static int colorizeXPOrb(int origColor, float timer) { ++ return xpOrbColors != null && xpOrbColors.length != 0 ? xpOrbColors[(int)((Math.sin((double)timer / 4.0D) + 1.0D) * (double)(xpOrbColors.length - 1) / 2.0D)] : origColor; ++ } ++ ++ public static boolean computeLavaDropColor(int age) { ++ if (lavaDropColors == null) { ++ return false; ++ } else { ++ int offset = 3 * Math.max(Math.min(lavaDropColors.length / 3 - 1, age - 20), 0); ++ System.arraycopy(lavaDropColors, offset, Colorizer.setColor, 0, 3); ++ return true; ++ } ++ } ++ ++ public static boolean computeMyceliumParticleColor() { ++ if (myceliumColors == null) { ++ return false; ++ } else { ++ Colorizer.setColorF(myceliumColors[random.nextInt(myceliumColors.length)]); ++ return true; ++ } ++ } ++ ++ public static int getPotionEffectColor(int defaultColor, EntityLivingBase entity) { ++ return defaultColor == 0 ? defaultColor : entity.overridePotionColor; ++ } ++ ++ static { ++ try { ++ for (int e = 0; e < EntitySheep.fleeceColorTable.length; ++e) { ++ origFleeceColors[e] = (float[])EntitySheep.fleeceColorTable[e].clone(); ++ armorColors[e] = (float[])EntitySheep.fleeceColorTable[e].clone(); ++ collarColors[e] = (float[])EntitySheep.fleeceColorTable[e].clone(); ++ } ++ ++ reset(); ++ } catch (Throwable var1) { ++ var1.printStackTrace(); ++ } ++ } ++} diff --git a/patches/com/prupe/mcpatcher/cc/ColorizeItem.java.patch b/patches/com/prupe/mcpatcher/cc/ColorizeItem.java.patch new file mode 100644 index 0000000..767a5f6 --- /dev/null +++ b/patches/com/prupe/mcpatcher/cc/ColorizeItem.java.patch @@ -0,0 +1,122 @@ +--- /dev/null ++++ com/prupe/mcpatcher/cc/ColorizeItem.java +@@ -1,0 +1,119 @@ ++package com.prupe.mcpatcher.cc; ++ ++import com.prupe.mcpatcher.MCLogger; ++import java.util.ArrayList; ++import java.util.HashMap; ++import java.util.Iterator; ++import java.util.List; ++import java.util.Map; ++import java.util.Properties; ++import net.minecraft.src.MapColor; ++import net.minecraft.src.Potion; ++import net.minecraft.src.PotionHelper; ++ ++public class ColorizeItem { ++ private static final MCLogger logger = MCLogger.getLogger("Custom Colors"); ++ private static final Map entityNamesByID = new HashMap(); ++ private static final Map spawnerEggShellColors = new HashMap(); ++ private static final Map spawnerEggSpotColors = new HashMap(); ++ private static int waterBottleColor; ++ private static final List potions = new ArrayList(); ++ private static final String[] MAP_MATERIALS = new String[] {"air", "grass", "sand", "cloth", "tnt", "ice", "iron", "foliage", "snow", "clay", "dirt", "stone", "water", "wood"}; ++ ++ static void reset() { ++ spawnerEggShellColors.clear(); ++ spawnerEggSpotColors.clear(); ++ ++ if (PotionHelper.field_77925_n != null) { ++ PotionHelper.field_77925_n.clear(); ++ } ++ ++ waterBottleColor = 3694022; ++ Potion len$; ++ ++ for (Iterator arr$ = potions.iterator(); arr$.hasNext(); len$.liquidColor = len$.origColor) { ++ len$ = (Potion)arr$.next(); ++ } ++ ++ MapColor[] var4 = MapColor.mapColorArray; ++ int var5 = var4.length; ++ ++ for (int i$ = 0; i$ < var5; ++i$) { ++ MapColor mapColor = var4[i$]; ++ ++ if (mapColor != null) { ++ mapColor.colorValue = mapColor.origColorValue; ++ } ++ } ++ } ++ ++ static void reloadPotionColors(Properties properties) { ++ Iterator temp = potions.iterator(); ++ ++ while (temp.hasNext()) { ++ Potion potion = (Potion)temp.next(); ++ Colorizer.loadIntColor(potion.name, potion); ++ } ++ ++ int[] temp1 = new int[] {waterBottleColor}; ++ Colorizer.loadIntColor("potion.water", temp1, 0); ++ waterBottleColor = temp1[0]; ++ } ++ ++ static void reloadMapColors(Properties properties) { ++ for (int i = 0; i < MapColor.mapColorArray.length; ++i) { ++ if (MapColor.mapColorArray[i] != null) { ++ int[] rgb = new int[] {MapColor.mapColorArray[i].origColorValue}; ++ Colorizer.loadIntColor("map." + Colorizer.getStringKey(MAP_MATERIALS, i), rgb, 0); ++ MapColor.mapColorArray[i].colorValue = rgb[0]; ++ } ++ } ++ } ++ ++ public static void setupSpawnerEgg(String entityName, int entityID, int defaultShellColor, int defaultSpotColor) { ++ logger.config("egg.shell.%s=%06x", new Object[] {entityName, Integer.valueOf(defaultShellColor)}); ++ logger.config("egg.spots.%s=%06x", new Object[] {entityName, Integer.valueOf(defaultSpotColor)}); ++ entityNamesByID.put(Integer.valueOf(entityID), entityName); ++ } ++ ++ public static void setupPotion(Potion potion) { ++ potion.origColor = potion.liquidColor; ++ potions.add(potion); ++ } ++ ++ public static int colorizeSpawnerEgg(int defaultColor, int entityID, int spots) { ++ if (!Colorizer.useEggColors) { ++ return defaultColor; ++ } else { ++ Integer value = null; ++ Map eggMap = spots == 0 ? spawnerEggShellColors : spawnerEggSpotColors; ++ ++ if (eggMap.containsKey(Integer.valueOf(entityID))) { ++ value = (Integer)eggMap.get(Integer.valueOf(entityID)); ++ } else if (entityNamesByID.containsKey(Integer.valueOf(entityID))) { ++ String name = (String)entityNamesByID.get(Integer.valueOf(entityID)); ++ ++ if (name != null) { ++ int[] tmp = new int[] {defaultColor}; ++ Colorizer.loadIntColor((spots == 0 ? "egg.shell." : "egg.spots.") + name, tmp, 0); ++ eggMap.put(Integer.valueOf(entityID), Integer.valueOf(tmp[0])); ++ value = Integer.valueOf(tmp[0]); ++ } ++ } ++ ++ return value == null ? defaultColor : value.intValue(); ++ } ++ } ++ ++ public static int getWaterBottleColor() { ++ return waterBottleColor; ++ } ++ ++ static { ++ try { ++ reset(); ++ } catch (Throwable var1) { ++ var1.printStackTrace(); ++ } ++ } ++} diff --git a/patches/com/prupe/mcpatcher/cc/ColorizeWorld.java.patch b/patches/com/prupe/mcpatcher/cc/ColorizeWorld.java.patch new file mode 100644 index 0000000..0e7fd45 --- /dev/null +++ b/patches/com/prupe/mcpatcher/cc/ColorizeWorld.java.patch @@ -0,0 +1,208 @@ +--- /dev/null ++++ com/prupe/mcpatcher/cc/ColorizeWorld.java +@@ -1,0 +1,205 @@ ++package com.prupe.mcpatcher.cc; ++ ++import com.prupe.mcpatcher.Config; ++import com.prupe.mcpatcher.MCLogger; ++import java.util.ArrayList; ++import java.util.HashMap; ++import java.util.Iterator; ++import java.util.List; ++import java.util.Map; ++import java.util.Properties; ++import java.util.Map.Entry; ++import net.minecraft.src.BiomeGenBase; ++import net.minecraft.src.Entity; ++import net.minecraft.src.World; ++ ++public class ColorizeWorld { ++ private static final MCLogger logger = MCLogger.getLogger("Custom Colors"); ++ private static final int fogBlendRadius = Config.getInt("Custom Colors", "fogBlendRadius", 7); ++ private static final String TEXT_KEY = "text."; ++ private static final String TEXT_CODE_KEY = "text.code."; ++ private static final int CLOUDS_DEFAULT = 0; ++ private static final int CLOUDS_FAST = 1; ++ private static final int CLOUDS_FANCY = 2; ++ private static int cloudType = 0; ++ private static final List biomes = new ArrayList(); ++ private static boolean biomesLogged; ++ private static Entity fogCamera; ++ private static final Map textColorMap = new HashMap(); ++ private static final int[] textCodeColors = new int[32]; ++ private static final boolean[] textCodeColorSet = new boolean[32]; ++ private static int signTextColor; ++ public static float[] netherFogColor; ++ public static float[] endFogColor; ++ public static int endSkyColor; ++ ++ static void reset() { ++ netherFogColor = new float[] {0.2F, 0.03F, 0.03F}; ++ endFogColor = new float[] {0.075F, 0.075F, 0.094F}; ++ endSkyColor = 1579032; ++ cloudType = 0; ++ textColorMap.clear(); ++ ++ for (int i = 0; i < textCodeColorSet.length; ++i) { ++ textCodeColorSet[i] = false; ++ } ++ ++ signTextColor = 0; ++ } ++ ++ static void reloadFogColors(Properties properties) { ++ Colorizer.loadFloatColor("fog.nether", netherFogColor); ++ Colorizer.loadFloatColor("fog.end", endFogColor); ++ endSkyColor = Colorizer.loadIntColor("sky.end", endSkyColor); ++ } ++ ++ static void reloadCloudType(Properties properties) { ++ String value = properties.getProperty("clouds", "").trim().toLowerCase(); ++ ++ if (value.equals("fast")) { ++ cloudType = 1; ++ } else if (value.equals("fancy")) { ++ cloudType = 2; ++ } ++ } ++ ++ static void reloadTextColors(Properties properties) { ++ for (int i$ = 0; i$ < textCodeColors.length; ++i$) { ++ textCodeColorSet[i$] = Colorizer.loadIntColor("text.code." + i$, textCodeColors, i$); ++ ++ if (textCodeColorSet[i$] && i$ + 16 < textCodeColors.length) { ++ textCodeColors[i$ + 16] = (textCodeColors[i$] & 16579836) >> 2; ++ textCodeColorSet[i$ + 16] = true; ++ } ++ } ++ ++ Iterator var8 = properties.entrySet().iterator(); ++ ++ while (var8.hasNext()) { ++ Entry entry = (Entry)var8.next(); ++ ++ if (entry.getKey() instanceof String && entry.getValue() instanceof String) { ++ String key = (String)entry.getKey(); ++ String value = (String)entry.getValue(); ++ ++ if (key.startsWith("text.") && !key.startsWith("text.code.")) { ++ key = key.substring("text.".length()).trim(); ++ ++ try { ++ int oldColor; ++ ++ if (key.equals("xpbar")) { ++ oldColor = 8453920; ++ } else if (key.equals("boss")) { ++ oldColor = 16711935; ++ } else { ++ oldColor = Integer.parseInt(key, 16); ++ } ++ ++ int e = Integer.parseInt(value, 16); ++ textColorMap.put(Integer.valueOf(oldColor), Integer.valueOf(e)); ++ } catch (NumberFormatException var7) { ++ ; ++ } ++ } ++ } ++ } ++ ++ signTextColor = Colorizer.loadIntColor("text.sign", 0); ++ } ++ ++ public static void setupBiome(BiomeGenBase biome) { ++ biomes.add(biome); ++ } ++ ++ public static void setupForFog(Entity entity) { ++ fogCamera = entity; ++ ++ if (!biomesLogged) { ++ biomesLogged = true; ++ Iterator i$ = biomes.iterator(); ++ ++ while (i$.hasNext()) { ++ BiomeGenBase biome = (BiomeGenBase)i$.next(); ++ int x = ColorMap.getX((double)biome.temperature, (double)biome.rainfall); ++ int y = ColorMap.getY((double)biome.temperature, (double)biome.rainfall); ++ logger.finer("setupBiome #%d \"%s\" %06x (%d,%d)", new Object[] {Integer.valueOf(biome.biomeID), biome.biomeName, Integer.valueOf(biome.waterColorMultiplier), Integer.valueOf(x), Integer.valueOf(y)}); ++ } ++ } ++ } ++ ++ public static boolean computeFogColor(int index) { ++ if (index >= 0 && index < Colorizer.fixedColorMaps.length && fogCamera != null && Colorizer.fixedColorMaps[index].isCustom()) { ++ int x = (int)fogCamera.posX; ++ int y = (int)fogCamera.posY; ++ int z = (int)fogCamera.posZ; ++ Colorizer.fixedColorMaps[index].colorizeWithBlending(x, y, z, fogBlendRadius, Colorizer.setColor); ++ return true; ++ } else { ++ return false; ++ } ++ } ++ ++ public static boolean computeFogColor(World world, float f) { ++ if (world.provider.dimensionId == 0 && computeFogColor(7)) { ++ computeLightningFlash(world, f); ++ return true; ++ } else { ++ return false; ++ } ++ } ++ ++ public static boolean computeSkyColor(World world, float f) { ++ if (world.provider.dimensionId == 0 && computeFogColor(8)) { ++ computeLightningFlash(world, f); ++ return true; ++ } else { ++ return false; ++ } ++ } ++ ++ private static void computeLightningFlash(World world, float f) { ++ if (world.lastLightningBolt > 0) { ++ f = 0.45F * Colorizer.clamp((float)world.lastLightningBolt - f); ++ Colorizer.setColor[0] = Colorizer.setColor[0] * (1.0F - f) + 0.8F * f; ++ Colorizer.setColor[1] = Colorizer.setColor[1] * (1.0F - f) + 0.8F * f; ++ Colorizer.setColor[2] = Colorizer.setColor[2] * (1.0F - f) + 0.8F * f; ++ } ++ } ++ ++ public static boolean drawFancyClouds(boolean fancyGraphics) { ++ switch (cloudType) { ++ case 1: ++ return false; ++ ++ case 2: ++ return true; ++ ++ default: ++ return fancyGraphics; ++ } ++ } ++ ++ public static int colorizeText(int defaultColor) { ++ int high = defaultColor & -16777216; ++ defaultColor &= 16777215; ++ Integer newColor = (Integer)textColorMap.get(Integer.valueOf(defaultColor)); ++ return newColor == null ? high | defaultColor : high | newColor.intValue(); ++ } ++ ++ public static int colorizeText(int defaultColor, int index) { ++ return index >= 0 && index < textCodeColors.length && textCodeColorSet[index] ? defaultColor & -16777216 | textCodeColors[index] : defaultColor; ++ } ++ ++ public static int colorizeSignText() { ++ return signTextColor; ++ } ++ ++ static { ++ try { ++ reset(); ++ } catch (Throwable var1) { ++ var1.printStackTrace(); ++ } ++ } ++} diff --git a/patches/com/prupe/mcpatcher/cc/Colorizer$1.java.patch b/patches/com/prupe/mcpatcher/cc/Colorizer$1.java.patch new file mode 100644 index 0000000..e549771 --- /dev/null +++ b/patches/com/prupe/mcpatcher/cc/Colorizer$1.java.patch @@ -0,0 +1,69 @@ +--- /dev/null ++++ com/prupe/mcpatcher/cc/Colorizer$1.java +@@ -1,0 +1,66 @@ ++package com.prupe.mcpatcher.cc; ++ ++import com.prupe.mcpatcher.TexturePackChangeHandler; ++ ++final class Colorizer$1 extends TexturePackChangeHandler { ++ Colorizer$1(String x0, int x1) { ++ super(x0, x1); ++ } ++ ++ public void beforeChange() { ++ Colorizer.access$000(); ++ } ++ ++ public void afterChange() { ++ Colorizer.access$100(); ++ ColorizeBlock.reloadColorMaps(Colorizer.access$200()); ++ ++ if (Colorizer.useFogColors) { ++ ColorizeWorld.reloadFogColors(Colorizer.access$200()); ++ } ++ ++ if (Colorizer.usePotionColors) { ++ ColorizeItem.reloadPotionColors(Colorizer.access$200()); ++ } ++ ++ if (Colorizer.useSwampColors) { ++ ColorizeBlock.reloadSwampColors(Colorizer.access$200()); ++ } ++ ++ if (Colorizer.useBlockColors) { ++ ColorizeBlock.reloadBlockColors(Colorizer.access$200()); ++ } ++ ++ if (Colorizer.useParticleColors) { ++ ColorizeEntity.reloadParticleColors(Colorizer.access$200()); ++ } ++ ++ if (Colorizer.useRedstoneColors) { ++ ColorizeBlock.reloadRedstoneColors(Colorizer.access$200()); ++ } ++ ++ if (Colorizer.useStemColors) { ++ ColorizeBlock.reloadStemColors(Colorizer.access$200()); ++ } ++ ++ if (Colorizer.useCloudType) { ++ ColorizeWorld.reloadCloudType(Colorizer.access$200()); ++ } ++ ++ if (Colorizer.useMapColors) { ++ ColorizeItem.reloadMapColors(Colorizer.access$200()); ++ } ++ ++ if (Colorizer.useDyeColors) { ++ ColorizeEntity.reloadDyeColors(Colorizer.access$200()); ++ } ++ ++ if (Colorizer.useTextColors) { ++ ColorizeWorld.reloadTextColors(Colorizer.access$200()); ++ } ++ ++ if (Colorizer.useXPOrbColors) { ++ ColorizeEntity.reloadXPOrbColors(Colorizer.access$200()); ++ } ++ } ++} diff --git a/patches/com/prupe/mcpatcher/cc/Colorizer.java.patch b/patches/com/prupe/mcpatcher/cc/Colorizer.java.patch new file mode 100644 index 0000000..a9bdbf7 --- /dev/null +++ b/patches/com/prupe/mcpatcher/cc/Colorizer.java.patch @@ -0,0 +1,169 @@ +--- /dev/null ++++ com/prupe/mcpatcher/cc/Colorizer.java +@@ -1,0 +1,166 @@ ++package com.prupe.mcpatcher.cc; ++ ++import com.prupe.mcpatcher.Config; ++import com.prupe.mcpatcher.MCLogger; ++import com.prupe.mcpatcher.TexturePackAPI; ++import com.prupe.mcpatcher.TexturePackChangeHandler; ++import com.prupe.mcpatcher.cc.Colorizer$1; ++import java.util.Properties; ++import net.minecraft.src.Potion; ++import net.minecraft.src.ResourceLocation; ++ ++public class Colorizer { ++ private static final MCLogger logger = MCLogger.getLogger("Custom Colors"); ++ static final ResourceLocation COLOR_PROPERTIES = TexturePackAPI.newMCPatcherResourceLocation("color.properties"); ++ private static Properties properties; ++ static final boolean useWaterColors = Config.getBoolean("Custom Colors", "water", true); ++ static final boolean useSwampColors = Config.getBoolean("Custom Colors", "swamp", true); ++ static final boolean useTreeColors = Config.getBoolean("Custom Colors", "tree", true); ++ static final boolean usePotionColors = Config.getBoolean("Custom Colors", "potion", true); ++ static final boolean useParticleColors = Config.getBoolean("Custom Colors", "particle", true); ++ static final boolean useFogColors = Config.getBoolean("Custom Colors", "fog", true); ++ static final boolean useCloudType = Config.getBoolean("Custom Colors", "clouds", true); ++ static final boolean useRedstoneColors = Config.getBoolean("Custom Colors", "redstone", true); ++ static final boolean useStemColors = Config.getBoolean("Custom Colors", "stem", true); ++ static final boolean useMapColors = Config.getBoolean("Custom Colors", "map", true); ++ static final boolean useDyeColors = Config.getBoolean("Custom Colors", "dye", true); ++ static final boolean useBlockColors = Config.getBoolean("Custom Colors", "otherBlocks", true); ++ static final boolean useTextColors = Config.getBoolean("Custom Colors", "text", true); ++ static final boolean useXPOrbColors = Config.getBoolean("Custom Colors", "xporb", true); ++ static final boolean useEggColors = Config.getBoolean("Custom Colors", "egg", true); ++ public static final int COLOR_MAP_SWAMP_GRASS = 0; ++ public static final int COLOR_MAP_SWAMP_FOLIAGE = 1; ++ public static final int COLOR_MAP_PINE = 2; ++ public static final int COLOR_MAP_BIRCH = 3; ++ public static final int COLOR_MAP_FOLIAGE = 4; ++ public static final int COLOR_MAP_WATER = 5; ++ public static final int COLOR_MAP_UNDERWATER = 6; ++ public static final int COLOR_MAP_FOG0 = 7; ++ public static final int COLOR_MAP_SKY0 = 8; ++ public static final int NUM_FIXED_COLOR_MAPS = 9; ++ static final ColorMap[] fixedColorMaps = new ColorMap[9]; ++ public static final float[] setColor = new float[3]; ++ ++ public static void setColorF(int color) { ++ intToFloat3(color, setColor); ++ } ++ ++ static void init() {} ++ ++ private static void reset() { ++ properties = new Properties(); ++ ColorizeBlock.reset(); ++ Lightmap.reset(); ++ ColorizeItem.reset(); ++ ColorizeWorld.reset(); ++ ColorizeEntity.reset(); ++ } ++ ++ private static void reloadColorProperties() { ++ if (TexturePackAPI.getProperties(COLOR_PROPERTIES, properties)) { ++ logger.finer("reloading %s", new Object[] {COLOR_PROPERTIES}); ++ } ++ } ++ ++ static String getStringKey(String[] keys, int index) { ++ return keys != null && index >= 0 && index < keys.length && keys[index] != null ? keys[index] : "" + index; ++ } ++ ++ static void loadIntColor(String key, Potion potion) { ++ potion.liquidColor = loadIntColor(key, potion.liquidColor); ++ } ++ ++ static boolean loadIntColor(String key, int[] color, int index) { ++ logger.config("%s=%06x", new Object[] {key, Integer.valueOf(color[index])}); ++ String value = properties.getProperty(key, ""); ++ ++ if (!value.equals("")) { ++ try { ++ color[index] = Integer.parseInt(value, 16); ++ return true; ++ } catch (NumberFormatException var5) { ++ ; ++ } ++ } ++ ++ return false; ++ } ++ ++ static int loadIntColor(String key, int color) { ++ logger.config("%s=%06x", new Object[] {key, Integer.valueOf(color)}); ++ String value = properties.getProperty(key, ""); ++ ++ if (!value.equals("")) { ++ try { ++ return Integer.parseInt(value, 16); ++ } catch (NumberFormatException var4) { ++ ; ++ } ++ } ++ ++ return color; ++ } ++ ++ static void loadFloatColor(String key, float[] color) { ++ int intColor = float3ToInt(color); ++ intToFloat3(loadIntColor(key, intColor), color); ++ } ++ ++ static void intToFloat3(int rgb, float[] f, int offset) { ++ if ((rgb & 16777215) == 16777215) { ++ f[offset] = f[offset + 1] = f[offset + 2] = 1.0F; ++ } else { ++ f[offset] = (float)(rgb & 16711680) / 1.671168E7F; ++ f[offset + 1] = (float)(rgb & 65280) / 65280.0F; ++ f[offset + 2] = (float)(rgb & 255) / 255.0F; ++ } ++ } ++ ++ static void intToFloat3(int rgb, float[] f) { ++ intToFloat3(rgb, f, 0); ++ } ++ ++ static int float3ToInt(float[] f, int offset) { ++ return (int)(255.0F * f[offset]) << 16 | (int)(255.0F * f[offset + 1]) << 8 | (int)(255.0F * f[offset + 2]); ++ } ++ ++ static int float3ToInt(float[] f) { ++ return float3ToInt(f, 0); ++ } ++ ++ static float clamp(float f) { ++ return f < 0.0F ? 0.0F : (f > 1.0F ? 1.0F : f); ++ } ++ ++ static double clamp(double d) { ++ return d < 0.0D ? 0.0D : (d > 1.0D ? 1.0D : d); ++ } ++ ++ static void clamp(float[] f) { ++ for (int i = 0; i < f.length; ++i) { ++ f[i] = clamp(f[i]); ++ } ++ } ++ ++ static void access$000() { ++ reset(); ++ } ++ ++ static void access$100() { ++ reloadColorProperties(); ++ } ++ ++ static Properties access$200() { ++ return properties; ++ } ++ ++ static { ++ try { ++ reset(); ++ } catch (Throwable var1) { ++ var1.printStackTrace(); ++ } ++ ++ TexturePackChangeHandler.register(new Colorizer$1("Custom Colors", 2)); ++ } ++} diff --git a/patches/com/prupe/mcpatcher/cc/Lightmap.java.patch b/patches/com/prupe/mcpatcher/cc/Lightmap.java.patch new file mode 100644 index 0000000..4891ca0 --- /dev/null +++ b/patches/com/prupe/mcpatcher/cc/Lightmap.java.patch @@ -0,0 +1,156 @@ +--- /dev/null ++++ com/prupe/mcpatcher/cc/Lightmap.java +@@ -1,0 +1,153 @@ ++package com.prupe.mcpatcher.cc; ++ ++import com.prupe.mcpatcher.Config; ++import com.prupe.mcpatcher.MCLogger; ++import com.prupe.mcpatcher.TexturePackAPI; ++import java.awt.image.BufferedImage; ++import java.util.HashMap; ++import net.minecraft.src.EntityRenderer; ++import net.minecraft.src.Minecraft; ++import net.minecraft.src.ResourceLocation; ++import net.minecraft.src.World; ++ ++public final class Lightmap { ++ private static final MCLogger logger = MCLogger.getLogger("Custom Colors"); ++ private static final String LIGHTMAP_FORMAT = "lightmap/world%d.png"; ++ private static final int LIGHTMAP_SIZE = 16; ++ private static final int HEIGHT_WITHOUT_NIGHTVISION = 32; ++ private static final int HEIGHT_WITH_NIGHTVISION = 64; ++ private static final boolean useLightmaps = Config.getBoolean("Custom Colors", "lightmaps", true); ++ private static final HashMap lightmaps = new HashMap(); ++ private final int width; ++ private final boolean customNightvision; ++ private final int[] origMap; ++ private final boolean valid; ++ private final float[] sunrgb = new float[48]; ++ private final float[] torchrgb = new float[48]; ++ private final float[] sunrgbnv = new float[48]; ++ private final float[] torchrgbnv = new float[48]; ++ private final float[] rgb = new float[3]; ++ ++ static void reset() { ++ lightmaps.clear(); ++ } ++ ++ public static boolean computeLightmap(EntityRenderer renderer, World world, int[] mapRGB, float partialTick) { ++ if (world != null && useLightmaps) { ++ Lightmap lightmap = null; ++ int worldType = world.provider.dimensionId; ++ ++ if (lightmaps.containsKey(Integer.valueOf(worldType))) { ++ lightmap = (Lightmap)lightmaps.get(Integer.valueOf(worldType)); ++ } else { ++ ResourceLocation resource = TexturePackAPI.newMCPatcherResourceLocation(String.format("lightmap/world%d.png", new Object[] {Integer.valueOf(worldType)})); ++ BufferedImage image = TexturePackAPI.getImage(resource); ++ ++ if (image != null) { ++ lightmap = new Lightmap(resource, image); ++ ++ if (!lightmap.valid) { ++ lightmap = null; ++ } ++ } ++ ++ lightmaps.put(Integer.valueOf(worldType), lightmap); ++ } ++ ++ return lightmap != null && lightmap.compute(renderer, world, mapRGB, partialTick); ++ } else { ++ return false; ++ } ++ } ++ ++ private Lightmap(ResourceLocation resource, BufferedImage image) { ++ this.width = image.getWidth(); ++ int height = image.getHeight(); ++ this.customNightvision = height == 64; ++ this.origMap = new int[this.width * height]; ++ image.getRGB(0, 0, this.width, height, this.origMap, 0, this.width); ++ this.valid = height == 32 || height == 64; ++ ++ if (!this.valid) { ++ logger.error("%s must be exactly %d or %d pixels high", new Object[] {resource, Integer.valueOf(32), Integer.valueOf(64)}); ++ } ++ } ++ ++ private boolean compute(EntityRenderer renderer, World world, int[] mapRGB, float partialTick) { ++ float sun = Colorizer.clamp(world.lastLightningBolt > 0 ? 1.0F : 1.1666666F * (world.getSunBrightness(1.0F) - 0.2F)) * (float)(this.width - 1); ++ float torch = Colorizer.clamp(renderer.torchFlickerX + 0.5F) * (float)(this.width - 1); ++ float nightVisionStrength = renderer.getNightVisionStrength(partialTick); ++ float gamma = Colorizer.clamp(Minecraft.getMinecraft().gameSettings.gammaSetting); ++ int s; ++ ++ for (s = 0; s < 16; ++s) { ++ interpolate(this.origMap, s * this.width, sun, this.sunrgb, 3 * s); ++ interpolate(this.origMap, (s + 16) * this.width, torch, this.torchrgb, 3 * s); ++ ++ if (this.customNightvision && nightVisionStrength > 0.0F) { ++ interpolate(this.origMap, (s + 32) * this.width, sun, this.sunrgbnv, 3 * s); ++ interpolate(this.origMap, (s + 48) * this.width, torch, this.torchrgbnv, 3 * s); ++ } ++ } ++ ++ for (s = 0; s < 16; ++s) { ++ for (int t = 0; t < 16; ++t) { ++ int k; ++ ++ for (k = 0; k < 3; ++k) { ++ this.rgb[k] = Colorizer.clamp(this.sunrgb[3 * s + k] + this.torchrgb[3 * t + k]); ++ } ++ ++ if (nightVisionStrength > 0.0F) { ++ if (this.customNightvision) { ++ for (k = 0; k < 3; ++k) { ++ this.rgb[k] = Colorizer.clamp((1.0F - nightVisionStrength) * this.rgb[k] + nightVisionStrength * (this.sunrgbnv[3 * s + k] + this.torchrgbnv[3 * t + k])); ++ } ++ } else { ++ float var13 = Math.max(Math.max(this.rgb[0], this.rgb[1]), this.rgb[2]); ++ ++ if (var13 > 0.0F) { ++ var13 = 1.0F - nightVisionStrength + nightVisionStrength / var13; ++ ++ for (int tmp = 0; tmp < 3; ++tmp) { ++ this.rgb[tmp] = Colorizer.clamp(this.rgb[tmp] * var13); ++ } ++ } ++ } ++ } ++ ++ if (gamma != 0.0F) { ++ for (k = 0; k < 3; ++k) { ++ float var14 = 1.0F - this.rgb[k]; ++ var14 = 1.0F - var14 * var14 * var14 * var14; ++ this.rgb[k] = gamma * var14 + (1.0F - gamma) * this.rgb[k]; ++ } ++ } ++ ++ mapRGB[s * 16 + t] = -16777216 | Colorizer.float3ToInt(this.rgb); ++ } ++ } ++ ++ return true; ++ } ++ ++ private static void interpolate(int[] map, int offset1, float x, float[] rgb, int offset2) { ++ int x0 = (int)Math.floor((double)x); ++ int x1 = (int)Math.ceil((double)x); ++ ++ if (x0 == x1) { ++ Colorizer.intToFloat3(map[offset1 + x0], rgb, offset2); ++ } else { ++ float xf = x - (float)x0; ++ float xg = 1.0F - xf; ++ float[] rgb0 = new float[3]; ++ float[] rgb1 = new float[3]; ++ Colorizer.intToFloat3(map[offset1 + x0], rgb0); ++ Colorizer.intToFloat3(map[offset1 + x1], rgb1); ++ ++ for (int i = 0; i < 3; ++i) { ++ rgb[offset2 + i] = xg * rgb0[i] + xf * rgb1[i]; ++ } ++ } ++ } ++} diff --git a/patches/com/prupe/mcpatcher/ctm/CTMUtils$1.java.patch b/patches/com/prupe/mcpatcher/ctm/CTMUtils$1.java.patch new file mode 100644 index 0000000..a0a583b --- /dev/null +++ b/patches/com/prupe/mcpatcher/ctm/CTMUtils$1.java.patch @@ -0,0 +1,92 @@ +--- /dev/null ++++ com/prupe/mcpatcher/ctm/CTMUtils$1.java +@@ -1,0 +1,89 @@ ++package com.prupe.mcpatcher.ctm; ++ ++import com.prupe.mcpatcher.TexturePackAPI; ++import com.prupe.mcpatcher.TexturePackChangeHandler; ++import com.prupe.mcpatcher.TileLoader; ++import com.prupe.mcpatcher.ctm.TileOverrideImpl$BetterGrass; ++import java.util.Arrays; ++import java.util.Iterator; ++import net.minecraft.src.Block; ++import net.minecraft.src.ResourceLocation; ++ ++final class CTMUtils$1 extends TexturePackChangeHandler { ++ CTMUtils$1(String x0, int x1) { ++ super(x0, x1); ++ } ++ ++ public void initialize() {} ++ ++ public void beforeChange() { ++ RenderPassAPI.instance.clear(); ++ CTMUtils.access$000().clear(); ++ Arrays.fill(CTMUtils.access$100(), (Object)null); ++ CTMUtils.access$200().clear(); ++ CTMUtils.access$302(new TileLoader("textures/blocks", true, CTMUtils.access$400())); ++ CTMUtils.access$502((TileOverrideImpl$BetterGrass)null); ++ ++ if (CTMUtils.access$600() || CTMUtils.access$700()) { ++ Iterator i$ = TexturePackAPI.listResources("mcpatcher/ctm", ".properties", true, false, true).iterator(); ++ ++ while (i$.hasNext()) { ++ ResourceLocation resource = (ResourceLocation)i$.next(); ++ CTMUtils.access$800(TileOverride.create(resource, CTMUtils.access$300())); ++ } ++ } ++ } ++ ++ public void afterChange() { ++ if (CTMUtils.access$900()) { ++ CTMUtils.access$800(CTMUtils.access$502(new TileOverrideImpl$BetterGrass(CTMUtils.access$300(), 2, "grass"))); ++ CTMUtils.access$800(new TileOverrideImpl$BetterGrass(CTMUtils.access$300(), 110, "mycel")); ++ } ++ ++ Iterator i$ = CTMUtils.access$000().iterator(); ++ ++ while (i$.hasNext()) { ++ ITileOverride overrides = (ITileOverride)i$.next(); ++ overrides.registerIcons(); ++ } ++ ++ int i$1; ++ ITileOverride[] var8; ++ ++ for (int var6 = 0; var6 < CTMUtils.access$100().length; ++var6) { ++ if (CTMUtils.access$100()[var6] != null && Block.blocksList[var6] != null) { ++ var8 = CTMUtils.access$100()[var6]; ++ i$1 = var8.length; ++ ++ for (int overrides1 = 0; overrides1 < i$1; ++overrides1) { ++ ITileOverride override = var8[overrides1]; ++ ++ if (override != null && !override.isDisabled() && override.getRenderPass() >= 0) { ++ RenderPassAPI.instance.setRenderPassForBlock(Block.blocksList[var6], override.getRenderPass()); ++ } ++ } ++ } ++ } ++ ++ ITileOverride[][] var7 = CTMUtils.access$100(); ++ int var9 = var7.length; ++ ++ for (i$1 = 0; i$1 < var9; ++i$1) { ++ ITileOverride[] var10 = var7[i$1]; ++ this.sortOverrides(var10); ++ } ++ ++ i$ = CTMUtils.access$200().values().iterator(); ++ ++ while (i$.hasNext()) { ++ var8 = (ITileOverride[])i$.next(); ++ this.sortOverrides(var8); ++ } ++ } ++ ++ private void sortOverrides(ITileOverride[] overrides) { ++ if (overrides != null) { ++ Arrays.sort(overrides); ++ } ++ } ++} diff --git a/patches/com/prupe/mcpatcher/ctm/CTMUtils$2.java.patch b/patches/com/prupe/mcpatcher/ctm/CTMUtils$2.java.patch new file mode 100644 index 0000000..19e7025 --- /dev/null +++ b/patches/com/prupe/mcpatcher/ctm/CTMUtils$2.java.patch @@ -0,0 +1,34 @@ +--- /dev/null ++++ com/prupe/mcpatcher/ctm/CTMUtils$2.java +@@ -1,0 +1,31 @@ ++package com.prupe.mcpatcher.ctm; ++ ++import com.prupe.mcpatcher.ctm.CTMUtils$TileOverrideIterator; ++import net.minecraft.src.Block; ++import net.minecraft.src.IBlockAccess; ++import net.minecraft.src.Icon; ++ ++final class CTMUtils$2 extends CTMUtils$TileOverrideIterator { ++ final IBlockAccess val$blockAccess; ++ ++ final int val$i; ++ ++ final int val$j; ++ ++ final int val$k; ++ ++ final int val$face; ++ ++ CTMUtils$2(Block x0, Icon x1, IBlockAccess var3, int var4, int var5, int var6, int var7) { ++ super(x0, x1); ++ this.val$blockAccess = var3; ++ this.val$i = var4; ++ this.val$j = var5; ++ this.val$k = var6; ++ this.val$face = var7; ++ } ++ ++ Icon getTile(ITileOverride override, Block block, Icon currentIcon) { ++ return override.getTile(this.val$blockAccess, block, currentIcon, this.val$i, this.val$j, this.val$k, this.val$face); ++ } ++} diff --git a/patches/com/prupe/mcpatcher/ctm/CTMUtils$3.java.patch b/patches/com/prupe/mcpatcher/ctm/CTMUtils$3.java.patch new file mode 100644 index 0000000..a3d1c28 --- /dev/null +++ b/patches/com/prupe/mcpatcher/ctm/CTMUtils$3.java.patch @@ -0,0 +1,24 @@ +--- /dev/null ++++ com/prupe/mcpatcher/ctm/CTMUtils$3.java +@@ -1,0 +1,21 @@ ++package com.prupe.mcpatcher.ctm; ++ ++import com.prupe.mcpatcher.ctm.CTMUtils$TileOverrideIterator; ++import net.minecraft.src.Block; ++import net.minecraft.src.Icon; ++ ++final class CTMUtils$3 extends CTMUtils$TileOverrideIterator { ++ final int val$face; ++ ++ final int val$metadata; ++ ++ CTMUtils$3(Block x0, Icon x1, int var3, int var4) { ++ super(x0, x1); ++ this.val$face = var3; ++ this.val$metadata = var4; ++ } ++ ++ Icon getTile(ITileOverride override, Block block, Icon currentIcon) { ++ return override.getTile(block, currentIcon, this.val$face, this.val$metadata); ++ } ++} diff --git a/patches/com/prupe/mcpatcher/ctm/CTMUtils$TileOverrideIterator.java.patch b/patches/com/prupe/mcpatcher/ctm/CTMUtils$TileOverrideIterator.java.patch new file mode 100644 index 0000000..ec98fc7 --- /dev/null +++ b/patches/com/prupe/mcpatcher/ctm/CTMUtils$TileOverrideIterator.java.patch @@ -0,0 +1,114 @@ +--- /dev/null ++++ com/prupe/mcpatcher/ctm/CTMUtils$TileOverrideIterator.java +@@ -1,0 +1,111 @@ ++package com.prupe.mcpatcher.ctm; ++ ++import java.util.HashSet; ++import java.util.Iterator; ++import java.util.Set; ++import net.minecraft.src.Block; ++import net.minecraft.src.Icon; ++ ++abstract class CTMUtils$TileOverrideIterator implements Iterator { ++ private final Block block; ++ private Icon currentIcon; ++ private ITileOverride[] blockOverrides; ++ private ITileOverride[] iconOverrides; ++ private final Set skipOverrides = new HashSet(); ++ private int blockPos; ++ private int iconPos; ++ private boolean foundNext; ++ private ITileOverride nextOverride; ++ private ITileOverride lastMatchedOverride; ++ ++ CTMUtils$TileOverrideIterator(Block block, Icon icon) { ++ this.block = block; ++ this.currentIcon = icon; ++ this.blockOverrides = CTMUtils.access$100()[block.blockID]; ++ this.iconOverrides = (ITileOverride[])CTMUtils.access$200().get(this.currentIcon.getIconName()); ++ } ++ ++ private void resetForNextPass() { ++ this.blockOverrides = null; ++ this.iconOverrides = (ITileOverride[])CTMUtils.access$200().get(this.currentIcon.getIconName()); ++ this.blockPos = 0; ++ this.iconPos = 0; ++ this.foundNext = false; ++ } ++ ++ public boolean hasNext() { ++ if (this.foundNext) { ++ return true; ++ } else { ++ if (this.iconOverrides != null) { ++ while (this.iconPos < this.iconOverrides.length) { ++ if (this.checkOverride(this.iconOverrides[this.iconPos++])) { ++ return true; ++ } ++ } ++ } ++ ++ if (this.blockOverrides != null) { ++ while (this.blockPos < this.blockOverrides.length) { ++ if (this.checkOverride(this.blockOverrides[this.blockPos++])) { ++ return true; ++ } ++ } ++ } ++ ++ return false; ++ } ++ } ++ ++ public ITileOverride next() { ++ if (!this.foundNext) { ++ throw new IllegalStateException("next called before hasNext() == true"); ++ } else { ++ this.foundNext = false; ++ return this.nextOverride; ++ } ++ } ++ ++ public void remove() { ++ throw new UnsupportedOperationException("remove not supported"); ++ } ++ ++ private boolean checkOverride(ITileOverride override) { ++ if (override != null && !override.isDisabled() && !this.skipOverrides.contains(override)) { ++ this.foundNext = true; ++ this.nextOverride = override; ++ return true; ++ } else { ++ return false; ++ } ++ } ++ ++ ITileOverride go() { ++ for (int pass = 0; pass < CTMUtils.access$1000(); ++pass) { ++ ITileOverride override; ++ Icon newIcon; ++ ++ do { ++ if (!this.hasNext()) { ++ return this.lastMatchedOverride; ++ } ++ ++ override = this.next(); ++ newIcon = this.getTile(override, this.block, this.currentIcon); ++ } while (newIcon == null); ++ ++ this.lastMatchedOverride = override; ++ this.skipOverrides.add(override); ++ this.currentIcon = newIcon; ++ this.resetForNextPass(); ++ } ++ ++ return this.lastMatchedOverride; ++ } ++ ++ Icon getIcon() { ++ return this.currentIcon; ++ } ++ ++ abstract Icon getTile(ITileOverride var1, Block var2, Icon var3); ++} diff --git a/patches/com/prupe/mcpatcher/ctm/CTMUtils.java.patch b/patches/com/prupe/mcpatcher/ctm/CTMUtils.java.patch new file mode 100644 index 0000000..ae15d9a --- /dev/null +++ b/patches/com/prupe/mcpatcher/ctm/CTMUtils.java.patch @@ -0,0 +1,264 @@ +--- /dev/null ++++ com/prupe/mcpatcher/ctm/CTMUtils.java +@@ -1,0 +1,261 @@ ++package com.prupe.mcpatcher.ctm; ++ ++import com.prupe.mcpatcher.Config; ++import com.prupe.mcpatcher.MCLogger; ++import com.prupe.mcpatcher.TessellatorUtils; ++import com.prupe.mcpatcher.TexturePackChangeHandler; ++import com.prupe.mcpatcher.TileLoader; ++import com.prupe.mcpatcher.ctm.CTMUtils$1; ++import com.prupe.mcpatcher.ctm.CTMUtils$2; ++import com.prupe.mcpatcher.ctm.CTMUtils$3; ++import com.prupe.mcpatcher.ctm.TileOverrideImpl$BetterGrass; ++import java.util.ArrayList; ++import java.util.HashMap; ++import java.util.Iterator; ++import java.util.List; ++import java.util.Map; ++import net.minecraft.src.Block; ++import net.minecraft.src.IBlockAccess; ++import net.minecraft.src.Icon; ++import net.minecraft.src.RenderBlocks; ++import net.minecraft.src.Tessellator; ++ ++//Spout Start ++import org.spoutcraft.client.config.Configuration; ++//Spout End ++ ++public class CTMUtils { ++ private static final MCLogger logger = MCLogger.getLogger("Connected Textures", "CTM"); ++ private static final boolean enableStandard = Config.getBoolean("Connected Textures", "standard", true); ++ private static final boolean enableNonStandard = Config.getBoolean("Connected Textures", "nonStandard", true); ++ private static final boolean enableGrass = Config.getBoolean("Connected Textures", "grass", false); ++ private static final int maxRecursion = Config.getInt("Connected Textures", "maxRecursion", 4); ++ static final int BLOCK_ID_GRASS = 2; ++ static final int BLOCK_ID_MYCELIUM = 110; ++ static final int BLOCK_ID_SNOW = 78; ++ static final int BLOCK_ID_CRAFTED_SNOW = 80; ++ private static final List allOverrides = new ArrayList(); ++ private static final ITileOverride[][] blockOverrides = new ITileOverride[Block.blocksList.length][]; ++ private static final Map tileOverrides = new HashMap(); ++ private static TileLoader tileLoader; ++ private static TileOverrideImpl$BetterGrass betterGrass; ++ static boolean active; ++ static ITileOverride lastOverride; ++ ++ public static void start() { ++ lastOverride = null; ++ active = tileLoader.setDefaultTextureMap(Tessellator.instance); ++ } ++ ++ public static Icon getTile(RenderBlocks renderBlocks, Block block, int i, int j, int k, Icon origIcon, Tessellator tessellator) { ++ return getTile(renderBlocks, block, i, j, k, -1, origIcon, tessellator); ++ } ++ ++ public static Icon getTile(RenderBlocks renderBlocks, Block block, int i, int j, int k, int face, Icon icon, Tessellator tessellator) { ++ lastOverride = null; ++ ++ if (checkFace(face) && checkBlock(renderBlocks, block)) { ++ IBlockAccess blockAccess = renderBlocks.blockAccess; ++ CTMUtils$2 iterator = new CTMUtils$2(block, icon, blockAccess, i, j, k, face); ++ lastOverride = iterator.go(); ++ ++ if (lastOverride != null) { ++ icon = iterator.getIcon(); ++ } ++ } ++ ++ return lastOverride == null && skipDefaultRendering(block) ? null : icon; ++ } ++ ++ public static Icon getTile(RenderBlocks renderBlocks, Block block, int face, int metadata, Tessellator tessellator) { ++ return getTile(renderBlocks, block, face, metadata, renderBlocks.getBlockIconFromSideAndMetadata(block, face, metadata), tessellator); ++ } ++ ++ public static Icon getTile(RenderBlocks renderBlocks, Block block, int face, Tessellator tessellator) { ++ return getTile(renderBlocks, block, face, 0, renderBlocks.getBlockIconFromSide(block, face), tessellator); ++ } ++ ++ private static Icon getTile(RenderBlocks renderBlocks, Block block, int face, int metadata, Icon icon, Tessellator tessellator) { ++ lastOverride = null; ++ ++ if (checkFace(face) && checkRenderType(block)) { ++ CTMUtils$3 iterator = new CTMUtils$3(block, icon, face, metadata); ++ lastOverride = iterator.go(); ++ ++ if (lastOverride != null) { ++ icon = iterator.getIcon(); ++ } ++ } ++ ++ return icon; ++ } ++ ++ public static void reset() {} ++ ++ public static void finish() { ++ reset(); ++ RenderPassAPI.instance.finish(); ++ TessellatorUtils.clearDefaultTextureMap(Tessellator.instance); ++ lastOverride = null; ++ active = false; ++ } ++ ++ public static boolean isBetterGrass(IBlockAccess blockAccess, Block block, int i, int j, int k, int face) { ++ return betterGrass != null && betterGrass.isBetterGrass(blockAccess, block, i, j, k, face); ++ } ++ ++ private static boolean checkBlock(RenderBlocks renderBlocks, Block block) { ++ return active && renderBlocks.blockAccess != null; ++ } ++ ++ private static boolean checkFace(int face) { ++ boolean var10000; ++ ++ if (active) { ++ label25: { ++ if (face < 0) { ++ if (!enableNonStandard) { ++ break label25; ++ } ++ } else if (!enableStandard) { ++ break label25; ++ } ++ ++ var10000 = true; ++ return var10000; ++ } ++ } ++ ++ var10000 = false; ++ return var10000; ++ } ++ ++ private static boolean checkRenderType(Block block) { ++ switch (block.getRenderType()) { ++ case 11: ++ case 21: ++ return false; ++ ++ default: ++ return true; ++ } ++ } ++ ++ private static boolean skipDefaultRendering(Block block) { ++ return RenderPassAPI.instance.skipDefaultRendering(block); ++ } ++ ++ private static void registerOverride(ITileOverride override) { ++ if (override != null && !override.isDisabled()) { ++ boolean registered = false; ++ Iterator i$; ++ ++ if (override.getMatchingBlocks() != null) { ++ for (i$ = override.getMatchingBlocks().iterator(); i$.hasNext(); registered = true) { ++ int name = ((Integer)i$.next()).intValue(); ++ String blockName = ""; ++ ++ if (name >= 0 && name < Block.blocksList.length && Block.blocksList[name] != null) { ++ blockName = Block.blocksList[name].getUnlocalizedName(); ++ ++ if (blockName == null) { ++ blockName = ""; ++ } else { ++ blockName = " (" + blockName.replaceFirst("^tile\\.", "") + ")"; ++ } ++ } ++ ++ blockOverrides[name] = registerOverride(blockOverrides[name], override, "block " + name + blockName); ++ } ++ } ++ ++ if (override.getMatchingTiles() != null) { ++ for (i$ = override.getMatchingTiles().iterator(); i$.hasNext(); registered = true) { ++ String name1 = (String)i$.next(); ++ tileOverrides.put(name1, registerOverride((ITileOverride[])tileOverrides.get(name1), override, "tile " + name1)); ++ } ++ } ++ ++ if (registered) { ++ allOverrides.add(override); ++ } ++ } ++ } ++ ++ private static ITileOverride[] registerOverride(ITileOverride[] overrides, ITileOverride override, String description) { ++ logger.fine("using %s for %s", new Object[] {override, description}); ++ ++ if (overrides == null) { ++ return new ITileOverride[] {override}; ++ } else { ++ ITileOverride[] newList = new ITileOverride[overrides.length + 1]; ++ System.arraycopy(overrides, 0, newList, 0, overrides.length); ++ newList[overrides.length] = override; ++ return newList; ++ } ++ } ++ ++ static List access$000() { ++ return allOverrides; ++ } ++ ++ static ITileOverride[][] access$100() { ++ return blockOverrides; ++ } ++ ++ static Map access$200() { ++ return tileOverrides; ++ } ++ ++ static TileLoader access$302(TileLoader x0) { ++ tileLoader = x0; ++ return x0; ++ } ++ ++ static MCLogger access$400() { ++ return logger; ++ } ++ ++ static TileOverrideImpl$BetterGrass access$502(TileOverrideImpl$BetterGrass x0) { ++ betterGrass = x0; ++ return x0; ++ } ++ ++ static boolean access$600() { ++ return enableStandard; ++ } ++ ++ static boolean access$700() { ++ return enableNonStandard; ++ } ++ ++ static TileLoader access$300() { ++ return tileLoader; ++ } ++ ++ static void access$800(ITileOverride x0) { ++ registerOverride(x0); ++ } ++ ++ static boolean access$900() { ++ if (Configuration.betterGrass !=0) { ++ return true; ++ } else { ++ return false; ++ } ++ } ++ ++ static int access$1000() { ++ return maxRecursion; ++ } ++ ++ static { ++ try { ++ Class.forName("com.prupe.mcpatcher.ctm.RenderPass").getMethod("finish", new Class[0]).invoke((Object)null, new Object[0]); ++ } catch (Throwable var1) { ++ ; ++ } ++ ++ TexturePackChangeHandler.register(new CTMUtils$1("Connected Textures", 3)); ++ } ++} diff --git a/patches/com/prupe/mcpatcher/ctm/GlassPaneRenderer.java.patch b/patches/com/prupe/mcpatcher/ctm/GlassPaneRenderer.java.patch new file mode 100644 index 0000000..d09d835 --- /dev/null +++ b/patches/com/prupe/mcpatcher/ctm/GlassPaneRenderer.java.patch @@ -0,0 +1,142 @@ +--- /dev/null ++++ com/prupe/mcpatcher/ctm/GlassPaneRenderer.java +@@ -1,0 +1,139 @@ ++package com.prupe.mcpatcher.ctm; ++ ++import com.prupe.mcpatcher.Config; ++import com.prupe.mcpatcher.TessellatorUtils; ++import java.util.Arrays; ++import net.minecraft.src.Block; ++import net.minecraft.src.Icon; ++import net.minecraft.src.RenderBlocks; ++import net.minecraft.src.Tessellator; ++ ++//Spout Start ++import org.spoutcraft.client.config.Configuration; ++//Spout End ++ ++public class GlassPaneRenderer { ++ private static final boolean enable = Config.getBoolean("Connected Textures", "glassPane", true); ++ public static boolean active; ++ private static final Icon[] icons = new Icon[6]; ++ private static Tessellator tessellator; ++ private static double u0; ++ private static double uM; ++ private static double u1; ++ private static double v0; ++ private static double v1; ++ ++ public static void render(RenderBlocks renderBlocks, Block blockPane, Icon origIcon, int i, int j, int k, boolean connectNorth, boolean connectSouth, boolean connectWest, boolean connectEast) { ++ if (!Configuration.isConnectedTextures()) { ++ active = false; ++ } else { ++ active = true; ++ ++ for (int i0 = 2; i0 <= 5; ++i0) { ++ icons[i0] = CTMUtils.getTile(renderBlocks, blockPane, i, j, k, i0, origIcon, Tessellator.instance); ++ ++ if (icons[i0] == null) { ++ active = RenderPassAPI.instance.skipDefaultRendering(blockPane); ++ return; ++ } ++ } ++ ++ double var27 = (double)i; ++ double iM = var27 + 0.5D; ++ double i1 = var27 + 1.0D; ++ double j0 = (double)j; ++ double j1 = j0 + 1.0D; ++ double k0 = (double)k; ++ double kM = k0 + 0.5D; ++ double k1 = k0 + 1.0D; ++ boolean connectAny = connectWest || connectEast || connectNorth || connectSouth; ++ ++ if ((!connectEast || !connectWest) && connectAny) { ++ if (connectWest && !connectEast) { ++ setupTileCoords(3); ++ tessellator.addVertexWithUV(var27, j1, kM, uM, v0); ++ tessellator.addVertexWithUV(var27, j0, kM, uM, v1); ++ tessellator.addVertexWithUV(iM, j0, kM, u1, v1); ++ tessellator.addVertexWithUV(iM, j1, kM, u1, v0); ++ setupTileCoords(2); ++ tessellator.addVertexWithUV(iM, j1, kM, u0, v0); ++ tessellator.addVertexWithUV(iM, j0, kM, u0, v1); ++ tessellator.addVertexWithUV(var27, j0, kM, uM, v1); ++ tessellator.addVertexWithUV(var27, j1, kM, uM, v0); ++ } else if (!connectWest && connectEast) { ++ setupTileCoords(3); ++ tessellator.addVertexWithUV(iM, j1, kM, u0, v0); ++ tessellator.addVertexWithUV(iM, j0, kM, u0, v1); ++ tessellator.addVertexWithUV(i1, j0, kM, uM, v1); ++ tessellator.addVertexWithUV(i1, j1, kM, uM, v0); ++ setupTileCoords(2); ++ tessellator.addVertexWithUV(i1, j1, kM, uM, v0); ++ tessellator.addVertexWithUV(i1, j0, kM, uM, v1); ++ tessellator.addVertexWithUV(iM, j0, kM, u1, v1); ++ tessellator.addVertexWithUV(iM, j1, kM, u1, v0); ++ } ++ } else { ++ setupTileCoords(3); ++ tessellator.addVertexWithUV(var27, j1, kM, u0, v0); ++ tessellator.addVertexWithUV(var27, j0, kM, u0, v1); ++ tessellator.addVertexWithUV(i1, j0, kM, u1, v1); ++ tessellator.addVertexWithUV(i1, j1, kM, u1, v0); ++ setupTileCoords(2); ++ tessellator.addVertexWithUV(i1, j1, kM, u0, v0); ++ tessellator.addVertexWithUV(i1, j0, kM, u0, v1); ++ tessellator.addVertexWithUV(var27, j0, kM, u1, v1); ++ tessellator.addVertexWithUV(var27, j1, kM, u1, v0); ++ } ++ ++ if ((!connectNorth || !connectSouth) && connectAny) { ++ if (connectNorth && !connectSouth) { ++ setupTileCoords(4); ++ tessellator.addVertexWithUV(iM, j1, k0, uM, v0); ++ tessellator.addVertexWithUV(iM, j0, k0, uM, v1); ++ tessellator.addVertexWithUV(iM, j0, kM, u1, v1); ++ tessellator.addVertexWithUV(iM, j1, kM, u1, v0); ++ setupTileCoords(5); ++ tessellator.addVertexWithUV(iM, j1, kM, u0, v0); ++ tessellator.addVertexWithUV(iM, j0, kM, u0, v1); ++ tessellator.addVertexWithUV(iM, j0, k0, uM, v1); ++ tessellator.addVertexWithUV(iM, j1, k0, uM, v0); ++ } else if (!connectNorth && connectSouth) { ++ setupTileCoords(4); ++ tessellator.addVertexWithUV(iM, j1, kM, u0, v0); ++ tessellator.addVertexWithUV(iM, j0, kM, u0, v1); ++ tessellator.addVertexWithUV(iM, j0, k1, uM, v1); ++ tessellator.addVertexWithUV(iM, j1, k1, uM, v0); ++ setupTileCoords(5); ++ tessellator.addVertexWithUV(iM, j1, k1, uM, v0); ++ tessellator.addVertexWithUV(iM, j0, k1, uM, v1); ++ tessellator.addVertexWithUV(iM, j0, kM, u1, v1); ++ tessellator.addVertexWithUV(iM, j1, kM, u1, v0); ++ } ++ } else { ++ setupTileCoords(4); ++ tessellator.addVertexWithUV(iM, j1, k0, u0, v0); ++ tessellator.addVertexWithUV(iM, j0, k0, u0, v1); ++ tessellator.addVertexWithUV(iM, j0, k1, u1, v1); ++ tessellator.addVertexWithUV(iM, j1, k1, u1, v0); ++ setupTileCoords(5); ++ tessellator.addVertexWithUV(iM, j1, k1, u0, v0); ++ tessellator.addVertexWithUV(iM, j0, k1, u0, v1); ++ tessellator.addVertexWithUV(iM, j0, k0, u1, v1); ++ tessellator.addVertexWithUV(iM, j1, k0, u1, v0); ++ } ++ ++ Arrays.fill(icons, (Object)null); ++ tessellator = null; ++ } ++ } ++ ++ private static void setupTileCoords(int face) { ++ Icon icon = icons[face]; ++ tessellator = TessellatorUtils.getTessellator(Tessellator.instance, icons[face]); ++ u0 = (double)icon.getMinU(); ++ uM = (double)icon.getInterpolatedU(8.0D); ++ u1 = (double)icon.getMaxU(); ++ v0 = (double)icon.getMinV(); ++ v1 = (double)icon.getMaxV(); ++ } ++} diff --git a/patches/com/prupe/mcpatcher/ctm/ITileOverride.java.patch b/patches/com/prupe/mcpatcher/ctm/ITileOverride.java.patch new file mode 100644 index 0000000..b8f15ed --- /dev/null +++ b/patches/com/prupe/mcpatcher/ctm/ITileOverride.java.patch @@ -0,0 +1,27 @@ +--- /dev/null ++++ com/prupe/mcpatcher/ctm/ITileOverride.java +@@ -1,0 +1,24 @@ ++package com.prupe.mcpatcher.ctm; ++ ++import java.util.Set; ++import net.minecraft.src.Block; ++import net.minecraft.src.IBlockAccess; ++import net.minecraft.src.Icon; ++ ++interface ITileOverride extends Comparable { ++ boolean isDisabled(); ++ ++ void registerIcons(); ++ ++ Set getMatchingBlocks(); ++ ++ Set getMatchingTiles(); ++ ++ int getRenderPass(); ++ ++ int getWeight(); ++ ++ Icon getTile(IBlockAccess var1, Block var2, Icon var3, int var4, int var5, int var6, int var7); ++ ++ Icon getTile(Block var1, Icon var2, int var3, int var4); ++} diff --git a/patches/com/prupe/mcpatcher/ctm/RenderPass$1.java.patch b/patches/com/prupe/mcpatcher/ctm/RenderPass$1.java.patch new file mode 100644 index 0000000..4406e18 --- /dev/null +++ b/patches/com/prupe/mcpatcher/ctm/RenderPass$1.java.patch @@ -0,0 +1,51 @@ +--- /dev/null ++++ com/prupe/mcpatcher/ctm/RenderPass$1.java +@@ -1,0 +1,48 @@ ++package com.prupe.mcpatcher.ctm; ++ ++import java.util.Arrays; ++import net.minecraft.src.Block; ++ ++final class RenderPass$1 extends RenderPassAPI { ++ boolean skipDefaultRendering(Block block) { ++ return RenderPass.access$000() > 1; ++ } ++ ++ boolean skipThisRenderPass(Block block, int pass) { ++ if (pass < 0) { ++ pass = block.getRenderBlockPass(); ++ } ++ ++ return pass != RenderPass.access$000(); ++ } ++ ++ void clear() { ++ RenderPass.access$102(1); ++ Arrays.fill(RenderPass.access$200(), -1); ++ Arrays.fill(RenderPass.access$300(), -1); ++ ++ for (int i = 0; i < Block.blocksList.length; ++i) { ++ Block block = Block.blocksList[i]; ++ ++ if (block != null) { ++ RenderPass.access$200()[i] = block.getRenderBlockPass(); ++ } ++ } ++ } ++ ++ void setRenderPassForBlock(Block block, int pass) { ++ if (pass >= 0) { ++ if (pass <= 2) { ++ RenderPass.access$200()[block.blockID] = pass; ++ } else { ++ RenderPass.access$300()[block.blockID] = pass; ++ } ++ ++ RenderPass.access$102(Math.max(RenderPass.access$100(), pass)); ++ } ++ } ++ ++ void finish() { ++ RenderPass.finish(); ++ } ++} diff --git a/patches/com/prupe/mcpatcher/ctm/RenderPass$2.java.patch b/patches/com/prupe/mcpatcher/ctm/RenderPass$2.java.patch new file mode 100644 index 0000000..1a51686 --- /dev/null +++ b/patches/com/prupe/mcpatcher/ctm/RenderPass$2.java.patch @@ -0,0 +1,37 @@ +--- /dev/null ++++ com/prupe/mcpatcher/ctm/RenderPass$2.java +@@ -1,0 +1,34 @@ ++package com.prupe.mcpatcher.ctm; ++ ++import com.prupe.mcpatcher.BlendMethod; ++import com.prupe.mcpatcher.MCPatcherUtils; ++import com.prupe.mcpatcher.TexturePackAPI; ++import com.prupe.mcpatcher.TexturePackChangeHandler; ++import java.util.Properties; ++ ++final class RenderPass$2 extends TexturePackChangeHandler { ++ RenderPass$2(String x0, int x1) { ++ super(x0, x1); ++ } ++ ++ public void beforeChange() { ++ RenderPass.access$402(BlendMethod.ALPHA); ++ RenderPass.access$502(true); ++ } ++ ++ public void afterChange() { ++ Properties properties = TexturePackAPI.getProperties(RenderPass.access$600()); ++ ++ if (properties != null) { ++ String method = properties.getProperty("blend.3", "alpha").trim().toLowerCase(); ++ RenderPass.access$402(BlendMethod.parse(method)); ++ ++ if (RenderPass.access$400() == null) { ++ RenderPass.access$700().error("%s: unknown blend method \'%s\'", new Object[] {RenderPass.access$600(), method}); ++ RenderPass.access$402(BlendMethod.ALPHA); ++ } ++ ++ RenderPass.access$502(MCPatcherUtils.getBooleanProperty(properties, "enableLightmap.3", !RenderPass.access$400().isColorBased())); ++ } ++ } ++} diff --git a/patches/com/prupe/mcpatcher/ctm/RenderPass.java.patch b/patches/com/prupe/mcpatcher/ctm/RenderPass.java.patch new file mode 100644 index 0000000..9f18d2e --- /dev/null +++ b/patches/com/prupe/mcpatcher/ctm/RenderPass.java.patch @@ -0,0 +1,149 @@ +--- /dev/null ++++ com/prupe/mcpatcher/ctm/RenderPass.java +@@ -1,0 +1,146 @@ ++package com.prupe.mcpatcher.ctm; ++ ++import com.prupe.mcpatcher.BlendMethod; ++import com.prupe.mcpatcher.MCLogger; ++import com.prupe.mcpatcher.TexturePackAPI; ++import com.prupe.mcpatcher.TexturePackChangeHandler; ++import com.prupe.mcpatcher.ctm.RenderPass$1; ++import com.prupe.mcpatcher.ctm.RenderPass$2; ++import net.minecraft.src.Block; ++import net.minecraft.src.EntityLivingBase; ++import net.minecraft.src.EntityRenderer; ++import net.minecraft.src.IBlockAccess; ++import net.minecraft.src.RenderGlobal; ++import net.minecraft.src.ResourceLocation; ++import org.lwjgl.opengl.GL11; ++ ++public class RenderPass { ++ private static final MCLogger logger = MCLogger.getLogger("Better Glass"); ++ private static final ResourceLocation RENDERPASS_PROPERTIES = TexturePackAPI.newMCPatcherResourceLocation("renderpass.properties"); ++ private static final int[] baseRenderPass = new int[Block.blocksList.length]; ++ private static final int[] extraRenderPass = new int[Block.blocksList.length]; ++ private static BlendMethod blendMethod; ++ private static boolean enableLightmap; ++ private static int renderPass = -1; ++ private static int maxRenderPass = 1; ++ private static boolean ambientOcclusion; ++ ++ public static void start(int pass) { ++ finish(); ++ renderPass = pass; ++ } ++ ++ public static void finish() { ++ renderPass = -1; ++ } ++ ++ public static boolean skipAllRenderPasses(boolean[] skipRenderPass) { ++ return skipRenderPass[0] && skipRenderPass[1] && skipRenderPass[2] && skipRenderPass[3]; ++ } ++ ++ public static int getBlockRenderPass(Block block) { ++ return renderPass <= 2 ? baseRenderPass[block.blockID] : extraRenderPass[block.blockID]; ++ } ++ ++ public static boolean canRenderInPass(Block block, int pass, boolean renderThis) { ++ return baseRenderPass[block.blockID] < 2 && extraRenderPass[block.blockID] < 2 ? renderThis : pass == getBlockRenderPass(block); ++ } ++ ++ public static boolean shouldSideBeRendered(Block block, IBlockAccess blockAccess, int i, int j, int k, int face) { ++ return block.shouldSideBeRendered(blockAccess, i, j, k, face) ? true : extraRenderPass[blockAccess.getBlockId(i, j, k)] >= 0 && extraRenderPass[block.blockID] < 0; ++ } ++ ++ public static boolean setAmbientOcclusion(boolean ambientOcclusion) { ++ ambientOcclusion = ambientOcclusion; ++ return ambientOcclusion; ++ } ++ ++ public static float getAOBaseMultiplier(float multiplier) { ++ return renderPass > 2 && !enableLightmap ? 1.0F : multiplier; ++ } ++ ++ public static void doRenderPass(RenderGlobal renderer, EntityLivingBase camera, int pass, double partialTick) { ++ if (pass <= maxRenderPass) { ++ switch (pass) { ++ case 2: ++ GL11.glDisable(GL11.GL_CULL_FACE); ++ renderer.sortAndRender(camera, pass, partialTick); ++ GL11.glEnable(GL11.GL_CULL_FACE); ++ break; ++ ++ case 3: ++ GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); ++ GL11.glPolygonOffset(-2.0F, -2.0F); ++ GL11.glEnable(GL11.GL_POLYGON_OFFSET_FILL); ++ GL11.glEnable(GL11.GL_CULL_FACE); ++ ++ if (ambientOcclusion) { ++ GL11.glShadeModel(GL11.GL_SMOOTH); ++ } ++ ++ blendMethod.applyBlending(); ++ renderer.sortAndRender(camera, pass, partialTick); ++ GL11.glPolygonOffset(0.0F, 0.0F); ++ GL11.glDisable(GL11.GL_POLYGON_OFFSET_FILL); ++ GL11.glDisable(GL11.GL_BLEND); ++ GL11.glShadeModel(GL11.GL_FLAT); ++ } ++ } ++ } ++ ++ public static void enableDisableLightmap(EntityRenderer renderer, double partialTick, int pass) { ++ if (!enableLightmap && pass == 3) { ++ renderer.disableLightmap(partialTick); ++ } else { ++ renderer.enableLightmap(partialTick); ++ } ++ } ++ ++ static int access$000() { ++ return renderPass; ++ } ++ ++ static int access$102(int x0) { ++ maxRenderPass = x0; ++ return x0; ++ } ++ ++ static int[] access$200() { ++ return baseRenderPass; ++ } ++ ++ static int[] access$300() { ++ return extraRenderPass; ++ } ++ ++ static int access$100() { ++ return maxRenderPass; ++ } ++ ++ static BlendMethod access$402(BlendMethod x0) { ++ blendMethod = x0; ++ return x0; ++ } ++ ++ static boolean access$502(boolean x0) { ++ enableLightmap = x0; ++ return x0; ++ } ++ ++ static ResourceLocation access$600() { ++ return RENDERPASS_PROPERTIES; ++ } ++ ++ static BlendMethod access$400() { ++ return blendMethod; ++ } ++ ++ static MCLogger access$700() { ++ return logger; ++ } ++ ++ static { ++ RenderPassAPI.instance = new RenderPass$1(); ++ TexturePackChangeHandler.register(new RenderPass$2("Better Glass", 4)); ++ } ++} diff --git a/patches/com/prupe/mcpatcher/ctm/RenderPassAPI.java.patch b/patches/com/prupe/mcpatcher/ctm/RenderPassAPI.java.patch new file mode 100644 index 0000000..393e0be --- /dev/null +++ b/patches/com/prupe/mcpatcher/ctm/RenderPassAPI.java.patch @@ -0,0 +1,24 @@ +--- /dev/null ++++ com/prupe/mcpatcher/ctm/RenderPassAPI.java +@@ -1,0 +1,21 @@ ++package com.prupe.mcpatcher.ctm; ++ ++import net.minecraft.src.Block; ++ ++class RenderPassAPI { ++ static RenderPassAPI instance = new RenderPassAPI(); ++ ++ boolean skipDefaultRendering(Block block) { ++ return false; ++ } ++ ++ boolean skipThisRenderPass(Block block, int pass) { ++ return pass > 2; ++ } ++ ++ void clear() {} ++ ++ void setRenderPassForBlock(Block block, int pass) {} ++ ++ void finish() {} ++} diff --git a/patches/com/prupe/mcpatcher/ctm/TileOverride.java.patch b/patches/com/prupe/mcpatcher/ctm/TileOverride.java.patch new file mode 100644 index 0000000..b7a7e60 --- /dev/null +++ b/patches/com/prupe/mcpatcher/ctm/TileOverride.java.patch @@ -0,0 +1,759 @@ +--- /dev/null ++++ com/prupe/mcpatcher/ctm/TileOverride.java +@@ -1,0 +1,756 @@ ++package com.prupe.mcpatcher.ctm; ++ ++import com.prupe.mcpatcher.MCLogger; ++import com.prupe.mcpatcher.MCPatcherUtils; ++import com.prupe.mcpatcher.TexturePackAPI; ++import com.prupe.mcpatcher.TileLoader; ++import com.prupe.mcpatcher.ctm.TileOverrideImpl$CTM; ++import com.prupe.mcpatcher.ctm.TileOverrideImpl$Fixed; ++import com.prupe.mcpatcher.ctm.TileOverrideImpl$Horizontal; ++import com.prupe.mcpatcher.ctm.TileOverrideImpl$HorizontalVertical; ++import com.prupe.mcpatcher.ctm.TileOverrideImpl$Random1; ++import com.prupe.mcpatcher.ctm.TileOverrideImpl$Repeat; ++import com.prupe.mcpatcher.ctm.TileOverrideImpl$Top; ++import com.prupe.mcpatcher.ctm.TileOverrideImpl$Vertical; ++import com.prupe.mcpatcher.ctm.TileOverrideImpl$VerticalHorizontal; ++import java.lang.reflect.Method; ++import java.util.ArrayList; ++import java.util.BitSet; ++import java.util.HashSet; ++import java.util.List; ++import java.util.Properties; ++import java.util.Set; ++import java.util.regex.Matcher; ++import java.util.regex.Pattern; ++import net.minecraft.src.Block; ++import net.minecraft.src.IBlockAccess; ++import net.minecraft.src.Icon; ++import net.minecraft.src.ResourceLocation; ++ ++abstract class TileOverride implements ITileOverride { ++ private static final MCLogger logger = MCLogger.getLogger("Connected Textures", "CTM"); ++ static final int BOTTOM_FACE = 0; ++ static final int TOP_FACE = 1; ++ static final int NORTH_FACE = 2; ++ static final int SOUTH_FACE = 3; ++ static final int WEST_FACE = 4; ++ static final int EAST_FACE = 5; ++ static final int REL_L = 0; ++ static final int REL_DL = 1; ++ static final int REL_D = 2; ++ static final int REL_DR = 3; ++ static final int REL_R = 4; ++ static final int REL_UR = 5; ++ static final int REL_U = 6; ++ static final int REL_UL = 7; ++ private static final int META_MASK = 65535; ++ private static final int ORIENTATION_U_D = 0; ++ private static final int ORIENTATION_E_W = 65536; ++ private static final int ORIENTATION_N_S = 131072; ++ private static final int ORIENTATION_E_W_2 = 196608; ++ private static final int ORIENTATION_N_S_2 = 262144; ++ private static final int[][] ROTATE_UV_MAP = new int[][] {{4, 5, 2, 3, 1, 0, 2, -2, 2, -2, 0, 0}, {2, 3, 1, 0, 4, 5, 0, 0, 0, 0, -2, 2}, {4, 5, 2, 3, 1, 0, 2, -2, -2, -2, 0, 0}, {2, 3, 1, 0, 4, 5, 0, 0, 0, 0, -2, -2}}; ++ private static final int[] GO_DOWN = new int[] {0, -1, 0}; ++ private static final int[] GO_UP = new int[] {0, 1, 0}; ++ private static final int[] GO_NORTH = new int[] {0, 0, -1}; ++ private static final int[] GO_SOUTH = new int[] {0, 0, 1}; ++ private static final int[] GO_WEST = new int[] { -1, 0, 0}; ++ private static final int[] GO_EAST = new int[] {1, 0, 0}; ++ private static final int[][] NORMALS = new int[][] {GO_DOWN, GO_UP, GO_NORTH, GO_SOUTH, GO_WEST, GO_EAST}; ++ protected static final int[][][] NEIGHBOR_OFFSET = new int[][][] {{GO_WEST, add(GO_WEST, GO_SOUTH), GO_SOUTH, add(GO_EAST, GO_SOUTH), GO_EAST, add(GO_EAST, GO_NORTH), GO_NORTH, add(GO_WEST, GO_NORTH)}, {GO_WEST, add(GO_WEST, GO_SOUTH), GO_SOUTH, add(GO_EAST, GO_SOUTH), GO_EAST, add(GO_EAST, GO_NORTH), GO_NORTH, add(GO_WEST, GO_NORTH)}, {GO_EAST, add(GO_EAST, GO_DOWN), GO_DOWN, add(GO_WEST, GO_DOWN), GO_WEST, add(GO_WEST, GO_UP), GO_UP, add(GO_EAST, GO_UP)}, {GO_WEST, add(GO_WEST, GO_DOWN), GO_DOWN, add(GO_EAST, GO_DOWN), GO_EAST, add(GO_EAST, GO_UP), GO_UP, add(GO_WEST, GO_UP)}, {GO_NORTH, add(GO_NORTH, GO_DOWN), GO_DOWN, add(GO_SOUTH, GO_DOWN), GO_SOUTH, add(GO_SOUTH, GO_UP), GO_UP, add(GO_NORTH, GO_UP)}, {GO_SOUTH, add(GO_SOUTH, GO_DOWN), GO_DOWN, add(GO_NORTH, GO_DOWN), GO_NORTH, add(GO_NORTH, GO_UP), GO_UP, add(GO_SOUTH, GO_UP)}}; ++ private static final int CONNECT_BY_BLOCK = 0; ++ private static final int CONNECT_BY_TILE = 1; ++ private static final int CONNECT_BY_MATERIAL = 2; ++ private static Method parseBiomeList; ++ private static Method getBiomeIDAt; ++ private final ResourceLocation propertiesFile; ++ private final String texturesDirectory; ++ private final String baseFilename; ++ private final TileLoader tileLoader; ++ private final int renderPass; ++ private final int weight; ++ private final Set matchBlocks; ++ private final Set matchTiles; ++ private final int faces; ++ private final int metadata; ++ private final int connectType; ++ private final boolean innerSeams; ++ private final BitSet biomes; ++ private final int minHeight; ++ private final int maxHeight; ++ private final List tileNames = new ArrayList(); ++ protected Icon[] icons; ++ private boolean disabled; ++ private int[] reorient; ++ private int rotateUV; ++ protected boolean rotateTop; ++ ++ static TileOverride create(ResourceLocation propertiesFile, TileLoader tileLoader) { ++ if (propertiesFile == null) { ++ return null; ++ } else { ++ Properties properties = TexturePackAPI.getProperties(propertiesFile); ++ ++ if (properties == null) { ++ return null; ++ } else { ++ String method = properties.getProperty("method", "default").trim().toLowerCase(); ++ Object override = null; ++ ++ if (!method.equals("default") && !method.equals("glass") && !method.equals("ctm")) { ++ if (method.equals("random")) { ++ override = new TileOverrideImpl$Random1(propertiesFile, properties, tileLoader); ++ ++ if (((TileOverride)override).getNumberOfTiles() == 1) { ++ override = new TileOverrideImpl$Fixed(propertiesFile, properties, tileLoader); ++ } ++ } else if (!method.equals("fixed") && !method.equals("static")) { ++ if (!method.equals("bookshelf") && !method.equals("horizontal")) { ++ if (!method.equals("horizontal+vertical") && !method.equals("h+v")) { ++ if (method.equals("vertical")) { ++ override = new TileOverrideImpl$Vertical(propertiesFile, properties, tileLoader); ++ } else if (!method.equals("vertical+horizontal") && !method.equals("v+h")) { ++ if (!method.equals("sandstone") && !method.equals("top")) { ++ if (!method.equals("repeat") && !method.equals("pattern")) { ++ logger.error("%s: unknown method \"%s\"", new Object[] {propertiesFile, method}); ++ } else { ++ override = new TileOverrideImpl$Repeat(propertiesFile, properties, tileLoader); ++ } ++ } else { ++ override = new TileOverrideImpl$Top(propertiesFile, properties, tileLoader); ++ } ++ } else { ++ override = new TileOverrideImpl$VerticalHorizontal(propertiesFile, properties, tileLoader); ++ } ++ } else { ++ override = new TileOverrideImpl$HorizontalVertical(propertiesFile, properties, tileLoader); ++ } ++ } else { ++ override = new TileOverrideImpl$Horizontal(propertiesFile, properties, tileLoader); ++ } ++ } else { ++ override = new TileOverrideImpl$Fixed(propertiesFile, properties, tileLoader); ++ } ++ } else { ++ override = new TileOverrideImpl$CTM(propertiesFile, properties, tileLoader); ++ } ++ ++ if (override != null && !((TileOverride)override).disabled) { ++ String status = ((TileOverride)override).checkTileMap(); ++ ++ if (status != null) { ++ ((TileOverride)override).error("invalid %s tile map: %s", new Object[] {((TileOverride)override).getMethod(), status}); ++ } ++ } ++ ++ return (TileOverride)(override != null && !((TileOverride)override).disabled ? override : null); ++ } ++ } ++ } ++ ++ protected TileOverride(ResourceLocation propertiesFile, Properties properties, TileLoader tileLoader) { ++ this.propertiesFile = propertiesFile; ++ this.texturesDirectory = propertiesFile.getResourcePath().replaceFirst("/[^/]*$", ""); ++ this.baseFilename = propertiesFile.getResourcePath().replaceFirst(".*/", "").replaceFirst("\\.properties$", ""); ++ this.tileLoader = tileLoader; ++ this.loadIcons(properties); ++ ++ if (this.tileNames.isEmpty()) { ++ this.error("no images found in %s/", new Object[] {this.texturesDirectory}); ++ } ++ ++ String[] mappings = new String[Block.blocksList.length]; ++ int flags; ++ ++ for (flags = 0; flags < Block.blocksList.length; ++flags) { ++ Block meta = Block.blocksList[flags]; ++ ++ if (meta != null) { ++ mappings[flags] = meta.getUnlocalizedName(); ++ } ++ } ++ ++ this.matchBlocks = this.getIDList(properties, "matchBlocks", "block", mappings); ++ this.matchTiles = this.getIDList(properties, "matchTiles"); ++ ++ if (this.matchBlocks.isEmpty() && this.matchTiles.isEmpty()) { ++ this.matchTiles.add(this.baseFilename); ++ } ++ ++ flags = 0; ++ String[] var13 = properties.getProperty("faces", "all").trim().toLowerCase().split("\\s+"); ++ int connectType1 = var13.length; ++ int biomeList; ++ ++ for (biomeList = 0; biomeList < connectType1; ++biomeList) { ++ String e = var13[biomeList]; ++ ++ if (e.equals("bottom")) { ++ flags |= 1; ++ } else if (e.equals("top")) { ++ flags |= 2; ++ } else if (e.equals("north")) { ++ flags |= 4; ++ } else if (e.equals("south")) { ++ flags |= 8; ++ } else if (e.equals("east")) { ++ flags |= 32; ++ } else if (e.equals("west")) { ++ flags |= 16; ++ } else if (!e.equals("side") && !e.equals("sides")) { ++ if (e.equals("all")) { ++ flags = -1; ++ } ++ } else { ++ flags |= 60; ++ } ++ } ++ ++ this.faces = flags; ++ int var12 = 0; ++ int[] var14 = MCPatcherUtils.parseIntegerList(properties.getProperty("metadata", "0-31"), 0, 31); ++ biomeList = var14.length; ++ ++ for (int var16 = 0; var16 < biomeList; ++var16) { ++ int i = var14[var16]; ++ var12 |= 1 << i; ++ } ++ ++ this.metadata = var12; ++ String var15 = properties.getProperty("connect", "").trim().toLowerCase(); ++ ++ if (var15.equals("")) { ++ this.connectType = this.matchTiles.isEmpty() ? 0 : 1; ++ } else if (var15.equals("block")) { ++ this.connectType = 0; ++ } else if (var15.equals("tile")) { ++ this.connectType = 1; ++ } else if (var15.equals("material")) { ++ this.connectType = 2; ++ } else { ++ this.error("invalid connect type %s", new Object[] {var15}); ++ this.connectType = 0; ++ } ++ ++ this.innerSeams = MCPatcherUtils.getBooleanProperty(properties, "innerSeams", false); ++ String var17 = properties.getProperty("biomes", ""); ++ ++ if (var17.isEmpty()) { ++ this.biomes = null; ++ } else { ++ this.biomes = new BitSet(); ++ ++ if (parseBiomeList != null) { ++ try { ++ parseBiomeList.invoke((Object)null, new Object[] {var17, this.biomes}); ++ } catch (Throwable var11) { ++ var11.printStackTrace(); ++ parseBiomeList = null; ++ } ++ } ++ } ++ ++ this.minHeight = MCPatcherUtils.getIntProperty(properties, "minHeight", -1); ++ this.maxHeight = MCPatcherUtils.getIntProperty(properties, "maxHeight", Integer.MAX_VALUE); ++ this.renderPass = MCPatcherUtils.getIntProperty(properties, "renderPass", -1); ++ ++ if (this.renderPass > 3) { ++ this.error("renderPass must be 0-3", new Object[0]); ++ } else if (this.renderPass >= 0 && !this.matchTiles.isEmpty()) { ++ this.error("renderPass=%d must be block-based not tile-based", new Object[] {Integer.valueOf(this.renderPass)}); ++ } ++ ++ this.weight = MCPatcherUtils.getIntProperty(properties, "weight", 0); ++ } ++ ++ private boolean addIcon(ResourceLocation resource) { ++ this.tileNames.add(resource); ++ return this.tileLoader.preloadTile(resource, this.renderPass > 2); ++ } ++ ++ private void loadIcons(Properties properties) { ++ this.tileNames.clear(); ++ String tileList = properties.getProperty("tiles", "").trim(); ++ ++ if (tileList.equals("")) { ++ int range = 0; ++ ++ while (true) { ++ ResourceLocation arr$ = TileLoader.parseTileAddress(this.propertiesFile, String.valueOf(range)); ++ ++ if (!TexturePackAPI.hasResource(arr$) || !this.addIcon(arr$)) { ++ break; ++ } ++ ++ ++range; ++ } ++ } else { ++ Pattern var14 = Pattern.compile("(\\d+)-(\\d+)"); ++ String[] var15 = tileList.split("\\s+"); ++ int len$ = var15.length; ++ ++ for (int i$ = 0; i$ < len$; ++i$) { ++ String token = var15[i$]; ++ Matcher matcher = var14.matcher(token); ++ ++ if (!token.equals("")) { ++ if (matcher.matches()) { ++ try { ++ int resource = Integer.parseInt(matcher.group(1)); ++ int to = Integer.parseInt(matcher.group(2)); ++ ++ for (int i = resource; i <= to; ++i) { ++ ResourceLocation resource1 = TileLoader.parseTileAddress(this.propertiesFile, String.valueOf(i)); ++ ++ if (TexturePackAPI.hasResource(resource1)) { ++ this.addIcon(resource1); ++ } else { ++ this.warn("could not find image %s", new Object[] {resource1}); ++ // ToDO: ++ //this.tileNames.add((Object)null); ++ } ++ } ++ } catch (NumberFormatException var13) { ++ var13.printStackTrace(); ++ } ++ } else { ++ ResourceLocation var16 = TileLoader.parseTileAddress(this.propertiesFile, token); ++ ++ if (var16 == null) { ++ // ToDo: ++ this.tileNames.add((ResourceLocation)null); ++ } else if (TexturePackAPI.hasResource(var16)) { ++ this.addIcon(var16); ++ } else { ++ this.warn("could not find image %s", new Object[] {var16}); ++ // ToDO: ++ //this.tileNames.add((Object)null); ++ } ++ } ++ } ++ } ++ } ++ } ++ ++ private Set getIDList(Properties properties, String key, String type, String[] mappings) { ++ HashSet list = new HashSet(); ++ String property = properties.getProperty(key, ""); ++ String[] m = property.split("\\s+"); ++ int e = m.length; ++ label53: ++ ++ for (int i$ = 0; i$ < e; ++i$) { ++ String token = m[i$]; ++ ++ if (!token.equals("")) { ++ int i; ++ ++ if (token.matches("\\d+")) { ++ try { ++ i = Integer.parseInt(token); ++ ++ if (i >= 0 && i < mappings.length) { ++ list.add(Integer.valueOf(i)); ++ } else { ++ this.warn("%s value %d is out of range", new Object[] {key, Integer.valueOf(i)}); ++ } ++ } catch (NumberFormatException var13) { ++ var13.printStackTrace(); ++ } ++ } else { ++ for (i = 0; i < mappings.length; ++i) { ++ if (token.equals(mappings[i])) { ++ list.add(Integer.valueOf(i)); ++ continue label53; ++ } ++ } ++ ++ this.warn("unknown %s value %s", new Object[] {key, token}); ++ } ++ } ++ } ++ ++ if (list.isEmpty()) { ++ Matcher var14 = Pattern.compile(type + "(\\d+)").matcher(this.baseFilename); ++ ++ if (var14.find()) { ++ try { ++ list.add(Integer.valueOf(Integer.parseInt(var14.group(1)))); ++ } catch (NumberFormatException var12) { ++ var12.printStackTrace(); ++ } ++ } ++ } ++ ++ return list; ++ } ++ ++ private Set getIDList(Properties properties, String key) { ++ HashSet list = new HashSet(); ++ String property = properties.getProperty(key, ""); ++ String[] arr$ = property.split("\\s+"); ++ int len$ = arr$.length; ++ ++ for (int i$ = 0; i$ < len$; ++i$) { ++ String token = arr$[i$]; ++ ++ if (!token.equals("")) { ++ if (token.contains("/")) { ++ if (!token.endsWith(".png")) { ++ token = token + ".png"; ++ } ++ ++ ResourceLocation resource = TexturePackAPI.parseResourceLocation(this.propertiesFile, token); ++ ++ if (resource != null) { ++ list.add(resource.toString()); ++ } ++ } else { ++ list.add(token); ++ } ++ } ++ } ++ ++ return list; ++ } ++ ++ private static int[] add(int[] a, int[] b) { ++ if (a.length != b.length) { ++ throw new RuntimeException("arrays to add are not same length"); ++ } else { ++ int[] c = new int[a.length]; ++ ++ for (int i = 0; i < c.length; ++i) { ++ c[i] = a[i] + b[i]; ++ } ++ ++ return c; ++ } ++ } ++ ++ protected int getNumberOfTiles() { ++ return this.tileNames.size(); ++ } ++ ++ String checkTileMap() { ++ return null; ++ } ++ ++ boolean requiresFace() { ++ return false; ++ } ++ ++ public String toString() { ++ return String.format("%s[%s]", new Object[] {this.getMethod(), this.propertiesFile}); ++ } ++ ++ public final void registerIcons() { ++ this.icons = new Icon[this.tileNames.size()]; ++ ++ for (int i = 0; i < this.icons.length; ++i) { ++ this.icons[i] = this.tileLoader.getIcon((ResourceLocation)this.tileNames.get(i)); ++ } ++ } ++ ++ final void error(String format, Object ... params) { ++ if (this.propertiesFile != null) { ++ logger.error(this.propertiesFile + ": " + format, params); ++ } ++ ++ this.disabled = true; ++ } ++ ++ final void warn(String format, Object ... params) { ++ if (this.propertiesFile != null) { ++ logger.warning(this.propertiesFile + ": " + format, params); ++ } ++ } ++ ++ public final boolean isDisabled() { ++ return this.disabled; ++ } ++ ++ public final Set getMatchingBlocks() { ++ return this.matchBlocks; ++ } ++ ++ public final Set getMatchingTiles() { ++ return this.matchTiles; ++ } ++ ++ public final int getRenderPass() { ++ return this.renderPass; ++ } ++ ++ public final int getWeight() { ++ return this.weight; ++ } ++ ++ public int compareTo(ITileOverride o) { ++ int result = o.getWeight() - this.getWeight(); ++ return result != 0 ? result : (o instanceof TileOverride ? this.baseFilename.compareTo(((TileOverride)o).baseFilename) : -1); ++ } ++ ++ final boolean shouldConnect(IBlockAccess blockAccess, Block block, Icon icon, int i, int j, int k, int face, int[] offset) { ++ int blockID = block.blockID; ++ int metadata = blockAccess.getBlockMetadata(i, j, k); ++ i += offset[0]; ++ j += offset[1]; ++ k += offset[2]; ++ int neighborID = blockAccess.getBlockId(i, j, k); ++ int neighborMeta = blockAccess.getBlockMetadata(i, j, k); ++ Block neighbor = Block.blocksList[neighborID]; ++ ++ if (this.exclude(neighbor, face, neighborMeta)) { ++ return false; ++ } else { ++ int orientation = getOrientationFromMetadata(block, metadata); ++ int neighborOrientation = getOrientationFromMetadata(neighbor, neighborMeta); ++ ++ if ((orientation & -65536) != (neighborOrientation & -65536)) { ++ return false; ++ } else if (this.metadata != -1 && (orientation & 65535) != (neighborOrientation & 65535)) { ++ return false; ++ } else { ++ if (face >= 0 && this.innerSeams) { ++ int[] normal = NORMALS[face]; ++ ++ if (!neighbor.shouldSideBeRendered(blockAccess, i + normal[0], j + normal[1], k + normal[2], face)) { ++ return false; ++ } ++ } ++ ++ switch (this.connectType) { ++ case 0: ++ return neighborID == blockID; ++ ++ case 1: ++ return neighbor.getBlockTexture(blockAccess, i, j, k, face) == icon; ++ ++ case 2: ++ return block.blockMaterial == neighbor.blockMaterial; ++ ++ default: ++ return false; ++ } ++ } ++ } ++ } ++ ++ final int reorient(int face) { ++ return face >= 0 && face <= 5 && this.reorient != null ? this.reorient[face] : face; ++ } ++ ++ final int rotateUV(int neighbor) { ++ return neighbor + this.rotateUV & 7; ++ } ++ ++ final boolean exclude(Block block, int face, int metadata) { ++ if (block == null) { ++ return true; ++ } else if ((this.faces & 1 << this.reorient(face)) == 0) { ++ return true; ++ } else { ++ if (this.metadata != -1 && metadata >= 0 && metadata < 32) { ++ int altMetadata = getOrientationFromMetadata(block, metadata) & 65535; ++ ++ if ((this.metadata & (1 << metadata | 1 << altMetadata)) == 0) { ++ return true; ++ } ++ } ++ ++ return false; ++ } ++ } ++ ++ private static int getOrientationFromMetadata(Block block, int metadata) { ++ int newMeta = metadata; ++ int orientation = 0; ++ ++ switch (block.getRenderType()) { ++ case 31: ++ switch (metadata & 12) { ++ case 0: ++ newMeta = metadata & -13; ++ return orientation | newMeta; ++ ++ case 4: ++ newMeta = metadata & -13; ++ orientation = 65536; ++ return orientation | newMeta; ++ ++ case 8: ++ newMeta = metadata & -13; ++ orientation = 131072; ++ return orientation | newMeta; ++ ++ default: ++ return orientation | newMeta; ++ } ++ ++ case 39: ++ switch (metadata) { ++ case 3: ++ newMeta = 2; ++ orientation = 196608; ++ break; ++ ++ case 4: ++ newMeta = 2; ++ orientation = 262144; ++ } ++ } ++ ++ return orientation | newMeta; ++ } ++ ++ private void setupOrientation(int orientation, int face) { ++ switch (orientation & -65536) { ++ case 65536: ++ this.reorient = ROTATE_UV_MAP[0]; ++ this.rotateUV = ROTATE_UV_MAP[0][face + 6]; ++ this.rotateTop = true; ++ break; ++ ++ case 131072: ++ this.reorient = ROTATE_UV_MAP[1]; ++ this.rotateUV = ROTATE_UV_MAP[1][face + 6]; ++ this.rotateTop = false; ++ break; ++ ++ case 196608: ++ this.reorient = ROTATE_UV_MAP[2]; ++ this.rotateUV = ROTATE_UV_MAP[2][face + 6]; ++ this.rotateTop = true; ++ break; ++ ++ case 262144: ++ this.reorient = ROTATE_UV_MAP[3]; ++ this.rotateUV = ROTATE_UV_MAP[3][face + 6]; ++ this.rotateTop = false; ++ break; ++ ++ default: ++ this.reorient = null; ++ this.rotateUV = 0; ++ this.rotateTop = false; ++ } ++ } ++ ++ private static int remapFaceByRenderType(Block block, int metadata, int face) { ++ switch (block.getRenderType()) { ++ case 8: ++ switch (metadata) { ++ case 2: ++ case 3: ++ case 4: ++ case 5: ++ return metadata; ++ ++ default: ++ return face; ++ } ++ ++ case 20: ++ switch (metadata) { ++ case 1: ++ return 2; ++ ++ case 2: ++ return 5; ++ ++ case 3: ++ case 5: ++ case 6: ++ case 7: ++ default: ++ break; ++ ++ case 4: ++ return 3; ++ ++ case 8: ++ return 4; ++ } ++ } ++ ++ return face; ++ } ++ ++ public final Icon getTile(IBlockAccess blockAccess, Block block, Icon origIcon, int i, int j, int k, int face) { ++ if (this.icons == null) { ++ this.error("no images loaded, disabling", new Object[0]); ++ return null; ++ } else if (face < 0 && this.requiresFace()) { ++ this.error("method=%s is not supported for non-standard blocks", new Object[] {this.getMethod()}); ++ return null; ++ } else if (block != null && !RenderPassAPI.instance.skipThisRenderPass(block, this.renderPass)) { ++ int metadata = blockAccess.getBlockMetadata(i, j, k); ++ this.setupOrientation(getOrientationFromMetadata(block, metadata), face); ++ face = remapFaceByRenderType(block, metadata, face); ++ ++ if (this.exclude(block, face, metadata)) { ++ return null; ++ } else if (j >= this.minHeight && j <= this.maxHeight) { ++ if (this.biomes != null) { ++ if (getBiomeIDAt == null) { ++ return null; ++ } ++ ++ try { ++ int e = ((Integer)getBiomeIDAt.invoke((Object)null, new Object[] {Integer.valueOf(i), Integer.valueOf(j), Integer.valueOf(k)})).intValue(); ++ ++ if (!this.biomes.get(e)) { ++ return null; ++ } ++ } catch (Throwable var10) { ++ var10.printStackTrace(); ++ getBiomeIDAt = null; ++ } ++ } ++ ++ return this.getTileImpl(blockAccess, block, origIcon, i, j, k, face); ++ } else { ++ return null; ++ } ++ } else { ++ return null; ++ } ++ } ++ ++ public final Icon getTile(Block block, Icon origIcon, int face, int metadata) { ++ if (this.icons == null) { ++ this.error("no images loaded, disabling", new Object[0]); ++ return null; ++ } else if (face < 0 && this.requiresFace()) { ++ this.error("method=%s is not supported for non-standard blocks", new Object[] {this.getMethod()}); ++ return null; ++ } else if (this.minHeight < 0 && this.maxHeight >= Integer.MAX_VALUE && this.biomes == null) { ++ this.setupOrientation(getOrientationFromMetadata(block, metadata), face); ++ return this.exclude(block, face, metadata) ? null : this.getTileImpl(block, origIcon, face, metadata); ++ } else { ++ return null; ++ } ++ } ++ ++ abstract String getMethod(); ++ ++ abstract Icon getTileImpl(IBlockAccess var1, Block var2, Icon var3, int var4, int var5, int var6, int var7); ++ ++ abstract Icon getTileImpl(Block var1, Icon var2, int var3, int var4); ++ ++ static { ++ try { ++ Class e = Class.forName("com.prupe.mcpatcher.cc.BiomeHelper"); ++ parseBiomeList = e.getDeclaredMethod("parseBiomeList", new Class[] {String.class, BitSet.class}); ++ getBiomeIDAt = e.getDeclaredMethod("getBiomeIDAt", new Class[] {Integer.TYPE, Integer.TYPE, Integer.TYPE}); ++ parseBiomeList.setAccessible(true); ++ getBiomeIDAt.setAccessible(true); ++ logger.fine("biome integration active", new Object[0]); ++ } catch (Throwable var1) { ++ parseBiomeList = null; ++ getBiomeIDAt = null; ++ logger.warning("biome integration failed", new Object[0]); ++ } ++ } ++} diff --git a/patches/com/prupe/mcpatcher/ctm/TileOverrideImpl$BetterGrass.java.patch b/patches/com/prupe/mcpatcher/ctm/TileOverrideImpl$BetterGrass.java.patch new file mode 100644 index 0000000..4b76498 --- /dev/null +++ b/patches/com/prupe/mcpatcher/ctm/TileOverrideImpl$BetterGrass.java.patch @@ -0,0 +1,87 @@ +--- /dev/null ++++ com/prupe/mcpatcher/ctm/TileOverrideImpl$BetterGrass.java +@@ -1,0 +1,84 @@ ++package com.prupe.mcpatcher.ctm; ++ ++import com.prupe.mcpatcher.TileLoader; ++import java.util.HashSet; ++import java.util.Set; ++import net.minecraft.src.Block; ++import net.minecraft.src.IBlockAccess; ++import net.minecraft.src.Icon; ++ ++final class TileOverrideImpl$BetterGrass implements ITileOverride { ++ private static final int[][] OFFSET_MATRIX = new int[][] {{0, -1}, {0, 1}, { -1, 0}, {1, 0}}; ++ private final int blockID; ++ private final String tileName; ++ private final Icon fullTile; ++ private final Icon fullSnowTile; ++ ++ TileOverrideImpl$BetterGrass(TileLoader tileLoader, int blockID, String tileName) { ++ this.blockID = blockID; ++ this.tileName = tileName; ++ this.fullSnowTile = tileLoader.getIcon("snow"); ++ this.fullTile = tileLoader.getIcon(tileName + "_top"); ++ } ++ ++ public String toString() { ++ return "BetterGrass{" + this.tileName + "}"; ++ } ++ ++ public boolean isDisabled() { ++ return false; ++ } ++ ++ public void registerIcons() {} ++ ++ public Set getMatchingBlocks() { ++ HashSet ids = new HashSet(); ++ ids.add(Integer.valueOf(this.blockID)); ++ return ids; ++ } ++ ++ public Set getMatchingTiles() { ++ return null; ++ } ++ ++ public int getRenderPass() { ++ return 0; ++ } ++ ++ public int getWeight() { ++ return -1; ++ } ++ ++ public int compareTo(ITileOverride o) { ++ return o.getWeight() - this.getWeight(); ++ } ++ ++ public Icon getTile(IBlockAccess blockAccess, Block block, Icon origIcon, int i, int j, int k, int face) { ++ if (face >= 2 && face <= 5) { ++ int[] offset = OFFSET_MATRIX[face - 2]; ++ ++ if (blockAccess.getBlockId(i + offset[0], j - 1, k + offset[1]) == this.blockID) { ++ int neighborBlock = blockAccess.getBlockId(i, j + 1, k); ++ ++ if (neighborBlock != 78 && neighborBlock != 80) { ++ return this.fullTile; ++ } else { ++ neighborBlock = blockAccess.getBlockId(i + offset[0], j, k + offset[1]); ++ return neighborBlock != 78 && neighborBlock != 80 ? null : this.fullSnowTile; ++ } ++ } else { ++ return null; ++ } ++ } else { ++ return null; ++ } ++ } ++ ++ boolean isBetterGrass(IBlockAccess blockAccess, Block block, int i, int j, int k, int face) { ++ return block.blockID == this.blockID && this.getTile(blockAccess, block, (Icon)null, i, j, k, face) == this.fullTile; ++ } ++ ++ public Icon getTile(Block block, Icon origIcon, int face, int metadata) { ++ return null; ++ } ++} diff --git a/patches/com/prupe/mcpatcher/ctm/TileOverrideImpl$CTM.java.patch b/patches/com/prupe/mcpatcher/ctm/TileOverrideImpl$CTM.java.patch new file mode 100644 index 0000000..8832c7d --- /dev/null +++ b/patches/com/prupe/mcpatcher/ctm/TileOverrideImpl$CTM.java.patch @@ -0,0 +1,48 @@ +--- /dev/null ++++ com/prupe/mcpatcher/ctm/TileOverrideImpl$CTM.java +@@ -1,0 +1,45 @@ ++package com.prupe.mcpatcher.ctm; ++ ++import com.prupe.mcpatcher.TileLoader; ++import java.util.Properties; ++import net.minecraft.src.Block; ++import net.minecraft.src.IBlockAccess; ++import net.minecraft.src.Icon; ++import net.minecraft.src.ResourceLocation; ++ ++final class TileOverrideImpl$CTM extends TileOverride { ++ private static final int[] neighborMap = new int[] {0, 3, 0, 3, 12, 5, 12, 15, 0, 3, 0, 3, 12, 5, 12, 15, 1, 2, 1, 2, 4, 7, 4, 29, 1, 2, 1, 2, 13, 31, 13, 14, 0, 3, 0, 3, 12, 5, 12, 15, 0, 3, 0, 3, 12, 5, 12, 15, 1, 2, 1, 2, 4, 7, 4, 29, 1, 2, 1, 2, 13, 31, 13, 14, 36, 17, 36, 17, 24, 19, 24, 43, 36, 17, 36, 17, 24, 19, 24, 43, 16, 18, 16, 18, 6, 46, 6, 21, 16, 18, 16, 18, 28, 9, 28, 22, 36, 17, 36, 17, 24, 19, 24, 43, 36, 17, 36, 17, 24, 19, 24, 43, 37, 40, 37, 40, 30, 8, 30, 34, 37, 40, 37, 40, 25, 23, 25, 45, 0, 3, 0, 3, 12, 5, 12, 15, 0, 3, 0, 3, 12, 5, 12, 15, 1, 2, 1, 2, 4, 7, 4, 29, 1, 2, 1, 2, 13, 31, 13, 14, 0, 3, 0, 3, 12, 5, 12, 15, 0, 3, 0, 3, 12, 5, 12, 15, 1, 2, 1, 2, 4, 7, 4, 29, 1, 2, 1, 2, 13, 31, 13, 14, 36, 39, 36, 39, 24, 41, 24, 27, 36, 39, 36, 39, 24, 41, 24, 27, 16, 42, 16, 42, 6, 20, 6, 10, 16, 42, 16, 42, 28, 35, 28, 44, 36, 39, 36, 39, 24, 41, 24, 27, 36, 39, 36, 39, 24, 41, 24, 27, 37, 38, 37, 38, 30, 11, 30, 32, 37, 38, 37, 38, 25, 33, 25, 26}; ++ ++ TileOverrideImpl$CTM(ResourceLocation filePrefix, Properties properties, TileLoader tileLoader) { ++ super(filePrefix, properties, tileLoader); ++ } ++ ++ String getMethod() { ++ return "ctm"; ++ } ++ ++ String checkTileMap() { ++ return this.getNumberOfTiles() >= 47 ? null : "requires at least 47 tiles"; ++ } ++ ++ boolean requiresFace() { ++ return true; ++ } ++ ++ Icon getTileImpl(IBlockAccess blockAccess, Block block, Icon origIcon, int i, int j, int k, int face) { ++ int[][] offsets = NEIGHBOR_OFFSET[face]; ++ int neighborBits = 0; ++ ++ for (int bit = 0; bit < 8; ++bit) { ++ if (this.shouldConnect(blockAccess, block, origIcon, i, j, k, face, offsets[bit])) { ++ neighborBits |= 1 << bit; ++ } ++ } ++ ++ return this.icons[neighborMap[neighborBits]]; ++ } ++ ++ Icon getTileImpl(Block block, Icon origIcon, int face, int metadata) { ++ return this.icons[0]; ++ } ++} diff --git a/patches/com/prupe/mcpatcher/ctm/TileOverrideImpl$Fixed.java.patch b/patches/com/prupe/mcpatcher/ctm/TileOverrideImpl$Fixed.java.patch new file mode 100644 index 0000000..78e841e --- /dev/null +++ b/patches/com/prupe/mcpatcher/ctm/TileOverrideImpl$Fixed.java.patch @@ -0,0 +1,33 @@ +--- /dev/null ++++ com/prupe/mcpatcher/ctm/TileOverrideImpl$Fixed.java +@@ -1,0 +1,30 @@ ++package com.prupe.mcpatcher.ctm; ++ ++import com.prupe.mcpatcher.TileLoader; ++import java.util.Properties; ++import net.minecraft.src.Block; ++import net.minecraft.src.IBlockAccess; ++import net.minecraft.src.Icon; ++import net.minecraft.src.ResourceLocation; ++ ++final class TileOverrideImpl$Fixed extends TileOverride { ++ TileOverrideImpl$Fixed(ResourceLocation filePrefix, Properties properties, TileLoader tileLoader) { ++ super(filePrefix, properties, tileLoader); ++ } ++ ++ String getMethod() { ++ return "fixed"; ++ } ++ ++ String checkTileMap() { ++ return this.getNumberOfTiles() == 1 ? null : "requires exactly 1 tile"; ++ } ++ ++ Icon getTileImpl(IBlockAccess blockAccess, Block block, Icon origIcon, int i, int j, int k, int face) { ++ return this.icons[0]; ++ } ++ ++ Icon getTileImpl(Block block, Icon origIcon, int face, int metadata) { ++ return this.icons[0]; ++ } ++} diff --git a/patches/com/prupe/mcpatcher/ctm/TileOverrideImpl$Horizontal.java.patch b/patches/com/prupe/mcpatcher/ctm/TileOverrideImpl$Horizontal.java.patch new file mode 100644 index 0000000..ec4c9e1 --- /dev/null +++ b/patches/com/prupe/mcpatcher/ctm/TileOverrideImpl$Horizontal.java.patch @@ -0,0 +1,52 @@ +--- /dev/null ++++ com/prupe/mcpatcher/ctm/TileOverrideImpl$Horizontal.java +@@ -1,0 +1,49 @@ ++package com.prupe.mcpatcher.ctm; ++ ++import com.prupe.mcpatcher.TileLoader; ++import java.util.Properties; ++import net.minecraft.src.Block; ++import net.minecraft.src.IBlockAccess; ++import net.minecraft.src.Icon; ++import net.minecraft.src.ResourceLocation; ++ ++class TileOverrideImpl$Horizontal extends TileOverride { ++ private static final int[] neighborMap = new int[] {3, 2, 0, 1}; ++ ++ TileOverrideImpl$Horizontal(ResourceLocation filePrefix, Properties properties, TileLoader tileLoader) { ++ super(filePrefix, properties, tileLoader); ++ } ++ ++ String getMethod() { ++ return "horizontal"; ++ } ++ ++ String checkTileMap() { ++ return this.getNumberOfTiles() == 4 ? null : "requires exactly 4 tiles"; ++ } ++ ++ Icon getTileImpl(IBlockAccess blockAccess, Block block, Icon origIcon, int i, int j, int k, int face) { ++ if (face < 0) { ++ face = 2; ++ } else if (this.reorient(face) <= 1) { ++ return null; ++ } ++ ++ int[][] offsets = NEIGHBOR_OFFSET[face]; ++ int neighborBits = 0; ++ ++ if (this.shouldConnect(blockAccess, block, origIcon, i, j, k, face, offsets[this.rotateUV(0)])) { ++ neighborBits |= 1; ++ } ++ ++ if (this.shouldConnect(blockAccess, block, origIcon, i, j, k, face, offsets[this.rotateUV(4)])) { ++ neighborBits |= 2; ++ } ++ ++ return this.icons[neighborMap[neighborBits]]; ++ } ++ ++ Icon getTileImpl(Block block, Icon origIcon, int face, int metadata) { ++ return this.icons[3]; ++ } ++} diff --git a/patches/com/prupe/mcpatcher/ctm/TileOverrideImpl$HorizontalVertical.java.patch b/patches/com/prupe/mcpatcher/ctm/TileOverrideImpl$HorizontalVertical.java.patch new file mode 100644 index 0000000..5352de0 --- /dev/null +++ b/patches/com/prupe/mcpatcher/ctm/TileOverrideImpl$HorizontalVertical.java.patch @@ -0,0 +1,65 @@ +--- /dev/null ++++ com/prupe/mcpatcher/ctm/TileOverrideImpl$HorizontalVertical.java +@@ -1,0 +1,62 @@ ++package com.prupe.mcpatcher.ctm; ++ ++import com.prupe.mcpatcher.TileLoader; ++import com.prupe.mcpatcher.ctm.TileOverrideImpl$Horizontal; ++import java.util.Properties; ++import net.minecraft.src.Block; ++import net.minecraft.src.IBlockAccess; ++import net.minecraft.src.Icon; ++import net.minecraft.src.ResourceLocation; ++ ++final class TileOverrideImpl$HorizontalVertical extends TileOverrideImpl$Horizontal { ++ private static final int[] neighborMap = new int[] {3, 3, 6, 3, 3, 3, 3, 3, 3, 3, 6, 3, 3, 3, 3, 3, 4, 4, 5, 4, 4, 4, 4, 4, 3, 3, 6, 3, 3, 3, 3, 3, 3, 3, 6, 3, 3, 3, 3, 3, 3, 3, 6, 3, 3, 3, 3, 3, 3, 3, 6, 3, 3, 3, 3, 3, 3, 3, 6, 3, 3, 3, 3, 3}; ++ ++ TileOverrideImpl$HorizontalVertical(ResourceLocation filePrefix, Properties properties, TileLoader tileLoader) { ++ super(filePrefix, properties, tileLoader); ++ } ++ ++ String getMethod() { ++ return "horizontal+vertical"; ++ } ++ ++ String checkTileMap() { ++ return this.getNumberOfTiles() == 7 ? null : "requires exactly 7 tiles"; ++ } ++ ++ Icon getTileImpl(IBlockAccess blockAccess, Block block, Icon origIcon, int i, int j, int k, int face) { ++ Icon icon = super.getTileImpl(blockAccess, block, origIcon, i, j, k, face); ++ ++ if (icon != this.icons[3]) { ++ return icon; ++ } else { ++ int[][] offsets = NEIGHBOR_OFFSET[face]; ++ int neighborBits = 0; ++ ++ if (this.shouldConnect(blockAccess, block, origIcon, i, j, k, face, offsets[this.rotateUV(1)])) { ++ neighborBits |= 1; ++ } ++ ++ if (this.shouldConnect(blockAccess, block, origIcon, i, j, k, face, offsets[this.rotateUV(2)])) { ++ neighborBits |= 2; ++ } ++ ++ if (this.shouldConnect(blockAccess, block, origIcon, i, j, k, face, offsets[this.rotateUV(3)])) { ++ neighborBits |= 4; ++ } ++ ++ if (this.shouldConnect(blockAccess, block, origIcon, i, j, k, face, offsets[this.rotateUV(5)])) { ++ neighborBits |= 8; ++ } ++ ++ if (this.shouldConnect(blockAccess, block, origIcon, i, j, k, face, offsets[this.rotateUV(6)])) { ++ neighborBits |= 16; ++ } ++ ++ if (this.shouldConnect(blockAccess, block, origIcon, i, j, k, face, offsets[this.rotateUV(7)])) { ++ neighborBits |= 32; ++ } ++ ++ return this.icons[neighborMap[neighborBits]]; ++ } ++ } ++} diff --git a/patches/com/prupe/mcpatcher/ctm/TileOverrideImpl$Random1.java.patch b/patches/com/prupe/mcpatcher/ctm/TileOverrideImpl$Random1.java.patch new file mode 100644 index 0000000..44eb964 --- /dev/null +++ b/patches/com/prupe/mcpatcher/ctm/TileOverrideImpl$Random1.java.patch @@ -0,0 +1,54 @@ +--- /dev/null ++++ com/prupe/mcpatcher/ctm/TileOverrideImpl$Random1.java +@@ -1,0 +1,51 @@ ++package com.prupe.mcpatcher.ctm; ++ ++import com.prupe.mcpatcher.TileLoader; ++import com.prupe.mcpatcher.WeightedIndex; ++import java.util.Properties; ++import net.minecraft.src.Block; ++import net.minecraft.src.IBlockAccess; ++import net.minecraft.src.Icon; ++import net.minecraft.src.ResourceLocation; ++ ++final class TileOverrideImpl$Random1 extends TileOverride { ++ private final int symmetry; ++ private final WeightedIndex chooser; ++ ++ TileOverrideImpl$Random1(ResourceLocation filePrefix, Properties properties, TileLoader tileLoader) { ++ super(filePrefix, properties, tileLoader); ++ String sym = properties.getProperty("symmetry", "none"); ++ ++ if (sym.equals("all")) { ++ this.symmetry = 6; ++ } else if (sym.equals("opposite")) { ++ this.symmetry = 2; ++ } else { ++ this.symmetry = 1; ++ } ++ ++ this.chooser = WeightedIndex.create(this.getNumberOfTiles(), properties.getProperty("weights", "")); ++ ++ if (this.chooser == null) { ++ this.error("invalid weights", new Object[0]); ++ } ++ } ++ ++ String getMethod() { ++ return "random"; ++ } ++ ++ Icon getTileImpl(IBlockAccess blockAccess, Block block, Icon origIcon, int i, int j, int k, int face) { ++ if (face < 0) { ++ face = 0; ++ } ++ ++ long hash = WeightedIndex.hash128To64(i, j, k, this.reorient(face) / this.symmetry); ++ int index = this.chooser.choose(hash); ++ return this.icons[index]; ++ } ++ ++ Icon getTileImpl(Block block, Icon origIcon, int face, int metadata) { ++ return this.icons[0]; ++ } ++} diff --git a/patches/com/prupe/mcpatcher/ctm/TileOverrideImpl$Repeat.java.patch b/patches/com/prupe/mcpatcher/ctm/TileOverrideImpl$Repeat.java.patch new file mode 100644 index 0000000..9fa5b40 --- /dev/null +++ b/patches/com/prupe/mcpatcher/ctm/TileOverrideImpl$Repeat.java.patch @@ -0,0 +1,109 @@ +--- /dev/null ++++ com/prupe/mcpatcher/ctm/TileOverrideImpl$Repeat.java +@@ -1,0 +1,106 @@ ++package com.prupe.mcpatcher.ctm; ++ ++import com.prupe.mcpatcher.MCPatcherUtils; ++import com.prupe.mcpatcher.TileLoader; ++import java.util.Properties; ++import net.minecraft.src.Block; ++import net.minecraft.src.IBlockAccess; ++import net.minecraft.src.Icon; ++import net.minecraft.src.ResourceLocation; ++ ++final class TileOverrideImpl$Repeat extends TileOverride { ++ private final int width; ++ private final int height; ++ private final int symmetry; ++ ++ TileOverrideImpl$Repeat(ResourceLocation filePrefix, Properties properties, TileLoader tileLoader) { ++ super(filePrefix, properties, tileLoader); ++ this.width = MCPatcherUtils.getIntProperty(properties, "width", 0); ++ this.height = MCPatcherUtils.getIntProperty(properties, "height", 0); ++ ++ if (this.width <= 0 || this.height <= 0) { ++ this.error("invalid width and height (%dx%d)", new Object[] {Integer.valueOf(this.width), Integer.valueOf(this.height)}); ++ } ++ ++ String sym = properties.getProperty("symmetry", "none"); ++ ++ if (sym.equals("opposite")) { ++ this.symmetry = -2; ++ } else { ++ this.symmetry = -1; ++ } ++ } ++ ++ String getMethod() { ++ return "repeat"; ++ } ++ ++ String checkTileMap() { ++ return this.getNumberOfTiles() == this.width * this.height ? null : String.format("requires exactly %dx%d tiles", new Object[] {Integer.valueOf(this.width), Integer.valueOf(this.height)}); ++ } ++ ++ Icon getTileImpl(IBlockAccess blockAccess, Block block, Icon origIcon, int i, int j, int k, int face) { ++ if (face < 0) { ++ face = 0; ++ } ++ ++ face &= this.symmetry; ++ int x; ++ int y; ++ ++ switch (face) { ++ case 0: ++ case 1: ++ if (this.rotateTop) { ++ x = k; ++ y = i; ++ } else { ++ x = i; ++ y = k; ++ } ++ ++ break; ++ ++ case 2: ++ x = -i - 1; ++ y = -j; ++ break; ++ ++ case 3: ++ x = i; ++ y = -j; ++ break; ++ ++ case 4: ++ x = k; ++ y = -j; ++ break; ++ ++ case 5: ++ x = -k - 1; ++ y = -j; ++ break; ++ ++ default: ++ return null; ++ } ++ ++ x %= this.width; ++ ++ if (x < 0) { ++ x += this.width; ++ } ++ ++ y %= this.height; ++ ++ if (y < 0) { ++ y += this.height; ++ } ++ ++ return this.icons[this.width * y + x]; ++ } ++ ++ Icon getTileImpl(Block block, Icon origIcon, int face, int metadata) { ++ return this.icons[0]; ++ } ++} diff --git a/patches/com/prupe/mcpatcher/ctm/TileOverrideImpl$Top.java.patch b/patches/com/prupe/mcpatcher/ctm/TileOverrideImpl$Top.java.patch new file mode 100644 index 0000000..cb3b0c7 --- /dev/null +++ b/patches/com/prupe/mcpatcher/ctm/TileOverrideImpl$Top.java.patch @@ -0,0 +1,40 @@ +--- /dev/null ++++ com/prupe/mcpatcher/ctm/TileOverrideImpl$Top.java +@@ -1,0 +1,37 @@ ++package com.prupe.mcpatcher.ctm; ++ ++import com.prupe.mcpatcher.TileLoader; ++import java.util.Properties; ++import net.minecraft.src.Block; ++import net.minecraft.src.IBlockAccess; ++import net.minecraft.src.Icon; ++import net.minecraft.src.ResourceLocation; ++ ++final class TileOverrideImpl$Top extends TileOverride { ++ TileOverrideImpl$Top(ResourceLocation filePrefix, Properties properties, TileLoader tileLoader) { ++ super(filePrefix, properties, tileLoader); ++ } ++ ++ String getMethod() { ++ return "top"; ++ } ++ ++ String checkTileMap() { ++ return this.getNumberOfTiles() == 1 ? null : "requires exactly 1 tile"; ++ } ++ ++ Icon getTileImpl(IBlockAccess blockAccess, Block block, Icon origIcon, int i, int j, int k, int face) { ++ if (face < 0) { ++ face = 2; ++ } else if (this.reorient(face) <= 1) { ++ return null; ++ } ++ ++ int[][] offsets = NEIGHBOR_OFFSET[face]; ++ return this.shouldConnect(blockAccess, block, origIcon, i, j, k, face, offsets[this.rotateUV(6)]) ? this.icons[0] : null; ++ } ++ ++ Icon getTileImpl(Block block, Icon origIcon, int face, int metadata) { ++ return null; ++ } ++} diff --git a/patches/com/prupe/mcpatcher/ctm/TileOverrideImpl$Vertical.java.patch b/patches/com/prupe/mcpatcher/ctm/TileOverrideImpl$Vertical.java.patch new file mode 100644 index 0000000..0918bfc --- /dev/null +++ b/patches/com/prupe/mcpatcher/ctm/TileOverrideImpl$Vertical.java.patch @@ -0,0 +1,52 @@ +--- /dev/null ++++ com/prupe/mcpatcher/ctm/TileOverrideImpl$Vertical.java +@@ -1,0 +1,49 @@ ++package com.prupe.mcpatcher.ctm; ++ ++import com.prupe.mcpatcher.TileLoader; ++import java.util.Properties; ++import net.minecraft.src.Block; ++import net.minecraft.src.IBlockAccess; ++import net.minecraft.src.Icon; ++import net.minecraft.src.ResourceLocation; ++ ++class TileOverrideImpl$Vertical extends TileOverride { ++ private static final int[] neighborMap = new int[] {3, 2, 0, 1}; ++ ++ TileOverrideImpl$Vertical(ResourceLocation filePrefix, Properties properties, TileLoader tileLoader) { ++ super(filePrefix, properties, tileLoader); ++ } ++ ++ String getMethod() { ++ return "vertical"; ++ } ++ ++ String checkTileMap() { ++ return this.getNumberOfTiles() == 4 ? null : "requires exactly 4 tiles"; ++ } ++ ++ Icon getTileImpl(IBlockAccess blockAccess, Block block, Icon origIcon, int i, int j, int k, int face) { ++ if (face < 0) { ++ face = 2; ++ } else if (this.reorient(face) <= 1) { ++ return null; ++ } ++ ++ int[][] offsets = NEIGHBOR_OFFSET[face]; ++ int neighborBits = 0; ++ ++ if (this.shouldConnect(blockAccess, block, origIcon, i, j, k, face, offsets[this.rotateUV(2)])) { ++ neighborBits |= 1; ++ } ++ ++ if (this.shouldConnect(blockAccess, block, origIcon, i, j, k, face, offsets[this.rotateUV(6)])) { ++ neighborBits |= 2; ++ } ++ ++ return this.icons[neighborMap[neighborBits]]; ++ } ++ ++ Icon getTileImpl(Block block, Icon origIcon, int face, int metadata) { ++ return this.icons[3]; ++ } ++} diff --git a/patches/com/prupe/mcpatcher/ctm/TileOverrideImpl$VerticalHorizontal.java.patch b/patches/com/prupe/mcpatcher/ctm/TileOverrideImpl$VerticalHorizontal.java.patch new file mode 100644 index 0000000..ae05bbe --- /dev/null +++ b/patches/com/prupe/mcpatcher/ctm/TileOverrideImpl$VerticalHorizontal.java.patch @@ -0,0 +1,65 @@ +--- /dev/null ++++ com/prupe/mcpatcher/ctm/TileOverrideImpl$VerticalHorizontal.java +@@ -1,0 +1,62 @@ ++package com.prupe.mcpatcher.ctm; ++ ++import com.prupe.mcpatcher.TileLoader; ++import com.prupe.mcpatcher.ctm.TileOverrideImpl$Vertical; ++import java.util.Properties; ++import net.minecraft.src.Block; ++import net.minecraft.src.IBlockAccess; ++import net.minecraft.src.Icon; ++import net.minecraft.src.ResourceLocation; ++ ++final class TileOverrideImpl$VerticalHorizontal extends TileOverrideImpl$Vertical { ++ private static final int[] neighborMap = new int[] {3, 6, 3, 3, 3, 6, 3, 3, 4, 5, 4, 4, 3, 6, 3, 3, 3, 6, 3, 3, 3, 6, 3, 3, 3, 6, 3, 3, 3, 6, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3}; ++ ++ TileOverrideImpl$VerticalHorizontal(ResourceLocation filePrefix, Properties properties, TileLoader tileLoader) { ++ super(filePrefix, properties, tileLoader); ++ } ++ ++ String getMethod() { ++ return "vertical+horizontal"; ++ } ++ ++ String checkTileMap() { ++ return this.getNumberOfTiles() == 7 ? null : "requires exactly 7 tiles"; ++ } ++ ++ Icon getTileImpl(IBlockAccess blockAccess, Block block, Icon origIcon, int i, int j, int k, int face) { ++ Icon icon = super.getTileImpl(blockAccess, block, origIcon, i, j, k, face); ++ ++ if (icon != this.icons[3]) { ++ return icon; ++ } else { ++ int[][] offsets = NEIGHBOR_OFFSET[face]; ++ int neighborBits = 0; ++ ++ if (this.shouldConnect(blockAccess, block, origIcon, i, j, k, face, offsets[this.rotateUV(0)])) { ++ neighborBits |= 1; ++ } ++ ++ if (this.shouldConnect(blockAccess, block, origIcon, i, j, k, face, offsets[this.rotateUV(1)])) { ++ neighborBits |= 2; ++ } ++ ++ if (this.shouldConnect(blockAccess, block, origIcon, i, j, k, face, offsets[this.rotateUV(3)])) { ++ neighborBits |= 4; ++ } ++ ++ if (this.shouldConnect(blockAccess, block, origIcon, i, j, k, face, offsets[this.rotateUV(4)])) { ++ neighborBits |= 8; ++ } ++ ++ if (this.shouldConnect(blockAccess, block, origIcon, i, j, k, face, offsets[this.rotateUV(5)])) { ++ neighborBits |= 16; ++ } ++ ++ if (this.shouldConnect(blockAccess, block, origIcon, i, j, k, face, offsets[this.rotateUV(7)])) { ++ neighborBits |= 32; ++ } ++ ++ return this.icons[neighborMap[neighborBits]]; ++ } ++ } ++} diff --git a/patches/com/prupe/mcpatcher/ctm/TileOverrideImpl.java.patch b/patches/com/prupe/mcpatcher/ctm/TileOverrideImpl.java.patch new file mode 100644 index 0000000..4aee898 --- /dev/null +++ b/patches/com/prupe/mcpatcher/ctm/TileOverrideImpl.java.patch @@ -0,0 +1,7 @@ +--- /dev/null ++++ com/prupe/mcpatcher/ctm/TileOverrideImpl.java +@@ -1,0 +1,4 @@ ++package com.prupe.mcpatcher.ctm; ++ ++class TileOverrideImpl { ++} diff --git a/patches/com/prupe/mcpatcher/hd/AAHelper.java.patch b/patches/com/prupe/mcpatcher/hd/AAHelper.java.patch new file mode 100644 index 0000000..5b0be13 --- /dev/null +++ b/patches/com/prupe/mcpatcher/hd/AAHelper.java.patch @@ -0,0 +1,156 @@ +--- /dev/null ++++ com/prupe/mcpatcher/hd/AAHelper.java +@@ -1,0 +1,153 @@ ++package com.prupe.mcpatcher.hd; ++ ++import com.prupe.mcpatcher.Config; ++import com.prupe.mcpatcher.MCLogger; ++import java.awt.image.BufferedImage; ++import java.lang.reflect.Field; ++import net.minecraft.src.Resource; ++import net.minecraft.src.ResourceLocation; ++import net.minecraft.src.SimpleResource; ++import net.minecraft.src.TextureAtlasSprite; ++import org.lwjgl.opengl.PixelFormat; ++ ++//Spout Start ++import org.spoutcraft.client.config.Configuration; ++//Spout End ++ ++public class AAHelper { ++ private static final MCLogger logger = MCLogger.getLogger("Mipmap"); ++ private static final int debugColor = Config.getBoolean("Extended HD", "debugBorder", false) ? -16776961 : 0; ++ private static final int aaSamples = Config.getInt("Extended HD", "antiAliasing", 1); ++ private static Field addressField; ++ ++ public static PixelFormat setupPixelFormat(PixelFormat pixelFormat) { ++ if (Configuration.getAASampling() > 1) { ++ logger.config("setting AA samples to %d", new Object[] {Integer.valueOf(Configuration.getAASampling())}); ++ return pixelFormat.withSamples(Configuration.getAASampling()); ++ } else { ++ return pixelFormat; ++ } ++ } ++ ++ public static BufferedImage addBorder(TextureAtlasSprite stitched, Resource resource, BufferedImage input) { ++ if (input != null && resource instanceof SimpleResource && addressField != null) { ++ ResourceLocation name; ++ ++ try { ++ name = (ResourceLocation)addressField.get(resource); ++ } catch (IllegalAccessException var14) { ++ var14.printStackTrace(); ++ addressField = null; ++ return input; ++ } ++ ++ input = MipmapHelper.fixTransparency(name, input); ++ ++ if (!(stitched instanceof BorderedTexture)) { ++ return input; ++ } else { ++ int width = input.getWidth(); ++ int height = input.getHeight(); ++ int numFrames = height / width; ++ height = width; ++ int border = getBorderWidth(width); ++ ((BorderedTexture)stitched).setBorderWidth(border); ++ ++ if (border <= 0) { ++ return input; ++ } else { ++ int newWidth = width + 2 * border; ++ int newHeight = width + 2 * border; ++ BufferedImage output = new BufferedImage(newWidth, numFrames * newHeight, 2); ++ ++ for (int frame = 0; frame < numFrames; ++frame) { ++ int sy = frame * height; ++ int dy = frame * newHeight; ++ copyRegion(input, 0, sy, output, 0, dy, border, border, true, true); ++ copyRegion(input, 0, sy, output, border, dy, width, border, false, true); ++ copyRegion(input, width - border, sy, output, width + border, dy, border, border, true, true); ++ copyRegion(input, 0, sy, output, 0, dy + border, border, width, true, false); ++ copyRegion(input, 0, sy, output, border, dy + border, width, height, false, false); ++ copyRegion(input, width - border, sy, output, width + border, dy + border, border, width, true, false); ++ copyRegion(input, 0, sy + height - border, output, 0, dy + height + border, border, border, true, true); ++ copyRegion(input, 0, sy + height - border, output, border, dy + height + border, width, border, false, true); ++ copyRegion(input, width - border, sy + height - border, output, width + border, dy + height + border, border, border, true, true); ++ addDebugOutline(output, dy, width, height, border); ++ } ++ ++ return output; ++ } ++ } ++ } else { ++ return input; ++ } ++ } ++ ++ static boolean useAAForTexture(String texture) { ++ return (Configuration.getAASampling() > 1 || MipmapHelper.anisoLevel > 1) && MipmapHelper.useMipmapsForTexture(texture); ++ } ++ ++ private static int getBorderWidth(int size) { ++ int border; ++ ++ if (Configuration.getAASampling() <= 1 && MipmapHelper.anisoLevel <= 1) { ++ border = 0; ++ } else if (MipmapHelper.mipmapEnabled && MipmapHelper.maxMipmapLevel > 0) { ++ border = 1 << Math.max(Math.min(MipmapHelper.maxMipmapLevel, 4), 0); ++ } else { ++ border = 2; ++ } ++ ++ return Math.min(border, size); ++ } ++ ++ private static void copyRegion(BufferedImage input, int sx, int sy, BufferedImage output, int dx, int dy, int w, int h, boolean flipX, boolean flipY) { ++ int[] rgb = new int[w * h]; ++ input.getRGB(sx, sy, w, h, rgb, 0, w); ++ ++ if (!flipX && !flipY) { ++ output.setRGB(dx, dy, w, h, rgb, 0, w); ++ } else { ++ int[] rgbFlipped = new int[w * h]; ++ ++ for (int i = 0; i < w; ++i) { ++ for (int j = 0; j < h; ++j) { ++ rgbFlipped[w * j + i] = rgb[w * (flipY ? h - 1 - j : j) + (flipX ? w - 1 - i : i)]; ++ } ++ } ++ ++ output.setRGB(dx, dy, w, h, rgbFlipped, 0, w); ++ } ++ } ++ ++ private static void addDebugOutline(BufferedImage output, int dy, int width, int height, int border) { ++ if (debugColor != 0) { ++ int i; ++ ++ for (i = 0; i < width; ++i) { ++ output.setRGB(i + border, dy + border, debugColor); ++ output.setRGB(i + border, dy + height + border, debugColor); ++ } ++ ++ for (i = 0; i < height; ++i) { ++ output.setRGB(border, dy + i + border, debugColor); ++ output.setRGB(height + border, dy + i + border, debugColor); ++ } ++ } ++ } ++ ++ static { ++ Field[] arr$ = SimpleResource.class.getDeclaredFields(); ++ int len$ = arr$.length; ++ ++ for (int i$ = 0; i$ < len$; ++i$) { ++ Field f = arr$[i$]; ++ ++ if (ResourceLocation.class.isAssignableFrom(f.getType())) { ++ f.setAccessible(true); ++ addressField = f; ++ break; ++ } ++ } ++ } ++} diff --git a/patches/com/prupe/mcpatcher/hd/BorderedTexture.java.patch b/patches/com/prupe/mcpatcher/hd/BorderedTexture.java.patch new file mode 100644 index 0000000..911a7c3 --- /dev/null +++ b/patches/com/prupe/mcpatcher/hd/BorderedTexture.java.patch @@ -0,0 +1,128 @@ +--- /dev/null ++++ com/prupe/mcpatcher/hd/BorderedTexture.java +@@ -1,0 +1,125 @@ ++package com.prupe.mcpatcher.hd; ++ ++import com.prupe.mcpatcher.MCLogger; ++import net.minecraft.src.TextureAtlasSprite; ++ ++public class BorderedTexture extends TextureAtlasSprite { ++ private static final MCLogger logger = MCLogger.getLogger("Mipmap"); ++ private float minU; ++ private float maxU; ++ private float minV; ++ private float maxV; ++ private float scaledWidth; ++ private float scaledHeight; ++ private int tilesheetWidth; ++ private int tilesheetHeight; ++ private int x0; ++ private int y0; ++ private String tilesheet; ++ int border; ++ ++ public static TextureAtlasSprite create(String tilesheet, String name) { ++ return (TextureAtlasSprite)(AAHelper.useAAForTexture(tilesheet) ? new BorderedTexture(tilesheet, name) : new TextureAtlasSprite(name)); ++ } ++ ++ private BorderedTexture(String tilesheet, String name) { ++ super(name); ++ this.tilesheet = tilesheet; ++ } ++ ++ public void initSprite(int tilesheetWidth, int tilesheetHeight, int x0, int y0, boolean flipped) { ++ super.initSprite(tilesheetWidth, tilesheetHeight, x0, y0, flipped); ++ this.tilesheetWidth = tilesheetWidth; ++ this.tilesheetHeight = tilesheetHeight; ++ this.x0 = x0; ++ this.y0 = y0; ++ this.setBorderWidth(this.border); ++ } ++ ++ /** ++ * Returns the minimum U coordinate to use when rendering with this icon. ++ */ ++ public float getMinU() { ++ return this.minU; ++ } ++ ++ /** ++ * Returns the maximum U coordinate to use when rendering with this icon. ++ */ ++ public float getMaxU() { ++ return this.maxU; ++ } ++ ++ /** ++ * Gets a U coordinate on the icon. 0 returns uMin and 16 returns uMax. Other arguments return in-between values. ++ */ ++ public float getInterpolatedU(double u) { ++ return this.border > 0 ? this.minU + (float)u * this.scaledWidth : super.getInterpolatedU(u); ++ } ++ ++ /** ++ * Returns the minimum V coordinate to use when rendering with this icon. ++ */ ++ public float getMinV() { ++ return this.minV; ++ } ++ ++ /** ++ * Returns the maximum V coordinate to use when rendering with this icon. ++ */ ++ public float getMaxV() { ++ return this.maxV; ++ } ++ ++ /** ++ * Gets a V coordinate on the icon. 0 returns vMin and 16 returns vMax. Other arguments return in-between values. ++ */ ++ public float getInterpolatedV(double v) { ++ return this.border > 0 ? this.minV + (float)v * this.scaledHeight : super.getInterpolatedV(v); ++ } ++ ++ public void copyFrom(TextureAtlasSprite stitched) { ++ if (stitched instanceof BorderedTexture) { ++ BorderedTexture bordered = (BorderedTexture)stitched; ++ this.tilesheetWidth = bordered.tilesheetWidth; ++ this.tilesheetHeight = bordered.tilesheetHeight; ++ this.x0 = bordered.x0; ++ this.y0 = bordered.y0; ++ this.tilesheet = bordered.tilesheet; ++ this.border = bordered.border; ++ } ++ } ++ ++ void setBorderWidth(int border) { ++ this.border = border; ++ int width = this.getIconWidth(); ++ int height = this.getIconHeight(); ++ ++ if (width > 0 && height > 0) { ++ logger.finer("setBorderWidth(%s, %s, %d): %dx%d -> %dx%d", new Object[] {this.tilesheet, this.getIconName(), Integer.valueOf(border), Integer.valueOf(width - 2 * border), Integer.valueOf(height - 2 * border), Integer.valueOf(width), Integer.valueOf(height)}); ++ ++ if (border > 0) { ++ this.x0 += border; ++ this.y0 += border; ++ width -= 2 * border; ++ height -= 2 * border; ++ this.minU = (float)this.x0 / (float)this.tilesheetWidth; ++ this.maxU = (float)(this.x0 + width) / (float)this.tilesheetWidth; ++ this.minV = (float)this.y0 / (float)this.tilesheetHeight; ++ this.maxV = (float)(this.y0 + height) / (float)this.tilesheetHeight; ++ } else { ++ this.minU = super.getMinU(); ++ this.maxU = super.getMaxU(); ++ this.minV = super.getMinV(); ++ this.maxV = super.getMaxV(); ++ } ++ ++ this.scaledWidth = (this.maxU - this.minU) / 16.0F; ++ this.scaledHeight = (this.maxV - this.minV) / 16.0F; ++ } else { ++ this.x0 = this.y0 = 0; ++ this.minU = this.maxU = this.minV = this.maxV = 0.0F; ++ this.scaledWidth = this.scaledHeight = 0.0F; ++ } ++ } ++} diff --git a/patches/com/prupe/mcpatcher/hd/CustomAnimation$1.java.patch b/patches/com/prupe/mcpatcher/hd/CustomAnimation$1.java.patch new file mode 100644 index 0000000..4364436 --- /dev/null +++ b/patches/com/prupe/mcpatcher/hd/CustomAnimation$1.java.patch @@ -0,0 +1,51 @@ +--- /dev/null ++++ com/prupe/mcpatcher/hd/CustomAnimation$1.java +@@ -1,0 +1,48 @@ ++package com.prupe.mcpatcher.hd; ++ ++import com.prupe.mcpatcher.TexturePackAPI; ++import com.prupe.mcpatcher.TexturePackChangeHandler; ++import java.util.Iterator; ++import java.util.Properties; ++import net.minecraft.src.ResourceLocation; ++ ++final class CustomAnimation$1 extends TexturePackChangeHandler { ++ CustomAnimation$1(String x0, int x1) { ++ super(x0, x1); ++ } ++ ++ public void beforeChange() { ++ if (!CustomAnimation.access$000().isEmpty()) { ++ CustomAnimation.access$100().fine("%d animations were never registered:", new Object[] {Integer.valueOf(CustomAnimation.access$000().size())}); ++ Iterator i$ = CustomAnimation.access$000().keySet().iterator(); ++ ++ while (i$.hasNext()) { ++ ResourceLocation resource = (ResourceLocation)i$.next(); ++ CustomAnimation.access$100().fine(" %s", new Object[] {resource}); ++ } ++ ++ CustomAnimation.access$000().clear(); ++ } ++ ++ CustomAnimation.access$200().clear(); ++ MipmapHelper.reset(); ++ FancyDial.clearAll(); ++ } ++ ++ public void afterChange() { ++ if (CustomAnimation.access$300()) { ++ Iterator i$ = TexturePackAPI.listResources("mcpatcher/anim", ".properties", true, false, false).iterator(); ++ ++ while (i$.hasNext()) { ++ ResourceLocation resource = (ResourceLocation)i$.next(); ++ Properties properties = TexturePackAPI.getProperties(resource); ++ ++ if (properties != null) { ++ CustomAnimation.access$000().put(resource, properties); ++ } ++ } ++ } ++ ++ FancyDial.registerAnimations(); ++ } ++} diff --git a/patches/com/prupe/mcpatcher/hd/CustomAnimation.java.patch b/patches/com/prupe/mcpatcher/hd/CustomAnimation.java.patch new file mode 100644 index 0000000..a61ae11 --- /dev/null +++ b/patches/com/prupe/mcpatcher/hd/CustomAnimation.java.patch @@ -0,0 +1,357 @@ +--- /dev/null ++++ com/prupe/mcpatcher/hd/CustomAnimation.java +@@ -1,0 +1,354 @@ ++package com.prupe.mcpatcher.hd; ++ ++import com.prupe.mcpatcher.Config; ++import com.prupe.mcpatcher.MCLogger; ++import com.prupe.mcpatcher.MCPatcherUtils; ++import com.prupe.mcpatcher.TexturePackAPI; ++import com.prupe.mcpatcher.TexturePackChangeHandler; ++import com.prupe.mcpatcher.hd.CustomAnimation$1; ++import java.awt.Graphics2D; ++import java.awt.image.BufferedImage; ++import java.awt.image.ImageObserver; ++import java.nio.ByteBuffer; ++import java.util.ArrayList; ++import java.util.Collections; ++import java.util.HashMap; ++import java.util.Iterator; ++import java.util.List; ++import java.util.Map; ++import java.util.Properties; ++import java.util.Map.Entry; ++import net.minecraft.src.ResourceLocation; ++import org.lwjgl.opengl.GL11; ++import org.lwjgl.util.glu.GLU; ++ ++public class CustomAnimation implements Comparable { ++ private static final MCLogger logger = MCLogger.getLogger("Custom Animations", "Animation"); ++ private static final boolean enable = Config.getBoolean("Extended HD", "animations", true); ++ private static final Map pending = new HashMap(); ++ private static final List animations = new ArrayList(); ++ private final ResourceLocation propertiesName; ++ private final ResourceLocation dstName; ++ private final ResourceLocation srcName; ++ private final int mipmapLevel; ++ private final ByteBuffer imageData; ++ private final int x; ++ private final int y; ++ private final int w; ++ private final int h; ++ private int currentFrame; ++ private int currentDelay; ++ private int numFrames; ++ private int[] tileOrder; ++ private int[] tileDelay; ++ private final int numTiles; ++ private boolean error; ++ ++ public static void updateAll() { ++ if (!pending.isEmpty()) { ++ try { ++ checkPendingAnimations(); ++ } catch (Throwable var2) { ++ var2.printStackTrace(); ++ logger.error("%d remaining animations cleared", new Object[] {Integer.valueOf(pending.size())}); ++ pending.clear(); ++ } ++ } ++ ++ Iterator i$ = animations.iterator(); ++ ++ while (i$.hasNext()) { ++ CustomAnimation animation = (CustomAnimation)i$.next(); ++ animation.update(); ++ } ++ } ++ ++ private static void checkPendingAnimations() { ++ ArrayList done = new ArrayList(); ++ Iterator i$ = pending.entrySet().iterator(); ++ ++ while (i$.hasNext()) { ++ Entry name = (Entry)i$.next(); ++ ResourceLocation name1 = (ResourceLocation)name.getKey(); ++ Properties properties = (Properties)name.getValue(); ++ ResourceLocation textureName = TexturePackAPI.parseResourceLocation(name1, MCPatcherUtils.getStringProperty(properties, "to", "")); ++ ++ if (TexturePackAPI.isTextureLoaded(textureName)) { ++ addStrip(name1, properties); ++ done.add(name1); ++ } ++ } ++ ++ if (!done.isEmpty()) { ++ i$ = done.iterator(); ++ ++ while (i$.hasNext()) { ++ ResourceLocation name2 = (ResourceLocation)i$.next(); ++ pending.remove(name2); ++ } ++ ++ Collections.sort(animations); ++ } ++ } ++ ++ private static void addStrip(ResourceLocation propertiesName, Properties properties) { ++ ResourceLocation dstName = TexturePackAPI.parseResourceLocation(propertiesName, properties.getProperty("to", "")); ++ ++ if (dstName == null) { ++ logger.error("%s: missing to= property", new Object[0]); ++ } else { ++ ResourceLocation srcName = TexturePackAPI.parseResourceLocation(propertiesName, properties.getProperty("from", "")); ++ ++ if (srcName == null) { ++ logger.error("%s: missing from= property", new Object[0]); ++ } else { ++ BufferedImage srcImage = TexturePackAPI.getImage(srcName); ++ ++ if (srcImage == null) { ++ logger.error("%s: image %s not found in texture pack", new Object[] {propertiesName, srcName}); ++ } else { ++ int x = MCPatcherUtils.getIntProperty(properties, "x", 0); ++ int y = MCPatcherUtils.getIntProperty(properties, "y", 0); ++ int w = MCPatcherUtils.getIntProperty(properties, "w", 0); ++ int h = MCPatcherUtils.getIntProperty(properties, "h", 0); ++ ++ if (dstName.toString().startsWith("minecraft:textures/atlas/")) { ++ logger.error("%s: animations cannot have a target of %s", new Object[] {dstName}); ++ } else if (x >= 0 && y >= 0 && w > 0 && h > 0) { ++ TexturePackAPI.bindTexture(dstName); ++ int dstWidth = GL11.glGetTexLevelParameteri(GL11.GL_TEXTURE_2D, 0, GL11.GL_TEXTURE_WIDTH); ++ int dstHeight = GL11.glGetTexLevelParameteri(GL11.GL_TEXTURE_2D, 0, GL11.GL_TEXTURE_HEIGHT); ++ int levels = MipmapHelper.getMipmapLevelsForCurrentTexture(); ++ ++ if (x + w <= dstWidth && y + h <= dstHeight) { ++ int width = srcImage.getWidth(); ++ int height = srcImage.getHeight(); ++ ++ if (width != w) { ++ srcImage = resizeImage(srcImage, w); ++ width = srcImage.getWidth(); ++ height = srcImage.getHeight(); ++ } ++ ++ if (width == w && height >= h) { ++ ByteBuffer imageData = ByteBuffer.allocateDirect(4 * width * height); ++ int[] argb = new int[width * height]; ++ byte[] rgba = new byte[4 * width * height]; ++ srcImage.getRGB(0, 0, width, height, argb, 0, width); ++ ARGBtoRGBA(argb, rgba); ++ imageData.put(rgba).flip(); ++ ++ for (int mipmapLevel = 0; mipmapLevel <= levels; ++mipmapLevel) { ++ add(new CustomAnimation(propertiesName, srcName, dstName, mipmapLevel, x, y, w, h, imageData, height / h, properties)); ++ ++ if (((x | y | w | h) & 1) != 0 || w <= 0 || h <= 0) { ++ break; ++ } ++ ++ ByteBuffer newImage = ByteBuffer.allocateDirect(width * height); ++ MipmapHelper.scaleHalf(imageData.asIntBuffer(), width, height, newImage.asIntBuffer(), 0); ++ imageData = newImage; ++ width >>= 1; ++ height >>= 1; ++ x >>= 1; ++ y >>= 1; ++ w >>= 1; ++ h >>= 1; ++ } ++ } else { ++ logger.error("%s: %s dimensions %dx%d do not match %dx%d", new Object[] {propertiesName, srcName, Integer.valueOf(width), Integer.valueOf(height), Integer.valueOf(w), Integer.valueOf(h)}); ++ } ++ } else { ++ logger.error("%s: %s dimensions x=%d,y=%d,w=%d,h=%d exceed %s size %dx%d", new Object[] {propertiesName, srcName, Integer.valueOf(x), Integer.valueOf(y), Integer.valueOf(w), Integer.valueOf(h), dstName, Integer.valueOf(dstWidth), Integer.valueOf(dstHeight)}); ++ } ++ } else { ++ logger.error("%s: %s has invalid dimensions x=%d,y=%d,w=%d,h=%d", new Object[] {propertiesName, srcName, Integer.valueOf(x), Integer.valueOf(y), Integer.valueOf(w), Integer.valueOf(h)}); ++ } ++ } ++ } ++ } ++ } ++ ++ private static void add(CustomAnimation animation) { ++ if (animation != null) { ++ animations.add(animation); ++ ++ if (animation.mipmapLevel == 0) { ++ logger.fine("new %s", new Object[] {animation}); ++ } ++ } ++ } ++ ++ private CustomAnimation(ResourceLocation propertiesName, ResourceLocation srcName, ResourceLocation dstName, int mipmapLevel, int x, int y, int w, int h, ByteBuffer imageData, int numFrames, Properties properties) { ++ this.propertiesName = propertiesName; ++ this.srcName = srcName; ++ this.dstName = dstName; ++ this.mipmapLevel = mipmapLevel; ++ this.x = x; ++ this.y = y; ++ this.w = w; ++ this.h = h; ++ this.imageData = imageData; ++ this.numFrames = numFrames; ++ this.currentFrame = -1; ++ this.numTiles = numFrames; ++ this.loadProperties(properties); ++ } ++ ++ void update() { ++ if (!this.error) { ++ int texture = TexturePackAPI.getTextureIfLoaded(this.dstName); ++ ++ if (texture >= 0) { ++ if (--this.currentDelay <= 0) { ++ if (++this.currentFrame >= this.numFrames) { ++ this.currentFrame = 0; ++ } ++ ++ TexturePackAPI.bindTexture(texture); ++ this.update(texture, 0, 0); ++ int glError = GL11.glGetError(); ++ ++ if (glError != 0) { ++ logger.severe("%s: %s", new Object[] {this, GLU.gluErrorString(glError)}); ++ this.error = true; ++ } else { ++ this.currentDelay = this.getDelay(); ++ } ++ } ++ } ++ } ++ } ++ ++ public int compareTo(CustomAnimation o) { ++ return this.dstName.toString().compareTo(o.dstName.toString()); ++ } ++ ++ public String toString() { ++ return String.format("CustomAnimation{%s %s %dx%d -> %s%s @ %d,%d (%d frames)}", new Object[] {this.propertiesName, this.srcName, Integer.valueOf(this.w), Integer.valueOf(this.h), this.dstName, this.mipmapLevel > 0 ? "#" + this.mipmapLevel : "", Integer.valueOf(this.x), Integer.valueOf(this.y), Integer.valueOf(this.numFrames)}); ++ } ++ ++ private static void ARGBtoRGBA(int[] src, byte[] dest) { ++ for (int i = 0; i < src.length; ++i) { ++ int v = src[i]; ++ dest[i * 4 + 3] = (byte)(v >> 24 & 255); ++ dest[i * 4 + 0] = (byte)(v >> 16 & 255); ++ dest[i * 4 + 1] = (byte)(v >> 8 & 255); ++ dest[i * 4 + 2] = (byte)(v >> 0 & 255); ++ } ++ } ++ ++ private static BufferedImage resizeImage(BufferedImage image, int width) { ++ if (width == image.getWidth()) { ++ return image; ++ } else { ++ int height = image.getHeight() * width / image.getWidth(); ++ logger.finer("resizing to %dx%d", new Object[] {Integer.valueOf(width), Integer.valueOf(height)}); ++ BufferedImage newImage = new BufferedImage(width, height, 2); ++ Graphics2D graphics2D = newImage.createGraphics(); ++ graphics2D.drawImage(image, 0, 0, width, height, (ImageObserver)null); ++ return newImage; ++ } ++ } ++ ++ private void loadProperties(Properties properties) { ++ this.loadTileOrder(properties); ++ int i; ++ ++ if (this.tileOrder == null) { ++ this.tileOrder = new int[this.numFrames]; ++ ++ for (i = 0; i < this.numFrames; ++i) { ++ this.tileOrder[i] = i % this.numTiles; ++ } ++ } ++ ++ this.tileDelay = new int[this.numFrames]; ++ this.loadTileDelay(properties); ++ ++ for (i = 0; i < this.numFrames; ++i) { ++ this.tileDelay[i] = Math.max(this.tileDelay[i], 1); ++ } ++ } ++ ++ private void loadTileOrder(Properties properties) { ++ if (properties != null) { ++ int i; ++ ++ for (i = 0; getIntValue(properties, "tile.", i) != null; ++i) { ++ ; ++ } ++ ++ if (i > 0) { ++ this.numFrames = i; ++ this.tileOrder = new int[this.numFrames]; ++ ++ for (i = 0; i < this.numFrames; ++i) { ++ this.tileOrder[i] = Math.abs(getIntValue(properties, "tile.", i).intValue()) % this.numTiles; ++ } ++ } ++ } ++ } ++ ++ private void loadTileDelay(Properties properties) { ++ if (properties != null) { ++ Integer defaultValue = getIntValue(properties, "duration"); ++ ++ for (int i = 0; i < this.numFrames; ++i) { ++ Integer value = getIntValue(properties, "duration.", i); ++ ++ if (value != null) { ++ this.tileDelay[i] = value.intValue(); ++ } else if (defaultValue != null) { ++ this.tileDelay[i] = defaultValue.intValue(); ++ } ++ } ++ } ++ } ++ ++ private static Integer getIntValue(Properties properties, String key) { ++ try { ++ String e = properties.getProperty(key); ++ ++ if (e != null && e.matches("^\\d+$")) { ++ return Integer.valueOf(Integer.parseInt(e)); ++ } ++ } catch (NumberFormatException var3) { ++ ; ++ } ++ ++ return null; ++ } ++ ++ private static Integer getIntValue(Properties properties, String prefix, int index) { ++ return getIntValue(properties, prefix + index); ++ } ++ ++ private void update(int texture, int dx, int dy) { ++ GL11.glTexSubImage2D(GL11.GL_TEXTURE_2D, this.mipmapLevel, this.x + dx, this.y + dy, this.w, this.h, GL11.GL_RGBA, GL11.GL_UNSIGNED_BYTE, (ByteBuffer)this.imageData.position(4 * this.w * this.h * this.tileOrder[this.currentFrame])); ++ } ++ ++ private int getDelay() { ++ return this.tileDelay[this.currentFrame]; ++ } ++ ++ static Map access$000() { ++ return pending; ++ } ++ ++ static MCLogger access$100() { ++ return logger; ++ } ++ ++ static List access$200() { ++ return animations; ++ } ++ ++ static boolean access$300() { ++ return enable; ++ } ++ ++ static { ++ TexturePackChangeHandler.register(new CustomAnimation$1("Extended HD", 1)); ++ } ++} diff --git a/patches/com/prupe/mcpatcher/hd/FancyDial$Layer.java.patch b/patches/com/prupe/mcpatcher/hd/FancyDial$Layer.java.patch new file mode 100644 index 0000000..1cf9a64 --- /dev/null +++ b/patches/com/prupe/mcpatcher/hd/FancyDial$Layer.java.patch @@ -0,0 +1,38 @@ +--- /dev/null ++++ com/prupe/mcpatcher/hd/FancyDial$Layer.java +@@ -1,0 +1,35 @@ ++package com.prupe.mcpatcher.hd; ++ ++import com.prupe.mcpatcher.BlendMethod; ++import net.minecraft.src.ResourceLocation; ++ ++class FancyDial$Layer { ++ final ResourceLocation textureName; ++ final float scaleX; ++ final float scaleY; ++ final float offsetX; ++ final float offsetY; ++ final float rotationMultiplier; ++ final float rotationOffset; ++ final BlendMethod blendMethod; ++ final boolean debug; ++ ++ final FancyDial this$0; ++ ++ FancyDial$Layer(FancyDial var1, ResourceLocation textureName, float scaleX, float scaleY, float offsetX, float offsetY, float rotationMultiplier, float rotationOffset, BlendMethod blendMethod, boolean debug) { ++ this.this$0 = var1; ++ this.textureName = textureName; ++ this.scaleX = scaleX; ++ this.scaleY = scaleY; ++ this.offsetX = offsetX; ++ this.offsetY = offsetY; ++ this.rotationMultiplier = rotationMultiplier; ++ this.rotationOffset = rotationOffset; ++ this.blendMethod = blendMethod; ++ this.debug = debug; ++ } ++ ++ public String toString() { ++ return String.format("Layer{%s %f %f %+f %+f x%f}", new Object[] {this.textureName, Float.valueOf(this.scaleX), Float.valueOf(this.scaleY), Float.valueOf(this.offsetX), Float.valueOf(this.offsetY), Float.valueOf(this.rotationMultiplier)}); ++ } ++} diff --git a/patches/com/prupe/mcpatcher/hd/FancyDial.java.patch b/patches/com/prupe/mcpatcher/hd/FancyDial.java.patch new file mode 100644 index 0000000..2d07355 --- /dev/null +++ b/patches/com/prupe/mcpatcher/hd/FancyDial.java.patch @@ -0,0 +1,627 @@ +--- /dev/null ++++ com/prupe/mcpatcher/hd/FancyDial.java +@@ -1,0 +1,624 @@ ++package com.prupe.mcpatcher.hd; ++ ++import com.prupe.mcpatcher.BlendMethod; ++import com.prupe.mcpatcher.Config; ++import com.prupe.mcpatcher.InputHandler; ++import com.prupe.mcpatcher.MCLogger; ++import com.prupe.mcpatcher.MCPatcherUtils; ++import com.prupe.mcpatcher.TexturePackAPI; ++import com.prupe.mcpatcher.hd.FancyDial$Layer; ++import java.awt.image.BufferedImage; ++import java.io.File; ++import java.nio.ByteBuffer; ++import java.nio.IntBuffer; ++import java.util.ArrayList; ++import java.util.Arrays; ++import java.util.Iterator; ++import java.util.List; ++import java.util.Map; ++import java.util.Properties; ++import java.util.TreeMap; ++import java.util.WeakHashMap; ++import javax.imageio.ImageIO; ++import net.minecraft.src.Icon; ++import net.minecraft.src.ResourceLocation; ++import net.minecraft.src.TextureAtlasSprite; ++import net.minecraft.src.TextureClock; ++import net.minecraft.src.TextureCompass; ++import net.minecraft.src.TextureMap; ++import net.minecraft.src.TextureObject; ++import org.lwjgl.opengl.EXTFramebufferObject; ++import org.lwjgl.opengl.GL11; ++import org.lwjgl.opengl.GL13; ++import org.lwjgl.opengl.GLContext; ++import org.lwjgl.util.glu.GLU; ++ ++public class FancyDial { ++ private static final MCLogger logger = MCLogger.getLogger("Custom Animations", "Animation"); ++ private static final ResourceLocation ITEMS_PNG = new ResourceLocation("textures/atlas/items.png"); ++ private static final double ANGLE_UNSET = Double.MAX_VALUE; ++ private static final int NUM_SCRATCH_TEXTURES = 3; ++ private static final boolean fboSupported = GLContext.getCapabilities().GL_EXT_framebuffer_object; ++ private static final boolean gl13Supported = GLContext.getCapabilities().OpenGL13; ++ private static final boolean enableCompass = Config.getBoolean("Extended HD", "fancyCompass", true); ++ private static final boolean enableClock = Config.getBoolean("Extended HD", "fancyClock", true); ++ private static final boolean useGL13 = gl13Supported && Config.getBoolean("Extended HD", "useGL13", true); ++ private static final boolean useScratchTexture = Config.getBoolean("Extended HD", "useScratchTexture", true); ++ private static final int glAttributes; ++ private static boolean initialized; ++ private static final int drawList = GL11.glGenLists(1); ++ private static final Map setupInfo = new WeakHashMap(); ++ private static final Map instances = new WeakHashMap(); ++ private final TextureAtlasSprite icon; ++ private final ResourceLocation resource; ++ private final String name; ++ private final int x0; ++ private final int y0; ++ private final int width; ++ private final int height; ++ private final int itemsTexture; ++ private final int[] scratchTexture = new int[4]; ++ private final ByteBuffer scratchBuffer; ++ private final int[] frameBuffer = new int[4]; ++ private int scratchIndex; ++ private Map itemFrames = new TreeMap(); ++ private int outputFrames; ++ private boolean ok; ++ private double lastAngle = Double.MAX_VALUE; ++ private boolean lastItemFrameRenderer; ++ private final List layers = new ArrayList(); ++ private InputHandler keyboard; ++ private static final float STEP = 0.01F; ++ private float scaleXDelta; ++ private float scaleYDelta; ++ private float offsetXDelta; ++ private float offsetYDelta; ++ ++ public static void setup(TextureAtlasSprite icon) { ++ if (fboSupported) { ++ String name = icon.getIconName(); ++ ++ if ("compass".equals(icon.getIconName())) { ++ if (!enableCompass) { ++ return; ++ } ++ } else { ++ if (!"clock".equals(icon.getIconName())) { ++ logger.warning("ignoring custom animation for %s not compass or clock", new Object[] {icon.getIconName()}); ++ return; ++ } ++ ++ if (!enableClock) { ++ return; ++ } ++ } ++ ++ ResourceLocation resource = TexturePackAPI.newMCPatcherResourceLocation("dial/" + name + ".properties"); ++ ++ if (TexturePackAPI.hasResource(resource)) { ++ logger.fine("found custom %s (%s)", new Object[] {name, resource}); ++ setupInfo.put(icon, resource); ++ } ++ } ++ } ++ ++ public static boolean update(TextureAtlasSprite icon, boolean itemFrameRenderer) { ++ if (!initialized) { ++ logger.finer("deferring %s update until initialization finishes", new Object[] {icon.getIconName()}); ++ return false; ++ } else { ++ FancyDial instance = (FancyDial)instances.get(icon); ++ ++ if (instance == null) { ++ instance = getInstance(icon); ++ ++ if (instance == null) { ++ return false; ++ } ++ } ++ ++ return instance.render(itemFrameRenderer); ++ } ++ } ++ ++ static void clearAll() { ++ logger.finer("FancyDial.clearAll", new Object[0]); ++ Iterator i$ = instances.values().iterator(); ++ ++ while (i$.hasNext()) { ++ FancyDial instance = (FancyDial)i$.next(); ++ ++ if (instance != null) { ++ instance.finish(); ++ } ++ } ++ ++ instances.clear(); ++ initialized = true; ++ } ++ ++ static void registerAnimations() { ++ TextureObject texture = TexturePackAPI.getTextureObject(ITEMS_PNG); ++ ++ if (texture instanceof TextureMap) { ++ List animations = ((TextureMap)texture).listAnimatedSprites; ++ Iterator i$ = instances.values().iterator(); ++ ++ while (i$.hasNext()) { ++ FancyDial instance = (FancyDial)i$.next(); ++ instance.registerAnimation(animations); ++ } ++ } ++ } ++ ++ void registerAnimation(List animations) { ++ if (!animations.contains(this.icon)) { ++ animations.add(this.icon); ++ ++ if (this.icon.framesTextureData == null) { ++ this.icon.framesTextureData = new ArrayList(); ++ } ++ ++ if (this.icon.framesTextureData.isEmpty()) { ++ int[] dummyRGB = new int[this.width * this.height]; ++ Arrays.fill(dummyRGB, -65281); ++ this.icon.framesTextureData.add(dummyRGB); ++ } ++ ++ logger.fine("registered %s animation", new Object[] {this.name}); ++ } ++ } ++ ++ private static FancyDial getInstance(TextureAtlasSprite icon) { ++ ResourceLocation resource = (ResourceLocation)setupInfo.get(icon); ++ Properties properties = TexturePackAPI.getProperties(resource); ++ setupInfo.remove(icon); ++ ++ if (properties == null) { ++ return null; ++ } else { ++ try { ++ FancyDial e = new FancyDial(icon, resource, properties); ++ ++ if (e.ok) { ++ instances.put(icon, e); ++ return e; ++ } ++ ++ e.finish(); ++ } catch (Throwable var4) { ++ var4.printStackTrace(); ++ } ++ ++ return null; ++ } ++ } ++ ++ private FancyDial(TextureAtlasSprite icon, ResourceLocation resource, Properties properties) { ++ this.icon = icon; ++ this.resource = resource; ++ this.name = icon.getIconName(); ++ this.x0 = icon.getOriginX(); ++ this.y0 = icon.getOriginY(); ++ this.width = icon.getIconWidth(); ++ this.height = icon.getIconHeight(); ++ this.scratchBuffer = ByteBuffer.allocateDirect(4 * this.width * this.height); ++ this.itemsTexture = TexturePackAPI.getTextureIfLoaded(ITEMS_PNG); ++ ++ if (this.itemsTexture < 0) { ++ logger.severe("could not get items texture", new Object[0]); ++ } else { ++ if (useScratchTexture) { ++ logger.fine("rendering %s to %dx%d scratch texture", new Object[] {this.name, Integer.valueOf(this.width), Integer.valueOf(this.height)}); ++ } else { ++ logger.fine("rendering %s directly to %s", new Object[] {this.name, ITEMS_PNG}); ++ } ++ ++ for (int debug = 0; debug < this.scratchTexture.length; ++debug) { ++ this.scratchTexture[debug] = debug == 3 ? this.itemsTexture : this.setupScratchTexture(debug); ++ this.frameBuffer[debug] = this.setupFrameBuffer(this.scratchTexture[debug]); ++ } ++ ++ boolean var7 = false; ++ int glError = 0; ++ ++ while (true) { ++ FancyDial$Layer layer = this.newLayer(resource, properties, "." + glError); ++ ++ if (layer == null) { ++ if (glError > 0) { ++ this.keyboard = new InputHandler(this.name, var7); ++ ++ if (this.layers.size() < 2) { ++ logger.error("custom %s needs at least two layers defined", new Object[] {this.name}); ++ return; ++ } ++ ++ this.outputFrames = MCPatcherUtils.getIntProperty(properties, "outputFrames", 0); ++ glError = GL11.glGetError(); ++ ++ if (glError != 0) { ++ logger.severe("%s during %s setup", new Object[] {GLU.gluErrorString(glError), this.name}); ++ return; ++ } ++ ++ this.ok = true; ++ return; ++ } ++ } else { ++ this.layers.add(layer); ++ var7 |= layer.debug; ++ logger.fine(" new %s", new Object[] {layer}); ++ } ++ ++ ++glError; ++ } ++ } ++ } ++ ++ private int setupScratchTexture(int i) { ++ int targetTexture; ++ ++ if (useScratchTexture) { ++ targetTexture = GL11.glGenTextures(); ++ MipmapHelper.setupTexture(targetTexture, this.width, this.height, TexturePackAPI.transformResourceLocation(this.resource, ".properties", "_scratch" + i).getResourcePath()); ++ } else { ++ targetTexture = -1; ++ } ++ ++ return targetTexture; ++ } ++ ++ private int setupFrameBuffer(int texture) { ++ if (texture < 0) { ++ return -1; ++ } else { ++ int frameBuffer = EXTFramebufferObject.glGenFramebuffersEXT(); ++ ++ if (frameBuffer < 0) { ++ logger.severe("could not get framebuffer object", new Object[0]); ++ this.ok = false; ++ return -1; ++ } else { ++ EXTFramebufferObject.glBindFramebufferEXT(36160, frameBuffer); ++ EXTFramebufferObject.glFramebufferTexture2DEXT(36160, 36064, 3553, texture, 0); ++ EXTFramebufferObject.glBindFramebufferEXT(36160, 0); ++ return frameBuffer; ++ } ++ } ++ } ++ ++ private boolean render(boolean itemFrameRenderer) { ++ if (!this.ok) { ++ return false; ++ } else { ++ if (!itemFrameRenderer) { ++ boolean angle = true; ++ ++ if (!this.keyboard.isEnabled()) { ++ angle = false; ++ } else if (this.keyboard.isKeyPressed(80)) { ++ this.scaleYDelta -= 0.01F; ++ } else if (this.keyboard.isKeyPressed(72)) { ++ this.scaleYDelta += 0.01F; ++ } else if (this.keyboard.isKeyPressed(75)) { ++ this.scaleXDelta -= 0.01F; ++ } else if (this.keyboard.isKeyPressed(77)) { ++ this.scaleXDelta += 0.01F; ++ } else if (this.keyboard.isKeyPressed(208)) { ++ this.offsetYDelta += 0.01F; ++ } else if (this.keyboard.isKeyPressed(200)) { ++ this.offsetYDelta -= 0.01F; ++ } else if (this.keyboard.isKeyPressed(203)) { ++ this.offsetXDelta -= 0.01F; ++ } else if (this.keyboard.isKeyPressed(205)) { ++ this.offsetXDelta += 0.01F; ++ } else if (this.keyboard.isKeyPressed(55)) { ++ this.scaleXDelta = this.scaleYDelta = this.offsetXDelta = this.offsetYDelta = 0.0F; ++ } else { ++ angle = false; ++ } ++ ++ if (angle) { ++ logger.info("", new Object[0]); ++ logger.info("scaleX %+f", new Object[] {Float.valueOf(this.scaleXDelta)}); ++ logger.info("scaleY %+f", new Object[] {Float.valueOf(this.scaleYDelta)}); ++ logger.info("offsetX %+f", new Object[] {Float.valueOf(this.offsetXDelta)}); ++ logger.info("offsetY %+f", new Object[] {Float.valueOf(this.offsetYDelta)}); ++ this.lastAngle = Double.MAX_VALUE; ++ } ++ ++ if (this.outputFrames > 0) { ++ this.writeCustomImage(); ++ this.outputFrames = 0; ++ } ++ } ++ ++ double var5 = getAngle(this.icon); ++ int var6; ++ ++ if (!useScratchTexture) { ++ if (var5 != this.lastAngle) { ++ this.renderToItems(var5); ++ this.lastAngle = var5; ++ } ++ } else if (itemFrameRenderer) { ++ ByteBuffer glError = (ByteBuffer)this.itemFrames.get(Double.valueOf(var5)); ++ ++ if (glError == null) { ++ logger.fine("rendering %s at angle %f for item frame", new Object[] {this.name, Double.valueOf(var5)}); ++ glError = ByteBuffer.allocateDirect(this.width * this.height * 4); ++ this.renderToItems(var5); ++ this.readTextureToBuffer(glError); ++ this.itemFrames.put(Double.valueOf(var5), glError); ++ } else { ++ this.copyBufferToItemsTexture(glError); ++ } ++ ++ this.lastItemFrameRenderer = true; ++ } else if (this.lastAngle == Double.MAX_VALUE) { ++ for (var6 = 0; var6 < 3; ++var6) { ++ this.renderToFB(var5, this.frameBuffer[var6]); ++ } ++ ++ this.readTextureToBuffer(this.scratchTexture[0], this.scratchBuffer); ++ this.copyBufferToItemsTexture(this.scratchBuffer); ++ this.lastAngle = var5; ++ this.scratchIndex = 0; ++ } else if (this.lastItemFrameRenderer || var5 != this.lastAngle) { ++ var6 = (this.scratchIndex + 1) % 3; ++ ++ if (var5 != this.lastAngle) { ++ this.renderToFB(var5, this.frameBuffer[var6]); ++ this.readTextureToBuffer(this.scratchTexture[this.scratchIndex], this.scratchBuffer); ++ } ++ ++ this.copyBufferToItemsTexture(this.scratchBuffer); ++ this.lastAngle = var5; ++ this.scratchIndex = var6; ++ this.lastItemFrameRenderer = false; ++ } ++ ++ var6 = GL11.glGetError(); ++ ++ if (var6 != 0) { ++ logger.severe("%s during %s update", new Object[] {GLU.gluErrorString(var6), this.name}); ++ this.ok = false; ++ } ++ ++ return this.ok; ++ } ++ } ++ ++ private void writeCustomImage() { ++ try { ++ BufferedImage e = new BufferedImage(this.width, this.outputFrames * this.height, 2); ++ IntBuffer intBuffer = this.scratchBuffer.asIntBuffer(); ++ int[] argb = new int[this.width * this.height]; ++ File path = MCPatcherUtils.getGamePath(new String[] {"custom_" + this.name + ".png"}); ++ logger.info("generating %d %s frames", new Object[] {Integer.valueOf(this.outputFrames), this.name}); ++ ++ for (int i = 0; i < this.outputFrames; ++i) { ++ this.renderToItems((double)i * (360.0D / (double)this.outputFrames)); ++ this.readTextureToBuffer(this.scratchBuffer); ++ intBuffer.position(0); ++ ++ for (int j = 0; j < argb.length; ++j) { ++ argb[j] = Integer.rotateRight(intBuffer.get(j), 8); ++ } ++ ++ e.setRGB(0, i * this.height, this.width, this.height, argb, 0, this.width); ++ } ++ ++ ImageIO.write(e, "png", path); ++ logger.info("wrote %dx%d %s", new Object[] {Integer.valueOf(e.getWidth()), Integer.valueOf(e.getHeight()), path.getPath()}); ++ } catch (Throwable var7) { ++ var7.printStackTrace(); ++ } ++ } ++ ++ private void renderToItems(double angle) { ++ GL11.glPushAttrib(glAttributes); ++ GL11.glViewport(this.x0, this.y0, this.width, this.height); ++ GL11.glEnable(GL11.GL_SCISSOR_TEST); ++ GL11.glScissor(this.x0, this.y0, this.width, this.height); ++ EXTFramebufferObject.glBindFramebufferEXT(36160, this.frameBuffer[3]); ++ this.renderImpl(angle); ++ } ++ ++ private void renderToFB(double angle, int bindFB) { ++ GL11.glPushAttrib(glAttributes); ++ GL11.glViewport(0, 0, this.width, this.height); ++ EXTFramebufferObject.glBindFramebufferEXT(36160, bindFB); ++ this.renderImpl(angle); ++ } ++ ++ private void renderImpl(double angle) { ++ boolean lightmapEnabled = false; ++ ++ if (gl13Supported) { ++ GL13.glActiveTexture(GL13.GL_TEXTURE1); ++ lightmapEnabled = GL11.glIsEnabled(GL11.GL_TEXTURE_2D); ++ ++ if (lightmapEnabled) { ++ GL11.glDisable(GL11.GL_TEXTURE_2D); ++ } ++ ++ GL13.glActiveTexture(GL13.GL_TEXTURE0); ++ } ++ ++ GL11.glEnable(GL11.GL_TEXTURE_2D); ++ GL11.glDisable(GL11.GL_DEPTH_TEST); ++ GL11.glBindTexture(GL11.GL_TEXTURE_2D, 0); ++ GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); ++ GL11.glDisable(GL11.GL_LIGHTING); ++ ++ if (useGL13) { ++ GL11.glDisable(GL13.GL_MULTISAMPLE); ++ } ++ ++ GL11.glClearColor(0.0F, 0.0F, 0.0F, 0.0F); ++ GL11.glClear(16384); ++ GL11.glMatrixMode(GL11.GL_PROJECTION); ++ GL11.glPushMatrix(); ++ GL11.glLoadIdentity(); ++ GL11.glOrtho(-1.0D, 1.0D, -1.0D, 1.0D, -1.0D, 1.0D); ++ GL11.glMatrixMode(GL11.GL_MODELVIEW); ++ GL11.glPushMatrix(); ++ GL11.glLoadIdentity(); ++ Iterator i$ = this.layers.iterator(); ++ ++ while (i$.hasNext()) { ++ FancyDial$Layer layer = (FancyDial$Layer)i$.next(); ++ layer.blendMethod.applyBlending(); ++ GL11.glPushMatrix(); ++ TexturePackAPI.bindTexture(layer.textureName); ++ float offsetX = layer.offsetX; ++ float offsetY = layer.offsetY; ++ float scaleX = layer.scaleX; ++ float scaleY = layer.scaleY; ++ ++ if (layer.debug) { ++ offsetX += this.offsetXDelta; ++ offsetY += this.offsetYDelta; ++ scaleX += this.scaleXDelta; ++ scaleY += this.scaleYDelta; ++ } ++ ++ GL11.glTranslatef(offsetX, offsetY, 0.0F); ++ GL11.glScalef(scaleX, scaleY, 1.0F); ++ float layerAngle = (float)(angle * (double)layer.rotationMultiplier + (double)layer.rotationOffset); ++ GL11.glRotatef(layerAngle, 0.0F, 0.0F, 1.0F); ++ GL11.glCallList(drawList); ++ GL11.glPopMatrix(); ++ } ++ ++ EXTFramebufferObject.glBindFramebufferEXT(36160, 0); ++ GL11.glPopAttrib(); ++ GL11.glMatrixMode(GL11.GL_PROJECTION); ++ GL11.glPopMatrix(); ++ GL11.glMatrixMode(GL11.GL_MODELVIEW); ++ GL11.glPopMatrix(); ++ ++ if (lightmapEnabled) { ++ GL13.glActiveTexture(GL13.GL_TEXTURE1); ++ GL11.glEnable(GL11.GL_TEXTURE_2D); ++ GL13.glActiveTexture(GL13.GL_TEXTURE0); ++ } ++ ++ GL11.glEnable(GL11.GL_BLEND); ++ GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); ++ } ++ ++ private void readTextureToBuffer(int texture, ByteBuffer buffer) { ++ TexturePackAPI.bindTexture(texture); ++ buffer.position(0); ++ GL11.glGetTexImage(GL11.GL_TEXTURE_2D, 0, GL11.GL_RGBA, GL11.GL_UNSIGNED_BYTE, buffer); ++ } ++ ++ private void readTextureToBuffer(ByteBuffer buffer) { ++ EXTFramebufferObject.glBindFramebufferEXT(36160, this.frameBuffer[3]); ++ buffer.position(0); ++ GL11.glReadPixels(this.x0, this.y0, this.width, this.height, GL11.GL_RGBA, GL11.GL_UNSIGNED_BYTE, buffer); ++ EXTFramebufferObject.glBindFramebufferEXT(36160, 0); ++ } ++ ++ private void copyBufferToItemsTexture(ByteBuffer buffer) { ++ TexturePackAPI.bindTexture(this.itemsTexture); ++ buffer.position(0); ++ GL11.glTexSubImage2D(GL11.GL_TEXTURE_2D, 0, this.x0, this.y0, this.width, this.height, GL11.GL_RGBA, GL11.GL_UNSIGNED_BYTE, buffer); ++ } ++ ++ private static void drawBox() { ++ GL11.glBegin(GL11.GL_QUADS); ++ GL11.glTexCoord2f(0.0F, 0.0F); ++ GL11.glVertex3f(-1.0F, -1.0F, 0.0F); ++ GL11.glTexCoord2f(1.0F, 0.0F); ++ GL11.glVertex3f(1.0F, -1.0F, 0.0F); ++ GL11.glTexCoord2f(1.0F, 1.0F); ++ GL11.glVertex3f(1.0F, 1.0F, 0.0F); ++ GL11.glTexCoord2f(0.0F, 1.0F); ++ GL11.glVertex3f(-1.0F, 1.0F, 0.0F); ++ GL11.glEnd(); ++ } ++ ++ private void finish() { ++ for (int i = 0; i < this.frameBuffer.length; ++i) { ++ if (this.frameBuffer[i] >= 0) { ++ EXTFramebufferObject.glDeleteFramebuffersEXT(this.frameBuffer[i]); ++ this.frameBuffer[i] = -1; ++ } ++ ++ if (i < 3 && this.scratchTexture[i] >= 0) { ++ TexturePackAPI.deleteTexture(this.scratchTexture[i]); ++ this.scratchTexture[i] = -1; ++ } ++ } ++ ++ this.itemFrames.clear(); ++ this.layers.clear(); ++ this.ok = false; ++ } ++ ++ public String toString() { ++ return String.format("FancyDial{%s, %dx%d @ %d,%d}", new Object[] {this.name, Integer.valueOf(this.width), Integer.valueOf(this.height), Integer.valueOf(this.x0), Integer.valueOf(this.y0)}); ++ } ++ ++ protected void finalize() throws Throwable { ++ this.finish(); ++ super.finalize(); ++ } ++ ++ private static double getAngle(Icon icon) { ++ return icon instanceof TextureCompass ? ((TextureCompass)icon).currentAngle * 180.0D / Math.PI : (icon instanceof TextureClock ? ((TextureClock)icon).field_94239_h * 360.0D : 0.0D); ++ } ++ ++ FancyDial$Layer newLayer(ResourceLocation resource, Properties properties, String suffix) { ++ String textureName = MCPatcherUtils.getStringProperty(properties, "source" + suffix, ""); ++ ++ if (textureName.isEmpty()) { ++ return null; ++ } else { ++ ResourceLocation textureResource = TexturePackAPI.parseResourceLocation(resource, textureName); ++ ++ if (textureResource == null) { ++ return null; ++ } else if (!TexturePackAPI.hasResource(textureResource)) { ++ logger.error("%s: could not read %s", new Object[] {resource, textureResource}); ++ return null; ++ } else { ++ float scaleX = MCPatcherUtils.getFloatProperty(properties, "scaleX" + suffix, 1.0F); ++ float scaleY = MCPatcherUtils.getFloatProperty(properties, "scaleY" + suffix, 1.0F); ++ float offsetX = MCPatcherUtils.getFloatProperty(properties, "offsetX" + suffix, 0.0F); ++ float offsetY = MCPatcherUtils.getFloatProperty(properties, "offsetY" + suffix, 0.0F); ++ float angleMultiplier = MCPatcherUtils.getFloatProperty(properties, "rotationSpeed" + suffix, 0.0F); ++ float angleOffset = MCPatcherUtils.getFloatProperty(properties, "rotationOffset" + suffix, 0.0F); ++ String blend = MCPatcherUtils.getStringProperty(properties, "blend" + suffix, "alpha"); ++ BlendMethod blendMethod = BlendMethod.parse(blend); ++ ++ if (blendMethod == null) { ++ logger.error("%s: unknown blend method %s", new Object[] {resource, blend}); ++ return null; ++ } else { ++ boolean debug = MCPatcherUtils.getBooleanProperty(properties, "debug" + suffix, false); ++ return new FancyDial$Layer(this, textureResource, scaleX, scaleY, offsetX, offsetY, angleMultiplier, angleOffset, blendMethod, debug); ++ } ++ } ++ } ++ } ++ ++ static { ++ logger.config("fbo: supported=%s", new Object[] {Boolean.valueOf(fboSupported)}); ++ logger.config("GL13: supported=%s, enabled=%s", new Object[] {Boolean.valueOf(gl13Supported), Boolean.valueOf(useGL13)}); ++ int bits = 527702; ++ ++ if (useGL13) { ++ bits |= 536870912; ++ } ++ ++ glAttributes = bits; ++ GL11.glNewList(drawList, GL11.GL_COMPILE); ++ drawBox(); ++ GL11.glEndList(); ++ } ++} diff --git a/patches/com/prupe/mcpatcher/hd/FontUtils$1.java.patch b/patches/com/prupe/mcpatcher/hd/FontUtils$1.java.patch new file mode 100644 index 0000000..572cda3 --- /dev/null +++ b/patches/com/prupe/mcpatcher/hd/FontUtils$1.java.patch @@ -0,0 +1,27 @@ +--- /dev/null ++++ com/prupe/mcpatcher/hd/FontUtils$1.java +@@ -1,0 +1,24 @@ ++package com.prupe.mcpatcher.hd; ++ ++import com.prupe.mcpatcher.TexturePackChangeHandler; ++import java.util.Iterator; ++import net.minecraft.src.FontRenderer; ++ ++final class FontUtils$1 extends TexturePackChangeHandler { ++ FontUtils$1(String x0, int x1) { ++ super(x0, x1); ++ } ++ ++ public void initialize() {} ++ ++ public void beforeChange() {} ++ ++ public void afterChange() { ++ Iterator i$ = FontUtils.access$000().iterator(); ++ ++ while (i$.hasNext()) { ++ FontRenderer renderer = (FontRenderer)i$.next(); ++ renderer.readFontTexture(); ++ } ++ } ++} diff --git a/patches/com/prupe/mcpatcher/hd/FontUtils.java.patch b/patches/com/prupe/mcpatcher/hd/FontUtils.java.patch new file mode 100644 index 0000000..0022641 --- /dev/null +++ b/patches/com/prupe/mcpatcher/hd/FontUtils.java.patch @@ -0,0 +1,293 @@ +--- /dev/null ++++ com/prupe/mcpatcher/hd/FontUtils.java +@@ -1,0 +1,290 @@ ++package com.prupe.mcpatcher.hd; ++ ++import com.prupe.mcpatcher.Config; ++import com.prupe.mcpatcher.MCLogger; ++import com.prupe.mcpatcher.TexturePackAPI; ++import com.prupe.mcpatcher.TexturePackChangeHandler; ++import com.prupe.mcpatcher.hd.FontUtils$1; ++import java.awt.image.BufferedImage; ++import java.util.HashSet; ++import java.util.Iterator; ++import java.util.Properties; ++import java.util.Set; ++import java.util.Map.Entry; ++import net.minecraft.src.FontRenderer; ++import net.minecraft.src.ResourceLocation; ++ ++public class FontUtils { ++ private static final MCLogger logger = MCLogger.getLogger("HD Font"); ++ private static final boolean enable = Config.getBoolean("Extended HD", "hdFont", true); ++ private static final boolean enableNonHD = Config.getBoolean("Extended HD", "nonHDFontWidth", false); ++ private static final int ROWS = 16; ++ private static final int COLS = 16; ++ public static final char[] AVERAGE_CHARS = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123467890".toCharArray(); ++ public static final int[] SPACERS = new int[] {33721342, 41975936, 234881023}; ++ private static final boolean showLines = false; ++ private static final Set allRenderers = new HashSet(); ++ ++ static void init() {} ++ ++ public static ResourceLocation getFontName(FontRenderer fontRenderer, ResourceLocation font) { ++ if (fontRenderer.defaultFont == null) { ++ fontRenderer.defaultFont = font; ++ } ++ ++ if (fontRenderer.hdFont == null) { ++ String newFont = fontRenderer.defaultFont.getResourceDomain(); ++ String name = fontRenderer.defaultFont.getResourcePath().replaceAll(".*/", ""); ++ fontRenderer.hdFont = new ResourceLocation(newFont, "mcpatcher/font/" + name); ++ } ++ ++ ResourceLocation newFont1; ++ ++ if (enable && TexturePackAPI.hasResource(fontRenderer.hdFont)) { ++ logger.fine("using %s instead of %s", new Object[] {fontRenderer.hdFont, fontRenderer.defaultFont}); ++ fontRenderer.isHD = true; ++ newFont1 = fontRenderer.hdFont; ++ } else { ++ logger.fine("using default %s", new Object[] {fontRenderer.defaultFont}); ++ fontRenderer.isHD = enable && enableNonHD; ++ newFont1 = fontRenderer.defaultFont; ++ } ++ ++ fontRenderer.fontAdj = fontRenderer.isHD ? 0.0F : 1.0F; ++ return newFont1; ++ } ++ ++ public static float[] computeCharWidthsf(FontRenderer fontRenderer, ResourceLocation filename, BufferedImage image, int[] rgb, int[] charWidth, float fontAdj) { ++ float[] charWidthf = new float[charWidth.length]; ++ int width; ++ ++ if (!fontRenderer.isHD) { ++ fontRenderer.fontAdj = fontAdj; ++ ++ for (width = 0; width < charWidth.length; ++width) { ++ charWidthf[width] = (float)charWidth[width]; ++ } ++ ++ charWidthf[32] = 4.0F; ++ return charWidthf; ++ } else { ++ allRenderers.add(fontRenderer); ++ width = image.getWidth(); ++ int height = image.getHeight(); ++ int colWidth = width / 16; ++ int rowHeight = height / 16; ++ int isOverride = 0; ++ int ch; ++ ++ while (isOverride < charWidth.length) { ++ ch = isOverride / 16; ++ int col = isOverride % 16; ++ int colIdx = colWidth - 1; ++ label84: ++ ++ while (true) { ++ if (colIdx >= 0) { ++ int x = col * colWidth + colIdx; ++ int rowIdx = 0; ++ ++ while (true) { ++ if (rowIdx >= rowHeight) { ++ --colIdx; ++ continue label84; ++ } ++ ++ int y = ch * rowHeight + rowIdx; ++ int pixel = rgb[x + y * width]; ++ ++ if (isOpaque(pixel)) { ++ if (printThis(isOverride)) { ++ logger.finer("\'%c\' pixel (%d, %d) = %08x, colIdx = %d", new Object[] {Character.valueOf((char)isOverride), Integer.valueOf(x), Integer.valueOf(y), Integer.valueOf(pixel), Integer.valueOf(colIdx)}); ++ } ++ ++ charWidthf[isOverride] = 128.0F * (float)(colIdx + 1) / (float)width + 1.0F; ++ break; ++ } ++ ++ ++rowIdx; ++ } ++ } ++ ++ ++isOverride; ++ break; ++ } ++ } ++ ++ for (isOverride = 0; isOverride < charWidthf.length; ++isOverride) { ++ if (charWidthf[isOverride] <= 0.0F) { ++ charWidthf[isOverride] = 2.0F; ++ } else if (charWidthf[isOverride] >= 7.99F) { ++ charWidthf[isOverride] = 7.99F; ++ } ++ } ++ ++ boolean[] var20 = new boolean[charWidth.length]; ++ ++ try { ++ getCharWidthOverrides(filename, charWidthf, var20); ++ } catch (Throwable var19) { ++ var19.printStackTrace(); ++ } ++ ++ if (!var20[32]) { ++ charWidthf[32] = defaultSpaceWidth(charWidthf); ++ } ++ ++ for (ch = 0; ch < charWidth.length; ++ch) { ++ charWidth[ch] = Math.round(charWidthf[ch]); ++ ++ if (printThis(ch)) { ++ logger.finer("charWidth[\'%c\'] = %f", new Object[] {Character.valueOf((char)ch), Float.valueOf(charWidthf[ch])}); ++ } ++ } ++ ++ return charWidthf; ++ } ++ } ++ ++ private static float getCharWidthf(FontRenderer fontRenderer, char ch) { ++ float width = (float)fontRenderer.getCharWidth(ch); ++ return width >= 0.0F && fontRenderer.charWidthf != null && ch < fontRenderer.charWidthf.length && ch >= 0 ? fontRenderer.charWidthf[ch] : width; ++ } ++ ++ public static float getCharWidthf(FontRenderer fontRenderer, int[] charWidth, int ch) { ++ return fontRenderer.isHD ? fontRenderer.charWidthf[ch] * (float)fontRenderer.FONT_HEIGHT / 8.0F : (float)charWidth[ch]; ++ } ++ ++ public static float getStringWidthf(FontRenderer fontRenderer, String s) { ++ float totalWidth = 0.0F; ++ ++ if (s != null) { ++ boolean isLink = false; ++ ++ for (int i = 0; i < s.length(); ++i) { ++ char c = s.charAt(i); ++ float cWidth = getCharWidthf(fontRenderer, c); ++ ++ if (cWidth < 0.0F && i < s.length() - 1) { ++ ++i; ++ c = s.charAt(i); ++ ++ if (c != 108 && c != 76) { ++ if (c == 114 || c == 82) { ++ isLink = false; ++ } ++ } else { ++ isLink = true; ++ } ++ ++ cWidth = 0.0F; ++ } ++ ++ totalWidth += cWidth; ++ ++ if (isLink) { ++ ++totalWidth; ++ } ++ } ++ } ++ ++ return totalWidth; ++ } ++ ++ public static ResourceLocation getUnicodePage(ResourceLocation resource) { ++ if (enable && resource != null) { ++ ResourceLocation newResource = new ResourceLocation(resource.getResourceDomain(), resource.getResourcePath().replaceFirst("^textures/", "mcpatcher/")); ++ ++ if (TexturePackAPI.hasResource(newResource)) { ++ logger.fine("using %s instead of %s", new Object[] {newResource, resource}); ++ return newResource; ++ } ++ } ++ ++ return resource; ++ } ++ ++ private static boolean isOpaque(int pixel) { ++ int[] arr$ = SPACERS; ++ int len$ = arr$.length; ++ ++ for (int i$ = 0; i$ < len$; ++i$) { ++ int i = arr$[i$]; ++ ++ if (pixel == i) { ++ return false; ++ } ++ } ++ ++ return (pixel >> 24 & 240) > 0; ++ } ++ ++ private static boolean printThis(int ch) { ++ return "ABCDEF abcdef".indexOf(ch) >= 0; ++ } ++ ++ private static float defaultSpaceWidth(float[] charWidthf) { ++ if (TexturePackAPI.isDefaultTexturePack()) { ++ return 4.0F; ++ } else { ++ float sum = 0.0F; ++ int n = 0; ++ char[] arr$ = AVERAGE_CHARS; ++ int len$ = arr$.length; ++ ++ for (int i$ = 0; i$ < len$; ++i$) { ++ char ch = arr$[i$]; ++ ++ if (charWidthf[ch] > 0.0F) { ++ sum += charWidthf[ch]; ++ ++n; ++ } ++ } ++ ++ if (n > 0) { ++ return sum / (float)n * 7.0F / 12.0F; ++ } else { ++ return 4.0F; ++ } ++ } ++ } ++ ++ private static void getCharWidthOverrides(ResourceLocation font, float[] charWidthf, boolean[] isOverride) { ++ ResourceLocation textFile = TexturePackAPI.transformResourceLocation(font, ".png", ".properties"); ++ Properties props = TexturePackAPI.getProperties(textFile); ++ ++ if (props != null) { ++ logger.fine("reading character widths from %s", new Object[] {textFile}); ++ Iterator i$ = props.entrySet().iterator(); ++ ++ while (i$.hasNext()) { ++ Entry entry = (Entry)i$.next(); ++ String key = entry.getKey().toString().trim(); ++ String value = entry.getValue().toString().trim(); ++ ++ if (key.matches("^width\\.\\d+$") && !value.equals("")) { ++ try { ++ int e = Integer.parseInt(key.substring(6)); ++ float width = Float.parseFloat(value); ++ ++ if (e >= 0 && e < charWidthf.length) { ++ logger.finer("setting charWidthf[%d] to %f", new Object[] {Integer.valueOf(e), Float.valueOf(width)}); ++ charWidthf[e] = width; ++ isOverride[e] = true; ++ } ++ } catch (NumberFormatException var11) { ++ ; ++ } ++ } ++ } ++ } ++ } ++ ++ static Set access$000() { ++ return allRenderers; ++ } ++ ++ static { ++ TexturePackChangeHandler.register(new FontUtils$1("HD Font", 1)); ++ } ++} diff --git a/patches/com/prupe/mcpatcher/hd/MipmapHelper.java.patch b/patches/com/prupe/mcpatcher/hd/MipmapHelper.java.patch new file mode 100644 index 0000000..dfe2adc --- /dev/null +++ b/patches/com/prupe/mcpatcher/hd/MipmapHelper.java.patch @@ -0,0 +1,491 @@ +--- /dev/null ++++ com/prupe/mcpatcher/hd/MipmapHelper.java +@@ -1,0 +1,488 @@ ++package com.prupe.mcpatcher.hd; ++ ++import com.prupe.mcpatcher.Config; ++import com.prupe.mcpatcher.MCLogger; ++import com.prupe.mcpatcher.TexturePackAPI; ++import java.awt.Graphics2D; ++import java.awt.image.BufferedImage; ++import java.awt.image.DataBuffer; ++import java.awt.image.DataBufferByte; ++import java.awt.image.DataBufferInt; ++import java.awt.image.ImageObserver; ++import java.lang.ref.Reference; ++import java.lang.ref.SoftReference; ++import java.math.BigInteger; ++import java.nio.ByteBuffer; ++import java.nio.ByteOrder; ++import java.nio.IntBuffer; ++import java.util.ArrayList; ++import java.util.Arrays; ++import java.util.HashMap; ++import java.util.Iterator; ++import java.util.Map; ++import java.util.Properties; ++import java.util.Map.Entry; ++import net.minecraft.src.ResourceLocation; ++import net.minecraft.src.TextureAtlasSprite; ++import org.lwjgl.opengl.GL11; ++import org.lwjgl.opengl.GL14; ++import org.lwjgl.opengl.GL12; ++import org.lwjgl.opengl.GLContext; ++import org.lwjgl.util.glu.GLU; ++ ++public class MipmapHelper { ++ private static final MCLogger logger = MCLogger.getLogger("Mipmap"); ++ private static final ResourceLocation MIPMAP_PROPERTIES = TexturePackAPI.newMCPatcherResourceLocation("mipmap.properties"); ++ private static final int TEX_FORMAT = 32993; ++ private static final int TEX_DATA_TYPE = 33639; ++ private static final int MIN_ALPHA = 26; ++ private static final int MAX_ALPHA = 229; ++ private static final boolean mipmapSupported = GLContext.getCapabilities().OpenGL12; ++ static final boolean mipmapEnabled = Config.getBoolean("Extended HD", "mipmap", false); ++ static final int maxMipmapLevel = Config.getInt("Extended HD", "maxMipmapLevel", 3); ++ private static final boolean useMipmap = mipmapSupported && mipmapEnabled && maxMipmapLevel > 0; ++ private static final int mipmapAlignment = (1 << Config.getInt("Extended HD", "mipmapAlignment", 3)) - 1; ++ private static final boolean anisoSupported = GLContext.getCapabilities().GL_EXT_texture_filter_anisotropic; ++ static final int anisoLevel; ++ private static final int anisoMax; ++ private static final boolean lodSupported; ++ private static final int lodBias; ++ private static final Map> imagePool = new HashMap(); ++ private static final Map> bufferPool = new HashMap(); ++ private static final Map mipmapType = new HashMap(); ++ ++ private static void setupTexture(int width, int height, boolean blur, boolean clamp, String textureName) { ++ int mipmaps = useMipmapsForTexture(textureName) ? getMipmapLevels(width, height, 1) : 0; ++ logger.finer("setupTexture(%s) %dx%d %d mipmaps", new Object[] {textureName, Integer.valueOf(width), Integer.valueOf(height), Integer.valueOf(mipmaps)}); ++ int magFilter = blur ? 9729 : 9728; ++ int minFilter = mipmaps > 0 ? 9986 : magFilter; ++ int wrap = clamp ? 10496 : 10497; ++ ++ if (mipmaps > 0) { ++ GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL12.GL_TEXTURE_MAX_LEVEL, mipmaps); ++ checkGLError("%s: set GL_TEXTURE_MAX_LEVEL = %d", new Object[] {textureName, Integer.valueOf(mipmaps)}); ++ ++ if (anisoSupported && anisoLevel > 1) { ++ GL11.glTexParameterf(GL11.GL_TEXTURE_2D, 34046, (float)anisoLevel); ++ checkGLError("%s: set GL_TEXTURE_MAX_ANISOTROPY_EXT = %f", new Object[] {textureName, Integer.valueOf(anisoLevel)}); ++ } ++ ++ if (lodSupported) { ++ GL11.glTexEnvi(GL14.GL_TEXTURE_FILTER_CONTROL, GL14.GL_TEXTURE_LOD_BIAS, lodBias); ++ checkGLError("%s: set GL_TEXTURE_LOD_BIAS_EXT = %d", new Object[] {textureName, Integer.valueOf(lodBias)}); ++ } ++ } ++ ++ GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MIN_FILTER, minFilter); ++ GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MAG_FILTER, magFilter); ++ GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_WRAP_S, wrap); ++ GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_WRAP_T, wrap); ++ ++ for (int level = 0; level <= mipmaps; ++level) { ++ GL11.glTexImage2D(GL11.GL_TEXTURE_2D, level, GL11.GL_RGBA, width, height, 0, GL12.GL_BGRA, GL12.GL_UNSIGNED_INT_8_8_8_8_REV, (IntBuffer)null); ++ checkGLError("%s: glTexImage2D %dx%d level %d", new Object[] {textureName, Integer.valueOf(width), Integer.valueOf(height), Integer.valueOf(level)}); ++ width >>= 1; ++ height >>= 1; ++ } ++ } ++ ++ public static void setupTexture(int[] rgb, int width, int height, int x, int y, boolean blur, boolean clamp, String textureName) { ++ setupTexture(width, height, blur, clamp, textureName); ++ copySubTexture(rgb, width, height, x, y, textureName); ++ } ++ ++ public static int setupTexture(int glTexture, BufferedImage image, boolean blur, boolean clamp, ResourceLocation textureName) { ++ int width = image.getWidth(); ++ int height = image.getHeight(); ++ GL11.glBindTexture(GL11.GL_TEXTURE_2D, glTexture); ++ logger.finer("setupTexture(%s, %d, %dx%d, %s, %s)", new Object[] {textureName, Integer.valueOf(glTexture), Integer.valueOf(width), Integer.valueOf(height), Boolean.valueOf(blur), Boolean.valueOf(clamp)}); ++ int[] rgb = new int[width * height]; ++ image.getRGB(0, 0, width, height, rgb, 0, width); ++ setupTexture(rgb, width, height, 0, 0, blur, clamp, textureName.getResourcePath()); ++ return glTexture; ++ } ++ ++ public static void setupTexture(int glTexture, int width, int height, String textureName) { ++ GL11.glBindTexture(GL11.GL_TEXTURE_2D, glTexture); ++ logger.finer("setupTexture(tilesheet %s, %d, %dx%d)", new Object[] {textureName, Integer.valueOf(glTexture), Integer.valueOf(width), Integer.valueOf(height)}); ++ setupTexture(width, height, false, false, textureName); ++ } ++ ++ public static void copySubTexture(int[] rgb, int width, int height, int x, int y, String textureName) { ++ if (rgb == null) { ++ logger.error("copySubTexture %s %d,%d %dx%d: rgb data is null", new Object[] {textureName, Integer.valueOf(x), Integer.valueOf(y), Integer.valueOf(width), Integer.valueOf(height)}); ++ } else { ++ IntBuffer buffer = getPooledBuffer(width * height * 4).asIntBuffer(); ++ buffer.put(rgb).position(0); ++ int mipmaps = getMipmapLevelsForCurrentTexture(); ++ logger.finest("copySubTexture %s %d,%d %dx%d %d mipmaps", new Object[] {textureName, Integer.valueOf(x), Integer.valueOf(y), Integer.valueOf(width), Integer.valueOf(height), Integer.valueOf(mipmaps)}); ++ ++ for (int level = 0; width > 0 && height > 0; height >>= 1) { ++ GL11.glTexSubImage2D(GL11.GL_TEXTURE_2D, level, x, y, width, height, GL12.GL_BGRA, GL12.GL_UNSIGNED_INT_8_8_8_8_REV, buffer); ++ checkGLError("%s: glTexSubImage2D(%d, %d, %d, %d, %d)", new Object[] {textureName, Integer.valueOf(level), Integer.valueOf(x), Integer.valueOf(y), Integer.valueOf(width), Integer.valueOf(height)}); ++ ++ if (level >= mipmaps) { ++ break; ++ } ++ ++ IntBuffer newBuffer = getPooledBuffer(width * height).asIntBuffer(); ++ scaleHalf(buffer, width, height, newBuffer, 0); ++ buffer = newBuffer; ++ ++level; ++ x >>= 1; ++ y >>= 1; ++ width >>= 1; ++ } ++ } ++ } ++ ++ public static void copySubTexture(TextureAtlasSprite texture, int index) { ++ int width = texture.getIconWidth(); ++ int height = texture.getIconHeight(); ++ int x; ++ int y; ++ ++ if (texture.mipmaps == null || texture.mipmaps.size() != texture.framesTextureData.size()) { ++ texture.mipmaps = new ArrayList(texture.framesTextureData.size()); ++ x = getMipmapLevelsForCurrentTexture(); ++ ++ if (x > 0) { ++ logger.fine("generating %d mipmaps for tile %s", new Object[] {Integer.valueOf(x), texture.getIconName()}); ++ } ++ ++ for (y = 0; y < texture.framesTextureData.size(); ++y) { ++ texture.mipmaps.add(generateMipmaps((int[])texture.framesTextureData.get(y), width, height, x)); ++ } ++ } ++ ++ x = texture.getOriginX(); ++ y = texture.getOriginY(); ++ IntBuffer[] mipmapData = (IntBuffer[])texture.mipmaps.get(index); ++ ++ if (mipmapData != null) { ++ for (int level = 0; level < mipmapData.length; ++level) { ++ GL11.glTexSubImage2D(GL11.GL_TEXTURE_2D, level, x, y, width, height, GL12.GL_BGRA, GL12.GL_UNSIGNED_INT_8_8_8_8_REV, mipmapData[level]); ++ x >>= 1; ++ y >>= 1; ++ width >>= 1; ++ height >>= 1; ++ } ++ } ++ } ++ ++ private static IntBuffer[] generateMipmaps(int[] rgb, int width, int height, int mipmaps) { ++ if (rgb == null) { ++ return null; ++ } else { ++ ArrayList mipmapData = new ArrayList(); ++ IntBuffer buffer = newIntBuffer(width * height * 4); ++ buffer.put(rgb).position(0); ++ int level = 0; ++ ++ while (true) { ++ mipmapData.add(buffer); ++ ++ if (width <= 0 || height <= 0 || level >= mipmaps) { ++ return (IntBuffer[])mipmapData.toArray(new IntBuffer[mipmapData.size()]); ++ } ++ ++ IntBuffer newBuffer = newIntBuffer(width * height); ++ scaleHalf(buffer, width, height, newBuffer, 0); ++ buffer = newBuffer; ++ ++level; ++ width >>= 1; ++ height >>= 1; ++ } ++ } ++ } ++ ++ static BufferedImage fixTransparency(ResourceLocation name, BufferedImage image) { ++ if (image == null) { ++ return image; ++ } else { ++ long s1 = System.currentTimeMillis(); ++ image = convertToARGB(image); ++ int width = image.getWidth(); ++ int height = image.getHeight(); ++ IntBuffer buffer = getImageAsARGBIntBuffer(image); ++ IntBuffer scaledBuffer = buffer; ++ label33: ++ ++ while (width % 2 == 0 && height % 2 == 0) { ++ int s2 = 0; ++ ++ while (true) { ++ if (s2 >= scaledBuffer.limit()) { ++ break label33; ++ } ++ ++ if (scaledBuffer.get(s2) >>> 24 == 0) { ++ IntBuffer newBuffer = getPooledBuffer(width * height).asIntBuffer(); ++ scaleHalf(scaledBuffer, width, height, newBuffer, 8); ++ scaledBuffer = newBuffer; ++ width >>= 1; ++ height >>= 1; ++ break; ++ } ++ ++ ++s2; ++ } ++ } ++ ++ long var12 = System.currentTimeMillis(); ++ ++ if (scaledBuffer != buffer) { ++ setBackgroundColor(buffer, image.getWidth(), image.getHeight(), scaledBuffer, image.getWidth() / width); ++ } ++ ++ long s3 = System.currentTimeMillis(); ++ logger.finer("bg fix (tile %s): scaling %dms, setbg %dms", new Object[] {name, Long.valueOf(var12 - s1), Long.valueOf(s3 - var12)}); ++ return image; ++ } ++ } ++ ++ static void reset() { ++ mipmapType.clear(); ++ mipmapType.put("terrain", Boolean.valueOf(true)); ++ mipmapType.put("items", Boolean.valueOf(false)); ++ Properties properties = TexturePackAPI.getProperties(MIPMAP_PROPERTIES); ++ ++ if (properties != null) { ++ Iterator i$ = properties.entrySet().iterator(); ++ ++ while (i$.hasNext()) { ++ Entry entry = (Entry)i$.next(); ++ ++ if (entry.getKey() instanceof String && entry.getValue() instanceof String) { ++ String key = ((String)entry.getKey()).trim(); ++ boolean value = Boolean.parseBoolean(((String)entry.getValue()).trim().toLowerCase()); ++ ++ if (key.endsWith(".png")) { ++ mipmapType.put(key, Boolean.valueOf(value)); ++ } ++ } ++ } ++ } ++ } ++ ++ static boolean useMipmapsForTexture(String texture) { ++ return useMipmap && texture != null ? (mipmapType.containsKey(texture) ? ((Boolean)mipmapType.get(texture)).booleanValue() : !texture.contains("item") && !texture.startsWith("textures/colormap/") && !texture.startsWith("textures/environment/") && !texture.startsWith("textures/font/") && !texture.startsWith("textures/gui/") && !texture.startsWith("textures/map/") && !texture.startsWith("textures/misc/") && !texture.startsWith("mcpatcher/colormap/") && !texture.startsWith("mcpatcher/cit/") && !texture.startsWith("mcpatcher/dial/") && !texture.startsWith("mcpatcher/font/") && !texture.startsWith("mcpatcher/lightmap/") && !texture.startsWith("mcpatcher/sky/")) : false; ++ } ++ ++ static int getMipmapLevelsForCurrentTexture() { ++ int filter = GL11.glGetTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MIN_FILTER); ++ return filter != 9986 && filter != 9984 ? 0 : Math.min(maxMipmapLevel, GL11.glGetTexParameteri(GL11.GL_TEXTURE_2D, GL12.GL_TEXTURE_MAX_LEVEL)); ++ } ++ ++ private static int gcd(int a, int b) { ++ return BigInteger.valueOf((long)a).gcd(BigInteger.valueOf((long)b)).intValue(); ++ } ++ ++ private static int getMipmapLevels(int width, int height, int minSize) { ++ int size = gcd(width, height); ++ int mipmap; ++ ++ for (mipmap = 0; size >= minSize && (size & 1) == 0 && mipmap < maxMipmapLevel; ++mipmap) { ++ size >>= 1; ++ } ++ ++ return mipmap; ++ } ++ ++ private static BufferedImage getPooledImage(int width, int height, int index) { ++ String key = String.format("%dx%d#%d", new Object[] {Integer.valueOf(width), Integer.valueOf(height), Integer.valueOf(index)}); ++ Reference ref = (Reference)imagePool.get(key); ++ BufferedImage image = ref == null ? null : (BufferedImage)ref.get(); ++ ++ if (image == null) { ++ image = new BufferedImage(width, height, 2); ++ imagePool.put(key, new SoftReference(image)); ++ } ++ ++ return image; ++ } ++ ++ private static IntBuffer newIntBuffer(int size) { ++ ByteBuffer buffer = ByteBuffer.allocateDirect(size); ++ buffer.order(ByteOrder.LITTLE_ENDIAN); ++ return buffer.asIntBuffer(); ++ } ++ ++ private static ByteBuffer getPooledBuffer(int size) { ++ Reference ref = (Reference)bufferPool.get(Integer.valueOf(size)); ++ ByteBuffer buffer = ref == null ? null : (ByteBuffer)ref.get(); ++ ++ if (buffer == null) { ++ buffer = ByteBuffer.allocateDirect(size); ++ bufferPool.put(Integer.valueOf(size), new SoftReference(buffer)); ++ } ++ ++ buffer.order(ByteOrder.LITTLE_ENDIAN); ++ buffer.position(0); ++ return buffer; ++ } ++ ++ private static BufferedImage convertToARGB(BufferedImage image) { ++ if (image == null) { ++ return null; ++ } else if (image.getType() == 2) { ++ return image; ++ } else { ++ int width = image.getWidth(); ++ int height = image.getHeight(); ++ logger.finest("converting %dx%d image to ARGB", new Object[] {Integer.valueOf(width), Integer.valueOf(height)}); ++ BufferedImage newImage = getPooledImage(width, height, 0); ++ Graphics2D graphics = newImage.createGraphics(); ++ Arrays.fill(getImageAsARGBIntBuffer(newImage).array(), 0); ++ graphics.drawImage(image, 0, 0, (ImageObserver)null); ++ return newImage; ++ } ++ } ++ ++ private static IntBuffer getImageAsARGBIntBuffer(BufferedImage image) { ++ DataBuffer buffer = image.getRaster().getDataBuffer(); ++ ++ if (buffer instanceof DataBufferInt) { ++ return IntBuffer.wrap(((DataBufferInt)buffer).getData()); ++ } else if (buffer instanceof DataBufferByte) { ++ return ByteBuffer.wrap(((DataBufferByte)buffer).getData()).order(ByteOrder.BIG_ENDIAN).asIntBuffer(); ++ } else { ++ int width = image.getWidth(); ++ int height = image.getHeight(); ++ int[] pixels = new int[width * height]; ++ image.getRGB(0, 0, width, height, pixels, 0, width); ++ return IntBuffer.wrap(pixels); ++ } ++ } ++ ++ private static void setBackgroundColor(IntBuffer buffer, int width, int height, IntBuffer scaledBuffer, int scale) { ++ for (int i = 0; i < width; ++i) { ++ for (int j = 0; j < height; ++j) { ++ int k = width * j + i; ++ int pixel = buffer.get(k); ++ ++ if ((pixel & -16777216) == 0) { ++ pixel = scaledBuffer.get(j / scale * (width / scale) + i / scale); ++ buffer.put(k, pixel & 16777215); ++ } ++ } ++ } ++ } ++ ++ static void scaleHalf(IntBuffer in, int w, int h, IntBuffer out, int rotate) { ++ for (int i = 0; i < w / 2; ++i) { ++ for (int j = 0; j < h / 2; ++j) { ++ int k = w * 2 * j + 2 * i; ++ int pixel00 = in.get(k); ++ int pixel01 = in.get(k + 1); ++ int pixel10 = in.get(k + w); ++ int pixel11 = in.get(k + w + 1); ++ ++ if (rotate != 0) { ++ pixel00 = Integer.rotateLeft(pixel00, rotate); ++ pixel01 = Integer.rotateLeft(pixel01, rotate); ++ pixel10 = Integer.rotateLeft(pixel10, rotate); ++ pixel11 = Integer.rotateLeft(pixel11, rotate); ++ } ++ ++ int pixel = average4RGBA(pixel00, pixel01, pixel10, pixel11); ++ ++ if (rotate != 0) { ++ pixel = Integer.rotateRight(pixel, rotate); ++ } ++ ++ out.put(w / 2 * j + i, pixel); ++ } ++ } ++ } ++ ++ private static int average4RGBA(int pixel00, int pixel01, int pixel10, int pixel11) { ++ int a00 = pixel00 & 255; ++ int a01 = pixel01 & 255; ++ int a10 = pixel10 & 255; ++ int a11 = pixel11 & 255; ++ ++ switch (a00 << 24 | a01 << 16 | a10 << 8 | a11) { ++ case -16777216: ++ return pixel00; ++ ++ case -16776961: ++ return average2RGBA(pixel00, pixel11); ++ ++ case -16711936: ++ return average2RGBA(pixel00, pixel10); ++ ++ case -65536: ++ return average2RGBA(pixel00, pixel01); ++ ++ case -1: ++ case 0: ++ return average2RGBA(average2RGBA(pixel00, pixel11), average2RGBA(pixel01, pixel10)); ++ ++ case 255: ++ return pixel11; ++ ++ case 65280: ++ return pixel10; ++ ++ case 65535: ++ return average2RGBA(pixel10, pixel11); ++ ++ case 16711680: ++ return pixel01; ++ ++ case 16711935: ++ return average2RGBA(pixel01, pixel11); ++ ++ case 16776960: ++ return average2RGBA(pixel01, pixel10); ++ ++ default: ++ int a = a00 + a01 + a10 + a11; ++ int pixel = a >> 2; ++ ++ for (int i = 8; i < 32; i += 8) { ++ int average = (a00 * (pixel00 >> i & 255) + a01 * (pixel01 >> i & 255) + a10 * (pixel10 >> i & 255) + a11 * (pixel11 >> i & 255)) / a; ++ pixel |= average << i; ++ } ++ ++ return pixel; ++ } ++ } ++ ++ private static int average2RGBA(int a, int b) { ++ return ((a & -16843010) >>> 1) + ((b & -16843010) >>> 1) | a & b & 16843009; ++ } ++ ++ private static void checkGLError(String format, Object ... params) { ++ int error = GL11.glGetError(); ++ ++ if (error != 0) { ++ String message = GLU.gluErrorString(error) + ": " + String.format(format, params); ++ (new RuntimeException(message)).printStackTrace(); ++ } ++ } ++ ++ static { ++ if (anisoSupported) { ++ anisoMax = (int)GL11.glGetFloat(34047); ++ checkGLError("glGetFloat(GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT)", new Object[0]); ++ anisoLevel = Math.max(Math.min(Config.getInt("Extended HD", "anisotropicFiltering", 1), anisoMax), 1); ++ } else { ++ anisoLevel = 1; ++ anisoMax = 1; ++ } ++ ++ lodSupported = GLContext.getCapabilities().GL_EXT_texture_lod_bias; ++ ++ if (lodSupported) { ++ lodBias = Config.getInt("Extended HD", "lodBias", 0); ++ } else { ++ lodBias = 0; ++ } ++ ++ logger.config("mipmap: supported=%s, enabled=%s, level=%d", new Object[] {Boolean.valueOf(mipmapSupported), Boolean.valueOf(mipmapEnabled), Integer.valueOf(maxMipmapLevel)}); ++ logger.config("anisotropic: supported=%s, level=%d, max=%d", new Object[] {Boolean.valueOf(anisoSupported), Integer.valueOf(anisoLevel), Integer.valueOf(anisoMax)}); ++ logger.config("lod bias: supported=%s, bias=%d", new Object[] {Boolean.valueOf(lodSupported), Integer.valueOf(lodBias)}); ++ } ++} diff --git a/patches/com/prupe/mcpatcher/mob/LineRenderer.java.patch b/patches/com/prupe/mcpatcher/mob/LineRenderer.java.patch new file mode 100644 index 0000000..3aa358e --- /dev/null +++ b/patches/com/prupe/mcpatcher/mob/LineRenderer.java.patch @@ -0,0 +1,177 @@ +--- /dev/null ++++ com/prupe/mcpatcher/mob/LineRenderer.java +@@ -1,0 +1,174 @@ ++package com.prupe.mcpatcher.mob; ++ ++import com.prupe.mcpatcher.Config; ++import com.prupe.mcpatcher.InputHandler; ++import com.prupe.mcpatcher.MCLogger; ++import com.prupe.mcpatcher.MCPatcherUtils; ++import com.prupe.mcpatcher.TexturePackAPI; ++import java.util.Properties; ++import net.minecraft.src.ResourceLocation; ++import net.minecraft.src.Tessellator; ++import org.lwjgl.opengl.GL11; ++ ++public class LineRenderer { ++ private static final MCLogger logger = MCLogger.getLogger("Random Mobs"); ++ private static final double D_WIDTH = 9.765625E-4D; ++ private static final double D_POS = 0.00390625D; ++ private static final boolean enable = Config.getBoolean("Random Mobs", "leashLine", true); ++ private static final LineRenderer[] renderers = new LineRenderer[2]; ++ private final ResourceLocation texture; ++ private final double width; ++ private final double a; ++ private final double b; ++ private final double sx; ++ private final double sy; ++ private final double sz; ++ private final int segments; ++ private final double tileFactor; ++ private final boolean active; ++ private final InputHandler keyboard; ++ private double plusWidth; ++ private double plusTile; ++ private double plusSX; ++ private double plusSY; ++ private double plusSZ; ++ ++ public static boolean renderLine(int type, double x, double y, double z, double dx, double dy, double dz) { ++ LineRenderer renderer = renderers[type]; ++ return renderer != null && renderer.render(x, y, z, dx, dy, dz); ++ } ++ ++ static void reset() { ++ if (enable) { ++ setup(0, "fishingline", 0.0075D, 0.0D, 0.25D, 16); ++ setup(1, "lead", 0.025D, 1.3333333333333333D, 0.125D, 24); ++ } ++ } ++ ++ private static void setup(int type, String name, double defaultWidth, double a, double b, int segments) { ++ LineRenderer renderer = new LineRenderer(name, defaultWidth, a, b, segments); ++ ++ if (renderer.active) { ++ logger.fine("using %s", new Object[] {renderer}); ++ renderers[type] = renderer; ++ } else { ++ logger.fine("%s not found", new Object[] {renderer}); ++ renderers[type] = null; ++ } ++ } ++ ++ private LineRenderer(String name, double width, double a, double b, int segments) { ++ this.texture = TexturePackAPI.newMCPatcherResourceLocation("line/" + name + ".png"); ++ this.active = TexturePackAPI.hasResource(this.texture); ++ Properties properties = TexturePackAPI.getProperties(TexturePackAPI.transformResourceLocation(this.texture, ".png", ".properties")); ++ this.width = MCPatcherUtils.getDoubleProperty(properties, "width", width); ++ this.a = MCPatcherUtils.getDoubleProperty(properties, "a", a); ++ this.b = MCPatcherUtils.getDoubleProperty(properties, "b", b); ++ this.sx = MCPatcherUtils.getDoubleProperty(properties, "sx", 0.0D); ++ this.sy = MCPatcherUtils.getDoubleProperty(properties, "sy", 0.0D); ++ this.sz = MCPatcherUtils.getDoubleProperty(properties, "sz", 0.0D); ++ this.segments = MCPatcherUtils.getIntProperty(properties, "segments", segments); ++ this.tileFactor = MCPatcherUtils.getDoubleProperty(properties, "tileFactor", 24.0D); ++ this.keyboard = new InputHandler(name, MCPatcherUtils.getBooleanProperty(properties, "debug", false)); ++ } ++ ++ private boolean render(double x, double y, double z, double dx, double dy, double dz) { ++ if (this.keyboard.isKeyDown(55)) { ++ return false; ++ } else { ++ boolean changed = false; ++ ++ if (this.keyboard.isEnabled()) { ++ if (this.keyboard.isKeyPressed(78)) { ++ changed = true; ++ this.plusWidth += 9.765625E-4D; ++ } else if (this.keyboard.isKeyPressed(74)) { ++ changed = true; ++ this.plusWidth -= 9.765625E-4D; ++ } else if (this.keyboard.isKeyPressed(181)) { ++ changed = true; ++ this.plusWidth = this.plusTile = this.plusSX = this.plusSY = this.plusSZ = 0.0D; ++ } else if (this.keyboard.isKeyPressed(81)) { ++ changed = true; ++ --this.plusTile; ++ } else if (this.keyboard.isKeyPressed(73)) { ++ changed = true; ++ ++this.plusTile; ++ } else if (this.keyboard.isKeyDown(75)) { ++ changed = true; ++ this.plusSX -= 0.00390625D; ++ } else if (this.keyboard.isKeyDown(77)) { ++ changed = true; ++ this.plusSX += 0.00390625D; ++ } else if (this.keyboard.isKeyDown(79)) { ++ changed = true; ++ this.plusSY -= 0.00390625D; ++ } else if (this.keyboard.isKeyDown(71)) { ++ changed = true; ++ this.plusSY += 0.00390625D; ++ } else if (this.keyboard.isKeyDown(80)) { ++ changed = true; ++ this.plusSZ += 0.00390625D; ++ } else if (this.keyboard.isKeyDown(72)) { ++ changed = true; ++ this.plusSZ -= 0.00390625D; ++ } ++ } ++ ++ TexturePackAPI.bindTexture(this.texture); ++ Tessellator tessellator = Tessellator.instance; ++ tessellator.startDrawingQuads(); ++ GL11.glDisable(GL11.GL_CULL_FACE); ++ GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); ++ dx += this.sx + this.plusSX; ++ dy += this.sy + this.plusSY; ++ dz += this.sz + this.plusSZ; ++ double x0 = x; ++ double y0 = y + this.a + this.b; ++ double z0 = z; ++ double u0 = 0.0D; ++ double len = Math.sqrt(dx * dx + dy * dy + dz * dz); ++ double t = this.tileFactor + this.plusTile; ++ double w = this.width + this.plusWidth; ++ ++ if (changed) { ++ logger.info("%s: dx=%f, dy=%f, dz=%f, len=%f(*%d=%f), slen=%f", new Object[] {this, Double.valueOf(dx), Double.valueOf(dy), Double.valueOf(dz), Double.valueOf(len), Integer.valueOf((int)t), Double.valueOf(len * t), Double.valueOf(len * t / (double)this.segments)}); ++ System.out.printf("width=%f\n", new Object[] {Double.valueOf(w)}); ++ System.out.printf("tileFactor=%f\n", new Object[] {Double.valueOf(t)}); ++ System.out.printf("sx=%f\n", new Object[] {Double.valueOf(this.sx + this.plusSX)}); ++ System.out.printf("sy=%f\n", new Object[] {Double.valueOf(this.sy + this.plusSY)}); ++ System.out.printf("sz=%f\n", new Object[] {Double.valueOf(this.sz + this.plusSZ)}); ++ } ++ ++ len *= t / (double)this.segments; ++ ++ for (int i = 1; i <= this.segments; ++i) { ++ double s = (double)i / (double)this.segments; ++ double x1 = x + s * dx; ++ double y1 = y + (s * s + s) * 0.5D * dy + this.a * (1.0D - s) + this.b; ++ double z1 = z + s * dz; ++ double u1 = (double)(this.segments - i) * len; ++ tessellator.addVertexWithUV(x0, y0, z0, u0, 1.0D); ++ tessellator.addVertexWithUV(x1, y1, z1, u1, 1.0D); ++ tessellator.addVertexWithUV(x1 + w, y1 + w, z1, u1, 0.0D); ++ tessellator.addVertexWithUV(x0 + w, y0 + w, z0, u0, 0.0D); ++ tessellator.addVertexWithUV(x0, y0 + w, z0, u0, 1.0D); ++ tessellator.addVertexWithUV(x1, y1 + w, z1, u1, 1.0D); ++ tessellator.addVertexWithUV(x1 + w, y1, z1 + w, u1, 0.0D); ++ tessellator.addVertexWithUV(x0 + w, y0, z0 + w, u0, 0.0D); ++ x0 = x1; ++ y0 = y1; ++ z0 = z1; ++ u0 = u1; ++ } ++ ++ tessellator.draw(); ++ GL11.glEnable(GL11.GL_CULL_FACE); ++ return true; ++ } ++ } ++ ++ public String toString() { ++ return "LineRenderer{" + this.texture + ", " + (this.width + this.plusWidth) + "}"; ++ } ++} diff --git a/patches/com/prupe/mcpatcher/mob/MobOverlay.java.patch b/patches/com/prupe/mcpatcher/mob/MobOverlay.java.patch new file mode 100644 index 0000000..d317e41 --- /dev/null +++ b/patches/com/prupe/mcpatcher/mob/MobOverlay.java.patch @@ -0,0 +1,135 @@ +--- /dev/null ++++ com/prupe/mcpatcher/mob/MobOverlay.java +@@ -1,0 +1,132 @@ ++package com.prupe.mcpatcher.mob; ++ ++import com.prupe.mcpatcher.TexturePackAPI; ++import net.minecraft.src.EntityLivingBase; ++import net.minecraft.src.ResourceLocation; ++import net.minecraft.src.Tessellator; ++ ++public class MobOverlay { ++ private static final ResourceLocation MOOSHROOM_OVERLAY = TexturePackAPI.newMCPatcherResourceLocation("mob/cow/mooshroom_overlay.png"); ++ private static final ResourceLocation SNOWMAN_OVERLAY = TexturePackAPI.newMCPatcherResourceLocation("mob/snowman_overlay.png"); ++ private static final double MOO_X0 = -0.45D; ++ private static final double MOO_X1 = 0.45D; ++ private static final double MOO_Y0 = -0.5D; ++ private static final double MOO_Y1 = 0.5D; ++ private static final double MOO_Z0 = -0.45D; ++ private static final double MOO_Z1 = 0.45D; ++ private static final double SNOW_X0 = -0.5D; ++ private static final double SNOW_X1 = 0.5D; ++ private static final double SNOW_Y0 = -0.5D; ++ private static final double SNOW_Y1 = 0.5D; ++ private static final double SNOW_Z0 = -0.5D; ++ private static final double SNOW_Z1 = 0.5D; ++ private static boolean overlayActive; ++ private static int overlayCounter; ++ private static boolean haveMooshroom; ++ private static boolean haveSnowman; ++ public static ResourceLocation snowmanOverlayTexture; ++ ++ static void reset() { ++ haveMooshroom = TexturePackAPI.hasResource(MOOSHROOM_OVERLAY); ++ haveSnowman = TexturePackAPI.hasResource(SNOWMAN_OVERLAY); ++ } ++ ++ public static ResourceLocation setupMooshroom(EntityLivingBase entity, ResourceLocation defaultTexture) { ++ overlayCounter = 0; ++ ++ if (haveMooshroom) { ++ overlayActive = true; ++ return MobRandomizer.randomTexture(entity, MOOSHROOM_OVERLAY); ++ } else { ++ overlayActive = false; ++ return defaultTexture; ++ } ++ } ++ ++ public static boolean renderMooshroomOverlay() { ++ if (overlayActive && overlayCounter < 3) { ++ float tileX0 = (float)overlayCounter / 3.0F; ++ float tileX1 = (float)(++overlayCounter) / 3.0F; ++ Tessellator tessellator = Tessellator.instance; ++ tessellator.startDrawingQuads(); ++ tessellator.addVertexWithUV(-0.45D, 0.5D, -0.45D, (double)tileX0, 0.0D); ++ tessellator.addVertexWithUV(-0.45D, -0.5D, -0.45D, (double)tileX0, 1.0D); ++ tessellator.addVertexWithUV(0.45D, -0.5D, 0.45D, (double)tileX1, 1.0D); ++ tessellator.addVertexWithUV(0.45D, 0.5D, 0.45D, (double)tileX1, 0.0D); ++ tessellator.addVertexWithUV(0.45D, 0.5D, 0.45D, (double)tileX0, 0.0D); ++ tessellator.addVertexWithUV(0.45D, -0.5D, 0.45D, (double)tileX0, 1.0D); ++ tessellator.addVertexWithUV(-0.45D, -0.5D, -0.45D, (double)tileX1, 1.0D); ++ tessellator.addVertexWithUV(-0.45D, 0.5D, -0.45D, (double)tileX1, 0.0D); ++ tessellator.addVertexWithUV(-0.45D, 0.5D, 0.45D, (double)tileX0, 0.0D); ++ tessellator.addVertexWithUV(-0.45D, -0.5D, 0.45D, (double)tileX0, 1.0D); ++ tessellator.addVertexWithUV(0.45D, -0.5D, -0.45D, (double)tileX1, 1.0D); ++ tessellator.addVertexWithUV(0.45D, 0.5D, -0.45D, (double)tileX1, 0.0D); ++ tessellator.addVertexWithUV(0.45D, 0.5D, -0.45D, (double)tileX0, 0.0D); ++ tessellator.addVertexWithUV(0.45D, -0.5D, -0.45D, (double)tileX0, 1.0D); ++ tessellator.addVertexWithUV(-0.45D, -0.5D, 0.45D, (double)tileX1, 1.0D); ++ tessellator.addVertexWithUV(-0.45D, 0.5D, 0.45D, (double)tileX1, 0.0D); ++ tessellator.draw(); ++ } ++ ++ return overlayActive; ++ } ++ ++ public static void finishMooshroom() { ++ overlayCounter = 0; ++ overlayActive = false; ++ } ++ ++ public static boolean setupSnowman(EntityLivingBase entity) { ++ if (haveSnowman) { ++ snowmanOverlayTexture = MobRandomizer.randomTexture(entity, SNOWMAN_OVERLAY); ++ return true; ++ } else { ++ snowmanOverlayTexture = null; ++ return false; ++ } ++ } ++ ++ public static void renderSnowmanOverlay() { ++ Tessellator tessellator = Tessellator.instance; ++ tessellator.startDrawingQuads(); ++ double[] c = new double[4]; ++ getTileCoordinates(0, c); ++ tessellator.addVertexWithUV(0.5D, -0.5D, -0.5D, c[0], c[2]); ++ tessellator.addVertexWithUV(0.5D, -0.5D, 0.5D, c[1], c[2]); ++ tessellator.addVertexWithUV(-0.5D, -0.5D, 0.5D, c[1], c[3]); ++ tessellator.addVertexWithUV(-0.5D, -0.5D, -0.5D, c[0], c[3]); ++ getTileCoordinates(1, c); ++ tessellator.addVertexWithUV(-0.5D, 0.5D, -0.5D, c[0], c[2]); ++ tessellator.addVertexWithUV(-0.5D, 0.5D, 0.5D, c[1], c[2]); ++ tessellator.addVertexWithUV(0.5D, 0.5D, 0.5D, c[1], c[3]); ++ tessellator.addVertexWithUV(0.5D, 0.5D, -0.5D, c[0], c[3]); ++ getTileCoordinates(2, c); ++ tessellator.addVertexWithUV(-0.5D, 0.5D, 0.5D, c[0], c[2]); ++ tessellator.addVertexWithUV(-0.5D, 0.5D, -0.5D, c[1], c[2]); ++ tessellator.addVertexWithUV(-0.5D, -0.5D, -0.5D, c[1], c[3]); ++ tessellator.addVertexWithUV(-0.5D, -0.5D, 0.5D, c[0], c[3]); ++ getTileCoordinates(3, c); ++ tessellator.addVertexWithUV(-0.5D, 0.5D, -0.5D, c[0], c[2]); ++ tessellator.addVertexWithUV(0.5D, 0.5D, -0.5D, c[1], c[2]); ++ tessellator.addVertexWithUV(0.5D, -0.5D, -0.5D, c[1], c[3]); ++ tessellator.addVertexWithUV(-0.5D, -0.5D, -0.5D, c[0], c[3]); ++ getTileCoordinates(4, c); ++ tessellator.addVertexWithUV(0.5D, 0.5D, -0.5D, c[0], c[2]); ++ tessellator.addVertexWithUV(0.5D, 0.5D, 0.5D, c[1], c[2]); ++ tessellator.addVertexWithUV(0.5D, -0.5D, 0.5D, c[1], c[3]); ++ tessellator.addVertexWithUV(0.5D, -0.5D, -0.5D, c[0], c[3]); ++ getTileCoordinates(5, c); ++ tessellator.addVertexWithUV(0.5D, 0.5D, 0.5D, c[0], c[2]); ++ tessellator.addVertexWithUV(-0.5D, 0.5D, 0.5D, c[1], c[2]); ++ tessellator.addVertexWithUV(-0.5D, -0.5D, 0.5D, c[1], c[3]); ++ tessellator.addVertexWithUV(0.5D, -0.5D, 0.5D, c[0], c[3]); ++ tessellator.draw(); ++ } ++ ++ private static void getTileCoordinates(int tileNum, double[] c) { ++ c[0] = (double)(tileNum % 3) / 3.0D; ++ c[1] = c[0] + 0.3333333333333333D; ++ c[2] = (double)(tileNum / 3) / 2.0D; ++ c[3] = c[2] + 0.5D; ++ } ++} diff --git a/patches/com/prupe/mcpatcher/mob/MobRandomizer$1.java.patch b/patches/com/prupe/mcpatcher/mob/MobRandomizer$1.java.patch new file mode 100644 index 0000000..74fb815 --- /dev/null +++ b/patches/com/prupe/mcpatcher/mob/MobRandomizer$1.java.patch @@ -0,0 +1,22 @@ +--- /dev/null ++++ com/prupe/mcpatcher/mob/MobRandomizer$1.java +@@ -1,0 +1,19 @@ ++package com.prupe.mcpatcher.mob; ++ ++import com.prupe.mcpatcher.TexturePackChangeHandler; ++ ++final class MobRandomizer$1 extends TexturePackChangeHandler { ++ MobRandomizer$1(String x0, int x1) { ++ super(x0, x1); ++ } ++ ++ public void beforeChange() { ++ MobRandomizer.access$000().clear(); ++ } ++ ++ public void afterChange() { ++ MobRuleList.clear(); ++ MobOverlay.reset(); ++ LineRenderer.reset(); ++ } ++} diff --git a/patches/com/prupe/mcpatcher/mob/MobRandomizer$ExtraInfo.java.patch b/patches/com/prupe/mcpatcher/mob/MobRandomizer$ExtraInfo.java.patch new file mode 100644 index 0000000..efe7772 --- /dev/null +++ b/patches/com/prupe/mcpatcher/mob/MobRandomizer$ExtraInfo.java.patch @@ -0,0 +1,189 @@ +--- /dev/null ++++ com/prupe/mcpatcher/mob/MobRandomizer$ExtraInfo.java +@@ -1,0 +1,186 @@ ++package com.prupe.mcpatcher.mob; ++ ++import java.lang.ref.Reference; ++import java.lang.ref.ReferenceQueue; ++import java.lang.ref.WeakReference; ++import java.util.HashMap; ++import java.util.HashSet; ++import java.util.Iterator; ++import net.minecraft.src.EntityLivingBase; ++import net.minecraft.src.NBTTagCompound; ++ ++public final class MobRandomizer$ExtraInfo { ++ private static final String SKIN_TAG = "randomMobsSkin"; ++ private static final String ORIG_X_TAG = "origX"; ++ private static final String ORIG_Y_TAG = "origY"; ++ private static final String ORIG_Z_TAG = "origZ"; ++ private static final long MULTIPLIER = 25214903917L; ++ private static final long ADDEND = 11L; ++ private static final long MASK = 281474976710655L; ++ private static final HashMap allInfo = new HashMap(); ++ private static final HashMap, MobRandomizer$ExtraInfo> allRefs = new HashMap(); ++ private static final ReferenceQueue refQueue = new ReferenceQueue(); ++ private final int entityId; ++ private final HashSet> references; ++ private final long skin; ++ private final int origX; ++ private final int origY; ++ private final int origZ; ++ private Integer origBiome; ++ ++ MobRandomizer$ExtraInfo(EntityLivingBase entity) { ++ this(entity, getSkinId(entity.entityId), (int)entity.posX, (int)entity.posY, (int)entity.posZ); ++ } ++ ++ MobRandomizer$ExtraInfo(EntityLivingBase entity, long skin, int origX, int origY, int origZ) { ++ this.entityId = entity.entityId; ++ this.references = new HashSet(); ++ this.skin = skin; ++ this.origX = origX; ++ this.origY = origY; ++ this.origZ = origZ; ++ } ++ ++ private void setBiome() { ++ if (this.origBiome == null && MobRuleList.getBiomeIDAt != null) { ++ try { ++ this.origBiome = (Integer)MobRuleList.getBiomeIDAt.invoke((Object)null, new Object[] {Integer.valueOf(this.origX), Integer.valueOf(this.origY), Integer.valueOf(this.origZ)}); ++ } catch (Throwable var2) { ++ MobRuleList.getBiomeIDAt = null; ++ var2.printStackTrace(); ++ } ++ } ++ } ++ ++ public String toString() { ++ return String.format("%s{%d, %d, %d, %d, %d, %s}", new Object[] {this.getClass().getSimpleName(), Integer.valueOf(this.entityId), Long.valueOf(this.skin), Integer.valueOf(this.origX), Integer.valueOf(this.origY), Integer.valueOf(this.origZ), this.origBiome}); ++ } ++ ++ private static void clearUnusedReferences() { ++ HashMap var0 = allInfo; ++ ++ synchronized (allInfo) { ++ Reference ref; ++ ++ for (; (ref = refQueue.poll()) != null; allRefs.remove(ref)) { ++ MobRandomizer$ExtraInfo info = (MobRandomizer$ExtraInfo)allRefs.get(ref); ++ ++ if (info != null) { ++ info.references.remove(ref); ++ ++ if (info.references.isEmpty()) { ++ MobRandomizer.access$600().finest("removing unused ref %d", new Object[] {Integer.valueOf(info.entityId)}); ++ allInfo.remove(Integer.valueOf(info.entityId)); ++ } ++ } ++ } ++ } ++ } ++ ++ static MobRandomizer$ExtraInfo getInfo(EntityLivingBase entity) { ++ HashMap var2 = allInfo; ++ ++ synchronized (allInfo) { ++ clearUnusedReferences(); ++ MobRandomizer$ExtraInfo info = (MobRandomizer$ExtraInfo)allInfo.get(Integer.valueOf(entity.entityId)); ++ ++ if (info == null) { ++ info = new MobRandomizer$ExtraInfo(entity); ++ putInfo(entity, info); ++ } ++ ++ boolean found = false; ++ Iterator reference = info.references.iterator(); ++ ++ while (reference.hasNext()) { ++ WeakReference ref = (WeakReference)reference.next(); ++ ++ if (ref.get() == entity) { ++ found = true; ++ break; ++ } ++ } ++ ++ if (!found) { ++ WeakReference reference1 = new WeakReference(entity, refQueue); ++ info.references.add(reference1); ++ allRefs.put(reference1, info); ++ MobRandomizer.access$600().finest("added ref #%d for %d (%d entities)", new Object[] {Integer.valueOf(info.references.size()), Integer.valueOf(entity.entityId), Integer.valueOf(allInfo.size())}); ++ } ++ ++ info.setBiome(); ++ return info; ++ } ++ } ++ ++ static void putInfo(EntityLivingBase entity, MobRandomizer$ExtraInfo info) { ++ HashMap var2 = allInfo; ++ ++ synchronized (allInfo) { ++ allInfo.put(Integer.valueOf(entity.entityId), info); ++ } ++ } ++ ++ static void clearInfo() { ++ HashMap var0 = allInfo; ++ ++ synchronized (allInfo) { ++ allInfo.clear(); ++ } ++ } ++ ++ private static long getSkinId(int entityId) { ++ long n = (long)entityId; ++ n = n ^ n << 16 ^ n << 32 ^ n << 48; ++ n = 25214903917L * n + 11L; ++ n = 25214903917L * n + 11L; ++ n &= 281474976710655L; ++ return n >> 32 ^ n; ++ } ++ ++ public static void readFromNBT(EntityLivingBase entity, NBTTagCompound nbt) { ++ long skin = nbt.getLong("randomMobsSkin"); ++ ++ if (skin != 0L) { ++ int x = nbt.getInteger("origX"); ++ int y = nbt.getInteger("origY"); ++ int z = nbt.getInteger("origZ"); ++ putInfo(entity, new MobRandomizer$ExtraInfo(entity, skin, x, y, z)); ++ } ++ } ++ ++ public static void writeToNBT(EntityLivingBase entity, NBTTagCompound nbt) { ++ HashMap var2 = allInfo; ++ ++ synchronized (allInfo) { ++ MobRandomizer$ExtraInfo info = (MobRandomizer$ExtraInfo)allInfo.get(Integer.valueOf(entity.entityId)); ++ ++ if (info != null) { ++ nbt.setLong("randomMobsSkin", info.skin); ++ nbt.setInteger("origX", info.origX); ++ nbt.setInteger("origY", info.origY); ++ nbt.setInteger("origZ", info.origZ); ++ } ++ } ++ } ++ ++ static long access$100(MobRandomizer$ExtraInfo x0) { ++ return x0.skin; ++ } ++ ++ static int access$200(MobRandomizer$ExtraInfo x0) { ++ return x0.origX; ++ } ++ ++ static int access$300(MobRandomizer$ExtraInfo x0) { ++ return x0.origY; ++ } ++ ++ static int access$400(MobRandomizer$ExtraInfo x0) { ++ return x0.origZ; ++ } ++ ++ static Integer access$500(MobRandomizer$ExtraInfo x0) { ++ return x0.origBiome; ++ } ++} diff --git a/patches/com/prupe/mcpatcher/mob/MobRandomizer.java.patch b/patches/com/prupe/mcpatcher/mob/MobRandomizer.java.patch new file mode 100644 index 0000000..961d3ff --- /dev/null +++ b/patches/com/prupe/mcpatcher/mob/MobRandomizer.java.patch @@ -0,0 +1,61 @@ +--- /dev/null ++++ com/prupe/mcpatcher/mob/MobRandomizer.java +@@ -1,0 +1,58 @@ ++package com.prupe.mcpatcher.mob; ++ ++import com.prupe.mcpatcher.MCLogger; ++import com.prupe.mcpatcher.TexturePackChangeHandler; ++import com.prupe.mcpatcher.mob.MobRandomizer$1; ++import com.prupe.mcpatcher.mob.MobRandomizer$ExtraInfo; ++import java.util.LinkedHashMap; ++import net.minecraft.src.Entity; ++import net.minecraft.src.EntityLivingBase; ++import net.minecraft.src.ResourceLocation; ++ ++public class MobRandomizer { ++ private static final MCLogger logger = MCLogger.getLogger("Random Mobs"); ++ private static final LinkedHashMap cache = new LinkedHashMap(); ++ ++ static void init() {} ++ ++ public static ResourceLocation randomTexture(EntityLivingBase entity, ResourceLocation texture) { ++ if (texture != null && texture.getResourcePath().endsWith(".png")) { ++ String key = texture.toString() + ":" + entity.entityId; ++ ResourceLocation newTexture = (ResourceLocation)cache.get(key); ++ ++ if (newTexture == null) { ++ MobRandomizer$ExtraInfo info = MobRandomizer$ExtraInfo.getInfo(entity); ++ MobRuleList list = MobRuleList.get(texture); ++ newTexture = list.getSkin(MobRandomizer$ExtraInfo.access$100(info), MobRandomizer$ExtraInfo.access$200(info), MobRandomizer$ExtraInfo.access$300(info), MobRandomizer$ExtraInfo.access$400(info), MobRandomizer$ExtraInfo.access$500(info)); ++ cache.put(key, newTexture); ++ logger.finer("entity %s using %s (cache: %d)", new Object[] {entity, newTexture, Integer.valueOf(cache.size())}); ++ ++ if (cache.size() > 250) { ++ while (cache.size() > 200) { ++ cache.remove(cache.keySet().iterator().next()); ++ } ++ } ++ } ++ ++ return newTexture; ++ } else { ++ return texture; ++ } ++ } ++ ++ public static ResourceLocation randomTexture(Entity entity, ResourceLocation texture) { ++ return entity instanceof EntityLivingBase ? randomTexture((EntityLivingBase)entity, texture) : texture; ++ } ++ ++ static LinkedHashMap access$000() { ++ return cache; ++ } ++ ++ static MCLogger access$600() { ++ return logger; ++ } ++ ++ static { ++ TexturePackChangeHandler.register(new MobRandomizer$1("Random Mobs", 2)); ++ } ++} diff --git a/patches/com/prupe/mcpatcher/mob/MobRuleList$MobRuleEntry.java.patch b/patches/com/prupe/mcpatcher/mob/MobRuleList$MobRuleEntry.java.patch new file mode 100644 index 0000000..3f9f2fb --- /dev/null +++ b/patches/com/prupe/mcpatcher/mob/MobRuleList$MobRuleEntry.java.patch @@ -0,0 +1,115 @@ +--- /dev/null ++++ com/prupe/mcpatcher/mob/MobRuleList$MobRuleEntry.java +@@ -1,0 +1,112 @@ ++package com.prupe.mcpatcher.mob; ++ ++import com.prupe.mcpatcher.MCPatcherUtils; ++import com.prupe.mcpatcher.WeightedIndex; ++import java.lang.reflect.Method; ++import java.util.BitSet; ++import java.util.Properties; ++ ++class MobRuleList$MobRuleEntry { ++ final int[] skins; ++ final WeightedIndex weightedIndex; ++ private final BitSet biomes; ++ private final int minHeight; ++ private final int maxHeight; ++ ++ static MobRuleList$MobRuleEntry load(Properties properties, int index, int limit) { ++ String skinList = properties.getProperty("skins." + index, "").trim().toLowerCase(); ++ int[] skins; ++ int chooser; ++ ++ if (!skinList.equals("*") && !skinList.equals("all") && !skinList.equals("any")) { ++ skins = MCPatcherUtils.parseIntegerList(skinList, 1, limit); ++ ++ if (skins.length <= 0) { ++ return null; ++ } ++ ++ for (chooser = 0; chooser < skins.length; ++chooser) { ++ --skins[chooser]; ++ } ++ } else { ++ skins = new int[limit]; ++ ++ for (chooser = 0; chooser < skins.length; skins[chooser] = chooser++) { ++ ; ++ } ++ } ++ ++ WeightedIndex var11 = WeightedIndex.create(skins.length, properties.getProperty("weights." + index, "")); ++ ++ if (var11 == null) { ++ return null; ++ } else { ++ String biomeList = MCPatcherUtils.getStringProperty(properties, "biomes." + index, ""); ++ BitSet biomes; ++ ++ if (biomeList.isEmpty()) { ++ biomes = null; ++ } else { ++ biomes = new BitSet(); ++ ++ if (MobRuleList.access$000() != null) { ++ try { ++ MobRuleList.access$000().invoke((Object)null, new Object[] {biomeList, biomes}); ++ } catch (Throwable var10) { ++ var10.printStackTrace(); ++ MobRuleList.access$002((Method)null); ++ } ++ } ++ } ++ ++ int minHeight = MCPatcherUtils.getIntProperty(properties, "minHeight." + index, -1); ++ int maxHeight = MCPatcherUtils.getIntProperty(properties, "maxHeight." + index, Integer.MAX_VALUE); ++ ++ if (minHeight < 0 || minHeight > maxHeight) { ++ minHeight = -1; ++ maxHeight = Integer.MAX_VALUE; ++ } ++ ++ return new MobRuleList$MobRuleEntry(skins, var11, biomes, minHeight, maxHeight); ++ } ++ } ++ ++ MobRuleList$MobRuleEntry(int[] skins, WeightedIndex weightedIndex, BitSet biomes, int minHeight, int maxHeight) { ++ this.skins = skins; ++ this.weightedIndex = weightedIndex; ++ this.biomes = biomes; ++ this.minHeight = minHeight; ++ this.maxHeight = maxHeight; ++ } ++ ++ boolean match(int i, int j, int k, Integer biome) { ++ return this.biomes != null && (biome == null || !this.biomes.get(biome.intValue())) ? false : this.minHeight < 0 || j >= this.minHeight && j <= this.maxHeight; ++ } ++ ++ public String toString() { ++ StringBuilder sb = new StringBuilder(); ++ sb.append("skins:"); ++ int[] i = this.skins; ++ int len$ = i.length; ++ ++ for (int i$ = 0; i$ < len$; ++i$) { ++ int i1 = i[i$]; ++ sb.append(' ').append(i1 + 1); ++ } ++ ++ if (this.biomes != null) { ++ sb.append(", biomes:"); ++ ++ for (int var6 = this.biomes.nextSetBit(0); var6 >= 0; var6 = this.biomes.nextSetBit(var6 + 1)) { ++ sb.append(' ').append(var6); ++ } ++ } ++ ++ if (this.minHeight >= 0) { ++ sb.append(", height: ").append(this.minHeight).append('-').append(this.maxHeight); ++ } ++ ++ sb.append(", weights: ").append(this.weightedIndex.toString()); ++ return sb.toString(); ++ } ++} diff --git a/patches/com/prupe/mcpatcher/mob/MobRuleList.java.patch b/patches/com/prupe/mcpatcher/mob/MobRuleList.java.patch new file mode 100644 index 0000000..7b40dfb --- /dev/null +++ b/patches/com/prupe/mcpatcher/mob/MobRuleList.java.patch @@ -0,0 +1,156 @@ +--- /dev/null ++++ com/prupe/mcpatcher/mob/MobRuleList.java +@@ -1,0 +1,153 @@ ++package com.prupe.mcpatcher.mob; ++ ++import com.prupe.mcpatcher.MCLogger; ++import com.prupe.mcpatcher.TexturePackAPI; ++import com.prupe.mcpatcher.mob.MobRuleList$MobRuleEntry; ++import java.lang.reflect.Method; ++import java.util.ArrayList; ++import java.util.BitSet; ++import java.util.HashMap; ++import java.util.Iterator; ++import java.util.List; ++import java.util.Map; ++import java.util.Properties; ++import net.minecraft.src.ResourceLocation; ++ ++class MobRuleList { ++ private static final MCLogger logger = MCLogger.getLogger("Random Mobs"); ++ public static final String ALTERNATIVES_REGEX = "_(eyes|overlay|tame|angry|collar|fur|invulnerable|shooting)\\.properties$"; ++ private static final Map allRules = new HashMap(); ++ private final ResourceLocation baseSkin; ++ private final List allSkins; ++ private final int skinCount; ++ private final List entries; ++ private static Method parseBiomeList; ++ static Method getBiomeIDAt; ++ ++ private MobRuleList(ResourceLocation baseSkin) { ++ this.baseSkin = baseSkin; ++ String newPath = baseSkin.getResourcePath().replaceFirst("^textures/entity/", "mcpatcher/mob/"); ++ ResourceLocation newSkin = new ResourceLocation(baseSkin.getResourceDomain(), newPath); ++ this.allSkins = new ArrayList(); ++ this.allSkins.add(baseSkin); ++ int filename = 2; ++ ++ while (true) { ++ ResourceLocation altFilename = TexturePackAPI.transformResourceLocation(newSkin, ".png", filename + ".png"); ++ ++ if (!TexturePackAPI.hasResource(altFilename)) { ++ this.skinCount = this.allSkins.size(); ++ ++ if (this.skinCount <= 1) { ++ this.entries = null; ++ return; ++ } else { ++ logger.fine("found %d variations for %s", new Object[] {Integer.valueOf(this.skinCount), baseSkin}); ++ ResourceLocation var10 = TexturePackAPI.transformResourceLocation(newSkin, ".png", ".properties"); ++ altFilename = new ResourceLocation(newSkin.getResourceDomain(), var10.getResourcePath().replaceFirst("_(eyes|overlay|tame|angry|collar|fur|invulnerable|shooting)\\.properties$", ".properties")); ++ Properties properties = TexturePackAPI.getProperties(var10); ++ ++ if (properties == null && !var10.equals(altFilename)) { ++ properties = TexturePackAPI.getProperties(altFilename); ++ ++ if (properties != null) { ++ logger.fine("using %s for %s", new Object[] {altFilename, baseSkin}); ++ } ++ } ++ ++ ArrayList tmpEntries = new ArrayList(); ++ ++ if (properties != null) { ++ int i = 0; ++ ++ while (true) { ++ MobRuleList$MobRuleEntry entry = MobRuleList$MobRuleEntry.load(properties, i, this.skinCount); ++ ++ if (entry == null) { ++ if (i > 0) { ++ break; ++ } ++ } else { ++ logger.fine(" %s", new Object[] {entry.toString()}); ++ tmpEntries.add(entry); ++ } ++ ++ ++i; ++ } ++ } ++ ++ this.entries = tmpEntries.isEmpty() ? null : tmpEntries; ++ return; ++ } ++ } ++ ++ this.allSkins.add(altFilename); ++ ++filename; ++ } ++ } ++ ++ ResourceLocation getSkin(long key, int i, int j, int k, Integer biome) { ++ if (this.entries == null) { ++ int i$1 = (int)(key % (long)this.skinCount); ++ ++ if (i$1 < 0) { ++ i$1 += this.skinCount; ++ } ++ ++ return (ResourceLocation)this.allSkins.get(i$1); ++ } else { ++ Iterator i$ = this.entries.iterator(); ++ MobRuleList$MobRuleEntry entry; ++ ++ do { ++ if (!i$.hasNext()) { ++ return this.baseSkin; ++ } ++ ++ entry = (MobRuleList$MobRuleEntry)i$.next(); ++ } while (!entry.match(i, j, k, biome)); ++ ++ int index = entry.weightedIndex.choose(key); ++ return (ResourceLocation)this.allSkins.get(entry.skins[index]); ++ } ++ } ++ ++ static MobRuleList get(ResourceLocation texture) { ++ MobRuleList list = (MobRuleList)allRules.get(texture); ++ ++ if (list == null) { ++ list = new MobRuleList(texture); ++ allRules.put(texture, list); ++ } ++ ++ return list; ++ } ++ ++ static void clear() { ++ allRules.clear(); ++ } ++ ++ static Method access$000() { ++ return parseBiomeList; ++ } ++ ++ static Method access$002(Method x0) { ++ parseBiomeList = x0; ++ return x0; ++ } ++ ++ static { ++ try { ++ Class e = Class.forName("com.prupe.mcpatcher.cc.BiomeHelper"); ++ parseBiomeList = e.getDeclaredMethod("parseBiomeList", new Class[] {String.class, BitSet.class}); ++ getBiomeIDAt = e.getDeclaredMethod("getBiomeIDAt", new Class[] {Integer.TYPE, Integer.TYPE, Integer.TYPE}); ++ parseBiomeList.setAccessible(true); ++ getBiomeIDAt.setAccessible(true); ++ logger.fine("biome integration active", new Object[0]); ++ } catch (Throwable var1) { ++ parseBiomeList = null; ++ getBiomeIDAt = null; ++ logger.warning("biome integration failed", new Object[0]); ++ } ++ } ++} diff --git a/patches/com/prupe/mcpatcher/sky/FireworksHelper.java.patch b/patches/com/prupe/mcpatcher/sky/FireworksHelper.java.patch new file mode 100644 index 0000000..6cb7f4d --- /dev/null +++ b/patches/com/prupe/mcpatcher/sky/FireworksHelper.java.patch @@ -0,0 +1,59 @@ +--- /dev/null ++++ com/prupe/mcpatcher/sky/FireworksHelper.java +@@ -1,0 +1,56 @@ ++package com.prupe.mcpatcher.sky; ++ ++import com.prupe.mcpatcher.BlendMethod; ++import com.prupe.mcpatcher.Config; ++import com.prupe.mcpatcher.MCLogger; ++import com.prupe.mcpatcher.MCPatcherUtils; ++import com.prupe.mcpatcher.TexturePackAPI; ++import java.util.Properties; ++import net.minecraft.src.EntityFX; ++import net.minecraft.src.EntityFireworkOverlayFX; ++import net.minecraft.src.EntityFireworkSparkFX; ++import net.minecraft.src.ResourceLocation; ++import org.lwjgl.opengl.GL11; ++ ++//Spout Start ++import org.spoutcraft.client.config.Configuration; ++//Spout End ++ ++public class FireworksHelper { ++ private static final int LIT_LAYER = 3; ++ private static final int EXTRA_LAYER = 4; ++ private static final ResourceLocation PARTICLE_PROPERTIES = TexturePackAPI.newMCPatcherResourceLocation("particle.properties"); ++ private static final MCLogger logger = MCLogger.getLogger("Better Skies"); ++ private static final boolean enable = Config.getBoolean("Better Skies", "brightenFireworks", true); ++ private static BlendMethod blendMethod; ++ ++ public static int getFXLayer(EntityFX entity) { ++ return enable && (entity instanceof EntityFireworkSparkFX || entity instanceof EntityFireworkOverlayFX) ? 4 : entity.getFXLayer(); ++ } ++ ++ public static boolean skipThisLayer(boolean skip, int layer) { ++ return skip || layer == 3 || !enable && layer > 3; ++ } ++ ++ public static void setParticleBlendMethod(int layer) { ++ if (Configuration.isFancyClouds() && layer == 4 && blendMethod != null) { ++ blendMethod.applyBlending(); ++ } else { ++ GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); ++ } ++ } ++ ++ static void reload() { ++ Properties properties = TexturePackAPI.getProperties(PARTICLE_PROPERTIES); ++ String blend = MCPatcherUtils.getStringProperty(properties, "blend.4", "add"); ++ blendMethod = BlendMethod.parse(blend); ++ ++ if (blendMethod == null) { ++ logger.error("%s: unknown blend method %s", new Object[] {PARTICLE_PROPERTIES, blend}); ++ } else if (enable) { ++ logger.config("using %s blending for fireworks particles", new Object[] {blendMethod}); ++ } else { ++ logger.config("using default blending for fireworks particles", new Object[0]); ++ } ++ } ++} diff --git a/patches/com/prupe/mcpatcher/sky/SkyRenderer$1.java.patch b/patches/com/prupe/mcpatcher/sky/SkyRenderer$1.java.patch new file mode 100644 index 0000000..7137309 --- /dev/null +++ b/patches/com/prupe/mcpatcher/sky/SkyRenderer$1.java.patch @@ -0,0 +1,30 @@ +--- /dev/null ++++ com/prupe/mcpatcher/sky/SkyRenderer$1.java +@@ -1,0 +1,27 @@ ++package com.prupe.mcpatcher.sky; ++ ++import com.prupe.mcpatcher.TexturePackChangeHandler; ++import net.minecraft.src.Minecraft; ++import net.minecraft.src.WorldClient; ++ ++final class SkyRenderer$1 extends TexturePackChangeHandler { ++ SkyRenderer$1(String x0, int x1) { ++ super(x0, x1); ++ } ++ ++ public void beforeChange() { ++ SkyRenderer.access$000().clear(); ++ } ++ ++ public void afterChange() { ++ if (SkyRenderer.access$100()) { ++ WorldClient world = Minecraft.getMinecraft().theWorld; ++ ++ if (world != null) { ++ SkyRenderer.access$200(world.provider.dimensionId); ++ } ++ } ++ ++ FireworksHelper.reload(); ++ } ++} diff --git a/patches/com/prupe/mcpatcher/sky/SkyRenderer$Layer.java.patch b/patches/com/prupe/mcpatcher/sky/SkyRenderer$Layer.java.patch new file mode 100644 index 0000000..7b4a9ba --- /dev/null +++ b/patches/com/prupe/mcpatcher/sky/SkyRenderer$Layer.java.patch @@ -0,0 +1,267 @@ +--- /dev/null ++++ com/prupe/mcpatcher/sky/SkyRenderer$Layer.java +@@ -1,0 +1,264 @@ ++package com.prupe.mcpatcher.sky; ++ ++import com.prupe.mcpatcher.BlendMethod; ++import com.prupe.mcpatcher.MCPatcherUtils; ++import com.prupe.mcpatcher.TexturePackAPI; ++import java.util.Properties; ++import net.minecraft.src.ResourceLocation; ++import net.minecraft.src.Tessellator; ++import org.lwjgl.opengl.GL11; ++ ++class SkyRenderer$Layer { ++ private static final int SECS_PER_DAY = 86400; ++ private static final int TICKS_PER_DAY = 24000; ++ private static final double TOD_OFFSET = -0.25D; ++ private static final double SKY_DISTANCE = 100.0D; ++ private final ResourceLocation propertiesName; ++ private final Properties properties; ++ private ResourceLocation texture; ++ private boolean fade; ++ private boolean rotate; ++ private float[] axis; ++ private float speed; ++ private BlendMethod blendMethod; ++ private double a; ++ private double b; ++ private double c; ++ boolean valid; ++ float brightness; ++ ++ static SkyRenderer$Layer create(ResourceLocation resource) { ++ Properties properties = TexturePackAPI.getProperties(resource); ++ return properties == null ? null : new SkyRenderer$Layer(resource, properties); ++ } ++ ++ SkyRenderer$Layer(ResourceLocation propertiesName, Properties properties) { ++ this.propertiesName = propertiesName; ++ this.properties = properties; ++ this.valid = true; ++ this.valid = this.readTexture() && this.readRotation() & this.readBlendingMethod() && this.readFadeTimers(); ++ } ++ ++ private boolean readTexture() { ++ this.texture = TexturePackAPI.parseResourceLocation(this.propertiesName, this.properties.getProperty("source", this.propertiesName.getResourcePath().replaceFirst("\\.properties$", ".png"))); ++ return TexturePackAPI.hasResource(this.texture) ? true : this.addError("source texture %s not found", new Object[] {this.texture}); ++ } ++ ++ private boolean readRotation() { ++ this.rotate = MCPatcherUtils.getBooleanProperty(this.properties, "rotate", true); ++ ++ if (this.rotate) { ++ try { ++ this.speed = Float.parseFloat(this.properties.getProperty("speed", "1.0")); ++ } catch (NumberFormatException var8) { ++ return this.addError("invalid rotation speed", new Object[0]); ++ } ++ ++ String value = this.properties.getProperty("axis", "0.0 0.0 1.0").trim().toLowerCase(); ++ String[] tokens = value.split("\\s+"); ++ ++ if (tokens.length != 3) { ++ return this.addError("invalid rotate value %s", new Object[] {value}); ++ } ++ ++ float x; ++ float y; ++ float z; ++ ++ try { ++ x = Float.parseFloat(tokens[0]); ++ y = Float.parseFloat(tokens[1]); ++ z = Float.parseFloat(tokens[2]); ++ } catch (NumberFormatException var7) { ++ return this.addError("invalid rotation axis", new Object[0]); ++ } ++ ++ if (x * x + y * y + z * z == 0.0F) { ++ return this.addError("rotation axis cannot be 0", new Object[0]); ++ } ++ ++ this.axis = new float[] {z, y, -x}; ++ } ++ ++ return true; ++ } ++ ++ private boolean readBlendingMethod() { ++ String value = this.properties.getProperty("blend", "add"); ++ this.blendMethod = BlendMethod.parse(value); ++ return this.blendMethod == null ? this.addError("unknown blend method %s", new Object[] {value}): true; ++ } ++ ++ private boolean readFadeTimers() { ++ this.fade = Boolean.parseBoolean(this.properties.getProperty("fade", "true")); ++ ++ if (!this.fade) { ++ return true; ++ } else { ++ int startFadeIn = this.parseTime(this.properties, "startFadeIn"); ++ int endFadeIn = this.parseTime(this.properties, "endFadeIn"); ++ int endFadeOut = this.parseTime(this.properties, "endFadeOut"); ++ ++ if (!this.valid) { ++ return false; ++ } else { ++ while (endFadeIn <= startFadeIn) { ++ endFadeIn += 86400; ++ } ++ ++ while (endFadeOut <= endFadeIn) { ++ endFadeOut += 86400; ++ } ++ ++ if (endFadeOut - startFadeIn >= 86400) { ++ return this.addError("fade times must fall within a 24 hour period", new Object[0]); ++ } else { ++ int startFadeOut = startFadeIn + endFadeOut - endFadeIn; ++ double s0 = normalize((double)startFadeIn, 86400, -0.25D); ++ double s1 = normalize((double)endFadeIn, 86400, -0.25D); ++ double e0 = normalize((double)startFadeOut, 86400, -0.25D); ++ double e1 = normalize((double)endFadeOut, 86400, -0.25D); ++ double det = Math.cos(s0) * Math.sin(s1) + Math.cos(e1) * Math.sin(s0) + Math.cos(s1) * Math.sin(e1) - Math.cos(s0) * Math.sin(e1) - Math.cos(s1) * Math.sin(s0) - Math.cos(e1) * Math.sin(s1); ++ ++ if (det == 0.0D) { ++ return this.addError("determinant is 0", new Object[0]); ++ } else { ++ this.a = (Math.sin(e1) - Math.sin(s0)) / det; ++ this.b = (Math.cos(s0) - Math.cos(e1)) / det; ++ this.c = (Math.cos(e1) * Math.sin(s0) - Math.cos(s0) * Math.sin(e1)) / det; ++ SkyRenderer.access$400().finer("%s: y = %f cos x + %f sin x + %f", new Object[] {this.propertiesName, Double.valueOf(this.a), Double.valueOf(this.b), Double.valueOf(this.c)}); ++ SkyRenderer.access$400().finer(" at %f: %f", new Object[] {Double.valueOf(s0), Double.valueOf(this.f(s0))}); ++ SkyRenderer.access$400().finer(" at %f: %f", new Object[] {Double.valueOf(s1), Double.valueOf(this.f(s1))}); ++ SkyRenderer.access$400().finer(" at %f: %f", new Object[] {Double.valueOf(e0), Double.valueOf(this.f(e0))}); ++ SkyRenderer.access$400().finer(" at %f: %f", new Object[] {Double.valueOf(e1), Double.valueOf(this.f(e1))}); ++ return true; ++ } ++ } ++ } ++ } ++ } ++ ++ private boolean addError(String format, Object ... params) { ++ SkyRenderer.access$400().error("" + this.propertiesName + ": " + format, params); ++ this.valid = false; ++ return false; ++ } ++ ++ private int parseTime(Properties properties, String key) { ++ String s = properties.getProperty(key, "").trim(); ++ ++ if ("".equals(s)) { ++ this.addError("missing value for %s", new Object[] {key}); ++ return -1; ++ } else { ++ String[] t = s.split(":"); ++ ++ if (t.length >= 2) { ++ try { ++ int e = Integer.parseInt(t[0].trim()); ++ int mm = Integer.parseInt(t[1].trim()); ++ int ss; ++ ++ if (t.length >= 3) { ++ ss = Integer.parseInt(t[2].trim()); ++ } else { ++ ss = 0; ++ } ++ ++ return (3600 * e + 60 * mm + ss) % 86400; ++ } catch (NumberFormatException var8) { ++ ; ++ } ++ } ++ ++ this.addError("invalid %s time %s", new Object[] {key, s}); ++ return -1; ++ } ++ } ++ ++ private static double normalize(double time, int period, double offset) { ++ return (Math.PI * 2D) * (time / (double)period + offset); ++ } ++ ++ private double f(double x) { ++ return this.a * Math.cos(x) + this.b * Math.sin(x) + this.c; ++ } ++ ++ boolean prepare() { ++ this.brightness = SkyRenderer.access$500(); ++ ++ if (this.fade) { ++ double x = normalize(SkyRenderer.access$600(), 24000, 0.0D); ++ this.brightness *= (float)this.f(x); ++ } ++ ++ if (this.brightness <= 0.0F) { ++ return false; ++ } else { ++ if (this.brightness > 1.0F) { ++ this.brightness = 1.0F; ++ } ++ ++ return true; ++ } ++ } ++ ++ boolean render(Tessellator tessellator) { ++ TexturePackAPI.bindTexture(this.texture); ++ this.setBlendingMethod(this.brightness); ++ GL11.glPushMatrix(); ++ ++ if (this.rotate) { ++ GL11.glRotatef(SkyRenderer.access$700() * 360.0F * this.speed, this.axis[0], this.axis[1], this.axis[2]); ++ } ++ ++ GL11.glRotatef(90.0F, 1.0F, 0.0F, 0.0F); ++ GL11.glRotatef(-90.0F, 0.0F, 0.0F, 1.0F); ++ drawTile(tessellator, 4); ++ GL11.glPushMatrix(); ++ GL11.glRotatef(90.0F, 1.0F, 0.0F, 0.0F); ++ drawTile(tessellator, 1); ++ GL11.glPopMatrix(); ++ GL11.glPushMatrix(); ++ GL11.glRotatef(-90.0F, 1.0F, 0.0F, 0.0F); ++ drawTile(tessellator, 0); ++ GL11.glPopMatrix(); ++ GL11.glRotatef(90.0F, 0.0F, 0.0F, 1.0F); ++ drawTile(tessellator, 5); ++ GL11.glRotatef(90.0F, 0.0F, 0.0F, 1.0F); ++ drawTile(tessellator, 2); ++ GL11.glRotatef(90.0F, 0.0F, 0.0F, 1.0F); ++ drawTile(tessellator, 3); ++ GL11.glPopMatrix(); ++ return true; ++ } ++ ++ private static void drawTile(Tessellator tessellator, int tile) { ++ double tileX = (double)(tile % 3) / 3.0D; ++ double tileY = (double)(tile / 3) / 2.0D; ++ tessellator.startDrawingQuads(); ++ tessellator.addVertexWithUV(-100.0D, -100.0D, -100.0D, tileX, tileY); ++ tessellator.addVertexWithUV(-100.0D, -100.0D, 100.0D, tileX, tileY + 0.5D); ++ tessellator.addVertexWithUV(100.0D, -100.0D, 100.0D, tileX + 0.3333333333333333D, tileY + 0.5D); ++ tessellator.addVertexWithUV(100.0D, -100.0D, -100.0D, tileX + 0.3333333333333333D, tileY); ++ tessellator.draw(); ++ } ++ ++ void setBlendingMethod(float brightness) { ++ this.blendMethod.applyFade(brightness); ++ this.blendMethod.applyAlphaTest(); ++ this.blendMethod.applyBlending(); ++ GL11.glEnable(GL11.GL_TEXTURE_2D); ++ } ++ ++ static void clearBlendingMethod() { ++ GL11.glDisable(GL11.GL_ALPHA_TEST); ++ GL11.glEnable(GL11.GL_BLEND); ++ GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE); ++ GL11.glColor4f(1.0F, 1.0F, 1.0F, SkyRenderer.access$500()); ++ } ++ ++ static ResourceLocation access$300(SkyRenderer$Layer x0) { ++ return x0.texture; ++ } ++} diff --git a/patches/com/prupe/mcpatcher/sky/SkyRenderer$WorldEntry.java.patch b/patches/com/prupe/mcpatcher/sky/SkyRenderer$WorldEntry.java.patch new file mode 100644 index 0000000..ae6fb38 --- /dev/null +++ b/patches/com/prupe/mcpatcher/sky/SkyRenderer$WorldEntry.java.patch @@ -0,0 +1,121 @@ +--- /dev/null ++++ com/prupe/mcpatcher/sky/SkyRenderer$WorldEntry.java +@@ -1,0 +1,118 @@ ++package com.prupe.mcpatcher.sky; ++ ++import com.prupe.mcpatcher.TexturePackAPI; ++import com.prupe.mcpatcher.sky.SkyRenderer$Layer; ++import java.util.ArrayList; ++import java.util.HashMap; ++import java.util.HashSet; ++import java.util.Iterator; ++import java.util.List; ++import java.util.Map; ++import java.util.Properties; ++import java.util.Set; ++import net.minecraft.src.ResourceLocation; ++import net.minecraft.src.Tessellator; ++ ++class SkyRenderer$WorldEntry { ++ private final int worldType; ++ private final List skies = new ArrayList(); ++ private final Map objects = new HashMap(); ++ private final Set textures = new HashSet(); ++ ++ SkyRenderer$WorldEntry(int worldType) { ++ this.worldType = worldType; ++ this.loadSkies(); ++ this.loadCelestialObject("sun"); ++ this.loadCelestialObject("moon_phases"); ++ } ++ ++ private void loadSkies() { ++ int i = -1; ++ ++ while (true) { ++ String path = "sky/world" + this.worldType + "/sky" + (i < 0 ? "" : String.valueOf(i)) + ".properties"; ++ ResourceLocation resource = TexturePackAPI.newMCPatcherResourceLocation(path); ++ SkyRenderer$Layer layer = SkyRenderer$Layer.create(resource); ++ ++ if (layer == null) { ++ if (i > 0) { ++ return; ++ } ++ } else if (layer.valid) { ++ SkyRenderer.access$400().fine("loaded %s", new Object[] {resource}); ++ this.skies.add(layer); ++ this.textures.add(SkyRenderer$Layer.access$300(layer)); ++ } ++ ++ ++i; ++ } ++ } ++ ++ private void loadCelestialObject(String objName) { ++ ResourceLocation textureName = new ResourceLocation("textures/environment/" + objName + ".png"); ++ ResourceLocation resource = TexturePackAPI.newMCPatcherResourceLocation("sky/world0/" + objName + ".properties"); ++ Properties properties = TexturePackAPI.getProperties(resource); ++ ++ if (properties != null) { ++ properties.setProperty("fade", "false"); ++ properties.setProperty("rotate", "true"); ++ SkyRenderer$Layer layer = new SkyRenderer$Layer(resource, properties); ++ ++ if (layer.valid) { ++ SkyRenderer.access$400().fine("using %s (%s) for the %s", new Object[] {resource, SkyRenderer$Layer.access$300(layer), objName}); ++ this.objects.put(textureName, layer); ++ } ++ } ++ } ++ ++ boolean active() { ++ return !this.skies.isEmpty() || !this.objects.isEmpty(); ++ } ++ ++ void renderAll(Tessellator tessellator) { ++ HashSet texturesNeeded = new HashSet(); ++ Iterator texturesToUnload = this.skies.iterator(); ++ ++ while (texturesToUnload.hasNext()) { ++ SkyRenderer$Layer i$ = (SkyRenderer$Layer)texturesToUnload.next(); ++ ++ if (i$.prepare()) { ++ texturesNeeded.add(SkyRenderer$Layer.access$300(i$)); ++ } ++ } ++ ++ HashSet texturesToUnload1 = new HashSet(); ++ texturesToUnload1.addAll(this.textures); ++ texturesToUnload1.removeAll(texturesNeeded); ++ Iterator i$1 = texturesToUnload1.iterator(); ++ ++ while (i$1.hasNext()) { ++ ResourceLocation layer = (ResourceLocation)i$1.next(); ++ TexturePackAPI.unloadTexture(layer); ++ } ++ ++ i$1 = this.skies.iterator(); ++ ++ while (i$1.hasNext()) { ++ SkyRenderer$Layer layer1 = (SkyRenderer$Layer)i$1.next(); ++ ++ if (layer1.brightness > 0.0F) { ++ layer1.render(tessellator); ++ SkyRenderer$Layer.clearBlendingMethod(); ++ } ++ } ++ } ++ ++ SkyRenderer$Layer getCelestialObject(ResourceLocation defaultTexture) { ++ return (SkyRenderer$Layer)this.objects.get(defaultTexture); ++ } ++ ++ void unloadTextures() { ++ Iterator i$ = this.skies.iterator(); ++ ++ while (i$.hasNext()) { ++ SkyRenderer$Layer layer = (SkyRenderer$Layer)i$.next(); ++ TexturePackAPI.unloadTexture(SkyRenderer$Layer.access$300(layer)); ++ } ++ } ++} diff --git a/patches/com/prupe/mcpatcher/sky/SkyRenderer.java.patch b/patches/com/prupe/mcpatcher/sky/SkyRenderer.java.patch new file mode 100644 index 0000000..df47500 --- /dev/null +++ b/patches/com/prupe/mcpatcher/sky/SkyRenderer.java.patch @@ -0,0 +1,113 @@ +--- /dev/null ++++ com/prupe/mcpatcher/sky/SkyRenderer.java +@@ -1,0 +1,110 @@ ++package com.prupe.mcpatcher.sky; ++ ++import com.prupe.mcpatcher.Config; ++import com.prupe.mcpatcher.MCLogger; ++import com.prupe.mcpatcher.TexturePackAPI; ++import com.prupe.mcpatcher.TexturePackChangeHandler; ++import com.prupe.mcpatcher.sky.SkyRenderer$1; ++import com.prupe.mcpatcher.sky.SkyRenderer$Layer; ++import com.prupe.mcpatcher.sky.SkyRenderer$WorldEntry; ++import java.util.HashMap; ++import net.minecraft.src.Minecraft; ++import net.minecraft.src.ResourceLocation; ++import net.minecraft.src.Tessellator; ++import net.minecraft.src.World; ++ ++public class SkyRenderer { ++ private static final MCLogger logger = MCLogger.getLogger("Better Skies"); ++ private static final boolean enable = Config.getBoolean("Better Skies", "skybox", true); ++ private static double worldTime; ++ private static float celestialAngle; ++ private static float rainStrength; ++ private static final HashMap worldSkies = new HashMap(); ++ private static SkyRenderer$WorldEntry currentWorld; ++ public static boolean active; ++ ++ public static void setup(World world, float partialTick, float celestialAngle) { ++ if (TexturePackAPI.isDefaultTexturePack()) { ++ active = false; ++ } else { ++ int worldType = Minecraft.getMinecraft().theWorld.provider.dimensionId; ++ SkyRenderer$WorldEntry newEntry = getWorldEntry(worldType); ++ ++ if (newEntry != currentWorld && currentWorld != null) { ++ currentWorld.unloadTextures(); ++ } ++ ++ currentWorld = newEntry; ++ active = currentWorld.active(); ++ ++ if (active) { ++ worldTime = (double)((float)world.getWorldTime() + partialTick); ++ rainStrength = 1.0F - world.getRainStrength(partialTick); ++ celestialAngle = celestialAngle; ++ } ++ } ++ } ++ ++ public static void renderAll() { ++ if (active) { ++ currentWorld.renderAll(Tessellator.instance); ++ } ++ } ++ ++ public static ResourceLocation setupCelestialObject(ResourceLocation defaultTexture) { ++ if (active) { ++ SkyRenderer$Layer.clearBlendingMethod(); ++ SkyRenderer$Layer layer = currentWorld.getCelestialObject(defaultTexture); ++ ++ if (layer != null) { ++ layer.setBlendingMethod(rainStrength); ++ return SkyRenderer$Layer.access$300(layer); ++ } ++ } ++ ++ return defaultTexture; ++ } ++ ++ private static SkyRenderer$WorldEntry getWorldEntry(int worldType) { ++ SkyRenderer$WorldEntry entry = (SkyRenderer$WorldEntry)worldSkies.get(Integer.valueOf(worldType)); ++ ++ if (entry == null) { ++ entry = new SkyRenderer$WorldEntry(worldType); ++ worldSkies.put(Integer.valueOf(worldType), entry); ++ } ++ ++ return entry; ++ } ++ ++ static HashMap access$000() { ++ return worldSkies; ++ } ++ ++ static boolean access$100() { ++ return enable; ++ } ++ ++ static SkyRenderer$WorldEntry access$200(int x0) { ++ return getWorldEntry(x0); ++ } ++ ++ static MCLogger access$400() { ++ return logger; ++ } ++ ++ static float access$500() { ++ return rainStrength; ++ } ++ ++ static double access$600() { ++ return worldTime; ++ } ++ ++ static float access$700() { ++ return celestialAngle; ++ } ++ ++ static { ++ TexturePackChangeHandler.register(new SkyRenderer$1("Better Skies", 2)); ++ } ++} diff --git a/patches/net/minecraft/client/ClientBrandRetriever.java.patch b/patches/net/minecraft/client/ClientBrandRetriever.java.patch new file mode 100644 index 0000000..97d1b8f --- /dev/null +++ b/patches/net/minecraft/client/ClientBrandRetriever.java.patch @@ -0,0 +1,10 @@ +--- net/minecraft/client/ClientBrandRetriever.java ++++ net/minecraft/client/ClientBrandRetriever.java +@@ -2,6 +2,6 @@ + + public class ClientBrandRetriever { + public static String getClientModName() { +- return "vanilla"; ++ return "spoutcraft"; + } + } diff --git a/patches/net/minecraft/client/main/Main.java.patch b/patches/net/minecraft/client/main/Main.java.patch new file mode 100644 index 0000000..0b04bbb --- /dev/null +++ b/patches/net/minecraft/client/main/Main.java.patch @@ -0,0 +1,109 @@ +--- net/minecraft/client/main/Main.java ++++ net/minecraft/client/main/Main.java +@@ -6,18 +6,22 @@ + import java.net.Proxy; + import java.net.Proxy.Type; + import java.util.List; ++ + import joptsimple.ArgumentAcceptingOptionSpec; + import joptsimple.NonOptionArgumentSpec; + import joptsimple.OptionParser; + import joptsimple.OptionSet; +-import joptsimple.OptionSpec; ++import net.minecraft.src.GameWindowListener; + import net.minecraft.src.MainProxyAuthenticator; + import net.minecraft.src.MainShutdownHook; + import net.minecraft.src.Minecraft; + import net.minecraft.src.Session; + ++import org.spoutcraft.client.SpoutClient; ++import org.spoutcraft.client.io.DownloadAssets; ++ + public class Main { +- public static void main(String[] var0) { ++ public static void main(String[] par0ArrayOfStr) { + System.setProperty("java.net.preferIPv4Stack", "true"); + OptionParser var1 = new OptionParser(); + var1.allowsUnrecognizedOptions(); +@@ -33,53 +37,59 @@ + ArgumentAcceptingOptionSpec var9 = var1.accepts("proxyUser").withRequiredArg(); + ArgumentAcceptingOptionSpec var10 = var1.accepts("proxyPass").withRequiredArg(); + ArgumentAcceptingOptionSpec var11 = var1.accepts("username").withRequiredArg().defaultsTo("Player" + Minecraft.getSystemTime() % 1000L, new String[0]); +- ArgumentAcceptingOptionSpec var12 = var1.accepts("session").withRequiredArg(); ++ ArgumentAcceptingOptionSpec var12 = var1.accepts("session").withRequiredArg().defaultsTo("Invalid Session ID", new String[0]); + ArgumentAcceptingOptionSpec var13 = var1.accepts("version").withRequiredArg().required(); + ArgumentAcceptingOptionSpec var14 = var1.accepts("width").withRequiredArg().ofType(Integer.class).defaultsTo(Integer.valueOf(854), new Integer[0]); + ArgumentAcceptingOptionSpec var15 = var1.accepts("height").withRequiredArg().ofType(Integer.class).defaultsTo(Integer.valueOf(480), new Integer[0]); + NonOptionArgumentSpec var16 = var1.nonOptions(); +- OptionSet var17 = var1.parse(var0); +- List var18 = var17.valuesOf((OptionSpec)var16); +- String var19 = (String)var17.valueOf((OptionSpec)var7); ++ OptionSet var17 = var1.parse(par0ArrayOfStr); ++ List var18 = var17.valuesOf(var16); ++ String var19 = (String)var17.valueOf(var7); + Proxy var20 = Proxy.NO_PROXY; +- if(var19 != null) { ++ ++ if (var19 != null) { + try { +- var20 = new Proxy(Type.SOCKS, new InetSocketAddress(var19, ((Integer)var17.valueOf((OptionSpec)var8)).intValue())); ++ var20 = new Proxy(Type.SOCKS, new InetSocketAddress(var19, ((Integer)var17.valueOf(var8)).intValue())); + } catch (Exception var34) { ++ ; + } + } + +- String var21 = (String)var17.valueOf((OptionSpec)var9); +- String var22 = (String)var17.valueOf((OptionSpec)var10); +- if(!var20.equals(Proxy.NO_PROXY) && func_110121_a(var21) && func_110121_a(var22)) { ++ String var21 = (String)var17.valueOf(var9); ++ String var22 = (String)var17.valueOf(var10); ++ ++ if (!var20.equals(Proxy.NO_PROXY) && func_110121_a(var21) && func_110121_a(var22)) { + Authenticator.setDefault(new MainProxyAuthenticator(var21, var22)); + } + +- int var23 = ((Integer)var17.valueOf((OptionSpec)var14)).intValue(); +- int var24 = ((Integer)var17.valueOf((OptionSpec)var15)).intValue(); ++ int var23 = ((Integer)var17.valueOf(var14)).intValue(); ++ int var24 = ((Integer)var17.valueOf(var15)).intValue(); + boolean var25 = var17.has("fullscreen"); + boolean var26 = var17.has("demo"); +- String var27 = (String)var17.valueOf((OptionSpec)var13); +- File var28 = (File)var17.valueOf((OptionSpec)var4); +- File var29 = var17.has((OptionSpec)var5) ? (File)var17.valueOf((OptionSpec)var5) : new File(var28, "assets/"); +- File var30 = var17.has((OptionSpec)var6) ? (File)var17.valueOf((OptionSpec)var6) : new File(var28, "resourcepacks/"); ++ String var27 = (String)var17.valueOf(var13); ++ File var28 = (File)var17.valueOf(var4); ++ File var29 = var17.has(var5) ? (File)var17.valueOf(var5) : new File(var28, "assets/"); ++ File var30 = var17.has(var6) ? (File)var17.valueOf(var6) : new File(var28, "resourcepacks/"); + Session var31 = new Session((String)var11.value(var17), (String)var12.value(var17)); +- Minecraft var32 = new Minecraft(var31, var23, var24, var25, var26, var28, var29, var30, var20, var27); +- String var33 = (String)var17.valueOf((OptionSpec)var2); +- if(var33 != null) { +- var32.setServer(var33, ((Integer)var17.valueOf((OptionSpec)var3)).intValue()); ++ Minecraft var32 = new Minecraft(var31, var23, var24, var25, var26, var28, var29, var30, var20, var27); ++ String var33 = (String)var17.valueOf(var2); ++ ++ if (var33 != null) { ++ var32.setServer(var33, ((Integer)var17.valueOf(var3)).intValue()); + } + + Runtime.getRuntime().addShutdownHook(new MainShutdownHook()); +- if(!var18.isEmpty()) { ++ ++ if (!var18.isEmpty()) { + System.out.println("Completely ignored arguments: " + var18); + } + + Thread.currentThread().setName("Minecraft main thread"); ++ DownloadAssets.importOldConfig(); + var32.run(); + } + +- private static boolean func_110121_a(String var0) { +- return var0 != null && !var0.isEmpty(); ++ private static boolean func_110121_a(String par0Str) { ++ return par0Str != null && !par0Str.isEmpty(); + } + } diff --git a/patches/net/minecraft/server/MinecraftServer.java.patch b/patches/net/minecraft/server/MinecraftServer.java.patch new file mode 100644 index 0000000..c44cb7d --- /dev/null +++ b/patches/net/minecraft/server/MinecraftServer.java.patch @@ -0,0 +1,1283 @@ +--- net/minecraft/server/MinecraftServer.java ++++ net/minecraft/server/MinecraftServer.java +@@ -53,127 +53,200 @@ + import net.minecraft.src.WorldType; + + public abstract class MinecraftServer implements ICommandSender, Runnable, IPlayerUsage { +- private static MinecraftServer l; ++ ++ /** Instance of Minecraft Server. */ ++ private static MinecraftServer mcServer; + private final ISaveFormat anvilConverterForAnvilFile; +- private final PlayerUsageSnooper usageSnooper = new PlayerUsageSnooper("server", this, getCurrentTimeMillis()); +- private final File o; +- private final List p = new ArrayList(); ++ ++ /** The PlayerUsageSnooper instance. */ ++ private final PlayerUsageSnooper usageSnooper = new PlayerUsageSnooper("server", this, getSystemTimeMillis()); ++ private final File anvilFile; ++ ++ /** ++ * Collection of objects to update every tick. Type: List ++ */ ++ private final List tickables = new ArrayList(); + private final ICommandManager commandManager; + public final Profiler theProfiler = new Profiler(); +- private String r; ++ ++ /** The server's hostname. */ ++ private String hostname; ++ ++ /** The server's port. */ + private int serverPort = -1; ++ ++ /** The server world instances. */ + public WorldServer[] worldServers; ++ ++ /** The ServerConfigurationManager instance. */ + private ServerConfigurationManager serverConfigManager; ++ ++ /** ++ * Indicates whether the server is running or not. Set to false to initiate a shutdown. ++ */ + private boolean serverRunning = true; ++ ++ /** Indicates to other classes that the server is safely stopped. */ + private boolean serverStopped; ++ ++ /** Incremented every tick. */ + private int tickCounter; +- protected Proxy c = Proxy.NO_PROXY; +- public String d; ++ protected Proxy serverProxy; ++ ++ /** ++ * The task the server is currently working on(and will output on outputPercentRemaining). ++ */ ++ public String currentTask; ++ ++ /** The percentage of the current task finished so far. */ + public int percentDone; ++ ++ /** True if the server is in online mode. */ + private boolean onlineMode; ++ ++ /** True if the server has animals turned on. */ + private boolean canSpawnAnimals; + private boolean canSpawnNPCs; ++ ++ /** Indicates whether PvP is active on the server or not. */ + private boolean pvpEnabled; ++ ++ /** Determines if flight is allowed or not. */ + private boolean allowFlight; +- private String C; ++ ++ /** The server MOTD string. */ ++ private String motd; ++ ++ /** Maximum build height. */ + private int buildLimit; +- private int field_143008_E = 0; ++ private int field_143008_E; + private long lastSentPacketID; + private long lastSentPacketSize; + private long lastReceivedID; + private long lastReceivedSize; +- public final long[] sentPacketCountArray = new long[100]; +- public final long[] sentPacketSizeArray = new long[100]; +- public final long[] receivedPacketCountArray = new long[100]; +- public final long[] receivedPacketSizeArray = new long[100]; +- public final long[] tickTimeArray = new long[100]; ++ public final long[] sentPacketCountArray; ++ public final long[] sentPacketSizeArray; ++ public final long[] receivedPacketCountArray; ++ public final long[] receivedPacketSizeArray; ++ public final long[] tickTimeArray; ++ ++ /** Stats are [dimension][tick%100] system.nanoTime is stored. */ + public long[][] timeOfLastDimensionTick; +- private KeyPair J; +- private String K; +- private String L; +- private String M; ++ private KeyPair serverKeyPair; ++ ++ /** Username of the server owner (for integrated servers) */ ++ private String serverOwner; ++ private String folderName; ++ private String worldName; + private boolean isDemo; + private boolean enableBonusChest; ++ ++ /** ++ * If true, there is no need to save chunks or stop the server, because that is already being done. ++ */ + private boolean worldIsBeingDeleted; +- private String Q = ""; ++ private String texturePack; + private boolean serverIsRunning; ++ ++ /** ++ * Set when warned for "Can't keep up", which triggers again after 15 seconds. ++ */ + private long timeOfLastWarning; +- private String T; ++ private String userMessage; + private boolean startProfiling; + private boolean isGamemodeForced; + +- public MinecraftServer(File var1) { +- l = this; +- this.o = var1; ++ public MinecraftServer(File par1File) { ++ this.serverProxy = Proxy.NO_PROXY; ++ this.field_143008_E = 0; ++ this.sentPacketCountArray = new long[100]; ++ this.sentPacketSizeArray = new long[100]; ++ this.receivedPacketCountArray = new long[100]; ++ this.receivedPacketSizeArray = new long[100]; ++ this.tickTimeArray = new long[100]; ++ this.texturePack = ""; ++ mcServer = this; ++ this.anvilFile = par1File; + this.commandManager = new ServerCommandManager(); +- this.anvilConverterForAnvilFile = new AnvilSaveConverter(var1); ++ this.anvilConverterForAnvilFile = new AnvilSaveConverter(par1File); + this.registerDispenseBehaviors(); + } + ++ /** ++ * Register all dispense behaviors. ++ */ + private void registerDispenseBehaviors() { + DispenserBehaviors.registerDispenserBehaviours(); + } + ++ /** ++ * Initialises the server and starts it. ++ */ + protected abstract boolean startServer() throws IOException; + +- protected void convertMapIfNeeded(String var1) { +- if(this.getActiveAnvilConverter().isOldMapFormat(var1)) { ++ protected void convertMapIfNeeded(String par1Str) { ++ if (this.getActiveAnvilConverter().isOldMapFormat(par1Str)) { + this.getLogAgent().logInfo("Converting map!"); + this.setUserMessage("menu.convertingLevel"); +- this.getActiveAnvilConverter().convertMapFormat(var1, new ConvertingProgressUpdate(this)); ++ this.getActiveAnvilConverter().convertMapFormat(par1Str, new ConvertingProgressUpdate(this)); + } +- + } + +- protected synchronized void setUserMessage(String var1) { +- this.T = var1; ++ /** ++ * Typically "menu.convertingLevel", "menu.loadingLevel" or others. ++ */ ++ protected synchronized void setUserMessage(String par1Str) { ++ this.userMessage = par1Str; + } + + public synchronized String getUserMessage() { +- return this.T; ++ return this.userMessage; + } + +- protected void loadAllWorlds(String var1, String var2, long var3, WorldType var5, String var6) { +- this.convertMapIfNeeded(var1); ++ protected void loadAllWorlds(String par1Str, String par2Str, long par3, WorldType par5WorldType, String par6Str) { ++ this.convertMapIfNeeded(par1Str); + this.setUserMessage("menu.loadingLevel"); + this.worldServers = new WorldServer[3]; + this.timeOfLastDimensionTick = new long[this.worldServers.length][100]; +- ISaveHandler var7 = this.anvilConverterForAnvilFile.getSaveLoader(var1, true); ++ ISaveHandler var7 = this.anvilConverterForAnvilFile.getSaveLoader(par1Str, true); + WorldInfo var9 = var7.loadWorldInfo(); + WorldSettings var8; +- if(var9 == null) { +- var8 = new WorldSettings(var3, this.getGameType(), this.canStructuresSpawn(), this.isHardcore(), var5); +- var8.func_82750_a(var6); ++ ++ if (var9 == null) { ++ var8 = new WorldSettings(par3, this.getGameType(), this.canStructuresSpawn(), this.isHardcore(), par5WorldType); ++ var8.func_82750_a(par6Str); + } else { + var8 = new WorldSettings(var9); + } + +- if(this.enableBonusChest) { ++ if (this.enableBonusChest) { + var8.enableBonusChest(); + } + +- for(int var10 = 0; var10 < this.worldServers.length; ++var10) { ++ for (int var10 = 0; var10 < this.worldServers.length; ++var10) { + byte var11 = 0; +- if(var10 == 1) { ++ ++ if (var10 == 1) { + var11 = -1; + } + +- if(var10 == 2) { ++ if (var10 == 2) { + var11 = 1; + } + +- if(var10 == 0) { +- if(this.isDemo()) { +- this.worldServers[var10] = new DemoWorldServer(this, var7, var2, var11, this.theProfiler, this.getLogAgent()); ++ if (var10 == 0) { ++ if (this.isDemo()) { ++ this.worldServers[var10] = new DemoWorldServer(this, var7, par2Str, var11, this.theProfiler, this.getLogAgent()); + } else { +- this.worldServers[var10] = new WorldServer(this, var7, var2, var11, var8, this.theProfiler, this.getLogAgent()); ++ this.worldServers[var10] = new WorldServer(this, var7, par2Str, var11, var8, this.theProfiler, this.getLogAgent()); + } + } else { +- this.worldServers[var10] = new WorldServerMulti(this, var7, var2, var11, var8, this.worldServers[0], this.theProfiler, this.getLogAgent()); ++ this.worldServers[var10] = new WorldServerMulti(this, var7, par2Str, var11, var8, this.worldServers[0], this.theProfiler, this.getLogAgent()); + } + + this.worldServers[var10].addWorldAccess(new WorldManager(this, this.worldServers[var10])); +- if(!this.isSinglePlayer()) { ++ ++ if (!this.isSinglePlayer()) { + this.worldServers[var10].getWorldInfo().setGameType(this.getGameType()); + } + +@@ -195,12 +268,13 @@ + this.getLogAgent().logInfo("Preparing start region for level " + var6); + WorldServer var7 = this.worldServers[var6]; + ChunkCoordinates var8 = var7.getSpawnPoint(); +- long var9 = getCurrentTimeMillis(); +- +- for(int var11 = -192; var11 <= 192 && this.isServerRunning(); var11 += 16) { +- for(int var12 = -192; var12 <= 192 && this.isServerRunning(); var12 += 16) { +- long var13 = getCurrentTimeMillis(); +- if(var13 - var9 > 1000L) { ++ long var9 = getSystemTimeMillis(); ++ ++ for (int var11 = -192; var11 <= 192 && this.isServerRunning(); var11 += 16) { ++ for (int var12 = -192; var12 <= 192 && this.isServerRunning(); var12 += 16) { ++ long var13 = getSystemTimeMillis(); ++ ++ if (var13 - var9 > 1000L) { + this.outputPercentRemaining("Preparing spawn area", var5 * 100 / 625); + var9 = var13; + } +@@ -217,32 +291,48 @@ + + public abstract EnumGameType getGameType(); + ++ /** ++ * Defaults to "1" (Easy) for the dedicated server, defaults to "2" (Normal) on the client. ++ */ + public abstract int getDifficulty(); + ++ /** ++ * Defaults to false. ++ */ + public abstract boolean isHardcore(); + + public abstract int func_110455_j(); + +- protected void outputPercentRemaining(String var1, int var2) { +- this.d = var1; +- this.percentDone = var2; +- this.getLogAgent().logInfo(var1 + ": " + var2 + "%"); ++ /** ++ * Used to display a percent remaining given text and the percentage. ++ */ ++ protected void outputPercentRemaining(String par1Str, int par2) { ++ this.currentTask = par1Str; ++ this.percentDone = par2; ++ this.getLogAgent().logInfo(par1Str + ": " + par2 + "%"); + } + ++ /** ++ * Set current task to null and set its percentage to 0. ++ */ + protected void clearCurrentTask() { +- this.d = null; ++ this.currentTask = null; + this.percentDone = 0; + } + +- protected void saveAllWorlds(boolean var1) { +- if(!this.worldIsBeingDeleted) { ++ /** ++ * par1 indicates if a log message should be output. ++ */ ++ protected void saveAllWorlds(boolean par1) { ++ if (!this.worldIsBeingDeleted) { + WorldServer[] var2 = this.worldServers; + int var3 = var2.length; + +- for(int var4 = 0; var4 < var3; ++var4) { ++ for (int var4 = 0; var4 < var3; ++var4) { + WorldServer var5 = var2[var4]; +- if(var5 != null) { +- if(!var1) { ++ ++ if (var5 != null) { ++ if (!par1) { + this.getLogAgent().logInfo("Saving chunks for level \'" + var5.getWorldInfo().getWorldName() + "\'/" + var5.provider.getDimensionName()); + } + +@@ -253,18 +343,21 @@ + } + } + } +- + } + } + ++ /** ++ * Saves all necessary data as preparation for stopping the server. ++ */ + public void stopServer() { +- if(!this.worldIsBeingDeleted) { ++ if (!this.worldIsBeingDeleted) { + this.getLogAgent().logInfo("Stopping server"); +- if(this.getNetworkThread() != null) { ++ ++ if (this.getNetworkThread() != null) { + this.getNetworkThread().stopListening(); + } + +- if(this.serverConfigManager != null) { ++ if (this.serverConfigManager != null) { + this.getLogAgent().logInfo("Saving players"); + this.serverConfigManager.saveAllPlayerData(); + this.serverConfigManager.removeAllPlayers(); +@@ -273,60 +366,67 @@ + this.getLogAgent().logInfo("Saving worlds"); + this.saveAllWorlds(false); + +- for(int var1 = 0; var1 < this.worldServers.length; ++var1) { ++ for (int var1 = 0; var1 < this.worldServers.length; ++var1) { + WorldServer var2 = this.worldServers[var1]; + var2.flush(); + } + +- if(this.usageSnooper != null && this.usageSnooper.isSnooperRunning()) { ++ if (this.usageSnooper != null && this.usageSnooper.isSnooperRunning()) { + this.usageSnooper.stopSnooper(); + } +- + } + } + ++ /** ++ * "getHostname" is already taken, but both return the hostname. ++ */ + public String getServerHostname() { +- return this.r; ++ return this.hostname; + } + +- public void setHostname(String var1) { +- this.r = var1; ++ public void setHostname(String par1Str) { ++ this.hostname = par1Str; + } + + public boolean isServerRunning() { + return this.serverRunning; + } + ++ /** ++ * Sets the serverRunning variable to false, in order to get the server to shut down. ++ */ + public void initiateShutdown() { + this.serverRunning = false; + } + + public void run() { + try { +- if(this.startServer()) { +- long var1 = getCurrentTimeMillis(); ++ if (this.startServer()) { ++ long var1 = getSystemTimeMillis(); + +- for(long var50 = 0L; this.serverRunning; this.serverIsRunning = true) { +- long var5 = getCurrentTimeMillis(); ++ for (long var50 = 0L; this.serverRunning; this.serverIsRunning = true) { ++ long var5 = getSystemTimeMillis(); + long var7 = var5 - var1; +- if(var7 > 2000L && var1 - this.timeOfLastWarning >= 15000L) { ++ ++ if (var7 > 2000L && var1 - this.timeOfLastWarning >= 15000L) { + this.getLogAgent().logWarning("Can\'t keep up! Did the system time change, or is the server overloaded?"); + var7 = 2000L; + this.timeOfLastWarning = var1; + } + +- if(var7 < 0L) { ++ if (var7 < 0L) { + this.getLogAgent().logWarning("Time ran backwards! Did the system time change?"); + var7 = 0L; + } + + var50 += var7; + var1 = var5; +- if(this.worldServers[0].areAllPlayersAsleep()) { ++ ++ if (this.worldServers[0].areAllPlayersAsleep()) { + this.tick(); + var50 = 0L; + } else { +- while(var50 > 50L) { ++ while (var50 > 50L) { + var50 -= 50L; + this.tick(); + } +@@ -341,14 +441,16 @@ + var48.printStackTrace(); + this.getLogAgent().logSevereException("Encountered an unexpected exception " + var48.getClass().getSimpleName(), var48); + CrashReport var2 = null; +- if(var48 instanceof ReportedException) { ++ ++ if (var48 instanceof ReportedException) { + var2 = this.addServerInfoToCrashReport(((ReportedException)var48).getCrashReport()); + } else { + var2 = this.addServerInfoToCrashReport(new CrashReport("Exception in server tick loop", var48)); + } + + File var3 = new File(new File(this.getDataDirectory(), "crash-reports"), "crash-" + (new SimpleDateFormat("yyyy-MM-dd_HH.mm.ss")).format(new Date()) + "-server.txt"); +- if(var2.saveToFile(var3, this.getLogAgent())) { ++ ++ if (var2.saveToFile(var3, this.getLogAgent())) { + this.getLogAgent().logSevere("This crash report has been saved to: " + var3.getAbsolutePath()); + } else { + this.getLogAgent().logSevere("We were unable to save this crash report to disk."); +@@ -364,26 +466,32 @@ + } finally { + this.systemExitNow(); + } +- + } +- + } + + protected File getDataDirectory() { + return new File("."); + } + +- protected void finalTick(CrashReport var1) { +- } +- +- protected void systemExitNow() { +- } +- ++ /** ++ * Called on exit from the main run() loop. ++ */ ++ protected void finalTick(CrashReport par1CrashReport) {} ++ ++ /** ++ * Directly calls System.exit(0), instantly killing the program. ++ */ ++ protected void systemExitNow() {} ++ ++ /** ++ * Main function called by run() every loop. ++ */ + public void tick() { + long var1 = System.nanoTime(); + AxisAlignedBB.getAABBPool().cleanPool(); + ++this.tickCounter; +- if(this.startProfiling) { ++ ++ if (this.startProfiling) { + this.startProfiling = false; + this.theProfiler.profilingEnabled = true; + this.theProfiler.clearProfiling(); +@@ -391,7 +499,8 @@ + + this.theProfiler.startSection("root"); + this.updateTimeLightAndEntities(); +- if(this.tickCounter % 900 == 0) { ++ ++ if (this.tickCounter % 900 == 0) { + this.theProfiler.startSection("save"); + this.serverConfigManager.saveAllPlayerData(); + this.saveAllWorlds(true); +@@ -410,11 +519,12 @@ + this.lastReceivedSize = Packet.receivedSize; + this.theProfiler.endSection(); + this.theProfiler.startSection("snooper"); +- if(!this.usageSnooper.isSnooperRunning() && this.tickCounter > 100) { ++ ++ if (!this.usageSnooper.isSnooperRunning() && this.tickCounter > 100) { + this.usageSnooper.startSnooper(); + } + +- if(this.tickCounter % 6000 == 0) { ++ if (this.tickCounter % 6000 == 0) { + this.usageSnooper.addMemoryStatsToSnooper(); + } + +@@ -424,25 +534,27 @@ + + public void updateTimeLightAndEntities() { + this.theProfiler.startSection("levels"); +- + int var1; +- for(var1 = 0; var1 < this.worldServers.length; ++var1) { ++ ++ for (var1 = 0; var1 < this.worldServers.length; ++var1) { + long var2 = System.nanoTime(); +- if(var1 == 0 || this.getAllowNether()) { ++ ++ if (var1 == 0 || this.getAllowNether()) { + WorldServer var4 = this.worldServers[var1]; + this.theProfiler.startSection(var4.getWorldInfo().getWorldName()); + this.theProfiler.startSection("pools"); + var4.getWorldVec3Pool().clear(); + this.theProfiler.endSection(); +- if(this.tickCounter % 20 == 0) { ++ ++ if (this.tickCounter % 20 == 0) { + this.theProfiler.startSection("timeSync"); + this.serverConfigManager.sendPacketToAllPlayersInDimension(new Packet4UpdateTime(var4.getTotalWorldTime(), var4.getWorldTime(), var4.getGameRules().getGameRuleBooleanValue("doDaylightCycle")), var4.provider.dimensionId); + this.theProfiler.endSection(); + } + + this.theProfiler.startSection("tick"); +- + CrashReport var6; ++ + try { + var4.tick(); + } catch (Throwable var8) { +@@ -470,13 +582,13 @@ + } + + this.theProfiler.endStartSection("connection"); +- this.getNetworkThread().handleNetworkListenThread(); ++ this.getNetworkThread().networkTick(); + this.theProfiler.endStartSection("players"); +- this.serverConfigManager.onTick(); ++ this.serverConfigManager.sendPlayerInfoToAllPlayers(); + this.theProfiler.endStartSection("tickables"); + +- for(var1 = 0; var1 < this.p.size(); ++var1) { +- ((IUpdatePlayerListBox)this.p.get(var1)).update(); ++ for (var1 = 0; var1 < this.tickables.size(); ++var1) { ++ ((IUpdatePlayerListBox)this.tickables.get(var1)).update(); + } + + this.theProfiler.endSection(); +@@ -490,104 +602,158 @@ + (new ThreadMinecraftServer(this, "Server thread")).start(); + } + +- public File getFile(String var1) { +- return new File(this.getDataDirectory(), var1); +- } +- +- public void logInfo(String var1) { +- this.getLogAgent().logInfo(var1); +- } +- +- public void logWarning(String var1) { +- this.getLogAgent().logWarning(var1); +- } +- +- public WorldServer worldServerForDimension(int var1) { +- return var1 == -1 ? this.worldServers[1] : (var1 == 1 ? this.worldServers[2] : this.worldServers[0]); +- } +- ++ /** ++ * Returns a File object from the specified string. ++ */ ++ public File getFile(String par1Str) { ++ return new File(this.getDataDirectory(), par1Str); ++ } ++ ++ /** ++ * Logs the message with a level of INFO. ++ */ ++ public void logInfo(String par1Str) { ++ this.getLogAgent().logInfo(par1Str); ++ } ++ ++ /** ++ * Logs the message with a level of WARN. ++ */ ++ public void logWarning(String par1Str) { ++ this.getLogAgent().logWarning(par1Str); ++ } ++ ++ /** ++ * Gets the worldServer by the given dimension. ++ */ ++ public WorldServer worldServerForDimension(int par1) { ++ return par1 == -1 ? this.worldServers[1] : (par1 == 1 ? this.worldServers[2] : this.worldServers[0]); ++ } ++ ++ /** ++ * Returns the server's hostname. ++ */ + public String getHostname() { +- return this.r; ++ return this.hostname; + } + ++ /** ++ * Never used, but "getServerPort" is already taken. ++ */ + public int getPort() { + return this.serverPort; + } + +- public String getMotd() { +- return this.C; ++ /** ++ * Returns the server message of the day ++ */ ++ public String getServerMOTD() { ++ return this.motd; + } + ++ /** ++ * Returns the server's Minecraft version as string. ++ */ + public String getMinecraftVersion() { + return "1.6.4"; + } + ++ /** ++ * Returns the number of players currently on the server. ++ */ + public int getCurrentPlayerCount() { + return this.serverConfigManager.getCurrentPlayerCount(); + } + ++ /** ++ * Returns the maximum number of players allowed on the server. ++ */ + public int getMaxPlayers() { + return this.serverConfigManager.getMaxPlayers(); + } + ++ /** ++ * Returns an array of the usernames of all the connected players. ++ */ + public String[] getAllUsernames() { + return this.serverConfigManager.getAllUsernames(); + } + ++ /** ++ * Used by RCon's Query in the form of "MajorServerMod 1.2.3: MyPlugin 1.3; AnotherPlugin 2.1; AndSoForth 1.0". ++ */ + public String getPlugins() { + return ""; + } + +- public String handleRConCommand(String var1) { +- RConConsoleSource.instance.resetLog(); +- this.commandManager.executeCommand(RConConsoleSource.instance, var1); +- return RConConsoleSource.instance.getLogContents(); ++ public String executeCommand(String par1Str) { ++ RConConsoleSource.consoleBuffer.resetLog(); ++ this.commandManager.executeCommand(RConConsoleSource.consoleBuffer, par1Str); ++ return RConConsoleSource.consoleBuffer.getChatBuffer(); + } + ++ /** ++ * Returns true if debugging is enabled, false otherwise. ++ */ + public boolean isDebuggingEnabled() { + return false; + } + +- public void logSevere(String var1) { +- this.getLogAgent().logSevere(var1); ++ /** ++ * Logs the error message with a level of SEVERE. ++ */ ++ public void logSevere(String par1Str) { ++ this.getLogAgent().logSevere(par1Str); + } + +- public void logDebug(String var1) { +- if(this.isDebuggingEnabled()) { +- this.getLogAgent().logInfo(var1); ++ /** ++ * If isDebuggingEnabled(), logs the message with a level of INFO. ++ */ ++ public void logDebug(String par1Str) { ++ if (this.isDebuggingEnabled()) { ++ this.getLogAgent().logInfo(par1Str); + } +- + } + + public String getServerModName() { + return "vanilla"; + } + +- public CrashReport addServerInfoToCrashReport(CrashReport var1) { +- var1.getCategory().addCrashSectionCallable("Profiler Position", new CallableIsServerModded(this)); +- if(this.worldServers != null && this.worldServers.length > 0 && this.worldServers[0] != null) { +- var1.getCategory().addCrashSectionCallable("Vec3 Pool Size", new CallableServerProfiler(this)); +- } +- +- if(this.serverConfigManager != null) { +- var1.getCategory().addCrashSectionCallable("Player Count", new CallableServerMemoryStats(this)); +- } +- +- return var1; ++ /** ++ * Adds the server info, including from theWorldServer, to the crash report. ++ */ ++ public CrashReport addServerInfoToCrashReport(CrashReport par1CrashReport) { ++ par1CrashReport.getCategory().addCrashSectionCallable("Profiler Position", new CallableIsServerModded(this)); ++ ++ if (this.worldServers != null && this.worldServers.length > 0 && this.worldServers[0] != null) { ++ par1CrashReport.getCategory().addCrashSectionCallable("Vec3 Pool Size", new CallableServerProfiler(this)); ++ } ++ ++ if (this.serverConfigManager != null) { ++ par1CrashReport.getCategory().addCrashSectionCallable("Player Count", new CallableServerMemoryStats(this)); ++ } ++ ++ return par1CrashReport; + } + +- public List getPossibleCompletions(ICommandSender var1, String var2) { ++ /** ++ * If par2Str begins with /, then it searches for commands, otherwise it returns players. ++ */ ++ public List getPossibleCompletions(ICommandSender par1ICommandSender, String par2Str) { + ArrayList var3 = new ArrayList(); +- if(var2.startsWith("/")) { +- var2 = var2.substring(1); +- boolean var10 = !var2.contains(" "); +- List var11 = this.commandManager.getPossibleCommands(var1, var2); +- if(var11 != null) { ++ ++ if (par2Str.startsWith("/")) { ++ par2Str = par2Str.substring(1); ++ boolean var10 = !par2Str.contains(" "); ++ List var11 = this.commandManager.getPossibleCommands(par1ICommandSender, par2Str); ++ ++ if (var11 != null) { + Iterator var12 = var11.iterator(); + +- while(var12.hasNext()) { ++ while (var12.hasNext()) { + String var13 = (String)var12.next(); +- if(var10) { ++ ++ if (var10) { + var3.add("/" + var13); + } else { + var3.add(var13); +@@ -597,14 +763,15 @@ + + return var3; + } else { +- String[] var4 = var2.split(" ", -1); ++ String[] var4 = par2Str.split(" ", -1); + String var5 = var4[var4.length - 1]; + String[] var6 = this.serverConfigManager.getAllUsernames(); + int var7 = var6.length; + +- for(int var8 = 0; var8 < var7; ++var8) { ++ for (int var8 = 0; var8 < var7; ++var8) { + String var9 = var6[var8]; +- if(CommandBase.doesStringStartWith(var5, var9)) { ++ ++ if (CommandBase.doesStringStartWith(var5, var9)) { + var3.add(var9); + } + } +@@ -613,19 +780,28 @@ + } + } + ++ /** ++ * Gets mcServer. ++ */ + public static MinecraftServer getServer() { +- return l; ++ return mcServer; + } + ++ /** ++ * Gets the name of this command sender (usually username, but possibly "Rcon") ++ */ + public String getCommandSenderName() { + return "Server"; + } + +- public void sendChatToPlayer(ChatMessageComponent var1) { +- this.getLogAgent().logInfo(var1.toString()); ++ public void sendChatToPlayer(ChatMessageComponent par1ChatMessageComponent) { ++ this.getLogAgent().logInfo(par1ChatMessageComponent.toString()); + } + +- public boolean canCommandSenderUseCommand(int var1, String var2) { ++ /** ++ * Returns true if the command sender is allowed to use the given command. ++ */ ++ public boolean canCommandSenderUseCommand(int par1, String par2Str) { + return true; + } + +@@ -633,96 +809,119 @@ + return this.commandManager; + } + ++ /** ++ * Gets KeyPair instanced in MinecraftServer. ++ */ + public KeyPair getKeyPair() { +- return this.J; ++ return this.serverKeyPair; + } + ++ /** ++ * Gets serverPort. ++ */ + public int getServerPort() { + return this.serverPort; + } + +- public void setServerPort(int var1) { +- this.serverPort = var1; ++ public void setServerPort(int par1) { ++ this.serverPort = par1; + } + ++ /** ++ * Returns the username of the server owner (for integrated servers) ++ */ + public String getServerOwner() { +- return this.K; ++ return this.serverOwner; + } + +- public void setServerOwner(String var1) { +- this.K = var1; ++ /** ++ * Sets the username of the owner of this server (in the case of an integrated server) ++ */ ++ public void setServerOwner(String par1Str) { ++ this.serverOwner = par1Str; + } + + public boolean isSinglePlayer() { +- return this.K != null; ++ return this.serverOwner != null; + } + + public String getFolderName() { +- return this.L; +- } +- +- public void setFolderName(String var1) { +- this.L = var1; +- } +- +- public void setWorldName(String var1) { +- this.M = var1; ++ return this.folderName; ++ } ++ ++ public void setFolderName(String par1Str) { ++ this.folderName = par1Str; ++ } ++ ++ public void setWorldName(String par1Str) { ++ this.worldName = par1Str; + } + + public String getWorldName() { +- return this.M; +- } +- +- public void setKeyPair(KeyPair var1) { +- this.J = var1; +- } +- +- public void setDifficultyForAllWorlds(int var1) { +- for(int var2 = 0; var2 < this.worldServers.length; ++var2) { ++ return this.worldName; ++ } ++ ++ public void setKeyPair(KeyPair par1KeyPair) { ++ this.serverKeyPair = par1KeyPair; ++ } ++ ++ public void setDifficultyForAllWorlds(int par1) { ++ for (int var2 = 0; var2 < this.worldServers.length; ++var2) { + WorldServer var3 = this.worldServers[var2]; +- if(var3 != null) { +- if(var3.getWorldInfo().isHardcoreModeEnabled()) { ++ ++ if (var3 != null) { ++ if (var3.getWorldInfo().isHardcoreModeEnabled()) { + var3.difficultySetting = 3; + var3.setAllowedSpawnTypes(true, true); +- } else if(this.isSinglePlayer()) { +- var3.difficultySetting = var1; ++ } else if (this.isSinglePlayer()) { ++ var3.difficultySetting = par1; + var3.setAllowedSpawnTypes(var3.difficultySetting > 0, true); + } else { +- var3.difficultySetting = var1; ++ var3.difficultySetting = par1; + var3.setAllowedSpawnTypes(this.allowSpawnMonsters(), this.canSpawnAnimals); + } + } + } +- + } + + protected boolean allowSpawnMonsters() { + return true; + } + ++ /** ++ * Gets whether this is a demo or not. ++ */ + public boolean isDemo() { + return this.isDemo; + } + +- public void setDemo(boolean var1) { +- this.isDemo = var1; ++ /** ++ * Sets whether this is a demo or not. ++ */ ++ public void setDemo(boolean par1) { ++ this.isDemo = par1; + } + +- public void canCreateBonusChest(boolean var1) { +- this.enableBonusChest = var1; ++ public void canCreateBonusChest(boolean par1) { ++ this.enableBonusChest = par1; + } + + public ISaveFormat getActiveAnvilConverter() { + return this.anvilConverterForAnvilFile; + } + ++ /** ++ * WARNING : directly calls ++ * getActiveAnvilConverter().deleteWorldDirectory(theWorldServer[0].getSaveHandler().getWorldDirectoryName()); ++ */ + public void deleteWorldAndStopServer() { + this.worldIsBeingDeleted = true; + this.getActiveAnvilConverter().flushCache(); + +- for(int var1 = 0; var1 < this.worldServers.length; ++var1) { ++ for (int var1 = 0; var1 < this.worldServers.length; ++var1) { + WorldServer var2 = this.worldServers[var1]; +- if(var2 != null) { ++ ++ if (var2 != null) { + var2.flush(); + } + } +@@ -732,59 +931,65 @@ + } + + public String getTexturePack() { +- return this.Q; +- } +- +- public void setTexturePack(String var1) { +- this.Q = var1; +- } +- +- public void addServerStatsToSnooper(PlayerUsageSnooper var1) { +- var1.addData("whitelist_enabled", Boolean.valueOf(false)); +- var1.addData("whitelist_count", Integer.valueOf(0)); +- var1.addData("players_current", Integer.valueOf(this.getCurrentPlayerCount())); +- var1.addData("players_max", Integer.valueOf(this.getMaxPlayers())); +- var1.addData("players_seen", Integer.valueOf(this.serverConfigManager.getAvailablePlayerDat().length)); +- var1.addData("uses_auth", Boolean.valueOf(this.onlineMode)); +- var1.addData("gui_state", this.getGuiEnabled() ? "enabled" : "disabled"); +- var1.addData("run_time", Long.valueOf((getCurrentTimeMillis() - var1.func_130105_g()) / 60L * 1000L)); +- var1.addData("avg_tick_ms", Integer.valueOf((int)(MathHelper.average(this.tickTimeArray) * 1.0E-6D))); +- var1.addData("avg_sent_packet_count", Integer.valueOf((int)MathHelper.average(this.sentPacketCountArray))); +- var1.addData("avg_sent_packet_size", Integer.valueOf((int)MathHelper.average(this.sentPacketSizeArray))); +- var1.addData("avg_rec_packet_count", Integer.valueOf((int)MathHelper.average(this.receivedPacketCountArray))); +- var1.addData("avg_rec_packet_size", Integer.valueOf((int)MathHelper.average(this.receivedPacketSizeArray))); ++ return this.texturePack; ++ } ++ ++ public void setTexturePack(String par1Str) { ++ this.texturePack = par1Str; ++ } ++ ++ public void addServerStatsToSnooper(PlayerUsageSnooper par1PlayerUsageSnooper) { ++ par1PlayerUsageSnooper.addData("whitelist_enabled", Boolean.valueOf(false)); ++ par1PlayerUsageSnooper.addData("whitelist_count", Integer.valueOf(0)); ++ par1PlayerUsageSnooper.addData("players_current", Integer.valueOf(this.getCurrentPlayerCount())); ++ par1PlayerUsageSnooper.addData("players_max", Integer.valueOf(this.getMaxPlayers())); ++ par1PlayerUsageSnooper.addData("players_seen", Integer.valueOf(this.serverConfigManager.getAvailablePlayerDat().length)); ++ par1PlayerUsageSnooper.addData("uses_auth", Boolean.valueOf(this.onlineMode)); ++ par1PlayerUsageSnooper.addData("gui_state", this.getGuiEnabled() ? "enabled" : "disabled"); ++ par1PlayerUsageSnooper.addData("run_time", Long.valueOf((getSystemTimeMillis() - par1PlayerUsageSnooper.func_130105_g()) / 60L * 1000L)); ++ par1PlayerUsageSnooper.addData("avg_tick_ms", Integer.valueOf((int)(MathHelper.average(this.tickTimeArray) * 1.0E-6D))); ++ par1PlayerUsageSnooper.addData("avg_sent_packet_count", Integer.valueOf((int)MathHelper.average(this.sentPacketCountArray))); ++ par1PlayerUsageSnooper.addData("avg_sent_packet_size", Integer.valueOf((int)MathHelper.average(this.sentPacketSizeArray))); ++ par1PlayerUsageSnooper.addData("avg_rec_packet_count", Integer.valueOf((int)MathHelper.average(this.receivedPacketCountArray))); ++ par1PlayerUsageSnooper.addData("avg_rec_packet_size", Integer.valueOf((int)MathHelper.average(this.receivedPacketSizeArray))); + int var2 = 0; + +- for(int var3 = 0; var3 < this.worldServers.length; ++var3) { +- if(this.worldServers[var3] != null) { ++ for (int var3 = 0; var3 < this.worldServers.length; ++var3) { ++ if (this.worldServers[var3] != null) { + WorldServer var4 = this.worldServers[var3]; + WorldInfo var5 = var4.getWorldInfo(); +- var1.addData("world[" + var2 + "][dimension]", Integer.valueOf(var4.provider.dimensionId)); +- var1.addData("world[" + var2 + "][mode]", var5.getGameType()); +- var1.addData("world[" + var2 + "][difficulty]", Integer.valueOf(var4.difficultySetting)); +- var1.addData("world[" + var2 + "][hardcore]", Boolean.valueOf(var5.isHardcoreModeEnabled())); +- var1.addData("world[" + var2 + "][generator_name]", var5.getTerrainType().getWorldTypeName()); +- var1.addData("world[" + var2 + "][generator_version]", Integer.valueOf(var5.getTerrainType().getGeneratorVersion())); +- var1.addData("world[" + var2 + "][height]", Integer.valueOf(this.buildLimit)); +- var1.addData("world[" + var2 + "][chunks_loaded]", Integer.valueOf(var4.getChunkProvider().getLoadedChunkCount())); ++ par1PlayerUsageSnooper.addData("world[" + var2 + "][dimension]", Integer.valueOf(var4.provider.dimensionId)); ++ par1PlayerUsageSnooper.addData("world[" + var2 + "][mode]", var5.getGameType()); ++ par1PlayerUsageSnooper.addData("world[" + var2 + "][difficulty]", Integer.valueOf(var4.difficultySetting)); ++ par1PlayerUsageSnooper.addData("world[" + var2 + "][hardcore]", Boolean.valueOf(var5.isHardcoreModeEnabled())); ++ par1PlayerUsageSnooper.addData("world[" + var2 + "][generator_name]", var5.getTerrainType().getWorldTypeName()); ++ par1PlayerUsageSnooper.addData("world[" + var2 + "][generator_version]", Integer.valueOf(var5.getTerrainType().getGeneratorVersion())); ++ par1PlayerUsageSnooper.addData("world[" + var2 + "][height]", Integer.valueOf(this.buildLimit)); ++ par1PlayerUsageSnooper.addData("world[" + var2 + "][chunks_loaded]", Integer.valueOf(var4.getChunkProvider().getLoadedChunkCount())); + ++var2; + } + } + +- var1.addData("worlds", Integer.valueOf(var2)); +- } +- +- public void addServerTypeToSnooper(PlayerUsageSnooper var1) { +- var1.addData("singleplayer", Boolean.valueOf(this.isSinglePlayer())); +- var1.addData("server_brand", this.getServerModName()); +- var1.addData("gui_supported", GraphicsEnvironment.isHeadless() ? "headless" : "supported"); +- var1.addData("dedicated", Boolean.valueOf(this.isDedicatedServer())); +- } +- ++ par1PlayerUsageSnooper.addData("worlds", Integer.valueOf(var2)); ++ } ++ ++ public void addServerTypeToSnooper(PlayerUsageSnooper par1PlayerUsageSnooper) { ++ par1PlayerUsageSnooper.addData("singleplayer", Boolean.valueOf(this.isSinglePlayer())); ++ par1PlayerUsageSnooper.addData("server_brand", this.getServerModName()); ++ par1PlayerUsageSnooper.addData("gui_supported", GraphicsEnvironment.isHeadless() ? "headless" : "supported"); ++ par1PlayerUsageSnooper.addData("dedicated", Boolean.valueOf(this.isDedicatedServer())); ++ } ++ ++ /** ++ * Returns whether snooping is enabled or not. ++ */ + public boolean isSnooperEnabled() { + return true; + } + ++ /** ++ * This is checked to be 16 upon receiving the packet, otherwise the packet is ignored. ++ */ + public int textureSize() { + return 16; + } +@@ -795,58 +1000,61 @@ + return this.onlineMode; + } + +- public void setOnlineMode(boolean var1) { +- this.onlineMode = var1; ++ public void setOnlineMode(boolean par1) { ++ this.onlineMode = par1; + } + + public boolean getCanSpawnAnimals() { + return this.canSpawnAnimals; + } + +- public void setCanSpawnAnimals(boolean var1) { +- this.canSpawnAnimals = var1; ++ public void setCanSpawnAnimals(boolean par1) { ++ this.canSpawnAnimals = par1; + } + + public boolean getCanSpawnNPCs() { + return this.canSpawnNPCs; + } + +- public void setCanSpawnNPCs(boolean var1) { +- this.canSpawnNPCs = var1; ++ public void setCanSpawnNPCs(boolean par1) { ++ this.canSpawnNPCs = par1; + } + + public boolean isPVPEnabled() { + return this.pvpEnabled; + } + +- public void setAllowPvp(boolean var1) { +- this.pvpEnabled = var1; ++ public void setAllowPvp(boolean par1) { ++ this.pvpEnabled = par1; + } + + public boolean isFlightAllowed() { + return this.allowFlight; + } + +- public void setAllowFlight(boolean var1) { +- this.allowFlight = var1; ++ public void setAllowFlight(boolean par1) { ++ this.allowFlight = par1; + } + ++ /** ++ * Return whether command blocks are enabled. ++ */ + public abstract boolean isCommandBlockEnabled(); + + public String getMOTD() { +- return this.C; ++ return this.motd; + } + +- public void setMOTD(String var1) { +- this.C = var1; ++ public void setMOTD(String par1Str) { ++ this.motd = par1Str; + } + + public int getBuildLimit() { + return this.buildLimit; + } + +- public void setBuildLimit(int var1) { +- this.buildLimit = var1; ++ public void setBuildLimit(int par1) { ++ this.buildLimit = par1; + } + + public boolean isServerStopped() { +@@ -857,15 +1065,17 @@ + return this.serverConfigManager; + } + +- public void setConfigurationManager(ServerConfigurationManager var1) { +- this.serverConfigManager = var1; ++ public void setConfigurationManager(ServerConfigurationManager par1ServerConfigurationManager) { ++ this.serverConfigManager = par1ServerConfigurationManager; + } + +- public void setGameType(EnumGameType var1) { +- for(int var2 = 0; var2 < this.worldServers.length; ++var2) { +- getServer().worldServers[var2].getWorldInfo().setGameType(var1); ++ /** ++ * Sets the game type for all worlds. ++ */ ++ public void setGameType(EnumGameType par1EnumGameType) { ++ for (int var2 = 0; var2 < this.worldServers.length; ++var2) { ++ getServer().worldServers[var2].getWorldInfo().setGameType(par1EnumGameType); + } +- + } + + public abstract NetworkListenThread getNetworkThread(); +@@ -878,6 +1088,9 @@ + return false; + } + ++ /** ++ * On dedicated does nothing. On integrated, sets commandsAllowedForAll, gameType and allows external connections. ++ */ + public abstract String shareToLAN(EnumGameType var1, boolean var2); + + public int getTickCounter() { +@@ -892,7 +1105,10 @@ + return this.usageSnooper; + } + +- public ChunkCoordinates getCommandSenderPosition() { ++ /** ++ * Return the position for this command sender. ++ */ ++ public ChunkCoordinates getPlayerCoordinates() { + return new ChunkCoordinates(0, 0, 0); + } + +@@ -900,18 +1116,24 @@ + return this.worldServers[0]; + } + ++ /** ++ * Return the spawn protection area's size. ++ */ + public int getSpawnProtectionSize() { + return 16; + } + +- public boolean isBlockProtected(World var1, int var2, int var3, int var4, EntityPlayer var5) { ++ /** ++ * Returns true if a player does not have permission to edit the block at the given coordinates. ++ */ ++ public boolean isBlockProtected(World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer) { + return false; + } + + public abstract ILogAgent getLogAgent(); + +- public void setForceGamemode(boolean var1) { +- this.isGamemodeForced = var1; ++ public void setForceGamemode(boolean par1) { ++ this.isGamemodeForced = par1; + } + + public boolean getForceGamemode() { +@@ -919,10 +1141,13 @@ + } + + public Proxy getServerProxy() { +- return this.c; ++ return this.serverProxy; + } + +- public static long getCurrentTimeMillis() { ++ /** ++ * returns the difference, measured in milliseconds, between the current system time and midnight, January 1, 1970 UTC. ++ */ ++ public static long getSystemTimeMillis() { + return System.currentTimeMillis(); + } + +@@ -930,11 +1155,14 @@ + return this.field_143008_E; + } + +- public void func_143006_e(int var1) { +- this.field_143008_E = var1; ++ public void func_143006_e(int par1) { ++ this.field_143008_E = par1; + } + +- public static ServerConfigurationManager getServerConfigurationManager(MinecraftServer var0) { +- return var0.serverConfigManager; ++ /** ++ * Gets the current player count, maximum player count, and player entity list. ++ */ ++ public static ServerConfigurationManager getServerConfigurationManager(MinecraftServer par0MinecraftServer) { ++ return par0MinecraftServer.serverConfigManager; + } + } diff --git a/patches/net/minecraft/src/AABBPool.java.patch b/patches/net/minecraft/src/AABBPool.java.patch new file mode 100644 index 0000000..15c32bf --- /dev/null +++ b/patches/net/minecraft/src/AABBPool.java.patch @@ -0,0 +1,106 @@ +--- net/minecraft/src/AABBPool.java ++++ net/minecraft/src/AABBPool.java +@@ -4,42 +4,69 @@ + import java.util.List; + + public class AABBPool { ++ ++ /** ++ * Maximum number of times the pool can be "cleaned" before the list is shrunk ++ */ + private final int maxNumCleans; ++ ++ /** ++ * Number of Pool entries to remove when cleanPool is called maxNumCleans times. ++ */ + private final int numEntriesToRemove; +- private final List c = new ArrayList(); ++ ++ /** List of AABB stored in this Pool */ ++ private final List listAABB = new ArrayList(); ++ ++ /** Next index to use when adding a Pool Entry. */ + private int nextPoolIndex; ++ ++ /** ++ * Largest index reached by this Pool (can be reset to 0 upon calling cleanPool) ++ */ + private int maxPoolIndex; ++ ++ /** Number of times this Pool has been cleaned */ + private int numCleans; + +- public AABBPool(int var1, int var2) { +- this.maxNumCleans = var1; +- this.numEntriesToRemove = var2; ++ public AABBPool(int par1, int par2) { ++ this.maxNumCleans = par1; ++ this.numEntriesToRemove = par2; + } + +- public AxisAlignedBB getAABB(double var1, double var3, double var5, double var7, double var9, double var11) { ++ /** ++ * Creates a new AABB, or reuses one that's no longer in use. Parameters: minX, minY, minZ, maxX, maxY, maxZ. AABBs ++ * returned from this function should only be used for one frame or tick, as after that they will be reused. ++ */ ++ public AxisAlignedBB getAABB(double par1, double par3, double par5, double par7, double par9, double par11) { + AxisAlignedBB var13; +- if(this.nextPoolIndex >= this.c.size()) { +- var13 = new AxisAlignedBB(var1, var3, var5, var7, var9, var11); +- this.c.add(var13); ++ ++ if (this.nextPoolIndex >= this.listAABB.size()) { ++ var13 = new AxisAlignedBB(par1, par3, par5, par7, par9, par11); ++ this.listAABB.add(var13); + } else { +- var13 = (AxisAlignedBB)this.c.get(this.nextPoolIndex); +- var13.setBounds(var1, var3, var5, var7, var9, var11); ++ var13 = (AxisAlignedBB)this.listAABB.get(this.nextPoolIndex); ++ var13.setBounds(par1, par3, par5, par7, par9, par11); + } + + ++this.nextPoolIndex; + return var13; + } + ++ /** ++ * Marks the pool as "empty", starting over when adding new entries. If this is called maxNumCleans times, the list ++ * size is reduced ++ */ + public void cleanPool() { +- if(this.nextPoolIndex > this.maxPoolIndex) { ++ if (this.nextPoolIndex > this.maxPoolIndex) { + this.maxPoolIndex = this.nextPoolIndex; + } + +- if(this.numCleans++ == this.maxNumCleans) { +- int var1 = Math.max(this.maxPoolIndex, this.c.size() - this.numEntriesToRemove); ++ if (this.numCleans++ == this.maxNumCleans) { ++ int var1 = Math.max(this.maxPoolIndex, this.listAABB.size() - this.numEntriesToRemove); + +- while(this.c.size() > var1) { +- this.c.remove(var1); ++ while (this.listAABB.size() > var1) { ++ this.listAABB.remove(var1); + } + + this.maxPoolIndex = 0; +@@ -49,13 +76,16 @@ + this.nextPoolIndex = 0; + } + ++ /** ++ * Clears the AABBPool ++ */ + public void clearPool() { + this.nextPoolIndex = 0; +- this.c.clear(); ++ this.listAABB.clear(); + } + + public int getlistAABBsize() { +- return this.c.size(); ++ return this.listAABB.size(); + } + + public int getnextPoolIndex() { diff --git a/patches/net/minecraft/src/AbstractClientPlayer.java.patch b/patches/net/minecraft/src/AbstractClientPlayer.java.patch new file mode 100644 index 0000000..b7a6b53 --- /dev/null +++ b/patches/net/minecraft/src/AbstractClientPlayer.java.patch @@ -0,0 +1,159 @@ +--- net/minecraft/src/AbstractClientPlayer.java ++++ net/minecraft/src/AbstractClientPlayer.java +@@ -1,24 +1,38 @@ + package net.minecraft.src; + ++import net.minecraft.src.Minecraft; ++import net.minecraft.src.StringUtils; ++ ++import org.bukkit.ChatColor; ++import org.spoutcraft.client.SpoutClient; ++import org.spoutcraft.client.config.Configuration; ++import org.spoutcraft.client.special.Holiday; ++import org.spoutcraft.client.special.Resources; ++import org.spoutcraft.client.special.VIP; ++ + public abstract class AbstractClientPlayer extends EntityPlayer { + public static final ResourceLocation locationStevePng = new ResourceLocation("textures/entity/steve.png"); + private ThreadDownloadImageData downloadImageSkin; + private ThreadDownloadImageData downloadImageCape; + private ResourceLocation locationSkin; + private ResourceLocation locationCape; +- +- public AbstractClientPlayer(World var1, String var2) { +- super(var1, var2); ++ public String customCapeUrl; ++ public String customSkinUrl; ++ public static boolean forceUpdate = false; ++ ++ public AbstractClientPlayer(World par1World, String par2Str) { ++ super(par1World, par2Str); + this.setupCustomSkin(); + } + +- protected void setupCustomSkin() { +- System.out.println("Setting up custom skins"); +- if(this.bu != null && !this.bu.isEmpty()) { +- this.locationSkin = getLocationSkin(this.bu); +- this.locationCape = getLocationCape(this.bu); +- this.downloadImageSkin = getDownloadImageSkin(this.locationSkin, this.bu); +- this.downloadImageCape = getDownloadImageCape(this.locationCape, this.bu); ++ public void setupCustomSkin() { ++ if (this.username != null && !this.username.isEmpty()) { ++ this.locationSkin = getLocationSkin(this.username); ++ this.locationCape = getLocationCape(this.username); ++ forceUpdate = true; ++ this.downloadImageSkin = getDownloadImageSkin(this.locationSkin, this.username, this.customSkinUrl); ++ forceUpdate = true; ++ this.downloadImageCape = getDownloadImageCape(this.locationCape, this.username, this.customCapeUrl); + } + } + +@@ -37,43 +51,74 @@ + public ResourceLocation getLocationCape() { + return this.locationCape; + } +- +- public static ThreadDownloadImageData getDownloadImageSkin(ResourceLocation var0, String var1) { +- return getDownloadImage(var0, getSkinUrl(var1), locationStevePng, new ImageBufferDownload()); +- } +- +- public static ThreadDownloadImageData getDownloadImageCape(ResourceLocation var0, String var1) { +- return getDownloadImage(var0, getCapeUrl(var1), (ResourceLocation)null, (IImageBuffer)null); +- } +- +- private static ThreadDownloadImageData getDownloadImage(ResourceLocation var0, String var1, ResourceLocation var2, IImageBuffer var3) { ++ ++ public static ThreadDownloadImageData getDownloadImageSkin(ResourceLocation par0ResourceLocation, String par1Str) { ++ return getDownloadImage(par0ResourceLocation, getSkinUrl(par1Str, null), locationStevePng, new ImageBufferDownload()); ++ } ++ ++ public static ThreadDownloadImageData getDownloadImageSkin(ResourceLocation par0ResourceLocation, String par1Str, String customSkin) { ++ return getDownloadImage(par0ResourceLocation, getSkinUrl(par1Str, customSkin), locationStevePng, new ImageBufferDownload()); ++ } ++ ++ public static ThreadDownloadImageData getDownloadImageCape(ResourceLocation par0ResourceLocation, String par1Str, String customCape) { ++ return getDownloadImage(par0ResourceLocation, getCapeUrl(par1Str, customCape), (ResourceLocation)null, (IImageBuffer)null); ++ } ++ ++ private static ThreadDownloadImageData getDownloadImage(ResourceLocation par0ResourceLocation, String par1Str, ResourceLocation par2ResourceLocation, IImageBuffer par3IImageBuffer) { + TextureManager var4 = Minecraft.getMinecraft().getTextureManager(); +- Object var5 = var4.getTexture(var0); +- if(var5 == null) { +- var5 = new ThreadDownloadImageData(var1, var2, var3); +- var4.loadTexture(var0, (TextureObject)var5); +- } ++ Object var5 = var4.getTexture(par0ResourceLocation); + ++ if (forceUpdate){ ++ var5 = null; ++ forceUpdate = false; ++ } ++ ++ if (var5 == null) { ++ var5 = new ThreadDownloadImageData(par1Str, par2ResourceLocation, par3IImageBuffer); ++ var4.loadTexture(par0ResourceLocation, (TextureObject)var5); ++ } + return (ThreadDownloadImageData)var5; + } + +- public static String getSkinUrl(String var0) { +- return String.format("http://skins.minecraft.net/MinecraftSkins/%s.png", new Object[]{StringUtils.stripControlCodes(var0)}); +- } +- +- public static String getCapeUrl(String var0) { +- return String.format("http://skins.minecraft.net/MinecraftCloaks/%s.png", new Object[]{StringUtils.stripControlCodes(var0)}); +- } +- +- public static ResourceLocation getLocationSkin(String var0) { +- return new ResourceLocation("skins/" + StringUtils.stripControlCodes(var0)); +- } +- +- public static ResourceLocation getLocationCape(String var0) { +- return new ResourceLocation("cloaks/" + StringUtils.stripControlCodes(var0)); +- } +- +- public static ResourceLocation getLocationSkull(String var0) { +- return new ResourceLocation("skull/" + StringUtils.stripControlCodes(var0)); ++ public static String getSkinUrl(String par0Str, String par1Str) { ++ if (par1Str != null) { ++ return par1Str; ++ } else { ++ return String.format("http://skins.minecraft.net/MinecraftSkins/%s.png", new Object[] {StringUtils.stripControlCodes(par0Str)}); ++ } ++ } ++ ++ public static String getCapeUrl(String par0Str, String par1Str) { ++ String playerCloakUrl; ++ String cleanUserName = ChatColor.stripColor(par0Str); ++ VIP vip = Resources.getVIP(cleanUserName); ++ ++ if (par1Str != null) { ++ playerCloakUrl = par1Str; ++ } else { ++ playerCloakUrl = String.format("http://skins.minecraft.net/MinecraftCloaks/%s.png", new Object[] {StringUtils.stripControlCodes(par0Str)}); ++ } ++ ++ if (vip != null && vip.getCape() != null) { ++ playerCloakUrl = vip.getCape(); ++ } else { ++ Holiday holiday = Resources.getHoliday(); ++ if (holiday != null && holiday.getCape() != null) { ++ playerCloakUrl = holiday.getCape(); ++ } ++ } ++ return playerCloakUrl; ++ } ++ ++ public static ResourceLocation getLocationSkin(String par0Str) { ++ return new ResourceLocation("skins/" + StringUtils.stripControlCodes(par0Str)); ++ } ++ ++ public static ResourceLocation getLocationCape(String par0Str) { ++ return new ResourceLocation("cloaks/" + StringUtils.stripControlCodes(par0Str)); ++ } ++ ++ public static ResourceLocation getLocationSkull(String par0Str) { ++ return new ResourceLocation("skull/" + StringUtils.stripControlCodes(par0Str)); + } + } diff --git a/patches/net/minecraft/src/AbstractResourcePack.java.patch b/patches/net/minecraft/src/AbstractResourcePack.java.patch new file mode 100644 index 0000000..91f6766 --- /dev/null +++ b/patches/net/minecraft/src/AbstractResourcePack.java.patch @@ -0,0 +1,102 @@ +--- net/minecraft/src/AbstractResourcePack.java ++++ net/minecraft/src/AbstractResourcePack.java +@@ -8,58 +8,57 @@ + import java.io.IOException; + import java.io.InputStream; + import java.io.InputStreamReader; +-import java.io.Reader; + import javax.imageio.ImageIO; + import org.apache.commons.io.IOUtils; + + public abstract class AbstractResourcePack implements ResourcePack { + protected static final ILogAgent resourceLog = Minecraft.getMinecraft().getLogAgent(); +- protected final File b; +- +- public AbstractResourcePack(File var1) { +- this.b = var1; +- } +- +- private static String locationToName(ResourceLocation var0) { +- return String.format("%s/%s/%s", new Object[]{"assets", var0.getResourceDomain(), var0.getResourcePath()}); +- } +- +- protected static String getRelativeName(File var0, File var1) { +- return var0.toURI().relativize(var1.toURI()).getPath(); +- } +- +- public InputStream getInputStream(ResourceLocation var1) throws IOException { +- return this.getInputStreamByName(locationToName(var1)); +- } +- +- public boolean resourceExists(ResourceLocation var1) { +- return this.hasResourceName(locationToName(var1)); ++ public final File resourcePackFile; ++ ++ public AbstractResourcePack(File par1File) { ++ this.resourcePackFile = par1File; ++ } ++ ++ private static String locationToName(ResourceLocation par0ResourceLocation) { ++ return String.format("%s/%s/%s", new Object[] {"assets", par0ResourceLocation.getResourceDomain(), par0ResourceLocation.getResourcePath()}); ++ } ++ ++ protected static String getRelativeName(File par0File, File par1File) { ++ return par0File.toURI().relativize(par1File.toURI()).getPath(); ++ } ++ ++ public InputStream getInputStream(ResourceLocation par1ResourceLocation) throws IOException { ++ return this.getInputStreamByName(locationToName(par1ResourceLocation)); ++ } ++ ++ public boolean resourceExists(ResourceLocation par1ResourceLocation) { ++ return this.hasResourceName(locationToName(par1ResourceLocation)); + } + + protected abstract InputStream getInputStreamByName(String var1) throws IOException; + + protected abstract boolean hasResourceName(String var1); + +- protected void logNameNotLowercase(String var1) { +- resourceLog.logWarningFormatted("ResourcePack: ignored non-lowercase namespace: %s in %s", new Object[]{var1, this.b}); +- } +- +- public MetadataSection getPackMetadata(MetadataSerializer var1, String var2) throws IOException { +- return readMetadata(var1, this.getInputStreamByName("pack.mcmeta"), var2); +- } +- +- static MetadataSection readMetadata(MetadataSerializer var0, InputStream var1, String var2) { ++ protected void logNameNotLowercase(String par1Str) { ++ resourceLog.logWarningFormatted("ResourcePack: ignored non-lowercase namespace: %s in %s", new Object[] {par1Str, this.resourcePackFile}); ++ } ++ ++ public MetadataSection getPackMetadata(MetadataSerializer par1MetadataSerializer, String par2Str) throws IOException { ++ return readMetadata(par1MetadataSerializer, this.getInputStreamByName("pack.mcmeta"), par2Str); ++ } ++ ++ static MetadataSection readMetadata(MetadataSerializer par0MetadataSerializer, InputStream par1InputStream, String par2Str) { + JsonObject var3 = null; + BufferedReader var4 = null; + + try { +- var4 = new BufferedReader(new InputStreamReader(var1)); +- var3 = (new JsonParser()).parse((Reader)var4).getAsJsonObject(); ++ var4 = new BufferedReader(new InputStreamReader(par1InputStream)); ++ var3 = (new JsonParser()).parse(var4).getAsJsonObject(); + } finally { +- IOUtils.closeQuietly((Reader)var4); ++ IOUtils.closeQuietly(var4); + } + +- return var0.parseMetadataSection(var2, var3); ++ return par0MetadataSerializer.parseMetadataSection(par2Str, var3); + } + + public BufferedImage getPackImage() throws IOException { +@@ -67,6 +66,6 @@ + } + + public String getPackName() { +- return this.b.getName(); ++ return this.resourcePackFile.getName(); + } + } diff --git a/patches/net/minecraft/src/AbstractTexture.java.patch b/patches/net/minecraft/src/AbstractTexture.java.patch new file mode 100644 index 0000000..17a2c52 --- /dev/null +++ b/patches/net/minecraft/src/AbstractTexture.java.patch @@ -0,0 +1,31 @@ +--- net/minecraft/src/AbstractTexture.java ++++ net/minecraft/src/AbstractTexture.java +@@ -1,13 +1,26 @@ + package net.minecraft.src; + ++import org.lwjgl.opengl.GL11; ++ + public abstract class AbstractTexture implements TextureObject { +- protected int glTextureId = -1; ++ public int glTextureId = -1; + + public int getGlTextureId() { +- if(this.glTextureId == -1) { ++ if (this.glTextureId == -1) { + this.glTextureId = TextureUtil.glGenTextures(); + } + + return this.glTextureId; ++ } ++ ++ public void unloadGLTexture() { ++ if (this.glTextureId >= 0) { ++ GL11.glDeleteTextures(this.glTextureId); ++ this.glTextureId = -1; ++ } ++ } ++ ++ public void finalize() { ++ this.unloadGLTexture(); + } + } diff --git a/patches/net/minecraft/src/Achievement.java.patch b/patches/net/minecraft/src/Achievement.java.patch new file mode 100644 index 0000000..b94fe27 --- /dev/null +++ b/patches/net/minecraft/src/Achievement.java.patch @@ -0,0 +1,187 @@ +--- net/minecraft/src/Achievement.java ++++ net/minecraft/src/Achievement.java +@@ -1,84 +1,146 @@ + package net.minecraft.src; + + public class Achievement extends StatBase { ++ ++ /** ++ * Is the column (related to center of achievement gui, in 24 pixels unit) that the achievement will be displayed. ++ */ + public final int displayColumn; ++ ++ /** ++ * Is the row (related to center of achievement gui, in 24 pixels unit) that the achievement will be displayed. ++ */ + public final int displayRow; ++ ++ /** ++ * Holds the parent achievement, that must be taken before this achievement is avaiable. ++ */ + public final Achievement parentAchievement; +- private final String l; ++ ++ /** ++ * Holds the description of the achievement, ready to be formatted and/or displayed. ++ */ ++ private final String achievementDescription; ++ ++ /** ++ * Holds a string formatter for the achievement, some of then needs extra dynamic info - like the key used to open the ++ * inventory. ++ */ + private IStatStringFormat statStringFormatter; ++ ++ /** ++ * Holds the ItemStack that will be used to draw the achievement into the GUI. ++ */ + public final ItemStack theItemStack; ++ ++ /** ++ * Special achievements have a 'spiked' (on normal texture pack) frame, special achievements are the hardest ones to ++ * achieve. ++ */ + private boolean isSpecial; + +- public Achievement(int var1, String var2, int var3, int var4, Item var5, Achievement var6) { +- this(var1, var2, var3, var4, new ItemStack(var5), var6); +- } +- +- public Achievement(int var1, String var2, int var3, int var4, Block var5, Achievement var6) { +- this(var1, var2, var3, var4, new ItemStack(var5), var6); +- } +- +- public Achievement(int var1, String var2, int var3, int var4, ItemStack var5, Achievement var6) { +- super(5242880 + var1, "achievement." + var2); +- this.theItemStack = var5; +- this.l = "achievement." + var2 + ".desc"; +- this.displayColumn = var3; +- this.displayRow = var4; +- if(var3 < AchievementList.minDisplayColumn) { +- AchievementList.minDisplayColumn = var3; +- } +- +- if(var4 < AchievementList.minDisplayRow) { +- AchievementList.minDisplayRow = var4; +- } +- +- if(var3 > AchievementList.maxDisplayColumn) { +- AchievementList.maxDisplayColumn = var3; +- } +- +- if(var4 > AchievementList.maxDisplayRow) { +- AchievementList.maxDisplayRow = var4; +- } +- +- this.parentAchievement = var6; +- } +- ++ public Achievement(int par1, String par2Str, int par3, int par4, Item par5Item, Achievement par6Achievement) { ++ this(par1, par2Str, par3, par4, new ItemStack(par5Item), par6Achievement); ++ } ++ ++ public Achievement(int par1, String par2Str, int par3, int par4, Block par5Block, Achievement par6Achievement) { ++ this(par1, par2Str, par3, par4, new ItemStack(par5Block), par6Achievement); ++ } ++ ++ public Achievement(int par1, String par2Str, int par3, int par4, ItemStack par5ItemStack, Achievement par6Achievement) { ++ super(5242880 + par1, "achievement." + par2Str); ++ this.theItemStack = par5ItemStack; ++ this.achievementDescription = "achievement." + par2Str + ".desc"; ++ this.displayColumn = par3; ++ this.displayRow = par4; ++ ++ if (par3 < AchievementList.minDisplayColumn) { ++ AchievementList.minDisplayColumn = par3; ++ } ++ ++ if (par4 < AchievementList.minDisplayRow) { ++ AchievementList.minDisplayRow = par4; ++ } ++ ++ if (par3 > AchievementList.maxDisplayColumn) { ++ AchievementList.maxDisplayColumn = par3; ++ } ++ ++ if (par4 > AchievementList.maxDisplayRow) { ++ AchievementList.maxDisplayRow = par4; ++ } ++ ++ this.parentAchievement = par6Achievement; ++ } ++ ++ /** ++ * Indicates whether or not the given achievement or statistic is independent (i.e., lacks prerequisites for being ++ * update). ++ */ + public Achievement setIndependent() { + this.isIndependent = true; + return this; + } + ++ /** ++ * Special achievements have a 'spiked' (on normal texture pack) frame, special achievements are the hardest ones to ++ * achieve. ++ */ + public Achievement setSpecial() { + this.isSpecial = true; + return this; + } + ++ /** ++ * Adds the achievement on the internal list of registered achievements, also, it's check for duplicated id's. ++ */ + public Achievement registerAchievement() { + super.registerStat(); +- AchievementList.e.add(this); ++ AchievementList.achievementList.add(this); + return this; + } + ++ /** ++ * Returns whether or not the StatBase-derived class is a statistic (running counter) or an achievement (one-shot). ++ */ + public boolean isAchievement() { + return true; + } + ++ /** ++ * Returns the fully description of the achievement - ready to be displayed on screen. ++ */ + public String getDescription() { +- return this.statStringFormatter != null ? this.statStringFormatter.formatString(StatCollector.translateToLocal(this.l)) : StatCollector.translateToLocal(this.l); ++ return this.statStringFormatter != null ? this.statStringFormatter.formatString(StatCollector.translateToLocal(this.achievementDescription)) : StatCollector.translateToLocal(this.achievementDescription); + } + +- public Achievement setStatStringFormatter(IStatStringFormat var1) { +- this.statStringFormatter = var1; ++ /** ++ * Defines a string formatter for the achievement. ++ */ ++ public Achievement setStatStringFormatter(IStatStringFormat par1IStatStringFormat) { ++ this.statStringFormatter = par1IStatStringFormat; + return this; + } + ++ /** ++ * Special achievements have a 'spiked' (on normal texture pack) frame, special achievements are the hardest ones to ++ * achieve. ++ */ + public boolean getSpecial() { + return this.isSpecial; + } + ++ /** ++ * Register the stat into StatList. ++ */ + public StatBase registerStat() { + return this.registerAchievement(); + } + ++ /** ++ * Initializes the current stat as independent (i.e., lacking prerequisites for being updated) and returns the current ++ * instance. ++ */ + public StatBase initIndependentStat() { + return this.setIndependent(); + } diff --git a/patches/net/minecraft/src/AchievementList.java.patch b/patches/net/minecraft/src/AchievementList.java.patch new file mode 100644 index 0000000..6b23ff8 --- /dev/null +++ b/patches/net/minecraft/src/AchievementList.java.patch @@ -0,0 +1,109 @@ +--- net/minecraft/src/AchievementList.java ++++ net/minecraft/src/AchievementList.java +@@ -4,39 +4,103 @@ + import java.util.List; + + public class AchievementList { ++ ++ /** Is the smallest column used to display a achievement on the GUI. */ + public static int minDisplayColumn; ++ ++ /** Is the smallest row used to display a achievement on the GUI. */ + public static int minDisplayRow; ++ ++ /** Is the biggest column used to display a achievement on the GUI. */ + public static int maxDisplayColumn; ++ ++ /** Is the biggest row used to display a achievement on the GUI. */ + public static int maxDisplayRow; +- public static List e = new ArrayList(); ++ ++ /** Holds a list of all registered achievements. */ ++ public static List achievementList = new ArrayList(); ++ ++ /** Is the 'open inventory' achievement. */ + public static Achievement openInventory = (new Achievement(0, "openInventory", 0, 0, Item.book, (Achievement)null)).setIndependent().registerAchievement(); ++ ++ /** Is the 'getting wood' achievement. */ + public static Achievement mineWood = (new Achievement(1, "mineWood", 2, 1, Block.wood, openInventory)).registerAchievement(); ++ ++ /** Is the 'benchmarking' achievement. */ + public static Achievement buildWorkBench = (new Achievement(2, "buildWorkBench", 4, -1, Block.workbench, mineWood)).registerAchievement(); ++ ++ /** Is the 'time to mine' achievement. */ + public static Achievement buildPickaxe = (new Achievement(3, "buildPickaxe", 4, 2, Item.pickaxeWood, buildWorkBench)).registerAchievement(); ++ ++ /** Is the 'hot topic' achievement. */ + public static Achievement buildFurnace = (new Achievement(4, "buildFurnace", 3, 4, Block.furnaceIdle, buildPickaxe)).registerAchievement(); ++ ++ /** Is the 'acquire hardware' achievement. */ + public static Achievement acquireIron = (new Achievement(5, "acquireIron", 1, 4, Item.ingotIron, buildFurnace)).registerAchievement(); ++ ++ /** Is the 'time to farm' achievement. */ + public static Achievement buildHoe = (new Achievement(6, "buildHoe", 2, -3, Item.hoeWood, buildWorkBench)).registerAchievement(); ++ ++ /** Is the 'bake bread' achievement. */ + public static Achievement makeBread = (new Achievement(7, "makeBread", -1, -3, Item.bread, buildHoe)).registerAchievement(); ++ ++ /** Is the 'the lie' achievement. */ + public static Achievement bakeCake = (new Achievement(8, "bakeCake", 0, -5, Item.cake, buildHoe)).registerAchievement(); ++ ++ /** Is the 'getting a upgrade' achievement. */ + public static Achievement buildBetterPickaxe = (new Achievement(9, "buildBetterPickaxe", 6, 2, Item.pickaxeStone, buildPickaxe)).registerAchievement(); ++ ++ /** Is the 'delicious fish' achievement. */ + public static Achievement cookFish = (new Achievement(10, "cookFish", 2, 6, Item.fishCooked, buildFurnace)).registerAchievement(); ++ ++ /** Is the 'on a rail' achievement */ + public static Achievement onARail = (new Achievement(11, "onARail", 2, 3, Block.rail, acquireIron)).setSpecial().registerAchievement(); ++ ++ /** Is the 'time to strike' achievement. */ + public static Achievement buildSword = (new Achievement(12, "buildSword", 6, -1, Item.swordWood, buildWorkBench)).registerAchievement(); ++ ++ /** Is the 'monster hunter' achievement. */ + public static Achievement killEnemy = (new Achievement(13, "killEnemy", 8, -1, Item.bone, buildSword)).registerAchievement(); ++ ++ /** is the 'cow tipper' achievement. */ + public static Achievement killCow = (new Achievement(14, "killCow", 7, -3, Item.leather, buildSword)).registerAchievement(); ++ ++ /** Is the 'when pig fly' achievement. */ + public static Achievement flyPig = (new Achievement(15, "flyPig", 8, -4, Item.saddle, killCow)).setSpecial().registerAchievement(); ++ ++ /** The achievement for killing a Skeleton from 50 meters aways. */ + public static Achievement snipeSkeleton = (new Achievement(16, "snipeSkeleton", 7, 0, Item.bow, killEnemy)).setSpecial().registerAchievement(); ++ ++ /** Is the 'DIAMONDS!' achievement */ + public static Achievement diamonds = (new Achievement(17, "diamonds", -1, 5, Item.diamond, acquireIron)).registerAchievement(); ++ ++ /** Is the 'We Need to Go Deeper' achievement */ + public static Achievement portal = (new Achievement(18, "portal", -1, 7, Block.obsidian, diamonds)).registerAchievement(); ++ ++ /** Is the 'Return to Sender' achievement */ + public static Achievement ghast = (new Achievement(19, "ghast", -4, 8, Item.ghastTear, portal)).setSpecial().registerAchievement(); ++ ++ /** Is the 'Into Fire' achievement */ + public static Achievement blazeRod = (new Achievement(20, "blazeRod", 0, 9, Item.blazeRod, portal)).registerAchievement(); ++ ++ /** Is the 'Local Brewery' achievement */ + public static Achievement potion = (new Achievement(21, "potion", 2, 8, Item.potion, blazeRod)).registerAchievement(); ++ ++ /** Is the 'The End?' achievement */ + public static Achievement theEnd = (new Achievement(22, "theEnd", 3, 10, Item.eyeOfEnder, blazeRod)).setSpecial().registerAchievement(); ++ ++ /** Is the 'The End.' achievement */ + public static Achievement theEnd2 = (new Achievement(23, "theEnd2", 4, 13, Block.dragonEgg, theEnd)).setSpecial().registerAchievement(); ++ ++ /** Is the 'Enchanter' achievement */ + public static Achievement enchantments = (new Achievement(24, "enchantments", -4, 4, Block.enchantmentTable, diamonds)).registerAchievement(); + public static Achievement overkill = (new Achievement(25, "overkill", -4, 1, Item.swordDiamond, enchantments)).setSpecial().registerAchievement(); ++ ++ /** Is the 'Librarian' achievement */ + public static Achievement bookcase = (new Achievement(26, "bookcase", -3, 6, Block.bookShelf, enchantments)).registerAchievement(); + +- public static void init() { +- } ++ /** ++ * A stub functions called to make the static initializer for this class run. ++ */ ++ public static void init() {} + } diff --git a/patches/net/minecraft/src/AchievementMap.java.patch b/patches/net/minecraft/src/AchievementMap.java.patch new file mode 100644 index 0000000..795326c --- /dev/null +++ b/patches/net/minecraft/src/AchievementMap.java.patch @@ -0,0 +1,50 @@ +--- net/minecraft/src/AchievementMap.java ++++ net/minecraft/src/AchievementMap.java +@@ -6,31 +6,34 @@ + import java.util.Map; + + public class AchievementMap { ++ ++ /** Holds the singleton instance of AchievementMap. */ + public static AchievementMap instance = new AchievementMap(); +- private Map b = new HashMap(); ++ ++ /** Maps a achievement id with it's unique GUID. */ ++ private Map guidMap = new HashMap(); + + private AchievementMap() { + try { + BufferedReader var1 = new BufferedReader(new InputStreamReader(AchievementMap.class.getResourceAsStream("/achievement/map.txt"))); +- +- while(true) { +- String var2 = var1.readLine(); +- if(var2 == null) { +- var1.close(); +- break; +- } +- ++ String var2; ++ ++ while ((var2 = var1.readLine()) != null) { + String[] var3 = var2.split(","); + int var4 = Integer.parseInt(var3[0]); +- this.b.put(Integer.valueOf(var4), var3[1]); ++ this.guidMap.put(Integer.valueOf(var4), var3[1]); + } ++ ++ var1.close(); + } catch (Exception var5) { + var5.printStackTrace(); + } +- + } + +- public static String getGuid(int var0) { +- return (String)instance.b.get(Integer.valueOf(var0)); ++ /** ++ * Returns the unique GUID of a achievement id. ++ */ ++ public static String getGuid(int par0) { ++ return (String)instance.guidMap.get(Integer.valueOf(par0)); + } + } diff --git a/patches/net/minecraft/src/ActiveRenderInfo.java.patch b/patches/net/minecraft/src/ActiveRenderInfo.java.patch new file mode 100644 index 0000000..2864b44 --- /dev/null +++ b/patches/net/minecraft/src/ActiveRenderInfo.java.patch @@ -0,0 +1,143 @@ +--- net/minecraft/src/ActiveRenderInfo.java ++++ net/minecraft/src/ActiveRenderInfo.java +@@ -2,36 +2,76 @@ + + import java.nio.FloatBuffer; + import java.nio.IntBuffer; ++ + import org.lwjgl.opengl.GL11; + import org.lwjgl.util.glu.GLU; + + public class ActiveRenderInfo { ++ ++ /** The calculated view object X coordinate */ + public static float objectX; ++ ++ /** The calculated view object Y coordinate */ + public static float objectY; ++ ++ /** The calculated view object Z coordinate */ + public static float objectZ; +- private static IntBuffer i = GLAllocation.createDirectIntBuffer(16); +- private static FloatBuffer j = GLAllocation.createDirectFloatBuffer(16); +- private static FloatBuffer k = GLAllocation.createDirectFloatBuffer(16); +- private static FloatBuffer l = GLAllocation.createDirectFloatBuffer(3); ++ ++ /** The current GL viewport */ ++ private static IntBuffer viewport = GLAllocation.createDirectIntBuffer(16); ++ ++ /** The current GL modelview matrix */ ++ private static FloatBuffer modelview = GLAllocation.createDirectFloatBuffer(16); ++ ++ /** The current GL projection matrix */ ++ private static FloatBuffer projection = GLAllocation.createDirectFloatBuffer(16); ++ ++ /** The computed view object coordinates */ ++ private static FloatBuffer objectCoords = GLAllocation.createDirectFloatBuffer(3); ++ ++ /** The X component of the entity's yaw rotation */ + public static float rotationX; ++ ++ /** The combined X and Z components of the entity's pitch rotation */ + public static float rotationXZ; ++ ++ /** The Z component of the entity's yaw rotation */ + public static float rotationZ; ++ ++ /** ++ * The Y component (scaled along the Z axis) of the entity's pitch rotation ++ */ + public static float rotationYZ; ++ ++ /** ++ * The Y component (scaled along the X axis) of the entity's pitch rotation ++ */ + public static float rotationXY; ++ // Spout Start ++ public static FloatBuffer modelMatrix; ++ public static FloatBuffer projectionMatrix; ++ // Spout End + +- public static void updateRenderInfo(EntityPlayer var0, boolean var1) { +- GL11.glGetFloat(GL11.GL_MODELVIEW_MATRIX, j); +- GL11.glGetFloat(GL11.GL_PROJECTION_MATRIX, k); +- GL11.glGetInteger(GL11.GL_VIEWPORT, i); +- float var2 = (float)((i.get(0) + i.get(2)) / 2); +- float var3 = (float)((i.get(1) + i.get(3)) / 2); +- GLU.gluUnProject(var2, var3, 0.0F, j, k, i, l); +- objectX = l.get(0); +- objectY = l.get(1); +- objectZ = l.get(2); +- int var4 = var1 ? 1 : 0; +- float var5 = var0.rotationPitch; +- float var6 = var0.rotationYaw; ++ /** ++ * Updates the current render info and camera location based on entity look angles and 1st/3rd person view mode ++ */ ++ public static void updateRenderInfo(EntityPlayer par0EntityPlayer, boolean par1) { ++ GL11.glGetFloat(GL11.GL_MODELVIEW_MATRIX, modelview); ++ GL11.glGetFloat(GL11.GL_PROJECTION_MATRIX, projection); ++ // Spout Start ++ modelMatrix = modelview.duplicate(); ++ projectionMatrix = projection.duplicate(); ++ // Spout End ++ GL11.glGetInteger(GL11.GL_VIEWPORT, viewport); ++ float var2 = (float)((viewport.get(0) + viewport.get(2)) / 2); ++ float var3 = (float)((viewport.get(1) + viewport.get(3)) / 2); ++ GLU.gluUnProject(var2, var3, 0.0F, modelview, projection, viewport, objectCoords); ++ objectX = objectCoords.get(0); ++ objectY = objectCoords.get(1); ++ objectZ = objectCoords.get(2); ++ int var4 = par1 ? 1 : 0; ++ float var5 = par0EntityPlayer.rotationPitch; ++ float var6 = par0EntityPlayer.rotationYaw; + rotationX = MathHelper.cos(var6 * (float)Math.PI / 180.0F) * (float)(1 - var4 * 2); + rotationZ = MathHelper.sin(var6 * (float)Math.PI / 180.0F) * (float)(1 - var4 * 2); + rotationYZ = -rotationZ * MathHelper.sin(var5 * (float)Math.PI / 180.0F) * (float)(1 - var4 * 2); +@@ -39,25 +79,34 @@ + rotationXZ = MathHelper.cos(var5 * (float)Math.PI / 180.0F); + } + +- public static Vec3 projectViewFromEntity(EntityLivingBase var0, double var1) { +- double var3 = var0.prevPosX + (var0.posX - var0.prevPosX) * var1; +- double var5 = var0.prevPosY + (var0.posY - var0.prevPosY) * var1 + (double)var0.getEyeHeight(); +- double var7 = var0.prevPosZ + (var0.posZ - var0.prevPosZ) * var1; ++ /** ++ * Returns a vector representing the projection along the given entity's view for the given distance ++ */ ++ public static Vec3 projectViewFromEntity(EntityLivingBase par0EntityLivingBase, double par1) { ++ double var3 = par0EntityLivingBase.prevPosX + (par0EntityLivingBase.posX - par0EntityLivingBase.prevPosX) * par1; ++ double var5 = par0EntityLivingBase.prevPosY + (par0EntityLivingBase.posY - par0EntityLivingBase.prevPosY) * par1 + (double)par0EntityLivingBase.getEyeHeight(); ++ double var7 = par0EntityLivingBase.prevPosZ + (par0EntityLivingBase.posZ - par0EntityLivingBase.prevPosZ) * par1; + double var9 = var3 + (double)(objectX * 1.0F); + double var11 = var5 + (double)(objectY * 1.0F); + double var13 = var7 + (double)(objectZ * 1.0F); +- return var0.worldObj.getWorldVec3Pool().getVecFromPool(var9, var11, var13); ++ return par0EntityLivingBase.worldObj.getWorldVec3Pool().getVecFromPool(var9, var11, var13); + } + +- public static int getBlockIdAtEntityViewpoint(World var0, EntityLivingBase var1, float var2) { +- Vec3 var3 = projectViewFromEntity(var1, (double)var2); ++ /** ++ * Returns the block ID at the current camera location (either air or fluid), taking into account the height of fluid ++ * blocks ++ */ ++ public static int getBlockIdAtEntityViewpoint(World par0World, EntityLivingBase par1EntityLivingBase, float par2) { ++ Vec3 var3 = projectViewFromEntity(par1EntityLivingBase, (double)par2); + ChunkPosition var4 = new ChunkPosition(var3); +- int var5 = var0.getBlockId(var4.x, var4.y, var4.z); +- if(var5 != 0 && Block.blocksList[var5].blockMaterial.isLiquid()) { +- float var6 = BlockFluid.getFluidHeightPercent(var0.getBlockMetadata(var4.x, var4.y, var4.z)) - 1.0F / 9.0F; ++ int var5 = par0World.getBlockId(var4.x, var4.y, var4.z); ++ ++ if (var5 != 0 && Block.blocksList[var5].blockMaterial.isLiquid()) { ++ float var6 = BlockFluid.getFluidHeightPercent(par0World.getBlockMetadata(var4.x, var4.y, var4.z)) - 0.11111111F; + float var7 = (float)(var4.y + 1) - var6; +- if(var3.yCoord >= (double)var7) { +- var5 = var0.getBlockId(var4.x, var4.y + 1, var4.z); ++ ++ if (var3.yCoord >= (double)var7) { ++ var5 = par0World.getBlockId(var4.x, var4.y + 1, var4.z); + } + } + diff --git a/patches/net/minecraft/src/AnimalChest.java.patch b/patches/net/minecraft/src/AnimalChest.java.patch new file mode 100644 index 0000000..3ed9622 --- /dev/null +++ b/patches/net/minecraft/src/AnimalChest.java.patch @@ -0,0 +1,18 @@ +--- net/minecraft/src/AnimalChest.java ++++ net/minecraft/src/AnimalChest.java +@@ -1,11 +1,11 @@ + package net.minecraft.src; + + public class AnimalChest extends InventoryBasic { +- public AnimalChest(String var1, int var2) { +- super(var1, false, var2); ++ public AnimalChest(String par1Str, int par2) { ++ super(par1Str, false, par2); + } + +- public AnimalChest(String var1, boolean var2, int var3) { +- super(var1, var2, var3); ++ public AnimalChest(String par1Str, boolean par2, int par3) { ++ super(par1Str, par2, par3); + } + } diff --git a/patches/net/minecraft/src/AnimationFrame.java.patch b/patches/net/minecraft/src/AnimationFrame.java.patch new file mode 100644 index 0000000..5d23e1c --- /dev/null +++ b/patches/net/minecraft/src/AnimationFrame.java.patch @@ -0,0 +1,21 @@ +--- net/minecraft/src/AnimationFrame.java ++++ net/minecraft/src/AnimationFrame.java +@@ -4,13 +4,13 @@ + private final int frameIndex; + private final int frameTime; + +- public AnimationFrame(int var1) { +- this(var1, -1); ++ public AnimationFrame(int par1) { ++ this(par1, -1); + } + +- public AnimationFrame(int var1, int var2) { +- this.frameIndex = var1; +- this.frameTime = var2; ++ public AnimationFrame(int par1, int par2) { ++ this.frameIndex = par1; ++ this.frameTime = par2; + } + + public boolean hasNoTime() { diff --git a/patches/net/minecraft/src/AnimationMetadataSection.java.patch b/patches/net/minecraft/src/AnimationMetadataSection.java.patch new file mode 100644 index 0000000..8a77436 --- /dev/null +++ b/patches/net/minecraft/src/AnimationMetadataSection.java.patch @@ -0,0 +1,72 @@ +--- net/minecraft/src/AnimationMetadataSection.java ++++ net/minecraft/src/AnimationMetadataSection.java +@@ -7,16 +7,16 @@ + import java.util.Set; + + public class AnimationMetadataSection implements MetadataSection { +- private final List a; ++ private final List animationFrames; + private final int frameWidth; + private final int frameHeight; + private final int frameTime; + +- public AnimationMetadataSection(List var1, int var2, int var3, int var4) { +- this.a = var1; +- this.frameWidth = var2; +- this.frameHeight = var3; +- this.frameTime = var4; ++ public AnimationMetadataSection(List par1List, int par2, int par3, int par4) { ++ this.animationFrames = par1List; ++ this.frameWidth = par2; ++ this.frameHeight = par3; ++ this.frameTime = par4; + } + + public int getFrameHeight() { +@@ -28,35 +28,35 @@ + } + + public int getFrameCount() { +- return this.a.size(); ++ return this.animationFrames.size(); + } + + public int getFrameTime() { + return this.frameTime; + } + +- private AnimationFrame getAnimationFrame(int var1) { +- return (AnimationFrame)this.a.get(var1); ++ private AnimationFrame getAnimationFrame(int par1) { ++ return (AnimationFrame)this.animationFrames.get(par1); + } + +- public int getFrameTimeSingle(int var1) { +- AnimationFrame var2 = this.getAnimationFrame(var1); ++ public int getFrameTimeSingle(int par1) { ++ AnimationFrame var2 = this.getAnimationFrame(par1); + return var2.hasNoTime() ? this.frameTime : var2.getFrameTime(); + } + +- public boolean frameHasTime(int var1) { +- return !((AnimationFrame)this.a.get(var1)).hasNoTime(); ++ public boolean frameHasTime(int par1) { ++ return !((AnimationFrame)this.animationFrames.get(par1)).hasNoTime(); + } + +- public int getFrameIndex(int var1) { +- return ((AnimationFrame)this.a.get(var1)).getFrameIndex(); ++ public int getFrameIndex(int par1) { ++ return ((AnimationFrame)this.animationFrames.get(par1)).getFrameIndex(); + } + + public Set getFrameIndexSet() { + HashSet var1 = Sets.newHashSet(); +- Iterator var2 = this.a.iterator(); ++ Iterator var2 = this.animationFrames.iterator(); + +- while(var2.hasNext()) { ++ while (var2.hasNext()) { + AnimationFrame var3 = (AnimationFrame)var2.next(); + var1.add(Integer.valueOf(var3.getFrameIndex())); + } diff --git a/patches/net/minecraft/src/AnimationMetadataSectionSerializer.java.patch b/patches/net/minecraft/src/AnimationMetadataSectionSerializer.java.patch new file mode 100644 index 0000000..da7bd59 --- /dev/null +++ b/patches/net/minecraft/src/AnimationMetadataSectionSerializer.java.patch @@ -0,0 +1,123 @@ +--- net/minecraft/src/AnimationMetadataSectionSerializer.java ++++ net/minecraft/src/AnimationMetadataSectionSerializer.java +@@ -13,19 +13,21 @@ + import java.util.ArrayList; + + public class AnimationMetadataSectionSerializer extends BaseMetadataSectionSerializer implements JsonSerializer { +- public AnimationMetadataSection func_110493_a(JsonElement var1, Type var2, JsonDeserializationContext var3) { ++ public AnimationMetadataSection func_110493_a(JsonElement par1JsonElement, Type par2Type, JsonDeserializationContext par3JsonDeserializationContext) { + ArrayList var4 = Lists.newArrayList(); +- JsonObject var5 = (JsonObject)var1; ++ JsonObject var5 = (JsonObject)par1JsonElement; + int var6 = this.func_110485_a(var5.get("frametime"), "frametime", Integer.valueOf(1), 1, Integer.MAX_VALUE); + int var8; +- if(var5.has("frames")) { ++ ++ if (var5.has("frames")) { + try { + JsonArray var7 = var5.getAsJsonArray("frames"); + +- for(var8 = 0; var8 < var7.size(); ++var8) { ++ for (var8 = 0; var8 < var7.size(); ++var8) { + JsonElement var9 = var7.get(var8); + AnimationFrame var10 = this.parseAnimationFrame(var8, var9); +- if(var10 != null) { ++ ++ if (var10 != null) { + var4.add(var10); + } + } +@@ -39,45 +41,46 @@ + return new AnimationMetadataSection(var4, var12, var8, var6); + } + +- private AnimationFrame parseAnimationFrame(int var1, JsonElement var2) { +- if(var2.isJsonPrimitive()) { ++ private AnimationFrame parseAnimationFrame(int par1, JsonElement par2JsonElement) { ++ if (par2JsonElement.isJsonPrimitive()) { + try { +- return new AnimationFrame(var2.getAsInt()); ++ return new AnimationFrame(par2JsonElement.getAsInt()); + } catch (NumberFormatException var6) { +- throw new JsonParseException("Invalid animation->frames->" + var1 + ": expected number, was " + var2, var6); ++ throw new JsonParseException("Invalid animation->frames->" + par1 + ": expected number, was " + par2JsonElement, var6); + } +- } else if(var2.isJsonObject()) { +- JsonObject var3 = var2.getAsJsonObject(); +- int var4 = this.func_110485_a(var3.get("time"), "frames->" + var1 + "->time", Integer.valueOf(-1), 1, Integer.MAX_VALUE); +- int var5 = this.func_110485_a(var3.get("index"), "frames->" + var1 + "->index", (Integer)null, 0, Integer.MAX_VALUE); ++ } else if (par2JsonElement.isJsonObject()) { ++ JsonObject var3 = par2JsonElement.getAsJsonObject(); ++ int var4 = this.func_110485_a(var3.get("time"), "frames->" + par1 + "->time", Integer.valueOf(-1), 1, Integer.MAX_VALUE); ++ int var5 = this.func_110485_a(var3.get("index"), "frames->" + par1 + "->index", (Integer)null, 0, Integer.MAX_VALUE); + return new AnimationFrame(var5, var4); + } else { + return null; + } + } + +- public JsonElement func_110491_a(AnimationMetadataSection var1, Type var2, JsonSerializationContext var3) { ++ public JsonElement func_110491_a(AnimationMetadataSection par1AnimationMetadataSection, Type par2Type, JsonSerializationContext par3JsonSerializationContext) { + JsonObject var4 = new JsonObject(); +- var4.addProperty("frametime", (Number)Integer.valueOf(var1.getFrameTime())); +- if(var1.getFrameWidth() != -1) { +- var4.addProperty("width", (Number)Integer.valueOf(var1.getFrameWidth())); +- } +- +- if(var1.getFrameHeight() != -1) { +- var4.addProperty("height", (Number)Integer.valueOf(var1.getFrameHeight())); +- } +- +- if(var1.getFrameCount() > 0) { ++ var4.addProperty("frametime", Integer.valueOf(par1AnimationMetadataSection.getFrameTime())); ++ ++ if (par1AnimationMetadataSection.getFrameWidth() != -1) { ++ var4.addProperty("width", Integer.valueOf(par1AnimationMetadataSection.getFrameWidth())); ++ } ++ ++ if (par1AnimationMetadataSection.getFrameHeight() != -1) { ++ var4.addProperty("height", Integer.valueOf(par1AnimationMetadataSection.getFrameHeight())); ++ } ++ ++ if (par1AnimationMetadataSection.getFrameCount() > 0) { + JsonArray var5 = new JsonArray(); + +- for(int var6 = 0; var6 < var1.getFrameCount(); ++var6) { +- if(var1.frameHasTime(var6)) { ++ for (int var6 = 0; var6 < par1AnimationMetadataSection.getFrameCount(); ++var6) { ++ if (par1AnimationMetadataSection.frameHasTime(var6)) { + JsonObject var7 = new JsonObject(); +- var7.addProperty("index", (Number)Integer.valueOf(var1.getFrameIndex(var6))); +- var7.addProperty("time", (Number)Integer.valueOf(var1.getFrameTimeSingle(var6))); ++ var7.addProperty("index", Integer.valueOf(par1AnimationMetadataSection.getFrameIndex(var6))); ++ var7.addProperty("time", Integer.valueOf(par1AnimationMetadataSection.getFrameTimeSingle(var6))); + var5.add(var7); + } else { +- var5.add(new JsonPrimitive(Integer.valueOf(var1.getFrameIndex(var6)))); ++ var5.add(new JsonPrimitive(Integer.valueOf(par1AnimationMetadataSection.getFrameIndex(var6)))); + } + } + +@@ -87,15 +90,18 @@ + return var4; + } + ++ /** ++ * The name of this section type as it appears in JSON. ++ */ + public String getSectionName() { + return "animation"; + } + +- public Object deserialize(JsonElement var1, Type var2, JsonDeserializationContext var3) { +- return this.func_110493_a(var1, var2, var3); ++ public Object deserialize(JsonElement par1JsonElement, Type par2Type, JsonDeserializationContext par3JsonDeserializationContext) { ++ return this.func_110493_a(par1JsonElement, par2Type, par3JsonDeserializationContext); + } + +- public JsonElement serialize(Object var1, Type var2, JsonSerializationContext var3) { +- return this.func_110491_a((AnimationMetadataSection)var1, var2, var3); ++ public JsonElement serialize(Object par1Obj, Type par2Type, JsonSerializationContext par3JsonSerializationContext) { ++ return this.func_110491_a((AnimationMetadataSection)par1Obj, par2Type, par3JsonSerializationContext); + } + } diff --git a/patches/net/minecraft/src/AnvilChunkLoader.java.patch b/patches/net/minecraft/src/AnvilChunkLoader.java.patch new file mode 100644 index 0000000..2071ae1 --- /dev/null +++ b/patches/net/minecraft/src/AnvilChunkLoader.java.patch @@ -0,0 +1,473 @@ +--- net/minecraft/src/AnvilChunkLoader.java ++++ net/minecraft/src/AnvilChunkLoader.java +@@ -1,8 +1,6 @@ + package net.minecraft.src; + +-import java.io.DataInput; + import java.io.DataInputStream; +-import java.io.DataOutput; + import java.io.DataOutputStream; + import java.io.File; + import java.io.IOException; +@@ -13,108 +11,123 @@ + import java.util.Set; + + public class AnvilChunkLoader implements IChunkLoader, IThreadedFileIO { +- private List a = new ArrayList(); +- private Set b = new HashSet(); +- private Object c = new Object(); +- private final File d; +- +- public AnvilChunkLoader(File var1) { +- this.d = var1; ++ private List chunksToRemove = new ArrayList(); ++ private Set pendingAnvilChunksCoordinates = new HashSet(); ++ private Object syncLockObject = new Object(); ++ ++ /** Save directory for chunks using the Anvil format */ ++ private final File chunkSaveLocation; ++ ++ public AnvilChunkLoader(File par1File) { ++ this.chunkSaveLocation = par1File; + } + +- public Chunk loadChunk(World var1, int var2, int var3) throws IOException { ++ /** ++ * Loads the specified(XZ) chunk into the specified world. ++ */ ++ public Chunk loadChunk(World par1World, int par2, int par3) throws IOException { + NBTTagCompound var4 = null; +- ChunkCoordIntPair var5 = new ChunkCoordIntPair(var2, var3); +- Object var6 = this.c; +- synchronized(var6) { +- if(this.b.contains(var5)) { +- for(int var7 = 0; var7 < this.a.size(); ++var7) { +- if(((AnvilChunkLoaderPending)this.a.get(var7)).chunkCoordinate.equals(var5)) { +- var4 = ((AnvilChunkLoaderPending)this.a.get(var7)).nbtTags; ++ ChunkCoordIntPair var5 = new ChunkCoordIntPair(par2, par3); ++ Object var6 = this.syncLockObject; ++ ++ synchronized (this.syncLockObject) { ++ if (this.pendingAnvilChunksCoordinates.contains(var5)) { ++ for (int var7 = 0; var7 < this.chunksToRemove.size(); ++var7) { ++ if (((AnvilChunkLoaderPending)this.chunksToRemove.get(var7)).chunkCoordinate.equals(var5)) { ++ var4 = ((AnvilChunkLoaderPending)this.chunksToRemove.get(var7)).nbtTags; + break; + } + } + } + } + +- if(var4 == null) { +- DataInputStream var10 = RegionFileCache.getChunkInputStream(this.d, var2, var3); +- if(var10 == null) { ++ if (var4 == null) { ++ DataInputStream var10 = RegionFileCache.getChunkInputStream(this.chunkSaveLocation, par2, par3); ++ ++ if (var10 == null) { + return null; + } + +- var4 = CompressedStreamTools.read((DataInput)var10); ++ var4 = CompressedStreamTools.read(var10); + } + +- return this.checkedReadChunkFromNBT(var1, var2, var3, var4); ++ return this.checkedReadChunkFromNBT(par1World, par2, par3, var4); + } + +- protected Chunk checkedReadChunkFromNBT(World var1, int var2, int var3, NBTTagCompound var4) { +- if(!var4.hasKey("Level")) { +- var1.getWorldLogAgent().logSevere("Chunk file at " + var2 + "," + var3 + " is missing level data, skipping"); ++ /** ++ * Wraps readChunkFromNBT. Checks the coordinates and several NBT tags. ++ */ ++ protected Chunk checkedReadChunkFromNBT(World par1World, int par2, int par3, NBTTagCompound par4NBTTagCompound) { ++ if (!par4NBTTagCompound.hasKey("Level")) { ++ par1World.getWorldLogAgent().logSevere("Chunk file at " + par2 + "," + par3 + " is missing level data, skipping"); + return null; +- } else if(!var4.getCompoundTag("Level").hasKey("Sections")) { +- var1.getWorldLogAgent().logSevere("Chunk file at " + var2 + "," + var3 + " is missing block data, skipping"); ++ } else if (!par4NBTTagCompound.getCompoundTag("Level").hasKey("Sections")) { ++ par1World.getWorldLogAgent().logSevere("Chunk file at " + par2 + "," + par3 + " is missing block data, skipping"); + return null; + } else { +- Chunk var5 = this.readChunkFromNBT(var1, var4.getCompoundTag("Level")); +- if(!var5.isAtLocation(var2, var3)) { +- var1.getWorldLogAgent().logSevere("Chunk file at " + var2 + "," + var3 + " is in the wrong location; relocating. (Expected " + var2 + ", " + var3 + ", got " + var5.xPosition + ", " + var5.zPosition + ")"); +- var4.setInteger("xPos", var2); +- var4.setInteger("zPos", var3); +- var5 = this.readChunkFromNBT(var1, var4.getCompoundTag("Level")); ++ Chunk var5 = this.readChunkFromNBT(par1World, par4NBTTagCompound.getCompoundTag("Level")); ++ ++ if (!var5.isAtLocation(par2, par3)) { ++ par1World.getWorldLogAgent().logSevere("Chunk file at " + par2 + "," + par3 + " is in the wrong location; relocating. (Expected " + par2 + ", " + par3 + ", got " + var5.xPosition + ", " + var5.zPosition + ")"); ++ par4NBTTagCompound.setInteger("xPos", par2); ++ par4NBTTagCompound.setInteger("zPos", par3); ++ var5 = this.readChunkFromNBT(par1World, par4NBTTagCompound.getCompoundTag("Level")); + } + + return var5; + } + } + +- public void saveChunk(World var1, Chunk var2) throws IOException, MinecraftException { +- var1.checkSessionLock(); ++ public void saveChunk(World par1World, Chunk par2Chunk) throws MinecraftException, IOException { ++ par1World.checkSessionLock(); + + try { + NBTTagCompound var3 = new NBTTagCompound(); + NBTTagCompound var4 = new NBTTagCompound(); + var3.setTag("Level", var4); +- this.writeChunkToNBT(var2, var1, var4); +- this.addChunkToPending(var2.getChunkCoordIntPair(), var3); ++ this.writeChunkToNBT(par2Chunk, par1World, var4); ++ this.addChunkToPending(par2Chunk.getChunkCoordIntPair(), var3); + } catch (Exception var5) { + var5.printStackTrace(); + } +- + } + +- protected void addChunkToPending(ChunkCoordIntPair var1, NBTTagCompound var2) { +- Object var3 = this.c; +- synchronized(var3) { +- if(this.b.contains(var1)) { +- for(int var4 = 0; var4 < this.a.size(); ++var4) { +- if(((AnvilChunkLoaderPending)this.a.get(var4)).chunkCoordinate.equals(var1)) { +- this.a.set(var4, new AnvilChunkLoaderPending(var1, var2)); ++ protected void addChunkToPending(ChunkCoordIntPair par1ChunkCoordIntPair, NBTTagCompound par2NBTTagCompound) { ++ Object var3 = this.syncLockObject; ++ ++ synchronized (this.syncLockObject) { ++ if (this.pendingAnvilChunksCoordinates.contains(par1ChunkCoordIntPair)) { ++ for (int var4 = 0; var4 < this.chunksToRemove.size(); ++var4) { ++ if (((AnvilChunkLoaderPending)this.chunksToRemove.get(var4)).chunkCoordinate.equals(par1ChunkCoordIntPair)) { ++ this.chunksToRemove.set(var4, new AnvilChunkLoaderPending(par1ChunkCoordIntPair, par2NBTTagCompound)); + return; + } + } + } + +- this.a.add(new AnvilChunkLoaderPending(var1, var2)); +- this.b.add(var1); ++ this.chunksToRemove.add(new AnvilChunkLoaderPending(par1ChunkCoordIntPair, par2NBTTagCompound)); ++ this.pendingAnvilChunksCoordinates.add(par1ChunkCoordIntPair); + ThreadedFileIOBase.threadedIOInstance.queueIO(this); + } + } + ++ /** ++ * Returns a boolean stating if the write was unsuccessful. ++ */ + public boolean writeNextIO() { + AnvilChunkLoaderPending var1 = null; +- Object var2 = this.c; +- synchronized(var2) { +- if(this.a.isEmpty()) { ++ Object var2 = this.syncLockObject; ++ ++ synchronized (this.syncLockObject) { ++ if (this.chunksToRemove.isEmpty()) { + return false; + } + +- var1 = (AnvilChunkLoaderPending)this.a.remove(0); +- this.b.remove(var1.chunkCoordinate); ++ var1 = (AnvilChunkLoaderPending)this.chunksToRemove.remove(0); ++ this.pendingAnvilChunksCoordinates.remove(var1.chunkCoordinate); + } + +- if(var1 != null) { ++ if (var1 != null) { + try { + this.writeChunkNBTTags(var1); + } catch (Exception var4) { +@@ -125,51 +138,67 @@ + return true; + } + +- private void writeChunkNBTTags(AnvilChunkLoaderPending var1) throws IOException { +- DataOutputStream var2 = RegionFileCache.getChunkOutputStream(this.d, var1.chunkCoordinate.chunkXPos, var1.chunkCoordinate.chunkZPos); +- CompressedStreamTools.write(var1.nbtTags, (DataOutput)var2); ++ private void writeChunkNBTTags(AnvilChunkLoaderPending par1AnvilChunkLoaderPending) throws IOException { ++ DataOutputStream var2 = RegionFileCache.getChunkOutputStream(this.chunkSaveLocation, par1AnvilChunkLoaderPending.chunkCoordinate.chunkXPos, par1AnvilChunkLoaderPending.chunkCoordinate.chunkZPos); ++ CompressedStreamTools.write(par1AnvilChunkLoaderPending.nbtTags, var2); + var2.close(); + } + +- public void saveExtraChunkData(World var1, Chunk var2) { +- } +- +- public void chunkTick() { +- } +- ++ /** ++ * Save extra data associated with this Chunk not normally saved during autosave, only during chunk unload. Currently ++ * unused. ++ */ ++ public void saveExtraChunkData(World par1World, Chunk par2Chunk) {} ++ ++ /** ++ * Called every World.tick() ++ */ ++ public void chunkTick() {} ++ ++ /** ++ * Save extra data not associated with any Chunk. Not saved during autosave, only during world unload. Currently ++ * unused. ++ */ + public void saveExtraData() { +- while(this.writeNextIO()) { ++ while (this.writeNextIO()) { ++ ; + } +- + } + +- private void writeChunkToNBT(Chunk var1, World var2, NBTTagCompound var3) { +- var3.setInteger("xPos", var1.xPosition); +- var3.setInteger("zPos", var1.zPosition); +- var3.setLong("LastUpdate", var2.getTotalWorldTime()); +- var3.setIntArray("HeightMap", var1.heightMap); +- var3.setBoolean("TerrainPopulated", var1.isTerrainPopulated); +- var3.setLong("InhabitedTime", var1.inhabitedTime); +- ExtendedBlockStorage[] var4 = var1.getBlockStorageArray(); ++ /** ++ * Writes the Chunk passed as an argument to the NBTTagCompound also passed, using the World argument to retrieve the ++ * Chunk's last update time. ++ */ ++ private void writeChunkToNBT(Chunk par1Chunk, World par2World, NBTTagCompound par3NBTTagCompound) { ++ par3NBTTagCompound.setInteger("xPos", par1Chunk.xPosition); ++ par3NBTTagCompound.setInteger("zPos", par1Chunk.zPosition); ++ par3NBTTagCompound.setLong("LastUpdate", par2World.getTotalWorldTime()); ++ par3NBTTagCompound.setIntArray("HeightMap", par1Chunk.heightMap); ++ par3NBTTagCompound.setBoolean("TerrainPopulated", par1Chunk.isTerrainPopulated); ++ par3NBTTagCompound.setLong("InhabitedTime", par1Chunk.inhabitedTime); ++ ExtendedBlockStorage[] var4 = par1Chunk.getBlockStorageArray(); + NBTTagList var5 = new NBTTagList("Sections"); +- boolean var6 = !var2.provider.hasNoSky; ++ boolean var6 = !par2World.provider.hasNoSky; + ExtendedBlockStorage[] var7 = var4; + int var8 = var4.length; +- + NBTTagCompound var11; +- for(int var9 = 0; var9 < var8; ++var9) { ++ ++ for (int var9 = 0; var9 < var8; ++var9) { + ExtendedBlockStorage var10 = var7[var9]; +- if(var10 != null) { ++ ++ if (var10 != null) { + var11 = new NBTTagCompound(); + var11.setByte("Y", (byte)(var10.getYLocation() >> 4 & 255)); + var11.setByteArray("Blocks", var10.getBlockLSBArray()); +- if(var10.getBlockMSBArray() != null) { ++ ++ if (var10.getBlockMSBArray() != null) { + var11.setByteArray("Add", var10.getBlockMSBArray().data); + } + + var11.setByteArray("Data", var10.getMetadataArray().data); + var11.setByteArray("BlockLight", var10.getBlocklightArray().data); +- if(var6) { ++ ++ if (var6) { + var11.setByteArray("SkyLight", var10.getSkylightArray().data); + } else { + var11.setByteArray("SkyLight", new byte[var10.getBlocklightArray().data.length]); +@@ -179,44 +208,46 @@ + } + } + +- var3.setTag("Sections", var5); +- var3.setByteArray("Biomes", var1.getBiomeArray()); +- var1.hasEntities = false; ++ par3NBTTagCompound.setTag("Sections", var5); ++ par3NBTTagCompound.setByteArray("Biomes", par1Chunk.getBiomeArray()); ++ par1Chunk.hasEntities = false; + NBTTagList var16 = new NBTTagList(); +- + Iterator var18; +- for(var8 = 0; var8 < var1.j.length; ++var8) { +- var18 = var1.j[var8].iterator(); +- +- while(var18.hasNext()) { ++ ++ for (var8 = 0; var8 < par1Chunk.entityLists.length; ++var8) { ++ var18 = par1Chunk.entityLists[var8].iterator(); ++ ++ while (var18.hasNext()) { + Entity var20 = (Entity)var18.next(); + var11 = new NBTTagCompound(); +- if(var20.writeToNBTOptional(var11)) { +- var1.hasEntities = true; ++ ++ if (var20.writeToNBTOptional(var11)) { ++ par1Chunk.hasEntities = true; + var16.appendTag(var11); + } + } + } + +- var3.setTag("Entities", var16); ++ par3NBTTagCompound.setTag("Entities", var16); + NBTTagList var17 = new NBTTagList(); +- var18 = var1.i.values().iterator(); ++ var18 = par1Chunk.chunkTileEntityMap.values().iterator(); + +- while(var18.hasNext()) { ++ while (var18.hasNext()) { + TileEntity var21 = (TileEntity)var18.next(); + var11 = new NBTTagCompound(); + var21.writeToNBT(var11); + var17.appendTag(var11); + } + +- var3.setTag("TileEntities", var17); +- List var19 = var2.getPendingBlockUpdates(var1, false); +- if(var19 != null) { +- long var22 = var2.getTotalWorldTime(); ++ par3NBTTagCompound.setTag("TileEntities", var17); ++ List var19 = par2World.getPendingBlockUpdates(par1Chunk, false); ++ ++ if (var19 != null) { ++ long var22 = par2World.getTotalWorldTime(); + NBTTagList var12 = new NBTTagList(); + Iterator var13 = var19.iterator(); + +- while(var13.hasNext()) { ++ while (var13.hasNext()) { + NextTickListEntry var14 = (NextTickListEntry)var13.next(); + NBTTagCompound var15 = new NBTTagCompound(); + var15.setInteger("i", var14.blockID); +@@ -228,35 +259,40 @@ + var12.appendTag(var15); + } + +- var3.setTag("TileTicks", var12); ++ par3NBTTagCompound.setTag("TileTicks", var12); + } +- + } + +- private Chunk readChunkFromNBT(World var1, NBTTagCompound var2) { +- int var3 = var2.getInteger("xPos"); +- int var4 = var2.getInteger("zPos"); +- Chunk var5 = new Chunk(var1, var3, var4); +- var5.heightMap = var2.getIntArray("HeightMap"); +- var5.isTerrainPopulated = var2.getBoolean("TerrainPopulated"); +- var5.inhabitedTime = var2.getLong("InhabitedTime"); +- NBTTagList var6 = var2.getTagList("Sections"); ++ /** ++ * Reads the data stored in the passed NBTTagCompound and creates a Chunk with that data in the passed World. Returns ++ * the created Chunk. ++ */ ++ private Chunk readChunkFromNBT(World par1World, NBTTagCompound par2NBTTagCompound) { ++ int var3 = par2NBTTagCompound.getInteger("xPos"); ++ int var4 = par2NBTTagCompound.getInteger("zPos"); ++ Chunk var5 = new Chunk(par1World, var3, var4); ++ var5.heightMap = par2NBTTagCompound.getIntArray("HeightMap"); ++ var5.isTerrainPopulated = par2NBTTagCompound.getBoolean("TerrainPopulated"); ++ var5.inhabitedTime = par2NBTTagCompound.getLong("InhabitedTime"); ++ NBTTagList var6 = par2NBTTagCompound.getTagList("Sections"); + byte var7 = 16; + ExtendedBlockStorage[] var8 = new ExtendedBlockStorage[var7]; +- boolean var9 = !var1.provider.hasNoSky; ++ boolean var9 = !par1World.provider.hasNoSky; + +- for(int var10 = 0; var10 < var6.tagCount(); ++var10) { ++ for (int var10 = 0; var10 < var6.tagCount(); ++var10) { + NBTTagCompound var11 = (NBTTagCompound)var6.tagAt(var10); + byte var12 = var11.getByte("Y"); + ExtendedBlockStorage var13 = new ExtendedBlockStorage(var12 << 4, var9); + var13.setBlockLSBArray(var11.getByteArray("Blocks")); +- if(var11.hasKey("Add")) { ++ ++ if (var11.hasKey("Add")) { + var13.setBlockMSBArray(new NibbleArray(var11.getByteArray("Add"), 4)); + } + + var13.setBlockMetadataArray(new NibbleArray(var11.getByteArray("Data"), 4)); + var13.setBlocklightArray(new NibbleArray(var11.getByteArray("BlockLight"), 4)); +- if(var9) { ++ ++ if (var9) { + var13.setSkylightArray(new NibbleArray(var11.getByteArray("SkyLight"), 4)); + } + +@@ -265,23 +301,27 @@ + } + + var5.setStorageArrays(var8); +- if(var2.hasKey("Biomes")) { +- var5.setBiomeArray(var2.getByteArray("Biomes")); ++ ++ if (par2NBTTagCompound.hasKey("Biomes")) { ++ var5.setBiomeArray(par2NBTTagCompound.getByteArray("Biomes")); + } + +- NBTTagList var17 = var2.getTagList("Entities"); +- if(var17 != null) { +- for(int var18 = 0; var18 < var17.tagCount(); ++var18) { ++ NBTTagList var17 = par2NBTTagCompound.getTagList("Entities"); ++ ++ if (var17 != null) { ++ for (int var18 = 0; var18 < var17.tagCount(); ++var18) { + NBTTagCompound var20 = (NBTTagCompound)var17.tagAt(var18); +- Entity var22 = EntityList.createEntityFromNBT(var20, var1); ++ Entity var22 = EntityList.createEntityFromNBT(var20, par1World); + var5.hasEntities = true; +- if(var22 != null) { ++ ++ if (var22 != null) { + var5.addEntity(var22); + Entity var14 = var22; + +- for(NBTTagCompound var15 = var20; var15.hasKey("Riding"); var15 = var15.getCompoundTag("Riding")) { +- Entity var16 = EntityList.createEntityFromNBT(var15.getCompoundTag("Riding"), var1); +- if(var16 != null) { ++ for (NBTTagCompound var15 = var20; var15.hasKey("Riding"); var15 = var15.getCompoundTag("Riding")) { ++ Entity var16 = EntityList.createEntityFromNBT(var15.getCompoundTag("Riding"), par1World); ++ ++ if (var16 != null) { + var5.addEntity(var16); + var14.mountEntity(var16); + } +@@ -292,23 +332,26 @@ + } + } + +- NBTTagList var19 = var2.getTagList("TileEntities"); +- if(var19 != null) { +- for(int var21 = 0; var21 < var19.tagCount(); ++var21) { ++ NBTTagList var19 = par2NBTTagCompound.getTagList("TileEntities"); ++ ++ if (var19 != null) { ++ for (int var21 = 0; var21 < var19.tagCount(); ++var21) { + NBTTagCompound var24 = (NBTTagCompound)var19.tagAt(var21); + TileEntity var26 = TileEntity.createAndLoadEntity(var24); +- if(var26 != null) { ++ ++ if (var26 != null) { + var5.addTileEntity(var26); + } + } + } + +- if(var2.hasKey("TileTicks")) { +- NBTTagList var23 = var2.getTagList("TileTicks"); +- if(var23 != null) { +- for(int var25 = 0; var25 < var23.tagCount(); ++var25) { ++ if (par2NBTTagCompound.hasKey("TileTicks")) { ++ NBTTagList var23 = par2NBTTagCompound.getTagList("TileTicks"); ++ ++ if (var23 != null) { ++ for (int var25 = 0; var25 < var23.tagCount(); ++var25) { + NBTTagCompound var27 = (NBTTagCompound)var23.tagAt(var25); +- var1.scheduleBlockUpdateFromLoad(var27.getInteger("x"), var27.getInteger("y"), var27.getInteger("z"), var27.getInteger("i"), var27.getInteger("t"), var27.getInteger("p")); ++ par1World.scheduleBlockUpdateFromLoad(var27.getInteger("x"), var27.getInteger("y"), var27.getInteger("z"), var27.getInteger("i"), var27.getInteger("t"), var27.getInteger("p")); + } + } + } diff --git a/patches/net/minecraft/src/AnvilChunkLoaderPending.java.patch b/patches/net/minecraft/src/AnvilChunkLoaderPending.java.patch new file mode 100644 index 0000000..d2f8be1 --- /dev/null +++ b/patches/net/minecraft/src/AnvilChunkLoaderPending.java.patch @@ -0,0 +1,14 @@ +--- net/minecraft/src/AnvilChunkLoaderPending.java ++++ net/minecraft/src/AnvilChunkLoaderPending.java +@@ -4,8 +4,8 @@ + public final ChunkCoordIntPair chunkCoordinate; + public final NBTTagCompound nbtTags; + +- public AnvilChunkLoaderPending(ChunkCoordIntPair var1, NBTTagCompound var2) { +- this.chunkCoordinate = var1; +- this.nbtTags = var2; ++ public AnvilChunkLoaderPending(ChunkCoordIntPair par1ChunkCoordIntPair, NBTTagCompound par2NBTTagCompound) { ++ this.chunkCoordinate = par1ChunkCoordIntPair; ++ this.nbtTags = par2NBTTagCompound; + } + } diff --git a/patches/net/minecraft/src/AnvilConverterData.java.patch b/patches/net/minecraft/src/AnvilConverterData.java.patch new file mode 100644 index 0000000..57e943f --- /dev/null +++ b/patches/net/minecraft/src/AnvilConverterData.java.patch @@ -0,0 +1,14 @@ +--- net/minecraft/src/AnvilConverterData.java ++++ net/minecraft/src/AnvilConverterData.java +@@ -14,8 +14,8 @@ + public final int x; + public final int z; + +- public AnvilConverterData(int var1, int var2) { +- this.x = var1; +- this.z = var2; ++ public AnvilConverterData(int par1, int par2) { ++ this.x = par1; ++ this.z = par2; + } + } diff --git a/patches/net/minecraft/src/AnvilConverterException.java.patch b/patches/net/minecraft/src/AnvilConverterException.java.patch new file mode 100644 index 0000000..a9f7e4f --- /dev/null +++ b/patches/net/minecraft/src/AnvilConverterException.java.patch @@ -0,0 +1,12 @@ +--- net/minecraft/src/AnvilConverterException.java ++++ net/minecraft/src/AnvilConverterException.java +@@ -1,7 +1,7 @@ + package net.minecraft.src; + + public class AnvilConverterException extends Exception { +- public AnvilConverterException(String var1) { +- super(var1); ++ public AnvilConverterException(String par1Str) { ++ super(par1Str); + } + } diff --git a/patches/net/minecraft/src/AnvilSaveConverter.java.patch b/patches/net/minecraft/src/AnvilSaveConverter.java.patch new file mode 100644 index 0000000..0d62f59 --- /dev/null +++ b/patches/net/minecraft/src/AnvilSaveConverter.java.patch @@ -0,0 +1,263 @@ +--- net/minecraft/src/AnvilSaveConverter.java ++++ net/minecraft/src/AnvilSaveConverter.java +@@ -1,8 +1,6 @@ + package net.minecraft.src; + +-import java.io.DataInput; + import java.io.DataInputStream; +-import java.io.DataOutput; + import java.io.DataOutputStream; + import java.io.File; + import java.io.IOException; +@@ -14,26 +12,29 @@ + import net.minecraft.server.MinecraftServer; + + public class AnvilSaveConverter extends SaveFormatOld { +- public AnvilSaveConverter(File var1) { +- super(var1); ++ public AnvilSaveConverter(File par1File) { ++ super(par1File); + } + + public List getSaveList() throws AnvilConverterException { +- if(this.a != null && this.a.exists() && this.a.isDirectory()) { ++ if (this.savesDirectory != null && this.savesDirectory.exists() && this.savesDirectory.isDirectory()) { + ArrayList var1 = new ArrayList(); +- File[] var2 = this.a.listFiles(); ++ File[] var2 = this.savesDirectory.listFiles(); + File[] var3 = var2; + int var4 = var2.length; + +- for(int var5 = 0; var5 < var4; ++var5) { ++ for (int var5 = 0; var5 < var4; ++var5) { + File var6 = var3[var5]; +- if(var6.isDirectory()) { ++ ++ if (var6.isDirectory()) { + String var7 = var6.getName(); + WorldInfo var8 = this.getWorldInfo(var7); +- if(var8 != null && (var8.getSaveVersion() == 19132 || var8.getSaveVersion() == 19133)) { ++ ++ if (var8 != null && (var8.getSaveVersion() == 19132 || var8.getSaveVersion() == 19133)) { + boolean var9 = var8.getSaveVersion() != this.getSaveVersion(); + String var10 = var8.getWorldName(); +- if(var10 == null || MathHelper.stringNullOrLengthZero(var10)) { ++ ++ if (var10 == null || MathHelper.stringNullOrLengthZero(var10)) { + var10 = var7; + } + +@@ -57,121 +58,143 @@ + RegionFileCache.clearRegionFileReferences(); + } + +- public ISaveHandler getSaveLoader(String var1, boolean var2) { +- return new AnvilSaveHandler(this.a, var1, var2); ++ /** ++ * Returns back a loader for the specified save directory ++ */ ++ public ISaveHandler getSaveLoader(String par1Str, boolean par2) { ++ return new AnvilSaveHandler(this.savesDirectory, par1Str, par2); + } + +- public boolean isOldMapFormat(String var1) { +- WorldInfo var2 = this.getWorldInfo(var1); ++ /** ++ * Checks if the save directory uses the old map format ++ */ ++ public boolean isOldMapFormat(String par1Str) { ++ WorldInfo var2 = this.getWorldInfo(par1Str); + return var2 != null && var2.getSaveVersion() != this.getSaveVersion(); + } + +- public boolean convertMapFormat(String var1, IProgressUpdate var2) { +- var2.setLoadingProgress(0); ++ /** ++ * Converts the specified map to the new map format. Args: worldName, loadingScreen ++ */ ++ public boolean convertMapFormat(String par1Str, IProgressUpdate par2IProgressUpdate) { ++ par2IProgressUpdate.setLoadingProgress(0); + ArrayList var3 = new ArrayList(); + ArrayList var4 = new ArrayList(); + ArrayList var5 = new ArrayList(); +- File var6 = new File(this.a, var1); ++ File var6 = new File(this.savesDirectory, par1Str); + File var7 = new File(var6, "DIM-1"); + File var8 = new File(var6, "DIM1"); + MinecraftServer.getServer().getLogAgent().logInfo("Scanning folders..."); + this.addRegionFilesToCollection(var6, var3); +- if(var7.exists()) { ++ ++ if (var7.exists()) { + this.addRegionFilesToCollection(var7, var4); + } + +- if(var8.exists()) { ++ if (var8.exists()) { + this.addRegionFilesToCollection(var8, var5); + } + + int var9 = var3.size() + var4.size() + var5.size(); + MinecraftServer.getServer().getLogAgent().logInfo("Total conversion count is " + var9); +- WorldInfo var10 = this.getWorldInfo(var1); ++ WorldInfo var10 = this.getWorldInfo(par1Str); + Object var11 = null; +- if(var10.getTerrainType() == WorldType.FLAT) { ++ ++ if (var10.getTerrainType() == WorldType.FLAT) { + var11 = new WorldChunkManagerHell(BiomeGenBase.plains, 0.5F, 0.5F); + } else { + var11 = new WorldChunkManager(var10.getSeed(), var10.getTerrainType()); + } + +- this.convertFile(new File(var6, "region"), var3, (WorldChunkManager)var11, 0, var9, var2); +- this.convertFile(new File(var7, "region"), var4, new WorldChunkManagerHell(BiomeGenBase.hell, 1.0F, 0.0F), var3.size(), var9, var2); +- this.convertFile(new File(var8, "region"), var5, new WorldChunkManagerHell(BiomeGenBase.sky, 0.5F, 0.0F), var3.size() + var4.size(), var9, var2); ++ this.convertFile(new File(var6, "region"), var3, (WorldChunkManager)var11, 0, var9, par2IProgressUpdate); ++ this.convertFile(new File(var7, "region"), var4, new WorldChunkManagerHell(BiomeGenBase.hell, 1.0F, 0.0F), var3.size(), var9, par2IProgressUpdate); ++ this.convertFile(new File(var8, "region"), var5, new WorldChunkManagerHell(BiomeGenBase.sky, 0.5F, 0.0F), var3.size() + var4.size(), var9, par2IProgressUpdate); + var10.setSaveVersion(19133); +- if(var10.getTerrainType() == WorldType.DEFAULT_1_1) { ++ ++ if (var10.getTerrainType() == WorldType.DEFAULT_1_1) { + var10.setTerrainType(WorldType.DEFAULT); + } + +- this.createFile(var1); +- ISaveHandler var12 = this.getSaveLoader(var1, false); ++ this.createFile(par1Str); ++ ISaveHandler var12 = this.getSaveLoader(par1Str, false); + var12.saveWorldInfo(var10); + return true; + } + +- private void createFile(String var1) { +- File var2 = new File(this.a, var1); +- if(!var2.exists()) { ++ /** ++ * par: filename for the level.dat_mcr backup ++ */ ++ private void createFile(String par1Str) { ++ File var2 = new File(this.savesDirectory, par1Str); ++ ++ if (!var2.exists()) { + System.out.println("Warning: Unable to create level.dat_mcr backup"); + } else { + File var3 = new File(var2, "level.dat"); +- if(!var3.exists()) { ++ ++ if (!var3.exists()) { + System.out.println("Warning: Unable to create level.dat_mcr backup"); + } else { + File var4 = new File(var2, "level.dat_mcr"); +- if(!var3.renameTo(var4)) { ++ ++ if (!var3.renameTo(var4)) { + System.out.println("Warning: Unable to create level.dat_mcr backup"); + } +- + } + } + } + +- private void convertFile(File var1, Iterable var2, WorldChunkManager var3, int var4, int var5, IProgressUpdate var6) { +- Iterator var7 = var2.iterator(); ++ private void convertFile(File par1File, Iterable par2Iterable, WorldChunkManager par3WorldChunkManager, int par4, int par5, IProgressUpdate par6IProgressUpdate) { ++ Iterator var7 = par2Iterable.iterator(); + +- while(var7.hasNext()) { ++ while (var7.hasNext()) { + File var8 = (File)var7.next(); +- this.convertChunks(var1, var8, var3, var4, var5, var6); +- ++var4; +- int var9 = (int)Math.round(100.0D * (double)var4 / (double)var5); +- var6.setLoadingProgress(var9); ++ this.convertChunks(par1File, var8, par3WorldChunkManager, par4, par5, par6IProgressUpdate); ++ ++par4; ++ int var9 = (int)Math.round(100.0D * (double)par4 / (double)par5); ++ par6IProgressUpdate.setLoadingProgress(var9); + } +- + } + +- private void convertChunks(File var1, File var2, WorldChunkManager var3, int var4, int var5, IProgressUpdate var6) { ++ /** ++ * copies a 32x32 chunk set from par2File to par1File, via AnvilConverterData ++ */ ++ private void convertChunks(File par1File, File par2File, WorldChunkManager par3WorldChunkManager, int par4, int par5, IProgressUpdate par6IProgressUpdate) { + try { +- String var7 = var2.getName(); +- RegionFile var8 = new RegionFile(var2); +- RegionFile var9 = new RegionFile(new File(var1, var7.substring(0, var7.length() - ".mcr".length()) + ".mca")); ++ String var7 = par2File.getName(); ++ RegionFile var8 = new RegionFile(par2File); ++ RegionFile var9 = new RegionFile(new File(par1File, var7.substring(0, var7.length() - ".mcr".length()) + ".mca")); + +- for(int var10 = 0; var10 < 32; ++var10) { ++ for (int var10 = 0; var10 < 32; ++var10) { + int var11; +- for(var11 = 0; var11 < 32; ++var11) { +- if(var8.isChunkSaved(var10, var11) && !var9.isChunkSaved(var10, var11)) { ++ ++ for (var11 = 0; var11 < 32; ++var11) { ++ if (var8.isChunkSaved(var10, var11) && !var9.isChunkSaved(var10, var11)) { + DataInputStream var12 = var8.getChunkDataInputStream(var10, var11); +- if(var12 == null) { ++ ++ if (var12 == null) { + MinecraftServer.getServer().getLogAgent().logWarning("Failed to fetch input stream"); + } else { +- NBTTagCompound var13 = CompressedStreamTools.read((DataInput)var12); ++ NBTTagCompound var13 = CompressedStreamTools.read(var12); + var12.close(); + NBTTagCompound var14 = var13.getCompoundTag("Level"); + AnvilConverterData var15 = ChunkLoader.load(var14); + NBTTagCompound var16 = new NBTTagCompound(); + NBTTagCompound var17 = new NBTTagCompound(); + var16.setTag("Level", var17); +- ChunkLoader.convertToAnvilFormat(var15, var17, var3); ++ ChunkLoader.convertToAnvilFormat(var15, var17, par3WorldChunkManager); + DataOutputStream var18 = var9.getChunkDataOutputStream(var10, var11); +- CompressedStreamTools.write(var16, (DataOutput)var18); ++ CompressedStreamTools.write(var16, var18); + var18.close(); + } + } + } + +- var11 = (int)Math.round(100.0D * (double)(var4 * 1024) / (double)(var5 * 1024)); +- int var20 = (int)Math.round(100.0D * (double)((var10 + 1) * 32 + var4 * 1024) / (double)(var5 * 1024)); +- if(var20 > var11) { +- var6.setLoadingProgress(var20); ++ var11 = (int)Math.round(100.0D * (double)(par4 * 1024) / (double)(par5 * 1024)); ++ int var20 = (int)Math.round(100.0D * (double)((var10 + 1) * 32 + par4 * 1024) / (double)(par5 * 1024)); ++ ++ if (var20 > var11) { ++ par6IProgressUpdate.setLoadingProgress(var20); + } + } + +@@ -180,15 +203,17 @@ + } catch (IOException var19) { + var19.printStackTrace(); + } +- + } + +- private void addRegionFilesToCollection(File var1, Collection var2) { +- File var3 = new File(var1, "region"); ++ /** ++ * filters the files in the par1 directory, and adds them to the par2 collections ++ */ ++ private void addRegionFilesToCollection(File par1File, Collection par2Collection) { ++ File var3 = new File(par1File, "region"); + File[] var4 = var3.listFiles(new AnvilSaveConverterFileFilter(this)); +- if(var4 != null) { +- Collections.addAll(var2, var4); +- } + ++ if (var4 != null) { ++ Collections.addAll(par2Collection, var4); ++ } + } + } diff --git a/patches/net/minecraft/src/AnvilSaveConverterFileFilter.java.patch b/patches/net/minecraft/src/AnvilSaveConverterFileFilter.java.patch new file mode 100644 index 0000000..62747af --- /dev/null +++ b/patches/net/minecraft/src/AnvilSaveConverterFileFilter.java.patch @@ -0,0 +1,18 @@ +--- net/minecraft/src/AnvilSaveConverterFileFilter.java ++++ net/minecraft/src/AnvilSaveConverterFileFilter.java +@@ -6,11 +6,11 @@ + class AnvilSaveConverterFileFilter implements FilenameFilter { + final AnvilSaveConverter parent; + +- AnvilSaveConverterFileFilter(AnvilSaveConverter var1) { +- this.parent = var1; ++ AnvilSaveConverterFileFilter(AnvilSaveConverter par1AnvilSaveConverter) { ++ this.parent = par1AnvilSaveConverter; + } + +- public boolean accept(File var1, String var2) { +- return var2.endsWith(".mcr"); ++ public boolean accept(File par1File, String par2Str) { ++ return par2Str.endsWith(".mcr"); + } + } diff --git a/patches/net/minecraft/src/AnvilSaveHandler.java.patch b/patches/net/minecraft/src/AnvilSaveHandler.java.patch new file mode 100644 index 0000000..ead693d --- /dev/null +++ b/patches/net/minecraft/src/AnvilSaveHandler.java.patch @@ -0,0 +1,51 @@ +--- net/minecraft/src/AnvilSaveHandler.java ++++ net/minecraft/src/AnvilSaveHandler.java +@@ -3,18 +3,22 @@ + import java.io.File; + + public class AnvilSaveHandler extends SaveHandler { +- public AnvilSaveHandler(File var1, String var2, boolean var3) { +- super(var1, var2, var3); ++ public AnvilSaveHandler(File par1File, String par2Str, boolean par3) { ++ super(par1File, par2Str, par3); + } + +- public IChunkLoader getChunkLoader(WorldProvider var1) { ++ /** ++ * Returns the chunk loader with the provided world provider ++ */ ++ public IChunkLoader getChunkLoader(WorldProvider par1WorldProvider) { + File var2 = this.getWorldDirectory(); + File var3; +- if(var1 instanceof WorldProviderHell) { ++ ++ if (par1WorldProvider instanceof WorldProviderHell) { + var3 = new File(var2, "DIM-1"); + var3.mkdirs(); + return new AnvilChunkLoader(var3); +- } else if(var1 instanceof WorldProviderEnd) { ++ } else if (par1WorldProvider instanceof WorldProviderEnd) { + var3 = new File(var2, "DIM1"); + var3.mkdirs(); + return new AnvilChunkLoader(var3); +@@ -23,11 +27,17 @@ + } + } + +- public void saveWorldInfoWithPlayer(WorldInfo var1, NBTTagCompound var2) { +- var1.setSaveVersion(19133); +- super.saveWorldInfoWithPlayer(var1, var2); ++ /** ++ * Saves the given World Info with the given NBTTagCompound as the Player. ++ */ ++ public void saveWorldInfoWithPlayer(WorldInfo par1WorldInfo, NBTTagCompound par2NBTTagCompound) { ++ par1WorldInfo.setSaveVersion(19133); ++ super.saveWorldInfoWithPlayer(par1WorldInfo, par2NBTTagCompound); + } + ++ /** ++ * Called to flush all changes to disk, waiting for them to complete. ++ */ + public void flush() { + try { + ThreadedFileIOBase.threadedIOInstance.waitForFinish(); diff --git a/patches/net/minecraft/src/AttributeInstance.java.patch b/patches/net/minecraft/src/AttributeInstance.java.patch new file mode 100644 index 0000000..d40102e --- /dev/null +++ b/patches/net/minecraft/src/AttributeInstance.java.patch @@ -0,0 +1,12 @@ +--- net/minecraft/src/AttributeInstance.java ++++ net/minecraft/src/AttributeInstance.java +@@ -12,6 +12,9 @@ + + Collection func_111122_c(); + ++ /** ++ * Returns attribute modifier, if any, by the given UUID ++ */ + AttributeModifier getModifier(UUID var1); + + void applyModifier(AttributeModifier var1); diff --git a/patches/net/minecraft/src/AttributeModifier.java.patch b/patches/net/minecraft/src/AttributeModifier.java.patch new file mode 100644 index 0000000..545e2bd --- /dev/null +++ b/patches/net/minecraft/src/AttributeModifier.java.patch @@ -0,0 +1,105 @@ +--- net/minecraft/src/AttributeModifier.java ++++ net/minecraft/src/AttributeModifier.java +@@ -6,30 +6,34 @@ + public class AttributeModifier { + private final double amount; + private final int operation; +- private final String c; +- private final UUID d; ++ private final String name; ++ private final UUID id; ++ ++ /** ++ * If false, this modifier is not saved in NBT. Used for "natural" modifiers like speed boost from sprinting ++ */ + private boolean isSaved; + +- public AttributeModifier(String var1, double var2, int var4) { +- this(UUID.randomUUID(), var1, var2, var4); ++ public AttributeModifier(String par1Str, double par2, int par4) { ++ this(UUID.randomUUID(), par1Str, par2, par4); + } + +- public AttributeModifier(UUID var1, String var2, double var3, int var5) { ++ public AttributeModifier(UUID par1UUID, String par2Str, double par3, int par5) { + this.isSaved = true; +- this.d = var1; +- this.c = var2; +- this.amount = var3; +- this.operation = var5; +- Validate.notEmpty((CharSequence)var2, "Modifier name cannot be empty", new Object[0]); +- Validate.inclusiveBetween(Integer.valueOf(0), Integer.valueOf(2), Integer.valueOf(var5), "Invalid operation", new Object[0]); ++ this.id = par1UUID; ++ this.name = par2Str; ++ this.amount = par3; ++ this.operation = par5; ++ Validate.notEmpty(par2Str, "Modifier name cannot be empty", new Object[0]); ++ Validate.inclusiveBetween(Integer.valueOf(0), Integer.valueOf(2), Integer.valueOf(par5), "Invalid operation", new Object[0]); + } + + public UUID getID() { +- return this.d; ++ return this.id; + } + + public String getName() { +- return this.c; ++ return this.name; + } + + public int getOperation() { +@@ -40,25 +44,32 @@ + return this.amount; + } + ++ /** ++ * @see #isSaved ++ */ + public boolean isSaved() { + return this.isSaved; + } + +- public AttributeModifier setSaved(boolean var1) { +- this.isSaved = var1; ++ /** ++ * @see #isSaved ++ */ ++ public AttributeModifier setSaved(boolean par1) { ++ this.isSaved = par1; + return this; + } + +- public boolean equals(Object var1) { +- if(this == var1) { ++ public boolean equals(Object par1Obj) { ++ if (this == par1Obj) { + return true; +- } else if(var1 != null && this.getClass() == var1.getClass()) { +- AttributeModifier var2 = (AttributeModifier)var1; +- if(this.d != null) { +- if(!this.d.equals(var2.d)) { ++ } else if (par1Obj != null && this.getClass() == par1Obj.getClass()) { ++ AttributeModifier var2 = (AttributeModifier)par1Obj; ++ ++ if (this.id != null) { ++ if (!this.id.equals(var2.id)) { + return false; + } +- } else if(var2.d != null) { ++ } else if (var2.id != null) { + return false; + } + +@@ -69,10 +80,10 @@ + } + + public int hashCode() { +- return this.d != null ? this.d.hashCode() : 0; ++ return this.id != null ? this.id.hashCode() : 0; + } + + public String toString() { +- return "AttributeModifier{amount=" + this.amount + ", operation=" + this.operation + ", name=\'" + this.c + '\'' + ", id=" + this.d + ", serialize=" + this.isSaved + '}'; ++ return "AttributeModifier{amount=" + this.amount + ", operation=" + this.operation + ", name=\'" + this.name + '\'' + ", id=" + this.id + ", serialize=" + this.isSaved + '}'; + } + } diff --git a/patches/net/minecraft/src/AxisAlignedBB.java.patch b/patches/net/minecraft/src/AxisAlignedBB.java.patch new file mode 100644 index 0000000..87f4aa7 --- /dev/null +++ b/patches/net/minecraft/src/AxisAlignedBB.java.patch @@ -0,0 +1,626 @@ +--- net/minecraft/src/AxisAlignedBB.java ++++ net/minecraft/src/AxisAlignedBB.java +@@ -1,7 +1,9 @@ + package net.minecraft.src; + + public class AxisAlignedBB { +- private static final ThreadLocal g = new AABBLocalPool(); ++ ++ /** ThreadLocal AABBPool */ ++ private static final ThreadLocal theAABBLocalPool = new AABBLocalPool(); + public double minX; + public double minY; + public double minZ; +@@ -9,190 +11,247 @@ + public double maxY; + public double maxZ; + +- public static AxisAlignedBB getBoundingBox(double var0, double var2, double var4, double var6, double var8, double var10) { +- return new AxisAlignedBB(var0, var2, var4, var6, var8, var10); ++ /** ++ * Returns a bounding box with the specified bounds. Args: minX, minY, minZ, maxX, maxY, maxZ ++ */ ++ public static AxisAlignedBB getBoundingBox(double par0, double par2, double par4, double par6, double par8, double par10) { ++ return new AxisAlignedBB(par0, par2, par4, par6, par8, par10); + } + ++ /** ++ * Gets the ThreadLocal AABBPool ++ */ + public static AABBPool getAABBPool() { +- return (AABBPool)g.get(); +- } +- +- protected AxisAlignedBB(double var1, double var3, double var5, double var7, double var9, double var11) { +- this.minX = var1; +- this.minY = var3; +- this.minZ = var5; +- this.maxX = var7; +- this.maxY = var9; +- this.maxZ = var11; +- } +- +- public AxisAlignedBB setBounds(double var1, double var3, double var5, double var7, double var9, double var11) { +- this.minX = var1; +- this.minY = var3; +- this.minZ = var5; +- this.maxX = var7; +- this.maxY = var9; +- this.maxZ = var11; ++ return (AABBPool)theAABBLocalPool.get(); ++ } ++ ++ protected AxisAlignedBB(double par1, double par3, double par5, double par7, double par9, double par11) { ++ this.minX = par1; ++ this.minY = par3; ++ this.minZ = par5; ++ this.maxX = par7; ++ this.maxY = par9; ++ this.maxZ = par11; ++ } ++ ++ /** ++ * Sets the bounds of the bounding box. Args: minX, minY, minZ, maxX, maxY, maxZ ++ */ ++ public AxisAlignedBB setBounds(double par1, double par3, double par5, double par7, double par9, double par11) { ++ this.minX = par1; ++ this.minY = par3; ++ this.minZ = par5; ++ this.maxX = par7; ++ this.maxY = par9; ++ this.maxZ = par11; + return this; + } + +- public AxisAlignedBB addCoord(double var1, double var3, double var5) { ++ /** ++ * Adds the coordinates to the bounding box extending it if the point lies outside the current ranges. Args: x, y, z ++ */ ++ public AxisAlignedBB addCoord(double par1, double par3, double par5) { + double var7 = this.minX; + double var9 = this.minY; + double var11 = this.minZ; + double var13 = this.maxX; + double var15 = this.maxY; + double var17 = this.maxZ; +- if(var1 < 0.0D) { +- var7 += var1; +- } +- +- if(var1 > 0.0D) { +- var13 += var1; +- } +- +- if(var3 < 0.0D) { +- var9 += var3; +- } +- +- if(var3 > 0.0D) { +- var15 += var3; +- } +- +- if(var5 < 0.0D) { +- var11 += var5; +- } +- +- if(var5 > 0.0D) { +- var17 += var5; +- } +- +- return getAABBPool().getAABB(var7, var9, var11, var13, var15, var17); +- } +- +- public AxisAlignedBB expand(double var1, double var3, double var5) { +- double var7 = this.minX - var1; +- double var9 = this.minY - var3; +- double var11 = this.minZ - var5; +- double var13 = this.maxX + var1; +- double var15 = this.maxY + var3; +- double var17 = this.maxZ + var5; +- return getAABBPool().getAABB(var7, var9, var11, var13, var15, var17); +- } +- +- public AxisAlignedBB func_111270_a(AxisAlignedBB var1) { +- double var2 = Math.min(this.minX, var1.minX); +- double var4 = Math.min(this.minY, var1.minY); +- double var6 = Math.min(this.minZ, var1.minZ); +- double var8 = Math.max(this.maxX, var1.maxX); +- double var10 = Math.max(this.maxY, var1.maxY); +- double var12 = Math.max(this.maxZ, var1.maxZ); ++ ++ if (par1 < 0.0D) { ++ var7 += par1; ++ } ++ ++ if (par1 > 0.0D) { ++ var13 += par1; ++ } ++ ++ if (par3 < 0.0D) { ++ var9 += par3; ++ } ++ ++ if (par3 > 0.0D) { ++ var15 += par3; ++ } ++ ++ if (par5 < 0.0D) { ++ var11 += par5; ++ } ++ ++ if (par5 > 0.0D) { ++ var17 += par5; ++ } ++ ++ return getAABBPool().getAABB(var7, var9, var11, var13, var15, var17); ++ } ++ ++ /** ++ * Returns a bounding box expanded by the specified vector (if negative numbers are given it will shrink). Args: x, y, ++ * z ++ */ ++ public AxisAlignedBB expand(double par1, double par3, double par5) { ++ double var7 = this.minX - par1; ++ double var9 = this.minY - par3; ++ double var11 = this.minZ - par5; ++ double var13 = this.maxX + par1; ++ double var15 = this.maxY + par3; ++ double var17 = this.maxZ + par5; ++ return getAABBPool().getAABB(var7, var9, var11, var13, var15, var17); ++ } ++ ++ public AxisAlignedBB func_111270_a(AxisAlignedBB par1AxisAlignedBB) { ++ double var2 = Math.min(this.minX, par1AxisAlignedBB.minX); ++ double var4 = Math.min(this.minY, par1AxisAlignedBB.minY); ++ double var6 = Math.min(this.minZ, par1AxisAlignedBB.minZ); ++ double var8 = Math.max(this.maxX, par1AxisAlignedBB.maxX); ++ double var10 = Math.max(this.maxY, par1AxisAlignedBB.maxY); ++ double var12 = Math.max(this.maxZ, par1AxisAlignedBB.maxZ); + return getAABBPool().getAABB(var2, var4, var6, var8, var10, var12); + } + +- public AxisAlignedBB getOffsetBoundingBox(double var1, double var3, double var5) { +- return getAABBPool().getAABB(this.minX + var1, this.minY + var3, this.minZ + var5, this.maxX + var1, this.maxY + var3, this.maxZ + var5); +- } +- +- public double calculateXOffset(AxisAlignedBB var1, double var2) { +- if(var1.maxY > this.minY && var1.minY < this.maxY) { +- if(var1.maxZ > this.minZ && var1.minZ < this.maxZ) { +- double var4; +- if(var2 > 0.0D && var1.maxX <= this.minX) { +- var4 = this.minX - var1.maxX; +- if(var4 < var2) { +- var2 = var4; +- } +- } +- +- if(var2 < 0.0D && var1.minX >= this.maxX) { +- var4 = this.maxX - var1.minX; +- if(var4 > var2) { +- var2 = var4; +- } +- } +- +- return var2; +- } else { +- return var2; +- } +- } else { +- return var2; +- } +- } +- +- public double calculateYOffset(AxisAlignedBB var1, double var2) { +- if(var1.maxX > this.minX && var1.minX < this.maxX) { +- if(var1.maxZ > this.minZ && var1.minZ < this.maxZ) { +- double var4; +- if(var2 > 0.0D && var1.maxY <= this.minY) { +- var4 = this.minY - var1.maxY; +- if(var4 < var2) { +- var2 = var4; +- } +- } +- +- if(var2 < 0.0D && var1.minY >= this.maxY) { +- var4 = this.maxY - var1.minY; +- if(var4 > var2) { +- var2 = var4; +- } +- } +- +- return var2; +- } else { +- return var2; +- } +- } else { +- return var2; +- } +- } +- +- public double calculateZOffset(AxisAlignedBB var1, double var2) { +- if(var1.maxX > this.minX && var1.minX < this.maxX) { +- if(var1.maxY > this.minY && var1.minY < this.maxY) { +- double var4; +- if(var2 > 0.0D && var1.maxZ <= this.minZ) { +- var4 = this.minZ - var1.maxZ; +- if(var4 < var2) { +- var2 = var4; +- } +- } +- +- if(var2 < 0.0D && var1.minZ >= this.maxZ) { +- var4 = this.maxZ - var1.minZ; +- if(var4 > var2) { +- var2 = var4; +- } +- } +- +- return var2; +- } else { +- return var2; +- } +- } else { +- return var2; +- } +- } +- +- public boolean intersectsWith(AxisAlignedBB var1) { +- return var1.maxX > this.minX && var1.minX < this.maxX ? (var1.maxY > this.minY && var1.minY < this.maxY ? var1.maxZ > this.minZ && var1.minZ < this.maxZ : false) : false; +- } +- +- public AxisAlignedBB offset(double var1, double var3, double var5) { +- this.minX += var1; +- this.minY += var3; +- this.minZ += var5; +- this.maxX += var1; +- this.maxY += var3; +- this.maxZ += var5; ++ /** ++ * Returns a bounding box offseted by the specified vector (if negative numbers are given it will shrink). Args: x, y, ++ * z ++ */ ++ public AxisAlignedBB getOffsetBoundingBox(double par1, double par3, double par5) { ++ return getAABBPool().getAABB(this.minX + par1, this.minY + par3, this.minZ + par5, this.maxX + par1, this.maxY + par3, this.maxZ + par5); ++ } ++ ++ /** ++ * if instance and the argument bounding boxes overlap in the Y and Z dimensions, calculate the offset between them in ++ * the X dimension. return var2 if the bounding boxes do not overlap or if var2 is closer to 0 then the calculated ++ * offset. Otherwise return the calculated offset. ++ */ ++ public double calculateXOffset(AxisAlignedBB par1AxisAlignedBB, double par2) { ++ if (par1AxisAlignedBB.maxY > this.minY && par1AxisAlignedBB.minY < this.maxY) { ++ if (par1AxisAlignedBB.maxZ > this.minZ && par1AxisAlignedBB.minZ < this.maxZ) { ++ double var4; ++ ++ if (par2 > 0.0D && par1AxisAlignedBB.maxX <= this.minX) { ++ var4 = this.minX - par1AxisAlignedBB.maxX; ++ ++ if (var4 < par2) { ++ par2 = var4; ++ } ++ } ++ ++ if (par2 < 0.0D && par1AxisAlignedBB.minX >= this.maxX) { ++ var4 = this.maxX - par1AxisAlignedBB.minX; ++ ++ if (var4 > par2) { ++ par2 = var4; ++ } ++ } ++ ++ return par2; ++ } else { ++ return par2; ++ } ++ } else { ++ return par2; ++ } ++ } ++ ++ /** ++ * if instance and the argument bounding boxes overlap in the X and Z dimensions, calculate the offset between them in ++ * the Y dimension. return var2 if the bounding boxes do not overlap or if var2 is closer to 0 then the calculated ++ * offset. Otherwise return the calculated offset. ++ */ ++ public double calculateYOffset(AxisAlignedBB par1AxisAlignedBB, double par2) { ++ if (par1AxisAlignedBB.maxX > this.minX && par1AxisAlignedBB.minX < this.maxX) { ++ if (par1AxisAlignedBB.maxZ > this.minZ && par1AxisAlignedBB.minZ < this.maxZ) { ++ double var4; ++ ++ if (par2 > 0.0D && par1AxisAlignedBB.maxY <= this.minY) { ++ var4 = this.minY - par1AxisAlignedBB.maxY; ++ ++ if (var4 < par2) { ++ par2 = var4; ++ } ++ } ++ ++ if (par2 < 0.0D && par1AxisAlignedBB.minY >= this.maxY) { ++ var4 = this.maxY - par1AxisAlignedBB.minY; ++ ++ if (var4 > par2) { ++ par2 = var4; ++ } ++ } ++ ++ return par2; ++ } else { ++ return par2; ++ } ++ } else { ++ return par2; ++ } ++ } ++ ++ /** ++ * if instance and the argument bounding boxes overlap in the Y and X dimensions, calculate the offset between them in ++ * the Z dimension. return var2 if the bounding boxes do not overlap or if var2 is closer to 0 then the calculated ++ * offset. Otherwise return the calculated offset. ++ */ ++ public double calculateZOffset(AxisAlignedBB par1AxisAlignedBB, double par2) { ++ if (par1AxisAlignedBB.maxX > this.minX && par1AxisAlignedBB.minX < this.maxX) { ++ if (par1AxisAlignedBB.maxY > this.minY && par1AxisAlignedBB.minY < this.maxY) { ++ double var4; ++ ++ if (par2 > 0.0D && par1AxisAlignedBB.maxZ <= this.minZ) { ++ var4 = this.minZ - par1AxisAlignedBB.maxZ; ++ ++ if (var4 < par2) { ++ par2 = var4; ++ } ++ } ++ ++ if (par2 < 0.0D && par1AxisAlignedBB.minZ >= this.maxZ) { ++ var4 = this.maxZ - par1AxisAlignedBB.minZ; ++ ++ if (var4 > par2) { ++ par2 = var4; ++ } ++ } ++ ++ return par2; ++ } else { ++ return par2; ++ } ++ } else { ++ return par2; ++ } ++ } ++ ++ /** ++ * Returns whether the given bounding box intersects with this one. Args: axisAlignedBB ++ */ ++ public boolean intersectsWith(AxisAlignedBB par1AxisAlignedBB) { ++ return par1AxisAlignedBB.maxX > this.minX && par1AxisAlignedBB.minX < this.maxX ? (par1AxisAlignedBB.maxY > this.minY && par1AxisAlignedBB.minY < this.maxY ? par1AxisAlignedBB.maxZ > this.minZ && par1AxisAlignedBB.minZ < this.maxZ : false) : false; ++ } ++ ++ /** ++ * Offsets the current bounding box by the specified coordinates. Args: x, y, z ++ */ ++ public AxisAlignedBB offset(double par1, double par3, double par5) { ++ this.minX += par1; ++ this.minY += par3; ++ this.minZ += par5; ++ this.maxX += par1; ++ this.maxY += par3; ++ this.maxZ += par5; + return this; + } + +- public boolean isVecInside(Vec3 var1) { +- return var1.xCoord > this.minX && var1.xCoord < this.maxX ? (var1.yCoord > this.minY && var1.yCoord < this.maxY ? var1.zCoord > this.minZ && var1.zCoord < this.maxZ : false) : false; ++ /** ++ * Returns if the supplied Vec3D is completely inside the bounding box ++ */ ++ public boolean isVecInside(Vec3 par1Vec3) { ++ return par1Vec3.xCoord > this.minX && par1Vec3.xCoord < this.maxX ? (par1Vec3.yCoord > this.minY && par1Vec3.yCoord < this.maxY ? par1Vec3.zCoord > this.minZ && par1Vec3.zCoord < this.maxZ : false) : false; + } + ++ /** ++ * Returns the average length of the edges of the bounding box. ++ */ + public double getAverageEdgeLength() { + double var1 = this.maxX - this.minX; + double var3 = this.maxY - this.minY; +@@ -200,101 +259,110 @@ + return (var1 + var3 + var5) / 3.0D; + } + +- public AxisAlignedBB contract(double var1, double var3, double var5) { +- double var7 = this.minX + var1; +- double var9 = this.minY + var3; +- double var11 = this.minZ + var5; +- double var13 = this.maxX - var1; +- double var15 = this.maxY - var3; +- double var17 = this.maxZ - var5; ++ /** ++ * Returns a bounding box that is inset by the specified amounts ++ */ ++ public AxisAlignedBB contract(double par1, double par3, double par5) { ++ double var7 = this.minX + par1; ++ double var9 = this.minY + par3; ++ double var11 = this.minZ + par5; ++ double var13 = this.maxX - par1; ++ double var15 = this.maxY - par3; ++ double var17 = this.maxZ - par5; + return getAABBPool().getAABB(var7, var9, var11, var13, var15, var17); + } + ++ /** ++ * Returns a copy of the bounding box. ++ */ + public AxisAlignedBB copy() { + return getAABBPool().getAABB(this.minX, this.minY, this.minZ, this.maxX, this.maxY, this.maxZ); + } + +- public MovingObjectPosition calculateIntercept(Vec3 var1, Vec3 var2) { +- Vec3 var3 = var1.getIntermediateWithXValue(var2, this.minX); +- Vec3 var4 = var1.getIntermediateWithXValue(var2, this.maxX); +- Vec3 var5 = var1.getIntermediateWithYValue(var2, this.minY); +- Vec3 var6 = var1.getIntermediateWithYValue(var2, this.maxY); +- Vec3 var7 = var1.getIntermediateWithZValue(var2, this.minZ); +- Vec3 var8 = var1.getIntermediateWithZValue(var2, this.maxZ); +- if(!this.isVecInYZ(var3)) { ++ public MovingObjectPosition calculateIntercept(Vec3 par1Vec3, Vec3 par2Vec3) { ++ Vec3 var3 = par1Vec3.getIntermediateWithXValue(par2Vec3, this.minX); ++ Vec3 var4 = par1Vec3.getIntermediateWithXValue(par2Vec3, this.maxX); ++ Vec3 var5 = par1Vec3.getIntermediateWithYValue(par2Vec3, this.minY); ++ Vec3 var6 = par1Vec3.getIntermediateWithYValue(par2Vec3, this.maxY); ++ Vec3 var7 = par1Vec3.getIntermediateWithZValue(par2Vec3, this.minZ); ++ Vec3 var8 = par1Vec3.getIntermediateWithZValue(par2Vec3, this.maxZ); ++ ++ if (!this.isVecInYZ(var3)) { + var3 = null; + } + +- if(!this.isVecInYZ(var4)) { ++ if (!this.isVecInYZ(var4)) { + var4 = null; + } + +- if(!this.isVecInXZ(var5)) { ++ if (!this.isVecInXZ(var5)) { + var5 = null; + } + +- if(!this.isVecInXZ(var6)) { ++ if (!this.isVecInXZ(var6)) { + var6 = null; + } + +- if(!this.isVecInXY(var7)) { ++ if (!this.isVecInXY(var7)) { + var7 = null; + } + +- if(!this.isVecInXY(var8)) { ++ if (!this.isVecInXY(var8)) { + var8 = null; + } + + Vec3 var9 = null; +- if(var3 != null && (var9 == null || var1.squareDistanceTo(var3) < var1.squareDistanceTo(var9))) { ++ ++ if (var3 != null && (var9 == null || par1Vec3.squareDistanceTo(var3) < par1Vec3.squareDistanceTo(var9))) { + var9 = var3; + } + +- if(var4 != null && (var9 == null || var1.squareDistanceTo(var4) < var1.squareDistanceTo(var9))) { ++ if (var4 != null && (var9 == null || par1Vec3.squareDistanceTo(var4) < par1Vec3.squareDistanceTo(var9))) { + var9 = var4; + } + +- if(var5 != null && (var9 == null || var1.squareDistanceTo(var5) < var1.squareDistanceTo(var9))) { ++ if (var5 != null && (var9 == null || par1Vec3.squareDistanceTo(var5) < par1Vec3.squareDistanceTo(var9))) { + var9 = var5; + } + +- if(var6 != null && (var9 == null || var1.squareDistanceTo(var6) < var1.squareDistanceTo(var9))) { ++ if (var6 != null && (var9 == null || par1Vec3.squareDistanceTo(var6) < par1Vec3.squareDistanceTo(var9))) { + var9 = var6; + } + +- if(var7 != null && (var9 == null || var1.squareDistanceTo(var7) < var1.squareDistanceTo(var9))) { ++ if (var7 != null && (var9 == null || par1Vec3.squareDistanceTo(var7) < par1Vec3.squareDistanceTo(var9))) { + var9 = var7; + } + +- if(var8 != null && (var9 == null || var1.squareDistanceTo(var8) < var1.squareDistanceTo(var9))) { ++ if (var8 != null && (var9 == null || par1Vec3.squareDistanceTo(var8) < par1Vec3.squareDistanceTo(var9))) { + var9 = var8; + } + +- if(var9 == null) { ++ if (var9 == null) { + return null; + } else { + byte var10 = -1; +- if(var9 == var3) { ++ ++ if (var9 == var3) { + var10 = 4; + } + +- if(var9 == var4) { ++ if (var9 == var4) { + var10 = 5; + } + +- if(var9 == var5) { ++ if (var9 == var5) { + var10 = 0; + } + +- if(var9 == var6) { ++ if (var9 == var6) { + var10 = 1; + } + +- if(var9 == var7) { ++ if (var9 == var7) { + var10 = 2; + } + +- if(var9 == var8) { ++ if (var9 == var8) { + var10 = 3; + } + +@@ -302,25 +370,37 @@ + } + } + +- private boolean isVecInYZ(Vec3 var1) { +- return var1 == null ? false : var1.yCoord >= this.minY && var1.yCoord <= this.maxY && var1.zCoord >= this.minZ && var1.zCoord <= this.maxZ; +- } +- +- private boolean isVecInXZ(Vec3 var1) { +- return var1 == null ? false : var1.xCoord >= this.minX && var1.xCoord <= this.maxX && var1.zCoord >= this.minZ && var1.zCoord <= this.maxZ; +- } +- +- private boolean isVecInXY(Vec3 var1) { +- return var1 == null ? false : var1.xCoord >= this.minX && var1.xCoord <= this.maxX && var1.yCoord >= this.minY && var1.yCoord <= this.maxY; +- } +- +- public void setBB(AxisAlignedBB var1) { +- this.minX = var1.minX; +- this.minY = var1.minY; +- this.minZ = var1.minZ; +- this.maxX = var1.maxX; +- this.maxY = var1.maxY; +- this.maxZ = var1.maxZ; ++ /** ++ * Checks if the specified vector is within the YZ dimensions of the bounding box. Args: Vec3D ++ */ ++ private boolean isVecInYZ(Vec3 par1Vec3) { ++ return par1Vec3 == null ? false : par1Vec3.yCoord >= this.minY && par1Vec3.yCoord <= this.maxY && par1Vec3.zCoord >= this.minZ && par1Vec3.zCoord <= this.maxZ; ++ } ++ ++ /** ++ * Checks if the specified vector is within the XZ dimensions of the bounding box. Args: Vec3D ++ */ ++ private boolean isVecInXZ(Vec3 par1Vec3) { ++ return par1Vec3 == null ? false : par1Vec3.xCoord >= this.minX && par1Vec3.xCoord <= this.maxX && par1Vec3.zCoord >= this.minZ && par1Vec3.zCoord <= this.maxZ; ++ } ++ ++ /** ++ * Checks if the specified vector is within the XY dimensions of the bounding box. Args: Vec3D ++ */ ++ private boolean isVecInXY(Vec3 par1Vec3) { ++ return par1Vec3 == null ? false : par1Vec3.xCoord >= this.minX && par1Vec3.xCoord <= this.maxX && par1Vec3.yCoord >= this.minY && par1Vec3.yCoord <= this.maxY; ++ } ++ ++ /** ++ * Sets the bounding box to the same bounds as the bounding box passed in. Args: axisAlignedBB ++ */ ++ public void setBB(AxisAlignedBB par1AxisAlignedBB) { ++ this.minX = par1AxisAlignedBB.minX; ++ this.minY = par1AxisAlignedBB.minY; ++ this.minZ = par1AxisAlignedBB.minZ; ++ this.maxX = par1AxisAlignedBB.maxX; ++ this.maxY = par1AxisAlignedBB.maxY; ++ this.maxZ = par1AxisAlignedBB.maxZ; + } + + public String toString() { diff --git a/patches/net/minecraft/src/Backup.java.patch b/patches/net/minecraft/src/Backup.java.patch new file mode 100644 index 0000000..91bfa21 --- /dev/null +++ b/patches/net/minecraft/src/Backup.java.patch @@ -0,0 +1,28 @@ +--- net/minecraft/src/Backup.java ++++ net/minecraft/src/Backup.java +@@ -4,18 +4,19 @@ + import java.util.Date; + + public class Backup extends ValueObject { +- public String a; +- public Date b; ++ public String field_110727_a; ++ public Date field_110725_b; + public long field_110726_c; + +- public static Backup func_110724_a(JsonNode var0) { ++ public static Backup func_110724_a(JsonNode par0JsonNode) { + Backup var1 = new Backup(); + + try { +- var1.a = var0.getStringValue(new Object[]{"backupId"}); +- var1.b = new Date(Long.parseLong(var0.getNumberValue(new Object[]{"lastModifiedDate"}))); +- var1.field_110726_c = Long.parseLong(var0.getNumberValue(new Object[]{"size"})); ++ var1.field_110727_a = par0JsonNode.getStringValue(new Object[] {"backupId"}); ++ var1.field_110725_b = new Date(Long.parseLong(par0JsonNode.getNumberValue(new Object[] {"lastModifiedDate"}))); ++ var1.field_110726_c = Long.parseLong(par0JsonNode.getNumberValue(new Object[] {"size"})); + } catch (IllegalArgumentException var3) { ++ ; + } + + return var1; diff --git a/patches/net/minecraft/src/BackupList.java.patch b/patches/net/minecraft/src/BackupList.java.patch new file mode 100644 index 0000000..0a528ad --- /dev/null +++ b/patches/net/minecraft/src/BackupList.java.patch @@ -0,0 +1,39 @@ +--- net/minecraft/src/BackupList.java ++++ net/minecraft/src/BackupList.java +@@ -9,24 +9,27 @@ + import java.util.List; + + public class BackupList { +- public List a; ++ public List field_111223_a; + +- public static BackupList func_111222_a(String var0) { ++ public static BackupList func_111222_a(String par0Str) { + BackupList var1 = new BackupList(); +- var1.a = new ArrayList(); ++ var1.field_111223_a = new ArrayList(); + + try { +- JsonRootNode var2 = (new JdomParser()).parse(var0); +- if(var2.isArrayNode(new Object[]{"backups"})) { +- Iterator var3 = var2.getArrayNode(new Object[]{"backups"}).iterator(); +- +- while(var3.hasNext()) { ++ JsonRootNode var2 = (new JdomParser()).parse(par0Str); ++ ++ if (var2.isArrayNode(new Object[] {"backups"})) { ++ Iterator var3 = var2.getArrayNode(new Object[] {"backups"}).iterator(); ++ ++ while (var3.hasNext()) { + JsonNode var4 = (JsonNode)var3.next(); +- var1.a.add(Backup.func_110724_a(var4)); ++ var1.field_111223_a.add(Backup.func_110724_a(var4)); + } + } + } catch (InvalidSyntaxException var5) { ++ ; + } catch (IllegalArgumentException var6) { ++ ; + } + + return var1; diff --git a/patches/net/minecraft/src/BanEntry.java.patch b/patches/net/minecraft/src/BanEntry.java.patch new file mode 100644 index 0000000..ecc543c --- /dev/null +++ b/patches/net/minecraft/src/BanEntry.java.patch @@ -0,0 +1,157 @@ +--- net/minecraft/src/BanEntry.java ++++ net/minecraft/src/BanEntry.java +@@ -7,104 +7,111 @@ + import net.minecraft.server.MinecraftServer; + + public class BanEntry { +- public static final SimpleDateFormat a = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss Z"); +- private final String b; +- private Date c = new Date(); +- private String d = "(Unknown)"; +- private Date e; +- private String f = "Banned by an operator."; ++ public static final SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss Z"); ++ private final String username; ++ private Date banStartDate = new Date(); ++ private String bannedBy = "(Unknown)"; ++ private Date banEndDate; ++ private String reason = "Banned by an operator."; + +- public BanEntry(String var1) { +- this.b = var1; ++ public BanEntry(String par1Str) { ++ this.username = par1Str; + } + + public String getBannedUsername() { +- return this.b; ++ return this.username; + } + + public Date getBanStartDate() { +- return this.c; ++ return this.banStartDate; + } + +- public void setBanStartDate(Date var1) { +- this.c = var1 != null ? var1 : new Date(); ++ /** ++ * null == start ban now ++ */ ++ public void setBanStartDate(Date par1Date) { ++ this.banStartDate = par1Date != null ? par1Date : new Date(); + } + + public String getBannedBy() { +- return this.d; ++ return this.bannedBy; + } + +- public void setBannedBy(String var1) { +- this.d = var1; ++ public void setBannedBy(String par1Str) { ++ this.bannedBy = par1Str; + } + + public Date getBanEndDate() { +- return this.e; ++ return this.banEndDate; + } + +- public void setBanEndDate(Date var1) { +- this.e = var1; ++ public void setBanEndDate(Date par1Date) { ++ this.banEndDate = par1Date; + } + + public boolean hasBanExpired() { +- return this.e == null ? false : this.e.before(new Date()); ++ return this.banEndDate == null ? false : this.banEndDate.before(new Date()); + } + + public String getBanReason() { +- return this.f; ++ return this.reason; + } + +- public void setBanReason(String var1) { +- this.f = var1; ++ public void setBanReason(String par1Str) { ++ this.reason = par1Str; + } + + public String buildBanString() { + StringBuilder var1 = new StringBuilder(); + var1.append(this.getBannedUsername()); + var1.append("|"); +- var1.append(a.format(this.getBanStartDate())); ++ var1.append(dateFormat.format(this.getBanStartDate())); + var1.append("|"); + var1.append(this.getBannedBy()); + var1.append("|"); +- var1.append(this.getBanEndDate() == null ? "Forever" : a.format(this.getBanEndDate())); ++ var1.append(this.getBanEndDate() == null ? "Forever" : dateFormat.format(this.getBanEndDate())); + var1.append("|"); + var1.append(this.getBanReason()); + return var1.toString(); + } + +- public static BanEntry parse(String var0) { +- if(var0.trim().length() < 2) { ++ public static BanEntry parse(String par0Str) { ++ if (par0Str.trim().length() < 2) { + return null; + } else { +- String[] var1 = var0.trim().split(Pattern.quote("|"), 5); ++ String[] var1 = par0Str.trim().split(Pattern.quote("|"), 5); + BanEntry var2 = new BanEntry(var1[0].trim()); + byte var3 = 0; + int var10000 = var1.length; + int var7 = var3 + 1; +- if(var10000 <= var7) { ++ ++ if (var10000 <= var7) { + return var2; + } else { + try { +- var2.setBanStartDate(a.parse(var1[var7].trim())); ++ var2.setBanStartDate(dateFormat.parse(var1[var7].trim())); + } catch (ParseException var6) { + MinecraftServer.getServer().getLogAgent().logWarningException("Could not read creation date format for ban entry \'" + var2.getBannedUsername() + "\' (was: \'" + var1[var7] + "\')", var6); + } + + var10000 = var1.length; + ++var7; +- if(var10000 <= var7) { ++ ++ if (var10000 <= var7) { + return var2; + } else { + var2.setBannedBy(var1[var7].trim()); + var10000 = var1.length; + ++var7; +- if(var10000 <= var7) { ++ ++ if (var10000 <= var7) { + return var2; + } else { + try { + String var4 = var1[var7].trim(); +- if(!var4.equalsIgnoreCase("Forever") && var4.length() > 0) { +- var2.setBanEndDate(a.parse(var4)); ++ ++ if (!var4.equalsIgnoreCase("Forever") && var4.length() > 0) { ++ var2.setBanEndDate(dateFormat.parse(var4)); + } + } catch (ParseException var5) { + MinecraftServer.getServer().getLogAgent().logWarningException("Could not read expiry date format for ban entry \'" + var2.getBannedUsername() + "\' (was: \'" + var1[var7] + "\')", var5); +@@ -112,7 +119,8 @@ + + var10000 = var1.length; + ++var7; +- if(var10000 <= var7) { ++ ++ if (var10000 <= var7) { + return var2; + } else { + var2.setBanReason(var1[var7].trim()); diff --git a/patches/net/minecraft/src/BanList.java.patch b/patches/net/minecraft/src/BanList.java.patch new file mode 100644 index 0000000..200e114 --- /dev/null +++ b/patches/net/minecraft/src/BanList.java.patch @@ -0,0 +1,155 @@ +--- net/minecraft/src/BanList.java ++++ net/minecraft/src/BanList.java +@@ -15,76 +15,83 @@ + + public class BanList { + private final LowerStringMap theBanList = new LowerStringMap(); +- private final File b; ++ private final File fileName; ++ ++ /** set to true if not singlePlayer */ + private boolean listActive = true; + +- public BanList(File var1) { +- this.b = var1; ++ public BanList(File par1File) { ++ this.fileName = par1File; + } + + public boolean isListActive() { + return this.listActive; + } + +- public void setListActive(boolean var1) { +- this.listActive = var1; ++ public void setListActive(boolean par1) { ++ this.listActive = par1; + } + ++ /** ++ * removes expired Bans before returning ++ */ + public Map getBannedList() { + this.removeExpiredBans(); + return this.theBanList; + } + +- public boolean isBanned(String var1) { +- if(!this.isListActive()) { ++ public boolean isBanned(String par1Str) { ++ if (!this.isListActive()) { + return false; + } else { + this.removeExpiredBans(); +- return this.theBanList.containsKey(var1); ++ return this.theBanList.containsKey(par1Str); + } + } + +- public void put(BanEntry var1) { +- this.theBanList.putLower(var1.getBannedUsername(), var1); ++ public void put(BanEntry par1BanEntry) { ++ this.theBanList.putLower(par1BanEntry.getBannedUsername(), par1BanEntry); + this.saveToFileWithHeader(); + } + +- public void remove(String var1) { +- this.theBanList.remove(var1); ++ public void remove(String par1Str) { ++ this.theBanList.remove(par1Str); + this.saveToFileWithHeader(); + } + + public void removeExpiredBans() { + Iterator var1 = this.theBanList.values().iterator(); + +- while(var1.hasNext()) { ++ while (var1.hasNext()) { + BanEntry var2 = (BanEntry)var1.next(); +- if(var2.hasBanExpired()) { ++ ++ if (var2.hasBanExpired()) { + var1.remove(); + } + } +- + } + ++ /** ++ * Loads the ban list from the file (adds every entry, does not clear the current list). ++ */ + public void loadBanList() { +- if(this.b.isFile()) { ++ if (this.fileName.isFile()) { + BufferedReader var1; ++ + try { +- var1 = new BufferedReader(new FileReader(this.b)); ++ var1 = new BufferedReader(new FileReader(this.fileName)); + } catch (FileNotFoundException var4) { + throw new Error(); + } + +- try { +- while(true) { +- String var2 = var1.readLine(); +- if(var2 == null) { +- break; +- } ++ String var2; + +- if(!var2.startsWith("#")) { ++ try { ++ while ((var2 = var1.readLine()) != null) { ++ if (!var2.startsWith("#")) { + BanEntry var3 = BanEntry.parse(var2); +- if(var3 != null) { ++ ++ if (var3 != null) { + this.theBanList.putLower(var3.getBannedUsername(), var3); + } + } +@@ -92,7 +99,6 @@ + } catch (IOException var5) { + MinecraftServer.getServer().getLogAgent().logSevereException("Could not load ban list", var5); + } +- + } + } + +@@ -100,12 +106,16 @@ + this.saveToFile(true); + } + +- public void saveToFile(boolean var1) { ++ /** ++ * par1: include header ++ */ ++ public void saveToFile(boolean par1) { + this.removeExpiredBans(); + + try { +- PrintWriter var2 = new PrintWriter(new FileWriter(this.b, false)); +- if(var1) { ++ PrintWriter var2 = new PrintWriter(new FileWriter(this.fileName, false)); ++ ++ if (par1) { + var2.println("# Updated " + (new SimpleDateFormat()).format(new Date()) + " by Minecraft " + "1.6.4"); + var2.println("# victim name | ban date | banned by | banned until | reason"); + var2.println(); +@@ -113,7 +123,7 @@ + + Iterator var3 = this.theBanList.values().iterator(); + +- while(var3.hasNext()) { ++ while (var3.hasNext()) { + BanEntry var4 = (BanEntry)var3.next(); + var2.println(var4.buildBanString()); + } +@@ -122,6 +132,5 @@ + } catch (IOException var5) { + MinecraftServer.getServer().getLogAgent().logSevereException("Could not save ban list", var5); + } +- + } + } diff --git a/patches/net/minecraft/src/BaseAttribute.java.patch b/patches/net/minecraft/src/BaseAttribute.java.patch new file mode 100644 index 0000000..42047cb --- /dev/null +++ b/patches/net/minecraft/src/BaseAttribute.java.patch @@ -0,0 +1,46 @@ +--- net/minecraft/src/BaseAttribute.java ++++ net/minecraft/src/BaseAttribute.java +@@ -1,20 +1,21 @@ + package net.minecraft.src; + + public abstract class BaseAttribute implements Attribute { +- private final String a; ++ private final String field_111115_a; + private final double defaultValue; + private boolean shouldWatch; + +- protected BaseAttribute(String var1, double var2) { +- this.a = var1; +- this.defaultValue = var2; +- if(var1 == null) { ++ protected BaseAttribute(String par1Str, double par2) { ++ this.field_111115_a = par1Str; ++ this.defaultValue = par2; ++ ++ if (par1Str == null) { + throw new IllegalArgumentException("Name cannot be null!"); + } + } + + public String getAttributeUnlocalizedName() { +- return this.a; ++ return this.field_111115_a; + } + + public double getDefaultValue() { +@@ -25,12 +26,12 @@ + return this.shouldWatch; + } + +- public BaseAttribute setShouldWatch(boolean var1) { +- this.shouldWatch = var1; ++ public BaseAttribute setShouldWatch(boolean par1) { ++ this.shouldWatch = par1; + return this; + } + + public int hashCode() { +- return this.a.hashCode(); ++ return this.field_111115_a.hashCode(); + } + } diff --git a/patches/net/minecraft/src/BaseAttributeMap.java.patch b/patches/net/minecraft/src/BaseAttributeMap.java.patch new file mode 100644 index 0000000..a3495cd --- /dev/null +++ b/patches/net/minecraft/src/BaseAttributeMap.java.patch @@ -0,0 +1,75 @@ +--- net/minecraft/src/BaseAttributeMap.java ++++ net/minecraft/src/BaseAttributeMap.java +@@ -8,50 +8,49 @@ + import java.util.Map.Entry; + + public abstract class BaseAttributeMap { +- protected final Map a = new HashMap(); +- protected final Map b = new LowerStringMap(); ++ protected final Map attributes = new HashMap(); ++ protected final Map attributesByName = new LowerStringMap(); + +- public AttributeInstance getAttributeInstance(Attribute var1) { +- return (AttributeInstance)this.a.get(var1); ++ public AttributeInstance getAttributeInstance(Attribute par1Attribute) { ++ return (AttributeInstance)this.attributes.get(par1Attribute); + } + +- public AttributeInstance getAttributeInstanceByName(String var1) { +- return (AttributeInstance)this.b.get(var1); ++ public AttributeInstance getAttributeInstanceByName(String par1Str) { ++ return (AttributeInstance)this.attributesByName.get(par1Str); + } + + public abstract AttributeInstance func_111150_b(Attribute var1); + + public Collection getAllAttributes() { +- return this.b.values(); +- } +- +- public void func_111149_a(ModifiableAttributeInstance var1) { +- } +- +- public void removeAttributeModifiers(Multimap var1) { +- Iterator var2 = var1.entries().iterator(); +- +- while(var2.hasNext()) { ++ return this.attributesByName.values(); ++ } ++ ++ public void func_111149_a(ModifiableAttributeInstance par1ModifiableAttributeInstance) {} ++ ++ public void removeAttributeModifiers(Multimap par1Multimap) { ++ Iterator var2 = par1Multimap.entries().iterator(); ++ ++ while (var2.hasNext()) { + Entry var3 = (Entry)var2.next(); + AttributeInstance var4 = this.getAttributeInstanceByName((String)var3.getKey()); +- if(var4 != null) { ++ ++ if (var4 != null) { + var4.removeModifier((AttributeModifier)var3.getValue()); + } + } +- + } + +- public void applyAttributeModifiers(Multimap var1) { +- Iterator var2 = var1.entries().iterator(); ++ public void applyAttributeModifiers(Multimap par1Multimap) { ++ Iterator var2 = par1Multimap.entries().iterator(); + +- while(var2.hasNext()) { ++ while (var2.hasNext()) { + Entry var3 = (Entry)var2.next(); + AttributeInstance var4 = this.getAttributeInstanceByName((String)var3.getKey()); +- if(var4 != null) { ++ ++ if (var4 != null) { + var4.removeModifier((AttributeModifier)var3.getValue()); + var4.applyModifier((AttributeModifier)var3.getValue()); + } + } +- + } + } diff --git a/patches/net/minecraft/src/BaseMetadataSectionSerializer.java.patch b/patches/net/minecraft/src/BaseMetadataSectionSerializer.java.patch new file mode 100644 index 0000000..ff251d3 --- /dev/null +++ b/patches/net/minecraft/src/BaseMetadataSectionSerializer.java.patch @@ -0,0 +1,179 @@ +--- net/minecraft/src/BaseMetadataSectionSerializer.java ++++ net/minecraft/src/BaseMetadataSectionSerializer.java +@@ -4,92 +4,99 @@ + import com.google.gson.JsonParseException; + + public abstract class BaseMetadataSectionSerializer implements MetadataSectionSerializer { +- protected float func_110487_a(JsonElement var1, String var2, Float var3, float var4, float var5) { +- var2 = this.getSectionName() + "->" + var2; +- if(var1 == null) { +- if(var3 == null) { +- throw new JsonParseException("Missing " + var2 + ": expected float"); +- } else { +- return var3.floatValue(); +- } +- } else if(!var1.isJsonPrimitive()) { +- throw new JsonParseException("Invalid " + var2 + ": expected float, was " + var1); +- } else { +- try { +- float var6 = var1.getAsFloat(); +- if(var6 < var4) { +- throw new JsonParseException("Invalid " + var2 + ": expected float >= " + var4 + ", was " + var6); +- } else if(var6 > var5) { +- throw new JsonParseException("Invalid " + var2 + ": expected float <= " + var5 + ", was " + var6); +- } else { +- return var6; +- } +- } catch (NumberFormatException var7) { +- throw new JsonParseException("Invalid " + var2 + ": expected float, was " + var1, var7); +- } +- } +- } +- +- protected int func_110485_a(JsonElement var1, String var2, Integer var3, int var4, int var5) { +- var2 = this.getSectionName() + "->" + var2; +- if(var1 == null) { +- if(var3 == null) { +- throw new JsonParseException("Missing " + var2 + ": expected int"); +- } else { +- return var3.intValue(); +- } +- } else if(!var1.isJsonPrimitive()) { +- throw new JsonParseException("Invalid " + var2 + ": expected int, was " + var1); +- } else { +- try { +- int var6 = var1.getAsInt(); +- if(var6 < var4) { +- throw new JsonParseException("Invalid " + var2 + ": expected int >= " + var4 + ", was " + var6); +- } else if(var6 > var5) { +- throw new JsonParseException("Invalid " + var2 + ": expected int <= " + var5 + ", was " + var6); +- } else { +- return var6; +- } +- } catch (NumberFormatException var7) { +- throw new JsonParseException("Invalid " + var2 + ": expected int, was " + var1, var7); +- } +- } +- } +- +- protected String func_110486_a(JsonElement var1, String var2, String var3, int var4, int var5) { +- var2 = this.getSectionName() + "->" + var2; +- if(var1 == null) { +- if(var3 == null) { +- throw new JsonParseException("Missing " + var2 + ": expected string"); +- } else { +- return var3; +- } +- } else if(!var1.isJsonPrimitive()) { +- throw new JsonParseException("Invalid " + var2 + ": expected string, was " + var1); +- } else { +- String var6 = var1.getAsString(); +- if(var6.length() < var4) { +- throw new JsonParseException("Invalid " + var2 + ": expected string length >= " + var4 + ", was " + var6); +- } else if(var6.length() > var5) { +- throw new JsonParseException("Invalid " + var2 + ": expected string length <= " + var5 + ", was " + var6); ++ protected float func_110487_a(JsonElement par1JsonElement, String par2Str, Float par3, float par4, float par5) { ++ par2Str = this.getSectionName() + "->" + par2Str; ++ ++ if (par1JsonElement == null) { ++ if (par3 == null) { ++ throw new JsonParseException("Missing " + par2Str + ": expected float"); ++ } else { ++ return par3.floatValue(); ++ } ++ } else if (!par1JsonElement.isJsonPrimitive()) { ++ throw new JsonParseException("Invalid " + par2Str + ": expected float, was " + par1JsonElement); ++ } else { ++ try { ++ float var6 = par1JsonElement.getAsFloat(); ++ ++ if (var6 < par4) { ++ throw new JsonParseException("Invalid " + par2Str + ": expected float >= " + par4 + ", was " + var6); ++ } else if (var6 > par5) { ++ throw new JsonParseException("Invalid " + par2Str + ": expected float <= " + par5 + ", was " + var6); ++ } else { ++ return var6; ++ } ++ } catch (NumberFormatException var7) { ++ throw new JsonParseException("Invalid " + par2Str + ": expected float, was " + par1JsonElement, var7); ++ } ++ } ++ } ++ ++ protected int func_110485_a(JsonElement par1JsonElement, String par2Str, Integer par3, int par4, int par5) { ++ par2Str = this.getSectionName() + "->" + par2Str; ++ ++ if (par1JsonElement == null) { ++ if (par3 == null) { ++ throw new JsonParseException("Missing " + par2Str + ": expected int"); ++ } else { ++ return par3.intValue(); ++ } ++ } else if (!par1JsonElement.isJsonPrimitive()) { ++ throw new JsonParseException("Invalid " + par2Str + ": expected int, was " + par1JsonElement); ++ } else { ++ try { ++ int var6 = par1JsonElement.getAsInt(); ++ ++ if (var6 < par4) { ++ throw new JsonParseException("Invalid " + par2Str + ": expected int >= " + par4 + ", was " + var6); ++ } else if (var6 > par5) { ++ throw new JsonParseException("Invalid " + par2Str + ": expected int <= " + par5 + ", was " + var6); ++ } else { ++ return var6; ++ } ++ } catch (NumberFormatException var7) { ++ throw new JsonParseException("Invalid " + par2Str + ": expected int, was " + par1JsonElement, var7); ++ } ++ } ++ } ++ ++ protected String func_110486_a(JsonElement par1JsonElement, String par2Str, String par3Str, int par4, int par5) { ++ par2Str = this.getSectionName() + "->" + par2Str; ++ ++ if (par1JsonElement == null) { ++ if (par3Str == null) { ++ throw new JsonParseException("Missing " + par2Str + ": expected string"); ++ } else { ++ return par3Str; ++ } ++ } else if (!par1JsonElement.isJsonPrimitive()) { ++ throw new JsonParseException("Invalid " + par2Str + ": expected string, was " + par1JsonElement); ++ } else { ++ String var6 = par1JsonElement.getAsString(); ++ ++ if (var6.length() < par4) { ++ throw new JsonParseException("Invalid " + par2Str + ": expected string length >= " + par4 + ", was " + var6); ++ } else if (var6.length() > par5) { ++ throw new JsonParseException("Invalid " + par2Str + ": expected string length <= " + par5 + ", was " + var6); + } else { + return var6; + } + } + } + +- protected boolean func_110484_a(JsonElement var1, String var2, Boolean var3) { +- var2 = this.getSectionName() + "->" + var2; +- if(var1 == null) { +- if(var3 == null) { +- throw new JsonParseException("Missing " + var2 + ": expected boolean"); ++ protected boolean func_110484_a(JsonElement par1JsonElement, String par2Str, Boolean par3) { ++ par2Str = this.getSectionName() + "->" + par2Str; ++ ++ if (par1JsonElement == null) { ++ if (par3 == null) { ++ throw new JsonParseException("Missing " + par2Str + ": expected boolean"); + } else { +- return var3.booleanValue(); ++ return par3.booleanValue(); + } +- } else if(!var1.isJsonPrimitive()) { +- throw new JsonParseException("Invalid " + var2 + ": expected boolean, was " + var1); ++ } else if (!par1JsonElement.isJsonPrimitive()) { ++ throw new JsonParseException("Invalid " + par2Str + ": expected boolean, was " + par1JsonElement); + } else { +- boolean var4 = var1.getAsBoolean(); ++ boolean var4 = par1JsonElement.getAsBoolean(); + return var4; + } + } diff --git a/patches/net/minecraft/src/BehaviorDefaultDispenseItem.java.patch b/patches/net/minecraft/src/BehaviorDefaultDispenseItem.java.patch new file mode 100644 index 0000000..d27246b --- /dev/null +++ b/patches/net/minecraft/src/BehaviorDefaultDispenseItem.java.patch @@ -0,0 +1,98 @@ +--- net/minecraft/src/BehaviorDefaultDispenseItem.java ++++ net/minecraft/src/BehaviorDefaultDispenseItem.java +@@ -1,45 +1,58 @@ + package net.minecraft.src; + + public class BehaviorDefaultDispenseItem implements IBehaviorDispenseItem { +- public final ItemStack dispense(IBlockSource var1, ItemStack var2) { +- ItemStack var3 = this.dispenseStack(var1, var2); +- this.playDispenseSound(var1); +- this.spawnDispenseParticles(var1, BlockDispenser.getFacing(var1.getBlockMetadata())); ++ ++ /** ++ * Dispenses the specified ItemStack from a dispenser. ++ */ ++ public final ItemStack dispense(IBlockSource par1IBlockSource, ItemStack par2ItemStack) { ++ ItemStack var3 = this.dispenseStack(par1IBlockSource, par2ItemStack); ++ this.playDispenseSound(par1IBlockSource); ++ this.spawnDispenseParticles(par1IBlockSource, BlockDispenser.getFacing(par1IBlockSource.getBlockMetadata())); + return var3; + } + +- protected ItemStack dispenseStack(IBlockSource var1, ItemStack var2) { +- EnumFacing var3 = BlockDispenser.getFacing(var1.getBlockMetadata()); +- IPosition var4 = BlockDispenser.getIPositionFromBlockSource(var1); +- ItemStack var5 = var2.splitStack(1); +- doDispense(var1.getWorld(), var5, 6, var3, var4); +- return var2; +- } +- +- public static void doDispense(World var0, ItemStack var1, int var2, EnumFacing var3, IPosition var4) { +- double var5 = var4.getX(); +- double var7 = var4.getY(); +- double var9 = var4.getZ(); +- EntityItem var11 = new EntityItem(var0, var5, var7 - 0.3D, var9, var1); +- double var12 = var0.s.nextDouble() * 0.1D + 0.2D; +- var11.motionX = (double)var3.getFrontOffsetX() * var12; +- var11.motionY = (double)0.2F; +- var11.motionZ = (double)var3.getFrontOffsetZ() * var12; +- var11.motionX += var0.s.nextGaussian() * (double)0.0075F * (double)var2; +- var11.motionY += var0.s.nextGaussian() * (double)0.0075F * (double)var2; +- var11.motionZ += var0.s.nextGaussian() * (double)0.0075F * (double)var2; +- var0.spawnEntityInWorld(var11); +- } +- +- protected void playDispenseSound(IBlockSource var1) { +- var1.getWorld().playAuxSFX(1000, var1.getXInt(), var1.getYInt(), var1.getZInt(), 0); +- } +- +- protected void spawnDispenseParticles(IBlockSource var1, EnumFacing var2) { +- var1.getWorld().playAuxSFX(2000, var1.getXInt(), var1.getYInt(), var1.getZInt(), this.func_82488_a(var2)); +- } +- +- private int func_82488_a(EnumFacing var1) { +- return var1.getFrontOffsetX() + 1 + (var1.getFrontOffsetZ() + 1) * 3; ++ /** ++ * Dispense the specified stack, play the dispense sound and spawn particles. ++ */ ++ protected ItemStack dispenseStack(IBlockSource par1IBlockSource, ItemStack par2ItemStack) { ++ EnumFacing var3 = BlockDispenser.getFacing(par1IBlockSource.getBlockMetadata()); ++ IPosition var4 = BlockDispenser.getIPositionFromBlockSource(par1IBlockSource); ++ ItemStack var5 = par2ItemStack.splitStack(1); ++ doDispense(par1IBlockSource.getWorld(), var5, 6, var3, var4); ++ return par2ItemStack; ++ } ++ ++ public static void doDispense(World par0World, ItemStack par1ItemStack, int par2, EnumFacing par3EnumFacing, IPosition par4IPosition) { ++ double var5 = par4IPosition.getX(); ++ double var7 = par4IPosition.getY(); ++ double var9 = par4IPosition.getZ(); ++ EntityItem var11 = new EntityItem(par0World, var5, var7 - 0.3D, var9, par1ItemStack); ++ double var12 = par0World.rand.nextDouble() * 0.1D + 0.2D; ++ var11.motionX = (double)par3EnumFacing.getFrontOffsetX() * var12; ++ var11.motionY = 0.20000000298023224D; ++ var11.motionZ = (double)par3EnumFacing.getFrontOffsetZ() * var12; ++ var11.motionX += par0World.rand.nextGaussian() * 0.007499999832361937D * (double)par2; ++ var11.motionY += par0World.rand.nextGaussian() * 0.007499999832361937D * (double)par2; ++ var11.motionZ += par0World.rand.nextGaussian() * 0.007499999832361937D * (double)par2; ++ par0World.spawnEntityInWorld(var11); ++ } ++ ++ /** ++ * Play the dispense sound from the specified block. ++ */ ++ protected void playDispenseSound(IBlockSource par1IBlockSource) { ++ par1IBlockSource.getWorld().playAuxSFX(1000, par1IBlockSource.getXInt(), par1IBlockSource.getYInt(), par1IBlockSource.getZInt(), 0); ++ } ++ ++ /** ++ * Order clients to display dispense particles from the specified block and facing. ++ */ ++ protected void spawnDispenseParticles(IBlockSource par1IBlockSource, EnumFacing par2EnumFacing) { ++ par1IBlockSource.getWorld().playAuxSFX(2000, par1IBlockSource.getXInt(), par1IBlockSource.getYInt(), par1IBlockSource.getZInt(), this.func_82488_a(par2EnumFacing)); ++ } ++ ++ private int func_82488_a(EnumFacing par1EnumFacing) { ++ return par1EnumFacing.getFrontOffsetX() + 1 + (par1EnumFacing.getFrontOffsetZ() + 1) * 3; + } + } diff --git a/patches/net/minecraft/src/BehaviorDispenseArmor.java.patch b/patches/net/minecraft/src/BehaviorDispenseArmor.java.patch new file mode 100644 index 0000000..9c87cae --- /dev/null +++ b/patches/net/minecraft/src/BehaviorDispenseArmor.java.patch @@ -0,0 +1,50 @@ +--- net/minecraft/src/BehaviorDispenseArmor.java ++++ net/minecraft/src/BehaviorDispenseArmor.java +@@ -3,28 +3,34 @@ + import java.util.List; + + final class BehaviorDispenseArmor extends BehaviorDefaultDispenseItem { +- protected ItemStack dispenseStack(IBlockSource var1, ItemStack var2) { +- EnumFacing var3 = BlockDispenser.getFacing(var1.getBlockMetadata()); +- int var4 = var1.getXInt() + var3.getFrontOffsetX(); +- int var5 = var1.getYInt() + var3.getFrontOffsetY(); +- int var6 = var1.getZInt() + var3.getFrontOffsetZ(); ++ ++ /** ++ * Dispense the specified stack, play the dispense sound and spawn particles. ++ */ ++ protected ItemStack dispenseStack(IBlockSource par1IBlockSource, ItemStack par2ItemStack) { ++ EnumFacing var3 = BlockDispenser.getFacing(par1IBlockSource.getBlockMetadata()); ++ int var4 = par1IBlockSource.getXInt() + var3.getFrontOffsetX(); ++ int var5 = par1IBlockSource.getYInt() + var3.getFrontOffsetY(); ++ int var6 = par1IBlockSource.getZInt() + var3.getFrontOffsetZ(); + AxisAlignedBB var7 = AxisAlignedBB.getAABBPool().getAABB((double)var4, (double)var5, (double)var6, (double)(var4 + 1), (double)(var5 + 1), (double)(var6 + 1)); +- List var8 = var1.getWorld().selectEntitiesWithinAABB(EntityLivingBase.class, var7, new EntitySelectorArmoredMob(var2)); +- if(var8.size() > 0) { ++ List var8 = par1IBlockSource.getWorld().selectEntitiesWithinAABB(EntityLivingBase.class, var7, new EntitySelectorArmoredMob(par2ItemStack)); ++ ++ if (var8.size() > 0) { + EntityLivingBase var9 = (EntityLivingBase)var8.get(0); + int var10 = var9 instanceof EntityPlayer ? 1 : 0; +- int var11 = EntityLiving.getArmorPosition(var2); +- ItemStack var12 = var2.copy(); ++ int var11 = EntityLiving.getArmorPosition(par2ItemStack); ++ ItemStack var12 = par2ItemStack.copy(); + var12.stackSize = 1; + var9.setCurrentItemOrArmor(var11 - var10, var12); +- if(var9 instanceof EntityLiving) { ++ ++ if (var9 instanceof EntityLiving) { + ((EntityLiving)var9).setEquipmentDropChance(var11, 2.0F); + } + +- --var2.stackSize; +- return var2; ++ --par2ItemStack.stackSize; ++ return par2ItemStack; + } else { +- return super.dispenseStack(var1, var2); ++ return super.dispenseStack(par1IBlockSource, par2ItemStack); + } + } + } diff --git a/patches/net/minecraft/src/BehaviorDispenseItemProvider.java.patch b/patches/net/minecraft/src/BehaviorDispenseItemProvider.java.patch new file mode 100644 index 0000000..f7e9529 --- /dev/null +++ b/patches/net/minecraft/src/BehaviorDispenseItemProvider.java.patch @@ -0,0 +1,16 @@ +--- net/minecraft/src/BehaviorDispenseItemProvider.java ++++ net/minecraft/src/BehaviorDispenseItemProvider.java +@@ -1,7 +1,11 @@ + package net.minecraft.src; + + final class BehaviorDispenseItemProvider implements IBehaviorDispenseItem { +- public ItemStack dispense(IBlockSource var1, ItemStack var2) { +- return var2; ++ ++ /** ++ * Dispenses the specified ItemStack from a dispenser. ++ */ ++ public ItemStack dispense(IBlockSource par1IBlockSource, ItemStack par2ItemStack) { ++ return par2ItemStack; + } + } diff --git a/patches/net/minecraft/src/BehaviorDispenseMinecart.java.patch b/patches/net/minecraft/src/BehaviorDispenseMinecart.java.patch new file mode 100644 index 0000000..6c7ed07 --- /dev/null +++ b/patches/net/minecraft/src/BehaviorDispenseMinecart.java.patch @@ -0,0 +1,68 @@ +--- net/minecraft/src/BehaviorDispenseMinecart.java ++++ net/minecraft/src/BehaviorDispenseMinecart.java +@@ -3,38 +3,46 @@ + final class BehaviorDispenseMinecart extends BehaviorDefaultDispenseItem { + private final BehaviorDefaultDispenseItem behaviourDefaultDispenseItem = new BehaviorDefaultDispenseItem(); + +- public ItemStack dispenseStack(IBlockSource var1, ItemStack var2) { +- EnumFacing var3 = BlockDispenser.getFacing(var1.getBlockMetadata()); +- World var4 = var1.getWorld(); +- double var5 = var1.getX() + (double)((float)var3.getFrontOffsetX() * 1.125F); +- double var7 = var1.getY() + (double)((float)var3.getFrontOffsetY() * 1.125F); +- double var9 = var1.getZ() + (double)((float)var3.getFrontOffsetZ() * 1.125F); +- int var11 = var1.getXInt() + var3.getFrontOffsetX(); +- int var12 = var1.getYInt() + var3.getFrontOffsetY(); +- int var13 = var1.getZInt() + var3.getFrontOffsetZ(); ++ /** ++ * Dispense the specified stack, play the dispense sound and spawn particles. ++ */ ++ public ItemStack dispenseStack(IBlockSource par1IBlockSource, ItemStack par2ItemStack) { ++ EnumFacing var3 = BlockDispenser.getFacing(par1IBlockSource.getBlockMetadata()); ++ World var4 = par1IBlockSource.getWorld(); ++ double var5 = par1IBlockSource.getX() + (double)((float)var3.getFrontOffsetX() * 1.125F); ++ double var7 = par1IBlockSource.getY() + (double)((float)var3.getFrontOffsetY() * 1.125F); ++ double var9 = par1IBlockSource.getZ() + (double)((float)var3.getFrontOffsetZ() * 1.125F); ++ int var11 = par1IBlockSource.getXInt() + var3.getFrontOffsetX(); ++ int var12 = par1IBlockSource.getYInt() + var3.getFrontOffsetY(); ++ int var13 = par1IBlockSource.getZInt() + var3.getFrontOffsetZ(); + int var14 = var4.getBlockId(var11, var12, var13); + double var15; +- if(BlockRailBase.isRailBlock(var14)) { ++ ++ if (BlockRailBase.isRailBlock(var14)) { + var15 = 0.0D; + } else { +- if(var14 != 0 || !BlockRailBase.isRailBlock(var4.getBlockId(var11, var12 - 1, var13))) { +- return this.behaviourDefaultDispenseItem.dispense(var1, var2); ++ if (var14 != 0 || !BlockRailBase.isRailBlock(var4.getBlockId(var11, var12 - 1, var13))) { ++ return this.behaviourDefaultDispenseItem.dispense(par1IBlockSource, par2ItemStack); + } + + var15 = -1.0D; + } + +- EntityMinecart var17 = EntityMinecart.createMinecart(var4, var5, var7 + var15, var9, ((ItemMinecart)var2.getItem()).minecartType); +- if(var2.hasDisplayName()) { +- var17.setMinecartName(var2.getDisplayName()); ++ EntityMinecart var17 = EntityMinecart.createMinecart(var4, var5, var7 + var15, var9, ((ItemMinecart)par2ItemStack.getItem()).minecartType); ++ ++ if (par2ItemStack.hasDisplayName()) { ++ var17.setMinecartName(par2ItemStack.getDisplayName()); + } + + var4.spawnEntityInWorld(var17); +- var2.splitStack(1); +- return var2; ++ par2ItemStack.splitStack(1); ++ return par2ItemStack; + } + +- protected void playDispenseSound(IBlockSource var1) { +- var1.getWorld().playAuxSFX(1000, var1.getXInt(), var1.getYInt(), var1.getZInt(), 0); ++ /** ++ * Play the dispense sound from the specified block. ++ */ ++ protected void playDispenseSound(IBlockSource par1IBlockSource) { ++ par1IBlockSource.getWorld().playAuxSFX(1000, par1IBlockSource.getXInt(), par1IBlockSource.getYInt(), par1IBlockSource.getZInt(), 0); + } + } diff --git a/patches/net/minecraft/src/BehaviorProjectileDispense.java.patch b/patches/net/minecraft/src/BehaviorProjectileDispense.java.patch new file mode 100644 index 0000000..6ed4f69 --- /dev/null +++ b/patches/net/minecraft/src/BehaviorProjectileDispense.java.patch @@ -0,0 +1,46 @@ +--- net/minecraft/src/BehaviorProjectileDispense.java ++++ net/minecraft/src/BehaviorProjectileDispense.java +@@ -1,21 +1,31 @@ + package net.minecraft.src; + + public abstract class BehaviorProjectileDispense extends BehaviorDefaultDispenseItem { +- public ItemStack dispenseStack(IBlockSource var1, ItemStack var2) { +- World var3 = var1.getWorld(); +- IPosition var4 = BlockDispenser.getIPositionFromBlockSource(var1); +- EnumFacing var5 = BlockDispenser.getFacing(var1.getBlockMetadata()); ++ ++ /** ++ * Dispense the specified stack, play the dispense sound and spawn particles. ++ */ ++ public ItemStack dispenseStack(IBlockSource par1IBlockSource, ItemStack par2ItemStack) { ++ World var3 = par1IBlockSource.getWorld(); ++ IPosition var4 = BlockDispenser.getIPositionFromBlockSource(par1IBlockSource); ++ EnumFacing var5 = BlockDispenser.getFacing(par1IBlockSource.getBlockMetadata()); + IProjectile var6 = this.getProjectileEntity(var3, var4); + var6.setThrowableHeading((double)var5.getFrontOffsetX(), (double)((float)var5.getFrontOffsetY() + 0.1F), (double)var5.getFrontOffsetZ(), this.func_82500_b(), this.func_82498_a()); + var3.spawnEntityInWorld((Entity)var6); +- var2.splitStack(1); +- return var2; +- } +- +- protected void playDispenseSound(IBlockSource var1) { +- var1.getWorld().playAuxSFX(1002, var1.getXInt(), var1.getYInt(), var1.getZInt(), 0); +- } +- ++ par2ItemStack.splitStack(1); ++ return par2ItemStack; ++ } ++ ++ /** ++ * Play the dispense sound from the specified block. ++ */ ++ protected void playDispenseSound(IBlockSource par1IBlockSource) { ++ par1IBlockSource.getWorld().playAuxSFX(1002, par1IBlockSource.getXInt(), par1IBlockSource.getYInt(), par1IBlockSource.getZInt(), 0); ++ } ++ ++ /** ++ * Return the projectile entity spawned by this dispense behavior. ++ */ + protected abstract IProjectile getProjectileEntity(World var1, IPosition var2); + + protected float func_82498_a() { diff --git a/patches/net/minecraft/src/BiomeCache.java.patch b/patches/net/minecraft/src/BiomeCache.java.patch new file mode 100644 index 0000000..4b4b59c --- /dev/null +++ b/patches/net/minecraft/src/BiomeCache.java.patch @@ -0,0 +1,117 @@ +--- net/minecraft/src/BiomeCache.java ++++ net/minecraft/src/BiomeCache.java +@@ -5,58 +5,85 @@ + import net.minecraft.server.MinecraftServer; + + public class BiomeCache { ++ ++ /** Reference to the WorldChunkManager */ + private final WorldChunkManager chunkManager; ++ ++ /** The last time this BiomeCache was cleaned, in milliseconds. */ + private long lastCleanupTime; ++ ++ /** ++ * The map of keys to BiomeCacheBlocks. Keys are based on the chunk x, z coordinates as (x | z << 32). ++ */ + private LongHashMap cacheMap = new LongHashMap(); +- private List d = new ArrayList(); +- +- public BiomeCache(WorldChunkManager var1) { +- this.chunkManager = var1; ++ ++ /** The list of cached BiomeCacheBlocks */ ++ private List cache = new ArrayList(); ++ ++ public BiomeCache(WorldChunkManager par1WorldChunkManager) { ++ this.chunkManager = par1WorldChunkManager; + } + +- public BiomeCacheBlock getBiomeCacheBlock(int var1, int var2) { +- var1 >>= 4; +- var2 >>= 4; +- long var3 = (long)var1 & 4294967295L | ((long)var2 & 4294967295L) << 32; ++ /** ++ * Returns a biome cache block at location specified. ++ */ ++ public BiomeCacheBlock getBiomeCacheBlock(int par1, int par2) { ++ par1 >>= 4; ++ par2 >>= 4; ++ long var3 = (long)par1 & 4294967295L | ((long)par2 & 4294967295L) << 32; + BiomeCacheBlock var5 = (BiomeCacheBlock)this.cacheMap.getValueByKey(var3); +- if(var5 == null) { +- var5 = new BiomeCacheBlock(this, var1, var2); ++ ++ if (var5 == null) { ++ var5 = new BiomeCacheBlock(this, par1, par2); + this.cacheMap.add(var3, var5); +- this.d.add(var5); ++ this.cache.add(var5); + } + +- var5.lastAccessTime = MinecraftServer.getCurrentTimeMillis(); ++ var5.lastAccessTime = MinecraftServer.getSystemTimeMillis(); + return var5; + } + +- public BiomeGenBase getBiomeGenAt(int var1, int var2) { +- return this.getBiomeCacheBlock(var1, var2).getBiomeGenAt(var1, var2); ++ /** ++ * Returns the BiomeGenBase related to the x, z position from the cache. ++ */ ++ public BiomeGenBase getBiomeGenAt(int par1, int par2) { ++ return this.getBiomeCacheBlock(par1, par2).getBiomeGenAt(par1, par2); + } + ++ /** ++ * Removes BiomeCacheBlocks from this cache that haven't been accessed in at least 30 seconds. ++ */ + public void cleanupCache() { +- long var1 = MinecraftServer.getCurrentTimeMillis(); ++ long var1 = MinecraftServer.getSystemTimeMillis(); + long var3 = var1 - this.lastCleanupTime; +- if(var3 > 7500L || var3 < 0L) { ++ ++ if (var3 > 7500L || var3 < 0L) { + this.lastCleanupTime = var1; + +- for(int var5 = 0; var5 < this.d.size(); ++var5) { +- BiomeCacheBlock var6 = (BiomeCacheBlock)this.d.get(var5); ++ for (int var5 = 0; var5 < this.cache.size(); ++var5) { ++ BiomeCacheBlock var6 = (BiomeCacheBlock)this.cache.get(var5); + long var7 = var1 - var6.lastAccessTime; +- if(var7 > 30000L || var7 < 0L) { +- this.d.remove(var5--); ++ ++ if (var7 > 30000L || var7 < 0L) { ++ this.cache.remove(var5--); + long var9 = (long)var6.xPosition & 4294967295L | ((long)var6.zPosition & 4294967295L) << 32; + this.cacheMap.remove(var9); + } + } + } +- +- } +- +- public BiomeGenBase[] getCachedBiomes(int var1, int var2) { +- return this.getBiomeCacheBlock(var1, var2).biomes; +- } +- +- static WorldChunkManager getChunkManager(BiomeCache var0) { +- return var0.chunkManager; ++ } ++ ++ /** ++ * Returns the array of cached biome types in the BiomeCacheBlock at the given location. ++ */ ++ public BiomeGenBase[] getCachedBiomes(int par1, int par2) { ++ return this.getBiomeCacheBlock(par1, par2).biomes; ++ } ++ ++ /** ++ * Get the world chunk manager object for a biome list. ++ */ ++ static WorldChunkManager getChunkManager(BiomeCache par0BiomeCache) { ++ return par0BiomeCache.chunkManager; + } + } diff --git a/patches/net/minecraft/src/BiomeCacheBlock.java.patch b/patches/net/minecraft/src/BiomeCacheBlock.java.patch new file mode 100644 index 0000000..8a9944d --- /dev/null +++ b/patches/net/minecraft/src/BiomeCacheBlock.java.patch @@ -0,0 +1,56 @@ +--- net/minecraft/src/BiomeCacheBlock.java ++++ net/minecraft/src/BiomeCacheBlock.java +@@ -1,27 +1,44 @@ + package net.minecraft.src; + + public class BiomeCacheBlock { ++ ++ /** An array of chunk temperatures saved by this cache. */ + public float[] temperatureValues; ++ ++ /** An array of chunk rainfall values saved by this cache. */ + public float[] rainfallValues; ++ ++ /** The array of biome types stored in this BiomeCacheBlock. */ + public BiomeGenBase[] biomes; ++ ++ /** The x coordinate of the BiomeCacheBlock. */ + public int xPosition; ++ ++ /** The z coordinate of the BiomeCacheBlock. */ + public int zPosition; ++ ++ /** The last time this BiomeCacheBlock was accessed, in milliseconds. */ + public long lastAccessTime; ++ ++ /** The BiomeCache object that contains this BiomeCacheBlock */ + final BiomeCache theBiomeCache; + +- public BiomeCacheBlock(BiomeCache var1, int var2, int var3) { +- this.theBiomeCache = var1; ++ public BiomeCacheBlock(BiomeCache par1BiomeCache, int par2, int par3) { ++ this.theBiomeCache = par1BiomeCache; + this.temperatureValues = new float[256]; + this.rainfallValues = new float[256]; + this.biomes = new BiomeGenBase[256]; +- this.xPosition = var2; +- this.zPosition = var3; +- BiomeCache.getChunkManager(var1).getTemperatures(this.temperatureValues, var2 << 4, var3 << 4, 16, 16); +- BiomeCache.getChunkManager(var1).getRainfall(this.rainfallValues, var2 << 4, var3 << 4, 16, 16); +- BiomeCache.getChunkManager(var1).getBiomeGenAt(this.biomes, var2 << 4, var3 << 4, 16, 16, false); ++ this.xPosition = par2; ++ this.zPosition = par3; ++ BiomeCache.getChunkManager(par1BiomeCache).getTemperatures(this.temperatureValues, par2 << 4, par3 << 4, 16, 16); ++ BiomeCache.getChunkManager(par1BiomeCache).getRainfall(this.rainfallValues, par2 << 4, par3 << 4, 16, 16); ++ BiomeCache.getChunkManager(par1BiomeCache).getBiomeGenAt(this.biomes, par2 << 4, par3 << 4, 16, 16, false); + } + +- public BiomeGenBase getBiomeGenAt(int var1, int var2) { +- return this.biomes[var1 & 15 | (var2 & 15) << 4]; ++ /** ++ * Returns the BiomeGenBase related to the x, z position from the cache block. ++ */ ++ public BiomeGenBase getBiomeGenAt(int par1, int par2) { ++ return this.biomes[par1 & 15 | (par2 & 15) << 4]; + } + } diff --git a/patches/net/minecraft/src/BiomeDecorator.java.patch b/patches/net/minecraft/src/BiomeDecorator.java.patch new file mode 100644 index 0000000..705d773 --- /dev/null +++ b/patches/net/minecraft/src/BiomeDecorator.java.patch @@ -0,0 +1,574 @@ +--- net/minecraft/src/BiomeDecorator.java ++++ net/minecraft/src/BiomeDecorator.java +@@ -3,241 +3,376 @@ + import java.util.Random; + + public class BiomeDecorator { ++ ++ /** The world the BiomeDecorator is currently decorating */ + protected World currentWorld; +- protected Random b; ++ ++ /** The Biome Decorator's random number generator. */ ++ protected Random randomGenerator; ++ ++ /** The X-coordinate of the chunk currently being decorated */ + protected int chunk_X; ++ ++ /** The Z-coordinate of the chunk currently being decorated */ + protected int chunk_Z; ++ ++ /** The biome generator object. */ + protected BiomeGenBase biome; ++ ++ /** The clay generator. */ + protected WorldGenerator clayGen = new WorldGenClay(4); +- protected WorldGenerator sandGen = new WorldGenSand(7, Block.sand.blockID); +- protected WorldGenerator gravelAsSandGen = new WorldGenSand(6, Block.gravel.blockID); +- protected WorldGenerator dirtGen = new WorldGenMinable(Block.dirt.blockID, 32); +- protected WorldGenerator gravelGen = new WorldGenMinable(Block.gravel.blockID, 32); +- protected WorldGenerator coalGen = new WorldGenMinable(Block.oreCoal.blockID, 16); +- protected WorldGenerator ironGen = new WorldGenMinable(Block.oreIron.blockID, 8); +- protected WorldGenerator goldGen = new WorldGenMinable(Block.oreGold.blockID, 8); +- protected WorldGenerator redstoneGen = new WorldGenMinable(Block.oreRedstone.blockID, 7); +- protected WorldGenerator diamondGen = new WorldGenMinable(Block.oreDiamond.blockID, 7); +- protected WorldGenerator lapisGen = new WorldGenMinable(Block.oreLapis.blockID, 6); +- protected WorldGenerator plantYellowGen = new WorldGenFlowers(Block.plantYellow.blockID); +- protected WorldGenerator plantRedGen = new WorldGenFlowers(Block.plantRed.blockID); +- protected WorldGenerator mushroomBrownGen = new WorldGenFlowers(Block.mushroomBrown.blockID); +- protected WorldGenerator mushroomRedGen = new WorldGenFlowers(Block.mushroomRed.blockID); +- protected WorldGenerator bigMushroomGen = new WorldGenBigMushroom(); +- protected WorldGenerator reedGen = new WorldGenReed(); +- protected WorldGenerator cactusGen = new WorldGenCactus(); +- protected WorldGenerator waterlilyGen = new WorldGenWaterlily(); ++ ++ /** The sand generator. */ ++ protected WorldGenerator sandGen; ++ ++ /** The gravel generator. */ ++ protected WorldGenerator gravelAsSandGen; ++ ++ /** The dirt generator. */ ++ protected WorldGenerator dirtGen; ++ protected WorldGenerator gravelGen; ++ protected WorldGenerator coalGen; ++ protected WorldGenerator ironGen; ++ ++ /** Field that holds gold WorldGenMinable */ ++ protected WorldGenerator goldGen; ++ ++ /** Field that holds redstone WorldGenMinable */ ++ protected WorldGenerator redstoneGen; ++ ++ /** Field that holds diamond WorldGenMinable */ ++ protected WorldGenerator diamondGen; ++ ++ /** Field that holds Lapis WorldGenMinable */ ++ protected WorldGenerator lapisGen; ++ ++ /** Field that holds one of the plantYellow WorldGenFlowers */ ++ protected WorldGenerator plantYellowGen; ++ ++ /** Field that holds one of the plantRed WorldGenFlowers */ ++ protected WorldGenerator plantRedGen; ++ ++ /** Field that holds mushroomBrown WorldGenFlowers */ ++ protected WorldGenerator mushroomBrownGen; ++ ++ /** Field that holds mushroomRed WorldGenFlowers */ ++ protected WorldGenerator mushroomRedGen; ++ ++ /** Field that holds big mushroom generator */ ++ protected WorldGenerator bigMushroomGen; ++ ++ /** Field that holds WorldGenReed */ ++ protected WorldGenerator reedGen; ++ ++ /** Field that holds WorldGenCactus */ ++ protected WorldGenerator cactusGen; ++ ++ /** The water lily generation! */ ++ protected WorldGenerator waterlilyGen; ++ ++ /** Amount of waterlilys per chunk. */ + protected int waterlilyPerChunk; ++ ++ /** ++ * The number of trees to attempt to generate per chunk. Up to 10 in forests, none in deserts. ++ */ + protected int treesPerChunk; +- protected int flowersPerChunk = 2; +- protected int grassPerChunk = 1; ++ ++ /** ++ * The number of yellow flower patches to generate per chunk. The game generates much less than this number, since it ++ * attempts to generate them at a random altitude. ++ */ ++ protected int flowersPerChunk; ++ ++ /** The amount of tall grass to generate per chunk. */ ++ protected int grassPerChunk; ++ ++ /** ++ * The number of dead bushes to generate per chunk. Used in deserts and swamps. ++ */ + protected int deadBushPerChunk; ++ ++ /** ++ * The number of extra mushroom patches per chunk. It generates 1/4 this number in brown mushroom patches, and 1/8 this ++ * number in red mushroom patches. These mushrooms go beyond the default base number of mushrooms. ++ */ + protected int mushroomsPerChunk; ++ ++ /** ++ * The number of reeds to generate per chunk. Reeds won't generate if the randomly selected placement is unsuitable. ++ */ + protected int reedsPerChunk; ++ ++ /** ++ * The number of cactus plants to generate per chunk. Cacti only work on sand. ++ */ + protected int cactiPerChunk; +- protected int sandPerChunk = 1; +- protected int sandPerChunk2 = 3; +- protected int clayPerChunk = 1; ++ ++ /** ++ * The number of sand patches to generate per chunk. Sand patches only generate when part of it is underwater. ++ */ ++ protected int sandPerChunk; ++ ++ /** ++ * The number of sand patches to generate per chunk. Sand patches only generate when part of it is underwater. There ++ * appear to be two separate fields for this. ++ */ ++ protected int sandPerChunk2; ++ ++ /** ++ * The number of clay patches to generate per chunk. Only generates when part of it is underwater. ++ */ ++ protected int clayPerChunk; ++ ++ /** Amount of big mushrooms per chunk */ + protected int bigMushroomsPerChunk; +- public boolean generateLakes = true; +- +- public BiomeDecorator(BiomeGenBase var1) { +- this.biome = var1; ++ ++ /** True if decorator should generate surface lava & water */ ++ public boolean generateLakes; ++ ++ public BiomeDecorator(BiomeGenBase par1BiomeGenBase) { ++ this.sandGen = new WorldGenSand(7, Block.sand.blockID); ++ this.gravelAsSandGen = new WorldGenSand(6, Block.gravel.blockID); ++ this.dirtGen = new WorldGenMinable(Block.dirt.blockID, 32); ++ this.gravelGen = new WorldGenMinable(Block.gravel.blockID, 32); ++ this.coalGen = new WorldGenMinable(Block.oreCoal.blockID, 16); ++ this.ironGen = new WorldGenMinable(Block.oreIron.blockID, 8); ++ this.goldGen = new WorldGenMinable(Block.oreGold.blockID, 8); ++ this.redstoneGen = new WorldGenMinable(Block.oreRedstone.blockID, 7); ++ this.diamondGen = new WorldGenMinable(Block.oreDiamond.blockID, 7); ++ this.lapisGen = new WorldGenMinable(Block.oreLapis.blockID, 6); ++ this.plantYellowGen = new WorldGenFlowers(Block.plantYellow.blockID); ++ this.plantRedGen = new WorldGenFlowers(Block.plantRed.blockID); ++ this.mushroomBrownGen = new WorldGenFlowers(Block.mushroomBrown.blockID); ++ this.mushroomRedGen = new WorldGenFlowers(Block.mushroomRed.blockID); ++ this.bigMushroomGen = new WorldGenBigMushroom(); ++ this.reedGen = new WorldGenReed(); ++ this.cactusGen = new WorldGenCactus(); ++ this.waterlilyGen = new WorldGenWaterlily(); ++ this.flowersPerChunk = 2; ++ this.grassPerChunk = 1; ++ this.sandPerChunk = 1; ++ this.sandPerChunk2 = 3; ++ this.clayPerChunk = 1; ++ this.generateLakes = true; ++ this.biome = par1BiomeGenBase; + } + +- public void decorate(World var1, Random var2, int var3, int var4) { +- if(this.currentWorld != null) { ++ /** ++ * Decorates the world. Calls code that was formerly (pre-1.8) in ChunkProviderGenerate.populate ++ */ ++ // Spout Start - Synchronize instead of throwing exceptions. ++ public synchronized void decorate(World par1World, Random par2Random, int par3, int par4) { ++ /* ++ if (this.currentWorld != null) { + throw new RuntimeException("Already decorating!!"); + } else { +- this.currentWorld = var1; +- this.b = var2; +- this.chunk_X = var3; +- this.chunk_Z = var4; ++ */ ++ { ++ // Spout End ++ this.currentWorld = par1World; ++ this.randomGenerator = par2Random; ++ this.chunk_X = par3; ++ this.chunk_Z = par4; + this.decorate(); + this.currentWorld = null; +- this.b = null; ++ this.randomGenerator = null; + } + } + ++ /** ++ * The method that does the work of actually decorating chunks ++ */ + protected void decorate() { + this.generateOres(); +- + int var1; + int var2; + int var3; +- for(var1 = 0; var1 < this.sandPerChunk2; ++var1) { +- var2 = this.chunk_X + this.b.nextInt(16) + 8; +- var3 = this.chunk_Z + this.b.nextInt(16) + 8; +- this.sandGen.generate(this.currentWorld, this.b, var2, this.currentWorld.getTopSolidOrLiquidBlock(var2, var3), var3); +- } +- +- for(var1 = 0; var1 < this.clayPerChunk; ++var1) { +- var2 = this.chunk_X + this.b.nextInt(16) + 8; +- var3 = this.chunk_Z + this.b.nextInt(16) + 8; +- this.clayGen.generate(this.currentWorld, this.b, var2, this.currentWorld.getTopSolidOrLiquidBlock(var2, var3), var3); +- } +- +- for(var1 = 0; var1 < this.sandPerChunk; ++var1) { +- var2 = this.chunk_X + this.b.nextInt(16) + 8; +- var3 = this.chunk_Z + this.b.nextInt(16) + 8; +- this.sandGen.generate(this.currentWorld, this.b, var2, this.currentWorld.getTopSolidOrLiquidBlock(var2, var3), var3); ++ ++ for (var1 = 0; var1 < this.sandPerChunk2; ++var1) { ++ var2 = this.chunk_X + this.randomGenerator.nextInt(16) + 8; ++ var3 = this.chunk_Z + this.randomGenerator.nextInt(16) + 8; ++ this.sandGen.generate(this.currentWorld, this.randomGenerator, var2, this.currentWorld.getTopSolidOrLiquidBlock(var2, var3), var3); ++ } ++ ++ for (var1 = 0; var1 < this.clayPerChunk; ++var1) { ++ var2 = this.chunk_X + this.randomGenerator.nextInt(16) + 8; ++ var3 = this.chunk_Z + this.randomGenerator.nextInt(16) + 8; ++ this.clayGen.generate(this.currentWorld, this.randomGenerator, var2, this.currentWorld.getTopSolidOrLiquidBlock(var2, var3), var3); ++ } ++ ++ for (var1 = 0; var1 < this.sandPerChunk; ++var1) { ++ var2 = this.chunk_X + this.randomGenerator.nextInt(16) + 8; ++ var3 = this.chunk_Z + this.randomGenerator.nextInt(16) + 8; ++ this.sandGen.generate(this.currentWorld, this.randomGenerator, var2, this.currentWorld.getTopSolidOrLiquidBlock(var2, var3), var3); + } + + var1 = this.treesPerChunk; +- if(this.b.nextInt(10) == 0) { ++ ++ if (this.randomGenerator.nextInt(10) == 0) { + ++var1; + } + + int var4; +- for(var2 = 0; var2 < var1; ++var2) { +- var3 = this.chunk_X + this.b.nextInt(16) + 8; +- var4 = this.chunk_Z + this.b.nextInt(16) + 8; +- WorldGenerator var5 = this.biome.getRandomWorldGenForTrees(this.b); ++ ++ for (var2 = 0; var2 < var1; ++var2) { ++ var3 = this.chunk_X + this.randomGenerator.nextInt(16) + 8; ++ var4 = this.chunk_Z + this.randomGenerator.nextInt(16) + 8; ++ WorldGenerator var5 = this.biome.getRandomWorldGenForTrees(this.randomGenerator); + var5.setScale(1.0D, 1.0D, 1.0D); +- var5.generate(this.currentWorld, this.b, var3, this.currentWorld.getHeightValue(var3, var4), var4); ++ var5.generate(this.currentWorld, this.randomGenerator, var3, this.currentWorld.getHeightValue(var3, var4), var4); + } + +- for(var2 = 0; var2 < this.bigMushroomsPerChunk; ++var2) { +- var3 = this.chunk_X + this.b.nextInt(16) + 8; +- var4 = this.chunk_Z + this.b.nextInt(16) + 8; +- this.bigMushroomGen.generate(this.currentWorld, this.b, var3, this.currentWorld.getHeightValue(var3, var4), var4); ++ for (var2 = 0; var2 < this.bigMushroomsPerChunk; ++var2) { ++ var3 = this.chunk_X + this.randomGenerator.nextInt(16) + 8; ++ var4 = this.chunk_Z + this.randomGenerator.nextInt(16) + 8; ++ this.bigMushroomGen.generate(this.currentWorld, this.randomGenerator, var3, this.currentWorld.getHeightValue(var3, var4), var4); + } + + int var7; +- for(var2 = 0; var2 < this.flowersPerChunk; ++var2) { +- var3 = this.chunk_X + this.b.nextInt(16) + 8; +- var4 = this.b.nextInt(128); +- var7 = this.chunk_Z + this.b.nextInt(16) + 8; +- this.plantYellowGen.generate(this.currentWorld, this.b, var3, var4, var7); +- if(this.b.nextInt(4) == 0) { +- var3 = this.chunk_X + this.b.nextInt(16) + 8; +- var4 = this.b.nextInt(128); +- var7 = this.chunk_Z + this.b.nextInt(16) + 8; +- this.plantRedGen.generate(this.currentWorld, this.b, var3, var4, var7); +- } +- } +- +- for(var2 = 0; var2 < this.grassPerChunk; ++var2) { +- var3 = this.chunk_X + this.b.nextInt(16) + 8; +- var4 = this.b.nextInt(128); +- var7 = this.chunk_Z + this.b.nextInt(16) + 8; +- WorldGenerator var6 = this.biome.getRandomWorldGenForGrass(this.b); +- var6.generate(this.currentWorld, this.b, var3, var4, var7); +- } +- +- for(var2 = 0; var2 < this.deadBushPerChunk; ++var2) { +- var3 = this.chunk_X + this.b.nextInt(16) + 8; +- var4 = this.b.nextInt(128); +- var7 = this.chunk_Z + this.b.nextInt(16) + 8; +- (new WorldGenDeadBush(Block.deadBush.blockID)).generate(this.currentWorld, this.b, var3, var4, var7); +- } +- +- for(var2 = 0; var2 < this.waterlilyPerChunk; ++var2) { +- var3 = this.chunk_X + this.b.nextInt(16) + 8; +- var4 = this.chunk_Z + this.b.nextInt(16) + 8; +- +- for(var7 = this.b.nextInt(128); var7 > 0 && this.currentWorld.getBlockId(var3, var7 - 1, var4) == 0; --var7) { +- } +- +- this.waterlilyGen.generate(this.currentWorld, this.b, var3, var7, var4); +- } +- +- for(var2 = 0; var2 < this.mushroomsPerChunk; ++var2) { +- if(this.b.nextInt(4) == 0) { +- var3 = this.chunk_X + this.b.nextInt(16) + 8; +- var4 = this.chunk_Z + this.b.nextInt(16) + 8; ++ ++ for (var2 = 0; var2 < this.flowersPerChunk; ++var2) { ++ var3 = this.chunk_X + this.randomGenerator.nextInt(16) + 8; ++ var4 = this.randomGenerator.nextInt(128); ++ var7 = this.chunk_Z + this.randomGenerator.nextInt(16) + 8; ++ this.plantYellowGen.generate(this.currentWorld, this.randomGenerator, var3, var4, var7); ++ ++ if (this.randomGenerator.nextInt(4) == 0) { ++ var3 = this.chunk_X + this.randomGenerator.nextInt(16) + 8; ++ var4 = this.randomGenerator.nextInt(128); ++ var7 = this.chunk_Z + this.randomGenerator.nextInt(16) + 8; ++ this.plantRedGen.generate(this.currentWorld, this.randomGenerator, var3, var4, var7); ++ } ++ } ++ ++ for (var2 = 0; var2 < this.grassPerChunk; ++var2) { ++ var3 = this.chunk_X + this.randomGenerator.nextInt(16) + 8; ++ var4 = this.randomGenerator.nextInt(128); ++ var7 = this.chunk_Z + this.randomGenerator.nextInt(16) + 8; ++ WorldGenerator var6 = this.biome.getRandomWorldGenForGrass(this.randomGenerator); ++ var6.generate(this.currentWorld, this.randomGenerator, var3, var4, var7); ++ } ++ ++ for (var2 = 0; var2 < this.deadBushPerChunk; ++var2) { ++ var3 = this.chunk_X + this.randomGenerator.nextInt(16) + 8; ++ var4 = this.randomGenerator.nextInt(128); ++ var7 = this.chunk_Z + this.randomGenerator.nextInt(16) + 8; ++ (new WorldGenDeadBush(Block.deadBush.blockID)).generate(this.currentWorld, this.randomGenerator, var3, var4, var7); ++ } ++ ++ for (var2 = 0; var2 < this.waterlilyPerChunk; ++var2) { ++ var3 = this.chunk_X + this.randomGenerator.nextInt(16) + 8; ++ var4 = this.chunk_Z + this.randomGenerator.nextInt(16) + 8; ++ ++ for (var7 = this.randomGenerator.nextInt(128); var7 > 0 && this.currentWorld.getBlockId(var3, var7 - 1, var4) == 0; --var7) { ++ ; ++ } ++ ++ this.waterlilyGen.generate(this.currentWorld, this.randomGenerator, var3, var7, var4); ++ } ++ ++ for (var2 = 0; var2 < this.mushroomsPerChunk; ++var2) { ++ if (this.randomGenerator.nextInt(4) == 0) { ++ var3 = this.chunk_X + this.randomGenerator.nextInt(16) + 8; ++ var4 = this.chunk_Z + this.randomGenerator.nextInt(16) + 8; + var7 = this.currentWorld.getHeightValue(var3, var4); +- this.mushroomBrownGen.generate(this.currentWorld, this.b, var3, var7, var4); +- } +- +- if(this.b.nextInt(8) == 0) { +- var3 = this.chunk_X + this.b.nextInt(16) + 8; +- var4 = this.chunk_Z + this.b.nextInt(16) + 8; +- var7 = this.b.nextInt(128); +- this.mushroomRedGen.generate(this.currentWorld, this.b, var3, var7, var4); +- } +- } +- +- if(this.b.nextInt(4) == 0) { +- var2 = this.chunk_X + this.b.nextInt(16) + 8; +- var3 = this.b.nextInt(128); +- var4 = this.chunk_Z + this.b.nextInt(16) + 8; +- this.mushroomBrownGen.generate(this.currentWorld, this.b, var2, var3, var4); +- } +- +- if(this.b.nextInt(8) == 0) { +- var2 = this.chunk_X + this.b.nextInt(16) + 8; +- var3 = this.b.nextInt(128); +- var4 = this.chunk_Z + this.b.nextInt(16) + 8; +- this.mushroomRedGen.generate(this.currentWorld, this.b, var2, var3, var4); +- } +- +- for(var2 = 0; var2 < this.reedsPerChunk; ++var2) { +- var3 = this.chunk_X + this.b.nextInt(16) + 8; +- var4 = this.chunk_Z + this.b.nextInt(16) + 8; +- var7 = this.b.nextInt(128); +- this.reedGen.generate(this.currentWorld, this.b, var3, var7, var4); +- } +- +- for(var2 = 0; var2 < 10; ++var2) { +- var3 = this.chunk_X + this.b.nextInt(16) + 8; +- var4 = this.b.nextInt(128); +- var7 = this.chunk_Z + this.b.nextInt(16) + 8; +- this.reedGen.generate(this.currentWorld, this.b, var3, var4, var7); +- } +- +- if(this.b.nextInt(32) == 0) { +- var2 = this.chunk_X + this.b.nextInt(16) + 8; +- var3 = this.b.nextInt(128); +- var4 = this.chunk_Z + this.b.nextInt(16) + 8; +- (new WorldGenPumpkin()).generate(this.currentWorld, this.b, var2, var3, var4); +- } +- +- for(var2 = 0; var2 < this.cactiPerChunk; ++var2) { +- var3 = this.chunk_X + this.b.nextInt(16) + 8; +- var4 = this.b.nextInt(128); +- var7 = this.chunk_Z + this.b.nextInt(16) + 8; +- this.cactusGen.generate(this.currentWorld, this.b, var3, var4, var7); +- } +- +- if(this.generateLakes) { +- for(var2 = 0; var2 < 50; ++var2) { +- var3 = this.chunk_X + this.b.nextInt(16) + 8; +- var4 = this.b.nextInt(this.b.nextInt(120) + 8); +- var7 = this.chunk_Z + this.b.nextInt(16) + 8; +- (new WorldGenLiquids(Block.waterMoving.blockID)).generate(this.currentWorld, this.b, var3, var4, var7); +- } +- +- for(var2 = 0; var2 < 20; ++var2) { +- var3 = this.chunk_X + this.b.nextInt(16) + 8; +- var4 = this.b.nextInt(this.b.nextInt(this.b.nextInt(112) + 8) + 8); +- var7 = this.chunk_Z + this.b.nextInt(16) + 8; +- (new WorldGenLiquids(Block.lavaMoving.blockID)).generate(this.currentWorld, this.b, var3, var4, var7); +- } +- } +- +- } +- +- protected void genStandardOre1(int var1, WorldGenerator var2, int var3, int var4) { +- for(int var5 = 0; var5 < var1; ++var5) { +- int var6 = this.chunk_X + this.b.nextInt(16); +- int var7 = this.b.nextInt(var4 - var3) + var3; +- int var8 = this.chunk_Z + this.b.nextInt(16); +- var2.generate(this.currentWorld, this.b, var6, var7, var8); +- } +- +- } +- +- protected void genStandardOre2(int var1, WorldGenerator var2, int var3, int var4) { +- for(int var5 = 0; var5 < var1; ++var5) { +- int var6 = this.chunk_X + this.b.nextInt(16); +- int var7 = this.b.nextInt(var4) + this.b.nextInt(var4) + (var3 - var4); +- int var8 = this.chunk_Z + this.b.nextInt(16); +- var2.generate(this.currentWorld, this.b, var6, var7, var8); +- } +- +- } +- ++ this.mushroomBrownGen.generate(this.currentWorld, this.randomGenerator, var3, var7, var4); ++ } ++ ++ if (this.randomGenerator.nextInt(8) == 0) { ++ var3 = this.chunk_X + this.randomGenerator.nextInt(16) + 8; ++ var4 = this.chunk_Z + this.randomGenerator.nextInt(16) + 8; ++ var7 = this.randomGenerator.nextInt(128); ++ this.mushroomRedGen.generate(this.currentWorld, this.randomGenerator, var3, var7, var4); ++ } ++ } ++ ++ if (this.randomGenerator.nextInt(4) == 0) { ++ var2 = this.chunk_X + this.randomGenerator.nextInt(16) + 8; ++ var3 = this.randomGenerator.nextInt(128); ++ var4 = this.chunk_Z + this.randomGenerator.nextInt(16) + 8; ++ this.mushroomBrownGen.generate(this.currentWorld, this.randomGenerator, var2, var3, var4); ++ } ++ ++ if (this.randomGenerator.nextInt(8) == 0) { ++ var2 = this.chunk_X + this.randomGenerator.nextInt(16) + 8; ++ var3 = this.randomGenerator.nextInt(128); ++ var4 = this.chunk_Z + this.randomGenerator.nextInt(16) + 8; ++ this.mushroomRedGen.generate(this.currentWorld, this.randomGenerator, var2, var3, var4); ++ } ++ ++ for (var2 = 0; var2 < this.reedsPerChunk; ++var2) { ++ var3 = this.chunk_X + this.randomGenerator.nextInt(16) + 8; ++ var4 = this.chunk_Z + this.randomGenerator.nextInt(16) + 8; ++ var7 = this.randomGenerator.nextInt(128); ++ this.reedGen.generate(this.currentWorld, this.randomGenerator, var3, var7, var4); ++ } ++ ++ for (var2 = 0; var2 < 10; ++var2) { ++ var3 = this.chunk_X + this.randomGenerator.nextInt(16) + 8; ++ var4 = this.randomGenerator.nextInt(128); ++ var7 = this.chunk_Z + this.randomGenerator.nextInt(16) + 8; ++ this.reedGen.generate(this.currentWorld, this.randomGenerator, var3, var4, var7); ++ } ++ ++ if (this.randomGenerator.nextInt(32) == 0) { ++ var2 = this.chunk_X + this.randomGenerator.nextInt(16) + 8; ++ var3 = this.randomGenerator.nextInt(128); ++ var4 = this.chunk_Z + this.randomGenerator.nextInt(16) + 8; ++ (new WorldGenPumpkin()).generate(this.currentWorld, this.randomGenerator, var2, var3, var4); ++ } ++ ++ for (var2 = 0; var2 < this.cactiPerChunk; ++var2) { ++ var3 = this.chunk_X + this.randomGenerator.nextInt(16) + 8; ++ var4 = this.randomGenerator.nextInt(128); ++ var7 = this.chunk_Z + this.randomGenerator.nextInt(16) + 8; ++ this.cactusGen.generate(this.currentWorld, this.randomGenerator, var3, var4, var7); ++ } ++ ++ if (this.generateLakes) { ++ for (var2 = 0; var2 < 50; ++var2) { ++ var3 = this.chunk_X + this.randomGenerator.nextInt(16) + 8; ++ var4 = this.randomGenerator.nextInt(this.randomGenerator.nextInt(120) + 8); ++ var7 = this.chunk_Z + this.randomGenerator.nextInt(16) + 8; ++ (new WorldGenLiquids(Block.waterMoving.blockID)).generate(this.currentWorld, this.randomGenerator, var3, var4, var7); ++ } ++ ++ for (var2 = 0; var2 < 20; ++var2) { ++ var3 = this.chunk_X + this.randomGenerator.nextInt(16) + 8; ++ var4 = this.randomGenerator.nextInt(this.randomGenerator.nextInt(this.randomGenerator.nextInt(112) + 8) + 8); ++ var7 = this.chunk_Z + this.randomGenerator.nextInt(16) + 8; ++ (new WorldGenLiquids(Block.lavaMoving.blockID)).generate(this.currentWorld, this.randomGenerator, var3, var4, var7); ++ } ++ } ++ } ++ ++ /** ++ * Standard ore generation helper. Generates most ores. ++ */ ++ protected void genStandardOre1(int par1, WorldGenerator par2WorldGenerator, int par3, int par4) { ++ for (int var5 = 0; var5 < par1; ++var5) { ++ int var6 = this.chunk_X + this.randomGenerator.nextInt(16); ++ int var7 = this.randomGenerator.nextInt(par4 - par3) + par3; ++ int var8 = this.chunk_Z + this.randomGenerator.nextInt(16); ++ par2WorldGenerator.generate(this.currentWorld, this.randomGenerator, var6, var7, var8); ++ } ++ } ++ ++ /** ++ * Standard ore generation helper. Generates Lapis Lazuli. ++ */ ++ protected void genStandardOre2(int par1, WorldGenerator par2WorldGenerator, int par3, int par4) { ++ for (int var5 = 0; var5 < par1; ++var5) { ++ int var6 = this.chunk_X + this.randomGenerator.nextInt(16); ++ int var7 = this.randomGenerator.nextInt(par4) + this.randomGenerator.nextInt(par4) + (par3 - par4); ++ int var8 = this.chunk_Z + this.randomGenerator.nextInt(16); ++ par2WorldGenerator.generate(this.currentWorld, this.randomGenerator, var6, var7, var8); ++ } ++ } ++ ++ /** ++ * Generates ores in the current chunk ++ */ + protected void generateOres() { + this.genStandardOre1(20, this.dirtGen, 0, 128); + this.genStandardOre1(10, this.gravelGen, 0, 128); diff --git a/patches/net/minecraft/src/BiomeEndDecorator.java.patch b/patches/net/minecraft/src/BiomeEndDecorator.java.patch new file mode 100644 index 0000000..91f6475 --- /dev/null +++ b/patches/net/minecraft/src/BiomeEndDecorator.java.patch @@ -0,0 +1,43 @@ +--- net/minecraft/src/BiomeEndDecorator.java ++++ net/minecraft/src/BiomeEndDecorator.java +@@ -1,26 +1,30 @@ + package net.minecraft.src; + + public class BiomeEndDecorator extends BiomeDecorator { +- protected WorldGenerator spikeGen = new WorldGenSpikes(Block.whiteStone.blockID); ++ protected WorldGenerator spikeGen; + +- public BiomeEndDecorator(BiomeGenBase var1) { +- super(var1); ++ public BiomeEndDecorator(BiomeGenBase par1BiomeGenBase) { ++ super(par1BiomeGenBase); ++ this.spikeGen = new WorldGenSpikes(Block.whiteStone.blockID); + } + ++ /** ++ * The method that does the work of actually decorating chunks ++ */ + protected void decorate() { + this.generateOres(); +- if(this.b.nextInt(5) == 0) { +- int var1 = this.chunk_X + this.b.nextInt(16) + 8; +- int var2 = this.chunk_Z + this.b.nextInt(16) + 8; ++ ++ if (this.randomGenerator.nextInt(5) == 0) { ++ int var1 = this.chunk_X + this.randomGenerator.nextInt(16) + 8; ++ int var2 = this.chunk_Z + this.randomGenerator.nextInt(16) + 8; + int var3 = this.currentWorld.getTopSolidOrLiquidBlock(var1, var2); +- this.spikeGen.generate(this.currentWorld, this.b, var1, var3, var2); ++ this.spikeGen.generate(this.currentWorld, this.randomGenerator, var1, var3, var2); + } + +- if(this.chunk_X == 0 && this.chunk_Z == 0) { ++ if (this.chunk_X == 0 && this.chunk_Z == 0) { + EntityDragon var4 = new EntityDragon(this.currentWorld); +- var4.setLocationAndAngles(0.0D, 128.0D, 0.0D, this.b.nextFloat() * 360.0F, 0.0F); ++ var4.setLocationAndAngles(0.0D, 128.0D, 0.0D, this.randomGenerator.nextFloat() * 360.0F, 0.0F); + this.currentWorld.spawnEntityInWorld(var4); + } +- + } + } diff --git a/patches/net/minecraft/src/BiomeGenBase.java.patch b/patches/net/minecraft/src/BiomeGenBase.java.patch new file mode 100644 index 0000000..11461d2 --- /dev/null +++ b/patches/net/minecraft/src/BiomeGenBase.java.patch @@ -0,0 +1,402 @@ +--- net/minecraft/src/BiomeGenBase.java ++++ net/minecraft/src/BiomeGenBase.java +@@ -5,7 +5,11 @@ + import java.util.List; + import java.util.Random; + ++import com.prupe.mcpatcher.cc.ColorizeWorld; ++ + public abstract class BiomeGenBase { ++ ++ /** An array of all the biomes, indexed by biome id. */ + public static final BiomeGenBase[] biomeList = new BiomeGenBase[256]; + public static final BiomeGenBase ocean = (new BiomeGenOcean(0)).setColor(112).setBiomeName("Ocean").setMinMaxHeight(-1.0F, 0.4F); + public static final BiomeGenBase plains = (new BiomeGenPlains(1)).setColor(9286496).setBiomeName("Plains").setTemperatureRainfall(0.8F, 0.4F); +@@ -16,6 +20,8 @@ + public static final BiomeGenBase swampland = (new BiomeGenSwamp(6)).setColor(522674).setBiomeName("Swampland").func_76733_a(9154376).setMinMaxHeight(-0.2F, 0.1F).setTemperatureRainfall(0.8F, 0.9F); + public static final BiomeGenBase river = (new BiomeGenRiver(7)).setColor(255).setBiomeName("River").setMinMaxHeight(-0.5F, 0.0F); + public static final BiomeGenBase hell = (new BiomeGenHell(8)).setColor(16711680).setBiomeName("Hell").setDisableRain().setTemperatureRainfall(2.0F, 0.0F); ++ ++ /** Is the biome used for sky world. */ + public static final BiomeGenBase sky = (new BiomeGenEnd(9)).setColor(8421631).setBiomeName("Sky").setDisableRain(); + public static final BiomeGenBase frozenOcean = (new BiomeGenOcean(10)).setColor(9474208).setBiomeName("FrozenOcean").setEnableSnow().setMinMaxHeight(-1.0F, 0.5F).setTemperatureRainfall(0.0F, 0.5F); + public static final BiomeGenBase frozenRiver = (new BiomeGenRiver(11)).setColor(10526975).setBiomeName("FrozenRiver").setEnableSnow().setMinMaxHeight(-0.5F, 0.0F).setTemperatureRainfall(0.0F, 0.5F); +@@ -23,166 +29,300 @@ + public static final BiomeGenBase iceMountains = (new BiomeGenSnow(13)).setColor(10526880).setBiomeName("Ice Mountains").setEnableSnow().setMinMaxHeight(0.3F, 1.3F).setTemperatureRainfall(0.0F, 0.5F); + public static final BiomeGenBase mushroomIsland = (new BiomeGenMushroomIsland(14)).setColor(16711935).setBiomeName("MushroomIsland").setTemperatureRainfall(0.9F, 1.0F).setMinMaxHeight(0.2F, 1.0F); + public static final BiomeGenBase mushroomIslandShore = (new BiomeGenMushroomIsland(15)).setColor(10486015).setBiomeName("MushroomIslandShore").setTemperatureRainfall(0.9F, 1.0F).setMinMaxHeight(-1.0F, 0.1F); ++ ++ /** Beach biome. */ + public static final BiomeGenBase beach = (new BiomeGenBeach(16)).setColor(16440917).setBiomeName("Beach").setTemperatureRainfall(0.8F, 0.4F).setMinMaxHeight(0.0F, 0.1F); ++ ++ /** Desert Hills biome. */ + public static final BiomeGenBase desertHills = (new BiomeGenDesert(17)).setColor(13786898).setBiomeName("DesertHills").setDisableRain().setTemperatureRainfall(2.0F, 0.0F).setMinMaxHeight(0.3F, 0.8F); ++ ++ /** Forest Hills biome. */ + public static final BiomeGenBase forestHills = (new BiomeGenForest(18)).setColor(2250012).setBiomeName("ForestHills").func_76733_a(5159473).setTemperatureRainfall(0.7F, 0.8F).setMinMaxHeight(0.3F, 0.7F); ++ ++ /** Taiga Hills biome. */ + public static final BiomeGenBase taigaHills = (new BiomeGenTaiga(19)).setColor(1456435).setBiomeName("TaigaHills").setEnableSnow().func_76733_a(5159473).setTemperatureRainfall(0.05F, 0.8F).setMinMaxHeight(0.3F, 0.8F); ++ ++ /** Extreme Hills Edge biome. */ + public static final BiomeGenBase extremeHillsEdge = (new BiomeGenHills(20)).setColor(7501978).setBiomeName("Extreme Hills Edge").setMinMaxHeight(0.2F, 0.8F).setTemperatureRainfall(0.2F, 0.3F); ++ ++ /** Jungle biome identifier */ + public static final BiomeGenBase jungle = (new BiomeGenJungle(21)).setColor(5470985).setBiomeName("Jungle").func_76733_a(5470985).setTemperatureRainfall(1.2F, 0.9F).setMinMaxHeight(0.2F, 0.4F); + public static final BiomeGenBase jungleHills = (new BiomeGenJungle(22)).setColor(2900485).setBiomeName("JungleHills").func_76733_a(5470985).setTemperatureRainfall(1.2F, 0.9F).setMinMaxHeight(1.8F, 0.5F); +- public String y; ++ public String biomeName; + public int color; +- public byte topBlock = (byte)Block.grass.blockID; +- public byte fillerBlock = (byte)Block.dirt.blockID; +- public int field_76754_C = 5169201; +- public float minHeight = 0.1F; +- public float maxHeight = 0.3F; +- public float temperature = 0.5F; +- public float rainfall = 0.5F; +- public int waterColorMultiplier = 16777215; ++ ++ /** The block expected to be on the top of this biome */ ++ public byte topBlock; ++ ++ /** The block to fill spots in when not on the top */ ++ public byte fillerBlock; ++ public int field_76754_C; ++ ++ /** The minimum height of this biome. Default 0.1. */ ++ public float minHeight; ++ ++ /** The maximum height of this biome. Default 0.3. */ ++ public float maxHeight; ++ ++ /** The temperature of this biome. */ ++ public float temperature; ++ ++ /** The rainfall in this biome. */ ++ public float rainfall; ++ ++ /** Color tint applied to water depending on biome */ ++ public int waterColorMultiplier; ++ ++ /** The biome decorator. */ + public BiomeDecorator theBiomeDecorator; +- protected List J = new ArrayList(); +- protected List K = new ArrayList(); +- protected List L = new ArrayList(); +- protected List M = new ArrayList(); ++ ++ /** ++ * Holds the classes of IMobs (hostile mobs) that can be spawned in the biome. ++ */ ++ protected List spawnableMonsterList; ++ ++ /** ++ * Holds the classes of any creature that can be spawned in the biome as friendly creature. ++ */ ++ protected List spawnableCreatureList; ++ ++ /** ++ * Holds the classes of any aquatic creature that can be spawned in the water of the biome. ++ */ ++ protected List spawnableWaterCreatureList; ++ protected List spawnableCaveCreatureList; ++ ++ /** Set to true if snow is enabled for this biome. */ + private boolean enableSnow; +- private boolean enableRain = true; ++ ++ /** ++ * Is true (default) if the biome support rain (desert and nether can't have rain) ++ */ ++ private boolean enableRain; ++ ++ /** The id number to this biome, and its index in the biomeList array. */ + public final int biomeID; +- protected WorldGenTrees worldGeneratorTrees = new WorldGenTrees(false); +- protected WorldGenBigTree worldGeneratorBigTree = new WorldGenBigTree(false); +- protected WorldGenForest worldGeneratorForest = new WorldGenForest(false); +- protected WorldGenSwamp worldGeneratorSwamp = new WorldGenSwamp(); +- +- protected BiomeGenBase(int var1) { +- this.biomeID = var1; +- biomeList[var1] = this; ++ ++ /** The tree generator. */ ++ protected WorldGenTrees worldGeneratorTrees; ++ ++ /** The big tree generator. */ ++ protected WorldGenBigTree worldGeneratorBigTree; ++ ++ /** The forest generator. */ ++ protected WorldGenForest worldGeneratorForest; ++ ++ /** The swamp tree generator. */ ++ protected WorldGenSwamp worldGeneratorSwamp; ++ ++ protected BiomeGenBase(int par1) { ++ this.topBlock = (byte)Block.grass.blockID; ++ this.fillerBlock = (byte)Block.dirt.blockID; ++ this.field_76754_C = 5169201; ++ this.minHeight = 0.1F; ++ this.maxHeight = 0.3F; ++ this.temperature = 0.5F; ++ this.rainfall = 0.5F; ++ this.waterColorMultiplier = 16777215; ++ this.spawnableMonsterList = new ArrayList(); ++ this.spawnableCreatureList = new ArrayList(); ++ this.spawnableWaterCreatureList = new ArrayList(); ++ this.spawnableCaveCreatureList = new ArrayList(); ++ this.enableRain = true; ++ this.worldGeneratorTrees = new WorldGenTrees(false); ++ this.worldGeneratorBigTree = new WorldGenBigTree(false); ++ this.worldGeneratorForest = new WorldGenForest(false); ++ this.worldGeneratorSwamp = new WorldGenSwamp(); ++ this.biomeID = par1; ++ biomeList[par1] = this; + this.theBiomeDecorator = this.createBiomeDecorator(); +- this.K.add(new SpawnListEntry(EntitySheep.class, 12, 4, 4)); +- this.K.add(new SpawnListEntry(EntityPig.class, 10, 4, 4)); +- this.K.add(new SpawnListEntry(EntityChicken.class, 10, 4, 4)); +- this.K.add(new SpawnListEntry(EntityCow.class, 8, 4, 4)); +- this.J.add(new SpawnListEntry(EntitySpider.class, 10, 4, 4)); +- this.J.add(new SpawnListEntry(EntityZombie.class, 10, 4, 4)); +- this.J.add(new SpawnListEntry(EntitySkeleton.class, 10, 4, 4)); +- this.J.add(new SpawnListEntry(EntityCreeper.class, 10, 4, 4)); +- this.J.add(new SpawnListEntry(EntitySlime.class, 10, 4, 4)); +- this.J.add(new SpawnListEntry(EntityEnderman.class, 1, 1, 4)); +- this.L.add(new SpawnListEntry(EntitySquid.class, 10, 4, 4)); +- this.M.add(new SpawnListEntry(EntityBat.class, 10, 8, 8)); ++ this.spawnableCreatureList.add(new SpawnListEntry(EntitySheep.class, 12, 4, 4)); ++ this.spawnableCreatureList.add(new SpawnListEntry(EntityPig.class, 10, 4, 4)); ++ this.spawnableCreatureList.add(new SpawnListEntry(EntityChicken.class, 10, 4, 4)); ++ this.spawnableCreatureList.add(new SpawnListEntry(EntityCow.class, 8, 4, 4)); ++ this.spawnableMonsterList.add(new SpawnListEntry(EntitySpider.class, 10, 4, 4)); ++ this.spawnableMonsterList.add(new SpawnListEntry(EntityZombie.class, 10, 4, 4)); ++ this.spawnableMonsterList.add(new SpawnListEntry(EntitySkeleton.class, 10, 4, 4)); ++ this.spawnableMonsterList.add(new SpawnListEntry(EntityCreeper.class, 10, 4, 4)); ++ this.spawnableMonsterList.add(new SpawnListEntry(EntitySlime.class, 10, 4, 4)); ++ this.spawnableMonsterList.add(new SpawnListEntry(EntityEnderman.class, 1, 1, 4)); ++ this.spawnableWaterCreatureList.add(new SpawnListEntry(EntitySquid.class, 10, 4, 4)); ++ this.spawnableCaveCreatureList.add(new SpawnListEntry(EntityBat.class, 10, 8, 8)); + } + ++ /** ++ * Allocate a new BiomeDecorator for this BiomeGenBase ++ */ + protected BiomeDecorator createBiomeDecorator() { + return new BiomeDecorator(this); + } + +- private BiomeGenBase setTemperatureRainfall(float var1, float var2) { +- if(var1 > 0.1F && var1 < 0.2F) { ++ /** ++ * Sets the temperature and rainfall of this biome. ++ */ ++ private BiomeGenBase setTemperatureRainfall(float par1, float par2) { ++ if (par1 > 0.1F && par1 < 0.2F) { + throw new IllegalArgumentException("Please avoid temperatures in the range 0.1 - 0.2 because of snow"); + } else { +- this.temperature = var1; +- this.rainfall = var2; ++ this.temperature = par1; ++ this.rainfall = par2; + return this; + } + } + +- private BiomeGenBase setMinMaxHeight(float var1, float var2) { +- this.minHeight = var1; +- this.maxHeight = var2; ++ /** ++ * Sets the minimum and maximum height of this biome. Seems to go from -2.0 to 2.0. ++ */ ++ private BiomeGenBase setMinMaxHeight(float par1, float par2) { ++ this.minHeight = par1; ++ this.maxHeight = par2; + return this; + } + ++ /** ++ * Disable the rain for the biome. ++ */ + private BiomeGenBase setDisableRain() { + this.enableRain = false; + return this; + } + +- public WorldGenerator getRandomWorldGenForTrees(Random var1) { +- return (WorldGenerator)(var1.nextInt(10) == 0 ? this.worldGeneratorBigTree : this.worldGeneratorTrees); ++ /** ++ * Gets a WorldGen appropriate for this biome. ++ */ ++ public WorldGenerator getRandomWorldGenForTrees(Random par1Random) { ++ return (WorldGenerator)(par1Random.nextInt(10) == 0 ? this.worldGeneratorBigTree : this.worldGeneratorTrees); + } + +- public WorldGenerator getRandomWorldGenForGrass(Random var1) { ++ /** ++ * Gets a WorldGen appropriate for this biome. ++ */ ++ public WorldGenerator getRandomWorldGenForGrass(Random par1Random) { + return new WorldGenTallGrass(Block.tallGrass.blockID, 1); + } + ++ /** ++ * sets enableSnow to true during biome initialization. returns BiomeGenBase. ++ */ + protected BiomeGenBase setEnableSnow() { + this.enableSnow = true; + return this; + } + +- protected BiomeGenBase setBiomeName(String var1) { +- this.y = var1; +- return this; +- } +- +- protected BiomeGenBase func_76733_a(int var1) { +- this.field_76754_C = var1; +- return this; +- } +- +- protected BiomeGenBase setColor(int var1) { +- this.color = var1; +- return this; +- } +- +- public int getSkyColorByTemp(float var1) { +- var1 /= 3.0F; +- if(var1 < -1.0F) { +- var1 = -1.0F; +- } +- +- if(var1 > 1.0F) { +- var1 = 1.0F; +- } +- +- return Color.getHSBColor(224.0F / 360.0F - var1 * 0.05F, 0.5F + var1 * 0.1F, 1.0F).getRGB(); +- } +- +- public List getSpawnableList(EnumCreatureType var1) { +- return var1 == EnumCreatureType.monster ? this.J : (var1 == EnumCreatureType.creature ? this.K : (var1 == EnumCreatureType.waterCreature ? this.L : (var1 == EnumCreatureType.ambient ? this.M : null))); +- } +- ++ protected BiomeGenBase setBiomeName(String par1Str) { ++ this.biomeName = par1Str; ++ // MCPatcher Start ++ ColorizeWorld.setupBiome(this); ++ // MCPatcher End ++ return this; ++ } ++ ++ protected BiomeGenBase func_76733_a(int par1) { ++ this.field_76754_C = par1; ++ return this; ++ } ++ ++ protected BiomeGenBase setColor(int par1) { ++ this.color = par1; ++ return this; ++ } ++ ++ /** ++ * takes temperature, returns color ++ */ ++ public int getSkyColorByTemp(float par1) { ++ par1 /= 3.0F; ++ ++ if (par1 < -1.0F) { ++ par1 = -1.0F; ++ } ++ ++ if (par1 > 1.0F) { ++ par1 = 1.0F; ++ } ++ ++ return Color.getHSBColor(0.62222224F - par1 * 0.05F, 0.5F + par1 * 0.1F, 1.0F).getRGB(); ++ } ++ ++ /** ++ * Returns the correspondent list of the EnumCreatureType informed. ++ */ ++ public List getSpawnableList(EnumCreatureType par1EnumCreatureType) { ++ return par1EnumCreatureType == EnumCreatureType.monster ? this.spawnableMonsterList : (par1EnumCreatureType == EnumCreatureType.creature ? this.spawnableCreatureList : (par1EnumCreatureType == EnumCreatureType.waterCreature ? this.spawnableWaterCreatureList : (par1EnumCreatureType == EnumCreatureType.ambient ? this.spawnableCaveCreatureList : null))); ++ } ++ ++ /** ++ * Returns true if the biome have snowfall instead a normal rain. ++ */ + public boolean getEnableSnow() { + return this.enableSnow; + } + ++ /** ++ * Return true if the biome supports lightning bolt spawn, either by have the bolts enabled and have rain enabled. ++ */ + public boolean canSpawnLightningBolt() { + return this.enableSnow ? false : this.enableRain; + } + ++ /** ++ * Checks to see if the rainfall level of the biome is extremely high ++ */ + public boolean isHighHumidity() { + return this.rainfall > 0.85F; + } + ++ /** ++ * returns the chance a creature has to spawn. ++ */ + public float getSpawningChance() { + return 0.1F; + } + ++ /** ++ * Gets an integer representation of this biome's rainfall ++ */ + public final int getIntRainfall() { + return (int)(this.rainfall * 65536.0F); + } + ++ /** ++ * Gets an integer representation of this biome's temperature ++ */ + public final int getIntTemperature() { + return (int)(this.temperature * 65536.0F); + } + ++ /** ++ * Gets a floating point representation of this biome's rainfall ++ */ + public final float getFloatRainfall() { + return this.rainfall; + } + ++ /** ++ * Gets a floating point representation of this biome's temperature ++ */ + public final float getFloatTemperature() { + return this.temperature; + } + +- public void decorate(World var1, Random var2, int var3, int var4) { +- this.theBiomeDecorator.decorate(var1, var2, var3, var4); ++ public void decorate(World par1World, Random par2Random, int par3, int par4) { ++ this.theBiomeDecorator.decorate(par1World, par2Random, par3, par4); + } + ++ /** ++ * Provides the basic grass color based on the biome temperature and rainfall ++ */ + public int getBiomeGrassColor() { + double var1 = (double)MathHelper.clamp_float(this.getFloatTemperature(), 0.0F, 1.0F); + double var3 = (double)MathHelper.clamp_float(this.getFloatRainfall(), 0.0F, 1.0F); + return ColorizerGrass.getGrassColor(var1, var3); + } + ++ /** ++ * Provides the basic foliage color based on the biome temperature and rainfall ++ */ + public int getBiomeFoliageColor() { + double var1 = (double)MathHelper.clamp_float(this.getFloatTemperature(), 0.0F, 1.0F); + double var3 = (double)MathHelper.clamp_float(this.getFloatRainfall(), 0.0F, 1.0F); diff --git a/patches/net/minecraft/src/BiomeGenBeach.java.patch b/patches/net/minecraft/src/BiomeGenBeach.java.patch new file mode 100644 index 0000000..f3f1ea3 --- /dev/null +++ b/patches/net/minecraft/src/BiomeGenBeach.java.patch @@ -0,0 +1,15 @@ +--- net/minecraft/src/BiomeGenBeach.java ++++ net/minecraft/src/BiomeGenBeach.java +@@ -1,9 +1,9 @@ + package net.minecraft.src; + + public class BiomeGenBeach extends BiomeGenBase { +- public BiomeGenBeach(int var1) { +- super(var1); +- this.K.clear(); ++ public BiomeGenBeach(int par1) { ++ super(par1); ++ this.spawnableCreatureList.clear(); + this.topBlock = (byte)Block.sand.blockID; + this.fillerBlock = (byte)Block.sand.blockID; + this.theBiomeDecorator.treesPerChunk = -999; diff --git a/patches/net/minecraft/src/BiomeGenDesert.java.patch b/patches/net/minecraft/src/BiomeGenDesert.java.patch new file mode 100644 index 0000000..2fcdb40 --- /dev/null +++ b/patches/net/minecraft/src/BiomeGenDesert.java.patch @@ -0,0 +1,37 @@ +--- net/minecraft/src/BiomeGenDesert.java ++++ net/minecraft/src/BiomeGenDesert.java +@@ -3,9 +3,9 @@ + import java.util.Random; + + public class BiomeGenDesert extends BiomeGenBase { +- public BiomeGenDesert(int var1) { +- super(var1); +- this.K.clear(); ++ public BiomeGenDesert(int par1) { ++ super(par1); ++ this.spawnableCreatureList.clear(); + this.topBlock = (byte)Block.sand.blockID; + this.fillerBlock = (byte)Block.sand.blockID; + this.theBiomeDecorator.treesPerChunk = -999; +@@ -14,14 +14,14 @@ + this.theBiomeDecorator.cactiPerChunk = 10; + } + +- public void decorate(World var1, Random var2, int var3, int var4) { +- super.decorate(var1, var2, var3, var4); +- if(var2.nextInt(1000) == 0) { +- int var5 = var3 + var2.nextInt(16) + 8; +- int var6 = var4 + var2.nextInt(16) + 8; ++ public void decorate(World par1World, Random par2Random, int par3, int par4) { ++ super.decorate(par1World, par2Random, par3, par4); ++ ++ if (par2Random.nextInt(1000) == 0) { ++ int var5 = par3 + par2Random.nextInt(16) + 8; ++ int var6 = par4 + par2Random.nextInt(16) + 8; + WorldGenDesertWells var7 = new WorldGenDesertWells(); +- var7.generate(var1, var2, var5, var1.getHeightValue(var5, var6) + 1, var6); ++ var7.generate(par1World, par2Random, var5, par1World.getHeightValue(var5, var6) + 1, var6); + } +- + } + } diff --git a/patches/net/minecraft/src/BiomeGenEnd.java.patch b/patches/net/minecraft/src/BiomeGenEnd.java.patch new file mode 100644 index 0000000..78d162d --- /dev/null +++ b/patches/net/minecraft/src/BiomeGenEnd.java.patch @@ -0,0 +1,33 @@ +--- net/minecraft/src/BiomeGenEnd.java ++++ net/minecraft/src/BiomeGenEnd.java +@@ -1,19 +1,22 @@ + package net.minecraft.src; + + public class BiomeGenEnd extends BiomeGenBase { +- public BiomeGenEnd(int var1) { +- super(var1); +- this.J.clear(); +- this.K.clear(); +- this.L.clear(); +- this.M.clear(); +- this.J.add(new SpawnListEntry(EntityEnderman.class, 10, 4, 4)); ++ public BiomeGenEnd(int par1) { ++ super(par1); ++ this.spawnableMonsterList.clear(); ++ this.spawnableCreatureList.clear(); ++ this.spawnableWaterCreatureList.clear(); ++ this.spawnableCaveCreatureList.clear(); ++ this.spawnableMonsterList.add(new SpawnListEntry(EntityEnderman.class, 10, 4, 4)); + this.topBlock = (byte)Block.dirt.blockID; + this.fillerBlock = (byte)Block.dirt.blockID; + this.theBiomeDecorator = new BiomeEndDecorator(this); + } + +- public int getSkyColorByTemp(float var1) { ++ /** ++ * takes temperature, returns color ++ */ ++ public int getSkyColorByTemp(float par1) { + return 0; + } + } diff --git a/patches/net/minecraft/src/BiomeGenForest.java.patch b/patches/net/minecraft/src/BiomeGenForest.java.patch new file mode 100644 index 0000000..87cb83b --- /dev/null +++ b/patches/net/minecraft/src/BiomeGenForest.java.patch @@ -0,0 +1,25 @@ +--- net/minecraft/src/BiomeGenForest.java ++++ net/minecraft/src/BiomeGenForest.java +@@ -3,14 +3,17 @@ + import java.util.Random; + + public class BiomeGenForest extends BiomeGenBase { +- public BiomeGenForest(int var1) { +- super(var1); +- this.K.add(new SpawnListEntry(EntityWolf.class, 5, 4, 4)); ++ public BiomeGenForest(int par1) { ++ super(par1); ++ this.spawnableCreatureList.add(new SpawnListEntry(EntityWolf.class, 5, 4, 4)); + this.theBiomeDecorator.treesPerChunk = 10; + this.theBiomeDecorator.grassPerChunk = 2; + } + +- public WorldGenerator getRandomWorldGenForTrees(Random var1) { +- return (WorldGenerator)(var1.nextInt(5) == 0 ? this.worldGeneratorForest : (var1.nextInt(10) == 0 ? this.worldGeneratorBigTree : this.worldGeneratorTrees)); ++ /** ++ * Gets a WorldGen appropriate for this biome. ++ */ ++ public WorldGenerator getRandomWorldGenForTrees(Random par1Random) { ++ return (WorldGenerator)(par1Random.nextInt(5) == 0 ? this.worldGeneratorForest : (par1Random.nextInt(10) == 0 ? this.worldGeneratorBigTree : this.worldGeneratorTrees)); + } + } diff --git a/patches/net/minecraft/src/BiomeGenHell.java.patch b/patches/net/minecraft/src/BiomeGenHell.java.patch new file mode 100644 index 0000000..c1c2f09 --- /dev/null +++ b/patches/net/minecraft/src/BiomeGenHell.java.patch @@ -0,0 +1,26 @@ +--- net/minecraft/src/BiomeGenHell.java ++++ net/minecraft/src/BiomeGenHell.java +@@ -1,14 +1,14 @@ + package net.minecraft.src; + + public class BiomeGenHell extends BiomeGenBase { +- public BiomeGenHell(int var1) { +- super(var1); +- this.J.clear(); +- this.K.clear(); +- this.L.clear(); +- this.M.clear(); +- this.J.add(new SpawnListEntry(EntityGhast.class, 50, 4, 4)); +- this.J.add(new SpawnListEntry(EntityPigZombie.class, 100, 4, 4)); +- this.J.add(new SpawnListEntry(EntityMagmaCube.class, 1, 4, 4)); ++ public BiomeGenHell(int par1) { ++ super(par1); ++ this.spawnableMonsterList.clear(); ++ this.spawnableCreatureList.clear(); ++ this.spawnableWaterCreatureList.clear(); ++ this.spawnableCaveCreatureList.clear(); ++ this.spawnableMonsterList.add(new SpawnListEntry(EntityGhast.class, 50, 4, 4)); ++ this.spawnableMonsterList.add(new SpawnListEntry(EntityPigZombie.class, 100, 4, 4)); ++ this.spawnableMonsterList.add(new SpawnListEntry(EntityMagmaCube.class, 1, 4, 4)); + } + } diff --git a/patches/net/minecraft/src/BiomeGenHills.java.patch b/patches/net/minecraft/src/BiomeGenHills.java.patch new file mode 100644 index 0000000..c0d4a06 --- /dev/null +++ b/patches/net/minecraft/src/BiomeGenHills.java.patch @@ -0,0 +1,59 @@ +--- net/minecraft/src/BiomeGenHills.java ++++ net/minecraft/src/BiomeGenHills.java +@@ -3,35 +3,36 @@ + import java.util.Random; + + public class BiomeGenHills extends BiomeGenBase { +- private WorldGenerator theWorldGenerator = new WorldGenMinable(Block.silverfish.blockID, 8); ++ private WorldGenerator theWorldGenerator; + +- protected BiomeGenHills(int var1) { +- super(var1); ++ protected BiomeGenHills(int par1) { ++ super(par1); ++ this.theWorldGenerator = new WorldGenMinable(Block.silverfish.blockID, 8); + } + +- public void decorate(World var1, Random var2, int var3, int var4) { +- super.decorate(var1, var2, var3, var4); +- int var5 = 3 + var2.nextInt(6); +- ++ public void decorate(World par1World, Random par2Random, int par3, int par4) { ++ super.decorate(par1World, par2Random, par3, par4); ++ int var5 = 3 + par2Random.nextInt(6); + int var6; + int var7; + int var8; +- for(var6 = 0; var6 < var5; ++var6) { +- var7 = var3 + var2.nextInt(16); +- var8 = var2.nextInt(28) + 4; +- int var9 = var4 + var2.nextInt(16); +- int var10 = var1.getBlockId(var7, var8, var9); +- if(var10 == Block.stone.blockID) { +- var1.setBlock(var7, var8, var9, Block.oreEmerald.blockID, 0, 2); ++ ++ for (var6 = 0; var6 < var5; ++var6) { ++ var7 = par3 + par2Random.nextInt(16); ++ var8 = par2Random.nextInt(28) + 4; ++ int var9 = par4 + par2Random.nextInt(16); ++ int var10 = par1World.getBlockId(var7, var8, var9); ++ ++ if (var10 == Block.stone.blockID) { ++ par1World.setBlock(var7, var8, var9, Block.oreEmerald.blockID, 0, 2); + } + } + +- for(var5 = 0; var5 < 7; ++var5) { +- var6 = var3 + var2.nextInt(16); +- var7 = var2.nextInt(64); +- var8 = var4 + var2.nextInt(16); +- this.theWorldGenerator.generate(var1, var2, var6, var7, var8); ++ for (var5 = 0; var5 < 7; ++var5) { ++ var6 = par3 + par2Random.nextInt(16); ++ var7 = par2Random.nextInt(64); ++ var8 = par4 + par2Random.nextInt(16); ++ this.theWorldGenerator.generate(par1World, par2Random, var6, var7, var8); + } +- + } + } diff --git a/patches/net/minecraft/src/BiomeGenJungle.java.patch b/patches/net/minecraft/src/BiomeGenJungle.java.patch new file mode 100644 index 0000000..245d662 --- /dev/null +++ b/patches/net/minecraft/src/BiomeGenJungle.java.patch @@ -0,0 +1,62 @@ +--- net/minecraft/src/BiomeGenJungle.java ++++ net/minecraft/src/BiomeGenJungle.java +@@ -3,33 +3,38 @@ + import java.util.Random; + + public class BiomeGenJungle extends BiomeGenBase { +- public BiomeGenJungle(int var1) { +- super(var1); ++ public BiomeGenJungle(int par1) { ++ super(par1); + this.theBiomeDecorator.treesPerChunk = 50; + this.theBiomeDecorator.grassPerChunk = 25; + this.theBiomeDecorator.flowersPerChunk = 4; +- this.J.add(new SpawnListEntry(EntityOcelot.class, 2, 1, 1)); +- this.K.add(new SpawnListEntry(EntityChicken.class, 10, 4, 4)); +- } +- +- public WorldGenerator getRandomWorldGenForTrees(Random var1) { +- return (WorldGenerator)(var1.nextInt(10) == 0 ? this.worldGeneratorBigTree : (var1.nextInt(2) == 0 ? new WorldGenShrub(3, 0) : (var1.nextInt(3) == 0 ? new WorldGenHugeTrees(false, 10 + var1.nextInt(20), 3, 3) : new WorldGenTrees(false, 4 + var1.nextInt(7), 3, 3, true)))); +- } +- +- public WorldGenerator getRandomWorldGenForGrass(Random var1) { +- return var1.nextInt(4) == 0 ? new WorldGenTallGrass(Block.tallGrass.blockID, 2) : new WorldGenTallGrass(Block.tallGrass.blockID, 1); +- } +- +- public void decorate(World var1, Random var2, int var3, int var4) { +- super.decorate(var1, var2, var3, var4); ++ this.spawnableMonsterList.add(new SpawnListEntry(EntityOcelot.class, 2, 1, 1)); ++ this.spawnableCreatureList.add(new SpawnListEntry(EntityChicken.class, 10, 4, 4)); ++ } ++ ++ /** ++ * Gets a WorldGen appropriate for this biome. ++ */ ++ public WorldGenerator getRandomWorldGenForTrees(Random par1Random) { ++ return (WorldGenerator)(par1Random.nextInt(10) == 0 ? this.worldGeneratorBigTree : (par1Random.nextInt(2) == 0 ? new WorldGenShrub(3, 0) : (par1Random.nextInt(3) == 0 ? new WorldGenHugeTrees(false, 10 + par1Random.nextInt(20), 3, 3) : new WorldGenTrees(false, 4 + par1Random.nextInt(7), 3, 3, true)))); ++ } ++ ++ /** ++ * Gets a WorldGen appropriate for this biome. ++ */ ++ public WorldGenerator getRandomWorldGenForGrass(Random par1Random) { ++ return par1Random.nextInt(4) == 0 ? new WorldGenTallGrass(Block.tallGrass.blockID, 2) : new WorldGenTallGrass(Block.tallGrass.blockID, 1); ++ } ++ ++ public void decorate(World par1World, Random par2Random, int par3, int par4) { ++ super.decorate(par1World, par2Random, par3, par4); + WorldGenVines var5 = new WorldGenVines(); + +- for(int var6 = 0; var6 < 50; ++var6) { +- int var7 = var3 + var2.nextInt(16) + 8; ++ for (int var6 = 0; var6 < 50; ++var6) { ++ int var7 = par3 + par2Random.nextInt(16) + 8; + byte var8 = 64; +- int var9 = var4 + var2.nextInt(16) + 8; +- var5.generate(var1, var2, var7, var8, var9); ++ int var9 = par4 + par2Random.nextInt(16) + 8; ++ var5.generate(par1World, par2Random, var7, var8, var9); + } +- + } + } diff --git a/patches/net/minecraft/src/BiomeGenMushroomIsland.java.patch b/patches/net/minecraft/src/BiomeGenMushroomIsland.java.patch new file mode 100644 index 0000000..1c83a7c --- /dev/null +++ b/patches/net/minecraft/src/BiomeGenMushroomIsland.java.patch @@ -0,0 +1,26 @@ +--- net/minecraft/src/BiomeGenMushroomIsland.java ++++ net/minecraft/src/BiomeGenMushroomIsland.java +@@ -1,17 +1,17 @@ + package net.minecraft.src; + + public class BiomeGenMushroomIsland extends BiomeGenBase { +- public BiomeGenMushroomIsland(int var1) { +- super(var1); ++ public BiomeGenMushroomIsland(int par1) { ++ super(par1); + this.theBiomeDecorator.treesPerChunk = -100; + this.theBiomeDecorator.flowersPerChunk = -100; + this.theBiomeDecorator.grassPerChunk = -100; + this.theBiomeDecorator.mushroomsPerChunk = 1; + this.theBiomeDecorator.bigMushroomsPerChunk = 1; + this.topBlock = (byte)Block.mycelium.blockID; +- this.J.clear(); +- this.K.clear(); +- this.L.clear(); +- this.K.add(new SpawnListEntry(EntityMooshroom.class, 8, 4, 8)); ++ this.spawnableMonsterList.clear(); ++ this.spawnableCreatureList.clear(); ++ this.spawnableWaterCreatureList.clear(); ++ this.spawnableCreatureList.add(new SpawnListEntry(EntityMooshroom.class, 8, 4, 8)); + } + } diff --git a/patches/net/minecraft/src/BiomeGenOcean.java.patch b/patches/net/minecraft/src/BiomeGenOcean.java.patch new file mode 100644 index 0000000..8e4a7f4 --- /dev/null +++ b/patches/net/minecraft/src/BiomeGenOcean.java.patch @@ -0,0 +1,14 @@ +--- net/minecraft/src/BiomeGenOcean.java ++++ net/minecraft/src/BiomeGenOcean.java +@@ -1,8 +1,8 @@ + package net.minecraft.src; + + public class BiomeGenOcean extends BiomeGenBase { +- public BiomeGenOcean(int var1) { +- super(var1); +- this.K.clear(); ++ public BiomeGenOcean(int par1) { ++ super(par1); ++ this.spawnableCreatureList.clear(); + } + } diff --git a/patches/net/minecraft/src/BiomeGenPlains.java.patch b/patches/net/minecraft/src/BiomeGenPlains.java.patch new file mode 100644 index 0000000..106e6d0 --- /dev/null +++ b/patches/net/minecraft/src/BiomeGenPlains.java.patch @@ -0,0 +1,15 @@ +--- net/minecraft/src/BiomeGenPlains.java ++++ net/minecraft/src/BiomeGenPlains.java +@@ -1,9 +1,9 @@ + package net.minecraft.src; + + public class BiomeGenPlains extends BiomeGenBase { +- protected BiomeGenPlains(int var1) { +- super(var1); +- this.K.add(new SpawnListEntry(EntityHorse.class, 5, 2, 6)); ++ protected BiomeGenPlains(int par1) { ++ super(par1); ++ this.spawnableCreatureList.add(new SpawnListEntry(EntityHorse.class, 5, 2, 6)); + this.theBiomeDecorator.treesPerChunk = -999; + this.theBiomeDecorator.flowersPerChunk = 4; + this.theBiomeDecorator.grassPerChunk = 10; diff --git a/patches/net/minecraft/src/BiomeGenRiver.java.patch b/patches/net/minecraft/src/BiomeGenRiver.java.patch new file mode 100644 index 0000000..516f7d9 --- /dev/null +++ b/patches/net/minecraft/src/BiomeGenRiver.java.patch @@ -0,0 +1,14 @@ +--- net/minecraft/src/BiomeGenRiver.java ++++ net/minecraft/src/BiomeGenRiver.java +@@ -1,8 +1,8 @@ + package net.minecraft.src; + + public class BiomeGenRiver extends BiomeGenBase { +- public BiomeGenRiver(int var1) { +- super(var1); +- this.K.clear(); ++ public BiomeGenRiver(int par1) { ++ super(par1); ++ this.spawnableCreatureList.clear(); + } + } diff --git a/patches/net/minecraft/src/BiomeGenSnow.java.patch b/patches/net/minecraft/src/BiomeGenSnow.java.patch new file mode 100644 index 0000000..5fd0e40 --- /dev/null +++ b/patches/net/minecraft/src/BiomeGenSnow.java.patch @@ -0,0 +1,12 @@ +--- net/minecraft/src/BiomeGenSnow.java ++++ net/minecraft/src/BiomeGenSnow.java +@@ -1,7 +1,7 @@ + package net.minecraft.src; + + public class BiomeGenSnow extends BiomeGenBase { +- public BiomeGenSnow(int var1) { +- super(var1); ++ public BiomeGenSnow(int par1) { ++ super(par1); + } + } diff --git a/patches/net/minecraft/src/BiomeGenSwamp.java.patch b/patches/net/minecraft/src/BiomeGenSwamp.java.patch new file mode 100644 index 0000000..5b3ca1c --- /dev/null +++ b/patches/net/minecraft/src/BiomeGenSwamp.java.patch @@ -0,0 +1,57 @@ +--- net/minecraft/src/BiomeGenSwamp.java ++++ net/minecraft/src/BiomeGenSwamp.java +@@ -2,9 +2,12 @@ + + import java.util.Random; + ++import com.prupe.mcpatcher.cc.ColorizeBlock; ++import com.prupe.mcpatcher.cc.Colorizer; ++ + public class BiomeGenSwamp extends BiomeGenBase { +- protected BiomeGenSwamp(int var1) { +- super(var1); ++ protected BiomeGenSwamp(int par1) { ++ super(par1); + this.theBiomeDecorator.treesPerChunk = 2; + this.theBiomeDecorator.flowersPerChunk = -999; + this.theBiomeDecorator.deadBushPerChunk = 1; +@@ -13,22 +16,35 @@ + this.theBiomeDecorator.clayPerChunk = 1; + this.theBiomeDecorator.waterlilyPerChunk = 4; + this.waterColorMultiplier = 14745518; +- this.J.add(new SpawnListEntry(EntitySlime.class, 1, 1, 1)); ++ this.spawnableMonsterList.add(new SpawnListEntry(EntitySlime.class, 1, 1, 1)); + } + +- public WorldGenerator getRandomWorldGenForTrees(Random var1) { ++ /** ++ * Gets a WorldGen appropriate for this biome. ++ */ ++ public WorldGenerator getRandomWorldGenForTrees(Random par1Random) { + return this.worldGeneratorSwamp; + } + ++ /** ++ * Provides the basic grass color based on the biome temperature and rainfall ++ */ + public int getBiomeGrassColor() { + double var1 = (double)this.getFloatTemperature(); + double var3 = (double)this.getFloatRainfall(); +- return ((ColorizerGrass.getGrassColor(var1, var3) & 16711422) + 5115470) / 2; ++ // MCPatcher Start ++ return ColorizeBlock.colorizeBiome(((ColorizerGrass.getGrassColor(var1, var3) & 16711422) + 5115470) / 2, Colorizer.COLOR_MAP_SWAMP_GRASS, var1, var3); ++ // MCPatcher End + } + ++ /** ++ * Provides the basic foliage color based on the biome temperature and rainfall ++ */ + public int getBiomeFoliageColor() { + double var1 = (double)this.getFloatTemperature(); + double var3 = (double)this.getFloatRainfall(); +- return ((ColorizerFoliage.getFoliageColor(var1, var3) & 16711422) + 5115470) / 2; ++ // MCPatcher Start ++ return ColorizeBlock.colorizeBiome(((ColorizerFoliage.getFoliageColor(var1, var3) & 16711422) + 5115470) / 2, Colorizer.COLOR_MAP_SWAMP_FOLIAGE, var1, var3); ++ // MCPatcher End + } + } diff --git a/patches/net/minecraft/src/BiomeGenTaiga.java.patch b/patches/net/minecraft/src/BiomeGenTaiga.java.patch new file mode 100644 index 0000000..d2238b9 --- /dev/null +++ b/patches/net/minecraft/src/BiomeGenTaiga.java.patch @@ -0,0 +1,25 @@ +--- net/minecraft/src/BiomeGenTaiga.java ++++ net/minecraft/src/BiomeGenTaiga.java +@@ -3,14 +3,17 @@ + import java.util.Random; + + public class BiomeGenTaiga extends BiomeGenBase { +- public BiomeGenTaiga(int var1) { +- super(var1); +- this.K.add(new SpawnListEntry(EntityWolf.class, 8, 4, 4)); ++ public BiomeGenTaiga(int par1) { ++ super(par1); ++ this.spawnableCreatureList.add(new SpawnListEntry(EntityWolf.class, 8, 4, 4)); + this.theBiomeDecorator.treesPerChunk = 10; + this.theBiomeDecorator.grassPerChunk = 1; + } + +- public WorldGenerator getRandomWorldGenForTrees(Random var1) { +- return (WorldGenerator)(var1.nextInt(3) == 0 ? new WorldGenTaiga1() : new WorldGenTaiga2(false)); ++ /** ++ * Gets a WorldGen appropriate for this biome. ++ */ ++ public WorldGenerator getRandomWorldGenForTrees(Random par1Random) { ++ return (WorldGenerator)(par1Random.nextInt(3) == 0 ? new WorldGenTaiga1() : new WorldGenTaiga2(false)); + } + } diff --git a/patches/net/minecraft/src/Block.java.patch b/patches/net/minecraft/src/Block.java.patch new file mode 100644 index 0000000..c4458dc --- /dev/null +++ b/patches/net/minecraft/src/Block.java.patch @@ -0,0 +1,1632 @@ +--- net/minecraft/src/Block.java ++++ net/minecraft/src/Block.java +@@ -3,9 +3,22 @@ + import java.util.List; + import java.util.Random; + ++import com.prupe.mcpatcher.cc.ColorizeBlock; ++ ++import org.spoutcraft.api.Spoutcraft; ++import org.spoutcraft.api.material.CustomBlock; ++import org.spoutcraft.api.material.MaterialData; ++import org.spoutcraft.api.util.FastLocation; ++import org.spoutcraft.api.util.FixedLocation; ++import org.spoutcraft.client.SpoutClient; ++import org.spoutcraft.client.block.SpoutcraftChunk; + public class Block { ++ ++ /** ++ * used as foreach item, if item.tab = current tab, display it on the screen ++ */ + private CreativeTabs displayOnCreativeTab; +- protected String f; ++ protected String textureName; + public static final StepSound soundPowderFootstep = new StepSound("stone", 1.0F, 1.0F); + public static final StepSound soundWoodFootstep = new StepSound("wood", 1.0F, 1.0F); + public static final StepSound soundGravelFootstep = new StepSound("gravel", 1.0F, 1.0F); +@@ -18,11 +31,27 @@ + public static final StepSound soundSnowFootstep = new StepSound("snow", 1.0F, 1.0F); + public static final StepSound soundLadderFootstep = new StepSoundSand("ladder", 1.0F, 1.0F); + public static final StepSound soundAnvilFootstep = new StepSoundAnvil("anvil", 0.3F, 1.0F); ++ ++ /** List of ly/ff (BlockType) containing the already registered blocks. */ + public static final Block[] blocksList = new Block[4096]; ++ ++ /** ++ * An array of 4096 booleans corresponding to the result of the isOpaqueCube() method for each block ID ++ */ + public static final boolean[] opaqueCubeLookup = new boolean[4096]; ++ ++ /** How much light is subtracted for going through this block */ + public static final int[] lightOpacity = new int[4096]; ++ ++ /** Array of booleans that tells if a block can grass */ + public static final boolean[] canBlockGrass = new boolean[4096]; ++ ++ /** Amount of light emitted */ + public static final int[] lightValue = new int[4096]; ++ ++ /** ++ * Flag if block ID should use the brightest neighbor light value as its own ++ */ + public static boolean[] useNeighborBrightness = new boolean[4096]; + public static final Block stone = (new BlockStone(1)).setHardness(1.5F).setResistance(10.0F).setStepSound(soundStoneFootstep).setUnlocalizedName("stone").setTextureName("stone"); + public static final BlockGrass grass = (BlockGrass)(new BlockGrass(2)).setHardness(0.6F).setStepSound(soundGrassFootstep).setUnlocalizedName("grass").setTextureName("grass"); +@@ -34,6 +63,8 @@ + public static final BlockFluid waterMoving = (BlockFluid)(new BlockFlowing(8, Material.water)).setHardness(100.0F).setLightOpacity(3).setUnlocalizedName("water").disableStats().setTextureName("water_flow"); + public static final Block waterStill = (new BlockStationary(9, Material.water)).setHardness(100.0F).setLightOpacity(3).setUnlocalizedName("water").disableStats().setTextureName("water_still"); + public static final BlockFluid lavaMoving = (BlockFluid)(new BlockFlowing(10, Material.lava)).setHardness(0.0F).setLightValue(1.0F).setUnlocalizedName("lava").disableStats().setTextureName("lava_flow"); ++ ++ /** Stationary lava source block */ + public static final Block lavaStill = (new BlockStationary(11, Material.lava)).setHardness(100.0F).setLightValue(1.0F).setUnlocalizedName("lava").disableStats().setTextureName("lava_still"); + public static final Block sand = (new BlockSand(12)).setHardness(0.5F).setStepSound(soundSandFootstep).setUnlocalizedName("sand").setTextureName("sand"); + public static final Block gravel = (new BlockGravel(13)).setHardness(0.6F).setStepSound(soundGravelFootstep).setUnlocalizedName("gravel").setTextureName("gravel"); +@@ -62,18 +93,22 @@ + public static final BlockPistonMoving pistonMoving = new BlockPistonMoving(36); + public static final BlockFlower plantYellow = (BlockFlower)(new BlockFlower(37)).setHardness(0.0F).setStepSound(soundGrassFootstep).setUnlocalizedName("flower").setTextureName("flower_dandelion"); + public static final BlockFlower plantRed = (BlockFlower)(new BlockFlower(38)).setHardness(0.0F).setStepSound(soundGrassFootstep).setUnlocalizedName("rose").setTextureName("flower_rose"); +- public static final BlockFlower mushroomBrown = (BlockFlower)(new BlockMushroom(39)).setHardness(0.0F).setStepSound(soundGrassFootstep).setLightValue(2.0F / 16.0F).setUnlocalizedName("mushroom").setTextureName("mushroom_brown"); ++ public static final BlockFlower mushroomBrown = (BlockFlower)(new BlockMushroom(39)).setHardness(0.0F).setStepSound(soundGrassFootstep).setLightValue(0.125F).setUnlocalizedName("mushroom").setTextureName("mushroom_brown"); + public static final BlockFlower mushroomRed = (BlockFlower)(new BlockMushroom(40)).setHardness(0.0F).setStepSound(soundGrassFootstep).setUnlocalizedName("mushroom").setTextureName("mushroom_red"); + public static final Block blockGold = (new BlockOreStorage(41)).setHardness(3.0F).setResistance(10.0F).setStepSound(soundMetalFootstep).setUnlocalizedName("blockGold").setTextureName("gold_block"); + public static final Block blockIron = (new BlockOreStorage(42)).setHardness(5.0F).setResistance(10.0F).setStepSound(soundMetalFootstep).setUnlocalizedName("blockIron").setTextureName("iron_block"); ++ ++ /** stoneDoubleSlab */ + public static final BlockHalfSlab stoneDoubleSlab = (BlockHalfSlab)(new BlockStep(43, true)).setHardness(2.0F).setResistance(10.0F).setStepSound(soundStoneFootstep).setUnlocalizedName("stoneSlab"); ++ ++ /** stoneSingleSlab */ + public static final BlockHalfSlab stoneSingleSlab = (BlockHalfSlab)(new BlockStep(44, false)).setHardness(2.0F).setResistance(10.0F).setStepSound(soundStoneFootstep).setUnlocalizedName("stoneSlab"); + public static final Block brick = (new Block(45, Material.rock)).setHardness(2.0F).setResistance(10.0F).setStepSound(soundStoneFootstep).setUnlocalizedName("brick").setCreativeTab(CreativeTabs.tabBlock).setTextureName("brick"); + public static final Block tnt = (new BlockTNT(46)).setHardness(0.0F).setStepSound(soundGrassFootstep).setUnlocalizedName("tnt").setTextureName("tnt"); + public static final Block bookShelf = (new BlockBookshelf(47)).setHardness(1.5F).setStepSound(soundWoodFootstep).setUnlocalizedName("bookshelf").setTextureName("bookshelf"); + public static final Block cobblestoneMossy = (new Block(48, Material.rock)).setHardness(2.0F).setResistance(10.0F).setStepSound(soundStoneFootstep).setUnlocalizedName("stoneMoss").setCreativeTab(CreativeTabs.tabBlock).setTextureName("cobblestone_mossy"); + public static final Block obsidian = (new BlockObsidian(49)).setHardness(50.0F).setResistance(2000.0F).setStepSound(soundStoneFootstep).setUnlocalizedName("obsidian").setTextureName("obsidian"); +- public static final Block torchWood = (new BlockTorch(50)).setHardness(0.0F).setLightValue(15.0F / 16.0F).setStepSound(soundWoodFootstep).setUnlocalizedName("torch").setTextureName("torch_on"); ++ public static final Block torchWood = (new BlockTorch(50)).setHardness(0.0F).setLightValue(0.9375F).setStepSound(soundWoodFootstep).setUnlocalizedName("torch").setTextureName("torch_on"); + public static final BlockFire fire = (BlockFire)(new BlockFire(51)).setHardness(0.0F).setLightValue(1.0F).setStepSound(soundWoodFootstep).setUnlocalizedName("fire").disableStats().setTextureName("fire"); + public static final Block mobSpawner = (new BlockMobSpawner(52)).setHardness(5.0F).setStepSound(soundMetalFootstep).setUnlocalizedName("mobSpawner").disableStats().setTextureName("mob_spawner"); + public static final Block stairsWoodOak = (new BlockStairs(53, planks, 0)).setUnlocalizedName("stairsWood"); +@@ -85,7 +120,7 @@ + public static final Block crops = (new BlockCrops(59)).setUnlocalizedName("crops").setTextureName("wheat"); + public static final Block tilledField = (new BlockFarmland(60)).setHardness(0.6F).setStepSound(soundGravelFootstep).setUnlocalizedName("farmland").setTextureName("farmland"); + public static final Block furnaceIdle = (new BlockFurnace(61, false)).setHardness(3.5F).setStepSound(soundStoneFootstep).setUnlocalizedName("furnace").setCreativeTab(CreativeTabs.tabDecorations); +- public static final Block furnaceBurning = (new BlockFurnace(62, true)).setHardness(3.5F).setStepSound(soundStoneFootstep).setLightValue(14.0F / 16.0F).setUnlocalizedName("furnace"); ++ public static final Block furnaceBurning = (new BlockFurnace(62, true)).setHardness(3.5F).setStepSound(soundStoneFootstep).setLightValue(0.875F).setUnlocalizedName("furnace"); + public static final Block signPost = (new BlockSign(63, TileEntitySign.class, true)).setHardness(1.0F).setStepSound(soundWoodFootstep).setUnlocalizedName("sign").disableStats(); + public static final Block doorWood = (new BlockDoor(64, Material.wood)).setHardness(3.0F).setStepSound(soundWoodFootstep).setUnlocalizedName("doorWood").disableStats().setTextureName("door_wood"); + public static final Block ladder = (new BlockLadder(65)).setHardness(0.4F).setStepSound(soundLadderFootstep).setUnlocalizedName("ladder").setTextureName("ladder"); +@@ -97,7 +132,7 @@ + public static final Block doorIron = (new BlockDoor(71, Material.iron)).setHardness(5.0F).setStepSound(soundMetalFootstep).setUnlocalizedName("doorIron").disableStats().setTextureName("door_iron"); + public static final Block pressurePlatePlanks = (new BlockPressurePlate(72, "planks_oak", Material.wood, EnumMobType.everything)).setHardness(0.5F).setStepSound(soundWoodFootstep).setUnlocalizedName("pressurePlate"); + public static final Block oreRedstone = (new BlockRedstoneOre(73, false)).setHardness(3.0F).setResistance(5.0F).setStepSound(soundStoneFootstep).setUnlocalizedName("oreRedstone").setCreativeTab(CreativeTabs.tabBlock).setTextureName("redstone_ore"); +- public static final Block oreRedstoneGlowing = (new BlockRedstoneOre(74, true)).setLightValue(10.0F / 16.0F).setHardness(3.0F).setResistance(5.0F).setStepSound(soundStoneFootstep).setUnlocalizedName("oreRedstone").setTextureName("redstone_ore"); ++ public static final Block oreRedstoneGlowing = (new BlockRedstoneOre(74, true)).setLightValue(0.625F).setHardness(3.0F).setResistance(5.0F).setStepSound(soundStoneFootstep).setUnlocalizedName("oreRedstone").setTextureName("redstone_ore"); + public static final Block torchRedstoneIdle = (new BlockRedstoneTorch(75, false)).setHardness(0.0F).setStepSound(soundWoodFootstep).setUnlocalizedName("notGate").setTextureName("redstone_torch_off"); + public static final Block torchRedstoneActive = (new BlockRedstoneTorch(76, true)).setHardness(0.0F).setLightValue(0.5F).setStepSound(soundWoodFootstep).setUnlocalizedName("notGate").setCreativeTab(CreativeTabs.tabRedstone).setTextureName("redstone_torch_on"); + public static final Block stoneButton = (new BlockButtonStone(77)).setHardness(0.5F).setStepSound(soundStoneFootstep).setUnlocalizedName("button"); +@@ -113,14 +148,20 @@ + public static final Block netherrack = (new BlockNetherrack(87)).setHardness(0.4F).setStepSound(soundStoneFootstep).setUnlocalizedName("hellrock").setTextureName("netherrack"); + public static final Block slowSand = (new BlockSoulSand(88)).setHardness(0.5F).setStepSound(soundSandFootstep).setUnlocalizedName("hellsand").setTextureName("soul_sand"); + public static final Block glowStone = (new BlockGlowStone(89, Material.glass)).setHardness(0.3F).setStepSound(soundGlassFootstep).setLightValue(1.0F).setUnlocalizedName("lightgem").setTextureName("glowstone"); +- public static final BlockPortal portal = (BlockPortal)(new BlockPortal(90)).setHardness(-1.0F).setStepSound(soundGlassFootstep).setLightValue(12.0F / 16.0F).setUnlocalizedName("portal").setTextureName("portal"); ++ ++ /** The purple teleport blocks inside the obsidian circle */ ++ public static final BlockPortal portal = (BlockPortal)(new BlockPortal(90)).setHardness(-1.0F).setStepSound(soundGlassFootstep).setLightValue(0.75F).setUnlocalizedName("portal").setTextureName("portal"); + public static final Block pumpkinLantern = (new BlockPumpkin(91, true)).setHardness(1.0F).setStepSound(soundWoodFootstep).setLightValue(1.0F).setUnlocalizedName("litpumpkin").setTextureName("pumpkin"); + public static final Block cake = (new BlockCake(92)).setHardness(0.5F).setStepSound(soundClothFootstep).setUnlocalizedName("cake").disableStats().setTextureName("cake"); + public static final BlockRedstoneRepeater redstoneRepeaterIdle = (BlockRedstoneRepeater)(new BlockRedstoneRepeater(93, false)).setHardness(0.0F).setStepSound(soundWoodFootstep).setUnlocalizedName("diode").disableStats().setTextureName("repeater_off"); +- public static final BlockRedstoneRepeater redstoneRepeaterActive = (BlockRedstoneRepeater)(new BlockRedstoneRepeater(94, true)).setHardness(0.0F).setLightValue(10.0F / 16.0F).setStepSound(soundWoodFootstep).setUnlocalizedName("diode").disableStats().setTextureName("repeater_on"); ++ public static final BlockRedstoneRepeater redstoneRepeaterActive = (BlockRedstoneRepeater)(new BlockRedstoneRepeater(94, true)).setHardness(0.0F).setLightValue(0.625F).setStepSound(soundWoodFootstep).setUnlocalizedName("diode").disableStats().setTextureName("repeater_on"); ++ ++ /** ++ * April fools secret locked chest, only spawns on new chunks on 1st April. ++ */ + public static final Block lockedChest = (new BlockLockedChest(95)).setHardness(0.0F).setLightValue(1.0F).setStepSound(soundWoodFootstep).setUnlocalizedName("lockedchest").setTickRandomly(true); + public static final Block trapdoor = (new BlockTrapDoor(96, Material.wood)).setHardness(3.0F).setStepSound(soundWoodFootstep).setUnlocalizedName("trapdoor").disableStats().setTextureName("trapdoor"); +- public static final Block silverfish = (new BlockSilverfish(97)).setHardness(12.0F / 16.0F).setUnlocalizedName("monsterStoneEgg"); ++ public static final Block silverfish = (new BlockSilverfish(97)).setHardness(0.75F).setUnlocalizedName("monsterStoneEgg"); + public static final Block stoneBrick = (new BlockStoneBrick(98)).setHardness(1.5F).setResistance(10.0F).setStepSound(soundStoneFootstep).setUnlocalizedName("stonebricksmooth").setTextureName("stonebrick"); + public static final Block mushroomCapBrown = (new BlockMushroomCap(99, Material.wood, 0)).setHardness(0.2F).setStepSound(soundWoodFootstep).setUnlocalizedName("mushroom").setTextureName("mushroom_block"); + public static final Block mushroomCapRed = (new BlockMushroomCap(100, Material.wood, 1)).setHardness(0.2F).setStepSound(soundWoodFootstep).setUnlocalizedName("mushroom").setTextureName("mushroom_block"); +@@ -140,12 +181,14 @@ + public static final Block stairsNetherBrick = (new BlockStairs(114, netherBrick, 0)).setUnlocalizedName("stairsNetherBrick"); + public static final Block netherStalk = (new BlockNetherStalk(115)).setUnlocalizedName("netherStalk").setTextureName("nether_wart"); + public static final Block enchantmentTable = (new BlockEnchantmentTable(116)).setHardness(5.0F).setResistance(2000.0F).setUnlocalizedName("enchantmentTable").setTextureName("enchanting_table"); +- public static final Block brewingStand = (new BlockBrewingStand(117)).setHardness(0.5F).setLightValue(2.0F / 16.0F).setUnlocalizedName("brewingStand").setTextureName("brewing_stand"); ++ public static final Block brewingStand = (new BlockBrewingStand(117)).setHardness(0.5F).setLightValue(0.125F).setUnlocalizedName("brewingStand").setTextureName("brewing_stand"); + public static final BlockCauldron cauldron = (BlockCauldron)(new BlockCauldron(118)).setHardness(2.0F).setUnlocalizedName("cauldron").setTextureName("cauldron"); + public static final Block endPortal = (new BlockEndPortal(119, Material.portal)).setHardness(-1.0F).setResistance(6000000.0F); +- public static final Block endPortalFrame = (new BlockEndPortalFrame(120)).setStepSound(soundGlassFootstep).setLightValue(2.0F / 16.0F).setHardness(-1.0F).setUnlocalizedName("endPortalFrame").setResistance(6000000.0F).setCreativeTab(CreativeTabs.tabDecorations).setTextureName("endframe"); ++ public static final Block endPortalFrame = (new BlockEndPortalFrame(120)).setStepSound(soundGlassFootstep).setLightValue(0.125F).setHardness(-1.0F).setUnlocalizedName("endPortalFrame").setResistance(6000000.0F).setCreativeTab(CreativeTabs.tabDecorations).setTextureName("endframe"); ++ ++ /** The rock found in The End. */ + public static final Block whiteStone = (new Block(121, Material.rock)).setHardness(3.0F).setResistance(15.0F).setStepSound(soundStoneFootstep).setUnlocalizedName("whiteStone").setCreativeTab(CreativeTabs.tabBlock).setTextureName("end_stone"); +- public static final Block dragonEgg = (new BlockDragonEgg(122)).setHardness(3.0F).setResistance(15.0F).setStepSound(soundStoneFootstep).setLightValue(2.0F / 16.0F).setUnlocalizedName("dragonEgg").setTextureName("dragon_egg"); ++ public static final Block dragonEgg = (new BlockDragonEgg(122)).setHardness(3.0F).setResistance(15.0F).setStepSound(soundStoneFootstep).setLightValue(0.125F).setUnlocalizedName("dragonEgg").setTextureName("dragon_egg"); + public static final Block redstoneLampIdle = (new BlockRedstoneLight(123, false)).setHardness(0.3F).setStepSound(soundGlassFootstep).setUnlocalizedName("redstoneLight").setCreativeTab(CreativeTabs.tabRedstone).setTextureName("redstone_lamp_off"); + public static final Block redstoneLampActive = (new BlockRedstoneLight(124, true)).setHardness(0.3F).setStepSound(soundGlassFootstep).setUnlocalizedName("redstoneLight").setTextureName("redstone_lamp_on"); + public static final BlockHalfSlab woodDoubleSlab = (BlockHalfSlab)(new BlockWoodSlab(125, true)).setHardness(2.0F).setResistance(5.0F).setStepSound(soundWoodFootstep).setUnlocalizedName("woodSlab"); +@@ -173,7 +216,7 @@ + public static final Block pressurePlateGold = (new BlockPressurePlateWeighted(147, "gold_block", Material.iron, 64)).setHardness(0.5F).setStepSound(soundWoodFootstep).setUnlocalizedName("weightedPlate_light"); + public static final Block pressurePlateIron = (new BlockPressurePlateWeighted(148, "iron_block", Material.iron, 640)).setHardness(0.5F).setStepSound(soundWoodFootstep).setUnlocalizedName("weightedPlate_heavy"); + public static final BlockComparator redstoneComparatorIdle = (BlockComparator)(new BlockComparator(149, false)).setHardness(0.0F).setStepSound(soundWoodFootstep).setUnlocalizedName("comparator").disableStats().setTextureName("comparator_off"); +- public static final BlockComparator redstoneComparatorActive = (BlockComparator)(new BlockComparator(150, true)).setHardness(0.0F).setLightValue(10.0F / 16.0F).setStepSound(soundWoodFootstep).setUnlocalizedName("comparator").disableStats().setTextureName("comparator_on"); ++ public static final BlockComparator redstoneComparatorActive = (BlockComparator)(new BlockComparator(150, true)).setHardness(0.0F).setLightValue(0.625F).setStepSound(soundWoodFootstep).setUnlocalizedName("comparator").disableStats().setTextureName("comparator_on"); + public static final BlockDaylightDetector daylightSensor = (BlockDaylightDetector)(new BlockDaylightDetector(151)).setHardness(0.2F).setStepSound(soundWoodFootstep).setUnlocalizedName("daylightDetector").setTextureName("daylight_detector"); + public static final Block blockRedstone = (new BlockPoweredOre(152)).setHardness(5.0F).setResistance(10.0F).setStepSound(soundMetalFootstep).setUnlocalizedName("blockRedstone").setTextureName("redstone_block"); + public static final Block oreNetherQuartz = (new BlockOre(153)).setHardness(3.0F).setResistance(5.0F).setStepSound(soundStoneFootstep).setUnlocalizedName("netherquartz").setTextureName("quartz_ore"); +@@ -187,103 +230,200 @@ + public static final Block carpet = (new BlockCarpet(171)).setHardness(0.1F).setStepSound(soundClothFootstep).setUnlocalizedName("woolCarpet").setLightOpacity(0); + public static final Block hardenedClay = (new Block(172, Material.rock)).setHardness(1.25F).setResistance(7.0F).setStepSound(soundStoneFootstep).setUnlocalizedName("clayHardened").setCreativeTab(CreativeTabs.tabBlock).setTextureName("hardened_clay"); + public static final Block coalBlock = (new Block(173, Material.rock)).setHardness(5.0F).setResistance(10.0F).setStepSound(soundStoneFootstep).setUnlocalizedName("blockCoal").setCreativeTab(CreativeTabs.tabBlock).setTextureName("coal_block"); ++ ++ /** ID of the block. */ + public final int blockID; +- protected float blockHardness; +- protected float blockResistance; ++ ++ /** Indicates how many hits it takes to break a block. */ ++ // Spout Start - protected to public ++ public float blockHardness; ++ // Spout End ++ ++ /** Indicates the blocks resistance to explosions. */ ++ // Spout Start - protected to public ++ public float blockResistance; ++ // Spout End ++ ++ /** ++ * set to true when Block's constructor is called through the chain of super()'s. Note: Never used ++ */ + protected boolean blockConstructorCalled = true; ++ ++ /** ++ * If this field is true, the block is counted for statistics (mined or placed) ++ */ + protected boolean enableStats = true; ++ ++ /** ++ * Flags whether or not this block is of a type that needs random ticking. Ref-counted by ExtendedBlockStorage in order ++ * to broadly cull a chunk from the random chunk update list for efficiency's sake. ++ */ + protected boolean needsRandomTick; ++ ++ /** true if the Block contains a Tile Entity */ + protected boolean isBlockContainer; ++ ++ /** minimum X for the block bounds (local coordinates) */ + protected double minX; ++ ++ /** minimum Y for the block bounds (local coordinates) */ + protected double minY; ++ ++ /** minimum Z for the block bounds (local coordinates) */ + protected double minZ; ++ ++ /** maximum X for the block bounds (local coordinates) */ + protected double maxX; ++ ++ /** maximum Y for the block bounds (local coordinates) */ + protected double maxY; ++ ++ /** maximum Z for the block bounds (local coordinates) */ + protected double maxZ; +- public StepSound stepSound = soundPowderFootstep; +- public float blockParticleGravity = 1.0F; ++ ++ /** Sound of stepping on the block */ ++ public StepSound stepSound; ++ public float blockParticleGravity; ++ ++ /** Block material definition. */ + public final Material blockMaterial; +- public float slipperiness = 0.6F; +- private String b; ++ ++ /** ++ * Determines how much velocity is maintained while moving on top of this block ++ */ ++ public float slipperiness; ++ ++ /** The unlocalized name of this block. */ ++ private String unlocalizedName; + protected Icon blockIcon; + +- protected Block(int var1, Material var2) { +- if(blocksList[var1] != null) { +- throw new IllegalArgumentException("Slot " + var1 + " is already occupied by " + blocksList[var1] + " when adding " + this); ++ private String blockName; ++ // Spout Start ++ public static short[] customIds = null; ++ // Spout End ++ ++ protected Block(int par1, Material par2Material) { ++ this.stepSound = soundPowderFootstep; ++ this.blockParticleGravity = 1.0F; ++ this.slipperiness = 0.6F; ++ ++ if (blocksList[par1] != null) { ++ throw new IllegalArgumentException("Slot " + par1 + " is already occupied by " + blocksList[par1] + " when adding " + this); + } else { +- this.blockMaterial = var2; +- blocksList[var1] = this; +- this.blockID = var1; ++ this.blockMaterial = par2Material; ++ blocksList[par1] = this; ++ this.blockID = par1; + this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F); +- opaqueCubeLookup[var1] = this.isOpaqueCube(); +- lightOpacity[var1] = this.isOpaqueCube() ? 255 : 0; +- canBlockGrass[var1] = !var2.getCanBlockGrass(); ++ opaqueCubeLookup[par1] = this.isOpaqueCube(); ++ lightOpacity[par1] = this.isOpaqueCube() ? 255 : 0; ++ canBlockGrass[par1] = !par2Material.getCanBlockGrass(); + } + } + +- protected void initializeBlock() { +- } +- +- protected Block setStepSound(StepSound var1) { +- this.stepSound = var1; +- return this; +- } +- +- protected Block setLightOpacity(int var1) { +- lightOpacity[this.blockID] = var1; +- return this; +- } +- +- protected Block setLightValue(float var1) { +- lightValue[this.blockID] = (int)(15.0F * var1); +- return this; +- } +- +- protected Block setResistance(float var1) { +- this.blockResistance = var1 * 3.0F; +- return this; +- } +- +- public static boolean isNormalCube(int var0) { +- Block var1 = blocksList[var0]; ++ /** ++ * This method is called on a block after all other blocks gets already created. You can use it to reference and ++ * configure something on the block that needs the others ones. ++ */ ++ protected void initializeBlock() {} ++ ++ /** ++ * Sets the footstep sound for the block. Returns the object for convenience in constructing. ++ */ ++ protected Block setStepSound(StepSound par1StepSound) { ++ this.stepSound = par1StepSound; ++ return this; ++ } ++ ++ /** ++ * Sets how much light is blocked going through this block. Returns the object for convenience in constructing. ++ */ ++ // Spout Start - protected to public ++ public Block setLightOpacity(int par1) { ++ // Spout End ++ lightOpacity[this.blockID] = par1; ++ return this; ++ } ++ ++ /** ++ * Sets the amount of light emitted by a block from 0.0f to 1.0f (converts internally to 0-15). Returns the object for ++ * convenience in constructing. ++ */ ++ protected Block setLightValue(float par1) { ++ lightValue[this.blockID] = (int)(15.0F * par1); ++ return this; ++ } ++ ++ /** ++ * Sets the the blocks resistance to explosions. Returns the object for convenience in constructing. ++ */ ++ protected Block setResistance(float par1) { ++ this.blockResistance = par1 * 3.0F; ++ return this; ++ } ++ ++ public static boolean isNormalCube(int par0) { ++ Block var1 = blocksList[par0]; + return var1 == null ? false : var1.blockMaterial.isOpaque() && var1.renderAsNormalBlock() && !var1.canProvidePower(); + } + ++ /** ++ * If this block doesn't render as an ordinary block it will return False (examples: signs, buttons, stairs, etc) ++ */ + public boolean renderAsNormalBlock() { +- return true; ++ return !SpoutClient.getInstance().xrayMode; + } + +- public boolean getBlocksMovement(IBlockAccess var1, int var2, int var3, int var4) { ++ public boolean getBlocksMovement(IBlockAccess par1IBlockAccess, int par2, int par3, int par4) { + return !this.blockMaterial.blocksMovement(); + } + ++ /** ++ * The type of render function that is called for this block ++ */ + public int getRenderType() { + return 0; + } + +- protected Block setHardness(float var1) { +- this.blockHardness = var1; +- if(this.blockResistance < var1 * 5.0F) { +- this.blockResistance = var1 * 5.0F; ++ /** ++ * Sets how many hits it takes to break a block. ++ */ ++ protected Block setHardness(float par1) { ++ this.blockHardness = par1; ++ ++ if (this.blockResistance < par1 * 5.0F) { ++ this.blockResistance = par1 * 5.0F; + } + + return this; + } + ++ /** ++ * This method will make the hardness of the block equals to -1, and the block is indestructible. ++ */ + protected Block setBlockUnbreakable() { + this.setHardness(-1.0F); + return this; + } + +- public float getBlockHardness(World var1, int var2, int var3, int var4) { ++ /** ++ * Returns the block hardness at a location. Args: world, x, y, z ++ */ ++ public float getBlockHardness(World par1World, int par2, int par3, int par4) { + return this.blockHardness; + } + +- protected Block setTickRandomly(boolean var1) { +- this.needsRandomTick = var1; ++ /** ++ * Sets whether this block type will receive random update ticks ++ */ ++ protected Block setTickRandomly(boolean par1) { ++ this.needsRandomTick = par1; + return this; + } + ++ /** ++ * Returns whether or not this block is of a type that needs random ticking. Called for ref-counting purposes by ++ * ExtendedBlockStorage in order to broadly cull a chunk from the random chunk update list for efficiency's sake. ++ */ + public boolean getTickRandomly() { + return this.needsRandomTick; + } +@@ -292,320 +432,560 @@ + return this.isBlockContainer; + } + +- protected final void setBlockBounds(float var1, float var2, float var3, float var4, float var5, float var6) { +- this.minX = (double)var1; +- this.minY = (double)var2; +- this.minZ = (double)var3; +- this.maxX = (double)var4; +- this.maxY = (double)var5; +- this.maxZ = (double)var6; +- } +- +- public float getBlockBrightness(IBlockAccess var1, int var2, int var3, int var4) { +- return var1.getBrightness(var2, var3, var4, lightValue[var1.getBlockId(var2, var3, var4)]); +- } +- +- public int getMixedBrightnessForBlock(IBlockAccess var1, int var2, int var3, int var4) { +- return var1.getLightBrightnessForSkyBlocks(var2, var3, var4, lightValue[var1.getBlockId(var2, var3, var4)]); +- } +- +- public boolean shouldSideBeRendered(IBlockAccess var1, int var2, int var3, int var4, int var5) { +- return var5 == 0 && this.minY > 0.0D ? true : (var5 == 1 && this.maxY < 1.0D ? true : (var5 == 2 && this.minZ > 0.0D ? true : (var5 == 3 && this.maxZ < 1.0D ? true : (var5 == 4 && this.minX > 0.0D ? true : (var5 == 5 && this.maxX < 1.0D ? true : !var1.isBlockOpaqueCube(var2, var3, var4)))))); +- } +- +- public boolean isBlockSolid(IBlockAccess var1, int var2, int var3, int var4, int var5) { +- return var1.getBlockMaterial(var2, var3, var4).isSolid(); +- } +- +- public Icon getBlockTexture(IBlockAccess var1, int var2, int var3, int var4, int var5) { +- return this.getIcon(var5, var1.getBlockMetadata(var2, var3, var4)); +- } +- +- public Icon getIcon(int var1, int var2) { ++ /** ++ * Sets the bounds of the block. minX, minY, minZ, maxX, maxY, maxZ ++ */ ++ protected final void setBlockBounds(float par1, float par2, float par3, float par4, float par5, float par6) { ++ this.minX = (double)par1; ++ this.minY = (double)par2; ++ this.minZ = (double)par3; ++ this.maxX = (double)par4; ++ this.maxY = (double)par5; ++ this.maxZ = (double)par6; ++ } ++ ++ /** ++ * How bright to render this block based on the light its receiving. Args: iBlockAccess, x, y, z ++ */ ++ // Spout Start ++ public float getBlockBrightness(IBlockAccess par1IBlockAccess, int x, int y, int z) { ++ if (SpoutClient.getInstance().xrayMode) { ++ return 1000.0F; ++ } else { ++ int light = lightValue[par1IBlockAccess.getBlockId(x, y, z)]; ++ if (customIds != null) { ++ int key = ((x & 0xF) << 12) | ((z & 0xF) << 8) | (y & 256); ++ short customId = customIds[key]; ++ if (customId > 0) { ++ CustomBlock block = MaterialData.getCustomBlock(customId); ++ if (block != null) { ++ light = block.getLightLevel(); ++ } ++ } ++ } ++ return par1IBlockAccess.getBrightness(x, y, z, light); ++ } ++ // Spout End ++ } ++ ++ /** ++ * Goes straight to getLightBrightnessForSkyBlocks for Blocks, does some fancy computing for Fluids ++ */ ++ // Spout Start ++ public int getMixedBrightnessForBlock(IBlockAccess par1IBlockAccess, int x, int y, int z) { ++ if (SpoutClient.getInstance().xrayMode) { ++ return 15728640; ++ } else { ++ int light = lightValue[par1IBlockAccess.getBlockId(x, y, z)]; ++ if (customIds != null) { ++ int key = ((x & 0xF) << 12) | ((z & 0xF) << 8) | (y & 256); ++ short customId = customIds[key]; ++ if (customId > 0) { ++ CustomBlock block = MaterialData.getCustomBlock(customId); ++ if (block != null) { ++ light = block.getLightLevel(); ++ } ++ } ++ } ++ return par1IBlockAccess.getLightBrightnessForSkyBlocks(x, y, z, light); ++ } ++ // Spout End ++ } ++ ++ /** ++ * Returns true if the given side of this block type should be rendered, if the adjacent block is at the given ++ * coordinates. Args: blockAccess, x, y, z, side ++ */ ++ public boolean shouldSideBeRendered(IBlockAccess par1IBlockAccess, int par2, int par3, int par4, int par5) { ++ int[] var6; ++ int var7; ++ ++ if (SpoutClient.getInstance().xrayMode) { ++ var6 = SpoutClient.getInstance().visibleBlocks; ++ for (var7 = 0; var7 < var6.length; ++var7) { ++ if (this.blockID == var6[var7]) { ++ return true; ++ } ++ } ++ return false; ++ } else { ++ return par5 == 0 && this.minY > 0.0D ? true : (par5 == 1 && this.maxY < 1.0D ? true : (par5 == 2 && this.minZ > 0.0D ? true : (par5 == 3 && this.maxZ < 1.0D ? true : (par5 == 4 && this.minX > 0.0D ? true : (par5 == 5 && this.maxX < 1.0D ? true : !par1IBlockAccess.isBlockOpaqueCube(par2, par3, par4)))))); ++ } ++ } ++ ++ /** ++ * Returns Returns true if the given side of this block type should be rendered (if it's solid or not), if the adjacent ++ * block is at the given coordinates. Args: blockAccess, x, y, z, side ++ */ ++ public boolean isBlockSolid(IBlockAccess par1IBlockAccess, int par2, int par3, int par4, int par5) { ++ return par1IBlockAccess.getBlockMaterial(par2, par3, par4).isSolid(); ++ } ++ ++ /** ++ * Retrieves the block texture to use based on the display side. Args: iBlockAccess, x, y, z, side ++ */ ++ public Icon getBlockTexture(IBlockAccess par1IBlockAccess, int par2, int par3, int par4, int par5) { ++ return this.getIcon(par5, par1IBlockAccess.getBlockMetadata(par2, par3, par4)); ++ } ++ ++ /** ++ * From the specified side and block metadata retrieves the blocks texture. Args: side, metadata ++ */ ++ public Icon getIcon(int par1, int par2) { + return this.blockIcon; + } + +- public final Icon getBlockTextureFromSide(int var1) { +- return this.getIcon(var1, 0); +- } +- +- public AxisAlignedBB getSelectedBoundingBoxFromPool(World var1, int var2, int var3, int var4) { +- return AxisAlignedBB.getAABBPool().getAABB((double)var2 + this.minX, (double)var3 + this.minY, (double)var4 + this.minZ, (double)var2 + this.maxX, (double)var3 + this.maxY, (double)var4 + this.maxZ); +- } +- +- public void addCollisionBoxesToList(World var1, int var2, int var3, int var4, AxisAlignedBB var5, List var6, Entity var7) { +- AxisAlignedBB var8 = this.getCollisionBoundingBoxFromPool(var1, var2, var3, var4); +- if(var8 != null && var5.intersectsWith(var8)) { +- var6.add(var8); ++ /** ++ * Returns the block texture based on the side being looked at. Args: side ++ */ ++ public final Icon getBlockTextureFromSide(int par1) { ++ return this.getIcon(par1, 0); ++ } ++ ++ /** ++ * Returns the bounding box of the wired rectangular prism to render. ++ */ ++ public AxisAlignedBB getSelectedBoundingBoxFromPool(World par1World, int par2, int par3, int par4) { ++ return AxisAlignedBB.getAABBPool().getAABB((double)par2 + this.minX, (double)par3 + this.minY, (double)par4 + this.minZ, (double)par2 + this.maxX, (double)par3 + this.maxY, (double)par4 + this.maxZ); ++ } ++ ++ /** ++ * Adds all intersecting collision boxes to a list. (Be sure to only add boxes to the list if they intersect the mask.) ++ * Parameters: World, X, Y, Z, mask, list, colliding entity ++ */ ++ public void addCollisionBoxesToList(World par1World, int par2, int par3, int par4, AxisAlignedBB par5AxisAlignedBB, List par6List, Entity par7Entity) { ++ AxisAlignedBB var8 = this.getCollisionBoundingBoxFromPool(par1World, par2, par3, par4); ++ ++ if (var8 != null && par5AxisAlignedBB.intersectsWith(var8)) { ++ par6List.add(var8); + } +- +- } +- +- public AxisAlignedBB getCollisionBoundingBoxFromPool(World var1, int var2, int var3, int var4) { +- return AxisAlignedBB.getAABBPool().getAABB((double)var2 + this.minX, (double)var3 + this.minY, (double)var4 + this.minZ, (double)var2 + this.maxX, (double)var3 + this.maxY, (double)var4 + this.maxZ); +- } +- ++ } ++ ++ /** ++ * Returns a bounding box from the pool of bounding boxes (this means this box can change after the pool has been ++ * cleared to be reused) ++ */ ++ public AxisAlignedBB getCollisionBoundingBoxFromPool(World par1World, int par2, int par3, int par4) { ++ return AxisAlignedBB.getAABBPool().getAABB((double)par2 + this.minX, (double)par3 + this.minY, (double)par4 + this.minZ, (double)par2 + this.maxX, (double)par3 + this.maxY, (double)par4 + this.maxZ); ++ } ++ ++ /** ++ * Is this block (a) opaque and (b) a full 1m cube? This determines whether or not to render the shared face of two ++ * adjacent blocks and also whether the player can attach torches, redstone wire, etc to this block. ++ */ + public boolean isOpaqueCube() { + return true; + } + +- public boolean canCollideCheck(int var1, boolean var2) { ++ /** ++ * Returns whether this block is collideable based on the arguments passed in \n@param par1 block metaData \n@param ++ * par2 whether the player right-clicked while holding a boat ++ */ ++ public boolean canCollideCheck(int par1, boolean par2) { + return this.isCollidable(); + } + ++ /** ++ * Returns if this block is collidable (only used by Fire). Args: x, y, z ++ */ + public boolean isCollidable() { + return true; + } + +- public void updateTick(World var1, int var2, int var3, int var4, Random var5) { +- } +- +- public void randomDisplayTick(World var1, int var2, int var3, int var4, Random var5) { +- } +- +- public void onBlockDestroyedByPlayer(World var1, int var2, int var3, int var4, int var5) { +- } +- +- public void onNeighborBlockChange(World var1, int var2, int var3, int var4, int var5) { +- } +- +- public int tickRate(World var1) { ++ /** ++ * Ticks the block if it's been scheduled ++ */ ++ public void updateTick(World par1World, int par2, int par3, int par4, Random par5Random) {} ++ ++ /** ++ * A randomly called display update to be able to add particles or other items for display ++ */ ++ public void randomDisplayTick(World par1World, int par2, int par3, int par4, Random par5Random) {} ++ ++ /** ++ * Called right before the block is destroyed by a player. Args: world, x, y, z, metaData ++ */ ++ public void onBlockDestroyedByPlayer(World par1World, int par2, int par3, int par4, int par5) {} ++ ++ /** ++ * Lets the block know when one of its neighbor changes. Doesn't know which neighbor changed (coordinates passed are ++ * their own) Args: x, y, z, neighbor blockID ++ */ ++ public void onNeighborBlockChange(World par1World, int par2, int par3, int par4, int par5) {} ++ ++ /** ++ * How many world ticks before ticking ++ */ ++ public int tickRate(World par1World) { + return 10; + } + +- public void onBlockAdded(World var1, int var2, int var3, int var4) { +- } +- +- public void breakBlock(World var1, int var2, int var3, int var4, int var5, int var6) { +- } +- +- public int quantityDropped(Random var1) { ++ /** ++ * Called whenever the block is added into the world. Args: world, x, y, z ++ */ ++ public void onBlockAdded(World par1World, int par2, int par3, int par4) {} ++ ++ /** ++ * Called on server worlds only when the block has been replaced by a different block ID, or the same block with a ++ * different metadata value, but before the new metadata value is set. Args: World, x, y, z, old block ID, old metadata ++ */ ++ public void breakBlock(World par1World, int par2, int par3, int par4, int par5, int par6) {} ++ ++ /** ++ * Returns the quantity of items to drop on block destruction. ++ */ ++ public int quantityDropped(Random par1Random) { + return 1; + } + +- public int idDropped(int var1, Random var2, int var3) { ++ /** ++ * Returns the ID of the items to drop on destruction. ++ */ ++ public int idDropped(int par1, Random par2Random, int par3) { + return this.blockID; + } + +- public float getPlayerRelativeBlockHardness(EntityPlayer var1, World var2, int var3, int var4, int var5) { +- float var6 = this.getBlockHardness(var2, var3, var4, var5); +- return var6 < 0.0F ? 0.0F : (!var1.canHarvestBlock(this) ? var1.getCurrentPlayerStrVsBlock(this, false) / var6 / 100.0F : var1.getCurrentPlayerStrVsBlock(this, true) / var6 / 30.0F); +- } +- +- public final void dropBlockAsItem(World var1, int var2, int var3, int var4, int var5, int var6) { +- this.dropBlockAsItemWithChance(var1, var2, var3, var4, var5, 1.0F, var6); +- } +- +- public void dropBlockAsItemWithChance(World var1, int var2, int var3, int var4, int var5, float var6, int var7) { +- if(!var1.isRemote) { +- int var8 = this.quantityDroppedWithBonus(var7, var1.s); +- +- for(int var9 = 0; var9 < var8; ++var9) { +- if(var1.s.nextFloat() <= var6) { +- int var10 = this.idDropped(var5, var1.s, var7); +- if(var10 > 0) { +- this.dropBlockAsItem_do(var1, var2, var3, var4, new ItemStack(var10, 1, this.damageDropped(var5))); +- } +- } +- } +- +- } +- } +- +- protected void dropBlockAsItem_do(World var1, int var2, int var3, int var4, ItemStack var5) { +- if(!var1.isRemote && var1.getGameRules().getGameRuleBooleanValue("doTileDrops")) { ++ /** ++ * Gets the hardness of block at the given coordinates in the given world, relative to the ability of the given ++ * EntityPlayer. ++ */ ++ // TODO: This should be combined into one method. ++ public float getPlayerRelativeBlockHardness(EntityPlayer par1EntityPlayer, World par2World, int par3, int par4, int par5) { ++ float var6 = this.getBlockHardness(par2World, par3, par4, par5); ++ return var6 < 0.0F ? 0.0F : (!par1EntityPlayer.canHarvestBlock(this) ? par1EntityPlayer.getCurrentPlayerStrVsBlock(this, false) / var6 / 100.0F : par1EntityPlayer.getCurrentPlayerStrVsBlock(this, true) / var6 / 30.0F); ++ } ++ ++ // Spout Start ++ /** ++ * Gets the hardness of block at the given coordinates in the given world, relative to the ability of the given ++ * EntityPlayer. ++ */ ++ public float getPlayerRelativeBlockHardness(EntityPlayer entityhuman) { ++ if (entityhuman instanceof EntityPlayerSP) { ++ FixedLocation target = Spoutcraft.getActivePlayer().getLastClickedLocation(); ++ if (target != null) { ++ int x = (int) target.getX(); ++ int y = (int) target.getY(); ++ int z = (int) target.getZ(); ++ SpoutcraftChunk chunk = Spoutcraft.getChunkAt(entityhuman.worldObj, x, y, z); ++ short customId = chunk.getCustomBlockId(x, y, z); ++ if (customId > 0) { ++ CustomBlock b = MaterialData.getCustomBlock(customId); ++ if (b == null) { ++ // ToDo: Shouldn't be needed. Something outside of SpoutPlugin changed the Custom Blocks value outside of SpoutPlugin. This is a fall-back return to prevent client returning null and crashing. ++ return (!entityhuman.canHarvestBlock(this) ? entityhuman.getCurrentPlayerStrVsBlock(this, false) / 1.0F / 100.0F : entityhuman.getCurrentPlayerStrVsBlock(this, true) / 1.0F / 30.0F); ++ } ++ return b.getHardness() < 0.0F ? 0.0F : (!entityhuman.canHarvestBlock(this) ? entityhuman.getCurrentPlayerStrVsBlock(this, false) / b.getHardness() / 100.0F : entityhuman.getCurrentPlayerStrVsBlock(this, true) / b.getHardness() / 30.0F); ++ } ++ } ++ } ++ return this.blockHardness < 0.0F ? 0.0F : (!entityhuman.canHarvestBlock(this) ? entityhuman.getCurrentPlayerStrVsBlock(this, false) / this.blockHardness / 100.0F : entityhuman.getCurrentPlayerStrVsBlock(this, true) / this.blockHardness / 30.0F); ++ } ++ // Spout End ++ ++ /** ++ * Drops the specified block items ++ */ ++ public final void dropBlockAsItem(World par1World, int par2, int par3, int par4, int par5, int par6) { ++ this.dropBlockAsItemWithChance(par1World, par2, par3, par4, par5, 1.0F, par6); ++ } ++ ++ /** ++ * Drops the block items with a specified chance of dropping the specified items ++ */ ++ public void dropBlockAsItemWithChance(World par1World, int par2, int par3, int par4, int par5, float par6, int par7) { ++ if (!par1World.isRemote) { ++ int var8 = this.quantityDroppedWithBonus(par7, par1World.rand); ++ ++ for (int var9 = 0; var9 < var8; ++var9) { ++ if (par1World.rand.nextFloat() <= par6) { ++ int var10 = this.idDropped(par5, par1World.rand, par7); ++ ++ if (var10 > 0) { ++ this.dropBlockAsItem_do(par1World, par2, par3, par4, new ItemStack(var10, 1, this.damageDropped(par5))); ++ } ++ } ++ } ++ } ++ } ++ ++ /** ++ * Spawns EntityItem in the world for the given ItemStack if the world is not remote. ++ */ ++ protected void dropBlockAsItem_do(World par1World, int par2, int par3, int par4, ItemStack par5ItemStack) { ++ if (!par1World.isRemote && par1World.getGameRules().getGameRuleBooleanValue("doTileDrops")) { + float var6 = 0.7F; +- double var7 = (double)(var1.s.nextFloat() * var6) + (double)(1.0F - var6) * 0.5D; +- double var9 = (double)(var1.s.nextFloat() * var6) + (double)(1.0F - var6) * 0.5D; +- double var11 = (double)(var1.s.nextFloat() * var6) + (double)(1.0F - var6) * 0.5D; +- EntityItem var13 = new EntityItem(var1, (double)var2 + var7, (double)var3 + var9, (double)var4 + var11, var5); ++ double var7 = (double)(par1World.rand.nextFloat() * var6) + (double)(1.0F - var6) * 0.5D; ++ double var9 = (double)(par1World.rand.nextFloat() * var6) + (double)(1.0F - var6) * 0.5D; ++ double var11 = (double)(par1World.rand.nextFloat() * var6) + (double)(1.0F - var6) * 0.5D; ++ EntityItem var13 = new EntityItem(par1World, (double)par2 + var7, (double)par3 + var9, (double)par4 + var11, par5ItemStack); + var13.delayBeforeCanPickup = 10; +- var1.spawnEntityInWorld(var13); ++ par1World.spawnEntityInWorld(var13); + } + } + +- protected void dropXpOnBlockBreak(World var1, int var2, int var3, int var4, int var5) { +- if(!var1.isRemote) { +- while(var5 > 0) { +- int var6 = EntityXPOrb.getXPSplit(var5); +- var5 -= var6; +- var1.spawnEntityInWorld(new EntityXPOrb(var1, (double)var2 + 0.5D, (double)var3 + 0.5D, (double)var4 + 0.5D, var6)); ++ /** ++ * called by spawner, ore, redstoneOre blocks ++ */ ++ protected void dropXpOnBlockBreak(World par1World, int par2, int par3, int par4, int par5) { ++ if (!par1World.isRemote) { ++ while (par5 > 0) { ++ int var6 = EntityXPOrb.getXPSplit(par5); ++ par5 -= var6; ++ par1World.spawnEntityInWorld(new EntityXPOrb(par1World, (double)par2 + 0.5D, (double)par3 + 0.5D, (double)par4 + 0.5D, var6)); + } + } +- + } + +- public int damageDropped(int var1) { ++ /** ++ * Determines the damage on the item the block drops. Used in cloth and wood. ++ */ ++ public int damageDropped(int par1) { + return 0; + } + +- public float getExplosionResistance(Entity var1) { ++ // Spout Start - getBlockHardness version with removed random params. ++ public float getHardness() { ++ return this.blockHardness; ++ } ++ // Spout End ++ ++ /** ++ * Returns how much this block can resist explosions from the passed in entity. ++ */ ++ public float getExplosionResistance(Entity par1Entity) { + return this.blockResistance / 5.0F; + } + +- public MovingObjectPosition collisionRayTrace(World var1, int var2, int var3, int var4, Vec3 var5, Vec3 var6) { +- this.setBlockBoundsBasedOnState(var1, var2, var3, var4); +- var5 = var5.addVector((double)(-var2), (double)(-var3), (double)(-var4)); +- var6 = var6.addVector((double)(-var2), (double)(-var3), (double)(-var4)); +- Vec3 var7 = var5.getIntermediateWithXValue(var6, this.minX); +- Vec3 var8 = var5.getIntermediateWithXValue(var6, this.maxX); +- Vec3 var9 = var5.getIntermediateWithYValue(var6, this.minY); +- Vec3 var10 = var5.getIntermediateWithYValue(var6, this.maxY); +- Vec3 var11 = var5.getIntermediateWithZValue(var6, this.minZ); +- Vec3 var12 = var5.getIntermediateWithZValue(var6, this.maxZ); +- if(!this.isVecInsideYZBounds(var7)) { ++ /** ++ * Ray traces through the blocks collision from start vector to end vector returning a ray trace hit. Args: world, x, ++ * y, z, startVec, endVec ++ */ ++ public MovingObjectPosition collisionRayTrace(World par1World, int par2, int par3, int par4, Vec3 par5Vec3, Vec3 par6Vec3) { ++ this.setBlockBoundsBasedOnState(par1World, par2, par3, par4); ++ par5Vec3 = par5Vec3.addVector((double)(-par2), (double)(-par3), (double)(-par4)); ++ par6Vec3 = par6Vec3.addVector((double)(-par2), (double)(-par3), (double)(-par4)); ++ Vec3 var7 = par5Vec3.getIntermediateWithXValue(par6Vec3, this.minX); ++ Vec3 var8 = par5Vec3.getIntermediateWithXValue(par6Vec3, this.maxX); ++ Vec3 var9 = par5Vec3.getIntermediateWithYValue(par6Vec3, this.minY); ++ Vec3 var10 = par5Vec3.getIntermediateWithYValue(par6Vec3, this.maxY); ++ Vec3 var11 = par5Vec3.getIntermediateWithZValue(par6Vec3, this.minZ); ++ Vec3 var12 = par5Vec3.getIntermediateWithZValue(par6Vec3, this.maxZ); ++ ++ if (!this.isVecInsideYZBounds(var7)) { + var7 = null; + } + +- if(!this.isVecInsideYZBounds(var8)) { ++ if (!this.isVecInsideYZBounds(var8)) { + var8 = null; + } + +- if(!this.isVecInsideXZBounds(var9)) { ++ if (!this.isVecInsideXZBounds(var9)) { + var9 = null; + } + +- if(!this.isVecInsideXZBounds(var10)) { ++ if (!this.isVecInsideXZBounds(var10)) { + var10 = null; + } + +- if(!this.isVecInsideXYBounds(var11)) { ++ if (!this.isVecInsideXYBounds(var11)) { + var11 = null; + } + +- if(!this.isVecInsideXYBounds(var12)) { ++ if (!this.isVecInsideXYBounds(var12)) { + var12 = null; + } + + Vec3 var13 = null; +- if(var7 != null && (var13 == null || var5.squareDistanceTo(var7) < var5.squareDistanceTo(var13))) { ++ ++ if (var7 != null && (var13 == null || par5Vec3.squareDistanceTo(var7) < par5Vec3.squareDistanceTo(var13))) { + var13 = var7; + } + +- if(var8 != null && (var13 == null || var5.squareDistanceTo(var8) < var5.squareDistanceTo(var13))) { ++ if (var8 != null && (var13 == null || par5Vec3.squareDistanceTo(var8) < par5Vec3.squareDistanceTo(var13))) { + var13 = var8; + } + +- if(var9 != null && (var13 == null || var5.squareDistanceTo(var9) < var5.squareDistanceTo(var13))) { ++ if (var9 != null && (var13 == null || par5Vec3.squareDistanceTo(var9) < par5Vec3.squareDistanceTo(var13))) { + var13 = var9; + } + +- if(var10 != null && (var13 == null || var5.squareDistanceTo(var10) < var5.squareDistanceTo(var13))) { ++ if (var10 != null && (var13 == null || par5Vec3.squareDistanceTo(var10) < par5Vec3.squareDistanceTo(var13))) { + var13 = var10; + } + +- if(var11 != null && (var13 == null || var5.squareDistanceTo(var11) < var5.squareDistanceTo(var13))) { ++ if (var11 != null && (var13 == null || par5Vec3.squareDistanceTo(var11) < par5Vec3.squareDistanceTo(var13))) { + var13 = var11; + } + +- if(var12 != null && (var13 == null || var5.squareDistanceTo(var12) < var5.squareDistanceTo(var13))) { ++ if (var12 != null && (var13 == null || par5Vec3.squareDistanceTo(var12) < par5Vec3.squareDistanceTo(var13))) { + var13 = var12; + } + +- if(var13 == null) { ++ if (var13 == null) { + return null; + } else { + byte var14 = -1; +- if(var13 == var7) { ++ ++ if (var13 == var7) { + var14 = 4; + } + +- if(var13 == var8) { ++ if (var13 == var8) { + var14 = 5; + } + +- if(var13 == var9) { ++ if (var13 == var9) { + var14 = 0; + } + +- if(var13 == var10) { ++ if (var13 == var10) { + var14 = 1; + } + +- if(var13 == var11) { ++ if (var13 == var11) { + var14 = 2; + } + +- if(var13 == var12) { ++ if (var13 == var12) { + var14 = 3; + } + +- return new MovingObjectPosition(var2, var3, var4, var14, var13.addVector((double)var2, (double)var3, (double)var4)); ++ return new MovingObjectPosition(par2, par3, par4, var14, var13.addVector((double)par2, (double)par3, (double)par4)); + } + } + +- private boolean isVecInsideYZBounds(Vec3 var1) { +- return var1 == null ? false : var1.yCoord >= this.minY && var1.yCoord <= this.maxY && var1.zCoord >= this.minZ && var1.zCoord <= this.maxZ; +- } +- +- private boolean isVecInsideXZBounds(Vec3 var1) { +- return var1 == null ? false : var1.xCoord >= this.minX && var1.xCoord <= this.maxX && var1.zCoord >= this.minZ && var1.zCoord <= this.maxZ; +- } +- +- private boolean isVecInsideXYBounds(Vec3 var1) { +- return var1 == null ? false : var1.xCoord >= this.minX && var1.xCoord <= this.maxX && var1.yCoord >= this.minY && var1.yCoord <= this.maxY; +- } +- +- public void onBlockDestroyedByExplosion(World var1, int var2, int var3, int var4, Explosion var5) { +- } +- ++ /** ++ * Checks if a vector is within the Y and Z bounds of the block. ++ */ ++ private boolean isVecInsideYZBounds(Vec3 par1Vec3) { ++ return par1Vec3 == null ? false : par1Vec3.yCoord >= this.minY && par1Vec3.yCoord <= this.maxY && par1Vec3.zCoord >= this.minZ && par1Vec3.zCoord <= this.maxZ; ++ } ++ ++ /** ++ * Checks if a vector is within the X and Z bounds of the block. ++ */ ++ private boolean isVecInsideXZBounds(Vec3 par1Vec3) { ++ return par1Vec3 == null ? false : par1Vec3.xCoord >= this.minX && par1Vec3.xCoord <= this.maxX && par1Vec3.zCoord >= this.minZ && par1Vec3.zCoord <= this.maxZ; ++ } ++ ++ /** ++ * Checks if a vector is within the X and Y bounds of the block. ++ */ ++ private boolean isVecInsideXYBounds(Vec3 par1Vec3) { ++ return par1Vec3 == null ? false : par1Vec3.xCoord >= this.minX && par1Vec3.xCoord <= this.maxX && par1Vec3.yCoord >= this.minY && par1Vec3.yCoord <= this.maxY; ++ } ++ ++ /** ++ * Called upon the block being destroyed by an explosion ++ */ ++ public void onBlockDestroyedByExplosion(World par1World, int par2, int par3, int par4, Explosion par5Explosion) {} ++ ++ /** ++ * Returns which pass should this block be rendered on. 0 for solids and 1 for alpha ++ */ + public int getRenderBlockPass() { + return 0; + } + +- public boolean canPlaceBlockOnSide(World var1, int var2, int var3, int var4, int var5, ItemStack var6) { +- return this.canPlaceBlockOnSide(var1, var2, var3, var4, var5); +- } +- +- public boolean canPlaceBlockOnSide(World var1, int var2, int var3, int var4, int var5) { +- return this.canPlaceBlockAt(var1, var2, var3, var4); +- } +- +- public boolean canPlaceBlockAt(World var1, int var2, int var3, int var4) { +- int var5 = var1.getBlockId(var2, var3, var4); ++ public boolean canPlaceBlockOnSide(World par1World, int par2, int par3, int par4, int par5, ItemStack par6ItemStack) { ++ return this.canPlaceBlockOnSide(par1World, par2, par3, par4, par5); ++ } ++ ++ /** ++ * checks to see if you can place this block can be placed on that side of a block: BlockLever overrides ++ */ ++ public boolean canPlaceBlockOnSide(World par1World, int par2, int par3, int par4, int par5) { ++ return this.canPlaceBlockAt(par1World, par2, par3, par4); ++ } ++ ++ /** ++ * Checks to see if its valid to put this block at the specified coordinates. Args: world, x, y, z ++ */ ++ public boolean canPlaceBlockAt(World par1World, int par2, int par3, int par4) { ++ int var5 = par1World.getBlockId(par2, par3, par4); + return var5 == 0 || blocksList[var5].blockMaterial.isReplaceable(); + } + +- public boolean onBlockActivated(World var1, int var2, int var3, int var4, EntityPlayer var5, int var6, float var7, float var8, float var9) { ++ /** ++ * Called upon block activation (right click on the block.) ++ */ ++ public boolean onBlockActivated(World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer, int par6, float par7, float par8, float par9) { + return false; + } + +- public void onEntityWalking(World var1, int var2, int var3, int var4, Entity var5) { +- } +- +- public int onBlockPlaced(World var1, int var2, int var3, int var4, int var5, float var6, float var7, float var8, int var9) { +- return var9; +- } +- ++ /** ++ * Called whenever an entity is walking on top of this block. Args: world, x, y, z, entity ++ */ ++ public void onEntityWalking(World par1World, int par2, int par3, int par4, Entity par5Entity) {} ++ ++ /** ++ * Called when a block is placed using its ItemBlock. Args: World, X, Y, Z, side, hitX, hitY, hitZ, block metadata ++ */ ++ public int onBlockPlaced(World par1World, int par2, int par3, int par4, int par5, float par6, float par7, float par8, int par9) { ++ return par9; ++ } ++ ++ /** ++ * Called when the block is clicked by a player. Args: x, y, z, entityPlayer ++ */ ++ // Spout Start + public void onBlockClicked(World var1, int var2, int var3, int var4, EntityPlayer var5) { +- } +- +- public void velocityToAddToEntity(World var1, int var2, int var3, int var4, Entity var5, Vec3 var6) { +- } +- +- public void setBlockBoundsBasedOnState(IBlockAccess var1, int var2, int var3, int var4) { +- } +- +- public final double getMinX() { ++ if (var5 instanceof EntityPlayerSP) { ++ FixedLocation location = new FastLocation(var2, var3, var4, 0, 0); ++ ((EntityPlayerSP)var5).lastClickLocation = location; ++ } ++ } ++ // Spout End ++ ++ /** ++ * Can add to the passed in vector for a movement vector to be applied to the entity. Args: x, y, z, entity, vec3d ++ */ ++ public void velocityToAddToEntity(World par1World, int par2, int par3, int par4, Entity par5Entity, Vec3 par6Vec3) {} ++ ++ /** ++ * Updates the blocks bounds based on its current state. Args: world, x, y, z ++ */ ++ public void setBlockBoundsBasedOnState(IBlockAccess par1IBlockAccess, int par2, int par3, int par4) {} ++ ++ /** ++ * returns the block bounderies minX value ++ */ ++ public final double getBlockBoundsMinX() { + return this.minX; + } + ++ /** ++ * returns the block bounderies maxX value ++ */ + public final double getBlockBoundsMaxX() { + return this.maxX; + } + ++ /** ++ * returns the block bounderies minY value ++ */ + public final double getBlockBoundsMinY() { + return this.minY; + } + ++ /** ++ * returns the block bounderies maxY value ++ */ + public final double getBlockBoundsMaxY() { + return this.maxY; + } + ++ /** ++ * returns the block bounderies minZ value ++ */ + public final double getBlockBoundsMinZ() { + return this.minZ; + } + ++ /** ++ * returns the block bounderies maxZ value ++ */ + public final double getBlockBoundsMaxZ() { + return this.maxZ; + } +@@ -614,141 +994,241 @@ + return 16777215; + } + +- public int getRenderColor(int var1) { +- return 16777215; +- } +- +- public int colorMultiplier(IBlockAccess var1, int var2, int var3, int var4) { +- return 16777215; +- } +- +- public int isProvidingWeakPower(IBlockAccess var1, int var2, int var3, int var4, int var5) { ++ /** ++ * Returns the color this block should be rendered. Used by leaves. ++ */ ++ public int getRenderColor(int par1) { ++ // MCPatcher Start ++ return ColorizeBlock.colorizeBlock(this); ++ // MCPatcher End ++ } ++ ++ /** ++ * Returns a integer with hex for 0xrrggbb with this color multiplied against the blocks color. Note only called when ++ * first determining what to render. ++ */ ++ public int colorMultiplier(IBlockAccess par1IBlockAccess, int par2, int par3, int par4) { ++ // MCPatcher Start ++ return ColorizeBlock.colorizeBlock(this, par2, par3, par4, par1IBlockAccess.getBlockMetadata(par2, par3, par4)); ++ // MCPatcher End ++ } ++ ++ /** ++ * Returns true if the block is emitting indirect/weak redstone power on the specified side. If isBlockNormalCube ++ * returns true, standard redstone propagation rules will apply instead and this will not be called. Args: World, X, Y, ++ * Z, side. Note that the side is reversed - eg it is 1 (up) when checking the bottom of the block. ++ */ ++ public int isProvidingWeakPower(IBlockAccess par1IBlockAccess, int par2, int par3, int par4, int par5) { + return 0; + } + ++ /** ++ * Can this block provide power. Only wire currently seems to have this change based on its state. ++ */ + public boolean canProvidePower() { + return false; + } + +- public void onEntityCollidedWithBlock(World var1, int var2, int var3, int var4, Entity var5) { +- } ++ /** ++ * Triggered whenever an entity collides with this block (enters into the block). Args: world, x, y, z, entity ++ */ ++ public void onEntityCollidedWithBlock(World par1World, int par2, int par3, int par4, Entity par5Entity) {} + +- public int isProvidingStrongPower(IBlockAccess var1, int var2, int var3, int var4, int var5) { ++ /** ++ * Returns true if the block is emitting direct/strong redstone power on the specified side. Args: World, X, Y, Z, ++ * side. Note that the side is reversed - eg it is 1 (up) when checking the bottom of the block. ++ */ ++ public int isProvidingStrongPower(IBlockAccess par1IBlockAccess, int par2, int par3, int par4, int par5) { + return 0; + } + +- public void setBlockBoundsForItemRender() { +- } +- +- public void harvestBlock(World var1, EntityPlayer var2, int var3, int var4, int var5, int var6) { +- var2.addStat(StatList.mineBlockStatArray[this.blockID], 1); +- var2.addExhaustion(0.025F); +- if(this.canSilkHarvest() && EnchantmentHelper.getSilkTouchModifier(var2)) { +- ItemStack var8 = this.createStackedBlock(var6); +- if(var8 != null) { +- this.dropBlockAsItem_do(var1, var3, var4, var5, var8); ++ /** ++ * Sets the block's bounds for rendering it as an item ++ */ ++ public void setBlockBoundsForItemRender() {} ++ ++ /** ++ * Called when the player destroys a block with an item that can harvest it. (i, j, k) are the coordinates of the block ++ * and l is the block's subtype/damage. ++ */ ++ public void harvestBlock(World par1World, EntityPlayer par2EntityPlayer, int par3, int par4, int par5, int par6) { ++ par2EntityPlayer.addStat(StatList.mineBlockStatArray[this.blockID], 1); ++ par2EntityPlayer.addExhaustion(0.025F); ++ ++ if (this.canSilkHarvest() && EnchantmentHelper.getSilkTouchModifier(par2EntityPlayer)) { ++ ItemStack var8 = this.createStackedBlock(par6); ++ ++ if (var8 != null) { ++ this.dropBlockAsItem_do(par1World, par3, par4, par5, var8); + } + } else { +- int var7 = EnchantmentHelper.getFortuneModifier(var2); +- this.dropBlockAsItem(var1, var3, var4, var5, var6, var7); ++ int var7 = EnchantmentHelper.getFortuneModifier(par2EntityPlayer); ++ this.dropBlockAsItem(par1World, par3, par4, par5, par6, var7); + } +- + } + ++ /** ++ * Return true if a player with Silk Touch can harvest this block directly, and not its normal drops. ++ */ + protected boolean canSilkHarvest() { + return this.renderAsNormalBlock() && !this.isBlockContainer; + } + +- protected ItemStack createStackedBlock(int var1) { ++ /** ++ * Returns an item stack containing a single instance of the current block type. 'i' is the block's subtype/damage and ++ * is ignored for blocks which do not support subtypes. Blocks which cannot be harvested should return null. ++ */ ++ protected ItemStack createStackedBlock(int par1) { + int var2 = 0; +- if(this.blockID >= 0 && this.blockID < Item.itemsList.length && Item.itemsList[this.blockID].getHasSubtypes()) { +- var2 = var1; ++ ++ if (this.blockID >= 0 && this.blockID < Item.itemsList.length && Item.itemsList[this.blockID].getHasSubtypes()) { ++ var2 = par1; + } + + return new ItemStack(this.blockID, 1, var2); + } + +- public int quantityDroppedWithBonus(int var1, Random var2) { +- return this.quantityDropped(var2); ++ /** ++ * Returns the usual quantity dropped by the block plus a bonus of 1 to 'i' (inclusive). ++ */ ++ public int quantityDroppedWithBonus(int par1, Random par2Random) { ++ return this.quantityDropped(par2Random); + } + +- public boolean canBlockStay(World var1, int var2, int var3, int var4) { ++ /** ++ * Can this block stay at this position. Similar to canPlaceBlockAt except gets checked often with plants. ++ */ ++ public boolean canBlockStay(World par1World, int par2, int par3, int par4) { + return true; + } + +- public void onBlockPlacedBy(World var1, int var2, int var3, int var4, EntityLivingBase var5, ItemStack var6) { +- } +- +- public void onPostBlockPlaced(World var1, int var2, int var3, int var4, int var5) { +- } +- +- public Block setUnlocalizedName(String var1) { +- this.b = var1; ++ /** ++ * Called when the block is placed in the world. ++ */ ++ public void onBlockPlacedBy(World par1World, int par2, int par3, int par4, EntityLivingBase par5EntityLivingBase, ItemStack par6ItemStack) {} ++ ++ /** ++ * Called after a block is placed ++ */ ++ public void onPostBlockPlaced(World par1World, int par2, int par3, int par4, int par5) {} ++ ++ public Block setUnlocalizedName(String par1Str) { ++ this.unlocalizedName = par1Str; + return this; + } + ++ /** ++ * Gets the localized name of this block. Used for the statistics page. ++ */ + public String getLocalizedName() { + return StatCollector.translateToLocal(this.getUnlocalizedName() + ".name"); + } + ++ /** ++ * Returns the unlocalized name of this block. ++ */ + public String getUnlocalizedName() { +- return "tile." + this.b; ++ return "tile." + this.unlocalizedName; + } +- +- public boolean onBlockEventReceived(World var1, int var2, int var3, int var4, int var5, int var6) { ++ ++ /** ++ * Called when the block receives a BlockEvent - see World.addBlockEvent. By default, passes it on to the tile entity ++ * at this location. Args: world, x, y, z, blockID, EventID, event parameter ++ */ ++ public boolean onBlockEventReceived(World par1World, int par2, int par3, int par4, int par5, int par6) { + return false; + } + ++ /** ++ * Return the state of blocks statistics flags - if the block is counted for mined and placed. ++ */ + public boolean getEnableStats() { + return this.enableStats; + } + ++ /** ++ * Disable statistics for the block, the block will no count for mined or placed. ++ */ + protected Block disableStats() { + this.enableStats = false; + return this; + } + ++ /** ++ * Returns the mobility information of the block, 0 = free, 1 = can't push but can move over, 2 = total immobility and ++ * stop pistons ++ */ + public int getMobilityFlag() { + return this.blockMaterial.getMaterialMobility(); + } + +- public float getAmbientOcclusionLightValue(IBlockAccess var1, int var2, int var3, int var4) { +- return var1.isBlockNormalCube(var2, var3, var4) ? 0.2F : 1.0F; +- } +- +- public void onFallenUpon(World var1, int var2, int var3, int var4, Entity var5, float var6) { +- } +- +- public int idPicked(World var1, int var2, int var3, int var4) { ++ /** ++ * Returns the default ambient occlusion value based on block opacity ++ */ ++ public float getAmbientOcclusionLightValue(IBlockAccess par1IBlockAccess, int par2, int par3, int par4) { ++ return par1IBlockAccess.isBlockNormalCube(par2, par3, par4) ? 0.2F : 1.0F; ++ } ++ ++ /** ++ * Block's chance to react to an entity falling on it. ++ */ ++ public void onFallenUpon(World par1World, int par2, int par3, int par4, Entity par5Entity, float par6) {} ++ ++ /** ++ * only called by clickMiddleMouseButton , and passed to inventory.setCurrentItem (along with isCreative) ++ */ ++ public int idPicked(World par1World, int par2, int par3, int par4) { + return this.blockID; + } + +- public int getDamageValue(World var1, int var2, int var3, int var4) { +- return this.damageDropped(var1.getBlockMetadata(var2, var3, var4)); +- } +- +- public void getSubBlocks(int var1, CreativeTabs var2, List var3) { +- var3.add(new ItemStack(var1, 1, 0)); +- } +- ++ /** ++ * Get the block's damage value (for use with pick block). ++ */ ++ public int getDamageValue(World par1World, int par2, int par3, int par4) { ++ return this.damageDropped(par1World.getBlockMetadata(par2, par3, par4)); ++ } ++ ++ /** ++ * returns a list of blocks with the same ID, but different meta (eg: wood returns 4 blocks) ++ */ ++ public void getSubBlocks(int par1, CreativeTabs par2CreativeTabs, List par3List) { ++ par3List.add(new ItemStack(par1, 1, 0)); ++ } ++ ++ /** ++ * Returns the CreativeTab to display the given block on. ++ */ + public CreativeTabs getCreativeTabToDisplayOn() { + return this.displayOnCreativeTab; + } + +- public Block setCreativeTab(CreativeTabs var1) { +- this.displayOnCreativeTab = var1; ++ /** ++ * Sets the CreativeTab to display this block on. ++ */ ++ public Block setCreativeTab(CreativeTabs par1CreativeTabs) { ++ this.displayOnCreativeTab = par1CreativeTabs; + return this; + } + +- public void onBlockHarvested(World var1, int var2, int var3, int var4, int var5, EntityPlayer var6) { +- } +- +- public void onBlockPreDestroy(World var1, int var2, int var3, int var4, int var5) { +- } +- +- public void fillWithRain(World var1, int var2, int var3, int var4) { +- } +- ++ /** ++ * Called when the block is attempted to be harvested ++ */ ++ public void onBlockHarvested(World par1World, int par2, int par3, int par4, int par5, EntityPlayer par6EntityPlayer) {} ++ ++ /** ++ * Called on server worlds only when the block is about to be replaced by a different block or the same block with a ++ * different metadata value. Args: world, x, y, z, old metadata ++ */ ++ public void onBlockPreDestroy(World par1World, int par2, int par3, int par4, int par5) {} ++ ++ /** ++ * currently only used by BlockCauldron to incrament meta-data during rain ++ */ ++ public void fillWithRain(World par1World, int par2, int par3, int par4) {} ++ ++ /** ++ * Returns true only if block is flowerPot ++ */ + public boolean isFlowerPot() { + return false; + } +@@ -757,39 +1237,64 @@ + return true; + } + +- public boolean canDropFromExplosion(Explosion var1) { ++ /** ++ * Return whether this block can drop from an explosion. ++ */ ++ public boolean canDropFromExplosion(Explosion par1Explosion) { + return true; + } + +- public boolean isAssociatedBlockID(int var1) { +- return this.blockID == var1; +- } +- +- public static boolean isAssociatedBlockID(int var0, int var1) { +- return var0 == var1 ? true : (var0 != 0 && var1 != 0 && blocksList[var0] != null && blocksList[var1] != null ? blocksList[var0].isAssociatedBlockID(var1) : false); +- } +- ++ /** ++ * Returns true if the given block ID is equivalent to this one. Example: redstoneTorchOn matches itself and ++ * redstoneTorchOff, and vice versa. Most blocks only match themselves. ++ */ ++ public boolean isAssociatedBlockID(int par1) { ++ return this.blockID == par1; ++ } ++ ++ /** ++ * Static version of isAssociatedBlockID. ++ */ ++ public static boolean isAssociatedBlockID(int par0, int par1) { ++ return par0 == par1 ? true : (par0 != 0 && par1 != 0 && blocksList[par0] != null && blocksList[par1] != null ? blocksList[par0].isAssociatedBlockID(par1) : false); ++ } ++ ++ /** ++ * If this returns true, then comparators facing away from this block will use the value from ++ * getComparatorInputOverride instead of the actual redstone signal strength. ++ */ + public boolean hasComparatorInputOverride() { + return false; +- } ++ } + +- public int getComparatorInputOverride(World var1, int var2, int var3, int var4, int var5) { ++ /** ++ * If hasComparatorInputOverride returns true, the return value from this is used instead of the redstone signal ++ * strength when this block inputs to a comparator. ++ */ ++ public int getComparatorInputOverride(World par1World, int par2, int par3, int par4, int par5) { + return 0; +- } ++ } + +- protected Block setTextureName(String var1) { +- this.f = var1; ++ protected Block setTextureName(String par1Str) { ++ this.textureName = par1Str; + return this; + } + + protected String getTextureName() { +- return this.f == null ? "MISSING_ICON_TILE_" + this.blockID + "_" + this.b : this.f; +- } +- +- public void registerIcons(IconRegister var1) { +- this.blockIcon = var1.registerIcon(this.getTextureName()); +- } +- ++ return this.textureName == null ? "MISSING_ICON_TILE_" + this.blockID + "_" + this.unlocalizedName : this.textureName; ++ } ++ ++ /** ++ * When this method is called, your block should register all the icons it needs with the given IconRegister. This is ++ * the only chance you get to register icons. ++ */ ++ public void registerIcons(IconRegister par1IconRegister) { ++ this.blockIcon = par1IconRegister.registerIcon(this.getTextureName()); ++ } ++ ++ /** ++ * Gets the icon name of the ItemBlock corresponding to this block. Used by hoppers. ++ */ + public String getItemIconName() { + return null; + } +@@ -798,52 +1303,53 @@ + Item.itemsList[cloth.blockID] = (new ItemCloth(cloth.blockID - 256)).setUnlocalizedName("cloth"); + Item.itemsList[stainedClay.blockID] = (new ItemCloth(stainedClay.blockID - 256)).setUnlocalizedName("clayHardenedStained"); + Item.itemsList[carpet.blockID] = (new ItemCloth(carpet.blockID - 256)).setUnlocalizedName("woolCarpet"); +- Item.itemsList[wood.blockID] = (new ItemMultiTextureTile(wood.blockID - 256, wood, BlockLog.b)).setUnlocalizedName("log"); +- Item.itemsList[planks.blockID] = (new ItemMultiTextureTile(planks.blockID - 256, planks, BlockWood.a)).setUnlocalizedName("wood"); +- Item.itemsList[silverfish.blockID] = (new ItemMultiTextureTile(silverfish.blockID - 256, silverfish, BlockSilverfish.a)).setUnlocalizedName("monsterStoneEgg"); +- Item.itemsList[stoneBrick.blockID] = (new ItemMultiTextureTile(stoneBrick.blockID - 256, stoneBrick, BlockStoneBrick.a)).setUnlocalizedName("stonebricksmooth"); +- Item.itemsList[sandStone.blockID] = (new ItemMultiTextureTile(sandStone.blockID - 256, sandStone, BlockSandStone.a)).setUnlocalizedName("sandStone"); +- Item.itemsList[blockNetherQuartz.blockID] = (new ItemMultiTextureTile(blockNetherQuartz.blockID - 256, blockNetherQuartz, BlockQuartz.a)).setUnlocalizedName("quartzBlock"); ++ Item.itemsList[wood.blockID] = (new ItemMultiTextureTile(wood.blockID - 256, wood, BlockLog.woodType)).setUnlocalizedName("log"); ++ Item.itemsList[planks.blockID] = (new ItemMultiTextureTile(planks.blockID - 256, planks, BlockWood.woodType)).setUnlocalizedName("wood"); ++ Item.itemsList[silverfish.blockID] = (new ItemMultiTextureTile(silverfish.blockID - 256, silverfish, BlockSilverfish.silverfishStoneTypes)).setUnlocalizedName("monsterStoneEgg"); ++ Item.itemsList[stoneBrick.blockID] = (new ItemMultiTextureTile(stoneBrick.blockID - 256, stoneBrick, BlockStoneBrick.STONE_BRICK_TYPES)).setUnlocalizedName("stonebricksmooth"); ++ Item.itemsList[sandStone.blockID] = (new ItemMultiTextureTile(sandStone.blockID - 256, sandStone, BlockSandStone.SAND_STONE_TYPES)).setUnlocalizedName("sandStone"); ++ Item.itemsList[blockNetherQuartz.blockID] = (new ItemMultiTextureTile(blockNetherQuartz.blockID - 256, blockNetherQuartz, BlockQuartz.quartzBlockTypes)).setUnlocalizedName("quartzBlock"); + Item.itemsList[stoneSingleSlab.blockID] = (new ItemSlab(stoneSingleSlab.blockID - 256, stoneSingleSlab, stoneDoubleSlab, false)).setUnlocalizedName("stoneSlab"); + Item.itemsList[stoneDoubleSlab.blockID] = (new ItemSlab(stoneDoubleSlab.blockID - 256, stoneSingleSlab, stoneDoubleSlab, true)).setUnlocalizedName("stoneSlab"); + Item.itemsList[woodSingleSlab.blockID] = (new ItemSlab(woodSingleSlab.blockID - 256, woodSingleSlab, woodDoubleSlab, false)).setUnlocalizedName("woodSlab"); + Item.itemsList[woodDoubleSlab.blockID] = (new ItemSlab(woodDoubleSlab.blockID - 256, woodSingleSlab, woodDoubleSlab, true)).setUnlocalizedName("woodSlab"); +- Item.itemsList[sapling.blockID] = (new ItemMultiTextureTile(sapling.blockID - 256, sapling, BlockSapling.a)).setUnlocalizedName("sapling"); ++ Item.itemsList[sapling.blockID] = (new ItemMultiTextureTile(sapling.blockID - 256, sapling, BlockSapling.WOOD_TYPES)).setUnlocalizedName("sapling"); + Item.itemsList[leaves.blockID] = (new ItemLeaves(leaves.blockID - 256)).setUnlocalizedName("leaves"); + Item.itemsList[vine.blockID] = new ItemColored(vine.blockID - 256, false); +- Item.itemsList[tallGrass.blockID] = (new ItemColored(tallGrass.blockID - 256, true)).setBlockNames(new String[]{"shrub", "grass", "fern"}); ++ Item.itemsList[tallGrass.blockID] = (new ItemColored(tallGrass.blockID - 256, true)).setBlockNames(new String[] {"shrub", "grass", "fern"}); + Item.itemsList[snow.blockID] = new ItemSnow(snow.blockID - 256, snow); + Item.itemsList[waterlily.blockID] = new ItemLilyPad(waterlily.blockID - 256); + Item.itemsList[pistonBase.blockID] = new ItemPiston(pistonBase.blockID - 256); + Item.itemsList[pistonStickyBase.blockID] = new ItemPiston(pistonStickyBase.blockID - 256); +- Item.itemsList[cobblestoneWall.blockID] = (new ItemMultiTextureTile(cobblestoneWall.blockID - 256, cobblestoneWall, BlockWall.a)).setUnlocalizedName("cobbleWall"); ++ Item.itemsList[cobblestoneWall.blockID] = (new ItemMultiTextureTile(cobblestoneWall.blockID - 256, cobblestoneWall, BlockWall.types)).setUnlocalizedName("cobbleWall"); + Item.itemsList[anvil.blockID] = (new ItemAnvilBlock(anvil)).setUnlocalizedName("anvil"); + +- for(int var0 = 0; var0 < 256; ++var0) { +- if(blocksList[var0] != null) { +- if(Item.itemsList[var0] == null) { ++ for (int var0 = 0; var0 < 256; ++var0) { ++ if (blocksList[var0] != null) { ++ if (Item.itemsList[var0] == null) { + Item.itemsList[var0] = new ItemBlock(var0 - 256); + blocksList[var0].initializeBlock(); + } + + boolean var1 = false; +- if(var0 > 0 && blocksList[var0].getRenderType() == 10) { +- var1 = true; +- } +- +- if(var0 > 0 && blocksList[var0] instanceof BlockHalfSlab) { +- var1 = true; +- } +- +- if(var0 == tilledField.blockID) { +- var1 = true; +- } +- +- if(canBlockGrass[var0]) { +- var1 = true; +- } +- +- if(lightOpacity[var0] == 0) { ++ ++ if (var0 > 0 && blocksList[var0].getRenderType() == 10) { ++ var1 = true; ++ } ++ ++ if (var0 > 0 && blocksList[var0] instanceof BlockHalfSlab) { ++ var1 = true; ++ } ++ ++ if (var0 == tilledField.blockID) { ++ var1 = true; ++ } ++ ++ if (canBlockGrass[var0]) { ++ var1 = true; ++ } ++ ++ if (lightOpacity[var0] == 0) { + var1 = true; + } + diff --git a/patches/net/minecraft/src/BlockAnvil.java.patch b/patches/net/minecraft/src/BlockAnvil.java.patch new file mode 100644 index 0000000..6e0bf5a --- /dev/null +++ b/patches/net/minecraft/src/BlockAnvil.java.patch @@ -0,0 +1,215 @@ +--- net/minecraft/src/BlockAnvil.java ++++ net/minecraft/src/BlockAnvil.java +@@ -3,109 +3,152 @@ + import java.util.List; + + public class BlockAnvil extends BlockSand { +- public static final String[] a = new String[]{"intact", "slightlyDamaged", "veryDamaged"}; +- private static final String[] d = new String[]{"anvil_top_damaged_0", "anvil_top_damaged_1", "anvil_top_damaged_2"}; ++ ++ /** List of types/statues the Anvil can be in. */ ++ public static final String[] statuses = new String[] {"intact", "slightlyDamaged", "veryDamaged"}; ++ private static final String[] anvilIconNames = new String[] {"anvil_top_damaged_0", "anvil_top_damaged_1", "anvil_top_damaged_2"}; + public int field_82521_b; + private Icon[] iconArray; + +- protected BlockAnvil(int var1) { +- super(var1, Material.anvil); ++ protected BlockAnvil(int par1) { ++ super(par1, Material.anvil); + this.setLightOpacity(0); + this.setCreativeTab(CreativeTabs.tabDecorations); + } + ++ /** ++ * If this block doesn't render as an ordinary block it will return False (examples: signs, buttons, stairs, etc) ++ */ + public boolean renderAsNormalBlock() { + return false; + } + ++ /** ++ * Is this block (a) opaque and (b) a full 1m cube? This determines whether or not to render the shared face of two ++ * adjacent blocks and also whether the player can attach torches, redstone wire, etc to this block. ++ */ + public boolean isOpaqueCube() { + return false; + } + +- public Icon getIcon(int var1, int var2) { +- if(this.field_82521_b == 3 && var1 == 1) { +- int var3 = (var2 >> 2) % this.iconArray.length; ++ /** ++ * From the specified side and block metadata retrieves the blocks texture. Args: side, metadata ++ */ ++ public Icon getIcon(int par1, int par2) { ++ if (this.field_82521_b == 3 && par1 == 1) { ++ int var3 = (par2 >> 2) % this.iconArray.length; + return this.iconArray[var3]; + } else { + return this.blockIcon; + } + } + +- public void registerIcons(IconRegister var1) { +- this.blockIcon = var1.registerIcon("anvil_base"); +- this.iconArray = new Icon[d.length]; ++ /** ++ * When this method is called, your block should register all the icons it needs with the given IconRegister. This is ++ * the only chance you get to register icons. ++ */ ++ public void registerIcons(IconRegister par1IconRegister) { ++ this.blockIcon = par1IconRegister.registerIcon("anvil_base"); ++ this.iconArray = new Icon[anvilIconNames.length]; + +- for(int var2 = 0; var2 < this.iconArray.length; ++var2) { +- this.iconArray[var2] = var1.registerIcon(d[var2]); ++ for (int var2 = 0; var2 < this.iconArray.length; ++var2) { ++ this.iconArray[var2] = par1IconRegister.registerIcon(anvilIconNames[var2]); + } +- + } + +- public void onBlockPlacedBy(World var1, int var2, int var3, int var4, EntityLivingBase var5, ItemStack var6) { +- int var7 = MathHelper.floor_double((double)(var5.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3; +- int var8 = var1.getBlockMetadata(var2, var3, var4) >> 2; ++ /** ++ * Called when the block is placed in the world. ++ */ ++ public void onBlockPlacedBy(World par1World, int par2, int par3, int par4, EntityLivingBase par5EntityLivingBase, ItemStack par6ItemStack) { ++ int var7 = MathHelper.floor_double((double)(par5EntityLivingBase.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3; ++ int var8 = par1World.getBlockMetadata(par2, par3, par4) >> 2; + ++var7; + var7 %= 4; +- if(var7 == 0) { +- var1.setBlockMetadata(var2, var3, var4, 2 | var8 << 2, 2); +- } +- +- if(var7 == 1) { +- var1.setBlockMetadata(var2, var3, var4, 3 | var8 << 2, 2); +- } +- +- if(var7 == 2) { +- var1.setBlockMetadata(var2, var3, var4, 0 | var8 << 2, 2); +- } +- +- if(var7 == 3) { +- var1.setBlockMetadata(var2, var3, var4, 1 | var8 << 2, 2); +- } +- ++ ++ if (var7 == 0) { ++ par1World.setBlockMetadataWithNotify(par2, par3, par4, 2 | var8 << 2, 2); ++ } ++ ++ if (var7 == 1) { ++ par1World.setBlockMetadataWithNotify(par2, par3, par4, 3 | var8 << 2, 2); ++ } ++ ++ if (var7 == 2) { ++ par1World.setBlockMetadataWithNotify(par2, par3, par4, 0 | var8 << 2, 2); ++ } ++ ++ if (var7 == 3) { ++ par1World.setBlockMetadataWithNotify(par2, par3, par4, 1 | var8 << 2, 2); ++ } + } + +- public boolean onBlockActivated(World var1, int var2, int var3, int var4, EntityPlayer var5, int var6, float var7, float var8, float var9) { +- if(var1.isRemote) { ++ /** ++ * Called upon block activation (right click on the block.) ++ */ ++ public boolean onBlockActivated(World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer, int par6, float par7, float par8, float par9) { ++ if (par1World.isRemote) { + return true; + } else { +- var5.displayGUIAnvil(var2, var3, var4); ++ par5EntityPlayer.displayGUIAnvil(par2, par3, par4); + return true; + } + } + ++ /** ++ * The type of render function that is called for this block ++ */ + public int getRenderType() { + return 35; + } + +- public int damageDropped(int var1) { +- return var1 >> 2; ++ /** ++ * Determines the damage on the item the block drops. Used in cloth and wood. ++ */ ++ public int damageDropped(int par1) { ++ return par1 >> 2; + } + +- public void setBlockBoundsBasedOnState(IBlockAccess var1, int var2, int var3, int var4) { +- int var5 = var1.getBlockMetadata(var2, var3, var4) & 3; +- if(var5 != 3 && var5 != 1) { +- this.setBlockBounds(2.0F / 16.0F, 0.0F, 0.0F, 14.0F / 16.0F, 1.0F, 1.0F); ++ /** ++ * Updates the blocks bounds based on its current state. Args: world, x, y, z ++ */ ++ public void setBlockBoundsBasedOnState(IBlockAccess par1IBlockAccess, int par2, int par3, int par4) { ++ int var5 = par1IBlockAccess.getBlockMetadata(par2, par3, par4) & 3; ++ ++ if (var5 != 3 && var5 != 1) { ++ this.setBlockBounds(0.125F, 0.0F, 0.0F, 0.875F, 1.0F, 1.0F); + } else { +- this.setBlockBounds(0.0F, 0.0F, 2.0F / 16.0F, 1.0F, 1.0F, 14.0F / 16.0F); ++ this.setBlockBounds(0.0F, 0.0F, 0.125F, 1.0F, 1.0F, 0.875F); + } +- +- } +- +- public void getSubBlocks(int var1, CreativeTabs var2, List var3) { +- var3.add(new ItemStack(var1, 1, 0)); +- var3.add(new ItemStack(var1, 1, 1)); +- var3.add(new ItemStack(var1, 1, 2)); +- } +- +- protected void onStartFalling(EntityFallingSand var1) { +- var1.setIsAnvil(true); +- } +- +- public void onFinishFalling(World var1, int var2, int var3, int var4, int var5) { +- var1.playAuxSFX(1022, var2, var3, var4, 0); +- } +- +- public boolean shouldSideBeRendered(IBlockAccess var1, int var2, int var3, int var4, int var5) { ++ } ++ ++ /** ++ * returns a list of blocks with the same ID, but different meta (eg: wood returns 4 blocks) ++ */ ++ public void getSubBlocks(int par1, CreativeTabs par2CreativeTabs, List par3List) { ++ par3List.add(new ItemStack(par1, 1, 0)); ++ par3List.add(new ItemStack(par1, 1, 1)); ++ par3List.add(new ItemStack(par1, 1, 2)); ++ } ++ ++ /** ++ * Called when the falling block entity for this block is created ++ */ ++ protected void onStartFalling(EntityFallingSand par1EntityFallingSand) { ++ par1EntityFallingSand.setIsAnvil(true); ++ } ++ ++ /** ++ * Called when the falling block entity for this block hits the ground and turns back into a block ++ */ ++ public void onFinishFalling(World par1World, int par2, int par3, int par4, int par5) { ++ par1World.playAuxSFX(1022, par2, par3, par4, 0); ++ } ++ ++ /** ++ * Returns true if the given side of this block type should be rendered, if the adjacent block is at the given ++ * coordinates. Args: blockAccess, x, y, z, side ++ */ ++ public boolean shouldSideBeRendered(IBlockAccess par1IBlockAccess, int par2, int par3, int par4, int par5) { + return true; + } + } diff --git a/patches/net/minecraft/src/BlockBasePressurePlate.java.patch b/patches/net/minecraft/src/BlockBasePressurePlate.java.patch new file mode 100644 index 0000000..bfbfedd --- /dev/null +++ b/patches/net/minecraft/src/BlockBasePressurePlate.java.patch @@ -0,0 +1,327 @@ +--- net/minecraft/src/BlockBasePressurePlate.java ++++ net/minecraft/src/BlockBasePressurePlate.java +@@ -3,158 +3,228 @@ + import java.util.Random; + + public abstract class BlockBasePressurePlate extends Block { +- private String a; ++ private String pressurePlateIconName; + +- protected BlockBasePressurePlate(int var1, String var2, Material var3) { +- super(var1, var3); +- this.a = var2; ++ protected BlockBasePressurePlate(int par1, String par2Str, Material par3Material) { ++ super(par1, par3Material); ++ this.pressurePlateIconName = par2Str; + this.setCreativeTab(CreativeTabs.tabRedstone); + this.setTickRandomly(true); + this.func_94353_c_(this.getMetaFromWeight(15)); + } + +- public void setBlockBoundsBasedOnState(IBlockAccess var1, int var2, int var3, int var4) { +- this.func_94353_c_(var1.getBlockMetadata(var2, var3, var4)); ++ /** ++ * Updates the blocks bounds based on its current state. Args: world, x, y, z ++ */ ++ public void setBlockBoundsBasedOnState(IBlockAccess par1IBlockAccess, int par2, int par3, int par4) { ++ this.func_94353_c_(par1IBlockAccess.getBlockMetadata(par2, par3, par4)); + } + +- protected void func_94353_c_(int var1) { +- boolean var2 = this.getPowerSupply(var1) > 0; +- float var3 = 1.0F / 16.0F; +- if(var2) { ++ protected void func_94353_c_(int par1) { ++ boolean var2 = this.getPowerSupply(par1) > 0; ++ float var3 = 0.0625F; ++ ++ if (var2) { + this.setBlockBounds(var3, 0.0F, var3, 1.0F - var3, 0.03125F, 1.0F - var3); + } else { +- this.setBlockBounds(var3, 0.0F, var3, 1.0F - var3, 1.0F / 16.0F, 1.0F - var3); ++ this.setBlockBounds(var3, 0.0F, var3, 1.0F - var3, 0.0625F, 1.0F - var3); + } +- + } + +- public int tickRate(World var1) { ++ /** ++ * How many world ticks before ticking ++ */ ++ public int tickRate(World par1World) { + return 20; + } + +- public AxisAlignedBB getCollisionBoundingBoxFromPool(World var1, int var2, int var3, int var4) { ++ /** ++ * Returns a bounding box from the pool of bounding boxes (this means this box can change after the pool has been ++ * cleared to be reused) ++ */ ++ public AxisAlignedBB getCollisionBoundingBoxFromPool(World par1World, int par2, int par3, int par4) { + return null; + } + ++ /** ++ * Is this block (a) opaque and (b) a full 1m cube? This determines whether or not to render the shared face of two ++ * adjacent blocks and also whether the player can attach torches, redstone wire, etc to this block. ++ */ + public boolean isOpaqueCube() { + return false; + } + ++ /** ++ * If this block doesn't render as an ordinary block it will return False (examples: signs, buttons, stairs, etc) ++ */ + public boolean renderAsNormalBlock() { + return false; + } + +- public boolean getBlocksMovement(IBlockAccess var1, int var2, int var3, int var4) { ++ public boolean getBlocksMovement(IBlockAccess par1IBlockAccess, int par2, int par3, int par4) { + return true; + } + +- public boolean canPlaceBlockAt(World var1, int var2, int var3, int var4) { +- return var1.doesBlockHaveSolidTopSurface(var2, var3 - 1, var4) || BlockFence.isIdAFence(var1.getBlockId(var2, var3 - 1, var4)); ++ /** ++ * Checks to see if its valid to put this block at the specified coordinates. Args: world, x, y, z ++ */ ++ public boolean canPlaceBlockAt(World par1World, int par2, int par3, int par4) { ++ return par1World.doesBlockHaveSolidTopSurface(par2, par3 - 1, par4) || BlockFence.isIdAFence(par1World.getBlockId(par2, par3 - 1, par4)); + } + +- public void onNeighborBlockChange(World var1, int var2, int var3, int var4, int var5) { ++ /** ++ * Lets the block know when one of its neighbor changes. Doesn't know which neighbor changed (coordinates passed are ++ * their own) Args: x, y, z, neighbor blockID ++ */ ++ public void onNeighborBlockChange(World par1World, int par2, int par3, int par4, int par5) { + boolean var6 = false; +- if(!var1.doesBlockHaveSolidTopSurface(var2, var3 - 1, var4) && !BlockFence.isIdAFence(var1.getBlockId(var2, var3 - 1, var4))) { ++ ++ if (!par1World.doesBlockHaveSolidTopSurface(par2, par3 - 1, par4) && !BlockFence.isIdAFence(par1World.getBlockId(par2, par3 - 1, par4))) { + var6 = true; + } + +- if(var6) { +- this.dropBlockAsItem(var1, var2, var3, var4, var1.getBlockMetadata(var2, var3, var4), 0); +- var1.setBlockToAir(var2, var3, var4); +- } +- +- } +- +- public void updateTick(World var1, int var2, int var3, int var4, Random var5) { +- if(!var1.isRemote) { +- int var6 = this.getPowerSupply(var1.getBlockMetadata(var2, var3, var4)); +- if(var6 > 0) { +- this.setStateIfMobInteractsWithPlate(var1, var2, var3, var4, var6); +- } +- +- } +- } +- +- public void onEntityCollidedWithBlock(World var1, int var2, int var3, int var4, Entity var5) { +- if(!var1.isRemote) { +- int var6 = this.getPowerSupply(var1.getBlockMetadata(var2, var3, var4)); +- if(var6 == 0) { +- this.setStateIfMobInteractsWithPlate(var1, var2, var3, var4, var6); +- } +- +- } +- } +- +- protected void setStateIfMobInteractsWithPlate(World var1, int var2, int var3, int var4, int var5) { +- int var6 = this.getPlateState(var1, var2, var3, var4); +- boolean var7 = var5 > 0; ++ if (var6) { ++ this.dropBlockAsItem(par1World, par2, par3, par4, par1World.getBlockMetadata(par2, par3, par4), 0); ++ par1World.setBlockToAir(par2, par3, par4); ++ } ++ } ++ ++ /** ++ * Ticks the block if it's been scheduled ++ */ ++ public void updateTick(World par1World, int par2, int par3, int par4, Random par5Random) { ++ if (!par1World.isRemote) { ++ int var6 = this.getPowerSupply(par1World.getBlockMetadata(par2, par3, par4)); ++ ++ if (var6 > 0) { ++ this.setStateIfMobInteractsWithPlate(par1World, par2, par3, par4, var6); ++ } ++ } ++ } ++ ++ /** ++ * Triggered whenever an entity collides with this block (enters into the block). Args: world, x, y, z, entity ++ */ ++ public void onEntityCollidedWithBlock(World par1World, int par2, int par3, int par4, Entity par5Entity) { ++ if (!par1World.isRemote) { ++ int var6 = this.getPowerSupply(par1World.getBlockMetadata(par2, par3, par4)); ++ ++ if (var6 == 0) { ++ this.setStateIfMobInteractsWithPlate(par1World, par2, par3, par4, var6); ++ } ++ } ++ } ++ ++ /** ++ * Checks if there are mobs on the plate. If a mob is on the plate and it is off, it turns it on, and vice versa. ++ */ ++ protected void setStateIfMobInteractsWithPlate(World par1World, int par2, int par3, int par4, int par5) { ++ int var6 = this.getPlateState(par1World, par2, par3, par4); ++ boolean var7 = par5 > 0; + boolean var8 = var6 > 0; +- if(var5 != var6) { +- var1.setBlockMetadata(var2, var3, var4, this.getMetaFromWeight(var6), 2); +- this.func_94354_b_(var1, var2, var3, var4); +- var1.markBlockRangeForRenderUpdate(var2, var3, var4, var2, var3, var4); +- } +- +- if(!var8 && var7) { +- var1.playSoundEffect((double)var2 + 0.5D, (double)var3 + 0.1D, (double)var4 + 0.5D, "random.click", 0.3F, 0.5F); +- } else if(var8 && !var7) { +- var1.playSoundEffect((double)var2 + 0.5D, (double)var3 + 0.1D, (double)var4 + 0.5D, "random.click", 0.3F, 0.6F); +- } +- +- if(var8) { +- var1.scheduleBlockUpdate(var2, var3, var4, this.blockID, this.tickRate(var1)); +- } +- +- } +- +- protected AxisAlignedBB getSensitiveAABB(int var1, int var2, int var3) { +- float var4 = 2.0F / 16.0F; +- return AxisAlignedBB.getAABBPool().getAABB((double)((float)var1 + var4), (double)var2, (double)((float)var3 + var4), (double)((float)(var1 + 1) - var4), (double)var2 + 0.25D, (double)((float)(var3 + 1) - var4)); +- } +- +- public void breakBlock(World var1, int var2, int var3, int var4, int var5, int var6) { +- if(this.getPowerSupply(var6) > 0) { +- this.func_94354_b_(var1, var2, var3, var4); +- } +- +- super.breakBlock(var1, var2, var3, var4, var5, var6); +- } +- +- protected void func_94354_b_(World var1, int var2, int var3, int var4) { +- var1.notifyBlocksOfNeighborChange(var2, var3, var4, this.blockID); +- var1.notifyBlocksOfNeighborChange(var2, var3 - 1, var4, this.blockID); +- } +- +- public int isProvidingWeakPower(IBlockAccess var1, int var2, int var3, int var4, int var5) { +- return this.getPowerSupply(var1.getBlockMetadata(var2, var3, var4)); +- } +- +- public int isProvidingStrongPower(IBlockAccess var1, int var2, int var3, int var4, int var5) { +- return var5 == 1 ? this.getPowerSupply(var1.getBlockMetadata(var2, var3, var4)) : 0; +- } +- ++ ++ if (par5 != var6) { ++ par1World.setBlockMetadataWithNotify(par2, par3, par4, this.getMetaFromWeight(var6), 2); ++ this.func_94354_b_(par1World, par2, par3, par4); ++ par1World.markBlockRangeForRenderUpdate(par2, par3, par4, par2, par3, par4); ++ } ++ ++ if (!var8 && var7) { ++ par1World.playSoundEffect((double)par2 + 0.5D, (double)par3 + 0.1D, (double)par4 + 0.5D, "random.click", 0.3F, 0.5F); ++ } else if (var8 && !var7) { ++ par1World.playSoundEffect((double)par2 + 0.5D, (double)par3 + 0.1D, (double)par4 + 0.5D, "random.click", 0.3F, 0.6F); ++ } ++ ++ if (var8) { ++ par1World.scheduleBlockUpdate(par2, par3, par4, this.blockID, this.tickRate(par1World)); ++ } ++ } ++ ++ protected AxisAlignedBB getSensitiveAABB(int par1, int par2, int par3) { ++ float var4 = 0.125F; ++ return AxisAlignedBB.getAABBPool().getAABB((double)((float)par1 + var4), (double)par2, (double)((float)par3 + var4), (double)((float)(par1 + 1) - var4), (double)par2 + 0.25D, (double)((float)(par3 + 1) - var4)); ++ } ++ ++ /** ++ * Called on server worlds only when the block has been replaced by a different block ID, or the same block with a ++ * different metadata value, but before the new metadata value is set. Args: World, x, y, z, old block ID, old metadata ++ */ ++ public void breakBlock(World par1World, int par2, int par3, int par4, int par5, int par6) { ++ if (this.getPowerSupply(par6) > 0) { ++ this.func_94354_b_(par1World, par2, par3, par4); ++ } ++ ++ super.breakBlock(par1World, par2, par3, par4, par5, par6); ++ } ++ ++ protected void func_94354_b_(World par1World, int par2, int par3, int par4) { ++ par1World.notifyBlocksOfNeighborChange(par2, par3, par4, this.blockID); ++ par1World.notifyBlocksOfNeighborChange(par2, par3 - 1, par4, this.blockID); ++ } ++ ++ /** ++ * Returns true if the block is emitting indirect/weak redstone power on the specified side. If isBlockNormalCube ++ * returns true, standard redstone propagation rules will apply instead and this will not be called. Args: World, X, Y, ++ * Z, side. Note that the side is reversed - eg it is 1 (up) when checking the bottom of the block. ++ */ ++ public int isProvidingWeakPower(IBlockAccess par1IBlockAccess, int par2, int par3, int par4, int par5) { ++ return this.getPowerSupply(par1IBlockAccess.getBlockMetadata(par2, par3, par4)); ++ } ++ ++ /** ++ * Returns true if the block is emitting direct/strong redstone power on the specified side. Args: World, X, Y, Z, ++ * side. Note that the side is reversed - eg it is 1 (up) when checking the bottom of the block. ++ */ ++ public int isProvidingStrongPower(IBlockAccess par1IBlockAccess, int par2, int par3, int par4, int par5) { ++ return par5 == 1 ? this.getPowerSupply(par1IBlockAccess.getBlockMetadata(par2, par3, par4)) : 0; ++ } ++ ++ /** ++ * Can this block provide power. Only wire currently seems to have this change based on its state. ++ */ + public boolean canProvidePower() { + return true; + } + ++ /** ++ * Sets the block's bounds for rendering it as an item ++ */ + public void setBlockBoundsForItemRender() { + float var1 = 0.5F; +- float var2 = 2.0F / 16.0F; ++ float var2 = 0.125F; + float var3 = 0.5F; + this.setBlockBounds(0.5F - var1, 0.5F - var2, 0.5F - var3, 0.5F + var1, 0.5F + var2, 0.5F + var3); + } + ++ /** ++ * Returns the mobility information of the block, 0 = free, 1 = can't push but can move over, 2 = total immobility and ++ * stop pistons ++ */ + public int getMobilityFlag() { + return 1; + } + ++ /** ++ * Returns the current state of the pressure plate. Returns a value between 0 and 15 based on the number of items on ++ * it. ++ */ + protected abstract int getPlateState(World var1, int var2, int var3, int var4); + ++ /** ++ * Argument is metadata. Returns power level (0-15) ++ */ + protected abstract int getPowerSupply(int var1); + ++ /** ++ * Argument is weight (0-15). Return the metadata to be set because of it. ++ */ + protected abstract int getMetaFromWeight(int var1); + +- public void registerIcons(IconRegister var1) { +- this.blockIcon = var1.registerIcon(this.a); ++ /** ++ * When this method is called, your block should register all the icons it needs with the given IconRegister. This is ++ * the only chance you get to register icons. ++ */ ++ public void registerIcons(IconRegister par1IconRegister) { ++ this.blockIcon = par1IconRegister.registerIcon(this.pressurePlateIconName); + } + } diff --git a/patches/net/minecraft/src/BlockBaseRailLogic.java.patch b/patches/net/minecraft/src/BlockBaseRailLogic.java.patch new file mode 100644 index 0000000..a8a7950 --- /dev/null +++ b/patches/net/minecraft/src/BlockBaseRailLogic.java.patch @@ -0,0 +1,483 @@ +--- net/minecraft/src/BlockBaseRailLogic.java ++++ net/minecraft/src/BlockBaseRailLogic.java +@@ -9,19 +9,23 @@ + private int railY; + private int railZ; + private final boolean isStraightRail; +- private List g; ++ ++ /** The chunk position the rail is at. */ ++ private List railChunkPosition; ++ + final BlockRailBase theRail; + +- public BlockBaseRailLogic(BlockRailBase var1, World var2, int var3, int var4, int var5) { +- this.theRail = var1; +- this.g = new ArrayList(); +- this.logicWorld = var2; +- this.railX = var3; +- this.railY = var4; +- this.railZ = var5; +- int var6 = var2.getBlockId(var3, var4, var5); +- int var7 = var2.getBlockMetadata(var3, var4, var5); +- if(((BlockRailBase)Block.blocksList[var6]).isPowered) { ++ public BlockBaseRailLogic(BlockRailBase par1BlockRailBase, World par2World, int par3, int par4, int par5) { ++ this.theRail = par1BlockRailBase; ++ this.railChunkPosition = new ArrayList(); ++ this.logicWorld = par2World; ++ this.railX = par3; ++ this.railY = par4; ++ this.railZ = par5; ++ int var6 = par2World.getBlockId(par3, par4, par5); ++ int var7 = par2World.getBlockMetadata(par3, par4, par5); ++ ++ if (((BlockRailBase)Block.blocksList[var6]).isPowered) { + this.isStraightRail = true; + var7 &= -9; + } else { +@@ -31,66 +35,70 @@ + this.setBasicRail(var7); + } + +- private void setBasicRail(int var1) { +- this.g.clear(); +- if(var1 == 0) { +- this.g.add(new ChunkPosition(this.railX, this.railY, this.railZ - 1)); +- this.g.add(new ChunkPosition(this.railX, this.railY, this.railZ + 1)); +- } else if(var1 == 1) { +- this.g.add(new ChunkPosition(this.railX - 1, this.railY, this.railZ)); +- this.g.add(new ChunkPosition(this.railX + 1, this.railY, this.railZ)); +- } else if(var1 == 2) { +- this.g.add(new ChunkPosition(this.railX - 1, this.railY, this.railZ)); +- this.g.add(new ChunkPosition(this.railX + 1, this.railY + 1, this.railZ)); +- } else if(var1 == 3) { +- this.g.add(new ChunkPosition(this.railX - 1, this.railY + 1, this.railZ)); +- this.g.add(new ChunkPosition(this.railX + 1, this.railY, this.railZ)); +- } else if(var1 == 4) { +- this.g.add(new ChunkPosition(this.railX, this.railY + 1, this.railZ - 1)); +- this.g.add(new ChunkPosition(this.railX, this.railY, this.railZ + 1)); +- } else if(var1 == 5) { +- this.g.add(new ChunkPosition(this.railX, this.railY, this.railZ - 1)); +- this.g.add(new ChunkPosition(this.railX, this.railY + 1, this.railZ + 1)); +- } else if(var1 == 6) { +- this.g.add(new ChunkPosition(this.railX + 1, this.railY, this.railZ)); +- this.g.add(new ChunkPosition(this.railX, this.railY, this.railZ + 1)); +- } else if(var1 == 7) { +- this.g.add(new ChunkPosition(this.railX - 1, this.railY, this.railZ)); +- this.g.add(new ChunkPosition(this.railX, this.railY, this.railZ + 1)); +- } else if(var1 == 8) { +- this.g.add(new ChunkPosition(this.railX - 1, this.railY, this.railZ)); +- this.g.add(new ChunkPosition(this.railX, this.railY, this.railZ - 1)); +- } else if(var1 == 9) { +- this.g.add(new ChunkPosition(this.railX + 1, this.railY, this.railZ)); +- this.g.add(new ChunkPosition(this.railX, this.railY, this.railZ - 1)); +- } ++ private void setBasicRail(int par1) { ++ this.railChunkPosition.clear(); + ++ if (par1 == 0) { ++ this.railChunkPosition.add(new ChunkPosition(this.railX, this.railY, this.railZ - 1)); ++ this.railChunkPosition.add(new ChunkPosition(this.railX, this.railY, this.railZ + 1)); ++ } else if (par1 == 1) { ++ this.railChunkPosition.add(new ChunkPosition(this.railX - 1, this.railY, this.railZ)); ++ this.railChunkPosition.add(new ChunkPosition(this.railX + 1, this.railY, this.railZ)); ++ } else if (par1 == 2) { ++ this.railChunkPosition.add(new ChunkPosition(this.railX - 1, this.railY, this.railZ)); ++ this.railChunkPosition.add(new ChunkPosition(this.railX + 1, this.railY + 1, this.railZ)); ++ } else if (par1 == 3) { ++ this.railChunkPosition.add(new ChunkPosition(this.railX - 1, this.railY + 1, this.railZ)); ++ this.railChunkPosition.add(new ChunkPosition(this.railX + 1, this.railY, this.railZ)); ++ } else if (par1 == 4) { ++ this.railChunkPosition.add(new ChunkPosition(this.railX, this.railY + 1, this.railZ - 1)); ++ this.railChunkPosition.add(new ChunkPosition(this.railX, this.railY, this.railZ + 1)); ++ } else if (par1 == 5) { ++ this.railChunkPosition.add(new ChunkPosition(this.railX, this.railY, this.railZ - 1)); ++ this.railChunkPosition.add(new ChunkPosition(this.railX, this.railY + 1, this.railZ + 1)); ++ } else if (par1 == 6) { ++ this.railChunkPosition.add(new ChunkPosition(this.railX + 1, this.railY, this.railZ)); ++ this.railChunkPosition.add(new ChunkPosition(this.railX, this.railY, this.railZ + 1)); ++ } else if (par1 == 7) { ++ this.railChunkPosition.add(new ChunkPosition(this.railX - 1, this.railY, this.railZ)); ++ this.railChunkPosition.add(new ChunkPosition(this.railX, this.railY, this.railZ + 1)); ++ } else if (par1 == 8) { ++ this.railChunkPosition.add(new ChunkPosition(this.railX - 1, this.railY, this.railZ)); ++ this.railChunkPosition.add(new ChunkPosition(this.railX, this.railY, this.railZ - 1)); ++ } else if (par1 == 9) { ++ this.railChunkPosition.add(new ChunkPosition(this.railX + 1, this.railY, this.railZ)); ++ this.railChunkPosition.add(new ChunkPosition(this.railX, this.railY, this.railZ - 1)); ++ } + } + + private void refreshConnectedTracks() { +- for(int var1 = 0; var1 < this.g.size(); ++var1) { +- BlockBaseRailLogic var2 = this.getRailLogic((ChunkPosition)this.g.get(var1)); +- if(var2 != null && var2.isRailChunkPositionCorrect(this)) { +- this.g.set(var1, new ChunkPosition(var2.railX, var2.railY, var2.railZ)); ++ for (int var1 = 0; var1 < this.railChunkPosition.size(); ++var1) { ++ BlockBaseRailLogic var2 = this.getRailLogic((ChunkPosition)this.railChunkPosition.get(var1)); ++ ++ if (var2 != null && var2.isRailChunkPositionCorrect(this)) { ++ this.railChunkPosition.set(var1, new ChunkPosition(var2.railX, var2.railY, var2.railZ)); + } else { +- this.g.remove(var1--); ++ this.railChunkPosition.remove(var1--); + } + } +- +- } +- +- private boolean isMinecartTrack(int var1, int var2, int var3) { +- return BlockRailBase.isRailBlockAt(this.logicWorld, var1, var2, var3) ? true : (BlockRailBase.isRailBlockAt(this.logicWorld, var1, var2 + 1, var3) ? true : BlockRailBase.isRailBlockAt(this.logicWorld, var1, var2 - 1, var3)); +- } +- +- private BlockBaseRailLogic getRailLogic(ChunkPosition var1) { +- return BlockRailBase.isRailBlockAt(this.logicWorld, var1.x, var1.y, var1.z) ? new BlockBaseRailLogic(this.theRail, this.logicWorld, var1.x, var1.y, var1.z) : (BlockRailBase.isRailBlockAt(this.logicWorld, var1.x, var1.y + 1, var1.z) ? new BlockBaseRailLogic(this.theRail, this.logicWorld, var1.x, var1.y + 1, var1.z) : (BlockRailBase.isRailBlockAt(this.logicWorld, var1.x, var1.y - 1, var1.z) ? new BlockBaseRailLogic(this.theRail, this.logicWorld, var1.x, var1.y - 1, var1.z) : null)); +- } +- +- private boolean isRailChunkPositionCorrect(BlockBaseRailLogic var1) { +- for(int var2 = 0; var2 < this.g.size(); ++var2) { +- ChunkPosition var3 = (ChunkPosition)this.g.get(var2); +- if(var3.x == var1.railX && var3.z == var1.railZ) { ++ } ++ ++ private boolean isMinecartTrack(int par1, int par2, int par3) { ++ return BlockRailBase.isRailBlockAt(this.logicWorld, par1, par2, par3) ? true : (BlockRailBase.isRailBlockAt(this.logicWorld, par1, par2 + 1, par3) ? true : BlockRailBase.isRailBlockAt(this.logicWorld, par1, par2 - 1, par3)); ++ } ++ ++ private BlockBaseRailLogic getRailLogic(ChunkPosition par1ChunkPosition) { ++ return BlockRailBase.isRailBlockAt(this.logicWorld, par1ChunkPosition.x, par1ChunkPosition.y, par1ChunkPosition.z) ? new BlockBaseRailLogic(this.theRail, this.logicWorld, par1ChunkPosition.x, par1ChunkPosition.y, par1ChunkPosition.z) : (BlockRailBase.isRailBlockAt(this.logicWorld, par1ChunkPosition.x, par1ChunkPosition.y + 1, par1ChunkPosition.z) ? new BlockBaseRailLogic(this.theRail, this.logicWorld, par1ChunkPosition.x, par1ChunkPosition.y + 1, par1ChunkPosition.z) : (BlockRailBase.isRailBlockAt(this.logicWorld, par1ChunkPosition.x, par1ChunkPosition.y - 1, par1ChunkPosition.z) ? new BlockBaseRailLogic(this.theRail, this.logicWorld, par1ChunkPosition.x, par1ChunkPosition.y - 1, par1ChunkPosition.z) : null)); ++ } ++ ++ /** ++ * Checks if the rail is at the chunk position it is expected to be. ++ */ ++ private boolean isRailChunkPositionCorrect(BlockBaseRailLogic par1BlockBaseRailLogic) { ++ for (int var2 = 0; var2 < this.railChunkPosition.size(); ++var2) { ++ ChunkPosition var3 = (ChunkPosition)this.railChunkPosition.get(var2); ++ ++ if (var3.x == par1BlockBaseRailLogic.railX && var3.z == par1BlockBaseRailLogic.railZ) { + return true; + } + } +@@ -98,10 +106,11 @@ + return false; + } + +- private boolean isPartOfTrack(int var1, int var2, int var3) { +- for(int var4 = 0; var4 < this.g.size(); ++var4) { +- ChunkPosition var5 = (ChunkPosition)this.g.get(var4); +- if(var5.x == var1 && var5.z == var3) { ++ private boolean isPartOfTrack(int par1, int par2, int par3) { ++ for (int var4 = 0; var4 < this.railChunkPosition.size(); ++var4) { ++ ChunkPosition var5 = (ChunkPosition)this.railChunkPosition.get(var4); ++ ++ if (var5.x == par1 && var5.z == par3) { + return true; + } + } +@@ -111,97 +120,101 @@ + + protected int getNumberOfAdjacentTracks() { + int var1 = 0; +- if(this.isMinecartTrack(this.railX, this.railY, this.railZ - 1)) { +- ++var1; +- } +- +- if(this.isMinecartTrack(this.railX, this.railY, this.railZ + 1)) { +- ++var1; +- } +- +- if(this.isMinecartTrack(this.railX - 1, this.railY, this.railZ)) { +- ++var1; +- } +- +- if(this.isMinecartTrack(this.railX + 1, this.railY, this.railZ)) { ++ ++ if (this.isMinecartTrack(this.railX, this.railY, this.railZ - 1)) { ++ ++var1; ++ } ++ ++ if (this.isMinecartTrack(this.railX, this.railY, this.railZ + 1)) { ++ ++var1; ++ } ++ ++ if (this.isMinecartTrack(this.railX - 1, this.railY, this.railZ)) { ++ ++var1; ++ } ++ ++ if (this.isMinecartTrack(this.railX + 1, this.railY, this.railZ)) { + ++var1; + } + + return var1; + } + +- private boolean canConnectTo(BlockBaseRailLogic var1) { +- return this.isRailChunkPositionCorrect(var1) ? true : (this.g.size() == 2 ? false : (this.g.isEmpty() ? true : true)); ++ private boolean canConnectTo(BlockBaseRailLogic par1BlockBaseRailLogic) { ++ return this.isRailChunkPositionCorrect(par1BlockBaseRailLogic) ? true : (this.railChunkPosition.size() == 2 ? false : (this.railChunkPosition.isEmpty() ? true : true)); + } + +- private void connectToNeighbor(BlockBaseRailLogic var1) { +- this.g.add(new ChunkPosition(var1.railX, var1.railY, var1.railZ)); ++ private void connectToNeighbor(BlockBaseRailLogic par1BlockBaseRailLogic) { ++ this.railChunkPosition.add(new ChunkPosition(par1BlockBaseRailLogic.railX, par1BlockBaseRailLogic.railY, par1BlockBaseRailLogic.railZ)); + boolean var2 = this.isPartOfTrack(this.railX, this.railY, this.railZ - 1); + boolean var3 = this.isPartOfTrack(this.railX, this.railY, this.railZ + 1); + boolean var4 = this.isPartOfTrack(this.railX - 1, this.railY, this.railZ); + boolean var5 = this.isPartOfTrack(this.railX + 1, this.railY, this.railZ); + byte var6 = -1; +- if(var2 || var3) { ++ ++ if (var2 || var3) { + var6 = 0; + } + +- if(var4 || var5) { ++ if (var4 || var5) { + var6 = 1; + } + +- if(!this.isStraightRail) { +- if(var3 && var5 && !var2 && !var4) { ++ if (!this.isStraightRail) { ++ if (var3 && var5 && !var2 && !var4) { + var6 = 6; + } + +- if(var3 && var4 && !var2 && !var5) { ++ if (var3 && var4 && !var2 && !var5) { + var6 = 7; + } + +- if(var2 && var4 && !var3 && !var5) { ++ if (var2 && var4 && !var3 && !var5) { + var6 = 8; + } + +- if(var2 && var5 && !var3 && !var4) { ++ if (var2 && var5 && !var3 && !var4) { + var6 = 9; + } + } + +- if(var6 == 0) { +- if(BlockRailBase.isRailBlockAt(this.logicWorld, this.railX, this.railY + 1, this.railZ - 1)) { ++ if (var6 == 0) { ++ if (BlockRailBase.isRailBlockAt(this.logicWorld, this.railX, this.railY + 1, this.railZ - 1)) { + var6 = 4; + } + +- if(BlockRailBase.isRailBlockAt(this.logicWorld, this.railX, this.railY + 1, this.railZ + 1)) { ++ if (BlockRailBase.isRailBlockAt(this.logicWorld, this.railX, this.railY + 1, this.railZ + 1)) { + var6 = 5; + } + } + +- if(var6 == 1) { +- if(BlockRailBase.isRailBlockAt(this.logicWorld, this.railX + 1, this.railY + 1, this.railZ)) { ++ if (var6 == 1) { ++ if (BlockRailBase.isRailBlockAt(this.logicWorld, this.railX + 1, this.railY + 1, this.railZ)) { + var6 = 2; + } + +- if(BlockRailBase.isRailBlockAt(this.logicWorld, this.railX - 1, this.railY + 1, this.railZ)) { ++ if (BlockRailBase.isRailBlockAt(this.logicWorld, this.railX - 1, this.railY + 1, this.railZ)) { + var6 = 3; + } + } + +- if(var6 < 0) { ++ if (var6 < 0) { + var6 = 0; + } + + int var7 = var6; +- if(this.isStraightRail) { ++ ++ if (this.isStraightRail) { + var7 = this.logicWorld.getBlockMetadata(this.railX, this.railY, this.railZ) & 8 | var6; + } + +- this.logicWorld.setBlockMetadata(this.railX, this.railY, this.railZ, var7, 3); ++ this.logicWorld.setBlockMetadataWithNotify(this.railX, this.railY, this.railZ, var7, 3); + } + +- private boolean canConnectFrom(int var1, int var2, int var3) { +- BlockBaseRailLogic var4 = this.getRailLogic(new ChunkPosition(var1, var2, var3)); +- if(var4 == null) { ++ private boolean canConnectFrom(int par1, int par2, int par3) { ++ BlockBaseRailLogic var4 = this.getRailLogic(new ChunkPosition(par1, par2, par3)); ++ ++ if (var4 == null) { + return false; + } else { + var4.refreshConnectedTracks(); +@@ -209,127 +222,130 @@ + } + } + +- public void func_94511_a(boolean var1, boolean var2) { ++ public void func_94511_a(boolean par1, boolean par2) { + boolean var3 = this.canConnectFrom(this.railX, this.railY, this.railZ - 1); + boolean var4 = this.canConnectFrom(this.railX, this.railY, this.railZ + 1); + boolean var5 = this.canConnectFrom(this.railX - 1, this.railY, this.railZ); + boolean var6 = this.canConnectFrom(this.railX + 1, this.railY, this.railZ); + byte var7 = -1; +- if((var3 || var4) && !var5 && !var6) { ++ ++ if ((var3 || var4) && !var5 && !var6) { + var7 = 0; + } + +- if((var5 || var6) && !var3 && !var4) { ++ if ((var5 || var6) && !var3 && !var4) { + var7 = 1; + } + +- if(!this.isStraightRail) { +- if(var4 && var6 && !var3 && !var5) { ++ if (!this.isStraightRail) { ++ if (var4 && var6 && !var3 && !var5) { + var7 = 6; + } + +- if(var4 && var5 && !var3 && !var6) { ++ if (var4 && var5 && !var3 && !var6) { + var7 = 7; + } + +- if(var3 && var5 && !var4 && !var6) { ++ if (var3 && var5 && !var4 && !var6) { + var7 = 8; + } + +- if(var3 && var6 && !var4 && !var5) { ++ if (var3 && var6 && !var4 && !var5) { + var7 = 9; + } + } + +- if(var7 == -1) { +- if(var3 || var4) { ++ if (var7 == -1) { ++ if (var3 || var4) { + var7 = 0; + } + +- if(var5 || var6) { ++ if (var5 || var6) { + var7 = 1; + } + +- if(!this.isStraightRail) { +- if(var1) { +- if(var4 && var6) { ++ if (!this.isStraightRail) { ++ if (par1) { ++ if (var4 && var6) { + var7 = 6; + } + +- if(var5 && var4) { ++ if (var5 && var4) { + var7 = 7; + } + +- if(var6 && var3) { ++ if (var6 && var3) { + var7 = 9; + } + +- if(var3 && var5) { ++ if (var3 && var5) { + var7 = 8; + } + } else { +- if(var3 && var5) { ++ if (var3 && var5) { + var7 = 8; + } + +- if(var6 && var3) { ++ if (var6 && var3) { + var7 = 9; + } + +- if(var5 && var4) { ++ if (var5 && var4) { + var7 = 7; + } + +- if(var4 && var6) { ++ if (var4 && var6) { + var7 = 6; + } + } + } + } + +- if(var7 == 0) { +- if(BlockRailBase.isRailBlockAt(this.logicWorld, this.railX, this.railY + 1, this.railZ - 1)) { ++ if (var7 == 0) { ++ if (BlockRailBase.isRailBlockAt(this.logicWorld, this.railX, this.railY + 1, this.railZ - 1)) { + var7 = 4; + } + +- if(BlockRailBase.isRailBlockAt(this.logicWorld, this.railX, this.railY + 1, this.railZ + 1)) { ++ if (BlockRailBase.isRailBlockAt(this.logicWorld, this.railX, this.railY + 1, this.railZ + 1)) { + var7 = 5; + } + } + +- if(var7 == 1) { +- if(BlockRailBase.isRailBlockAt(this.logicWorld, this.railX + 1, this.railY + 1, this.railZ)) { ++ if (var7 == 1) { ++ if (BlockRailBase.isRailBlockAt(this.logicWorld, this.railX + 1, this.railY + 1, this.railZ)) { + var7 = 2; + } + +- if(BlockRailBase.isRailBlockAt(this.logicWorld, this.railX - 1, this.railY + 1, this.railZ)) { ++ if (BlockRailBase.isRailBlockAt(this.logicWorld, this.railX - 1, this.railY + 1, this.railZ)) { + var7 = 3; + } + } + +- if(var7 < 0) { ++ if (var7 < 0) { + var7 = 0; + } + + this.setBasicRail(var7); + int var8 = var7; +- if(this.isStraightRail) { ++ ++ if (this.isStraightRail) { + var8 = this.logicWorld.getBlockMetadata(this.railX, this.railY, this.railZ) & 8 | var7; + } + +- if(var2 || this.logicWorld.getBlockMetadata(this.railX, this.railY, this.railZ) != var8) { +- this.logicWorld.setBlockMetadata(this.railX, this.railY, this.railZ, var8, 3); +- +- for(int var9 = 0; var9 < this.g.size(); ++var9) { +- BlockBaseRailLogic var10 = this.getRailLogic((ChunkPosition)this.g.get(var9)); +- if(var10 != null) { ++ if (par2 || this.logicWorld.getBlockMetadata(this.railX, this.railY, this.railZ) != var8) { ++ this.logicWorld.setBlockMetadataWithNotify(this.railX, this.railY, this.railZ, var8, 3); ++ ++ for (int var9 = 0; var9 < this.railChunkPosition.size(); ++var9) { ++ BlockBaseRailLogic var10 = this.getRailLogic((ChunkPosition)this.railChunkPosition.get(var9)); ++ ++ if (var10 != null) { + var10.refreshConnectedTracks(); +- if(var10.canConnectTo(this)) { ++ ++ if (var10.canConnectTo(this)) { + var10.connectToNeighbor(this); + } + } + } + } +- + } + } diff --git a/patches/net/minecraft/src/BlockBeacon.java.patch b/patches/net/minecraft/src/BlockBeacon.java.patch new file mode 100644 index 0000000..9f24b8b --- /dev/null +++ b/patches/net/minecraft/src/BlockBeacon.java.patch @@ -0,0 +1,92 @@ +--- net/minecraft/src/BlockBeacon.java ++++ net/minecraft/src/BlockBeacon.java +@@ -1,50 +1,74 @@ + package net.minecraft.src; + + public class BlockBeacon extends BlockContainer { +- public BlockBeacon(int var1) { +- super(var1, Material.glass); ++ public BlockBeacon(int par1) { ++ super(par1, Material.glass); + this.setHardness(3.0F); + this.setCreativeTab(CreativeTabs.tabMisc); + } + +- public TileEntity createNewTileEntity(World var1) { ++ /** ++ * Returns a new instance of a block's tile entity class. Called on placing the block. ++ */ ++ public TileEntity createNewTileEntity(World par1World) { + return new TileEntityBeacon(); + } + +- public boolean onBlockActivated(World var1, int var2, int var3, int var4, EntityPlayer var5, int var6, float var7, float var8, float var9) { +- if(var1.isRemote) { ++ /** ++ * Called upon block activation (right click on the block.) ++ */ ++ public boolean onBlockActivated(World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer, int par6, float par7, float par8, float par9) { ++ if (par1World.isRemote) { + return true; + } else { +- TileEntityBeacon var10 = (TileEntityBeacon)var1.getBlockTileEntity(var2, var3, var4); +- if(var10 != null) { +- var5.displayGUIBeacon(var10); ++ TileEntityBeacon var10 = (TileEntityBeacon)par1World.getBlockTileEntity(par2, par3, par4); ++ ++ if (var10 != null) { ++ par5EntityPlayer.displayGUIBeacon(var10); + } + + return true; + } + } + ++ /** ++ * Is this block (a) opaque and (b) a full 1m cube? This determines whether or not to render the shared face of two ++ * adjacent blocks and also whether the player can attach torches, redstone wire, etc to this block. ++ */ + public boolean isOpaqueCube() { + return false; + } + ++ /** ++ * If this block doesn't render as an ordinary block it will return False (examples: signs, buttons, stairs, etc) ++ */ + public boolean renderAsNormalBlock() { + return false; + } + ++ /** ++ * The type of render function that is called for this block ++ */ + public int getRenderType() { + return 34; + } + +- public void registerIcons(IconRegister var1) { +- super.registerIcons(var1); ++ /** ++ * When this method is called, your block should register all the icons it needs with the given IconRegister. This is ++ * the only chance you get to register icons. ++ */ ++ public void registerIcons(IconRegister par1IconRegister) { ++ super.registerIcons(par1IconRegister); + } + +- public void onBlockPlacedBy(World var1, int var2, int var3, int var4, EntityLivingBase var5, ItemStack var6) { +- super.onBlockPlacedBy(var1, var2, var3, var4, var5, var6); +- if(var6.hasDisplayName()) { +- ((TileEntityBeacon)var1.getBlockTileEntity(var2, var3, var4)).func_94047_a(var6.getDisplayName()); ++ /** ++ * Called when the block is placed in the world. ++ */ ++ public void onBlockPlacedBy(World par1World, int par2, int par3, int par4, EntityLivingBase par5EntityLivingBase, ItemStack par6ItemStack) { ++ super.onBlockPlacedBy(par1World, par2, par3, par4, par5EntityLivingBase, par6ItemStack); ++ ++ if (par6ItemStack.hasDisplayName()) { ++ ((TileEntityBeacon)par1World.getBlockTileEntity(par2, par3, par4)).func_94047_a(par6ItemStack.getDisplayName()); + } +- + } + } diff --git a/patches/net/minecraft/src/BlockBed.java.patch b/patches/net/minecraft/src/BlockBed.java.patch new file mode 100644 index 0000000..e77589f --- /dev/null +++ b/patches/net/minecraft/src/BlockBed.java.patch @@ -0,0 +1,389 @@ +--- net/minecraft/src/BlockBed.java ++++ net/minecraft/src/BlockBed.java +@@ -4,183 +4,238 @@ + import java.util.Random; + + public class BlockBed extends BlockDirectional { +- public static final int[][] footBlockToHeadBlockMap = new int[][]{{0, 1}, {-1, 0}, {0, -1}, {1, 0}}; ++ ++ /** Maps the foot-of-bed block to the head-of-bed block. */ ++ public static final int[][] footBlockToHeadBlockMap = new int[][] {{0, 1}, { -1, 0}, {0, -1}, {1, 0}}; + private Icon[] field_94472_b; + private Icon[] bedSideIcons; + private Icon[] bedTopIcons; + +- public BlockBed(int var1) { +- super(var1, Material.cloth); ++ public BlockBed(int par1) { ++ super(par1, Material.cloth); + this.setBounds(); + } + +- public boolean onBlockActivated(World var1, int var2, int var3, int var4, EntityPlayer var5, int var6, float var7, float var8, float var9) { +- if(var1.isRemote) { ++ /** ++ * Called upon block activation (right click on the block.) ++ */ ++ public boolean onBlockActivated(World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer, int par6, float par7, float par8, float par9) { ++ if (par1World.isRemote) { + return true; + } else { +- int var10 = var1.getBlockMetadata(var2, var3, var4); +- if(!isBlockHeadOfBed(var10)) { ++ int var10 = par1World.getBlockMetadata(par2, par3, par4); ++ ++ if (!isBlockHeadOfBed(var10)) { + int var11 = getDirection(var10); +- var2 += footBlockToHeadBlockMap[var11][0]; +- var4 += footBlockToHeadBlockMap[var11][1]; +- if(var1.getBlockId(var2, var3, var4) != this.blockID) { ++ par2 += footBlockToHeadBlockMap[var11][0]; ++ par4 += footBlockToHeadBlockMap[var11][1]; ++ ++ if (par1World.getBlockId(par2, par3, par4) != this.blockID) { + return true; + } + +- var10 = var1.getBlockMetadata(var2, var3, var4); ++ var10 = par1World.getBlockMetadata(par2, par3, par4); + } + +- if(var1.provider.canRespawnHere() && var1.getBiomeGenForCoords(var2, var4) != BiomeGenBase.hell) { +- if(isBedOccupied(var10)) { ++ if (par1World.provider.canRespawnHere() && par1World.getBiomeGenForCoords(par2, par4) != BiomeGenBase.hell) { ++ if (isBedOccupied(var10)) { + EntityPlayer var19 = null; +- Iterator var12 = var1.h.iterator(); ++ Iterator var12 = par1World.playerEntities.iterator(); + +- while(var12.hasNext()) { ++ while (var12.hasNext()) { + EntityPlayer var21 = (EntityPlayer)var12.next(); +- if(var21.isPlayerSleeping()) { ++ ++ if (var21.isPlayerSleeping()) { + ChunkCoordinates var14 = var21.playerLocation; +- if(var14.posX == var2 && var14.posY == var3 && var14.posZ == var4) { ++ ++ if (var14.posX == par2 && var14.posY == par3 && var14.posZ == par4) { + var19 = var21; + } + } + } + +- if(var19 != null) { +- var5.addChatMessage("tile.bed.occupied"); ++ if (var19 != null) { ++ par5EntityPlayer.addChatMessage("tile.bed.occupied"); + return true; + } + +- setBedOccupied(var1, var2, var3, var4, false); ++ setBedOccupied(par1World, par2, par3, par4, false); + } + +- EnumStatus var20 = var5.sleepInBedAt(var2, var3, var4); +- if(var20 == EnumStatus.OK) { +- setBedOccupied(var1, var2, var3, var4, true); ++ EnumStatus var20 = par5EntityPlayer.sleepInBedAt(par2, par3, par4); ++ ++ if (var20 == EnumStatus.OK) { ++ setBedOccupied(par1World, par2, par3, par4, true); + return true; + } else { +- if(var20 == EnumStatus.NOT_POSSIBLE_NOW) { +- var5.addChatMessage("tile.bed.noSleep"); +- } else if(var20 == EnumStatus.NOT_SAFE) { +- var5.addChatMessage("tile.bed.notSafe"); ++ if (var20 == EnumStatus.NOT_POSSIBLE_NOW) { ++ par5EntityPlayer.addChatMessage("tile.bed.noSleep"); ++ } else if (var20 == EnumStatus.NOT_SAFE) { ++ par5EntityPlayer.addChatMessage("tile.bed.notSafe"); + } + + return true; + } + } else { +- double var18 = (double)var2 + 0.5D; +- double var13 = (double)var3 + 0.5D; +- double var15 = (double)var4 + 0.5D; +- var1.setBlockToAir(var2, var3, var4); ++ double var18 = (double)par2 + 0.5D; ++ double var13 = (double)par3 + 0.5D; ++ double var15 = (double)par4 + 0.5D; ++ par1World.setBlockToAir(par2, par3, par4); + int var17 = getDirection(var10); +- var2 += footBlockToHeadBlockMap[var17][0]; +- var4 += footBlockToHeadBlockMap[var17][1]; +- if(var1.getBlockId(var2, var3, var4) == this.blockID) { +- var1.setBlockToAir(var2, var3, var4); +- var18 = (var18 + (double)var2 + 0.5D) / 2.0D; +- var13 = (var13 + (double)var3 + 0.5D) / 2.0D; +- var15 = (var15 + (double)var4 + 0.5D) / 2.0D; ++ par2 += footBlockToHeadBlockMap[var17][0]; ++ par4 += footBlockToHeadBlockMap[var17][1]; ++ ++ if (par1World.getBlockId(par2, par3, par4) == this.blockID) { ++ par1World.setBlockToAir(par2, par3, par4); ++ var18 = (var18 + (double)par2 + 0.5D) / 2.0D; ++ var13 = (var13 + (double)par3 + 0.5D) / 2.0D; ++ var15 = (var15 + (double)par4 + 0.5D) / 2.0D; + } + +- var1.newExplosion((Entity)null, (double)((float)var2 + 0.5F), (double)((float)var3 + 0.5F), (double)((float)var4 + 0.5F), 5.0F, true, true); ++ par1World.newExplosion((Entity)null, (double)((float)par2 + 0.5F), (double)((float)par3 + 0.5F), (double)((float)par4 + 0.5F), 5.0F, true, true); + return true; + } + } + } + +- public Icon getIcon(int var1, int var2) { +- if(var1 == 0) { +- return Block.planks.getBlockTextureFromSide(var1); ++ /** ++ * From the specified side and block metadata retrieves the blocks texture. Args: side, metadata ++ */ ++ public Icon getIcon(int par1, int par2) { ++ if (par1 == 0) { ++ return Block.planks.getBlockTextureFromSide(par1); + } else { +- int var3 = getDirection(var2); +- int var4 = Direction.bedDirection[var3][var1]; +- int var5 = isBlockHeadOfBed(var2) ? 1 : 0; ++ int var3 = getDirection(par2); ++ int var4 = Direction.bedDirection[var3][par1]; ++ int var5 = isBlockHeadOfBed(par2) ? 1 : 0; + return (var5 != 1 || var4 != 2) && (var5 != 0 || var4 != 3) ? (var4 != 5 && var4 != 4 ? this.bedTopIcons[var5] : this.bedSideIcons[var5]) : this.field_94472_b[var5]; + } + } + +- public void registerIcons(IconRegister var1) { +- this.bedTopIcons = new Icon[]{var1.registerIcon(this.getTextureName() + "_feet_top"), var1.registerIcon(this.getTextureName() + "_head_top")}; +- this.field_94472_b = new Icon[]{var1.registerIcon(this.getTextureName() + "_feet_end"), var1.registerIcon(this.getTextureName() + "_head_end")}; +- this.bedSideIcons = new Icon[]{var1.registerIcon(this.getTextureName() + "_feet_side"), var1.registerIcon(this.getTextureName() + "_head_side")}; ++ /** ++ * When this method is called, your block should register all the icons it needs with the given IconRegister. This is ++ * the only chance you get to register icons. ++ */ ++ public void registerIcons(IconRegister par1IconRegister) { ++ this.bedTopIcons = new Icon[] {par1IconRegister.registerIcon(this.getTextureName() + "_feet_top"), par1IconRegister.registerIcon(this.getTextureName() + "_head_top")}; ++ this.field_94472_b = new Icon[] {par1IconRegister.registerIcon(this.getTextureName() + "_feet_end"), par1IconRegister.registerIcon(this.getTextureName() + "_head_end")}; ++ this.bedSideIcons = new Icon[] {par1IconRegister.registerIcon(this.getTextureName() + "_feet_side"), par1IconRegister.registerIcon(this.getTextureName() + "_head_side")}; + } + ++ /** ++ * The type of render function that is called for this block ++ */ + public int getRenderType() { + return 14; + } + ++ /** ++ * If this block doesn't render as an ordinary block it will return False (examples: signs, buttons, stairs, etc) ++ */ + public boolean renderAsNormalBlock() { + return false; + } + ++ /** ++ * Is this block (a) opaque and (b) a full 1m cube? This determines whether or not to render the shared face of two ++ * adjacent blocks and also whether the player can attach torches, redstone wire, etc to this block. ++ */ + public boolean isOpaqueCube() { + return false; + } + +- public void setBlockBoundsBasedOnState(IBlockAccess var1, int var2, int var3, int var4) { ++ /** ++ * Updates the blocks bounds based on its current state. Args: world, x, y, z ++ */ ++ public void setBlockBoundsBasedOnState(IBlockAccess par1IBlockAccess, int par2, int par3, int par4) { + this.setBounds(); + } + +- public void onNeighborBlockChange(World var1, int var2, int var3, int var4, int var5) { +- int var6 = var1.getBlockMetadata(var2, var3, var4); ++ /** ++ * Lets the block know when one of its neighbor changes. Doesn't know which neighbor changed (coordinates passed are ++ * their own) Args: x, y, z, neighbor blockID ++ */ ++ public void onNeighborBlockChange(World par1World, int par2, int par3, int par4, int par5) { ++ int var6 = par1World.getBlockMetadata(par2, par3, par4); + int var7 = getDirection(var6); +- if(isBlockHeadOfBed(var6)) { +- if(var1.getBlockId(var2 - footBlockToHeadBlockMap[var7][0], var3, var4 - footBlockToHeadBlockMap[var7][1]) != this.blockID) { +- var1.setBlockToAir(var2, var3, var4); ++ ++ if (isBlockHeadOfBed(var6)) { ++ if (par1World.getBlockId(par2 - footBlockToHeadBlockMap[var7][0], par3, par4 - footBlockToHeadBlockMap[var7][1]) != this.blockID) { ++ par1World.setBlockToAir(par2, par3, par4); + } +- } else if(var1.getBlockId(var2 + footBlockToHeadBlockMap[var7][0], var3, var4 + footBlockToHeadBlockMap[var7][1]) != this.blockID) { +- var1.setBlockToAir(var2, var3, var4); +- if(!var1.isRemote) { +- this.dropBlockAsItem(var1, var2, var3, var4, var6, 0); ++ } else if (par1World.getBlockId(par2 + footBlockToHeadBlockMap[var7][0], par3, par4 + footBlockToHeadBlockMap[var7][1]) != this.blockID) { ++ par1World.setBlockToAir(par2, par3, par4); ++ ++ if (!par1World.isRemote) { ++ this.dropBlockAsItem(par1World, par2, par3, par4, var6, 0); + } + } +- +- } +- +- public int idDropped(int var1, Random var2, int var3) { +- return isBlockHeadOfBed(var1) ? 0 : Item.bed.itemID; +- } +- ++ } ++ ++ /** ++ * Returns the ID of the items to drop on destruction. ++ */ ++ public int idDropped(int par1, Random par2Random, int par3) { ++ return isBlockHeadOfBed(par1) ? 0 : Item.bed.itemID; ++ } ++ ++ /** ++ * Set the bounds of the bed block. ++ */ + private void setBounds() { +- this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 9.0F / 16.0F, 1.0F); +- } +- +- public static boolean isBlockHeadOfBed(int var0) { +- return (var0 & 8) != 0; +- } +- +- public static boolean isBedOccupied(int var0) { +- return (var0 & 4) != 0; +- } +- +- public static void setBedOccupied(World var0, int var1, int var2, int var3, boolean var4) { +- int var5 = var0.getBlockMetadata(var1, var2, var3); +- if(var4) { ++ this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.5625F, 1.0F); ++ } ++ ++ /** ++ * Returns whether or not this bed block is the head of the bed. ++ */ ++ public static boolean isBlockHeadOfBed(int par0) { ++ return (par0 & 8) != 0; ++ } ++ ++ /** ++ * Return whether or not the bed is occupied. ++ */ ++ public static boolean isBedOccupied(int par0) { ++ return (par0 & 4) != 0; ++ } ++ ++ /** ++ * Sets whether or not the bed is occupied. ++ */ ++ public static void setBedOccupied(World par0World, int par1, int par2, int par3, boolean par4) { ++ int var5 = par0World.getBlockMetadata(par1, par2, par3); ++ ++ if (par4) { + var5 |= 4; + } else { + var5 &= -5; + } + +- var0.setBlockMetadata(var1, var2, var3, var5, 4); ++ par0World.setBlockMetadataWithNotify(par1, par2, par3, var5, 4); + } + +- public static ChunkCoordinates getNearestEmptyChunkCoordinates(World var0, int var1, int var2, int var3, int var4) { +- int var5 = var0.getBlockMetadata(var1, var2, var3); ++ /** ++ * Gets the nearest empty chunk coordinates for the player to wake up from a bed into. ++ */ ++ public static ChunkCoordinates getNearestEmptyChunkCoordinates(World par0World, int par1, int par2, int par3, int par4) { ++ int var5 = par0World.getBlockMetadata(par1, par2, par3); + int var6 = BlockDirectional.getDirection(var5); + +- for(int var7 = 0; var7 <= 1; ++var7) { +- int var8 = var1 - footBlockToHeadBlockMap[var6][0] * var7 - 1; +- int var9 = var3 - footBlockToHeadBlockMap[var6][1] * var7 - 1; ++ for (int var7 = 0; var7 <= 1; ++var7) { ++ int var8 = par1 - footBlockToHeadBlockMap[var6][0] * var7 - 1; ++ int var9 = par3 - footBlockToHeadBlockMap[var6][1] * var7 - 1; + int var10 = var8 + 2; + int var11 = var9 + 2; + +- for(int var12 = var8; var12 <= var10; ++var12) { +- for(int var13 = var9; var13 <= var11; ++var13) { +- if(var0.doesBlockHaveSolidTopSurface(var12, var2 - 1, var13) && !var0.getBlockMaterial(var12, var2, var13).isOpaque() && !var0.getBlockMaterial(var12, var2 + 1, var13).isOpaque()) { +- if(var4 <= 0) { +- return new ChunkCoordinates(var12, var2, var13); ++ for (int var12 = var8; var12 <= var10; ++var12) { ++ for (int var13 = var9; var13 <= var11; ++var13) { ++ if (par0World.doesBlockHaveSolidTopSurface(var12, par2 - 1, var13) && !par0World.getBlockMaterial(var12, par2, var13).isOpaque() && !par0World.getBlockMaterial(var12, par2 + 1, var13).isOpaque()) { ++ if (par4 <= 0) { ++ return new ChunkCoordinates(var12, par2, var13); + } + +- --var4; ++ --par4; + } + } + } +@@ -189,30 +244,42 @@ + return null; + } + +- public void dropBlockAsItemWithChance(World var1, int var2, int var3, int var4, int var5, float var6, int var7) { +- if(!isBlockHeadOfBed(var5)) { +- super.dropBlockAsItemWithChance(var1, var2, var3, var4, var5, var6, 0); ++ /** ++ * Drops the block items with a specified chance of dropping the specified items ++ */ ++ public void dropBlockAsItemWithChance(World par1World, int par2, int par3, int par4, int par5, float par6, int par7) { ++ if (!isBlockHeadOfBed(par5)) { ++ super.dropBlockAsItemWithChance(par1World, par2, par3, par4, par5, par6, 0); + } +- + } + ++ /** ++ * Returns the mobility information of the block, 0 = free, 1 = can't push but can move over, 2 = total immobility and ++ * stop pistons ++ */ + public int getMobilityFlag() { + return 1; + } + +- public int idPicked(World var1, int var2, int var3, int var4) { ++ /** ++ * only called by clickMiddleMouseButton , and passed to inventory.setCurrentItem (along with isCreative) ++ */ ++ public int idPicked(World par1World, int par2, int par3, int par4) { + return Item.bed.itemID; + } + +- public void onBlockHarvested(World var1, int var2, int var3, int var4, int var5, EntityPlayer var6) { +- if(var6.capabilities.isCreativeMode && isBlockHeadOfBed(var5)) { +- int var7 = getDirection(var5); +- var2 -= footBlockToHeadBlockMap[var7][0]; +- var4 -= footBlockToHeadBlockMap[var7][1]; +- if(var1.getBlockId(var2, var3, var4) == this.blockID) { +- var1.setBlockToAir(var2, var3, var4); ++ /** ++ * Called when the block is attempted to be harvested ++ */ ++ public void onBlockHarvested(World par1World, int par2, int par3, int par4, int par5, EntityPlayer par6EntityPlayer) { ++ if (par6EntityPlayer.capabilities.isCreativeMode && isBlockHeadOfBed(par5)) { ++ int var7 = getDirection(par5); ++ par2 -= footBlockToHeadBlockMap[var7][0]; ++ par4 -= footBlockToHeadBlockMap[var7][1]; ++ ++ if (par1World.getBlockId(par2, par3, par4) == this.blockID) { ++ par1World.setBlockToAir(par2, par3, par4); + } + } +- + } + } diff --git a/patches/net/minecraft/src/BlockBookshelf.java.patch b/patches/net/minecraft/src/BlockBookshelf.java.patch new file mode 100644 index 0000000..3788096 --- /dev/null +++ b/patches/net/minecraft/src/BlockBookshelf.java.patch @@ -0,0 +1,38 @@ +--- net/minecraft/src/BlockBookshelf.java ++++ net/minecraft/src/BlockBookshelf.java +@@ -3,20 +3,29 @@ + import java.util.Random; + + public class BlockBookshelf extends Block { +- public BlockBookshelf(int var1) { +- super(var1, Material.wood); ++ public BlockBookshelf(int par1) { ++ super(par1, Material.wood); + this.setCreativeTab(CreativeTabs.tabBlock); + } + +- public Icon getIcon(int var1, int var2) { +- return var1 != 1 && var1 != 0 ? super.getIcon(var1, var2) : Block.planks.getBlockTextureFromSide(var1); ++ /** ++ * From the specified side and block metadata retrieves the blocks texture. Args: side, metadata ++ */ ++ public Icon getIcon(int par1, int par2) { ++ return par1 != 1 && par1 != 0 ? super.getIcon(par1, par2) : Block.planks.getBlockTextureFromSide(par1); + } + +- public int quantityDropped(Random var1) { ++ /** ++ * Returns the quantity of items to drop on block destruction. ++ */ ++ public int quantityDropped(Random par1Random) { + return 3; + } + +- public int idDropped(int var1, Random var2, int var3) { ++ /** ++ * Returns the ID of the items to drop on destruction. ++ */ ++ public int idDropped(int par1, Random par2Random, int par3) { + return Item.book.itemID; + } + } diff --git a/patches/net/minecraft/src/BlockBreakable.java.patch b/patches/net/minecraft/src/BlockBreakable.java.patch new file mode 100644 index 0000000..4dc1626 --- /dev/null +++ b/patches/net/minecraft/src/BlockBreakable.java.patch @@ -0,0 +1,49 @@ +--- net/minecraft/src/BlockBreakable.java ++++ net/minecraft/src/BlockBreakable.java +@@ -2,24 +2,36 @@ + + public class BlockBreakable extends Block { + private boolean localFlag; +- private String b; ++ private String breakableBlockIcon; + +- protected BlockBreakable(int var1, String var2, Material var3, boolean var4) { +- super(var1, var3); +- this.localFlag = var4; +- this.b = var2; ++ protected BlockBreakable(int par1, String par2Str, Material par3Material, boolean par4) { ++ super(par1, par3Material); ++ this.localFlag = par4; ++ this.breakableBlockIcon = par2Str; + } + ++ /** ++ * Is this block (a) opaque and (b) a full 1m cube? This determines whether or not to render the shared face of two ++ * adjacent blocks and also whether the player can attach torches, redstone wire, etc to this block. ++ */ + public boolean isOpaqueCube() { + return false; + } + +- public boolean shouldSideBeRendered(IBlockAccess var1, int var2, int var3, int var4, int var5) { +- int var6 = var1.getBlockId(var2, var3, var4); +- return !this.localFlag && var6 == this.blockID ? false : super.shouldSideBeRendered(var1, var2, var3, var4, var5); ++ /** ++ * Returns true if the given side of this block type should be rendered, if the adjacent block is at the given ++ * coordinates. Args: blockAccess, x, y, z, side ++ */ ++ public boolean shouldSideBeRendered(IBlockAccess par1IBlockAccess, int par2, int par3, int par4, int par5) { ++ int var6 = par1IBlockAccess.getBlockId(par2, par3, par4); ++ return !this.localFlag && var6 == this.blockID ? false : super.shouldSideBeRendered(par1IBlockAccess, par2, par3, par4, par5); + } + +- public void registerIcons(IconRegister var1) { +- this.blockIcon = var1.registerIcon(this.b); ++ /** ++ * When this method is called, your block should register all the icons it needs with the given IconRegister. This is ++ * the only chance you get to register icons. ++ */ ++ public void registerIcons(IconRegister par1IconRegister) { ++ this.blockIcon = par1IconRegister.registerIcon(this.breakableBlockIcon); + } + } diff --git a/patches/net/minecraft/src/BlockBrewingStand.java.patch b/patches/net/minecraft/src/BlockBrewingStand.java.patch new file mode 100644 index 0000000..5e9045c --- /dev/null +++ b/patches/net/minecraft/src/BlockBrewingStand.java.patch @@ -0,0 +1,236 @@ +--- net/minecraft/src/BlockBrewingStand.java ++++ net/minecraft/src/BlockBrewingStand.java +@@ -4,119 +4,173 @@ + import java.util.Random; + + public class BlockBrewingStand extends BlockContainer { +- private Random a = new Random(); ++ private Random rand = new Random(); + private Icon theIcon; + +- public BlockBrewingStand(int var1) { +- super(var1, Material.iron); ++ public BlockBrewingStand(int par1) { ++ super(par1, Material.iron); + } + ++ /** ++ * Is this block (a) opaque and (b) a full 1m cube? This determines whether or not to render the shared face of two ++ * adjacent blocks and also whether the player can attach torches, redstone wire, etc to this block. ++ */ + public boolean isOpaqueCube() { + return false; + } + ++ /** ++ * The type of render function that is called for this block ++ */ + public int getRenderType() { + return 25; + } + +- public TileEntity createNewTileEntity(World var1) { ++ /** ++ * Returns a new instance of a block's tile entity class. Called on placing the block. ++ */ ++ public TileEntity createNewTileEntity(World par1World) { + return new TileEntityBrewingStand(); + } + ++ /** ++ * If this block doesn't render as an ordinary block it will return False (examples: signs, buttons, stairs, etc) ++ */ + public boolean renderAsNormalBlock() { + return false; + } + +- public void addCollisionBoxesToList(World var1, int var2, int var3, int var4, AxisAlignedBB var5, List var6, Entity var7) { +- this.setBlockBounds(7.0F / 16.0F, 0.0F, 7.0F / 16.0F, 9.0F / 16.0F, 14.0F / 16.0F, 9.0F / 16.0F); +- super.addCollisionBoxesToList(var1, var2, var3, var4, var5, var6, var7); ++ /** ++ * Adds all intersecting collision boxes to a list. (Be sure to only add boxes to the list if they intersect the mask.) ++ * Parameters: World, X, Y, Z, mask, list, colliding entity ++ */ ++ public void addCollisionBoxesToList(World par1World, int par2, int par3, int par4, AxisAlignedBB par5AxisAlignedBB, List par6List, Entity par7Entity) { ++ this.setBlockBounds(0.4375F, 0.0F, 0.4375F, 0.5625F, 0.875F, 0.5625F); ++ super.addCollisionBoxesToList(par1World, par2, par3, par4, par5AxisAlignedBB, par6List, par7Entity); + this.setBlockBoundsForItemRender(); +- super.addCollisionBoxesToList(var1, var2, var3, var4, var5, var6, var7); ++ super.addCollisionBoxesToList(par1World, par2, par3, par4, par5AxisAlignedBB, par6List, par7Entity); + } + ++ /** ++ * Sets the block's bounds for rendering it as an item ++ */ + public void setBlockBoundsForItemRender() { +- this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 2.0F / 16.0F, 1.0F); ++ this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.125F, 1.0F); + } + +- public boolean onBlockActivated(World var1, int var2, int var3, int var4, EntityPlayer var5, int var6, float var7, float var8, float var9) { +- if(var1.isRemote) { ++ /** ++ * Called upon block activation (right click on the block.) ++ */ ++ public boolean onBlockActivated(World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer, int par6, float par7, float par8, float par9) { ++ if (par1World.isRemote) { + return true; + } else { +- TileEntityBrewingStand var10 = (TileEntityBrewingStand)var1.getBlockTileEntity(var2, var3, var4); +- if(var10 != null) { +- var5.displayGUIBrewingStand(var10); ++ TileEntityBrewingStand var10 = (TileEntityBrewingStand)par1World.getBlockTileEntity(par2, par3, par4); ++ ++ if (var10 != null) { ++ par5EntityPlayer.displayGUIBrewingStand(var10); + } + + return true; + } + } + +- public void onBlockPlacedBy(World var1, int var2, int var3, int var4, EntityLivingBase var5, ItemStack var6) { +- if(var6.hasDisplayName()) { +- ((TileEntityBrewingStand)var1.getBlockTileEntity(var2, var3, var4)).func_94131_a(var6.getDisplayName()); ++ /** ++ * Called when the block is placed in the world. ++ */ ++ public void onBlockPlacedBy(World par1World, int par2, int par3, int par4, EntityLivingBase par5EntityLivingBase, ItemStack par6ItemStack) { ++ if (par6ItemStack.hasDisplayName()) { ++ ((TileEntityBrewingStand)par1World.getBlockTileEntity(par2, par3, par4)).func_94131_a(par6ItemStack.getDisplayName()); + } +- +- } +- +- public void randomDisplayTick(World var1, int var2, int var3, int var4, Random var5) { +- double var6 = (double)((float)var2 + 0.4F + var5.nextFloat() * 0.2F); +- double var8 = (double)((float)var3 + 0.7F + var5.nextFloat() * 0.3F); +- double var10 = (double)((float)var4 + 0.4F + var5.nextFloat() * 0.2F); +- var1.spawnParticle("smoke", var6, var8, var10, 0.0D, 0.0D, 0.0D); +- } +- +- public void breakBlock(World var1, int var2, int var3, int var4, int var5, int var6) { +- TileEntity var7 = var1.getBlockTileEntity(var2, var3, var4); +- if(var7 instanceof TileEntityBrewingStand) { ++ } ++ ++ /** ++ * A randomly called display update to be able to add particles or other items for display ++ */ ++ public void randomDisplayTick(World par1World, int par2, int par3, int par4, Random par5Random) { ++ double var6 = (double)((float)par2 + 0.4F + par5Random.nextFloat() * 0.2F); ++ double var8 = (double)((float)par3 + 0.7F + par5Random.nextFloat() * 0.3F); ++ double var10 = (double)((float)par4 + 0.4F + par5Random.nextFloat() * 0.2F); ++ par1World.spawnParticle("smoke", var6, var8, var10, 0.0D, 0.0D, 0.0D); ++ } ++ ++ /** ++ * Called on server worlds only when the block has been replaced by a different block ID, or the same block with a ++ * different metadata value, but before the new metadata value is set. Args: World, x, y, z, old block ID, old metadata ++ */ ++ public void breakBlock(World par1World, int par2, int par3, int par4, int par5, int par6) { ++ TileEntity var7 = par1World.getBlockTileEntity(par2, par3, par4); ++ ++ if (var7 instanceof TileEntityBrewingStand) { + TileEntityBrewingStand var8 = (TileEntityBrewingStand)var7; + +- for(int var9 = 0; var9 < var8.getSizeInventory(); ++var9) { ++ for (int var9 = 0; var9 < var8.getSizeInventory(); ++var9) { + ItemStack var10 = var8.getStackInSlot(var9); +- if(var10 != null) { +- float var11 = this.a.nextFloat() * 0.8F + 0.1F; +- float var12 = this.a.nextFloat() * 0.8F + 0.1F; +- float var13 = this.a.nextFloat() * 0.8F + 0.1F; +- +- while(var10.stackSize > 0) { +- int var14 = this.a.nextInt(21) + 10; +- if(var14 > var10.stackSize) { ++ ++ if (var10 != null) { ++ float var11 = this.rand.nextFloat() * 0.8F + 0.1F; ++ float var12 = this.rand.nextFloat() * 0.8F + 0.1F; ++ float var13 = this.rand.nextFloat() * 0.8F + 0.1F; ++ ++ while (var10.stackSize > 0) { ++ int var14 = this.rand.nextInt(21) + 10; ++ ++ if (var14 > var10.stackSize) { + var14 = var10.stackSize; + } + + var10.stackSize -= var14; +- EntityItem var15 = new EntityItem(var1, (double)((float)var2 + var11), (double)((float)var3 + var12), (double)((float)var4 + var13), new ItemStack(var10.itemID, var14, var10.getItemDamage())); ++ EntityItem var15 = new EntityItem(par1World, (double)((float)par2 + var11), (double)((float)par3 + var12), (double)((float)par4 + var13), new ItemStack(var10.itemID, var14, var10.getItemDamage())); + float var16 = 0.05F; +- var15.motionX = (double)((float)this.a.nextGaussian() * var16); +- var15.motionY = (double)((float)this.a.nextGaussian() * var16 + 0.2F); +- var15.motionZ = (double)((float)this.a.nextGaussian() * var16); +- var1.spawnEntityInWorld(var15); ++ var15.motionX = (double)((float)this.rand.nextGaussian() * var16); ++ var15.motionY = (double)((float)this.rand.nextGaussian() * var16 + 0.2F); ++ var15.motionZ = (double)((float)this.rand.nextGaussian() * var16); ++ par1World.spawnEntityInWorld(var15); + } + } + } + } + +- super.breakBlock(var1, var2, var3, var4, var5, var6); +- } +- +- public int idDropped(int var1, Random var2, int var3) { +- return Item.brewingStand.itemID; +- } +- +- public int idPicked(World var1, int var2, int var3, int var4) { +- return Item.brewingStand.itemID; +- } +- ++ super.breakBlock(par1World, par2, par3, par4, par5, par6); ++ } ++ ++ /** ++ * Returns the ID of the items to drop on destruction. ++ */ ++ public int idDropped(int par1, Random par2Random, int par3) { ++ return Item.brewingStand.itemID; ++ } ++ ++ /** ++ * only called by clickMiddleMouseButton , and passed to inventory.setCurrentItem (along with isCreative) ++ */ ++ public int idPicked(World par1World, int par2, int par3, int par4) { ++ return Item.brewingStand.itemID; ++ } ++ ++ /** ++ * If this returns true, then comparators facing away from this block will use the value from ++ * getComparatorInputOverride instead of the actual redstone signal strength. ++ */ + public boolean hasComparatorInputOverride() { + return true; + } + +- public int getComparatorInputOverride(World var1, int var2, int var3, int var4, int var5) { +- return Container.calcRedstoneFromInventory((IInventory)var1.getBlockTileEntity(var2, var3, var4)); ++ /** ++ * If hasComparatorInputOverride returns true, the return value from this is used instead of the redstone signal ++ * strength when this block inputs to a comparator. ++ */ ++ public int getComparatorInputOverride(World par1World, int par2, int par3, int par4, int par5) { ++ return Container.calcRedstoneFromInventory((IInventory)par1World.getBlockTileEntity(par2, par3, par4)); + } + +- public void registerIcons(IconRegister var1) { +- super.registerIcons(var1); +- this.theIcon = var1.registerIcon(this.getTextureName() + "_base"); ++ /** ++ * When this method is called, your block should register all the icons it needs with the given IconRegister. This is ++ * the only chance you get to register icons. ++ */ ++ public void registerIcons(IconRegister par1IconRegister) { ++ super.registerIcons(par1IconRegister); ++ this.theIcon = par1IconRegister.registerIcon(this.getTextureName() + "_base"); + } + + public Icon getBrewingStandIcon() { diff --git a/patches/net/minecraft/src/BlockButton.java.patch b/patches/net/minecraft/src/BlockButton.java.patch new file mode 100644 index 0000000..a67d519 --- /dev/null +++ b/patches/net/minecraft/src/BlockButton.java.patch @@ -0,0 +1,478 @@ +--- net/minecraft/src/BlockButton.java ++++ net/minecraft/src/BlockButton.java +@@ -4,252 +4,326 @@ + import java.util.Random; + + public abstract class BlockButton extends Block { ++ ++ /** Whether this button is sensible to arrows, used by wooden buttons. */ + private final boolean sensible; + +- protected BlockButton(int var1, boolean var2) { +- super(var1, Material.circuits); ++ protected BlockButton(int par1, boolean par2) { ++ super(par1, Material.circuits); + this.setTickRandomly(true); + this.setCreativeTab(CreativeTabs.tabRedstone); +- this.sensible = var2; ++ this.sensible = par2; + } + +- public AxisAlignedBB getCollisionBoundingBoxFromPool(World var1, int var2, int var3, int var4) { ++ /** ++ * Returns a bounding box from the pool of bounding boxes (this means this box can change after the pool has been ++ * cleared to be reused) ++ */ ++ public AxisAlignedBB getCollisionBoundingBoxFromPool(World par1World, int par2, int par3, int par4) { + return null; + } + +- public int tickRate(World var1) { ++ /** ++ * How many world ticks before ticking ++ */ ++ public int tickRate(World par1World) { + return this.sensible ? 30 : 20; + } + ++ /** ++ * Is this block (a) opaque and (b) a full 1m cube? This determines whether or not to render the shared face of two ++ * adjacent blocks and also whether the player can attach torches, redstone wire, etc to this block. ++ */ + public boolean isOpaqueCube() { + return false; + } + ++ /** ++ * If this block doesn't render as an ordinary block it will return False (examples: signs, buttons, stairs, etc) ++ */ + public boolean renderAsNormalBlock() { + return false; + } + +- public boolean canPlaceBlockOnSide(World var1, int var2, int var3, int var4, int var5) { +- return var5 == 2 && var1.isBlockNormalCube(var2, var3, var4 + 1) ? true : (var5 == 3 && var1.isBlockNormalCube(var2, var3, var4 - 1) ? true : (var5 == 4 && var1.isBlockNormalCube(var2 + 1, var3, var4) ? true : var5 == 5 && var1.isBlockNormalCube(var2 - 1, var3, var4))); +- } +- +- public boolean canPlaceBlockAt(World var1, int var2, int var3, int var4) { +- return var1.isBlockNormalCube(var2 - 1, var3, var4) ? true : (var1.isBlockNormalCube(var2 + 1, var3, var4) ? true : (var1.isBlockNormalCube(var2, var3, var4 - 1) ? true : var1.isBlockNormalCube(var2, var3, var4 + 1))); +- } +- +- public int onBlockPlaced(World var1, int var2, int var3, int var4, int var5, float var6, float var7, float var8, int var9) { +- int var10 = var1.getBlockMetadata(var2, var3, var4); ++ /** ++ * checks to see if you can place this block can be placed on that side of a block: BlockLever overrides ++ */ ++ public boolean canPlaceBlockOnSide(World par1World, int par2, int par3, int par4, int par5) { ++ return par5 == 2 && par1World.isBlockNormalCube(par2, par3, par4 + 1) ? true : (par5 == 3 && par1World.isBlockNormalCube(par2, par3, par4 - 1) ? true : (par5 == 4 && par1World.isBlockNormalCube(par2 + 1, par3, par4) ? true : par5 == 5 && par1World.isBlockNormalCube(par2 - 1, par3, par4))); ++ } ++ ++ /** ++ * Checks to see if its valid to put this block at the specified coordinates. Args: world, x, y, z ++ */ ++ public boolean canPlaceBlockAt(World par1World, int par2, int par3, int par4) { ++ return par1World.isBlockNormalCube(par2 - 1, par3, par4) ? true : (par1World.isBlockNormalCube(par2 + 1, par3, par4) ? true : (par1World.isBlockNormalCube(par2, par3, par4 - 1) ? true : par1World.isBlockNormalCube(par2, par3, par4 + 1))); ++ } ++ ++ /** ++ * Called when a block is placed using its ItemBlock. Args: World, X, Y, Z, side, hitX, hitY, hitZ, block metadata ++ */ ++ public int onBlockPlaced(World par1World, int par2, int par3, int par4, int par5, float par6, float par7, float par8, int par9) { ++ int var10 = par1World.getBlockMetadata(par2, par3, par4); + int var11 = var10 & 8; + var10 &= 7; +- if(var5 == 2 && var1.isBlockNormalCube(var2, var3, var4 + 1)) { ++ ++ if (par5 == 2 && par1World.isBlockNormalCube(par2, par3, par4 + 1)) { + var10 = 4; +- } else if(var5 == 3 && var1.isBlockNormalCube(var2, var3, var4 - 1)) { ++ } else if (par5 == 3 && par1World.isBlockNormalCube(par2, par3, par4 - 1)) { + var10 = 3; +- } else if(var5 == 4 && var1.isBlockNormalCube(var2 + 1, var3, var4)) { ++ } else if (par5 == 4 && par1World.isBlockNormalCube(par2 + 1, par3, par4)) { + var10 = 2; +- } else if(var5 == 5 && var1.isBlockNormalCube(var2 - 1, var3, var4)) { ++ } else if (par5 == 5 && par1World.isBlockNormalCube(par2 - 1, par3, par4)) { + var10 = 1; + } else { +- var10 = this.getOrientation(var1, var2, var3, var4); ++ var10 = this.getOrientation(par1World, par2, par3, par4); + } + + return var10 + var11; + } + +- private int getOrientation(World var1, int var2, int var3, int var4) { +- return var1.isBlockNormalCube(var2 - 1, var3, var4) ? 1 : (var1.isBlockNormalCube(var2 + 1, var3, var4) ? 2 : (var1.isBlockNormalCube(var2, var3, var4 - 1) ? 3 : (var1.isBlockNormalCube(var2, var3, var4 + 1) ? 4 : 1))); ++ /** ++ * Get side which this button is facing. ++ */ ++ private int getOrientation(World par1World, int par2, int par3, int par4) { ++ return par1World.isBlockNormalCube(par2 - 1, par3, par4) ? 1 : (par1World.isBlockNormalCube(par2 + 1, par3, par4) ? 2 : (par1World.isBlockNormalCube(par2, par3, par4 - 1) ? 3 : (par1World.isBlockNormalCube(par2, par3, par4 + 1) ? 4 : 1))); + } + +- public void onNeighborBlockChange(World var1, int var2, int var3, int var4, int var5) { +- if(this.redundantCanPlaceBlockAt(var1, var2, var3, var4)) { +- int var6 = var1.getBlockMetadata(var2, var3, var4) & 7; ++ /** ++ * Lets the block know when one of its neighbor changes. Doesn't know which neighbor changed (coordinates passed are ++ * their own) Args: x, y, z, neighbor blockID ++ */ ++ public void onNeighborBlockChange(World par1World, int par2, int par3, int par4, int par5) { ++ if (this.redundantCanPlaceBlockAt(par1World, par2, par3, par4)) { ++ int var6 = par1World.getBlockMetadata(par2, par3, par4) & 7; + boolean var7 = false; +- if(!var1.isBlockNormalCube(var2 - 1, var3, var4) && var6 == 1) { +- var7 = true; +- } +- +- if(!var1.isBlockNormalCube(var2 + 1, var3, var4) && var6 == 2) { +- var7 = true; +- } +- +- if(!var1.isBlockNormalCube(var2, var3, var4 - 1) && var6 == 3) { +- var7 = true; +- } +- +- if(!var1.isBlockNormalCube(var2, var3, var4 + 1) && var6 == 4) { +- var7 = true; +- } +- +- if(var7) { +- this.dropBlockAsItem(var1, var2, var3, var4, var1.getBlockMetadata(var2, var3, var4), 0); +- var1.setBlockToAir(var2, var3, var4); ++ ++ if (!par1World.isBlockNormalCube(par2 - 1, par3, par4) && var6 == 1) { ++ var7 = true; ++ } ++ ++ if (!par1World.isBlockNormalCube(par2 + 1, par3, par4) && var6 == 2) { ++ var7 = true; ++ } ++ ++ if (!par1World.isBlockNormalCube(par2, par3, par4 - 1) && var6 == 3) { ++ var7 = true; ++ } ++ ++ if (!par1World.isBlockNormalCube(par2, par3, par4 + 1) && var6 == 4) { ++ var7 = true; ++ } ++ ++ if (var7) { ++ this.dropBlockAsItem(par1World, par2, par3, par4, par1World.getBlockMetadata(par2, par3, par4), 0); ++ par1World.setBlockToAir(par2, par3, par4); + } + } +- + } + +- private boolean redundantCanPlaceBlockAt(World var1, int var2, int var3, int var4) { +- if(!this.canPlaceBlockAt(var1, var2, var3, var4)) { +- this.dropBlockAsItem(var1, var2, var3, var4, var1.getBlockMetadata(var2, var3, var4), 0); +- var1.setBlockToAir(var2, var3, var4); ++ /** ++ * This method is redundant, check it out... ++ */ ++ private boolean redundantCanPlaceBlockAt(World par1World, int par2, int par3, int par4) { ++ if (!this.canPlaceBlockAt(par1World, par2, par3, par4)) { ++ this.dropBlockAsItem(par1World, par2, par3, par4, par1World.getBlockMetadata(par2, par3, par4), 0); ++ par1World.setBlockToAir(par2, par3, par4); + return false; + } else { + return true; + } + } + +- public void setBlockBoundsBasedOnState(IBlockAccess var1, int var2, int var3, int var4) { +- int var5 = var1.getBlockMetadata(var2, var3, var4); ++ /** ++ * Updates the blocks bounds based on its current state. Args: world, x, y, z ++ */ ++ public void setBlockBoundsBasedOnState(IBlockAccess par1IBlockAccess, int par2, int par3, int par4) { ++ int var5 = par1IBlockAccess.getBlockMetadata(par2, par3, par4); + this.func_82534_e(var5); + } + +- private void func_82534_e(int var1) { +- int var2 = var1 & 7; +- boolean var3 = (var1 & 8) > 0; +- float var4 = 6.0F / 16.0F; +- float var5 = 10.0F / 16.0F; +- float var6 = 3.0F / 16.0F; +- float var7 = 2.0F / 16.0F; +- if(var3) { +- var7 = 1.0F / 16.0F; ++ private void func_82534_e(int par1) { ++ int var2 = par1 & 7; ++ boolean var3 = (par1 & 8) > 0; ++ float var4 = 0.375F; ++ float var5 = 0.625F; ++ float var6 = 0.1875F; ++ float var7 = 0.125F; ++ ++ if (var3) { ++ var7 = 0.0625F; + } + +- if(var2 == 1) { ++ if (var2 == 1) { + this.setBlockBounds(0.0F, var4, 0.5F - var6, var7, var5, 0.5F + var6); +- } else if(var2 == 2) { ++ } else if (var2 == 2) { + this.setBlockBounds(1.0F - var7, var4, 0.5F - var6, 1.0F, var5, 0.5F + var6); +- } else if(var2 == 3) { ++ } else if (var2 == 3) { + this.setBlockBounds(0.5F - var6, var4, 0.0F, 0.5F + var6, var5, var7); +- } else if(var2 == 4) { ++ } else if (var2 == 4) { + this.setBlockBounds(0.5F - var6, var4, 1.0F - var7, 0.5F + var6, var5, 1.0F); + } +- +- } +- +- public void onBlockClicked(World var1, int var2, int var3, int var4, EntityPlayer var5) { +- } +- +- public boolean onBlockActivated(World var1, int var2, int var3, int var4, EntityPlayer var5, int var6, float var7, float var8, float var9) { +- int var10 = var1.getBlockMetadata(var2, var3, var4); ++ } ++ ++ /** ++ * Called when the block is clicked by a player. Args: x, y, z, entityPlayer ++ */ ++ public void onBlockClicked(World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer) {} ++ ++ /** ++ * Called upon block activation (right click on the block.) ++ */ ++ public boolean onBlockActivated(World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer, int par6, float par7, float par8, float par9) { ++ int var10 = par1World.getBlockMetadata(par2, par3, par4); + int var11 = var10 & 7; + int var12 = 8 - (var10 & 8); +- if(var12 == 0) { ++ ++ if (var12 == 0) { + return true; + } else { +- var1.setBlockMetadata(var2, var3, var4, var11 + var12, 3); +- var1.markBlockRangeForRenderUpdate(var2, var3, var4, var2, var3, var4); +- var1.playSoundEffect((double)var2 + 0.5D, (double)var3 + 0.5D, (double)var4 + 0.5D, "random.click", 0.3F, 0.6F); +- this.func_82536_d(var1, var2, var3, var4, var11); +- var1.scheduleBlockUpdate(var2, var3, var4, this.blockID, this.tickRate(var1)); ++ par1World.setBlockMetadataWithNotify(par2, par3, par4, var11 + var12, 3); ++ par1World.markBlockRangeForRenderUpdate(par2, par3, par4, par2, par3, par4); ++ par1World.playSoundEffect((double)par2 + 0.5D, (double)par3 + 0.5D, (double)par4 + 0.5D, "random.click", 0.3F, 0.6F); ++ this.func_82536_d(par1World, par2, par3, par4, var11); ++ par1World.scheduleBlockUpdate(par2, par3, par4, this.blockID, this.tickRate(par1World)); + return true; + } + } + +- public void breakBlock(World var1, int var2, int var3, int var4, int var5, int var6) { +- if((var6 & 8) > 0) { +- int var7 = var6 & 7; +- this.func_82536_d(var1, var2, var3, var4, var7); ++ /** ++ * Called on server worlds only when the block has been replaced by a different block ID, or the same block with a ++ * different metadata value, but before the new metadata value is set. Args: World, x, y, z, old block ID, old metadata ++ */ ++ public void breakBlock(World par1World, int par2, int par3, int par4, int par5, int par6) { ++ if ((par6 & 8) > 0) { ++ int var7 = par6 & 7; ++ this.func_82536_d(par1World, par2, par3, par4, var7); + } + +- super.breakBlock(var1, var2, var3, var4, var5, var6); +- } +- +- public int isProvidingWeakPower(IBlockAccess var1, int var2, int var3, int var4, int var5) { +- return (var1.getBlockMetadata(var2, var3, var4) & 8) > 0 ? 15 : 0; +- } +- +- public int isProvidingStrongPower(IBlockAccess var1, int var2, int var3, int var4, int var5) { +- int var6 = var1.getBlockMetadata(var2, var3, var4); +- if((var6 & 8) == 0) { ++ super.breakBlock(par1World, par2, par3, par4, par5, par6); ++ } ++ ++ /** ++ * Returns true if the block is emitting indirect/weak redstone power on the specified side. If isBlockNormalCube ++ * returns true, standard redstone propagation rules will apply instead and this will not be called. Args: World, X, Y, ++ * Z, side. Note that the side is reversed - eg it is 1 (up) when checking the bottom of the block. ++ */ ++ public int isProvidingWeakPower(IBlockAccess par1IBlockAccess, int par2, int par3, int par4, int par5) { ++ return (par1IBlockAccess.getBlockMetadata(par2, par3, par4) & 8) > 0 ? 15 : 0; ++ } ++ ++ /** ++ * Returns true if the block is emitting direct/strong redstone power on the specified side. Args: World, X, Y, Z, ++ * side. Note that the side is reversed - eg it is 1 (up) when checking the bottom of the block. ++ */ ++ public int isProvidingStrongPower(IBlockAccess par1IBlockAccess, int par2, int par3, int par4, int par5) { ++ int var6 = par1IBlockAccess.getBlockMetadata(par2, par3, par4); ++ ++ if ((var6 & 8) == 0) { + return 0; + } else { + int var7 = var6 & 7; +- return var7 == 5 && var5 == 1 ? 15 : (var7 == 4 && var5 == 2 ? 15 : (var7 == 3 && var5 == 3 ? 15 : (var7 == 2 && var5 == 4 ? 15 : (var7 == 1 && var5 == 5 ? 15 : 0)))); ++ return var7 == 5 && par5 == 1 ? 15 : (var7 == 4 && par5 == 2 ? 15 : (var7 == 3 && par5 == 3 ? 15 : (var7 == 2 && par5 == 4 ? 15 : (var7 == 1 && par5 == 5 ? 15 : 0)))); + } + } + ++ /** ++ * Can this block provide power. Only wire currently seems to have this change based on its state. ++ */ + public boolean canProvidePower() { + return true; + } + +- public void updateTick(World var1, int var2, int var3, int var4, Random var5) { +- if(!var1.isRemote) { +- int var6 = var1.getBlockMetadata(var2, var3, var4); +- if((var6 & 8) != 0) { +- if(this.sensible) { +- this.func_82535_o(var1, var2, var3, var4); ++ /** ++ * Ticks the block if it's been scheduled ++ */ ++ public void updateTick(World par1World, int par2, int par3, int par4, Random par5Random) { ++ if (!par1World.isRemote) { ++ int var6 = par1World.getBlockMetadata(par2, par3, par4); ++ ++ if ((var6 & 8) != 0) { ++ if (this.sensible) { ++ this.func_82535_o(par1World, par2, par3, par4); + } else { +- var1.setBlockMetadata(var2, var3, var4, var6 & 7, 3); ++ par1World.setBlockMetadataWithNotify(par2, par3, par4, var6 & 7, 3); + int var7 = var6 & 7; +- this.func_82536_d(var1, var2, var3, var4, var7); +- var1.playSoundEffect((double)var2 + 0.5D, (double)var3 + 0.5D, (double)var4 + 0.5D, "random.click", 0.3F, 0.5F); +- var1.markBlockRangeForRenderUpdate(var2, var3, var4, var2, var3, var4); ++ this.func_82536_d(par1World, par2, par3, par4, var7); ++ par1World.playSoundEffect((double)par2 + 0.5D, (double)par3 + 0.5D, (double)par4 + 0.5D, "random.click", 0.3F, 0.5F); ++ par1World.markBlockRangeForRenderUpdate(par2, par3, par4, par2, par3, par4); + } +- + } + } + } + ++ /** ++ * Sets the block's bounds for rendering it as an item ++ */ + public void setBlockBoundsForItemRender() { +- float var1 = 3.0F / 16.0F; +- float var2 = 2.0F / 16.0F; +- float var3 = 2.0F / 16.0F; ++ float var1 = 0.1875F; ++ float var2 = 0.125F; ++ float var3 = 0.125F; + this.setBlockBounds(0.5F - var1, 0.5F - var2, 0.5F - var3, 0.5F + var1, 0.5F + var2, 0.5F + var3); + } + +- public void onEntityCollidedWithBlock(World var1, int var2, int var3, int var4, Entity var5) { +- if(!var1.isRemote) { +- if(this.sensible) { +- if((var1.getBlockMetadata(var2, var3, var4) & 8) == 0) { +- this.func_82535_o(var1, var2, var3, var4); ++ /** ++ * Triggered whenever an entity collides with this block (enters into the block). Args: world, x, y, z, entity ++ */ ++ public void onEntityCollidedWithBlock(World par1World, int par2, int par3, int par4, Entity par5Entity) { ++ if (!par1World.isRemote) { ++ if (this.sensible) { ++ if ((par1World.getBlockMetadata(par2, par3, par4) & 8) == 0) { ++ this.func_82535_o(par1World, par2, par3, par4); + } + } + } + } + +- private void func_82535_o(World var1, int var2, int var3, int var4) { +- int var5 = var1.getBlockMetadata(var2, var3, var4); ++ private void func_82535_o(World par1World, int par2, int par3, int par4) { ++ int var5 = par1World.getBlockMetadata(par2, par3, par4); + int var6 = var5 & 7; + boolean var7 = (var5 & 8) != 0; + this.func_82534_e(var5); +- List var9 = var1.getEntitiesWithinAABB(EntityArrow.class, AxisAlignedBB.getAABBPool().getAABB((double)var2 + this.minX, (double)var3 + this.minY, (double)var4 + this.minZ, (double)var2 + this.maxX, (double)var3 + this.maxY, (double)var4 + this.maxZ)); ++ List var9 = par1World.getEntitiesWithinAABB(EntityArrow.class, AxisAlignedBB.getAABBPool().getAABB((double)par2 + this.minX, (double)par3 + this.minY, (double)par4 + this.minZ, (double)par2 + this.maxX, (double)par3 + this.maxY, (double)par4 + this.maxZ)); + boolean var8 = !var9.isEmpty(); +- if(var8 && !var7) { +- var1.setBlockMetadata(var2, var3, var4, var6 | 8, 3); +- this.func_82536_d(var1, var2, var3, var4, var6); +- var1.markBlockRangeForRenderUpdate(var2, var3, var4, var2, var3, var4); +- var1.playSoundEffect((double)var2 + 0.5D, (double)var3 + 0.5D, (double)var4 + 0.5D, "random.click", 0.3F, 0.6F); +- } +- +- if(!var8 && var7) { +- var1.setBlockMetadata(var2, var3, var4, var6, 3); +- this.func_82536_d(var1, var2, var3, var4, var6); +- var1.markBlockRangeForRenderUpdate(var2, var3, var4, var2, var3, var4); +- var1.playSoundEffect((double)var2 + 0.5D, (double)var3 + 0.5D, (double)var4 + 0.5D, "random.click", 0.3F, 0.5F); +- } +- +- if(var8) { +- var1.scheduleBlockUpdate(var2, var3, var4, this.blockID, this.tickRate(var1)); +- } +- ++ ++ if (var8 && !var7) { ++ par1World.setBlockMetadataWithNotify(par2, par3, par4, var6 | 8, 3); ++ this.func_82536_d(par1World, par2, par3, par4, var6); ++ par1World.markBlockRangeForRenderUpdate(par2, par3, par4, par2, par3, par4); ++ par1World.playSoundEffect((double)par2 + 0.5D, (double)par3 + 0.5D, (double)par4 + 0.5D, "random.click", 0.3F, 0.6F); ++ } ++ ++ if (!var8 && var7) { ++ par1World.setBlockMetadataWithNotify(par2, par3, par4, var6, 3); ++ this.func_82536_d(par1World, par2, par3, par4, var6); ++ par1World.markBlockRangeForRenderUpdate(par2, par3, par4, par2, par3, par4); ++ par1World.playSoundEffect((double)par2 + 0.5D, (double)par3 + 0.5D, (double)par4 + 0.5D, "random.click", 0.3F, 0.5F); ++ } ++ ++ if (var8) { ++ par1World.scheduleBlockUpdate(par2, par3, par4, this.blockID, this.tickRate(par1World)); ++ } + } + +- private void func_82536_d(World var1, int var2, int var3, int var4, int var5) { +- var1.notifyBlocksOfNeighborChange(var2, var3, var4, this.blockID); +- if(var5 == 1) { +- var1.notifyBlocksOfNeighborChange(var2 - 1, var3, var4, this.blockID); +- } else if(var5 == 2) { +- var1.notifyBlocksOfNeighborChange(var2 + 1, var3, var4, this.blockID); +- } else if(var5 == 3) { +- var1.notifyBlocksOfNeighborChange(var2, var3, var4 - 1, this.blockID); +- } else if(var5 == 4) { +- var1.notifyBlocksOfNeighborChange(var2, var3, var4 + 1, this.blockID); ++ private void func_82536_d(World par1World, int par2, int par3, int par4, int par5) { ++ par1World.notifyBlocksOfNeighborChange(par2, par3, par4, this.blockID); ++ ++ if (par5 == 1) { ++ par1World.notifyBlocksOfNeighborChange(par2 - 1, par3, par4, this.blockID); ++ } else if (par5 == 2) { ++ par1World.notifyBlocksOfNeighborChange(par2 + 1, par3, par4, this.blockID); ++ } else if (par5 == 3) { ++ par1World.notifyBlocksOfNeighborChange(par2, par3, par4 - 1, this.blockID); ++ } else if (par5 == 4) { ++ par1World.notifyBlocksOfNeighborChange(par2, par3, par4 + 1, this.blockID); + } else { +- var1.notifyBlocksOfNeighborChange(var2, var3 - 1, var4, this.blockID); ++ par1World.notifyBlocksOfNeighborChange(par2, par3 - 1, par4, this.blockID); + } +- +- } +- +- public void registerIcons(IconRegister var1) { +- } ++ } ++ ++ /** ++ * When this method is called, your block should register all the icons it needs with the given IconRegister. This is ++ * the only chance you get to register icons. ++ */ ++ public void registerIcons(IconRegister par1IconRegister) {} + } diff --git a/patches/net/minecraft/src/BlockButtonStone.java.patch b/patches/net/minecraft/src/BlockButtonStone.java.patch new file mode 100644 index 0000000..caaadd7 --- /dev/null +++ b/patches/net/minecraft/src/BlockButtonStone.java.patch @@ -0,0 +1,20 @@ +--- net/minecraft/src/BlockButtonStone.java ++++ net/minecraft/src/BlockButtonStone.java +@@ -1,11 +1,14 @@ + package net.minecraft.src; + + public class BlockButtonStone extends BlockButton { +- protected BlockButtonStone(int var1) { +- super(var1, false); ++ protected BlockButtonStone(int par1) { ++ super(par1, false); + } + +- public Icon getIcon(int var1, int var2) { ++ /** ++ * From the specified side and block metadata retrieves the blocks texture. Args: side, metadata ++ */ ++ public Icon getIcon(int par1, int par2) { + return Block.stone.getBlockTextureFromSide(1); + } + } diff --git a/patches/net/minecraft/src/BlockButtonWood.java.patch b/patches/net/minecraft/src/BlockButtonWood.java.patch new file mode 100644 index 0000000..9080c88 --- /dev/null +++ b/patches/net/minecraft/src/BlockButtonWood.java.patch @@ -0,0 +1,20 @@ +--- net/minecraft/src/BlockButtonWood.java ++++ net/minecraft/src/BlockButtonWood.java +@@ -1,11 +1,14 @@ + package net.minecraft.src; + + public class BlockButtonWood extends BlockButton { +- protected BlockButtonWood(int var1) { +- super(var1, true); ++ protected BlockButtonWood(int par1) { ++ super(par1, true); + } + +- public Icon getIcon(int var1, int var2) { ++ /** ++ * From the specified side and block metadata retrieves the blocks texture. Args: side, metadata ++ */ ++ public Icon getIcon(int par1, int par2) { + return Block.planks.getBlockTextureFromSide(1); + } + } diff --git a/patches/net/minecraft/src/BlockCactus.java.patch b/patches/net/minecraft/src/BlockCactus.java.patch new file mode 100644 index 0000000..d0b4b3e --- /dev/null +++ b/patches/net/minecraft/src/BlockCactus.java.patch @@ -0,0 +1,185 @@ +--- net/minecraft/src/BlockCactus.java ++++ net/minecraft/src/BlockCactus.java +@@ -6,91 +6,132 @@ + private Icon cactusTopIcon; + private Icon cactusBottomIcon; + +- protected BlockCactus(int var1) { +- super(var1, Material.cactus); ++ protected BlockCactus(int par1) { ++ super(par1, Material.cactus); + this.setTickRandomly(true); + this.setCreativeTab(CreativeTabs.tabDecorations); + } + +- public void updateTick(World var1, int var2, int var3, int var4, Random var5) { +- if(var1.isAirBlock(var2, var3 + 1, var4)) { ++ /** ++ * Ticks the block if it's been scheduled ++ */ ++ public void updateTick(World par1World, int par2, int par3, int par4, Random par5Random) { ++ if (par1World.isAirBlock(par2, par3 + 1, par4)) { + int var6; +- for(var6 = 1; var1.getBlockId(var2, var3 - var6, var4) == this.blockID; ++var6) { ++ ++ for (var6 = 1; par1World.getBlockId(par2, par3 - var6, par4) == this.blockID; ++var6) { ++ ; + } + +- if(var6 < 3) { +- int var7 = var1.getBlockMetadata(var2, var3, var4); +- if(var7 == 15) { +- var1.setBlock(var2, var3 + 1, var4, this.blockID); +- var1.setBlockMetadata(var2, var3, var4, 0, 4); +- this.onNeighborBlockChange(var1, var2, var3 + 1, var4, this.blockID); ++ if (var6 < 3) { ++ int var7 = par1World.getBlockMetadata(par2, par3, par4); ++ ++ if (var7 == 15) { ++ par1World.setBlock(par2, par3 + 1, par4, this.blockID); ++ par1World.setBlockMetadataWithNotify(par2, par3, par4, 0, 4); ++ this.onNeighborBlockChange(par1World, par2, par3 + 1, par4, this.blockID); + } else { +- var1.setBlockMetadata(var2, var3, var4, var7 + 1, 4); ++ par1World.setBlockMetadataWithNotify(par2, par3, par4, var7 + 1, 4); + } + } + } +- +- } +- +- public AxisAlignedBB getCollisionBoundingBoxFromPool(World var1, int var2, int var3, int var4) { +- float var5 = 1.0F / 16.0F; +- return AxisAlignedBB.getAABBPool().getAABB((double)((float)var2 + var5), (double)var3, (double)((float)var4 + var5), (double)((float)(var2 + 1) - var5), (double)((float)(var3 + 1) - var5), (double)((float)(var4 + 1) - var5)); +- } +- +- public AxisAlignedBB getSelectedBoundingBoxFromPool(World var1, int var2, int var3, int var4) { +- float var5 = 1.0F / 16.0F; +- return AxisAlignedBB.getAABBPool().getAABB((double)((float)var2 + var5), (double)var3, (double)((float)var4 + var5), (double)((float)(var2 + 1) - var5), (double)(var3 + 1), (double)((float)(var4 + 1) - var5)); +- } +- +- public Icon getIcon(int var1, int var2) { +- return var1 == 1 ? this.cactusTopIcon : (var1 == 0 ? this.cactusBottomIcon : this.blockIcon); +- } +- ++ } ++ ++ /** ++ * Returns a bounding box from the pool of bounding boxes (this means this box can change after the pool has been ++ * cleared to be reused) ++ */ ++ public AxisAlignedBB getCollisionBoundingBoxFromPool(World par1World, int par2, int par3, int par4) { ++ float var5 = 0.0625F; ++ return AxisAlignedBB.getAABBPool().getAABB((double)((float)par2 + var5), (double)par3, (double)((float)par4 + var5), (double)((float)(par2 + 1) - var5), (double)((float)(par3 + 1) - var5), (double)((float)(par4 + 1) - var5)); ++ } ++ ++ /** ++ * Returns the bounding box of the wired rectangular prism to render. ++ */ ++ public AxisAlignedBB getSelectedBoundingBoxFromPool(World par1World, int par2, int par3, int par4) { ++ float var5 = 0.0625F; ++ return AxisAlignedBB.getAABBPool().getAABB((double)((float)par2 + var5), (double)par3, (double)((float)par4 + var5), (double)((float)(par2 + 1) - var5), (double)(par3 + 1), (double)((float)(par4 + 1) - var5)); ++ } ++ ++ /** ++ * From the specified side and block metadata retrieves the blocks texture. Args: side, metadata ++ */ ++ public Icon getIcon(int par1, int par2) { ++ return par1 == 1 ? this.cactusTopIcon : (par1 == 0 ? this.cactusBottomIcon : this.blockIcon); ++ } ++ ++ /** ++ * If this block doesn't render as an ordinary block it will return False (examples: signs, buttons, stairs, etc) ++ */ + public boolean renderAsNormalBlock() { + return false; + } + ++ /** ++ * Is this block (a) opaque and (b) a full 1m cube? This determines whether or not to render the shared face of two ++ * adjacent blocks and also whether the player can attach torches, redstone wire, etc to this block. ++ */ + public boolean isOpaqueCube() { + return false; + } + ++ /** ++ * The type of render function that is called for this block ++ */ + public int getRenderType() { + return 13; + } + +- public boolean canPlaceBlockAt(World var1, int var2, int var3, int var4) { +- return !super.canPlaceBlockAt(var1, var2, var3, var4) ? false : this.canBlockStay(var1, var2, var3, var4); ++ /** ++ * Checks to see if its valid to put this block at the specified coordinates. Args: world, x, y, z ++ */ ++ public boolean canPlaceBlockAt(World par1World, int par2, int par3, int par4) { ++ return !super.canPlaceBlockAt(par1World, par2, par3, par4) ? false : this.canBlockStay(par1World, par2, par3, par4); + } + +- public void onNeighborBlockChange(World var1, int var2, int var3, int var4, int var5) { +- if(!this.canBlockStay(var1, var2, var3, var4)) { +- var1.destroyBlock(var2, var3, var4, true); ++ /** ++ * Lets the block know when one of its neighbor changes. Doesn't know which neighbor changed (coordinates passed are ++ * their own) Args: x, y, z, neighbor blockID ++ */ ++ public void onNeighborBlockChange(World par1World, int par2, int par3, int par4, int par5) { ++ if (!this.canBlockStay(par1World, par2, par3, par4)) { ++ par1World.destroyBlock(par2, par3, par4, true); + } +- + } + +- public boolean canBlockStay(World var1, int var2, int var3, int var4) { +- if(var1.getBlockMaterial(var2 - 1, var3, var4).isSolid()) { +- return false; +- } else if(var1.getBlockMaterial(var2 + 1, var3, var4).isSolid()) { +- return false; +- } else if(var1.getBlockMaterial(var2, var3, var4 - 1).isSolid()) { +- return false; +- } else if(var1.getBlockMaterial(var2, var3, var4 + 1).isSolid()) { ++ /** ++ * Can this block stay at this position. Similar to canPlaceBlockAt except gets checked often with plants. ++ */ ++ public boolean canBlockStay(World par1World, int par2, int par3, int par4) { ++ if (par1World.getBlockMaterial(par2 - 1, par3, par4).isSolid()) { ++ return false; ++ } else if (par1World.getBlockMaterial(par2 + 1, par3, par4).isSolid()) { ++ return false; ++ } else if (par1World.getBlockMaterial(par2, par3, par4 - 1).isSolid()) { ++ return false; ++ } else if (par1World.getBlockMaterial(par2, par3, par4 + 1).isSolid()) { + return false; + } else { +- int var5 = var1.getBlockId(var2, var3 - 1, var4); ++ int var5 = par1World.getBlockId(par2, par3 - 1, par4); + return var5 == Block.cactus.blockID || var5 == Block.sand.blockID; + } + } + +- public void onEntityCollidedWithBlock(World var1, int var2, int var3, int var4, Entity var5) { +- var5.attackEntityFrom(DamageSource.cactus, 1.0F); ++ /** ++ * Triggered whenever an entity collides with this block (enters into the block). Args: world, x, y, z, entity ++ */ ++ public void onEntityCollidedWithBlock(World par1World, int par2, int par3, int par4, Entity par5Entity) { ++ par5Entity.attackEntityFrom(DamageSource.cactus, 1.0F); + } + +- public void registerIcons(IconRegister var1) { +- this.blockIcon = var1.registerIcon(this.getTextureName() + "_side"); +- this.cactusTopIcon = var1.registerIcon(this.getTextureName() + "_top"); +- this.cactusBottomIcon = var1.registerIcon(this.getTextureName() + "_bottom"); ++ /** ++ * When this method is called, your block should register all the icons it needs with the given IconRegister. This is ++ * the only chance you get to register icons. ++ */ ++ public void registerIcons(IconRegister par1IconRegister) { ++ this.blockIcon = par1IconRegister.registerIcon(this.getTextureName() + "_side"); ++ this.cactusTopIcon = par1IconRegister.registerIcon(this.getTextureName() + "_top"); ++ this.cactusBottomIcon = par1IconRegister.registerIcon(this.getTextureName() + "_bottom"); + } + } diff --git a/patches/net/minecraft/src/BlockCake.java.patch b/patches/net/minecraft/src/BlockCake.java.patch new file mode 100644 index 0000000..c934030 --- /dev/null +++ b/patches/net/minecraft/src/BlockCake.java.patch @@ -0,0 +1,233 @@ +--- net/minecraft/src/BlockCake.java ++++ net/minecraft/src/BlockCake.java +@@ -7,106 +7,160 @@ + private Icon cakeBottomIcon; + private Icon field_94382_c; + +- protected BlockCake(int var1) { +- super(var1, Material.cake); ++ protected BlockCake(int par1) { ++ super(par1, Material.cake); + this.setTickRandomly(true); + } + +- public void setBlockBoundsBasedOnState(IBlockAccess var1, int var2, int var3, int var4) { +- int var5 = var1.getBlockMetadata(var2, var3, var4); +- float var6 = 1.0F / 16.0F; ++ /** ++ * Updates the blocks bounds based on its current state. Args: world, x, y, z ++ */ ++ public void setBlockBoundsBasedOnState(IBlockAccess par1IBlockAccess, int par2, int par3, int par4) { ++ int var5 = par1IBlockAccess.getBlockMetadata(par2, par3, par4); ++ float var6 = 0.0625F; + float var7 = (float)(1 + var5 * 2) / 16.0F; + float var8 = 0.5F; + this.setBlockBounds(var7, 0.0F, var6, 1.0F - var6, var8, 1.0F - var6); + } + ++ /** ++ * Sets the block's bounds for rendering it as an item ++ */ + public void setBlockBoundsForItemRender() { +- float var1 = 1.0F / 16.0F; ++ float var1 = 0.0625F; + float var2 = 0.5F; + this.setBlockBounds(var1, 0.0F, var1, 1.0F - var1, var2, 1.0F - var1); + } + +- public AxisAlignedBB getCollisionBoundingBoxFromPool(World var1, int var2, int var3, int var4) { +- int var5 = var1.getBlockMetadata(var2, var3, var4); +- float var6 = 1.0F / 16.0F; +- float var7 = (float)(1 + var5 * 2) / 16.0F; +- float var8 = 0.5F; +- return AxisAlignedBB.getAABBPool().getAABB((double)((float)var2 + var7), (double)var3, (double)((float)var4 + var6), (double)((float)(var2 + 1) - var6), (double)((float)var3 + var8 - var6), (double)((float)(var4 + 1) - var6)); +- } +- +- public AxisAlignedBB getSelectedBoundingBoxFromPool(World var1, int var2, int var3, int var4) { +- int var5 = var1.getBlockMetadata(var2, var3, var4); +- float var6 = 1.0F / 16.0F; +- float var7 = (float)(1 + var5 * 2) / 16.0F; +- float var8 = 0.5F; +- return AxisAlignedBB.getAABBPool().getAABB((double)((float)var2 + var7), (double)var3, (double)((float)var4 + var6), (double)((float)(var2 + 1) - var6), (double)((float)var3 + var8), (double)((float)(var4 + 1) - var6)); +- } +- +- public Icon getIcon(int var1, int var2) { +- return var1 == 1 ? this.cakeTopIcon : (var1 == 0 ? this.cakeBottomIcon : (var2 > 0 && var1 == 4 ? this.field_94382_c : this.blockIcon)); +- } +- +- public void registerIcons(IconRegister var1) { +- this.blockIcon = var1.registerIcon(this.getTextureName() + "_side"); +- this.field_94382_c = var1.registerIcon(this.getTextureName() + "_inner"); +- this.cakeTopIcon = var1.registerIcon(this.getTextureName() + "_top"); +- this.cakeBottomIcon = var1.registerIcon(this.getTextureName() + "_bottom"); +- } +- ++ /** ++ * Returns a bounding box from the pool of bounding boxes (this means this box can change after the pool has been ++ * cleared to be reused) ++ */ ++ public AxisAlignedBB getCollisionBoundingBoxFromPool(World par1World, int par2, int par3, int par4) { ++ int var5 = par1World.getBlockMetadata(par2, par3, par4); ++ float var6 = 0.0625F; ++ float var7 = (float)(1 + var5 * 2) / 16.0F; ++ float var8 = 0.5F; ++ return AxisAlignedBB.getAABBPool().getAABB((double)((float)par2 + var7), (double)par3, (double)((float)par4 + var6), (double)((float)(par2 + 1) - var6), (double)((float)par3 + var8 - var6), (double)((float)(par4 + 1) - var6)); ++ } ++ ++ /** ++ * Returns the bounding box of the wired rectangular prism to render. ++ */ ++ public AxisAlignedBB getSelectedBoundingBoxFromPool(World par1World, int par2, int par3, int par4) { ++ int var5 = par1World.getBlockMetadata(par2, par3, par4); ++ float var6 = 0.0625F; ++ float var7 = (float)(1 + var5 * 2) / 16.0F; ++ float var8 = 0.5F; ++ return AxisAlignedBB.getAABBPool().getAABB((double)((float)par2 + var7), (double)par3, (double)((float)par4 + var6), (double)((float)(par2 + 1) - var6), (double)((float)par3 + var8), (double)((float)(par4 + 1) - var6)); ++ } ++ ++ /** ++ * From the specified side and block metadata retrieves the blocks texture. Args: side, metadata ++ */ ++ public Icon getIcon(int par1, int par2) { ++ return par1 == 1 ? this.cakeTopIcon : (par1 == 0 ? this.cakeBottomIcon : (par2 > 0 && par1 == 4 ? this.field_94382_c : this.blockIcon)); ++ } ++ ++ /** ++ * When this method is called, your block should register all the icons it needs with the given IconRegister. This is ++ * the only chance you get to register icons. ++ */ ++ public void registerIcons(IconRegister par1IconRegister) { ++ this.blockIcon = par1IconRegister.registerIcon(this.getTextureName() + "_side"); ++ this.field_94382_c = par1IconRegister.registerIcon(this.getTextureName() + "_inner"); ++ this.cakeTopIcon = par1IconRegister.registerIcon(this.getTextureName() + "_top"); ++ this.cakeBottomIcon = par1IconRegister.registerIcon(this.getTextureName() + "_bottom"); ++ } ++ ++ /** ++ * If this block doesn't render as an ordinary block it will return False (examples: signs, buttons, stairs, etc) ++ */ + public boolean renderAsNormalBlock() { + return false; + } + ++ /** ++ * Is this block (a) opaque and (b) a full 1m cube? This determines whether or not to render the shared face of two ++ * adjacent blocks and also whether the player can attach torches, redstone wire, etc to this block. ++ */ + public boolean isOpaqueCube() { + return false; + } + +- public boolean onBlockActivated(World var1, int var2, int var3, int var4, EntityPlayer var5, int var6, float var7, float var8, float var9) { +- this.eatCakeSlice(var1, var2, var3, var4, var5); ++ /** ++ * Called upon block activation (right click on the block.) ++ */ ++ public boolean onBlockActivated(World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer, int par6, float par7, float par8, float par9) { ++ this.eatCakeSlice(par1World, par2, par3, par4, par5EntityPlayer); + return true; + } + +- public void onBlockClicked(World var1, int var2, int var3, int var4, EntityPlayer var5) { +- this.eatCakeSlice(var1, var2, var3, var4, var5); ++ /** ++ * Called when the block is clicked by a player. Args: x, y, z, entityPlayer ++ */ ++ public void onBlockClicked(World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer) { ++ this.eatCakeSlice(par1World, par2, par3, par4, par5EntityPlayer); + } + +- private void eatCakeSlice(World var1, int var2, int var3, int var4, EntityPlayer var5) { +- if(var5.canEat(false)) { +- var5.getFoodStats().addStats(2, 0.1F); +- int var6 = var1.getBlockMetadata(var2, var3, var4) + 1; +- if(var6 >= 6) { +- var1.setBlockToAir(var2, var3, var4); ++ /** ++ * Heals the player and removes a slice from the cake. ++ */ ++ private void eatCakeSlice(World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer) { ++ if (par5EntityPlayer.canEat(false)) { ++ par5EntityPlayer.getFoodStats().addStats(2, 0.1F); ++ int var6 = par1World.getBlockMetadata(par2, par3, par4) + 1; ++ ++ if (var6 >= 6) { ++ par1World.setBlockToAir(par2, par3, par4); + } else { +- var1.setBlockMetadata(var2, var3, var4, var6, 2); ++ par1World.setBlockMetadataWithNotify(par2, par3, par4, var6, 2); + } + } +- +- } +- +- public boolean canPlaceBlockAt(World var1, int var2, int var3, int var4) { +- return !super.canPlaceBlockAt(var1, var2, var3, var4) ? false : this.canBlockStay(var1, var2, var3, var4); +- } +- +- public void onNeighborBlockChange(World var1, int var2, int var3, int var4, int var5) { +- if(!this.canBlockStay(var1, var2, var3, var4)) { +- var1.setBlockToAir(var2, var3, var4); ++ } ++ ++ /** ++ * Checks to see if its valid to put this block at the specified coordinates. Args: world, x, y, z ++ */ ++ public boolean canPlaceBlockAt(World par1World, int par2, int par3, int par4) { ++ return !super.canPlaceBlockAt(par1World, par2, par3, par4) ? false : this.canBlockStay(par1World, par2, par3, par4); ++ } ++ ++ /** ++ * Lets the block know when one of its neighbor changes. Doesn't know which neighbor changed (coordinates passed are ++ * their own) Args: x, y, z, neighbor blockID ++ */ ++ public void onNeighborBlockChange(World par1World, int par2, int par3, int par4, int par5) { ++ if (!this.canBlockStay(par1World, par2, par3, par4)) { ++ par1World.setBlockToAir(par2, par3, par4); + } +- +- } +- +- public boolean canBlockStay(World var1, int var2, int var3, int var4) { +- return var1.getBlockMaterial(var2, var3 - 1, var4).isSolid(); +- } +- +- public int quantityDropped(Random var1) { +- return 0; +- } +- +- public int idDropped(int var1, Random var2, int var3) { +- return 0; +- } +- +- public int idPicked(World var1, int var2, int var3, int var4) { ++ } ++ ++ /** ++ * Can this block stay at this position. Similar to canPlaceBlockAt except gets checked often with plants. ++ */ ++ public boolean canBlockStay(World par1World, int par2, int par3, int par4) { ++ return par1World.getBlockMaterial(par2, par3 - 1, par4).isSolid(); ++ } ++ ++ /** ++ * Returns the quantity of items to drop on block destruction. ++ */ ++ public int quantityDropped(Random par1Random) { ++ return 0; ++ } ++ ++ /** ++ * Returns the ID of the items to drop on destruction. ++ */ ++ public int idDropped(int par1, Random par2Random, int par3) { ++ return 0; ++ } ++ ++ /** ++ * only called by clickMiddleMouseButton , and passed to inventory.setCurrentItem (along with isCreative) ++ */ ++ public int idPicked(World par1World, int par2, int par3, int par4) { + return Item.cake.itemID; + } + } diff --git a/patches/net/minecraft/src/BlockCarpet.java.patch b/patches/net/minecraft/src/BlockCarpet.java.patch new file mode 100644 index 0000000..79bb34d --- /dev/null +++ b/patches/net/minecraft/src/BlockCarpet.java.patch @@ -0,0 +1,171 @@ +--- net/minecraft/src/BlockCarpet.java ++++ net/minecraft/src/BlockCarpet.java +@@ -3,83 +3,125 @@ + import java.util.List; + + public class BlockCarpet extends Block { +- protected BlockCarpet(int var1) { +- super(var1, Material.materialCarpet); +- this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F / 16.0F, 1.0F); ++ protected BlockCarpet(int par1) { ++ super(par1, Material.materialCarpet); ++ this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.0625F, 1.0F); + this.setTickRandomly(true); + this.setCreativeTab(CreativeTabs.tabDecorations); + this.func_111047_d(0); + } + +- public Icon getIcon(int var1, int var2) { +- return Block.cloth.getIcon(var1, var2); ++ /** ++ * From the specified side and block metadata retrieves the blocks texture. Args: side, metadata ++ */ ++ public Icon getIcon(int par1, int par2) { ++ return Block.cloth.getIcon(par1, par2); + } + +- public AxisAlignedBB getCollisionBoundingBoxFromPool(World var1, int var2, int var3, int var4) { ++ /** ++ * Returns a bounding box from the pool of bounding boxes (this means this box can change after the pool has been ++ * cleared to be reused) ++ */ ++ public AxisAlignedBB getCollisionBoundingBoxFromPool(World par1World, int par2, int par3, int par4) { + byte var5 = 0; +- float var6 = 1.0F / 16.0F; +- return AxisAlignedBB.getAABBPool().getAABB((double)var2 + this.minX, (double)var3 + this.minY, (double)var4 + this.minZ, (double)var2 + this.maxX, (double)((float)var3 + (float)var5 * var6), (double)var4 + this.maxZ); ++ float var6 = 0.0625F; ++ return AxisAlignedBB.getAABBPool().getAABB((double)par2 + this.minX, (double)par3 + this.minY, (double)par4 + this.minZ, (double)par2 + this.maxX, (double)((float)par3 + (float)var5 * var6), (double)par4 + this.maxZ); + } + ++ /** ++ * Is this block (a) opaque and (b) a full 1m cube? This determines whether or not to render the shared face of two ++ * adjacent blocks and also whether the player can attach torches, redstone wire, etc to this block. ++ */ + public boolean isOpaqueCube() { + return false; + } + ++ /** ++ * If this block doesn't render as an ordinary block it will return False (examples: signs, buttons, stairs, etc) ++ */ + public boolean renderAsNormalBlock() { + return false; + } + ++ /** ++ * Sets the block's bounds for rendering it as an item ++ */ + public void setBlockBoundsForItemRender() { + this.func_111047_d(0); + } + +- public void setBlockBoundsBasedOnState(IBlockAccess var1, int var2, int var3, int var4) { +- this.func_111047_d(var1.getBlockMetadata(var2, var3, var4)); ++ /** ++ * Updates the blocks bounds based on its current state. Args: world, x, y, z ++ */ ++ public void setBlockBoundsBasedOnState(IBlockAccess par1IBlockAccess, int par2, int par3, int par4) { ++ this.func_111047_d(par1IBlockAccess.getBlockMetadata(par2, par3, par4)); + } + +- protected void func_111047_d(int var1) { ++ protected void func_111047_d(int par1) { + byte var2 = 0; + float var3 = (float)(1 * (1 + var2)) / 16.0F; + this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, var3, 1.0F); + } + +- public boolean canPlaceBlockAt(World var1, int var2, int var3, int var4) { +- return super.canPlaceBlockAt(var1, var2, var3, var4) && this.canBlockStay(var1, var2, var3, var4); +- } +- +- public void onNeighborBlockChange(World var1, int var2, int var3, int var4, int var5) { +- this.func_111046_k(var1, var2, var3, var4); +- } +- +- private boolean func_111046_k(World var1, int var2, int var3, int var4) { +- if(!this.canBlockStay(var1, var2, var3, var4)) { +- this.dropBlockAsItem(var1, var2, var3, var4, var1.getBlockMetadata(var2, var3, var4), 0); +- var1.setBlockToAir(var2, var3, var4); ++ /** ++ * Checks to see if its valid to put this block at the specified coordinates. Args: world, x, y, z ++ */ ++ public boolean canPlaceBlockAt(World par1World, int par2, int par3, int par4) { ++ return super.canPlaceBlockAt(par1World, par2, par3, par4) && this.canBlockStay(par1World, par2, par3, par4); ++ } ++ ++ /** ++ * Lets the block know when one of its neighbor changes. Doesn't know which neighbor changed (coordinates passed are ++ * their own) Args: x, y, z, neighbor blockID ++ */ ++ public void onNeighborBlockChange(World par1World, int par2, int par3, int par4, int par5) { ++ this.func_111046_k(par1World, par2, par3, par4); ++ } ++ ++ private boolean func_111046_k(World par1World, int par2, int par3, int par4) { ++ if (!this.canBlockStay(par1World, par2, par3, par4)) { ++ this.dropBlockAsItem(par1World, par2, par3, par4, par1World.getBlockMetadata(par2, par3, par4), 0); ++ par1World.setBlockToAir(par2, par3, par4); + return false; + } else { + return true; + } + } + +- public boolean canBlockStay(World var1, int var2, int var3, int var4) { +- return !var1.isAirBlock(var2, var3 - 1, var4); +- } +- +- public boolean shouldSideBeRendered(IBlockAccess var1, int var2, int var3, int var4, int var5) { +- return var5 == 1 ? true : super.shouldSideBeRendered(var1, var2, var3, var4, var5); +- } +- +- public int damageDropped(int var1) { +- return var1; +- } +- +- public void getSubBlocks(int var1, CreativeTabs var2, List var3) { +- for(int var4 = 0; var4 < 16; ++var4) { +- var3.add(new ItemStack(var1, 1, var4)); ++ /** ++ * Can this block stay at this position. Similar to canPlaceBlockAt except gets checked often with plants. ++ */ ++ public boolean canBlockStay(World par1World, int par2, int par3, int par4) { ++ return !par1World.isAirBlock(par2, par3 - 1, par4); ++ } ++ ++ /** ++ * Returns true if the given side of this block type should be rendered, if the adjacent block is at the given ++ * coordinates. Args: blockAccess, x, y, z, side ++ */ ++ public boolean shouldSideBeRendered(IBlockAccess par1IBlockAccess, int par2, int par3, int par4, int par5) { ++ return par5 == 1 ? true : super.shouldSideBeRendered(par1IBlockAccess, par2, par3, par4, par5); ++ } ++ ++ /** ++ * Determines the damage on the item the block drops. Used in cloth and wood. ++ */ ++ public int damageDropped(int par1) { ++ return par1; ++ } ++ ++ /** ++ * returns a list of blocks with the same ID, but different meta (eg: wood returns 4 blocks) ++ */ ++ public void getSubBlocks(int par1, CreativeTabs par2CreativeTabs, List par3List) { ++ for (int var4 = 0; var4 < 16; ++var4) { ++ par3List.add(new ItemStack(par1, 1, var4)); + } +- +- } +- +- public void registerIcons(IconRegister var1) { +- } ++ } ++ ++ /** ++ * When this method is called, your block should register all the icons it needs with the given IconRegister. This is ++ * the only chance you get to register icons. ++ */ ++ public void registerIcons(IconRegister par1IconRegister) {} + } diff --git a/patches/net/minecraft/src/BlockCarrot.java.patch b/patches/net/minecraft/src/BlockCarrot.java.patch new file mode 100644 index 0000000..b7d097d --- /dev/null +++ b/patches/net/minecraft/src/BlockCarrot.java.patch @@ -0,0 +1,62 @@ +--- net/minecraft/src/BlockCarrot.java ++++ net/minecraft/src/BlockCarrot.java +@@ -3,36 +3,48 @@ + public class BlockCarrot extends BlockCrops { + private Icon[] iconArray; + +- public BlockCarrot(int var1) { +- super(var1); ++ public BlockCarrot(int par1) { ++ super(par1); + } + +- public Icon getIcon(int var1, int var2) { +- if(var2 < 7) { +- if(var2 == 6) { +- var2 = 5; ++ /** ++ * From the specified side and block metadata retrieves the blocks texture. Args: side, metadata ++ */ ++ public Icon getIcon(int par1, int par2) { ++ if (par2 < 7) { ++ if (par2 == 6) { ++ par2 = 5; + } + +- return this.iconArray[var2 >> 1]; ++ return this.iconArray[par2 >> 1]; + } else { + return this.iconArray[3]; + } + } + ++ /** ++ * Generate a seed ItemStack for this crop. ++ */ + protected int getSeedItem() { + return Item.carrot.itemID; + } + ++ /** ++ * Generate a crop produce ItemStack for this crop. ++ */ + protected int getCropItem() { + return Item.carrot.itemID; + } + +- public void registerIcons(IconRegister var1) { ++ /** ++ * When this method is called, your block should register all the icons it needs with the given IconRegister. This is ++ * the only chance you get to register icons. ++ */ ++ public void registerIcons(IconRegister par1IconRegister) { + this.iconArray = new Icon[4]; + +- for(int var2 = 0; var2 < this.iconArray.length; ++var2) { +- this.iconArray[var2] = var1.registerIcon(this.getTextureName() + "_stage_" + var2); ++ for (int var2 = 0; var2 < this.iconArray.length; ++var2) { ++ this.iconArray[var2] = par1IconRegister.registerIcon(this.getTextureName() + "_stage_" + var2); + } +- + } + } diff --git a/patches/net/minecraft/src/BlockCauldron.java.patch b/patches/net/minecraft/src/BlockCauldron.java.patch new file mode 100644 index 0000000..fa6d9ff --- /dev/null +++ b/patches/net/minecraft/src/BlockCauldron.java.patch @@ -0,0 +1,255 @@ +--- net/minecraft/src/BlockCauldron.java ++++ net/minecraft/src/BlockCauldron.java +@@ -8,100 +8,131 @@ + private Icon cauldronTopIcon; + private Icon cauldronBottomIcon; + +- public BlockCauldron(int var1) { +- super(var1, Material.iron); +- } +- +- public Icon getIcon(int var1, int var2) { +- return var1 == 1 ? this.cauldronTopIcon : (var1 == 0 ? this.cauldronBottomIcon : this.blockIcon); +- } +- +- public void registerIcons(IconRegister var1) { +- this.field_94378_a = var1.registerIcon(this.getTextureName() + "_" + "inner"); +- this.cauldronTopIcon = var1.registerIcon(this.getTextureName() + "_top"); +- this.cauldronBottomIcon = var1.registerIcon(this.getTextureName() + "_" + "bottom"); +- this.blockIcon = var1.registerIcon(this.getTextureName() + "_side"); +- } +- +- public static Icon getCauldronIcon(String var0) { +- return var0.equals("inner") ? Block.cauldron.field_94378_a : (var0.equals("bottom") ? Block.cauldron.cauldronBottomIcon : null); +- } +- +- public void addCollisionBoxesToList(World var1, int var2, int var3, int var4, AxisAlignedBB var5, List var6, Entity var7) { +- this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 5.0F / 16.0F, 1.0F); +- super.addCollisionBoxesToList(var1, var2, var3, var4, var5, var6, var7); +- float var8 = 2.0F / 16.0F; ++ public BlockCauldron(int par1) { ++ super(par1, Material.iron); ++ } ++ ++ /** ++ * From the specified side and block metadata retrieves the blocks texture. Args: side, metadata ++ */ ++ public Icon getIcon(int par1, int par2) { ++ return par1 == 1 ? this.cauldronTopIcon : (par1 == 0 ? this.cauldronBottomIcon : this.blockIcon); ++ } ++ ++ /** ++ * When this method is called, your block should register all the icons it needs with the given IconRegister. This is ++ * the only chance you get to register icons. ++ */ ++ public void registerIcons(IconRegister par1IconRegister) { ++ this.field_94378_a = par1IconRegister.registerIcon(this.getTextureName() + "_" + "inner"); ++ this.cauldronTopIcon = par1IconRegister.registerIcon(this.getTextureName() + "_top"); ++ this.cauldronBottomIcon = par1IconRegister.registerIcon(this.getTextureName() + "_" + "bottom"); ++ this.blockIcon = par1IconRegister.registerIcon(this.getTextureName() + "_side"); ++ } ++ ++ public static Icon getCauldronIcon(String par0Str) { ++ return par0Str.equals("inner") ? Block.cauldron.field_94378_a : (par0Str.equals("bottom") ? Block.cauldron.cauldronBottomIcon : null); ++ } ++ ++ /** ++ * Adds all intersecting collision boxes to a list. (Be sure to only add boxes to the list if they intersect the mask.) ++ * Parameters: World, X, Y, Z, mask, list, colliding entity ++ */ ++ public void addCollisionBoxesToList(World par1World, int par2, int par3, int par4, AxisAlignedBB par5AxisAlignedBB, List par6List, Entity par7Entity) { ++ this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.3125F, 1.0F); ++ super.addCollisionBoxesToList(par1World, par2, par3, par4, par5AxisAlignedBB, par6List, par7Entity); ++ float var8 = 0.125F; + this.setBlockBounds(0.0F, 0.0F, 0.0F, var8, 1.0F, 1.0F); +- super.addCollisionBoxesToList(var1, var2, var3, var4, var5, var6, var7); ++ super.addCollisionBoxesToList(par1World, par2, par3, par4, par5AxisAlignedBB, par6List, par7Entity); + this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, var8); +- super.addCollisionBoxesToList(var1, var2, var3, var4, var5, var6, var7); ++ super.addCollisionBoxesToList(par1World, par2, par3, par4, par5AxisAlignedBB, par6List, par7Entity); + this.setBlockBounds(1.0F - var8, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F); +- super.addCollisionBoxesToList(var1, var2, var3, var4, var5, var6, var7); ++ super.addCollisionBoxesToList(par1World, par2, par3, par4, par5AxisAlignedBB, par6List, par7Entity); + this.setBlockBounds(0.0F, 0.0F, 1.0F - var8, 1.0F, 1.0F, 1.0F); +- super.addCollisionBoxesToList(var1, var2, var3, var4, var5, var6, var7); ++ super.addCollisionBoxesToList(par1World, par2, par3, par4, par5AxisAlignedBB, par6List, par7Entity); + this.setBlockBoundsForItemRender(); + } + ++ /** ++ * Sets the block's bounds for rendering it as an item ++ */ + public void setBlockBoundsForItemRender() { + this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F); + } + ++ /** ++ * Is this block (a) opaque and (b) a full 1m cube? This determines whether or not to render the shared face of two ++ * adjacent blocks and also whether the player can attach torches, redstone wire, etc to this block. ++ */ + public boolean isOpaqueCube() { + return false; + } + ++ /** ++ * The type of render function that is called for this block ++ */ + public int getRenderType() { + return 24; + } + ++ /** ++ * If this block doesn't render as an ordinary block it will return False (examples: signs, buttons, stairs, etc) ++ */ + public boolean renderAsNormalBlock() { + return false; + } + +- public boolean onBlockActivated(World var1, int var2, int var3, int var4, EntityPlayer var5, int var6, float var7, float var8, float var9) { +- if(var1.isRemote) { ++ /** ++ * Called upon block activation (right click on the block.) ++ */ ++ public boolean onBlockActivated(World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer, int par6, float par7, float par8, float par9) { ++ if (par1World.isRemote) { + return true; + } else { +- ItemStack var10 = var5.inventory.getCurrentItem(); +- if(var10 == null) { ++ ItemStack var10 = par5EntityPlayer.inventory.getCurrentItem(); ++ ++ if (var10 == null) { + return true; + } else { +- int var11 = var1.getBlockMetadata(var2, var3, var4); ++ int var11 = par1World.getBlockMetadata(par2, par3, par4); + int var12 = func_111045_h_(var11); +- if(var10.itemID == Item.bucketWater.itemID) { +- if(var12 < 3) { +- if(!var5.capabilities.isCreativeMode) { +- var5.inventory.setInventorySlotContents(var5.inventory.currentItem, new ItemStack(Item.bucketEmpty)); ++ ++ if (var10.itemID == Item.bucketWater.itemID) { ++ if (var12 < 3) { ++ if (!par5EntityPlayer.capabilities.isCreativeMode) { ++ par5EntityPlayer.inventory.setInventorySlotContents(par5EntityPlayer.inventory.currentItem, new ItemStack(Item.bucketEmpty)); + } + +- var1.setBlockMetadata(var2, var3, var4, 3, 2); +- var1.func_96440_m(var2, var3, var4, this.blockID); ++ par1World.setBlockMetadataWithNotify(par2, par3, par4, 3, 2); ++ par1World.func_96440_m(par2, par3, par4, this.blockID); + } + + return true; + } else { +- if(var10.itemID == Item.glassBottle.itemID) { +- if(var12 > 0) { ++ if (var10.itemID == Item.glassBottle.itemID) { ++ if (var12 > 0) { + ItemStack var13 = new ItemStack(Item.potion, 1, 0); +- if(!var5.inventory.addItemStackToInventory(var13)) { +- var1.spawnEntityInWorld(new EntityItem(var1, (double)var2 + 0.5D, (double)var3 + 1.5D, (double)var4 + 0.5D, var13)); +- } else if(var5 instanceof EntityPlayerMP) { +- ((EntityPlayerMP)var5).sendContainerToPlayer(var5.inventoryContainer); ++ ++ if (!par5EntityPlayer.inventory.addItemStackToInventory(var13)) { ++ par1World.spawnEntityInWorld(new EntityItem(par1World, (double)par2 + 0.5D, (double)par3 + 1.5D, (double)par4 + 0.5D, var13)); ++ } else if (par5EntityPlayer instanceof EntityPlayerMP) { ++ ((EntityPlayerMP)par5EntityPlayer).sendContainerToPlayer(par5EntityPlayer.inventoryContainer); + } + + --var10.stackSize; +- if(var10.stackSize <= 0) { +- var5.inventory.setInventorySlotContents(var5.inventory.currentItem, (ItemStack)null); ++ ++ if (var10.stackSize <= 0) { ++ par5EntityPlayer.inventory.setInventorySlotContents(par5EntityPlayer.inventory.currentItem, (ItemStack)null); + } + +- var1.setBlockMetadata(var2, var3, var4, var12 - 1, 2); +- var1.func_96440_m(var2, var3, var4, this.blockID); ++ par1World.setBlockMetadataWithNotify(par2, par3, par4, var12 - 1, 2); ++ par1World.func_96440_m(par2, par3, par4, this.blockID); + } +- } else if(var12 > 0 && var10.getItem() instanceof ItemArmor && ((ItemArmor)var10.getItem()).getArmorMaterial() == EnumArmorMaterial.CLOTH) { ++ } else if (var12 > 0 && var10.getItem() instanceof ItemArmor && ((ItemArmor)var10.getItem()).getArmorMaterial() == EnumArmorMaterial.CLOTH) { + ItemArmor var14 = (ItemArmor)var10.getItem(); + var14.removeColor(var10); +- var1.setBlockMetadata(var2, var3, var4, var12 - 1, 2); +- var1.func_96440_m(var2, var3, var4, this.blockID); ++ par1World.setBlockMetadataWithNotify(par2, par3, par4, var12 - 1, 2); ++ par1World.func_96440_m(par2, par3, par4, this.blockID); + return true; + } + +@@ -111,34 +142,51 @@ + } + } + +- public void fillWithRain(World var1, int var2, int var3, int var4) { +- if(var1.s.nextInt(20) == 1) { +- int var5 = var1.getBlockMetadata(var2, var3, var4); +- if(var5 < 3) { +- var1.setBlockMetadata(var2, var3, var4, var5 + 1, 2); ++ /** ++ * currently only used by BlockCauldron to incrament meta-data during rain ++ */ ++ public void fillWithRain(World par1World, int par2, int par3, int par4) { ++ if (par1World.rand.nextInt(20) == 1) { ++ int var5 = par1World.getBlockMetadata(par2, par3, par4); ++ ++ if (var5 < 3) { ++ par1World.setBlockMetadataWithNotify(par2, par3, par4, var5 + 1, 2); + } +- + } + } + +- public int idDropped(int var1, Random var2, int var3) { +- return Item.cauldron.itemID; +- } +- +- public int idPicked(World var1, int var2, int var3, int var4) { +- return Item.cauldron.itemID; +- } +- ++ /** ++ * Returns the ID of the items to drop on destruction. ++ */ ++ public int idDropped(int par1, Random par2Random, int par3) { ++ return Item.cauldron.itemID; ++ } ++ ++ /** ++ * only called by clickMiddleMouseButton , and passed to inventory.setCurrentItem (along with isCreative) ++ */ ++ public int idPicked(World par1World, int par2, int par3, int par4) { ++ return Item.cauldron.itemID; ++ } ++ ++ /** ++ * If this returns true, then comparators facing away from this block will use the value from ++ * getComparatorInputOverride instead of the actual redstone signal strength. ++ */ + public boolean hasComparatorInputOverride() { + return true; + } + +- public int getComparatorInputOverride(World var1, int var2, int var3, int var4, int var5) { +- int var6 = var1.getBlockMetadata(var2, var3, var4); ++ /** ++ * If hasComparatorInputOverride returns true, the return value from this is used instead of the redstone signal ++ * strength when this block inputs to a comparator. ++ */ ++ public int getComparatorInputOverride(World par1World, int par2, int par3, int par4, int par5) { ++ int var6 = par1World.getBlockMetadata(par2, par3, par4); + return func_111045_h_(var6); + } + +- public static int func_111045_h_(int var0) { +- return var0; ++ public static int func_111045_h_(int par0) { ++ return par0; + } + } diff --git a/patches/net/minecraft/src/BlockChest.java.patch b/patches/net/minecraft/src/BlockChest.java.patch new file mode 100644 index 0000000..7d74ab2 --- /dev/null +++ b/patches/net/minecraft/src/BlockChest.java.patch @@ -0,0 +1,687 @@ +--- net/minecraft/src/BlockChest.java ++++ net/minecraft/src/BlockChest.java +@@ -4,374 +4,453 @@ + import java.util.Random; + + public class BlockChest extends BlockContainer { +- private final Random b = new Random(); ++ private final Random random = new Random(); ++ ++ /** 1 for trapped chests, 0 for normal chests. */ + public final int chestType; + +- protected BlockChest(int var1, int var2) { +- super(var1, Material.wood); +- this.chestType = var2; ++ protected BlockChest(int par1, int par2) { ++ super(par1, Material.wood); ++ this.chestType = par2; + this.setCreativeTab(CreativeTabs.tabDecorations); +- this.setBlockBounds(1.0F / 16.0F, 0.0F, 1.0F / 16.0F, 15.0F / 16.0F, 14.0F / 16.0F, 15.0F / 16.0F); ++ this.setBlockBounds(0.0625F, 0.0F, 0.0625F, 0.9375F, 0.875F, 0.9375F); + } + ++ /** ++ * Is this block (a) opaque and (b) a full 1m cube? This determines whether or not to render the shared face of two ++ * adjacent blocks and also whether the player can attach torches, redstone wire, etc to this block. ++ */ + public boolean isOpaqueCube() { + return false; + } + ++ /** ++ * If this block doesn't render as an ordinary block it will return False (examples: signs, buttons, stairs, etc) ++ */ + public boolean renderAsNormalBlock() { + return false; + } + ++ /** ++ * The type of render function that is called for this block ++ */ + public int getRenderType() { + return 22; + } + +- public void setBlockBoundsBasedOnState(IBlockAccess var1, int var2, int var3, int var4) { +- if(var1.getBlockId(var2, var3, var4 - 1) == this.blockID) { +- this.setBlockBounds(1.0F / 16.0F, 0.0F, 0.0F, 15.0F / 16.0F, 14.0F / 16.0F, 15.0F / 16.0F); +- } else if(var1.getBlockId(var2, var3, var4 + 1) == this.blockID) { +- this.setBlockBounds(1.0F / 16.0F, 0.0F, 1.0F / 16.0F, 15.0F / 16.0F, 14.0F / 16.0F, 1.0F); +- } else if(var1.getBlockId(var2 - 1, var3, var4) == this.blockID) { +- this.setBlockBounds(0.0F, 0.0F, 1.0F / 16.0F, 15.0F / 16.0F, 14.0F / 16.0F, 15.0F / 16.0F); +- } else if(var1.getBlockId(var2 + 1, var3, var4) == this.blockID) { +- this.setBlockBounds(1.0F / 16.0F, 0.0F, 1.0F / 16.0F, 1.0F, 14.0F / 16.0F, 15.0F / 16.0F); ++ /** ++ * Updates the blocks bounds based on its current state. Args: world, x, y, z ++ */ ++ public void setBlockBoundsBasedOnState(IBlockAccess par1IBlockAccess, int par2, int par3, int par4) { ++ if (par1IBlockAccess.getBlockId(par2, par3, par4 - 1) == this.blockID) { ++ this.setBlockBounds(0.0625F, 0.0F, 0.0F, 0.9375F, 0.875F, 0.9375F); ++ } else if (par1IBlockAccess.getBlockId(par2, par3, par4 + 1) == this.blockID) { ++ this.setBlockBounds(0.0625F, 0.0F, 0.0625F, 0.9375F, 0.875F, 1.0F); ++ } else if (par1IBlockAccess.getBlockId(par2 - 1, par3, par4) == this.blockID) { ++ this.setBlockBounds(0.0F, 0.0F, 0.0625F, 0.9375F, 0.875F, 0.9375F); ++ } else if (par1IBlockAccess.getBlockId(par2 + 1, par3, par4) == this.blockID) { ++ this.setBlockBounds(0.0625F, 0.0F, 0.0625F, 1.0F, 0.875F, 0.9375F); + } else { +- this.setBlockBounds(1.0F / 16.0F, 0.0F, 1.0F / 16.0F, 15.0F / 16.0F, 14.0F / 16.0F, 15.0F / 16.0F); +- } +- +- } +- +- public void onBlockAdded(World var1, int var2, int var3, int var4) { +- super.onBlockAdded(var1, var2, var3, var4); +- this.unifyAdjacentChests(var1, var2, var3, var4); +- int var5 = var1.getBlockId(var2, var3, var4 - 1); +- int var6 = var1.getBlockId(var2, var3, var4 + 1); +- int var7 = var1.getBlockId(var2 - 1, var3, var4); +- int var8 = var1.getBlockId(var2 + 1, var3, var4); +- if(var5 == this.blockID) { +- this.unifyAdjacentChests(var1, var2, var3, var4 - 1); +- } +- +- if(var6 == this.blockID) { +- this.unifyAdjacentChests(var1, var2, var3, var4 + 1); +- } +- +- if(var7 == this.blockID) { +- this.unifyAdjacentChests(var1, var2 - 1, var3, var4); +- } +- +- if(var8 == this.blockID) { +- this.unifyAdjacentChests(var1, var2 + 1, var3, var4); +- } +- +- } +- +- public void onBlockPlacedBy(World var1, int var2, int var3, int var4, EntityLivingBase var5, ItemStack var6) { +- int var7 = var1.getBlockId(var2, var3, var4 - 1); +- int var8 = var1.getBlockId(var2, var3, var4 + 1); +- int var9 = var1.getBlockId(var2 - 1, var3, var4); +- int var10 = var1.getBlockId(var2 + 1, var3, var4); ++ this.setBlockBounds(0.0625F, 0.0F, 0.0625F, 0.9375F, 0.875F, 0.9375F); ++ } ++ } ++ ++ /** ++ * Called whenever the block is added into the world. Args: world, x, y, z ++ */ ++ public void onBlockAdded(World par1World, int par2, int par3, int par4) { ++ super.onBlockAdded(par1World, par2, par3, par4); ++ this.unifyAdjacentChests(par1World, par2, par3, par4); ++ int var5 = par1World.getBlockId(par2, par3, par4 - 1); ++ int var6 = par1World.getBlockId(par2, par3, par4 + 1); ++ int var7 = par1World.getBlockId(par2 - 1, par3, par4); ++ int var8 = par1World.getBlockId(par2 + 1, par3, par4); ++ ++ if (var5 == this.blockID) { ++ this.unifyAdjacentChests(par1World, par2, par3, par4 - 1); ++ } ++ ++ if (var6 == this.blockID) { ++ this.unifyAdjacentChests(par1World, par2, par3, par4 + 1); ++ } ++ ++ if (var7 == this.blockID) { ++ this.unifyAdjacentChests(par1World, par2 - 1, par3, par4); ++ } ++ ++ if (var8 == this.blockID) { ++ this.unifyAdjacentChests(par1World, par2 + 1, par3, par4); ++ } ++ } ++ ++ /** ++ * Called when the block is placed in the world. ++ */ ++ public void onBlockPlacedBy(World par1World, int par2, int par3, int par4, EntityLivingBase par5EntityLivingBase, ItemStack par6ItemStack) { ++ int var7 = par1World.getBlockId(par2, par3, par4 - 1); ++ int var8 = par1World.getBlockId(par2, par3, par4 + 1); ++ int var9 = par1World.getBlockId(par2 - 1, par3, par4); ++ int var10 = par1World.getBlockId(par2 + 1, par3, par4); + byte var11 = 0; +- int var12 = MathHelper.floor_double((double)(var5.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3; +- if(var12 == 0) { ++ int var12 = MathHelper.floor_double((double)(par5EntityLivingBase.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3; ++ ++ if (var12 == 0) { + var11 = 2; + } + +- if(var12 == 1) { ++ if (var12 == 1) { + var11 = 5; + } + +- if(var12 == 2) { ++ if (var12 == 2) { + var11 = 3; + } + +- if(var12 == 3) { ++ if (var12 == 3) { + var11 = 4; + } + +- if(var7 != this.blockID && var8 != this.blockID && var9 != this.blockID && var10 != this.blockID) { +- var1.setBlockMetadata(var2, var3, var4, var11, 3); ++ if (var7 != this.blockID && var8 != this.blockID && var9 != this.blockID && var10 != this.blockID) { ++ par1World.setBlockMetadataWithNotify(par2, par3, par4, var11, 3); + } else { +- if((var7 == this.blockID || var8 == this.blockID) && (var11 == 4 || var11 == 5)) { +- if(var7 == this.blockID) { +- var1.setBlockMetadata(var2, var3, var4 - 1, var11, 3); +- } else { +- var1.setBlockMetadata(var2, var3, var4 + 1, var11, 3); +- } +- +- var1.setBlockMetadata(var2, var3, var4, var11, 3); +- } +- +- if((var9 == this.blockID || var10 == this.blockID) && (var11 == 2 || var11 == 3)) { +- if(var9 == this.blockID) { +- var1.setBlockMetadata(var2 - 1, var3, var4, var11, 3); +- } else { +- var1.setBlockMetadata(var2 + 1, var3, var4, var11, 3); +- } +- +- var1.setBlockMetadata(var2, var3, var4, var11, 3); +- } +- } +- +- if(var6.hasDisplayName()) { +- ((TileEntityChest)var1.getBlockTileEntity(var2, var3, var4)).setChestGuiName(var6.getDisplayName()); +- } +- ++ if ((var7 == this.blockID || var8 == this.blockID) && (var11 == 4 || var11 == 5)) { ++ if (var7 == this.blockID) { ++ par1World.setBlockMetadataWithNotify(par2, par3, par4 - 1, var11, 3); ++ } else { ++ par1World.setBlockMetadataWithNotify(par2, par3, par4 + 1, var11, 3); ++ } ++ ++ par1World.setBlockMetadataWithNotify(par2, par3, par4, var11, 3); ++ } ++ ++ if ((var9 == this.blockID || var10 == this.blockID) && (var11 == 2 || var11 == 3)) { ++ if (var9 == this.blockID) { ++ par1World.setBlockMetadataWithNotify(par2 - 1, par3, par4, var11, 3); ++ } else { ++ par1World.setBlockMetadataWithNotify(par2 + 1, par3, par4, var11, 3); ++ } ++ ++ par1World.setBlockMetadataWithNotify(par2, par3, par4, var11, 3); ++ } ++ } ++ ++ if (par6ItemStack.hasDisplayName()) { ++ ((TileEntityChest)par1World.getBlockTileEntity(par2, par3, par4)).setChestGuiName(par6ItemStack.getDisplayName()); ++ } + } + +- public void unifyAdjacentChests(World var1, int var2, int var3, int var4) { +- if(!var1.isRemote) { +- int var5 = var1.getBlockId(var2, var3, var4 - 1); +- int var6 = var1.getBlockId(var2, var3, var4 + 1); +- int var7 = var1.getBlockId(var2 - 1, var3, var4); +- int var8 = var1.getBlockId(var2 + 1, var3, var4); ++ /** ++ * Turns the adjacent chests to a double chest. ++ */ ++ public void unifyAdjacentChests(World par1World, int par2, int par3, int par4) { ++ if (!par1World.isRemote) { ++ int var5 = par1World.getBlockId(par2, par3, par4 - 1); ++ int var6 = par1World.getBlockId(par2, par3, par4 + 1); ++ int var7 = par1World.getBlockId(par2 - 1, par3, par4); ++ int var8 = par1World.getBlockId(par2 + 1, par3, par4); + boolean var9 = true; + int var10; + int var11; + boolean var12; + byte var13; + int var14; +- if(var5 != this.blockID && var6 != this.blockID) { +- if(var7 != this.blockID && var8 != this.blockID) { ++ ++ if (var5 != this.blockID && var6 != this.blockID) { ++ if (var7 != this.blockID && var8 != this.blockID) { + var13 = 3; +- if(Block.opaqueCubeLookup[var5] && !Block.opaqueCubeLookup[var6]) { ++ ++ if (Block.opaqueCubeLookup[var5] && !Block.opaqueCubeLookup[var6]) { + var13 = 3; + } + +- if(Block.opaqueCubeLookup[var6] && !Block.opaqueCubeLookup[var5]) { ++ if (Block.opaqueCubeLookup[var6] && !Block.opaqueCubeLookup[var5]) { + var13 = 2; + } + +- if(Block.opaqueCubeLookup[var7] && !Block.opaqueCubeLookup[var8]) { ++ if (Block.opaqueCubeLookup[var7] && !Block.opaqueCubeLookup[var8]) { + var13 = 5; + } + +- if(Block.opaqueCubeLookup[var8] && !Block.opaqueCubeLookup[var7]) { ++ if (Block.opaqueCubeLookup[var8] && !Block.opaqueCubeLookup[var7]) { + var13 = 4; + } + } else { +- var10 = var1.getBlockId(var7 == this.blockID ? var2 - 1 : var2 + 1, var3, var4 - 1); +- var11 = var1.getBlockId(var7 == this.blockID ? var2 - 1 : var2 + 1, var3, var4 + 1); ++ var10 = par1World.getBlockId(var7 == this.blockID ? par2 - 1 : par2 + 1, par3, par4 - 1); ++ var11 = par1World.getBlockId(var7 == this.blockID ? par2 - 1 : par2 + 1, par3, par4 + 1); + var13 = 3; + var12 = true; +- if(var7 == this.blockID) { +- var14 = var1.getBlockMetadata(var2 - 1, var3, var4); ++ ++ if (var7 == this.blockID) { ++ var14 = par1World.getBlockMetadata(par2 - 1, par3, par4); + } else { +- var14 = var1.getBlockMetadata(var2 + 1, var3, var4); ++ var14 = par1World.getBlockMetadata(par2 + 1, par3, par4); + } + +- if(var14 == 2) { ++ if (var14 == 2) { + var13 = 2; + } + +- if((Block.opaqueCubeLookup[var5] || Block.opaqueCubeLookup[var10]) && !Block.opaqueCubeLookup[var6] && !Block.opaqueCubeLookup[var11]) { ++ if ((Block.opaqueCubeLookup[var5] || Block.opaqueCubeLookup[var10]) && !Block.opaqueCubeLookup[var6] && !Block.opaqueCubeLookup[var11]) { + var13 = 3; + } + +- if((Block.opaqueCubeLookup[var6] || Block.opaqueCubeLookup[var11]) && !Block.opaqueCubeLookup[var5] && !Block.opaqueCubeLookup[var10]) { ++ if ((Block.opaqueCubeLookup[var6] || Block.opaqueCubeLookup[var11]) && !Block.opaqueCubeLookup[var5] && !Block.opaqueCubeLookup[var10]) { + var13 = 2; + } + } + } else { +- var10 = var1.getBlockId(var2 - 1, var3, var5 == this.blockID ? var4 - 1 : var4 + 1); +- var11 = var1.getBlockId(var2 + 1, var3, var5 == this.blockID ? var4 - 1 : var4 + 1); ++ var10 = par1World.getBlockId(par2 - 1, par3, var5 == this.blockID ? par4 - 1 : par4 + 1); ++ var11 = par1World.getBlockId(par2 + 1, par3, var5 == this.blockID ? par4 - 1 : par4 + 1); + var13 = 5; + var12 = true; +- if(var5 == this.blockID) { +- var14 = var1.getBlockMetadata(var2, var3, var4 - 1); ++ ++ if (var5 == this.blockID) { ++ var14 = par1World.getBlockMetadata(par2, par3, par4 - 1); + } else { +- var14 = var1.getBlockMetadata(var2, var3, var4 + 1); ++ var14 = par1World.getBlockMetadata(par2, par3, par4 + 1); + } + +- if(var14 == 4) { ++ if (var14 == 4) { + var13 = 4; + } + +- if((Block.opaqueCubeLookup[var7] || Block.opaqueCubeLookup[var10]) && !Block.opaqueCubeLookup[var8] && !Block.opaqueCubeLookup[var11]) { ++ if ((Block.opaqueCubeLookup[var7] || Block.opaqueCubeLookup[var10]) && !Block.opaqueCubeLookup[var8] && !Block.opaqueCubeLookup[var11]) { + var13 = 5; + } + +- if((Block.opaqueCubeLookup[var8] || Block.opaqueCubeLookup[var11]) && !Block.opaqueCubeLookup[var7] && !Block.opaqueCubeLookup[var10]) { ++ if ((Block.opaqueCubeLookup[var8] || Block.opaqueCubeLookup[var11]) && !Block.opaqueCubeLookup[var7] && !Block.opaqueCubeLookup[var10]) { + var13 = 4; + } + } + +- var1.setBlockMetadata(var2, var3, var4, var13, 3); ++ par1World.setBlockMetadataWithNotify(par2, par3, par4, var13, 3); + } + } + +- public boolean canPlaceBlockAt(World var1, int var2, int var3, int var4) { ++ /** ++ * Checks to see if its valid to put this block at the specified coordinates. Args: world, x, y, z ++ */ ++ public boolean canPlaceBlockAt(World par1World, int par2, int par3, int par4) { + int var5 = 0; +- if(var1.getBlockId(var2 - 1, var3, var4) == this.blockID) { +- ++var5; +- } +- +- if(var1.getBlockId(var2 + 1, var3, var4) == this.blockID) { +- ++var5; +- } +- +- if(var1.getBlockId(var2, var3, var4 - 1) == this.blockID) { +- ++var5; +- } +- +- if(var1.getBlockId(var2, var3, var4 + 1) == this.blockID) { +- ++var5; +- } +- +- return var5 > 1 ? false : (this.isThereANeighborChest(var1, var2 - 1, var3, var4) ? false : (this.isThereANeighborChest(var1, var2 + 1, var3, var4) ? false : (this.isThereANeighborChest(var1, var2, var3, var4 - 1) ? false : !this.isThereANeighborChest(var1, var2, var3, var4 + 1)))); +- } +- +- private boolean isThereANeighborChest(World var1, int var2, int var3, int var4) { +- return var1.getBlockId(var2, var3, var4) != this.blockID ? false : (var1.getBlockId(var2 - 1, var3, var4) == this.blockID ? true : (var1.getBlockId(var2 + 1, var3, var4) == this.blockID ? true : (var1.getBlockId(var2, var3, var4 - 1) == this.blockID ? true : var1.getBlockId(var2, var3, var4 + 1) == this.blockID))); +- } +- +- public void onNeighborBlockChange(World var1, int var2, int var3, int var4, int var5) { +- super.onNeighborBlockChange(var1, var2, var3, var4, var5); +- TileEntityChest var6 = (TileEntityChest)var1.getBlockTileEntity(var2, var3, var4); +- if(var6 != null) { ++ ++ if (par1World.getBlockId(par2 - 1, par3, par4) == this.blockID) { ++ ++var5; ++ } ++ ++ if (par1World.getBlockId(par2 + 1, par3, par4) == this.blockID) { ++ ++var5; ++ } ++ ++ if (par1World.getBlockId(par2, par3, par4 - 1) == this.blockID) { ++ ++var5; ++ } ++ ++ if (par1World.getBlockId(par2, par3, par4 + 1) == this.blockID) { ++ ++var5; ++ } ++ ++ return var5 > 1 ? false : (this.isThereANeighborChest(par1World, par2 - 1, par3, par4) ? false : (this.isThereANeighborChest(par1World, par2 + 1, par3, par4) ? false : (this.isThereANeighborChest(par1World, par2, par3, par4 - 1) ? false : !this.isThereANeighborChest(par1World, par2, par3, par4 + 1)))); ++ } ++ ++ /** ++ * Checks the neighbor blocks to see if there is a chest there. Args: world, x, y, z ++ */ ++ private boolean isThereANeighborChest(World par1World, int par2, int par3, int par4) { ++ return par1World.getBlockId(par2, par3, par4) != this.blockID ? false : (par1World.getBlockId(par2 - 1, par3, par4) == this.blockID ? true : (par1World.getBlockId(par2 + 1, par3, par4) == this.blockID ? true : (par1World.getBlockId(par2, par3, par4 - 1) == this.blockID ? true : par1World.getBlockId(par2, par3, par4 + 1) == this.blockID))); ++ } ++ ++ /** ++ * Lets the block know when one of its neighbor changes. Doesn't know which neighbor changed (coordinates passed are ++ * their own) Args: x, y, z, neighbor blockID ++ */ ++ public void onNeighborBlockChange(World par1World, int par2, int par3, int par4, int par5) { ++ super.onNeighborBlockChange(par1World, par2, par3, par4, par5); ++ TileEntityChest var6 = (TileEntityChest)par1World.getBlockTileEntity(par2, par3, par4); ++ ++ if (var6 != null) { + var6.updateContainingBlockInfo(); + } +- + } + +- public void breakBlock(World var1, int var2, int var3, int var4, int var5, int var6) { +- TileEntityChest var7 = (TileEntityChest)var1.getBlockTileEntity(var2, var3, var4); +- if(var7 != null) { +- for(int var8 = 0; var8 < var7.getSizeInventory(); ++var8) { ++ /** ++ * Called on server worlds only when the block has been replaced by a different block ID, or the same block with a ++ * different metadata value, but before the new metadata value is set. Args: World, x, y, z, old block ID, old metadata ++ */ ++ public void breakBlock(World par1World, int par2, int par3, int par4, int par5, int par6) { ++ TileEntityChest var7 = (TileEntityChest)par1World.getBlockTileEntity(par2, par3, par4); ++ ++ if (var7 != null) { ++ for (int var8 = 0; var8 < var7.getSizeInventory(); ++var8) { + ItemStack var9 = var7.getStackInSlot(var8); +- if(var9 != null) { +- float var10 = this.b.nextFloat() * 0.8F + 0.1F; +- float var11 = this.b.nextFloat() * 0.8F + 0.1F; + ++ if (var9 != null) { ++ float var10 = this.random.nextFloat() * 0.8F + 0.1F; ++ float var11 = this.random.nextFloat() * 0.8F + 0.1F; + EntityItem var14; +- for(float var12 = this.b.nextFloat() * 0.8F + 0.1F; var9.stackSize > 0; var1.spawnEntityInWorld(var14)) { +- int var13 = this.b.nextInt(21) + 10; +- if(var13 > var9.stackSize) { ++ ++ for (float var12 = this.random.nextFloat() * 0.8F + 0.1F; var9.stackSize > 0; par1World.spawnEntityInWorld(var14)) { ++ int var13 = this.random.nextInt(21) + 10; ++ ++ if (var13 > var9.stackSize) { + var13 = var9.stackSize; + } + + var9.stackSize -= var13; +- var14 = new EntityItem(var1, (double)((float)var2 + var10), (double)((float)var3 + var11), (double)((float)var4 + var12), new ItemStack(var9.itemID, var13, var9.getItemDamage())); ++ var14 = new EntityItem(par1World, (double)((float)par2 + var10), (double)((float)par3 + var11), (double)((float)par4 + var12), new ItemStack(var9.itemID, var13, var9.getItemDamage())); + float var15 = 0.05F; +- var14.motionX = (double)((float)this.b.nextGaussian() * var15); +- var14.motionY = (double)((float)this.b.nextGaussian() * var15 + 0.2F); +- var14.motionZ = (double)((float)this.b.nextGaussian() * var15); +- if(var9.hasTagCompound()) { ++ var14.motionX = (double)((float)this.random.nextGaussian() * var15); ++ var14.motionY = (double)((float)this.random.nextGaussian() * var15 + 0.2F); ++ var14.motionZ = (double)((float)this.random.nextGaussian() * var15); ++ ++ if (var9.hasTagCompound()) { + var14.getEntityItem().setTagCompound((NBTTagCompound)var9.getTagCompound().copy()); + } + } + } + } + +- var1.func_96440_m(var2, var3, var4, var5); +- } +- +- super.breakBlock(var1, var2, var3, var4, var5, var6); +- } +- +- public boolean onBlockActivated(World var1, int var2, int var3, int var4, EntityPlayer var5, int var6, float var7, float var8, float var9) { +- if(var1.isRemote) { +- return true; +- } else { +- IInventory var10 = this.getInventory(var1, var2, var3, var4); +- if(var10 != null) { +- var5.displayGUIChest(var10); +- } +- +- return true; +- } +- } +- +- public IInventory getInventory(World var1, int var2, int var3, int var4) { +- Object var5 = (TileEntityChest)var1.getBlockTileEntity(var2, var3, var4); +- if(var5 == null) { +- return null; +- } else if(var1.isBlockNormalCube(var2, var3 + 1, var4)) { +- return null; +- } else if(isOcelotBlockingChest(var1, var2, var3, var4)) { +- return null; +- } else if(var1.getBlockId(var2 - 1, var3, var4) != this.blockID || !var1.isBlockNormalCube(var2 - 1, var3 + 1, var4) && !isOcelotBlockingChest(var1, var2 - 1, var3, var4)) { +- if(var1.getBlockId(var2 + 1, var3, var4) != this.blockID || !var1.isBlockNormalCube(var2 + 1, var3 + 1, var4) && !isOcelotBlockingChest(var1, var2 + 1, var3, var4)) { +- if(var1.getBlockId(var2, var3, var4 - 1) != this.blockID || !var1.isBlockNormalCube(var2, var3 + 1, var4 - 1) && !isOcelotBlockingChest(var1, var2, var3, var4 - 1)) { +- if(var1.getBlockId(var2, var3, var4 + 1) != this.blockID || !var1.isBlockNormalCube(var2, var3 + 1, var4 + 1) && !isOcelotBlockingChest(var1, var2, var3, var4 + 1)) { +- if(var1.getBlockId(var2 - 1, var3, var4) == this.blockID) { +- var5 = new InventoryLargeChest("container.chestDouble", (TileEntityChest)var1.getBlockTileEntity(var2 - 1, var3, var4), (IInventory)var5); +- } +- +- if(var1.getBlockId(var2 + 1, var3, var4) == this.blockID) { +- var5 = new InventoryLargeChest("container.chestDouble", (IInventory)var5, (TileEntityChest)var1.getBlockTileEntity(var2 + 1, var3, var4)); +- } +- +- if(var1.getBlockId(var2, var3, var4 - 1) == this.blockID) { +- var5 = new InventoryLargeChest("container.chestDouble", (TileEntityChest)var1.getBlockTileEntity(var2, var3, var4 - 1), (IInventory)var5); +- } +- +- if(var1.getBlockId(var2, var3, var4 + 1) == this.blockID) { +- var5 = new InventoryLargeChest("container.chestDouble", (IInventory)var5, (TileEntityChest)var1.getBlockTileEntity(var2, var3, var4 + 1)); +- } +- +- return (IInventory)var5; +- } else { +- return null; +- } +- } else { +- return null; +- } +- } else { +- return null; +- } +- } else { +- return null; +- } +- } +- +- public TileEntity createNewTileEntity(World var1) { ++ par1World.func_96440_m(par2, par3, par4, par5); ++ } ++ ++ super.breakBlock(par1World, par2, par3, par4, par5, par6); ++ } ++ ++ /** ++ * Called upon block activation (right click on the block.) ++ */ ++ public boolean onBlockActivated(World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer, int par6, float par7, float par8, float par9) { ++ if (par1World.isRemote) { ++ return true; ++ } else { ++ IInventory var10 = this.getInventory(par1World, par2, par3, par4); ++ ++ if (var10 != null) { ++ par5EntityPlayer.displayGUIChest(var10); ++ } ++ ++ return true; ++ } ++ } ++ ++ /** ++ * Gets the inventory of the chest at the specified coords, accounting for blocks or ocelots on top of the chest, and ++ * double chests. ++ */ ++ public IInventory getInventory(World par1World, int par2, int par3, int par4) { ++ Object var5 = (TileEntityChest)par1World.getBlockTileEntity(par2, par3, par4); ++ ++ if (var5 == null) { ++ return null; ++ } else if (par1World.isBlockNormalCube(par2, par3 + 1, par4)) { ++ return null; ++ } else if (isOcelotBlockingChest(par1World, par2, par3, par4)) { ++ return null; ++ } else if (par1World.getBlockId(par2 - 1, par3, par4) == this.blockID && (par1World.isBlockNormalCube(par2 - 1, par3 + 1, par4) || isOcelotBlockingChest(par1World, par2 - 1, par3, par4))) { ++ return null; ++ } else if (par1World.getBlockId(par2 + 1, par3, par4) == this.blockID && (par1World.isBlockNormalCube(par2 + 1, par3 + 1, par4) || isOcelotBlockingChest(par1World, par2 + 1, par3, par4))) { ++ return null; ++ } else if (par1World.getBlockId(par2, par3, par4 - 1) == this.blockID && (par1World.isBlockNormalCube(par2, par3 + 1, par4 - 1) || isOcelotBlockingChest(par1World, par2, par3, par4 - 1))) { ++ return null; ++ } else if (par1World.getBlockId(par2, par3, par4 + 1) == this.blockID && (par1World.isBlockNormalCube(par2, par3 + 1, par4 + 1) || isOcelotBlockingChest(par1World, par2, par3, par4 + 1))) { ++ return null; ++ } else { ++ if (par1World.getBlockId(par2 - 1, par3, par4) == this.blockID) { ++ var5 = new InventoryLargeChest("container.chestDouble", (TileEntityChest)par1World.getBlockTileEntity(par2 - 1, par3, par4), (IInventory)var5); ++ } ++ ++ if (par1World.getBlockId(par2 + 1, par3, par4) == this.blockID) { ++ var5 = new InventoryLargeChest("container.chestDouble", (IInventory)var5, (TileEntityChest)par1World.getBlockTileEntity(par2 + 1, par3, par4)); ++ } ++ ++ if (par1World.getBlockId(par2, par3, par4 - 1) == this.blockID) { ++ var5 = new InventoryLargeChest("container.chestDouble", (TileEntityChest)par1World.getBlockTileEntity(par2, par3, par4 - 1), (IInventory)var5); ++ } ++ ++ if (par1World.getBlockId(par2, par3, par4 + 1) == this.blockID) { ++ var5 = new InventoryLargeChest("container.chestDouble", (IInventory)var5, (TileEntityChest)par1World.getBlockTileEntity(par2, par3, par4 + 1)); ++ } ++ ++ return (IInventory)var5; ++ } ++ } ++ ++ /** ++ * Returns a new instance of a block's tile entity class. Called on placing the block. ++ */ ++ public TileEntity createNewTileEntity(World par1World) { + TileEntityChest var2 = new TileEntityChest(); + return var2; + } + ++ /** ++ * Can this block provide power. Only wire currently seems to have this change based on its state. ++ */ + public boolean canProvidePower() { + return this.chestType == 1; + } + +- public int isProvidingWeakPower(IBlockAccess var1, int var2, int var3, int var4, int var5) { +- if(!this.canProvidePower()) { ++ /** ++ * Returns true if the block is emitting indirect/weak redstone power on the specified side. If isBlockNormalCube ++ * returns true, standard redstone propagation rules will apply instead and this will not be called. Args: World, X, Y, ++ * Z, side. Note that the side is reversed - eg it is 1 (up) when checking the bottom of the block. ++ */ ++ public int isProvidingWeakPower(IBlockAccess par1IBlockAccess, int par2, int par3, int par4, int par5) { ++ if (!this.canProvidePower()) { + return 0; + } else { +- int var6 = ((TileEntityChest)var1.getBlockTileEntity(var2, var3, var4)).numUsingPlayers; ++ int var6 = ((TileEntityChest)par1IBlockAccess.getBlockTileEntity(par2, par3, par4)).numUsingPlayers; + return MathHelper.clamp_int(var6, 0, 15); + } + } + +- public int isProvidingStrongPower(IBlockAccess var1, int var2, int var3, int var4, int var5) { +- return var5 == 1 ? this.isProvidingWeakPower(var1, var2, var3, var4, var5) : 0; ++ /** ++ * Returns true if the block is emitting direct/strong redstone power on the specified side. Args: World, X, Y, Z, ++ * side. Note that the side is reversed - eg it is 1 (up) when checking the bottom of the block. ++ */ ++ public int isProvidingStrongPower(IBlockAccess par1IBlockAccess, int par2, int par3, int par4, int par5) { ++ return par5 == 1 ? this.isProvidingWeakPower(par1IBlockAccess, par2, par3, par4, par5) : 0; + } + +- private static boolean isOcelotBlockingChest(World var0, int var1, int var2, int var3) { +- Iterator var4 = var0.getEntitiesWithinAABB(EntityOcelot.class, AxisAlignedBB.getAABBPool().getAABB((double)var1, (double)(var2 + 1), (double)var3, (double)(var1 + 1), (double)(var2 + 2), (double)(var3 + 1))).iterator(); +- ++ /** ++ * Looks for a sitting ocelot within certain bounds. Such an ocelot is considered to be blocking access to the chest. ++ */ ++ private static boolean isOcelotBlockingChest(World par0World, int par1, int par2, int par3) { ++ Iterator var4 = par0World.getEntitiesWithinAABB(EntityOcelot.class, AxisAlignedBB.getAABBPool().getAABB((double)par1, (double)(par2 + 1), (double)par3, (double)(par1 + 1), (double)(par2 + 2), (double)(par3 + 1))).iterator(); + EntityOcelot var6; ++ + do { +- if(!var4.hasNext()) { ++ if (!var4.hasNext()) { + return false; + } + + EntityOcelot var5 = (EntityOcelot)var4.next(); + var6 = (EntityOcelot)var5; +- } while(!var6.isSitting()); ++ } while (!var6.isSitting()); + + return true; + } + ++ /** ++ * If this returns true, then comparators facing away from this block will use the value from ++ * getComparatorInputOverride instead of the actual redstone signal strength. ++ */ + public boolean hasComparatorInputOverride() { + return true; + } + +- public int getComparatorInputOverride(World var1, int var2, int var3, int var4, int var5) { +- return Container.calcRedstoneFromInventory(this.getInventory(var1, var2, var3, var4)); ++ /** ++ * If hasComparatorInputOverride returns true, the return value from this is used instead of the redstone signal ++ * strength when this block inputs to a comparator. ++ */ ++ public int getComparatorInputOverride(World par1World, int par2, int par3, int par4, int par5) { ++ return Container.calcRedstoneFromInventory(this.getInventory(par1World, par2, par3, par4)); + } + +- public void registerIcons(IconRegister var1) { +- this.blockIcon = var1.registerIcon("planks_oak"); ++ /** ++ * When this method is called, your block should register all the icons it needs with the given IconRegister. This is ++ * the only chance you get to register icons. ++ */ ++ public void registerIcons(IconRegister par1IconRegister) { ++ this.blockIcon = par1IconRegister.registerIcon("planks_oak"); + } + } diff --git a/patches/net/minecraft/src/BlockClay.java.patch b/patches/net/minecraft/src/BlockClay.java.patch new file mode 100644 index 0000000..0fa0cf5 --- /dev/null +++ b/patches/net/minecraft/src/BlockClay.java.patch @@ -0,0 +1,29 @@ +--- net/minecraft/src/BlockClay.java ++++ net/minecraft/src/BlockClay.java +@@ -3,16 +3,22 @@ + import java.util.Random; + + public class BlockClay extends Block { +- public BlockClay(int var1) { +- super(var1, Material.clay); ++ public BlockClay(int par1) { ++ super(par1, Material.clay); + this.setCreativeTab(CreativeTabs.tabBlock); + } + +- public int idDropped(int var1, Random var2, int var3) { ++ /** ++ * Returns the ID of the items to drop on destruction. ++ */ ++ public int idDropped(int par1, Random par2Random, int par3) { + return Item.clay.itemID; + } + +- public int quantityDropped(Random var1) { ++ /** ++ * Returns the quantity of items to drop on block destruction. ++ */ ++ public int quantityDropped(Random par1Random) { + return 4; + } + } diff --git a/patches/net/minecraft/src/BlockCocoa.java.patch b/patches/net/minecraft/src/BlockCocoa.java.patch new file mode 100644 index 0000000..8527741 --- /dev/null +++ b/patches/net/minecraft/src/BlockCocoa.java.patch @@ -0,0 +1,290 @@ +--- net/minecraft/src/BlockCocoa.java ++++ net/minecraft/src/BlockCocoa.java +@@ -5,143 +5,196 @@ + public class BlockCocoa extends BlockDirectional { + private Icon[] iconArray; + +- public BlockCocoa(int var1) { +- super(var1, Material.plants); ++ public BlockCocoa(int par1) { ++ super(par1, Material.plants); + this.setTickRandomly(true); + } + +- public Icon getIcon(int var1, int var2) { ++ /** ++ * From the specified side and block metadata retrieves the blocks texture. Args: side, metadata ++ */ ++ public Icon getIcon(int par1, int par2) { + return this.iconArray[2]; + } + +- public Icon getCocoaIcon(int var1) { +- if(var1 < 0 || var1 >= this.iconArray.length) { +- var1 = this.iconArray.length - 1; ++ public Icon getCocoaIcon(int par1) { ++ if (par1 < 0 || par1 >= this.iconArray.length) { ++ par1 = this.iconArray.length - 1; + } + +- return this.iconArray[var1]; ++ return this.iconArray[par1]; + } + +- public void updateTick(World var1, int var2, int var3, int var4, Random var5) { +- if(!this.canBlockStay(var1, var2, var3, var4)) { +- this.dropBlockAsItem(var1, var2, var3, var4, var1.getBlockMetadata(var2, var3, var4), 0); +- var1.setBlock(var2, var3, var4, 0, 0, 2); +- } else if(var1.s.nextInt(5) == 0) { +- int var6 = var1.getBlockMetadata(var2, var3, var4); ++ /** ++ * Ticks the block if it's been scheduled ++ */ ++ public void updateTick(World par1World, int par2, int par3, int par4, Random par5Random) { ++ if (!this.canBlockStay(par1World, par2, par3, par4)) { ++ this.dropBlockAsItem(par1World, par2, par3, par4, par1World.getBlockMetadata(par2, par3, par4), 0); ++ par1World.setBlock(par2, par3, par4, 0, 0, 2); ++ } else if (par1World.rand.nextInt(5) == 0) { ++ int var6 = par1World.getBlockMetadata(par2, par3, par4); + int var7 = func_72219_c(var6); +- if(var7 < 2) { ++ ++ if (var7 < 2) { + ++var7; +- var1.setBlockMetadata(var2, var3, var4, var7 << 2 | getDirection(var6), 2); ++ par1World.setBlockMetadataWithNotify(par2, par3, par4, var7 << 2 | getDirection(var6), 2); + } + } +- +- } +- +- public boolean canBlockStay(World var1, int var2, int var3, int var4) { +- int var5 = getDirection(var1.getBlockMetadata(var2, var3, var4)); +- var2 += Direction.offsetX[var5]; +- var4 += Direction.offsetZ[var5]; +- int var6 = var1.getBlockId(var2, var3, var4); +- return var6 == Block.wood.blockID && BlockLog.limitToValidMetadata(var1.getBlockMetadata(var2, var3, var4)) == 3; +- } +- ++ } ++ ++ /** ++ * Can this block stay at this position. Similar to canPlaceBlockAt except gets checked often with plants. ++ */ ++ public boolean canBlockStay(World par1World, int par2, int par3, int par4) { ++ int var5 = getDirection(par1World.getBlockMetadata(par2, par3, par4)); ++ par2 += Direction.offsetX[var5]; ++ par4 += Direction.offsetZ[var5]; ++ int var6 = par1World.getBlockId(par2, par3, par4); ++ return var6 == Block.wood.blockID && BlockLog.limitToValidMetadata(par1World.getBlockMetadata(par2, par3, par4)) == 3; ++ } ++ ++ /** ++ * The type of render function that is called for this block ++ */ + public int getRenderType() { + return 28; + } + ++ /** ++ * If this block doesn't render as an ordinary block it will return False (examples: signs, buttons, stairs, etc) ++ */ + public boolean renderAsNormalBlock() { + return false; + } + ++ /** ++ * Is this block (a) opaque and (b) a full 1m cube? This determines whether or not to render the shared face of two ++ * adjacent blocks and also whether the player can attach torches, redstone wire, etc to this block. ++ */ + public boolean isOpaqueCube() { + return false; + } + +- public AxisAlignedBB getCollisionBoundingBoxFromPool(World var1, int var2, int var3, int var4) { +- this.setBlockBoundsBasedOnState(var1, var2, var3, var4); +- return super.getCollisionBoundingBoxFromPool(var1, var2, var3, var4); +- } +- +- public AxisAlignedBB getSelectedBoundingBoxFromPool(World var1, int var2, int var3, int var4) { +- this.setBlockBoundsBasedOnState(var1, var2, var3, var4); +- return super.getSelectedBoundingBoxFromPool(var1, var2, var3, var4); +- } +- +- public void setBlockBoundsBasedOnState(IBlockAccess var1, int var2, int var3, int var4) { +- int var5 = var1.getBlockMetadata(var2, var3, var4); ++ /** ++ * Returns a bounding box from the pool of bounding boxes (this means this box can change after the pool has been ++ * cleared to be reused) ++ */ ++ public AxisAlignedBB getCollisionBoundingBoxFromPool(World par1World, int par2, int par3, int par4) { ++ this.setBlockBoundsBasedOnState(par1World, par2, par3, par4); ++ return super.getCollisionBoundingBoxFromPool(par1World, par2, par3, par4); ++ } ++ ++ /** ++ * Returns the bounding box of the wired rectangular prism to render. ++ */ ++ public AxisAlignedBB getSelectedBoundingBoxFromPool(World par1World, int par2, int par3, int par4) { ++ this.setBlockBoundsBasedOnState(par1World, par2, par3, par4); ++ return super.getSelectedBoundingBoxFromPool(par1World, par2, par3, par4); ++ } ++ ++ /** ++ * Updates the blocks bounds based on its current state. Args: world, x, y, z ++ */ ++ public void setBlockBoundsBasedOnState(IBlockAccess par1IBlockAccess, int par2, int par3, int par4) { ++ int var5 = par1IBlockAccess.getBlockMetadata(par2, par3, par4); + int var6 = getDirection(var5); + int var7 = func_72219_c(var5); + int var8 = 4 + var7 * 2; + int var9 = 5 + var7 * 2; + float var10 = (float)var8 / 2.0F; +- switch(var6) { +- case 0: +- this.setBlockBounds((8.0F - var10) / 16.0F, (12.0F - (float)var9) / 16.0F, (15.0F - (float)var8) / 16.0F, (8.0F + var10) / 16.0F, 12.0F / 16.0F, 15.0F / 16.0F); +- break; +- case 1: +- this.setBlockBounds(1.0F / 16.0F, (12.0F - (float)var9) / 16.0F, (8.0F - var10) / 16.0F, (1.0F + (float)var8) / 16.0F, 12.0F / 16.0F, (8.0F + var10) / 16.0F); +- break; +- case 2: +- this.setBlockBounds((8.0F - var10) / 16.0F, (12.0F - (float)var9) / 16.0F, 1.0F / 16.0F, (8.0F + var10) / 16.0F, 12.0F / 16.0F, (1.0F + (float)var8) / 16.0F); +- break; +- case 3: +- this.setBlockBounds((15.0F - (float)var8) / 16.0F, (12.0F - (float)var9) / 16.0F, (8.0F - var10) / 16.0F, 15.0F / 16.0F, 12.0F / 16.0F, (8.0F + var10) / 16.0F); +- } +- +- } +- +- public void onBlockPlacedBy(World var1, int var2, int var3, int var4, EntityLivingBase var5, ItemStack var6) { +- int var7 = ((MathHelper.floor_double((double)(var5.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3) + 0) % 4; +- var1.setBlockMetadata(var2, var3, var4, var7, 2); +- } +- +- public int onBlockPlaced(World var1, int var2, int var3, int var4, int var5, float var6, float var7, float var8, int var9) { +- if(var5 == 1 || var5 == 0) { +- var5 = 2; +- } +- +- return Direction.rotateOpposite[Direction.facingToDirection[var5]]; +- } +- +- public void onNeighborBlockChange(World var1, int var2, int var3, int var4, int var5) { +- if(!this.canBlockStay(var1, var2, var3, var4)) { +- this.dropBlockAsItem(var1, var2, var3, var4, var1.getBlockMetadata(var2, var3, var4), 0); +- var1.setBlock(var2, var3, var4, 0, 0, 2); +- } +- +- } +- +- public static int func_72219_c(int var0) { +- return (var0 & 12) >> 2; +- } +- +- public void dropBlockAsItemWithChance(World var1, int var2, int var3, int var4, int var5, float var6, int var7) { +- int var8 = func_72219_c(var5); ++ ++ switch (var6) { ++ case 0: ++ this.setBlockBounds((8.0F - var10) / 16.0F, (12.0F - (float)var9) / 16.0F, (15.0F - (float)var8) / 16.0F, (8.0F + var10) / 16.0F, 0.75F, 0.9375F); ++ break; ++ ++ case 1: ++ this.setBlockBounds(0.0625F, (12.0F - (float)var9) / 16.0F, (8.0F - var10) / 16.0F, (1.0F + (float)var8) / 16.0F, 0.75F, (8.0F + var10) / 16.0F); ++ break; ++ ++ case 2: ++ this.setBlockBounds((8.0F - var10) / 16.0F, (12.0F - (float)var9) / 16.0F, 0.0625F, (8.0F + var10) / 16.0F, 0.75F, (1.0F + (float)var8) / 16.0F); ++ break; ++ ++ case 3: ++ this.setBlockBounds((15.0F - (float)var8) / 16.0F, (12.0F - (float)var9) / 16.0F, (8.0F - var10) / 16.0F, 0.9375F, 0.75F, (8.0F + var10) / 16.0F); ++ } ++ } ++ ++ /** ++ * Called when the block is placed in the world. ++ */ ++ public void onBlockPlacedBy(World par1World, int par2, int par3, int par4, EntityLivingBase par5EntityLivingBase, ItemStack par6ItemStack) { ++ int var7 = ((MathHelper.floor_double((double)(par5EntityLivingBase.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3) + 0) % 4; ++ par1World.setBlockMetadataWithNotify(par2, par3, par4, var7, 2); ++ } ++ ++ /** ++ * Called when a block is placed using its ItemBlock. Args: World, X, Y, Z, side, hitX, hitY, hitZ, block metadata ++ */ ++ public int onBlockPlaced(World par1World, int par2, int par3, int par4, int par5, float par6, float par7, float par8, int par9) { ++ if (par5 == 1 || par5 == 0) { ++ par5 = 2; ++ } ++ ++ return Direction.rotateOpposite[Direction.facingToDirection[par5]]; ++ } ++ ++ /** ++ * Lets the block know when one of its neighbor changes. Doesn't know which neighbor changed (coordinates passed are ++ * their own) Args: x, y, z, neighbor blockID ++ */ ++ public void onNeighborBlockChange(World par1World, int par2, int par3, int par4, int par5) { ++ if (!this.canBlockStay(par1World, par2, par3, par4)) { ++ this.dropBlockAsItem(par1World, par2, par3, par4, par1World.getBlockMetadata(par2, par3, par4), 0); ++ par1World.setBlock(par2, par3, par4, 0, 0, 2); ++ } ++ } ++ ++ public static int func_72219_c(int par0) { ++ return (par0 & 12) >> 2; ++ } ++ ++ /** ++ * Drops the block items with a specified chance of dropping the specified items ++ */ ++ public void dropBlockAsItemWithChance(World par1World, int par2, int par3, int par4, int par5, float par6, int par7) { ++ int var8 = func_72219_c(par5); + byte var9 = 1; +- if(var8 >= 2) { ++ ++ if (var8 >= 2) { + var9 = 3; + } + +- for(int var10 = 0; var10 < var9; ++var10) { +- this.dropBlockAsItem_do(var1, var2, var3, var4, new ItemStack(Item.dyePowder, 1, 3)); ++ for (int var10 = 0; var10 < var9; ++var10) { ++ this.dropBlockAsItem_do(par1World, par2, par3, par4, new ItemStack(Item.dyePowder, 1, 3)); + } +- + } + +- public int idPicked(World var1, int var2, int var3, int var4) { ++ /** ++ * only called by clickMiddleMouseButton , and passed to inventory.setCurrentItem (along with isCreative) ++ */ ++ public int idPicked(World par1World, int par2, int par3, int par4) { + return Item.dyePowder.itemID; + } + +- public int getDamageValue(World var1, int var2, int var3, int var4) { ++ /** ++ * Get the block's damage value (for use with pick block). ++ */ ++ public int getDamageValue(World par1World, int par2, int par3, int par4) { + return 3; + } + +- public void registerIcons(IconRegister var1) { ++ /** ++ * When this method is called, your block should register all the icons it needs with the given IconRegister. This is ++ * the only chance you get to register icons. ++ */ ++ public void registerIcons(IconRegister par1IconRegister) { + this.iconArray = new Icon[3]; + +- for(int var2 = 0; var2 < this.iconArray.length; ++var2) { +- this.iconArray[var2] = var1.registerIcon(this.getTextureName() + "_stage_" + var2); ++ for (int var2 = 0; var2 < this.iconArray.length; ++var2) { ++ this.iconArray[var2] = par1IconRegister.registerIcon(this.getTextureName() + "_stage_" + var2); + } +- + } + } diff --git a/patches/net/minecraft/src/BlockColored.java.patch b/patches/net/minecraft/src/BlockColored.java.patch new file mode 100644 index 0000000..0b6693b --- /dev/null +++ b/patches/net/minecraft/src/BlockColored.java.patch @@ -0,0 +1,86 @@ +--- net/minecraft/src/BlockColored.java ++++ net/minecraft/src/BlockColored.java +@@ -5,40 +5,57 @@ + public class BlockColored extends Block { + private Icon[] iconArray; + +- public BlockColored(int var1, Material var2) { +- super(var1, var2); ++ public BlockColored(int par1, Material par2Material) { ++ super(par1, par2Material); + this.setCreativeTab(CreativeTabs.tabBlock); + } + +- public Icon getIcon(int var1, int var2) { +- return this.iconArray[var2 % this.iconArray.length]; +- } +- +- public int damageDropped(int var1) { +- return var1; +- } +- +- public static int getBlockFromDye(int var0) { +- return ~var0 & 15; +- } +- +- public static int getDyeFromBlock(int var0) { +- return ~var0 & 15; +- } +- +- public void getSubBlocks(int var1, CreativeTabs var2, List var3) { +- for(int var4 = 0; var4 < 16; ++var4) { +- var3.add(new ItemStack(var1, 1, var4)); ++ /** ++ * From the specified side and block metadata retrieves the blocks texture. Args: side, metadata ++ */ ++ public Icon getIcon(int par1, int par2) { ++ return this.iconArray[par2 % this.iconArray.length]; ++ } ++ ++ /** ++ * Determines the damage on the item the block drops. Used in cloth and wood. ++ */ ++ public int damageDropped(int par1) { ++ return par1; ++ } ++ ++ /** ++ * Takes a dye damage value and returns the block damage value to match ++ */ ++ public static int getBlockFromDye(int par0) { ++ return ~par0 & 15; ++ } ++ ++ /** ++ * Takes a block damage value and returns the dye damage value to match ++ */ ++ public static int getDyeFromBlock(int par0) { ++ return ~par0 & 15; ++ } ++ ++ /** ++ * returns a list of blocks with the same ID, but different meta (eg: wood returns 4 blocks) ++ */ ++ public void getSubBlocks(int par1, CreativeTabs par2CreativeTabs, List par3List) { ++ for (int var4 = 0; var4 < 16; ++var4) { ++ par3List.add(new ItemStack(par1, 1, var4)); + } +- + } + +- public void registerIcons(IconRegister var1) { ++ /** ++ * When this method is called, your block should register all the icons it needs with the given IconRegister. This is ++ * the only chance you get to register icons. ++ */ ++ public void registerIcons(IconRegister par1IconRegister) { + this.iconArray = new Icon[16]; + +- for(int var2 = 0; var2 < this.iconArray.length; ++var2) { +- this.iconArray[var2] = var1.registerIcon(this.getTextureName() + "_" + ItemDye.b[getDyeFromBlock(var2)]); ++ for (int var2 = 0; var2 < this.iconArray.length; ++var2) { ++ this.iconArray[var2] = par1IconRegister.registerIcon(this.getTextureName() + "_" + ItemDye.dyeItemNames[getDyeFromBlock(var2)]); + } +- + } + } diff --git a/patches/net/minecraft/src/BlockCommandBlock.java.patch b/patches/net/minecraft/src/BlockCommandBlock.java.patch new file mode 100644 index 0000000..586a3b7 --- /dev/null +++ b/patches/net/minecraft/src/BlockCommandBlock.java.patch @@ -0,0 +1,137 @@ +--- net/minecraft/src/BlockCommandBlock.java ++++ net/minecraft/src/BlockCommandBlock.java +@@ -3,70 +3,101 @@ + import java.util.Random; + + public class BlockCommandBlock extends BlockContainer { +- public BlockCommandBlock(int var1) { +- super(var1, Material.iron); ++ public BlockCommandBlock(int par1) { ++ super(par1, Material.iron); + } + +- public TileEntity createNewTileEntity(World var1) { ++ /** ++ * Returns a new instance of a block's tile entity class. Called on placing the block. ++ */ ++ public TileEntity createNewTileEntity(World par1World) { + return new TileEntityCommandBlock(); + } + +- public void onNeighborBlockChange(World var1, int var2, int var3, int var4, int var5) { +- if(!var1.isRemote) { +- boolean var6 = var1.isBlockIndirectlyGettingPowered(var2, var3, var4); +- int var7 = var1.getBlockMetadata(var2, var3, var4); ++ /** ++ * Lets the block know when one of its neighbor changes. Doesn't know which neighbor changed (coordinates passed are ++ * their own) Args: x, y, z, neighbor blockID ++ */ ++ public void onNeighborBlockChange(World par1World, int par2, int par3, int par4, int par5) { ++ if (!par1World.isRemote) { ++ boolean var6 = par1World.isBlockIndirectlyGettingPowered(par2, par3, par4); ++ int var7 = par1World.getBlockMetadata(par2, par3, par4); + boolean var8 = (var7 & 1) != 0; +- if(var6 && !var8) { +- var1.setBlockMetadata(var2, var3, var4, var7 | 1, 4); +- var1.scheduleBlockUpdate(var2, var3, var4, this.blockID, this.tickRate(var1)); +- } else if(!var6 && var8) { +- var1.setBlockMetadata(var2, var3, var4, var7 & -2, 4); ++ ++ if (var6 && !var8) { ++ par1World.setBlockMetadataWithNotify(par2, par3, par4, var7 | 1, 4); ++ par1World.scheduleBlockUpdate(par2, par3, par4, this.blockID, this.tickRate(par1World)); ++ } else if (!var6 && var8) { ++ par1World.setBlockMetadataWithNotify(par2, par3, par4, var7 & -2, 4); + } + } +- + } + +- public void updateTick(World var1, int var2, int var3, int var4, Random var5) { +- TileEntity var6 = var1.getBlockTileEntity(var2, var3, var4); +- if(var6 != null && var6 instanceof TileEntityCommandBlock) { ++ /** ++ * Ticks the block if it's been scheduled ++ */ ++ public void updateTick(World par1World, int par2, int par3, int par4, Random par5Random) { ++ TileEntity var6 = par1World.getBlockTileEntity(par2, par3, par4); ++ ++ if (var6 != null && var6 instanceof TileEntityCommandBlock) { + TileEntityCommandBlock var7 = (TileEntityCommandBlock)var6; +- var7.setSignalStrength(var7.executeCommandOnPowered(var1)); +- var1.func_96440_m(var2, var3, var4, this.blockID); ++ var7.func_96102_a(var7.executeCommandOnPowered(par1World)); ++ par1World.func_96440_m(par2, par3, par4, this.blockID); + } +- + } + +- public int tickRate(World var1) { ++ /** ++ * How many world ticks before ticking ++ */ ++ public int tickRate(World par1World) { + return 1; + } + +- public boolean onBlockActivated(World var1, int var2, int var3, int var4, EntityPlayer var5, int var6, float var7, float var8, float var9) { +- TileEntityCommandBlock var10 = (TileEntityCommandBlock)var1.getBlockTileEntity(var2, var3, var4); +- if(var10 != null) { +- var5.displayGUIEditSign(var10); ++ /** ++ * Called upon block activation (right click on the block.) ++ */ ++ public boolean onBlockActivated(World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer, int par6, float par7, float par8, float par9) { ++ TileEntityCommandBlock var10 = (TileEntityCommandBlock)par1World.getBlockTileEntity(par2, par3, par4); ++ ++ if (var10 != null) { ++ par5EntityPlayer.displayGUIEditSign(var10); + } + + return true; + } + ++ /** ++ * If this returns true, then comparators facing away from this block will use the value from ++ * getComparatorInputOverride instead of the actual redstone signal strength. ++ */ + public boolean hasComparatorInputOverride() { + return true; + } + +- public int getComparatorInputOverride(World var1, int var2, int var3, int var4, int var5) { +- TileEntity var6 = var1.getBlockTileEntity(var2, var3, var4); +- return var6 != null && var6 instanceof TileEntityCommandBlock ? ((TileEntityCommandBlock)var6).getSignalStrength() : 0; ++ /** ++ * If hasComparatorInputOverride returns true, the return value from this is used instead of the redstone signal ++ * strength when this block inputs to a comparator. ++ */ ++ public int getComparatorInputOverride(World par1World, int par2, int par3, int par4, int par5) { ++ TileEntity var6 = par1World.getBlockTileEntity(par2, par3, par4); ++ return var6 != null && var6 instanceof TileEntityCommandBlock ? ((TileEntityCommandBlock)var6).func_96103_d() : 0; + } + +- public void onBlockPlacedBy(World var1, int var2, int var3, int var4, EntityLivingBase var5, ItemStack var6) { +- TileEntityCommandBlock var7 = (TileEntityCommandBlock)var1.getBlockTileEntity(var2, var3, var4); +- if(var6.hasDisplayName()) { +- var7.setCommandSenderName(var6.getDisplayName()); ++ /** ++ * Called when the block is placed in the world. ++ */ ++ public void onBlockPlacedBy(World par1World, int par2, int par3, int par4, EntityLivingBase par5EntityLivingBase, ItemStack par6ItemStack) { ++ TileEntityCommandBlock var7 = (TileEntityCommandBlock)par1World.getBlockTileEntity(par2, par3, par4); ++ ++ if (par6ItemStack.hasDisplayName()) { ++ var7.setCommandSenderName(par6ItemStack.getDisplayName()); + } +- + } + +- public int quantityDropped(Random var1) { ++ /** ++ * Returns the quantity of items to drop on block destruction. ++ */ ++ public int quantityDropped(Random par1Random) { + return 0; + } + } diff --git a/patches/net/minecraft/src/BlockComparator.java.patch b/patches/net/minecraft/src/BlockComparator.java.patch new file mode 100644 index 0000000..7df31b6 --- /dev/null +++ b/patches/net/minecraft/src/BlockComparator.java.patch @@ -0,0 +1,319 @@ +--- net/minecraft/src/BlockComparator.java ++++ net/minecraft/src/BlockComparator.java +@@ -3,20 +3,26 @@ + import java.util.Random; + + public class BlockComparator extends BlockRedstoneLogic implements ITileEntityProvider { +- public BlockComparator(int var1, boolean var2) { +- super(var1, var2); ++ public BlockComparator(int par1, boolean par2) { ++ super(par1, par2); + this.isBlockContainer = true; + } + +- public int idDropped(int var1, Random var2, int var3) { +- return Item.comparator.itemID; +- } +- +- public int idPicked(World var1, int var2, int var3, int var4) { +- return Item.comparator.itemID; +- } +- +- protected int func_94481_j_(int var1) { ++ /** ++ * Returns the ID of the items to drop on destruction. ++ */ ++ public int idDropped(int par1, Random par2Random, int par3) { ++ return Item.comparator.itemID; ++ } ++ ++ /** ++ * only called by clickMiddleMouseButton , and passed to inventory.setCurrentItem (along with isCreative) ++ */ ++ public int idPicked(World par1World, int par2, int par3, int par4) { ++ return Item.comparator.itemID; ++ } ++ ++ protected int func_94481_j_(int par1) { + return 2; + } + +@@ -28,58 +34,70 @@ + return Block.redstoneComparatorIdle; + } + ++ /** ++ * The type of render function that is called for this block ++ */ + public int getRenderType() { + return 37; + } + +- public Icon getIcon(int var1, int var2) { +- boolean var3 = this.isRepeaterPowered || (var2 & 8) != 0; +- return var1 == 0 ? (var3 ? Block.torchRedstoneActive.getBlockTextureFromSide(var1) : Block.torchRedstoneIdle.getBlockTextureFromSide(var1)) : (var1 == 1 ? (var3 ? Block.redstoneComparatorActive.blockIcon : this.blockIcon) : Block.stoneDoubleSlab.getBlockTextureFromSide(1)); +- } +- +- protected boolean func_96470_c(int var1) { +- return this.isRepeaterPowered || (var1 & 8) != 0; +- } +- +- protected int func_94480_d(IBlockAccess var1, int var2, int var3, int var4, int var5) { +- return this.getTileEntityComparator(var1, var2, var3, var4).getOutputSignal(); +- } +- +- private int getOutputStrength(World var1, int var2, int var3, int var4, int var5) { +- return !this.func_94490_c(var5) ? this.getInputStrength(var1, var2, var3, var4, var5) : Math.max(this.getInputStrength(var1, var2, var3, var4, var5) - this.func_94482_f(var1, var2, var3, var4, var5), 0); +- } +- +- public boolean func_94490_c(int var1) { +- return (var1 & 4) == 4; +- } +- +- protected boolean isGettingInput(World var1, int var2, int var3, int var4, int var5) { +- int var6 = this.getInputStrength(var1, var2, var3, var4, var5); +- if(var6 >= 15) { ++ /** ++ * From the specified side and block metadata retrieves the blocks texture. Args: side, metadata ++ */ ++ public Icon getIcon(int par1, int par2) { ++ boolean var3 = this.isRepeaterPowered || (par2 & 8) != 0; ++ return par1 == 0 ? (var3 ? Block.torchRedstoneActive.getBlockTextureFromSide(par1) : Block.torchRedstoneIdle.getBlockTextureFromSide(par1)) : (par1 == 1 ? (var3 ? Block.redstoneComparatorActive.blockIcon : this.blockIcon) : Block.stoneDoubleSlab.getBlockTextureFromSide(1)); ++ } ++ ++ protected boolean func_96470_c(int par1) { ++ return this.isRepeaterPowered || (par1 & 8) != 0; ++ } ++ ++ protected int func_94480_d(IBlockAccess par1IBlockAccess, int par2, int par3, int par4, int par5) { ++ return this.getTileEntityComparator(par1IBlockAccess, par2, par3, par4).getOutputSignal(); ++ } ++ ++ private int getOutputStrength(World par1World, int par2, int par3, int par4, int par5) { ++ return !this.func_94490_c(par5) ? this.getInputStrength(par1World, par2, par3, par4, par5) : Math.max(this.getInputStrength(par1World, par2, par3, par4, par5) - this.func_94482_f(par1World, par2, par3, par4, par5), 0); ++ } ++ ++ public boolean func_94490_c(int par1) { ++ return (par1 & 4) == 4; ++ } ++ ++ protected boolean isGettingInput(World par1World, int par2, int par3, int par4, int par5) { ++ int var6 = this.getInputStrength(par1World, par2, par3, par4, par5); ++ ++ if (var6 >= 15) { + return true; +- } else if(var6 == 0) { ++ } else if (var6 == 0) { + return false; + } else { +- int var7 = this.func_94482_f(var1, var2, var3, var4, var5); ++ int var7 = this.func_94482_f(par1World, par2, par3, par4, par5); + return var7 == 0 ? true : var6 >= var7; + } + } + +- protected int getInputStrength(World var1, int var2, int var3, int var4, int var5) { +- int var6 = super.getInputStrength(var1, var2, var3, var4, var5); +- int var7 = getDirection(var5); +- int var8 = var2 + Direction.offsetX[var7]; +- int var9 = var4 + Direction.offsetZ[var7]; +- int var10 = var1.getBlockId(var8, var3, var9); +- if(var10 > 0) { +- if(Block.blocksList[var10].hasComparatorInputOverride()) { +- var6 = Block.blocksList[var10].getComparatorInputOverride(var1, var8, var3, var9, Direction.rotateOpposite[var7]); +- } else if(var6 < 15 && Block.isNormalCube(var10)) { ++ /** ++ * Returns the signal strength at one input of the block. Args: world, X, Y, Z, side ++ */ ++ protected int getInputStrength(World par1World, int par2, int par3, int par4, int par5) { ++ int var6 = super.getInputStrength(par1World, par2, par3, par4, par5); ++ int var7 = getDirection(par5); ++ int var8 = par2 + Direction.offsetX[var7]; ++ int var9 = par4 + Direction.offsetZ[var7]; ++ int var10 = par1World.getBlockId(var8, par3, var9); ++ ++ if (var10 > 0) { ++ if (Block.blocksList[var10].hasComparatorInputOverride()) { ++ var6 = Block.blocksList[var10].getComparatorInputOverride(par1World, var8, par3, var9, Direction.rotateOpposite[var7]); ++ } else if (var6 < 15 && Block.isNormalCube(var10)) { + var8 += Direction.offsetX[var7]; + var9 += Direction.offsetZ[var7]; +- var10 = var1.getBlockId(var8, var3, var9); +- if(var10 > 0 && Block.blocksList[var10].hasComparatorInputOverride()) { +- var6 = Block.blocksList[var10].getComparatorInputOverride(var1, var8, var3, var9, Direction.rotateOpposite[var7]); ++ var10 = par1World.getBlockId(var8, par3, var9); ++ ++ if (var10 > 0 && Block.blocksList[var10].hasComparatorInputOverride()) { ++ var6 = Block.blocksList[var10].getComparatorInputOverride(par1World, var8, par3, var9, Direction.rotateOpposite[var7]); + } + } + } +@@ -87,84 +105,108 @@ + return var6; + } + +- public TileEntityComparator getTileEntityComparator(IBlockAccess var1, int var2, int var3, int var4) { +- return (TileEntityComparator)var1.getBlockTileEntity(var2, var3, var4); ++ /** ++ * Returns the blockTileEntity at given coordinates. ++ */ ++ public TileEntityComparator getTileEntityComparator(IBlockAccess par1IBlockAccess, int par2, int par3, int par4) { ++ return (TileEntityComparator)par1IBlockAccess.getBlockTileEntity(par2, par3, par4); + } + +- public boolean onBlockActivated(World var1, int var2, int var3, int var4, EntityPlayer var5, int var6, float var7, float var8, float var9) { +- int var10 = var1.getBlockMetadata(var2, var3, var4); ++ /** ++ * Called upon block activation (right click on the block.) ++ */ ++ public boolean onBlockActivated(World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer, int par6, float par7, float par8, float par9) { ++ int var10 = par1World.getBlockMetadata(par2, par3, par4); + boolean var11 = this.isRepeaterPowered | (var10 & 8) != 0; + boolean var12 = !this.func_94490_c(var10); + int var13 = var12 ? 4 : 0; + var13 |= var11 ? 8 : 0; +- var1.playSoundEffect((double)var2 + 0.5D, (double)var3 + 0.5D, (double)var4 + 0.5D, "random.click", 0.3F, var12 ? 0.55F : 0.5F); +- var1.setBlockMetadata(var2, var3, var4, var13 | var10 & 3, 2); +- this.func_96476_c(var1, var2, var3, var4, var1.s); ++ par1World.playSoundEffect((double)par2 + 0.5D, (double)par3 + 0.5D, (double)par4 + 0.5D, "random.click", 0.3F, var12 ? 0.55F : 0.5F); ++ par1World.setBlockMetadataWithNotify(par2, par3, par4, var13 | var10 & 3, 2); ++ this.func_96476_c(par1World, par2, par3, par4, par1World.rand); + return true; + } + +- protected void func_94479_f(World var1, int var2, int var3, int var4, int var5) { +- if(!var1.isBlockTickScheduledThisTick(var2, var3, var4, this.blockID)) { +- int var6 = var1.getBlockMetadata(var2, var3, var4); +- int var7 = this.getOutputStrength(var1, var2, var3, var4, var6); +- int var8 = this.getTileEntityComparator(var1, var2, var3, var4).getOutputSignal(); +- if(var7 != var8 || this.func_96470_c(var6) != this.isGettingInput(var1, var2, var3, var4, var6)) { +- if(this.func_83011_d(var1, var2, var3, var4, var6)) { +- var1.scheduleBlockUpdateWithPriority(var2, var3, var4, this.blockID, this.func_94481_j_(0), -1); ++ protected void func_94479_f(World par1World, int par2, int par3, int par4, int par5) { ++ if (!par1World.isBlockTickScheduledThisTick(par2, par3, par4, this.blockID)) { ++ int var6 = par1World.getBlockMetadata(par2, par3, par4); ++ int var7 = this.getOutputStrength(par1World, par2, par3, par4, var6); ++ int var8 = this.getTileEntityComparator(par1World, par2, par3, par4).getOutputSignal(); ++ ++ if (var7 != var8 || this.func_96470_c(var6) != this.isGettingInput(par1World, par2, par3, par4, var6)) { ++ if (this.func_83011_d(par1World, par2, par3, par4, var6)) { ++ par1World.scheduleBlockUpdateWithPriority(par2, par3, par4, this.blockID, this.func_94481_j_(0), -1); + } else { +- var1.scheduleBlockUpdateWithPriority(var2, var3, var4, this.blockID, this.func_94481_j_(0), 0); ++ par1World.scheduleBlockUpdateWithPriority(par2, par3, par4, this.blockID, this.func_94481_j_(0), 0); + } + } + } +- + } + +- private void func_96476_c(World var1, int var2, int var3, int var4, Random var5) { +- int var6 = var1.getBlockMetadata(var2, var3, var4); +- int var7 = this.getOutputStrength(var1, var2, var3, var4, var6); +- int var8 = this.getTileEntityComparator(var1, var2, var3, var4).getOutputSignal(); +- this.getTileEntityComparator(var1, var2, var3, var4).setOutputSignal(var7); +- if(var8 != var7 || !this.func_94490_c(var6)) { +- boolean var9 = this.isGettingInput(var1, var2, var3, var4, var6); ++ private void func_96476_c(World par1World, int par2, int par3, int par4, Random par5Random) { ++ int var6 = par1World.getBlockMetadata(par2, par3, par4); ++ int var7 = this.getOutputStrength(par1World, par2, par3, par4, var6); ++ int var8 = this.getTileEntityComparator(par1World, par2, par3, par4).getOutputSignal(); ++ this.getTileEntityComparator(par1World, par2, par3, par4).setOutputSignal(var7); ++ ++ if (var8 != var7 || !this.func_94490_c(var6)) { ++ boolean var9 = this.isGettingInput(par1World, par2, par3, par4, var6); + boolean var10 = this.isRepeaterPowered || (var6 & 8) != 0; +- if(var10 && !var9) { +- var1.setBlockMetadata(var2, var3, var4, var6 & -9, 2); +- } else if(!var10 && var9) { +- var1.setBlockMetadata(var2, var3, var4, var6 | 8, 2); ++ ++ if (var10 && !var9) { ++ par1World.setBlockMetadataWithNotify(par2, par3, par4, var6 & -9, 2); ++ } else if (!var10 && var9) { ++ par1World.setBlockMetadataWithNotify(par2, par3, par4, var6 | 8, 2); + } + +- this.func_94483_i_(var1, var2, var3, var4); +- } +- +- } +- +- public void updateTick(World var1, int var2, int var3, int var4, Random var5) { +- if(this.isRepeaterPowered) { +- int var6 = var1.getBlockMetadata(var2, var3, var4); +- var1.setBlock(var2, var3, var4, this.func_94484_i().blockID, var6 | 8, 4); +- } +- +- this.func_96476_c(var1, var2, var3, var4, var5); +- } +- +- public void onBlockAdded(World var1, int var2, int var3, int var4) { +- super.onBlockAdded(var1, var2, var3, var4); +- var1.setBlockTileEntity(var2, var3, var4, this.createNewTileEntity(var1)); +- } +- +- public void breakBlock(World var1, int var2, int var3, int var4, int var5, int var6) { +- super.breakBlock(var1, var2, var3, var4, var5, var6); +- var1.removeBlockTileEntity(var2, var3, var4); +- this.func_94483_i_(var1, var2, var3, var4); +- } +- +- public boolean onBlockEventReceived(World var1, int var2, int var3, int var4, int var5, int var6) { +- super.onBlockEventReceived(var1, var2, var3, var4, var5, var6); +- TileEntity var7 = var1.getBlockTileEntity(var2, var3, var4); +- return var7 != null ? var7.receiveClientEvent(var5, var6) : false; +- } +- +- public TileEntity createNewTileEntity(World var1) { ++ this.func_94483_i_(par1World, par2, par3, par4); ++ } ++ } ++ ++ /** ++ * Ticks the block if it's been scheduled ++ */ ++ public void updateTick(World par1World, int par2, int par3, int par4, Random par5Random) { ++ if (this.isRepeaterPowered) { ++ int var6 = par1World.getBlockMetadata(par2, par3, par4); ++ par1World.setBlock(par2, par3, par4, this.func_94484_i().blockID, var6 | 8, 4); ++ } ++ ++ this.func_96476_c(par1World, par2, par3, par4, par5Random); ++ } ++ ++ /** ++ * Called whenever the block is added into the world. Args: world, x, y, z ++ */ ++ public void onBlockAdded(World par1World, int par2, int par3, int par4) { ++ super.onBlockAdded(par1World, par2, par3, par4); ++ par1World.setBlockTileEntity(par2, par3, par4, this.createNewTileEntity(par1World)); ++ } ++ ++ /** ++ * Called on server worlds only when the block has been replaced by a different block ID, or the same block with a ++ * different metadata value, but before the new metadata value is set. Args: World, x, y, z, old block ID, old metadata ++ */ ++ public void breakBlock(World par1World, int par2, int par3, int par4, int par5, int par6) { ++ super.breakBlock(par1World, par2, par3, par4, par5, par6); ++ par1World.removeBlockTileEntity(par2, par3, par4); ++ this.func_94483_i_(par1World, par2, par3, par4); ++ } ++ ++ /** ++ * Called when the block receives a BlockEvent - see World.addBlockEvent. By default, passes it on to the tile entity ++ * at this location. Args: world, x, y, z, blockID, EventID, event parameter ++ */ ++ public boolean onBlockEventReceived(World par1World, int par2, int par3, int par4, int par5, int par6) { ++ super.onBlockEventReceived(par1World, par2, par3, par4, par5, par6); ++ TileEntity var7 = par1World.getBlockTileEntity(par2, par3, par4); ++ return var7 != null ? var7.receiveClientEvent(par5, par6) : false; ++ } ++ ++ /** ++ * Returns a new instance of a block's tile entity class. Called on placing the block. ++ */ ++ public TileEntity createNewTileEntity(World par1World) { + return new TileEntityComparator(); + } + } diff --git a/patches/net/minecraft/src/BlockContainer.java.patch b/patches/net/minecraft/src/BlockContainer.java.patch new file mode 100644 index 0000000..e2feda1 --- /dev/null +++ b/patches/net/minecraft/src/BlockContainer.java.patch @@ -0,0 +1,52 @@ +--- net/minecraft/src/BlockContainer.java ++++ net/minecraft/src/BlockContainer.java +@@ -1,23 +1,34 @@ + package net.minecraft.src; + + public abstract class BlockContainer extends Block implements ITileEntityProvider { +- protected BlockContainer(int var1, Material var2) { +- super(var1, var2); ++ protected BlockContainer(int par1, Material par2Material) { ++ super(par1, par2Material); + this.isBlockContainer = true; + } + +- public void onBlockAdded(World var1, int var2, int var3, int var4) { +- super.onBlockAdded(var1, var2, var3, var4); +- } +- +- public void breakBlock(World var1, int var2, int var3, int var4, int var5, int var6) { +- super.breakBlock(var1, var2, var3, var4, var5, var6); +- var1.removeBlockTileEntity(var2, var3, var4); +- } +- +- public boolean onBlockEventReceived(World var1, int var2, int var3, int var4, int var5, int var6) { +- super.onBlockEventReceived(var1, var2, var3, var4, var5, var6); +- TileEntity var7 = var1.getBlockTileEntity(var2, var3, var4); +- return var7 != null ? var7.receiveClientEvent(var5, var6) : false; ++ /** ++ * Called whenever the block is added into the world. Args: world, x, y, z ++ */ ++ public void onBlockAdded(World par1World, int par2, int par3, int par4) { ++ super.onBlockAdded(par1World, par2, par3, par4); ++ } ++ ++ /** ++ * Called on server worlds only when the block has been replaced by a different block ID, or the same block with a ++ * different metadata value, but before the new metadata value is set. Args: World, x, y, z, old block ID, old metadata ++ */ ++ public void breakBlock(World par1World, int par2, int par3, int par4, int par5, int par6) { ++ super.breakBlock(par1World, par2, par3, par4, par5, par6); ++ par1World.removeBlockTileEntity(par2, par3, par4); ++ } ++ ++ /** ++ * Called when the block receives a BlockEvent - see World.addBlockEvent. By default, passes it on to the tile entity ++ * at this location. Args: world, x, y, z, blockID, EventID, event parameter ++ */ ++ public boolean onBlockEventReceived(World par1World, int par2, int par3, int par4, int par5, int par6) { ++ super.onBlockEventReceived(par1World, par2, par3, par4, par5, par6); ++ TileEntity var7 = par1World.getBlockTileEntity(par2, par3, par4); ++ return var7 != null ? var7.receiveClientEvent(par5, par6) : false; + } + } diff --git a/patches/net/minecraft/src/BlockCrops.java.patch b/patches/net/minecraft/src/BlockCrops.java.patch new file mode 100644 index 0000000..e21a5aa --- /dev/null +++ b/patches/net/minecraft/src/BlockCrops.java.patch @@ -0,0 +1,242 @@ +--- net/minecraft/src/BlockCrops.java ++++ net/minecraft/src/BlockCrops.java +@@ -5,8 +5,8 @@ + public class BlockCrops extends BlockFlower { + private Icon[] iconArray; + +- protected BlockCrops(int var1) { +- super(var1); ++ protected BlockCrops(int par1) { ++ super(par1); + this.setTickRandomly(true); + float var2 = 0.5F; + this.setBlockBounds(0.5F - var2, 0.0F, 0.5F - var2, 0.5F + var2, 0.25F, 0.5F + var2); +@@ -16,60 +16,80 @@ + this.disableStats(); + } + +- protected boolean canThisPlantGrowOnThisBlockID(int var1) { +- return var1 == Block.tilledField.blockID; ++ /** ++ * Gets passed in the blockID of the block below and supposed to return true if its allowed to grow on the type of ++ * blockID passed in. Args: blockID ++ */ ++ protected boolean canThisPlantGrowOnThisBlockID(int par1) { ++ return par1 == Block.tilledField.blockID; + } + +- public void updateTick(World var1, int var2, int var3, int var4, Random var5) { +- super.updateTick(var1, var2, var3, var4, var5); +- if(var1.getBlockLightValue(var2, var3 + 1, var4) >= 9) { +- int var6 = var1.getBlockMetadata(var2, var3, var4); +- if(var6 < 7) { +- float var7 = this.getGrowthRate(var1, var2, var3, var4); +- if(var5.nextInt((int)(25.0F / var7) + 1) == 0) { ++ /** ++ * Ticks the block if it's been scheduled ++ */ ++ public void updateTick(World par1World, int par2, int par3, int par4, Random par5Random) { ++ super.updateTick(par1World, par2, par3, par4, par5Random); ++ ++ if (par1World.getBlockLightValue(par2, par3 + 1, par4) >= 9) { ++ int var6 = par1World.getBlockMetadata(par2, par3, par4); ++ ++ if (var6 < 7) { ++ float var7 = this.getGrowthRate(par1World, par2, par3, par4); ++ ++ if (par5Random.nextInt((int)(25.0F / var7) + 1) == 0) { + ++var6; +- var1.setBlockMetadata(var2, var3, var4, var6, 2); ++ par1World.setBlockMetadataWithNotify(par2, par3, par4, var6, 2); + } + } + } +- + } + +- public void fertilize(World var1, int var2, int var3, int var4) { +- int var5 = var1.getBlockMetadata(var2, var3, var4) + MathHelper.getRandomIntegerInRange(var1.s, 2, 5); +- if(var5 > 7) { ++ /** ++ * Apply bonemeal to the crops. ++ */ ++ public void fertilize(World par1World, int par2, int par3, int par4) { ++ int var5 = par1World.getBlockMetadata(par2, par3, par4) + MathHelper.getRandomIntegerInRange(par1World.rand, 2, 5); ++ ++ if (var5 > 7) { + var5 = 7; + } + +- var1.setBlockMetadata(var2, var3, var4, var5, 2); ++ par1World.setBlockMetadataWithNotify(par2, par3, par4, var5, 2); + } + +- private float getGrowthRate(World var1, int var2, int var3, int var4) { ++ /** ++ * Gets the growth rate for the crop. Setup to encourage rows by halving growth rate if there is diagonals, crops on ++ * different sides that aren't opposing, and by adding growth for every crop next to this one (and for crop below this ++ * one). Args: x, y, z ++ */ ++ private float getGrowthRate(World par1World, int par2, int par3, int par4) { + float var5 = 1.0F; +- int var6 = var1.getBlockId(var2, var3, var4 - 1); +- int var7 = var1.getBlockId(var2, var3, var4 + 1); +- int var8 = var1.getBlockId(var2 - 1, var3, var4); +- int var9 = var1.getBlockId(var2 + 1, var3, var4); +- int var10 = var1.getBlockId(var2 - 1, var3, var4 - 1); +- int var11 = var1.getBlockId(var2 + 1, var3, var4 - 1); +- int var12 = var1.getBlockId(var2 + 1, var3, var4 + 1); +- int var13 = var1.getBlockId(var2 - 1, var3, var4 + 1); ++ int var6 = par1World.getBlockId(par2, par3, par4 - 1); ++ int var7 = par1World.getBlockId(par2, par3, par4 + 1); ++ int var8 = par1World.getBlockId(par2 - 1, par3, par4); ++ int var9 = par1World.getBlockId(par2 + 1, par3, par4); ++ int var10 = par1World.getBlockId(par2 - 1, par3, par4 - 1); ++ int var11 = par1World.getBlockId(par2 + 1, par3, par4 - 1); ++ int var12 = par1World.getBlockId(par2 + 1, par3, par4 + 1); ++ int var13 = par1World.getBlockId(par2 - 1, par3, par4 + 1); + boolean var14 = var8 == this.blockID || var9 == this.blockID; + boolean var15 = var6 == this.blockID || var7 == this.blockID; + boolean var16 = var10 == this.blockID || var11 == this.blockID || var12 == this.blockID || var13 == this.blockID; + +- for(int var17 = var2 - 1; var17 <= var2 + 1; ++var17) { +- for(int var18 = var4 - 1; var18 <= var4 + 1; ++var18) { +- int var19 = var1.getBlockId(var17, var3 - 1, var18); ++ for (int var17 = par2 - 1; var17 <= par2 + 1; ++var17) { ++ for (int var18 = par4 - 1; var18 <= par4 + 1; ++var18) { ++ int var19 = par1World.getBlockId(var17, par3 - 1, var18); + float var20 = 0.0F; +- if(var19 == Block.tilledField.blockID) { ++ ++ if (var19 == Block.tilledField.blockID) { + var20 = 1.0F; +- if(var1.getBlockMetadata(var17, var3 - 1, var18) > 0) { ++ ++ if (par1World.getBlockMetadata(var17, par3 - 1, var18) > 0) { + var20 = 3.0F; + } + } + +- if(var17 != var2 || var18 != var4) { ++ if (var17 != par2 || var18 != par4) { + var20 /= 4.0F; + } + +@@ -77,67 +97,94 @@ + } + } + +- if(var16 || var14 && var15) { ++ if (var16 || var14 && var15) { + var5 /= 2.0F; + } + + return var5; + } + +- public Icon getIcon(int var1, int var2) { +- if(var2 < 0 || var2 > 7) { +- var2 = 7; ++ /** ++ * From the specified side and block metadata retrieves the blocks texture. Args: side, metadata ++ */ ++ public Icon getIcon(int par1, int par2) { ++ if (par2 < 0 || par2 > 7) { ++ par2 = 7; + } + +- return this.iconArray[var2]; ++ return this.iconArray[par2]; + } + ++ /** ++ * The type of render function that is called for this block ++ */ + public int getRenderType() { + return 6; + } + ++ /** ++ * Generate a seed ItemStack for this crop. ++ */ + protected int getSeedItem() { + return Item.seeds.itemID; + } + ++ /** ++ * Generate a crop produce ItemStack for this crop. ++ */ + protected int getCropItem() { + return Item.wheat.itemID; + } + +- public void dropBlockAsItemWithChance(World var1, int var2, int var3, int var4, int var5, float var6, int var7) { +- super.dropBlockAsItemWithChance(var1, var2, var3, var4, var5, var6, 0); +- if(!var1.isRemote) { +- if(var5 >= 7) { +- int var8 = 3 + var7; +- +- for(int var9 = 0; var9 < var8; ++var9) { +- if(var1.s.nextInt(15) <= var5) { +- this.dropBlockAsItem_do(var1, var2, var3, var4, new ItemStack(this.getSeedItem(), 1, 0)); ++ /** ++ * Drops the block items with a specified chance of dropping the specified items ++ */ ++ public void dropBlockAsItemWithChance(World par1World, int par2, int par3, int par4, int par5, float par6, int par7) { ++ super.dropBlockAsItemWithChance(par1World, par2, par3, par4, par5, par6, 0); ++ ++ if (!par1World.isRemote) { ++ if (par5 >= 7) { ++ int var8 = 3 + par7; ++ ++ for (int var9 = 0; var9 < var8; ++var9) { ++ if (par1World.rand.nextInt(15) <= par5) { ++ this.dropBlockAsItem_do(par1World, par2, par3, par4, new ItemStack(this.getSeedItem(), 1, 0)); + } + } + } +- + } + } + +- public int idDropped(int var1, Random var2, int var3) { +- return var1 == 7 ? this.getCropItem() : this.getSeedItem(); ++ /** ++ * Returns the ID of the items to drop on destruction. ++ */ ++ public int idDropped(int par1, Random par2Random, int par3) { ++ return par1 == 7 ? this.getCropItem() : this.getSeedItem(); + } + +- public int quantityDropped(Random var1) { ++ /** ++ * Returns the quantity of items to drop on block destruction. ++ */ ++ public int quantityDropped(Random par1Random) { + return 1; + } + +- public int idPicked(World var1, int var2, int var3, int var4) { ++ /** ++ * only called by clickMiddleMouseButton , and passed to inventory.setCurrentItem (along with isCreative) ++ */ ++ public int idPicked(World par1World, int par2, int par3, int par4) { + return this.getSeedItem(); + } + +- public void registerIcons(IconRegister var1) { ++ /** ++ * When this method is called, your block should register all the icons it needs with the given IconRegister. This is ++ * the only chance you get to register icons. ++ */ ++ public void registerIcons(IconRegister par1IconRegister) { + this.iconArray = new Icon[8]; + +- for(int var2 = 0; var2 < this.iconArray.length; ++var2) { +- this.iconArray[var2] = var1.registerIcon(this.getTextureName() + "_stage_" + var2); ++ for (int var2 = 0; var2 < this.iconArray.length; ++var2) { ++ this.iconArray[var2] = par1IconRegister.registerIcon(this.getTextureName() + "_stage_" + var2); + } +- + } + } diff --git a/patches/net/minecraft/src/BlockDaylightDetector.java.patch b/patches/net/minecraft/src/BlockDaylightDetector.java.patch new file mode 100644 index 0000000..83b7238 --- /dev/null +++ b/patches/net/minecraft/src/BlockDaylightDetector.java.patch @@ -0,0 +1,155 @@ +--- net/minecraft/src/BlockDaylightDetector.java ++++ net/minecraft/src/BlockDaylightDetector.java +@@ -5,78 +5,114 @@ + public class BlockDaylightDetector extends BlockContainer { + private Icon[] iconArray = new Icon[2]; + +- public BlockDaylightDetector(int var1) { +- super(var1, Material.wood); +- this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 6.0F / 16.0F, 1.0F); ++ public BlockDaylightDetector(int par1) { ++ super(par1, Material.wood); ++ this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.375F, 1.0F); + this.setCreativeTab(CreativeTabs.tabRedstone); + } + +- public void setBlockBoundsBasedOnState(IBlockAccess var1, int var2, int var3, int var4) { +- this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 6.0F / 16.0F, 1.0F); +- } +- +- public int isProvidingWeakPower(IBlockAccess var1, int var2, int var3, int var4, int var5) { +- return var1.getBlockMetadata(var2, var3, var4); +- } +- +- public void updateTick(World var1, int var2, int var3, int var4, Random var5) { +- } +- +- public void onNeighborBlockChange(World var1, int var2, int var3, int var4, int var5) { +- } +- +- public void onBlockAdded(World var1, int var2, int var3, int var4) { +- } +- +- public void updateLightLevel(World var1, int var2, int var3, int var4) { +- if(!var1.provider.hasNoSky) { +- int var5 = var1.getBlockMetadata(var2, var3, var4); +- int var6 = var1.getSavedLightValue(EnumSkyBlock.Sky, var2, var3, var4) - var1.skylightSubtracted; +- float var7 = var1.getCelestialAngleRadians(1.0F); +- if(var7 < (float)Math.PI) { ++ /** ++ * Updates the blocks bounds based on its current state. Args: world, x, y, z ++ */ ++ public void setBlockBoundsBasedOnState(IBlockAccess par1IBlockAccess, int par2, int par3, int par4) { ++ this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.375F, 1.0F); ++ } ++ ++ /** ++ * Returns true if the block is emitting indirect/weak redstone power on the specified side. If isBlockNormalCube ++ * returns true, standard redstone propagation rules will apply instead and this will not be called. Args: World, X, Y, ++ * Z, side. Note that the side is reversed - eg it is 1 (up) when checking the bottom of the block. ++ */ ++ public int isProvidingWeakPower(IBlockAccess par1IBlockAccess, int par2, int par3, int par4, int par5) { ++ return par1IBlockAccess.getBlockMetadata(par2, par3, par4); ++ } ++ ++ /** ++ * Ticks the block if it's been scheduled ++ */ ++ public void updateTick(World par1World, int par2, int par3, int par4, Random par5Random) {} ++ ++ /** ++ * Lets the block know when one of its neighbor changes. Doesn't know which neighbor changed (coordinates passed are ++ * their own) Args: x, y, z, neighbor blockID ++ */ ++ public void onNeighborBlockChange(World par1World, int par2, int par3, int par4, int par5) {} ++ ++ /** ++ * Called whenever the block is added into the world. Args: world, x, y, z ++ */ ++ public void onBlockAdded(World par1World, int par2, int par3, int par4) {} ++ ++ public void updateLightLevel(World par1World, int par2, int par3, int par4) { ++ if (!par1World.provider.hasNoSky) { ++ int var5 = par1World.getBlockMetadata(par2, par3, par4); ++ int var6 = par1World.getSavedLightValue(EnumSkyBlock.Sky, par2, par3, par4) - par1World.skylightSubtracted; ++ float var7 = par1World.getCelestialAngleRadians(1.0F); ++ ++ if (var7 < (float)Math.PI) { + var7 += (0.0F - var7) * 0.2F; + } else { +- var7 += ((float)Math.PI * 2.0F - var7) * 0.2F; ++ var7 += (((float)Math.PI * 2F) - var7) * 0.2F; + } + + var6 = Math.round((float)var6 * MathHelper.cos(var7)); +- if(var6 < 0) { ++ ++ if (var6 < 0) { + var6 = 0; + } + +- if(var6 > 15) { ++ if (var6 > 15) { + var6 = 15; + } + +- if(var5 != var6) { +- var1.setBlockMetadata(var2, var3, var4, var6, 3); ++ if (var5 != var6) { ++ par1World.setBlockMetadataWithNotify(par2, par3, par4, var6, 3); + } +- + } + } + ++ /** ++ * If this block doesn't render as an ordinary block it will return False (examples: signs, buttons, stairs, etc) ++ */ + public boolean renderAsNormalBlock() { + return false; + } + ++ /** ++ * Is this block (a) opaque and (b) a full 1m cube? This determines whether or not to render the shared face of two ++ * adjacent blocks and also whether the player can attach torches, redstone wire, etc to this block. ++ */ + public boolean isOpaqueCube() { + return false; + } + ++ /** ++ * Can this block provide power. Only wire currently seems to have this change based on its state. ++ */ + public boolean canProvidePower() { + return true; + } + +- public TileEntity createNewTileEntity(World var1) { ++ /** ++ * Returns a new instance of a block's tile entity class. Called on placing the block. ++ */ ++ public TileEntity createNewTileEntity(World par1World) { + return new TileEntityDaylightDetector(); + } + +- public Icon getIcon(int var1, int var2) { +- return var1 == 1 ? this.iconArray[0] : this.iconArray[1]; ++ /** ++ * From the specified side and block metadata retrieves the blocks texture. Args: side, metadata ++ */ ++ public Icon getIcon(int par1, int par2) { ++ return par1 == 1 ? this.iconArray[0] : this.iconArray[1]; + } + +- public void registerIcons(IconRegister var1) { +- this.iconArray[0] = var1.registerIcon(this.getTextureName() + "_top"); +- this.iconArray[1] = var1.registerIcon(this.getTextureName() + "_side"); ++ /** ++ * When this method is called, your block should register all the icons it needs with the given IconRegister. This is ++ * the only chance you get to register icons. ++ */ ++ public void registerIcons(IconRegister par1IconRegister) { ++ this.iconArray[0] = par1IconRegister.registerIcon(this.getTextureName() + "_top"); ++ this.iconArray[1] = par1IconRegister.registerIcon(this.getTextureName() + "_side"); + } + } diff --git a/patches/net/minecraft/src/BlockDeadBush.java.patch b/patches/net/minecraft/src/BlockDeadBush.java.patch new file mode 100644 index 0000000..2f70fcc --- /dev/null +++ b/patches/net/minecraft/src/BlockDeadBush.java.patch @@ -0,0 +1,51 @@ +--- net/minecraft/src/BlockDeadBush.java ++++ net/minecraft/src/BlockDeadBush.java +@@ -3,27 +3,37 @@ + import java.util.Random; + + public class BlockDeadBush extends BlockFlower { +- protected BlockDeadBush(int var1) { +- super(var1, Material.vine); ++ protected BlockDeadBush(int par1) { ++ super(par1, Material.vine); + float var2 = 0.4F; + this.setBlockBounds(0.5F - var2, 0.0F, 0.5F - var2, 0.5F + var2, 0.8F, 0.5F + var2); + } + +- protected boolean canThisPlantGrowOnThisBlockID(int var1) { +- return var1 == Block.sand.blockID; ++ /** ++ * Gets passed in the blockID of the block below and supposed to return true if its allowed to grow on the type of ++ * blockID passed in. Args: blockID ++ */ ++ protected boolean canThisPlantGrowOnThisBlockID(int par1) { ++ return par1 == Block.sand.blockID; + } + +- public int idDropped(int var1, Random var2, int var3) { ++ /** ++ * Returns the ID of the items to drop on destruction. ++ */ ++ public int idDropped(int par1, Random par2Random, int par3) { + return -1; + } + +- public void harvestBlock(World var1, EntityPlayer var2, int var3, int var4, int var5, int var6) { +- if(!var1.isRemote && var2.getCurrentEquippedItem() != null && var2.getCurrentEquippedItem().itemID == Item.shears.itemID) { +- var2.addStat(StatList.mineBlockStatArray[this.blockID], 1); +- this.dropBlockAsItem_do(var1, var3, var4, var5, new ItemStack(Block.deadBush, 1, var6)); ++ /** ++ * Called when the player destroys a block with an item that can harvest it. (i, j, k) are the coordinates of the block ++ * and l is the block's subtype/damage. ++ */ ++ public void harvestBlock(World par1World, EntityPlayer par2EntityPlayer, int par3, int par4, int par5, int par6) { ++ if (!par1World.isRemote && par2EntityPlayer.getCurrentEquippedItem() != null && par2EntityPlayer.getCurrentEquippedItem().itemID == Item.shears.itemID) { ++ par2EntityPlayer.addStat(StatList.mineBlockStatArray[this.blockID], 1); ++ this.dropBlockAsItem_do(par1World, par3, par4, par5, new ItemStack(Block.deadBush, 1, par6)); + } else { +- super.harvestBlock(var1, var2, var3, var4, var5, var6); ++ super.harvestBlock(par1World, par2EntityPlayer, par3, par4, par5, par6); + } +- + } + } diff --git a/patches/net/minecraft/src/BlockDetectorRail.java.patch b/patches/net/minecraft/src/BlockDetectorRail.java.patch new file mode 100644 index 0000000..f075cd5 --- /dev/null +++ b/patches/net/minecraft/src/BlockDetectorRail.java.patch @@ -0,0 +1,222 @@ +--- net/minecraft/src/BlockDetectorRail.java ++++ net/minecraft/src/BlockDetectorRail.java +@@ -6,89 +6,128 @@ + public class BlockDetectorRail extends BlockRailBase { + private Icon[] iconArray; + +- public BlockDetectorRail(int var1) { +- super(var1, true); ++ public BlockDetectorRail(int par1) { ++ super(par1, true); + this.setTickRandomly(true); + } + +- public int tickRate(World var1) { ++ /** ++ * How many world ticks before ticking ++ */ ++ public int tickRate(World par1World) { + return 20; + } + ++ /** ++ * Can this block provide power. Only wire currently seems to have this change based on its state. ++ */ + public boolean canProvidePower() { + return true; + } + +- public void onEntityCollidedWithBlock(World var1, int var2, int var3, int var4, Entity var5) { +- if(!var1.isRemote) { +- int var6 = var1.getBlockMetadata(var2, var3, var4); +- if((var6 & 8) == 0) { +- this.setStateIfMinecartInteractsWithRail(var1, var2, var3, var4, var6); +- } +- } +- } +- +- public void updateTick(World var1, int var2, int var3, int var4, Random var5) { +- if(!var1.isRemote) { +- int var6 = var1.getBlockMetadata(var2, var3, var4); +- if((var6 & 8) != 0) { +- this.setStateIfMinecartInteractsWithRail(var1, var2, var3, var4, var6); +- } +- } +- } +- +- public int isProvidingWeakPower(IBlockAccess var1, int var2, int var3, int var4, int var5) { +- return (var1.getBlockMetadata(var2, var3, var4) & 8) != 0 ? 15 : 0; +- } +- +- public int isProvidingStrongPower(IBlockAccess var1, int var2, int var3, int var4, int var5) { +- return (var1.getBlockMetadata(var2, var3, var4) & 8) == 0 ? 0 : (var5 == 1 ? 15 : 0); +- } +- +- private void setStateIfMinecartInteractsWithRail(World var1, int var2, int var3, int var4, int var5) { +- boolean var6 = (var5 & 8) != 0; ++ /** ++ * Triggered whenever an entity collides with this block (enters into the block). Args: world, x, y, z, entity ++ */ ++ public void onEntityCollidedWithBlock(World par1World, int par2, int par3, int par4, Entity par5Entity) { ++ if (!par1World.isRemote) { ++ int var6 = par1World.getBlockMetadata(par2, par3, par4); ++ ++ if ((var6 & 8) == 0) { ++ this.setStateIfMinecartInteractsWithRail(par1World, par2, par3, par4, var6); ++ } ++ } ++ } ++ ++ /** ++ * Ticks the block if it's been scheduled ++ */ ++ public void updateTick(World par1World, int par2, int par3, int par4, Random par5Random) { ++ if (!par1World.isRemote) { ++ int var6 = par1World.getBlockMetadata(par2, par3, par4); ++ ++ if ((var6 & 8) != 0) { ++ this.setStateIfMinecartInteractsWithRail(par1World, par2, par3, par4, var6); ++ } ++ } ++ } ++ ++ /** ++ * Returns true if the block is emitting indirect/weak redstone power on the specified side. If isBlockNormalCube ++ * returns true, standard redstone propagation rules will apply instead and this will not be called. Args: World, X, Y, ++ * Z, side. Note that the side is reversed - eg it is 1 (up) when checking the bottom of the block. ++ */ ++ public int isProvidingWeakPower(IBlockAccess par1IBlockAccess, int par2, int par3, int par4, int par5) { ++ return (par1IBlockAccess.getBlockMetadata(par2, par3, par4) & 8) != 0 ? 15 : 0; ++ } ++ ++ /** ++ * Returns true if the block is emitting direct/strong redstone power on the specified side. Args: World, X, Y, Z, ++ * side. Note that the side is reversed - eg it is 1 (up) when checking the bottom of the block. ++ */ ++ public int isProvidingStrongPower(IBlockAccess par1IBlockAccess, int par2, int par3, int par4, int par5) { ++ return (par1IBlockAccess.getBlockMetadata(par2, par3, par4) & 8) == 0 ? 0 : (par5 == 1 ? 15 : 0); ++ } ++ ++ /** ++ * Update the detector rail power state if a minecart enter, stays or leave the block. ++ */ ++ private void setStateIfMinecartInteractsWithRail(World par1World, int par2, int par3, int par4, int par5) { ++ boolean var6 = (par5 & 8) != 0; + boolean var7 = false; +- float var8 = 2.0F / 16.0F; +- List var9 = var1.getEntitiesWithinAABB(EntityMinecart.class, AxisAlignedBB.getAABBPool().getAABB((double)((float)var2 + var8), (double)var3, (double)((float)var4 + var8), (double)((float)(var2 + 1) - var8), (double)((float)(var3 + 1) - var8), (double)((float)(var4 + 1) - var8))); +- if(!var9.isEmpty()) { ++ float var8 = 0.125F; ++ List var9 = par1World.getEntitiesWithinAABB(EntityMinecart.class, AxisAlignedBB.getAABBPool().getAABB((double)((float)par2 + var8), (double)par3, (double)((float)par4 + var8), (double)((float)(par2 + 1) - var8), (double)((float)(par3 + 1) - var8), (double)((float)(par4 + 1) - var8))); ++ ++ if (!var9.isEmpty()) { + var7 = true; + } + +- if(var7 && !var6) { +- var1.setBlockMetadata(var2, var3, var4, var5 | 8, 3); +- var1.notifyBlocksOfNeighborChange(var2, var3, var4, this.blockID); +- var1.notifyBlocksOfNeighborChange(var2, var3 - 1, var4, this.blockID); +- var1.markBlockRangeForRenderUpdate(var2, var3, var4, var2, var3, var4); +- } +- +- if(!var7 && var6) { +- var1.setBlockMetadata(var2, var3, var4, var5 & 7, 3); +- var1.notifyBlocksOfNeighborChange(var2, var3, var4, this.blockID); +- var1.notifyBlocksOfNeighborChange(var2, var3 - 1, var4, this.blockID); +- var1.markBlockRangeForRenderUpdate(var2, var3, var4, var2, var3, var4); +- } +- +- if(var7) { +- var1.scheduleBlockUpdate(var2, var3, var4, this.blockID, this.tickRate(var1)); +- } +- +- var1.func_96440_m(var2, var3, var4, this.blockID); +- } +- +- public void onBlockAdded(World var1, int var2, int var3, int var4) { +- super.onBlockAdded(var1, var2, var3, var4); +- this.setStateIfMinecartInteractsWithRail(var1, var2, var3, var4, var1.getBlockMetadata(var2, var3, var4)); +- } +- ++ if (var7 && !var6) { ++ par1World.setBlockMetadataWithNotify(par2, par3, par4, par5 | 8, 3); ++ par1World.notifyBlocksOfNeighborChange(par2, par3, par4, this.blockID); ++ par1World.notifyBlocksOfNeighborChange(par2, par3 - 1, par4, this.blockID); ++ par1World.markBlockRangeForRenderUpdate(par2, par3, par4, par2, par3, par4); ++ } ++ ++ if (!var7 && var6) { ++ par1World.setBlockMetadataWithNotify(par2, par3, par4, par5 & 7, 3); ++ par1World.notifyBlocksOfNeighborChange(par2, par3, par4, this.blockID); ++ par1World.notifyBlocksOfNeighborChange(par2, par3 - 1, par4, this.blockID); ++ par1World.markBlockRangeForRenderUpdate(par2, par3, par4, par2, par3, par4); ++ } ++ ++ if (var7) { ++ par1World.scheduleBlockUpdate(par2, par3, par4, this.blockID, this.tickRate(par1World)); ++ } ++ ++ par1World.func_96440_m(par2, par3, par4, this.blockID); ++ } ++ ++ /** ++ * Called whenever the block is added into the world. Args: world, x, y, z ++ */ ++ public void onBlockAdded(World par1World, int par2, int par3, int par4) { ++ super.onBlockAdded(par1World, par2, par3, par4); ++ this.setStateIfMinecartInteractsWithRail(par1World, par2, par3, par4, par1World.getBlockMetadata(par2, par3, par4)); ++ } ++ ++ /** ++ * If this returns true, then comparators facing away from this block will use the value from ++ * getComparatorInputOverride instead of the actual redstone signal strength. ++ */ + public boolean hasComparatorInputOverride() { + return true; + } + +- public int getComparatorInputOverride(World var1, int var2, int var3, int var4, int var5) { +- if((var1.getBlockMetadata(var2, var3, var4) & 8) > 0) { +- float var6 = 2.0F / 16.0F; +- List var7 = var1.selectEntitiesWithinAABB(EntityMinecart.class, AxisAlignedBB.getAABBPool().getAABB((double)((float)var2 + var6), (double)var3, (double)((float)var4 + var6), (double)((float)(var2 + 1) - var6), (double)((float)(var3 + 1) - var6), (double)((float)(var4 + 1) - var6)), IEntitySelector.selectInventories); +- if(var7.size() > 0) { ++ /** ++ * If hasComparatorInputOverride returns true, the return value from this is used instead of the redstone signal ++ * strength when this block inputs to a comparator. ++ */ ++ public int getComparatorInputOverride(World par1World, int par2, int par3, int par4, int par5) { ++ if ((par1World.getBlockMetadata(par2, par3, par4) & 8) > 0) { ++ float var6 = 0.125F; ++ List var7 = par1World.selectEntitiesWithinAABB(EntityMinecart.class, AxisAlignedBB.getAABBPool().getAABB((double)((float)par2 + var6), (double)par3, (double)((float)par4 + var6), (double)((float)(par2 + 1) - var6), (double)((float)(par3 + 1) - var6), (double)((float)(par4 + 1) - var6)), IEntitySelector.selectInventories); ++ ++ if (var7.size() > 0) { + return Container.calcRedstoneFromInventory((IInventory)var7.get(0)); + } + } +@@ -96,13 +135,20 @@ + return 0; + } + +- public void registerIcons(IconRegister var1) { ++ /** ++ * When this method is called, your block should register all the icons it needs with the given IconRegister. This is ++ * the only chance you get to register icons. ++ */ ++ public void registerIcons(IconRegister par1IconRegister) { + this.iconArray = new Icon[2]; +- this.iconArray[0] = var1.registerIcon(this.getTextureName()); +- this.iconArray[1] = var1.registerIcon(this.getTextureName() + "_powered"); ++ this.iconArray[0] = par1IconRegister.registerIcon(this.getTextureName()); ++ this.iconArray[1] = par1IconRegister.registerIcon(this.getTextureName() + "_powered"); + } + +- public Icon getIcon(int var1, int var2) { +- return (var2 & 8) != 0 ? this.iconArray[1] : this.iconArray[0]; ++ /** ++ * From the specified side and block metadata retrieves the blocks texture. Args: side, metadata ++ */ ++ public Icon getIcon(int par1, int par2) { ++ return (par2 & 8) != 0 ? this.iconArray[1] : this.iconArray[0]; + } + } diff --git a/patches/net/minecraft/src/BlockDirectional.java.patch b/patches/net/minecraft/src/BlockDirectional.java.patch new file mode 100644 index 0000000..05f2b8a --- /dev/null +++ b/patches/net/minecraft/src/BlockDirectional.java.patch @@ -0,0 +1,21 @@ +--- net/minecraft/src/BlockDirectional.java ++++ net/minecraft/src/BlockDirectional.java +@@ -1,11 +1,14 @@ + package net.minecraft.src; + + public abstract class BlockDirectional extends Block { +- protected BlockDirectional(int var1, Material var2) { +- super(var1, var2); ++ protected BlockDirectional(int par1, Material par2Material) { ++ super(par1, par2Material); + } + +- public static int getDirection(int var0) { +- return var0 & 3; ++ /** ++ * Returns the orentation value from the specified metadata ++ */ ++ public static int getDirection(int par0) { ++ return par0 & 3; + } + } diff --git a/patches/net/minecraft/src/BlockDirt.java.patch b/patches/net/minecraft/src/BlockDirt.java.patch new file mode 100644 index 0000000..5ae109e --- /dev/null +++ b/patches/net/minecraft/src/BlockDirt.java.patch @@ -0,0 +1,13 @@ +--- net/minecraft/src/BlockDirt.java ++++ net/minecraft/src/BlockDirt.java +@@ -1,8 +1,8 @@ + package net.minecraft.src; + + public class BlockDirt extends Block { +- protected BlockDirt(int var1) { +- super(var1, Material.ground); ++ protected BlockDirt(int par1) { ++ super(par1, Material.ground); + this.setCreativeTab(CreativeTabs.tabBlock); + } + } diff --git a/patches/net/minecraft/src/BlockDispenser.java.patch b/patches/net/minecraft/src/BlockDispenser.java.patch new file mode 100644 index 0000000..efc728e --- /dev/null +++ b/patches/net/minecraft/src/BlockDispenser.java.patch @@ -0,0 +1,347 @@ +--- net/minecraft/src/BlockDispenser.java ++++ net/minecraft/src/BlockDispenser.java +@@ -3,188 +3,245 @@ + import java.util.Random; + + public class BlockDispenser extends BlockContainer { ++ ++ /** Registry for all dispense behaviors. */ + public static final IRegistry dispenseBehaviorRegistry = new RegistryDefaulted(new BehaviorDefaultDispenseItem()); +- protected Random b = new Random(); ++ protected Random random = new Random(); + protected Icon furnaceTopIcon; + protected Icon furnaceFrontIcon; + protected Icon field_96473_e; + +- protected BlockDispenser(int var1) { +- super(var1, Material.rock); ++ protected BlockDispenser(int par1) { ++ super(par1, Material.rock); + this.setCreativeTab(CreativeTabs.tabRedstone); + } + +- public int tickRate(World var1) { ++ /** ++ * How many world ticks before ticking ++ */ ++ public int tickRate(World par1World) { + return 4; + } + +- public void onBlockAdded(World var1, int var2, int var3, int var4) { +- super.onBlockAdded(var1, var2, var3, var4); +- this.setDispenserDefaultDirection(var1, var2, var3, var4); ++ /** ++ * Called whenever the block is added into the world. Args: world, x, y, z ++ */ ++ public void onBlockAdded(World par1World, int par2, int par3, int par4) { ++ super.onBlockAdded(par1World, par2, par3, par4); ++ this.setDispenserDefaultDirection(par1World, par2, par3, par4); + } + +- private void setDispenserDefaultDirection(World var1, int var2, int var3, int var4) { +- if(!var1.isRemote) { +- int var5 = var1.getBlockId(var2, var3, var4 - 1); +- int var6 = var1.getBlockId(var2, var3, var4 + 1); +- int var7 = var1.getBlockId(var2 - 1, var3, var4); +- int var8 = var1.getBlockId(var2 + 1, var3, var4); ++ /** ++ * sets Dispenser block direction so that the front faces an non-opaque block; chooses west to be direction if all ++ * surrounding blocks are opaque. ++ */ ++ private void setDispenserDefaultDirection(World par1World, int par2, int par3, int par4) { ++ if (!par1World.isRemote) { ++ int var5 = par1World.getBlockId(par2, par3, par4 - 1); ++ int var6 = par1World.getBlockId(par2, par3, par4 + 1); ++ int var7 = par1World.getBlockId(par2 - 1, par3, par4); ++ int var8 = par1World.getBlockId(par2 + 1, par3, par4); + byte var9 = 3; +- if(Block.opaqueCubeLookup[var5] && !Block.opaqueCubeLookup[var6]) { ++ ++ if (Block.opaqueCubeLookup[var5] && !Block.opaqueCubeLookup[var6]) { + var9 = 3; + } + +- if(Block.opaqueCubeLookup[var6] && !Block.opaqueCubeLookup[var5]) { ++ if (Block.opaqueCubeLookup[var6] && !Block.opaqueCubeLookup[var5]) { + var9 = 2; + } + +- if(Block.opaqueCubeLookup[var7] && !Block.opaqueCubeLookup[var8]) { ++ if (Block.opaqueCubeLookup[var7] && !Block.opaqueCubeLookup[var8]) { + var9 = 5; + } + +- if(Block.opaqueCubeLookup[var8] && !Block.opaqueCubeLookup[var7]) { ++ if (Block.opaqueCubeLookup[var8] && !Block.opaqueCubeLookup[var7]) { + var9 = 4; + } + +- var1.setBlockMetadata(var2, var3, var4, var9, 2); ++ par1World.setBlockMetadataWithNotify(par2, par3, par4, var9, 2); + } + } + +- public Icon getIcon(int var1, int var2) { +- int var3 = var2 & 7; +- return var1 == var3 ? (var3 != 1 && var3 != 0 ? this.furnaceFrontIcon : this.field_96473_e) : (var3 != 1 && var3 != 0 ? (var1 != 1 && var1 != 0 ? this.blockIcon : this.furnaceTopIcon) : this.furnaceTopIcon); +- } +- +- public void registerIcons(IconRegister var1) { +- this.blockIcon = var1.registerIcon("furnace_side"); +- this.furnaceTopIcon = var1.registerIcon("furnace_top"); +- this.furnaceFrontIcon = var1.registerIcon(this.getTextureName() + "_front_horizontal"); +- this.field_96473_e = var1.registerIcon(this.getTextureName() + "_front_vertical"); +- } +- +- public boolean onBlockActivated(World var1, int var2, int var3, int var4, EntityPlayer var5, int var6, float var7, float var8, float var9) { +- if(var1.isRemote) { ++ /** ++ * From the specified side and block metadata retrieves the blocks texture. Args: side, metadata ++ */ ++ public Icon getIcon(int par1, int par2) { ++ int var3 = par2 & 7; ++ return par1 == var3 ? (var3 != 1 && var3 != 0 ? this.furnaceFrontIcon : this.field_96473_e) : (var3 != 1 && var3 != 0 ? (par1 != 1 && par1 != 0 ? this.blockIcon : this.furnaceTopIcon) : this.furnaceTopIcon); ++ } ++ ++ /** ++ * When this method is called, your block should register all the icons it needs with the given IconRegister. This is ++ * the only chance you get to register icons. ++ */ ++ public void registerIcons(IconRegister par1IconRegister) { ++ this.blockIcon = par1IconRegister.registerIcon("furnace_side"); ++ this.furnaceTopIcon = par1IconRegister.registerIcon("furnace_top"); ++ this.furnaceFrontIcon = par1IconRegister.registerIcon(this.getTextureName() + "_front_horizontal"); ++ this.field_96473_e = par1IconRegister.registerIcon(this.getTextureName() + "_front_vertical"); ++ } ++ ++ /** ++ * Called upon block activation (right click on the block.) ++ */ ++ public boolean onBlockActivated(World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer, int par6, float par7, float par8, float par9) { ++ if (par1World.isRemote) { + return true; + } else { +- TileEntityDispenser var10 = (TileEntityDispenser)var1.getBlockTileEntity(var2, var3, var4); +- if(var10 != null) { +- var5.displayGUIDispenser(var10); ++ TileEntityDispenser var10 = (TileEntityDispenser)par1World.getBlockTileEntity(par2, par3, par4); ++ ++ if (var10 != null) { ++ par5EntityPlayer.displayGUIDispenser(var10); + } + + return true; + } + } + +- protected void dispense(World var1, int var2, int var3, int var4) { +- BlockSourceImpl var5 = new BlockSourceImpl(var1, var2, var3, var4); ++ protected void dispense(World par1World, int par2, int par3, int par4) { ++ BlockSourceImpl var5 = new BlockSourceImpl(par1World, par2, par3, par4); + TileEntityDispenser var6 = (TileEntityDispenser)var5.getBlockTileEntity(); +- if(var6 != null) { ++ ++ if (var6 != null) { + int var7 = var6.getRandomStackFromInventory(); +- if(var7 < 0) { +- var1.playAuxSFX(1001, var2, var3, var4, 0); ++ ++ if (var7 < 0) { ++ par1World.playAuxSFX(1001, par2, par3, par4, 0); + } else { + ItemStack var8 = var6.getStackInSlot(var7); + IBehaviorDispenseItem var9 = this.getBehaviorForItemStack(var8); +- if(var9 != IBehaviorDispenseItem.itemDispenseBehaviorProvider) { ++ ++ if (var9 != IBehaviorDispenseItem.itemDispenseBehaviorProvider) { + ItemStack var10 = var9.dispense(var5, var8); + var6.setInventorySlotContents(var7, var10.stackSize == 0 ? null : var10); + } + } +- + } + } + +- protected IBehaviorDispenseItem getBehaviorForItemStack(ItemStack var1) { +- return (IBehaviorDispenseItem)dispenseBehaviorRegistry.getObject(var1.getItem()); ++ /** ++ * Returns the behavior for the given ItemStack. ++ */ ++ protected IBehaviorDispenseItem getBehaviorForItemStack(ItemStack par1ItemStack) { ++ return (IBehaviorDispenseItem)dispenseBehaviorRegistry.getObject(par1ItemStack.getItem()); + } + +- public void onNeighborBlockChange(World var1, int var2, int var3, int var4, int var5) { +- boolean var6 = var1.isBlockIndirectlyGettingPowered(var2, var3, var4) || var1.isBlockIndirectlyGettingPowered(var2, var3 + 1, var4); +- int var7 = var1.getBlockMetadata(var2, var3, var4); ++ /** ++ * Lets the block know when one of its neighbor changes. Doesn't know which neighbor changed (coordinates passed are ++ * their own) Args: x, y, z, neighbor blockID ++ */ ++ public void onNeighborBlockChange(World par1World, int par2, int par3, int par4, int par5) { ++ boolean var6 = par1World.isBlockIndirectlyGettingPowered(par2, par3, par4) || par1World.isBlockIndirectlyGettingPowered(par2, par3 + 1, par4); ++ int var7 = par1World.getBlockMetadata(par2, par3, par4); + boolean var8 = (var7 & 8) != 0; +- if(var6 && !var8) { +- var1.scheduleBlockUpdate(var2, var3, var4, this.blockID, this.tickRate(var1)); +- var1.setBlockMetadata(var2, var3, var4, var7 | 8, 4); +- } else if(!var6 && var8) { +- var1.setBlockMetadata(var2, var3, var4, var7 & -9, 4); +- } +- +- } +- +- public void updateTick(World var1, int var2, int var3, int var4, Random var5) { +- if(!var1.isRemote) { +- this.dispense(var1, var2, var3, var4); +- } +- +- } +- +- public TileEntity createNewTileEntity(World var1) { ++ ++ if (var6 && !var8) { ++ par1World.scheduleBlockUpdate(par2, par3, par4, this.blockID, this.tickRate(par1World)); ++ par1World.setBlockMetadataWithNotify(par2, par3, par4, var7 | 8, 4); ++ } else if (!var6 && var8) { ++ par1World.setBlockMetadataWithNotify(par2, par3, par4, var7 & -9, 4); ++ } ++ } ++ ++ /** ++ * Ticks the block if it's been scheduled ++ */ ++ public void updateTick(World par1World, int par2, int par3, int par4, Random par5Random) { ++ if (!par1World.isRemote) { ++ this.dispense(par1World, par2, par3, par4); ++ } ++ } ++ ++ /** ++ * Returns a new instance of a block's tile entity class. Called on placing the block. ++ */ ++ public TileEntity createNewTileEntity(World par1World) { + return new TileEntityDispenser(); + } + +- public void onBlockPlacedBy(World var1, int var2, int var3, int var4, EntityLivingBase var5, ItemStack var6) { +- int var7 = BlockPistonBase.determineOrientation(var1, var2, var3, var4, var5); +- var1.setBlockMetadata(var2, var3, var4, var7, 2); +- if(var6.hasDisplayName()) { +- ((TileEntityDispenser)var1.getBlockTileEntity(var2, var3, var4)).setCustomName(var6.getDisplayName()); ++ /** ++ * Called when the block is placed in the world. ++ */ ++ public void onBlockPlacedBy(World par1World, int par2, int par3, int par4, EntityLivingBase par5EntityLivingBase, ItemStack par6ItemStack) { ++ int var7 = BlockPistonBase.determineOrientation(par1World, par2, par3, par4, par5EntityLivingBase); ++ par1World.setBlockMetadataWithNotify(par2, par3, par4, var7, 2); ++ ++ if (par6ItemStack.hasDisplayName()) { ++ ((TileEntityDispenser)par1World.getBlockTileEntity(par2, par3, par4)).setCustomName(par6ItemStack.getDisplayName()); + } +- + } + +- public void breakBlock(World var1, int var2, int var3, int var4, int var5, int var6) { +- TileEntityDispenser var7 = (TileEntityDispenser)var1.getBlockTileEntity(var2, var3, var4); +- if(var7 != null) { +- for(int var8 = 0; var8 < var7.getSizeInventory(); ++var8) { ++ /** ++ * Called on server worlds only when the block has been replaced by a different block ID, or the same block with a ++ * different metadata value, but before the new metadata value is set. Args: World, x, y, z, old block ID, old metadata ++ */ ++ public void breakBlock(World par1World, int par2, int par3, int par4, int par5, int par6) { ++ TileEntityDispenser var7 = (TileEntityDispenser)par1World.getBlockTileEntity(par2, par3, par4); ++ ++ if (var7 != null) { ++ for (int var8 = 0; var8 < var7.getSizeInventory(); ++var8) { + ItemStack var9 = var7.getStackInSlot(var8); +- if(var9 != null) { +- float var10 = this.b.nextFloat() * 0.8F + 0.1F; +- float var11 = this.b.nextFloat() * 0.8F + 0.1F; +- float var12 = this.b.nextFloat() * 0.8F + 0.1F; +- +- while(var9.stackSize > 0) { +- int var13 = this.b.nextInt(21) + 10; +- if(var13 > var9.stackSize) { ++ ++ if (var9 != null) { ++ float var10 = this.random.nextFloat() * 0.8F + 0.1F; ++ float var11 = this.random.nextFloat() * 0.8F + 0.1F; ++ float var12 = this.random.nextFloat() * 0.8F + 0.1F; ++ ++ while (var9.stackSize > 0) { ++ int var13 = this.random.nextInt(21) + 10; ++ ++ if (var13 > var9.stackSize) { + var13 = var9.stackSize; + } + + var9.stackSize -= var13; +- EntityItem var14 = new EntityItem(var1, (double)((float)var2 + var10), (double)((float)var3 + var11), (double)((float)var4 + var12), new ItemStack(var9.itemID, var13, var9.getItemDamage())); +- if(var9.hasTagCompound()) { ++ EntityItem var14 = new EntityItem(par1World, (double)((float)par2 + var10), (double)((float)par3 + var11), (double)((float)par4 + var12), new ItemStack(var9.itemID, var13, var9.getItemDamage())); ++ ++ if (var9.hasTagCompound()) { + var14.getEntityItem().setTagCompound((NBTTagCompound)var9.getTagCompound().copy()); + } + + float var15 = 0.05F; +- var14.motionX = (double)((float)this.b.nextGaussian() * var15); +- var14.motionY = (double)((float)this.b.nextGaussian() * var15 + 0.2F); +- var14.motionZ = (double)((float)this.b.nextGaussian() * var15); +- var1.spawnEntityInWorld(var14); ++ var14.motionX = (double)((float)this.random.nextGaussian() * var15); ++ var14.motionY = (double)((float)this.random.nextGaussian() * var15 + 0.2F); ++ var14.motionZ = (double)((float)this.random.nextGaussian() * var15); ++ par1World.spawnEntityInWorld(var14); + } + } + } + +- var1.func_96440_m(var2, var3, var4, var5); ++ par1World.func_96440_m(par2, par3, par4, par5); + } + +- super.breakBlock(var1, var2, var3, var4, var5, var6); ++ super.breakBlock(par1World, par2, par3, par4, par5, par6); + } + +- public static IPosition getIPositionFromBlockSource(IBlockSource var0) { +- EnumFacing var1 = getFacing(var0.getBlockMetadata()); +- double var2 = var0.getX() + 0.7D * (double)var1.getFrontOffsetX(); +- double var4 = var0.getY() + 0.7D * (double)var1.getFrontOffsetY(); +- double var6 = var0.getZ() + 0.7D * (double)var1.getFrontOffsetZ(); ++ public static IPosition getIPositionFromBlockSource(IBlockSource par0IBlockSource) { ++ EnumFacing var1 = getFacing(par0IBlockSource.getBlockMetadata()); ++ double var2 = par0IBlockSource.getX() + 0.7D * (double)var1.getFrontOffsetX(); ++ double var4 = par0IBlockSource.getY() + 0.7D * (double)var1.getFrontOffsetY(); ++ double var6 = par0IBlockSource.getZ() + 0.7D * (double)var1.getFrontOffsetZ(); + return new PositionImpl(var2, var4, var6); + } + +- public static EnumFacing getFacing(int var0) { +- return EnumFacing.getFront(var0 & 7); ++ public static EnumFacing getFacing(int par0) { ++ return EnumFacing.getFront(par0 & 7); + } + ++ /** ++ * If this returns true, then comparators facing away from this block will use the value from ++ * getComparatorInputOverride instead of the actual redstone signal strength. ++ */ + public boolean hasComparatorInputOverride() { + return true; + } + +- public int getComparatorInputOverride(World var1, int var2, int var3, int var4, int var5) { +- return Container.calcRedstoneFromInventory((IInventory)var1.getBlockTileEntity(var2, var3, var4)); ++ /** ++ * If hasComparatorInputOverride returns true, the return value from this is used instead of the redstone signal ++ * strength when this block inputs to a comparator. ++ */ ++ public int getComparatorInputOverride(World par1World, int par2, int par3, int par4, int par5) { ++ return Container.calcRedstoneFromInventory((IInventory)par1World.getBlockTileEntity(par2, par3, par4)); + } + } diff --git a/patches/net/minecraft/src/BlockDoor.java.patch b/patches/net/minecraft/src/BlockDoor.java.patch new file mode 100644 index 0000000..95be020 --- /dev/null +++ b/patches/net/minecraft/src/BlockDoor.java.patch @@ -0,0 +1,485 @@ +--- net/minecraft/src/BlockDoor.java ++++ net/minecraft/src/BlockDoor.java +@@ -6,46 +6,53 @@ + private Icon[] field_111044_a; + private Icon[] field_111043_b; + +- protected BlockDoor(int var1, Material var2) { +- super(var1, var2); ++ protected BlockDoor(int par1, Material par2Material) { ++ super(par1, par2Material); + float var3 = 0.5F; + float var4 = 1.0F; + this.setBlockBounds(0.5F - var3, 0.0F, 0.5F - var3, 0.5F + var3, var4, 0.5F + var3); + } + +- public Icon getIcon(int var1, int var2) { ++ /** ++ * From the specified side and block metadata retrieves the blocks texture. Args: side, metadata ++ */ ++ public Icon getIcon(int par1, int par2) { + return this.field_111043_b[0]; + } + +- public Icon getBlockTexture(IBlockAccess var1, int var2, int var3, int var4, int var5) { +- if(var5 != 1 && var5 != 0) { +- int var6 = this.getFullMetadata(var1, var2, var3, var4); ++ /** ++ * Retrieves the block texture to use based on the display side. Args: iBlockAccess, x, y, z, side ++ */ ++ public Icon getBlockTexture(IBlockAccess par1IBlockAccess, int par2, int par3, int par4, int par5) { ++ if (par5 != 1 && par5 != 0) { ++ int var6 = this.getFullMetadata(par1IBlockAccess, par2, par3, par4); + int var7 = var6 & 3; + boolean var8 = (var6 & 4) != 0; + boolean var9 = false; + boolean var10 = (var6 & 8) != 0; +- if(var8) { +- if(var7 == 0 && var5 == 2) { +- var9 = !var9; +- } else if(var7 == 1 && var5 == 5) { +- var9 = !var9; +- } else if(var7 == 2 && var5 == 3) { +- var9 = !var9; +- } else if(var7 == 3 && var5 == 4) { ++ ++ if (var8) { ++ if (var7 == 0 && par5 == 2) { ++ var9 = !var9; ++ } else if (var7 == 1 && par5 == 5) { ++ var9 = !var9; ++ } else if (var7 == 2 && par5 == 3) { ++ var9 = !var9; ++ } else if (var7 == 3 && par5 == 4) { + var9 = !var9; + } + } else { +- if(var7 == 0 && var5 == 5) { +- var9 = !var9; +- } else if(var7 == 1 && var5 == 3) { +- var9 = !var9; +- } else if(var7 == 2 && var5 == 4) { +- var9 = !var9; +- } else if(var7 == 3 && var5 == 2) { ++ if (var7 == 0 && par5 == 5) { ++ var9 = !var9; ++ } else if (var7 == 1 && par5 == 3) { ++ var9 = !var9; ++ } else if (var7 == 2 && par5 == 4) { ++ var9 = !var9; ++ } else if (var7 == 3 && par5 == 2) { + var9 = !var9; + } + +- if((var6 & 16) != 0) { ++ if ((var6 & 16) != 0) { + var9 = !var9; + } + } +@@ -56,63 +63,91 @@ + } + } + +- public void registerIcons(IconRegister var1) { ++ /** ++ * When this method is called, your block should register all the icons it needs with the given IconRegister. This is ++ * the only chance you get to register icons. ++ */ ++ public void registerIcons(IconRegister par1IconRegister) { + this.field_111044_a = new Icon[2]; + this.field_111043_b = new Icon[2]; +- this.field_111044_a[0] = var1.registerIcon(this.getTextureName() + "_upper"); +- this.field_111043_b[0] = var1.registerIcon(this.getTextureName() + "_lower"); ++ this.field_111044_a[0] = par1IconRegister.registerIcon(this.getTextureName() + "_upper"); ++ this.field_111043_b[0] = par1IconRegister.registerIcon(this.getTextureName() + "_lower"); + this.field_111044_a[1] = new IconFlipped(this.field_111044_a[0], true, false); + this.field_111043_b[1] = new IconFlipped(this.field_111043_b[0], true, false); + } + ++ /** ++ * Is this block (a) opaque and (b) a full 1m cube? This determines whether or not to render the shared face of two ++ * adjacent blocks and also whether the player can attach torches, redstone wire, etc to this block. ++ */ + public boolean isOpaqueCube() { + return false; + } + +- public boolean getBlocksMovement(IBlockAccess var1, int var2, int var3, int var4) { +- int var5 = this.getFullMetadata(var1, var2, var3, var4); ++ public boolean getBlocksMovement(IBlockAccess par1IBlockAccess, int par2, int par3, int par4) { ++ int var5 = this.getFullMetadata(par1IBlockAccess, par2, par3, par4); + return (var5 & 4) != 0; + } + ++ /** ++ * If this block doesn't render as an ordinary block it will return False (examples: signs, buttons, stairs, etc) ++ */ + public boolean renderAsNormalBlock() { + return false; + } + ++ /** ++ * The type of render function that is called for this block ++ */ + public int getRenderType() { + return 7; + } + +- public AxisAlignedBB getSelectedBoundingBoxFromPool(World var1, int var2, int var3, int var4) { +- this.setBlockBoundsBasedOnState(var1, var2, var3, var4); +- return super.getSelectedBoundingBoxFromPool(var1, var2, var3, var4); +- } +- +- public AxisAlignedBB getCollisionBoundingBoxFromPool(World var1, int var2, int var3, int var4) { +- this.setBlockBoundsBasedOnState(var1, var2, var3, var4); +- return super.getCollisionBoundingBoxFromPool(var1, var2, var3, var4); +- } +- +- public void setBlockBoundsBasedOnState(IBlockAccess var1, int var2, int var3, int var4) { +- this.setDoorRotation(this.getFullMetadata(var1, var2, var3, var4)); +- } +- +- public int getDoorOrientation(IBlockAccess var1, int var2, int var3, int var4) { +- return this.getFullMetadata(var1, var2, var3, var4) & 3; +- } +- +- public boolean isDoorOpen(IBlockAccess var1, int var2, int var3, int var4) { +- return (this.getFullMetadata(var1, var2, var3, var4) & 4) != 0; +- } +- +- private void setDoorRotation(int var1) { +- float var2 = 3.0F / 16.0F; ++ /** ++ * Returns the bounding box of the wired rectangular prism to render. ++ */ ++ public AxisAlignedBB getSelectedBoundingBoxFromPool(World par1World, int par2, int par3, int par4) { ++ this.setBlockBoundsBasedOnState(par1World, par2, par3, par4); ++ return super.getSelectedBoundingBoxFromPool(par1World, par2, par3, par4); ++ } ++ ++ /** ++ * Returns a bounding box from the pool of bounding boxes (this means this box can change after the pool has been ++ * cleared to be reused) ++ */ ++ public AxisAlignedBB getCollisionBoundingBoxFromPool(World par1World, int par2, int par3, int par4) { ++ this.setBlockBoundsBasedOnState(par1World, par2, par3, par4); ++ return super.getCollisionBoundingBoxFromPool(par1World, par2, par3, par4); ++ } ++ ++ /** ++ * Updates the blocks bounds based on its current state. Args: world, x, y, z ++ */ ++ public void setBlockBoundsBasedOnState(IBlockAccess par1IBlockAccess, int par2, int par3, int par4) { ++ this.setDoorRotation(this.getFullMetadata(par1IBlockAccess, par2, par3, par4)); ++ } ++ ++ /** ++ * Returns 0, 1, 2 or 3 depending on where the hinge is. ++ */ ++ public int getDoorOrientation(IBlockAccess par1IBlockAccess, int par2, int par3, int par4) { ++ return this.getFullMetadata(par1IBlockAccess, par2, par3, par4) & 3; ++ } ++ ++ public boolean isDoorOpen(IBlockAccess par1IBlockAccess, int par2, int par3, int par4) { ++ return (this.getFullMetadata(par1IBlockAccess, par2, par3, par4) & 4) != 0; ++ } ++ ++ private void setDoorRotation(int par1) { ++ float var2 = 0.1875F; + this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 2.0F, 1.0F); +- int var3 = var1 & 3; +- boolean var4 = (var1 & 4) != 0; +- boolean var5 = (var1 & 16) != 0; +- if(var3 == 0) { +- if(var4) { +- if(!var5) { ++ int var3 = par1 & 3; ++ boolean var4 = (par1 & 4) != 0; ++ boolean var5 = (par1 & 16) != 0; ++ ++ if (var3 == 0) { ++ if (var4) { ++ if (!var5) { + this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, var2); + } else { + this.setBlockBounds(0.0F, 0.0F, 1.0F - var2, 1.0F, 1.0F, 1.0F); +@@ -120,9 +155,9 @@ + } else { + this.setBlockBounds(0.0F, 0.0F, 0.0F, var2, 1.0F, 1.0F); + } +- } else if(var3 == 1) { +- if(var4) { +- if(!var5) { ++ } else if (var3 == 1) { ++ if (var4) { ++ if (!var5) { + this.setBlockBounds(1.0F - var2, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F); + } else { + this.setBlockBounds(0.0F, 0.0F, 0.0F, var2, 1.0F, 1.0F); +@@ -130,9 +165,9 @@ + } else { + this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, var2); + } +- } else if(var3 == 2) { +- if(var4) { +- if(!var5) { ++ } else if (var3 == 2) { ++ if (var4) { ++ if (!var5) { + this.setBlockBounds(0.0F, 0.0F, 1.0F - var2, 1.0F, 1.0F, 1.0F); + } else { + this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, var2); +@@ -140,9 +175,9 @@ + } else { + this.setBlockBounds(1.0F - var2, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F); + } +- } else if(var3 == 3) { +- if(var4) { +- if(!var5) { ++ } else if (var3 == 3) { ++ if (var4) { ++ if (!var5) { + this.setBlockBounds(0.0F, 0.0F, 0.0F, var2, 1.0F, 1.0F); + } else { + this.setBlockBounds(1.0F - var2, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F); +@@ -151,131 +186,171 @@ + this.setBlockBounds(0.0F, 0.0F, 1.0F - var2, 1.0F, 1.0F, 1.0F); + } + } +- +- } +- +- public void onBlockClicked(World var1, int var2, int var3, int var4, EntityPlayer var5) { +- } +- +- public boolean onBlockActivated(World var1, int var2, int var3, int var4, EntityPlayer var5, int var6, float var7, float var8, float var9) { +- if(this.blockMaterial == Material.iron) { ++ } ++ ++ /** ++ * Called when the block is clicked by a player. Args: x, y, z, entityPlayer ++ */ ++ public void onBlockClicked(World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer) {} ++ ++ /** ++ * Called upon block activation (right click on the block.) ++ */ ++ public boolean onBlockActivated(World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer, int par6, float par7, float par8, float par9) { ++ if (this.blockMaterial == Material.iron) { + return true; + } else { +- int var10 = this.getFullMetadata(var1, var2, var3, var4); ++ int var10 = this.getFullMetadata(par1World, par2, par3, par4); + int var11 = var10 & 7; + var11 ^= 4; +- if((var10 & 8) == 0) { +- var1.setBlockMetadata(var2, var3, var4, var11, 2); +- var1.markBlockRangeForRenderUpdate(var2, var3, var4, var2, var3, var4); ++ ++ if ((var10 & 8) == 0) { ++ par1World.setBlockMetadataWithNotify(par2, par3, par4, var11, 2); ++ par1World.markBlockRangeForRenderUpdate(par2, par3, par4, par2, par3, par4); + } else { +- var1.setBlockMetadata(var2, var3 - 1, var4, var11, 2); +- var1.markBlockRangeForRenderUpdate(var2, var3 - 1, var4, var2, var3, var4); ++ par1World.setBlockMetadataWithNotify(par2, par3 - 1, par4, var11, 2); ++ par1World.markBlockRangeForRenderUpdate(par2, par3 - 1, par4, par2, par3, par4); + } + +- var1.playAuxSFXAtEntity(var5, 1003, var2, var3, var4, 0); ++ par1World.playAuxSFXAtEntity(par5EntityPlayer, 1003, par2, par3, par4, 0); + return true; + } + } + +- public void onPoweredBlockChange(World var1, int var2, int var3, int var4, boolean var5) { +- int var6 = this.getFullMetadata(var1, var2, var3, var4); ++ /** ++ * A function to open a door. ++ */ ++ public void onPoweredBlockChange(World par1World, int par2, int par3, int par4, boolean par5) { ++ int var6 = this.getFullMetadata(par1World, par2, par3, par4); + boolean var7 = (var6 & 4) != 0; +- if(var7 != var5) { ++ ++ if (var7 != par5) { + int var8 = var6 & 7; + var8 ^= 4; +- if((var6 & 8) == 0) { +- var1.setBlockMetadata(var2, var3, var4, var8, 2); +- var1.markBlockRangeForRenderUpdate(var2, var3, var4, var2, var3, var4); ++ ++ if ((var6 & 8) == 0) { ++ par1World.setBlockMetadataWithNotify(par2, par3, par4, var8, 2); ++ par1World.markBlockRangeForRenderUpdate(par2, par3, par4, par2, par3, par4); + } else { +- var1.setBlockMetadata(var2, var3 - 1, var4, var8, 2); +- var1.markBlockRangeForRenderUpdate(var2, var3 - 1, var4, var2, var3, var4); ++ par1World.setBlockMetadataWithNotify(par2, par3 - 1, par4, var8, 2); ++ par1World.markBlockRangeForRenderUpdate(par2, par3 - 1, par4, par2, par3, par4); + } + +- var1.playAuxSFXAtEntity((EntityPlayer)null, 1003, var2, var3, var4, 0); ++ par1World.playAuxSFXAtEntity((EntityPlayer)null, 1003, par2, par3, par4, 0); + } + } + +- public void onNeighborBlockChange(World var1, int var2, int var3, int var4, int var5) { +- int var6 = var1.getBlockMetadata(var2, var3, var4); +- if((var6 & 8) == 0) { ++ /** ++ * Lets the block know when one of its neighbor changes. Doesn't know which neighbor changed (coordinates passed are ++ * their own) Args: x, y, z, neighbor blockID ++ */ ++ public void onNeighborBlockChange(World par1World, int par2, int par3, int par4, int par5) { ++ int var6 = par1World.getBlockMetadata(par2, par3, par4); ++ ++ if ((var6 & 8) == 0) { + boolean var7 = false; +- if(var1.getBlockId(var2, var3 + 1, var4) != this.blockID) { +- var1.setBlockToAir(var2, var3, var4); ++ ++ if (par1World.getBlockId(par2, par3 + 1, par4) != this.blockID) { ++ par1World.setBlockToAir(par2, par3, par4); + var7 = true; + } + +- if(!var1.doesBlockHaveSolidTopSurface(var2, var3 - 1, var4)) { +- var1.setBlockToAir(var2, var3, var4); ++ if (!par1World.doesBlockHaveSolidTopSurface(par2, par3 - 1, par4)) { ++ par1World.setBlockToAir(par2, par3, par4); + var7 = true; +- if(var1.getBlockId(var2, var3 + 1, var4) == this.blockID) { +- var1.setBlockToAir(var2, var3 + 1, var4); ++ ++ if (par1World.getBlockId(par2, par3 + 1, par4) == this.blockID) { ++ par1World.setBlockToAir(par2, par3 + 1, par4); + } + } + +- if(var7) { +- if(!var1.isRemote) { +- this.dropBlockAsItem(var1, var2, var3, var4, var6, 0); ++ if (var7) { ++ if (!par1World.isRemote) { ++ this.dropBlockAsItem(par1World, par2, par3, par4, var6, 0); + } + } else { +- boolean var8 = var1.isBlockIndirectlyGettingPowered(var2, var3, var4) || var1.isBlockIndirectlyGettingPowered(var2, var3 + 1, var4); +- if((var8 || var5 > 0 && Block.blocksList[var5].canProvidePower()) && var5 != this.blockID) { +- this.onPoweredBlockChange(var1, var2, var3, var4, var8); ++ boolean var8 = par1World.isBlockIndirectlyGettingPowered(par2, par3, par4) || par1World.isBlockIndirectlyGettingPowered(par2, par3 + 1, par4); ++ ++ if ((var8 || par5 > 0 && Block.blocksList[par5].canProvidePower()) && par5 != this.blockID) { ++ this.onPoweredBlockChange(par1World, par2, par3, par4, var8); + } + } + } else { +- if(var1.getBlockId(var2, var3 - 1, var4) != this.blockID) { +- var1.setBlockToAir(var2, var3, var4); ++ if (par1World.getBlockId(par2, par3 - 1, par4) != this.blockID) { ++ par1World.setBlockToAir(par2, par3, par4); + } + +- if(var5 > 0 && var5 != this.blockID) { +- this.onNeighborBlockChange(var1, var2, var3 - 1, var4, var5); ++ if (par5 > 0 && par5 != this.blockID) { ++ this.onNeighborBlockChange(par1World, par2, par3 - 1, par4, par5); + } + } +- +- } +- +- public int idDropped(int var1, Random var2, int var3) { +- return (var1 & 8) != 0 ? 0 : (this.blockMaterial == Material.iron ? Item.doorIron.itemID : Item.doorWood.itemID); +- } +- +- public MovingObjectPosition collisionRayTrace(World var1, int var2, int var3, int var4, Vec3 var5, Vec3 var6) { +- this.setBlockBoundsBasedOnState(var1, var2, var3, var4); +- return super.collisionRayTrace(var1, var2, var3, var4, var5, var6); +- } +- +- public boolean canPlaceBlockAt(World var1, int var2, int var3, int var4) { +- return var3 >= 255 ? false : var1.doesBlockHaveSolidTopSurface(var2, var3 - 1, var4) && super.canPlaceBlockAt(var1, var2, var3, var4) && super.canPlaceBlockAt(var1, var2, var3 + 1, var4); +- } +- ++ } ++ ++ /** ++ * Returns the ID of the items to drop on destruction. ++ */ ++ public int idDropped(int par1, Random par2Random, int par3) { ++ return (par1 & 8) != 0 ? 0 : (this.blockMaterial == Material.iron ? Item.doorIron.itemID : Item.doorWood.itemID); ++ } ++ ++ /** ++ * Ray traces through the blocks collision from start vector to end vector returning a ray trace hit. Args: world, x, ++ * y, z, startVec, endVec ++ */ ++ public MovingObjectPosition collisionRayTrace(World par1World, int par2, int par3, int par4, Vec3 par5Vec3, Vec3 par6Vec3) { ++ this.setBlockBoundsBasedOnState(par1World, par2, par3, par4); ++ return super.collisionRayTrace(par1World, par2, par3, par4, par5Vec3, par6Vec3); ++ } ++ ++ /** ++ * Checks to see if its valid to put this block at the specified coordinates. Args: world, x, y, z ++ */ ++ public boolean canPlaceBlockAt(World par1World, int par2, int par3, int par4) { ++ return par3 >= 255 ? false : par1World.doesBlockHaveSolidTopSurface(par2, par3 - 1, par4) && super.canPlaceBlockAt(par1World, par2, par3, par4) && super.canPlaceBlockAt(par1World, par2, par3 + 1, par4); ++ } ++ ++ /** ++ * Returns the mobility information of the block, 0 = free, 1 = can't push but can move over, 2 = total immobility and ++ * stop pistons ++ */ + public int getMobilityFlag() { + return 1; + } + +- public int getFullMetadata(IBlockAccess var1, int var2, int var3, int var4) { +- int var5 = var1.getBlockMetadata(var2, var3, var4); ++ /** ++ * Returns the full metadata value created by combining the metadata of both blocks the door takes up. ++ */ ++ public int getFullMetadata(IBlockAccess par1IBlockAccess, int par2, int par3, int par4) { ++ int var5 = par1IBlockAccess.getBlockMetadata(par2, par3, par4); + boolean var6 = (var5 & 8) != 0; + int var7; + int var8; +- if(var6) { +- var7 = var1.getBlockMetadata(var2, var3 - 1, var4); ++ ++ if (var6) { ++ var7 = par1IBlockAccess.getBlockMetadata(par2, par3 - 1, par4); + var8 = var5; + } else { + var7 = var5; +- var8 = var1.getBlockMetadata(var2, var3 + 1, var4); ++ var8 = par1IBlockAccess.getBlockMetadata(par2, par3 + 1, par4); + } + + boolean var9 = (var8 & 1) != 0; + return var7 & 7 | (var6 ? 8 : 0) | (var9 ? 16 : 0); + } + +- public int idPicked(World var1, int var2, int var3, int var4) { ++ /** ++ * only called by clickMiddleMouseButton , and passed to inventory.setCurrentItem (along with isCreative) ++ */ ++ public int idPicked(World par1World, int par2, int par3, int par4) { + return this.blockMaterial == Material.iron ? Item.doorIron.itemID : Item.doorWood.itemID; + } + +- public void onBlockHarvested(World var1, int var2, int var3, int var4, int var5, EntityPlayer var6) { +- if(var6.capabilities.isCreativeMode && (var5 & 8) != 0 && var1.getBlockId(var2, var3 - 1, var4) == this.blockID) { +- var1.setBlockToAir(var2, var3 - 1, var4); ++ /** ++ * Called when the block is attempted to be harvested ++ */ ++ public void onBlockHarvested(World par1World, int par2, int par3, int par4, int par5, EntityPlayer par6EntityPlayer) { ++ if (par6EntityPlayer.capabilities.isCreativeMode && (par5 & 8) != 0 && par1World.getBlockId(par2, par3 - 1, par4) == this.blockID) { ++ par1World.setBlockToAir(par2, par3 - 1, par4); + } +- + } + } diff --git a/patches/net/minecraft/src/BlockDragonEgg.java.patch b/patches/net/minecraft/src/BlockDragonEgg.java.patch new file mode 100644 index 0000000..3986f9c --- /dev/null +++ b/patches/net/minecraft/src/BlockDragonEgg.java.patch @@ -0,0 +1,206 @@ +--- net/minecraft/src/BlockDragonEgg.java ++++ net/minecraft/src/BlockDragonEgg.java +@@ -3,106 +3,148 @@ + import java.util.Random; + + public class BlockDragonEgg extends Block { +- public BlockDragonEgg(int var1) { +- super(var1, Material.dragonEgg); +- this.setBlockBounds(1.0F / 16.0F, 0.0F, 1.0F / 16.0F, 15.0F / 16.0F, 1.0F, 15.0F / 16.0F); +- } +- +- public void onBlockAdded(World var1, int var2, int var3, int var4) { +- var1.scheduleBlockUpdate(var2, var3, var4, this.blockID, this.tickRate(var1)); +- } +- +- public void onNeighborBlockChange(World var1, int var2, int var3, int var4, int var5) { +- var1.scheduleBlockUpdate(var2, var3, var4, this.blockID, this.tickRate(var1)); +- } +- +- public void updateTick(World var1, int var2, int var3, int var4, Random var5) { +- this.fallIfPossible(var1, var2, var3, var4); +- } +- +- private void fallIfPossible(World var1, int var2, int var3, int var4) { +- if(BlockSand.canFallBelow(var1, var2, var3 - 1, var4) && var3 >= 0) { ++ public BlockDragonEgg(int par1) { ++ super(par1, Material.dragonEgg); ++ this.setBlockBounds(0.0625F, 0.0F, 0.0625F, 0.9375F, 1.0F, 0.9375F); ++ } ++ ++ /** ++ * Called whenever the block is added into the world. Args: world, x, y, z ++ */ ++ public void onBlockAdded(World par1World, int par2, int par3, int par4) { ++ par1World.scheduleBlockUpdate(par2, par3, par4, this.blockID, this.tickRate(par1World)); ++ } ++ ++ /** ++ * Lets the block know when one of its neighbor changes. Doesn't know which neighbor changed (coordinates passed are ++ * their own) Args: x, y, z, neighbor blockID ++ */ ++ public void onNeighborBlockChange(World par1World, int par2, int par3, int par4, int par5) { ++ par1World.scheduleBlockUpdate(par2, par3, par4, this.blockID, this.tickRate(par1World)); ++ } ++ ++ /** ++ * Ticks the block if it's been scheduled ++ */ ++ public void updateTick(World par1World, int par2, int par3, int par4, Random par5Random) { ++ this.fallIfPossible(par1World, par2, par3, par4); ++ } ++ ++ /** ++ * Checks if the dragon egg can fall down, and if so, makes it fall. ++ */ ++ private void fallIfPossible(World par1World, int par2, int par3, int par4) { ++ if (BlockSand.canFallBelow(par1World, par2, par3 - 1, par4) && par3 >= 0) { + byte var5 = 32; +- if(!BlockSand.fallInstantly && var1.checkChunksExist(var2 - var5, var3 - var5, var4 - var5, var2 + var5, var3 + var5, var4 + var5)) { +- EntityFallingSand var6 = new EntityFallingSand(var1, (double)((float)var2 + 0.5F), (double)((float)var3 + 0.5F), (double)((float)var4 + 0.5F), this.blockID); +- var1.spawnEntityInWorld(var6); ++ ++ if (!BlockSand.fallInstantly && par1World.checkChunksExist(par2 - var5, par3 - var5, par4 - var5, par2 + var5, par3 + var5, par4 + var5)) { ++ EntityFallingSand var6 = new EntityFallingSand(par1World, (double)((float)par2 + 0.5F), (double)((float)par3 + 0.5F), (double)((float)par4 + 0.5F), this.blockID); ++ par1World.spawnEntityInWorld(var6); + } else { +- var1.setBlockToAir(var2, var3, var4); ++ par1World.setBlockToAir(par2, par3, par4); + +- while(BlockSand.canFallBelow(var1, var2, var3 - 1, var4) && var3 > 0) { +- --var3; ++ while (BlockSand.canFallBelow(par1World, par2, par3 - 1, par4) && par3 > 0) { ++ --par3; + } + +- if(var3 > 0) { +- var1.setBlock(var2, var3, var4, this.blockID, 0, 2); ++ if (par3 > 0) { ++ par1World.setBlock(par2, par3, par4, this.blockID, 0, 2); + } + } + } +- + } + +- public boolean onBlockActivated(World var1, int var2, int var3, int var4, EntityPlayer var5, int var6, float var7, float var8, float var9) { +- this.teleportNearby(var1, var2, var3, var4); ++ /** ++ * Called upon block activation (right click on the block.) ++ */ ++ public boolean onBlockActivated(World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer, int par6, float par7, float par8, float par9) { ++ this.teleportNearby(par1World, par2, par3, par4); + return true; + } + +- public void onBlockClicked(World var1, int var2, int var3, int var4, EntityPlayer var5) { +- this.teleportNearby(var1, var2, var3, var4); ++ /** ++ * Called when the block is clicked by a player. Args: x, y, z, entityPlayer ++ */ ++ public void onBlockClicked(World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer) { ++ this.teleportNearby(par1World, par2, par3, par4); + } + +- private void teleportNearby(World var1, int var2, int var3, int var4) { +- if(var1.getBlockId(var2, var3, var4) == this.blockID) { +- for(int var5 = 0; var5 < 1000; ++var5) { +- int var6 = var2 + var1.s.nextInt(16) - var1.s.nextInt(16); +- int var7 = var3 + var1.s.nextInt(8) - var1.s.nextInt(8); +- int var8 = var4 + var1.s.nextInt(16) - var1.s.nextInt(16); +- if(var1.getBlockId(var6, var7, var8) == 0) { +- if(!var1.isRemote) { +- var1.setBlock(var6, var7, var8, this.blockID, var1.getBlockMetadata(var2, var3, var4), 2); +- var1.setBlockToAir(var2, var3, var4); ++ /** ++ * Teleports the dragon egg somewhere else in a 31x19x31 area centered on the egg. ++ */ ++ private void teleportNearby(World par1World, int par2, int par3, int par4) { ++ if (par1World.getBlockId(par2, par3, par4) == this.blockID) { ++ for (int var5 = 0; var5 < 1000; ++var5) { ++ int var6 = par2 + par1World.rand.nextInt(16) - par1World.rand.nextInt(16); ++ int var7 = par3 + par1World.rand.nextInt(8) - par1World.rand.nextInt(8); ++ int var8 = par4 + par1World.rand.nextInt(16) - par1World.rand.nextInt(16); ++ ++ if (par1World.getBlockId(var6, var7, var8) == 0) { ++ if (!par1World.isRemote) { ++ par1World.setBlock(var6, var7, var8, this.blockID, par1World.getBlockMetadata(par2, par3, par4), 2); ++ par1World.setBlockToAir(par2, par3, par4); + } else { + short var9 = 128; + +- for(int var10 = 0; var10 < var9; ++var10) { +- double var11 = var1.s.nextDouble(); +- float var13 = (var1.s.nextFloat() - 0.5F) * 0.2F; +- float var14 = (var1.s.nextFloat() - 0.5F) * 0.2F; +- float var15 = (var1.s.nextFloat() - 0.5F) * 0.2F; +- double var16 = (double)var6 + (double)(var2 - var6) * var11 + (var1.s.nextDouble() - 0.5D) * 1.0D + 0.5D; +- double var18 = (double)var7 + (double)(var3 - var7) * var11 + var1.s.nextDouble() * 1.0D - 0.5D; +- double var20 = (double)var8 + (double)(var4 - var8) * var11 + (var1.s.nextDouble() - 0.5D) * 1.0D + 0.5D; +- var1.spawnParticle("portal", var16, var18, var20, (double)var13, (double)var14, (double)var15); ++ for (int var10 = 0; var10 < var9; ++var10) { ++ double var11 = par1World.rand.nextDouble(); ++ float var13 = (par1World.rand.nextFloat() - 0.5F) * 0.2F; ++ float var14 = (par1World.rand.nextFloat() - 0.5F) * 0.2F; ++ float var15 = (par1World.rand.nextFloat() - 0.5F) * 0.2F; ++ double var16 = (double)var6 + (double)(par2 - var6) * var11 + (par1World.rand.nextDouble() - 0.5D) * 1.0D + 0.5D; ++ double var18 = (double)var7 + (double)(par3 - var7) * var11 + par1World.rand.nextDouble() * 1.0D - 0.5D; ++ double var20 = (double)var8 + (double)(par4 - var8) * var11 + (par1World.rand.nextDouble() - 0.5D) * 1.0D + 0.5D; ++ par1World.spawnParticle("portal", var16, var18, var20, (double)var13, (double)var14, (double)var15); + } + } + + return; + } + } +- + } + } + +- public int tickRate(World var1) { ++ /** ++ * How many world ticks before ticking ++ */ ++ public int tickRate(World par1World) { + return 5; + } + ++ /** ++ * Is this block (a) opaque and (b) a full 1m cube? This determines whether or not to render the shared face of two ++ * adjacent blocks and also whether the player can attach torches, redstone wire, etc to this block. ++ */ + public boolean isOpaqueCube() { + return false; + } + ++ /** ++ * If this block doesn't render as an ordinary block it will return False (examples: signs, buttons, stairs, etc) ++ */ + public boolean renderAsNormalBlock() { + return false; + } + +- public boolean shouldSideBeRendered(IBlockAccess var1, int var2, int var3, int var4, int var5) { ++ /** ++ * Returns true if the given side of this block type should be rendered, if the adjacent block is at the given ++ * coordinates. Args: blockAccess, x, y, z, side ++ */ ++ public boolean shouldSideBeRendered(IBlockAccess par1IBlockAccess, int par2, int par3, int par4, int par5) { + return true; + } + ++ /** ++ * The type of render function that is called for this block ++ */ + public int getRenderType() { + return 27; + } + +- public int idPicked(World var1, int var2, int var3, int var4) { ++ /** ++ * only called by clickMiddleMouseButton , and passed to inventory.setCurrentItem (along with isCreative) ++ */ ++ public int idPicked(World par1World, int par2, int par3, int par4) { + return 0; + } + } diff --git a/patches/net/minecraft/src/BlockDropper.java.patch b/patches/net/minecraft/src/BlockDropper.java.patch new file mode 100644 index 0000000..bfd57cf --- /dev/null +++ b/patches/net/minecraft/src/BlockDropper.java.patch @@ -0,0 +1,100 @@ +--- net/minecraft/src/BlockDropper.java ++++ net/minecraft/src/BlockDropper.java +@@ -3,42 +3,57 @@ + public class BlockDropper extends BlockDispenser { + private final IBehaviorDispenseItem dropperDefaultBehaviour = new BehaviorDefaultDispenseItem(); + +- protected BlockDropper(int var1) { +- super(var1); +- } +- +- public void registerIcons(IconRegister var1) { +- this.blockIcon = var1.registerIcon("furnace_side"); +- this.furnaceTopIcon = var1.registerIcon("furnace_top"); +- this.furnaceFrontIcon = var1.registerIcon(this.getTextureName() + "_front_horizontal"); +- this.field_96473_e = var1.registerIcon(this.getTextureName() + "_front_vertical"); +- } +- +- protected IBehaviorDispenseItem getBehaviorForItemStack(ItemStack var1) { ++ protected BlockDropper(int par1) { ++ super(par1); ++ } ++ ++ /** ++ * When this method is called, your block should register all the icons it needs with the given IconRegister. This is ++ * the only chance you get to register icons. ++ */ ++ public void registerIcons(IconRegister par1IconRegister) { ++ this.blockIcon = par1IconRegister.registerIcon("furnace_side"); ++ this.furnaceTopIcon = par1IconRegister.registerIcon("furnace_top"); ++ this.furnaceFrontIcon = par1IconRegister.registerIcon(this.getTextureName() + "_front_horizontal"); ++ this.field_96473_e = par1IconRegister.registerIcon(this.getTextureName() + "_front_vertical"); ++ } ++ ++ /** ++ * Returns the behavior for the given ItemStack. ++ */ ++ protected IBehaviorDispenseItem getBehaviorForItemStack(ItemStack par1ItemStack) { + return this.dropperDefaultBehaviour; + } + +- public TileEntity createNewTileEntity(World var1) { ++ /** ++ * Returns a new instance of a block's tile entity class. Called on placing the block. ++ */ ++ public TileEntity createNewTileEntity(World par1World) { + return new TileEntityDropper(); + } + +- protected void dispense(World var1, int var2, int var3, int var4) { +- BlockSourceImpl var5 = new BlockSourceImpl(var1, var2, var3, var4); ++ protected void dispense(World par1World, int par2, int par3, int par4) { ++ BlockSourceImpl var5 = new BlockSourceImpl(par1World, par2, par3, par4); + TileEntityDispenser var6 = (TileEntityDispenser)var5.getBlockTileEntity(); +- if(var6 != null) { ++ ++ if (var6 != null) { + int var7 = var6.getRandomStackFromInventory(); +- if(var7 < 0) { +- var1.playAuxSFX(1001, var2, var3, var4, 0); ++ ++ if (var7 < 0) { ++ par1World.playAuxSFX(1001, par2, par3, par4, 0); + } else { + ItemStack var8 = var6.getStackInSlot(var7); +- int var9 = var1.getBlockMetadata(var2, var3, var4) & 7; +- IInventory var10 = TileEntityHopper.getInventoryAtLocation(var1, (double)(var2 + Facing.offsetsXForSide[var9]), (double)(var3 + Facing.offsetsYForSide[var9]), (double)(var4 + Facing.offsetsZForSide[var9])); ++ int var9 = par1World.getBlockMetadata(par2, par3, par4) & 7; ++ IInventory var10 = TileEntityHopper.getInventoryAtLocation(par1World, (double)(par2 + Facing.offsetsXForSide[var9]), (double)(par3 + Facing.offsetsYForSide[var9]), (double)(par4 + Facing.offsetsZForSide[var9])); + ItemStack var11; +- if(var10 != null) { ++ ++ if (var10 != null) { + var11 = TileEntityHopper.insertStack(var10, var8.copy().splitStack(1), Facing.oppositeSide[var9]); +- if(var11 == null) { ++ ++ if (var11 == null) { + var11 = var8.copy(); +- if(--var11.stackSize == 0) { ++ ++ if (--var11.stackSize == 0) { + var11 = null; + } + } else { +@@ -46,14 +61,14 @@ + } + } else { + var11 = this.dropperDefaultBehaviour.dispense(var5, var8); +- if(var11 != null && var11.stackSize == 0) { ++ ++ if (var11 != null && var11.stackSize == 0) { + var11 = null; + } + } + + var6.setInventorySlotContents(var7, var11); + } +- + } + } + } diff --git a/patches/net/minecraft/src/BlockEnchantmentTable.java.patch b/patches/net/minecraft/src/BlockEnchantmentTable.java.patch new file mode 100644 index 0000000..8e4fdf4 --- /dev/null +++ b/patches/net/minecraft/src/BlockEnchantmentTable.java.patch @@ -0,0 +1,134 @@ +--- net/minecraft/src/BlockEnchantmentTable.java ++++ net/minecraft/src/BlockEnchantmentTable.java +@@ -6,75 +6,100 @@ + private Icon field_94461_a; + private Icon field_94460_b; + +- protected BlockEnchantmentTable(int var1) { +- super(var1, Material.rock); +- this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 12.0F / 16.0F, 1.0F); ++ protected BlockEnchantmentTable(int par1) { ++ super(par1, Material.rock); ++ this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.75F, 1.0F); + this.setLightOpacity(0); + this.setCreativeTab(CreativeTabs.tabDecorations); + } + ++ /** ++ * If this block doesn't render as an ordinary block it will return False (examples: signs, buttons, stairs, etc) ++ */ + public boolean renderAsNormalBlock() { + return false; + } + +- public void randomDisplayTick(World var1, int var2, int var3, int var4, Random var5) { +- super.randomDisplayTick(var1, var2, var3, var4, var5); ++ /** ++ * A randomly called display update to be able to add particles or other items for display ++ */ ++ public void randomDisplayTick(World par1World, int par2, int par3, int par4, Random par5Random) { ++ super.randomDisplayTick(par1World, par2, par3, par4, par5Random); + +- for(int var6 = var2 - 2; var6 <= var2 + 2; ++var6) { +- for(int var7 = var4 - 2; var7 <= var4 + 2; ++var7) { +- if(var6 > var2 - 2 && var6 < var2 + 2 && var7 == var4 - 1) { +- var7 = var4 + 2; ++ for (int var6 = par2 - 2; var6 <= par2 + 2; ++var6) { ++ for (int var7 = par4 - 2; var7 <= par4 + 2; ++var7) { ++ if (var6 > par2 - 2 && var6 < par2 + 2 && var7 == par4 - 1) { ++ var7 = par4 + 2; + } + +- if(var5.nextInt(16) == 0) { +- for(int var8 = var3; var8 <= var3 + 1; ++var8) { +- if(var1.getBlockId(var6, var8, var7) == Block.bookShelf.blockID) { +- if(!var1.isAirBlock((var6 - var2) / 2 + var2, var8, (var7 - var4) / 2 + var4)) { ++ if (par5Random.nextInt(16) == 0) { ++ for (int var8 = par3; var8 <= par3 + 1; ++var8) { ++ if (par1World.getBlockId(var6, var8, var7) == Block.bookShelf.blockID) { ++ if (!par1World.isAirBlock((var6 - par2) / 2 + par2, var8, (var7 - par4) / 2 + par4)) { + break; + } + +- var1.spawnParticle("enchantmenttable", (double)var2 + 0.5D, (double)var3 + 2.0D, (double)var4 + 0.5D, (double)((float)(var6 - var2) + var5.nextFloat()) - 0.5D, (double)((float)(var8 - var3) - var5.nextFloat() - 1.0F), (double)((float)(var7 - var4) + var5.nextFloat()) - 0.5D); ++ par1World.spawnParticle("enchantmenttable", (double)par2 + 0.5D, (double)par3 + 2.0D, (double)par4 + 0.5D, (double)((float)(var6 - par2) + par5Random.nextFloat()) - 0.5D, (double)((float)(var8 - par3) - par5Random.nextFloat() - 1.0F), (double)((float)(var7 - par4) + par5Random.nextFloat()) - 0.5D); + } + } + } + } + } +- + } + ++ /** ++ * Is this block (a) opaque and (b) a full 1m cube? This determines whether or not to render the shared face of two ++ * adjacent blocks and also whether the player can attach torches, redstone wire, etc to this block. ++ */ + public boolean isOpaqueCube() { + return false; + } + +- public Icon getIcon(int var1, int var2) { +- return var1 == 0 ? this.field_94460_b : (var1 == 1 ? this.field_94461_a : this.blockIcon); ++ /** ++ * From the specified side and block metadata retrieves the blocks texture. Args: side, metadata ++ */ ++ public Icon getIcon(int par1, int par2) { ++ return par1 == 0 ? this.field_94460_b : (par1 == 1 ? this.field_94461_a : this.blockIcon); + } + +- public TileEntity createNewTileEntity(World var1) { ++ /** ++ * Returns a new instance of a block's tile entity class. Called on placing the block. ++ */ ++ public TileEntity createNewTileEntity(World par1World) { + return new TileEntityEnchantmentTable(); + } + +- public boolean onBlockActivated(World var1, int var2, int var3, int var4, EntityPlayer var5, int var6, float var7, float var8, float var9) { +- if(var1.isRemote) { ++ /** ++ * Called upon block activation (right click on the block.) ++ */ ++ public boolean onBlockActivated(World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer, int par6, float par7, float par8, float par9) { ++ if (par1World.isRemote) { + return true; + } else { +- TileEntityEnchantmentTable var10 = (TileEntityEnchantmentTable)var1.getBlockTileEntity(var2, var3, var4); +- var5.displayGUIEnchantment(var2, var3, var4, var10.func_94135_b() ? var10.func_94133_a() : null); ++ TileEntityEnchantmentTable var10 = (TileEntityEnchantmentTable)par1World.getBlockTileEntity(par2, par3, par4); ++ par5EntityPlayer.displayGUIEnchantment(par2, par3, par4, var10.func_94135_b() ? var10.func_94133_a() : null); + return true; + } + } + +- public void onBlockPlacedBy(World var1, int var2, int var3, int var4, EntityLivingBase var5, ItemStack var6) { +- super.onBlockPlacedBy(var1, var2, var3, var4, var5, var6); +- if(var6.hasDisplayName()) { +- ((TileEntityEnchantmentTable)var1.getBlockTileEntity(var2, var3, var4)).func_94134_a(var6.getDisplayName()); ++ /** ++ * Called when the block is placed in the world. ++ */ ++ public void onBlockPlacedBy(World par1World, int par2, int par3, int par4, EntityLivingBase par5EntityLivingBase, ItemStack par6ItemStack) { ++ super.onBlockPlacedBy(par1World, par2, par3, par4, par5EntityLivingBase, par6ItemStack); ++ ++ if (par6ItemStack.hasDisplayName()) { ++ ((TileEntityEnchantmentTable)par1World.getBlockTileEntity(par2, par3, par4)).func_94134_a(par6ItemStack.getDisplayName()); + } +- + } + +- public void registerIcons(IconRegister var1) { +- this.blockIcon = var1.registerIcon(this.getTextureName() + "_" + "side"); +- this.field_94461_a = var1.registerIcon(this.getTextureName() + "_" + "top"); +- this.field_94460_b = var1.registerIcon(this.getTextureName() + "_" + "bottom"); ++ /** ++ * When this method is called, your block should register all the icons it needs with the given IconRegister. This is ++ * the only chance you get to register icons. ++ */ ++ public void registerIcons(IconRegister par1IconRegister) { ++ this.blockIcon = par1IconRegister.registerIcon(this.getTextureName() + "_" + "side"); ++ this.field_94461_a = par1IconRegister.registerIcon(this.getTextureName() + "_" + "top"); ++ this.field_94460_b = par1IconRegister.registerIcon(this.getTextureName() + "_" + "bottom"); + } + } diff --git a/patches/net/minecraft/src/BlockEndPortal.java.patch b/patches/net/minecraft/src/BlockEndPortal.java.patch new file mode 100644 index 0000000..22d2617 --- /dev/null +++ b/patches/net/minecraft/src/BlockEndPortal.java.patch @@ -0,0 +1,153 @@ +--- net/minecraft/src/BlockEndPortal.java ++++ net/minecraft/src/BlockEndPortal.java +@@ -4,76 +4,120 @@ + import java.util.Random; + + public class BlockEndPortal extends BlockContainer { ++ ++ /** ++ * true if the enderdragon has been killed - allows end portal blocks to be created in the end ++ */ + public static boolean bossDefeated; + +- protected BlockEndPortal(int var1, Material var2) { +- super(var1, var2); ++ protected BlockEndPortal(int par1, Material par2Material) { ++ super(par1, par2Material); + this.setLightValue(1.0F); + } + +- public TileEntity createNewTileEntity(World var1) { ++ /** ++ * Returns a new instance of a block's tile entity class. Called on placing the block. ++ */ ++ public TileEntity createNewTileEntity(World par1World) { + return new TileEntityEndPortal(); + } + +- public void setBlockBoundsBasedOnState(IBlockAccess var1, int var2, int var3, int var4) { +- float var5 = 1.0F / 16.0F; ++ /** ++ * Updates the blocks bounds based on its current state. Args: world, x, y, z ++ */ ++ public void setBlockBoundsBasedOnState(IBlockAccess par1IBlockAccess, int par2, int par3, int par4) { ++ float var5 = 0.0625F; + this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, var5, 1.0F); + } + +- public boolean shouldSideBeRendered(IBlockAccess var1, int var2, int var3, int var4, int var5) { +- return var5 != 0 ? false : super.shouldSideBeRendered(var1, var2, var3, var4, var5); +- } +- +- public void addCollisionBoxesToList(World var1, int var2, int var3, int var4, AxisAlignedBB var5, List var6, Entity var7) { +- } +- ++ /** ++ * Returns true if the given side of this block type should be rendered, if the adjacent block is at the given ++ * coordinates. Args: blockAccess, x, y, z, side ++ */ ++ public boolean shouldSideBeRendered(IBlockAccess par1IBlockAccess, int par2, int par3, int par4, int par5) { ++ return par5 != 0 ? false : super.shouldSideBeRendered(par1IBlockAccess, par2, par3, par4, par5); ++ } ++ ++ /** ++ * Adds all intersecting collision boxes to a list. (Be sure to only add boxes to the list if they intersect the mask.) ++ * Parameters: World, X, Y, Z, mask, list, colliding entity ++ */ ++ public void addCollisionBoxesToList(World par1World, int par2, int par3, int par4, AxisAlignedBB par5AxisAlignedBB, List par6List, Entity par7Entity) {} ++ ++ /** ++ * Is this block (a) opaque and (b) a full 1m cube? This determines whether or not to render the shared face of two ++ * adjacent blocks and also whether the player can attach torches, redstone wire, etc to this block. ++ */ + public boolean isOpaqueCube() { + return false; + } + ++ /** ++ * If this block doesn't render as an ordinary block it will return False (examples: signs, buttons, stairs, etc) ++ */ + public boolean renderAsNormalBlock() { + return false; + } + +- public int quantityDropped(Random var1) { ++ /** ++ * Returns the quantity of items to drop on block destruction. ++ */ ++ public int quantityDropped(Random par1Random) { + return 0; + } + +- public void onEntityCollidedWithBlock(World var1, int var2, int var3, int var4, Entity var5) { +- if(var5.ridingEntity == null && var5.riddenByEntity == null && !var1.isRemote) { +- var5.travelToDimension(1); ++ /** ++ * Triggered whenever an entity collides with this block (enters into the block). Args: world, x, y, z, entity ++ */ ++ public void onEntityCollidedWithBlock(World par1World, int par2, int par3, int par4, Entity par5Entity) { ++ if (par5Entity.ridingEntity == null && par5Entity.riddenByEntity == null && !par1World.isRemote) { ++ par5Entity.travelToDimension(1); + } +- + } + +- public void randomDisplayTick(World var1, int var2, int var3, int var4, Random var5) { +- double var6 = (double)((float)var2 + var5.nextFloat()); +- double var8 = (double)((float)var3 + 0.8F); +- double var10 = (double)((float)var4 + var5.nextFloat()); ++ /** ++ * A randomly called display update to be able to add particles or other items for display ++ */ ++ public void randomDisplayTick(World par1World, int par2, int par3, int par4, Random par5Random) { ++ double var6 = (double)((float)par2 + par5Random.nextFloat()); ++ double var8 = (double)((float)par3 + 0.8F); ++ double var10 = (double)((float)par4 + par5Random.nextFloat()); + double var12 = 0.0D; + double var14 = 0.0D; + double var16 = 0.0D; +- var1.spawnParticle("smoke", var6, var8, var10, var12, var14, var16); ++ par1World.spawnParticle("smoke", var6, var8, var10, var12, var14, var16); + } + ++ /** ++ * The type of render function that is called for this block ++ */ + public int getRenderType() { + return -1; + } + +- public void onBlockAdded(World var1, int var2, int var3, int var4) { +- if(!bossDefeated) { +- if(var1.provider.dimensionId != 0) { +- var1.setBlockToAir(var2, var3, var4); ++ /** ++ * Called whenever the block is added into the world. Args: world, x, y, z ++ */ ++ public void onBlockAdded(World par1World, int par2, int par3, int par4) { ++ if (!bossDefeated) { ++ if (par1World.provider.dimensionId != 0) { ++ par1World.setBlockToAir(par2, par3, par4); + } +- + } + } + +- public int idPicked(World var1, int var2, int var3, int var4) { ++ /** ++ * only called by clickMiddleMouseButton , and passed to inventory.setCurrentItem (along with isCreative) ++ */ ++ public int idPicked(World par1World, int par2, int par3, int par4) { + return 0; + } + +- public void registerIcons(IconRegister var1) { +- this.blockIcon = var1.registerIcon("portal"); ++ /** ++ * When this method is called, your block should register all the icons it needs with the given IconRegister. This is ++ * the only chance you get to register icons. ++ */ ++ public void registerIcons(IconRegister par1IconRegister) { ++ this.blockIcon = par1IconRegister.registerIcon("portal"); + } + } diff --git a/patches/net/minecraft/src/BlockEndPortalFrame.java.patch b/patches/net/minecraft/src/BlockEndPortalFrame.java.patch new file mode 100644 index 0000000..e16d128 --- /dev/null +++ b/patches/net/minecraft/src/BlockEndPortalFrame.java.patch @@ -0,0 +1,137 @@ +--- net/minecraft/src/BlockEndPortalFrame.java ++++ net/minecraft/src/BlockEndPortalFrame.java +@@ -7,67 +7,106 @@ + private Icon field_94400_a; + private Icon field_94399_b; + +- public BlockEndPortalFrame(int var1) { +- super(var1, Material.rock); +- } +- +- public Icon getIcon(int var1, int var2) { +- return var1 == 1 ? this.field_94400_a : (var1 == 0 ? Block.whiteStone.getBlockTextureFromSide(var1) : this.blockIcon); +- } +- +- public void registerIcons(IconRegister var1) { +- this.blockIcon = var1.registerIcon(this.getTextureName() + "_side"); +- this.field_94400_a = var1.registerIcon(this.getTextureName() + "_top"); +- this.field_94399_b = var1.registerIcon(this.getTextureName() + "_eye"); ++ public BlockEndPortalFrame(int par1) { ++ super(par1, Material.rock); ++ } ++ ++ /** ++ * From the specified side and block metadata retrieves the blocks texture. Args: side, metadata ++ */ ++ public Icon getIcon(int par1, int par2) { ++ return par1 == 1 ? this.field_94400_a : (par1 == 0 ? Block.whiteStone.getBlockTextureFromSide(par1) : this.blockIcon); ++ } ++ ++ /** ++ * When this method is called, your block should register all the icons it needs with the given IconRegister. This is ++ * the only chance you get to register icons. ++ */ ++ public void registerIcons(IconRegister par1IconRegister) { ++ this.blockIcon = par1IconRegister.registerIcon(this.getTextureName() + "_side"); ++ this.field_94400_a = par1IconRegister.registerIcon(this.getTextureName() + "_top"); ++ this.field_94399_b = par1IconRegister.registerIcon(this.getTextureName() + "_eye"); + } + + public Icon func_94398_p() { + return this.field_94399_b; + } + ++ /** ++ * Is this block (a) opaque and (b) a full 1m cube? This determines whether or not to render the shared face of two ++ * adjacent blocks and also whether the player can attach torches, redstone wire, etc to this block. ++ */ + public boolean isOpaqueCube() { + return false; + } + ++ /** ++ * The type of render function that is called for this block ++ */ + public int getRenderType() { + return 26; + } + ++ /** ++ * Sets the block's bounds for rendering it as an item ++ */ + public void setBlockBoundsForItemRender() { +- this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 13.0F / 16.0F, 1.0F); ++ this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.8125F, 1.0F); + } + +- public void addCollisionBoxesToList(World var1, int var2, int var3, int var4, AxisAlignedBB var5, List var6, Entity var7) { +- this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 13.0F / 16.0F, 1.0F); +- super.addCollisionBoxesToList(var1, var2, var3, var4, var5, var6, var7); +- int var8 = var1.getBlockMetadata(var2, var3, var4); +- if(isEnderEyeInserted(var8)) { +- this.setBlockBounds(5.0F / 16.0F, 13.0F / 16.0F, 5.0F / 16.0F, 11.0F / 16.0F, 1.0F, 11.0F / 16.0F); +- super.addCollisionBoxesToList(var1, var2, var3, var4, var5, var6, var7); ++ /** ++ * Adds all intersecting collision boxes to a list. (Be sure to only add boxes to the list if they intersect the mask.) ++ * Parameters: World, X, Y, Z, mask, list, colliding entity ++ */ ++ public void addCollisionBoxesToList(World par1World, int par2, int par3, int par4, AxisAlignedBB par5AxisAlignedBB, List par6List, Entity par7Entity) { ++ this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.8125F, 1.0F); ++ super.addCollisionBoxesToList(par1World, par2, par3, par4, par5AxisAlignedBB, par6List, par7Entity); ++ int var8 = par1World.getBlockMetadata(par2, par3, par4); ++ ++ if (isEnderEyeInserted(var8)) { ++ this.setBlockBounds(0.3125F, 0.8125F, 0.3125F, 0.6875F, 1.0F, 0.6875F); ++ super.addCollisionBoxesToList(par1World, par2, par3, par4, par5AxisAlignedBB, par6List, par7Entity); + } + + this.setBlockBoundsForItemRender(); + } + +- public static boolean isEnderEyeInserted(int var0) { +- return (var0 & 4) != 0; ++ /** ++ * checks if an ender eye has been inserted into the frame block. parameters: metadata ++ */ ++ public static boolean isEnderEyeInserted(int par0) { ++ return (par0 & 4) != 0; + } + +- public int idDropped(int var1, Random var2, int var3) { ++ /** ++ * Returns the ID of the items to drop on destruction. ++ */ ++ public int idDropped(int par1, Random par2Random, int par3) { + return 0; + } + +- public void onBlockPlacedBy(World var1, int var2, int var3, int var4, EntityLivingBase var5, ItemStack var6) { +- int var7 = ((MathHelper.floor_double((double)(var5.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3) + 2) % 4; +- var1.setBlockMetadata(var2, var3, var4, var7, 2); ++ /** ++ * Called when the block is placed in the world. ++ */ ++ public void onBlockPlacedBy(World par1World, int par2, int par3, int par4, EntityLivingBase par5EntityLivingBase, ItemStack par6ItemStack) { ++ int var7 = ((MathHelper.floor_double((double)(par5EntityLivingBase.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3) + 2) % 4; ++ par1World.setBlockMetadataWithNotify(par2, par3, par4, var7, 2); + } + ++ /** ++ * If this returns true, then comparators facing away from this block will use the value from ++ * getComparatorInputOverride instead of the actual redstone signal strength. ++ */ + public boolean hasComparatorInputOverride() { + return true; + } + +- public int getComparatorInputOverride(World var1, int var2, int var3, int var4, int var5) { +- int var6 = var1.getBlockMetadata(var2, var3, var4); ++ /** ++ * If hasComparatorInputOverride returns true, the return value from this is used instead of the redstone signal ++ * strength when this block inputs to a comparator. ++ */ ++ public int getComparatorInputOverride(World par1World, int par2, int par3, int par4, int par5) { ++ int var6 = par1World.getBlockMetadata(par2, par3, par4); + return isEnderEyeInserted(var6) ? 15 : 0; + } + } diff --git a/patches/net/minecraft/src/BlockEnderChest.java.patch b/patches/net/minecraft/src/BlockEnderChest.java.patch new file mode 100644 index 0000000..c1d891b --- /dev/null +++ b/patches/net/minecraft/src/BlockEnderChest.java.patch @@ -0,0 +1,180 @@ +--- net/minecraft/src/BlockEnderChest.java ++++ net/minecraft/src/BlockEnderChest.java +@@ -3,69 +3,96 @@ + import java.util.Random; + + public class BlockEnderChest extends BlockContainer { +- protected BlockEnderChest(int var1) { +- super(var1, Material.rock); ++ protected BlockEnderChest(int par1) { ++ super(par1, Material.rock); + this.setCreativeTab(CreativeTabs.tabDecorations); +- this.setBlockBounds(1.0F / 16.0F, 0.0F, 1.0F / 16.0F, 15.0F / 16.0F, 14.0F / 16.0F, 15.0F / 16.0F); ++ this.setBlockBounds(0.0625F, 0.0F, 0.0625F, 0.9375F, 0.875F, 0.9375F); + } + ++ /** ++ * Is this block (a) opaque and (b) a full 1m cube? This determines whether or not to render the shared face of two ++ * adjacent blocks and also whether the player can attach torches, redstone wire, etc to this block. ++ */ + public boolean isOpaqueCube() { + return false; + } + ++ /** ++ * If this block doesn't render as an ordinary block it will return False (examples: signs, buttons, stairs, etc) ++ */ + public boolean renderAsNormalBlock() { + return false; + } + ++ /** ++ * The type of render function that is called for this block ++ */ + public int getRenderType() { + return 22; + } + +- public int idDropped(int var1, Random var2, int var3) { ++ /** ++ * Returns the ID of the items to drop on destruction. ++ */ ++ public int idDropped(int par1, Random par2Random, int par3) { + return Block.obsidian.blockID; + } + +- public int quantityDropped(Random var1) { ++ /** ++ * Returns the quantity of items to drop on block destruction. ++ */ ++ public int quantityDropped(Random par1Random) { + return 8; + } + ++ /** ++ * Return true if a player with Silk Touch can harvest this block directly, and not its normal drops. ++ */ + protected boolean canSilkHarvest() { + return true; + } + +- public void onBlockPlacedBy(World var1, int var2, int var3, int var4, EntityLivingBase var5, ItemStack var6) { ++ /** ++ * Called when the block is placed in the world. ++ */ ++ public void onBlockPlacedBy(World par1World, int par2, int par3, int par4, EntityLivingBase par5EntityLivingBase, ItemStack par6ItemStack) { + byte var7 = 0; +- int var8 = MathHelper.floor_double((double)(var5.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3; +- if(var8 == 0) { ++ int var8 = MathHelper.floor_double((double)(par5EntityLivingBase.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3; ++ ++ if (var8 == 0) { + var7 = 2; + } + +- if(var8 == 1) { ++ if (var8 == 1) { + var7 = 5; + } + +- if(var8 == 2) { ++ if (var8 == 2) { + var7 = 3; + } + +- if(var8 == 3) { ++ if (var8 == 3) { + var7 = 4; + } + +- var1.setBlockMetadata(var2, var3, var4, var7, 2); ++ par1World.setBlockMetadataWithNotify(par2, par3, par4, var7, 2); + } + +- public boolean onBlockActivated(World var1, int var2, int var3, int var4, EntityPlayer var5, int var6, float var7, float var8, float var9) { +- InventoryEnderChest var10 = var5.getInventoryEnderChest(); +- TileEntityEnderChest var11 = (TileEntityEnderChest)var1.getBlockTileEntity(var2, var3, var4); +- if(var10 != null && var11 != null) { +- if(var1.isBlockNormalCube(var2, var3 + 1, var4)) { ++ /** ++ * Called upon block activation (right click on the block.) ++ */ ++ public boolean onBlockActivated(World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer, int par6, float par7, float par8, float par9) { ++ InventoryEnderChest var10 = par5EntityPlayer.getInventoryEnderChest(); ++ TileEntityEnderChest var11 = (TileEntityEnderChest)par1World.getBlockTileEntity(par2, par3, par4); ++ ++ if (var10 != null && var11 != null) { ++ if (par1World.isBlockNormalCube(par2, par3 + 1, par4)) { + return true; +- } else if(var1.isRemote) { ++ } else if (par1World.isRemote) { + return true; + } else { + var10.setAssociatedChest(var11); +- var5.displayGUIChest(var10); ++ par5EntityPlayer.displayGUIChest(var10); + return true; + } + } else { +@@ -73,33 +100,42 @@ + } + } + +- public TileEntity createNewTileEntity(World var1) { ++ /** ++ * Returns a new instance of a block's tile entity class. Called on placing the block. ++ */ ++ public TileEntity createNewTileEntity(World par1World) { + return new TileEntityEnderChest(); + } + +- public void randomDisplayTick(World var1, int var2, int var3, int var4, Random var5) { +- for(int var6 = 0; var6 < 3; ++var6) { +- double var10000 = (double)((float)var2 + var5.nextFloat()); +- double var9 = (double)((float)var3 + var5.nextFloat()); +- var10000 = (double)((float)var4 + var5.nextFloat()); ++ /** ++ * A randomly called display update to be able to add particles or other items for display ++ */ ++ public void randomDisplayTick(World par1World, int par2, int par3, int par4, Random par5Random) { ++ for (int var6 = 0; var6 < 3; ++var6) { ++ double var10000 = (double)((float)par2 + par5Random.nextFloat()); ++ double var9 = (double)((float)par3 + par5Random.nextFloat()); ++ var10000 = (double)((float)par4 + par5Random.nextFloat()); + double var13 = 0.0D; + double var15 = 0.0D; + double var17 = 0.0D; +- int var19 = var5.nextInt(2) * 2 - 1; +- int var20 = var5.nextInt(2) * 2 - 1; +- var13 = ((double)var5.nextFloat() - 0.5D) * 0.125D; +- var15 = ((double)var5.nextFloat() - 0.5D) * 0.125D; +- var17 = ((double)var5.nextFloat() - 0.5D) * 0.125D; +- double var11 = (double)var4 + 0.5D + 0.25D * (double)var20; +- var17 = (double)(var5.nextFloat() * 1.0F * (float)var20); +- double var7 = (double)var2 + 0.5D + 0.25D * (double)var19; +- var13 = (double)(var5.nextFloat() * 1.0F * (float)var19); +- var1.spawnParticle("portal", var7, var9, var11, var13, var15, var17); ++ int var19 = par5Random.nextInt(2) * 2 - 1; ++ int var20 = par5Random.nextInt(2) * 2 - 1; ++ var13 = ((double)par5Random.nextFloat() - 0.5D) * 0.125D; ++ var15 = ((double)par5Random.nextFloat() - 0.5D) * 0.125D; ++ var17 = ((double)par5Random.nextFloat() - 0.5D) * 0.125D; ++ double var11 = (double)par4 + 0.5D + 0.25D * (double)var20; ++ var17 = (double)(par5Random.nextFloat() * 1.0F * (float)var20); ++ double var7 = (double)par2 + 0.5D + 0.25D * (double)var19; ++ var13 = (double)(par5Random.nextFloat() * 1.0F * (float)var19); ++ par1World.spawnParticle("portal", var7, var9, var11, var13, var15, var17); + } +- + } + +- public void registerIcons(IconRegister var1) { +- this.blockIcon = var1.registerIcon("obsidian"); ++ /** ++ * When this method is called, your block should register all the icons it needs with the given IconRegister. This is ++ * the only chance you get to register icons. ++ */ ++ public void registerIcons(IconRegister par1IconRegister) { ++ this.blockIcon = par1IconRegister.registerIcon("obsidian"); + } + } diff --git a/patches/net/minecraft/src/BlockEventData.java.patch b/patches/net/minecraft/src/BlockEventData.java.patch new file mode 100644 index 0000000..36bd40b --- /dev/null +++ b/patches/net/minecraft/src/BlockEventData.java.patch @@ -0,0 +1,82 @@ +--- net/minecraft/src/BlockEventData.java ++++ net/minecraft/src/BlockEventData.java +@@ -5,47 +5,69 @@ + private int coordY; + private int coordZ; + private int blockID; ++ ++ /** Different for each blockID */ + private int eventID; ++ ++ /** Different for each blockID, eventID */ + private int eventParameter; + +- public BlockEventData(int var1, int var2, int var3, int var4, int var5, int var6) { +- this.coordX = var1; +- this.coordY = var2; +- this.coordZ = var3; +- this.eventID = var5; +- this.eventParameter = var6; +- this.blockID = var4; ++ public BlockEventData(int par1, int par2, int par3, int par4, int par5, int par6) { ++ this.coordX = par1; ++ this.coordY = par2; ++ this.coordZ = par3; ++ this.eventID = par5; ++ this.eventParameter = par6; ++ this.blockID = par4; + } + ++ /** ++ * Get the X coordinate. ++ */ + public int getX() { + return this.coordX; + } + ++ /** ++ * Get the Y coordinate. ++ */ + public int getY() { + return this.coordY; + } + ++ /** ++ * Get the Z coordinate. ++ */ + public int getZ() { + return this.coordZ; + } + ++ /** ++ * Get the Event ID (different for each BlockID) ++ */ + public int getEventID() { + return this.eventID; + } + ++ /** ++ * Get the Event Parameter (different for each BlockID,EventID) ++ */ + public int getEventParameter() { + return this.eventParameter; + } + ++ /** ++ * Gets the BlockID for this BlockEventData ++ */ + public int getBlockID() { + return this.blockID; + } + +- public boolean equals(Object var1) { +- if(!(var1 instanceof BlockEventData)) { ++ public boolean equals(Object par1Obj) { ++ if (!(par1Obj instanceof BlockEventData)) { + return false; + } else { +- BlockEventData var2 = (BlockEventData)var1; ++ BlockEventData var2 = (BlockEventData)par1Obj; + return this.coordX == var2.coordX && this.coordY == var2.coordY && this.coordZ == var2.coordZ && this.eventID == var2.eventID && this.eventParameter == var2.eventParameter && this.blockID == var2.blockID; + } + } diff --git a/patches/net/minecraft/src/BlockFarmland.java.patch b/patches/net/minecraft/src/BlockFarmland.java.patch new file mode 100644 index 0000000..ae40451 --- /dev/null +++ b/patches/net/minecraft/src/BlockFarmland.java.patch @@ -0,0 +1,189 @@ +--- net/minecraft/src/BlockFarmland.java ++++ net/minecraft/src/BlockFarmland.java +@@ -6,61 +6,84 @@ + private Icon field_94441_a; + private Icon field_94440_b; + +- protected BlockFarmland(int var1) { +- super(var1, Material.ground); ++ protected BlockFarmland(int par1) { ++ super(par1, Material.ground); + this.setTickRandomly(true); +- this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 15.0F / 16.0F, 1.0F); ++ this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.9375F, 1.0F); + this.setLightOpacity(255); + } + +- public AxisAlignedBB getCollisionBoundingBoxFromPool(World var1, int var2, int var3, int var4) { +- return AxisAlignedBB.getAABBPool().getAABB((double)(var2 + 0), (double)(var3 + 0), (double)(var4 + 0), (double)(var2 + 1), (double)(var3 + 1), (double)(var4 + 1)); ++ /** ++ * Returns a bounding box from the pool of bounding boxes (this means this box can change after the pool has been ++ * cleared to be reused) ++ */ ++ public AxisAlignedBB getCollisionBoundingBoxFromPool(World par1World, int par2, int par3, int par4) { ++ return AxisAlignedBB.getAABBPool().getAABB((double)(par2 + 0), (double)(par3 + 0), (double)(par4 + 0), (double)(par2 + 1), (double)(par3 + 1), (double)(par4 + 1)); + } + ++ /** ++ * Is this block (a) opaque and (b) a full 1m cube? This determines whether or not to render the shared face of two ++ * adjacent blocks and also whether the player can attach torches, redstone wire, etc to this block. ++ */ + public boolean isOpaqueCube() { + return false; + } + ++ /** ++ * If this block doesn't render as an ordinary block it will return False (examples: signs, buttons, stairs, etc) ++ */ + public boolean renderAsNormalBlock() { + return false; + } + +- public Icon getIcon(int var1, int var2) { +- return var1 == 1 ? (var2 > 0 ? this.field_94441_a : this.field_94440_b) : Block.dirt.getBlockTextureFromSide(var1); ++ /** ++ * From the specified side and block metadata retrieves the blocks texture. Args: side, metadata ++ */ ++ public Icon getIcon(int par1, int par2) { ++ return par1 == 1 ? (par2 > 0 ? this.field_94441_a : this.field_94440_b) : Block.dirt.getBlockTextureFromSide(par1); + } + +- public void updateTick(World var1, int var2, int var3, int var4, Random var5) { +- if(!this.isWaterNearby(var1, var2, var3, var4) && !var1.canLightningStrikeAt(var2, var3 + 1, var4)) { +- int var6 = var1.getBlockMetadata(var2, var3, var4); +- if(var6 > 0) { +- var1.setBlockMetadata(var2, var3, var4, var6 - 1, 2); +- } else if(!this.isCropsNearby(var1, var2, var3, var4)) { +- var1.setBlock(var2, var3, var4, Block.dirt.blockID); ++ /** ++ * Ticks the block if it's been scheduled ++ */ ++ public void updateTick(World par1World, int par2, int par3, int par4, Random par5Random) { ++ if (!this.isWaterNearby(par1World, par2, par3, par4) && !par1World.canLightningStrikeAt(par2, par3 + 1, par4)) { ++ int var6 = par1World.getBlockMetadata(par2, par3, par4); ++ ++ if (var6 > 0) { ++ par1World.setBlockMetadataWithNotify(par2, par3, par4, var6 - 1, 2); ++ } else if (!this.isCropsNearby(par1World, par2, par3, par4)) { ++ par1World.setBlock(par2, par3, par4, Block.dirt.blockID); + } + } else { +- var1.setBlockMetadata(var2, var3, var4, 7, 2); ++ par1World.setBlockMetadataWithNotify(par2, par3, par4, 7, 2); + } +- + } + +- public void onFallenUpon(World var1, int var2, int var3, int var4, Entity var5, float var6) { +- if(!var1.isRemote && var1.s.nextFloat() < var6 - 0.5F) { +- if(!(var5 instanceof EntityPlayer) && !var1.getGameRules().getGameRuleBooleanValue("mobGriefing")) { ++ /** ++ * Block's chance to react to an entity falling on it. ++ */ ++ public void onFallenUpon(World par1World, int par2, int par3, int par4, Entity par5Entity, float par6) { ++ if (!par1World.isRemote && par1World.rand.nextFloat() < par6 - 0.5F) { ++ if (!(par5Entity instanceof EntityPlayer) && !par1World.getGameRules().getGameRuleBooleanValue("mobGriefing")) { + return; + } + +- var1.setBlock(var2, var3, var4, Block.dirt.blockID); ++ par1World.setBlock(par2, par3, par4, Block.dirt.blockID); + } +- + } + +- private boolean isCropsNearby(World var1, int var2, int var3, int var4) { ++ /** ++ * returns true if there is at least one cropblock nearby (x-1 to x+1, y+1, z-1 to z+1) ++ */ ++ private boolean isCropsNearby(World par1World, int par2, int par3, int par4) { + byte var5 = 0; + +- for(int var6 = var2 - var5; var6 <= var2 + var5; ++var6) { +- for(int var7 = var4 - var5; var7 <= var4 + var5; ++var7) { +- int var8 = var1.getBlockId(var6, var3 + 1, var7); +- if(var8 == Block.crops.blockID || var8 == Block.melonStem.blockID || var8 == Block.pumpkinStem.blockID || var8 == Block.potato.blockID || var8 == Block.carrot.blockID) { ++ for (int var6 = par2 - var5; var6 <= par2 + var5; ++var6) { ++ for (int var7 = par4 - var5; var7 <= par4 + var5; ++var7) { ++ int var8 = par1World.getBlockId(var6, par3 + 1, var7); ++ ++ if (var8 == Block.crops.blockID || var8 == Block.melonStem.blockID || var8 == Block.pumpkinStem.blockID || var8 == Block.potato.blockID || var8 == Block.carrot.blockID) { + return true; + } + } +@@ -69,11 +92,14 @@ + return false; + } + +- private boolean isWaterNearby(World var1, int var2, int var3, int var4) { +- for(int var5 = var2 - 4; var5 <= var2 + 4; ++var5) { +- for(int var6 = var3; var6 <= var3 + 1; ++var6) { +- for(int var7 = var4 - 4; var7 <= var4 + 4; ++var7) { +- if(var1.getBlockMaterial(var5, var6, var7) == Material.water) { ++ /** ++ * returns true if there's water nearby (x-4 to x+4, y to y+1, k-4 to k+4) ++ */ ++ private boolean isWaterNearby(World par1World, int par2, int par3, int par4) { ++ for (int var5 = par2 - 4; var5 <= par2 + 4; ++var5) { ++ for (int var6 = par3; var6 <= par3 + 1; ++var6) { ++ for (int var7 = par4 - 4; var7 <= par4 + 4; ++var7) { ++ if (par1World.getBlockMaterial(var5, var6, var7) == Material.water) { + return true; + } + } +@@ -83,25 +109,39 @@ + return false; + } + +- public void onNeighborBlockChange(World var1, int var2, int var3, int var4, int var5) { +- super.onNeighborBlockChange(var1, var2, var3, var4, var5); +- Material var6 = var1.getBlockMaterial(var2, var3 + 1, var4); +- if(var6.isSolid()) { +- var1.setBlock(var2, var3, var4, Block.dirt.blockID); ++ /** ++ * Lets the block know when one of its neighbor changes. Doesn't know which neighbor changed (coordinates passed are ++ * their own) Args: x, y, z, neighbor blockID ++ */ ++ public void onNeighborBlockChange(World par1World, int par2, int par3, int par4, int par5) { ++ super.onNeighborBlockChange(par1World, par2, par3, par4, par5); ++ Material var6 = par1World.getBlockMaterial(par2, par3 + 1, par4); ++ ++ if (var6.isSolid()) { ++ par1World.setBlock(par2, par3, par4, Block.dirt.blockID); + } +- +- } +- +- public int idDropped(int var1, Random var2, int var3) { +- return Block.dirt.idDropped(0, var2, var3); +- } +- +- public int idPicked(World var1, int var2, int var3, int var4) { ++ } ++ ++ /** ++ * Returns the ID of the items to drop on destruction. ++ */ ++ public int idDropped(int par1, Random par2Random, int par3) { ++ return Block.dirt.idDropped(0, par2Random, par3); ++ } ++ ++ /** ++ * only called by clickMiddleMouseButton , and passed to inventory.setCurrentItem (along with isCreative) ++ */ ++ public int idPicked(World par1World, int par2, int par3, int par4) { + return Block.dirt.blockID; + } + +- public void registerIcons(IconRegister var1) { +- this.field_94441_a = var1.registerIcon(this.getTextureName() + "_wet"); +- this.field_94440_b = var1.registerIcon(this.getTextureName() + "_dry"); ++ /** ++ * When this method is called, your block should register all the icons it needs with the given IconRegister. This is ++ * the only chance you get to register icons. ++ */ ++ public void registerIcons(IconRegister par1IconRegister) { ++ this.field_94441_a = par1IconRegister.registerIcon(this.getTextureName() + "_wet"); ++ this.field_94440_b = par1IconRegister.registerIcon(this.getTextureName() + "_dry"); + } + } diff --git a/patches/net/minecraft/src/BlockFence.java.patch b/patches/net/minecraft/src/BlockFence.java.patch new file mode 100644 index 0000000..0c83368 --- /dev/null +++ b/patches/net/minecraft/src/BlockFence.java.patch @@ -0,0 +1,216 @@ +--- net/minecraft/src/BlockFence.java ++++ net/minecraft/src/BlockFence.java +@@ -3,109 +3,133 @@ + import java.util.List; + + public class BlockFence extends Block { +- private final String a; ++ private final String field_94464_a; + +- public BlockFence(int var1, String var2, Material var3) { +- super(var1, var3); +- this.a = var2; ++ public BlockFence(int par1, String par2Str, Material par3Material) { ++ super(par1, par3Material); ++ this.field_94464_a = par2Str; + this.setCreativeTab(CreativeTabs.tabDecorations); + } + +- public void addCollisionBoxesToList(World var1, int var2, int var3, int var4, AxisAlignedBB var5, List var6, Entity var7) { +- boolean var8 = this.canConnectFenceTo(var1, var2, var3, var4 - 1); +- boolean var9 = this.canConnectFenceTo(var1, var2, var3, var4 + 1); +- boolean var10 = this.canConnectFenceTo(var1, var2 - 1, var3, var4); +- boolean var11 = this.canConnectFenceTo(var1, var2 + 1, var3, var4); +- float var12 = 6.0F / 16.0F; +- float var13 = 10.0F / 16.0F; +- float var14 = 6.0F / 16.0F; +- float var15 = 10.0F / 16.0F; +- if(var8) { ++ /** ++ * Adds all intersecting collision boxes to a list. (Be sure to only add boxes to the list if they intersect the mask.) ++ * Parameters: World, X, Y, Z, mask, list, colliding entity ++ */ ++ public void addCollisionBoxesToList(World par1World, int par2, int par3, int par4, AxisAlignedBB par5AxisAlignedBB, List par6List, Entity par7Entity) { ++ boolean var8 = this.canConnectFenceTo(par1World, par2, par3, par4 - 1); ++ boolean var9 = this.canConnectFenceTo(par1World, par2, par3, par4 + 1); ++ boolean var10 = this.canConnectFenceTo(par1World, par2 - 1, par3, par4); ++ boolean var11 = this.canConnectFenceTo(par1World, par2 + 1, par3, par4); ++ float var12 = 0.375F; ++ float var13 = 0.625F; ++ float var14 = 0.375F; ++ float var15 = 0.625F; ++ ++ if (var8) { + var14 = 0.0F; + } + +- if(var9) { ++ if (var9) { + var15 = 1.0F; + } + +- if(var8 || var9) { ++ if (var8 || var9) { + this.setBlockBounds(var12, 0.0F, var14, var13, 1.5F, var15); +- super.addCollisionBoxesToList(var1, var2, var3, var4, var5, var6, var7); ++ super.addCollisionBoxesToList(par1World, par2, par3, par4, par5AxisAlignedBB, par6List, par7Entity); + } + +- var14 = 6.0F / 16.0F; +- var15 = 10.0F / 16.0F; +- if(var10) { ++ var14 = 0.375F; ++ var15 = 0.625F; ++ ++ if (var10) { + var12 = 0.0F; + } + +- if(var11) { ++ if (var11) { + var13 = 1.0F; + } + +- if(var10 || var11 || !var8 && !var9) { ++ if (var10 || var11 || !var8 && !var9) { + this.setBlockBounds(var12, 0.0F, var14, var13, 1.5F, var15); +- super.addCollisionBoxesToList(var1, var2, var3, var4, var5, var6, var7); ++ super.addCollisionBoxesToList(par1World, par2, par3, par4, par5AxisAlignedBB, par6List, par7Entity); + } + +- if(var8) { ++ if (var8) { + var14 = 0.0F; + } + +- if(var9) { ++ if (var9) { + var15 = 1.0F; + } + + this.setBlockBounds(var12, 0.0F, var14, var13, 1.0F, var15); + } + +- public void setBlockBoundsBasedOnState(IBlockAccess var1, int var2, int var3, int var4) { +- boolean var5 = this.canConnectFenceTo(var1, var2, var3, var4 - 1); +- boolean var6 = this.canConnectFenceTo(var1, var2, var3, var4 + 1); +- boolean var7 = this.canConnectFenceTo(var1, var2 - 1, var3, var4); +- boolean var8 = this.canConnectFenceTo(var1, var2 + 1, var3, var4); +- float var9 = 6.0F / 16.0F; +- float var10 = 10.0F / 16.0F; +- float var11 = 6.0F / 16.0F; +- float var12 = 10.0F / 16.0F; +- if(var5) { ++ /** ++ * Updates the blocks bounds based on its current state. Args: world, x, y, z ++ */ ++ public void setBlockBoundsBasedOnState(IBlockAccess par1IBlockAccess, int par2, int par3, int par4) { ++ boolean var5 = this.canConnectFenceTo(par1IBlockAccess, par2, par3, par4 - 1); ++ boolean var6 = this.canConnectFenceTo(par1IBlockAccess, par2, par3, par4 + 1); ++ boolean var7 = this.canConnectFenceTo(par1IBlockAccess, par2 - 1, par3, par4); ++ boolean var8 = this.canConnectFenceTo(par1IBlockAccess, par2 + 1, par3, par4); ++ float var9 = 0.375F; ++ float var10 = 0.625F; ++ float var11 = 0.375F; ++ float var12 = 0.625F; ++ ++ if (var5) { + var11 = 0.0F; + } + +- if(var6) { ++ if (var6) { + var12 = 1.0F; + } + +- if(var7) { ++ if (var7) { + var9 = 0.0F; + } + +- if(var8) { ++ if (var8) { + var10 = 1.0F; + } + + this.setBlockBounds(var9, 0.0F, var11, var10, 1.0F, var12); + } + ++ /** ++ * Is this block (a) opaque and (b) a full 1m cube? This determines whether or not to render the shared face of two ++ * adjacent blocks and also whether the player can attach torches, redstone wire, etc to this block. ++ */ + public boolean isOpaqueCube() { + return false; + } + ++ /** ++ * If this block doesn't render as an ordinary block it will return False (examples: signs, buttons, stairs, etc) ++ */ + public boolean renderAsNormalBlock() { + return false; + } + +- public boolean getBlocksMovement(IBlockAccess var1, int var2, int var3, int var4) { ++ public boolean getBlocksMovement(IBlockAccess par1IBlockAccess, int par2, int par3, int par4) { + return false; + } + ++ /** ++ * The type of render function that is called for this block ++ */ + public int getRenderType() { + return 11; + } + +- public boolean canConnectFenceTo(IBlockAccess var1, int var2, int var3, int var4) { +- int var5 = var1.getBlockId(var2, var3, var4); +- if(var5 != this.blockID && var5 != Block.fenceGate.blockID) { ++ /** ++ * Returns true if the specified block can be connected by a fence ++ */ ++ public boolean canConnectFenceTo(IBlockAccess par1IBlockAccess, int par2, int par3, int par4) { ++ int var5 = par1IBlockAccess.getBlockId(par2, par3, par4); ++ ++ if (var5 != this.blockID && var5 != Block.fenceGate.blockID) { + Block var6 = Block.blocksList[var5]; + return var6 != null && var6.blockMaterial.isOpaque() && var6.renderAsNormalBlock() ? var6.blockMaterial != Material.pumpkin : false; + } else { +@@ -113,19 +137,30 @@ + } + } + +- public static boolean isIdAFence(int var0) { +- return var0 == Block.fence.blockID || var0 == Block.netherFence.blockID; ++ public static boolean isIdAFence(int par0) { ++ return par0 == Block.fence.blockID || par0 == Block.netherFence.blockID; + } + +- public boolean shouldSideBeRendered(IBlockAccess var1, int var2, int var3, int var4, int var5) { ++ /** ++ * Returns true if the given side of this block type should be rendered, if the adjacent block is at the given ++ * coordinates. Args: blockAccess, x, y, z, side ++ */ ++ public boolean shouldSideBeRendered(IBlockAccess par1IBlockAccess, int par2, int par3, int par4, int par5) { + return true; + } + +- public void registerIcons(IconRegister var1) { +- this.blockIcon = var1.registerIcon(this.a); ++ /** ++ * When this method is called, your block should register all the icons it needs with the given IconRegister. This is ++ * the only chance you get to register icons. ++ */ ++ public void registerIcons(IconRegister par1IconRegister) { ++ this.blockIcon = par1IconRegister.registerIcon(this.field_94464_a); + } + +- public boolean onBlockActivated(World var1, int var2, int var3, int var4, EntityPlayer var5, int var6, float var7, float var8, float var9) { +- return var1.isRemote ? true : ItemLeash.func_135066_a(var5, var1, var2, var3, var4); ++ /** ++ * Called upon block activation (right click on the block.) ++ */ ++ public boolean onBlockActivated(World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer, int par6, float par7, float par8, float par9) { ++ return par1World.isRemote ? true : ItemLeash.func_135066_a(par5EntityPlayer, par1World, par2, par3, par4); + } + } diff --git a/patches/net/minecraft/src/BlockFenceGate.java.patch b/patches/net/minecraft/src/BlockFenceGate.java.patch new file mode 100644 index 0000000..c9b48fe --- /dev/null +++ b/patches/net/minecraft/src/BlockFenceGate.java.patch @@ -0,0 +1,197 @@ +--- net/minecraft/src/BlockFenceGate.java ++++ net/minecraft/src/BlockFenceGate.java +@@ -1,98 +1,143 @@ + package net.minecraft.src; + + public class BlockFenceGate extends BlockDirectional { +- public BlockFenceGate(int var1) { +- super(var1, Material.wood); ++ public BlockFenceGate(int par1) { ++ super(par1, Material.wood); + this.setCreativeTab(CreativeTabs.tabRedstone); + } + +- public Icon getIcon(int var1, int var2) { +- return Block.planks.getBlockTextureFromSide(var1); +- } +- +- public boolean canPlaceBlockAt(World var1, int var2, int var3, int var4) { +- return !var1.getBlockMaterial(var2, var3 - 1, var4).isSolid() ? false : super.canPlaceBlockAt(var1, var2, var3, var4); +- } +- +- public AxisAlignedBB getCollisionBoundingBoxFromPool(World var1, int var2, int var3, int var4) { +- int var5 = var1.getBlockMetadata(var2, var3, var4); +- return isFenceGateOpen(var5) ? null : (var5 != 2 && var5 != 0 ? AxisAlignedBB.getAABBPool().getAABB((double)((float)var2 + 6.0F / 16.0F), (double)var3, (double)var4, (double)((float)var2 + 10.0F / 16.0F), (double)((float)var3 + 1.5F), (double)(var4 + 1)) : AxisAlignedBB.getAABBPool().getAABB((double)var2, (double)var3, (double)((float)var4 + 6.0F / 16.0F), (double)(var2 + 1), (double)((float)var3 + 1.5F), (double)((float)var4 + 10.0F / 16.0F))); +- } +- +- public void setBlockBoundsBasedOnState(IBlockAccess var1, int var2, int var3, int var4) { +- int var5 = getDirection(var1.getBlockMetadata(var2, var3, var4)); +- if(var5 != 2 && var5 != 0) { +- this.setBlockBounds(6.0F / 16.0F, 0.0F, 0.0F, 10.0F / 16.0F, 1.0F, 1.0F); ++ /** ++ * From the specified side and block metadata retrieves the blocks texture. Args: side, metadata ++ */ ++ public Icon getIcon(int par1, int par2) { ++ return Block.planks.getBlockTextureFromSide(par1); ++ } ++ ++ /** ++ * Checks to see if its valid to put this block at the specified coordinates. Args: world, x, y, z ++ */ ++ public boolean canPlaceBlockAt(World par1World, int par2, int par3, int par4) { ++ return !par1World.getBlockMaterial(par2, par3 - 1, par4).isSolid() ? false : super.canPlaceBlockAt(par1World, par2, par3, par4); ++ } ++ ++ /** ++ * Returns a bounding box from the pool of bounding boxes (this means this box can change after the pool has been ++ * cleared to be reused) ++ */ ++ public AxisAlignedBB getCollisionBoundingBoxFromPool(World par1World, int par2, int par3, int par4) { ++ int var5 = par1World.getBlockMetadata(par2, par3, par4); ++ return isFenceGateOpen(var5) ? null : (var5 != 2 && var5 != 0 ? AxisAlignedBB.getAABBPool().getAABB((double)((float)par2 + 0.375F), (double)par3, (double)par4, (double)((float)par2 + 0.625F), (double)((float)par3 + 1.5F), (double)(par4 + 1)) : AxisAlignedBB.getAABBPool().getAABB((double)par2, (double)par3, (double)((float)par4 + 0.375F), (double)(par2 + 1), (double)((float)par3 + 1.5F), (double)((float)par4 + 0.625F))); ++ } ++ ++ /** ++ * Updates the blocks bounds based on its current state. Args: world, x, y, z ++ */ ++ public void setBlockBoundsBasedOnState(IBlockAccess par1IBlockAccess, int par2, int par3, int par4) { ++ int var5 = getDirection(par1IBlockAccess.getBlockMetadata(par2, par3, par4)); ++ ++ if (var5 != 2 && var5 != 0) { ++ this.setBlockBounds(0.375F, 0.0F, 0.0F, 0.625F, 1.0F, 1.0F); + } else { +- this.setBlockBounds(0.0F, 0.0F, 6.0F / 16.0F, 1.0F, 1.0F, 10.0F / 16.0F); ++ this.setBlockBounds(0.0F, 0.0F, 0.375F, 1.0F, 1.0F, 0.625F); + } +- + } + ++ /** ++ * Is this block (a) opaque and (b) a full 1m cube? This determines whether or not to render the shared face of two ++ * adjacent blocks and also whether the player can attach torches, redstone wire, etc to this block. ++ */ + public boolean isOpaqueCube() { + return false; + } + ++ /** ++ * If this block doesn't render as an ordinary block it will return False (examples: signs, buttons, stairs, etc) ++ */ + public boolean renderAsNormalBlock() { + return false; + } + +- public boolean getBlocksMovement(IBlockAccess var1, int var2, int var3, int var4) { +- return isFenceGateOpen(var1.getBlockMetadata(var2, var3, var4)); ++ public boolean getBlocksMovement(IBlockAccess par1IBlockAccess, int par2, int par3, int par4) { ++ return isFenceGateOpen(par1IBlockAccess.getBlockMetadata(par2, par3, par4)); + } + ++ /** ++ * The type of render function that is called for this block ++ */ + public int getRenderType() { + return 21; + } + +- public void onBlockPlacedBy(World var1, int var2, int var3, int var4, EntityLivingBase var5, ItemStack var6) { +- int var7 = (MathHelper.floor_double((double)(var5.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3) % 4; +- var1.setBlockMetadata(var2, var3, var4, var7, 2); ++ /** ++ * Called when the block is placed in the world. ++ */ ++ public void onBlockPlacedBy(World par1World, int par2, int par3, int par4, EntityLivingBase par5EntityLivingBase, ItemStack par6ItemStack) { ++ int var7 = (MathHelper.floor_double((double)(par5EntityLivingBase.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3) % 4; ++ par1World.setBlockMetadataWithNotify(par2, par3, par4, var7, 2); + } + +- public boolean onBlockActivated(World var1, int var2, int var3, int var4, EntityPlayer var5, int var6, float var7, float var8, float var9) { +- int var10 = var1.getBlockMetadata(var2, var3, var4); +- if(isFenceGateOpen(var10)) { +- var1.setBlockMetadata(var2, var3, var4, var10 & -5, 2); ++ /** ++ * Called upon block activation (right click on the block.) ++ */ ++ public boolean onBlockActivated(World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer, int par6, float par7, float par8, float par9) { ++ int var10 = par1World.getBlockMetadata(par2, par3, par4); ++ ++ if (isFenceGateOpen(var10)) { ++ par1World.setBlockMetadataWithNotify(par2, par3, par4, var10 & -5, 2); + } else { +- int var11 = (MathHelper.floor_double((double)(var5.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3) % 4; ++ int var11 = (MathHelper.floor_double((double)(par5EntityPlayer.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3) % 4; + int var12 = getDirection(var10); +- if(var12 == (var11 + 2) % 4) { ++ ++ if (var12 == (var11 + 2) % 4) { + var10 = var11; + } + +- var1.setBlockMetadata(var2, var3, var4, var10 | 4, 2); ++ par1World.setBlockMetadataWithNotify(par2, par3, par4, var10 | 4, 2); + } + +- var1.playAuxSFXAtEntity(var5, 1003, var2, var3, var4, 0); ++ par1World.playAuxSFXAtEntity(par5EntityPlayer, 1003, par2, par3, par4, 0); + return true; + } + +- public void onNeighborBlockChange(World var1, int var2, int var3, int var4, int var5) { +- if(!var1.isRemote) { +- int var6 = var1.getBlockMetadata(var2, var3, var4); +- boolean var7 = var1.isBlockIndirectlyGettingPowered(var2, var3, var4); +- if(var7 || var5 > 0 && Block.blocksList[var5].canProvidePower()) { +- if(var7 && !isFenceGateOpen(var6)) { +- var1.setBlockMetadata(var2, var3, var4, var6 | 4, 2); +- var1.playAuxSFXAtEntity((EntityPlayer)null, 1003, var2, var3, var4, 0); +- } else if(!var7 && isFenceGateOpen(var6)) { +- var1.setBlockMetadata(var2, var3, var4, var6 & -5, 2); +- var1.playAuxSFXAtEntity((EntityPlayer)null, 1003, var2, var3, var4, 0); ++ /** ++ * Lets the block know when one of its neighbor changes. Doesn't know which neighbor changed (coordinates passed are ++ * their own) Args: x, y, z, neighbor blockID ++ */ ++ public void onNeighborBlockChange(World par1World, int par2, int par3, int par4, int par5) { ++ if (!par1World.isRemote) { ++ int var6 = par1World.getBlockMetadata(par2, par3, par4); ++ boolean var7 = par1World.isBlockIndirectlyGettingPowered(par2, par3, par4); ++ ++ if (var7 || par5 > 0 && Block.blocksList[par5].canProvidePower()) { ++ if (var7 && !isFenceGateOpen(var6)) { ++ par1World.setBlockMetadataWithNotify(par2, par3, par4, var6 | 4, 2); ++ par1World.playAuxSFXAtEntity((EntityPlayer)null, 1003, par2, par3, par4, 0); ++ } else if (!var7 && isFenceGateOpen(var6)) { ++ par1World.setBlockMetadataWithNotify(par2, par3, par4, var6 & -5, 2); ++ par1World.playAuxSFXAtEntity((EntityPlayer)null, 1003, par2, par3, par4, 0); + } + } +- + } + } + +- public static boolean isFenceGateOpen(int var0) { +- return (var0 & 4) != 0; ++ /** ++ * Returns if the fence gate is open according to its metadata. ++ */ ++ public static boolean isFenceGateOpen(int par0) { ++ return (par0 & 4) != 0; + } + +- public boolean shouldSideBeRendered(IBlockAccess var1, int var2, int var3, int var4, int var5) { ++ /** ++ * Returns true if the given side of this block type should be rendered, if the adjacent block is at the given ++ * coordinates. Args: blockAccess, x, y, z, side ++ */ ++ public boolean shouldSideBeRendered(IBlockAccess par1IBlockAccess, int par2, int par3, int par4, int par5) { + return true; + } + +- public void registerIcons(IconRegister var1) { +- } ++ /** ++ * When this method is called, your block should register all the icons it needs with the given IconRegister. This is ++ * the only chance you get to register icons. ++ */ ++ public void registerIcons(IconRegister par1IconRegister) {} + } diff --git a/patches/net/minecraft/src/BlockFire.java.patch b/patches/net/minecraft/src/BlockFire.java.patch new file mode 100644 index 0000000..ef17fc0 --- /dev/null +++ b/patches/net/minecraft/src/BlockFire.java.patch @@ -0,0 +1,527 @@ +--- net/minecraft/src/BlockFire.java ++++ net/minecraft/src/BlockFire.java +@@ -3,15 +3,26 @@ + import java.util.Random; + + public class BlockFire extends Block { ++ ++ /** The chance this block will encourage nearby blocks to catch on fire */ + private int[] chanceToEncourageFire = new int[256]; ++ ++ /** ++ * This is an array indexed by block ID the larger the number in the array the more likely a block type will catch ++ * fires ++ */ + private int[] abilityToCatchFire = new int[256]; + private Icon[] iconArray; + +- protected BlockFire(int var1) { +- super(var1, Material.fire); ++ protected BlockFire(int par1) { ++ super(par1, Material.fire); + this.setTickRandomly(true); + } + ++ /** ++ * This method is called on a block after all other blocks gets already created. You can use it to reference and ++ * configure something on the block that needs the others ones. ++ */ + public void initializeBlock() { + this.setBurnRate(Block.planks.blockID, 5, 20); + this.setBurnRate(Block.woodDoubleSlab.blockID, 5, 20); +@@ -32,107 +43,141 @@ + this.setBurnRate(Block.hay.blockID, 60, 20); + } + +- private void setBurnRate(int var1, int var2, int var3) { +- this.chanceToEncourageFire[var1] = var2; +- this.abilityToCatchFire[var1] = var3; ++ /** ++ * Sets the burn rate for a block. The larger abilityToCatchFire the more easily it will catch. The larger ++ * chanceToEncourageFire the faster it will burn and spread to other blocks. Args: blockID, chanceToEncourageFire, ++ * abilityToCatchFire ++ */ ++ private void setBurnRate(int par1, int par2, int par3) { ++ this.chanceToEncourageFire[par1] = par2; ++ this.abilityToCatchFire[par1] = par3; + } + +- public AxisAlignedBB getCollisionBoundingBoxFromPool(World var1, int var2, int var3, int var4) { ++ /** ++ * Returns a bounding box from the pool of bounding boxes (this means this box can change after the pool has been ++ * cleared to be reused) ++ */ ++ public AxisAlignedBB getCollisionBoundingBoxFromPool(World par1World, int par2, int par3, int par4) { + return null; + } + ++ /** ++ * Is this block (a) opaque and (b) a full 1m cube? This determines whether or not to render the shared face of two ++ * adjacent blocks and also whether the player can attach torches, redstone wire, etc to this block. ++ */ + public boolean isOpaqueCube() { + return false; + } + ++ /** ++ * If this block doesn't render as an ordinary block it will return False (examples: signs, buttons, stairs, etc) ++ */ + public boolean renderAsNormalBlock() { + return false; + } + ++ /** ++ * The type of render function that is called for this block ++ */ + public int getRenderType() { + return 3; + } + +- public int quantityDropped(Random var1) { ++ /** ++ * Returns the quantity of items to drop on block destruction. ++ */ ++ public int quantityDropped(Random par1Random) { + return 0; + } + +- public int tickRate(World var1) { ++ /** ++ * How many world ticks before ticking ++ */ ++ public int tickRate(World par1World) { + return 30; + } + +- public void updateTick(World var1, int var2, int var3, int var4, Random var5) { +- if(var1.getGameRules().getGameRuleBooleanValue("doFireTick")) { +- boolean var6 = var1.getBlockId(var2, var3 - 1, var4) == Block.netherrack.blockID; +- if(var1.provider instanceof WorldProviderEnd && var1.getBlockId(var2, var3 - 1, var4) == Block.bedrock.blockID) { ++ /** ++ * Ticks the block if it's been scheduled ++ */ ++ public void updateTick(World par1World, int par2, int par3, int par4, Random par5Random) { ++ if (par1World.getGameRules().getGameRuleBooleanValue("doFireTick")) { ++ boolean var6 = par1World.getBlockId(par2, par3 - 1, par4) == Block.netherrack.blockID; ++ ++ if (par1World.provider instanceof WorldProviderEnd && par1World.getBlockId(par2, par3 - 1, par4) == Block.bedrock.blockID) { + var6 = true; + } + +- if(!this.canPlaceBlockAt(var1, var2, var3, var4)) { +- var1.setBlockToAir(var2, var3, var4); ++ if (!this.canPlaceBlockAt(par1World, par2, par3, par4)) { ++ par1World.setBlockToAir(par2, par3, par4); + } + +- if(var6 || !var1.isRaining() || !var1.canLightningStrikeAt(var2, var3, var4) && !var1.canLightningStrikeAt(var2 - 1, var3, var4) && !var1.canLightningStrikeAt(var2 + 1, var3, var4) && !var1.canLightningStrikeAt(var2, var3, var4 - 1) && !var1.canLightningStrikeAt(var2, var3, var4 + 1)) { +- int var7 = var1.getBlockMetadata(var2, var3, var4); +- if(var7 < 15) { +- var1.setBlockMetadata(var2, var3, var4, var7 + var5.nextInt(3) / 2, 4); ++ if (!var6 && par1World.isRaining() && (par1World.canLightningStrikeAt(par2, par3, par4) || par1World.canLightningStrikeAt(par2 - 1, par3, par4) || par1World.canLightningStrikeAt(par2 + 1, par3, par4) || par1World.canLightningStrikeAt(par2, par3, par4 - 1) || par1World.canLightningStrikeAt(par2, par3, par4 + 1))) { ++ par1World.setBlockToAir(par2, par3, par4); ++ } else { ++ int var7 = par1World.getBlockMetadata(par2, par3, par4); ++ ++ if (var7 < 15) { ++ par1World.setBlockMetadataWithNotify(par2, par3, par4, var7 + par5Random.nextInt(3) / 2, 4); + } + +- var1.scheduleBlockUpdate(var2, var3, var4, this.blockID, this.tickRate(var1) + var5.nextInt(10)); +- if(!var6 && !this.canNeighborBurn(var1, var2, var3, var4)) { +- if(!var1.doesBlockHaveSolidTopSurface(var2, var3 - 1, var4) || var7 > 3) { +- var1.setBlockToAir(var2, var3, var4); ++ par1World.scheduleBlockUpdate(par2, par3, par4, this.blockID, this.tickRate(par1World) + par5Random.nextInt(10)); ++ ++ if (!var6 && !this.canNeighborBurn(par1World, par2, par3, par4)) { ++ if (!par1World.doesBlockHaveSolidTopSurface(par2, par3 - 1, par4) || var7 > 3) { ++ par1World.setBlockToAir(par2, par3, par4); + } +- +- } else if(!var6 && !this.canBlockCatchFire(var1, var2, var3 - 1, var4) && var7 == 15 && var5.nextInt(4) == 0) { +- var1.setBlockToAir(var2, var3, var4); ++ } else if (!var6 && !this.canBlockCatchFire(par1World, par2, par3 - 1, par4) && var7 == 15 && par5Random.nextInt(4) == 0) { ++ par1World.setBlockToAir(par2, par3, par4); + } else { +- boolean var8 = var1.isBlockHighHumidity(var2, var3, var4); ++ boolean var8 = par1World.isBlockHighHumidity(par2, par3, par4); + byte var9 = 0; +- if(var8) { ++ ++ if (var8) { + var9 = -50; + } + +- this.tryToCatchBlockOnFire(var1, var2 + 1, var3, var4, 300 + var9, var5, var7); +- this.tryToCatchBlockOnFire(var1, var2 - 1, var3, var4, 300 + var9, var5, var7); +- this.tryToCatchBlockOnFire(var1, var2, var3 - 1, var4, 250 + var9, var5, var7); +- this.tryToCatchBlockOnFire(var1, var2, var3 + 1, var4, 250 + var9, var5, var7); +- this.tryToCatchBlockOnFire(var1, var2, var3, var4 - 1, 300 + var9, var5, var7); +- this.tryToCatchBlockOnFire(var1, var2, var3, var4 + 1, 300 + var9, var5, var7); ++ this.tryToCatchBlockOnFire(par1World, par2 + 1, par3, par4, 300 + var9, par5Random, var7); ++ this.tryToCatchBlockOnFire(par1World, par2 - 1, par3, par4, 300 + var9, par5Random, var7); ++ this.tryToCatchBlockOnFire(par1World, par2, par3 - 1, par4, 250 + var9, par5Random, var7); ++ this.tryToCatchBlockOnFire(par1World, par2, par3 + 1, par4, 250 + var9, par5Random, var7); ++ this.tryToCatchBlockOnFire(par1World, par2, par3, par4 - 1, 300 + var9, par5Random, var7); ++ this.tryToCatchBlockOnFire(par1World, par2, par3, par4 + 1, 300 + var9, par5Random, var7); + +- for(int var10 = var2 - 1; var10 <= var2 + 1; ++var10) { +- for(int var11 = var4 - 1; var11 <= var4 + 1; ++var11) { +- for(int var12 = var3 - 1; var12 <= var3 + 4; ++var12) { +- if(var10 != var2 || var12 != var3 || var11 != var4) { ++ for (int var10 = par2 - 1; var10 <= par2 + 1; ++var10) { ++ for (int var11 = par4 - 1; var11 <= par4 + 1; ++var11) { ++ for (int var12 = par3 - 1; var12 <= par3 + 4; ++var12) { ++ if (var10 != par2 || var12 != par3 || var11 != par4) { + int var13 = 100; +- if(var12 > var3 + 1) { +- var13 += (var12 - (var3 + 1)) * 100; ++ ++ if (var12 > par3 + 1) { ++ var13 += (var12 - (par3 + 1)) * 100; + } + +- int var14 = this.getChanceOfNeighborsEncouragingFire(var1, var10, var12, var11); +- if(var14 > 0) { +- int var15 = (var14 + 40 + var1.difficultySetting * 7) / (var7 + 30); +- if(var8) { ++ int var14 = this.getChanceOfNeighborsEncouragingFire(par1World, var10, var12, var11); ++ ++ if (var14 > 0) { ++ int var15 = (var14 + 40 + par1World.difficultySetting * 7) / (var7 + 30); ++ ++ if (var8) { + var15 /= 2; + } + +- if(var15 > 0 && var5.nextInt(var13) <= var15 && (!var1.isRaining() || !var1.canLightningStrikeAt(var10, var12, var11)) && !var1.canLightningStrikeAt(var10 - 1, var12, var4) && !var1.canLightningStrikeAt(var10 + 1, var12, var11) && !var1.canLightningStrikeAt(var10, var12, var11 - 1) && !var1.canLightningStrikeAt(var10, var12, var11 + 1)) { +- int var16 = var7 + var5.nextInt(5) / 4; +- if(var16 > 15) { ++ if (var15 > 0 && par5Random.nextInt(var13) <= var15 && (!par1World.isRaining() || !par1World.canLightningStrikeAt(var10, var12, var11)) && !par1World.canLightningStrikeAt(var10 - 1, var12, par4) && !par1World.canLightningStrikeAt(var10 + 1, var12, var11) && !par1World.canLightningStrikeAt(var10, var12, var11 - 1) && !par1World.canLightningStrikeAt(var10, var12, var11 + 1)) { ++ int var16 = var7 + par5Random.nextInt(5) / 4; ++ ++ if (var16 > 15) { + var16 = 15; + } + +- var1.setBlock(var10, var12, var11, this.blockID, var16, 3); ++ par1World.setBlock(var10, var12, var11, this.blockID, var16, 3); + } + } + } + } + } + } +- + } +- } else { +- var1.setBlockToAir(var2, var3, var4); + } + } + } +@@ -141,155 +186,194 @@ + return false; + } + +- private void tryToCatchBlockOnFire(World var1, int var2, int var3, int var4, int var5, Random var6, int var7) { +- int var8 = this.abilityToCatchFire[var1.getBlockId(var2, var3, var4)]; +- if(var6.nextInt(var5) < var8) { +- boolean var9 = var1.getBlockId(var2, var3, var4) == Block.tnt.blockID; +- if(var6.nextInt(var7 + 10) < 5 && !var1.canLightningStrikeAt(var2, var3, var4)) { +- int var10 = var7 + var6.nextInt(5) / 4; +- if(var10 > 15) { ++ private void tryToCatchBlockOnFire(World par1World, int par2, int par3, int par4, int par5, Random par6Random, int par7) { ++ int var8 = this.abilityToCatchFire[par1World.getBlockId(par2, par3, par4)]; ++ ++ if (par6Random.nextInt(par5) < var8) { ++ boolean var9 = par1World.getBlockId(par2, par3, par4) == Block.tnt.blockID; ++ ++ if (par6Random.nextInt(par7 + 10) < 5 && !par1World.canLightningStrikeAt(par2, par3, par4)) { ++ int var10 = par7 + par6Random.nextInt(5) / 4; ++ ++ if (var10 > 15) { + var10 = 15; + } + +- var1.setBlock(var2, var3, var4, this.blockID, var10, 3); ++ par1World.setBlock(par2, par3, par4, this.blockID, var10, 3); + } else { +- var1.setBlockToAir(var2, var3, var4); ++ par1World.setBlockToAir(par2, par3, par4); + } + +- if(var9) { +- Block.tnt.onBlockDestroyedByPlayer(var1, var2, var3, var4, 1); ++ if (var9) { ++ Block.tnt.onBlockDestroyedByPlayer(par1World, par2, par3, par4, 1); + } + } +- +- } +- +- private boolean canNeighborBurn(World var1, int var2, int var3, int var4) { +- return this.canBlockCatchFire(var1, var2 + 1, var3, var4) ? true : (this.canBlockCatchFire(var1, var2 - 1, var3, var4) ? true : (this.canBlockCatchFire(var1, var2, var3 - 1, var4) ? true : (this.canBlockCatchFire(var1, var2, var3 + 1, var4) ? true : (this.canBlockCatchFire(var1, var2, var3, var4 - 1) ? true : this.canBlockCatchFire(var1, var2, var3, var4 + 1))))); +- } +- +- private int getChanceOfNeighborsEncouragingFire(World var1, int var2, int var3, int var4) { ++ } ++ ++ /** ++ * Returns true if at least one block next to this one can burn. ++ */ ++ private boolean canNeighborBurn(World par1World, int par2, int par3, int par4) { ++ return this.canBlockCatchFire(par1World, par2 + 1, par3, par4) ? true : (this.canBlockCatchFire(par1World, par2 - 1, par3, par4) ? true : (this.canBlockCatchFire(par1World, par2, par3 - 1, par4) ? true : (this.canBlockCatchFire(par1World, par2, par3 + 1, par4) ? true : (this.canBlockCatchFire(par1World, par2, par3, par4 - 1) ? true : this.canBlockCatchFire(par1World, par2, par3, par4 + 1))))); ++ } ++ ++ /** ++ * Gets the highest chance of a neighbor block encouraging this block to catch fire ++ */ ++ private int getChanceOfNeighborsEncouragingFire(World par1World, int par2, int par3, int par4) { + byte var5 = 0; +- if(!var1.isAirBlock(var2, var3, var4)) { ++ ++ if (!par1World.isAirBlock(par2, par3, par4)) { + return 0; + } else { +- int var6 = this.getChanceToEncourageFire(var1, var2 + 1, var3, var4, var5); +- var6 = this.getChanceToEncourageFire(var1, var2 - 1, var3, var4, var6); +- var6 = this.getChanceToEncourageFire(var1, var2, var3 - 1, var4, var6); +- var6 = this.getChanceToEncourageFire(var1, var2, var3 + 1, var4, var6); +- var6 = this.getChanceToEncourageFire(var1, var2, var3, var4 - 1, var6); +- var6 = this.getChanceToEncourageFire(var1, var2, var3, var4 + 1, var6); ++ int var6 = this.getChanceToEncourageFire(par1World, par2 + 1, par3, par4, var5); ++ var6 = this.getChanceToEncourageFire(par1World, par2 - 1, par3, par4, var6); ++ var6 = this.getChanceToEncourageFire(par1World, par2, par3 - 1, par4, var6); ++ var6 = this.getChanceToEncourageFire(par1World, par2, par3 + 1, par4, var6); ++ var6 = this.getChanceToEncourageFire(par1World, par2, par3, par4 - 1, var6); ++ var6 = this.getChanceToEncourageFire(par1World, par2, par3, par4 + 1, var6); + return var6; + } + } + ++ /** ++ * Returns if this block is collidable (only used by Fire). Args: x, y, z ++ */ + public boolean isCollidable() { + return false; + } + +- public boolean canBlockCatchFire(IBlockAccess var1, int var2, int var3, int var4) { +- return this.chanceToEncourageFire[var1.getBlockId(var2, var3, var4)] > 0; +- } +- +- public int getChanceToEncourageFire(World var1, int var2, int var3, int var4, int var5) { +- int var6 = this.chanceToEncourageFire[var1.getBlockId(var2, var3, var4)]; +- return var6 > var5 ? var6 : var5; +- } +- +- public boolean canPlaceBlockAt(World var1, int var2, int var3, int var4) { +- return var1.doesBlockHaveSolidTopSurface(var2, var3 - 1, var4) || this.canNeighborBurn(var1, var2, var3, var4); +- } +- +- public void onNeighborBlockChange(World var1, int var2, int var3, int var4, int var5) { +- if(!var1.doesBlockHaveSolidTopSurface(var2, var3 - 1, var4) && !this.canNeighborBurn(var1, var2, var3, var4)) { +- var1.setBlockToAir(var2, var3, var4); ++ /** ++ * Checks the specified block coordinate to see if it can catch fire. Args: blockAccess, x, y, z ++ */ ++ public boolean canBlockCatchFire(IBlockAccess par1IBlockAccess, int par2, int par3, int par4) { ++ return this.chanceToEncourageFire[par1IBlockAccess.getBlockId(par2, par3, par4)] > 0; ++ } ++ ++ /** ++ * Retrieves a specified block's chance to encourage their neighbors to burn and if the number is greater than the ++ * current number passed in it will return its number instead of the passed in one. Args: world, x, y, z, ++ * curChanceToEncourageFire ++ */ ++ public int getChanceToEncourageFire(World par1World, int par2, int par3, int par4, int par5) { ++ int var6 = this.chanceToEncourageFire[par1World.getBlockId(par2, par3, par4)]; ++ return var6 > par5 ? var6 : par5; ++ } ++ ++ /** ++ * Checks to see if its valid to put this block at the specified coordinates. Args: world, x, y, z ++ */ ++ public boolean canPlaceBlockAt(World par1World, int par2, int par3, int par4) { ++ return par1World.doesBlockHaveSolidTopSurface(par2, par3 - 1, par4) || this.canNeighborBurn(par1World, par2, par3, par4); ++ } ++ ++ /** ++ * Lets the block know when one of its neighbor changes. Doesn't know which neighbor changed (coordinates passed are ++ * their own) Args: x, y, z, neighbor blockID ++ */ ++ public void onNeighborBlockChange(World par1World, int par2, int par3, int par4, int par5) { ++ if (!par1World.doesBlockHaveSolidTopSurface(par2, par3 - 1, par4) && !this.canNeighborBurn(par1World, par2, par3, par4)) { ++ par1World.setBlockToAir(par2, par3, par4); + } +- + } + +- public void onBlockAdded(World var1, int var2, int var3, int var4) { +- if(var1.provider.dimensionId > 0 || var1.getBlockId(var2, var3 - 1, var4) != Block.obsidian.blockID || !Block.portal.tryToCreatePortal(var1, var2, var3, var4)) { +- if(!var1.doesBlockHaveSolidTopSurface(var2, var3 - 1, var4) && !this.canNeighborBurn(var1, var2, var3, var4)) { +- var1.setBlockToAir(var2, var3, var4); ++ /** ++ * Called whenever the block is added into the world. Args: world, x, y, z ++ */ ++ public void onBlockAdded(World par1World, int par2, int par3, int par4) { ++ if (par1World.provider.dimensionId > 0 || par1World.getBlockId(par2, par3 - 1, par4) != Block.obsidian.blockID || !Block.portal.tryToCreatePortal(par1World, par2, par3, par4)) { ++ if (!par1World.doesBlockHaveSolidTopSurface(par2, par3 - 1, par4) && !this.canNeighborBurn(par1World, par2, par3, par4)) { ++ par1World.setBlockToAir(par2, par3, par4); + } else { +- var1.scheduleBlockUpdate(var2, var3, var4, this.blockID, this.tickRate(var1) + var1.s.nextInt(10)); ++ par1World.scheduleBlockUpdate(par2, par3, par4, this.blockID, this.tickRate(par1World) + par1World.rand.nextInt(10)); + } + } + } + +- public void randomDisplayTick(World var1, int var2, int var3, int var4, Random var5) { +- if(var5.nextInt(24) == 0) { +- var1.playSound((double)((float)var2 + 0.5F), (double)((float)var3 + 0.5F), (double)((float)var4 + 0.5F), "fire.fire", 1.0F + var5.nextFloat(), var5.nextFloat() * 0.7F + 0.3F, false); ++ /** ++ * A randomly called display update to be able to add particles or other items for display ++ */ ++ public void randomDisplayTick(World par1World, int par2, int par3, int par4, Random par5Random) { ++ if (par5Random.nextInt(24) == 0) { ++ par1World.playSound((double)((float)par2 + 0.5F), (double)((float)par3 + 0.5F), (double)((float)par4 + 0.5F), "fire.fire", 1.0F + par5Random.nextFloat(), par5Random.nextFloat() * 0.7F + 0.3F, false); + } + + int var6; + float var7; + float var8; + float var9; +- if(!var1.doesBlockHaveSolidTopSurface(var2, var3 - 1, var4) && !Block.fire.canBlockCatchFire(var1, var2, var3 - 1, var4)) { +- if(Block.fire.canBlockCatchFire(var1, var2 - 1, var3, var4)) { +- for(var6 = 0; var6 < 2; ++var6) { +- var7 = (float)var2 + var5.nextFloat() * 0.1F; +- var8 = (float)var3 + var5.nextFloat(); +- var9 = (float)var4 + var5.nextFloat(); +- var1.spawnParticle("largesmoke", (double)var7, (double)var8, (double)var9, 0.0D, 0.0D, 0.0D); +- } +- } +- +- if(Block.fire.canBlockCatchFire(var1, var2 + 1, var3, var4)) { +- for(var6 = 0; var6 < 2; ++var6) { +- var7 = (float)(var2 + 1) - var5.nextFloat() * 0.1F; +- var8 = (float)var3 + var5.nextFloat(); +- var9 = (float)var4 + var5.nextFloat(); +- var1.spawnParticle("largesmoke", (double)var7, (double)var8, (double)var9, 0.0D, 0.0D, 0.0D); +- } +- } +- +- if(Block.fire.canBlockCatchFire(var1, var2, var3, var4 - 1)) { +- for(var6 = 0; var6 < 2; ++var6) { +- var7 = (float)var2 + var5.nextFloat(); +- var8 = (float)var3 + var5.nextFloat(); +- var9 = (float)var4 + var5.nextFloat() * 0.1F; +- var1.spawnParticle("largesmoke", (double)var7, (double)var8, (double)var9, 0.0D, 0.0D, 0.0D); +- } +- } +- +- if(Block.fire.canBlockCatchFire(var1, var2, var3, var4 + 1)) { +- for(var6 = 0; var6 < 2; ++var6) { +- var7 = (float)var2 + var5.nextFloat(); +- var8 = (float)var3 + var5.nextFloat(); +- var9 = (float)(var4 + 1) - var5.nextFloat() * 0.1F; +- var1.spawnParticle("largesmoke", (double)var7, (double)var8, (double)var9, 0.0D, 0.0D, 0.0D); +- } +- } +- +- if(Block.fire.canBlockCatchFire(var1, var2, var3 + 1, var4)) { +- for(var6 = 0; var6 < 2; ++var6) { +- var7 = (float)var2 + var5.nextFloat(); +- var8 = (float)(var3 + 1) - var5.nextFloat() * 0.1F; +- var9 = (float)var4 + var5.nextFloat(); +- var1.spawnParticle("largesmoke", (double)var7, (double)var8, (double)var9, 0.0D, 0.0D, 0.0D); ++ ++ if (!par1World.doesBlockHaveSolidTopSurface(par2, par3 - 1, par4) && !Block.fire.canBlockCatchFire(par1World, par2, par3 - 1, par4)) { ++ if (Block.fire.canBlockCatchFire(par1World, par2 - 1, par3, par4)) { ++ for (var6 = 0; var6 < 2; ++var6) { ++ var7 = (float)par2 + par5Random.nextFloat() * 0.1F; ++ var8 = (float)par3 + par5Random.nextFloat(); ++ var9 = (float)par4 + par5Random.nextFloat(); ++ par1World.spawnParticle("largesmoke", (double)var7, (double)var8, (double)var9, 0.0D, 0.0D, 0.0D); ++ } ++ } ++ ++ if (Block.fire.canBlockCatchFire(par1World, par2 + 1, par3, par4)) { ++ for (var6 = 0; var6 < 2; ++var6) { ++ var7 = (float)(par2 + 1) - par5Random.nextFloat() * 0.1F; ++ var8 = (float)par3 + par5Random.nextFloat(); ++ var9 = (float)par4 + par5Random.nextFloat(); ++ par1World.spawnParticle("largesmoke", (double)var7, (double)var8, (double)var9, 0.0D, 0.0D, 0.0D); ++ } ++ } ++ ++ if (Block.fire.canBlockCatchFire(par1World, par2, par3, par4 - 1)) { ++ for (var6 = 0; var6 < 2; ++var6) { ++ var7 = (float)par2 + par5Random.nextFloat(); ++ var8 = (float)par3 + par5Random.nextFloat(); ++ var9 = (float)par4 + par5Random.nextFloat() * 0.1F; ++ par1World.spawnParticle("largesmoke", (double)var7, (double)var8, (double)var9, 0.0D, 0.0D, 0.0D); ++ } ++ } ++ ++ if (Block.fire.canBlockCatchFire(par1World, par2, par3, par4 + 1)) { ++ for (var6 = 0; var6 < 2; ++var6) { ++ var7 = (float)par2 + par5Random.nextFloat(); ++ var8 = (float)par3 + par5Random.nextFloat(); ++ var9 = (float)(par4 + 1) - par5Random.nextFloat() * 0.1F; ++ par1World.spawnParticle("largesmoke", (double)var7, (double)var8, (double)var9, 0.0D, 0.0D, 0.0D); ++ } ++ } ++ ++ if (Block.fire.canBlockCatchFire(par1World, par2, par3 + 1, par4)) { ++ for (var6 = 0; var6 < 2; ++var6) { ++ var7 = (float)par2 + par5Random.nextFloat(); ++ var8 = (float)(par3 + 1) - par5Random.nextFloat() * 0.1F; ++ var9 = (float)par4 + par5Random.nextFloat(); ++ par1World.spawnParticle("largesmoke", (double)var7, (double)var8, (double)var9, 0.0D, 0.0D, 0.0D); + } + } + } else { +- for(var6 = 0; var6 < 3; ++var6) { +- var7 = (float)var2 + var5.nextFloat(); +- var8 = (float)var3 + var5.nextFloat() * 0.5F + 0.5F; +- var9 = (float)var4 + var5.nextFloat(); +- var1.spawnParticle("largesmoke", (double)var7, (double)var8, (double)var9, 0.0D, 0.0D, 0.0D); ++ for (var6 = 0; var6 < 3; ++var6) { ++ var7 = (float)par2 + par5Random.nextFloat(); ++ var8 = (float)par3 + par5Random.nextFloat() * 0.5F + 0.5F; ++ var9 = (float)par4 + par5Random.nextFloat(); ++ par1World.spawnParticle("largesmoke", (double)var7, (double)var8, (double)var9, 0.0D, 0.0D, 0.0D); + } + } +- +- } +- +- public void registerIcons(IconRegister var1) { +- this.iconArray = new Icon[]{var1.registerIcon(this.getTextureName() + "_layer_0"), var1.registerIcon(this.getTextureName() + "_layer_1")}; +- } +- +- public Icon getFireIcon(int var1) { +- return this.iconArray[var1]; +- } +- +- public Icon getIcon(int var1, int var2) { ++ } ++ ++ /** ++ * When this method is called, your block should register all the icons it needs with the given IconRegister. This is ++ * the only chance you get to register icons. ++ */ ++ public void registerIcons(IconRegister par1IconRegister) { ++ this.iconArray = new Icon[] {par1IconRegister.registerIcon(this.getTextureName() + "_layer_0"), par1IconRegister.registerIcon(this.getTextureName() + "_layer_1")}; ++ } ++ ++ public Icon getFireIcon(int par1) { ++ return this.iconArray[par1]; ++ } ++ ++ /** ++ * From the specified side and block metadata retrieves the blocks texture. Args: side, metadata ++ */ ++ public Icon getIcon(int par1, int par2) { + return this.iconArray[0]; + } + } diff --git a/patches/net/minecraft/src/BlockFlower.java.patch b/patches/net/minecraft/src/BlockFlower.java.patch new file mode 100644 index 0000000..47f5f67 --- /dev/null +++ b/patches/net/minecraft/src/BlockFlower.java.patch @@ -0,0 +1,127 @@ +--- net/minecraft/src/BlockFlower.java ++++ net/minecraft/src/BlockFlower.java +@@ -3,59 +3,89 @@ + import java.util.Random; + + public class BlockFlower extends Block { +- protected BlockFlower(int var1, Material var2) { +- super(var1, var2); ++ protected BlockFlower(int par1, Material par2Material) { ++ super(par1, par2Material); + this.setTickRandomly(true); + float var3 = 0.2F; + this.setBlockBounds(0.5F - var3, 0.0F, 0.5F - var3, 0.5F + var3, var3 * 3.0F, 0.5F + var3); + this.setCreativeTab(CreativeTabs.tabDecorations); + } + +- protected BlockFlower(int var1) { +- this(var1, Material.plants); +- } +- +- public boolean canPlaceBlockAt(World var1, int var2, int var3, int var4) { +- return super.canPlaceBlockAt(var1, var2, var3, var4) && this.canThisPlantGrowOnThisBlockID(var1.getBlockId(var2, var3 - 1, var4)); +- } +- +- protected boolean canThisPlantGrowOnThisBlockID(int var1) { +- return var1 == Block.grass.blockID || var1 == Block.dirt.blockID || var1 == Block.tilledField.blockID; +- } +- +- public void onNeighborBlockChange(World var1, int var2, int var3, int var4, int var5) { +- super.onNeighborBlockChange(var1, var2, var3, var4, var5); +- this.checkFlowerChange(var1, var2, var3, var4); +- } +- +- public void updateTick(World var1, int var2, int var3, int var4, Random var5) { +- this.checkFlowerChange(var1, var2, var3, var4); +- } +- +- protected final void checkFlowerChange(World var1, int var2, int var3, int var4) { +- if(!this.canBlockStay(var1, var2, var3, var4)) { +- this.dropBlockAsItem(var1, var2, var3, var4, var1.getBlockMetadata(var2, var3, var4), 0); +- var1.setBlock(var2, var3, var4, 0, 0, 2); ++ protected BlockFlower(int par1) { ++ this(par1, Material.plants); ++ } ++ ++ /** ++ * Checks to see if its valid to put this block at the specified coordinates. Args: world, x, y, z ++ */ ++ public boolean canPlaceBlockAt(World par1World, int par2, int par3, int par4) { ++ return super.canPlaceBlockAt(par1World, par2, par3, par4) && this.canThisPlantGrowOnThisBlockID(par1World.getBlockId(par2, par3 - 1, par4)); ++ } ++ ++ /** ++ * Gets passed in the blockID of the block below and supposed to return true if its allowed to grow on the type of ++ * blockID passed in. Args: blockID ++ */ ++ protected boolean canThisPlantGrowOnThisBlockID(int par1) { ++ return par1 == Block.grass.blockID || par1 == Block.dirt.blockID || par1 == Block.tilledField.blockID; ++ } ++ ++ /** ++ * Lets the block know when one of its neighbor changes. Doesn't know which neighbor changed (coordinates passed are ++ * their own) Args: x, y, z, neighbor blockID ++ */ ++ public void onNeighborBlockChange(World par1World, int par2, int par3, int par4, int par5) { ++ super.onNeighborBlockChange(par1World, par2, par3, par4, par5); ++ this.checkFlowerChange(par1World, par2, par3, par4); ++ } ++ ++ /** ++ * Ticks the block if it's been scheduled ++ */ ++ public void updateTick(World par1World, int par2, int par3, int par4, Random par5Random) { ++ this.checkFlowerChange(par1World, par2, par3, par4); ++ } ++ ++ protected final void checkFlowerChange(World par1World, int par2, int par3, int par4) { ++ if (!this.canBlockStay(par1World, par2, par3, par4)) { ++ this.dropBlockAsItem(par1World, par2, par3, par4, par1World.getBlockMetadata(par2, par3, par4), 0); ++ par1World.setBlock(par2, par3, par4, 0, 0, 2); + } +- +- } +- +- public boolean canBlockStay(World var1, int var2, int var3, int var4) { +- return (var1.getFullBlockLightValue(var2, var3, var4) >= 8 || var1.canBlockSeeTheSky(var2, var3, var4)) && this.canThisPlantGrowOnThisBlockID(var1.getBlockId(var2, var3 - 1, var4)); +- } +- +- public AxisAlignedBB getCollisionBoundingBoxFromPool(World var1, int var2, int var3, int var4) { ++ } ++ ++ /** ++ * Can this block stay at this position. Similar to canPlaceBlockAt except gets checked often with plants. ++ */ ++ public boolean canBlockStay(World par1World, int par2, int par3, int par4) { ++ return (par1World.getFullBlockLightValue(par2, par3, par4) >= 8 || par1World.canBlockSeeTheSky(par2, par3, par4)) && this.canThisPlantGrowOnThisBlockID(par1World.getBlockId(par2, par3 - 1, par4)); ++ } ++ ++ /** ++ * Returns a bounding box from the pool of bounding boxes (this means this box can change after the pool has been ++ * cleared to be reused) ++ */ ++ public AxisAlignedBB getCollisionBoundingBoxFromPool(World par1World, int par2, int par3, int par4) { + return null; + } + ++ /** ++ * Is this block (a) opaque and (b) a full 1m cube? This determines whether or not to render the shared face of two ++ * adjacent blocks and also whether the player can attach torches, redstone wire, etc to this block. ++ */ + public boolean isOpaqueCube() { + return false; + } + ++ /** ++ * If this block doesn't render as an ordinary block it will return False (examples: signs, buttons, stairs, etc) ++ */ + public boolean renderAsNormalBlock() { + return false; + } + ++ /** ++ * The type of render function that is called for this block ++ */ + public int getRenderType() { + return 1; + } diff --git a/patches/net/minecraft/src/BlockFlowerPot.java.patch b/patches/net/minecraft/src/BlockFlowerPot.java.patch new file mode 100644 index 0000000..01bc470 --- /dev/null +++ b/patches/net/minecraft/src/BlockFlowerPot.java.patch @@ -0,0 +1,293 @@ +--- net/minecraft/src/BlockFlowerPot.java ++++ net/minecraft/src/BlockFlowerPot.java +@@ -3,41 +3,60 @@ + import java.util.Random; + + public class BlockFlowerPot extends Block { +- public BlockFlowerPot(int var1) { +- super(var1, Material.circuits); ++ public BlockFlowerPot(int par1) { ++ super(par1, Material.circuits); + this.setBlockBoundsForItemRender(); + } + ++ /** ++ * Sets the block's bounds for rendering it as an item ++ */ + public void setBlockBoundsForItemRender() { +- float var1 = 6.0F / 16.0F; ++ float var1 = 0.375F; + float var2 = var1 / 2.0F; + this.setBlockBounds(0.5F - var2, 0.0F, 0.5F - var2, 0.5F + var2, var1, 0.5F + var2); + } + ++ /** ++ * Is this block (a) opaque and (b) a full 1m cube? This determines whether or not to render the shared face of two ++ * adjacent blocks and also whether the player can attach torches, redstone wire, etc to this block. ++ */ + public boolean isOpaqueCube() { + return false; + } + ++ /** ++ * The type of render function that is called for this block ++ */ + public int getRenderType() { + return 33; + } + ++ /** ++ * If this block doesn't render as an ordinary block it will return False (examples: signs, buttons, stairs, etc) ++ */ + public boolean renderAsNormalBlock() { + return false; + } + +- public boolean onBlockActivated(World var1, int var2, int var3, int var4, EntityPlayer var5, int var6, float var7, float var8, float var9) { +- ItemStack var10 = var5.inventory.getCurrentItem(); +- if(var10 == null) { ++ /** ++ * Called upon block activation (right click on the block.) ++ */ ++ public boolean onBlockActivated(World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer, int par6, float par7, float par8, float par9) { ++ ItemStack var10 = par5EntityPlayer.inventory.getCurrentItem(); ++ ++ if (var10 == null) { + return false; +- } else if(var1.getBlockMetadata(var2, var3, var4) != 0) { ++ } else if (par1World.getBlockMetadata(par2, par3, par4) != 0) { + return false; + } else { + int var11 = getMetaForPlant(var10); +- if(var11 > 0) { +- var1.setBlockMetadata(var2, var3, var4, var11, 2); +- if(!var5.capabilities.isCreativeMode && --var10.stackSize <= 0) { +- var5.inventory.setInventorySlotContents(var5.inventory.currentItem, (ItemStack)null); ++ ++ if (var11 > 0) { ++ par1World.setBlockMetadataWithNotify(par2, par3, par4, var11, 2); ++ ++ if (!par5EntityPlayer.capabilities.isCreativeMode && --var10.stackSize <= 0) { ++ par5EntityPlayer.inventory.setInventorySlotContents(par5EntityPlayer.inventory.currentItem, (ItemStack)null); + } + + return true; +@@ -47,108 +66,151 @@ + } + } + +- public int idPicked(World var1, int var2, int var3, int var4) { +- ItemStack var5 = getPlantForMeta(var1.getBlockMetadata(var2, var3, var4)); ++ /** ++ * only called by clickMiddleMouseButton , and passed to inventory.setCurrentItem (along with isCreative) ++ */ ++ public int idPicked(World par1World, int par2, int par3, int par4) { ++ ItemStack var5 = getPlantForMeta(par1World.getBlockMetadata(par2, par3, par4)); + return var5 == null ? Item.flowerPot.itemID : var5.itemID; + } + +- public int getDamageValue(World var1, int var2, int var3, int var4) { +- ItemStack var5 = getPlantForMeta(var1.getBlockMetadata(var2, var3, var4)); ++ /** ++ * Get the block's damage value (for use with pick block). ++ */ ++ public int getDamageValue(World par1World, int par2, int par3, int par4) { ++ ItemStack var5 = getPlantForMeta(par1World.getBlockMetadata(par2, par3, par4)); + return var5 == null ? Item.flowerPot.itemID : var5.getItemDamage(); + } + ++ /** ++ * Returns true only if block is flowerPot ++ */ + public boolean isFlowerPot() { + return true; + } + +- public boolean canPlaceBlockAt(World var1, int var2, int var3, int var4) { +- return super.canPlaceBlockAt(var1, var2, var3, var4) && var1.doesBlockHaveSolidTopSurface(var2, var3 - 1, var4); ++ /** ++ * Checks to see if its valid to put this block at the specified coordinates. Args: world, x, y, z ++ */ ++ public boolean canPlaceBlockAt(World par1World, int par2, int par3, int par4) { ++ return super.canPlaceBlockAt(par1World, par2, par3, par4) && par1World.doesBlockHaveSolidTopSurface(par2, par3 - 1, par4); + } + +- public void onNeighborBlockChange(World var1, int var2, int var3, int var4, int var5) { +- if(!var1.doesBlockHaveSolidTopSurface(var2, var3 - 1, var4)) { +- this.dropBlockAsItem(var1, var2, var3, var4, var1.getBlockMetadata(var2, var3, var4), 0); +- var1.setBlockToAir(var2, var3, var4); ++ /** ++ * Lets the block know when one of its neighbor changes. Doesn't know which neighbor changed (coordinates passed are ++ * their own) Args: x, y, z, neighbor blockID ++ */ ++ public void onNeighborBlockChange(World par1World, int par2, int par3, int par4, int par5) { ++ if (!par1World.doesBlockHaveSolidTopSurface(par2, par3 - 1, par4)) { ++ this.dropBlockAsItem(par1World, par2, par3, par4, par1World.getBlockMetadata(par2, par3, par4), 0); ++ par1World.setBlockToAir(par2, par3, par4); + } +- + } + +- public void dropBlockAsItemWithChance(World var1, int var2, int var3, int var4, int var5, float var6, int var7) { +- super.dropBlockAsItemWithChance(var1, var2, var3, var4, var5, var6, var7); +- if(var5 > 0) { +- ItemStack var8 = getPlantForMeta(var5); +- if(var8 != null) { +- this.dropBlockAsItem_do(var1, var2, var3, var4, var8); ++ /** ++ * Drops the block items with a specified chance of dropping the specified items ++ */ ++ public void dropBlockAsItemWithChance(World par1World, int par2, int par3, int par4, int par5, float par6, int par7) { ++ super.dropBlockAsItemWithChance(par1World, par2, par3, par4, par5, par6, par7); ++ ++ if (par5 > 0) { ++ ItemStack var8 = getPlantForMeta(par5); ++ ++ if (var8 != null) { ++ this.dropBlockAsItem_do(par1World, par2, par3, par4, var8); + } + } +- + } + +- public int idDropped(int var1, Random var2, int var3) { ++ /** ++ * Returns the ID of the items to drop on destruction. ++ */ ++ public int idDropped(int par1, Random par2Random, int par3) { + return Item.flowerPot.itemID; + } + +- public static ItemStack getPlantForMeta(int var0) { +- switch(var0) { +- case 1: +- return new ItemStack(Block.plantRed); +- case 2: +- return new ItemStack(Block.plantYellow); +- case 3: +- return new ItemStack(Block.sapling, 1, 0); +- case 4: +- return new ItemStack(Block.sapling, 1, 1); +- case 5: +- return new ItemStack(Block.sapling, 1, 2); +- case 6: +- return new ItemStack(Block.sapling, 1, 3); +- case 7: +- return new ItemStack(Block.mushroomRed); +- case 8: +- return new ItemStack(Block.mushroomBrown); +- case 9: +- return new ItemStack(Block.cactus); +- case 10: +- return new ItemStack(Block.deadBush); +- case 11: +- return new ItemStack(Block.tallGrass, 1, 2); +- default: +- return null; ++ /** ++ * Return the item associated with the specified flower pot metadata value. ++ */ ++ public static ItemStack getPlantForMeta(int par0) { ++ switch (par0) { ++ case 1: ++ return new ItemStack(Block.plantRed); ++ ++ case 2: ++ return new ItemStack(Block.plantYellow); ++ ++ case 3: ++ return new ItemStack(Block.sapling, 1, 0); ++ ++ case 4: ++ return new ItemStack(Block.sapling, 1, 1); ++ ++ case 5: ++ return new ItemStack(Block.sapling, 1, 2); ++ ++ case 6: ++ return new ItemStack(Block.sapling, 1, 3); ++ ++ case 7: ++ return new ItemStack(Block.mushroomRed); ++ ++ case 8: ++ return new ItemStack(Block.mushroomBrown); ++ ++ case 9: ++ return new ItemStack(Block.cactus); ++ ++ case 10: ++ return new ItemStack(Block.deadBush); ++ ++ case 11: ++ return new ItemStack(Block.tallGrass, 1, 2); ++ ++ default: ++ return null; + } + } + +- public static int getMetaForPlant(ItemStack var0) { +- int var1 = var0.getItem().itemID; +- if(var1 == Block.plantRed.blockID) { ++ /** ++ * Return the flower pot metadata value associated with the specified item. ++ */ ++ public static int getMetaForPlant(ItemStack par0ItemStack) { ++ int var1 = par0ItemStack.getItem().itemID; ++ ++ if (var1 == Block.plantRed.blockID) { + return 1; +- } else if(var1 == Block.plantYellow.blockID) { ++ } else if (var1 == Block.plantYellow.blockID) { + return 2; +- } else if(var1 == Block.cactus.blockID) { ++ } else if (var1 == Block.cactus.blockID) { + return 9; +- } else if(var1 == Block.mushroomBrown.blockID) { ++ } else if (var1 == Block.mushroomBrown.blockID) { + return 8; +- } else if(var1 == Block.mushroomRed.blockID) { ++ } else if (var1 == Block.mushroomRed.blockID) { + return 7; +- } else if(var1 == Block.deadBush.blockID) { ++ } else if (var1 == Block.deadBush.blockID) { + return 10; + } else { +- if(var1 == Block.sapling.blockID) { +- switch(var0.getItemDamage()) { +- case 0: +- return 3; +- case 1: +- return 4; +- case 2: +- return 5; +- case 3: +- return 6; ++ if (var1 == Block.sapling.blockID) { ++ switch (par0ItemStack.getItemDamage()) { ++ case 0: ++ return 3; ++ ++ case 1: ++ return 4; ++ ++ case 2: ++ return 5; ++ ++ case 3: ++ return 6; + } + } + +- if(var1 == Block.tallGrass.blockID) { +- switch(var0.getItemDamage()) { +- case 2: +- return 11; ++ if (var1 == Block.tallGrass.blockID) { ++ switch (par0ItemStack.getItemDamage()) { ++ case 2: ++ return 11; + } + } + diff --git a/patches/net/minecraft/src/BlockFlowing.java.patch b/patches/net/minecraft/src/BlockFlowing.java.patch new file mode 100644 index 0000000..477aa1f --- /dev/null +++ b/patches/net/minecraft/src/BlockFlowing.java.patch @@ -0,0 +1,458 @@ +--- net/minecraft/src/BlockFlowing.java ++++ net/minecraft/src/BlockFlowing.java +@@ -3,173 +3,210 @@ + import java.util.Random; + + public class BlockFlowing extends BlockFluid { ++ ++ /** ++ * Number of horizontally adjacent liquid source blocks. Diagonal doesn't count. Only source blocks of the same liquid ++ * as the block using the field are counted. ++ */ + int numAdjacentSources; ++ ++ /** ++ * Indicates whether the flow direction is optimal. Each array index corresponds to one of the four cardinal ++ * directions. ++ */ + boolean[] isOptimalFlowDirection = new boolean[4]; ++ ++ /** ++ * The estimated cost to flow in a given direction from the current point. Each array index corresponds to one of the ++ * four cardinal directions. ++ */ + int[] flowCost = new int[4]; + +- protected BlockFlowing(int var1, Material var2) { +- super(var1, var2); +- } +- +- private void updateFlow(World var1, int var2, int var3, int var4) { +- int var5 = var1.getBlockMetadata(var2, var3, var4); +- var1.setBlock(var2, var3, var4, this.blockID + 1, var5, 2); +- } +- +- public boolean getBlocksMovement(IBlockAccess var1, int var2, int var3, int var4) { ++ protected BlockFlowing(int par1, Material par2Material) { ++ super(par1, par2Material); ++ } ++ ++ /** ++ * Updates the flow for the BlockFlowing object. ++ */ ++ private void updateFlow(World par1World, int par2, int par3, int par4) { ++ int var5 = par1World.getBlockMetadata(par2, par3, par4); ++ par1World.setBlock(par2, par3, par4, this.blockID + 1, var5, 2); ++ } ++ ++ public boolean getBlocksMovement(IBlockAccess par1IBlockAccess, int par2, int par3, int par4) { + return this.blockMaterial != Material.lava; + } + +- public void updateTick(World var1, int var2, int var3, int var4, Random var5) { +- int var6 = this.getFlowDecay(var1, var2, var3, var4); ++ /** ++ * Ticks the block if it's been scheduled ++ */ ++ public void updateTick(World par1World, int par2, int par3, int par4, Random par5Random) { ++ int var6 = this.getFlowDecay(par1World, par2, par3, par4); + byte var7 = 1; +- if(this.blockMaterial == Material.lava && !var1.provider.isHellWorld) { ++ ++ if (this.blockMaterial == Material.lava && !par1World.provider.isHellWorld) { + var7 = 2; + } + + boolean var8 = true; +- int var9 = this.tickRate(var1); ++ int var9 = this.tickRate(par1World); + int var11; +- if(var6 > 0) { ++ ++ if (var6 > 0) { + byte var10 = -100; + this.numAdjacentSources = 0; +- int var13 = this.getSmallestFlowDecay(var1, var2 - 1, var3, var4, var10); +- var13 = this.getSmallestFlowDecay(var1, var2 + 1, var3, var4, var13); +- var13 = this.getSmallestFlowDecay(var1, var2, var3, var4 - 1, var13); +- var13 = this.getSmallestFlowDecay(var1, var2, var3, var4 + 1, var13); ++ int var13 = this.getSmallestFlowDecay(par1World, par2 - 1, par3, par4, var10); ++ var13 = this.getSmallestFlowDecay(par1World, par2 + 1, par3, par4, var13); ++ var13 = this.getSmallestFlowDecay(par1World, par2, par3, par4 - 1, var13); ++ var13 = this.getSmallestFlowDecay(par1World, par2, par3, par4 + 1, var13); + var11 = var13 + var7; +- if(var11 >= 8 || var13 < 0) { ++ ++ if (var11 >= 8 || var13 < 0) { + var11 = -1; + } + +- if(this.getFlowDecay(var1, var2, var3 + 1, var4) >= 0) { +- int var12 = this.getFlowDecay(var1, var2, var3 + 1, var4); +- if(var12 >= 8) { ++ if (this.getFlowDecay(par1World, par2, par3 + 1, par4) >= 0) { ++ int var12 = this.getFlowDecay(par1World, par2, par3 + 1, par4); ++ ++ if (var12 >= 8) { + var11 = var12; + } else { + var11 = var12 + 8; + } + } + +- if(this.numAdjacentSources >= 2 && this.blockMaterial == Material.water) { +- if(var1.getBlockMaterial(var2, var3 - 1, var4).isSolid()) { ++ if (this.numAdjacentSources >= 2 && this.blockMaterial == Material.water) { ++ if (par1World.getBlockMaterial(par2, par3 - 1, par4).isSolid()) { + var11 = 0; +- } else if(var1.getBlockMaterial(var2, var3 - 1, var4) == this.blockMaterial && var1.getBlockMetadata(var2, var3 - 1, var4) == 0) { ++ } else if (par1World.getBlockMaterial(par2, par3 - 1, par4) == this.blockMaterial && par1World.getBlockMetadata(par2, par3 - 1, par4) == 0) { + var11 = 0; + } + } + +- if(this.blockMaterial == Material.lava && var6 < 8 && var11 < 8 && var11 > var6 && var5.nextInt(4) != 0) { ++ if (this.blockMaterial == Material.lava && var6 < 8 && var11 < 8 && var11 > var6 && par5Random.nextInt(4) != 0) { + var9 *= 4; + } + +- if(var11 == var6) { +- if(var8) { +- this.updateFlow(var1, var2, var3, var4); ++ if (var11 == var6) { ++ if (var8) { ++ this.updateFlow(par1World, par2, par3, par4); + } + } else { + var6 = var11; +- if(var11 < 0) { +- var1.setBlockToAir(var2, var3, var4); ++ ++ if (var11 < 0) { ++ par1World.setBlockToAir(par2, par3, par4); + } else { +- var1.setBlockMetadata(var2, var3, var4, var11, 2); +- var1.scheduleBlockUpdate(var2, var3, var4, this.blockID, var9); +- var1.notifyBlocksOfNeighborChange(var2, var3, var4, this.blockID); ++ par1World.setBlockMetadataWithNotify(par2, par3, par4, var11, 2); ++ par1World.scheduleBlockUpdate(par2, par3, par4, this.blockID, var9); ++ par1World.notifyBlocksOfNeighborChange(par2, par3, par4, this.blockID); + } + } + } else { +- this.updateFlow(var1, var2, var3, var4); ++ this.updateFlow(par1World, par2, par3, par4); + } + +- if(this.liquidCanDisplaceBlock(var1, var2, var3 - 1, var4)) { +- if(this.blockMaterial == Material.lava && var1.getBlockMaterial(var2, var3 - 1, var4) == Material.water) { +- var1.setBlock(var2, var3 - 1, var4, Block.stone.blockID); +- this.triggerLavaMixEffects(var1, var2, var3 - 1, var4); ++ if (this.liquidCanDisplaceBlock(par1World, par2, par3 - 1, par4)) { ++ if (this.blockMaterial == Material.lava && par1World.getBlockMaterial(par2, par3 - 1, par4) == Material.water) { ++ par1World.setBlock(par2, par3 - 1, par4, Block.stone.blockID); ++ this.triggerLavaMixEffects(par1World, par2, par3 - 1, par4); + return; + } + +- if(var6 >= 8) { +- this.flowIntoBlock(var1, var2, var3 - 1, var4, var6); ++ if (var6 >= 8) { ++ this.flowIntoBlock(par1World, par2, par3 - 1, par4, var6); + } else { +- this.flowIntoBlock(var1, var2, var3 - 1, var4, var6 + 8); ++ this.flowIntoBlock(par1World, par2, par3 - 1, par4, var6 + 8); + } +- } else if(var6 >= 0 && (var6 == 0 || this.blockBlocksFlow(var1, var2, var3 - 1, var4))) { +- boolean[] var14 = this.getOptimalFlowDirections(var1, var2, var3, var4); ++ } else if (var6 >= 0 && (var6 == 0 || this.blockBlocksFlow(par1World, par2, par3 - 1, par4))) { ++ boolean[] var14 = this.getOptimalFlowDirections(par1World, par2, par3, par4); + var11 = var6 + var7; +- if(var6 >= 8) { ++ ++ if (var6 >= 8) { + var11 = 1; + } + +- if(var11 >= 8) { ++ if (var11 >= 8) { + return; + } + +- if(var14[0]) { +- this.flowIntoBlock(var1, var2 - 1, var3, var4, var11); +- } +- +- if(var14[1]) { +- this.flowIntoBlock(var1, var2 + 1, var3, var4, var11); +- } +- +- if(var14[2]) { +- this.flowIntoBlock(var1, var2, var3, var4 - 1, var11); +- } +- +- if(var14[3]) { +- this.flowIntoBlock(var1, var2, var3, var4 + 1, var11); ++ if (var14[0]) { ++ this.flowIntoBlock(par1World, par2 - 1, par3, par4, var11); ++ } ++ ++ if (var14[1]) { ++ this.flowIntoBlock(par1World, par2 + 1, par3, par4, var11); ++ } ++ ++ if (var14[2]) { ++ this.flowIntoBlock(par1World, par2, par3, par4 - 1, var11); ++ } ++ ++ if (var14[3]) { ++ this.flowIntoBlock(par1World, par2, par3, par4 + 1, var11); + } + } +- + } + +- private void flowIntoBlock(World var1, int var2, int var3, int var4, int var5) { +- if(this.liquidCanDisplaceBlock(var1, var2, var3, var4)) { +- int var6 = var1.getBlockId(var2, var3, var4); +- if(var6 > 0) { +- if(this.blockMaterial == Material.lava) { +- this.triggerLavaMixEffects(var1, var2, var3, var4); ++ /** ++ * flowIntoBlock(World world, int x, int y, int z, int newFlowDecay) - Flows into the block at the coordinates and ++ * changes the block type to the liquid. ++ */ ++ private void flowIntoBlock(World par1World, int par2, int par3, int par4, int par5) { ++ if (this.liquidCanDisplaceBlock(par1World, par2, par3, par4)) { ++ int var6 = par1World.getBlockId(par2, par3, par4); ++ ++ if (var6 > 0) { ++ if (this.blockMaterial == Material.lava) { ++ this.triggerLavaMixEffects(par1World, par2, par3, par4); + } else { +- Block.blocksList[var6].dropBlockAsItem(var1, var2, var3, var4, var1.getBlockMetadata(var2, var3, var4), 0); ++ Block.blocksList[var6].dropBlockAsItem(par1World, par2, par3, par4, par1World.getBlockMetadata(par2, par3, par4), 0); + } + } + +- var1.setBlock(var2, var3, var4, this.blockID, var5, 3); ++ par1World.setBlock(par2, par3, par4, this.blockID, par5, 3); + } +- + } + +- private int calculateFlowCost(World var1, int var2, int var3, int var4, int var5, int var6) { ++ /** ++ * calculateFlowCost(World world, int x, int y, int z, int accumulatedCost, int previousDirectionOfFlow) - Used to ++ * determine the path of least resistance, this method returns the lowest possible flow cost for the direction of flow ++ * indicated. Each necessary horizontal flow adds to the flow cost. ++ */ ++ private int calculateFlowCost(World par1World, int par2, int par3, int par4, int par5, int par6) { + int var7 = 1000; + +- for(int var8 = 0; var8 < 4; ++var8) { +- if((var8 != 0 || var6 != 1) && (var8 != 1 || var6 != 0) && (var8 != 2 || var6 != 3) && (var8 != 3 || var6 != 2)) { +- int var9 = var2; +- int var11 = var4; +- if(var8 == 0) { +- var9 = var2 - 1; ++ for (int var8 = 0; var8 < 4; ++var8) { ++ if ((var8 != 0 || par6 != 1) && (var8 != 1 || par6 != 0) && (var8 != 2 || par6 != 3) && (var8 != 3 || par6 != 2)) { ++ int var9 = par2; ++ int var11 = par4; ++ ++ if (var8 == 0) { ++ var9 = par2 - 1; + } + +- if(var8 == 1) { ++ if (var8 == 1) { + ++var9; + } + +- if(var8 == 2) { +- var11 = var4 - 1; ++ if (var8 == 2) { ++ var11 = par4 - 1; + } + +- if(var8 == 3) { ++ if (var8 == 3) { + ++var11; + } + +- if(!this.blockBlocksFlow(var1, var9, var3, var11) && (var1.getBlockMaterial(var9, var3, var11) != this.blockMaterial || var1.getBlockMetadata(var9, var3, var11) != 0)) { +- if(!this.blockBlocksFlow(var1, var9, var3 - 1, var11)) { +- return var5; ++ if (!this.blockBlocksFlow(par1World, var9, par3, var11) && (par1World.getBlockMaterial(var9, par3, var11) != this.blockMaterial || par1World.getBlockMetadata(var9, par3, var11) != 0)) { ++ if (!this.blockBlocksFlow(par1World, var9, par3 - 1, var11)) { ++ return par5; + } + +- if(var5 < 4) { +- int var12 = this.calculateFlowCost(var1, var9, var3, var11, var5 + 1, var8); +- if(var12 < var7) { ++ if (par5 < 4) { ++ int var12 = this.calculateFlowCost(par1World, var9, par3, var11, par5 + 1, var8); ++ ++ if (var12 < var7) { + var7 = var12; + } + } +@@ -180,32 +217,39 @@ + return var7; + } + +- private boolean[] getOptimalFlowDirections(World var1, int var2, int var3, int var4) { ++ /** ++ * Returns a boolean array indicating which flow directions are optimal based on each direction's calculated flow cost. ++ * Each array index corresponds to one of the four cardinal directions. A value of true indicates the direction is ++ * optimal. ++ */ ++ private boolean[] getOptimalFlowDirections(World par1World, int par2, int par3, int par4) { + int var5; + int var6; +- for(var5 = 0; var5 < 4; ++var5) { ++ ++ for (var5 = 0; var5 < 4; ++var5) { + this.flowCost[var5] = 1000; +- var6 = var2; +- int var8 = var4; +- if(var5 == 0) { +- var6 = var2 - 1; ++ var6 = par2; ++ int var8 = par4; ++ ++ if (var5 == 0) { ++ var6 = par2 - 1; + } + +- if(var5 == 1) { ++ if (var5 == 1) { + ++var6; + } + +- if(var5 == 2) { +- var8 = var4 - 1; ++ if (var5 == 2) { ++ var8 = par4 - 1; + } + +- if(var5 == 3) { ++ if (var5 == 3) { + ++var8; + } + +- if(!this.blockBlocksFlow(var1, var6, var3, var8) && (var1.getBlockMaterial(var6, var3, var8) != this.blockMaterial || var1.getBlockMetadata(var6, var3, var8) != 0)) { +- if(this.blockBlocksFlow(var1, var6, var3 - 1, var8)) { +- this.flowCost[var5] = this.calculateFlowCost(var1, var6, var3, var8, 1, var5); ++ if (!this.blockBlocksFlow(par1World, var6, par3, var8) && (par1World.getBlockMaterial(var6, par3, var8) != this.blockMaterial || par1World.getBlockMetadata(var6, par3, var8) != 0)) { ++ if (this.blockBlocksFlow(par1World, var6, par3 - 1, var8)) { ++ this.flowCost[var5] = this.calculateFlowCost(par1World, var6, par3, var8, 1, var5); + } else { + this.flowCost[var5] = 0; + } +@@ -214,23 +258,27 @@ + + var5 = this.flowCost[0]; + +- for(var6 = 1; var6 < 4; ++var6) { +- if(this.flowCost[var6] < var5) { ++ for (var6 = 1; var6 < 4; ++var6) { ++ if (this.flowCost[var6] < var5) { + var5 = this.flowCost[var6]; + } + } + +- for(var6 = 0; var6 < 4; ++var6) { ++ for (var6 = 0; var6 < 4; ++var6) { + this.isOptimalFlowDirection[var6] = this.flowCost[var6] == var5; + } + + return this.isOptimalFlowDirection; + } + +- private boolean blockBlocksFlow(World var1, int var2, int var3, int var4) { +- int var5 = var1.getBlockId(var2, var3, var4); +- if(var5 != Block.doorWood.blockID && var5 != Block.doorIron.blockID && var5 != Block.signPost.blockID && var5 != Block.ladder.blockID && var5 != Block.reed.blockID) { +- if(var5 == 0) { ++ /** ++ * Returns true if block at coords blocks fluids ++ */ ++ private boolean blockBlocksFlow(World par1World, int par2, int par3, int par4) { ++ int var5 = par1World.getBlockId(par2, par3, par4); ++ ++ if (var5 != Block.doorWood.blockID && var5 != Block.doorIron.blockID && var5 != Block.signPost.blockID && var5 != Block.ladder.blockID && var5 != Block.reed.blockID) { ++ if (var5 == 0) { + return false; + } else { + Material var6 = Block.blocksList[var5].blockMaterial; +@@ -241,34 +289,47 @@ + } + } + +- protected int getSmallestFlowDecay(World var1, int var2, int var3, int var4, int var5) { +- int var6 = this.getFlowDecay(var1, var2, var3, var4); +- if(var6 < 0) { +- return var5; ++ /** ++ * getSmallestFlowDecay(World world, intx, int y, int z, int currentSmallestFlowDecay) - Looks up the flow decay at the ++ * coordinates given and returns the smaller of this value or the provided currentSmallestFlowDecay. If one value is ++ * valid and the other isn't, the valid value will be returned. Valid values are >= 0. Flow decay is the amount that a ++ * liquid has dissipated. 0 indicates a source block. ++ */ ++ protected int getSmallestFlowDecay(World par1World, int par2, int par3, int par4, int par5) { ++ int var6 = this.getFlowDecay(par1World, par2, par3, par4); ++ ++ if (var6 < 0) { ++ return par5; + } else { +- if(var6 == 0) { ++ if (var6 == 0) { + ++this.numAdjacentSources; + } + +- if(var6 >= 8) { ++ if (var6 >= 8) { + var6 = 0; + } + +- return var5 >= 0 && var6 >= var5 ? var5 : var6; +- } +- } +- +- private boolean liquidCanDisplaceBlock(World var1, int var2, int var3, int var4) { +- Material var5 = var1.getBlockMaterial(var2, var3, var4); +- return var5 == this.blockMaterial ? false : (var5 == Material.lava ? false : !this.blockBlocksFlow(var1, var2, var3, var4)); +- } +- +- public void onBlockAdded(World var1, int var2, int var3, int var4) { +- super.onBlockAdded(var1, var2, var3, var4); +- if(var1.getBlockId(var2, var3, var4) == this.blockID) { +- var1.scheduleBlockUpdate(var2, var3, var4, this.blockID, this.tickRate(var1)); +- } +- ++ return par5 >= 0 && var6 >= par5 ? par5 : var6; ++ } ++ } ++ ++ /** ++ * Returns true if the block at the coordinates can be displaced by the liquid. ++ */ ++ private boolean liquidCanDisplaceBlock(World par1World, int par2, int par3, int par4) { ++ Material var5 = par1World.getBlockMaterial(par2, par3, par4); ++ return var5 == this.blockMaterial ? false : (var5 == Material.lava ? false : !this.blockBlocksFlow(par1World, par2, par3, par4)); ++ } ++ ++ /** ++ * Called whenever the block is added into the world. Args: world, x, y, z ++ */ ++ public void onBlockAdded(World par1World, int par2, int par3, int par4) { ++ super.onBlockAdded(par1World, par2, par3, par4); ++ ++ if (par1World.getBlockId(par2, par3, par4) == this.blockID) { ++ par1World.scheduleBlockUpdate(par2, par3, par4, this.blockID, this.tickRate(par1World)); ++ } + } + + public boolean func_82506_l() { diff --git a/patches/net/minecraft/src/BlockFluid.java.patch b/patches/net/minecraft/src/BlockFluid.java.patch new file mode 100644 index 0000000..e0bb9e3 --- /dev/null +++ b/patches/net/minecraft/src/BlockFluid.java.patch @@ -0,0 +1,782 @@ +--- net/minecraft/src/BlockFluid.java ++++ net/minecraft/src/BlockFluid.java +@@ -2,18 +2,20 @@ + + import java.util.Random; + ++import com.prupe.mcpatcher.cc.ColorizeBlock; ++ + public abstract class BlockFluid extends Block { + private Icon[] theIcon; + +- protected BlockFluid(int var1, Material var2) { +- super(var1, var2); ++ protected BlockFluid(int par1, Material par2Material) { ++ super(par1, par2Material); + float var3 = 0.0F; + float var4 = 0.0F; + this.setBlockBounds(0.0F + var4, 0.0F + var3, 0.0F + var4, 1.0F + var4, 1.0F + var3, 1.0F + var4); + this.setTickRandomly(true); + } + +- public boolean getBlocksMovement(IBlockAccess var1, int var2, int var3, int var4) { ++ public boolean getBlocksMovement(IBlockAccess par1IBlockAccess, int par2, int par3, int par4) { + return this.blockMaterial != Material.lava; + } + +@@ -21,19 +23,25 @@ + return 16777215; + } + +- public int colorMultiplier(IBlockAccess var1, int var2, int var3, int var4) { +- if(this.blockMaterial != Material.water) { ++ /** ++ * Returns a integer with hex for 0xrrggbb with this color multiplied against the blocks color. Note only called when ++ * first determining what to render. ++ */ ++ public int colorMultiplier(IBlockAccess par1IBlockAccess, int par2, int par3, int par4) { ++ if (this.blockMaterial != Material.water) { + return 16777215; + } else { + int var5 = 0; + int var6 = 0; + int var7 = 0; + +- for(int var8 = -1; var8 <= 1; ++var8) { +- for(int var9 = -1; var9 <= 1; ++var9) { +- int var10 = var1.getBiomeGenForCoords(var2 + var9, var4 + var8).waterColorMultiplier; ++ for (int var8 = -1; var8 <= 1; ++var8) { ++ for (int var9 = -1; var9 <= 1; ++var9) { ++ // MCPatcher Start ++ int var10 = ColorizeBlock.colorizeWater(par1IBlockAccess, par2 + var9, par4 + var8); ++ // MCPatcher End + var5 += (var10 & 16711680) >> 16; +- var6 += (var10 & '\uff00') >> 8; ++ var6 += (var10 & 65280) >> 8; + var7 += var10 & 255; + } + } +@@ -42,28 +50,43 @@ + } + } + +- public static float getFluidHeightPercent(int var0) { +- if(var0 >= 8) { +- var0 = 0; ++ /** ++ * Returns the percentage of the fluid block that is air, based on the given flow decay of the fluid. ++ */ ++ public static float getFluidHeightPercent(int par0) { ++ if (par0 >= 8) { ++ par0 = 0; + } + +- return (float)(var0 + 1) / 9.0F; +- } +- +- public Icon getIcon(int var1, int var2) { +- return var1 != 0 && var1 != 1 ? this.theIcon[1] : this.theIcon[0]; +- } +- +- protected int getFlowDecay(World var1, int var2, int var3, int var4) { +- return var1.getBlockMaterial(var2, var3, var4) == this.blockMaterial ? var1.getBlockMetadata(var2, var3, var4) : -1; +- } +- +- protected int getEffectiveFlowDecay(IBlockAccess var1, int var2, int var3, int var4) { +- if(var1.getBlockMaterial(var2, var3, var4) != this.blockMaterial) { ++ return (float)(par0 + 1) / 9.0F; ++ } ++ ++ /** ++ * From the specified side and block metadata retrieves the blocks texture. Args: side, metadata ++ */ ++ public Icon getIcon(int par1, int par2) { ++ return par1 != 0 && par1 != 1 ? this.theIcon[1] : this.theIcon[0]; ++ } ++ ++ /** ++ * Returns the amount of fluid decay at the coordinates, or -1 if the block at the coordinates is not the same material ++ * as the fluid. ++ */ ++ protected int getFlowDecay(World par1World, int par2, int par3, int par4) { ++ return par1World.getBlockMaterial(par2, par3, par4) == this.blockMaterial ? par1World.getBlockMetadata(par2, par3, par4) : -1; ++ } ++ ++ /** ++ * Returns the flow decay but converts values indicating falling liquid (values >=8) to their effective source block ++ * value of zero. ++ */ ++ protected int getEffectiveFlowDecay(IBlockAccess par1IBlockAccess, int par2, int par3, int par4) { ++ if (par1IBlockAccess.getBlockMaterial(par2, par3, par4) != this.blockMaterial) { + return -1; + } else { +- int var5 = var1.getBlockMetadata(var2, var3, var4); +- if(var5 >= 8) { ++ int var5 = par1IBlockAccess.getBlockMetadata(par2, par3, par4); ++ ++ if (var5 >= 8) { + var5 = 0; + } + +@@ -71,118 +94,157 @@ + } + } + ++ /** ++ * If this block doesn't render as an ordinary block it will return False (examples: signs, buttons, stairs, etc) ++ */ + public boolean renderAsNormalBlock() { + return false; + } + ++ /** ++ * Is this block (a) opaque and (b) a full 1m cube? This determines whether or not to render the shared face of two ++ * adjacent blocks and also whether the player can attach torches, redstone wire, etc to this block. ++ */ + public boolean isOpaqueCube() { + return false; + } + +- public boolean canCollideCheck(int var1, boolean var2) { +- return var2 && var1 == 0; +- } +- +- public boolean isBlockSolid(IBlockAccess var1, int var2, int var3, int var4, int var5) { +- Material var6 = var1.getBlockMaterial(var2, var3, var4); +- return var6 == this.blockMaterial ? false : (var5 == 1 ? true : (var6 == Material.ice ? false : super.isBlockSolid(var1, var2, var3, var4, var5))); +- } +- +- public boolean shouldSideBeRendered(IBlockAccess var1, int var2, int var3, int var4, int var5) { +- Material var6 = var1.getBlockMaterial(var2, var3, var4); +- return var6 == this.blockMaterial ? false : (var5 == 1 ? true : (var6 == Material.ice ? false : super.shouldSideBeRendered(var1, var2, var3, var4, var5))); +- } +- +- public AxisAlignedBB getCollisionBoundingBoxFromPool(World var1, int var2, int var3, int var4) { ++ /** ++ * Returns whether this block is collideable based on the arguments passed in \n@param par1 block metaData \n@param ++ * par2 whether the player right-clicked while holding a boat ++ */ ++ public boolean canCollideCheck(int par1, boolean par2) { ++ return par2 && par1 == 0; ++ } ++ ++ /** ++ * Returns Returns true if the given side of this block type should be rendered (if it's solid or not), if the adjacent ++ * block is at the given coordinates. Args: blockAccess, x, y, z, side ++ */ ++ public boolean isBlockSolid(IBlockAccess par1IBlockAccess, int par2, int par3, int par4, int par5) { ++ Material var6 = par1IBlockAccess.getBlockMaterial(par2, par3, par4); ++ return var6 == this.blockMaterial ? false : (par5 == 1 ? true : (var6 == Material.ice ? false : super.isBlockSolid(par1IBlockAccess, par2, par3, par4, par5))); ++ } ++ ++ /** ++ * Returns true if the given side of this block type should be rendered, if the adjacent block is at the given ++ * coordinates. Args: blockAccess, x, y, z, side ++ */ ++ public boolean shouldSideBeRendered(IBlockAccess par1IBlockAccess, int par2, int par3, int par4, int par5) { ++ Material var6 = par1IBlockAccess.getBlockMaterial(par2, par3, par4); ++ return var6 == this.blockMaterial ? false : (par5 == 1 ? true : (var6 == Material.ice ? false : super.shouldSideBeRendered(par1IBlockAccess, par2, par3, par4, par5))); ++ } ++ ++ /** ++ * Returns a bounding box from the pool of bounding boxes (this means this box can change after the pool has been ++ * cleared to be reused) ++ */ ++ public AxisAlignedBB getCollisionBoundingBoxFromPool(World par1World, int par2, int par3, int par4) { + return null; + } + ++ /** ++ * The type of render function that is called for this block ++ */ + public int getRenderType() { + return 4; + } + +- public int idDropped(int var1, Random var2, int var3) { +- return 0; +- } +- +- public int quantityDropped(Random var1) { +- return 0; +- } +- +- private Vec3 getFlowVector(IBlockAccess var1, int var2, int var3, int var4) { +- Vec3 var5 = var1.getWorldVec3Pool().getVecFromPool(0.0D, 0.0D, 0.0D); +- int var6 = this.getEffectiveFlowDecay(var1, var2, var3, var4); +- +- for(int var7 = 0; var7 < 4; ++var7) { +- int var8 = var2; +- int var10 = var4; +- if(var7 == 0) { +- var8 = var2 - 1; +- } +- +- if(var7 == 1) { +- var10 = var4 - 1; +- } +- +- if(var7 == 2) { ++ /** ++ * Returns the ID of the items to drop on destruction. ++ */ ++ public int idDropped(int par1, Random par2Random, int par3) { ++ return 0; ++ } ++ ++ /** ++ * Returns the quantity of items to drop on block destruction. ++ */ ++ public int quantityDropped(Random par1Random) { ++ return 0; ++ } ++ ++ /** ++ * Returns a vector indicating the direction and intensity of fluid flow. ++ */ ++ private Vec3 getFlowVector(IBlockAccess par1IBlockAccess, int par2, int par3, int par4) { ++ Vec3 var5 = par1IBlockAccess.getWorldVec3Pool().getVecFromPool(0.0D, 0.0D, 0.0D); ++ int var6 = this.getEffectiveFlowDecay(par1IBlockAccess, par2, par3, par4); ++ ++ for (int var7 = 0; var7 < 4; ++var7) { ++ int var8 = par2; ++ int var10 = par4; ++ ++ if (var7 == 0) { ++ var8 = par2 - 1; ++ } ++ ++ if (var7 == 1) { ++ var10 = par4 - 1; ++ } ++ ++ if (var7 == 2) { + ++var8; + } + +- if(var7 == 3) { ++ if (var7 == 3) { + ++var10; + } + +- int var11 = this.getEffectiveFlowDecay(var1, var8, var3, var10); ++ int var11 = this.getEffectiveFlowDecay(par1IBlockAccess, var8, par3, var10); + int var12; +- if(var11 < 0) { +- if(!var1.getBlockMaterial(var8, var3, var10).blocksMovement()) { +- var11 = this.getEffectiveFlowDecay(var1, var8, var3 - 1, var10); +- if(var11 >= 0) { ++ ++ if (var11 < 0) { ++ if (!par1IBlockAccess.getBlockMaterial(var8, par3, var10).blocksMovement()) { ++ var11 = this.getEffectiveFlowDecay(par1IBlockAccess, var8, par3 - 1, var10); ++ ++ if (var11 >= 0) { + var12 = var11 - (var6 - 8); +- var5 = var5.addVector((double)((var8 - var2) * var12), (double)((var3 - var3) * var12), (double)((var10 - var4) * var12)); ++ var5 = var5.addVector((double)((var8 - par2) * var12), (double)((par3 - par3) * var12), (double)((var10 - par4) * var12)); + } + } +- } else if(var11 >= 0) { ++ } else if (var11 >= 0) { + var12 = var11 - var6; +- var5 = var5.addVector((double)((var8 - var2) * var12), (double)((var3 - var3) * var12), (double)((var10 - var4) * var12)); ++ var5 = var5.addVector((double)((var8 - par2) * var12), (double)((par3 - par3) * var12), (double)((var10 - par4) * var12)); + } + } + +- if(var1.getBlockMetadata(var2, var3, var4) >= 8) { ++ if (par1IBlockAccess.getBlockMetadata(par2, par3, par4) >= 8) { + boolean var13 = false; +- if(var13 || this.isBlockSolid(var1, var2, var3, var4 - 1, 2)) { +- var13 = true; +- } +- +- if(var13 || this.isBlockSolid(var1, var2, var3, var4 + 1, 3)) { +- var13 = true; +- } +- +- if(var13 || this.isBlockSolid(var1, var2 - 1, var3, var4, 4)) { +- var13 = true; +- } +- +- if(var13 || this.isBlockSolid(var1, var2 + 1, var3, var4, 5)) { +- var13 = true; +- } +- +- if(var13 || this.isBlockSolid(var1, var2, var3 + 1, var4 - 1, 2)) { +- var13 = true; +- } +- +- if(var13 || this.isBlockSolid(var1, var2, var3 + 1, var4 + 1, 3)) { +- var13 = true; +- } +- +- if(var13 || this.isBlockSolid(var1, var2 - 1, var3 + 1, var4, 4)) { +- var13 = true; +- } +- +- if(var13 || this.isBlockSolid(var1, var2 + 1, var3 + 1, var4, 5)) { +- var13 = true; +- } +- +- if(var13) { ++ ++ if (var13 || this.isBlockSolid(par1IBlockAccess, par2, par3, par4 - 1, 2)) { ++ var13 = true; ++ } ++ ++ if (var13 || this.isBlockSolid(par1IBlockAccess, par2, par3, par4 + 1, 3)) { ++ var13 = true; ++ } ++ ++ if (var13 || this.isBlockSolid(par1IBlockAccess, par2 - 1, par3, par4, 4)) { ++ var13 = true; ++ } ++ ++ if (var13 || this.isBlockSolid(par1IBlockAccess, par2 + 1, par3, par4, 5)) { ++ var13 = true; ++ } ++ ++ if (var13 || this.isBlockSolid(par1IBlockAccess, par2, par3 + 1, par4 - 1, 2)) { ++ var13 = true; ++ } ++ ++ if (var13 || this.isBlockSolid(par1IBlockAccess, par2, par3 + 1, par4 + 1, 3)) { ++ var13 = true; ++ } ++ ++ if (var13 || this.isBlockSolid(par1IBlockAccess, par2 - 1, par3 + 1, par4, 4)) { ++ var13 = true; ++ } ++ ++ if (var13 || this.isBlockSolid(par1IBlockAccess, par2 + 1, par3 + 1, par4, 5)) { ++ var13 = true; ++ } ++ ++ if (var13) { + var5 = var5.normalize().addVector(0.0D, -6.0D, 0.0D); + } + } +@@ -191,20 +253,29 @@ + return var5; + } + +- public void velocityToAddToEntity(World var1, int var2, int var3, int var4, Entity var5, Vec3 var6) { +- Vec3 var7 = this.getFlowVector(var1, var2, var3, var4); +- var6.xCoord += var7.xCoord; +- var6.yCoord += var7.yCoord; +- var6.zCoord += var7.zCoord; +- } +- +- public int tickRate(World var1) { +- return this.blockMaterial == Material.water ? 5 : (this.blockMaterial == Material.lava ? (var1.provider.hasNoSky ? 10 : 30) : 0); +- } +- +- public int getMixedBrightnessForBlock(IBlockAccess var1, int var2, int var3, int var4) { +- int var5 = var1.getLightBrightnessForSkyBlocks(var2, var3, var4, 0); +- int var6 = var1.getLightBrightnessForSkyBlocks(var2, var3 + 1, var4, 0); ++ /** ++ * Can add to the passed in vector for a movement vector to be applied to the entity. Args: x, y, z, entity, vec3d ++ */ ++ public void velocityToAddToEntity(World par1World, int par2, int par3, int par4, Entity par5Entity, Vec3 par6Vec3) { ++ Vec3 var7 = this.getFlowVector(par1World, par2, par3, par4); ++ par6Vec3.xCoord += var7.xCoord; ++ par6Vec3.yCoord += var7.yCoord; ++ par6Vec3.zCoord += var7.zCoord; ++ } ++ ++ /** ++ * How many world ticks before ticking ++ */ ++ public int tickRate(World par1World) { ++ return this.blockMaterial == Material.water ? 5 : (this.blockMaterial == Material.lava ? (par1World.provider.hasNoSky ? 10 : 30) : 0); ++ } ++ ++ /** ++ * Goes straight to getLightBrightnessForSkyBlocks for Blocks, does some fancy computing for Fluids ++ */ ++ public int getMixedBrightnessForBlock(IBlockAccess par1IBlockAccess, int par2, int par3, int par4) { ++ int var5 = par1IBlockAccess.getLightBrightnessForSkyBlocks(par2, par3, par4, 0); ++ int var6 = par1IBlockAccess.getLightBrightnessForSkyBlocks(par2, par3 + 1, par4, 0); + int var7 = var5 & 255; + int var8 = var6 & 255; + int var9 = var5 >> 16 & 255; +@@ -212,206 +283,242 @@ + return (var7 > var8 ? var7 : var8) | (var9 > var10 ? var9 : var10) << 16; + } + +- public float getBlockBrightness(IBlockAccess var1, int var2, int var3, int var4) { +- float var5 = var1.getLightBrightness(var2, var3, var4); +- float var6 = var1.getLightBrightness(var2, var3 + 1, var4); ++ /** ++ * How bright to render this block based on the light its receiving. Args: iBlockAccess, x, y, z ++ */ ++ public float getBlockBrightness(IBlockAccess par1IBlockAccess, int par2, int par3, int par4) { ++ float var5 = par1IBlockAccess.getLightBrightness(par2, par3, par4); ++ float var6 = par1IBlockAccess.getLightBrightness(par2, par3 + 1, par4); + return var5 > var6 ? var5 : var6; + } + ++ /** ++ * Returns which pass should this block be rendered on. 0 for solids and 1 for alpha ++ */ + public int getRenderBlockPass() { + return this.blockMaterial == Material.water ? 1 : 0; + } + +- public void randomDisplayTick(World var1, int var2, int var3, int var4, Random var5) { ++ /** ++ * A randomly called display update to be able to add particles or other items for display ++ */ ++ public void randomDisplayTick(World par1World, int par2, int par3, int par4, Random par5Random) { + int var6; +- if(this.blockMaterial == Material.water) { +- if(var5.nextInt(10) == 0) { +- var6 = var1.getBlockMetadata(var2, var3, var4); +- if(var6 <= 0 || var6 >= 8) { +- var1.spawnParticle("suspended", (double)((float)var2 + var5.nextFloat()), (double)((float)var3 + var5.nextFloat()), (double)((float)var4 + var5.nextFloat()), 0.0D, 0.0D, 0.0D); ++ ++ if (this.blockMaterial == Material.water) { ++ if (par5Random.nextInt(10) == 0) { ++ var6 = par1World.getBlockMetadata(par2, par3, par4); ++ ++ if (var6 <= 0 || var6 >= 8) { ++ par1World.spawnParticle("suspended", (double)((float)par2 + par5Random.nextFloat()), (double)((float)par3 + par5Random.nextFloat()), (double)((float)par4 + par5Random.nextFloat()), 0.0D, 0.0D, 0.0D); + } + } + +- for(var6 = 0; var6 < 0; ++var6) { +- int var7 = var5.nextInt(4); +- int var8 = var2; +- int var9 = var4; +- if(var7 == 0) { +- var8 = var2 - 1; ++ for (var6 = 0; var6 < 0; ++var6) { ++ int var7 = par5Random.nextInt(4); ++ int var8 = par2; ++ int var9 = par4; ++ ++ if (var7 == 0) { ++ var8 = par2 - 1; + } + +- if(var7 == 1) { ++ if (var7 == 1) { + ++var8; + } + +- if(var7 == 2) { +- var9 = var4 - 1; ++ if (var7 == 2) { ++ var9 = par4 - 1; + } + +- if(var7 == 3) { ++ if (var7 == 3) { + ++var9; + } + +- if(var1.getBlockMaterial(var8, var3, var9) == Material.air && (var1.getBlockMaterial(var8, var3 - 1, var9).blocksMovement() || var1.getBlockMaterial(var8, var3 - 1, var9).isLiquid())) { +- float var10 = 1.0F / 16.0F; +- double var11 = (double)((float)var2 + var5.nextFloat()); +- double var13 = (double)((float)var3 + var5.nextFloat()); +- double var15 = (double)((float)var4 + var5.nextFloat()); +- if(var7 == 0) { +- var11 = (double)((float)var2 - var10); +- } +- +- if(var7 == 1) { +- var11 = (double)((float)(var2 + 1) + var10); +- } +- +- if(var7 == 2) { +- var15 = (double)((float)var4 - var10); +- } +- +- if(var7 == 3) { +- var15 = (double)((float)(var4 + 1) + var10); ++ if (par1World.getBlockMaterial(var8, par3, var9) == Material.air && (par1World.getBlockMaterial(var8, par3 - 1, var9).blocksMovement() || par1World.getBlockMaterial(var8, par3 - 1, var9).isLiquid())) { ++ float var10 = 0.0625F; ++ double var11 = (double)((float)par2 + par5Random.nextFloat()); ++ double var13 = (double)((float)par3 + par5Random.nextFloat()); ++ double var15 = (double)((float)par4 + par5Random.nextFloat()); ++ ++ if (var7 == 0) { ++ var11 = (double)((float)par2 - var10); ++ } ++ ++ if (var7 == 1) { ++ var11 = (double)((float)(par2 + 1) + var10); ++ } ++ ++ if (var7 == 2) { ++ var15 = (double)((float)par4 - var10); ++ } ++ ++ if (var7 == 3) { ++ var15 = (double)((float)(par4 + 1) + var10); + } + + double var17 = 0.0D; + double var19 = 0.0D; +- if(var7 == 0) { ++ ++ if (var7 == 0) { + var17 = (double)(-var10); + } + +- if(var7 == 1) { ++ if (var7 == 1) { + var17 = (double)var10; + } + +- if(var7 == 2) { ++ if (var7 == 2) { + var19 = (double)(-var10); + } + +- if(var7 == 3) { ++ if (var7 == 3) { + var19 = (double)var10; + } + +- var1.spawnParticle("splash", var11, var13, var15, var17, 0.0D, var19); ++ par1World.spawnParticle("splash", var11, var13, var15, var17, 0.0D, var19); + } + } + } + +- if(this.blockMaterial == Material.water && var5.nextInt(64) == 0) { +- var6 = var1.getBlockMetadata(var2, var3, var4); +- if(var6 > 0 && var6 < 8) { +- var1.playSound((double)((float)var2 + 0.5F), (double)((float)var3 + 0.5F), (double)((float)var4 + 0.5F), "liquid.water", var5.nextFloat() * 0.25F + 12.0F / 16.0F, var5.nextFloat() * 1.0F + 0.5F, false); ++ if (this.blockMaterial == Material.water && par5Random.nextInt(64) == 0) { ++ var6 = par1World.getBlockMetadata(par2, par3, par4); ++ ++ if (var6 > 0 && var6 < 8) { ++ par1World.playSound((double)((float)par2 + 0.5F), (double)((float)par3 + 0.5F), (double)((float)par4 + 0.5F), "liquid.water", par5Random.nextFloat() * 0.25F + 0.75F, par5Random.nextFloat() * 1.0F + 0.5F, false); + } + } + +- double var21; + double var22; + double var23; +- if(this.blockMaterial == Material.lava && var1.getBlockMaterial(var2, var3 + 1, var4) == Material.air && !var1.isBlockOpaqueCube(var2, var3 + 1, var4)) { +- if(var5.nextInt(100) == 0) { +- var21 = (double)((float)var2 + var5.nextFloat()); +- var22 = (double)var3 + this.maxY; +- var23 = (double)((float)var4 + var5.nextFloat()); +- var1.spawnParticle("lava", var21, var22, var23, 0.0D, 0.0D, 0.0D); +- var1.playSound(var21, var22, var23, "liquid.lavapop", 0.2F + var5.nextFloat() * 0.2F, 0.9F + var5.nextFloat() * 0.15F, false); ++ double var21; ++ ++ if (this.blockMaterial == Material.lava && par1World.getBlockMaterial(par2, par3 + 1, par4) == Material.air && !par1World.isBlockOpaqueCube(par2, par3 + 1, par4)) { ++ if (par5Random.nextInt(100) == 0) { ++ var21 = (double)((float)par2 + par5Random.nextFloat()); ++ var22 = (double)par3 + this.maxY; ++ var23 = (double)((float)par4 + par5Random.nextFloat()); ++ par1World.spawnParticle("lava", var21, var22, var23, 0.0D, 0.0D, 0.0D); ++ par1World.playSound(var21, var22, var23, "liquid.lavapop", 0.2F + par5Random.nextFloat() * 0.2F, 0.9F + par5Random.nextFloat() * 0.15F, false); + } + +- if(var5.nextInt(200) == 0) { +- var1.playSound((double)var2, (double)var3, (double)var4, "liquid.lava", 0.2F + var5.nextFloat() * 0.2F, 0.9F + var5.nextFloat() * 0.15F, false); ++ if (par5Random.nextInt(200) == 0) { ++ par1World.playSound((double)par2, (double)par3, (double)par4, "liquid.lava", 0.2F + par5Random.nextFloat() * 0.2F, 0.9F + par5Random.nextFloat() * 0.15F, false); + } + } + +- if(var5.nextInt(10) == 0 && var1.doesBlockHaveSolidTopSurface(var2, var3 - 1, var4) && !var1.getBlockMaterial(var2, var3 - 2, var4).blocksMovement()) { +- var21 = (double)((float)var2 + var5.nextFloat()); +- var22 = (double)var3 - 1.05D; +- var23 = (double)((float)var4 + var5.nextFloat()); +- if(this.blockMaterial == Material.water) { +- var1.spawnParticle("dripWater", var21, var22, var23, 0.0D, 0.0D, 0.0D); ++ if (par5Random.nextInt(10) == 0 && par1World.doesBlockHaveSolidTopSurface(par2, par3 - 1, par4) && !par1World.getBlockMaterial(par2, par3 - 2, par4).blocksMovement()) { ++ var21 = (double)((float)par2 + par5Random.nextFloat()); ++ var22 = (double)par3 - 1.05D; ++ var23 = (double)((float)par4 + par5Random.nextFloat()); ++ ++ if (this.blockMaterial == Material.water) { ++ par1World.spawnParticle("dripWater", var21, var22, var23, 0.0D, 0.0D, 0.0D); + } else { +- var1.spawnParticle("dripLava", var21, var22, var23, 0.0D, 0.0D, 0.0D); ++ par1World.spawnParticle("dripLava", var21, var22, var23, 0.0D, 0.0D, 0.0D); + } + } +- + } + +- public static double getFlowDirection(IBlockAccess var0, int var1, int var2, int var3, Material var4) { ++ /** ++ * the sin and cos of this number determine the surface gradient of the flowing block. ++ */ ++ public static double getFlowDirection(IBlockAccess par0IBlockAccess, int par1, int par2, int par3, Material par4Material) { + Vec3 var5 = null; +- if(var4 == Material.water) { +- var5 = Block.waterMoving.getFlowVector(var0, var1, var2, var3); +- } +- +- if(var4 == Material.lava) { +- var5 = Block.lavaMoving.getFlowVector(var0, var1, var2, var3); +- } +- +- return var5.xCoord == 0.0D && var5.zCoord == 0.0D ? -1000.0D : Math.atan2(var5.zCoord, var5.xCoord) - Math.PI * 0.5D; +- } +- +- public void onBlockAdded(World var1, int var2, int var3, int var4) { +- this.checkForHarden(var1, var2, var3, var4); +- } +- +- public void onNeighborBlockChange(World var1, int var2, int var3, int var4, int var5) { +- this.checkForHarden(var1, var2, var3, var4); +- } +- +- private void checkForHarden(World var1, int var2, int var3, int var4) { +- if(var1.getBlockId(var2, var3, var4) == this.blockID) { +- if(this.blockMaterial == Material.lava) { ++ ++ if (par4Material == Material.water) { ++ var5 = Block.waterMoving.getFlowVector(par0IBlockAccess, par1, par2, par3); ++ } ++ ++ if (par4Material == Material.lava) { ++ var5 = Block.lavaMoving.getFlowVector(par0IBlockAccess, par1, par2, par3); ++ } ++ ++ return var5.xCoord == 0.0D && var5.zCoord == 0.0D ? -1000.0D : Math.atan2(var5.zCoord, var5.xCoord) - (Math.PI / 2D); ++ } ++ ++ /** ++ * Called whenever the block is added into the world. Args: world, x, y, z ++ */ ++ public void onBlockAdded(World par1World, int par2, int par3, int par4) { ++ this.checkForHarden(par1World, par2, par3, par4); ++ } ++ ++ /** ++ * Lets the block know when one of its neighbor changes. Doesn't know which neighbor changed (coordinates passed are ++ * their own) Args: x, y, z, neighbor blockID ++ */ ++ public void onNeighborBlockChange(World par1World, int par2, int par3, int par4, int par5) { ++ this.checkForHarden(par1World, par2, par3, par4); ++ } ++ ++ /** ++ * Forces lava to check to see if it is colliding with water, and then decide what it should harden to. ++ */ ++ private void checkForHarden(World par1World, int par2, int par3, int par4) { ++ if (par1World.getBlockId(par2, par3, par4) == this.blockID) { ++ if (this.blockMaterial == Material.lava) { + boolean var5 = false; +- if(var5 || var1.getBlockMaterial(var2, var3, var4 - 1) == Material.water) { +- var5 = true; +- } +- +- if(var5 || var1.getBlockMaterial(var2, var3, var4 + 1) == Material.water) { +- var5 = true; +- } +- +- if(var5 || var1.getBlockMaterial(var2 - 1, var3, var4) == Material.water) { +- var5 = true; +- } +- +- if(var5 || var1.getBlockMaterial(var2 + 1, var3, var4) == Material.water) { +- var5 = true; +- } +- +- if(var5 || var1.getBlockMaterial(var2, var3 + 1, var4) == Material.water) { +- var5 = true; +- } +- +- if(var5) { +- int var6 = var1.getBlockMetadata(var2, var3, var4); +- if(var6 == 0) { +- var1.setBlock(var2, var3, var4, Block.obsidian.blockID); +- } else if(var6 <= 4) { +- var1.setBlock(var2, var3, var4, Block.cobblestone.blockID); ++ ++ if (var5 || par1World.getBlockMaterial(par2, par3, par4 - 1) == Material.water) { ++ var5 = true; ++ } ++ ++ if (var5 || par1World.getBlockMaterial(par2, par3, par4 + 1) == Material.water) { ++ var5 = true; ++ } ++ ++ if (var5 || par1World.getBlockMaterial(par2 - 1, par3, par4) == Material.water) { ++ var5 = true; ++ } ++ ++ if (var5 || par1World.getBlockMaterial(par2 + 1, par3, par4) == Material.water) { ++ var5 = true; ++ } ++ ++ if (var5 || par1World.getBlockMaterial(par2, par3 + 1, par4) == Material.water) { ++ var5 = true; ++ } ++ ++ if (var5) { ++ int var6 = par1World.getBlockMetadata(par2, par3, par4); ++ ++ if (var6 == 0) { ++ par1World.setBlock(par2, par3, par4, Block.obsidian.blockID); ++ } else if (var6 <= 4) { ++ par1World.setBlock(par2, par3, par4, Block.cobblestone.blockID); + } + +- this.triggerLavaMixEffects(var1, var2, var3, var4); ++ this.triggerLavaMixEffects(par1World, par2, par3, par4); + } + } +- +- } +- } +- +- protected void triggerLavaMixEffects(World var1, int var2, int var3, int var4) { +- var1.playSoundEffect((double)((float)var2 + 0.5F), (double)((float)var3 + 0.5F), (double)((float)var4 + 0.5F), "random.fizz", 0.5F, 2.6F + (var1.s.nextFloat() - var1.s.nextFloat()) * 0.8F); +- +- for(int var5 = 0; var5 < 8; ++var5) { +- var1.spawnParticle("largesmoke", (double)var2 + Math.random(), (double)var3 + 1.2D, (double)var4 + Math.random(), 0.0D, 0.0D, 0.0D); +- } +- +- } +- +- public void registerIcons(IconRegister var1) { +- if(this.blockMaterial == Material.lava) { +- this.theIcon = new Icon[]{var1.registerIcon("lava_still"), var1.registerIcon("lava_flow")}; ++ } ++ } ++ ++ /** ++ * Creates fizzing sound and smoke. Used when lava flows over block or mixes with water. ++ */ ++ protected void triggerLavaMixEffects(World par1World, int par2, int par3, int par4) { ++ par1World.playSoundEffect((double)((float)par2 + 0.5F), (double)((float)par3 + 0.5F), (double)((float)par4 + 0.5F), "random.fizz", 0.5F, 2.6F + (par1World.rand.nextFloat() - par1World.rand.nextFloat()) * 0.8F); ++ ++ for (int var5 = 0; var5 < 8; ++var5) { ++ par1World.spawnParticle("largesmoke", (double)par2 + Math.random(), (double)par3 + 1.2D, (double)par4 + Math.random(), 0.0D, 0.0D, 0.0D); ++ } ++ } ++ ++ /** ++ * When this method is called, your block should register all the icons it needs with the given IconRegister. This is ++ * the only chance you get to register icons. ++ */ ++ public void registerIcons(IconRegister par1IconRegister) { ++ if (this.blockMaterial == Material.lava) { ++ this.theIcon = new Icon[] {par1IconRegister.registerIcon("lava_still"), par1IconRegister.registerIcon("lava_flow")}; + } else { +- this.theIcon = new Icon[]{var1.registerIcon("water_still"), var1.registerIcon("water_flow")}; ++ this.theIcon = new Icon[] {par1IconRegister.registerIcon("water_still"), par1IconRegister.registerIcon("water_flow")}; + } +- + } + +- public static Icon getFluidIcon(String var0) { +- return var0 == "water_still" ? Block.waterMoving.theIcon[0] : (var0 == "water_flow" ? Block.waterMoving.theIcon[1] : (var0 == "lava_still" ? Block.lavaMoving.theIcon[0] : (var0 == "lava_flow" ? Block.lavaMoving.theIcon[1] : null))); ++ public static Icon getFluidIcon(String par0Str) { ++ return par0Str == "water_still" ? Block.waterMoving.theIcon[0] : (par0Str == "water_flow" ? Block.waterMoving.theIcon[1] : (par0Str == "lava_still" ? Block.lavaMoving.theIcon[0] : (par0Str == "lava_flow" ? Block.lavaMoving.theIcon[1] : null))); + } + } diff --git a/patches/net/minecraft/src/BlockFurnace.java.patch b/patches/net/minecraft/src/BlockFurnace.java.patch new file mode 100644 index 0000000..1746068 --- /dev/null +++ b/patches/net/minecraft/src/BlockFurnace.java.patch @@ -0,0 +1,374 @@ +--- net/minecraft/src/BlockFurnace.java ++++ net/minecraft/src/BlockFurnace.java +@@ -3,196 +3,260 @@ + import java.util.Random; + + public class BlockFurnace extends BlockContainer { +- private final Random a = new Random(); ++ ++ /** ++ * Is the random generator used by furnace to drop the inventory contents in random directions. ++ */ ++ private final Random furnaceRand = new Random(); ++ ++ /** True if this is an active furnace, false if idle */ + private final boolean isActive; ++ ++ /** ++ * This flag is used to prevent the furnace inventory to be dropped upon block removal, is used internally when the ++ * furnace block changes from idle to active and vice-versa. ++ */ + private static boolean keepFurnaceInventory; + private Icon furnaceIconTop; + private Icon furnaceIconFront; + +- protected BlockFurnace(int var1, boolean var2) { +- super(var1, Material.rock); +- this.isActive = var2; ++ protected BlockFurnace(int par1, boolean par2) { ++ super(par1, Material.rock); ++ this.isActive = par2; + } + +- public int idDropped(int var1, Random var2, int var3) { ++ /** ++ * Returns the ID of the items to drop on destruction. ++ */ ++ public int idDropped(int par1, Random par2Random, int par3) { + return Block.furnaceIdle.blockID; + } + +- public void onBlockAdded(World var1, int var2, int var3, int var4) { +- super.onBlockAdded(var1, var2, var3, var4); +- this.setDefaultDirection(var1, var2, var3, var4); ++ /** ++ * Called whenever the block is added into the world. Args: world, x, y, z ++ */ ++ public void onBlockAdded(World par1World, int par2, int par3, int par4) { ++ super.onBlockAdded(par1World, par2, par3, par4); ++ this.setDefaultDirection(par1World, par2, par3, par4); + } + +- private void setDefaultDirection(World var1, int var2, int var3, int var4) { +- if(!var1.isRemote) { +- int var5 = var1.getBlockId(var2, var3, var4 - 1); +- int var6 = var1.getBlockId(var2, var3, var4 + 1); +- int var7 = var1.getBlockId(var2 - 1, var3, var4); +- int var8 = var1.getBlockId(var2 + 1, var3, var4); ++ /** ++ * set a blocks direction ++ */ ++ private void setDefaultDirection(World par1World, int par2, int par3, int par4) { ++ if (!par1World.isRemote) { ++ int var5 = par1World.getBlockId(par2, par3, par4 - 1); ++ int var6 = par1World.getBlockId(par2, par3, par4 + 1); ++ int var7 = par1World.getBlockId(par2 - 1, par3, par4); ++ int var8 = par1World.getBlockId(par2 + 1, par3, par4); + byte var9 = 3; +- if(Block.opaqueCubeLookup[var5] && !Block.opaqueCubeLookup[var6]) { ++ ++ if (Block.opaqueCubeLookup[var5] && !Block.opaqueCubeLookup[var6]) { + var9 = 3; + } + +- if(Block.opaqueCubeLookup[var6] && !Block.opaqueCubeLookup[var5]) { ++ if (Block.opaqueCubeLookup[var6] && !Block.opaqueCubeLookup[var5]) { + var9 = 2; + } + +- if(Block.opaqueCubeLookup[var7] && !Block.opaqueCubeLookup[var8]) { ++ if (Block.opaqueCubeLookup[var7] && !Block.opaqueCubeLookup[var8]) { + var9 = 5; + } + +- if(Block.opaqueCubeLookup[var8] && !Block.opaqueCubeLookup[var7]) { ++ if (Block.opaqueCubeLookup[var8] && !Block.opaqueCubeLookup[var7]) { + var9 = 4; + } + +- var1.setBlockMetadata(var2, var3, var4, var9, 2); ++ par1World.setBlockMetadataWithNotify(par2, par3, par4, var9, 2); + } + } + +- public Icon getIcon(int var1, int var2) { +- return var1 == 1 ? this.furnaceIconTop : (var1 == 0 ? this.furnaceIconTop : (var1 != var2 ? this.blockIcon : this.furnaceIconFront)); +- } +- +- public void registerIcons(IconRegister var1) { +- this.blockIcon = var1.registerIcon("furnace_side"); +- this.furnaceIconFront = var1.registerIcon(this.isActive ? "furnace_front_on" : "furnace_front_off"); +- this.furnaceIconTop = var1.registerIcon("furnace_top"); +- } +- +- public void randomDisplayTick(World var1, int var2, int var3, int var4, Random var5) { +- if(this.isActive) { +- int var6 = var1.getBlockMetadata(var2, var3, var4); +- float var7 = (float)var2 + 0.5F; +- float var8 = (float)var3 + 0.0F + var5.nextFloat() * 6.0F / 16.0F; +- float var9 = (float)var4 + 0.5F; ++ /** ++ * From the specified side and block metadata retrieves the blocks texture. Args: side, metadata ++ */ ++ public Icon getIcon(int par1, int par2) { ++ return par1 == 1 ? this.furnaceIconTop : (par1 == 0 ? this.furnaceIconTop : (par1 != par2 ? this.blockIcon : this.furnaceIconFront)); ++ } ++ ++ /** ++ * When this method is called, your block should register all the icons it needs with the given IconRegister. This is ++ * the only chance you get to register icons. ++ */ ++ public void registerIcons(IconRegister par1IconRegister) { ++ this.blockIcon = par1IconRegister.registerIcon("furnace_side"); ++ this.furnaceIconFront = par1IconRegister.registerIcon(this.isActive ? "furnace_front_on" : "furnace_front_off"); ++ this.furnaceIconTop = par1IconRegister.registerIcon("furnace_top"); ++ } ++ ++ /** ++ * A randomly called display update to be able to add particles or other items for display ++ */ ++ public void randomDisplayTick(World par1World, int par2, int par3, int par4, Random par5Random) { ++ if (this.isActive) { ++ int var6 = par1World.getBlockMetadata(par2, par3, par4); ++ float var7 = (float)par2 + 0.5F; ++ float var8 = (float)par3 + 0.0F + par5Random.nextFloat() * 6.0F / 16.0F; ++ float var9 = (float)par4 + 0.5F; + float var10 = 0.52F; +- float var11 = var5.nextFloat() * 0.6F - 0.3F; +- if(var6 == 4) { +- var1.spawnParticle("smoke", (double)(var7 - var10), (double)var8, (double)(var9 + var11), 0.0D, 0.0D, 0.0D); +- var1.spawnParticle("flame", (double)(var7 - var10), (double)var8, (double)(var9 + var11), 0.0D, 0.0D, 0.0D); +- } else if(var6 == 5) { +- var1.spawnParticle("smoke", (double)(var7 + var10), (double)var8, (double)(var9 + var11), 0.0D, 0.0D, 0.0D); +- var1.spawnParticle("flame", (double)(var7 + var10), (double)var8, (double)(var9 + var11), 0.0D, 0.0D, 0.0D); +- } else if(var6 == 2) { +- var1.spawnParticle("smoke", (double)(var7 + var11), (double)var8, (double)(var9 - var10), 0.0D, 0.0D, 0.0D); +- var1.spawnParticle("flame", (double)(var7 + var11), (double)var8, (double)(var9 - var10), 0.0D, 0.0D, 0.0D); +- } else if(var6 == 3) { +- var1.spawnParticle("smoke", (double)(var7 + var11), (double)var8, (double)(var9 + var10), 0.0D, 0.0D, 0.0D); +- var1.spawnParticle("flame", (double)(var7 + var11), (double)var8, (double)(var9 + var10), 0.0D, 0.0D, 0.0D); ++ float var11 = par5Random.nextFloat() * 0.6F - 0.3F; ++ ++ if (var6 == 4) { ++ par1World.spawnParticle("smoke", (double)(var7 - var10), (double)var8, (double)(var9 + var11), 0.0D, 0.0D, 0.0D); ++ par1World.spawnParticle("flame", (double)(var7 - var10), (double)var8, (double)(var9 + var11), 0.0D, 0.0D, 0.0D); ++ } else if (var6 == 5) { ++ par1World.spawnParticle("smoke", (double)(var7 + var10), (double)var8, (double)(var9 + var11), 0.0D, 0.0D, 0.0D); ++ par1World.spawnParticle("flame", (double)(var7 + var10), (double)var8, (double)(var9 + var11), 0.0D, 0.0D, 0.0D); ++ } else if (var6 == 2) { ++ par1World.spawnParticle("smoke", (double)(var7 + var11), (double)var8, (double)(var9 - var10), 0.0D, 0.0D, 0.0D); ++ par1World.spawnParticle("flame", (double)(var7 + var11), (double)var8, (double)(var9 - var10), 0.0D, 0.0D, 0.0D); ++ } else if (var6 == 3) { ++ par1World.spawnParticle("smoke", (double)(var7 + var11), (double)var8, (double)(var9 + var10), 0.0D, 0.0D, 0.0D); ++ par1World.spawnParticle("flame", (double)(var7 + var11), (double)var8, (double)(var9 + var10), 0.0D, 0.0D, 0.0D); + } +- + } + } + +- public boolean onBlockActivated(World var1, int var2, int var3, int var4, EntityPlayer var5, int var6, float var7, float var8, float var9) { +- if(var1.isRemote) { ++ /** ++ * Called upon block activation (right click on the block.) ++ */ ++ public boolean onBlockActivated(World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer, int par6, float par7, float par8, float par9) { ++ if (par1World.isRemote) { + return true; + } else { +- TileEntityFurnace var10 = (TileEntityFurnace)var1.getBlockTileEntity(var2, var3, var4); +- if(var10 != null) { +- var5.displayGUIFurnace(var10); ++ TileEntityFurnace var10 = (TileEntityFurnace)par1World.getBlockTileEntity(par2, par3, par4); ++ ++ if (var10 != null) { ++ par5EntityPlayer.displayGUIFurnace(var10); + } + + return true; + } + } + +- public static void updateFurnaceBlockState(boolean var0, World var1, int var2, int var3, int var4) { +- int var5 = var1.getBlockMetadata(var2, var3, var4); +- TileEntity var6 = var1.getBlockTileEntity(var2, var3, var4); ++ /** ++ * Update which block ID the furnace is using depending on whether or not it is burning ++ */ ++ public static void updateFurnaceBlockState(boolean par0, World par1World, int par2, int par3, int par4) { ++ int var5 = par1World.getBlockMetadata(par2, par3, par4); ++ TileEntity var6 = par1World.getBlockTileEntity(par2, par3, par4); + keepFurnaceInventory = true; +- if(var0) { +- var1.setBlock(var2, var3, var4, Block.furnaceBurning.blockID); ++ ++ if (par0) { ++ par1World.setBlock(par2, par3, par4, Block.furnaceBurning.blockID); + } else { +- var1.setBlock(var2, var3, var4, Block.furnaceIdle.blockID); ++ par1World.setBlock(par2, par3, par4, Block.furnaceIdle.blockID); + } + + keepFurnaceInventory = false; +- var1.setBlockMetadata(var2, var3, var4, var5, 2); +- if(var6 != null) { ++ par1World.setBlockMetadataWithNotify(par2, par3, par4, var5, 2); ++ ++ if (var6 != null) { + var6.validate(); +- var1.setBlockTileEntity(var2, var3, var4, var6); ++ par1World.setBlockTileEntity(par2, par3, par4, var6); + } +- + } + +- public TileEntity createNewTileEntity(World var1) { ++ /** ++ * Returns a new instance of a block's tile entity class. Called on placing the block. ++ */ ++ public TileEntity createNewTileEntity(World par1World) { + return new TileEntityFurnace(); + } + +- public void onBlockPlacedBy(World var1, int var2, int var3, int var4, EntityLivingBase var5, ItemStack var6) { +- int var7 = MathHelper.floor_double((double)(var5.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3; +- if(var7 == 0) { +- var1.setBlockMetadata(var2, var3, var4, 2, 2); +- } +- +- if(var7 == 1) { +- var1.setBlockMetadata(var2, var3, var4, 5, 2); +- } +- +- if(var7 == 2) { +- var1.setBlockMetadata(var2, var3, var4, 3, 2); +- } +- +- if(var7 == 3) { +- var1.setBlockMetadata(var2, var3, var4, 4, 2); +- } +- +- if(var6.hasDisplayName()) { +- ((TileEntityFurnace)var1.getBlockTileEntity(var2, var3, var4)).setGuiDisplayName(var6.getDisplayName()); +- } +- ++ /** ++ * Called when the block is placed in the world. ++ */ ++ public void onBlockPlacedBy(World par1World, int par2, int par3, int par4, EntityLivingBase par5EntityLivingBase, ItemStack par6ItemStack) { ++ int var7 = MathHelper.floor_double((double)(par5EntityLivingBase.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3; ++ ++ if (var7 == 0) { ++ par1World.setBlockMetadataWithNotify(par2, par3, par4, 2, 2); ++ } ++ ++ if (var7 == 1) { ++ par1World.setBlockMetadataWithNotify(par2, par3, par4, 5, 2); ++ } ++ ++ if (var7 == 2) { ++ par1World.setBlockMetadataWithNotify(par2, par3, par4, 3, 2); ++ } ++ ++ if (var7 == 3) { ++ par1World.setBlockMetadataWithNotify(par2, par3, par4, 4, 2); ++ } ++ ++ if (par6ItemStack.hasDisplayName()) { ++ ((TileEntityFurnace)par1World.getBlockTileEntity(par2, par3, par4)).setGuiDisplayName(par6ItemStack.getDisplayName()); ++ } + } + +- public void breakBlock(World var1, int var2, int var3, int var4, int var5, int var6) { +- if(!keepFurnaceInventory) { +- TileEntityFurnace var7 = (TileEntityFurnace)var1.getBlockTileEntity(var2, var3, var4); +- if(var7 != null) { +- for(int var8 = 0; var8 < var7.getSizeInventory(); ++var8) { ++ /** ++ * Called on server worlds only when the block has been replaced by a different block ID, or the same block with a ++ * different metadata value, but before the new metadata value is set. Args: World, x, y, z, old block ID, old metadata ++ */ ++ public void breakBlock(World par1World, int par2, int par3, int par4, int par5, int par6) { ++ if (!keepFurnaceInventory) { ++ TileEntityFurnace var7 = (TileEntityFurnace)par1World.getBlockTileEntity(par2, par3, par4); ++ ++ if (var7 != null) { ++ for (int var8 = 0; var8 < var7.getSizeInventory(); ++var8) { + ItemStack var9 = var7.getStackInSlot(var8); +- if(var9 != null) { +- float var10 = this.a.nextFloat() * 0.8F + 0.1F; +- float var11 = this.a.nextFloat() * 0.8F + 0.1F; +- float var12 = this.a.nextFloat() * 0.8F + 0.1F; +- +- while(var9.stackSize > 0) { +- int var13 = this.a.nextInt(21) + 10; +- if(var13 > var9.stackSize) { ++ ++ if (var9 != null) { ++ float var10 = this.furnaceRand.nextFloat() * 0.8F + 0.1F; ++ float var11 = this.furnaceRand.nextFloat() * 0.8F + 0.1F; ++ float var12 = this.furnaceRand.nextFloat() * 0.8F + 0.1F; ++ ++ while (var9.stackSize > 0) { ++ int var13 = this.furnaceRand.nextInt(21) + 10; ++ ++ if (var13 > var9.stackSize) { + var13 = var9.stackSize; + } + + var9.stackSize -= var13; +- EntityItem var14 = new EntityItem(var1, (double)((float)var2 + var10), (double)((float)var3 + var11), (double)((float)var4 + var12), new ItemStack(var9.itemID, var13, var9.getItemDamage())); +- if(var9.hasTagCompound()) { ++ EntityItem var14 = new EntityItem(par1World, (double)((float)par2 + var10), (double)((float)par3 + var11), (double)((float)par4 + var12), new ItemStack(var9.itemID, var13, var9.getItemDamage())); ++ ++ if (var9.hasTagCompound()) { + var14.getEntityItem().setTagCompound((NBTTagCompound)var9.getTagCompound().copy()); + } + + float var15 = 0.05F; +- var14.motionX = (double)((float)this.a.nextGaussian() * var15); +- var14.motionY = (double)((float)this.a.nextGaussian() * var15 + 0.2F); +- var14.motionZ = (double)((float)this.a.nextGaussian() * var15); +- var1.spawnEntityInWorld(var14); ++ var14.motionX = (double)((float)this.furnaceRand.nextGaussian() * var15); ++ var14.motionY = (double)((float)this.furnaceRand.nextGaussian() * var15 + 0.2F); ++ var14.motionZ = (double)((float)this.furnaceRand.nextGaussian() * var15); ++ par1World.spawnEntityInWorld(var14); + } + } + } + +- var1.func_96440_m(var2, var3, var4, var5); ++ par1World.func_96440_m(par2, par3, par4, par5); + } + } + +- super.breakBlock(var1, var2, var3, var4, var5, var6); ++ super.breakBlock(par1World, par2, par3, par4, par5, par6); + } + ++ /** ++ * If this returns true, then comparators facing away from this block will use the value from ++ * getComparatorInputOverride instead of the actual redstone signal strength. ++ */ + public boolean hasComparatorInputOverride() { + return true; + } + +- public int getComparatorInputOverride(World var1, int var2, int var3, int var4, int var5) { +- return Container.calcRedstoneFromInventory((IInventory)var1.getBlockTileEntity(var2, var3, var4)); ++ /** ++ * If hasComparatorInputOverride returns true, the return value from this is used instead of the redstone signal ++ * strength when this block inputs to a comparator. ++ */ ++ public int getComparatorInputOverride(World par1World, int par2, int par3, int par4, int par5) { ++ return Container.calcRedstoneFromInventory((IInventory)par1World.getBlockTileEntity(par2, par3, par4)); + } + +- public int idPicked(World var1, int var2, int var3, int var4) { ++ /** ++ * only called by clickMiddleMouseButton , and passed to inventory.setCurrentItem (along with isCreative) ++ */ ++ public int idPicked(World par1World, int par2, int par3, int par4) { + return Block.furnaceIdle.blockID; + } + } diff --git a/patches/net/minecraft/src/BlockGlass.java.patch b/patches/net/minecraft/src/BlockGlass.java.patch new file mode 100644 index 0000000..b47257e --- /dev/null +++ b/patches/net/minecraft/src/BlockGlass.java.patch @@ -0,0 +1,49 @@ +--- net/minecraft/src/BlockGlass.java ++++ net/minecraft/src/BlockGlass.java +@@ -3,27 +3,43 @@ + import java.util.Random; + + public class BlockGlass extends BlockBreakable { +- public BlockGlass(int var1, Material var2, boolean var3) { +- super(var1, "glass", var2, var3); ++ public BlockGlass(int par1, Material par2Material, boolean par3) { ++ super(par1, "glass", par2Material, par3); + this.setCreativeTab(CreativeTabs.tabBlock); + } + +- public int quantityDropped(Random var1) { ++ /** ++ * Returns the quantity of items to drop on block destruction. ++ */ ++ public int quantityDropped(Random par1Random) { + return 0; + } + ++ /** ++ * Returns which pass should this block be rendered on. 0 for solids and 1 for alpha ++ */ + public int getRenderBlockPass() { + return 0; + } + ++ /** ++ * Is this block (a) opaque and (b) a full 1m cube? This determines whether or not to render the shared face of two ++ * adjacent blocks and also whether the player can attach torches, redstone wire, etc to this block. ++ */ + public boolean isOpaqueCube() { + return false; + } + ++ /** ++ * If this block doesn't render as an ordinary block it will return False (examples: signs, buttons, stairs, etc) ++ */ + public boolean renderAsNormalBlock() { + return false; + } + ++ /** ++ * Return true if a player with Silk Touch can harvest this block directly, and not its normal drops. ++ */ + protected boolean canSilkHarvest() { + return true; + } diff --git a/patches/net/minecraft/src/BlockGlowStone.java.patch b/patches/net/minecraft/src/BlockGlowStone.java.patch new file mode 100644 index 0000000..e42e884 --- /dev/null +++ b/patches/net/minecraft/src/BlockGlowStone.java.patch @@ -0,0 +1,43 @@ +--- net/minecraft/src/BlockGlowStone.java ++++ net/minecraft/src/BlockGlowStone.java +@@ -3,20 +3,29 @@ + import java.util.Random; + + public class BlockGlowStone extends Block { +- public BlockGlowStone(int var1, Material var2) { +- super(var1, var2); ++ public BlockGlowStone(int par1, Material par2Material) { ++ super(par1, par2Material); + this.setCreativeTab(CreativeTabs.tabBlock); + } + +- public int quantityDroppedWithBonus(int var1, Random var2) { +- return MathHelper.clamp_int(this.quantityDropped(var2) + var2.nextInt(var1 + 1), 1, 4); +- } +- +- public int quantityDropped(Random var1) { +- return 2 + var1.nextInt(3); +- } +- +- public int idDropped(int var1, Random var2, int var3) { ++ /** ++ * Returns the usual quantity dropped by the block plus a bonus of 1 to 'i' (inclusive). ++ */ ++ public int quantityDroppedWithBonus(int par1, Random par2Random) { ++ return MathHelper.clamp_int(this.quantityDropped(par2Random) + par2Random.nextInt(par1 + 1), 1, 4); ++ } ++ ++ /** ++ * Returns the quantity of items to drop on block destruction. ++ */ ++ public int quantityDropped(Random par1Random) { ++ return 2 + par1Random.nextInt(3); ++ } ++ ++ /** ++ * Returns the ID of the items to drop on destruction. ++ */ ++ public int idDropped(int par1, Random par2Random, int par3) { + return Item.glowstone.itemID; + } + } diff --git a/patches/net/minecraft/src/BlockGrass.java.patch b/patches/net/minecraft/src/BlockGrass.java.patch new file mode 100644 index 0000000..1e11132 --- /dev/null +++ b/patches/net/minecraft/src/BlockGrass.java.patch @@ -0,0 +1,142 @@ +--- net/minecraft/src/BlockGrass.java ++++ net/minecraft/src/BlockGrass.java +@@ -7,32 +7,42 @@ + private Icon iconSnowSide; + private Icon iconGrassSideOverlay; + +- protected BlockGrass(int var1) { +- super(var1, Material.grass); ++ protected BlockGrass(int par1) { ++ super(par1, Material.grass); + this.setTickRandomly(true); + this.setCreativeTab(CreativeTabs.tabBlock); + } + +- public Icon getIcon(int var1, int var2) { +- return var1 == 1 ? this.iconGrassTop : (var1 == 0 ? Block.dirt.getBlockTextureFromSide(var1) : this.blockIcon); ++ /** ++ * From the specified side and block metadata retrieves the blocks texture. Args: side, metadata ++ */ ++ public Icon getIcon(int par1, int par2) { ++ return par1 == 1 ? this.iconGrassTop : (par1 == 0 ? Block.dirt.getBlockTextureFromSide(par1) : this.blockIcon); + } + +- public Icon getBlockTexture(IBlockAccess var1, int var2, int var3, int var4, int var5) { +- if(var5 == 1) { ++ /** ++ * Retrieves the block texture to use based on the display side. Args: iBlockAccess, x, y, z, side ++ */ ++ public Icon getBlockTexture(IBlockAccess par1IBlockAccess, int par2, int par3, int par4, int par5) { ++ if (par5 == 1) { + return this.iconGrassTop; +- } else if(var5 == 0) { +- return Block.dirt.getBlockTextureFromSide(var5); ++ } else if (par5 == 0) { ++ return Block.dirt.getBlockTextureFromSide(par5); + } else { +- Material var6 = var1.getBlockMaterial(var2, var3 + 1, var4); ++ Material var6 = par1IBlockAccess.getBlockMaterial(par2, par3 + 1, par4); + return var6 != Material.snow && var6 != Material.craftedSnow ? this.blockIcon : this.iconSnowSide; + } + } + +- public void registerIcons(IconRegister var1) { +- this.blockIcon = var1.registerIcon(this.getTextureName() + "_side"); +- this.iconGrassTop = var1.registerIcon(this.getTextureName() + "_top"); +- this.iconSnowSide = var1.registerIcon(this.getTextureName() + "_side_snowed"); +- this.iconGrassSideOverlay = var1.registerIcon(this.getTextureName() + "_side_overlay"); ++ /** ++ * When this method is called, your block should register all the icons it needs with the given IconRegister. This is ++ * the only chance you get to register icons. ++ */ ++ public void registerIcons(IconRegister par1IconRegister) { ++ this.blockIcon = par1IconRegister.registerIcon(this.getTextureName() + "_side"); ++ this.iconGrassTop = par1IconRegister.registerIcon(this.getTextureName() + "_top"); ++ this.iconSnowSide = par1IconRegister.registerIcon(this.getTextureName() + "_side_snowed"); ++ this.iconGrassSideOverlay = par1IconRegister.registerIcon(this.getTextureName() + "_side_overlay"); + } + + public int getBlockColor() { +@@ -41,20 +51,27 @@ + return ColorizerGrass.getGrassColor(var1, var3); + } + +- public int getRenderColor(int var1) { ++ /** ++ * Returns the color this block should be rendered. Used by leaves. ++ */ ++ public int getRenderColor(int par1) { + return this.getBlockColor(); + } + +- public int colorMultiplier(IBlockAccess var1, int var2, int var3, int var4) { ++ /** ++ * Returns a integer with hex for 0xrrggbb with this color multiplied against the blocks color. Note only called when ++ * first determining what to render. ++ */ ++ public int colorMultiplier(IBlockAccess par1IBlockAccess, int par2, int par3, int par4) { + int var5 = 0; + int var6 = 0; + int var7 = 0; + +- for(int var8 = -1; var8 <= 1; ++var8) { +- for(int var9 = -1; var9 <= 1; ++var9) { +- int var10 = var1.getBiomeGenForCoords(var2 + var9, var4 + var8).getBiomeGrassColor(); ++ for (int var8 = -1; var8 <= 1; ++var8) { ++ for (int var9 = -1; var9 <= 1; ++var9) { ++ int var10 = par1IBlockAccess.getBiomeGenForCoords(par2 + var9, par4 + var8).getBiomeGrassColor(); + var5 += (var10 & 16711680) >> 16; +- var6 += (var10 & '\uff00') >> 8; ++ var6 += (var10 & 65280) >> 8; + var7 += var10 & 255; + } + } +@@ -62,27 +79,33 @@ + return (var5 / 9 & 255) << 16 | (var6 / 9 & 255) << 8 | var7 / 9 & 255; + } + +- public void updateTick(World var1, int var2, int var3, int var4, Random var5) { +- if(!var1.isRemote) { +- if(var1.getBlockLightValue(var2, var3 + 1, var4) < 4 && Block.lightOpacity[var1.getBlockId(var2, var3 + 1, var4)] > 2) { +- var1.setBlock(var2, var3, var4, Block.dirt.blockID); +- } else if(var1.getBlockLightValue(var2, var3 + 1, var4) >= 9) { +- for(int var6 = 0; var6 < 4; ++var6) { +- int var7 = var2 + var5.nextInt(3) - 1; +- int var8 = var3 + var5.nextInt(5) - 3; +- int var9 = var4 + var5.nextInt(3) - 1; +- int var10 = var1.getBlockId(var7, var8 + 1, var9); +- if(var1.getBlockId(var7, var8, var9) == Block.dirt.blockID && var1.getBlockLightValue(var7, var8 + 1, var9) >= 4 && Block.lightOpacity[var10] <= 2) { +- var1.setBlock(var7, var8, var9, Block.grass.blockID); ++ /** ++ * Ticks the block if it's been scheduled ++ */ ++ public void updateTick(World par1World, int par2, int par3, int par4, Random par5Random) { ++ if (!par1World.isRemote) { ++ if (par1World.getBlockLightValue(par2, par3 + 1, par4) < 4 && Block.lightOpacity[par1World.getBlockId(par2, par3 + 1, par4)] > 2) { ++ par1World.setBlock(par2, par3, par4, Block.dirt.blockID); ++ } else if (par1World.getBlockLightValue(par2, par3 + 1, par4) >= 9) { ++ for (int var6 = 0; var6 < 4; ++var6) { ++ int var7 = par2 + par5Random.nextInt(3) - 1; ++ int var8 = par3 + par5Random.nextInt(5) - 3; ++ int var9 = par4 + par5Random.nextInt(3) - 1; ++ int var10 = par1World.getBlockId(var7, var8 + 1, var9); ++ ++ if (par1World.getBlockId(var7, var8, var9) == Block.dirt.blockID && par1World.getBlockLightValue(var7, var8 + 1, var9) >= 4 && Block.lightOpacity[var10] <= 2) { ++ par1World.setBlock(var7, var8, var9, Block.grass.blockID); + } + } + } +- + } + } + +- public int idDropped(int var1, Random var2, int var3) { +- return Block.dirt.idDropped(0, var2, var3); ++ /** ++ * Returns the ID of the items to drop on destruction. ++ */ ++ public int idDropped(int par1, Random par2Random, int par3) { ++ return Block.dirt.idDropped(0, par2Random, par3); + } + + public static Icon getIconSideOverlay() { diff --git a/patches/net/minecraft/src/BlockGravel.java.patch b/patches/net/minecraft/src/BlockGravel.java.patch new file mode 100644 index 0000000..e7926ac --- /dev/null +++ b/patches/net/minecraft/src/BlockGravel.java.patch @@ -0,0 +1,27 @@ +--- net/minecraft/src/BlockGravel.java ++++ net/minecraft/src/BlockGravel.java +@@ -3,15 +3,18 @@ + import java.util.Random; + + public class BlockGravel extends BlockSand { +- public BlockGravel(int var1) { +- super(var1); ++ public BlockGravel(int par1) { ++ super(par1); + } + +- public int idDropped(int var1, Random var2, int var3) { +- if(var3 > 3) { +- var3 = 3; ++ /** ++ * Returns the ID of the items to drop on destruction. ++ */ ++ public int idDropped(int par1, Random par2Random, int par3) { ++ if (par3 > 3) { ++ par3 = 3; + } + +- return var2.nextInt(10 - var3 * 3) == 0 ? Item.flint.itemID : this.blockID; ++ return par2Random.nextInt(10 - par3 * 3) == 0 ? Item.flint.itemID : this.blockID; + } + } diff --git a/patches/net/minecraft/src/BlockHalfSlab.java.patch b/patches/net/minecraft/src/BlockHalfSlab.java.patch new file mode 100644 index 0000000..052a2ff --- /dev/null +++ b/patches/net/minecraft/src/BlockHalfSlab.java.patch @@ -0,0 +1,174 @@ +--- net/minecraft/src/BlockHalfSlab.java ++++ net/minecraft/src/BlockHalfSlab.java +@@ -6,11 +6,12 @@ + public abstract class BlockHalfSlab extends Block { + protected final boolean isDoubleSlab; + +- public BlockHalfSlab(int var1, boolean var2, Material var3) { +- super(var1, var3); +- this.isDoubleSlab = var2; +- if(var2) { +- opaqueCubeLookup[var1] = true; ++ public BlockHalfSlab(int par1, boolean par2, Material par3Material) { ++ super(par1, par3Material); ++ this.isDoubleSlab = par2; ++ ++ if (par2) { ++ opaqueCubeLookup[par1] = true; + } else { + this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.5F, 1.0F); + } +@@ -18,79 +19,120 @@ + this.setLightOpacity(255); + } + +- public void setBlockBoundsBasedOnState(IBlockAccess var1, int var2, int var3, int var4) { +- if(this.isDoubleSlab) { ++ /** ++ * Updates the blocks bounds based on its current state. Args: world, x, y, z ++ */ ++ public void setBlockBoundsBasedOnState(IBlockAccess par1IBlockAccess, int par2, int par3, int par4) { ++ if (this.isDoubleSlab) { + this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F); + } else { +- boolean var5 = (var1.getBlockMetadata(var2, var3, var4) & 8) != 0; +- if(var5) { ++ boolean var5 = (par1IBlockAccess.getBlockMetadata(par2, par3, par4) & 8) != 0; ++ ++ if (var5) { + this.setBlockBounds(0.0F, 0.5F, 0.0F, 1.0F, 1.0F, 1.0F); + } else { + this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.5F, 1.0F); + } + } +- + } + ++ /** ++ * Sets the block's bounds for rendering it as an item ++ */ + public void setBlockBoundsForItemRender() { +- if(this.isDoubleSlab) { ++ if (this.isDoubleSlab) { + this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F); + } else { + this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.5F, 1.0F); + } +- +- } +- +- public void addCollisionBoxesToList(World var1, int var2, int var3, int var4, AxisAlignedBB var5, List var6, Entity var7) { +- this.setBlockBoundsBasedOnState(var1, var2, var3, var4); +- super.addCollisionBoxesToList(var1, var2, var3, var4, var5, var6, var7); +- } +- ++ } ++ ++ /** ++ * Adds all intersecting collision boxes to a list. (Be sure to only add boxes to the list if they intersect the mask.) ++ * Parameters: World, X, Y, Z, mask, list, colliding entity ++ */ ++ public void addCollisionBoxesToList(World par1World, int par2, int par3, int par4, AxisAlignedBB par5AxisAlignedBB, List par6List, Entity par7Entity) { ++ this.setBlockBoundsBasedOnState(par1World, par2, par3, par4); ++ super.addCollisionBoxesToList(par1World, par2, par3, par4, par5AxisAlignedBB, par6List, par7Entity); ++ } ++ ++ /** ++ * Is this block (a) opaque and (b) a full 1m cube? This determines whether or not to render the shared face of two ++ * adjacent blocks and also whether the player can attach torches, redstone wire, etc to this block. ++ */ + public boolean isOpaqueCube() { + return this.isDoubleSlab; + } + +- public int onBlockPlaced(World var1, int var2, int var3, int var4, int var5, float var6, float var7, float var8, int var9) { +- return this.isDoubleSlab ? var9 : (var5 != 0 && (var5 == 1 || (double)var7 <= 0.5D) ? var9 : var9 | 8); ++ /** ++ * Called when a block is placed using its ItemBlock. Args: World, X, Y, Z, side, hitX, hitY, hitZ, block metadata ++ */ ++ public int onBlockPlaced(World par1World, int par2, int par3, int par4, int par5, float par6, float par7, float par8, int par9) { ++ return this.isDoubleSlab ? par9 : (par5 != 0 && (par5 == 1 || (double)par7 <= 0.5D) ? par9 : par9 | 8); + } + +- public int quantityDropped(Random var1) { ++ /** ++ * Returns the quantity of items to drop on block destruction. ++ */ ++ public int quantityDropped(Random par1Random) { + return this.isDoubleSlab ? 2 : 1; + } + +- public int damageDropped(int var1) { +- return var1 & 7; ++ /** ++ * Determines the damage on the item the block drops. Used in cloth and wood. ++ */ ++ public int damageDropped(int par1) { ++ return par1 & 7; + } + ++ /** ++ * If this block doesn't render as an ordinary block it will return False (examples: signs, buttons, stairs, etc) ++ */ + public boolean renderAsNormalBlock() { + return this.isDoubleSlab; + } + +- public boolean shouldSideBeRendered(IBlockAccess var1, int var2, int var3, int var4, int var5) { +- if(this.isDoubleSlab) { +- return super.shouldSideBeRendered(var1, var2, var3, var4, var5); +- } else if(var5 != 1 && var5 != 0 && !super.shouldSideBeRendered(var1, var2, var3, var4, var5)) { ++ /** ++ * Returns true if the given side of this block type should be rendered, if the adjacent block is at the given ++ * coordinates. Args: blockAccess, x, y, z, side ++ */ ++ public boolean shouldSideBeRendered(IBlockAccess par1IBlockAccess, int par2, int par3, int par4, int par5) { ++ if (this.isDoubleSlab) { ++ return super.shouldSideBeRendered(par1IBlockAccess, par2, par3, par4, par5); ++ } else if (par5 != 1 && par5 != 0 && !super.shouldSideBeRendered(par1IBlockAccess, par2, par3, par4, par5)) { + return false; + } else { +- int var6 = var2 + Facing.offsetsXForSide[Facing.oppositeSide[var5]]; +- int var7 = var3 + Facing.offsetsYForSide[Facing.oppositeSide[var5]]; +- int var8 = var4 + Facing.offsetsZForSide[Facing.oppositeSide[var5]]; +- boolean var9 = (var1.getBlockMetadata(var6, var7, var8) & 8) != 0; +- return var9 ? (var5 == 0 ? true : (var5 == 1 && super.shouldSideBeRendered(var1, var2, var3, var4, var5) ? true : !isBlockSingleSlab(var1.getBlockId(var2, var3, var4)) || (var1.getBlockMetadata(var2, var3, var4) & 8) == 0)) : (var5 == 1 ? true : (var5 == 0 && super.shouldSideBeRendered(var1, var2, var3, var4, var5) ? true : !isBlockSingleSlab(var1.getBlockId(var2, var3, var4)) || (var1.getBlockMetadata(var2, var3, var4) & 8) != 0)); ++ int var6 = par2 + Facing.offsetsXForSide[Facing.oppositeSide[par5]]; ++ int var7 = par3 + Facing.offsetsYForSide[Facing.oppositeSide[par5]]; ++ int var8 = par4 + Facing.offsetsZForSide[Facing.oppositeSide[par5]]; ++ boolean var9 = (par1IBlockAccess.getBlockMetadata(var6, var7, var8) & 8) != 0; ++ return var9 ? (par5 == 0 ? true : (par5 == 1 && super.shouldSideBeRendered(par1IBlockAccess, par2, par3, par4, par5) ? true : !isBlockSingleSlab(par1IBlockAccess.getBlockId(par2, par3, par4)) || (par1IBlockAccess.getBlockMetadata(par2, par3, par4) & 8) == 0)) : (par5 == 1 ? true : (par5 == 0 && super.shouldSideBeRendered(par1IBlockAccess, par2, par3, par4, par5) ? true : !isBlockSingleSlab(par1IBlockAccess.getBlockId(par2, par3, par4)) || (par1IBlockAccess.getBlockMetadata(par2, par3, par4) & 8) != 0)); + } + } + +- private static boolean isBlockSingleSlab(int var0) { +- return var0 == Block.stoneSingleSlab.blockID || var0 == Block.woodSingleSlab.blockID; ++ /** ++ * Takes a block ID, returns true if it's the same as the ID for a stone or wooden single slab. ++ */ ++ private static boolean isBlockSingleSlab(int par0) { ++ return par0 == Block.stoneSingleSlab.blockID || par0 == Block.woodSingleSlab.blockID; + } + ++ /** ++ * Returns the slab block name with step type. ++ */ + public abstract String getFullSlabName(int var1); + +- public int getDamageValue(World var1, int var2, int var3, int var4) { +- return super.getDamageValue(var1, var2, var3, var4) & 7; ++ /** ++ * Get the block's damage value (for use with pick block). ++ */ ++ public int getDamageValue(World par1World, int par2, int par3, int par4) { ++ return super.getDamageValue(par1World, par2, par3, par4) & 7; + } + +- public int idPicked(World var1, int var2, int var3, int var4) { ++ /** ++ * only called by clickMiddleMouseButton , and passed to inventory.setCurrentItem (along with isCreative) ++ */ ++ public int idPicked(World par1World, int par2, int par3, int par4) { + return isBlockSingleSlab(this.blockID) ? this.blockID : (this.blockID == Block.stoneDoubleSlab.blockID ? Block.stoneSingleSlab.blockID : (this.blockID == Block.woodDoubleSlab.blockID ? Block.woodSingleSlab.blockID : Block.stoneSingleSlab.blockID)); + } + } diff --git a/patches/net/minecraft/src/BlockHay.java.patch b/patches/net/minecraft/src/BlockHay.java.patch new file mode 100644 index 0000000..da2bcfa --- /dev/null +++ b/patches/net/minecraft/src/BlockHay.java.patch @@ -0,0 +1,40 @@ +--- net/minecraft/src/BlockHay.java ++++ net/minecraft/src/BlockHay.java +@@ -1,21 +1,31 @@ + package net.minecraft.src; + + public class BlockHay extends BlockRotatedPillar { +- public BlockHay(int var1) { +- super(var1, Material.grass); ++ public BlockHay(int par1) { ++ super(par1, Material.grass); + this.setCreativeTab(CreativeTabs.tabBlock); + } + ++ /** ++ * The type of render function that is called for this block ++ */ + public int getRenderType() { + return 31; + } + +- protected Icon getSideIcon(int var1) { ++ /** ++ * The icon for the side of the block. ++ */ ++ protected Icon getSideIcon(int par1) { + return this.blockIcon; + } + +- public void registerIcons(IconRegister var1) { +- this.field_111051_a = var1.registerIcon(this.getTextureName() + "_top"); +- this.blockIcon = var1.registerIcon(this.getTextureName() + "_side"); ++ /** ++ * When this method is called, your block should register all the icons it needs with the given IconRegister. This is ++ * the only chance you get to register icons. ++ */ ++ public void registerIcons(IconRegister par1IconRegister) { ++ this.field_111051_a = par1IconRegister.registerIcon(this.getTextureName() + "_top"); ++ this.blockIcon = par1IconRegister.registerIcon(this.getTextureName() + "_side"); + } + } diff --git a/patches/net/minecraft/src/BlockHopper.java.patch b/patches/net/minecraft/src/BlockHopper.java.patch new file mode 100644 index 0000000..91eac57 --- /dev/null +++ b/patches/net/minecraft/src/BlockHopper.java.patch @@ -0,0 +1,344 @@ +--- net/minecraft/src/BlockHopper.java ++++ net/minecraft/src/BlockHopper.java +@@ -4,179 +4,250 @@ + import java.util.Random; + + public class BlockHopper extends BlockContainer { +- private final Random a = new Random(); ++ private final Random field_94457_a = new Random(); + private Icon hopperIcon; + private Icon hopperTopIcon; + private Icon hopperInsideIcon; + +- public BlockHopper(int var1) { +- super(var1, Material.iron); ++ public BlockHopper(int par1) { ++ super(par1, Material.iron); + this.setCreativeTab(CreativeTabs.tabRedstone); + this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F); + } + +- public void setBlockBoundsBasedOnState(IBlockAccess var1, int var2, int var3, int var4) { ++ /** ++ * Updates the blocks bounds based on its current state. Args: world, x, y, z ++ */ ++ public void setBlockBoundsBasedOnState(IBlockAccess par1IBlockAccess, int par2, int par3, int par4) { + this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F); + } + +- public void addCollisionBoxesToList(World var1, int var2, int var3, int var4, AxisAlignedBB var5, List var6, Entity var7) { +- this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 10.0F / 16.0F, 1.0F); +- super.addCollisionBoxesToList(var1, var2, var3, var4, var5, var6, var7); +- float var8 = 2.0F / 16.0F; ++ /** ++ * Adds all intersecting collision boxes to a list. (Be sure to only add boxes to the list if they intersect the mask.) ++ * Parameters: World, X, Y, Z, mask, list, colliding entity ++ */ ++ public void addCollisionBoxesToList(World par1World, int par2, int par3, int par4, AxisAlignedBB par5AxisAlignedBB, List par6List, Entity par7Entity) { ++ this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.625F, 1.0F); ++ super.addCollisionBoxesToList(par1World, par2, par3, par4, par5AxisAlignedBB, par6List, par7Entity); ++ float var8 = 0.125F; + this.setBlockBounds(0.0F, 0.0F, 0.0F, var8, 1.0F, 1.0F); +- super.addCollisionBoxesToList(var1, var2, var3, var4, var5, var6, var7); ++ super.addCollisionBoxesToList(par1World, par2, par3, par4, par5AxisAlignedBB, par6List, par7Entity); + this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, var8); +- super.addCollisionBoxesToList(var1, var2, var3, var4, var5, var6, var7); ++ super.addCollisionBoxesToList(par1World, par2, par3, par4, par5AxisAlignedBB, par6List, par7Entity); + this.setBlockBounds(1.0F - var8, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F); +- super.addCollisionBoxesToList(var1, var2, var3, var4, var5, var6, var7); ++ super.addCollisionBoxesToList(par1World, par2, par3, par4, par5AxisAlignedBB, par6List, par7Entity); + this.setBlockBounds(0.0F, 0.0F, 1.0F - var8, 1.0F, 1.0F, 1.0F); +- super.addCollisionBoxesToList(var1, var2, var3, var4, var5, var6, var7); ++ super.addCollisionBoxesToList(par1World, par2, par3, par4, par5AxisAlignedBB, par6List, par7Entity); + this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F); + } + +- public int onBlockPlaced(World var1, int var2, int var3, int var4, int var5, float var6, float var7, float var8, int var9) { +- int var10 = Facing.oppositeSide[var5]; +- if(var10 == 1) { ++ /** ++ * Called when a block is placed using its ItemBlock. Args: World, X, Y, Z, side, hitX, hitY, hitZ, block metadata ++ */ ++ public int onBlockPlaced(World par1World, int par2, int par3, int par4, int par5, float par6, float par7, float par8, int par9) { ++ int var10 = Facing.oppositeSide[par5]; ++ ++ if (var10 == 1) { + var10 = 0; + } + + return var10; + } + +- public TileEntity createNewTileEntity(World var1) { ++ /** ++ * Returns a new instance of a block's tile entity class. Called on placing the block. ++ */ ++ public TileEntity createNewTileEntity(World par1World) { + return new TileEntityHopper(); + } + +- public void onBlockPlacedBy(World var1, int var2, int var3, int var4, EntityLivingBase var5, ItemStack var6) { +- super.onBlockPlacedBy(var1, var2, var3, var4, var5, var6); +- if(var6.hasDisplayName()) { +- TileEntityHopper var7 = getHopperTile(var1, var2, var3, var4); +- var7.setInventoryName(var6.getDisplayName()); ++ /** ++ * Called when the block is placed in the world. ++ */ ++ public void onBlockPlacedBy(World par1World, int par2, int par3, int par4, EntityLivingBase par5EntityLivingBase, ItemStack par6ItemStack) { ++ super.onBlockPlacedBy(par1World, par2, par3, par4, par5EntityLivingBase, par6ItemStack); ++ ++ if (par6ItemStack.hasDisplayName()) { ++ TileEntityHopper var7 = getHopperTile(par1World, par2, par3, par4); ++ var7.setInventoryName(par6ItemStack.getDisplayName()); + } +- +- } +- +- public void onBlockAdded(World var1, int var2, int var3, int var4) { +- super.onBlockAdded(var1, var2, var3, var4); +- this.updateMetadata(var1, var2, var3, var4); +- } +- +- public boolean onBlockActivated(World var1, int var2, int var3, int var4, EntityPlayer var5, int var6, float var7, float var8, float var9) { +- if(var1.isRemote) { ++ } ++ ++ /** ++ * Called whenever the block is added into the world. Args: world, x, y, z ++ */ ++ public void onBlockAdded(World par1World, int par2, int par3, int par4) { ++ super.onBlockAdded(par1World, par2, par3, par4); ++ this.updateMetadata(par1World, par2, par3, par4); ++ } ++ ++ /** ++ * Called upon block activation (right click on the block.) ++ */ ++ public boolean onBlockActivated(World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer, int par6, float par7, float par8, float par9) { ++ if (par1World.isRemote) { + return true; + } else { +- TileEntityHopper var10 = getHopperTile(var1, var2, var3, var4); +- if(var10 != null) { +- var5.displayGUIHopper(var10); ++ TileEntityHopper var10 = getHopperTile(par1World, par2, par3, par4); ++ ++ if (var10 != null) { ++ par5EntityPlayer.displayGUIHopper(var10); + } + + return true; + } + } + +- public void onNeighborBlockChange(World var1, int var2, int var3, int var4, int var5) { +- this.updateMetadata(var1, var2, var3, var4); ++ /** ++ * Lets the block know when one of its neighbor changes. Doesn't know which neighbor changed (coordinates passed are ++ * their own) Args: x, y, z, neighbor blockID ++ */ ++ public void onNeighborBlockChange(World par1World, int par2, int par3, int par4, int par5) { ++ this.updateMetadata(par1World, par2, par3, par4); + } + +- private void updateMetadata(World var1, int var2, int var3, int var4) { +- int var5 = var1.getBlockMetadata(var2, var3, var4); ++ /** ++ * Updates the Metadata to include if the Hopper gets powered by Redstone or not ++ */ ++ private void updateMetadata(World par1World, int par2, int par3, int par4) { ++ int var5 = par1World.getBlockMetadata(par2, par3, par4); + int var6 = getDirectionFromMetadata(var5); +- boolean var7 = !var1.isBlockIndirectlyGettingPowered(var2, var3, var4); ++ boolean var7 = !par1World.isBlockIndirectlyGettingPowered(par2, par3, par4); + boolean var8 = getIsBlockNotPoweredFromMetadata(var5); +- if(var7 != var8) { +- var1.setBlockMetadata(var2, var3, var4, var6 | (var7 ? 0 : 8), 4); ++ ++ if (var7 != var8) { ++ par1World.setBlockMetadataWithNotify(par2, par3, par4, var6 | (var7 ? 0 : 8), 4); + } +- + } + +- public void breakBlock(World var1, int var2, int var3, int var4, int var5, int var6) { +- TileEntityHopper var7 = (TileEntityHopper)var1.getBlockTileEntity(var2, var3, var4); +- if(var7 != null) { +- for(int var8 = 0; var8 < var7.getSizeInventory(); ++var8) { ++ /** ++ * Called on server worlds only when the block has been replaced by a different block ID, or the same block with a ++ * different metadata value, but before the new metadata value is set. Args: World, x, y, z, old block ID, old metadata ++ */ ++ public void breakBlock(World par1World, int par2, int par3, int par4, int par5, int par6) { ++ TileEntityHopper var7 = (TileEntityHopper)par1World.getBlockTileEntity(par2, par3, par4); ++ ++ if (var7 != null) { ++ for (int var8 = 0; var8 < var7.getSizeInventory(); ++var8) { + ItemStack var9 = var7.getStackInSlot(var8); +- if(var9 != null) { +- float var10 = this.a.nextFloat() * 0.8F + 0.1F; +- float var11 = this.a.nextFloat() * 0.8F + 0.1F; +- float var12 = this.a.nextFloat() * 0.8F + 0.1F; +- +- while(var9.stackSize > 0) { +- int var13 = this.a.nextInt(21) + 10; +- if(var13 > var9.stackSize) { ++ ++ if (var9 != null) { ++ float var10 = this.field_94457_a.nextFloat() * 0.8F + 0.1F; ++ float var11 = this.field_94457_a.nextFloat() * 0.8F + 0.1F; ++ float var12 = this.field_94457_a.nextFloat() * 0.8F + 0.1F; ++ ++ while (var9.stackSize > 0) { ++ int var13 = this.field_94457_a.nextInt(21) + 10; ++ ++ if (var13 > var9.stackSize) { + var13 = var9.stackSize; + } + + var9.stackSize -= var13; +- EntityItem var14 = new EntityItem(var1, (double)((float)var2 + var10), (double)((float)var3 + var11), (double)((float)var4 + var12), new ItemStack(var9.itemID, var13, var9.getItemDamage())); +- if(var9.hasTagCompound()) { ++ EntityItem var14 = new EntityItem(par1World, (double)((float)par2 + var10), (double)((float)par3 + var11), (double)((float)par4 + var12), new ItemStack(var9.itemID, var13, var9.getItemDamage())); ++ ++ if (var9.hasTagCompound()) { + var14.getEntityItem().setTagCompound((NBTTagCompound)var9.getTagCompound().copy()); + } + + float var15 = 0.05F; +- var14.motionX = (double)((float)this.a.nextGaussian() * var15); +- var14.motionY = (double)((float)this.a.nextGaussian() * var15 + 0.2F); +- var14.motionZ = (double)((float)this.a.nextGaussian() * var15); +- var1.spawnEntityInWorld(var14); ++ var14.motionX = (double)((float)this.field_94457_a.nextGaussian() * var15); ++ var14.motionY = (double)((float)this.field_94457_a.nextGaussian() * var15 + 0.2F); ++ var14.motionZ = (double)((float)this.field_94457_a.nextGaussian() * var15); ++ par1World.spawnEntityInWorld(var14); + } + } + } + +- var1.func_96440_m(var2, var3, var4, var5); ++ par1World.func_96440_m(par2, par3, par4, par5); + } + +- super.breakBlock(var1, var2, var3, var4, var5, var6); ++ super.breakBlock(par1World, par2, par3, par4, par5, par6); + } + ++ /** ++ * The type of render function that is called for this block ++ */ + public int getRenderType() { + return 38; + } + ++ /** ++ * If this block doesn't render as an ordinary block it will return False (examples: signs, buttons, stairs, etc) ++ */ + public boolean renderAsNormalBlock() { + return false; + } + ++ /** ++ * Is this block (a) opaque and (b) a full 1m cube? This determines whether or not to render the shared face of two ++ * adjacent blocks and also whether the player can attach torches, redstone wire, etc to this block. ++ */ + public boolean isOpaqueCube() { + return false; + } + +- public boolean shouldSideBeRendered(IBlockAccess var1, int var2, int var3, int var4, int var5) { ++ /** ++ * Returns true if the given side of this block type should be rendered, if the adjacent block is at the given ++ * coordinates. Args: blockAccess, x, y, z, side ++ */ ++ public boolean shouldSideBeRendered(IBlockAccess par1IBlockAccess, int par2, int par3, int par4, int par5) { + return true; + } + +- public Icon getIcon(int var1, int var2) { +- return var1 == 1 ? this.hopperTopIcon : this.hopperIcon; +- } +- +- public static int getDirectionFromMetadata(int var0) { +- return var0 & 7; +- } +- +- public static boolean getIsBlockNotPoweredFromMetadata(int var0) { +- return (var0 & 8) != 8; +- } +- ++ /** ++ * From the specified side and block metadata retrieves the blocks texture. Args: side, metadata ++ */ ++ public Icon getIcon(int par1, int par2) { ++ return par1 == 1 ? this.hopperTopIcon : this.hopperIcon; ++ } ++ ++ public static int getDirectionFromMetadata(int par0) { ++ return par0 & 7; ++ } ++ ++ public static boolean getIsBlockNotPoweredFromMetadata(int par0) { ++ return (par0 & 8) != 8; ++ } ++ ++ /** ++ * If this returns true, then comparators facing away from this block will use the value from ++ * getComparatorInputOverride instead of the actual redstone signal strength. ++ */ + public boolean hasComparatorInputOverride() { + return true; + } + +- public int getComparatorInputOverride(World var1, int var2, int var3, int var4, int var5) { +- return Container.calcRedstoneFromInventory(getHopperTile(var1, var2, var3, var4)); +- } +- +- public void registerIcons(IconRegister var1) { +- this.hopperIcon = var1.registerIcon("hopper_outside"); +- this.hopperTopIcon = var1.registerIcon("hopper_top"); +- this.hopperInsideIcon = var1.registerIcon("hopper_inside"); +- } +- +- public static Icon getHopperIcon(String var0) { +- return var0.equals("hopper_outside") ? Block.hopperBlock.hopperIcon : (var0.equals("hopper_inside") ? Block.hopperBlock.hopperInsideIcon : null); +- } +- ++ /** ++ * If hasComparatorInputOverride returns true, the return value from this is used instead of the redstone signal ++ * strength when this block inputs to a comparator. ++ */ ++ public int getComparatorInputOverride(World par1World, int par2, int par3, int par4, int par5) { ++ return Container.calcRedstoneFromInventory(getHopperTile(par1World, par2, par3, par4)); ++ } ++ ++ /** ++ * When this method is called, your block should register all the icons it needs with the given IconRegister. This is ++ * the only chance you get to register icons. ++ */ ++ public void registerIcons(IconRegister par1IconRegister) { ++ this.hopperIcon = par1IconRegister.registerIcon("hopper_outside"); ++ this.hopperTopIcon = par1IconRegister.registerIcon("hopper_top"); ++ this.hopperInsideIcon = par1IconRegister.registerIcon("hopper_inside"); ++ } ++ ++ public static Icon getHopperIcon(String par0Str) { ++ return par0Str.equals("hopper_outside") ? Block.hopperBlock.hopperIcon : (par0Str.equals("hopper_inside") ? Block.hopperBlock.hopperInsideIcon : null); ++ } ++ ++ /** ++ * Gets the icon name of the ItemBlock corresponding to this block. Used by hoppers. ++ */ + public String getItemIconName() { + return "hopper"; + } + +- public static TileEntityHopper getHopperTile(IBlockAccess var0, int var1, int var2, int var3) { +- return (TileEntityHopper)var0.getBlockTileEntity(var1, var2, var3); ++ public static TileEntityHopper getHopperTile(IBlockAccess par0IBlockAccess, int par1, int par2, int par3) { ++ return (TileEntityHopper)par0IBlockAccess.getBlockTileEntity(par1, par2, par3); + } + } diff --git a/patches/net/minecraft/src/BlockIce.java.patch b/patches/net/minecraft/src/BlockIce.java.patch new file mode 100644 index 0000000..6c3d89d --- /dev/null +++ b/patches/net/minecraft/src/BlockIce.java.patch @@ -0,0 +1,114 @@ +--- net/minecraft/src/BlockIce.java ++++ net/minecraft/src/BlockIce.java +@@ -3,62 +3,84 @@ + import java.util.Random; + + public class BlockIce extends BlockBreakable { +- public BlockIce(int var1) { +- super(var1, "ice", Material.ice, false); ++ public BlockIce(int par1) { ++ super(par1, "ice", Material.ice, false); + this.slipperiness = 0.98F; + this.setTickRandomly(true); + this.setCreativeTab(CreativeTabs.tabBlock); + } + ++ /** ++ * Returns which pass should this block be rendered on. 0 for solids and 1 for alpha ++ */ + public int getRenderBlockPass() { + return 1; + } + +- public boolean shouldSideBeRendered(IBlockAccess var1, int var2, int var3, int var4, int var5) { +- return super.shouldSideBeRendered(var1, var2, var3, var4, 1 - var5); ++ /** ++ * Returns true if the given side of this block type should be rendered, if the adjacent block is at the given ++ * coordinates. Args: blockAccess, x, y, z, side ++ */ ++ public boolean shouldSideBeRendered(IBlockAccess par1IBlockAccess, int par2, int par3, int par4, int par5) { ++ return super.shouldSideBeRendered(par1IBlockAccess, par2, par3, par4, 1 - par5); + } + +- public void harvestBlock(World var1, EntityPlayer var2, int var3, int var4, int var5, int var6) { +- var2.addStat(StatList.mineBlockStatArray[this.blockID], 1); +- var2.addExhaustion(0.025F); +- if(this.canSilkHarvest() && EnchantmentHelper.getSilkTouchModifier(var2)) { +- ItemStack var9 = this.createStackedBlock(var6); +- if(var9 != null) { +- this.dropBlockAsItem_do(var1, var3, var4, var5, var9); ++ /** ++ * Called when the player destroys a block with an item that can harvest it. (i, j, k) are the coordinates of the block ++ * and l is the block's subtype/damage. ++ */ ++ public void harvestBlock(World par1World, EntityPlayer par2EntityPlayer, int par3, int par4, int par5, int par6) { ++ par2EntityPlayer.addStat(StatList.mineBlockStatArray[this.blockID], 1); ++ par2EntityPlayer.addExhaustion(0.025F); ++ ++ if (this.canSilkHarvest() && EnchantmentHelper.getSilkTouchModifier(par2EntityPlayer)) { ++ ItemStack var9 = this.createStackedBlock(par6); ++ ++ if (var9 != null) { ++ this.dropBlockAsItem_do(par1World, par3, par4, par5, var9); + } + } else { +- if(var1.provider.isHellWorld) { +- var1.setBlockToAir(var3, var4, var5); ++ if (par1World.provider.isHellWorld) { ++ par1World.setBlockToAir(par3, par4, par5); + return; + } + +- int var7 = EnchantmentHelper.getFortuneModifier(var2); +- this.dropBlockAsItem(var1, var3, var4, var5, var6, var7); +- Material var8 = var1.getBlockMaterial(var3, var4 - 1, var5); +- if(var8.blocksMovement() || var8.isLiquid()) { +- var1.setBlock(var3, var4, var5, Block.waterMoving.blockID); ++ int var7 = EnchantmentHelper.getFortuneModifier(par2EntityPlayer); ++ this.dropBlockAsItem(par1World, par3, par4, par5, par6, var7); ++ Material var8 = par1World.getBlockMaterial(par3, par4 - 1, par5); ++ ++ if (var8.blocksMovement() || var8.isLiquid()) { ++ par1World.setBlock(par3, par4, par5, Block.waterMoving.blockID); + } + } +- + } + +- public int quantityDropped(Random var1) { ++ /** ++ * Returns the quantity of items to drop on block destruction. ++ */ ++ public int quantityDropped(Random par1Random) { + return 0; + } + +- public void updateTick(World var1, int var2, int var3, int var4, Random var5) { +- if(var1.getSavedLightValue(EnumSkyBlock.Block, var2, var3, var4) > 11 - Block.lightOpacity[this.blockID]) { +- if(var1.provider.isHellWorld) { +- var1.setBlockToAir(var2, var3, var4); ++ /** ++ * Ticks the block if it's been scheduled ++ */ ++ public void updateTick(World par1World, int par2, int par3, int par4, Random par5Random) { ++ if (par1World.getSavedLightValue(EnumSkyBlock.Block, par2, par3, par4) > 11 - Block.lightOpacity[this.blockID]) { ++ if (par1World.provider.isHellWorld) { ++ par1World.setBlockToAir(par2, par3, par4); + return; + } + +- this.dropBlockAsItem(var1, var2, var3, var4, var1.getBlockMetadata(var2, var3, var4), 0); +- var1.setBlock(var2, var3, var4, Block.waterStill.blockID); ++ this.dropBlockAsItem(par1World, par2, par3, par4, par1World.getBlockMetadata(par2, par3, par4), 0); ++ par1World.setBlock(par2, par3, par4, Block.waterStill.blockID); + } +- + } + ++ /** ++ * Returns the mobility information of the block, 0 = free, 1 = can't push but can move over, 2 = total immobility and ++ * stop pistons ++ */ + public int getMobilityFlag() { + return 0; + } diff --git a/patches/net/minecraft/src/BlockJukeBox.java.patch b/patches/net/minecraft/src/BlockJukeBox.java.patch new file mode 100644 index 0000000..6f2fc30 --- /dev/null +++ b/patches/net/minecraft/src/BlockJukeBox.java.patch @@ -0,0 +1,161 @@ +--- net/minecraft/src/BlockJukeBox.java ++++ net/minecraft/src/BlockJukeBox.java +@@ -3,83 +3,120 @@ + public class BlockJukeBox extends BlockContainer { + private Icon theIcon; + +- protected BlockJukeBox(int var1) { +- super(var1, Material.wood); ++ protected BlockJukeBox(int par1) { ++ super(par1, Material.wood); + this.setCreativeTab(CreativeTabs.tabDecorations); + } + +- public Icon getIcon(int var1, int var2) { +- return var1 == 1 ? this.theIcon : this.blockIcon; ++ /** ++ * From the specified side and block metadata retrieves the blocks texture. Args: side, metadata ++ */ ++ public Icon getIcon(int par1, int par2) { ++ return par1 == 1 ? this.theIcon : this.blockIcon; + } + +- public boolean onBlockActivated(World var1, int var2, int var3, int var4, EntityPlayer var5, int var6, float var7, float var8, float var9) { +- if(var1.getBlockMetadata(var2, var3, var4) == 0) { ++ /** ++ * Called upon block activation (right click on the block.) ++ */ ++ public boolean onBlockActivated(World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer, int par6, float par7, float par8, float par9) { ++ if (par1World.getBlockMetadata(par2, par3, par4) == 0) { + return false; + } else { +- this.ejectRecord(var1, var2, var3, var4); ++ this.ejectRecord(par1World, par2, par3, par4); + return true; + } + } + +- public void insertRecord(World var1, int var2, int var3, int var4, ItemStack var5) { +- if(!var1.isRemote) { +- TileEntityRecordPlayer var6 = (TileEntityRecordPlayer)var1.getBlockTileEntity(var2, var3, var4); +- if(var6 != null) { +- var6.func_96098_a(var5.copy()); +- var1.setBlockMetadata(var2, var3, var4, 1, 2); ++ /** ++ * Insert the specified music disc in the jukebox at the given coordinates ++ */ ++ public void insertRecord(World par1World, int par2, int par3, int par4, ItemStack par5ItemStack) { ++ if (!par1World.isRemote) { ++ TileEntityRecordPlayer var6 = (TileEntityRecordPlayer)par1World.getBlockTileEntity(par2, par3, par4); ++ ++ if (var6 != null) { ++ var6.func_96098_a(par5ItemStack.copy()); ++ par1World.setBlockMetadataWithNotify(par2, par3, par4, 1, 2); + } + } + } + +- public void ejectRecord(World var1, int var2, int var3, int var4) { +- if(!var1.isRemote) { +- TileEntityRecordPlayer var5 = (TileEntityRecordPlayer)var1.getBlockTileEntity(var2, var3, var4); +- if(var5 != null) { ++ /** ++ * Ejects the current record inside of the jukebox. ++ */ ++ public void ejectRecord(World par1World, int par2, int par3, int par4) { ++ if (!par1World.isRemote) { ++ TileEntityRecordPlayer var5 = (TileEntityRecordPlayer)par1World.getBlockTileEntity(par2, par3, par4); ++ ++ if (var5 != null) { + ItemStack var6 = var5.func_96097_a(); +- if(var6 != null) { +- var1.playAuxSFX(1005, var2, var3, var4, 0); +- var1.playRecord((String)null, var2, var3, var4); ++ ++ if (var6 != null) { ++ par1World.playAuxSFX(1005, par2, par3, par4, 0); ++ par1World.playRecord((String)null, par2, par3, par4); + var5.func_96098_a((ItemStack)null); +- var1.setBlockMetadata(var2, var3, var4, 0, 2); ++ par1World.setBlockMetadataWithNotify(par2, par3, par4, 0, 2); + float var7 = 0.7F; +- double var8 = (double)(var1.s.nextFloat() * var7) + (double)(1.0F - var7) * 0.5D; +- double var10 = (double)(var1.s.nextFloat() * var7) + (double)(1.0F - var7) * 0.2D + 0.6D; +- double var12 = (double)(var1.s.nextFloat() * var7) + (double)(1.0F - var7) * 0.5D; ++ double var8 = (double)(par1World.rand.nextFloat() * var7) + (double)(1.0F - var7) * 0.5D; ++ double var10 = (double)(par1World.rand.nextFloat() * var7) + (double)(1.0F - var7) * 0.2D + 0.6D; ++ double var12 = (double)(par1World.rand.nextFloat() * var7) + (double)(1.0F - var7) * 0.5D; + ItemStack var14 = var6.copy(); +- EntityItem var15 = new EntityItem(var1, (double)var2 + var8, (double)var3 + var10, (double)var4 + var12, var14); ++ EntityItem var15 = new EntityItem(par1World, (double)par2 + var8, (double)par3 + var10, (double)par4 + var12, var14); + var15.delayBeforeCanPickup = 10; +- var1.spawnEntityInWorld(var15); ++ par1World.spawnEntityInWorld(var15); + } + } + } + } + +- public void breakBlock(World var1, int var2, int var3, int var4, int var5, int var6) { +- this.ejectRecord(var1, var2, var3, var4); +- super.breakBlock(var1, var2, var3, var4, var5, var6); ++ /** ++ * Called on server worlds only when the block has been replaced by a different block ID, or the same block with a ++ * different metadata value, but before the new metadata value is set. Args: World, x, y, z, old block ID, old metadata ++ */ ++ public void breakBlock(World par1World, int par2, int par3, int par4, int par5, int par6) { ++ this.ejectRecord(par1World, par2, par3, par4); ++ super.breakBlock(par1World, par2, par3, par4, par5, par6); + } + +- public void dropBlockAsItemWithChance(World var1, int var2, int var3, int var4, int var5, float var6, int var7) { +- if(!var1.isRemote) { +- super.dropBlockAsItemWithChance(var1, var2, var3, var4, var5, var6, 0); ++ /** ++ * Drops the block items with a specified chance of dropping the specified items ++ */ ++ public void dropBlockAsItemWithChance(World par1World, int par2, int par3, int par4, int par5, float par6, int par7) { ++ if (!par1World.isRemote) { ++ super.dropBlockAsItemWithChance(par1World, par2, par3, par4, par5, par6, 0); + } + } + +- public TileEntity createNewTileEntity(World var1) { ++ /** ++ * Returns a new instance of a block's tile entity class. Called on placing the block. ++ */ ++ public TileEntity createNewTileEntity(World par1World) { + return new TileEntityRecordPlayer(); + } + +- public void registerIcons(IconRegister var1) { +- this.blockIcon = var1.registerIcon(this.getTextureName() + "_side"); +- this.theIcon = var1.registerIcon(this.getTextureName() + "_top"); ++ /** ++ * When this method is called, your block should register all the icons it needs with the given IconRegister. This is ++ * the only chance you get to register icons. ++ */ ++ public void registerIcons(IconRegister par1IconRegister) { ++ this.blockIcon = par1IconRegister.registerIcon(this.getTextureName() + "_side"); ++ this.theIcon = par1IconRegister.registerIcon(this.getTextureName() + "_top"); + } + ++ /** ++ * If this returns true, then comparators facing away from this block will use the value from ++ * getComparatorInputOverride instead of the actual redstone signal strength. ++ */ + public boolean hasComparatorInputOverride() { + return true; + } + +- public int getComparatorInputOverride(World var1, int var2, int var3, int var4, int var5) { +- ItemStack var6 = ((TileEntityRecordPlayer)var1.getBlockTileEntity(var2, var3, var4)).func_96097_a(); ++ /** ++ * If hasComparatorInputOverride returns true, the return value from this is used instead of the redstone signal ++ * strength when this block inputs to a comparator. ++ */ ++ public int getComparatorInputOverride(World par1World, int par2, int par3, int par4, int par5) { ++ ItemStack var6 = ((TileEntityRecordPlayer)par1World.getBlockTileEntity(par2, par3, par4)).func_96097_a(); + return var6 == null ? 0 : var6.itemID + 1 - Item.record13.itemID; + } + } diff --git a/patches/net/minecraft/src/BlockLadder.java.patch b/patches/net/minecraft/src/BlockLadder.java.patch new file mode 100644 index 0000000..57e37f6 --- /dev/null +++ b/patches/net/minecraft/src/BlockLadder.java.patch @@ -0,0 +1,207 @@ +--- net/minecraft/src/BlockLadder.java ++++ net/minecraft/src/BlockLadder.java +@@ -3,110 +3,148 @@ + import java.util.Random; + + public class BlockLadder extends Block { +- protected BlockLadder(int var1) { +- super(var1, Material.circuits); ++ protected BlockLadder(int par1) { ++ super(par1, Material.circuits); + this.setCreativeTab(CreativeTabs.tabDecorations); + } + +- public AxisAlignedBB getCollisionBoundingBoxFromPool(World var1, int var2, int var3, int var4) { +- this.setBlockBoundsBasedOnState(var1, var2, var3, var4); +- return super.getCollisionBoundingBoxFromPool(var1, var2, var3, var4); +- } +- +- public AxisAlignedBB getSelectedBoundingBoxFromPool(World var1, int var2, int var3, int var4) { +- this.setBlockBoundsBasedOnState(var1, var2, var3, var4); +- return super.getSelectedBoundingBoxFromPool(var1, var2, var3, var4); +- } +- +- public void setBlockBoundsBasedOnState(IBlockAccess var1, int var2, int var3, int var4) { +- this.updateLadderBounds(var1.getBlockMetadata(var2, var3, var4)); +- } +- +- public void updateLadderBounds(int var1) { +- float var3 = 2.0F / 16.0F; +- if(var1 == 2) { ++ /** ++ * Returns a bounding box from the pool of bounding boxes (this means this box can change after the pool has been ++ * cleared to be reused) ++ */ ++ public AxisAlignedBB getCollisionBoundingBoxFromPool(World par1World, int par2, int par3, int par4) { ++ this.setBlockBoundsBasedOnState(par1World, par2, par3, par4); ++ return super.getCollisionBoundingBoxFromPool(par1World, par2, par3, par4); ++ } ++ ++ /** ++ * Returns the bounding box of the wired rectangular prism to render. ++ */ ++ public AxisAlignedBB getSelectedBoundingBoxFromPool(World par1World, int par2, int par3, int par4) { ++ this.setBlockBoundsBasedOnState(par1World, par2, par3, par4); ++ return super.getSelectedBoundingBoxFromPool(par1World, par2, par3, par4); ++ } ++ ++ /** ++ * Updates the blocks bounds based on its current state. Args: world, x, y, z ++ */ ++ public void setBlockBoundsBasedOnState(IBlockAccess par1IBlockAccess, int par2, int par3, int par4) { ++ this.updateLadderBounds(par1IBlockAccess.getBlockMetadata(par2, par3, par4)); ++ } ++ ++ /** ++ * Update the ladder block bounds based on the given metadata value. ++ */ ++ public void updateLadderBounds(int par1) { ++ float var3 = 0.125F; ++ ++ if (par1 == 2) { + this.setBlockBounds(0.0F, 0.0F, 1.0F - var3, 1.0F, 1.0F, 1.0F); + } + +- if(var1 == 3) { ++ if (par1 == 3) { + this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, var3); + } + +- if(var1 == 4) { ++ if (par1 == 4) { + this.setBlockBounds(1.0F - var3, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F); + } + +- if(var1 == 5) { ++ if (par1 == 5) { + this.setBlockBounds(0.0F, 0.0F, 0.0F, var3, 1.0F, 1.0F); + } +- + } + ++ /** ++ * Is this block (a) opaque and (b) a full 1m cube? This determines whether or not to render the shared face of two ++ * adjacent blocks and also whether the player can attach torches, redstone wire, etc to this block. ++ */ + public boolean isOpaqueCube() { + return false; + } + ++ /** ++ * If this block doesn't render as an ordinary block it will return False (examples: signs, buttons, stairs, etc) ++ */ + public boolean renderAsNormalBlock() { + return false; + } + ++ /** ++ * The type of render function that is called for this block ++ */ + public int getRenderType() { + return 8; + } + +- public boolean canPlaceBlockAt(World var1, int var2, int var3, int var4) { +- return var1.isBlockNormalCube(var2 - 1, var3, var4) ? true : (var1.isBlockNormalCube(var2 + 1, var3, var4) ? true : (var1.isBlockNormalCube(var2, var3, var4 - 1) ? true : var1.isBlockNormalCube(var2, var3, var4 + 1))); ++ /** ++ * Checks to see if its valid to put this block at the specified coordinates. Args: world, x, y, z ++ */ ++ public boolean canPlaceBlockAt(World par1World, int par2, int par3, int par4) { ++ return par1World.isBlockNormalCube(par2 - 1, par3, par4) ? true : (par1World.isBlockNormalCube(par2 + 1, par3, par4) ? true : (par1World.isBlockNormalCube(par2, par3, par4 - 1) ? true : par1World.isBlockNormalCube(par2, par3, par4 + 1))); + } + +- public int onBlockPlaced(World var1, int var2, int var3, int var4, int var5, float var6, float var7, float var8, int var9) { +- int var10 = var9; +- if((var9 == 0 || var5 == 2) && var1.isBlockNormalCube(var2, var3, var4 + 1)) { ++ /** ++ * Called when a block is placed using its ItemBlock. Args: World, X, Y, Z, side, hitX, hitY, hitZ, block metadata ++ */ ++ public int onBlockPlaced(World par1World, int par2, int par3, int par4, int par5, float par6, float par7, float par8, int par9) { ++ int var10 = par9; ++ ++ if ((par9 == 0 || par5 == 2) && par1World.isBlockNormalCube(par2, par3, par4 + 1)) { + var10 = 2; + } + +- if((var10 == 0 || var5 == 3) && var1.isBlockNormalCube(var2, var3, var4 - 1)) { ++ if ((var10 == 0 || par5 == 3) && par1World.isBlockNormalCube(par2, par3, par4 - 1)) { + var10 = 3; + } + +- if((var10 == 0 || var5 == 4) && var1.isBlockNormalCube(var2 + 1, var3, var4)) { ++ if ((var10 == 0 || par5 == 4) && par1World.isBlockNormalCube(par2 + 1, par3, par4)) { + var10 = 4; + } + +- if((var10 == 0 || var5 == 5) && var1.isBlockNormalCube(var2 - 1, var3, var4)) { ++ if ((var10 == 0 || par5 == 5) && par1World.isBlockNormalCube(par2 - 1, par3, par4)) { + var10 = 5; + } + + return var10; + } + +- public void onNeighborBlockChange(World var1, int var2, int var3, int var4, int var5) { +- int var6 = var1.getBlockMetadata(var2, var3, var4); ++ /** ++ * Lets the block know when one of its neighbor changes. Doesn't know which neighbor changed (coordinates passed are ++ * their own) Args: x, y, z, neighbor blockID ++ */ ++ public void onNeighborBlockChange(World par1World, int par2, int par3, int par4, int par5) { ++ int var6 = par1World.getBlockMetadata(par2, par3, par4); + boolean var7 = false; +- if(var6 == 2 && var1.isBlockNormalCube(var2, var3, var4 + 1)) { +- var7 = true; +- } +- +- if(var6 == 3 && var1.isBlockNormalCube(var2, var3, var4 - 1)) { +- var7 = true; +- } +- +- if(var6 == 4 && var1.isBlockNormalCube(var2 + 1, var3, var4)) { +- var7 = true; +- } +- +- if(var6 == 5 && var1.isBlockNormalCube(var2 - 1, var3, var4)) { +- var7 = true; +- } +- +- if(!var7) { +- this.dropBlockAsItem(var1, var2, var3, var4, var6, 0); +- var1.setBlockToAir(var2, var3, var4); +- } +- +- super.onNeighborBlockChange(var1, var2, var3, var4, var5); ++ ++ if (var6 == 2 && par1World.isBlockNormalCube(par2, par3, par4 + 1)) { ++ var7 = true; ++ } ++ ++ if (var6 == 3 && par1World.isBlockNormalCube(par2, par3, par4 - 1)) { ++ var7 = true; ++ } ++ ++ if (var6 == 4 && par1World.isBlockNormalCube(par2 + 1, par3, par4)) { ++ var7 = true; ++ } ++ ++ if (var6 == 5 && par1World.isBlockNormalCube(par2 - 1, par3, par4)) { ++ var7 = true; ++ } ++ ++ if (!var7) { ++ this.dropBlockAsItem(par1World, par2, par3, par4, var6, 0); ++ par1World.setBlockToAir(par2, par3, par4); ++ } ++ ++ super.onNeighborBlockChange(par1World, par2, par3, par4, par5); + } + +- public int quantityDropped(Random var1) { ++ /** ++ * Returns the quantity of items to drop on block destruction. ++ */ ++ public int quantityDropped(Random par1Random) { + return 1; + } + } diff --git a/patches/net/minecraft/src/BlockLeaves.java.patch b/patches/net/minecraft/src/BlockLeaves.java.patch new file mode 100644 index 0000000..5acb68a --- /dev/null +++ b/patches/net/minecraft/src/BlockLeaves.java.patch @@ -0,0 +1,495 @@ +--- net/minecraft/src/BlockLeaves.java ++++ net/minecraft/src/BlockLeaves.java +@@ -3,15 +3,21 @@ + import java.util.List; + import java.util.Random; + ++import com.prupe.mcpatcher.cc.ColorizeBlock; ++import com.prupe.mcpatcher.cc.Colorizer; ++ + public class BlockLeaves extends BlockLeavesBase { +- public static final String[] a = new String[]{"oak", "spruce", "birch", "jungle"}; +- public static final String[][] b = new String[][]{{"leaves_oak", "leaves_spruce", "leaves_birch", "leaves_jungle"}, {"leaves_oak_opaque", "leaves_spruce_opaque", "leaves_birch_opaque", "leaves_jungle_opaque"}}; ++ public static final String[] LEAF_TYPES = new String[] {"oak", "spruce", "birch", "jungle"}; ++ public static final String[][] field_94396_b = new String[][] {{"leaves_oak", "leaves_spruce", "leaves_birch", "leaves_jungle"}, {"leaves_oak_opaque", "leaves_spruce_opaque", "leaves_birch_opaque", "leaves_jungle_opaque"}}; ++ ++ ++ /** 1 for fast graphic. 0 for fancy graphics. used in iconArray. */ + private int iconType; + private Icon[][] iconArray = new Icon[2][]; + int[] adjacentTreeBlocks; + +- protected BlockLeaves(int var1) { +- super(var1, Material.leaves, false); ++ protected BlockLeaves(int par1) { ++ super(par1, Material.leaves, false); + this.setTickRandomly(true); + this.setCreativeTab(CreativeTabs.tabDecorations); + } +@@ -22,26 +28,38 @@ + return ColorizerFoliage.getFoliageColor(var1, var3); + } + +- public int getRenderColor(int var1) { +- return (var1 & 3) == 1 ? ColorizerFoliage.getFoliageColorPine() : ((var1 & 3) == 2 ? ColorizerFoliage.getFoliageColorBirch() : ColorizerFoliage.getFoliageColorBasic()); ++ /** ++ * Returns the color this block should be rendered. Used by leaves. ++ */ ++ public int getRenderColor(int par1) { ++ return (par1 & 3) == 1 ? ColorizerFoliage.getFoliageColorPine() : ((par1 & 3) == 2 ? ColorizerFoliage.getFoliageColorBirch() : ColorizerFoliage.getFoliageColorBasic()); + } + +- public int colorMultiplier(IBlockAccess var1, int var2, int var3, int var4) { +- int var5 = var1.getBlockMetadata(var2, var3, var4); +- if((var5 & 3) == 1) { +- return ColorizerFoliage.getFoliageColorPine(); +- } else if((var5 & 3) == 2) { +- return ColorizerFoliage.getFoliageColorBirch(); ++ /** ++ * Returns a integer with hex for 0xrrggbb with this color multiplied against the blocks color. Note only called when ++ * first determining what to render. ++ */ ++ public int colorMultiplier(IBlockAccess par1IBlockAccess, int par2, int par3, int par4) { ++ int var5 = par1IBlockAccess.getBlockMetadata(par2, par3, par4); ++ ++ if ((var5 & 3) == 1) { ++ // MCPatcher Start ++ return ColorizeBlock.colorizeBiomeWithBlending(ColorizerFoliage.getFoliageColorPine(), Colorizer.COLOR_MAP_PINE, par2, par3, par4); ++ // MCPatcher End ++ } else if ((var5 & 3) == 2) { ++ // MCPatcher Start ++ return ColorizeBlock.colorizeBiomeWithBlending(ColorizerFoliage.getFoliageColorBirch(), Colorizer.COLOR_MAP_BIRCH, par2, par3, par4); ++ // MCPatcher End + } else { + int var6 = 0; + int var7 = 0; + int var8 = 0; + +- for(int var9 = -1; var9 <= 1; ++var9) { +- for(int var10 = -1; var10 <= 1; ++var10) { +- int var11 = var1.getBiomeGenForCoords(var2 + var10, var4 + var9).getBiomeFoliageColor(); ++ for (int var9 = -1; var9 <= 1; ++var9) { ++ for (int var10 = -1; var10 <= 1; ++var10) { ++ int var11 = par1IBlockAccess.getBiomeGenForCoords(par2 + var10, par4 + var9).getBiomeFoliageColor(); + var6 += (var11 & 16711680) >> 16; +- var7 += (var11 & '\uff00') >> 8; ++ var7 += (var11 & 65280) >> 8; + var8 += var11 & 255; + } + } +@@ -50,222 +68,260 @@ + } + } + +- public void breakBlock(World var1, int var2, int var3, int var4, int var5, int var6) { ++ /** ++ * Called on server worlds only when the block has been replaced by a different block ID, or the same block with a ++ * different metadata value, but before the new metadata value is set. Args: World, x, y, z, old block ID, old metadata ++ */ ++ public void breakBlock(World par1World, int par2, int par3, int par4, int par5, int par6) { + byte var7 = 1; + int var8 = var7 + 1; +- if(var1.checkChunksExist(var2 - var8, var3 - var8, var4 - var8, var2 + var8, var3 + var8, var4 + var8)) { +- for(int var9 = -var7; var9 <= var7; ++var9) { +- for(int var10 = -var7; var10 <= var7; ++var10) { +- for(int var11 = -var7; var11 <= var7; ++var11) { +- int var12 = var1.getBlockId(var2 + var9, var3 + var10, var4 + var11); +- if(var12 == Block.leaves.blockID) { +- int var13 = var1.getBlockMetadata(var2 + var9, var3 + var10, var4 + var11); +- var1.setBlockMetadata(var2 + var9, var3 + var10, var4 + var11, var13 | 8, 4); ++ ++ if (par1World.checkChunksExist(par2 - var8, par3 - var8, par4 - var8, par2 + var8, par3 + var8, par4 + var8)) { ++ for (int var9 = -var7; var9 <= var7; ++var9) { ++ for (int var10 = -var7; var10 <= var7; ++var10) { ++ for (int var11 = -var7; var11 <= var7; ++var11) { ++ int var12 = par1World.getBlockId(par2 + var9, par3 + var10, par4 + var11); ++ ++ if (var12 == Block.leaves.blockID) { ++ int var13 = par1World.getBlockMetadata(par2 + var9, par3 + var10, par4 + var11); ++ par1World.setBlockMetadataWithNotify(par2 + var9, par3 + var10, par4 + var11, var13 | 8, 4); + } + } + } + } + } +- + } + +- public void updateTick(World var1, int var2, int var3, int var4, Random var5) { +- if(!var1.isRemote) { +- int var6 = var1.getBlockMetadata(var2, var3, var4); +- if((var6 & 8) != 0 && (var6 & 4) == 0) { ++ /** ++ * Ticks the block if it's been scheduled ++ */ ++ public void updateTick(World par1World, int par2, int par3, int par4, Random par5Random) { ++ if (!par1World.isRemote) { ++ int var6 = par1World.getBlockMetadata(par2, par3, par4); ++ ++ if ((var6 & 8) != 0 && (var6 & 4) == 0) { + byte var7 = 4; + int var8 = var7 + 1; + byte var9 = 32; + int var10 = var9 * var9; + int var11 = var9 / 2; +- if(this.adjacentTreeBlocks == null) { ++ ++ if (this.adjacentTreeBlocks == null) { + this.adjacentTreeBlocks = new int[var9 * var9 * var9]; + } + + int var12; +- if(var1.checkChunksExist(var2 - var8, var3 - var8, var4 - var8, var2 + var8, var3 + var8, var4 + var8)) { +- var12 = -var7; +- +- label112: +- while(true) { +- int var13; +- int var14; +- int var15; +- if(var12 > var7) { +- var12 = 1; +- +- while(true) { +- if(var12 > 4) { +- break label112; +- } +- +- for(var13 = -var7; var13 <= var7; ++var13) { +- for(var14 = -var7; var14 <= var7; ++var14) { +- for(var15 = -var7; var15 <= var7; ++var15) { +- if(this.adjacentTreeBlocks[(var13 + var11) * var10 + (var14 + var11) * var9 + var15 + var11] == var12 - 1) { +- if(this.adjacentTreeBlocks[(var13 + var11 - 1) * var10 + (var14 + var11) * var9 + var15 + var11] == -2) { +- this.adjacentTreeBlocks[(var13 + var11 - 1) * var10 + (var14 + var11) * var9 + var15 + var11] = var12; +- } +- +- if(this.adjacentTreeBlocks[(var13 + var11 + 1) * var10 + (var14 + var11) * var9 + var15 + var11] == -2) { +- this.adjacentTreeBlocks[(var13 + var11 + 1) * var10 + (var14 + var11) * var9 + var15 + var11] = var12; +- } +- +- if(this.adjacentTreeBlocks[(var13 + var11) * var10 + (var14 + var11 - 1) * var9 + var15 + var11] == -2) { +- this.adjacentTreeBlocks[(var13 + var11) * var10 + (var14 + var11 - 1) * var9 + var15 + var11] = var12; +- } +- +- if(this.adjacentTreeBlocks[(var13 + var11) * var10 + (var14 + var11 + 1) * var9 + var15 + var11] == -2) { +- this.adjacentTreeBlocks[(var13 + var11) * var10 + (var14 + var11 + 1) * var9 + var15 + var11] = var12; +- } +- +- if(this.adjacentTreeBlocks[(var13 + var11) * var10 + (var14 + var11) * var9 + (var15 + var11 - 1)] == -2) { +- this.adjacentTreeBlocks[(var13 + var11) * var10 + (var14 + var11) * var9 + (var15 + var11 - 1)] = var12; +- } +- +- if(this.adjacentTreeBlocks[(var13 + var11) * var10 + (var14 + var11) * var9 + var15 + var11 + 1] == -2) { +- this.adjacentTreeBlocks[(var13 + var11) * var10 + (var14 + var11) * var9 + var15 + var11 + 1] = var12; +- } +- } +- } +- } +- } +- +- ++var12; +- } +- } +- +- for(var13 = -var7; var13 <= var7; ++var13) { +- for(var14 = -var7; var14 <= var7; ++var14) { +- var15 = var1.getBlockId(var2 + var12, var3 + var13, var4 + var14); +- if(var15 == Block.wood.blockID) { ++ ++ if (par1World.checkChunksExist(par2 - var8, par3 - var8, par4 - var8, par2 + var8, par3 + var8, par4 + var8)) { ++ int var13; ++ int var14; ++ int var15; ++ ++ for (var12 = -var7; var12 <= var7; ++var12) { ++ for (var13 = -var7; var13 <= var7; ++var13) { ++ for (var14 = -var7; var14 <= var7; ++var14) { ++ var15 = par1World.getBlockId(par2 + var12, par3 + var13, par4 + var14); ++ ++ if (var15 == Block.wood.blockID) { + this.adjacentTreeBlocks[(var12 + var11) * var10 + (var13 + var11) * var9 + var14 + var11] = 0; +- } else if(var15 == Block.leaves.blockID) { ++ } else if (var15 == Block.leaves.blockID) { + this.adjacentTreeBlocks[(var12 + var11) * var10 + (var13 + var11) * var9 + var14 + var11] = -2; + } else { + this.adjacentTreeBlocks[(var12 + var11) * var10 + (var13 + var11) * var9 + var14 + var11] = -1; + } + } + } +- +- ++var12; ++ } ++ ++ for (var12 = 1; var12 <= 4; ++var12) { ++ for (var13 = -var7; var13 <= var7; ++var13) { ++ for (var14 = -var7; var14 <= var7; ++var14) { ++ for (var15 = -var7; var15 <= var7; ++var15) { ++ if (this.adjacentTreeBlocks[(var13 + var11) * var10 + (var14 + var11) * var9 + var15 + var11] == var12 - 1) { ++ if (this.adjacentTreeBlocks[(var13 + var11 - 1) * var10 + (var14 + var11) * var9 + var15 + var11] == -2) { ++ this.adjacentTreeBlocks[(var13 + var11 - 1) * var10 + (var14 + var11) * var9 + var15 + var11] = var12; ++ } ++ ++ if (this.adjacentTreeBlocks[(var13 + var11 + 1) * var10 + (var14 + var11) * var9 + var15 + var11] == -2) { ++ this.adjacentTreeBlocks[(var13 + var11 + 1) * var10 + (var14 + var11) * var9 + var15 + var11] = var12; ++ } ++ ++ if (this.adjacentTreeBlocks[(var13 + var11) * var10 + (var14 + var11 - 1) * var9 + var15 + var11] == -2) { ++ this.adjacentTreeBlocks[(var13 + var11) * var10 + (var14 + var11 - 1) * var9 + var15 + var11] = var12; ++ } ++ ++ if (this.adjacentTreeBlocks[(var13 + var11) * var10 + (var14 + var11 + 1) * var9 + var15 + var11] == -2) { ++ this.adjacentTreeBlocks[(var13 + var11) * var10 + (var14 + var11 + 1) * var9 + var15 + var11] = var12; ++ } ++ ++ if (this.adjacentTreeBlocks[(var13 + var11) * var10 + (var14 + var11) * var9 + (var15 + var11 - 1)] == -2) { ++ this.adjacentTreeBlocks[(var13 + var11) * var10 + (var14 + var11) * var9 + (var15 + var11 - 1)] = var12; ++ } ++ ++ if (this.adjacentTreeBlocks[(var13 + var11) * var10 + (var14 + var11) * var9 + var15 + var11 + 1] == -2) { ++ this.adjacentTreeBlocks[(var13 + var11) * var10 + (var14 + var11) * var9 + var15 + var11 + 1] = var12; ++ } ++ } ++ } ++ } ++ } + } + } + + var12 = this.adjacentTreeBlocks[var11 * var10 + var11 * var9 + var11]; +- if(var12 >= 0) { +- var1.setBlockMetadata(var2, var3, var4, var6 & -9, 4); ++ ++ if (var12 >= 0) { ++ par1World.setBlockMetadataWithNotify(par2, par3, par4, var6 & -9, 4); + } else { +- this.removeLeaves(var1, var2, var3, var4); ++ this.removeLeaves(par1World, par2, par3, par4); + } + } +- +- } +- } +- +- public void randomDisplayTick(World var1, int var2, int var3, int var4, Random var5) { +- if(var1.canLightningStrikeAt(var2, var3 + 1, var4) && !var1.doesBlockHaveSolidTopSurface(var2, var3 - 1, var4) && var5.nextInt(15) == 1) { +- double var6 = (double)((float)var2 + var5.nextFloat()); +- double var8 = (double)var3 - 0.05D; +- double var10 = (double)((float)var4 + var5.nextFloat()); +- var1.spawnParticle("dripWater", var6, var8, var10, 0.0D, 0.0D, 0.0D); +- } +- +- } +- +- private void removeLeaves(World var1, int var2, int var3, int var4) { +- this.dropBlockAsItem(var1, var2, var3, var4, var1.getBlockMetadata(var2, var3, var4), 0); +- var1.setBlockToAir(var2, var3, var4); +- } +- +- public int quantityDropped(Random var1) { +- return var1.nextInt(20) == 0 ? 1 : 0; +- } +- +- public int idDropped(int var1, Random var2, int var3) { ++ } ++ } ++ ++ /** ++ * A randomly called display update to be able to add particles or other items for display ++ */ ++ public void randomDisplayTick(World par1World, int par2, int par3, int par4, Random par5Random) { ++ if (par1World.canLightningStrikeAt(par2, par3 + 1, par4) && !par1World.doesBlockHaveSolidTopSurface(par2, par3 - 1, par4) && par5Random.nextInt(15) == 1) { ++ double var6 = (double)((float)par2 + par5Random.nextFloat()); ++ double var8 = (double)par3 - 0.05D; ++ double var10 = (double)((float)par4 + par5Random.nextFloat()); ++ par1World.spawnParticle("dripWater", var6, var8, var10, 0.0D, 0.0D, 0.0D); ++ } ++ } ++ ++ private void removeLeaves(World par1World, int par2, int par3, int par4) { ++ this.dropBlockAsItem(par1World, par2, par3, par4, par1World.getBlockMetadata(par2, par3, par4), 0); ++ par1World.setBlockToAir(par2, par3, par4); ++ } ++ ++ /** ++ * Returns the quantity of items to drop on block destruction. ++ */ ++ public int quantityDropped(Random par1Random) { ++ return par1Random.nextInt(20) == 0 ? 1 : 0; ++ } ++ ++ /** ++ * Returns the ID of the items to drop on destruction. ++ */ ++ public int idDropped(int par1, Random par2Random, int par3) { + return Block.sapling.blockID; + } + +- public void dropBlockAsItemWithChance(World var1, int var2, int var3, int var4, int var5, float var6, int var7) { +- if(!var1.isRemote) { ++ /** ++ * Drops the block items with a specified chance of dropping the specified items ++ */ ++ public void dropBlockAsItemWithChance(World par1World, int par2, int par3, int par4, int par5, float par6, int par7) { ++ if (!par1World.isRemote) { + int var8 = 20; +- if((var5 & 3) == 3) { ++ ++ if ((par5 & 3) == 3) { + var8 = 40; + } + +- if(var7 > 0) { +- var8 -= 2 << var7; +- if(var8 < 10) { ++ if (par7 > 0) { ++ var8 -= 2 << par7; ++ ++ if (var8 < 10) { + var8 = 10; + } + } + +- if(var1.s.nextInt(var8) == 0) { +- int var9 = this.idDropped(var5, var1.s, var7); +- this.dropBlockAsItem_do(var1, var2, var3, var4, new ItemStack(var9, 1, this.damageDropped(var5))); ++ if (par1World.rand.nextInt(var8) == 0) { ++ int var9 = this.idDropped(par5, par1World.rand, par7); ++ this.dropBlockAsItem_do(par1World, par2, par3, par4, new ItemStack(var9, 1, this.damageDropped(par5))); + } + + var8 = 200; +- if(var7 > 0) { +- var8 -= 10 << var7; +- if(var8 < 40) { ++ ++ if (par7 > 0) { ++ var8 -= 10 << par7; ++ ++ if (var8 < 40) { + var8 = 40; + } + } + +- if((var5 & 3) == 0 && var1.s.nextInt(var8) == 0) { +- this.dropBlockAsItem_do(var1, var2, var3, var4, new ItemStack(Item.appleRed, 1, 0)); ++ if ((par5 & 3) == 0 && par1World.rand.nextInt(var8) == 0) { ++ this.dropBlockAsItem_do(par1World, par2, par3, par4, new ItemStack(Item.appleRed, 1, 0)); + } + } +- + } + +- public void harvestBlock(World var1, EntityPlayer var2, int var3, int var4, int var5, int var6) { +- if(!var1.isRemote && var2.getCurrentEquippedItem() != null && var2.getCurrentEquippedItem().itemID == Item.shears.itemID) { +- var2.addStat(StatList.mineBlockStatArray[this.blockID], 1); +- this.dropBlockAsItem_do(var1, var3, var4, var5, new ItemStack(Block.leaves.blockID, 1, var6 & 3)); ++ /** ++ * Called when the player destroys a block with an item that can harvest it. (i, j, k) are the coordinates of the block ++ * and l is the block's subtype/damage. ++ */ ++ public void harvestBlock(World par1World, EntityPlayer par2EntityPlayer, int par3, int par4, int par5, int par6) { ++ if (!par1World.isRemote && par2EntityPlayer.getCurrentEquippedItem() != null && par2EntityPlayer.getCurrentEquippedItem().itemID == Item.shears.itemID) { ++ par2EntityPlayer.addStat(StatList.mineBlockStatArray[this.blockID], 1); ++ this.dropBlockAsItem_do(par1World, par3, par4, par5, new ItemStack(Block.leaves.blockID, 1, par6 & 3)); + } else { +- super.harvestBlock(var1, var2, var3, var4, var5, var6); ++ super.harvestBlock(par1World, par2EntityPlayer, par3, par4, par5, par6); + } +- +- } +- +- public int damageDropped(int var1) { +- return var1 & 3; +- } +- ++ } ++ ++ /** ++ * Determines the damage on the item the block drops. Used in cloth and wood. ++ */ ++ public int damageDropped(int par1) { ++ return par1 & 3; ++ } ++ ++ /** ++ * Is this block (a) opaque and (b) a full 1m cube? This determines whether or not to render the shared face of two ++ * adjacent blocks and also whether the player can attach torches, redstone wire, etc to this block. ++ */ + public boolean isOpaqueCube() { + return !this.graphicsLevel; + } + +- public Icon getIcon(int var1, int var2) { +- return (var2 & 3) == 1 ? this.iconArray[this.iconType][1] : ((var2 & 3) == 3 ? this.iconArray[this.iconType][3] : ((var2 & 3) == 2 ? this.iconArray[this.iconType][2] : this.iconArray[this.iconType][0])); +- } +- +- public void setGraphicsLevel(boolean var1) { +- this.graphicsLevel = var1; +- this.iconType = var1 ? 0 : 1; +- } +- +- public void getSubBlocks(int var1, CreativeTabs var2, List var3) { +- var3.add(new ItemStack(var1, 1, 0)); +- var3.add(new ItemStack(var1, 1, 1)); +- var3.add(new ItemStack(var1, 1, 2)); +- var3.add(new ItemStack(var1, 1, 3)); +- } +- +- protected ItemStack createStackedBlock(int var1) { +- return new ItemStack(this.blockID, 1, var1 & 3); +- } +- +- public void registerIcons(IconRegister var1) { +- for(int var2 = 0; var2 < b.length; ++var2) { +- this.iconArray[var2] = new Icon[b[var2].length]; +- +- for(int var3 = 0; var3 < b[var2].length; ++var3) { +- this.iconArray[var2][var3] = var1.registerIcon(b[var2][var3]); ++ /** ++ * From the specified side and block metadata retrieves the blocks texture. Args: side, metadata ++ */ ++ public Icon getIcon(int par1, int par2) { ++ return (par2 & 3) == 1 ? this.iconArray[this.iconType][1] : ((par2 & 3) == 3 ? this.iconArray[this.iconType][3] : ((par2 & 3) == 2 ? this.iconArray[this.iconType][2] : this.iconArray[this.iconType][0])); ++ } ++ ++ /** ++ * Pass true to draw this block using fancy graphics, or false for fast graphics. ++ */ ++ public void setGraphicsLevel(boolean par1) { ++ this.graphicsLevel = par1; ++ this.iconType = par1 ? 0 : 1; ++ } ++ ++ /** ++ * returns a list of blocks with the same ID, but different meta (eg: wood returns 4 blocks) ++ */ ++ public void getSubBlocks(int par1, CreativeTabs par2CreativeTabs, List par3List) { ++ par3List.add(new ItemStack(par1, 1, 0)); ++ par3List.add(new ItemStack(par1, 1, 1)); ++ par3List.add(new ItemStack(par1, 1, 2)); ++ par3List.add(new ItemStack(par1, 1, 3)); ++ } ++ ++ /** ++ * Returns an item stack containing a single instance of the current block type. 'i' is the block's subtype/damage and ++ * is ignored for blocks which do not support subtypes. Blocks which cannot be harvested should return null. ++ */ ++ protected ItemStack createStackedBlock(int par1) { ++ return new ItemStack(this.blockID, 1, par1 & 3); ++ } ++ ++ /** ++ * When this method is called, your block should register all the icons it needs with the given IconRegister. This is ++ * the only chance you get to register icons. ++ */ ++ public void registerIcons(IconRegister par1IconRegister) { ++ for (int var2 = 0; var2 < field_94396_b.length; ++var2) { ++ this.iconArray[var2] = new Icon[field_94396_b[var2].length]; ++ ++ for (int var3 = 0; var3 < field_94396_b[var2].length; ++var3) { ++ this.iconArray[var2][var3] = par1IconRegister.registerIcon(field_94396_b[var2][var3]); + } + } +- + } + } diff --git a/patches/net/minecraft/src/BlockLeavesBase.java.patch b/patches/net/minecraft/src/BlockLeavesBase.java.patch new file mode 100644 index 0000000..0f34eac --- /dev/null +++ b/patches/net/minecraft/src/BlockLeavesBase.java.patch @@ -0,0 +1,41 @@ +--- net/minecraft/src/BlockLeavesBase.java ++++ net/minecraft/src/BlockLeavesBase.java +@@ -1,19 +1,32 @@ + package net.minecraft.src; + + public class BlockLeavesBase extends Block { ++ ++ /** ++ * Used to determine how to display leaves based on the graphics level. May also be used in rendering for transparency, ++ * not sure. ++ */ + protected boolean graphicsLevel; + +- protected BlockLeavesBase(int var1, Material var2, boolean var3) { +- super(var1, var2); +- this.graphicsLevel = var3; ++ protected BlockLeavesBase(int par1, Material par2Material, boolean par3) { ++ super(par1, par2Material); ++ this.graphicsLevel = par3; + } + ++ /** ++ * Is this block (a) opaque and (b) a full 1m cube? This determines whether or not to render the shared face of two ++ * adjacent blocks and also whether the player can attach torches, redstone wire, etc to this block. ++ */ + public boolean isOpaqueCube() { + return false; + } + +- public boolean shouldSideBeRendered(IBlockAccess var1, int var2, int var3, int var4, int var5) { +- int var6 = var1.getBlockId(var2, var3, var4); +- return !this.graphicsLevel && var6 == this.blockID ? false : super.shouldSideBeRendered(var1, var2, var3, var4, var5); ++ /** ++ * Returns true if the given side of this block type should be rendered, if the adjacent block is at the given ++ * coordinates. Args: blockAccess, x, y, z, side ++ */ ++ public boolean shouldSideBeRendered(IBlockAccess par1IBlockAccess, int par2, int par3, int par4, int par5) { ++ int var6 = par1IBlockAccess.getBlockId(par2, par3, par4); ++ return !this.graphicsLevel && var6 == this.blockID ? false : super.shouldSideBeRendered(par1IBlockAccess, par2, par3, par4, par5); + } + } diff --git a/patches/net/minecraft/src/BlockLever.java.patch b/patches/net/minecraft/src/BlockLever.java.patch new file mode 100644 index 0000000..76e55e5 --- /dev/null +++ b/patches/net/minecraft/src/BlockLever.java.patch @@ -0,0 +1,477 @@ +--- net/minecraft/src/BlockLever.java ++++ net/minecraft/src/BlockLever.java +@@ -1,172 +1,220 @@ + package net.minecraft.src; + + public class BlockLever extends Block { +- protected BlockLever(int var1) { +- super(var1, Material.circuits); ++ protected BlockLever(int par1) { ++ super(par1, Material.circuits); + this.setCreativeTab(CreativeTabs.tabRedstone); + } + +- public AxisAlignedBB getCollisionBoundingBoxFromPool(World var1, int var2, int var3, int var4) { ++ /** ++ * Returns a bounding box from the pool of bounding boxes (this means this box can change after the pool has been ++ * cleared to be reused) ++ */ ++ public AxisAlignedBB getCollisionBoundingBoxFromPool(World par1World, int par2, int par3, int par4) { + return null; + } + ++ /** ++ * Is this block (a) opaque and (b) a full 1m cube? This determines whether or not to render the shared face of two ++ * adjacent blocks and also whether the player can attach torches, redstone wire, etc to this block. ++ */ + public boolean isOpaqueCube() { + return false; + } + ++ /** ++ * If this block doesn't render as an ordinary block it will return False (examples: signs, buttons, stairs, etc) ++ */ + public boolean renderAsNormalBlock() { + return false; + } + ++ /** ++ * The type of render function that is called for this block ++ */ + public int getRenderType() { + return 12; + } + +- public boolean canPlaceBlockOnSide(World var1, int var2, int var3, int var4, int var5) { +- return var5 == 0 && var1.isBlockNormalCube(var2, var3 + 1, var4) ? true : (var5 == 1 && var1.doesBlockHaveSolidTopSurface(var2, var3 - 1, var4) ? true : (var5 == 2 && var1.isBlockNormalCube(var2, var3, var4 + 1) ? true : (var5 == 3 && var1.isBlockNormalCube(var2, var3, var4 - 1) ? true : (var5 == 4 && var1.isBlockNormalCube(var2 + 1, var3, var4) ? true : var5 == 5 && var1.isBlockNormalCube(var2 - 1, var3, var4))))); +- } +- +- public boolean canPlaceBlockAt(World var1, int var2, int var3, int var4) { +- return var1.isBlockNormalCube(var2 - 1, var3, var4) ? true : (var1.isBlockNormalCube(var2 + 1, var3, var4) ? true : (var1.isBlockNormalCube(var2, var3, var4 - 1) ? true : (var1.isBlockNormalCube(var2, var3, var4 + 1) ? true : (var1.doesBlockHaveSolidTopSurface(var2, var3 - 1, var4) ? true : var1.isBlockNormalCube(var2, var3 + 1, var4))))); +- } +- +- public int onBlockPlaced(World var1, int var2, int var3, int var4, int var5, float var6, float var7, float var8, int var9) { +- int var11 = var9 & 8; +- int var10 = var9 & 7; ++ /** ++ * checks to see if you can place this block can be placed on that side of a block: BlockLever overrides ++ */ ++ public boolean canPlaceBlockOnSide(World par1World, int par2, int par3, int par4, int par5) { ++ return par5 == 0 && par1World.isBlockNormalCube(par2, par3 + 1, par4) ? true : (par5 == 1 && par1World.doesBlockHaveSolidTopSurface(par2, par3 - 1, par4) ? true : (par5 == 2 && par1World.isBlockNormalCube(par2, par3, par4 + 1) ? true : (par5 == 3 && par1World.isBlockNormalCube(par2, par3, par4 - 1) ? true : (par5 == 4 && par1World.isBlockNormalCube(par2 + 1, par3, par4) ? true : par5 == 5 && par1World.isBlockNormalCube(par2 - 1, par3, par4))))); ++ } ++ ++ /** ++ * Checks to see if its valid to put this block at the specified coordinates. Args: world, x, y, z ++ */ ++ public boolean canPlaceBlockAt(World par1World, int par2, int par3, int par4) { ++ return par1World.isBlockNormalCube(par2 - 1, par3, par4) ? true : (par1World.isBlockNormalCube(par2 + 1, par3, par4) ? true : (par1World.isBlockNormalCube(par2, par3, par4 - 1) ? true : (par1World.isBlockNormalCube(par2, par3, par4 + 1) ? true : (par1World.doesBlockHaveSolidTopSurface(par2, par3 - 1, par4) ? true : par1World.isBlockNormalCube(par2, par3 + 1, par4))))); ++ } ++ ++ /** ++ * Called when a block is placed using its ItemBlock. Args: World, X, Y, Z, side, hitX, hitY, hitZ, block metadata ++ */ ++ public int onBlockPlaced(World par1World, int par2, int par3, int par4, int par5, float par6, float par7, float par8, int par9) { ++ int var11 = par9 & 8; ++ int var10 = par9 & 7; + byte var12 = -1; +- if(var5 == 0 && var1.isBlockNormalCube(var2, var3 + 1, var4)) { ++ ++ if (par5 == 0 && par1World.isBlockNormalCube(par2, par3 + 1, par4)) { + var12 = 0; + } + +- if(var5 == 1 && var1.doesBlockHaveSolidTopSurface(var2, var3 - 1, var4)) { ++ if (par5 == 1 && par1World.doesBlockHaveSolidTopSurface(par2, par3 - 1, par4)) { + var12 = 5; + } + +- if(var5 == 2 && var1.isBlockNormalCube(var2, var3, var4 + 1)) { ++ if (par5 == 2 && par1World.isBlockNormalCube(par2, par3, par4 + 1)) { + var12 = 4; + } + +- if(var5 == 3 && var1.isBlockNormalCube(var2, var3, var4 - 1)) { ++ if (par5 == 3 && par1World.isBlockNormalCube(par2, par3, par4 - 1)) { + var12 = 3; + } + +- if(var5 == 4 && var1.isBlockNormalCube(var2 + 1, var3, var4)) { ++ if (par5 == 4 && par1World.isBlockNormalCube(par2 + 1, par3, par4)) { + var12 = 2; + } + +- if(var5 == 5 && var1.isBlockNormalCube(var2 - 1, var3, var4)) { ++ if (par5 == 5 && par1World.isBlockNormalCube(par2 - 1, par3, par4)) { + var12 = 1; + } + + return var12 + var11; + } + +- public void onBlockPlacedBy(World var1, int var2, int var3, int var4, EntityLivingBase var5, ItemStack var6) { +- int var7 = var1.getBlockMetadata(var2, var3, var4); ++ /** ++ * Called when the block is placed in the world. ++ */ ++ public void onBlockPlacedBy(World par1World, int par2, int par3, int par4, EntityLivingBase par5EntityLivingBase, ItemStack par6ItemStack) { ++ int var7 = par1World.getBlockMetadata(par2, par3, par4); + int var8 = var7 & 7; + int var9 = var7 & 8; +- if(var8 == invertMetadata(1)) { +- if((MathHelper.floor_double((double)(var5.rotationYaw * 4.0F / 360.0F) + 0.5D) & 1) == 0) { +- var1.setBlockMetadata(var2, var3, var4, 5 | var9, 2); +- } else { +- var1.setBlockMetadata(var2, var3, var4, 6 | var9, 2); +- } +- } else if(var8 == invertMetadata(0)) { +- if((MathHelper.floor_double((double)(var5.rotationYaw * 4.0F / 360.0F) + 0.5D) & 1) == 0) { +- var1.setBlockMetadata(var2, var3, var4, 7 | var9, 2); +- } else { +- var1.setBlockMetadata(var2, var3, var4, 0 | var9, 2); +- } +- } +- +- } +- +- public static int invertMetadata(int var0) { +- switch(var0) { +- case 0: +- return 0; +- case 1: +- return 5; +- case 2: +- return 4; +- case 3: +- return 3; +- case 4: +- return 2; +- case 5: +- return 1; +- default: +- return -1; +- } +- } +- +- public void onNeighborBlockChange(World var1, int var2, int var3, int var4, int var5) { +- if(this.checkIfAttachedToBlock(var1, var2, var3, var4)) { +- int var6 = var1.getBlockMetadata(var2, var3, var4) & 7; ++ ++ if (var8 == invertMetadata(1)) { ++ if ((MathHelper.floor_double((double)(par5EntityLivingBase.rotationYaw * 4.0F / 360.0F) + 0.5D) & 1) == 0) { ++ par1World.setBlockMetadataWithNotify(par2, par3, par4, 5 | var9, 2); ++ } else { ++ par1World.setBlockMetadataWithNotify(par2, par3, par4, 6 | var9, 2); ++ } ++ } else if (var8 == invertMetadata(0)) { ++ if ((MathHelper.floor_double((double)(par5EntityLivingBase.rotationYaw * 4.0F / 360.0F) + 0.5D) & 1) == 0) { ++ par1World.setBlockMetadataWithNotify(par2, par3, par4, 7 | var9, 2); ++ } else { ++ par1World.setBlockMetadataWithNotify(par2, par3, par4, 0 | var9, 2); ++ } ++ } ++ } ++ ++ /** ++ * only used in ComponentScatteredFeatureJunglePyramid.addComponentParts" ++ */ ++ public static int invertMetadata(int par0) { ++ switch (par0) { ++ case 0: ++ return 0; ++ ++ case 1: ++ return 5; ++ ++ case 2: ++ return 4; ++ ++ case 3: ++ return 3; ++ ++ case 4: ++ return 2; ++ ++ case 5: ++ return 1; ++ ++ default: ++ return -1; ++ } ++ } ++ ++ /** ++ * Lets the block know when one of its neighbor changes. Doesn't know which neighbor changed (coordinates passed are ++ * their own) Args: x, y, z, neighbor blockID ++ */ ++ public void onNeighborBlockChange(World par1World, int par2, int par3, int par4, int par5) { ++ if (this.checkIfAttachedToBlock(par1World, par2, par3, par4)) { ++ int var6 = par1World.getBlockMetadata(par2, par3, par4) & 7; + boolean var7 = false; +- if(!var1.isBlockNormalCube(var2 - 1, var3, var4) && var6 == 1) { +- var7 = true; +- } +- +- if(!var1.isBlockNormalCube(var2 + 1, var3, var4) && var6 == 2) { +- var7 = true; +- } +- +- if(!var1.isBlockNormalCube(var2, var3, var4 - 1) && var6 == 3) { +- var7 = true; +- } +- +- if(!var1.isBlockNormalCube(var2, var3, var4 + 1) && var6 == 4) { +- var7 = true; +- } +- +- if(!var1.doesBlockHaveSolidTopSurface(var2, var3 - 1, var4) && var6 == 5) { +- var7 = true; +- } +- +- if(!var1.doesBlockHaveSolidTopSurface(var2, var3 - 1, var4) && var6 == 6) { +- var7 = true; +- } +- +- if(!var1.isBlockNormalCube(var2, var3 + 1, var4) && var6 == 0) { +- var7 = true; +- } +- +- if(!var1.isBlockNormalCube(var2, var3 + 1, var4) && var6 == 7) { +- var7 = true; +- } +- +- if(var7) { +- this.dropBlockAsItem(var1, var2, var3, var4, var1.getBlockMetadata(var2, var3, var4), 0); +- var1.setBlockToAir(var2, var3, var4); ++ ++ if (!par1World.isBlockNormalCube(par2 - 1, par3, par4) && var6 == 1) { ++ var7 = true; ++ } ++ ++ if (!par1World.isBlockNormalCube(par2 + 1, par3, par4) && var6 == 2) { ++ var7 = true; ++ } ++ ++ if (!par1World.isBlockNormalCube(par2, par3, par4 - 1) && var6 == 3) { ++ var7 = true; ++ } ++ ++ if (!par1World.isBlockNormalCube(par2, par3, par4 + 1) && var6 == 4) { ++ var7 = true; ++ } ++ ++ if (!par1World.doesBlockHaveSolidTopSurface(par2, par3 - 1, par4) && var6 == 5) { ++ var7 = true; ++ } ++ ++ if (!par1World.doesBlockHaveSolidTopSurface(par2, par3 - 1, par4) && var6 == 6) { ++ var7 = true; ++ } ++ ++ if (!par1World.isBlockNormalCube(par2, par3 + 1, par4) && var6 == 0) { ++ var7 = true; ++ } ++ ++ if (!par1World.isBlockNormalCube(par2, par3 + 1, par4) && var6 == 7) { ++ var7 = true; ++ } ++ ++ if (var7) { ++ this.dropBlockAsItem(par1World, par2, par3, par4, par1World.getBlockMetadata(par2, par3, par4), 0); ++ par1World.setBlockToAir(par2, par3, par4); + } + } +- + } + +- private boolean checkIfAttachedToBlock(World var1, int var2, int var3, int var4) { +- if(!this.canPlaceBlockAt(var1, var2, var3, var4)) { +- this.dropBlockAsItem(var1, var2, var3, var4, var1.getBlockMetadata(var2, var3, var4), 0); +- var1.setBlockToAir(var2, var3, var4); ++ /** ++ * Checks if the block is attached to another block. If it is not, it returns false and drops the block as an item. If ++ * it is it returns true. ++ */ ++ private boolean checkIfAttachedToBlock(World par1World, int par2, int par3, int par4) { ++ if (!this.canPlaceBlockAt(par1World, par2, par3, par4)) { ++ this.dropBlockAsItem(par1World, par2, par3, par4, par1World.getBlockMetadata(par2, par3, par4), 0); ++ par1World.setBlockToAir(par2, par3, par4); + return false; + } else { + return true; + } + } + +- public void setBlockBoundsBasedOnState(IBlockAccess var1, int var2, int var3, int var4) { +- int var5 = var1.getBlockMetadata(var2, var3, var4) & 7; +- float var6 = 3.0F / 16.0F; +- if(var5 == 1) { ++ /** ++ * Updates the blocks bounds based on its current state. Args: world, x, y, z ++ */ ++ public void setBlockBoundsBasedOnState(IBlockAccess par1IBlockAccess, int par2, int par3, int par4) { ++ int var5 = par1IBlockAccess.getBlockMetadata(par2, par3, par4) & 7; ++ float var6 = 0.1875F; ++ ++ if (var5 == 1) { + this.setBlockBounds(0.0F, 0.2F, 0.5F - var6, var6 * 2.0F, 0.8F, 0.5F + var6); +- } else if(var5 == 2) { ++ } else if (var5 == 2) { + this.setBlockBounds(1.0F - var6 * 2.0F, 0.2F, 0.5F - var6, 1.0F, 0.8F, 0.5F + var6); +- } else if(var5 == 3) { ++ } else if (var5 == 3) { + this.setBlockBounds(0.5F - var6, 0.2F, 0.0F, 0.5F + var6, 0.8F, var6 * 2.0F); +- } else if(var5 == 4) { ++ } else if (var5 == 4) { + this.setBlockBounds(0.5F - var6, 0.2F, 1.0F - var6 * 2.0F, 0.5F + var6, 0.8F, 1.0F); +- } else if(var5 != 5 && var5 != 6) { +- if(var5 == 0 || var5 == 7) { ++ } else if (var5 != 5 && var5 != 6) { ++ if (var5 == 0 || var5 == 7) { + var6 = 0.25F; + this.setBlockBounds(0.5F - var6, 0.4F, 0.5F - var6, 0.5F + var6, 1.0F, 0.5F + var6); + } +@@ -174,77 +222,98 @@ + var6 = 0.25F; + this.setBlockBounds(0.5F - var6, 0.0F, 0.5F - var6, 0.5F + var6, 0.6F, 0.5F + var6); + } +- + } + +- public boolean onBlockActivated(World var1, int var2, int var3, int var4, EntityPlayer var5, int var6, float var7, float var8, float var9) { +- if(var1.isRemote) { ++ /** ++ * Called upon block activation (right click on the block.) ++ */ ++ public boolean onBlockActivated(World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer, int par6, float par7, float par8, float par9) { ++ if (par1World.isRemote) { + return true; + } else { +- int var10 = var1.getBlockMetadata(var2, var3, var4); ++ int var10 = par1World.getBlockMetadata(par2, par3, par4); + int var11 = var10 & 7; + int var12 = 8 - (var10 & 8); +- var1.setBlockMetadata(var2, var3, var4, var11 + var12, 3); +- var1.playSoundEffect((double)var2 + 0.5D, (double)var3 + 0.5D, (double)var4 + 0.5D, "random.click", 0.3F, var12 > 0 ? 0.6F : 0.5F); +- var1.notifyBlocksOfNeighborChange(var2, var3, var4, this.blockID); +- if(var11 == 1) { +- var1.notifyBlocksOfNeighborChange(var2 - 1, var3, var4, this.blockID); +- } else if(var11 == 2) { +- var1.notifyBlocksOfNeighborChange(var2 + 1, var3, var4, this.blockID); +- } else if(var11 == 3) { +- var1.notifyBlocksOfNeighborChange(var2, var3, var4 - 1, this.blockID); +- } else if(var11 == 4) { +- var1.notifyBlocksOfNeighborChange(var2, var3, var4 + 1, this.blockID); +- } else if(var11 != 5 && var11 != 6) { +- if(var11 == 0 || var11 == 7) { +- var1.notifyBlocksOfNeighborChange(var2, var3 + 1, var4, this.blockID); ++ par1World.setBlockMetadataWithNotify(par2, par3, par4, var11 + var12, 3); ++ par1World.playSoundEffect((double)par2 + 0.5D, (double)par3 + 0.5D, (double)par4 + 0.5D, "random.click", 0.3F, var12 > 0 ? 0.6F : 0.5F); ++ par1World.notifyBlocksOfNeighborChange(par2, par3, par4, this.blockID); ++ ++ if (var11 == 1) { ++ par1World.notifyBlocksOfNeighborChange(par2 - 1, par3, par4, this.blockID); ++ } else if (var11 == 2) { ++ par1World.notifyBlocksOfNeighborChange(par2 + 1, par3, par4, this.blockID); ++ } else if (var11 == 3) { ++ par1World.notifyBlocksOfNeighborChange(par2, par3, par4 - 1, this.blockID); ++ } else if (var11 == 4) { ++ par1World.notifyBlocksOfNeighborChange(par2, par3, par4 + 1, this.blockID); ++ } else if (var11 != 5 && var11 != 6) { ++ if (var11 == 0 || var11 == 7) { ++ par1World.notifyBlocksOfNeighborChange(par2, par3 + 1, par4, this.blockID); + } + } else { +- var1.notifyBlocksOfNeighborChange(var2, var3 - 1, var4, this.blockID); ++ par1World.notifyBlocksOfNeighborChange(par2, par3 - 1, par4, this.blockID); + } + + return true; + } + } + +- public void breakBlock(World var1, int var2, int var3, int var4, int var5, int var6) { +- if((var6 & 8) > 0) { +- var1.notifyBlocksOfNeighborChange(var2, var3, var4, this.blockID); +- int var7 = var6 & 7; +- if(var7 == 1) { +- var1.notifyBlocksOfNeighborChange(var2 - 1, var3, var4, this.blockID); +- } else if(var7 == 2) { +- var1.notifyBlocksOfNeighborChange(var2 + 1, var3, var4, this.blockID); +- } else if(var7 == 3) { +- var1.notifyBlocksOfNeighborChange(var2, var3, var4 - 1, this.blockID); +- } else if(var7 == 4) { +- var1.notifyBlocksOfNeighborChange(var2, var3, var4 + 1, this.blockID); +- } else if(var7 != 5 && var7 != 6) { +- if(var7 == 0 || var7 == 7) { +- var1.notifyBlocksOfNeighborChange(var2, var3 + 1, var4, this.blockID); ++ /** ++ * Called on server worlds only when the block has been replaced by a different block ID, or the same block with a ++ * different metadata value, but before the new metadata value is set. Args: World, x, y, z, old block ID, old metadata ++ */ ++ public void breakBlock(World par1World, int par2, int par3, int par4, int par5, int par6) { ++ if ((par6 & 8) > 0) { ++ par1World.notifyBlocksOfNeighborChange(par2, par3, par4, this.blockID); ++ int var7 = par6 & 7; ++ ++ if (var7 == 1) { ++ par1World.notifyBlocksOfNeighborChange(par2 - 1, par3, par4, this.blockID); ++ } else if (var7 == 2) { ++ par1World.notifyBlocksOfNeighborChange(par2 + 1, par3, par4, this.blockID); ++ } else if (var7 == 3) { ++ par1World.notifyBlocksOfNeighborChange(par2, par3, par4 - 1, this.blockID); ++ } else if (var7 == 4) { ++ par1World.notifyBlocksOfNeighborChange(par2, par3, par4 + 1, this.blockID); ++ } else if (var7 != 5 && var7 != 6) { ++ if (var7 == 0 || var7 == 7) { ++ par1World.notifyBlocksOfNeighborChange(par2, par3 + 1, par4, this.blockID); + } + } else { +- var1.notifyBlocksOfNeighborChange(var2, var3 - 1, var4, this.blockID); ++ par1World.notifyBlocksOfNeighborChange(par2, par3 - 1, par4, this.blockID); + } + } + +- super.breakBlock(var1, var2, var3, var4, var5, var6); +- } +- +- public int isProvidingWeakPower(IBlockAccess var1, int var2, int var3, int var4, int var5) { +- return (var1.getBlockMetadata(var2, var3, var4) & 8) > 0 ? 15 : 0; +- } +- +- public int isProvidingStrongPower(IBlockAccess var1, int var2, int var3, int var4, int var5) { +- int var6 = var1.getBlockMetadata(var2, var3, var4); +- if((var6 & 8) == 0) { ++ super.breakBlock(par1World, par2, par3, par4, par5, par6); ++ } ++ ++ /** ++ * Returns true if the block is emitting indirect/weak redstone power on the specified side. If isBlockNormalCube ++ * returns true, standard redstone propagation rules will apply instead and this will not be called. Args: World, X, Y, ++ * Z, side. Note that the side is reversed - eg it is 1 (up) when checking the bottom of the block. ++ */ ++ public int isProvidingWeakPower(IBlockAccess par1IBlockAccess, int par2, int par3, int par4, int par5) { ++ return (par1IBlockAccess.getBlockMetadata(par2, par3, par4) & 8) > 0 ? 15 : 0; ++ } ++ ++ /** ++ * Returns true if the block is emitting direct/strong redstone power on the specified side. Args: World, X, Y, Z, ++ * side. Note that the side is reversed - eg it is 1 (up) when checking the bottom of the block. ++ */ ++ public int isProvidingStrongPower(IBlockAccess par1IBlockAccess, int par2, int par3, int par4, int par5) { ++ int var6 = par1IBlockAccess.getBlockMetadata(par2, par3, par4); ++ ++ if ((var6 & 8) == 0) { + return 0; + } else { + int var7 = var6 & 7; +- return var7 == 0 && var5 == 0 ? 15 : (var7 == 7 && var5 == 0 ? 15 : (var7 == 6 && var5 == 1 ? 15 : (var7 == 5 && var5 == 1 ? 15 : (var7 == 4 && var5 == 2 ? 15 : (var7 == 3 && var5 == 3 ? 15 : (var7 == 2 && var5 == 4 ? 15 : (var7 == 1 && var5 == 5 ? 15 : 0))))))); ++ return var7 == 0 && par5 == 0 ? 15 : (var7 == 7 && par5 == 0 ? 15 : (var7 == 6 && par5 == 1 ? 15 : (var7 == 5 && par5 == 1 ? 15 : (var7 == 4 && par5 == 2 ? 15 : (var7 == 3 && par5 == 3 ? 15 : (var7 == 2 && par5 == 4 ? 15 : (var7 == 1 && par5 == 5 ? 15 : 0))))))); + } + } + ++ /** ++ * Can this block provide power. Only wire currently seems to have this change based on its state. ++ */ + public boolean canProvidePower() { + return true; + } diff --git a/patches/net/minecraft/src/BlockLilyPad.java.patch b/patches/net/minecraft/src/BlockLilyPad.java.patch new file mode 100644 index 0000000..70b039b --- /dev/null +++ b/patches/net/minecraft/src/BlockLilyPad.java.patch @@ -0,0 +1,107 @@ +--- net/minecraft/src/BlockLilyPad.java ++++ net/minecraft/src/BlockLilyPad.java +@@ -2,47 +2,79 @@ + + import java.util.List; + ++import com.prupe.mcpatcher.cc.ColorizeBlock; ++ + public class BlockLilyPad extends BlockFlower { +- protected BlockLilyPad(int var1) { +- super(var1); ++ protected BlockLilyPad(int par1) { ++ super(par1); + float var2 = 0.5F; + float var3 = 0.015625F; + this.setBlockBounds(0.5F - var2, 0.0F, 0.5F - var2, 0.5F + var2, var3, 0.5F + var2); + this.setCreativeTab(CreativeTabs.tabDecorations); + } + ++ /** ++ * The type of render function that is called for this block ++ */ + public int getRenderType() { + return 23; + } + +- public void addCollisionBoxesToList(World var1, int var2, int var3, int var4, AxisAlignedBB var5, List var6, Entity var7) { +- if(var7 == null || !(var7 instanceof EntityBoat)) { +- super.addCollisionBoxesToList(var1, var2, var3, var4, var5, var6, var7); ++ /** ++ * Adds all intersecting collision boxes to a list. (Be sure to only add boxes to the list if they intersect the mask.) ++ * Parameters: World, X, Y, Z, mask, list, colliding entity ++ */ ++ public void addCollisionBoxesToList(World par1World, int par2, int par3, int par4, AxisAlignedBB par5AxisAlignedBB, List par6List, Entity par7Entity) { ++ if (par7Entity == null || !(par7Entity instanceof EntityBoat)) { ++ super.addCollisionBoxesToList(par1World, par2, par3, par4, par5AxisAlignedBB, par6List, par7Entity); + } +- + } + +- public AxisAlignedBB getCollisionBoundingBoxFromPool(World var1, int var2, int var3, int var4) { +- return AxisAlignedBB.getAABBPool().getAABB((double)var2 + this.minX, (double)var3 + this.minY, (double)var4 + this.minZ, (double)var2 + this.maxX, (double)var3 + this.maxY, (double)var4 + this.maxZ); ++ /** ++ * Returns a bounding box from the pool of bounding boxes (this means this box can change after the pool has been ++ * cleared to be reused) ++ */ ++ public AxisAlignedBB getCollisionBoundingBoxFromPool(World par1World, int par2, int par3, int par4) { ++ return AxisAlignedBB.getAABBPool().getAABB((double)par2 + this.minX, (double)par3 + this.minY, (double)par4 + this.minZ, (double)par2 + this.maxX, (double)par3 + this.maxY, (double)par4 + this.maxZ); + } + + public int getBlockColor() { +- return 2129968; +- } +- +- public int getRenderColor(int var1) { +- return 2129968; +- } +- +- public int colorMultiplier(IBlockAccess var1, int var2, int var3, int var4) { +- return 2129968; +- } +- +- protected boolean canThisPlantGrowOnThisBlockID(int var1) { +- return var1 == Block.waterStill.blockID; +- } +- +- public boolean canBlockStay(World var1, int var2, int var3, int var4) { +- return var3 >= 0 && var3 < 256 ? var1.getBlockMaterial(var2, var3 - 1, var4) == Material.water && var1.getBlockMetadata(var2, var3 - 1, var4) == 0 : false; ++ // MCPatcher Start ++ return ColorizeBlock.getLilyPadColor(); ++ // MCPatcher End ++ } ++ ++ /** ++ * Returns the color this block should be rendered. Used by leaves. ++ */ ++ public int getRenderColor(int par1) { ++ // MCPatcher Start ++ return ColorizeBlock.getLilyPadColor(); ++ // MCPatcher End ++ } ++ ++ /** ++ * Returns a integer with hex for 0xrrggbb with this color multiplied against the blocks color. Note only called when ++ * first determining what to render. ++ */ ++ public int colorMultiplier(IBlockAccess par1IBlockAccess, int par2, int par3, int par4) { ++ // MCPatcher Start ++ return ColorizeBlock.getLilyPadColor(); ++ // MCPatcher End ++ } ++ ++ /** ++ * Gets passed in the blockID of the block below and supposed to return true if its allowed to grow on the type of ++ * blockID passed in. Args: blockID ++ */ ++ protected boolean canThisPlantGrowOnThisBlockID(int par1) { ++ return par1 == Block.waterStill.blockID; ++ } ++ ++ /** ++ * Can this block stay at this position. Similar to canPlaceBlockAt except gets checked often with plants. ++ */ ++ public boolean canBlockStay(World par1World, int par2, int par3, int par4) { ++ return par3 >= 0 && par3 < 256 ? par1World.getBlockMaterial(par2, par3 - 1, par4) == Material.water && par1World.getBlockMetadata(par2, par3 - 1, par4) == 0 : false; + } + } diff --git a/patches/net/minecraft/src/BlockLockedChest.java.patch b/patches/net/minecraft/src/BlockLockedChest.java.patch new file mode 100644 index 0000000..357990b --- /dev/null +++ b/patches/net/minecraft/src/BlockLockedChest.java.patch @@ -0,0 +1,37 @@ +--- net/minecraft/src/BlockLockedChest.java ++++ net/minecraft/src/BlockLockedChest.java +@@ -3,18 +3,27 @@ + import java.util.Random; + + public class BlockLockedChest extends Block { +- protected BlockLockedChest(int var1) { +- super(var1, Material.wood); ++ protected BlockLockedChest(int par1) { ++ super(par1, Material.wood); + } + +- public boolean canPlaceBlockAt(World var1, int var2, int var3, int var4) { ++ /** ++ * Checks to see if its valid to put this block at the specified coordinates. Args: world, x, y, z ++ */ ++ public boolean canPlaceBlockAt(World par1World, int par2, int par3, int par4) { + return true; + } + +- public void updateTick(World var1, int var2, int var3, int var4, Random var5) { +- var1.setBlockToAir(var2, var3, var4); ++ /** ++ * Ticks the block if it's been scheduled ++ */ ++ public void updateTick(World par1World, int par2, int par3, int par4, Random par5Random) { ++ par1World.setBlockToAir(par2, par3, par4); + } + +- public void registerIcons(IconRegister var1) { +- } ++ /** ++ * When this method is called, your block should register all the icons it needs with the given IconRegister. This is ++ * the only chance you get to register icons. ++ */ ++ public void registerIcons(IconRegister par1IconRegister) {} + } diff --git a/patches/net/minecraft/src/BlockLog.java.patch b/patches/net/minecraft/src/BlockLog.java.patch new file mode 100644 index 0000000..8c4dffe --- /dev/null +++ b/patches/net/minecraft/src/BlockLog.java.patch @@ -0,0 +1,148 @@ +--- net/minecraft/src/BlockLog.java ++++ net/minecraft/src/BlockLog.java +@@ -4,71 +4,100 @@ + import java.util.Random; + + public class BlockLog extends BlockRotatedPillar { +- public static final String[] b = new String[]{"oak", "spruce", "birch", "jungle"}; ++ ++ /** The type of tree this log came from. */ ++ public static final String[] woodType = new String[] {"oak", "spruce", "birch", "jungle"}; + private Icon[] field_111052_c; + private Icon[] tree_top; + +- protected BlockLog(int var1) { +- super(var1, Material.wood); ++ protected BlockLog(int par1) { ++ super(par1, Material.wood); + this.setCreativeTab(CreativeTabs.tabBlock); + } + +- public int quantityDropped(Random var1) { ++ /** ++ * Returns the quantity of items to drop on block destruction. ++ */ ++ public int quantityDropped(Random par1Random) { + return 1; + } + +- public int idDropped(int var1, Random var2, int var3) { ++ /** ++ * Returns the ID of the items to drop on destruction. ++ */ ++ public int idDropped(int par1, Random par2Random, int par3) { + return Block.wood.blockID; + } + +- public void breakBlock(World var1, int var2, int var3, int var4, int var5, int var6) { ++ /** ++ * Called on server worlds only when the block has been replaced by a different block ID, or the same block with a ++ * different metadata value, but before the new metadata value is set. Args: World, x, y, z, old block ID, old metadata ++ */ ++ public void breakBlock(World par1World, int par2, int par3, int par4, int par5, int par6) { + byte var7 = 4; + int var8 = var7 + 1; +- if(var1.checkChunksExist(var2 - var8, var3 - var8, var4 - var8, var2 + var8, var3 + var8, var4 + var8)) { +- for(int var9 = -var7; var9 <= var7; ++var9) { +- for(int var10 = -var7; var10 <= var7; ++var10) { +- for(int var11 = -var7; var11 <= var7; ++var11) { +- int var12 = var1.getBlockId(var2 + var9, var3 + var10, var4 + var11); +- if(var12 == Block.leaves.blockID) { +- int var13 = var1.getBlockMetadata(var2 + var9, var3 + var10, var4 + var11); +- if((var13 & 8) == 0) { +- var1.setBlockMetadata(var2 + var9, var3 + var10, var4 + var11, var13 | 8, 4); ++ ++ if (par1World.checkChunksExist(par2 - var8, par3 - var8, par4 - var8, par2 + var8, par3 + var8, par4 + var8)) { ++ for (int var9 = -var7; var9 <= var7; ++var9) { ++ for (int var10 = -var7; var10 <= var7; ++var10) { ++ for (int var11 = -var7; var11 <= var7; ++var11) { ++ int var12 = par1World.getBlockId(par2 + var9, par3 + var10, par4 + var11); ++ ++ if (var12 == Block.leaves.blockID) { ++ int var13 = par1World.getBlockMetadata(par2 + var9, par3 + var10, par4 + var11); ++ ++ if ((var13 & 8) == 0) { ++ par1World.setBlockMetadataWithNotify(par2 + var9, par3 + var10, par4 + var11, var13 | 8, 4); + } + } + } + } + } + } +- +- } +- +- protected Icon getSideIcon(int var1) { +- return this.field_111052_c[var1]; +- } +- +- protected Icon getEndIcon(int var1) { +- return this.tree_top[var1]; +- } +- +- public static int limitToValidMetadata(int var0) { +- return var0 & 3; +- } +- +- public void getSubBlocks(int var1, CreativeTabs var2, List var3) { +- var3.add(new ItemStack(var1, 1, 0)); +- var3.add(new ItemStack(var1, 1, 1)); +- var3.add(new ItemStack(var1, 1, 2)); +- var3.add(new ItemStack(var1, 1, 3)); +- } +- +- public void registerIcons(IconRegister var1) { +- this.field_111052_c = new Icon[b.length]; +- this.tree_top = new Icon[b.length]; +- +- for(int var2 = 0; var2 < this.field_111052_c.length; ++var2) { +- this.field_111052_c[var2] = var1.registerIcon(this.getTextureName() + "_" + b[var2]); +- this.tree_top[var2] = var1.registerIcon(this.getTextureName() + "_" + b[var2] + "_top"); ++ } ++ ++ /** ++ * The icon for the side of the block. ++ */ ++ protected Icon getSideIcon(int par1) { ++ return this.field_111052_c[par1]; ++ } ++ ++ /** ++ * The icon for the tops and bottoms of the block. ++ */ ++ protected Icon getEndIcon(int par1) { ++ return this.tree_top[par1]; ++ } ++ ++ /** ++ * returns a number between 0 and 3 ++ */ ++ public static int limitToValidMetadata(int par0) { ++ return par0 & 3; ++ } ++ ++ /** ++ * returns a list of blocks with the same ID, but different meta (eg: wood returns 4 blocks) ++ */ ++ public void getSubBlocks(int par1, CreativeTabs par2CreativeTabs, List par3List) { ++ par3List.add(new ItemStack(par1, 1, 0)); ++ par3List.add(new ItemStack(par1, 1, 1)); ++ par3List.add(new ItemStack(par1, 1, 2)); ++ par3List.add(new ItemStack(par1, 1, 3)); ++ } ++ ++ /** ++ * When this method is called, your block should register all the icons it needs with the given IconRegister. This is ++ * the only chance you get to register icons. ++ */ ++ public void registerIcons(IconRegister par1IconRegister) { ++ this.field_111052_c = new Icon[woodType.length]; ++ this.tree_top = new Icon[woodType.length]; ++ ++ for (int var2 = 0; var2 < this.field_111052_c.length; ++var2) { ++ this.field_111052_c[var2] = par1IconRegister.registerIcon(this.getTextureName() + "_" + woodType[var2]); ++ this.tree_top[var2] = par1IconRegister.registerIcon(this.getTextureName() + "_" + woodType[var2] + "_top"); + } +- + } + } diff --git a/patches/net/minecraft/src/BlockMelon.java.patch b/patches/net/minecraft/src/BlockMelon.java.patch new file mode 100644 index 0000000..e54c408 --- /dev/null +++ b/patches/net/minecraft/src/BlockMelon.java.patch @@ -0,0 +1,67 @@ +--- net/minecraft/src/BlockMelon.java ++++ net/minecraft/src/BlockMelon.java +@@ -5,34 +5,51 @@ + public class BlockMelon extends Block { + private Icon theIcon; + +- protected BlockMelon(int var1) { +- super(var1, Material.pumpkin); ++ protected BlockMelon(int par1) { ++ super(par1, Material.pumpkin); + this.setCreativeTab(CreativeTabs.tabBlock); + } + +- public Icon getIcon(int var1, int var2) { +- return var1 != 1 && var1 != 0 ? this.blockIcon : this.theIcon; ++ /** ++ * From the specified side and block metadata retrieves the blocks texture. Args: side, metadata ++ */ ++ public Icon getIcon(int par1, int par2) { ++ return par1 != 1 && par1 != 0 ? this.blockIcon : this.theIcon; + } + +- public int idDropped(int var1, Random var2, int var3) { ++ /** ++ * Returns the ID of the items to drop on destruction. ++ */ ++ public int idDropped(int par1, Random par2Random, int par3) { + return Item.melon.itemID; + } + +- public int quantityDropped(Random var1) { +- return 3 + var1.nextInt(5); ++ /** ++ * Returns the quantity of items to drop on block destruction. ++ */ ++ public int quantityDropped(Random par1Random) { ++ return 3 + par1Random.nextInt(5); + } + +- public int quantityDroppedWithBonus(int var1, Random var2) { +- int var3 = this.quantityDropped(var2) + var2.nextInt(1 + var1); +- if(var3 > 9) { ++ /** ++ * Returns the usual quantity dropped by the block plus a bonus of 1 to 'i' (inclusive). ++ */ ++ public int quantityDroppedWithBonus(int par1, Random par2Random) { ++ int var3 = this.quantityDropped(par2Random) + par2Random.nextInt(1 + par1); ++ ++ if (var3 > 9) { + var3 = 9; + } + + return var3; + } + +- public void registerIcons(IconRegister var1) { +- this.blockIcon = var1.registerIcon(this.getTextureName() + "_side"); +- this.theIcon = var1.registerIcon(this.getTextureName() + "_top"); ++ /** ++ * When this method is called, your block should register all the icons it needs with the given IconRegister. This is ++ * the only chance you get to register icons. ++ */ ++ public void registerIcons(IconRegister par1IconRegister) { ++ this.blockIcon = par1IconRegister.registerIcon(this.getTextureName() + "_side"); ++ this.theIcon = par1IconRegister.registerIcon(this.getTextureName() + "_top"); + } + } diff --git a/patches/net/minecraft/src/BlockMobSpawner.java.patch b/patches/net/minecraft/src/BlockMobSpawner.java.patch new file mode 100644 index 0000000..98641fd --- /dev/null +++ b/patches/net/minecraft/src/BlockMobSpawner.java.patch @@ -0,0 +1,73 @@ +--- net/minecraft/src/BlockMobSpawner.java ++++ net/minecraft/src/BlockMobSpawner.java +@@ -3,33 +3,52 @@ + import java.util.Random; + + public class BlockMobSpawner extends BlockContainer { +- protected BlockMobSpawner(int var1) { +- super(var1, Material.rock); ++ protected BlockMobSpawner(int par1) { ++ super(par1, Material.rock); + } + +- public TileEntity createNewTileEntity(World var1) { ++ /** ++ * Returns a new instance of a block's tile entity class. Called on placing the block. ++ */ ++ public TileEntity createNewTileEntity(World par1World) { + return new TileEntityMobSpawner(); + } + +- public int idDropped(int var1, Random var2, int var3) { +- return 0; +- } +- +- public int quantityDropped(Random var1) { +- return 0; +- } +- +- public void dropBlockAsItemWithChance(World var1, int var2, int var3, int var4, int var5, float var6, int var7) { +- super.dropBlockAsItemWithChance(var1, var2, var3, var4, var5, var6, var7); +- int var8 = 15 + var1.s.nextInt(15) + var1.s.nextInt(15); +- this.dropXpOnBlockBreak(var1, var2, var3, var4, var8); +- } +- ++ /** ++ * Returns the ID of the items to drop on destruction. ++ */ ++ public int idDropped(int par1, Random par2Random, int par3) { ++ return 0; ++ } ++ ++ /** ++ * Returns the quantity of items to drop on block destruction. ++ */ ++ public int quantityDropped(Random par1Random) { ++ return 0; ++ } ++ ++ /** ++ * Drops the block items with a specified chance of dropping the specified items ++ */ ++ public void dropBlockAsItemWithChance(World par1World, int par2, int par3, int par4, int par5, float par6, int par7) { ++ super.dropBlockAsItemWithChance(par1World, par2, par3, par4, par5, par6, par7); ++ int var8 = 15 + par1World.rand.nextInt(15) + par1World.rand.nextInt(15); ++ this.dropXpOnBlockBreak(par1World, par2, par3, par4, var8); ++ } ++ ++ /** ++ * Is this block (a) opaque and (b) a full 1m cube? This determines whether or not to render the shared face of two ++ * adjacent blocks and also whether the player can attach torches, redstone wire, etc to this block. ++ */ + public boolean isOpaqueCube() { + return false; + } + +- public int idPicked(World var1, int var2, int var3, int var4) { ++ /** ++ * only called by clickMiddleMouseButton , and passed to inventory.setCurrentItem (along with isCreative) ++ */ ++ public int idPicked(World par1World, int par2, int par3, int par4) { + return 0; + } + } diff --git a/patches/net/minecraft/src/BlockMushroom.java.patch b/patches/net/minecraft/src/BlockMushroom.java.patch new file mode 100644 index 0000000..c998437 --- /dev/null +++ b/patches/net/minecraft/src/BlockMushroom.java.patch @@ -0,0 +1,153 @@ +--- net/minecraft/src/BlockMushroom.java ++++ net/minecraft/src/BlockMushroom.java +@@ -3,27 +3,31 @@ + import java.util.Random; + + public class BlockMushroom extends BlockFlower { +- protected BlockMushroom(int var1) { +- super(var1); ++ protected BlockMushroom(int par1) { ++ super(par1); + float var2 = 0.2F; + this.setBlockBounds(0.5F - var2, 0.0F, 0.5F - var2, 0.5F + var2, var2 * 2.0F, 0.5F + var2); + this.setTickRandomly(true); + } + +- public void updateTick(World var1, int var2, int var3, int var4, Random var5) { +- if(var5.nextInt(25) == 0) { ++ /** ++ * Ticks the block if it's been scheduled ++ */ ++ public void updateTick(World par1World, int par2, int par3, int par4, Random par5Random) { ++ if (par5Random.nextInt(25) == 0) { + byte var6 = 4; + int var7 = 5; +- + int var8; + int var9; + int var10; +- for(var8 = var2 - var6; var8 <= var2 + var6; ++var8) { +- for(var9 = var4 - var6; var9 <= var4 + var6; ++var9) { +- for(var10 = var3 - 1; var10 <= var3 + 1; ++var10) { +- if(var1.getBlockId(var8, var10, var9) == this.blockID) { ++ ++ for (var8 = par2 - var6; var8 <= par2 + var6; ++var8) { ++ for (var9 = par4 - var6; var9 <= par4 + var6; ++var9) { ++ for (var10 = par3 - 1; var10 <= par3 + 1; ++var10) { ++ if (par1World.getBlockId(var8, var10, var9) == this.blockID) { + --var7; +- if(var7 <= 0) { ++ ++ if (var7 <= 0) { + return; + } + } +@@ -31,60 +35,73 @@ + } + } + +- var8 = var2 + var5.nextInt(3) - 1; +- var9 = var3 + var5.nextInt(2) - var5.nextInt(2); +- var10 = var4 + var5.nextInt(3) - 1; ++ var8 = par2 + par5Random.nextInt(3) - 1; ++ var9 = par3 + par5Random.nextInt(2) - par5Random.nextInt(2); ++ var10 = par4 + par5Random.nextInt(3) - 1; + +- for(int var11 = 0; var11 < 4; ++var11) { +- if(var1.isAirBlock(var8, var9, var10) && this.canBlockStay(var1, var8, var9, var10)) { +- var2 = var8; +- var3 = var9; +- var4 = var10; ++ for (int var11 = 0; var11 < 4; ++var11) { ++ if (par1World.isAirBlock(var8, var9, var10) && this.canBlockStay(par1World, var8, var9, var10)) { ++ par2 = var8; ++ par3 = var9; ++ par4 = var10; + } + +- var8 = var2 + var5.nextInt(3) - 1; +- var9 = var3 + var5.nextInt(2) - var5.nextInt(2); +- var10 = var4 + var5.nextInt(3) - 1; ++ var8 = par2 + par5Random.nextInt(3) - 1; ++ var9 = par3 + par5Random.nextInt(2) - par5Random.nextInt(2); ++ var10 = par4 + par5Random.nextInt(3) - 1; + } + +- if(var1.isAirBlock(var8, var9, var10) && this.canBlockStay(var1, var8, var9, var10)) { +- var1.setBlock(var8, var9, var10, this.blockID, 0, 2); ++ if (par1World.isAirBlock(var8, var9, var10) && this.canBlockStay(par1World, var8, var9, var10)) { ++ par1World.setBlock(var8, var9, var10, this.blockID, 0, 2); + } + } +- +- } +- +- public boolean canPlaceBlockAt(World var1, int var2, int var3, int var4) { +- return super.canPlaceBlockAt(var1, var2, var3, var4) && this.canBlockStay(var1, var2, var3, var4); +- } +- +- protected boolean canThisPlantGrowOnThisBlockID(int var1) { +- return Block.opaqueCubeLookup[var1]; +- } +- +- public boolean canBlockStay(World var1, int var2, int var3, int var4) { +- if(var3 >= 0 && var3 < 256) { +- int var5 = var1.getBlockId(var2, var3 - 1, var4); +- return var5 == Block.mycelium.blockID || var1.getFullBlockLightValue(var2, var3, var4) < 13 && this.canThisPlantGrowOnThisBlockID(var5); ++ } ++ ++ /** ++ * Checks to see if its valid to put this block at the specified coordinates. Args: world, x, y, z ++ */ ++ public boolean canPlaceBlockAt(World par1World, int par2, int par3, int par4) { ++ return super.canPlaceBlockAt(par1World, par2, par3, par4) && this.canBlockStay(par1World, par2, par3, par4); ++ } ++ ++ /** ++ * Gets passed in the blockID of the block below and supposed to return true if its allowed to grow on the type of ++ * blockID passed in. Args: blockID ++ */ ++ protected boolean canThisPlantGrowOnThisBlockID(int par1) { ++ return Block.opaqueCubeLookup[par1]; ++ } ++ ++ /** ++ * Can this block stay at this position. Similar to canPlaceBlockAt except gets checked often with plants. ++ */ ++ public boolean canBlockStay(World par1World, int par2, int par3, int par4) { ++ if (par3 >= 0 && par3 < 256) { ++ int var5 = par1World.getBlockId(par2, par3 - 1, par4); ++ return var5 == Block.mycelium.blockID || par1World.getFullBlockLightValue(par2, par3, par4) < 13 && this.canThisPlantGrowOnThisBlockID(var5); + } else { + return false; + } + } + +- public boolean fertilizeMushroom(World var1, int var2, int var3, int var4, Random var5) { +- int var6 = var1.getBlockMetadata(var2, var3, var4); +- var1.setBlockToAir(var2, var3, var4); ++ /** ++ * Fertilize the mushroom. ++ */ ++ public boolean fertilizeMushroom(World par1World, int par2, int par3, int par4, Random par5Random) { ++ int var6 = par1World.getBlockMetadata(par2, par3, par4); ++ par1World.setBlockToAir(par2, par3, par4); + WorldGenBigMushroom var7 = null; +- if(this.blockID == Block.mushroomBrown.blockID) { ++ ++ if (this.blockID == Block.mushroomBrown.blockID) { + var7 = new WorldGenBigMushroom(0); +- } else if(this.blockID == Block.mushroomRed.blockID) { ++ } else if (this.blockID == Block.mushroomRed.blockID) { + var7 = new WorldGenBigMushroom(1); + } + +- if(var7 != null && var7.generate(var1, var5, var2, var3, var4)) { ++ if (var7 != null && var7.generate(par1World, par5Random, par2, par3, par4)) { + return true; + } else { +- var1.setBlock(var2, var3, var4, this.blockID, var6, 3); ++ par1World.setBlock(par2, par3, par4, this.blockID, var6, 3); + return false; + } + } diff --git a/patches/net/minecraft/src/BlockMushroomCap.java.patch b/patches/net/minecraft/src/BlockMushroomCap.java.patch new file mode 100644 index 0000000..bf23aa0 --- /dev/null +++ b/patches/net/minecraft/src/BlockMushroomCap.java.patch @@ -0,0 +1,96 @@ +--- net/minecraft/src/BlockMushroomCap.java ++++ net/minecraft/src/BlockMushroomCap.java +@@ -3,46 +3,65 @@ + import java.util.Random; + + public class BlockMushroomCap extends Block { +- private static final String[] a = new String[]{"skin_brown", "skin_red"}; ++ private static final String[] field_94429_a = new String[] {"skin_brown", "skin_red"}; ++ ++ /** The mushroom type. 0 for brown, 1 for red. */ + private final int mushroomType; + private Icon[] iconArray; + private Icon field_94426_cO; + private Icon field_94427_cP; + +- public BlockMushroomCap(int var1, Material var2, int var3) { +- super(var1, var2); +- this.mushroomType = var3; +- } +- +- public Icon getIcon(int var1, int var2) { +- return var2 == 10 && var1 > 1 ? this.field_94426_cO : (var2 >= 1 && var2 <= 9 && var1 == 1 ? this.iconArray[this.mushroomType] : (var2 >= 1 && var2 <= 3 && var1 == 2 ? this.iconArray[this.mushroomType] : (var2 >= 7 && var2 <= 9 && var1 == 3 ? this.iconArray[this.mushroomType] : ((var2 == 1 || var2 == 4 || var2 == 7) && var1 == 4 ? this.iconArray[this.mushroomType] : ((var2 == 3 || var2 == 6 || var2 == 9) && var1 == 5 ? this.iconArray[this.mushroomType] : (var2 == 14 ? this.iconArray[this.mushroomType] : (var2 == 15 ? this.field_94426_cO : this.field_94427_cP))))))); +- } +- +- public int quantityDropped(Random var1) { +- int var2 = var1.nextInt(10) - 7; +- if(var2 < 0) { ++ public BlockMushroomCap(int par1, Material par2Material, int par3) { ++ super(par1, par2Material); ++ this.mushroomType = par3; ++ } ++ ++ /** ++ * From the specified side and block metadata retrieves the blocks texture. Args: side, metadata ++ */ ++ public Icon getIcon(int par1, int par2) { ++ return par2 == 10 && par1 > 1 ? this.field_94426_cO : (par2 >= 1 && par2 <= 9 && par1 == 1 ? this.iconArray[this.mushroomType] : (par2 >= 1 && par2 <= 3 && par1 == 2 ? this.iconArray[this.mushroomType] : (par2 >= 7 && par2 <= 9 && par1 == 3 ? this.iconArray[this.mushroomType] : ((par2 == 1 || par2 == 4 || par2 == 7) && par1 == 4 ? this.iconArray[this.mushroomType] : ((par2 == 3 || par2 == 6 || par2 == 9) && par1 == 5 ? this.iconArray[this.mushroomType] : (par2 == 14 ? this.iconArray[this.mushroomType] : (par2 == 15 ? this.field_94426_cO : this.field_94427_cP))))))); ++ } ++ ++ /** ++ * Returns the quantity of items to drop on block destruction. ++ */ ++ public int quantityDropped(Random par1Random) { ++ int var2 = par1Random.nextInt(10) - 7; ++ ++ if (var2 < 0) { + var2 = 0; + } + + return var2; + } + +- public int idDropped(int var1, Random var2, int var3) { +- return Block.mushroomBrown.blockID + this.mushroomType; +- } +- +- public int idPicked(World var1, int var2, int var3, int var4) { +- return Block.mushroomBrown.blockID + this.mushroomType; +- } +- +- public void registerIcons(IconRegister var1) { +- this.iconArray = new Icon[a.length]; +- +- for(int var2 = 0; var2 < this.iconArray.length; ++var2) { +- this.iconArray[var2] = var1.registerIcon(this.getTextureName() + "_" + a[var2]); ++ /** ++ * Returns the ID of the items to drop on destruction. ++ */ ++ public int idDropped(int par1, Random par2Random, int par3) { ++ return Block.mushroomBrown.blockID + this.mushroomType; ++ } ++ ++ /** ++ * only called by clickMiddleMouseButton , and passed to inventory.setCurrentItem (along with isCreative) ++ */ ++ public int idPicked(World par1World, int par2, int par3, int par4) { ++ return Block.mushroomBrown.blockID + this.mushroomType; ++ } ++ ++ /** ++ * When this method is called, your block should register all the icons it needs with the given IconRegister. This is ++ * the only chance you get to register icons. ++ */ ++ public void registerIcons(IconRegister par1IconRegister) { ++ this.iconArray = new Icon[field_94429_a.length]; ++ ++ for (int var2 = 0; var2 < this.iconArray.length; ++var2) { ++ this.iconArray[var2] = par1IconRegister.registerIcon(this.getTextureName() + "_" + field_94429_a[var2]); + } + +- this.field_94427_cP = var1.registerIcon(this.getTextureName() + "_" + "inside"); +- this.field_94426_cO = var1.registerIcon(this.getTextureName() + "_" + "skin_stem"); ++ this.field_94427_cP = par1IconRegister.registerIcon(this.getTextureName() + "_" + "inside"); ++ this.field_94426_cO = par1IconRegister.registerIcon(this.getTextureName() + "_" + "skin_stem"); + } + } diff --git a/patches/net/minecraft/src/BlockMycelium.java.patch b/patches/net/minecraft/src/BlockMycelium.java.patch new file mode 100644 index 0000000..69ce666 --- /dev/null +++ b/patches/net/minecraft/src/BlockMycelium.java.patch @@ -0,0 +1,122 @@ +--- net/minecraft/src/BlockMycelium.java ++++ net/minecraft/src/BlockMycelium.java +@@ -6,61 +6,80 @@ + private Icon field_94422_a; + private Icon field_94421_b; + +- protected BlockMycelium(int var1) { +- super(var1, Material.grass); ++ protected BlockMycelium(int par1) { ++ super(par1, Material.grass); + this.setTickRandomly(true); + this.setCreativeTab(CreativeTabs.tabBlock); + } + +- public Icon getIcon(int var1, int var2) { +- return var1 == 1 ? this.field_94422_a : (var1 == 0 ? Block.dirt.getBlockTextureFromSide(var1) : this.blockIcon); ++ /** ++ * From the specified side and block metadata retrieves the blocks texture. Args: side, metadata ++ */ ++ public Icon getIcon(int par1, int par2) { ++ return par1 == 1 ? this.field_94422_a : (par1 == 0 ? Block.dirt.getBlockTextureFromSide(par1) : this.blockIcon); + } + +- public Icon getBlockTexture(IBlockAccess var1, int var2, int var3, int var4, int var5) { +- if(var5 == 1) { ++ /** ++ * Retrieves the block texture to use based on the display side. Args: iBlockAccess, x, y, z, side ++ */ ++ public Icon getBlockTexture(IBlockAccess par1IBlockAccess, int par2, int par3, int par4, int par5) { ++ if (par5 == 1) { + return this.field_94422_a; +- } else if(var5 == 0) { +- return Block.dirt.getBlockTextureFromSide(var5); ++ } else if (par5 == 0) { ++ return Block.dirt.getBlockTextureFromSide(par5); + } else { +- Material var6 = var1.getBlockMaterial(var2, var3 + 1, var4); ++ Material var6 = par1IBlockAccess.getBlockMaterial(par2, par3 + 1, par4); + return var6 != Material.snow && var6 != Material.craftedSnow ? this.blockIcon : this.field_94421_b; + } + } + +- public void registerIcons(IconRegister var1) { +- this.blockIcon = var1.registerIcon(this.getTextureName() + "_side"); +- this.field_94422_a = var1.registerIcon(this.getTextureName() + "_top"); +- this.field_94421_b = var1.registerIcon("grass_side_snowed"); ++ /** ++ * When this method is called, your block should register all the icons it needs with the given IconRegister. This is ++ * the only chance you get to register icons. ++ */ ++ public void registerIcons(IconRegister par1IconRegister) { ++ this.blockIcon = par1IconRegister.registerIcon(this.getTextureName() + "_side"); ++ this.field_94422_a = par1IconRegister.registerIcon(this.getTextureName() + "_top"); ++ this.field_94421_b = par1IconRegister.registerIcon("grass_side_snowed"); + } + +- public void updateTick(World var1, int var2, int var3, int var4, Random var5) { +- if(!var1.isRemote) { +- if(var1.getBlockLightValue(var2, var3 + 1, var4) < 4 && Block.lightOpacity[var1.getBlockId(var2, var3 + 1, var4)] > 2) { +- var1.setBlock(var2, var3, var4, Block.dirt.blockID); +- } else if(var1.getBlockLightValue(var2, var3 + 1, var4) >= 9) { +- for(int var6 = 0; var6 < 4; ++var6) { +- int var7 = var2 + var5.nextInt(3) - 1; +- int var8 = var3 + var5.nextInt(5) - 3; +- int var9 = var4 + var5.nextInt(3) - 1; +- int var10 = var1.getBlockId(var7, var8 + 1, var9); +- if(var1.getBlockId(var7, var8, var9) == Block.dirt.blockID && var1.getBlockLightValue(var7, var8 + 1, var9) >= 4 && Block.lightOpacity[var10] <= 2) { +- var1.setBlock(var7, var8, var9, this.blockID); ++ /** ++ * Ticks the block if it's been scheduled ++ */ ++ public void updateTick(World par1World, int par2, int par3, int par4, Random par5Random) { ++ if (!par1World.isRemote) { ++ if (par1World.getBlockLightValue(par2, par3 + 1, par4) < 4 && Block.lightOpacity[par1World.getBlockId(par2, par3 + 1, par4)] > 2) { ++ par1World.setBlock(par2, par3, par4, Block.dirt.blockID); ++ } else if (par1World.getBlockLightValue(par2, par3 + 1, par4) >= 9) { ++ for (int var6 = 0; var6 < 4; ++var6) { ++ int var7 = par2 + par5Random.nextInt(3) - 1; ++ int var8 = par3 + par5Random.nextInt(5) - 3; ++ int var9 = par4 + par5Random.nextInt(3) - 1; ++ int var10 = par1World.getBlockId(var7, var8 + 1, var9); ++ ++ if (par1World.getBlockId(var7, var8, var9) == Block.dirt.blockID && par1World.getBlockLightValue(var7, var8 + 1, var9) >= 4 && Block.lightOpacity[var10] <= 2) { ++ par1World.setBlock(var7, var8, var9, this.blockID); + } + } + } +- +- } +- } +- +- public void randomDisplayTick(World var1, int var2, int var3, int var4, Random var5) { +- super.randomDisplayTick(var1, var2, var3, var4, var5); +- if(var5.nextInt(10) == 0) { +- var1.spawnParticle("townaura", (double)((float)var2 + var5.nextFloat()), (double)((float)var3 + 1.1F), (double)((float)var4 + var5.nextFloat()), 0.0D, 0.0D, 0.0D); +- } +- +- } +- +- public int idDropped(int var1, Random var2, int var3) { +- return Block.dirt.idDropped(0, var2, var3); ++ } ++ } ++ ++ /** ++ * A randomly called display update to be able to add particles or other items for display ++ */ ++ public void randomDisplayTick(World par1World, int par2, int par3, int par4, Random par5Random) { ++ super.randomDisplayTick(par1World, par2, par3, par4, par5Random); ++ ++ if (par5Random.nextInt(10) == 0) { ++ par1World.spawnParticle("townaura", (double)((float)par2 + par5Random.nextFloat()), (double)((float)par3 + 1.1F), (double)((float)par4 + par5Random.nextFloat()), 0.0D, 0.0D, 0.0D); ++ } ++ } ++ ++ /** ++ * Returns the ID of the items to drop on destruction. ++ */ ++ public int idDropped(int par1, Random par2Random, int par3) { ++ return Block.dirt.idDropped(0, par2Random, par3); + } + } diff --git a/patches/net/minecraft/src/BlockNetherStalk.java.patch b/patches/net/minecraft/src/BlockNetherStalk.java.patch new file mode 100644 index 0000000..fc2bcc9 --- /dev/null +++ b/patches/net/minecraft/src/BlockNetherStalk.java.patch @@ -0,0 +1,154 @@ +--- net/minecraft/src/BlockNetherStalk.java ++++ net/minecraft/src/BlockNetherStalk.java +@@ -5,75 +5,108 @@ + public class BlockNetherStalk extends BlockFlower { + private Icon[] iconArray; + +- protected BlockNetherStalk(int var1) { +- super(var1); ++ protected BlockNetherStalk(int par1) { ++ super(par1); + this.setTickRandomly(true); + float var2 = 0.5F; + this.setBlockBounds(0.5F - var2, 0.0F, 0.5F - var2, 0.5F + var2, 0.25F, 0.5F + var2); + this.setCreativeTab((CreativeTabs)null); + } + +- protected boolean canThisPlantGrowOnThisBlockID(int var1) { +- return var1 == Block.slowSand.blockID; +- } +- +- public boolean canBlockStay(World var1, int var2, int var3, int var4) { +- return this.canThisPlantGrowOnThisBlockID(var1.getBlockId(var2, var3 - 1, var4)); +- } +- +- public void updateTick(World var1, int var2, int var3, int var4, Random var5) { +- int var6 = var1.getBlockMetadata(var2, var3, var4); +- if(var6 < 3 && var5.nextInt(10) == 0) { ++ /** ++ * Gets passed in the blockID of the block below and supposed to return true if its allowed to grow on the type of ++ * blockID passed in. Args: blockID ++ */ ++ protected boolean canThisPlantGrowOnThisBlockID(int par1) { ++ return par1 == Block.slowSand.blockID; ++ } ++ ++ /** ++ * Can this block stay at this position. Similar to canPlaceBlockAt except gets checked often with plants. ++ */ ++ public boolean canBlockStay(World par1World, int par2, int par3, int par4) { ++ return this.canThisPlantGrowOnThisBlockID(par1World.getBlockId(par2, par3 - 1, par4)); ++ } ++ ++ /** ++ * Ticks the block if it's been scheduled ++ */ ++ public void updateTick(World par1World, int par2, int par3, int par4, Random par5Random) { ++ int var6 = par1World.getBlockMetadata(par2, par3, par4); ++ ++ if (var6 < 3 && par5Random.nextInt(10) == 0) { + ++var6; +- var1.setBlockMetadata(var2, var3, var4, var6, 2); ++ par1World.setBlockMetadataWithNotify(par2, par3, par4, var6, 2); + } + +- super.updateTick(var1, var2, var3, var4, var5); +- } +- +- public Icon getIcon(int var1, int var2) { +- return var2 >= 3 ? this.iconArray[2] : (var2 > 0 ? this.iconArray[1] : this.iconArray[0]); +- } +- ++ super.updateTick(par1World, par2, par3, par4, par5Random); ++ } ++ ++ /** ++ * From the specified side and block metadata retrieves the blocks texture. Args: side, metadata ++ */ ++ public Icon getIcon(int par1, int par2) { ++ return par2 >= 3 ? this.iconArray[2] : (par2 > 0 ? this.iconArray[1] : this.iconArray[0]); ++ } ++ ++ /** ++ * The type of render function that is called for this block ++ */ + public int getRenderType() { + return 6; + } + +- public void dropBlockAsItemWithChance(World var1, int var2, int var3, int var4, int var5, float var6, int var7) { +- if(!var1.isRemote) { ++ /** ++ * Drops the block items with a specified chance of dropping the specified items ++ */ ++ public void dropBlockAsItemWithChance(World par1World, int par2, int par3, int par4, int par5, float par6, int par7) { ++ if (!par1World.isRemote) { + int var8 = 1; +- if(var5 >= 3) { +- var8 = 2 + var1.s.nextInt(3); +- if(var7 > 0) { +- var8 += var1.s.nextInt(var7 + 1); ++ ++ if (par5 >= 3) { ++ var8 = 2 + par1World.rand.nextInt(3); ++ ++ if (par7 > 0) { ++ var8 += par1World.rand.nextInt(par7 + 1); + } + } + +- for(int var9 = 0; var9 < var8; ++var9) { +- this.dropBlockAsItem_do(var1, var2, var3, var4, new ItemStack(Item.netherStalkSeeds)); ++ for (int var9 = 0; var9 < var8; ++var9) { ++ this.dropBlockAsItem_do(par1World, par2, par3, par4, new ItemStack(Item.netherStalkSeeds)); + } +- + } + } + +- public int idDropped(int var1, Random var2, int var3) { +- return 0; +- } +- +- public int quantityDropped(Random var1) { +- return 0; +- } +- +- public int idPicked(World var1, int var2, int var3, int var4) { ++ /** ++ * Returns the ID of the items to drop on destruction. ++ */ ++ public int idDropped(int par1, Random par2Random, int par3) { ++ return 0; ++ } ++ ++ /** ++ * Returns the quantity of items to drop on block destruction. ++ */ ++ public int quantityDropped(Random par1Random) { ++ return 0; ++ } ++ ++ /** ++ * only called by clickMiddleMouseButton , and passed to inventory.setCurrentItem (along with isCreative) ++ */ ++ public int idPicked(World par1World, int par2, int par3, int par4) { + return Item.netherStalkSeeds.itemID; + } + +- public void registerIcons(IconRegister var1) { ++ /** ++ * When this method is called, your block should register all the icons it needs with the given IconRegister. This is ++ * the only chance you get to register icons. ++ */ ++ public void registerIcons(IconRegister par1IconRegister) { + this.iconArray = new Icon[3]; + +- for(int var2 = 0; var2 < this.iconArray.length; ++var2) { +- this.iconArray[var2] = var1.registerIcon(this.getTextureName() + "_stage_" + var2); ++ for (int var2 = 0; var2 < this.iconArray.length; ++var2) { ++ this.iconArray[var2] = par1IconRegister.registerIcon(this.getTextureName() + "_stage_" + var2); + } +- + } + } diff --git a/patches/net/minecraft/src/BlockNetherrack.java.patch b/patches/net/minecraft/src/BlockNetherrack.java.patch new file mode 100644 index 0000000..9c4d215 --- /dev/null +++ b/patches/net/minecraft/src/BlockNetherrack.java.patch @@ -0,0 +1,13 @@ +--- net/minecraft/src/BlockNetherrack.java ++++ net/minecraft/src/BlockNetherrack.java +@@ -1,8 +1,8 @@ + package net.minecraft.src; + + public class BlockNetherrack extends Block { +- public BlockNetherrack(int var1) { +- super(var1, Material.rock); ++ public BlockNetherrack(int par1) { ++ super(par1, Material.rock); + this.setCreativeTab(CreativeTabs.tabBlock); + } + } diff --git a/patches/net/minecraft/src/BlockNote.java.patch b/patches/net/minecraft/src/BlockNote.java.patch new file mode 100644 index 0000000..488cc66 --- /dev/null +++ b/patches/net/minecraft/src/BlockNote.java.patch @@ -0,0 +1,124 @@ +--- net/minecraft/src/BlockNote.java ++++ net/minecraft/src/BlockNote.java +@@ -1,73 +1,92 @@ + package net.minecraft.src; + + public class BlockNote extends BlockContainer { +- public BlockNote(int var1) { +- super(var1, Material.wood); ++ public BlockNote(int par1) { ++ super(par1, Material.wood); + this.setCreativeTab(CreativeTabs.tabRedstone); + } + +- public void onNeighborBlockChange(World var1, int var2, int var3, int var4, int var5) { +- boolean var6 = var1.isBlockIndirectlyGettingPowered(var2, var3, var4); +- TileEntityNote var7 = (TileEntityNote)var1.getBlockTileEntity(var2, var3, var4); +- if(var7 != null && var7.previousRedstoneState != var6) { +- if(var6) { +- var7.triggerNote(var1, var2, var3, var4); ++ /** ++ * Lets the block know when one of its neighbor changes. Doesn't know which neighbor changed (coordinates passed are ++ * their own) Args: x, y, z, neighbor blockID ++ */ ++ public void onNeighborBlockChange(World par1World, int par2, int par3, int par4, int par5) { ++ boolean var6 = par1World.isBlockIndirectlyGettingPowered(par2, par3, par4); ++ TileEntityNote var7 = (TileEntityNote)par1World.getBlockTileEntity(par2, par3, par4); ++ ++ if (var7 != null && var7.previousRedstoneState != var6) { ++ if (var6) { ++ var7.triggerNote(par1World, par2, par3, par4); + } + + var7.previousRedstoneState = var6; + } +- + } + +- public boolean onBlockActivated(World var1, int var2, int var3, int var4, EntityPlayer var5, int var6, float var7, float var8, float var9) { +- if(var1.isRemote) { ++ /** ++ * Called upon block activation (right click on the block.) ++ */ ++ public boolean onBlockActivated(World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer, int par6, float par7, float par8, float par9) { ++ if (par1World.isRemote) { + return true; + } else { +- TileEntityNote var10 = (TileEntityNote)var1.getBlockTileEntity(var2, var3, var4); +- if(var10 != null) { ++ TileEntityNote var10 = (TileEntityNote)par1World.getBlockTileEntity(par2, par3, par4); ++ ++ if (var10 != null) { + var10.changePitch(); +- var10.triggerNote(var1, var2, var3, var4); ++ var10.triggerNote(par1World, par2, par3, par4); + } + + return true; + } + } + +- public void onBlockClicked(World var1, int var2, int var3, int var4, EntityPlayer var5) { +- if(!var1.isRemote) { +- TileEntityNote var6 = (TileEntityNote)var1.getBlockTileEntity(var2, var3, var4); +- if(var6 != null) { +- var6.triggerNote(var1, var2, var3, var4); ++ /** ++ * Called when the block is clicked by a player. Args: x, y, z, entityPlayer ++ */ ++ public void onBlockClicked(World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer) { ++ if (!par1World.isRemote) { ++ TileEntityNote var6 = (TileEntityNote)par1World.getBlockTileEntity(par2, par3, par4); ++ ++ if (var6 != null) { ++ var6.triggerNote(par1World, par2, par3, par4); + } +- + } + } + +- public TileEntity createNewTileEntity(World var1) { ++ /** ++ * Returns a new instance of a block's tile entity class. Called on placing the block. ++ */ ++ public TileEntity createNewTileEntity(World par1World) { + return new TileEntityNote(); + } + +- public boolean onBlockEventReceived(World var1, int var2, int var3, int var4, int var5, int var6) { +- float var7 = (float)Math.pow(2.0D, (double)(var6 - 12) / 12.0D); ++ /** ++ * Called when the block receives a BlockEvent - see World.addBlockEvent. By default, passes it on to the tile entity ++ * at this location. Args: world, x, y, z, blockID, EventID, event parameter ++ */ ++ public boolean onBlockEventReceived(World par1World, int par2, int par3, int par4, int par5, int par6) { ++ float var7 = (float)Math.pow(2.0D, (double)(par6 - 12) / 12.0D); + String var8 = "harp"; +- if(var5 == 1) { ++ ++ if (par5 == 1) { + var8 = "bd"; + } + +- if(var5 == 2) { ++ if (par5 == 2) { + var8 = "snare"; + } + +- if(var5 == 3) { ++ if (par5 == 3) { + var8 = "hat"; + } + +- if(var5 == 4) { ++ if (par5 == 4) { + var8 = "bassattack"; + } + +- var1.playSoundEffect((double)var2 + 0.5D, (double)var3 + 0.5D, (double)var4 + 0.5D, "note." + var8, 3.0F, var7); +- var1.spawnParticle("note", (double)var2 + 0.5D, (double)var3 + 1.2D, (double)var4 + 0.5D, (double)var6 / 24.0D, 0.0D, 0.0D); ++ par1World.playSoundEffect((double)par2 + 0.5D, (double)par3 + 0.5D, (double)par4 + 0.5D, "note." + var8, 3.0F, var7); ++ par1World.spawnParticle("note", (double)par2 + 0.5D, (double)par3 + 1.2D, (double)par4 + 0.5D, (double)par6 / 24.0D, 0.0D, 0.0D); + return true; + } + } diff --git a/patches/net/minecraft/src/BlockObsidian.java.patch b/patches/net/minecraft/src/BlockObsidian.java.patch new file mode 100644 index 0000000..1c6c88b --- /dev/null +++ b/patches/net/minecraft/src/BlockObsidian.java.patch @@ -0,0 +1,28 @@ +--- net/minecraft/src/BlockObsidian.java ++++ net/minecraft/src/BlockObsidian.java +@@ -3,15 +3,21 @@ + import java.util.Random; + + public class BlockObsidian extends BlockStone { +- public BlockObsidian(int var1) { +- super(var1); ++ public BlockObsidian(int par1) { ++ super(par1); + } + +- public int quantityDropped(Random var1) { ++ /** ++ * Returns the quantity of items to drop on block destruction. ++ */ ++ public int quantityDropped(Random par1Random) { + return 1; + } + +- public int idDropped(int var1, Random var2, int var3) { ++ /** ++ * Returns the ID of the items to drop on destruction. ++ */ ++ public int idDropped(int par1, Random par2Random, int par3) { + return Block.obsidian.blockID; + } + } diff --git a/patches/net/minecraft/src/BlockOre.java.patch b/patches/net/minecraft/src/BlockOre.java.patch new file mode 100644 index 0000000..48befee --- /dev/null +++ b/patches/net/minecraft/src/BlockOre.java.patch @@ -0,0 +1,101 @@ +--- net/minecraft/src/BlockOre.java ++++ net/minecraft/src/BlockOre.java +@@ -3,54 +3,71 @@ + import java.util.Random; + + public class BlockOre extends Block { +- public BlockOre(int var1) { +- super(var1, Material.rock); ++ public BlockOre(int par1) { ++ super(par1, Material.rock); + this.setCreativeTab(CreativeTabs.tabBlock); + } + +- public int idDropped(int var1, Random var2, int var3) { ++ /** ++ * Returns the ID of the items to drop on destruction. ++ */ ++ public int idDropped(int par1, Random par2Random, int par3) { + return this.blockID == Block.oreCoal.blockID ? Item.coal.itemID : (this.blockID == Block.oreDiamond.blockID ? Item.diamond.itemID : (this.blockID == Block.oreLapis.blockID ? Item.dyePowder.itemID : (this.blockID == Block.oreEmerald.blockID ? Item.emerald.itemID : (this.blockID == Block.oreNetherQuartz.blockID ? Item.netherQuartz.itemID : this.blockID)))); + } + +- public int quantityDropped(Random var1) { +- return this.blockID == Block.oreLapis.blockID ? 4 + var1.nextInt(5) : 1; ++ /** ++ * Returns the quantity of items to drop on block destruction. ++ */ ++ public int quantityDropped(Random par1Random) { ++ return this.blockID == Block.oreLapis.blockID ? 4 + par1Random.nextInt(5) : 1; + } + +- public int quantityDroppedWithBonus(int var1, Random var2) { +- if(var1 > 0 && this.blockID != this.idDropped(0, var2, var1)) { +- int var3 = var2.nextInt(var1 + 2) - 1; +- if(var3 < 0) { ++ /** ++ * Returns the usual quantity dropped by the block plus a bonus of 1 to 'i' (inclusive). ++ */ ++ public int quantityDroppedWithBonus(int par1, Random par2Random) { ++ if (par1 > 0 && this.blockID != this.idDropped(0, par2Random, par1)) { ++ int var3 = par2Random.nextInt(par1 + 2) - 1; ++ ++ if (var3 < 0) { + var3 = 0; + } + +- return this.quantityDropped(var2) * (var3 + 1); ++ return this.quantityDropped(par2Random) * (var3 + 1); + } else { +- return this.quantityDropped(var2); ++ return this.quantityDropped(par2Random); + } + } + +- public void dropBlockAsItemWithChance(World var1, int var2, int var3, int var4, int var5, float var6, int var7) { +- super.dropBlockAsItemWithChance(var1, var2, var3, var4, var5, var6, var7); +- if(this.idDropped(var5, var1.s, var7) != this.blockID) { ++ /** ++ * Drops the block items with a specified chance of dropping the specified items ++ */ ++ public void dropBlockAsItemWithChance(World par1World, int par2, int par3, int par4, int par5, float par6, int par7) { ++ super.dropBlockAsItemWithChance(par1World, par2, par3, par4, par5, par6, par7); ++ ++ if (this.idDropped(par5, par1World.rand, par7) != this.blockID) { + int var8 = 0; +- if(this.blockID == Block.oreCoal.blockID) { +- var8 = MathHelper.getRandomIntegerInRange(var1.s, 0, 2); +- } else if(this.blockID == Block.oreDiamond.blockID) { +- var8 = MathHelper.getRandomIntegerInRange(var1.s, 3, 7); +- } else if(this.blockID == Block.oreEmerald.blockID) { +- var8 = MathHelper.getRandomIntegerInRange(var1.s, 3, 7); +- } else if(this.blockID == Block.oreLapis.blockID) { +- var8 = MathHelper.getRandomIntegerInRange(var1.s, 2, 5); +- } else if(this.blockID == Block.oreNetherQuartz.blockID) { +- var8 = MathHelper.getRandomIntegerInRange(var1.s, 2, 5); ++ ++ if (this.blockID == Block.oreCoal.blockID) { ++ var8 = MathHelper.getRandomIntegerInRange(par1World.rand, 0, 2); ++ } else if (this.blockID == Block.oreDiamond.blockID) { ++ var8 = MathHelper.getRandomIntegerInRange(par1World.rand, 3, 7); ++ } else if (this.blockID == Block.oreEmerald.blockID) { ++ var8 = MathHelper.getRandomIntegerInRange(par1World.rand, 3, 7); ++ } else if (this.blockID == Block.oreLapis.blockID) { ++ var8 = MathHelper.getRandomIntegerInRange(par1World.rand, 2, 5); ++ } else if (this.blockID == Block.oreNetherQuartz.blockID) { ++ var8 = MathHelper.getRandomIntegerInRange(par1World.rand, 2, 5); + } + +- this.dropXpOnBlockBreak(var1, var2, var3, var4, var8); ++ this.dropXpOnBlockBreak(par1World, par2, par3, par4, var8); + } +- + } + +- public int damageDropped(int var1) { ++ /** ++ * Determines the damage on the item the block drops. Used in cloth and wood. ++ */ ++ public int damageDropped(int par1) { + return this.blockID == Block.oreLapis.blockID ? 4 : 0; + } + } diff --git a/patches/net/minecraft/src/BlockOreStorage.java.patch b/patches/net/minecraft/src/BlockOreStorage.java.patch new file mode 100644 index 0000000..13d3a45 --- /dev/null +++ b/patches/net/minecraft/src/BlockOreStorage.java.patch @@ -0,0 +1,13 @@ +--- net/minecraft/src/BlockOreStorage.java ++++ net/minecraft/src/BlockOreStorage.java +@@ -1,8 +1,8 @@ + package net.minecraft.src; + + public class BlockOreStorage extends Block { +- public BlockOreStorage(int var1) { +- super(var1, Material.iron); ++ public BlockOreStorage(int par1) { ++ super(par1, Material.iron); + this.setCreativeTab(CreativeTabs.tabBlock); + } + } diff --git a/patches/net/minecraft/src/BlockPane.java.patch b/patches/net/minecraft/src/BlockPane.java.patch new file mode 100644 index 0000000..9bf58ef --- /dev/null +++ b/patches/net/minecraft/src/BlockPane.java.patch @@ -0,0 +1,255 @@ +--- net/minecraft/src/BlockPane.java ++++ net/minecraft/src/BlockPane.java +@@ -4,90 +4,127 @@ + import java.util.Random; + + public class BlockPane extends Block { +- private final String a; ++ ++ /** ++ * Holds the texture index of the side of the pane (the thin lateral side) ++ */ ++ private final String sideTextureIndex; ++ ++ /** ++ * If this field is true, the pane block drops itself when destroyed (like the iron fences), otherwise, it's just ++ * destroyed (like glass panes) ++ */ + private final boolean canDropItself; +- private final String c; ++ private final String field_94402_c; + private Icon theIcon; + +- protected BlockPane(int var1, String var2, String var3, Material var4, boolean var5) { +- super(var1, var4); +- this.a = var3; +- this.canDropItself = var5; +- this.c = var2; ++ protected BlockPane(int par1, String par2Str, String par3Str, Material par4Material, boolean par5) { ++ super(par1, par4Material); ++ this.sideTextureIndex = par3Str; ++ this.canDropItself = par5; ++ this.field_94402_c = par2Str; + this.setCreativeTab(CreativeTabs.tabDecorations); + } + +- public int idDropped(int var1, Random var2, int var3) { +- return !this.canDropItself ? 0 : super.idDropped(var1, var2, var3); ++ /** ++ * Returns the ID of the items to drop on destruction. ++ */ ++ public int idDropped(int par1, Random par2Random, int par3) { ++ return !this.canDropItself ? 0 : super.idDropped(par1, par2Random, par3); + } + ++ /** ++ * Is this block (a) opaque and (b) a full 1m cube? This determines whether or not to render the shared face of two ++ * adjacent blocks and also whether the player can attach torches, redstone wire, etc to this block. ++ */ + public boolean isOpaqueCube() { + return false; + } + ++ /** ++ * If this block doesn't render as an ordinary block it will return False (examples: signs, buttons, stairs, etc) ++ */ + public boolean renderAsNormalBlock() { + return false; + } + ++ /** ++ * The type of render function that is called for this block ++ */ + public int getRenderType() { + return 18; + } + +- public boolean shouldSideBeRendered(IBlockAccess var1, int var2, int var3, int var4, int var5) { +- int var6 = var1.getBlockId(var2, var3, var4); +- return var6 == this.blockID ? false : super.shouldSideBeRendered(var1, var2, var3, var4, var5); +- } +- +- public void addCollisionBoxesToList(World var1, int var2, int var3, int var4, AxisAlignedBB var5, List var6, Entity var7) { +- boolean var8 = this.canThisPaneConnectToThisBlockID(var1.getBlockId(var2, var3, var4 - 1)); +- boolean var9 = this.canThisPaneConnectToThisBlockID(var1.getBlockId(var2, var3, var4 + 1)); +- boolean var10 = this.canThisPaneConnectToThisBlockID(var1.getBlockId(var2 - 1, var3, var4)); +- boolean var11 = this.canThisPaneConnectToThisBlockID(var1.getBlockId(var2 + 1, var3, var4)); +- if((!var10 || !var11) && (var10 || var11 || var8 || var9)) { +- if(var10 && !var11) { +- this.setBlockBounds(0.0F, 0.0F, 7.0F / 16.0F, 0.5F, 1.0F, 9.0F / 16.0F); +- super.addCollisionBoxesToList(var1, var2, var3, var4, var5, var6, var7); +- } else if(!var10 && var11) { +- this.setBlockBounds(0.5F, 0.0F, 7.0F / 16.0F, 1.0F, 1.0F, 9.0F / 16.0F); +- super.addCollisionBoxesToList(var1, var2, var3, var4, var5, var6, var7); +- } +- } else { +- this.setBlockBounds(0.0F, 0.0F, 7.0F / 16.0F, 1.0F, 1.0F, 9.0F / 16.0F); +- super.addCollisionBoxesToList(var1, var2, var3, var4, var5, var6, var7); +- } +- +- if((!var8 || !var9) && (var10 || var11 || var8 || var9)) { +- if(var8 && !var9) { +- this.setBlockBounds(7.0F / 16.0F, 0.0F, 0.0F, 9.0F / 16.0F, 1.0F, 0.5F); +- super.addCollisionBoxesToList(var1, var2, var3, var4, var5, var6, var7); +- } else if(!var8 && var9) { +- this.setBlockBounds(7.0F / 16.0F, 0.0F, 0.5F, 9.0F / 16.0F, 1.0F, 1.0F); +- super.addCollisionBoxesToList(var1, var2, var3, var4, var5, var6, var7); +- } +- } else { +- this.setBlockBounds(7.0F / 16.0F, 0.0F, 0.0F, 9.0F / 16.0F, 1.0F, 1.0F); +- super.addCollisionBoxesToList(var1, var2, var3, var4, var5, var6, var7); +- } +- +- } +- ++ /** ++ * Returns true if the given side of this block type should be rendered, if the adjacent block is at the given ++ * coordinates. Args: blockAccess, x, y, z, side ++ */ ++ public boolean shouldSideBeRendered(IBlockAccess par1IBlockAccess, int par2, int par3, int par4, int par5) { ++ int var6 = par1IBlockAccess.getBlockId(par2, par3, par4); ++ return var6 == this.blockID ? false : super.shouldSideBeRendered(par1IBlockAccess, par2, par3, par4, par5); ++ } ++ ++ /** ++ * Adds all intersecting collision boxes to a list. (Be sure to only add boxes to the list if they intersect the mask.) ++ * Parameters: World, X, Y, Z, mask, list, colliding entity ++ */ ++ public void addCollisionBoxesToList(World par1World, int par2, int par3, int par4, AxisAlignedBB par5AxisAlignedBB, List par6List, Entity par7Entity) { ++ boolean var8 = this.canThisPaneConnectToThisBlockID(par1World.getBlockId(par2, par3, par4 - 1)); ++ boolean var9 = this.canThisPaneConnectToThisBlockID(par1World.getBlockId(par2, par3, par4 + 1)); ++ boolean var10 = this.canThisPaneConnectToThisBlockID(par1World.getBlockId(par2 - 1, par3, par4)); ++ boolean var11 = this.canThisPaneConnectToThisBlockID(par1World.getBlockId(par2 + 1, par3, par4)); ++ ++ if ((!var10 || !var11) && (var10 || var11 || var8 || var9)) { ++ if (var10 && !var11) { ++ this.setBlockBounds(0.0F, 0.0F, 0.4375F, 0.5F, 1.0F, 0.5625F); ++ super.addCollisionBoxesToList(par1World, par2, par3, par4, par5AxisAlignedBB, par6List, par7Entity); ++ } else if (!var10 && var11) { ++ this.setBlockBounds(0.5F, 0.0F, 0.4375F, 1.0F, 1.0F, 0.5625F); ++ super.addCollisionBoxesToList(par1World, par2, par3, par4, par5AxisAlignedBB, par6List, par7Entity); ++ } ++ } else { ++ this.setBlockBounds(0.0F, 0.0F, 0.4375F, 1.0F, 1.0F, 0.5625F); ++ super.addCollisionBoxesToList(par1World, par2, par3, par4, par5AxisAlignedBB, par6List, par7Entity); ++ } ++ ++ if ((!var8 || !var9) && (var10 || var11 || var8 || var9)) { ++ if (var8 && !var9) { ++ this.setBlockBounds(0.4375F, 0.0F, 0.0F, 0.5625F, 1.0F, 0.5F); ++ super.addCollisionBoxesToList(par1World, par2, par3, par4, par5AxisAlignedBB, par6List, par7Entity); ++ } else if (!var8 && var9) { ++ this.setBlockBounds(0.4375F, 0.0F, 0.5F, 0.5625F, 1.0F, 1.0F); ++ super.addCollisionBoxesToList(par1World, par2, par3, par4, par5AxisAlignedBB, par6List, par7Entity); ++ } ++ } else { ++ this.setBlockBounds(0.4375F, 0.0F, 0.0F, 0.5625F, 1.0F, 1.0F); ++ super.addCollisionBoxesToList(par1World, par2, par3, par4, par5AxisAlignedBB, par6List, par7Entity); ++ } ++ } ++ ++ /** ++ * Sets the block's bounds for rendering it as an item ++ */ + public void setBlockBoundsForItemRender() { + this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F); + } + +- public void setBlockBoundsBasedOnState(IBlockAccess var1, int var2, int var3, int var4) { +- float var5 = 7.0F / 16.0F; +- float var6 = 9.0F / 16.0F; +- float var7 = 7.0F / 16.0F; +- float var8 = 9.0F / 16.0F; +- boolean var9 = this.canThisPaneConnectToThisBlockID(var1.getBlockId(var2, var3, var4 - 1)); +- boolean var10 = this.canThisPaneConnectToThisBlockID(var1.getBlockId(var2, var3, var4 + 1)); +- boolean var11 = this.canThisPaneConnectToThisBlockID(var1.getBlockId(var2 - 1, var3, var4)); +- boolean var12 = this.canThisPaneConnectToThisBlockID(var1.getBlockId(var2 + 1, var3, var4)); +- if((!var11 || !var12) && (var11 || var12 || var9 || var10)) { +- if(var11 && !var12) { ++ /** ++ * Updates the blocks bounds based on its current state. Args: world, x, y, z ++ */ ++ public void setBlockBoundsBasedOnState(IBlockAccess par1IBlockAccess, int par2, int par3, int par4) { ++ float var5 = 0.4375F; ++ float var6 = 0.5625F; ++ float var7 = 0.4375F; ++ float var8 = 0.5625F; ++ boolean var9 = this.canThisPaneConnectToThisBlockID(par1IBlockAccess.getBlockId(par2, par3, par4 - 1)); ++ boolean var10 = this.canThisPaneConnectToThisBlockID(par1IBlockAccess.getBlockId(par2, par3, par4 + 1)); ++ boolean var11 = this.canThisPaneConnectToThisBlockID(par1IBlockAccess.getBlockId(par2 - 1, par3, par4)); ++ boolean var12 = this.canThisPaneConnectToThisBlockID(par1IBlockAccess.getBlockId(par2 + 1, par3, par4)); ++ ++ if ((!var11 || !var12) && (var11 || var12 || var9 || var10)) { ++ if (var11 && !var12) { + var5 = 0.0F; +- } else if(!var11 && var12) { ++ } else if (!var11 && var12) { + var6 = 1.0F; + } + } else { +@@ -95,10 +132,10 @@ + var6 = 1.0F; + } + +- if((!var9 || !var10) && (var11 || var12 || var9 || var10)) { +- if(var9 && !var10) { ++ if ((!var9 || !var10) && (var11 || var12 || var9 || var10)) { ++ if (var9 && !var10) { + var7 = 0.0F; +- } else if(!var9 && var10) { ++ } else if (!var9 && var10) { + var8 = 1.0F; + } + } else { +@@ -109,24 +146,44 @@ + this.setBlockBounds(var5, 0.0F, var7, var6, 1.0F, var8); + } + ++ /** ++ * Returns the texture index of the thin side of the pane. ++ */ + public Icon getSideTextureIndex() { + return this.theIcon; + } + +- public final boolean canThisPaneConnectToThisBlockID(int var1) { +- return Block.opaqueCubeLookup[var1] || var1 == this.blockID || var1 == Block.glass.blockID; ++ /** ++ * Gets passed in the blockID of the block adjacent and supposed to return true if its allowed to connect to the type ++ * of blockID passed in. Args: blockID ++ */ ++ public final boolean canThisPaneConnectToThisBlockID(int par1) { ++ // Spout Start - Add cloth and stoneBrick IDs ++ return Block.opaqueCubeLookup[par1] || par1 == this.blockID || par1 == Block.glass.blockID || par1 == Block.cloth.blockID || par1 == Block.stoneBrick.blockID; ++ // Spout End + } + ++ /** ++ * Return true if a player with Silk Touch can harvest this block directly, and not its normal drops. ++ */ + protected boolean canSilkHarvest() { + return true; + } + +- protected ItemStack createStackedBlock(int var1) { +- return new ItemStack(this.blockID, 1, var1); ++ /** ++ * Returns an item stack containing a single instance of the current block type. 'i' is the block's subtype/damage and ++ * is ignored for blocks which do not support subtypes. Blocks which cannot be harvested should return null. ++ */ ++ protected ItemStack createStackedBlock(int par1) { ++ return new ItemStack(this.blockID, 1, par1); + } + +- public void registerIcons(IconRegister var1) { +- this.blockIcon = var1.registerIcon(this.c); +- this.theIcon = var1.registerIcon(this.a); ++ /** ++ * When this method is called, your block should register all the icons it needs with the given IconRegister. This is ++ * the only chance you get to register icons. ++ */ ++ public void registerIcons(IconRegister par1IconRegister) { ++ this.blockIcon = par1IconRegister.registerIcon(this.field_94402_c); ++ this.theIcon = par1IconRegister.registerIcon(this.sideTextureIndex); + } + } diff --git a/patches/net/minecraft/src/BlockPistonBase.java.patch b/patches/net/minecraft/src/BlockPistonBase.java.patch new file mode 100644 index 0000000..e392494 --- /dev/null +++ b/patches/net/minecraft/src/BlockPistonBase.java.patch @@ -0,0 +1,693 @@ +--- net/minecraft/src/BlockPistonBase.java ++++ net/minecraft/src/BlockPistonBase.java +@@ -3,139 +3,193 @@ + import java.util.List; + + public class BlockPistonBase extends Block { ++ ++ /** This pistons is the sticky one? */ + private final boolean isSticky; ++ ++ /** Only visible when piston is extended */ + private Icon innerTopIcon; ++ ++ /** Bottom side texture */ + private Icon bottomIcon; ++ ++ /** Top icon of piston depends on (either sticky or normal) */ + private Icon topIcon; + +- public BlockPistonBase(int var1, boolean var2) { +- super(var1, Material.piston); +- this.isSticky = var2; ++ public BlockPistonBase(int par1, boolean par2) { ++ super(par1, Material.piston); ++ this.isSticky = par2; + this.setStepSound(soundStoneFootstep); + this.setHardness(0.5F); + this.setCreativeTab(CreativeTabs.tabRedstone); + } + ++ /** ++ * Return the either 106 or 107 as the texture index depending on the isSticky flag. This will actually never get ++ * called by TileEntityRendererPiston.renderPiston() because TileEntityPiston.shouldRenderHead() will always return false. ++ */ + public Icon getPistonExtensionTexture() { + return this.topIcon; + } + +- public void func_96479_b(float var1, float var2, float var3, float var4, float var5, float var6) { +- this.setBlockBounds(var1, var2, var3, var4, var5, var6); +- } +- +- public Icon getIcon(int var1, int var2) { +- int var3 = getOrientation(var2); +- return var3 > 5 ? this.topIcon : (var1 == var3 ? (!isExtended(var2) && this.minX <= 0.0D && this.minY <= 0.0D && this.minZ <= 0.0D && this.maxX >= 1.0D && this.maxY >= 1.0D && this.maxZ >= 1.0D ? this.topIcon : this.innerTopIcon) : (var1 == Facing.oppositeSide[var3] ? this.bottomIcon : this.blockIcon)); +- } +- +- public static Icon getPistonBaseIcon(String var0) { +- return var0 == "piston_side" ? Block.pistonBase.blockIcon : (var0 == "piston_top_normal" ? Block.pistonBase.topIcon : (var0 == "piston_top_sticky" ? Block.pistonStickyBase.topIcon : (var0 == "piston_inner" ? Block.pistonBase.innerTopIcon : null))); +- } +- +- public void registerIcons(IconRegister var1) { +- this.blockIcon = var1.registerIcon("piston_side"); +- this.topIcon = var1.registerIcon(this.isSticky ? "piston_top_sticky" : "piston_top_normal"); +- this.innerTopIcon = var1.registerIcon("piston_inner"); +- this.bottomIcon = var1.registerIcon("piston_bottom"); +- } +- ++ public void func_96479_b(float par1, float par2, float par3, float par4, float par5, float par6) { ++ this.setBlockBounds(par1, par2, par3, par4, par5, par6); ++ } ++ ++ /** ++ * From the specified side and block metadata retrieves the blocks texture. Args: side, metadata ++ */ ++ public Icon getIcon(int par1, int par2) { ++ int var3 = getOrientation(par2); ++ return var3 > 5 ? this.topIcon : (par1 == var3 ? (!isExtended(par2) && this.minX <= 0.0D && this.minY <= 0.0D && this.minZ <= 0.0D && this.maxX >= 1.0D && this.maxY >= 1.0D && this.maxZ >= 1.0D ? this.topIcon : this.innerTopIcon) : (par1 == Facing.oppositeSide[var3] ? this.bottomIcon : this.blockIcon)); ++ } ++ ++ public static Icon getPistonBaseIcon(String par0Str) { ++ return par0Str == "piston_side" ? Block.pistonBase.blockIcon : (par0Str == "piston_top_normal" ? Block.pistonBase.topIcon : (par0Str == "piston_top_sticky" ? Block.pistonStickyBase.topIcon : (par0Str == "piston_inner" ? Block.pistonBase.innerTopIcon : null))); ++ } ++ ++ /** ++ * When this method is called, your block should register all the icons it needs with the given IconRegister. This is ++ * the only chance you get to register icons. ++ */ ++ public void registerIcons(IconRegister par1IconRegister) { ++ this.blockIcon = par1IconRegister.registerIcon("piston_side"); ++ this.topIcon = par1IconRegister.registerIcon(this.isSticky ? "piston_top_sticky" : "piston_top_normal"); ++ this.innerTopIcon = par1IconRegister.registerIcon("piston_inner"); ++ this.bottomIcon = par1IconRegister.registerIcon("piston_bottom"); ++ } ++ ++ /** ++ * The type of render function that is called for this block ++ */ + public int getRenderType() { + return 16; + } + ++ /** ++ * Is this block (a) opaque and (b) a full 1m cube? This determines whether or not to render the shared face of two ++ * adjacent blocks and also whether the player can attach torches, redstone wire, etc to this block. ++ */ + public boolean isOpaqueCube() { + return false; + } + +- public boolean onBlockActivated(World var1, int var2, int var3, int var4, EntityPlayer var5, int var6, float var7, float var8, float var9) { ++ /** ++ * Called upon block activation (right click on the block.) ++ */ ++ public boolean onBlockActivated(World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer, int par6, float par7, float par8, float par9) { + return false; + } + +- public void onBlockPlacedBy(World var1, int var2, int var3, int var4, EntityLivingBase var5, ItemStack var6) { +- int var7 = determineOrientation(var1, var2, var3, var4, var5); +- var1.setBlockMetadata(var2, var3, var4, var7, 2); +- if(!var1.isRemote) { +- this.updatePistonState(var1, var2, var3, var4); +- } +- +- } +- +- public void onNeighborBlockChange(World var1, int var2, int var3, int var4, int var5) { +- if(!var1.isRemote) { +- this.updatePistonState(var1, var2, var3, var4); +- } +- +- } +- +- public void onBlockAdded(World var1, int var2, int var3, int var4) { +- if(!var1.isRemote && var1.getBlockTileEntity(var2, var3, var4) == null) { +- this.updatePistonState(var1, var2, var3, var4); +- } +- +- } +- +- private void updatePistonState(World var1, int var2, int var3, int var4) { +- int var5 = var1.getBlockMetadata(var2, var3, var4); ++ /** ++ * Called when the block is placed in the world. ++ */ ++ public void onBlockPlacedBy(World par1World, int par2, int par3, int par4, EntityLivingBase par5EntityLivingBase, ItemStack par6ItemStack) { ++ int var7 = determineOrientation(par1World, par2, par3, par4, par5EntityLivingBase); ++ par1World.setBlockMetadataWithNotify(par2, par3, par4, var7, 2); ++ ++ if (!par1World.isRemote) { ++ this.updatePistonState(par1World, par2, par3, par4); ++ } ++ } ++ ++ /** ++ * Lets the block know when one of its neighbor changes. Doesn't know which neighbor changed (coordinates passed are ++ * their own) Args: x, y, z, neighbor blockID ++ */ ++ public void onNeighborBlockChange(World par1World, int par2, int par3, int par4, int par5) { ++ if (!par1World.isRemote) { ++ this.updatePistonState(par1World, par2, par3, par4); ++ } ++ } ++ ++ /** ++ * Called whenever the block is added into the world. Args: world, x, y, z ++ */ ++ public void onBlockAdded(World par1World, int par2, int par3, int par4) { ++ if (!par1World.isRemote && par1World.getBlockTileEntity(par2, par3, par4) == null) { ++ this.updatePistonState(par1World, par2, par3, par4); ++ } ++ } ++ ++ /** ++ * handles attempts to extend or retract the piston. ++ */ ++ private void updatePistonState(World par1World, int par2, int par3, int par4) { ++ int var5 = par1World.getBlockMetadata(par2, par3, par4); + int var6 = getOrientation(var5); +- if(var6 != 7) { +- boolean var7 = this.isIndirectlyPowered(var1, var2, var3, var4, var6); +- if(var7 && !isExtended(var5)) { +- if(canExtend(var1, var2, var3, var4, var6)) { +- var1.addBlockEvent(var2, var3, var4, this.blockID, 0, var6); ++ ++ if (var6 != 7) { ++ boolean var7 = this.isIndirectlyPowered(par1World, par2, par3, par4, var6); ++ ++ if (var7 && !isExtended(var5)) { ++ if (canExtend(par1World, par2, par3, par4, var6)) { ++ par1World.addBlockEvent(par2, par3, par4, this.blockID, 0, var6); + } +- } else if(!var7 && isExtended(var5)) { +- var1.setBlockMetadata(var2, var3, var4, var6, 2); +- var1.addBlockEvent(var2, var3, var4, this.blockID, 1, var6); +- } +- +- } +- } +- +- private boolean isIndirectlyPowered(World var1, int var2, int var3, int var4, int var5) { +- return var5 != 0 && var1.getIndirectPowerOutput(var2, var3 - 1, var4, 0) ? true : (var5 != 1 && var1.getIndirectPowerOutput(var2, var3 + 1, var4, 1) ? true : (var5 != 2 && var1.getIndirectPowerOutput(var2, var3, var4 - 1, 2) ? true : (var5 != 3 && var1.getIndirectPowerOutput(var2, var3, var4 + 1, 3) ? true : (var5 != 5 && var1.getIndirectPowerOutput(var2 + 1, var3, var4, 5) ? true : (var5 != 4 && var1.getIndirectPowerOutput(var2 - 1, var3, var4, 4) ? true : (var1.getIndirectPowerOutput(var2, var3, var4, 0) ? true : (var1.getIndirectPowerOutput(var2, var3 + 2, var4, 1) ? true : (var1.getIndirectPowerOutput(var2, var3 + 1, var4 - 1, 2) ? true : (var1.getIndirectPowerOutput(var2, var3 + 1, var4 + 1, 3) ? true : (var1.getIndirectPowerOutput(var2 - 1, var3 + 1, var4, 4) ? true : var1.getIndirectPowerOutput(var2 + 1, var3 + 1, var4, 5))))))))))); +- } +- +- public boolean onBlockEventReceived(World var1, int var2, int var3, int var4, int var5, int var6) { +- if(!var1.isRemote) { +- boolean var7 = this.isIndirectlyPowered(var1, var2, var3, var4, var6); +- if(var7 && var5 == 1) { +- var1.setBlockMetadata(var2, var3, var4, var6 | 8, 2); +- return false; +- } +- +- if(!var7 && var5 == 0) { +- return false; +- } +- } +- +- if(var5 == 0) { +- if(!this.tryExtend(var1, var2, var3, var4, var6)) { +- return false; +- } +- +- var1.setBlockMetadata(var2, var3, var4, var6 | 8, 2); +- var1.playSoundEffect((double)var2 + 0.5D, (double)var3 + 0.5D, (double)var4 + 0.5D, "tile.piston.out", 0.5F, var1.s.nextFloat() * 0.25F + 0.6F); +- } else if(var5 == 1) { +- TileEntity var16 = var1.getBlockTileEntity(var2 + Facing.offsetsXForSide[var6], var3 + Facing.offsetsYForSide[var6], var4 + Facing.offsetsZForSide[var6]); +- if(var16 instanceof TileEntityPiston) { ++ } else if (!var7 && isExtended(var5)) { ++ par1World.setBlockMetadataWithNotify(par2, par3, par4, var6, 2); ++ par1World.addBlockEvent(par2, par3, par4, this.blockID, 1, var6); ++ } ++ } ++ } ++ ++ /** ++ * checks the block to that side to see if it is indirectly powered. ++ */ ++ private boolean isIndirectlyPowered(World par1World, int par2, int par3, int par4, int par5) { ++ return par5 != 0 && par1World.getIndirectPowerOutput(par2, par3 - 1, par4, 0) ? true : (par5 != 1 && par1World.getIndirectPowerOutput(par2, par3 + 1, par4, 1) ? true : (par5 != 2 && par1World.getIndirectPowerOutput(par2, par3, par4 - 1, 2) ? true : (par5 != 3 && par1World.getIndirectPowerOutput(par2, par3, par4 + 1, 3) ? true : (par5 != 5 && par1World.getIndirectPowerOutput(par2 + 1, par3, par4, 5) ? true : (par5 != 4 && par1World.getIndirectPowerOutput(par2 - 1, par3, par4, 4) ? true : (par1World.getIndirectPowerOutput(par2, par3, par4, 0) ? true : (par1World.getIndirectPowerOutput(par2, par3 + 2, par4, 1) ? true : (par1World.getIndirectPowerOutput(par2, par3 + 1, par4 - 1, 2) ? true : (par1World.getIndirectPowerOutput(par2, par3 + 1, par4 + 1, 3) ? true : (par1World.getIndirectPowerOutput(par2 - 1, par3 + 1, par4, 4) ? true : par1World.getIndirectPowerOutput(par2 + 1, par3 + 1, par4, 5))))))))))); ++ } ++ ++ /** ++ * Called when the block receives a BlockEvent - see World.addBlockEvent. By default, passes it on to the tile entity ++ * at this location. Args: world, x, y, z, blockID, EventID, event parameter ++ */ ++ public boolean onBlockEventReceived(World par1World, int par2, int par3, int par4, int par5, int par6) { ++ if (!par1World.isRemote) { ++ boolean var7 = this.isIndirectlyPowered(par1World, par2, par3, par4, par6); ++ ++ if (var7 && par5 == 1) { ++ par1World.setBlockMetadataWithNotify(par2, par3, par4, par6 | 8, 2); ++ return false; ++ } ++ ++ if (!var7 && par5 == 0) { ++ return false; ++ } ++ } ++ ++ if (par5 == 0) { ++ if (!this.tryExtend(par1World, par2, par3, par4, par6)) { ++ return false; ++ } ++ ++ par1World.setBlockMetadataWithNotify(par2, par3, par4, par6 | 8, 2); ++ par1World.playSoundEffect((double)par2 + 0.5D, (double)par3 + 0.5D, (double)par4 + 0.5D, "tile.piston.out", 0.5F, par1World.rand.nextFloat() * 0.25F + 0.6F); ++ } else if (par5 == 1) { ++ TileEntity var16 = par1World.getBlockTileEntity(par2 + Facing.offsetsXForSide[par6], par3 + Facing.offsetsYForSide[par6], par4 + Facing.offsetsZForSide[par6]); ++ ++ if (var16 instanceof TileEntityPiston) { + ((TileEntityPiston)var16).clearPistonTileEntity(); + } + +- var1.setBlock(var2, var3, var4, Block.pistonMoving.blockID, var6, 3); +- var1.setBlockTileEntity(var2, var3, var4, BlockPistonMoving.getTileEntity(this.blockID, var6, var6, false, true)); +- if(this.isSticky) { +- int var8 = var2 + Facing.offsetsXForSide[var6] * 2; +- int var9 = var3 + Facing.offsetsYForSide[var6] * 2; +- int var10 = var4 + Facing.offsetsZForSide[var6] * 2; +- int var11 = var1.getBlockId(var8, var9, var10); +- int var12 = var1.getBlockMetadata(var8, var9, var10); ++ par1World.setBlock(par2, par3, par4, Block.pistonMoving.blockID, par6, 3); ++ par1World.setBlockTileEntity(par2, par3, par4, BlockPistonMoving.getTileEntity(this.blockID, par6, par6, false, true)); ++ ++ if (this.isSticky) { ++ int var8 = par2 + Facing.offsetsXForSide[par6] * 2; ++ int var9 = par3 + Facing.offsetsYForSide[par6] * 2; ++ int var10 = par4 + Facing.offsetsZForSide[par6] * 2; ++ int var11 = par1World.getBlockId(var8, var9, var10); ++ int var12 = par1World.getBlockMetadata(var8, var9, var10); + boolean var13 = false; +- if(var11 == Block.pistonMoving.blockID) { +- TileEntity var14 = var1.getBlockTileEntity(var8, var9, var10); +- if(var14 instanceof TileEntityPiston) { ++ ++ if (var11 == Block.pistonMoving.blockID) { ++ TileEntity var14 = par1World.getBlockTileEntity(var8, var9, var10); ++ ++ if (var14 instanceof TileEntityPiston) { + TileEntityPiston var15 = (TileEntityPiston)var14; +- if(var15.getPistonOrientation() == var6 && var15.isExtending()) { ++ ++ if (var15.getPistonOrientation() == par6 && var15.isExtending()) { + var15.clearPistonTileEntity(); + var11 = var15.getStoredBlockID(); + var12 = var15.getBlockMetadata(); +@@ -144,153 +198,191 @@ + } + } + +- if(var13 || var11 <= 0 || !canPushBlock(var11, var1, var8, var9, var10, false) || Block.blocksList[var11].getMobilityFlag() != 0 && var11 != Block.pistonBase.blockID && var11 != Block.pistonStickyBase.blockID) { +- if(!var13) { +- var1.setBlockToAir(var2 + Facing.offsetsXForSide[var6], var3 + Facing.offsetsYForSide[var6], var4 + Facing.offsetsZForSide[var6]); +- } +- } else { +- var2 += Facing.offsetsXForSide[var6]; +- var3 += Facing.offsetsYForSide[var6]; +- var4 += Facing.offsetsZForSide[var6]; +- var1.setBlock(var2, var3, var4, Block.pistonMoving.blockID, var12, 3); +- var1.setBlockTileEntity(var2, var3, var4, BlockPistonMoving.getTileEntity(var11, var12, var6, false, false)); +- var1.setBlockToAir(var8, var9, var10); ++ if (!var13 && var11 > 0 && canPushBlock(var11, par1World, var8, var9, var10, false) && (Block.blocksList[var11].getMobilityFlag() == 0 || var11 == Block.pistonBase.blockID || var11 == Block.pistonStickyBase.blockID)) { ++ par2 += Facing.offsetsXForSide[par6]; ++ par3 += Facing.offsetsYForSide[par6]; ++ par4 += Facing.offsetsZForSide[par6]; ++ par1World.setBlock(par2, par3, par4, Block.pistonMoving.blockID, var12, 3); ++ par1World.setBlockTileEntity(par2, par3, par4, BlockPistonMoving.getTileEntity(var11, var12, par6, false, false)); ++ par1World.setBlockToAir(var8, var9, var10); ++ } else if (!var13) { ++ par1World.setBlockToAir(par2 + Facing.offsetsXForSide[par6], par3 + Facing.offsetsYForSide[par6], par4 + Facing.offsetsZForSide[par6]); + } + } else { +- var1.setBlockToAir(var2 + Facing.offsetsXForSide[var6], var3 + Facing.offsetsYForSide[var6], var4 + Facing.offsetsZForSide[var6]); ++ par1World.setBlockToAir(par2 + Facing.offsetsXForSide[par6], par3 + Facing.offsetsYForSide[par6], par4 + Facing.offsetsZForSide[par6]); + } + +- var1.playSoundEffect((double)var2 + 0.5D, (double)var3 + 0.5D, (double)var4 + 0.5D, "tile.piston.in", 0.5F, var1.s.nextFloat() * 0.15F + 0.6F); ++ par1World.playSoundEffect((double)par2 + 0.5D, (double)par3 + 0.5D, (double)par4 + 0.5D, "tile.piston.in", 0.5F, par1World.rand.nextFloat() * 0.15F + 0.6F); + } + + return true; + } + +- public void setBlockBoundsBasedOnState(IBlockAccess var1, int var2, int var3, int var4) { +- int var5 = var1.getBlockMetadata(var2, var3, var4); +- if(isExtended(var5)) { ++ /** ++ * Updates the blocks bounds based on its current state. Args: world, x, y, z ++ */ ++ public void setBlockBoundsBasedOnState(IBlockAccess par1IBlockAccess, int par2, int par3, int par4) { ++ int var5 = par1IBlockAccess.getBlockMetadata(par2, par3, par4); ++ ++ if (isExtended(var5)) { + float var6 = 0.25F; +- switch(getOrientation(var5)) { +- case 0: +- this.setBlockBounds(0.0F, 0.25F, 0.0F, 1.0F, 1.0F, 1.0F); +- break; +- case 1: +- this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 12.0F / 16.0F, 1.0F); +- break; +- case 2: +- this.setBlockBounds(0.0F, 0.0F, 0.25F, 1.0F, 1.0F, 1.0F); +- break; +- case 3: +- this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 12.0F / 16.0F); +- break; +- case 4: +- this.setBlockBounds(0.25F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F); +- break; +- case 5: +- this.setBlockBounds(0.0F, 0.0F, 0.0F, 12.0F / 16.0F, 1.0F, 1.0F); ++ ++ switch (getOrientation(var5)) { ++ case 0: ++ this.setBlockBounds(0.0F, 0.25F, 0.0F, 1.0F, 1.0F, 1.0F); ++ break; ++ ++ case 1: ++ this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.75F, 1.0F); ++ break; ++ ++ case 2: ++ this.setBlockBounds(0.0F, 0.0F, 0.25F, 1.0F, 1.0F, 1.0F); ++ break; ++ ++ case 3: ++ this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 0.75F); ++ break; ++ ++ case 4: ++ this.setBlockBounds(0.25F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F); ++ break; ++ ++ case 5: ++ this.setBlockBounds(0.0F, 0.0F, 0.0F, 0.75F, 1.0F, 1.0F); + } + } else { + this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F); + } +- + } + ++ /** ++ * Sets the block's bounds for rendering it as an item ++ */ + public void setBlockBoundsForItemRender() { + this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F); + } + +- public void addCollisionBoxesToList(World var1, int var2, int var3, int var4, AxisAlignedBB var5, List var6, Entity var7) { ++ /** ++ * Adds all intersecting collision boxes to a list. (Be sure to only add boxes to the list if they intersect the mask.) ++ * Parameters: World, X, Y, Z, mask, list, colliding entity ++ */ ++ public void addCollisionBoxesToList(World par1World, int par2, int par3, int par4, AxisAlignedBB par5AxisAlignedBB, List par6List, Entity par7Entity) { + this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F); +- super.addCollisionBoxesToList(var1, var2, var3, var4, var5, var6, var7); +- } +- +- public AxisAlignedBB getCollisionBoundingBoxFromPool(World var1, int var2, int var3, int var4) { +- this.setBlockBoundsBasedOnState(var1, var2, var3, var4); +- return super.getCollisionBoundingBoxFromPool(var1, var2, var3, var4); +- } +- ++ super.addCollisionBoxesToList(par1World, par2, par3, par4, par5AxisAlignedBB, par6List, par7Entity); ++ } ++ ++ /** ++ * Returns a bounding box from the pool of bounding boxes (this means this box can change after the pool has been ++ * cleared to be reused) ++ */ ++ public AxisAlignedBB getCollisionBoundingBoxFromPool(World par1World, int par2, int par3, int par4) { ++ this.setBlockBoundsBasedOnState(par1World, par2, par3, par4); ++ return super.getCollisionBoundingBoxFromPool(par1World, par2, par3, par4); ++ } ++ ++ /** ++ * If this block doesn't render as an ordinary block it will return False (examples: signs, buttons, stairs, etc) ++ */ + public boolean renderAsNormalBlock() { + return false; + } + +- public static int getOrientation(int var0) { +- return var0 & 7; +- } +- +- public static boolean isExtended(int var0) { +- return (var0 & 8) != 0; +- } +- +- public static int determineOrientation(World var0, int var1, int var2, int var3, EntityLivingBase var4) { +- if(MathHelper.abs((float)var4.posX - (float)var1) < 2.0F && MathHelper.abs((float)var4.posZ - (float)var3) < 2.0F) { +- double var5 = var4.posY + 1.82D - (double)var4.yOffset; +- if(var5 - (double)var2 > 2.0D) { ++ /** ++ * returns an int which describes the direction the piston faces ++ */ ++ public static int getOrientation(int par0) { ++ return par0 & 7; ++ } ++ ++ /** ++ * Determine if the metadata is related to something powered. ++ */ ++ public static boolean isExtended(int par0) { ++ return (par0 & 8) != 0; ++ } ++ ++ /** ++ * gets the way this piston should face for that entity that placed it. ++ */ ++ public static int determineOrientation(World par0World, int par1, int par2, int par3, EntityLivingBase par4EntityLivingBase) { ++ if (MathHelper.abs((float)par4EntityLivingBase.posX - (float)par1) < 2.0F && MathHelper.abs((float)par4EntityLivingBase.posZ - (float)par3) < 2.0F) { ++ double var5 = par4EntityLivingBase.posY + 1.82D - (double)par4EntityLivingBase.yOffset; ++ ++ if (var5 - (double)par2 > 2.0D) { + return 1; + } + +- if((double)var2 - var5 > 0.0D) { ++ if ((double)par2 - var5 > 0.0D) { + return 0; + } + } + +- int var7 = MathHelper.floor_double((double)(var4.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3; ++ int var7 = MathHelper.floor_double((double)(par4EntityLivingBase.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3; + return var7 == 0 ? 2 : (var7 == 1 ? 5 : (var7 == 2 ? 3 : (var7 == 3 ? 4 : 0))); + } + +- private static boolean canPushBlock(int var0, World var1, int var2, int var3, int var4, boolean var5) { +- if(var0 == Block.obsidian.blockID) { ++ /** ++ * returns true if the piston can push the specified block ++ */ ++ private static boolean canPushBlock(int par0, World par1World, int par2, int par3, int par4, boolean par5) { ++ if (par0 == Block.obsidian.blockID) { + return false; + } else { +- if(var0 != Block.pistonBase.blockID && var0 != Block.pistonStickyBase.blockID) { +- if(Block.blocksList[var0].getBlockHardness(var1, var2, var3, var4) == -1.0F) { +- return false; +- } +- +- if(Block.blocksList[var0].getMobilityFlag() == 2) { +- return false; +- } +- +- if(Block.blocksList[var0].getMobilityFlag() == 1) { +- if(!var5) { ++ if (par0 != Block.pistonBase.blockID && par0 != Block.pistonStickyBase.blockID) { ++ if (Block.blocksList[par0].getBlockHardness(par1World, par2, par3, par4) == -1.0F) { ++ return false; ++ } ++ ++ if (Block.blocksList[par0].getMobilityFlag() == 2) { ++ return false; ++ } ++ ++ if (Block.blocksList[par0].getMobilityFlag() == 1) { ++ if (!par5) { + return false; + } + + return true; + } +- } else if(isExtended(var1.getBlockMetadata(var2, var3, var4))) { ++ } else if (isExtended(par1World.getBlockMetadata(par2, par3, par4))) { + return false; + } + +- return !(Block.blocksList[var0] instanceof ITileEntityProvider); ++ return !(Block.blocksList[par0] instanceof ITileEntityProvider); + } + } + +- private static boolean canExtend(World var0, int var1, int var2, int var3, int var4) { +- int var5 = var1 + Facing.offsetsXForSide[var4]; +- int var6 = var2 + Facing.offsetsYForSide[var4]; +- int var7 = var3 + Facing.offsetsZForSide[var4]; ++ /** ++ * checks to see if this piston could push the blocks in front of it. ++ */ ++ private static boolean canExtend(World par0World, int par1, int par2, int par3, int par4) { ++ int var5 = par1 + Facing.offsetsXForSide[par4]; ++ int var6 = par2 + Facing.offsetsYForSide[par4]; ++ int var7 = par3 + Facing.offsetsZForSide[par4]; + int var8 = 0; + +- while(true) { +- if(var8 < 13) { +- if(var6 <= 0 || var6 >= 255) { ++ while (true) { ++ if (var8 < 13) { ++ if (var6 <= 0 || var6 >= 255) { + return false; + } + +- int var9 = var0.getBlockId(var5, var6, var7); +- if(var9 != 0) { +- if(!canPushBlock(var9, var0, var5, var6, var7, true)) { ++ int var9 = par0World.getBlockId(var5, var6, var7); ++ ++ if (var9 != 0) { ++ if (!canPushBlock(var9, par0World, var5, var6, var7, true)) { + return false; + } + +- if(Block.blocksList[var9].getMobilityFlag() != 1) { +- if(var8 == 12) { ++ if (Block.blocksList[var9].getMobilityFlag() != 1) { ++ if (var8 == 12) { + return false; + } + +- var5 += Facing.offsetsXForSide[var4]; +- var6 += Facing.offsetsYForSide[var4]; +- var7 += Facing.offsetsZForSide[var4]; ++ var5 += Facing.offsetsXForSide[par4]; ++ var6 += Facing.offsetsYForSide[par4]; ++ var7 += Facing.offsetsZForSide[par4]; + ++var8; + continue; + } +@@ -301,39 +393,44 @@ + } + } + +- private boolean tryExtend(World var1, int var2, int var3, int var4, int var5) { +- int var6 = var2 + Facing.offsetsXForSide[var5]; +- int var7 = var3 + Facing.offsetsYForSide[var5]; +- int var8 = var4 + Facing.offsetsZForSide[var5]; ++ /** ++ * attempts to extend the piston. returns false if impossible. ++ */ ++ private boolean tryExtend(World par1World, int par2, int par3, int par4, int par5) { ++ int var6 = par2 + Facing.offsetsXForSide[par5]; ++ int var7 = par3 + Facing.offsetsYForSide[par5]; ++ int var8 = par4 + Facing.offsetsZForSide[par5]; + int var9 = 0; + +- while(true) { ++ while (true) { + int var10; +- if(var9 < 13) { +- if(var7 <= 0 || var7 >= 255) { ++ ++ if (var9 < 13) { ++ if (var7 <= 0 || var7 >= 255) { + return false; + } + +- var10 = var1.getBlockId(var6, var7, var8); +- if(var10 != 0) { +- if(!canPushBlock(var10, var1, var6, var7, var8, true)) { ++ var10 = par1World.getBlockId(var6, var7, var8); ++ ++ if (var10 != 0) { ++ if (!canPushBlock(var10, par1World, var6, var7, var8, true)) { + return false; + } + +- if(Block.blocksList[var10].getMobilityFlag() != 1) { +- if(var9 == 12) { ++ if (Block.blocksList[var10].getMobilityFlag() != 1) { ++ if (var9 == 12) { + return false; + } + +- var6 += Facing.offsetsXForSide[var5]; +- var7 += Facing.offsetsYForSide[var5]; +- var8 += Facing.offsetsZForSide[var5]; ++ var6 += Facing.offsetsXForSide[par5]; ++ var7 += Facing.offsetsYForSide[par5]; ++ var8 += Facing.offsetsZForSide[par5]; + ++var9; + continue; + } + +- Block.blocksList[var10].dropBlockAsItem(var1, var6, var7, var8, var1.getBlockMetadata(var6, var7, var8), 0); +- var1.setBlockToAir(var6, var7, var8); ++ Block.blocksList[var10].dropBlockAsItem(par1World, var6, var7, var8, par1World.getBlockMetadata(var6, var7, var8), 0); ++ par1World.setBlockToAir(var6, var7, var8); + } + } + +@@ -341,23 +438,24 @@ + var10 = var7; + int var11 = var8; + int var12 = 0; +- + int[] var13; + int var14; + int var15; + int var16; +- for(var13 = new int[13]; var6 != var2 || var7 != var3 || var8 != var4; var8 = var16) { +- var14 = var6 - Facing.offsetsXForSide[var5]; +- var15 = var7 - Facing.offsetsYForSide[var5]; +- var16 = var8 - Facing.offsetsZForSide[var5]; +- int var17 = var1.getBlockId(var14, var15, var16); +- int var18 = var1.getBlockMetadata(var14, var15, var16); +- if(var17 == this.blockID && var14 == var2 && var15 == var3 && var16 == var4) { +- var1.setBlock(var6, var7, var8, Block.pistonMoving.blockID, var5 | (this.isSticky ? 8 : 0), 4); +- var1.setBlockTileEntity(var6, var7, var8, BlockPistonMoving.getTileEntity(Block.pistonExtension.blockID, var5 | (this.isSticky ? 8 : 0), var5, true, false)); ++ ++ for (var13 = new int[13]; var6 != par2 || var7 != par3 || var8 != par4; var8 = var16) { ++ var14 = var6 - Facing.offsetsXForSide[par5]; ++ var15 = var7 - Facing.offsetsYForSide[par5]; ++ var16 = var8 - Facing.offsetsZForSide[par5]; ++ int var17 = par1World.getBlockId(var14, var15, var16); ++ int var18 = par1World.getBlockMetadata(var14, var15, var16); ++ ++ if (var17 == this.blockID && var14 == par2 && var15 == par3 && var16 == par4) { ++ par1World.setBlock(var6, var7, var8, Block.pistonMoving.blockID, par5 | (this.isSticky ? 8 : 0), 4); ++ par1World.setBlockTileEntity(var6, var7, var8, BlockPistonMoving.getTileEntity(Block.pistonExtension.blockID, par5 | (this.isSticky ? 8 : 0), par5, true, false)); + } else { +- var1.setBlock(var6, var7, var8, Block.pistonMoving.blockID, var18, 4); +- var1.setBlockTileEntity(var6, var7, var8, BlockPistonMoving.getTileEntity(var17, var18, var5, true, false)); ++ par1World.setBlock(var6, var7, var8, Block.pistonMoving.blockID, var18, 4); ++ par1World.setBlockTileEntity(var6, var7, var8, BlockPistonMoving.getTileEntity(var17, var18, par5, true, false)); + } + + var13[var12++] = var17; +@@ -369,11 +467,11 @@ + var7 = var10; + var8 = var11; + +- for(var12 = 0; var6 != var2 || var7 != var3 || var8 != var4; var8 = var16) { +- var14 = var6 - Facing.offsetsXForSide[var5]; +- var15 = var7 - Facing.offsetsYForSide[var5]; +- var16 = var8 - Facing.offsetsZForSide[var5]; +- var1.notifyBlocksOfNeighborChange(var14, var15, var16, var13[var12++]); ++ for (var12 = 0; var6 != par2 || var7 != par3 || var8 != par4; var8 = var16) { ++ var14 = var6 - Facing.offsetsXForSide[par5]; ++ var15 = var7 - Facing.offsetsYForSide[par5]; ++ var16 = var8 - Facing.offsetsZForSide[par5]; ++ par1World.notifyBlocksOfNeighborChange(var14, var15, var16, var13[var12++]); + var6 = var14; + var7 = var15; + } diff --git a/patches/net/minecraft/src/BlockPistonExtension.java.patch b/patches/net/minecraft/src/BlockPistonExtension.java.patch new file mode 100644 index 0000000..fe4ae99 --- /dev/null +++ b/patches/net/minecraft/src/BlockPistonExtension.java.patch @@ -0,0 +1,364 @@ +--- net/minecraft/src/BlockPistonExtension.java ++++ net/minecraft/src/BlockPistonExtension.java +@@ -4,173 +4,234 @@ + import java.util.Random; + + public class BlockPistonExtension extends Block { ++ ++ /** The texture for the 'head' of the piston. Sticky or normal. */ + private Icon headTexture; + +- public BlockPistonExtension(int var1) { +- super(var1, Material.piston); ++ public BlockPistonExtension(int par1) { ++ super(par1, Material.piston); + this.setStepSound(soundStoneFootstep); + this.setHardness(0.5F); + } + +- public void setHeadTexture(Icon var1) { +- this.headTexture = var1; ++ public void setHeadTexture(Icon par1Icon) { ++ this.headTexture = par1Icon; + } + + public void clearHeadTexture() { + this.headTexture = null; + } + +- public void onBlockHarvested(World var1, int var2, int var3, int var4, int var5, EntityPlayer var6) { +- if(var6.capabilities.isCreativeMode) { +- int var7 = getDirectionMeta(var5); +- int var8 = var1.getBlockId(var2 - Facing.offsetsXForSide[var7], var3 - Facing.offsetsYForSide[var7], var4 - Facing.offsetsZForSide[var7]); +- if(var8 == Block.pistonBase.blockID || var8 == Block.pistonStickyBase.blockID) { +- var1.setBlockToAir(var2 - Facing.offsetsXForSide[var7], var3 - Facing.offsetsYForSide[var7], var4 - Facing.offsetsZForSide[var7]); +- } +- } +- +- super.onBlockHarvested(var1, var2, var3, var4, var5, var6); +- } +- +- public void breakBlock(World var1, int var2, int var3, int var4, int var5, int var6) { +- super.breakBlock(var1, var2, var3, var4, var5, var6); +- int var7 = Facing.oppositeSide[getDirectionMeta(var6)]; +- var2 += Facing.offsetsXForSide[var7]; +- var3 += Facing.offsetsYForSide[var7]; +- var4 += Facing.offsetsZForSide[var7]; +- int var8 = var1.getBlockId(var2, var3, var4); +- if(var8 == Block.pistonBase.blockID || var8 == Block.pistonStickyBase.blockID) { +- var6 = var1.getBlockMetadata(var2, var3, var4); +- if(BlockPistonBase.isExtended(var6)) { +- Block.blocksList[var8].dropBlockAsItem(var1, var2, var3, var4, var6, 0); +- var1.setBlockToAir(var2, var3, var4); +- } +- } +- +- } +- +- public Icon getIcon(int var1, int var2) { +- int var3 = getDirectionMeta(var2); +- return var1 == var3 ? (this.headTexture != null ? this.headTexture : ((var2 & 8) != 0 ? BlockPistonBase.getPistonBaseIcon("piston_top_sticky") : BlockPistonBase.getPistonBaseIcon("piston_top_normal"))) : (var3 < 6 && var1 == Facing.oppositeSide[var3] ? BlockPistonBase.getPistonBaseIcon("piston_top_normal") : BlockPistonBase.getPistonBaseIcon("piston_side")); +- } +- +- public void registerIcons(IconRegister var1) { +- } +- ++ /** ++ * Called when the block is attempted to be harvested ++ */ ++ public void onBlockHarvested(World par1World, int par2, int par3, int par4, int par5, EntityPlayer par6EntityPlayer) { ++ if (par6EntityPlayer.capabilities.isCreativeMode) { ++ int var7 = getDirectionMeta(par5); ++ int var8 = par1World.getBlockId(par2 - Facing.offsetsXForSide[var7], par3 - Facing.offsetsYForSide[var7], par4 - Facing.offsetsZForSide[var7]); ++ ++ if (var8 == Block.pistonBase.blockID || var8 == Block.pistonStickyBase.blockID) { ++ par1World.setBlockToAir(par2 - Facing.offsetsXForSide[var7], par3 - Facing.offsetsYForSide[var7], par4 - Facing.offsetsZForSide[var7]); ++ } ++ } ++ ++ super.onBlockHarvested(par1World, par2, par3, par4, par5, par6EntityPlayer); ++ } ++ ++ /** ++ * Called on server worlds only when the block has been replaced by a different block ID, or the same block with a ++ * different metadata value, but before the new metadata value is set. Args: World, x, y, z, old block ID, old metadata ++ */ ++ public void breakBlock(World par1World, int par2, int par3, int par4, int par5, int par6) { ++ super.breakBlock(par1World, par2, par3, par4, par5, par6); ++ int var7 = Facing.oppositeSide[getDirectionMeta(par6)]; ++ par2 += Facing.offsetsXForSide[var7]; ++ par3 += Facing.offsetsYForSide[var7]; ++ par4 += Facing.offsetsZForSide[var7]; ++ int var8 = par1World.getBlockId(par2, par3, par4); ++ ++ if (var8 == Block.pistonBase.blockID || var8 == Block.pistonStickyBase.blockID) { ++ par6 = par1World.getBlockMetadata(par2, par3, par4); ++ ++ if (BlockPistonBase.isExtended(par6)) { ++ Block.blocksList[var8].dropBlockAsItem(par1World, par2, par3, par4, par6, 0); ++ par1World.setBlockToAir(par2, par3, par4); ++ } ++ } ++ } ++ ++ /** ++ * From the specified side and block metadata retrieves the blocks texture. Args: side, metadata ++ */ ++ public Icon getIcon(int par1, int par2) { ++ int var3 = getDirectionMeta(par2); ++ return par1 == var3 ? (this.headTexture != null ? this.headTexture : ((par2 & 8) != 0 ? BlockPistonBase.getPistonBaseIcon("piston_top_sticky") : BlockPistonBase.getPistonBaseIcon("piston_top_normal"))) : (var3 < 6 && par1 == Facing.oppositeSide[var3] ? BlockPistonBase.getPistonBaseIcon("piston_top_normal") : BlockPistonBase.getPistonBaseIcon("piston_side")); ++ } ++ ++ /** ++ * When this method is called, your block should register all the icons it needs with the given IconRegister. This is ++ * the only chance you get to register icons. ++ */ ++ public void registerIcons(IconRegister par1IconRegister) {} ++ ++ /** ++ * The type of render function that is called for this block ++ */ + public int getRenderType() { + return 17; + } + ++ /** ++ * Is this block (a) opaque and (b) a full 1m cube? This determines whether or not to render the shared face of two ++ * adjacent blocks and also whether the player can attach torches, redstone wire, etc to this block. ++ */ + public boolean isOpaqueCube() { + return false; + } + ++ /** ++ * If this block doesn't render as an ordinary block it will return False (examples: signs, buttons, stairs, etc) ++ */ + public boolean renderAsNormalBlock() { + return false; + } + +- public boolean canPlaceBlockAt(World var1, int var2, int var3, int var4) { +- return false; +- } +- +- public boolean canPlaceBlockOnSide(World var1, int var2, int var3, int var4, int var5) { +- return false; +- } +- +- public int quantityDropped(Random var1) { ++ /** ++ * Checks to see if its valid to put this block at the specified coordinates. Args: world, x, y, z ++ */ ++ public boolean canPlaceBlockAt(World par1World, int par2, int par3, int par4) { ++ return false; ++ } ++ ++ /** ++ * checks to see if you can place this block can be placed on that side of a block: BlockLever overrides ++ */ ++ public boolean canPlaceBlockOnSide(World par1World, int par2, int par3, int par4, int par5) { ++ return false; ++ } ++ ++ /** ++ * Returns the quantity of items to drop on block destruction. ++ */ ++ public int quantityDropped(Random par1Random) { + return 0; + } + +- public void addCollisionBoxesToList(World var1, int var2, int var3, int var4, AxisAlignedBB var5, List var6, Entity var7) { +- int var8 = var1.getBlockMetadata(var2, var3, var4); ++ /** ++ * Adds all intersecting collision boxes to a list. (Be sure to only add boxes to the list if they intersect the mask.) ++ * Parameters: World, X, Y, Z, mask, list, colliding entity ++ */ ++ public void addCollisionBoxesToList(World par1World, int par2, int par3, int par4, AxisAlignedBB par5AxisAlignedBB, List par6List, Entity par7Entity) { ++ int var8 = par1World.getBlockMetadata(par2, par3, par4); + float var9 = 0.25F; +- float var10 = 6.0F / 16.0F; +- float var11 = 10.0F / 16.0F; ++ float var10 = 0.375F; ++ float var11 = 0.625F; + float var12 = 0.25F; +- float var13 = 12.0F / 16.0F; +- switch(getDirectionMeta(var8)) { +- case 0: +- this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.25F, 1.0F); +- super.addCollisionBoxesToList(var1, var2, var3, var4, var5, var6, var7); +- this.setBlockBounds(6.0F / 16.0F, 0.25F, 6.0F / 16.0F, 10.0F / 16.0F, 1.0F, 10.0F / 16.0F); +- super.addCollisionBoxesToList(var1, var2, var3, var4, var5, var6, var7); +- break; +- case 1: +- this.setBlockBounds(0.0F, 12.0F / 16.0F, 0.0F, 1.0F, 1.0F, 1.0F); +- super.addCollisionBoxesToList(var1, var2, var3, var4, var5, var6, var7); +- this.setBlockBounds(6.0F / 16.0F, 0.0F, 6.0F / 16.0F, 10.0F / 16.0F, 12.0F / 16.0F, 10.0F / 16.0F); +- super.addCollisionBoxesToList(var1, var2, var3, var4, var5, var6, var7); +- break; +- case 2: +- this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 0.25F); +- super.addCollisionBoxesToList(var1, var2, var3, var4, var5, var6, var7); +- this.setBlockBounds(0.25F, 6.0F / 16.0F, 0.25F, 12.0F / 16.0F, 10.0F / 16.0F, 1.0F); +- super.addCollisionBoxesToList(var1, var2, var3, var4, var5, var6, var7); +- break; +- case 3: +- this.setBlockBounds(0.0F, 0.0F, 12.0F / 16.0F, 1.0F, 1.0F, 1.0F); +- super.addCollisionBoxesToList(var1, var2, var3, var4, var5, var6, var7); +- this.setBlockBounds(0.25F, 6.0F / 16.0F, 0.0F, 12.0F / 16.0F, 10.0F / 16.0F, 12.0F / 16.0F); +- super.addCollisionBoxesToList(var1, var2, var3, var4, var5, var6, var7); +- break; +- case 4: +- this.setBlockBounds(0.0F, 0.0F, 0.0F, 0.25F, 1.0F, 1.0F); +- super.addCollisionBoxesToList(var1, var2, var3, var4, var5, var6, var7); +- this.setBlockBounds(6.0F / 16.0F, 0.25F, 0.25F, 10.0F / 16.0F, 12.0F / 16.0F, 1.0F); +- super.addCollisionBoxesToList(var1, var2, var3, var4, var5, var6, var7); +- break; +- case 5: +- this.setBlockBounds(12.0F / 16.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F); +- super.addCollisionBoxesToList(var1, var2, var3, var4, var5, var6, var7); +- this.setBlockBounds(0.0F, 6.0F / 16.0F, 0.25F, 12.0F / 16.0F, 10.0F / 16.0F, 12.0F / 16.0F); +- super.addCollisionBoxesToList(var1, var2, var3, var4, var5, var6, var7); ++ float var13 = 0.75F; ++ ++ switch (getDirectionMeta(var8)) { ++ case 0: ++ this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.25F, 1.0F); ++ super.addCollisionBoxesToList(par1World, par2, par3, par4, par5AxisAlignedBB, par6List, par7Entity); ++ this.setBlockBounds(0.375F, 0.25F, 0.375F, 0.625F, 1.0F, 0.625F); ++ super.addCollisionBoxesToList(par1World, par2, par3, par4, par5AxisAlignedBB, par6List, par7Entity); ++ break; ++ ++ case 1: ++ this.setBlockBounds(0.0F, 0.75F, 0.0F, 1.0F, 1.0F, 1.0F); ++ super.addCollisionBoxesToList(par1World, par2, par3, par4, par5AxisAlignedBB, par6List, par7Entity); ++ this.setBlockBounds(0.375F, 0.0F, 0.375F, 0.625F, 0.75F, 0.625F); ++ super.addCollisionBoxesToList(par1World, par2, par3, par4, par5AxisAlignedBB, par6List, par7Entity); ++ break; ++ ++ case 2: ++ this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 0.25F); ++ super.addCollisionBoxesToList(par1World, par2, par3, par4, par5AxisAlignedBB, par6List, par7Entity); ++ this.setBlockBounds(0.25F, 0.375F, 0.25F, 0.75F, 0.625F, 1.0F); ++ super.addCollisionBoxesToList(par1World, par2, par3, par4, par5AxisAlignedBB, par6List, par7Entity); ++ break; ++ ++ case 3: ++ this.setBlockBounds(0.0F, 0.0F, 0.75F, 1.0F, 1.0F, 1.0F); ++ super.addCollisionBoxesToList(par1World, par2, par3, par4, par5AxisAlignedBB, par6List, par7Entity); ++ this.setBlockBounds(0.25F, 0.375F, 0.0F, 0.75F, 0.625F, 0.75F); ++ super.addCollisionBoxesToList(par1World, par2, par3, par4, par5AxisAlignedBB, par6List, par7Entity); ++ break; ++ ++ case 4: ++ this.setBlockBounds(0.0F, 0.0F, 0.0F, 0.25F, 1.0F, 1.0F); ++ super.addCollisionBoxesToList(par1World, par2, par3, par4, par5AxisAlignedBB, par6List, par7Entity); ++ this.setBlockBounds(0.375F, 0.25F, 0.25F, 0.625F, 0.75F, 1.0F); ++ super.addCollisionBoxesToList(par1World, par2, par3, par4, par5AxisAlignedBB, par6List, par7Entity); ++ break; ++ ++ case 5: ++ this.setBlockBounds(0.75F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F); ++ super.addCollisionBoxesToList(par1World, par2, par3, par4, par5AxisAlignedBB, par6List, par7Entity); ++ this.setBlockBounds(0.0F, 0.375F, 0.25F, 0.75F, 0.625F, 0.75F); ++ super.addCollisionBoxesToList(par1World, par2, par3, par4, par5AxisAlignedBB, par6List, par7Entity); + } + + this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F); + } + +- public void setBlockBoundsBasedOnState(IBlockAccess var1, int var2, int var3, int var4) { +- int var5 = var1.getBlockMetadata(var2, var3, var4); ++ /** ++ * Updates the blocks bounds based on its current state. Args: world, x, y, z ++ */ ++ public void setBlockBoundsBasedOnState(IBlockAccess par1IBlockAccess, int par2, int par3, int par4) { ++ int var5 = par1IBlockAccess.getBlockMetadata(par2, par3, par4); + float var6 = 0.25F; +- switch(getDirectionMeta(var5)) { +- case 0: +- this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.25F, 1.0F); +- break; +- case 1: +- this.setBlockBounds(0.0F, 12.0F / 16.0F, 0.0F, 1.0F, 1.0F, 1.0F); +- break; +- case 2: +- this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 0.25F); +- break; +- case 3: +- this.setBlockBounds(0.0F, 0.0F, 12.0F / 16.0F, 1.0F, 1.0F, 1.0F); +- break; +- case 4: +- this.setBlockBounds(0.0F, 0.0F, 0.0F, 0.25F, 1.0F, 1.0F); +- break; +- case 5: +- this.setBlockBounds(12.0F / 16.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F); ++ ++ switch (getDirectionMeta(var5)) { ++ case 0: ++ this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.25F, 1.0F); ++ break; ++ ++ case 1: ++ this.setBlockBounds(0.0F, 0.75F, 0.0F, 1.0F, 1.0F, 1.0F); ++ break; ++ ++ case 2: ++ this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 0.25F); ++ break; ++ ++ case 3: ++ this.setBlockBounds(0.0F, 0.0F, 0.75F, 1.0F, 1.0F, 1.0F); ++ break; ++ ++ case 4: ++ this.setBlockBounds(0.0F, 0.0F, 0.0F, 0.25F, 1.0F, 1.0F); ++ break; ++ ++ case 5: ++ this.setBlockBounds(0.75F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F); + } +- + } + +- public void onNeighborBlockChange(World var1, int var2, int var3, int var4, int var5) { +- int var6 = getDirectionMeta(var1.getBlockMetadata(var2, var3, var4)); +- int var7 = var1.getBlockId(var2 - Facing.offsetsXForSide[var6], var3 - Facing.offsetsYForSide[var6], var4 - Facing.offsetsZForSide[var6]); +- if(var7 != Block.pistonBase.blockID && var7 != Block.pistonStickyBase.blockID) { +- var1.setBlockToAir(var2, var3, var4); ++ /** ++ * Lets the block know when one of its neighbor changes. Doesn't know which neighbor changed (coordinates passed are ++ * their own) Args: x, y, z, neighbor blockID ++ */ ++ public void onNeighborBlockChange(World par1World, int par2, int par3, int par4, int par5) { ++ int var6 = getDirectionMeta(par1World.getBlockMetadata(par2, par3, par4)); ++ int var7 = par1World.getBlockId(par2 - Facing.offsetsXForSide[var6], par3 - Facing.offsetsYForSide[var6], par4 - Facing.offsetsZForSide[var6]); ++ ++ if (var7 != Block.pistonBase.blockID && var7 != Block.pistonStickyBase.blockID) { ++ par1World.setBlockToAir(par2, par3, par4); + } else { +- Block.blocksList[var7].onNeighborBlockChange(var1, var2 - Facing.offsetsXForSide[var6], var3 - Facing.offsetsYForSide[var6], var4 - Facing.offsetsZForSide[var6], var5); ++ Block.blocksList[var7].onNeighborBlockChange(par1World, par2 - Facing.offsetsXForSide[var6], par3 - Facing.offsetsYForSide[var6], par4 - Facing.offsetsZForSide[var6], par5); + } +- +- } +- +- public static int getDirectionMeta(int var0) { +- return var0 & 7; +- } +- +- public int idPicked(World var1, int var2, int var3, int var4) { +- int var5 = var1.getBlockMetadata(var2, var3, var4); ++ } ++ ++ public static int getDirectionMeta(int par0) { ++ return par0 & 7; ++ } ++ ++ /** ++ * only called by clickMiddleMouseButton , and passed to inventory.setCurrentItem (along with isCreative) ++ */ ++ public int idPicked(World par1World, int par2, int par3, int par4) { ++ int var5 = par1World.getBlockMetadata(par2, par3, par4); + return (var5 & 8) != 0 ? Block.pistonStickyBase.blockID : Block.pistonBase.blockID; + } + } diff --git a/patches/net/minecraft/src/BlockPistonMoving.java.patch b/patches/net/minecraft/src/BlockPistonMoving.java.patch new file mode 100644 index 0000000..4f87ae9 --- /dev/null +++ b/patches/net/minecraft/src/BlockPistonMoving.java.patch @@ -0,0 +1,303 @@ +--- net/minecraft/src/BlockPistonMoving.java ++++ net/minecraft/src/BlockPistonMoving.java +@@ -3,142 +3,195 @@ + import java.util.Random; + + public class BlockPistonMoving extends BlockContainer { +- public BlockPistonMoving(int var1) { +- super(var1, Material.piston); ++ public BlockPistonMoving(int par1) { ++ super(par1, Material.piston); + this.setHardness(-1.0F); + } + +- public TileEntity createNewTileEntity(World var1) { ++ /** ++ * Returns a new instance of a block's tile entity class. Called on placing the block. ++ */ ++ public TileEntity createNewTileEntity(World par1World) { + return null; + } + +- public void onBlockAdded(World var1, int var2, int var3, int var4) { +- } +- +- public void breakBlock(World var1, int var2, int var3, int var4, int var5, int var6) { +- TileEntity var7 = var1.getBlockTileEntity(var2, var3, var4); +- if(var7 instanceof TileEntityPiston) { ++ /** ++ * Called whenever the block is added into the world. Args: world, x, y, z ++ */ ++ public void onBlockAdded(World par1World, int par2, int par3, int par4) {} ++ ++ /** ++ * Called on server worlds only when the block has been replaced by a different block ID, or the same block with a ++ * different metadata value, but before the new metadata value is set. Args: World, x, y, z, old block ID, old metadata ++ */ ++ public void breakBlock(World par1World, int par2, int par3, int par4, int par5, int par6) { ++ TileEntity var7 = par1World.getBlockTileEntity(par2, par3, par4); ++ ++ if (var7 instanceof TileEntityPiston) { + ((TileEntityPiston)var7).clearPistonTileEntity(); + } else { +- super.breakBlock(var1, var2, var3, var4, var5, var6); ++ super.breakBlock(par1World, par2, par3, par4, par5, par6); + } +- +- } +- +- public boolean canPlaceBlockAt(World var1, int var2, int var3, int var4) { +- return false; +- } +- +- public boolean canPlaceBlockOnSide(World var1, int var2, int var3, int var4, int var5) { +- return false; +- } +- ++ } ++ ++ /** ++ * Checks to see if its valid to put this block at the specified coordinates. Args: world, x, y, z ++ */ ++ public boolean canPlaceBlockAt(World par1World, int par2, int par3, int par4) { ++ return false; ++ } ++ ++ /** ++ * checks to see if you can place this block can be placed on that side of a block: BlockLever overrides ++ */ ++ public boolean canPlaceBlockOnSide(World par1World, int par2, int par3, int par4, int par5) { ++ return false; ++ } ++ ++ /** ++ * The type of render function that is called for this block ++ */ + public int getRenderType() { + return -1; + } + ++ /** ++ * Is this block (a) opaque and (b) a full 1m cube? This determines whether or not to render the shared face of two ++ * adjacent blocks and also whether the player can attach torches, redstone wire, etc to this block. ++ */ + public boolean isOpaqueCube() { + return false; + } + ++ /** ++ * If this block doesn't render as an ordinary block it will return False (examples: signs, buttons, stairs, etc) ++ */ + public boolean renderAsNormalBlock() { + return false; + } + +- public boolean onBlockActivated(World var1, int var2, int var3, int var4, EntityPlayer var5, int var6, float var7, float var8, float var9) { +- if(!var1.isRemote && var1.getBlockTileEntity(var2, var3, var4) == null) { +- var1.setBlockToAir(var2, var3, var4); ++ /** ++ * Called upon block activation (right click on the block.) ++ */ ++ public boolean onBlockActivated(World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer, int par6, float par7, float par8, float par9) { ++ if (!par1World.isRemote && par1World.getBlockTileEntity(par2, par3, par4) == null) { ++ par1World.setBlockToAir(par2, par3, par4); + return true; + } else { + return false; + } + } + +- public int idDropped(int var1, Random var2, int var3) { ++ /** ++ * Returns the ID of the items to drop on destruction. ++ */ ++ public int idDropped(int par1, Random par2Random, int par3) { + return 0; + } + +- public void dropBlockAsItemWithChance(World var1, int var2, int var3, int var4, int var5, float var6, int var7) { +- if(!var1.isRemote) { +- TileEntityPiston var8 = this.getTileEntityAtLocation(var1, var2, var3, var4); +- if(var8 != null) { +- Block.blocksList[var8.getStoredBlockID()].dropBlockAsItem(var1, var2, var3, var4, var8.getBlockMetadata(), 0); ++ /** ++ * Drops the block items with a specified chance of dropping the specified items ++ */ ++ public void dropBlockAsItemWithChance(World par1World, int par2, int par3, int par4, int par5, float par6, int par7) { ++ if (!par1World.isRemote) { ++ TileEntityPiston var8 = this.getTileEntityAtLocation(par1World, par2, par3, par4); ++ ++ if (var8 != null) { ++ Block.blocksList[var8.getStoredBlockID()].dropBlockAsItem(par1World, par2, par3, par4, var8.getBlockMetadata(), 0); + } + } + } + +- public void onNeighborBlockChange(World var1, int var2, int var3, int var4, int var5) { +- if(!var1.isRemote) { +- var1.getBlockTileEntity(var2, var3, var4); ++ /** ++ * Lets the block know when one of its neighbor changes. Doesn't know which neighbor changed (coordinates passed are ++ * their own) Args: x, y, z, neighbor blockID ++ */ ++ public void onNeighborBlockChange(World par1World, int par2, int par3, int par4, int par5) { ++ if (!par1World.isRemote) { ++ par1World.getBlockTileEntity(par2, par3, par4); + } +- +- } +- +- public static TileEntity getTileEntity(int var0, int var1, int var2, boolean var3, boolean var4) { +- return new TileEntityPiston(var0, var1, var2, var3, var4); +- } +- +- public AxisAlignedBB getCollisionBoundingBoxFromPool(World var1, int var2, int var3, int var4) { +- TileEntityPiston var5 = this.getTileEntityAtLocation(var1, var2, var3, var4); +- if(var5 == null) { ++ } ++ ++ /** ++ * gets a new TileEntityPiston created with the arguments provided. ++ */ ++ public static TileEntity getTileEntity(int par0, int par1, int par2, boolean par3, boolean par4) { ++ return new TileEntityPiston(par0, par1, par2, par3, par4); ++ } ++ ++ /** ++ * Returns a bounding box from the pool of bounding boxes (this means this box can change after the pool has been ++ * cleared to be reused) ++ */ ++ public AxisAlignedBB getCollisionBoundingBoxFromPool(World par1World, int par2, int par3, int par4) { ++ TileEntityPiston var5 = this.getTileEntityAtLocation(par1World, par2, par3, par4); ++ ++ if (var5 == null) { + return null; + } else { + float var6 = var5.getProgress(0.0F); +- if(var5.isExtending()) { ++ ++ if (var5.isExtending()) { + var6 = 1.0F - var6; + } + +- return this.getAxisAlignedBB(var1, var2, var3, var4, var5.getStoredBlockID(), var6, var5.getPistonOrientation()); ++ return this.getAxisAlignedBB(par1World, par2, par3, par4, var5.getStoredBlockID(), var6, var5.getPistonOrientation()); + } + } + +- public void setBlockBoundsBasedOnState(IBlockAccess var1, int var2, int var3, int var4) { +- TileEntityPiston var5 = this.getTileEntityAtLocation(var1, var2, var3, var4); +- if(var5 != null) { ++ /** ++ * Updates the blocks bounds based on its current state. Args: world, x, y, z ++ */ ++ public void setBlockBoundsBasedOnState(IBlockAccess par1IBlockAccess, int par2, int par3, int par4) { ++ TileEntityPiston var5 = this.getTileEntityAtLocation(par1IBlockAccess, par2, par3, par4); ++ ++ if (var5 != null) { + Block var6 = Block.blocksList[var5.getStoredBlockID()]; +- if(var6 == null || var6 == this) { ++ ++ if (var6 == null || var6 == this) { + return; + } + +- var6.setBlockBoundsBasedOnState(var1, var2, var3, var4); ++ var6.setBlockBoundsBasedOnState(par1IBlockAccess, par2, par3, par4); + float var7 = var5.getProgress(0.0F); +- if(var5.isExtending()) { ++ ++ if (var5.isExtending()) { + var7 = 1.0F - var7; + } + + int var8 = var5.getPistonOrientation(); +- this.minX = var6.getMinX() - (double)((float)Facing.offsetsXForSide[var8] * var7); ++ this.minX = var6.getBlockBoundsMinX() - (double)((float)Facing.offsetsXForSide[var8] * var7); + this.minY = var6.getBlockBoundsMinY() - (double)((float)Facing.offsetsYForSide[var8] * var7); + this.minZ = var6.getBlockBoundsMinZ() - (double)((float)Facing.offsetsZForSide[var8] * var7); + this.maxX = var6.getBlockBoundsMaxX() - (double)((float)Facing.offsetsXForSide[var8] * var7); + this.maxY = var6.getBlockBoundsMaxY() - (double)((float)Facing.offsetsYForSide[var8] * var7); + this.maxZ = var6.getBlockBoundsMaxZ() - (double)((float)Facing.offsetsZForSide[var8] * var7); + } +- + } + +- public AxisAlignedBB getAxisAlignedBB(World var1, int var2, int var3, int var4, int var5, float var6, int var7) { +- if(var5 != 0 && var5 != this.blockID) { +- AxisAlignedBB var8 = Block.blocksList[var5].getCollisionBoundingBoxFromPool(var1, var2, var3, var4); +- if(var8 == null) { ++ public AxisAlignedBB getAxisAlignedBB(World par1World, int par2, int par3, int par4, int par5, float par6, int par7) { ++ if (par5 != 0 && par5 != this.blockID) { ++ AxisAlignedBB var8 = Block.blocksList[par5].getCollisionBoundingBoxFromPool(par1World, par2, par3, par4); ++ ++ if (var8 == null) { + return null; + } else { +- if(Facing.offsetsXForSide[var7] < 0) { +- var8.minX -= (double)((float)Facing.offsetsXForSide[var7] * var6); +- } else { +- var8.maxX -= (double)((float)Facing.offsetsXForSide[var7] * var6); +- } +- +- if(Facing.offsetsYForSide[var7] < 0) { +- var8.minY -= (double)((float)Facing.offsetsYForSide[var7] * var6); +- } else { +- var8.maxY -= (double)((float)Facing.offsetsYForSide[var7] * var6); +- } +- +- if(Facing.offsetsZForSide[var7] < 0) { +- var8.minZ -= (double)((float)Facing.offsetsZForSide[var7] * var6); +- } else { +- var8.maxZ -= (double)((float)Facing.offsetsZForSide[var7] * var6); ++ if (Facing.offsetsXForSide[par7] < 0) { ++ var8.minX -= (double)((float)Facing.offsetsXForSide[par7] * par6); ++ } else { ++ var8.maxX -= (double)((float)Facing.offsetsXForSide[par7] * par6); ++ } ++ ++ if (Facing.offsetsYForSide[par7] < 0) { ++ var8.minY -= (double)((float)Facing.offsetsYForSide[par7] * par6); ++ } else { ++ var8.maxY -= (double)((float)Facing.offsetsYForSide[par7] * par6); ++ } ++ ++ if (Facing.offsetsZForSide[par7] < 0) { ++ var8.minZ -= (double)((float)Facing.offsetsZForSide[par7] * par6); ++ } else { ++ var8.maxZ -= (double)((float)Facing.offsetsZForSide[par7] * par6); + } + + return var8; +@@ -148,16 +201,26 @@ + } + } + +- private TileEntityPiston getTileEntityAtLocation(IBlockAccess var1, int var2, int var3, int var4) { +- TileEntity var5 = var1.getBlockTileEntity(var2, var3, var4); ++ /** ++ * gets the piston tile entity at the specified location ++ */ ++ private TileEntityPiston getTileEntityAtLocation(IBlockAccess par1IBlockAccess, int par2, int par3, int par4) { ++ TileEntity var5 = par1IBlockAccess.getBlockTileEntity(par2, par3, par4); + return var5 instanceof TileEntityPiston ? (TileEntityPiston)var5 : null; + } + +- public int idPicked(World var1, int var2, int var3, int var4) { ++ /** ++ * only called by clickMiddleMouseButton , and passed to inventory.setCurrentItem (along with isCreative) ++ */ ++ public int idPicked(World par1World, int par2, int par3, int par4) { + return 0; + } + +- public void registerIcons(IconRegister var1) { +- this.blockIcon = var1.registerIcon("piston_top_normal"); ++ /** ++ * When this method is called, your block should register all the icons it needs with the given IconRegister. This is ++ * the only chance you get to register icons. ++ */ ++ public void registerIcons(IconRegister par1IconRegister) { ++ this.blockIcon = par1IconRegister.registerIcon("piston_top_normal"); + } + } diff --git a/patches/net/minecraft/src/BlockPortal.java.patch b/patches/net/minecraft/src/BlockPortal.java.patch new file mode 100644 index 0000000..fdf69c4 --- /dev/null +++ b/patches/net/minecraft/src/BlockPortal.java.patch @@ -0,0 +1,333 @@ +--- net/minecraft/src/BlockPortal.java ++++ net/minecraft/src/BlockPortal.java +@@ -3,95 +3,122 @@ + import java.util.Random; + + public class BlockPortal extends BlockBreakable { +- public BlockPortal(int var1) { +- super(var1, "portal", Material.portal, false); ++ public BlockPortal(int par1) { ++ super(par1, "portal", Material.portal, false); + this.setTickRandomly(true); + } + +- public void updateTick(World var1, int var2, int var3, int var4, Random var5) { +- super.updateTick(var1, var2, var3, var4, var5); +- if(var1.provider.isSurfaceWorld() && var5.nextInt(2000) < var1.difficultySetting) { ++ /** ++ * Ticks the block if it's been scheduled ++ */ ++ public void updateTick(World par1World, int par2, int par3, int par4, Random par5Random) { ++ super.updateTick(par1World, par2, par3, par4, par5Random); ++ ++ if (par1World.provider.isSurfaceWorld() && par5Random.nextInt(2000) < par1World.difficultySetting) { + int var6; +- for(var6 = var3; !var1.doesBlockHaveSolidTopSurface(var2, var6, var4) && var6 > 0; --var6) { ++ ++ for (var6 = par3; !par1World.doesBlockHaveSolidTopSurface(par2, var6, par4) && var6 > 0; --var6) { ++ ; + } + +- if(var6 > 0 && !var1.isBlockNormalCube(var2, var6 + 1, var4)) { +- Entity var7 = ItemMonsterPlacer.spawnCreature(var1, 57, (double)var2 + 0.5D, (double)var6 + 1.1D, (double)var4 + 0.5D); +- if(var7 != null) { ++ if (var6 > 0 && !par1World.isBlockNormalCube(par2, var6 + 1, par4)) { ++ Entity var7 = ItemMonsterPlacer.spawnCreature(par1World, 57, (double)par2 + 0.5D, (double)var6 + 1.1D, (double)par4 + 0.5D); ++ ++ if (var7 != null) { + var7.timeUntilPortal = var7.getPortalCooldown(); + } + } + } +- + } + +- public AxisAlignedBB getCollisionBoundingBoxFromPool(World var1, int var2, int var3, int var4) { ++ /** ++ * Returns a bounding box from the pool of bounding boxes (this means this box can change after the pool has been ++ * cleared to be reused) ++ */ ++ public AxisAlignedBB getCollisionBoundingBoxFromPool(World par1World, int par2, int par3, int par4) { + return null; + } + +- public void setBlockBoundsBasedOnState(IBlockAccess var1, int var2, int var3, int var4) { ++ /** ++ * Updates the blocks bounds based on its current state. Args: world, x, y, z ++ */ ++ public void setBlockBoundsBasedOnState(IBlockAccess par1IBlockAccess, int par2, int par3, int par4) { + float var5; + float var6; +- if(var1.getBlockId(var2 - 1, var3, var4) != this.blockID && var1.getBlockId(var2 + 1, var3, var4) != this.blockID) { +- var5 = 2.0F / 16.0F; ++ ++ if (par1IBlockAccess.getBlockId(par2 - 1, par3, par4) != this.blockID && par1IBlockAccess.getBlockId(par2 + 1, par3, par4) != this.blockID) { ++ var5 = 0.125F; + var6 = 0.5F; + this.setBlockBounds(0.5F - var5, 0.0F, 0.5F - var6, 0.5F + var5, 1.0F, 0.5F + var6); + } else { + var5 = 0.5F; +- var6 = 2.0F / 16.0F; ++ var6 = 0.125F; + this.setBlockBounds(0.5F - var5, 0.0F, 0.5F - var6, 0.5F + var5, 1.0F, 0.5F + var6); + } +- + } + ++ /** ++ * Is this block (a) opaque and (b) a full 1m cube? This determines whether or not to render the shared face of two ++ * adjacent blocks and also whether the player can attach torches, redstone wire, etc to this block. ++ */ + public boolean isOpaqueCube() { + return false; + } + ++ /** ++ * If this block doesn't render as an ordinary block it will return False (examples: signs, buttons, stairs, etc) ++ */ + public boolean renderAsNormalBlock() { + return false; + } + +- public boolean tryToCreatePortal(World var1, int var2, int var3, int var4) { ++ /** ++ * Checks to see if this location is valid to create a portal and will return True if it does. Args: world, x, y, z ++ */ ++ public boolean tryToCreatePortal(World par1World, int par2, int par3, int par4) { + byte var5 = 0; + byte var6 = 0; +- if(var1.getBlockId(var2 - 1, var3, var4) == Block.obsidian.blockID || var1.getBlockId(var2 + 1, var3, var4) == Block.obsidian.blockID) { ++ ++ if (par1World.getBlockId(par2 - 1, par3, par4) == Block.obsidian.blockID || par1World.getBlockId(par2 + 1, par3, par4) == Block.obsidian.blockID) { + var5 = 1; + } + +- if(var1.getBlockId(var2, var3, var4 - 1) == Block.obsidian.blockID || var1.getBlockId(var2, var3, var4 + 1) == Block.obsidian.blockID) { ++ if (par1World.getBlockId(par2, par3, par4 - 1) == Block.obsidian.blockID || par1World.getBlockId(par2, par3, par4 + 1) == Block.obsidian.blockID) { + var6 = 1; + } + +- if(var5 == var6) { ++ if (var5 == var6) { + return false; + } else { +- if(var1.getBlockId(var2 - var5, var3, var4 - var6) == 0) { +- var2 -= var5; +- var4 -= var6; ++ if (par1World.getBlockId(par2 - var5, par3, par4 - var6) == 0) { ++ par2 -= var5; ++ par4 -= var6; + } + + int var7; + int var8; +- for(var7 = -1; var7 <= 2; ++var7) { +- for(var8 = -1; var8 <= 3; ++var8) { ++ ++ for (var7 = -1; var7 <= 2; ++var7) { ++ for (var8 = -1; var8 <= 3; ++var8) { + boolean var9 = var7 == -1 || var7 == 2 || var8 == -1 || var8 == 3; +- if(var7 != -1 && var7 != 2 || var8 != -1 && var8 != 3) { +- int var10 = var1.getBlockId(var2 + var5 * var7, var3 + var8, var4 + var6 * var7); +- if(var9) { +- if(var10 != Block.obsidian.blockID) { ++ ++ if (var7 != -1 && var7 != 2 || var8 != -1 && var8 != 3) { ++ int var10 = par1World.getBlockId(par2 + var5 * var7, par3 + var8, par4 + var6 * var7); ++ ++ if (var9) { ++ if (var10 != Block.obsidian.blockID) { + return false; + } +- } else if(var10 != 0 && var10 != Block.fire.blockID) { ++ } else if (var10 != 0 && var10 != Block.fire.blockID) { + return false; + } + } + } + } + +- for(var7 = 0; var7 < 2; ++var7) { +- for(var8 = 0; var8 < 3; ++var8) { +- var1.setBlock(var2 + var5 * var7, var3 + var8, var4 + var6 * var7, Block.portal.blockID, 0, 2); ++ for (var7 = 0; var7 < 2; ++var7) { ++ for (var8 = 0; var8 < 3; ++var8) { ++ par1World.setBlock(par2 + var5 * var7, par3 + var8, par4 + var6 * var7, Block.portal.blockID, 0, 2); + } + } + +@@ -99,101 +126,128 @@ + } + } + +- public void onNeighborBlockChange(World var1, int var2, int var3, int var4, int var5) { ++ /** ++ * Lets the block know when one of its neighbor changes. Doesn't know which neighbor changed (coordinates passed are ++ * their own) Args: x, y, z, neighbor blockID ++ */ ++ public void onNeighborBlockChange(World par1World, int par2, int par3, int par4, int par5) { + byte var6 = 0; + byte var7 = 1; +- if(var1.getBlockId(var2 - 1, var3, var4) == this.blockID || var1.getBlockId(var2 + 1, var3, var4) == this.blockID) { ++ ++ if (par1World.getBlockId(par2 - 1, par3, par4) == this.blockID || par1World.getBlockId(par2 + 1, par3, par4) == this.blockID) { + var6 = 1; + var7 = 0; + } + + int var8; +- for(var8 = var3; var1.getBlockId(var2, var8 - 1, var4) == this.blockID; --var8) { ++ ++ for (var8 = par3; par1World.getBlockId(par2, var8 - 1, par4) == this.blockID; --var8) { ++ ; + } + +- if(var1.getBlockId(var2, var8 - 1, var4) != Block.obsidian.blockID) { +- var1.setBlockToAir(var2, var3, var4); ++ if (par1World.getBlockId(par2, var8 - 1, par4) != Block.obsidian.blockID) { ++ par1World.setBlockToAir(par2, par3, par4); + } else { + int var9; +- for(var9 = 1; var9 < 4 && var1.getBlockId(var2, var8 + var9, var4) == this.blockID; ++var9) { ++ ++ for (var9 = 1; var9 < 4 && par1World.getBlockId(par2, var8 + var9, par4) == this.blockID; ++var9) { ++ ; + } + +- if(var9 == 3 && var1.getBlockId(var2, var8 + var9, var4) == Block.obsidian.blockID) { +- boolean var10 = var1.getBlockId(var2 - 1, var3, var4) == this.blockID || var1.getBlockId(var2 + 1, var3, var4) == this.blockID; +- boolean var11 = var1.getBlockId(var2, var3, var4 - 1) == this.blockID || var1.getBlockId(var2, var3, var4 + 1) == this.blockID; +- if(var10 && var11) { +- var1.setBlockToAir(var2, var3, var4); ++ if (var9 == 3 && par1World.getBlockId(par2, var8 + var9, par4) == Block.obsidian.blockID) { ++ boolean var10 = par1World.getBlockId(par2 - 1, par3, par4) == this.blockID || par1World.getBlockId(par2 + 1, par3, par4) == this.blockID; ++ boolean var11 = par1World.getBlockId(par2, par3, par4 - 1) == this.blockID || par1World.getBlockId(par2, par3, par4 + 1) == this.blockID; ++ ++ if (var10 && var11) { ++ par1World.setBlockToAir(par2, par3, par4); + } else { +- if((var1.getBlockId(var2 + var6, var3, var4 + var7) != Block.obsidian.blockID || var1.getBlockId(var2 - var6, var3, var4 - var7) != this.blockID) && (var1.getBlockId(var2 - var6, var3, var4 - var7) != Block.obsidian.blockID || var1.getBlockId(var2 + var6, var3, var4 + var7) != this.blockID)) { +- var1.setBlockToAir(var2, var3, var4); ++ if ((par1World.getBlockId(par2 + var6, par3, par4 + var7) != Block.obsidian.blockID || par1World.getBlockId(par2 - var6, par3, par4 - var7) != this.blockID) && (par1World.getBlockId(par2 - var6, par3, par4 - var7) != Block.obsidian.blockID || par1World.getBlockId(par2 + var6, par3, par4 + var7) != this.blockID)) { ++ par1World.setBlockToAir(par2, par3, par4); + } +- + } + } else { +- var1.setBlockToAir(var2, var3, var4); ++ par1World.setBlockToAir(par2, par3, par4); + } + } + } + +- public boolean shouldSideBeRendered(IBlockAccess var1, int var2, int var3, int var4, int var5) { +- if(var1.getBlockId(var2, var3, var4) == this.blockID) { ++ /** ++ * Returns true if the given side of this block type should be rendered, if the adjacent block is at the given ++ * coordinates. Args: blockAccess, x, y, z, side ++ */ ++ public boolean shouldSideBeRendered(IBlockAccess par1IBlockAccess, int par2, int par3, int par4, int par5) { ++ if (par1IBlockAccess.getBlockId(par2, par3, par4) == this.blockID) { + return false; + } else { +- boolean var6 = var1.getBlockId(var2 - 1, var3, var4) == this.blockID && var1.getBlockId(var2 - 2, var3, var4) != this.blockID; +- boolean var7 = var1.getBlockId(var2 + 1, var3, var4) == this.blockID && var1.getBlockId(var2 + 2, var3, var4) != this.blockID; +- boolean var8 = var1.getBlockId(var2, var3, var4 - 1) == this.blockID && var1.getBlockId(var2, var3, var4 - 2) != this.blockID; +- boolean var9 = var1.getBlockId(var2, var3, var4 + 1) == this.blockID && var1.getBlockId(var2, var3, var4 + 2) != this.blockID; ++ boolean var6 = par1IBlockAccess.getBlockId(par2 - 1, par3, par4) == this.blockID && par1IBlockAccess.getBlockId(par2 - 2, par3, par4) != this.blockID; ++ boolean var7 = par1IBlockAccess.getBlockId(par2 + 1, par3, par4) == this.blockID && par1IBlockAccess.getBlockId(par2 + 2, par3, par4) != this.blockID; ++ boolean var8 = par1IBlockAccess.getBlockId(par2, par3, par4 - 1) == this.blockID && par1IBlockAccess.getBlockId(par2, par3, par4 - 2) != this.blockID; ++ boolean var9 = par1IBlockAccess.getBlockId(par2, par3, par4 + 1) == this.blockID && par1IBlockAccess.getBlockId(par2, par3, par4 + 2) != this.blockID; + boolean var10 = var6 || var7; + boolean var11 = var8 || var9; +- return var10 && var5 == 4 ? true : (var10 && var5 == 5 ? true : (var11 && var5 == 2 ? true : var11 && var5 == 3)); ++ return var10 && par5 == 4 ? true : (var10 && par5 == 5 ? true : (var11 && par5 == 2 ? true : var11 && par5 == 3)); + } + } + +- public int quantityDropped(Random var1) { ++ /** ++ * Returns the quantity of items to drop on block destruction. ++ */ ++ public int quantityDropped(Random par1Random) { + return 0; + } + ++ /** ++ * Returns which pass should this block be rendered on. 0 for solids and 1 for alpha ++ */ + public int getRenderBlockPass() { + return 1; + } + +- public void onEntityCollidedWithBlock(World var1, int var2, int var3, int var4, Entity var5) { +- if(var5.ridingEntity == null && var5.riddenByEntity == null) { +- var5.setInPortal(); ++ /** ++ * Triggered whenever an entity collides with this block (enters into the block). Args: world, x, y, z, entity ++ */ ++ public void onEntityCollidedWithBlock(World par1World, int par2, int par3, int par4, Entity par5Entity) { ++ if (par5Entity.ridingEntity == null && par5Entity.riddenByEntity == null) { ++ par5Entity.setInPortal(); + } +- + } + +- public void randomDisplayTick(World var1, int var2, int var3, int var4, Random var5) { +- if(var5.nextInt(100) == 0) { +- var1.playSound((double)var2 + 0.5D, (double)var3 + 0.5D, (double)var4 + 0.5D, "portal.portal", 0.5F, var5.nextFloat() * 0.4F + 0.8F, false); ++ /** ++ * A randomly called display update to be able to add particles or other items for display ++ */ ++ public void randomDisplayTick(World par1World, int par2, int par3, int par4, Random par5Random) { ++ if (par5Random.nextInt(100) == 0) { ++ par1World.playSound((double)par2 + 0.5D, (double)par3 + 0.5D, (double)par4 + 0.5D, "portal.portal", 0.5F, par5Random.nextFloat() * 0.4F + 0.8F, false); + } + +- for(int var6 = 0; var6 < 4; ++var6) { +- double var7 = (double)((float)var2 + var5.nextFloat()); +- double var9 = (double)((float)var3 + var5.nextFloat()); +- double var11 = (double)((float)var4 + var5.nextFloat()); ++ for (int var6 = 0; var6 < 4; ++var6) { ++ double var7 = (double)((float)par2 + par5Random.nextFloat()); ++ double var9 = (double)((float)par3 + par5Random.nextFloat()); ++ double var11 = (double)((float)par4 + par5Random.nextFloat()); + double var13 = 0.0D; + double var15 = 0.0D; + double var17 = 0.0D; +- int var19 = var5.nextInt(2) * 2 - 1; +- var13 = ((double)var5.nextFloat() - 0.5D) * 0.5D; +- var15 = ((double)var5.nextFloat() - 0.5D) * 0.5D; +- var17 = ((double)var5.nextFloat() - 0.5D) * 0.5D; +- if(var1.getBlockId(var2 - 1, var3, var4) != this.blockID && var1.getBlockId(var2 + 1, var3, var4) != this.blockID) { +- var7 = (double)var2 + 0.5D + 0.25D * (double)var19; +- var13 = (double)(var5.nextFloat() * 2.0F * (float)var19); ++ int var19 = par5Random.nextInt(2) * 2 - 1; ++ var13 = ((double)par5Random.nextFloat() - 0.5D) * 0.5D; ++ var15 = ((double)par5Random.nextFloat() - 0.5D) * 0.5D; ++ var17 = ((double)par5Random.nextFloat() - 0.5D) * 0.5D; ++ ++ if (par1World.getBlockId(par2 - 1, par3, par4) != this.blockID && par1World.getBlockId(par2 + 1, par3, par4) != this.blockID) { ++ var7 = (double)par2 + 0.5D + 0.25D * (double)var19; ++ var13 = (double)(par5Random.nextFloat() * 2.0F * (float)var19); + } else { +- var11 = (double)var4 + 0.5D + 0.25D * (double)var19; +- var17 = (double)(var5.nextFloat() * 2.0F * (float)var19); ++ var11 = (double)par4 + 0.5D + 0.25D * (double)var19; ++ var17 = (double)(par5Random.nextFloat() * 2.0F * (float)var19); + } + +- var1.spawnParticle("portal", var7, var9, var11, var13, var15, var17); ++ par1World.spawnParticle("portal", var7, var9, var11, var13, var15, var17); + } +- + } + +- public int idPicked(World var1, int var2, int var3, int var4) { ++ /** ++ * only called by clickMiddleMouseButton , and passed to inventory.setCurrentItem (along with isCreative) ++ */ ++ public int idPicked(World par1World, int par2, int par3, int par4) { + return 0; + } + } diff --git a/patches/net/minecraft/src/BlockPotato.java.patch b/patches/net/minecraft/src/BlockPotato.java.patch new file mode 100644 index 0000000..edc25bd --- /dev/null +++ b/patches/net/minecraft/src/BlockPotato.java.patch @@ -0,0 +1,81 @@ +--- net/minecraft/src/BlockPotato.java ++++ net/minecraft/src/BlockPotato.java +@@ -3,46 +3,61 @@ + public class BlockPotato extends BlockCrops { + private Icon[] iconArray; + +- public BlockPotato(int var1) { +- super(var1); ++ public BlockPotato(int par1) { ++ super(par1); + } + +- public Icon getIcon(int var1, int var2) { +- if(var2 < 7) { +- if(var2 == 6) { +- var2 = 5; ++ /** ++ * From the specified side and block metadata retrieves the blocks texture. Args: side, metadata ++ */ ++ public Icon getIcon(int par1, int par2) { ++ if (par2 < 7) { ++ if (par2 == 6) { ++ par2 = 5; + } + +- return this.iconArray[var2 >> 1]; ++ return this.iconArray[par2 >> 1]; + } else { + return this.iconArray[3]; + } + } + ++ /** ++ * Generate a seed ItemStack for this crop. ++ */ + protected int getSeedItem() { + return Item.potato.itemID; + } + ++ /** ++ * Generate a crop produce ItemStack for this crop. ++ */ + protected int getCropItem() { + return Item.potato.itemID; + } + +- public void dropBlockAsItemWithChance(World var1, int var2, int var3, int var4, int var5, float var6, int var7) { +- super.dropBlockAsItemWithChance(var1, var2, var3, var4, var5, var6, var7); +- if(!var1.isRemote) { +- if(var5 >= 7 && var1.s.nextInt(50) == 0) { +- this.dropBlockAsItem_do(var1, var2, var3, var4, new ItemStack(Item.poisonousPotato)); ++ /** ++ * Drops the block items with a specified chance of dropping the specified items ++ */ ++ public void dropBlockAsItemWithChance(World par1World, int par2, int par3, int par4, int par5, float par6, int par7) { ++ super.dropBlockAsItemWithChance(par1World, par2, par3, par4, par5, par6, par7); ++ ++ if (!par1World.isRemote) { ++ if (par5 >= 7 && par1World.rand.nextInt(50) == 0) { ++ this.dropBlockAsItem_do(par1World, par2, par3, par4, new ItemStack(Item.poisonousPotato)); + } +- + } + } + +- public void registerIcons(IconRegister var1) { ++ /** ++ * When this method is called, your block should register all the icons it needs with the given IconRegister. This is ++ * the only chance you get to register icons. ++ */ ++ public void registerIcons(IconRegister par1IconRegister) { + this.iconArray = new Icon[4]; + +- for(int var2 = 0; var2 < this.iconArray.length; ++var2) { +- this.iconArray[var2] = var1.registerIcon(this.getTextureName() + "_stage_" + var2); ++ for (int var2 = 0; var2 < this.iconArray.length; ++var2) { ++ this.iconArray[var2] = par1IconRegister.registerIcon(this.getTextureName() + "_stage_" + var2); + } +- + } + } diff --git a/patches/net/minecraft/src/BlockPoweredOre.java.patch b/patches/net/minecraft/src/BlockPoweredOre.java.patch new file mode 100644 index 0000000..638c9ac --- /dev/null +++ b/patches/net/minecraft/src/BlockPoweredOre.java.patch @@ -0,0 +1,30 @@ +--- net/minecraft/src/BlockPoweredOre.java ++++ net/minecraft/src/BlockPoweredOre.java +@@ -1,16 +1,24 @@ + package net.minecraft.src; + + public class BlockPoweredOre extends BlockOreStorage { +- public BlockPoweredOre(int var1) { +- super(var1); ++ public BlockPoweredOre(int par1) { ++ super(par1); + this.setCreativeTab(CreativeTabs.tabRedstone); + } + ++ /** ++ * Can this block provide power. Only wire currently seems to have this change based on its state. ++ */ + public boolean canProvidePower() { + return true; + } + +- public int isProvidingWeakPower(IBlockAccess var1, int var2, int var3, int var4, int var5) { ++ /** ++ * Returns true if the block is emitting indirect/weak redstone power on the specified side. If isBlockNormalCube ++ * returns true, standard redstone propagation rules will apply instead and this will not be called. Args: World, X, Y, ++ * Z, side. Note that the side is reversed - eg it is 1 (up) when checking the bottom of the block. ++ */ ++ public int isProvidingWeakPower(IBlockAccess par1IBlockAccess, int par2, int par3, int par4, int par5) { + return 15; + } + } diff --git a/patches/net/minecraft/src/BlockPressurePlate.java.patch b/patches/net/minecraft/src/BlockPressurePlate.java.patch new file mode 100644 index 0000000..b19301d --- /dev/null +++ b/patches/net/minecraft/src/BlockPressurePlate.java.patch @@ -0,0 +1,87 @@ +--- net/minecraft/src/BlockPressurePlate.java ++++ net/minecraft/src/BlockPressurePlate.java +@@ -4,41 +4,55 @@ + import java.util.List; + + public class BlockPressurePlate extends BlockBasePressurePlate { ++ ++ /** The mob type that can trigger this pressure plate. */ + private EnumMobType triggerMobType; + +- protected BlockPressurePlate(int var1, String var2, Material var3, EnumMobType var4) { +- super(var1, var2, var3); +- this.triggerMobType = var4; +- } +- +- protected int getMetaFromWeight(int var1) { +- return var1 > 0 ? 1 : 0; +- } +- +- protected int getPowerSupply(int var1) { +- return var1 == 1 ? 15 : 0; +- } +- +- protected int getPlateState(World var1, int var2, int var3, int var4) { ++ protected BlockPressurePlate(int par1, String par2Str, Material par3Material, EnumMobType par4EnumMobType) { ++ super(par1, par2Str, par3Material); ++ this.triggerMobType = par4EnumMobType; ++ } ++ ++ /** ++ * Argument is weight (0-15). Return the metadata to be set because of it. ++ */ ++ protected int getMetaFromWeight(int par1) { ++ return par1 > 0 ? 1 : 0; ++ } ++ ++ /** ++ * Argument is metadata. Returns power level (0-15) ++ */ ++ protected int getPowerSupply(int par1) { ++ return par1 == 1 ? 15 : 0; ++ } ++ ++ /** ++ * Returns the current state of the pressure plate. Returns a value between 0 and 15 based on the number of items on ++ * it. ++ */ ++ protected int getPlateState(World par1World, int par2, int par3, int par4) { + List var5 = null; +- if(this.triggerMobType == EnumMobType.everything) { +- var5 = var1.getEntitiesWithinAABBExcludingEntity((Entity)null, this.getSensitiveAABB(var2, var3, var4)); +- } +- +- if(this.triggerMobType == EnumMobType.mobs) { +- var5 = var1.getEntitiesWithinAABB(EntityLivingBase.class, this.getSensitiveAABB(var2, var3, var4)); +- } +- +- if(this.triggerMobType == EnumMobType.players) { +- var5 = var1.getEntitiesWithinAABB(EntityPlayer.class, this.getSensitiveAABB(var2, var3, var4)); +- } +- +- if(var5 != null && !var5.isEmpty()) { ++ ++ if (this.triggerMobType == EnumMobType.everything) { ++ var5 = par1World.getEntitiesWithinAABBExcludingEntity((Entity)null, this.getSensitiveAABB(par2, par3, par4)); ++ } ++ ++ if (this.triggerMobType == EnumMobType.mobs) { ++ var5 = par1World.getEntitiesWithinAABB(EntityLivingBase.class, this.getSensitiveAABB(par2, par3, par4)); ++ } ++ ++ if (this.triggerMobType == EnumMobType.players) { ++ var5 = par1World.getEntitiesWithinAABB(EntityPlayer.class, this.getSensitiveAABB(par2, par3, par4)); ++ } ++ ++ if (var5 != null && !var5.isEmpty()) { + Iterator var6 = var5.iterator(); + +- while(var6.hasNext()) { ++ while (var6.hasNext()) { + Entity var7 = (Entity)var6.next(); +- if(!var7.doesEntityNotTriggerPressurePlate()) { ++ ++ if (!var7.doesEntityNotTriggerPressurePlate()) { + return 15; + } + } diff --git a/patches/net/minecraft/src/BlockPressurePlateWeighted.java.patch b/patches/net/minecraft/src/BlockPressurePlateWeighted.java.patch new file mode 100644 index 0000000..decf46c --- /dev/null +++ b/patches/net/minecraft/src/BlockPressurePlateWeighted.java.patch @@ -0,0 +1,78 @@ +--- net/minecraft/src/BlockPressurePlateWeighted.java ++++ net/minecraft/src/BlockPressurePlateWeighted.java +@@ -3,26 +3,33 @@ + import java.util.Iterator; + + public class BlockPressurePlateWeighted extends BlockBasePressurePlate { ++ ++ /** The maximum number of items the plate weights. */ + private final int maxItemsWeighted; + +- protected BlockPressurePlateWeighted(int var1, String var2, Material var3, int var4) { +- super(var1, var2, var3); +- this.maxItemsWeighted = var4; ++ protected BlockPressurePlateWeighted(int par1, String par2Str, Material par3Material, int par4) { ++ super(par1, par2Str, par3Material); ++ this.maxItemsWeighted = par4; + } + +- protected int getPlateState(World var1, int var2, int var3, int var4) { ++ /** ++ * Returns the current state of the pressure plate. Returns a value between 0 and 15 based on the number of items on ++ * it. ++ */ ++ protected int getPlateState(World par1World, int par2, int par3, int par4) { + int var5 = 0; +- Iterator var6 = var1.getEntitiesWithinAABB(EntityItem.class, this.getSensitiveAABB(var2, var3, var4)).iterator(); ++ Iterator var6 = par1World.getEntitiesWithinAABB(EntityItem.class, this.getSensitiveAABB(par2, par3, par4)).iterator(); + +- while(var6.hasNext()) { ++ while (var6.hasNext()) { + EntityItem var7 = (EntityItem)var6.next(); + var5 += var7.getEntityItem().stackSize; +- if(var5 >= this.maxItemsWeighted) { ++ ++ if (var5 >= this.maxItemsWeighted) { + break; + } + } + +- if(var5 <= 0) { ++ if (var5 <= 0) { + return 0; + } else { + float var8 = (float)Math.min(this.maxItemsWeighted, var5) / (float)this.maxItemsWeighted; +@@ -30,15 +37,24 @@ + } + } + +- protected int getPowerSupply(int var1) { +- return var1; +- } +- +- protected int getMetaFromWeight(int var1) { +- return var1; +- } +- +- public int tickRate(World var1) { ++ /** ++ * Argument is metadata. Returns power level (0-15) ++ */ ++ protected int getPowerSupply(int par1) { ++ return par1; ++ } ++ ++ /** ++ * Argument is weight (0-15). Return the metadata to be set because of it. ++ */ ++ protected int getMetaFromWeight(int par1) { ++ return par1; ++ } ++ ++ /** ++ * How many world ticks before ticking ++ */ ++ public int tickRate(World par1World) { + return 10; + } + } diff --git a/patches/net/minecraft/src/BlockPumpkin.java.patch b/patches/net/minecraft/src/BlockPumpkin.java.patch new file mode 100644 index 0000000..e344b5d --- /dev/null +++ b/patches/net/minecraft/src/BlockPumpkin.java.patch @@ -0,0 +1,180 @@ +--- net/minecraft/src/BlockPumpkin.java ++++ net/minecraft/src/BlockPumpkin.java +@@ -1,91 +1,112 @@ + package net.minecraft.src; + + public class BlockPumpkin extends BlockDirectional { ++ ++ /** Boolean used to seperate different states of blocks */ + private boolean blockType; + private Icon field_94474_b; + private Icon field_94475_c; + +- protected BlockPumpkin(int var1, boolean var2) { +- super(var1, Material.pumpkin); ++ protected BlockPumpkin(int par1, boolean par2) { ++ super(par1, Material.pumpkin); + this.setTickRandomly(true); +- this.blockType = var2; ++ this.blockType = par2; + this.setCreativeTab(CreativeTabs.tabBlock); + } + +- public Icon getIcon(int var1, int var2) { +- return var1 == 1 ? this.field_94474_b : (var1 == 0 ? this.field_94474_b : (var2 == 2 && var1 == 2 ? this.field_94475_c : (var2 == 3 && var1 == 5 ? this.field_94475_c : (var2 == 0 && var1 == 3 ? this.field_94475_c : (var2 == 1 && var1 == 4 ? this.field_94475_c : this.blockIcon))))); ++ /** ++ * From the specified side and block metadata retrieves the blocks texture. Args: side, metadata ++ */ ++ public Icon getIcon(int par1, int par2) { ++ return par1 == 1 ? this.field_94474_b : (par1 == 0 ? this.field_94474_b : (par2 == 2 && par1 == 2 ? this.field_94475_c : (par2 == 3 && par1 == 5 ? this.field_94475_c : (par2 == 0 && par1 == 3 ? this.field_94475_c : (par2 == 1 && par1 == 4 ? this.field_94475_c : this.blockIcon))))); + } + +- public void onBlockAdded(World var1, int var2, int var3, int var4) { +- super.onBlockAdded(var1, var2, var3, var4); +- if(var1.getBlockId(var2, var3 - 1, var4) == Block.blockSnow.blockID && var1.getBlockId(var2, var3 - 2, var4) == Block.blockSnow.blockID) { +- if(!var1.isRemote) { +- var1.setBlock(var2, var3, var4, 0, 0, 2); +- var1.setBlock(var2, var3 - 1, var4, 0, 0, 2); +- var1.setBlock(var2, var3 - 2, var4, 0, 0, 2); +- EntitySnowman var9 = new EntitySnowman(var1); +- var9.setLocationAndAngles((double)var2 + 0.5D, (double)var3 - 1.95D, (double)var4 + 0.5D, 0.0F, 0.0F); +- var1.spawnEntityInWorld(var9); +- var1.notifyBlockChange(var2, var3, var4, 0); +- var1.notifyBlockChange(var2, var3 - 1, var4, 0); +- var1.notifyBlockChange(var2, var3 - 2, var4, 0); +- } +- +- for(int var10 = 0; var10 < 120; ++var10) { +- var1.spawnParticle("snowshovel", (double)var2 + var1.s.nextDouble(), (double)(var3 - 2) + var1.s.nextDouble() * 2.5D, (double)var4 + var1.s.nextDouble(), 0.0D, 0.0D, 0.0D); +- } +- } else if(var1.getBlockId(var2, var3 - 1, var4) == Block.blockIron.blockID && var1.getBlockId(var2, var3 - 2, var4) == Block.blockIron.blockID) { +- boolean var5 = var1.getBlockId(var2 - 1, var3 - 1, var4) == Block.blockIron.blockID && var1.getBlockId(var2 + 1, var3 - 1, var4) == Block.blockIron.blockID; +- boolean var6 = var1.getBlockId(var2, var3 - 1, var4 - 1) == Block.blockIron.blockID && var1.getBlockId(var2, var3 - 1, var4 + 1) == Block.blockIron.blockID; +- if(var5 || var6) { +- var1.setBlock(var2, var3, var4, 0, 0, 2); +- var1.setBlock(var2, var3 - 1, var4, 0, 0, 2); +- var1.setBlock(var2, var3 - 2, var4, 0, 0, 2); +- if(var5) { +- var1.setBlock(var2 - 1, var3 - 1, var4, 0, 0, 2); +- var1.setBlock(var2 + 1, var3 - 1, var4, 0, 0, 2); ++ /** ++ * Called whenever the block is added into the world. Args: world, x, y, z ++ */ ++ public void onBlockAdded(World par1World, int par2, int par3, int par4) { ++ super.onBlockAdded(par1World, par2, par3, par4); ++ ++ if (par1World.getBlockId(par2, par3 - 1, par4) == Block.blockSnow.blockID && par1World.getBlockId(par2, par3 - 2, par4) == Block.blockSnow.blockID) { ++ if (!par1World.isRemote) { ++ par1World.setBlock(par2, par3, par4, 0, 0, 2); ++ par1World.setBlock(par2, par3 - 1, par4, 0, 0, 2); ++ par1World.setBlock(par2, par3 - 2, par4, 0, 0, 2); ++ EntitySnowman var9 = new EntitySnowman(par1World); ++ var9.setLocationAndAngles((double)par2 + 0.5D, (double)par3 - 1.95D, (double)par4 + 0.5D, 0.0F, 0.0F); ++ par1World.spawnEntityInWorld(var9); ++ par1World.notifyBlockChange(par2, par3, par4, 0); ++ par1World.notifyBlockChange(par2, par3 - 1, par4, 0); ++ par1World.notifyBlockChange(par2, par3 - 2, par4, 0); ++ } ++ ++ for (int var10 = 0; var10 < 120; ++var10) { ++ par1World.spawnParticle("snowshovel", (double)par2 + par1World.rand.nextDouble(), (double)(par3 - 2) + par1World.rand.nextDouble() * 2.5D, (double)par4 + par1World.rand.nextDouble(), 0.0D, 0.0D, 0.0D); ++ } ++ } else if (par1World.getBlockId(par2, par3 - 1, par4) == Block.blockIron.blockID && par1World.getBlockId(par2, par3 - 2, par4) == Block.blockIron.blockID) { ++ boolean var5 = par1World.getBlockId(par2 - 1, par3 - 1, par4) == Block.blockIron.blockID && par1World.getBlockId(par2 + 1, par3 - 1, par4) == Block.blockIron.blockID; ++ boolean var6 = par1World.getBlockId(par2, par3 - 1, par4 - 1) == Block.blockIron.blockID && par1World.getBlockId(par2, par3 - 1, par4 + 1) == Block.blockIron.blockID; ++ ++ if (var5 || var6) { ++ par1World.setBlock(par2, par3, par4, 0, 0, 2); ++ par1World.setBlock(par2, par3 - 1, par4, 0, 0, 2); ++ par1World.setBlock(par2, par3 - 2, par4, 0, 0, 2); ++ ++ if (var5) { ++ par1World.setBlock(par2 - 1, par3 - 1, par4, 0, 0, 2); ++ par1World.setBlock(par2 + 1, par3 - 1, par4, 0, 0, 2); + } else { +- var1.setBlock(var2, var3 - 1, var4 - 1, 0, 0, 2); +- var1.setBlock(var2, var3 - 1, var4 + 1, 0, 0, 2); ++ par1World.setBlock(par2, par3 - 1, par4 - 1, 0, 0, 2); ++ par1World.setBlock(par2, par3 - 1, par4 + 1, 0, 0, 2); + } + +- EntityIronGolem var7 = new EntityIronGolem(var1); ++ EntityIronGolem var7 = new EntityIronGolem(par1World); + var7.setPlayerCreated(true); +- var7.setLocationAndAngles((double)var2 + 0.5D, (double)var3 - 1.95D, (double)var4 + 0.5D, 0.0F, 0.0F); +- var1.spawnEntityInWorld(var7); ++ var7.setLocationAndAngles((double)par2 + 0.5D, (double)par3 - 1.95D, (double)par4 + 0.5D, 0.0F, 0.0F); ++ par1World.spawnEntityInWorld(var7); + +- for(int var8 = 0; var8 < 120; ++var8) { +- var1.spawnParticle("snowballpoof", (double)var2 + var1.s.nextDouble(), (double)(var3 - 2) + var1.s.nextDouble() * 3.9D, (double)var4 + var1.s.nextDouble(), 0.0D, 0.0D, 0.0D); ++ for (int var8 = 0; var8 < 120; ++var8) { ++ par1World.spawnParticle("snowballpoof", (double)par2 + par1World.rand.nextDouble(), (double)(par3 - 2) + par1World.rand.nextDouble() * 3.9D, (double)par4 + par1World.rand.nextDouble(), 0.0D, 0.0D, 0.0D); + } + +- var1.notifyBlockChange(var2, var3, var4, 0); +- var1.notifyBlockChange(var2, var3 - 1, var4, 0); +- var1.notifyBlockChange(var2, var3 - 2, var4, 0); +- if(var5) { +- var1.notifyBlockChange(var2 - 1, var3 - 1, var4, 0); +- var1.notifyBlockChange(var2 + 1, var3 - 1, var4, 0); ++ par1World.notifyBlockChange(par2, par3, par4, 0); ++ par1World.notifyBlockChange(par2, par3 - 1, par4, 0); ++ par1World.notifyBlockChange(par2, par3 - 2, par4, 0); ++ ++ if (var5) { ++ par1World.notifyBlockChange(par2 - 1, par3 - 1, par4, 0); ++ par1World.notifyBlockChange(par2 + 1, par3 - 1, par4, 0); + } else { +- var1.notifyBlockChange(var2, var3 - 1, var4 - 1, 0); +- var1.notifyBlockChange(var2, var3 - 1, var4 + 1, 0); ++ par1World.notifyBlockChange(par2, par3 - 1, par4 - 1, 0); ++ par1World.notifyBlockChange(par2, par3 - 1, par4 + 1, 0); + } + } + } +- +- } +- +- public boolean canPlaceBlockAt(World var1, int var2, int var3, int var4) { +- int var5 = var1.getBlockId(var2, var3, var4); +- return (var5 == 0 || Block.blocksList[var5].blockMaterial.isReplaceable()) && var1.doesBlockHaveSolidTopSurface(var2, var3 - 1, var4); +- } +- +- public void onBlockPlacedBy(World var1, int var2, int var3, int var4, EntityLivingBase var5, ItemStack var6) { +- int var7 = MathHelper.floor_double((double)(var5.rotationYaw * 4.0F / 360.0F) + 2.5D) & 3; +- var1.setBlockMetadata(var2, var3, var4, var7, 2); +- } +- +- public void registerIcons(IconRegister var1) { +- this.field_94475_c = var1.registerIcon(this.getTextureName() + "_face_" + (this.blockType ? "on" : "off")); +- this.field_94474_b = var1.registerIcon(this.getTextureName() + "_top"); +- this.blockIcon = var1.registerIcon(this.getTextureName() + "_side"); ++ } ++ ++ /** ++ * Checks to see if its valid to put this block at the specified coordinates. Args: world, x, y, z ++ */ ++ public boolean canPlaceBlockAt(World par1World, int par2, int par3, int par4) { ++ int var5 = par1World.getBlockId(par2, par3, par4); ++ return (var5 == 0 || Block.blocksList[var5].blockMaterial.isReplaceable()) && par1World.doesBlockHaveSolidTopSurface(par2, par3 - 1, par4); ++ } ++ ++ /** ++ * Called when the block is placed in the world. ++ */ ++ public void onBlockPlacedBy(World par1World, int par2, int par3, int par4, EntityLivingBase par5EntityLivingBase, ItemStack par6ItemStack) { ++ int var7 = MathHelper.floor_double((double)(par5EntityLivingBase.rotationYaw * 4.0F / 360.0F) + 2.5D) & 3; ++ par1World.setBlockMetadataWithNotify(par2, par3, par4, var7, 2); ++ } ++ ++ /** ++ * When this method is called, your block should register all the icons it needs with the given IconRegister. This is ++ * the only chance you get to register icons. ++ */ ++ public void registerIcons(IconRegister par1IconRegister) { ++ this.field_94475_c = par1IconRegister.registerIcon(this.getTextureName() + "_face_" + (this.blockType ? "on" : "off")); ++ this.field_94474_b = par1IconRegister.registerIcon(this.getTextureName() + "_top"); ++ this.blockIcon = par1IconRegister.registerIcon(this.getTextureName() + "_side"); + } + } diff --git a/patches/net/minecraft/src/BlockQuartz.java.patch b/patches/net/minecraft/src/BlockQuartz.java.patch new file mode 100644 index 0000000..b20081a --- /dev/null +++ b/patches/net/minecraft/src/BlockQuartz.java.patch @@ -0,0 +1,170 @@ +--- net/minecraft/src/BlockQuartz.java ++++ net/minecraft/src/BlockQuartz.java +@@ -3,91 +3,116 @@ + import java.util.List; + + public class BlockQuartz extends Block { +- public static final String[] a = new String[]{"default", "chiseled", "lines"}; +- private static final String[] b = new String[]{"side", "chiseled", "lines", null, null}; ++ public static final String[] quartzBlockTypes = new String[] {"default", "chiseled", "lines"}; ++ private static final String[] quartzBlockTextureTypes = new String[] {"side", "chiseled", "lines", null, null}; + private Icon[] quartzblockIcons; + private Icon quartzblock_chiseled_top; + private Icon quartzblock_lines_top; + private Icon quartzblock_top; + private Icon quartzblock_bottom; + +- public BlockQuartz(int var1) { +- super(var1, Material.rock); ++ public BlockQuartz(int par1) { ++ super(par1, Material.rock); + this.setCreativeTab(CreativeTabs.tabBlock); + } + +- public Icon getIcon(int var1, int var2) { +- if(var2 != 2 && var2 != 3 && var2 != 4) { +- if(var1 != 1 && (var1 != 0 || var2 != 1)) { +- if(var1 == 0) { ++ /** ++ * From the specified side and block metadata retrieves the blocks texture. Args: side, metadata ++ */ ++ public Icon getIcon(int par1, int par2) { ++ if (par2 != 2 && par2 != 3 && par2 != 4) { ++ if (par1 != 1 && (par1 != 0 || par2 != 1)) { ++ if (par1 == 0) { + return this.quartzblock_bottom; + } else { +- if(var2 < 0 || var2 >= this.quartzblockIcons.length) { +- var2 = 0; ++ if (par2 < 0 || par2 >= this.quartzblockIcons.length) { ++ par2 = 0; + } + +- return this.quartzblockIcons[var2]; ++ return this.quartzblockIcons[par2]; + } + } else { +- return var2 == 1 ? this.quartzblock_chiseled_top : this.quartzblock_top; ++ return par2 == 1 ? this.quartzblock_chiseled_top : this.quartzblock_top; + } + } else { +- return var2 != 2 || var1 != 1 && var1 != 0 ? (var2 != 3 || var1 != 5 && var1 != 4 ? (var2 != 4 || var1 != 2 && var1 != 3 ? this.quartzblockIcons[var2] : this.quartzblock_lines_top) : this.quartzblock_lines_top) : this.quartzblock_lines_top; ++ return par2 == 2 && (par1 == 1 || par1 == 0) ? this.quartzblock_lines_top : (par2 == 3 && (par1 == 5 || par1 == 4) ? this.quartzblock_lines_top : (par2 == 4 && (par1 == 2 || par1 == 3) ? this.quartzblock_lines_top : this.quartzblockIcons[par2])); + } + } + +- public int onBlockPlaced(World var1, int var2, int var3, int var4, int var5, float var6, float var7, float var8, int var9) { +- if(var9 == 2) { +- switch(var5) { +- case 0: +- case 1: +- var9 = 2; +- break; +- case 2: +- case 3: +- var9 = 4; +- break; +- case 4: +- case 5: +- var9 = 3; ++ /** ++ * Called when a block is placed using its ItemBlock. Args: World, X, Y, Z, side, hitX, hitY, hitZ, block metadata ++ */ ++ public int onBlockPlaced(World par1World, int par2, int par3, int par4, int par5, float par6, float par7, float par8, int par9) { ++ if (par9 == 2) { ++ switch (par5) { ++ case 0: ++ case 1: ++ par9 = 2; ++ break; ++ ++ case 2: ++ case 3: ++ par9 = 4; ++ break; ++ ++ case 4: ++ case 5: ++ par9 = 3; + } + } + +- return var9; +- } +- +- public int damageDropped(int var1) { +- return var1 != 3 && var1 != 4 ? var1 : 2; +- } +- +- protected ItemStack createStackedBlock(int var1) { +- return var1 != 3 && var1 != 4 ? super.createStackedBlock(var1) : new ItemStack(this.blockID, 1, 2); +- } +- ++ return par9; ++ } ++ ++ /** ++ * Determines the damage on the item the block drops. Used in cloth and wood. ++ */ ++ public int damageDropped(int par1) { ++ return par1 != 3 && par1 != 4 ? par1 : 2; ++ } ++ ++ /** ++ * Returns an item stack containing a single instance of the current block type. 'i' is the block's subtype/damage and ++ * is ignored for blocks which do not support subtypes. Blocks which cannot be harvested should return null. ++ */ ++ protected ItemStack createStackedBlock(int par1) { ++ return par1 != 3 && par1 != 4 ? super.createStackedBlock(par1) : new ItemStack(this.blockID, 1, 2); ++ } ++ ++ /** ++ * The type of render function that is called for this block ++ */ + public int getRenderType() { + return 39; + } + +- public void getSubBlocks(int var1, CreativeTabs var2, List var3) { +- var3.add(new ItemStack(var1, 1, 0)); +- var3.add(new ItemStack(var1, 1, 1)); +- var3.add(new ItemStack(var1, 1, 2)); ++ /** ++ * returns a list of blocks with the same ID, but different meta (eg: wood returns 4 blocks) ++ */ ++ public void getSubBlocks(int par1, CreativeTabs par2CreativeTabs, List par3List) { ++ par3List.add(new ItemStack(par1, 1, 0)); ++ par3List.add(new ItemStack(par1, 1, 1)); ++ par3List.add(new ItemStack(par1, 1, 2)); + } + +- public void registerIcons(IconRegister var1) { +- this.quartzblockIcons = new Icon[b.length]; ++ /** ++ * When this method is called, your block should register all the icons it needs with the given IconRegister. This is ++ * the only chance you get to register icons. ++ */ ++ public void registerIcons(IconRegister par1IconRegister) { ++ this.quartzblockIcons = new Icon[quartzBlockTextureTypes.length]; + +- for(int var2 = 0; var2 < this.quartzblockIcons.length; ++var2) { +- if(b[var2] == null) { ++ for (int var2 = 0; var2 < this.quartzblockIcons.length; ++var2) { ++ if (quartzBlockTextureTypes[var2] == null) { + this.quartzblockIcons[var2] = this.quartzblockIcons[var2 - 1]; + } else { +- this.quartzblockIcons[var2] = var1.registerIcon(this.getTextureName() + "_" + b[var2]); ++ this.quartzblockIcons[var2] = par1IconRegister.registerIcon(this.getTextureName() + "_" + quartzBlockTextureTypes[var2]); + } + } + +- this.quartzblock_top = var1.registerIcon(this.getTextureName() + "_" + "top"); +- this.quartzblock_chiseled_top = var1.registerIcon(this.getTextureName() + "_" + "chiseled_top"); +- this.quartzblock_lines_top = var1.registerIcon(this.getTextureName() + "_" + "lines_top"); +- this.quartzblock_bottom = var1.registerIcon(this.getTextureName() + "_" + "bottom"); ++ this.quartzblock_top = par1IconRegister.registerIcon(this.getTextureName() + "_" + "top"); ++ this.quartzblock_chiseled_top = par1IconRegister.registerIcon(this.getTextureName() + "_" + "chiseled_top"); ++ this.quartzblock_lines_top = par1IconRegister.registerIcon(this.getTextureName() + "_" + "lines_top"); ++ this.quartzblock_bottom = par1IconRegister.registerIcon(this.getTextureName() + "_" + "bottom"); + } + } diff --git a/patches/net/minecraft/src/BlockRail.java.patch b/patches/net/minecraft/src/BlockRail.java.patch new file mode 100644 index 0000000..96491c1 --- /dev/null +++ b/patches/net/minecraft/src/BlockRail.java.patch @@ -0,0 +1,49 @@ +--- net/minecraft/src/BlockRail.java ++++ net/minecraft/src/BlockRail.java +@@ -3,23 +3,29 @@ + public class BlockRail extends BlockRailBase { + private Icon theIcon; + +- protected BlockRail(int var1) { +- super(var1, false); +- } +- +- public Icon getIcon(int var1, int var2) { +- return var2 >= 6 ? this.theIcon : this.blockIcon; +- } +- +- public void registerIcons(IconRegister var1) { +- super.registerIcons(var1); +- this.theIcon = var1.registerIcon(this.getTextureName() + "_turned"); +- } +- +- protected void func_94358_a(World var1, int var2, int var3, int var4, int var5, int var6, int var7) { +- if(var7 > 0 && Block.blocksList[var7].canProvidePower() && (new BlockBaseRailLogic(this, var1, var2, var3, var4)).getNumberOfAdjacentTracks() == 3) { +- this.refreshTrackShape(var1, var2, var3, var4, false); ++ protected BlockRail(int par1) { ++ super(par1, false); ++ } ++ ++ /** ++ * From the specified side and block metadata retrieves the blocks texture. Args: side, metadata ++ */ ++ public Icon getIcon(int par1, int par2) { ++ return par2 >= 6 ? this.theIcon : this.blockIcon; ++ } ++ ++ /** ++ * When this method is called, your block should register all the icons it needs with the given IconRegister. This is ++ * the only chance you get to register icons. ++ */ ++ public void registerIcons(IconRegister par1IconRegister) { ++ super.registerIcons(par1IconRegister); ++ this.theIcon = par1IconRegister.registerIcon(this.getTextureName() + "_turned"); ++ } ++ ++ protected void func_94358_a(World par1World, int par2, int par3, int par4, int par5, int par6, int par7) { ++ if (par7 > 0 && Block.blocksList[par7].canProvidePower() && (new BlockBaseRailLogic(this, par1World, par2, par3, par4)).getNumberOfAdjacentTracks() == 3) { ++ this.refreshTrackShape(par1World, par2, par3, par4, false); + } +- + } + } diff --git a/patches/net/minecraft/src/BlockRailBase.java.patch b/patches/net/minecraft/src/BlockRailBase.java.patch new file mode 100644 index 0000000..ecdd30c --- /dev/null +++ b/patches/net/minecraft/src/BlockRailBase.java.patch @@ -0,0 +1,292 @@ +--- net/minecraft/src/BlockRailBase.java ++++ net/minecraft/src/BlockRailBase.java +@@ -3,143 +3,201 @@ + import java.util.Random; + + public abstract class BlockRailBase extends Block { ++ ++ /** Power related rails have this field at true. */ + protected final boolean isPowered; + +- public static final boolean isRailBlockAt(World var0, int var1, int var2, int var3) { +- return isRailBlock(var0.getBlockId(var1, var2, var3)); +- } +- +- public static final boolean isRailBlock(int var0) { +- return var0 == Block.rail.blockID || var0 == Block.railPowered.blockID || var0 == Block.railDetector.blockID || var0 == Block.railActivator.blockID; +- } +- +- protected BlockRailBase(int var1, boolean var2) { +- super(var1, Material.circuits); +- this.isPowered = var2; +- this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 2.0F / 16.0F, 1.0F); ++ /** ++ * Returns true if the block at the coordinates of world passed is a valid rail block (current is rail, powered or ++ * detector). ++ */ ++ public static final boolean isRailBlockAt(World par0World, int par1, int par2, int par3) { ++ return isRailBlock(par0World.getBlockId(par1, par2, par3)); ++ } ++ ++ /** ++ * Return true if the parameter is a blockID for a valid rail block (current is rail, powered or detector). ++ */ ++ public static final boolean isRailBlock(int par0) { ++ return par0 == Block.rail.blockID || par0 == Block.railPowered.blockID || par0 == Block.railDetector.blockID || par0 == Block.railActivator.blockID; ++ } ++ ++ protected BlockRailBase(int par1, boolean par2) { ++ super(par1, Material.circuits); ++ this.isPowered = par2; ++ this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.125F, 1.0F); + this.setCreativeTab(CreativeTabs.tabTransport); + } + ++ /** ++ * Returns true if the block is power related rail. ++ */ + public boolean isPowered() { + return this.isPowered; + } + +- public AxisAlignedBB getCollisionBoundingBoxFromPool(World var1, int var2, int var3, int var4) { ++ /** ++ * Returns a bounding box from the pool of bounding boxes (this means this box can change after the pool has been ++ * cleared to be reused) ++ */ ++ public AxisAlignedBB getCollisionBoundingBoxFromPool(World par1World, int par2, int par3, int par4) { + return null; + } + ++ /** ++ * Is this block (a) opaque and (b) a full 1m cube? This determines whether or not to render the shared face of two ++ * adjacent blocks and also whether the player can attach torches, redstone wire, etc to this block. ++ */ + public boolean isOpaqueCube() { + return false; + } + +- public MovingObjectPosition collisionRayTrace(World var1, int var2, int var3, int var4, Vec3 var5, Vec3 var6) { +- this.setBlockBoundsBasedOnState(var1, var2, var3, var4); +- return super.collisionRayTrace(var1, var2, var3, var4, var5, var6); ++ /** ++ * Ray traces through the blocks collision from start vector to end vector returning a ray trace hit. Args: world, x, ++ * y, z, startVec, endVec ++ */ ++ public MovingObjectPosition collisionRayTrace(World par1World, int par2, int par3, int par4, Vec3 par5Vec3, Vec3 par6Vec3) { ++ this.setBlockBoundsBasedOnState(par1World, par2, par3, par4); ++ return super.collisionRayTrace(par1World, par2, par3, par4, par5Vec3, par6Vec3); + } + +- public void setBlockBoundsBasedOnState(IBlockAccess var1, int var2, int var3, int var4) { +- int var5 = var1.getBlockMetadata(var2, var3, var4); +- if(var5 >= 2 && var5 <= 5) { +- this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 10.0F / 16.0F, 1.0F); ++ /** ++ * Updates the blocks bounds based on its current state. Args: world, x, y, z ++ */ ++ public void setBlockBoundsBasedOnState(IBlockAccess par1IBlockAccess, int par2, int par3, int par4) { ++ int var5 = par1IBlockAccess.getBlockMetadata(par2, par3, par4); ++ ++ if (var5 >= 2 && var5 <= 5) { ++ this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.625F, 1.0F); + } else { +- this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 2.0F / 16.0F, 1.0F); ++ this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.125F, 1.0F); + } +- + } + ++ /** ++ * If this block doesn't render as an ordinary block it will return False (examples: signs, buttons, stairs, etc) ++ */ + public boolean renderAsNormalBlock() { + return false; + } + ++ /** ++ * The type of render function that is called for this block ++ */ + public int getRenderType() { + return 9; + } + +- public int quantityDropped(Random var1) { ++ /** ++ * Returns the quantity of items to drop on block destruction. ++ */ ++ public int quantityDropped(Random par1Random) { + return 1; + } + +- public boolean canPlaceBlockAt(World var1, int var2, int var3, int var4) { +- return var1.doesBlockHaveSolidTopSurface(var2, var3 - 1, var4); ++ /** ++ * Checks to see if its valid to put this block at the specified coordinates. Args: world, x, y, z ++ */ ++ public boolean canPlaceBlockAt(World par1World, int par2, int par3, int par4) { ++ return par1World.doesBlockHaveSolidTopSurface(par2, par3 - 1, par4); + } + +- public void onBlockAdded(World var1, int var2, int var3, int var4) { +- if(!var1.isRemote) { +- this.refreshTrackShape(var1, var2, var3, var4, true); +- if(this.isPowered) { +- this.onNeighborBlockChange(var1, var2, var3, var4, this.blockID); ++ /** ++ * Called whenever the block is added into the world. Args: world, x, y, z ++ */ ++ public void onBlockAdded(World par1World, int par2, int par3, int par4) { ++ if (!par1World.isRemote) { ++ this.refreshTrackShape(par1World, par2, par3, par4, true); ++ ++ if (this.isPowered) { ++ this.onNeighborBlockChange(par1World, par2, par3, par4, this.blockID); + } + } +- + } + +- public void onNeighborBlockChange(World var1, int var2, int var3, int var4, int var5) { +- if(!var1.isRemote) { +- int var6 = var1.getBlockMetadata(var2, var3, var4); ++ /** ++ * Lets the block know when one of its neighbor changes. Doesn't know which neighbor changed (coordinates passed are ++ * their own) Args: x, y, z, neighbor blockID ++ */ ++ public void onNeighborBlockChange(World par1World, int par2, int par3, int par4, int par5) { ++ if (!par1World.isRemote) { ++ int var6 = par1World.getBlockMetadata(par2, par3, par4); + int var7 = var6; +- if(this.isPowered) { ++ ++ if (this.isPowered) { + var7 = var6 & 7; + } + + boolean var8 = false; +- if(!var1.doesBlockHaveSolidTopSurface(var2, var3 - 1, var4)) { +- var8 = true; +- } +- +- if(var7 == 2 && !var1.doesBlockHaveSolidTopSurface(var2 + 1, var3, var4)) { +- var8 = true; +- } +- +- if(var7 == 3 && !var1.doesBlockHaveSolidTopSurface(var2 - 1, var3, var4)) { +- var8 = true; +- } +- +- if(var7 == 4 && !var1.doesBlockHaveSolidTopSurface(var2, var3, var4 - 1)) { +- var8 = true; +- } +- +- if(var7 == 5 && !var1.doesBlockHaveSolidTopSurface(var2, var3, var4 + 1)) { +- var8 = true; +- } +- +- if(var8) { +- this.dropBlockAsItem(var1, var2, var3, var4, var1.getBlockMetadata(var2, var3, var4), 0); +- var1.setBlockToAir(var2, var3, var4); ++ ++ if (!par1World.doesBlockHaveSolidTopSurface(par2, par3 - 1, par4)) { ++ var8 = true; ++ } ++ ++ if (var7 == 2 && !par1World.doesBlockHaveSolidTopSurface(par2 + 1, par3, par4)) { ++ var8 = true; ++ } ++ ++ if (var7 == 3 && !par1World.doesBlockHaveSolidTopSurface(par2 - 1, par3, par4)) { ++ var8 = true; ++ } ++ ++ if (var7 == 4 && !par1World.doesBlockHaveSolidTopSurface(par2, par3, par4 - 1)) { ++ var8 = true; ++ } ++ ++ if (var7 == 5 && !par1World.doesBlockHaveSolidTopSurface(par2, par3, par4 + 1)) { ++ var8 = true; ++ } ++ ++ if (var8) { ++ this.dropBlockAsItem(par1World, par2, par3, par4, par1World.getBlockMetadata(par2, par3, par4), 0); ++ par1World.setBlockToAir(par2, par3, par4); + } else { +- this.func_94358_a(var1, var2, var3, var4, var6, var7, var5); ++ this.func_94358_a(par1World, par2, par3, par4, var6, var7, par5); + } +- +- } +- } +- +- protected void func_94358_a(World var1, int var2, int var3, int var4, int var5, int var6, int var7) { +- } +- +- protected void refreshTrackShape(World var1, int var2, int var3, int var4, boolean var5) { +- if(!var1.isRemote) { +- (new BlockBaseRailLogic(this, var1, var2, var3, var4)).func_94511_a(var1.isBlockIndirectlyGettingPowered(var2, var3, var4), var5); +- } +- } +- ++ } ++ } ++ ++ protected void func_94358_a(World par1World, int par2, int par3, int par4, int par5, int par6, int par7) {} ++ ++ /** ++ * Completely recalculates the track shape based on neighboring tracks ++ */ ++ protected void refreshTrackShape(World par1World, int par2, int par3, int par4, boolean par5) { ++ if (!par1World.isRemote) { ++ (new BlockBaseRailLogic(this, par1World, par2, par3, par4)).func_94511_a(par1World.isBlockIndirectlyGettingPowered(par2, par3, par4), par5); ++ } ++ } ++ ++ /** ++ * Returns the mobility information of the block, 0 = free, 1 = can't push but can move over, 2 = total immobility and ++ * stop pistons ++ */ + public int getMobilityFlag() { + return 0; + } + +- public void breakBlock(World var1, int var2, int var3, int var4, int var5, int var6) { +- int var7 = var6; +- if(this.isPowered) { +- var7 = var6 & 7; +- } +- +- super.breakBlock(var1, var2, var3, var4, var5, var6); +- if(var7 == 2 || var7 == 3 || var7 == 4 || var7 == 5) { +- var1.notifyBlocksOfNeighborChange(var2, var3 + 1, var4, var5); +- } +- +- if(this.isPowered) { +- var1.notifyBlocksOfNeighborChange(var2, var3, var4, var5); +- var1.notifyBlocksOfNeighborChange(var2, var3 - 1, var4, var5); +- } +- ++ /** ++ * Called on server worlds only when the block has been replaced by a different block ID, or the same block with a ++ * different metadata value, but before the new metadata value is set. Args: World, x, y, z, old block ID, old metadata ++ */ ++ public void breakBlock(World par1World, int par2, int par3, int par4, int par5, int par6) { ++ int var7 = par6; ++ ++ if (this.isPowered) { ++ var7 = par6 & 7; ++ } ++ ++ super.breakBlock(par1World, par2, par3, par4, par5, par6); ++ ++ if (var7 == 2 || var7 == 3 || var7 == 4 || var7 == 5) { ++ par1World.notifyBlocksOfNeighborChange(par2, par3 + 1, par4, par5); ++ } ++ ++ if (this.isPowered) { ++ par1World.notifyBlocksOfNeighborChange(par2, par3, par4, par5); ++ par1World.notifyBlocksOfNeighborChange(par2, par3 - 1, par4, par5); ++ } + } + } diff --git a/patches/net/minecraft/src/BlockRailPowered.java.patch b/patches/net/minecraft/src/BlockRailPowered.java.patch new file mode 100644 index 0000000..1c16c96 --- /dev/null +++ b/patches/net/minecraft/src/BlockRailPowered.java.patch @@ -0,0 +1,255 @@ +--- net/minecraft/src/BlockRailPowered.java ++++ net/minecraft/src/BlockRailPowered.java +@@ -3,132 +3,150 @@ + public class BlockRailPowered extends BlockRailBase { + protected Icon theIcon; + +- protected BlockRailPowered(int var1) { +- super(var1, true); +- } +- +- public Icon getIcon(int var1, int var2) { +- return (var2 & 8) == 0 ? this.blockIcon : this.theIcon; +- } +- +- public void registerIcons(IconRegister var1) { +- super.registerIcons(var1); +- this.theIcon = var1.registerIcon(this.getTextureName() + "_powered"); +- } +- +- protected boolean func_94360_a(World var1, int var2, int var3, int var4, int var5, boolean var6, int var7) { +- if(var7 >= 8) { ++ protected BlockRailPowered(int par1) { ++ super(par1, true); ++ } ++ ++ /** ++ * From the specified side and block metadata retrieves the blocks texture. Args: side, metadata ++ */ ++ public Icon getIcon(int par1, int par2) { ++ return (par2 & 8) == 0 ? this.blockIcon : this.theIcon; ++ } ++ ++ /** ++ * When this method is called, your block should register all the icons it needs with the given IconRegister. This is ++ * the only chance you get to register icons. ++ */ ++ public void registerIcons(IconRegister par1IconRegister) { ++ super.registerIcons(par1IconRegister); ++ this.theIcon = par1IconRegister.registerIcon(this.getTextureName() + "_powered"); ++ } ++ ++ protected boolean func_94360_a(World par1World, int par2, int par3, int par4, int par5, boolean par6, int par7) { ++ if (par7 >= 8) { + return false; + } else { +- int var8 = var5 & 7; ++ int var8 = par5 & 7; + boolean var9 = true; +- switch(var8) { +- case 0: +- if(var6) { +- ++var4; +- } else { +- --var4; +- } +- break; +- case 1: +- if(var6) { +- --var2; +- } else { +- ++var2; +- } +- break; +- case 2: +- if(var6) { +- --var2; +- } else { +- ++var2; +- ++var3; +- var9 = false; +- } +- +- var8 = 1; +- break; +- case 3: +- if(var6) { +- --var2; +- ++var3; +- var9 = false; +- } else { +- ++var2; +- } +- +- var8 = 1; +- break; +- case 4: +- if(var6) { +- ++var4; +- } else { +- --var4; +- ++var3; +- var9 = false; +- } +- +- var8 = 0; +- break; +- case 5: +- if(var6) { +- ++var4; +- ++var3; +- var9 = false; +- } else { +- --var4; +- } +- +- var8 = 0; ++ ++ switch (var8) { ++ case 0: ++ if (par6) { ++ ++par4; ++ } else { ++ --par4; ++ } ++ ++ break; ++ ++ case 1: ++ if (par6) { ++ --par2; ++ } else { ++ ++par2; ++ } ++ ++ break; ++ ++ case 2: ++ if (par6) { ++ --par2; ++ } else { ++ ++par2; ++ ++par3; ++ var9 = false; ++ } ++ ++ var8 = 1; ++ break; ++ ++ case 3: ++ if (par6) { ++ --par2; ++ ++par3; ++ var9 = false; ++ } else { ++ ++par2; ++ } ++ ++ var8 = 1; ++ break; ++ ++ case 4: ++ if (par6) { ++ ++par4; ++ } else { ++ --par4; ++ ++par3; ++ var9 = false; ++ } ++ ++ var8 = 0; ++ break; ++ ++ case 5: ++ if (par6) { ++ ++par4; ++ ++par3; ++ var9 = false; ++ } else { ++ --par4; ++ } ++ ++ var8 = 0; + } + +- return this.func_94361_a(var1, var2, var3, var4, var6, var7, var8) ? true : var9 && this.func_94361_a(var1, var2, var3 - 1, var4, var6, var7, var8); ++ return this.func_94361_a(par1World, par2, par3, par4, par6, par7, var8) ? true : var9 && this.func_94361_a(par1World, par2, par3 - 1, par4, par6, par7, var8); + } + } + +- protected boolean func_94361_a(World var1, int var2, int var3, int var4, boolean var5, int var6, int var7) { +- int var8 = var1.getBlockId(var2, var3, var4); +- if(var8 == this.blockID) { +- int var9 = var1.getBlockMetadata(var2, var3, var4); ++ protected boolean func_94361_a(World par1World, int par2, int par3, int par4, boolean par5, int par6, int par7) { ++ int var8 = par1World.getBlockId(par2, par3, par4); ++ ++ if (var8 == this.blockID) { ++ int var9 = par1World.getBlockMetadata(par2, par3, par4); + int var10 = var9 & 7; +- if(var7 == 1 && (var10 == 0 || var10 == 4 || var10 == 5)) { +- return false; +- } +- +- if(var7 == 0 && (var10 == 1 || var10 == 2 || var10 == 3)) { +- return false; +- } +- +- if((var9 & 8) != 0) { +- if(var1.isBlockIndirectlyGettingPowered(var2, var3, var4)) { ++ ++ if (par7 == 1 && (var10 == 0 || var10 == 4 || var10 == 5)) { ++ return false; ++ } ++ ++ if (par7 == 0 && (var10 == 1 || var10 == 2 || var10 == 3)) { ++ return false; ++ } ++ ++ if ((var9 & 8) != 0) { ++ if (par1World.isBlockIndirectlyGettingPowered(par2, par3, par4)) { + return true; + } + +- return this.func_94360_a(var1, var2, var3, var4, var9, var5, var6 + 1); ++ return this.func_94360_a(par1World, par2, par3, par4, var9, par5, par6 + 1); + } + } + + return false; + } + +- protected void func_94358_a(World var1, int var2, int var3, int var4, int var5, int var6, int var7) { +- boolean var8 = var1.isBlockIndirectlyGettingPowered(var2, var3, var4); +- var8 = var8 || this.func_94360_a(var1, var2, var3, var4, var5, true, 0) || this.func_94360_a(var1, var2, var3, var4, var5, false, 0); ++ protected void func_94358_a(World par1World, int par2, int par3, int par4, int par5, int par6, int par7) { ++ boolean var8 = par1World.isBlockIndirectlyGettingPowered(par2, par3, par4); ++ var8 = var8 || this.func_94360_a(par1World, par2, par3, par4, par5, true, 0) || this.func_94360_a(par1World, par2, par3, par4, par5, false, 0); + boolean var9 = false; +- if(var8 && (var5 & 8) == 0) { +- var1.setBlockMetadata(var2, var3, var4, var6 | 8, 3); ++ ++ if (var8 && (par5 & 8) == 0) { ++ par1World.setBlockMetadataWithNotify(par2, par3, par4, par6 | 8, 3); + var9 = true; +- } else if(!var8 && (var5 & 8) != 0) { +- var1.setBlockMetadata(var2, var3, var4, var6, 3); ++ } else if (!var8 && (par5 & 8) != 0) { ++ par1World.setBlockMetadataWithNotify(par2, par3, par4, par6, 3); + var9 = true; + } + +- if(var9) { +- var1.notifyBlocksOfNeighborChange(var2, var3 - 1, var4, this.blockID); +- if(var6 == 2 || var6 == 3 || var6 == 4 || var6 == 5) { +- var1.notifyBlocksOfNeighborChange(var2, var3 + 1, var4, this.blockID); ++ if (var9) { ++ par1World.notifyBlocksOfNeighborChange(par2, par3 - 1, par4, this.blockID); ++ ++ if (par6 == 2 || par6 == 3 || par6 == 4 || par6 == 5) { ++ par1World.notifyBlocksOfNeighborChange(par2, par3 + 1, par4, this.blockID); + } + } +- + } + } diff --git a/patches/net/minecraft/src/BlockRedstoneLight.java.patch b/patches/net/minecraft/src/BlockRedstoneLight.java.patch new file mode 100644 index 0000000..db88de0 --- /dev/null +++ b/patches/net/minecraft/src/BlockRedstoneLight.java.patch @@ -0,0 +1,107 @@ +--- net/minecraft/src/BlockRedstoneLight.java ++++ net/minecraft/src/BlockRedstoneLight.java +@@ -3,51 +3,66 @@ + import java.util.Random; + + public class BlockRedstoneLight extends Block { ++ ++ /** Whether this lamp block is the powered version. */ + private final boolean powered; + +- public BlockRedstoneLight(int var1, boolean var2) { +- super(var1, Material.redstoneLight); +- this.powered = var2; +- if(var2) { ++ public BlockRedstoneLight(int par1, boolean par2) { ++ super(par1, Material.redstoneLight); ++ this.powered = par2; ++ ++ if (par2) { + this.setLightValue(1.0F); + } +- +- } +- +- public void onBlockAdded(World var1, int var2, int var3, int var4) { +- if(!var1.isRemote) { +- if(this.powered && !var1.isBlockIndirectlyGettingPowered(var2, var3, var4)) { +- var1.scheduleBlockUpdate(var2, var3, var4, this.blockID, 4); +- } else if(!this.powered && var1.isBlockIndirectlyGettingPowered(var2, var3, var4)) { +- var1.setBlock(var2, var3, var4, Block.redstoneLampActive.blockID, 0, 2); +- } +- } +- +- } +- +- public void onNeighborBlockChange(World var1, int var2, int var3, int var4, int var5) { +- if(!var1.isRemote) { +- if(this.powered && !var1.isBlockIndirectlyGettingPowered(var2, var3, var4)) { +- var1.scheduleBlockUpdate(var2, var3, var4, this.blockID, 4); +- } else if(!this.powered && var1.isBlockIndirectlyGettingPowered(var2, var3, var4)) { +- var1.setBlock(var2, var3, var4, Block.redstoneLampActive.blockID, 0, 2); +- } +- } +- +- } +- +- public void updateTick(World var1, int var2, int var3, int var4, Random var5) { +- if(!var1.isRemote && this.powered && !var1.isBlockIndirectlyGettingPowered(var2, var3, var4)) { +- var1.setBlock(var2, var3, var4, Block.redstoneLampIdle.blockID, 0, 2); +- } +- +- } +- +- public int idDropped(int var1, Random var2, int var3) { ++ } ++ ++ /** ++ * Called whenever the block is added into the world. Args: world, x, y, z ++ */ ++ public void onBlockAdded(World par1World, int par2, int par3, int par4) { ++ if (!par1World.isRemote) { ++ if (this.powered && !par1World.isBlockIndirectlyGettingPowered(par2, par3, par4)) { ++ par1World.scheduleBlockUpdate(par2, par3, par4, this.blockID, 4); ++ } else if (!this.powered && par1World.isBlockIndirectlyGettingPowered(par2, par3, par4)) { ++ par1World.setBlock(par2, par3, par4, Block.redstoneLampActive.blockID, 0, 2); ++ } ++ } ++ } ++ ++ /** ++ * Lets the block know when one of its neighbor changes. Doesn't know which neighbor changed (coordinates passed are ++ * their own) Args: x, y, z, neighbor blockID ++ */ ++ public void onNeighborBlockChange(World par1World, int par2, int par3, int par4, int par5) { ++ if (!par1World.isRemote) { ++ if (this.powered && !par1World.isBlockIndirectlyGettingPowered(par2, par3, par4)) { ++ par1World.scheduleBlockUpdate(par2, par3, par4, this.blockID, 4); ++ } else if (!this.powered && par1World.isBlockIndirectlyGettingPowered(par2, par3, par4)) { ++ par1World.setBlock(par2, par3, par4, Block.redstoneLampActive.blockID, 0, 2); ++ } ++ } ++ } ++ ++ /** ++ * Ticks the block if it's been scheduled ++ */ ++ public void updateTick(World par1World, int par2, int par3, int par4, Random par5Random) { ++ if (!par1World.isRemote && this.powered && !par1World.isBlockIndirectlyGettingPowered(par2, par3, par4)) { ++ par1World.setBlock(par2, par3, par4, Block.redstoneLampIdle.blockID, 0, 2); ++ } ++ } ++ ++ /** ++ * Returns the ID of the items to drop on destruction. ++ */ ++ public int idDropped(int par1, Random par2Random, int par3) { + return Block.redstoneLampIdle.blockID; + } + +- public int idPicked(World var1, int var2, int var3, int var4) { ++ /** ++ * only called by clickMiddleMouseButton , and passed to inventory.setCurrentItem (along with isCreative) ++ */ ++ public int idPicked(World par1World, int par2, int par3, int par4) { + return Block.redstoneLampIdle.blockID; + } + } diff --git a/patches/net/minecraft/src/BlockRedstoneLogic.java.patch b/patches/net/minecraft/src/BlockRedstoneLogic.java.patch new file mode 100644 index 0000000..869601f --- /dev/null +++ b/patches/net/minecraft/src/BlockRedstoneLogic.java.patch @@ -0,0 +1,466 @@ +--- net/minecraft/src/BlockRedstoneLogic.java ++++ net/minecraft/src/BlockRedstoneLogic.java +@@ -3,220 +3,285 @@ + import java.util.Random; + + public abstract class BlockRedstoneLogic extends BlockDirectional { ++ ++ /** Tells whether the repeater is powered or not */ + protected final boolean isRepeaterPowered; + +- protected BlockRedstoneLogic(int var1, boolean var2) { +- super(var1, Material.circuits); +- this.isRepeaterPowered = var2; +- this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 2.0F / 16.0F, 1.0F); ++ protected BlockRedstoneLogic(int par1, boolean par2) { ++ super(par1, Material.circuits); ++ this.isRepeaterPowered = par2; ++ this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.125F, 1.0F); + } + ++ /** ++ * If this block doesn't render as an ordinary block it will return False (examples: signs, buttons, stairs, etc) ++ */ + public boolean renderAsNormalBlock() { + return false; + } + +- public boolean canPlaceBlockAt(World var1, int var2, int var3, int var4) { +- return !var1.doesBlockHaveSolidTopSurface(var2, var3 - 1, var4) ? false : super.canPlaceBlockAt(var1, var2, var3, var4); +- } +- +- public boolean canBlockStay(World var1, int var2, int var3, int var4) { +- return !var1.doesBlockHaveSolidTopSurface(var2, var3 - 1, var4) ? false : super.canBlockStay(var1, var2, var3, var4); +- } +- +- public void updateTick(World var1, int var2, int var3, int var4, Random var5) { +- int var6 = var1.getBlockMetadata(var2, var3, var4); +- if(!this.func_94476_e(var1, var2, var3, var4, var6)) { +- boolean var7 = this.isGettingInput(var1, var2, var3, var4, var6); +- if(this.isRepeaterPowered && !var7) { +- var1.setBlock(var2, var3, var4, this.func_94484_i().blockID, var6, 2); +- } else if(!this.isRepeaterPowered) { +- var1.setBlock(var2, var3, var4, this.func_94485_e().blockID, var6, 2); +- if(!var7) { +- var1.scheduleBlockUpdateWithPriority(var2, var3, var4, this.func_94485_e().blockID, this.func_94486_g(var6), -1); ++ /** ++ * Checks to see if its valid to put this block at the specified coordinates. Args: world, x, y, z ++ */ ++ public boolean canPlaceBlockAt(World par1World, int par2, int par3, int par4) { ++ return !par1World.doesBlockHaveSolidTopSurface(par2, par3 - 1, par4) ? false : super.canPlaceBlockAt(par1World, par2, par3, par4); ++ } ++ ++ /** ++ * Can this block stay at this position. Similar to canPlaceBlockAt except gets checked often with plants. ++ */ ++ public boolean canBlockStay(World par1World, int par2, int par3, int par4) { ++ return !par1World.doesBlockHaveSolidTopSurface(par2, par3 - 1, par4) ? false : super.canBlockStay(par1World, par2, par3, par4); ++ } ++ ++ /** ++ * Ticks the block if it's been scheduled ++ */ ++ public void updateTick(World par1World, int par2, int par3, int par4, Random par5Random) { ++ int var6 = par1World.getBlockMetadata(par2, par3, par4); ++ ++ if (!this.func_94476_e(par1World, par2, par3, par4, var6)) { ++ boolean var7 = this.isGettingInput(par1World, par2, par3, par4, var6); ++ ++ if (this.isRepeaterPowered && !var7) { ++ par1World.setBlock(par2, par3, par4, this.func_94484_i().blockID, var6, 2); ++ } else if (!this.isRepeaterPowered) { ++ par1World.setBlock(par2, par3, par4, this.func_94485_e().blockID, var6, 2); ++ ++ if (!var7) { ++ par1World.scheduleBlockUpdateWithPriority(par2, par3, par4, this.func_94485_e().blockID, this.func_94486_g(var6), -1); + } + } + } +- +- } +- +- public Icon getIcon(int var1, int var2) { +- return var1 == 0 ? (this.isRepeaterPowered ? Block.torchRedstoneActive.getBlockTextureFromSide(var1) : Block.torchRedstoneIdle.getBlockTextureFromSide(var1)) : (var1 == 1 ? this.blockIcon : Block.stoneDoubleSlab.getBlockTextureFromSide(1)); +- } +- +- public boolean shouldSideBeRendered(IBlockAccess var1, int var2, int var3, int var4, int var5) { +- return var5 != 0 && var5 != 1; +- } +- ++ } ++ ++ /** ++ * From the specified side and block metadata retrieves the blocks texture. Args: side, metadata ++ */ ++ public Icon getIcon(int par1, int par2) { ++ return par1 == 0 ? (this.isRepeaterPowered ? Block.torchRedstoneActive.getBlockTextureFromSide(par1) : Block.torchRedstoneIdle.getBlockTextureFromSide(par1)) : (par1 == 1 ? this.blockIcon : Block.stoneDoubleSlab.getBlockTextureFromSide(1)); ++ } ++ ++ /** ++ * Returns true if the given side of this block type should be rendered, if the adjacent block is at the given ++ * coordinates. Args: blockAccess, x, y, z, side ++ */ ++ public boolean shouldSideBeRendered(IBlockAccess par1IBlockAccess, int par2, int par3, int par4, int par5) { ++ return par5 != 0 && par5 != 1; ++ } ++ ++ /** ++ * The type of render function that is called for this block ++ */ + public int getRenderType() { + return 36; + } + +- protected boolean func_96470_c(int var1) { ++ protected boolean func_96470_c(int par1) { + return this.isRepeaterPowered; + } + +- public int isProvidingStrongPower(IBlockAccess var1, int var2, int var3, int var4, int var5) { +- return this.isProvidingWeakPower(var1, var2, var3, var4, var5); ++ /** ++ * Returns true if the block is emitting direct/strong redstone power on the specified side. Args: World, X, Y, Z, ++ * side. Note that the side is reversed - eg it is 1 (up) when checking the bottom of the block. ++ */ ++ public int isProvidingStrongPower(IBlockAccess par1IBlockAccess, int par2, int par3, int par4, int par5) { ++ return this.isProvidingWeakPower(par1IBlockAccess, par2, par3, par4, par5); + } + +- public int isProvidingWeakPower(IBlockAccess var1, int var2, int var3, int var4, int var5) { +- int var6 = var1.getBlockMetadata(var2, var3, var4); +- if(!this.func_96470_c(var6)) { ++ /** ++ * Returns true if the block is emitting indirect/weak redstone power on the specified side. If isBlockNormalCube ++ * returns true, standard redstone propagation rules will apply instead and this will not be called. Args: World, X, Y, ++ * Z, side. Note that the side is reversed - eg it is 1 (up) when checking the bottom of the block. ++ */ ++ public int isProvidingWeakPower(IBlockAccess par1IBlockAccess, int par2, int par3, int par4, int par5) { ++ int var6 = par1IBlockAccess.getBlockMetadata(par2, par3, par4); ++ ++ if (!this.func_96470_c(var6)) { + return 0; + } else { + int var7 = getDirection(var6); +- return var7 == 0 && var5 == 3 ? this.func_94480_d(var1, var2, var3, var4, var6) : (var7 == 1 && var5 == 4 ? this.func_94480_d(var1, var2, var3, var4, var6) : (var7 == 2 && var5 == 2 ? this.func_94480_d(var1, var2, var3, var4, var6) : (var7 == 3 && var5 == 5 ? this.func_94480_d(var1, var2, var3, var4, var6) : 0))); ++ return var7 == 0 && par5 == 3 ? this.func_94480_d(par1IBlockAccess, par2, par3, par4, var6) : (var7 == 1 && par5 == 4 ? this.func_94480_d(par1IBlockAccess, par2, par3, par4, var6) : (var7 == 2 && par5 == 2 ? this.func_94480_d(par1IBlockAccess, par2, par3, par4, var6) : (var7 == 3 && par5 == 5 ? this.func_94480_d(par1IBlockAccess, par2, par3, par4, var6) : 0))); + } + } + +- public void onNeighborBlockChange(World var1, int var2, int var3, int var4, int var5) { +- if(!this.canBlockStay(var1, var2, var3, var4)) { +- this.dropBlockAsItem(var1, var2, var3, var4, var1.getBlockMetadata(var2, var3, var4), 0); +- var1.setBlockToAir(var2, var3, var4); +- var1.notifyBlocksOfNeighborChange(var2 + 1, var3, var4, this.blockID); +- var1.notifyBlocksOfNeighborChange(var2 - 1, var3, var4, this.blockID); +- var1.notifyBlocksOfNeighborChange(var2, var3, var4 + 1, this.blockID); +- var1.notifyBlocksOfNeighborChange(var2, var3, var4 - 1, this.blockID); +- var1.notifyBlocksOfNeighborChange(var2, var3 - 1, var4, this.blockID); +- var1.notifyBlocksOfNeighborChange(var2, var3 + 1, var4, this.blockID); ++ /** ++ * Lets the block know when one of its neighbor changes. Doesn't know which neighbor changed (coordinates passed are ++ * their own) Args: x, y, z, neighbor blockID ++ */ ++ public void onNeighborBlockChange(World par1World, int par2, int par3, int par4, int par5) { ++ if (!this.canBlockStay(par1World, par2, par3, par4)) { ++ this.dropBlockAsItem(par1World, par2, par3, par4, par1World.getBlockMetadata(par2, par3, par4), 0); ++ par1World.setBlockToAir(par2, par3, par4); ++ par1World.notifyBlocksOfNeighborChange(par2 + 1, par3, par4, this.blockID); ++ par1World.notifyBlocksOfNeighborChange(par2 - 1, par3, par4, this.blockID); ++ par1World.notifyBlocksOfNeighborChange(par2, par3, par4 + 1, this.blockID); ++ par1World.notifyBlocksOfNeighborChange(par2, par3, par4 - 1, this.blockID); ++ par1World.notifyBlocksOfNeighborChange(par2, par3 - 1, par4, this.blockID); ++ par1World.notifyBlocksOfNeighborChange(par2, par3 + 1, par4, this.blockID); + } else { +- this.func_94479_f(var1, var2, var3, var4, var5); ++ this.func_94479_f(par1World, par2, par3, par4, par5); + } + } + +- protected void func_94479_f(World var1, int var2, int var3, int var4, int var5) { +- int var6 = var1.getBlockMetadata(var2, var3, var4); +- if(!this.func_94476_e(var1, var2, var3, var4, var6)) { +- boolean var7 = this.isGettingInput(var1, var2, var3, var4, var6); +- if((this.isRepeaterPowered && !var7 || !this.isRepeaterPowered && var7) && !var1.isBlockTickScheduledThisTick(var2, var3, var4, this.blockID)) { ++ protected void func_94479_f(World par1World, int par2, int par3, int par4, int par5) { ++ int var6 = par1World.getBlockMetadata(par2, par3, par4); ++ ++ if (!this.func_94476_e(par1World, par2, par3, par4, var6)) { ++ boolean var7 = this.isGettingInput(par1World, par2, par3, par4, var6); ++ ++ if ((this.isRepeaterPowered && !var7 || !this.isRepeaterPowered && var7) && !par1World.isBlockTickScheduledThisTick(par2, par3, par4, this.blockID)) { + byte var8 = -1; +- if(this.func_83011_d(var1, var2, var3, var4, var6)) { ++ ++ if (this.func_83011_d(par1World, par2, par3, par4, var6)) { + var8 = -3; +- } else if(this.isRepeaterPowered) { ++ } else if (this.isRepeaterPowered) { + var8 = -2; + } + +- var1.scheduleBlockUpdateWithPriority(var2, var3, var4, this.blockID, this.func_94481_j_(var6), var8); ++ par1World.scheduleBlockUpdateWithPriority(par2, par3, par4, this.blockID, this.func_94481_j_(var6), var8); + } + } +- + } + +- public boolean func_94476_e(IBlockAccess var1, int var2, int var3, int var4, int var5) { ++ public boolean func_94476_e(IBlockAccess par1IBlockAccess, int par2, int par3, int par4, int par5) { + return false; + } + +- protected boolean isGettingInput(World var1, int var2, int var3, int var4, int var5) { +- return this.getInputStrength(var1, var2, var3, var4, var5) > 0; +- } +- +- protected int getInputStrength(World var1, int var2, int var3, int var4, int var5) { +- int var6 = getDirection(var5); +- int var7 = var2 + Direction.offsetX[var6]; +- int var8 = var4 + Direction.offsetZ[var6]; +- int var9 = var1.getIndirectPowerLevelTo(var7, var3, var8, Direction.directionToFacing[var6]); +- return var9 >= 15 ? var9 : Math.max(var9, var1.getBlockId(var7, var3, var8) == Block.redstoneWire.blockID ? var1.getBlockMetadata(var7, var3, var8) : 0); +- } +- +- protected int func_94482_f(IBlockAccess var1, int var2, int var3, int var4, int var5) { +- int var6 = getDirection(var5); +- switch(var6) { +- case 0: +- case 2: +- return Math.max(this.func_94488_g(var1, var2 - 1, var3, var4, 4), this.func_94488_g(var1, var2 + 1, var3, var4, 5)); +- case 1: +- case 3: +- return Math.max(this.func_94488_g(var1, var2, var3, var4 + 1, 3), this.func_94488_g(var1, var2, var3, var4 - 1, 2)); +- default: +- return 0; ++ protected boolean isGettingInput(World par1World, int par2, int par3, int par4, int par5) { ++ return this.getInputStrength(par1World, par2, par3, par4, par5) > 0; ++ } ++ ++ /** ++ * Returns the signal strength at one input of the block. Args: world, X, Y, Z, side ++ */ ++ protected int getInputStrength(World par1World, int par2, int par3, int par4, int par5) { ++ int var6 = getDirection(par5); ++ int var7 = par2 + Direction.offsetX[var6]; ++ int var8 = par4 + Direction.offsetZ[var6]; ++ int var9 = par1World.getIndirectPowerLevelTo(var7, par3, var8, Direction.directionToFacing[var6]); ++ return var9 >= 15 ? var9 : Math.max(var9, par1World.getBlockId(var7, par3, var8) == Block.redstoneWire.blockID ? par1World.getBlockMetadata(var7, par3, var8) : 0); ++ } ++ ++ protected int func_94482_f(IBlockAccess par1IBlockAccess, int par2, int par3, int par4, int par5) { ++ int var6 = getDirection(par5); ++ ++ switch (var6) { ++ case 0: ++ case 2: ++ return Math.max(this.func_94488_g(par1IBlockAccess, par2 - 1, par3, par4, 4), this.func_94488_g(par1IBlockAccess, par2 + 1, par3, par4, 5)); ++ ++ case 1: ++ case 3: ++ return Math.max(this.func_94488_g(par1IBlockAccess, par2, par3, par4 + 1, 3), this.func_94488_g(par1IBlockAccess, par2, par3, par4 - 1, 2)); ++ ++ default: ++ return 0; + } + } + +- protected int func_94488_g(IBlockAccess var1, int var2, int var3, int var4, int var5) { +- int var6 = var1.getBlockId(var2, var3, var4); +- return this.func_94477_d(var6) ? (var6 == Block.redstoneWire.blockID ? var1.getBlockMetadata(var2, var3, var4) : var1.isBlockProvidingPowerTo(var2, var3, var4, var5)) : 0; ++ protected int func_94488_g(IBlockAccess par1IBlockAccess, int par2, int par3, int par4, int par5) { ++ int var6 = par1IBlockAccess.getBlockId(par2, par3, par4); ++ return this.func_94477_d(var6) ? (var6 == Block.redstoneWire.blockID ? par1IBlockAccess.getBlockMetadata(par2, par3, par4) : par1IBlockAccess.isBlockProvidingPowerTo(par2, par3, par4, par5)) : 0; + } + ++ /** ++ * Can this block provide power. Only wire currently seems to have this change based on its state. ++ */ + public boolean canProvidePower() { + return true; + } + +- public void onBlockPlacedBy(World var1, int var2, int var3, int var4, EntityLivingBase var5, ItemStack var6) { +- int var7 = ((MathHelper.floor_double((double)(var5.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3) + 2) % 4; +- var1.setBlockMetadata(var2, var3, var4, var7, 3); +- boolean var8 = this.isGettingInput(var1, var2, var3, var4, var7); +- if(var8) { +- var1.scheduleBlockUpdate(var2, var3, var4, this.blockID, 1); +- } +- +- } +- +- public void onBlockAdded(World var1, int var2, int var3, int var4) { +- this.func_94483_i_(var1, var2, var3, var4); +- } +- +- protected void func_94483_i_(World var1, int var2, int var3, int var4) { +- int var5 = getDirection(var1.getBlockMetadata(var2, var3, var4)); +- if(var5 == 1) { +- var1.notifyBlockOfNeighborChange(var2 + 1, var3, var4, this.blockID); +- var1.notifyBlocksOfNeighborChange(var2 + 1, var3, var4, this.blockID, 4); +- } +- +- if(var5 == 3) { +- var1.notifyBlockOfNeighborChange(var2 - 1, var3, var4, this.blockID); +- var1.notifyBlocksOfNeighborChange(var2 - 1, var3, var4, this.blockID, 5); +- } +- +- if(var5 == 2) { +- var1.notifyBlockOfNeighborChange(var2, var3, var4 + 1, this.blockID); +- var1.notifyBlocksOfNeighborChange(var2, var3, var4 + 1, this.blockID, 2); +- } +- +- if(var5 == 0) { +- var1.notifyBlockOfNeighborChange(var2, var3, var4 - 1, this.blockID); +- var1.notifyBlocksOfNeighborChange(var2, var3, var4 - 1, this.blockID, 3); +- } +- +- } +- +- public void onBlockDestroyedByPlayer(World var1, int var2, int var3, int var4, int var5) { +- if(this.isRepeaterPowered) { +- var1.notifyBlocksOfNeighborChange(var2 + 1, var3, var4, this.blockID); +- var1.notifyBlocksOfNeighborChange(var2 - 1, var3, var4, this.blockID); +- var1.notifyBlocksOfNeighborChange(var2, var3, var4 + 1, this.blockID); +- var1.notifyBlocksOfNeighborChange(var2, var3, var4 - 1, this.blockID); +- var1.notifyBlocksOfNeighborChange(var2, var3 - 1, var4, this.blockID); +- var1.notifyBlocksOfNeighborChange(var2, var3 + 1, var4, this.blockID); +- } +- +- super.onBlockDestroyedByPlayer(var1, var2, var3, var4, var5); +- } +- ++ /** ++ * Called when the block is placed in the world. ++ */ ++ public void onBlockPlacedBy(World par1World, int par2, int par3, int par4, EntityLivingBase par5EntityLivingBase, ItemStack par6ItemStack) { ++ int var7 = ((MathHelper.floor_double((double)(par5EntityLivingBase.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3) + 2) % 4; ++ par1World.setBlockMetadataWithNotify(par2, par3, par4, var7, 3); ++ boolean var8 = this.isGettingInput(par1World, par2, par3, par4, var7); ++ ++ if (var8) { ++ par1World.scheduleBlockUpdate(par2, par3, par4, this.blockID, 1); ++ } ++ } ++ ++ /** ++ * Called whenever the block is added into the world. Args: world, x, y, z ++ */ ++ public void onBlockAdded(World par1World, int par2, int par3, int par4) { ++ this.func_94483_i_(par1World, par2, par3, par4); ++ } ++ ++ protected void func_94483_i_(World par1World, int par2, int par3, int par4) { ++ int var5 = getDirection(par1World.getBlockMetadata(par2, par3, par4)); ++ ++ if (var5 == 1) { ++ par1World.notifyBlockOfNeighborChange(par2 + 1, par3, par4, this.blockID); ++ par1World.notifyBlocksOfNeighborChange(par2 + 1, par3, par4, this.blockID, 4); ++ } ++ ++ if (var5 == 3) { ++ par1World.notifyBlockOfNeighborChange(par2 - 1, par3, par4, this.blockID); ++ par1World.notifyBlocksOfNeighborChange(par2 - 1, par3, par4, this.blockID, 5); ++ } ++ ++ if (var5 == 2) { ++ par1World.notifyBlockOfNeighborChange(par2, par3, par4 + 1, this.blockID); ++ par1World.notifyBlocksOfNeighborChange(par2, par3, par4 + 1, this.blockID, 2); ++ } ++ ++ if (var5 == 0) { ++ par1World.notifyBlockOfNeighborChange(par2, par3, par4 - 1, this.blockID); ++ par1World.notifyBlocksOfNeighborChange(par2, par3, par4 - 1, this.blockID, 3); ++ } ++ } ++ ++ /** ++ * Called right before the block is destroyed by a player. Args: world, x, y, z, metaData ++ */ ++ public void onBlockDestroyedByPlayer(World par1World, int par2, int par3, int par4, int par5) { ++ if (this.isRepeaterPowered) { ++ par1World.notifyBlocksOfNeighborChange(par2 + 1, par3, par4, this.blockID); ++ par1World.notifyBlocksOfNeighborChange(par2 - 1, par3, par4, this.blockID); ++ par1World.notifyBlocksOfNeighborChange(par2, par3, par4 + 1, this.blockID); ++ par1World.notifyBlocksOfNeighborChange(par2, par3, par4 - 1, this.blockID); ++ par1World.notifyBlocksOfNeighborChange(par2, par3 - 1, par4, this.blockID); ++ par1World.notifyBlocksOfNeighborChange(par2, par3 + 1, par4, this.blockID); ++ } ++ ++ super.onBlockDestroyedByPlayer(par1World, par2, par3, par4, par5); ++ } ++ ++ /** ++ * Is this block (a) opaque and (b) a full 1m cube? This determines whether or not to render the shared face of two ++ * adjacent blocks and also whether the player can attach torches, redstone wire, etc to this block. ++ */ + public boolean isOpaqueCube() { + return false; + } + +- protected boolean func_94477_d(int var1) { +- Block var2 = Block.blocksList[var1]; ++ protected boolean func_94477_d(int par1) { ++ Block var2 = Block.blocksList[par1]; + return var2 != null && var2.canProvidePower(); + } + +- protected int func_94480_d(IBlockAccess var1, int var2, int var3, int var4, int var5) { ++ protected int func_94480_d(IBlockAccess par1IBlockAccess, int par2, int par3, int par4, int par5) { + return 15; + } + +- public static boolean isRedstoneRepeaterBlockID(int var0) { +- return Block.redstoneRepeaterIdle.func_94487_f(var0) || Block.redstoneComparatorIdle.func_94487_f(var0); +- } +- +- public boolean func_94487_f(int var1) { +- return var1 == this.func_94485_e().blockID || var1 == this.func_94484_i().blockID; +- } +- +- public boolean func_83011_d(World var1, int var2, int var3, int var4, int var5) { +- int var6 = getDirection(var5); +- if(isRedstoneRepeaterBlockID(var1.getBlockId(var2 - Direction.offsetX[var6], var3, var4 - Direction.offsetZ[var6]))) { +- int var7 = var1.getBlockMetadata(var2 - Direction.offsetX[var6], var3, var4 - Direction.offsetZ[var6]); ++ public static boolean isRedstoneRepeaterBlockID(int par0) { ++ return Block.redstoneRepeaterIdle.func_94487_f(par0) || Block.redstoneComparatorIdle.func_94487_f(par0); ++ } ++ ++ public boolean func_94487_f(int par1) { ++ return par1 == this.func_94485_e().blockID || par1 == this.func_94484_i().blockID; ++ } ++ ++ public boolean func_83011_d(World par1World, int par2, int par3, int par4, int par5) { ++ int var6 = getDirection(par5); ++ ++ if (isRedstoneRepeaterBlockID(par1World.getBlockId(par2 - Direction.offsetX[var6], par3, par4 - Direction.offsetZ[var6]))) { ++ int var7 = par1World.getBlockMetadata(par2 - Direction.offsetX[var6], par3, par4 - Direction.offsetZ[var6]); + int var8 = getDirection(var7); + return var8 != var6; + } else { +@@ -224,8 +289,8 @@ + } + } + +- protected int func_94486_g(int var1) { +- return this.func_94481_j_(var1); ++ protected int func_94486_g(int par1) { ++ return this.func_94481_j_(par1); + } + + protected abstract int func_94481_j_(int var1); +@@ -234,7 +299,11 @@ + + protected abstract BlockRedstoneLogic func_94484_i(); + +- public boolean isAssociatedBlockID(int var1) { +- return this.func_94487_f(var1); ++ /** ++ * Returns true if the given block ID is equivalent to this one. Example: redstoneTorchOn matches itself and ++ * redstoneTorchOff, and vice versa. Most blocks only match themselves. ++ */ ++ public boolean isAssociatedBlockID(int par1) { ++ return this.func_94487_f(par1); + } + } diff --git a/patches/net/minecraft/src/BlockRedstoneOre.java.patch b/patches/net/minecraft/src/BlockRedstoneOre.java.patch new file mode 100644 index 0000000..4509d5d --- /dev/null +++ b/patches/net/minecraft/src/BlockRedstoneOre.java.patch @@ -0,0 +1,259 @@ +--- net/minecraft/src/BlockRedstoneOre.java ++++ net/minecraft/src/BlockRedstoneOre.java +@@ -5,117 +5,156 @@ + public class BlockRedstoneOre extends Block { + private boolean glowing; + +- public BlockRedstoneOre(int var1, boolean var2) { +- super(var1, Material.rock); +- if(var2) { ++ public BlockRedstoneOre(int par1, boolean par2) { ++ super(par1, Material.rock); ++ ++ if (par2) { + this.setTickRandomly(true); + } + +- this.glowing = var2; ++ this.glowing = par2; + } + +- public int tickRate(World var1) { ++ /** ++ * How many world ticks before ticking ++ */ ++ public int tickRate(World par1World) { + return 30; + } + +- public void onBlockClicked(World var1, int var2, int var3, int var4, EntityPlayer var5) { +- this.glow(var1, var2, var3, var4); +- super.onBlockClicked(var1, var2, var3, var4, var5); +- } +- +- public void onEntityWalking(World var1, int var2, int var3, int var4, Entity var5) { +- this.glow(var1, var2, var3, var4); +- super.onEntityWalking(var1, var2, var3, var4, var5); +- } +- +- public boolean onBlockActivated(World var1, int var2, int var3, int var4, EntityPlayer var5, int var6, float var7, float var8, float var9) { +- this.glow(var1, var2, var3, var4); +- return super.onBlockActivated(var1, var2, var3, var4, var5, var6, var7, var8, var9); +- } +- +- private void glow(World var1, int var2, int var3, int var4) { +- this.sparkle(var1, var2, var3, var4); +- if(this.blockID == Block.oreRedstone.blockID) { +- var1.setBlock(var2, var3, var4, Block.oreRedstoneGlowing.blockID); +- } +- +- } +- +- public void updateTick(World var1, int var2, int var3, int var4, Random var5) { +- if(this.blockID == Block.oreRedstoneGlowing.blockID) { +- var1.setBlock(var2, var3, var4, Block.oreRedstone.blockID); +- } +- +- } +- +- public int idDropped(int var1, Random var2, int var3) { ++ /** ++ * Called when the block is clicked by a player. Args: x, y, z, entityPlayer ++ */ ++ public void onBlockClicked(World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer) { ++ this.glow(par1World, par2, par3, par4); ++ super.onBlockClicked(par1World, par2, par3, par4, par5EntityPlayer); ++ } ++ ++ /** ++ * Called whenever an entity is walking on top of this block. Args: world, x, y, z, entity ++ */ ++ public void onEntityWalking(World par1World, int par2, int par3, int par4, Entity par5Entity) { ++ this.glow(par1World, par2, par3, par4); ++ super.onEntityWalking(par1World, par2, par3, par4, par5Entity); ++ } ++ ++ /** ++ * Called upon block activation (right click on the block.) ++ */ ++ public boolean onBlockActivated(World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer, int par6, float par7, float par8, float par9) { ++ this.glow(par1World, par2, par3, par4); ++ return super.onBlockActivated(par1World, par2, par3, par4, par5EntityPlayer, par6, par7, par8, par9); ++ } ++ ++ /** ++ * The redstone ore glows. ++ */ ++ private void glow(World par1World, int par2, int par3, int par4) { ++ this.sparkle(par1World, par2, par3, par4); ++ ++ if (this.blockID == Block.oreRedstone.blockID) { ++ par1World.setBlock(par2, par3, par4, Block.oreRedstoneGlowing.blockID); ++ } ++ } ++ ++ /** ++ * Ticks the block if it's been scheduled ++ */ ++ public void updateTick(World par1World, int par2, int par3, int par4, Random par5Random) { ++ if (this.blockID == Block.oreRedstoneGlowing.blockID) { ++ par1World.setBlock(par2, par3, par4, Block.oreRedstone.blockID); ++ } ++ } ++ ++ /** ++ * Returns the ID of the items to drop on destruction. ++ */ ++ public int idDropped(int par1, Random par2Random, int par3) { + return Item.redstone.itemID; + } + +- public int quantityDroppedWithBonus(int var1, Random var2) { +- return this.quantityDropped(var2) + var2.nextInt(var1 + 1); +- } +- +- public int quantityDropped(Random var1) { +- return 4 + var1.nextInt(2); +- } +- +- public void dropBlockAsItemWithChance(World var1, int var2, int var3, int var4, int var5, float var6, int var7) { +- super.dropBlockAsItemWithChance(var1, var2, var3, var4, var5, var6, var7); +- if(this.idDropped(var5, var1.s, var7) != this.blockID) { +- int var8 = 1 + var1.s.nextInt(5); +- this.dropXpOnBlockBreak(var1, var2, var3, var4, var8); +- } +- +- } +- +- public void randomDisplayTick(World var1, int var2, int var3, int var4, Random var5) { +- if(this.glowing) { +- this.sparkle(var1, var2, var3, var4); +- } +- +- } +- +- private void sparkle(World var1, int var2, int var3, int var4) { +- Random var5 = var1.s; +- double var6 = 1.0D / 16.0D; +- +- for(int var8 = 0; var8 < 6; ++var8) { +- double var9 = (double)((float)var2 + var5.nextFloat()); +- double var11 = (double)((float)var3 + var5.nextFloat()); +- double var13 = (double)((float)var4 + var5.nextFloat()); +- if(var8 == 0 && !var1.isBlockOpaqueCube(var2, var3 + 1, var4)) { +- var11 = (double)(var3 + 1) + var6; +- } +- +- if(var8 == 1 && !var1.isBlockOpaqueCube(var2, var3 - 1, var4)) { +- var11 = (double)(var3 + 0) - var6; +- } +- +- if(var8 == 2 && !var1.isBlockOpaqueCube(var2, var3, var4 + 1)) { +- var13 = (double)(var4 + 1) + var6; +- } +- +- if(var8 == 3 && !var1.isBlockOpaqueCube(var2, var3, var4 - 1)) { +- var13 = (double)(var4 + 0) - var6; +- } +- +- if(var8 == 4 && !var1.isBlockOpaqueCube(var2 + 1, var3, var4)) { +- var9 = (double)(var2 + 1) + var6; +- } +- +- if(var8 == 5 && !var1.isBlockOpaqueCube(var2 - 1, var3, var4)) { +- var9 = (double)(var2 + 0) - var6; +- } +- +- if(var9 < (double)var2 || var9 > (double)(var2 + 1) || var11 < 0.0D || var11 > (double)(var3 + 1) || var13 < (double)var4 || var13 > (double)(var4 + 1)) { +- var1.spawnParticle("reddust", var9, var11, var13, 0.0D, 0.0D, 0.0D); +- } +- } +- +- } +- +- protected ItemStack createStackedBlock(int var1) { ++ /** ++ * Returns the usual quantity dropped by the block plus a bonus of 1 to 'i' (inclusive). ++ */ ++ public int quantityDroppedWithBonus(int par1, Random par2Random) { ++ return this.quantityDropped(par2Random) + par2Random.nextInt(par1 + 1); ++ } ++ ++ /** ++ * Returns the quantity of items to drop on block destruction. ++ */ ++ public int quantityDropped(Random par1Random) { ++ return 4 + par1Random.nextInt(2); ++ } ++ ++ /** ++ * Drops the block items with a specified chance of dropping the specified items ++ */ ++ public void dropBlockAsItemWithChance(World par1World, int par2, int par3, int par4, int par5, float par6, int par7) { ++ super.dropBlockAsItemWithChance(par1World, par2, par3, par4, par5, par6, par7); ++ ++ if (this.idDropped(par5, par1World.rand, par7) != this.blockID) { ++ int var8 = 1 + par1World.rand.nextInt(5); ++ this.dropXpOnBlockBreak(par1World, par2, par3, par4, var8); ++ } ++ } ++ ++ /** ++ * A randomly called display update to be able to add particles or other items for display ++ */ ++ public void randomDisplayTick(World par1World, int par2, int par3, int par4, Random par5Random) { ++ if (this.glowing) { ++ this.sparkle(par1World, par2, par3, par4); ++ } ++ } ++ ++ /** ++ * The redstone ore sparkles. ++ */ ++ private void sparkle(World par1World, int par2, int par3, int par4) { ++ Random var5 = par1World.rand; ++ double var6 = 0.0625D; ++ ++ for (int var8 = 0; var8 < 6; ++var8) { ++ double var9 = (double)((float)par2 + var5.nextFloat()); ++ double var11 = (double)((float)par3 + var5.nextFloat()); ++ double var13 = (double)((float)par4 + var5.nextFloat()); ++ ++ if (var8 == 0 && !par1World.isBlockOpaqueCube(par2, par3 + 1, par4)) { ++ var11 = (double)(par3 + 1) + var6; ++ } ++ ++ if (var8 == 1 && !par1World.isBlockOpaqueCube(par2, par3 - 1, par4)) { ++ var11 = (double)(par3 + 0) - var6; ++ } ++ ++ if (var8 == 2 && !par1World.isBlockOpaqueCube(par2, par3, par4 + 1)) { ++ var13 = (double)(par4 + 1) + var6; ++ } ++ ++ if (var8 == 3 && !par1World.isBlockOpaqueCube(par2, par3, par4 - 1)) { ++ var13 = (double)(par4 + 0) - var6; ++ } ++ ++ if (var8 == 4 && !par1World.isBlockOpaqueCube(par2 + 1, par3, par4)) { ++ var9 = (double)(par2 + 1) + var6; ++ } ++ ++ if (var8 == 5 && !par1World.isBlockOpaqueCube(par2 - 1, par3, par4)) { ++ var9 = (double)(par2 + 0) - var6; ++ } ++ ++ if (var9 < (double)par2 || var9 > (double)(par2 + 1) || var11 < 0.0D || var11 > (double)(par3 + 1) || var13 < (double)par4 || var13 > (double)(par4 + 1)) { ++ par1World.spawnParticle("reddust", var9, var11, var13, 0.0D, 0.0D, 0.0D); ++ } ++ } ++ } ++ ++ /** ++ * Returns an item stack containing a single instance of the current block type. 'i' is the block's subtype/damage and ++ * is ignored for blocks which do not support subtypes. Blocks which cannot be harvested should return null. ++ */ ++ protected ItemStack createStackedBlock(int par1) { + return new ItemStack(Block.oreRedstone); + } + } diff --git a/patches/net/minecraft/src/BlockRedstoneRepeater.java.patch b/patches/net/minecraft/src/BlockRedstoneRepeater.java.patch new file mode 100644 index 0000000..960669a --- /dev/null +++ b/patches/net/minecraft/src/BlockRedstoneRepeater.java.patch @@ -0,0 +1,191 @@ +--- net/minecraft/src/BlockRedstoneRepeater.java ++++ net/minecraft/src/BlockRedstoneRepeater.java +@@ -3,23 +3,30 @@ + import java.util.Random; + + public class BlockRedstoneRepeater extends BlockRedstoneLogic { +- public static final double[] repeaterTorchOffset = new double[]{-0.0625D, 1.0D / 16.0D, 0.1875D, 0.3125D}; +- private static final int[] repeaterState = new int[]{1, 2, 3, 4}; +- +- protected BlockRedstoneRepeater(int var1, boolean var2) { +- super(var1, var2); ++ ++ /** The offsets for the two torches in redstone repeater blocks. */ ++ public static final double[] repeaterTorchOffset = new double[] { -0.0625D, 0.0625D, 0.1875D, 0.3125D}; ++ ++ /** The states in which the redstone repeater blocks can be. */ ++ private static final int[] repeaterState = new int[] {1, 2, 3, 4}; ++ ++ protected BlockRedstoneRepeater(int par1, boolean par2) { ++ super(par1, par2); + } + +- public boolean onBlockActivated(World var1, int var2, int var3, int var4, EntityPlayer var5, int var6, float var7, float var8, float var9) { +- int var10 = var1.getBlockMetadata(var2, var3, var4); ++ /** ++ * Called upon block activation (right click on the block.) ++ */ ++ public boolean onBlockActivated(World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer, int par6, float par7, float par8, float par9) { ++ int var10 = par1World.getBlockMetadata(par2, par3, par4); + int var11 = (var10 & 12) >> 2; + var11 = var11 + 1 << 2 & 12; +- var1.setBlockMetadata(var2, var3, var4, var11 | var10 & 3, 3); ++ par1World.setBlockMetadataWithNotify(par2, par3, par4, var11 | var10 & 3, 3); + return true; + } + +- protected int func_94481_j_(int var1) { +- return repeaterState[(var1 & 12) >> 2] * 2; ++ protected int func_94481_j_(int par1) { ++ return repeaterState[(par1 & 12) >> 2] * 2; + } + + protected BlockRedstoneLogic func_94485_e() { +@@ -30,72 +37,96 @@ + return Block.redstoneRepeaterIdle; + } + +- public int idDropped(int var1, Random var2, int var3) { +- return Item.redstoneRepeater.itemID; +- } +- +- public int idPicked(World var1, int var2, int var3, int var4) { +- return Item.redstoneRepeater.itemID; +- } +- ++ /** ++ * Returns the ID of the items to drop on destruction. ++ */ ++ public int idDropped(int par1, Random par2Random, int par3) { ++ return Item.redstoneRepeater.itemID; ++ } ++ ++ /** ++ * only called by clickMiddleMouseButton , and passed to inventory.setCurrentItem (along with isCreative) ++ */ ++ public int idPicked(World par1World, int par2, int par3, int par4) { ++ return Item.redstoneRepeater.itemID; ++ } ++ ++ /** ++ * The type of render function that is called for this block ++ */ + public int getRenderType() { + return 15; + } + +- public boolean func_94476_e(IBlockAccess var1, int var2, int var3, int var4, int var5) { +- return this.func_94482_f(var1, var2, var3, var4, var5) > 0; +- } +- +- protected boolean func_94477_d(int var1) { +- return isRedstoneRepeaterBlockID(var1); +- } +- +- public void randomDisplayTick(World var1, int var2, int var3, int var4, Random var5) { +- if(this.isRepeaterPowered) { +- int var6 = var1.getBlockMetadata(var2, var3, var4); ++ public boolean func_94476_e(IBlockAccess par1IBlockAccess, int par2, int par3, int par4, int par5) { ++ return this.func_94482_f(par1IBlockAccess, par2, par3, par4, par5) > 0; ++ } ++ ++ protected boolean func_94477_d(int par1) { ++ return isRedstoneRepeaterBlockID(par1); ++ } ++ ++ /** ++ * A randomly called display update to be able to add particles or other items for display ++ */ ++ public void randomDisplayTick(World par1World, int par2, int par3, int par4, Random par5Random) { ++ if (this.isRepeaterPowered) { ++ int var6 = par1World.getBlockMetadata(par2, par3, par4); + int var7 = getDirection(var6); +- double var8 = (double)((float)var2 + 0.5F) + (double)(var5.nextFloat() - 0.5F) * 0.2D; +- double var10 = (double)((float)var3 + 0.4F) + (double)(var5.nextFloat() - 0.5F) * 0.2D; +- double var12 = (double)((float)var4 + 0.5F) + (double)(var5.nextFloat() - 0.5F) * 0.2D; ++ double var8 = (double)((float)par2 + 0.5F) + (double)(par5Random.nextFloat() - 0.5F) * 0.2D; ++ double var10 = (double)((float)par3 + 0.4F) + (double)(par5Random.nextFloat() - 0.5F) * 0.2D; ++ double var12 = (double)((float)par4 + 0.5F) + (double)(par5Random.nextFloat() - 0.5F) * 0.2D; + double var14 = 0.0D; + double var16 = 0.0D; +- if(var5.nextInt(2) == 0) { +- switch(var7) { +- case 0: +- var16 = -0.3125D; +- break; +- case 1: +- var14 = 0.3125D; +- break; +- case 2: +- var16 = 0.3125D; +- break; +- case 3: +- var14 = -0.3125D; ++ ++ if (par5Random.nextInt(2) == 0) { ++ switch (var7) { ++ case 0: ++ var16 = -0.3125D; ++ break; ++ ++ case 1: ++ var14 = 0.3125D; ++ break; ++ ++ case 2: ++ var16 = 0.3125D; ++ break; ++ ++ case 3: ++ var14 = -0.3125D; + } + } else { + int var18 = (var6 & 12) >> 2; +- switch(var7) { +- case 0: +- var16 = repeaterTorchOffset[var18]; +- break; +- case 1: +- var14 = -repeaterTorchOffset[var18]; +- break; +- case 2: +- var16 = -repeaterTorchOffset[var18]; +- break; +- case 3: +- var14 = repeaterTorchOffset[var18]; ++ ++ switch (var7) { ++ case 0: ++ var16 = repeaterTorchOffset[var18]; ++ break; ++ ++ case 1: ++ var14 = -repeaterTorchOffset[var18]; ++ break; ++ ++ case 2: ++ var16 = -repeaterTorchOffset[var18]; ++ break; ++ ++ case 3: ++ var14 = repeaterTorchOffset[var18]; + } + } + +- var1.spawnParticle("reddust", var8 + var14, var10, var12 + var16, 0.0D, 0.0D, 0.0D); ++ par1World.spawnParticle("reddust", var8 + var14, var10, var12 + var16, 0.0D, 0.0D, 0.0D); + } + } + +- public void breakBlock(World var1, int var2, int var3, int var4, int var5, int var6) { +- super.breakBlock(var1, var2, var3, var4, var5, var6); +- this.func_94483_i_(var1, var2, var3, var4); ++ /** ++ * Called on server worlds only when the block has been replaced by a different block ID, or the same block with a ++ * different metadata value, but before the new metadata value is set. Args: World, x, y, z, old block ID, old metadata ++ */ ++ public void breakBlock(World par1World, int par2, int par3, int par4, int par5, int par6) { ++ super.breakBlock(par1World, par2, par3, par4, par5, par6); ++ this.func_94483_i_(par1World, par2, par3, par4); + } + } diff --git a/patches/net/minecraft/src/BlockRedstoneTorch.java.patch b/patches/net/minecraft/src/BlockRedstoneTorch.java.patch new file mode 100644 index 0000000..5222b89 --- /dev/null +++ b/patches/net/minecraft/src/BlockRedstoneTorch.java.patch @@ -0,0 +1,315 @@ +--- net/minecraft/src/BlockRedstoneTorch.java ++++ net/minecraft/src/BlockRedstoneTorch.java +@@ -7,26 +7,33 @@ + import java.util.Random; + + public class BlockRedstoneTorch extends BlockTorch { ++ ++ /** Whether the redstone torch is currently active or not. */ + private boolean torchActive; +- private static Map b = new HashMap(); +- +- private boolean checkForBurnout(World var1, int var2, int var3, int var4, boolean var5) { +- if(!b.containsKey(var1)) { +- b.put(var1, new ArrayList()); ++ ++ /** Map of ArrayLists of RedstoneUpdateInfo. Key of map is World. */ ++ private static Map redstoneUpdateInfoCache = new HashMap(); ++ ++ private boolean checkForBurnout(World par1World, int par2, int par3, int par4, boolean par5) { ++ if (!redstoneUpdateInfoCache.containsKey(par1World)) { ++ redstoneUpdateInfoCache.put(par1World, new ArrayList()); + } + +- List var6 = (List)b.get(var1); +- if(var5) { +- var6.add(new RedstoneUpdateInfo(var2, var3, var4, var1.getTotalWorldTime())); ++ List var6 = (List)redstoneUpdateInfoCache.get(par1World); ++ ++ if (par5) { ++ var6.add(new RedstoneUpdateInfo(par2, par3, par4, par1World.getTotalWorldTime())); + } + + int var7 = 0; + +- for(int var8 = 0; var8 < var6.size(); ++var8) { ++ for (int var8 = 0; var8 < var6.size(); ++var8) { + RedstoneUpdateInfo var9 = (RedstoneUpdateInfo)var6.get(var8); +- if(var9.x == var2 && var9.y == var3 && var9.z == var4) { ++ ++ if (var9.x == par2 && var9.y == par3 && var9.z == par4) { + ++var7; +- if(var7 >= 8) { ++ ++ if (var7 >= 8) { + return true; + } + } +@@ -35,137 +42,180 @@ + return false; + } + +- protected BlockRedstoneTorch(int var1, boolean var2) { +- super(var1); +- this.torchActive = var2; ++ protected BlockRedstoneTorch(int par1, boolean par2) { ++ super(par1); ++ this.torchActive = par2; + this.setTickRandomly(true); + this.setCreativeTab((CreativeTabs)null); + } + +- public int tickRate(World var1) { ++ /** ++ * How many world ticks before ticking ++ */ ++ public int tickRate(World par1World) { + return 2; + } + +- public void onBlockAdded(World var1, int var2, int var3, int var4) { +- if(var1.getBlockMetadata(var2, var3, var4) == 0) { +- super.onBlockAdded(var1, var2, var3, var4); +- } +- +- if(this.torchActive) { +- var1.notifyBlocksOfNeighborChange(var2, var3 - 1, var4, this.blockID); +- var1.notifyBlocksOfNeighborChange(var2, var3 + 1, var4, this.blockID); +- var1.notifyBlocksOfNeighborChange(var2 - 1, var3, var4, this.blockID); +- var1.notifyBlocksOfNeighborChange(var2 + 1, var3, var4, this.blockID); +- var1.notifyBlocksOfNeighborChange(var2, var3, var4 - 1, this.blockID); +- var1.notifyBlocksOfNeighborChange(var2, var3, var4 + 1, this.blockID); +- } +- +- } +- +- public void breakBlock(World var1, int var2, int var3, int var4, int var5, int var6) { +- if(this.torchActive) { +- var1.notifyBlocksOfNeighborChange(var2, var3 - 1, var4, this.blockID); +- var1.notifyBlocksOfNeighborChange(var2, var3 + 1, var4, this.blockID); +- var1.notifyBlocksOfNeighborChange(var2 - 1, var3, var4, this.blockID); +- var1.notifyBlocksOfNeighborChange(var2 + 1, var3, var4, this.blockID); +- var1.notifyBlocksOfNeighborChange(var2, var3, var4 - 1, this.blockID); +- var1.notifyBlocksOfNeighborChange(var2, var3, var4 + 1, this.blockID); +- } +- +- } +- +- public int isProvidingWeakPower(IBlockAccess var1, int var2, int var3, int var4, int var5) { +- if(!this.torchActive) { ++ /** ++ * Called whenever the block is added into the world. Args: world, x, y, z ++ */ ++ public void onBlockAdded(World par1World, int par2, int par3, int par4) { ++ if (par1World.getBlockMetadata(par2, par3, par4) == 0) { ++ super.onBlockAdded(par1World, par2, par3, par4); ++ } ++ ++ if (this.torchActive) { ++ par1World.notifyBlocksOfNeighborChange(par2, par3 - 1, par4, this.blockID); ++ par1World.notifyBlocksOfNeighborChange(par2, par3 + 1, par4, this.blockID); ++ par1World.notifyBlocksOfNeighborChange(par2 - 1, par3, par4, this.blockID); ++ par1World.notifyBlocksOfNeighborChange(par2 + 1, par3, par4, this.blockID); ++ par1World.notifyBlocksOfNeighborChange(par2, par3, par4 - 1, this.blockID); ++ par1World.notifyBlocksOfNeighborChange(par2, par3, par4 + 1, this.blockID); ++ } ++ } ++ ++ /** ++ * Called on server worlds only when the block has been replaced by a different block ID, or the same block with a ++ * different metadata value, but before the new metadata value is set. Args: World, x, y, z, old block ID, old metadata ++ */ ++ public void breakBlock(World par1World, int par2, int par3, int par4, int par5, int par6) { ++ if (this.torchActive) { ++ par1World.notifyBlocksOfNeighborChange(par2, par3 - 1, par4, this.blockID); ++ par1World.notifyBlocksOfNeighborChange(par2, par3 + 1, par4, this.blockID); ++ par1World.notifyBlocksOfNeighborChange(par2 - 1, par3, par4, this.blockID); ++ par1World.notifyBlocksOfNeighborChange(par2 + 1, par3, par4, this.blockID); ++ par1World.notifyBlocksOfNeighborChange(par2, par3, par4 - 1, this.blockID); ++ par1World.notifyBlocksOfNeighborChange(par2, par3, par4 + 1, this.blockID); ++ } ++ } ++ ++ /** ++ * Returns true if the block is emitting indirect/weak redstone power on the specified side. If isBlockNormalCube ++ * returns true, standard redstone propagation rules will apply instead and this will not be called. Args: World, X, Y, ++ * Z, side. Note that the side is reversed - eg it is 1 (up) when checking the bottom of the block. ++ */ ++ public int isProvidingWeakPower(IBlockAccess par1IBlockAccess, int par2, int par3, int par4, int par5) { ++ if (!this.torchActive) { + return 0; + } else { +- int var6 = var1.getBlockMetadata(var2, var3, var4); +- return var6 == 5 && var5 == 1 ? 0 : (var6 == 3 && var5 == 3 ? 0 : (var6 == 4 && var5 == 2 ? 0 : (var6 == 1 && var5 == 5 ? 0 : (var6 == 2 && var5 == 4 ? 0 : 15)))); ++ int var6 = par1IBlockAccess.getBlockMetadata(par2, par3, par4); ++ return var6 == 5 && par5 == 1 ? 0 : (var6 == 3 && par5 == 3 ? 0 : (var6 == 4 && par5 == 2 ? 0 : (var6 == 1 && par5 == 5 ? 0 : (var6 == 2 && par5 == 4 ? 0 : 15)))); + } + } + +- private boolean isIndirectlyPowered(World var1, int var2, int var3, int var4) { +- int var5 = var1.getBlockMetadata(var2, var3, var4); +- return var5 == 5 && var1.getIndirectPowerOutput(var2, var3 - 1, var4, 0) ? true : (var5 == 3 && var1.getIndirectPowerOutput(var2, var3, var4 - 1, 2) ? true : (var5 == 4 && var1.getIndirectPowerOutput(var2, var3, var4 + 1, 3) ? true : (var5 == 1 && var1.getIndirectPowerOutput(var2 - 1, var3, var4, 4) ? true : var5 == 2 && var1.getIndirectPowerOutput(var2 + 1, var3, var4, 5)))); ++ /** ++ * Returns true or false based on whether the block the torch is attached to is providing indirect power. ++ */ ++ private boolean isIndirectlyPowered(World par1World, int par2, int par3, int par4) { ++ int var5 = par1World.getBlockMetadata(par2, par3, par4); ++ return var5 == 5 && par1World.getIndirectPowerOutput(par2, par3 - 1, par4, 0) ? true : (var5 == 3 && par1World.getIndirectPowerOutput(par2, par3, par4 - 1, 2) ? true : (var5 == 4 && par1World.getIndirectPowerOutput(par2, par3, par4 + 1, 3) ? true : (var5 == 1 && par1World.getIndirectPowerOutput(par2 - 1, par3, par4, 4) ? true : var5 == 2 && par1World.getIndirectPowerOutput(par2 + 1, par3, par4, 5)))); + } + +- public void updateTick(World var1, int var2, int var3, int var4, Random var5) { +- boolean var6 = this.isIndirectlyPowered(var1, var2, var3, var4); +- List var7 = (List)b.get(var1); ++ /** ++ * Ticks the block if it's been scheduled ++ */ ++ public void updateTick(World par1World, int par2, int par3, int par4, Random par5Random) { ++ boolean var6 = this.isIndirectlyPowered(par1World, par2, par3, par4); ++ List var7 = (List)redstoneUpdateInfoCache.get(par1World); + +- while(var7 != null && !var7.isEmpty() && var1.getTotalWorldTime() - ((RedstoneUpdateInfo)var7.get(0)).updateTime > 60L) { ++ while (var7 != null && !var7.isEmpty() && par1World.getTotalWorldTime() - ((RedstoneUpdateInfo)var7.get(0)).updateTime > 60L) { + var7.remove(0); + } + +- if(this.torchActive) { +- if(var6) { +- var1.setBlock(var2, var3, var4, Block.torchRedstoneIdle.blockID, var1.getBlockMetadata(var2, var3, var4), 3); +- if(this.checkForBurnout(var1, var2, var3, var4, true)) { +- var1.playSoundEffect((double)((float)var2 + 0.5F), (double)((float)var3 + 0.5F), (double)((float)var4 + 0.5F), "random.fizz", 0.5F, 2.6F + (var1.s.nextFloat() - var1.s.nextFloat()) * 0.8F); +- +- for(int var8 = 0; var8 < 5; ++var8) { +- double var9 = (double)var2 + var5.nextDouble() * 0.6D + 0.2D; +- double var11 = (double)var3 + var5.nextDouble() * 0.6D + 0.2D; +- double var13 = (double)var4 + var5.nextDouble() * 0.6D + 0.2D; +- var1.spawnParticle("smoke", var9, var11, var13, 0.0D, 0.0D, 0.0D); ++ if (this.torchActive) { ++ if (var6) { ++ par1World.setBlock(par2, par3, par4, Block.torchRedstoneIdle.blockID, par1World.getBlockMetadata(par2, par3, par4), 3); ++ ++ if (this.checkForBurnout(par1World, par2, par3, par4, true)) { ++ par1World.playSoundEffect((double)((float)par2 + 0.5F), (double)((float)par3 + 0.5F), (double)((float)par4 + 0.5F), "random.fizz", 0.5F, 2.6F + (par1World.rand.nextFloat() - par1World.rand.nextFloat()) * 0.8F); ++ ++ for (int var8 = 0; var8 < 5; ++var8) { ++ double var9 = (double)par2 + par5Random.nextDouble() * 0.6D + 0.2D; ++ double var11 = (double)par3 + par5Random.nextDouble() * 0.6D + 0.2D; ++ double var13 = (double)par4 + par5Random.nextDouble() * 0.6D + 0.2D; ++ par1World.spawnParticle("smoke", var9, var11, var13, 0.0D, 0.0D, 0.0D); + } + } + } +- } else if(!var6 && !this.checkForBurnout(var1, var2, var3, var4, false)) { +- var1.setBlock(var2, var3, var4, Block.torchRedstoneActive.blockID, var1.getBlockMetadata(var2, var3, var4), 3); ++ } else if (!var6 && !this.checkForBurnout(par1World, par2, par3, par4, false)) { ++ par1World.setBlock(par2, par3, par4, Block.torchRedstoneActive.blockID, par1World.getBlockMetadata(par2, par3, par4), 3); + } +- + } + +- public void onNeighborBlockChange(World var1, int var2, int var3, int var4, int var5) { +- if(!this.func_94397_d(var1, var2, var3, var4, var5)) { +- boolean var6 = this.isIndirectlyPowered(var1, var2, var3, var4); +- if(this.torchActive && var6 || !this.torchActive && !var6) { +- var1.scheduleBlockUpdate(var2, var3, var4, this.blockID, this.tickRate(var1)); ++ /** ++ * Lets the block know when one of its neighbor changes. Doesn't know which neighbor changed (coordinates passed are ++ * their own) Args: x, y, z, neighbor blockID ++ */ ++ public void onNeighborBlockChange(World par1World, int par2, int par3, int par4, int par5) { ++ if (!this.func_94397_d(par1World, par2, par3, par4, par5)) { ++ boolean var6 = this.isIndirectlyPowered(par1World, par2, par3, par4); ++ ++ if (this.torchActive && var6 || !this.torchActive && !var6) { ++ par1World.scheduleBlockUpdate(par2, par3, par4, this.blockID, this.tickRate(par1World)); + } +- + } + } + +- public int isProvidingStrongPower(IBlockAccess var1, int var2, int var3, int var4, int var5) { +- return var5 == 0 ? this.isProvidingWeakPower(var1, var2, var3, var4, var5) : 0; ++ /** ++ * Returns true if the block is emitting direct/strong redstone power on the specified side. Args: World, X, Y, Z, ++ * side. Note that the side is reversed - eg it is 1 (up) when checking the bottom of the block. ++ */ ++ public int isProvidingStrongPower(IBlockAccess par1IBlockAccess, int par2, int par3, int par4, int par5) { ++ return par5 == 0 ? this.isProvidingWeakPower(par1IBlockAccess, par2, par3, par4, par5) : 0; + } + +- public int idDropped(int var1, Random var2, int var3) { ++ /** ++ * Returns the ID of the items to drop on destruction. ++ */ ++ public int idDropped(int par1, Random par2Random, int par3) { + return Block.torchRedstoneActive.blockID; + } + ++ /** ++ * Can this block provide power. Only wire currently seems to have this change based on its state. ++ */ + public boolean canProvidePower() { + return true; + } + +- public void randomDisplayTick(World var1, int var2, int var3, int var4, Random var5) { +- if(this.torchActive) { +- int var6 = var1.getBlockMetadata(var2, var3, var4); +- double var7 = (double)((float)var2 + 0.5F) + (double)(var5.nextFloat() - 0.5F) * 0.2D; +- double var9 = (double)((float)var3 + 0.7F) + (double)(var5.nextFloat() - 0.5F) * 0.2D; +- double var11 = (double)((float)var4 + 0.5F) + (double)(var5.nextFloat() - 0.5F) * 0.2D; +- double var13 = (double)0.22F; +- double var15 = (double)0.27F; +- if(var6 == 1) { +- var1.spawnParticle("reddust", var7 - var15, var9 + var13, var11, 0.0D, 0.0D, 0.0D); +- } else if(var6 == 2) { +- var1.spawnParticle("reddust", var7 + var15, var9 + var13, var11, 0.0D, 0.0D, 0.0D); +- } else if(var6 == 3) { +- var1.spawnParticle("reddust", var7, var9 + var13, var11 - var15, 0.0D, 0.0D, 0.0D); +- } else if(var6 == 4) { +- var1.spawnParticle("reddust", var7, var9 + var13, var11 + var15, 0.0D, 0.0D, 0.0D); ++ /** ++ * A randomly called display update to be able to add particles or other items for display ++ */ ++ public void randomDisplayTick(World par1World, int par2, int par3, int par4, Random par5Random) { ++ if (this.torchActive) { ++ int var6 = par1World.getBlockMetadata(par2, par3, par4); ++ double var7 = (double)((float)par2 + 0.5F) + (double)(par5Random.nextFloat() - 0.5F) * 0.2D; ++ double var9 = (double)((float)par3 + 0.7F) + (double)(par5Random.nextFloat() - 0.5F) * 0.2D; ++ double var11 = (double)((float)par4 + 0.5F) + (double)(par5Random.nextFloat() - 0.5F) * 0.2D; ++ double var13 = 0.2199999988079071D; ++ double var15 = 0.27000001072883606D; ++ ++ if (var6 == 1) { ++ par1World.spawnParticle("reddust", var7 - var15, var9 + var13, var11, 0.0D, 0.0D, 0.0D); ++ } else if (var6 == 2) { ++ par1World.spawnParticle("reddust", var7 + var15, var9 + var13, var11, 0.0D, 0.0D, 0.0D); ++ } else if (var6 == 3) { ++ par1World.spawnParticle("reddust", var7, var9 + var13, var11 - var15, 0.0D, 0.0D, 0.0D); ++ } else if (var6 == 4) { ++ par1World.spawnParticle("reddust", var7, var9 + var13, var11 + var15, 0.0D, 0.0D, 0.0D); + } else { +- var1.spawnParticle("reddust", var7, var9, var11, 0.0D, 0.0D, 0.0D); ++ par1World.spawnParticle("reddust", var7, var9, var11, 0.0D, 0.0D, 0.0D); + } +- + } + } + +- public int idPicked(World var1, int var2, int var3, int var4) { ++ /** ++ * only called by clickMiddleMouseButton , and passed to inventory.setCurrentItem (along with isCreative) ++ */ ++ public int idPicked(World par1World, int par2, int par3, int par4) { + return Block.torchRedstoneActive.blockID; + } + +- public boolean isAssociatedBlockID(int var1) { +- return var1 == Block.torchRedstoneIdle.blockID || var1 == Block.torchRedstoneActive.blockID; ++ /** ++ * Returns true if the given block ID is equivalent to this one. Example: redstoneTorchOn matches itself and ++ * redstoneTorchOff, and vice versa. Most blocks only match themselves. ++ */ ++ public boolean isAssociatedBlockID(int par1) { ++ return par1 == Block.torchRedstoneIdle.blockID || par1 == Block.torchRedstoneActive.blockID; + } + } diff --git a/patches/net/minecraft/src/BlockRedstoneWire.java.patch b/patches/net/minecraft/src/BlockRedstoneWire.java.patch new file mode 100644 index 0000000..b01d78b --- /dev/null +++ b/patches/net/minecraft/src/BlockRedstoneWire.java.patch @@ -0,0 +1,685 @@ +--- net/minecraft/src/BlockRedstoneWire.java ++++ net/minecraft/src/BlockRedstoneWire.java +@@ -5,355 +5,465 @@ + import java.util.Random; + import java.util.Set; + ++import com.prupe.mcpatcher.cc.ColorizeBlock; ++import com.prupe.mcpatcher.cc.Colorizer; ++ + public class BlockRedstoneWire extends Block { ++ ++ /** ++ * When false, power transmission methods do not look at other redstone wires. Used internally during ++ * updateCurrentStrength. ++ */ + private boolean wiresProvidePower = true; +- private Set b = new HashSet(); ++ private Set blocksNeedingUpdate = new HashSet(); + private Icon field_94413_c; + private Icon field_94410_cO; + private Icon field_94411_cP; + private Icon field_94412_cQ; + +- public BlockRedstoneWire(int var1) { +- super(var1, Material.circuits); +- this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F / 16.0F, 1.0F); ++ public BlockRedstoneWire(int par1) { ++ super(par1, Material.circuits); ++ this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.0625F, 1.0F); + } + +- public AxisAlignedBB getCollisionBoundingBoxFromPool(World var1, int var2, int var3, int var4) { ++ /** ++ * Returns a bounding box from the pool of bounding boxes (this means this box can change after the pool has been ++ * cleared to be reused) ++ */ ++ public AxisAlignedBB getCollisionBoundingBoxFromPool(World par1World, int par2, int par3, int par4) { + return null; + } + ++ /** ++ * Is this block (a) opaque and (b) a full 1m cube? This determines whether or not to render the shared face of two ++ * adjacent blocks and also whether the player can attach torches, redstone wire, etc to this block. ++ */ + public boolean isOpaqueCube() { + return false; + } + ++ /** ++ * If this block doesn't render as an ordinary block it will return False (examples: signs, buttons, stairs, etc) ++ */ + public boolean renderAsNormalBlock() { + return false; + } + ++ /** ++ * The type of render function that is called for this block ++ */ + public int getRenderType() { + return 5; + } + +- public int colorMultiplier(IBlockAccess var1, int var2, int var3, int var4) { +- return 8388608; +- } +- +- public boolean canPlaceBlockAt(World var1, int var2, int var3, int var4) { +- return var1.doesBlockHaveSolidTopSurface(var2, var3 - 1, var4) || var1.getBlockId(var2, var3 - 1, var4) == Block.glowStone.blockID; +- } +- +- private void updateAndPropagateCurrentStrength(World var1, int var2, int var3, int var4) { +- this.calculateCurrentChanges(var1, var2, var3, var4, var2, var3, var4); +- ArrayList var5 = new ArrayList(this.b); +- this.b.clear(); +- +- for(int var6 = 0; var6 < var5.size(); ++var6) { ++ /** ++ * Returns a integer with hex for 0xrrggbb with this color multiplied against the blocks color. Note only called when ++ * first determining what to render. ++ */ ++ public int colorMultiplier(IBlockAccess par1IBlockAccess, int par2, int par3, int par4) { ++ // MCPatcher Start ++ return ColorizeBlock.colorizeRedstoneWire(par1IBlockAccess, par2, par3, par4, 8388608); ++ // MCPatcher End ++ } ++ ++ /** ++ * Checks to see if its valid to put this block at the specified coordinates. Args: world, x, y, z ++ */ ++ public boolean canPlaceBlockAt(World par1World, int par2, int par3, int par4) { ++ return par1World.doesBlockHaveSolidTopSurface(par2, par3 - 1, par4) || par1World.getBlockId(par2, par3 - 1, par4) == Block.glowStone.blockID; ++ } ++ ++ /** ++ * Sets the strength of the wire current (0-15) for this block based on neighboring blocks and propagates to ++ * neighboring redstone wires ++ */ ++ private void updateAndPropagateCurrentStrength(World par1World, int par2, int par3, int par4) { ++ this.calculateCurrentChanges(par1World, par2, par3, par4, par2, par3, par4); ++ ArrayList var5 = new ArrayList(this.blocksNeedingUpdate); ++ this.blocksNeedingUpdate.clear(); ++ ++ for (int var6 = 0; var6 < var5.size(); ++var6) { + ChunkPosition var7 = (ChunkPosition)var5.get(var6); +- var1.notifyBlocksOfNeighborChange(var7.x, var7.y, var7.z, this.blockID); ++ par1World.notifyBlocksOfNeighborChange(var7.x, var7.y, var7.z, this.blockID); + } +- + } + +- private void calculateCurrentChanges(World var1, int var2, int var3, int var4, int var5, int var6, int var7) { +- int var8 = var1.getBlockMetadata(var2, var3, var4); ++ private void calculateCurrentChanges(World par1World, int par2, int par3, int par4, int par5, int par6, int par7) { ++ int var8 = par1World.getBlockMetadata(par2, par3, par4); + byte var9 = 0; +- int var15 = this.getMaxCurrentStrength(var1, var5, var6, var7, var9); ++ int var15 = this.getMaxCurrentStrength(par1World, par5, par6, par7, var9); + this.wiresProvidePower = false; +- int var10 = var1.getStrongestIndirectPower(var2, var3, var4); ++ int var10 = par1World.getStrongestIndirectPower(par2, par3, par4); + this.wiresProvidePower = true; +- if(var10 > 0 && var10 > var15 - 1) { ++ ++ if (var10 > 0 && var10 > var15 - 1) { + var15 = var10; + } + + int var11 = 0; + +- for(int var12 = 0; var12 < 4; ++var12) { +- int var13 = var2; +- int var14 = var4; +- if(var12 == 0) { +- var13 = var2 - 1; ++ for (int var12 = 0; var12 < 4; ++var12) { ++ int var13 = par2; ++ int var14 = par4; ++ ++ if (var12 == 0) { ++ var13 = par2 - 1; + } + +- if(var12 == 1) { ++ if (var12 == 1) { + ++var13; + } + +- if(var12 == 2) { +- var14 = var4 - 1; ++ if (var12 == 2) { ++ var14 = par4 - 1; + } + +- if(var12 == 3) { ++ if (var12 == 3) { + ++var14; + } + +- if(var13 != var5 || var14 != var7) { +- var11 = this.getMaxCurrentStrength(var1, var13, var3, var14, var11); ++ if (var13 != par5 || var14 != par7) { ++ var11 = this.getMaxCurrentStrength(par1World, var13, par3, var14, var11); + } + +- if(var1.isBlockNormalCube(var13, var3, var14) && !var1.isBlockNormalCube(var2, var3 + 1, var4)) { +- if((var13 != var5 || var14 != var7) && var3 >= var6) { +- var11 = this.getMaxCurrentStrength(var1, var13, var3 + 1, var14, var11); ++ if (par1World.isBlockNormalCube(var13, par3, var14) && !par1World.isBlockNormalCube(par2, par3 + 1, par4)) { ++ if ((var13 != par5 || var14 != par7) && par3 >= par6) { ++ var11 = this.getMaxCurrentStrength(par1World, var13, par3 + 1, var14, var11); + } +- } else if(!var1.isBlockNormalCube(var13, var3, var14) && (var13 != var5 || var14 != var7) && var3 <= var6) { +- var11 = this.getMaxCurrentStrength(var1, var13, var3 - 1, var14, var11); ++ } else if (!par1World.isBlockNormalCube(var13, par3, var14) && (var13 != par5 || var14 != par7) && par3 <= par6) { ++ var11 = this.getMaxCurrentStrength(par1World, var13, par3 - 1, var14, var11); + } + } + +- if(var11 > var15) { ++ if (var11 > var15) { + var15 = var11 - 1; +- } else if(var15 > 0) { ++ } else if (var15 > 0) { + --var15; + } else { + var15 = 0; + } + +- if(var10 > var15 - 1) { ++ if (var10 > var15 - 1) { + var15 = var10; + } + +- if(var8 != var15) { +- var1.setBlockMetadata(var2, var3, var4, var15, 2); +- this.b.add(new ChunkPosition(var2, var3, var4)); +- this.b.add(new ChunkPosition(var2 - 1, var3, var4)); +- this.b.add(new ChunkPosition(var2 + 1, var3, var4)); +- this.b.add(new ChunkPosition(var2, var3 - 1, var4)); +- this.b.add(new ChunkPosition(var2, var3 + 1, var4)); +- this.b.add(new ChunkPosition(var2, var3, var4 - 1)); +- this.b.add(new ChunkPosition(var2, var3, var4 + 1)); +- } +- +- } +- +- private void notifyWireNeighborsOfNeighborChange(World var1, int var2, int var3, int var4) { +- if(var1.getBlockId(var2, var3, var4) == this.blockID) { +- var1.notifyBlocksOfNeighborChange(var2, var3, var4, this.blockID); +- var1.notifyBlocksOfNeighborChange(var2 - 1, var3, var4, this.blockID); +- var1.notifyBlocksOfNeighborChange(var2 + 1, var3, var4, this.blockID); +- var1.notifyBlocksOfNeighborChange(var2, var3, var4 - 1, this.blockID); +- var1.notifyBlocksOfNeighborChange(var2, var3, var4 + 1, this.blockID); +- var1.notifyBlocksOfNeighborChange(var2, var3 - 1, var4, this.blockID); +- var1.notifyBlocksOfNeighborChange(var2, var3 + 1, var4, this.blockID); +- } +- } +- +- public void onBlockAdded(World var1, int var2, int var3, int var4) { +- super.onBlockAdded(var1, var2, var3, var4); +- if(!var1.isRemote) { +- this.updateAndPropagateCurrentStrength(var1, var2, var3, var4); +- var1.notifyBlocksOfNeighborChange(var2, var3 + 1, var4, this.blockID); +- var1.notifyBlocksOfNeighborChange(var2, var3 - 1, var4, this.blockID); +- this.notifyWireNeighborsOfNeighborChange(var1, var2 - 1, var3, var4); +- this.notifyWireNeighborsOfNeighborChange(var1, var2 + 1, var3, var4); +- this.notifyWireNeighborsOfNeighborChange(var1, var2, var3, var4 - 1); +- this.notifyWireNeighborsOfNeighborChange(var1, var2, var3, var4 + 1); +- if(var1.isBlockNormalCube(var2 - 1, var3, var4)) { +- this.notifyWireNeighborsOfNeighborChange(var1, var2 - 1, var3 + 1, var4); +- } else { +- this.notifyWireNeighborsOfNeighborChange(var1, var2 - 1, var3 - 1, var4); +- } +- +- if(var1.isBlockNormalCube(var2 + 1, var3, var4)) { +- this.notifyWireNeighborsOfNeighborChange(var1, var2 + 1, var3 + 1, var4); +- } else { +- this.notifyWireNeighborsOfNeighborChange(var1, var2 + 1, var3 - 1, var4); +- } +- +- if(var1.isBlockNormalCube(var2, var3, var4 - 1)) { +- this.notifyWireNeighborsOfNeighborChange(var1, var2, var3 + 1, var4 - 1); +- } else { +- this.notifyWireNeighborsOfNeighborChange(var1, var2, var3 - 1, var4 - 1); +- } +- +- if(var1.isBlockNormalCube(var2, var3, var4 + 1)) { +- this.notifyWireNeighborsOfNeighborChange(var1, var2, var3 + 1, var4 + 1); +- } else { +- this.notifyWireNeighborsOfNeighborChange(var1, var2, var3 - 1, var4 + 1); +- } +- +- } +- } +- +- public void breakBlock(World var1, int var2, int var3, int var4, int var5, int var6) { +- super.breakBlock(var1, var2, var3, var4, var5, var6); +- if(!var1.isRemote) { +- var1.notifyBlocksOfNeighborChange(var2, var3 + 1, var4, this.blockID); +- var1.notifyBlocksOfNeighborChange(var2, var3 - 1, var4, this.blockID); +- var1.notifyBlocksOfNeighborChange(var2 + 1, var3, var4, this.blockID); +- var1.notifyBlocksOfNeighborChange(var2 - 1, var3, var4, this.blockID); +- var1.notifyBlocksOfNeighborChange(var2, var3, var4 + 1, this.blockID); +- var1.notifyBlocksOfNeighborChange(var2, var3, var4 - 1, this.blockID); +- this.updateAndPropagateCurrentStrength(var1, var2, var3, var4); +- this.notifyWireNeighborsOfNeighborChange(var1, var2 - 1, var3, var4); +- this.notifyWireNeighborsOfNeighborChange(var1, var2 + 1, var3, var4); +- this.notifyWireNeighborsOfNeighborChange(var1, var2, var3, var4 - 1); +- this.notifyWireNeighborsOfNeighborChange(var1, var2, var3, var4 + 1); +- if(var1.isBlockNormalCube(var2 - 1, var3, var4)) { +- this.notifyWireNeighborsOfNeighborChange(var1, var2 - 1, var3 + 1, var4); +- } else { +- this.notifyWireNeighborsOfNeighborChange(var1, var2 - 1, var3 - 1, var4); +- } +- +- if(var1.isBlockNormalCube(var2 + 1, var3, var4)) { +- this.notifyWireNeighborsOfNeighborChange(var1, var2 + 1, var3 + 1, var4); +- } else { +- this.notifyWireNeighborsOfNeighborChange(var1, var2 + 1, var3 - 1, var4); +- } +- +- if(var1.isBlockNormalCube(var2, var3, var4 - 1)) { +- this.notifyWireNeighborsOfNeighborChange(var1, var2, var3 + 1, var4 - 1); +- } else { +- this.notifyWireNeighborsOfNeighborChange(var1, var2, var3 - 1, var4 - 1); +- } +- +- if(var1.isBlockNormalCube(var2, var3, var4 + 1)) { +- this.notifyWireNeighborsOfNeighborChange(var1, var2, var3 + 1, var4 + 1); +- } else { +- this.notifyWireNeighborsOfNeighborChange(var1, var2, var3 - 1, var4 + 1); +- } +- +- } +- } +- +- private int getMaxCurrentStrength(World var1, int var2, int var3, int var4, int var5) { +- if(var1.getBlockId(var2, var3, var4) != this.blockID) { +- return var5; ++ if (var8 != var15) { ++ par1World.setBlockMetadataWithNotify(par2, par3, par4, var15, 2); ++ this.blocksNeedingUpdate.add(new ChunkPosition(par2, par3, par4)); ++ this.blocksNeedingUpdate.add(new ChunkPosition(par2 - 1, par3, par4)); ++ this.blocksNeedingUpdate.add(new ChunkPosition(par2 + 1, par3, par4)); ++ this.blocksNeedingUpdate.add(new ChunkPosition(par2, par3 - 1, par4)); ++ this.blocksNeedingUpdate.add(new ChunkPosition(par2, par3 + 1, par4)); ++ this.blocksNeedingUpdate.add(new ChunkPosition(par2, par3, par4 - 1)); ++ this.blocksNeedingUpdate.add(new ChunkPosition(par2, par3, par4 + 1)); ++ } ++ } ++ ++ /** ++ * Calls World.notifyBlocksOfNeighborChange() for all neighboring blocks, but only if the given block is a redstone ++ * wire. ++ */ ++ private void notifyWireNeighborsOfNeighborChange(World par1World, int par2, int par3, int par4) { ++ if (par1World.getBlockId(par2, par3, par4) == this.blockID) { ++ par1World.notifyBlocksOfNeighborChange(par2, par3, par4, this.blockID); ++ par1World.notifyBlocksOfNeighborChange(par2 - 1, par3, par4, this.blockID); ++ par1World.notifyBlocksOfNeighborChange(par2 + 1, par3, par4, this.blockID); ++ par1World.notifyBlocksOfNeighborChange(par2, par3, par4 - 1, this.blockID); ++ par1World.notifyBlocksOfNeighborChange(par2, par3, par4 + 1, this.blockID); ++ par1World.notifyBlocksOfNeighborChange(par2, par3 - 1, par4, this.blockID); ++ par1World.notifyBlocksOfNeighborChange(par2, par3 + 1, par4, this.blockID); ++ } ++ } ++ ++ /** ++ * Called whenever the block is added into the world. Args: world, x, y, z ++ */ ++ public void onBlockAdded(World par1World, int par2, int par3, int par4) { ++ super.onBlockAdded(par1World, par2, par3, par4); ++ ++ if (!par1World.isRemote) { ++ this.updateAndPropagateCurrentStrength(par1World, par2, par3, par4); ++ par1World.notifyBlocksOfNeighborChange(par2, par3 + 1, par4, this.blockID); ++ par1World.notifyBlocksOfNeighborChange(par2, par3 - 1, par4, this.blockID); ++ this.notifyWireNeighborsOfNeighborChange(par1World, par2 - 1, par3, par4); ++ this.notifyWireNeighborsOfNeighborChange(par1World, par2 + 1, par3, par4); ++ this.notifyWireNeighborsOfNeighborChange(par1World, par2, par3, par4 - 1); ++ this.notifyWireNeighborsOfNeighborChange(par1World, par2, par3, par4 + 1); ++ ++ if (par1World.isBlockNormalCube(par2 - 1, par3, par4)) { ++ this.notifyWireNeighborsOfNeighborChange(par1World, par2 - 1, par3 + 1, par4); ++ } else { ++ this.notifyWireNeighborsOfNeighborChange(par1World, par2 - 1, par3 - 1, par4); ++ } ++ ++ if (par1World.isBlockNormalCube(par2 + 1, par3, par4)) { ++ this.notifyWireNeighborsOfNeighborChange(par1World, par2 + 1, par3 + 1, par4); ++ } else { ++ this.notifyWireNeighborsOfNeighborChange(par1World, par2 + 1, par3 - 1, par4); ++ } ++ ++ if (par1World.isBlockNormalCube(par2, par3, par4 - 1)) { ++ this.notifyWireNeighborsOfNeighborChange(par1World, par2, par3 + 1, par4 - 1); ++ } else { ++ this.notifyWireNeighborsOfNeighborChange(par1World, par2, par3 - 1, par4 - 1); ++ } ++ ++ if (par1World.isBlockNormalCube(par2, par3, par4 + 1)) { ++ this.notifyWireNeighborsOfNeighborChange(par1World, par2, par3 + 1, par4 + 1); ++ } else { ++ this.notifyWireNeighborsOfNeighborChange(par1World, par2, par3 - 1, par4 + 1); ++ } ++ } ++ } ++ ++ /** ++ * Called on server worlds only when the block has been replaced by a different block ID, or the same block with a ++ * different metadata value, but before the new metadata value is set. Args: World, x, y, z, old block ID, old metadata ++ */ ++ public void breakBlock(World par1World, int par2, int par3, int par4, int par5, int par6) { ++ super.breakBlock(par1World, par2, par3, par4, par5, par6); ++ ++ if (!par1World.isRemote) { ++ par1World.notifyBlocksOfNeighborChange(par2, par3 + 1, par4, this.blockID); ++ par1World.notifyBlocksOfNeighborChange(par2, par3 - 1, par4, this.blockID); ++ par1World.notifyBlocksOfNeighborChange(par2 + 1, par3, par4, this.blockID); ++ par1World.notifyBlocksOfNeighborChange(par2 - 1, par3, par4, this.blockID); ++ par1World.notifyBlocksOfNeighborChange(par2, par3, par4 + 1, this.blockID); ++ par1World.notifyBlocksOfNeighborChange(par2, par3, par4 - 1, this.blockID); ++ this.updateAndPropagateCurrentStrength(par1World, par2, par3, par4); ++ this.notifyWireNeighborsOfNeighborChange(par1World, par2 - 1, par3, par4); ++ this.notifyWireNeighborsOfNeighborChange(par1World, par2 + 1, par3, par4); ++ this.notifyWireNeighborsOfNeighborChange(par1World, par2, par3, par4 - 1); ++ this.notifyWireNeighborsOfNeighborChange(par1World, par2, par3, par4 + 1); ++ ++ if (par1World.isBlockNormalCube(par2 - 1, par3, par4)) { ++ this.notifyWireNeighborsOfNeighborChange(par1World, par2 - 1, par3 + 1, par4); ++ } else { ++ this.notifyWireNeighborsOfNeighborChange(par1World, par2 - 1, par3 - 1, par4); ++ } ++ ++ if (par1World.isBlockNormalCube(par2 + 1, par3, par4)) { ++ this.notifyWireNeighborsOfNeighborChange(par1World, par2 + 1, par3 + 1, par4); ++ } else { ++ this.notifyWireNeighborsOfNeighborChange(par1World, par2 + 1, par3 - 1, par4); ++ } ++ ++ if (par1World.isBlockNormalCube(par2, par3, par4 - 1)) { ++ this.notifyWireNeighborsOfNeighborChange(par1World, par2, par3 + 1, par4 - 1); ++ } else { ++ this.notifyWireNeighborsOfNeighborChange(par1World, par2, par3 - 1, par4 - 1); ++ } ++ ++ if (par1World.isBlockNormalCube(par2, par3, par4 + 1)) { ++ this.notifyWireNeighborsOfNeighborChange(par1World, par2, par3 + 1, par4 + 1); ++ } else { ++ this.notifyWireNeighborsOfNeighborChange(par1World, par2, par3 - 1, par4 + 1); ++ } ++ } ++ } ++ ++ /** ++ * Returns the current strength at the specified block if it is greater than the passed value, or the passed value ++ * otherwise. Signature: (world, x, y, z, strength) ++ */ ++ // Spout Start - private to public ++ public int getMaxCurrentStrength(World par1World, int par2, int par3, int par4, int par5) { ++ // Spout End ++ if (par1World.getBlockId(par2, par3, par4) != this.blockID) { ++ return par5; + } else { +- int var6 = var1.getBlockMetadata(var2, var3, var4); +- return var6 > var5 ? var6 : var5; ++ int var6 = par1World.getBlockMetadata(par2, par3, par4); ++ return var6 > par5 ? var6 : par5; + } + } + +- public void onNeighborBlockChange(World var1, int var2, int var3, int var4, int var5) { +- if(!var1.isRemote) { +- boolean var6 = this.canPlaceBlockAt(var1, var2, var3, var4); +- if(var6) { +- this.updateAndPropagateCurrentStrength(var1, var2, var3, var4); ++ /** ++ * Lets the block know when one of its neighbor changes. Doesn't know which neighbor changed (coordinates passed are ++ * their own) Args: x, y, z, neighbor blockID ++ */ ++ public void onNeighborBlockChange(World par1World, int par2, int par3, int par4, int par5) { ++ if (!par1World.isRemote) { ++ boolean var6 = this.canPlaceBlockAt(par1World, par2, par3, par4); ++ ++ if (var6) { ++ this.updateAndPropagateCurrentStrength(par1World, par2, par3, par4); + } else { +- this.dropBlockAsItem(var1, var2, var3, var4, 0, 0); +- var1.setBlockToAir(var2, var3, var4); ++ this.dropBlockAsItem(par1World, par2, par3, par4, 0, 0); ++ par1World.setBlockToAir(par2, par3, par4); + } + +- super.onNeighborBlockChange(var1, var2, var3, var4, var5); ++ super.onNeighborBlockChange(par1World, par2, par3, par4, par5); + } + } + +- public int idDropped(int var1, Random var2, int var3) { ++ /** ++ * Returns the ID of the items to drop on destruction. ++ */ ++ public int idDropped(int par1, Random par2Random, int par3) { + return Item.redstone.itemID; + } + +- public int isProvidingStrongPower(IBlockAccess var1, int var2, int var3, int var4, int var5) { +- return !this.wiresProvidePower ? 0 : this.isProvidingWeakPower(var1, var2, var3, var4, var5); ++ /** ++ * Returns true if the block is emitting direct/strong redstone power on the specified side. Args: World, X, Y, Z, ++ * side. Note that the side is reversed - eg it is 1 (up) when checking the bottom of the block. ++ */ ++ public int isProvidingStrongPower(IBlockAccess par1IBlockAccess, int par2, int par3, int par4, int par5) { ++ return !this.wiresProvidePower ? 0 : this.isProvidingWeakPower(par1IBlockAccess, par2, par3, par4, par5); + } + +- public int isProvidingWeakPower(IBlockAccess var1, int var2, int var3, int var4, int var5) { +- if(!this.wiresProvidePower) { ++ /** ++ * Returns true if the block is emitting indirect/weak redstone power on the specified side. If isBlockNormalCube ++ * returns true, standard redstone propagation rules will apply instead and this will not be called. Args: World, X, Y, ++ * Z, side. Note that the side is reversed - eg it is 1 (up) when checking the bottom of the block. ++ */ ++ public int isProvidingWeakPower(IBlockAccess par1IBlockAccess, int par2, int par3, int par4, int par5) { ++ if (!this.wiresProvidePower) { + return 0; + } else { +- int var6 = var1.getBlockMetadata(var2, var3, var4); +- if(var6 == 0) { ++ int var6 = par1IBlockAccess.getBlockMetadata(par2, par3, par4); ++ ++ if (var6 == 0) { + return 0; +- } else if(var5 == 1) { ++ } else if (par5 == 1) { + return var6; + } else { +- boolean var7 = isPoweredOrRepeater(var1, var2 - 1, var3, var4, 1) || !var1.isBlockNormalCube(var2 - 1, var3, var4) && isPoweredOrRepeater(var1, var2 - 1, var3 - 1, var4, -1); +- boolean var8 = isPoweredOrRepeater(var1, var2 + 1, var3, var4, 3) || !var1.isBlockNormalCube(var2 + 1, var3, var4) && isPoweredOrRepeater(var1, var2 + 1, var3 - 1, var4, -1); +- boolean var9 = isPoweredOrRepeater(var1, var2, var3, var4 - 1, 2) || !var1.isBlockNormalCube(var2, var3, var4 - 1) && isPoweredOrRepeater(var1, var2, var3 - 1, var4 - 1, -1); +- boolean var10 = isPoweredOrRepeater(var1, var2, var3, var4 + 1, 0) || !var1.isBlockNormalCube(var2, var3, var4 + 1) && isPoweredOrRepeater(var1, var2, var3 - 1, var4 + 1, -1); +- if(!var1.isBlockNormalCube(var2, var3 + 1, var4)) { +- if(var1.isBlockNormalCube(var2 - 1, var3, var4) && isPoweredOrRepeater(var1, var2 - 1, var3 + 1, var4, -1)) { ++ boolean var7 = isPoweredOrRepeater(par1IBlockAccess, par2 - 1, par3, par4, 1) || !par1IBlockAccess.isBlockNormalCube(par2 - 1, par3, par4) && isPoweredOrRepeater(par1IBlockAccess, par2 - 1, par3 - 1, par4, -1); ++ boolean var8 = isPoweredOrRepeater(par1IBlockAccess, par2 + 1, par3, par4, 3) || !par1IBlockAccess.isBlockNormalCube(par2 + 1, par3, par4) && isPoweredOrRepeater(par1IBlockAccess, par2 + 1, par3 - 1, par4, -1); ++ boolean var9 = isPoweredOrRepeater(par1IBlockAccess, par2, par3, par4 - 1, 2) || !par1IBlockAccess.isBlockNormalCube(par2, par3, par4 - 1) && isPoweredOrRepeater(par1IBlockAccess, par2, par3 - 1, par4 - 1, -1); ++ boolean var10 = isPoweredOrRepeater(par1IBlockAccess, par2, par3, par4 + 1, 0) || !par1IBlockAccess.isBlockNormalCube(par2, par3, par4 + 1) && isPoweredOrRepeater(par1IBlockAccess, par2, par3 - 1, par4 + 1, -1); ++ ++ if (!par1IBlockAccess.isBlockNormalCube(par2, par3 + 1, par4)) { ++ if (par1IBlockAccess.isBlockNormalCube(par2 - 1, par3, par4) && isPoweredOrRepeater(par1IBlockAccess, par2 - 1, par3 + 1, par4, -1)) { + var7 = true; + } + +- if(var1.isBlockNormalCube(var2 + 1, var3, var4) && isPoweredOrRepeater(var1, var2 + 1, var3 + 1, var4, -1)) { ++ if (par1IBlockAccess.isBlockNormalCube(par2 + 1, par3, par4) && isPoweredOrRepeater(par1IBlockAccess, par2 + 1, par3 + 1, par4, -1)) { + var8 = true; + } + +- if(var1.isBlockNormalCube(var2, var3, var4 - 1) && isPoweredOrRepeater(var1, var2, var3 + 1, var4 - 1, -1)) { ++ if (par1IBlockAccess.isBlockNormalCube(par2, par3, par4 - 1) && isPoweredOrRepeater(par1IBlockAccess, par2, par3 + 1, par4 - 1, -1)) { + var9 = true; + } + +- if(var1.isBlockNormalCube(var2, var3, var4 + 1) && isPoweredOrRepeater(var1, var2, var3 + 1, var4 + 1, -1)) { ++ if (par1IBlockAccess.isBlockNormalCube(par2, par3, par4 + 1) && isPoweredOrRepeater(par1IBlockAccess, par2, par3 + 1, par4 + 1, -1)) { + var10 = true; + } + } + +- return !var9 && !var8 && !var7 && !var10 && var5 >= 2 && var5 <= 5 ? var6 : (var5 == 2 && var9 && !var7 && !var8 ? var6 : (var5 == 3 && var10 && !var7 && !var8 ? var6 : (var5 == 4 && var7 && !var9 && !var10 ? var6 : (var5 == 5 && var8 && !var9 && !var10 ? var6 : 0)))); ++ return !var9 && !var8 && !var7 && !var10 && par5 >= 2 && par5 <= 5 ? var6 : (par5 == 2 && var9 && !var7 && !var8 ? var6 : (par5 == 3 && var10 && !var7 && !var8 ? var6 : (par5 == 4 && var7 && !var9 && !var10 ? var6 : (par5 == 5 && var8 && !var9 && !var10 ? var6 : 0)))); + } + } + } + ++ /** ++ * Can this block provide power. Only wire currently seems to have this change based on its state. ++ */ + public boolean canProvidePower() { + return this.wiresProvidePower; + } + +- public void randomDisplayTick(World var1, int var2, int var3, int var4, Random var5) { +- int var6 = var1.getBlockMetadata(var2, var3, var4); +- if(var6 > 0) { +- double var7 = (double)var2 + 0.5D + ((double)var5.nextFloat() - 0.5D) * 0.2D; +- double var9 = (double)((float)var3 + 1.0F / 16.0F); +- double var11 = (double)var4 + 0.5D + ((double)var5.nextFloat() - 0.5D) * 0.2D; +- float var13 = (float)var6 / 15.0F; +- float var14 = var13 * 0.6F + 0.4F; +- if(var6 == 0) { +- var14 = 0.0F; ++ /** ++ * A randomly called display update to be able to add particles or other items for display ++ */ ++ public void randomDisplayTick(World par1World, int par2, int par3, int par4, Random par5Random) { ++ int var6 = par1World.getBlockMetadata(par2, par3, par4); ++ ++ if (var6 > 0) { ++ double var7 = (double)par2 + 0.5D + ((double)par5Random.nextFloat() - 0.5D) * 0.2D; ++ double var9 = (double)((float)par3 + 0.0625F); ++ double var11 = (double)par4 + 0.5D + ((double)par5Random.nextFloat() - 0.5D) * 0.2D; ++ // MCPatcher Start ++ float var16; ++ float var14; ++ float var15; ++ ++ if (ColorizeBlock.computeRedstoneWireColor(var6)) { ++ var14 = Colorizer.setColor[0]; ++ var15 = Colorizer.setColor[1]; ++ var16 = Colorizer.setColor[2]; ++ } else { ++ float var13 = (float)var6 / 15.0F; ++ var14 = var13 * 0.6F + 0.4F; ++ ++ if (var6 == 0) { ++ var14 = 0.0F; ++ } ++ ++ var15 = var13 * var13 * 0.7F - 0.5F; ++ var16 = var13 * var13 * 0.6F - 0.7F; + } ++ // MCPatcher End + +- float var15 = var13 * var13 * 0.7F - 0.5F; +- float var16 = var13 * var13 * 0.6F - 0.7F; +- if(var15 < 0.0F) { ++ if (var15 < 0.0F) { + var15 = 0.0F; + } + +- if(var16 < 0.0F) { ++ if (var16 < 0.0F) { + var16 = 0.0F; + } + +- var1.spawnParticle("reddust", var7, var9, var11, (double)var14, (double)var15, (double)var16); ++ par1World.spawnParticle("reddust", var7, var9, var11, (double)var14, (double)var15, (double)var16); + } +- + } + +- public static boolean isPowerProviderOrWire(IBlockAccess var0, int var1, int var2, int var3, int var4) { +- int var5 = var0.getBlockId(var1, var2, var3); +- if(var5 == Block.redstoneWire.blockID) { ++ /** ++ * Returns true if redstone wire can connect to the specified block. Params: World, X, Y, Z, side (not a normal notch- ++ * side, this can be 0, 1, 2, 3 or -1) ++ */ ++ public static boolean isPowerProviderOrWire(IBlockAccess par0IBlockAccess, int par1, int par2, int par3, int par4) { ++ int var5 = par0IBlockAccess.getBlockId(par1, par2, par3); ++ ++ if (var5 == Block.redstoneWire.blockID) { + return true; +- } else if(var5 == 0) { ++ } else if (var5 == 0) { + return false; +- } else if(!Block.redstoneRepeaterIdle.func_94487_f(var5)) { +- return Block.blocksList[var5].canProvidePower() && var4 != -1; ++ } else if (!Block.redstoneRepeaterIdle.func_94487_f(var5)) { ++ return Block.blocksList[var5].canProvidePower() && par4 != -1; + } else { +- int var6 = var0.getBlockMetadata(var1, var2, var3); +- return var4 == (var6 & 3) || var4 == Direction.rotateOpposite[var6 & 3]; ++ int var6 = par0IBlockAccess.getBlockMetadata(par1, par2, par3); ++ return par4 == (var6 & 3) || par4 == Direction.rotateOpposite[var6 & 3]; + } + } + +- public static boolean isPoweredOrRepeater(IBlockAccess var0, int var1, int var2, int var3, int var4) { +- if(isPowerProviderOrWire(var0, var1, var2, var3, var4)) { ++ /** ++ * Returns true if the block coordinate passed can provide power, or is a redstone wire, or if its a repeater that is ++ * powered. ++ */ ++ public static boolean isPoweredOrRepeater(IBlockAccess par0IBlockAccess, int par1, int par2, int par3, int par4) { ++ if (isPowerProviderOrWire(par0IBlockAccess, par1, par2, par3, par4)) { + return true; + } else { +- int var5 = var0.getBlockId(var1, var2, var3); +- if(var5 == Block.redstoneRepeaterActive.blockID) { +- int var6 = var0.getBlockMetadata(var1, var2, var3); +- return var4 == (var6 & 3); ++ int var5 = par0IBlockAccess.getBlockId(par1, par2, par3); ++ ++ if (var5 == Block.redstoneRepeaterActive.blockID) { ++ int var6 = par0IBlockAccess.getBlockMetadata(par1, par2, par3); ++ return par4 == (var6 & 3); + } else { + return false; + } + } + } + +- public int idPicked(World var1, int var2, int var3, int var4) { ++ /** ++ * only called by clickMiddleMouseButton , and passed to inventory.setCurrentItem (along with isCreative) ++ */ ++ public int idPicked(World par1World, int par2, int par3, int par4) { + return Item.redstone.itemID; + } + +- public void registerIcons(IconRegister var1) { +- this.field_94413_c = var1.registerIcon(this.getTextureName() + "_" + "cross"); +- this.field_94410_cO = var1.registerIcon(this.getTextureName() + "_" + "line"); +- this.field_94411_cP = var1.registerIcon(this.getTextureName() + "_" + "cross_overlay"); +- this.field_94412_cQ = var1.registerIcon(this.getTextureName() + "_" + "line_overlay"); ++ /** ++ * When this method is called, your block should register all the icons it needs with the given IconRegister. This is ++ * the only chance you get to register icons. ++ */ ++ public void registerIcons(IconRegister par1IconRegister) { ++ this.field_94413_c = par1IconRegister.registerIcon(this.getTextureName() + "_" + "cross"); ++ this.field_94410_cO = par1IconRegister.registerIcon(this.getTextureName() + "_" + "line"); ++ this.field_94411_cP = par1IconRegister.registerIcon(this.getTextureName() + "_" + "cross_overlay"); ++ this.field_94412_cQ = par1IconRegister.registerIcon(this.getTextureName() + "_" + "line_overlay"); + this.blockIcon = this.field_94413_c; + } + +- public static Icon getRedstoneWireIcon(String var0) { +- return var0.equals("cross") ? Block.redstoneWire.field_94413_c : (var0.equals("line") ? Block.redstoneWire.field_94410_cO : (var0.equals("cross_overlay") ? Block.redstoneWire.field_94411_cP : (var0.equals("line_overlay") ? Block.redstoneWire.field_94412_cQ : null))); ++ public static Icon getRedstoneWireIcon(String par0Str) { ++ return par0Str.equals("cross") ? Block.redstoneWire.field_94413_c : (par0Str.equals("line") ? Block.redstoneWire.field_94410_cO : (par0Str.equals("cross_overlay") ? Block.redstoneWire.field_94411_cP : (par0Str.equals("line_overlay") ? Block.redstoneWire.field_94412_cQ : null))); + } + } diff --git a/patches/net/minecraft/src/BlockReed.java.patch b/patches/net/minecraft/src/BlockReed.java.patch new file mode 100644 index 0000000..1181d28 --- /dev/null +++ b/patches/net/minecraft/src/BlockReed.java.patch @@ -0,0 +1,152 @@ +--- net/minecraft/src/BlockReed.java ++++ net/minecraft/src/BlockReed.java +@@ -3,74 +3,111 @@ + import java.util.Random; + + public class BlockReed extends Block { +- protected BlockReed(int var1) { +- super(var1, Material.plants); +- float var2 = 6.0F / 16.0F; ++ protected BlockReed(int par1) { ++ super(par1, Material.plants); ++ float var2 = 0.375F; + this.setBlockBounds(0.5F - var2, 0.0F, 0.5F - var2, 0.5F + var2, 1.0F, 0.5F + var2); + this.setTickRandomly(true); + } + +- public void updateTick(World var1, int var2, int var3, int var4, Random var5) { +- if(var1.isAirBlock(var2, var3 + 1, var4)) { ++ /** ++ * Ticks the block if it's been scheduled ++ */ ++ public void updateTick(World par1World, int par2, int par3, int par4, Random par5Random) { ++ if (par1World.isAirBlock(par2, par3 + 1, par4)) { + int var6; +- for(var6 = 1; var1.getBlockId(var2, var3 - var6, var4) == this.blockID; ++var6) { ++ ++ for (var6 = 1; par1World.getBlockId(par2, par3 - var6, par4) == this.blockID; ++var6) { ++ ; + } + +- if(var6 < 3) { +- int var7 = var1.getBlockMetadata(var2, var3, var4); +- if(var7 == 15) { +- var1.setBlock(var2, var3 + 1, var4, this.blockID); +- var1.setBlockMetadata(var2, var3, var4, 0, 4); ++ if (var6 < 3) { ++ int var7 = par1World.getBlockMetadata(par2, par3, par4); ++ ++ if (var7 == 15) { ++ par1World.setBlock(par2, par3 + 1, par4, this.blockID); ++ par1World.setBlockMetadataWithNotify(par2, par3, par4, 0, 4); + } else { +- var1.setBlockMetadata(var2, var3, var4, var7 + 1, 4); ++ par1World.setBlockMetadataWithNotify(par2, par3, par4, var7 + 1, 4); + } + } + } +- +- } +- +- public boolean canPlaceBlockAt(World var1, int var2, int var3, int var4) { +- int var5 = var1.getBlockId(var2, var3 - 1, var4); +- return var5 == this.blockID ? true : (var5 != Block.grass.blockID && var5 != Block.dirt.blockID && var5 != Block.sand.blockID ? false : (var1.getBlockMaterial(var2 - 1, var3 - 1, var4) == Material.water ? true : (var1.getBlockMaterial(var2 + 1, var3 - 1, var4) == Material.water ? true : (var1.getBlockMaterial(var2, var3 - 1, var4 - 1) == Material.water ? true : var1.getBlockMaterial(var2, var3 - 1, var4 + 1) == Material.water)))); +- } +- +- public void onNeighborBlockChange(World var1, int var2, int var3, int var4, int var5) { +- this.checkBlockCoordValid(var1, var2, var3, var4); +- } +- +- protected final void checkBlockCoordValid(World var1, int var2, int var3, int var4) { +- if(!this.canBlockStay(var1, var2, var3, var4)) { +- this.dropBlockAsItem(var1, var2, var3, var4, var1.getBlockMetadata(var2, var3, var4), 0); +- var1.setBlockToAir(var2, var3, var4); ++ } ++ ++ /** ++ * Checks to see if its valid to put this block at the specified coordinates. Args: world, x, y, z ++ */ ++ public boolean canPlaceBlockAt(World par1World, int par2, int par3, int par4) { ++ int var5 = par1World.getBlockId(par2, par3 - 1, par4); ++ return var5 == this.blockID ? true : (var5 != Block.grass.blockID && var5 != Block.dirt.blockID && var5 != Block.sand.blockID ? false : (par1World.getBlockMaterial(par2 - 1, par3 - 1, par4) == Material.water ? true : (par1World.getBlockMaterial(par2 + 1, par3 - 1, par4) == Material.water ? true : (par1World.getBlockMaterial(par2, par3 - 1, par4 - 1) == Material.water ? true : par1World.getBlockMaterial(par2, par3 - 1, par4 + 1) == Material.water)))); ++ } ++ ++ /** ++ * Lets the block know when one of its neighbor changes. Doesn't know which neighbor changed (coordinates passed are ++ * their own) Args: x, y, z, neighbor blockID ++ */ ++ public void onNeighborBlockChange(World par1World, int par2, int par3, int par4, int par5) { ++ this.checkBlockCoordValid(par1World, par2, par3, par4); ++ } ++ ++ /** ++ * Checks if current block pos is valid, if not, breaks the block as dropable item. Used for reed and cactus. ++ */ ++ protected final void checkBlockCoordValid(World par1World, int par2, int par3, int par4) { ++ if (!this.canBlockStay(par1World, par2, par3, par4)) { ++ this.dropBlockAsItem(par1World, par2, par3, par4, par1World.getBlockMetadata(par2, par3, par4), 0); ++ par1World.setBlockToAir(par2, par3, par4); + } +- +- } +- +- public boolean canBlockStay(World var1, int var2, int var3, int var4) { +- return this.canPlaceBlockAt(var1, var2, var3, var4); +- } +- +- public AxisAlignedBB getCollisionBoundingBoxFromPool(World var1, int var2, int var3, int var4) { ++ } ++ ++ /** ++ * Can this block stay at this position. Similar to canPlaceBlockAt except gets checked often with plants. ++ */ ++ public boolean canBlockStay(World par1World, int par2, int par3, int par4) { ++ return this.canPlaceBlockAt(par1World, par2, par3, par4); ++ } ++ ++ /** ++ * Returns a bounding box from the pool of bounding boxes (this means this box can change after the pool has been ++ * cleared to be reused) ++ */ ++ public AxisAlignedBB getCollisionBoundingBoxFromPool(World par1World, int par2, int par3, int par4) { + return null; + } + +- public int idDropped(int var1, Random var2, int var3) { ++ /** ++ * Returns the ID of the items to drop on destruction. ++ */ ++ public int idDropped(int par1, Random par2Random, int par3) { + return Item.reed.itemID; + } + ++ /** ++ * Is this block (a) opaque and (b) a full 1m cube? This determines whether or not to render the shared face of two ++ * adjacent blocks and also whether the player can attach torches, redstone wire, etc to this block. ++ */ + public boolean isOpaqueCube() { + return false; + } + ++ /** ++ * If this block doesn't render as an ordinary block it will return False (examples: signs, buttons, stairs, etc) ++ */ + public boolean renderAsNormalBlock() { + return false; + } + ++ /** ++ * The type of render function that is called for this block ++ */ + public int getRenderType() { + return 1; + } + +- public int idPicked(World var1, int var2, int var3, int var4) { ++ /** ++ * only called by clickMiddleMouseButton , and passed to inventory.setCurrentItem (along with isCreative) ++ */ ++ public int idPicked(World par1World, int par2, int par3, int par4) { + return Item.reed.itemID; + } + } diff --git a/patches/net/minecraft/src/BlockRotatedPillar.java.patch b/patches/net/minecraft/src/BlockRotatedPillar.java.patch new file mode 100644 index 0000000..baf1e6c --- /dev/null +++ b/patches/net/minecraft/src/BlockRotatedPillar.java.patch @@ -0,0 +1,114 @@ +--- net/minecraft/src/BlockRotatedPillar.java ++++ net/minecraft/src/BlockRotatedPillar.java +@@ -3,55 +3,80 @@ + public abstract class BlockRotatedPillar extends Block { + protected Icon field_111051_a; + +- protected BlockRotatedPillar(int var1, Material var2) { +- super(var1, var2); ++ protected BlockRotatedPillar(int par1, Material par2Material) { ++ super(par1, par2Material); + } + ++ /** ++ * The type of render function that is called for this block ++ */ + public int getRenderType() { + return 31; + } + +- public int onBlockPlaced(World var1, int var2, int var3, int var4, int var5, float var6, float var7, float var8, int var9) { +- int var10 = var9 & 3; ++ /** ++ * Called when a block is placed using its ItemBlock. Args: World, X, Y, Z, side, hitX, hitY, hitZ, block metadata ++ */ ++ public int onBlockPlaced(World par1World, int par2, int par3, int par4, int par5, float par6, float par7, float par8, int par9) { ++ int var10 = par9 & 3; + byte var11 = 0; +- switch(var5) { +- case 0: +- case 1: +- var11 = 0; +- break; +- case 2: +- case 3: +- var11 = 8; +- break; +- case 4: +- case 5: +- var11 = 4; ++ ++ switch (par5) { ++ case 0: ++ case 1: ++ var11 = 0; ++ break; ++ ++ case 2: ++ case 3: ++ var11 = 8; ++ break; ++ ++ case 4: ++ case 5: ++ var11 = 4; + } + + return var10 | var11; + } + +- public Icon getIcon(int var1, int var2) { +- int var3 = var2 & 12; +- int var4 = var2 & 3; +- return var3 != 0 || var1 != 1 && var1 != 0 ? (var3 != 4 || var1 != 5 && var1 != 4 ? (var3 != 8 || var1 != 2 && var1 != 3 ? this.getSideIcon(var4) : this.getEndIcon(var4)) : this.getEndIcon(var4)) : this.getEndIcon(var4); ++ /** ++ * From the specified side and block metadata retrieves the blocks texture. Args: side, metadata ++ */ ++ public Icon getIcon(int par1, int par2) { ++ int var3 = par2 & 12; ++ int var4 = par2 & 3; ++ return var3 == 0 && (par1 == 1 || par1 == 0) ? this.getEndIcon(var4) : (var3 == 4 && (par1 == 5 || par1 == 4) ? this.getEndIcon(var4) : (var3 == 8 && (par1 == 2 || par1 == 3) ? this.getEndIcon(var4) : this.getSideIcon(var4))); + } + ++ /** ++ * The icon for the side of the block. ++ */ + protected abstract Icon getSideIcon(int var1); + +- protected Icon getEndIcon(int var1) { ++ /** ++ * The icon for the tops and bottoms of the block. ++ */ ++ protected Icon getEndIcon(int par1) { + return this.field_111051_a; + } + +- public int damageDropped(int var1) { +- return var1 & 3; +- } +- +- public int func_111050_e(int var1) { +- return var1 & 3; +- } +- +- protected ItemStack createStackedBlock(int var1) { +- return new ItemStack(this.blockID, 1, this.func_111050_e(var1)); ++ /** ++ * Determines the damage on the item the block drops. Used in cloth and wood. ++ */ ++ public int damageDropped(int par1) { ++ return par1 & 3; ++ } ++ ++ public int func_111050_e(int par1) { ++ return par1 & 3; ++ } ++ ++ /** ++ * Returns an item stack containing a single instance of the current block type. 'i' is the block's subtype/damage and ++ * is ignored for blocks which do not support subtypes. Blocks which cannot be harvested should return null. ++ */ ++ protected ItemStack createStackedBlock(int par1) { ++ return new ItemStack(this.blockID, 1, this.func_111050_e(par1)); + } + } diff --git a/patches/net/minecraft/src/BlockSand.java.patch b/patches/net/minecraft/src/BlockSand.java.patch new file mode 100644 index 0000000..6b69c24 --- /dev/null +++ b/patches/net/minecraft/src/BlockSand.java.patch @@ -0,0 +1,145 @@ +--- net/minecraft/src/BlockSand.java ++++ net/minecraft/src/BlockSand.java +@@ -3,68 +3,91 @@ + import java.util.Random; + + public class BlockSand extends Block { ++ ++ /** Do blocks fall instantly to where they stop or do they fall over time */ + public static boolean fallInstantly; + +- public BlockSand(int var1) { +- super(var1, Material.sand); ++ public BlockSand(int par1) { ++ super(par1, Material.sand); + this.setCreativeTab(CreativeTabs.tabBlock); + } + +- public BlockSand(int var1, Material var2) { +- super(var1, var2); +- } +- +- public void onBlockAdded(World var1, int var2, int var3, int var4) { +- var1.scheduleBlockUpdate(var2, var3, var4, this.blockID, this.tickRate(var1)); +- } +- +- public void onNeighborBlockChange(World var1, int var2, int var3, int var4, int var5) { +- var1.scheduleBlockUpdate(var2, var3, var4, this.blockID, this.tickRate(var1)); +- } +- +- public void updateTick(World var1, int var2, int var3, int var4, Random var5) { +- if(!var1.isRemote) { +- this.tryToFall(var1, var2, var3, var4); ++ public BlockSand(int par1, Material par2Material) { ++ super(par1, par2Material); ++ } ++ ++ /** ++ * Called whenever the block is added into the world. Args: world, x, y, z ++ */ ++ public void onBlockAdded(World par1World, int par2, int par3, int par4) { ++ par1World.scheduleBlockUpdate(par2, par3, par4, this.blockID, this.tickRate(par1World)); ++ } ++ ++ /** ++ * Lets the block know when one of its neighbor changes. Doesn't know which neighbor changed (coordinates passed are ++ * their own) Args: x, y, z, neighbor blockID ++ */ ++ public void onNeighborBlockChange(World par1World, int par2, int par3, int par4, int par5) { ++ par1World.scheduleBlockUpdate(par2, par3, par4, this.blockID, this.tickRate(par1World)); ++ } ++ ++ /** ++ * Ticks the block if it's been scheduled ++ */ ++ public void updateTick(World par1World, int par2, int par3, int par4, Random par5Random) { ++ if (!par1World.isRemote) { ++ this.tryToFall(par1World, par2, par3, par4); + } +- + } + +- private void tryToFall(World var1, int var2, int var3, int var4) { +- if(canFallBelow(var1, var2, var3 - 1, var4) && var3 >= 0) { ++ /** ++ * If there is space to fall below will start this block falling ++ */ ++ private void tryToFall(World par1World, int par2, int par3, int par4) { ++ if (canFallBelow(par1World, par2, par3 - 1, par4) && par3 >= 0) { + byte var8 = 32; +- if(!fallInstantly && var1.checkChunksExist(var2 - var8, var3 - var8, var4 - var8, var2 + var8, var3 + var8, var4 + var8)) { +- if(!var1.isRemote) { +- EntityFallingSand var9 = new EntityFallingSand(var1, (double)((float)var2 + 0.5F), (double)((float)var3 + 0.5F), (double)((float)var4 + 0.5F), this.blockID, var1.getBlockMetadata(var2, var3, var4)); ++ ++ if (!fallInstantly && par1World.checkChunksExist(par2 - var8, par3 - var8, par4 - var8, par2 + var8, par3 + var8, par4 + var8)) { ++ if (!par1World.isRemote) { ++ EntityFallingSand var9 = new EntityFallingSand(par1World, (double)((float)par2 + 0.5F), (double)((float)par3 + 0.5F), (double)((float)par4 + 0.5F), this.blockID, par1World.getBlockMetadata(par2, par3, par4)); + this.onStartFalling(var9); +- var1.spawnEntityInWorld(var9); ++ par1World.spawnEntityInWorld(var9); + } + } else { +- var1.setBlockToAir(var2, var3, var4); ++ par1World.setBlockToAir(par2, par3, par4); + +- while(canFallBelow(var1, var2, var3 - 1, var4) && var3 > 0) { +- --var3; ++ while (canFallBelow(par1World, par2, par3 - 1, par4) && par3 > 0) { ++ --par3; + } + +- if(var3 > 0) { +- var1.setBlock(var2, var3, var4, this.blockID); ++ if (par3 > 0) { ++ par1World.setBlock(par2, par3, par4, this.blockID); + } + } + } +- +- } +- +- protected void onStartFalling(EntityFallingSand var1) { +- } +- +- public int tickRate(World var1) { ++ } ++ ++ /** ++ * Called when the falling block entity for this block is created ++ */ ++ protected void onStartFalling(EntityFallingSand par1EntityFallingSand) {} ++ ++ /** ++ * How many world ticks before ticking ++ */ ++ public int tickRate(World par1World) { + return 2; + } + +- public static boolean canFallBelow(World var0, int var1, int var2, int var3) { +- int var4 = var0.getBlockId(var1, var2, var3); +- if(var4 == 0) { ++ /** ++ * Checks to see if the sand can fall into the block below it ++ */ ++ public static boolean canFallBelow(World par0World, int par1, int par2, int par3) { ++ int var4 = par0World.getBlockId(par1, par2, par3); ++ ++ if (var4 == 0) { + return true; +- } else if(var4 == Block.fire.blockID) { ++ } else if (var4 == Block.fire.blockID) { + return true; + } else { + Material var5 = Block.blocksList[var4].blockMaterial; +@@ -72,6 +95,8 @@ + } + } + +- public void onFinishFalling(World var1, int var2, int var3, int var4, int var5) { +- } ++ /** ++ * Called when the falling block entity for this block hits the ground and turns back into a block ++ */ ++ public void onFinishFalling(World par1World, int par2, int par3, int par4, int par5) {} + } diff --git a/patches/net/minecraft/src/BlockSandStone.java.patch b/patches/net/minecraft/src/BlockSandStone.java.patch new file mode 100644 index 0000000..9a569e0 --- /dev/null +++ b/patches/net/minecraft/src/BlockSandStone.java.patch @@ -0,0 +1,94 @@ +--- net/minecraft/src/BlockSandStone.java ++++ net/minecraft/src/BlockSandStone.java +@@ -3,51 +3,64 @@ + import java.util.List; + + public class BlockSandStone extends Block { +- public static final String[] a = new String[]{"default", "chiseled", "smooth"}; +- private static final String[] b = new String[]{"normal", "carved", "smooth"}; ++ public static final String[] SAND_STONE_TYPES = new String[] {"default", "chiseled", "smooth"}; ++ private static final String[] field_94405_b = new String[] {"normal", "carved", "smooth"}; + private Icon[] field_94406_c; + private Icon field_94403_cO; + private Icon field_94404_cP; + +- public BlockSandStone(int var1) { +- super(var1, Material.rock); ++ public BlockSandStone(int par1) { ++ super(par1, Material.rock); + this.setCreativeTab(CreativeTabs.tabBlock); + } + +- public Icon getIcon(int var1, int var2) { +- if(var1 != 1 && (var1 != 0 || var2 != 1 && var2 != 2)) { +- if(var1 == 0) { ++ /** ++ * From the specified side and block metadata retrieves the blocks texture. Args: side, metadata ++ */ ++ public Icon getIcon(int par1, int par2) { ++ if (par1 != 1 && (par1 != 0 || par2 != 1 && par2 != 2)) { ++ if (par1 == 0) { + return this.field_94404_cP; + } else { +- if(var2 < 0 || var2 >= this.field_94406_c.length) { +- var2 = 0; ++ if (par2 < 0 || par2 >= this.field_94406_c.length) { ++ par2 = 0; + } + +- return this.field_94406_c[var2]; ++ return this.field_94406_c[par2]; + } + } else { + return this.field_94403_cO; + } + } + +- public int damageDropped(int var1) { +- return var1; +- } +- +- public void getSubBlocks(int var1, CreativeTabs var2, List var3) { +- var3.add(new ItemStack(var1, 1, 0)); +- var3.add(new ItemStack(var1, 1, 1)); +- var3.add(new ItemStack(var1, 1, 2)); +- } +- +- public void registerIcons(IconRegister var1) { +- this.field_94406_c = new Icon[b.length]; +- +- for(int var2 = 0; var2 < this.field_94406_c.length; ++var2) { +- this.field_94406_c[var2] = var1.registerIcon(this.getTextureName() + "_" + b[var2]); ++ /** ++ * Determines the damage on the item the block drops. Used in cloth and wood. ++ */ ++ public int damageDropped(int par1) { ++ return par1; ++ } ++ ++ /** ++ * returns a list of blocks with the same ID, but different meta (eg: wood returns 4 blocks) ++ */ ++ public void getSubBlocks(int par1, CreativeTabs par2CreativeTabs, List par3List) { ++ par3List.add(new ItemStack(par1, 1, 0)); ++ par3List.add(new ItemStack(par1, 1, 1)); ++ par3List.add(new ItemStack(par1, 1, 2)); ++ } ++ ++ /** ++ * When this method is called, your block should register all the icons it needs with the given IconRegister. This is ++ * the only chance you get to register icons. ++ */ ++ public void registerIcons(IconRegister par1IconRegister) { ++ this.field_94406_c = new Icon[field_94405_b.length]; ++ ++ for (int var2 = 0; var2 < this.field_94406_c.length; ++var2) { ++ this.field_94406_c[var2] = par1IconRegister.registerIcon(this.getTextureName() + "_" + field_94405_b[var2]); + } + +- this.field_94403_cO = var1.registerIcon(this.getTextureName() + "_top"); +- this.field_94404_cP = var1.registerIcon(this.getTextureName() + "_bottom"); ++ this.field_94403_cO = par1IconRegister.registerIcon(this.getTextureName() + "_top"); ++ this.field_94404_cP = par1IconRegister.registerIcon(this.getTextureName() + "_bottom"); + } + } diff --git a/patches/net/minecraft/src/BlockSapling.java.patch b/patches/net/minecraft/src/BlockSapling.java.patch new file mode 100644 index 0000000..f0fb3ac --- /dev/null +++ b/patches/net/minecraft/src/BlockSapling.java.patch @@ -0,0 +1,215 @@ +--- net/minecraft/src/BlockSapling.java ++++ net/minecraft/src/BlockSapling.java +@@ -4,121 +4,143 @@ + import java.util.Random; + + public class BlockSapling extends BlockFlower { +- public static final String[] a = new String[]{"oak", "spruce", "birch", "jungle"}; ++ public static final String[] WOOD_TYPES = new String[] {"oak", "spruce", "birch", "jungle"}; + private Icon[] saplingIcon; + +- protected BlockSapling(int var1) { +- super(var1); ++ protected BlockSapling(int par1) { ++ super(par1); + float var2 = 0.4F; + this.setBlockBounds(0.5F - var2, 0.0F, 0.5F - var2, 0.5F + var2, var2 * 2.0F, 0.5F + var2); + this.setCreativeTab(CreativeTabs.tabDecorations); + } + +- public void updateTick(World var1, int var2, int var3, int var4, Random var5) { +- if(!var1.isRemote) { +- super.updateTick(var1, var2, var3, var4, var5); +- if(var1.getBlockLightValue(var2, var3 + 1, var4) >= 9 && var5.nextInt(7) == 0) { +- this.markOrGrowMarked(var1, var2, var3, var4, var5); ++ /** ++ * Ticks the block if it's been scheduled ++ */ ++ public void updateTick(World par1World, int par2, int par3, int par4, Random par5Random) { ++ if (!par1World.isRemote) { ++ super.updateTick(par1World, par2, par3, par4, par5Random); ++ ++ if (par1World.getBlockLightValue(par2, par3 + 1, par4) >= 9 && par5Random.nextInt(7) == 0) { ++ this.markOrGrowMarked(par1World, par2, par3, par4, par5Random); + } +- + } + } + +- public Icon getIcon(int var1, int var2) { +- var2 &= 3; +- return this.saplingIcon[var2]; ++ /** ++ * From the specified side and block metadata retrieves the blocks texture. Args: side, metadata ++ */ ++ public Icon getIcon(int par1, int par2) { ++ par2 &= 3; ++ return this.saplingIcon[par2]; + } + +- public void markOrGrowMarked(World var1, int var2, int var3, int var4, Random var5) { +- int var6 = var1.getBlockMetadata(var2, var3, var4); +- if((var6 & 8) == 0) { +- var1.setBlockMetadata(var2, var3, var4, var6 | 8, 4); ++ public void markOrGrowMarked(World par1World, int par2, int par3, int par4, Random par5Random) { ++ int var6 = par1World.getBlockMetadata(par2, par3, par4); ++ ++ if ((var6 & 8) == 0) { ++ par1World.setBlockMetadataWithNotify(par2, par3, par4, var6 | 8, 4); + } else { +- this.growTree(var1, var2, var3, var4, var5); ++ this.growTree(par1World, par2, par3, par4, par5Random); + } +- + } + +- public void growTree(World var1, int var2, int var3, int var4, Random var5) { +- int var6 = var1.getBlockMetadata(var2, var3, var4) & 3; ++ /** ++ * Attempts to grow a sapling into a tree ++ */ ++ public void growTree(World par1World, int par2, int par3, int par4, Random par5Random) { ++ int var6 = par1World.getBlockMetadata(par2, par3, par4) & 3; + Object var7 = null; + int var8 = 0; + int var9 = 0; + boolean var10 = false; +- if(var6 == 1) { ++ ++ if (var6 == 1) { + var7 = new WorldGenTaiga2(true); +- } else if(var6 == 2) { ++ } else if (var6 == 2) { + var7 = new WorldGenForest(true); +- } else if(var6 == 3) { +- for(var8 = 0; var8 >= -1; --var8) { +- for(var9 = 0; var9 >= -1; --var9) { +- if(this.isSameSapling(var1, var2 + var8, var3, var4 + var9, 3) && this.isSameSapling(var1, var2 + var8 + 1, var3, var4 + var9, 3) && this.isSameSapling(var1, var2 + var8, var3, var4 + var9 + 1, 3) && this.isSameSapling(var1, var2 + var8 + 1, var3, var4 + var9 + 1, 3)) { +- var7 = new WorldGenHugeTrees(true, 10 + var5.nextInt(20), 3, 3); ++ } else if (var6 == 3) { ++ for (var8 = 0; var8 >= -1; --var8) { ++ for (var9 = 0; var9 >= -1; --var9) { ++ if (this.isSameSapling(par1World, par2 + var8, par3, par4 + var9, 3) && this.isSameSapling(par1World, par2 + var8 + 1, par3, par4 + var9, 3) && this.isSameSapling(par1World, par2 + var8, par3, par4 + var9 + 1, 3) && this.isSameSapling(par1World, par2 + var8 + 1, par3, par4 + var9 + 1, 3)) { ++ var7 = new WorldGenHugeTrees(true, 10 + par5Random.nextInt(20), 3, 3); + var10 = true; + break; + } + } + +- if(var7 != null) { ++ if (var7 != null) { + break; + } + } + +- if(var7 == null) { ++ if (var7 == null) { + var9 = 0; +- var8 = var9; +- var7 = new WorldGenTrees(true, 4 + var5.nextInt(7), 3, 3, false); ++ var8 = 0; ++ var7 = new WorldGenTrees(true, 4 + par5Random.nextInt(7), 3, 3, false); + } + } else { + var7 = new WorldGenTrees(true); +- if(var5.nextInt(10) == 0) { ++ ++ if (par5Random.nextInt(10) == 0) { + var7 = new WorldGenBigTree(true); + } + } + +- if(var10) { +- var1.setBlock(var2 + var8, var3, var4 + var9, 0, 0, 4); +- var1.setBlock(var2 + var8 + 1, var3, var4 + var9, 0, 0, 4); +- var1.setBlock(var2 + var8, var3, var4 + var9 + 1, 0, 0, 4); +- var1.setBlock(var2 + var8 + 1, var3, var4 + var9 + 1, 0, 0, 4); ++ if (var10) { ++ par1World.setBlock(par2 + var8, par3, par4 + var9, 0, 0, 4); ++ par1World.setBlock(par2 + var8 + 1, par3, par4 + var9, 0, 0, 4); ++ par1World.setBlock(par2 + var8, par3, par4 + var9 + 1, 0, 0, 4); ++ par1World.setBlock(par2 + var8 + 1, par3, par4 + var9 + 1, 0, 0, 4); + } else { +- var1.setBlock(var2, var3, var4, 0, 0, 4); ++ par1World.setBlock(par2, par3, par4, 0, 0, 4); + } + +- if(!((WorldGenerator)var7).generate(var1, var5, var2 + var8, var3, var4 + var9)) { +- if(var10) { +- var1.setBlock(var2 + var8, var3, var4 + var9, this.blockID, var6, 4); +- var1.setBlock(var2 + var8 + 1, var3, var4 + var9, this.blockID, var6, 4); +- var1.setBlock(var2 + var8, var3, var4 + var9 + 1, this.blockID, var6, 4); +- var1.setBlock(var2 + var8 + 1, var3, var4 + var9 + 1, this.blockID, var6, 4); ++ if (!((WorldGenerator)var7).generate(par1World, par5Random, par2 + var8, par3, par4 + var9)) { ++ if (var10) { ++ par1World.setBlock(par2 + var8, par3, par4 + var9, this.blockID, var6, 4); ++ par1World.setBlock(par2 + var8 + 1, par3, par4 + var9, this.blockID, var6, 4); ++ par1World.setBlock(par2 + var8, par3, par4 + var9 + 1, this.blockID, var6, 4); ++ par1World.setBlock(par2 + var8 + 1, par3, par4 + var9 + 1, this.blockID, var6, 4); + } else { +- var1.setBlock(var2, var3, var4, this.blockID, var6, 4); ++ par1World.setBlock(par2, par3, par4, this.blockID, var6, 4); + } + } +- +- } +- +- public boolean isSameSapling(World var1, int var2, int var3, int var4, int var5) { +- return var1.getBlockId(var2, var3, var4) == this.blockID && (var1.getBlockMetadata(var2, var3, var4) & 3) == var5; +- } +- +- public int damageDropped(int var1) { +- return var1 & 3; +- } +- +- public void getSubBlocks(int var1, CreativeTabs var2, List var3) { +- var3.add(new ItemStack(var1, 1, 0)); +- var3.add(new ItemStack(var1, 1, 1)); +- var3.add(new ItemStack(var1, 1, 2)); +- var3.add(new ItemStack(var1, 1, 3)); +- } +- +- public void registerIcons(IconRegister var1) { +- this.saplingIcon = new Icon[a.length]; +- +- for(int var2 = 0; var2 < this.saplingIcon.length; ++var2) { +- this.saplingIcon[var2] = var1.registerIcon(this.getTextureName() + "_" + a[var2]); ++ } ++ ++ /** ++ * Determines if the same sapling is present at the given location. ++ */ ++ public boolean isSameSapling(World par1World, int par2, int par3, int par4, int par5) { ++ return par1World.getBlockId(par2, par3, par4) == this.blockID && (par1World.getBlockMetadata(par2, par3, par4) & 3) == par5; ++ } ++ ++ /** ++ * Determines the damage on the item the block drops. Used in cloth and wood. ++ */ ++ public int damageDropped(int par1) { ++ return par1 & 3; ++ } ++ ++ /** ++ * returns a list of blocks with the same ID, but different meta (eg: wood returns 4 blocks) ++ */ ++ public void getSubBlocks(int par1, CreativeTabs par2CreativeTabs, List par3List) { ++ par3List.add(new ItemStack(par1, 1, 0)); ++ par3List.add(new ItemStack(par1, 1, 1)); ++ par3List.add(new ItemStack(par1, 1, 2)); ++ par3List.add(new ItemStack(par1, 1, 3)); ++ } ++ ++ /** ++ * When this method is called, your block should register all the icons it needs with the given IconRegister. This is ++ * the only chance you get to register icons. ++ */ ++ public void registerIcons(IconRegister par1IconRegister) { ++ this.saplingIcon = new Icon[WOOD_TYPES.length]; ++ ++ for (int var2 = 0; var2 < this.saplingIcon.length; ++var2) { ++ this.saplingIcon[var2] = par1IconRegister.registerIcon(this.getTextureName() + "_" + WOOD_TYPES[var2]); + } +- + } + } diff --git a/patches/net/minecraft/src/BlockSign.java.patch b/patches/net/minecraft/src/BlockSign.java.patch new file mode 100644 index 0000000..5c47ded --- /dev/null +++ b/patches/net/minecraft/src/BlockSign.java.patch @@ -0,0 +1,227 @@ +--- net/minecraft/src/BlockSign.java ++++ net/minecraft/src/BlockSign.java +@@ -3,125 +3,168 @@ + import java.util.Random; + + public class BlockSign extends BlockContainer { +- private Class a; ++ private Class signEntityClass; ++ ++ /** Whether this is a freestanding sign or a wall-mounted sign */ + private boolean isFreestanding; + +- protected BlockSign(int var1, Class var2, boolean var3) { +- super(var1, Material.wood); +- this.isFreestanding = var3; +- this.a = var2; ++ protected BlockSign(int par1, Class par2Class, boolean par3) { ++ super(par1, Material.wood); ++ this.isFreestanding = par3; ++ this.signEntityClass = par2Class; + float var4 = 0.25F; + float var5 = 1.0F; + this.setBlockBounds(0.5F - var4, 0.0F, 0.5F - var4, 0.5F + var4, var5, 0.5F + var4); + } + +- public Icon getIcon(int var1, int var2) { +- return Block.planks.getBlockTextureFromSide(var1); ++ /** ++ * From the specified side and block metadata retrieves the blocks texture. Args: side, metadata ++ */ ++ public Icon getIcon(int par1, int par2) { ++ return Block.planks.getBlockTextureFromSide(par1); + } + +- public AxisAlignedBB getCollisionBoundingBoxFromPool(World var1, int var2, int var3, int var4) { ++ /** ++ * Returns a bounding box from the pool of bounding boxes (this means this box can change after the pool has been ++ * cleared to be reused) ++ */ ++ public AxisAlignedBB getCollisionBoundingBoxFromPool(World par1World, int par2, int par3, int par4) { + return null; + } + +- public AxisAlignedBB getSelectedBoundingBoxFromPool(World var1, int var2, int var3, int var4) { +- this.setBlockBoundsBasedOnState(var1, var2, var3, var4); +- return super.getSelectedBoundingBoxFromPool(var1, var2, var3, var4); ++ /** ++ * Returns the bounding box of the wired rectangular prism to render. ++ */ ++ public AxisAlignedBB getSelectedBoundingBoxFromPool(World par1World, int par2, int par3, int par4) { ++ this.setBlockBoundsBasedOnState(par1World, par2, par3, par4); ++ return super.getSelectedBoundingBoxFromPool(par1World, par2, par3, par4); + } + +- public void setBlockBoundsBasedOnState(IBlockAccess var1, int var2, int var3, int var4) { +- if(!this.isFreestanding) { +- int var5 = var1.getBlockMetadata(var2, var3, var4); +- float var6 = 9.0F / 32.0F; +- float var7 = 25.0F / 32.0F; ++ /** ++ * Updates the blocks bounds based on its current state. Args: world, x, y, z ++ */ ++ public void setBlockBoundsBasedOnState(IBlockAccess par1IBlockAccess, int par2, int par3, int par4) { ++ if (!this.isFreestanding) { ++ int var5 = par1IBlockAccess.getBlockMetadata(par2, par3, par4); ++ float var6 = 0.28125F; ++ float var7 = 0.78125F; + float var8 = 0.0F; + float var9 = 1.0F; +- float var10 = 2.0F / 16.0F; ++ float var10 = 0.125F; + this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F); +- if(var5 == 2) { ++ ++ if (var5 == 2) { + this.setBlockBounds(var8, var6, 1.0F - var10, var9, var7, 1.0F); + } + +- if(var5 == 3) { ++ if (var5 == 3) { + this.setBlockBounds(var8, var6, 0.0F, var9, var7, var10); + } + +- if(var5 == 4) { ++ if (var5 == 4) { + this.setBlockBounds(1.0F - var10, var6, var8, 1.0F, var7, var9); + } + +- if(var5 == 5) { ++ if (var5 == 5) { + this.setBlockBounds(0.0F, var6, var8, var10, var7, var9); + } +- + } + } + ++ /** ++ * The type of render function that is called for this block ++ */ + public int getRenderType() { + return -1; + } + ++ /** ++ * If this block doesn't render as an ordinary block it will return False (examples: signs, buttons, stairs, etc) ++ */ + public boolean renderAsNormalBlock() { + return false; + } + +- public boolean getBlocksMovement(IBlockAccess var1, int var2, int var3, int var4) { ++ public boolean getBlocksMovement(IBlockAccess par1IBlockAccess, int par2, int par3, int par4) { + return true; + } + ++ /** ++ * Is this block (a) opaque and (b) a full 1m cube? This determines whether or not to render the shared face of two ++ * adjacent blocks and also whether the player can attach torches, redstone wire, etc to this block. ++ */ + public boolean isOpaqueCube() { + return false; + } + +- public TileEntity createNewTileEntity(World var1) { ++ /** ++ * Returns a new instance of a block's tile entity class. Called on placing the block. ++ */ ++ public TileEntity createNewTileEntity(World par1World) { + try { +- return (TileEntity)this.a.newInstance(); ++ return (TileEntity)this.signEntityClass.newInstance(); + } catch (Exception var3) { + throw new RuntimeException(var3); + } + } + +- public int idDropped(int var1, Random var2, int var3) { ++ /** ++ * Returns the ID of the items to drop on destruction. ++ */ ++ public int idDropped(int par1, Random par2Random, int par3) { + return Item.sign.itemID; + } + +- public void onNeighborBlockChange(World var1, int var2, int var3, int var4, int var5) { ++ /** ++ * Lets the block know when one of its neighbor changes. Doesn't know which neighbor changed (coordinates passed are ++ * their own) Args: x, y, z, neighbor blockID ++ */ ++ public void onNeighborBlockChange(World par1World, int par2, int par3, int par4, int par5) { + boolean var6 = false; +- if(this.isFreestanding) { +- if(!var1.getBlockMaterial(var2, var3 - 1, var4).isSolid()) { ++ ++ if (this.isFreestanding) { ++ if (!par1World.getBlockMaterial(par2, par3 - 1, par4).isSolid()) { + var6 = true; + } + } else { +- int var7 = var1.getBlockMetadata(var2, var3, var4); ++ int var7 = par1World.getBlockMetadata(par2, par3, par4); + var6 = true; +- if(var7 == 2 && var1.getBlockMaterial(var2, var3, var4 + 1).isSolid()) { +- var6 = false; +- } +- +- if(var7 == 3 && var1.getBlockMaterial(var2, var3, var4 - 1).isSolid()) { +- var6 = false; +- } +- +- if(var7 == 4 && var1.getBlockMaterial(var2 + 1, var3, var4).isSolid()) { +- var6 = false; +- } +- +- if(var7 == 5 && var1.getBlockMaterial(var2 - 1, var3, var4).isSolid()) { +- var6 = false; +- } +- } +- +- if(var6) { +- this.dropBlockAsItem(var1, var2, var3, var4, var1.getBlockMetadata(var2, var3, var4), 0); +- var1.setBlockToAir(var2, var3, var4); +- } +- +- super.onNeighborBlockChange(var1, var2, var3, var4, var5); ++ ++ if (var7 == 2 && par1World.getBlockMaterial(par2, par3, par4 + 1).isSolid()) { ++ var6 = false; ++ } ++ ++ if (var7 == 3 && par1World.getBlockMaterial(par2, par3, par4 - 1).isSolid()) { ++ var6 = false; ++ } ++ ++ if (var7 == 4 && par1World.getBlockMaterial(par2 + 1, par3, par4).isSolid()) { ++ var6 = false; ++ } ++ ++ if (var7 == 5 && par1World.getBlockMaterial(par2 - 1, par3, par4).isSolid()) { ++ var6 = false; ++ } ++ } ++ ++ if (var6) { ++ this.dropBlockAsItem(par1World, par2, par3, par4, par1World.getBlockMetadata(par2, par3, par4), 0); ++ par1World.setBlockToAir(par2, par3, par4); ++ } ++ ++ super.onNeighborBlockChange(par1World, par2, par3, par4, par5); + } + +- public int idPicked(World var1, int var2, int var3, int var4) { ++ /** ++ * only called by clickMiddleMouseButton , and passed to inventory.setCurrentItem (along with isCreative) ++ */ ++ public int idPicked(World par1World, int par2, int par3, int par4) { + return Item.sign.itemID; + } + +- public void registerIcons(IconRegister var1) { +- } ++ /** ++ * When this method is called, your block should register all the icons it needs with the given IconRegister. This is ++ * the only chance you get to register icons. ++ */ ++ public void registerIcons(IconRegister par1IconRegister) {} + } diff --git a/patches/net/minecraft/src/BlockSilverfish.java.patch b/patches/net/minecraft/src/BlockSilverfish.java.patch new file mode 100644 index 0000000..8d9d007 --- /dev/null +++ b/patches/net/minecraft/src/BlockSilverfish.java.patch @@ -0,0 +1,134 @@ +--- net/minecraft/src/BlockSilverfish.java ++++ net/minecraft/src/BlockSilverfish.java +@@ -4,65 +4,96 @@ + import java.util.Random; + + public class BlockSilverfish extends Block { +- public static final String[] a = new String[]{"stone", "cobble", "brick"}; +- +- public BlockSilverfish(int var1) { +- super(var1, Material.clay); ++ ++ /** Block names that can be a silverfish stone. */ ++ public static final String[] silverfishStoneTypes = new String[] {"stone", "cobble", "brick"}; ++ ++ public BlockSilverfish(int par1) { ++ super(par1, Material.clay); + this.setHardness(0.0F); + this.setCreativeTab(CreativeTabs.tabDecorations); + } + +- public Icon getIcon(int var1, int var2) { +- return var2 == 1 ? Block.cobblestone.getBlockTextureFromSide(var1) : (var2 == 2 ? Block.stoneBrick.getBlockTextureFromSide(var1) : Block.stone.getBlockTextureFromSide(var1)); +- } +- +- public void registerIcons(IconRegister var1) { +- } +- +- public void onBlockDestroyedByPlayer(World var1, int var2, int var3, int var4, int var5) { +- if(!var1.isRemote) { +- EntitySilverfish var6 = new EntitySilverfish(var1); +- var6.setLocationAndAngles((double)var2 + 0.5D, (double)var3, (double)var4 + 0.5D, 0.0F, 0.0F); +- var1.spawnEntityInWorld(var6); ++ /** ++ * From the specified side and block metadata retrieves the blocks texture. Args: side, metadata ++ */ ++ public Icon getIcon(int par1, int par2) { ++ return par2 == 1 ? Block.cobblestone.getBlockTextureFromSide(par1) : (par2 == 2 ? Block.stoneBrick.getBlockTextureFromSide(par1) : Block.stone.getBlockTextureFromSide(par1)); ++ } ++ ++ /** ++ * When this method is called, your block should register all the icons it needs with the given IconRegister. This is ++ * the only chance you get to register icons. ++ */ ++ public void registerIcons(IconRegister par1IconRegister) {} ++ ++ /** ++ * Called right before the block is destroyed by a player. Args: world, x, y, z, metaData ++ */ ++ public void onBlockDestroyedByPlayer(World par1World, int par2, int par3, int par4, int par5) { ++ if (!par1World.isRemote) { ++ EntitySilverfish var6 = new EntitySilverfish(par1World); ++ var6.setLocationAndAngles((double)par2 + 0.5D, (double)par3, (double)par4 + 0.5D, 0.0F, 0.0F); ++ par1World.spawnEntityInWorld(var6); + var6.spawnExplosionParticle(); + } + +- super.onBlockDestroyedByPlayer(var1, var2, var3, var4, var5); ++ super.onBlockDestroyedByPlayer(par1World, par2, par3, par4, par5); + } + +- public int quantityDropped(Random var1) { ++ /** ++ * Returns the quantity of items to drop on block destruction. ++ */ ++ public int quantityDropped(Random par1Random) { + return 0; + } + +- public static boolean getPosingIdByMetadata(int var0) { +- return var0 == Block.stone.blockID || var0 == Block.cobblestone.blockID || var0 == Block.stoneBrick.blockID; +- } +- +- public static int getMetadataForBlockType(int var0) { +- return var0 == Block.cobblestone.blockID ? 1 : (var0 == Block.stoneBrick.blockID ? 2 : 0); +- } +- +- protected ItemStack createStackedBlock(int var1) { ++ /** ++ * Gets the blockID of the block this block is pretending to be according to this block's metadata. ++ */ ++ public static boolean getPosingIdByMetadata(int par0) { ++ return par0 == Block.stone.blockID || par0 == Block.cobblestone.blockID || par0 == Block.stoneBrick.blockID; ++ } ++ ++ /** ++ * Returns the metadata to use when a Silverfish hides in the block. Sets the block to BlockSilverfish with this ++ * metadata. It changes the displayed texture client side to look like a normal block. ++ */ ++ public static int getMetadataForBlockType(int par0) { ++ return par0 == Block.cobblestone.blockID ? 1 : (par0 == Block.stoneBrick.blockID ? 2 : 0); ++ } ++ ++ /** ++ * Returns an item stack containing a single instance of the current block type. 'i' is the block's subtype/damage and ++ * is ignored for blocks which do not support subtypes. Blocks which cannot be harvested should return null. ++ */ ++ protected ItemStack createStackedBlock(int par1) { + Block var2 = Block.stone; +- if(var1 == 1) { ++ ++ if (par1 == 1) { + var2 = Block.cobblestone; + } + +- if(var1 == 2) { ++ if (par1 == 2) { + var2 = Block.stoneBrick; + } + + return new ItemStack(var2); + } + +- public int getDamageValue(World var1, int var2, int var3, int var4) { +- return var1.getBlockMetadata(var2, var3, var4); ++ /** ++ * Get the block's damage value (for use with pick block). ++ */ ++ public int getDamageValue(World par1World, int par2, int par3, int par4) { ++ return par1World.getBlockMetadata(par2, par3, par4); + } + +- public void getSubBlocks(int var1, CreativeTabs var2, List var3) { +- for(int var4 = 0; var4 < 3; ++var4) { +- var3.add(new ItemStack(var1, 1, var4)); ++ /** ++ * returns a list of blocks with the same ID, but different meta (eg: wood returns 4 blocks) ++ */ ++ public void getSubBlocks(int par1, CreativeTabs par2CreativeTabs, List par3List) { ++ for (int var4 = 0; var4 < 3; ++var4) { ++ par3List.add(new ItemStack(par1, 1, var4)); + } +- + } + } diff --git a/patches/net/minecraft/src/BlockSkull.java.patch b/patches/net/minecraft/src/BlockSkull.java.patch new file mode 100644 index 0000000..2adaf30 --- /dev/null +++ b/patches/net/minecraft/src/BlockSkull.java.patch @@ -0,0 +1,402 @@ +--- net/minecraft/src/BlockSkull.java ++++ net/minecraft/src/BlockSkull.java +@@ -3,201 +3,263 @@ + import java.util.Random; + + public class BlockSkull extends BlockContainer { +- protected BlockSkull(int var1) { +- super(var1, Material.circuits); +- this.setBlockBounds(0.25F, 0.0F, 0.25F, 12.0F / 16.0F, 0.5F, 12.0F / 16.0F); ++ protected BlockSkull(int par1) { ++ super(par1, Material.circuits); ++ this.setBlockBounds(0.25F, 0.0F, 0.25F, 0.75F, 0.5F, 0.75F); + } + ++ /** ++ * The type of render function that is called for this block ++ */ + public int getRenderType() { + return -1; + } + ++ /** ++ * Is this block (a) opaque and (b) a full 1m cube? This determines whether or not to render the shared face of two ++ * adjacent blocks and also whether the player can attach torches, redstone wire, etc to this block. ++ */ + public boolean isOpaqueCube() { + return false; + } + ++ /** ++ * If this block doesn't render as an ordinary block it will return False (examples: signs, buttons, stairs, etc) ++ */ + public boolean renderAsNormalBlock() { + return false; + } + +- public void setBlockBoundsBasedOnState(IBlockAccess var1, int var2, int var3, int var4) { +- int var5 = var1.getBlockMetadata(var2, var3, var4) & 7; +- switch(var5) { +- case 1: +- default: +- this.setBlockBounds(0.25F, 0.0F, 0.25F, 12.0F / 16.0F, 0.5F, 12.0F / 16.0F); +- break; +- case 2: +- this.setBlockBounds(0.25F, 0.25F, 0.5F, 12.0F / 16.0F, 12.0F / 16.0F, 1.0F); +- break; +- case 3: +- this.setBlockBounds(0.25F, 0.25F, 0.0F, 12.0F / 16.0F, 12.0F / 16.0F, 0.5F); +- break; +- case 4: +- this.setBlockBounds(0.5F, 0.25F, 0.25F, 1.0F, 12.0F / 16.0F, 12.0F / 16.0F); +- break; +- case 5: +- this.setBlockBounds(0.0F, 0.25F, 0.25F, 0.5F, 12.0F / 16.0F, 12.0F / 16.0F); ++ /** ++ * Updates the blocks bounds based on its current state. Args: world, x, y, z ++ */ ++ public void setBlockBoundsBasedOnState(IBlockAccess par1IBlockAccess, int par2, int par3, int par4) { ++ int var5 = par1IBlockAccess.getBlockMetadata(par2, par3, par4) & 7; ++ ++ switch (var5) { ++ case 1: ++ default: ++ this.setBlockBounds(0.25F, 0.0F, 0.25F, 0.75F, 0.5F, 0.75F); ++ break; ++ ++ case 2: ++ this.setBlockBounds(0.25F, 0.25F, 0.5F, 0.75F, 0.75F, 1.0F); ++ break; ++ ++ case 3: ++ this.setBlockBounds(0.25F, 0.25F, 0.0F, 0.75F, 0.75F, 0.5F); ++ break; ++ ++ case 4: ++ this.setBlockBounds(0.5F, 0.25F, 0.25F, 1.0F, 0.75F, 0.75F); ++ break; ++ ++ case 5: ++ this.setBlockBounds(0.0F, 0.25F, 0.25F, 0.5F, 0.75F, 0.75F); + } +- +- } +- +- public AxisAlignedBB getCollisionBoundingBoxFromPool(World var1, int var2, int var3, int var4) { +- this.setBlockBoundsBasedOnState(var1, var2, var3, var4); +- return super.getCollisionBoundingBoxFromPool(var1, var2, var3, var4); +- } +- +- public void onBlockPlacedBy(World var1, int var2, int var3, int var4, EntityLivingBase var5, ItemStack var6) { +- int var7 = MathHelper.floor_double((double)(var5.rotationYaw * 4.0F / 360.0F) + 2.5D) & 3; +- var1.setBlockMetadata(var2, var3, var4, var7, 2); +- } +- +- public TileEntity createNewTileEntity(World var1) { ++ } ++ ++ /** ++ * Returns a bounding box from the pool of bounding boxes (this means this box can change after the pool has been ++ * cleared to be reused) ++ */ ++ public AxisAlignedBB getCollisionBoundingBoxFromPool(World par1World, int par2, int par3, int par4) { ++ this.setBlockBoundsBasedOnState(par1World, par2, par3, par4); ++ return super.getCollisionBoundingBoxFromPool(par1World, par2, par3, par4); ++ } ++ ++ /** ++ * Called when the block is placed in the world. ++ */ ++ public void onBlockPlacedBy(World par1World, int par2, int par3, int par4, EntityLivingBase par5EntityLivingBase, ItemStack par6ItemStack) { ++ int var7 = MathHelper.floor_double((double)(par5EntityLivingBase.rotationYaw * 4.0F / 360.0F) + 2.5D) & 3; ++ par1World.setBlockMetadataWithNotify(par2, par3, par4, var7, 2); ++ } ++ ++ /** ++ * Returns a new instance of a block's tile entity class. Called on placing the block. ++ */ ++ public TileEntity createNewTileEntity(World par1World) { + return new TileEntitySkull(); + } + +- public int idPicked(World var1, int var2, int var3, int var4) { ++ /** ++ * only called by clickMiddleMouseButton , and passed to inventory.setCurrentItem (along with isCreative) ++ */ ++ public int idPicked(World par1World, int par2, int par3, int par4) { + return Item.skull.itemID; + } + +- public int getDamageValue(World var1, int var2, int var3, int var4) { +- TileEntity var5 = var1.getBlockTileEntity(var2, var3, var4); +- return var5 != null && var5 instanceof TileEntitySkull ? ((TileEntitySkull)var5).getSkullType() : super.getDamageValue(var1, var2, var3, var4); +- } +- +- public int damageDropped(int var1) { +- return var1; +- } +- +- public void dropBlockAsItemWithChance(World var1, int var2, int var3, int var4, int var5, float var6, int var7) { +- } +- +- public void onBlockHarvested(World var1, int var2, int var3, int var4, int var5, EntityPlayer var6) { +- if(var6.capabilities.isCreativeMode) { +- var5 |= 8; +- var1.setBlockMetadata(var2, var3, var4, var5, 4); ++ /** ++ * Get the block's damage value (for use with pick block). ++ */ ++ public int getDamageValue(World par1World, int par2, int par3, int par4) { ++ TileEntity var5 = par1World.getBlockTileEntity(par2, par3, par4); ++ return var5 != null && var5 instanceof TileEntitySkull ? ((TileEntitySkull)var5).getSkullType() : super.getDamageValue(par1World, par2, par3, par4); ++ } ++ ++ /** ++ * Determines the damage on the item the block drops. Used in cloth and wood. ++ */ ++ public int damageDropped(int par1) { ++ return par1; ++ } ++ ++ /** ++ * Drops the block items with a specified chance of dropping the specified items ++ */ ++ public void dropBlockAsItemWithChance(World par1World, int par2, int par3, int par4, int par5, float par6, int par7) {} ++ ++ /** ++ * Called when the block is attempted to be harvested ++ */ ++ public void onBlockHarvested(World par1World, int par2, int par3, int par4, int par5, EntityPlayer par6EntityPlayer) { ++ if (par6EntityPlayer.capabilities.isCreativeMode) { ++ par5 |= 8; ++ par1World.setBlockMetadataWithNotify(par2, par3, par4, par5, 4); + } + +- super.onBlockHarvested(var1, var2, var3, var4, var5, var6); ++ super.onBlockHarvested(par1World, par2, par3, par4, par5, par6EntityPlayer); + } + +- public void breakBlock(World var1, int var2, int var3, int var4, int var5, int var6) { +- if(!var1.isRemote) { +- if((var6 & 8) == 0) { +- ItemStack var7 = new ItemStack(Item.skull.itemID, 1, this.getDamageValue(var1, var2, var3, var4)); +- TileEntitySkull var8 = (TileEntitySkull)var1.getBlockTileEntity(var2, var3, var4); +- if(var8.getSkullType() == 3 && var8.getExtraType() != null && var8.getExtraType().length() > 0) { ++ /** ++ * Called on server worlds only when the block has been replaced by a different block ID, or the same block with a ++ * different metadata value, but before the new metadata value is set. Args: World, x, y, z, old block ID, old metadata ++ */ ++ public void breakBlock(World par1World, int par2, int par3, int par4, int par5, int par6) { ++ if (!par1World.isRemote) { ++ if ((par6 & 8) == 0) { ++ ItemStack var7 = new ItemStack(Item.skull.itemID, 1, this.getDamageValue(par1World, par2, par3, par4)); ++ TileEntitySkull var8 = (TileEntitySkull)par1World.getBlockTileEntity(par2, par3, par4); ++ ++ if (var8.getSkullType() == 3 && var8.getExtraType() != null && var8.getExtraType().length() > 0) { + var7.setTagCompound(new NBTTagCompound()); + var7.getTagCompound().setString("SkullOwner", var8.getExtraType()); + } + +- this.dropBlockAsItem_do(var1, var2, var3, var4, var7); ++ this.dropBlockAsItem_do(par1World, par2, par3, par4, var7); + } + +- super.breakBlock(var1, var2, var3, var4, var5, var6); ++ super.breakBlock(par1World, par2, par3, par4, par5, par6); + } + } + +- public int idDropped(int var1, Random var2, int var3) { ++ /** ++ * Returns the ID of the items to drop on destruction. ++ */ ++ public int idDropped(int par1, Random par2Random, int par3) { + return Item.skull.itemID; + } + +- public void makeWither(World var1, int var2, int var3, int var4, TileEntitySkull var5) { +- if(var5.getSkullType() == 1 && var3 >= 2 && var1.difficultySetting > 0 && !var1.isRemote) { ++ /** ++ * This method attempts to create a wither at the given location and skull ++ */ ++ public void makeWither(World par1World, int par2, int par3, int par4, TileEntitySkull par5TileEntitySkull) { ++ if (par5TileEntitySkull.getSkullType() == 1 && par3 >= 2 && par1World.difficultySetting > 0 && !par1World.isRemote) { + int var6 = Block.slowSand.blockID; +- + int var7; + EntityWither var8; + int var9; +- for(var7 = -2; var7 <= 0; ++var7) { +- if(var1.getBlockId(var2, var3 - 1, var4 + var7) == var6 && var1.getBlockId(var2, var3 - 1, var4 + var7 + 1) == var6 && var1.getBlockId(var2, var3 - 2, var4 + var7 + 1) == var6 && var1.getBlockId(var2, var3 - 1, var4 + var7 + 2) == var6 && this.func_82528_d(var1, var2, var3, var4 + var7, 1) && this.func_82528_d(var1, var2, var3, var4 + var7 + 1, 1) && this.func_82528_d(var1, var2, var3, var4 + var7 + 2, 1)) { +- var1.setBlockMetadata(var2, var3, var4 + var7, 8, 2); +- var1.setBlockMetadata(var2, var3, var4 + var7 + 1, 8, 2); +- var1.setBlockMetadata(var2, var3, var4 + var7 + 2, 8, 2); +- var1.setBlock(var2, var3, var4 + var7, 0, 0, 2); +- var1.setBlock(var2, var3, var4 + var7 + 1, 0, 0, 2); +- var1.setBlock(var2, var3, var4 + var7 + 2, 0, 0, 2); +- var1.setBlock(var2, var3 - 1, var4 + var7, 0, 0, 2); +- var1.setBlock(var2, var3 - 1, var4 + var7 + 1, 0, 0, 2); +- var1.setBlock(var2, var3 - 1, var4 + var7 + 2, 0, 0, 2); +- var1.setBlock(var2, var3 - 2, var4 + var7 + 1, 0, 0, 2); +- if(!var1.isRemote) { +- var8 = new EntityWither(var1); +- var8.setLocationAndAngles((double)var2 + 0.5D, (double)var3 - 1.45D, (double)(var4 + var7) + 1.5D, 90.0F, 0.0F); ++ ++ for (var7 = -2; var7 <= 0; ++var7) { ++ if (par1World.getBlockId(par2, par3 - 1, par4 + var7) == var6 && par1World.getBlockId(par2, par3 - 1, par4 + var7 + 1) == var6 && par1World.getBlockId(par2, par3 - 2, par4 + var7 + 1) == var6 && par1World.getBlockId(par2, par3 - 1, par4 + var7 + 2) == var6 && this.func_82528_d(par1World, par2, par3, par4 + var7, 1) && this.func_82528_d(par1World, par2, par3, par4 + var7 + 1, 1) && this.func_82528_d(par1World, par2, par3, par4 + var7 + 2, 1)) { ++ par1World.setBlockMetadataWithNotify(par2, par3, par4 + var7, 8, 2); ++ par1World.setBlockMetadataWithNotify(par2, par3, par4 + var7 + 1, 8, 2); ++ par1World.setBlockMetadataWithNotify(par2, par3, par4 + var7 + 2, 8, 2); ++ par1World.setBlock(par2, par3, par4 + var7, 0, 0, 2); ++ par1World.setBlock(par2, par3, par4 + var7 + 1, 0, 0, 2); ++ par1World.setBlock(par2, par3, par4 + var7 + 2, 0, 0, 2); ++ par1World.setBlock(par2, par3 - 1, par4 + var7, 0, 0, 2); ++ par1World.setBlock(par2, par3 - 1, par4 + var7 + 1, 0, 0, 2); ++ par1World.setBlock(par2, par3 - 1, par4 + var7 + 2, 0, 0, 2); ++ par1World.setBlock(par2, par3 - 2, par4 + var7 + 1, 0, 0, 2); ++ ++ if (!par1World.isRemote) { ++ var8 = new EntityWither(par1World); ++ var8.setLocationAndAngles((double)par2 + 0.5D, (double)par3 - 1.45D, (double)(par4 + var7) + 1.5D, 90.0F, 0.0F); + var8.renderYawOffset = 90.0F; + var8.func_82206_m(); +- var1.spawnEntityInWorld(var8); +- } +- +- for(var9 = 0; var9 < 120; ++var9) { +- var1.spawnParticle("snowballpoof", (double)var2 + var1.s.nextDouble(), (double)(var3 - 2) + var1.s.nextDouble() * 3.9D, (double)(var4 + var7 + 1) + var1.s.nextDouble(), 0.0D, 0.0D, 0.0D); +- } +- +- var1.notifyBlockChange(var2, var3, var4 + var7, 0); +- var1.notifyBlockChange(var2, var3, var4 + var7 + 1, 0); +- var1.notifyBlockChange(var2, var3, var4 + var7 + 2, 0); +- var1.notifyBlockChange(var2, var3 - 1, var4 + var7, 0); +- var1.notifyBlockChange(var2, var3 - 1, var4 + var7 + 1, 0); +- var1.notifyBlockChange(var2, var3 - 1, var4 + var7 + 2, 0); +- var1.notifyBlockChange(var2, var3 - 2, var4 + var7 + 1, 0); ++ par1World.spawnEntityInWorld(var8); ++ } ++ ++ for (var9 = 0; var9 < 120; ++var9) { ++ par1World.spawnParticle("snowballpoof", (double)par2 + par1World.rand.nextDouble(), (double)(par3 - 2) + par1World.rand.nextDouble() * 3.9D, (double)(par4 + var7 + 1) + par1World.rand.nextDouble(), 0.0D, 0.0D, 0.0D); ++ } ++ ++ par1World.notifyBlockChange(par2, par3, par4 + var7, 0); ++ par1World.notifyBlockChange(par2, par3, par4 + var7 + 1, 0); ++ par1World.notifyBlockChange(par2, par3, par4 + var7 + 2, 0); ++ par1World.notifyBlockChange(par2, par3 - 1, par4 + var7, 0); ++ par1World.notifyBlockChange(par2, par3 - 1, par4 + var7 + 1, 0); ++ par1World.notifyBlockChange(par2, par3 - 1, par4 + var7 + 2, 0); ++ par1World.notifyBlockChange(par2, par3 - 2, par4 + var7 + 1, 0); + return; + } + } + +- for(var7 = -2; var7 <= 0; ++var7) { +- if(var1.getBlockId(var2 + var7, var3 - 1, var4) == var6 && var1.getBlockId(var2 + var7 + 1, var3 - 1, var4) == var6 && var1.getBlockId(var2 + var7 + 1, var3 - 2, var4) == var6 && var1.getBlockId(var2 + var7 + 2, var3 - 1, var4) == var6 && this.func_82528_d(var1, var2 + var7, var3, var4, 1) && this.func_82528_d(var1, var2 + var7 + 1, var3, var4, 1) && this.func_82528_d(var1, var2 + var7 + 2, var3, var4, 1)) { +- var1.setBlockMetadata(var2 + var7, var3, var4, 8, 2); +- var1.setBlockMetadata(var2 + var7 + 1, var3, var4, 8, 2); +- var1.setBlockMetadata(var2 + var7 + 2, var3, var4, 8, 2); +- var1.setBlock(var2 + var7, var3, var4, 0, 0, 2); +- var1.setBlock(var2 + var7 + 1, var3, var4, 0, 0, 2); +- var1.setBlock(var2 + var7 + 2, var3, var4, 0, 0, 2); +- var1.setBlock(var2 + var7, var3 - 1, var4, 0, 0, 2); +- var1.setBlock(var2 + var7 + 1, var3 - 1, var4, 0, 0, 2); +- var1.setBlock(var2 + var7 + 2, var3 - 1, var4, 0, 0, 2); +- var1.setBlock(var2 + var7 + 1, var3 - 2, var4, 0, 0, 2); +- if(!var1.isRemote) { +- var8 = new EntityWither(var1); +- var8.setLocationAndAngles((double)(var2 + var7) + 1.5D, (double)var3 - 1.45D, (double)var4 + 0.5D, 0.0F, 0.0F); ++ for (var7 = -2; var7 <= 0; ++var7) { ++ if (par1World.getBlockId(par2 + var7, par3 - 1, par4) == var6 && par1World.getBlockId(par2 + var7 + 1, par3 - 1, par4) == var6 && par1World.getBlockId(par2 + var7 + 1, par3 - 2, par4) == var6 && par1World.getBlockId(par2 + var7 + 2, par3 - 1, par4) == var6 && this.func_82528_d(par1World, par2 + var7, par3, par4, 1) && this.func_82528_d(par1World, par2 + var7 + 1, par3, par4, 1) && this.func_82528_d(par1World, par2 + var7 + 2, par3, par4, 1)) { ++ par1World.setBlockMetadataWithNotify(par2 + var7, par3, par4, 8, 2); ++ par1World.setBlockMetadataWithNotify(par2 + var7 + 1, par3, par4, 8, 2); ++ par1World.setBlockMetadataWithNotify(par2 + var7 + 2, par3, par4, 8, 2); ++ par1World.setBlock(par2 + var7, par3, par4, 0, 0, 2); ++ par1World.setBlock(par2 + var7 + 1, par3, par4, 0, 0, 2); ++ par1World.setBlock(par2 + var7 + 2, par3, par4, 0, 0, 2); ++ par1World.setBlock(par2 + var7, par3 - 1, par4, 0, 0, 2); ++ par1World.setBlock(par2 + var7 + 1, par3 - 1, par4, 0, 0, 2); ++ par1World.setBlock(par2 + var7 + 2, par3 - 1, par4, 0, 0, 2); ++ par1World.setBlock(par2 + var7 + 1, par3 - 2, par4, 0, 0, 2); ++ ++ if (!par1World.isRemote) { ++ var8 = new EntityWither(par1World); ++ var8.setLocationAndAngles((double)(par2 + var7) + 1.5D, (double)par3 - 1.45D, (double)par4 + 0.5D, 0.0F, 0.0F); + var8.func_82206_m(); +- var1.spawnEntityInWorld(var8); +- } +- +- for(var9 = 0; var9 < 120; ++var9) { +- var1.spawnParticle("snowballpoof", (double)(var2 + var7 + 1) + var1.s.nextDouble(), (double)(var3 - 2) + var1.s.nextDouble() * 3.9D, (double)var4 + var1.s.nextDouble(), 0.0D, 0.0D, 0.0D); +- } +- +- var1.notifyBlockChange(var2 + var7, var3, var4, 0); +- var1.notifyBlockChange(var2 + var7 + 1, var3, var4, 0); +- var1.notifyBlockChange(var2 + var7 + 2, var3, var4, 0); +- var1.notifyBlockChange(var2 + var7, var3 - 1, var4, 0); +- var1.notifyBlockChange(var2 + var7 + 1, var3 - 1, var4, 0); +- var1.notifyBlockChange(var2 + var7 + 2, var3 - 1, var4, 0); +- var1.notifyBlockChange(var2 + var7 + 1, var3 - 2, var4, 0); ++ par1World.spawnEntityInWorld(var8); ++ } ++ ++ for (var9 = 0; var9 < 120; ++var9) { ++ par1World.spawnParticle("snowballpoof", (double)(par2 + var7 + 1) + par1World.rand.nextDouble(), (double)(par3 - 2) + par1World.rand.nextDouble() * 3.9D, (double)par4 + par1World.rand.nextDouble(), 0.0D, 0.0D, 0.0D); ++ } ++ ++ par1World.notifyBlockChange(par2 + var7, par3, par4, 0); ++ par1World.notifyBlockChange(par2 + var7 + 1, par3, par4, 0); ++ par1World.notifyBlockChange(par2 + var7 + 2, par3, par4, 0); ++ par1World.notifyBlockChange(par2 + var7, par3 - 1, par4, 0); ++ par1World.notifyBlockChange(par2 + var7 + 1, par3 - 1, par4, 0); ++ par1World.notifyBlockChange(par2 + var7 + 2, par3 - 1, par4, 0); ++ par1World.notifyBlockChange(par2 + var7 + 1, par3 - 2, par4, 0); + return; + } + } + } +- + } + +- private boolean func_82528_d(World var1, int var2, int var3, int var4, int var5) { +- if(var1.getBlockId(var2, var3, var4) != this.blockID) { ++ private boolean func_82528_d(World par1World, int par2, int par3, int par4, int par5) { ++ if (par1World.getBlockId(par2, par3, par4) != this.blockID) { + return false; + } else { +- TileEntity var6 = var1.getBlockTileEntity(var2, var3, var4); +- return var6 != null && var6 instanceof TileEntitySkull ? ((TileEntitySkull)var6).getSkullType() == var5 : false; ++ TileEntity var6 = par1World.getBlockTileEntity(par2, par3, par4); ++ return var6 != null && var6 instanceof TileEntitySkull ? ((TileEntitySkull)var6).getSkullType() == par5 : false; + } + } + +- public void registerIcons(IconRegister var1) { +- } +- +- public Icon getIcon(int var1, int var2) { +- return Block.slowSand.getBlockTextureFromSide(var1); +- } +- ++ /** ++ * When this method is called, your block should register all the icons it needs with the given IconRegister. This is ++ * the only chance you get to register icons. ++ */ ++ public void registerIcons(IconRegister par1IconRegister) {} ++ ++ /** ++ * From the specified side and block metadata retrieves the blocks texture. Args: side, metadata ++ */ ++ public Icon getIcon(int par1, int par2) { ++ return Block.slowSand.getBlockTextureFromSide(par1); ++ } ++ ++ /** ++ * Gets the icon name of the ItemBlock corresponding to this block. Used by hoppers. ++ */ + public String getItemIconName() { +- return this.getTextureName() + "_" + ItemSkull.a[0]; ++ return this.getTextureName() + "_" + ItemSkull.field_94587_a[0]; + } + } diff --git a/patches/net/minecraft/src/BlockSnow.java.patch b/patches/net/minecraft/src/BlockSnow.java.patch new file mode 100644 index 0000000..5540892 --- /dev/null +++ b/patches/net/minecraft/src/BlockSnow.java.patch @@ -0,0 +1,187 @@ +--- net/minecraft/src/BlockSnow.java ++++ net/minecraft/src/BlockSnow.java +@@ -3,90 +3,140 @@ + import java.util.Random; + + public class BlockSnow extends Block { +- protected BlockSnow(int var1) { +- super(var1, Material.snow); +- this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 2.0F / 16.0F, 1.0F); ++ protected BlockSnow(int par1) { ++ super(par1, Material.snow); ++ this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.125F, 1.0F); + this.setTickRandomly(true); + this.setCreativeTab(CreativeTabs.tabDecorations); + this.setBlockBoundsForSnowDepth(0); + } + +- public void registerIcons(IconRegister var1) { +- this.blockIcon = var1.registerIcon("snow"); +- } +- +- public AxisAlignedBB getCollisionBoundingBoxFromPool(World var1, int var2, int var3, int var4) { +- int var5 = var1.getBlockMetadata(var2, var3, var4) & 7; +- float var6 = 2.0F / 16.0F; +- return AxisAlignedBB.getAABBPool().getAABB((double)var2 + this.minX, (double)var3 + this.minY, (double)var4 + this.minZ, (double)var2 + this.maxX, (double)((float)var3 + (float)var5 * var6), (double)var4 + this.maxZ); +- } +- ++ /** ++ * When this method is called, your block should register all the icons it needs with the given IconRegister. This is ++ * the only chance you get to register icons. ++ */ ++ public void registerIcons(IconRegister par1IconRegister) { ++ this.blockIcon = par1IconRegister.registerIcon("snow"); ++ } ++ ++ /** ++ * Returns a bounding box from the pool of bounding boxes (this means this box can change after the pool has been ++ * cleared to be reused) ++ */ ++ public AxisAlignedBB getCollisionBoundingBoxFromPool(World par1World, int par2, int par3, int par4) { ++ int var5 = par1World.getBlockMetadata(par2, par3, par4) & 7; ++ float var6 = 0.125F; ++ return AxisAlignedBB.getAABBPool().getAABB((double)par2 + this.minX, (double)par3 + this.minY, (double)par4 + this.minZ, (double)par2 + this.maxX, (double)((float)par3 + (float)var5 * var6), (double)par4 + this.maxZ); ++ } ++ ++ /** ++ * Is this block (a) opaque and (b) a full 1m cube? This determines whether or not to render the shared face of two ++ * adjacent blocks and also whether the player can attach torches, redstone wire, etc to this block. ++ */ + public boolean isOpaqueCube() { + return false; + } + ++ /** ++ * If this block doesn't render as an ordinary block it will return False (examples: signs, buttons, stairs, etc) ++ */ + public boolean renderAsNormalBlock() { + return false; + } + ++ /** ++ * Sets the block's bounds for rendering it as an item ++ */ + public void setBlockBoundsForItemRender() { + this.setBlockBoundsForSnowDepth(0); + } + +- public void setBlockBoundsBasedOnState(IBlockAccess var1, int var2, int var3, int var4) { +- this.setBlockBoundsForSnowDepth(var1.getBlockMetadata(var2, var3, var4)); ++ /** ++ * Updates the blocks bounds based on its current state. Args: world, x, y, z ++ */ ++ public void setBlockBoundsBasedOnState(IBlockAccess par1IBlockAccess, int par2, int par3, int par4) { ++ this.setBlockBoundsForSnowDepth(par1IBlockAccess.getBlockMetadata(par2, par3, par4)); + } + +- protected void setBlockBoundsForSnowDepth(int var1) { +- int var2 = var1 & 7; ++ /** ++ * calls setBlockBounds based on the depth of the snow. Int is any values 0x0-0x7, usually this blocks metadata. ++ */ ++ protected void setBlockBoundsForSnowDepth(int par1) { ++ int var2 = par1 & 7; + float var3 = (float)(2 * (1 + var2)) / 16.0F; + this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, var3, 1.0F); + } + +- public boolean canPlaceBlockAt(World var1, int var2, int var3, int var4) { +- int var5 = var1.getBlockId(var2, var3 - 1, var4); +- return var5 == 0 ? false : (var5 == this.blockID && (var1.getBlockMetadata(var2, var3 - 1, var4) & 7) == 7 ? true : (var5 != Block.leaves.blockID && !Block.blocksList[var5].isOpaqueCube() ? false : var1.getBlockMaterial(var2, var3 - 1, var4).blocksMovement())); +- } +- +- public void onNeighborBlockChange(World var1, int var2, int var3, int var4, int var5) { +- this.canSnowStay(var1, var2, var3, var4); +- } +- +- private boolean canSnowStay(World var1, int var2, int var3, int var4) { +- if(!this.canPlaceBlockAt(var1, var2, var3, var4)) { +- this.dropBlockAsItem(var1, var2, var3, var4, var1.getBlockMetadata(var2, var3, var4), 0); +- var1.setBlockToAir(var2, var3, var4); ++ /** ++ * Checks to see if its valid to put this block at the specified coordinates. Args: world, x, y, z ++ */ ++ public boolean canPlaceBlockAt(World par1World, int par2, int par3, int par4) { ++ int var5 = par1World.getBlockId(par2, par3 - 1, par4); ++ return var5 == 0 ? false : (var5 == this.blockID && (par1World.getBlockMetadata(par2, par3 - 1, par4) & 7) == 7 ? true : (var5 != Block.leaves.blockID && !Block.blocksList[var5].isOpaqueCube() ? false : par1World.getBlockMaterial(par2, par3 - 1, par4).blocksMovement())); ++ } ++ ++ /** ++ * Lets the block know when one of its neighbor changes. Doesn't know which neighbor changed (coordinates passed are ++ * their own) Args: x, y, z, neighbor blockID ++ */ ++ public void onNeighborBlockChange(World par1World, int par2, int par3, int par4, int par5) { ++ this.canSnowStay(par1World, par2, par3, par4); ++ } ++ ++ /** ++ * Checks if this snow block can stay at this location. ++ */ ++ private boolean canSnowStay(World par1World, int par2, int par3, int par4) { ++ if (!this.canPlaceBlockAt(par1World, par2, par3, par4)) { ++ this.dropBlockAsItem(par1World, par2, par3, par4, par1World.getBlockMetadata(par2, par3, par4), 0); ++ par1World.setBlockToAir(par2, par3, par4); + return false; + } else { + return true; + } + } + +- public void harvestBlock(World var1, EntityPlayer var2, int var3, int var4, int var5, int var6) { ++ /** ++ * Called when the player destroys a block with an item that can harvest it. (i, j, k) are the coordinates of the block ++ * and l is the block's subtype/damage. ++ */ ++ public void harvestBlock(World par1World, EntityPlayer par2EntityPlayer, int par3, int par4, int par5, int par6) { + int var7 = Item.snowball.itemID; +- int var8 = var6 & 7; +- this.dropBlockAsItem_do(var1, var3, var4, var5, new ItemStack(var7, var8 + 1, 0)); +- var1.setBlockToAir(var3, var4, var5); +- var2.addStat(StatList.mineBlockStatArray[this.blockID], 1); ++ int var8 = par6 & 7; ++ this.dropBlockAsItem_do(par1World, par3, par4, par5, new ItemStack(var7, var8 + 1, 0)); ++ par1World.setBlockToAir(par3, par4, par5); ++ par2EntityPlayer.addStat(StatList.mineBlockStatArray[this.blockID], 1); + } + +- public int idDropped(int var1, Random var2, int var3) { ++ /** ++ * Returns the ID of the items to drop on destruction. ++ */ ++ public int idDropped(int par1, Random par2Random, int par3) { + return Item.snowball.itemID; + } + +- public int quantityDropped(Random var1) { ++ /** ++ * Returns the quantity of items to drop on block destruction. ++ */ ++ public int quantityDropped(Random par1Random) { + return 0; + } + +- public void updateTick(World var1, int var2, int var3, int var4, Random var5) { +- if(var1.getSavedLightValue(EnumSkyBlock.Block, var2, var3, var4) > 11) { +- this.dropBlockAsItem(var1, var2, var3, var4, var1.getBlockMetadata(var2, var3, var4), 0); +- var1.setBlockToAir(var2, var3, var4); ++ /** ++ * Ticks the block if it's been scheduled ++ */ ++ public void updateTick(World par1World, int par2, int par3, int par4, Random par5Random) { ++ if (par1World.getSavedLightValue(EnumSkyBlock.Block, par2, par3, par4) > 11) { ++ this.dropBlockAsItem(par1World, par2, par3, par4, par1World.getBlockMetadata(par2, par3, par4), 0); ++ par1World.setBlockToAir(par2, par3, par4); + } +- + } + +- public boolean shouldSideBeRendered(IBlockAccess var1, int var2, int var3, int var4, int var5) { +- return var5 == 1 ? true : super.shouldSideBeRendered(var1, var2, var3, var4, var5); ++ /** ++ * Returns true if the given side of this block type should be rendered, if the adjacent block is at the given ++ * coordinates. Args: blockAccess, x, y, z, side ++ */ ++ public boolean shouldSideBeRendered(IBlockAccess par1IBlockAccess, int par2, int par3, int par4, int par5) { ++ return par5 == 1 ? true : super.shouldSideBeRendered(par1IBlockAccess, par2, par3, par4, par5); + } + } diff --git a/patches/net/minecraft/src/BlockSnowBlock.java.patch b/patches/net/minecraft/src/BlockSnowBlock.java.patch new file mode 100644 index 0000000..9c0ede6 --- /dev/null +++ b/patches/net/minecraft/src/BlockSnowBlock.java.patch @@ -0,0 +1,45 @@ +--- net/minecraft/src/BlockSnowBlock.java ++++ net/minecraft/src/BlockSnowBlock.java +@@ -3,25 +3,33 @@ + import java.util.Random; + + public class BlockSnowBlock extends Block { +- protected BlockSnowBlock(int var1) { +- super(var1, Material.craftedSnow); ++ protected BlockSnowBlock(int par1) { ++ super(par1, Material.craftedSnow); + this.setTickRandomly(true); + this.setCreativeTab(CreativeTabs.tabBlock); + } + +- public int idDropped(int var1, Random var2, int var3) { ++ /** ++ * Returns the ID of the items to drop on destruction. ++ */ ++ public int idDropped(int par1, Random par2Random, int par3) { + return Item.snowball.itemID; + } + +- public int quantityDropped(Random var1) { ++ /** ++ * Returns the quantity of items to drop on block destruction. ++ */ ++ public int quantityDropped(Random par1Random) { + return 4; + } + +- public void updateTick(World var1, int var2, int var3, int var4, Random var5) { +- if(var1.getSavedLightValue(EnumSkyBlock.Block, var2, var3, var4) > 11) { +- this.dropBlockAsItem(var1, var2, var3, var4, var1.getBlockMetadata(var2, var3, var4), 0); +- var1.setBlockToAir(var2, var3, var4); ++ /** ++ * Ticks the block if it's been scheduled ++ */ ++ public void updateTick(World par1World, int par2, int par3, int par4, Random par5Random) { ++ if (par1World.getSavedLightValue(EnumSkyBlock.Block, par2, par3, par4) > 11) { ++ this.dropBlockAsItem(par1World, par2, par3, par4, par1World.getBlockMetadata(par2, par3, par4), 0); ++ par1World.setBlockToAir(par2, par3, par4); + } +- + } + } diff --git a/patches/net/minecraft/src/BlockSoulSand.java.patch b/patches/net/minecraft/src/BlockSoulSand.java.patch new file mode 100644 index 0000000..eda01d3 --- /dev/null +++ b/patches/net/minecraft/src/BlockSoulSand.java.patch @@ -0,0 +1,36 @@ +--- net/minecraft/src/BlockSoulSand.java ++++ net/minecraft/src/BlockSoulSand.java +@@ -1,18 +1,25 @@ + package net.minecraft.src; + + public class BlockSoulSand extends Block { +- public BlockSoulSand(int var1) { +- super(var1, Material.sand); ++ public BlockSoulSand(int par1) { ++ super(par1, Material.sand); + this.setCreativeTab(CreativeTabs.tabBlock); + } + +- public AxisAlignedBB getCollisionBoundingBoxFromPool(World var1, int var2, int var3, int var4) { +- float var5 = 2.0F / 16.0F; +- return AxisAlignedBB.getAABBPool().getAABB((double)var2, (double)var3, (double)var4, (double)(var2 + 1), (double)((float)(var3 + 1) - var5), (double)(var4 + 1)); ++ /** ++ * Returns a bounding box from the pool of bounding boxes (this means this box can change after the pool has been ++ * cleared to be reused) ++ */ ++ public AxisAlignedBB getCollisionBoundingBoxFromPool(World par1World, int par2, int par3, int par4) { ++ float var5 = 0.125F; ++ return AxisAlignedBB.getAABBPool().getAABB((double)par2, (double)par3, (double)par4, (double)(par2 + 1), (double)((float)(par3 + 1) - var5), (double)(par4 + 1)); + } + +- public void onEntityCollidedWithBlock(World var1, int var2, int var3, int var4, Entity var5) { +- var5.motionX *= 0.4D; +- var5.motionZ *= 0.4D; ++ /** ++ * Triggered whenever an entity collides with this block (enters into the block). Args: world, x, y, z, entity ++ */ ++ public void onEntityCollidedWithBlock(World par1World, int par2, int par3, int par4, Entity par5Entity) { ++ par5Entity.motionX *= 0.4D; ++ par5Entity.motionZ *= 0.4D; + } + } diff --git a/patches/net/minecraft/src/BlockSourceImpl.java.patch b/patches/net/minecraft/src/BlockSourceImpl.java.patch new file mode 100644 index 0000000..c611b29 --- /dev/null +++ b/patches/net/minecraft/src/BlockSourceImpl.java.patch @@ -0,0 +1,19 @@ +--- net/minecraft/src/BlockSourceImpl.java ++++ net/minecraft/src/BlockSourceImpl.java +@@ -6,11 +6,11 @@ + private final int yPos; + private final int zPos; + +- public BlockSourceImpl(World var1, int var2, int var3, int var4) { +- this.worldObj = var1; +- this.xPos = var2; +- this.yPos = var3; +- this.zPos = var4; ++ public BlockSourceImpl(World par1World, int par2, int par3, int par4) { ++ this.worldObj = par1World; ++ this.xPos = par2; ++ this.yPos = par3; ++ this.zPos = par4; + } + + public World getWorld() { diff --git a/patches/net/minecraft/src/BlockSponge.java.patch b/patches/net/minecraft/src/BlockSponge.java.patch new file mode 100644 index 0000000..b6ca430 --- /dev/null +++ b/patches/net/minecraft/src/BlockSponge.java.patch @@ -0,0 +1,13 @@ +--- net/minecraft/src/BlockSponge.java ++++ net/minecraft/src/BlockSponge.java +@@ -1,8 +1,8 @@ + package net.minecraft.src; + + public class BlockSponge extends Block { +- protected BlockSponge(int var1) { +- super(var1, Material.sponge); ++ protected BlockSponge(int par1) { ++ super(par1, Material.sponge); + this.setCreativeTab(CreativeTabs.tabBlock); + } + } diff --git a/patches/net/minecraft/src/BlockStairs.java.patch b/patches/net/minecraft/src/BlockStairs.java.patch new file mode 100644 index 0000000..97f5cf6 --- /dev/null +++ b/patches/net/minecraft/src/BlockStairs.java.patch @@ -0,0 +1,713 @@ +--- net/minecraft/src/BlockStairs.java ++++ net/minecraft/src/BlockStairs.java +@@ -4,69 +4,91 @@ + import java.util.Random; + + public class BlockStairs extends Block { +- private static final int[][] field_72159_a = new int[][]{{2, 6}, {3, 7}, {2, 3}, {6, 7}, {0, 4}, {1, 5}, {0, 1}, {4, 5}}; ++ private static final int[][] field_72159_a = new int[][] {{2, 6}, {3, 7}, {2, 3}, {6, 7}, {0, 4}, {1, 5}, {0, 1}, {4, 5}}; ++ ++ /** The block that is used as model for the stair. */ + private final Block modelBlock; + private final int modelBlockMetadata; + private boolean field_72156_cr; + private int field_72160_cs; + +- protected BlockStairs(int var1, Block var2, int var3) { +- super(var1, var2.blockMaterial); +- this.modelBlock = var2; +- this.modelBlockMetadata = var3; +- this.setHardness(var2.blockHardness); +- this.setResistance(var2.blockResistance / 3.0F); +- this.setStepSound(var2.stepSound); ++ protected BlockStairs(int par1, Block par2Block, int par3) { ++ super(par1, par2Block.blockMaterial); ++ this.modelBlock = par2Block; ++ this.modelBlockMetadata = par3; ++ this.setHardness(par2Block.blockHardness); ++ this.setResistance(par2Block.blockResistance / 3.0F); ++ this.setStepSound(par2Block.stepSound); + this.setLightOpacity(255); + this.setCreativeTab(CreativeTabs.tabBlock); + } + +- public void setBlockBoundsBasedOnState(IBlockAccess var1, int var2, int var3, int var4) { +- if(this.field_72156_cr) { ++ /** ++ * Updates the blocks bounds based on its current state. Args: world, x, y, z ++ */ ++ public void setBlockBoundsBasedOnState(IBlockAccess par1IBlockAccess, int par2, int par3, int par4) { ++ if (this.field_72156_cr) { + this.setBlockBounds(0.5F * (float)(this.field_72160_cs % 2), 0.5F * (float)(this.field_72160_cs / 2 % 2), 0.5F * (float)(this.field_72160_cs / 4 % 2), 0.5F + 0.5F * (float)(this.field_72160_cs % 2), 0.5F + 0.5F * (float)(this.field_72160_cs / 2 % 2), 0.5F + 0.5F * (float)(this.field_72160_cs / 4 % 2)); + } else { + this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F); + } +- + } + ++ /** ++ * Is this block (a) opaque and (b) a full 1m cube? This determines whether or not to render the shared face of two ++ * adjacent blocks and also whether the player can attach torches, redstone wire, etc to this block. ++ */ + public boolean isOpaqueCube() { + return false; + } + ++ /** ++ * If this block doesn't render as an ordinary block it will return False (examples: signs, buttons, stairs, etc) ++ */ + public boolean renderAsNormalBlock() { + return false; + } + ++ /** ++ * The type of render function that is called for this block ++ */ + public int getRenderType() { + return 10; + } + +- public void func_82541_d(IBlockAccess var1, int var2, int var3, int var4) { +- int var5 = var1.getBlockMetadata(var2, var3, var4); +- if((var5 & 4) != 0) { ++ public void func_82541_d(IBlockAccess par1IBlockAccess, int par2, int par3, int par4) { ++ int var5 = par1IBlockAccess.getBlockMetadata(par2, par3, par4); ++ ++ if ((var5 & 4) != 0) { + this.setBlockBounds(0.0F, 0.5F, 0.0F, 1.0F, 1.0F, 1.0F); + } else { + this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.5F, 1.0F); + } +- +- } +- +- public static boolean isBlockStairsID(int var0) { +- return var0 > 0 && Block.blocksList[var0] instanceof BlockStairs; +- } +- +- private boolean isBlockStairsDirection(IBlockAccess var1, int var2, int var3, int var4, int var5) { +- int var6 = var1.getBlockId(var2, var3, var4); +- return isBlockStairsID(var6) && var1.getBlockMetadata(var2, var3, var4) == var5; +- } +- +- public boolean func_82542_g(IBlockAccess var1, int var2, int var3, int var4) { +- int var5 = var1.getBlockMetadata(var2, var3, var4); ++ } ++ ++ /** ++ * Checks if supplied ID is one of a BlockStairs ++ */ ++ public static boolean isBlockStairsID(int par0) { ++ return par0 > 0 && Block.blocksList[par0] instanceof BlockStairs; ++ } ++ ++ /** ++ * returns true if the given block is a stairs block and is in the given direction of par5. Parameters are ++ * IBlockAccess, x, y, z, direction ++ */ ++ private boolean isBlockStairsDirection(IBlockAccess par1IBlockAccess, int par2, int par3, int par4, int par5) { ++ int var6 = par1IBlockAccess.getBlockId(par2, par3, par4); ++ return isBlockStairsID(var6) && par1IBlockAccess.getBlockMetadata(par2, par3, par4) == par5; ++ } ++ ++ public boolean func_82542_g(IBlockAccess par1IBlockAccess, int par2, int par3, int par4) { ++ int var5 = par1IBlockAccess.getBlockMetadata(par2, par3, par4); + int var6 = var5 & 3; + float var7 = 0.5F; + float var8 = 1.0F; +- if((var5 & 4) != 0) { ++ ++ if ((var5 & 4) != 0) { + var7 = 0.0F; + var8 = 0.5F; + } +@@ -79,60 +101,69 @@ + int var14; + int var15; + int var16; +- if(var6 == 0) { ++ ++ if (var6 == 0) { + var9 = 0.5F; + var12 = 1.0F; +- var14 = var1.getBlockId(var2 + 1, var3, var4); +- var15 = var1.getBlockMetadata(var2 + 1, var3, var4); +- if(isBlockStairsID(var14) && (var5 & 4) == (var15 & 4)) { ++ var14 = par1IBlockAccess.getBlockId(par2 + 1, par3, par4); ++ var15 = par1IBlockAccess.getBlockMetadata(par2 + 1, par3, par4); ++ ++ if (isBlockStairsID(var14) && (var5 & 4) == (var15 & 4)) { + var16 = var15 & 3; +- if(var16 == 3 && !this.isBlockStairsDirection(var1, var2, var3, var4 + 1, var5)) { ++ ++ if (var16 == 3 && !this.isBlockStairsDirection(par1IBlockAccess, par2, par3, par4 + 1, var5)) { + var12 = 0.5F; + var13 = false; +- } else if(var16 == 2 && !this.isBlockStairsDirection(var1, var2, var3, var4 - 1, var5)) { ++ } else if (var16 == 2 && !this.isBlockStairsDirection(par1IBlockAccess, par2, par3, par4 - 1, var5)) { + var11 = 0.5F; + var13 = false; + } + } +- } else if(var6 == 1) { ++ } else if (var6 == 1) { + var10 = 0.5F; + var12 = 1.0F; +- var14 = var1.getBlockId(var2 - 1, var3, var4); +- var15 = var1.getBlockMetadata(var2 - 1, var3, var4); +- if(isBlockStairsID(var14) && (var5 & 4) == (var15 & 4)) { ++ var14 = par1IBlockAccess.getBlockId(par2 - 1, par3, par4); ++ var15 = par1IBlockAccess.getBlockMetadata(par2 - 1, par3, par4); ++ ++ if (isBlockStairsID(var14) && (var5 & 4) == (var15 & 4)) { + var16 = var15 & 3; +- if(var16 == 3 && !this.isBlockStairsDirection(var1, var2, var3, var4 + 1, var5)) { ++ ++ if (var16 == 3 && !this.isBlockStairsDirection(par1IBlockAccess, par2, par3, par4 + 1, var5)) { + var12 = 0.5F; + var13 = false; +- } else if(var16 == 2 && !this.isBlockStairsDirection(var1, var2, var3, var4 - 1, var5)) { ++ } else if (var16 == 2 && !this.isBlockStairsDirection(par1IBlockAccess, par2, par3, par4 - 1, var5)) { + var11 = 0.5F; + var13 = false; + } + } +- } else if(var6 == 2) { ++ } else if (var6 == 2) { + var11 = 0.5F; + var12 = 1.0F; +- var14 = var1.getBlockId(var2, var3, var4 + 1); +- var15 = var1.getBlockMetadata(var2, var3, var4 + 1); +- if(isBlockStairsID(var14) && (var5 & 4) == (var15 & 4)) { ++ var14 = par1IBlockAccess.getBlockId(par2, par3, par4 + 1); ++ var15 = par1IBlockAccess.getBlockMetadata(par2, par3, par4 + 1); ++ ++ if (isBlockStairsID(var14) && (var5 & 4) == (var15 & 4)) { + var16 = var15 & 3; +- if(var16 == 1 && !this.isBlockStairsDirection(var1, var2 + 1, var3, var4, var5)) { ++ ++ if (var16 == 1 && !this.isBlockStairsDirection(par1IBlockAccess, par2 + 1, par3, par4, var5)) { + var10 = 0.5F; + var13 = false; +- } else if(var16 == 0 && !this.isBlockStairsDirection(var1, var2 - 1, var3, var4, var5)) { ++ } else if (var16 == 0 && !this.isBlockStairsDirection(par1IBlockAccess, par2 - 1, par3, par4, var5)) { + var9 = 0.5F; + var13 = false; + } + } +- } else if(var6 == 3) { +- var14 = var1.getBlockId(var2, var3, var4 - 1); +- var15 = var1.getBlockMetadata(var2, var3, var4 - 1); +- if(isBlockStairsID(var14) && (var5 & 4) == (var15 & 4)) { ++ } else if (var6 == 3) { ++ var14 = par1IBlockAccess.getBlockId(par2, par3, par4 - 1); ++ var15 = par1IBlockAccess.getBlockMetadata(par2, par3, par4 - 1); ++ ++ if (isBlockStairsID(var14) && (var5 & 4) == (var15 & 4)) { + var16 = var15 & 3; +- if(var16 == 1 && !this.isBlockStairsDirection(var1, var2 + 1, var3, var4, var5)) { ++ ++ if (var16 == 1 && !this.isBlockStairsDirection(par1IBlockAccess, par2 + 1, par3, par4, var5)) { + var10 = 0.5F; + var13 = false; +- } else if(var16 == 0 && !this.isBlockStairsDirection(var1, var2 - 1, var3, var4, var5)) { ++ } else if (var16 == 0 && !this.isBlockStairsDirection(par1IBlockAccess, par2 - 1, par3, par4, var5)) { + var9 = 0.5F; + var13 = false; + } +@@ -143,12 +174,13 @@ + return var13; + } + +- public boolean func_82544_h(IBlockAccess var1, int var2, int var3, int var4) { +- int var5 = var1.getBlockMetadata(var2, var3, var4); ++ public boolean func_82544_h(IBlockAccess par1IBlockAccess, int par2, int par3, int par4) { ++ int var5 = par1IBlockAccess.getBlockMetadata(par2, par3, par4); + int var6 = var5 & 3; + float var7 = 0.5F; + float var8 = 1.0F; +- if((var5 & 4) != 0) { ++ ++ if ((var5 & 4) != 0) { + var7 = 0.0F; + var8 = 0.5F; + } +@@ -161,61 +193,70 @@ + int var14; + int var15; + int var16; +- if(var6 == 0) { +- var14 = var1.getBlockId(var2 - 1, var3, var4); +- var15 = var1.getBlockMetadata(var2 - 1, var3, var4); +- if(isBlockStairsID(var14) && (var5 & 4) == (var15 & 4)) { ++ ++ if (var6 == 0) { ++ var14 = par1IBlockAccess.getBlockId(par2 - 1, par3, par4); ++ var15 = par1IBlockAccess.getBlockMetadata(par2 - 1, par3, par4); ++ ++ if (isBlockStairsID(var14) && (var5 & 4) == (var15 & 4)) { + var16 = var15 & 3; +- if(var16 == 3 && !this.isBlockStairsDirection(var1, var2, var3, var4 - 1, var5)) { ++ ++ if (var16 == 3 && !this.isBlockStairsDirection(par1IBlockAccess, par2, par3, par4 - 1, var5)) { + var11 = 0.0F; + var12 = 0.5F; + var13 = true; +- } else if(var16 == 2 && !this.isBlockStairsDirection(var1, var2, var3, var4 + 1, var5)) { ++ } else if (var16 == 2 && !this.isBlockStairsDirection(par1IBlockAccess, par2, par3, par4 + 1, var5)) { + var11 = 0.5F; + var12 = 1.0F; + var13 = true; + } + } +- } else if(var6 == 1) { +- var14 = var1.getBlockId(var2 + 1, var3, var4); +- var15 = var1.getBlockMetadata(var2 + 1, var3, var4); +- if(isBlockStairsID(var14) && (var5 & 4) == (var15 & 4)) { ++ } else if (var6 == 1) { ++ var14 = par1IBlockAccess.getBlockId(par2 + 1, par3, par4); ++ var15 = par1IBlockAccess.getBlockMetadata(par2 + 1, par3, par4); ++ ++ if (isBlockStairsID(var14) && (var5 & 4) == (var15 & 4)) { + var9 = 0.5F; + var10 = 1.0F; + var16 = var15 & 3; +- if(var16 == 3 && !this.isBlockStairsDirection(var1, var2, var3, var4 - 1, var5)) { ++ ++ if (var16 == 3 && !this.isBlockStairsDirection(par1IBlockAccess, par2, par3, par4 - 1, var5)) { + var11 = 0.0F; + var12 = 0.5F; + var13 = true; +- } else if(var16 == 2 && !this.isBlockStairsDirection(var1, var2, var3, var4 + 1, var5)) { ++ } else if (var16 == 2 && !this.isBlockStairsDirection(par1IBlockAccess, par2, par3, par4 + 1, var5)) { + var11 = 0.5F; + var12 = 1.0F; + var13 = true; + } + } +- } else if(var6 == 2) { +- var14 = var1.getBlockId(var2, var3, var4 - 1); +- var15 = var1.getBlockMetadata(var2, var3, var4 - 1); +- if(isBlockStairsID(var14) && (var5 & 4) == (var15 & 4)) { ++ } else if (var6 == 2) { ++ var14 = par1IBlockAccess.getBlockId(par2, par3, par4 - 1); ++ var15 = par1IBlockAccess.getBlockMetadata(par2, par3, par4 - 1); ++ ++ if (isBlockStairsID(var14) && (var5 & 4) == (var15 & 4)) { + var11 = 0.0F; + var12 = 0.5F; + var16 = var15 & 3; +- if(var16 == 1 && !this.isBlockStairsDirection(var1, var2 - 1, var3, var4, var5)) { ++ ++ if (var16 == 1 && !this.isBlockStairsDirection(par1IBlockAccess, par2 - 1, par3, par4, var5)) { + var13 = true; +- } else if(var16 == 0 && !this.isBlockStairsDirection(var1, var2 + 1, var3, var4, var5)) { ++ } else if (var16 == 0 && !this.isBlockStairsDirection(par1IBlockAccess, par2 + 1, par3, par4, var5)) { + var9 = 0.5F; + var10 = 1.0F; + var13 = true; + } + } +- } else if(var6 == 3) { +- var14 = var1.getBlockId(var2, var3, var4 + 1); +- var15 = var1.getBlockMetadata(var2, var3, var4 + 1); +- if(isBlockStairsID(var14) && (var5 & 4) == (var15 & 4)) { ++ } else if (var6 == 3) { ++ var14 = par1IBlockAccess.getBlockId(par2, par3, par4 + 1); ++ var15 = par1IBlockAccess.getBlockMetadata(par2, par3, par4 + 1); ++ ++ if (isBlockStairsID(var14) && (var5 & 4) == (var15 & 4)) { + var16 = var15 & 3; +- if(var16 == 1 && !this.isBlockStairsDirection(var1, var2 - 1, var3, var4, var5)) { ++ ++ if (var16 == 1 && !this.isBlockStairsDirection(par1IBlockAccess, par2 - 1, par3, par4, var5)) { + var13 = true; +- } else if(var16 == 0 && !this.isBlockStairsDirection(var1, var2 + 1, var3, var4, var5)) { ++ } else if (var16 == 0 && !this.isBlockStairsDirection(par1IBlockAccess, par2 + 1, par3, par4, var5)) { + var9 = 0.5F; + var10 = 1.0F; + var13 = true; +@@ -223,160 +264,239 @@ + } + } + +- if(var13) { ++ if (var13) { + this.setBlockBounds(var9, var7, var11, var10, var8, var12); + } + + return var13; + } + +- public void addCollisionBoxesToList(World var1, int var2, int var3, int var4, AxisAlignedBB var5, List var6, Entity var7) { +- this.func_82541_d(var1, var2, var3, var4); +- super.addCollisionBoxesToList(var1, var2, var3, var4, var5, var6, var7); +- boolean var8 = this.func_82542_g(var1, var2, var3, var4); +- super.addCollisionBoxesToList(var1, var2, var3, var4, var5, var6, var7); +- if(var8 && this.func_82544_h(var1, var2, var3, var4)) { +- super.addCollisionBoxesToList(var1, var2, var3, var4, var5, var6, var7); ++ /** ++ * Adds all intersecting collision boxes to a list. (Be sure to only add boxes to the list if they intersect the mask.) ++ * Parameters: World, X, Y, Z, mask, list, colliding entity ++ */ ++ public void addCollisionBoxesToList(World par1World, int par2, int par3, int par4, AxisAlignedBB par5AxisAlignedBB, List par6List, Entity par7Entity) { ++ this.func_82541_d(par1World, par2, par3, par4); ++ super.addCollisionBoxesToList(par1World, par2, par3, par4, par5AxisAlignedBB, par6List, par7Entity); ++ boolean var8 = this.func_82542_g(par1World, par2, par3, par4); ++ super.addCollisionBoxesToList(par1World, par2, par3, par4, par5AxisAlignedBB, par6List, par7Entity); ++ ++ if (var8 && this.func_82544_h(par1World, par2, par3, par4)) { ++ super.addCollisionBoxesToList(par1World, par2, par3, par4, par5AxisAlignedBB, par6List, par7Entity); + } + + this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F); + } + +- public void randomDisplayTick(World var1, int var2, int var3, int var4, Random var5) { +- this.modelBlock.randomDisplayTick(var1, var2, var3, var4, var5); +- } +- +- public void onBlockClicked(World var1, int var2, int var3, int var4, EntityPlayer var5) { +- this.modelBlock.onBlockClicked(var1, var2, var3, var4, var5); +- } +- +- public void onBlockDestroyedByPlayer(World var1, int var2, int var3, int var4, int var5) { +- this.modelBlock.onBlockDestroyedByPlayer(var1, var2, var3, var4, var5); +- } +- +- public int getMixedBrightnessForBlock(IBlockAccess var1, int var2, int var3, int var4) { +- return this.modelBlock.getMixedBrightnessForBlock(var1, var2, var3, var4); +- } +- +- public float getBlockBrightness(IBlockAccess var1, int var2, int var3, int var4) { +- return this.modelBlock.getBlockBrightness(var1, var2, var3, var4); +- } +- +- public float getExplosionResistance(Entity var1) { +- return this.modelBlock.getExplosionResistance(var1); +- } +- ++ /** ++ * A randomly called display update to be able to add particles or other items for display ++ */ ++ public void randomDisplayTick(World par1World, int par2, int par3, int par4, Random par5Random) { ++ this.modelBlock.randomDisplayTick(par1World, par2, par3, par4, par5Random); ++ } ++ ++ /** ++ * Called when the block is clicked by a player. Args: x, y, z, entityPlayer ++ */ ++ public void onBlockClicked(World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer) { ++ this.modelBlock.onBlockClicked(par1World, par2, par3, par4, par5EntityPlayer); ++ } ++ ++ /** ++ * Called right before the block is destroyed by a player. Args: world, x, y, z, metaData ++ */ ++ public void onBlockDestroyedByPlayer(World par1World, int par2, int par3, int par4, int par5) { ++ this.modelBlock.onBlockDestroyedByPlayer(par1World, par2, par3, par4, par5); ++ } ++ ++ /** ++ * Goes straight to getLightBrightnessForSkyBlocks for Blocks, does some fancy computing for Fluids ++ */ ++ public int getMixedBrightnessForBlock(IBlockAccess par1IBlockAccess, int par2, int par3, int par4) { ++ return this.modelBlock.getMixedBrightnessForBlock(par1IBlockAccess, par2, par3, par4); ++ } ++ ++ /** ++ * How bright to render this block based on the light its receiving. Args: iBlockAccess, x, y, z ++ */ ++ public float getBlockBrightness(IBlockAccess par1IBlockAccess, int par2, int par3, int par4) { ++ return this.modelBlock.getBlockBrightness(par1IBlockAccess, par2, par3, par4); ++ } ++ ++ /** ++ * Returns how much this block can resist explosions from the passed in entity. ++ */ ++ public float getExplosionResistance(Entity par1Entity) { ++ return this.modelBlock.getExplosionResistance(par1Entity); ++ } ++ ++ /** ++ * Returns which pass should this block be rendered on. 0 for solids and 1 for alpha ++ */ + public int getRenderBlockPass() { + return this.modelBlock.getRenderBlockPass(); + } + +- public Icon getIcon(int var1, int var2) { +- return this.modelBlock.getIcon(var1, this.modelBlockMetadata); +- } +- +- public int tickRate(World var1) { +- return this.modelBlock.tickRate(var1); +- } +- +- public AxisAlignedBB getSelectedBoundingBoxFromPool(World var1, int var2, int var3, int var4) { +- return this.modelBlock.getSelectedBoundingBoxFromPool(var1, var2, var3, var4); +- } +- +- public void velocityToAddToEntity(World var1, int var2, int var3, int var4, Entity var5, Vec3 var6) { +- this.modelBlock.velocityToAddToEntity(var1, var2, var3, var4, var5, var6); +- } +- ++ /** ++ * From the specified side and block metadata retrieves the blocks texture. Args: side, metadata ++ */ ++ public Icon getIcon(int par1, int par2) { ++ return this.modelBlock.getIcon(par1, this.modelBlockMetadata); ++ } ++ ++ /** ++ * How many world ticks before ticking ++ */ ++ public int tickRate(World par1World) { ++ return this.modelBlock.tickRate(par1World); ++ } ++ ++ /** ++ * Returns the bounding box of the wired rectangular prism to render. ++ */ ++ public AxisAlignedBB getSelectedBoundingBoxFromPool(World par1World, int par2, int par3, int par4) { ++ return this.modelBlock.getSelectedBoundingBoxFromPool(par1World, par2, par3, par4); ++ } ++ ++ /** ++ * Can add to the passed in vector for a movement vector to be applied to the entity. Args: x, y, z, entity, vec3d ++ */ ++ public void velocityToAddToEntity(World par1World, int par2, int par3, int par4, Entity par5Entity, Vec3 par6Vec3) { ++ this.modelBlock.velocityToAddToEntity(par1World, par2, par3, par4, par5Entity, par6Vec3); ++ } ++ ++ /** ++ * Returns if this block is collidable (only used by Fire). Args: x, y, z ++ */ + public boolean isCollidable() { + return this.modelBlock.isCollidable(); + } + +- public boolean canCollideCheck(int var1, boolean var2) { +- return this.modelBlock.canCollideCheck(var1, var2); +- } +- +- public boolean canPlaceBlockAt(World var1, int var2, int var3, int var4) { +- return this.modelBlock.canPlaceBlockAt(var1, var2, var3, var4); +- } +- +- public void onBlockAdded(World var1, int var2, int var3, int var4) { +- this.onNeighborBlockChange(var1, var2, var3, var4, 0); +- this.modelBlock.onBlockAdded(var1, var2, var3, var4); +- } +- +- public void breakBlock(World var1, int var2, int var3, int var4, int var5, int var6) { +- this.modelBlock.breakBlock(var1, var2, var3, var4, var5, var6); +- } +- +- public void onEntityWalking(World var1, int var2, int var3, int var4, Entity var5) { +- this.modelBlock.onEntityWalking(var1, var2, var3, var4, var5); +- } +- +- public void updateTick(World var1, int var2, int var3, int var4, Random var5) { +- this.modelBlock.updateTick(var1, var2, var3, var4, var5); +- } +- +- public boolean onBlockActivated(World var1, int var2, int var3, int var4, EntityPlayer var5, int var6, float var7, float var8, float var9) { +- return this.modelBlock.onBlockActivated(var1, var2, var3, var4, var5, 0, 0.0F, 0.0F, 0.0F); +- } +- +- public void onBlockDestroyedByExplosion(World var1, int var2, int var3, int var4, Explosion var5) { +- this.modelBlock.onBlockDestroyedByExplosion(var1, var2, var3, var4, var5); +- } +- +- public void onBlockPlacedBy(World var1, int var2, int var3, int var4, EntityLivingBase var5, ItemStack var6) { +- int var7 = MathHelper.floor_double((double)(var5.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3; +- int var8 = var1.getBlockMetadata(var2, var3, var4) & 4; +- if(var7 == 0) { +- var1.setBlockMetadata(var2, var3, var4, 2 | var8, 2); +- } +- +- if(var7 == 1) { +- var1.setBlockMetadata(var2, var3, var4, 1 | var8, 2); +- } +- +- if(var7 == 2) { +- var1.setBlockMetadata(var2, var3, var4, 3 | var8, 2); +- } +- +- if(var7 == 3) { +- var1.setBlockMetadata(var2, var3, var4, 0 | var8, 2); +- } +- +- } +- +- public int onBlockPlaced(World var1, int var2, int var3, int var4, int var5, float var6, float var7, float var8, int var9) { +- return var5 != 0 && (var5 == 1 || (double)var7 <= 0.5D) ? var9 : var9 | 4; +- } +- +- public MovingObjectPosition collisionRayTrace(World var1, int var2, int var3, int var4, Vec3 var5, Vec3 var6) { ++ /** ++ * Returns whether this block is collideable based on the arguments passed in \n@param par1 block metaData \n@param ++ * par2 whether the player right-clicked while holding a boat ++ */ ++ public boolean canCollideCheck(int par1, boolean par2) { ++ return this.modelBlock.canCollideCheck(par1, par2); ++ } ++ ++ /** ++ * Checks to see if its valid to put this block at the specified coordinates. Args: world, x, y, z ++ */ ++ public boolean canPlaceBlockAt(World par1World, int par2, int par3, int par4) { ++ return this.modelBlock.canPlaceBlockAt(par1World, par2, par3, par4); ++ } ++ ++ /** ++ * Called whenever the block is added into the world. Args: world, x, y, z ++ */ ++ public void onBlockAdded(World par1World, int par2, int par3, int par4) { ++ this.onNeighborBlockChange(par1World, par2, par3, par4, 0); ++ this.modelBlock.onBlockAdded(par1World, par2, par3, par4); ++ } ++ ++ /** ++ * Called on server worlds only when the block has been replaced by a different block ID, or the same block with a ++ * different metadata value, but before the new metadata value is set. Args: World, x, y, z, old block ID, old metadata ++ */ ++ public void breakBlock(World par1World, int par2, int par3, int par4, int par5, int par6) { ++ this.modelBlock.breakBlock(par1World, par2, par3, par4, par5, par6); ++ } ++ ++ /** ++ * Called whenever an entity is walking on top of this block. Args: world, x, y, z, entity ++ */ ++ public void onEntityWalking(World par1World, int par2, int par3, int par4, Entity par5Entity) { ++ this.modelBlock.onEntityWalking(par1World, par2, par3, par4, par5Entity); ++ } ++ ++ /** ++ * Ticks the block if it's been scheduled ++ */ ++ public void updateTick(World par1World, int par2, int par3, int par4, Random par5Random) { ++ this.modelBlock.updateTick(par1World, par2, par3, par4, par5Random); ++ } ++ ++ /** ++ * Called upon block activation (right click on the block.) ++ */ ++ public boolean onBlockActivated(World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer, int par6, float par7, float par8, float par9) { ++ return this.modelBlock.onBlockActivated(par1World, par2, par3, par4, par5EntityPlayer, 0, 0.0F, 0.0F, 0.0F); ++ } ++ ++ /** ++ * Called upon the block being destroyed by an explosion ++ */ ++ public void onBlockDestroyedByExplosion(World par1World, int par2, int par3, int par4, Explosion par5Explosion) { ++ this.modelBlock.onBlockDestroyedByExplosion(par1World, par2, par3, par4, par5Explosion); ++ } ++ ++ /** ++ * Called when the block is placed in the world. ++ */ ++ public void onBlockPlacedBy(World par1World, int par2, int par3, int par4, EntityLivingBase par5EntityLivingBase, ItemStack par6ItemStack) { ++ int var7 = MathHelper.floor_double((double)(par5EntityLivingBase.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3; ++ int var8 = par1World.getBlockMetadata(par2, par3, par4) & 4; ++ ++ if (var7 == 0) { ++ par1World.setBlockMetadataWithNotify(par2, par3, par4, 2 | var8, 2); ++ } ++ ++ if (var7 == 1) { ++ par1World.setBlockMetadataWithNotify(par2, par3, par4, 1 | var8, 2); ++ } ++ ++ if (var7 == 2) { ++ par1World.setBlockMetadataWithNotify(par2, par3, par4, 3 | var8, 2); ++ } ++ ++ if (var7 == 3) { ++ par1World.setBlockMetadataWithNotify(par2, par3, par4, 0 | var8, 2); ++ } ++ } ++ ++ /** ++ * Called when a block is placed using its ItemBlock. Args: World, X, Y, Z, side, hitX, hitY, hitZ, block metadata ++ */ ++ public int onBlockPlaced(World par1World, int par2, int par3, int par4, int par5, float par6, float par7, float par8, int par9) { ++ return par5 != 0 && (par5 == 1 || (double)par7 <= 0.5D) ? par9 : par9 | 4; ++ } ++ ++ /** ++ * Ray traces through the blocks collision from start vector to end vector returning a ray trace hit. Args: world, x, ++ * y, z, startVec, endVec ++ */ ++ public MovingObjectPosition collisionRayTrace(World par1World, int par2, int par3, int par4, Vec3 par5Vec3, Vec3 par6Vec3) { + MovingObjectPosition[] var7 = new MovingObjectPosition[8]; +- int var8 = var1.getBlockMetadata(var2, var3, var4); ++ int var8 = par1World.getBlockMetadata(par2, par3, par4); + int var9 = var8 & 3; + boolean var10 = (var8 & 4) == 4; + int[] var11 = field_72159_a[var9 + (var10 ? 4 : 0)]; + this.field_72156_cr = true; +- + int var14; + int var15; + int var16; +- for(int var12 = 0; var12 < 8; ++var12) { ++ ++ for (int var12 = 0; var12 < 8; ++var12) { + this.field_72160_cs = var12; + int[] var13 = var11; + var14 = var11.length; + +- for(var15 = 0; var15 < var14; ++var15) { ++ for (var15 = 0; var15 < var14; ++var15) { + var16 = var13[var15]; +- if(var16 == var12) { ++ ++ if (var16 == var12) { ++ ; + } + } + +- var7[var12] = super.collisionRayTrace(var1, var2, var3, var4, var5, var6); ++ var7[var12] = super.collisionRayTrace(par1World, par2, par3, par4, par5Vec3, par6Vec3); + } + + int[] var21 = var11; + int var23 = var11.length; + +- for(var14 = 0; var14 < var23; ++var14) { ++ for (var14 = 0; var14 < var23; ++var14) { + var15 = var21[var14]; + var7[var15] = null; + } +@@ -386,11 +506,13 @@ + MovingObjectPosition[] var25 = var7; + var16 = var7.length; + +- for(int var17 = 0; var17 < var16; ++var17) { ++ for (int var17 = 0; var17 < var16; ++var17) { + MovingObjectPosition var18 = var25[var17]; +- if(var18 != null) { +- double var19 = var18.hitVec.squareDistanceTo(var6); +- if(var19 > var24) { ++ ++ if (var18 != null) { ++ double var19 = var18.hitVec.squareDistanceTo(par6Vec3); ++ ++ if (var19 > var24) { + var22 = var18; + var24 = var19; + } +@@ -400,6 +522,9 @@ + return var22; + } + +- public void registerIcons(IconRegister var1) { +- } ++ /** ++ * When this method is called, your block should register all the icons it needs with the given IconRegister. This is ++ * the only chance you get to register icons. ++ */ ++ public void registerIcons(IconRegister par1IconRegister) {} + } diff --git a/patches/net/minecraft/src/BlockStationary.java.patch b/patches/net/minecraft/src/BlockStationary.java.patch new file mode 100644 index 0000000..74e9356 --- /dev/null +++ b/patches/net/minecraft/src/BlockStationary.java.patch @@ -0,0 +1,142 @@ +--- net/minecraft/src/BlockStationary.java ++++ net/minecraft/src/BlockStationary.java +@@ -3,76 +3,85 @@ + import java.util.Random; + + public class BlockStationary extends BlockFluid { +- protected BlockStationary(int var1, Material var2) { +- super(var1, var2); ++ protected BlockStationary(int par1, Material par2Material) { ++ super(par1, par2Material); + this.setTickRandomly(false); +- if(var2 == Material.lava) { ++ ++ if (par2Material == Material.lava) { + this.setTickRandomly(true); + } +- + } + +- public boolean getBlocksMovement(IBlockAccess var1, int var2, int var3, int var4) { ++ public boolean getBlocksMovement(IBlockAccess par1IBlockAccess, int par2, int par3, int par4) { + return this.blockMaterial != Material.lava; + } + +- public void onNeighborBlockChange(World var1, int var2, int var3, int var4, int var5) { +- super.onNeighborBlockChange(var1, var2, var3, var4, var5); +- if(var1.getBlockId(var2, var3, var4) == this.blockID) { +- this.setNotStationary(var1, var2, var3, var4); ++ /** ++ * Lets the block know when one of its neighbor changes. Doesn't know which neighbor changed (coordinates passed are ++ * their own) Args: x, y, z, neighbor blockID ++ */ ++ public void onNeighborBlockChange(World par1World, int par2, int par3, int par4, int par5) { ++ super.onNeighborBlockChange(par1World, par2, par3, par4, par5); ++ ++ if (par1World.getBlockId(par2, par3, par4) == this.blockID) { ++ this.setNotStationary(par1World, par2, par3, par4); + } +- +- } +- +- private void setNotStationary(World var1, int var2, int var3, int var4) { +- int var5 = var1.getBlockMetadata(var2, var3, var4); +- var1.setBlock(var2, var3, var4, this.blockID - 1, var5, 2); +- var1.scheduleBlockUpdate(var2, var3, var4, this.blockID - 1, this.tickRate(var1)); +- } +- +- public void updateTick(World var1, int var2, int var3, int var4, Random var5) { +- if(this.blockMaterial == Material.lava) { +- int var6 = var5.nextInt(3); +- int var7 = 0; +- +- while(true) { +- int var8; +- if(var7 >= var6) { +- if(var6 == 0) { +- var7 = var2; +- var8 = var4; +- +- for(int var9 = 0; var9 < 3; ++var9) { +- var2 = var7 + var5.nextInt(3) - 1; +- var4 = var8 + var5.nextInt(3) - 1; +- if(var1.isAirBlock(var2, var3 + 1, var4) && this.isFlammable(var1, var2, var3, var4)) { +- var1.setBlock(var2, var3 + 1, var4, Block.fire.blockID); +- } +- } +- } +- break; +- } +- +- var2 += var5.nextInt(3) - 1; +- ++var3; +- var4 += var5.nextInt(3) - 1; +- var8 = var1.getBlockId(var2, var3, var4); +- if(var8 == 0) { +- if(this.isFlammable(var1, var2 - 1, var3, var4) || this.isFlammable(var1, var2 + 1, var3, var4) || this.isFlammable(var1, var2, var3, var4 - 1) || this.isFlammable(var1, var2, var3, var4 + 1) || this.isFlammable(var1, var2, var3 - 1, var4) || this.isFlammable(var1, var2, var3 + 1, var4)) { +- var1.setBlock(var2, var3, var4, Block.fire.blockID); ++ } ++ ++ /** ++ * Changes the block ID to that of an updating fluid. ++ */ ++ private void setNotStationary(World par1World, int par2, int par3, int par4) { ++ int var5 = par1World.getBlockMetadata(par2, par3, par4); ++ par1World.setBlock(par2, par3, par4, this.blockID - 1, var5, 2); ++ par1World.scheduleBlockUpdate(par2, par3, par4, this.blockID - 1, this.tickRate(par1World)); ++ } ++ ++ /** ++ * Ticks the block if it's been scheduled ++ */ ++ public void updateTick(World par1World, int par2, int par3, int par4, Random par5Random) { ++ if (this.blockMaterial == Material.lava) { ++ int var6 = par5Random.nextInt(3); ++ int var7; ++ int var8; ++ ++ for (var7 = 0; var7 < var6; ++var7) { ++ par2 += par5Random.nextInt(3) - 1; ++ ++par3; ++ par4 += par5Random.nextInt(3) - 1; ++ var8 = par1World.getBlockId(par2, par3, par4); ++ ++ if (var8 == 0) { ++ if (this.isFlammable(par1World, par2 - 1, par3, par4) || this.isFlammable(par1World, par2 + 1, par3, par4) || this.isFlammable(par1World, par2, par3, par4 - 1) || this.isFlammable(par1World, par2, par3, par4 + 1) || this.isFlammable(par1World, par2, par3 - 1, par4) || this.isFlammable(par1World, par2, par3 + 1, par4)) { ++ par1World.setBlock(par2, par3, par4, Block.fire.blockID); + return; + } +- } else if(Block.blocksList[var8].blockMaterial.blocksMovement()) { ++ } else if (Block.blocksList[var8].blockMaterial.blocksMovement()) { + return; + } +- +- ++var7; ++ } ++ ++ if (var6 == 0) { ++ var7 = par2; ++ var8 = par4; ++ ++ for (int var9 = 0; var9 < 3; ++var9) { ++ par2 = var7 + par5Random.nextInt(3) - 1; ++ par4 = var8 + par5Random.nextInt(3) - 1; ++ ++ if (par1World.isAirBlock(par2, par3 + 1, par4) && this.isFlammable(par1World, par2, par3, par4)) { ++ par1World.setBlock(par2, par3 + 1, par4, Block.fire.blockID); ++ } ++ } + } + } +- + } + +- private boolean isFlammable(World var1, int var2, int var3, int var4) { +- return var1.getBlockMaterial(var2, var3, var4).getCanBurn(); ++ /** ++ * Checks to see if the block is flammable. ++ */ ++ private boolean isFlammable(World par1World, int par2, int par3, int par4) { ++ return par1World.getBlockMaterial(par2, par3, par4).getCanBurn(); + } + } diff --git a/patches/net/minecraft/src/BlockStem.java.patch b/patches/net/minecraft/src/BlockStem.java.patch new file mode 100644 index 0000000..f9b1e6f --- /dev/null +++ b/patches/net/minecraft/src/BlockStem.java.patch @@ -0,0 +1,352 @@ +--- net/minecraft/src/BlockStem.java ++++ net/minecraft/src/BlockStem.java +@@ -2,113 +2,131 @@ + + import java.util.Random; + ++import com.prupe.mcpatcher.cc.ColorizeBlock; ++ + public class BlockStem extends BlockFlower { ++ ++ /** Defines if it is a Melon or a Pumpkin that the stem is producing. */ + private final Block fruitType; + private Icon theIcon; + +- protected BlockStem(int var1, Block var2) { +- super(var1); +- this.fruitType = var2; ++ protected BlockStem(int par1, Block par2Block) { ++ super(par1); ++ this.fruitType = par2Block; + this.setTickRandomly(true); +- float var3 = 2.0F / 16.0F; ++ float var3 = 0.125F; + this.setBlockBounds(0.5F - var3, 0.0F, 0.5F - var3, 0.5F + var3, 0.25F, 0.5F + var3); + this.setCreativeTab((CreativeTabs)null); + } + +- protected boolean canThisPlantGrowOnThisBlockID(int var1) { +- return var1 == Block.tilledField.blockID; ++ /** ++ * Gets passed in the blockID of the block below and supposed to return true if its allowed to grow on the type of ++ * blockID passed in. Args: blockID ++ */ ++ protected boolean canThisPlantGrowOnThisBlockID(int par1) { ++ return par1 == Block.tilledField.blockID; + } + +- public void updateTick(World var1, int var2, int var3, int var4, Random var5) { +- super.updateTick(var1, var2, var3, var4, var5); +- if(var1.getBlockLightValue(var2, var3 + 1, var4) >= 9) { +- float var6 = this.getGrowthModifier(var1, var2, var3, var4); +- if(var5.nextInt((int)(25.0F / var6) + 1) == 0) { +- int var7 = var1.getBlockMetadata(var2, var3, var4); +- if(var7 < 7) { ++ /** ++ * Ticks the block if it's been scheduled ++ */ ++ public void updateTick(World par1World, int par2, int par3, int par4, Random par5Random) { ++ super.updateTick(par1World, par2, par3, par4, par5Random); ++ ++ if (par1World.getBlockLightValue(par2, par3 + 1, par4) >= 9) { ++ float var6 = this.getGrowthModifier(par1World, par2, par3, par4); ++ ++ if (par5Random.nextInt((int)(25.0F / var6) + 1) == 0) { ++ int var7 = par1World.getBlockMetadata(par2, par3, par4); ++ ++ if (var7 < 7) { + ++var7; +- var1.setBlockMetadata(var2, var3, var4, var7, 2); ++ par1World.setBlockMetadataWithNotify(par2, par3, par4, var7, 2); + } else { +- if(var1.getBlockId(var2 - 1, var3, var4) == this.fruitType.blockID) { +- return; +- } +- +- if(var1.getBlockId(var2 + 1, var3, var4) == this.fruitType.blockID) { +- return; +- } +- +- if(var1.getBlockId(var2, var3, var4 - 1) == this.fruitType.blockID) { +- return; +- } +- +- if(var1.getBlockId(var2, var3, var4 + 1) == this.fruitType.blockID) { +- return; +- } +- +- int var8 = var5.nextInt(4); +- int var9 = var2; +- int var10 = var4; +- if(var8 == 0) { +- var9 = var2 - 1; +- } +- +- if(var8 == 1) { ++ if (par1World.getBlockId(par2 - 1, par3, par4) == this.fruitType.blockID) { ++ return; ++ } ++ ++ if (par1World.getBlockId(par2 + 1, par3, par4) == this.fruitType.blockID) { ++ return; ++ } ++ ++ if (par1World.getBlockId(par2, par3, par4 - 1) == this.fruitType.blockID) { ++ return; ++ } ++ ++ if (par1World.getBlockId(par2, par3, par4 + 1) == this.fruitType.blockID) { ++ return; ++ } ++ ++ int var8 = par5Random.nextInt(4); ++ int var9 = par2; ++ int var10 = par4; ++ ++ if (var8 == 0) { ++ var9 = par2 - 1; ++ } ++ ++ if (var8 == 1) { + ++var9; + } + +- if(var8 == 2) { +- var10 = var4 - 1; ++ if (var8 == 2) { ++ var10 = par4 - 1; + } + +- if(var8 == 3) { ++ if (var8 == 3) { + ++var10; + } + +- int var11 = var1.getBlockId(var9, var3 - 1, var10); +- if(var1.getBlockId(var9, var3, var10) == 0 && (var11 == Block.tilledField.blockID || var11 == Block.dirt.blockID || var11 == Block.grass.blockID)) { +- var1.setBlock(var9, var3, var10, this.fruitType.blockID); ++ int var11 = par1World.getBlockId(var9, par3 - 1, var10); ++ ++ if (par1World.getBlockId(var9, par3, var10) == 0 && (var11 == Block.tilledField.blockID || var11 == Block.dirt.blockID || var11 == Block.grass.blockID)) { ++ par1World.setBlock(var9, par3, var10, this.fruitType.blockID); + } + } + } + } +- + } + +- public void fertilizeStem(World var1, int var2, int var3, int var4) { +- int var5 = var1.getBlockMetadata(var2, var3, var4) + MathHelper.getRandomIntegerInRange(var1.s, 2, 5); +- if(var5 > 7) { ++ public void fertilizeStem(World par1World, int par2, int par3, int par4) { ++ int var5 = par1World.getBlockMetadata(par2, par3, par4) + MathHelper.getRandomIntegerInRange(par1World.rand, 2, 5); ++ ++ if (var5 > 7) { + var5 = 7; + } + +- var1.setBlockMetadata(var2, var3, var4, var5, 2); ++ par1World.setBlockMetadataWithNotify(par2, par3, par4, var5, 2); + } + +- private float getGrowthModifier(World var1, int var2, int var3, int var4) { ++ private float getGrowthModifier(World par1World, int par2, int par3, int par4) { + float var5 = 1.0F; +- int var6 = var1.getBlockId(var2, var3, var4 - 1); +- int var7 = var1.getBlockId(var2, var3, var4 + 1); +- int var8 = var1.getBlockId(var2 - 1, var3, var4); +- int var9 = var1.getBlockId(var2 + 1, var3, var4); +- int var10 = var1.getBlockId(var2 - 1, var3, var4 - 1); +- int var11 = var1.getBlockId(var2 + 1, var3, var4 - 1); +- int var12 = var1.getBlockId(var2 + 1, var3, var4 + 1); +- int var13 = var1.getBlockId(var2 - 1, var3, var4 + 1); ++ int var6 = par1World.getBlockId(par2, par3, par4 - 1); ++ int var7 = par1World.getBlockId(par2, par3, par4 + 1); ++ int var8 = par1World.getBlockId(par2 - 1, par3, par4); ++ int var9 = par1World.getBlockId(par2 + 1, par3, par4); ++ int var10 = par1World.getBlockId(par2 - 1, par3, par4 - 1); ++ int var11 = par1World.getBlockId(par2 + 1, par3, par4 - 1); ++ int var12 = par1World.getBlockId(par2 + 1, par3, par4 + 1); ++ int var13 = par1World.getBlockId(par2 - 1, par3, par4 + 1); + boolean var14 = var8 == this.blockID || var9 == this.blockID; + boolean var15 = var6 == this.blockID || var7 == this.blockID; + boolean var16 = var10 == this.blockID || var11 == this.blockID || var12 == this.blockID || var13 == this.blockID; + +- for(int var17 = var2 - 1; var17 <= var2 + 1; ++var17) { +- for(int var18 = var4 - 1; var18 <= var4 + 1; ++var18) { +- int var19 = var1.getBlockId(var17, var3 - 1, var18); ++ for (int var17 = par2 - 1; var17 <= par2 + 1; ++var17) { ++ for (int var18 = par4 - 1; var18 <= par4 + 1; ++var18) { ++ int var19 = par1World.getBlockId(var17, par3 - 1, var18); + float var20 = 0.0F; +- if(var19 == Block.tilledField.blockID) { ++ ++ if (var19 == Block.tilledField.blockID) { + var20 = 1.0F; +- if(var1.getBlockMetadata(var17, var3 - 1, var18) > 0) { ++ ++ if (par1World.getBlockMetadata(var17, par3 - 1, var18) > 0) { + var20 = 3.0F; + } + } + +- if(var17 != var2 || var18 != var4) { ++ if (var17 != par2 || var18 != par4) { + var20 /= 4.0F; + } + +@@ -116,80 +134,119 @@ + } + } + +- if(var16 || var14 && var15) { ++ if (var16 || var14 && var15) { + var5 /= 2.0F; + } + + return var5; + } + +- public int getRenderColor(int var1) { +- int var2 = var1 * 32; +- int var3 = 255 - var1 * 8; +- int var4 = var1 * 4; +- return var2 << 16 | var3 << 8 | var4; +- } +- +- public int colorMultiplier(IBlockAccess var1, int var2, int var3, int var4) { +- return this.getRenderColor(var1.getBlockMetadata(var2, var3, var4)); +- } +- ++ /** ++ * Returns the color this block should be rendered. Used by leaves. ++ */ ++ public int getRenderColor(int par1) { ++ int var2 = par1 * 32; ++ int var3 = 255 - par1 * 8; ++ int var4 = par1 * 4; ++ // MCPatcher Start ++ return ColorizeBlock.colorizeStem(var2 << 16 | var3 << 8 | var4, this, par1); ++ // MCPatcher End ++ } ++ ++ /** ++ * Returns a integer with hex for 0xrrggbb with this color multiplied against the blocks color. Note only called when ++ * first determining what to render. ++ */ ++ public int colorMultiplier(IBlockAccess par1IBlockAccess, int par2, int par3, int par4) { ++ return this.getRenderColor(par1IBlockAccess.getBlockMetadata(par2, par3, par4)); ++ } ++ ++ /** ++ * Sets the block's bounds for rendering it as an item ++ */ + public void setBlockBoundsForItemRender() { +- float var1 = 2.0F / 16.0F; ++ float var1 = 0.125F; + this.setBlockBounds(0.5F - var1, 0.0F, 0.5F - var1, 0.5F + var1, 0.25F, 0.5F + var1); + } + +- public void setBlockBoundsBasedOnState(IBlockAccess var1, int var2, int var3, int var4) { +- this.maxY = (double)((float)(var1.getBlockMetadata(var2, var3, var4) * 2 + 2) / 16.0F); +- float var5 = 2.0F / 16.0F; ++ /** ++ * Updates the blocks bounds based on its current state. Args: world, x, y, z ++ */ ++ public void setBlockBoundsBasedOnState(IBlockAccess par1IBlockAccess, int par2, int par3, int par4) { ++ this.maxY = (double)((float)(par1IBlockAccess.getBlockMetadata(par2, par3, par4) * 2 + 2) / 16.0F); ++ float var5 = 0.125F; + this.setBlockBounds(0.5F - var5, 0.0F, 0.5F - var5, 0.5F + var5, (float)this.maxY, 0.5F + var5); + } + ++ /** ++ * The type of render function that is called for this block ++ */ + public int getRenderType() { + return 19; + } + +- public int getState(IBlockAccess var1, int var2, int var3, int var4) { +- int var5 = var1.getBlockMetadata(var2, var3, var4); +- return var5 < 7 ? -1 : (var1.getBlockId(var2 - 1, var3, var4) == this.fruitType.blockID ? 0 : (var1.getBlockId(var2 + 1, var3, var4) == this.fruitType.blockID ? 1 : (var1.getBlockId(var2, var3, var4 - 1) == this.fruitType.blockID ? 2 : (var1.getBlockId(var2, var3, var4 + 1) == this.fruitType.blockID ? 3 : -1)))); ++ /** ++ * Returns the current state of the stem. Returns -1 if the stem is not fully grown, or a value between 0 and 3 based ++ * on the direction the stem is facing. ++ */ ++ public int getState(IBlockAccess par1IBlockAccess, int par2, int par3, int par4) { ++ int var5 = par1IBlockAccess.getBlockMetadata(par2, par3, par4); ++ return var5 < 7 ? -1 : (par1IBlockAccess.getBlockId(par2 - 1, par3, par4) == this.fruitType.blockID ? 0 : (par1IBlockAccess.getBlockId(par2 + 1, par3, par4) == this.fruitType.blockID ? 1 : (par1IBlockAccess.getBlockId(par2, par3, par4 - 1) == this.fruitType.blockID ? 2 : (par1IBlockAccess.getBlockId(par2, par3, par4 + 1) == this.fruitType.blockID ? 3 : -1)))); + } + +- public void dropBlockAsItemWithChance(World var1, int var2, int var3, int var4, int var5, float var6, int var7) { +- super.dropBlockAsItemWithChance(var1, var2, var3, var4, var5, var6, var7); +- if(!var1.isRemote) { ++ /** ++ * Drops the block items with a specified chance of dropping the specified items ++ */ ++ public void dropBlockAsItemWithChance(World par1World, int par2, int par3, int par4, int par5, float par6, int par7) { ++ super.dropBlockAsItemWithChance(par1World, par2, par3, par4, par5, par6, par7); ++ ++ if (!par1World.isRemote) { + Item var8 = null; +- if(this.fruitType == Block.pumpkin) { ++ ++ if (this.fruitType == Block.pumpkin) { + var8 = Item.pumpkinSeeds; + } + +- if(this.fruitType == Block.melon) { ++ if (this.fruitType == Block.melon) { + var8 = Item.melonSeeds; + } + +- for(int var9 = 0; var9 < 3; ++var9) { +- if(var1.s.nextInt(15) <= var5) { +- this.dropBlockAsItem_do(var1, var2, var3, var4, new ItemStack(var8)); ++ for (int var9 = 0; var9 < 3; ++var9) { ++ if (par1World.rand.nextInt(15) <= par5) { ++ this.dropBlockAsItem_do(par1World, par2, par3, par4, new ItemStack(var8)); + } + } +- + } + } + +- public int idDropped(int var1, Random var2, int var3) { ++ /** ++ * Returns the ID of the items to drop on destruction. ++ */ ++ public int idDropped(int par1, Random par2Random, int par3) { + return -1; + } + +- public int quantityDropped(Random var1) { ++ /** ++ * Returns the quantity of items to drop on block destruction. ++ */ ++ public int quantityDropped(Random par1Random) { + return 1; + } + +- public int idPicked(World var1, int var2, int var3, int var4) { ++ /** ++ * only called by clickMiddleMouseButton , and passed to inventory.setCurrentItem (along with isCreative) ++ */ ++ public int idPicked(World par1World, int par2, int par3, int par4) { + return this.fruitType == Block.pumpkin ? Item.pumpkinSeeds.itemID : (this.fruitType == Block.melon ? Item.melonSeeds.itemID : 0); + } + +- public void registerIcons(IconRegister var1) { +- this.blockIcon = var1.registerIcon(this.getTextureName() + "_disconnected"); +- this.theIcon = var1.registerIcon(this.getTextureName() + "_connected"); ++ /** ++ * When this method is called, your block should register all the icons it needs with the given IconRegister. This is ++ * the only chance you get to register icons. ++ */ ++ public void registerIcons(IconRegister par1IconRegister) { ++ this.blockIcon = par1IconRegister.registerIcon(this.getTextureName() + "_disconnected"); ++ this.theIcon = par1IconRegister.registerIcon(this.getTextureName() + "_connected"); + } + + public Icon getStemIcon() { diff --git a/patches/net/minecraft/src/BlockStep.java.patch b/patches/net/minecraft/src/BlockStep.java.patch new file mode 100644 index 0000000..4d21246 --- /dev/null +++ b/patches/net/minecraft/src/BlockStep.java.patch @@ -0,0 +1,105 @@ +--- net/minecraft/src/BlockStep.java ++++ net/minecraft/src/BlockStep.java +@@ -4,52 +4,74 @@ + import java.util.Random; + + public class BlockStep extends BlockHalfSlab { +- public static final String[] b = new String[]{"stone", "sand", "wood", "cobble", "brick", "smoothStoneBrick", "netherBrick", "quartz"}; ++ ++ /** The list of the types of step blocks. */ ++ public static final String[] blockStepTypes = new String[] {"stone", "sand", "wood", "cobble", "brick", "smoothStoneBrick", "netherBrick", "quartz"}; + private Icon theIcon; + +- public BlockStep(int var1, boolean var2) { +- super(var1, var2, Material.rock); ++ public BlockStep(int par1, boolean par2) { ++ super(par1, par2, Material.rock); + this.setCreativeTab(CreativeTabs.tabBlock); + } + +- public Icon getIcon(int var1, int var2) { +- int var3 = var2 & 7; +- if(this.isDoubleSlab && (var2 & 8) != 0) { +- var1 = 1; ++ /** ++ * From the specified side and block metadata retrieves the blocks texture. Args: side, metadata ++ */ ++ public Icon getIcon(int par1, int par2) { ++ int var3 = par2 & 7; ++ ++ if (this.isDoubleSlab && (par2 & 8) != 0) { ++ par1 = 1; + } + +- return var3 == 0 ? (var1 != 1 && var1 != 0 ? this.theIcon : this.blockIcon) : (var3 == 1 ? Block.sandStone.getBlockTextureFromSide(var1) : (var3 == 2 ? Block.planks.getBlockTextureFromSide(var1) : (var3 == 3 ? Block.cobblestone.getBlockTextureFromSide(var1) : (var3 == 4 ? Block.brick.getBlockTextureFromSide(var1) : (var3 == 5 ? Block.stoneBrick.getIcon(var1, 0) : (var3 == 6 ? Block.netherBrick.getBlockTextureFromSide(1) : (var3 == 7 ? Block.blockNetherQuartz.getBlockTextureFromSide(var1) : this.blockIcon))))))); +- } +- +- public void registerIcons(IconRegister var1) { +- this.blockIcon = var1.registerIcon("stone_slab_top"); +- this.theIcon = var1.registerIcon("stone_slab_side"); +- } +- +- public int idDropped(int var1, Random var2, int var3) { ++ return var3 == 0 ? (par1 != 1 && par1 != 0 ? this.theIcon : this.blockIcon) : (var3 == 1 ? Block.sandStone.getBlockTextureFromSide(par1) : (var3 == 2 ? Block.planks.getBlockTextureFromSide(par1) : (var3 == 3 ? Block.cobblestone.getBlockTextureFromSide(par1) : (var3 == 4 ? Block.brick.getBlockTextureFromSide(par1) : (var3 == 5 ? Block.stoneBrick.getIcon(par1, 0) : (var3 == 6 ? Block.netherBrick.getBlockTextureFromSide(1) : (var3 == 7 ? Block.blockNetherQuartz.getBlockTextureFromSide(par1) : this.blockIcon))))))); ++ } ++ ++ /** ++ * When this method is called, your block should register all the icons it needs with the given IconRegister. This is ++ * the only chance you get to register icons. ++ */ ++ public void registerIcons(IconRegister par1IconRegister) { ++ this.blockIcon = par1IconRegister.registerIcon("stone_slab_top"); ++ this.theIcon = par1IconRegister.registerIcon("stone_slab_side"); ++ } ++ ++ /** ++ * Returns the ID of the items to drop on destruction. ++ */ ++ public int idDropped(int par1, Random par2Random, int par3) { + return Block.stoneSingleSlab.blockID; + } + +- protected ItemStack createStackedBlock(int var1) { +- return new ItemStack(Block.stoneSingleSlab.blockID, 2, var1 & 7); ++ /** ++ * Returns an item stack containing a single instance of the current block type. 'i' is the block's subtype/damage and ++ * is ignored for blocks which do not support subtypes. Blocks which cannot be harvested should return null. ++ */ ++ protected ItemStack createStackedBlock(int par1) { ++ return new ItemStack(Block.stoneSingleSlab.blockID, 2, par1 & 7); + } + +- public String getFullSlabName(int var1) { +- if(var1 < 0 || var1 >= b.length) { +- var1 = 0; ++ /** ++ * Returns the slab block name with step type. ++ */ ++ public String getFullSlabName(int par1) { ++ if (par1 < 0 || par1 >= blockStepTypes.length) { ++ par1 = 0; + } + +- return super.getUnlocalizedName() + "." + b[var1]; ++ return super.getUnlocalizedName() + "." + blockStepTypes[par1]; + } + +- public void getSubBlocks(int var1, CreativeTabs var2, List var3) { +- if(var1 != Block.stoneDoubleSlab.blockID) { +- for(int var4 = 0; var4 <= 7; ++var4) { +- if(var4 != 2) { +- var3.add(new ItemStack(var1, 1, var4)); ++ /** ++ * returns a list of blocks with the same ID, but different meta (eg: wood returns 4 blocks) ++ */ ++ public void getSubBlocks(int par1, CreativeTabs par2CreativeTabs, List par3List) { ++ if (par1 != Block.stoneDoubleSlab.blockID) { ++ for (int var4 = 0; var4 <= 7; ++var4) { ++ if (var4 != 2) { ++ par3List.add(new ItemStack(par1, 1, var4)); + } + } +- + } + } + } diff --git a/patches/net/minecraft/src/BlockStone.java.patch b/patches/net/minecraft/src/BlockStone.java.patch new file mode 100644 index 0000000..8b8e6c4 --- /dev/null +++ b/patches/net/minecraft/src/BlockStone.java.patch @@ -0,0 +1,21 @@ +--- net/minecraft/src/BlockStone.java ++++ net/minecraft/src/BlockStone.java +@@ -3,12 +3,15 @@ + import java.util.Random; + + public class BlockStone extends Block { +- public BlockStone(int var1) { +- super(var1, Material.rock); ++ public BlockStone(int par1) { ++ super(par1, Material.rock); + this.setCreativeTab(CreativeTabs.tabBlock); + } + +- public int idDropped(int var1, Random var2, int var3) { ++ /** ++ * Returns the ID of the items to drop on destruction. ++ */ ++ public int idDropped(int par1, Random par2Random, int par3) { + return Block.cobblestone.blockID; + } + } diff --git a/patches/net/minecraft/src/BlockStoneBrick.java.patch b/patches/net/minecraft/src/BlockStoneBrick.java.patch new file mode 100644 index 0000000..1b0e7c9 --- /dev/null +++ b/patches/net/minecraft/src/BlockStoneBrick.java.patch @@ -0,0 +1,91 @@ +--- net/minecraft/src/BlockStoneBrick.java ++++ net/minecraft/src/BlockStoneBrick.java +@@ -3,45 +3,57 @@ + import java.util.List; + + public class BlockStoneBrick extends Block { +- public static final String[] a = new String[]{"default", "mossy", "cracked", "chiseled"}; +- public static final String[] b = new String[]{null, "mossy", "cracked", "carved"}; ++ public static final String[] STONE_BRICK_TYPES = new String[] {"default", "mossy", "cracked", "chiseled"}; ++ public static final String[] field_94407_b = new String[] {null, "mossy", "cracked", "carved"}; + private Icon[] field_94408_c; + +- public BlockStoneBrick(int var1) { +- super(var1, Material.rock); ++ public BlockStoneBrick(int par1) { ++ super(par1, Material.rock); + this.setCreativeTab(CreativeTabs.tabBlock); + } + +- public Icon getIcon(int var1, int var2) { +- if(var2 < 0 || var2 >= b.length) { +- var2 = 0; +- } +- +- return this.field_94408_c[var2]; +- } +- +- public int damageDropped(int var1) { +- return var1; +- } +- +- public void getSubBlocks(int var1, CreativeTabs var2, List var3) { +- for(int var4 = 0; var4 < 4; ++var4) { +- var3.add(new ItemStack(var1, 1, var4)); +- } +- +- } +- +- public void registerIcons(IconRegister var1) { +- this.field_94408_c = new Icon[b.length]; +- +- for(int var2 = 0; var2 < this.field_94408_c.length; ++var2) { ++ /** ++ * From the specified side and block metadata retrieves the blocks texture. Args: side, metadata ++ */ ++ public Icon getIcon(int par1, int par2) { ++ if (par2 < 0 || par2 >= field_94407_b.length) { ++ par2 = 0; ++ } ++ ++ return this.field_94408_c[par2]; ++ } ++ ++ /** ++ * Determines the damage on the item the block drops. Used in cloth and wood. ++ */ ++ public int damageDropped(int par1) { ++ return par1; ++ } ++ ++ /** ++ * returns a list of blocks with the same ID, but different meta (eg: wood returns 4 blocks) ++ */ ++ public void getSubBlocks(int par1, CreativeTabs par2CreativeTabs, List par3List) { ++ for (int var4 = 0; var4 < 4; ++var4) { ++ par3List.add(new ItemStack(par1, 1, var4)); ++ } ++ } ++ ++ /** ++ * When this method is called, your block should register all the icons it needs with the given IconRegister. This is ++ * the only chance you get to register icons. ++ */ ++ public void registerIcons(IconRegister par1IconRegister) { ++ this.field_94408_c = new Icon[field_94407_b.length]; ++ ++ for (int var2 = 0; var2 < this.field_94408_c.length; ++var2) { + String var3 = this.getTextureName(); +- if(b[var2] != null) { +- var3 = var3 + "_" + b[var2]; ++ ++ if (field_94407_b[var2] != null) { ++ var3 = var3 + "_" + field_94407_b[var2]; + } + +- this.field_94408_c[var2] = var1.registerIcon(var3); ++ this.field_94408_c[var2] = par1IconRegister.registerIcon(var3); + } +- + } + } diff --git a/patches/net/minecraft/src/BlockTNT.java.patch b/patches/net/minecraft/src/BlockTNT.java.patch new file mode 100644 index 0000000..8b81576 --- /dev/null +++ b/patches/net/minecraft/src/BlockTNT.java.patch @@ -0,0 +1,180 @@ +--- net/minecraft/src/BlockTNT.java ++++ net/minecraft/src/BlockTNT.java +@@ -6,88 +6,121 @@ + private Icon field_94393_a; + private Icon field_94392_b; + +- public BlockTNT(int var1) { +- super(var1, Material.tnt); ++ public BlockTNT(int par1) { ++ super(par1, Material.tnt); + this.setCreativeTab(CreativeTabs.tabRedstone); + } + +- public Icon getIcon(int var1, int var2) { +- return var1 == 0 ? this.field_94392_b : (var1 == 1 ? this.field_94393_a : this.blockIcon); +- } +- +- public void onBlockAdded(World var1, int var2, int var3, int var4) { +- super.onBlockAdded(var1, var2, var3, var4); +- if(var1.isBlockIndirectlyGettingPowered(var2, var3, var4)) { +- this.onBlockDestroyedByPlayer(var1, var2, var3, var4, 1); +- var1.setBlockToAir(var2, var3, var4); +- } +- +- } +- +- public void onNeighborBlockChange(World var1, int var2, int var3, int var4, int var5) { +- if(var1.isBlockIndirectlyGettingPowered(var2, var3, var4)) { +- this.onBlockDestroyedByPlayer(var1, var2, var3, var4, 1); +- var1.setBlockToAir(var2, var3, var4); +- } +- +- } +- +- public int quantityDropped(Random var1) { ++ /** ++ * From the specified side and block metadata retrieves the blocks texture. Args: side, metadata ++ */ ++ public Icon getIcon(int par1, int par2) { ++ return par1 == 0 ? this.field_94392_b : (par1 == 1 ? this.field_94393_a : this.blockIcon); ++ } ++ ++ /** ++ * Called whenever the block is added into the world. Args: world, x, y, z ++ */ ++ public void onBlockAdded(World par1World, int par2, int par3, int par4) { ++ super.onBlockAdded(par1World, par2, par3, par4); ++ ++ if (par1World.isBlockIndirectlyGettingPowered(par2, par3, par4)) { ++ this.onBlockDestroyedByPlayer(par1World, par2, par3, par4, 1); ++ par1World.setBlockToAir(par2, par3, par4); ++ } ++ } ++ ++ /** ++ * Lets the block know when one of its neighbor changes. Doesn't know which neighbor changed (coordinates passed are ++ * their own) Args: x, y, z, neighbor blockID ++ */ ++ public void onNeighborBlockChange(World par1World, int par2, int par3, int par4, int par5) { ++ if (par1World.isBlockIndirectlyGettingPowered(par2, par3, par4)) { ++ this.onBlockDestroyedByPlayer(par1World, par2, par3, par4, 1); ++ par1World.setBlockToAir(par2, par3, par4); ++ } ++ } ++ ++ /** ++ * Returns the quantity of items to drop on block destruction. ++ */ ++ public int quantityDropped(Random par1Random) { + return 1; + } + +- public void onBlockDestroyedByExplosion(World var1, int var2, int var3, int var4, Explosion var5) { +- if(!var1.isRemote) { +- EntityTNTPrimed var6 = new EntityTNTPrimed(var1, (double)((float)var2 + 0.5F), (double)((float)var3 + 0.5F), (double)((float)var4 + 0.5F), var5.getExplosivePlacedBy()); +- var6.fuse = var1.s.nextInt(var6.fuse / 4) + var6.fuse / 8; +- var1.spawnEntityInWorld(var6); ++ /** ++ * Called upon the block being destroyed by an explosion ++ */ ++ public void onBlockDestroyedByExplosion(World par1World, int par2, int par3, int par4, Explosion par5Explosion) { ++ if (!par1World.isRemote) { ++ EntityTNTPrimed var6 = new EntityTNTPrimed(par1World, (double)((float)par2 + 0.5F), (double)((float)par3 + 0.5F), (double)((float)par4 + 0.5F), par5Explosion.getExplosivePlacedBy()); ++ var6.fuse = par1World.rand.nextInt(var6.fuse / 4) + var6.fuse / 8; ++ par1World.spawnEntityInWorld(var6); + } + } + +- public void onBlockDestroyedByPlayer(World var1, int var2, int var3, int var4, int var5) { +- this.primeTnt(var1, var2, var3, var4, var5, (EntityLivingBase)null); ++ /** ++ * Called right before the block is destroyed by a player. Args: world, x, y, z, metaData ++ */ ++ public void onBlockDestroyedByPlayer(World par1World, int par2, int par3, int par4, int par5) { ++ this.primeTnt(par1World, par2, par3, par4, par5, (EntityLivingBase)null); + } + +- public void primeTnt(World var1, int var2, int var3, int var4, int var5, EntityLivingBase var6) { +- if(!var1.isRemote) { +- if((var5 & 1) == 1) { +- EntityTNTPrimed var7 = new EntityTNTPrimed(var1, (double)((float)var2 + 0.5F), (double)((float)var3 + 0.5F), (double)((float)var4 + 0.5F), var6); +- var1.spawnEntityInWorld(var7); +- var1.playSoundAtEntity(var7, "random.fuse", 1.0F, 1.0F); ++ /** ++ * spawns the primed tnt and plays the fuse sound. ++ */ ++ public void primeTnt(World par1World, int par2, int par3, int par4, int par5, EntityLivingBase par6EntityLivingBase) { ++ if (!par1World.isRemote) { ++ if ((par5 & 1) == 1) { ++ EntityTNTPrimed var7 = new EntityTNTPrimed(par1World, (double)((float)par2 + 0.5F), (double)((float)par3 + 0.5F), (double)((float)par4 + 0.5F), par6EntityLivingBase); ++ par1World.spawnEntityInWorld(var7); ++ par1World.playSoundAtEntity(var7, "random.fuse", 1.0F, 1.0F); + } +- + } + } + +- public boolean onBlockActivated(World var1, int var2, int var3, int var4, EntityPlayer var5, int var6, float var7, float var8, float var9) { +- if(var5.getCurrentEquippedItem() != null && var5.getCurrentEquippedItem().itemID == Item.flintAndSteel.itemID) { +- this.primeTnt(var1, var2, var3, var4, 1, var5); +- var1.setBlockToAir(var2, var3, var4); +- var5.getCurrentEquippedItem().damageItem(1, var5); ++ /** ++ * Called upon block activation (right click on the block.) ++ */ ++ public boolean onBlockActivated(World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer, int par6, float par7, float par8, float par9) { ++ if (par5EntityPlayer.getCurrentEquippedItem() != null && par5EntityPlayer.getCurrentEquippedItem().itemID == Item.flintAndSteel.itemID) { ++ this.primeTnt(par1World, par2, par3, par4, 1, par5EntityPlayer); ++ par1World.setBlockToAir(par2, par3, par4); ++ par5EntityPlayer.getCurrentEquippedItem().damageItem(1, par5EntityPlayer); + return true; + } else { +- return super.onBlockActivated(var1, var2, var3, var4, var5, var6, var7, var8, var9); ++ return super.onBlockActivated(par1World, par2, par3, par4, par5EntityPlayer, par6, par7, par8, par9); + } + } + +- public void onEntityCollidedWithBlock(World var1, int var2, int var3, int var4, Entity var5) { +- if(var5 instanceof EntityArrow && !var1.isRemote) { +- EntityArrow var6 = (EntityArrow)var5; +- if(var6.isBurning()) { +- this.primeTnt(var1, var2, var3, var4, 1, var6.shootingEntity instanceof EntityLivingBase ? (EntityLivingBase)var6.shootingEntity : null); +- var1.setBlockToAir(var2, var3, var4); ++ /** ++ * Triggered whenever an entity collides with this block (enters into the block). Args: world, x, y, z, entity ++ */ ++ public void onEntityCollidedWithBlock(World par1World, int par2, int par3, int par4, Entity par5Entity) { ++ if (par5Entity instanceof EntityArrow && !par1World.isRemote) { ++ EntityArrow var6 = (EntityArrow)par5Entity; ++ ++ if (var6.isBurning()) { ++ this.primeTnt(par1World, par2, par3, par4, 1, var6.shootingEntity instanceof EntityLivingBase ? (EntityLivingBase)var6.shootingEntity : null); ++ par1World.setBlockToAir(par2, par3, par4); + } + } +- + } + +- public boolean canDropFromExplosion(Explosion var1) { ++ /** ++ * Return whether this block can drop from an explosion. ++ */ ++ public boolean canDropFromExplosion(Explosion par1Explosion) { + return false; + } + +- public void registerIcons(IconRegister var1) { +- this.blockIcon = var1.registerIcon(this.getTextureName() + "_side"); +- this.field_94393_a = var1.registerIcon(this.getTextureName() + "_top"); +- this.field_94392_b = var1.registerIcon(this.getTextureName() + "_bottom"); ++ /** ++ * When this method is called, your block should register all the icons it needs with the given IconRegister. This is ++ * the only chance you get to register icons. ++ */ ++ public void registerIcons(IconRegister par1IconRegister) { ++ this.blockIcon = par1IconRegister.registerIcon(this.getTextureName() + "_side"); ++ this.field_94393_a = par1IconRegister.registerIcon(this.getTextureName() + "_top"); ++ this.field_94392_b = par1IconRegister.registerIcon(this.getTextureName() + "_bottom"); + } + } diff --git a/patches/net/minecraft/src/BlockTallGrass.java.patch b/patches/net/minecraft/src/BlockTallGrass.java.patch new file mode 100644 index 0000000..9350c63 --- /dev/null +++ b/patches/net/minecraft/src/BlockTallGrass.java.patch @@ -0,0 +1,153 @@ +--- net/minecraft/src/BlockTallGrass.java ++++ net/minecraft/src/BlockTallGrass.java +@@ -4,21 +4,24 @@ + import java.util.Random; + + public class BlockTallGrass extends BlockFlower { +- private static final String[] a = new String[]{"deadbush", "tallgrass", "fern"}; ++ private static final String[] grassTypes = new String[] {"deadbush", "tallgrass", "fern"}; + private Icon[] iconArray; + +- protected BlockTallGrass(int var1) { +- super(var1, Material.vine); ++ protected BlockTallGrass(int par1) { ++ super(par1, Material.vine); + float var2 = 0.4F; + this.setBlockBounds(0.5F - var2, 0.0F, 0.5F - var2, 0.5F + var2, 0.8F, 0.5F + var2); + } + +- public Icon getIcon(int var1, int var2) { +- if(var2 >= this.iconArray.length) { +- var2 = 0; ++ /** ++ * From the specified side and block metadata retrieves the blocks texture. Args: side, metadata ++ */ ++ public Icon getIcon(int par1, int par2) { ++ if (par2 >= this.iconArray.length) { ++ par2 = 0; + } + +- return this.iconArray[var2]; ++ return this.iconArray[par2]; + } + + public int getBlockColor() { +@@ -27,50 +30,74 @@ + return ColorizerGrass.getGrassColor(var1, var3); + } + +- public int getRenderColor(int var1) { +- return var1 == 0 ? 16777215 : ColorizerFoliage.getFoliageColorBasic(); +- } +- +- public int colorMultiplier(IBlockAccess var1, int var2, int var3, int var4) { +- int var5 = var1.getBlockMetadata(var2, var3, var4); +- return var5 == 0 ? 16777215 : var1.getBiomeGenForCoords(var2, var4).getBiomeGrassColor(); +- } +- +- public int idDropped(int var1, Random var2, int var3) { +- return var2.nextInt(8) == 0 ? Item.seeds.itemID : -1; +- } +- +- public int quantityDroppedWithBonus(int var1, Random var2) { +- return 1 + var2.nextInt(var1 * 2 + 1); +- } +- +- public void harvestBlock(World var1, EntityPlayer var2, int var3, int var4, int var5, int var6) { +- if(!var1.isRemote && var2.getCurrentEquippedItem() != null && var2.getCurrentEquippedItem().itemID == Item.shears.itemID) { +- var2.addStat(StatList.mineBlockStatArray[this.blockID], 1); +- this.dropBlockAsItem_do(var1, var3, var4, var5, new ItemStack(Block.tallGrass, 1, var6)); ++ /** ++ * Returns the color this block should be rendered. Used by leaves. ++ */ ++ public int getRenderColor(int par1) { ++ return par1 == 0 ? 16777215 : ColorizerFoliage.getFoliageColorBasic(); ++ } ++ ++ /** ++ * Returns a integer with hex for 0xrrggbb with this color multiplied against the blocks color. Note only called when ++ * first determining what to render. ++ */ ++ public int colorMultiplier(IBlockAccess par1IBlockAccess, int par2, int par3, int par4) { ++ int var5 = par1IBlockAccess.getBlockMetadata(par2, par3, par4); ++ return var5 == 0 ? 16777215 : par1IBlockAccess.getBiomeGenForCoords(par2, par4).getBiomeGrassColor(); ++ } ++ ++ /** ++ * Returns the ID of the items to drop on destruction. ++ */ ++ public int idDropped(int par1, Random par2Random, int par3) { ++ return par2Random.nextInt(8) == 0 ? Item.seeds.itemID : -1; ++ } ++ ++ /** ++ * Returns the usual quantity dropped by the block plus a bonus of 1 to 'i' (inclusive). ++ */ ++ public int quantityDroppedWithBonus(int par1, Random par2Random) { ++ return 1 + par2Random.nextInt(par1 * 2 + 1); ++ } ++ ++ /** ++ * Called when the player destroys a block with an item that can harvest it. (i, j, k) are the coordinates of the block ++ * and l is the block's subtype/damage. ++ */ ++ public void harvestBlock(World par1World, EntityPlayer par2EntityPlayer, int par3, int par4, int par5, int par6) { ++ if (!par1World.isRemote && par2EntityPlayer.getCurrentEquippedItem() != null && par2EntityPlayer.getCurrentEquippedItem().itemID == Item.shears.itemID) { ++ par2EntityPlayer.addStat(StatList.mineBlockStatArray[this.blockID], 1); ++ this.dropBlockAsItem_do(par1World, par3, par4, par5, new ItemStack(Block.tallGrass, 1, par6)); + } else { +- super.harvestBlock(var1, var2, var3, var4, var5, var6); +- } +- +- } +- +- public int getDamageValue(World var1, int var2, int var3, int var4) { +- return var1.getBlockMetadata(var2, var3, var4); +- } +- +- public void getSubBlocks(int var1, CreativeTabs var2, List var3) { +- for(int var4 = 1; var4 < 3; ++var4) { +- var3.add(new ItemStack(var1, 1, var4)); +- } +- +- } +- +- public void registerIcons(IconRegister var1) { +- this.iconArray = new Icon[a.length]; +- +- for(int var2 = 0; var2 < this.iconArray.length; ++var2) { +- this.iconArray[var2] = var1.registerIcon(a[var2]); +- } +- ++ super.harvestBlock(par1World, par2EntityPlayer, par3, par4, par5, par6); ++ } ++ } ++ ++ /** ++ * Get the block's damage value (for use with pick block). ++ */ ++ public int getDamageValue(World par1World, int par2, int par3, int par4) { ++ return par1World.getBlockMetadata(par2, par3, par4); ++ } ++ ++ /** ++ * returns a list of blocks with the same ID, but different meta (eg: wood returns 4 blocks) ++ */ ++ public void getSubBlocks(int par1, CreativeTabs par2CreativeTabs, List par3List) { ++ for (int var4 = 1; var4 < 3; ++var4) { ++ par3List.add(new ItemStack(par1, 1, var4)); ++ } ++ } ++ ++ /** ++ * When this method is called, your block should register all the icons it needs with the given IconRegister. This is ++ * the only chance you get to register icons. ++ */ ++ public void registerIcons(IconRegister par1IconRegister) { ++ this.iconArray = new Icon[grassTypes.length]; ++ ++ for (int var2 = 0; var2 < this.iconArray.length; ++var2) { ++ this.iconArray[var2] = par1IconRegister.registerIcon(grassTypes[var2]); ++ } + } + } diff --git a/patches/net/minecraft/src/BlockTorch.java.patch b/patches/net/minecraft/src/BlockTorch.java.patch new file mode 100644 index 0000000..2605b78 --- /dev/null +++ b/patches/net/minecraft/src/BlockTorch.java.patch @@ -0,0 +1,339 @@ +--- net/minecraft/src/BlockTorch.java ++++ net/minecraft/src/BlockTorch.java +@@ -3,123 +3,158 @@ + import java.util.Random; + + public class BlockTorch extends Block { +- protected BlockTorch(int var1) { +- super(var1, Material.circuits); ++ protected BlockTorch(int par1) { ++ super(par1, Material.circuits); + this.setTickRandomly(true); + this.setCreativeTab(CreativeTabs.tabDecorations); + } + +- public AxisAlignedBB getCollisionBoundingBoxFromPool(World var1, int var2, int var3, int var4) { ++ /** ++ * Returns a bounding box from the pool of bounding boxes (this means this box can change after the pool has been ++ * cleared to be reused) ++ */ ++ public AxisAlignedBB getCollisionBoundingBoxFromPool(World par1World, int par2, int par3, int par4) { + return null; + } + ++ /** ++ * Is this block (a) opaque and (b) a full 1m cube? This determines whether or not to render the shared face of two ++ * adjacent blocks and also whether the player can attach torches, redstone wire, etc to this block. ++ */ + public boolean isOpaqueCube() { + return false; + } + ++ /** ++ * If this block doesn't render as an ordinary block it will return False (examples: signs, buttons, stairs, etc) ++ */ + public boolean renderAsNormalBlock() { + return false; + } + ++ /** ++ * The type of render function that is called for this block ++ */ + public int getRenderType() { + return 2; + } + +- private boolean canPlaceTorchOn(World var1, int var2, int var3, int var4) { +- if(var1.doesBlockHaveSolidTopSurface(var2, var3, var4)) { ++ /** ++ * Gets if we can place a torch on a block. ++ */ ++ private boolean canPlaceTorchOn(World par1World, int par2, int par3, int par4) { ++ if (par1World.doesBlockHaveSolidTopSurface(par2, par3, par4)) { + return true; + } else { +- int var5 = var1.getBlockId(var2, var3, var4); ++ int var5 = par1World.getBlockId(par2, par3, par4); + return var5 == Block.fence.blockID || var5 == Block.netherFence.blockID || var5 == Block.glass.blockID || var5 == Block.cobblestoneWall.blockID; + } + } + +- public boolean canPlaceBlockAt(World var1, int var2, int var3, int var4) { +- return var1.isBlockNormalCubeDefault(var2 - 1, var3, var4, true) ? true : (var1.isBlockNormalCubeDefault(var2 + 1, var3, var4, true) ? true : (var1.isBlockNormalCubeDefault(var2, var3, var4 - 1, true) ? true : (var1.isBlockNormalCubeDefault(var2, var3, var4 + 1, true) ? true : this.canPlaceTorchOn(var1, var2, var3 - 1, var4)))); ++ /** ++ * Checks to see if its valid to put this block at the specified coordinates. Args: world, x, y, z ++ */ ++ public boolean canPlaceBlockAt(World par1World, int par2, int par3, int par4) { ++ return par1World.isBlockNormalCubeDefault(par2 - 1, par3, par4, true) ? true : (par1World.isBlockNormalCubeDefault(par2 + 1, par3, par4, true) ? true : (par1World.isBlockNormalCubeDefault(par2, par3, par4 - 1, true) ? true : (par1World.isBlockNormalCubeDefault(par2, par3, par4 + 1, true) ? true : this.canPlaceTorchOn(par1World, par2, par3 - 1, par4)))); + } + +- public int onBlockPlaced(World var1, int var2, int var3, int var4, int var5, float var6, float var7, float var8, int var9) { +- int var10 = var9; +- if(var5 == 1 && this.canPlaceTorchOn(var1, var2, var3 - 1, var4)) { ++ /** ++ * Called when a block is placed using its ItemBlock. Args: World, X, Y, Z, side, hitX, hitY, hitZ, block metadata ++ */ ++ public int onBlockPlaced(World par1World, int par2, int par3, int par4, int par5, float par6, float par7, float par8, int par9) { ++ int var10 = par9; ++ ++ if (par5 == 1 && this.canPlaceTorchOn(par1World, par2, par3 - 1, par4)) { + var10 = 5; + } + +- if(var5 == 2 && var1.isBlockNormalCubeDefault(var2, var3, var4 + 1, true)) { ++ if (par5 == 2 && par1World.isBlockNormalCubeDefault(par2, par3, par4 + 1, true)) { + var10 = 4; + } + +- if(var5 == 3 && var1.isBlockNormalCubeDefault(var2, var3, var4 - 1, true)) { ++ if (par5 == 3 && par1World.isBlockNormalCubeDefault(par2, par3, par4 - 1, true)) { + var10 = 3; + } + +- if(var5 == 4 && var1.isBlockNormalCubeDefault(var2 + 1, var3, var4, true)) { ++ if (par5 == 4 && par1World.isBlockNormalCubeDefault(par2 + 1, par3, par4, true)) { + var10 = 2; + } + +- if(var5 == 5 && var1.isBlockNormalCubeDefault(var2 - 1, var3, var4, true)) { ++ if (par5 == 5 && par1World.isBlockNormalCubeDefault(par2 - 1, par3, par4, true)) { + var10 = 1; + } + + return var10; + } + +- public void updateTick(World var1, int var2, int var3, int var4, Random var5) { +- super.updateTick(var1, var2, var3, var4, var5); +- if(var1.getBlockMetadata(var2, var3, var4) == 0) { +- this.onBlockAdded(var1, var2, var3, var4); ++ /** ++ * Ticks the block if it's been scheduled ++ */ ++ public void updateTick(World par1World, int par2, int par3, int par4, Random par5Random) { ++ super.updateTick(par1World, par2, par3, par4, par5Random); ++ ++ if (par1World.getBlockMetadata(par2, par3, par4) == 0) { ++ this.onBlockAdded(par1World, par2, par3, par4); + } +- + } + +- public void onBlockAdded(World var1, int var2, int var3, int var4) { +- if(var1.getBlockMetadata(var2, var3, var4) == 0) { +- if(var1.isBlockNormalCubeDefault(var2 - 1, var3, var4, true)) { +- var1.setBlockMetadata(var2, var3, var4, 1, 2); +- } else if(var1.isBlockNormalCubeDefault(var2 + 1, var3, var4, true)) { +- var1.setBlockMetadata(var2, var3, var4, 2, 2); +- } else if(var1.isBlockNormalCubeDefault(var2, var3, var4 - 1, true)) { +- var1.setBlockMetadata(var2, var3, var4, 3, 2); +- } else if(var1.isBlockNormalCubeDefault(var2, var3, var4 + 1, true)) { +- var1.setBlockMetadata(var2, var3, var4, 4, 2); +- } else if(this.canPlaceTorchOn(var1, var2, var3 - 1, var4)) { +- var1.setBlockMetadata(var2, var3, var4, 5, 2); ++ /** ++ * Called whenever the block is added into the world. Args: world, x, y, z ++ */ ++ public void onBlockAdded(World par1World, int par2, int par3, int par4) { ++ if (par1World.getBlockMetadata(par2, par3, par4) == 0) { ++ if (par1World.isBlockNormalCubeDefault(par2 - 1, par3, par4, true)) { ++ par1World.setBlockMetadataWithNotify(par2, par3, par4, 1, 2); ++ } else if (par1World.isBlockNormalCubeDefault(par2 + 1, par3, par4, true)) { ++ par1World.setBlockMetadataWithNotify(par2, par3, par4, 2, 2); ++ } else if (par1World.isBlockNormalCubeDefault(par2, par3, par4 - 1, true)) { ++ par1World.setBlockMetadataWithNotify(par2, par3, par4, 3, 2); ++ } else if (par1World.isBlockNormalCubeDefault(par2, par3, par4 + 1, true)) { ++ par1World.setBlockMetadataWithNotify(par2, par3, par4, 4, 2); ++ } else if (this.canPlaceTorchOn(par1World, par2, par3 - 1, par4)) { ++ par1World.setBlockMetadataWithNotify(par2, par3, par4, 5, 2); + } + } + +- this.dropTorchIfCantStay(var1, var2, var3, var4); +- } +- +- public void onNeighborBlockChange(World var1, int var2, int var3, int var4, int var5) { +- this.func_94397_d(var1, var2, var3, var4, var5); +- } +- +- protected boolean func_94397_d(World var1, int var2, int var3, int var4, int var5) { +- if(this.dropTorchIfCantStay(var1, var2, var3, var4)) { +- int var6 = var1.getBlockMetadata(var2, var3, var4); ++ this.dropTorchIfCantStay(par1World, par2, par3, par4); ++ } ++ ++ /** ++ * Lets the block know when one of its neighbor changes. Doesn't know which neighbor changed (coordinates passed are ++ * their own) Args: x, y, z, neighbor blockID ++ */ ++ public void onNeighborBlockChange(World par1World, int par2, int par3, int par4, int par5) { ++ this.func_94397_d(par1World, par2, par3, par4, par5); ++ } ++ ++ protected boolean func_94397_d(World par1World, int par2, int par3, int par4, int par5) { ++ if (this.dropTorchIfCantStay(par1World, par2, par3, par4)) { ++ int var6 = par1World.getBlockMetadata(par2, par3, par4); + boolean var7 = false; +- if(!var1.isBlockNormalCubeDefault(var2 - 1, var3, var4, true) && var6 == 1) { +- var7 = true; +- } +- +- if(!var1.isBlockNormalCubeDefault(var2 + 1, var3, var4, true) && var6 == 2) { +- var7 = true; +- } +- +- if(!var1.isBlockNormalCubeDefault(var2, var3, var4 - 1, true) && var6 == 3) { +- var7 = true; +- } +- +- if(!var1.isBlockNormalCubeDefault(var2, var3, var4 + 1, true) && var6 == 4) { +- var7 = true; +- } +- +- if(!this.canPlaceTorchOn(var1, var2, var3 - 1, var4) && var6 == 5) { +- var7 = true; +- } +- +- if(var7) { +- this.dropBlockAsItem(var1, var2, var3, var4, var1.getBlockMetadata(var2, var3, var4), 0); +- var1.setBlockToAir(var2, var3, var4); ++ ++ if (!par1World.isBlockNormalCubeDefault(par2 - 1, par3, par4, true) && var6 == 1) { ++ var7 = true; ++ } ++ ++ if (!par1World.isBlockNormalCubeDefault(par2 + 1, par3, par4, true) && var6 == 2) { ++ var7 = true; ++ } ++ ++ if (!par1World.isBlockNormalCubeDefault(par2, par3, par4 - 1, true) && var6 == 3) { ++ var7 = true; ++ } ++ ++ if (!par1World.isBlockNormalCubeDefault(par2, par3, par4 + 1, true) && var6 == 4) { ++ var7 = true; ++ } ++ ++ if (!this.canPlaceTorchOn(par1World, par2, par3 - 1, par4) && var6 == 5) { ++ var7 = true; ++ } ++ ++ if (var7) { ++ this.dropBlockAsItem(par1World, par2, par3, par4, par1World.getBlockMetadata(par2, par3, par4), 0); ++ par1World.setBlockToAir(par2, par3, par4); + return true; + } else { + return false; +@@ -129,11 +164,15 @@ + } + } + +- protected boolean dropTorchIfCantStay(World var1, int var2, int var3, int var4) { +- if(!this.canPlaceBlockAt(var1, var2, var3, var4)) { +- if(var1.getBlockId(var2, var3, var4) == this.blockID) { +- this.dropBlockAsItem(var1, var2, var3, var4, var1.getBlockMetadata(var2, var3, var4), 0); +- var1.setBlockToAir(var2, var3, var4); ++ /** ++ * Tests if the block can remain at its current location and will drop as an item if it is unable to stay. Returns True ++ * if it can stay and False if it drops. Args: world, x, y, z ++ */ ++ protected boolean dropTorchIfCantStay(World par1World, int par2, int par3, int par4) { ++ if (!this.canPlaceBlockAt(par1World, par2, par3, par4)) { ++ if (par1World.getBlockId(par2, par3, par4) == this.blockID) { ++ this.dropBlockAsItem(par1World, par2, par3, par4, par1World.getBlockMetadata(par2, par3, par4), 0); ++ par1World.setBlockToAir(par2, par3, par4); + } + + return false; +@@ -142,48 +181,62 @@ + } + } + +- public MovingObjectPosition collisionRayTrace(World var1, int var2, int var3, int var4, Vec3 var5, Vec3 var6) { +- int var7 = var1.getBlockMetadata(var2, var3, var4) & 7; ++ /** ++ * Ray traces through the blocks collision from start vector to end vector returning a ray trace hit. Args: world, x, ++ * y, z, startVec, endVec ++ */ ++ public MovingObjectPosition collisionRayTrace(World par1World, int par2, int par3, int par4, Vec3 par5Vec3, Vec3 par6Vec3) { ++ int var7 = par1World.getBlockMetadata(par2, par3, par4) & 7; + float var8 = 0.15F; +- if(var7 == 1) { ++ ++ if (var7 == 1) { + this.setBlockBounds(0.0F, 0.2F, 0.5F - var8, var8 * 2.0F, 0.8F, 0.5F + var8); +- } else if(var7 == 2) { ++ } else if (var7 == 2) { + this.setBlockBounds(1.0F - var8 * 2.0F, 0.2F, 0.5F - var8, 1.0F, 0.8F, 0.5F + var8); +- } else if(var7 == 3) { ++ } else if (var7 == 3) { + this.setBlockBounds(0.5F - var8, 0.2F, 0.0F, 0.5F + var8, 0.8F, var8 * 2.0F); +- } else if(var7 == 4) { ++ } else if (var7 == 4) { + this.setBlockBounds(0.5F - var8, 0.2F, 1.0F - var8 * 2.0F, 0.5F + var8, 0.8F, 1.0F); + } else { + var8 = 0.1F; + this.setBlockBounds(0.5F - var8, 0.0F, 0.5F - var8, 0.5F + var8, 0.6F, 0.5F + var8); + } + +- return super.collisionRayTrace(var1, var2, var3, var4, var5, var6); ++ return super.collisionRayTrace(par1World, par2, par3, par4, par5Vec3, par6Vec3); + } + +- public void randomDisplayTick(World var1, int var2, int var3, int var4, Random var5) { +- int var6 = var1.getBlockMetadata(var2, var3, var4); +- double var7 = (double)((float)var2 + 0.5F); +- double var9 = (double)((float)var3 + 0.7F); +- double var11 = (double)((float)var4 + 0.5F); +- double var13 = (double)0.22F; +- double var15 = (double)0.27F; +- if(var6 == 1) { +- var1.spawnParticle("smoke", var7 - var15, var9 + var13, var11, 0.0D, 0.0D, 0.0D); +- var1.spawnParticle("flame", var7 - var15, var9 + var13, var11, 0.0D, 0.0D, 0.0D); +- } else if(var6 == 2) { +- var1.spawnParticle("smoke", var7 + var15, var9 + var13, var11, 0.0D, 0.0D, 0.0D); +- var1.spawnParticle("flame", var7 + var15, var9 + var13, var11, 0.0D, 0.0D, 0.0D); +- } else if(var6 == 3) { +- var1.spawnParticle("smoke", var7, var9 + var13, var11 - var15, 0.0D, 0.0D, 0.0D); +- var1.spawnParticle("flame", var7, var9 + var13, var11 - var15, 0.0D, 0.0D, 0.0D); +- } else if(var6 == 4) { +- var1.spawnParticle("smoke", var7, var9 + var13, var11 + var15, 0.0D, 0.0D, 0.0D); +- var1.spawnParticle("flame", var7, var9 + var13, var11 + var15, 0.0D, 0.0D, 0.0D); ++ /** ++ * A randomly called display update to be able to add particles or other items for display ++ */ ++ public void randomDisplayTick(World par1World, int par2, int par3, int par4, Random par5Random) { ++ // Spout Start - Custom blocks ++ Chunk c = par1World.getChunkFromBlockCoords(par2, par4); ++ if (c.spoutChunk.getCustomBlockId(par2, par3, par4) > 0) { ++ return; ++ } ++ // Spout End ++ int var6 = par1World.getBlockMetadata(par2, par3, par4); ++ double var7 = (double)((float)par2 + 0.5F); ++ double var9 = (double)((float)par3 + 0.7F); ++ double var11 = (double)((float)par4 + 0.5F); ++ double var13 = 0.2199999988079071D; ++ double var15 = 0.27000001072883606D; ++ ++ if (var6 == 1) { ++ par1World.spawnParticle("smoke", var7 - var15, var9 + var13, var11, 0.0D, 0.0D, 0.0D); ++ par1World.spawnParticle("flame", var7 - var15, var9 + var13, var11, 0.0D, 0.0D, 0.0D); ++ } else if (var6 == 2) { ++ par1World.spawnParticle("smoke", var7 + var15, var9 + var13, var11, 0.0D, 0.0D, 0.0D); ++ par1World.spawnParticle("flame", var7 + var15, var9 + var13, var11, 0.0D, 0.0D, 0.0D); ++ } else if (var6 == 3) { ++ par1World.spawnParticle("smoke", var7, var9 + var13, var11 - var15, 0.0D, 0.0D, 0.0D); ++ par1World.spawnParticle("flame", var7, var9 + var13, var11 - var15, 0.0D, 0.0D, 0.0D); ++ } else if (var6 == 4) { ++ par1World.spawnParticle("smoke", var7, var9 + var13, var11 + var15, 0.0D, 0.0D, 0.0D); ++ par1World.spawnParticle("flame", var7, var9 + var13, var11 + var15, 0.0D, 0.0D, 0.0D); + } else { +- var1.spawnParticle("smoke", var7, var9, var11, 0.0D, 0.0D, 0.0D); +- var1.spawnParticle("flame", var7, var9, var11, 0.0D, 0.0D, 0.0D); ++ par1World.spawnParticle("smoke", var7, var9, var11, 0.0D, 0.0D, 0.0D); ++ par1World.spawnParticle("flame", var7, var9, var11, 0.0D, 0.0D, 0.0D); + } +- + } + } diff --git a/patches/net/minecraft/src/BlockTrapDoor.java.patch b/patches/net/minecraft/src/BlockTrapDoor.java.patch new file mode 100644 index 0000000..417a458 --- /dev/null +++ b/patches/net/minecraft/src/BlockTrapDoor.java.patch @@ -0,0 +1,349 @@ +--- net/minecraft/src/BlockTrapDoor.java ++++ net/minecraft/src/BlockTrapDoor.java +@@ -1,199 +1,248 @@ + package net.minecraft.src; + + public class BlockTrapDoor extends Block { +- protected BlockTrapDoor(int var1, Material var2) { +- super(var1, var2); ++ protected BlockTrapDoor(int par1, Material par2Material) { ++ super(par1, par2Material); + float var3 = 0.5F; + float var4 = 1.0F; + this.setBlockBounds(0.5F - var3, 0.0F, 0.5F - var3, 0.5F + var3, var4, 0.5F + var3); + this.setCreativeTab(CreativeTabs.tabRedstone); + } + ++ /** ++ * Is this block (a) opaque and (b) a full 1m cube? This determines whether or not to render the shared face of two ++ * adjacent blocks and also whether the player can attach torches, redstone wire, etc to this block. ++ */ + public boolean isOpaqueCube() { + return false; + } + ++ /** ++ * If this block doesn't render as an ordinary block it will return False (examples: signs, buttons, stairs, etc) ++ */ + public boolean renderAsNormalBlock() { + return false; + } + +- public boolean getBlocksMovement(IBlockAccess var1, int var2, int var3, int var4) { +- return !isTrapdoorOpen(var1.getBlockMetadata(var2, var3, var4)); ++ public boolean getBlocksMovement(IBlockAccess par1IBlockAccess, int par2, int par3, int par4) { ++ return !isTrapdoorOpen(par1IBlockAccess.getBlockMetadata(par2, par3, par4)); + } + ++ /** ++ * The type of render function that is called for this block ++ */ + public int getRenderType() { + return 0; + } + +- public AxisAlignedBB getSelectedBoundingBoxFromPool(World var1, int var2, int var3, int var4) { +- this.setBlockBoundsBasedOnState(var1, var2, var3, var4); +- return super.getSelectedBoundingBoxFromPool(var1, var2, var3, var4); +- } +- +- public AxisAlignedBB getCollisionBoundingBoxFromPool(World var1, int var2, int var3, int var4) { +- this.setBlockBoundsBasedOnState(var1, var2, var3, var4); +- return super.getCollisionBoundingBoxFromPool(var1, var2, var3, var4); +- } +- +- public void setBlockBoundsBasedOnState(IBlockAccess var1, int var2, int var3, int var4) { +- this.setBlockBoundsForBlockRender(var1.getBlockMetadata(var2, var3, var4)); +- } +- ++ /** ++ * Returns the bounding box of the wired rectangular prism to render. ++ */ ++ public AxisAlignedBB getSelectedBoundingBoxFromPool(World par1World, int par2, int par3, int par4) { ++ this.setBlockBoundsBasedOnState(par1World, par2, par3, par4); ++ return super.getSelectedBoundingBoxFromPool(par1World, par2, par3, par4); ++ } ++ ++ /** ++ * Returns a bounding box from the pool of bounding boxes (this means this box can change after the pool has been ++ * cleared to be reused) ++ */ ++ public AxisAlignedBB getCollisionBoundingBoxFromPool(World par1World, int par2, int par3, int par4) { ++ this.setBlockBoundsBasedOnState(par1World, par2, par3, par4); ++ return super.getCollisionBoundingBoxFromPool(par1World, par2, par3, par4); ++ } ++ ++ /** ++ * Updates the blocks bounds based on its current state. Args: world, x, y, z ++ */ ++ public void setBlockBoundsBasedOnState(IBlockAccess par1IBlockAccess, int par2, int par3, int par4) { ++ this.setBlockBoundsForBlockRender(par1IBlockAccess.getBlockMetadata(par2, par3, par4)); ++ } ++ ++ /** ++ * Sets the block's bounds for rendering it as an item ++ */ + public void setBlockBoundsForItemRender() { +- float var1 = 3.0F / 16.0F; ++ float var1 = 0.1875F; + this.setBlockBounds(0.0F, 0.5F - var1 / 2.0F, 0.0F, 1.0F, 0.5F + var1 / 2.0F, 1.0F); + } + +- public void setBlockBoundsForBlockRender(int var1) { +- float var2 = 3.0F / 16.0F; +- if((var1 & 8) != 0) { ++ public void setBlockBoundsForBlockRender(int par1) { ++ float var2 = 0.1875F; ++ ++ if ((par1 & 8) != 0) { + this.setBlockBounds(0.0F, 1.0F - var2, 0.0F, 1.0F, 1.0F, 1.0F); + } else { + this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, var2, 1.0F); + } + +- if(isTrapdoorOpen(var1)) { +- if((var1 & 3) == 0) { ++ if (isTrapdoorOpen(par1)) { ++ if ((par1 & 3) == 0) { + this.setBlockBounds(0.0F, 0.0F, 1.0F - var2, 1.0F, 1.0F, 1.0F); + } + +- if((var1 & 3) == 1) { ++ if ((par1 & 3) == 1) { + this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, var2); + } + +- if((var1 & 3) == 2) { ++ if ((par1 & 3) == 2) { + this.setBlockBounds(1.0F - var2, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F); + } + +- if((var1 & 3) == 3) { ++ if ((par1 & 3) == 3) { + this.setBlockBounds(0.0F, 0.0F, 0.0F, var2, 1.0F, 1.0F); + } + } +- +- } +- +- public void onBlockClicked(World var1, int var2, int var3, int var4, EntityPlayer var5) { +- } +- +- public boolean onBlockActivated(World var1, int var2, int var3, int var4, EntityPlayer var5, int var6, float var7, float var8, float var9) { +- if(this.blockMaterial == Material.iron) { ++ } ++ ++ /** ++ * Called when the block is clicked by a player. Args: x, y, z, entityPlayer ++ */ ++ public void onBlockClicked(World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer) {} ++ ++ /** ++ * Called upon block activation (right click on the block.) ++ */ ++ public boolean onBlockActivated(World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer, int par6, float par7, float par8, float par9) { ++ if (this.blockMaterial == Material.iron) { + return true; + } else { +- int var10 = var1.getBlockMetadata(var2, var3, var4); +- var1.setBlockMetadata(var2, var3, var4, var10 ^ 4, 2); +- var1.playAuxSFXAtEntity(var5, 1003, var2, var3, var4, 0); ++ int var10 = par1World.getBlockMetadata(par2, par3, par4); ++ par1World.setBlockMetadataWithNotify(par2, par3, par4, var10 ^ 4, 2); ++ par1World.playAuxSFXAtEntity(par5EntityPlayer, 1003, par2, par3, par4, 0); + return true; + } + } + +- public void onPoweredBlockChange(World var1, int var2, int var3, int var4, boolean var5) { +- int var6 = var1.getBlockMetadata(var2, var3, var4); ++ public void onPoweredBlockChange(World par1World, int par2, int par3, int par4, boolean par5) { ++ int var6 = par1World.getBlockMetadata(par2, par3, par4); + boolean var7 = (var6 & 4) > 0; +- if(var7 != var5) { +- var1.setBlockMetadata(var2, var3, var4, var6 ^ 4, 2); +- var1.playAuxSFXAtEntity((EntityPlayer)null, 1003, var2, var3, var4, 0); ++ ++ if (var7 != par5) { ++ par1World.setBlockMetadataWithNotify(par2, par3, par4, var6 ^ 4, 2); ++ par1World.playAuxSFXAtEntity((EntityPlayer)null, 1003, par2, par3, par4, 0); + } + } + +- public void onNeighborBlockChange(World var1, int var2, int var3, int var4, int var5) { +- if(!var1.isRemote) { +- int var6 = var1.getBlockMetadata(var2, var3, var4); +- int var7 = var2; +- int var8 = var4; +- if((var6 & 3) == 0) { +- var8 = var4 + 1; ++ /** ++ * Lets the block know when one of its neighbor changes. Doesn't know which neighbor changed (coordinates passed are ++ * their own) Args: x, y, z, neighbor blockID ++ */ ++ public void onNeighborBlockChange(World par1World, int par2, int par3, int par4, int par5) { ++ if (!par1World.isRemote) { ++ int var6 = par1World.getBlockMetadata(par2, par3, par4); ++ int var7 = par2; ++ int var8 = par4; ++ ++ if ((var6 & 3) == 0) { ++ var8 = par4 + 1; + } + +- if((var6 & 3) == 1) { ++ if ((var6 & 3) == 1) { + --var8; + } + +- if((var6 & 3) == 2) { +- var7 = var2 + 1; ++ if ((var6 & 3) == 2) { ++ var7 = par2 + 1; + } + +- if((var6 & 3) == 3) { ++ if ((var6 & 3) == 3) { + --var7; + } + +- if(!isValidSupportBlock(var1.getBlockId(var7, var3, var8))) { +- var1.setBlockToAir(var2, var3, var4); +- this.dropBlockAsItem(var1, var2, var3, var4, var6, 0); +- } +- +- boolean var9 = var1.isBlockIndirectlyGettingPowered(var2, var3, var4); +- if(var9 || var5 > 0 && Block.blocksList[var5].canProvidePower()) { +- this.onPoweredBlockChange(var1, var2, var3, var4, var9); +- } +- ++ if (!isValidSupportBlock(par1World.getBlockId(var7, par3, var8))) { ++ par1World.setBlockToAir(par2, par3, par4); ++ this.dropBlockAsItem(par1World, par2, par3, par4, var6, 0); ++ } ++ ++ boolean var9 = par1World.isBlockIndirectlyGettingPowered(par2, par3, par4); ++ ++ if (var9 || par5 > 0 && Block.blocksList[par5].canProvidePower()) { ++ this.onPoweredBlockChange(par1World, par2, par3, par4, var9); ++ } + } + } + +- public MovingObjectPosition collisionRayTrace(World var1, int var2, int var3, int var4, Vec3 var5, Vec3 var6) { +- this.setBlockBoundsBasedOnState(var1, var2, var3, var4); +- return super.collisionRayTrace(var1, var2, var3, var4, var5, var6); ++ /** ++ * Ray traces through the blocks collision from start vector to end vector returning a ray trace hit. Args: world, x, ++ * y, z, startVec, endVec ++ */ ++ public MovingObjectPosition collisionRayTrace(World par1World, int par2, int par3, int par4, Vec3 par5Vec3, Vec3 par6Vec3) { ++ this.setBlockBoundsBasedOnState(par1World, par2, par3, par4); ++ return super.collisionRayTrace(par1World, par2, par3, par4, par5Vec3, par6Vec3); + } + +- public int onBlockPlaced(World var1, int var2, int var3, int var4, int var5, float var6, float var7, float var8, int var9) { ++ /** ++ * Called when a block is placed using its ItemBlock. Args: World, X, Y, Z, side, hitX, hitY, hitZ, block metadata ++ */ ++ public int onBlockPlaced(World par1World, int par2, int par3, int par4, int par5, float par6, float par7, float par8, int par9) { + int var10 = 0; +- if(var5 == 2) { ++ ++ if (par5 == 2) { + var10 = 0; + } + +- if(var5 == 3) { ++ if (par5 == 3) { + var10 = 1; + } + +- if(var5 == 4) { ++ if (par5 == 4) { + var10 = 2; + } + +- if(var5 == 5) { ++ if (par5 == 5) { + var10 = 3; + } + +- if(var5 != 1 && var5 != 0 && var7 > 0.5F) { ++ if (par5 != 1 && par5 != 0 && par7 > 0.5F) { + var10 |= 8; + } + + return var10; + } + +- public boolean canPlaceBlockOnSide(World var1, int var2, int var3, int var4, int var5) { +- if(var5 == 0) { ++ /** ++ * checks to see if you can place this block can be placed on that side of a block: BlockLever overrides ++ */ ++ public boolean canPlaceBlockOnSide(World par1World, int par2, int par3, int par4, int par5) { ++ if (par5 == 0) { + return false; +- } else if(var5 == 1) { ++ } else if (par5 == 1) { + return false; + } else { +- if(var5 == 2) { +- ++var4; +- } +- +- if(var5 == 3) { +- --var4; +- } +- +- if(var5 == 4) { +- ++var2; +- } +- +- if(var5 == 5) { +- --var2; +- } +- +- return isValidSupportBlock(var1.getBlockId(var2, var3, var4)); ++ if (par5 == 2) { ++ ++par4; ++ } ++ ++ if (par5 == 3) { ++ --par4; ++ } ++ ++ if (par5 == 4) { ++ ++par2; ++ } ++ ++ if (par5 == 5) { ++ --par2; ++ } ++ ++ return isValidSupportBlock(par1World.getBlockId(par2, par3, par4)); + } + } + +- public static boolean isTrapdoorOpen(int var0) { +- return (var0 & 4) != 0; ++ public static boolean isTrapdoorOpen(int par0) { ++ return (par0 & 4) != 0; + } + +- private static boolean isValidSupportBlock(int var0) { +- if(var0 <= 0) { ++ /** ++ * Checks if the block ID is a valid support block for the trap door to connect with. If it is not the trapdoor is ++ * dropped into the world. ++ */ ++ private static boolean isValidSupportBlock(int par0) { ++ if (par0 <= 0) { + return false; + } else { +- Block var1 = Block.blocksList[var0]; ++ Block var1 = Block.blocksList[par0]; + return var1 != null && var1.blockMaterial.isOpaque() && var1.renderAsNormalBlock() || var1 == Block.glowStone || var1 instanceof BlockHalfSlab || var1 instanceof BlockStairs; + } + } diff --git a/patches/net/minecraft/src/BlockTripWire.java.patch b/patches/net/minecraft/src/BlockTripWire.java.patch new file mode 100644 index 0000000..bf42c43 --- /dev/null +++ b/patches/net/minecraft/src/BlockTripWire.java.patch @@ -0,0 +1,341 @@ +--- net/minecraft/src/BlockTripWire.java ++++ net/minecraft/src/BlockTripWire.java +@@ -5,174 +5,232 @@ + import java.util.Random; + + public class BlockTripWire extends Block { +- public BlockTripWire(int var1) { +- super(var1, Material.circuits); ++ public BlockTripWire(int par1) { ++ super(par1, Material.circuits); + this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.15625F, 1.0F); + this.setTickRandomly(true); + } + +- public int tickRate(World var1) { ++ /** ++ * How many world ticks before ticking ++ */ ++ public int tickRate(World par1World) { + return 10; + } + +- public AxisAlignedBB getCollisionBoundingBoxFromPool(World var1, int var2, int var3, int var4) { ++ /** ++ * Returns a bounding box from the pool of bounding boxes (this means this box can change after the pool has been ++ * cleared to be reused) ++ */ ++ public AxisAlignedBB getCollisionBoundingBoxFromPool(World par1World, int par2, int par3, int par4) { + return null; + } + ++ /** ++ * Is this block (a) opaque and (b) a full 1m cube? This determines whether or not to render the shared face of two ++ * adjacent blocks and also whether the player can attach torches, redstone wire, etc to this block. ++ */ + public boolean isOpaqueCube() { + return false; + } + ++ /** ++ * If this block doesn't render as an ordinary block it will return False (examples: signs, buttons, stairs, etc) ++ */ + public boolean renderAsNormalBlock() { + return false; + } + ++ /** ++ * Returns which pass should this block be rendered on. 0 for solids and 1 for alpha ++ */ + public int getRenderBlockPass() { + return 1; + } + ++ /** ++ * The type of render function that is called for this block ++ */ + public int getRenderType() { + return 30; + } + +- public int idDropped(int var1, Random var2, int var3) { +- return Item.silk.itemID; +- } +- +- public int idPicked(World var1, int var2, int var3, int var4) { +- return Item.silk.itemID; +- } +- +- public void onNeighborBlockChange(World var1, int var2, int var3, int var4, int var5) { +- int var6 = var1.getBlockMetadata(var2, var3, var4); ++ /** ++ * Returns the ID of the items to drop on destruction. ++ */ ++ public int idDropped(int par1, Random par2Random, int par3) { ++ return Item.silk.itemID; ++ } ++ ++ /** ++ * only called by clickMiddleMouseButton , and passed to inventory.setCurrentItem (along with isCreative) ++ */ ++ public int idPicked(World par1World, int par2, int par3, int par4) { ++ return Item.silk.itemID; ++ } ++ ++ /** ++ * Lets the block know when one of its neighbor changes. Doesn't know which neighbor changed (coordinates passed are ++ * their own) Args: x, y, z, neighbor blockID ++ */ ++ public void onNeighborBlockChange(World par1World, int par2, int par3, int par4, int par5) { ++ int var6 = par1World.getBlockMetadata(par2, par3, par4); + boolean var7 = (var6 & 2) == 2; +- boolean var8 = !var1.doesBlockHaveSolidTopSurface(var2, var3 - 1, var4); +- if(var7 != var8) { +- this.dropBlockAsItem(var1, var2, var3, var4, var6, 0); +- var1.setBlockToAir(var2, var3, var4); ++ boolean var8 = !par1World.doesBlockHaveSolidTopSurface(par2, par3 - 1, par4); ++ ++ if (var7 != var8) { ++ this.dropBlockAsItem(par1World, par2, par3, par4, var6, 0); ++ par1World.setBlockToAir(par2, par3, par4); + } +- + } + +- public void setBlockBoundsBasedOnState(IBlockAccess var1, int var2, int var3, int var4) { +- int var5 = var1.getBlockMetadata(var2, var3, var4); ++ /** ++ * Updates the blocks bounds based on its current state. Args: world, x, y, z ++ */ ++ public void setBlockBoundsBasedOnState(IBlockAccess par1IBlockAccess, int par2, int par3, int par4) { ++ int var5 = par1IBlockAccess.getBlockMetadata(par2, par3, par4); + boolean var6 = (var5 & 4) == 4; + boolean var7 = (var5 & 2) == 2; +- if(!var7) { ++ ++ if (!var7) { + this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.09375F, 1.0F); +- } else if(!var6) { ++ } else if (!var6) { + this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.5F, 1.0F); + } else { +- this.setBlockBounds(0.0F, 1.0F / 16.0F, 0.0F, 1.0F, 0.15625F, 1.0F); ++ this.setBlockBounds(0.0F, 0.0625F, 0.0F, 1.0F, 0.15625F, 1.0F); + } +- +- } +- +- public void onBlockAdded(World var1, int var2, int var3, int var4) { +- int var5 = var1.doesBlockHaveSolidTopSurface(var2, var3 - 1, var4) ? 0 : 2; +- var1.setBlockMetadata(var2, var3, var4, var5, 3); +- this.func_72149_e(var1, var2, var3, var4, var5); +- } +- +- public void breakBlock(World var1, int var2, int var3, int var4, int var5, int var6) { +- this.func_72149_e(var1, var2, var3, var4, var6 | 1); +- } +- +- public void onBlockHarvested(World var1, int var2, int var3, int var4, int var5, EntityPlayer var6) { +- if(!var1.isRemote) { +- if(var6.getCurrentEquippedItem() != null && var6.getCurrentEquippedItem().itemID == Item.shears.itemID) { +- var1.setBlockMetadata(var2, var3, var4, var5 | 8, 4); ++ } ++ ++ /** ++ * Called whenever the block is added into the world. Args: world, x, y, z ++ */ ++ public void onBlockAdded(World par1World, int par2, int par3, int par4) { ++ int var5 = par1World.doesBlockHaveSolidTopSurface(par2, par3 - 1, par4) ? 0 : 2; ++ par1World.setBlockMetadataWithNotify(par2, par3, par4, var5, 3); ++ this.func_72149_e(par1World, par2, par3, par4, var5); ++ } ++ ++ /** ++ * Called on server worlds only when the block has been replaced by a different block ID, or the same block with a ++ * different metadata value, but before the new metadata value is set. Args: World, x, y, z, old block ID, old metadata ++ */ ++ public void breakBlock(World par1World, int par2, int par3, int par4, int par5, int par6) { ++ this.func_72149_e(par1World, par2, par3, par4, par6 | 1); ++ } ++ ++ /** ++ * Called when the block is attempted to be harvested ++ */ ++ public void onBlockHarvested(World par1World, int par2, int par3, int par4, int par5, EntityPlayer par6EntityPlayer) { ++ if (!par1World.isRemote) { ++ if (par6EntityPlayer.getCurrentEquippedItem() != null && par6EntityPlayer.getCurrentEquippedItem().itemID == Item.shears.itemID) { ++ par1World.setBlockMetadataWithNotify(par2, par3, par4, par5 | 8, 4); + } +- + } + } + +- private void func_72149_e(World var1, int var2, int var3, int var4, int var5) { +- for(int var6 = 0; var6 < 2; ++var6) { +- for(int var7 = 1; var7 < 42; ++var7) { +- int var8 = var2 + Direction.offsetX[var6] * var7; +- int var9 = var4 + Direction.offsetZ[var6] * var7; +- int var10 = var1.getBlockId(var8, var3, var9); +- if(var10 == Block.tripWireSource.blockID) { +- int var11 = var1.getBlockMetadata(var8, var3, var9) & 3; +- if(var11 == Direction.rotateOpposite[var6]) { +- Block.tripWireSource.func_72143_a(var1, var8, var3, var9, var10, var1.getBlockMetadata(var8, var3, var9), true, var7, var5); ++ private void func_72149_e(World par1World, int par2, int par3, int par4, int par5) { ++ int var6 = 0; ++ ++ while (var6 < 2) { ++ int var7 = 1; ++ ++ while (true) { ++ if (var7 < 42) { ++ int var8 = par2 + Direction.offsetX[var6] * var7; ++ int var9 = par4 + Direction.offsetZ[var6] * var7; ++ int var10 = par1World.getBlockId(var8, par3, var9); ++ ++ if (var10 == Block.tripWireSource.blockID) { ++ int var11 = par1World.getBlockMetadata(var8, par3, var9) & 3; ++ ++ if (var11 == Direction.rotateOpposite[var6]) { ++ Block.tripWireSource.func_72143_a(par1World, var8, par3, var9, var10, par1World.getBlockMetadata(var8, par3, var9), true, var7, par5); ++ } ++ } else if (var10 == Block.tripWire.blockID) { ++ ++var7; ++ continue; + } +- break; +- } +- +- if(var10 != Block.tripWire.blockID) { +- break; +- } +- } +- } +- +- } +- +- public void onEntityCollidedWithBlock(World var1, int var2, int var3, int var4, Entity var5) { +- if(!var1.isRemote) { +- if((var1.getBlockMetadata(var2, var3, var4) & 1) != 1) { +- this.updateTripWireState(var1, var2, var3, var4); +- } +- } +- } +- +- public void updateTick(World var1, int var2, int var3, int var4, Random var5) { +- if(!var1.isRemote) { +- if((var1.getBlockMetadata(var2, var3, var4) & 1) == 1) { +- this.updateTripWireState(var1, var2, var3, var4); +- } +- } +- } +- +- private void updateTripWireState(World var1, int var2, int var3, int var4) { +- int var5 = var1.getBlockMetadata(var2, var3, var4); ++ } ++ ++ ++var6; ++ break; ++ } ++ } ++ } ++ ++ /** ++ * Triggered whenever an entity collides with this block (enters into the block). Args: world, x, y, z, entity ++ */ ++ public void onEntityCollidedWithBlock(World par1World, int par2, int par3, int par4, Entity par5Entity) { ++ if (!par1World.isRemote) { ++ if ((par1World.getBlockMetadata(par2, par3, par4) & 1) != 1) { ++ this.updateTripWireState(par1World, par2, par3, par4); ++ } ++ } ++ } ++ ++ /** ++ * Ticks the block if it's been scheduled ++ */ ++ public void updateTick(World par1World, int par2, int par3, int par4, Random par5Random) { ++ if (!par1World.isRemote) { ++ if ((par1World.getBlockMetadata(par2, par3, par4) & 1) == 1) { ++ this.updateTripWireState(par1World, par2, par3, par4); ++ } ++ } ++ } ++ ++ private void updateTripWireState(World par1World, int par2, int par3, int par4) { ++ int var5 = par1World.getBlockMetadata(par2, par3, par4); + boolean var6 = (var5 & 1) == 1; + boolean var7 = false; +- List var8 = var1.getEntitiesWithinAABBExcludingEntity((Entity)null, AxisAlignedBB.getAABBPool().getAABB((double)var2 + this.minX, (double)var3 + this.minY, (double)var4 + this.minZ, (double)var2 + this.maxX, (double)var3 + this.maxY, (double)var4 + this.maxZ)); +- if(!var8.isEmpty()) { ++ List var8 = par1World.getEntitiesWithinAABBExcludingEntity((Entity)null, AxisAlignedBB.getAABBPool().getAABB((double)par2 + this.minX, (double)par3 + this.minY, (double)par4 + this.minZ, (double)par2 + this.maxX, (double)par3 + this.maxY, (double)par4 + this.maxZ)); ++ ++ if (!var8.isEmpty()) { + Iterator var9 = var8.iterator(); + +- while(var9.hasNext()) { ++ while (var9.hasNext()) { + Entity var10 = (Entity)var9.next(); +- if(!var10.doesEntityNotTriggerPressurePlate()) { ++ ++ if (!var10.doesEntityNotTriggerPressurePlate()) { + var7 = true; + break; + } + } + } + +- if(var7 && !var6) { ++ if (var7 && !var6) { + var5 |= 1; + } + +- if(!var7 && var6) { ++ if (!var7 && var6) { + var5 &= -2; + } + +- if(var7 != var6) { +- var1.setBlockMetadata(var2, var3, var4, var5, 3); +- this.func_72149_e(var1, var2, var3, var4, var5); +- } +- +- if(var7) { +- var1.scheduleBlockUpdate(var2, var3, var4, this.blockID, this.tickRate(var1)); +- } +- ++ if (var7 != var6) { ++ par1World.setBlockMetadataWithNotify(par2, par3, par4, var5, 3); ++ this.func_72149_e(par1World, par2, par3, par4, var5); ++ } ++ ++ if (var7) { ++ par1World.scheduleBlockUpdate(par2, par3, par4, this.blockID, this.tickRate(par1World)); ++ } + } + +- public static boolean func_72148_a(IBlockAccess var0, int var1, int var2, int var3, int var4, int var5) { +- int var6 = var1 + Direction.offsetX[var5]; +- int var8 = var3 + Direction.offsetZ[var5]; +- int var9 = var0.getBlockId(var6, var2, var8); +- boolean var10 = (var4 & 2) == 2; ++ public static boolean func_72148_a(IBlockAccess par0IBlockAccess, int par1, int par2, int par3, int par4, int par5) { ++ int var6 = par1 + Direction.offsetX[par5]; ++ int var8 = par3 + Direction.offsetZ[par5]; ++ int var9 = par0IBlockAccess.getBlockId(var6, par2, var8); ++ boolean var10 = (par4 & 2) == 2; + int var11; +- if(var9 == Block.tripWireSource.blockID) { +- var11 = var0.getBlockMetadata(var6, var2, var8); ++ ++ if (var9 == Block.tripWireSource.blockID) { ++ var11 = par0IBlockAccess.getBlockMetadata(var6, par2, var8); + int var13 = var11 & 3; +- return var13 == Direction.rotateOpposite[var5]; +- } else if(var9 == Block.tripWire.blockID) { +- var11 = var0.getBlockMetadata(var6, var2, var8); ++ return var13 == Direction.rotateOpposite[par5]; ++ } else if (var9 == Block.tripWire.blockID) { ++ var11 = par0IBlockAccess.getBlockMetadata(var6, par2, var8); + boolean var12 = (var11 & 2) == 2; + return var10 == var12; + } else { diff --git a/patches/net/minecraft/src/BlockTripWireSource.java.patch b/patches/net/minecraft/src/BlockTripWireSource.java.patch new file mode 100644 index 0000000..fd649dd --- /dev/null +++ b/patches/net/minecraft/src/BlockTripWireSource.java.patch @@ -0,0 +1,500 @@ +--- net/minecraft/src/BlockTripWireSource.java ++++ net/minecraft/src/BlockTripWireSource.java +@@ -3,138 +3,176 @@ + import java.util.Random; + + public class BlockTripWireSource extends Block { +- public BlockTripWireSource(int var1) { +- super(var1, Material.circuits); ++ public BlockTripWireSource(int par1) { ++ super(par1, Material.circuits); + this.setCreativeTab(CreativeTabs.tabRedstone); + this.setTickRandomly(true); + } + +- public AxisAlignedBB getCollisionBoundingBoxFromPool(World var1, int var2, int var3, int var4) { ++ /** ++ * Returns a bounding box from the pool of bounding boxes (this means this box can change after the pool has been ++ * cleared to be reused) ++ */ ++ public AxisAlignedBB getCollisionBoundingBoxFromPool(World par1World, int par2, int par3, int par4) { + return null; + } + ++ /** ++ * Is this block (a) opaque and (b) a full 1m cube? This determines whether or not to render the shared face of two ++ * adjacent blocks and also whether the player can attach torches, redstone wire, etc to this block. ++ */ + public boolean isOpaqueCube() { + return false; + } + ++ /** ++ * If this block doesn't render as an ordinary block it will return False (examples: signs, buttons, stairs, etc) ++ */ + public boolean renderAsNormalBlock() { + return false; + } + ++ /** ++ * The type of render function that is called for this block ++ */ + public int getRenderType() { + return 29; + } + +- public int tickRate(World var1) { ++ /** ++ * How many world ticks before ticking ++ */ ++ public int tickRate(World par1World) { + return 10; + } + +- public boolean canPlaceBlockOnSide(World var1, int var2, int var3, int var4, int var5) { +- return var5 == 2 && var1.isBlockNormalCube(var2, var3, var4 + 1) ? true : (var5 == 3 && var1.isBlockNormalCube(var2, var3, var4 - 1) ? true : (var5 == 4 && var1.isBlockNormalCube(var2 + 1, var3, var4) ? true : var5 == 5 && var1.isBlockNormalCube(var2 - 1, var3, var4))); +- } +- +- public boolean canPlaceBlockAt(World var1, int var2, int var3, int var4) { +- return var1.isBlockNormalCube(var2 - 1, var3, var4) ? true : (var1.isBlockNormalCube(var2 + 1, var3, var4) ? true : (var1.isBlockNormalCube(var2, var3, var4 - 1) ? true : var1.isBlockNormalCube(var2, var3, var4 + 1))); +- } +- +- public int onBlockPlaced(World var1, int var2, int var3, int var4, int var5, float var6, float var7, float var8, int var9) { ++ /** ++ * checks to see if you can place this block can be placed on that side of a block: BlockLever overrides ++ */ ++ public boolean canPlaceBlockOnSide(World par1World, int par2, int par3, int par4, int par5) { ++ return par5 == 2 && par1World.isBlockNormalCube(par2, par3, par4 + 1) ? true : (par5 == 3 && par1World.isBlockNormalCube(par2, par3, par4 - 1) ? true : (par5 == 4 && par1World.isBlockNormalCube(par2 + 1, par3, par4) ? true : par5 == 5 && par1World.isBlockNormalCube(par2 - 1, par3, par4))); ++ } ++ ++ /** ++ * Checks to see if its valid to put this block at the specified coordinates. Args: world, x, y, z ++ */ ++ public boolean canPlaceBlockAt(World par1World, int par2, int par3, int par4) { ++ return par1World.isBlockNormalCube(par2 - 1, par3, par4) ? true : (par1World.isBlockNormalCube(par2 + 1, par3, par4) ? true : (par1World.isBlockNormalCube(par2, par3, par4 - 1) ? true : par1World.isBlockNormalCube(par2, par3, par4 + 1))); ++ } ++ ++ /** ++ * Called when a block is placed using its ItemBlock. Args: World, X, Y, Z, side, hitX, hitY, hitZ, block metadata ++ */ ++ public int onBlockPlaced(World par1World, int par2, int par3, int par4, int par5, float par6, float par7, float par8, int par9) { + byte var10 = 0; +- if(var5 == 2 && var1.isBlockNormalCubeDefault(var2, var3, var4 + 1, true)) { ++ ++ if (par5 == 2 && par1World.isBlockNormalCubeDefault(par2, par3, par4 + 1, true)) { + var10 = 2; + } + +- if(var5 == 3 && var1.isBlockNormalCubeDefault(var2, var3, var4 - 1, true)) { ++ if (par5 == 3 && par1World.isBlockNormalCubeDefault(par2, par3, par4 - 1, true)) { + var10 = 0; + } + +- if(var5 == 4 && var1.isBlockNormalCubeDefault(var2 + 1, var3, var4, true)) { ++ if (par5 == 4 && par1World.isBlockNormalCubeDefault(par2 + 1, par3, par4, true)) { + var10 = 1; + } + +- if(var5 == 5 && var1.isBlockNormalCubeDefault(var2 - 1, var3, var4, true)) { ++ if (par5 == 5 && par1World.isBlockNormalCubeDefault(par2 - 1, par3, par4, true)) { + var10 = 3; + } + + return var10; + } + +- public void onPostBlockPlaced(World var1, int var2, int var3, int var4, int var5) { +- this.func_72143_a(var1, var2, var3, var4, this.blockID, var5, false, -1, 0); ++ /** ++ * Called after a block is placed ++ */ ++ public void onPostBlockPlaced(World par1World, int par2, int par3, int par4, int par5) { ++ this.func_72143_a(par1World, par2, par3, par4, this.blockID, par5, false, -1, 0); + } + +- public void onNeighborBlockChange(World var1, int var2, int var3, int var4, int var5) { +- if(var5 != this.blockID) { +- if(this.func_72144_l(var1, var2, var3, var4)) { +- int var6 = var1.getBlockMetadata(var2, var3, var4); ++ /** ++ * Lets the block know when one of its neighbor changes. Doesn't know which neighbor changed (coordinates passed are ++ * their own) Args: x, y, z, neighbor blockID ++ */ ++ public void onNeighborBlockChange(World par1World, int par2, int par3, int par4, int par5) { ++ if (par5 != this.blockID) { ++ if (this.func_72144_l(par1World, par2, par3, par4)) { ++ int var6 = par1World.getBlockMetadata(par2, par3, par4); + int var7 = var6 & 3; + boolean var8 = false; +- if(!var1.isBlockNormalCube(var2 - 1, var3, var4) && var7 == 3) { +- var8 = true; +- } +- +- if(!var1.isBlockNormalCube(var2 + 1, var3, var4) && var7 == 1) { +- var8 = true; +- } +- +- if(!var1.isBlockNormalCube(var2, var3, var4 - 1) && var7 == 0) { +- var8 = true; +- } +- +- if(!var1.isBlockNormalCube(var2, var3, var4 + 1) && var7 == 2) { +- var8 = true; +- } +- +- if(var8) { +- this.dropBlockAsItem(var1, var2, var3, var4, var6, 0); +- var1.setBlockToAir(var2, var3, var4); ++ ++ if (!par1World.isBlockNormalCube(par2 - 1, par3, par4) && var7 == 3) { ++ var8 = true; ++ } ++ ++ if (!par1World.isBlockNormalCube(par2 + 1, par3, par4) && var7 == 1) { ++ var8 = true; ++ } ++ ++ if (!par1World.isBlockNormalCube(par2, par3, par4 - 1) && var7 == 0) { ++ var8 = true; ++ } ++ ++ if (!par1World.isBlockNormalCube(par2, par3, par4 + 1) && var7 == 2) { ++ var8 = true; ++ } ++ ++ if (var8) { ++ this.dropBlockAsItem(par1World, par2, par3, par4, var6, 0); ++ par1World.setBlockToAir(par2, par3, par4); + } + } +- + } + } + +- public void func_72143_a(World var1, int var2, int var3, int var4, int var5, int var6, boolean var7, int var8, int var9) { +- int var10 = var6 & 3; +- boolean var11 = (var6 & 4) == 4; +- boolean var12 = (var6 & 8) == 8; +- boolean var13 = var5 == Block.tripWireSource.blockID; ++ public void func_72143_a(World par1World, int par2, int par3, int par4, int par5, int par6, boolean par7, int par8, int par9) { ++ int var10 = par6 & 3; ++ boolean var11 = (par6 & 4) == 4; ++ boolean var12 = (par6 & 8) == 8; ++ boolean var13 = par5 == Block.tripWireSource.blockID; + boolean var14 = false; +- boolean var15 = !var1.doesBlockHaveSolidTopSurface(var2, var3 - 1, var4); ++ boolean var15 = !par1World.doesBlockHaveSolidTopSurface(par2, par3 - 1, par4); + int var16 = Direction.offsetX[var10]; + int var17 = Direction.offsetZ[var10]; + int var18 = 0; + int[] var19 = new int[42]; +- + int var20; + int var21; + int var22; + int var23; + int var24; +- for(var20 = 1; var20 < 42; ++var20) { +- var21 = var2 + var16 * var20; +- var22 = var4 + var17 * var20; +- var23 = var1.getBlockId(var21, var3, var22); +- if(var23 == Block.tripWireSource.blockID) { +- var24 = var1.getBlockMetadata(var21, var3, var22); +- if((var24 & 3) == Direction.rotateOpposite[var10]) { ++ ++ for (var20 = 1; var20 < 42; ++var20) { ++ var21 = par2 + var16 * var20; ++ var22 = par4 + var17 * var20; ++ var23 = par1World.getBlockId(var21, par3, var22); ++ ++ if (var23 == Block.tripWireSource.blockID) { ++ var24 = par1World.getBlockMetadata(var21, par3, var22); ++ ++ if ((var24 & 3) == Direction.rotateOpposite[var10]) { + var18 = var20; + } ++ + break; + } + +- if(var23 != Block.tripWire.blockID && var20 != var8) { ++ if (var23 != Block.tripWire.blockID && var20 != par8) { + var19[var20] = -1; + var13 = false; + } else { +- var24 = var20 == var8 ? var9 : var1.getBlockMetadata(var21, var3, var22); ++ var24 = var20 == par8 ? par9 : par1World.getBlockMetadata(var21, par3, var22); + boolean var25 = (var24 & 8) != 8; + boolean var26 = (var24 & 1) == 1; + boolean var27 = (var24 & 2) == 2; + var13 &= var27 == var15; + var14 |= var25 && var26; + var19[var20] = var24; +- if(var20 == var8) { +- var1.scheduleBlockUpdate(var2, var3, var4, var5, this.tickRate(var1)); ++ ++ if (var20 == par8) { ++ par1World.scheduleBlockUpdate(par2, par3, par4, par5, this.tickRate(par1World)); + var13 &= var25; + } + } +@@ -143,137 +181,167 @@ + var13 &= var18 > 1; + var14 &= var13; + var20 = (var13 ? 4 : 0) | (var14 ? 8 : 0); +- var6 = var10 | var20; +- if(var18 > 0) { +- var21 = var2 + var16 * var18; +- var22 = var4 + var17 * var18; ++ par6 = var10 | var20; ++ ++ if (var18 > 0) { ++ var21 = par2 + var16 * var18; ++ var22 = par4 + var17 * var18; + var23 = Direction.rotateOpposite[var10]; +- var1.setBlockMetadata(var21, var3, var22, var23 | var20, 3); +- this.notifyNeighborOfChange(var1, var21, var3, var22, var23); +- this.playSoundEffect(var1, var21, var3, var22, var13, var14, var11, var12); ++ par1World.setBlockMetadataWithNotify(var21, par3, var22, var23 | var20, 3); ++ this.notifyNeighborOfChange(par1World, var21, par3, var22, var23); ++ this.playSoundEffect(par1World, var21, par3, var22, var13, var14, var11, var12); + } + +- this.playSoundEffect(var1, var2, var3, var4, var13, var14, var11, var12); +- if(var5 > 0) { +- var1.setBlockMetadata(var2, var3, var4, var6, 3); +- if(var7) { +- this.notifyNeighborOfChange(var1, var2, var3, var4, var10); ++ this.playSoundEffect(par1World, par2, par3, par4, var13, var14, var11, var12); ++ ++ if (par5 > 0) { ++ par1World.setBlockMetadataWithNotify(par2, par3, par4, par6, 3); ++ ++ if (par7) { ++ this.notifyNeighborOfChange(par1World, par2, par3, par4, var10); + } + } + +- if(var11 != var13) { +- for(var21 = 1; var21 < var18; ++var21) { +- var22 = var2 + var16 * var21; +- var23 = var4 + var17 * var21; ++ if (var11 != var13) { ++ for (var21 = 1; var21 < var18; ++var21) { ++ var22 = par2 + var16 * var21; ++ var23 = par4 + var17 * var21; + var24 = var19[var21]; +- if(var24 >= 0) { +- if(var13) { ++ ++ if (var24 >= 0) { ++ if (var13) { + var24 |= 4; + } else { + var24 &= -5; + } + +- var1.setBlockMetadata(var22, var3, var23, var24, 3); ++ par1World.setBlockMetadataWithNotify(var22, par3, var23, var24, 3); + } + } + } +- +- } +- +- public void updateTick(World var1, int var2, int var3, int var4, Random var5) { +- this.func_72143_a(var1, var2, var3, var4, this.blockID, var1.getBlockMetadata(var2, var3, var4), true, -1, 0); +- } +- +- private void playSoundEffect(World var1, int var2, int var3, int var4, boolean var5, boolean var6, boolean var7, boolean var8) { +- if(var6 && !var8) { +- var1.playSoundEffect((double)var2 + 0.5D, (double)var3 + 0.1D, (double)var4 + 0.5D, "random.click", 0.4F, 0.6F); +- } else if(!var6 && var8) { +- var1.playSoundEffect((double)var2 + 0.5D, (double)var3 + 0.1D, (double)var4 + 0.5D, "random.click", 0.4F, 0.5F); +- } else if(var5 && !var7) { +- var1.playSoundEffect((double)var2 + 0.5D, (double)var3 + 0.1D, (double)var4 + 0.5D, "random.click", 0.4F, 0.7F); +- } else if(!var5 && var7) { +- var1.playSoundEffect((double)var2 + 0.5D, (double)var3 + 0.1D, (double)var4 + 0.5D, "random.bowhit", 0.4F, 1.2F / (var1.s.nextFloat() * 0.2F + 0.9F)); +- } +- +- } +- +- private void notifyNeighborOfChange(World var1, int var2, int var3, int var4, int var5) { +- var1.notifyBlocksOfNeighborChange(var2, var3, var4, this.blockID); +- if(var5 == 3) { +- var1.notifyBlocksOfNeighborChange(var2 - 1, var3, var4, this.blockID); +- } else if(var5 == 1) { +- var1.notifyBlocksOfNeighborChange(var2 + 1, var3, var4, this.blockID); +- } else if(var5 == 0) { +- var1.notifyBlocksOfNeighborChange(var2, var3, var4 - 1, this.blockID); +- } else if(var5 == 2) { +- var1.notifyBlocksOfNeighborChange(var2, var3, var4 + 1, this.blockID); +- } +- +- } +- +- private boolean func_72144_l(World var1, int var2, int var3, int var4) { +- if(!this.canPlaceBlockAt(var1, var2, var3, var4)) { +- this.dropBlockAsItem(var1, var2, var3, var4, var1.getBlockMetadata(var2, var3, var4), 0); +- var1.setBlockToAir(var2, var3, var4); ++ } ++ ++ /** ++ * Ticks the block if it's been scheduled ++ */ ++ public void updateTick(World par1World, int par2, int par3, int par4, Random par5Random) { ++ this.func_72143_a(par1World, par2, par3, par4, this.blockID, par1World.getBlockMetadata(par2, par3, par4), true, -1, 0); ++ } ++ ++ /** ++ * only of the conditions are right ++ */ ++ private void playSoundEffect(World par1World, int par2, int par3, int par4, boolean par5, boolean par6, boolean par7, boolean par8) { ++ if (par6 && !par8) { ++ par1World.playSoundEffect((double)par2 + 0.5D, (double)par3 + 0.1D, (double)par4 + 0.5D, "random.click", 0.4F, 0.6F); ++ } else if (!par6 && par8) { ++ par1World.playSoundEffect((double)par2 + 0.5D, (double)par3 + 0.1D, (double)par4 + 0.5D, "random.click", 0.4F, 0.5F); ++ } else if (par5 && !par7) { ++ par1World.playSoundEffect((double)par2 + 0.5D, (double)par3 + 0.1D, (double)par4 + 0.5D, "random.click", 0.4F, 0.7F); ++ } else if (!par5 && par7) { ++ par1World.playSoundEffect((double)par2 + 0.5D, (double)par3 + 0.1D, (double)par4 + 0.5D, "random.bowhit", 0.4F, 1.2F / (par1World.rand.nextFloat() * 0.2F + 0.9F)); ++ } ++ } ++ ++ private void notifyNeighborOfChange(World par1World, int par2, int par3, int par4, int par5) { ++ par1World.notifyBlocksOfNeighborChange(par2, par3, par4, this.blockID); ++ ++ if (par5 == 3) { ++ par1World.notifyBlocksOfNeighborChange(par2 - 1, par3, par4, this.blockID); ++ } else if (par5 == 1) { ++ par1World.notifyBlocksOfNeighborChange(par2 + 1, par3, par4, this.blockID); ++ } else if (par5 == 0) { ++ par1World.notifyBlocksOfNeighborChange(par2, par3, par4 - 1, this.blockID); ++ } else if (par5 == 2) { ++ par1World.notifyBlocksOfNeighborChange(par2, par3, par4 + 1, this.blockID); ++ } ++ } ++ ++ private boolean func_72144_l(World par1World, int par2, int par3, int par4) { ++ if (!this.canPlaceBlockAt(par1World, par2, par3, par4)) { ++ this.dropBlockAsItem(par1World, par2, par3, par4, par1World.getBlockMetadata(par2, par3, par4), 0); ++ par1World.setBlockToAir(par2, par3, par4); + return false; + } else { + return true; + } + } + +- public void setBlockBoundsBasedOnState(IBlockAccess var1, int var2, int var3, int var4) { +- int var5 = var1.getBlockMetadata(var2, var3, var4) & 3; +- float var6 = 3.0F / 16.0F; +- if(var5 == 3) { ++ /** ++ * Updates the blocks bounds based on its current state. Args: world, x, y, z ++ */ ++ public void setBlockBoundsBasedOnState(IBlockAccess par1IBlockAccess, int par2, int par3, int par4) { ++ int var5 = par1IBlockAccess.getBlockMetadata(par2, par3, par4) & 3; ++ float var6 = 0.1875F; ++ ++ if (var5 == 3) { + this.setBlockBounds(0.0F, 0.2F, 0.5F - var6, var6 * 2.0F, 0.8F, 0.5F + var6); +- } else if(var5 == 1) { ++ } else if (var5 == 1) { + this.setBlockBounds(1.0F - var6 * 2.0F, 0.2F, 0.5F - var6, 1.0F, 0.8F, 0.5F + var6); +- } else if(var5 == 0) { ++ } else if (var5 == 0) { + this.setBlockBounds(0.5F - var6, 0.2F, 0.0F, 0.5F + var6, 0.8F, var6 * 2.0F); +- } else if(var5 == 2) { ++ } else if (var5 == 2) { + this.setBlockBounds(0.5F - var6, 0.2F, 1.0F - var6 * 2.0F, 0.5F + var6, 0.8F, 1.0F); + } +- + } + +- public void breakBlock(World var1, int var2, int var3, int var4, int var5, int var6) { +- boolean var7 = (var6 & 4) == 4; +- boolean var8 = (var6 & 8) == 8; +- if(var7 || var8) { +- this.func_72143_a(var1, var2, var3, var4, 0, var6, false, -1, 0); ++ /** ++ * Called on server worlds only when the block has been replaced by a different block ID, or the same block with a ++ * different metadata value, but before the new metadata value is set. Args: World, x, y, z, old block ID, old metadata ++ */ ++ public void breakBlock(World par1World, int par2, int par3, int par4, int par5, int par6) { ++ boolean var7 = (par6 & 4) == 4; ++ boolean var8 = (par6 & 8) == 8; ++ ++ if (var7 || var8) { ++ this.func_72143_a(par1World, par2, par3, par4, 0, par6, false, -1, 0); + } + +- if(var8) { +- var1.notifyBlocksOfNeighborChange(var2, var3, var4, this.blockID); +- int var9 = var6 & 3; +- if(var9 == 3) { +- var1.notifyBlocksOfNeighborChange(var2 - 1, var3, var4, this.blockID); +- } else if(var9 == 1) { +- var1.notifyBlocksOfNeighborChange(var2 + 1, var3, var4, this.blockID); +- } else if(var9 == 0) { +- var1.notifyBlocksOfNeighborChange(var2, var3, var4 - 1, this.blockID); +- } else if(var9 == 2) { +- var1.notifyBlocksOfNeighborChange(var2, var3, var4 + 1, this.blockID); ++ if (var8) { ++ par1World.notifyBlocksOfNeighborChange(par2, par3, par4, this.blockID); ++ int var9 = par6 & 3; ++ ++ if (var9 == 3) { ++ par1World.notifyBlocksOfNeighborChange(par2 - 1, par3, par4, this.blockID); ++ } else if (var9 == 1) { ++ par1World.notifyBlocksOfNeighborChange(par2 + 1, par3, par4, this.blockID); ++ } else if (var9 == 0) { ++ par1World.notifyBlocksOfNeighborChange(par2, par3, par4 - 1, this.blockID); ++ } else if (var9 == 2) { ++ par1World.notifyBlocksOfNeighborChange(par2, par3, par4 + 1, this.blockID); + } + } + +- super.breakBlock(var1, var2, var3, var4, var5, var6); +- } +- +- public int isProvidingWeakPower(IBlockAccess var1, int var2, int var3, int var4, int var5) { +- return (var1.getBlockMetadata(var2, var3, var4) & 8) == 8 ? 15 : 0; +- } +- +- public int isProvidingStrongPower(IBlockAccess var1, int var2, int var3, int var4, int var5) { +- int var6 = var1.getBlockMetadata(var2, var3, var4); +- if((var6 & 8) != 8) { ++ super.breakBlock(par1World, par2, par3, par4, par5, par6); ++ } ++ ++ /** ++ * Returns true if the block is emitting indirect/weak redstone power on the specified side. If isBlockNormalCube ++ * returns true, standard redstone propagation rules will apply instead and this will not be called. Args: World, X, Y, ++ * Z, side. Note that the side is reversed - eg it is 1 (up) when checking the bottom of the block. ++ */ ++ public int isProvidingWeakPower(IBlockAccess par1IBlockAccess, int par2, int par3, int par4, int par5) { ++ return (par1IBlockAccess.getBlockMetadata(par2, par3, par4) & 8) == 8 ? 15 : 0; ++ } ++ ++ /** ++ * Returns true if the block is emitting direct/strong redstone power on the specified side. Args: World, X, Y, Z, ++ * side. Note that the side is reversed - eg it is 1 (up) when checking the bottom of the block. ++ */ ++ public int isProvidingStrongPower(IBlockAccess par1IBlockAccess, int par2, int par3, int par4, int par5) { ++ int var6 = par1IBlockAccess.getBlockMetadata(par2, par3, par4); ++ ++ if ((var6 & 8) != 8) { + return 0; + } else { + int var7 = var6 & 3; +- return var7 == 2 && var5 == 2 ? 15 : (var7 == 0 && var5 == 3 ? 15 : (var7 == 1 && var5 == 4 ? 15 : (var7 == 3 && var5 == 5 ? 15 : 0))); ++ return var7 == 2 && par5 == 2 ? 15 : (var7 == 0 && par5 == 3 ? 15 : (var7 == 1 && par5 == 4 ? 15 : (var7 == 3 && par5 == 5 ? 15 : 0))); + } + } + ++ /** ++ * Can this block provide power. Only wire currently seems to have this change based on its state. ++ */ + public boolean canProvidePower() { + return true; + } diff --git a/patches/net/minecraft/src/BlockVine.java.patch b/patches/net/minecraft/src/BlockVine.java.patch new file mode 100644 index 0000000..a486543 --- /dev/null +++ b/patches/net/minecraft/src/BlockVine.java.patch @@ -0,0 +1,520 @@ +--- net/minecraft/src/BlockVine.java ++++ net/minecraft/src/BlockVine.java +@@ -3,31 +3,47 @@ + import java.util.Random; + + public class BlockVine extends Block { +- public BlockVine(int var1) { +- super(var1, Material.vine); ++ public BlockVine(int par1) { ++ super(par1, Material.vine); + this.setTickRandomly(true); + this.setCreativeTab(CreativeTabs.tabDecorations); + } + ++ /** ++ * Sets the block's bounds for rendering it as an item ++ */ + public void setBlockBoundsForItemRender() { + this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F); + } + ++ /** ++ * The type of render function that is called for this block ++ */ + public int getRenderType() { + return 20; + } + ++ /** ++ * Is this block (a) opaque and (b) a full 1m cube? This determines whether or not to render the shared face of two ++ * adjacent blocks and also whether the player can attach torches, redstone wire, etc to this block. ++ */ + public boolean isOpaqueCube() { + return false; + } + ++ /** ++ * If this block doesn't render as an ordinary block it will return False (examples: signs, buttons, stairs, etc) ++ */ + public boolean renderAsNormalBlock() { + return false; + } + +- public void setBlockBoundsBasedOnState(IBlockAccess var1, int var2, int var3, int var4) { +- float var5 = 1.0F / 16.0F; +- int var6 = var1.getBlockMetadata(var2, var3, var4); ++ /** ++ * Updates the blocks bounds based on its current state. Args: world, x, y, z ++ */ ++ public void setBlockBoundsBasedOnState(IBlockAccess par1IBlockAccess, int par2, int par3, int par4) { ++ float var5 = 0.0625F; ++ int var6 = par1IBlockAccess.getBlockMetadata(par2, par3, par4); + float var7 = 1.0F; + float var8 = 1.0F; + float var9 = 1.0F; +@@ -35,48 +51,49 @@ + float var11 = 0.0F; + float var12 = 0.0F; + boolean var13 = var6 > 0; +- if((var6 & 2) != 0) { +- var10 = Math.max(var10, 1.0F / 16.0F); +- var7 = 0.0F; +- var8 = 0.0F; +- var11 = 1.0F; +- var9 = 0.0F; +- var12 = 1.0F; +- var13 = true; +- } +- +- if((var6 & 8) != 0) { +- var7 = Math.min(var7, 15.0F / 16.0F); +- var10 = 1.0F; +- var8 = 0.0F; +- var11 = 1.0F; +- var9 = 0.0F; +- var12 = 1.0F; +- var13 = true; +- } +- +- if((var6 & 4) != 0) { +- var12 = Math.max(var12, 1.0F / 16.0F); +- var9 = 0.0F; +- var7 = 0.0F; +- var10 = 1.0F; +- var8 = 0.0F; +- var11 = 1.0F; +- var13 = true; +- } +- +- if((var6 & 1) != 0) { +- var9 = Math.min(var9, 15.0F / 16.0F); +- var12 = 1.0F; +- var7 = 0.0F; +- var10 = 1.0F; +- var8 = 0.0F; +- var11 = 1.0F; +- var13 = true; +- } +- +- if(!var13 && this.canBePlacedOn(var1.getBlockId(var2, var3 + 1, var4))) { +- var8 = Math.min(var8, 15.0F / 16.0F); ++ ++ if ((var6 & 2) != 0) { ++ var10 = Math.max(var10, 0.0625F); ++ var7 = 0.0F; ++ var8 = 0.0F; ++ var11 = 1.0F; ++ var9 = 0.0F; ++ var12 = 1.0F; ++ var13 = true; ++ } ++ ++ if ((var6 & 8) != 0) { ++ var7 = Math.min(var7, 0.9375F); ++ var10 = 1.0F; ++ var8 = 0.0F; ++ var11 = 1.0F; ++ var9 = 0.0F; ++ var12 = 1.0F; ++ var13 = true; ++ } ++ ++ if ((var6 & 4) != 0) { ++ var12 = Math.max(var12, 0.0625F); ++ var9 = 0.0F; ++ var7 = 0.0F; ++ var10 = 1.0F; ++ var8 = 0.0F; ++ var11 = 1.0F; ++ var13 = true; ++ } ++ ++ if ((var6 & 1) != 0) { ++ var9 = Math.min(var9, 0.9375F); ++ var12 = 1.0F; ++ var7 = 0.0F; ++ var10 = 1.0F; ++ var8 = 0.0F; ++ var11 = 1.0F; ++ var13 = true; ++ } ++ ++ if (!var13 && this.canBePlacedOn(par1IBlockAccess.getBlockId(par2, par3 + 1, par4))) { ++ var8 = Math.min(var8, 0.9375F); + var11 = 1.0F; + var7 = 0.0F; + var10 = 1.0F; +@@ -87,53 +104,73 @@ + this.setBlockBounds(var7, var8, var9, var10, var11, var12); + } + +- public AxisAlignedBB getCollisionBoundingBoxFromPool(World var1, int var2, int var3, int var4) { ++ /** ++ * Returns a bounding box from the pool of bounding boxes (this means this box can change after the pool has been ++ * cleared to be reused) ++ */ ++ public AxisAlignedBB getCollisionBoundingBoxFromPool(World par1World, int par2, int par3, int par4) { + return null; + } + +- public boolean canPlaceBlockOnSide(World var1, int var2, int var3, int var4, int var5) { +- switch(var5) { +- case 1: +- return this.canBePlacedOn(var1.getBlockId(var2, var3 + 1, var4)); +- case 2: +- return this.canBePlacedOn(var1.getBlockId(var2, var3, var4 + 1)); +- case 3: +- return this.canBePlacedOn(var1.getBlockId(var2, var3, var4 - 1)); +- case 4: +- return this.canBePlacedOn(var1.getBlockId(var2 + 1, var3, var4)); +- case 5: +- return this.canBePlacedOn(var1.getBlockId(var2 - 1, var3, var4)); +- default: +- return false; ++ /** ++ * checks to see if you can place this block can be placed on that side of a block: BlockLever overrides ++ */ ++ public boolean canPlaceBlockOnSide(World par1World, int par2, int par3, int par4, int par5) { ++ switch (par5) { ++ case 1: ++ return this.canBePlacedOn(par1World.getBlockId(par2, par3 + 1, par4)); ++ ++ case 2: ++ return this.canBePlacedOn(par1World.getBlockId(par2, par3, par4 + 1)); ++ ++ case 3: ++ return this.canBePlacedOn(par1World.getBlockId(par2, par3, par4 - 1)); ++ ++ case 4: ++ return this.canBePlacedOn(par1World.getBlockId(par2 + 1, par3, par4)); ++ ++ case 5: ++ return this.canBePlacedOn(par1World.getBlockId(par2 - 1, par3, par4)); ++ ++ default: ++ return false; + } + } + +- private boolean canBePlacedOn(int var1) { +- if(var1 == 0) { ++ /** ++ * returns true if a vine can be placed on that block (checks for render as normal block and if it is solid) ++ */ ++ private boolean canBePlacedOn(int par1) { ++ if (par1 == 0) { + return false; + } else { +- Block var2 = Block.blocksList[var1]; ++ Block var2 = Block.blocksList[par1]; + return var2.renderAsNormalBlock() && var2.blockMaterial.blocksMovement(); + } + } + +- private boolean canVineStay(World var1, int var2, int var3, int var4) { +- int var5 = var1.getBlockMetadata(var2, var3, var4); ++ /** ++ * Returns if the vine can stay in the world. It also changes the metadata according to neighboring blocks. ++ */ ++ private boolean canVineStay(World par1World, int par2, int par3, int par4) { ++ int var5 = par1World.getBlockMetadata(par2, par3, par4); + int var6 = var5; +- if(var5 > 0) { +- for(int var7 = 0; var7 <= 3; ++var7) { ++ ++ if (var5 > 0) { ++ for (int var7 = 0; var7 <= 3; ++var7) { + int var8 = 1 << var7; +- if((var5 & var8) != 0 && !this.canBePlacedOn(var1.getBlockId(var2 + Direction.offsetX[var7], var3, var4 + Direction.offsetZ[var7])) && (var1.getBlockId(var2, var3 + 1, var4) != this.blockID || (var1.getBlockMetadata(var2, var3 + 1, var4) & var8) == 0)) { ++ ++ if ((var5 & var8) != 0 && !this.canBePlacedOn(par1World.getBlockId(par2 + Direction.offsetX[var7], par3, par4 + Direction.offsetZ[var7])) && (par1World.getBlockId(par2, par3 + 1, par4) != this.blockID || (par1World.getBlockMetadata(par2, par3 + 1, par4) & var8) == 0)) { + var6 &= ~var8; + } + } + } + +- if(var6 == 0 && !this.canBePlacedOn(var1.getBlockId(var2, var3 + 1, var4))) { ++ if (var6 == 0 && !this.canBePlacedOn(par1World.getBlockId(par2, par3 + 1, par4))) { + return false; + } else { +- if(var6 != var5) { +- var1.setBlockMetadata(var2, var3, var4, var6, 2); ++ if (var6 != var5) { ++ par1World.setBlockMetadataWithNotify(par2, par3, par4, var6, 2); + } + + return true; +@@ -144,149 +181,186 @@ + return ColorizerFoliage.getFoliageColorBasic(); + } + +- public int getRenderColor(int var1) { ++ /** ++ * Returns the color this block should be rendered. Used by leaves. ++ */ ++ public int getRenderColor(int par1) { + return ColorizerFoliage.getFoliageColorBasic(); + } + +- public int colorMultiplier(IBlockAccess var1, int var2, int var3, int var4) { +- return var1.getBiomeGenForCoords(var2, var4).getBiomeFoliageColor(); ++ /** ++ * Returns a integer with hex for 0xrrggbb with this color multiplied against the blocks color. Note only called when ++ * first determining what to render. ++ */ ++ public int colorMultiplier(IBlockAccess par1IBlockAccess, int par2, int par3, int par4) { ++ return par1IBlockAccess.getBiomeGenForCoords(par2, par4).getBiomeFoliageColor(); + } + +- public void onNeighborBlockChange(World var1, int var2, int var3, int var4, int var5) { +- if(!var1.isRemote && !this.canVineStay(var1, var2, var3, var4)) { +- this.dropBlockAsItem(var1, var2, var3, var4, var1.getBlockMetadata(var2, var3, var4), 0); +- var1.setBlockToAir(var2, var3, var4); ++ /** ++ * Lets the block know when one of its neighbor changes. Doesn't know which neighbor changed (coordinates passed are ++ * their own) Args: x, y, z, neighbor blockID ++ */ ++ public void onNeighborBlockChange(World par1World, int par2, int par3, int par4, int par5) { ++ if (!par1World.isRemote && !this.canVineStay(par1World, par2, par3, par4)) { ++ this.dropBlockAsItem(par1World, par2, par3, par4, par1World.getBlockMetadata(par2, par3, par4), 0); ++ par1World.setBlockToAir(par2, par3, par4); + } +- + } + +- public void updateTick(World var1, int var2, int var3, int var4, Random var5) { +- if(!var1.isRemote && var1.s.nextInt(4) == 0) { ++ /** ++ * Ticks the block if it's been scheduled ++ */ ++ public void updateTick(World par1World, int par2, int par3, int par4, Random par5Random) { ++ if (!par1World.isRemote && par1World.rand.nextInt(4) == 0) { + byte var6 = 4; + int var7 = 5; + boolean var8 = false; +- + int var9; + int var10; + int var11; +- label141: +- for(var9 = var2 - var6; var9 <= var2 + var6; ++var9) { +- for(var10 = var4 - var6; var10 <= var4 + var6; ++var10) { +- for(var11 = var3 - 1; var11 <= var3 + 1; ++var11) { +- if(var1.getBlockId(var9, var11, var10) == this.blockID) { ++ label138: ++ ++ for (var9 = par2 - var6; var9 <= par2 + var6; ++var9) { ++ for (var10 = par4 - var6; var10 <= par4 + var6; ++var10) { ++ for (var11 = par3 - 1; var11 <= par3 + 1; ++var11) { ++ if (par1World.getBlockId(var9, var11, var10) == this.blockID) { + --var7; +- if(var7 <= 0) { ++ ++ if (var7 <= 0) { + var8 = true; +- break label141; ++ break label138; + } + } + } + } + } + +- var9 = var1.getBlockMetadata(var2, var3, var4); +- var10 = var1.s.nextInt(6); ++ var9 = par1World.getBlockMetadata(par2, par3, par4); ++ var10 = par1World.rand.nextInt(6); + var11 = Direction.facingToDirection[var10]; + int var12; + int var13; +- if(var10 == 1 && var3 < 255 && var1.isAirBlock(var2, var3 + 1, var4)) { +- if(var8) { ++ ++ if (var10 == 1 && par3 < 255 && par1World.isAirBlock(par2, par3 + 1, par4)) { ++ if (var8) { + return; + } + +- var12 = var1.s.nextInt(16) & var9; +- if(var12 > 0) { +- for(var13 = 0; var13 <= 3; ++var13) { +- if(!this.canBePlacedOn(var1.getBlockId(var2 + Direction.offsetX[var13], var3 + 1, var4 + Direction.offsetZ[var13]))) { ++ var12 = par1World.rand.nextInt(16) & var9; ++ ++ if (var12 > 0) { ++ for (var13 = 0; var13 <= 3; ++var13) { ++ if (!this.canBePlacedOn(par1World.getBlockId(par2 + Direction.offsetX[var13], par3 + 1, par4 + Direction.offsetZ[var13]))) { + var12 &= ~(1 << var13); + } + } + +- if(var12 > 0) { +- var1.setBlock(var2, var3 + 1, var4, this.blockID, var12, 2); ++ if (var12 > 0) { ++ par1World.setBlock(par2, par3 + 1, par4, this.blockID, var12, 2); + } + } + } else { + int var14; +- if(var10 >= 2 && var10 <= 5 && (var9 & 1 << var11) == 0) { +- if(var8) { ++ ++ if (var10 >= 2 && var10 <= 5 && (var9 & 1 << var11) == 0) { ++ if (var8) { + return; + } + +- var12 = var1.getBlockId(var2 + Direction.offsetX[var11], var3, var4 + Direction.offsetZ[var11]); +- if(var12 != 0 && Block.blocksList[var12] != null) { +- if(Block.blocksList[var12].blockMaterial.isOpaque() && Block.blocksList[var12].renderAsNormalBlock()) { +- var1.setBlockMetadata(var2, var3, var4, var9 | 1 << var11, 2); ++ var12 = par1World.getBlockId(par2 + Direction.offsetX[var11], par3, par4 + Direction.offsetZ[var11]); ++ ++ if (var12 != 0 && Block.blocksList[var12] != null) { ++ if (Block.blocksList[var12].blockMaterial.isOpaque() && Block.blocksList[var12].renderAsNormalBlock()) { ++ par1World.setBlockMetadataWithNotify(par2, par3, par4, var9 | 1 << var11, 2); + } + } else { + var13 = var11 + 1 & 3; + var14 = var11 + 3 & 3; +- if((var9 & 1 << var13) != 0 && this.canBePlacedOn(var1.getBlockId(var2 + Direction.offsetX[var11] + Direction.offsetX[var13], var3, var4 + Direction.offsetZ[var11] + Direction.offsetZ[var13]))) { +- var1.setBlock(var2 + Direction.offsetX[var11], var3, var4 + Direction.offsetZ[var11], this.blockID, 1 << var13, 2); +- } else if((var9 & 1 << var14) != 0 && this.canBePlacedOn(var1.getBlockId(var2 + Direction.offsetX[var11] + Direction.offsetX[var14], var3, var4 + Direction.offsetZ[var11] + Direction.offsetZ[var14]))) { +- var1.setBlock(var2 + Direction.offsetX[var11], var3, var4 + Direction.offsetZ[var11], this.blockID, 1 << var14, 2); +- } else if((var9 & 1 << var13) != 0 && var1.isAirBlock(var2 + Direction.offsetX[var11] + Direction.offsetX[var13], var3, var4 + Direction.offsetZ[var11] + Direction.offsetZ[var13]) && this.canBePlacedOn(var1.getBlockId(var2 + Direction.offsetX[var13], var3, var4 + Direction.offsetZ[var13]))) { +- var1.setBlock(var2 + Direction.offsetX[var11] + Direction.offsetX[var13], var3, var4 + Direction.offsetZ[var11] + Direction.offsetZ[var13], this.blockID, 1 << (var11 + 2 & 3), 2); +- } else if((var9 & 1 << var14) != 0 && var1.isAirBlock(var2 + Direction.offsetX[var11] + Direction.offsetX[var14], var3, var4 + Direction.offsetZ[var11] + Direction.offsetZ[var14]) && this.canBePlacedOn(var1.getBlockId(var2 + Direction.offsetX[var14], var3, var4 + Direction.offsetZ[var14]))) { +- var1.setBlock(var2 + Direction.offsetX[var11] + Direction.offsetX[var14], var3, var4 + Direction.offsetZ[var11] + Direction.offsetZ[var14], this.blockID, 1 << (var11 + 2 & 3), 2); +- } else if(this.canBePlacedOn(var1.getBlockId(var2 + Direction.offsetX[var11], var3 + 1, var4 + Direction.offsetZ[var11]))) { +- var1.setBlock(var2 + Direction.offsetX[var11], var3, var4 + Direction.offsetZ[var11], this.blockID, 0, 2); ++ ++ if ((var9 & 1 << var13) != 0 && this.canBePlacedOn(par1World.getBlockId(par2 + Direction.offsetX[var11] + Direction.offsetX[var13], par3, par4 + Direction.offsetZ[var11] + Direction.offsetZ[var13]))) { ++ par1World.setBlock(par2 + Direction.offsetX[var11], par3, par4 + Direction.offsetZ[var11], this.blockID, 1 << var13, 2); ++ } else if ((var9 & 1 << var14) != 0 && this.canBePlacedOn(par1World.getBlockId(par2 + Direction.offsetX[var11] + Direction.offsetX[var14], par3, par4 + Direction.offsetZ[var11] + Direction.offsetZ[var14]))) { ++ par1World.setBlock(par2 + Direction.offsetX[var11], par3, par4 + Direction.offsetZ[var11], this.blockID, 1 << var14, 2); ++ } else if ((var9 & 1 << var13) != 0 && par1World.isAirBlock(par2 + Direction.offsetX[var11] + Direction.offsetX[var13], par3, par4 + Direction.offsetZ[var11] + Direction.offsetZ[var13]) && this.canBePlacedOn(par1World.getBlockId(par2 + Direction.offsetX[var13], par3, par4 + Direction.offsetZ[var13]))) { ++ par1World.setBlock(par2 + Direction.offsetX[var11] + Direction.offsetX[var13], par3, par4 + Direction.offsetZ[var11] + Direction.offsetZ[var13], this.blockID, 1 << (var11 + 2 & 3), 2); ++ } else if ((var9 & 1 << var14) != 0 && par1World.isAirBlock(par2 + Direction.offsetX[var11] + Direction.offsetX[var14], par3, par4 + Direction.offsetZ[var11] + Direction.offsetZ[var14]) && this.canBePlacedOn(par1World.getBlockId(par2 + Direction.offsetX[var14], par3, par4 + Direction.offsetZ[var14]))) { ++ par1World.setBlock(par2 + Direction.offsetX[var11] + Direction.offsetX[var14], par3, par4 + Direction.offsetZ[var11] + Direction.offsetZ[var14], this.blockID, 1 << (var11 + 2 & 3), 2); ++ } else if (this.canBePlacedOn(par1World.getBlockId(par2 + Direction.offsetX[var11], par3 + 1, par4 + Direction.offsetZ[var11]))) { ++ par1World.setBlock(par2 + Direction.offsetX[var11], par3, par4 + Direction.offsetZ[var11], this.blockID, 0, 2); + } + } +- } else if(var3 > 1) { +- var12 = var1.getBlockId(var2, var3 - 1, var4); +- if(var12 == 0) { +- var13 = var1.s.nextInt(16) & var9; +- if(var13 > 0) { +- var1.setBlock(var2, var3 - 1, var4, this.blockID, var13, 2); ++ } else if (par3 > 1) { ++ var12 = par1World.getBlockId(par2, par3 - 1, par4); ++ ++ if (var12 == 0) { ++ var13 = par1World.rand.nextInt(16) & var9; ++ ++ if (var13 > 0) { ++ par1World.setBlock(par2, par3 - 1, par4, this.blockID, var13, 2); + } +- } else if(var12 == this.blockID) { +- var13 = var1.s.nextInt(16) & var9; +- var14 = var1.getBlockMetadata(var2, var3 - 1, var4); +- if(var14 != (var14 | var13)) { +- var1.setBlockMetadata(var2, var3 - 1, var4, var14 | var13, 2); ++ } else if (var12 == this.blockID) { ++ var13 = par1World.rand.nextInt(16) & var9; ++ var14 = par1World.getBlockMetadata(par2, par3 - 1, par4); ++ ++ if (var14 != (var14 | var13)) { ++ par1World.setBlockMetadataWithNotify(par2, par3 - 1, par4, var14 | var13, 2); + } + } + } + } + } +- + } + +- public int onBlockPlaced(World var1, int var2, int var3, int var4, int var5, float var6, float var7, float var8, int var9) { ++ /** ++ * Called when a block is placed using its ItemBlock. Args: World, X, Y, Z, side, hitX, hitY, hitZ, block metadata ++ */ ++ public int onBlockPlaced(World par1World, int par2, int par3, int par4, int par5, float par6, float par7, float par8, int par9) { + byte var10 = 0; +- switch(var5) { +- case 2: +- var10 = 1; +- break; +- case 3: +- var10 = 4; +- break; +- case 4: +- var10 = 8; +- break; +- case 5: +- var10 = 2; ++ ++ switch (par5) { ++ case 2: ++ var10 = 1; ++ break; ++ ++ case 3: ++ var10 = 4; ++ break; ++ ++ case 4: ++ var10 = 8; ++ break; ++ ++ case 5: ++ var10 = 2; + } + +- return var10 != 0 ? var10 : var9; +- } +- +- public int idDropped(int var1, Random var2, int var3) { +- return 0; +- } +- +- public int quantityDropped(Random var1) { +- return 0; +- } +- +- public void harvestBlock(World var1, EntityPlayer var2, int var3, int var4, int var5, int var6) { +- if(!var1.isRemote && var2.getCurrentEquippedItem() != null && var2.getCurrentEquippedItem().itemID == Item.shears.itemID) { +- var2.addStat(StatList.mineBlockStatArray[this.blockID], 1); +- this.dropBlockAsItem_do(var1, var3, var4, var5, new ItemStack(Block.vine, 1, 0)); ++ return var10 != 0 ? var10 : par9; ++ } ++ ++ /** ++ * Returns the ID of the items to drop on destruction. ++ */ ++ public int idDropped(int par1, Random par2Random, int par3) { ++ return 0; ++ } ++ ++ /** ++ * Returns the quantity of items to drop on block destruction. ++ */ ++ public int quantityDropped(Random par1Random) { ++ return 0; ++ } ++ ++ /** ++ * Called when the player destroys a block with an item that can harvest it. (i, j, k) are the coordinates of the block ++ * and l is the block's subtype/damage. ++ */ ++ public void harvestBlock(World par1World, EntityPlayer par2EntityPlayer, int par3, int par4, int par5, int par6) { ++ if (!par1World.isRemote && par2EntityPlayer.getCurrentEquippedItem() != null && par2EntityPlayer.getCurrentEquippedItem().itemID == Item.shears.itemID) { ++ par2EntityPlayer.addStat(StatList.mineBlockStatArray[this.blockID], 1); ++ this.dropBlockAsItem_do(par1World, par3, par4, par5, new ItemStack(Block.vine, 1, 0)); + } else { +- super.harvestBlock(var1, var2, var3, var4, var5, var6); ++ super.harvestBlock(par1World, par2EntityPlayer, par3, par4, par5, par6); + } +- + } + } diff --git a/patches/net/minecraft/src/BlockWall.java.patch b/patches/net/minecraft/src/BlockWall.java.patch new file mode 100644 index 0000000..f545a04 --- /dev/null +++ b/patches/net/minecraft/src/BlockWall.java.patch @@ -0,0 +1,197 @@ +--- net/minecraft/src/BlockWall.java ++++ net/minecraft/src/BlockWall.java +@@ -3,84 +3,111 @@ + import java.util.List; + + public class BlockWall extends Block { +- public static final String[] a = new String[]{"normal", "mossy"}; +- +- public BlockWall(int var1, Block var2) { +- super(var1, var2.blockMaterial); +- this.setHardness(var2.blockHardness); +- this.setResistance(var2.blockResistance / 3.0F); +- this.setStepSound(var2.stepSound); ++ ++ /** The types of the wall. */ ++ public static final String[] types = new String[] {"normal", "mossy"}; ++ ++ public BlockWall(int par1, Block par2Block) { ++ super(par1, par2Block.blockMaterial); ++ this.setHardness(par2Block.blockHardness); ++ this.setResistance(par2Block.blockResistance / 3.0F); ++ this.setStepSound(par2Block.stepSound); + this.setCreativeTab(CreativeTabs.tabBlock); + } + +- public Icon getIcon(int var1, int var2) { +- return var2 == 1 ? Block.cobblestoneMossy.getBlockTextureFromSide(var1) : Block.cobblestone.getBlockTextureFromSide(var1); ++ /** ++ * From the specified side and block metadata retrieves the blocks texture. Args: side, metadata ++ */ ++ public Icon getIcon(int par1, int par2) { ++ return par2 == 1 ? Block.cobblestoneMossy.getBlockTextureFromSide(par1) : Block.cobblestone.getBlockTextureFromSide(par1); + } + ++ /** ++ * The type of render function that is called for this block ++ */ + public int getRenderType() { + return 32; + } + ++ /** ++ * If this block doesn't render as an ordinary block it will return False (examples: signs, buttons, stairs, etc) ++ */ + public boolean renderAsNormalBlock() { + return false; + } + +- public boolean getBlocksMovement(IBlockAccess var1, int var2, int var3, int var4) { ++ public boolean getBlocksMovement(IBlockAccess par1IBlockAccess, int par2, int par3, int par4) { + return false; + } + ++ /** ++ * Is this block (a) opaque and (b) a full 1m cube? This determines whether or not to render the shared face of two ++ * adjacent blocks and also whether the player can attach torches, redstone wire, etc to this block. ++ */ + public boolean isOpaqueCube() { + return false; + } + +- public void setBlockBoundsBasedOnState(IBlockAccess var1, int var2, int var3, int var4) { +- boolean var5 = this.canConnectWallTo(var1, var2, var3, var4 - 1); +- boolean var6 = this.canConnectWallTo(var1, var2, var3, var4 + 1); +- boolean var7 = this.canConnectWallTo(var1, var2 - 1, var3, var4); +- boolean var8 = this.canConnectWallTo(var1, var2 + 1, var3, var4); ++ /** ++ * Updates the blocks bounds based on its current state. Args: world, x, y, z ++ */ ++ public void setBlockBoundsBasedOnState(IBlockAccess par1IBlockAccess, int par2, int par3, int par4) { ++ boolean var5 = this.canConnectWallTo(par1IBlockAccess, par2, par3, par4 - 1); ++ boolean var6 = this.canConnectWallTo(par1IBlockAccess, par2, par3, par4 + 1); ++ boolean var7 = this.canConnectWallTo(par1IBlockAccess, par2 - 1, par3, par4); ++ boolean var8 = this.canConnectWallTo(par1IBlockAccess, par2 + 1, par3, par4); + float var9 = 0.25F; +- float var10 = 12.0F / 16.0F; ++ float var10 = 0.75F; + float var11 = 0.25F; +- float var12 = 12.0F / 16.0F; ++ float var12 = 0.75F; + float var13 = 1.0F; +- if(var5) { ++ ++ if (var5) { + var11 = 0.0F; + } + +- if(var6) { ++ if (var6) { + var12 = 1.0F; + } + +- if(var7) { ++ if (var7) { + var9 = 0.0F; + } + +- if(var8) { ++ if (var8) { + var10 = 1.0F; + } + +- if(var5 && var6 && !var7 && !var8) { +- var13 = 13.0F / 16.0F; +- var9 = 5.0F / 16.0F; +- var10 = 11.0F / 16.0F; +- } else if(!var5 && !var6 && var7 && var8) { +- var13 = 13.0F / 16.0F; +- var11 = 5.0F / 16.0F; +- var12 = 11.0F / 16.0F; ++ if (var5 && var6 && !var7 && !var8) { ++ var13 = 0.8125F; ++ var9 = 0.3125F; ++ var10 = 0.6875F; ++ } else if (!var5 && !var6 && var7 && var8) { ++ var13 = 0.8125F; ++ var11 = 0.3125F; ++ var12 = 0.6875F; + } + + this.setBlockBounds(var9, 0.0F, var11, var10, var13, var12); + } + +- public AxisAlignedBB getCollisionBoundingBoxFromPool(World var1, int var2, int var3, int var4) { +- this.setBlockBoundsBasedOnState(var1, var2, var3, var4); ++ /** ++ * Returns a bounding box from the pool of bounding boxes (this means this box can change after the pool has been ++ * cleared to be reused) ++ */ ++ public AxisAlignedBB getCollisionBoundingBoxFromPool(World par1World, int par2, int par3, int par4) { ++ this.setBlockBoundsBasedOnState(par1World, par2, par3, par4); + this.maxY = 1.5D; +- return super.getCollisionBoundingBoxFromPool(var1, var2, var3, var4); ++ return super.getCollisionBoundingBoxFromPool(par1World, par2, par3, par4); + } + +- public boolean canConnectWallTo(IBlockAccess var1, int var2, int var3, int var4) { +- int var5 = var1.getBlockId(var2, var3, var4); +- if(var5 != this.blockID && var5 != Block.fenceGate.blockID) { ++ /** ++ * Return whether an adjacent block can connect to a wall. ++ */ ++ public boolean canConnectWallTo(IBlockAccess par1IBlockAccess, int par2, int par3, int par4) { ++ int var5 = par1IBlockAccess.getBlockId(par2, par3, par4); ++ ++ if (var5 != this.blockID && var5 != Block.fenceGate.blockID) { + Block var6 = Block.blocksList[var5]; + return var6 != null && var6.blockMaterial.isOpaque() && var6.renderAsNormalBlock() ? var6.blockMaterial != Material.pumpkin : false; + } else { +@@ -88,19 +115,32 @@ + } + } + +- public void getSubBlocks(int var1, CreativeTabs var2, List var3) { +- var3.add(new ItemStack(var1, 1, 0)); +- var3.add(new ItemStack(var1, 1, 1)); +- } +- +- public int damageDropped(int var1) { +- return var1; +- } +- +- public boolean shouldSideBeRendered(IBlockAccess var1, int var2, int var3, int var4, int var5) { +- return var5 == 0 ? super.shouldSideBeRendered(var1, var2, var3, var4, var5) : true; +- } +- +- public void registerIcons(IconRegister var1) { +- } ++ /** ++ * returns a list of blocks with the same ID, but different meta (eg: wood returns 4 blocks) ++ */ ++ public void getSubBlocks(int par1, CreativeTabs par2CreativeTabs, List par3List) { ++ par3List.add(new ItemStack(par1, 1, 0)); ++ par3List.add(new ItemStack(par1, 1, 1)); ++ } ++ ++ /** ++ * Determines the damage on the item the block drops. Used in cloth and wood. ++ */ ++ public int damageDropped(int par1) { ++ return par1; ++ } ++ ++ /** ++ * Returns true if the given side of this block type should be rendered, if the adjacent block is at the given ++ * coordinates. Args: blockAccess, x, y, z, side ++ */ ++ public boolean shouldSideBeRendered(IBlockAccess par1IBlockAccess, int par2, int par3, int par4, int par5) { ++ return par5 == 0 ? super.shouldSideBeRendered(par1IBlockAccess, par2, par3, par4, par5) : true; ++ } ++ ++ /** ++ * When this method is called, your block should register all the icons it needs with the given IconRegister. This is ++ * the only chance you get to register icons. ++ */ ++ public void registerIcons(IconRegister par1IconRegister) {} + } diff --git a/patches/net/minecraft/src/BlockWeb.java.patch b/patches/net/minecraft/src/BlockWeb.java.patch new file mode 100644 index 0000000..7af9be1 --- /dev/null +++ b/patches/net/minecraft/src/BlockWeb.java.patch @@ -0,0 +1,67 @@ +--- net/minecraft/src/BlockWeb.java ++++ net/minecraft/src/BlockWeb.java +@@ -3,35 +3,58 @@ + import java.util.Random; + + public class BlockWeb extends Block { +- public BlockWeb(int var1) { +- super(var1, Material.web); ++ public BlockWeb(int par1) { ++ super(par1, Material.web); + this.setCreativeTab(CreativeTabs.tabDecorations); + } + +- public void onEntityCollidedWithBlock(World var1, int var2, int var3, int var4, Entity var5) { +- var5.setInWeb(); ++ /** ++ * Triggered whenever an entity collides with this block (enters into the block). Args: world, x, y, z, entity ++ */ ++ public void onEntityCollidedWithBlock(World par1World, int par2, int par3, int par4, Entity par5Entity) { ++ par5Entity.setInWeb(); + } + ++ /** ++ * Is this block (a) opaque and (b) a full 1m cube? This determines whether or not to render the shared face of two ++ * adjacent blocks and also whether the player can attach torches, redstone wire, etc to this block. ++ */ + public boolean isOpaqueCube() { + return false; + } + +- public AxisAlignedBB getCollisionBoundingBoxFromPool(World var1, int var2, int var3, int var4) { ++ /** ++ * Returns a bounding box from the pool of bounding boxes (this means this box can change after the pool has been ++ * cleared to be reused) ++ */ ++ public AxisAlignedBB getCollisionBoundingBoxFromPool(World par1World, int par2, int par3, int par4) { + return null; + } + ++ /** ++ * The type of render function that is called for this block ++ */ + public int getRenderType() { + return 1; + } + ++ /** ++ * If this block doesn't render as an ordinary block it will return False (examples: signs, buttons, stairs, etc) ++ */ + public boolean renderAsNormalBlock() { + return false; + } + +- public int idDropped(int var1, Random var2, int var3) { ++ /** ++ * Returns the ID of the items to drop on destruction. ++ */ ++ public int idDropped(int par1, Random par2Random, int par3) { + return Item.silk.itemID; + } + ++ /** ++ * Return true if a player with Silk Touch can harvest this block directly, and not its normal drops. ++ */ + protected boolean canSilkHarvest() { + return true; + } diff --git a/patches/net/minecraft/src/BlockWood.java.patch b/patches/net/minecraft/src/BlockWood.java.patch new file mode 100644 index 0000000..31a7015 --- /dev/null +++ b/patches/net/minecraft/src/BlockWood.java.patch @@ -0,0 +1,85 @@ +--- net/minecraft/src/BlockWood.java ++++ net/minecraft/src/BlockWood.java +@@ -3,39 +3,53 @@ + import java.util.List; + + public class BlockWood extends Block { +- public static final String[] a = new String[]{"oak", "spruce", "birch", "jungle"}; ++ ++ /** The type of tree this block came from. */ ++ public static final String[] woodType = new String[] {"oak", "spruce", "birch", "jungle"}; + private Icon[] iconArray; + +- public BlockWood(int var1) { +- super(var1, Material.wood); ++ public BlockWood(int par1) { ++ super(par1, Material.wood); + this.setCreativeTab(CreativeTabs.tabBlock); + } + +- public Icon getIcon(int var1, int var2) { +- if(var2 < 0 || var2 >= this.iconArray.length) { +- var2 = 0; +- } +- +- return this.iconArray[var2]; +- } +- +- public int damageDropped(int var1) { +- return var1; +- } +- +- public void getSubBlocks(int var1, CreativeTabs var2, List var3) { +- var3.add(new ItemStack(var1, 1, 0)); +- var3.add(new ItemStack(var1, 1, 1)); +- var3.add(new ItemStack(var1, 1, 2)); +- var3.add(new ItemStack(var1, 1, 3)); +- } +- +- public void registerIcons(IconRegister var1) { +- this.iconArray = new Icon[a.length]; +- +- for(int var2 = 0; var2 < this.iconArray.length; ++var2) { +- this.iconArray[var2] = var1.registerIcon(this.getTextureName() + "_" + a[var2]); +- } +- ++ /** ++ * From the specified side and block metadata retrieves the blocks texture. Args: side, metadata ++ */ ++ public Icon getIcon(int par1, int par2) { ++ if (par2 < 0 || par2 >= this.iconArray.length) { ++ par2 = 0; ++ } ++ ++ return this.iconArray[par2]; ++ } ++ ++ /** ++ * Determines the damage on the item the block drops. Used in cloth and wood. ++ */ ++ public int damageDropped(int par1) { ++ return par1; ++ } ++ ++ /** ++ * returns a list of blocks with the same ID, but different meta (eg: wood returns 4 blocks) ++ */ ++ public void getSubBlocks(int par1, CreativeTabs par2CreativeTabs, List par3List) { ++ par3List.add(new ItemStack(par1, 1, 0)); ++ par3List.add(new ItemStack(par1, 1, 1)); ++ par3List.add(new ItemStack(par1, 1, 2)); ++ par3List.add(new ItemStack(par1, 1, 3)); ++ } ++ ++ /** ++ * When this method is called, your block should register all the icons it needs with the given IconRegister. This is ++ * the only chance you get to register icons. ++ */ ++ public void registerIcons(IconRegister par1IconRegister) { ++ this.iconArray = new Icon[woodType.length]; ++ ++ for (int var2 = 0; var2 < this.iconArray.length; ++var2) { ++ this.iconArray[var2] = par1IconRegister.registerIcon(this.getTextureName() + "_" + woodType[var2]); ++ } + } + } diff --git a/patches/net/minecraft/src/BlockWoodSlab.java.patch b/patches/net/minecraft/src/BlockWoodSlab.java.patch new file mode 100644 index 0000000..accd775 --- /dev/null +++ b/patches/net/minecraft/src/BlockWoodSlab.java.patch @@ -0,0 +1,85 @@ +--- net/minecraft/src/BlockWoodSlab.java ++++ net/minecraft/src/BlockWoodSlab.java +@@ -4,42 +4,62 @@ + import java.util.Random; + + public class BlockWoodSlab extends BlockHalfSlab { +- public static final String[] b = new String[]{"oak", "spruce", "birch", "jungle"}; +- +- public BlockWoodSlab(int var1, boolean var2) { +- super(var1, var2, Material.wood); ++ ++ /** The type of tree this slab came from. */ ++ public static final String[] woodType = new String[] {"oak", "spruce", "birch", "jungle"}; ++ ++ public BlockWoodSlab(int par1, boolean par2) { ++ super(par1, par2, Material.wood); + this.setCreativeTab(CreativeTabs.tabBlock); + } + +- public Icon getIcon(int var1, int var2) { +- return Block.planks.getIcon(var1, var2 & 7); ++ /** ++ * From the specified side and block metadata retrieves the blocks texture. Args: side, metadata ++ */ ++ public Icon getIcon(int par1, int par2) { ++ return Block.planks.getIcon(par1, par2 & 7); + } + +- public int idDropped(int var1, Random var2, int var3) { ++ /** ++ * Returns the ID of the items to drop on destruction. ++ */ ++ public int idDropped(int par1, Random par2Random, int par3) { + return Block.woodSingleSlab.blockID; + } + +- protected ItemStack createStackedBlock(int var1) { +- return new ItemStack(Block.woodSingleSlab.blockID, 2, var1 & 7); ++ /** ++ * Returns an item stack containing a single instance of the current block type. 'i' is the block's subtype/damage and ++ * is ignored for blocks which do not support subtypes. Blocks which cannot be harvested should return null. ++ */ ++ protected ItemStack createStackedBlock(int par1) { ++ return new ItemStack(Block.woodSingleSlab.blockID, 2, par1 & 7); + } + +- public String getFullSlabName(int var1) { +- if(var1 < 0 || var1 >= b.length) { +- var1 = 0; ++ /** ++ * Returns the slab block name with step type. ++ */ ++ public String getFullSlabName(int par1) { ++ if (par1 < 0 || par1 >= woodType.length) { ++ par1 = 0; + } + +- return super.getUnlocalizedName() + "." + b[var1]; ++ return super.getUnlocalizedName() + "." + woodType[par1]; + } + +- public void getSubBlocks(int var1, CreativeTabs var2, List var3) { +- if(var1 != Block.woodDoubleSlab.blockID) { +- for(int var4 = 0; var4 < 4; ++var4) { +- var3.add(new ItemStack(var1, 1, var4)); ++ /** ++ * returns a list of blocks with the same ID, but different meta (eg: wood returns 4 blocks) ++ */ ++ public void getSubBlocks(int par1, CreativeTabs par2CreativeTabs, List par3List) { ++ if (par1 != Block.woodDoubleSlab.blockID) { ++ for (int var4 = 0; var4 < 4; ++var4) { ++ par3List.add(new ItemStack(par1, 1, var4)); + } +- + } + } + +- public void registerIcons(IconRegister var1) { +- } ++ /** ++ * When this method is called, your block should register all the icons it needs with the given IconRegister. This is ++ * the only chance you get to register icons. ++ */ ++ public void registerIcons(IconRegister par1IconRegister) {} + } diff --git a/patches/net/minecraft/src/BlockWorkbench.java.patch b/patches/net/minecraft/src/BlockWorkbench.java.patch new file mode 100644 index 0000000..d7e5e02 --- /dev/null +++ b/patches/net/minecraft/src/BlockWorkbench.java.patch @@ -0,0 +1,54 @@ +--- net/minecraft/src/BlockWorkbench.java ++++ net/minecraft/src/BlockWorkbench.java +@@ -4,26 +4,36 @@ + private Icon workbenchIconTop; + private Icon workbenchIconFront; + +- protected BlockWorkbench(int var1) { +- super(var1, Material.wood); ++ protected BlockWorkbench(int par1) { ++ super(par1, Material.wood); + this.setCreativeTab(CreativeTabs.tabDecorations); + } + +- public Icon getIcon(int var1, int var2) { +- return var1 == 1 ? this.workbenchIconTop : (var1 == 0 ? Block.planks.getBlockTextureFromSide(var1) : (var1 != 2 && var1 != 4 ? this.blockIcon : this.workbenchIconFront)); +- } +- +- public void registerIcons(IconRegister var1) { +- this.blockIcon = var1.registerIcon(this.getTextureName() + "_side"); +- this.workbenchIconTop = var1.registerIcon(this.getTextureName() + "_top"); +- this.workbenchIconFront = var1.registerIcon(this.getTextureName() + "_front"); +- } +- +- public boolean onBlockActivated(World var1, int var2, int var3, int var4, EntityPlayer var5, int var6, float var7, float var8, float var9) { +- if(var1.isRemote) { ++ /** ++ * From the specified side and block metadata retrieves the blocks texture. Args: side, metadata ++ */ ++ public Icon getIcon(int par1, int par2) { ++ return par1 == 1 ? this.workbenchIconTop : (par1 == 0 ? Block.planks.getBlockTextureFromSide(par1) : (par1 != 2 && par1 != 4 ? this.blockIcon : this.workbenchIconFront)); ++ } ++ ++ /** ++ * When this method is called, your block should register all the icons it needs with the given IconRegister. This is ++ * the only chance you get to register icons. ++ */ ++ public void registerIcons(IconRegister par1IconRegister) { ++ this.blockIcon = par1IconRegister.registerIcon(this.getTextureName() + "_side"); ++ this.workbenchIconTop = par1IconRegister.registerIcon(this.getTextureName() + "_top"); ++ this.workbenchIconFront = par1IconRegister.registerIcon(this.getTextureName() + "_front"); ++ } ++ ++ /** ++ * Called upon block activation (right click on the block.) ++ */ ++ public boolean onBlockActivated(World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer, int par6, float par7, float par8, float par9) { ++ if (par1World.isRemote) { + return true; + } else { +- var5.displayGUIWorkbench(var2, var3, var4); ++ par5EntityPlayer.displayGUIWorkbench(par2, par3, par4); + return true; + } + } diff --git a/patches/net/minecraft/src/BossStatus.java.patch b/patches/net/minecraft/src/BossStatus.java.patch new file mode 100644 index 0000000..27678ac --- /dev/null +++ b/patches/net/minecraft/src/BossStatus.java.patch @@ -0,0 +1,21 @@ +--- net/minecraft/src/BossStatus.java ++++ net/minecraft/src/BossStatus.java +@@ -3,13 +3,13 @@ + public final class BossStatus { + public static float healthScale; + public static int statusBarLength; +- public static String c; ++ public static String bossName; + public static boolean field_82825_d; + +- public static void setBossStatus(IBossDisplayData var0, boolean var1) { +- healthScale = var0.getHealth() / var0.getMaxHealth(); ++ public static void setBossStatus(IBossDisplayData par0IBossDisplayData, boolean par1) { ++ healthScale = par0IBossDisplayData.getHealth() / par0IBossDisplayData.getMaxHealth(); + statusBarLength = 100; +- c = var0.getEntityName(); +- field_82825_d = var1; ++ bossName = par0IBossDisplayData.getEntityName(); ++ field_82825_d = par1; + } + } diff --git a/patches/net/minecraft/src/CallableBlockDataValue.java.patch b/patches/net/minecraft/src/CallableBlockDataValue.java.patch new file mode 100644 index 0000000..944461a --- /dev/null +++ b/patches/net/minecraft/src/CallableBlockDataValue.java.patch @@ -0,0 +1,24 @@ +--- net/minecraft/src/CallableBlockDataValue.java ++++ net/minecraft/src/CallableBlockDataValue.java +@@ -5,16 +5,16 @@ + final class CallableBlockDataValue implements Callable { + final int field_85063_a; + +- CallableBlockDataValue(int var1) { +- this.field_85063_a = var1; ++ CallableBlockDataValue(int par1) { ++ this.field_85063_a = par1; + } + + public String callBlockDataValue() { +- if(this.field_85063_a < 0) { ++ if (this.field_85063_a < 0) { + return "Unknown? (Got " + this.field_85063_a + ")"; + } else { +- String var1 = String.format("%4s", new Object[]{Integer.toBinaryString(this.field_85063_a)}).replace(" ", "0"); +- return String.format("%1$d / 0x%1$X / 0b%2$s", new Object[]{Integer.valueOf(this.field_85063_a), var1}); ++ String var1 = String.format("%4s", new Object[] {Integer.toBinaryString(this.field_85063_a)}).replace(" ", "0"); ++ return String.format("%1$d / 0x%1$X / 0b%2$s", new Object[] {Integer.valueOf(this.field_85063_a), var1}); + } + } + diff --git a/patches/net/minecraft/src/CallableBlockLocation.java.patch b/patches/net/minecraft/src/CallableBlockLocation.java.patch new file mode 100644 index 0000000..692b428 --- /dev/null +++ b/patches/net/minecraft/src/CallableBlockLocation.java.patch @@ -0,0 +1,22 @@ +--- net/minecraft/src/CallableBlockLocation.java ++++ net/minecraft/src/CallableBlockLocation.java +@@ -4,13 +4,15 @@ + + final class CallableBlockLocation implements Callable { + final int blockXCoord; ++ + final int blockYCoord; ++ + final int blockZCoord; + +- CallableBlockLocation(int var1, int var2, int var3) { +- this.blockXCoord = var1; +- this.blockYCoord = var2; +- this.blockZCoord = var3; ++ CallableBlockLocation(int par1, int par2, int par3) { ++ this.blockXCoord = par1; ++ this.blockYCoord = par2; ++ this.blockZCoord = par3; + } + + public String callBlockLocationInfo() { diff --git a/patches/net/minecraft/src/CallableBlockType.java.patch b/patches/net/minecraft/src/CallableBlockType.java.patch new file mode 100644 index 0000000..3dc4996 --- /dev/null +++ b/patches/net/minecraft/src/CallableBlockType.java.patch @@ -0,0 +1,19 @@ +--- net/minecraft/src/CallableBlockType.java ++++ net/minecraft/src/CallableBlockType.java +@@ -5,13 +5,13 @@ + final class CallableBlockType implements Callable { + final int blockID; + +- CallableBlockType(int var1) { +- this.blockID = var1; ++ CallableBlockType(int par1) { ++ this.blockID = par1; + } + + public String callBlockType() { + try { +- return String.format("ID #%d (%s // %s)", new Object[]{Integer.valueOf(this.blockID), Block.blocksList[this.blockID].getUnlocalizedName(), Block.blocksList[this.blockID].getClass().getCanonicalName()}); ++ return String.format("ID #%d (%s // %s)", new Object[] {Integer.valueOf(this.blockID), Block.blocksList[this.blockID].getUnlocalizedName(), Block.blocksList[this.blockID].getClass().getCanonicalName()}); + } catch (Throwable var2) { + return "ID #" + this.blockID; + } diff --git a/patches/net/minecraft/src/CallableChunkPosHash.java.patch b/patches/net/minecraft/src/CallableChunkPosHash.java.patch new file mode 100644 index 0000000..0a63441 --- /dev/null +++ b/patches/net/minecraft/src/CallableChunkPosHash.java.patch @@ -0,0 +1,22 @@ +--- net/minecraft/src/CallableChunkPosHash.java ++++ net/minecraft/src/CallableChunkPosHash.java +@@ -4,13 +4,15 @@ + + class CallableChunkPosHash implements Callable { + final int field_85165_a; ++ + final int field_85163_b; ++ + final MapGenStructure theMapStructureGenerator; + +- CallableChunkPosHash(MapGenStructure var1, int var2, int var3) { +- this.theMapStructureGenerator = var1; +- this.field_85165_a = var2; +- this.field_85163_b = var3; ++ CallableChunkPosHash(MapGenStructure par1MapGenStructure, int par2, int par3) { ++ this.theMapStructureGenerator = par1MapGenStructure; ++ this.field_85165_a = par2; ++ this.field_85163_b = par3; + } + + public String callChunkPositionHash() { diff --git a/patches/net/minecraft/src/CallableClientMemoryStats.java.patch b/patches/net/minecraft/src/CallableClientMemoryStats.java.patch new file mode 100644 index 0000000..d294a7c --- /dev/null +++ b/patches/net/minecraft/src/CallableClientMemoryStats.java.patch @@ -0,0 +1,13 @@ +--- net/minecraft/src/CallableClientMemoryStats.java ++++ net/minecraft/src/CallableClientMemoryStats.java +@@ -5,8 +5,8 @@ + class CallableClientMemoryStats implements Callable { + final Minecraft theMinecraft; + +- CallableClientMemoryStats(Minecraft var1) { +- this.theMinecraft = var1; ++ CallableClientMemoryStats(Minecraft par1Minecraft) { ++ this.theMinecraft = par1Minecraft; + } + + public String callClientMemoryStats() { diff --git a/patches/net/minecraft/src/CallableClientProfiler.java.patch b/patches/net/minecraft/src/CallableClientProfiler.java.patch new file mode 100644 index 0000000..fdd5d27 --- /dev/null +++ b/patches/net/minecraft/src/CallableClientProfiler.java.patch @@ -0,0 +1,13 @@ +--- net/minecraft/src/CallableClientProfiler.java ++++ net/minecraft/src/CallableClientProfiler.java +@@ -5,8 +5,8 @@ + class CallableClientProfiler implements Callable { + final Minecraft theMinecraft; + +- CallableClientProfiler(Minecraft var1) { +- this.theMinecraft = var1; ++ CallableClientProfiler(Minecraft par1Minecraft) { ++ this.theMinecraft = par1Minecraft; + } + + public String callClientProfilerInfo() { diff --git a/patches/net/minecraft/src/CallableConnectionName.java.patch b/patches/net/minecraft/src/CallableConnectionName.java.patch new file mode 100644 index 0000000..ab38aad --- /dev/null +++ b/patches/net/minecraft/src/CallableConnectionName.java.patch @@ -0,0 +1,18 @@ +--- net/minecraft/src/CallableConnectionName.java ++++ net/minecraft/src/CallableConnectionName.java +@@ -4,11 +4,12 @@ + + class CallableConnectionName implements Callable { + final NetServerHandler field_111201_a; ++ + final NetworkListenThread field_111200_b; + +- CallableConnectionName(NetworkListenThread var1, NetServerHandler var2) { +- this.field_111200_b = var1; +- this.field_111201_a = var2; ++ CallableConnectionName(NetworkListenThread par1NetworkListenThread, NetServerHandler par2NetServerHandler) { ++ this.field_111200_b = par1NetworkListenThread; ++ this.field_111201_a = par2NetServerHandler; + } + + public String func_111199_a() { diff --git a/patches/net/minecraft/src/CallableCrashMemoryReport.java.patch b/patches/net/minecraft/src/CallableCrashMemoryReport.java.patch new file mode 100644 index 0000000..3f1d8d9 --- /dev/null +++ b/patches/net/minecraft/src/CallableCrashMemoryReport.java.patch @@ -0,0 +1,18 @@ +--- net/minecraft/src/CallableCrashMemoryReport.java ++++ net/minecraft/src/CallableCrashMemoryReport.java +@@ -5,10 +5,13 @@ + class CallableCrashMemoryReport implements Callable { + final CrashReport theCrashReport; + +- CallableCrashMemoryReport(CrashReport var1) { +- this.theCrashReport = var1; ++ CallableCrashMemoryReport(CrashReport par1CrashReport) { ++ this.theCrashReport = par1CrashReport; + } + ++ /** ++ * Returns a string with allocated and used memory. ++ */ + public String getMemoryReport() { + int var1 = AxisAlignedBB.getAABBPool().getlistAABBsize(); + int var2 = 56 * var1; diff --git a/patches/net/minecraft/src/CallableEntityName.java.patch b/patches/net/minecraft/src/CallableEntityName.java.patch new file mode 100644 index 0000000..2504f08 --- /dev/null +++ b/patches/net/minecraft/src/CallableEntityName.java.patch @@ -0,0 +1,13 @@ +--- net/minecraft/src/CallableEntityName.java ++++ net/minecraft/src/CallableEntityName.java +@@ -5,8 +5,8 @@ + class CallableEntityName implements Callable { + final Entity theEntity; + +- CallableEntityName(Entity var1) { +- this.theEntity = var1; ++ CallableEntityName(Entity par1Entity) { ++ this.theEntity = par1Entity; + } + + public String callEntityName() { diff --git a/patches/net/minecraft/src/CallableEntityTracker.java.patch b/patches/net/minecraft/src/CallableEntityTracker.java.patch new file mode 100644 index 0000000..d2d83de --- /dev/null +++ b/patches/net/minecraft/src/CallableEntityTracker.java.patch @@ -0,0 +1,25 @@ +--- net/minecraft/src/CallableEntityTracker.java ++++ net/minecraft/src/CallableEntityTracker.java +@@ -4,16 +4,18 @@ + + class CallableEntityTracker implements Callable { + final int field_96570_a; ++ + final EntityTracker theEntityTracker; + +- CallableEntityTracker(EntityTracker var1, int var2) { +- this.theEntityTracker = var1; +- this.field_96570_a = var2; ++ CallableEntityTracker(EntityTracker par1EntityTracker, int par2) { ++ this.theEntityTracker = par1EntityTracker; ++ this.field_96570_a = par2; + } + + public String func_96568_a() { + String var1 = "Once per " + this.field_96570_a + " ticks"; +- if(this.field_96570_a == Integer.MAX_VALUE) { ++ ++ if (this.field_96570_a == Integer.MAX_VALUE) { + var1 = "Maximum (" + var1 + ")"; + } + diff --git a/patches/net/minecraft/src/CallableEntityType.java.patch b/patches/net/minecraft/src/CallableEntityType.java.patch new file mode 100644 index 0000000..989022e --- /dev/null +++ b/patches/net/minecraft/src/CallableEntityType.java.patch @@ -0,0 +1,13 @@ +--- net/minecraft/src/CallableEntityType.java ++++ net/minecraft/src/CallableEntityType.java +@@ -5,8 +5,8 @@ + class CallableEntityType implements Callable { + final Entity theEntity; + +- CallableEntityType(Entity var1) { +- this.theEntity = var1; ++ CallableEntityType(Entity par1Entity) { ++ this.theEntity = par1Entity; + } + + public String callEntityType() { diff --git a/patches/net/minecraft/src/CallableGLInfo.java.patch b/patches/net/minecraft/src/CallableGLInfo.java.patch new file mode 100644 index 0000000..23eb771 --- /dev/null +++ b/patches/net/minecraft/src/CallableGLInfo.java.patch @@ -0,0 +1,17 @@ +--- net/minecraft/src/CallableGLInfo.java ++++ net/minecraft/src/CallableGLInfo.java +@@ -4,10 +4,12 @@ + import org.lwjgl.opengl.GL11; + + class CallableGLInfo implements Callable { ++ ++ /** The Minecraft instance. */ + final Minecraft mc; + +- CallableGLInfo(Minecraft var1) { +- this.mc = var1; ++ CallableGLInfo(Minecraft par1Minecraft) { ++ this.mc = par1Minecraft; + } + + public String getTexturePack() { diff --git a/patches/net/minecraft/src/CallableIntCache.java.patch b/patches/net/minecraft/src/CallableIntCache.java.patch new file mode 100644 index 0000000..8a37f60 --- /dev/null +++ b/patches/net/minecraft/src/CallableIntCache.java.patch @@ -0,0 +1,13 @@ +--- net/minecraft/src/CallableIntCache.java ++++ net/minecraft/src/CallableIntCache.java +@@ -5,8 +5,8 @@ + class CallableIntCache implements Callable { + final CrashReport theCrashReport; + +- CallableIntCache(CrashReport var1) { +- this.theCrashReport = var1; ++ CallableIntCache(CrashReport par1CrashReport) { ++ this.theCrashReport = par1CrashReport; + } + + public String func_85083_a() { diff --git a/patches/net/minecraft/src/CallableIsFeatureChunk.java.patch b/patches/net/minecraft/src/CallableIsFeatureChunk.java.patch new file mode 100644 index 0000000..d916196 --- /dev/null +++ b/patches/net/minecraft/src/CallableIsFeatureChunk.java.patch @@ -0,0 +1,22 @@ +--- net/minecraft/src/CallableIsFeatureChunk.java ++++ net/minecraft/src/CallableIsFeatureChunk.java +@@ -4,13 +4,15 @@ + + class CallableIsFeatureChunk implements Callable { + final int field_85169_a; ++ + final int field_85167_b; ++ + final MapGenStructure theMapStructureGenerator; + +- CallableIsFeatureChunk(MapGenStructure var1, int var2, int var3) { +- this.theMapStructureGenerator = var1; +- this.field_85169_a = var2; +- this.field_85167_b = var3; ++ CallableIsFeatureChunk(MapGenStructure par1MapGenStructure, int par2, int par3) { ++ this.theMapStructureGenerator = par1MapGenStructure; ++ this.field_85169_a = par2; ++ this.field_85167_b = par3; + } + + public String func_85166_a() { diff --git a/patches/net/minecraft/src/CallableIsModded.java.patch b/patches/net/minecraft/src/CallableIsModded.java.patch new file mode 100644 index 0000000..f102328 --- /dev/null +++ b/patches/net/minecraft/src/CallableIsModded.java.patch @@ -0,0 +1,27 @@ +--- net/minecraft/src/CallableIsModded.java ++++ net/minecraft/src/CallableIsModded.java +@@ -4,15 +4,21 @@ + import net.minecraft.client.ClientBrandRetriever; + + class CallableIsModded implements Callable { ++ ++ /** Reference to the IntegratedServer object. */ + final IntegratedServer theIntegratedServer; + +- CallableIsModded(IntegratedServer var1) { +- this.theIntegratedServer = var1; ++ CallableIsModded(IntegratedServer par1IntegratedServer) { ++ this.theIntegratedServer = par1IntegratedServer; + } + ++ /** ++ * Gets if your Minecraft is Modded. ++ */ + public String getMinecraftIsModded() { + String var1 = ClientBrandRetriever.getClientModName(); +- if(!var1.equals("vanilla")) { ++ ++ if (!var1.equals("vanilla")) { + return "Definitely; Client brand changed to \'" + var1 + "\'"; + } else { + var1 = this.theIntegratedServer.getServerModName(); diff --git a/patches/net/minecraft/src/CallableIsServerModded.java.patch b/patches/net/minecraft/src/CallableIsServerModded.java.patch new file mode 100644 index 0000000..dd22cdf --- /dev/null +++ b/patches/net/minecraft/src/CallableIsServerModded.java.patch @@ -0,0 +1,24 @@ +--- net/minecraft/src/CallableIsServerModded.java ++++ net/minecraft/src/CallableIsServerModded.java +@@ -4,14 +4,16 @@ + import net.minecraft.server.MinecraftServer; + + public class CallableIsServerModded implements Callable { +- final MinecraftServer a; +- +- public CallableIsServerModded(MinecraftServer var1) { +- this.a = var1; ++ ++ /** Reference to the MinecraftServer object. */ ++ final MinecraftServer mcServer; ++ ++ public CallableIsServerModded(MinecraftServer par1MinecraftServer) { ++ this.mcServer = par1MinecraftServer; + } + + public String func_96558_a() { +- return this.a.theProfiler.profilingEnabled ? this.a.theProfiler.getNameOfLastSection() : "N/A (disabled)"; ++ return this.mcServer.theProfiler.profilingEnabled ? this.mcServer.theProfiler.getNameOfLastSection() : "N/A (disabled)"; + } + + public Object call() { diff --git a/patches/net/minecraft/src/CallableItemName.java.patch b/patches/net/minecraft/src/CallableItemName.java.patch new file mode 100644 index 0000000..00e6707 --- /dev/null +++ b/patches/net/minecraft/src/CallableItemName.java.patch @@ -0,0 +1,18 @@ +--- net/minecraft/src/CallableItemName.java ++++ net/minecraft/src/CallableItemName.java +@@ -4,11 +4,12 @@ + + class CallableItemName implements Callable { + final ItemStack theItemStack; ++ + final InventoryPlayer playerInventory; + +- CallableItemName(InventoryPlayer var1, ItemStack var2) { +- this.playerInventory = var1; +- this.theItemStack = var2; ++ CallableItemName(InventoryPlayer par1InventoryPlayer, ItemStack par2ItemStack) { ++ this.playerInventory = par1InventoryPlayer; ++ this.theItemStack = par2ItemStack; + } + + public String callItemDisplayName() { diff --git a/patches/net/minecraft/src/CallableJVMFlags.java.patch b/patches/net/minecraft/src/CallableJVMFlags.java.patch new file mode 100644 index 0000000..4690ecb --- /dev/null +++ b/patches/net/minecraft/src/CallableJVMFlags.java.patch @@ -0,0 +1,46 @@ +--- net/minecraft/src/CallableJVMFlags.java ++++ net/minecraft/src/CallableJVMFlags.java +@@ -7,12 +7,17 @@ + import java.util.concurrent.Callable; + + class CallableJVMFlags implements Callable { ++ ++ /** Reference to the CrashReport object. */ + final CrashReport theCrashReport; + +- CallableJVMFlags(CrashReport var1) { +- this.theCrashReport = var1; ++ CallableJVMFlags(CrashReport par1CrashReport) { ++ this.theCrashReport = par1CrashReport; + } + ++ /** ++ * Returns the number of JVM Flags along with the passed JVM Flags. ++ */ + public String getJVMFlagsAsString() { + RuntimeMXBean var1 = ManagementFactory.getRuntimeMXBean(); + List var2 = var1.getInputArguments(); +@@ -20,10 +25,11 @@ + StringBuilder var4 = new StringBuilder(); + Iterator var5 = var2.iterator(); + +- while(var5.hasNext()) { ++ while (var5.hasNext()) { + String var6 = (String)var5.next(); +- if(var6.startsWith("-X")) { +- if(var3++ > 0) { ++ ++ if (var6.startsWith("-X")) { ++ if (var3++ > 0) { + var4.append(" "); + } + +@@ -31,7 +37,7 @@ + } + } + +- return String.format("%d total; %s", new Object[]{Integer.valueOf(var3), var4.toString()}); ++ return String.format("%d total; %s", new Object[] {Integer.valueOf(var3), var4.toString()}); + } + + public Object call() { diff --git a/patches/net/minecraft/src/CallableJavaInfo.java.patch b/patches/net/minecraft/src/CallableJavaInfo.java.patch new file mode 100644 index 0000000..b0370ca --- /dev/null +++ b/patches/net/minecraft/src/CallableJavaInfo.java.patch @@ -0,0 +1,22 @@ +--- net/minecraft/src/CallableJavaInfo.java ++++ net/minecraft/src/CallableJavaInfo.java +@@ -3,12 +3,17 @@ + import java.util.concurrent.Callable; + + class CallableJavaInfo implements Callable { ++ ++ /** Reference to the CrashReport object. */ + final CrashReport theCrashReport; + +- CallableJavaInfo(CrashReport var1) { +- this.theCrashReport = var1; ++ CallableJavaInfo(CrashReport par1CrashReport) { ++ this.theCrashReport = par1CrashReport; + } + ++ /** ++ * Returns the Java VM Information as a String. Includes the Version and Vender. ++ */ + public String getJavaInfoAsString() { + return System.getProperty("java.version") + ", " + System.getProperty("java.vendor"); + } diff --git a/patches/net/minecraft/src/CallableJavaInfo2.java.patch b/patches/net/minecraft/src/CallableJavaInfo2.java.patch new file mode 100644 index 0000000..ec48162 --- /dev/null +++ b/patches/net/minecraft/src/CallableJavaInfo2.java.patch @@ -0,0 +1,22 @@ +--- net/minecraft/src/CallableJavaInfo2.java ++++ net/minecraft/src/CallableJavaInfo2.java +@@ -3,12 +3,17 @@ + import java.util.concurrent.Callable; + + class CallableJavaInfo2 implements Callable { ++ ++ /** Reference to the CrashReport object. */ + final CrashReport theCrashReport; + +- CallableJavaInfo2(CrashReport var1) { +- this.theCrashReport = var1; ++ CallableJavaInfo2(CrashReport par1CrashReport) { ++ this.theCrashReport = par1CrashReport; + } + ++ /** ++ * Retuns the Java VM Information as a String. Includes the VM Name, VM Info and VM Vendor. ++ */ + public String getJavaVMInfoAsString() { + return System.getProperty("java.vm.name") + " (" + System.getProperty("java.vm.info") + "), " + System.getProperty("java.vm.vendor"); + } diff --git a/patches/net/minecraft/src/CallableLWJGLVersion.java.patch b/patches/net/minecraft/src/CallableLWJGLVersion.java.patch new file mode 100644 index 0000000..146a1ed --- /dev/null +++ b/patches/net/minecraft/src/CallableLWJGLVersion.java.patch @@ -0,0 +1,17 @@ +--- net/minecraft/src/CallableLWJGLVersion.java ++++ net/minecraft/src/CallableLWJGLVersion.java +@@ -4,10 +4,12 @@ + import org.lwjgl.Sys; + + class CallableLWJGLVersion implements Callable { ++ ++ /** Reference to the Minecraft object. */ + final Minecraft mc; + +- CallableLWJGLVersion(Minecraft var1) { +- this.mc = var1; ++ CallableLWJGLVersion(Minecraft par1Minecraft) { ++ this.mc = par1Minecraft; + } + + public String getType() { diff --git a/patches/net/minecraft/src/CallableLaunchedVersion.java.patch b/patches/net/minecraft/src/CallableLaunchedVersion.java.patch new file mode 100644 index 0000000..152023c --- /dev/null +++ b/patches/net/minecraft/src/CallableLaunchedVersion.java.patch @@ -0,0 +1,17 @@ +--- net/minecraft/src/CallableLaunchedVersion.java ++++ net/minecraft/src/CallableLaunchedVersion.java +@@ -3,10 +3,12 @@ + import java.util.concurrent.Callable; + + class CallableLaunchedVersion implements Callable { ++ ++ /** Reference to the Minecraft object. */ + final Minecraft mc; + +- CallableLaunchedVersion(Minecraft var1) { +- this.mc = var1; ++ CallableLaunchedVersion(Minecraft par1Minecraft) { ++ this.mc = par1Minecraft; + } + + public String getLWJGLVersion() { diff --git a/patches/net/minecraft/src/CallableLevelDimension.java.patch b/patches/net/minecraft/src/CallableLevelDimension.java.patch new file mode 100644 index 0000000..78d9f3d --- /dev/null +++ b/patches/net/minecraft/src/CallableLevelDimension.java.patch @@ -0,0 +1,13 @@ +--- net/minecraft/src/CallableLevelDimension.java ++++ net/minecraft/src/CallableLevelDimension.java +@@ -5,8 +5,8 @@ + class CallableLevelDimension implements Callable { + final WorldInfo worldInfoInstance; + +- CallableLevelDimension(WorldInfo var1) { +- this.worldInfoInstance = var1; ++ CallableLevelDimension(WorldInfo par1WorldInfo) { ++ this.worldInfoInstance = par1WorldInfo; + } + + public String callLevelDimension() { diff --git a/patches/net/minecraft/src/CallableLevelGamemode.java.patch b/patches/net/minecraft/src/CallableLevelGamemode.java.patch new file mode 100644 index 0000000..2bf6ccb --- /dev/null +++ b/patches/net/minecraft/src/CallableLevelGamemode.java.patch @@ -0,0 +1,18 @@ +--- net/minecraft/src/CallableLevelGamemode.java ++++ net/minecraft/src/CallableLevelGamemode.java +@@ -5,12 +5,12 @@ + class CallableLevelGamemode implements Callable { + final WorldInfo worldInfoInstance; + +- CallableLevelGamemode(WorldInfo var1) { +- this.worldInfoInstance = var1; ++ CallableLevelGamemode(WorldInfo par1WorldInfo) { ++ this.worldInfoInstance = par1WorldInfo; + } + + public String callLevelGameModeInfo() { +- return String.format("Game mode: %s (ID %d). Hardcore: %b. Cheats: %b", new Object[]{WorldInfo.getGameType(this.worldInfoInstance).getName(), Integer.valueOf(WorldInfo.getGameType(this.worldInfoInstance).getID()), Boolean.valueOf(WorldInfo.func_85117_p(this.worldInfoInstance)), Boolean.valueOf(WorldInfo.func_85131_q(this.worldInfoInstance))}); ++ return String.format("Game mode: %s (ID %d). Hardcore: %b. Cheats: %b", new Object[] {WorldInfo.getGameType(this.worldInfoInstance).getName(), Integer.valueOf(WorldInfo.getGameType(this.worldInfoInstance).getID()), Boolean.valueOf(WorldInfo.func_85117_p(this.worldInfoInstance)), Boolean.valueOf(WorldInfo.func_85131_q(this.worldInfoInstance))}); + } + + public Object call() { diff --git a/patches/net/minecraft/src/CallableLevelGenerator.java.patch b/patches/net/minecraft/src/CallableLevelGenerator.java.patch new file mode 100644 index 0000000..93a383f --- /dev/null +++ b/patches/net/minecraft/src/CallableLevelGenerator.java.patch @@ -0,0 +1,18 @@ +--- net/minecraft/src/CallableLevelGenerator.java ++++ net/minecraft/src/CallableLevelGenerator.java +@@ -5,12 +5,12 @@ + class CallableLevelGenerator implements Callable { + final WorldInfo worldInfoInstance; + +- CallableLevelGenerator(WorldInfo var1) { +- this.worldInfoInstance = var1; ++ CallableLevelGenerator(WorldInfo par1WorldInfo) { ++ this.worldInfoInstance = par1WorldInfo; + } + + public String callLevelGeneratorInfo() { +- return String.format("ID %02d - %s, ver %d. Features enabled: %b", new Object[]{Integer.valueOf(WorldInfo.getTerrainTypeOfWorld(this.worldInfoInstance).getWorldTypeID()), WorldInfo.getTerrainTypeOfWorld(this.worldInfoInstance).getWorldTypeName(), Integer.valueOf(WorldInfo.getTerrainTypeOfWorld(this.worldInfoInstance).getGeneratorVersion()), Boolean.valueOf(WorldInfo.getMapFeaturesEnabled(this.worldInfoInstance))}); ++ return String.format("ID %02d - %s, ver %d. Features enabled: %b", new Object[] {Integer.valueOf(WorldInfo.getTerrainTypeOfWorld(this.worldInfoInstance).getWorldTypeID()), WorldInfo.getTerrainTypeOfWorld(this.worldInfoInstance).getWorldTypeName(), Integer.valueOf(WorldInfo.getTerrainTypeOfWorld(this.worldInfoInstance).getGeneratorVersion()), Boolean.valueOf(WorldInfo.getMapFeaturesEnabled(this.worldInfoInstance))}); + } + + public Object call() { diff --git a/patches/net/minecraft/src/CallableLevelGeneratorOptions.java.patch b/patches/net/minecraft/src/CallableLevelGeneratorOptions.java.patch new file mode 100644 index 0000000..9b31dd8 --- /dev/null +++ b/patches/net/minecraft/src/CallableLevelGeneratorOptions.java.patch @@ -0,0 +1,13 @@ +--- net/minecraft/src/CallableLevelGeneratorOptions.java ++++ net/minecraft/src/CallableLevelGeneratorOptions.java +@@ -5,8 +5,8 @@ + class CallableLevelGeneratorOptions implements Callable { + final WorldInfo worldInfoInstance; + +- CallableLevelGeneratorOptions(WorldInfo var1) { +- this.worldInfoInstance = var1; ++ CallableLevelGeneratorOptions(WorldInfo par1WorldInfo) { ++ this.worldInfoInstance = par1WorldInfo; + } + + public String callLevelGeneratorOptions() { diff --git a/patches/net/minecraft/src/CallableLevelSeed.java.patch b/patches/net/minecraft/src/CallableLevelSeed.java.patch new file mode 100644 index 0000000..97ac035 --- /dev/null +++ b/patches/net/minecraft/src/CallableLevelSeed.java.patch @@ -0,0 +1,13 @@ +--- net/minecraft/src/CallableLevelSeed.java ++++ net/minecraft/src/CallableLevelSeed.java +@@ -5,8 +5,8 @@ + class CallableLevelSeed implements Callable { + final WorldInfo worldInfoInstance; + +- CallableLevelSeed(WorldInfo var1) { +- this.worldInfoInstance = var1; ++ CallableLevelSeed(WorldInfo par1WorldInfo) { ++ this.worldInfoInstance = par1WorldInfo; + } + + public String callLevelSeed() { diff --git a/patches/net/minecraft/src/CallableLevelSpawnLocation.java.patch b/patches/net/minecraft/src/CallableLevelSpawnLocation.java.patch new file mode 100644 index 0000000..899ec5f --- /dev/null +++ b/patches/net/minecraft/src/CallableLevelSpawnLocation.java.patch @@ -0,0 +1,13 @@ +--- net/minecraft/src/CallableLevelSpawnLocation.java ++++ net/minecraft/src/CallableLevelSpawnLocation.java +@@ -5,8 +5,8 @@ + class CallableLevelSpawnLocation implements Callable { + final WorldInfo worldInfoInstance; + +- CallableLevelSpawnLocation(WorldInfo var1) { +- this.worldInfoInstance = var1; ++ CallableLevelSpawnLocation(WorldInfo par1WorldInfo) { ++ this.worldInfoInstance = par1WorldInfo; + } + + public String callLevelSpawnLocation() { diff --git a/patches/net/minecraft/src/CallableLevelStorageVersion.java.patch b/patches/net/minecraft/src/CallableLevelStorageVersion.java.patch new file mode 100644 index 0000000..9d2ba2b --- /dev/null +++ b/patches/net/minecraft/src/CallableLevelStorageVersion.java.patch @@ -0,0 +1,39 @@ +--- net/minecraft/src/CallableLevelStorageVersion.java ++++ net/minecraft/src/CallableLevelStorageVersion.java +@@ -5,25 +5,27 @@ + class CallableLevelStorageVersion implements Callable { + final WorldInfo worldInfoInstance; + +- CallableLevelStorageVersion(WorldInfo var1) { +- this.worldInfoInstance = var1; ++ CallableLevelStorageVersion(WorldInfo par1WorldInfo) { ++ this.worldInfoInstance = par1WorldInfo; + } + + public String callLevelStorageFormat() { + String var1 = "Unknown?"; + + try { +- switch(WorldInfo.getSaveVersion(this.worldInfoInstance)) { +- case 19132: +- var1 = "McRegion"; +- break; +- case 19133: +- var1 = "Anvil"; ++ switch (WorldInfo.getSaveVersion(this.worldInfoInstance)) { ++ case 19132: ++ var1 = "McRegion"; ++ break; ++ ++ case 19133: ++ var1 = "Anvil"; + } + } catch (Throwable var3) { ++ ; + } + +- return String.format("0x%05X - %s", new Object[]{Integer.valueOf(WorldInfo.getSaveVersion(this.worldInfoInstance)), var1}); ++ return String.format("0x%05X - %s", new Object[] {Integer.valueOf(WorldInfo.getSaveVersion(this.worldInfoInstance)), var1}); + } + + public Object call() { diff --git a/patches/net/minecraft/src/CallableLevelTime.java.patch b/patches/net/minecraft/src/CallableLevelTime.java.patch new file mode 100644 index 0000000..8bc4116 --- /dev/null +++ b/patches/net/minecraft/src/CallableLevelTime.java.patch @@ -0,0 +1,18 @@ +--- net/minecraft/src/CallableLevelTime.java ++++ net/minecraft/src/CallableLevelTime.java +@@ -5,12 +5,12 @@ + class CallableLevelTime implements Callable { + final WorldInfo worldInfoInstance; + +- CallableLevelTime(WorldInfo var1) { +- this.worldInfoInstance = var1; ++ CallableLevelTime(WorldInfo par1WorldInfo) { ++ this.worldInfoInstance = par1WorldInfo; + } + + public String callLevelTime() { +- return String.format("%d game time, %d day time", new Object[]{Long.valueOf(WorldInfo.func_85126_g(this.worldInfoInstance)), Long.valueOf(WorldInfo.getWorldTime(this.worldInfoInstance))}); ++ return String.format("%d game time, %d day time", new Object[] {Long.valueOf(WorldInfo.func_85126_g(this.worldInfoInstance)), Long.valueOf(WorldInfo.getWorldTime(this.worldInfoInstance))}); + } + + public Object call() { diff --git a/patches/net/minecraft/src/CallableLevelWeather.java.patch b/patches/net/minecraft/src/CallableLevelWeather.java.patch new file mode 100644 index 0000000..7102f5e --- /dev/null +++ b/patches/net/minecraft/src/CallableLevelWeather.java.patch @@ -0,0 +1,18 @@ +--- net/minecraft/src/CallableLevelWeather.java ++++ net/minecraft/src/CallableLevelWeather.java +@@ -5,12 +5,12 @@ + class CallableLevelWeather implements Callable { + final WorldInfo worldInfoInstance; + +- CallableLevelWeather(WorldInfo var1) { +- this.worldInfoInstance = var1; ++ CallableLevelWeather(WorldInfo par1WorldInfo) { ++ this.worldInfoInstance = par1WorldInfo; + } + + public String callLevelWeatherInfo() { +- return String.format("Rain time: %d (now: %b), thunder time: %d (now: %b)", new Object[]{Integer.valueOf(WorldInfo.getRainTime(this.worldInfoInstance)), Boolean.valueOf(WorldInfo.getRaining(this.worldInfoInstance)), Integer.valueOf(WorldInfo.getThunderTime(this.worldInfoInstance)), Boolean.valueOf(WorldInfo.getThundering(this.worldInfoInstance))}); ++ return String.format("Rain time: %d (now: %b), thunder time: %d (now: %b)", new Object[] {Integer.valueOf(WorldInfo.getRainTime(this.worldInfoInstance)), Boolean.valueOf(WorldInfo.getRaining(this.worldInfoInstance)), Integer.valueOf(WorldInfo.getThunderTime(this.worldInfoInstance)), Boolean.valueOf(WorldInfo.getThundering(this.worldInfoInstance))}); + } + + public Object call() { diff --git a/patches/net/minecraft/src/CallableLvl1.java.patch b/patches/net/minecraft/src/CallableLvl1.java.patch new file mode 100644 index 0000000..f80cc04 --- /dev/null +++ b/patches/net/minecraft/src/CallableLvl1.java.patch @@ -0,0 +1,25 @@ +--- net/minecraft/src/CallableLvl1.java ++++ net/minecraft/src/CallableLvl1.java +@@ -4,16 +4,18 @@ + + class CallableLvl1 implements Callable { + final int field_85179_a; ++ ++ /** Reference to the World object. */ + final World theWorld; + +- CallableLvl1(World var1, int var2) { +- this.theWorld = var1; +- this.field_85179_a = var2; ++ CallableLvl1(World par1World, int par2) { ++ this.theWorld = par1World; ++ this.field_85179_a = par2; + } + + public String getWorldEntitiesAsString() { + try { +- return String.format("ID #%d (%s // %s)", new Object[]{Integer.valueOf(this.field_85179_a), Block.blocksList[this.field_85179_a].getUnlocalizedName(), Block.blocksList[this.field_85179_a].getClass().getCanonicalName()}); ++ return String.format("ID #%d (%s // %s)", new Object[] {Integer.valueOf(this.field_85179_a), Block.blocksList[this.field_85179_a].getUnlocalizedName(), Block.blocksList[this.field_85179_a].getClass().getCanonicalName()}); + } catch (Throwable var2) { + return "ID #" + this.field_85179_a; + } diff --git a/patches/net/minecraft/src/CallableLvl2.java.patch b/patches/net/minecraft/src/CallableLvl2.java.patch new file mode 100644 index 0000000..37c4422 --- /dev/null +++ b/patches/net/minecraft/src/CallableLvl2.java.patch @@ -0,0 +1,25 @@ +--- net/minecraft/src/CallableLvl2.java ++++ net/minecraft/src/CallableLvl2.java +@@ -3,14 +3,19 @@ + import java.util.concurrent.Callable; + + class CallableLvl2 implements Callable { ++ ++ /** Reference to the World object. */ + final World theWorld; + +- CallableLvl2(World var1) { +- this.theWorld = var1; ++ CallableLvl2(World par1World) { ++ this.theWorld = par1World; + } + ++ /** ++ * Returns the size and contents of the player entity list. ++ */ + public String getPlayerEntities() { +- return this.theWorld.h.size() + " total; " + this.theWorld.h.toString(); ++ return this.theWorld.playerEntities.size() + " total; " + this.theWorld.playerEntities.toString(); + } + + public Object call() { diff --git a/patches/net/minecraft/src/CallableLvl3.java.patch b/patches/net/minecraft/src/CallableLvl3.java.patch new file mode 100644 index 0000000..832f1c1 --- /dev/null +++ b/patches/net/minecraft/src/CallableLvl3.java.patch @@ -0,0 +1,22 @@ +--- net/minecraft/src/CallableLvl3.java ++++ net/minecraft/src/CallableLvl3.java +@@ -3,12 +3,17 @@ + import java.util.concurrent.Callable; + + class CallableLvl3 implements Callable { ++ ++ /** Reference to the World object. */ + final World theWorld; + +- CallableLvl3(World var1) { +- this.theWorld = var1; ++ CallableLvl3(World par1World) { ++ this.theWorld = par1World; + } + ++ /** ++ * Returns the result of the ChunkProvider's makeString ++ */ + public String getChunkProvider() { + return this.theWorld.chunkProvider.makeString(); + } diff --git a/patches/net/minecraft/src/CallableMPL1.java.patch b/patches/net/minecraft/src/CallableMPL1.java.patch new file mode 100644 index 0000000..e51bb58 --- /dev/null +++ b/patches/net/minecraft/src/CallableMPL1.java.patch @@ -0,0 +1,22 @@ +--- net/minecraft/src/CallableMPL1.java ++++ net/minecraft/src/CallableMPL1.java +@@ -3,12 +3,17 @@ + import java.util.concurrent.Callable; + + class CallableMPL1 implements Callable { ++ ++ /** Reference to the WorldClient object. */ + final WorldClient theWorldClient; + +- CallableMPL1(WorldClient var1) { +- this.theWorldClient = var1; ++ CallableMPL1(WorldClient par1WorldClient) { ++ this.theWorldClient = par1WorldClient; + } + ++ /** ++ * Returns the size and contents of the entity list. ++ */ + public String getEntityCountAndList() { + return WorldClient.getEntityList(this.theWorldClient).size() + " total; " + WorldClient.getEntityList(this.theWorldClient).toString(); + } diff --git a/patches/net/minecraft/src/CallableMPL2.java.patch b/patches/net/minecraft/src/CallableMPL2.java.patch new file mode 100644 index 0000000..da54444 --- /dev/null +++ b/patches/net/minecraft/src/CallableMPL2.java.patch @@ -0,0 +1,22 @@ +--- net/minecraft/src/CallableMPL2.java ++++ net/minecraft/src/CallableMPL2.java +@@ -3,12 +3,17 @@ + import java.util.concurrent.Callable; + + class CallableMPL2 implements Callable { ++ ++ /** Reference to the WorldClient object. */ + final WorldClient theWorldClient; + +- CallableMPL2(WorldClient var1) { +- this.theWorldClient = var1; ++ CallableMPL2(WorldClient par1WorldClient) { ++ this.theWorldClient = par1WorldClient; + } + ++ /** ++ * Returns the size and contents of the entity spawn queue. ++ */ + public String getEntitySpawnQueueCountAndList() { + return WorldClient.getEntitySpawnQueue(this.theWorldClient).size() + " total; " + WorldClient.getEntitySpawnQueue(this.theWorldClient).toString(); + } diff --git a/patches/net/minecraft/src/CallableMemoryInfo.java.patch b/patches/net/minecraft/src/CallableMemoryInfo.java.patch new file mode 100644 index 0000000..3b85c32 --- /dev/null +++ b/patches/net/minecraft/src/CallableMemoryInfo.java.patch @@ -0,0 +1,23 @@ +--- net/minecraft/src/CallableMemoryInfo.java ++++ net/minecraft/src/CallableMemoryInfo.java +@@ -3,12 +3,18 @@ + import java.util.concurrent.Callable; + + class CallableMemoryInfo implements Callable { ++ ++ /** Reference to the CrashReport object. */ + final CrashReport theCrashReport; + +- CallableMemoryInfo(CrashReport var1) { +- this.theCrashReport = var1; ++ CallableMemoryInfo(CrashReport par1CrashReport) { ++ this.theCrashReport = par1CrashReport; + } + ++ /** ++ * Returns the memory information as a String. Includes the Free Memory in bytes and MB, Total Memory in bytes and MB, ++ * and Max Memory in Bytes and MB. ++ */ + public String getMemoryInfoAsString() { + Runtime var1 = Runtime.getRuntime(); + long var2 = var1.maxMemory(); diff --git a/patches/net/minecraft/src/CallableMinecraftVersion.java.patch b/patches/net/minecraft/src/CallableMinecraftVersion.java.patch new file mode 100644 index 0000000..c92fa37 --- /dev/null +++ b/patches/net/minecraft/src/CallableMinecraftVersion.java.patch @@ -0,0 +1,22 @@ +--- net/minecraft/src/CallableMinecraftVersion.java ++++ net/minecraft/src/CallableMinecraftVersion.java +@@ -3,12 +3,17 @@ + import java.util.concurrent.Callable; + + class CallableMinecraftVersion implements Callable { ++ ++ /** Reference to the CrashReport object. */ + final CrashReport theCrashReport; + +- CallableMinecraftVersion(CrashReport var1) { +- this.theCrashReport = var1; ++ CallableMinecraftVersion(CrashReport par1CrashReport) { ++ this.theCrashReport = par1CrashReport; + } + ++ /** ++ * The current version of Minecraft ++ */ + public String minecraftVersion() { + return "1.6.4"; + } diff --git a/patches/net/minecraft/src/CallableModded.java.patch b/patches/net/minecraft/src/CallableModded.java.patch new file mode 100644 index 0000000..c161bc1 --- /dev/null +++ b/patches/net/minecraft/src/CallableModded.java.patch @@ -0,0 +1,22 @@ +--- net/minecraft/src/CallableModded.java ++++ net/minecraft/src/CallableModded.java +@@ -4,12 +4,17 @@ + import net.minecraft.client.ClientBrandRetriever; + + class CallableModded implements Callable { ++ ++ /** Reference to the Minecraft object. */ + final Minecraft mc; + +- CallableModded(Minecraft var1) { +- this.mc = var1; ++ CallableModded(Minecraft par1Minecraft) { ++ this.mc = par1Minecraft; + } + ++ /** ++ * Gets if Client Profiler (aka Snooper) is enabled. ++ */ + public String getClientProfilerEnabled() { + String var1 = ClientBrandRetriever.getClientModName(); + return !var1.equals("vanilla") ? "Definitely; Client brand changed to \'" + var1 + "\'" : (Minecraft.class.getSigners() == null ? "Very likely; Jar signature invalidated" : "Probably not. Jar signature remains and client brand is untouched."); diff --git a/patches/net/minecraft/src/CallableMouseLocation.java.patch b/patches/net/minecraft/src/CallableMouseLocation.java.patch new file mode 100644 index 0000000..e425f59 --- /dev/null +++ b/patches/net/minecraft/src/CallableMouseLocation.java.patch @@ -0,0 +1,27 @@ +--- net/minecraft/src/CallableMouseLocation.java ++++ net/minecraft/src/CallableMouseLocation.java +@@ -5,17 +5,19 @@ + + class CallableMouseLocation implements Callable { + final int field_90026_a; ++ + final int field_90024_b; ++ + final EntityRenderer theEntityRenderer; + +- CallableMouseLocation(EntityRenderer var1, int var2, int var3) { +- this.theEntityRenderer = var1; +- this.field_90026_a = var2; +- this.field_90024_b = var3; ++ CallableMouseLocation(EntityRenderer par1EntityRenderer, int par2, int par3) { ++ this.theEntityRenderer = par1EntityRenderer; ++ this.field_90026_a = par2; ++ this.field_90024_b = par3; + } + + public String callMouseLocation() { +- return String.format("Scaled: (%d, %d). Absolute: (%d, %d)", new Object[]{Integer.valueOf(this.field_90026_a), Integer.valueOf(this.field_90024_b), Integer.valueOf(Mouse.getX()), Integer.valueOf(Mouse.getY())}); ++ return String.format("Scaled: (%d, %d). Absolute: (%d, %d)", new Object[] {Integer.valueOf(this.field_90026_a), Integer.valueOf(this.field_90024_b), Integer.valueOf(Mouse.getX()), Integer.valueOf(Mouse.getY())}); + } + + public Object call() { diff --git a/patches/net/minecraft/src/CallableOSInfo.java.patch b/patches/net/minecraft/src/CallableOSInfo.java.patch new file mode 100644 index 0000000..eadd2c4 --- /dev/null +++ b/patches/net/minecraft/src/CallableOSInfo.java.patch @@ -0,0 +1,17 @@ +--- net/minecraft/src/CallableOSInfo.java ++++ net/minecraft/src/CallableOSInfo.java +@@ -3,10 +3,12 @@ + import java.util.concurrent.Callable; + + class CallableOSInfo implements Callable { ++ ++ /** Reference to the CrashReport object. */ + final CrashReport theCrashReport; + +- CallableOSInfo(CrashReport var1) { +- this.theCrashReport = var1; ++ CallableOSInfo(CrashReport par1CrashReport) { ++ this.theCrashReport = par1CrashReport; + } + + public String getOsAsString() { diff --git a/patches/net/minecraft/src/CallablePacketClass.java.patch b/patches/net/minecraft/src/CallablePacketClass.java.patch new file mode 100644 index 0000000..2b51ffd --- /dev/null +++ b/patches/net/minecraft/src/CallablePacketClass.java.patch @@ -0,0 +1,18 @@ +--- net/minecraft/src/CallablePacketClass.java ++++ net/minecraft/src/CallablePacketClass.java +@@ -4,11 +4,12 @@ + + class CallablePacketClass implements Callable { + final Packet thePacket; ++ + final NetServerHandler theNetServerHandler; + +- CallablePacketClass(NetServerHandler var1, Packet var2) { +- this.theNetServerHandler = var1; +- this.thePacket = var2; ++ CallablePacketClass(NetServerHandler par1NetServerHandler, Packet par2Packet) { ++ this.theNetServerHandler = par1NetServerHandler; ++ this.thePacket = par2Packet; + } + + public String getPacketClass() { diff --git a/patches/net/minecraft/src/CallablePacketID.java.patch b/patches/net/minecraft/src/CallablePacketID.java.patch new file mode 100644 index 0000000..ab7e163 --- /dev/null +++ b/patches/net/minecraft/src/CallablePacketID.java.patch @@ -0,0 +1,18 @@ +--- net/minecraft/src/CallablePacketID.java ++++ net/minecraft/src/CallablePacketID.java +@@ -4,11 +4,12 @@ + + class CallablePacketID implements Callable { + final Packet thePacket; ++ + final NetServerHandler theNetServerHandler; + +- CallablePacketID(NetServerHandler var1, Packet var2) { +- this.theNetServerHandler = var1; +- this.thePacket = var2; ++ CallablePacketID(NetServerHandler par1NetServerHandler, Packet par2Packet) { ++ this.theNetServerHandler = par1NetServerHandler; ++ this.thePacket = par2Packet; + } + + public String callPacketID() { diff --git a/patches/net/minecraft/src/CallableParticlePositionInfo.java.patch b/patches/net/minecraft/src/CallableParticlePositionInfo.java.patch new file mode 100644 index 0000000..1e9b454 --- /dev/null +++ b/patches/net/minecraft/src/CallableParticlePositionInfo.java.patch @@ -0,0 +1,26 @@ +--- net/minecraft/src/CallableParticlePositionInfo.java ++++ net/minecraft/src/CallableParticlePositionInfo.java +@@ -4,15 +4,18 @@ + + class CallableParticlePositionInfo implements Callable { + final double posX; ++ + final double posY; ++ + final double posZ; ++ + final RenderGlobal globalRenderer; + +- CallableParticlePositionInfo(RenderGlobal var1, double var2, double var4, double var6) { +- this.globalRenderer = var1; +- this.posX = var2; +- this.posY = var4; +- this.posZ = var6; ++ CallableParticlePositionInfo(RenderGlobal par1RenderGlobal, double par2, double par4, double par6) { ++ this.globalRenderer = par1RenderGlobal; ++ this.posX = par2; ++ this.posY = par4; ++ this.posZ = par6; + } + + public String callParticlePositionInfo() { diff --git a/patches/net/minecraft/src/CallableParticleScreenName.java.patch b/patches/net/minecraft/src/CallableParticleScreenName.java.patch new file mode 100644 index 0000000..5b0690a --- /dev/null +++ b/patches/net/minecraft/src/CallableParticleScreenName.java.patch @@ -0,0 +1,13 @@ +--- net/minecraft/src/CallableParticleScreenName.java ++++ net/minecraft/src/CallableParticleScreenName.java +@@ -5,8 +5,8 @@ + class CallableParticleScreenName implements Callable { + final Minecraft theMinecraft; + +- CallableParticleScreenName(Minecraft var1) { +- this.theMinecraft = var1; ++ CallableParticleScreenName(Minecraft par1Minecraft) { ++ this.theMinecraft = par1Minecraft; + } + + public String callParticleScreenName() { diff --git a/patches/net/minecraft/src/CallableScreenName.java.patch b/patches/net/minecraft/src/CallableScreenName.java.patch new file mode 100644 index 0000000..9e6ee93 --- /dev/null +++ b/patches/net/minecraft/src/CallableScreenName.java.patch @@ -0,0 +1,13 @@ +--- net/minecraft/src/CallableScreenName.java ++++ net/minecraft/src/CallableScreenName.java +@@ -5,8 +5,8 @@ + class CallableScreenName implements Callable { + final EntityRenderer entityRender; + +- CallableScreenName(EntityRenderer var1) { +- this.entityRender = var1; ++ CallableScreenName(EntityRenderer par1EntityRenderer) { ++ this.entityRender = par1EntityRenderer; + } + + public String callScreenName() { diff --git a/patches/net/minecraft/src/CallableScreenSize.java.patch b/patches/net/minecraft/src/CallableScreenSize.java.patch new file mode 100644 index 0000000..72cac5a --- /dev/null +++ b/patches/net/minecraft/src/CallableScreenSize.java.patch @@ -0,0 +1,23 @@ +--- net/minecraft/src/CallableScreenSize.java ++++ net/minecraft/src/CallableScreenSize.java +@@ -4,15 +4,16 @@ + + class CallableScreenSize implements Callable { + final ScaledResolution theScaledResolution; ++ + final EntityRenderer theEntityRenderer; + +- CallableScreenSize(EntityRenderer var1, ScaledResolution var2) { +- this.theEntityRenderer = var1; +- this.theScaledResolution = var2; ++ CallableScreenSize(EntityRenderer par1EntityRenderer, ScaledResolution par2ScaledResolution) { ++ this.theEntityRenderer = par1EntityRenderer; ++ this.theScaledResolution = par2ScaledResolution; + } + + public String callScreenSize() { +- return String.format("Scaled: (%d, %d). Absolute: (%d, %d). Scale factor of %d", new Object[]{Integer.valueOf(this.theScaledResolution.getScaledWidth()), Integer.valueOf(this.theScaledResolution.getScaledHeight()), Integer.valueOf(EntityRenderer.getRendererMinecraft(this.theEntityRenderer).displayWidth), Integer.valueOf(EntityRenderer.getRendererMinecraft(this.theEntityRenderer).displayHeight), Integer.valueOf(this.theScaledResolution.getScaleFactor())}); ++ return String.format("Scaled: (%d, %d). Absolute: (%d, %d). Scale factor of %d", new Object[] {Integer.valueOf(this.theScaledResolution.getScaledWidth()), Integer.valueOf(this.theScaledResolution.getScaledHeight()), Integer.valueOf(EntityRenderer.getRendererMinecraft(this.theEntityRenderer).displayWidth), Integer.valueOf(EntityRenderer.getRendererMinecraft(this.theEntityRenderer).displayHeight), Integer.valueOf(this.theScaledResolution.getScaleFactor())}); + } + + public Object call() { diff --git a/patches/net/minecraft/src/CallableServerMemoryStats.java.patch b/patches/net/minecraft/src/CallableServerMemoryStats.java.patch new file mode 100644 index 0000000..a1f3a77 --- /dev/null +++ b/patches/net/minecraft/src/CallableServerMemoryStats.java.patch @@ -0,0 +1,24 @@ +--- net/minecraft/src/CallableServerMemoryStats.java ++++ net/minecraft/src/CallableServerMemoryStats.java +@@ -4,14 +4,16 @@ + import net.minecraft.server.MinecraftServer; + + public class CallableServerMemoryStats implements Callable { +- final MinecraftServer a; +- +- public CallableServerMemoryStats(MinecraftServer var1) { +- this.a = var1; ++ ++ /** Reference to the MinecraftServer object. */ ++ final MinecraftServer mcServer; ++ ++ public CallableServerMemoryStats(MinecraftServer par1MinecraftServer) { ++ this.mcServer = par1MinecraftServer; + } + + public String callServerMemoryStats() { +- return MinecraftServer.getServerConfigurationManager(this.a).getCurrentPlayerCount() + " / " + MinecraftServer.getServerConfigurationManager(this.a).getMaxPlayers() + "; " + MinecraftServer.getServerConfigurationManager(this.a).a; ++ return MinecraftServer.getServerConfigurationManager(this.mcServer).getCurrentPlayerCount() + " / " + MinecraftServer.getServerConfigurationManager(this.mcServer).getMaxPlayers() + "; " + MinecraftServer.getServerConfigurationManager(this.mcServer).playerEntityList; + } + + public Object call() { diff --git a/patches/net/minecraft/src/CallableServerProfiler.java.patch b/patches/net/minecraft/src/CallableServerProfiler.java.patch new file mode 100644 index 0000000..adcf4e6 --- /dev/null +++ b/patches/net/minecraft/src/CallableServerProfiler.java.patch @@ -0,0 +1,28 @@ +--- net/minecraft/src/CallableServerProfiler.java ++++ net/minecraft/src/CallableServerProfiler.java +@@ -4,17 +4,19 @@ + import net.minecraft.server.MinecraftServer; + + public class CallableServerProfiler implements Callable { +- final MinecraftServer a; +- +- public CallableServerProfiler(MinecraftServer var1) { +- this.a = var1; ++ ++ /** Reference to the MinecraftServer object. */ ++ final MinecraftServer mcServer; ++ ++ public CallableServerProfiler(MinecraftServer par1MinecraftServer) { ++ this.mcServer = par1MinecraftServer; + } + + public String callServerProfiler() { +- int var1 = this.a.worldServers[0].getWorldVec3Pool().getPoolSize(); ++ int var1 = this.mcServer.worldServers[0].getWorldVec3Pool().getPoolSize(); + int var2 = 56 * var1; + int var3 = var2 / 1024 / 1024; +- int var4 = this.a.worldServers[0].getWorldVec3Pool().func_82590_d(); ++ int var4 = this.mcServer.worldServers[0].getWorldVec3Pool().func_82590_d(); + int var5 = 56 * var4; + int var6 = var5 / 1024 / 1024; + return var1 + " (" + var2 + " bytes; " + var3 + " MB) allocated, " + var4 + " (" + var5 + " bytes; " + var6 + " MB) used"; diff --git a/patches/net/minecraft/src/CallableServerType.java.patch b/patches/net/minecraft/src/CallableServerType.java.patch new file mode 100644 index 0000000..fb574f3 --- /dev/null +++ b/patches/net/minecraft/src/CallableServerType.java.patch @@ -0,0 +1,13 @@ +--- net/minecraft/src/CallableServerType.java ++++ net/minecraft/src/CallableServerType.java +@@ -5,8 +5,8 @@ + class CallableServerType implements Callable { + final DedicatedServer theDedicatedServer; + +- CallableServerType(DedicatedServer var1) { +- this.theDedicatedServer = var1; ++ CallableServerType(DedicatedServer par1DedicatedServer) { ++ this.theDedicatedServer = par1DedicatedServer; + } + + public String callServerType() { diff --git a/patches/net/minecraft/src/CallableStructureType.java.patch b/patches/net/minecraft/src/CallableStructureType.java.patch new file mode 100644 index 0000000..a5a758e --- /dev/null +++ b/patches/net/minecraft/src/CallableStructureType.java.patch @@ -0,0 +1,13 @@ +--- net/minecraft/src/CallableStructureType.java ++++ net/minecraft/src/CallableStructureType.java +@@ -5,8 +5,8 @@ + class CallableStructureType implements Callable { + final MapGenStructure theMapStructureGenerator; + +- CallableStructureType(MapGenStructure var1) { +- this.theMapStructureGenerator = var1; ++ CallableStructureType(MapGenStructure par1MapGenStructure) { ++ this.theMapStructureGenerator = par1MapGenStructure; + } + + public String callStructureType() { diff --git a/patches/net/minecraft/src/CallableSuspiciousClasses.java.patch b/patches/net/minecraft/src/CallableSuspiciousClasses.java.patch new file mode 100644 index 0000000..2696264 --- /dev/null +++ b/patches/net/minecraft/src/CallableSuspiciousClasses.java.patch @@ -0,0 +1,206 @@ +--- net/minecraft/src/CallableSuspiciousClasses.java ++++ net/minecraft/src/CallableSuspiciousClasses.java +@@ -11,15 +11,22 @@ + class CallableSuspiciousClasses implements Callable { + final CrashReport theCrashReport; + +- CallableSuspiciousClasses(CrashReport var1) { +- this.theCrashReport = var1; ++ CallableSuspiciousClasses(CrashReport par1CrashReport) { ++ this.theCrashReport = par1CrashReport; + } + +- public String callSuspiciousClasses() throws Exception { ++ public String callSuspiciousClasses() throws SecurityException, NoSuchFieldException, IllegalAccessException, IllegalArgumentException { + StringBuilder var1 = new StringBuilder(); +- Field var2 = ClassLoader.class.getDeclaredField("classes"); +- var2.setAccessible(true); +- ArrayList var3 = new ArrayList((Vector)var2.get(CrashReport.class.getClassLoader())); ++ ArrayList var3; ++ ++ try { ++ Field var2 = ClassLoader.class.getDeclaredField("classes"); ++ var2.setAccessible(true); ++ var3 = new ArrayList((Vector)var2.get(CrashReport.class.getClassLoader())); ++ } catch (Exception ex) { ++ return ""; ++ } ++ + boolean var4 = true; + boolean var5 = !CrashReport.class.getCanonicalName().equals("net.minecraft.CrashReport"); + HashMap var6 = new HashMap(); +@@ -27,105 +34,80 @@ + Collections.sort(var3, new ComparatorClassSorter(this)); + Iterator var8 = var3.iterator(); + +- while(true) { +- while(true) { +- Class var9; +- while(true) { +- String var10; +- do { +- do { +- do { +- do { +- do { +- do { +- do { +- do { +- do { +- do { +- do { +- do { +- if(!var8.hasNext()) { +- if(var4) { +- var1.append("No suspicious classes found."); +- } else { +- var1.append("]"); +- } +- +- return var1.toString(); +- } +- +- var9 = (Class)var8.next(); +- } while(var9 == null); +- +- var10 = var9.getCanonicalName(); +- } while(var10 == null); +- } while(var10.startsWith("org.lwjgl.")); +- } while(var10.startsWith("paulscode.")); +- } while(var10.startsWith("org.bouncycastle.")); +- } while(var10.startsWith("argo.")); +- } while(var10.startsWith("com.jcraft.")); +- } while(var10.startsWith("com.fasterxml.")); +- } while(var10.startsWith("com.google.")); +- } while(var10.startsWith("joptsimple.")); +- } while(var10.startsWith("org.apache.")); +- } while(var10.equals("util.GLX")); +- +- if(var5) { +- if(var10.length() > 3 && !var10.equals("net.minecraft.client.main.Main") && !var10.equals("net.minecraft.client.Minecraft") && !var10.equals("net.minecraft.client.ClientBrandRetriever") && !var10.equals("net.minecraft.server.MinecraftServer")) { +- break; ++ while (var8.hasNext()) { ++ Class var9 = (Class)var8.next(); ++ ++ if (var9 != null) { ++ String var10 = var9.getCanonicalName(); ++ ++ if (var10 != null && !var10.startsWith("org.lwjgl.") && !var10.startsWith("paulscode.") && !var10.startsWith("org.bouncycastle.") && !var10.startsWith("argo.") && !var10.startsWith("com.jcraft.") && !var10.startsWith("com.fasterxml.") && !var10.startsWith("com.google.") && !var10.startsWith("joptsimple.") && !var10.startsWith("org.apache.") && !var10.equals("util.GLX")) { ++ if (var5) { ++ if (var10.length() <= 3 || var10.equals("net.minecraft.client.main.Main") || var10.equals("net.minecraft.client.Minecraft") || var10.equals("net.minecraft.client.ClientBrandRetriever") || var10.equals("net.minecraft.server.MinecraftServer")) { ++ continue; ++ } ++ } else if (var10.startsWith("net.minecraft")) { ++ continue; ++ } ++ ++ Package var11 = var9.getPackage(); ++ String var12 = var11 == null ? "" : var11.getName(); ++ ++ if (var6.containsKey(var12)) { ++ int var13 = ((Integer)var6.get(var12)).intValue(); ++ var6.put(var12, Integer.valueOf(var13 + 1)); ++ ++ if (var13 == 3) { ++ if (!var4) { ++ var1.append(", "); ++ } ++ ++ var1.append("..."); ++ var4 = false; ++ continue; ++ } ++ ++ if (var13 > 3) { ++ continue; + } + } else { +- if(var10.startsWith("net.minecraft")) { +- continue; +- } +- break; +- } +- } +- +- Package var11 = var9.getPackage(); +- String var12 = var11 == null ? "" : var11.getName(); +- if(var6.containsKey(var12)) { +- int var13 = ((Integer)var6.get(var12)).intValue(); +- var6.put(var12, Integer.valueOf(var13 + 1)); +- if(var13 == 3) { +- if(!var4) { +- var1.append(", "); +- } +- +- var1.append("..."); +- var4 = false; +- continue; +- } +- +- if(var13 > 3) { +- continue; +- } +- } else { +- var6.put(var12, Integer.valueOf(1)); +- } +- +- if(!var7.equals(var12) && var7.length() > 0) { +- var1.append("], "); +- } +- +- if(!var4 && var7.equals(var12)) { +- var1.append(", "); +- } +- +- if(!var7.equals(var12)) { +- var1.append("["); +- var1.append(var12); +- var1.append("."); +- } +- +- var1.append(var9.getSimpleName()); +- var7 = var12; +- var4 = false; ++ var6.put(var12, Integer.valueOf(1)); ++ } ++ ++ if (!var7.equals(var12) && var7.length() > 0) { ++ var1.append("], "); ++ } ++ ++ if (!var4 && var7.equals(var12)) { ++ var1.append(", "); ++ } ++ ++ if (!var7.equals(var12)) { ++ var1.append("["); ++ var1.append(var12); ++ var1.append("."); ++ } ++ ++ var1.append(var9.getSimpleName()); ++ var7 = var12; ++ var4 = false; ++ } + } + } ++ ++ if (var4) { ++ var1.append("No suspicious classes found."); ++ } else { ++ var1.append("]"); ++ } ++ ++ return var1.toString(); + } + +- public Object call() throws Exception { +- return this.callSuspiciousClasses(); ++ public Object call() { ++ try { ++ return this.callSuspiciousClasses(); ++ } catch (Exception ex) { ++ return null; ++ } + } + } diff --git a/patches/net/minecraft/src/CallableTagCompound1.java.patch b/patches/net/minecraft/src/CallableTagCompound1.java.patch new file mode 100644 index 0000000..8223274 --- /dev/null +++ b/patches/net/minecraft/src/CallableTagCompound1.java.patch @@ -0,0 +1,25 @@ +--- net/minecraft/src/CallableTagCompound1.java ++++ net/minecraft/src/CallableTagCompound1.java +@@ -3,16 +3,17 @@ + import java.util.concurrent.Callable; + + class CallableTagCompound1 implements Callable { +- final String a; ++ final String field_82585_a; ++ + final NBTTagCompound theNBTTagCompound; + +- CallableTagCompound1(NBTTagCompound var1, String var2) { +- this.theNBTTagCompound = var1; +- this.a = var2; ++ CallableTagCompound1(NBTTagCompound par1NBTTagCompound, String par2Str) { ++ this.theNBTTagCompound = par1NBTTagCompound; ++ this.field_82585_a = par2Str; + } + + public String func_82583_a() { +- return NBTBase.b[((NBTBase)NBTTagCompound.getTagMap(this.theNBTTagCompound).get(this.a)).getId()]; ++ return NBTBase.NBTTypes[((NBTBase)NBTTagCompound.getTagMap(this.theNBTTagCompound).get(this.field_82585_a)).getId()]; + } + + public Object call() { diff --git a/patches/net/minecraft/src/CallableTagCompound2.java.patch b/patches/net/minecraft/src/CallableTagCompound2.java.patch new file mode 100644 index 0000000..0436a40 --- /dev/null +++ b/patches/net/minecraft/src/CallableTagCompound2.java.patch @@ -0,0 +1,23 @@ +--- net/minecraft/src/CallableTagCompound2.java ++++ net/minecraft/src/CallableTagCompound2.java +@@ -4,15 +4,16 @@ + + class CallableTagCompound2 implements Callable { + final int field_82588_a; ++ + final NBTTagCompound theNBTTagCompound; + +- CallableTagCompound2(NBTTagCompound var1, int var2) { +- this.theNBTTagCompound = var1; +- this.field_82588_a = var2; ++ CallableTagCompound2(NBTTagCompound par1NBTTagCompound, int par2) { ++ this.theNBTTagCompound = par1NBTTagCompound; ++ this.field_82588_a = par2; + } + + public String func_82586_a() { +- return NBTBase.b[this.field_82588_a]; ++ return NBTBase.NBTTypes[this.field_82588_a]; + } + + public Object call() { diff --git a/patches/net/minecraft/src/CallableTexturePack.java.patch b/patches/net/minecraft/src/CallableTexturePack.java.patch new file mode 100644 index 0000000..7c8644f --- /dev/null +++ b/patches/net/minecraft/src/CallableTexturePack.java.patch @@ -0,0 +1,18 @@ +--- net/minecraft/src/CallableTexturePack.java ++++ net/minecraft/src/CallableTexturePack.java +@@ -5,12 +5,12 @@ + class CallableTexturePack implements Callable { + final Minecraft theMinecraft; + +- CallableTexturePack(Minecraft var1) { +- this.theMinecraft = var1; ++ CallableTexturePack(Minecraft par1Minecraft) { ++ this.theMinecraft = par1Minecraft; + } + + public String callTexturePack() { +- return this.theMinecraft.gameSettings.m; ++ return this.theMinecraft.gameSettings.skin; + } + + public Object call() { diff --git a/patches/net/minecraft/src/CallableTileEntityData.java.patch b/patches/net/minecraft/src/CallableTileEntityData.java.patch new file mode 100644 index 0000000..90b8582 --- /dev/null +++ b/patches/net/minecraft/src/CallableTileEntityData.java.patch @@ -0,0 +1,26 @@ +--- net/minecraft/src/CallableTileEntityData.java ++++ net/minecraft/src/CallableTileEntityData.java +@@ -5,17 +5,18 @@ + class CallableTileEntityData implements Callable { + final TileEntity theTileEntity; + +- CallableTileEntityData(TileEntity var1) { +- this.theTileEntity = var1; ++ CallableTileEntityData(TileEntity par1TileEntity) { ++ this.theTileEntity = par1TileEntity; + } + + public String callTileEntityDataInfo() { + int var1 = this.theTileEntity.worldObj.getBlockMetadata(this.theTileEntity.xCoord, this.theTileEntity.yCoord, this.theTileEntity.zCoord); +- if(var1 < 0) { ++ ++ if (var1 < 0) { + return "Unknown? (Got " + var1 + ")"; + } else { +- String var2 = String.format("%4s", new Object[]{Integer.toBinaryString(var1)}).replace(" ", "0"); +- return String.format("%1$d / 0x%1$X / 0b%2$s", new Object[]{Integer.valueOf(var1), var2}); ++ String var2 = String.format("%4s", new Object[] {Integer.toBinaryString(var1)}).replace(" ", "0"); ++ return String.format("%1$d / 0x%1$X / 0b%2$s", new Object[] {Integer.valueOf(var1), var2}); + } + } + diff --git a/patches/net/minecraft/src/CallableTileEntityID.java.patch b/patches/net/minecraft/src/CallableTileEntityID.java.patch new file mode 100644 index 0000000..636fd6c --- /dev/null +++ b/patches/net/minecraft/src/CallableTileEntityID.java.patch @@ -0,0 +1,21 @@ +--- net/minecraft/src/CallableTileEntityID.java ++++ net/minecraft/src/CallableTileEntityID.java +@@ -5,15 +5,15 @@ + class CallableTileEntityID implements Callable { + final TileEntity theTileEntity; + +- CallableTileEntityID(TileEntity var1) { +- this.theTileEntity = var1; ++ CallableTileEntityID(TileEntity par1TileEntity) { ++ this.theTileEntity = par1TileEntity; + } + + public String callTileEntityID() { + int var1 = this.theTileEntity.worldObj.getBlockId(this.theTileEntity.xCoord, this.theTileEntity.yCoord, this.theTileEntity.zCoord); + + try { +- return String.format("ID #%d (%s // %s)", new Object[]{Integer.valueOf(var1), Block.blocksList[var1].getUnlocalizedName(), Block.blocksList[var1].getClass().getCanonicalName()}); ++ return String.format("ID #%d (%s // %s)", new Object[] {Integer.valueOf(var1), Block.blocksList[var1].getUnlocalizedName(), Block.blocksList[var1].getClass().getCanonicalName()}); + } catch (Throwable var3) { + return "ID #" + var1; + } diff --git a/patches/net/minecraft/src/CallableTileEntityName.java.patch b/patches/net/minecraft/src/CallableTileEntityName.java.patch new file mode 100644 index 0000000..85ab0c9 --- /dev/null +++ b/patches/net/minecraft/src/CallableTileEntityName.java.patch @@ -0,0 +1,13 @@ +--- net/minecraft/src/CallableTileEntityName.java ++++ net/minecraft/src/CallableTileEntityName.java +@@ -5,8 +5,8 @@ + class CallableTileEntityName implements Callable { + final TileEntity theTileEntity; + +- CallableTileEntityName(TileEntity var1) { +- this.theTileEntity = var1; ++ CallableTileEntityName(TileEntity par1TileEntity) { ++ this.theTileEntity = par1TileEntity; + } + + public String callTileEntityName() { diff --git a/patches/net/minecraft/src/CallableType.java.patch b/patches/net/minecraft/src/CallableType.java.patch new file mode 100644 index 0000000..4cf228d --- /dev/null +++ b/patches/net/minecraft/src/CallableType.java.patch @@ -0,0 +1,17 @@ +--- net/minecraft/src/CallableType.java ++++ net/minecraft/src/CallableType.java +@@ -3,10 +3,12 @@ + import java.util.concurrent.Callable; + + class CallableType implements Callable { ++ ++ /** Reference to the DecitatedServer object. */ + final DedicatedServer theDecitatedServer; + +- CallableType(DedicatedServer var1) { +- this.theDecitatedServer = var1; ++ CallableType(DedicatedServer par1DedicatedServer) { ++ this.theDecitatedServer = par1DedicatedServer; + } + + public String getType() { diff --git a/patches/net/minecraft/src/CallableType2.java.patch b/patches/net/minecraft/src/CallableType2.java.patch new file mode 100644 index 0000000..ce6aee1 --- /dev/null +++ b/patches/net/minecraft/src/CallableType2.java.patch @@ -0,0 +1,13 @@ +--- net/minecraft/src/CallableType2.java ++++ net/minecraft/src/CallableType2.java +@@ -5,8 +5,8 @@ + class CallableType2 implements Callable { + final Minecraft mc; + +- CallableType2(Minecraft var1) { +- this.mc = var1; ++ CallableType2(Minecraft par1Minecraft) { ++ this.mc = par1Minecraft; + } + + public String func_82886_a() { diff --git a/patches/net/minecraft/src/CallableType3.java.patch b/patches/net/minecraft/src/CallableType3.java.patch new file mode 100644 index 0000000..f692abb --- /dev/null +++ b/patches/net/minecraft/src/CallableType3.java.patch @@ -0,0 +1,17 @@ +--- net/minecraft/src/CallableType3.java ++++ net/minecraft/src/CallableType3.java +@@ -3,10 +3,12 @@ + import java.util.concurrent.Callable; + + class CallableType3 implements Callable { ++ ++ /** Reference to the IntegratedServer object. */ + final IntegratedServer theIntegratedServer; + +- CallableType3(IntegratedServer var1) { +- this.theIntegratedServer = var1; ++ CallableType3(IntegratedServer par1IntegratedServer) { ++ this.theIntegratedServer = par1IntegratedServer; + } + + public String getType() { diff --git a/patches/net/minecraft/src/CallableUpdatingScreenName.java.patch b/patches/net/minecraft/src/CallableUpdatingScreenName.java.patch new file mode 100644 index 0000000..d5ae763 --- /dev/null +++ b/patches/net/minecraft/src/CallableUpdatingScreenName.java.patch @@ -0,0 +1,13 @@ +--- net/minecraft/src/CallableUpdatingScreenName.java ++++ net/minecraft/src/CallableUpdatingScreenName.java +@@ -5,8 +5,8 @@ + class CallableUpdatingScreenName implements Callable { + final Minecraft theMinecraft; + +- CallableUpdatingScreenName(Minecraft var1) { +- this.theMinecraft = var1; ++ CallableUpdatingScreenName(Minecraft par1Minecraft) { ++ this.theMinecraft = par1Minecraft; + } + + public String callUpdatingScreenName() { diff --git a/patches/net/minecraft/src/ChatAllowedCharacters.java.patch b/patches/net/minecraft/src/ChatAllowedCharacters.java.patch new file mode 100644 index 0000000..694a5e0 --- /dev/null +++ b/patches/net/minecraft/src/ChatAllowedCharacters.java.patch @@ -0,0 +1,78 @@ +--- net/minecraft/src/ChatAllowedCharacters.java ++++ net/minecraft/src/ChatAllowedCharacters.java +@@ -4,9 +4,21 @@ + import java.io.InputStreamReader; + + public class ChatAllowedCharacters { +- public static final String a = getAllowedCharacters(); +- public static final char[] allowedCharactersArray = new char[]{'/', '\n', '\r', '\t', '\u0000', '\f', '`', '?', '*', '\\', '<', '>', '|', '\"', ':'}; +- ++ ++ /** ++ * This String have the characters allowed in any text drawing of minecraft. ++ */ ++ public static final String allowedCharacters = getAllowedCharacters(); ++ ++ /** ++ * Array of the special characters that are allowed in any text drawing of Minecraft. ++ */ ++ public static final char[] allowedCharactersArray = new char[] {'/', '\n', '\r', '\t', '\u0000', '\f', '`', '?', '*', '\\', '<', '>', '|', '\"', ':'}; ++ ++ /** ++ * Load the font.txt resource file, that is on UTF-8 format. This file contains the characters that minecraft can ++ * render Strings on screen. ++ */ + private static String getAllowedCharacters() { + String var0 = ""; + +@@ -14,35 +26,36 @@ + BufferedReader var1 = new BufferedReader(new InputStreamReader(ChatAllowedCharacters.class.getResourceAsStream("/font.txt"), "UTF-8")); + String var2 = ""; + +- while(true) { +- var2 = var1.readLine(); +- if(var2 == null) { +- var1.close(); +- break; +- } +- +- if(!var2.startsWith("#")) { ++ while ((var2 = var1.readLine()) != null) { ++ if (!var2.startsWith("#")) { + var0 = var0 + var2; + } + } ++ ++ var1.close(); + } catch (Exception var3) { ++ ; + } + + return var0; + } + +- public static final boolean isAllowedCharacter(char var0) { +- return var0 != 167 && (a.indexOf(var0) >= 0 || var0 > 32); ++ public static final boolean isAllowedCharacter(char par0) { ++ return par0 != 167 && (allowedCharacters.indexOf(par0) >= 0 || par0 > 32); + } + +- public static String filerAllowedCharacters(String var0) { ++ /** ++ * Filter string by only keeping those characters for which isAllowedCharacter() returns true. ++ */ ++ public static String filerAllowedCharacters(String par0Str) { + StringBuilder var1 = new StringBuilder(); +- char[] var2 = var0.toCharArray(); ++ char[] var2 = par0Str.toCharArray(); + int var3 = var2.length; + +- for(int var4 = 0; var4 < var3; ++var4) { ++ for (int var4 = 0; var4 < var3; ++var4) { + char var5 = var2[var4]; +- if(isAllowedCharacter(var5)) { ++ ++ if (isAllowedCharacter(var5)) { + var1.append(var5); + } + } diff --git a/patches/net/minecraft/src/ChatClickData.java.patch b/patches/net/minecraft/src/ChatClickData.java.patch new file mode 100644 index 0000000..eff52e8 --- /dev/null +++ b/patches/net/minecraft/src/ChatClickData.java.patch @@ -0,0 +1,86 @@ +--- net/minecraft/src/ChatClickData.java ++++ net/minecraft/src/ChatClickData.java +@@ -6,37 +6,48 @@ + import java.util.regex.Pattern; + + public class ChatClickData { +- public static final Pattern a = Pattern.compile("^(?:(https?)://)?([-\\w_\\.]{2,}\\.[a-z]{2,4})(/\\S*)?$"); ++ public static final Pattern pattern = Pattern.compile("^(?:(https?)://)?([-\\w_\\.]{2,}\\.[a-z]{2,4})(/\\S*)?$"); + private final FontRenderer fontR; + private final ChatLine line; + private final int field_78312_d; + private final int field_78313_e; +- private final String f; +- private final String g; +- +- public ChatClickData(FontRenderer var1, ChatLine var2, int var3, int var4) { +- this.fontR = var1; +- this.line = var2; +- this.field_78312_d = var3; +- this.field_78313_e = var4; +- this.f = var1.trimStringToWidth(var2.getChatLineString(), var3); +- this.g = this.findClickedUrl(); ++ private final String field_78310_f; ++ ++ /** The URL which was clicked on. */ ++ private final String clickedUrl; ++ ++ public ChatClickData(FontRenderer par1FontRenderer, ChatLine par2ChatLine, int par3, int par4) { ++ this.fontR = par1FontRenderer; ++ this.line = par2ChatLine; ++ this.field_78312_d = par3; ++ this.field_78313_e = par4; ++ this.field_78310_f = par1FontRenderer.trimStringToWidth(par2ChatLine.getChatLineString(), par3); ++ this.clickedUrl = this.findClickedUrl(); + } + ++ /** ++ * Gets the URL which was clicked on. ++ */ + public String getClickedUrl() { +- return this.g; ++ return this.clickedUrl; + } + ++ /** ++ * computes the URI from the clicked chat data object ++ */ + public URI getURI() { + String var1 = this.getClickedUrl(); +- if(var1 == null) { ++ ++ if (var1 == null) { + return null; + } else { +- Matcher var2 = a.matcher(var1); +- if(var2.matches()) { ++ Matcher var2 = pattern.matcher(var1); ++ ++ if (var2.matches()) { + try { + String var3 = var2.group(0); +- if(var2.group(1) == null) { ++ ++ if (var2.group(1) == null) { + var3 = "http://" + var3; + } + +@@ -51,13 +62,15 @@ + } + + private String findClickedUrl() { +- int var1 = this.f.lastIndexOf(" ", this.f.length()) + 1; +- if(var1 < 0) { ++ int var1 = this.field_78310_f.lastIndexOf(" ", this.field_78310_f.length()) + 1; ++ ++ if (var1 < 0) { + var1 = 0; + } + + int var2 = this.line.getChatLineString().indexOf(" ", var1); +- if(var2 < 0) { ++ ++ if (var2 < 0) { + var2 = this.line.getChatLineString().length(); + } + diff --git a/patches/net/minecraft/src/ChatLine.java.patch b/patches/net/minecraft/src/ChatLine.java.patch new file mode 100644 index 0000000..3b835fc --- /dev/null +++ b/patches/net/minecraft/src/ChatLine.java.patch @@ -0,0 +1,33 @@ +--- net/minecraft/src/ChatLine.java ++++ net/minecraft/src/ChatLine.java +@@ -1,18 +1,24 @@ + package net.minecraft.src; + + public class ChatLine { ++ ++ /** GUI Update Counter value this Line was created at */ + private final int updateCounterCreated; +- private final String b; ++ private final String lineString; ++ ++ /** ++ * int value to refer to existing Chat Lines, can be 0 which means unreferrable ++ */ + private final int chatLineID; + +- public ChatLine(int var1, String var2, int var3) { +- this.b = var2; +- this.updateCounterCreated = var1; +- this.chatLineID = var3; ++ public ChatLine(int par1, String par2Str, int par3) { ++ this.lineString = par2Str; ++ this.updateCounterCreated = par1; ++ this.chatLineID = par3; + } + + public String getChatLineString() { +- return this.b; ++ return this.lineString; + } + + public int getUpdatedCounter() { diff --git a/patches/net/minecraft/src/ChatMessageComponent.java.patch b/patches/net/minecraft/src/ChatMessageComponent.java.patch new file mode 100644 index 0000000..cde7eeb --- /dev/null +++ b/patches/net/minecraft/src/ChatMessageComponent.java.patch @@ -0,0 +1,455 @@ +--- net/minecraft/src/ChatMessageComponent.java ++++ net/minecraft/src/ChatMessageComponent.java +@@ -7,35 +7,34 @@ + import java.util.List; + + public class ChatMessageComponent { +- private static final Gson a = (new GsonBuilder()).registerTypeAdapter(ChatMessageComponent.class, new MessageComponentSerializer()).create(); ++ private static final Gson field_111089_a = (new GsonBuilder()).registerTypeAdapter(ChatMessageComponent.class, new MessageComponentSerializer()).create(); + private EnumChatFormatting color; +- private Boolean c; +- private Boolean d; +- private Boolean e; +- private Boolean f; +- private String g; +- private String h; +- private List i; +- +- public ChatMessageComponent() { +- } +- +- public ChatMessageComponent(ChatMessageComponent var1) { +- this.color = var1.color; +- this.c = var1.c; +- this.d = var1.d; +- this.e = var1.e; +- this.f = var1.f; +- this.g = var1.g; +- this.h = var1.h; +- this.i = var1.i == null ? null : Lists.newArrayList((Iterable)var1.i); +- } +- +- public ChatMessageComponent setColor(EnumChatFormatting var1) { +- if(var1 != null && !var1.Checks()) { ++ private Boolean bold; ++ private Boolean italic; ++ private Boolean underline; ++ private Boolean obfuscated; ++ private String text; ++ private String translationKey; ++ private List field_111091_i; ++ ++ public ChatMessageComponent() {} ++ ++ public ChatMessageComponent(ChatMessageComponent par1ChatMessageComponent) { ++ this.color = par1ChatMessageComponent.color; ++ this.bold = par1ChatMessageComponent.bold; ++ this.italic = par1ChatMessageComponent.italic; ++ this.underline = par1ChatMessageComponent.underline; ++ this.obfuscated = par1ChatMessageComponent.obfuscated; ++ this.text = par1ChatMessageComponent.text; ++ this.translationKey = par1ChatMessageComponent.translationKey; ++ this.field_111091_i = par1ChatMessageComponent.field_111091_i == null ? null : Lists.newArrayList(par1ChatMessageComponent.field_111091_i); ++ } ++ ++ public ChatMessageComponent setColor(EnumChatFormatting par1EnumChatFormatting) { ++ if (par1EnumChatFormatting != null && !par1EnumChatFormatting.isColor()) { + throw new IllegalArgumentException("Argument is not a valid color!"); + } else { +- this.color = var1; ++ this.color = par1EnumChatFormatting; + return this; + } + } +@@ -44,125 +43,133 @@ + return this.color; + } + +- public ChatMessageComponent setBold(Boolean var1) { +- this.c = var1; ++ public ChatMessageComponent setBold(Boolean par1) { ++ this.bold = par1; + return this; + } + + public Boolean isBold() { +- return this.c; ++ return this.bold; + } + +- public ChatMessageComponent setItalic(Boolean var1) { +- this.d = var1; ++ public ChatMessageComponent setItalic(Boolean par1) { ++ this.italic = par1; + return this; + } + + public Boolean isItalic() { +- return this.d; ++ return this.italic; + } + +- public ChatMessageComponent setUnderline(Boolean var1) { +- this.e = var1; ++ public ChatMessageComponent setUnderline(Boolean par1) { ++ this.underline = par1; + return this; + } + + public Boolean isUnderline() { +- return this.e; ++ return this.underline; + } + +- public ChatMessageComponent setObfuscated(Boolean var1) { +- this.f = var1; ++ public ChatMessageComponent setObfuscated(Boolean par1) { ++ this.obfuscated = par1; + return this; + } + + public Boolean isObfuscated() { +- return this.f; ++ return this.obfuscated; + } + + protected String getText() { +- return this.g; ++ return this.text; + } + + protected String getTranslationKey() { +- return this.h; ++ return this.translationKey; + } + + protected List getSubComponents() { +- return this.i; +- } +- +- public ChatMessageComponent appendComponent(ChatMessageComponent var1) { +- if(this.g == null && this.h == null) { +- if(this.i != null) { +- this.i.add(var1); +- } else { +- this.i = Lists.newArrayList((Object[])(new ChatMessageComponent[]{var1})); +- } +- } else { +- this.i = Lists.newArrayList((Object[])(new ChatMessageComponent[]{new ChatMessageComponent(this), var1})); +- this.g = null; +- this.h = null; +- } +- +- return this; +- } +- +- public ChatMessageComponent addText(String var1) { +- if(this.g == null && this.h == null) { +- if(this.i != null) { +- this.i.add(createFromText(var1)); +- } else { +- this.g = var1; +- } +- } else { +- this.i = Lists.newArrayList((Object[])(new ChatMessageComponent[]{new ChatMessageComponent(this), createFromText(var1)})); +- this.g = null; +- this.h = null; +- } +- +- return this; +- } +- +- public ChatMessageComponent addKey(String var1) { +- if(this.g == null && this.h == null) { +- if(this.i != null) { +- this.i.add(createFromTranslationKey(var1)); +- } else { +- this.h = var1; +- } +- } else { +- this.i = Lists.newArrayList((Object[])(new ChatMessageComponent[]{new ChatMessageComponent(this), createFromTranslationKey(var1)})); +- this.g = null; +- this.h = null; +- } +- +- return this; +- } +- +- public ChatMessageComponent addFormatted(String var1, Object... var2) { +- if(this.g == null && this.h == null) { +- if(this.i != null) { +- this.i.add(createFromTranslationWithSubstitutions(var1, var2)); +- } else { +- this.h = var1; +- this.i = Lists.newArrayList(); +- Object[] var3 = var2; +- int var4 = var2.length; +- +- for(int var5 = 0; var5 < var4; ++var5) { ++ return this.field_111091_i; ++ } ++ ++ public ChatMessageComponent appendComponent(ChatMessageComponent par1ChatMessageComponent) { ++ if (this.text == null && this.translationKey == null) { ++ if (this.field_111091_i != null) { ++ this.field_111091_i.add(par1ChatMessageComponent); ++ } else { ++ this.field_111091_i = Lists.newArrayList(new ChatMessageComponent[] {par1ChatMessageComponent}); ++ } ++ } else { ++ this.field_111091_i = Lists.newArrayList(new ChatMessageComponent[] {new ChatMessageComponent(this), par1ChatMessageComponent}); ++ this.text = null; ++ this.translationKey = null; ++ } ++ ++ return this; ++ } ++ ++ public ChatMessageComponent addText(String par1Str) { ++ if (this.text == null && this.translationKey == null) { ++ if (this.field_111091_i != null) { ++ this.field_111091_i.add(createFromText(par1Str)); ++ } else { ++ this.text = par1Str; ++ } ++ } else { ++ this.field_111091_i = Lists.newArrayList(new ChatMessageComponent[] {new ChatMessageComponent(this), createFromText(par1Str)}); ++ this.text = null; ++ this.translationKey = null; ++ } ++ ++ return this; ++ } ++ ++ /** ++ * Appends a translated string. ++ */ ++ public ChatMessageComponent addKey(String par1Str) { ++ if (this.text == null && this.translationKey == null) { ++ if (this.field_111091_i != null) { ++ this.field_111091_i.add(createFromTranslationKey(par1Str)); ++ } else { ++ this.translationKey = par1Str; ++ } ++ } else { ++ this.field_111091_i = Lists.newArrayList(new ChatMessageComponent[] {new ChatMessageComponent(this), createFromTranslationKey(par1Str)}); ++ this.text = null; ++ this.translationKey = null; ++ } ++ ++ return this; ++ } ++ ++ /** ++ * Appends a formatted translation key. Args: key, params. The text ultimately displayed is ++ * String.format(translate(key), params) ++ */ ++ public ChatMessageComponent addFormatted(String par1Str, Object ... par2ArrayOfObj) { ++ if (this.text == null && this.translationKey == null) { ++ if (this.field_111091_i != null) { ++ this.field_111091_i.add(createFromTranslationWithSubstitutions(par1Str, par2ArrayOfObj)); ++ } else { ++ this.translationKey = par1Str; ++ this.field_111091_i = Lists.newArrayList(); ++ Object[] var3 = par2ArrayOfObj; ++ int var4 = par2ArrayOfObj.length; ++ ++ for (int var5 = 0; var5 < var4; ++var5) { + Object var6 = var3[var5]; +- if(var6 instanceof ChatMessageComponent) { +- this.i.add((ChatMessageComponent)var6); ++ ++ if (var6 instanceof ChatMessageComponent) { ++ this.field_111091_i.add((ChatMessageComponent)var6); + } else { +- this.i.add(createFromText(var6.toString())); ++ this.field_111091_i.add(createFromText(var6.toString())); + } + } + } + } else { +- this.i = Lists.newArrayList((Object[])(new ChatMessageComponent[]{new ChatMessageComponent(this), createFromTranslationWithSubstitutions(var1, var2)})); +- this.g = null; +- this.h = null; ++ this.field_111091_i = Lists.newArrayList(new ChatMessageComponent[] {new ChatMessageComponent(this), createFromTranslationWithSubstitutions(par1Str, par2ArrayOfObj)}); ++ this.text = null; ++ this.translationKey = null; + } + + return this; +@@ -172,45 +179,51 @@ + return this.toStringWithFormatting(false); + } + +- public String toStringWithFormatting(boolean var1) { +- return this.toStringWithDefaultFormatting(var1, (EnumChatFormatting)null, false, false, false, false); ++ public String toStringWithFormatting(boolean par1) { ++ return this.toStringWithDefaultFormatting(par1, (EnumChatFormatting)null, false, false, false, false); + } + +- public String toStringWithDefaultFormatting(boolean var1, EnumChatFormatting var2, boolean var3, boolean var4, boolean var5, boolean var6) { ++ /** ++ * args: enableFormat, defaultColor, defaultBold, defaultItalic, defaultUnderline, defaultObfuscated ++ */ ++ public String toStringWithDefaultFormatting(boolean par1, EnumChatFormatting par2EnumChatFormatting, boolean par3, boolean par4, boolean par5, boolean par6) { + StringBuilder var7 = new StringBuilder(); +- EnumChatFormatting var8 = this.color == null ? var2 : this.color; +- boolean var9 = this.c == null ? var3 : this.c.booleanValue(); +- boolean var10 = this.d == null ? var4 : this.d.booleanValue(); +- boolean var11 = this.e == null ? var5 : this.e.booleanValue(); +- boolean var12 = this.f == null ? var6 : this.f.booleanValue(); +- if(this.h != null) { +- if(var1) { ++ EnumChatFormatting var8 = this.color == null ? par2EnumChatFormatting : this.color; ++ boolean var9 = this.bold == null ? par3 : this.bold.booleanValue(); ++ boolean var10 = this.italic == null ? par4 : this.italic.booleanValue(); ++ boolean var11 = this.underline == null ? par5 : this.underline.booleanValue(); ++ boolean var12 = this.obfuscated == null ? par6 : this.obfuscated.booleanValue(); ++ ++ if (this.translationKey != null) { ++ if (par1) { + appendFormattingToString(var7, var8, var9, var10, var11, var12); + } + +- if(this.i != null) { +- String[] var13 = new String[this.i.size()]; ++ if (this.field_111091_i != null) { ++ String[] var13 = new String[this.field_111091_i.size()]; + +- for(int var14 = 0; var14 < this.i.size(); ++var14) { +- var13[var14] = ((ChatMessageComponent)this.i.get(var14)).toStringWithDefaultFormatting(var1, var8, var9, var10, var11, var12); ++ for (int var14 = 0; var14 < this.field_111091_i.size(); ++var14) { ++ var13[var14] = ((ChatMessageComponent)this.field_111091_i.get(var14)).toStringWithDefaultFormatting(par1, var8, var9, var10, var11, var12); + } + +- var7.append(StatCollector.translateToLocalFormatted(this.h, var13)); ++ var7.append(StatCollector.translateToLocalFormatted(this.translationKey, var13)); + } else { +- var7.append(StatCollector.translateToLocal(this.h)); ++ var7.append(StatCollector.translateToLocal(this.translationKey)); + } +- } else if(this.g != null) { +- if(var1) { ++ } else if (this.text != null) { ++ if (par1) { + appendFormattingToString(var7, var8, var9, var10, var11, var12); + } + +- var7.append(this.g); ++ var7.append(this.text); + } else { + ChatMessageComponent var16; +- if(this.i != null) { +- for(Iterator var15 = this.i.iterator(); var15.hasNext(); var7.append(var16.toStringWithDefaultFormatting(var1, var8, var9, var10, var11, var12))) { ++ ++ if (this.field_111091_i != null) { ++ for (Iterator var15 = this.field_111091_i.iterator(); var15.hasNext(); var7.append(var16.toStringWithDefaultFormatting(par1, var8, var9, var10, var11, var12))) { + var16 = (ChatMessageComponent)var15.next(); +- if(var1) { ++ ++ if (par1) { + appendFormattingToString(var7, var8, var9, var10, var11, var12); + } + } +@@ -220,61 +233,60 @@ + return var7.toString(); + } + +- private static void appendFormattingToString(StringBuilder var0, EnumChatFormatting var1, boolean var2, boolean var3, boolean var4, boolean var5) { +- if(var1 != null) { +- var0.append(var1); +- } else if(var2 || var3 || var4 || var5) { +- var0.append(EnumChatFormatting.RESET); +- } +- +- if(var2) { +- var0.append(EnumChatFormatting.BOLD); +- } +- +- if(var3) { +- var0.append(EnumChatFormatting.ITALIC); +- } +- +- if(var4) { +- var0.append(EnumChatFormatting.UNDERLINE); +- } +- +- if(var5) { +- var0.append(EnumChatFormatting.OBFUSCATED); +- } +- ++ private static void appendFormattingToString(StringBuilder par0StringBuilder, EnumChatFormatting par1EnumChatFormatting, boolean par2, boolean par3, boolean par4, boolean par5) { ++ if (par1EnumChatFormatting != null) { ++ par0StringBuilder.append(par1EnumChatFormatting); ++ } else if (par2 || par3 || par4 || par5) { ++ par0StringBuilder.append(EnumChatFormatting.RESET); ++ } ++ ++ if (par2) { ++ par0StringBuilder.append(EnumChatFormatting.BOLD); ++ } ++ ++ if (par3) { ++ par0StringBuilder.append(EnumChatFormatting.ITALIC); ++ } ++ ++ if (par4) { ++ par0StringBuilder.append(EnumChatFormatting.UNDERLINE); ++ } ++ ++ if (par5) { ++ par0StringBuilder.append(EnumChatFormatting.OBFUSCATED); ++ } + } + +- public static ChatMessageComponent createFromJson(String var0) { ++ public static ChatMessageComponent createFromJson(String par0Str) { + try { +- return (ChatMessageComponent)a.fromJson(var0, ChatMessageComponent.class); ++ return (ChatMessageComponent)field_111089_a.fromJson(par0Str, ChatMessageComponent.class); + } catch (Throwable var4) { + CrashReport var2 = CrashReport.makeCrashReport(var4, "Deserializing Message"); + CrashReportCategory var3 = var2.makeCategory("Serialized Message"); +- var3.addCrashSection("JSON string", var0); ++ var3.addCrashSection("JSON string", par0Str); + throw new ReportedException(var2); + } + } + +- public static ChatMessageComponent createFromText(String var0) { +- ChatMessageComponent var1 = new ChatMessageComponent(); +- var1.addText(var0); +- return var1; +- } +- +- public static ChatMessageComponent createFromTranslationKey(String var0) { +- ChatMessageComponent var1 = new ChatMessageComponent(); +- var1.addKey(var0); +- return var1; +- } +- +- public static ChatMessageComponent createFromTranslationWithSubstitutions(String var0, Object... var1) { ++ public static ChatMessageComponent createFromText(String par0Str) { ++ ChatMessageComponent var1 = new ChatMessageComponent(); ++ var1.addText(par0Str); ++ return var1; ++ } ++ ++ public static ChatMessageComponent createFromTranslationKey(String par0Str) { ++ ChatMessageComponent var1 = new ChatMessageComponent(); ++ var1.addKey(par0Str); ++ return var1; ++ } ++ ++ public static ChatMessageComponent createFromTranslationWithSubstitutions(String par0Str, Object ... par1ArrayOfObj) { + ChatMessageComponent var2 = new ChatMessageComponent(); +- var2.addFormatted(var0, var1); ++ var2.addFormatted(par0Str, par1ArrayOfObj); + return var2; + } + + public String toJson() { +- return a.toJson((Object)this); ++ return field_111089_a.toJson(this); + } + } diff --git a/patches/net/minecraft/src/ChestItemRenderHelper.java.patch b/patches/net/minecraft/src/ChestItemRenderHelper.java.patch new file mode 100644 index 0000000..b94a895 --- /dev/null +++ b/patches/net/minecraft/src/ChestItemRenderHelper.java.patch @@ -0,0 +1,34 @@ +--- net/minecraft/src/ChestItemRenderHelper.java ++++ net/minecraft/src/ChestItemRenderHelper.java +@@ -1,19 +1,27 @@ + package net.minecraft.src; + + public class ChestItemRenderHelper { ++ ++ /** The static instance of ChestItemRenderHelper. */ + public static ChestItemRenderHelper instance = new ChestItemRenderHelper(); ++ ++ /** Instance of Chest's Tile Entity. */ + private TileEntityChest theChest = new TileEntityChest(0); + private TileEntityChest field_142033_c = new TileEntityChest(1); ++ ++ /** Instance of Ender Chest's Tile Entity. */ + private TileEntityEnderChest theEnderChest = new TileEntityEnderChest(); + +- public void renderChest(Block var1, int var2, float var3) { +- if(var1.blockID == Block.enderChest.blockID) { ++ /** ++ * Renders a chest at 0,0,0 - used for item rendering ++ */ ++ public void renderChest(Block par1Block, int par2, float par3) { ++ if (par1Block.blockID == Block.enderChest.blockID) { + TileEntityRenderer.instance.renderTileEntityAt(this.theEnderChest, 0.0D, 0.0D, 0.0D, 0.0F); +- } else if(var1.blockID == Block.chestTrapped.blockID) { ++ } else if (par1Block.blockID == Block.chestTrapped.blockID) { + TileEntityRenderer.instance.renderTileEntityAt(this.field_142033_c, 0.0D, 0.0D, 0.0D, 0.0F); + } else { + TileEntityRenderer.instance.renderTileEntityAt(this.theChest, 0.0D, 0.0D, 0.0D, 0.0F); + } +- + } + } diff --git a/patches/net/minecraft/src/Chunk.java.patch b/patches/net/minecraft/src/Chunk.java.patch new file mode 100644 index 0000000..f817557 --- /dev/null +++ b/patches/net/minecraft/src/Chunk.java.patch @@ -0,0 +1,1654 @@ +--- net/minecraft/src/Chunk.java ++++ net/minecraft/src/Chunk.java +@@ -8,62 +8,133 @@ + import java.util.Map; + import java.util.Random; + ++import org.spoutcraft.client.block.SpoutcraftChunk; ++ + public class Chunk { ++ /** ++ * Determines if the chunk is lit or not at a light value greater than 0. ++ */ + public static boolean isLit; ++ ++ /** ++ * Used to store block IDs, block MSBs, Sky-light maps, Block-light maps, and metadata. Each entry corresponds to a ++ * logical segment of 16x16x16 blocks, stacked vertically. ++ */ + private ExtendedBlockStorage[] storageArrays; ++ ++ /** ++ * Contains a 16x16 mapping on the X/Z plane of the biome ID to which each colum belongs. ++ */ + private byte[] blockBiomeArray; ++ ++ /** ++ * A map, similar to heightMap, that tracks how far down precipitation can fall. ++ */ + public int[] precipitationHeightMap; ++ ++ /** Which columns need their skylightMaps updated. */ + public boolean[] updateSkylightColumns; ++ ++ /** Whether or not this Chunk is currently loaded into the World */ + public boolean isChunkLoaded; ++ ++ /** Reference to the World object. */ + public World worldObj; + public int[] heightMap; ++ ++ /** The x coordinate of the chunk. */ + public final int xPosition; ++ ++ /** The z coordinate of the chunk. */ + public final int zPosition; + private boolean isGapLightingUpdated; +- public Map i; +- public List[] j; ++ ++ /** A Map of ChunkPositions to TileEntities in this chunk */ ++ public Map chunkTileEntityMap; ++ ++ /** ++ * Array of Lists containing the entities in this Chunk. Each List represents a 16 block subchunk. ++ */ ++ public List[] entityLists; ++ ++ /** Boolean value indicating if the terrain is populated. */ + public boolean isTerrainPopulated; ++ ++ /** ++ * Set to true if the chunk has been modified and needs to be updated internally. ++ */ + public boolean isModified; ++ ++ /** ++ * Whether this Chunk has any Entities and thus requires saving on every tick ++ */ + public boolean hasEntities; ++ ++ /** The time according to World.worldTime when this chunk was last saved */ + public long lastSaveTime; ++ ++ /** ++ * Updates to this chunk will not be sent to clients if this is false. This field is set to true the first time the ++ * chunk is sent to a client, and never set to false. ++ */ + public boolean sendUpdates; +- public int heightMapMinimum; ++ ++ /** Lowest value in the heightmap. */ ++ public int heightMapMinimum; ++ ++ /** the cumulative number of ticks players have been in this chunk */ + public long inhabitedTime; ++ ++ /** ++ * Contains the current round-robin relight check index, and is implied as the relight check location as well. ++ */ + private int queuedLightChecks; ++ ++ // Spout Start ++ public SpoutcraftChunk spoutChunk; ++ int grassColorCache = -1; ++ int waterColorCache = -1; ++ public boolean canBeUnloaded = false; ++ // Spout End + +- public Chunk(World var1, int var2, int var3) { ++ public Chunk(World par1World, int par2, int par3) { + this.storageArrays = new ExtendedBlockStorage[16]; + this.blockBiomeArray = new byte[256]; + this.precipitationHeightMap = new int[256]; + this.updateSkylightColumns = new boolean[256]; +- this.i = new HashMap(); ++ this.chunkTileEntityMap = new HashMap(); + this.queuedLightChecks = 4096; +- this.j = new List[16]; +- this.worldObj = var1; +- this.xPosition = var2; +- this.zPosition = var3; ++ this.entityLists = new List[16]; ++ this.worldObj = par1World; ++ this.xPosition = par2; ++ this.zPosition = par3; + this.heightMap = new int[256]; +- +- for(int var4 = 0; var4 < this.j.length; ++var4) { +- this.j[var4] = new ArrayList(); ++ for (int var4 = 0; var4 < this.entityLists.length; ++var4) { ++ this.entityLists[var4] = new ArrayList(); + } + + Arrays.fill(this.precipitationHeightMap, -999); +- Arrays.fill(this.blockBiomeArray, (byte)-1); ++ Arrays.fill(this.blockBiomeArray, (byte) - 1); ++ ++ // Spout Start ++ spoutChunk = new SpoutcraftChunk(this); ++ // Spout End + } + +- public Chunk(World var1, byte[] var2, int var3, int var4) { +- this(var1, var3, var4); +- int var5 = var2.length / 256; +- +- for(int var6 = 0; var6 < 16; ++var6) { +- for(int var7 = 0; var7 < 16; ++var7) { +- for(int var8 = 0; var8 < var5; ++var8) { +- byte var9 = var2[var6 << 11 | var7 << 7 | var8]; +- if(var9 != 0) { ++ public Chunk(World par1World, byte[] par2ArrayOfByte, int par3, int par4) { ++ this(par1World, par3, par4); ++ int var5 = par2ArrayOfByte.length / 256; ++ ++ for (int var6 = 0; var6 < 16; ++var6) { ++ for (int var7 = 0; var7 < 16; ++var7) { ++ for (int var8 = 0; var8 < var5; ++var8) { ++ byte var9 = par2ArrayOfByte[var6 << 11 | var7 << 7 | var8]; ++ ++ if (var9 != 0) { + int var10 = var8 >> 4; +- if(this.storageArrays[var10] == null) { +- this.storageArrays[var10] = new ExtendedBlockStorage(var10 << 4, !var1.provider.hasNoSky); ++ ++ if (this.storageArrays[var10] == null) { ++ this.storageArrays[var10] = new ExtendedBlockStorage(var10 << 4, !par1World.provider.hasNoSky); + } + + this.storageArrays[var10].setExtBlockID(var6, var8 & 15, var7, var9); +@@ -71,20 +142,28 @@ + } + } + } +- +- } +- +- public boolean isAtLocation(int var1, int var2) { +- return var1 == this.xPosition && var2 == this.zPosition; +- } +- +- public int getHeightValue(int var1, int var2) { +- return this.heightMap[var2 << 4 | var1]; +- } +- ++ } ++ ++ /** ++ * Checks whether the chunk is at the X/Z location specified ++ */ ++ public boolean isAtLocation(int par1, int par2) { ++ return par1 == this.xPosition && par2 == this.zPosition; ++ } ++ ++ /** ++ * Returns the value in the height map at this x, z coordinate in the chunk ++ */ ++ public int getHeightValue(int par1, int par2) { ++ return this.heightMap[par2 << 4 | par1]; ++ } ++ ++ /** ++ * Returns the topmost ExtendedBlockStorage instance for this Chunk that actually contains a block. ++ */ + public int getTopFilledSegment() { +- for(int var1 = this.storageArrays.length - 1; var1 >= 0; --var1) { +- if(this.storageArrays[var1] != null) { ++ for (int var1 = this.storageArrays.length - 1; var1 >= 0; --var1) { ++ if (this.storageArrays[var1] != null) { + return this.storageArrays[var1].getYLocation(); + } + } +@@ -92,23 +171,40 @@ + return 0; + } + ++ /** ++ * Returns the ExtendedBlockStorage array for this Chunk. ++ */ + public ExtendedBlockStorage[] getBlockStorageArray() { + return this.storageArrays; + } + ++ /** ++ * Generates the height map for a chunk from scratch ++ */ + public void generateHeightMap() { + int var1 = this.getTopFilledSegment(); + +- for(int var2 = 0; var2 < 16; ++var2) { +- for(int var3 = 0; var3 < 16; ++var3) { ++ for (int var2 = 0; var2 < 16; ++var2) { ++ int var3 = 0; ++ ++ while (var3 < 16) { + this.precipitationHeightMap[var2 + (var3 << 4)] = -999; +- +- for(int var4 = var1 + 16 - 1; var4 > 0; --var4) { +- int var5 = this.getBlockID(var2, var4 - 1, var3); +- if(Block.lightOpacity[var5] != 0) { ++ int var4 = var1 + 16 - 1; ++ ++ while (true) { ++ if (var4 > 0) { ++ int var5 = this.getBlockID(var2, var4 - 1, var3); ++ ++ if (Block.lightOpacity[var5] == 0) { ++ --var4; ++ continue; ++ } ++ + this.heightMap[var3 << 4 | var2] = var4; +- break; + } ++ ++ ++var3; ++ break; + } + } + } +@@ -116,68 +212,89 @@ + this.isModified = true; + } + ++ /** ++ * Generates the initial skylight map for the chunk upon generation or load. ++ */ + public void generateSkylightMap() { + int var1 = this.getTopFilledSegment(); + this.heightMapMinimum = Integer.MAX_VALUE; +- + int var2; + int var3; +- for(var2 = 0; var2 < 16; ++var2) { +- for(var3 = 0; var3 < 16; ++var3) { ++ ++ for (var2 = 0; var2 < 16; ++var2) { ++ var3 = 0; ++ ++ while (var3 < 16) { + this.precipitationHeightMap[var2 + (var3 << 4)] = -999; +- +- int var4; +- for(var4 = var1 + 16 - 1; var4 > 0; --var4) { +- if(this.getBlockLightOpacity(var2, var4 - 1, var3) != 0) { ++ int var4 = var1 + 16 - 1; ++ ++ while (true) { ++ if (var4 > 0) { ++ if (this.getBlockLightOpacity(var2, var4 - 1, var3) == 0) { ++ --var4; ++ continue; ++ } ++ + this.heightMap[var3 << 4 | var2] = var4; +- if(var4 < this.heightMapMinimum) { ++ ++ if (var4 < this.heightMapMinimum) { + this.heightMapMinimum = var4; + } +- break; + } +- } +- +- if(!this.worldObj.provider.hasNoSky) { +- var4 = 15; +- int var5 = var1 + 16 - 1; +- +- do { +- var4 -= this.getBlockLightOpacity(var2, var5, var3); +- if(var4 > 0) { +- ExtendedBlockStorage var6 = this.storageArrays[var5 >> 4]; +- if(var6 != null) { +- var6.setExtSkylightValue(var2, var5 & 15, var3, var4); +- this.worldObj.markBlockForRenderUpdate((this.xPosition << 4) + var2, var5, (this.zPosition << 4) + var3); ++ ++ if (!this.worldObj.provider.hasNoSky) { ++ var4 = 15; ++ int var5 = var1 + 16 - 1; ++ ++ do { ++ var4 -= this.getBlockLightOpacity(var2, var5, var3); ++ ++ if (var4 > 0) { ++ ExtendedBlockStorage var6 = this.storageArrays[var5 >> 4]; ++ ++ if (var6 != null) { ++ var6.setExtSkylightValue(var2, var5 & 15, var3, var4); ++ this.worldObj.markBlockForRenderUpdate((this.xPosition << 4) + var2, var5, (this.zPosition << 4) + var3); ++ } + } +- } +- +- --var5; +- } while(var5 > 0 && var4 > 0); ++ ++ --var5; ++ } while (var5 > 0 && var4 > 0); ++ } ++ ++ ++var3; ++ break; + } + } + } + + this.isModified = true; + +- for(var2 = 0; var2 < 16; ++var2) { +- for(var3 = 0; var3 < 16; ++var3) { ++ for (var2 = 0; var2 < 16; ++var2) { ++ for (var3 = 0; var3 < 16; ++var3) { + this.propagateSkylightOcclusion(var2, var3); + } + } +- + } + +- private void propagateSkylightOcclusion(int var1, int var2) { +- this.updateSkylightColumns[var1 + var2 * 16] = true; ++ /** ++ * Propagates a given sky-visible block's light value downward and upward to neighboring blocks as necessary. ++ */ ++ private void propagateSkylightOcclusion(int par1, int par2) { ++ this.updateSkylightColumns[par1 + par2 * 16] = true; + this.isGapLightingUpdated = true; + } + ++ /** ++ * Runs delayed skylight updates. ++ */ + private void updateSkylight_do() { + this.worldObj.theProfiler.startSection("recheckGaps"); +- if(this.worldObj.doChunksNearChunkExist(this.xPosition * 16 + 8, 0, this.zPosition * 16 + 8, 16)) { +- for(int var1 = 0; var1 < 16; ++var1) { +- for(int var2 = 0; var2 < 16; ++var2) { +- if(this.updateSkylightColumns[var1 + var2 * 16]) { ++ ++ if (this.worldObj.doChunksNearChunkExist(this.xPosition * 16 + 8, 0, this.zPosition * 16 + 8, 16)) { ++ for (int var1 = 0; var1 < 16; ++var1) { ++ for (int var2 = 0; var2 < 16; ++var2) { ++ if (this.updateSkylightColumns[var1 + var2 * 16]) { + this.updateSkylightColumns[var1 + var2 * 16] = false; + int var3 = this.getHeightValue(var1, var2); + int var4 = this.xPosition * 16 + var1; +@@ -185,16 +302,17 @@ + int var6 = this.worldObj.getChunkHeightMapMinimum(var4 - 1, var5); + int var7 = this.worldObj.getChunkHeightMapMinimum(var4 + 1, var5); + int var8 = this.worldObj.getChunkHeightMapMinimum(var4, var5 - 1); +- int var9 = this.worldObj.getChunkHeightMapMinimum(var4, var5 + 1); +- if(var7 < var6) { ++ int var9 = this.worldObj.getChunkHeightMapMinimum(var4, var5 + 1); ++ ++ if (var7 < var6) { + var6 = var7; + } + +- if(var8 < var6) { ++ if (var8 < var6) { + var6 = var8; + } + +- if(var9 < var6) { ++ if (var9 < var6) { + var6 = var9; + } + +@@ -213,208 +331,240 @@ + this.worldObj.theProfiler.endSection(); + } + +- private void checkSkylightNeighborHeight(int var1, int var2, int var3) { +- int var4 = this.worldObj.getHeightValue(var1, var2); +- if(var4 > var3) { +- this.updateSkylightNeighborHeight(var1, var2, var3, var4 + 1); +- } else if(var4 < var3) { +- this.updateSkylightNeighborHeight(var1, var2, var4, var3 + 1); ++ /** ++ * Checks the height of a block next to a sky-visible block and schedules a lighting update as necessary. ++ */ ++ private void checkSkylightNeighborHeight(int par1, int par2, int par3) { ++ int var4 = this.worldObj.getHeightValue(par1, par2); ++ ++ if (var4 > par3) { ++ this.updateSkylightNeighborHeight(par1, par2, par3, var4 + 1); ++ } else if (var4 < par3) { ++ this.updateSkylightNeighborHeight(par1, par2, var4, par3 + 1); + } +- + } + +- private void updateSkylightNeighborHeight(int var1, int var2, int var3, int var4) { +- if(var4 > var3 && this.worldObj.doChunksNearChunkExist(var1, 0, var2, 16)) { +- for(int var5 = var3; var5 < var4; ++var5) { +- this.worldObj.updateLightByType(EnumSkyBlock.Sky, var1, var5, var2); ++ private void updateSkylightNeighborHeight(int par1, int par2, int par3, int par4) { ++ if (par4 > par3 && this.worldObj.doChunksNearChunkExist(par1, 0, par2, 16)) { ++ for (int var5 = par3; var5 < par4; ++var5) { ++ this.worldObj.updateLightByType(EnumSkyBlock.Sky, par1, var5, par2); + } + + this.isModified = true; + } +- + } + +- private void relightBlock(int var1, int var2, int var3) { +- int var4 = this.heightMap[var3 << 4 | var1] & 255; ++ /** ++ * Initiates the recalculation of both the block-light and sky-light for a given block inside a chunk. ++ */ ++ private void relightBlock(int par1, int par2, int par3) { ++ int var4 = this.heightMap[par3 << 4 | par1] & 255; + int var5 = var4; +- if(var2 > var4) { +- var5 = var2; ++ ++ if (par2 > var4) { ++ var5 = par2; + } + +- while(var5 > 0 && this.getBlockLightOpacity(var1, var5 - 1, var3) == 0) { ++ while (var5 > 0 && this.getBlockLightOpacity(par1, var5 - 1, par3) == 0) { + --var5; + } + +- if(var5 != var4) { +- this.worldObj.markBlocksDirtyVertical(var1 + this.xPosition * 16, var3 + this.zPosition * 16, var5, var4); +- this.heightMap[var3 << 4 | var1] = var5; +- int var6 = this.xPosition * 16 + var1; +- int var7 = this.zPosition * 16 + var3; ++ if (var5 != var4) { ++ this.worldObj.markBlocksDirtyVertical(par1 + this.xPosition * 16, par3 + this.zPosition * 16, var5, var4); ++ this.heightMap[par3 << 4 | par1] = var5; ++ int var6 = this.xPosition * 16 + par1; ++ int var7 = this.zPosition * 16 + par3; ++ int var13; + int var8; +- int var12; +- if(!this.worldObj.provider.hasNoSky) { ++ ++ if (!this.worldObj.provider.hasNoSky) { + ExtendedBlockStorage var9; +- if(var5 < var4) { +- for(var8 = var5; var8 < var4; ++var8) { ++ ++ if (var5 < var4) { ++ for (var8 = var5; var8 < var4; ++var8) { + var9 = this.storageArrays[var8 >> 4]; +- if(var9 != null) { +- var9.setExtSkylightValue(var1, var8 & 15, var3, 15); +- this.worldObj.markBlockForRenderUpdate((this.xPosition << 4) + var1, var8, (this.zPosition << 4) + var3); ++ ++ if (var9 != null) { ++ var9.setExtSkylightValue(par1, var8 & 15, par3, 15); ++ this.worldObj.markBlockForRenderUpdate((this.xPosition << 4) + par1, var8, (this.zPosition << 4) + par3); + } + } + } else { +- for(var8 = var4; var8 < var5; ++var8) { ++ for (var8 = var4; var8 < var5; ++var8) { + var9 = this.storageArrays[var8 >> 4]; +- if(var9 != null) { +- var9.setExtSkylightValue(var1, var8 & 15, var3, 0); +- this.worldObj.markBlockForRenderUpdate((this.xPosition << 4) + var1, var8, (this.zPosition << 4) + var3); ++ ++ if (var9 != null) { ++ var9.setExtSkylightValue(par1, var8 & 15, par3, 0); ++ this.worldObj.markBlockForRenderUpdate((this.xPosition << 4) + par1, var8, (this.zPosition << 4) + par3); + } + } + } + + var8 = 15; + +- while(var5 > 0 && var8 > 0) { ++ while (var5 > 0 && var8 > 0) { + --var5; +- var12 = this.getBlockLightOpacity(var1, var5, var3); +- if(var12 == 0) { +- var12 = 1; ++ var13 = this.getBlockLightOpacity(par1, var5, par3); ++ ++ if (var13 == 0) { ++ var13 = 1; + } + +- var8 -= var12; +- if(var8 < 0) { ++ var8 -= var13; ++ ++ if (var8 < 0) { + var8 = 0; + } + + ExtendedBlockStorage var10 = this.storageArrays[var5 >> 4]; +- if(var10 != null) { +- var10.setExtSkylightValue(var1, var5 & 15, var3, var8); ++ ++ if (var10 != null) { ++ var10.setExtSkylightValue(par1, var5 & 15, par3, var8); + } + } + } + +- var8 = this.heightMap[var3 << 4 | var1]; +- var12 = var4; +- int var13 = var8; +- if(var8 < var4) { +- var12 = var8; +- var13 = var4; ++ var8 = this.heightMap[par3 << 4 | par1]; ++ var13 = var4; ++ int var12 = var8; ++ ++ if (var8 < var4) { ++ var13 = var8; ++ var12 = var4; + } + +- if(var8 < this.heightMapMinimum) { ++ if (var8 < this.heightMapMinimum) { + this.heightMapMinimum = var8; + } + +- if(!this.worldObj.provider.hasNoSky) { +- this.updateSkylightNeighborHeight(var6 - 1, var7, var12, var13); +- this.updateSkylightNeighborHeight(var6 + 1, var7, var12, var13); +- this.updateSkylightNeighborHeight(var6, var7 - 1, var12, var13); +- this.updateSkylightNeighborHeight(var6, var7 + 1, var12, var13); +- this.updateSkylightNeighborHeight(var6, var7, var12, var13); ++ if (!this.worldObj.provider.hasNoSky) { ++ this.updateSkylightNeighborHeight(var6 - 1, var7, var13, var12); ++ this.updateSkylightNeighborHeight(var6 + 1, var7, var13, var12); ++ this.updateSkylightNeighborHeight(var6, var7 - 1, var13, var12); ++ this.updateSkylightNeighborHeight(var6, var7 + 1, var13, var12); ++ this.updateSkylightNeighborHeight(var6, var7, var13, var12); + } + + this.isModified = true; + } + } + +- public int getBlockLightOpacity(int var1, int var2, int var3) { +- return Block.lightOpacity[this.getBlockID(var1, var2, var3)]; +- } +- +- public int getBlockID(int var1, int var2, int var3) { +- if(var2 >> 4 >= this.storageArrays.length) { +- return 0; +- } else { +- ExtendedBlockStorage var4 = this.storageArrays[var2 >> 4]; +- return var4 != null ? var4.getExtBlockID(var1, var2 & 15, var3) : 0; +- } +- } +- +- public int getBlockMetadata(int var1, int var2, int var3) { +- if(var2 >> 4 >= this.storageArrays.length) { +- return 0; +- } else { +- ExtendedBlockStorage var4 = this.storageArrays[var2 >> 4]; +- return var4 != null ? var4.getExtBlockMetadata(var1, var2 & 15, var3) : 0; +- } +- } +- +- public boolean setBlockIDWithMetadata(int var1, int var2, int var3, int var4, int var5) { +- int var6 = var3 << 4 | var1; +- if(var2 >= this.precipitationHeightMap[var6] - 1) { ++ public int getBlockLightOpacity(int par1, int par2, int par3) { ++ return Block.lightOpacity[this.getBlockID(par1, par2, par3)]; ++ } ++ ++ /** ++ * Return the ID of a block in the chunk. ++ */ ++ public int getBlockID(int par1, int par2, int par3) { ++ if (par2 >> 4 >= this.storageArrays.length) { ++ return 0; ++ } else { ++ ExtendedBlockStorage var4 = this.storageArrays[par2 >> 4]; ++ return var4 != null ? var4.getExtBlockID(par1, par2 & 15, par3) : 0; ++ } ++ } ++ ++ /** ++ * Return the metadata corresponding to the given coordinates inside a chunk. ++ */ ++ public int getBlockMetadata(int par1, int par2, int par3) { ++ if (par2 >> 4 >= this.storageArrays.length) { ++ return 0; ++ } else { ++ ExtendedBlockStorage var4 = this.storageArrays[par2 >> 4]; ++ return var4 != null ? var4.getExtBlockMetadata(par1, par2 & 15, par3) : 0; ++ } ++ } ++ ++ /** ++ * Sets a blockID of a position within a chunk with metadata. Args: x, y, z, blockID, metadata ++ */ ++ public boolean setBlockIDWithMetadata(int par1, int par2, int par3, int par4, int par5) { ++ int var6 = par3 << 4 | par1; ++ ++ if (par2 >= this.precipitationHeightMap[var6] - 1) { + this.precipitationHeightMap[var6] = -999; + } + + int var7 = this.heightMap[var6]; +- int var8 = this.getBlockID(var1, var2, var3); +- int var9 = this.getBlockMetadata(var1, var2, var3); +- if(var8 == var4 && var9 == var5) { ++ int var8 = this.getBlockID(par1, par2, par3); ++ int var9 = this.getBlockMetadata(par1, par2, par3); ++ ++ if (var8 == par4 && var9 == par5) { + return false; + } else { +- ExtendedBlockStorage var10 = this.storageArrays[var2 >> 4]; ++ ExtendedBlockStorage var10 = this.storageArrays[par2 >> 4]; + boolean var11 = false; +- if(var10 == null) { +- if(var4 == 0) { ++ ++ if (var10 == null) { ++ if (par4 == 0) { + return false; + } + +- var10 = this.storageArrays[var2 >> 4] = new ExtendedBlockStorage(var2 >> 4 << 4, !this.worldObj.provider.hasNoSky); +- var11 = var2 >= var7; +- } +- +- int var12 = this.xPosition * 16 + var1; +- int var13 = this.zPosition * 16 + var3; +- if(var8 != 0 && !this.worldObj.isRemote) { +- Block.blocksList[var8].onBlockPreDestroy(this.worldObj, var12, var2, var13, var9); +- } +- +- var10.setExtBlockID(var1, var2 & 15, var3, var4); +- if(var8 != 0) { +- if(!this.worldObj.isRemote) { +- Block.blocksList[var8].breakBlock(this.worldObj, var12, var2, var13, var8, var9); +- } else if(Block.blocksList[var8] instanceof ITileEntityProvider && var8 != var4) { +- this.worldObj.removeBlockTileEntity(var12, var2, var13); ++ var10 = this.storageArrays[par2 >> 4] = new ExtendedBlockStorage(par2 >> 4 << 4, !this.worldObj.provider.hasNoSky); ++ var11 = par2 >= var7; ++ } ++ ++ int var12 = this.xPosition * 16 + par1; ++ int var13 = this.zPosition * 16 + par3; ++ ++ if (var8 != 0 && !this.worldObj.isRemote) { ++ Block.blocksList[var8].onBlockPreDestroy(this.worldObj, var12, par2, var13, var9); ++ } ++ ++ var10.setExtBlockID(par1, par2 & 15, par3, par4); ++ ++ if (var8 != 0) { ++ if (!this.worldObj.isRemote) { ++ Block.blocksList[var8].breakBlock(this.worldObj, var12, par2, var13, var8, var9); ++ } else if (Block.blocksList[var8] instanceof ITileEntityProvider && var8 != par4) { ++ this.worldObj.removeBlockTileEntity(var12, par2, var13); + } + } + +- if(var10.getExtBlockID(var1, var2 & 15, var3) != var4) { ++ if (var10.getExtBlockID(par1, par2 & 15, par3) != par4) { + return false; + } else { +- var10.setExtBlockMetadata(var1, var2 & 15, var3, var5); +- if(var11) { ++ var10.setExtBlockMetadata(par1, par2 & 15, par3, par5); ++ ++ if (var11) { + this.generateSkylightMap(); + } else { +- if(Block.lightOpacity[var4 & 4095] > 0) { +- if(var2 >= var7) { +- this.relightBlock(var1, var2 + 1, var3); ++ if (Block.lightOpacity[par4 & 4095] > 0) { ++ if (par2 >= var7) { ++ this.relightBlock(par1, par2 + 1, par3); + } +- } else if(var2 == var7 - 1) { +- this.relightBlock(var1, var2, var3); ++ } else if (par2 == var7 - 1) { ++ this.relightBlock(par1, par2, par3); + } + +- this.propagateSkylightOcclusion(var1, var3); ++ this.propagateSkylightOcclusion(par1, par3); + } + + TileEntity var14; +- if(var4 != 0) { +- if(!this.worldObj.isRemote) { +- Block.blocksList[var4].onBlockAdded(this.worldObj, var12, var2, var13); ++ ++ if (par4 != 0) { ++ if (!this.worldObj.isRemote) { ++ Block.blocksList[par4].onBlockAdded(this.worldObj, var12, par2, var13); + } + +- if(Block.blocksList[var4] instanceof ITileEntityProvider) { +- var14 = this.getChunkBlockTileEntity(var1, var2, var3); +- if(var14 == null) { +- var14 = ((ITileEntityProvider)Block.blocksList[var4]).createNewTileEntity(this.worldObj); +- this.worldObj.setBlockTileEntity(var12, var2, var13, var14); ++ if (Block.blocksList[par4] instanceof ITileEntityProvider) { ++ var14 = this.getChunkBlockTileEntity(par1, par2, par3); ++ ++ if (var14 == null) { ++ var14 = ((ITileEntityProvider)Block.blocksList[par4]).createNewTileEntity(this.worldObj); ++ this.worldObj.setBlockTileEntity(var12, par2, var13, var14); + } + +- if(var14 != null) { ++ if (var14 != null) { + var14.updateContainingBlockInfo(); + } + } +- } else if(var8 > 0 && Block.blocksList[var8] instanceof ITileEntityProvider) { +- var14 = this.getChunkBlockTileEntity(var1, var2, var3); +- if(var14 != null) { ++ } else if (var8 > 0 && Block.blocksList[var8] instanceof ITileEntityProvider) { ++ var14 = this.getChunkBlockTileEntity(par1, par2, par3); ++ ++ if (var14 != null) { + var14.updateContainingBlockInfo(); + } + } +@@ -425,23 +575,30 @@ + } + } + +- public boolean setBlockMetadata(int var1, int var2, int var3, int var4) { +- ExtendedBlockStorage var5 = this.storageArrays[var2 >> 4]; +- if(var5 == null) { ++ /** ++ * Set the metadata of a block in the chunk ++ */ ++ public boolean setBlockMetadata(int par1, int par2, int par3, int par4) { ++ ExtendedBlockStorage var5 = this.storageArrays[par2 >> 4]; ++ ++ if (var5 == null) { + return false; + } else { +- int var6 = var5.getExtBlockMetadata(var1, var2 & 15, var3); +- if(var6 == var4) { ++ int var6 = var5.getExtBlockMetadata(par1, par2 & 15, par3); ++ ++ if (var6 == par4) { + return false; + } else { + this.isModified = true; +- var5.setExtBlockMetadata(var1, var2 & 15, var3, var4); +- int var7 = var5.getExtBlockID(var1, var2 & 15, var3); +- if(var7 > 0 && Block.blocksList[var7] instanceof ITileEntityProvider) { +- TileEntity var8 = this.getChunkBlockTileEntity(var1, var2, var3); +- if(var8 != null) { ++ var5.setExtBlockMetadata(par1, par2 & 15, par3, par4); ++ int var7 = var5.getExtBlockID(par1, par2 & 15, par3); ++ ++ if (var7 > 0 && Block.blocksList[var7] instanceof ITileEntityProvider) { ++ TileEntity var8 = this.getChunkBlockTileEntity(par1, par2, par3); ++ ++ if (var8 != null) { + var8.updateContainingBlockInfo(); +- var8.blockMetadata = var4; ++ var8.blockMetadata = par4; + } + } + +@@ -450,42 +607,56 @@ + } + } + +- public int getSavedLightValue(EnumSkyBlock var1, int var2, int var3, int var4) { +- ExtendedBlockStorage var5 = this.storageArrays[var3 >> 4]; +- return var5 == null ? (this.canBlockSeeTheSky(var2, var3, var4) ? var1.defaultLightValue : 0) : (var1 == EnumSkyBlock.Sky ? (this.worldObj.provider.hasNoSky ? 0 : var5.getExtSkylightValue(var2, var3 & 15, var4)) : (var1 == EnumSkyBlock.Block ? var5.getExtBlocklightValue(var2, var3 & 15, var4) : var1.defaultLightValue)); ++ /** ++ * Gets the amount of light saved in this block (doesn't adjust for daylight) ++ */ ++ public int getSavedLightValue(EnumSkyBlock par1EnumSkyBlock, int par2, int par3, int par4) { ++ ExtendedBlockStorage var5 = this.storageArrays[par3 >> 4]; ++ return var5 == null ? (this.canBlockSeeTheSky(par2, par3, par4) ? par1EnumSkyBlock.defaultLightValue : 0) : (par1EnumSkyBlock == EnumSkyBlock.Sky ? (this.worldObj.provider.hasNoSky ? 0 : var5.getExtSkylightValue(par2, par3 & 15, par4)) : (par1EnumSkyBlock == EnumSkyBlock.Block ? var5.getExtBlocklightValue(par2, par3 & 15, par4) : par1EnumSkyBlock.defaultLightValue)); + } + +- public void setLightValue(EnumSkyBlock var1, int var2, int var3, int var4, int var5) { +- ExtendedBlockStorage var6 = this.storageArrays[var3 >> 4]; +- if(var6 == null) { +- var6 = this.storageArrays[var3 >> 4] = new ExtendedBlockStorage(var3 >> 4 << 4, !this.worldObj.provider.hasNoSky); ++ /** ++ * Sets the light value at the coordinate. If enumskyblock is set to sky it sets it in the skylightmap and if its a ++ * block then into the blocklightmap. Args enumSkyBlock, x, y, z, lightValue ++ */ ++ public void setLightValue(EnumSkyBlock par1EnumSkyBlock, int par2, int par3, int par4, int par5) { ++ ExtendedBlockStorage var6 = this.storageArrays[par3 >> 4]; ++ ++ if (var6 == null) { ++ var6 = this.storageArrays[par3 >> 4] = new ExtendedBlockStorage(par3 >> 4 << 4, !this.worldObj.provider.hasNoSky); + this.generateSkylightMap(); + } + + this.isModified = true; +- if(var1 == EnumSkyBlock.Sky) { +- if(!this.worldObj.provider.hasNoSky) { +- var6.setExtSkylightValue(var2, var3 & 15, var4, var5); ++ ++ if (par1EnumSkyBlock == EnumSkyBlock.Sky) { ++ if (!this.worldObj.provider.hasNoSky) { ++ var6.setExtSkylightValue(par2, par3 & 15, par4, par5); + } +- } else if(var1 == EnumSkyBlock.Block) { +- var6.setExtBlocklightValue(var2, var3 & 15, var4, var5); ++ } else if (par1EnumSkyBlock == EnumSkyBlock.Block) { ++ var6.setExtBlocklightValue(par2, par3 & 15, par4, par5); + } +- + } + +- public int getBlockLightValue(int var1, int var2, int var3, int var4) { +- ExtendedBlockStorage var5 = this.storageArrays[var2 >> 4]; +- if(var5 == null) { +- return !this.worldObj.provider.hasNoSky && var4 < EnumSkyBlock.Sky.defaultLightValue ? EnumSkyBlock.Sky.defaultLightValue - var4 : 0; ++ /** ++ * Gets the amount of light on a block taking into account sunlight ++ */ ++ public int getBlockLightValue(int par1, int par2, int par3, int par4) { ++ ExtendedBlockStorage var5 = this.storageArrays[par2 >> 4]; ++ ++ if (var5 == null) { ++ return !this.worldObj.provider.hasNoSky && par4 < EnumSkyBlock.Sky.defaultLightValue ? EnumSkyBlock.Sky.defaultLightValue - par4 : 0; + } else { +- int var6 = this.worldObj.provider.hasNoSky ? 0 : var5.getExtSkylightValue(var1, var2 & 15, var3); +- if(var6 > 0) { ++ int var6 = this.worldObj.provider.hasNoSky ? 0 : var5.getExtSkylightValue(par1, par2 & 15, par3); ++ ++ if (var6 > 0) { + isLit = true; + } + +- var6 -= var4; +- int var7 = var5.getExtBlocklightValue(var1, var2 & 15, var3); +- if(var7 > var6) { ++ var6 -= par4; ++ int var7 = var5.getExtBlocklightValue(par1, par2 & 15, par3); ++ ++ if (var7 > var6) { + var6 = var7; + } + +@@ -493,301 +664,370 @@ + } + } + +- public void addEntity(Entity var1) { ++ /** ++ * Adds an entity to the chunk. Args: entity ++ */ ++ public void addEntity(Entity par1Entity) { + this.hasEntities = true; +- int var2 = MathHelper.floor_double(var1.posX / 16.0D); +- int var3 = MathHelper.floor_double(var1.posZ / 16.0D); +- if(var2 != this.xPosition || var3 != this.zPosition) { +- this.worldObj.getWorldLogAgent().logSevere("Wrong location! " + var1); ++ int var2 = MathHelper.floor_double(par1Entity.posX / 16.0D); ++ int var3 = MathHelper.floor_double(par1Entity.posZ / 16.0D); ++ ++ if (var2 != this.xPosition || var3 != this.zPosition) { ++ this.worldObj.getWorldLogAgent().logSevere("Wrong location! " + par1Entity); + Thread.dumpStack(); + } + +- int var4 = MathHelper.floor_double(var1.posY / 16.0D); +- if(var4 < 0) { ++ int var4 = MathHelper.floor_double(par1Entity.posY / 16.0D); ++ ++ if (var4 < 0) { + var4 = 0; + } + +- if(var4 >= this.j.length) { +- var4 = this.j.length - 1; +- } +- +- var1.addedToChunk = true; +- var1.chunkCoordX = this.xPosition; +- var1.chunkCoordY = var4; +- var1.chunkCoordZ = this.zPosition; +- this.j[var4].add(var1); +- } +- +- public void removeEntity(Entity var1) { +- this.removeEntityAtIndex(var1, var1.chunkCoordY); +- } +- +- public void removeEntityAtIndex(Entity var1, int var2) { +- if(var2 < 0) { +- var2 = 0; +- } +- +- if(var2 >= this.j.length) { +- var2 = this.j.length - 1; +- } +- +- this.j[var2].remove(var1); +- } +- +- public boolean canBlockSeeTheSky(int var1, int var2, int var3) { +- return var2 >= this.heightMap[var3 << 4 | var1]; +- } +- +- public TileEntity getChunkBlockTileEntity(int var1, int var2, int var3) { +- ChunkPosition var4 = new ChunkPosition(var1, var2, var3); +- TileEntity var5 = (TileEntity)this.i.get(var4); +- if(var5 == null) { +- int var6 = this.getBlockID(var1, var2, var3); +- if(var6 <= 0 || !Block.blocksList[var6].hasTileEntity()) { ++ if (var4 >= this.entityLists.length) { ++ var4 = this.entityLists.length - 1; ++ } ++ ++ par1Entity.addedToChunk = true; ++ par1Entity.chunkCoordX = this.xPosition; ++ par1Entity.chunkCoordY = var4; ++ par1Entity.chunkCoordZ = this.zPosition; ++ this.entityLists[var4].add(par1Entity); ++ } ++ ++ /** ++ * removes entity using its y chunk coordinate as its index ++ */ ++ public void removeEntity(Entity par1Entity) { ++ this.removeEntityAtIndex(par1Entity, par1Entity.chunkCoordY); ++ } ++ ++ /** ++ * Removes entity at the specified index from the entity array. ++ */ ++ public void removeEntityAtIndex(Entity par1Entity, int par2) { ++ if (par2 < 0) { ++ par2 = 0; ++ } ++ ++ if (par2 >= this.entityLists.length) { ++ par2 = this.entityLists.length - 1; ++ } ++ ++ this.entityLists[par2].remove(par1Entity); ++ } ++ ++ /** ++ * Returns whether is not a block above this one blocking sight to the sky (done via checking against the heightmap) ++ */ ++ public boolean canBlockSeeTheSky(int par1, int par2, int par3) { ++ return par2 >= this.heightMap[par3 << 4 | par1]; ++ } ++ ++ /** ++ * Gets the TileEntity for a given block in this chunk ++ */ ++ public TileEntity getChunkBlockTileEntity(int par1, int par2, int par3) { ++ ChunkPosition var4 = new ChunkPosition(par1, par2, par3); ++ TileEntity var5 = (TileEntity)this.chunkTileEntityMap.get(var4); ++ ++ if (var5 == null) { ++ int var6 = this.getBlockID(par1, par2, par3); ++ ++ if (var6 <= 0 || !Block.blocksList[var6].hasTileEntity()) { + return null; + } + +- if(var5 == null) { ++ if (var5 == null) { + var5 = ((ITileEntityProvider)Block.blocksList[var6]).createNewTileEntity(this.worldObj); +- this.worldObj.setBlockTileEntity(this.xPosition * 16 + var1, var2, this.zPosition * 16 + var3, var5); ++ this.worldObj.setBlockTileEntity(this.xPosition * 16 + par1, par2, this.zPosition * 16 + par3, var5); + } + +- var5 = (TileEntity)this.i.get(var4); ++ var5 = (TileEntity)this.chunkTileEntityMap.get(var4); + } + +- if(var5 != null && var5.isInvalid()) { +- this.i.remove(var4); ++ if (var5 != null && var5.isInvalid()) { ++ this.chunkTileEntityMap.remove(var4); + return null; + } else { + return var5; + } + } + +- public void addTileEntity(TileEntity var1) { +- int var2 = var1.xCoord - this.xPosition * 16; +- int var3 = var1.yCoord; +- int var4 = var1.zCoord - this.zPosition * 16; +- this.setChunkBlockTileEntity(var2, var3, var4, var1); +- if(this.isChunkLoaded) { +- this.worldObj.g.add(var1); ++ /** ++ * Adds a TileEntity to a chunk ++ */ ++ public void addTileEntity(TileEntity par1TileEntity) { ++ int var2 = par1TileEntity.xCoord - this.xPosition * 16; ++ int var3 = par1TileEntity.yCoord; ++ int var4 = par1TileEntity.zCoord - this.zPosition * 16; ++ this.setChunkBlockTileEntity(var2, var3, var4, par1TileEntity); ++ ++ if (this.isChunkLoaded) { ++ this.worldObj.loadedTileEntityList.add(par1TileEntity); + } +- + } + +- public void setChunkBlockTileEntity(int var1, int var2, int var3, TileEntity var4) { +- ChunkPosition var5 = new ChunkPosition(var1, var2, var3); +- var4.setWorldObj(this.worldObj); +- var4.xCoord = this.xPosition * 16 + var1; +- var4.yCoord = var2; +- var4.zCoord = this.zPosition * 16 + var3; +- if(this.getBlockID(var1, var2, var3) != 0 && Block.blocksList[this.getBlockID(var1, var2, var3)] instanceof ITileEntityProvider) { +- if(this.i.containsKey(var5)) { +- ((TileEntity)this.i.get(var5)).invalidate(); ++ /** ++ * Sets the TileEntity for a given block in this chunk ++ */ ++ public void setChunkBlockTileEntity(int par1, int par2, int par3, TileEntity par4TileEntity) { ++ ChunkPosition var5 = new ChunkPosition(par1, par2, par3); ++ par4TileEntity.setWorldObj(this.worldObj); ++ par4TileEntity.xCoord = this.xPosition * 16 + par1; ++ par4TileEntity.yCoord = par2; ++ par4TileEntity.zCoord = this.zPosition * 16 + par3; ++ ++ if (this.getBlockID(par1, par2, par3) != 0 && Block.blocksList[this.getBlockID(par1, par2, par3)] instanceof ITileEntityProvider) { ++ if (this.chunkTileEntityMap.containsKey(var5)) { ++ ((TileEntity)this.chunkTileEntityMap.get(var5)).invalidate(); + } + +- var4.validate(); +- this.i.put(var5, var4); ++ par4TileEntity.validate(); ++ this.chunkTileEntityMap.put(var5, par4TileEntity); + } + } + +- public void removeChunkBlockTileEntity(int var1, int var2, int var3) { +- ChunkPosition var4 = new ChunkPosition(var1, var2, var3); +- if(this.isChunkLoaded) { +- TileEntity var5 = (TileEntity)this.i.remove(var4); +- if(var5 != null) { ++ /** ++ * Removes the TileEntity for a given block in this chunk ++ */ ++ public void removeChunkBlockTileEntity(int par1, int par2, int par3) { ++ ChunkPosition var4 = new ChunkPosition(par1, par2, par3); ++ ++ if (this.isChunkLoaded) { ++ TileEntity var5 = (TileEntity)this.chunkTileEntityMap.remove(var4); ++ ++ if (var5 != null) { + var5.invalidate(); + } + } +- + } + ++ /** ++ * Called when this Chunk is loaded by the ChunkProvider ++ */ + public void onChunkLoad() { + this.isChunkLoaded = true; +- this.worldObj.addTileEntity(this.i.values()); +- +- for(int var1 = 0; var1 < this.j.length; ++var1) { +- Iterator var2 = this.j[var1].iterator(); +- +- while(var2.hasNext()) { ++ this.worldObj.addTileEntity(this.chunkTileEntityMap.values()); ++ ++ for (int var1 = 0; var1 < this.entityLists.length; ++var1) { ++ Iterator var2 = this.entityLists[var1].iterator(); ++ ++ while (var2.hasNext()) { + Entity var3 = (Entity)var2.next(); + var3.onChunkLoad(); + } +- +- this.worldObj.addLoadedEntities(this.j[var1]); ++ this.worldObj.addLoadedEntities(this.entityLists[var1]); + } + ++ // Spout Start - onChunkLoad is only called in SP ++ SpoutcraftChunk.loadedChunks.add(spoutChunk); ++ // Spout End + } + ++ /** ++ * Called when this Chunk is unloaded by the ChunkProvider ++ */ + public void onChunkUnload() { + this.isChunkLoaded = false; +- Iterator var1 = this.i.values().iterator(); ++ Iterator var1 = this.chunkTileEntityMap.values().iterator(); + +- while(var1.hasNext()) { ++ while (var1.hasNext()) { + TileEntity var2 = (TileEntity)var1.next(); + this.worldObj.markTileEntityForDespawn(var2); + } + +- for(int var3 = 0; var3 < this.j.length; ++var3) { +- this.worldObj.unloadEntities(this.j[var3]); ++ for (int var3 = 0; var3 < this.entityLists.length; ++var3) { ++ this.worldObj.unloadEntities(this.entityLists[var3]); + } + ++ // Spout Start ++ SpoutcraftChunk.loadedChunks.remove(spoutChunk); ++ // Spout End + } + ++ /** ++ * Sets the isModified flag for this Chunk ++ */ + public void setChunkModified() { + this.isModified = true; + } + +- public void getEntitiesWithinAABBForEntity(Entity var1, AxisAlignedBB var2, List var3, IEntitySelector var4) { +- int var5 = MathHelper.floor_double((var2.minY - 2.0D) / 16.0D); +- int var6 = MathHelper.floor_double((var2.maxY + 2.0D) / 16.0D); +- if(var5 < 0) { ++ /** ++ * Fills the given list of all entities that intersect within the given bounding box that aren't the passed entity ++ * Args: entity, aabb, listToFill ++ */ ++ public void getEntitiesWithinAABBForEntity(Entity par1Entity, AxisAlignedBB par2AxisAlignedBB, List par3List, IEntitySelector par4IEntitySelector) { ++ int var5 = MathHelper.floor_double((par2AxisAlignedBB.minY - 2.0D) / 16.0D); ++ int var6 = MathHelper.floor_double((par2AxisAlignedBB.maxY + 2.0D) / 16.0D); ++ ++ if (var5 < 0) { + var5 = 0; + var6 = Math.max(var5, var6); + } + +- if(var6 >= this.j.length) { +- var6 = this.j.length - 1; ++ if (var6 >= this.entityLists.length) { ++ var6 = this.entityLists.length - 1; + var5 = Math.min(var5, var6); + } + +- for(int var7 = var5; var7 <= var6; ++var7) { +- List var8 = this.j[var7]; ++ for (int var7 = var5; var7 <= var6; ++var7) { ++ List var8 = this.entityLists[var7]; + +- for(int var9 = 0; var9 < var8.size(); ++var9) { ++ for (int var9 = 0; var9 < var8.size(); ++var9) { + Entity var10 = (Entity)var8.get(var9); +- if(var10 != var1 && var10.boundingBox.intersectsWith(var2) && (var4 == null || var4.isEntityApplicable(var10))) { +- var3.add(var10); ++ ++ if (var10 != par1Entity && var10.boundingBox.intersectsWith(par2AxisAlignedBB) && (par4IEntitySelector == null || par4IEntitySelector.isEntityApplicable(var10))) { ++ par3List.add(var10); + Entity[] var11 = var10.getParts(); +- if(var11 != null) { +- for(int var12 = 0; var12 < var11.length; ++var12) { ++ ++ if (var11 != null) { ++ for (int var12 = 0; var12 < var11.length; ++var12) { + var10 = var11[var12]; +- if(var10 != var1 && var10.boundingBox.intersectsWith(var2) && (var4 == null || var4.isEntityApplicable(var10))) { +- var3.add(var10); ++ ++ if (var10 != par1Entity && var10.boundingBox.intersectsWith(par2AxisAlignedBB) && (par4IEntitySelector == null || par4IEntitySelector.isEntityApplicable(var10))) { ++ par3List.add(var10); + } + } + } + } + } + } +- + } + +- public void getEntitiesOfTypeWithinAAAB(Class var1, AxisAlignedBB var2, List var3, IEntitySelector var4) { +- int var5 = MathHelper.floor_double((var2.minY - 2.0D) / 16.0D); +- int var6 = MathHelper.floor_double((var2.maxY + 2.0D) / 16.0D); +- if(var5 < 0) { ++ /** ++ * Gets all entities that can be assigned to the specified class. Args: entityClass, aabb, listToFill ++ */ ++ public void getEntitiesOfTypeWithinAAAB(Class par1Class, AxisAlignedBB par2AxisAlignedBB, List par3List, IEntitySelector par4IEntitySelector) { ++ int var5 = MathHelper.floor_double((par2AxisAlignedBB.minY - 2.0D) / 16.0D); ++ int var6 = MathHelper.floor_double((par2AxisAlignedBB.maxY + 2.0D) / 16.0D); ++ ++ if (var5 < 0) { + var5 = 0; +- } else if(var5 >= this.j.length) { +- var5 = this.j.length - 1; ++ } else if (var5 >= this.entityLists.length) { ++ var5 = this.entityLists.length - 1; + } + +- if(var6 >= this.j.length) { +- var6 = this.j.length - 1; +- } else if(var6 < 0) { ++ if (var6 >= this.entityLists.length) { ++ var6 = this.entityLists.length - 1; ++ } else if (var6 < 0) { + var6 = 0; + } + +- for(int var7 = var5; var7 <= var6; ++var7) { +- List var8 = this.j[var7]; ++ for (int var7 = var5; var7 <= var6; ++var7) { ++ List var8 = this.entityLists[var7]; + +- for(int var9 = 0; var9 < var8.size(); ++var9) { ++ for (int var9 = 0; var9 < var8.size(); ++var9) { + Entity var10 = (Entity)var8.get(var9); +- if(var1.isAssignableFrom(var10.getClass()) && var10.boundingBox.intersectsWith(var2) && (var4 == null || var4.isEntityApplicable(var10))) { +- var3.add(var10); ++ ++ if (par1Class.isAssignableFrom(var10.getClass()) && var10.boundingBox.intersectsWith(par2AxisAlignedBB) && (par4IEntitySelector == null || par4IEntitySelector.isEntityApplicable(var10))) { ++ par3List.add(var10); + } + } + } +- + } + +- public boolean needsSaving(boolean var1) { +- if(var1) { +- if(this.hasEntities && this.worldObj.getTotalWorldTime() != this.lastSaveTime || this.isModified) { ++ /** ++ * Returns true if this Chunk needs to be saved ++ */ ++ public boolean needsSaving(boolean par1) { ++ if (par1) { ++ if (this.hasEntities && this.worldObj.getTotalWorldTime() != this.lastSaveTime || this.isModified) { + return true; + } +- } else if(this.hasEntities && this.worldObj.getTotalWorldTime() >= this.lastSaveTime + 600L) { ++ } else if (this.hasEntities && this.worldObj.getTotalWorldTime() >= this.lastSaveTime + 600L) { + return true; + } + + return this.isModified; + } + +- public Random getRandomWithSeed(long var1) { +- 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) ^ var1); ++ public Random getRandomWithSeed(long par1) { ++ 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) ^ par1); + } + + public boolean isEmpty() { + return false; + } + +- public void populateChunk(IChunkProvider var1, IChunkProvider var2, int var3, int var4) { +- if(!this.isTerrainPopulated && var1.chunkExists(var3 + 1, var4 + 1) && var1.chunkExists(var3, var4 + 1) && var1.chunkExists(var3 + 1, var4)) { +- var1.populate(var2, var3, var4); +- } +- +- if(var1.chunkExists(var3 - 1, var4) && !var1.provideChunk(var3 - 1, var4).isTerrainPopulated && var1.chunkExists(var3 - 1, var4 + 1) && var1.chunkExists(var3, var4 + 1) && var1.chunkExists(var3 - 1, var4 + 1)) { +- var1.populate(var2, var3 - 1, var4); +- } +- +- if(var1.chunkExists(var3, var4 - 1) && !var1.provideChunk(var3, var4 - 1).isTerrainPopulated && var1.chunkExists(var3 + 1, var4 - 1) && var1.chunkExists(var3 + 1, var4 - 1) && var1.chunkExists(var3 + 1, var4)) { +- var1.populate(var2, var3, var4 - 1); +- } +- +- if(var1.chunkExists(var3 - 1, var4 - 1) && !var1.provideChunk(var3 - 1, var4 - 1).isTerrainPopulated && var1.chunkExists(var3, var4 - 1) && var1.chunkExists(var3 - 1, var4)) { +- var1.populate(var2, var3 - 1, var4 - 1); +- } +- ++ public void populateChunk(IChunkProvider par1IChunkProvider, IChunkProvider par2IChunkProvider, int par3, int par4) { ++ if (!this.isTerrainPopulated && par1IChunkProvider.chunkExists(par3 + 1, par4 + 1) && par1IChunkProvider.chunkExists(par3, par4 + 1) && par1IChunkProvider.chunkExists(par3 + 1, par4)) { ++ par1IChunkProvider.populate(par2IChunkProvider, par3, par4); ++ } ++ ++ if (par1IChunkProvider.chunkExists(par3 - 1, par4) && !par1IChunkProvider.provideChunk(par3 - 1, par4).isTerrainPopulated && par1IChunkProvider.chunkExists(par3 - 1, par4 + 1) && par1IChunkProvider.chunkExists(par3, par4 + 1) && par1IChunkProvider.chunkExists(par3 - 1, par4 + 1)) { ++ par1IChunkProvider.populate(par2IChunkProvider, par3 - 1, par4); ++ } ++ ++ if (par1IChunkProvider.chunkExists(par3, par4 - 1) && !par1IChunkProvider.provideChunk(par3, par4 - 1).isTerrainPopulated && par1IChunkProvider.chunkExists(par3 + 1, par4 - 1) && par1IChunkProvider.chunkExists(par3 + 1, par4 - 1) && par1IChunkProvider.chunkExists(par3 + 1, par4)) { ++ par1IChunkProvider.populate(par2IChunkProvider, par3, par4 - 1); ++ } ++ ++ if (par1IChunkProvider.chunkExists(par3 - 1, par4 - 1) && !par1IChunkProvider.provideChunk(par3 - 1, par4 - 1).isTerrainPopulated && par1IChunkProvider.chunkExists(par3, par4 - 1) && par1IChunkProvider.chunkExists(par3 - 1, par4)) { ++ par1IChunkProvider.populate(par2IChunkProvider, par3 - 1, par4 - 1); ++ } + } + +- public int getPrecipitationHeight(int var1, int var2) { +- int var3 = var1 | var2 << 4; ++ /** ++ * Gets the height to which rain/snow will fall. Calculates it if not already stored. ++ */ ++ public int getPrecipitationHeight(int par1, int par2) { ++ int var3 = par1 | par2 << 4; + int var4 = this.precipitationHeightMap[var3]; +- if(var4 == -999) { ++ ++ if (var4 == -999) { + int var5 = this.getTopFilledSegment() + 15; + var4 = -1; + +- while(true) { +- while(var5 > 0 && var4 == -1) { +- int var6 = this.getBlockID(var1, var5, var2); +- Material var7 = var6 == 0 ? Material.air : Block.blocksList[var6].blockMaterial; +- if(!var7.blocksMovement() && !var7.isLiquid()) { +- --var5; +- } else { +- var4 = var5 + 1; +- } ++ while (var5 > 0 && var4 == -1) { ++ int var6 = this.getBlockID(par1, var5, par2); ++ Material var7 = var6 == 0 ? Material.air : Block.blocksList[var6].blockMaterial; ++ ++ if (!var7.blocksMovement() && !var7.isLiquid()) { ++ --var5; ++ } else { ++ var4 = var5 + 1; + } +- +- this.precipitationHeightMap[var3] = var4; +- break; + } ++ ++ this.precipitationHeightMap[var3] = var4; + } + + return var4; + } + ++ /** ++ * Checks whether skylight needs updated; if it does, calls updateSkylight_do ++ */ + public void updateSkylight() { +- if(this.isGapLightingUpdated && !this.worldObj.provider.hasNoSky) { ++ if (this.isGapLightingUpdated && !this.worldObj.provider.hasNoSky) { + this.updateSkylight_do(); + } +- + } + ++ /** ++ * Gets a ChunkCoordIntPair representing the Chunk's position. ++ */ + public ChunkCoordIntPair getChunkCoordIntPair() { + return new ChunkCoordIntPair(this.xPosition, this.zPosition); + } + +- public boolean getAreLevelsEmpty(int var1, int var2) { +- if(var1 < 0) { +- var1 = 0; +- } +- +- if(var2 >= 256) { +- var2 = 255; +- } +- +- for(int var3 = var1; var3 <= var2; var3 += 16) { ++ /** ++ * Returns whether the ExtendedBlockStorages containing levels (in blocks) from arg 1 to arg 2 are fully empty (true) ++ * or not (false). ++ */ ++ public boolean getAreLevelsEmpty(int par1, int par2) { ++ if (par1 < 0) { ++ par1 = 0; ++ } ++ ++ if (par2 >= 256) { ++ par2 = 255; ++ } ++ ++ for (int var3 = par1; var3 <= par2; var3 += 16) { + ExtendedBlockStorage var4 = this.storageArrays[var3 >> 4]; +- if(var4 != null && !var4.isEmpty()) { ++ ++ if (var4 != null && !var4.isEmpty()) { + return false; + } + } +@@ -795,121 +1035,145 @@ + return true; + } + +- public void setStorageArrays(ExtendedBlockStorage[] var1) { +- this.storageArrays = var1; ++ public void setStorageArrays(ExtendedBlockStorage[] par1ArrayOfExtendedBlockStorage) { ++ this.storageArrays = par1ArrayOfExtendedBlockStorage; + } + +- public void fillChunk(byte[] var1, int var2, int var3, boolean var4) { ++ /** ++ * Initialise this chunk with new binary data ++ */ ++ public void fillChunk(byte[] par1ArrayOfByte, int par2, int par3, boolean par4) { + int var5 = 0; + boolean var6 = !this.worldObj.provider.hasNoSky; +- + int var7; +- for(var7 = 0; var7 < this.storageArrays.length; ++var7) { +- if((var2 & 1 << var7) != 0) { +- if(this.storageArrays[var7] == null) { ++ ++ for (var7 = 0; var7 < this.storageArrays.length; ++var7) { ++ if ((par2 & 1 << var7) != 0) { ++ if (this.storageArrays[var7] == null) { + this.storageArrays[var7] = new ExtendedBlockStorage(var7 << 4, var6); + } + + byte[] var8 = this.storageArrays[var7].getBlockLSBArray(); +- System.arraycopy(var1, var5, var8, 0, var8.length); ++ System.arraycopy(par1ArrayOfByte, var5, var8, 0, var8.length); + var5 += var8.length; +- } else if(var4 && this.storageArrays[var7] != null) { ++ } else if (par4 && this.storageArrays[var7] != null) { + this.storageArrays[var7] = null; + } + } + + NibbleArray var9; +- for(var7 = 0; var7 < this.storageArrays.length; ++var7) { +- if((var2 & 1 << var7) != 0 && this.storageArrays[var7] != null) { ++ ++ for (var7 = 0; var7 < this.storageArrays.length; ++var7) { ++ if ((par2 & 1 << var7) != 0 && this.storageArrays[var7] != null) { + var9 = this.storageArrays[var7].getMetadataArray(); +- System.arraycopy(var1, var5, var9.data, 0, var9.data.length); ++ System.arraycopy(par1ArrayOfByte, var5, var9.data, 0, var9.data.length); + var5 += var9.data.length; + } + } + +- for(var7 = 0; var7 < this.storageArrays.length; ++var7) { +- if((var2 & 1 << var7) != 0 && this.storageArrays[var7] != null) { ++ for (var7 = 0; var7 < this.storageArrays.length; ++var7) { ++ if ((par2 & 1 << var7) != 0 && this.storageArrays[var7] != null) { + var9 = this.storageArrays[var7].getBlocklightArray(); +- System.arraycopy(var1, var5, var9.data, 0, var9.data.length); ++ System.arraycopy(par1ArrayOfByte, var5, var9.data, 0, var9.data.length); + var5 += var9.data.length; + } + } + +- if(var6) { +- for(var7 = 0; var7 < this.storageArrays.length; ++var7) { +- if((var2 & 1 << var7) != 0 && this.storageArrays[var7] != null) { ++ if (var6) { ++ for (var7 = 0; var7 < this.storageArrays.length; ++var7) { ++ if ((par2 & 1 << var7) != 0 && this.storageArrays[var7] != null) { + var9 = this.storageArrays[var7].getSkylightArray(); +- System.arraycopy(var1, var5, var9.data, 0, var9.data.length); ++ System.arraycopy(par1ArrayOfByte, var5, var9.data, 0, var9.data.length); + var5 += var9.data.length; + } + } + } + +- for(var7 = 0; var7 < this.storageArrays.length; ++var7) { +- if((var3 & 1 << var7) != 0) { +- if(this.storageArrays[var7] == null) { ++ for (var7 = 0; var7 < this.storageArrays.length; ++var7) { ++ if ((par3 & 1 << var7) != 0) { ++ if (this.storageArrays[var7] == null) { + var5 += 2048; + } else { + var9 = this.storageArrays[var7].getBlockMSBArray(); +- if(var9 == null) { ++ ++ if (var9 == null) { + var9 = this.storageArrays[var7].createBlockMSBArray(); + } + +- System.arraycopy(var1, var5, var9.data, 0, var9.data.length); ++ System.arraycopy(par1ArrayOfByte, var5, var9.data, 0, var9.data.length); + var5 += var9.data.length; + } +- } else if(var4 && this.storageArrays[var7] != null && this.storageArrays[var7].getBlockMSBArray() != null) { ++ } else if (par4 && this.storageArrays[var7] != null && this.storageArrays[var7].getBlockMSBArray() != null) { + this.storageArrays[var7].clearMSBArray(); + } + } + +- if(var4) { +- System.arraycopy(var1, var5, this.blockBiomeArray, 0, this.blockBiomeArray.length); ++ if (par4) { ++ System.arraycopy(par1ArrayOfByte, var5, this.blockBiomeArray, 0, this.blockBiomeArray.length); + int var10000 = var5 + this.blockBiomeArray.length; + } + +- for(var7 = 0; var7 < this.storageArrays.length; ++var7) { +- if(this.storageArrays[var7] != null && (var2 & 1 << var7) != 0) { ++ for (var7 = 0; var7 < this.storageArrays.length; ++var7) { ++ if (this.storageArrays[var7] != null && (par2 & 1 << var7) != 0) { + this.storageArrays[var7].removeInvalidBlocks(); + } + } + + this.generateHeightMap(); +- Iterator var11 = this.i.values().iterator(); ++ Iterator var11 = this.chunkTileEntityMap.values().iterator(); + +- while(var11.hasNext()) { ++ while (var11.hasNext()) { + TileEntity var10 = (TileEntity)var11.next(); + var10.updateContainingBlockInfo(); + } +- + } + +- public BiomeGenBase getBiomeGenForWorldCoords(int var1, int var2, WorldChunkManager var3) { +- int var4 = this.blockBiomeArray[var2 << 4 | var1] & 255; +- if(var4 == 255) { +- BiomeGenBase var5 = var3.getBiomeGenAt((this.xPosition << 4) + var1, (this.zPosition << 4) + var2); ++ /** ++ * This method retrieves the biome at a set of coordinates ++ */ ++ public BiomeGenBase getBiomeGenForWorldCoords(int par1, int par2, WorldChunkManager par3WorldChunkManager) { ++ int var4 = this.blockBiomeArray[par2 << 4 | par1] & 255; ++ ++ if (var4 == 255) { ++ BiomeGenBase var5 = par3WorldChunkManager.getBiomeGenAt((this.xPosition << 4) + par1, (this.zPosition << 4) + par2); + var4 = var5.biomeID; +- this.blockBiomeArray[var2 << 4 | var1] = (byte)(var4 & 255); ++ this.blockBiomeArray[par2 << 4 | par1] = (byte)(var4 & 255); + } + + return BiomeGenBase.biomeList[var4] == null ? BiomeGenBase.plains : BiomeGenBase.biomeList[var4]; + } + ++ /** ++ * Returns an array containing a 16x16 mapping on the X/Z of block positions in this Chunk to biome IDs. ++ */ + public byte[] getBiomeArray() { + return this.blockBiomeArray; + } + +- public void setBiomeArray(byte[] var1) { +- this.blockBiomeArray = var1; ++ /** ++ * Accepts a 256-entry array that contains a 16x16 mapping on the X/Z plane of block positions in this Chunk to biome ++ * IDs. ++ */ ++ public void setBiomeArray(byte[] par1ArrayOfByte) { ++ this.blockBiomeArray = par1ArrayOfByte; + } + ++ /** ++ * Resets the relight check index to 0 for this Chunk. ++ */ + public void resetRelightChecks() { + this.queuedLightChecks = 0; + } + ++ /** ++ * Called once-per-chunk-per-tick, and advances the round-robin relight check index per-storage-block by up to 8 blocks ++ * at a time. In a worst-case scenario, can potentially take up to 1.6 seconds, calculated via (4096/(8*16))/20, to re- ++ * check all blocks in a chunk, which could explain both lagging light updates in certain cases as well as Nether ++ * relight ++ */ + public void enqueueRelightChecks() { +- for(int var1 = 0; var1 < 8; ++var1) { +- if(this.queuedLightChecks >= 4096) { ++ for (int var1 = 0; var1 < 8; ++var1) { ++ if (this.queuedLightChecks >= 4096) { + return; + } + +@@ -920,30 +1184,31 @@ + int var5 = (this.xPosition << 4) + var3; + int var6 = (this.zPosition << 4) + var4; + +- for(int var7 = 0; var7 < 16; ++var7) { ++ for (int var7 = 0; var7 < 16; ++var7) { + int var8 = (var2 << 4) + var7; +- if(this.storageArrays[var2] == null && (var7 == 0 || var7 == 15 || var3 == 0 || var3 == 15 || var4 == 0 || var4 == 15) || this.storageArrays[var2] != null && this.storageArrays[var2].getExtBlockID(var3, var7, var4) == 0) { +- if(Block.lightValue[this.worldObj.getBlockId(var5, var8 - 1, var6)] > 0) { ++ ++ if (this.storageArrays[var2] == null && (var7 == 0 || var7 == 15 || var3 == 0 || var3 == 15 || var4 == 0 || var4 == 15) || this.storageArrays[var2] != null && this.storageArrays[var2].getExtBlockID(var3, var7, var4) == 0) { ++ if (Block.lightValue[this.worldObj.getBlockId(var5, var8 - 1, var6)] > 0) { + this.worldObj.updateAllLightTypes(var5, var8 - 1, var6); + } + +- if(Block.lightValue[this.worldObj.getBlockId(var5, var8 + 1, var6)] > 0) { ++ if (Block.lightValue[this.worldObj.getBlockId(var5, var8 + 1, var6)] > 0) { + this.worldObj.updateAllLightTypes(var5, var8 + 1, var6); + } + +- if(Block.lightValue[this.worldObj.getBlockId(var5 - 1, var8, var6)] > 0) { ++ if (Block.lightValue[this.worldObj.getBlockId(var5 - 1, var8, var6)] > 0) { + this.worldObj.updateAllLightTypes(var5 - 1, var8, var6); + } + +- if(Block.lightValue[this.worldObj.getBlockId(var5 + 1, var8, var6)] > 0) { ++ if (Block.lightValue[this.worldObj.getBlockId(var5 + 1, var8, var6)] > 0) { + this.worldObj.updateAllLightTypes(var5 + 1, var8, var6); + } + +- if(Block.lightValue[this.worldObj.getBlockId(var5, var8, var6 - 1)] > 0) { ++ if (Block.lightValue[this.worldObj.getBlockId(var5, var8, var6 - 1)] > 0) { + this.worldObj.updateAllLightTypes(var5, var8, var6 - 1); + } + +- if(Block.lightValue[this.worldObj.getBlockId(var5, var8, var6 + 1)] > 0) { ++ if (Block.lightValue[this.worldObj.getBlockId(var5, var8, var6 + 1)] > 0) { + this.worldObj.updateAllLightTypes(var5, var8, var6 + 1); + } + +@@ -951,6 +1216,5 @@ + } + } + } +- + } + } diff --git a/patches/net/minecraft/src/ChunkCache.java.patch b/patches/net/minecraft/src/ChunkCache.java.patch new file mode 100644 index 0000000..0cfa9fa --- /dev/null +++ b/patches/net/minecraft/src/ChunkCache.java.patch @@ -0,0 +1,510 @@ +--- net/minecraft/src/ChunkCache.java ++++ net/minecraft/src/ChunkCache.java +@@ -1,123 +1,158 @@ + package net.minecraft.src; + ++import net.minecraft.src.Minecraft; ++ + public class ChunkCache implements IBlockAccess { + private int chunkX; + private int chunkZ; + private Chunk[][] chunkArray; +- private boolean hasExtendedLevels; ++ ++ /** True if the chunk cache is empty. */ ++ private boolean isEmpty; ++ ++ /** Reference to the World object. */ + private World worldObj; + +- public ChunkCache(World var1, int var2, int var3, int var4, int var5, int var6, int var7, int var8) { +- this.worldObj = var1; +- this.chunkX = var2 - var8 >> 4; +- this.chunkZ = var4 - var8 >> 4; +- int var9 = var5 + var8 >> 4; +- int var10 = var7 + var8 >> 4; ++ public ChunkCache(World par1World, int par2, int par3, int par4, int par5, int par6, int par7, int par8) { ++ this.worldObj = par1World; ++ this.chunkX = par2 - par8 >> 4; ++ this.chunkZ = par4 - par8 >> 4; ++ int var9 = par5 + par8 >> 4; ++ int var10 = par7 + par8 >> 4; + this.chunkArray = new Chunk[var9 - this.chunkX + 1][var10 - this.chunkZ + 1]; +- this.hasExtendedLevels = true; +- ++ this.isEmpty = true; + int var11; + int var12; + Chunk var13; +- for(var11 = this.chunkX; var11 <= var9; ++var11) { +- for(var12 = this.chunkZ; var12 <= var10; ++var12) { +- var13 = var1.getChunkFromChunkCoords(var11, var12); +- if(var13 != null) { ++ ++ for (var11 = this.chunkX; var11 <= var9; ++var11) { ++ for (var12 = this.chunkZ; var12 <= var10; ++var12) { ++ var13 = par1World.getChunkFromChunkCoords(var11, var12); ++ ++ if (var13 != null) { + this.chunkArray[var11 - this.chunkX][var12 - this.chunkZ] = var13; + } + } + } + +- for(var11 = var2 >> 4; var11 <= var5 >> 4; ++var11) { +- for(var12 = var4 >> 4; var12 <= var7 >> 4; ++var12) { ++ for (var11 = par2 >> 4; var11 <= par5 >> 4; ++var11) { ++ for (var12 = par4 >> 4; var12 <= par7 >> 4; ++var12) { + var13 = this.chunkArray[var11 - this.chunkX][var12 - this.chunkZ]; +- if(var13 != null && !var13.getAreLevelsEmpty(var3, var6)) { +- this.hasExtendedLevels = false; ++ ++ if (var13 != null && !var13.getAreLevelsEmpty(par3, par6)) { ++ this.isEmpty = false; + } + } + } +- + } + ++ /** ++ * set by !chunk.getAreLevelsEmpty ++ */ + public boolean extendedLevelsInChunkCache() { +- return this.hasExtendedLevels; ++ return this.isEmpty; + } + +- public int getBlockId(int var1, int var2, int var3) { +- if(var2 < 0) { ++ /** ++ * Returns the block ID at coords x,y,z ++ */ ++ public int getBlockId(int par1, int par2, int par3) { ++ if (par2 < 0) { + return 0; +- } else if(var2 >= 256) { ++ } else if (par2 >= 256) { + return 0; + } else { +- int var4 = (var1 >> 4) - this.chunkX; +- int var5 = (var3 >> 4) - this.chunkZ; +- if(var4 >= 0 && var4 < this.chunkArray.length && var5 >= 0 && var5 < this.chunkArray[var4].length) { ++ int var4 = (par1 >> 4) - this.chunkX; ++ int var5 = (par3 >> 4) - this.chunkZ; ++ ++ if (var4 >= 0 && var4 < this.chunkArray.length && var5 >= 0 && var5 < this.chunkArray[var4].length) { + Chunk var6 = this.chunkArray[var4][var5]; +- return var6 == null ? 0 : var6.getBlockID(var1 & 15, var2, var3 & 15); ++ return var6 == null ? 0 : var6.getBlockID(par1 & 15, par2, par3 & 15); + } else { + return 0; + } + } + } + +- public TileEntity getBlockTileEntity(int var1, int var2, int var3) { +- int var4 = (var1 >> 4) - this.chunkX; +- int var5 = (var3 >> 4) - this.chunkZ; +- return this.chunkArray[var4][var5].getChunkBlockTileEntity(var1 & 15, var2, var3 & 15); ++ /** ++ * Returns the TileEntity associated with a given block in X,Y,Z coordinates, or null if no TileEntity exists ++ */ ++ public TileEntity getBlockTileEntity(int par1, int par2, int par3) { ++ int var4 = (par1 >> 4) - this.chunkX; ++ int var5 = (par3 >> 4) - this.chunkZ; ++ return this.chunkArray[var4][var5].getChunkBlockTileEntity(par1 & 15, par2, par3 & 15); + } + +- public float getBrightness(int var1, int var2, int var3, int var4) { +- int var5 = this.getLightValue(var1, var2, var3); +- if(var5 < var4) { +- var5 = var4; ++ public float getBrightness(int par1, int par2, int par3, int par4) { ++ int var5 = this.getLightValue(par1, par2, par3); ++ ++ if (var5 < par4) { ++ var5 = par4; + } + + return this.worldObj.provider.lightBrightnessTable[var5]; + } + +- public int getLightBrightnessForSkyBlocks(int var1, int var2, int var3, int var4) { +- int var5 = this.getSkyBlockTypeBrightness(EnumSkyBlock.Sky, var1, var2, var3); +- int var6 = this.getSkyBlockTypeBrightness(EnumSkyBlock.Block, var1, var2, var3); +- if(var6 < var4) { +- var6 = var4; ++ /** ++ * Any Light rendered on a 1.8 Block goes through here ++ */ ++ public int getLightBrightnessForSkyBlocks(int par1, int par2, int par3, int par4) { ++ int var5 = this.getSkyBlockTypeBrightness(EnumSkyBlock.Sky, par1, par2, par3); ++ int var6 = this.getSkyBlockTypeBrightness(EnumSkyBlock.Block, par1, par2, par3); ++ ++ if (var6 < par4) { ++ var6 = par4; + } + + return var5 << 20 | var6 << 4; + } + +- public float getLightBrightness(int var1, int var2, int var3) { +- return this.worldObj.provider.lightBrightnessTable[this.getLightValue(var1, var2, var3)]; +- } +- +- public int getLightValue(int var1, int var2, int var3) { +- return this.getLightValueExt(var1, var2, var3, true); +- } +- +- public int getLightValueExt(int var1, int var2, int var3, boolean var4) { +- if(var1 >= -30000000 && var3 >= -30000000 && var1 < 30000000 && var3 <= 30000000) { ++ /** ++ * Returns how bright the block is shown as which is the block's light value looked up in a lookup table (light values ++ * aren't linear for brightness). Args: x, y, z ++ */ ++ public float getLightBrightness(int par1, int par2, int par3) { ++ return this.worldObj.provider.lightBrightnessTable[this.getLightValue(par1, par2, par3)]; ++ } ++ ++ /** ++ * Gets the light value of the specified block coords. Args: x, y, z ++ */ ++ public int getLightValue(int par1, int par2, int par3) { ++ return this.getLightValueExt(par1, par2, par3, true); ++ } ++ ++ /** ++ * Get light value with flag ++ */ ++ public int getLightValueExt(int par1, int par2, int par3, boolean par4) { ++ if (par1 >= -30000000 && par3 >= -30000000 && par1 < 30000000 && par3 <= 30000000) { + int var5; + int var6; +- if(var4) { +- var5 = this.getBlockId(var1, var2, var3); +- if(var5 == Block.stoneSingleSlab.blockID || var5 == Block.woodSingleSlab.blockID || var5 == Block.tilledField.blockID || var5 == Block.stairsWoodOak.blockID || var5 == Block.stairsCobblestone.blockID) { +- var6 = this.getLightValueExt(var1, var2 + 1, var3, false); +- int var7 = this.getLightValueExt(var1 + 1, var2, var3, false); +- int var8 = this.getLightValueExt(var1 - 1, var2, var3, false); +- int var9 = this.getLightValueExt(var1, var2, var3 + 1, false); +- int var10 = this.getLightValueExt(var1, var2, var3 - 1, false); +- if(var7 > var6) { ++ ++ if (par4) { ++ var5 = this.getBlockId(par1, par2, par3); ++ ++ if (var5 == Block.stoneSingleSlab.blockID || var5 == Block.woodSingleSlab.blockID || var5 == Block.tilledField.blockID || var5 == Block.stairsWoodOak.blockID || var5 == Block.stairsCobblestone.blockID) { ++ var6 = this.getLightValueExt(par1, par2 + 1, par3, false); ++ int var7 = this.getLightValueExt(par1 + 1, par2, par3, false); ++ int var8 = this.getLightValueExt(par1 - 1, par2, par3, false); ++ int var9 = this.getLightValueExt(par1, par2, par3 + 1, false); ++ int var10 = this.getLightValueExt(par1, par2, par3 - 1, false); ++ ++ if (var7 > var6) { + var6 = var7; + } + +- if(var8 > var6) { ++ if (var8 > var6) { + var6 = var8; + } + +- if(var9 > var6) { ++ if (var9 > var6) { + var6 = var9; + } + +- if(var10 > var6) { ++ if (var10 > var6) { + var6 = var10; + } + +@@ -125,143 +160,219 @@ + } + } + +- if(var2 < 0) { ++ if (par2 < 0) { + return 0; +- } else if(var2 >= 256) { ++ } else if (par2 >= 256) { + var5 = 15 - this.worldObj.skylightSubtracted; +- if(var5 < 0) { ++ ++ if (var5 < 0) { + var5 = 0; + } + + return var5; + } else { +- var5 = (var1 >> 4) - this.chunkX; +- var6 = (var3 >> 4) - this.chunkZ; +- return this.chunkArray[var5][var6].getBlockLightValue(var1 & 15, var2, var3 & 15, this.worldObj.skylightSubtracted); ++ var5 = (par1 >> 4) - this.chunkX; ++ var6 = (par3 >> 4) - this.chunkZ; ++ return this.chunkArray[var5][var6].getBlockLightValue(par1 & 15, par2, par3 & 15, this.worldObj.skylightSubtracted); + } + } else { + return 15; + } + } + +- public int getBlockMetadata(int var1, int var2, int var3) { +- if(var2 < 0) { ++ /** ++ * Returns the block metadata at coords x,y,z ++ */ ++ public int getBlockMetadata(int par1, int par2, int par3) { ++ if (par2 < 0) { + return 0; +- } else if(var2 >= 256) { ++ } else if (par2 >= 256) { + return 0; + } else { +- int var4 = (var1 >> 4) - this.chunkX; +- int var5 = (var3 >> 4) - this.chunkZ; +- return this.chunkArray[var4][var5].getBlockMetadata(var1 & 15, var2, var3 & 15); ++ int var4 = (par1 >> 4) - this.chunkX; ++ int var5 = (par3 >> 4) - this.chunkZ; ++ return this.chunkArray[var4][var5].getBlockMetadata(par1 & 15, par2, par3 & 15); + } + } + +- public Material getBlockMaterial(int var1, int var2, int var3) { +- int var4 = this.getBlockId(var1, var2, var3); ++ /** ++ * Returns the block's material. ++ */ ++ public Material getBlockMaterial(int par1, int par2, int par3) { ++ int var4 = this.getBlockId(par1, par2, par3); + return var4 == 0 ? Material.air : Block.blocksList[var4].blockMaterial; + } + +- public BiomeGenBase getBiomeGenForCoords(int var1, int var2) { +- return this.worldObj.getBiomeGenForCoords(var1, var2); ++ /** ++ * Gets the biome for a given set of x/z coordinates ++ */ ++ public BiomeGenBase getBiomeGenForCoords(int par1, int par2) { ++ return this.worldObj.getBiomeGenForCoords(par1, par2); + } + +- public boolean isBlockOpaqueCube(int var1, int var2, int var3) { +- Block var4 = Block.blocksList[this.getBlockId(var1, var2, var3)]; ++ /** ++ * Returns true if the block at the specified coordinates is an opaque cube. Args: x, y, z ++ */ ++ public boolean isBlockOpaqueCube(int par1, int par2, int par3) { ++ Block var4 = Block.blocksList[this.getBlockId(par1, par2, par3)]; + return var4 == null ? false : var4.isOpaqueCube(); + } + +- public boolean isBlockNormalCube(int var1, int var2, int var3) { +- Block var4 = Block.blocksList[this.getBlockId(var1, var2, var3)]; ++ /** ++ * Indicate if a material is a normal solid opaque cube. ++ */ ++ public boolean isBlockNormalCube(int par1, int par2, int par3) { ++ Block var4 = Block.blocksList[this.getBlockId(par1, par2, par3)]; + return var4 == null ? false : var4.blockMaterial.blocksMovement() && var4.renderAsNormalBlock(); + } + +- public boolean doesBlockHaveSolidTopSurface(int var1, int var2, int var3) { +- Block var4 = Block.blocksList[this.getBlockId(var1, var2, var3)]; +- return this.worldObj.isBlockTopFacingSurfaceSolid(var4, this.getBlockMetadata(var1, var2, var3)); ++ /** ++ * Returns true if the block at the given coordinate has a solid (buildable) top surface. ++ */ ++ public boolean doesBlockHaveSolidTopSurface(int par1, int par2, int par3) { ++ Block var4 = Block.blocksList[this.getBlockId(par1, par2, par3)]; ++ return this.worldObj.isBlockTopFacingSurfaceSolid(var4, this.getBlockMetadata(par1, par2, par3)); + } + ++ /** ++ * Return the Vec3Pool object for this world. ++ */ + public Vec3Pool getWorldVec3Pool() { + return this.worldObj.getWorldVec3Pool(); + } + +- public boolean isAirBlock(int var1, int var2, int var3) { +- Block var4 = Block.blocksList[this.getBlockId(var1, var2, var3)]; ++ /** ++ * Returns true if the block at the specified coordinates is empty ++ */ ++ public boolean isAirBlock(int par1, int par2, int par3) { ++ Block var4 = Block.blocksList[this.getBlockId(par1, par2, par3)]; + return var4 == null; + } + +- public int getSkyBlockTypeBrightness(EnumSkyBlock var1, int var2, int var3, int var4) { +- if(var3 < 0) { +- var3 = 0; +- } +- +- if(var3 >= 256) { +- var3 = 255; +- } +- +- if(var3 >= 0 && var3 < 256 && var2 >= -30000000 && var4 >= -30000000 && var2 < 30000000 && var4 <= 30000000) { +- if(var1 == EnumSkyBlock.Sky && this.worldObj.provider.hasNoSky) { ++ /** ++ * Brightness for SkyBlock.Sky is clear white and (through color computing it is assumed) DEPENDENT ON DAYTIME. ++ * Brightness for SkyBlock.Block is yellowish and independent. ++ */ ++ public int getSkyBlockTypeBrightness(EnumSkyBlock par1EnumSkyBlock, int par2, int par3, int par4) { ++ if (par3 < 0) { ++ par3 = 0; ++ } ++ ++ if (par3 >= 256) { ++ par3 = 255; ++ } ++ ++ if (par3 >= 0 && par3 < 256 && par2 >= -30000000 && par4 >= -30000000 && par2 < 30000000 && par4 <= 30000000) { ++ if (par1EnumSkyBlock == EnumSkyBlock.Sky && this.worldObj.provider.hasNoSky) { + return 0; + } else { + int var5; + int var6; +- if(Block.useNeighborBrightness[this.getBlockId(var2, var3, var4)]) { +- var5 = this.getSpecialBlockBrightness(var1, var2, var3 + 1, var4); +- var6 = this.getSpecialBlockBrightness(var1, var2 + 1, var3, var4); +- int var7 = this.getSpecialBlockBrightness(var1, var2 - 1, var3, var4); +- int var8 = this.getSpecialBlockBrightness(var1, var2, var3, var4 + 1); +- int var9 = this.getSpecialBlockBrightness(var1, var2, var3, var4 - 1); +- if(var6 > var5) { ++ ++ if (Block.useNeighborBrightness[this.getBlockId(par2, par3, par4)]) { ++ var5 = this.getSpecialBlockBrightness(par1EnumSkyBlock, par2, par3 + 1, par4); ++ var6 = this.getSpecialBlockBrightness(par1EnumSkyBlock, par2 + 1, par3, par4); ++ int var7 = this.getSpecialBlockBrightness(par1EnumSkyBlock, par2 - 1, par3, par4); ++ int var8 = this.getSpecialBlockBrightness(par1EnumSkyBlock, par2, par3, par4 + 1); ++ int var9 = this.getSpecialBlockBrightness(par1EnumSkyBlock, par2, par3, par4 - 1); ++ ++ if (var6 > var5) { + var5 = var6; + } + +- if(var7 > var5) { ++ if (var7 > var5) { + var5 = var7; + } + +- if(var8 > var5) { ++ if (var8 > var5) { + var5 = var8; + } + +- if(var9 > var5) { ++ if (var9 > var5) { + var5 = var9; + } + + return var5; + } else { +- var5 = (var2 >> 4) - this.chunkX; +- var6 = (var4 >> 4) - this.chunkZ; +- return this.chunkArray[var5][var6].getSavedLightValue(var1, var2 & 15, var3, var4 & 15); ++ var5 = (par2 >> 4) - this.chunkX; ++ var6 = (par4 >> 4) - this.chunkZ; ++ return this.chunkArray[var5][var6].getSavedLightValue(par1EnumSkyBlock, par2 & 15, par3, par4 & 15); + } + } + } else { +- return var1.defaultLightValue; ++ return par1EnumSkyBlock.defaultLightValue; + } + } + +- public int getSpecialBlockBrightness(EnumSkyBlock var1, int var2, int var3, int var4) { +- if(var3 < 0) { +- var3 = 0; +- } +- +- if(var3 >= 256) { +- var3 = 255; +- } +- +- if(var3 >= 0 && var3 < 256 && var2 >= -30000000 && var4 >= -30000000 && var2 < 30000000 && var4 <= 30000000) { +- int var5 = (var2 >> 4) - this.chunkX; +- int var6 = (var4 >> 4) - this.chunkZ; +- return this.chunkArray[var5][var6].getSavedLightValue(var1, var2 & 15, var3, var4 & 15); ++ /** ++ * is only used on stairs and tilled fields ++ */ ++ public int getSpecialBlockBrightness(EnumSkyBlock par1EnumSkyBlock, int par2, int par3, int par4) { ++ if (par3 < 0) { ++ par3 = 0; ++ } ++ ++ if (par3 >= 256) { ++ par3 = 255; ++ } ++ ++ if (par3 >= 0 && par3 < 256 && par2 >= -30000000 && par4 >= -30000000 && par2 < 30000000 && par4 <= 30000000) { ++ int var5 = (par2 >> 4) - this.chunkX; ++ int var6 = (par4 >> 4) - this.chunkZ; ++ return this.chunkArray[var5][var6].getSavedLightValue(par1EnumSkyBlock, par2 & 15, par3, par4 & 15); + } else { +- return var1.defaultLightValue; ++ return par1EnumSkyBlock.defaultLightValue; + } + } + ++ /** ++ * Returns current world height. ++ */ + public int getHeight() { + return 256; + } + +- public int isBlockProvidingPowerTo(int var1, int var2, int var3, int var4) { +- int var5 = this.getBlockId(var1, var2, var3); +- return var5 == 0 ? 0 : Block.blocksList[var5].isProvidingStrongPower(this, var1, var2, var3, var4); +- } ++ /** ++ * Is this block powering in the specified direction Args: x, y, z, direction ++ */ ++ public int isBlockProvidingPowerTo(int par1, int par2, int par3, int par4) { ++ int var5 = this.getBlockId(par1, par2, par3); ++ return var5 == 0 ? 0 : Block.blocksList[var5].isProvidingStrongPower(this, par1, par2, par3, par4); ++ } ++ ++ // Spout Start ++ public int getGrassColorCache(int x, int y, int z) { ++ Chunk chunk = Minecraft.getMinecraft().theWorld.getChunkFromBlockCoords(x, z); ++ if (chunk != null) { ++ return chunk.grassColorCache; ++ } ++ return 0xffffff; ++ } ++ ++ public void setGrassColorCache(int x, int y, int z, int color) { ++ Chunk chunk = Minecraft.getMinecraft().theWorld.getChunkFromBlockCoords(x, z); ++ if (chunk != null) { ++ chunk.grassColorCache = color; ++ } ++ } ++ ++ public int getWaterColorCache(int x, int y, int z) { ++ Chunk chunk = Minecraft.getMinecraft().theWorld.getChunkFromBlockCoords(x, z); ++ if (chunk != null) { ++ return chunk.waterColorCache; ++ } ++ return 0xffffff; ++ } ++ ++ public void setWaterColorCache(int x, int y, int z, int color) { ++ Chunk chunk = Minecraft.getMinecraft().theWorld.getChunkFromBlockCoords(x, z); ++ if (chunk != null) { ++ chunk.waterColorCache = color; ++ } ++ } ++ ++ public WorldChunkManager getWorldChunkManager() { ++ return Minecraft.getMinecraft().theWorld.getWorldChunkManager(); ++ } ++ // Spout End + } diff --git a/patches/net/minecraft/src/ChunkCoordIntPair.java.patch b/patches/net/minecraft/src/ChunkCoordIntPair.java.patch new file mode 100644 index 0000000..9155f77 --- /dev/null +++ b/patches/net/minecraft/src/ChunkCoordIntPair.java.patch @@ -0,0 +1,53 @@ +--- net/minecraft/src/ChunkCoordIntPair.java ++++ net/minecraft/src/ChunkCoordIntPair.java +@@ -1,16 +1,23 @@ + package net.minecraft.src; + + public class ChunkCoordIntPair { ++ ++ /** The X position of this Chunk Coordinate Pair */ + public final int chunkXPos; ++ ++ /** The Z position of this Chunk Coordinate Pair */ + public final int chunkZPos; + +- public ChunkCoordIntPair(int var1, int var2) { +- this.chunkXPos = var1; +- this.chunkZPos = var2; ++ public ChunkCoordIntPair(int par1, int par2) { ++ this.chunkXPos = par1; ++ this.chunkZPos = par2; + } + +- public static long chunkXZ2Int(int var0, int var1) { +- return (long)var0 & 4294967295L | ((long)var1 & 4294967295L) << 32; ++ /** ++ * converts a chunk coordinate pair to an integer (suitable for hashing) ++ */ ++ public static long chunkXZ2Int(int par0, int par1) { ++ return (long)par0 & 4294967295L | ((long)par1 & 4294967295L) << 32; + } + + public int hashCode() { +@@ -20,8 +27,8 @@ + return var3 ^ var4; + } + +- public boolean equals(Object var1) { +- ChunkCoordIntPair var2 = (ChunkCoordIntPair)var1; ++ public boolean equals(Object par1Obj) { ++ ChunkCoordIntPair var2 = (ChunkCoordIntPair)par1Obj; + return var2.chunkXPos == this.chunkXPos && var2.chunkZPos == this.chunkZPos; + } + +@@ -33,8 +40,8 @@ + return (this.chunkZPos << 4) + 8; + } + +- public ChunkPosition getChunkPosition(int var1) { +- return new ChunkPosition(this.getCenterXPos(), var1, this.getCenterZPosition()); ++ public ChunkPosition getChunkPosition(int par1) { ++ return new ChunkPosition(this.getCenterXPos(), par1, this.getCenterZPosition()); + } + + public String toString() { diff --git a/patches/net/minecraft/src/ChunkCoordinates.java.patch b/patches/net/minecraft/src/ChunkCoordinates.java.patch new file mode 100644 index 0000000..a6c3c2b --- /dev/null +++ b/patches/net/minecraft/src/ChunkCoordinates.java.patch @@ -0,0 +1,109 @@ +--- net/minecraft/src/ChunkCoordinates.java ++++ net/minecraft/src/ChunkCoordinates.java +@@ -2,29 +2,32 @@ + + public class ChunkCoordinates implements Comparable { + public int posX; ++ ++ /** the y coordinate */ + public int posY; ++ ++ /** the z coordinate */ + public int posZ; + +- public ChunkCoordinates() { +- } +- +- public ChunkCoordinates(int var1, int var2, int var3) { +- this.posX = var1; +- this.posY = var2; +- this.posZ = var3; +- } +- +- public ChunkCoordinates(ChunkCoordinates var1) { +- this.posX = var1.posX; +- this.posY = var1.posY; +- this.posZ = var1.posZ; +- } +- +- public boolean equals(Object var1) { +- if(!(var1 instanceof ChunkCoordinates)) { ++ public ChunkCoordinates() {} ++ ++ public ChunkCoordinates(int par1, int par2, int par3) { ++ this.posX = par1; ++ this.posY = par2; ++ this.posZ = par3; ++ } ++ ++ public ChunkCoordinates(ChunkCoordinates par1ChunkCoordinates) { ++ this.posX = par1ChunkCoordinates.posX; ++ this.posY = par1ChunkCoordinates.posY; ++ this.posZ = par1ChunkCoordinates.posZ; ++ } ++ ++ public boolean equals(Object par1Obj) { ++ if (!(par1Obj instanceof ChunkCoordinates)) { + return false; + } else { +- ChunkCoordinates var2 = (ChunkCoordinates)var1; ++ ChunkCoordinates var2 = (ChunkCoordinates)par1Obj; + return this.posX == var2.posX && this.posY == var2.posY && this.posZ == var2.posZ; + } + } +@@ -33,28 +36,37 @@ + return this.posX + this.posZ << 8 + this.posY << 16; + } + +- public int compareChunkCoordinate(ChunkCoordinates var1) { +- return this.posY == var1.posY ? (this.posZ == var1.posZ ? this.posX - var1.posX : this.posZ - var1.posZ) : this.posY - var1.posY; +- } +- +- public void set(int var1, int var2, int var3) { +- this.posX = var1; +- this.posY = var2; +- this.posZ = var3; +- } +- +- public float getDistanceSquared(int var1, int var2, int var3) { +- float var4 = (float)(this.posX - var1); +- float var5 = (float)(this.posY - var2); +- float var6 = (float)(this.posZ - var3); ++ /** ++ * Compare the coordinate with another coordinate ++ */ ++ public int compareChunkCoordinate(ChunkCoordinates par1ChunkCoordinates) { ++ return this.posY == par1ChunkCoordinates.posY ? (this.posZ == par1ChunkCoordinates.posZ ? this.posX - par1ChunkCoordinates.posX : this.posZ - par1ChunkCoordinates.posZ) : this.posY - par1ChunkCoordinates.posY; ++ } ++ ++ public void set(int par1, int par2, int par3) { ++ this.posX = par1; ++ this.posY = par2; ++ this.posZ = par3; ++ } ++ ++ /** ++ * Returns the squared distance between this coordinates and the coordinates given as argument. ++ */ ++ public float getDistanceSquared(int par1, int par2, int par3) { ++ float var4 = (float)(this.posX - par1); ++ float var5 = (float)(this.posY - par2); ++ float var6 = (float)(this.posZ - par3); + return var4 * var4 + var5 * var5 + var6 * var6; + } + +- public float getDistanceSquaredToChunkCoordinates(ChunkCoordinates var1) { +- return this.getDistanceSquared(var1.posX, var1.posY, var1.posZ); ++ /** ++ * Return the squared distance between this coordinates and the ChunkCoordinates given as argument. ++ */ ++ public float getDistanceSquaredToChunkCoordinates(ChunkCoordinates par1ChunkCoordinates) { ++ return this.getDistanceSquared(par1ChunkCoordinates.posX, par1ChunkCoordinates.posY, par1ChunkCoordinates.posZ); + } + +- public int compareTo(Object var1) { +- return this.compareChunkCoordinate((ChunkCoordinates)var1); ++ public int compareTo(Object par1Obj) { ++ return this.compareChunkCoordinate((ChunkCoordinates)par1Obj); + } + } diff --git a/patches/net/minecraft/src/ChunkLoader.java.patch b/patches/net/minecraft/src/ChunkLoader.java.patch new file mode 100644 index 0000000..1e16d61 --- /dev/null +++ b/patches/net/minecraft/src/ChunkLoader.java.patch @@ -0,0 +1,162 @@ +--- net/minecraft/src/ChunkLoader.java ++++ net/minecraft/src/ChunkLoader.java +@@ -1,75 +1,87 @@ + package net.minecraft.src; + + public class ChunkLoader { +- public static AnvilConverterData load(NBTTagCompound var0) { +- int var1 = var0.getInteger("xPos"); +- int var2 = var0.getInteger("zPos"); ++ public static AnvilConverterData load(NBTTagCompound par0NBTTagCompound) { ++ int var1 = par0NBTTagCompound.getInteger("xPos"); ++ int var2 = par0NBTTagCompound.getInteger("zPos"); + AnvilConverterData var3 = new AnvilConverterData(var1, var2); +- var3.blocks = var0.getByteArray("Blocks"); +- var3.data = new NibbleArrayReader(var0.getByteArray("Data"), 7); +- var3.skyLight = new NibbleArrayReader(var0.getByteArray("SkyLight"), 7); +- var3.blockLight = new NibbleArrayReader(var0.getByteArray("BlockLight"), 7); +- var3.heightmap = var0.getByteArray("HeightMap"); +- var3.terrainPopulated = var0.getBoolean("TerrainPopulated"); +- var3.entities = var0.getTagList("Entities"); +- var3.tileEntities = var0.getTagList("TileEntities"); +- var3.tileTicks = var0.getTagList("TileTicks"); ++ var3.blocks = par0NBTTagCompound.getByteArray("Blocks"); ++ var3.data = new NibbleArrayReader(par0NBTTagCompound.getByteArray("Data"), 7); ++ var3.skyLight = new NibbleArrayReader(par0NBTTagCompound.getByteArray("SkyLight"), 7); ++ var3.blockLight = new NibbleArrayReader(par0NBTTagCompound.getByteArray("BlockLight"), 7); ++ var3.heightmap = par0NBTTagCompound.getByteArray("HeightMap"); ++ var3.terrainPopulated = par0NBTTagCompound.getBoolean("TerrainPopulated"); ++ var3.entities = par0NBTTagCompound.getTagList("Entities"); ++ var3.tileEntities = par0NBTTagCompound.getTagList("TileEntities"); ++ var3.tileTicks = par0NBTTagCompound.getTagList("TileTicks"); + + try { +- var3.lastUpdated = var0.getLong("LastUpdate"); ++ var3.lastUpdated = par0NBTTagCompound.getLong("LastUpdate"); + } catch (ClassCastException var5) { +- var3.lastUpdated = (long)var0.getInteger("LastUpdate"); ++ var3.lastUpdated = (long)par0NBTTagCompound.getInteger("LastUpdate"); + } + + return var3; + } + +- public static void convertToAnvilFormat(AnvilConverterData var0, NBTTagCompound var1, WorldChunkManager var2) { +- var1.setInteger("xPos", var0.x); +- var1.setInteger("zPos", var0.z); +- var1.setLong("LastUpdate", var0.lastUpdated); +- int[] var3 = new int[var0.heightmap.length]; ++ public static void convertToAnvilFormat(AnvilConverterData par0AnvilConverterData, NBTTagCompound par1NBTTagCompound, WorldChunkManager par2WorldChunkManager) { ++ par1NBTTagCompound.setInteger("xPos", par0AnvilConverterData.x); ++ par1NBTTagCompound.setInteger("zPos", par0AnvilConverterData.z); ++ par1NBTTagCompound.setLong("LastUpdate", par0AnvilConverterData.lastUpdated); ++ int[] var3 = new int[par0AnvilConverterData.heightmap.length]; + +- for(int var4 = 0; var4 < var0.heightmap.length; ++var4) { +- var3[var4] = var0.heightmap[var4]; ++ for (int var4 = 0; var4 < par0AnvilConverterData.heightmap.length; ++var4) { ++ var3[var4] = par0AnvilConverterData.heightmap[var4]; + } + +- var1.setIntArray("HeightMap", var3); +- var1.setBoolean("TerrainPopulated", var0.terrainPopulated); ++ par1NBTTagCompound.setIntArray("HeightMap", var3); ++ par1NBTTagCompound.setBoolean("TerrainPopulated", par0AnvilConverterData.terrainPopulated); + NBTTagList var16 = new NBTTagList("Sections"); +- + int var7; +- for(int var5 = 0; var5 < 8; ++var5) { ++ ++ for (int var5 = 0; var5 < 8; ++var5) { + boolean var6 = true; + +- for(var7 = 0; var7 < 16 && var6; ++var7) { +- for(int var8 = 0; var8 < 16 && var6; ++var8) { +- for(int var9 = 0; var9 < 16; ++var9) { +- int var10 = var7 << 11 | var9 << 7 | var8 + (var5 << 4); +- byte var11 = var0.blocks[var10]; +- if(var11 != 0) { ++ for (var7 = 0; var7 < 16 && var6; ++var7) { ++ int var8 = 0; ++ ++ while (var8 < 16 && var6) { ++ int var9 = 0; ++ ++ while (true) { ++ if (var9 < 16) { ++ int var10 = var7 << 11 | var9 << 7 | var8 + (var5 << 4); ++ byte var11 = par0AnvilConverterData.blocks[var10]; ++ ++ if (var11 == 0) { ++ ++var9; ++ continue; ++ } ++ + var6 = false; +- break; + } ++ ++ ++var8; ++ break; + } + } + } + +- if(!var6) { ++ if (!var6) { + byte[] var19 = new byte[4096]; + NibbleArray var20 = new NibbleArray(var19.length, 4); + NibbleArray var21 = new NibbleArray(var19.length, 4); + NibbleArray var22 = new NibbleArray(var19.length, 4); + +- for(int var23 = 0; var23 < 16; ++var23) { +- for(int var12 = 0; var12 < 16; ++var12) { +- for(int var13 = 0; var13 < 16; ++var13) { ++ for (int var23 = 0; var23 < 16; ++var23) { ++ for (int var12 = 0; var12 < 16; ++var12) { ++ for (int var13 = 0; var13 < 16; ++var13) { + int var14 = var23 << 11 | var13 << 7 | var12 + (var5 << 4); +- byte var15 = var0.blocks[var14]; ++ byte var15 = par0AnvilConverterData.blocks[var14]; + var19[var12 << 8 | var13 << 4 | var23] = (byte)(var15 & 255); +- var20.set(var23, var12, var13, var0.data.get(var23, var12 + (var5 << 4), var13)); +- var21.set(var23, var12, var13, var0.skyLight.get(var23, var12 + (var5 << 4), var13)); +- var22.set(var23, var12, var13, var0.blockLight.get(var23, var12 + (var5 << 4), var13)); ++ var20.set(var23, var12, var13, par0AnvilConverterData.data.get(var23, var12 + (var5 << 4), var13)); ++ var21.set(var23, var12, var13, par0AnvilConverterData.skyLight.get(var23, var12 + (var5 << 4), var13)); ++ var22.set(var23, var12, var13, par0AnvilConverterData.blockLight.get(var23, var12 + (var5 << 4), var13)); + } + } + } +@@ -84,21 +96,21 @@ + } + } + +- var1.setTag("Sections", var16); ++ par1NBTTagCompound.setTag("Sections", var16); + byte[] var17 = new byte[256]; + +- for(int var18 = 0; var18 < 16; ++var18) { +- for(var7 = 0; var7 < 16; ++var7) { +- var17[var7 << 4 | var18] = (byte)(var2.getBiomeGenAt(var0.x << 4 | var18, var0.z << 4 | var7).biomeID & 255); ++ for (int var18 = 0; var18 < 16; ++var18) { ++ for (var7 = 0; var7 < 16; ++var7) { ++ var17[var7 << 4 | var18] = (byte)(par2WorldChunkManager.getBiomeGenAt(par0AnvilConverterData.x << 4 | var18, par0AnvilConverterData.z << 4 | var7).biomeID & 255); + } + } + +- var1.setByteArray("Biomes", var17); +- var1.setTag("Entities", var0.entities); +- var1.setTag("TileEntities", var0.tileEntities); +- if(var0.tileTicks != null) { +- var1.setTag("TileTicks", var0.tileTicks); +- } ++ par1NBTTagCompound.setByteArray("Biomes", var17); ++ par1NBTTagCompound.setTag("Entities", par0AnvilConverterData.entities); ++ par1NBTTagCompound.setTag("TileEntities", par0AnvilConverterData.tileEntities); + ++ if (par0AnvilConverterData.tileTicks != null) { ++ par1NBTTagCompound.setTag("TileTicks", par0AnvilConverterData.tileTicks); ++ } + } + } diff --git a/patches/net/minecraft/src/ChunkPosition.java.patch b/patches/net/minecraft/src/ChunkPosition.java.patch new file mode 100644 index 0000000..d7414a6 --- /dev/null +++ b/patches/net/minecraft/src/ChunkPosition.java.patch @@ -0,0 +1,47 @@ +--- net/minecraft/src/ChunkPosition.java ++++ net/minecraft/src/ChunkPosition.java +@@ -1,25 +1,31 @@ + package net.minecraft.src; + + public class ChunkPosition { ++ ++ /** The x coordinate of this ChunkPosition */ + public final int x; ++ ++ /** The y coordinate of this ChunkPosition */ + public final int y; ++ ++ /** The z coordinate of this ChunkPosition */ + public final int z; + +- public ChunkPosition(int var1, int var2, int var3) { +- this.x = var1; +- this.y = var2; +- this.z = var3; +- } +- +- public ChunkPosition(Vec3 var1) { +- this(MathHelper.floor_double(var1.xCoord), MathHelper.floor_double(var1.yCoord), MathHelper.floor_double(var1.zCoord)); +- } +- +- public boolean equals(Object var1) { +- if(!(var1 instanceof ChunkPosition)) { ++ public ChunkPosition(int par1, int par2, int par3) { ++ this.x = par1; ++ this.y = par2; ++ this.z = par3; ++ } ++ ++ public ChunkPosition(Vec3 par1Vec3) { ++ this(MathHelper.floor_double(par1Vec3.xCoord), MathHelper.floor_double(par1Vec3.yCoord), MathHelper.floor_double(par1Vec3.zCoord)); ++ } ++ ++ public boolean equals(Object par1Obj) { ++ if (!(par1Obj instanceof ChunkPosition)) { + return false; + } else { +- ChunkPosition var2 = (ChunkPosition)var1; ++ ChunkPosition var2 = (ChunkPosition)par1Obj; + return var2.x == this.x && var2.y == this.y && var2.z == this.z; + } + } diff --git a/patches/net/minecraft/src/ChunkProviderClient.java.patch b/patches/net/minecraft/src/ChunkProviderClient.java.patch new file mode 100644 index 0000000..9807f17 --- /dev/null +++ b/patches/net/minecraft/src/ChunkProviderClient.java.patch @@ -0,0 +1,186 @@ +--- net/minecraft/src/ChunkProviderClient.java ++++ net/minecraft/src/ChunkProviderClient.java +@@ -1,79 +1,154 @@ + package net.minecraft.src; + +-import java.util.ArrayList; + import java.util.List; + ++import gnu.trove.map.hash.TLongObjectHashMap; ++ ++// Spout ++// Spout End ++ + public class ChunkProviderClient implements IChunkProvider { ++ ++ /** ++ * The completely empty chunk used by ChunkProviderClient when chunkMapping doesn't contain the requested coordinates. ++ */ + private Chunk blankChunk; +- private LongHashMap chunkMapping = new LongHashMap(); +- private List c = new ArrayList(); ++ ++ /** ++ * The mapping between ChunkCoordinates and Chunks that ChunkProviderClient maintains. ++ */ ++ // Spout Start ++ private TLongObjectHashMap chunkMapping = new TLongObjectHashMap(1000); ++ // Spout End ++ /** ++ * This may have been intended to be an iterable version of all currently loaded chunks (MultiplayerChunkCache), with ++ * identical contents to chunkMapping's values. However it is never actually added to. ++ */ ++ // Spout Start - Unused ++ //private List chunkListing = new ArrayList(); ++ // Spout End ++ ++ /** Reference to the World object. */ + private World worldObj; + +- public ChunkProviderClient(World var1) { +- this.blankChunk = new EmptyChunk(var1, 0, 0); +- this.worldObj = var1; ++ public ChunkProviderClient(World par1World) { ++ this.blankChunk = new EmptyChunk(par1World, 0, 0); ++ this.worldObj = par1World; ++ // Spout Start ++ chunkMapping.setAutoCompactionFactor(0.0F); ++ // Spout End + } + ++ /** ++ * Checks to see if a chunk exists at x, y ++ */ ++ // Spout Start + public boolean chunkExists(int var1, int var2) { +- return true; ++ return this != null ? true : this.chunkMapping.containsKey(ChunkCoordIntPair.chunkXZ2Int(var1, var2)); ++ // Spout End + } + +- public void unloadChunk(int var1, int var2) { +- Chunk var3 = this.provideChunk(var1, var2); +- if(!var3.isEmpty()) { ++ /** ++ * Unload chunk from ChunkProviderClient's hashmap. Called in response to a Packet50PreChunk with its mode field set to ++ * false ++ */ ++ public void unloadChunk(int par1, int par2) { ++ Chunk var3 = this.provideChunk(par1, par2); ++ ++ if (!var3.isEmpty()) { + var3.onChunkUnload(); + } + +- this.chunkMapping.remove(ChunkCoordIntPair.chunkXZ2Int(var1, var2)); +- this.c.remove(var3); ++ this.chunkMapping.remove(ChunkCoordIntPair.chunkXZ2Int(par1, par2)); ++ // Spout Start - Unused ++ //this.chunkListing.remove(var3); ++ // Spout End + } + +- public Chunk loadChunk(int var1, int var2) { +- Chunk var3 = new Chunk(this.worldObj, var1, var2); +- this.chunkMapping.add(ChunkCoordIntPair.chunkXZ2Int(var1, var2), var3); ++ /** ++ * loads or generates the chunk at the chunk location specified ++ */ ++ public Chunk loadChunk(int par1, int par2) { ++ Chunk var3 = new Chunk(this.worldObj, par1, par2); ++ // Spout Start ++ this.chunkMapping.put(ChunkCoordIntPair.chunkXZ2Int(par1, par2), var3); ++ // Spout End + var3.isChunkLoaded = true; + return var3; + } + ++ /** ++ * Will return back a chunk, if it doesn't exist and its not a MP client it will generates all the blocks for the ++ * specified chunk from the map seed and chunk seed ++ */ ++ // Spout Start - public + public Chunk provideChunk(int var1, int var2) { +- Chunk var3 = (Chunk)this.chunkMapping.getValueByKey(ChunkCoordIntPair.chunkXZ2Int(var1, var2)); ++ Chunk var3 = (Chunk)this.chunkMapping.get(ChunkCoordIntPair.chunkXZ2Int(var1, var2)); ++ // Spout End + return var3 == null ? this.blankChunk : var3; + } + +- public boolean saveChunks(boolean var1, IProgressUpdate var2) { ++ /** ++ * Two modes of operation: if passed true, save all Chunks in one go. If passed false, save up to two chunks. Return ++ * true if all chunks have been saved. ++ */ ++ public boolean saveChunks(boolean par1, IProgressUpdate par2IProgressUpdate) { + return true; + } +- +- public void saveExtraData() { +- } +- ++ ++ /** ++ * Save extra data not associated with any Chunk. Not saved during autosave, only during world unload. Currently ++ * unimplemented. ++ */ ++ public void saveExtraData() {} ++ ++ /** ++ * Unloads chunks that are marked to be unloaded. This is not guaranteed to unload every such chunk. ++ */ + public boolean unloadQueuedChunks() { + return false; + } + ++ /** ++ * Returns if the IChunkProvider supports saving. ++ */ + public boolean canSave() { + return false; + } + +- public void populate(IChunkProvider var1, int var2, int var3) { +- } ++ /** ++ * Populates chunk with ores etc etc ++ */ ++ public void populate(IChunkProvider par1IChunkProvider, int par2, int par3) {} + ++ /** ++ * Converts the instance data to a readable string. ++ */ + public String makeString() { +- return "MultiplayerChunkCache: " + this.chunkMapping.getNumHashElements(); ++ // Spout Start ++ return "MultiplayerChunkCache: " + this.chunkMapping.size(); ++ // Spout End + } + +- public List getPossibleCreatures(EnumCreatureType var1, int var2, int var3, int var4) { ++ /** ++ * Returns a list of creatures of the specified type that can spawn at the given location. ++ */ ++ public List getPossibleCreatures(EnumCreatureType par1EnumCreatureType, int par2, int par3, int par4) { + return null; + } + +- public ChunkPosition findClosestStructure(World var1, String var2, int var3, int var4, int var5) { ++ /** ++ * Returns the location of the closest structure of the specified type. If not found returns null. ++ */ ++ public ChunkPosition findClosestStructure(World par1World, String par2Str, int par3, int par4, int par5) { + return null; + } + + public int getLoadedChunkCount() { +- return this.c.size(); ++ // Spout Start - Was this.chunkListing.size(); ++ return chunkMapping.size(); ++ // Spout End + } + +- public void recreateStructures(int var1, int var2) { +- } ++ public void recreateStructures(int par1, int par2) {} + } diff --git a/patches/net/minecraft/src/ChunkProviderEnd.java.patch b/patches/net/minecraft/src/ChunkProviderEnd.java.patch new file mode 100644 index 0000000..cd3282e --- /dev/null +++ b/patches/net/minecraft/src/ChunkProviderEnd.java.patch @@ -0,0 +1,432 @@ +--- net/minecraft/src/ChunkProviderEnd.java ++++ net/minecraft/src/ChunkProviderEnd.java +@@ -4,7 +4,7 @@ + import java.util.Random; + + public class ChunkProviderEnd implements IChunkProvider { +- private Random i; ++ private Random endRNG; + private NoiseGeneratorOctaves noiseGen1; + private NoiseGeneratorOctaves noiseGen2; + private NoiseGeneratorOctaves noiseGen3; +@@ -12,6 +12,8 @@ + public NoiseGeneratorOctaves noiseGen5; + private World endWorld; + private double[] densities; ++ ++ /** The biomes that are used to generate the chunk */ + private BiomeGenBase[] biomesForGeneration; + double[] noiseData1; + double[] noiseData2; +@@ -20,26 +22,26 @@ + double[] noiseData5; + int[][] field_73203_h = new int[32][32]; + +- public ChunkProviderEnd(World var1, long var2) { +- this.endWorld = var1; +- this.i = new Random(var2); +- this.noiseGen1 = new NoiseGeneratorOctaves(this.i, 16); +- this.noiseGen2 = new NoiseGeneratorOctaves(this.i, 16); +- this.noiseGen3 = new NoiseGeneratorOctaves(this.i, 8); +- this.noiseGen4 = new NoiseGeneratorOctaves(this.i, 10); +- this.noiseGen5 = new NoiseGeneratorOctaves(this.i, 16); ++ public ChunkProviderEnd(World par1World, long par2) { ++ this.endWorld = par1World; ++ this.endRNG = new Random(par2); ++ this.noiseGen1 = new NoiseGeneratorOctaves(this.endRNG, 16); ++ this.noiseGen2 = new NoiseGeneratorOctaves(this.endRNG, 16); ++ this.noiseGen3 = new NoiseGeneratorOctaves(this.endRNG, 8); ++ this.noiseGen4 = new NoiseGeneratorOctaves(this.endRNG, 10); ++ this.noiseGen5 = new NoiseGeneratorOctaves(this.endRNG, 16); + } + +- public void generateTerrain(int var1, int var2, byte[] var3, BiomeGenBase[] var4) { ++ public void generateTerrain(int par1, int par2, byte[] par3ArrayOfByte, BiomeGenBase[] par4ArrayOfBiomeGenBase) { + byte var5 = 2; + int var6 = var5 + 1; + byte var7 = 33; + int var8 = var5 + 1; +- this.densities = this.initializeNoiseField(this.densities, var1 * var5, 0, var2 * var5, var6, var7, var8); ++ this.densities = this.initializeNoiseField(this.densities, par1 * var5, 0, par2 * var5, var6, var7, var8); + +- for(int var9 = 0; var9 < var5; ++var9) { +- for(int var10 = 0; var10 < var5; ++var10) { +- for(int var11 = 0; var11 < 32; ++var11) { ++ for (int var9 = 0; var9 < var5; ++var9) { ++ for (int var10 = 0; var10 < var5; ++var10) { ++ for (int var11 = 0; var11 < 32; ++var11) { + double var12 = 0.25D; + double var14 = this.densities[((var9 + 0) * var8 + var10 + 0) * var7 + var11 + 0]; + double var16 = this.densities[((var9 + 0) * var8 + var10 + 1) * var7 + var11 + 0]; +@@ -50,27 +52,28 @@ + double var26 = (this.densities[((var9 + 1) * var8 + var10 + 0) * var7 + var11 + 1] - var18) * var12; + double var28 = (this.densities[((var9 + 1) * var8 + var10 + 1) * var7 + var11 + 1] - var20) * var12; + +- for(int var30 = 0; var30 < 4; ++var30) { ++ for (int var30 = 0; var30 < 4; ++var30) { + double var31 = 0.125D; + double var33 = var14; + double var35 = var16; + double var37 = (var18 - var14) * var31; + double var39 = (var20 - var16) * var31; + +- for(int var41 = 0; var41 < 8; ++var41) { ++ for (int var41 = 0; var41 < 8; ++var41) { + int var42 = var41 + var9 * 8 << 11 | 0 + var10 * 8 << 7 | var11 * 4 + var30; + short var43 = 128; + double var44 = 0.125D; + double var46 = var33; + double var48 = (var35 - var33) * var44; + +- for(int var50 = 0; var50 < 8; ++var50) { ++ for (int var50 = 0; var50 < 8; ++var50) { + int var51 = 0; +- if(var46 > 0.0D) { ++ ++ if (var46 > 0.0D) { + var51 = Block.whiteStone.blockID; + } + +- var3[var42] = (byte)var51; ++ par3ArrayOfByte[var42] = (byte)var51; + var42 += var43; + var46 += var48; + } +@@ -87,60 +90,67 @@ + } + } + } +- + } + +- public void replaceBlocksForBiome(int var1, int var2, byte[] var3, BiomeGenBase[] var4) { +- for(int var5 = 0; var5 < 16; ++var5) { +- for(int var6 = 0; var6 < 16; ++var6) { ++ public void replaceBlocksForBiome(int par1, int par2, byte[] par3ArrayOfByte, BiomeGenBase[] par4ArrayOfBiomeGenBase) { ++ for (int var5 = 0; var5 < 16; ++var5) { ++ for (int var6 = 0; var6 < 16; ++var6) { + byte var7 = 1; + int var8 = -1; + byte var9 = (byte)Block.whiteStone.blockID; + byte var10 = (byte)Block.whiteStone.blockID; + +- for(int var11 = 127; var11 >= 0; --var11) { ++ for (int var11 = 127; var11 >= 0; --var11) { + int var12 = (var6 * 16 + var5) * 128 + var11; +- byte var13 = var3[var12]; +- if(var13 == 0) { ++ byte var13 = par3ArrayOfByte[var12]; ++ ++ if (var13 == 0) { + var8 = -1; +- } else if(var13 == Block.stone.blockID) { +- if(var8 == -1) { +- if(var7 <= 0) { ++ } else if (var13 == Block.stone.blockID) { ++ if (var8 == -1) { ++ if (var7 <= 0) { + var9 = 0; + var10 = (byte)Block.whiteStone.blockID; + } + + var8 = var7; +- if(var11 >= 0) { +- var3[var12] = var9; ++ ++ if (var11 >= 0) { ++ par3ArrayOfByte[var12] = var9; + } else { +- var3[var12] = var10; ++ par3ArrayOfByte[var12] = var10; + } +- } else if(var8 > 0) { ++ } else if (var8 > 0) { + --var8; +- var3[var12] = var10; ++ par3ArrayOfByte[var12] = var10; + } + } + } + } + } +- +- } +- +- public Chunk loadChunk(int var1, int var2) { +- return this.provideChunk(var1, var2); +- } +- +- public Chunk provideChunk(int var1, int var2) { +- this.i.setSeed((long)var1 * 341873128712L + (long)var2 * 132897987541L); +- byte[] var3 = new byte[-Short.MIN_VALUE]; +- this.biomesForGeneration = this.endWorld.getWorldChunkManager().loadBlockGeneratorData(this.biomesForGeneration, var1 * 16, var2 * 16, 16, 16); +- this.generateTerrain(var1, var2, var3, this.biomesForGeneration); +- this.replaceBlocksForBiome(var1, var2, var3, this.biomesForGeneration); +- Chunk var4 = new Chunk(this.endWorld, var3, var1, var2); ++ } ++ ++ /** ++ * loads or generates the chunk at the chunk location specified ++ */ ++ public Chunk loadChunk(int par1, int par2) { ++ return this.provideChunk(par1, par2); ++ } ++ ++ /** ++ * Will return back a chunk, if it doesn't exist and its not a MP client it will generates all the blocks for the ++ * specified chunk from the map seed and chunk seed ++ */ ++ public Chunk provideChunk(int par1, int par2) { ++ this.endRNG.setSeed((long)par1 * 341873128712L + (long)par2 * 132897987541L); ++ byte[] var3 = new byte[32768]; ++ this.biomesForGeneration = this.endWorld.getWorldChunkManager().loadBlockGeneratorData(this.biomesForGeneration, par1 * 16, par2 * 16, 16, 16); ++ this.generateTerrain(par1, par2, var3, this.biomesForGeneration); ++ this.replaceBlocksForBiome(par1, par2, var3, this.biomesForGeneration); ++ Chunk var4 = new Chunk(this.endWorld, var3, par1, par2); + byte[] var5 = var4.getBiomeArray(); + +- for(int var6 = 0; var6 < var5.length; ++var6) { ++ for (int var6 = 0; var6 < var5.length; ++var6) { + var5[var6] = (byte)this.biomesForGeneration[var6].biomeID; + } + +@@ -148,74 +158,84 @@ + return var4; + } + +- private double[] initializeNoiseField(double[] var1, int var2, int var3, int var4, int var5, int var6, int var7) { +- if(var1 == null) { +- var1 = new double[var5 * var6 * var7]; ++ /** ++ * generates a subset of the level's terrain data. Takes 7 arguments: the [empty] noise array, the position, and the ++ * size. ++ */ ++ private double[] initializeNoiseField(double[] par1ArrayOfDouble, int par2, int par3, int par4, int par5, int par6, int par7) { ++ if (par1ArrayOfDouble == null) { ++ par1ArrayOfDouble = new double[par5 * par6 * par7]; + } + + double var8 = 684.412D; + double var10 = 684.412D; +- this.noiseData4 = this.noiseGen4.generateNoiseOctaves(this.noiseData4, var2, var4, var5, var7, 1.121D, 1.121D, 0.5D); +- this.noiseData5 = this.noiseGen5.generateNoiseOctaves(this.noiseData5, var2, var4, var5, var7, 200.0D, 200.0D, 0.5D); ++ this.noiseData4 = this.noiseGen4.generateNoiseOctaves(this.noiseData4, par2, par4, par5, par7, 1.121D, 1.121D, 0.5D); ++ this.noiseData5 = this.noiseGen5.generateNoiseOctaves(this.noiseData5, par2, par4, par5, par7, 200.0D, 200.0D, 0.5D); + var8 *= 2.0D; +- this.noiseData1 = this.noiseGen3.generateNoiseOctaves(this.noiseData1, var2, var3, var4, var5, var6, var7, var8 / 80.0D, var10 / 160.0D, var8 / 80.0D); +- this.noiseData2 = this.noiseGen1.generateNoiseOctaves(this.noiseData2, var2, var3, var4, var5, var6, var7, var8, var10, var8); +- this.noiseData3 = this.noiseGen2.generateNoiseOctaves(this.noiseData3, var2, var3, var4, var5, var6, var7, var8, var10, var8); ++ this.noiseData1 = this.noiseGen3.generateNoiseOctaves(this.noiseData1, par2, par3, par4, par5, par6, par7, var8 / 80.0D, var10 / 160.0D, var8 / 80.0D); ++ this.noiseData2 = this.noiseGen1.generateNoiseOctaves(this.noiseData2, par2, par3, par4, par5, par6, par7, var8, var10, var8); ++ this.noiseData3 = this.noiseGen2.generateNoiseOctaves(this.noiseData3, par2, par3, par4, par5, par6, par7, var8, var10, var8); + int var12 = 0; + int var13 = 0; + +- for(int var14 = 0; var14 < var5; ++var14) { +- for(int var15 = 0; var15 < var7; ++var15) { ++ for (int var14 = 0; var14 < par5; ++var14) { ++ for (int var15 = 0; var15 < par7; ++var15) { + double var16 = (this.noiseData4[var13] + 256.0D) / 512.0D; +- if(var16 > 1.0D) { ++ ++ if (var16 > 1.0D) { + var16 = 1.0D; + } + + double var18 = this.noiseData5[var13] / 8000.0D; +- if(var18 < 0.0D) { ++ ++ if (var18 < 0.0D) { + var18 = -var18 * 0.3D; + } + + var18 = var18 * 3.0D - 2.0D; +- float var20 = (float)(var14 + var2 - 0) / 1.0F; +- float var21 = (float)(var15 + var4 - 0) / 1.0F; ++ float var20 = (float)(var14 + par2 - 0) / 1.0F; ++ float var21 = (float)(var15 + par4 - 0) / 1.0F; + float var22 = 100.0F - MathHelper.sqrt_float(var20 * var20 + var21 * var21) * 8.0F; +- if(var22 > 80.0F) { ++ ++ if (var22 > 80.0F) { + var22 = 80.0F; + } + +- if(var22 < -100.0F) { ++ if (var22 < -100.0F) { + var22 = -100.0F; + } + +- if(var18 > 1.0D) { ++ if (var18 > 1.0D) { + var18 = 1.0D; + } + + var18 /= 8.0D; + var18 = 0.0D; +- if(var16 < 0.0D) { ++ ++ if (var16 < 0.0D) { + var16 = 0.0D; + } + + var16 += 0.5D; +- var18 = var18 * (double)var6 / 16.0D; ++ var18 = var18 * (double)par6 / 16.0D; + ++var13; +- double var23 = (double)var6 / 2.0D; ++ double var23 = (double)par6 / 2.0D; + +- for(int var25 = 0; var25 < var6; ++var25) { ++ for (int var25 = 0; var25 < par6; ++var25) { + double var26 = 0.0D; + double var28 = ((double)var25 - var23) * 8.0D / var16; +- if(var28 < 0.0D) { ++ ++ if (var28 < 0.0D) { + var28 *= -1.0D; + } + + double var30 = this.noiseData2[var12] / 512.0D; + double var32 = this.noiseData3[var12] / 512.0D; + double var34 = (this.noiseData1[var12] / 10.0D + 1.0D) / 2.0D; +- if(var34 < 0.0D) { ++ ++ if (var34 < 0.0D) { + var26 = var30; +- } else if(var34 > 1.0D) { ++ } else if (var34 > 1.0D) { + var26 = var32; + } else { + var26 = var30 + (var32 - var30) * var34; +@@ -225,13 +245,15 @@ + var26 += (double)var22; + byte var36 = 2; + double var37; +- if(var25 > var6 / 2 - var36) { +- var37 = (double)((float)(var25 - (var6 / 2 - var36)) / 64.0F); +- if(var37 < 0.0D) { ++ ++ if (var25 > par6 / 2 - var36) { ++ var37 = (double)((float)(var25 - (par6 / 2 - var36)) / 64.0F); ++ ++ if (var37 < 0.0D) { + var37 = 0.0D; + } + +- if(var37 > 1.0D) { ++ if (var37 > 1.0D) { + var37 = 1.0D; + } + +@@ -239,58 +261,87 @@ + } + + var36 = 8; +- if(var25 < var36) { ++ ++ if (var25 < var36) { + var37 = (double)((float)(var36 - var25) / ((float)var36 - 1.0F)); + var26 = var26 * (1.0D - var37) + -30.0D * var37; + } + +- var1[var12] = var26; ++ par1ArrayOfDouble[var12] = var26; + ++var12; + } + } + } + +- return var1; ++ return par1ArrayOfDouble; + } + +- public boolean chunkExists(int var1, int var2) { ++ /** ++ * Checks to see if a chunk exists at x, y ++ */ ++ public boolean chunkExists(int par1, int par2) { + return true; + } + +- public void populate(IChunkProvider var1, int var2, int var3) { ++ /** ++ * Populates chunk with ores etc etc ++ */ ++ public void populate(IChunkProvider par1IChunkProvider, int par2, int par3) { + BlockSand.fallInstantly = true; +- int var4 = var2 * 16; +- int var5 = var3 * 16; ++ int var4 = par2 * 16; ++ int var5 = par3 * 16; + BiomeGenBase var6 = this.endWorld.getBiomeGenForCoords(var4 + 16, var5 + 16); +- var6.decorate(this.endWorld, this.endWorld.s, var4, var5); ++ var6.decorate(this.endWorld, this.endWorld.rand, var4, var5); + BlockSand.fallInstantly = false; + } + +- public boolean saveChunks(boolean var1, IProgressUpdate var2) { ++ /** ++ * Two modes of operation: if passed true, save all Chunks in one go. If passed false, save up to two chunks. Return ++ * true if all chunks have been saved. ++ */ ++ public boolean saveChunks(boolean par1, IProgressUpdate par2IProgressUpdate) { + return true; + } + +- public void saveExtraData() { +- } ++ /** ++ * Save extra data not associated with any Chunk. Not saved during autosave, only during world unload. Currently ++ * unimplemented. ++ */ ++ public void saveExtraData() {} + ++ /** ++ * Unloads chunks that are marked to be unloaded. This is not guaranteed to unload every such chunk. ++ */ + public boolean unloadQueuedChunks() { + return false; + } + ++ /** ++ * Returns if the IChunkProvider supports saving. ++ */ + public boolean canSave() { + return true; + } + ++ /** ++ * Converts the instance data to a readable string. ++ */ + public String makeString() { + return "RandomLevelSource"; + } + +- public List getPossibleCreatures(EnumCreatureType var1, int var2, int var3, int var4) { +- BiomeGenBase var5 = this.endWorld.getBiomeGenForCoords(var2, var4); +- return var5 == null ? null : var5.getSpawnableList(var1); ++ /** ++ * Returns a list of creatures of the specified type that can spawn at the given location. ++ */ ++ public List getPossibleCreatures(EnumCreatureType par1EnumCreatureType, int par2, int par3, int par4) { ++ BiomeGenBase var5 = this.endWorld.getBiomeGenForCoords(par2, par4); ++ return var5 == null ? null : var5.getSpawnableList(par1EnumCreatureType); + } + +- public ChunkPosition findClosestStructure(World var1, String var2, int var3, int var4, int var5) { ++ /** ++ * Returns the location of the closest structure of the specified type. If not found returns null. ++ */ ++ public ChunkPosition findClosestStructure(World par1World, String par2Str, int par3, int par4, int par5) { + return null; + } + +@@ -298,6 +349,5 @@ + return 0; + } + +- public void recreateStructures(int var1, int var2) { +- } ++ public void recreateStructures(int par1, int par2) {} + } diff --git a/patches/net/minecraft/src/ChunkProviderFlat.java.patch b/patches/net/minecraft/src/ChunkProviderFlat.java.patch new file mode 100644 index 0000000..3453cda --- /dev/null +++ b/patches/net/minecraft/src/ChunkProviderFlat.java.patch @@ -0,0 +1,359 @@ +--- net/minecraft/src/ChunkProviderFlat.java ++++ net/minecraft/src/ChunkProviderFlat.java +@@ -8,84 +8,95 @@ + + public class ChunkProviderFlat implements IChunkProvider { + private World worldObj; +- private Random b; ++ private Random random; + private final byte[] cachedBlockIDs = new byte[256]; + private final byte[] cachedBlockMetadata = new byte[256]; + private final FlatGeneratorInfo flatWorldGenInfo; +- private final List f = new ArrayList(); ++ private final List structureGenerators = new ArrayList(); + private final boolean hasDecoration; + private final boolean hasDungeons; + private WorldGenLakes waterLakeGenerator; + private WorldGenLakes lavaLakeGenerator; + +- public ChunkProviderFlat(World var1, long var2, boolean var4, String var5) { +- this.worldObj = var1; +- this.b = new Random(var2); +- this.flatWorldGenInfo = FlatGeneratorInfo.createFlatGeneratorFromString(var5); +- if(var4) { ++ public ChunkProviderFlat(World par1World, long par2, boolean par4, String par5Str) { ++ this.worldObj = par1World; ++ this.random = new Random(par2); ++ this.flatWorldGenInfo = FlatGeneratorInfo.createFlatGeneratorFromString(par5Str); ++ ++ if (par4) { + Map var6 = this.flatWorldGenInfo.getWorldFeatures(); +- if(var6.containsKey("village")) { ++ ++ if (var6.containsKey("village")) { + Map var7 = (Map)var6.get("village"); +- if(!var7.containsKey("size")) { ++ ++ if (!var7.containsKey("size")) { + var7.put("size", "1"); + } + +- this.f.add(new MapGenVillage(var7)); +- } +- +- if(var6.containsKey("biome_1")) { +- this.f.add(new MapGenScatteredFeature((Map)var6.get("biome_1"))); +- } +- +- if(var6.containsKey("mineshaft")) { +- this.f.add(new MapGenMineshaft((Map)var6.get("mineshaft"))); +- } +- +- if(var6.containsKey("stronghold")) { +- this.f.add(new MapGenStronghold((Map)var6.get("stronghold"))); ++ this.structureGenerators.add(new MapGenVillage(var7)); ++ } ++ ++ if (var6.containsKey("biome_1")) { ++ this.structureGenerators.add(new MapGenScatteredFeature((Map)var6.get("biome_1"))); ++ } ++ ++ if (var6.containsKey("mineshaft")) { ++ this.structureGenerators.add(new MapGenMineshaft((Map)var6.get("mineshaft"))); ++ } ++ ++ if (var6.containsKey("stronghold")) { ++ this.structureGenerators.add(new MapGenStronghold((Map)var6.get("stronghold"))); + } + } + + this.hasDecoration = this.flatWorldGenInfo.getWorldFeatures().containsKey("decoration"); +- if(this.flatWorldGenInfo.getWorldFeatures().containsKey("lake")) { ++ ++ if (this.flatWorldGenInfo.getWorldFeatures().containsKey("lake")) { + this.waterLakeGenerator = new WorldGenLakes(Block.waterStill.blockID); + } + +- if(this.flatWorldGenInfo.getWorldFeatures().containsKey("lava_lake")) { ++ if (this.flatWorldGenInfo.getWorldFeatures().containsKey("lava_lake")) { + this.lavaLakeGenerator = new WorldGenLakes(Block.lavaStill.blockID); + } + + this.hasDungeons = this.flatWorldGenInfo.getWorldFeatures().containsKey("dungeon"); + Iterator var9 = this.flatWorldGenInfo.getFlatLayers().iterator(); + +- while(var9.hasNext()) { ++ while (var9.hasNext()) { + FlatLayerInfo var10 = (FlatLayerInfo)var9.next(); + +- for(int var8 = var10.getMinY(); var8 < var10.getMinY() + var10.getLayerCount(); ++var8) { ++ for (int var8 = var10.getMinY(); var8 < var10.getMinY() + var10.getLayerCount(); ++var8) { + this.cachedBlockIDs[var8] = (byte)(var10.getFillBlock() & 255); + this.cachedBlockMetadata[var8] = (byte)var10.getFillBlockMeta(); + } + } +- +- } +- +- public Chunk loadChunk(int var1, int var2) { +- return this.provideChunk(var1, var2); +- } +- +- public Chunk provideChunk(int var1, int var2) { +- Chunk var3 = new Chunk(this.worldObj, var1, var2); +- +- for(int var4 = 0; var4 < this.cachedBlockIDs.length; ++var4) { ++ } ++ ++ /** ++ * loads or generates the chunk at the chunk location specified ++ */ ++ public Chunk loadChunk(int par1, int par2) { ++ return this.provideChunk(par1, par2); ++ } ++ ++ /** ++ * Will return back a chunk, if it doesn't exist and its not a MP client it will generates all the blocks for the ++ * specified chunk from the map seed and chunk seed ++ */ ++ public Chunk provideChunk(int par1, int par2) { ++ Chunk var3 = new Chunk(this.worldObj, par1, par2); ++ ++ for (int var4 = 0; var4 < this.cachedBlockIDs.length; ++var4) { + int var5 = var4 >> 4; + ExtendedBlockStorage var6 = var3.getBlockStorageArray()[var5]; +- if(var6 == null) { ++ ++ if (var6 == null) { + var6 = new ExtendedBlockStorage(var4, !this.worldObj.provider.hasNoSky); + var3.getBlockStorageArray()[var5] = var6; + } + +- for(int var7 = 0; var7 < 16; ++var7) { +- for(int var8 = 0; var8 < 16; ++var8) { ++ for (int var7 = 0; var7 < 16; ++var7) { ++ for (int var8 = 0; var8 < 16; ++var8) { + var6.setExtBlockID(var7, var4 & 15, var8, this.cachedBlockIDs[var4] & 255); + var6.setExtBlockMetadata(var7, var4 & 15, var8, this.cachedBlockMetadata[var4]); + } +@@ -93,43 +104,50 @@ + } + + var3.generateSkylightMap(); +- BiomeGenBase[] var9 = this.worldObj.getWorldChunkManager().loadBlockGeneratorData((BiomeGenBase[])null, var1 * 16, var2 * 16, 16, 16); ++ BiomeGenBase[] var9 = this.worldObj.getWorldChunkManager().loadBlockGeneratorData((BiomeGenBase[])null, par1 * 16, par2 * 16, 16, 16); + byte[] var10 = var3.getBiomeArray(); + +- for(int var11 = 0; var11 < var10.length; ++var11) { ++ for (int var11 = 0; var11 < var10.length; ++var11) { + var10[var11] = (byte)var9[var11].biomeID; + } + +- Iterator var12 = this.f.iterator(); ++ Iterator var12 = this.structureGenerators.iterator(); + +- while(var12.hasNext()) { ++ while (var12.hasNext()) { + MapGenStructure var13 = (MapGenStructure)var12.next(); +- var13.generate(this, this.worldObj, var1, var2, (byte[])null); ++ var13.generate(this, this.worldObj, par1, par2, (byte[])null); + } + + var3.generateSkylightMap(); + return var3; + } + +- public boolean chunkExists(int var1, int var2) { ++ /** ++ * Checks to see if a chunk exists at x, y ++ */ ++ public boolean chunkExists(int par1, int par2) { + return true; + } + +- public void populate(IChunkProvider var1, int var2, int var3) { +- int var4 = var2 * 16; +- int var5 = var3 * 16; ++ /** ++ * Populates chunk with ores etc etc ++ */ ++ public void populate(IChunkProvider par1IChunkProvider, int par2, int par3) { ++ int var4 = par2 * 16; ++ int var5 = par3 * 16; + BiomeGenBase var6 = this.worldObj.getBiomeGenForCoords(var4 + 16, var5 + 16); + boolean var7 = false; +- this.b.setSeed(this.worldObj.getSeed()); +- long var8 = this.b.nextLong() / 2L * 2L + 1L; +- long var10 = this.b.nextLong() / 2L * 2L + 1L; +- this.b.setSeed((long)var2 * var8 + (long)var3 * var10 ^ this.worldObj.getSeed()); +- Iterator var12 = this.f.iterator(); ++ this.random.setSeed(this.worldObj.getSeed()); ++ long var8 = this.random.nextLong() / 2L * 2L + 1L; ++ long var10 = this.random.nextLong() / 2L * 2L + 1L; ++ this.random.setSeed((long)par2 * var8 + (long)par3 * var10 ^ this.worldObj.getSeed()); ++ Iterator var12 = this.structureGenerators.iterator(); + +- while(var12.hasNext()) { ++ while (var12.hasNext()) { + MapGenStructure var13 = (MapGenStructure)var12.next(); +- boolean var14 = var13.generateStructuresInChunk(this.worldObj, this.b, var2, var3); +- if(var13 instanceof MapGenVillage) { ++ boolean var14 = var13.generateStructuresInChunk(this.worldObj, this.random, par2, par3); ++ ++ if (var13 instanceof MapGenVillage) { + var7 |= var14; + } + } +@@ -137,69 +155,93 @@ + int var16; + int var17; + int var18; +- if(this.waterLakeGenerator != null && !var7 && this.b.nextInt(4) == 0) { +- var16 = var4 + this.b.nextInt(16) + 8; +- var17 = this.b.nextInt(128); +- var18 = var5 + this.b.nextInt(16) + 8; +- this.waterLakeGenerator.generate(this.worldObj, this.b, var16, var17, var18); +- } +- +- if(this.lavaLakeGenerator != null && !var7 && this.b.nextInt(8) == 0) { +- var16 = var4 + this.b.nextInt(16) + 8; +- var17 = this.b.nextInt(this.b.nextInt(120) + 8); +- var18 = var5 + this.b.nextInt(16) + 8; +- if(var17 < 63 || this.b.nextInt(10) == 0) { +- this.lavaLakeGenerator.generate(this.worldObj, this.b, var16, var17, var18); +- } +- } +- +- if(this.hasDungeons) { +- for(var16 = 0; var16 < 8; ++var16) { +- var17 = var4 + this.b.nextInt(16) + 8; +- var18 = this.b.nextInt(128); +- int var15 = var5 + this.b.nextInt(16) + 8; +- (new WorldGenDungeons()).generate(this.worldObj, this.b, var17, var18, var15); +- } +- } +- +- if(this.hasDecoration) { +- var6.decorate(this.worldObj, this.b, var4, var5); +- } +- ++ ++ if (this.waterLakeGenerator != null && !var7 && this.random.nextInt(4) == 0) { ++ var16 = var4 + this.random.nextInt(16) + 8; ++ var17 = this.random.nextInt(128); ++ var18 = var5 + this.random.nextInt(16) + 8; ++ this.waterLakeGenerator.generate(this.worldObj, this.random, var16, var17, var18); ++ } ++ ++ if (this.lavaLakeGenerator != null && !var7 && this.random.nextInt(8) == 0) { ++ var16 = var4 + this.random.nextInt(16) + 8; ++ var17 = this.random.nextInt(this.random.nextInt(120) + 8); ++ var18 = var5 + this.random.nextInt(16) + 8; ++ ++ if (var17 < 63 || this.random.nextInt(10) == 0) { ++ this.lavaLakeGenerator.generate(this.worldObj, this.random, var16, var17, var18); ++ } ++ } ++ ++ if (this.hasDungeons) { ++ for (var16 = 0; var16 < 8; ++var16) { ++ var17 = var4 + this.random.nextInt(16) + 8; ++ var18 = this.random.nextInt(128); ++ int var15 = var5 + this.random.nextInt(16) + 8; ++ (new WorldGenDungeons()).generate(this.worldObj, this.random, var17, var18, var15); ++ } ++ } ++ ++ if (this.hasDecoration) { ++ var6.decorate(this.worldObj, this.random, var4, var5); ++ } + } + +- public boolean saveChunks(boolean var1, IProgressUpdate var2) { ++ /** ++ * Two modes of operation: if passed true, save all Chunks in one go. If passed false, save up to two chunks. Return ++ * true if all chunks have been saved. ++ */ ++ public boolean saveChunks(boolean par1, IProgressUpdate par2IProgressUpdate) { + return true; + } + +- public void saveExtraData() { +- } ++ /** ++ * Save extra data not associated with any Chunk. Not saved during autosave, only during world unload. Currently ++ * unimplemented. ++ */ ++ public void saveExtraData() {} + ++ /** ++ * Unloads chunks that are marked to be unloaded. This is not guaranteed to unload every such chunk. ++ */ + public boolean unloadQueuedChunks() { + return false; + } + ++ /** ++ * Returns if the IChunkProvider supports saving. ++ */ + public boolean canSave() { + return true; + } + ++ /** ++ * Converts the instance data to a readable string. ++ */ + public String makeString() { + return "FlatLevelSource"; + } + +- public List getPossibleCreatures(EnumCreatureType var1, int var2, int var3, int var4) { +- BiomeGenBase var5 = this.worldObj.getBiomeGenForCoords(var2, var4); +- return var5 == null ? null : var5.getSpawnableList(var1); ++ /** ++ * Returns a list of creatures of the specified type that can spawn at the given location. ++ */ ++ public List getPossibleCreatures(EnumCreatureType par1EnumCreatureType, int par2, int par3, int par4) { ++ BiomeGenBase var5 = this.worldObj.getBiomeGenForCoords(par2, par4); ++ return var5 == null ? null : var5.getSpawnableList(par1EnumCreatureType); + } + +- public ChunkPosition findClosestStructure(World var1, String var2, int var3, int var4, int var5) { +- if("Stronghold".equals(var2)) { +- Iterator var6 = this.f.iterator(); ++ /** ++ * Returns the location of the closest structure of the specified type. If not found returns null. ++ */ ++ public ChunkPosition findClosestStructure(World par1World, String par2Str, int par3, int par4, int par5) { ++ if ("Stronghold".equals(par2Str)) { ++ Iterator var6 = this.structureGenerators.iterator(); + +- while(var6.hasNext()) { ++ while (var6.hasNext()) { + MapGenStructure var7 = (MapGenStructure)var6.next(); +- if(var7 instanceof MapGenStronghold) { +- return var7.getNearestInstance(var1, var3, var4, var5); ++ ++ if (var7 instanceof MapGenStronghold) { ++ return var7.getNearestInstance(par1World, par3, par4, par5); + } + } + } +@@ -211,13 +253,12 @@ + return 0; + } + +- public void recreateStructures(int var1, int var2) { +- Iterator var3 = this.f.iterator(); ++ public void recreateStructures(int par1, int par2) { ++ Iterator var3 = this.structureGenerators.iterator(); + +- while(var3.hasNext()) { ++ while (var3.hasNext()) { + MapGenStructure var4 = (MapGenStructure)var3.next(); +- var4.generate(this, this.worldObj, var1, var2, (byte[])null); ++ var4.generate(this, this.worldObj, par1, par2, (byte[])null); + } +- + } + } diff --git a/patches/net/minecraft/src/ChunkProviderGenerate.java.patch b/patches/net/minecraft/src/ChunkProviderGenerate.java.patch new file mode 100644 index 0000000..f1b5d8f --- /dev/null +++ b/patches/net/minecraft/src/ChunkProviderGenerate.java.patch @@ -0,0 +1,684 @@ +--- net/minecraft/src/ChunkProviderGenerate.java ++++ net/minecraft/src/ChunkProviderGenerate.java +@@ -4,59 +4,107 @@ + import java.util.Random; + + public class ChunkProviderGenerate implements IChunkProvider { +- private Random k; ++ ++ /** RNG. */ ++ private Random rand; ++ ++ /** A NoiseGeneratorOctaves used in generating terrain */ + private NoiseGeneratorOctaves noiseGen1; ++ ++ /** A NoiseGeneratorOctaves used in generating terrain */ + private NoiseGeneratorOctaves noiseGen2; ++ ++ /** A NoiseGeneratorOctaves used in generating terrain */ + private NoiseGeneratorOctaves noiseGen3; ++ ++ /** A NoiseGeneratorOctaves used in generating terrain */ + private NoiseGeneratorOctaves noiseGen4; ++ ++ /** A NoiseGeneratorOctaves used in generating terrain */ + public NoiseGeneratorOctaves noiseGen5; ++ ++ /** A NoiseGeneratorOctaves used in generating terrain */ + public NoiseGeneratorOctaves noiseGen6; + public NoiseGeneratorOctaves mobSpawnerNoise; ++ ++ /** Reference to the World object. */ + private World worldObj; ++ ++ /** are map structures going to be generated (e.g. strongholds) */ + private final boolean mapFeaturesEnabled; ++ ++ /** Holds the overall noise array used in chunk generation */ + private double[] noiseArray; + private double[] stoneNoise = new double[256]; + private MapGenBase caveGenerator = new MapGenCaves(); ++ ++ /** Holds Stronghold Generator */ + private MapGenStronghold strongholdGenerator = new MapGenStronghold(); ++ ++ /** Holds Village Generator */ + private MapGenVillage villageGenerator = new MapGenVillage(); ++ ++ /** Holds Mineshaft Generator */ + private MapGenMineshaft mineshaftGenerator = new MapGenMineshaft(); + private MapGenScatteredFeature scatteredFeatureGenerator = new MapGenScatteredFeature(); ++ ++ /** Holds ravine generator */ + private MapGenBase ravineGenerator = new MapGenRavine(); ++ ++ /** The biomes that are used to generate the chunk */ + private BiomeGenBase[] biomesForGeneration; ++ ++ /** A double array that hold terrain noise from noiseGen3 */ + double[] noise3; ++ ++ /** A double array that hold terrain noise */ + double[] noise1; ++ ++ /** A double array that hold terrain noise from noiseGen2 */ + double[] noise2; ++ ++ /** A double array that hold terrain noise from noiseGen5 */ + double[] noise5; ++ ++ /** A double array that holds terrain noise from noiseGen6 */ + double[] noise6; ++ ++ /** ++ * Used to store the 5x5 parabolic field that is used during terrain generation. ++ */ + float[] parabolicField; + int[][] field_73219_j = new int[32][32]; + +- public ChunkProviderGenerate(World var1, long var2, boolean var4) { +- this.worldObj = var1; +- this.mapFeaturesEnabled = var4; +- this.k = new Random(var2); +- this.noiseGen1 = new NoiseGeneratorOctaves(this.k, 16); +- this.noiseGen2 = new NoiseGeneratorOctaves(this.k, 16); +- this.noiseGen3 = new NoiseGeneratorOctaves(this.k, 8); +- this.noiseGen4 = new NoiseGeneratorOctaves(this.k, 4); +- this.noiseGen5 = new NoiseGeneratorOctaves(this.k, 10); +- this.noiseGen6 = new NoiseGeneratorOctaves(this.k, 16); +- this.mobSpawnerNoise = new NoiseGeneratorOctaves(this.k, 8); ++ public ChunkProviderGenerate(World par1World, long par2, boolean par4) { ++ this.worldObj = par1World; ++ this.mapFeaturesEnabled = par4; ++ this.rand = new Random(par2); ++ this.noiseGen1 = new NoiseGeneratorOctaves(this.rand, 16); ++ this.noiseGen2 = new NoiseGeneratorOctaves(this.rand, 16); ++ this.noiseGen3 = new NoiseGeneratorOctaves(this.rand, 8); ++ this.noiseGen4 = new NoiseGeneratorOctaves(this.rand, 4); ++ this.noiseGen5 = new NoiseGeneratorOctaves(this.rand, 10); ++ this.noiseGen6 = new NoiseGeneratorOctaves(this.rand, 16); ++ this.mobSpawnerNoise = new NoiseGeneratorOctaves(this.rand, 8); + } + +- public void generateTerrain(int var1, int var2, byte[] var3) { ++ /** ++ * Generates the shape of the terrain for the chunk though its all stone though the water is frozen if the temperature ++ * is low enough ++ */ ++ public void generateTerrain(int par1, int par2, byte[] par3ArrayOfByte) { + byte var4 = 4; + byte var5 = 16; + byte var6 = 63; + int var7 = var4 + 1; + byte var8 = 17; + int var9 = var4 + 1; +- this.biomesForGeneration = this.worldObj.getWorldChunkManager().getBiomesForGeneration(this.biomesForGeneration, var1 * 4 - 2, var2 * 4 - 2, var7 + 5, var9 + 5); +- this.noiseArray = this.initializeNoiseField(this.noiseArray, var1 * var4, 0, var2 * var4, var7, var8, var9); ++ this.biomesForGeneration = this.worldObj.getWorldChunkManager().getBiomesForGeneration(this.biomesForGeneration, par1 * 4 - 2, par2 * 4 - 2, var7 + 5, var9 + 5); ++ this.noiseArray = this.initializeNoiseField(this.noiseArray, par1 * var4, 0, par2 * var4, var7, var8, var9); + +- for(int var10 = 0; var10 < var4; ++var10) { +- for(int var11 = 0; var11 < var4; ++var11) { +- for(int var12 = 0; var12 < var5; ++var12) { ++ for (int var10 = 0; var10 < var4; ++var10) { ++ for (int var11 = 0; var11 < var4; ++var11) { ++ for (int var12 = 0; var12 < var5; ++var12) { + double var13 = 0.125D; + double var15 = this.noiseArray[((var10 + 0) * var9 + var11 + 0) * var8 + var12 + 0]; + double var17 = this.noiseArray[((var10 + 0) * var9 + var11 + 1) * var8 + var12 + 0]; +@@ -67,14 +115,14 @@ + double var27 = (this.noiseArray[((var10 + 1) * var9 + var11 + 0) * var8 + var12 + 1] - var19) * var13; + double var29 = (this.noiseArray[((var10 + 1) * var9 + var11 + 1) * var8 + var12 + 1] - var21) * var13; + +- for(int var31 = 0; var31 < 8; ++var31) { ++ for (int var31 = 0; var31 < 8; ++var31) { + double var32 = 0.25D; + double var34 = var15; + double var36 = var17; + double var38 = (var19 - var15) * var32; + double var40 = (var21 - var17) * var32; + +- for(int var42 = 0; var42 < 4; ++var42) { ++ for (int var42 = 0; var42 < 4; ++var42) { + int var43 = var42 + var10 * 4 << 11 | 0 + var11 * 4 << 7 | var12 * 8 + var31; + short var44 = 128; + var43 -= var44; +@@ -82,17 +130,13 @@ + double var49 = (var36 - var34) * var45; + double var47 = var34 - var49; + +- for(int var51 = 0; var51 < 4; ++var51) { +- var47 += var49; +- if(var47 > 0.0D) { +- var43 += var44; +- var3[var43] = (byte)Block.stone.blockID; +- } else if(var12 * 8 + var31 < var6) { +- var43 += var44; +- var3[var43] = (byte)Block.waterStill.blockID; ++ for (int var51 = 0; var51 < 4; ++var51) { ++ if ((var47 += var49) > 0.0D) { ++ par3ArrayOfByte[var43 += var44] = (byte)Block.stone.blockID; ++ } else if (var12 * 8 + var31 < var6) { ++ par3ArrayOfByte[var43 += var44] = (byte)Block.waterStill.blockID; + } else { +- var43 += var44; +- var3[var43] = 0; ++ par3ArrayOfByte[var43 += var44] = 0; + } + } + +@@ -108,43 +152,47 @@ + } + } + } +- + } + +- public void replaceBlocksForBiome(int var1, int var2, byte[] var3, BiomeGenBase[] var4) { ++ /** ++ * Replaces the stone that was placed in with blocks that match the biome ++ */ ++ public void replaceBlocksForBiome(int par1, int par2, byte[] par3ArrayOfByte, BiomeGenBase[] par4ArrayOfBiomeGenBase) { + byte var5 = 63; +- double var6 = 1.0D / 32.0D; +- this.stoneNoise = this.noiseGen4.generateNoiseOctaves(this.stoneNoise, var1 * 16, var2 * 16, 0, 16, 16, 1, var6 * 2.0D, var6 * 2.0D, var6 * 2.0D); ++ double var6 = 0.03125D; ++ this.stoneNoise = this.noiseGen4.generateNoiseOctaves(this.stoneNoise, par1 * 16, par2 * 16, 0, 16, 16, 1, var6 * 2.0D, var6 * 2.0D, var6 * 2.0D); + +- for(int var8 = 0; var8 < 16; ++var8) { +- for(int var9 = 0; var9 < 16; ++var9) { +- BiomeGenBase var10 = var4[var9 + var8 * 16]; ++ for (int var8 = 0; var8 < 16; ++var8) { ++ for (int var9 = 0; var9 < 16; ++var9) { ++ BiomeGenBase var10 = par4ArrayOfBiomeGenBase[var9 + var8 * 16]; + float var11 = var10.getFloatTemperature(); +- int var12 = (int)(this.stoneNoise[var8 + var9 * 16] / 3.0D + 3.0D + this.k.nextDouble() * 0.25D); ++ int var12 = (int)(this.stoneNoise[var8 + var9 * 16] / 3.0D + 3.0D + this.rand.nextDouble() * 0.25D); + int var13 = -1; + byte var14 = var10.topBlock; + byte var15 = var10.fillerBlock; + +- for(int var16 = 127; var16 >= 0; --var16) { ++ for (int var16 = 127; var16 >= 0; --var16) { + int var17 = (var9 * 16 + var8) * 128 + var16; +- if(var16 <= 0 + this.k.nextInt(5)) { +- var3[var17] = (byte)Block.bedrock.blockID; ++ ++ if (var16 <= 0 + this.rand.nextInt(5)) { ++ par3ArrayOfByte[var17] = (byte)Block.bedrock.blockID; + } else { +- byte var18 = var3[var17]; +- if(var18 == 0) { ++ byte var18 = par3ArrayOfByte[var17]; ++ ++ if (var18 == 0) { + var13 = -1; +- } else if(var18 == Block.stone.blockID) { +- if(var13 == -1) { +- if(var12 <= 0) { ++ } else if (var18 == Block.stone.blockID) { ++ if (var13 == -1) { ++ if (var12 <= 0) { + var14 = 0; + var15 = (byte)Block.stone.blockID; +- } else if(var16 >= var5 - 4 && var16 <= var5 + 1) { ++ } else if (var16 >= var5 - 4 && var16 <= var5 + 1) { + var14 = var10.topBlock; + var15 = var10.fillerBlock; + } + +- if(var16 < var5 && var14 == 0) { +- if(var11 < 0.15F) { ++ if (var16 < var5 && var14 == 0) { ++ if (var11 < 0.15F) { + var14 = (byte)Block.ice.blockID; + } else { + var14 = (byte)Block.waterStill.blockID; +@@ -152,16 +200,18 @@ + } + + var13 = var12; +- if(var16 >= var5 - 1) { +- var3[var17] = var14; ++ ++ if (var16 >= var5 - 1) { ++ par3ArrayOfByte[var17] = var14; + } else { +- var3[var17] = var15; ++ par3ArrayOfByte[var17] = var15; + } +- } else if(var13 > 0) { ++ } else if (var13 > 0) { + --var13; +- var3[var17] = var15; +- if(var13 == 0 && var15 == Block.sand.blockID) { +- var13 = this.k.nextInt(4); ++ par3ArrayOfByte[var17] = var15; ++ ++ if (var13 == 0 && var15 == Block.sand.blockID) { ++ var13 = this.rand.nextInt(4); + var15 = (byte)Block.sandStone.blockID; + } + } +@@ -170,32 +220,39 @@ + } + } + } +- +- } +- +- public Chunk loadChunk(int var1, int var2) { +- return this.provideChunk(var1, var2); +- } +- +- public Chunk provideChunk(int var1, int var2) { +- this.k.setSeed((long)var1 * 341873128712L + (long)var2 * 132897987541L); +- byte[] var3 = new byte[-Short.MIN_VALUE]; +- this.generateTerrain(var1, var2, var3); +- this.biomesForGeneration = this.worldObj.getWorldChunkManager().loadBlockGeneratorData(this.biomesForGeneration, var1 * 16, var2 * 16, 16, 16); +- this.replaceBlocksForBiome(var1, var2, var3, this.biomesForGeneration); +- this.caveGenerator.generate(this, this.worldObj, var1, var2, var3); +- this.ravineGenerator.generate(this, this.worldObj, var1, var2, var3); +- if(this.mapFeaturesEnabled) { +- this.mineshaftGenerator.generate(this, this.worldObj, var1, var2, var3); +- this.villageGenerator.generate(this, this.worldObj, var1, var2, var3); +- this.strongholdGenerator.generate(this, this.worldObj, var1, var2, var3); +- this.scatteredFeatureGenerator.generate(this, this.worldObj, var1, var2, var3); ++ } ++ ++ /** ++ * loads or generates the chunk at the chunk location specified ++ */ ++ public Chunk loadChunk(int par1, int par2) { ++ return this.provideChunk(par1, par2); ++ } ++ ++ /** ++ * Will return back a chunk, if it doesn't exist and its not a MP client it will generates all the blocks for the ++ * specified chunk from the map seed and chunk seed ++ */ ++ public Chunk provideChunk(int par1, int par2) { ++ this.rand.setSeed((long)par1 * 341873128712L + (long)par2 * 132897987541L); ++ byte[] var3 = new byte[32768]; ++ this.generateTerrain(par1, par2, var3); ++ this.biomesForGeneration = this.worldObj.getWorldChunkManager().loadBlockGeneratorData(this.biomesForGeneration, par1 * 16, par2 * 16, 16, 16); ++ this.replaceBlocksForBiome(par1, par2, var3, this.biomesForGeneration); ++ this.caveGenerator.generate(this, this.worldObj, par1, par2, var3); ++ this.ravineGenerator.generate(this, this.worldObj, par1, par2, var3); ++ ++ if (this.mapFeaturesEnabled) { ++ this.mineshaftGenerator.generate(this, this.worldObj, par1, par2, var3); ++ this.villageGenerator.generate(this, this.worldObj, par1, par2, var3); ++ this.strongholdGenerator.generate(this, this.worldObj, par1, par2, var3); ++ this.scatteredFeatureGenerator.generate(this, this.worldObj, par1, par2, var3); + } + +- Chunk var4 = new Chunk(this.worldObj, var3, var1, var2); ++ Chunk var4 = new Chunk(this.worldObj, var3, par1, par2); + byte[] var5 = var4.getBiomeArray(); + +- for(int var6 = 0; var6 < var5.length; ++var6) { ++ for (int var6 = 0; var6 < var5.length; ++var6) { + var5[var6] = (byte)this.biomesForGeneration[var6].biomeID; + } + +@@ -203,46 +260,52 @@ + return var4; + } + +- private double[] initializeNoiseField(double[] var1, int var2, int var3, int var4, int var5, int var6, int var7) { +- if(var1 == null) { +- var1 = new double[var5 * var6 * var7]; ++ /** ++ * generates a subset of the level's terrain data. Takes 7 arguments: the [empty] noise array, the position, and the ++ * size. ++ */ ++ private double[] initializeNoiseField(double[] par1ArrayOfDouble, int par2, int par3, int par4, int par5, int par6, int par7) { ++ if (par1ArrayOfDouble == null) { ++ par1ArrayOfDouble = new double[par5 * par6 * par7]; + } + +- if(this.parabolicField == null) { ++ if (this.parabolicField == null) { + this.parabolicField = new float[25]; + +- for(int var8 = -2; var8 <= 2; ++var8) { +- for(int var9 = -2; var9 <= 2; ++var9) { ++ for (int var8 = -2; var8 <= 2; ++var8) { ++ for (int var9 = -2; var9 <= 2; ++var9) { + float var10 = 10.0F / MathHelper.sqrt_float((float)(var8 * var8 + var9 * var9) + 0.2F); + this.parabolicField[var8 + 2 + (var9 + 2) * 5] = var10; + } + } + } + +- double var43 = 684.412D; + double var44 = 684.412D; +- this.noise5 = this.noiseGen5.generateNoiseOctaves(this.noise5, var2, var4, var5, var7, 1.121D, 1.121D, 0.5D); +- this.noise6 = this.noiseGen6.generateNoiseOctaves(this.noise6, var2, var4, var5, var7, 200.0D, 200.0D, 0.5D); +- this.noise3 = this.noiseGen3.generateNoiseOctaves(this.noise3, var2, var3, var4, var5, var6, var7, var43 / 80.0D, var44 / 160.0D, var43 / 80.0D); +- this.noise1 = this.noiseGen1.generateNoiseOctaves(this.noise1, var2, var3, var4, var5, var6, var7, var43, var44, var43); +- this.noise2 = this.noiseGen2.generateNoiseOctaves(this.noise2, var2, var3, var4, var5, var6, var7, var43, var44, var43); ++ double var45 = 684.412D; ++ this.noise5 = this.noiseGen5.generateNoiseOctaves(this.noise5, par2, par4, par5, par7, 1.121D, 1.121D, 0.5D); ++ this.noise6 = this.noiseGen6.generateNoiseOctaves(this.noise6, par2, par4, par5, par7, 200.0D, 200.0D, 0.5D); ++ this.noise3 = this.noiseGen3.generateNoiseOctaves(this.noise3, par2, par3, par4, par5, par6, par7, var44 / 80.0D, var45 / 160.0D, var44 / 80.0D); ++ this.noise1 = this.noiseGen1.generateNoiseOctaves(this.noise1, par2, par3, par4, par5, par6, par7, var44, var45, var44); ++ this.noise2 = this.noiseGen2.generateNoiseOctaves(this.noise2, par2, par3, par4, par5, par6, par7, var44, var45, var44); ++ boolean var43 = false; + boolean var42 = false; + int var12 = 0; + int var13 = 0; + +- for(int var14 = 0; var14 < var5; ++var14) { +- for(int var15 = 0; var15 < var7; ++var15) { ++ for (int var14 = 0; var14 < par5; ++var14) { ++ for (int var15 = 0; var15 < par7; ++var15) { + float var16 = 0.0F; + float var17 = 0.0F; + float var18 = 0.0F; + byte var19 = 2; +- BiomeGenBase var20 = this.biomesForGeneration[var14 + 2 + (var15 + 2) * (var5 + 5)]; ++ BiomeGenBase var20 = this.biomesForGeneration[var14 + 2 + (var15 + 2) * (par5 + 5)]; + +- for(int var21 = -var19; var21 <= var19; ++var21) { +- for(int var22 = -var19; var22 <= var19; ++var22) { +- BiomeGenBase var23 = this.biomesForGeneration[var14 + var21 + 2 + (var15 + var22 + 2) * (var5 + 5)]; ++ for (int var21 = -var19; var21 <= var19; ++var21) { ++ for (int var22 = -var19; var22 <= var19; ++var22) { ++ BiomeGenBase var23 = this.biomesForGeneration[var14 + var21 + 2 + (var15 + var22 + 2) * (par5 + 5)]; + float var24 = this.parabolicField[var21 + 2 + (var22 + 2) * 5] / (var23.minHeight + 2.0F); +- if(var23.minHeight > var20.minHeight) { ++ ++ if (var23.minHeight > var20.minHeight) { + var24 /= 2.0F; + } + +@@ -256,128 +319,144 @@ + var17 /= var18; + var16 = var16 * 0.9F + 0.1F; + var17 = (var17 * 4.0F - 1.0F) / 8.0F; +- double var45 = this.noise6[var13] / 8000.0D; +- if(var45 < 0.0D) { +- var45 = -var45 * 0.3D; ++ double var46 = this.noise6[var13] / 8000.0D; ++ ++ if (var46 < 0.0D) { ++ var46 = -var46 * 0.3D; + } + +- var45 = var45 * 3.0D - 2.0D; +- if(var45 < 0.0D) { +- var45 /= 2.0D; +- if(var45 < -1.0D) { +- var45 = -1.0D; ++ var46 = var46 * 3.0D - 2.0D; ++ ++ if (var46 < 0.0D) { ++ var46 /= 2.0D; ++ ++ if (var46 < -1.0D) { ++ var46 = -1.0D; + } + +- var45 /= 1.4D; +- var45 /= 2.0D; ++ var46 /= 1.4D; ++ var46 /= 2.0D; + } else { +- if(var45 > 1.0D) { +- var45 = 1.0D; ++ if (var46 > 1.0D) { ++ var46 = 1.0D; + } + +- var45 /= 8.0D; ++ var46 /= 8.0D; + } + + ++var13; + +- for(int var46 = 0; var46 < var6; ++var46) { +- double var47 = (double)var17; ++ for (int var47 = 0; var47 < par6; ++var47) { ++ double var48 = (double)var17; + double var26 = (double)var16; +- var47 += var45 * 0.2D; +- var47 = var47 * (double)var6 / 16.0D; +- double var28 = (double)var6 / 2.0D + var47 * 4.0D; ++ var48 += var46 * 0.2D; ++ var48 = var48 * (double)par6 / 16.0D; ++ double var28 = (double)par6 / 2.0D + var48 * 4.0D; + double var30 = 0.0D; +- double var32 = ((double)var46 - var28) * 12.0D * 128.0D / 128.0D / var26; +- if(var32 < 0.0D) { ++ double var32 = ((double)var47 - var28) * 12.0D * 128.0D / 128.0D / var26; ++ ++ if (var32 < 0.0D) { + var32 *= 4.0D; + } + + double var34 = this.noise1[var12] / 512.0D; + double var36 = this.noise2[var12] / 512.0D; + double var38 = (this.noise3[var12] / 10.0D + 1.0D) / 2.0D; +- if(var38 < 0.0D) { ++ ++ if (var38 < 0.0D) { + var30 = var34; +- } else if(var38 > 1.0D) { ++ } else if (var38 > 1.0D) { + var30 = var36; + } else { + var30 = var34 + (var36 - var34) * var38; + } + + var30 -= var32; +- if(var46 > var6 - 4) { +- double var40 = (double)((float)(var46 - (var6 - 4)) / 3.0F); ++ ++ if (var47 > par6 - 4) { ++ double var40 = (double)((float)(var47 - (par6 - 4)) / 3.0F); + var30 = var30 * (1.0D - var40) + -10.0D * var40; + } + +- var1[var12] = var30; ++ par1ArrayOfDouble[var12] = var30; + ++var12; + } + } + } + +- return var1; ++ return par1ArrayOfDouble; + } + +- public boolean chunkExists(int var1, int var2) { ++ /** ++ * Checks to see if a chunk exists at x, y ++ */ ++ public boolean chunkExists(int par1, int par2) { + return true; + } + +- public void populate(IChunkProvider var1, int var2, int var3) { ++ /** ++ * Populates chunk with ores etc etc ++ */ ++ public void populate(IChunkProvider par1IChunkProvider, int par2, int par3) { + BlockSand.fallInstantly = true; +- int var4 = var2 * 16; +- int var5 = var3 * 16; ++ int var4 = par2 * 16; ++ int var5 = par3 * 16; + BiomeGenBase var6 = this.worldObj.getBiomeGenForCoords(var4 + 16, var5 + 16); +- this.k.setSeed(this.worldObj.getSeed()); +- long var7 = this.k.nextLong() / 2L * 2L + 1L; +- long var9 = this.k.nextLong() / 2L * 2L + 1L; +- this.k.setSeed((long)var2 * var7 + (long)var3 * var9 ^ this.worldObj.getSeed()); ++ this.rand.setSeed(this.worldObj.getSeed()); ++ long var7 = this.rand.nextLong() / 2L * 2L + 1L; ++ long var9 = this.rand.nextLong() / 2L * 2L + 1L; ++ this.rand.setSeed((long)par2 * var7 + (long)par3 * var9 ^ this.worldObj.getSeed()); + boolean var11 = false; +- if(this.mapFeaturesEnabled) { +- this.mineshaftGenerator.generateStructuresInChunk(this.worldObj, this.k, var2, var3); +- var11 = this.villageGenerator.generateStructuresInChunk(this.worldObj, this.k, var2, var3); +- this.strongholdGenerator.generateStructuresInChunk(this.worldObj, this.k, var2, var3); +- this.scatteredFeatureGenerator.generateStructuresInChunk(this.worldObj, this.k, var2, var3); ++ ++ if (this.mapFeaturesEnabled) { ++ this.mineshaftGenerator.generateStructuresInChunk(this.worldObj, this.rand, par2, par3); ++ var11 = this.villageGenerator.generateStructuresInChunk(this.worldObj, this.rand, par2, par3); ++ this.strongholdGenerator.generateStructuresInChunk(this.worldObj, this.rand, par2, par3); ++ this.scatteredFeatureGenerator.generateStructuresInChunk(this.worldObj, this.rand, par2, par3); + } + + int var12; + int var13; + int var14; +- if(var6 != BiomeGenBase.desert && var6 != BiomeGenBase.desertHills && !var11 && this.k.nextInt(4) == 0) { +- var12 = var4 + this.k.nextInt(16) + 8; +- var13 = this.k.nextInt(128); +- var14 = var5 + this.k.nextInt(16) + 8; +- (new WorldGenLakes(Block.waterStill.blockID)).generate(this.worldObj, this.k, var12, var13, var14); ++ ++ if (var6 != BiomeGenBase.desert && var6 != BiomeGenBase.desertHills && !var11 && this.rand.nextInt(4) == 0) { ++ var12 = var4 + this.rand.nextInt(16) + 8; ++ var13 = this.rand.nextInt(128); ++ var14 = var5 + this.rand.nextInt(16) + 8; ++ (new WorldGenLakes(Block.waterStill.blockID)).generate(this.worldObj, this.rand, var12, var13, var14); + } + +- if(!var11 && this.k.nextInt(8) == 0) { +- var12 = var4 + this.k.nextInt(16) + 8; +- var13 = this.k.nextInt(this.k.nextInt(120) + 8); +- var14 = var5 + this.k.nextInt(16) + 8; +- if(var13 < 63 || this.k.nextInt(10) == 0) { +- (new WorldGenLakes(Block.lavaStill.blockID)).generate(this.worldObj, this.k, var12, var13, var14); ++ if (!var11 && this.rand.nextInt(8) == 0) { ++ var12 = var4 + this.rand.nextInt(16) + 8; ++ var13 = this.rand.nextInt(this.rand.nextInt(120) + 8); ++ var14 = var5 + this.rand.nextInt(16) + 8; ++ ++ if (var13 < 63 || this.rand.nextInt(10) == 0) { ++ (new WorldGenLakes(Block.lavaStill.blockID)).generate(this.worldObj, this.rand, var12, var13, var14); + } + } + +- for(var12 = 0; var12 < 8; ++var12) { +- var13 = var4 + this.k.nextInt(16) + 8; +- var14 = this.k.nextInt(128); +- int var15 = var5 + this.k.nextInt(16) + 8; +- (new WorldGenDungeons()).generate(this.worldObj, this.k, var13, var14, var15); ++ for (var12 = 0; var12 < 8; ++var12) { ++ var13 = var4 + this.rand.nextInt(16) + 8; ++ var14 = this.rand.nextInt(128); ++ int var15 = var5 + this.rand.nextInt(16) + 8; ++ (new WorldGenDungeons()).generate(this.worldObj, this.rand, var13, var14, var15); + } + +- var6.decorate(this.worldObj, this.k, var4, var5); +- SpawnerAnimals.performWorldGenSpawning(this.worldObj, var6, var4 + 8, var5 + 8, 16, 16, this.k); ++ var6.decorate(this.worldObj, this.rand, var4, var5); ++ SpawnerAnimals.performWorldGenSpawning(this.worldObj, var6, var4 + 8, var5 + 8, 16, 16, this.rand); + var4 += 8; + var5 += 8; + +- for(var12 = 0; var12 < 16; ++var12) { +- for(var13 = 0; var13 < 16; ++var13) { ++ for (var12 = 0; var12 < 16; ++var12) { ++ for (var13 = 0; var13 < 16; ++var13) { + var14 = this.worldObj.getPrecipitationHeight(var4 + var12, var5 + var13); +- if(this.worldObj.isBlockFreezable(var12 + var4, var14 - 1, var13 + var5)) { ++ ++ if (this.worldObj.isBlockFreezable(var12 + var4, var14 - 1, var13 + var5)) { + this.worldObj.setBlock(var12 + var4, var14 - 1, var13 + var5, Block.ice.blockID, 0, 2); + } + +- if(this.worldObj.canSnowAt(var12 + var4, var14, var13 + var5)) { ++ if (this.worldObj.canSnowAt(var12 + var4, var14, var13 + var5)) { + this.worldObj.setBlock(var12 + var4, var14, var13 + var5, Block.snow.blockID, 0, 2); + } + } +@@ -386,45 +465,66 @@ + BlockSand.fallInstantly = false; + } + +- public boolean saveChunks(boolean var1, IProgressUpdate var2) { ++ /** ++ * Two modes of operation: if passed true, save all Chunks in one go. If passed false, save up to two chunks. Return ++ * true if all chunks have been saved. ++ */ ++ public boolean saveChunks(boolean par1, IProgressUpdate par2IProgressUpdate) { + return true; + } + +- public void saveExtraData() { +- } ++ /** ++ * Save extra data not associated with any Chunk. Not saved during autosave, only during world unload. Currently ++ * unimplemented. ++ */ ++ public void saveExtraData() {} + ++ /** ++ * Unloads chunks that are marked to be unloaded. This is not guaranteed to unload every such chunk. ++ */ + public boolean unloadQueuedChunks() { + return false; + } + ++ /** ++ * Returns if the IChunkProvider supports saving. ++ */ + public boolean canSave() { + return true; + } + ++ /** ++ * Converts the instance data to a readable string. ++ */ + public String makeString() { + return "RandomLevelSource"; + } + +- public List getPossibleCreatures(EnumCreatureType var1, int var2, int var3, int var4) { +- BiomeGenBase var5 = this.worldObj.getBiomeGenForCoords(var2, var4); +- return var5 == null ? null : (var1 == EnumCreatureType.monster && this.scatteredFeatureGenerator.func_143030_a(var2, var3, var4) ? this.scatteredFeatureGenerator.getScatteredFeatureSpawnList() : var5.getSpawnableList(var1)); ++ /** ++ * Returns a list of creatures of the specified type that can spawn at the given location. ++ */ ++ public List getPossibleCreatures(EnumCreatureType par1EnumCreatureType, int par2, int par3, int par4) { ++ BiomeGenBase var5 = this.worldObj.getBiomeGenForCoords(par2, par4); ++ return var5 == null ? null : (par1EnumCreatureType == EnumCreatureType.monster && this.scatteredFeatureGenerator.func_143030_a(par2, par3, par4) ? this.scatteredFeatureGenerator.getScatteredFeatureSpawnList() : var5.getSpawnableList(par1EnumCreatureType)); + } + +- public ChunkPosition findClosestStructure(World var1, String var2, int var3, int var4, int var5) { +- return "Stronghold".equals(var2) && this.strongholdGenerator != null ? this.strongholdGenerator.getNearestInstance(var1, var3, var4, var5) : null; ++ /** ++ * Returns the location of the closest structure of the specified type. If not found returns null. ++ */ ++ public ChunkPosition findClosestStructure(World par1World, String par2Str, int par3, int par4, int par5) { ++ return "Stronghold".equals(par2Str) && this.strongholdGenerator != null ? this.strongholdGenerator.getNearestInstance(par1World, par3, par4, par5) : null; + } + + public int getLoadedChunkCount() { + return 0; + } + +- public void recreateStructures(int var1, int var2) { +- if(this.mapFeaturesEnabled) { +- this.mineshaftGenerator.generate(this, this.worldObj, var1, var2, (byte[])null); +- this.villageGenerator.generate(this, this.worldObj, var1, var2, (byte[])null); +- this.strongholdGenerator.generate(this, this.worldObj, var1, var2, (byte[])null); +- this.scatteredFeatureGenerator.generate(this, this.worldObj, var1, var2, (byte[])null); ++ public void recreateStructures(int par1, int par2) { ++ if (this.mapFeaturesEnabled) { ++ this.mineshaftGenerator.generate(this, this.worldObj, par1, par2, (byte[])null); ++ this.villageGenerator.generate(this, this.worldObj, par1, par2, (byte[])null); ++ this.strongholdGenerator.generate(this, this.worldObj, par1, par2, (byte[])null); ++ this.scatteredFeatureGenerator.generate(this, this.worldObj, par1, par2, (byte[])null); + } +- + } + } diff --git a/patches/net/minecraft/src/ChunkProviderHell.java.patch b/patches/net/minecraft/src/ChunkProviderHell.java.patch new file mode 100644 index 0000000..f15fe30 --- /dev/null +++ b/patches/net/minecraft/src/ChunkProviderHell.java.patch @@ -0,0 +1,667 @@ +--- net/minecraft/src/ChunkProviderHell.java ++++ net/minecraft/src/ChunkProviderHell.java +@@ -4,19 +4,37 @@ + import java.util.Random; + + public class ChunkProviderHell implements IChunkProvider { +- private Random i; ++ private Random hellRNG; ++ ++ /** A NoiseGeneratorOctaves used in generating nether terrain */ + private NoiseGeneratorOctaves netherNoiseGen1; + private NoiseGeneratorOctaves netherNoiseGen2; + private NoiseGeneratorOctaves netherNoiseGen3; ++ ++ /** Determines whether slowsand or gravel can be generated at a location */ + private NoiseGeneratorOctaves slowsandGravelNoiseGen; ++ ++ /** ++ * Determines whether something other than nettherack can be generated at a location ++ */ + private NoiseGeneratorOctaves netherrackExculsivityNoiseGen; + public NoiseGeneratorOctaves netherNoiseGen6; + public NoiseGeneratorOctaves netherNoiseGen7; ++ ++ /** Is the world that the nether is getting generated. */ + private World worldObj; + private double[] noiseField; + public MapGenNetherBridge genNetherBridge = new MapGenNetherBridge(); ++ ++ /** ++ * Holds the noise used to determine whether slowsand can be generated at a location ++ */ + private double[] slowsandNoise = new double[256]; + private double[] gravelNoise = new double[256]; ++ ++ /** ++ * Holds the noise used to determine whether something other than netherrack can be generated at a location ++ */ + private double[] netherrackExclusivityNoise = new double[256]; + private MapGenBase netherCaveGenerator = new MapGenCavesHell(); + double[] noiseData1; +@@ -25,29 +43,32 @@ + double[] noiseData4; + double[] noiseData5; + +- public ChunkProviderHell(World var1, long var2) { +- this.worldObj = var1; +- this.i = new Random(var2); +- this.netherNoiseGen1 = new NoiseGeneratorOctaves(this.i, 16); +- this.netherNoiseGen2 = new NoiseGeneratorOctaves(this.i, 16); +- this.netherNoiseGen3 = new NoiseGeneratorOctaves(this.i, 8); +- this.slowsandGravelNoiseGen = new NoiseGeneratorOctaves(this.i, 4); +- this.netherrackExculsivityNoiseGen = new NoiseGeneratorOctaves(this.i, 4); +- this.netherNoiseGen6 = new NoiseGeneratorOctaves(this.i, 10); +- this.netherNoiseGen7 = new NoiseGeneratorOctaves(this.i, 16); ++ public ChunkProviderHell(World par1World, long par2) { ++ this.worldObj = par1World; ++ this.hellRNG = new Random(par2); ++ this.netherNoiseGen1 = new NoiseGeneratorOctaves(this.hellRNG, 16); ++ this.netherNoiseGen2 = new NoiseGeneratorOctaves(this.hellRNG, 16); ++ this.netherNoiseGen3 = new NoiseGeneratorOctaves(this.hellRNG, 8); ++ this.slowsandGravelNoiseGen = new NoiseGeneratorOctaves(this.hellRNG, 4); ++ this.netherrackExculsivityNoiseGen = new NoiseGeneratorOctaves(this.hellRNG, 4); ++ this.netherNoiseGen6 = new NoiseGeneratorOctaves(this.hellRNG, 10); ++ this.netherNoiseGen7 = new NoiseGeneratorOctaves(this.hellRNG, 16); + } + +- public void generateNetherTerrain(int var1, int var2, byte[] var3) { ++ /** ++ * Generates the shape of the terrain in the nether. ++ */ ++ public void generateNetherTerrain(int par1, int par2, byte[] par3ArrayOfByte) { + byte var4 = 4; + byte var5 = 32; + int var6 = var4 + 1; + byte var7 = 17; + int var8 = var4 + 1; +- this.noiseField = this.initializeNoiseField(this.noiseField, var1 * var4, 0, var2 * var4, var6, var7, var8); ++ this.noiseField = this.initializeNoiseField(this.noiseField, par1 * var4, 0, par2 * var4, var6, var7, var8); + +- for(int var9 = 0; var9 < var4; ++var9) { +- for(int var10 = 0; var10 < var4; ++var10) { +- for(int var11 = 0; var11 < 16; ++var11) { ++ for (int var9 = 0; var9 < var4; ++var9) { ++ for (int var10 = 0; var10 < var4; ++var10) { ++ for (int var11 = 0; var11 < 16; ++var11) { + double var12 = 0.125D; + double var14 = this.noiseField[((var9 + 0) * var8 + var10 + 0) * var7 + var11 + 0]; + double var16 = this.noiseField[((var9 + 0) * var8 + var10 + 1) * var7 + var11 + 0]; +@@ -58,31 +79,32 @@ + double var26 = (this.noiseField[((var9 + 1) * var8 + var10 + 0) * var7 + var11 + 1] - var18) * var12; + double var28 = (this.noiseField[((var9 + 1) * var8 + var10 + 1) * var7 + var11 + 1] - var20) * var12; + +- for(int var30 = 0; var30 < 8; ++var30) { ++ for (int var30 = 0; var30 < 8; ++var30) { + double var31 = 0.25D; + double var33 = var14; + double var35 = var16; + double var37 = (var18 - var14) * var31; + double var39 = (var20 - var16) * var31; + +- for(int var41 = 0; var41 < 4; ++var41) { ++ for (int var41 = 0; var41 < 4; ++var41) { + int var42 = var41 + var9 * 4 << 11 | 0 + var10 * 4 << 7 | var11 * 8 + var30; + short var43 = 128; + double var44 = 0.25D; + double var46 = var33; + double var48 = (var35 - var33) * var44; + +- for(int var50 = 0; var50 < 4; ++var50) { ++ for (int var50 = 0; var50 < 4; ++var50) { + int var51 = 0; +- if(var11 * 8 + var30 < var5) { ++ ++ if (var11 * 8 + var30 < var5) { + var51 = Block.lavaStill.blockID; + } + +- if(var46 > 0.0D) { ++ if (var46 > 0.0D) { + var51 = Block.netherrack.blockID; + } + +- var3[var42] = (byte)var51; ++ par3ArrayOfByte[var42] = (byte)var51; + var42 += var43; + var46 += var48; + } +@@ -99,96 +121,108 @@ + } + } + } +- + } + +- public void replaceBlocksForBiome(int var1, int var2, byte[] var3) { ++ /** ++ * name based on ChunkProviderGenerate ++ */ ++ public void replaceBlocksForBiome(int par1, int par2, byte[] par3ArrayOfByte) { + byte var4 = 64; +- double var5 = 1.0D / 32.0D; +- this.slowsandNoise = this.slowsandGravelNoiseGen.generateNoiseOctaves(this.slowsandNoise, var1 * 16, var2 * 16, 0, 16, 16, 1, var5, var5, 1.0D); +- this.gravelNoise = this.slowsandGravelNoiseGen.generateNoiseOctaves(this.gravelNoise, var1 * 16, 109, var2 * 16, 16, 1, 16, var5, 1.0D, var5); +- this.netherrackExclusivityNoise = this.netherrackExculsivityNoiseGen.generateNoiseOctaves(this.netherrackExclusivityNoise, var1 * 16, var2 * 16, 0, 16, 16, 1, var5 * 2.0D, var5 * 2.0D, var5 * 2.0D); ++ double var5 = 0.03125D; ++ this.slowsandNoise = this.slowsandGravelNoiseGen.generateNoiseOctaves(this.slowsandNoise, par1 * 16, par2 * 16, 0, 16, 16, 1, var5, var5, 1.0D); ++ this.gravelNoise = this.slowsandGravelNoiseGen.generateNoiseOctaves(this.gravelNoise, par1 * 16, 109, par2 * 16, 16, 1, 16, var5, 1.0D, var5); ++ this.netherrackExclusivityNoise = this.netherrackExculsivityNoiseGen.generateNoiseOctaves(this.netherrackExclusivityNoise, par1 * 16, par2 * 16, 0, 16, 16, 1, var5 * 2.0D, var5 * 2.0D, var5 * 2.0D); + +- for(int var7 = 0; var7 < 16; ++var7) { +- for(int var8 = 0; var8 < 16; ++var8) { +- boolean var9 = this.slowsandNoise[var7 + var8 * 16] + this.i.nextDouble() * 0.2D > 0.0D; +- boolean var10 = this.gravelNoise[var7 + var8 * 16] + this.i.nextDouble() * 0.2D > 0.0D; +- int var11 = (int)(this.netherrackExclusivityNoise[var7 + var8 * 16] / 3.0D + 3.0D + this.i.nextDouble() * 0.25D); ++ for (int var7 = 0; var7 < 16; ++var7) { ++ for (int var8 = 0; var8 < 16; ++var8) { ++ boolean var9 = this.slowsandNoise[var7 + var8 * 16] + this.hellRNG.nextDouble() * 0.2D > 0.0D; ++ boolean var10 = this.gravelNoise[var7 + var8 * 16] + this.hellRNG.nextDouble() * 0.2D > 0.0D; ++ int var11 = (int)(this.netherrackExclusivityNoise[var7 + var8 * 16] / 3.0D + 3.0D + this.hellRNG.nextDouble() * 0.25D); + int var12 = -1; + byte var13 = (byte)Block.netherrack.blockID; + byte var14 = (byte)Block.netherrack.blockID; + +- for(int var15 = 127; var15 >= 0; --var15) { ++ for (int var15 = 127; var15 >= 0; --var15) { + int var16 = (var8 * 16 + var7) * 128 + var15; +- if(var15 < 127 - this.i.nextInt(5) && var15 > 0 + this.i.nextInt(5)) { +- byte var17 = var3[var16]; +- if(var17 == 0) { ++ ++ if (var15 < 127 - this.hellRNG.nextInt(5) && var15 > 0 + this.hellRNG.nextInt(5)) { ++ byte var17 = par3ArrayOfByte[var16]; ++ ++ if (var17 == 0) { + var12 = -1; +- } else if(var17 == Block.netherrack.blockID) { +- if(var12 == -1) { +- if(var11 <= 0) { ++ } else if (var17 == Block.netherrack.blockID) { ++ if (var12 == -1) { ++ if (var11 <= 0) { + var13 = 0; + var14 = (byte)Block.netherrack.blockID; +- } else if(var15 >= var4 - 4 && var15 <= var4 + 1) { ++ } else if (var15 >= var4 - 4 && var15 <= var4 + 1) { + var13 = (byte)Block.netherrack.blockID; + var14 = (byte)Block.netherrack.blockID; +- if(var10) { ++ ++ if (var10) { + var13 = (byte)Block.gravel.blockID; + } + +- if(var10) { ++ if (var10) { + var14 = (byte)Block.netherrack.blockID; + } + +- if(var9) { ++ if (var9) { + var13 = (byte)Block.slowSand.blockID; + } + +- if(var9) { ++ if (var9) { + var14 = (byte)Block.slowSand.blockID; + } + } + +- if(var15 < var4 && var13 == 0) { ++ if (var15 < var4 && var13 == 0) { + var13 = (byte)Block.lavaStill.blockID; + } + + var12 = var11; +- if(var15 >= var4 - 1) { +- var3[var16] = var13; ++ ++ if (var15 >= var4 - 1) { ++ par3ArrayOfByte[var16] = var13; + } else { +- var3[var16] = var14; ++ par3ArrayOfByte[var16] = var14; + } +- } else if(var12 > 0) { ++ } else if (var12 > 0) { + --var12; +- var3[var16] = var14; ++ par3ArrayOfByte[var16] = var14; + } + } + } else { +- var3[var16] = (byte)Block.bedrock.blockID; ++ par3ArrayOfByte[var16] = (byte)Block.bedrock.blockID; + } + } + } + } +- +- } +- +- public Chunk loadChunk(int var1, int var2) { +- return this.provideChunk(var1, var2); +- } +- +- public Chunk provideChunk(int var1, int var2) { +- this.i.setSeed((long)var1 * 341873128712L + (long)var2 * 132897987541L); +- byte[] var3 = new byte[-Short.MIN_VALUE]; +- this.generateNetherTerrain(var1, var2, var3); +- this.replaceBlocksForBiome(var1, var2, var3); +- this.netherCaveGenerator.generate(this, this.worldObj, var1, var2, var3); +- this.genNetherBridge.generate(this, this.worldObj, var1, var2, var3); +- Chunk var4 = new Chunk(this.worldObj, var3, var1, var2); +- BiomeGenBase[] var5 = this.worldObj.getWorldChunkManager().loadBlockGeneratorData((BiomeGenBase[])null, var1 * 16, var2 * 16, 16, 16); ++ } ++ ++ /** ++ * loads or generates the chunk at the chunk location specified ++ */ ++ public Chunk loadChunk(int par1, int par2) { ++ return this.provideChunk(par1, par2); ++ } ++ ++ /** ++ * Will return back a chunk, if it doesn't exist and its not a MP client it will generates all the blocks for the ++ * specified chunk from the map seed and chunk seed ++ */ ++ public Chunk provideChunk(int par1, int par2) { ++ this.hellRNG.setSeed((long)par1 * 341873128712L + (long)par2 * 132897987541L); ++ byte[] var3 = new byte[32768]; ++ this.generateNetherTerrain(par1, par2, var3); ++ this.replaceBlocksForBiome(par1, par2, var3); ++ this.netherCaveGenerator.generate(this, this.worldObj, par1, par2, var3); ++ this.genNetherBridge.generate(this, this.worldObj, par1, par2, var3); ++ Chunk var4 = new Chunk(this.worldObj, var3, par1, par2); ++ BiomeGenBase[] var5 = this.worldObj.getWorldChunkManager().loadBlockGeneratorData((BiomeGenBase[])null, par1 * 16, par2 * 16, 16, 16); + byte[] var6 = var4.getBiomeArray(); + +- for(int var7 = 0; var7 < var6.length; ++var7) { ++ for (int var7 = 0; var7 < var6.length; ++var7) { + var6[var7] = (byte)var5[var7].biomeID; + } + +@@ -196,53 +230,62 @@ + return var4; + } + +- private double[] initializeNoiseField(double[] var1, int var2, int var3, int var4, int var5, int var6, int var7) { +- if(var1 == null) { +- var1 = new double[var5 * var6 * var7]; ++ /** ++ * generates a subset of the level's terrain data. Takes 7 arguments: the [empty] noise array, the position, and the ++ * size. ++ */ ++ private double[] initializeNoiseField(double[] par1ArrayOfDouble, int par2, int par3, int par4, int par5, int par6, int par7) { ++ if (par1ArrayOfDouble == null) { ++ par1ArrayOfDouble = new double[par5 * par6 * par7]; + } + + double var8 = 684.412D; + double var10 = 2053.236D; +- this.noiseData4 = this.netherNoiseGen6.generateNoiseOctaves(this.noiseData4, var2, var3, var4, var5, 1, var7, 1.0D, 0.0D, 1.0D); +- this.noiseData5 = this.netherNoiseGen7.generateNoiseOctaves(this.noiseData5, var2, var3, var4, var5, 1, var7, 100.0D, 0.0D, 100.0D); +- this.noiseData1 = this.netherNoiseGen3.generateNoiseOctaves(this.noiseData1, var2, var3, var4, var5, var6, var7, var8 / 80.0D, var10 / 60.0D, var8 / 80.0D); +- this.noiseData2 = this.netherNoiseGen1.generateNoiseOctaves(this.noiseData2, var2, var3, var4, var5, var6, var7, var8, var10, var8); +- this.noiseData3 = this.netherNoiseGen2.generateNoiseOctaves(this.noiseData3, var2, var3, var4, var5, var6, var7, var8, var10, var8); ++ this.noiseData4 = this.netherNoiseGen6.generateNoiseOctaves(this.noiseData4, par2, par3, par4, par5, 1, par7, 1.0D, 0.0D, 1.0D); ++ this.noiseData5 = this.netherNoiseGen7.generateNoiseOctaves(this.noiseData5, par2, par3, par4, par5, 1, par7, 100.0D, 0.0D, 100.0D); ++ this.noiseData1 = this.netherNoiseGen3.generateNoiseOctaves(this.noiseData1, par2, par3, par4, par5, par6, par7, var8 / 80.0D, var10 / 60.0D, var8 / 80.0D); ++ this.noiseData2 = this.netherNoiseGen1.generateNoiseOctaves(this.noiseData2, par2, par3, par4, par5, par6, par7, var8, var10, var8); ++ this.noiseData3 = this.netherNoiseGen2.generateNoiseOctaves(this.noiseData3, par2, par3, par4, par5, par6, par7, var8, var10, var8); + int var12 = 0; + int var13 = 0; +- double[] var14 = new double[var6]; +- ++ double[] var14 = new double[par6]; + int var15; +- for(var15 = 0; var15 < var6; ++var15) { +- var14[var15] = Math.cos((double)var15 * Math.PI * 6.0D / (double)var6) * 2.0D; ++ ++ for (var15 = 0; var15 < par6; ++var15) { ++ var14[var15] = Math.cos((double)var15 * Math.PI * 6.0D / (double)par6) * 2.0D; + double var16 = (double)var15; +- if(var15 > var6 / 2) { +- var16 = (double)(var6 - 1 - var15); ++ ++ if (var15 > par6 / 2) { ++ var16 = (double)(par6 - 1 - var15); + } + +- if(var16 < 4.0D) { ++ if (var16 < 4.0D) { + var16 = 4.0D - var16; + var14[var15] -= var16 * var16 * var16 * 10.0D; + } + } + +- for(var15 = 0; var15 < var5; ++var15) { +- for(int var36 = 0; var36 < var7; ++var36) { ++ for (var15 = 0; var15 < par5; ++var15) { ++ for (int var36 = 0; var36 < par7; ++var36) { + double var17 = (this.noiseData4[var13] + 256.0D) / 512.0D; +- if(var17 > 1.0D) { ++ ++ if (var17 > 1.0D) { + var17 = 1.0D; + } + + double var19 = 0.0D; + double var21 = this.noiseData5[var13] / 8000.0D; +- if(var21 < 0.0D) { ++ ++ if (var21 < 0.0D) { + var21 = -var21; + } + + var21 = var21 * 3.0D - 3.0D; +- if(var21 < 0.0D) { ++ ++ if (var21 < 0.0D) { + var21 /= 2.0D; +- if(var21 < -1.0D) { ++ ++ if (var21 < -1.0D) { + var21 = -1.0D; + } + +@@ -250,7 +293,7 @@ + var21 /= 2.0D; + var17 = 0.0D; + } else { +- if(var21 > 1.0D) { ++ if (var21 > 1.0D) { + var21 = 1.0D; + } + +@@ -258,18 +301,19 @@ + } + + var17 += 0.5D; +- var21 = var21 * (double)var6 / 16.0D; ++ var21 = var21 * (double)par6 / 16.0D; + ++var13; + +- for(int var23 = 0; var23 < var6; ++var23) { ++ for (int var23 = 0; var23 < par6; ++var23) { + double var24 = 0.0D; + double var26 = var14[var23]; + double var28 = this.noiseData2[var12] / 512.0D; + double var30 = this.noiseData3[var12] / 512.0D; + double var32 = (this.noiseData1[var12] / 10.0D + 1.0D) / 2.0D; +- if(var32 < 0.0D) { ++ ++ if (var32 < 0.0D) { + var24 = var28; +- } else if(var32 > 1.0D) { ++ } else if (var32 > 1.0D) { + var24 = var30; + } else { + var24 = var28 + (var30 - var28) * var32; +@@ -277,149 +321,179 @@ + + var24 -= var26; + double var34; +- if(var23 > var6 - 4) { +- var34 = (double)((float)(var23 - (var6 - 4)) / 3.0F); ++ ++ if (var23 > par6 - 4) { ++ var34 = (double)((float)(var23 - (par6 - 4)) / 3.0F); + var24 = var24 * (1.0D - var34) + -10.0D * var34; + } + +- if((double)var23 < var19) { ++ if ((double)var23 < var19) { + var34 = (var19 - (double)var23) / 4.0D; +- if(var34 < 0.0D) { ++ ++ if (var34 < 0.0D) { + var34 = 0.0D; + } + +- if(var34 > 1.0D) { ++ if (var34 > 1.0D) { + var34 = 1.0D; + } + + var24 = var24 * (1.0D - var34) + -10.0D * var34; + } + +- var1[var12] = var24; ++ par1ArrayOfDouble[var12] = var24; + ++var12; + } + } + } + +- return var1; ++ return par1ArrayOfDouble; + } + +- public boolean chunkExists(int var1, int var2) { ++ /** ++ * Checks to see if a chunk exists at x, y ++ */ ++ public boolean chunkExists(int par1, int par2) { + return true; + } + +- public void populate(IChunkProvider var1, int var2, int var3) { ++ /** ++ * Populates chunk with ores etc etc ++ */ ++ public void populate(IChunkProvider par1IChunkProvider, int par2, int par3) { + BlockSand.fallInstantly = true; +- int var4 = var2 * 16; +- int var5 = var3 * 16; +- this.genNetherBridge.generateStructuresInChunk(this.worldObj, this.i, var2, var3); +- ++ int var4 = par2 * 16; ++ int var5 = par3 * 16; ++ this.genNetherBridge.generateStructuresInChunk(this.worldObj, this.hellRNG, par2, par3); + int var6; + int var7; + int var8; + int var9; +- for(var6 = 0; var6 < 8; ++var6) { +- var7 = var4 + this.i.nextInt(16) + 8; +- var8 = this.i.nextInt(120) + 4; +- var9 = var5 + this.i.nextInt(16) + 8; +- (new WorldGenHellLava(Block.lavaMoving.blockID, false)).generate(this.worldObj, this.i, var7, var8, var9); ++ ++ for (var6 = 0; var6 < 8; ++var6) { ++ var7 = var4 + this.hellRNG.nextInt(16) + 8; ++ var8 = this.hellRNG.nextInt(120) + 4; ++ var9 = var5 + this.hellRNG.nextInt(16) + 8; ++ (new WorldGenHellLava(Block.lavaMoving.blockID, false)).generate(this.worldObj, this.hellRNG, var7, var8, var9); + } + +- var6 = this.i.nextInt(this.i.nextInt(10) + 1) + 1; +- ++ var6 = this.hellRNG.nextInt(this.hellRNG.nextInt(10) + 1) + 1; + int var10; +- for(var7 = 0; var7 < var6; ++var7) { +- var8 = var4 + this.i.nextInt(16) + 8; +- var9 = this.i.nextInt(120) + 4; +- var10 = var5 + this.i.nextInt(16) + 8; +- (new WorldGenFire()).generate(this.worldObj, this.i, var8, var9, var10); +- } +- +- var6 = this.i.nextInt(this.i.nextInt(10) + 1); +- +- for(var7 = 0; var7 < var6; ++var7) { +- var8 = var4 + this.i.nextInt(16) + 8; +- var9 = this.i.nextInt(120) + 4; +- var10 = var5 + this.i.nextInt(16) + 8; +- (new WorldGenGlowStone1()).generate(this.worldObj, this.i, var8, var9, var10); +- } +- +- for(var7 = 0; var7 < 10; ++var7) { +- var8 = var4 + this.i.nextInt(16) + 8; +- var9 = this.i.nextInt(128); +- var10 = var5 + this.i.nextInt(16) + 8; +- (new WorldGenGlowStone2()).generate(this.worldObj, this.i, var8, var9, var10); +- } +- +- if(this.i.nextInt(1) == 0) { +- var7 = var4 + this.i.nextInt(16) + 8; +- var8 = this.i.nextInt(128); +- var9 = var5 + this.i.nextInt(16) + 8; +- (new WorldGenFlowers(Block.mushroomBrown.blockID)).generate(this.worldObj, this.i, var7, var8, var9); +- } +- +- if(this.i.nextInt(1) == 0) { +- var7 = var4 + this.i.nextInt(16) + 8; +- var8 = this.i.nextInt(128); +- var9 = var5 + this.i.nextInt(16) + 8; +- (new WorldGenFlowers(Block.mushroomRed.blockID)).generate(this.worldObj, this.i, var7, var8, var9); ++ ++ for (var7 = 0; var7 < var6; ++var7) { ++ var8 = var4 + this.hellRNG.nextInt(16) + 8; ++ var9 = this.hellRNG.nextInt(120) + 4; ++ var10 = var5 + this.hellRNG.nextInt(16) + 8; ++ (new WorldGenFire()).generate(this.worldObj, this.hellRNG, var8, var9, var10); ++ } ++ ++ var6 = this.hellRNG.nextInt(this.hellRNG.nextInt(10) + 1); ++ ++ for (var7 = 0; var7 < var6; ++var7) { ++ var8 = var4 + this.hellRNG.nextInt(16) + 8; ++ var9 = this.hellRNG.nextInt(120) + 4; ++ var10 = var5 + this.hellRNG.nextInt(16) + 8; ++ (new WorldGenGlowStone1()).generate(this.worldObj, this.hellRNG, var8, var9, var10); ++ } ++ ++ for (var7 = 0; var7 < 10; ++var7) { ++ var8 = var4 + this.hellRNG.nextInt(16) + 8; ++ var9 = this.hellRNG.nextInt(128); ++ var10 = var5 + this.hellRNG.nextInt(16) + 8; ++ (new WorldGenGlowStone2()).generate(this.worldObj, this.hellRNG, var8, var9, var10); ++ } ++ ++ if (this.hellRNG.nextInt(1) == 0) { ++ var7 = var4 + this.hellRNG.nextInt(16) + 8; ++ var8 = this.hellRNG.nextInt(128); ++ var9 = var5 + this.hellRNG.nextInt(16) + 8; ++ (new WorldGenFlowers(Block.mushroomBrown.blockID)).generate(this.worldObj, this.hellRNG, var7, var8, var9); ++ } ++ ++ if (this.hellRNG.nextInt(1) == 0) { ++ var7 = var4 + this.hellRNG.nextInt(16) + 8; ++ var8 = this.hellRNG.nextInt(128); ++ var9 = var5 + this.hellRNG.nextInt(16) + 8; ++ (new WorldGenFlowers(Block.mushroomRed.blockID)).generate(this.worldObj, this.hellRNG, var7, var8, var9); + } + + WorldGenMinable var12 = new WorldGenMinable(Block.oreNetherQuartz.blockID, 13, Block.netherrack.blockID); +- + int var11; +- for(var8 = 0; var8 < 16; ++var8) { +- var9 = var4 + this.i.nextInt(16); +- var10 = this.i.nextInt(108) + 10; +- var11 = var5 + this.i.nextInt(16); +- var12.generate(this.worldObj, this.i, var9, var10, var11); ++ ++ for (var8 = 0; var8 < 16; ++var8) { ++ var9 = var4 + this.hellRNG.nextInt(16); ++ var10 = this.hellRNG.nextInt(108) + 10; ++ var11 = var5 + this.hellRNG.nextInt(16); ++ var12.generate(this.worldObj, this.hellRNG, var9, var10, var11); + } + +- for(var8 = 0; var8 < 16; ++var8) { +- var9 = var4 + this.i.nextInt(16); +- var10 = this.i.nextInt(108) + 10; +- var11 = var5 + this.i.nextInt(16); +- (new WorldGenHellLava(Block.lavaMoving.blockID, true)).generate(this.worldObj, this.i, var9, var10, var11); ++ for (var8 = 0; var8 < 16; ++var8) { ++ var9 = var4 + this.hellRNG.nextInt(16); ++ var10 = this.hellRNG.nextInt(108) + 10; ++ var11 = var5 + this.hellRNG.nextInt(16); ++ (new WorldGenHellLava(Block.lavaMoving.blockID, true)).generate(this.worldObj, this.hellRNG, var9, var10, var11); + } + + BlockSand.fallInstantly = false; + } + +- public boolean saveChunks(boolean var1, IProgressUpdate var2) { ++ /** ++ * Two modes of operation: if passed true, save all Chunks in one go. If passed false, save up to two chunks. Return ++ * true if all chunks have been saved. ++ */ ++ public boolean saveChunks(boolean par1, IProgressUpdate par2IProgressUpdate) { + return true; + } + +- public void saveExtraData() { +- } ++ /** ++ * Save extra data not associated with any Chunk. Not saved during autosave, only during world unload. Currently ++ * unimplemented. ++ */ ++ public void saveExtraData() {} + ++ /** ++ * Unloads chunks that are marked to be unloaded. This is not guaranteed to unload every such chunk. ++ */ + public boolean unloadQueuedChunks() { + return false; + } + ++ /** ++ * Returns if the IChunkProvider supports saving. ++ */ + public boolean canSave() { + return true; + } + ++ /** ++ * Converts the instance data to a readable string. ++ */ + public String makeString() { + return "HellRandomLevelSource"; + } + +- public List getPossibleCreatures(EnumCreatureType var1, int var2, int var3, int var4) { +- if(var1 == EnumCreatureType.monster) { +- if(this.genNetherBridge.hasStructureAt(var2, var3, var4)) { ++ /** ++ * Returns a list of creatures of the specified type that can spawn at the given location. ++ */ ++ public List getPossibleCreatures(EnumCreatureType par1EnumCreatureType, int par2, int par3, int par4) { ++ if (par1EnumCreatureType == EnumCreatureType.monster) { ++ if (this.genNetherBridge.hasStructureAt(par2, par3, par4)) { + return this.genNetherBridge.getSpawnList(); + } + +- if(this.genNetherBridge.func_142038_b(var2, var3, var4) && this.worldObj.getBlockId(var2, var3 - 1, var4) == Block.netherBrick.blockID) { ++ if (this.genNetherBridge.func_142038_b(par2, par3, par4) && this.worldObj.getBlockId(par2, par3 - 1, par4) == Block.netherBrick.blockID) { + return this.genNetherBridge.getSpawnList(); + } + } + +- BiomeGenBase var5 = this.worldObj.getBiomeGenForCoords(var2, var4); +- return var5 == null ? null : var5.getSpawnableList(var1); ++ BiomeGenBase var5 = this.worldObj.getBiomeGenForCoords(par2, par4); ++ return var5 == null ? null : var5.getSpawnableList(par1EnumCreatureType); + } + +- public ChunkPosition findClosestStructure(World var1, String var2, int var3, int var4, int var5) { ++ /** ++ * Returns the location of the closest structure of the specified type. If not found returns null. ++ */ ++ public ChunkPosition findClosestStructure(World par1World, String par2Str, int par3, int par4, int par5) { + return null; + } + +@@ -427,7 +501,7 @@ + return 0; + } + +- public void recreateStructures(int var1, int var2) { +- this.genNetherBridge.generate(this, this.worldObj, var1, var2, (byte[])null); ++ public void recreateStructures(int par1, int par2) { ++ this.genNetherBridge.generate(this, this.worldObj, par1, par2, (byte[])null); + } + } diff --git a/patches/net/minecraft/src/ChunkProviderServer.java.patch b/patches/net/minecraft/src/ChunkProviderServer.java.patch new file mode 100644 index 0000000..97fb2d8 --- /dev/null +++ b/patches/net/minecraft/src/ChunkProviderServer.java.patch @@ -0,0 +1,390 @@ +--- net/minecraft/src/ChunkProviderServer.java ++++ net/minecraft/src/ChunkProviderServer.java +@@ -8,101 +8,134 @@ + import java.util.Set; + + public class ChunkProviderServer implements IChunkProvider { +- private Set b = new HashSet(); +- private Chunk dummyChunk; +- private IChunkProvider serverChunkGenerator; +- private IChunkLoader chunkLoader; +- public boolean chunkLoadOverride = true; +- private LongHashMap id2ChunkMap = new LongHashMap(); +- private List g = new ArrayList(); ++ ++ /** ++ * used by unload100OldestChunks to iterate the loadedChunkHashMap for unload (underlying assumption, first in, first ++ * out) ++ */ ++ private Set chunksToUnload = new HashSet(); ++ private Chunk defaultEmptyChunk; ++ private IChunkProvider currentChunkProvider; ++ private IChunkLoader currentChunkLoader; ++ ++ /** ++ * if this is false, the defaultEmptyChunk will be returned by the provider ++ */ ++ public boolean loadChunkOnProvideRequest = true; ++ private LongHashMap loadedChunkHashMap = new LongHashMap(); ++ private List loadedChunks = new ArrayList(); + private WorldServer worldObj; + +- public ChunkProviderServer(WorldServer var1, IChunkLoader var2, IChunkProvider var3) { +- this.dummyChunk = new EmptyChunk(var1, 0, 0); +- this.worldObj = var1; +- this.chunkLoader = var2; +- this.serverChunkGenerator = var3; +- } +- +- public boolean chunkExists(int var1, int var2) { +- return this.id2ChunkMap.containsItem(ChunkCoordIntPair.chunkXZ2Int(var1, var2)); +- } +- +- public void dropChunk(int var1, int var2) { +- if(this.worldObj.provider.canRespawnHere()) { ++ public ChunkProviderServer(WorldServer par1WorldServer, IChunkLoader par2IChunkLoader, IChunkProvider par3IChunkProvider) { ++ this.defaultEmptyChunk = new EmptyChunk(par1WorldServer, 0, 0); ++ this.worldObj = par1WorldServer; ++ this.currentChunkLoader = par2IChunkLoader; ++ this.currentChunkProvider = par3IChunkProvider; ++ } ++ ++ /** ++ * Checks to see if a chunk exists at x, y ++ */ ++ public boolean chunkExists(int par1, int par2) { ++ return this.loadedChunkHashMap.containsItem(ChunkCoordIntPair.chunkXZ2Int(par1, par2)); ++ } ++ ++ /** ++ * marks chunk for unload by "unload100OldestChunks" if there is no spawn point, or if the center of the chunk is ++ * outside 200 blocks (x or z) of the spawn ++ */ ++ public void unloadChunksIfNotNearSpawn(int par1, int par2) { ++ if (this.worldObj.provider.canRespawnHere()) { + ChunkCoordinates var3 = this.worldObj.getSpawnPoint(); +- int var4 = var1 * 16 + 8 - var3.posX; +- int var5 = var2 * 16 + 8 - var3.posZ; ++ int var4 = par1 * 16 + 8 - var3.posX; ++ int var5 = par2 * 16 + 8 - var3.posZ; + short var6 = 128; +- if(var4 < -var6 || var4 > var6 || var5 < -var6 || var5 > var6) { +- this.b.add(Long.valueOf(ChunkCoordIntPair.chunkXZ2Int(var1, var2))); ++ ++ if (var4 < -var6 || var4 > var6 || var5 < -var6 || var5 > var6) { ++ this.chunksToUnload.add(Long.valueOf(ChunkCoordIntPair.chunkXZ2Int(par1, par2))); + } + } else { +- this.b.add(Long.valueOf(ChunkCoordIntPair.chunkXZ2Int(var1, var2))); ++ this.chunksToUnload.add(Long.valueOf(ChunkCoordIntPair.chunkXZ2Int(par1, par2))); + } +- + } + ++ /** ++ * marks all chunks for unload, ignoring those near the spawn ++ */ + public void unloadAllChunks() { +- Iterator var1 = this.g.iterator(); ++ Iterator var1 = this.loadedChunks.iterator(); + +- while(var1.hasNext()) { ++ while (var1.hasNext()) { + Chunk var2 = (Chunk)var1.next(); +- this.dropChunk(var2.xPosition, var2.zPosition); ++ this.unloadChunksIfNotNearSpawn(var2.xPosition, var2.zPosition); + } +- + } + +- public Chunk loadChunk(int var1, int var2) { +- long var3 = ChunkCoordIntPair.chunkXZ2Int(var1, var2); +- this.b.remove(Long.valueOf(var3)); +- Chunk var5 = (Chunk)this.id2ChunkMap.getValueByKey(var3); +- if(var5 == null) { +- var5 = this.loadChunkFromFile(var1, var2); +- if(var5 == null) { +- if(this.serverChunkGenerator == null) { +- var5 = this.dummyChunk; ++ /** ++ * loads or generates the chunk at the chunk location specified ++ */ ++ public Chunk loadChunk(int par1, int par2) { ++ long var3 = ChunkCoordIntPair.chunkXZ2Int(par1, par2); ++ this.chunksToUnload.remove(Long.valueOf(var3)); ++ Chunk var5 = (Chunk)this.loadedChunkHashMap.getValueByKey(var3); ++ ++ if (var5 == null) { ++ var5 = this.safeLoadChunk(par1, par2); ++ ++ if (var5 == null) { ++ if (this.currentChunkProvider == null) { ++ var5 = this.defaultEmptyChunk; + } else { + try { +- var5 = this.serverChunkGenerator.provideChunk(var1, var2); ++ var5 = this.currentChunkProvider.provideChunk(par1, par2); + } catch (Throwable var9) { + CrashReport var7 = CrashReport.makeCrashReport(var9, "Exception generating new chunk"); + CrashReportCategory var8 = var7.makeCategory("Chunk to be generated"); +- var8.addCrashSection("Location", String.format("%d,%d", new Object[]{Integer.valueOf(var1), Integer.valueOf(var2)})); ++ var8.addCrashSection("Location", String.format("%d,%d", new Object[] {Integer.valueOf(par1), Integer.valueOf(par2)})); + var8.addCrashSection("Position hash", Long.valueOf(var3)); +- var8.addCrashSection("Generator", this.serverChunkGenerator.makeString()); ++ var8.addCrashSection("Generator", this.currentChunkProvider.makeString()); + throw new ReportedException(var7); + } + } + } + +- this.id2ChunkMap.add(var3, var5); +- this.g.add(var5); +- if(var5 != null) { ++ this.loadedChunkHashMap.add(var3, var5); ++ this.loadedChunks.add(var5); ++ ++ if (var5 != null) { + var5.onChunkLoad(); + } + +- var5.populateChunk(this, this, var1, var2); ++ var5.populateChunk(this, this, par1, par2); + } + + return var5; + } + +- public Chunk provideChunk(int var1, int var2) { +- Chunk var3 = (Chunk)this.id2ChunkMap.getValueByKey(ChunkCoordIntPair.chunkXZ2Int(var1, var2)); +- return var3 == null ? (!this.worldObj.findingSpawnPoint && !this.chunkLoadOverride ? this.dummyChunk : this.loadChunk(var1, var2)) : var3; ++ /** ++ * Will return back a chunk, if it doesn't exist and its not a MP client it will generates all the blocks for the ++ * specified chunk from the map seed and chunk seed ++ */ ++ public Chunk provideChunk(int par1, int par2) { ++ Chunk var3 = (Chunk)this.loadedChunkHashMap.getValueByKey(ChunkCoordIntPair.chunkXZ2Int(par1, par2)); ++ return var3 == null ? (!this.worldObj.findingSpawnPoint && !this.loadChunkOnProvideRequest ? this.defaultEmptyChunk : this.loadChunk(par1, par2)) : var3; + } + +- private Chunk loadChunkFromFile(int var1, int var2) { +- if(this.chunkLoader == null) { ++ /** ++ * used by loadChunk, but catches any exceptions if the load fails. ++ */ ++ private Chunk safeLoadChunk(int par1, int par2) { ++ if (this.currentChunkLoader == null) { + return null; + } else { + try { +- Chunk var3 = this.chunkLoader.loadChunk(this.worldObj, var1, var2); +- if(var3 != null) { ++ Chunk var3 = this.currentChunkLoader.loadChunk(this.worldObj, par1, par2); ++ ++ if (var3 != null) { + var3.lastSaveTime = this.worldObj.getTotalWorldTime(); +- if(this.serverChunkGenerator != null) { +- this.serverChunkGenerator.recreateStructures(var1, var2); ++ ++ if (this.currentChunkProvider != null) { ++ this.currentChunkProvider.recreateStructures(par1, par2); + } + } + +@@ -114,57 +147,71 @@ + } + } + +- private void saveChunkExtraData(Chunk var1) { +- if(this.chunkLoader != null) { ++ /** ++ * used by saveChunks, but catches any exceptions if the save fails. ++ */ ++ private void safeSaveExtraChunkData(Chunk par1Chunk) { ++ if (this.currentChunkLoader != null) { + try { +- this.chunkLoader.saveExtraChunkData(this.worldObj, var1); ++ this.currentChunkLoader.saveExtraChunkData(this.worldObj, par1Chunk); + } catch (Exception var3) { + var3.printStackTrace(); + } +- + } + } + +- private void saveChunkData(Chunk var1) { +- if(this.chunkLoader != null) { ++ /** ++ * used by saveChunks, but catches any exceptions if the save fails. ++ */ ++ private void safeSaveChunk(Chunk par1Chunk) { ++ if (this.currentChunkLoader != null) { + try { +- var1.lastSaveTime = this.worldObj.getTotalWorldTime(); +- this.chunkLoader.saveChunk(this.worldObj, var1); ++ par1Chunk.lastSaveTime = this.worldObj.getTotalWorldTime(); ++ this.currentChunkLoader.saveChunk(this.worldObj, par1Chunk); + } catch (IOException var3) { + var3.printStackTrace(); + } catch (MinecraftException var4) { + var4.printStackTrace(); + } +- + } + } + +- public void populate(IChunkProvider var1, int var2, int var3) { +- Chunk var4 = this.provideChunk(var2, var3); +- if(!var4.isTerrainPopulated) { ++ /** ++ * Populates chunk with ores etc etc ++ */ ++ public void populate(IChunkProvider par1IChunkProvider, int par2, int par3) { ++ Chunk var4 = this.provideChunk(par2, par3); ++ ++ if (!var4.isTerrainPopulated) { + var4.isTerrainPopulated = true; +- if(this.serverChunkGenerator != null) { +- this.serverChunkGenerator.populate(var1, var2, var3); ++ ++ if (this.currentChunkProvider != null) { ++ this.currentChunkProvider.populate(par1IChunkProvider, par2, par3); + var4.setChunkModified(); + } + } +- + } + +- public boolean saveChunks(boolean var1, IProgressUpdate var2) { ++ /** ++ * Two modes of operation: if passed true, save all Chunks in one go. If passed false, save up to two chunks. Return ++ * true if all chunks have been saved. ++ */ ++ public boolean saveChunks(boolean par1, IProgressUpdate par2IProgressUpdate) { + int var3 = 0; + +- for(int var4 = 0; var4 < this.g.size(); ++var4) { +- Chunk var5 = (Chunk)this.g.get(var4); +- if(var1) { +- this.saveChunkExtraData(var5); ++ for (int var4 = 0; var4 < this.loadedChunks.size(); ++var4) { ++ Chunk var5 = (Chunk)this.loadedChunks.get(var4); ++ ++ if (par1) { ++ this.safeSaveExtraChunkData(var5); + } + +- if(var5.needsSaving(var1)) { +- this.saveChunkData(var5); ++ if (var5.needsSaving(par1)) { ++ this.safeSaveChunk(var5); + var5.isModified = false; + ++var3; +- if(var3 == 24 && !var1) { ++ ++ if (var3 == 24 && !par1) { + return false; + } + } +@@ -173,56 +220,73 @@ + return true; + } + ++ /** ++ * Save extra data not associated with any Chunk. Not saved during autosave, only during world unload. Currently ++ * unimplemented. ++ */ + public void saveExtraData() { +- if(this.chunkLoader != null) { +- this.chunkLoader.saveExtraData(); ++ if (this.currentChunkLoader != null) { ++ this.currentChunkLoader.saveExtraData(); + } +- + } + ++ /** ++ * Unloads chunks that are marked to be unloaded. This is not guaranteed to unload every such chunk. ++ */ + public boolean unloadQueuedChunks() { +- if(!this.worldObj.levelSaving) { +- for(int var1 = 0; var1 < 100; ++var1) { +- if(!this.b.isEmpty()) { +- Long var2 = (Long)this.b.iterator().next(); +- Chunk var3 = (Chunk)this.id2ChunkMap.getValueByKey(var2.longValue()); ++ if (!this.worldObj.canNotSave) { ++ for (int var1 = 0; var1 < 100; ++var1) { ++ if (!this.chunksToUnload.isEmpty()) { ++ Long var2 = (Long)this.chunksToUnload.iterator().next(); ++ Chunk var3 = (Chunk)this.loadedChunkHashMap.getValueByKey(var2.longValue()); + var3.onChunkUnload(); +- this.saveChunkData(var3); +- this.saveChunkExtraData(var3); +- this.b.remove(var2); +- this.id2ChunkMap.remove(var2.longValue()); +- this.g.remove(var3); ++ this.safeSaveChunk(var3); ++ this.safeSaveExtraChunkData(var3); ++ this.chunksToUnload.remove(var2); ++ this.loadedChunkHashMap.remove(var2.longValue()); ++ this.loadedChunks.remove(var3); + } + } + +- if(this.chunkLoader != null) { +- this.chunkLoader.chunkTick(); ++ if (this.currentChunkLoader != null) { ++ this.currentChunkLoader.chunkTick(); + } + } + +- return this.serverChunkGenerator.unloadQueuedChunks(); ++ return this.currentChunkProvider.unloadQueuedChunks(); + } + ++ /** ++ * Returns if the IChunkProvider supports saving. ++ */ + public boolean canSave() { +- return !this.worldObj.levelSaving; ++ return !this.worldObj.canNotSave; + } + ++ /** ++ * Converts the instance data to a readable string. ++ */ + public String makeString() { +- return "ServerChunkCache: " + this.id2ChunkMap.getNumHashElements() + " Drop: " + this.b.size(); +- } +- +- public List getPossibleCreatures(EnumCreatureType var1, int var2, int var3, int var4) { +- return this.serverChunkGenerator.getPossibleCreatures(var1, var2, var3, var4); +- } +- +- public ChunkPosition findClosestStructure(World var1, String var2, int var3, int var4, int var5) { +- return this.serverChunkGenerator.findClosestStructure(var1, var2, var3, var4, var5); ++ return "ServerChunkCache: " + this.loadedChunkHashMap.getNumHashElements() + " Drop: " + this.chunksToUnload.size(); ++ } ++ ++ /** ++ * Returns a list of creatures of the specified type that can spawn at the given location. ++ */ ++ public List getPossibleCreatures(EnumCreatureType par1EnumCreatureType, int par2, int par3, int par4) { ++ return this.currentChunkProvider.getPossibleCreatures(par1EnumCreatureType, par2, par3, par4); ++ } ++ ++ /** ++ * Returns the location of the closest structure of the specified type. If not found returns null. ++ */ ++ public ChunkPosition findClosestStructure(World par1World, String par2Str, int par3, int par4, int par5) { ++ return this.currentChunkProvider.findClosestStructure(par1World, par2Str, par3, par4, par5); + } + + public int getLoadedChunkCount() { +- return this.id2ChunkMap.getNumHashElements(); ++ return this.loadedChunkHashMap.getNumHashElements(); + } + +- public void recreateStructures(int var1, int var2) { +- } ++ public void recreateStructures(int par1, int par2) {} + } diff --git a/patches/net/minecraft/src/ClippingHelper.java.patch b/patches/net/minecraft/src/ClippingHelper.java.patch new file mode 100644 index 0000000..8bb36d8 --- /dev/null +++ b/patches/net/minecraft/src/ClippingHelper.java.patch @@ -0,0 +1,18 @@ +--- net/minecraft/src/ClippingHelper.java ++++ net/minecraft/src/ClippingHelper.java +@@ -6,9 +6,12 @@ + public float[] modelviewMatrix = new float[16]; + public float[] clippingMatrix = new float[16]; + +- public boolean isBoxInFrustum(double var1, double var3, double var5, double var7, double var9, double var11) { +- for(int var13 = 0; var13 < 6; ++var13) { +- if((double)this.frustum[var13][0] * var1 + (double)this.frustum[var13][1] * var3 + (double)this.frustum[var13][2] * var5 + (double)this.frustum[var13][3] <= 0.0D && (double)this.frustum[var13][0] * var7 + (double)this.frustum[var13][1] * var3 + (double)this.frustum[var13][2] * var5 + (double)this.frustum[var13][3] <= 0.0D && (double)this.frustum[var13][0] * var1 + (double)this.frustum[var13][1] * var9 + (double)this.frustum[var13][2] * var5 + (double)this.frustum[var13][3] <= 0.0D && (double)this.frustum[var13][0] * var7 + (double)this.frustum[var13][1] * var9 + (double)this.frustum[var13][2] * var5 + (double)this.frustum[var13][3] <= 0.0D && (double)this.frustum[var13][0] * var1 + (double)this.frustum[var13][1] * var3 + (double)this.frustum[var13][2] * var11 + (double)this.frustum[var13][3] <= 0.0D && (double)this.frustum[var13][0] * var7 + (double)this.frustum[var13][1] * var3 + (double)this.frustum[var13][2] * var11 + (double)this.frustum[var13][3] <= 0.0D && (double)this.frustum[var13][0] * var1 + (double)this.frustum[var13][1] * var9 + (double)this.frustum[var13][2] * var11 + (double)this.frustum[var13][3] <= 0.0D && (double)this.frustum[var13][0] * var7 + (double)this.frustum[var13][1] * var9 + (double)this.frustum[var13][2] * var11 + (double)this.frustum[var13][3] <= 0.0D) { ++ /** ++ * Returns true if the box is inside all 6 clipping planes, otherwise returns false. ++ */ ++ public boolean isBoxInFrustum(double par1, double par3, double par5, double par7, double par9, double par11) { ++ for (int var13 = 0; var13 < 6; ++var13) { ++ if ((double)this.frustum[var13][0] * par1 + (double)this.frustum[var13][1] * par3 + (double)this.frustum[var13][2] * par5 + (double)this.frustum[var13][3] <= 0.0D && (double)this.frustum[var13][0] * par7 + (double)this.frustum[var13][1] * par3 + (double)this.frustum[var13][2] * par5 + (double)this.frustum[var13][3] <= 0.0D && (double)this.frustum[var13][0] * par1 + (double)this.frustum[var13][1] * par9 + (double)this.frustum[var13][2] * par5 + (double)this.frustum[var13][3] <= 0.0D && (double)this.frustum[var13][0] * par7 + (double)this.frustum[var13][1] * par9 + (double)this.frustum[var13][2] * par5 + (double)this.frustum[var13][3] <= 0.0D && (double)this.frustum[var13][0] * par1 + (double)this.frustum[var13][1] * par3 + (double)this.frustum[var13][2] * par11 + (double)this.frustum[var13][3] <= 0.0D && (double)this.frustum[var13][0] * par7 + (double)this.frustum[var13][1] * par3 + (double)this.frustum[var13][2] * par11 + (double)this.frustum[var13][3] <= 0.0D && (double)this.frustum[var13][0] * par1 + (double)this.frustum[var13][1] * par9 + (double)this.frustum[var13][2] * par11 + (double)this.frustum[var13][3] <= 0.0D && (double)this.frustum[var13][0] * par7 + (double)this.frustum[var13][1] * par9 + (double)this.frustum[var13][2] * par11 + (double)this.frustum[var13][3] <= 0.0D) { + return false; + } + } diff --git a/patches/net/minecraft/src/ClippingHelperImpl.java.patch b/patches/net/minecraft/src/ClippingHelperImpl.java.patch new file mode 100644 index 0000000..a4f6a90 --- /dev/null +++ b/patches/net/minecraft/src/ClippingHelperImpl.java.patch @@ -0,0 +1,74 @@ +--- net/minecraft/src/ClippingHelperImpl.java ++++ net/minecraft/src/ClippingHelperImpl.java +@@ -1,37 +1,52 @@ + package net.minecraft.src; + + import java.nio.FloatBuffer; +-import org.lwjgl.opengl.GL11; ++// Spout Start - Unused import ++//import org.lwjgl.opengl.GL11; ++// Spout End + + public class ClippingHelperImpl extends ClippingHelper { + private static ClippingHelperImpl instance = new ClippingHelperImpl(); +- private FloatBuffer f = GLAllocation.createDirectFloatBuffer(16); +- private FloatBuffer g = GLAllocation.createDirectFloatBuffer(16); +- private FloatBuffer h = GLAllocation.createDirectFloatBuffer(16); ++ private FloatBuffer projectionMatrixBuffer = GLAllocation.createDirectFloatBuffer(16); ++ private FloatBuffer modelviewMatrixBuffer = GLAllocation.createDirectFloatBuffer(16); ++ private FloatBuffer field_78564_h = GLAllocation.createDirectFloatBuffer(16); + ++ /** ++ * Initialises the ClippingHelper object then returns an instance of it. ++ */ + public static ClippingHelper getInstance() { + instance.init(); + return instance; + } + +- private void normalize(float[][] var1, int var2) { +- float var3 = MathHelper.sqrt_float(var1[var2][0] * var1[var2][0] + var1[var2][1] * var1[var2][1] + var1[var2][2] * var1[var2][2]); +- var1[var2][0] /= var3; +- var1[var2][1] /= var3; +- var1[var2][2] /= var3; +- var1[var2][3] /= var3; ++ /** ++ * Normalize the frustum. ++ */ ++ private void normalize(float[][] par1ArrayOfFloat, int par2) { ++ float var3 = MathHelper.sqrt_float(par1ArrayOfFloat[par2][0] * par1ArrayOfFloat[par2][0] + par1ArrayOfFloat[par2][1] * par1ArrayOfFloat[par2][1] + par1ArrayOfFloat[par2][2] * par1ArrayOfFloat[par2][2]); ++ par1ArrayOfFloat[par2][0] /= var3; ++ par1ArrayOfFloat[par2][1] /= var3; ++ par1ArrayOfFloat[par2][2] /= var3; ++ par1ArrayOfFloat[par2][3] /= var3; + } + + private void init() { +- this.f.clear(); +- this.g.clear(); +- this.h.clear(); +- GL11.glGetFloat(GL11.GL_PROJECTION_MATRIX, this.f); +- GL11.glGetFloat(GL11.GL_MODELVIEW_MATRIX, this.g); +- this.f.flip().limit(16); +- this.f.get(this.projectionMatrix); +- this.g.flip().limit(16); +- this.g.get(this.modelviewMatrix); ++ // Spout Start ++ /* ++ this.projectionMatrixBuffer.clear(); ++ this.modelviewMatrixBuffer.clear(); ++ this.field_78564_h.clear(); ++ GL11.glGetFloat(GL11.GL_PROJECTION_MATRIX, this.projectionMatrixBuffer); ++ GL11.glGetFloat(GL11.GL_MODELVIEW_MATRIX, this.modelviewMatrixBuffer); ++ */ ++ modelviewMatrixBuffer = ActiveRenderInfo.modelMatrix.duplicate(); ++ projectionMatrixBuffer = ActiveRenderInfo.projectionMatrix.duplicate(); ++ // Spout End ++ ++ this.projectionMatrixBuffer.flip().limit(16); ++ this.projectionMatrixBuffer.get(this.projectionMatrix); ++ this.modelviewMatrixBuffer.flip().limit(16); ++ this.modelviewMatrixBuffer.get(this.modelviewMatrix); + this.clippingMatrix[0] = this.modelviewMatrix[0] * this.projectionMatrix[0] + this.modelviewMatrix[1] * this.projectionMatrix[4] + this.modelviewMatrix[2] * this.projectionMatrix[8] + this.modelviewMatrix[3] * this.projectionMatrix[12]; + this.clippingMatrix[1] = this.modelviewMatrix[0] * this.projectionMatrix[1] + this.modelviewMatrix[1] * this.projectionMatrix[5] + this.modelviewMatrix[2] * this.projectionMatrix[9] + this.modelviewMatrix[3] * this.projectionMatrix[13]; + this.clippingMatrix[2] = this.modelviewMatrix[0] * this.projectionMatrix[2] + this.modelviewMatrix[1] * this.projectionMatrix[6] + this.modelviewMatrix[2] * this.projectionMatrix[10] + this.modelviewMatrix[3] * this.projectionMatrix[14]; diff --git a/patches/net/minecraft/src/ColorizerFoliage.java.patch b/patches/net/minecraft/src/ColorizerFoliage.java.patch new file mode 100644 index 0000000..c88352d --- /dev/null +++ b/patches/net/minecraft/src/ColorizerFoliage.java.patch @@ -0,0 +1,66 @@ +--- net/minecraft/src/ColorizerFoliage.java ++++ net/minecraft/src/ColorizerFoliage.java +@@ -1,28 +1,52 @@ + package net.minecraft.src; + ++// MCPatcher Start ++import com.prupe.mcpatcher.cc.ColorizeBlock; ++import com.prupe.mcpatcher.cc.Colorizer; ++// MCPatcher End ++ + public class ColorizerFoliage { +- private static int[] foliageBuffer = new int[65536]; +- +- public static void setFoliageBiomeColorizer(int[] var0) { +- foliageBuffer = var0; ++ ++ /** Color buffer for foliage */ ++ // MCPatcher Start - private to public ++ public static int[] foliageBuffer = new int[65536]; ++ // MCPatcher End ++ ++ public static void setFoliageBiomeColorizer(int[] par0ArrayOfInteger) { ++ foliageBuffer = par0ArrayOfInteger; + } + +- public static int getFoliageColor(double var0, double var2) { +- var2 *= var0; +- int var4 = (int)((1.0D - var0) * 255.0D); +- int var5 = (int)((1.0D - var2) * 255.0D); ++ /** ++ * Gets foliage color from temperature and humidity. Args: temperature, humidity ++ */ ++ public static int getFoliageColor(double par0, double par2) { ++ par2 *= par0; ++ int var4 = (int)((1.0D - par0) * 255.0D); ++ int var5 = (int)((1.0D - par2) * 255.0D); + return foliageBuffer[var5 << 8 | var4]; + } + ++ /** ++ * Gets the foliage color for pine type (metadata 1) trees ++ */ + public static int getFoliageColorPine() { +- return 6396257; ++ // MCPatcher Start ++ return ColorizeBlock.colorizeBiome(6396257, Colorizer.COLOR_MAP_PINE); ++ // MCPatcher End + } + ++ /** ++ * Gets the foliage color for birch type (metadata 2) trees ++ */ + public static int getFoliageColorBirch() { +- return 8431445; ++ // MCPatcher Start ++ return ColorizeBlock.colorizeBiome(8431445, Colorizer.COLOR_MAP_BIRCH); ++ // MCPatcher End + } + + public static int getFoliageColorBasic() { +- return 4764952; ++ // MCPatcher Start ++ return ColorizeBlock.colorizeBiome(4764952, Colorizer.COLOR_MAP_FOLIAGE); ++ // MCPatcher End + } + } diff --git a/patches/net/minecraft/src/ColorizerGrass.java.patch b/patches/net/minecraft/src/ColorizerGrass.java.patch new file mode 100644 index 0000000..eb6c586 --- /dev/null +++ b/patches/net/minecraft/src/ColorizerGrass.java.patch @@ -0,0 +1,34 @@ +--- net/minecraft/src/ColorizerGrass.java ++++ net/minecraft/src/ColorizerGrass.java +@@ -1,16 +1,23 @@ + package net.minecraft.src; + + public class ColorizerGrass { +- private static int[] grassBuffer = new int[65536]; +- +- public static void setGrassBiomeColorizer(int[] var0) { +- grassBuffer = var0; ++ ++ /** Color buffer for grass */ ++ // MCPatcher Start - private -> public ++ public static int[] grassBuffer = new int[65536]; ++ // MCPatcher End ++ ++ public static void setGrassBiomeColorizer(int[] par0ArrayOfInteger) { ++ grassBuffer = par0ArrayOfInteger; + } + +- public static int getGrassColor(double var0, double var2) { +- var2 *= var0; +- int var4 = (int)((1.0D - var0) * 255.0D); +- int var5 = (int)((1.0D - var2) * 255.0D); ++ /** ++ * Gets grass color from temperature and humidity. Args: temperature, humidity ++ */ ++ public static int getGrassColor(double par0, double par2) { ++ par2 *= par0; ++ int var4 = (int)((1.0D - par0) * 255.0D); ++ int var5 = (int)((1.0D - par2) * 255.0D); + return grassBuffer[var5 << 8 | var4]; + } + } diff --git a/patches/net/minecraft/src/CombatEntry.java.patch b/patches/net/minecraft/src/CombatEntry.java.patch new file mode 100644 index 0000000..8085169 --- /dev/null +++ b/patches/net/minecraft/src/CombatEntry.java.patch @@ -0,0 +1,41 @@ +--- net/minecraft/src/CombatEntry.java ++++ net/minecraft/src/CombatEntry.java +@@ -5,18 +5,21 @@ + private final int field_94567_b; + private final float field_94568_c; + private final float field_94565_d; +- private final String e; ++ private final String field_94566_e; + private final float field_94564_f; + +- public CombatEntry(DamageSource var1, int var2, float var3, float var4, String var5, float var6) { +- this.damageSrc = var1; +- this.field_94567_b = var2; +- this.field_94568_c = var4; +- this.field_94565_d = var3; +- this.e = var5; +- this.field_94564_f = var6; ++ public CombatEntry(DamageSource par1DamageSource, int par2, float par3, float par4, String par5Str, float par6) { ++ this.damageSrc = par1DamageSource; ++ this.field_94567_b = par2; ++ this.field_94568_c = par4; ++ this.field_94565_d = par3; ++ this.field_94566_e = par5Str; ++ this.field_94564_f = par6; + } + ++ /** ++ * Get the DamageSource of the CombatEntry instance. ++ */ + public DamageSource getDamageSrc() { + return this.damageSrc; + } +@@ -30,7 +33,7 @@ + } + + public String func_94562_g() { +- return this.e; ++ return this.field_94566_e; + } + + public String func_94558_h() { diff --git a/patches/net/minecraft/src/CombatTracker.java.patch b/patches/net/minecraft/src/CombatTracker.java.patch new file mode 100644 index 0000000..642f17b --- /dev/null +++ b/patches/net/minecraft/src/CombatTracker.java.patch @@ -0,0 +1,228 @@ +--- net/minecraft/src/CombatTracker.java ++++ net/minecraft/src/CombatTracker.java +@@ -5,74 +5,81 @@ + import java.util.List; + + public class CombatTracker { +- private final List a = new ArrayList(); ++ private final List field_94556_a = new ArrayList(); ++ ++ /** The entity tracked. */ + private final EntityLivingBase fighter; + private int field_94555_c; + private boolean field_94552_d; + private boolean field_94553_e; +- private String f; ++ private String field_94551_f; + +- public CombatTracker(EntityLivingBase var1) { +- this.fighter = var1; ++ public CombatTracker(EntityLivingBase par1EntityLivingBase) { ++ this.fighter = par1EntityLivingBase; + } + + public void func_94545_a() { + this.func_94542_g(); +- if(this.fighter.isOnLadder()) { ++ ++ if (this.fighter.isOnLadder()) { + int var1 = this.fighter.worldObj.getBlockId(MathHelper.floor_double(this.fighter.posX), MathHelper.floor_double(this.fighter.boundingBox.minY), MathHelper.floor_double(this.fighter.posZ)); +- if(var1 == Block.ladder.blockID) { +- this.f = "ladder"; +- } else if(var1 == Block.vine.blockID) { +- this.f = "vines"; ++ ++ if (var1 == Block.ladder.blockID) { ++ this.field_94551_f = "ladder"; ++ } else if (var1 == Block.vine.blockID) { ++ this.field_94551_f = "vines"; + } +- } else if(this.fighter.isInWater()) { +- this.f = "water"; ++ } else if (this.fighter.isInWater()) { ++ this.field_94551_f = "water"; + } +- + } + +- public void func_94547_a(DamageSource var1, float var2, float var3) { ++ public void func_94547_a(DamageSource par1DamageSource, float par2, float par3) { + this.func_94549_h(); + this.func_94545_a(); +- CombatEntry var4 = new CombatEntry(var1, this.fighter.ticksExisted, var2, var3, this.f, this.fighter.fallDistance); +- this.a.add(var4); ++ CombatEntry var4 = new CombatEntry(par1DamageSource, this.fighter.ticksExisted, par2, par3, this.field_94551_f, this.fighter.fallDistance); ++ this.field_94556_a.add(var4); + this.field_94555_c = this.fighter.ticksExisted; + this.field_94553_e = true; + this.field_94552_d |= var4.func_94559_f(); + } + + public ChatMessageComponent func_94546_b() { +- if(this.a.size() == 0) { +- return ChatMessageComponent.createFromTranslationWithSubstitutions("death.attack.generic", new Object[]{this.fighter.getTranslatedEntityName()}); ++ if (this.field_94556_a.size() == 0) { ++ return ChatMessageComponent.createFromTranslationWithSubstitutions("death.attack.generic", new Object[] {this.fighter.getTranslatedEntityName()}); + } else { + CombatEntry var1 = this.func_94544_f(); +- CombatEntry var2 = (CombatEntry)this.a.get(this.a.size() - 1); ++ CombatEntry var2 = (CombatEntry)this.field_94556_a.get(this.field_94556_a.size() - 1); + String var4 = var2.func_94558_h(); + Entity var5 = var2.getDamageSrc().getEntity(); + ChatMessageComponent var3; +- if(var1 != null && var2.getDamageSrc() == DamageSource.fall) { ++ ++ if (var1 != null && var2.getDamageSrc() == DamageSource.fall) { + String var6 = var1.func_94558_h(); +- if(var1.getDamageSrc() != DamageSource.fall && var1.getDamageSrc() != DamageSource.outOfWorld) { +- if(var6 != null && (var4 == null || !var6.equals(var4))) { ++ ++ if (var1.getDamageSrc() != DamageSource.fall && var1.getDamageSrc() != DamageSource.outOfWorld) { ++ if (var6 != null && (var4 == null || !var6.equals(var4))) { + Entity var9 = var1.getDamageSrc().getEntity(); + ItemStack var8 = var9 instanceof EntityLivingBase ? ((EntityLivingBase)var9).getHeldItem() : null; +- if(var8 != null && var8.hasDisplayName()) { +- var3 = ChatMessageComponent.createFromTranslationWithSubstitutions("death.fell.assist.item", new Object[]{this.fighter.getTranslatedEntityName(), var6, var8.getDisplayName()}); ++ ++ if (var8 != null && var8.hasDisplayName()) { ++ var3 = ChatMessageComponent.createFromTranslationWithSubstitutions("death.fell.assist.item", new Object[] {this.fighter.getTranslatedEntityName(), var6, var8.getDisplayName()}); + } else { +- var3 = ChatMessageComponent.createFromTranslationWithSubstitutions("death.fell.assist", new Object[]{this.fighter.getTranslatedEntityName(), var6}); ++ var3 = ChatMessageComponent.createFromTranslationWithSubstitutions("death.fell.assist", new Object[] {this.fighter.getTranslatedEntityName(), var6}); + } +- } else if(var4 != null) { ++ } else if (var4 != null) { + ItemStack var7 = var5 instanceof EntityLivingBase ? ((EntityLivingBase)var5).getHeldItem() : null; +- if(var7 != null && var7.hasDisplayName()) { +- var3 = ChatMessageComponent.createFromTranslationWithSubstitutions("death.fell.finish.item", new Object[]{this.fighter.getTranslatedEntityName(), var4, var7.getDisplayName()}); ++ ++ if (var7 != null && var7.hasDisplayName()) { ++ var3 = ChatMessageComponent.createFromTranslationWithSubstitutions("death.fell.finish.item", new Object[] {this.fighter.getTranslatedEntityName(), var4, var7.getDisplayName()}); + } else { +- var3 = ChatMessageComponent.createFromTranslationWithSubstitutions("death.fell.finish", new Object[]{this.fighter.getTranslatedEntityName(), var4}); ++ var3 = ChatMessageComponent.createFromTranslationWithSubstitutions("death.fell.finish", new Object[] {this.fighter.getTranslatedEntityName(), var4}); + } + } else { +- var3 = ChatMessageComponent.createFromTranslationWithSubstitutions("death.fell.killer", new Object[]{this.fighter.getTranslatedEntityName()}); ++ var3 = ChatMessageComponent.createFromTranslationWithSubstitutions("death.fell.killer", new Object[] {this.fighter.getTranslatedEntityName()}); + } + } else { +- var3 = ChatMessageComponent.createFromTranslationWithSubstitutions("death.fell.accident." + this.func_94548_b(var1), new Object[]{this.fighter.getTranslatedEntityName()}); ++ var3 = ChatMessageComponent.createFromTranslationWithSubstitutions("death.fell.accident." + this.func_94548_b(var1), new Object[] {this.fighter.getTranslatedEntityName()}); + } + } else { + var3 = var2.getDamageSrc().getDeathMessage(this.fighter); +@@ -87,30 +94,26 @@ + EntityPlayer var2 = null; + float var3 = 0.0F; + float var4 = 0.0F; +- Iterator var5 = this.a.iterator(); +- +- while(true) { +- CombatEntry var6; +- do { +- do { +- if(!var5.hasNext()) { +- if(var2 != null && var4 >= var3 / 3.0F) { +- return var2; +- } +- +- return var1; +- } +- +- var6 = (CombatEntry)var5.next(); +- if(var6.getDamageSrc().getEntity() instanceof EntityPlayer && (var2 == null || var6.func_94563_c() > var4)) { +- var4 = var6.func_94563_c(); +- var2 = (EntityPlayer)var6.getDamageSrc().getEntity(); +- } +- } while(!(var6.getDamageSrc().getEntity() instanceof EntityLivingBase)); +- } while(var1 != null && var6.func_94563_c() <= var3); +- +- var3 = var6.func_94563_c(); +- var1 = (EntityLivingBase)var6.getDamageSrc().getEntity(); ++ Iterator var5 = this.field_94556_a.iterator(); ++ ++ while (var5.hasNext()) { ++ CombatEntry var6 = (CombatEntry)var5.next(); ++ ++ if (var6.getDamageSrc().getEntity() instanceof EntityPlayer && (var2 == null || var6.func_94563_c() > var4)) { ++ var4 = var6.func_94563_c(); ++ var2 = (EntityPlayer)var6.getDamageSrc().getEntity(); ++ } ++ ++ if (var6.getDamageSrc().getEntity() instanceof EntityLivingBase && (var1 == null || var6.func_94563_c() > var3)) { ++ var3 = var6.func_94563_c(); ++ var1 = (EntityLivingBase)var6.getDamageSrc().getEntity(); ++ } ++ } ++ ++ if (var2 != null && var4 >= var3 / 3.0F) { ++ return var2; ++ } else { ++ return var1; + } + } + +@@ -120,11 +123,12 @@ + byte var3 = 0; + float var4 = 0.0F; + +- for(int var5 = 0; var5 < this.a.size(); ++var5) { +- CombatEntry var6 = (CombatEntry)this.a.get(var5); +- CombatEntry var7 = var5 > 0 ? (CombatEntry)this.a.get(var5 - 1) : null; +- if((var6.getDamageSrc() == DamageSource.fall || var6.getDamageSrc() == DamageSource.outOfWorld) && var6.func_94561_i() > 0.0F && (var1 == null || var6.func_94561_i() > var4)) { +- if(var5 > 0) { ++ for (int var5 = 0; var5 < this.field_94556_a.size(); ++var5) { ++ CombatEntry var6 = (CombatEntry)this.field_94556_a.get(var5); ++ CombatEntry var7 = var5 > 0 ? (CombatEntry)this.field_94556_a.get(var5 - 1) : null; ++ ++ if ((var6.getDamageSrc() == DamageSource.fall || var6.getDamageSrc() == DamageSource.outOfWorld) && var6.func_94561_i() > 0.0F && (var1 == null || var6.func_94561_i() > var4)) { ++ if (var5 > 0) { + var1 = var7; + } else { + var1 = var6; +@@ -133,35 +137,35 @@ + var4 = var6.func_94561_i(); + } + +- if(var6.func_94562_g() != null && (var2 == null || var6.func_94563_c() > (float)var3)) { ++ if (var6.func_94562_g() != null && (var2 == null || var6.func_94563_c() > (float)var3)) { + var2 = var6; + } + } + +- if(var4 > 5.0F && var1 != null) { ++ if (var4 > 5.0F && var1 != null) { + return var1; +- } else if(var3 > 5 && var2 != null) { ++ } else if (var3 > 5 && var2 != null) { + return var2; + } else { + return null; + } + } + +- private String func_94548_b(CombatEntry var1) { +- return var1.func_94562_g() == null ? "generic" : var1.func_94562_g(); ++ private String func_94548_b(CombatEntry par1CombatEntry) { ++ return par1CombatEntry.func_94562_g() == null ? "generic" : par1CombatEntry.func_94562_g(); + } + + private void func_94542_g() { +- this.f = null; ++ this.field_94551_f = null; + } + + private void func_94549_h() { + int var1 = this.field_94552_d ? 300 : 100; +- if(this.field_94553_e && this.fighter.ticksExisted - this.field_94555_c > var1) { +- this.a.clear(); ++ ++ if (this.field_94553_e && this.fighter.ticksExisted - this.field_94555_c > var1) { ++ this.field_94556_a.clear(); + this.field_94553_e = false; + this.field_94552_d = false; + } +- + } + } diff --git a/patches/net/minecraft/src/CommandBase.java.patch b/patches/net/minecraft/src/CommandBase.java.patch new file mode 100644 index 0000000..711968c --- /dev/null +++ b/patches/net/minecraft/src/CommandBase.java.patch @@ -0,0 +1,445 @@ +--- net/minecraft/src/CommandBase.java ++++ net/minecraft/src/CommandBase.java +@@ -10,6 +10,9 @@ + public abstract class CommandBase implements ICommand { + private static IAdminCommand theAdmin; + ++ /** ++ * Return the required permission level for this command. ++ */ + public int getRequiredPermissionLevel() { + return 4; + } +@@ -18,69 +21,90 @@ + return null; + } + +- public boolean canCommandSenderUseCommand(ICommandSender var1) { +- return var1.canCommandSenderUseCommand(this.getRequiredPermissionLevel(), this.getCommandName()); ++ /** ++ * Returns true if the given command sender is allowed to use this command. ++ */ ++ public boolean canCommandSenderUseCommand(ICommandSender par1ICommandSender) { ++ return par1ICommandSender.canCommandSenderUseCommand(this.getRequiredPermissionLevel(), this.getCommandName()); + } + +- public List addTabCompletionOptions(ICommandSender var1, String[] var2) { ++ /** ++ * Adds the strings available in this command to the given list of tab completion options. ++ */ ++ public List addTabCompletionOptions(ICommandSender par1ICommandSender, String[] par2ArrayOfStr) { + return null; + } + +- public static int parseInt(ICommandSender var0, String var1) { ++ /** ++ * Parses an int from the given string. ++ */ ++ public static int parseInt(ICommandSender par0ICommandSender, String par1Str) { + try { +- return Integer.parseInt(var1); ++ return Integer.parseInt(par1Str); + } catch (NumberFormatException var3) { +- throw new NumberInvalidException("commands.generic.num.invalid", new Object[]{var1}); ++ throw new NumberInvalidException("commands.generic.num.invalid", new Object[] {par1Str}); + } + } + +- public static int parseIntWithMin(ICommandSender var0, String var1, int var2) { +- return parseIntBounded(var0, var1, var2, Integer.MAX_VALUE); ++ /** ++ * Parses an int from the given sring with a specified minimum. ++ */ ++ public static int parseIntWithMin(ICommandSender par0ICommandSender, String par1Str, int par2) { ++ return parseIntBounded(par0ICommandSender, par1Str, par2, Integer.MAX_VALUE); + } + +- public static int parseIntBounded(ICommandSender var0, String var1, int var2, int var3) { +- int var4 = parseInt(var0, var1); +- if(var4 < var2) { +- throw new NumberInvalidException("commands.generic.num.tooSmall", new Object[]{Integer.valueOf(var4), Integer.valueOf(var2)}); +- } else if(var4 > var3) { +- throw new NumberInvalidException("commands.generic.num.tooBig", new Object[]{Integer.valueOf(var4), Integer.valueOf(var3)}); ++ /** ++ * Parses an int from the given string within a specified bound. ++ */ ++ public static int parseIntBounded(ICommandSender par0ICommandSender, String par1Str, int par2, int par3) { ++ int var4 = parseInt(par0ICommandSender, par1Str); ++ ++ if (var4 < par2) { ++ throw new NumberInvalidException("commands.generic.num.tooSmall", new Object[] {Integer.valueOf(var4), Integer.valueOf(par2)}); ++ } else if (var4 > par3) { ++ throw new NumberInvalidException("commands.generic.num.tooBig", new Object[] {Integer.valueOf(var4), Integer.valueOf(par3)}); + } else { + return var4; + } + } + +- public static double parseDouble(ICommandSender var0, String var1) { ++ /** ++ * Parses a double from the given string or throws an exception if it's not a double. ++ */ ++ public static double parseDouble(ICommandSender par0ICommandSender, String par1Str) { + try { +- double var2 = Double.parseDouble(var1); +- if(!Doubles.isFinite(var2)) { +- throw new NumberInvalidException("commands.generic.double.invalid", new Object[]{var1}); ++ double var2 = Double.parseDouble(par1Str); ++ ++ if (!Doubles.isFinite(var2)) { ++ throw new NumberInvalidException("commands.generic.double.invalid", new Object[] {par1Str}); + } else { + return var2; + } + } catch (NumberFormatException var4) { +- throw new NumberInvalidException("commands.generic.double.invalid", new Object[]{var1}); ++ throw new NumberInvalidException("commands.generic.double.invalid", new Object[] {par1Str}); + } + } + +- public static double func_110664_a(ICommandSender var0, String var1, double var2) { +- return func_110661_a(var0, var1, var2, Double.MAX_VALUE); ++ public static double func_110664_a(ICommandSender par0ICommandSender, String par1Str, double par2) { ++ return func_110661_a(par0ICommandSender, par1Str, par2, Double.MAX_VALUE); + } + +- public static double func_110661_a(ICommandSender var0, String var1, double var2, double var4) { +- double var6 = parseDouble(var0, var1); +- if(var6 < var2) { +- throw new NumberInvalidException("commands.generic.double.tooSmall", new Object[]{Double.valueOf(var6), Double.valueOf(var2)}); +- } else if(var6 > var4) { +- throw new NumberInvalidException("commands.generic.double.tooBig", new Object[]{Double.valueOf(var6), Double.valueOf(var4)}); ++ public static double func_110661_a(ICommandSender par0ICommandSender, String par1Str, double par2, double par4) { ++ double var6 = parseDouble(par0ICommandSender, par1Str); ++ ++ if (var6 < par2) { ++ throw new NumberInvalidException("commands.generic.double.tooSmall", new Object[] {Double.valueOf(var6), Double.valueOf(par2)}); ++ } else if (var6 > par4) { ++ throw new NumberInvalidException("commands.generic.double.tooBig", new Object[] {Double.valueOf(var6), Double.valueOf(par4)}); + } else { + return var6; + } + } + +- public static boolean func_110662_c(ICommandSender var0, String var1) { +- if(!var1.equals("true") && !var1.equals("1")) { +- if(!var1.equals("false") && !var1.equals("0")) { +- throw new CommandException("commands.generic.boolean.invalid", new Object[]{var1}); ++ public static boolean func_110662_c(ICommandSender par0ICommandSender, String par1Str) { ++ if (!par1Str.equals("true") && !par1Str.equals("1")) { ++ if (!par1Str.equals("false") && !par1Str.equals("0")) { ++ throw new CommandException("commands.generic.boolean.invalid", new Object[] {par1Str}); + } else { + return false; + } +@@ -89,21 +113,26 @@ + } + } + +- public static EntityPlayerMP getCommandSenderAsPlayer(ICommandSender var0) { +- if(var0 instanceof EntityPlayerMP) { +- return (EntityPlayerMP)var0; ++ /** ++ * Returns the given ICommandSender as a EntityPlayer or throw an exception. ++ */ ++ public static EntityPlayerMP getCommandSenderAsPlayer(ICommandSender par0ICommandSender) { ++ if (par0ICommandSender instanceof EntityPlayerMP) { ++ return (EntityPlayerMP)par0ICommandSender; + } else { + throw new PlayerNotFoundException("You must specify which player you wish to perform this action on.", new Object[0]); + } + } + +- public static EntityPlayerMP getPlayer(ICommandSender var0, String var1) { +- EntityPlayerMP var2 = PlayerSelector.matchOnePlayer(var0, var1); +- if(var2 != null) { ++ public static EntityPlayerMP getPlayer(ICommandSender par0ICommandSender, String par1Str) { ++ EntityPlayerMP var2 = PlayerSelector.matchOnePlayer(par0ICommandSender, par1Str); ++ ++ if (var2 != null) { + return var2; + } else { +- var2 = MinecraftServer.getServer().getConfigurationManager().getPlayerEntity(var1); +- if(var2 == null) { ++ var2 = MinecraftServer.getServer().getConfigurationManager().getPlayerForUsername(par1Str); ++ ++ if (var2 == null) { + throw new PlayerNotFoundException(); + } else { + return var2; +@@ -111,35 +140,38 @@ + } + } + +- public static String func_96332_d(ICommandSender var0, String var1) { +- EntityPlayerMP var2 = PlayerSelector.matchOnePlayer(var0, var1); +- if(var2 != null) { ++ public static String func_96332_d(ICommandSender par0ICommandSender, String par1Str) { ++ EntityPlayerMP var2 = PlayerSelector.matchOnePlayer(par0ICommandSender, par1Str); ++ ++ if (var2 != null) { + return var2.getEntityName(); +- } else if(PlayerSelector.hasArguments(var1)) { ++ } else if (PlayerSelector.hasArguments(par1Str)) { + throw new PlayerNotFoundException(); + } else { +- return var1; ++ return par1Str; + } + } + +- public static String func_82360_a(ICommandSender var0, String[] var1, int var2) { +- return func_82361_a(var0, var1, var2, false); ++ public static String func_82360_a(ICommandSender par0ICommandSender, String[] par1ArrayOfStr, int par2) { ++ return func_82361_a(par0ICommandSender, par1ArrayOfStr, par2, false); + } + +- public static String func_82361_a(ICommandSender var0, String[] var1, int var2, boolean var3) { ++ public static String func_82361_a(ICommandSender par0ICommandSender, String[] par1ArrayOfStr, int par2, boolean par3) { + StringBuilder var4 = new StringBuilder(); + +- for(int var5 = var2; var5 < var1.length; ++var5) { +- if(var5 > var2) { ++ for (int var5 = par2; var5 < par1ArrayOfStr.length; ++var5) { ++ if (var5 > par2) { + var4.append(" "); + } + +- String var6 = var1[var5]; +- if(var3) { +- String var7 = PlayerSelector.matchPlayersAsString(var0, var6); +- if(var7 != null) { ++ String var6 = par1ArrayOfStr[var5]; ++ ++ if (par3) { ++ String var7 = PlayerSelector.matchPlayersAsString(par0ICommandSender, var6); ++ ++ if (var7 != null) { + var6 = var7; +- } else if(PlayerSelector.hasArguments(var6)) { ++ } else if (PlayerSelector.hasArguments(var6)) { + throw new PlayerNotFoundException(); + } + } +@@ -150,35 +182,39 @@ + return var4.toString(); + } + +- public static double func_110666_a(ICommandSender var0, double var1, String var3) { +- return func_110665_a(var0, var1, var3, -30000000, 30000000); ++ public static double func_110666_a(ICommandSender par0ICommandSender, double par1, String par3Str) { ++ return func_110665_a(par0ICommandSender, par1, par3Str, -30000000, 30000000); + } + +- public static double func_110665_a(ICommandSender var0, double var1, String var3, int var4, int var5) { +- boolean var6 = var3.startsWith("~"); +- if(var6 && Double.isNaN(var1)) { +- throw new NumberInvalidException("commands.generic.num.invalid", new Object[]{Double.valueOf(var1)}); ++ public static double func_110665_a(ICommandSender par0ICommandSender, double par1, String par3Str, int par4, int par5) { ++ boolean var6 = par3Str.startsWith("~"); ++ ++ if (var6 && Double.isNaN(par1)) { ++ throw new NumberInvalidException("commands.generic.num.invalid", new Object[] {Double.valueOf(par1)}); + } else { +- double var7 = var6 ? var1 : 0.0D; +- if(!var6 || var3.length() > 1) { +- boolean var9 = var3.contains("."); +- if(var6) { +- var3 = var3.substring(1); ++ double var7 = var6 ? par1 : 0.0D; ++ ++ if (!var6 || par3Str.length() > 1) { ++ boolean var9 = par3Str.contains("."); ++ ++ if (var6) { ++ par3Str = par3Str.substring(1); + } + +- var7 += parseDouble(var0, var3); +- if(!var9 && !var6) { ++ var7 += parseDouble(par0ICommandSender, par3Str); ++ ++ if (!var9 && !var6) { + var7 += 0.5D; + } + } + +- if(var4 != 0 || var5 != 0) { +- if(var7 < (double)var4) { +- throw new NumberInvalidException("commands.generic.double.tooSmall", new Object[]{Double.valueOf(var7), Integer.valueOf(var4)}); ++ if (par4 != 0 || par5 != 0) { ++ if (var7 < (double)par4) { ++ throw new NumberInvalidException("commands.generic.double.tooSmall", new Object[] {Double.valueOf(var7), Integer.valueOf(par4)}); + } + +- if(var7 > (double)var5) { +- throw new NumberInvalidException("commands.generic.double.tooBig", new Object[]{Double.valueOf(var7), Integer.valueOf(var5)}); ++ if (var7 > (double)par5) { ++ throw new NumberInvalidException("commands.generic.double.tooBig", new Object[] {Double.valueOf(var7), Integer.valueOf(par5)}); + } + } + +@@ -186,13 +222,17 @@ + } + } + +- public static String joinNiceString(Object[] var0) { ++ /** ++ * Joins the given string array into a "x, y, and z" seperated string. ++ */ ++ public static String joinNiceString(Object[] par0ArrayOfObj) { + StringBuilder var1 = new StringBuilder(); + +- for(int var2 = 0; var2 < var0.length; ++var2) { +- String var3 = var0[var2].toString(); +- if(var2 > 0) { +- if(var2 == var0.length - 1) { ++ for (int var2 = 0; var2 < par0ArrayOfObj.length; ++var2) { ++ String var3 = par0ArrayOfObj[var2].toString(); ++ ++ if (var2 > 0) { ++ if (var2 == par0ArrayOfObj.length - 1) { + var1.append(" and "); + } else { + var1.append(", "); +@@ -205,35 +245,43 @@ + return var1.toString(); + } + +- public static String func_96333_a(Collection var0) { +- return joinNiceString(var0.toArray(new String[var0.size()])); ++ public static String func_96333_a(Collection par0Collection) { ++ return joinNiceString(par0Collection.toArray(new String[par0Collection.size()])); + } + +- public static String func_110663_b(Collection var0) { +- String[] var1 = new String[var0.size()]; ++ public static String func_110663_b(Collection par0Collection) { ++ String[] var1 = new String[par0Collection.size()]; + int var2 = 0; +- + EntityLivingBase var4; +- for(Iterator var3 = var0.iterator(); var3.hasNext(); var1[var2++] = var4.getTranslatedEntityName()) { ++ ++ for (Iterator var3 = par0Collection.iterator(); var3.hasNext(); var1[var2++] = var4.getTranslatedEntityName()) { + var4 = (EntityLivingBase)var3.next(); + } + + return joinNiceString(var1); + } + +- public static boolean doesStringStartWith(String var0, String var1) { +- return var1.regionMatches(true, 0, var0, 0, var0.length()); ++ /** ++ * Returns true if the given substring is exactly equal to the start of the given string (case insensitive). ++ */ ++ public static boolean doesStringStartWith(String par0Str, String par1Str) { ++ return par1Str.regionMatches(true, 0, par0Str, 0, par0Str.length()); + } + +- public static List getListOfStringsMatchingLastWord(String[] var0, String... var1) { +- String var2 = var0[var0.length - 1]; ++ /** ++ * Returns a List of strings (chosen from the given strings) which the last word in the given string array is a ++ * beginning-match for. (Tab completion). ++ */ ++ public static List getListOfStringsMatchingLastWord(String[] par0ArrayOfStr, String ... par1ArrayOfStr) { ++ String var2 = par0ArrayOfStr[par0ArrayOfStr.length - 1]; + ArrayList var3 = new ArrayList(); +- String[] var4 = var1; +- int var5 = var1.length; ++ String[] var4 = par1ArrayOfStr; ++ int var5 = par1ArrayOfStr.length; + +- for(int var6 = 0; var6 < var5; ++var6) { ++ for (int var6 = 0; var6 < var5; ++var6) { + String var7 = var4[var6]; +- if(doesStringStartWith(var2, var7)) { ++ ++ if (doesStringStartWith(var2, var7)) { + var3.add(var7); + } + } +@@ -241,14 +289,19 @@ + return var3; + } + +- public static List getListOfStringsFromIterableMatchingLastWord(String[] var0, Iterable var1) { +- String var2 = var0[var0.length - 1]; ++ /** ++ * Returns a List of strings (chosen from the given string iterable) which the last word in the given string array is a ++ * beginning-match for. (Tab completion). ++ */ ++ public static List getListOfStringsFromIterableMatchingLastWord(String[] par0ArrayOfStr, Iterable par1Iterable) { ++ String var2 = par0ArrayOfStr[par0ArrayOfStr.length - 1]; + ArrayList var3 = new ArrayList(); +- Iterator var4 = var1.iterator(); ++ Iterator var4 = par1Iterable.iterator(); + +- while(var4.hasNext()) { ++ while (var4.hasNext()) { + String var5 = (String)var4.next(); +- if(doesStringStartWith(var2, var5)) { ++ ++ if (doesStringStartWith(var2, var5)) { + var3.add(var5); + } + } +@@ -256,30 +309,38 @@ + return var3; + } + +- public boolean isUsernameIndex(String[] var1, int var2) { ++ /** ++ * Return whether the specified command parameter index is a username parameter. ++ */ ++ public boolean isUsernameIndex(String[] par1ArrayOfStr, int par2) { + return false; + } + +- public static void notifyAdmins(ICommandSender var0, String var1, Object... var2) { +- notifyAdmins(var0, 0, var1, var2); ++ public static void notifyAdmins(ICommandSender par0ICommandSender, String par1Str, Object ... par2ArrayOfObj) { ++ notifyAdmins(par0ICommandSender, 0, par1Str, par2ArrayOfObj); + } + +- public static void notifyAdmins(ICommandSender var0, int var1, String var2, Object... var3) { +- if(theAdmin != null) { +- theAdmin.notifyAdmins(var0, var1, var2, var3); ++ public static void notifyAdmins(ICommandSender par0ICommandSender, int par1, String par2Str, Object ... par3ArrayOfObj) { ++ if (theAdmin != null) { ++ theAdmin.notifyAdmins(par0ICommandSender, par1, par2Str, par3ArrayOfObj); + } +- +- } +- +- public static void setAdminCommander(IAdminCommand var0) { +- theAdmin = var0; +- } +- +- public int compareTo(ICommand var1) { +- return this.getCommandName().compareTo(var1.getCommandName()); +- } +- +- public int compareTo(Object var1) { +- return this.compareTo((ICommand)var1); ++ } ++ ++ /** ++ * Sets the static IAdminCommander. ++ */ ++ public static void setAdminCommander(IAdminCommand par0IAdminCommand) { ++ theAdmin = par0IAdminCommand; ++ } ++ ++ /** ++ * Compares the name of this command to the name of the given command. ++ */ ++ public int compareTo(ICommand par1ICommand) { ++ return this.getCommandName().compareTo(par1ICommand.getCommandName()); ++ } ++ ++ public int compareTo(Object par1Obj) { ++ return this.compareTo((ICommand)par1Obj); + } + } diff --git a/patches/net/minecraft/src/CommandClearInventory.java.patch b/patches/net/minecraft/src/CommandClearInventory.java.patch new file mode 100644 index 0000000..adda5db --- /dev/null +++ b/patches/net/minecraft/src/CommandClearInventory.java.patch @@ -0,0 +1,69 @@ +--- net/minecraft/src/CommandClearInventory.java ++++ net/minecraft/src/CommandClearInventory.java +@@ -8,40 +8,53 @@ + return "clear"; + } + +- public String getCommandUsage(ICommandSender var1) { ++ public String getCommandUsage(ICommandSender par1ICommandSender) { + return "commands.clear.usage"; + } + ++ /** ++ * Return the required permission level for this command. ++ */ + public int getRequiredPermissionLevel() { + return 2; + } + +- public void processCommand(ICommandSender var1, String[] var2) { +- EntityPlayerMP var3 = var2.length == 0 ? getCommandSenderAsPlayer(var1) : getPlayer(var1, var2[0]); +- int var4 = var2.length >= 2 ? parseIntWithMin(var1, var2[1], 1) : -1; +- int var5 = var2.length >= 3 ? parseIntWithMin(var1, var2[2], 0) : -1; ++ public void processCommand(ICommandSender par1ICommandSender, String[] par2ArrayOfStr) { ++ EntityPlayerMP var3 = par2ArrayOfStr.length == 0 ? getCommandSenderAsPlayer(par1ICommandSender) : getPlayer(par1ICommandSender, par2ArrayOfStr[0]); ++ int var4 = par2ArrayOfStr.length >= 2 ? parseIntWithMin(par1ICommandSender, par2ArrayOfStr[1], 1) : -1; ++ int var5 = par2ArrayOfStr.length >= 3 ? parseIntWithMin(par1ICommandSender, par2ArrayOfStr[2], 0) : -1; + int var6 = var3.inventory.clearInventory(var4, var5); + var3.inventoryContainer.detectAndSendChanges(); +- if(!var3.capabilities.isCreativeMode) { ++ ++ if (!var3.capabilities.isCreativeMode) { + var3.updateHeldItem(); + } + +- if(var6 == 0) { +- throw new CommandException("commands.clear.failure", new Object[]{var3.getEntityName()}); ++ if (var6 == 0) { ++ throw new CommandException("commands.clear.failure", new Object[] {var3.getEntityName()}); + } else { +- notifyAdmins(var1, "commands.clear.success", new Object[]{var3.getEntityName(), Integer.valueOf(var6)}); ++ notifyAdmins(par1ICommandSender, "commands.clear.success", new Object[] {var3.getEntityName(), Integer.valueOf(var6)}); + } + } + +- public List addTabCompletionOptions(ICommandSender var1, String[] var2) { +- return var2.length == 1 ? getListOfStringsMatchingLastWord(var2, this.getAllOnlineUsernames()) : null; ++ /** ++ * Adds the strings available in this command to the given list of tab completion options. ++ */ ++ public List addTabCompletionOptions(ICommandSender par1ICommandSender, String[] par2ArrayOfStr) { ++ return par2ArrayOfStr.length == 1 ? getListOfStringsMatchingLastWord(par2ArrayOfStr, this.getAllOnlineUsernames()) : null; + } + ++ /** ++ * Return all usernames currently connected to the server. ++ */ + protected String[] getAllOnlineUsernames() { + return MinecraftServer.getServer().getAllUsernames(); + } + +- public boolean isUsernameIndex(String[] var1, int var2) { +- return var2 == 0; ++ /** ++ * Return whether the specified command parameter index is a username parameter. ++ */ ++ public boolean isUsernameIndex(String[] par1ArrayOfStr, int par2) { ++ return par2 == 0; + } + } diff --git a/patches/net/minecraft/src/CommandDebug.java.patch b/patches/net/minecraft/src/CommandDebug.java.patch new file mode 100644 index 0000000..94002ce --- /dev/null +++ b/patches/net/minecraft/src/CommandDebug.java.patch @@ -0,0 +1,171 @@ +--- net/minecraft/src/CommandDebug.java ++++ net/minecraft/src/CommandDebug.java +@@ -8,43 +8,50 @@ + import net.minecraft.server.MinecraftServer; + + public class CommandDebug extends CommandBase { ++ ++ /** Time the debugging started in milliseconds. */ + private long startTime; ++ ++ /** The number of ticks when debugging started. */ + private int startTicks; + + public String getCommandName() { + return "debug"; + } + ++ /** ++ * Return the required permission level for this command. ++ */ + public int getRequiredPermissionLevel() { + return 3; + } + +- public String getCommandUsage(ICommandSender var1) { ++ public String getCommandUsage(ICommandSender par1ICommandSender) { + return "commands.debug.usage"; + } + +- public void processCommand(ICommandSender var1, String[] var2) { +- if(var2.length == 1) { +- if(var2[0].equals("start")) { +- notifyAdmins(var1, "commands.debug.start", new Object[0]); ++ public void processCommand(ICommandSender par1ICommandSender, String[] par2ArrayOfStr) { ++ if (par2ArrayOfStr.length == 1) { ++ if (par2ArrayOfStr[0].equals("start")) { ++ notifyAdmins(par1ICommandSender, "commands.debug.start", new Object[0]); + MinecraftServer.getServer().enableProfiling(); +- this.startTime = MinecraftServer.getCurrentTimeMillis(); ++ this.startTime = MinecraftServer.getSystemTimeMillis(); + this.startTicks = MinecraftServer.getServer().getTickCounter(); + return; + } + +- if(var2[0].equals("stop")) { +- if(!MinecraftServer.getServer().theProfiler.profilingEnabled) { ++ if (par2ArrayOfStr[0].equals("stop")) { ++ if (!MinecraftServer.getServer().theProfiler.profilingEnabled) { + throw new CommandException("commands.debug.notStarted", new Object[0]); + } + +- long var3 = MinecraftServer.getCurrentTimeMillis(); ++ long var3 = MinecraftServer.getSystemTimeMillis(); + int var5 = MinecraftServer.getServer().getTickCounter(); + long var6 = var3 - this.startTime; + int var8 = var5 - this.startTicks; + this.saveProfilerResults(var6, var8); + MinecraftServer.getServer().theProfiler.profilingEnabled = false; +- notifyAdmins(var1, "commands.debug.stop", new Object[]{Float.valueOf((float)var6 / 1000.0F), Integer.valueOf(var8)}); ++ notifyAdmins(par1ICommandSender, "commands.debug.stop", new Object[] {Float.valueOf((float)var6 / 1000.0F), Integer.valueOf(var8)}); + return; + } + } +@@ -52,66 +59,69 @@ + throw new WrongUsageException("commands.debug.usage", new Object[0]); + } + +- private void saveProfilerResults(long var1, int var3) { ++ private void saveProfilerResults(long par1, int par3) { + File var4 = new File(MinecraftServer.getServer().getFile("debug"), "profile-results-" + (new SimpleDateFormat("yyyy-MM-dd_HH.mm.ss")).format(new Date()) + ".txt"); + var4.getParentFile().mkdirs(); + + try { + FileWriter var5 = new FileWriter(var4); +- var5.write(this.getProfilerResults(var1, var3)); ++ var5.write(this.getProfilerResults(par1, par3)); + var5.close(); + } catch (Throwable var6) { + MinecraftServer.getServer().getLogAgent().logSevereException("Could not save profiler results to " + var4, var6); + } +- + } + +- private String getProfilerResults(long var1, int var3) { ++ private String getProfilerResults(long par1, int par3) { + StringBuilder var4 = new StringBuilder(); + var4.append("---- Minecraft Profiler Results ----\n"); + var4.append("// "); + var4.append(getWittyComment()); + var4.append("\n\n"); +- var4.append("Time span: ").append(var1).append(" ms\n"); +- var4.append("Tick span: ").append(var3).append(" ticks\n"); +- var4.append("// This is approximately ").append(String.format("%.2f", new Object[]{Float.valueOf((float)var3 / ((float)var1 / 1000.0F))})).append(" ticks per second. It should be ").append(20).append(" ticks per second\n\n"); ++ var4.append("Time span: ").append(par1).append(" ms\n"); ++ var4.append("Tick span: ").append(par3).append(" ticks\n"); ++ var4.append("// This is approximately ").append(String.format("%.2f", new Object[] {Float.valueOf((float)par3 / ((float)par1 / 1000.0F))})).append(" ticks per second. It should be ").append(20).append(" ticks per second\n\n"); + var4.append("--- BEGIN PROFILE DUMP ---\n\n"); + this.getProfileDump(0, "root", var4); + var4.append("--- END PROFILE DUMP ---\n\n"); + return var4.toString(); + } + +- private void getProfileDump(int var1, String var2, StringBuilder var3) { +- List var4 = MinecraftServer.getServer().theProfiler.getProfilingData(var2); +- if(var4 != null && var4.size() >= 3) { +- for(int var5 = 1; var5 < var4.size(); ++var5) { ++ private void getProfileDump(int par1, String par2Str, StringBuilder par3StringBuilder) { ++ List var4 = MinecraftServer.getServer().theProfiler.getProfilingData(par2Str); ++ ++ if (var4 != null && var4.size() >= 3) { ++ for (int var5 = 1; var5 < var4.size(); ++var5) { + ProfilerResult var6 = (ProfilerResult)var4.get(var5); +- var3.append(String.format("[%02d] ", new Object[]{Integer.valueOf(var1)})); ++ par3StringBuilder.append(String.format("[%02d] ", new Object[] {Integer.valueOf(par1)})); + +- for(int var7 = 0; var7 < var1; ++var7) { +- var3.append(" "); ++ for (int var7 = 0; var7 < par1; ++var7) { ++ par3StringBuilder.append(" "); + } + +- var3.append(var6.c); +- var3.append(" - "); +- var3.append(String.format("%.2f", new Object[]{Double.valueOf(var6.field_76332_a)})); +- var3.append("%/"); +- var3.append(String.format("%.2f", new Object[]{Double.valueOf(var6.field_76330_b)})); +- var3.append("%\n"); +- if(!var6.c.equals("unspecified")) { ++ par3StringBuilder.append(var6.field_76331_c); ++ par3StringBuilder.append(" - "); ++ par3StringBuilder.append(String.format("%.2f", new Object[] {Double.valueOf(var6.field_76332_a)})); ++ par3StringBuilder.append("%/"); ++ par3StringBuilder.append(String.format("%.2f", new Object[] {Double.valueOf(var6.field_76330_b)})); ++ par3StringBuilder.append("%\n"); ++ ++ if (!var6.field_76331_c.equals("unspecified")) { + try { +- this.getProfileDump(var1 + 1, var2 + "." + var6.c, var3); ++ this.getProfileDump(par1 + 1, par2Str + "." + var6.field_76331_c, par3StringBuilder); + } catch (Exception var8) { +- var3.append("[[ EXCEPTION " + var8 + " ]]"); ++ par3StringBuilder.append("[[ EXCEPTION " + var8 + " ]]"); + } + } + } +- + } + } + ++ /** ++ * Returns a random "witty" comment. ++ */ + private static String getWittyComment() { +- String[] var0 = new String[]{"Shiny numbers!", "Am I not running fast enough? :(", "I\'m working as hard as I can!", "Will I ever be good enough for you? :(", "Speedy. Zoooooom!", "Hello world", "40% better than a crash report.", "Now with extra numbers", "Now with less numbers", "Now with the same numbers", "You should add flames to things, it makes them go faster!", "Do you feel the need for... optimization?", "*cracks redstone whip*", "Maybe if you treated it better then it\'ll have more motivation to work faster! Poor server."}; ++ String[] var0 = new String[] {"Shiny numbers!", "Am I not running fast enough? :(", "I\'m working as hard as I can!", "Will I ever be good enough for you? :(", "Speedy. Zoooooom!", "Hello world", "40% better than a crash report.", "Now with extra numbers", "Now with less numbers", "Now with the same numbers", "You should add flames to things, it makes them go faster!", "Do you feel the need for... optimization?", "*cracks redstone whip*", "Maybe if you treated it better then it\'ll have more motivation to work faster! Poor server."}; + + try { + return var0[(int)(System.nanoTime() % (long)var0.length)]; +@@ -120,7 +130,10 @@ + } + } + +- public List addTabCompletionOptions(ICommandSender var1, String[] var2) { +- return var2.length == 1 ? getListOfStringsMatchingLastWord(var2, new String[]{"start", "stop"}) : null; ++ /** ++ * Adds the strings available in this command to the given list of tab completion options. ++ */ ++ public List addTabCompletionOptions(ICommandSender par1ICommandSender, String[] par2ArrayOfStr) { ++ return par2ArrayOfStr.length == 1 ? getListOfStringsMatchingLastWord(par2ArrayOfStr, new String[] {"start", "stop"}): null; + } + } diff --git a/patches/net/minecraft/src/CommandDefaultGameMode.java.patch b/patches/net/minecraft/src/CommandDefaultGameMode.java.patch new file mode 100644 index 0000000..fdaca89 --- /dev/null +++ b/patches/net/minecraft/src/CommandDefaultGameMode.java.patch @@ -0,0 +1,44 @@ +--- net/minecraft/src/CommandDefaultGameMode.java ++++ net/minecraft/src/CommandDefaultGameMode.java +@@ -8,30 +8,30 @@ + return "defaultgamemode"; + } + +- public String getCommandUsage(ICommandSender var1) { ++ public String getCommandUsage(ICommandSender par1ICommandSender) { + return "commands.defaultgamemode.usage"; + } + +- public void processCommand(ICommandSender var1, String[] var2) { +- if(var2.length > 0) { +- EnumGameType var3 = this.getGameModeFromCommand(var1, var2[0]); ++ public void processCommand(ICommandSender par1ICommandSender, String[] par2ArrayOfStr) { ++ if (par2ArrayOfStr.length > 0) { ++ EnumGameType var3 = this.getGameModeFromCommand(par1ICommandSender, par2ArrayOfStr[0]); + this.setGameType(var3); +- notifyAdmins(var1, "commands.defaultgamemode.success", new Object[]{ChatMessageComponent.createFromTranslationKey("gameMode." + var3.getName())}); ++ notifyAdmins(par1ICommandSender, "commands.defaultgamemode.success", new Object[] {ChatMessageComponent.createFromTranslationKey("gameMode." + var3.getName())}); + } else { + throw new WrongUsageException("commands.defaultgamemode.usage", new Object[0]); + } + } + +- protected void setGameType(EnumGameType var1) { ++ protected void setGameType(EnumGameType par1EnumGameType) { + MinecraftServer var2 = MinecraftServer.getServer(); +- var2.setGameType(var1); ++ var2.setGameType(par1EnumGameType); + EntityPlayerMP var4; +- if(var2.getForceGamemode()) { +- for(Iterator var3 = MinecraftServer.getServer().getConfigurationManager().a.iterator(); var3.hasNext(); var4.fallDistance = 0.0F) { ++ ++ if (var2.getForceGamemode()) { ++ for (Iterator var3 = MinecraftServer.getServer().getConfigurationManager().playerEntityList.iterator(); var3.hasNext(); var4.fallDistance = 0.0F) { + var4 = (EntityPlayerMP)var3.next(); +- var4.setGameType(var1); ++ var4.setGameType(par1EnumGameType); + } + } +- + } + } diff --git a/patches/net/minecraft/src/CommandDifficulty.java.patch b/patches/net/minecraft/src/CommandDifficulty.java.patch new file mode 100644 index 0000000..98e3b4f --- /dev/null +++ b/patches/net/minecraft/src/CommandDifficulty.java.patch @@ -0,0 +1,57 @@ +--- net/minecraft/src/CommandDifficulty.java ++++ net/minecraft/src/CommandDifficulty.java +@@ -4,35 +4,44 @@ + import net.minecraft.server.MinecraftServer; + + public class CommandDifficulty extends CommandBase { +- private static final String[] a = new String[]{"options.difficulty.peaceful", "options.difficulty.easy", "options.difficulty.normal", "options.difficulty.hard"}; ++ private static final String[] difficulties = new String[] {"options.difficulty.peaceful", "options.difficulty.easy", "options.difficulty.normal", "options.difficulty.hard"}; + + public String getCommandName() { + return "difficulty"; + } + ++ /** ++ * Return the required permission level for this command. ++ */ + public int getRequiredPermissionLevel() { + return 2; + } + +- public String getCommandUsage(ICommandSender var1) { ++ public String getCommandUsage(ICommandSender par1ICommandSender) { + return "commands.difficulty.usage"; + } + +- public void processCommand(ICommandSender var1, String[] var2) { +- if(var2.length > 0) { +- int var3 = this.getDifficultyForName(var1, var2[0]); ++ public void processCommand(ICommandSender par1ICommandSender, String[] par2ArrayOfStr) { ++ if (par2ArrayOfStr.length > 0) { ++ int var3 = this.getDifficultyForName(par1ICommandSender, par2ArrayOfStr[0]); + MinecraftServer.getServer().setDifficultyForAllWorlds(var3); +- notifyAdmins(var1, "commands.difficulty.success", new Object[]{ChatMessageComponent.createFromTranslationKey(a[var3])}); ++ notifyAdmins(par1ICommandSender, "commands.difficulty.success", new Object[] {ChatMessageComponent.createFromTranslationKey(difficulties[var3])}); + } else { + throw new WrongUsageException("commands.difficulty.usage", new Object[0]); + } + } + +- protected int getDifficultyForName(ICommandSender var1, String var2) { +- return !var2.equalsIgnoreCase("peaceful") && !var2.equalsIgnoreCase("p") ? (!var2.equalsIgnoreCase("easy") && !var2.equalsIgnoreCase("e") ? (!var2.equalsIgnoreCase("normal") && !var2.equalsIgnoreCase("n") ? (!var2.equalsIgnoreCase("hard") && !var2.equalsIgnoreCase("h") ? parseIntBounded(var1, var2, 0, 3) : 3) : 2) : 1) : 0; ++ /** ++ * Return the difficulty value for the specified string. ++ */ ++ protected int getDifficultyForName(ICommandSender par1ICommandSender, String par2Str) { ++ return !par2Str.equalsIgnoreCase("peaceful") && !par2Str.equalsIgnoreCase("p") ? (!par2Str.equalsIgnoreCase("easy") && !par2Str.equalsIgnoreCase("e") ? (!par2Str.equalsIgnoreCase("normal") && !par2Str.equalsIgnoreCase("n") ? (!par2Str.equalsIgnoreCase("hard") && !par2Str.equalsIgnoreCase("h") ? parseIntBounded(par1ICommandSender, par2Str, 0, 3) : 3) : 2) : 1) : 0; + } + +- public List addTabCompletionOptions(ICommandSender var1, String[] var2) { +- return var2.length == 1 ? getListOfStringsMatchingLastWord(var2, new String[]{"peaceful", "easy", "normal", "hard"}) : null; ++ /** ++ * Adds the strings available in this command to the given list of tab completion options. ++ */ ++ public List addTabCompletionOptions(ICommandSender par1ICommandSender, String[] par2ArrayOfStr) { ++ return par2ArrayOfStr.length == 1 ? getListOfStringsMatchingLastWord(par2ArrayOfStr, new String[] {"peaceful", "easy", "normal", "hard"}): null; + } + } diff --git a/patches/net/minecraft/src/CommandEffect.java.patch b/patches/net/minecraft/src/CommandEffect.java.patch new file mode 100644 index 0000000..551fdd3 --- /dev/null +++ b/patches/net/minecraft/src/CommandEffect.java.patch @@ -0,0 +1,117 @@ +--- net/minecraft/src/CommandEffect.java ++++ net/minecraft/src/CommandEffect.java +@@ -8,76 +8,87 @@ + return "effect"; + } + ++ /** ++ * Return the required permission level for this command. ++ */ + public int getRequiredPermissionLevel() { + return 2; + } + +- public String getCommandUsage(ICommandSender var1) { ++ public String getCommandUsage(ICommandSender par1ICommandSender) { + return "commands.effect.usage"; + } + +- public void processCommand(ICommandSender var1, String[] var2) { +- if(var2.length < 2) { ++ public void processCommand(ICommandSender par1ICommandSender, String[] par2ArrayOfStr) { ++ if (par2ArrayOfStr.length < 2) { + throw new WrongUsageException("commands.effect.usage", new Object[0]); + } else { +- EntityPlayerMP var3 = getPlayer(var1, var2[0]); +- if(var2[1].equals("clear")) { +- if(var3.getActivePotionEffects().isEmpty()) { +- throw new CommandException("commands.effect.failure.notActive.all", new Object[]{var3.getEntityName()}); ++ EntityPlayerMP var3 = getPlayer(par1ICommandSender, par2ArrayOfStr[0]); ++ ++ if (par2ArrayOfStr[1].equals("clear")) { ++ if (var3.getActivePotionEffects().isEmpty()) { ++ throw new CommandException("commands.effect.failure.notActive.all", new Object[] {var3.getEntityName()}); + } + + var3.clearActivePotions(); +- notifyAdmins(var1, "commands.effect.success.removed.all", new Object[]{var3.getEntityName()}); ++ notifyAdmins(par1ICommandSender, "commands.effect.success.removed.all", new Object[] {var3.getEntityName()}); + } else { +- int var4 = parseIntWithMin(var1, var2[1], 1); ++ int var4 = parseIntWithMin(par1ICommandSender, par2ArrayOfStr[1], 1); + int var5 = 600; + int var6 = 30; + int var7 = 0; +- if(var4 < 0 || var4 >= Potion.potionTypes.length || Potion.potionTypes[var4] == null) { +- throw new NumberInvalidException("commands.effect.notFound", new Object[]{Integer.valueOf(var4)}); ++ ++ if (var4 < 0 || var4 >= Potion.potionTypes.length || Potion.potionTypes[var4] == null) { ++ throw new NumberInvalidException("commands.effect.notFound", new Object[] {Integer.valueOf(var4)}); + } + +- if(var2.length >= 3) { +- var6 = parseIntBounded(var1, var2[2], 0, 1000000); +- if(Potion.potionTypes[var4].isInstant()) { ++ if (par2ArrayOfStr.length >= 3) { ++ var6 = parseIntBounded(par1ICommandSender, par2ArrayOfStr[2], 0, 1000000); ++ ++ if (Potion.potionTypes[var4].isInstant()) { + var5 = var6; + } else { + var5 = var6 * 20; + } +- } else if(Potion.potionTypes[var4].isInstant()) { ++ } else if (Potion.potionTypes[var4].isInstant()) { + var5 = 1; + } + +- if(var2.length >= 4) { +- var7 = parseIntBounded(var1, var2[3], 0, 255); ++ if (par2ArrayOfStr.length >= 4) { ++ var7 = parseIntBounded(par1ICommandSender, par2ArrayOfStr[3], 0, 255); + } + +- if(var6 == 0) { +- if(!var3.isPotionActive(var4)) { +- throw new CommandException("commands.effect.failure.notActive", new Object[]{ChatMessageComponent.createFromTranslationKey(Potion.potionTypes[var4].getName()), var3.getEntityName()}); ++ if (var6 == 0) { ++ if (!var3.isPotionActive(var4)) { ++ throw new CommandException("commands.effect.failure.notActive", new Object[] {ChatMessageComponent.createFromTranslationKey(Potion.potionTypes[var4].getName()), var3.getEntityName()}); + } + + var3.removePotionEffect(var4); +- notifyAdmins(var1, "commands.effect.success.removed", new Object[]{ChatMessageComponent.createFromTranslationKey(Potion.potionTypes[var4].getName()), var3.getEntityName()}); ++ notifyAdmins(par1ICommandSender, "commands.effect.success.removed", new Object[] {ChatMessageComponent.createFromTranslationKey(Potion.potionTypes[var4].getName()), var3.getEntityName()}); + } else { + PotionEffect var8 = new PotionEffect(var4, var5, var7); + var3.addPotionEffect(var8); +- notifyAdmins(var1, "commands.effect.success", new Object[]{ChatMessageComponent.createFromTranslationKey(var8.getEffectName()), Integer.valueOf(var4), Integer.valueOf(var7), var3.getEntityName(), Integer.valueOf(var6)}); ++ notifyAdmins(par1ICommandSender, "commands.effect.success", new Object[] {ChatMessageComponent.createFromTranslationKey(var8.getEffectName()), Integer.valueOf(var4), Integer.valueOf(var7), var3.getEntityName(), Integer.valueOf(var6)}); + } + } +- + } + } + +- public List addTabCompletionOptions(ICommandSender var1, String[] var2) { +- return var2.length == 1 ? getListOfStringsMatchingLastWord(var2, this.getAllUsernames()) : null; ++ /** ++ * Adds the strings available in this command to the given list of tab completion options. ++ */ ++ public List addTabCompletionOptions(ICommandSender par1ICommandSender, String[] par2ArrayOfStr) { ++ return par2ArrayOfStr.length == 1 ? getListOfStringsMatchingLastWord(par2ArrayOfStr, this.getAllUsernames()) : null; + } + + protected String[] getAllUsernames() { + return MinecraftServer.getServer().getAllUsernames(); + } + +- public boolean isUsernameIndex(String[] var1, int var2) { +- return var2 == 0; ++ /** ++ * Return whether the specified command parameter index is a username parameter. ++ */ ++ public boolean isUsernameIndex(String[] par1ArrayOfStr, int par2) { ++ return par2 == 0; + } + } diff --git a/patches/net/minecraft/src/CommandEnchant.java.patch b/patches/net/minecraft/src/CommandEnchant.java.patch new file mode 100644 index 0000000..4b15a4f --- /dev/null +++ b/patches/net/minecraft/src/CommandEnchant.java.patch @@ -0,0 +1,105 @@ +--- net/minecraft/src/CommandEnchant.java ++++ net/minecraft/src/CommandEnchant.java +@@ -8,44 +8,52 @@ + return "enchant"; + } + ++ /** ++ * Return the required permission level for this command. ++ */ + public int getRequiredPermissionLevel() { + return 2; + } + +- public String getCommandUsage(ICommandSender var1) { ++ public String getCommandUsage(ICommandSender par1ICommandSender) { + return "commands.enchant.usage"; + } + +- public void processCommand(ICommandSender var1, String[] var2) { +- if(var2.length < 2) { ++ public void processCommand(ICommandSender par1ICommandSender, String[] par2ArrayOfStr) { ++ if (par2ArrayOfStr.length < 2) { + throw new WrongUsageException("commands.enchant.usage", new Object[0]); + } else { +- EntityPlayerMP var3 = getPlayer(var1, var2[0]); +- int var4 = parseIntBounded(var1, var2[1], 0, Enchantment.enchantmentsList.length - 1); ++ EntityPlayerMP var3 = getPlayer(par1ICommandSender, par2ArrayOfStr[0]); ++ int var4 = parseIntBounded(par1ICommandSender, par2ArrayOfStr[1], 0, Enchantment.enchantmentsList.length - 1); + int var5 = 1; + ItemStack var6 = var3.getCurrentEquippedItem(); +- if(var6 == null) { ++ ++ if (var6 == null) { + throw new CommandException("commands.enchant.noItem", new Object[0]); + } else { + Enchantment var7 = Enchantment.enchantmentsList[var4]; +- if(var7 == null) { +- throw new NumberInvalidException("commands.enchant.notFound", new Object[]{Integer.valueOf(var4)}); +- } else if(!var7.canApply(var6)) { ++ ++ if (var7 == null) { ++ throw new NumberInvalidException("commands.enchant.notFound", new Object[] {Integer.valueOf(var4)}); ++ } else if (!var7.canApply(var6)) { + throw new CommandException("commands.enchant.cantEnchant", new Object[0]); + } else { +- if(var2.length >= 3) { +- var5 = parseIntBounded(var1, var2[2], var7.getMinLevel(), var7.getMaxLevel()); ++ if (par2ArrayOfStr.length >= 3) { ++ var5 = parseIntBounded(par1ICommandSender, par2ArrayOfStr[2], var7.getMinLevel(), var7.getMaxLevel()); + } + +- if(var6.hasTagCompound()) { ++ if (var6.hasTagCompound()) { + NBTTagList var8 = var6.getEnchantmentTagList(); +- if(var8 != null) { +- for(int var9 = 0; var9 < var8.tagCount(); ++var9) { ++ ++ if (var8 != null) { ++ for (int var9 = 0; var9 < var8.tagCount(); ++var9) { + short var10 = ((NBTTagCompound)var8.tagAt(var9)).getShort("id"); +- if(Enchantment.enchantmentsList[var10] != null) { ++ ++ if (Enchantment.enchantmentsList[var10] != null) { + Enchantment var11 = Enchantment.enchantmentsList[var10]; +- if(!var11.canApplyTogether(var7)) { +- throw new CommandException("commands.enchant.cantCombine", new Object[]{var7.getTranslatedName(var5), var11.getTranslatedName(((NBTTagCompound)var8.tagAt(var9)).getShort("lvl"))}); ++ ++ if (!var11.canApplyTogether(var7)) { ++ throw new CommandException("commands.enchant.cantCombine", new Object[] {var7.getTranslatedName(var5), var11.getTranslatedName(((NBTTagCompound)var8.tagAt(var9)).getShort("lvl"))}); + } + } + } +@@ -53,21 +61,27 @@ + } + + var6.addEnchantment(var7, var5); +- notifyAdmins(var1, "commands.enchant.success", new Object[0]); ++ notifyAdmins(par1ICommandSender, "commands.enchant.success", new Object[0]); + } + } + } + } + +- public List addTabCompletionOptions(ICommandSender var1, String[] var2) { +- return var2.length == 1 ? getListOfStringsMatchingLastWord(var2, this.getListOfPlayers()) : null; ++ /** ++ * Adds the strings available in this command to the given list of tab completion options. ++ */ ++ public List addTabCompletionOptions(ICommandSender par1ICommandSender, String[] par2ArrayOfStr) { ++ return par2ArrayOfStr.length == 1 ? getListOfStringsMatchingLastWord(par2ArrayOfStr, this.getListOfPlayers()) : null; + } + + protected String[] getListOfPlayers() { + return MinecraftServer.getServer().getAllUsernames(); + } + +- public boolean isUsernameIndex(String[] var1, int var2) { +- return var2 == 0; ++ /** ++ * Return whether the specified command parameter index is a username parameter. ++ */ ++ public boolean isUsernameIndex(String[] par1ArrayOfStr, int par2) { ++ return par2 == 0; + } + } diff --git a/patches/net/minecraft/src/CommandException.java.patch b/patches/net/minecraft/src/CommandException.java.patch new file mode 100644 index 0000000..23001ab --- /dev/null +++ b/patches/net/minecraft/src/CommandException.java.patch @@ -0,0 +1,22 @@ +--- net/minecraft/src/CommandException.java ++++ net/minecraft/src/CommandException.java +@@ -1,14 +1,14 @@ + package net.minecraft.src; + + public class CommandException extends RuntimeException { +- private Object[] a; ++ private Object[] errorObjects; + +- public CommandException(String var1, Object... var2) { +- super(var1); +- this.a = var2; ++ public CommandException(String par1Str, Object ... par2ArrayOfObj) { ++ super(par1Str); ++ this.errorObjects = par2ArrayOfObj; + } + + public Object[] getErrorOjbects() { +- return this.a; ++ return this.errorObjects; + } + } diff --git a/patches/net/minecraft/src/CommandGameMode.java.patch b/patches/net/minecraft/src/CommandGameMode.java.patch new file mode 100644 index 0000000..b5b72fe --- /dev/null +++ b/patches/net/minecraft/src/CommandGameMode.java.patch @@ -0,0 +1,82 @@ +--- net/minecraft/src/CommandGameMode.java ++++ net/minecraft/src/CommandGameMode.java +@@ -8,45 +8,60 @@ + return "gamemode"; + } + ++ /** ++ * Return the required permission level for this command. ++ */ + public int getRequiredPermissionLevel() { + return 2; + } + +- public String getCommandUsage(ICommandSender var1) { ++ public String getCommandUsage(ICommandSender par1ICommandSender) { + return "commands.gamemode.usage"; + } + +- public void processCommand(ICommandSender var1, String[] var2) { +- if(var2.length > 0) { +- EnumGameType var3 = this.getGameModeFromCommand(var1, var2[0]); +- EntityPlayerMP var4 = var2.length >= 2 ? getPlayer(var1, var2[1]) : getCommandSenderAsPlayer(var1); ++ public void processCommand(ICommandSender par1ICommandSender, String[] par2ArrayOfStr) { ++ if (par2ArrayOfStr.length > 0) { ++ EnumGameType var3 = this.getGameModeFromCommand(par1ICommandSender, par2ArrayOfStr[0]); ++ EntityPlayerMP var4 = par2ArrayOfStr.length >= 2 ? getPlayer(par1ICommandSender, par2ArrayOfStr[1]) : getCommandSenderAsPlayer(par1ICommandSender); + var4.setGameType(var3); + var4.fallDistance = 0.0F; + ChatMessageComponent var5 = ChatMessageComponent.createFromTranslationKey("gameMode." + var3.getName()); +- if(var4 != var1) { +- notifyAdmins(var1, 1, "commands.gamemode.success.other", new Object[]{var4.getEntityName(), var5}); ++ ++ if (var4 != par1ICommandSender) { ++ notifyAdmins(par1ICommandSender, 1, "commands.gamemode.success.other", new Object[] {var4.getEntityName(), var5}); + } else { +- notifyAdmins(var1, 1, "commands.gamemode.success.self", new Object[]{var5}); ++ notifyAdmins(par1ICommandSender, 1, "commands.gamemode.success.self", new Object[] {var5}); + } +- + } else { + throw new WrongUsageException("commands.gamemode.usage", new Object[0]); + } + } + +- protected EnumGameType getGameModeFromCommand(ICommandSender var1, String var2) { +- return !var2.equalsIgnoreCase(EnumGameType.SURVIVAL.getName()) && !var2.equalsIgnoreCase("s") ? (!var2.equalsIgnoreCase(EnumGameType.CREATIVE.getName()) && !var2.equalsIgnoreCase("c") ? (!var2.equalsIgnoreCase(EnumGameType.ADVENTURE.getName()) && !var2.equalsIgnoreCase("a") ? WorldSettings.getGameTypeById(parseIntBounded(var1, var2, 0, EnumGameType.values().length - 2)) : EnumGameType.ADVENTURE) : EnumGameType.CREATIVE) : EnumGameType.SURVIVAL; +- } +- +- public List addTabCompletionOptions(ICommandSender var1, String[] var2) { +- return var2.length == 1 ? getListOfStringsMatchingLastWord(var2, new String[]{"survival", "creative", "adventure"}) : (var2.length == 2 ? getListOfStringsMatchingLastWord(var2, this.getListOfPlayerUsernames()) : null); +- } +- ++ /** ++ * Gets the Game Mode specified in the command. ++ */ ++ protected EnumGameType getGameModeFromCommand(ICommandSender par1ICommandSender, String par2Str) { ++ return !par2Str.equalsIgnoreCase(EnumGameType.SURVIVAL.getName()) && !par2Str.equalsIgnoreCase("s") ? (!par2Str.equalsIgnoreCase(EnumGameType.CREATIVE.getName()) && !par2Str.equalsIgnoreCase("c") ? (!par2Str.equalsIgnoreCase(EnumGameType.ADVENTURE.getName()) && !par2Str.equalsIgnoreCase("a") ? WorldSettings.getGameTypeById(parseIntBounded(par1ICommandSender, par2Str, 0, EnumGameType.values().length - 2)) : EnumGameType.ADVENTURE) : EnumGameType.CREATIVE) : EnumGameType.SURVIVAL; ++ } ++ ++ /** ++ * Adds the strings available in this command to the given list of tab completion options. ++ */ ++ public List addTabCompletionOptions(ICommandSender par1ICommandSender, String[] par2ArrayOfStr) { ++ return par2ArrayOfStr.length == 1 ? getListOfStringsMatchingLastWord(par2ArrayOfStr, new String[] {"survival", "creative", "adventure"}): (par2ArrayOfStr.length == 2 ? getListOfStringsMatchingLastWord(par2ArrayOfStr, this.getListOfPlayerUsernames()) : null); ++ } ++ ++ /** ++ * Returns String array containing all player usernames in the server. ++ */ + protected String[] getListOfPlayerUsernames() { + return MinecraftServer.getServer().getAllUsernames(); + } + +- public boolean isUsernameIndex(String[] var1, int var2) { +- return var2 == 1; ++ /** ++ * Return whether the specified command parameter index is a username parameter. ++ */ ++ public boolean isUsernameIndex(String[] par1ArrayOfStr, int par2) { ++ return par2 == 1; + } + } diff --git a/patches/net/minecraft/src/CommandGameRule.java.patch b/patches/net/minecraft/src/CommandGameRule.java.patch new file mode 100644 index 0000000..89ea0af --- /dev/null +++ b/patches/net/minecraft/src/CommandGameRule.java.patch @@ -0,0 +1,81 @@ +--- net/minecraft/src/CommandGameRule.java ++++ net/minecraft/src/CommandGameRule.java +@@ -8,49 +8,59 @@ + return "gamerule"; + } + ++ /** ++ * Return the required permission level for this command. ++ */ + public int getRequiredPermissionLevel() { + return 2; + } + +- public String getCommandUsage(ICommandSender var1) { ++ public String getCommandUsage(ICommandSender par1ICommandSender) { + return "commands.gamerule.usage"; + } + +- public void processCommand(ICommandSender var1, String[] var2) { ++ public void processCommand(ICommandSender par1ICommandSender, String[] par2ArrayOfStr) { + String var6; +- if(var2.length == 2) { +- var6 = var2[0]; +- String var7 = var2[1]; ++ ++ if (par2ArrayOfStr.length == 2) { ++ var6 = par2ArrayOfStr[0]; ++ String var7 = par2ArrayOfStr[1]; + GameRules var8 = this.getGameRules(); +- if(var8.hasRule(var6)) { ++ ++ if (var8.hasRule(var6)) { + var8.setOrCreateGameRule(var6, var7); +- notifyAdmins(var1, "commands.gamerule.success", new Object[0]); ++ notifyAdmins(par1ICommandSender, "commands.gamerule.success", new Object[0]); + } else { +- notifyAdmins(var1, "commands.gamerule.norule", new Object[]{var6}); ++ notifyAdmins(par1ICommandSender, "commands.gamerule.norule", new Object[] {var6}); + } +- +- } else if(var2.length == 1) { +- var6 = var2[0]; ++ } else if (par2ArrayOfStr.length == 1) { ++ var6 = par2ArrayOfStr[0]; + GameRules var4 = this.getGameRules(); +- if(var4.hasRule(var6)) { ++ ++ if (var4.hasRule(var6)) { + String var5 = var4.getGameRuleStringValue(var6); +- var1.sendChatToPlayer(ChatMessageComponent.createFromText(var6).addText(" = ").addText(var5)); ++ par1ICommandSender.sendChatToPlayer(ChatMessageComponent.createFromText(var6).addText(" = ").addText(var5)); + } else { +- notifyAdmins(var1, "commands.gamerule.norule", new Object[]{var6}); ++ notifyAdmins(par1ICommandSender, "commands.gamerule.norule", new Object[] {var6}); + } +- +- } else if(var2.length == 0) { ++ } else if (par2ArrayOfStr.length == 0) { + GameRules var3 = this.getGameRules(); +- var1.sendChatToPlayer(ChatMessageComponent.createFromText(joinNiceString(var3.getRules()))); ++ par1ICommandSender.sendChatToPlayer(ChatMessageComponent.createFromText(joinNiceString(var3.getRules()))); + } else { + throw new WrongUsageException("commands.gamerule.usage", new Object[0]); + } + } + +- public List addTabCompletionOptions(ICommandSender var1, String[] var2) { +- return var2.length == 1 ? getListOfStringsMatchingLastWord(var2, this.getGameRules().getRules()) : (var2.length == 2 ? getListOfStringsMatchingLastWord(var2, new String[]{"true", "false"}) : null); ++ /** ++ * Adds the strings available in this command to the given list of tab completion options. ++ */ ++ public List addTabCompletionOptions(ICommandSender par1ICommandSender, String[] par2ArrayOfStr) { ++ return par2ArrayOfStr.length == 1 ? getListOfStringsMatchingLastWord(par2ArrayOfStr, this.getGameRules().getRules()) : (par2ArrayOfStr.length == 2 ? getListOfStringsMatchingLastWord(par2ArrayOfStr, new String[] {"true", "false"}): null); + } + ++ /** ++ * Return the game rule set this command should be able to manipulate. ++ */ + private GameRules getGameRules() { + return MinecraftServer.getServer().worldServerForDimension(0).getGameRules(); + } diff --git a/patches/net/minecraft/src/CommandGive.java.patch b/patches/net/minecraft/src/CommandGive.java.patch new file mode 100644 index 0000000..9478d44 --- /dev/null +++ b/patches/net/minecraft/src/CommandGive.java.patch @@ -0,0 +1,79 @@ +--- net/minecraft/src/CommandGive.java ++++ net/minecraft/src/CommandGive.java +@@ -8,50 +8,60 @@ + return "give"; + } + ++ /** ++ * Return the required permission level for this command. ++ */ + public int getRequiredPermissionLevel() { + return 2; + } + +- public String getCommandUsage(ICommandSender var1) { ++ public String getCommandUsage(ICommandSender par1ICommandSender) { + return "commands.give.usage"; + } + +- public void processCommand(ICommandSender var1, String[] var2) { +- if(var2.length >= 2) { +- EntityPlayerMP var3 = getPlayer(var1, var2[0]); +- int var4 = parseIntWithMin(var1, var2[1], 1); ++ public void processCommand(ICommandSender par1ICommandSender, String[] par2ArrayOfStr) { ++ if (par2ArrayOfStr.length >= 2) { ++ EntityPlayerMP var3 = getPlayer(par1ICommandSender, par2ArrayOfStr[0]); ++ int var4 = parseIntWithMin(par1ICommandSender, par2ArrayOfStr[1], 1); + int var5 = 1; + int var6 = 0; +- if(Item.itemsList[var4] == null) { +- throw new NumberInvalidException("commands.give.notFound", new Object[]{Integer.valueOf(var4)}); ++ ++ if (Item.itemsList[var4] == null) { ++ throw new NumberInvalidException("commands.give.notFound", new Object[] {Integer.valueOf(var4)}); + } else { +- if(var2.length >= 3) { +- var5 = parseIntBounded(var1, var2[2], 1, 64); ++ if (par2ArrayOfStr.length >= 3) { ++ var5 = parseIntBounded(par1ICommandSender, par2ArrayOfStr[2], 1, 64); + } + +- if(var2.length >= 4) { +- var6 = parseInt(var1, var2[3]); ++ if (par2ArrayOfStr.length >= 4) { ++ var6 = parseInt(par1ICommandSender, par2ArrayOfStr[3]); + } + + ItemStack var7 = new ItemStack(var4, var5, var6); + EntityItem var8 = var3.dropPlayerItem(var7); + var8.delayBeforeCanPickup = 0; +- notifyAdmins(var1, "commands.give.success", new Object[]{Item.itemsList[var4].getItemStackDisplayName(var7), Integer.valueOf(var4), Integer.valueOf(var5), var3.getEntityName()}); ++ notifyAdmins(par1ICommandSender, "commands.give.success", new Object[] {Item.itemsList[var4].getItemStackDisplayName(var7), Integer.valueOf(var4), Integer.valueOf(var5), var3.getEntityName()}); + } + } else { + throw new WrongUsageException("commands.give.usage", new Object[0]); + } + } + +- public List addTabCompletionOptions(ICommandSender var1, String[] var2) { +- return var2.length == 1 ? getListOfStringsMatchingLastWord(var2, this.getPlayers()) : null; ++ /** ++ * Adds the strings available in this command to the given list of tab completion options. ++ */ ++ public List addTabCompletionOptions(ICommandSender par1ICommandSender, String[] par2ArrayOfStr) { ++ return par2ArrayOfStr.length == 1 ? getListOfStringsMatchingLastWord(par2ArrayOfStr, this.getPlayers()) : null; + } + + protected String[] getPlayers() { + return MinecraftServer.getServer().getAllUsernames(); + } + +- public boolean isUsernameIndex(String[] var1, int var2) { +- return var2 == 0; ++ /** ++ * Return whether the specified command parameter index is a username parameter. ++ */ ++ public boolean isUsernameIndex(String[] par1ArrayOfStr, int par2) { ++ return par2 == 0; + } + } diff --git a/patches/net/minecraft/src/CommandHandler.java.patch b/patches/net/minecraft/src/CommandHandler.java.patch new file mode 100644 index 0000000..62fb053 --- /dev/null +++ b/patches/net/minecraft/src/CommandHandler.java.patch @@ -0,0 +1,242 @@ +--- net/minecraft/src/CommandHandler.java ++++ net/minecraft/src/CommandHandler.java +@@ -10,122 +10,134 @@ + import java.util.Map.Entry; + + public class CommandHandler implements ICommandManager { +- private final Map a = new HashMap(); +- private final Set b = new HashSet(); +- +- public int executeCommand(ICommandSender var1, String var2) { +- var2 = var2.trim(); +- if(var2.startsWith("/")) { +- var2 = var2.substring(1); ++ ++ /** Map of Strings to the ICommand objects they represent */ ++ private final Map commandMap = new HashMap(); ++ ++ /** The set of ICommand objects currently loaded. */ ++ private final Set commandSet = new HashSet(); ++ ++ public int executeCommand(ICommandSender par1ICommandSender, String par2Str) { ++ par2Str = par2Str.trim(); ++ ++ if (par2Str.startsWith("/")) { ++ par2Str = par2Str.substring(1); + } + +- String[] var3 = var2.split(" "); ++ String[] var3 = par2Str.split(" "); + String var4 = var3[0]; + var3 = dropFirstString(var3); +- ICommand var5 = (ICommand)this.a.get(var4); ++ ICommand var5 = (ICommand)this.commandMap.get(var4); + int var6 = this.getUsernameIndex(var5, var3); + int var7 = 0; + + try { +- if(var5 == null) { ++ if (var5 == null) { + throw new CommandNotFoundException(); + } + +- if(var5.canCommandSenderUseCommand(var1)) { +- if(var6 > -1) { +- EntityPlayerMP[] var8 = PlayerSelector.matchPlayers(var1, var3[var6]); ++ if (var5.canCommandSenderUseCommand(par1ICommandSender)) { ++ if (var6 > -1) { ++ EntityPlayerMP[] var8 = PlayerSelector.matchPlayers(par1ICommandSender, var3[var6]); + String var9 = var3[var6]; + EntityPlayerMP[] var10 = var8; + int var11 = var8.length; + +- for(int var12 = 0; var12 < var11; ++var12) { ++ for (int var12 = 0; var12 < var11; ++var12) { + EntityPlayerMP var13 = var10[var12]; + var3[var6] = var13.getEntityName(); + + try { +- var5.processCommand(var1, var3); ++ var5.processCommand(par1ICommandSender, var3); + ++var7; + } catch (CommandException var15) { +- var1.sendChatToPlayer(ChatMessageComponent.createFromTranslationWithSubstitutions(var15.getMessage(), var15.getErrorOjbects()).setColor(EnumChatFormatting.RED)); ++ par1ICommandSender.sendChatToPlayer(ChatMessageComponent.createFromTranslationWithSubstitutions(var15.getMessage(), var15.getErrorOjbects()).setColor(EnumChatFormatting.RED)); + } + } + + var3[var6] = var9; + } else { +- var5.processCommand(var1, var3); ++ var5.processCommand(par1ICommandSender, var3); + ++var7; + } + } else { +- var1.sendChatToPlayer(ChatMessageComponent.createFromTranslationKey("commands.generic.permission").setColor(EnumChatFormatting.RED)); ++ par1ICommandSender.sendChatToPlayer(ChatMessageComponent.createFromTranslationKey("commands.generic.permission").setColor(EnumChatFormatting.RED)); + } + } catch (WrongUsageException var16) { +- var1.sendChatToPlayer(ChatMessageComponent.createFromTranslationWithSubstitutions("commands.generic.usage", new Object[]{ChatMessageComponent.createFromTranslationWithSubstitutions(var16.getMessage(), var16.getErrorOjbects())}).setColor(EnumChatFormatting.RED)); ++ par1ICommandSender.sendChatToPlayer(ChatMessageComponent.createFromTranslationWithSubstitutions("commands.generic.usage", new Object[] {ChatMessageComponent.createFromTranslationWithSubstitutions(var16.getMessage(), var16.getErrorOjbects())}).setColor(EnumChatFormatting.RED)); + } catch (CommandException var17) { +- var1.sendChatToPlayer(ChatMessageComponent.createFromTranslationWithSubstitutions(var17.getMessage(), var17.getErrorOjbects()).setColor(EnumChatFormatting.RED)); ++ par1ICommandSender.sendChatToPlayer(ChatMessageComponent.createFromTranslationWithSubstitutions(var17.getMessage(), var17.getErrorOjbects()).setColor(EnumChatFormatting.RED)); + } catch (Throwable var18) { +- var1.sendChatToPlayer(ChatMessageComponent.createFromTranslationKey("commands.generic.exception").setColor(EnumChatFormatting.RED)); ++ par1ICommandSender.sendChatToPlayer(ChatMessageComponent.createFromTranslationKey("commands.generic.exception").setColor(EnumChatFormatting.RED)); + var18.printStackTrace(); + } + + return var7; + } + +- public ICommand registerCommand(ICommand var1) { +- List var2 = var1.getCommandAliases(); +- this.a.put(var1.getCommandName(), var1); +- this.b.add(var1); +- if(var2 != null) { ++ /** ++ * adds the command and any aliases it has to the internal map of available commands ++ */ ++ public ICommand registerCommand(ICommand par1ICommand) { ++ List var2 = par1ICommand.getCommandAliases(); ++ this.commandMap.put(par1ICommand.getCommandName(), par1ICommand); ++ this.commandSet.add(par1ICommand); ++ ++ if (var2 != null) { + Iterator var3 = var2.iterator(); + +- while(true) { +- String var4; +- ICommand var5; +- do { +- if(!var3.hasNext()) { +- return var1; +- } +- +- var4 = (String)var3.next(); +- var5 = (ICommand)this.a.get(var4); +- } while(var5 != null && var5.getCommandName().equals(var4)); +- +- this.a.put(var4, var1); ++ while (var3.hasNext()) { ++ String var4 = (String)var3.next(); ++ ICommand var5 = (ICommand)this.commandMap.get(var4); ++ ++ if (var5 == null || !var5.getCommandName().equals(var4)) { ++ this.commandMap.put(var4, par1ICommand); ++ } + } +- } else { +- return var1; + } ++ ++ return par1ICommand; + } + +- private static String[] dropFirstString(String[] var0) { +- String[] var1 = new String[var0.length - 1]; ++ /** ++ * creates a new array and sets elements 0..n-2 to be 0..n-1 of the input (n elements) ++ */ ++ private static String[] dropFirstString(String[] par0ArrayOfStr) { ++ String[] var1 = new String[par0ArrayOfStr.length - 1]; + +- for(int var2 = 1; var2 < var0.length; ++var2) { +- var1[var2 - 1] = var0[var2]; ++ for (int var2 = 1; var2 < par0ArrayOfStr.length; ++var2) { ++ var1[var2 - 1] = par0ArrayOfStr[var2]; + } + + return var1; + } + +- public List getPossibleCommands(ICommandSender var1, String var2) { +- String[] var3 = var2.split(" ", -1); ++ /** ++ * Performs a "begins with" string match on each token in par2. Only returns commands that par1 can use. ++ */ ++ public List getPossibleCommands(ICommandSender par1ICommandSender, String par2Str) { ++ String[] var3 = par2Str.split(" ", -1); + String var4 = var3[0]; +- if(var3.length == 1) { ++ ++ if (var3.length == 1) { + ArrayList var8 = new ArrayList(); +- Iterator var6 = this.a.entrySet().iterator(); ++ Iterator var6 = this.commandMap.entrySet().iterator(); + +- while(var6.hasNext()) { ++ while (var6.hasNext()) { + Entry var7 = (Entry)var6.next(); +- if(CommandBase.doesStringStartWith(var4, (String)var7.getKey()) && ((ICommand)var7.getValue()).canCommandSenderUseCommand(var1)) { ++ ++ if (CommandBase.doesStringStartWith(var4, (String)var7.getKey()) && ((ICommand)var7.getValue()).canCommandSenderUseCommand(par1ICommandSender)) { + var8.add(var7.getKey()); + } + } + + return var8; + } else { +- if(var3.length > 1) { +- ICommand var5 = (ICommand)this.a.get(var4); +- if(var5 != null) { +- return var5.addTabCompletionOptions(var1, dropFirstString(var3)); ++ if (var3.length > 1) { ++ ICommand var5 = (ICommand)this.commandMap.get(var4); ++ ++ if (var5 != null) { ++ return var5.addTabCompletionOptions(par1ICommandSender, dropFirstString(var3)); + } + } + +@@ -133,13 +145,17 @@ + } + } + +- public List getPossibleCommands(ICommandSender var1) { ++ /** ++ * returns all commands that the commandSender can use ++ */ ++ public List getPossibleCommands(ICommandSender par1ICommandSender) { + ArrayList var2 = new ArrayList(); +- Iterator var3 = this.b.iterator(); ++ Iterator var3 = this.commandSet.iterator(); + +- while(var3.hasNext()) { ++ while (var3.hasNext()) { + ICommand var4 = (ICommand)var3.next(); +- if(var4.canCommandSenderUseCommand(var1)) { ++ ++ if (var4.canCommandSenderUseCommand(par1ICommandSender)) { + var2.add(var4); + } + } +@@ -147,16 +163,22 @@ + return var2; + } + ++ /** ++ * returns a map of string to commads. All commands are returned, not just ones which someone has permission to use. ++ */ + public Map getCommands() { +- return this.a; ++ return this.commandMap; + } + +- private int getUsernameIndex(ICommand var1, String[] var2) { +- if(var1 == null) { ++ /** ++ * Return a command's first parameter index containing a valid username. ++ */ ++ private int getUsernameIndex(ICommand par1ICommand, String[] par2ArrayOfStr) { ++ if (par1ICommand == null) { + return -1; + } else { +- for(int var3 = 0; var3 < var2.length; ++var3) { +- if(var1.isUsernameIndex(var2, var3) && PlayerSelector.matchesMultiplePlayers(var2[var3])) { ++ for (int var3 = 0; var3 < par2ArrayOfStr.length; ++var3) { ++ if (par1ICommand.isUsernameIndex(par2ArrayOfStr, var3) && PlayerSelector.matchesMultiplePlayers(par2ArrayOfStr[var3])) { + return var3; + } + } diff --git a/patches/net/minecraft/src/CommandHelp.java.patch b/patches/net/minecraft/src/CommandHelp.java.patch new file mode 100644 index 0000000..251d6d9 --- /dev/null +++ b/patches/net/minecraft/src/CommandHelp.java.patch @@ -0,0 +1,83 @@ +--- net/minecraft/src/CommandHelp.java ++++ net/minecraft/src/CommandHelp.java +@@ -11,54 +11,60 @@ + return "help"; + } + ++ /** ++ * Return the required permission level for this command. ++ */ + public int getRequiredPermissionLevel() { + return 0; + } + +- public String getCommandUsage(ICommandSender var1) { ++ public String getCommandUsage(ICommandSender par1ICommandSender) { + return "commands.help.usage"; + } + + public List getCommandAliases() { +- return Arrays.asList(new String[]{"?"}); ++ return Arrays.asList(new String[] {"?"}); + } + +- public void processCommand(ICommandSender var1, String[] var2) { +- List var3 = this.getSortedPossibleCommands(var1); ++ public void processCommand(ICommandSender par1ICommandSender, String[] par2ArrayOfStr) { ++ List var3 = this.getSortedPossibleCommands(par1ICommandSender); + byte var4 = 7; + int var5 = (var3.size() - 1) / var4; + boolean var6 = false; +- + ICommand var9; + int var11; ++ + try { +- var11 = var2.length == 0 ? 0 : parseIntBounded(var1, var2[0], 1, var5 + 1) - 1; ++ var11 = par2ArrayOfStr.length == 0 ? 0 : parseIntBounded(par1ICommandSender, par2ArrayOfStr[0], 1, var5 + 1) - 1; + } catch (NumberInvalidException var10) { + Map var8 = this.getCommands(); +- var9 = (ICommand)var8.get(var2[0]); +- if(var9 != null) { +- throw new WrongUsageException(var9.getCommandUsage(var1), new Object[0]); ++ var9 = (ICommand)var8.get(par2ArrayOfStr[0]); ++ ++ if (var9 != null) { ++ throw new WrongUsageException(var9.getCommandUsage(par1ICommandSender), new Object[0]); + } + + throw new CommandNotFoundException(); + } + + int var7 = Math.min((var11 + 1) * var4, var3.size()); +- var1.sendChatToPlayer(ChatMessageComponent.createFromTranslationWithSubstitutions("commands.help.header", new Object[]{Integer.valueOf(var11 + 1), Integer.valueOf(var5 + 1)}).setColor(EnumChatFormatting.DARK_GREEN)); ++ par1ICommandSender.sendChatToPlayer(ChatMessageComponent.createFromTranslationWithSubstitutions("commands.help.header", new Object[] {Integer.valueOf(var11 + 1), Integer.valueOf(var5 + 1)}).setColor(EnumChatFormatting.DARK_GREEN)); + +- for(int var12 = var11 * var4; var12 < var7; ++var12) { ++ for (int var12 = var11 * var4; var12 < var7; ++var12) { + var9 = (ICommand)var3.get(var12); +- var1.sendChatToPlayer(ChatMessageComponent.createFromTranslationKey(var9.getCommandUsage(var1))); +- } +- +- if(var11 == 0 && var1 instanceof EntityPlayer) { +- var1.sendChatToPlayer(ChatMessageComponent.createFromTranslationKey("commands.help.footer").setColor(EnumChatFormatting.GREEN)); +- } +- ++ par1ICommandSender.sendChatToPlayer(ChatMessageComponent.createFromTranslationKey(var9.getCommandUsage(par1ICommandSender))); ++ } ++ ++ if (var11 == 0 && par1ICommandSender instanceof EntityPlayer) { ++ par1ICommandSender.sendChatToPlayer(ChatMessageComponent.createFromTranslationKey("commands.help.footer").setColor(EnumChatFormatting.GREEN)); ++ } + } + +- protected List getSortedPossibleCommands(ICommandSender var1) { +- List var2 = MinecraftServer.getServer().getCommandManager().getPossibleCommands(var1); ++ /** ++ * Returns a sorted list of all possible commands for the given ICommandSender. ++ */ ++ protected List getSortedPossibleCommands(ICommandSender par1ICommandSender) { ++ List var2 = MinecraftServer.getServer().getCommandManager().getPossibleCommands(par1ICommandSender); + Collections.sort(var2); + return var2; + } diff --git a/patches/net/minecraft/src/CommandKill.java.patch b/patches/net/minecraft/src/CommandKill.java.patch new file mode 100644 index 0000000..c7e7c1a --- /dev/null +++ b/patches/net/minecraft/src/CommandKill.java.patch @@ -0,0 +1,27 @@ +--- net/minecraft/src/CommandKill.java ++++ net/minecraft/src/CommandKill.java +@@ -5,17 +5,20 @@ + return "kill"; + } + ++ /** ++ * Return the required permission level for this command. ++ */ + public int getRequiredPermissionLevel() { + return 0; + } + +- public String getCommandUsage(ICommandSender var1) { ++ public String getCommandUsage(ICommandSender par1ICommandSender) { + return "commands.kill.usage"; + } + +- public void processCommand(ICommandSender var1, String[] var2) { +- EntityPlayerMP var3 = getCommandSenderAsPlayer(var1); ++ public void processCommand(ICommandSender par1ICommandSender, String[] par2ArrayOfStr) { ++ EntityPlayerMP var3 = getCommandSenderAsPlayer(par1ICommandSender); + var3.attackEntityFrom(DamageSource.outOfWorld, Float.MAX_VALUE); +- var1.sendChatToPlayer(ChatMessageComponent.createFromTranslationKey("commands.kill.success")); ++ par1ICommandSender.sendChatToPlayer(ChatMessageComponent.createFromTranslationKey("commands.kill.success")); + } + } diff --git a/patches/net/minecraft/src/CommandNotFoundException.java.patch b/patches/net/minecraft/src/CommandNotFoundException.java.patch new file mode 100644 index 0000000..53416f8 --- /dev/null +++ b/patches/net/minecraft/src/CommandNotFoundException.java.patch @@ -0,0 +1,12 @@ +--- net/minecraft/src/CommandNotFoundException.java ++++ net/minecraft/src/CommandNotFoundException.java +@@ -5,7 +5,7 @@ + this("commands.generic.notFound", new Object[0]); + } + +- public CommandNotFoundException(String var1, Object... var2) { +- super(var1, var2); ++ public CommandNotFoundException(String par1Str, Object ... par2ArrayOfObj) { ++ super(par1Str, par2ArrayOfObj); + } + } diff --git a/patches/net/minecraft/src/CommandPlaySound.java.patch b/patches/net/minecraft/src/CommandPlaySound.java.patch new file mode 100644 index 0000000..f8824d0 --- /dev/null +++ b/patches/net/minecraft/src/CommandPlaySound.java.patch @@ -0,0 +1,132 @@ +--- net/minecraft/src/CommandPlaySound.java ++++ net/minecraft/src/CommandPlaySound.java +@@ -5,57 +5,62 @@ + return "playsound"; + } + ++ /** ++ * Return the required permission level for this command. ++ */ + public int getRequiredPermissionLevel() { + return 2; + } + +- public String getCommandUsage(ICommandSender var1) { ++ public String getCommandUsage(ICommandSender par1ICommandSender) { + return "commands.playsound.usage"; + } + +- public void processCommand(ICommandSender var1, String[] var2) { +- if(var2.length < 2) { +- throw new WrongUsageException(this.getCommandUsage(var1), new Object[0]); ++ public void processCommand(ICommandSender par1ICommandSender, String[] par2ArrayOfStr) { ++ if (par2ArrayOfStr.length < 2) { ++ throw new WrongUsageException(this.getCommandUsage(par1ICommandSender), new Object[0]); + } else { + byte var3 = 0; + int var36 = var3 + 1; +- String var4 = var2[var3]; +- EntityPlayerMP var5 = getPlayer(var1, var2[var36++]); +- double var6 = (double)var5.getCommandSenderPosition().posX; +- double var8 = (double)var5.getCommandSenderPosition().posY; +- double var10 = (double)var5.getCommandSenderPosition().posZ; ++ String var4 = par2ArrayOfStr[var3]; ++ EntityPlayerMP var5 = getPlayer(par1ICommandSender, par2ArrayOfStr[var36++]); ++ double var6 = (double)var5.getPlayerCoordinates().posX; ++ double var8 = (double)var5.getPlayerCoordinates().posY; ++ double var10 = (double)var5.getPlayerCoordinates().posZ; + double var12 = 1.0D; + double var14 = 1.0D; + double var16 = 0.0D; +- if(var2.length > var36) { +- var6 = func_110666_a(var1, var6, var2[var36++]); +- } +- +- if(var2.length > var36) { +- var8 = func_110665_a(var1, var8, var2[var36++], 0, 0); +- } +- +- if(var2.length > var36) { +- var10 = func_110666_a(var1, var10, var2[var36++]); +- } +- +- if(var2.length > var36) { +- var12 = func_110661_a(var1, var2[var36++], 0.0D, (double)Float.MAX_VALUE); +- } +- +- if(var2.length > var36) { +- var14 = func_110661_a(var1, var2[var36++], 0.0D, 2.0D); +- } +- +- if(var2.length > var36) { +- var16 = func_110661_a(var1, var2[var36++], 0.0D, 1.0D); ++ ++ if (par2ArrayOfStr.length > var36) { ++ var6 = func_110666_a(par1ICommandSender, var6, par2ArrayOfStr[var36++]); ++ } ++ ++ if (par2ArrayOfStr.length > var36) { ++ var8 = func_110665_a(par1ICommandSender, var8, par2ArrayOfStr[var36++], 0, 0); ++ } ++ ++ if (par2ArrayOfStr.length > var36) { ++ var10 = func_110666_a(par1ICommandSender, var10, par2ArrayOfStr[var36++]); ++ } ++ ++ if (par2ArrayOfStr.length > var36) { ++ var12 = func_110661_a(par1ICommandSender, par2ArrayOfStr[var36++], 0.0D, 3.4028234663852886E38D); ++ } ++ ++ if (par2ArrayOfStr.length > var36) { ++ var14 = func_110661_a(par1ICommandSender, par2ArrayOfStr[var36++], 0.0D, 2.0D); ++ } ++ ++ if (par2ArrayOfStr.length > var36) { ++ var16 = func_110661_a(par1ICommandSender, par2ArrayOfStr[var36++], 0.0D, 1.0D); + } + + double var18 = var12 > 1.0D ? var12 * 16.0D : 16.0D; + double var20 = var5.getDistance(var6, var8, var10); +- if(var20 > var18) { +- if(var16 <= 0.0D) { +- throw new CommandException("commands.playsound.playerTooFar", new Object[]{var5.getEntityName()}); ++ ++ if (var20 > var18) { ++ if (var16 <= 0.0D) { ++ throw new CommandException("commands.playsound.playerTooFar", new Object[] {var5.getEntityName()}); + } + + double var22 = var6 - var5.posX; +@@ -65,22 +70,26 @@ + double var30 = var5.posX; + double var32 = var5.posY; + double var34 = var5.posZ; +- if(var28 > 0.0D) { ++ ++ if (var28 > 0.0D) { + var30 += var22 / var28 * 2.0D; + var32 += var24 / var28 * 2.0D; + var34 += var26 / var28 * 2.0D; + } + +- var5.playerNetServerHandler.sendPacket(new Packet62LevelSound(var4, var30, var32, var34, (float)var16, (float)var14)); ++ var5.playerNetServerHandler.sendPacketToPlayer(new Packet62LevelSound(var4, var30, var32, var34, (float)var16, (float)var14)); + } else { +- var5.playerNetServerHandler.sendPacket(new Packet62LevelSound(var4, var6, var8, var10, (float)var12, (float)var14)); ++ var5.playerNetServerHandler.sendPacketToPlayer(new Packet62LevelSound(var4, var6, var8, var10, (float)var12, (float)var14)); + } + +- notifyAdmins(var1, "commands.playsound.success", new Object[]{var4, var5.getEntityName()}); ++ notifyAdmins(par1ICommandSender, "commands.playsound.success", new Object[] {var4, var5.getEntityName()}); + } + } + +- public boolean isUsernameIndex(String[] var1, int var2) { +- return var2 == 1; ++ /** ++ * Return whether the specified command parameter index is a username parameter. ++ */ ++ public boolean isUsernameIndex(String[] par1ArrayOfStr, int par2) { ++ return par2 == 1; + } + } diff --git a/patches/net/minecraft/src/CommandServerBan.java.patch b/patches/net/minecraft/src/CommandServerBan.java.patch new file mode 100644 index 0000000..62dc6b3 --- /dev/null +++ b/patches/net/minecraft/src/CommandServerBan.java.patch @@ -0,0 +1,68 @@ +--- net/minecraft/src/CommandServerBan.java ++++ net/minecraft/src/CommandServerBan.java +@@ -8,39 +8,50 @@ + return "ban"; + } + ++ /** ++ * Return the required permission level for this command. ++ */ + public int getRequiredPermissionLevel() { + return 3; + } + +- public String getCommandUsage(ICommandSender var1) { ++ public String getCommandUsage(ICommandSender par1ICommandSender) { + return "commands.ban.usage"; + } + +- public boolean canCommandSenderUseCommand(ICommandSender var1) { +- return MinecraftServer.getServer().getConfigurationManager().getBannedPlayers().isListActive() && super.canCommandSenderUseCommand(var1); ++ /** ++ * Returns true if the given command sender is allowed to use this command. ++ */ ++ public boolean canCommandSenderUseCommand(ICommandSender par1ICommandSender) { ++ return MinecraftServer.getServer().getConfigurationManager().getBannedPlayers().isListActive() && super.canCommandSenderUseCommand(par1ICommandSender); + } + +- public void processCommand(ICommandSender var1, String[] var2) { +- if(var2.length >= 1 && var2[0].length() > 0) { +- EntityPlayerMP var3 = MinecraftServer.getServer().getConfigurationManager().getPlayerEntity(var2[0]); +- BanEntry var4 = new BanEntry(var2[0]); +- var4.setBannedBy(var1.getCommandSenderName()); +- if(var2.length >= 2) { +- var4.setBanReason(func_82360_a(var1, var2, 1)); ++ public void processCommand(ICommandSender par1ICommandSender, String[] par2ArrayOfStr) { ++ if (par2ArrayOfStr.length >= 1 && par2ArrayOfStr[0].length() > 0) { ++ EntityPlayerMP var3 = MinecraftServer.getServer().getConfigurationManager().getPlayerForUsername(par2ArrayOfStr[0]); ++ BanEntry var4 = new BanEntry(par2ArrayOfStr[0]); ++ var4.setBannedBy(par1ICommandSender.getCommandSenderName()); ++ ++ if (par2ArrayOfStr.length >= 2) { ++ var4.setBanReason(func_82360_a(par1ICommandSender, par2ArrayOfStr, 1)); + } + + MinecraftServer.getServer().getConfigurationManager().getBannedPlayers().put(var4); +- if(var3 != null) { +- var3.playerNetServerHandler.kickPlayer("You are banned from this server."); ++ ++ if (var3 != null) { ++ var3.playerNetServerHandler.kickPlayerFromServer("You are banned from this server."); + } + +- notifyAdmins(var1, "commands.ban.success", new Object[]{var2[0]}); ++ notifyAdmins(par1ICommandSender, "commands.ban.success", new Object[] {par2ArrayOfStr[0]}); + } else { + throw new WrongUsageException("commands.ban.usage", new Object[0]); + } + } + +- public List addTabCompletionOptions(ICommandSender var1, String[] var2) { +- return var2.length >= 1 ? getListOfStringsMatchingLastWord(var2, MinecraftServer.getServer().getAllUsernames()) : null; ++ /** ++ * Adds the strings available in this command to the given list of tab completion options. ++ */ ++ public List addTabCompletionOptions(ICommandSender par1ICommandSender, String[] par2ArrayOfStr) { ++ return par2ArrayOfStr.length >= 1 ? getListOfStringsMatchingLastWord(par2ArrayOfStr, MinecraftServer.getServer().getAllUsernames()) : null; + } + } diff --git a/patches/net/minecraft/src/CommandServerBanIp.java.patch b/patches/net/minecraft/src/CommandServerBanIp.java.patch new file mode 100644 index 0000000..681f7c3 --- /dev/null +++ b/patches/net/minecraft/src/CommandServerBanIp.java.patch @@ -0,0 +1,121 @@ +--- net/minecraft/src/CommandServerBanIp.java ++++ net/minecraft/src/CommandServerBanIp.java +@@ -7,75 +7,88 @@ + import net.minecraft.server.MinecraftServer; + + public class CommandServerBanIp extends CommandBase { +- public static final Pattern a = Pattern.compile("^([01]?\\d\\d?|2[0-4]\\d|25[0-5])\\.([01]?\\d\\d?|2[0-4]\\d|25[0-5])\\.([01]?\\d\\d?|2[0-4]\\d|25[0-5])\\.([01]?\\d\\d?|2[0-4]\\d|25[0-5])$"); ++ public static final Pattern IPv4Pattern = Pattern.compile("^([01]?\\d\\d?|2[0-4]\\d|25[0-5])\\.([01]?\\d\\d?|2[0-4]\\d|25[0-5])\\.([01]?\\d\\d?|2[0-4]\\d|25[0-5])\\.([01]?\\d\\d?|2[0-4]\\d|25[0-5])$"); + + public String getCommandName() { + return "ban-ip"; + } + ++ /** ++ * Return the required permission level for this command. ++ */ + public int getRequiredPermissionLevel() { + return 3; + } + +- public boolean canCommandSenderUseCommand(ICommandSender var1) { +- return MinecraftServer.getServer().getConfigurationManager().getBannedIPs().isListActive() && super.canCommandSenderUseCommand(var1); ++ /** ++ * Returns true if the given command sender is allowed to use this command. ++ */ ++ public boolean canCommandSenderUseCommand(ICommandSender par1ICommandSender) { ++ return MinecraftServer.getServer().getConfigurationManager().getBannedIPs().isListActive() && super.canCommandSenderUseCommand(par1ICommandSender); + } + +- public String getCommandUsage(ICommandSender var1) { ++ public String getCommandUsage(ICommandSender par1ICommandSender) { + return "commands.banip.usage"; + } + +- public void processCommand(ICommandSender var1, String[] var2) { +- if(var2.length >= 1 && var2[0].length() > 1) { +- Matcher var3 = a.matcher(var2[0]); ++ public void processCommand(ICommandSender par1ICommandSender, String[] par2ArrayOfStr) { ++ if (par2ArrayOfStr.length >= 1 && par2ArrayOfStr[0].length() > 1) { ++ Matcher var3 = IPv4Pattern.matcher(par2ArrayOfStr[0]); + String var4 = null; +- if(var2.length >= 2) { +- var4 = func_82360_a(var1, var2, 1); ++ ++ if (par2ArrayOfStr.length >= 2) { ++ var4 = func_82360_a(par1ICommandSender, par2ArrayOfStr, 1); + } + +- if(var3.matches()) { +- this.banIP(var1, var2[0], var4); ++ if (var3.matches()) { ++ this.banIP(par1ICommandSender, par2ArrayOfStr[0], var4); + } else { +- EntityPlayerMP var5 = MinecraftServer.getServer().getConfigurationManager().getPlayerEntity(var2[0]); +- if(var5 == null) { ++ EntityPlayerMP var5 = MinecraftServer.getServer().getConfigurationManager().getPlayerForUsername(par2ArrayOfStr[0]); ++ ++ if (var5 == null) { + throw new PlayerNotFoundException("commands.banip.invalid", new Object[0]); + } + +- this.banIP(var1, var5.getPlayerIP(), var4); ++ this.banIP(par1ICommandSender, var5.getPlayerIP(), var4); + } +- + } else { + throw new WrongUsageException("commands.banip.usage", new Object[0]); + } + } + +- public List addTabCompletionOptions(ICommandSender var1, String[] var2) { +- return var2.length == 1 ? getListOfStringsMatchingLastWord(var2, MinecraftServer.getServer().getAllUsernames()) : null; ++ /** ++ * Adds the strings available in this command to the given list of tab completion options. ++ */ ++ public List addTabCompletionOptions(ICommandSender par1ICommandSender, String[] par2ArrayOfStr) { ++ return par2ArrayOfStr.length == 1 ? getListOfStringsMatchingLastWord(par2ArrayOfStr, MinecraftServer.getServer().getAllUsernames()) : null; + } + +- protected void banIP(ICommandSender var1, String var2, String var3) { +- BanEntry var4 = new BanEntry(var2); +- var4.setBannedBy(var1.getCommandSenderName()); +- if(var3 != null) { +- var4.setBanReason(var3); ++ /** ++ * Actually does the banning work. ++ */ ++ protected void banIP(ICommandSender par1ICommandSender, String par2Str, String par3Str) { ++ BanEntry var4 = new BanEntry(par2Str); ++ var4.setBannedBy(par1ICommandSender.getCommandSenderName()); ++ ++ if (par3Str != null) { ++ var4.setBanReason(par3Str); + } + + MinecraftServer.getServer().getConfigurationManager().getBannedIPs().put(var4); +- List var5 = MinecraftServer.getServer().getConfigurationManager().getPlayerList(var2); ++ List var5 = MinecraftServer.getServer().getConfigurationManager().getPlayerList(par2Str); + String[] var6 = new String[var5.size()]; + int var7 = 0; +- + EntityPlayerMP var9; +- for(Iterator var8 = var5.iterator(); var8.hasNext(); var6[var7++] = var9.getEntityName()) { ++ ++ for (Iterator var8 = var5.iterator(); var8.hasNext(); var6[var7++] = var9.getEntityName()) { + var9 = (EntityPlayerMP)var8.next(); +- var9.playerNetServerHandler.kickPlayer("You have been IP banned."); ++ var9.playerNetServerHandler.kickPlayerFromServer("You have been IP banned."); + } + +- if(var5.isEmpty()) { +- notifyAdmins(var1, "commands.banip.success", new Object[]{var2}); ++ if (var5.isEmpty()) { ++ notifyAdmins(par1ICommandSender, "commands.banip.success", new Object[] {par2Str}); + } else { +- notifyAdmins(var1, "commands.banip.success.players", new Object[]{var2, joinNiceString(var6)}); ++ notifyAdmins(par1ICommandSender, "commands.banip.success.players", new Object[] {par2Str, joinNiceString(var6)}); + } +- + } + } diff --git a/patches/net/minecraft/src/CommandServerBanlist.java.patch b/patches/net/minecraft/src/CommandServerBanlist.java.patch new file mode 100644 index 0000000..29e07ec --- /dev/null +++ b/patches/net/minecraft/src/CommandServerBanlist.java.patch @@ -0,0 +1,53 @@ +--- net/minecraft/src/CommandServerBanlist.java ++++ net/minecraft/src/CommandServerBanlist.java +@@ -8,30 +8,38 @@ + return "banlist"; + } + ++ /** ++ * Return the required permission level for this command. ++ */ + public int getRequiredPermissionLevel() { + return 3; + } + +- public boolean canCommandSenderUseCommand(ICommandSender var1) { +- return (MinecraftServer.getServer().getConfigurationManager().getBannedIPs().isListActive() || MinecraftServer.getServer().getConfigurationManager().getBannedPlayers().isListActive()) && super.canCommandSenderUseCommand(var1); ++ /** ++ * Returns true if the given command sender is allowed to use this command. ++ */ ++ public boolean canCommandSenderUseCommand(ICommandSender par1ICommandSender) { ++ return (MinecraftServer.getServer().getConfigurationManager().getBannedIPs().isListActive() || MinecraftServer.getServer().getConfigurationManager().getBannedPlayers().isListActive()) && super.canCommandSenderUseCommand(par1ICommandSender); + } + +- public String getCommandUsage(ICommandSender var1) { ++ public String getCommandUsage(ICommandSender par1ICommandSender) { + return "commands.banlist.usage"; + } + +- public void processCommand(ICommandSender var1, String[] var2) { +- if(var2.length >= 1 && var2[0].equalsIgnoreCase("ips")) { +- var1.sendChatToPlayer(ChatMessageComponent.createFromTranslationWithSubstitutions("commands.banlist.ips", new Object[]{Integer.valueOf(MinecraftServer.getServer().getConfigurationManager().getBannedIPs().getBannedList().size())})); +- var1.sendChatToPlayer(ChatMessageComponent.createFromText(joinNiceString(MinecraftServer.getServer().getConfigurationManager().getBannedIPs().getBannedList().keySet().toArray()))); ++ public void processCommand(ICommandSender par1ICommandSender, String[] par2ArrayOfStr) { ++ if (par2ArrayOfStr.length >= 1 && par2ArrayOfStr[0].equalsIgnoreCase("ips")) { ++ par1ICommandSender.sendChatToPlayer(ChatMessageComponent.createFromTranslationWithSubstitutions("commands.banlist.ips", new Object[] {Integer.valueOf(MinecraftServer.getServer().getConfigurationManager().getBannedIPs().getBannedList().size())})); ++ par1ICommandSender.sendChatToPlayer(ChatMessageComponent.createFromText(joinNiceString(MinecraftServer.getServer().getConfigurationManager().getBannedIPs().getBannedList().keySet().toArray()))); + } else { +- var1.sendChatToPlayer(ChatMessageComponent.createFromTranslationWithSubstitutions("commands.banlist.players", new Object[]{Integer.valueOf(MinecraftServer.getServer().getConfigurationManager().getBannedPlayers().getBannedList().size())})); +- var1.sendChatToPlayer(ChatMessageComponent.createFromText(joinNiceString(MinecraftServer.getServer().getConfigurationManager().getBannedPlayers().getBannedList().keySet().toArray()))); ++ par1ICommandSender.sendChatToPlayer(ChatMessageComponent.createFromTranslationWithSubstitutions("commands.banlist.players", new Object[] {Integer.valueOf(MinecraftServer.getServer().getConfigurationManager().getBannedPlayers().getBannedList().size())})); ++ par1ICommandSender.sendChatToPlayer(ChatMessageComponent.createFromText(joinNiceString(MinecraftServer.getServer().getConfigurationManager().getBannedPlayers().getBannedList().keySet().toArray()))); + } +- + } + +- public List addTabCompletionOptions(ICommandSender var1, String[] var2) { +- return var2.length == 1 ? getListOfStringsMatchingLastWord(var2, new String[]{"players", "ips"}) : null; ++ /** ++ * Adds the strings available in this command to the given list of tab completion options. ++ */ ++ public List addTabCompletionOptions(ICommandSender par1ICommandSender, String[] par2ArrayOfStr) { ++ return par2ArrayOfStr.length == 1 ? getListOfStringsMatchingLastWord(par2ArrayOfStr, new String[] {"players", "ips"}): null; + } + } diff --git a/patches/net/minecraft/src/CommandServerDeop.java.patch b/patches/net/minecraft/src/CommandServerDeop.java.patch new file mode 100644 index 0000000..6e82d44 --- /dev/null +++ b/patches/net/minecraft/src/CommandServerDeop.java.patch @@ -0,0 +1,40 @@ +--- net/minecraft/src/CommandServerDeop.java ++++ net/minecraft/src/CommandServerDeop.java +@@ -8,24 +8,30 @@ + return "deop"; + } + ++ /** ++ * Return the required permission level for this command. ++ */ + public int getRequiredPermissionLevel() { + return 3; + } + +- public String getCommandUsage(ICommandSender var1) { ++ public String getCommandUsage(ICommandSender par1ICommandSender) { + return "commands.deop.usage"; + } + +- public void processCommand(ICommandSender var1, String[] var2) { +- if(var2.length == 1 && var2[0].length() > 0) { +- MinecraftServer.getServer().getConfigurationManager().removeOp(var2[0]); +- notifyAdmins(var1, "commands.deop.success", new Object[]{var2[0]}); ++ public void processCommand(ICommandSender par1ICommandSender, String[] par2ArrayOfStr) { ++ if (par2ArrayOfStr.length == 1 && par2ArrayOfStr[0].length() > 0) { ++ MinecraftServer.getServer().getConfigurationManager().removeOp(par2ArrayOfStr[0]); ++ notifyAdmins(par1ICommandSender, "commands.deop.success", new Object[] {par2ArrayOfStr[0]}); + } else { + throw new WrongUsageException("commands.deop.usage", new Object[0]); + } + } + +- public List addTabCompletionOptions(ICommandSender var1, String[] var2) { +- return var2.length == 1 ? getListOfStringsFromIterableMatchingLastWord(var2, MinecraftServer.getServer().getConfigurationManager().getOps()) : null; ++ /** ++ * Adds the strings available in this command to the given list of tab completion options. ++ */ ++ public List addTabCompletionOptions(ICommandSender par1ICommandSender, String[] par2ArrayOfStr) { ++ return par2ArrayOfStr.length == 1 ? getListOfStringsFromIterableMatchingLastWord(par2ArrayOfStr, MinecraftServer.getServer().getConfigurationManager().getOps()) : null; + } + } diff --git a/patches/net/minecraft/src/CommandServerEmote.java.patch b/patches/net/minecraft/src/CommandServerEmote.java.patch new file mode 100644 index 0000000..3fef65e --- /dev/null +++ b/patches/net/minecraft/src/CommandServerEmote.java.patch @@ -0,0 +1,40 @@ +--- net/minecraft/src/CommandServerEmote.java ++++ net/minecraft/src/CommandServerEmote.java +@@ -8,24 +8,30 @@ + return "me"; + } + ++ /** ++ * Return the required permission level for this command. ++ */ + public int getRequiredPermissionLevel() { + return 0; + } + +- public String getCommandUsage(ICommandSender var1) { ++ public String getCommandUsage(ICommandSender par1ICommandSender) { + return "commands.me.usage"; + } + +- public void processCommand(ICommandSender var1, String[] var2) { +- if(var2.length > 0) { +- String var3 = func_82361_a(var1, var2, 0, var1.canCommandSenderUseCommand(1, "me")); +- MinecraftServer.getServer().getConfigurationManager().sendChatMsg(ChatMessageComponent.createFromTranslationWithSubstitutions("chat.type.emote", new Object[]{var1.getCommandSenderName(), var3})); ++ public void processCommand(ICommandSender par1ICommandSender, String[] par2ArrayOfStr) { ++ if (par2ArrayOfStr.length > 0) { ++ String var3 = func_82361_a(par1ICommandSender, par2ArrayOfStr, 0, par1ICommandSender.canCommandSenderUseCommand(1, "me")); ++ MinecraftServer.getServer().getConfigurationManager().sendChatMsg(ChatMessageComponent.createFromTranslationWithSubstitutions("chat.type.emote", new Object[] {par1ICommandSender.getCommandSenderName(), var3})); + } else { + throw new WrongUsageException("commands.me.usage", new Object[0]); + } + } + +- public List addTabCompletionOptions(ICommandSender var1, String[] var2) { +- return getListOfStringsMatchingLastWord(var2, MinecraftServer.getServer().getAllUsernames()); ++ /** ++ * Adds the strings available in this command to the given list of tab completion options. ++ */ ++ public List addTabCompletionOptions(ICommandSender par1ICommandSender, String[] par2ArrayOfStr) { ++ return getListOfStringsMatchingLastWord(par2ArrayOfStr, MinecraftServer.getServer().getAllUsernames()); + } + } diff --git a/patches/net/minecraft/src/CommandServerKick.java.patch b/patches/net/minecraft/src/CommandServerKick.java.patch new file mode 100644 index 0000000..0372b10 --- /dev/null +++ b/patches/net/minecraft/src/CommandServerKick.java.patch @@ -0,0 +1,65 @@ +--- net/minecraft/src/CommandServerKick.java ++++ net/minecraft/src/CommandServerKick.java +@@ -8,41 +8,48 @@ + return "kick"; + } + ++ /** ++ * Return the required permission level for this command. ++ */ + public int getRequiredPermissionLevel() { + return 3; + } + +- public String getCommandUsage(ICommandSender var1) { ++ public String getCommandUsage(ICommandSender par1ICommandSender) { + return "commands.kick.usage"; + } + +- public void processCommand(ICommandSender var1, String[] var2) { +- if(var2.length > 0 && var2[0].length() > 1) { +- EntityPlayerMP var3 = MinecraftServer.getServer().getConfigurationManager().getPlayerEntity(var2[0]); ++ public void processCommand(ICommandSender par1ICommandSender, String[] par2ArrayOfStr) { ++ if (par2ArrayOfStr.length > 0 && par2ArrayOfStr[0].length() > 1) { ++ EntityPlayerMP var3 = MinecraftServer.getServer().getConfigurationManager().getPlayerForUsername(par2ArrayOfStr[0]); + String var4 = "Kicked by an operator."; + boolean var5 = false; +- if(var3 == null) { ++ ++ if (var3 == null) { + throw new PlayerNotFoundException(); + } else { +- if(var2.length >= 2) { +- var4 = func_82360_a(var1, var2, 1); ++ if (par2ArrayOfStr.length >= 2) { ++ var4 = func_82360_a(par1ICommandSender, par2ArrayOfStr, 1); + var5 = true; + } + +- var3.playerNetServerHandler.kickPlayer(var4); +- if(var5) { +- notifyAdmins(var1, "commands.kick.success.reason", new Object[]{var3.getEntityName(), var4}); ++ var3.playerNetServerHandler.kickPlayerFromServer(var4); ++ ++ if (var5) { ++ notifyAdmins(par1ICommandSender, "commands.kick.success.reason", new Object[] {var3.getEntityName(), var4}); + } else { +- notifyAdmins(var1, "commands.kick.success", new Object[]{var3.getEntityName()}); ++ notifyAdmins(par1ICommandSender, "commands.kick.success", new Object[] {var3.getEntityName()}); + } +- + } + } else { + throw new WrongUsageException("commands.kick.usage", new Object[0]); + } + } + +- public List addTabCompletionOptions(ICommandSender var1, String[] var2) { +- return var2.length >= 1 ? getListOfStringsMatchingLastWord(var2, MinecraftServer.getServer().getAllUsernames()) : null; ++ /** ++ * Adds the strings available in this command to the given list of tab completion options. ++ */ ++ public List addTabCompletionOptions(ICommandSender par1ICommandSender, String[] par2ArrayOfStr) { ++ return par2ArrayOfStr.length >= 1 ? getListOfStringsMatchingLastWord(par2ArrayOfStr, MinecraftServer.getServer().getAllUsernames()) : null; + } + } diff --git a/patches/net/minecraft/src/CommandServerList.java.patch b/patches/net/minecraft/src/CommandServerList.java.patch new file mode 100644 index 0000000..66ea301 --- /dev/null +++ b/patches/net/minecraft/src/CommandServerList.java.patch @@ -0,0 +1,26 @@ +--- net/minecraft/src/CommandServerList.java ++++ net/minecraft/src/CommandServerList.java +@@ -7,16 +7,19 @@ + return "list"; + } + ++ /** ++ * Return the required permission level for this command. ++ */ + public int getRequiredPermissionLevel() { + return 0; + } + +- public String getCommandUsage(ICommandSender var1) { ++ public String getCommandUsage(ICommandSender par1ICommandSender) { + return "commands.players.usage"; + } + +- public void processCommand(ICommandSender var1, String[] var2) { +- var1.sendChatToPlayer(ChatMessageComponent.createFromTranslationWithSubstitutions("commands.players.list", new Object[]{Integer.valueOf(MinecraftServer.getServer().getCurrentPlayerCount()), Integer.valueOf(MinecraftServer.getServer().getMaxPlayers())})); +- var1.sendChatToPlayer(ChatMessageComponent.createFromText(MinecraftServer.getServer().getConfigurationManager().getPlayerListAsString())); ++ public void processCommand(ICommandSender par1ICommandSender, String[] par2ArrayOfStr) { ++ par1ICommandSender.sendChatToPlayer(ChatMessageComponent.createFromTranslationWithSubstitutions("commands.players.list", new Object[] {Integer.valueOf(MinecraftServer.getServer().getCurrentPlayerCount()), Integer.valueOf(MinecraftServer.getServer().getMaxPlayers())})); ++ par1ICommandSender.sendChatToPlayer(ChatMessageComponent.createFromText(MinecraftServer.getServer().getConfigurationManager().getPlayerListAsString())); + } + } diff --git a/patches/net/minecraft/src/CommandServerMessage.java.patch b/patches/net/minecraft/src/CommandServerMessage.java.patch new file mode 100644 index 0000000..ea72f49 --- /dev/null +++ b/patches/net/minecraft/src/CommandServerMessage.java.patch @@ -0,0 +1,70 @@ +--- net/minecraft/src/CommandServerMessage.java ++++ net/minecraft/src/CommandServerMessage.java +@@ -6,43 +6,53 @@ + + public class CommandServerMessage extends CommandBase { + public List getCommandAliases() { +- return Arrays.asList(new String[]{"w", "msg"}); ++ return Arrays.asList(new String[] {"w", "msg"}); + } + + public String getCommandName() { + return "tell"; + } + ++ /** ++ * Return the required permission level for this command. ++ */ + public int getRequiredPermissionLevel() { + return 0; + } + +- public String getCommandUsage(ICommandSender var1) { ++ public String getCommandUsage(ICommandSender par1ICommandSender) { + return "commands.message.usage"; + } + +- public void processCommand(ICommandSender var1, String[] var2) { +- if(var2.length < 2) { ++ public void processCommand(ICommandSender par1ICommandSender, String[] par2ArrayOfStr) { ++ if (par2ArrayOfStr.length < 2) { + throw new WrongUsageException("commands.message.usage", new Object[0]); + } else { +- EntityPlayerMP var3 = getPlayer(var1, var2[0]); +- if(var3 == null) { ++ EntityPlayerMP var3 = getPlayer(par1ICommandSender, par2ArrayOfStr[0]); ++ ++ if (var3 == null) { + throw new PlayerNotFoundException(); +- } else if(var3 == var1) { ++ } else if (var3 == par1ICommandSender) { + throw new PlayerNotFoundException("commands.message.sameTarget", new Object[0]); + } else { +- String var4 = func_82361_a(var1, var2, 1, !(var1 instanceof EntityPlayer)); +- var3.sendChatToPlayer(ChatMessageComponent.createFromTranslationWithSubstitutions("commands.message.display.incoming", new Object[]{var1.getCommandSenderName(), var4}).setColor(EnumChatFormatting.GRAY).setItalic(Boolean.valueOf(true))); +- var1.sendChatToPlayer(ChatMessageComponent.createFromTranslationWithSubstitutions("commands.message.display.outgoing", new Object[]{var3.getCommandSenderName(), var4}).setColor(EnumChatFormatting.GRAY).setItalic(Boolean.valueOf(true))); ++ String var4 = func_82361_a(par1ICommandSender, par2ArrayOfStr, 1, !(par1ICommandSender instanceof EntityPlayer)); ++ var3.sendChatToPlayer(ChatMessageComponent.createFromTranslationWithSubstitutions("commands.message.display.incoming", new Object[] {par1ICommandSender.getCommandSenderName(), var4}).setColor(EnumChatFormatting.GRAY).setItalic(Boolean.valueOf(true))); ++ par1ICommandSender.sendChatToPlayer(ChatMessageComponent.createFromTranslationWithSubstitutions("commands.message.display.outgoing", new Object[] {var3.getCommandSenderName(), var4}).setColor(EnumChatFormatting.GRAY).setItalic(Boolean.valueOf(true))); + } + } + } + +- public List addTabCompletionOptions(ICommandSender var1, String[] var2) { +- return getListOfStringsMatchingLastWord(var2, MinecraftServer.getServer().getAllUsernames()); ++ /** ++ * Adds the strings available in this command to the given list of tab completion options. ++ */ ++ public List addTabCompletionOptions(ICommandSender par1ICommandSender, String[] par2ArrayOfStr) { ++ return getListOfStringsMatchingLastWord(par2ArrayOfStr, MinecraftServer.getServer().getAllUsernames()); + } + +- public boolean isUsernameIndex(String[] var1, int var2) { +- return var2 == 0; ++ /** ++ * Return whether the specified command parameter index is a username parameter. ++ */ ++ public boolean isUsernameIndex(String[] par1ArrayOfStr, int par2) { ++ return par2 == 0; + } + } diff --git a/patches/net/minecraft/src/CommandServerOp.java.patch b/patches/net/minecraft/src/CommandServerOp.java.patch new file mode 100644 index 0000000..c3f01ea --- /dev/null +++ b/patches/net/minecraft/src/CommandServerOp.java.patch @@ -0,0 +1,53 @@ +--- net/minecraft/src/CommandServerOp.java ++++ net/minecraft/src/CommandServerOp.java +@@ -9,33 +9,40 @@ + return "op"; + } + ++ /** ++ * Return the required permission level for this command. ++ */ + public int getRequiredPermissionLevel() { + return 3; + } + +- public String getCommandUsage(ICommandSender var1) { ++ public String getCommandUsage(ICommandSender par1ICommandSender) { + return "commands.op.usage"; + } + +- public void processCommand(ICommandSender var1, String[] var2) { +- if(var2.length == 1 && var2[0].length() > 0) { +- MinecraftServer.getServer().getConfigurationManager().addOp(var2[0]); +- notifyAdmins(var1, "commands.op.success", new Object[]{var2[0]}); ++ public void processCommand(ICommandSender par1ICommandSender, String[] par2ArrayOfStr) { ++ if (par2ArrayOfStr.length == 1 && par2ArrayOfStr[0].length() > 0) { ++ MinecraftServer.getServer().getConfigurationManager().addOp(par2ArrayOfStr[0]); ++ notifyAdmins(par1ICommandSender, "commands.op.success", new Object[] {par2ArrayOfStr[0]}); + } else { + throw new WrongUsageException("commands.op.usage", new Object[0]); + } + } + +- public List addTabCompletionOptions(ICommandSender var1, String[] var2) { +- if(var2.length == 1) { +- String var3 = var2[var2.length - 1]; ++ /** ++ * Adds the strings available in this command to the given list of tab completion options. ++ */ ++ public List addTabCompletionOptions(ICommandSender par1ICommandSender, String[] par2ArrayOfStr) { ++ if (par2ArrayOfStr.length == 1) { ++ String var3 = par2ArrayOfStr[par2ArrayOfStr.length - 1]; + ArrayList var4 = new ArrayList(); + String[] var5 = MinecraftServer.getServer().getAllUsernames(); + int var6 = var5.length; + +- for(int var7 = 0; var7 < var6; ++var7) { ++ for (int var7 = 0; var7 < var6; ++var7) { + String var8 = var5[var7]; +- if(!MinecraftServer.getServer().getConfigurationManager().isPlayerOpped(var8) && doesStringStartWith(var3, var8)) { ++ ++ if (!MinecraftServer.getServer().getConfigurationManager().isPlayerOpped(var8) && doesStringStartWith(var3, var8)) { + var4.add(var8); + } + } diff --git a/patches/net/minecraft/src/CommandServerPardon.java.patch b/patches/net/minecraft/src/CommandServerPardon.java.patch new file mode 100644 index 0000000..3d4226f --- /dev/null +++ b/patches/net/minecraft/src/CommandServerPardon.java.patch @@ -0,0 +1,49 @@ +--- net/minecraft/src/CommandServerPardon.java ++++ net/minecraft/src/CommandServerPardon.java +@@ -8,28 +8,37 @@ + return "pardon"; + } + ++ /** ++ * Return the required permission level for this command. ++ */ + public int getRequiredPermissionLevel() { + return 3; + } + +- public String getCommandUsage(ICommandSender var1) { ++ public String getCommandUsage(ICommandSender par1ICommandSender) { + return "commands.unban.usage"; + } + +- public boolean canCommandSenderUseCommand(ICommandSender var1) { +- return MinecraftServer.getServer().getConfigurationManager().getBannedPlayers().isListActive() && super.canCommandSenderUseCommand(var1); ++ /** ++ * Returns true if the given command sender is allowed to use this command. ++ */ ++ public boolean canCommandSenderUseCommand(ICommandSender par1ICommandSender) { ++ return MinecraftServer.getServer().getConfigurationManager().getBannedPlayers().isListActive() && super.canCommandSenderUseCommand(par1ICommandSender); + } + +- public void processCommand(ICommandSender var1, String[] var2) { +- if(var2.length == 1 && var2[0].length() > 0) { +- MinecraftServer.getServer().getConfigurationManager().getBannedPlayers().remove(var2[0]); +- notifyAdmins(var1, "commands.unban.success", new Object[]{var2[0]}); ++ public void processCommand(ICommandSender par1ICommandSender, String[] par2ArrayOfStr) { ++ if (par2ArrayOfStr.length == 1 && par2ArrayOfStr[0].length() > 0) { ++ MinecraftServer.getServer().getConfigurationManager().getBannedPlayers().remove(par2ArrayOfStr[0]); ++ notifyAdmins(par1ICommandSender, "commands.unban.success", new Object[] {par2ArrayOfStr[0]}); + } else { + throw new WrongUsageException("commands.unban.usage", new Object[0]); + } + } + +- public List addTabCompletionOptions(ICommandSender var1, String[] var2) { +- return var2.length == 1 ? getListOfStringsFromIterableMatchingLastWord(var2, MinecraftServer.getServer().getConfigurationManager().getBannedPlayers().getBannedList().keySet()) : null; ++ /** ++ * Adds the strings available in this command to the given list of tab completion options. ++ */ ++ public List addTabCompletionOptions(ICommandSender par1ICommandSender, String[] par2ArrayOfStr) { ++ return par2ArrayOfStr.length == 1 ? getListOfStringsFromIterableMatchingLastWord(par2ArrayOfStr, MinecraftServer.getServer().getConfigurationManager().getBannedPlayers().getBannedList().keySet()) : null; + } + } diff --git a/patches/net/minecraft/src/CommandServerPardonIp.java.patch b/patches/net/minecraft/src/CommandServerPardonIp.java.patch new file mode 100644 index 0000000..66a9dd6 --- /dev/null +++ b/patches/net/minecraft/src/CommandServerPardonIp.java.patch @@ -0,0 +1,56 @@ +--- net/minecraft/src/CommandServerPardonIp.java ++++ net/minecraft/src/CommandServerPardonIp.java +@@ -9,24 +9,31 @@ + return "pardon-ip"; + } + ++ /** ++ * Return the required permission level for this command. ++ */ + public int getRequiredPermissionLevel() { + return 3; + } + +- public boolean canCommandSenderUseCommand(ICommandSender var1) { +- return MinecraftServer.getServer().getConfigurationManager().getBannedIPs().isListActive() && super.canCommandSenderUseCommand(var1); ++ /** ++ * Returns true if the given command sender is allowed to use this command. ++ */ ++ public boolean canCommandSenderUseCommand(ICommandSender par1ICommandSender) { ++ return MinecraftServer.getServer().getConfigurationManager().getBannedIPs().isListActive() && super.canCommandSenderUseCommand(par1ICommandSender); + } + +- public String getCommandUsage(ICommandSender var1) { ++ public String getCommandUsage(ICommandSender par1ICommandSender) { + return "commands.unbanip.usage"; + } + +- public void processCommand(ICommandSender var1, String[] var2) { +- if(var2.length == 1 && var2[0].length() > 1) { +- Matcher var3 = CommandServerBanIp.a.matcher(var2[0]); +- if(var3.matches()) { +- MinecraftServer.getServer().getConfigurationManager().getBannedIPs().remove(var2[0]); +- notifyAdmins(var1, "commands.unbanip.success", new Object[]{var2[0]}); ++ public void processCommand(ICommandSender par1ICommandSender, String[] par2ArrayOfStr) { ++ if (par2ArrayOfStr.length == 1 && par2ArrayOfStr[0].length() > 1) { ++ Matcher var3 = CommandServerBanIp.IPv4Pattern.matcher(par2ArrayOfStr[0]); ++ ++ if (var3.matches()) { ++ MinecraftServer.getServer().getConfigurationManager().getBannedIPs().remove(par2ArrayOfStr[0]); ++ notifyAdmins(par1ICommandSender, "commands.unbanip.success", new Object[] {par2ArrayOfStr[0]}); + } else { + throw new SyntaxErrorException("commands.unbanip.invalid", new Object[0]); + } +@@ -35,7 +42,10 @@ + } + } + +- public List addTabCompletionOptions(ICommandSender var1, String[] var2) { +- return var2.length == 1 ? getListOfStringsFromIterableMatchingLastWord(var2, MinecraftServer.getServer().getConfigurationManager().getBannedIPs().getBannedList().keySet()) : null; ++ /** ++ * Adds the strings available in this command to the given list of tab completion options. ++ */ ++ public List addTabCompletionOptions(ICommandSender par1ICommandSender, String[] par2ArrayOfStr) { ++ return par2ArrayOfStr.length == 1 ? getListOfStringsFromIterableMatchingLastWord(par2ArrayOfStr, MinecraftServer.getServer().getConfigurationManager().getBannedIPs().getBannedList().keySet()) : null; + } + } diff --git a/patches/net/minecraft/src/CommandServerPublishLocal.java.patch b/patches/net/minecraft/src/CommandServerPublishLocal.java.patch new file mode 100644 index 0000000..a1e9d1e --- /dev/null +++ b/patches/net/minecraft/src/CommandServerPublishLocal.java.patch @@ -0,0 +1,33 @@ +--- net/minecraft/src/CommandServerPublishLocal.java ++++ net/minecraft/src/CommandServerPublishLocal.java +@@ -7,21 +7,24 @@ + return "publish"; + } + ++ /** ++ * Return the required permission level for this command. ++ */ + public int getRequiredPermissionLevel() { + return 4; + } + +- public String getCommandUsage(ICommandSender var1) { ++ public String getCommandUsage(ICommandSender par1ICommandSender) { + return "commands.publish.usage"; + } + +- public void processCommand(ICommandSender var1, String[] var2) { ++ public void processCommand(ICommandSender par1ICommandSender, String[] par2ArrayOfStr) { + String var3 = MinecraftServer.getServer().shareToLAN(EnumGameType.SURVIVAL, false); +- if(var3 != null) { +- notifyAdmins(var1, "commands.publish.started", new Object[]{var3}); ++ ++ if (var3 != null) { ++ notifyAdmins(par1ICommandSender, "commands.publish.started", new Object[] {var3}); + } else { +- notifyAdmins(var1, "commands.publish.failed", new Object[0]); ++ notifyAdmins(par1ICommandSender, "commands.publish.failed", new Object[0]); + } +- + } + } diff --git a/patches/net/minecraft/src/CommandServerSaveAll.java.patch b/patches/net/minecraft/src/CommandServerSaveAll.java.patch new file mode 100644 index 0000000..0d6db4c --- /dev/null +++ b/patches/net/minecraft/src/CommandServerSaveAll.java.patch @@ -0,0 +1,82 @@ +--- net/minecraft/src/CommandServerSaveAll.java ++++ net/minecraft/src/CommandServerSaveAll.java +@@ -7,18 +7,22 @@ + return "save-all"; + } + ++ /** ++ * Return the required permission level for this command. ++ */ + public int getRequiredPermissionLevel() { + return 4; + } + +- public String getCommandUsage(ICommandSender var1) { ++ public String getCommandUsage(ICommandSender par1ICommandSender) { + return "commands.save.usage"; + } + +- public void processCommand(ICommandSender var1, String[] var2) { ++ public void processCommand(ICommandSender par1ICommandSender, String[] par2ArrayOfStr) { + MinecraftServer var3 = MinecraftServer.getServer(); +- var1.sendChatToPlayer(ChatMessageComponent.createFromTranslationKey("commands.save.start")); +- if(var3.getConfigurationManager() != null) { ++ par1ICommandSender.sendChatToPlayer(ChatMessageComponent.createFromTranslationKey("commands.save.start")); ++ ++ if (var3.getConfigurationManager() != null) { + var3.getConfigurationManager().saveAllPlayerData(); + } + +@@ -26,36 +30,37 @@ + int var4; + WorldServer var5; + boolean var6; +- for(var4 = 0; var4 < var3.worldServers.length; ++var4) { +- if(var3.worldServers[var4] != null) { ++ ++ for (var4 = 0; var4 < var3.worldServers.length; ++var4) { ++ if (var3.worldServers[var4] != null) { + var5 = var3.worldServers[var4]; +- var6 = var5.levelSaving; +- var5.levelSaving = false; ++ var6 = var5.canNotSave; ++ var5.canNotSave = false; + var5.saveAllChunks(true, (IProgressUpdate)null); +- var5.levelSaving = var6; ++ var5.canNotSave = var6; + } + } + +- if(var2.length > 0 && "flush".equals(var2[0])) { +- var1.sendChatToPlayer(ChatMessageComponent.createFromTranslationKey("commands.save.flushStart")); ++ if (par2ArrayOfStr.length > 0 && "flush".equals(par2ArrayOfStr[0])) { ++ par1ICommandSender.sendChatToPlayer(ChatMessageComponent.createFromTranslationKey("commands.save.flushStart")); + +- for(var4 = 0; var4 < var3.worldServers.length; ++var4) { +- if(var3.worldServers[var4] != null) { ++ for (var4 = 0; var4 < var3.worldServers.length; ++var4) { ++ if (var3.worldServers[var4] != null) { + var5 = var3.worldServers[var4]; +- var6 = var5.levelSaving; +- var5.levelSaving = false; ++ var6 = var5.canNotSave; ++ var5.canNotSave = false; + var5.saveChunkData(); +- var5.levelSaving = var6; ++ var5.canNotSave = var6; + } + } + +- var1.sendChatToPlayer(ChatMessageComponent.createFromTranslationKey("commands.save.flushEnd")); ++ par1ICommandSender.sendChatToPlayer(ChatMessageComponent.createFromTranslationKey("commands.save.flushEnd")); + } + } catch (MinecraftException var7) { +- notifyAdmins(var1, "commands.save.failed", new Object[]{var7.getMessage()}); ++ notifyAdmins(par1ICommandSender, "commands.save.failed", new Object[] {var7.getMessage()}); + return; + } + +- notifyAdmins(var1, "commands.save.success", new Object[0]); ++ notifyAdmins(par1ICommandSender, "commands.save.success", new Object[0]); + } + } diff --git a/patches/net/minecraft/src/CommandServerSaveOff.java.patch b/patches/net/minecraft/src/CommandServerSaveOff.java.patch new file mode 100644 index 0000000..e804082 --- /dev/null +++ b/patches/net/minecraft/src/CommandServerSaveOff.java.patch @@ -0,0 +1,45 @@ +--- net/minecraft/src/CommandServerSaveOff.java ++++ net/minecraft/src/CommandServerSaveOff.java +@@ -7,30 +7,34 @@ + return "save-off"; + } + ++ /** ++ * Return the required permission level for this command. ++ */ + public int getRequiredPermissionLevel() { + return 4; + } + +- public String getCommandUsage(ICommandSender var1) { ++ public String getCommandUsage(ICommandSender par1ICommandSender) { + return "commands.save-off.usage"; + } + +- public void processCommand(ICommandSender var1, String[] var2) { ++ public void processCommand(ICommandSender par1ICommandSender, String[] par2ArrayOfStr) { + MinecraftServer var3 = MinecraftServer.getServer(); + boolean var4 = false; + +- for(int var5 = 0; var5 < var3.worldServers.length; ++var5) { +- if(var3.worldServers[var5] != null) { ++ for (int var5 = 0; var5 < var3.worldServers.length; ++var5) { ++ if (var3.worldServers[var5] != null) { + WorldServer var6 = var3.worldServers[var5]; +- if(!var6.levelSaving) { +- var6.levelSaving = true; ++ ++ if (!var6.canNotSave) { ++ var6.canNotSave = true; + var4 = true; + } + } + } + +- if(var4) { +- notifyAdmins(var1, "commands.save.disabled", new Object[0]); ++ if (var4) { ++ notifyAdmins(par1ICommandSender, "commands.save.disabled", new Object[0]); + } else { + throw new CommandException("commands.save-off.alreadyOff", new Object[0]); + } diff --git a/patches/net/minecraft/src/CommandServerSaveOn.java.patch b/patches/net/minecraft/src/CommandServerSaveOn.java.patch new file mode 100644 index 0000000..f828a74 --- /dev/null +++ b/patches/net/minecraft/src/CommandServerSaveOn.java.patch @@ -0,0 +1,45 @@ +--- net/minecraft/src/CommandServerSaveOn.java ++++ net/minecraft/src/CommandServerSaveOn.java +@@ -7,30 +7,34 @@ + return "save-on"; + } + ++ /** ++ * Return the required permission level for this command. ++ */ + public int getRequiredPermissionLevel() { + return 4; + } + +- public String getCommandUsage(ICommandSender var1) { ++ public String getCommandUsage(ICommandSender par1ICommandSender) { + return "commands.save-on.usage"; + } + +- public void processCommand(ICommandSender var1, String[] var2) { ++ public void processCommand(ICommandSender par1ICommandSender, String[] par2ArrayOfStr) { + MinecraftServer var3 = MinecraftServer.getServer(); + boolean var4 = false; + +- for(int var5 = 0; var5 < var3.worldServers.length; ++var5) { +- if(var3.worldServers[var5] != null) { ++ for (int var5 = 0; var5 < var3.worldServers.length; ++var5) { ++ if (var3.worldServers[var5] != null) { + WorldServer var6 = var3.worldServers[var5]; +- if(var6.levelSaving) { +- var6.levelSaving = false; ++ ++ if (var6.canNotSave) { ++ var6.canNotSave = false; + var4 = true; + } + } + } + +- if(var4) { +- notifyAdmins(var1, "commands.save.enabled", new Object[0]); ++ if (var4) { ++ notifyAdmins(par1ICommandSender, "commands.save.enabled", new Object[0]); + } else { + throw new CommandException("commands.save-on.alreadyOn", new Object[0]); + } diff --git a/patches/net/minecraft/src/CommandServerSay.java.patch b/patches/net/minecraft/src/CommandServerSay.java.patch new file mode 100644 index 0000000..34b17a6 --- /dev/null +++ b/patches/net/minecraft/src/CommandServerSay.java.patch @@ -0,0 +1,40 @@ +--- net/minecraft/src/CommandServerSay.java ++++ net/minecraft/src/CommandServerSay.java +@@ -8,24 +8,30 @@ + return "say"; + } + ++ /** ++ * Return the required permission level for this command. ++ */ + public int getRequiredPermissionLevel() { + return 1; + } + +- public String getCommandUsage(ICommandSender var1) { ++ public String getCommandUsage(ICommandSender par1ICommandSender) { + return "commands.say.usage"; + } + +- public void processCommand(ICommandSender var1, String[] var2) { +- if(var2.length > 0 && var2[0].length() > 0) { +- String var3 = func_82361_a(var1, var2, 0, true); +- MinecraftServer.getServer().getConfigurationManager().sendChatMsg(ChatMessageComponent.createFromTranslationWithSubstitutions("chat.type.announcement", new Object[]{var1.getCommandSenderName(), var3})); ++ public void processCommand(ICommandSender par1ICommandSender, String[] par2ArrayOfStr) { ++ if (par2ArrayOfStr.length > 0 && par2ArrayOfStr[0].length() > 0) { ++ String var3 = func_82361_a(par1ICommandSender, par2ArrayOfStr, 0, true); ++ MinecraftServer.getServer().getConfigurationManager().sendChatMsg(ChatMessageComponent.createFromTranslationWithSubstitutions("chat.type.announcement", new Object[] {par1ICommandSender.getCommandSenderName(), var3})); + } else { + throw new WrongUsageException("commands.say.usage", new Object[0]); + } + } + +- public List addTabCompletionOptions(ICommandSender var1, String[] var2) { +- return var2.length >= 1 ? getListOfStringsMatchingLastWord(var2, MinecraftServer.getServer().getAllUsernames()) : null; ++ /** ++ * Adds the strings available in this command to the given list of tab completion options. ++ */ ++ public List addTabCompletionOptions(ICommandSender par1ICommandSender, String[] par2ArrayOfStr) { ++ return par2ArrayOfStr.length >= 1 ? getListOfStringsMatchingLastWord(par2ArrayOfStr, MinecraftServer.getServer().getAllUsernames()) : null; + } + } diff --git a/patches/net/minecraft/src/CommandServerStop.java.patch b/patches/net/minecraft/src/CommandServerStop.java.patch new file mode 100644 index 0000000..af7367d --- /dev/null +++ b/patches/net/minecraft/src/CommandServerStop.java.patch @@ -0,0 +1,25 @@ +--- net/minecraft/src/CommandServerStop.java ++++ net/minecraft/src/CommandServerStop.java +@@ -7,16 +7,19 @@ + return "stop"; + } + ++ /** ++ * Return the required permission level for this command. ++ */ + public int getRequiredPermissionLevel() { + return 4; + } + +- public String getCommandUsage(ICommandSender var1) { ++ public String getCommandUsage(ICommandSender par1ICommandSender) { + return "commands.stop.usage"; + } + +- public void processCommand(ICommandSender var1, String[] var2) { +- notifyAdmins(var1, "commands.stop.start", new Object[0]); ++ public void processCommand(ICommandSender par1ICommandSender, String[] par2ArrayOfStr) { ++ notifyAdmins(par1ICommandSender, "commands.stop.start", new Object[0]); + MinecraftServer.getServer().initiateShutdown(); + } + } diff --git a/patches/net/minecraft/src/CommandServerTp.java.patch b/patches/net/minecraft/src/CommandServerTp.java.patch new file mode 100644 index 0000000..9e1e877 --- /dev/null +++ b/patches/net/minecraft/src/CommandServerTp.java.patch @@ -0,0 +1,101 @@ +--- net/minecraft/src/CommandServerTp.java ++++ net/minecraft/src/CommandServerTp.java +@@ -8,62 +8,73 @@ + return "tp"; + } + ++ /** ++ * Return the required permission level for this command. ++ */ + public int getRequiredPermissionLevel() { + return 2; + } + +- public String getCommandUsage(ICommandSender var1) { ++ public String getCommandUsage(ICommandSender par1ICommandSender) { + return "commands.tp.usage"; + } + +- public void processCommand(ICommandSender var1, String[] var2) { +- if(var2.length < 1) { ++ public void processCommand(ICommandSender par1ICommandSender, String[] par2ArrayOfStr) { ++ if (par2ArrayOfStr.length < 1) { + throw new WrongUsageException("commands.tp.usage", new Object[0]); + } else { + EntityPlayerMP var3; +- if(var2.length != 2 && var2.length != 4) { +- var3 = getCommandSenderAsPlayer(var1); ++ ++ if (par2ArrayOfStr.length != 2 && par2ArrayOfStr.length != 4) { ++ var3 = getCommandSenderAsPlayer(par1ICommandSender); + } else { +- var3 = getPlayer(var1, var2[0]); +- if(var3 == null) { ++ var3 = getPlayer(par1ICommandSender, par2ArrayOfStr[0]); ++ ++ if (var3 == null) { + throw new PlayerNotFoundException(); + } + } + +- if(var2.length != 3 && var2.length != 4) { +- if(var2.length == 1 || var2.length == 2) { +- EntityPlayerMP var11 = getPlayer(var1, var2[var2.length - 1]); +- if(var11 == null) { ++ if (par2ArrayOfStr.length != 3 && par2ArrayOfStr.length != 4) { ++ if (par2ArrayOfStr.length == 1 || par2ArrayOfStr.length == 2) { ++ EntityPlayerMP var11 = getPlayer(par1ICommandSender, par2ArrayOfStr[par2ArrayOfStr.length - 1]); ++ ++ if (var11 == null) { + throw new PlayerNotFoundException(); + } + +- if(var11.worldObj != var3.worldObj) { +- notifyAdmins(var1, "commands.tp.notSameDimension", new Object[0]); ++ if (var11.worldObj != var3.worldObj) { ++ notifyAdmins(par1ICommandSender, "commands.tp.notSameDimension", new Object[0]); + return; + } + + var3.mountEntity((Entity)null); + var3.playerNetServerHandler.setPlayerLocation(var11.posX, var11.posY, var11.posZ, var11.rotationYaw, var11.rotationPitch); +- notifyAdmins(var1, "commands.tp.success", new Object[]{var3.getEntityName(), var11.getEntityName()}); ++ notifyAdmins(par1ICommandSender, "commands.tp.success", new Object[] {var3.getEntityName(), var11.getEntityName()}); + } +- } else if(var3.worldObj != null) { +- int var4 = var2.length - 3; +- double var5 = func_110666_a(var1, var3.posX, var2[var4++]); +- double var7 = func_110665_a(var1, var3.posY, var2[var4++], 0, 0); +- double var9 = func_110666_a(var1, var3.posZ, var2[var4++]); ++ } else if (var3.worldObj != null) { ++ int var4 = par2ArrayOfStr.length - 3; ++ double var5 = func_110666_a(par1ICommandSender, var3.posX, par2ArrayOfStr[var4++]); ++ double var7 = func_110665_a(par1ICommandSender, var3.posY, par2ArrayOfStr[var4++], 0, 0); ++ double var9 = func_110666_a(par1ICommandSender, var3.posZ, par2ArrayOfStr[var4++]); + var3.mountEntity((Entity)null); + var3.setPositionAndUpdate(var5, var7, var9); +- notifyAdmins(var1, "commands.tp.success.coordinates", new Object[]{var3.getEntityName(), Double.valueOf(var5), Double.valueOf(var7), Double.valueOf(var9)}); ++ notifyAdmins(par1ICommandSender, "commands.tp.success.coordinates", new Object[] {var3.getEntityName(), Double.valueOf(var5), Double.valueOf(var7), Double.valueOf(var9)}); + } +- + } + } + +- public List addTabCompletionOptions(ICommandSender var1, String[] var2) { +- return var2.length != 1 && var2.length != 2 ? null : getListOfStringsMatchingLastWord(var2, MinecraftServer.getServer().getAllUsernames()); ++ /** ++ * Adds the strings available in this command to the given list of tab completion options. ++ */ ++ public List addTabCompletionOptions(ICommandSender par1ICommandSender, String[] par2ArrayOfStr) { ++ return par2ArrayOfStr.length != 1 && par2ArrayOfStr.length != 2 ? null : getListOfStringsMatchingLastWord(par2ArrayOfStr, MinecraftServer.getServer().getAllUsernames()); + } + +- public boolean isUsernameIndex(String[] var1, int var2) { +- return var2 == 0; ++ /** ++ * Return whether the specified command parameter index is a username parameter. ++ */ ++ public boolean isUsernameIndex(String[] par1ArrayOfStr, int par2) { ++ return par2 == 0; + } + } diff --git a/patches/net/minecraft/src/CommandServerWhitelist.java.patch b/patches/net/minecraft/src/CommandServerWhitelist.java.patch new file mode 100644 index 0000000..4c92511 --- /dev/null +++ b/patches/net/minecraft/src/CommandServerWhitelist.java.patch @@ -0,0 +1,129 @@ +--- net/minecraft/src/CommandServerWhitelist.java ++++ net/minecraft/src/CommandServerWhitelist.java +@@ -10,58 +10,61 @@ + return "whitelist"; + } + ++ /** ++ * Return the required permission level for this command. ++ */ + public int getRequiredPermissionLevel() { + return 3; + } + +- public String getCommandUsage(ICommandSender var1) { ++ public String getCommandUsage(ICommandSender par1ICommandSender) { + return "commands.whitelist.usage"; + } + +- public void processCommand(ICommandSender var1, String[] var2) { +- if(var2.length >= 1) { +- if(var2[0].equals("on")) { ++ public void processCommand(ICommandSender par1ICommandSender, String[] par2ArrayOfStr) { ++ if (par2ArrayOfStr.length >= 1) { ++ if (par2ArrayOfStr[0].equals("on")) { + MinecraftServer.getServer().getConfigurationManager().setWhiteListEnabled(true); +- notifyAdmins(var1, "commands.whitelist.enabled", new Object[0]); ++ notifyAdmins(par1ICommandSender, "commands.whitelist.enabled", new Object[0]); + return; + } + +- if(var2[0].equals("off")) { ++ if (par2ArrayOfStr[0].equals("off")) { + MinecraftServer.getServer().getConfigurationManager().setWhiteListEnabled(false); +- notifyAdmins(var1, "commands.whitelist.disabled", new Object[0]); ++ notifyAdmins(par1ICommandSender, "commands.whitelist.disabled", new Object[0]); + return; + } + +- if(var2[0].equals("list")) { +- var1.sendChatToPlayer(ChatMessageComponent.createFromTranslationWithSubstitutions("commands.whitelist.list", new Object[]{Integer.valueOf(MinecraftServer.getServer().getConfigurationManager().getWhiteListedPlayers().size()), Integer.valueOf(MinecraftServer.getServer().getConfigurationManager().getAvailablePlayerDat().length)})); ++ if (par2ArrayOfStr[0].equals("list")) { ++ par1ICommandSender.sendChatToPlayer(ChatMessageComponent.createFromTranslationWithSubstitutions("commands.whitelist.list", new Object[] {Integer.valueOf(MinecraftServer.getServer().getConfigurationManager().getWhiteListedPlayers().size()), Integer.valueOf(MinecraftServer.getServer().getConfigurationManager().getAvailablePlayerDat().length)})); + Set var3 = MinecraftServer.getServer().getConfigurationManager().getWhiteListedPlayers(); +- var1.sendChatToPlayer(ChatMessageComponent.createFromText(joinNiceString(var3.toArray(new String[var3.size()])))); ++ par1ICommandSender.sendChatToPlayer(ChatMessageComponent.createFromText(joinNiceString(var3.toArray(new String[var3.size()])))); + return; + } + +- if(var2[0].equals("add")) { +- if(var2.length < 2) { ++ if (par2ArrayOfStr[0].equals("add")) { ++ if (par2ArrayOfStr.length < 2) { + throw new WrongUsageException("commands.whitelist.add.usage", new Object[0]); + } + +- MinecraftServer.getServer().getConfigurationManager().addToWhiteList(var2[1]); +- notifyAdmins(var1, "commands.whitelist.add.success", new Object[]{var2[1]}); ++ MinecraftServer.getServer().getConfigurationManager().addToWhiteList(par2ArrayOfStr[1]); ++ notifyAdmins(par1ICommandSender, "commands.whitelist.add.success", new Object[] {par2ArrayOfStr[1]}); + return; + } + +- if(var2[0].equals("remove")) { +- if(var2.length < 2) { ++ if (par2ArrayOfStr[0].equals("remove")) { ++ if (par2ArrayOfStr.length < 2) { + throw new WrongUsageException("commands.whitelist.remove.usage", new Object[0]); + } + +- MinecraftServer.getServer().getConfigurationManager().removeFromWhitelist(var2[1]); +- notifyAdmins(var1, "commands.whitelist.remove.success", new Object[]{var2[1]}); ++ MinecraftServer.getServer().getConfigurationManager().removeFromWhitelist(par2ArrayOfStr[1]); ++ notifyAdmins(par1ICommandSender, "commands.whitelist.remove.success", new Object[] {par2ArrayOfStr[1]}); + return; + } + +- if(var2[0].equals("reload")) { ++ if (par2ArrayOfStr[0].equals("reload")) { + MinecraftServer.getServer().getConfigurationManager().loadWhiteList(); +- notifyAdmins(var1, "commands.whitelist.reloaded", new Object[0]); ++ notifyAdmins(par1ICommandSender, "commands.whitelist.reloaded", new Object[0]); + return; + } + } +@@ -69,21 +72,25 @@ + throw new WrongUsageException("commands.whitelist.usage", new Object[0]); + } + +- public List addTabCompletionOptions(ICommandSender var1, String[] var2) { +- if(var2.length == 1) { +- return getListOfStringsMatchingLastWord(var2, new String[]{"on", "off", "list", "add", "remove", "reload"}); ++ /** ++ * Adds the strings available in this command to the given list of tab completion options. ++ */ ++ public List addTabCompletionOptions(ICommandSender par1ICommandSender, String[] par2ArrayOfStr) { ++ if (par2ArrayOfStr.length == 1) { ++ return getListOfStringsMatchingLastWord(par2ArrayOfStr, new String[] {"on", "off", "list", "add", "remove", "reload"}); + } else { +- if(var2.length == 2) { +- if(var2[0].equals("add")) { ++ if (par2ArrayOfStr.length == 2) { ++ if (par2ArrayOfStr[0].equals("add")) { + String[] var3 = MinecraftServer.getServer().getConfigurationManager().getAvailablePlayerDat(); + ArrayList var4 = new ArrayList(); +- String var5 = var2[var2.length - 1]; ++ String var5 = par2ArrayOfStr[par2ArrayOfStr.length - 1]; + String[] var6 = var3; + int var7 = var3.length; + +- for(int var8 = 0; var8 < var7; ++var8) { ++ for (int var8 = 0; var8 < var7; ++var8) { + String var9 = var6[var8]; +- if(doesStringStartWith(var5, var9) && !MinecraftServer.getServer().getConfigurationManager().getWhiteListedPlayers().contains(var9)) { ++ ++ if (doesStringStartWith(var5, var9) && !MinecraftServer.getServer().getConfigurationManager().getWhiteListedPlayers().contains(var9)) { + var4.add(var9); + } + } +@@ -91,8 +98,8 @@ + return var4; + } + +- if(var2[0].equals("remove")) { +- return getListOfStringsFromIterableMatchingLastWord(var2, MinecraftServer.getServer().getConfigurationManager().getWhiteListedPlayers()); ++ if (par2ArrayOfStr[0].equals("remove")) { ++ return getListOfStringsFromIterableMatchingLastWord(par2ArrayOfStr, MinecraftServer.getServer().getConfigurationManager().getWhiteListedPlayers()); + } + } + diff --git a/patches/net/minecraft/src/CommandSetPlayerTimeout.java.patch b/patches/net/minecraft/src/CommandSetPlayerTimeout.java.patch new file mode 100644 index 0000000..706c97c --- /dev/null +++ b/patches/net/minecraft/src/CommandSetPlayerTimeout.java.patch @@ -0,0 +1,30 @@ +--- net/minecraft/src/CommandSetPlayerTimeout.java ++++ net/minecraft/src/CommandSetPlayerTimeout.java +@@ -7,19 +7,22 @@ + return "setidletimeout"; + } + ++ /** ++ * Return the required permission level for this command. ++ */ + public int getRequiredPermissionLevel() { + return 3; + } + +- public String getCommandUsage(ICommandSender var1) { ++ public String getCommandUsage(ICommandSender par1ICommandSender) { + return "commands.setidletimeout.usage"; + } + +- public void processCommand(ICommandSender var1, String[] var2) { +- if(var2.length == 1) { +- int var3 = parseIntWithMin(var1, var2[0], 0); ++ public void processCommand(ICommandSender par1ICommandSender, String[] par2ArrayOfStr) { ++ if (par2ArrayOfStr.length == 1) { ++ int var3 = parseIntWithMin(par1ICommandSender, par2ArrayOfStr[0], 0); + MinecraftServer.getServer().func_143006_e(var3); +- notifyAdmins(var1, "commands.setidletimeout.success", new Object[]{Integer.valueOf(var3)}); ++ notifyAdmins(par1ICommandSender, "commands.setidletimeout.success", new Object[] {Integer.valueOf(var3)}); + } else { + throw new WrongUsageException("commands.setidletimeout.usage", new Object[0]); + } diff --git a/patches/net/minecraft/src/CommandSetSpawnpoint.java.patch b/patches/net/minecraft/src/CommandSetSpawnpoint.java.patch new file mode 100644 index 0000000..a2919e6 --- /dev/null +++ b/patches/net/minecraft/src/CommandSetSpawnpoint.java.patch @@ -0,0 +1,77 @@ +--- net/minecraft/src/CommandSetSpawnpoint.java ++++ net/minecraft/src/CommandSetSpawnpoint.java +@@ -8,44 +8,53 @@ + return "spawnpoint"; + } + ++ /** ++ * Return the required permission level for this command. ++ */ + public int getRequiredPermissionLevel() { + return 2; + } + +- public String getCommandUsage(ICommandSender var1) { ++ public String getCommandUsage(ICommandSender par1ICommandSender) { + return "commands.spawnpoint.usage"; + } + +- public void processCommand(ICommandSender var1, String[] var2) { +- EntityPlayerMP var3 = var2.length == 0 ? getCommandSenderAsPlayer(var1) : getPlayer(var1, var2[0]); +- if(var2.length == 4) { +- if(var3.worldObj != null) { ++ public void processCommand(ICommandSender par1ICommandSender, String[] par2ArrayOfStr) { ++ EntityPlayerMP var3 = par2ArrayOfStr.length == 0 ? getCommandSenderAsPlayer(par1ICommandSender) : getPlayer(par1ICommandSender, par2ArrayOfStr[0]); ++ ++ if (par2ArrayOfStr.length == 4) { ++ if (var3.worldObj != null) { + byte var4 = 1; + int var5 = 30000000; + int var9 = var4 + 1; +- int var6 = parseIntBounded(var1, var2[var4], -var5, var5); +- int var7 = parseIntBounded(var1, var2[var9++], 0, 256); +- int var8 = parseIntBounded(var1, var2[var9++], -var5, var5); ++ int var6 = parseIntBounded(par1ICommandSender, par2ArrayOfStr[var4], -var5, var5); ++ int var7 = parseIntBounded(par1ICommandSender, par2ArrayOfStr[var9++], 0, 256); ++ int var8 = parseIntBounded(par1ICommandSender, par2ArrayOfStr[var9++], -var5, var5); + var3.setSpawnChunk(new ChunkCoordinates(var6, var7, var8), true); +- notifyAdmins(var1, "commands.spawnpoint.success", new Object[]{var3.getEntityName(), Integer.valueOf(var6), Integer.valueOf(var7), Integer.valueOf(var8)}); ++ notifyAdmins(par1ICommandSender, "commands.spawnpoint.success", new Object[] {var3.getEntityName(), Integer.valueOf(var6), Integer.valueOf(var7), Integer.valueOf(var8)}); + } + } else { +- if(var2.length > 1) { ++ if (par2ArrayOfStr.length > 1) { + throw new WrongUsageException("commands.spawnpoint.usage", new Object[0]); + } + +- ChunkCoordinates var10 = var3.getCommandSenderPosition(); ++ ChunkCoordinates var10 = var3.getPlayerCoordinates(); + var3.setSpawnChunk(var10, true); +- notifyAdmins(var1, "commands.spawnpoint.success", new Object[]{var3.getEntityName(), Integer.valueOf(var10.posX), Integer.valueOf(var10.posY), Integer.valueOf(var10.posZ)}); ++ notifyAdmins(par1ICommandSender, "commands.spawnpoint.success", new Object[] {var3.getEntityName(), Integer.valueOf(var10.posX), Integer.valueOf(var10.posY), Integer.valueOf(var10.posZ)}); + } +- +- } +- +- public List addTabCompletionOptions(ICommandSender var1, String[] var2) { +- return var2.length != 1 && var2.length != 2 ? null : getListOfStringsMatchingLastWord(var2, MinecraftServer.getServer().getAllUsernames()); +- } +- +- public boolean isUsernameIndex(String[] var1, int var2) { +- return var2 == 0; ++ } ++ ++ /** ++ * Adds the strings available in this command to the given list of tab completion options. ++ */ ++ public List addTabCompletionOptions(ICommandSender par1ICommandSender, String[] par2ArrayOfStr) { ++ return par2ArrayOfStr.length != 1 && par2ArrayOfStr.length != 2 ? null : getListOfStringsMatchingLastWord(par2ArrayOfStr, MinecraftServer.getServer().getAllUsernames()); ++ } ++ ++ /** ++ * Return whether the specified command parameter index is a username parameter. ++ */ ++ public boolean isUsernameIndex(String[] par1ArrayOfStr, int par2) { ++ return par2 == 0; + } + } diff --git a/patches/net/minecraft/src/CommandShowSeed.java.patch b/patches/net/minecraft/src/CommandShowSeed.java.patch new file mode 100644 index 0000000..3eac8b9 --- /dev/null +++ b/patches/net/minecraft/src/CommandShowSeed.java.patch @@ -0,0 +1,40 @@ +--- net/minecraft/src/CommandShowSeed.java ++++ net/minecraft/src/CommandShowSeed.java +@@ -3,24 +3,31 @@ + import net.minecraft.server.MinecraftServer; + + public class CommandShowSeed extends CommandBase { +- public boolean canCommandSenderUseCommand(ICommandSender var1) { +- return MinecraftServer.getServer().isSinglePlayer() || super.canCommandSenderUseCommand(var1); ++ ++ /** ++ * Returns true if the given command sender is allowed to use this command. ++ */ ++ public boolean canCommandSenderUseCommand(ICommandSender par1ICommandSender) { ++ return MinecraftServer.getServer().isSinglePlayer() || super.canCommandSenderUseCommand(par1ICommandSender); + } + + public String getCommandName() { + return "seed"; + } + ++ /** ++ * Return the required permission level for this command. ++ */ + public int getRequiredPermissionLevel() { + return 2; + } + +- public String getCommandUsage(ICommandSender var1) { ++ public String getCommandUsage(ICommandSender par1ICommandSender) { + return "commands.seed.usage"; + } + +- public void processCommand(ICommandSender var1, String[] var2) { +- Object var3 = var1 instanceof EntityPlayer ? ((EntityPlayer)var1).worldObj : MinecraftServer.getServer().worldServerForDimension(0); +- var1.sendChatToPlayer(ChatMessageComponent.createFromTranslationWithSubstitutions("commands.seed.success", new Object[]{Long.valueOf(((World)var3).getSeed())})); ++ public void processCommand(ICommandSender par1ICommandSender, String[] par2ArrayOfStr) { ++ Object var3 = par1ICommandSender instanceof EntityPlayer ? ((EntityPlayer)par1ICommandSender).worldObj : MinecraftServer.getServer().worldServerForDimension(0); ++ par1ICommandSender.sendChatToPlayer(ChatMessageComponent.createFromTranslationWithSubstitutions("commands.seed.success", new Object[] {Long.valueOf(((World)var3).getSeed())})); + } + } diff --git a/patches/net/minecraft/src/CommandSpreadPlayers.java.patch b/patches/net/minecraft/src/CommandSpreadPlayers.java.patch new file mode 100644 index 0000000..4d902fb --- /dev/null +++ b/patches/net/minecraft/src/CommandSpreadPlayers.java.patch @@ -0,0 +1,289 @@ +--- net/minecraft/src/CommandSpreadPlayers.java ++++ net/minecraft/src/CommandSpreadPlayers.java +@@ -17,40 +17,46 @@ + return "spreadplayers"; + } + ++ /** ++ * Return the required permission level for this command. ++ */ + public int getRequiredPermissionLevel() { + return 2; + } + +- public String getCommandUsage(ICommandSender var1) { ++ public String getCommandUsage(ICommandSender par1ICommandSender) { + return "commands.spreadplayers.usage"; + } + +- public void processCommand(ICommandSender var1, String[] var2) { +- if(var2.length < 6) { ++ public void processCommand(ICommandSender par1ICommandSender, String[] par2ArrayOfStr) { ++ if (par2ArrayOfStr.length < 6) { + throw new WrongUsageException("commands.spreadplayers.usage", new Object[0]); + } else { + byte var3 = 0; + int var16 = var3 + 1; +- double var4 = func_110666_a(var1, Double.NaN, var2[var3]); +- double var6 = func_110666_a(var1, Double.NaN, var2[var16++]); +- double var8 = func_110664_a(var1, var2[var16++], 0.0D); +- double var10 = func_110664_a(var1, var2[var16++], var8 + 1.0D); +- boolean var12 = func_110662_c(var1, var2[var16++]); ++ double var4 = func_110666_a(par1ICommandSender, Double.NaN, par2ArrayOfStr[var3]); ++ double var6 = func_110666_a(par1ICommandSender, Double.NaN, par2ArrayOfStr[var16++]); ++ double var8 = func_110664_a(par1ICommandSender, par2ArrayOfStr[var16++], 0.0D); ++ double var10 = func_110664_a(par1ICommandSender, par2ArrayOfStr[var16++], var8 + 1.0D); ++ boolean var12 = func_110662_c(par1ICommandSender, par2ArrayOfStr[var16++]); + ArrayList var13 = Lists.newArrayList(); + +- while(true) { +- while(var16 < var2.length) { +- String var14 = var2[var16++]; +- if(PlayerSelector.hasArguments(var14)) { +- EntityPlayerMP[] var17 = PlayerSelector.matchPlayers(var1, var14); +- if(var17 == null || var17.length == 0) { ++ while (true) { ++ while (var16 < par2ArrayOfStr.length) { ++ String var14 = par2ArrayOfStr[var16++]; ++ ++ if (PlayerSelector.hasArguments(var14)) { ++ EntityPlayerMP[] var17 = PlayerSelector.matchPlayers(par1ICommandSender, var14); ++ ++ if (var17 == null || var17.length == 0) { + throw new PlayerNotFoundException(); + } + + Collections.addAll(var13, var17); + } else { +- EntityPlayerMP var15 = MinecraftServer.getServer().getConfigurationManager().getPlayerEntity(var14); +- if(var15 == null) { ++ EntityPlayerMP var15 = MinecraftServer.getServer().getConfigurationManager().getPlayerForUsername(var14); ++ ++ if (var15 == null) { + throw new PlayerNotFoundException(); + } + +@@ -58,40 +64,41 @@ + } + } + +- if(var13.isEmpty()) { ++ if (var13.isEmpty()) { + throw new PlayerNotFoundException(); + } + +- var1.sendChatToPlayer(ChatMessageComponent.createFromTranslationWithSubstitutions("commands.spreadplayers.spreading." + (var12 ? "teams" : "players"), new Object[]{func_110663_b(var13), Double.valueOf(var4), Double.valueOf(var6), Double.valueOf(var8), Double.valueOf(var10)})); +- this.func_110669_a(var1, var13, new CommandSpreadPlayersPosition(var4, var6), var8, var10, ((EntityLivingBase)var13.get(0)).worldObj, var12); ++ par1ICommandSender.sendChatToPlayer(ChatMessageComponent.createFromTranslationWithSubstitutions("commands.spreadplayers.spreading." + (var12 ? "teams" : "players"), new Object[] {func_110663_b(var13), Double.valueOf(var4), Double.valueOf(var6), Double.valueOf(var8), Double.valueOf(var10)})); ++ this.func_110669_a(par1ICommandSender, var13, new CommandSpreadPlayersPosition(var4, var6), var8, var10, ((EntityLivingBase)var13.get(0)).worldObj, var12); + return; + } + } + } + +- private void func_110669_a(ICommandSender var1, List var2, CommandSpreadPlayersPosition var3, double var4, double var6, World var8, boolean var9) { ++ private void func_110669_a(ICommandSender par1ICommandSender, List par2List, CommandSpreadPlayersPosition par3CommandSpreadPlayersPosition, double par4, double par6, World par8World, boolean par9) { + Random var10 = new Random(); +- double var11 = var3.field_111101_a - var6; +- double var13 = var3.field_111100_b - var6; +- double var15 = var3.field_111101_a + var6; +- double var17 = var3.field_111100_b + var6; +- CommandSpreadPlayersPosition[] var19 = this.func_110670_a(var10, var9 ? this.func_110667_a(var2) : var2.size(), var11, var13, var15, var17); +- int var20 = this.func_110668_a(var3, var4, var8, var10, var11, var13, var15, var17, var19, var9); +- double var21 = this.func_110671_a(var2, var8, var19, var9); +- notifyAdmins(var1, "commands.spreadplayers.success." + (var9 ? "teams" : "players"), new Object[]{Integer.valueOf(var19.length), Double.valueOf(var3.field_111101_a), Double.valueOf(var3.field_111100_b)}); +- if(var19.length > 1) { +- var1.sendChatToPlayer(ChatMessageComponent.createFromTranslationWithSubstitutions("commands.spreadplayers.info." + (var9 ? "teams" : "players"), new Object[]{String.format("%.2f", new Object[]{Double.valueOf(var21)}), Integer.valueOf(var20)})); ++ double var11 = par3CommandSpreadPlayersPosition.field_111101_a - par6; ++ double var13 = par3CommandSpreadPlayersPosition.field_111100_b - par6; ++ double var15 = par3CommandSpreadPlayersPosition.field_111101_a + par6; ++ double var17 = par3CommandSpreadPlayersPosition.field_111100_b + par6; ++ CommandSpreadPlayersPosition[] var19 = this.func_110670_a(var10, par9 ? this.func_110667_a(par2List) : par2List.size(), var11, var13, var15, var17); ++ int var20 = this.func_110668_a(par3CommandSpreadPlayersPosition, par4, par8World, var10, var11, var13, var15, var17, var19, par9); ++ double var21 = this.func_110671_a(par2List, par8World, var19, par9); ++ notifyAdmins(par1ICommandSender, "commands.spreadplayers.success." + (par9 ? "teams" : "players"), new Object[] {Integer.valueOf(var19.length), Double.valueOf(par3CommandSpreadPlayersPosition.field_111101_a), Double.valueOf(par3CommandSpreadPlayersPosition.field_111100_b)}); ++ ++ if (var19.length > 1) { ++ par1ICommandSender.sendChatToPlayer(ChatMessageComponent.createFromTranslationWithSubstitutions("commands.spreadplayers.info." + (par9 ? "teams" : "players"), new Object[] {String.format("%.2f", new Object[]{Double.valueOf(var21)}), Integer.valueOf(var20)})); + } +- + } + +- private int func_110667_a(List var1) { ++ private int func_110667_a(List par1List) { + HashSet var2 = Sets.newHashSet(); +- Iterator var3 = var1.iterator(); ++ Iterator var3 = par1List.iterator(); + +- while(var3.hasNext()) { ++ while (var3.hasNext()) { + EntityLivingBase var4 = (EntityLivingBase)var3.next(); +- if(var4 instanceof EntityPlayer) { ++ ++ if (var4 instanceof EntityPlayer) { + var2.add(((EntityPlayer)var4).getTeam()); + } else { + var2.add((Object)null); +@@ -101,28 +108,29 @@ + return var2.size(); + } + +- private int func_110668_a(CommandSpreadPlayersPosition var1, double var2, World var4, Random var5, double var6, double var8, double var10, double var12, CommandSpreadPlayersPosition[] var14, boolean var15) { ++ private int func_110668_a(CommandSpreadPlayersPosition par1CommandSpreadPlayersPosition, double par2, World par4World, Random par5Random, double par6, double par8, double par10, double par12, CommandSpreadPlayersPosition[] par14ArrayOfCommandSpreadPlayersPosition, boolean par15) { + boolean var16 = true; +- double var18 = (double)Float.MAX_VALUE; +- ++ double var18 = 3.4028234663852886E38D; + int var17; +- for(var17 = 0; var17 < 10000 && var16; ++var17) { ++ ++ for (var17 = 0; var17 < 10000 && var16; ++var17) { + var16 = false; +- var18 = (double)Float.MAX_VALUE; +- ++ var18 = 3.4028234663852886E38D; + int var22; + CommandSpreadPlayersPosition var23; +- for(int var20 = 0; var20 < var14.length; ++var20) { +- CommandSpreadPlayersPosition var21 = var14[var20]; ++ ++ for (int var20 = 0; var20 < par14ArrayOfCommandSpreadPlayersPosition.length; ++var20) { ++ CommandSpreadPlayersPosition var21 = par14ArrayOfCommandSpreadPlayersPosition[var20]; + var22 = 0; + var23 = new CommandSpreadPlayersPosition(); + +- for(int var24 = 0; var24 < var14.length; ++var24) { +- if(var20 != var24) { +- CommandSpreadPlayersPosition var25 = var14[var24]; ++ for (int var24 = 0; var24 < par14ArrayOfCommandSpreadPlayersPosition.length; ++var24) { ++ if (var20 != var24) { ++ CommandSpreadPlayersPosition var25 = par14ArrayOfCommandSpreadPlayersPosition[var24]; + double var26 = var21.func_111099_a(var25); + var18 = Math.min(var26, var18); +- if(var26 < var2) { ++ ++ if (var26 < par2) { + ++var22; + var23.field_111101_a += var25.field_111101_a - var21.field_111101_a; + var23.field_111100_b += var25.field_111100_b - var21.field_111100_b; +@@ -130,71 +138,75 @@ + } + } + +- if(var22 > 0) { ++ if (var22 > 0) { + var23.field_111101_a /= (double)var22; + var23.field_111100_b /= (double)var22; + double var30 = (double)var23.func_111096_b(); +- if(var30 > 0.0D) { ++ ++ if (var30 > 0.0D) { + var23.func_111095_a(); + var21.func_111094_b(var23); + } else { +- var21.func_111097_a(var5, var6, var8, var10, var12); ++ var21.func_111097_a(par5Random, par6, par8, par10, par12); + } + + var16 = true; + } + +- if(var21.func_111093_a(var6, var8, var10, var12)) { ++ if (var21.func_111093_a(par6, par8, par10, par12)) { + var16 = true; + } + } + +- if(!var16) { +- CommandSpreadPlayersPosition[] var28 = var14; +- int var29 = var14.length; ++ if (!var16) { ++ CommandSpreadPlayersPosition[] var28 = par14ArrayOfCommandSpreadPlayersPosition; ++ int var29 = par14ArrayOfCommandSpreadPlayersPosition.length; + +- for(var22 = 0; var22 < var29; ++var22) { ++ for (var22 = 0; var22 < var29; ++var22) { + var23 = var28[var22]; +- if(!var23.func_111098_b(var4)) { +- var23.func_111097_a(var5, var6, var8, var10, var12); ++ ++ if (!var23.func_111098_b(par4World)) { ++ var23.func_111097_a(par5Random, par6, par8, par10, par12); + var16 = true; + } + } + } + } + +- if(var17 >= 10000) { +- throw new CommandException("commands.spreadplayers.failure." + (var15 ? "teams" : "players"), new Object[]{Integer.valueOf(var14.length), Double.valueOf(var1.field_111101_a), Double.valueOf(var1.field_111100_b), String.format("%.2f", new Object[]{Double.valueOf(var18)})}); ++ if (var17 >= 10000) { ++ throw new CommandException("commands.spreadplayers.failure." + (par15 ? "teams" : "players"), new Object[] {Integer.valueOf(par14ArrayOfCommandSpreadPlayersPosition.length), Double.valueOf(par1CommandSpreadPlayersPosition.field_111101_a), Double.valueOf(par1CommandSpreadPlayersPosition.field_111100_b), String.format("%.2f", new Object[]{Double.valueOf(var18)})}); + } else { + return var17; + } + } + +- private double func_110671_a(List var1, World var2, CommandSpreadPlayersPosition[] var3, boolean var4) { ++ private double func_110671_a(List par1List, World par2World, CommandSpreadPlayersPosition[] par3ArrayOfCommandSpreadPlayersPosition, boolean par4) { + double var5 = 0.0D; + int var7 = 0; + HashMap var8 = Maps.newHashMap(); + +- for(int var9 = 0; var9 < var1.size(); ++var9) { +- EntityLivingBase var10 = (EntityLivingBase)var1.get(var9); ++ for (int var9 = 0; var9 < par1List.size(); ++var9) { ++ EntityLivingBase var10 = (EntityLivingBase)par1List.get(var9); + CommandSpreadPlayersPosition var11; +- if(var4) { ++ ++ if (par4) { + Team var12 = var10 instanceof EntityPlayer ? ((EntityPlayer)var10).getTeam() : null; +- if(!var8.containsKey(var12)) { +- var8.put(var12, var3[var7++]); ++ ++ if (!var8.containsKey(var12)) { ++ var8.put(var12, par3ArrayOfCommandSpreadPlayersPosition[var7++]); + } + + var11 = (CommandSpreadPlayersPosition)var8.get(var12); + } else { +- var11 = var3[var7++]; ++ var11 = par3ArrayOfCommandSpreadPlayersPosition[var7++]; + } + +- var10.setPositionAndUpdate((double)((float)MathHelper.floor_double(var11.field_111101_a) + 0.5F), (double)var11.func_111092_a(var2), (double)MathHelper.floor_double(var11.field_111100_b) + 0.5D); ++ var10.setPositionAndUpdate((double)((float)MathHelper.floor_double(var11.field_111101_a) + 0.5F), (double)var11.func_111092_a(par2World), (double)MathHelper.floor_double(var11.field_111100_b) + 0.5D); + double var17 = Double.MAX_VALUE; + +- for(int var14 = 0; var14 < var3.length; ++var14) { +- if(var11 != var3[var14]) { +- double var15 = var11.func_111099_a(var3[var14]); ++ for (int var14 = 0; var14 < par3ArrayOfCommandSpreadPlayersPosition.length; ++var14) { ++ if (var11 != par3ArrayOfCommandSpreadPlayersPosition[var14]) { ++ double var15 = var11.func_111099_a(par3ArrayOfCommandSpreadPlayersPosition[var14]); + var17 = Math.min(var15, var17); + } + } +@@ -202,16 +214,16 @@ + var5 += var17; + } + +- var5 /= (double)var1.size(); ++ var5 /= (double)par1List.size(); + return var5; + } + +- private CommandSpreadPlayersPosition[] func_110670_a(Random var1, int var2, double var3, double var5, double var7, double var9) { +- CommandSpreadPlayersPosition[] var11 = new CommandSpreadPlayersPosition[var2]; ++ private CommandSpreadPlayersPosition[] func_110670_a(Random par1Random, int par2, double par3, double par5, double par7, double par9) { ++ CommandSpreadPlayersPosition[] var11 = new CommandSpreadPlayersPosition[par2]; + +- for(int var12 = 0; var12 < var11.length; ++var12) { ++ for (int var12 = 0; var12 < var11.length; ++var12) { + CommandSpreadPlayersPosition var13 = new CommandSpreadPlayersPosition(); +- var13.func_111097_a(var1, var3, var5, var7, var9); ++ var13.func_111097_a(par1Random, par3, par5, par7, par9); + var11[var12] = var13; + } + diff --git a/patches/net/minecraft/src/CommandSpreadPlayersPosition.java.patch b/patches/net/minecraft/src/CommandSpreadPlayersPosition.java.patch new file mode 100644 index 0000000..25b91d9 --- /dev/null +++ b/patches/net/minecraft/src/CommandSpreadPlayersPosition.java.patch @@ -0,0 +1,119 @@ +--- net/minecraft/src/CommandSpreadPlayersPosition.java ++++ net/minecraft/src/CommandSpreadPlayersPosition.java +@@ -6,17 +6,16 @@ + double field_111101_a; + double field_111100_b; + +- CommandSpreadPlayersPosition() { +- } +- +- CommandSpreadPlayersPosition(double var1, double var3) { +- this.field_111101_a = var1; +- this.field_111100_b = var3; +- } +- +- double func_111099_a(CommandSpreadPlayersPosition var1) { +- double var2 = this.field_111101_a - var1.field_111101_a; +- double var4 = this.field_111100_b - var1.field_111100_b; ++ CommandSpreadPlayersPosition() {} ++ ++ CommandSpreadPlayersPosition(double par1, double par3) { ++ this.field_111101_a = par1; ++ this.field_111100_b = par3; ++ } ++ ++ double func_111099_a(CommandSpreadPlayersPosition par1CommandSpreadPlayersPosition) { ++ double var2 = this.field_111101_a - par1CommandSpreadPlayersPosition.field_111101_a; ++ double var4 = this.field_111100_b - par1CommandSpreadPlayersPosition.field_111100_b; + return Math.sqrt(var2 * var2 + var4 * var4); + } + +@@ -30,39 +29,41 @@ + return MathHelper.sqrt_double(this.field_111101_a * this.field_111101_a + this.field_111100_b * this.field_111100_b); + } + +- public void func_111094_b(CommandSpreadPlayersPosition var1) { +- this.field_111101_a -= var1.field_111101_a; +- this.field_111100_b -= var1.field_111100_b; ++ public void func_111094_b(CommandSpreadPlayersPosition par1CommandSpreadPlayersPosition) { ++ this.field_111101_a -= par1CommandSpreadPlayersPosition.field_111101_a; ++ this.field_111100_b -= par1CommandSpreadPlayersPosition.field_111100_b; + } + +- public boolean func_111093_a(double var1, double var3, double var5, double var7) { ++ public boolean func_111093_a(double par1, double par3, double par5, double par7) { + boolean var9 = false; +- if(this.field_111101_a < var1) { +- this.field_111101_a = var1; ++ ++ if (this.field_111101_a < par1) { ++ this.field_111101_a = par1; + var9 = true; +- } else if(this.field_111101_a > var5) { +- this.field_111101_a = var5; ++ } else if (this.field_111101_a > par5) { ++ this.field_111101_a = par5; + var9 = true; + } + +- if(this.field_111100_b < var3) { +- this.field_111100_b = var3; ++ if (this.field_111100_b < par3) { ++ this.field_111100_b = par3; + var9 = true; +- } else if(this.field_111100_b > var7) { +- this.field_111100_b = var7; ++ } else if (this.field_111100_b > par7) { ++ this.field_111100_b = par7; + var9 = true; + } + + return var9; + } + +- public int func_111092_a(World var1) { ++ public int func_111092_a(World par1World) { + int var2 = MathHelper.floor_double(this.field_111101_a); + int var3 = MathHelper.floor_double(this.field_111100_b); + +- for(int var4 = 256; var4 > 0; --var4) { +- int var5 = var1.getBlockId(var2, var4, var3); +- if(var5 != 0) { ++ for (int var4 = 256; var4 > 0; --var4) { ++ int var5 = par1World.getBlockId(var2, var4, var3); ++ ++ if (var5 != 0) { + return var4 + 1; + } + } +@@ -70,13 +71,14 @@ + return 257; + } + +- public boolean func_111098_b(World var1) { ++ public boolean func_111098_b(World par1World) { + int var2 = MathHelper.floor_double(this.field_111101_a); + int var3 = MathHelper.floor_double(this.field_111100_b); + +- for(int var4 = 256; var4 > 0; --var4) { +- int var5 = var1.getBlockId(var2, var4, var3); +- if(var5 != 0) { ++ for (int var4 = 256; var4 > 0; --var4) { ++ int var5 = par1World.getBlockId(var2, var4, var3); ++ ++ if (var5 != 0) { + Material var6 = Block.blocksList[var5].blockMaterial; + return !var6.isLiquid() && var6 != Material.fire; + } +@@ -85,8 +87,8 @@ + return false; + } + +- public void func_111097_a(Random var1, double var2, double var4, double var6, double var8) { +- this.field_111101_a = MathHelper.getRandomDoubleInRange(var1, var2, var6); +- this.field_111100_b = MathHelper.getRandomDoubleInRange(var1, var4, var8); ++ public void func_111097_a(Random par1Random, double par2, double par4, double par6, double par8) { ++ this.field_111101_a = MathHelper.getRandomDoubleInRange(par1Random, par2, par6); ++ this.field_111100_b = MathHelper.getRandomDoubleInRange(par1Random, par4, par8); + } + } diff --git a/patches/net/minecraft/src/CommandTime.java.patch b/patches/net/minecraft/src/CommandTime.java.patch new file mode 100644 index 0000000..280453e --- /dev/null +++ b/patches/net/minecraft/src/CommandTime.java.patch @@ -0,0 +1,95 @@ +--- net/minecraft/src/CommandTime.java ++++ net/minecraft/src/CommandTime.java +@@ -8,35 +8,39 @@ + return "time"; + } + ++ /** ++ * Return the required permission level for this command. ++ */ + public int getRequiredPermissionLevel() { + return 2; + } + +- public String getCommandUsage(ICommandSender var1) { ++ public String getCommandUsage(ICommandSender par1ICommandSender) { + return "commands.time.usage"; + } + +- public void processCommand(ICommandSender var1, String[] var2) { +- if(var2.length > 1) { ++ public void processCommand(ICommandSender par1ICommandSender, String[] par2ArrayOfStr) { ++ if (par2ArrayOfStr.length > 1) { + int var3; +- if(var2[0].equals("set")) { +- if(var2[1].equals("day")) { ++ ++ if (par2ArrayOfStr[0].equals("set")) { ++ if (par2ArrayOfStr[1].equals("day")) { + var3 = 0; +- } else if(var2[1].equals("night")) { ++ } else if (par2ArrayOfStr[1].equals("night")) { + var3 = 12500; + } else { +- var3 = parseIntWithMin(var1, var2[1], 0); ++ var3 = parseIntWithMin(par1ICommandSender, par2ArrayOfStr[1], 0); + } + +- this.setTime(var1, var3); +- notifyAdmins(var1, "commands.time.set", new Object[]{Integer.valueOf(var3)}); ++ this.setTime(par1ICommandSender, var3); ++ notifyAdmins(par1ICommandSender, "commands.time.set", new Object[] {Integer.valueOf(var3)}); + return; + } + +- if(var2[0].equals("add")) { +- var3 = parseIntWithMin(var1, var2[1], 0); +- this.addTime(var1, var3); +- notifyAdmins(var1, "commands.time.added", new Object[]{Integer.valueOf(var3)}); ++ if (par2ArrayOfStr[0].equals("add")) { ++ var3 = parseIntWithMin(par1ICommandSender, par2ArrayOfStr[1], 0); ++ this.addTime(par1ICommandSender, var3); ++ notifyAdmins(par1ICommandSender, "commands.time.added", new Object[] {Integer.valueOf(var3)}); + return; + } + } +@@ -44,22 +48,29 @@ + throw new WrongUsageException("commands.time.usage", new Object[0]); + } + +- public List addTabCompletionOptions(ICommandSender var1, String[] var2) { +- return var2.length == 1 ? getListOfStringsMatchingLastWord(var2, new String[]{"set", "add"}) : (var2.length == 2 && var2[0].equals("set") ? getListOfStringsMatchingLastWord(var2, new String[]{"day", "night"}) : null); ++ /** ++ * Adds the strings available in this command to the given list of tab completion options. ++ */ ++ public List addTabCompletionOptions(ICommandSender par1ICommandSender, String[] par2ArrayOfStr) { ++ return par2ArrayOfStr.length == 1 ? getListOfStringsMatchingLastWord(par2ArrayOfStr, new String[] {"set", "add"}): (par2ArrayOfStr.length == 2 && par2ArrayOfStr[0].equals("set") ? getListOfStringsMatchingLastWord(par2ArrayOfStr, new String[] {"day", "night"}): null); + } + +- protected void setTime(ICommandSender var1, int var2) { +- for(int var3 = 0; var3 < MinecraftServer.getServer().worldServers.length; ++var3) { +- MinecraftServer.getServer().worldServers[var3].setWorldTime((long)var2); ++ /** ++ * Set the time in the server object. ++ */ ++ protected void setTime(ICommandSender par1ICommandSender, int par2) { ++ for (int var3 = 0; var3 < MinecraftServer.getServer().worldServers.length; ++var3) { ++ MinecraftServer.getServer().worldServers[var3].setWorldTime((long)par2); + } +- + } + +- protected void addTime(ICommandSender var1, int var2) { +- for(int var3 = 0; var3 < MinecraftServer.getServer().worldServers.length; ++var3) { ++ /** ++ * Adds (or removes) time in the server object. ++ */ ++ protected void addTime(ICommandSender par1ICommandSender, int par2) { ++ for (int var3 = 0; var3 < MinecraftServer.getServer().worldServers.length; ++var3) { + WorldServer var4 = MinecraftServer.getServer().worldServers[var3]; +- var4.setWorldTime(var4.getWorldTime() + (long)var2); ++ var4.setWorldTime(var4.getWorldTime() + (long)par2); + } +- + } + } diff --git a/patches/net/minecraft/src/CommandToggleDownfall.java.patch b/patches/net/minecraft/src/CommandToggleDownfall.java.patch new file mode 100644 index 0000000..273bfe8 --- /dev/null +++ b/patches/net/minecraft/src/CommandToggleDownfall.java.patch @@ -0,0 +1,34 @@ +--- net/minecraft/src/CommandToggleDownfall.java ++++ net/minecraft/src/CommandToggleDownfall.java +@@ -7,21 +7,27 @@ + return "toggledownfall"; + } + ++ /** ++ * Return the required permission level for this command. ++ */ + public int getRequiredPermissionLevel() { + return 2; + } + +- public String getCommandUsage(ICommandSender var1) { ++ public String getCommandUsage(ICommandSender par1ICommandSender) { + return "commands.downfall.usage"; + } + +- public void processCommand(ICommandSender var1, String[] var2) { ++ public void processCommand(ICommandSender par1ICommandSender, String[] par2ArrayOfStr) { + this.toggleDownfall(); +- notifyAdmins(var1, "commands.downfall.success", new Object[0]); ++ notifyAdmins(par1ICommandSender, "commands.downfall.success", new Object[0]); + } + ++ /** ++ * Toggle rain and enable thundering. ++ */ + protected void toggleDownfall() { +- MinecraftServer.getServer().worldServers[0].commandToggleDownfall(); ++ MinecraftServer.getServer().worldServers[0].toggleRain(); + MinecraftServer.getServer().worldServers[0].getWorldInfo().setThundering(true); + } + } diff --git a/patches/net/minecraft/src/CommandWeather.java.patch b/patches/net/minecraft/src/CommandWeather.java.patch new file mode 100644 index 0000000..e2396e8 --- /dev/null +++ b/patches/net/minecraft/src/CommandWeather.java.patch @@ -0,0 +1,73 @@ +--- net/minecraft/src/CommandWeather.java ++++ net/minecraft/src/CommandWeather.java +@@ -9,49 +9,56 @@ + return "weather"; + } + ++ /** ++ * Return the required permission level for this command. ++ */ + public int getRequiredPermissionLevel() { + return 2; + } + +- public String getCommandUsage(ICommandSender var1) { ++ public String getCommandUsage(ICommandSender par1ICommandSender) { + return "commands.weather.usage"; + } + +- public void processCommand(ICommandSender var1, String[] var2) { +- if(var2.length >= 1 && var2.length <= 2) { ++ public void processCommand(ICommandSender par1ICommandSender, String[] par2ArrayOfStr) { ++ if (par2ArrayOfStr.length >= 1 && par2ArrayOfStr.length <= 2) { + int var3 = (300 + (new Random()).nextInt(600)) * 20; +- if(var2.length >= 2) { +- var3 = parseIntBounded(var1, var2[1], 1, 1000000) * 20; ++ ++ if (par2ArrayOfStr.length >= 2) { ++ var3 = parseIntBounded(par1ICommandSender, par2ArrayOfStr[1], 1, 1000000) * 20; + } + + WorldServer var4 = MinecraftServer.getServer().worldServers[0]; + WorldInfo var5 = var4.getWorldInfo(); + var5.setRainTime(var3); + var5.setThunderTime(var3); +- if("clear".equalsIgnoreCase(var2[0])) { ++ ++ if ("clear".equalsIgnoreCase(par2ArrayOfStr[0])) { + var5.setRaining(false); + var5.setThundering(false); +- notifyAdmins(var1, "commands.weather.clear", new Object[0]); +- } else if("rain".equalsIgnoreCase(var2[0])) { ++ notifyAdmins(par1ICommandSender, "commands.weather.clear", new Object[0]); ++ } else if ("rain".equalsIgnoreCase(par2ArrayOfStr[0])) { + var5.setRaining(true); + var5.setThundering(false); +- notifyAdmins(var1, "commands.weather.rain", new Object[0]); ++ notifyAdmins(par1ICommandSender, "commands.weather.rain", new Object[0]); + } else { +- if(!"thunder".equalsIgnoreCase(var2[0])) { ++ if (!"thunder".equalsIgnoreCase(par2ArrayOfStr[0])) { + throw new WrongUsageException("commands.weather.usage", new Object[0]); + } + + var5.setRaining(true); + var5.setThundering(true); +- notifyAdmins(var1, "commands.weather.thunder", new Object[0]); ++ notifyAdmins(par1ICommandSender, "commands.weather.thunder", new Object[0]); + } +- + } else { + throw new WrongUsageException("commands.weather.usage", new Object[0]); + } + } + +- public List addTabCompletionOptions(ICommandSender var1, String[] var2) { +- return var2.length == 1 ? getListOfStringsMatchingLastWord(var2, new String[]{"clear", "rain", "thunder"}) : null; ++ /** ++ * Adds the strings available in this command to the given list of tab completion options. ++ */ ++ public List addTabCompletionOptions(ICommandSender par1ICommandSender, String[] par2ArrayOfStr) { ++ return par2ArrayOfStr.length == 1 ? getListOfStringsMatchingLastWord(par2ArrayOfStr, new String[] {"clear", "rain", "thunder"}): null; + } + } diff --git a/patches/net/minecraft/src/CommandXP.java.patch b/patches/net/minecraft/src/CommandXP.java.patch new file mode 100644 index 0000000..c76c200 --- /dev/null +++ b/patches/net/minecraft/src/CommandXP.java.patch @@ -0,0 +1,101 @@ +--- net/minecraft/src/CommandXP.java ++++ net/minecraft/src/CommandXP.java +@@ -8,66 +8,77 @@ + return "xp"; + } + ++ /** ++ * Return the required permission level for this command. ++ */ + public int getRequiredPermissionLevel() { + return 2; + } + +- public String getCommandUsage(ICommandSender var1) { ++ public String getCommandUsage(ICommandSender par1ICommandSender) { + return "commands.xp.usage"; + } + +- public void processCommand(ICommandSender var1, String[] var2) { +- if(var2.length <= 0) { ++ public void processCommand(ICommandSender par1ICommandSender, String[] par2ArrayOfStr) { ++ if (par2ArrayOfStr.length <= 0) { + throw new WrongUsageException("commands.xp.usage", new Object[0]); + } else { +- String var4 = var2[0]; ++ String var4 = par2ArrayOfStr[0]; + boolean var5 = var4.endsWith("l") || var4.endsWith("L"); +- if(var5 && var4.length() > 1) { ++ ++ if (var5 && var4.length() > 1) { + var4 = var4.substring(0, var4.length() - 1); + } + +- int var6 = parseInt(var1, var4); ++ int var6 = parseInt(par1ICommandSender, var4); + boolean var7 = var6 < 0; +- if(var7) { ++ ++ if (var7) { + var6 *= -1; + } + + EntityPlayerMP var3; +- if(var2.length > 1) { +- var3 = getPlayer(var1, var2[1]); ++ ++ if (par2ArrayOfStr.length > 1) { ++ var3 = getPlayer(par1ICommandSender, par2ArrayOfStr[1]); + } else { +- var3 = getCommandSenderAsPlayer(var1); ++ var3 = getCommandSenderAsPlayer(par1ICommandSender); + } + +- if(var5) { +- if(var7) { ++ if (var5) { ++ if (var7) { + var3.addExperienceLevel(-var6); +- notifyAdmins(var1, "commands.xp.success.negative.levels", new Object[]{Integer.valueOf(var6), var3.getEntityName()}); ++ notifyAdmins(par1ICommandSender, "commands.xp.success.negative.levels", new Object[] {Integer.valueOf(var6), var3.getEntityName()}); + } else { + var3.addExperienceLevel(var6); +- notifyAdmins(var1, "commands.xp.success.levels", new Object[]{Integer.valueOf(var6), var3.getEntityName()}); ++ notifyAdmins(par1ICommandSender, "commands.xp.success.levels", new Object[] {Integer.valueOf(var6), var3.getEntityName()}); + } + } else { +- if(var7) { ++ if (var7) { + throw new WrongUsageException("commands.xp.failure.widthdrawXp", new Object[0]); + } + + var3.addExperience(var6); +- notifyAdmins(var1, "commands.xp.success", new Object[]{Integer.valueOf(var6), var3.getEntityName()}); ++ notifyAdmins(par1ICommandSender, "commands.xp.success", new Object[] {Integer.valueOf(var6), var3.getEntityName()}); + } +- + } + } + +- public List addTabCompletionOptions(ICommandSender var1, String[] var2) { +- return var2.length == 2 ? getListOfStringsMatchingLastWord(var2, this.getAllUsernames()) : null; ++ /** ++ * Adds the strings available in this command to the given list of tab completion options. ++ */ ++ public List addTabCompletionOptions(ICommandSender par1ICommandSender, String[] par2ArrayOfStr) { ++ return par2ArrayOfStr.length == 2 ? getListOfStringsMatchingLastWord(par2ArrayOfStr, this.getAllUsernames()) : null; + } + + protected String[] getAllUsernames() { + return MinecraftServer.getServer().getAllUsernames(); + } + +- public boolean isUsernameIndex(String[] var1, int var2) { +- return var2 == 1; ++ /** ++ * Return whether the specified command parameter index is a username parameter. ++ */ ++ public boolean isUsernameIndex(String[] par1ArrayOfStr, int par2) { ++ return par2 == 1; + } + } diff --git a/patches/net/minecraft/src/ComparatorClassSorter.java.patch b/patches/net/minecraft/src/ComparatorClassSorter.java.patch new file mode 100644 index 0000000..4a40ae4 --- /dev/null +++ b/patches/net/minecraft/src/ComparatorClassSorter.java.patch @@ -0,0 +1,27 @@ +--- net/minecraft/src/ComparatorClassSorter.java ++++ net/minecraft/src/ComparatorClassSorter.java +@@ -5,17 +5,17 @@ + class ComparatorClassSorter implements Comparator { + final CallableSuspiciousClasses theSuspiciousClasses; + +- ComparatorClassSorter(CallableSuspiciousClasses var1) { +- this.theSuspiciousClasses = var1; ++ ComparatorClassSorter(CallableSuspiciousClasses par1CallableSuspiciousClasses) { ++ this.theSuspiciousClasses = par1CallableSuspiciousClasses; + } + +- public int func_85081_a(Class var1, Class var2) { +- String var3 = var1.getPackage() == null ? "" : var1.getPackage().getName(); +- String var4 = var2.getPackage() == null ? "" : var2.getPackage().getName(); ++ public int func_85081_a(Class par1Class, Class par2Class) { ++ String var3 = par1Class.getPackage() == null ? "" : par1Class.getPackage().getName(); ++ String var4 = par2Class.getPackage() == null ? "" : par2Class.getPackage().getName(); + return var3.compareTo(var4); + } + +- public int compare(Object var1, Object var2) { +- return this.func_85081_a((Class)var1, (Class)var2); ++ public int compare(Object par1Obj, Object par2Obj) { ++ return this.func_85081_a((Class)par1Obj, (Class)par2Obj); + } + } diff --git a/patches/net/minecraft/src/ComponentMineshaftCorridor.java.patch b/patches/net/minecraft/src/ComponentMineshaftCorridor.java.patch new file mode 100644 index 0000000..7478933 --- /dev/null +++ b/patches/net/minecraft/src/ComponentMineshaftCorridor.java.patch @@ -0,0 +1,432 @@ +--- net/minecraft/src/ComponentMineshaftCorridor.java ++++ net/minecraft/src/ComponentMineshaftCorridor.java +@@ -7,155 +7,182 @@ + private boolean hasRails; + private boolean hasSpiders; + private boolean spawnerPlaced; ++ ++ /** ++ * A count of the different sections of this mine. The space between ceiling supports. ++ */ + private int sectionCount; + +- public ComponentMineshaftCorridor() { +- } +- +- protected void func_143012_a(NBTTagCompound var1) { +- var1.setBoolean("hr", this.hasRails); +- var1.setBoolean("sc", this.hasSpiders); +- var1.setBoolean("hps", this.spawnerPlaced); +- var1.setInteger("Num", this.sectionCount); +- } +- +- protected void func_143011_b(NBTTagCompound var1) { +- this.hasRails = var1.getBoolean("hr"); +- this.hasSpiders = var1.getBoolean("sc"); +- this.spawnerPlaced = var1.getBoolean("hps"); +- this.sectionCount = var1.getInteger("Num"); +- } +- +- public ComponentMineshaftCorridor(int var1, Random var2, StructureBoundingBox var3, int var4) { +- super(var1); +- this.coordBaseMode = var4; +- this.boundingBox = var3; +- this.hasRails = var2.nextInt(3) == 0; +- this.hasSpiders = !this.hasRails && var2.nextInt(23) == 0; +- if(this.coordBaseMode != 2 && this.coordBaseMode != 0) { +- this.sectionCount = var3.getXSize() / 5; ++ public ComponentMineshaftCorridor() {} ++ ++ protected void func_143012_a(NBTTagCompound par1NBTTagCompound) { ++ par1NBTTagCompound.setBoolean("hr", this.hasRails); ++ par1NBTTagCompound.setBoolean("sc", this.hasSpiders); ++ par1NBTTagCompound.setBoolean("hps", this.spawnerPlaced); ++ par1NBTTagCompound.setInteger("Num", this.sectionCount); ++ } ++ ++ protected void func_143011_b(NBTTagCompound par1NBTTagCompound) { ++ this.hasRails = par1NBTTagCompound.getBoolean("hr"); ++ this.hasSpiders = par1NBTTagCompound.getBoolean("sc"); ++ this.spawnerPlaced = par1NBTTagCompound.getBoolean("hps"); ++ this.sectionCount = par1NBTTagCompound.getInteger("Num"); ++ } ++ ++ public ComponentMineshaftCorridor(int par1, Random par2Random, StructureBoundingBox par3StructureBoundingBox, int par4) { ++ super(par1); ++ this.coordBaseMode = par4; ++ this.boundingBox = par3StructureBoundingBox; ++ this.hasRails = par2Random.nextInt(3) == 0; ++ this.hasSpiders = !this.hasRails && par2Random.nextInt(23) == 0; ++ ++ if (this.coordBaseMode != 2 && this.coordBaseMode != 0) { ++ this.sectionCount = par3StructureBoundingBox.getXSize() / 5; + } else { +- this.sectionCount = var3.getZSize() / 5; ++ this.sectionCount = par3StructureBoundingBox.getZSize() / 5; + } +- + } + +- public static StructureBoundingBox findValidPlacement(List var0, Random var1, int var2, int var3, int var4, int var5) { +- StructureBoundingBox var6 = new StructureBoundingBox(var2, var3, var4, var2, var3 + 2, var4); +- ++ public static StructureBoundingBox findValidPlacement(List par0List, Random par1Random, int par2, int par3, int par4, int par5) { ++ StructureBoundingBox var6 = new StructureBoundingBox(par2, par3, par4, par2, par3 + 2, par4); + int var7; +- for(var7 = var1.nextInt(3) + 2; var7 > 0; --var7) { ++ ++ for (var7 = par1Random.nextInt(3) + 2; var7 > 0; --var7) { + int var8 = var7 * 5; +- switch(var5) { ++ ++ switch (par5) { ++ case 0: ++ var6.maxX = par2 + 2; ++ var6.maxZ = par4 + (var8 - 1); ++ break; ++ ++ case 1: ++ var6.minX = par2 - (var8 - 1); ++ var6.maxZ = par4 + 2; ++ break; ++ ++ case 2: ++ var6.maxX = par2 + 2; ++ var6.minZ = par4 - (var8 - 1); ++ break; ++ ++ case 3: ++ var6.maxX = par2 + (var8 - 1); ++ var6.maxZ = par4 + 2; ++ } ++ ++ if (StructureComponent.findIntersecting(par0List, var6) == null) { ++ break; ++ } ++ } ++ ++ return var7 > 0 ? var6 : null; ++ } ++ ++ /** ++ * Initiates construction of the Structure Component picked, at the current Location of StructGen ++ */ ++ public void buildComponent(StructureComponent par1StructureComponent, List par2List, Random par3Random) { ++ int var4 = this.getComponentType(); ++ int var5 = par3Random.nextInt(4); ++ ++ switch (this.coordBaseMode) { + case 0: +- var6.maxX = var2 + 2; +- var6.maxZ = var4 + (var8 - 1); ++ if (var5 <= 1) { ++ StructureMineshaftPieces.getNextComponent(par1StructureComponent, par2List, par3Random, this.boundingBox.minX, this.boundingBox.minY - 1 + par3Random.nextInt(3), this.boundingBox.maxZ + 1, this.coordBaseMode, var4); ++ } else if (var5 == 2) { ++ StructureMineshaftPieces.getNextComponent(par1StructureComponent, par2List, par3Random, this.boundingBox.minX - 1, this.boundingBox.minY - 1 + par3Random.nextInt(3), this.boundingBox.maxZ - 3, 1, var4); ++ } else { ++ StructureMineshaftPieces.getNextComponent(par1StructureComponent, par2List, par3Random, this.boundingBox.maxX + 1, this.boundingBox.minY - 1 + par3Random.nextInt(3), this.boundingBox.maxZ - 3, 3, var4); ++ } ++ + break; ++ + case 1: +- var6.minX = var2 - (var8 - 1); +- var6.maxZ = var4 + 2; ++ if (var5 <= 1) { ++ StructureMineshaftPieces.getNextComponent(par1StructureComponent, par2List, par3Random, this.boundingBox.minX - 1, this.boundingBox.minY - 1 + par3Random.nextInt(3), this.boundingBox.minZ, this.coordBaseMode, var4); ++ } else if (var5 == 2) { ++ StructureMineshaftPieces.getNextComponent(par1StructureComponent, par2List, par3Random, this.boundingBox.minX, this.boundingBox.minY - 1 + par3Random.nextInt(3), this.boundingBox.minZ - 1, 2, var4); ++ } else { ++ StructureMineshaftPieces.getNextComponent(par1StructureComponent, par2List, par3Random, this.boundingBox.minX, this.boundingBox.minY - 1 + par3Random.nextInt(3), this.boundingBox.maxZ + 1, 0, var4); ++ } ++ + break; ++ + case 2: +- var6.maxX = var2 + 2; +- var6.minZ = var4 - (var8 - 1); ++ if (var5 <= 1) { ++ StructureMineshaftPieces.getNextComponent(par1StructureComponent, par2List, par3Random, this.boundingBox.minX, this.boundingBox.minY - 1 + par3Random.nextInt(3), this.boundingBox.minZ - 1, this.coordBaseMode, var4); ++ } else if (var5 == 2) { ++ StructureMineshaftPieces.getNextComponent(par1StructureComponent, par2List, par3Random, this.boundingBox.minX - 1, this.boundingBox.minY - 1 + par3Random.nextInt(3), this.boundingBox.minZ, 1, var4); ++ } else { ++ StructureMineshaftPieces.getNextComponent(par1StructureComponent, par2List, par3Random, this.boundingBox.maxX + 1, this.boundingBox.minY - 1 + par3Random.nextInt(3), this.boundingBox.minZ, 3, var4); ++ } ++ + break; ++ + case 3: +- var6.maxX = var2 + (var8 - 1); +- var6.maxZ = var4 + 2; +- } +- +- if(StructureComponent.findIntersecting(var0, var6) == null) { +- break; +- } +- } +- +- return var7 > 0 ? var6 : null; +- } +- +- public void buildComponent(StructureComponent var1, List var2, Random var3) { +- int var4 = this.getComponentType(); +- int var5 = var3.nextInt(4); +- switch(this.coordBaseMode) { +- case 0: +- if(var5 <= 1) { +- StructureMineshaftPieces.getNextComponent(var1, var2, var3, this.boundingBox.minX, this.boundingBox.minY - 1 + var3.nextInt(3), this.boundingBox.maxZ + 1, this.coordBaseMode, var4); +- } else if(var5 == 2) { +- StructureMineshaftPieces.getNextComponent(var1, var2, var3, this.boundingBox.minX - 1, this.boundingBox.minY - 1 + var3.nextInt(3), this.boundingBox.maxZ - 3, 1, var4); +- } else { +- StructureMineshaftPieces.getNextComponent(var1, var2, var3, this.boundingBox.maxX + 1, this.boundingBox.minY - 1 + var3.nextInt(3), this.boundingBox.maxZ - 3, 3, var4); +- } +- break; +- case 1: +- if(var5 <= 1) { +- StructureMineshaftPieces.getNextComponent(var1, var2, var3, this.boundingBox.minX - 1, this.boundingBox.minY - 1 + var3.nextInt(3), this.boundingBox.minZ, this.coordBaseMode, var4); +- } else if(var5 == 2) { +- StructureMineshaftPieces.getNextComponent(var1, var2, var3, this.boundingBox.minX, this.boundingBox.minY - 1 + var3.nextInt(3), this.boundingBox.minZ - 1, 2, var4); +- } else { +- StructureMineshaftPieces.getNextComponent(var1, var2, var3, this.boundingBox.minX, this.boundingBox.minY - 1 + var3.nextInt(3), this.boundingBox.maxZ + 1, 0, var4); +- } +- break; +- case 2: +- if(var5 <= 1) { +- StructureMineshaftPieces.getNextComponent(var1, var2, var3, this.boundingBox.minX, this.boundingBox.minY - 1 + var3.nextInt(3), this.boundingBox.minZ - 1, this.coordBaseMode, var4); +- } else if(var5 == 2) { +- StructureMineshaftPieces.getNextComponent(var1, var2, var3, this.boundingBox.minX - 1, this.boundingBox.minY - 1 + var3.nextInt(3), this.boundingBox.minZ, 1, var4); +- } else { +- StructureMineshaftPieces.getNextComponent(var1, var2, var3, this.boundingBox.maxX + 1, this.boundingBox.minY - 1 + var3.nextInt(3), this.boundingBox.minZ, 3, var4); +- } +- break; +- case 3: +- if(var5 <= 1) { +- StructureMineshaftPieces.getNextComponent(var1, var2, var3, this.boundingBox.maxX + 1, this.boundingBox.minY - 1 + var3.nextInt(3), this.boundingBox.minZ, this.coordBaseMode, var4); +- } else if(var5 == 2) { +- StructureMineshaftPieces.getNextComponent(var1, var2, var3, this.boundingBox.maxX - 3, this.boundingBox.minY - 1 + var3.nextInt(3), this.boundingBox.minZ - 1, 2, var4); +- } else { +- StructureMineshaftPieces.getNextComponent(var1, var2, var3, this.boundingBox.maxX - 3, this.boundingBox.minY - 1 + var3.nextInt(3), this.boundingBox.maxZ + 1, 0, var4); +- } +- } +- +- if(var4 < 8) { ++ if (var5 <= 1) { ++ StructureMineshaftPieces.getNextComponent(par1StructureComponent, par2List, par3Random, this.boundingBox.maxX + 1, this.boundingBox.minY - 1 + par3Random.nextInt(3), this.boundingBox.minZ, this.coordBaseMode, var4); ++ } else if (var5 == 2) { ++ StructureMineshaftPieces.getNextComponent(par1StructureComponent, par2List, par3Random, this.boundingBox.maxX - 3, this.boundingBox.minY - 1 + par3Random.nextInt(3), this.boundingBox.minZ - 1, 2, var4); ++ } else { ++ StructureMineshaftPieces.getNextComponent(par1StructureComponent, par2List, par3Random, this.boundingBox.maxX - 3, this.boundingBox.minY - 1 + par3Random.nextInt(3), this.boundingBox.maxZ + 1, 0, var4); ++ } ++ } ++ ++ if (var4 < 8) { + int var6; + int var7; +- if(this.coordBaseMode != 2 && this.coordBaseMode != 0) { +- for(var6 = this.boundingBox.minX + 3; var6 + 3 <= this.boundingBox.maxX; var6 += 5) { +- var7 = var3.nextInt(5); +- if(var7 == 0) { +- StructureMineshaftPieces.getNextComponent(var1, var2, var3, var6, this.boundingBox.minY, this.boundingBox.minZ - 1, 2, var4 + 1); +- } else if(var7 == 1) { +- StructureMineshaftPieces.getNextComponent(var1, var2, var3, var6, this.boundingBox.minY, this.boundingBox.maxZ + 1, 0, var4 + 1); ++ ++ if (this.coordBaseMode != 2 && this.coordBaseMode != 0) { ++ for (var6 = this.boundingBox.minX + 3; var6 + 3 <= this.boundingBox.maxX; var6 += 5) { ++ var7 = par3Random.nextInt(5); ++ ++ if (var7 == 0) { ++ StructureMineshaftPieces.getNextComponent(par1StructureComponent, par2List, par3Random, var6, this.boundingBox.minY, this.boundingBox.minZ - 1, 2, var4 + 1); ++ } else if (var7 == 1) { ++ StructureMineshaftPieces.getNextComponent(par1StructureComponent, par2List, par3Random, var6, this.boundingBox.minY, this.boundingBox.maxZ + 1, 0, var4 + 1); + } + } + } else { +- for(var6 = this.boundingBox.minZ + 3; var6 + 3 <= this.boundingBox.maxZ; var6 += 5) { +- var7 = var3.nextInt(5); +- if(var7 == 0) { +- StructureMineshaftPieces.getNextComponent(var1, var2, var3, this.boundingBox.minX - 1, this.boundingBox.minY, var6, 1, var4 + 1); +- } else if(var7 == 1) { +- StructureMineshaftPieces.getNextComponent(var1, var2, var3, this.boundingBox.maxX + 1, this.boundingBox.minY, var6, 3, var4 + 1); ++ for (var6 = this.boundingBox.minZ + 3; var6 + 3 <= this.boundingBox.maxZ; var6 += 5) { ++ var7 = par3Random.nextInt(5); ++ ++ if (var7 == 0) { ++ StructureMineshaftPieces.getNextComponent(par1StructureComponent, par2List, par3Random, this.boundingBox.minX - 1, this.boundingBox.minY, var6, 1, var4 + 1); ++ } else if (var7 == 1) { ++ StructureMineshaftPieces.getNextComponent(par1StructureComponent, par2List, par3Random, this.boundingBox.maxX + 1, this.boundingBox.minY, var6, 3, var4 + 1); + } + } + } + } +- + } + +- protected boolean generateStructureChestContents(World var1, StructureBoundingBox var2, Random var3, int var4, int var5, int var6, WeightedRandomChestContent[] var7, int var8) { +- int var9 = this.getXWithOffset(var4, var6); +- int var10 = this.getYWithOffset(var5); +- int var11 = this.getZWithOffset(var4, var6); +- if(var2.isVecInside(var9, var10, var11) && var1.getBlockId(var9, var10, var11) == 0) { +- var1.setBlock(var9, var10, var11, Block.rail.blockID, this.getMetadataWithOffset(Block.rail.blockID, var3.nextBoolean() ? 1 : 0), 2); +- EntityMinecartChest var12 = new EntityMinecartChest(var1, (double)((float)var9 + 0.5F), (double)((float)var10 + 0.5F), (double)((float)var11 + 0.5F)); +- WeightedRandomChestContent.generateChestContents(var3, var7, var12, var8); +- var1.spawnEntityInWorld(var12); ++ /** ++ * Used to generate chests with items in it. ex: Temple Chests, Village Blacksmith Chests, Mineshaft Chests. ++ */ ++ protected boolean generateStructureChestContents(World par1World, StructureBoundingBox par2StructureBoundingBox, Random par3Random, int par4, int par5, int par6, WeightedRandomChestContent[] par7ArrayOfWeightedRandomChestContent, int par8) { ++ int var9 = this.getXWithOffset(par4, par6); ++ int var10 = this.getYWithOffset(par5); ++ int var11 = this.getZWithOffset(par4, par6); ++ ++ if (par2StructureBoundingBox.isVecInside(var9, var10, var11) && par1World.getBlockId(var9, var10, var11) == 0) { ++ par1World.setBlock(var9, var10, var11, Block.rail.blockID, this.getMetadataWithOffset(Block.rail.blockID, par3Random.nextBoolean() ? 1 : 0), 2); ++ EntityMinecartChest var12 = new EntityMinecartChest(par1World, (double)((float)var9 + 0.5F), (double)((float)var10 + 0.5F), (double)((float)var11 + 0.5F)); ++ WeightedRandomChestContent.generateChestContents(par3Random, par7ArrayOfWeightedRandomChestContent, var12, par8); ++ par1World.spawnEntityInWorld(var12); + return true; + } else { + return false; + } + } + +- public boolean addComponentParts(World var1, Random var2, StructureBoundingBox var3) { +- if(this.isLiquidInStructureBoundingBox(var1, var3)) { ++ /** ++ * second Part of Structure generating, this for example places Spiderwebs, Mob Spawners, it closes Mineshafts at the ++ * end, it adds Fences... ++ */ ++ public boolean addComponentParts(World par1World, Random par2Random, StructureBoundingBox par3StructureBoundingBox) { ++ if (this.isLiquidInStructureBoundingBox(par1World, par3StructureBoundingBox)) { + return false; + } else { + boolean var4 = false; +@@ -163,74 +190,82 @@ + boolean var6 = false; + boolean var7 = true; + int var8 = this.sectionCount * 5 - 1; +- this.fillWithBlocks(var1, var3, 0, 0, 0, 2, 1, var8, 0, 0, false); +- this.randomlyFillWithBlocks(var1, var3, var2, 0.8F, 0, 2, 0, 2, 2, var8, 0, 0, false); +- if(this.hasSpiders) { +- this.randomlyFillWithBlocks(var1, var3, var2, 0.6F, 0, 0, 0, 2, 1, var8, Block.web.blockID, 0, false); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 0, 0, 0, 2, 1, var8, 0, 0, false); ++ this.randomlyFillWithBlocks(par1World, par3StructureBoundingBox, par2Random, 0.8F, 0, 2, 0, 2, 2, var8, 0, 0, false); ++ ++ if (this.hasSpiders) { ++ this.randomlyFillWithBlocks(par1World, par3StructureBoundingBox, par2Random, 0.6F, 0, 0, 0, 2, 1, var8, Block.web.blockID, 0, false); + } + + int var9; + int var10; + int var11; +- for(var9 = 0; var9 < this.sectionCount; ++var9) { ++ ++ for (var9 = 0; var9 < this.sectionCount; ++var9) { + var10 = 2 + var9 * 5; +- this.fillWithBlocks(var1, var3, 0, 0, var10, 0, 1, var10, Block.fence.blockID, 0, false); +- this.fillWithBlocks(var1, var3, 2, 0, var10, 2, 1, var10, Block.fence.blockID, 0, false); +- if(var2.nextInt(4) == 0) { +- this.fillWithBlocks(var1, var3, 0, 2, var10, 0, 2, var10, Block.planks.blockID, 0, false); +- this.fillWithBlocks(var1, var3, 2, 2, var10, 2, 2, var10, Block.planks.blockID, 0, false); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 0, 0, var10, 0, 1, var10, Block.fence.blockID, 0, false); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 2, 0, var10, 2, 1, var10, Block.fence.blockID, 0, false); ++ ++ if (par2Random.nextInt(4) == 0) { ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 0, 2, var10, 0, 2, var10, Block.planks.blockID, 0, false); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 2, 2, var10, 2, 2, var10, Block.planks.blockID, 0, false); + } else { +- this.fillWithBlocks(var1, var3, 0, 2, var10, 2, 2, var10, Block.planks.blockID, 0, false); +- } +- +- this.randomlyPlaceBlock(var1, var3, var2, 0.1F, 0, 2, var10 - 1, Block.web.blockID, 0); +- this.randomlyPlaceBlock(var1, var3, var2, 0.1F, 2, 2, var10 - 1, Block.web.blockID, 0); +- this.randomlyPlaceBlock(var1, var3, var2, 0.1F, 0, 2, var10 + 1, Block.web.blockID, 0); +- this.randomlyPlaceBlock(var1, var3, var2, 0.1F, 2, 2, var10 + 1, Block.web.blockID, 0); +- this.randomlyPlaceBlock(var1, var3, var2, 0.05F, 0, 2, var10 - 2, Block.web.blockID, 0); +- this.randomlyPlaceBlock(var1, var3, var2, 0.05F, 2, 2, var10 - 2, Block.web.blockID, 0); +- this.randomlyPlaceBlock(var1, var3, var2, 0.05F, 0, 2, var10 + 2, Block.web.blockID, 0); +- this.randomlyPlaceBlock(var1, var3, var2, 0.05F, 2, 2, var10 + 2, Block.web.blockID, 0); +- this.randomlyPlaceBlock(var1, var3, var2, 0.05F, 1, 2, var10 - 1, Block.torchWood.blockID, 0); +- this.randomlyPlaceBlock(var1, var3, var2, 0.05F, 1, 2, var10 + 1, Block.torchWood.blockID, 0); +- if(var2.nextInt(100) == 0) { +- this.generateStructureChestContents(var1, var3, var2, 2, 0, var10 - 1, WeightedRandomChestContent.func_92080_a(StructureMineshaftPieces.func_78816_a(), new WeightedRandomChestContent[]{Item.enchantedBook.func_92114_b(var2)}), 3 + var2.nextInt(4)); +- } +- +- if(var2.nextInt(100) == 0) { +- this.generateStructureChestContents(var1, var3, var2, 0, 0, var10 + 1, WeightedRandomChestContent.func_92080_a(StructureMineshaftPieces.func_78816_a(), new WeightedRandomChestContent[]{Item.enchantedBook.func_92114_b(var2)}), 3 + var2.nextInt(4)); +- } +- +- if(this.hasSpiders && !this.spawnerPlaced) { ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 0, 2, var10, 2, 2, var10, Block.planks.blockID, 0, false); ++ } ++ ++ this.randomlyPlaceBlock(par1World, par3StructureBoundingBox, par2Random, 0.1F, 0, 2, var10 - 1, Block.web.blockID, 0); ++ this.randomlyPlaceBlock(par1World, par3StructureBoundingBox, par2Random, 0.1F, 2, 2, var10 - 1, Block.web.blockID, 0); ++ this.randomlyPlaceBlock(par1World, par3StructureBoundingBox, par2Random, 0.1F, 0, 2, var10 + 1, Block.web.blockID, 0); ++ this.randomlyPlaceBlock(par1World, par3StructureBoundingBox, par2Random, 0.1F, 2, 2, var10 + 1, Block.web.blockID, 0); ++ this.randomlyPlaceBlock(par1World, par3StructureBoundingBox, par2Random, 0.05F, 0, 2, var10 - 2, Block.web.blockID, 0); ++ this.randomlyPlaceBlock(par1World, par3StructureBoundingBox, par2Random, 0.05F, 2, 2, var10 - 2, Block.web.blockID, 0); ++ this.randomlyPlaceBlock(par1World, par3StructureBoundingBox, par2Random, 0.05F, 0, 2, var10 + 2, Block.web.blockID, 0); ++ this.randomlyPlaceBlock(par1World, par3StructureBoundingBox, par2Random, 0.05F, 2, 2, var10 + 2, Block.web.blockID, 0); ++ this.randomlyPlaceBlock(par1World, par3StructureBoundingBox, par2Random, 0.05F, 1, 2, var10 - 1, Block.torchWood.blockID, 0); ++ this.randomlyPlaceBlock(par1World, par3StructureBoundingBox, par2Random, 0.05F, 1, 2, var10 + 1, Block.torchWood.blockID, 0); ++ ++ if (par2Random.nextInt(100) == 0) { ++ this.generateStructureChestContents(par1World, par3StructureBoundingBox, par2Random, 2, 0, var10 - 1, WeightedRandomChestContent.func_92080_a(StructureMineshaftPieces.func_78816_a(), new WeightedRandomChestContent[] {Item.enchantedBook.func_92114_b(par2Random)}), 3 + par2Random.nextInt(4)); ++ } ++ ++ if (par2Random.nextInt(100) == 0) { ++ this.generateStructureChestContents(par1World, par3StructureBoundingBox, par2Random, 0, 0, var10 + 1, WeightedRandomChestContent.func_92080_a(StructureMineshaftPieces.func_78816_a(), new WeightedRandomChestContent[] {Item.enchantedBook.func_92114_b(par2Random)}), 3 + par2Random.nextInt(4)); ++ } ++ ++ if (this.hasSpiders && !this.spawnerPlaced) { + var11 = this.getYWithOffset(0); +- int var12 = var10 - 1 + var2.nextInt(3); ++ int var12 = var10 - 1 + par2Random.nextInt(3); + int var13 = this.getXWithOffset(1, var12); + var12 = this.getZWithOffset(1, var12); +- if(var3.isVecInside(var13, var11, var12)) { ++ ++ if (par3StructureBoundingBox.isVecInside(var13, var11, var12)) { + this.spawnerPlaced = true; +- var1.setBlock(var13, var11, var12, Block.mobSpawner.blockID, 0, 2); +- TileEntityMobSpawner var14 = (TileEntityMobSpawner)var1.getBlockTileEntity(var13, var11, var12); +- if(var14 != null) { ++ par1World.setBlock(var13, var11, var12, Block.mobSpawner.blockID, 0, 2); ++ TileEntityMobSpawner var14 = (TileEntityMobSpawner)par1World.getBlockTileEntity(var13, var11, var12); ++ ++ if (var14 != null) { + var14.getSpawnerLogic().setMobID("CaveSpider"); + } + } + } + } + +- for(var9 = 0; var9 <= 2; ++var9) { +- for(var10 = 0; var10 <= var8; ++var10) { +- var11 = this.getBlockIdAtCurrentPosition(var1, var9, -1, var10, var3); +- if(var11 == 0) { +- this.placeBlockAtCurrentPosition(var1, Block.planks.blockID, 0, var9, -1, var10, var3); ++ for (var9 = 0; var9 <= 2; ++var9) { ++ for (var10 = 0; var10 <= var8; ++var10) { ++ var11 = this.getBlockIdAtCurrentPosition(par1World, var9, -1, var10, par3StructureBoundingBox); ++ ++ if (var11 == 0) { ++ this.placeBlockAtCurrentPosition(par1World, Block.planks.blockID, 0, var9, -1, var10, par3StructureBoundingBox); + } + } + } + +- if(this.hasRails) { +- for(var9 = 0; var9 <= var8; ++var9) { +- var10 = this.getBlockIdAtCurrentPosition(var1, 1, -1, var9, var3); +- if(var10 > 0 && Block.opaqueCubeLookup[var10]) { +- this.randomlyPlaceBlock(var1, var3, var2, 0.7F, 1, 0, var9, Block.rail.blockID, this.getMetadataWithOffset(Block.rail.blockID, 0)); ++ if (this.hasRails) { ++ for (var9 = 0; var9 <= var8; ++var9) { ++ var10 = this.getBlockIdAtCurrentPosition(par1World, 1, -1, var9, par3StructureBoundingBox); ++ ++ if (var10 > 0 && Block.opaqueCubeLookup[var10]) { ++ this.randomlyPlaceBlock(par1World, par3StructureBoundingBox, par2Random, 0.7F, 1, 0, var9, Block.rail.blockID, this.getMetadataWithOffset(Block.rail.blockID, 0)); + } + } + } diff --git a/patches/net/minecraft/src/ComponentMineshaftCross.java.patch b/patches/net/minecraft/src/ComponentMineshaftCross.java.patch new file mode 100644 index 0000000..10a412c --- /dev/null +++ b/patches/net/minecraft/src/ComponentMineshaftCross.java.patch @@ -0,0 +1,248 @@ +--- net/minecraft/src/ComponentMineshaftCross.java ++++ net/minecraft/src/ComponentMineshaftCross.java +@@ -7,126 +7,140 @@ + private int corridorDirection; + private boolean isMultipleFloors; + +- public ComponentMineshaftCross() { +- } +- +- protected void func_143012_a(NBTTagCompound var1) { +- var1.setBoolean("tf", this.isMultipleFloors); +- var1.setInteger("D", this.corridorDirection); +- } +- +- protected void func_143011_b(NBTTagCompound var1) { +- this.isMultipleFloors = var1.getBoolean("tf"); +- this.corridorDirection = var1.getInteger("D"); +- } +- +- public ComponentMineshaftCross(int var1, Random var2, StructureBoundingBox var3, int var4) { +- super(var1); +- this.corridorDirection = var4; +- this.boundingBox = var3; +- this.isMultipleFloors = var3.getYSize() > 3; +- } +- +- public static StructureBoundingBox findValidPlacement(List var0, Random var1, int var2, int var3, int var4, int var5) { +- StructureBoundingBox var6 = new StructureBoundingBox(var2, var3, var4, var2, var3 + 2, var4); +- if(var1.nextInt(4) == 0) { ++ public ComponentMineshaftCross() {} ++ ++ protected void func_143012_a(NBTTagCompound par1NBTTagCompound) { ++ par1NBTTagCompound.setBoolean("tf", this.isMultipleFloors); ++ par1NBTTagCompound.setInteger("D", this.corridorDirection); ++ } ++ ++ protected void func_143011_b(NBTTagCompound par1NBTTagCompound) { ++ this.isMultipleFloors = par1NBTTagCompound.getBoolean("tf"); ++ this.corridorDirection = par1NBTTagCompound.getInteger("D"); ++ } ++ ++ public ComponentMineshaftCross(int par1, Random par2Random, StructureBoundingBox par3StructureBoundingBox, int par4) { ++ super(par1); ++ this.corridorDirection = par4; ++ this.boundingBox = par3StructureBoundingBox; ++ this.isMultipleFloors = par3StructureBoundingBox.getYSize() > 3; ++ } ++ ++ public static StructureBoundingBox findValidPlacement(List par0List, Random par1Random, int par2, int par3, int par4, int par5) { ++ StructureBoundingBox var6 = new StructureBoundingBox(par2, par3, par4, par2, par3 + 2, par4); ++ ++ if (par1Random.nextInt(4) == 0) { + var6.maxY += 4; + } + +- switch(var5) { +- case 0: +- var6.minX = var2 - 1; +- var6.maxX = var2 + 3; +- var6.maxZ = var4 + 4; +- break; +- case 1: +- var6.minX = var2 - 4; +- var6.minZ = var4 - 1; +- var6.maxZ = var4 + 3; +- break; +- case 2: +- var6.minX = var2 - 1; +- var6.maxX = var2 + 3; +- var6.minZ = var4 - 4; +- break; +- case 3: +- var6.maxX = var2 + 4; +- var6.minZ = var4 - 1; +- var6.maxZ = var4 + 3; ++ switch (par5) { ++ case 0: ++ var6.minX = par2 - 1; ++ var6.maxX = par2 + 3; ++ var6.maxZ = par4 + 4; ++ break; ++ ++ case 1: ++ var6.minX = par2 - 4; ++ var6.minZ = par4 - 1; ++ var6.maxZ = par4 + 3; ++ break; ++ ++ case 2: ++ var6.minX = par2 - 1; ++ var6.maxX = par2 + 3; ++ var6.minZ = par4 - 4; ++ break; ++ ++ case 3: ++ var6.maxX = par2 + 4; ++ var6.minZ = par4 - 1; ++ var6.maxZ = par4 + 3; + } + +- return StructureComponent.findIntersecting(var0, var6) != null ? null : var6; ++ return StructureComponent.findIntersecting(par0List, var6) != null ? null : var6; + } + +- public void buildComponent(StructureComponent var1, List var2, Random var3) { ++ /** ++ * Initiates construction of the Structure Component picked, at the current Location of StructGen ++ */ ++ public void buildComponent(StructureComponent par1StructureComponent, List par2List, Random par3Random) { + int var4 = this.getComponentType(); +- switch(this.corridorDirection) { +- case 0: +- StructureMineshaftPieces.getNextComponent(var1, var2, var3, this.boundingBox.minX + 1, this.boundingBox.minY, this.boundingBox.maxZ + 1, 0, var4); +- StructureMineshaftPieces.getNextComponent(var1, var2, var3, this.boundingBox.minX - 1, this.boundingBox.minY, this.boundingBox.minZ + 1, 1, var4); +- StructureMineshaftPieces.getNextComponent(var1, var2, var3, this.boundingBox.maxX + 1, this.boundingBox.minY, this.boundingBox.minZ + 1, 3, var4); +- break; +- case 1: +- StructureMineshaftPieces.getNextComponent(var1, var2, var3, this.boundingBox.minX + 1, this.boundingBox.minY, this.boundingBox.minZ - 1, 2, var4); +- StructureMineshaftPieces.getNextComponent(var1, var2, var3, this.boundingBox.minX + 1, this.boundingBox.minY, this.boundingBox.maxZ + 1, 0, var4); +- StructureMineshaftPieces.getNextComponent(var1, var2, var3, this.boundingBox.minX - 1, this.boundingBox.minY, this.boundingBox.minZ + 1, 1, var4); +- break; +- case 2: +- StructureMineshaftPieces.getNextComponent(var1, var2, var3, this.boundingBox.minX + 1, this.boundingBox.minY, this.boundingBox.minZ - 1, 2, var4); +- StructureMineshaftPieces.getNextComponent(var1, var2, var3, this.boundingBox.minX - 1, this.boundingBox.minY, this.boundingBox.minZ + 1, 1, var4); +- StructureMineshaftPieces.getNextComponent(var1, var2, var3, this.boundingBox.maxX + 1, this.boundingBox.minY, this.boundingBox.minZ + 1, 3, var4); +- break; +- case 3: +- StructureMineshaftPieces.getNextComponent(var1, var2, var3, this.boundingBox.minX + 1, this.boundingBox.minY, this.boundingBox.minZ - 1, 2, var4); +- StructureMineshaftPieces.getNextComponent(var1, var2, var3, this.boundingBox.minX + 1, this.boundingBox.minY, this.boundingBox.maxZ + 1, 0, var4); +- StructureMineshaftPieces.getNextComponent(var1, var2, var3, this.boundingBox.maxX + 1, this.boundingBox.minY, this.boundingBox.minZ + 1, 3, var4); +- } +- +- if(this.isMultipleFloors) { +- if(var3.nextBoolean()) { +- StructureMineshaftPieces.getNextComponent(var1, var2, var3, this.boundingBox.minX + 1, this.boundingBox.minY + 3 + 1, this.boundingBox.minZ - 1, 2, var4); +- } +- +- if(var3.nextBoolean()) { +- StructureMineshaftPieces.getNextComponent(var1, var2, var3, this.boundingBox.minX - 1, this.boundingBox.minY + 3 + 1, this.boundingBox.minZ + 1, 1, var4); +- } +- +- if(var3.nextBoolean()) { +- StructureMineshaftPieces.getNextComponent(var1, var2, var3, this.boundingBox.maxX + 1, this.boundingBox.minY + 3 + 1, this.boundingBox.minZ + 1, 3, var4); +- } +- +- if(var3.nextBoolean()) { +- StructureMineshaftPieces.getNextComponent(var1, var2, var3, this.boundingBox.minX + 1, this.boundingBox.minY + 3 + 1, this.boundingBox.maxZ + 1, 0, var4); +- } +- } +- ++ ++ switch (this.corridorDirection) { ++ case 0: ++ StructureMineshaftPieces.getNextComponent(par1StructureComponent, par2List, par3Random, this.boundingBox.minX + 1, this.boundingBox.minY, this.boundingBox.maxZ + 1, 0, var4); ++ StructureMineshaftPieces.getNextComponent(par1StructureComponent, par2List, par3Random, this.boundingBox.minX - 1, this.boundingBox.minY, this.boundingBox.minZ + 1, 1, var4); ++ StructureMineshaftPieces.getNextComponent(par1StructureComponent, par2List, par3Random, this.boundingBox.maxX + 1, this.boundingBox.minY, this.boundingBox.minZ + 1, 3, var4); ++ break; ++ ++ case 1: ++ StructureMineshaftPieces.getNextComponent(par1StructureComponent, par2List, par3Random, this.boundingBox.minX + 1, this.boundingBox.minY, this.boundingBox.minZ - 1, 2, var4); ++ StructureMineshaftPieces.getNextComponent(par1StructureComponent, par2List, par3Random, this.boundingBox.minX + 1, this.boundingBox.minY, this.boundingBox.maxZ + 1, 0, var4); ++ StructureMineshaftPieces.getNextComponent(par1StructureComponent, par2List, par3Random, this.boundingBox.minX - 1, this.boundingBox.minY, this.boundingBox.minZ + 1, 1, var4); ++ break; ++ ++ case 2: ++ StructureMineshaftPieces.getNextComponent(par1StructureComponent, par2List, par3Random, this.boundingBox.minX + 1, this.boundingBox.minY, this.boundingBox.minZ - 1, 2, var4); ++ StructureMineshaftPieces.getNextComponent(par1StructureComponent, par2List, par3Random, this.boundingBox.minX - 1, this.boundingBox.minY, this.boundingBox.minZ + 1, 1, var4); ++ StructureMineshaftPieces.getNextComponent(par1StructureComponent, par2List, par3Random, this.boundingBox.maxX + 1, this.boundingBox.minY, this.boundingBox.minZ + 1, 3, var4); ++ break; ++ ++ case 3: ++ StructureMineshaftPieces.getNextComponent(par1StructureComponent, par2List, par3Random, this.boundingBox.minX + 1, this.boundingBox.minY, this.boundingBox.minZ - 1, 2, var4); ++ StructureMineshaftPieces.getNextComponent(par1StructureComponent, par2List, par3Random, this.boundingBox.minX + 1, this.boundingBox.minY, this.boundingBox.maxZ + 1, 0, var4); ++ StructureMineshaftPieces.getNextComponent(par1StructureComponent, par2List, par3Random, this.boundingBox.maxX + 1, this.boundingBox.minY, this.boundingBox.minZ + 1, 3, var4); ++ } ++ ++ if (this.isMultipleFloors) { ++ if (par3Random.nextBoolean()) { ++ StructureMineshaftPieces.getNextComponent(par1StructureComponent, par2List, par3Random, this.boundingBox.minX + 1, this.boundingBox.minY + 3 + 1, this.boundingBox.minZ - 1, 2, var4); ++ } ++ ++ if (par3Random.nextBoolean()) { ++ StructureMineshaftPieces.getNextComponent(par1StructureComponent, par2List, par3Random, this.boundingBox.minX - 1, this.boundingBox.minY + 3 + 1, this.boundingBox.minZ + 1, 1, var4); ++ } ++ ++ if (par3Random.nextBoolean()) { ++ StructureMineshaftPieces.getNextComponent(par1StructureComponent, par2List, par3Random, this.boundingBox.maxX + 1, this.boundingBox.minY + 3 + 1, this.boundingBox.minZ + 1, 3, var4); ++ } ++ ++ if (par3Random.nextBoolean()) { ++ StructureMineshaftPieces.getNextComponent(par1StructureComponent, par2List, par3Random, this.boundingBox.minX + 1, this.boundingBox.minY + 3 + 1, this.boundingBox.maxZ + 1, 0, var4); ++ } ++ } + } + +- public boolean addComponentParts(World var1, Random var2, StructureBoundingBox var3) { +- if(this.isLiquidInStructureBoundingBox(var1, var3)) { ++ /** ++ * second Part of Structure generating, this for example places Spiderwebs, Mob Spawners, it closes Mineshafts at the ++ * end, it adds Fences... ++ */ ++ public boolean addComponentParts(World par1World, Random par2Random, StructureBoundingBox par3StructureBoundingBox) { ++ if (this.isLiquidInStructureBoundingBox(par1World, par3StructureBoundingBox)) { + return false; + } else { +- if(this.isMultipleFloors) { +- this.fillWithBlocks(var1, var3, this.boundingBox.minX + 1, this.boundingBox.minY, this.boundingBox.minZ, this.boundingBox.maxX - 1, this.boundingBox.minY + 3 - 1, this.boundingBox.maxZ, 0, 0, false); +- this.fillWithBlocks(var1, var3, this.boundingBox.minX, this.boundingBox.minY, this.boundingBox.minZ + 1, this.boundingBox.maxX, this.boundingBox.minY + 3 - 1, this.boundingBox.maxZ - 1, 0, 0, false); +- this.fillWithBlocks(var1, var3, this.boundingBox.minX + 1, this.boundingBox.maxY - 2, this.boundingBox.minZ, this.boundingBox.maxX - 1, this.boundingBox.maxY, this.boundingBox.maxZ, 0, 0, false); +- this.fillWithBlocks(var1, var3, this.boundingBox.minX, this.boundingBox.maxY - 2, this.boundingBox.minZ + 1, this.boundingBox.maxX, this.boundingBox.maxY, this.boundingBox.maxZ - 1, 0, 0, false); +- this.fillWithBlocks(var1, var3, this.boundingBox.minX + 1, this.boundingBox.minY + 3, this.boundingBox.minZ + 1, this.boundingBox.maxX - 1, this.boundingBox.minY + 3, this.boundingBox.maxZ - 1, 0, 0, false); ++ if (this.isMultipleFloors) { ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, this.boundingBox.minX + 1, this.boundingBox.minY, this.boundingBox.minZ, this.boundingBox.maxX - 1, this.boundingBox.minY + 3 - 1, this.boundingBox.maxZ, 0, 0, false); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, this.boundingBox.minX, this.boundingBox.minY, this.boundingBox.minZ + 1, this.boundingBox.maxX, this.boundingBox.minY + 3 - 1, this.boundingBox.maxZ - 1, 0, 0, false); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, this.boundingBox.minX + 1, this.boundingBox.maxY - 2, this.boundingBox.minZ, this.boundingBox.maxX - 1, this.boundingBox.maxY, this.boundingBox.maxZ, 0, 0, false); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, this.boundingBox.minX, this.boundingBox.maxY - 2, this.boundingBox.minZ + 1, this.boundingBox.maxX, this.boundingBox.maxY, this.boundingBox.maxZ - 1, 0, 0, false); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, this.boundingBox.minX + 1, this.boundingBox.minY + 3, this.boundingBox.minZ + 1, this.boundingBox.maxX - 1, this.boundingBox.minY + 3, this.boundingBox.maxZ - 1, 0, 0, false); + } else { +- this.fillWithBlocks(var1, var3, this.boundingBox.minX + 1, this.boundingBox.minY, this.boundingBox.minZ, this.boundingBox.maxX - 1, this.boundingBox.maxY, this.boundingBox.maxZ, 0, 0, false); +- this.fillWithBlocks(var1, var3, this.boundingBox.minX, this.boundingBox.minY, this.boundingBox.minZ + 1, this.boundingBox.maxX, this.boundingBox.maxY, this.boundingBox.maxZ - 1, 0, 0, false); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, this.boundingBox.minX + 1, this.boundingBox.minY, this.boundingBox.minZ, this.boundingBox.maxX - 1, this.boundingBox.maxY, this.boundingBox.maxZ, 0, 0, false); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, this.boundingBox.minX, this.boundingBox.minY, this.boundingBox.minZ + 1, this.boundingBox.maxX, this.boundingBox.maxY, this.boundingBox.maxZ - 1, 0, 0, false); + } + +- this.fillWithBlocks(var1, var3, this.boundingBox.minX + 1, this.boundingBox.minY, this.boundingBox.minZ + 1, this.boundingBox.minX + 1, this.boundingBox.maxY, this.boundingBox.minZ + 1, Block.planks.blockID, 0, false); +- this.fillWithBlocks(var1, var3, this.boundingBox.minX + 1, this.boundingBox.minY, this.boundingBox.maxZ - 1, this.boundingBox.minX + 1, this.boundingBox.maxY, this.boundingBox.maxZ - 1, Block.planks.blockID, 0, false); +- this.fillWithBlocks(var1, var3, this.boundingBox.maxX - 1, this.boundingBox.minY, this.boundingBox.minZ + 1, this.boundingBox.maxX - 1, this.boundingBox.maxY, this.boundingBox.minZ + 1, Block.planks.blockID, 0, false); +- this.fillWithBlocks(var1, var3, this.boundingBox.maxX - 1, this.boundingBox.minY, this.boundingBox.maxZ - 1, this.boundingBox.maxX - 1, this.boundingBox.maxY, this.boundingBox.maxZ - 1, Block.planks.blockID, 0, false); +- +- for(int var4 = this.boundingBox.minX; var4 <= this.boundingBox.maxX; ++var4) { +- for(int var5 = this.boundingBox.minZ; var5 <= this.boundingBox.maxZ; ++var5) { +- int var6 = this.getBlockIdAtCurrentPosition(var1, var4, this.boundingBox.minY - 1, var5, var3); +- if(var6 == 0) { +- this.placeBlockAtCurrentPosition(var1, Block.planks.blockID, 0, var4, this.boundingBox.minY - 1, var5, var3); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, this.boundingBox.minX + 1, this.boundingBox.minY, this.boundingBox.minZ + 1, this.boundingBox.minX + 1, this.boundingBox.maxY, this.boundingBox.minZ + 1, Block.planks.blockID, 0, false); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, this.boundingBox.minX + 1, this.boundingBox.minY, this.boundingBox.maxZ - 1, this.boundingBox.minX + 1, this.boundingBox.maxY, this.boundingBox.maxZ - 1, Block.planks.blockID, 0, false); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, this.boundingBox.maxX - 1, this.boundingBox.minY, this.boundingBox.minZ + 1, this.boundingBox.maxX - 1, this.boundingBox.maxY, this.boundingBox.minZ + 1, Block.planks.blockID, 0, false); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, this.boundingBox.maxX - 1, this.boundingBox.minY, this.boundingBox.maxZ - 1, this.boundingBox.maxX - 1, this.boundingBox.maxY, this.boundingBox.maxZ - 1, Block.planks.blockID, 0, false); ++ ++ for (int var4 = this.boundingBox.minX; var4 <= this.boundingBox.maxX; ++var4) { ++ for (int var5 = this.boundingBox.minZ; var5 <= this.boundingBox.maxZ; ++var5) { ++ int var6 = this.getBlockIdAtCurrentPosition(par1World, var4, this.boundingBox.minY - 1, var5, par3StructureBoundingBox); ++ ++ if (var6 == 0) { ++ this.placeBlockAtCurrentPosition(par1World, Block.planks.blockID, 0, var4, this.boundingBox.minY - 1, var5, par3StructureBoundingBox); + } + } + } diff --git a/patches/net/minecraft/src/ComponentMineshaftRoom.java.patch b/patches/net/minecraft/src/ComponentMineshaftRoom.java.patch new file mode 100644 index 0000000..dee3adb --- /dev/null +++ b/patches/net/minecraft/src/ComponentMineshaftRoom.java.patch @@ -0,0 +1,216 @@ +--- net/minecraft/src/ComponentMineshaftRoom.java ++++ net/minecraft/src/ComponentMineshaftRoom.java +@@ -6,116 +6,132 @@ + import java.util.Random; + + public class ComponentMineshaftRoom extends StructureComponent { +- private List a = new LinkedList(); +- +- public ComponentMineshaftRoom() { +- } +- +- public ComponentMineshaftRoom(int var1, Random var2, int var3, int var4) { +- super(var1); +- this.boundingBox = new StructureBoundingBox(var3, 50, var4, var3 + 7 + var2.nextInt(6), 54 + var2.nextInt(6), var4 + 7 + var2.nextInt(6)); +- } +- +- public void buildComponent(StructureComponent var1, List var2, Random var3) { ++ ++ /** List of other Mineshaft components linked to this room. */ ++ private List roomsLinkedToTheRoom = new LinkedList(); ++ ++ public ComponentMineshaftRoom() {} ++ ++ public ComponentMineshaftRoom(int par1, Random par2Random, int par3, int par4) { ++ super(par1); ++ this.boundingBox = new StructureBoundingBox(par3, 50, par4, par3 + 7 + par2Random.nextInt(6), 54 + par2Random.nextInt(6), par4 + 7 + par2Random.nextInt(6)); ++ } ++ ++ /** ++ * Initiates construction of the Structure Component picked, at the current Location of StructGen ++ */ ++ public void buildComponent(StructureComponent par1StructureComponent, List par2List, Random par3Random) { + int var4 = this.getComponentType(); + int var6 = this.boundingBox.getYSize() - 3 - 1; +- if(var6 <= 0) { ++ ++ if (var6 <= 0) { + var6 = 1; + } + + int var5; + StructureComponent var7; + StructureBoundingBox var8; +- for(var5 = 0; var5 < this.boundingBox.getXSize(); var5 += 4) { +- var5 += var3.nextInt(this.boundingBox.getXSize()); +- if(var5 + 3 > this.boundingBox.getXSize()) { +- break; +- } +- +- var7 = StructureMineshaftPieces.getNextComponent(var1, var2, var3, this.boundingBox.minX + var5, this.boundingBox.minY + var3.nextInt(var6) + 1, this.boundingBox.minZ - 1, 2, var4); +- if(var7 != null) { +- var8 = var7.getBoundingBox(); +- this.a.add(new StructureBoundingBox(var8.minX, var8.minY, this.boundingBox.minZ, var8.maxX, var8.maxY, this.boundingBox.minZ + 1)); +- } +- } +- +- for(var5 = 0; var5 < this.boundingBox.getXSize(); var5 += 4) { +- var5 += var3.nextInt(this.boundingBox.getXSize()); +- if(var5 + 3 > this.boundingBox.getXSize()) { +- break; +- } +- +- var7 = StructureMineshaftPieces.getNextComponent(var1, var2, var3, this.boundingBox.minX + var5, this.boundingBox.minY + var3.nextInt(var6) + 1, this.boundingBox.maxZ + 1, 0, var4); +- if(var7 != null) { +- var8 = var7.getBoundingBox(); +- this.a.add(new StructureBoundingBox(var8.minX, var8.minY, this.boundingBox.maxZ - 1, var8.maxX, var8.maxY, this.boundingBox.maxZ)); +- } +- } +- +- for(var5 = 0; var5 < this.boundingBox.getZSize(); var5 += 4) { +- var5 += var3.nextInt(this.boundingBox.getZSize()); +- if(var5 + 3 > this.boundingBox.getZSize()) { +- break; +- } +- +- var7 = StructureMineshaftPieces.getNextComponent(var1, var2, var3, this.boundingBox.minX - 1, this.boundingBox.minY + var3.nextInt(var6) + 1, this.boundingBox.minZ + var5, 1, var4); +- if(var7 != null) { +- var8 = var7.getBoundingBox(); +- this.a.add(new StructureBoundingBox(this.boundingBox.minX, var8.minY, var8.minZ, this.boundingBox.minX + 1, var8.maxY, var8.maxZ)); +- } +- } +- +- for(var5 = 0; var5 < this.boundingBox.getZSize(); var5 += 4) { +- var5 += var3.nextInt(this.boundingBox.getZSize()); +- if(var5 + 3 > this.boundingBox.getZSize()) { +- break; +- } +- +- var7 = StructureMineshaftPieces.getNextComponent(var1, var2, var3, this.boundingBox.maxX + 1, this.boundingBox.minY + var3.nextInt(var6) + 1, this.boundingBox.minZ + var5, 3, var4); +- if(var7 != null) { +- var8 = var7.getBoundingBox(); +- this.a.add(new StructureBoundingBox(this.boundingBox.maxX - 1, var8.minY, var8.minZ, this.boundingBox.maxX, var8.maxY, var8.maxZ)); +- } +- } +- ++ ++ for (var5 = 0; var5 < this.boundingBox.getXSize(); var5 += 4) { ++ var5 += par3Random.nextInt(this.boundingBox.getXSize()); ++ ++ if (var5 + 3 > this.boundingBox.getXSize()) { ++ break; ++ } ++ ++ var7 = StructureMineshaftPieces.getNextComponent(par1StructureComponent, par2List, par3Random, this.boundingBox.minX + var5, this.boundingBox.minY + par3Random.nextInt(var6) + 1, this.boundingBox.minZ - 1, 2, var4); ++ ++ if (var7 != null) { ++ var8 = var7.getBoundingBox(); ++ this.roomsLinkedToTheRoom.add(new StructureBoundingBox(var8.minX, var8.minY, this.boundingBox.minZ, var8.maxX, var8.maxY, this.boundingBox.minZ + 1)); ++ } ++ } ++ ++ for (var5 = 0; var5 < this.boundingBox.getXSize(); var5 += 4) { ++ var5 += par3Random.nextInt(this.boundingBox.getXSize()); ++ ++ if (var5 + 3 > this.boundingBox.getXSize()) { ++ break; ++ } ++ ++ var7 = StructureMineshaftPieces.getNextComponent(par1StructureComponent, par2List, par3Random, this.boundingBox.minX + var5, this.boundingBox.minY + par3Random.nextInt(var6) + 1, this.boundingBox.maxZ + 1, 0, var4); ++ ++ if (var7 != null) { ++ var8 = var7.getBoundingBox(); ++ this.roomsLinkedToTheRoom.add(new StructureBoundingBox(var8.minX, var8.minY, this.boundingBox.maxZ - 1, var8.maxX, var8.maxY, this.boundingBox.maxZ)); ++ } ++ } ++ ++ for (var5 = 0; var5 < this.boundingBox.getZSize(); var5 += 4) { ++ var5 += par3Random.nextInt(this.boundingBox.getZSize()); ++ ++ if (var5 + 3 > this.boundingBox.getZSize()) { ++ break; ++ } ++ ++ var7 = StructureMineshaftPieces.getNextComponent(par1StructureComponent, par2List, par3Random, this.boundingBox.minX - 1, this.boundingBox.minY + par3Random.nextInt(var6) + 1, this.boundingBox.minZ + var5, 1, var4); ++ ++ if (var7 != null) { ++ var8 = var7.getBoundingBox(); ++ this.roomsLinkedToTheRoom.add(new StructureBoundingBox(this.boundingBox.minX, var8.minY, var8.minZ, this.boundingBox.minX + 1, var8.maxY, var8.maxZ)); ++ } ++ } ++ ++ for (var5 = 0; var5 < this.boundingBox.getZSize(); var5 += 4) { ++ var5 += par3Random.nextInt(this.boundingBox.getZSize()); ++ ++ if (var5 + 3 > this.boundingBox.getZSize()) { ++ break; ++ } ++ ++ var7 = StructureMineshaftPieces.getNextComponent(par1StructureComponent, par2List, par3Random, this.boundingBox.maxX + 1, this.boundingBox.minY + par3Random.nextInt(var6) + 1, this.boundingBox.minZ + var5, 3, var4); ++ ++ if (var7 != null) { ++ var8 = var7.getBoundingBox(); ++ this.roomsLinkedToTheRoom.add(new StructureBoundingBox(this.boundingBox.maxX - 1, var8.minY, var8.minZ, this.boundingBox.maxX, var8.maxY, var8.maxZ)); ++ } ++ } + } + +- public boolean addComponentParts(World var1, Random var2, StructureBoundingBox var3) { +- if(this.isLiquidInStructureBoundingBox(var1, var3)) { ++ /** ++ * second Part of Structure generating, this for example places Spiderwebs, Mob Spawners, it closes Mineshafts at the ++ * end, it adds Fences... ++ */ ++ public boolean addComponentParts(World par1World, Random par2Random, StructureBoundingBox par3StructureBoundingBox) { ++ if (this.isLiquidInStructureBoundingBox(par1World, par3StructureBoundingBox)) { + return false; + } else { +- this.fillWithBlocks(var1, var3, this.boundingBox.minX, this.boundingBox.minY, this.boundingBox.minZ, this.boundingBox.maxX, this.boundingBox.minY, this.boundingBox.maxZ, Block.dirt.blockID, 0, true); +- this.fillWithBlocks(var1, var3, this.boundingBox.minX, this.boundingBox.minY + 1, this.boundingBox.minZ, this.boundingBox.maxX, Math.min(this.boundingBox.minY + 3, this.boundingBox.maxY), this.boundingBox.maxZ, 0, 0, false); +- Iterator var4 = this.a.iterator(); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, this.boundingBox.minX, this.boundingBox.minY, this.boundingBox.minZ, this.boundingBox.maxX, this.boundingBox.minY, this.boundingBox.maxZ, Block.dirt.blockID, 0, true); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, this.boundingBox.minX, this.boundingBox.minY + 1, this.boundingBox.minZ, this.boundingBox.maxX, Math.min(this.boundingBox.minY + 3, this.boundingBox.maxY), this.boundingBox.maxZ, 0, 0, false); ++ Iterator var4 = this.roomsLinkedToTheRoom.iterator(); + +- while(var4.hasNext()) { ++ while (var4.hasNext()) { + StructureBoundingBox var5 = (StructureBoundingBox)var4.next(); +- this.fillWithBlocks(var1, var3, var5.minX, var5.maxY - 2, var5.minZ, var5.maxX, var5.maxY, var5.maxZ, 0, 0, false); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, var5.minX, var5.maxY - 2, var5.minZ, var5.maxX, var5.maxY, var5.maxZ, 0, 0, false); + } + +- this.randomlyRareFillWithBlocks(var1, var3, this.boundingBox.minX, this.boundingBox.minY + 4, this.boundingBox.minZ, this.boundingBox.maxX, this.boundingBox.maxY, this.boundingBox.maxZ, 0, false); ++ this.randomlyRareFillWithBlocks(par1World, par3StructureBoundingBox, this.boundingBox.minX, this.boundingBox.minY + 4, this.boundingBox.minZ, this.boundingBox.maxX, this.boundingBox.maxY, this.boundingBox.maxZ, 0, false); + return true; + } + } + +- protected void func_143012_a(NBTTagCompound var1) { ++ protected void func_143012_a(NBTTagCompound par1NBTTagCompound) { + NBTTagList var2 = new NBTTagList("Entrances"); +- Iterator var3 = this.a.iterator(); ++ Iterator var3 = this.roomsLinkedToTheRoom.iterator(); + +- while(var3.hasNext()) { ++ while (var3.hasNext()) { + StructureBoundingBox var4 = (StructureBoundingBox)var3.next(); + var2.appendTag(var4.func_143047_a("")); + } + +- var1.setTag("Entrances", var2); ++ par1NBTTagCompound.setTag("Entrances", var2); + } + +- protected void func_143011_b(NBTTagCompound var1) { +- NBTTagList var2 = var1.getTagList("Entrances"); ++ protected void func_143011_b(NBTTagCompound par1NBTTagCompound) { ++ NBTTagList var2 = par1NBTTagCompound.getTagList("Entrances"); + +- for(int var3 = 0; var3 < var2.tagCount(); ++var3) { +- this.a.add(new StructureBoundingBox(((NBTTagIntArray)var2.tagAt(var3)).intArray)); ++ for (int var3 = 0; var3 < var2.tagCount(); ++var3) { ++ this.roomsLinkedToTheRoom.add(new StructureBoundingBox(((NBTTagIntArray)var2.tagAt(var3)).intArray)); + } +- + } + } diff --git a/patches/net/minecraft/src/ComponentMineshaftStairs.java.patch b/patches/net/minecraft/src/ComponentMineshaftStairs.java.patch new file mode 100644 index 0000000..6797418 --- /dev/null +++ b/patches/net/minecraft/src/ComponentMineshaftStairs.java.patch @@ -0,0 +1,142 @@ +--- net/minecraft/src/ComponentMineshaftStairs.java ++++ net/minecraft/src/ComponentMineshaftStairs.java +@@ -4,71 +4,85 @@ + import java.util.Random; + + public class ComponentMineshaftStairs extends StructureComponent { +- public ComponentMineshaftStairs() { +- } +- +- public ComponentMineshaftStairs(int var1, Random var2, StructureBoundingBox var3, int var4) { +- super(var1); +- this.coordBaseMode = var4; +- this.boundingBox = var3; +- } +- +- protected void func_143012_a(NBTTagCompound var1) { +- } +- +- protected void func_143011_b(NBTTagCompound var1) { +- } +- +- public static StructureBoundingBox findValidPlacement(List var0, Random var1, int var2, int var3, int var4, int var5) { +- StructureBoundingBox var6 = new StructureBoundingBox(var2, var3 - 5, var4, var2, var3 + 2, var4); +- switch(var5) { +- case 0: +- var6.maxX = var2 + 2; +- var6.maxZ = var4 + 8; +- break; +- case 1: +- var6.minX = var2 - 8; +- var6.maxZ = var4 + 2; +- break; +- case 2: +- var6.maxX = var2 + 2; +- var6.minZ = var4 - 8; +- break; +- case 3: +- var6.maxX = var2 + 8; +- var6.maxZ = var4 + 2; ++ public ComponentMineshaftStairs() {} ++ ++ public ComponentMineshaftStairs(int par1, Random par2Random, StructureBoundingBox par3StructureBoundingBox, int par4) { ++ super(par1); ++ this.coordBaseMode = par4; ++ this.boundingBox = par3StructureBoundingBox; ++ } ++ ++ protected void func_143012_a(NBTTagCompound par1NBTTagCompound) {} ++ ++ protected void func_143011_b(NBTTagCompound par1NBTTagCompound) {} ++ ++ /** ++ * Trys to find a valid place to put this component. ++ */ ++ public static StructureBoundingBox findValidPlacement(List par0List, Random par1Random, int par2, int par3, int par4, int par5) { ++ StructureBoundingBox var6 = new StructureBoundingBox(par2, par3 - 5, par4, par2, par3 + 2, par4); ++ ++ switch (par5) { ++ case 0: ++ var6.maxX = par2 + 2; ++ var6.maxZ = par4 + 8; ++ break; ++ ++ case 1: ++ var6.minX = par2 - 8; ++ var6.maxZ = par4 + 2; ++ break; ++ ++ case 2: ++ var6.maxX = par2 + 2; ++ var6.minZ = par4 - 8; ++ break; ++ ++ case 3: ++ var6.maxX = par2 + 8; ++ var6.maxZ = par4 + 2; + } + +- return StructureComponent.findIntersecting(var0, var6) != null ? null : var6; ++ return StructureComponent.findIntersecting(par0List, var6) != null ? null : var6; + } + +- public void buildComponent(StructureComponent var1, List var2, Random var3) { ++ /** ++ * Initiates construction of the Structure Component picked, at the current Location of StructGen ++ */ ++ public void buildComponent(StructureComponent par1StructureComponent, List par2List, Random par3Random) { + int var4 = this.getComponentType(); +- switch(this.coordBaseMode) { +- case 0: +- StructureMineshaftPieces.getNextComponent(var1, var2, var3, this.boundingBox.minX, this.boundingBox.minY, this.boundingBox.maxZ + 1, 0, var4); +- break; +- case 1: +- StructureMineshaftPieces.getNextComponent(var1, var2, var3, this.boundingBox.minX - 1, this.boundingBox.minY, this.boundingBox.minZ, 1, var4); +- break; +- case 2: +- StructureMineshaftPieces.getNextComponent(var1, var2, var3, this.boundingBox.minX, this.boundingBox.minY, this.boundingBox.minZ - 1, 2, var4); +- break; +- case 3: +- StructureMineshaftPieces.getNextComponent(var1, var2, var3, this.boundingBox.maxX + 1, this.boundingBox.minY, this.boundingBox.minZ, 3, var4); ++ ++ switch (this.coordBaseMode) { ++ case 0: ++ StructureMineshaftPieces.getNextComponent(par1StructureComponent, par2List, par3Random, this.boundingBox.minX, this.boundingBox.minY, this.boundingBox.maxZ + 1, 0, var4); ++ break; ++ ++ case 1: ++ StructureMineshaftPieces.getNextComponent(par1StructureComponent, par2List, par3Random, this.boundingBox.minX - 1, this.boundingBox.minY, this.boundingBox.minZ, 1, var4); ++ break; ++ ++ case 2: ++ StructureMineshaftPieces.getNextComponent(par1StructureComponent, par2List, par3Random, this.boundingBox.minX, this.boundingBox.minY, this.boundingBox.minZ - 1, 2, var4); ++ break; ++ ++ case 3: ++ StructureMineshaftPieces.getNextComponent(par1StructureComponent, par2List, par3Random, this.boundingBox.maxX + 1, this.boundingBox.minY, this.boundingBox.minZ, 3, var4); + } +- + } + +- public boolean addComponentParts(World var1, Random var2, StructureBoundingBox var3) { +- if(this.isLiquidInStructureBoundingBox(var1, var3)) { ++ /** ++ * second Part of Structure generating, this for example places Spiderwebs, Mob Spawners, it closes Mineshafts at the ++ * end, it adds Fences... ++ */ ++ public boolean addComponentParts(World par1World, Random par2Random, StructureBoundingBox par3StructureBoundingBox) { ++ if (this.isLiquidInStructureBoundingBox(par1World, par3StructureBoundingBox)) { + return false; + } else { +- this.fillWithBlocks(var1, var3, 0, 5, 0, 2, 7, 1, 0, 0, false); +- this.fillWithBlocks(var1, var3, 0, 0, 7, 2, 2, 8, 0, 0, false); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 0, 5, 0, 2, 7, 1, 0, 0, false); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 0, 0, 7, 2, 2, 8, 0, 0, false); + +- for(int var4 = 0; var4 < 5; ++var4) { +- this.fillWithBlocks(var1, var3, 0, 5 - var4 - (var4 < 4 ? 1 : 0), 2 + var4, 2, 7 - var4, 2 + var4, 0, 0, false); ++ for (int var4 = 0; var4 < 5; ++var4) { ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 0, 5 - var4 - (var4 < 4 ? 1 : 0), 2 + var4, 2, 7 - var4, 2 + var4, 0, 0, false); + } + + return true; diff --git a/patches/net/minecraft/src/ComponentNetherBridgeCorridor.java.patch b/patches/net/minecraft/src/ComponentNetherBridgeCorridor.java.patch new file mode 100644 index 0000000..15e7a17 --- /dev/null +++ b/patches/net/minecraft/src/ComponentNetherBridgeCorridor.java.patch @@ -0,0 +1,122 @@ +--- net/minecraft/src/ComponentNetherBridgeCorridor.java ++++ net/minecraft/src/ComponentNetherBridgeCorridor.java +@@ -6,62 +6,73 @@ + public class ComponentNetherBridgeCorridor extends ComponentNetherBridgePiece { + private boolean field_111021_b; + +- public ComponentNetherBridgeCorridor() { +- } +- +- public ComponentNetherBridgeCorridor(int var1, Random var2, StructureBoundingBox var3, int var4) { +- super(var1); +- this.coordBaseMode = var4; +- this.boundingBox = var3; +- this.field_111021_b = var2.nextInt(3) == 0; +- } +- +- protected void func_143011_b(NBTTagCompound var1) { +- super.func_143011_b(var1); +- this.field_111021_b = var1.getBoolean("Chest"); +- } +- +- protected void func_143012_a(NBTTagCompound var1) { +- super.func_143012_a(var1); +- var1.setBoolean("Chest", this.field_111021_b); +- } +- +- public void buildComponent(StructureComponent var1, List var2, Random var3) { +- this.getNextComponentX((ComponentNetherBridgeStartPiece)var1, var2, var3, 0, 1, true); +- } +- +- public static ComponentNetherBridgeCorridor createValidComponent(List var0, Random var1, int var2, int var3, int var4, int var5, int var6) { +- StructureBoundingBox var7 = StructureBoundingBox.getComponentToAddBoundingBox(var2, var3, var4, -1, 0, 0, 5, 7, 5, var5); +- return isAboveGround(var7) && StructureComponent.findIntersecting(var0, var7) == null ? new ComponentNetherBridgeCorridor(var6, var1, var7, var5) : null; +- } +- +- public boolean addComponentParts(World var1, Random var2, StructureBoundingBox var3) { +- this.fillWithBlocks(var1, var3, 0, 0, 0, 4, 1, 4, Block.netherBrick.blockID, Block.netherBrick.blockID, false); +- this.fillWithBlocks(var1, var3, 0, 2, 0, 4, 5, 4, 0, 0, false); +- this.fillWithBlocks(var1, var3, 4, 2, 0, 4, 5, 4, Block.netherBrick.blockID, Block.netherBrick.blockID, false); +- this.fillWithBlocks(var1, var3, 4, 3, 1, 4, 4, 1, Block.netherFence.blockID, Block.netherFence.blockID, false); +- this.fillWithBlocks(var1, var3, 4, 3, 3, 4, 4, 3, Block.netherFence.blockID, Block.netherFence.blockID, false); +- this.fillWithBlocks(var1, var3, 0, 2, 0, 0, 5, 0, Block.netherBrick.blockID, Block.netherBrick.blockID, false); +- this.fillWithBlocks(var1, var3, 0, 2, 4, 3, 5, 4, Block.netherBrick.blockID, Block.netherBrick.blockID, false); +- this.fillWithBlocks(var1, var3, 1, 3, 4, 1, 4, 4, Block.netherFence.blockID, Block.netherBrick.blockID, false); +- this.fillWithBlocks(var1, var3, 3, 3, 4, 3, 4, 4, Block.netherFence.blockID, Block.netherBrick.blockID, false); ++ public ComponentNetherBridgeCorridor() {} ++ ++ public ComponentNetherBridgeCorridor(int par1, Random par2Random, StructureBoundingBox par3StructureBoundingBox, int par4) { ++ super(par1); ++ this.coordBaseMode = par4; ++ this.boundingBox = par3StructureBoundingBox; ++ this.field_111021_b = par2Random.nextInt(3) == 0; ++ } ++ ++ protected void func_143011_b(NBTTagCompound par1NBTTagCompound) { ++ super.func_143011_b(par1NBTTagCompound); ++ this.field_111021_b = par1NBTTagCompound.getBoolean("Chest"); ++ } ++ ++ protected void func_143012_a(NBTTagCompound par1NBTTagCompound) { ++ super.func_143012_a(par1NBTTagCompound); ++ par1NBTTagCompound.setBoolean("Chest", this.field_111021_b); ++ } ++ ++ /** ++ * Initiates construction of the Structure Component picked, at the current Location of StructGen ++ */ ++ public void buildComponent(StructureComponent par1StructureComponent, List par2List, Random par3Random) { ++ this.getNextComponentX((ComponentNetherBridgeStartPiece)par1StructureComponent, par2List, par3Random, 0, 1, true); ++ } ++ ++ /** ++ * Creates and returns a new component piece. Or null if it could not find enough room to place it. ++ */ ++ public static ComponentNetherBridgeCorridor createValidComponent(List par0List, Random par1Random, int par2, int par3, int par4, int par5, int par6) { ++ StructureBoundingBox var7 = StructureBoundingBox.getComponentToAddBoundingBox(par2, par3, par4, -1, 0, 0, 5, 7, 5, par5); ++ return isAboveGround(var7) && StructureComponent.findIntersecting(par0List, var7) == null ? new ComponentNetherBridgeCorridor(par6, par1Random, var7, par5) : null; ++ } ++ ++ /** ++ * second Part of Structure generating, this for example places Spiderwebs, Mob Spawners, it closes Mineshafts at the ++ * end, it adds Fences... ++ */ ++ public boolean addComponentParts(World par1World, Random par2Random, StructureBoundingBox par3StructureBoundingBox) { ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 0, 0, 0, 4, 1, 4, Block.netherBrick.blockID, Block.netherBrick.blockID, false); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 0, 2, 0, 4, 5, 4, 0, 0, false); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 4, 2, 0, 4, 5, 4, Block.netherBrick.blockID, Block.netherBrick.blockID, false); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 4, 3, 1, 4, 4, 1, Block.netherFence.blockID, Block.netherFence.blockID, false); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 4, 3, 3, 4, 4, 3, Block.netherFence.blockID, Block.netherFence.blockID, false); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 0, 2, 0, 0, 5, 0, Block.netherBrick.blockID, Block.netherBrick.blockID, false); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 0, 2, 4, 3, 5, 4, Block.netherBrick.blockID, Block.netherBrick.blockID, false); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 1, 3, 4, 1, 4, 4, Block.netherFence.blockID, Block.netherBrick.blockID, false); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 3, 3, 4, 3, 4, 4, Block.netherFence.blockID, Block.netherBrick.blockID, false); + int var4; + int var5; +- if(this.field_111021_b) { ++ ++ if (this.field_111021_b) { + var4 = this.getYWithOffset(2); + var5 = this.getXWithOffset(3, 3); + int var6 = this.getZWithOffset(3, 3); +- if(var3.isVecInside(var5, var4, var6)) { ++ ++ if (par3StructureBoundingBox.isVecInside(var5, var4, var6)) { + this.field_111021_b = false; +- this.generateStructureChestContents(var1, var3, var2, 3, 2, 3, field_111019_a, 2 + var2.nextInt(4)); ++ this.generateStructureChestContents(par1World, par3StructureBoundingBox, par2Random, 3, 2, 3, field_111019_a, 2 + par2Random.nextInt(4)); + } + } + +- this.fillWithBlocks(var1, var3, 0, 6, 0, 4, 6, 4, Block.netherBrick.blockID, Block.netherBrick.blockID, false); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 0, 6, 0, 4, 6, 4, Block.netherBrick.blockID, Block.netherBrick.blockID, false); + +- for(var4 = 0; var4 <= 4; ++var4) { +- for(var5 = 0; var5 <= 4; ++var5) { +- this.fillCurrentPositionBlocksDownwards(var1, Block.netherBrick.blockID, 0, var4, -1, var5, var3); ++ for (var4 = 0; var4 <= 4; ++var4) { ++ for (var5 = 0; var5 <= 4; ++var5) { ++ this.fillCurrentPositionBlocksDownwards(par1World, Block.netherBrick.blockID, 0, var4, -1, var5, par3StructureBoundingBox); + } + } + diff --git a/patches/net/minecraft/src/ComponentNetherBridgeCorridor2.java.patch b/patches/net/minecraft/src/ComponentNetherBridgeCorridor2.java.patch new file mode 100644 index 0000000..4bf8ffc --- /dev/null +++ b/patches/net/minecraft/src/ComponentNetherBridgeCorridor2.java.patch @@ -0,0 +1,122 @@ +--- net/minecraft/src/ComponentNetherBridgeCorridor2.java ++++ net/minecraft/src/ComponentNetherBridgeCorridor2.java +@@ -6,62 +6,73 @@ + public class ComponentNetherBridgeCorridor2 extends ComponentNetherBridgePiece { + private boolean field_111020_b; + +- public ComponentNetherBridgeCorridor2() { +- } +- +- public ComponentNetherBridgeCorridor2(int var1, Random var2, StructureBoundingBox var3, int var4) { +- super(var1); +- this.coordBaseMode = var4; +- this.boundingBox = var3; +- this.field_111020_b = var2.nextInt(3) == 0; +- } +- +- protected void func_143011_b(NBTTagCompound var1) { +- super.func_143011_b(var1); +- this.field_111020_b = var1.getBoolean("Chest"); +- } +- +- protected void func_143012_a(NBTTagCompound var1) { +- super.func_143012_a(var1); +- var1.setBoolean("Chest", this.field_111020_b); +- } +- +- public void buildComponent(StructureComponent var1, List var2, Random var3) { +- this.getNextComponentZ((ComponentNetherBridgeStartPiece)var1, var2, var3, 0, 1, true); +- } +- +- public static ComponentNetherBridgeCorridor2 createValidComponent(List var0, Random var1, int var2, int var3, int var4, int var5, int var6) { +- StructureBoundingBox var7 = StructureBoundingBox.getComponentToAddBoundingBox(var2, var3, var4, -1, 0, 0, 5, 7, 5, var5); +- return isAboveGround(var7) && StructureComponent.findIntersecting(var0, var7) == null ? new ComponentNetherBridgeCorridor2(var6, var1, var7, var5) : null; +- } +- +- public boolean addComponentParts(World var1, Random var2, StructureBoundingBox var3) { +- this.fillWithBlocks(var1, var3, 0, 0, 0, 4, 1, 4, Block.netherBrick.blockID, Block.netherBrick.blockID, false); +- this.fillWithBlocks(var1, var3, 0, 2, 0, 4, 5, 4, 0, 0, false); +- this.fillWithBlocks(var1, var3, 0, 2, 0, 0, 5, 4, Block.netherBrick.blockID, Block.netherBrick.blockID, false); +- this.fillWithBlocks(var1, var3, 0, 3, 1, 0, 4, 1, Block.netherFence.blockID, Block.netherFence.blockID, false); +- this.fillWithBlocks(var1, var3, 0, 3, 3, 0, 4, 3, Block.netherFence.blockID, Block.netherFence.blockID, false); +- this.fillWithBlocks(var1, var3, 4, 2, 0, 4, 5, 0, Block.netherBrick.blockID, Block.netherBrick.blockID, false); +- this.fillWithBlocks(var1, var3, 1, 2, 4, 4, 5, 4, Block.netherBrick.blockID, Block.netherBrick.blockID, false); +- this.fillWithBlocks(var1, var3, 1, 3, 4, 1, 4, 4, Block.netherFence.blockID, Block.netherBrick.blockID, false); +- this.fillWithBlocks(var1, var3, 3, 3, 4, 3, 4, 4, Block.netherFence.blockID, Block.netherBrick.blockID, false); ++ public ComponentNetherBridgeCorridor2() {} ++ ++ public ComponentNetherBridgeCorridor2(int par1, Random par2Random, StructureBoundingBox par3StructureBoundingBox, int par4) { ++ super(par1); ++ this.coordBaseMode = par4; ++ this.boundingBox = par3StructureBoundingBox; ++ this.field_111020_b = par2Random.nextInt(3) == 0; ++ } ++ ++ protected void func_143011_b(NBTTagCompound par1NBTTagCompound) { ++ super.func_143011_b(par1NBTTagCompound); ++ this.field_111020_b = par1NBTTagCompound.getBoolean("Chest"); ++ } ++ ++ protected void func_143012_a(NBTTagCompound par1NBTTagCompound) { ++ super.func_143012_a(par1NBTTagCompound); ++ par1NBTTagCompound.setBoolean("Chest", this.field_111020_b); ++ } ++ ++ /** ++ * Initiates construction of the Structure Component picked, at the current Location of StructGen ++ */ ++ public void buildComponent(StructureComponent par1StructureComponent, List par2List, Random par3Random) { ++ this.getNextComponentZ((ComponentNetherBridgeStartPiece)par1StructureComponent, par2List, par3Random, 0, 1, true); ++ } ++ ++ /** ++ * Creates and returns a new component piece. Or null if it could not find enough room to place it. ++ */ ++ public static ComponentNetherBridgeCorridor2 createValidComponent(List par0List, Random par1Random, int par2, int par3, int par4, int par5, int par6) { ++ StructureBoundingBox var7 = StructureBoundingBox.getComponentToAddBoundingBox(par2, par3, par4, -1, 0, 0, 5, 7, 5, par5); ++ return isAboveGround(var7) && StructureComponent.findIntersecting(par0List, var7) == null ? new ComponentNetherBridgeCorridor2(par6, par1Random, var7, par5) : null; ++ } ++ ++ /** ++ * second Part of Structure generating, this for example places Spiderwebs, Mob Spawners, it closes Mineshafts at the ++ * end, it adds Fences... ++ */ ++ public boolean addComponentParts(World par1World, Random par2Random, StructureBoundingBox par3StructureBoundingBox) { ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 0, 0, 0, 4, 1, 4, Block.netherBrick.blockID, Block.netherBrick.blockID, false); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 0, 2, 0, 4, 5, 4, 0, 0, false); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 0, 2, 0, 0, 5, 4, Block.netherBrick.blockID, Block.netherBrick.blockID, false); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 0, 3, 1, 0, 4, 1, Block.netherFence.blockID, Block.netherFence.blockID, false); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 0, 3, 3, 0, 4, 3, Block.netherFence.blockID, Block.netherFence.blockID, false); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 4, 2, 0, 4, 5, 0, Block.netherBrick.blockID, Block.netherBrick.blockID, false); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 1, 2, 4, 4, 5, 4, Block.netherBrick.blockID, Block.netherBrick.blockID, false); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 1, 3, 4, 1, 4, 4, Block.netherFence.blockID, Block.netherBrick.blockID, false); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 3, 3, 4, 3, 4, 4, Block.netherFence.blockID, Block.netherBrick.blockID, false); + int var4; + int var5; +- if(this.field_111020_b) { ++ ++ if (this.field_111020_b) { + var4 = this.getYWithOffset(2); + var5 = this.getXWithOffset(1, 3); + int var6 = this.getZWithOffset(1, 3); +- if(var3.isVecInside(var5, var4, var6)) { ++ ++ if (par3StructureBoundingBox.isVecInside(var5, var4, var6)) { + this.field_111020_b = false; +- this.generateStructureChestContents(var1, var3, var2, 1, 2, 3, field_111019_a, 2 + var2.nextInt(4)); ++ this.generateStructureChestContents(par1World, par3StructureBoundingBox, par2Random, 1, 2, 3, field_111019_a, 2 + par2Random.nextInt(4)); + } + } + +- this.fillWithBlocks(var1, var3, 0, 6, 0, 4, 6, 4, Block.netherBrick.blockID, Block.netherBrick.blockID, false); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 0, 6, 0, 4, 6, 4, Block.netherBrick.blockID, Block.netherBrick.blockID, false); + +- for(var4 = 0; var4 <= 4; ++var4) { +- for(var5 = 0; var5 <= 4; ++var5) { +- this.fillCurrentPositionBlocksDownwards(var1, Block.netherBrick.blockID, 0, var4, -1, var5, var3); ++ for (var4 = 0; var4 <= 4; ++var4) { ++ for (var5 = 0; var5 <= 4; ++var5) { ++ this.fillCurrentPositionBlocksDownwards(par1World, Block.netherBrick.blockID, 0, var4, -1, var5, par3StructureBoundingBox); + } + } + diff --git a/patches/net/minecraft/src/ComponentNetherBridgeCorridor3.java.patch b/patches/net/minecraft/src/ComponentNetherBridgeCorridor3.java.patch new file mode 100644 index 0000000..df38c36 --- /dev/null +++ b/patches/net/minecraft/src/ComponentNetherBridgeCorridor3.java.patch @@ -0,0 +1,101 @@ +--- net/minecraft/src/ComponentNetherBridgeCorridor3.java ++++ net/minecraft/src/ComponentNetherBridgeCorridor3.java +@@ -4,49 +4,60 @@ + import java.util.Random; + + public class ComponentNetherBridgeCorridor3 extends ComponentNetherBridgePiece { +- public ComponentNetherBridgeCorridor3() { +- } +- +- public ComponentNetherBridgeCorridor3(int var1, Random var2, StructureBoundingBox var3, int var4) { +- super(var1); +- this.coordBaseMode = var4; +- this.boundingBox = var3; +- } +- +- public void buildComponent(StructureComponent var1, List var2, Random var3) { +- this.getNextComponentNormal((ComponentNetherBridgeStartPiece)var1, var2, var3, 1, 0, true); +- } +- +- public static ComponentNetherBridgeCorridor3 createValidComponent(List var0, Random var1, int var2, int var3, int var4, int var5, int var6) { +- StructureBoundingBox var7 = StructureBoundingBox.getComponentToAddBoundingBox(var2, var3, var4, -1, -7, 0, 5, 14, 10, var5); +- return isAboveGround(var7) && StructureComponent.findIntersecting(var0, var7) == null ? new ComponentNetherBridgeCorridor3(var6, var1, var7, var5) : null; +- } +- +- public boolean addComponentParts(World var1, Random var2, StructureBoundingBox var3) { ++ public ComponentNetherBridgeCorridor3() {} ++ ++ public ComponentNetherBridgeCorridor3(int par1, Random par2Random, StructureBoundingBox par3StructureBoundingBox, int par4) { ++ super(par1); ++ this.coordBaseMode = par4; ++ this.boundingBox = par3StructureBoundingBox; ++ } ++ ++ /** ++ * Initiates construction of the Structure Component picked, at the current Location of StructGen ++ */ ++ public void buildComponent(StructureComponent par1StructureComponent, List par2List, Random par3Random) { ++ this.getNextComponentNormal((ComponentNetherBridgeStartPiece)par1StructureComponent, par2List, par3Random, 1, 0, true); ++ } ++ ++ /** ++ * Creates and returns a new component piece. Or null if it could not find enough room to place it. ++ */ ++ public static ComponentNetherBridgeCorridor3 createValidComponent(List par0List, Random par1Random, int par2, int par3, int par4, int par5, int par6) { ++ StructureBoundingBox var7 = StructureBoundingBox.getComponentToAddBoundingBox(par2, par3, par4, -1, -7, 0, 5, 14, 10, par5); ++ return isAboveGround(var7) && StructureComponent.findIntersecting(par0List, var7) == null ? new ComponentNetherBridgeCorridor3(par6, par1Random, var7, par5) : null; ++ } ++ ++ /** ++ * second Part of Structure generating, this for example places Spiderwebs, Mob Spawners, it closes Mineshafts at the ++ * end, it adds Fences... ++ */ ++ public boolean addComponentParts(World par1World, Random par2Random, StructureBoundingBox par3StructureBoundingBox) { + int var4 = this.getMetadataWithOffset(Block.stairsNetherBrick.blockID, 2); + +- for(int var5 = 0; var5 <= 9; ++var5) { ++ for (int var5 = 0; var5 <= 9; ++var5) { + int var6 = Math.max(1, 7 - var5); + int var7 = Math.min(Math.max(var6 + 5, 14 - var5), 13); + int var8 = var5; +- this.fillWithBlocks(var1, var3, 0, 0, var5, 4, var6, var5, Block.netherBrick.blockID, Block.netherBrick.blockID, false); +- this.fillWithBlocks(var1, var3, 1, var6 + 1, var5, 3, var7 - 1, var5, 0, 0, false); +- if(var5 <= 6) { +- this.placeBlockAtCurrentPosition(var1, Block.stairsNetherBrick.blockID, var4, 1, var6 + 1, var5, var3); +- this.placeBlockAtCurrentPosition(var1, Block.stairsNetherBrick.blockID, var4, 2, var6 + 1, var5, var3); +- this.placeBlockAtCurrentPosition(var1, Block.stairsNetherBrick.blockID, var4, 3, var6 + 1, var5, var3); +- } +- +- this.fillWithBlocks(var1, var3, 0, var7, var5, 4, var7, var5, Block.netherBrick.blockID, Block.netherBrick.blockID, false); +- this.fillWithBlocks(var1, var3, 0, var6 + 1, var5, 0, var7 - 1, var5, Block.netherBrick.blockID, Block.netherBrick.blockID, false); +- this.fillWithBlocks(var1, var3, 4, var6 + 1, var5, 4, var7 - 1, var5, Block.netherBrick.blockID, Block.netherBrick.blockID, false); +- if((var5 & 1) == 0) { +- this.fillWithBlocks(var1, var3, 0, var6 + 2, var5, 0, var6 + 3, var5, Block.netherFence.blockID, Block.netherFence.blockID, false); +- this.fillWithBlocks(var1, var3, 4, var6 + 2, var5, 4, var6 + 3, var5, Block.netherFence.blockID, Block.netherFence.blockID, false); +- } +- +- for(int var9 = 0; var9 <= 4; ++var9) { +- this.fillCurrentPositionBlocksDownwards(var1, Block.netherBrick.blockID, 0, var9, -1, var8, var3); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 0, 0, var5, 4, var6, var5, Block.netherBrick.blockID, Block.netherBrick.blockID, false); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 1, var6 + 1, var5, 3, var7 - 1, var5, 0, 0, false); ++ ++ if (var5 <= 6) { ++ this.placeBlockAtCurrentPosition(par1World, Block.stairsNetherBrick.blockID, var4, 1, var6 + 1, var5, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.stairsNetherBrick.blockID, var4, 2, var6 + 1, var5, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.stairsNetherBrick.blockID, var4, 3, var6 + 1, var5, par3StructureBoundingBox); ++ } ++ ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 0, var7, var5, 4, var7, var5, Block.netherBrick.blockID, Block.netherBrick.blockID, false); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 0, var6 + 1, var5, 0, var7 - 1, var5, Block.netherBrick.blockID, Block.netherBrick.blockID, false); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 4, var6 + 1, var5, 4, var7 - 1, var5, Block.netherBrick.blockID, Block.netherBrick.blockID, false); ++ ++ if ((var5 & 1) == 0) { ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 0, var6 + 2, var5, 0, var6 + 3, var5, Block.netherFence.blockID, Block.netherFence.blockID, false); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 4, var6 + 2, var5, 4, var6 + 3, var5, Block.netherFence.blockID, Block.netherFence.blockID, false); ++ } ++ ++ for (int var9 = 0; var9 <= 4; ++var9) { ++ this.fillCurrentPositionBlocksDownwards(par1World, Block.netherBrick.blockID, 0, var9, -1, var8, par3StructureBoundingBox); + } + } + diff --git a/patches/net/minecraft/src/ComponentNetherBridgeCorridor4.java.patch b/patches/net/minecraft/src/ComponentNetherBridgeCorridor4.java.patch new file mode 100644 index 0000000..02028ec --- /dev/null +++ b/patches/net/minecraft/src/ComponentNetherBridgeCorridor4.java.patch @@ -0,0 +1,111 @@ +--- net/minecraft/src/ComponentNetherBridgeCorridor4.java ++++ net/minecraft/src/ComponentNetherBridgeCorridor4.java +@@ -4,54 +4,64 @@ + import java.util.Random; + + public class ComponentNetherBridgeCorridor4 extends ComponentNetherBridgePiece { +- public ComponentNetherBridgeCorridor4() { +- } +- +- public ComponentNetherBridgeCorridor4(int var1, Random var2, StructureBoundingBox var3, int var4) { +- super(var1); +- this.coordBaseMode = var4; +- this.boundingBox = var3; +- } +- +- public void buildComponent(StructureComponent var1, List var2, Random var3) { ++ public ComponentNetherBridgeCorridor4() {} ++ ++ public ComponentNetherBridgeCorridor4(int par1, Random par2Random, StructureBoundingBox par3StructureBoundingBox, int par4) { ++ super(par1); ++ this.coordBaseMode = par4; ++ this.boundingBox = par3StructureBoundingBox; ++ } ++ ++ /** ++ * Initiates construction of the Structure Component picked, at the current Location of StructGen ++ */ ++ public void buildComponent(StructureComponent par1StructureComponent, List par2List, Random par3Random) { + byte var4 = 1; +- if(this.coordBaseMode == 1 || this.coordBaseMode == 2) { ++ ++ if (this.coordBaseMode == 1 || this.coordBaseMode == 2) { + var4 = 5; + } + +- this.getNextComponentX((ComponentNetherBridgeStartPiece)var1, var2, var3, 0, var4, var3.nextInt(8) > 0); +- this.getNextComponentZ((ComponentNetherBridgeStartPiece)var1, var2, var3, 0, var4, var3.nextInt(8) > 0); +- } +- +- public static ComponentNetherBridgeCorridor4 createValidComponent(List var0, Random var1, int var2, int var3, int var4, int var5, int var6) { +- StructureBoundingBox var7 = StructureBoundingBox.getComponentToAddBoundingBox(var2, var3, var4, -3, 0, 0, 9, 7, 9, var5); +- return isAboveGround(var7) && StructureComponent.findIntersecting(var0, var7) == null ? new ComponentNetherBridgeCorridor4(var6, var1, var7, var5) : null; +- } +- +- public boolean addComponentParts(World var1, Random var2, StructureBoundingBox var3) { +- this.fillWithBlocks(var1, var3, 0, 0, 0, 8, 1, 8, Block.netherBrick.blockID, Block.netherBrick.blockID, false); +- this.fillWithBlocks(var1, var3, 0, 2, 0, 8, 5, 8, 0, 0, false); +- this.fillWithBlocks(var1, var3, 0, 6, 0, 8, 6, 5, Block.netherBrick.blockID, Block.netherBrick.blockID, false); +- this.fillWithBlocks(var1, var3, 0, 2, 0, 2, 5, 0, Block.netherBrick.blockID, Block.netherBrick.blockID, false); +- this.fillWithBlocks(var1, var3, 6, 2, 0, 8, 5, 0, Block.netherBrick.blockID, Block.netherBrick.blockID, false); +- this.fillWithBlocks(var1, var3, 1, 3, 0, 1, 4, 0, Block.netherFence.blockID, Block.netherFence.blockID, false); +- this.fillWithBlocks(var1, var3, 7, 3, 0, 7, 4, 0, Block.netherFence.blockID, Block.netherFence.blockID, false); +- this.fillWithBlocks(var1, var3, 0, 2, 4, 8, 2, 8, Block.netherBrick.blockID, Block.netherBrick.blockID, false); +- this.fillWithBlocks(var1, var3, 1, 1, 4, 2, 2, 4, 0, 0, false); +- this.fillWithBlocks(var1, var3, 6, 1, 4, 7, 2, 4, 0, 0, false); +- this.fillWithBlocks(var1, var3, 0, 3, 8, 8, 3, 8, Block.netherFence.blockID, Block.netherFence.blockID, false); +- this.fillWithBlocks(var1, var3, 0, 3, 6, 0, 3, 7, Block.netherFence.blockID, Block.netherFence.blockID, false); +- this.fillWithBlocks(var1, var3, 8, 3, 6, 8, 3, 7, Block.netherFence.blockID, Block.netherFence.blockID, false); +- this.fillWithBlocks(var1, var3, 0, 3, 4, 0, 5, 5, Block.netherBrick.blockID, Block.netherBrick.blockID, false); +- this.fillWithBlocks(var1, var3, 8, 3, 4, 8, 5, 5, Block.netherBrick.blockID, Block.netherBrick.blockID, false); +- this.fillWithBlocks(var1, var3, 1, 3, 5, 2, 5, 5, Block.netherBrick.blockID, Block.netherBrick.blockID, false); +- this.fillWithBlocks(var1, var3, 6, 3, 5, 7, 5, 5, Block.netherBrick.blockID, Block.netherBrick.blockID, false); +- this.fillWithBlocks(var1, var3, 1, 4, 5, 1, 5, 5, Block.netherFence.blockID, Block.netherFence.blockID, false); +- this.fillWithBlocks(var1, var3, 7, 4, 5, 7, 5, 5, Block.netherFence.blockID, Block.netherFence.blockID, false); +- +- for(int var4 = 0; var4 <= 5; ++var4) { +- for(int var5 = 0; var5 <= 8; ++var5) { +- this.fillCurrentPositionBlocksDownwards(var1, Block.netherBrick.blockID, 0, var5, -1, var4, var3); ++ this.getNextComponentX((ComponentNetherBridgeStartPiece)par1StructureComponent, par2List, par3Random, 0, var4, par3Random.nextInt(8) > 0); ++ this.getNextComponentZ((ComponentNetherBridgeStartPiece)par1StructureComponent, par2List, par3Random, 0, var4, par3Random.nextInt(8) > 0); ++ } ++ ++ /** ++ * Creates and returns a new component piece. Or null if it could not find enough room to place it. ++ */ ++ public static ComponentNetherBridgeCorridor4 createValidComponent(List par0List, Random par1Random, int par2, int par3, int par4, int par5, int par6) { ++ StructureBoundingBox var7 = StructureBoundingBox.getComponentToAddBoundingBox(par2, par3, par4, -3, 0, 0, 9, 7, 9, par5); ++ return isAboveGround(var7) && StructureComponent.findIntersecting(par0List, var7) == null ? new ComponentNetherBridgeCorridor4(par6, par1Random, var7, par5) : null; ++ } ++ ++ /** ++ * second Part of Structure generating, this for example places Spiderwebs, Mob Spawners, it closes Mineshafts at the ++ * end, it adds Fences... ++ */ ++ public boolean addComponentParts(World par1World, Random par2Random, StructureBoundingBox par3StructureBoundingBox) { ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 0, 0, 0, 8, 1, 8, Block.netherBrick.blockID, Block.netherBrick.blockID, false); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 0, 2, 0, 8, 5, 8, 0, 0, false); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 0, 6, 0, 8, 6, 5, Block.netherBrick.blockID, Block.netherBrick.blockID, false); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 0, 2, 0, 2, 5, 0, Block.netherBrick.blockID, Block.netherBrick.blockID, false); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 6, 2, 0, 8, 5, 0, Block.netherBrick.blockID, Block.netherBrick.blockID, false); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 1, 3, 0, 1, 4, 0, Block.netherFence.blockID, Block.netherFence.blockID, false); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 7, 3, 0, 7, 4, 0, Block.netherFence.blockID, Block.netherFence.blockID, false); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 0, 2, 4, 8, 2, 8, Block.netherBrick.blockID, Block.netherBrick.blockID, false); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 1, 1, 4, 2, 2, 4, 0, 0, false); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 6, 1, 4, 7, 2, 4, 0, 0, false); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 0, 3, 8, 8, 3, 8, Block.netherFence.blockID, Block.netherFence.blockID, false); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 0, 3, 6, 0, 3, 7, Block.netherFence.blockID, Block.netherFence.blockID, false); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 8, 3, 6, 8, 3, 7, Block.netherFence.blockID, Block.netherFence.blockID, false); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 0, 3, 4, 0, 5, 5, Block.netherBrick.blockID, Block.netherBrick.blockID, false); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 8, 3, 4, 8, 5, 5, Block.netherBrick.blockID, Block.netherBrick.blockID, false); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 1, 3, 5, 2, 5, 5, Block.netherBrick.blockID, Block.netherBrick.blockID, false); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 6, 3, 5, 7, 5, 5, Block.netherBrick.blockID, Block.netherBrick.blockID, false); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 1, 4, 5, 1, 5, 5, Block.netherFence.blockID, Block.netherFence.blockID, false); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 7, 4, 5, 7, 5, 5, Block.netherFence.blockID, Block.netherFence.blockID, false); ++ ++ for (int var4 = 0; var4 <= 5; ++var4) { ++ for (int var5 = 0; var5 <= 8; ++var5) { ++ this.fillCurrentPositionBlocksDownwards(par1World, Block.netherBrick.blockID, 0, var5, -1, var4, par3StructureBoundingBox); + } + } + diff --git a/patches/net/minecraft/src/ComponentNetherBridgeCorridor5.java.patch b/patches/net/minecraft/src/ComponentNetherBridgeCorridor5.java.patch new file mode 100644 index 0000000..e60e11c --- /dev/null +++ b/patches/net/minecraft/src/ComponentNetherBridgeCorridor5.java.patch @@ -0,0 +1,82 @@ +--- net/minecraft/src/ComponentNetherBridgeCorridor5.java ++++ net/minecraft/src/ComponentNetherBridgeCorridor5.java +@@ -4,38 +4,47 @@ + import java.util.Random; + + public class ComponentNetherBridgeCorridor5 extends ComponentNetherBridgePiece { +- public ComponentNetherBridgeCorridor5() { +- } +- +- public ComponentNetherBridgeCorridor5(int var1, Random var2, StructureBoundingBox var3, int var4) { +- super(var1); +- this.coordBaseMode = var4; +- this.boundingBox = var3; +- } +- +- public void buildComponent(StructureComponent var1, List var2, Random var3) { +- this.getNextComponentNormal((ComponentNetherBridgeStartPiece)var1, var2, var3, 1, 0, true); +- } +- +- public static ComponentNetherBridgeCorridor5 createValidComponent(List var0, Random var1, int var2, int var3, int var4, int var5, int var6) { +- StructureBoundingBox var7 = StructureBoundingBox.getComponentToAddBoundingBox(var2, var3, var4, -1, 0, 0, 5, 7, 5, var5); +- return isAboveGround(var7) && StructureComponent.findIntersecting(var0, var7) == null ? new ComponentNetherBridgeCorridor5(var6, var1, var7, var5) : null; +- } +- +- public boolean addComponentParts(World var1, Random var2, StructureBoundingBox var3) { +- this.fillWithBlocks(var1, var3, 0, 0, 0, 4, 1, 4, Block.netherBrick.blockID, Block.netherBrick.blockID, false); +- this.fillWithBlocks(var1, var3, 0, 2, 0, 4, 5, 4, 0, 0, false); +- this.fillWithBlocks(var1, var3, 0, 2, 0, 0, 5, 4, Block.netherBrick.blockID, Block.netherBrick.blockID, false); +- this.fillWithBlocks(var1, var3, 4, 2, 0, 4, 5, 4, Block.netherBrick.blockID, Block.netherBrick.blockID, false); +- this.fillWithBlocks(var1, var3, 0, 3, 1, 0, 4, 1, Block.netherFence.blockID, Block.netherFence.blockID, false); +- this.fillWithBlocks(var1, var3, 0, 3, 3, 0, 4, 3, Block.netherFence.blockID, Block.netherFence.blockID, false); +- this.fillWithBlocks(var1, var3, 4, 3, 1, 4, 4, 1, Block.netherFence.blockID, Block.netherFence.blockID, false); +- this.fillWithBlocks(var1, var3, 4, 3, 3, 4, 4, 3, Block.netherFence.blockID, Block.netherFence.blockID, false); +- this.fillWithBlocks(var1, var3, 0, 6, 0, 4, 6, 4, Block.netherBrick.blockID, Block.netherBrick.blockID, false); +- +- for(int var4 = 0; var4 <= 4; ++var4) { +- for(int var5 = 0; var5 <= 4; ++var5) { +- this.fillCurrentPositionBlocksDownwards(var1, Block.netherBrick.blockID, 0, var4, -1, var5, var3); ++ public ComponentNetherBridgeCorridor5() {} ++ ++ public ComponentNetherBridgeCorridor5(int par1, Random par2Random, StructureBoundingBox par3StructureBoundingBox, int par4) { ++ super(par1); ++ this.coordBaseMode = par4; ++ this.boundingBox = par3StructureBoundingBox; ++ } ++ ++ /** ++ * Initiates construction of the Structure Component picked, at the current Location of StructGen ++ */ ++ public void buildComponent(StructureComponent par1StructureComponent, List par2List, Random par3Random) { ++ this.getNextComponentNormal((ComponentNetherBridgeStartPiece)par1StructureComponent, par2List, par3Random, 1, 0, true); ++ } ++ ++ /** ++ * Creates and returns a new component piece. Or null if it could not find enough room to place it. ++ */ ++ public static ComponentNetherBridgeCorridor5 createValidComponent(List par0List, Random par1Random, int par2, int par3, int par4, int par5, int par6) { ++ StructureBoundingBox var7 = StructureBoundingBox.getComponentToAddBoundingBox(par2, par3, par4, -1, 0, 0, 5, 7, 5, par5); ++ return isAboveGround(var7) && StructureComponent.findIntersecting(par0List, var7) == null ? new ComponentNetherBridgeCorridor5(par6, par1Random, var7, par5) : null; ++ } ++ ++ /** ++ * second Part of Structure generating, this for example places Spiderwebs, Mob Spawners, it closes Mineshafts at the ++ * end, it adds Fences... ++ */ ++ public boolean addComponentParts(World par1World, Random par2Random, StructureBoundingBox par3StructureBoundingBox) { ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 0, 0, 0, 4, 1, 4, Block.netherBrick.blockID, Block.netherBrick.blockID, false); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 0, 2, 0, 4, 5, 4, 0, 0, false); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 0, 2, 0, 0, 5, 4, Block.netherBrick.blockID, Block.netherBrick.blockID, false); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 4, 2, 0, 4, 5, 4, Block.netherBrick.blockID, Block.netherBrick.blockID, false); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 0, 3, 1, 0, 4, 1, Block.netherFence.blockID, Block.netherFence.blockID, false); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 0, 3, 3, 0, 4, 3, Block.netherFence.blockID, Block.netherFence.blockID, false); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 4, 3, 1, 4, 4, 1, Block.netherFence.blockID, Block.netherFence.blockID, false); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 4, 3, 3, 4, 4, 3, Block.netherFence.blockID, Block.netherFence.blockID, false); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 0, 6, 0, 4, 6, 4, Block.netherBrick.blockID, Block.netherBrick.blockID, false); ++ ++ for (int var4 = 0; var4 <= 4; ++var4) { ++ for (int var5 = 0; var5 <= 4; ++var5) { ++ this.fillCurrentPositionBlocksDownwards(par1World, Block.netherBrick.blockID, 0, var4, -1, var5, par3StructureBoundingBox); + } + } + diff --git a/patches/net/minecraft/src/ComponentNetherBridgeCrossing.java.patch b/patches/net/minecraft/src/ComponentNetherBridgeCrossing.java.patch new file mode 100644 index 0000000..eb3dc3d --- /dev/null +++ b/patches/net/minecraft/src/ComponentNetherBridgeCrossing.java.patch @@ -0,0 +1,104 @@ +--- net/minecraft/src/ComponentNetherBridgeCrossing.java ++++ net/minecraft/src/ComponentNetherBridgeCrossing.java +@@ -4,49 +4,58 @@ + import java.util.Random; + + public class ComponentNetherBridgeCrossing extends ComponentNetherBridgePiece { +- public ComponentNetherBridgeCrossing() { +- } +- +- public ComponentNetherBridgeCrossing(int var1, Random var2, StructureBoundingBox var3, int var4) { +- super(var1); +- this.coordBaseMode = var4; +- this.boundingBox = var3; +- } +- +- public void buildComponent(StructureComponent var1, List var2, Random var3) { +- this.getNextComponentNormal((ComponentNetherBridgeStartPiece)var1, var2, var3, 2, 0, false); +- this.getNextComponentX((ComponentNetherBridgeStartPiece)var1, var2, var3, 0, 2, false); +- this.getNextComponentZ((ComponentNetherBridgeStartPiece)var1, var2, var3, 0, 2, false); +- } +- +- public static ComponentNetherBridgeCrossing createValidComponent(List var0, Random var1, int var2, int var3, int var4, int var5, int var6) { +- StructureBoundingBox var7 = StructureBoundingBox.getComponentToAddBoundingBox(var2, var3, var4, -2, 0, 0, 7, 9, 7, var5); +- return isAboveGround(var7) && StructureComponent.findIntersecting(var0, var7) == null ? new ComponentNetherBridgeCrossing(var6, var1, var7, var5) : null; +- } +- +- public boolean addComponentParts(World var1, Random var2, StructureBoundingBox var3) { +- this.fillWithBlocks(var1, var3, 0, 0, 0, 6, 1, 6, Block.netherBrick.blockID, Block.netherBrick.blockID, false); +- this.fillWithBlocks(var1, var3, 0, 2, 0, 6, 7, 6, 0, 0, false); +- this.fillWithBlocks(var1, var3, 0, 2, 0, 1, 6, 0, Block.netherBrick.blockID, Block.netherBrick.blockID, false); +- this.fillWithBlocks(var1, var3, 0, 2, 6, 1, 6, 6, Block.netherBrick.blockID, Block.netherBrick.blockID, false); +- this.fillWithBlocks(var1, var3, 5, 2, 0, 6, 6, 0, Block.netherBrick.blockID, Block.netherBrick.blockID, false); +- this.fillWithBlocks(var1, var3, 5, 2, 6, 6, 6, 6, Block.netherBrick.blockID, Block.netherBrick.blockID, false); +- this.fillWithBlocks(var1, var3, 0, 2, 0, 0, 6, 1, Block.netherBrick.blockID, Block.netherBrick.blockID, false); +- this.fillWithBlocks(var1, var3, 0, 2, 5, 0, 6, 6, Block.netherBrick.blockID, Block.netherBrick.blockID, false); +- this.fillWithBlocks(var1, var3, 6, 2, 0, 6, 6, 1, Block.netherBrick.blockID, Block.netherBrick.blockID, false); +- this.fillWithBlocks(var1, var3, 6, 2, 5, 6, 6, 6, Block.netherBrick.blockID, Block.netherBrick.blockID, false); +- this.fillWithBlocks(var1, var3, 2, 6, 0, 4, 6, 0, Block.netherBrick.blockID, Block.netherBrick.blockID, false); +- this.fillWithBlocks(var1, var3, 2, 5, 0, 4, 5, 0, Block.netherFence.blockID, Block.netherFence.blockID, false); +- this.fillWithBlocks(var1, var3, 2, 6, 6, 4, 6, 6, Block.netherBrick.blockID, Block.netherBrick.blockID, false); +- this.fillWithBlocks(var1, var3, 2, 5, 6, 4, 5, 6, Block.netherFence.blockID, Block.netherFence.blockID, false); +- this.fillWithBlocks(var1, var3, 0, 6, 2, 0, 6, 4, Block.netherBrick.blockID, Block.netherBrick.blockID, false); +- this.fillWithBlocks(var1, var3, 0, 5, 2, 0, 5, 4, Block.netherFence.blockID, Block.netherFence.blockID, false); +- this.fillWithBlocks(var1, var3, 6, 6, 2, 6, 6, 4, Block.netherBrick.blockID, Block.netherBrick.blockID, false); +- this.fillWithBlocks(var1, var3, 6, 5, 2, 6, 5, 4, Block.netherFence.blockID, Block.netherFence.blockID, false); +- +- for(int var4 = 0; var4 <= 6; ++var4) { +- for(int var5 = 0; var5 <= 6; ++var5) { +- this.fillCurrentPositionBlocksDownwards(var1, Block.netherBrick.blockID, 0, var4, -1, var5, var3); ++ public ComponentNetherBridgeCrossing() {} ++ ++ public ComponentNetherBridgeCrossing(int par1, Random par2Random, StructureBoundingBox par3StructureBoundingBox, int par4) { ++ super(par1); ++ this.coordBaseMode = par4; ++ this.boundingBox = par3StructureBoundingBox; ++ } ++ ++ /** ++ * Initiates construction of the Structure Component picked, at the current Location of StructGen ++ */ ++ public void buildComponent(StructureComponent par1StructureComponent, List par2List, Random par3Random) { ++ this.getNextComponentNormal((ComponentNetherBridgeStartPiece)par1StructureComponent, par2List, par3Random, 2, 0, false); ++ this.getNextComponentX((ComponentNetherBridgeStartPiece)par1StructureComponent, par2List, par3Random, 0, 2, false); ++ this.getNextComponentZ((ComponentNetherBridgeStartPiece)par1StructureComponent, par2List, par3Random, 0, 2, false); ++ } ++ ++ /** ++ * Creates and returns a new component piece. Or null if it could not find enough room to place it. ++ */ ++ public static ComponentNetherBridgeCrossing createValidComponent(List par0List, Random par1Random, int par2, int par3, int par4, int par5, int par6) { ++ StructureBoundingBox var7 = StructureBoundingBox.getComponentToAddBoundingBox(par2, par3, par4, -2, 0, 0, 7, 9, 7, par5); ++ return isAboveGround(var7) && StructureComponent.findIntersecting(par0List, var7) == null ? new ComponentNetherBridgeCrossing(par6, par1Random, var7, par5) : null; ++ } ++ ++ /** ++ * second Part of Structure generating, this for example places Spiderwebs, Mob Spawners, it closes Mineshafts at the ++ * end, it adds Fences... ++ */ ++ public boolean addComponentParts(World par1World, Random par2Random, StructureBoundingBox par3StructureBoundingBox) { ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 0, 0, 0, 6, 1, 6, Block.netherBrick.blockID, Block.netherBrick.blockID, false); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 0, 2, 0, 6, 7, 6, 0, 0, false); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 0, 2, 0, 1, 6, 0, Block.netherBrick.blockID, Block.netherBrick.blockID, false); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 0, 2, 6, 1, 6, 6, Block.netherBrick.blockID, Block.netherBrick.blockID, false); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 5, 2, 0, 6, 6, 0, Block.netherBrick.blockID, Block.netherBrick.blockID, false); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 5, 2, 6, 6, 6, 6, Block.netherBrick.blockID, Block.netherBrick.blockID, false); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 0, 2, 0, 0, 6, 1, Block.netherBrick.blockID, Block.netherBrick.blockID, false); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 0, 2, 5, 0, 6, 6, Block.netherBrick.blockID, Block.netherBrick.blockID, false); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 6, 2, 0, 6, 6, 1, Block.netherBrick.blockID, Block.netherBrick.blockID, false); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 6, 2, 5, 6, 6, 6, Block.netherBrick.blockID, Block.netherBrick.blockID, false); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 2, 6, 0, 4, 6, 0, Block.netherBrick.blockID, Block.netherBrick.blockID, false); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 2, 5, 0, 4, 5, 0, Block.netherFence.blockID, Block.netherFence.blockID, false); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 2, 6, 6, 4, 6, 6, Block.netherBrick.blockID, Block.netherBrick.blockID, false); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 2, 5, 6, 4, 5, 6, Block.netherFence.blockID, Block.netherFence.blockID, false); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 0, 6, 2, 0, 6, 4, Block.netherBrick.blockID, Block.netherBrick.blockID, false); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 0, 5, 2, 0, 5, 4, Block.netherFence.blockID, Block.netherFence.blockID, false); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 6, 6, 2, 6, 6, 4, Block.netherBrick.blockID, Block.netherBrick.blockID, false); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 6, 5, 2, 6, 5, 4, Block.netherFence.blockID, Block.netherFence.blockID, false); ++ ++ for (int var4 = 0; var4 <= 6; ++var4) { ++ for (int var5 = 0; var5 <= 6; ++var5) { ++ this.fillCurrentPositionBlocksDownwards(par1World, Block.netherBrick.blockID, 0, var4, -1, var5, par3StructureBoundingBox); + } + } + diff --git a/patches/net/minecraft/src/ComponentNetherBridgeCrossing2.java.patch b/patches/net/minecraft/src/ComponentNetherBridgeCrossing2.java.patch new file mode 100644 index 0000000..55c42ec --- /dev/null +++ b/patches/net/minecraft/src/ComponentNetherBridgeCrossing2.java.patch @@ -0,0 +1,82 @@ +--- net/minecraft/src/ComponentNetherBridgeCrossing2.java ++++ net/minecraft/src/ComponentNetherBridgeCrossing2.java +@@ -4,38 +4,47 @@ + import java.util.Random; + + public class ComponentNetherBridgeCrossing2 extends ComponentNetherBridgePiece { +- public ComponentNetherBridgeCrossing2() { +- } +- +- public ComponentNetherBridgeCrossing2(int var1, Random var2, StructureBoundingBox var3, int var4) { +- super(var1); +- this.coordBaseMode = var4; +- this.boundingBox = var3; +- } +- +- public void buildComponent(StructureComponent var1, List var2, Random var3) { +- this.getNextComponentNormal((ComponentNetherBridgeStartPiece)var1, var2, var3, 1, 0, true); +- this.getNextComponentX((ComponentNetherBridgeStartPiece)var1, var2, var3, 0, 1, true); +- this.getNextComponentZ((ComponentNetherBridgeStartPiece)var1, var2, var3, 0, 1, true); +- } +- +- public static ComponentNetherBridgeCrossing2 createValidComponent(List var0, Random var1, int var2, int var3, int var4, int var5, int var6) { +- StructureBoundingBox var7 = StructureBoundingBox.getComponentToAddBoundingBox(var2, var3, var4, -1, 0, 0, 5, 7, 5, var5); +- return isAboveGround(var7) && StructureComponent.findIntersecting(var0, var7) == null ? new ComponentNetherBridgeCrossing2(var6, var1, var7, var5) : null; +- } +- +- public boolean addComponentParts(World var1, Random var2, StructureBoundingBox var3) { +- this.fillWithBlocks(var1, var3, 0, 0, 0, 4, 1, 4, Block.netherBrick.blockID, Block.netherBrick.blockID, false); +- this.fillWithBlocks(var1, var3, 0, 2, 0, 4, 5, 4, 0, 0, false); +- this.fillWithBlocks(var1, var3, 0, 2, 0, 0, 5, 0, Block.netherBrick.blockID, Block.netherBrick.blockID, false); +- this.fillWithBlocks(var1, var3, 4, 2, 0, 4, 5, 0, Block.netherBrick.blockID, Block.netherBrick.blockID, false); +- this.fillWithBlocks(var1, var3, 0, 2, 4, 0, 5, 4, Block.netherBrick.blockID, Block.netherBrick.blockID, false); +- this.fillWithBlocks(var1, var3, 4, 2, 4, 4, 5, 4, Block.netherBrick.blockID, Block.netherBrick.blockID, false); +- this.fillWithBlocks(var1, var3, 0, 6, 0, 4, 6, 4, Block.netherBrick.blockID, Block.netherBrick.blockID, false); +- +- for(int var4 = 0; var4 <= 4; ++var4) { +- for(int var5 = 0; var5 <= 4; ++var5) { +- this.fillCurrentPositionBlocksDownwards(var1, Block.netherBrick.blockID, 0, var4, -1, var5, var3); ++ public ComponentNetherBridgeCrossing2() {} ++ ++ public ComponentNetherBridgeCrossing2(int par1, Random par2Random, StructureBoundingBox par3StructureBoundingBox, int par4) { ++ super(par1); ++ this.coordBaseMode = par4; ++ this.boundingBox = par3StructureBoundingBox; ++ } ++ ++ /** ++ * Initiates construction of the Structure Component picked, at the current Location of StructGen ++ */ ++ public void buildComponent(StructureComponent par1StructureComponent, List par2List, Random par3Random) { ++ this.getNextComponentNormal((ComponentNetherBridgeStartPiece)par1StructureComponent, par2List, par3Random, 1, 0, true); ++ this.getNextComponentX((ComponentNetherBridgeStartPiece)par1StructureComponent, par2List, par3Random, 0, 1, true); ++ this.getNextComponentZ((ComponentNetherBridgeStartPiece)par1StructureComponent, par2List, par3Random, 0, 1, true); ++ } ++ ++ /** ++ * Creates and returns a new component piece. Or null if it could not find enough room to place it. ++ */ ++ public static ComponentNetherBridgeCrossing2 createValidComponent(List par0List, Random par1Random, int par2, int par3, int par4, int par5, int par6) { ++ StructureBoundingBox var7 = StructureBoundingBox.getComponentToAddBoundingBox(par2, par3, par4, -1, 0, 0, 5, 7, 5, par5); ++ return isAboveGround(var7) && StructureComponent.findIntersecting(par0List, var7) == null ? new ComponentNetherBridgeCrossing2(par6, par1Random, var7, par5) : null; ++ } ++ ++ /** ++ * second Part of Structure generating, this for example places Spiderwebs, Mob Spawners, it closes Mineshafts at the ++ * end, it adds Fences... ++ */ ++ public boolean addComponentParts(World par1World, Random par2Random, StructureBoundingBox par3StructureBoundingBox) { ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 0, 0, 0, 4, 1, 4, Block.netherBrick.blockID, Block.netherBrick.blockID, false); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 0, 2, 0, 4, 5, 4, 0, 0, false); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 0, 2, 0, 0, 5, 0, Block.netherBrick.blockID, Block.netherBrick.blockID, false); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 4, 2, 0, 4, 5, 0, Block.netherBrick.blockID, Block.netherBrick.blockID, false); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 0, 2, 4, 0, 5, 4, Block.netherBrick.blockID, Block.netherBrick.blockID, false); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 4, 2, 4, 4, 5, 4, Block.netherBrick.blockID, Block.netherBrick.blockID, false); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 0, 6, 0, 4, 6, 4, Block.netherBrick.blockID, Block.netherBrick.blockID, false); ++ ++ for (int var4 = 0; var4 <= 4; ++var4) { ++ for (int var5 = 0; var5 <= 4; ++var5) { ++ this.fillCurrentPositionBlocksDownwards(par1World, Block.netherBrick.blockID, 0, var4, -1, var5, par3StructureBoundingBox); + } + } + diff --git a/patches/net/minecraft/src/ComponentNetherBridgeCrossing3.java.patch b/patches/net/minecraft/src/ComponentNetherBridgeCrossing3.java.patch new file mode 100644 index 0000000..f6005bb --- /dev/null +++ b/patches/net/minecraft/src/ComponentNetherBridgeCrossing3.java.patch @@ -0,0 +1,151 @@ +--- net/minecraft/src/ComponentNetherBridgeCrossing3.java ++++ net/minecraft/src/ComponentNetherBridgeCrossing3.java +@@ -4,76 +4,86 @@ + import java.util.Random; + + public class ComponentNetherBridgeCrossing3 extends ComponentNetherBridgePiece { +- public ComponentNetherBridgeCrossing3() { +- } +- +- public ComponentNetherBridgeCrossing3(int var1, Random var2, StructureBoundingBox var3, int var4) { +- super(var1); +- this.coordBaseMode = var4; +- this.boundingBox = var3; +- } +- +- protected ComponentNetherBridgeCrossing3(Random var1, int var2, int var3) { ++ public ComponentNetherBridgeCrossing3() {} ++ ++ public ComponentNetherBridgeCrossing3(int par1, Random par2Random, StructureBoundingBox par3StructureBoundingBox, int par4) { ++ super(par1); ++ this.coordBaseMode = par4; ++ this.boundingBox = par3StructureBoundingBox; ++ } ++ ++ protected ComponentNetherBridgeCrossing3(Random par1Random, int par2, int par3) { + super(0); +- this.coordBaseMode = var1.nextInt(4); +- switch(this.coordBaseMode) { +- case 0: +- case 2: +- this.boundingBox = new StructureBoundingBox(var2, 64, var3, var2 + 19 - 1, 73, var3 + 19 - 1); +- break; +- default: +- this.boundingBox = new StructureBoundingBox(var2, 64, var3, var2 + 19 - 1, 73, var3 + 19 - 1); ++ this.coordBaseMode = par1Random.nextInt(4); ++ ++ switch (this.coordBaseMode) { ++ case 0: ++ case 2: ++ this.boundingBox = new StructureBoundingBox(par2, 64, par3, par2 + 19 - 1, 73, par3 + 19 - 1); ++ break; ++ ++ default: ++ this.boundingBox = new StructureBoundingBox(par2, 64, par3, par2 + 19 - 1, 73, par3 + 19 - 1); + } +- +- } +- +- public void buildComponent(StructureComponent var1, List var2, Random var3) { +- this.getNextComponentNormal((ComponentNetherBridgeStartPiece)var1, var2, var3, 8, 3, false); +- this.getNextComponentX((ComponentNetherBridgeStartPiece)var1, var2, var3, 3, 8, false); +- this.getNextComponentZ((ComponentNetherBridgeStartPiece)var1, var2, var3, 3, 8, false); +- } +- +- public static ComponentNetherBridgeCrossing3 createValidComponent(List var0, Random var1, int var2, int var3, int var4, int var5, int var6) { +- StructureBoundingBox var7 = StructureBoundingBox.getComponentToAddBoundingBox(var2, var3, var4, -8, -3, 0, 19, 10, 19, var5); +- return isAboveGround(var7) && StructureComponent.findIntersecting(var0, var7) == null ? new ComponentNetherBridgeCrossing3(var6, var1, var7, var5) : null; +- } +- +- public boolean addComponentParts(World var1, Random var2, StructureBoundingBox var3) { +- this.fillWithBlocks(var1, var3, 7, 3, 0, 11, 4, 18, Block.netherBrick.blockID, Block.netherBrick.blockID, false); +- this.fillWithBlocks(var1, var3, 0, 3, 7, 18, 4, 11, Block.netherBrick.blockID, Block.netherBrick.blockID, false); +- this.fillWithBlocks(var1, var3, 8, 5, 0, 10, 7, 18, 0, 0, false); +- this.fillWithBlocks(var1, var3, 0, 5, 8, 18, 7, 10, 0, 0, false); +- this.fillWithBlocks(var1, var3, 7, 5, 0, 7, 5, 7, Block.netherBrick.blockID, Block.netherBrick.blockID, false); +- this.fillWithBlocks(var1, var3, 7, 5, 11, 7, 5, 18, Block.netherBrick.blockID, Block.netherBrick.blockID, false); +- this.fillWithBlocks(var1, var3, 11, 5, 0, 11, 5, 7, Block.netherBrick.blockID, Block.netherBrick.blockID, false); +- this.fillWithBlocks(var1, var3, 11, 5, 11, 11, 5, 18, Block.netherBrick.blockID, Block.netherBrick.blockID, false); +- this.fillWithBlocks(var1, var3, 0, 5, 7, 7, 5, 7, Block.netherBrick.blockID, Block.netherBrick.blockID, false); +- this.fillWithBlocks(var1, var3, 11, 5, 7, 18, 5, 7, Block.netherBrick.blockID, Block.netherBrick.blockID, false); +- this.fillWithBlocks(var1, var3, 0, 5, 11, 7, 5, 11, Block.netherBrick.blockID, Block.netherBrick.blockID, false); +- this.fillWithBlocks(var1, var3, 11, 5, 11, 18, 5, 11, Block.netherBrick.blockID, Block.netherBrick.blockID, false); +- this.fillWithBlocks(var1, var3, 7, 2, 0, 11, 2, 5, Block.netherBrick.blockID, Block.netherBrick.blockID, false); +- this.fillWithBlocks(var1, var3, 7, 2, 13, 11, 2, 18, Block.netherBrick.blockID, Block.netherBrick.blockID, false); +- this.fillWithBlocks(var1, var3, 7, 0, 0, 11, 1, 3, Block.netherBrick.blockID, Block.netherBrick.blockID, false); +- this.fillWithBlocks(var1, var3, 7, 0, 15, 11, 1, 18, Block.netherBrick.blockID, Block.netherBrick.blockID, false); +- ++ } ++ ++ /** ++ * Initiates construction of the Structure Component picked, at the current Location of StructGen ++ */ ++ public void buildComponent(StructureComponent par1StructureComponent, List par2List, Random par3Random) { ++ this.getNextComponentNormal((ComponentNetherBridgeStartPiece)par1StructureComponent, par2List, par3Random, 8, 3, false); ++ this.getNextComponentX((ComponentNetherBridgeStartPiece)par1StructureComponent, par2List, par3Random, 3, 8, false); ++ this.getNextComponentZ((ComponentNetherBridgeStartPiece)par1StructureComponent, par2List, par3Random, 3, 8, false); ++ } ++ ++ /** ++ * Creates and returns a new component piece. Or null if it could not find enough room to place it. ++ */ ++ public static ComponentNetherBridgeCrossing3 createValidComponent(List par0List, Random par1Random, int par2, int par3, int par4, int par5, int par6) { ++ StructureBoundingBox var7 = StructureBoundingBox.getComponentToAddBoundingBox(par2, par3, par4, -8, -3, 0, 19, 10, 19, par5); ++ return isAboveGround(var7) && StructureComponent.findIntersecting(par0List, var7) == null ? new ComponentNetherBridgeCrossing3(par6, par1Random, var7, par5) : null; ++ } ++ ++ /** ++ * second Part of Structure generating, this for example places Spiderwebs, Mob Spawners, it closes Mineshafts at the ++ * end, it adds Fences... ++ */ ++ public boolean addComponentParts(World par1World, Random par2Random, StructureBoundingBox par3StructureBoundingBox) { ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 7, 3, 0, 11, 4, 18, Block.netherBrick.blockID, Block.netherBrick.blockID, false); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 0, 3, 7, 18, 4, 11, Block.netherBrick.blockID, Block.netherBrick.blockID, false); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 8, 5, 0, 10, 7, 18, 0, 0, false); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 0, 5, 8, 18, 7, 10, 0, 0, false); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 7, 5, 0, 7, 5, 7, Block.netherBrick.blockID, Block.netherBrick.blockID, false); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 7, 5, 11, 7, 5, 18, Block.netherBrick.blockID, Block.netherBrick.blockID, false); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 11, 5, 0, 11, 5, 7, Block.netherBrick.blockID, Block.netherBrick.blockID, false); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 11, 5, 11, 11, 5, 18, Block.netherBrick.blockID, Block.netherBrick.blockID, false); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 0, 5, 7, 7, 5, 7, Block.netherBrick.blockID, Block.netherBrick.blockID, false); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 11, 5, 7, 18, 5, 7, Block.netherBrick.blockID, Block.netherBrick.blockID, false); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 0, 5, 11, 7, 5, 11, Block.netherBrick.blockID, Block.netherBrick.blockID, false); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 11, 5, 11, 18, 5, 11, Block.netherBrick.blockID, Block.netherBrick.blockID, false); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 7, 2, 0, 11, 2, 5, Block.netherBrick.blockID, Block.netherBrick.blockID, false); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 7, 2, 13, 11, 2, 18, Block.netherBrick.blockID, Block.netherBrick.blockID, false); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 7, 0, 0, 11, 1, 3, Block.netherBrick.blockID, Block.netherBrick.blockID, false); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 7, 0, 15, 11, 1, 18, Block.netherBrick.blockID, Block.netherBrick.blockID, false); + int var4; + int var5; +- for(var4 = 7; var4 <= 11; ++var4) { +- for(var5 = 0; var5 <= 2; ++var5) { +- this.fillCurrentPositionBlocksDownwards(var1, Block.netherBrick.blockID, 0, var4, -1, var5, var3); +- this.fillCurrentPositionBlocksDownwards(var1, Block.netherBrick.blockID, 0, var4, -1, 18 - var5, var3); ++ ++ for (var4 = 7; var4 <= 11; ++var4) { ++ for (var5 = 0; var5 <= 2; ++var5) { ++ this.fillCurrentPositionBlocksDownwards(par1World, Block.netherBrick.blockID, 0, var4, -1, var5, par3StructureBoundingBox); ++ this.fillCurrentPositionBlocksDownwards(par1World, Block.netherBrick.blockID, 0, var4, -1, 18 - var5, par3StructureBoundingBox); + } + } + +- this.fillWithBlocks(var1, var3, 0, 2, 7, 5, 2, 11, Block.netherBrick.blockID, Block.netherBrick.blockID, false); +- this.fillWithBlocks(var1, var3, 13, 2, 7, 18, 2, 11, Block.netherBrick.blockID, Block.netherBrick.blockID, false); +- this.fillWithBlocks(var1, var3, 0, 0, 7, 3, 1, 11, Block.netherBrick.blockID, Block.netherBrick.blockID, false); +- this.fillWithBlocks(var1, var3, 15, 0, 7, 18, 1, 11, Block.netherBrick.blockID, Block.netherBrick.blockID, false); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 0, 2, 7, 5, 2, 11, Block.netherBrick.blockID, Block.netherBrick.blockID, false); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 13, 2, 7, 18, 2, 11, Block.netherBrick.blockID, Block.netherBrick.blockID, false); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 0, 0, 7, 3, 1, 11, Block.netherBrick.blockID, Block.netherBrick.blockID, false); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 15, 0, 7, 18, 1, 11, Block.netherBrick.blockID, Block.netherBrick.blockID, false); + +- for(var4 = 0; var4 <= 2; ++var4) { +- for(var5 = 7; var5 <= 11; ++var5) { +- this.fillCurrentPositionBlocksDownwards(var1, Block.netherBrick.blockID, 0, var4, -1, var5, var3); +- this.fillCurrentPositionBlocksDownwards(var1, Block.netherBrick.blockID, 0, 18 - var4, -1, var5, var3); ++ for (var4 = 0; var4 <= 2; ++var4) { ++ for (var5 = 7; var5 <= 11; ++var5) { ++ this.fillCurrentPositionBlocksDownwards(par1World, Block.netherBrick.blockID, 0, var4, -1, var5, par3StructureBoundingBox); ++ this.fillCurrentPositionBlocksDownwards(par1World, Block.netherBrick.blockID, 0, 18 - var4, -1, var5, par3StructureBoundingBox); + } + } + diff --git a/patches/net/minecraft/src/ComponentNetherBridgeEnd.java.patch b/patches/net/minecraft/src/ComponentNetherBridgeEnd.java.patch new file mode 100644 index 0000000..f36725f --- /dev/null +++ b/patches/net/minecraft/src/ComponentNetherBridgeEnd.java.patch @@ -0,0 +1,101 @@ +--- net/minecraft/src/ComponentNetherBridgeEnd.java ++++ net/minecraft/src/ComponentNetherBridgeEnd.java +@@ -6,58 +6,61 @@ + public class ComponentNetherBridgeEnd extends ComponentNetherBridgePiece { + private int fillSeed; + +- public ComponentNetherBridgeEnd() { +- } +- +- public ComponentNetherBridgeEnd(int var1, Random var2, StructureBoundingBox var3, int var4) { +- super(var1); +- this.coordBaseMode = var4; +- this.boundingBox = var3; +- this.fillSeed = var2.nextInt(); +- } +- +- public static ComponentNetherBridgeEnd func_74971_a(List var0, Random var1, int var2, int var3, int var4, int var5, int var6) { +- StructureBoundingBox var7 = StructureBoundingBox.getComponentToAddBoundingBox(var2, var3, var4, -1, -3, 0, 5, 10, 8, var5); +- return isAboveGround(var7) && StructureComponent.findIntersecting(var0, var7) == null ? new ComponentNetherBridgeEnd(var6, var1, var7, var5) : null; +- } +- +- protected void func_143011_b(NBTTagCompound var1) { +- super.func_143011_b(var1); +- this.fillSeed = var1.getInteger("Seed"); +- } +- +- protected void func_143012_a(NBTTagCompound var1) { +- super.func_143012_a(var1); +- var1.setInteger("Seed", this.fillSeed); +- } +- +- public boolean addComponentParts(World var1, Random var2, StructureBoundingBox var3) { ++ public ComponentNetherBridgeEnd() {} ++ ++ public ComponentNetherBridgeEnd(int par1, Random par2Random, StructureBoundingBox par3StructureBoundingBox, int par4) { ++ super(par1); ++ this.coordBaseMode = par4; ++ this.boundingBox = par3StructureBoundingBox; ++ this.fillSeed = par2Random.nextInt(); ++ } ++ ++ public static ComponentNetherBridgeEnd func_74971_a(List par0List, Random par1Random, int par2, int par3, int par4, int par5, int par6) { ++ StructureBoundingBox var7 = StructureBoundingBox.getComponentToAddBoundingBox(par2, par3, par4, -1, -3, 0, 5, 10, 8, par5); ++ return isAboveGround(var7) && StructureComponent.findIntersecting(par0List, var7) == null ? new ComponentNetherBridgeEnd(par6, par1Random, var7, par5) : null; ++ } ++ ++ protected void func_143011_b(NBTTagCompound par1NBTTagCompound) { ++ super.func_143011_b(par1NBTTagCompound); ++ this.fillSeed = par1NBTTagCompound.getInteger("Seed"); ++ } ++ ++ protected void func_143012_a(NBTTagCompound par1NBTTagCompound) { ++ super.func_143012_a(par1NBTTagCompound); ++ par1NBTTagCompound.setInteger("Seed", this.fillSeed); ++ } ++ ++ /** ++ * second Part of Structure generating, this for example places Spiderwebs, Mob Spawners, it closes Mineshafts at the ++ * end, it adds Fences... ++ */ ++ public boolean addComponentParts(World par1World, Random par2Random, StructureBoundingBox par3StructureBoundingBox) { + Random var4 = new Random((long)this.fillSeed); +- + int var5; + int var6; + int var7; +- for(var5 = 0; var5 <= 4; ++var5) { +- for(var6 = 3; var6 <= 4; ++var6) { ++ ++ for (var5 = 0; var5 <= 4; ++var5) { ++ for (var6 = 3; var6 <= 4; ++var6) { + var7 = var4.nextInt(8); +- this.fillWithBlocks(var1, var3, var5, var6, 0, var5, var6, var7, Block.netherBrick.blockID, Block.netherBrick.blockID, false); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, var5, var6, 0, var5, var6, var7, Block.netherBrick.blockID, Block.netherBrick.blockID, false); + } + } + + var5 = var4.nextInt(8); +- this.fillWithBlocks(var1, var3, 0, 5, 0, 0, 5, var5, Block.netherBrick.blockID, Block.netherBrick.blockID, false); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 0, 5, 0, 0, 5, var5, Block.netherBrick.blockID, Block.netherBrick.blockID, false); + var5 = var4.nextInt(8); +- this.fillWithBlocks(var1, var3, 4, 5, 0, 4, 5, var5, Block.netherBrick.blockID, Block.netherBrick.blockID, false); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 4, 5, 0, 4, 5, var5, Block.netherBrick.blockID, Block.netherBrick.blockID, false); + +- for(var5 = 0; var5 <= 4; ++var5) { ++ for (var5 = 0; var5 <= 4; ++var5) { + var6 = var4.nextInt(5); +- this.fillWithBlocks(var1, var3, var5, 2, 0, var5, 2, var6, Block.netherBrick.blockID, Block.netherBrick.blockID, false); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, var5, 2, 0, var5, 2, var6, Block.netherBrick.blockID, Block.netherBrick.blockID, false); + } + +- for(var5 = 0; var5 <= 4; ++var5) { +- for(var6 = 0; var6 <= 1; ++var6) { ++ for (var5 = 0; var5 <= 4; ++var5) { ++ for (var6 = 0; var6 <= 1; ++var6) { + var7 = var4.nextInt(3); +- this.fillWithBlocks(var1, var3, var5, var6, 0, var5, var6, var7, Block.netherBrick.blockID, Block.netherBrick.blockID, false); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, var5, var6, 0, var5, var6, var7, Block.netherBrick.blockID, Block.netherBrick.blockID, false); + } + } + diff --git a/patches/net/minecraft/src/ComponentNetherBridgeEntrance.java.patch b/patches/net/minecraft/src/ComponentNetherBridgeEntrance.java.patch new file mode 100644 index 0000000..0370e80 --- /dev/null +++ b/patches/net/minecraft/src/ComponentNetherBridgeEntrance.java.patch @@ -0,0 +1,196 @@ +--- net/minecraft/src/ComponentNetherBridgeEntrance.java ++++ net/minecraft/src/ComponentNetherBridgeEntrance.java +@@ -4,97 +4,107 @@ + import java.util.Random; + + public class ComponentNetherBridgeEntrance extends ComponentNetherBridgePiece { +- public ComponentNetherBridgeEntrance() { +- } +- +- public ComponentNetherBridgeEntrance(int var1, Random var2, StructureBoundingBox var3, int var4) { +- super(var1); +- this.coordBaseMode = var4; +- this.boundingBox = var3; +- } +- +- public void buildComponent(StructureComponent var1, List var2, Random var3) { +- this.getNextComponentNormal((ComponentNetherBridgeStartPiece)var1, var2, var3, 5, 3, true); +- } +- +- public static ComponentNetherBridgeEntrance createValidComponent(List var0, Random var1, int var2, int var3, int var4, int var5, int var6) { +- StructureBoundingBox var7 = StructureBoundingBox.getComponentToAddBoundingBox(var2, var3, var4, -5, -3, 0, 13, 14, 13, var5); +- return isAboveGround(var7) && StructureComponent.findIntersecting(var0, var7) == null ? new ComponentNetherBridgeEntrance(var6, var1, var7, var5) : null; +- } +- +- public boolean addComponentParts(World var1, Random var2, StructureBoundingBox var3) { +- this.fillWithBlocks(var1, var3, 0, 3, 0, 12, 4, 12, Block.netherBrick.blockID, Block.netherBrick.blockID, false); +- this.fillWithBlocks(var1, var3, 0, 5, 0, 12, 13, 12, 0, 0, false); +- this.fillWithBlocks(var1, var3, 0, 5, 0, 1, 12, 12, Block.netherBrick.blockID, Block.netherBrick.blockID, false); +- this.fillWithBlocks(var1, var3, 11, 5, 0, 12, 12, 12, Block.netherBrick.blockID, Block.netherBrick.blockID, false); +- this.fillWithBlocks(var1, var3, 2, 5, 11, 4, 12, 12, Block.netherBrick.blockID, Block.netherBrick.blockID, false); +- this.fillWithBlocks(var1, var3, 8, 5, 11, 10, 12, 12, Block.netherBrick.blockID, Block.netherBrick.blockID, false); +- this.fillWithBlocks(var1, var3, 5, 9, 11, 7, 12, 12, Block.netherBrick.blockID, Block.netherBrick.blockID, false); +- this.fillWithBlocks(var1, var3, 2, 5, 0, 4, 12, 1, Block.netherBrick.blockID, Block.netherBrick.blockID, false); +- this.fillWithBlocks(var1, var3, 8, 5, 0, 10, 12, 1, Block.netherBrick.blockID, Block.netherBrick.blockID, false); +- this.fillWithBlocks(var1, var3, 5, 9, 0, 7, 12, 1, Block.netherBrick.blockID, Block.netherBrick.blockID, false); +- this.fillWithBlocks(var1, var3, 2, 11, 2, 10, 12, 10, Block.netherBrick.blockID, Block.netherBrick.blockID, false); +- this.fillWithBlocks(var1, var3, 5, 8, 0, 7, 8, 0, Block.netherFence.blockID, Block.netherFence.blockID, false); +- ++ public ComponentNetherBridgeEntrance() {} ++ ++ public ComponentNetherBridgeEntrance(int par1, Random par2Random, StructureBoundingBox par3StructureBoundingBox, int par4) { ++ super(par1); ++ this.coordBaseMode = par4; ++ this.boundingBox = par3StructureBoundingBox; ++ } ++ ++ /** ++ * Initiates construction of the Structure Component picked, at the current Location of StructGen ++ */ ++ public void buildComponent(StructureComponent par1StructureComponent, List par2List, Random par3Random) { ++ this.getNextComponentNormal((ComponentNetherBridgeStartPiece)par1StructureComponent, par2List, par3Random, 5, 3, true); ++ } ++ ++ /** ++ * Creates and returns a new component piece. Or null if it could not find enough room to place it. ++ */ ++ public static ComponentNetherBridgeEntrance createValidComponent(List par0List, Random par1Random, int par2, int par3, int par4, int par5, int par6) { ++ StructureBoundingBox var7 = StructureBoundingBox.getComponentToAddBoundingBox(par2, par3, par4, -5, -3, 0, 13, 14, 13, par5); ++ return isAboveGround(var7) && StructureComponent.findIntersecting(par0List, var7) == null ? new ComponentNetherBridgeEntrance(par6, par1Random, var7, par5) : null; ++ } ++ ++ /** ++ * second Part of Structure generating, this for example places Spiderwebs, Mob Spawners, it closes Mineshafts at the ++ * end, it adds Fences... ++ */ ++ public boolean addComponentParts(World par1World, Random par2Random, StructureBoundingBox par3StructureBoundingBox) { ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 0, 3, 0, 12, 4, 12, Block.netherBrick.blockID, Block.netherBrick.blockID, false); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 0, 5, 0, 12, 13, 12, 0, 0, false); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 0, 5, 0, 1, 12, 12, Block.netherBrick.blockID, Block.netherBrick.blockID, false); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 11, 5, 0, 12, 12, 12, Block.netherBrick.blockID, Block.netherBrick.blockID, false); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 2, 5, 11, 4, 12, 12, Block.netherBrick.blockID, Block.netherBrick.blockID, false); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 8, 5, 11, 10, 12, 12, Block.netherBrick.blockID, Block.netherBrick.blockID, false); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 5, 9, 11, 7, 12, 12, Block.netherBrick.blockID, Block.netherBrick.blockID, false); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 2, 5, 0, 4, 12, 1, Block.netherBrick.blockID, Block.netherBrick.blockID, false); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 8, 5, 0, 10, 12, 1, Block.netherBrick.blockID, Block.netherBrick.blockID, false); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 5, 9, 0, 7, 12, 1, Block.netherBrick.blockID, Block.netherBrick.blockID, false); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 2, 11, 2, 10, 12, 10, Block.netherBrick.blockID, Block.netherBrick.blockID, false); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 5, 8, 0, 7, 8, 0, Block.netherFence.blockID, Block.netherFence.blockID, false); + int var4; +- for(var4 = 1; var4 <= 11; var4 += 2) { +- this.fillWithBlocks(var1, var3, var4, 10, 0, var4, 11, 0, Block.netherFence.blockID, Block.netherFence.blockID, false); +- this.fillWithBlocks(var1, var3, var4, 10, 12, var4, 11, 12, Block.netherFence.blockID, Block.netherFence.blockID, false); +- this.fillWithBlocks(var1, var3, 0, 10, var4, 0, 11, var4, Block.netherFence.blockID, Block.netherFence.blockID, false); +- this.fillWithBlocks(var1, var3, 12, 10, var4, 12, 11, var4, Block.netherFence.blockID, Block.netherFence.blockID, false); +- this.placeBlockAtCurrentPosition(var1, Block.netherBrick.blockID, 0, var4, 13, 0, var3); +- this.placeBlockAtCurrentPosition(var1, Block.netherBrick.blockID, 0, var4, 13, 12, var3); +- this.placeBlockAtCurrentPosition(var1, Block.netherBrick.blockID, 0, 0, 13, var4, var3); +- this.placeBlockAtCurrentPosition(var1, Block.netherBrick.blockID, 0, 12, 13, var4, var3); +- this.placeBlockAtCurrentPosition(var1, Block.netherFence.blockID, 0, var4 + 1, 13, 0, var3); +- this.placeBlockAtCurrentPosition(var1, Block.netherFence.blockID, 0, var4 + 1, 13, 12, var3); +- this.placeBlockAtCurrentPosition(var1, Block.netherFence.blockID, 0, 0, 13, var4 + 1, var3); +- this.placeBlockAtCurrentPosition(var1, Block.netherFence.blockID, 0, 12, 13, var4 + 1, var3); +- } +- +- this.placeBlockAtCurrentPosition(var1, Block.netherFence.blockID, 0, 0, 13, 0, var3); +- this.placeBlockAtCurrentPosition(var1, Block.netherFence.blockID, 0, 0, 13, 12, var3); +- this.placeBlockAtCurrentPosition(var1, Block.netherFence.blockID, 0, 0, 13, 0, var3); +- this.placeBlockAtCurrentPosition(var1, Block.netherFence.blockID, 0, 12, 13, 0, var3); +- +- for(var4 = 3; var4 <= 9; var4 += 2) { +- this.fillWithBlocks(var1, var3, 1, 7, var4, 1, 8, var4, Block.netherFence.blockID, Block.netherFence.blockID, false); +- this.fillWithBlocks(var1, var3, 11, 7, var4, 11, 8, var4, Block.netherFence.blockID, Block.netherFence.blockID, false); +- } +- +- this.fillWithBlocks(var1, var3, 4, 2, 0, 8, 2, 12, Block.netherBrick.blockID, Block.netherBrick.blockID, false); +- this.fillWithBlocks(var1, var3, 0, 2, 4, 12, 2, 8, Block.netherBrick.blockID, Block.netherBrick.blockID, false); +- this.fillWithBlocks(var1, var3, 4, 0, 0, 8, 1, 3, Block.netherBrick.blockID, Block.netherBrick.blockID, false); +- this.fillWithBlocks(var1, var3, 4, 0, 9, 8, 1, 12, Block.netherBrick.blockID, Block.netherBrick.blockID, false); +- this.fillWithBlocks(var1, var3, 0, 0, 4, 3, 1, 8, Block.netherBrick.blockID, Block.netherBrick.blockID, false); +- this.fillWithBlocks(var1, var3, 9, 0, 4, 12, 1, 8, Block.netherBrick.blockID, Block.netherBrick.blockID, false); +- ++ ++ for (var4 = 1; var4 <= 11; var4 += 2) { ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, var4, 10, 0, var4, 11, 0, Block.netherFence.blockID, Block.netherFence.blockID, false); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, var4, 10, 12, var4, 11, 12, Block.netherFence.blockID, Block.netherFence.blockID, false); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 0, 10, var4, 0, 11, var4, Block.netherFence.blockID, Block.netherFence.blockID, false); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 12, 10, var4, 12, 11, var4, Block.netherFence.blockID, Block.netherFence.blockID, false); ++ this.placeBlockAtCurrentPosition(par1World, Block.netherBrick.blockID, 0, var4, 13, 0, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.netherBrick.blockID, 0, var4, 13, 12, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.netherBrick.blockID, 0, 0, 13, var4, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.netherBrick.blockID, 0, 12, 13, var4, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.netherFence.blockID, 0, var4 + 1, 13, 0, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.netherFence.blockID, 0, var4 + 1, 13, 12, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.netherFence.blockID, 0, 0, 13, var4 + 1, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.netherFence.blockID, 0, 12, 13, var4 + 1, par3StructureBoundingBox); ++ } ++ ++ this.placeBlockAtCurrentPosition(par1World, Block.netherFence.blockID, 0, 0, 13, 0, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.netherFence.blockID, 0, 0, 13, 12, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.netherFence.blockID, 0, 0, 13, 0, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.netherFence.blockID, 0, 12, 13, 0, par3StructureBoundingBox); ++ ++ for (var4 = 3; var4 <= 9; var4 += 2) { ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 1, 7, var4, 1, 8, var4, Block.netherFence.blockID, Block.netherFence.blockID, false); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 11, 7, var4, 11, 8, var4, Block.netherFence.blockID, Block.netherFence.blockID, false); ++ } ++ ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 4, 2, 0, 8, 2, 12, Block.netherBrick.blockID, Block.netherBrick.blockID, false); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 0, 2, 4, 12, 2, 8, Block.netherBrick.blockID, Block.netherBrick.blockID, false); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 4, 0, 0, 8, 1, 3, Block.netherBrick.blockID, Block.netherBrick.blockID, false); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 4, 0, 9, 8, 1, 12, Block.netherBrick.blockID, Block.netherBrick.blockID, false); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 0, 0, 4, 3, 1, 8, Block.netherBrick.blockID, Block.netherBrick.blockID, false); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 9, 0, 4, 12, 1, 8, Block.netherBrick.blockID, Block.netherBrick.blockID, false); + int var5; +- for(var4 = 4; var4 <= 8; ++var4) { +- for(var5 = 0; var5 <= 2; ++var5) { +- this.fillCurrentPositionBlocksDownwards(var1, Block.netherBrick.blockID, 0, var4, -1, var5, var3); +- this.fillCurrentPositionBlocksDownwards(var1, Block.netherBrick.blockID, 0, var4, -1, 12 - var5, var3); +- } +- } +- +- for(var4 = 0; var4 <= 2; ++var4) { +- for(var5 = 4; var5 <= 8; ++var5) { +- this.fillCurrentPositionBlocksDownwards(var1, Block.netherBrick.blockID, 0, var4, -1, var5, var3); +- this.fillCurrentPositionBlocksDownwards(var1, Block.netherBrick.blockID, 0, 12 - var4, -1, var5, var3); +- } +- } +- +- this.fillWithBlocks(var1, var3, 5, 5, 5, 7, 5, 7, Block.netherBrick.blockID, Block.netherBrick.blockID, false); +- this.fillWithBlocks(var1, var3, 6, 1, 6, 6, 4, 6, 0, 0, false); +- this.placeBlockAtCurrentPosition(var1, Block.netherBrick.blockID, 0, 6, 0, 6, var3); +- this.placeBlockAtCurrentPosition(var1, Block.lavaMoving.blockID, 0, 6, 5, 6, var3); ++ ++ for (var4 = 4; var4 <= 8; ++var4) { ++ for (var5 = 0; var5 <= 2; ++var5) { ++ this.fillCurrentPositionBlocksDownwards(par1World, Block.netherBrick.blockID, 0, var4, -1, var5, par3StructureBoundingBox); ++ this.fillCurrentPositionBlocksDownwards(par1World, Block.netherBrick.blockID, 0, var4, -1, 12 - var5, par3StructureBoundingBox); ++ } ++ } ++ ++ for (var4 = 0; var4 <= 2; ++var4) { ++ for (var5 = 4; var5 <= 8; ++var5) { ++ this.fillCurrentPositionBlocksDownwards(par1World, Block.netherBrick.blockID, 0, var4, -1, var5, par3StructureBoundingBox); ++ this.fillCurrentPositionBlocksDownwards(par1World, Block.netherBrick.blockID, 0, 12 - var4, -1, var5, par3StructureBoundingBox); ++ } ++ } ++ ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 5, 5, 5, 7, 5, 7, Block.netherBrick.blockID, Block.netherBrick.blockID, false); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 6, 1, 6, 6, 4, 6, 0, 0, false); ++ this.placeBlockAtCurrentPosition(par1World, Block.netherBrick.blockID, 0, 6, 0, 6, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.lavaMoving.blockID, 0, 6, 5, 6, par3StructureBoundingBox); + var4 = this.getXWithOffset(6, 6); + var5 = this.getYWithOffset(5); + int var6 = this.getZWithOffset(6, 6); +- if(var3.isVecInside(var4, var5, var6)) { +- var1.scheduledUpdatesAreImmediate = true; +- Block.blocksList[Block.lavaMoving.blockID].updateTick(var1, var4, var5, var6, var2); +- var1.scheduledUpdatesAreImmediate = false; ++ ++ if (par3StructureBoundingBox.isVecInside(var4, var5, var6)) { ++ par1World.scheduledUpdatesAreImmediate = true; ++ Block.blocksList[Block.lavaMoving.blockID].updateTick(par1World, var4, var5, var6, par2Random); ++ par1World.scheduledUpdatesAreImmediate = false; + } + + return true; diff --git a/patches/net/minecraft/src/ComponentNetherBridgeNetherStalkRoom.java.patch b/patches/net/minecraft/src/ComponentNetherBridgeNetherStalkRoom.java.patch new file mode 100644 index 0000000..2f9d771 --- /dev/null +++ b/patches/net/minecraft/src/ComponentNetherBridgeNetherStalkRoom.java.patch @@ -0,0 +1,254 @@ +--- net/minecraft/src/ComponentNetherBridgeNetherStalkRoom.java ++++ net/minecraft/src/ComponentNetherBridgeNetherStalkRoom.java +@@ -4,133 +4,142 @@ + import java.util.Random; + + public class ComponentNetherBridgeNetherStalkRoom extends ComponentNetherBridgePiece { +- public ComponentNetherBridgeNetherStalkRoom() { +- } +- +- public ComponentNetherBridgeNetherStalkRoom(int var1, Random var2, StructureBoundingBox var3, int var4) { +- super(var1); +- this.coordBaseMode = var4; +- this.boundingBox = var3; +- } +- +- public void buildComponent(StructureComponent var1, List var2, Random var3) { +- this.getNextComponentNormal((ComponentNetherBridgeStartPiece)var1, var2, var3, 5, 3, true); +- this.getNextComponentNormal((ComponentNetherBridgeStartPiece)var1, var2, var3, 5, 11, true); +- } +- +- public static ComponentNetherBridgeNetherStalkRoom createValidComponent(List var0, Random var1, int var2, int var3, int var4, int var5, int var6) { +- StructureBoundingBox var7 = StructureBoundingBox.getComponentToAddBoundingBox(var2, var3, var4, -5, -3, 0, 13, 14, 13, var5); +- return isAboveGround(var7) && StructureComponent.findIntersecting(var0, var7) == null ? new ComponentNetherBridgeNetherStalkRoom(var6, var1, var7, var5) : null; +- } +- +- public boolean addComponentParts(World var1, Random var2, StructureBoundingBox var3) { +- this.fillWithBlocks(var1, var3, 0, 3, 0, 12, 4, 12, Block.netherBrick.blockID, Block.netherBrick.blockID, false); +- this.fillWithBlocks(var1, var3, 0, 5, 0, 12, 13, 12, 0, 0, false); +- this.fillWithBlocks(var1, var3, 0, 5, 0, 1, 12, 12, Block.netherBrick.blockID, Block.netherBrick.blockID, false); +- this.fillWithBlocks(var1, var3, 11, 5, 0, 12, 12, 12, Block.netherBrick.blockID, Block.netherBrick.blockID, false); +- this.fillWithBlocks(var1, var3, 2, 5, 11, 4, 12, 12, Block.netherBrick.blockID, Block.netherBrick.blockID, false); +- this.fillWithBlocks(var1, var3, 8, 5, 11, 10, 12, 12, Block.netherBrick.blockID, Block.netherBrick.blockID, false); +- this.fillWithBlocks(var1, var3, 5, 9, 11, 7, 12, 12, Block.netherBrick.blockID, Block.netherBrick.blockID, false); +- this.fillWithBlocks(var1, var3, 2, 5, 0, 4, 12, 1, Block.netherBrick.blockID, Block.netherBrick.blockID, false); +- this.fillWithBlocks(var1, var3, 8, 5, 0, 10, 12, 1, Block.netherBrick.blockID, Block.netherBrick.blockID, false); +- this.fillWithBlocks(var1, var3, 5, 9, 0, 7, 12, 1, Block.netherBrick.blockID, Block.netherBrick.blockID, false); +- this.fillWithBlocks(var1, var3, 2, 11, 2, 10, 12, 10, Block.netherBrick.blockID, Block.netherBrick.blockID, false); +- ++ public ComponentNetherBridgeNetherStalkRoom() {} ++ ++ public ComponentNetherBridgeNetherStalkRoom(int par1, Random par2Random, StructureBoundingBox par3StructureBoundingBox, int par4) { ++ super(par1); ++ this.coordBaseMode = par4; ++ this.boundingBox = par3StructureBoundingBox; ++ } ++ ++ /** ++ * Initiates construction of the Structure Component picked, at the current Location of StructGen ++ */ ++ public void buildComponent(StructureComponent par1StructureComponent, List par2List, Random par3Random) { ++ this.getNextComponentNormal((ComponentNetherBridgeStartPiece)par1StructureComponent, par2List, par3Random, 5, 3, true); ++ this.getNextComponentNormal((ComponentNetherBridgeStartPiece)par1StructureComponent, par2List, par3Random, 5, 11, true); ++ } ++ ++ /** ++ * Creates and returns a new component piece. Or null if it could not find enough room to place it. ++ */ ++ public static ComponentNetherBridgeNetherStalkRoom createValidComponent(List par0List, Random par1Random, int par2, int par3, int par4, int par5, int par6) { ++ StructureBoundingBox var7 = StructureBoundingBox.getComponentToAddBoundingBox(par2, par3, par4, -5, -3, 0, 13, 14, 13, par5); ++ return isAboveGround(var7) && StructureComponent.findIntersecting(par0List, var7) == null ? new ComponentNetherBridgeNetherStalkRoom(par6, par1Random, var7, par5) : null; ++ } ++ ++ /** ++ * second Part of Structure generating, this for example places Spiderwebs, Mob Spawners, it closes Mineshafts at the ++ * end, it adds Fences... ++ */ ++ public boolean addComponentParts(World par1World, Random par2Random, StructureBoundingBox par3StructureBoundingBox) { ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 0, 3, 0, 12, 4, 12, Block.netherBrick.blockID, Block.netherBrick.blockID, false); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 0, 5, 0, 12, 13, 12, 0, 0, false); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 0, 5, 0, 1, 12, 12, Block.netherBrick.blockID, Block.netherBrick.blockID, false); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 11, 5, 0, 12, 12, 12, Block.netherBrick.blockID, Block.netherBrick.blockID, false); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 2, 5, 11, 4, 12, 12, Block.netherBrick.blockID, Block.netherBrick.blockID, false); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 8, 5, 11, 10, 12, 12, Block.netherBrick.blockID, Block.netherBrick.blockID, false); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 5, 9, 11, 7, 12, 12, Block.netherBrick.blockID, Block.netherBrick.blockID, false); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 2, 5, 0, 4, 12, 1, Block.netherBrick.blockID, Block.netherBrick.blockID, false); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 8, 5, 0, 10, 12, 1, Block.netherBrick.blockID, Block.netherBrick.blockID, false); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 5, 9, 0, 7, 12, 1, Block.netherBrick.blockID, Block.netherBrick.blockID, false); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 2, 11, 2, 10, 12, 10, Block.netherBrick.blockID, Block.netherBrick.blockID, false); + int var4; +- for(var4 = 1; var4 <= 11; var4 += 2) { +- this.fillWithBlocks(var1, var3, var4, 10, 0, var4, 11, 0, Block.netherFence.blockID, Block.netherFence.blockID, false); +- this.fillWithBlocks(var1, var3, var4, 10, 12, var4, 11, 12, Block.netherFence.blockID, Block.netherFence.blockID, false); +- this.fillWithBlocks(var1, var3, 0, 10, var4, 0, 11, var4, Block.netherFence.blockID, Block.netherFence.blockID, false); +- this.fillWithBlocks(var1, var3, 12, 10, var4, 12, 11, var4, Block.netherFence.blockID, Block.netherFence.blockID, false); +- this.placeBlockAtCurrentPosition(var1, Block.netherBrick.blockID, 0, var4, 13, 0, var3); +- this.placeBlockAtCurrentPosition(var1, Block.netherBrick.blockID, 0, var4, 13, 12, var3); +- this.placeBlockAtCurrentPosition(var1, Block.netherBrick.blockID, 0, 0, 13, var4, var3); +- this.placeBlockAtCurrentPosition(var1, Block.netherBrick.blockID, 0, 12, 13, var4, var3); +- this.placeBlockAtCurrentPosition(var1, Block.netherFence.blockID, 0, var4 + 1, 13, 0, var3); +- this.placeBlockAtCurrentPosition(var1, Block.netherFence.blockID, 0, var4 + 1, 13, 12, var3); +- this.placeBlockAtCurrentPosition(var1, Block.netherFence.blockID, 0, 0, 13, var4 + 1, var3); +- this.placeBlockAtCurrentPosition(var1, Block.netherFence.blockID, 0, 12, 13, var4 + 1, var3); ++ ++ for (var4 = 1; var4 <= 11; var4 += 2) { ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, var4, 10, 0, var4, 11, 0, Block.netherFence.blockID, Block.netherFence.blockID, false); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, var4, 10, 12, var4, 11, 12, Block.netherFence.blockID, Block.netherFence.blockID, false); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 0, 10, var4, 0, 11, var4, Block.netherFence.blockID, Block.netherFence.blockID, false); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 12, 10, var4, 12, 11, var4, Block.netherFence.blockID, Block.netherFence.blockID, false); ++ this.placeBlockAtCurrentPosition(par1World, Block.netherBrick.blockID, 0, var4, 13, 0, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.netherBrick.blockID, 0, var4, 13, 12, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.netherBrick.blockID, 0, 0, 13, var4, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.netherBrick.blockID, 0, 12, 13, var4, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.netherFence.blockID, 0, var4 + 1, 13, 0, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.netherFence.blockID, 0, var4 + 1, 13, 12, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.netherFence.blockID, 0, 0, 13, var4 + 1, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.netherFence.blockID, 0, 12, 13, var4 + 1, par3StructureBoundingBox); + } + +- this.placeBlockAtCurrentPosition(var1, Block.netherFence.blockID, 0, 0, 13, 0, var3); +- this.placeBlockAtCurrentPosition(var1, Block.netherFence.blockID, 0, 0, 13, 12, var3); +- this.placeBlockAtCurrentPosition(var1, Block.netherFence.blockID, 0, 0, 13, 0, var3); +- this.placeBlockAtCurrentPosition(var1, Block.netherFence.blockID, 0, 12, 13, 0, var3); ++ this.placeBlockAtCurrentPosition(par1World, Block.netherFence.blockID, 0, 0, 13, 0, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.netherFence.blockID, 0, 0, 13, 12, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.netherFence.blockID, 0, 0, 13, 0, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.netherFence.blockID, 0, 12, 13, 0, par3StructureBoundingBox); + +- for(var4 = 3; var4 <= 9; var4 += 2) { +- this.fillWithBlocks(var1, var3, 1, 7, var4, 1, 8, var4, Block.netherFence.blockID, Block.netherFence.blockID, false); +- this.fillWithBlocks(var1, var3, 11, 7, var4, 11, 8, var4, Block.netherFence.blockID, Block.netherFence.blockID, false); ++ for (var4 = 3; var4 <= 9; var4 += 2) { ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 1, 7, var4, 1, 8, var4, Block.netherFence.blockID, Block.netherFence.blockID, false); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 11, 7, var4, 11, 8, var4, Block.netherFence.blockID, Block.netherFence.blockID, false); + } + + var4 = this.getMetadataWithOffset(Block.stairsNetherBrick.blockID, 3); +- + int var5; + int var6; + int var7; +- for(var5 = 0; var5 <= 6; ++var5) { ++ ++ for (var5 = 0; var5 <= 6; ++var5) { + var6 = var5 + 4; + +- for(var7 = 5; var7 <= 7; ++var7) { +- this.placeBlockAtCurrentPosition(var1, Block.stairsNetherBrick.blockID, var4, var7, 5 + var5, var6, var3); +- } +- +- if(var6 >= 5 && var6 <= 8) { +- this.fillWithBlocks(var1, var3, 5, 5, var6, 7, var5 + 4, var6, Block.netherBrick.blockID, Block.netherBrick.blockID, false); +- } else if(var6 >= 9 && var6 <= 10) { +- this.fillWithBlocks(var1, var3, 5, 8, var6, 7, var5 + 4, var6, Block.netherBrick.blockID, Block.netherBrick.blockID, false); +- } +- +- if(var5 >= 1) { +- this.fillWithBlocks(var1, var3, 5, 6 + var5, var6, 7, 9 + var5, var6, 0, 0, false); +- } +- } +- +- for(var5 = 5; var5 <= 7; ++var5) { +- this.placeBlockAtCurrentPosition(var1, Block.stairsNetherBrick.blockID, var4, var5, 12, 11, var3); +- } +- +- this.fillWithBlocks(var1, var3, 5, 6, 7, 5, 7, 7, Block.netherFence.blockID, Block.netherFence.blockID, false); +- this.fillWithBlocks(var1, var3, 7, 6, 7, 7, 7, 7, Block.netherFence.blockID, Block.netherFence.blockID, false); +- this.fillWithBlocks(var1, var3, 5, 13, 12, 7, 13, 12, 0, 0, false); +- this.fillWithBlocks(var1, var3, 2, 5, 2, 3, 5, 3, Block.netherBrick.blockID, Block.netherBrick.blockID, false); +- this.fillWithBlocks(var1, var3, 2, 5, 9, 3, 5, 10, Block.netherBrick.blockID, Block.netherBrick.blockID, false); +- this.fillWithBlocks(var1, var3, 2, 5, 4, 2, 5, 8, Block.netherBrick.blockID, Block.netherBrick.blockID, false); +- this.fillWithBlocks(var1, var3, 9, 5, 2, 10, 5, 3, Block.netherBrick.blockID, Block.netherBrick.blockID, false); +- this.fillWithBlocks(var1, var3, 9, 5, 9, 10, 5, 10, Block.netherBrick.blockID, Block.netherBrick.blockID, false); +- this.fillWithBlocks(var1, var3, 10, 5, 4, 10, 5, 8, Block.netherBrick.blockID, Block.netherBrick.blockID, false); ++ for (var7 = 5; var7 <= 7; ++var7) { ++ this.placeBlockAtCurrentPosition(par1World, Block.stairsNetherBrick.blockID, var4, var7, 5 + var5, var6, par3StructureBoundingBox); ++ } ++ ++ if (var6 >= 5 && var6 <= 8) { ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 5, 5, var6, 7, var5 + 4, var6, Block.netherBrick.blockID, Block.netherBrick.blockID, false); ++ } else if (var6 >= 9 && var6 <= 10) { ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 5, 8, var6, 7, var5 + 4, var6, Block.netherBrick.blockID, Block.netherBrick.blockID, false); ++ } ++ ++ if (var5 >= 1) { ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 5, 6 + var5, var6, 7, 9 + var5, var6, 0, 0, false); ++ } ++ } ++ ++ for (var5 = 5; var5 <= 7; ++var5) { ++ this.placeBlockAtCurrentPosition(par1World, Block.stairsNetherBrick.blockID, var4, var5, 12, 11, par3StructureBoundingBox); ++ } ++ ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 5, 6, 7, 5, 7, 7, Block.netherFence.blockID, Block.netherFence.blockID, false); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 7, 6, 7, 7, 7, 7, Block.netherFence.blockID, Block.netherFence.blockID, false); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 5, 13, 12, 7, 13, 12, 0, 0, false); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 2, 5, 2, 3, 5, 3, Block.netherBrick.blockID, Block.netherBrick.blockID, false); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 2, 5, 9, 3, 5, 10, Block.netherBrick.blockID, Block.netherBrick.blockID, false); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 2, 5, 4, 2, 5, 8, Block.netherBrick.blockID, Block.netherBrick.blockID, false); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 9, 5, 2, 10, 5, 3, Block.netherBrick.blockID, Block.netherBrick.blockID, false); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 9, 5, 9, 10, 5, 10, Block.netherBrick.blockID, Block.netherBrick.blockID, false); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 10, 5, 4, 10, 5, 8, Block.netherBrick.blockID, Block.netherBrick.blockID, false); + var5 = this.getMetadataWithOffset(Block.stairsNetherBrick.blockID, 0); + var6 = this.getMetadataWithOffset(Block.stairsNetherBrick.blockID, 1); +- this.placeBlockAtCurrentPosition(var1, Block.stairsNetherBrick.blockID, var6, 4, 5, 2, var3); +- this.placeBlockAtCurrentPosition(var1, Block.stairsNetherBrick.blockID, var6, 4, 5, 3, var3); +- this.placeBlockAtCurrentPosition(var1, Block.stairsNetherBrick.blockID, var6, 4, 5, 9, var3); +- this.placeBlockAtCurrentPosition(var1, Block.stairsNetherBrick.blockID, var6, 4, 5, 10, var3); +- this.placeBlockAtCurrentPosition(var1, Block.stairsNetherBrick.blockID, var5, 8, 5, 2, var3); +- this.placeBlockAtCurrentPosition(var1, Block.stairsNetherBrick.blockID, var5, 8, 5, 3, var3); +- this.placeBlockAtCurrentPosition(var1, Block.stairsNetherBrick.blockID, var5, 8, 5, 9, var3); +- this.placeBlockAtCurrentPosition(var1, Block.stairsNetherBrick.blockID, var5, 8, 5, 10, var3); +- this.fillWithBlocks(var1, var3, 3, 4, 4, 4, 4, 8, Block.slowSand.blockID, Block.slowSand.blockID, false); +- this.fillWithBlocks(var1, var3, 8, 4, 4, 9, 4, 8, Block.slowSand.blockID, Block.slowSand.blockID, false); +- this.fillWithBlocks(var1, var3, 3, 5, 4, 4, 5, 8, Block.netherStalk.blockID, Block.netherStalk.blockID, false); +- this.fillWithBlocks(var1, var3, 8, 5, 4, 9, 5, 8, Block.netherStalk.blockID, Block.netherStalk.blockID, false); +- this.fillWithBlocks(var1, var3, 4, 2, 0, 8, 2, 12, Block.netherBrick.blockID, Block.netherBrick.blockID, false); +- this.fillWithBlocks(var1, var3, 0, 2, 4, 12, 2, 8, Block.netherBrick.blockID, Block.netherBrick.blockID, false); +- this.fillWithBlocks(var1, var3, 4, 0, 0, 8, 1, 3, Block.netherBrick.blockID, Block.netherBrick.blockID, false); +- this.fillWithBlocks(var1, var3, 4, 0, 9, 8, 1, 12, Block.netherBrick.blockID, Block.netherBrick.blockID, false); +- this.fillWithBlocks(var1, var3, 0, 0, 4, 3, 1, 8, Block.netherBrick.blockID, Block.netherBrick.blockID, false); +- this.fillWithBlocks(var1, var3, 9, 0, 4, 12, 1, 8, Block.netherBrick.blockID, Block.netherBrick.blockID, false); +- ++ this.placeBlockAtCurrentPosition(par1World, Block.stairsNetherBrick.blockID, var6, 4, 5, 2, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.stairsNetherBrick.blockID, var6, 4, 5, 3, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.stairsNetherBrick.blockID, var6, 4, 5, 9, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.stairsNetherBrick.blockID, var6, 4, 5, 10, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.stairsNetherBrick.blockID, var5, 8, 5, 2, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.stairsNetherBrick.blockID, var5, 8, 5, 3, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.stairsNetherBrick.blockID, var5, 8, 5, 9, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.stairsNetherBrick.blockID, var5, 8, 5, 10, par3StructureBoundingBox); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 3, 4, 4, 4, 4, 8, Block.slowSand.blockID, Block.slowSand.blockID, false); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 8, 4, 4, 9, 4, 8, Block.slowSand.blockID, Block.slowSand.blockID, false); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 3, 5, 4, 4, 5, 8, Block.netherStalk.blockID, Block.netherStalk.blockID, false); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 8, 5, 4, 9, 5, 8, Block.netherStalk.blockID, Block.netherStalk.blockID, false); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 4, 2, 0, 8, 2, 12, Block.netherBrick.blockID, Block.netherBrick.blockID, false); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 0, 2, 4, 12, 2, 8, Block.netherBrick.blockID, Block.netherBrick.blockID, false); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 4, 0, 0, 8, 1, 3, Block.netherBrick.blockID, Block.netherBrick.blockID, false); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 4, 0, 9, 8, 1, 12, Block.netherBrick.blockID, Block.netherBrick.blockID, false); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 0, 0, 4, 3, 1, 8, Block.netherBrick.blockID, Block.netherBrick.blockID, false); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 9, 0, 4, 12, 1, 8, Block.netherBrick.blockID, Block.netherBrick.blockID, false); + int var8; +- for(var7 = 4; var7 <= 8; ++var7) { +- for(var8 = 0; var8 <= 2; ++var8) { +- this.fillCurrentPositionBlocksDownwards(var1, Block.netherBrick.blockID, 0, var7, -1, var8, var3); +- this.fillCurrentPositionBlocksDownwards(var1, Block.netherBrick.blockID, 0, var7, -1, 12 - var8, var3); ++ ++ for (var7 = 4; var7 <= 8; ++var7) { ++ for (var8 = 0; var8 <= 2; ++var8) { ++ this.fillCurrentPositionBlocksDownwards(par1World, Block.netherBrick.blockID, 0, var7, -1, var8, par3StructureBoundingBox); ++ this.fillCurrentPositionBlocksDownwards(par1World, Block.netherBrick.blockID, 0, var7, -1, 12 - var8, par3StructureBoundingBox); + } + } + +- for(var7 = 0; var7 <= 2; ++var7) { +- for(var8 = 4; var8 <= 8; ++var8) { +- this.fillCurrentPositionBlocksDownwards(var1, Block.netherBrick.blockID, 0, var7, -1, var8, var3); +- this.fillCurrentPositionBlocksDownwards(var1, Block.netherBrick.blockID, 0, 12 - var7, -1, var8, var3); ++ for (var7 = 0; var7 <= 2; ++var7) { ++ for (var8 = 4; var8 <= 8; ++var8) { ++ this.fillCurrentPositionBlocksDownwards(par1World, Block.netherBrick.blockID, 0, var7, -1, var8, par3StructureBoundingBox); ++ this.fillCurrentPositionBlocksDownwards(par1World, Block.netherBrick.blockID, 0, 12 - var7, -1, var8, par3StructureBoundingBox); + } + } + diff --git a/patches/net/minecraft/src/ComponentNetherBridgePiece.java.patch b/patches/net/minecraft/src/ComponentNetherBridgePiece.java.patch new file mode 100644 index 0000000..ed948c1 --- /dev/null +++ b/patches/net/minecraft/src/ComponentNetherBridgePiece.java.patch @@ -0,0 +1,262 @@ +--- net/minecraft/src/ComponentNetherBridgePiece.java ++++ net/minecraft/src/ComponentNetherBridgePiece.java +@@ -5,29 +5,27 @@ + import java.util.Random; + + abstract class ComponentNetherBridgePiece extends StructureComponent { +- protected static final WeightedRandomChestContent[] field_111019_a = new WeightedRandomChestContent[]{new WeightedRandomChestContent(Item.diamond.itemID, 0, 1, 3, 5), new WeightedRandomChestContent(Item.ingotIron.itemID, 0, 1, 5, 5), new WeightedRandomChestContent(Item.ingotGold.itemID, 0, 1, 3, 15), new WeightedRandomChestContent(Item.swordGold.itemID, 0, 1, 1, 5), new WeightedRandomChestContent(Item.plateGold.itemID, 0, 1, 1, 5), new WeightedRandomChestContent(Item.flintAndSteel.itemID, 0, 1, 1, 5), new WeightedRandomChestContent(Item.netherStalkSeeds.itemID, 0, 3, 7, 5), new WeightedRandomChestContent(Item.saddle.itemID, 0, 1, 1, 10), new WeightedRandomChestContent(Item.horseArmorGold.itemID, 0, 1, 1, 8), new WeightedRandomChestContent(Item.horseArmorIron.itemID, 0, 1, 1, 5), new WeightedRandomChestContent(Item.horseArmorDiamond.itemID, 0, 1, 1, 3)}; +- +- public ComponentNetherBridgePiece() { +- } +- +- protected ComponentNetherBridgePiece(int var1) { +- super(var1); +- } +- +- protected void func_143011_b(NBTTagCompound var1) { +- } +- +- protected void func_143012_a(NBTTagCompound var1) { +- } +- +- private int getTotalWeight(List var1) { ++ protected static final WeightedRandomChestContent[] field_111019_a = new WeightedRandomChestContent[] {new WeightedRandomChestContent(Item.diamond.itemID, 0, 1, 3, 5), new WeightedRandomChestContent(Item.ingotIron.itemID, 0, 1, 5, 5), new WeightedRandomChestContent(Item.ingotGold.itemID, 0, 1, 3, 15), new WeightedRandomChestContent(Item.swordGold.itemID, 0, 1, 1, 5), new WeightedRandomChestContent(Item.plateGold.itemID, 0, 1, 1, 5), new WeightedRandomChestContent(Item.flintAndSteel.itemID, 0, 1, 1, 5), new WeightedRandomChestContent(Item.netherStalkSeeds.itemID, 0, 3, 7, 5), new WeightedRandomChestContent(Item.saddle.itemID, 0, 1, 1, 10), new WeightedRandomChestContent(Item.horseArmorGold.itemID, 0, 1, 1, 8), new WeightedRandomChestContent(Item.horseArmorIron.itemID, 0, 1, 1, 5), new WeightedRandomChestContent(Item.horseArmorDiamond.itemID, 0, 1, 1, 3)}; ++ ++ public ComponentNetherBridgePiece() {} ++ ++ protected ComponentNetherBridgePiece(int par1) { ++ super(par1); ++ } ++ ++ protected void func_143011_b(NBTTagCompound par1NBTTagCompound) {} ++ ++ protected void func_143012_a(NBTTagCompound par1NBTTagCompound) {} ++ ++ private int getTotalWeight(List par1List) { + boolean var2 = false; + int var3 = 0; +- + StructureNetherBridgePieceWeight var5; +- for(Iterator var4 = var1.iterator(); var4.hasNext(); var3 += var5.field_78826_b) { ++ ++ for (Iterator var4 = par1List.iterator(); var4.hasNext(); var3 += var5.field_78826_b) { + var5 = (StructureNetherBridgePieceWeight)var4.next(); +- if(var5.field_78824_d > 0 && var5.field_78827_c < var5.field_78824_d) { ++ ++ if (var5.field_78824_d > 0 && var5.field_78827_c < var5.field_78824_d) { + var2 = true; + } + } +@@ -35,30 +33,33 @@ + return var2 ? var3 : -1; + } + +- private ComponentNetherBridgePiece getNextComponent(ComponentNetherBridgeStartPiece var1, List var2, List var3, Random var4, int var5, int var6, int var7, int var8, int var9) { +- int var10 = this.getTotalWeight(var2); +- boolean var11 = var10 > 0 && var9 <= 30; ++ private ComponentNetherBridgePiece getNextComponent(ComponentNetherBridgeStartPiece par1ComponentNetherBridgeStartPiece, List par2List, List par3List, Random par4Random, int par5, int par6, int par7, int par8, int par9) { ++ int var10 = this.getTotalWeight(par2List); ++ boolean var11 = var10 > 0 && par9 <= 30; + int var12 = 0; + +- while(var12 < 5 && var11) { ++ while (var12 < 5 && var11) { + ++var12; +- int var13 = var4.nextInt(var10); +- Iterator var14 = var2.iterator(); ++ int var13 = par4Random.nextInt(var10); ++ Iterator var14 = par2List.iterator(); + +- while(var14.hasNext()) { ++ while (var14.hasNext()) { + StructureNetherBridgePieceWeight var15 = (StructureNetherBridgePieceWeight)var14.next(); + var13 -= var15.field_78826_b; +- if(var13 < 0) { +- if(!var15.func_78822_a(var9) || var15 == var1.theNetherBridgePieceWeight && !var15.field_78825_e) { ++ ++ if (var13 < 0) { ++ if (!var15.func_78822_a(par9) || var15 == par1ComponentNetherBridgeStartPiece.theNetherBridgePieceWeight && !var15.field_78825_e) { + break; + } + +- ComponentNetherBridgePiece var16 = StructureNetherBridgePieces.createNextComponent(var15, var3, var4, var5, var6, var7, var8, var9); +- if(var16 != null) { ++ ComponentNetherBridgePiece var16 = StructureNetherBridgePieces.createNextComponent(var15, par3List, par4Random, par5, par6, par7, par8, par9); ++ ++ if (var16 != null) { + ++var15.field_78827_c; +- var1.theNetherBridgePieceWeight = var15; +- if(!var15.func_78823_a()) { +- var2.remove(var15); ++ par1ComponentNetherBridgeStartPiece.theNetherBridgePieceWeight = var15; ++ ++ if (!var15.func_78823_a()) { ++ par2List.remove(var15); + } + + return var16; +@@ -67,74 +68,103 @@ + } + } + +- return ComponentNetherBridgeEnd.func_74971_a(var3, var4, var5, var6, var7, var8, var9); ++ return ComponentNetherBridgeEnd.func_74971_a(par3List, par4Random, par5, par6, par7, par8, par9); + } + +- private StructureComponent getNextComponent(ComponentNetherBridgeStartPiece var1, List var2, Random var3, int var4, int var5, int var6, int var7, int var8, boolean var9) { +- if(Math.abs(var4 - var1.getBoundingBox().minX) <= 112 && Math.abs(var6 - var1.getBoundingBox().minZ) <= 112) { +- List var10 = var1.c; +- if(var9) { +- var10 = var1.d; ++ /** ++ * Finds a random component to tack on to the bridge. Or builds the end. ++ */ ++ private StructureComponent getNextComponent(ComponentNetherBridgeStartPiece par1ComponentNetherBridgeStartPiece, List par2List, Random par3Random, int par4, int par5, int par6, int par7, int par8, boolean par9) { ++ if (Math.abs(par4 - par1ComponentNetherBridgeStartPiece.getBoundingBox().minX) <= 112 && Math.abs(par6 - par1ComponentNetherBridgeStartPiece.getBoundingBox().minZ) <= 112) { ++ List var10 = par1ComponentNetherBridgeStartPiece.primaryWeights; ++ ++ if (par9) { ++ var10 = par1ComponentNetherBridgeStartPiece.secondaryWeights; + } + +- ComponentNetherBridgePiece var11 = this.getNextComponent(var1, var10, var2, var3, var4, var5, var6, var7, var8 + 1); +- if(var11 != null) { +- var2.add(var11); +- var1.e.add(var11); ++ ComponentNetherBridgePiece var11 = this.getNextComponent(par1ComponentNetherBridgeStartPiece, var10, par2List, par3Random, par4, par5, par6, par7, par8 + 1); ++ ++ if (var11 != null) { ++ par2List.add(var11); ++ par1ComponentNetherBridgeStartPiece.field_74967_d.add(var11); + } + + return var11; + } else { +- return ComponentNetherBridgeEnd.func_74971_a(var2, var3, var4, var5, var6, var7, var8); +- } +- } +- +- protected StructureComponent getNextComponentNormal(ComponentNetherBridgeStartPiece var1, List var2, Random var3, int var4, int var5, boolean var6) { +- switch(this.coordBaseMode) { +- case 0: +- return this.getNextComponent(var1, var2, var3, this.boundingBox.minX + var4, this.boundingBox.minY + var5, this.boundingBox.maxZ + 1, this.coordBaseMode, this.getComponentType(), var6); +- case 1: +- return this.getNextComponent(var1, var2, var3, this.boundingBox.minX - 1, this.boundingBox.minY + var5, this.boundingBox.minZ + var4, this.coordBaseMode, this.getComponentType(), var6); +- case 2: +- return this.getNextComponent(var1, var2, var3, this.boundingBox.minX + var4, this.boundingBox.minY + var5, this.boundingBox.minZ - 1, this.coordBaseMode, this.getComponentType(), var6); +- case 3: +- return this.getNextComponent(var1, var2, var3, this.boundingBox.maxX + 1, this.boundingBox.minY + var5, this.boundingBox.minZ + var4, this.coordBaseMode, this.getComponentType(), var6); +- default: +- return null; +- } +- } +- +- protected StructureComponent getNextComponentX(ComponentNetherBridgeStartPiece var1, List var2, Random var3, int var4, int var5, boolean var6) { +- switch(this.coordBaseMode) { +- case 0: +- return this.getNextComponent(var1, var2, var3, this.boundingBox.minX - 1, this.boundingBox.minY + var4, this.boundingBox.minZ + var5, 1, this.getComponentType(), var6); +- case 1: +- return this.getNextComponent(var1, var2, var3, this.boundingBox.minX + var5, this.boundingBox.minY + var4, this.boundingBox.minZ - 1, 2, this.getComponentType(), var6); +- case 2: +- return this.getNextComponent(var1, var2, var3, this.boundingBox.minX - 1, this.boundingBox.minY + var4, this.boundingBox.minZ + var5, 1, this.getComponentType(), var6); +- case 3: +- return this.getNextComponent(var1, var2, var3, this.boundingBox.minX + var5, this.boundingBox.minY + var4, this.boundingBox.minZ - 1, 2, this.getComponentType(), var6); +- default: +- return null; +- } +- } +- +- protected StructureComponent getNextComponentZ(ComponentNetherBridgeStartPiece var1, List var2, Random var3, int var4, int var5, boolean var6) { +- switch(this.coordBaseMode) { +- case 0: +- return this.getNextComponent(var1, var2, var3, this.boundingBox.maxX + 1, this.boundingBox.minY + var4, this.boundingBox.minZ + var5, 3, this.getComponentType(), var6); +- case 1: +- return this.getNextComponent(var1, var2, var3, this.boundingBox.minX + var5, this.boundingBox.minY + var4, this.boundingBox.maxZ + 1, 0, this.getComponentType(), var6); +- case 2: +- return this.getNextComponent(var1, var2, var3, this.boundingBox.maxX + 1, this.boundingBox.minY + var4, this.boundingBox.minZ + var5, 3, this.getComponentType(), var6); +- case 3: +- return this.getNextComponent(var1, var2, var3, this.boundingBox.minX + var5, this.boundingBox.minY + var4, this.boundingBox.maxZ + 1, 0, this.getComponentType(), var6); +- default: +- return null; +- } +- } +- +- protected static boolean isAboveGround(StructureBoundingBox var0) { +- return var0 != null && var0.minY > 10; ++ return ComponentNetherBridgeEnd.func_74971_a(par2List, par3Random, par4, par5, par6, par7, par8); ++ } ++ } ++ ++ /** ++ * Gets the next component in any cardinal direction ++ */ ++ protected StructureComponent getNextComponentNormal(ComponentNetherBridgeStartPiece par1ComponentNetherBridgeStartPiece, List par2List, Random par3Random, int par4, int par5, boolean par6) { ++ switch (this.coordBaseMode) { ++ case 0: ++ return this.getNextComponent(par1ComponentNetherBridgeStartPiece, par2List, par3Random, this.boundingBox.minX + par4, this.boundingBox.minY + par5, this.boundingBox.maxZ + 1, this.coordBaseMode, this.getComponentType(), par6); ++ ++ case 1: ++ return this.getNextComponent(par1ComponentNetherBridgeStartPiece, par2List, par3Random, this.boundingBox.minX - 1, this.boundingBox.minY + par5, this.boundingBox.minZ + par4, this.coordBaseMode, this.getComponentType(), par6); ++ ++ case 2: ++ return this.getNextComponent(par1ComponentNetherBridgeStartPiece, par2List, par3Random, this.boundingBox.minX + par4, this.boundingBox.minY + par5, this.boundingBox.minZ - 1, this.coordBaseMode, this.getComponentType(), par6); ++ ++ case 3: ++ return this.getNextComponent(par1ComponentNetherBridgeStartPiece, par2List, par3Random, this.boundingBox.maxX + 1, this.boundingBox.minY + par5, this.boundingBox.minZ + par4, this.coordBaseMode, this.getComponentType(), par6); ++ ++ default: ++ return null; ++ } ++ } ++ ++ /** ++ * Gets the next component in the +/- X direction ++ */ ++ protected StructureComponent getNextComponentX(ComponentNetherBridgeStartPiece par1ComponentNetherBridgeStartPiece, List par2List, Random par3Random, int par4, int par5, boolean par6) { ++ switch (this.coordBaseMode) { ++ case 0: ++ return this.getNextComponent(par1ComponentNetherBridgeStartPiece, par2List, par3Random, this.boundingBox.minX - 1, this.boundingBox.minY + par4, this.boundingBox.minZ + par5, 1, this.getComponentType(), par6); ++ ++ case 1: ++ return this.getNextComponent(par1ComponentNetherBridgeStartPiece, par2List, par3Random, this.boundingBox.minX + par5, this.boundingBox.minY + par4, this.boundingBox.minZ - 1, 2, this.getComponentType(), par6); ++ ++ case 2: ++ return this.getNextComponent(par1ComponentNetherBridgeStartPiece, par2List, par3Random, this.boundingBox.minX - 1, this.boundingBox.minY + par4, this.boundingBox.minZ + par5, 1, this.getComponentType(), par6); ++ ++ case 3: ++ return this.getNextComponent(par1ComponentNetherBridgeStartPiece, par2List, par3Random, this.boundingBox.minX + par5, this.boundingBox.minY + par4, this.boundingBox.minZ - 1, 2, this.getComponentType(), par6); ++ ++ default: ++ return null; ++ } ++ } ++ ++ /** ++ * Gets the next component in the +/- Z direction ++ */ ++ protected StructureComponent getNextComponentZ(ComponentNetherBridgeStartPiece par1ComponentNetherBridgeStartPiece, List par2List, Random par3Random, int par4, int par5, boolean par6) { ++ switch (this.coordBaseMode) { ++ case 0: ++ return this.getNextComponent(par1ComponentNetherBridgeStartPiece, par2List, par3Random, this.boundingBox.maxX + 1, this.boundingBox.minY + par4, this.boundingBox.minZ + par5, 3, this.getComponentType(), par6); ++ ++ case 1: ++ return this.getNextComponent(par1ComponentNetherBridgeStartPiece, par2List, par3Random, this.boundingBox.minX + par5, this.boundingBox.minY + par4, this.boundingBox.maxZ + 1, 0, this.getComponentType(), par6); ++ ++ case 2: ++ return this.getNextComponent(par1ComponentNetherBridgeStartPiece, par2List, par3Random, this.boundingBox.maxX + 1, this.boundingBox.minY + par4, this.boundingBox.minZ + par5, 3, this.getComponentType(), par6); ++ ++ case 3: ++ return this.getNextComponent(par1ComponentNetherBridgeStartPiece, par2List, par3Random, this.boundingBox.minX + par5, this.boundingBox.minY + par4, this.boundingBox.maxZ + 1, 0, this.getComponentType(), par6); ++ ++ default: ++ return null; ++ } ++ } ++ ++ /** ++ * Checks if the bounding box's minY is > 10 ++ */ ++ protected static boolean isAboveGround(StructureBoundingBox par0StructureBoundingBox) { ++ return par0StructureBoundingBox != null && par0StructureBoundingBox.minY > 10; + } + } diff --git a/patches/net/minecraft/src/ComponentNetherBridgeStairs.java.patch b/patches/net/minecraft/src/ComponentNetherBridgeStairs.java.patch new file mode 100644 index 0000000..c9aab47 --- /dev/null +++ b/patches/net/minecraft/src/ComponentNetherBridgeStairs.java.patch @@ -0,0 +1,102 @@ +--- net/minecraft/src/ComponentNetherBridgeStairs.java ++++ net/minecraft/src/ComponentNetherBridgeStairs.java +@@ -4,48 +4,57 @@ + import java.util.Random; + + public class ComponentNetherBridgeStairs extends ComponentNetherBridgePiece { +- public ComponentNetherBridgeStairs() { +- } +- +- public ComponentNetherBridgeStairs(int var1, Random var2, StructureBoundingBox var3, int var4) { +- super(var1); +- this.coordBaseMode = var4; +- this.boundingBox = var3; +- } +- +- public void buildComponent(StructureComponent var1, List var2, Random var3) { +- this.getNextComponentZ((ComponentNetherBridgeStartPiece)var1, var2, var3, 6, 2, false); +- } +- +- public static ComponentNetherBridgeStairs createValidComponent(List var0, Random var1, int var2, int var3, int var4, int var5, int var6) { +- StructureBoundingBox var7 = StructureBoundingBox.getComponentToAddBoundingBox(var2, var3, var4, -2, 0, 0, 7, 11, 7, var5); +- return isAboveGround(var7) && StructureComponent.findIntersecting(var0, var7) == null ? new ComponentNetherBridgeStairs(var6, var1, var7, var5) : null; +- } +- +- public boolean addComponentParts(World var1, Random var2, StructureBoundingBox var3) { +- this.fillWithBlocks(var1, var3, 0, 0, 0, 6, 1, 6, Block.netherBrick.blockID, Block.netherBrick.blockID, false); +- this.fillWithBlocks(var1, var3, 0, 2, 0, 6, 10, 6, 0, 0, false); +- this.fillWithBlocks(var1, var3, 0, 2, 0, 1, 8, 0, Block.netherBrick.blockID, Block.netherBrick.blockID, false); +- this.fillWithBlocks(var1, var3, 5, 2, 0, 6, 8, 0, Block.netherBrick.blockID, Block.netherBrick.blockID, false); +- this.fillWithBlocks(var1, var3, 0, 2, 1, 0, 8, 6, Block.netherBrick.blockID, Block.netherBrick.blockID, false); +- this.fillWithBlocks(var1, var3, 6, 2, 1, 6, 8, 6, Block.netherBrick.blockID, Block.netherBrick.blockID, false); +- this.fillWithBlocks(var1, var3, 1, 2, 6, 5, 8, 6, Block.netherBrick.blockID, Block.netherBrick.blockID, false); +- this.fillWithBlocks(var1, var3, 0, 3, 2, 0, 5, 4, Block.netherFence.blockID, Block.netherFence.blockID, false); +- this.fillWithBlocks(var1, var3, 6, 3, 2, 6, 5, 2, Block.netherFence.blockID, Block.netherFence.blockID, false); +- this.fillWithBlocks(var1, var3, 6, 3, 4, 6, 5, 4, Block.netherFence.blockID, Block.netherFence.blockID, false); +- this.placeBlockAtCurrentPosition(var1, Block.netherBrick.blockID, 0, 5, 2, 5, var3); +- this.fillWithBlocks(var1, var3, 4, 2, 5, 4, 3, 5, Block.netherBrick.blockID, Block.netherBrick.blockID, false); +- this.fillWithBlocks(var1, var3, 3, 2, 5, 3, 4, 5, Block.netherBrick.blockID, Block.netherBrick.blockID, false); +- this.fillWithBlocks(var1, var3, 2, 2, 5, 2, 5, 5, Block.netherBrick.blockID, Block.netherBrick.blockID, false); +- this.fillWithBlocks(var1, var3, 1, 2, 5, 1, 6, 5, Block.netherBrick.blockID, Block.netherBrick.blockID, false); +- this.fillWithBlocks(var1, var3, 1, 7, 1, 5, 7, 4, Block.netherBrick.blockID, Block.netherBrick.blockID, false); +- this.fillWithBlocks(var1, var3, 6, 8, 2, 6, 8, 4, 0, 0, false); +- this.fillWithBlocks(var1, var3, 2, 6, 0, 4, 8, 0, Block.netherBrick.blockID, Block.netherBrick.blockID, false); +- this.fillWithBlocks(var1, var3, 2, 5, 0, 4, 5, 0, Block.netherFence.blockID, Block.netherFence.blockID, false); +- +- for(int var4 = 0; var4 <= 6; ++var4) { +- for(int var5 = 0; var5 <= 6; ++var5) { +- this.fillCurrentPositionBlocksDownwards(var1, Block.netherBrick.blockID, 0, var4, -1, var5, var3); ++ public ComponentNetherBridgeStairs() {} ++ ++ public ComponentNetherBridgeStairs(int par1, Random par2Random, StructureBoundingBox par3StructureBoundingBox, int par4) { ++ super(par1); ++ this.coordBaseMode = par4; ++ this.boundingBox = par3StructureBoundingBox; ++ } ++ ++ /** ++ * Initiates construction of the Structure Component picked, at the current Location of StructGen ++ */ ++ public void buildComponent(StructureComponent par1StructureComponent, List par2List, Random par3Random) { ++ this.getNextComponentZ((ComponentNetherBridgeStartPiece)par1StructureComponent, par2List, par3Random, 6, 2, false); ++ } ++ ++ /** ++ * Creates and returns a new component piece. Or null if it could not find enough room to place it. ++ */ ++ public static ComponentNetherBridgeStairs createValidComponent(List par0List, Random par1Random, int par2, int par3, int par4, int par5, int par6) { ++ StructureBoundingBox var7 = StructureBoundingBox.getComponentToAddBoundingBox(par2, par3, par4, -2, 0, 0, 7, 11, 7, par5); ++ return isAboveGround(var7) && StructureComponent.findIntersecting(par0List, var7) == null ? new ComponentNetherBridgeStairs(par6, par1Random, var7, par5) : null; ++ } ++ ++ /** ++ * second Part of Structure generating, this for example places Spiderwebs, Mob Spawners, it closes Mineshafts at the ++ * end, it adds Fences... ++ */ ++ public boolean addComponentParts(World par1World, Random par2Random, StructureBoundingBox par3StructureBoundingBox) { ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 0, 0, 0, 6, 1, 6, Block.netherBrick.blockID, Block.netherBrick.blockID, false); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 0, 2, 0, 6, 10, 6, 0, 0, false); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 0, 2, 0, 1, 8, 0, Block.netherBrick.blockID, Block.netherBrick.blockID, false); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 5, 2, 0, 6, 8, 0, Block.netherBrick.blockID, Block.netherBrick.blockID, false); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 0, 2, 1, 0, 8, 6, Block.netherBrick.blockID, Block.netherBrick.blockID, false); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 6, 2, 1, 6, 8, 6, Block.netherBrick.blockID, Block.netherBrick.blockID, false); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 1, 2, 6, 5, 8, 6, Block.netherBrick.blockID, Block.netherBrick.blockID, false); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 0, 3, 2, 0, 5, 4, Block.netherFence.blockID, Block.netherFence.blockID, false); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 6, 3, 2, 6, 5, 2, Block.netherFence.blockID, Block.netherFence.blockID, false); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 6, 3, 4, 6, 5, 4, Block.netherFence.blockID, Block.netherFence.blockID, false); ++ this.placeBlockAtCurrentPosition(par1World, Block.netherBrick.blockID, 0, 5, 2, 5, par3StructureBoundingBox); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 4, 2, 5, 4, 3, 5, Block.netherBrick.blockID, Block.netherBrick.blockID, false); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 3, 2, 5, 3, 4, 5, Block.netherBrick.blockID, Block.netherBrick.blockID, false); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 2, 2, 5, 2, 5, 5, Block.netherBrick.blockID, Block.netherBrick.blockID, false); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 1, 2, 5, 1, 6, 5, Block.netherBrick.blockID, Block.netherBrick.blockID, false); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 1, 7, 1, 5, 7, 4, Block.netherBrick.blockID, Block.netherBrick.blockID, false); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 6, 8, 2, 6, 8, 4, 0, 0, false); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 2, 6, 0, 4, 8, 0, Block.netherBrick.blockID, Block.netherBrick.blockID, false); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 2, 5, 0, 4, 5, 0, Block.netherFence.blockID, Block.netherFence.blockID, false); ++ ++ for (int var4 = 0; var4 <= 6; ++var4) { ++ for (int var5 = 0; var5 <= 6; ++var5) { ++ this.fillCurrentPositionBlocksDownwards(par1World, Block.netherBrick.blockID, 0, var4, -1, var5, par3StructureBoundingBox); + } + } + diff --git a/patches/net/minecraft/src/ComponentNetherBridgeStartPiece.java.patch b/patches/net/minecraft/src/ComponentNetherBridgeStartPiece.java.patch new file mode 100644 index 0000000..a3fee47 --- /dev/null +++ b/patches/net/minecraft/src/ComponentNetherBridgeStartPiece.java.patch @@ -0,0 +1,81 @@ +--- net/minecraft/src/ComponentNetherBridgeStartPiece.java ++++ net/minecraft/src/ComponentNetherBridgeStartPiece.java +@@ -5,45 +5,53 @@ + import java.util.Random; + + public class ComponentNetherBridgeStartPiece extends ComponentNetherBridgeCrossing3 { ++ ++ /** Instance of StructureNetherBridgePieceWeight. */ + public StructureNetherBridgePieceWeight theNetherBridgePieceWeight; +- public List c; +- public List d; +- public ArrayList e = new ArrayList(); +- +- public ComponentNetherBridgeStartPiece() { +- } +- +- public ComponentNetherBridgeStartPiece(Random var1, int var2, int var3) { +- super(var1, var2, var3); +- this.c = new ArrayList(); ++ ++ /** ++ * Contains the list of valid piece weights for the set of nether bridge structure pieces. ++ */ ++ public List primaryWeights; ++ ++ /** ++ * Contains the list of valid piece weights for the secondary set of nether bridge structure pieces. ++ */ ++ public List secondaryWeights; ++ public ArrayList field_74967_d = new ArrayList(); ++ ++ public ComponentNetherBridgeStartPiece() {} ++ ++ public ComponentNetherBridgeStartPiece(Random par1Random, int par2, int par3) { ++ super(par1Random, par2, par3); ++ this.primaryWeights = new ArrayList(); + StructureNetherBridgePieceWeight[] var4 = StructureNetherBridgePieces.getPrimaryComponents(); + int var5 = var4.length; +- + int var6; + StructureNetherBridgePieceWeight var7; +- for(var6 = 0; var6 < var5; ++var6) { ++ ++ for (var6 = 0; var6 < var5; ++var6) { + var7 = var4[var6]; + var7.field_78827_c = 0; +- this.c.add(var7); ++ this.primaryWeights.add(var7); + } + +- this.d = new ArrayList(); ++ this.secondaryWeights = new ArrayList(); + var4 = StructureNetherBridgePieces.getSecondaryComponents(); + var5 = var4.length; + +- for(var6 = 0; var6 < var5; ++var6) { ++ for (var6 = 0; var6 < var5; ++var6) { + var7 = var4[var6]; + var7.field_78827_c = 0; +- this.d.add(var7); ++ this.secondaryWeights.add(var7); + } +- +- } +- +- protected void func_143011_b(NBTTagCompound var1) { +- super.func_143011_b(var1); +- } +- +- protected void func_143012_a(NBTTagCompound var1) { +- super.func_143012_a(var1); ++ } ++ ++ protected void func_143011_b(NBTTagCompound par1NBTTagCompound) { ++ super.func_143011_b(par1NBTTagCompound); ++ } ++ ++ protected void func_143012_a(NBTTagCompound par1NBTTagCompound) { ++ super.func_143012_a(par1NBTTagCompound); + } + } diff --git a/patches/net/minecraft/src/ComponentNetherBridgeStraight.java.patch b/patches/net/minecraft/src/ComponentNetherBridgeStraight.java.patch new file mode 100644 index 0000000..dd939e8 --- /dev/null +++ b/patches/net/minecraft/src/ComponentNetherBridgeStraight.java.patch @@ -0,0 +1,101 @@ +--- net/minecraft/src/ComponentNetherBridgeStraight.java ++++ net/minecraft/src/ComponentNetherBridgeStraight.java +@@ -4,49 +4,58 @@ + import java.util.Random; + + public class ComponentNetherBridgeStraight extends ComponentNetherBridgePiece { +- public ComponentNetherBridgeStraight() { +- } +- +- public ComponentNetherBridgeStraight(int var1, Random var2, StructureBoundingBox var3, int var4) { +- super(var1); +- this.coordBaseMode = var4; +- this.boundingBox = var3; +- } +- +- public void buildComponent(StructureComponent var1, List var2, Random var3) { +- this.getNextComponentNormal((ComponentNetherBridgeStartPiece)var1, var2, var3, 1, 3, false); +- } +- +- public static ComponentNetherBridgeStraight createValidComponent(List var0, Random var1, int var2, int var3, int var4, int var5, int var6) { +- StructureBoundingBox var7 = StructureBoundingBox.getComponentToAddBoundingBox(var2, var3, var4, -1, -3, 0, 5, 10, 19, var5); +- return isAboveGround(var7) && StructureComponent.findIntersecting(var0, var7) == null ? new ComponentNetherBridgeStraight(var6, var1, var7, var5) : null; +- } +- +- public boolean addComponentParts(World var1, Random var2, StructureBoundingBox var3) { +- this.fillWithBlocks(var1, var3, 0, 3, 0, 4, 4, 18, Block.netherBrick.blockID, Block.netherBrick.blockID, false); +- this.fillWithBlocks(var1, var3, 1, 5, 0, 3, 7, 18, 0, 0, false); +- this.fillWithBlocks(var1, var3, 0, 5, 0, 0, 5, 18, Block.netherBrick.blockID, Block.netherBrick.blockID, false); +- this.fillWithBlocks(var1, var3, 4, 5, 0, 4, 5, 18, Block.netherBrick.blockID, Block.netherBrick.blockID, false); +- this.fillWithBlocks(var1, var3, 0, 2, 0, 4, 2, 5, Block.netherBrick.blockID, Block.netherBrick.blockID, false); +- this.fillWithBlocks(var1, var3, 0, 2, 13, 4, 2, 18, Block.netherBrick.blockID, Block.netherBrick.blockID, false); +- this.fillWithBlocks(var1, var3, 0, 0, 0, 4, 1, 3, Block.netherBrick.blockID, Block.netherBrick.blockID, false); +- this.fillWithBlocks(var1, var3, 0, 0, 15, 4, 1, 18, Block.netherBrick.blockID, Block.netherBrick.blockID, false); +- +- for(int var4 = 0; var4 <= 4; ++var4) { +- for(int var5 = 0; var5 <= 2; ++var5) { +- this.fillCurrentPositionBlocksDownwards(var1, Block.netherBrick.blockID, 0, var4, -1, var5, var3); +- this.fillCurrentPositionBlocksDownwards(var1, Block.netherBrick.blockID, 0, var4, -1, 18 - var5, var3); ++ public ComponentNetherBridgeStraight() {} ++ ++ public ComponentNetherBridgeStraight(int par1, Random par2Random, StructureBoundingBox par3StructureBoundingBox, int par4) { ++ super(par1); ++ this.coordBaseMode = par4; ++ this.boundingBox = par3StructureBoundingBox; ++ } ++ ++ /** ++ * Initiates construction of the Structure Component picked, at the current Location of StructGen ++ */ ++ public void buildComponent(StructureComponent par1StructureComponent, List par2List, Random par3Random) { ++ this.getNextComponentNormal((ComponentNetherBridgeStartPiece)par1StructureComponent, par2List, par3Random, 1, 3, false); ++ } ++ ++ /** ++ * Creates and returns a new component piece. Or null if it could not find enough room to place it. ++ */ ++ public static ComponentNetherBridgeStraight createValidComponent(List par0List, Random par1Random, int par2, int par3, int par4, int par5, int par6) { ++ StructureBoundingBox var7 = StructureBoundingBox.getComponentToAddBoundingBox(par2, par3, par4, -1, -3, 0, 5, 10, 19, par5); ++ return isAboveGround(var7) && StructureComponent.findIntersecting(par0List, var7) == null ? new ComponentNetherBridgeStraight(par6, par1Random, var7, par5) : null; ++ } ++ ++ /** ++ * second Part of Structure generating, this for example places Spiderwebs, Mob Spawners, it closes Mineshafts at the ++ * end, it adds Fences... ++ */ ++ public boolean addComponentParts(World par1World, Random par2Random, StructureBoundingBox par3StructureBoundingBox) { ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 0, 3, 0, 4, 4, 18, Block.netherBrick.blockID, Block.netherBrick.blockID, false); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 1, 5, 0, 3, 7, 18, 0, 0, false); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 0, 5, 0, 0, 5, 18, Block.netherBrick.blockID, Block.netherBrick.blockID, false); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 4, 5, 0, 4, 5, 18, Block.netherBrick.blockID, Block.netherBrick.blockID, false); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 0, 2, 0, 4, 2, 5, Block.netherBrick.blockID, Block.netherBrick.blockID, false); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 0, 2, 13, 4, 2, 18, Block.netherBrick.blockID, Block.netherBrick.blockID, false); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 0, 0, 0, 4, 1, 3, Block.netherBrick.blockID, Block.netherBrick.blockID, false); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 0, 0, 15, 4, 1, 18, Block.netherBrick.blockID, Block.netherBrick.blockID, false); ++ ++ for (int var4 = 0; var4 <= 4; ++var4) { ++ for (int var5 = 0; var5 <= 2; ++var5) { ++ this.fillCurrentPositionBlocksDownwards(par1World, Block.netherBrick.blockID, 0, var4, -1, var5, par3StructureBoundingBox); ++ this.fillCurrentPositionBlocksDownwards(par1World, Block.netherBrick.blockID, 0, var4, -1, 18 - var5, par3StructureBoundingBox); + } + } + +- this.fillWithBlocks(var1, var3, 0, 1, 1, 0, 4, 1, Block.netherFence.blockID, Block.netherFence.blockID, false); +- this.fillWithBlocks(var1, var3, 0, 3, 4, 0, 4, 4, Block.netherFence.blockID, Block.netherFence.blockID, false); +- this.fillWithBlocks(var1, var3, 0, 3, 14, 0, 4, 14, Block.netherFence.blockID, Block.netherFence.blockID, false); +- this.fillWithBlocks(var1, var3, 0, 1, 17, 0, 4, 17, Block.netherFence.blockID, Block.netherFence.blockID, false); +- this.fillWithBlocks(var1, var3, 4, 1, 1, 4, 4, 1, Block.netherFence.blockID, Block.netherFence.blockID, false); +- this.fillWithBlocks(var1, var3, 4, 3, 4, 4, 4, 4, Block.netherFence.blockID, Block.netherFence.blockID, false); +- this.fillWithBlocks(var1, var3, 4, 3, 14, 4, 4, 14, Block.netherFence.blockID, Block.netherFence.blockID, false); +- this.fillWithBlocks(var1, var3, 4, 1, 17, 4, 4, 17, Block.netherFence.blockID, Block.netherFence.blockID, false); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 0, 1, 1, 0, 4, 1, Block.netherFence.blockID, Block.netherFence.blockID, false); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 0, 3, 4, 0, 4, 4, Block.netherFence.blockID, Block.netherFence.blockID, false); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 0, 3, 14, 0, 4, 14, Block.netherFence.blockID, Block.netherFence.blockID, false); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 0, 1, 17, 0, 4, 17, Block.netherFence.blockID, Block.netherFence.blockID, false); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 4, 1, 1, 4, 4, 1, Block.netherFence.blockID, Block.netherFence.blockID, false); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 4, 3, 4, 4, 4, 4, Block.netherFence.blockID, Block.netherFence.blockID, false); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 4, 3, 14, 4, 4, 14, Block.netherFence.blockID, Block.netherFence.blockID, false); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 4, 1, 17, 4, 4, 17, Block.netherFence.blockID, Block.netherFence.blockID, false); + return true; + } + } diff --git a/patches/net/minecraft/src/ComponentNetherBridgeThrone.java.patch b/patches/net/minecraft/src/ComponentNetherBridgeThrone.java.patch new file mode 100644 index 0000000..efcb3c3 --- /dev/null +++ b/patches/net/minecraft/src/ComponentNetherBridgeThrone.java.patch @@ -0,0 +1,131 @@ +--- net/minecraft/src/ComponentNetherBridgeThrone.java ++++ net/minecraft/src/ComponentNetherBridgeThrone.java +@@ -6,68 +6,77 @@ + public class ComponentNetherBridgeThrone extends ComponentNetherBridgePiece { + private boolean hasSpawner; + +- public ComponentNetherBridgeThrone() { +- } +- +- public ComponentNetherBridgeThrone(int var1, Random var2, StructureBoundingBox var3, int var4) { +- super(var1); +- this.coordBaseMode = var4; +- this.boundingBox = var3; +- } +- +- protected void func_143011_b(NBTTagCompound var1) { +- super.func_143011_b(var1); +- this.hasSpawner = var1.getBoolean("Mob"); +- } +- +- protected void func_143012_a(NBTTagCompound var1) { +- super.func_143012_a(var1); +- var1.setBoolean("Mob", this.hasSpawner); +- } +- +- public static ComponentNetherBridgeThrone createValidComponent(List var0, Random var1, int var2, int var3, int var4, int var5, int var6) { +- StructureBoundingBox var7 = StructureBoundingBox.getComponentToAddBoundingBox(var2, var3, var4, -2, 0, 0, 7, 8, 9, var5); +- return isAboveGround(var7) && StructureComponent.findIntersecting(var0, var7) == null ? new ComponentNetherBridgeThrone(var6, var1, var7, var5) : null; +- } +- +- public boolean addComponentParts(World var1, Random var2, StructureBoundingBox var3) { +- this.fillWithBlocks(var1, var3, 0, 2, 0, 6, 7, 7, 0, 0, false); +- this.fillWithBlocks(var1, var3, 1, 0, 0, 5, 1, 7, Block.netherBrick.blockID, Block.netherBrick.blockID, false); +- this.fillWithBlocks(var1, var3, 1, 2, 1, 5, 2, 7, Block.netherBrick.blockID, Block.netherBrick.blockID, false); +- this.fillWithBlocks(var1, var3, 1, 3, 2, 5, 3, 7, Block.netherBrick.blockID, Block.netherBrick.blockID, false); +- this.fillWithBlocks(var1, var3, 1, 4, 3, 5, 4, 7, Block.netherBrick.blockID, Block.netherBrick.blockID, false); +- this.fillWithBlocks(var1, var3, 1, 2, 0, 1, 4, 2, Block.netherBrick.blockID, Block.netherBrick.blockID, false); +- this.fillWithBlocks(var1, var3, 5, 2, 0, 5, 4, 2, Block.netherBrick.blockID, Block.netherBrick.blockID, false); +- this.fillWithBlocks(var1, var3, 1, 5, 2, 1, 5, 3, Block.netherBrick.blockID, Block.netherBrick.blockID, false); +- this.fillWithBlocks(var1, var3, 5, 5, 2, 5, 5, 3, Block.netherBrick.blockID, Block.netherBrick.blockID, false); +- this.fillWithBlocks(var1, var3, 0, 5, 3, 0, 5, 8, Block.netherBrick.blockID, Block.netherBrick.blockID, false); +- this.fillWithBlocks(var1, var3, 6, 5, 3, 6, 5, 8, Block.netherBrick.blockID, Block.netherBrick.blockID, false); +- this.fillWithBlocks(var1, var3, 1, 5, 8, 5, 5, 8, Block.netherBrick.blockID, Block.netherBrick.blockID, false); +- this.placeBlockAtCurrentPosition(var1, Block.netherFence.blockID, 0, 1, 6, 3, var3); +- this.placeBlockAtCurrentPosition(var1, Block.netherFence.blockID, 0, 5, 6, 3, var3); +- this.fillWithBlocks(var1, var3, 0, 6, 3, 0, 6, 8, Block.netherFence.blockID, Block.netherFence.blockID, false); +- this.fillWithBlocks(var1, var3, 6, 6, 3, 6, 6, 8, Block.netherFence.blockID, Block.netherFence.blockID, false); +- this.fillWithBlocks(var1, var3, 1, 6, 8, 5, 7, 8, Block.netherFence.blockID, Block.netherFence.blockID, false); +- this.fillWithBlocks(var1, var3, 2, 8, 8, 4, 8, 8, Block.netherFence.blockID, Block.netherFence.blockID, false); ++ public ComponentNetherBridgeThrone() {} ++ ++ public ComponentNetherBridgeThrone(int par1, Random par2Random, StructureBoundingBox par3StructureBoundingBox, int par4) { ++ super(par1); ++ this.coordBaseMode = par4; ++ this.boundingBox = par3StructureBoundingBox; ++ } ++ ++ protected void func_143011_b(NBTTagCompound par1NBTTagCompound) { ++ super.func_143011_b(par1NBTTagCompound); ++ this.hasSpawner = par1NBTTagCompound.getBoolean("Mob"); ++ } ++ ++ protected void func_143012_a(NBTTagCompound par1NBTTagCompound) { ++ super.func_143012_a(par1NBTTagCompound); ++ par1NBTTagCompound.setBoolean("Mob", this.hasSpawner); ++ } ++ ++ /** ++ * Creates and returns a new component piece. Or null if it could not find enough room to place it. ++ */ ++ public static ComponentNetherBridgeThrone createValidComponent(List par0List, Random par1Random, int par2, int par3, int par4, int par5, int par6) { ++ StructureBoundingBox var7 = StructureBoundingBox.getComponentToAddBoundingBox(par2, par3, par4, -2, 0, 0, 7, 8, 9, par5); ++ return isAboveGround(var7) && StructureComponent.findIntersecting(par0List, var7) == null ? new ComponentNetherBridgeThrone(par6, par1Random, var7, par5) : null; ++ } ++ ++ /** ++ * second Part of Structure generating, this for example places Spiderwebs, Mob Spawners, it closes Mineshafts at the ++ * end, it adds Fences... ++ */ ++ public boolean addComponentParts(World par1World, Random par2Random, StructureBoundingBox par3StructureBoundingBox) { ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 0, 2, 0, 6, 7, 7, 0, 0, false); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 1, 0, 0, 5, 1, 7, Block.netherBrick.blockID, Block.netherBrick.blockID, false); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 1, 2, 1, 5, 2, 7, Block.netherBrick.blockID, Block.netherBrick.blockID, false); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 1, 3, 2, 5, 3, 7, Block.netherBrick.blockID, Block.netherBrick.blockID, false); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 1, 4, 3, 5, 4, 7, Block.netherBrick.blockID, Block.netherBrick.blockID, false); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 1, 2, 0, 1, 4, 2, Block.netherBrick.blockID, Block.netherBrick.blockID, false); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 5, 2, 0, 5, 4, 2, Block.netherBrick.blockID, Block.netherBrick.blockID, false); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 1, 5, 2, 1, 5, 3, Block.netherBrick.blockID, Block.netherBrick.blockID, false); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 5, 5, 2, 5, 5, 3, Block.netherBrick.blockID, Block.netherBrick.blockID, false); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 0, 5, 3, 0, 5, 8, Block.netherBrick.blockID, Block.netherBrick.blockID, false); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 6, 5, 3, 6, 5, 8, Block.netherBrick.blockID, Block.netherBrick.blockID, false); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 1, 5, 8, 5, 5, 8, Block.netherBrick.blockID, Block.netherBrick.blockID, false); ++ this.placeBlockAtCurrentPosition(par1World, Block.netherFence.blockID, 0, 1, 6, 3, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.netherFence.blockID, 0, 5, 6, 3, par3StructureBoundingBox); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 0, 6, 3, 0, 6, 8, Block.netherFence.blockID, Block.netherFence.blockID, false); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 6, 6, 3, 6, 6, 8, Block.netherFence.blockID, Block.netherFence.blockID, false); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 1, 6, 8, 5, 7, 8, Block.netherFence.blockID, Block.netherFence.blockID, false); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 2, 8, 8, 4, 8, 8, Block.netherFence.blockID, Block.netherFence.blockID, false); + int var4; + int var5; +- if(!this.hasSpawner) { ++ ++ if (!this.hasSpawner) { + var4 = this.getYWithOffset(5); + var5 = this.getXWithOffset(3, 5); + int var6 = this.getZWithOffset(3, 5); +- if(var3.isVecInside(var5, var4, var6)) { ++ ++ if (par3StructureBoundingBox.isVecInside(var5, var4, var6)) { + this.hasSpawner = true; +- var1.setBlock(var5, var4, var6, Block.mobSpawner.blockID, 0, 2); +- TileEntityMobSpawner var7 = (TileEntityMobSpawner)var1.getBlockTileEntity(var5, var4, var6); +- if(var7 != null) { ++ par1World.setBlock(var5, var4, var6, Block.mobSpawner.blockID, 0, 2); ++ TileEntityMobSpawner var7 = (TileEntityMobSpawner)par1World.getBlockTileEntity(var5, var4, var6); ++ ++ if (var7 != null) { + var7.getSpawnerLogic().setMobID("Blaze"); + } + } + } + +- for(var4 = 0; var4 <= 6; ++var4) { +- for(var5 = 0; var5 <= 6; ++var5) { +- this.fillCurrentPositionBlocksDownwards(var1, Block.netherBrick.blockID, 0, var4, -1, var5, var3); ++ for (var4 = 0; var4 <= 6; ++var4) { ++ for (var5 = 0; var5 <= 6; ++var5) { ++ this.fillCurrentPositionBlocksDownwards(par1World, Block.netherBrick.blockID, 0, var4, -1, var5, par3StructureBoundingBox); + } + } + diff --git a/patches/net/minecraft/src/ComponentScatteredFeature.java.patch b/patches/net/minecraft/src/ComponentScatteredFeature.java.patch new file mode 100644 index 0000000..2eb3efe --- /dev/null +++ b/patches/net/minecraft/src/ComponentScatteredFeature.java.patch @@ -0,0 +1,114 @@ +--- net/minecraft/src/ComponentScatteredFeature.java ++++ net/minecraft/src/ComponentScatteredFeature.java +@@ -3,66 +3,72 @@ + import java.util.Random; + + abstract class ComponentScatteredFeature extends StructureComponent { ++ ++ /** The size of the bounding box for this feature in the X axis */ + protected int scatteredFeatureSizeX; ++ ++ /** The size of the bounding box for this feature in the Y axis */ + protected int scatteredFeatureSizeY; ++ ++ /** The size of the bounding box for this feature in the Z axis */ + protected int scatteredFeatureSizeZ; + protected int field_74936_d = -1; + +- public ComponentScatteredFeature() { +- } ++ public ComponentScatteredFeature() {} + +- protected ComponentScatteredFeature(Random var1, int var2, int var3, int var4, int var5, int var6, int var7) { ++ protected ComponentScatteredFeature(Random par1Random, int par2, int par3, int par4, int par5, int par6, int par7) { + super(0); +- this.scatteredFeatureSizeX = var5; +- this.scatteredFeatureSizeY = var6; +- this.scatteredFeatureSizeZ = var7; +- this.coordBaseMode = var1.nextInt(4); +- switch(this.coordBaseMode) { +- case 0: +- case 2: +- this.boundingBox = new StructureBoundingBox(var2, var3, var4, var2 + var5 - 1, var3 + var6 - 1, var4 + var7 - 1); +- break; +- default: +- this.boundingBox = new StructureBoundingBox(var2, var3, var4, var2 + var7 - 1, var3 + var6 - 1, var4 + var5 - 1); ++ this.scatteredFeatureSizeX = par5; ++ this.scatteredFeatureSizeY = par6; ++ this.scatteredFeatureSizeZ = par7; ++ this.coordBaseMode = par1Random.nextInt(4); ++ ++ switch (this.coordBaseMode) { ++ case 0: ++ case 2: ++ this.boundingBox = new StructureBoundingBox(par2, par3, par4, par2 + par5 - 1, par3 + par6 - 1, par4 + par7 - 1); ++ break; ++ ++ default: ++ this.boundingBox = new StructureBoundingBox(par2, par3, par4, par2 + par7 - 1, par3 + par6 - 1, par4 + par5 - 1); + } +- +- } +- +- protected void func_143012_a(NBTTagCompound var1) { +- var1.setInteger("Width", this.scatteredFeatureSizeX); +- var1.setInteger("Height", this.scatteredFeatureSizeY); +- var1.setInteger("Depth", this.scatteredFeatureSizeZ); +- var1.setInteger("HPos", this.field_74936_d); +- } +- +- protected void func_143011_b(NBTTagCompound var1) { +- this.scatteredFeatureSizeX = var1.getInteger("Width"); +- this.scatteredFeatureSizeY = var1.getInteger("Height"); +- this.scatteredFeatureSizeZ = var1.getInteger("Depth"); +- this.field_74936_d = var1.getInteger("HPos"); +- } +- +- protected boolean func_74935_a(World var1, StructureBoundingBox var2, int var3) { +- if(this.field_74936_d >= 0) { ++ } ++ ++ protected void func_143012_a(NBTTagCompound par1NBTTagCompound) { ++ par1NBTTagCompound.setInteger("Width", this.scatteredFeatureSizeX); ++ par1NBTTagCompound.setInteger("Height", this.scatteredFeatureSizeY); ++ par1NBTTagCompound.setInteger("Depth", this.scatteredFeatureSizeZ); ++ par1NBTTagCompound.setInteger("HPos", this.field_74936_d); ++ } ++ ++ protected void func_143011_b(NBTTagCompound par1NBTTagCompound) { ++ this.scatteredFeatureSizeX = par1NBTTagCompound.getInteger("Width"); ++ this.scatteredFeatureSizeY = par1NBTTagCompound.getInteger("Height"); ++ this.scatteredFeatureSizeZ = par1NBTTagCompound.getInteger("Depth"); ++ this.field_74936_d = par1NBTTagCompound.getInteger("HPos"); ++ } ++ ++ protected boolean func_74935_a(World par1World, StructureBoundingBox par2StructureBoundingBox, int par3) { ++ if (this.field_74936_d >= 0) { + return true; + } else { + int var4 = 0; + int var5 = 0; + +- for(int var6 = this.boundingBox.minZ; var6 <= this.boundingBox.maxZ; ++var6) { +- for(int var7 = this.boundingBox.minX; var7 <= this.boundingBox.maxX; ++var7) { +- if(var2.isVecInside(var7, 64, var6)) { +- var4 += Math.max(var1.getTopSolidOrLiquidBlock(var7, var6), var1.provider.getAverageGroundLevel()); ++ for (int var6 = this.boundingBox.minZ; var6 <= this.boundingBox.maxZ; ++var6) { ++ for (int var7 = this.boundingBox.minX; var7 <= this.boundingBox.maxX; ++var7) { ++ if (par2StructureBoundingBox.isVecInside(var7, 64, var6)) { ++ var4 += Math.max(par1World.getTopSolidOrLiquidBlock(var7, var6), par1World.provider.getAverageGroundLevel()); + ++var5; + } + } + } + +- if(var5 == 0) { ++ if (var5 == 0) { + return false; + } else { + this.field_74936_d = var4 / var5; +- this.boundingBox.offset(0, this.field_74936_d - this.boundingBox.minY + var3, 0); ++ this.boundingBox.offset(0, this.field_74936_d - this.boundingBox.minY + par3, 0); + return true; + } + } diff --git a/patches/net/minecraft/src/ComponentScatteredFeatureDesertPyramid.java.patch b/patches/net/minecraft/src/ComponentScatteredFeatureDesertPyramid.java.patch new file mode 100644 index 0000000..0ec8f05 --- /dev/null +++ b/patches/net/minecraft/src/ComponentScatteredFeatureDesertPyramid.java.patch @@ -0,0 +1,425 @@ +--- net/minecraft/src/ComponentScatteredFeatureDesertPyramid.java ++++ net/minecraft/src/ComponentScatteredFeatureDesertPyramid.java +@@ -4,44 +4,50 @@ + + public class ComponentScatteredFeatureDesertPyramid extends ComponentScatteredFeature { + private boolean[] field_74940_h = new boolean[4]; +- private static final WeightedRandomChestContent[] itemsToGenerateInTemple = new WeightedRandomChestContent[]{new WeightedRandomChestContent(Item.diamond.itemID, 0, 1, 3, 3), new WeightedRandomChestContent(Item.ingotIron.itemID, 0, 1, 5, 10), new WeightedRandomChestContent(Item.ingotGold.itemID, 0, 2, 7, 15), new WeightedRandomChestContent(Item.emerald.itemID, 0, 1, 3, 2), new WeightedRandomChestContent(Item.bone.itemID, 0, 4, 6, 20), new WeightedRandomChestContent(Item.rottenFlesh.itemID, 0, 3, 7, 16), new WeightedRandomChestContent(Item.saddle.itemID, 0, 1, 1, 3), new WeightedRandomChestContent(Item.horseArmorIron.itemID, 0, 1, 1, 1), new WeightedRandomChestContent(Item.horseArmorGold.itemID, 0, 1, 1, 1), new WeightedRandomChestContent(Item.horseArmorDiamond.itemID, 0, 1, 1, 1)}; +- +- public ComponentScatteredFeatureDesertPyramid() { +- } +- +- public ComponentScatteredFeatureDesertPyramid(Random var1, int var2, int var3) { +- super(var1, var2, 64, var3, 21, 15, 21); +- } +- +- protected void func_143012_a(NBTTagCompound var1) { +- super.func_143012_a(var1); +- var1.setBoolean("hasPlacedChest0", this.field_74940_h[0]); +- var1.setBoolean("hasPlacedChest1", this.field_74940_h[1]); +- var1.setBoolean("hasPlacedChest2", this.field_74940_h[2]); +- var1.setBoolean("hasPlacedChest3", this.field_74940_h[3]); +- } +- +- protected void func_143011_b(NBTTagCompound var1) { +- super.func_143011_b(var1); +- this.field_74940_h[0] = var1.getBoolean("hasPlacedChest0"); +- this.field_74940_h[1] = var1.getBoolean("hasPlacedChest1"); +- this.field_74940_h[2] = var1.getBoolean("hasPlacedChest2"); +- this.field_74940_h[3] = var1.getBoolean("hasPlacedChest3"); +- } +- +- public boolean addComponentParts(World var1, Random var2, StructureBoundingBox var3) { +- this.fillWithBlocks(var1, var3, 0, -4, 0, this.scatteredFeatureSizeX - 1, 0, this.scatteredFeatureSizeZ - 1, Block.sandStone.blockID, Block.sandStone.blockID, false); +- ++ ++ /** List of items to generate in chests of Temples. */ ++ private static final WeightedRandomChestContent[] itemsToGenerateInTemple = new WeightedRandomChestContent[] {new WeightedRandomChestContent(Item.diamond.itemID, 0, 1, 3, 3), new WeightedRandomChestContent(Item.ingotIron.itemID, 0, 1, 5, 10), new WeightedRandomChestContent(Item.ingotGold.itemID, 0, 2, 7, 15), new WeightedRandomChestContent(Item.emerald.itemID, 0, 1, 3, 2), new WeightedRandomChestContent(Item.bone.itemID, 0, 4, 6, 20), new WeightedRandomChestContent(Item.rottenFlesh.itemID, 0, 3, 7, 16), new WeightedRandomChestContent(Item.saddle.itemID, 0, 1, 1, 3), new WeightedRandomChestContent(Item.horseArmorIron.itemID, 0, 1, 1, 1), new WeightedRandomChestContent(Item.horseArmorGold.itemID, 0, 1, 1, 1), new WeightedRandomChestContent(Item.horseArmorDiamond.itemID, 0, 1, 1, 1)}; ++ ++ public ComponentScatteredFeatureDesertPyramid() {} ++ ++ public ComponentScatteredFeatureDesertPyramid(Random par1Random, int par2, int par3) { ++ super(par1Random, par2, 64, par3, 21, 15, 21); ++ } ++ ++ protected void func_143012_a(NBTTagCompound par1NBTTagCompound) { ++ super.func_143012_a(par1NBTTagCompound); ++ par1NBTTagCompound.setBoolean("hasPlacedChest0", this.field_74940_h[0]); ++ par1NBTTagCompound.setBoolean("hasPlacedChest1", this.field_74940_h[1]); ++ par1NBTTagCompound.setBoolean("hasPlacedChest2", this.field_74940_h[2]); ++ par1NBTTagCompound.setBoolean("hasPlacedChest3", this.field_74940_h[3]); ++ } ++ ++ protected void func_143011_b(NBTTagCompound par1NBTTagCompound) { ++ super.func_143011_b(par1NBTTagCompound); ++ this.field_74940_h[0] = par1NBTTagCompound.getBoolean("hasPlacedChest0"); ++ this.field_74940_h[1] = par1NBTTagCompound.getBoolean("hasPlacedChest1"); ++ this.field_74940_h[2] = par1NBTTagCompound.getBoolean("hasPlacedChest2"); ++ this.field_74940_h[3] = par1NBTTagCompound.getBoolean("hasPlacedChest3"); ++ } ++ ++ /** ++ * second Part of Structure generating, this for example places Spiderwebs, Mob Spawners, it closes Mineshafts at the ++ * end, it adds Fences... ++ */ ++ public boolean addComponentParts(World par1World, Random par2Random, StructureBoundingBox par3StructureBoundingBox) { ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 0, -4, 0, this.scatteredFeatureSizeX - 1, 0, this.scatteredFeatureSizeZ - 1, Block.sandStone.blockID, Block.sandStone.blockID, false); + int var4; +- for(var4 = 1; var4 <= 9; ++var4) { +- this.fillWithBlocks(var1, var3, var4, var4, var4, this.scatteredFeatureSizeX - 1 - var4, var4, this.scatteredFeatureSizeZ - 1 - var4, Block.sandStone.blockID, Block.sandStone.blockID, false); +- this.fillWithBlocks(var1, var3, var4 + 1, var4, var4 + 1, this.scatteredFeatureSizeX - 2 - var4, var4, this.scatteredFeatureSizeZ - 2 - var4, 0, 0, false); ++ ++ for (var4 = 1; var4 <= 9; ++var4) { ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, var4, var4, var4, this.scatteredFeatureSizeX - 1 - var4, var4, this.scatteredFeatureSizeZ - 1 - var4, Block.sandStone.blockID, Block.sandStone.blockID, false); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, var4 + 1, var4, var4 + 1, this.scatteredFeatureSizeX - 2 - var4, var4, this.scatteredFeatureSizeZ - 2 - var4, 0, 0, false); + } + + int var5; +- for(var4 = 0; var4 < this.scatteredFeatureSizeX; ++var4) { +- for(var5 = 0; var5 < this.scatteredFeatureSizeZ; ++var5) { +- this.fillCurrentPositionBlocksDownwards(var1, Block.sandStone.blockID, 0, var4, -5, var5, var3); ++ ++ for (var4 = 0; var4 < this.scatteredFeatureSizeX; ++var4) { ++ for (var5 = 0; var5 < this.scatteredFeatureSizeZ; ++var5) { ++ this.fillCurrentPositionBlocksDownwards(par1World, Block.sandStone.blockID, 0, var4, -5, var5, par3StructureBoundingBox); + } + } + +@@ -51,173 +57,173 @@ + int var7 = this.getMetadataWithOffset(Block.stairsSandStone.blockID, 1); + byte var8 = 1; + byte var9 = 11; +- this.fillWithBlocks(var1, var3, 0, 0, 0, 4, 9, 4, Block.sandStone.blockID, 0, false); +- this.fillWithBlocks(var1, var3, 1, 10, 1, 3, 10, 3, Block.sandStone.blockID, Block.sandStone.blockID, false); +- this.placeBlockAtCurrentPosition(var1, Block.stairsSandStone.blockID, var4, 2, 10, 0, var3); +- this.placeBlockAtCurrentPosition(var1, Block.stairsSandStone.blockID, var5, 2, 10, 4, var3); +- this.placeBlockAtCurrentPosition(var1, Block.stairsSandStone.blockID, var6, 0, 10, 2, var3); +- this.placeBlockAtCurrentPosition(var1, Block.stairsSandStone.blockID, var7, 4, 10, 2, var3); +- this.fillWithBlocks(var1, var3, this.scatteredFeatureSizeX - 5, 0, 0, this.scatteredFeatureSizeX - 1, 9, 4, Block.sandStone.blockID, 0, false); +- this.fillWithBlocks(var1, var3, this.scatteredFeatureSizeX - 4, 10, 1, this.scatteredFeatureSizeX - 2, 10, 3, Block.sandStone.blockID, Block.sandStone.blockID, false); +- this.placeBlockAtCurrentPosition(var1, Block.stairsSandStone.blockID, var4, this.scatteredFeatureSizeX - 3, 10, 0, var3); +- this.placeBlockAtCurrentPosition(var1, Block.stairsSandStone.blockID, var5, this.scatteredFeatureSizeX - 3, 10, 4, var3); +- this.placeBlockAtCurrentPosition(var1, Block.stairsSandStone.blockID, var6, this.scatteredFeatureSizeX - 5, 10, 2, var3); +- this.placeBlockAtCurrentPosition(var1, Block.stairsSandStone.blockID, var7, this.scatteredFeatureSizeX - 1, 10, 2, var3); +- this.fillWithBlocks(var1, var3, 8, 0, 0, 12, 4, 4, Block.sandStone.blockID, 0, false); +- this.fillWithBlocks(var1, var3, 9, 1, 0, 11, 3, 4, 0, 0, false); +- this.placeBlockAtCurrentPosition(var1, Block.sandStone.blockID, 2, 9, 1, 1, var3); +- this.placeBlockAtCurrentPosition(var1, Block.sandStone.blockID, 2, 9, 2, 1, var3); +- this.placeBlockAtCurrentPosition(var1, Block.sandStone.blockID, 2, 9, 3, 1, var3); +- this.placeBlockAtCurrentPosition(var1, Block.sandStone.blockID, 2, 10, 3, 1, var3); +- this.placeBlockAtCurrentPosition(var1, Block.sandStone.blockID, 2, 11, 3, 1, var3); +- this.placeBlockAtCurrentPosition(var1, Block.sandStone.blockID, 2, 11, 2, 1, var3); +- this.placeBlockAtCurrentPosition(var1, Block.sandStone.blockID, 2, 11, 1, 1, var3); +- this.fillWithBlocks(var1, var3, 4, 1, 1, 8, 3, 3, Block.sandStone.blockID, 0, false); +- this.fillWithBlocks(var1, var3, 4, 1, 2, 8, 2, 2, 0, 0, false); +- this.fillWithBlocks(var1, var3, 12, 1, 1, 16, 3, 3, Block.sandStone.blockID, 0, false); +- this.fillWithBlocks(var1, var3, 12, 1, 2, 16, 2, 2, 0, 0, false); +- this.fillWithBlocks(var1, var3, 5, 4, 5, this.scatteredFeatureSizeX - 6, 4, this.scatteredFeatureSizeZ - 6, Block.sandStone.blockID, Block.sandStone.blockID, false); +- this.fillWithBlocks(var1, var3, 9, 4, 9, 11, 4, 11, 0, 0, false); +- this.fillWithMetadataBlocks(var1, var3, 8, 1, 8, 8, 3, 8, Block.sandStone.blockID, 2, Block.sandStone.blockID, 2, false); +- this.fillWithMetadataBlocks(var1, var3, 12, 1, 8, 12, 3, 8, Block.sandStone.blockID, 2, Block.sandStone.blockID, 2, false); +- this.fillWithMetadataBlocks(var1, var3, 8, 1, 12, 8, 3, 12, Block.sandStone.blockID, 2, Block.sandStone.blockID, 2, false); +- this.fillWithMetadataBlocks(var1, var3, 12, 1, 12, 12, 3, 12, Block.sandStone.blockID, 2, Block.sandStone.blockID, 2, false); +- this.fillWithBlocks(var1, var3, 1, 1, 5, 4, 4, 11, Block.sandStone.blockID, Block.sandStone.blockID, false); +- this.fillWithBlocks(var1, var3, this.scatteredFeatureSizeX - 5, 1, 5, this.scatteredFeatureSizeX - 2, 4, 11, Block.sandStone.blockID, Block.sandStone.blockID, false); +- this.fillWithBlocks(var1, var3, 6, 7, 9, 6, 7, 11, Block.sandStone.blockID, Block.sandStone.blockID, false); +- this.fillWithBlocks(var1, var3, this.scatteredFeatureSizeX - 7, 7, 9, this.scatteredFeatureSizeX - 7, 7, 11, Block.sandStone.blockID, Block.sandStone.blockID, false); +- this.fillWithMetadataBlocks(var1, var3, 5, 5, 9, 5, 7, 11, Block.sandStone.blockID, 2, Block.sandStone.blockID, 2, false); +- this.fillWithMetadataBlocks(var1, var3, this.scatteredFeatureSizeX - 6, 5, 9, this.scatteredFeatureSizeX - 6, 7, 11, Block.sandStone.blockID, 2, Block.sandStone.blockID, 2, false); +- this.placeBlockAtCurrentPosition(var1, 0, 0, 5, 5, 10, var3); +- this.placeBlockAtCurrentPosition(var1, 0, 0, 5, 6, 10, var3); +- this.placeBlockAtCurrentPosition(var1, 0, 0, 6, 6, 10, var3); +- this.placeBlockAtCurrentPosition(var1, 0, 0, this.scatteredFeatureSizeX - 6, 5, 10, var3); +- this.placeBlockAtCurrentPosition(var1, 0, 0, this.scatteredFeatureSizeX - 6, 6, 10, var3); +- this.placeBlockAtCurrentPosition(var1, 0, 0, this.scatteredFeatureSizeX - 7, 6, 10, var3); +- this.fillWithBlocks(var1, var3, 2, 4, 4, 2, 6, 4, 0, 0, false); +- this.fillWithBlocks(var1, var3, this.scatteredFeatureSizeX - 3, 4, 4, this.scatteredFeatureSizeX - 3, 6, 4, 0, 0, false); +- this.placeBlockAtCurrentPosition(var1, Block.stairsSandStone.blockID, var4, 2, 4, 5, var3); +- this.placeBlockAtCurrentPosition(var1, Block.stairsSandStone.blockID, var4, 2, 3, 4, var3); +- this.placeBlockAtCurrentPosition(var1, Block.stairsSandStone.blockID, var4, this.scatteredFeatureSizeX - 3, 4, 5, var3); +- this.placeBlockAtCurrentPosition(var1, Block.stairsSandStone.blockID, var4, this.scatteredFeatureSizeX - 3, 3, 4, var3); +- this.fillWithBlocks(var1, var3, 1, 1, 3, 2, 2, 3, Block.sandStone.blockID, Block.sandStone.blockID, false); +- this.fillWithBlocks(var1, var3, this.scatteredFeatureSizeX - 3, 1, 3, this.scatteredFeatureSizeX - 2, 2, 3, Block.sandStone.blockID, Block.sandStone.blockID, false); +- this.placeBlockAtCurrentPosition(var1, Block.stairsSandStone.blockID, 0, 1, 1, 2, var3); +- this.placeBlockAtCurrentPosition(var1, Block.stairsSandStone.blockID, 0, this.scatteredFeatureSizeX - 2, 1, 2, var3); +- this.placeBlockAtCurrentPosition(var1, Block.stoneSingleSlab.blockID, 1, 1, 2, 2, var3); +- this.placeBlockAtCurrentPosition(var1, Block.stoneSingleSlab.blockID, 1, this.scatteredFeatureSizeX - 2, 2, 2, var3); +- this.placeBlockAtCurrentPosition(var1, Block.stairsSandStone.blockID, var7, 2, 1, 2, var3); +- this.placeBlockAtCurrentPosition(var1, Block.stairsSandStone.blockID, var6, this.scatteredFeatureSizeX - 3, 1, 2, var3); +- this.fillWithBlocks(var1, var3, 4, 3, 5, 4, 3, 18, Block.sandStone.blockID, Block.sandStone.blockID, false); +- this.fillWithBlocks(var1, var3, this.scatteredFeatureSizeX - 5, 3, 5, this.scatteredFeatureSizeX - 5, 3, 17, Block.sandStone.blockID, Block.sandStone.blockID, false); +- this.fillWithBlocks(var1, var3, 3, 1, 5, 4, 2, 16, 0, 0, false); +- this.fillWithBlocks(var1, var3, this.scatteredFeatureSizeX - 6, 1, 5, this.scatteredFeatureSizeX - 5, 2, 16, 0, 0, false); +- ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 0, 0, 0, 4, 9, 4, Block.sandStone.blockID, 0, false); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 1, 10, 1, 3, 10, 3, Block.sandStone.blockID, Block.sandStone.blockID, false); ++ this.placeBlockAtCurrentPosition(par1World, Block.stairsSandStone.blockID, var4, 2, 10, 0, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.stairsSandStone.blockID, var5, 2, 10, 4, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.stairsSandStone.blockID, var6, 0, 10, 2, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.stairsSandStone.blockID, var7, 4, 10, 2, par3StructureBoundingBox); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, this.scatteredFeatureSizeX - 5, 0, 0, this.scatteredFeatureSizeX - 1, 9, 4, Block.sandStone.blockID, 0, false); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, this.scatteredFeatureSizeX - 4, 10, 1, this.scatteredFeatureSizeX - 2, 10, 3, Block.sandStone.blockID, Block.sandStone.blockID, false); ++ this.placeBlockAtCurrentPosition(par1World, Block.stairsSandStone.blockID, var4, this.scatteredFeatureSizeX - 3, 10, 0, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.stairsSandStone.blockID, var5, this.scatteredFeatureSizeX - 3, 10, 4, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.stairsSandStone.blockID, var6, this.scatteredFeatureSizeX - 5, 10, 2, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.stairsSandStone.blockID, var7, this.scatteredFeatureSizeX - 1, 10, 2, par3StructureBoundingBox); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 8, 0, 0, 12, 4, 4, Block.sandStone.blockID, 0, false); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 9, 1, 0, 11, 3, 4, 0, 0, false); ++ this.placeBlockAtCurrentPosition(par1World, Block.sandStone.blockID, 2, 9, 1, 1, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.sandStone.blockID, 2, 9, 2, 1, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.sandStone.blockID, 2, 9, 3, 1, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.sandStone.blockID, 2, 10, 3, 1, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.sandStone.blockID, 2, 11, 3, 1, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.sandStone.blockID, 2, 11, 2, 1, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.sandStone.blockID, 2, 11, 1, 1, par3StructureBoundingBox); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 4, 1, 1, 8, 3, 3, Block.sandStone.blockID, 0, false); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 4, 1, 2, 8, 2, 2, 0, 0, false); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 12, 1, 1, 16, 3, 3, Block.sandStone.blockID, 0, false); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 12, 1, 2, 16, 2, 2, 0, 0, false); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 5, 4, 5, this.scatteredFeatureSizeX - 6, 4, this.scatteredFeatureSizeZ - 6, Block.sandStone.blockID, Block.sandStone.blockID, false); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 9, 4, 9, 11, 4, 11, 0, 0, false); ++ this.fillWithMetadataBlocks(par1World, par3StructureBoundingBox, 8, 1, 8, 8, 3, 8, Block.sandStone.blockID, 2, Block.sandStone.blockID, 2, false); ++ this.fillWithMetadataBlocks(par1World, par3StructureBoundingBox, 12, 1, 8, 12, 3, 8, Block.sandStone.blockID, 2, Block.sandStone.blockID, 2, false); ++ this.fillWithMetadataBlocks(par1World, par3StructureBoundingBox, 8, 1, 12, 8, 3, 12, Block.sandStone.blockID, 2, Block.sandStone.blockID, 2, false); ++ this.fillWithMetadataBlocks(par1World, par3StructureBoundingBox, 12, 1, 12, 12, 3, 12, Block.sandStone.blockID, 2, Block.sandStone.blockID, 2, false); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 1, 1, 5, 4, 4, 11, Block.sandStone.blockID, Block.sandStone.blockID, false); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, this.scatteredFeatureSizeX - 5, 1, 5, this.scatteredFeatureSizeX - 2, 4, 11, Block.sandStone.blockID, Block.sandStone.blockID, false); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 6, 7, 9, 6, 7, 11, Block.sandStone.blockID, Block.sandStone.blockID, false); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, this.scatteredFeatureSizeX - 7, 7, 9, this.scatteredFeatureSizeX - 7, 7, 11, Block.sandStone.blockID, Block.sandStone.blockID, false); ++ this.fillWithMetadataBlocks(par1World, par3StructureBoundingBox, 5, 5, 9, 5, 7, 11, Block.sandStone.blockID, 2, Block.sandStone.blockID, 2, false); ++ this.fillWithMetadataBlocks(par1World, par3StructureBoundingBox, this.scatteredFeatureSizeX - 6, 5, 9, this.scatteredFeatureSizeX - 6, 7, 11, Block.sandStone.blockID, 2, Block.sandStone.blockID, 2, false); ++ this.placeBlockAtCurrentPosition(par1World, 0, 0, 5, 5, 10, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, 0, 0, 5, 6, 10, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, 0, 0, 6, 6, 10, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, 0, 0, this.scatteredFeatureSizeX - 6, 5, 10, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, 0, 0, this.scatteredFeatureSizeX - 6, 6, 10, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, 0, 0, this.scatteredFeatureSizeX - 7, 6, 10, par3StructureBoundingBox); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 2, 4, 4, 2, 6, 4, 0, 0, false); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, this.scatteredFeatureSizeX - 3, 4, 4, this.scatteredFeatureSizeX - 3, 6, 4, 0, 0, false); ++ this.placeBlockAtCurrentPosition(par1World, Block.stairsSandStone.blockID, var4, 2, 4, 5, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.stairsSandStone.blockID, var4, 2, 3, 4, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.stairsSandStone.blockID, var4, this.scatteredFeatureSizeX - 3, 4, 5, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.stairsSandStone.blockID, var4, this.scatteredFeatureSizeX - 3, 3, 4, par3StructureBoundingBox); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 1, 1, 3, 2, 2, 3, Block.sandStone.blockID, Block.sandStone.blockID, false); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, this.scatteredFeatureSizeX - 3, 1, 3, this.scatteredFeatureSizeX - 2, 2, 3, Block.sandStone.blockID, Block.sandStone.blockID, false); ++ this.placeBlockAtCurrentPosition(par1World, Block.stairsSandStone.blockID, 0, 1, 1, 2, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.stairsSandStone.blockID, 0, this.scatteredFeatureSizeX - 2, 1, 2, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.stoneSingleSlab.blockID, 1, 1, 2, 2, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.stoneSingleSlab.blockID, 1, this.scatteredFeatureSizeX - 2, 2, 2, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.stairsSandStone.blockID, var7, 2, 1, 2, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.stairsSandStone.blockID, var6, this.scatteredFeatureSizeX - 3, 1, 2, par3StructureBoundingBox); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 4, 3, 5, 4, 3, 18, Block.sandStone.blockID, Block.sandStone.blockID, false); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, this.scatteredFeatureSizeX - 5, 3, 5, this.scatteredFeatureSizeX - 5, 3, 17, Block.sandStone.blockID, Block.sandStone.blockID, false); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 3, 1, 5, 4, 2, 16, 0, 0, false); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, this.scatteredFeatureSizeX - 6, 1, 5, this.scatteredFeatureSizeX - 5, 2, 16, 0, 0, false); + int var10; +- for(var10 = 5; var10 <= 17; var10 += 2) { +- this.placeBlockAtCurrentPosition(var1, Block.sandStone.blockID, 2, 4, 1, var10, var3); +- this.placeBlockAtCurrentPosition(var1, Block.sandStone.blockID, 1, 4, 2, var10, var3); +- this.placeBlockAtCurrentPosition(var1, Block.sandStone.blockID, 2, this.scatteredFeatureSizeX - 5, 1, var10, var3); +- this.placeBlockAtCurrentPosition(var1, Block.sandStone.blockID, 1, this.scatteredFeatureSizeX - 5, 2, var10, var3); +- } +- +- this.placeBlockAtCurrentPosition(var1, Block.cloth.blockID, var8, 10, 0, 7, var3); +- this.placeBlockAtCurrentPosition(var1, Block.cloth.blockID, var8, 10, 0, 8, var3); +- this.placeBlockAtCurrentPosition(var1, Block.cloth.blockID, var8, 9, 0, 9, var3); +- this.placeBlockAtCurrentPosition(var1, Block.cloth.blockID, var8, 11, 0, 9, var3); +- this.placeBlockAtCurrentPosition(var1, Block.cloth.blockID, var8, 8, 0, 10, var3); +- this.placeBlockAtCurrentPosition(var1, Block.cloth.blockID, var8, 12, 0, 10, var3); +- this.placeBlockAtCurrentPosition(var1, Block.cloth.blockID, var8, 7, 0, 10, var3); +- this.placeBlockAtCurrentPosition(var1, Block.cloth.blockID, var8, 13, 0, 10, var3); +- this.placeBlockAtCurrentPosition(var1, Block.cloth.blockID, var8, 9, 0, 11, var3); +- this.placeBlockAtCurrentPosition(var1, Block.cloth.blockID, var8, 11, 0, 11, var3); +- this.placeBlockAtCurrentPosition(var1, Block.cloth.blockID, var8, 10, 0, 12, var3); +- this.placeBlockAtCurrentPosition(var1, Block.cloth.blockID, var8, 10, 0, 13, var3); +- this.placeBlockAtCurrentPosition(var1, Block.cloth.blockID, var9, 10, 0, 10, var3); +- +- for(var10 = 0; var10 <= this.scatteredFeatureSizeX - 1; var10 += this.scatteredFeatureSizeX - 1) { +- this.placeBlockAtCurrentPosition(var1, Block.sandStone.blockID, 2, var10, 2, 1, var3); +- this.placeBlockAtCurrentPosition(var1, Block.cloth.blockID, var8, var10, 2, 2, var3); +- this.placeBlockAtCurrentPosition(var1, Block.sandStone.blockID, 2, var10, 2, 3, var3); +- this.placeBlockAtCurrentPosition(var1, Block.sandStone.blockID, 2, var10, 3, 1, var3); +- this.placeBlockAtCurrentPosition(var1, Block.cloth.blockID, var8, var10, 3, 2, var3); +- this.placeBlockAtCurrentPosition(var1, Block.sandStone.blockID, 2, var10, 3, 3, var3); +- this.placeBlockAtCurrentPosition(var1, Block.cloth.blockID, var8, var10, 4, 1, var3); +- this.placeBlockAtCurrentPosition(var1, Block.sandStone.blockID, 1, var10, 4, 2, var3); +- this.placeBlockAtCurrentPosition(var1, Block.cloth.blockID, var8, var10, 4, 3, var3); +- this.placeBlockAtCurrentPosition(var1, Block.sandStone.blockID, 2, var10, 5, 1, var3); +- this.placeBlockAtCurrentPosition(var1, Block.cloth.blockID, var8, var10, 5, 2, var3); +- this.placeBlockAtCurrentPosition(var1, Block.sandStone.blockID, 2, var10, 5, 3, var3); +- this.placeBlockAtCurrentPosition(var1, Block.cloth.blockID, var8, var10, 6, 1, var3); +- this.placeBlockAtCurrentPosition(var1, Block.sandStone.blockID, 1, var10, 6, 2, var3); +- this.placeBlockAtCurrentPosition(var1, Block.cloth.blockID, var8, var10, 6, 3, var3); +- this.placeBlockAtCurrentPosition(var1, Block.cloth.blockID, var8, var10, 7, 1, var3); +- this.placeBlockAtCurrentPosition(var1, Block.cloth.blockID, var8, var10, 7, 2, var3); +- this.placeBlockAtCurrentPosition(var1, Block.cloth.blockID, var8, var10, 7, 3, var3); +- this.placeBlockAtCurrentPosition(var1, Block.sandStone.blockID, 2, var10, 8, 1, var3); +- this.placeBlockAtCurrentPosition(var1, Block.sandStone.blockID, 2, var10, 8, 2, var3); +- this.placeBlockAtCurrentPosition(var1, Block.sandStone.blockID, 2, var10, 8, 3, var3); +- } +- +- for(var10 = 2; var10 <= this.scatteredFeatureSizeX - 3; var10 += this.scatteredFeatureSizeX - 3 - 2) { +- this.placeBlockAtCurrentPosition(var1, Block.sandStone.blockID, 2, var10 - 1, 2, 0, var3); +- this.placeBlockAtCurrentPosition(var1, Block.cloth.blockID, var8, var10, 2, 0, var3); +- this.placeBlockAtCurrentPosition(var1, Block.sandStone.blockID, 2, var10 + 1, 2, 0, var3); +- this.placeBlockAtCurrentPosition(var1, Block.sandStone.blockID, 2, var10 - 1, 3, 0, var3); +- this.placeBlockAtCurrentPosition(var1, Block.cloth.blockID, var8, var10, 3, 0, var3); +- this.placeBlockAtCurrentPosition(var1, Block.sandStone.blockID, 2, var10 + 1, 3, 0, var3); +- this.placeBlockAtCurrentPosition(var1, Block.cloth.blockID, var8, var10 - 1, 4, 0, var3); +- this.placeBlockAtCurrentPosition(var1, Block.sandStone.blockID, 1, var10, 4, 0, var3); +- this.placeBlockAtCurrentPosition(var1, Block.cloth.blockID, var8, var10 + 1, 4, 0, var3); +- this.placeBlockAtCurrentPosition(var1, Block.sandStone.blockID, 2, var10 - 1, 5, 0, var3); +- this.placeBlockAtCurrentPosition(var1, Block.cloth.blockID, var8, var10, 5, 0, var3); +- this.placeBlockAtCurrentPosition(var1, Block.sandStone.blockID, 2, var10 + 1, 5, 0, var3); +- this.placeBlockAtCurrentPosition(var1, Block.cloth.blockID, var8, var10 - 1, 6, 0, var3); +- this.placeBlockAtCurrentPosition(var1, Block.sandStone.blockID, 1, var10, 6, 0, var3); +- this.placeBlockAtCurrentPosition(var1, Block.cloth.blockID, var8, var10 + 1, 6, 0, var3); +- this.placeBlockAtCurrentPosition(var1, Block.cloth.blockID, var8, var10 - 1, 7, 0, var3); +- this.placeBlockAtCurrentPosition(var1, Block.cloth.blockID, var8, var10, 7, 0, var3); +- this.placeBlockAtCurrentPosition(var1, Block.cloth.blockID, var8, var10 + 1, 7, 0, var3); +- this.placeBlockAtCurrentPosition(var1, Block.sandStone.blockID, 2, var10 - 1, 8, 0, var3); +- this.placeBlockAtCurrentPosition(var1, Block.sandStone.blockID, 2, var10, 8, 0, var3); +- this.placeBlockAtCurrentPosition(var1, Block.sandStone.blockID, 2, var10 + 1, 8, 0, var3); +- } +- +- this.fillWithMetadataBlocks(var1, var3, 8, 4, 0, 12, 6, 0, Block.sandStone.blockID, 2, Block.sandStone.blockID, 2, false); +- this.placeBlockAtCurrentPosition(var1, 0, 0, 8, 6, 0, var3); +- this.placeBlockAtCurrentPosition(var1, 0, 0, 12, 6, 0, var3); +- this.placeBlockAtCurrentPosition(var1, Block.cloth.blockID, var8, 9, 5, 0, var3); +- this.placeBlockAtCurrentPosition(var1, Block.sandStone.blockID, 1, 10, 5, 0, var3); +- this.placeBlockAtCurrentPosition(var1, Block.cloth.blockID, var8, 11, 5, 0, var3); +- this.fillWithMetadataBlocks(var1, var3, 8, -14, 8, 12, -11, 12, Block.sandStone.blockID, 2, Block.sandStone.blockID, 2, false); +- this.fillWithMetadataBlocks(var1, var3, 8, -10, 8, 12, -10, 12, Block.sandStone.blockID, 1, Block.sandStone.blockID, 1, false); +- this.fillWithMetadataBlocks(var1, var3, 8, -9, 8, 12, -9, 12, Block.sandStone.blockID, 2, Block.sandStone.blockID, 2, false); +- this.fillWithBlocks(var1, var3, 8, -8, 8, 12, -1, 12, Block.sandStone.blockID, Block.sandStone.blockID, false); +- this.fillWithBlocks(var1, var3, 9, -11, 9, 11, -1, 11, 0, 0, false); +- this.placeBlockAtCurrentPosition(var1, Block.pressurePlateStone.blockID, 0, 10, -11, 10, var3); +- this.fillWithBlocks(var1, var3, 9, -13, 9, 11, -13, 11, Block.tnt.blockID, 0, false); +- this.placeBlockAtCurrentPosition(var1, 0, 0, 8, -11, 10, var3); +- this.placeBlockAtCurrentPosition(var1, 0, 0, 8, -10, 10, var3); +- this.placeBlockAtCurrentPosition(var1, Block.sandStone.blockID, 1, 7, -10, 10, var3); +- this.placeBlockAtCurrentPosition(var1, Block.sandStone.blockID, 2, 7, -11, 10, var3); +- this.placeBlockAtCurrentPosition(var1, 0, 0, 12, -11, 10, var3); +- this.placeBlockAtCurrentPosition(var1, 0, 0, 12, -10, 10, var3); +- this.placeBlockAtCurrentPosition(var1, Block.sandStone.blockID, 1, 13, -10, 10, var3); +- this.placeBlockAtCurrentPosition(var1, Block.sandStone.blockID, 2, 13, -11, 10, var3); +- this.placeBlockAtCurrentPosition(var1, 0, 0, 10, -11, 8, var3); +- this.placeBlockAtCurrentPosition(var1, 0, 0, 10, -10, 8, var3); +- this.placeBlockAtCurrentPosition(var1, Block.sandStone.blockID, 1, 10, -10, 7, var3); +- this.placeBlockAtCurrentPosition(var1, Block.sandStone.blockID, 2, 10, -11, 7, var3); +- this.placeBlockAtCurrentPosition(var1, 0, 0, 10, -11, 12, var3); +- this.placeBlockAtCurrentPosition(var1, 0, 0, 10, -10, 12, var3); +- this.placeBlockAtCurrentPosition(var1, Block.sandStone.blockID, 1, 10, -10, 13, var3); +- this.placeBlockAtCurrentPosition(var1, Block.sandStone.blockID, 2, 10, -11, 13, var3); +- +- for(var10 = 0; var10 < 4; ++var10) { +- if(!this.field_74940_h[var10]) { ++ ++ for (var10 = 5; var10 <= 17; var10 += 2) { ++ this.placeBlockAtCurrentPosition(par1World, Block.sandStone.blockID, 2, 4, 1, var10, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.sandStone.blockID, 1, 4, 2, var10, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.sandStone.blockID, 2, this.scatteredFeatureSizeX - 5, 1, var10, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.sandStone.blockID, 1, this.scatteredFeatureSizeX - 5, 2, var10, par3StructureBoundingBox); ++ } ++ ++ this.placeBlockAtCurrentPosition(par1World, Block.cloth.blockID, var8, 10, 0, 7, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.cloth.blockID, var8, 10, 0, 8, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.cloth.blockID, var8, 9, 0, 9, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.cloth.blockID, var8, 11, 0, 9, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.cloth.blockID, var8, 8, 0, 10, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.cloth.blockID, var8, 12, 0, 10, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.cloth.blockID, var8, 7, 0, 10, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.cloth.blockID, var8, 13, 0, 10, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.cloth.blockID, var8, 9, 0, 11, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.cloth.blockID, var8, 11, 0, 11, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.cloth.blockID, var8, 10, 0, 12, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.cloth.blockID, var8, 10, 0, 13, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.cloth.blockID, var9, 10, 0, 10, par3StructureBoundingBox); ++ ++ for (var10 = 0; var10 <= this.scatteredFeatureSizeX - 1; var10 += this.scatteredFeatureSizeX - 1) { ++ this.placeBlockAtCurrentPosition(par1World, Block.sandStone.blockID, 2, var10, 2, 1, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.cloth.blockID, var8, var10, 2, 2, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.sandStone.blockID, 2, var10, 2, 3, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.sandStone.blockID, 2, var10, 3, 1, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.cloth.blockID, var8, var10, 3, 2, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.sandStone.blockID, 2, var10, 3, 3, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.cloth.blockID, var8, var10, 4, 1, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.sandStone.blockID, 1, var10, 4, 2, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.cloth.blockID, var8, var10, 4, 3, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.sandStone.blockID, 2, var10, 5, 1, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.cloth.blockID, var8, var10, 5, 2, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.sandStone.blockID, 2, var10, 5, 3, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.cloth.blockID, var8, var10, 6, 1, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.sandStone.blockID, 1, var10, 6, 2, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.cloth.blockID, var8, var10, 6, 3, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.cloth.blockID, var8, var10, 7, 1, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.cloth.blockID, var8, var10, 7, 2, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.cloth.blockID, var8, var10, 7, 3, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.sandStone.blockID, 2, var10, 8, 1, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.sandStone.blockID, 2, var10, 8, 2, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.sandStone.blockID, 2, var10, 8, 3, par3StructureBoundingBox); ++ } ++ ++ for (var10 = 2; var10 <= this.scatteredFeatureSizeX - 3; var10 += this.scatteredFeatureSizeX - 3 - 2) { ++ this.placeBlockAtCurrentPosition(par1World, Block.sandStone.blockID, 2, var10 - 1, 2, 0, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.cloth.blockID, var8, var10, 2, 0, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.sandStone.blockID, 2, var10 + 1, 2, 0, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.sandStone.blockID, 2, var10 - 1, 3, 0, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.cloth.blockID, var8, var10, 3, 0, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.sandStone.blockID, 2, var10 + 1, 3, 0, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.cloth.blockID, var8, var10 - 1, 4, 0, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.sandStone.blockID, 1, var10, 4, 0, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.cloth.blockID, var8, var10 + 1, 4, 0, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.sandStone.blockID, 2, var10 - 1, 5, 0, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.cloth.blockID, var8, var10, 5, 0, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.sandStone.blockID, 2, var10 + 1, 5, 0, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.cloth.blockID, var8, var10 - 1, 6, 0, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.sandStone.blockID, 1, var10, 6, 0, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.cloth.blockID, var8, var10 + 1, 6, 0, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.cloth.blockID, var8, var10 - 1, 7, 0, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.cloth.blockID, var8, var10, 7, 0, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.cloth.blockID, var8, var10 + 1, 7, 0, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.sandStone.blockID, 2, var10 - 1, 8, 0, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.sandStone.blockID, 2, var10, 8, 0, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.sandStone.blockID, 2, var10 + 1, 8, 0, par3StructureBoundingBox); ++ } ++ ++ this.fillWithMetadataBlocks(par1World, par3StructureBoundingBox, 8, 4, 0, 12, 6, 0, Block.sandStone.blockID, 2, Block.sandStone.blockID, 2, false); ++ this.placeBlockAtCurrentPosition(par1World, 0, 0, 8, 6, 0, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, 0, 0, 12, 6, 0, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.cloth.blockID, var8, 9, 5, 0, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.sandStone.blockID, 1, 10, 5, 0, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.cloth.blockID, var8, 11, 5, 0, par3StructureBoundingBox); ++ this.fillWithMetadataBlocks(par1World, par3StructureBoundingBox, 8, -14, 8, 12, -11, 12, Block.sandStone.blockID, 2, Block.sandStone.blockID, 2, false); ++ this.fillWithMetadataBlocks(par1World, par3StructureBoundingBox, 8, -10, 8, 12, -10, 12, Block.sandStone.blockID, 1, Block.sandStone.blockID, 1, false); ++ this.fillWithMetadataBlocks(par1World, par3StructureBoundingBox, 8, -9, 8, 12, -9, 12, Block.sandStone.blockID, 2, Block.sandStone.blockID, 2, false); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 8, -8, 8, 12, -1, 12, Block.sandStone.blockID, Block.sandStone.blockID, false); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 9, -11, 9, 11, -1, 11, 0, 0, false); ++ this.placeBlockAtCurrentPosition(par1World, Block.pressurePlateStone.blockID, 0, 10, -11, 10, par3StructureBoundingBox); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 9, -13, 9, 11, -13, 11, Block.tnt.blockID, 0, false); ++ this.placeBlockAtCurrentPosition(par1World, 0, 0, 8, -11, 10, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, 0, 0, 8, -10, 10, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.sandStone.blockID, 1, 7, -10, 10, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.sandStone.blockID, 2, 7, -11, 10, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, 0, 0, 12, -11, 10, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, 0, 0, 12, -10, 10, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.sandStone.blockID, 1, 13, -10, 10, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.sandStone.blockID, 2, 13, -11, 10, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, 0, 0, 10, -11, 8, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, 0, 0, 10, -10, 8, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.sandStone.blockID, 1, 10, -10, 7, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.sandStone.blockID, 2, 10, -11, 7, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, 0, 0, 10, -11, 12, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, 0, 0, 10, -10, 12, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.sandStone.blockID, 1, 10, -10, 13, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.sandStone.blockID, 2, 10, -11, 13, par3StructureBoundingBox); ++ ++ for (var10 = 0; var10 < 4; ++var10) { ++ if (!this.field_74940_h[var10]) { + int var11 = Direction.offsetX[var10] * 2; + int var12 = Direction.offsetZ[var10] * 2; +- this.field_74940_h[var10] = this.generateStructureChestContents(var1, var3, var2, 10 + var11, -11, 10 + var12, WeightedRandomChestContent.func_92080_a(itemsToGenerateInTemple, new WeightedRandomChestContent[]{Item.enchantedBook.func_92114_b(var2)}), 2 + var2.nextInt(5)); ++ this.field_74940_h[var10] = this.generateStructureChestContents(par1World, par3StructureBoundingBox, par2Random, 10 + var11, -11, 10 + var12, WeightedRandomChestContent.func_92080_a(itemsToGenerateInTemple, new WeightedRandomChestContent[] {Item.enchantedBook.func_92114_b(par2Random)}), 2 + par2Random.nextInt(5)); + } + } + diff --git a/patches/net/minecraft/src/ComponentScatteredFeatureJunglePyramid.java.patch b/patches/net/minecraft/src/ComponentScatteredFeatureJunglePyramid.java.patch new file mode 100644 index 0000000..3265a3d --- /dev/null +++ b/patches/net/minecraft/src/ComponentScatteredFeatureJunglePyramid.java.patch @@ -0,0 +1,410 @@ +--- net/minecraft/src/ComponentScatteredFeatureJunglePyramid.java ++++ net/minecraft/src/ComponentScatteredFeatureJunglePyramid.java +@@ -7,206 +7,221 @@ + private boolean field_74948_i; + private boolean field_74945_j; + private boolean field_74946_k; +- private static final WeightedRandomChestContent[] junglePyramidsChestContents = new WeightedRandomChestContent[]{new WeightedRandomChestContent(Item.diamond.itemID, 0, 1, 3, 3), new WeightedRandomChestContent(Item.ingotIron.itemID, 0, 1, 5, 10), new WeightedRandomChestContent(Item.ingotGold.itemID, 0, 2, 7, 15), new WeightedRandomChestContent(Item.emerald.itemID, 0, 1, 3, 2), new WeightedRandomChestContent(Item.bone.itemID, 0, 4, 6, 20), new WeightedRandomChestContent(Item.rottenFlesh.itemID, 0, 3, 7, 16), new WeightedRandomChestContent(Item.saddle.itemID, 0, 1, 1, 3), new WeightedRandomChestContent(Item.horseArmorIron.itemID, 0, 1, 1, 1), new WeightedRandomChestContent(Item.horseArmorGold.itemID, 0, 1, 1, 1), new WeightedRandomChestContent(Item.horseArmorDiamond.itemID, 0, 1, 1, 1)}; +- private static final WeightedRandomChestContent[] junglePyramidsDispenserContents = new WeightedRandomChestContent[]{new WeightedRandomChestContent(Item.arrow.itemID, 0, 2, 7, 30)}; ++ ++ /** List of Chest contents to be generated in the Jungle Pyramid chests. */ ++ private static final WeightedRandomChestContent[] junglePyramidsChestContents = new WeightedRandomChestContent[] {new WeightedRandomChestContent(Item.diamond.itemID, 0, 1, 3, 3), new WeightedRandomChestContent(Item.ingotIron.itemID, 0, 1, 5, 10), new WeightedRandomChestContent(Item.ingotGold.itemID, 0, 2, 7, 15), new WeightedRandomChestContent(Item.emerald.itemID, 0, 1, 3, 2), new WeightedRandomChestContent(Item.bone.itemID, 0, 4, 6, 20), new WeightedRandomChestContent(Item.rottenFlesh.itemID, 0, 3, 7, 16), new WeightedRandomChestContent(Item.saddle.itemID, 0, 1, 1, 3), new WeightedRandomChestContent(Item.horseArmorIron.itemID, 0, 1, 1, 1), new WeightedRandomChestContent(Item.horseArmorGold.itemID, 0, 1, 1, 1), new WeightedRandomChestContent(Item.horseArmorDiamond.itemID, 0, 1, 1, 1)}; ++ ++ /** ++ * List of Dispenser contents to be generated in the Jungle Pyramid dispensers. ++ */ ++ private static final WeightedRandomChestContent[] junglePyramidsDispenserContents = new WeightedRandomChestContent[] {new WeightedRandomChestContent(Item.arrow.itemID, 0, 2, 7, 30)}; ++ ++ /** List of random stones to be generated in the Jungle Pyramid. */ + private static StructureScatteredFeatureStones junglePyramidsRandomScatteredStones = new StructureScatteredFeatureStones((ComponentScatteredFeaturePieces2)null); + +- public ComponentScatteredFeatureJunglePyramid() { +- } +- +- public ComponentScatteredFeatureJunglePyramid(Random var1, int var2, int var3) { +- super(var1, var2, 64, var3, 12, 10, 15); +- } +- +- protected void func_143012_a(NBTTagCompound var1) { +- super.func_143012_a(var1); +- var1.setBoolean("placedMainChest", this.field_74947_h); +- var1.setBoolean("placedHiddenChest", this.field_74948_i); +- var1.setBoolean("placedTrap1", this.field_74945_j); +- var1.setBoolean("placedTrap2", this.field_74946_k); +- } +- +- protected void func_143011_b(NBTTagCompound var1) { +- super.func_143011_b(var1); +- this.field_74947_h = var1.getBoolean("placedMainChest"); +- this.field_74948_i = var1.getBoolean("placedHiddenChest"); +- this.field_74945_j = var1.getBoolean("placedTrap1"); +- this.field_74946_k = var1.getBoolean("placedTrap2"); +- } +- +- public boolean addComponentParts(World var1, Random var2, StructureBoundingBox var3) { +- if(!this.func_74935_a(var1, var3, 0)) { ++ public ComponentScatteredFeatureJunglePyramid() {} ++ ++ public ComponentScatteredFeatureJunglePyramid(Random par1Random, int par2, int par3) { ++ super(par1Random, par2, 64, par3, 12, 10, 15); ++ } ++ ++ protected void func_143012_a(NBTTagCompound par1NBTTagCompound) { ++ super.func_143012_a(par1NBTTagCompound); ++ par1NBTTagCompound.setBoolean("placedMainChest", this.field_74947_h); ++ par1NBTTagCompound.setBoolean("placedHiddenChest", this.field_74948_i); ++ par1NBTTagCompound.setBoolean("placedTrap1", this.field_74945_j); ++ par1NBTTagCompound.setBoolean("placedTrap2", this.field_74946_k); ++ } ++ ++ protected void func_143011_b(NBTTagCompound par1NBTTagCompound) { ++ super.func_143011_b(par1NBTTagCompound); ++ this.field_74947_h = par1NBTTagCompound.getBoolean("placedMainChest"); ++ this.field_74948_i = par1NBTTagCompound.getBoolean("placedHiddenChest"); ++ this.field_74945_j = par1NBTTagCompound.getBoolean("placedTrap1"); ++ this.field_74946_k = par1NBTTagCompound.getBoolean("placedTrap2"); ++ } ++ ++ /** ++ * second Part of Structure generating, this for example places Spiderwebs, Mob Spawners, it closes Mineshafts at the ++ * end, it adds Fences... ++ */ ++ public boolean addComponentParts(World par1World, Random par2Random, StructureBoundingBox par3StructureBoundingBox) { ++ if (!this.func_74935_a(par1World, par3StructureBoundingBox, 0)) { + return false; + } else { + int var4 = this.getMetadataWithOffset(Block.stairsCobblestone.blockID, 3); + int var5 = this.getMetadataWithOffset(Block.stairsCobblestone.blockID, 2); + int var6 = this.getMetadataWithOffset(Block.stairsCobblestone.blockID, 0); + int var7 = this.getMetadataWithOffset(Block.stairsCobblestone.blockID, 1); +- this.fillWithRandomizedBlocks(var1, var3, 0, -4, 0, this.scatteredFeatureSizeX - 1, 0, this.scatteredFeatureSizeZ - 1, false, var2, junglePyramidsRandomScatteredStones); +- this.fillWithRandomizedBlocks(var1, var3, 2, 1, 2, 9, 2, 2, false, var2, junglePyramidsRandomScatteredStones); +- this.fillWithRandomizedBlocks(var1, var3, 2, 1, 12, 9, 2, 12, false, var2, junglePyramidsRandomScatteredStones); +- this.fillWithRandomizedBlocks(var1, var3, 2, 1, 3, 2, 2, 11, false, var2, junglePyramidsRandomScatteredStones); +- this.fillWithRandomizedBlocks(var1, var3, 9, 1, 3, 9, 2, 11, false, var2, junglePyramidsRandomScatteredStones); +- this.fillWithRandomizedBlocks(var1, var3, 1, 3, 1, 10, 6, 1, false, var2, junglePyramidsRandomScatteredStones); +- this.fillWithRandomizedBlocks(var1, var3, 1, 3, 13, 10, 6, 13, false, var2, junglePyramidsRandomScatteredStones); +- this.fillWithRandomizedBlocks(var1, var3, 1, 3, 2, 1, 6, 12, false, var2, junglePyramidsRandomScatteredStones); +- this.fillWithRandomizedBlocks(var1, var3, 10, 3, 2, 10, 6, 12, false, var2, junglePyramidsRandomScatteredStones); +- this.fillWithRandomizedBlocks(var1, var3, 2, 3, 2, 9, 3, 12, false, var2, junglePyramidsRandomScatteredStones); +- this.fillWithRandomizedBlocks(var1, var3, 2, 6, 2, 9, 6, 12, false, var2, junglePyramidsRandomScatteredStones); +- this.fillWithRandomizedBlocks(var1, var3, 3, 7, 3, 8, 7, 11, false, var2, junglePyramidsRandomScatteredStones); +- this.fillWithRandomizedBlocks(var1, var3, 4, 8, 4, 7, 8, 10, false, var2, junglePyramidsRandomScatteredStones); +- this.fillWithAir(var1, var3, 3, 1, 3, 8, 2, 11); +- this.fillWithAir(var1, var3, 4, 3, 6, 7, 3, 9); +- this.fillWithAir(var1, var3, 2, 4, 2, 9, 5, 12); +- this.fillWithAir(var1, var3, 4, 6, 5, 7, 6, 9); +- this.fillWithAir(var1, var3, 5, 7, 6, 6, 7, 8); +- this.fillWithAir(var1, var3, 5, 1, 2, 6, 2, 2); +- this.fillWithAir(var1, var3, 5, 2, 12, 6, 2, 12); +- this.fillWithAir(var1, var3, 5, 5, 1, 6, 5, 1); +- this.fillWithAir(var1, var3, 5, 5, 13, 6, 5, 13); +- this.placeBlockAtCurrentPosition(var1, 0, 0, 1, 5, 5, var3); +- this.placeBlockAtCurrentPosition(var1, 0, 0, 10, 5, 5, var3); +- this.placeBlockAtCurrentPosition(var1, 0, 0, 1, 5, 9, var3); +- this.placeBlockAtCurrentPosition(var1, 0, 0, 10, 5, 9, var3); +- ++ this.fillWithRandomizedBlocks(par1World, par3StructureBoundingBox, 0, -4, 0, this.scatteredFeatureSizeX - 1, 0, this.scatteredFeatureSizeZ - 1, false, par2Random, junglePyramidsRandomScatteredStones); ++ this.fillWithRandomizedBlocks(par1World, par3StructureBoundingBox, 2, 1, 2, 9, 2, 2, false, par2Random, junglePyramidsRandomScatteredStones); ++ this.fillWithRandomizedBlocks(par1World, par3StructureBoundingBox, 2, 1, 12, 9, 2, 12, false, par2Random, junglePyramidsRandomScatteredStones); ++ this.fillWithRandomizedBlocks(par1World, par3StructureBoundingBox, 2, 1, 3, 2, 2, 11, false, par2Random, junglePyramidsRandomScatteredStones); ++ this.fillWithRandomizedBlocks(par1World, par3StructureBoundingBox, 9, 1, 3, 9, 2, 11, false, par2Random, junglePyramidsRandomScatteredStones); ++ this.fillWithRandomizedBlocks(par1World, par3StructureBoundingBox, 1, 3, 1, 10, 6, 1, false, par2Random, junglePyramidsRandomScatteredStones); ++ this.fillWithRandomizedBlocks(par1World, par3StructureBoundingBox, 1, 3, 13, 10, 6, 13, false, par2Random, junglePyramidsRandomScatteredStones); ++ this.fillWithRandomizedBlocks(par1World, par3StructureBoundingBox, 1, 3, 2, 1, 6, 12, false, par2Random, junglePyramidsRandomScatteredStones); ++ this.fillWithRandomizedBlocks(par1World, par3StructureBoundingBox, 10, 3, 2, 10, 6, 12, false, par2Random, junglePyramidsRandomScatteredStones); ++ this.fillWithRandomizedBlocks(par1World, par3StructureBoundingBox, 2, 3, 2, 9, 3, 12, false, par2Random, junglePyramidsRandomScatteredStones); ++ this.fillWithRandomizedBlocks(par1World, par3StructureBoundingBox, 2, 6, 2, 9, 6, 12, false, par2Random, junglePyramidsRandomScatteredStones); ++ this.fillWithRandomizedBlocks(par1World, par3StructureBoundingBox, 3, 7, 3, 8, 7, 11, false, par2Random, junglePyramidsRandomScatteredStones); ++ this.fillWithRandomizedBlocks(par1World, par3StructureBoundingBox, 4, 8, 4, 7, 8, 10, false, par2Random, junglePyramidsRandomScatteredStones); ++ this.fillWithAir(par1World, par3StructureBoundingBox, 3, 1, 3, 8, 2, 11); ++ this.fillWithAir(par1World, par3StructureBoundingBox, 4, 3, 6, 7, 3, 9); ++ this.fillWithAir(par1World, par3StructureBoundingBox, 2, 4, 2, 9, 5, 12); ++ this.fillWithAir(par1World, par3StructureBoundingBox, 4, 6, 5, 7, 6, 9); ++ this.fillWithAir(par1World, par3StructureBoundingBox, 5, 7, 6, 6, 7, 8); ++ this.fillWithAir(par1World, par3StructureBoundingBox, 5, 1, 2, 6, 2, 2); ++ this.fillWithAir(par1World, par3StructureBoundingBox, 5, 2, 12, 6, 2, 12); ++ this.fillWithAir(par1World, par3StructureBoundingBox, 5, 5, 1, 6, 5, 1); ++ this.fillWithAir(par1World, par3StructureBoundingBox, 5, 5, 13, 6, 5, 13); ++ this.placeBlockAtCurrentPosition(par1World, 0, 0, 1, 5, 5, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, 0, 0, 10, 5, 5, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, 0, 0, 1, 5, 9, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, 0, 0, 10, 5, 9, par3StructureBoundingBox); + int var8; +- for(var8 = 0; var8 <= 14; var8 += 14) { +- this.fillWithRandomizedBlocks(var1, var3, 2, 4, var8, 2, 5, var8, false, var2, junglePyramidsRandomScatteredStones); +- this.fillWithRandomizedBlocks(var1, var3, 4, 4, var8, 4, 5, var8, false, var2, junglePyramidsRandomScatteredStones); +- this.fillWithRandomizedBlocks(var1, var3, 7, 4, var8, 7, 5, var8, false, var2, junglePyramidsRandomScatteredStones); +- this.fillWithRandomizedBlocks(var1, var3, 9, 4, var8, 9, 5, var8, false, var2, junglePyramidsRandomScatteredStones); ++ ++ for (var8 = 0; var8 <= 14; var8 += 14) { ++ this.fillWithRandomizedBlocks(par1World, par3StructureBoundingBox, 2, 4, var8, 2, 5, var8, false, par2Random, junglePyramidsRandomScatteredStones); ++ this.fillWithRandomizedBlocks(par1World, par3StructureBoundingBox, 4, 4, var8, 4, 5, var8, false, par2Random, junglePyramidsRandomScatteredStones); ++ this.fillWithRandomizedBlocks(par1World, par3StructureBoundingBox, 7, 4, var8, 7, 5, var8, false, par2Random, junglePyramidsRandomScatteredStones); ++ this.fillWithRandomizedBlocks(par1World, par3StructureBoundingBox, 9, 4, var8, 9, 5, var8, false, par2Random, junglePyramidsRandomScatteredStones); + } + +- this.fillWithRandomizedBlocks(var1, var3, 5, 6, 0, 6, 6, 0, false, var2, junglePyramidsRandomScatteredStones); ++ this.fillWithRandomizedBlocks(par1World, par3StructureBoundingBox, 5, 6, 0, 6, 6, 0, false, par2Random, junglePyramidsRandomScatteredStones); + +- for(var8 = 0; var8 <= 11; var8 += 11) { +- for(int var9 = 2; var9 <= 12; var9 += 2) { +- this.fillWithRandomizedBlocks(var1, var3, var8, 4, var9, var8, 5, var9, false, var2, junglePyramidsRandomScatteredStones); ++ for (var8 = 0; var8 <= 11; var8 += 11) { ++ for (int var9 = 2; var9 <= 12; var9 += 2) { ++ this.fillWithRandomizedBlocks(par1World, par3StructureBoundingBox, var8, 4, var9, var8, 5, var9, false, par2Random, junglePyramidsRandomScatteredStones); + } + +- this.fillWithRandomizedBlocks(var1, var3, var8, 6, 5, var8, 6, 5, false, var2, junglePyramidsRandomScatteredStones); +- this.fillWithRandomizedBlocks(var1, var3, var8, 6, 9, var8, 6, 9, false, var2, junglePyramidsRandomScatteredStones); +- } +- +- this.fillWithRandomizedBlocks(var1, var3, 2, 7, 2, 2, 9, 2, false, var2, junglePyramidsRandomScatteredStones); +- this.fillWithRandomizedBlocks(var1, var3, 9, 7, 2, 9, 9, 2, false, var2, junglePyramidsRandomScatteredStones); +- this.fillWithRandomizedBlocks(var1, var3, 2, 7, 12, 2, 9, 12, false, var2, junglePyramidsRandomScatteredStones); +- this.fillWithRandomizedBlocks(var1, var3, 9, 7, 12, 9, 9, 12, false, var2, junglePyramidsRandomScatteredStones); +- this.fillWithRandomizedBlocks(var1, var3, 4, 9, 4, 4, 9, 4, false, var2, junglePyramidsRandomScatteredStones); +- this.fillWithRandomizedBlocks(var1, var3, 7, 9, 4, 7, 9, 4, false, var2, junglePyramidsRandomScatteredStones); +- this.fillWithRandomizedBlocks(var1, var3, 4, 9, 10, 4, 9, 10, false, var2, junglePyramidsRandomScatteredStones); +- this.fillWithRandomizedBlocks(var1, var3, 7, 9, 10, 7, 9, 10, false, var2, junglePyramidsRandomScatteredStones); +- this.fillWithRandomizedBlocks(var1, var3, 5, 9, 7, 6, 9, 7, false, var2, junglePyramidsRandomScatteredStones); +- this.placeBlockAtCurrentPosition(var1, Block.stairsCobblestone.blockID, var4, 5, 9, 6, var3); +- this.placeBlockAtCurrentPosition(var1, Block.stairsCobblestone.blockID, var4, 6, 9, 6, var3); +- this.placeBlockAtCurrentPosition(var1, Block.stairsCobblestone.blockID, var5, 5, 9, 8, var3); +- this.placeBlockAtCurrentPosition(var1, Block.stairsCobblestone.blockID, var5, 6, 9, 8, var3); +- this.placeBlockAtCurrentPosition(var1, Block.stairsCobblestone.blockID, var4, 4, 0, 0, var3); +- this.placeBlockAtCurrentPosition(var1, Block.stairsCobblestone.blockID, var4, 5, 0, 0, var3); +- this.placeBlockAtCurrentPosition(var1, Block.stairsCobblestone.blockID, var4, 6, 0, 0, var3); +- this.placeBlockAtCurrentPosition(var1, Block.stairsCobblestone.blockID, var4, 7, 0, 0, var3); +- this.placeBlockAtCurrentPosition(var1, Block.stairsCobblestone.blockID, var4, 4, 1, 8, var3); +- this.placeBlockAtCurrentPosition(var1, Block.stairsCobblestone.blockID, var4, 4, 2, 9, var3); +- this.placeBlockAtCurrentPosition(var1, Block.stairsCobblestone.blockID, var4, 4, 3, 10, var3); +- this.placeBlockAtCurrentPosition(var1, Block.stairsCobblestone.blockID, var4, 7, 1, 8, var3); +- this.placeBlockAtCurrentPosition(var1, Block.stairsCobblestone.blockID, var4, 7, 2, 9, var3); +- this.placeBlockAtCurrentPosition(var1, Block.stairsCobblestone.blockID, var4, 7, 3, 10, var3); +- this.fillWithRandomizedBlocks(var1, var3, 4, 1, 9, 4, 1, 9, false, var2, junglePyramidsRandomScatteredStones); +- this.fillWithRandomizedBlocks(var1, var3, 7, 1, 9, 7, 1, 9, false, var2, junglePyramidsRandomScatteredStones); +- this.fillWithRandomizedBlocks(var1, var3, 4, 1, 10, 7, 2, 10, false, var2, junglePyramidsRandomScatteredStones); +- this.fillWithRandomizedBlocks(var1, var3, 5, 4, 5, 6, 4, 5, false, var2, junglePyramidsRandomScatteredStones); +- this.placeBlockAtCurrentPosition(var1, Block.stairsCobblestone.blockID, var6, 4, 4, 5, var3); +- this.placeBlockAtCurrentPosition(var1, Block.stairsCobblestone.blockID, var7, 7, 4, 5, var3); +- +- for(var8 = 0; var8 < 4; ++var8) { +- this.placeBlockAtCurrentPosition(var1, Block.stairsCobblestone.blockID, var5, 5, 0 - var8, 6 + var8, var3); +- this.placeBlockAtCurrentPosition(var1, Block.stairsCobblestone.blockID, var5, 6, 0 - var8, 6 + var8, var3); +- this.fillWithAir(var1, var3, 5, 0 - var8, 7 + var8, 6, 0 - var8, 9 + var8); +- } +- +- this.fillWithAir(var1, var3, 1, -3, 12, 10, -1, 13); +- this.fillWithAir(var1, var3, 1, -3, 1, 3, -1, 13); +- this.fillWithAir(var1, var3, 1, -3, 1, 9, -1, 5); +- +- for(var8 = 1; var8 <= 13; var8 += 2) { +- this.fillWithRandomizedBlocks(var1, var3, 1, -3, var8, 1, -2, var8, false, var2, junglePyramidsRandomScatteredStones); +- } +- +- for(var8 = 2; var8 <= 12; var8 += 2) { +- this.fillWithRandomizedBlocks(var1, var3, 1, -1, var8, 3, -1, var8, false, var2, junglePyramidsRandomScatteredStones); +- } +- +- this.fillWithRandomizedBlocks(var1, var3, 2, -2, 1, 5, -2, 1, false, var2, junglePyramidsRandomScatteredStones); +- this.fillWithRandomizedBlocks(var1, var3, 7, -2, 1, 9, -2, 1, false, var2, junglePyramidsRandomScatteredStones); +- this.fillWithRandomizedBlocks(var1, var3, 6, -3, 1, 6, -3, 1, false, var2, junglePyramidsRandomScatteredStones); +- this.fillWithRandomizedBlocks(var1, var3, 6, -1, 1, 6, -1, 1, false, var2, junglePyramidsRandomScatteredStones); +- this.placeBlockAtCurrentPosition(var1, Block.tripWireSource.blockID, this.getMetadataWithOffset(Block.tripWireSource.blockID, 3) | 4, 1, -3, 8, var3); +- this.placeBlockAtCurrentPosition(var1, Block.tripWireSource.blockID, this.getMetadataWithOffset(Block.tripWireSource.blockID, 1) | 4, 4, -3, 8, var3); +- this.placeBlockAtCurrentPosition(var1, Block.tripWire.blockID, 4, 2, -3, 8, var3); +- this.placeBlockAtCurrentPosition(var1, Block.tripWire.blockID, 4, 3, -3, 8, var3); +- this.placeBlockAtCurrentPosition(var1, Block.redstoneWire.blockID, 0, 5, -3, 7, var3); +- this.placeBlockAtCurrentPosition(var1, Block.redstoneWire.blockID, 0, 5, -3, 6, var3); +- this.placeBlockAtCurrentPosition(var1, Block.redstoneWire.blockID, 0, 5, -3, 5, var3); +- this.placeBlockAtCurrentPosition(var1, Block.redstoneWire.blockID, 0, 5, -3, 4, var3); +- this.placeBlockAtCurrentPosition(var1, Block.redstoneWire.blockID, 0, 5, -3, 3, var3); +- this.placeBlockAtCurrentPosition(var1, Block.redstoneWire.blockID, 0, 5, -3, 2, var3); +- this.placeBlockAtCurrentPosition(var1, Block.redstoneWire.blockID, 0, 5, -3, 1, var3); +- this.placeBlockAtCurrentPosition(var1, Block.redstoneWire.blockID, 0, 4, -3, 1, var3); +- this.placeBlockAtCurrentPosition(var1, Block.cobblestoneMossy.blockID, 0, 3, -3, 1, var3); +- if(!this.field_74945_j) { +- this.field_74945_j = this.generateStructureDispenserContents(var1, var3, var2, 3, -2, 1, 2, junglePyramidsDispenserContents, 2); +- } +- +- this.placeBlockAtCurrentPosition(var1, Block.vine.blockID, 15, 3, -2, 2, var3); +- this.placeBlockAtCurrentPosition(var1, Block.tripWireSource.blockID, this.getMetadataWithOffset(Block.tripWireSource.blockID, 2) | 4, 7, -3, 1, var3); +- this.placeBlockAtCurrentPosition(var1, Block.tripWireSource.blockID, this.getMetadataWithOffset(Block.tripWireSource.blockID, 0) | 4, 7, -3, 5, var3); +- this.placeBlockAtCurrentPosition(var1, Block.tripWire.blockID, 4, 7, -3, 2, var3); +- this.placeBlockAtCurrentPosition(var1, Block.tripWire.blockID, 4, 7, -3, 3, var3); +- this.placeBlockAtCurrentPosition(var1, Block.tripWire.blockID, 4, 7, -3, 4, var3); +- this.placeBlockAtCurrentPosition(var1, Block.redstoneWire.blockID, 0, 8, -3, 6, var3); +- this.placeBlockAtCurrentPosition(var1, Block.redstoneWire.blockID, 0, 9, -3, 6, var3); +- this.placeBlockAtCurrentPosition(var1, Block.redstoneWire.blockID, 0, 9, -3, 5, var3); +- this.placeBlockAtCurrentPosition(var1, Block.cobblestoneMossy.blockID, 0, 9, -3, 4, var3); +- this.placeBlockAtCurrentPosition(var1, Block.redstoneWire.blockID, 0, 9, -2, 4, var3); +- if(!this.field_74946_k) { +- this.field_74946_k = this.generateStructureDispenserContents(var1, var3, var2, 9, -2, 3, 4, junglePyramidsDispenserContents, 2); +- } +- +- this.placeBlockAtCurrentPosition(var1, Block.vine.blockID, 15, 8, -1, 3, var3); +- this.placeBlockAtCurrentPosition(var1, Block.vine.blockID, 15, 8, -2, 3, var3); +- if(!this.field_74947_h) { +- this.field_74947_h = this.generateStructureChestContents(var1, var3, var2, 8, -3, 3, WeightedRandomChestContent.func_92080_a(junglePyramidsChestContents, new WeightedRandomChestContent[]{Item.enchantedBook.func_92114_b(var2)}), 2 + var2.nextInt(5)); +- } +- +- this.placeBlockAtCurrentPosition(var1, Block.cobblestoneMossy.blockID, 0, 9, -3, 2, var3); +- this.placeBlockAtCurrentPosition(var1, Block.cobblestoneMossy.blockID, 0, 8, -3, 1, var3); +- this.placeBlockAtCurrentPosition(var1, Block.cobblestoneMossy.blockID, 0, 4, -3, 5, var3); +- this.placeBlockAtCurrentPosition(var1, Block.cobblestoneMossy.blockID, 0, 5, -2, 5, var3); +- this.placeBlockAtCurrentPosition(var1, Block.cobblestoneMossy.blockID, 0, 5, -1, 5, var3); +- this.placeBlockAtCurrentPosition(var1, Block.cobblestoneMossy.blockID, 0, 6, -3, 5, var3); +- this.placeBlockAtCurrentPosition(var1, Block.cobblestoneMossy.blockID, 0, 7, -2, 5, var3); +- this.placeBlockAtCurrentPosition(var1, Block.cobblestoneMossy.blockID, 0, 7, -1, 5, var3); +- this.placeBlockAtCurrentPosition(var1, Block.cobblestoneMossy.blockID, 0, 8, -3, 5, var3); +- this.fillWithRandomizedBlocks(var1, var3, 9, -1, 1, 9, -1, 5, false, var2, junglePyramidsRandomScatteredStones); +- this.fillWithAir(var1, var3, 8, -3, 8, 10, -1, 10); +- this.placeBlockAtCurrentPosition(var1, Block.stoneBrick.blockID, 3, 8, -2, 11, var3); +- this.placeBlockAtCurrentPosition(var1, Block.stoneBrick.blockID, 3, 9, -2, 11, var3); +- this.placeBlockAtCurrentPosition(var1, Block.stoneBrick.blockID, 3, 10, -2, 11, var3); +- this.placeBlockAtCurrentPosition(var1, Block.lever.blockID, BlockLever.invertMetadata(this.getMetadataWithOffset(Block.lever.blockID, 2)), 8, -2, 12, var3); +- this.placeBlockAtCurrentPosition(var1, Block.lever.blockID, BlockLever.invertMetadata(this.getMetadataWithOffset(Block.lever.blockID, 2)), 9, -2, 12, var3); +- this.placeBlockAtCurrentPosition(var1, Block.lever.blockID, BlockLever.invertMetadata(this.getMetadataWithOffset(Block.lever.blockID, 2)), 10, -2, 12, var3); +- this.fillWithRandomizedBlocks(var1, var3, 8, -3, 8, 8, -3, 10, false, var2, junglePyramidsRandomScatteredStones); +- this.fillWithRandomizedBlocks(var1, var3, 10, -3, 8, 10, -3, 10, false, var2, junglePyramidsRandomScatteredStones); +- this.placeBlockAtCurrentPosition(var1, Block.cobblestoneMossy.blockID, 0, 10, -2, 9, var3); +- this.placeBlockAtCurrentPosition(var1, Block.redstoneWire.blockID, 0, 8, -2, 9, var3); +- this.placeBlockAtCurrentPosition(var1, Block.redstoneWire.blockID, 0, 8, -2, 10, var3); +- this.placeBlockAtCurrentPosition(var1, Block.redstoneWire.blockID, 0, 10, -1, 9, var3); +- this.placeBlockAtCurrentPosition(var1, Block.pistonStickyBase.blockID, 1, 9, -2, 8, var3); +- this.placeBlockAtCurrentPosition(var1, Block.pistonStickyBase.blockID, this.getMetadataWithOffset(Block.pistonStickyBase.blockID, 4), 10, -2, 8, var3); +- this.placeBlockAtCurrentPosition(var1, Block.pistonStickyBase.blockID, this.getMetadataWithOffset(Block.pistonStickyBase.blockID, 4), 10, -1, 8, var3); +- this.placeBlockAtCurrentPosition(var1, Block.redstoneRepeaterIdle.blockID, this.getMetadataWithOffset(Block.redstoneRepeaterIdle.blockID, 2), 10, -2, 10, var3); +- if(!this.field_74948_i) { +- this.field_74948_i = this.generateStructureChestContents(var1, var3, var2, 9, -3, 10, WeightedRandomChestContent.func_92080_a(junglePyramidsChestContents, new WeightedRandomChestContent[]{Item.enchantedBook.func_92114_b(var2)}), 2 + var2.nextInt(5)); ++ this.fillWithRandomizedBlocks(par1World, par3StructureBoundingBox, var8, 6, 5, var8, 6, 5, false, par2Random, junglePyramidsRandomScatteredStones); ++ this.fillWithRandomizedBlocks(par1World, par3StructureBoundingBox, var8, 6, 9, var8, 6, 9, false, par2Random, junglePyramidsRandomScatteredStones); ++ } ++ ++ this.fillWithRandomizedBlocks(par1World, par3StructureBoundingBox, 2, 7, 2, 2, 9, 2, false, par2Random, junglePyramidsRandomScatteredStones); ++ this.fillWithRandomizedBlocks(par1World, par3StructureBoundingBox, 9, 7, 2, 9, 9, 2, false, par2Random, junglePyramidsRandomScatteredStones); ++ this.fillWithRandomizedBlocks(par1World, par3StructureBoundingBox, 2, 7, 12, 2, 9, 12, false, par2Random, junglePyramidsRandomScatteredStones); ++ this.fillWithRandomizedBlocks(par1World, par3StructureBoundingBox, 9, 7, 12, 9, 9, 12, false, par2Random, junglePyramidsRandomScatteredStones); ++ this.fillWithRandomizedBlocks(par1World, par3StructureBoundingBox, 4, 9, 4, 4, 9, 4, false, par2Random, junglePyramidsRandomScatteredStones); ++ this.fillWithRandomizedBlocks(par1World, par3StructureBoundingBox, 7, 9, 4, 7, 9, 4, false, par2Random, junglePyramidsRandomScatteredStones); ++ this.fillWithRandomizedBlocks(par1World, par3StructureBoundingBox, 4, 9, 10, 4, 9, 10, false, par2Random, junglePyramidsRandomScatteredStones); ++ this.fillWithRandomizedBlocks(par1World, par3StructureBoundingBox, 7, 9, 10, 7, 9, 10, false, par2Random, junglePyramidsRandomScatteredStones); ++ this.fillWithRandomizedBlocks(par1World, par3StructureBoundingBox, 5, 9, 7, 6, 9, 7, false, par2Random, junglePyramidsRandomScatteredStones); ++ this.placeBlockAtCurrentPosition(par1World, Block.stairsCobblestone.blockID, var4, 5, 9, 6, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.stairsCobblestone.blockID, var4, 6, 9, 6, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.stairsCobblestone.blockID, var5, 5, 9, 8, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.stairsCobblestone.blockID, var5, 6, 9, 8, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.stairsCobblestone.blockID, var4, 4, 0, 0, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.stairsCobblestone.blockID, var4, 5, 0, 0, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.stairsCobblestone.blockID, var4, 6, 0, 0, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.stairsCobblestone.blockID, var4, 7, 0, 0, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.stairsCobblestone.blockID, var4, 4, 1, 8, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.stairsCobblestone.blockID, var4, 4, 2, 9, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.stairsCobblestone.blockID, var4, 4, 3, 10, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.stairsCobblestone.blockID, var4, 7, 1, 8, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.stairsCobblestone.blockID, var4, 7, 2, 9, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.stairsCobblestone.blockID, var4, 7, 3, 10, par3StructureBoundingBox); ++ this.fillWithRandomizedBlocks(par1World, par3StructureBoundingBox, 4, 1, 9, 4, 1, 9, false, par2Random, junglePyramidsRandomScatteredStones); ++ this.fillWithRandomizedBlocks(par1World, par3StructureBoundingBox, 7, 1, 9, 7, 1, 9, false, par2Random, junglePyramidsRandomScatteredStones); ++ this.fillWithRandomizedBlocks(par1World, par3StructureBoundingBox, 4, 1, 10, 7, 2, 10, false, par2Random, junglePyramidsRandomScatteredStones); ++ this.fillWithRandomizedBlocks(par1World, par3StructureBoundingBox, 5, 4, 5, 6, 4, 5, false, par2Random, junglePyramidsRandomScatteredStones); ++ this.placeBlockAtCurrentPosition(par1World, Block.stairsCobblestone.blockID, var6, 4, 4, 5, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.stairsCobblestone.blockID, var7, 7, 4, 5, par3StructureBoundingBox); ++ ++ for (var8 = 0; var8 < 4; ++var8) { ++ this.placeBlockAtCurrentPosition(par1World, Block.stairsCobblestone.blockID, var5, 5, 0 - var8, 6 + var8, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.stairsCobblestone.blockID, var5, 6, 0 - var8, 6 + var8, par3StructureBoundingBox); ++ this.fillWithAir(par1World, par3StructureBoundingBox, 5, 0 - var8, 7 + var8, 6, 0 - var8, 9 + var8); ++ } ++ ++ this.fillWithAir(par1World, par3StructureBoundingBox, 1, -3, 12, 10, -1, 13); ++ this.fillWithAir(par1World, par3StructureBoundingBox, 1, -3, 1, 3, -1, 13); ++ this.fillWithAir(par1World, par3StructureBoundingBox, 1, -3, 1, 9, -1, 5); ++ ++ for (var8 = 1; var8 <= 13; var8 += 2) { ++ this.fillWithRandomizedBlocks(par1World, par3StructureBoundingBox, 1, -3, var8, 1, -2, var8, false, par2Random, junglePyramidsRandomScatteredStones); ++ } ++ ++ for (var8 = 2; var8 <= 12; var8 += 2) { ++ this.fillWithRandomizedBlocks(par1World, par3StructureBoundingBox, 1, -1, var8, 3, -1, var8, false, par2Random, junglePyramidsRandomScatteredStones); ++ } ++ ++ this.fillWithRandomizedBlocks(par1World, par3StructureBoundingBox, 2, -2, 1, 5, -2, 1, false, par2Random, junglePyramidsRandomScatteredStones); ++ this.fillWithRandomizedBlocks(par1World, par3StructureBoundingBox, 7, -2, 1, 9, -2, 1, false, par2Random, junglePyramidsRandomScatteredStones); ++ this.fillWithRandomizedBlocks(par1World, par3StructureBoundingBox, 6, -3, 1, 6, -3, 1, false, par2Random, junglePyramidsRandomScatteredStones); ++ this.fillWithRandomizedBlocks(par1World, par3StructureBoundingBox, 6, -1, 1, 6, -1, 1, false, par2Random, junglePyramidsRandomScatteredStones); ++ this.placeBlockAtCurrentPosition(par1World, Block.tripWireSource.blockID, this.getMetadataWithOffset(Block.tripWireSource.blockID, 3) | 4, 1, -3, 8, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.tripWireSource.blockID, this.getMetadataWithOffset(Block.tripWireSource.blockID, 1) | 4, 4, -3, 8, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.tripWire.blockID, 4, 2, -3, 8, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.tripWire.blockID, 4, 3, -3, 8, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.redstoneWire.blockID, 0, 5, -3, 7, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.redstoneWire.blockID, 0, 5, -3, 6, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.redstoneWire.blockID, 0, 5, -3, 5, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.redstoneWire.blockID, 0, 5, -3, 4, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.redstoneWire.blockID, 0, 5, -3, 3, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.redstoneWire.blockID, 0, 5, -3, 2, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.redstoneWire.blockID, 0, 5, -3, 1, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.redstoneWire.blockID, 0, 4, -3, 1, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.cobblestoneMossy.blockID, 0, 3, -3, 1, par3StructureBoundingBox); ++ ++ if (!this.field_74945_j) { ++ this.field_74945_j = this.generateStructureDispenserContents(par1World, par3StructureBoundingBox, par2Random, 3, -2, 1, 2, junglePyramidsDispenserContents, 2); ++ } ++ ++ this.placeBlockAtCurrentPosition(par1World, Block.vine.blockID, 15, 3, -2, 2, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.tripWireSource.blockID, this.getMetadataWithOffset(Block.tripWireSource.blockID, 2) | 4, 7, -3, 1, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.tripWireSource.blockID, this.getMetadataWithOffset(Block.tripWireSource.blockID, 0) | 4, 7, -3, 5, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.tripWire.blockID, 4, 7, -3, 2, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.tripWire.blockID, 4, 7, -3, 3, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.tripWire.blockID, 4, 7, -3, 4, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.redstoneWire.blockID, 0, 8, -3, 6, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.redstoneWire.blockID, 0, 9, -3, 6, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.redstoneWire.blockID, 0, 9, -3, 5, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.cobblestoneMossy.blockID, 0, 9, -3, 4, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.redstoneWire.blockID, 0, 9, -2, 4, par3StructureBoundingBox); ++ ++ if (!this.field_74946_k) { ++ this.field_74946_k = this.generateStructureDispenserContents(par1World, par3StructureBoundingBox, par2Random, 9, -2, 3, 4, junglePyramidsDispenserContents, 2); ++ } ++ ++ this.placeBlockAtCurrentPosition(par1World, Block.vine.blockID, 15, 8, -1, 3, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.vine.blockID, 15, 8, -2, 3, par3StructureBoundingBox); ++ ++ if (!this.field_74947_h) { ++ this.field_74947_h = this.generateStructureChestContents(par1World, par3StructureBoundingBox, par2Random, 8, -3, 3, WeightedRandomChestContent.func_92080_a(junglePyramidsChestContents, new WeightedRandomChestContent[] {Item.enchantedBook.func_92114_b(par2Random)}), 2 + par2Random.nextInt(5)); ++ } ++ ++ this.placeBlockAtCurrentPosition(par1World, Block.cobblestoneMossy.blockID, 0, 9, -3, 2, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.cobblestoneMossy.blockID, 0, 8, -3, 1, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.cobblestoneMossy.blockID, 0, 4, -3, 5, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.cobblestoneMossy.blockID, 0, 5, -2, 5, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.cobblestoneMossy.blockID, 0, 5, -1, 5, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.cobblestoneMossy.blockID, 0, 6, -3, 5, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.cobblestoneMossy.blockID, 0, 7, -2, 5, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.cobblestoneMossy.blockID, 0, 7, -1, 5, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.cobblestoneMossy.blockID, 0, 8, -3, 5, par3StructureBoundingBox); ++ this.fillWithRandomizedBlocks(par1World, par3StructureBoundingBox, 9, -1, 1, 9, -1, 5, false, par2Random, junglePyramidsRandomScatteredStones); ++ this.fillWithAir(par1World, par3StructureBoundingBox, 8, -3, 8, 10, -1, 10); ++ this.placeBlockAtCurrentPosition(par1World, Block.stoneBrick.blockID, 3, 8, -2, 11, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.stoneBrick.blockID, 3, 9, -2, 11, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.stoneBrick.blockID, 3, 10, -2, 11, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.lever.blockID, BlockLever.invertMetadata(this.getMetadataWithOffset(Block.lever.blockID, 2)), 8, -2, 12, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.lever.blockID, BlockLever.invertMetadata(this.getMetadataWithOffset(Block.lever.blockID, 2)), 9, -2, 12, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.lever.blockID, BlockLever.invertMetadata(this.getMetadataWithOffset(Block.lever.blockID, 2)), 10, -2, 12, par3StructureBoundingBox); ++ this.fillWithRandomizedBlocks(par1World, par3StructureBoundingBox, 8, -3, 8, 8, -3, 10, false, par2Random, junglePyramidsRandomScatteredStones); ++ this.fillWithRandomizedBlocks(par1World, par3StructureBoundingBox, 10, -3, 8, 10, -3, 10, false, par2Random, junglePyramidsRandomScatteredStones); ++ this.placeBlockAtCurrentPosition(par1World, Block.cobblestoneMossy.blockID, 0, 10, -2, 9, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.redstoneWire.blockID, 0, 8, -2, 9, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.redstoneWire.blockID, 0, 8, -2, 10, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.redstoneWire.blockID, 0, 10, -1, 9, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.pistonStickyBase.blockID, 1, 9, -2, 8, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.pistonStickyBase.blockID, this.getMetadataWithOffset(Block.pistonStickyBase.blockID, 4), 10, -2, 8, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.pistonStickyBase.blockID, this.getMetadataWithOffset(Block.pistonStickyBase.blockID, 4), 10, -1, 8, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.redstoneRepeaterIdle.blockID, this.getMetadataWithOffset(Block.redstoneRepeaterIdle.blockID, 2), 10, -2, 10, par3StructureBoundingBox); ++ ++ if (!this.field_74948_i) { ++ this.field_74948_i = this.generateStructureChestContents(par1World, par3StructureBoundingBox, par2Random, 9, -3, 10, WeightedRandomChestContent.func_92080_a(junglePyramidsChestContents, new WeightedRandomChestContent[] {Item.enchantedBook.func_92114_b(par2Random)}), 2 + par2Random.nextInt(5)); + } + + return true; diff --git a/patches/net/minecraft/src/ComponentScatteredFeatureSwampHut.java.patch b/patches/net/minecraft/src/ComponentScatteredFeatureSwampHut.java.patch new file mode 100644 index 0000000..822fa14 --- /dev/null +++ b/patches/net/minecraft/src/ComponentScatteredFeatureSwampHut.java.patch @@ -0,0 +1,138 @@ +--- net/minecraft/src/ComponentScatteredFeatureSwampHut.java ++++ net/minecraft/src/ComponentScatteredFeatureSwampHut.java +@@ -3,77 +3,83 @@ + import java.util.Random; + + public class ComponentScatteredFeatureSwampHut extends ComponentScatteredFeature { ++ ++ /** Whether this swamp hut has a witch. */ + private boolean hasWitch; + +- public ComponentScatteredFeatureSwampHut() { +- } +- +- public ComponentScatteredFeatureSwampHut(Random var1, int var2, int var3) { +- super(var1, var2, 64, var3, 7, 5, 9); +- } +- +- protected void func_143012_a(NBTTagCompound var1) { +- super.func_143012_a(var1); +- var1.setBoolean("Witch", this.hasWitch); +- } +- +- protected void func_143011_b(NBTTagCompound var1) { +- super.func_143011_b(var1); +- this.hasWitch = var1.getBoolean("Witch"); +- } +- +- public boolean addComponentParts(World var1, Random var2, StructureBoundingBox var3) { +- if(!this.func_74935_a(var1, var3, 0)) { ++ public ComponentScatteredFeatureSwampHut() {} ++ ++ public ComponentScatteredFeatureSwampHut(Random par1Random, int par2, int par3) { ++ super(par1Random, par2, 64, par3, 7, 5, 9); ++ } ++ ++ protected void func_143012_a(NBTTagCompound par1NBTTagCompound) { ++ super.func_143012_a(par1NBTTagCompound); ++ par1NBTTagCompound.setBoolean("Witch", this.hasWitch); ++ } ++ ++ protected void func_143011_b(NBTTagCompound par1NBTTagCompound) { ++ super.func_143011_b(par1NBTTagCompound); ++ this.hasWitch = par1NBTTagCompound.getBoolean("Witch"); ++ } ++ ++ /** ++ * second Part of Structure generating, this for example places Spiderwebs, Mob Spawners, it closes Mineshafts at the ++ * end, it adds Fences... ++ */ ++ public boolean addComponentParts(World par1World, Random par2Random, StructureBoundingBox par3StructureBoundingBox) { ++ if (!this.func_74935_a(par1World, par3StructureBoundingBox, 0)) { + return false; + } else { +- this.fillWithMetadataBlocks(var1, var3, 1, 1, 1, 5, 1, 7, Block.planks.blockID, 1, Block.planks.blockID, 1, false); +- this.fillWithMetadataBlocks(var1, var3, 1, 4, 2, 5, 4, 7, Block.planks.blockID, 1, Block.planks.blockID, 1, false); +- this.fillWithMetadataBlocks(var1, var3, 2, 1, 0, 4, 1, 0, Block.planks.blockID, 1, Block.planks.blockID, 1, false); +- this.fillWithMetadataBlocks(var1, var3, 2, 2, 2, 3, 3, 2, Block.planks.blockID, 1, Block.planks.blockID, 1, false); +- this.fillWithMetadataBlocks(var1, var3, 1, 2, 3, 1, 3, 6, Block.planks.blockID, 1, Block.planks.blockID, 1, false); +- this.fillWithMetadataBlocks(var1, var3, 5, 2, 3, 5, 3, 6, Block.planks.blockID, 1, Block.planks.blockID, 1, false); +- this.fillWithMetadataBlocks(var1, var3, 2, 2, 7, 4, 3, 7, Block.planks.blockID, 1, Block.planks.blockID, 1, false); +- this.fillWithBlocks(var1, var3, 1, 0, 2, 1, 3, 2, Block.wood.blockID, Block.wood.blockID, false); +- this.fillWithBlocks(var1, var3, 5, 0, 2, 5, 3, 2, Block.wood.blockID, Block.wood.blockID, false); +- this.fillWithBlocks(var1, var3, 1, 0, 7, 1, 3, 7, Block.wood.blockID, Block.wood.blockID, false); +- this.fillWithBlocks(var1, var3, 5, 0, 7, 5, 3, 7, Block.wood.blockID, Block.wood.blockID, false); +- this.placeBlockAtCurrentPosition(var1, Block.fence.blockID, 0, 2, 3, 2, var3); +- this.placeBlockAtCurrentPosition(var1, Block.fence.blockID, 0, 3, 3, 7, var3); +- this.placeBlockAtCurrentPosition(var1, 0, 0, 1, 3, 4, var3); +- this.placeBlockAtCurrentPosition(var1, 0, 0, 5, 3, 4, var3); +- this.placeBlockAtCurrentPosition(var1, 0, 0, 5, 3, 5, var3); +- this.placeBlockAtCurrentPosition(var1, Block.flowerPot.blockID, 7, 1, 3, 5, var3); +- this.placeBlockAtCurrentPosition(var1, Block.workbench.blockID, 0, 3, 2, 6, var3); +- this.placeBlockAtCurrentPosition(var1, Block.cauldron.blockID, 0, 4, 2, 6, var3); +- this.placeBlockAtCurrentPosition(var1, Block.fence.blockID, 0, 1, 2, 1, var3); +- this.placeBlockAtCurrentPosition(var1, Block.fence.blockID, 0, 5, 2, 1, var3); ++ this.fillWithMetadataBlocks(par1World, par3StructureBoundingBox, 1, 1, 1, 5, 1, 7, Block.planks.blockID, 1, Block.planks.blockID, 1, false); ++ this.fillWithMetadataBlocks(par1World, par3StructureBoundingBox, 1, 4, 2, 5, 4, 7, Block.planks.blockID, 1, Block.planks.blockID, 1, false); ++ this.fillWithMetadataBlocks(par1World, par3StructureBoundingBox, 2, 1, 0, 4, 1, 0, Block.planks.blockID, 1, Block.planks.blockID, 1, false); ++ this.fillWithMetadataBlocks(par1World, par3StructureBoundingBox, 2, 2, 2, 3, 3, 2, Block.planks.blockID, 1, Block.planks.blockID, 1, false); ++ this.fillWithMetadataBlocks(par1World, par3StructureBoundingBox, 1, 2, 3, 1, 3, 6, Block.planks.blockID, 1, Block.planks.blockID, 1, false); ++ this.fillWithMetadataBlocks(par1World, par3StructureBoundingBox, 5, 2, 3, 5, 3, 6, Block.planks.blockID, 1, Block.planks.blockID, 1, false); ++ this.fillWithMetadataBlocks(par1World, par3StructureBoundingBox, 2, 2, 7, 4, 3, 7, Block.planks.blockID, 1, Block.planks.blockID, 1, false); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 1, 0, 2, 1, 3, 2, Block.wood.blockID, Block.wood.blockID, false); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 5, 0, 2, 5, 3, 2, Block.wood.blockID, Block.wood.blockID, false); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 1, 0, 7, 1, 3, 7, Block.wood.blockID, Block.wood.blockID, false); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 5, 0, 7, 5, 3, 7, Block.wood.blockID, Block.wood.blockID, false); ++ this.placeBlockAtCurrentPosition(par1World, Block.fence.blockID, 0, 2, 3, 2, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.fence.blockID, 0, 3, 3, 7, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, 0, 0, 1, 3, 4, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, 0, 0, 5, 3, 4, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, 0, 0, 5, 3, 5, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.flowerPot.blockID, 7, 1, 3, 5, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.workbench.blockID, 0, 3, 2, 6, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.cauldron.blockID, 0, 4, 2, 6, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.fence.blockID, 0, 1, 2, 1, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.fence.blockID, 0, 5, 2, 1, par3StructureBoundingBox); + int var4 = this.getMetadataWithOffset(Block.stairsWoodOak.blockID, 3); + int var5 = this.getMetadataWithOffset(Block.stairsWoodOak.blockID, 1); + int var6 = this.getMetadataWithOffset(Block.stairsWoodOak.blockID, 0); + int var7 = this.getMetadataWithOffset(Block.stairsWoodOak.blockID, 2); +- this.fillWithMetadataBlocks(var1, var3, 0, 4, 1, 6, 4, 1, Block.stairsWoodSpruce.blockID, var4, Block.stairsWoodSpruce.blockID, var4, false); +- this.fillWithMetadataBlocks(var1, var3, 0, 4, 2, 0, 4, 7, Block.stairsWoodSpruce.blockID, var6, Block.stairsWoodSpruce.blockID, var6, false); +- this.fillWithMetadataBlocks(var1, var3, 6, 4, 2, 6, 4, 7, Block.stairsWoodSpruce.blockID, var5, Block.stairsWoodSpruce.blockID, var5, false); +- this.fillWithMetadataBlocks(var1, var3, 0, 4, 8, 6, 4, 8, Block.stairsWoodSpruce.blockID, var7, Block.stairsWoodSpruce.blockID, var7, false); +- ++ this.fillWithMetadataBlocks(par1World, par3StructureBoundingBox, 0, 4, 1, 6, 4, 1, Block.stairsWoodSpruce.blockID, var4, Block.stairsWoodSpruce.blockID, var4, false); ++ this.fillWithMetadataBlocks(par1World, par3StructureBoundingBox, 0, 4, 2, 0, 4, 7, Block.stairsWoodSpruce.blockID, var6, Block.stairsWoodSpruce.blockID, var6, false); ++ this.fillWithMetadataBlocks(par1World, par3StructureBoundingBox, 6, 4, 2, 6, 4, 7, Block.stairsWoodSpruce.blockID, var5, Block.stairsWoodSpruce.blockID, var5, false); ++ this.fillWithMetadataBlocks(par1World, par3StructureBoundingBox, 0, 4, 8, 6, 4, 8, Block.stairsWoodSpruce.blockID, var7, Block.stairsWoodSpruce.blockID, var7, false); + int var8; + int var9; +- for(var8 = 2; var8 <= 7; var8 += 5) { +- for(var9 = 1; var9 <= 5; var9 += 4) { +- this.fillCurrentPositionBlocksDownwards(var1, Block.wood.blockID, 0, var9, -1, var8, var3); ++ ++ for (var8 = 2; var8 <= 7; var8 += 5) { ++ for (var9 = 1; var9 <= 5; var9 += 4) { ++ this.fillCurrentPositionBlocksDownwards(par1World, Block.wood.blockID, 0, var9, -1, var8, par3StructureBoundingBox); + } + } + +- if(!this.hasWitch) { ++ if (!this.hasWitch) { + var8 = this.getXWithOffset(2, 5); + var9 = this.getYWithOffset(2); + int var10 = this.getZWithOffset(2, 5); +- if(var3.isVecInside(var8, var9, var10)) { ++ ++ if (par3StructureBoundingBox.isVecInside(var8, var9, var10)) { + this.hasWitch = true; +- EntityWitch var11 = new EntityWitch(var1); ++ EntityWitch var11 = new EntityWitch(par1World); + var11.setLocationAndAngles((double)var8 + 0.5D, (double)var9, (double)var10 + 0.5D, 0.0F, 0.0F); + var11.onSpawnWithEgg((EntityLivingData)null); +- var1.spawnEntityInWorld(var11); ++ par1World.spawnEntityInWorld(var11); + } + } + diff --git a/patches/net/minecraft/src/ComponentStronghold.java.patch b/patches/net/minecraft/src/ComponentStronghold.java.patch new file mode 100644 index 0000000..034822b --- /dev/null +++ b/patches/net/minecraft/src/ComponentStronghold.java.patch @@ -0,0 +1,289 @@ +--- net/minecraft/src/ComponentStronghold.java ++++ net/minecraft/src/ComponentStronghold.java +@@ -4,129 +4,164 @@ + import java.util.Random; + + abstract class ComponentStronghold extends StructureComponent { +- protected EnumDoor field_143013_d = EnumDoor.OPENING; ++ protected EnumDoor field_143013_d; + + public ComponentStronghold() { +- } +- +- protected ComponentStronghold(int var1) { +- super(var1); +- } +- +- protected void func_143012_a(NBTTagCompound var1) { +- var1.setString("EntryDoor", this.field_143013_d.name()); +- } +- +- protected void func_143011_b(NBTTagCompound var1) { +- this.field_143013_d = EnumDoor.valueOf(var1.getString("EntryDoor")); +- } +- +- protected void placeDoor(World var1, Random var2, StructureBoundingBox var3, EnumDoor var4, int var5, int var6, int var7) { +- switch(EnumDoorHelper.doorEnum[var4.ordinal()]) { +- case 1: +- default: +- this.fillWithBlocks(var1, var3, var5, var6, var7, var5 + 3 - 1, var6 + 3 - 1, var7, 0, 0, false); +- break; +- case 2: +- this.placeBlockAtCurrentPosition(var1, Block.stoneBrick.blockID, 0, var5, var6, var7, var3); +- this.placeBlockAtCurrentPosition(var1, Block.stoneBrick.blockID, 0, var5, var6 + 1, var7, var3); +- this.placeBlockAtCurrentPosition(var1, Block.stoneBrick.blockID, 0, var5, var6 + 2, var7, var3); +- this.placeBlockAtCurrentPosition(var1, Block.stoneBrick.blockID, 0, var5 + 1, var6 + 2, var7, var3); +- this.placeBlockAtCurrentPosition(var1, Block.stoneBrick.blockID, 0, var5 + 2, var6 + 2, var7, var3); +- this.placeBlockAtCurrentPosition(var1, Block.stoneBrick.blockID, 0, var5 + 2, var6 + 1, var7, var3); +- this.placeBlockAtCurrentPosition(var1, Block.stoneBrick.blockID, 0, var5 + 2, var6, var7, var3); +- this.placeBlockAtCurrentPosition(var1, Block.doorWood.blockID, 0, var5 + 1, var6, var7, var3); +- this.placeBlockAtCurrentPosition(var1, Block.doorWood.blockID, 8, var5 + 1, var6 + 1, var7, var3); +- break; +- case 3: +- this.placeBlockAtCurrentPosition(var1, 0, 0, var5 + 1, var6, var7, var3); +- this.placeBlockAtCurrentPosition(var1, 0, 0, var5 + 1, var6 + 1, var7, var3); +- this.placeBlockAtCurrentPosition(var1, Block.fenceIron.blockID, 0, var5, var6, var7, var3); +- this.placeBlockAtCurrentPosition(var1, Block.fenceIron.blockID, 0, var5, var6 + 1, var7, var3); +- this.placeBlockAtCurrentPosition(var1, Block.fenceIron.blockID, 0, var5, var6 + 2, var7, var3); +- this.placeBlockAtCurrentPosition(var1, Block.fenceIron.blockID, 0, var5 + 1, var6 + 2, var7, var3); +- this.placeBlockAtCurrentPosition(var1, Block.fenceIron.blockID, 0, var5 + 2, var6 + 2, var7, var3); +- this.placeBlockAtCurrentPosition(var1, Block.fenceIron.blockID, 0, var5 + 2, var6 + 1, var7, var3); +- this.placeBlockAtCurrentPosition(var1, Block.fenceIron.blockID, 0, var5 + 2, var6, var7, var3); +- break; +- case 4: +- this.placeBlockAtCurrentPosition(var1, Block.stoneBrick.blockID, 0, var5, var6, var7, var3); +- this.placeBlockAtCurrentPosition(var1, Block.stoneBrick.blockID, 0, var5, var6 + 1, var7, var3); +- this.placeBlockAtCurrentPosition(var1, Block.stoneBrick.blockID, 0, var5, var6 + 2, var7, var3); +- this.placeBlockAtCurrentPosition(var1, Block.stoneBrick.blockID, 0, var5 + 1, var6 + 2, var7, var3); +- this.placeBlockAtCurrentPosition(var1, Block.stoneBrick.blockID, 0, var5 + 2, var6 + 2, var7, var3); +- this.placeBlockAtCurrentPosition(var1, Block.stoneBrick.blockID, 0, var5 + 2, var6 + 1, var7, var3); +- this.placeBlockAtCurrentPosition(var1, Block.stoneBrick.blockID, 0, var5 + 2, var6, var7, var3); +- this.placeBlockAtCurrentPosition(var1, Block.doorIron.blockID, 0, var5 + 1, var6, var7, var3); +- this.placeBlockAtCurrentPosition(var1, Block.doorIron.blockID, 8, var5 + 1, var6 + 1, var7, var3); +- this.placeBlockAtCurrentPosition(var1, Block.stoneButton.blockID, this.getMetadataWithOffset(Block.stoneButton.blockID, 4), var5 + 2, var6 + 1, var7 + 1, var3); +- this.placeBlockAtCurrentPosition(var1, Block.stoneButton.blockID, this.getMetadataWithOffset(Block.stoneButton.blockID, 3), var5 + 2, var6 + 1, var7 - 1, var3); +- } +- +- } +- +- protected EnumDoor getRandomDoor(Random var1) { +- int var2 = var1.nextInt(5); +- switch(var2) { +- case 0: +- case 1: +- default: +- return EnumDoor.OPENING; +- case 2: +- return EnumDoor.WOOD_DOOR; +- case 3: +- return EnumDoor.GRATES; +- case 4: +- return EnumDoor.IRON_DOOR; +- } +- } +- +- protected StructureComponent getNextComponentNormal(ComponentStrongholdStairs2 var1, List var2, Random var3, int var4, int var5) { +- switch(this.coordBaseMode) { +- case 0: +- return StructureStrongholdPieces.getNextValidComponentAccess(var1, var2, var3, this.boundingBox.minX + var4, this.boundingBox.minY + var5, this.boundingBox.maxZ + 1, this.coordBaseMode, this.getComponentType()); +- case 1: +- return StructureStrongholdPieces.getNextValidComponentAccess(var1, var2, var3, this.boundingBox.minX - 1, this.boundingBox.minY + var5, this.boundingBox.minZ + var4, this.coordBaseMode, this.getComponentType()); +- case 2: +- return StructureStrongholdPieces.getNextValidComponentAccess(var1, var2, var3, this.boundingBox.minX + var4, this.boundingBox.minY + var5, this.boundingBox.minZ - 1, this.coordBaseMode, this.getComponentType()); +- case 3: +- return StructureStrongholdPieces.getNextValidComponentAccess(var1, var2, var3, this.boundingBox.maxX + 1, this.boundingBox.minY + var5, this.boundingBox.minZ + var4, this.coordBaseMode, this.getComponentType()); +- default: +- return null; +- } +- } +- +- protected StructureComponent getNextComponentX(ComponentStrongholdStairs2 var1, List var2, Random var3, int var4, int var5) { +- switch(this.coordBaseMode) { +- case 0: +- return StructureStrongholdPieces.getNextValidComponentAccess(var1, var2, var3, this.boundingBox.minX - 1, this.boundingBox.minY + var4, this.boundingBox.minZ + var5, 1, this.getComponentType()); +- case 1: +- return StructureStrongholdPieces.getNextValidComponentAccess(var1, var2, var3, this.boundingBox.minX + var5, this.boundingBox.minY + var4, this.boundingBox.minZ - 1, 2, this.getComponentType()); +- case 2: +- return StructureStrongholdPieces.getNextValidComponentAccess(var1, var2, var3, this.boundingBox.minX - 1, this.boundingBox.minY + var4, this.boundingBox.minZ + var5, 1, this.getComponentType()); +- case 3: +- return StructureStrongholdPieces.getNextValidComponentAccess(var1, var2, var3, this.boundingBox.minX + var5, this.boundingBox.minY + var4, this.boundingBox.minZ - 1, 2, this.getComponentType()); +- default: +- return null; +- } +- } +- +- protected StructureComponent getNextComponentZ(ComponentStrongholdStairs2 var1, List var2, Random var3, int var4, int var5) { +- switch(this.coordBaseMode) { +- case 0: +- return StructureStrongholdPieces.getNextValidComponentAccess(var1, var2, var3, this.boundingBox.maxX + 1, this.boundingBox.minY + var4, this.boundingBox.minZ + var5, 3, this.getComponentType()); +- case 1: +- return StructureStrongholdPieces.getNextValidComponentAccess(var1, var2, var3, this.boundingBox.minX + var5, this.boundingBox.minY + var4, this.boundingBox.maxZ + 1, 0, this.getComponentType()); +- case 2: +- return StructureStrongholdPieces.getNextValidComponentAccess(var1, var2, var3, this.boundingBox.maxX + 1, this.boundingBox.minY + var4, this.boundingBox.minZ + var5, 3, this.getComponentType()); +- case 3: +- return StructureStrongholdPieces.getNextValidComponentAccess(var1, var2, var3, this.boundingBox.minX + var5, this.boundingBox.minY + var4, this.boundingBox.maxZ + 1, 0, this.getComponentType()); +- default: +- return null; +- } +- } +- +- protected static boolean canStrongholdGoDeeper(StructureBoundingBox var0) { +- return var0 != null && var0.minY > 10; ++ this.field_143013_d = EnumDoor.OPENING; ++ } ++ ++ protected ComponentStronghold(int par1) { ++ super(par1); ++ this.field_143013_d = EnumDoor.OPENING; ++ } ++ ++ protected void func_143012_a(NBTTagCompound par1NBTTagCompound) { ++ par1NBTTagCompound.setString("EntryDoor", this.field_143013_d.name()); ++ } ++ ++ protected void func_143011_b(NBTTagCompound par1NBTTagCompound) { ++ this.field_143013_d = EnumDoor.valueOf(par1NBTTagCompound.getString("EntryDoor")); ++ } ++ ++ /** ++ * builds a door of the enumerated types (empty opening is a door) ++ */ ++ protected void placeDoor(World par1World, Random par2Random, StructureBoundingBox par3StructureBoundingBox, EnumDoor par4EnumDoor, int par5, int par6, int par7) { ++ switch (EnumDoorHelper.doorEnum[par4EnumDoor.ordinal()]) { ++ case 1: ++ default: ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, par5, par6, par7, par5 + 3 - 1, par6 + 3 - 1, par7, 0, 0, false); ++ break; ++ ++ case 2: ++ this.placeBlockAtCurrentPosition(par1World, Block.stoneBrick.blockID, 0, par5, par6, par7, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.stoneBrick.blockID, 0, par5, par6 + 1, par7, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.stoneBrick.blockID, 0, par5, par6 + 2, par7, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.stoneBrick.blockID, 0, par5 + 1, par6 + 2, par7, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.stoneBrick.blockID, 0, par5 + 2, par6 + 2, par7, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.stoneBrick.blockID, 0, par5 + 2, par6 + 1, par7, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.stoneBrick.blockID, 0, par5 + 2, par6, par7, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.doorWood.blockID, 0, par5 + 1, par6, par7, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.doorWood.blockID, 8, par5 + 1, par6 + 1, par7, par3StructureBoundingBox); ++ break; ++ ++ case 3: ++ this.placeBlockAtCurrentPosition(par1World, 0, 0, par5 + 1, par6, par7, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, 0, 0, par5 + 1, par6 + 1, par7, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.fenceIron.blockID, 0, par5, par6, par7, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.fenceIron.blockID, 0, par5, par6 + 1, par7, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.fenceIron.blockID, 0, par5, par6 + 2, par7, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.fenceIron.blockID, 0, par5 + 1, par6 + 2, par7, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.fenceIron.blockID, 0, par5 + 2, par6 + 2, par7, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.fenceIron.blockID, 0, par5 + 2, par6 + 1, par7, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.fenceIron.blockID, 0, par5 + 2, par6, par7, par3StructureBoundingBox); ++ break; ++ ++ case 4: ++ this.placeBlockAtCurrentPosition(par1World, Block.stoneBrick.blockID, 0, par5, par6, par7, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.stoneBrick.blockID, 0, par5, par6 + 1, par7, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.stoneBrick.blockID, 0, par5, par6 + 2, par7, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.stoneBrick.blockID, 0, par5 + 1, par6 + 2, par7, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.stoneBrick.blockID, 0, par5 + 2, par6 + 2, par7, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.stoneBrick.blockID, 0, par5 + 2, par6 + 1, par7, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.stoneBrick.blockID, 0, par5 + 2, par6, par7, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.doorIron.blockID, 0, par5 + 1, par6, par7, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.doorIron.blockID, 8, par5 + 1, par6 + 1, par7, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.stoneButton.blockID, this.getMetadataWithOffset(Block.stoneButton.blockID, 4), par5 + 2, par6 + 1, par7 + 1, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.stoneButton.blockID, this.getMetadataWithOffset(Block.stoneButton.blockID, 3), par5 + 2, par6 + 1, par7 - 1, par3StructureBoundingBox); ++ } ++ } ++ ++ protected EnumDoor getRandomDoor(Random par1Random) { ++ int var2 = par1Random.nextInt(5); ++ ++ switch (var2) { ++ case 0: ++ case 1: ++ default: ++ return EnumDoor.OPENING; ++ ++ case 2: ++ return EnumDoor.WOOD_DOOR; ++ ++ case 3: ++ return EnumDoor.GRATES; ++ ++ case 4: ++ return EnumDoor.IRON_DOOR; ++ } ++ } ++ ++ /** ++ * Gets the next component in any cardinal direction ++ */ ++ protected StructureComponent getNextComponentNormal(ComponentStrongholdStairs2 par1ComponentStrongholdStairs2, List par2List, Random par3Random, int par4, int par5) { ++ switch (this.coordBaseMode) { ++ case 0: ++ return StructureStrongholdPieces.getNextValidComponentAccess(par1ComponentStrongholdStairs2, par2List, par3Random, this.boundingBox.minX + par4, this.boundingBox.minY + par5, this.boundingBox.maxZ + 1, this.coordBaseMode, this.getComponentType()); ++ ++ case 1: ++ return StructureStrongholdPieces.getNextValidComponentAccess(par1ComponentStrongholdStairs2, par2List, par3Random, this.boundingBox.minX - 1, this.boundingBox.minY + par5, this.boundingBox.minZ + par4, this.coordBaseMode, this.getComponentType()); ++ ++ case 2: ++ return StructureStrongholdPieces.getNextValidComponentAccess(par1ComponentStrongholdStairs2, par2List, par3Random, this.boundingBox.minX + par4, this.boundingBox.minY + par5, this.boundingBox.minZ - 1, this.coordBaseMode, this.getComponentType()); ++ ++ case 3: ++ return StructureStrongholdPieces.getNextValidComponentAccess(par1ComponentStrongholdStairs2, par2List, par3Random, this.boundingBox.maxX + 1, this.boundingBox.minY + par5, this.boundingBox.minZ + par4, this.coordBaseMode, this.getComponentType()); ++ ++ default: ++ return null; ++ } ++ } ++ ++ /** ++ * Gets the next component in the +/- X direction ++ */ ++ protected StructureComponent getNextComponentX(ComponentStrongholdStairs2 par1ComponentStrongholdStairs2, List par2List, Random par3Random, int par4, int par5) { ++ switch (this.coordBaseMode) { ++ case 0: ++ return StructureStrongholdPieces.getNextValidComponentAccess(par1ComponentStrongholdStairs2, par2List, par3Random, this.boundingBox.minX - 1, this.boundingBox.minY + par4, this.boundingBox.minZ + par5, 1, this.getComponentType()); ++ ++ case 1: ++ return StructureStrongholdPieces.getNextValidComponentAccess(par1ComponentStrongholdStairs2, par2List, par3Random, this.boundingBox.minX + par5, this.boundingBox.minY + par4, this.boundingBox.minZ - 1, 2, this.getComponentType()); ++ ++ case 2: ++ return StructureStrongholdPieces.getNextValidComponentAccess(par1ComponentStrongholdStairs2, par2List, par3Random, this.boundingBox.minX - 1, this.boundingBox.minY + par4, this.boundingBox.minZ + par5, 1, this.getComponentType()); ++ ++ case 3: ++ return StructureStrongholdPieces.getNextValidComponentAccess(par1ComponentStrongholdStairs2, par2List, par3Random, this.boundingBox.minX + par5, this.boundingBox.minY + par4, this.boundingBox.minZ - 1, 2, this.getComponentType()); ++ ++ default: ++ return null; ++ } ++ } ++ ++ /** ++ * Gets the next component in the +/- Z direction ++ */ ++ protected StructureComponent getNextComponentZ(ComponentStrongholdStairs2 par1ComponentStrongholdStairs2, List par2List, Random par3Random, int par4, int par5) { ++ switch (this.coordBaseMode) { ++ case 0: ++ return StructureStrongholdPieces.getNextValidComponentAccess(par1ComponentStrongholdStairs2, par2List, par3Random, this.boundingBox.maxX + 1, this.boundingBox.minY + par4, this.boundingBox.minZ + par5, 3, this.getComponentType()); ++ ++ case 1: ++ return StructureStrongholdPieces.getNextValidComponentAccess(par1ComponentStrongholdStairs2, par2List, par3Random, this.boundingBox.minX + par5, this.boundingBox.minY + par4, this.boundingBox.maxZ + 1, 0, this.getComponentType()); ++ ++ case 2: ++ return StructureStrongholdPieces.getNextValidComponentAccess(par1ComponentStrongholdStairs2, par2List, par3Random, this.boundingBox.maxX + 1, this.boundingBox.minY + par4, this.boundingBox.minZ + par5, 3, this.getComponentType()); ++ ++ case 3: ++ return StructureStrongholdPieces.getNextValidComponentAccess(par1ComponentStrongholdStairs2, par2List, par3Random, this.boundingBox.minX + par5, this.boundingBox.minY + par4, this.boundingBox.maxZ + 1, 0, this.getComponentType()); ++ ++ default: ++ return null; ++ } ++ } ++ ++ /** ++ * returns false if the Structure Bounding Box goes below 10 ++ */ ++ protected static boolean canStrongholdGoDeeper(StructureBoundingBox par0StructureBoundingBox) { ++ return par0StructureBoundingBox != null && par0StructureBoundingBox.minY > 10; + } + } diff --git a/patches/net/minecraft/src/ComponentStrongholdChestCorridor.java.patch b/patches/net/minecraft/src/ComponentStrongholdChestCorridor.java.patch new file mode 100644 index 0000000..981738c --- /dev/null +++ b/patches/net/minecraft/src/ComponentStrongholdChestCorridor.java.patch @@ -0,0 +1,121 @@ +--- net/minecraft/src/ComponentStrongholdChestCorridor.java ++++ net/minecraft/src/ComponentStrongholdChestCorridor.java +@@ -4,63 +4,72 @@ + import java.util.Random; + + public class ComponentStrongholdChestCorridor extends ComponentStronghold { +- private static final WeightedRandomChestContent[] strongholdChestContents = new WeightedRandomChestContent[]{new WeightedRandomChestContent(Item.enderPearl.itemID, 0, 1, 1, 10), new WeightedRandomChestContent(Item.diamond.itemID, 0, 1, 3, 3), new WeightedRandomChestContent(Item.ingotIron.itemID, 0, 1, 5, 10), new WeightedRandomChestContent(Item.ingotGold.itemID, 0, 1, 3, 5), new WeightedRandomChestContent(Item.redstone.itemID, 0, 4, 9, 5), new WeightedRandomChestContent(Item.bread.itemID, 0, 1, 3, 15), new WeightedRandomChestContent(Item.appleRed.itemID, 0, 1, 3, 15), new WeightedRandomChestContent(Item.pickaxeIron.itemID, 0, 1, 1, 5), new WeightedRandomChestContent(Item.swordIron.itemID, 0, 1, 1, 5), new WeightedRandomChestContent(Item.plateIron.itemID, 0, 1, 1, 5), new WeightedRandomChestContent(Item.helmetIron.itemID, 0, 1, 1, 5), new WeightedRandomChestContent(Item.legsIron.itemID, 0, 1, 1, 5), new WeightedRandomChestContent(Item.bootsIron.itemID, 0, 1, 1, 5), new WeightedRandomChestContent(Item.appleGold.itemID, 0, 1, 1, 1), new WeightedRandomChestContent(Item.saddle.itemID, 0, 1, 1, 1), new WeightedRandomChestContent(Item.horseArmorIron.itemID, 0, 1, 1, 1), new WeightedRandomChestContent(Item.horseArmorGold.itemID, 0, 1, 1, 1), new WeightedRandomChestContent(Item.horseArmorDiamond.itemID, 0, 1, 1, 1)}; ++ ++ /** List of items that Stronghold chests can contain. */ ++ private static final WeightedRandomChestContent[] strongholdChestContents = new WeightedRandomChestContent[] {new WeightedRandomChestContent(Item.enderPearl.itemID, 0, 1, 1, 10), new WeightedRandomChestContent(Item.diamond.itemID, 0, 1, 3, 3), new WeightedRandomChestContent(Item.ingotIron.itemID, 0, 1, 5, 10), new WeightedRandomChestContent(Item.ingotGold.itemID, 0, 1, 3, 5), new WeightedRandomChestContent(Item.redstone.itemID, 0, 4, 9, 5), new WeightedRandomChestContent(Item.bread.itemID, 0, 1, 3, 15), new WeightedRandomChestContent(Item.appleRed.itemID, 0, 1, 3, 15), new WeightedRandomChestContent(Item.pickaxeIron.itemID, 0, 1, 1, 5), new WeightedRandomChestContent(Item.swordIron.itemID, 0, 1, 1, 5), new WeightedRandomChestContent(Item.plateIron.itemID, 0, 1, 1, 5), new WeightedRandomChestContent(Item.helmetIron.itemID, 0, 1, 1, 5), new WeightedRandomChestContent(Item.legsIron.itemID, 0, 1, 1, 5), new WeightedRandomChestContent(Item.bootsIron.itemID, 0, 1, 1, 5), new WeightedRandomChestContent(Item.appleGold.itemID, 0, 1, 1, 1), new WeightedRandomChestContent(Item.saddle.itemID, 0, 1, 1, 1), new WeightedRandomChestContent(Item.horseArmorIron.itemID, 0, 1, 1, 1), new WeightedRandomChestContent(Item.horseArmorGold.itemID, 0, 1, 1, 1), new WeightedRandomChestContent(Item.horseArmorDiamond.itemID, 0, 1, 1, 1)}; + private boolean hasMadeChest; + +- public ComponentStrongholdChestCorridor() { +- } +- +- public ComponentStrongholdChestCorridor(int var1, Random var2, StructureBoundingBox var3, int var4) { +- super(var1); +- this.coordBaseMode = var4; +- this.field_143013_d = this.getRandomDoor(var2); +- this.boundingBox = var3; +- } +- +- protected void func_143012_a(NBTTagCompound var1) { +- super.func_143012_a(var1); +- var1.setBoolean("Chest", this.hasMadeChest); +- } +- +- protected void func_143011_b(NBTTagCompound var1) { +- super.func_143011_b(var1); +- this.hasMadeChest = var1.getBoolean("Chest"); +- } +- +- public void buildComponent(StructureComponent var1, List var2, Random var3) { +- this.getNextComponentNormal((ComponentStrongholdStairs2)var1, var2, var3, 1, 1); +- } +- +- public static ComponentStrongholdChestCorridor findValidPlacement(List var0, Random var1, int var2, int var3, int var4, int var5, int var6) { +- StructureBoundingBox var7 = StructureBoundingBox.getComponentToAddBoundingBox(var2, var3, var4, -1, -1, 0, 5, 5, 7, var5); +- return canStrongholdGoDeeper(var7) && StructureComponent.findIntersecting(var0, var7) == null ? new ComponentStrongholdChestCorridor(var6, var1, var7, var5) : null; +- } +- +- public boolean addComponentParts(World var1, Random var2, StructureBoundingBox var3) { +- if(this.isLiquidInStructureBoundingBox(var1, var3)) { ++ public ComponentStrongholdChestCorridor() {} ++ ++ public ComponentStrongholdChestCorridor(int par1, Random par2Random, StructureBoundingBox par3StructureBoundingBox, int par4) { ++ super(par1); ++ this.coordBaseMode = par4; ++ this.field_143013_d = this.getRandomDoor(par2Random); ++ this.boundingBox = par3StructureBoundingBox; ++ } ++ ++ protected void func_143012_a(NBTTagCompound par1NBTTagCompound) { ++ super.func_143012_a(par1NBTTagCompound); ++ par1NBTTagCompound.setBoolean("Chest", this.hasMadeChest); ++ } ++ ++ protected void func_143011_b(NBTTagCompound par1NBTTagCompound) { ++ super.func_143011_b(par1NBTTagCompound); ++ this.hasMadeChest = par1NBTTagCompound.getBoolean("Chest"); ++ } ++ ++ /** ++ * Initiates construction of the Structure Component picked, at the current Location of StructGen ++ */ ++ public void buildComponent(StructureComponent par1StructureComponent, List par2List, Random par3Random) { ++ this.getNextComponentNormal((ComponentStrongholdStairs2)par1StructureComponent, par2List, par3Random, 1, 1); ++ } ++ ++ public static ComponentStrongholdChestCorridor findValidPlacement(List par0List, Random par1Random, int par2, int par3, int par4, int par5, int par6) { ++ StructureBoundingBox var7 = StructureBoundingBox.getComponentToAddBoundingBox(par2, par3, par4, -1, -1, 0, 5, 5, 7, par5); ++ return canStrongholdGoDeeper(var7) && StructureComponent.findIntersecting(par0List, var7) == null ? new ComponentStrongholdChestCorridor(par6, par1Random, var7, par5) : null; ++ } ++ ++ /** ++ * second Part of Structure generating, this for example places Spiderwebs, Mob Spawners, it closes Mineshafts at the ++ * end, it adds Fences... ++ */ ++ public boolean addComponentParts(World par1World, Random par2Random, StructureBoundingBox par3StructureBoundingBox) { ++ if (this.isLiquidInStructureBoundingBox(par1World, par3StructureBoundingBox)) { + return false; + } else { +- this.fillWithRandomizedBlocks(var1, var3, 0, 0, 0, 4, 4, 6, true, var2, StructureStrongholdPieces.getStrongholdStones()); +- this.placeDoor(var1, var2, var3, this.field_143013_d, 1, 1, 0); +- this.placeDoor(var1, var2, var3, EnumDoor.OPENING, 1, 1, 6); +- this.fillWithBlocks(var1, var3, 3, 1, 2, 3, 1, 4, Block.stoneBrick.blockID, Block.stoneBrick.blockID, false); +- this.placeBlockAtCurrentPosition(var1, Block.stoneSingleSlab.blockID, 5, 3, 1, 1, var3); +- this.placeBlockAtCurrentPosition(var1, Block.stoneSingleSlab.blockID, 5, 3, 1, 5, var3); +- this.placeBlockAtCurrentPosition(var1, Block.stoneSingleSlab.blockID, 5, 3, 2, 2, var3); +- this.placeBlockAtCurrentPosition(var1, Block.stoneSingleSlab.blockID, 5, 3, 2, 4, var3); +- ++ this.fillWithRandomizedBlocks(par1World, par3StructureBoundingBox, 0, 0, 0, 4, 4, 6, true, par2Random, StructureStrongholdPieces.getStrongholdStones()); ++ this.placeDoor(par1World, par2Random, par3StructureBoundingBox, this.field_143013_d, 1, 1, 0); ++ this.placeDoor(par1World, par2Random, par3StructureBoundingBox, EnumDoor.OPENING, 1, 1, 6); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 3, 1, 2, 3, 1, 4, Block.stoneBrick.blockID, Block.stoneBrick.blockID, false); ++ this.placeBlockAtCurrentPosition(par1World, Block.stoneSingleSlab.blockID, 5, 3, 1, 1, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.stoneSingleSlab.blockID, 5, 3, 1, 5, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.stoneSingleSlab.blockID, 5, 3, 2, 2, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.stoneSingleSlab.blockID, 5, 3, 2, 4, par3StructureBoundingBox); + int var4; +- for(var4 = 2; var4 <= 4; ++var4) { +- this.placeBlockAtCurrentPosition(var1, Block.stoneSingleSlab.blockID, 5, 2, 1, var4, var3); ++ ++ for (var4 = 2; var4 <= 4; ++var4) { ++ this.placeBlockAtCurrentPosition(par1World, Block.stoneSingleSlab.blockID, 5, 2, 1, var4, par3StructureBoundingBox); + } + +- if(!this.hasMadeChest) { ++ if (!this.hasMadeChest) { + var4 = this.getYWithOffset(2); + int var5 = this.getXWithOffset(3, 3); + int var6 = this.getZWithOffset(3, 3); +- if(var3.isVecInside(var5, var4, var6)) { ++ ++ if (par3StructureBoundingBox.isVecInside(var5, var4, var6)) { + this.hasMadeChest = true; +- this.generateStructureChestContents(var1, var3, var2, 3, 2, 3, WeightedRandomChestContent.func_92080_a(strongholdChestContents, new WeightedRandomChestContent[]{Item.enchantedBook.func_92114_b(var2)}), 2 + var2.nextInt(2)); ++ this.generateStructureChestContents(par1World, par3StructureBoundingBox, par2Random, 3, 2, 3, WeightedRandomChestContent.func_92080_a(strongholdChestContents, new WeightedRandomChestContent[] {Item.enchantedBook.func_92114_b(par2Random)}), 2 + par2Random.nextInt(2)); + } + } + diff --git a/patches/net/minecraft/src/ComponentStrongholdCorridor.java.patch b/patches/net/minecraft/src/ComponentStrongholdCorridor.java.patch new file mode 100644 index 0000000..e7267c6 --- /dev/null +++ b/patches/net/minecraft/src/ComponentStrongholdCorridor.java.patch @@ -0,0 +1,125 @@ +--- net/minecraft/src/ComponentStrongholdCorridor.java ++++ net/minecraft/src/ComponentStrongholdCorridor.java +@@ -6,38 +6,39 @@ + public class ComponentStrongholdCorridor extends ComponentStronghold { + private int field_74993_a; + +- public ComponentStrongholdCorridor() { +- } +- +- public ComponentStrongholdCorridor(int var1, Random var2, StructureBoundingBox var3, int var4) { +- super(var1); +- this.coordBaseMode = var4; +- this.boundingBox = var3; +- this.field_74993_a = var4 != 2 && var4 != 0 ? var3.getXSize() : var3.getZSize(); +- } +- +- protected void func_143012_a(NBTTagCompound var1) { +- super.func_143012_a(var1); +- var1.setInteger("Steps", this.field_74993_a); +- } +- +- protected void func_143011_b(NBTTagCompound var1) { +- super.func_143011_b(var1); +- this.field_74993_a = var1.getInteger("Steps"); +- } +- +- public static StructureBoundingBox func_74992_a(List var0, Random var1, int var2, int var3, int var4, int var5) { ++ public ComponentStrongholdCorridor() {} ++ ++ public ComponentStrongholdCorridor(int par1, Random par2Random, StructureBoundingBox par3StructureBoundingBox, int par4) { ++ super(par1); ++ this.coordBaseMode = par4; ++ this.boundingBox = par3StructureBoundingBox; ++ this.field_74993_a = par4 != 2 && par4 != 0 ? par3StructureBoundingBox.getXSize() : par3StructureBoundingBox.getZSize(); ++ } ++ ++ protected void func_143012_a(NBTTagCompound par1NBTTagCompound) { ++ super.func_143012_a(par1NBTTagCompound); ++ par1NBTTagCompound.setInteger("Steps", this.field_74993_a); ++ } ++ ++ protected void func_143011_b(NBTTagCompound par1NBTTagCompound) { ++ super.func_143011_b(par1NBTTagCompound); ++ this.field_74993_a = par1NBTTagCompound.getInteger("Steps"); ++ } ++ ++ public static StructureBoundingBox func_74992_a(List par0List, Random par1Random, int par2, int par3, int par4, int par5) { + boolean var6 = true; +- StructureBoundingBox var7 = StructureBoundingBox.getComponentToAddBoundingBox(var2, var3, var4, -1, -1, 0, 5, 5, 4, var5); +- StructureComponent var8 = StructureComponent.findIntersecting(var0, var7); +- if(var8 == null) { ++ StructureBoundingBox var7 = StructureBoundingBox.getComponentToAddBoundingBox(par2, par3, par4, -1, -1, 0, 5, 5, 4, par5); ++ StructureComponent var8 = StructureComponent.findIntersecting(par0List, var7); ++ ++ if (var8 == null) { + return null; + } else { +- if(var8.getBoundingBox().minY == var7.minY) { +- for(int var9 = 3; var9 >= 1; --var9) { +- var7 = StructureBoundingBox.getComponentToAddBoundingBox(var2, var3, var4, -1, -1, 0, 5, 5, var9 - 1, var5); +- if(!var8.getBoundingBox().intersectsWith(var7)) { +- return StructureBoundingBox.getComponentToAddBoundingBox(var2, var3, var4, -1, -1, 0, 5, 5, var9, var5); ++ if (var8.getBoundingBox().minY == var7.minY) { ++ for (int var9 = 3; var9 >= 1; --var9) { ++ var7 = StructureBoundingBox.getComponentToAddBoundingBox(par2, par3, par4, -1, -1, 0, 5, 5, var9 - 1, par5); ++ ++ if (!var8.getBoundingBox().intersectsWith(var7)) { ++ return StructureBoundingBox.getComponentToAddBoundingBox(par2, par3, par4, -1, -1, 0, 5, 5, var9, par5); + } + } + } +@@ -46,30 +47,34 @@ + } + } + +- public boolean addComponentParts(World var1, Random var2, StructureBoundingBox var3) { +- if(this.isLiquidInStructureBoundingBox(var1, var3)) { ++ /** ++ * second Part of Structure generating, this for example places Spiderwebs, Mob Spawners, it closes Mineshafts at the ++ * end, it adds Fences... ++ */ ++ public boolean addComponentParts(World par1World, Random par2Random, StructureBoundingBox par3StructureBoundingBox) { ++ if (this.isLiquidInStructureBoundingBox(par1World, par3StructureBoundingBox)) { + return false; + } else { +- for(int var4 = 0; var4 < this.field_74993_a; ++var4) { +- this.placeBlockAtCurrentPosition(var1, Block.stoneBrick.blockID, 0, 0, 0, var4, var3); +- this.placeBlockAtCurrentPosition(var1, Block.stoneBrick.blockID, 0, 1, 0, var4, var3); +- this.placeBlockAtCurrentPosition(var1, Block.stoneBrick.blockID, 0, 2, 0, var4, var3); +- this.placeBlockAtCurrentPosition(var1, Block.stoneBrick.blockID, 0, 3, 0, var4, var3); +- this.placeBlockAtCurrentPosition(var1, Block.stoneBrick.blockID, 0, 4, 0, var4, var3); ++ for (int var4 = 0; var4 < this.field_74993_a; ++var4) { ++ this.placeBlockAtCurrentPosition(par1World, Block.stoneBrick.blockID, 0, 0, 0, var4, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.stoneBrick.blockID, 0, 1, 0, var4, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.stoneBrick.blockID, 0, 2, 0, var4, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.stoneBrick.blockID, 0, 3, 0, var4, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.stoneBrick.blockID, 0, 4, 0, var4, par3StructureBoundingBox); + +- for(int var5 = 1; var5 <= 3; ++var5) { +- this.placeBlockAtCurrentPosition(var1, Block.stoneBrick.blockID, 0, 0, var5, var4, var3); +- this.placeBlockAtCurrentPosition(var1, 0, 0, 1, var5, var4, var3); +- this.placeBlockAtCurrentPosition(var1, 0, 0, 2, var5, var4, var3); +- this.placeBlockAtCurrentPosition(var1, 0, 0, 3, var5, var4, var3); +- this.placeBlockAtCurrentPosition(var1, Block.stoneBrick.blockID, 0, 4, var5, var4, var3); ++ for (int var5 = 1; var5 <= 3; ++var5) { ++ this.placeBlockAtCurrentPosition(par1World, Block.stoneBrick.blockID, 0, 0, var5, var4, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, 0, 0, 1, var5, var4, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, 0, 0, 2, var5, var4, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, 0, 0, 3, var5, var4, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.stoneBrick.blockID, 0, 4, var5, var4, par3StructureBoundingBox); + } + +- this.placeBlockAtCurrentPosition(var1, Block.stoneBrick.blockID, 0, 0, 4, var4, var3); +- this.placeBlockAtCurrentPosition(var1, Block.stoneBrick.blockID, 0, 1, 4, var4, var3); +- this.placeBlockAtCurrentPosition(var1, Block.stoneBrick.blockID, 0, 2, 4, var4, var3); +- this.placeBlockAtCurrentPosition(var1, Block.stoneBrick.blockID, 0, 3, 4, var4, var3); +- this.placeBlockAtCurrentPosition(var1, Block.stoneBrick.blockID, 0, 4, 4, var4, var3); ++ this.placeBlockAtCurrentPosition(par1World, Block.stoneBrick.blockID, 0, 0, 4, var4, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.stoneBrick.blockID, 0, 1, 4, var4, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.stoneBrick.blockID, 0, 2, 4, var4, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.stoneBrick.blockID, 0, 3, 4, var4, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.stoneBrick.blockID, 0, 4, 4, var4, par3StructureBoundingBox); + } + + return true; diff --git a/patches/net/minecraft/src/ComponentStrongholdCrossing.java.patch b/patches/net/minecraft/src/ComponentStrongholdCrossing.java.patch new file mode 100644 index 0000000..c9a52b9 --- /dev/null +++ b/patches/net/minecraft/src/ComponentStrongholdCrossing.java.patch @@ -0,0 +1,207 @@ +--- net/minecraft/src/ComponentStrongholdCrossing.java ++++ net/minecraft/src/ComponentStrongholdCrossing.java +@@ -9,105 +9,113 @@ + private boolean field_74995_d; + private boolean field_74999_h; + +- public ComponentStrongholdCrossing() { +- } +- +- public ComponentStrongholdCrossing(int var1, Random var2, StructureBoundingBox var3, int var4) { +- super(var1); +- this.coordBaseMode = var4; +- this.field_143013_d = this.getRandomDoor(var2); +- this.boundingBox = var3; +- this.field_74996_b = var2.nextBoolean(); +- this.field_74997_c = var2.nextBoolean(); +- this.field_74995_d = var2.nextBoolean(); +- this.field_74999_h = var2.nextInt(3) > 0; +- } +- +- protected void func_143012_a(NBTTagCompound var1) { +- super.func_143012_a(var1); +- var1.setBoolean("leftLow", this.field_74996_b); +- var1.setBoolean("leftHigh", this.field_74997_c); +- var1.setBoolean("rightLow", this.field_74995_d); +- var1.setBoolean("rightHigh", this.field_74999_h); +- } +- +- protected void func_143011_b(NBTTagCompound var1) { +- super.func_143011_b(var1); +- this.field_74996_b = var1.getBoolean("leftLow"); +- this.field_74997_c = var1.getBoolean("leftHigh"); +- this.field_74995_d = var1.getBoolean("rightLow"); +- this.field_74999_h = var1.getBoolean("rightHigh"); +- } +- +- public void buildComponent(StructureComponent var1, List var2, Random var3) { ++ public ComponentStrongholdCrossing() {} ++ ++ public ComponentStrongholdCrossing(int par1, Random par2Random, StructureBoundingBox par3StructureBoundingBox, int par4) { ++ super(par1); ++ this.coordBaseMode = par4; ++ this.field_143013_d = this.getRandomDoor(par2Random); ++ this.boundingBox = par3StructureBoundingBox; ++ this.field_74996_b = par2Random.nextBoolean(); ++ this.field_74997_c = par2Random.nextBoolean(); ++ this.field_74995_d = par2Random.nextBoolean(); ++ this.field_74999_h = par2Random.nextInt(3) > 0; ++ } ++ ++ protected void func_143012_a(NBTTagCompound par1NBTTagCompound) { ++ super.func_143012_a(par1NBTTagCompound); ++ par1NBTTagCompound.setBoolean("leftLow", this.field_74996_b); ++ par1NBTTagCompound.setBoolean("leftHigh", this.field_74997_c); ++ par1NBTTagCompound.setBoolean("rightLow", this.field_74995_d); ++ par1NBTTagCompound.setBoolean("rightHigh", this.field_74999_h); ++ } ++ ++ protected void func_143011_b(NBTTagCompound par1NBTTagCompound) { ++ super.func_143011_b(par1NBTTagCompound); ++ this.field_74996_b = par1NBTTagCompound.getBoolean("leftLow"); ++ this.field_74997_c = par1NBTTagCompound.getBoolean("leftHigh"); ++ this.field_74995_d = par1NBTTagCompound.getBoolean("rightLow"); ++ this.field_74999_h = par1NBTTagCompound.getBoolean("rightHigh"); ++ } ++ ++ /** ++ * Initiates construction of the Structure Component picked, at the current Location of StructGen ++ */ ++ public void buildComponent(StructureComponent par1StructureComponent, List par2List, Random par3Random) { + int var4 = 3; + int var5 = 5; +- if(this.coordBaseMode == 1 || this.coordBaseMode == 2) { ++ ++ if (this.coordBaseMode == 1 || this.coordBaseMode == 2) { + var4 = 8 - var4; + var5 = 8 - var5; + } + +- this.getNextComponentNormal((ComponentStrongholdStairs2)var1, var2, var3, 5, 1); +- if(this.field_74996_b) { +- this.getNextComponentX((ComponentStrongholdStairs2)var1, var2, var3, var4, 1); +- } +- +- if(this.field_74997_c) { +- this.getNextComponentX((ComponentStrongholdStairs2)var1, var2, var3, var5, 7); +- } +- +- if(this.field_74995_d) { +- this.getNextComponentZ((ComponentStrongholdStairs2)var1, var2, var3, var4, 1); +- } +- +- if(this.field_74999_h) { +- this.getNextComponentZ((ComponentStrongholdStairs2)var1, var2, var3, var5, 7); +- } +- +- } +- +- public static ComponentStrongholdCrossing findValidPlacement(List var0, Random var1, int var2, int var3, int var4, int var5, int var6) { +- StructureBoundingBox var7 = StructureBoundingBox.getComponentToAddBoundingBox(var2, var3, var4, -4, -3, 0, 10, 9, 11, var5); +- return canStrongholdGoDeeper(var7) && StructureComponent.findIntersecting(var0, var7) == null ? new ComponentStrongholdCrossing(var6, var1, var7, var5) : null; +- } +- +- public boolean addComponentParts(World var1, Random var2, StructureBoundingBox var3) { +- if(this.isLiquidInStructureBoundingBox(var1, var3)) { ++ this.getNextComponentNormal((ComponentStrongholdStairs2)par1StructureComponent, par2List, par3Random, 5, 1); ++ ++ if (this.field_74996_b) { ++ this.getNextComponentX((ComponentStrongholdStairs2)par1StructureComponent, par2List, par3Random, var4, 1); ++ } ++ ++ if (this.field_74997_c) { ++ this.getNextComponentX((ComponentStrongholdStairs2)par1StructureComponent, par2List, par3Random, var5, 7); ++ } ++ ++ if (this.field_74995_d) { ++ this.getNextComponentZ((ComponentStrongholdStairs2)par1StructureComponent, par2List, par3Random, var4, 1); ++ } ++ ++ if (this.field_74999_h) { ++ this.getNextComponentZ((ComponentStrongholdStairs2)par1StructureComponent, par2List, par3Random, var5, 7); ++ } ++ } ++ ++ public static ComponentStrongholdCrossing findValidPlacement(List par0List, Random par1Random, int par2, int par3, int par4, int par5, int par6) { ++ StructureBoundingBox var7 = StructureBoundingBox.getComponentToAddBoundingBox(par2, par3, par4, -4, -3, 0, 10, 9, 11, par5); ++ return canStrongholdGoDeeper(var7) && StructureComponent.findIntersecting(par0List, var7) == null ? new ComponentStrongholdCrossing(par6, par1Random, var7, par5) : null; ++ } ++ ++ /** ++ * second Part of Structure generating, this for example places Spiderwebs, Mob Spawners, it closes Mineshafts at the ++ * end, it adds Fences... ++ */ ++ public boolean addComponentParts(World par1World, Random par2Random, StructureBoundingBox par3StructureBoundingBox) { ++ if (this.isLiquidInStructureBoundingBox(par1World, par3StructureBoundingBox)) { + return false; + } else { +- this.fillWithRandomizedBlocks(var1, var3, 0, 0, 0, 9, 8, 10, true, var2, StructureStrongholdPieces.getStrongholdStones()); +- this.placeDoor(var1, var2, var3, this.field_143013_d, 4, 3, 0); +- if(this.field_74996_b) { +- this.fillWithBlocks(var1, var3, 0, 3, 1, 0, 5, 3, 0, 0, false); +- } +- +- if(this.field_74995_d) { +- this.fillWithBlocks(var1, var3, 9, 3, 1, 9, 5, 3, 0, 0, false); +- } +- +- if(this.field_74997_c) { +- this.fillWithBlocks(var1, var3, 0, 5, 7, 0, 7, 9, 0, 0, false); +- } +- +- if(this.field_74999_h) { +- this.fillWithBlocks(var1, var3, 9, 5, 7, 9, 7, 9, 0, 0, false); +- } +- +- this.fillWithBlocks(var1, var3, 5, 1, 10, 7, 3, 10, 0, 0, false); +- this.fillWithRandomizedBlocks(var1, var3, 1, 2, 1, 8, 2, 6, false, var2, StructureStrongholdPieces.getStrongholdStones()); +- this.fillWithRandomizedBlocks(var1, var3, 4, 1, 5, 4, 4, 9, false, var2, StructureStrongholdPieces.getStrongholdStones()); +- this.fillWithRandomizedBlocks(var1, var3, 8, 1, 5, 8, 4, 9, false, var2, StructureStrongholdPieces.getStrongholdStones()); +- this.fillWithRandomizedBlocks(var1, var3, 1, 4, 7, 3, 4, 9, false, var2, StructureStrongholdPieces.getStrongholdStones()); +- this.fillWithRandomizedBlocks(var1, var3, 1, 3, 5, 3, 3, 6, false, var2, StructureStrongholdPieces.getStrongholdStones()); +- this.fillWithBlocks(var1, var3, 1, 3, 4, 3, 3, 4, Block.stoneSingleSlab.blockID, Block.stoneSingleSlab.blockID, false); +- this.fillWithBlocks(var1, var3, 1, 4, 6, 3, 4, 6, Block.stoneSingleSlab.blockID, Block.stoneSingleSlab.blockID, false); +- this.fillWithRandomizedBlocks(var1, var3, 5, 1, 7, 7, 1, 8, false, var2, StructureStrongholdPieces.getStrongholdStones()); +- this.fillWithBlocks(var1, var3, 5, 1, 9, 7, 1, 9, Block.stoneSingleSlab.blockID, Block.stoneSingleSlab.blockID, false); +- this.fillWithBlocks(var1, var3, 5, 2, 7, 7, 2, 7, Block.stoneSingleSlab.blockID, Block.stoneSingleSlab.blockID, false); +- this.fillWithBlocks(var1, var3, 4, 5, 7, 4, 5, 9, Block.stoneSingleSlab.blockID, Block.stoneSingleSlab.blockID, false); +- this.fillWithBlocks(var1, var3, 8, 5, 7, 8, 5, 9, Block.stoneSingleSlab.blockID, Block.stoneSingleSlab.blockID, false); +- this.fillWithBlocks(var1, var3, 5, 5, 7, 7, 5, 9, Block.stoneDoubleSlab.blockID, Block.stoneDoubleSlab.blockID, false); +- this.placeBlockAtCurrentPosition(var1, Block.torchWood.blockID, 0, 6, 5, 6, var3); ++ this.fillWithRandomizedBlocks(par1World, par3StructureBoundingBox, 0, 0, 0, 9, 8, 10, true, par2Random, StructureStrongholdPieces.getStrongholdStones()); ++ this.placeDoor(par1World, par2Random, par3StructureBoundingBox, this.field_143013_d, 4, 3, 0); ++ ++ if (this.field_74996_b) { ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 0, 3, 1, 0, 5, 3, 0, 0, false); ++ } ++ ++ if (this.field_74995_d) { ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 9, 3, 1, 9, 5, 3, 0, 0, false); ++ } ++ ++ if (this.field_74997_c) { ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 0, 5, 7, 0, 7, 9, 0, 0, false); ++ } ++ ++ if (this.field_74999_h) { ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 9, 5, 7, 9, 7, 9, 0, 0, false); ++ } ++ ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 5, 1, 10, 7, 3, 10, 0, 0, false); ++ this.fillWithRandomizedBlocks(par1World, par3StructureBoundingBox, 1, 2, 1, 8, 2, 6, false, par2Random, StructureStrongholdPieces.getStrongholdStones()); ++ this.fillWithRandomizedBlocks(par1World, par3StructureBoundingBox, 4, 1, 5, 4, 4, 9, false, par2Random, StructureStrongholdPieces.getStrongholdStones()); ++ this.fillWithRandomizedBlocks(par1World, par3StructureBoundingBox, 8, 1, 5, 8, 4, 9, false, par2Random, StructureStrongholdPieces.getStrongholdStones()); ++ this.fillWithRandomizedBlocks(par1World, par3StructureBoundingBox, 1, 4, 7, 3, 4, 9, false, par2Random, StructureStrongholdPieces.getStrongholdStones()); ++ this.fillWithRandomizedBlocks(par1World, par3StructureBoundingBox, 1, 3, 5, 3, 3, 6, false, par2Random, StructureStrongholdPieces.getStrongholdStones()); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 1, 3, 4, 3, 3, 4, Block.stoneSingleSlab.blockID, Block.stoneSingleSlab.blockID, false); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 1, 4, 6, 3, 4, 6, Block.stoneSingleSlab.blockID, Block.stoneSingleSlab.blockID, false); ++ this.fillWithRandomizedBlocks(par1World, par3StructureBoundingBox, 5, 1, 7, 7, 1, 8, false, par2Random, StructureStrongholdPieces.getStrongholdStones()); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 5, 1, 9, 7, 1, 9, Block.stoneSingleSlab.blockID, Block.stoneSingleSlab.blockID, false); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 5, 2, 7, 7, 2, 7, Block.stoneSingleSlab.blockID, Block.stoneSingleSlab.blockID, false); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 4, 5, 7, 4, 5, 9, Block.stoneSingleSlab.blockID, Block.stoneSingleSlab.blockID, false); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 8, 5, 7, 8, 5, 9, Block.stoneSingleSlab.blockID, Block.stoneSingleSlab.blockID, false); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 5, 5, 7, 7, 5, 9, Block.stoneDoubleSlab.blockID, Block.stoneDoubleSlab.blockID, false); ++ this.placeBlockAtCurrentPosition(par1World, Block.torchWood.blockID, 0, 6, 5, 6, par3StructureBoundingBox); + return true; + } + } diff --git a/patches/net/minecraft/src/ComponentStrongholdLeftTurn.java.patch b/patches/net/minecraft/src/ComponentStrongholdLeftTurn.java.patch new file mode 100644 index 0000000..32aa2e2 --- /dev/null +++ b/patches/net/minecraft/src/ComponentStrongholdLeftTurn.java.patch @@ -0,0 +1,78 @@ +--- net/minecraft/src/ComponentStrongholdLeftTurn.java ++++ net/minecraft/src/ComponentStrongholdLeftTurn.java +@@ -4,40 +4,46 @@ + import java.util.Random; + + public class ComponentStrongholdLeftTurn extends ComponentStronghold { +- public ComponentStrongholdLeftTurn() { +- } +- +- public ComponentStrongholdLeftTurn(int var1, Random var2, StructureBoundingBox var3, int var4) { +- super(var1); +- this.coordBaseMode = var4; +- this.field_143013_d = this.getRandomDoor(var2); +- this.boundingBox = var3; +- } +- +- public void buildComponent(StructureComponent var1, List var2, Random var3) { +- if(this.coordBaseMode != 2 && this.coordBaseMode != 3) { +- this.getNextComponentZ((ComponentStrongholdStairs2)var1, var2, var3, 1, 1); ++ public ComponentStrongholdLeftTurn() {} ++ ++ public ComponentStrongholdLeftTurn(int par1, Random par2Random, StructureBoundingBox par3StructureBoundingBox, int par4) { ++ super(par1); ++ this.coordBaseMode = par4; ++ this.field_143013_d = this.getRandomDoor(par2Random); ++ this.boundingBox = par3StructureBoundingBox; ++ } ++ ++ /** ++ * Initiates construction of the Structure Component picked, at the current Location of StructGen ++ */ ++ public void buildComponent(StructureComponent par1StructureComponent, List par2List, Random par3Random) { ++ if (this.coordBaseMode != 2 && this.coordBaseMode != 3) { ++ this.getNextComponentZ((ComponentStrongholdStairs2)par1StructureComponent, par2List, par3Random, 1, 1); + } else { +- this.getNextComponentX((ComponentStrongholdStairs2)var1, var2, var3, 1, 1); ++ this.getNextComponentX((ComponentStrongholdStairs2)par1StructureComponent, par2List, par3Random, 1, 1); + } +- +- } +- +- public static ComponentStrongholdLeftTurn findValidPlacement(List var0, Random var1, int var2, int var3, int var4, int var5, int var6) { +- StructureBoundingBox var7 = StructureBoundingBox.getComponentToAddBoundingBox(var2, var3, var4, -1, -1, 0, 5, 5, 5, var5); +- return canStrongholdGoDeeper(var7) && StructureComponent.findIntersecting(var0, var7) == null ? new ComponentStrongholdLeftTurn(var6, var1, var7, var5) : null; +- } +- +- public boolean addComponentParts(World var1, Random var2, StructureBoundingBox var3) { +- if(this.isLiquidInStructureBoundingBox(var1, var3)) { ++ } ++ ++ public static ComponentStrongholdLeftTurn findValidPlacement(List par0List, Random par1Random, int par2, int par3, int par4, int par5, int par6) { ++ StructureBoundingBox var7 = StructureBoundingBox.getComponentToAddBoundingBox(par2, par3, par4, -1, -1, 0, 5, 5, 5, par5); ++ return canStrongholdGoDeeper(var7) && StructureComponent.findIntersecting(par0List, var7) == null ? new ComponentStrongholdLeftTurn(par6, par1Random, var7, par5) : null; ++ } ++ ++ /** ++ * second Part of Structure generating, this for example places Spiderwebs, Mob Spawners, it closes Mineshafts at the ++ * end, it adds Fences... ++ */ ++ public boolean addComponentParts(World par1World, Random par2Random, StructureBoundingBox par3StructureBoundingBox) { ++ if (this.isLiquidInStructureBoundingBox(par1World, par3StructureBoundingBox)) { + return false; + } else { +- this.fillWithRandomizedBlocks(var1, var3, 0, 0, 0, 4, 4, 4, true, var2, StructureStrongholdPieces.getStrongholdStones()); +- this.placeDoor(var1, var2, var3, this.field_143013_d, 1, 1, 0); +- if(this.coordBaseMode != 2 && this.coordBaseMode != 3) { +- this.fillWithBlocks(var1, var3, 4, 1, 1, 4, 3, 3, 0, 0, false); ++ this.fillWithRandomizedBlocks(par1World, par3StructureBoundingBox, 0, 0, 0, 4, 4, 4, true, par2Random, StructureStrongholdPieces.getStrongholdStones()); ++ this.placeDoor(par1World, par2Random, par3StructureBoundingBox, this.field_143013_d, 1, 1, 0); ++ ++ if (this.coordBaseMode != 2 && this.coordBaseMode != 3) { ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 4, 1, 1, 4, 3, 3, 0, 0, false); + } else { +- this.fillWithBlocks(var1, var3, 0, 1, 1, 0, 3, 3, 0, 0, false); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 0, 1, 1, 0, 3, 3, 0, 0, false); + } + + return true; diff --git a/patches/net/minecraft/src/ComponentStrongholdLibrary.java.patch b/patches/net/minecraft/src/ComponentStrongholdLibrary.java.patch new file mode 100644 index 0000000..ac31b97 --- /dev/null +++ b/patches/net/minecraft/src/ComponentStrongholdLibrary.java.patch @@ -0,0 +1,244 @@ +--- net/minecraft/src/ComponentStrongholdLibrary.java ++++ net/minecraft/src/ComponentStrongholdLibrary.java +@@ -4,133 +4,144 @@ + import java.util.Random; + + public class ComponentStrongholdLibrary extends ComponentStronghold { +- private static final WeightedRandomChestContent[] strongholdLibraryChestContents = new WeightedRandomChestContent[]{new WeightedRandomChestContent(Item.book.itemID, 0, 1, 3, 20), new WeightedRandomChestContent(Item.paper.itemID, 0, 2, 7, 20), new WeightedRandomChestContent(Item.emptyMap.itemID, 0, 1, 1, 1), new WeightedRandomChestContent(Item.compass.itemID, 0, 1, 1, 1)}; ++ ++ /** List of items that Stronghold Library chests can contain. */ ++ private static final WeightedRandomChestContent[] strongholdLibraryChestContents = new WeightedRandomChestContent[] {new WeightedRandomChestContent(Item.book.itemID, 0, 1, 3, 20), new WeightedRandomChestContent(Item.paper.itemID, 0, 2, 7, 20), new WeightedRandomChestContent(Item.emptyMap.itemID, 0, 1, 1, 1), new WeightedRandomChestContent(Item.compass.itemID, 0, 1, 1, 1)}; + private boolean isLargeRoom; + +- public ComponentStrongholdLibrary() { +- } +- +- public ComponentStrongholdLibrary(int var1, Random var2, StructureBoundingBox var3, int var4) { +- super(var1); +- this.coordBaseMode = var4; +- this.field_143013_d = this.getRandomDoor(var2); +- this.boundingBox = var3; +- this.isLargeRoom = var3.getYSize() > 6; +- } +- +- protected void func_143012_a(NBTTagCompound var1) { +- super.func_143012_a(var1); +- var1.setBoolean("Tall", this.isLargeRoom); +- } +- +- protected void func_143011_b(NBTTagCompound var1) { +- super.func_143011_b(var1); +- this.isLargeRoom = var1.getBoolean("Tall"); +- } +- +- public static ComponentStrongholdLibrary findValidPlacement(List var0, Random var1, int var2, int var3, int var4, int var5, int var6) { +- StructureBoundingBox var7 = StructureBoundingBox.getComponentToAddBoundingBox(var2, var3, var4, -4, -1, 0, 14, 11, 15, var5); +- if(!canStrongholdGoDeeper(var7) || StructureComponent.findIntersecting(var0, var7) != null) { +- var7 = StructureBoundingBox.getComponentToAddBoundingBox(var2, var3, var4, -4, -1, 0, 14, 6, 15, var5); +- if(!canStrongholdGoDeeper(var7) || StructureComponent.findIntersecting(var0, var7) != null) { ++ public ComponentStrongholdLibrary() {} ++ ++ public ComponentStrongholdLibrary(int par1, Random par2Random, StructureBoundingBox par3StructureBoundingBox, int par4) { ++ super(par1); ++ this.coordBaseMode = par4; ++ this.field_143013_d = this.getRandomDoor(par2Random); ++ this.boundingBox = par3StructureBoundingBox; ++ this.isLargeRoom = par3StructureBoundingBox.getYSize() > 6; ++ } ++ ++ protected void func_143012_a(NBTTagCompound par1NBTTagCompound) { ++ super.func_143012_a(par1NBTTagCompound); ++ par1NBTTagCompound.setBoolean("Tall", this.isLargeRoom); ++ } ++ ++ protected void func_143011_b(NBTTagCompound par1NBTTagCompound) { ++ super.func_143011_b(par1NBTTagCompound); ++ this.isLargeRoom = par1NBTTagCompound.getBoolean("Tall"); ++ } ++ ++ public static ComponentStrongholdLibrary findValidPlacement(List par0List, Random par1Random, int par2, int par3, int par4, int par5, int par6) { ++ StructureBoundingBox var7 = StructureBoundingBox.getComponentToAddBoundingBox(par2, par3, par4, -4, -1, 0, 14, 11, 15, par5); ++ ++ if (!canStrongholdGoDeeper(var7) || StructureComponent.findIntersecting(par0List, var7) != null) { ++ var7 = StructureBoundingBox.getComponentToAddBoundingBox(par2, par3, par4, -4, -1, 0, 14, 6, 15, par5); ++ ++ if (!canStrongholdGoDeeper(var7) || StructureComponent.findIntersecting(par0List, var7) != null) { + return null; + } + } + +- return new ComponentStrongholdLibrary(var6, var1, var7, var5); ++ return new ComponentStrongholdLibrary(par6, par1Random, var7, par5); + } + +- public boolean addComponentParts(World var1, Random var2, StructureBoundingBox var3) { +- if(this.isLiquidInStructureBoundingBox(var1, var3)) { ++ /** ++ * second Part of Structure generating, this for example places Spiderwebs, Mob Spawners, it closes Mineshafts at the ++ * end, it adds Fences... ++ */ ++ public boolean addComponentParts(World par1World, Random par2Random, StructureBoundingBox par3StructureBoundingBox) { ++ if (this.isLiquidInStructureBoundingBox(par1World, par3StructureBoundingBox)) { + return false; + } else { + byte var4 = 11; +- if(!this.isLargeRoom) { ++ ++ if (!this.isLargeRoom) { + var4 = 6; + } + +- this.fillWithRandomizedBlocks(var1, var3, 0, 0, 0, 13, var4 - 1, 14, true, var2, StructureStrongholdPieces.getStrongholdStones()); +- this.placeDoor(var1, var2, var3, this.field_143013_d, 4, 1, 0); +- this.randomlyFillWithBlocks(var1, var3, var2, 0.07F, 2, 1, 1, 11, 4, 13, Block.web.blockID, Block.web.blockID, false); ++ this.fillWithRandomizedBlocks(par1World, par3StructureBoundingBox, 0, 0, 0, 13, var4 - 1, 14, true, par2Random, StructureStrongholdPieces.getStrongholdStones()); ++ this.placeDoor(par1World, par2Random, par3StructureBoundingBox, this.field_143013_d, 4, 1, 0); ++ this.randomlyFillWithBlocks(par1World, par3StructureBoundingBox, par2Random, 0.07F, 2, 1, 1, 11, 4, 13, Block.web.blockID, Block.web.blockID, false); + boolean var5 = true; + boolean var6 = true; +- + int var7; +- for(var7 = 1; var7 <= 13; ++var7) { +- if((var7 - 1) % 4 == 0) { +- this.fillWithBlocks(var1, var3, 1, 1, var7, 1, 4, var7, Block.planks.blockID, Block.planks.blockID, false); +- this.fillWithBlocks(var1, var3, 12, 1, var7, 12, 4, var7, Block.planks.blockID, Block.planks.blockID, false); +- this.placeBlockAtCurrentPosition(var1, Block.torchWood.blockID, 0, 2, 3, var7, var3); +- this.placeBlockAtCurrentPosition(var1, Block.torchWood.blockID, 0, 11, 3, var7, var3); +- if(this.isLargeRoom) { +- this.fillWithBlocks(var1, var3, 1, 6, var7, 1, 9, var7, Block.planks.blockID, Block.planks.blockID, false); +- this.fillWithBlocks(var1, var3, 12, 6, var7, 12, 9, var7, Block.planks.blockID, Block.planks.blockID, false); ++ ++ for (var7 = 1; var7 <= 13; ++var7) { ++ if ((var7 - 1) % 4 == 0) { ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 1, 1, var7, 1, 4, var7, Block.planks.blockID, Block.planks.blockID, false); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 12, 1, var7, 12, 4, var7, Block.planks.blockID, Block.planks.blockID, false); ++ this.placeBlockAtCurrentPosition(par1World, Block.torchWood.blockID, 0, 2, 3, var7, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.torchWood.blockID, 0, 11, 3, var7, par3StructureBoundingBox); ++ ++ if (this.isLargeRoom) { ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 1, 6, var7, 1, 9, var7, Block.planks.blockID, Block.planks.blockID, false); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 12, 6, var7, 12, 9, var7, Block.planks.blockID, Block.planks.blockID, false); + } + } else { +- this.fillWithBlocks(var1, var3, 1, 1, var7, 1, 4, var7, Block.bookShelf.blockID, Block.bookShelf.blockID, false); +- this.fillWithBlocks(var1, var3, 12, 1, var7, 12, 4, var7, Block.bookShelf.blockID, Block.bookShelf.blockID, false); +- if(this.isLargeRoom) { +- this.fillWithBlocks(var1, var3, 1, 6, var7, 1, 9, var7, Block.bookShelf.blockID, Block.bookShelf.blockID, false); +- this.fillWithBlocks(var1, var3, 12, 6, var7, 12, 9, var7, Block.bookShelf.blockID, Block.bookShelf.blockID, false); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 1, 1, var7, 1, 4, var7, Block.bookShelf.blockID, Block.bookShelf.blockID, false); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 12, 1, var7, 12, 4, var7, Block.bookShelf.blockID, Block.bookShelf.blockID, false); ++ ++ if (this.isLargeRoom) { ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 1, 6, var7, 1, 9, var7, Block.bookShelf.blockID, Block.bookShelf.blockID, false); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 12, 6, var7, 12, 9, var7, Block.bookShelf.blockID, Block.bookShelf.blockID, false); + } + } + } + +- for(var7 = 3; var7 < 12; var7 += 2) { +- this.fillWithBlocks(var1, var3, 3, 1, var7, 4, 3, var7, Block.bookShelf.blockID, Block.bookShelf.blockID, false); +- this.fillWithBlocks(var1, var3, 6, 1, var7, 7, 3, var7, Block.bookShelf.blockID, Block.bookShelf.blockID, false); +- this.fillWithBlocks(var1, var3, 9, 1, var7, 10, 3, var7, Block.bookShelf.blockID, Block.bookShelf.blockID, false); ++ for (var7 = 3; var7 < 12; var7 += 2) { ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 3, 1, var7, 4, 3, var7, Block.bookShelf.blockID, Block.bookShelf.blockID, false); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 6, 1, var7, 7, 3, var7, Block.bookShelf.blockID, Block.bookShelf.blockID, false); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 9, 1, var7, 10, 3, var7, Block.bookShelf.blockID, Block.bookShelf.blockID, false); + } + +- if(this.isLargeRoom) { +- this.fillWithBlocks(var1, var3, 1, 5, 1, 3, 5, 13, Block.planks.blockID, Block.planks.blockID, false); +- this.fillWithBlocks(var1, var3, 10, 5, 1, 12, 5, 13, Block.planks.blockID, Block.planks.blockID, false); +- this.fillWithBlocks(var1, var3, 4, 5, 1, 9, 5, 2, Block.planks.blockID, Block.planks.blockID, false); +- this.fillWithBlocks(var1, var3, 4, 5, 12, 9, 5, 13, Block.planks.blockID, Block.planks.blockID, false); +- this.placeBlockAtCurrentPosition(var1, Block.planks.blockID, 0, 9, 5, 11, var3); +- this.placeBlockAtCurrentPosition(var1, Block.planks.blockID, 0, 8, 5, 11, var3); +- this.placeBlockAtCurrentPosition(var1, Block.planks.blockID, 0, 9, 5, 10, var3); +- this.fillWithBlocks(var1, var3, 3, 6, 2, 3, 6, 12, Block.fence.blockID, Block.fence.blockID, false); +- this.fillWithBlocks(var1, var3, 10, 6, 2, 10, 6, 10, Block.fence.blockID, Block.fence.blockID, false); +- this.fillWithBlocks(var1, var3, 4, 6, 2, 9, 6, 2, Block.fence.blockID, Block.fence.blockID, false); +- this.fillWithBlocks(var1, var3, 4, 6, 12, 8, 6, 12, Block.fence.blockID, Block.fence.blockID, false); +- this.placeBlockAtCurrentPosition(var1, Block.fence.blockID, 0, 9, 6, 11, var3); +- this.placeBlockAtCurrentPosition(var1, Block.fence.blockID, 0, 8, 6, 11, var3); +- this.placeBlockAtCurrentPosition(var1, Block.fence.blockID, 0, 9, 6, 10, var3); ++ if (this.isLargeRoom) { ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 1, 5, 1, 3, 5, 13, Block.planks.blockID, Block.planks.blockID, false); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 10, 5, 1, 12, 5, 13, Block.planks.blockID, Block.planks.blockID, false); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 4, 5, 1, 9, 5, 2, Block.planks.blockID, Block.planks.blockID, false); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 4, 5, 12, 9, 5, 13, Block.planks.blockID, Block.planks.blockID, false); ++ this.placeBlockAtCurrentPosition(par1World, Block.planks.blockID, 0, 9, 5, 11, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.planks.blockID, 0, 8, 5, 11, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.planks.blockID, 0, 9, 5, 10, par3StructureBoundingBox); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 3, 6, 2, 3, 6, 12, Block.fence.blockID, Block.fence.blockID, false); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 10, 6, 2, 10, 6, 10, Block.fence.blockID, Block.fence.blockID, false); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 4, 6, 2, 9, 6, 2, Block.fence.blockID, Block.fence.blockID, false); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 4, 6, 12, 8, 6, 12, Block.fence.blockID, Block.fence.blockID, false); ++ this.placeBlockAtCurrentPosition(par1World, Block.fence.blockID, 0, 9, 6, 11, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.fence.blockID, 0, 8, 6, 11, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.fence.blockID, 0, 9, 6, 10, par3StructureBoundingBox); + var7 = this.getMetadataWithOffset(Block.ladder.blockID, 3); +- this.placeBlockAtCurrentPosition(var1, Block.ladder.blockID, var7, 10, 1, 13, var3); +- this.placeBlockAtCurrentPosition(var1, Block.ladder.blockID, var7, 10, 2, 13, var3); +- this.placeBlockAtCurrentPosition(var1, Block.ladder.blockID, var7, 10, 3, 13, var3); +- this.placeBlockAtCurrentPosition(var1, Block.ladder.blockID, var7, 10, 4, 13, var3); +- this.placeBlockAtCurrentPosition(var1, Block.ladder.blockID, var7, 10, 5, 13, var3); +- this.placeBlockAtCurrentPosition(var1, Block.ladder.blockID, var7, 10, 6, 13, var3); +- this.placeBlockAtCurrentPosition(var1, Block.ladder.blockID, var7, 10, 7, 13, var3); ++ this.placeBlockAtCurrentPosition(par1World, Block.ladder.blockID, var7, 10, 1, 13, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.ladder.blockID, var7, 10, 2, 13, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.ladder.blockID, var7, 10, 3, 13, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.ladder.blockID, var7, 10, 4, 13, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.ladder.blockID, var7, 10, 5, 13, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.ladder.blockID, var7, 10, 6, 13, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.ladder.blockID, var7, 10, 7, 13, par3StructureBoundingBox); + byte var8 = 7; + byte var9 = 7; +- this.placeBlockAtCurrentPosition(var1, Block.fence.blockID, 0, var8 - 1, 9, var9, var3); +- this.placeBlockAtCurrentPosition(var1, Block.fence.blockID, 0, var8, 9, var9, var3); +- this.placeBlockAtCurrentPosition(var1, Block.fence.blockID, 0, var8 - 1, 8, var9, var3); +- this.placeBlockAtCurrentPosition(var1, Block.fence.blockID, 0, var8, 8, var9, var3); +- this.placeBlockAtCurrentPosition(var1, Block.fence.blockID, 0, var8 - 1, 7, var9, var3); +- this.placeBlockAtCurrentPosition(var1, Block.fence.blockID, 0, var8, 7, var9, var3); +- this.placeBlockAtCurrentPosition(var1, Block.fence.blockID, 0, var8 - 2, 7, var9, var3); +- this.placeBlockAtCurrentPosition(var1, Block.fence.blockID, 0, var8 + 1, 7, var9, var3); +- this.placeBlockAtCurrentPosition(var1, Block.fence.blockID, 0, var8 - 1, 7, var9 - 1, var3); +- this.placeBlockAtCurrentPosition(var1, Block.fence.blockID, 0, var8 - 1, 7, var9 + 1, var3); +- this.placeBlockAtCurrentPosition(var1, Block.fence.blockID, 0, var8, 7, var9 - 1, var3); +- this.placeBlockAtCurrentPosition(var1, Block.fence.blockID, 0, var8, 7, var9 + 1, var3); +- this.placeBlockAtCurrentPosition(var1, Block.torchWood.blockID, 0, var8 - 2, 8, var9, var3); +- this.placeBlockAtCurrentPosition(var1, Block.torchWood.blockID, 0, var8 + 1, 8, var9, var3); +- this.placeBlockAtCurrentPosition(var1, Block.torchWood.blockID, 0, var8 - 1, 8, var9 - 1, var3); +- this.placeBlockAtCurrentPosition(var1, Block.torchWood.blockID, 0, var8 - 1, 8, var9 + 1, var3); +- this.placeBlockAtCurrentPosition(var1, Block.torchWood.blockID, 0, var8, 8, var9 - 1, var3); +- this.placeBlockAtCurrentPosition(var1, Block.torchWood.blockID, 0, var8, 8, var9 + 1, var3); ++ this.placeBlockAtCurrentPosition(par1World, Block.fence.blockID, 0, var8 - 1, 9, var9, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.fence.blockID, 0, var8, 9, var9, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.fence.blockID, 0, var8 - 1, 8, var9, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.fence.blockID, 0, var8, 8, var9, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.fence.blockID, 0, var8 - 1, 7, var9, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.fence.blockID, 0, var8, 7, var9, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.fence.blockID, 0, var8 - 2, 7, var9, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.fence.blockID, 0, var8 + 1, 7, var9, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.fence.blockID, 0, var8 - 1, 7, var9 - 1, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.fence.blockID, 0, var8 - 1, 7, var9 + 1, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.fence.blockID, 0, var8, 7, var9 - 1, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.fence.blockID, 0, var8, 7, var9 + 1, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.torchWood.blockID, 0, var8 - 2, 8, var9, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.torchWood.blockID, 0, var8 + 1, 8, var9, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.torchWood.blockID, 0, var8 - 1, 8, var9 - 1, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.torchWood.blockID, 0, var8 - 1, 8, var9 + 1, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.torchWood.blockID, 0, var8, 8, var9 - 1, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.torchWood.blockID, 0, var8, 8, var9 + 1, par3StructureBoundingBox); + } + +- this.generateStructureChestContents(var1, var3, var2, 3, 3, 5, WeightedRandomChestContent.func_92080_a(strongholdLibraryChestContents, new WeightedRandomChestContent[]{Item.enchantedBook.func_92112_a(var2, 1, 5, 2)}), 1 + var2.nextInt(4)); +- if(this.isLargeRoom) { +- this.placeBlockAtCurrentPosition(var1, 0, 0, 12, 9, 1, var3); +- this.generateStructureChestContents(var1, var3, var2, 12, 8, 1, WeightedRandomChestContent.func_92080_a(strongholdLibraryChestContents, new WeightedRandomChestContent[]{Item.enchantedBook.func_92112_a(var2, 1, 5, 2)}), 1 + var2.nextInt(4)); ++ this.generateStructureChestContents(par1World, par3StructureBoundingBox, par2Random, 3, 3, 5, WeightedRandomChestContent.func_92080_a(strongholdLibraryChestContents, new WeightedRandomChestContent[] {Item.enchantedBook.func_92112_a(par2Random, 1, 5, 2)}), 1 + par2Random.nextInt(4)); ++ ++ if (this.isLargeRoom) { ++ this.placeBlockAtCurrentPosition(par1World, 0, 0, 12, 9, 1, par3StructureBoundingBox); ++ this.generateStructureChestContents(par1World, par3StructureBoundingBox, par2Random, 12, 8, 1, WeightedRandomChestContent.func_92080_a(strongholdLibraryChestContents, new WeightedRandomChestContent[] {Item.enchantedBook.func_92112_a(par2Random, 1, 5, 2)}), 1 + par2Random.nextInt(4)); + } + + return true; diff --git a/patches/net/minecraft/src/ComponentStrongholdPortalRoom.java.patch b/patches/net/minecraft/src/ComponentStrongholdPortalRoom.java.patch new file mode 100644 index 0000000..2987f27 --- /dev/null +++ b/patches/net/minecraft/src/ComponentStrongholdPortalRoom.java.patch @@ -0,0 +1,224 @@ +--- net/minecraft/src/ComponentStrongholdPortalRoom.java ++++ net/minecraft/src/ComponentStrongholdPortalRoom.java +@@ -6,118 +6,130 @@ + public class ComponentStrongholdPortalRoom extends ComponentStronghold { + private boolean hasSpawner; + +- public ComponentStrongholdPortalRoom() { +- } +- +- public ComponentStrongholdPortalRoom(int var1, Random var2, StructureBoundingBox var3, int var4) { +- super(var1); +- this.coordBaseMode = var4; +- this.boundingBox = var3; +- } +- +- protected void func_143012_a(NBTTagCompound var1) { +- super.func_143012_a(var1); +- var1.setBoolean("Mob", this.hasSpawner); +- } +- +- protected void func_143011_b(NBTTagCompound var1) { +- super.func_143011_b(var1); +- this.hasSpawner = var1.getBoolean("Mob"); +- } +- +- public void buildComponent(StructureComponent var1, List var2, Random var3) { +- if(var1 != null) { +- ((ComponentStrongholdStairs2)var1).strongholdPortalRoom = this; ++ public ComponentStrongholdPortalRoom() {} ++ ++ public ComponentStrongholdPortalRoom(int par1, Random par2Random, StructureBoundingBox par3StructureBoundingBox, int par4) { ++ super(par1); ++ this.coordBaseMode = par4; ++ this.boundingBox = par3StructureBoundingBox; ++ } ++ ++ protected void func_143012_a(NBTTagCompound par1NBTTagCompound) { ++ super.func_143012_a(par1NBTTagCompound); ++ par1NBTTagCompound.setBoolean("Mob", this.hasSpawner); ++ } ++ ++ protected void func_143011_b(NBTTagCompound par1NBTTagCompound) { ++ super.func_143011_b(par1NBTTagCompound); ++ this.hasSpawner = par1NBTTagCompound.getBoolean("Mob"); ++ } ++ ++ /** ++ * Initiates construction of the Structure Component picked, at the current Location of StructGen ++ */ ++ public void buildComponent(StructureComponent par1StructureComponent, List par2List, Random par3Random) { ++ if (par1StructureComponent != null) { ++ ((ComponentStrongholdStairs2)par1StructureComponent).strongholdPortalRoom = this; + } +- +- } +- +- public static ComponentStrongholdPortalRoom findValidPlacement(List var0, Random var1, int var2, int var3, int var4, int var5, int var6) { +- StructureBoundingBox var7 = StructureBoundingBox.getComponentToAddBoundingBox(var2, var3, var4, -4, -1, 0, 11, 8, 16, var5); +- return canStrongholdGoDeeper(var7) && StructureComponent.findIntersecting(var0, var7) == null ? new ComponentStrongholdPortalRoom(var6, var1, var7, var5) : null; +- } +- +- public boolean addComponentParts(World var1, Random var2, StructureBoundingBox var3) { +- this.fillWithRandomizedBlocks(var1, var3, 0, 0, 0, 10, 7, 15, false, var2, StructureStrongholdPieces.getStrongholdStones()); +- this.placeDoor(var1, var2, var3, EnumDoor.GRATES, 4, 1, 0); ++ } ++ ++ public static ComponentStrongholdPortalRoom findValidPlacement(List par0List, Random par1Random, int par2, int par3, int par4, int par5, int par6) { ++ StructureBoundingBox var7 = StructureBoundingBox.getComponentToAddBoundingBox(par2, par3, par4, -4, -1, 0, 11, 8, 16, par5); ++ return canStrongholdGoDeeper(var7) && StructureComponent.findIntersecting(par0List, var7) == null ? new ComponentStrongholdPortalRoom(par6, par1Random, var7, par5) : null; ++ } ++ ++ /** ++ * second Part of Structure generating, this for example places Spiderwebs, Mob Spawners, it closes Mineshafts at the ++ * end, it adds Fences... ++ */ ++ public boolean addComponentParts(World par1World, Random par2Random, StructureBoundingBox par3StructureBoundingBox) { ++ this.fillWithRandomizedBlocks(par1World, par3StructureBoundingBox, 0, 0, 0, 10, 7, 15, false, par2Random, StructureStrongholdPieces.getStrongholdStones()); ++ this.placeDoor(par1World, par2Random, par3StructureBoundingBox, EnumDoor.GRATES, 4, 1, 0); + byte var4 = 6; +- this.fillWithRandomizedBlocks(var1, var3, 1, var4, 1, 1, var4, 14, false, var2, StructureStrongholdPieces.getStrongholdStones()); +- this.fillWithRandomizedBlocks(var1, var3, 9, var4, 1, 9, var4, 14, false, var2, StructureStrongholdPieces.getStrongholdStones()); +- this.fillWithRandomizedBlocks(var1, var3, 2, var4, 1, 8, var4, 2, false, var2, StructureStrongholdPieces.getStrongholdStones()); +- this.fillWithRandomizedBlocks(var1, var3, 2, var4, 14, 8, var4, 14, false, var2, StructureStrongholdPieces.getStrongholdStones()); +- this.fillWithRandomizedBlocks(var1, var3, 1, 1, 1, 2, 1, 4, false, var2, StructureStrongholdPieces.getStrongholdStones()); +- this.fillWithRandomizedBlocks(var1, var3, 8, 1, 1, 9, 1, 4, false, var2, StructureStrongholdPieces.getStrongholdStones()); +- this.fillWithBlocks(var1, var3, 1, 1, 1, 1, 1, 3, Block.lavaMoving.blockID, Block.lavaMoving.blockID, false); +- this.fillWithBlocks(var1, var3, 9, 1, 1, 9, 1, 3, Block.lavaMoving.blockID, Block.lavaMoving.blockID, false); +- this.fillWithRandomizedBlocks(var1, var3, 3, 1, 8, 7, 1, 12, false, var2, StructureStrongholdPieces.getStrongholdStones()); +- this.fillWithBlocks(var1, var3, 4, 1, 9, 6, 1, 11, Block.lavaMoving.blockID, Block.lavaMoving.blockID, false); +- ++ this.fillWithRandomizedBlocks(par1World, par3StructureBoundingBox, 1, var4, 1, 1, var4, 14, false, par2Random, StructureStrongholdPieces.getStrongholdStones()); ++ this.fillWithRandomizedBlocks(par1World, par3StructureBoundingBox, 9, var4, 1, 9, var4, 14, false, par2Random, StructureStrongholdPieces.getStrongholdStones()); ++ this.fillWithRandomizedBlocks(par1World, par3StructureBoundingBox, 2, var4, 1, 8, var4, 2, false, par2Random, StructureStrongholdPieces.getStrongholdStones()); ++ this.fillWithRandomizedBlocks(par1World, par3StructureBoundingBox, 2, var4, 14, 8, var4, 14, false, par2Random, StructureStrongholdPieces.getStrongholdStones()); ++ this.fillWithRandomizedBlocks(par1World, par3StructureBoundingBox, 1, 1, 1, 2, 1, 4, false, par2Random, StructureStrongholdPieces.getStrongholdStones()); ++ this.fillWithRandomizedBlocks(par1World, par3StructureBoundingBox, 8, 1, 1, 9, 1, 4, false, par2Random, StructureStrongholdPieces.getStrongholdStones()); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 1, 1, 1, 1, 1, 3, Block.lavaMoving.blockID, Block.lavaMoving.blockID, false); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 9, 1, 1, 9, 1, 3, Block.lavaMoving.blockID, Block.lavaMoving.blockID, false); ++ this.fillWithRandomizedBlocks(par1World, par3StructureBoundingBox, 3, 1, 8, 7, 1, 12, false, par2Random, StructureStrongholdPieces.getStrongholdStones()); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 4, 1, 9, 6, 1, 11, Block.lavaMoving.blockID, Block.lavaMoving.blockID, false); + int var5; +- for(var5 = 3; var5 < 14; var5 += 2) { +- this.fillWithBlocks(var1, var3, 0, 3, var5, 0, 4, var5, Block.fenceIron.blockID, Block.fenceIron.blockID, false); +- this.fillWithBlocks(var1, var3, 10, 3, var5, 10, 4, var5, Block.fenceIron.blockID, Block.fenceIron.blockID, false); ++ ++ for (var5 = 3; var5 < 14; var5 += 2) { ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 0, 3, var5, 0, 4, var5, Block.fenceIron.blockID, Block.fenceIron.blockID, false); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 10, 3, var5, 10, 4, var5, Block.fenceIron.blockID, Block.fenceIron.blockID, false); + } + +- for(var5 = 2; var5 < 9; var5 += 2) { +- this.fillWithBlocks(var1, var3, var5, 3, 15, var5, 4, 15, Block.fenceIron.blockID, Block.fenceIron.blockID, false); ++ for (var5 = 2; var5 < 9; var5 += 2) { ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, var5, 3, 15, var5, 4, 15, Block.fenceIron.blockID, Block.fenceIron.blockID, false); + } + + var5 = this.getMetadataWithOffset(Block.stairsStoneBrick.blockID, 3); +- this.fillWithRandomizedBlocks(var1, var3, 4, 1, 5, 6, 1, 7, false, var2, StructureStrongholdPieces.getStrongholdStones()); +- this.fillWithRandomizedBlocks(var1, var3, 4, 2, 6, 6, 2, 7, false, var2, StructureStrongholdPieces.getStrongholdStones()); +- this.fillWithRandomizedBlocks(var1, var3, 4, 3, 7, 6, 3, 7, false, var2, StructureStrongholdPieces.getStrongholdStones()); ++ this.fillWithRandomizedBlocks(par1World, par3StructureBoundingBox, 4, 1, 5, 6, 1, 7, false, par2Random, StructureStrongholdPieces.getStrongholdStones()); ++ this.fillWithRandomizedBlocks(par1World, par3StructureBoundingBox, 4, 2, 6, 6, 2, 7, false, par2Random, StructureStrongholdPieces.getStrongholdStones()); ++ this.fillWithRandomizedBlocks(par1World, par3StructureBoundingBox, 4, 3, 7, 6, 3, 7, false, par2Random, StructureStrongholdPieces.getStrongholdStones()); + +- for(int var6 = 4; var6 <= 6; ++var6) { +- this.placeBlockAtCurrentPosition(var1, Block.stairsStoneBrick.blockID, var5, var6, 1, 4, var3); +- this.placeBlockAtCurrentPosition(var1, Block.stairsStoneBrick.blockID, var5, var6, 2, 5, var3); +- this.placeBlockAtCurrentPosition(var1, Block.stairsStoneBrick.blockID, var5, var6, 3, 6, var3); ++ for (int var6 = 4; var6 <= 6; ++var6) { ++ this.placeBlockAtCurrentPosition(par1World, Block.stairsStoneBrick.blockID, var5, var6, 1, 4, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.stairsStoneBrick.blockID, var5, var6, 2, 5, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.stairsStoneBrick.blockID, var5, var6, 3, 6, par3StructureBoundingBox); + } + + byte var14 = 2; + byte var7 = 0; + byte var8 = 3; + byte var9 = 1; +- switch(this.coordBaseMode) { +- case 0: +- var14 = 0; +- var7 = 2; +- break; +- case 1: +- var14 = 1; +- var7 = 3; +- var8 = 0; +- var9 = 2; +- case 2: +- default: +- break; +- case 3: +- var14 = 3; +- var7 = 1; +- var8 = 0; +- var9 = 2; ++ ++ switch (this.coordBaseMode) { ++ case 0: ++ var14 = 0; ++ var7 = 2; ++ break; ++ ++ case 1: ++ var14 = 1; ++ var7 = 3; ++ var8 = 0; ++ var9 = 2; ++ ++ case 2: ++ default: ++ break; ++ ++ case 3: ++ var14 = 3; ++ var7 = 1; ++ var8 = 0; ++ var9 = 2; + } + +- this.placeBlockAtCurrentPosition(var1, Block.endPortalFrame.blockID, var14 + (var2.nextFloat() > 0.9F ? 4 : 0), 4, 3, 8, var3); +- this.placeBlockAtCurrentPosition(var1, Block.endPortalFrame.blockID, var14 + (var2.nextFloat() > 0.9F ? 4 : 0), 5, 3, 8, var3); +- this.placeBlockAtCurrentPosition(var1, Block.endPortalFrame.blockID, var14 + (var2.nextFloat() > 0.9F ? 4 : 0), 6, 3, 8, var3); +- this.placeBlockAtCurrentPosition(var1, Block.endPortalFrame.blockID, var7 + (var2.nextFloat() > 0.9F ? 4 : 0), 4, 3, 12, var3); +- this.placeBlockAtCurrentPosition(var1, Block.endPortalFrame.blockID, var7 + (var2.nextFloat() > 0.9F ? 4 : 0), 5, 3, 12, var3); +- this.placeBlockAtCurrentPosition(var1, Block.endPortalFrame.blockID, var7 + (var2.nextFloat() > 0.9F ? 4 : 0), 6, 3, 12, var3); +- this.placeBlockAtCurrentPosition(var1, Block.endPortalFrame.blockID, var8 + (var2.nextFloat() > 0.9F ? 4 : 0), 3, 3, 9, var3); +- this.placeBlockAtCurrentPosition(var1, Block.endPortalFrame.blockID, var8 + (var2.nextFloat() > 0.9F ? 4 : 0), 3, 3, 10, var3); +- this.placeBlockAtCurrentPosition(var1, Block.endPortalFrame.blockID, var8 + (var2.nextFloat() > 0.9F ? 4 : 0), 3, 3, 11, var3); +- this.placeBlockAtCurrentPosition(var1, Block.endPortalFrame.blockID, var9 + (var2.nextFloat() > 0.9F ? 4 : 0), 7, 3, 9, var3); +- this.placeBlockAtCurrentPosition(var1, Block.endPortalFrame.blockID, var9 + (var2.nextFloat() > 0.9F ? 4 : 0), 7, 3, 10, var3); +- this.placeBlockAtCurrentPosition(var1, Block.endPortalFrame.blockID, var9 + (var2.nextFloat() > 0.9F ? 4 : 0), 7, 3, 11, var3); +- if(!this.hasSpawner) { ++ this.placeBlockAtCurrentPosition(par1World, Block.endPortalFrame.blockID, var14 + (par2Random.nextFloat() > 0.9F ? 4 : 0), 4, 3, 8, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.endPortalFrame.blockID, var14 + (par2Random.nextFloat() > 0.9F ? 4 : 0), 5, 3, 8, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.endPortalFrame.blockID, var14 + (par2Random.nextFloat() > 0.9F ? 4 : 0), 6, 3, 8, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.endPortalFrame.blockID, var7 + (par2Random.nextFloat() > 0.9F ? 4 : 0), 4, 3, 12, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.endPortalFrame.blockID, var7 + (par2Random.nextFloat() > 0.9F ? 4 : 0), 5, 3, 12, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.endPortalFrame.blockID, var7 + (par2Random.nextFloat() > 0.9F ? 4 : 0), 6, 3, 12, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.endPortalFrame.blockID, var8 + (par2Random.nextFloat() > 0.9F ? 4 : 0), 3, 3, 9, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.endPortalFrame.blockID, var8 + (par2Random.nextFloat() > 0.9F ? 4 : 0), 3, 3, 10, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.endPortalFrame.blockID, var8 + (par2Random.nextFloat() > 0.9F ? 4 : 0), 3, 3, 11, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.endPortalFrame.blockID, var9 + (par2Random.nextFloat() > 0.9F ? 4 : 0), 7, 3, 9, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.endPortalFrame.blockID, var9 + (par2Random.nextFloat() > 0.9F ? 4 : 0), 7, 3, 10, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.endPortalFrame.blockID, var9 + (par2Random.nextFloat() > 0.9F ? 4 : 0), 7, 3, 11, par3StructureBoundingBox); ++ ++ if (!this.hasSpawner) { + int var13 = this.getYWithOffset(3); + int var10 = this.getXWithOffset(5, 6); + int var11 = this.getZWithOffset(5, 6); +- if(var3.isVecInside(var10, var13, var11)) { ++ ++ if (par3StructureBoundingBox.isVecInside(var10, var13, var11)) { + this.hasSpawner = true; +- var1.setBlock(var10, var13, var11, Block.mobSpawner.blockID, 0, 2); +- TileEntityMobSpawner var12 = (TileEntityMobSpawner)var1.getBlockTileEntity(var10, var13, var11); +- if(var12 != null) { ++ par1World.setBlock(var10, var13, var11, Block.mobSpawner.blockID, 0, 2); ++ TileEntityMobSpawner var12 = (TileEntityMobSpawner)par1World.getBlockTileEntity(var10, var13, var11); ++ ++ if (var12 != null) { + var12.getSpawnerLogic().setMobID("Silverfish"); + } + } diff --git a/patches/net/minecraft/src/ComponentStrongholdPrison.java.patch b/patches/net/minecraft/src/ComponentStrongholdPrison.java.patch new file mode 100644 index 0000000..a0c9f26 --- /dev/null +++ b/patches/net/minecraft/src/ComponentStrongholdPrison.java.patch @@ -0,0 +1,89 @@ +--- net/minecraft/src/ComponentStrongholdPrison.java ++++ net/minecraft/src/ComponentStrongholdPrison.java +@@ -4,44 +4,50 @@ + import java.util.Random; + + public class ComponentStrongholdPrison extends ComponentStronghold { +- public ComponentStrongholdPrison() { +- } +- +- public ComponentStrongholdPrison(int var1, Random var2, StructureBoundingBox var3, int var4) { +- super(var1); +- this.coordBaseMode = var4; +- this.field_143013_d = this.getRandomDoor(var2); +- this.boundingBox = var3; +- } +- +- public void buildComponent(StructureComponent var1, List var2, Random var3) { +- this.getNextComponentNormal((ComponentStrongholdStairs2)var1, var2, var3, 1, 1); +- } +- +- public static ComponentStrongholdPrison findValidPlacement(List var0, Random var1, int var2, int var3, int var4, int var5, int var6) { +- StructureBoundingBox var7 = StructureBoundingBox.getComponentToAddBoundingBox(var2, var3, var4, -1, -1, 0, 9, 5, 11, var5); +- return canStrongholdGoDeeper(var7) && StructureComponent.findIntersecting(var0, var7) == null ? new ComponentStrongholdPrison(var6, var1, var7, var5) : null; +- } +- +- public boolean addComponentParts(World var1, Random var2, StructureBoundingBox var3) { +- if(this.isLiquidInStructureBoundingBox(var1, var3)) { ++ public ComponentStrongholdPrison() {} ++ ++ public ComponentStrongholdPrison(int par1, Random par2Random, StructureBoundingBox par3StructureBoundingBox, int par4) { ++ super(par1); ++ this.coordBaseMode = par4; ++ this.field_143013_d = this.getRandomDoor(par2Random); ++ this.boundingBox = par3StructureBoundingBox; ++ } ++ ++ /** ++ * Initiates construction of the Structure Component picked, at the current Location of StructGen ++ */ ++ public void buildComponent(StructureComponent par1StructureComponent, List par2List, Random par3Random) { ++ this.getNextComponentNormal((ComponentStrongholdStairs2)par1StructureComponent, par2List, par3Random, 1, 1); ++ } ++ ++ public static ComponentStrongholdPrison findValidPlacement(List par0List, Random par1Random, int par2, int par3, int par4, int par5, int par6) { ++ StructureBoundingBox var7 = StructureBoundingBox.getComponentToAddBoundingBox(par2, par3, par4, -1, -1, 0, 9, 5, 11, par5); ++ return canStrongholdGoDeeper(var7) && StructureComponent.findIntersecting(par0List, var7) == null ? new ComponentStrongholdPrison(par6, par1Random, var7, par5) : null; ++ } ++ ++ /** ++ * second Part of Structure generating, this for example places Spiderwebs, Mob Spawners, it closes Mineshafts at the ++ * end, it adds Fences... ++ */ ++ public boolean addComponentParts(World par1World, Random par2Random, StructureBoundingBox par3StructureBoundingBox) { ++ if (this.isLiquidInStructureBoundingBox(par1World, par3StructureBoundingBox)) { + return false; + } else { +- this.fillWithRandomizedBlocks(var1, var3, 0, 0, 0, 8, 4, 10, true, var2, StructureStrongholdPieces.getStrongholdStones()); +- this.placeDoor(var1, var2, var3, this.field_143013_d, 1, 1, 0); +- this.fillWithBlocks(var1, var3, 1, 1, 10, 3, 3, 10, 0, 0, false); +- this.fillWithRandomizedBlocks(var1, var3, 4, 1, 1, 4, 3, 1, false, var2, StructureStrongholdPieces.getStrongholdStones()); +- this.fillWithRandomizedBlocks(var1, var3, 4, 1, 3, 4, 3, 3, false, var2, StructureStrongholdPieces.getStrongholdStones()); +- this.fillWithRandomizedBlocks(var1, var3, 4, 1, 7, 4, 3, 7, false, var2, StructureStrongholdPieces.getStrongholdStones()); +- this.fillWithRandomizedBlocks(var1, var3, 4, 1, 9, 4, 3, 9, false, var2, StructureStrongholdPieces.getStrongholdStones()); +- this.fillWithBlocks(var1, var3, 4, 1, 4, 4, 3, 6, Block.fenceIron.blockID, Block.fenceIron.blockID, false); +- this.fillWithBlocks(var1, var3, 5, 1, 5, 7, 3, 5, Block.fenceIron.blockID, Block.fenceIron.blockID, false); +- this.placeBlockAtCurrentPosition(var1, Block.fenceIron.blockID, 0, 4, 3, 2, var3); +- this.placeBlockAtCurrentPosition(var1, Block.fenceIron.blockID, 0, 4, 3, 8, var3); +- this.placeBlockAtCurrentPosition(var1, Block.doorIron.blockID, this.getMetadataWithOffset(Block.doorIron.blockID, 3), 4, 1, 2, var3); +- this.placeBlockAtCurrentPosition(var1, Block.doorIron.blockID, this.getMetadataWithOffset(Block.doorIron.blockID, 3) + 8, 4, 2, 2, var3); +- this.placeBlockAtCurrentPosition(var1, Block.doorIron.blockID, this.getMetadataWithOffset(Block.doorIron.blockID, 3), 4, 1, 8, var3); +- this.placeBlockAtCurrentPosition(var1, Block.doorIron.blockID, this.getMetadataWithOffset(Block.doorIron.blockID, 3) + 8, 4, 2, 8, var3); ++ this.fillWithRandomizedBlocks(par1World, par3StructureBoundingBox, 0, 0, 0, 8, 4, 10, true, par2Random, StructureStrongholdPieces.getStrongholdStones()); ++ this.placeDoor(par1World, par2Random, par3StructureBoundingBox, this.field_143013_d, 1, 1, 0); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 1, 1, 10, 3, 3, 10, 0, 0, false); ++ this.fillWithRandomizedBlocks(par1World, par3StructureBoundingBox, 4, 1, 1, 4, 3, 1, false, par2Random, StructureStrongholdPieces.getStrongholdStones()); ++ this.fillWithRandomizedBlocks(par1World, par3StructureBoundingBox, 4, 1, 3, 4, 3, 3, false, par2Random, StructureStrongholdPieces.getStrongholdStones()); ++ this.fillWithRandomizedBlocks(par1World, par3StructureBoundingBox, 4, 1, 7, 4, 3, 7, false, par2Random, StructureStrongholdPieces.getStrongholdStones()); ++ this.fillWithRandomizedBlocks(par1World, par3StructureBoundingBox, 4, 1, 9, 4, 3, 9, false, par2Random, StructureStrongholdPieces.getStrongholdStones()); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 4, 1, 4, 4, 3, 6, Block.fenceIron.blockID, Block.fenceIron.blockID, false); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 5, 1, 5, 7, 3, 5, Block.fenceIron.blockID, Block.fenceIron.blockID, false); ++ this.placeBlockAtCurrentPosition(par1World, Block.fenceIron.blockID, 0, 4, 3, 2, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.fenceIron.blockID, 0, 4, 3, 8, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.doorIron.blockID, this.getMetadataWithOffset(Block.doorIron.blockID, 3), 4, 1, 2, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.doorIron.blockID, this.getMetadataWithOffset(Block.doorIron.blockID, 3) + 8, 4, 2, 2, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.doorIron.blockID, this.getMetadataWithOffset(Block.doorIron.blockID, 3), 4, 1, 8, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.doorIron.blockID, this.getMetadataWithOffset(Block.doorIron.blockID, 3) + 8, 4, 2, 8, par3StructureBoundingBox); + return true; + } + } diff --git a/patches/net/minecraft/src/ComponentStrongholdRightTurn.java.patch b/patches/net/minecraft/src/ComponentStrongholdRightTurn.java.patch new file mode 100644 index 0000000..199f2fa --- /dev/null +++ b/patches/net/minecraft/src/ComponentStrongholdRightTurn.java.patch @@ -0,0 +1,51 @@ +--- net/minecraft/src/ComponentStrongholdRightTurn.java ++++ net/minecraft/src/ComponentStrongholdRightTurn.java +@@ -4,25 +4,36 @@ + import java.util.Random; + + public class ComponentStrongholdRightTurn extends ComponentStrongholdLeftTurn { +- public void buildComponent(StructureComponent var1, List var2, Random var3) { +- if(this.coordBaseMode != 2 && this.coordBaseMode != 3) { +- this.getNextComponentX((ComponentStrongholdStairs2)var1, var2, var3, 1, 1); ++ public ComponentStrongholdRightTurn(int par1, Random par2Random, StructureBoundingBox par3StructureBoundingBox, int par4) { ++ super(par1, par2Random, par3StructureBoundingBox, par4); ++ } ++ ++ /** ++ * Initiates construction of the Structure Component picked, at the current Location of StructGen ++ */ ++ public void buildComponent(StructureComponent par1StructureComponent, List par2List, Random par3Random) { ++ if (this.coordBaseMode != 2 && this.coordBaseMode != 3) { ++ this.getNextComponentX((ComponentStrongholdStairs2)par1StructureComponent, par2List, par3Random, 1, 1); + } else { +- this.getNextComponentZ((ComponentStrongholdStairs2)var1, var2, var3, 1, 1); ++ this.getNextComponentZ((ComponentStrongholdStairs2)par1StructureComponent, par2List, par3Random, 1, 1); + } +- + } + +- public boolean addComponentParts(World var1, Random var2, StructureBoundingBox var3) { +- if(this.isLiquidInStructureBoundingBox(var1, var3)) { ++ /** ++ * second Part of Structure generating, this for example places Spiderwebs, Mob Spawners, it closes Mineshafts at the ++ * end, it adds Fences... ++ */ ++ public boolean addComponentParts(World par1World, Random par2Random, StructureBoundingBox par3StructureBoundingBox) { ++ if (this.isLiquidInStructureBoundingBox(par1World, par3StructureBoundingBox)) { + return false; + } else { +- this.fillWithRandomizedBlocks(var1, var3, 0, 0, 0, 4, 4, 4, true, var2, StructureStrongholdPieces.getStrongholdStones()); +- this.placeDoor(var1, var2, var3, this.field_143013_d, 1, 1, 0); +- if(this.coordBaseMode != 2 && this.coordBaseMode != 3) { +- this.fillWithBlocks(var1, var3, 0, 1, 1, 0, 3, 3, 0, 0, false); ++ this.fillWithRandomizedBlocks(par1World, par3StructureBoundingBox, 0, 0, 0, 4, 4, 4, true, par2Random, StructureStrongholdPieces.getStrongholdStones()); ++ this.placeDoor(par1World, par2Random, par3StructureBoundingBox, this.field_143013_d, 1, 1, 0); ++ ++ if (this.coordBaseMode != 2 && this.coordBaseMode != 3) { ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 0, 1, 1, 0, 3, 3, 0, 0, false); + } else { +- this.fillWithBlocks(var1, var3, 4, 1, 1, 4, 3, 3, 0, 0, false); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 4, 1, 1, 4, 3, 3, 0, 0, false); + } + + return true; diff --git a/patches/net/minecraft/src/ComponentStrongholdRoomCrossing.java.patch b/patches/net/minecraft/src/ComponentStrongholdRoomCrossing.java.patch new file mode 100644 index 0000000..cac6148 --- /dev/null +++ b/patches/net/minecraft/src/ComponentStrongholdRoomCrossing.java.patch @@ -0,0 +1,262 @@ +--- net/minecraft/src/ComponentStrongholdRoomCrossing.java ++++ net/minecraft/src/ComponentStrongholdRoomCrossing.java +@@ -4,128 +4,142 @@ + import java.util.Random; + + public class ComponentStrongholdRoomCrossing extends ComponentStronghold { +- private static final WeightedRandomChestContent[] strongholdRoomCrossingChestContents = new WeightedRandomChestContent[]{new WeightedRandomChestContent(Item.ingotIron.itemID, 0, 1, 5, 10), new WeightedRandomChestContent(Item.ingotGold.itemID, 0, 1, 3, 5), new WeightedRandomChestContent(Item.redstone.itemID, 0, 4, 9, 5), new WeightedRandomChestContent(Item.coal.itemID, 0, 3, 8, 10), new WeightedRandomChestContent(Item.bread.itemID, 0, 1, 3, 15), new WeightedRandomChestContent(Item.appleRed.itemID, 0, 1, 3, 15), new WeightedRandomChestContent(Item.pickaxeIron.itemID, 0, 1, 1, 1)}; ++ ++ /** ++ * Items that could generate in the chest that is located in Stronghold Room Crossing. ++ */ ++ private static final WeightedRandomChestContent[] strongholdRoomCrossingChestContents = new WeightedRandomChestContent[] {new WeightedRandomChestContent(Item.ingotIron.itemID, 0, 1, 5, 10), new WeightedRandomChestContent(Item.ingotGold.itemID, 0, 1, 3, 5), new WeightedRandomChestContent(Item.redstone.itemID, 0, 4, 9, 5), new WeightedRandomChestContent(Item.coal.itemID, 0, 3, 8, 10), new WeightedRandomChestContent(Item.bread.itemID, 0, 1, 3, 15), new WeightedRandomChestContent(Item.appleRed.itemID, 0, 1, 3, 15), new WeightedRandomChestContent(Item.pickaxeIron.itemID, 0, 1, 1, 1)}; + protected int roomType; + +- public ComponentStrongholdRoomCrossing() { +- } +- +- public ComponentStrongholdRoomCrossing(int var1, Random var2, StructureBoundingBox var3, int var4) { +- super(var1); +- this.coordBaseMode = var4; +- this.field_143013_d = this.getRandomDoor(var2); +- this.boundingBox = var3; +- this.roomType = var2.nextInt(5); +- } +- +- protected void func_143012_a(NBTTagCompound var1) { +- super.func_143012_a(var1); +- var1.setInteger("Type", this.roomType); +- } +- +- protected void func_143011_b(NBTTagCompound var1) { +- super.func_143011_b(var1); +- this.roomType = var1.getInteger("Type"); +- } +- +- public void buildComponent(StructureComponent var1, List var2, Random var3) { +- this.getNextComponentNormal((ComponentStrongholdStairs2)var1, var2, var3, 4, 1); +- this.getNextComponentX((ComponentStrongholdStairs2)var1, var2, var3, 1, 4); +- this.getNextComponentZ((ComponentStrongholdStairs2)var1, var2, var3, 1, 4); +- } +- +- public static ComponentStrongholdRoomCrossing findValidPlacement(List var0, Random var1, int var2, int var3, int var4, int var5, int var6) { +- StructureBoundingBox var7 = StructureBoundingBox.getComponentToAddBoundingBox(var2, var3, var4, -4, -1, 0, 11, 7, 11, var5); +- return canStrongholdGoDeeper(var7) && StructureComponent.findIntersecting(var0, var7) == null ? new ComponentStrongholdRoomCrossing(var6, var1, var7, var5) : null; +- } +- +- public boolean addComponentParts(World var1, Random var2, StructureBoundingBox var3) { +- if(this.isLiquidInStructureBoundingBox(var1, var3)) { ++ public ComponentStrongholdRoomCrossing() {} ++ ++ public ComponentStrongholdRoomCrossing(int par1, Random par2Random, StructureBoundingBox par3StructureBoundingBox, int par4) { ++ super(par1); ++ this.coordBaseMode = par4; ++ this.field_143013_d = this.getRandomDoor(par2Random); ++ this.boundingBox = par3StructureBoundingBox; ++ this.roomType = par2Random.nextInt(5); ++ } ++ ++ protected void func_143012_a(NBTTagCompound par1NBTTagCompound) { ++ super.func_143012_a(par1NBTTagCompound); ++ par1NBTTagCompound.setInteger("Type", this.roomType); ++ } ++ ++ protected void func_143011_b(NBTTagCompound par1NBTTagCompound) { ++ super.func_143011_b(par1NBTTagCompound); ++ this.roomType = par1NBTTagCompound.getInteger("Type"); ++ } ++ ++ /** ++ * Initiates construction of the Structure Component picked, at the current Location of StructGen ++ */ ++ public void buildComponent(StructureComponent par1StructureComponent, List par2List, Random par3Random) { ++ this.getNextComponentNormal((ComponentStrongholdStairs2)par1StructureComponent, par2List, par3Random, 4, 1); ++ this.getNextComponentX((ComponentStrongholdStairs2)par1StructureComponent, par2List, par3Random, 1, 4); ++ this.getNextComponentZ((ComponentStrongholdStairs2)par1StructureComponent, par2List, par3Random, 1, 4); ++ } ++ ++ public static ComponentStrongholdRoomCrossing findValidPlacement(List par0List, Random par1Random, int par2, int par3, int par4, int par5, int par6) { ++ StructureBoundingBox var7 = StructureBoundingBox.getComponentToAddBoundingBox(par2, par3, par4, -4, -1, 0, 11, 7, 11, par5); ++ return canStrongholdGoDeeper(var7) && StructureComponent.findIntersecting(par0List, var7) == null ? new ComponentStrongholdRoomCrossing(par6, par1Random, var7, par5) : null; ++ } ++ ++ /** ++ * second Part of Structure generating, this for example places Spiderwebs, Mob Spawners, it closes Mineshafts at the ++ * end, it adds Fences... ++ */ ++ public boolean addComponentParts(World par1World, Random par2Random, StructureBoundingBox par3StructureBoundingBox) { ++ if (this.isLiquidInStructureBoundingBox(par1World, par3StructureBoundingBox)) { + return false; + } else { +- this.fillWithRandomizedBlocks(var1, var3, 0, 0, 0, 10, 6, 10, true, var2, StructureStrongholdPieces.getStrongholdStones()); +- this.placeDoor(var1, var2, var3, this.field_143013_d, 4, 1, 0); +- this.fillWithBlocks(var1, var3, 4, 1, 10, 6, 3, 10, 0, 0, false); +- this.fillWithBlocks(var1, var3, 0, 1, 4, 0, 3, 6, 0, 0, false); +- this.fillWithBlocks(var1, var3, 10, 1, 4, 10, 3, 6, 0, 0, false); ++ this.fillWithRandomizedBlocks(par1World, par3StructureBoundingBox, 0, 0, 0, 10, 6, 10, true, par2Random, StructureStrongholdPieces.getStrongholdStones()); ++ this.placeDoor(par1World, par2Random, par3StructureBoundingBox, this.field_143013_d, 4, 1, 0); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 4, 1, 10, 6, 3, 10, 0, 0, false); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 0, 1, 4, 0, 3, 6, 0, 0, false); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 10, 1, 4, 10, 3, 6, 0, 0, false); + int var4; +- switch(this.roomType) { +- case 0: +- this.placeBlockAtCurrentPosition(var1, Block.stoneBrick.blockID, 0, 5, 1, 5, var3); +- this.placeBlockAtCurrentPosition(var1, Block.stoneBrick.blockID, 0, 5, 2, 5, var3); +- this.placeBlockAtCurrentPosition(var1, Block.stoneBrick.blockID, 0, 5, 3, 5, var3); +- this.placeBlockAtCurrentPosition(var1, Block.torchWood.blockID, 0, 4, 3, 5, var3); +- this.placeBlockAtCurrentPosition(var1, Block.torchWood.blockID, 0, 6, 3, 5, var3); +- this.placeBlockAtCurrentPosition(var1, Block.torchWood.blockID, 0, 5, 3, 4, var3); +- this.placeBlockAtCurrentPosition(var1, Block.torchWood.blockID, 0, 5, 3, 6, var3); +- this.placeBlockAtCurrentPosition(var1, Block.stoneSingleSlab.blockID, 0, 4, 1, 4, var3); +- this.placeBlockAtCurrentPosition(var1, Block.stoneSingleSlab.blockID, 0, 4, 1, 5, var3); +- this.placeBlockAtCurrentPosition(var1, Block.stoneSingleSlab.blockID, 0, 4, 1, 6, var3); +- this.placeBlockAtCurrentPosition(var1, Block.stoneSingleSlab.blockID, 0, 6, 1, 4, var3); +- this.placeBlockAtCurrentPosition(var1, Block.stoneSingleSlab.blockID, 0, 6, 1, 5, var3); +- this.placeBlockAtCurrentPosition(var1, Block.stoneSingleSlab.blockID, 0, 6, 1, 6, var3); +- this.placeBlockAtCurrentPosition(var1, Block.stoneSingleSlab.blockID, 0, 5, 1, 4, var3); +- this.placeBlockAtCurrentPosition(var1, Block.stoneSingleSlab.blockID, 0, 5, 1, 6, var3); +- break; +- case 1: +- for(var4 = 0; var4 < 5; ++var4) { +- this.placeBlockAtCurrentPosition(var1, Block.stoneBrick.blockID, 0, 3, 1, 3 + var4, var3); +- this.placeBlockAtCurrentPosition(var1, Block.stoneBrick.blockID, 0, 7, 1, 3 + var4, var3); +- this.placeBlockAtCurrentPosition(var1, Block.stoneBrick.blockID, 0, 3 + var4, 1, 3, var3); +- this.placeBlockAtCurrentPosition(var1, Block.stoneBrick.blockID, 0, 3 + var4, 1, 7, var3); +- } +- +- this.placeBlockAtCurrentPosition(var1, Block.stoneBrick.blockID, 0, 5, 1, 5, var3); +- this.placeBlockAtCurrentPosition(var1, Block.stoneBrick.blockID, 0, 5, 2, 5, var3); +- this.placeBlockAtCurrentPosition(var1, Block.stoneBrick.blockID, 0, 5, 3, 5, var3); +- this.placeBlockAtCurrentPosition(var1, Block.waterMoving.blockID, 0, 5, 4, 5, var3); +- break; +- case 2: +- for(var4 = 1; var4 <= 9; ++var4) { +- this.placeBlockAtCurrentPosition(var1, Block.cobblestone.blockID, 0, 1, 3, var4, var3); +- this.placeBlockAtCurrentPosition(var1, Block.cobblestone.blockID, 0, 9, 3, var4, var3); +- } +- +- for(var4 = 1; var4 <= 9; ++var4) { +- this.placeBlockAtCurrentPosition(var1, Block.cobblestone.blockID, 0, var4, 3, 1, var3); +- this.placeBlockAtCurrentPosition(var1, Block.cobblestone.blockID, 0, var4, 3, 9, var3); +- } +- +- this.placeBlockAtCurrentPosition(var1, Block.cobblestone.blockID, 0, 5, 1, 4, var3); +- this.placeBlockAtCurrentPosition(var1, Block.cobblestone.blockID, 0, 5, 1, 6, var3); +- this.placeBlockAtCurrentPosition(var1, Block.cobblestone.blockID, 0, 5, 3, 4, var3); +- this.placeBlockAtCurrentPosition(var1, Block.cobblestone.blockID, 0, 5, 3, 6, var3); +- this.placeBlockAtCurrentPosition(var1, Block.cobblestone.blockID, 0, 4, 1, 5, var3); +- this.placeBlockAtCurrentPosition(var1, Block.cobblestone.blockID, 0, 6, 1, 5, var3); +- this.placeBlockAtCurrentPosition(var1, Block.cobblestone.blockID, 0, 4, 3, 5, var3); +- this.placeBlockAtCurrentPosition(var1, Block.cobblestone.blockID, 0, 6, 3, 5, var3); +- +- for(var4 = 1; var4 <= 3; ++var4) { +- this.placeBlockAtCurrentPosition(var1, Block.cobblestone.blockID, 0, 4, var4, 4, var3); +- this.placeBlockAtCurrentPosition(var1, Block.cobblestone.blockID, 0, 6, var4, 4, var3); +- this.placeBlockAtCurrentPosition(var1, Block.cobblestone.blockID, 0, 4, var4, 6, var3); +- this.placeBlockAtCurrentPosition(var1, Block.cobblestone.blockID, 0, 6, var4, 6, var3); +- } +- +- this.placeBlockAtCurrentPosition(var1, Block.torchWood.blockID, 0, 5, 3, 5, var3); +- +- for(var4 = 2; var4 <= 8; ++var4) { +- this.placeBlockAtCurrentPosition(var1, Block.planks.blockID, 0, 2, 3, var4, var3); +- this.placeBlockAtCurrentPosition(var1, Block.planks.blockID, 0, 3, 3, var4, var3); +- if(var4 <= 3 || var4 >= 7) { +- this.placeBlockAtCurrentPosition(var1, Block.planks.blockID, 0, 4, 3, var4, var3); +- this.placeBlockAtCurrentPosition(var1, Block.planks.blockID, 0, 5, 3, var4, var3); +- this.placeBlockAtCurrentPosition(var1, Block.planks.blockID, 0, 6, 3, var4, var3); +- } +- +- this.placeBlockAtCurrentPosition(var1, Block.planks.blockID, 0, 7, 3, var4, var3); +- this.placeBlockAtCurrentPosition(var1, Block.planks.blockID, 0, 8, 3, var4, var3); +- } +- +- this.placeBlockAtCurrentPosition(var1, Block.ladder.blockID, this.getMetadataWithOffset(Block.ladder.blockID, 4), 9, 1, 3, var3); +- this.placeBlockAtCurrentPosition(var1, Block.ladder.blockID, this.getMetadataWithOffset(Block.ladder.blockID, 4), 9, 2, 3, var3); +- this.placeBlockAtCurrentPosition(var1, Block.ladder.blockID, this.getMetadataWithOffset(Block.ladder.blockID, 4), 9, 3, 3, var3); +- this.generateStructureChestContents(var1, var3, var2, 3, 4, 8, WeightedRandomChestContent.func_92080_a(strongholdRoomCrossingChestContents, new WeightedRandomChestContent[]{Item.enchantedBook.func_92114_b(var2)}), 1 + var2.nextInt(4)); ++ ++ switch (this.roomType) { ++ case 0: ++ this.placeBlockAtCurrentPosition(par1World, Block.stoneBrick.blockID, 0, 5, 1, 5, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.stoneBrick.blockID, 0, 5, 2, 5, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.stoneBrick.blockID, 0, 5, 3, 5, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.torchWood.blockID, 0, 4, 3, 5, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.torchWood.blockID, 0, 6, 3, 5, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.torchWood.blockID, 0, 5, 3, 4, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.torchWood.blockID, 0, 5, 3, 6, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.stoneSingleSlab.blockID, 0, 4, 1, 4, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.stoneSingleSlab.blockID, 0, 4, 1, 5, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.stoneSingleSlab.blockID, 0, 4, 1, 6, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.stoneSingleSlab.blockID, 0, 6, 1, 4, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.stoneSingleSlab.blockID, 0, 6, 1, 5, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.stoneSingleSlab.blockID, 0, 6, 1, 6, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.stoneSingleSlab.blockID, 0, 5, 1, 4, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.stoneSingleSlab.blockID, 0, 5, 1, 6, par3StructureBoundingBox); ++ break; ++ ++ case 1: ++ for (var4 = 0; var4 < 5; ++var4) { ++ this.placeBlockAtCurrentPosition(par1World, Block.stoneBrick.blockID, 0, 3, 1, 3 + var4, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.stoneBrick.blockID, 0, 7, 1, 3 + var4, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.stoneBrick.blockID, 0, 3 + var4, 1, 3, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.stoneBrick.blockID, 0, 3 + var4, 1, 7, par3StructureBoundingBox); ++ } ++ ++ this.placeBlockAtCurrentPosition(par1World, Block.stoneBrick.blockID, 0, 5, 1, 5, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.stoneBrick.blockID, 0, 5, 2, 5, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.stoneBrick.blockID, 0, 5, 3, 5, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.waterMoving.blockID, 0, 5, 4, 5, par3StructureBoundingBox); ++ break; ++ ++ case 2: ++ for (var4 = 1; var4 <= 9; ++var4) { ++ this.placeBlockAtCurrentPosition(par1World, Block.cobblestone.blockID, 0, 1, 3, var4, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.cobblestone.blockID, 0, 9, 3, var4, par3StructureBoundingBox); ++ } ++ ++ for (var4 = 1; var4 <= 9; ++var4) { ++ this.placeBlockAtCurrentPosition(par1World, Block.cobblestone.blockID, 0, var4, 3, 1, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.cobblestone.blockID, 0, var4, 3, 9, par3StructureBoundingBox); ++ } ++ ++ this.placeBlockAtCurrentPosition(par1World, Block.cobblestone.blockID, 0, 5, 1, 4, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.cobblestone.blockID, 0, 5, 1, 6, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.cobblestone.blockID, 0, 5, 3, 4, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.cobblestone.blockID, 0, 5, 3, 6, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.cobblestone.blockID, 0, 4, 1, 5, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.cobblestone.blockID, 0, 6, 1, 5, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.cobblestone.blockID, 0, 4, 3, 5, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.cobblestone.blockID, 0, 6, 3, 5, par3StructureBoundingBox); ++ ++ for (var4 = 1; var4 <= 3; ++var4) { ++ this.placeBlockAtCurrentPosition(par1World, Block.cobblestone.blockID, 0, 4, var4, 4, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.cobblestone.blockID, 0, 6, var4, 4, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.cobblestone.blockID, 0, 4, var4, 6, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.cobblestone.blockID, 0, 6, var4, 6, par3StructureBoundingBox); ++ } ++ ++ this.placeBlockAtCurrentPosition(par1World, Block.torchWood.blockID, 0, 5, 3, 5, par3StructureBoundingBox); ++ ++ for (var4 = 2; var4 <= 8; ++var4) { ++ this.placeBlockAtCurrentPosition(par1World, Block.planks.blockID, 0, 2, 3, var4, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.planks.blockID, 0, 3, 3, var4, par3StructureBoundingBox); ++ ++ if (var4 <= 3 || var4 >= 7) { ++ this.placeBlockAtCurrentPosition(par1World, Block.planks.blockID, 0, 4, 3, var4, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.planks.blockID, 0, 5, 3, var4, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.planks.blockID, 0, 6, 3, var4, par3StructureBoundingBox); ++ } ++ ++ this.placeBlockAtCurrentPosition(par1World, Block.planks.blockID, 0, 7, 3, var4, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.planks.blockID, 0, 8, 3, var4, par3StructureBoundingBox); ++ } ++ ++ this.placeBlockAtCurrentPosition(par1World, Block.ladder.blockID, this.getMetadataWithOffset(Block.ladder.blockID, 4), 9, 1, 3, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.ladder.blockID, this.getMetadataWithOffset(Block.ladder.blockID, 4), 9, 2, 3, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.ladder.blockID, this.getMetadataWithOffset(Block.ladder.blockID, 4), 9, 3, 3, par3StructureBoundingBox); ++ this.generateStructureChestContents(par1World, par3StructureBoundingBox, par2Random, 3, 4, 8, WeightedRandomChestContent.func_92080_a(strongholdRoomCrossingChestContents, new WeightedRandomChestContent[] {Item.enchantedBook.func_92114_b(par2Random)}), 1 + par2Random.nextInt(4)); + } + + return true; diff --git a/patches/net/minecraft/src/ComponentStrongholdStairs.java.patch b/patches/net/minecraft/src/ComponentStrongholdStairs.java.patch new file mode 100644 index 0000000..ffbc544 --- /dev/null +++ b/patches/net/minecraft/src/ComponentStrongholdStairs.java.patch @@ -0,0 +1,155 @@ +--- net/minecraft/src/ComponentStrongholdStairs.java ++++ net/minecraft/src/ComponentStrongholdStairs.java +@@ -6,80 +6,90 @@ + public class ComponentStrongholdStairs extends ComponentStronghold { + private boolean field_75024_a; + +- public ComponentStrongholdStairs() { +- } ++ public ComponentStrongholdStairs() {} + +- public ComponentStrongholdStairs(int var1, Random var2, int var3, int var4) { +- super(var1); ++ public ComponentStrongholdStairs(int par1, Random par2Random, int par3, int par4) { ++ super(par1); + this.field_75024_a = true; +- this.coordBaseMode = var2.nextInt(4); ++ this.coordBaseMode = par2Random.nextInt(4); + this.field_143013_d = EnumDoor.OPENING; +- switch(this.coordBaseMode) { +- case 0: +- case 2: +- this.boundingBox = new StructureBoundingBox(var3, 64, var4, var3 + 5 - 1, 74, var4 + 5 - 1); +- break; +- default: +- this.boundingBox = new StructureBoundingBox(var3, 64, var4, var3 + 5 - 1, 74, var4 + 5 - 1); ++ ++ switch (this.coordBaseMode) { ++ case 0: ++ case 2: ++ this.boundingBox = new StructureBoundingBox(par3, 64, par4, par3 + 5 - 1, 74, par4 + 5 - 1); ++ break; ++ ++ default: ++ this.boundingBox = new StructureBoundingBox(par3, 64, par4, par3 + 5 - 1, 74, par4 + 5 - 1); + } +- + } + +- public ComponentStrongholdStairs(int var1, Random var2, StructureBoundingBox var3, int var4) { +- super(var1); ++ public ComponentStrongholdStairs(int par1, Random par2Random, StructureBoundingBox par3StructureBoundingBox, int par4) { ++ super(par1); + this.field_75024_a = false; +- this.coordBaseMode = var4; +- this.field_143013_d = this.getRandomDoor(var2); +- this.boundingBox = var3; +- } +- +- protected void func_143012_a(NBTTagCompound var1) { +- super.func_143012_a(var1); +- var1.setBoolean("Source", this.field_75024_a); +- } +- +- protected void func_143011_b(NBTTagCompound var1) { +- super.func_143011_b(var1); +- this.field_75024_a = var1.getBoolean("Source"); +- } +- +- public void buildComponent(StructureComponent var1, List var2, Random var3) { +- if(this.field_75024_a) { ++ this.coordBaseMode = par4; ++ this.field_143013_d = this.getRandomDoor(par2Random); ++ this.boundingBox = par3StructureBoundingBox; ++ } ++ ++ protected void func_143012_a(NBTTagCompound par1NBTTagCompound) { ++ super.func_143012_a(par1NBTTagCompound); ++ par1NBTTagCompound.setBoolean("Source", this.field_75024_a); ++ } ++ ++ protected void func_143011_b(NBTTagCompound par1NBTTagCompound) { ++ super.func_143011_b(par1NBTTagCompound); ++ this.field_75024_a = par1NBTTagCompound.getBoolean("Source"); ++ } ++ ++ /** ++ * Initiates construction of the Structure Component picked, at the current Location of StructGen ++ */ ++ public void buildComponent(StructureComponent par1StructureComponent, List par2List, Random par3Random) { ++ if (this.field_75024_a) { + StructureStrongholdPieces.setComponentType(ComponentStrongholdCrossing.class); + } + +- this.getNextComponentNormal((ComponentStrongholdStairs2)var1, var2, var3, 1, 1); +- } +- +- public static ComponentStrongholdStairs getStrongholdStairsComponent(List var0, Random var1, int var2, int var3, int var4, int var5, int var6) { +- StructureBoundingBox var7 = StructureBoundingBox.getComponentToAddBoundingBox(var2, var3, var4, -1, -7, 0, 5, 11, 5, var5); +- return canStrongholdGoDeeper(var7) && StructureComponent.findIntersecting(var0, var7) == null ? new ComponentStrongholdStairs(var6, var1, var7, var5) : null; +- } +- +- public boolean addComponentParts(World var1, Random var2, StructureBoundingBox var3) { +- if(this.isLiquidInStructureBoundingBox(var1, var3)) { ++ this.getNextComponentNormal((ComponentStrongholdStairs2)par1StructureComponent, par2List, par3Random, 1, 1); ++ } ++ ++ /** ++ * performs some checks, then gives out a fresh Stairs component ++ */ ++ public static ComponentStrongholdStairs getStrongholdStairsComponent(List par0List, Random par1Random, int par2, int par3, int par4, int par5, int par6) { ++ StructureBoundingBox var7 = StructureBoundingBox.getComponentToAddBoundingBox(par2, par3, par4, -1, -7, 0, 5, 11, 5, par5); ++ return canStrongholdGoDeeper(var7) && StructureComponent.findIntersecting(par0List, var7) == null ? new ComponentStrongholdStairs(par6, par1Random, var7, par5) : null; ++ } ++ ++ /** ++ * second Part of Structure generating, this for example places Spiderwebs, Mob Spawners, it closes Mineshafts at the ++ * end, it adds Fences... ++ */ ++ public boolean addComponentParts(World par1World, Random par2Random, StructureBoundingBox par3StructureBoundingBox) { ++ if (this.isLiquidInStructureBoundingBox(par1World, par3StructureBoundingBox)) { + return false; + } else { +- this.fillWithRandomizedBlocks(var1, var3, 0, 0, 0, 4, 10, 4, true, var2, StructureStrongholdPieces.getStrongholdStones()); +- this.placeDoor(var1, var2, var3, this.field_143013_d, 1, 7, 0); +- this.placeDoor(var1, var2, var3, EnumDoor.OPENING, 1, 1, 4); +- this.placeBlockAtCurrentPosition(var1, Block.stoneBrick.blockID, 0, 2, 6, 1, var3); +- this.placeBlockAtCurrentPosition(var1, Block.stoneBrick.blockID, 0, 1, 5, 1, var3); +- this.placeBlockAtCurrentPosition(var1, Block.stoneSingleSlab.blockID, 0, 1, 6, 1, var3); +- this.placeBlockAtCurrentPosition(var1, Block.stoneBrick.blockID, 0, 1, 5, 2, var3); +- this.placeBlockAtCurrentPosition(var1, Block.stoneBrick.blockID, 0, 1, 4, 3, var3); +- this.placeBlockAtCurrentPosition(var1, Block.stoneSingleSlab.blockID, 0, 1, 5, 3, var3); +- this.placeBlockAtCurrentPosition(var1, Block.stoneBrick.blockID, 0, 2, 4, 3, var3); +- this.placeBlockAtCurrentPosition(var1, Block.stoneBrick.blockID, 0, 3, 3, 3, var3); +- this.placeBlockAtCurrentPosition(var1, Block.stoneSingleSlab.blockID, 0, 3, 4, 3, var3); +- this.placeBlockAtCurrentPosition(var1, Block.stoneBrick.blockID, 0, 3, 3, 2, var3); +- this.placeBlockAtCurrentPosition(var1, Block.stoneBrick.blockID, 0, 3, 2, 1, var3); +- this.placeBlockAtCurrentPosition(var1, Block.stoneSingleSlab.blockID, 0, 3, 3, 1, var3); +- this.placeBlockAtCurrentPosition(var1, Block.stoneBrick.blockID, 0, 2, 2, 1, var3); +- this.placeBlockAtCurrentPosition(var1, Block.stoneBrick.blockID, 0, 1, 1, 1, var3); +- this.placeBlockAtCurrentPosition(var1, Block.stoneSingleSlab.blockID, 0, 1, 2, 1, var3); +- this.placeBlockAtCurrentPosition(var1, Block.stoneBrick.blockID, 0, 1, 1, 2, var3); +- this.placeBlockAtCurrentPosition(var1, Block.stoneSingleSlab.blockID, 0, 1, 1, 3, var3); ++ this.fillWithRandomizedBlocks(par1World, par3StructureBoundingBox, 0, 0, 0, 4, 10, 4, true, par2Random, StructureStrongholdPieces.getStrongholdStones()); ++ this.placeDoor(par1World, par2Random, par3StructureBoundingBox, this.field_143013_d, 1, 7, 0); ++ this.placeDoor(par1World, par2Random, par3StructureBoundingBox, EnumDoor.OPENING, 1, 1, 4); ++ this.placeBlockAtCurrentPosition(par1World, Block.stoneBrick.blockID, 0, 2, 6, 1, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.stoneBrick.blockID, 0, 1, 5, 1, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.stoneSingleSlab.blockID, 0, 1, 6, 1, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.stoneBrick.blockID, 0, 1, 5, 2, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.stoneBrick.blockID, 0, 1, 4, 3, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.stoneSingleSlab.blockID, 0, 1, 5, 3, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.stoneBrick.blockID, 0, 2, 4, 3, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.stoneBrick.blockID, 0, 3, 3, 3, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.stoneSingleSlab.blockID, 0, 3, 4, 3, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.stoneBrick.blockID, 0, 3, 3, 2, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.stoneBrick.blockID, 0, 3, 2, 1, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.stoneSingleSlab.blockID, 0, 3, 3, 1, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.stoneBrick.blockID, 0, 2, 2, 1, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.stoneBrick.blockID, 0, 1, 1, 1, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.stoneSingleSlab.blockID, 0, 1, 2, 1, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.stoneBrick.blockID, 0, 1, 1, 2, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.stoneSingleSlab.blockID, 0, 1, 1, 3, par3StructureBoundingBox); + return true; + } + } diff --git a/patches/net/minecraft/src/ComponentStrongholdStairs2.java.patch b/patches/net/minecraft/src/ComponentStrongholdStairs2.java.patch new file mode 100644 index 0000000..cdf7089 --- /dev/null +++ b/patches/net/minecraft/src/ComponentStrongholdStairs2.java.patch @@ -0,0 +1,22 @@ +--- net/minecraft/src/ComponentStrongholdStairs2.java ++++ net/minecraft/src/ComponentStrongholdStairs2.java +@@ -7,13 +7,12 @@ + public class ComponentStrongholdStairs2 extends ComponentStrongholdStairs { + public StructureStrongholdPieceWeight strongholdPieceWeight; + public ComponentStrongholdPortalRoom strongholdPortalRoom; +- public List c = new ArrayList(); +- +- public ComponentStrongholdStairs2() { +- } +- +- public ComponentStrongholdStairs2(int var1, Random var2, int var3, int var4) { +- super(0, var2, var3, var4); ++ public List field_75026_c = new ArrayList(); ++ ++ public ComponentStrongholdStairs2() {} ++ ++ public ComponentStrongholdStairs2(int par1, Random par2Random, int par3, int par4) { ++ super(0, par2Random, par3, par4); + } + + public ChunkPosition getCenter() { diff --git a/patches/net/minecraft/src/ComponentStrongholdStairsStraight.java.patch b/patches/net/minecraft/src/ComponentStrongholdStairsStraight.java.patch new file mode 100644 index 0000000..7a1cd47 --- /dev/null +++ b/patches/net/minecraft/src/ComponentStrongholdStairsStraight.java.patch @@ -0,0 +1,84 @@ +--- net/minecraft/src/ComponentStrongholdStairsStraight.java ++++ net/minecraft/src/ComponentStrongholdStairsStraight.java +@@ -4,42 +4,49 @@ + import java.util.Random; + + public class ComponentStrongholdStairsStraight extends ComponentStronghold { +- public ComponentStrongholdStairsStraight() { +- } +- +- public ComponentStrongholdStairsStraight(int var1, Random var2, StructureBoundingBox var3, int var4) { +- super(var1); +- this.coordBaseMode = var4; +- this.field_143013_d = this.getRandomDoor(var2); +- this.boundingBox = var3; +- } +- +- public void buildComponent(StructureComponent var1, List var2, Random var3) { +- this.getNextComponentNormal((ComponentStrongholdStairs2)var1, var2, var3, 1, 1); +- } +- +- public static ComponentStrongholdStairsStraight findValidPlacement(List var0, Random var1, int var2, int var3, int var4, int var5, int var6) { +- StructureBoundingBox var7 = StructureBoundingBox.getComponentToAddBoundingBox(var2, var3, var4, -1, -7, 0, 5, 11, 8, var5); +- return canStrongholdGoDeeper(var7) && StructureComponent.findIntersecting(var0, var7) == null ? new ComponentStrongholdStairsStraight(var6, var1, var7, var5) : null; +- } +- +- public boolean addComponentParts(World var1, Random var2, StructureBoundingBox var3) { +- if(this.isLiquidInStructureBoundingBox(var1, var3)) { ++ public ComponentStrongholdStairsStraight() {} ++ ++ public ComponentStrongholdStairsStraight(int par1, Random par2Random, StructureBoundingBox par3StructureBoundingBox, int par4) { ++ super(par1); ++ this.coordBaseMode = par4; ++ this.field_143013_d = this.getRandomDoor(par2Random); ++ this.boundingBox = par3StructureBoundingBox; ++ } ++ ++ /** ++ * Initiates construction of the Structure Component picked, at the current Location of StructGen ++ */ ++ public void buildComponent(StructureComponent par1StructureComponent, List par2List, Random par3Random) { ++ this.getNextComponentNormal((ComponentStrongholdStairs2)par1StructureComponent, par2List, par3Random, 1, 1); ++ } ++ ++ public static ComponentStrongholdStairsStraight findValidPlacement(List par0List, Random par1Random, int par2, int par3, int par4, int par5, int par6) { ++ StructureBoundingBox var7 = StructureBoundingBox.getComponentToAddBoundingBox(par2, par3, par4, -1, -7, 0, 5, 11, 8, par5); ++ return canStrongholdGoDeeper(var7) && StructureComponent.findIntersecting(par0List, var7) == null ? new ComponentStrongholdStairsStraight(par6, par1Random, var7, par5) : null; ++ } ++ ++ /** ++ * second Part of Structure generating, this for example places Spiderwebs, Mob Spawners, it closes Mineshafts at the ++ * end, it adds Fences... ++ */ ++ public boolean addComponentParts(World par1World, Random par2Random, StructureBoundingBox par3StructureBoundingBox) { ++ if (this.isLiquidInStructureBoundingBox(par1World, par3StructureBoundingBox)) { + return false; + } else { +- this.fillWithRandomizedBlocks(var1, var3, 0, 0, 0, 4, 10, 7, true, var2, StructureStrongholdPieces.getStrongholdStones()); +- this.placeDoor(var1, var2, var3, this.field_143013_d, 1, 7, 0); +- this.placeDoor(var1, var2, var3, EnumDoor.OPENING, 1, 1, 7); ++ this.fillWithRandomizedBlocks(par1World, par3StructureBoundingBox, 0, 0, 0, 4, 10, 7, true, par2Random, StructureStrongholdPieces.getStrongholdStones()); ++ this.placeDoor(par1World, par2Random, par3StructureBoundingBox, this.field_143013_d, 1, 7, 0); ++ this.placeDoor(par1World, par2Random, par3StructureBoundingBox, EnumDoor.OPENING, 1, 1, 7); + int var4 = this.getMetadataWithOffset(Block.stairsCobblestone.blockID, 2); + +- for(int var5 = 0; var5 < 6; ++var5) { +- this.placeBlockAtCurrentPosition(var1, Block.stairsCobblestone.blockID, var4, 1, 6 - var5, 1 + var5, var3); +- this.placeBlockAtCurrentPosition(var1, Block.stairsCobblestone.blockID, var4, 2, 6 - var5, 1 + var5, var3); +- this.placeBlockAtCurrentPosition(var1, Block.stairsCobblestone.blockID, var4, 3, 6 - var5, 1 + var5, var3); +- if(var5 < 5) { +- this.placeBlockAtCurrentPosition(var1, Block.stoneBrick.blockID, 0, 1, 5 - var5, 1 + var5, var3); +- this.placeBlockAtCurrentPosition(var1, Block.stoneBrick.blockID, 0, 2, 5 - var5, 1 + var5, var3); +- this.placeBlockAtCurrentPosition(var1, Block.stoneBrick.blockID, 0, 3, 5 - var5, 1 + var5, var3); ++ for (int var5 = 0; var5 < 6; ++var5) { ++ this.placeBlockAtCurrentPosition(par1World, Block.stairsCobblestone.blockID, var4, 1, 6 - var5, 1 + var5, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.stairsCobblestone.blockID, var4, 2, 6 - var5, 1 + var5, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.stairsCobblestone.blockID, var4, 3, 6 - var5, 1 + var5, par3StructureBoundingBox); ++ ++ if (var5 < 5) { ++ this.placeBlockAtCurrentPosition(par1World, Block.stoneBrick.blockID, 0, 1, 5 - var5, 1 + var5, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.stoneBrick.blockID, 0, 2, 5 - var5, 1 + var5, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.stoneBrick.blockID, 0, 3, 5 - var5, 1 + var5, par3StructureBoundingBox); + } + } + diff --git a/patches/net/minecraft/src/ComponentStrongholdStraight.java.patch b/patches/net/minecraft/src/ComponentStrongholdStraight.java.patch new file mode 100644 index 0000000..937e27b --- /dev/null +++ b/patches/net/minecraft/src/ComponentStrongholdStraight.java.patch @@ -0,0 +1,128 @@ +--- net/minecraft/src/ComponentStrongholdStraight.java ++++ net/minecraft/src/ComponentStrongholdStraight.java +@@ -7,64 +7,71 @@ + private boolean expandsX; + private boolean expandsZ; + +- public ComponentStrongholdStraight() { +- } +- +- public ComponentStrongholdStraight(int var1, Random var2, StructureBoundingBox var3, int var4) { +- super(var1); +- this.coordBaseMode = var4; +- this.field_143013_d = this.getRandomDoor(var2); +- this.boundingBox = var3; +- this.expandsX = var2.nextInt(2) == 0; +- this.expandsZ = var2.nextInt(2) == 0; +- } +- +- protected void func_143012_a(NBTTagCompound var1) { +- super.func_143012_a(var1); +- var1.setBoolean("Left", this.expandsX); +- var1.setBoolean("Right", this.expandsZ); +- } +- +- protected void func_143011_b(NBTTagCompound var1) { +- super.func_143011_b(var1); +- this.expandsX = var1.getBoolean("Left"); +- this.expandsZ = var1.getBoolean("Right"); +- } +- +- public void buildComponent(StructureComponent var1, List var2, Random var3) { +- this.getNextComponentNormal((ComponentStrongholdStairs2)var1, var2, var3, 1, 1); +- if(this.expandsX) { +- this.getNextComponentX((ComponentStrongholdStairs2)var1, var2, var3, 1, 2); +- } +- +- if(this.expandsZ) { +- this.getNextComponentZ((ComponentStrongholdStairs2)var1, var2, var3, 1, 2); +- } +- +- } +- +- public static ComponentStrongholdStraight findValidPlacement(List var0, Random var1, int var2, int var3, int var4, int var5, int var6) { +- StructureBoundingBox var7 = StructureBoundingBox.getComponentToAddBoundingBox(var2, var3, var4, -1, -1, 0, 5, 5, 7, var5); +- return canStrongholdGoDeeper(var7) && StructureComponent.findIntersecting(var0, var7) == null ? new ComponentStrongholdStraight(var6, var1, var7, var5) : null; +- } +- +- public boolean addComponentParts(World var1, Random var2, StructureBoundingBox var3) { +- if(this.isLiquidInStructureBoundingBox(var1, var3)) { ++ public ComponentStrongholdStraight() {} ++ ++ public ComponentStrongholdStraight(int par1, Random par2Random, StructureBoundingBox par3StructureBoundingBox, int par4) { ++ super(par1); ++ this.coordBaseMode = par4; ++ this.field_143013_d = this.getRandomDoor(par2Random); ++ this.boundingBox = par3StructureBoundingBox; ++ this.expandsX = par2Random.nextInt(2) == 0; ++ this.expandsZ = par2Random.nextInt(2) == 0; ++ } ++ ++ protected void func_143012_a(NBTTagCompound par1NBTTagCompound) { ++ super.func_143012_a(par1NBTTagCompound); ++ par1NBTTagCompound.setBoolean("Left", this.expandsX); ++ par1NBTTagCompound.setBoolean("Right", this.expandsZ); ++ } ++ ++ protected void func_143011_b(NBTTagCompound par1NBTTagCompound) { ++ super.func_143011_b(par1NBTTagCompound); ++ this.expandsX = par1NBTTagCompound.getBoolean("Left"); ++ this.expandsZ = par1NBTTagCompound.getBoolean("Right"); ++ } ++ ++ /** ++ * Initiates construction of the Structure Component picked, at the current Location of StructGen ++ */ ++ public void buildComponent(StructureComponent par1StructureComponent, List par2List, Random par3Random) { ++ this.getNextComponentNormal((ComponentStrongholdStairs2)par1StructureComponent, par2List, par3Random, 1, 1); ++ ++ if (this.expandsX) { ++ this.getNextComponentX((ComponentStrongholdStairs2)par1StructureComponent, par2List, par3Random, 1, 2); ++ } ++ ++ if (this.expandsZ) { ++ this.getNextComponentZ((ComponentStrongholdStairs2)par1StructureComponent, par2List, par3Random, 1, 2); ++ } ++ } ++ ++ public static ComponentStrongholdStraight findValidPlacement(List par0List, Random par1Random, int par2, int par3, int par4, int par5, int par6) { ++ StructureBoundingBox var7 = StructureBoundingBox.getComponentToAddBoundingBox(par2, par3, par4, -1, -1, 0, 5, 5, 7, par5); ++ return canStrongholdGoDeeper(var7) && StructureComponent.findIntersecting(par0List, var7) == null ? new ComponentStrongholdStraight(par6, par1Random, var7, par5) : null; ++ } ++ ++ /** ++ * second Part of Structure generating, this for example places Spiderwebs, Mob Spawners, it closes Mineshafts at the ++ * end, it adds Fences... ++ */ ++ public boolean addComponentParts(World par1World, Random par2Random, StructureBoundingBox par3StructureBoundingBox) { ++ if (this.isLiquidInStructureBoundingBox(par1World, par3StructureBoundingBox)) { + return false; + } else { +- this.fillWithRandomizedBlocks(var1, var3, 0, 0, 0, 4, 4, 6, true, var2, StructureStrongholdPieces.getStrongholdStones()); +- this.placeDoor(var1, var2, var3, this.field_143013_d, 1, 1, 0); +- this.placeDoor(var1, var2, var3, EnumDoor.OPENING, 1, 1, 6); +- this.randomlyPlaceBlock(var1, var3, var2, 0.1F, 1, 2, 1, Block.torchWood.blockID, 0); +- this.randomlyPlaceBlock(var1, var3, var2, 0.1F, 3, 2, 1, Block.torchWood.blockID, 0); +- this.randomlyPlaceBlock(var1, var3, var2, 0.1F, 1, 2, 5, Block.torchWood.blockID, 0); +- this.randomlyPlaceBlock(var1, var3, var2, 0.1F, 3, 2, 5, Block.torchWood.blockID, 0); +- if(this.expandsX) { +- this.fillWithBlocks(var1, var3, 0, 1, 2, 0, 3, 4, 0, 0, false); ++ this.fillWithRandomizedBlocks(par1World, par3StructureBoundingBox, 0, 0, 0, 4, 4, 6, true, par2Random, StructureStrongholdPieces.getStrongholdStones()); ++ this.placeDoor(par1World, par2Random, par3StructureBoundingBox, this.field_143013_d, 1, 1, 0); ++ this.placeDoor(par1World, par2Random, par3StructureBoundingBox, EnumDoor.OPENING, 1, 1, 6); ++ this.randomlyPlaceBlock(par1World, par3StructureBoundingBox, par2Random, 0.1F, 1, 2, 1, Block.torchWood.blockID, 0); ++ this.randomlyPlaceBlock(par1World, par3StructureBoundingBox, par2Random, 0.1F, 3, 2, 1, Block.torchWood.blockID, 0); ++ this.randomlyPlaceBlock(par1World, par3StructureBoundingBox, par2Random, 0.1F, 1, 2, 5, Block.torchWood.blockID, 0); ++ this.randomlyPlaceBlock(par1World, par3StructureBoundingBox, par2Random, 0.1F, 3, 2, 5, Block.torchWood.blockID, 0); ++ ++ if (this.expandsX) { ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 0, 1, 2, 0, 3, 4, 0, 0, false); + } + +- if(this.expandsZ) { +- this.fillWithBlocks(var1, var3, 4, 1, 2, 4, 3, 4, 0, 0, false); ++ if (this.expandsZ) { ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 4, 1, 2, 4, 3, 4, 0, 0, false); + } + + return true; diff --git a/patches/net/minecraft/src/ComponentVillage.java.patch b/patches/net/minecraft/src/ComponentVillage.java.patch new file mode 100644 index 0000000..4956dd8 --- /dev/null +++ b/patches/net/minecraft/src/ComponentVillage.java.patch @@ -0,0 +1,347 @@ +--- net/minecraft/src/ComponentVillage.java ++++ net/minecraft/src/ComponentVillage.java +@@ -5,174 +5,216 @@ + + abstract class ComponentVillage extends StructureComponent { + protected int field_143015_k = -1; ++ ++ /** The number of villagers that have been spawned in this component. */ + private int villagersSpawned; + private boolean field_143014_b; + +- public ComponentVillage() { +- } +- +- protected ComponentVillage(ComponentVillageStartPiece var1, int var2) { +- super(var2); +- if(var1 != null) { +- this.field_143014_b = var1.inDesert; +- } +- +- } +- +- protected void func_143012_a(NBTTagCompound var1) { +- var1.setInteger("HPos", this.field_143015_k); +- var1.setInteger("VCount", this.villagersSpawned); +- var1.setBoolean("Desert", this.field_143014_b); +- } +- +- protected void func_143011_b(NBTTagCompound var1) { +- this.field_143015_k = var1.getInteger("HPos"); +- this.villagersSpawned = var1.getInteger("VCount"); +- this.field_143014_b = var1.getBoolean("Desert"); +- } +- +- protected StructureComponent getNextComponentNN(ComponentVillageStartPiece var1, List var2, Random var3, int var4, int var5) { +- switch(this.coordBaseMode) { +- case 0: +- return StructureVillagePieces.getNextStructureComponent(var1, var2, var3, this.boundingBox.minX - 1, this.boundingBox.minY + var4, this.boundingBox.minZ + var5, 1, this.getComponentType()); +- case 1: +- return StructureVillagePieces.getNextStructureComponent(var1, var2, var3, this.boundingBox.minX + var5, this.boundingBox.minY + var4, this.boundingBox.minZ - 1, 2, this.getComponentType()); +- case 2: +- return StructureVillagePieces.getNextStructureComponent(var1, var2, var3, this.boundingBox.minX - 1, this.boundingBox.minY + var4, this.boundingBox.minZ + var5, 1, this.getComponentType()); +- case 3: +- return StructureVillagePieces.getNextStructureComponent(var1, var2, var3, this.boundingBox.minX + var5, this.boundingBox.minY + var4, this.boundingBox.minZ - 1, 2, this.getComponentType()); +- default: +- return null; +- } +- } +- +- protected StructureComponent getNextComponentPP(ComponentVillageStartPiece var1, List var2, Random var3, int var4, int var5) { +- switch(this.coordBaseMode) { +- case 0: +- return StructureVillagePieces.getNextStructureComponent(var1, var2, var3, this.boundingBox.maxX + 1, this.boundingBox.minY + var4, this.boundingBox.minZ + var5, 3, this.getComponentType()); +- case 1: +- return StructureVillagePieces.getNextStructureComponent(var1, var2, var3, this.boundingBox.minX + var5, this.boundingBox.minY + var4, this.boundingBox.maxZ + 1, 0, this.getComponentType()); +- case 2: +- return StructureVillagePieces.getNextStructureComponent(var1, var2, var3, this.boundingBox.maxX + 1, this.boundingBox.minY + var4, this.boundingBox.minZ + var5, 3, this.getComponentType()); +- case 3: +- return StructureVillagePieces.getNextStructureComponent(var1, var2, var3, this.boundingBox.minX + var5, this.boundingBox.minY + var4, this.boundingBox.maxZ + 1, 0, this.getComponentType()); +- default: +- return null; +- } +- } +- +- protected int getAverageGroundLevel(World var1, StructureBoundingBox var2) { ++ public ComponentVillage() {} ++ ++ protected ComponentVillage(ComponentVillageStartPiece par1ComponentVillageStartPiece, int par2) { ++ super(par2); ++ ++ if (par1ComponentVillageStartPiece != null) { ++ this.field_143014_b = par1ComponentVillageStartPiece.inDesert; ++ } ++ } ++ ++ protected void func_143012_a(NBTTagCompound par1NBTTagCompound) { ++ par1NBTTagCompound.setInteger("HPos", this.field_143015_k); ++ par1NBTTagCompound.setInteger("VCount", this.villagersSpawned); ++ par1NBTTagCompound.setBoolean("Desert", this.field_143014_b); ++ } ++ ++ protected void func_143011_b(NBTTagCompound par1NBTTagCompound) { ++ this.field_143015_k = par1NBTTagCompound.getInteger("HPos"); ++ this.villagersSpawned = par1NBTTagCompound.getInteger("VCount"); ++ this.field_143014_b = par1NBTTagCompound.getBoolean("Desert"); ++ } ++ ++ /** ++ * Gets the next village component, with the bounding box shifted -1 in the X and Z direction. ++ */ ++ protected StructureComponent getNextComponentNN(ComponentVillageStartPiece par1ComponentVillageStartPiece, List par2List, Random par3Random, int par4, int par5) { ++ switch (this.coordBaseMode) { ++ case 0: ++ return StructureVillagePieces.getNextStructureComponent(par1ComponentVillageStartPiece, par2List, par3Random, this.boundingBox.minX - 1, this.boundingBox.minY + par4, this.boundingBox.minZ + par5, 1, this.getComponentType()); ++ ++ case 1: ++ return StructureVillagePieces.getNextStructureComponent(par1ComponentVillageStartPiece, par2List, par3Random, this.boundingBox.minX + par5, this.boundingBox.minY + par4, this.boundingBox.minZ - 1, 2, this.getComponentType()); ++ ++ case 2: ++ return StructureVillagePieces.getNextStructureComponent(par1ComponentVillageStartPiece, par2List, par3Random, this.boundingBox.minX - 1, this.boundingBox.minY + par4, this.boundingBox.minZ + par5, 1, this.getComponentType()); ++ ++ case 3: ++ return StructureVillagePieces.getNextStructureComponent(par1ComponentVillageStartPiece, par2List, par3Random, this.boundingBox.minX + par5, this.boundingBox.minY + par4, this.boundingBox.minZ - 1, 2, this.getComponentType()); ++ ++ default: ++ return null; ++ } ++ } ++ ++ /** ++ * Gets the next village component, with the bounding box shifted +1 in the X and Z direction. ++ */ ++ protected StructureComponent getNextComponentPP(ComponentVillageStartPiece par1ComponentVillageStartPiece, List par2List, Random par3Random, int par4, int par5) { ++ switch (this.coordBaseMode) { ++ case 0: ++ return StructureVillagePieces.getNextStructureComponent(par1ComponentVillageStartPiece, par2List, par3Random, this.boundingBox.maxX + 1, this.boundingBox.minY + par4, this.boundingBox.minZ + par5, 3, this.getComponentType()); ++ ++ case 1: ++ return StructureVillagePieces.getNextStructureComponent(par1ComponentVillageStartPiece, par2List, par3Random, this.boundingBox.minX + par5, this.boundingBox.minY + par4, this.boundingBox.maxZ + 1, 0, this.getComponentType()); ++ ++ case 2: ++ return StructureVillagePieces.getNextStructureComponent(par1ComponentVillageStartPiece, par2List, par3Random, this.boundingBox.maxX + 1, this.boundingBox.minY + par4, this.boundingBox.minZ + par5, 3, this.getComponentType()); ++ ++ case 3: ++ return StructureVillagePieces.getNextStructureComponent(par1ComponentVillageStartPiece, par2List, par3Random, this.boundingBox.minX + par5, this.boundingBox.minY + par4, this.boundingBox.maxZ + 1, 0, this.getComponentType()); ++ ++ default: ++ return null; ++ } ++ } ++ ++ /** ++ * Discover the y coordinate that will serve as the ground level of the supplied BoundingBox. (A median of all the ++ * levels in the BB's horizontal rectangle). ++ */ ++ protected int getAverageGroundLevel(World par1World, StructureBoundingBox par2StructureBoundingBox) { + int var3 = 0; + int var4 = 0; + +- for(int var5 = this.boundingBox.minZ; var5 <= this.boundingBox.maxZ; ++var5) { +- for(int var6 = this.boundingBox.minX; var6 <= this.boundingBox.maxX; ++var6) { +- if(var2.isVecInside(var6, 64, var5)) { +- var3 += Math.max(var1.getTopSolidOrLiquidBlock(var6, var5), var1.provider.getAverageGroundLevel()); ++ for (int var5 = this.boundingBox.minZ; var5 <= this.boundingBox.maxZ; ++var5) { ++ for (int var6 = this.boundingBox.minX; var6 <= this.boundingBox.maxX; ++var6) { ++ if (par2StructureBoundingBox.isVecInside(var6, 64, var5)) { ++ var3 += Math.max(par1World.getTopSolidOrLiquidBlock(var6, var5), par1World.provider.getAverageGroundLevel()); + ++var4; + } + } + } + +- if(var4 == 0) { ++ if (var4 == 0) { + return -1; + } else { + return var3 / var4; + } + } + +- protected static boolean canVillageGoDeeper(StructureBoundingBox var0) { +- return var0 != null && var0.minY > 10; ++ protected static boolean canVillageGoDeeper(StructureBoundingBox par0StructureBoundingBox) { ++ return par0StructureBoundingBox != null && par0StructureBoundingBox.minY > 10; + } + +- protected void spawnVillagers(World var1, StructureBoundingBox var2, int var3, int var4, int var5, int var6) { +- if(this.villagersSpawned < var6) { +- for(int var7 = this.villagersSpawned; var7 < var6; ++var7) { +- int var8 = this.getXWithOffset(var3 + var7, var5); +- int var9 = this.getYWithOffset(var4); +- int var10 = this.getZWithOffset(var3 + var7, var5); +- if(!var2.isVecInside(var8, var9, var10)) { ++ /** ++ * Spawns a number of villagers in this component. Parameters: world, component bounding box, x offset, y offset, z ++ * offset, number of villagers ++ */ ++ protected void spawnVillagers(World par1World, StructureBoundingBox par2StructureBoundingBox, int par3, int par4, int par5, int par6) { ++ if (this.villagersSpawned < par6) { ++ for (int var7 = this.villagersSpawned; var7 < par6; ++var7) { ++ int var8 = this.getXWithOffset(par3 + var7, par5); ++ int var9 = this.getYWithOffset(par4); ++ int var10 = this.getZWithOffset(par3 + var7, par5); ++ ++ if (!par2StructureBoundingBox.isVecInside(var8, var9, var10)) { + break; + } + + ++this.villagersSpawned; +- EntityVillager var11 = new EntityVillager(var1, this.getVillagerType(var7)); ++ EntityVillager var11 = new EntityVillager(par1World, this.getVillagerType(var7)); + var11.setLocationAndAngles((double)var8 + 0.5D, (double)var9, (double)var10 + 0.5D, 0.0F, 0.0F); +- var1.spawnEntityInWorld(var11); ++ par1World.spawnEntityInWorld(var11); + } +- + } + } + +- protected int getVillagerType(int var1) { ++ /** ++ * Returns the villager type to spawn in this component, based on the number of villagers already spawned. ++ */ ++ protected int getVillagerType(int par1) { + return 0; + } + +- protected int getBiomeSpecificBlock(int var1, int var2) { +- if(this.field_143014_b) { +- if(var1 == Block.wood.blockID) { +- return Block.sandStone.blockID; +- } +- +- if(var1 == Block.cobblestone.blockID) { +- return Block.sandStone.blockID; +- } +- +- if(var1 == Block.planks.blockID) { +- return Block.sandStone.blockID; +- } +- +- if(var1 == Block.stairsWoodOak.blockID) { +- return Block.stairsSandStone.blockID; +- } +- +- if(var1 == Block.stairsCobblestone.blockID) { +- return Block.stairsSandStone.blockID; +- } +- +- if(var1 == Block.gravel.blockID) { ++ /** ++ * Gets the replacement block for the current biome ++ */ ++ protected int getBiomeSpecificBlock(int par1, int par2) { ++ if (this.field_143014_b) { ++ if (par1 == Block.wood.blockID) { ++ return Block.sandStone.blockID; ++ } ++ ++ if (par1 == Block.cobblestone.blockID) { ++ return Block.sandStone.blockID; ++ } ++ ++ if (par1 == Block.planks.blockID) { ++ return Block.sandStone.blockID; ++ } ++ ++ if (par1 == Block.stairsWoodOak.blockID) { ++ return Block.stairsSandStone.blockID; ++ } ++ ++ if (par1 == Block.stairsCobblestone.blockID) { ++ return Block.stairsSandStone.blockID; ++ } ++ ++ if (par1 == Block.gravel.blockID) { + return Block.sandStone.blockID; + } + } + +- return var1; ++ return par1; + } + +- protected int getBiomeSpecificBlockMetadata(int var1, int var2) { +- if(this.field_143014_b) { +- if(var1 == Block.wood.blockID) { +- return 0; +- } +- +- if(var1 == Block.cobblestone.blockID) { +- return 0; +- } +- +- if(var1 == Block.planks.blockID) { ++ /** ++ * Gets the replacement block metadata for the current biome ++ */ ++ protected int getBiomeSpecificBlockMetadata(int par1, int par2) { ++ if (this.field_143014_b) { ++ if (par1 == Block.wood.blockID) { ++ return 0; ++ } ++ ++ if (par1 == Block.cobblestone.blockID) { ++ return 0; ++ } ++ ++ if (par1 == Block.planks.blockID) { + return 2; + } + } + +- return var2; +- } +- +- protected void placeBlockAtCurrentPosition(World var1, int var2, int var3, int var4, int var5, int var6, StructureBoundingBox var7) { +- int var8 = this.getBiomeSpecificBlock(var2, var3); +- int var9 = this.getBiomeSpecificBlockMetadata(var2, var3); +- super.placeBlockAtCurrentPosition(var1, var8, var9, var4, var5, var6, var7); +- } +- +- protected void fillWithBlocks(World var1, StructureBoundingBox var2, int var3, int var4, int var5, int var6, int var7, int var8, int var9, int var10, boolean var11) { +- int var12 = this.getBiomeSpecificBlock(var9, 0); +- int var13 = this.getBiomeSpecificBlockMetadata(var9, 0); +- int var14 = this.getBiomeSpecificBlock(var10, 0); +- int var15 = this.getBiomeSpecificBlockMetadata(var10, 0); +- super.fillWithMetadataBlocks(var1, var2, var3, var4, var5, var6, var7, var8, var12, var13, var14, var15, var11); +- } +- +- protected void fillCurrentPositionBlocksDownwards(World var1, int var2, int var3, int var4, int var5, int var6, StructureBoundingBox var7) { +- int var8 = this.getBiomeSpecificBlock(var2, var3); +- int var9 = this.getBiomeSpecificBlockMetadata(var2, var3); +- super.fillCurrentPositionBlocksDownwards(var1, var8, var9, var4, var5, var6, var7); ++ return par2; ++ } ++ ++ /** ++ * current Position depends on currently set Coordinates mode, is computed here ++ */ ++ protected void placeBlockAtCurrentPosition(World par1World, int par2, int par3, int par4, int par5, int par6, StructureBoundingBox par7StructureBoundingBox) { ++ int var8 = this.getBiomeSpecificBlock(par2, par3); ++ int var9 = this.getBiomeSpecificBlockMetadata(par2, par3); ++ super.placeBlockAtCurrentPosition(par1World, var8, var9, par4, par5, par6, par7StructureBoundingBox); ++ } ++ ++ /** ++ * arguments: (World worldObj, StructureBoundingBox structBB, int minX, int minY, int minZ, int maxX, int maxY, int ++ * maxZ, int placeBlockId, int replaceBlockId, boolean alwaysreplace) ++ */ ++ protected void fillWithBlocks(World par1World, StructureBoundingBox par2StructureBoundingBox, int par3, int par4, int par5, int par6, int par7, int par8, int par9, int par10, boolean par11) { ++ int var12 = this.getBiomeSpecificBlock(par9, 0); ++ int var13 = this.getBiomeSpecificBlockMetadata(par9, 0); ++ int var14 = this.getBiomeSpecificBlock(par10, 0); ++ int var15 = this.getBiomeSpecificBlockMetadata(par10, 0); ++ super.fillWithMetadataBlocks(par1World, par2StructureBoundingBox, par3, par4, par5, par6, par7, par8, var12, var13, var14, var15, par11); ++ } ++ ++ /** ++ * Overwrites air and liquids from selected position downwards, stops at hitting anything else. ++ */ ++ protected void fillCurrentPositionBlocksDownwards(World par1World, int par2, int par3, int par4, int par5, int par6, StructureBoundingBox par7StructureBoundingBox) { ++ int var8 = this.getBiomeSpecificBlock(par2, par3); ++ int var9 = this.getBiomeSpecificBlockMetadata(par2, par3); ++ super.fillCurrentPositionBlocksDownwards(par1World, var8, var9, par4, par5, par6, par7StructureBoundingBox); + } + } diff --git a/patches/net/minecraft/src/ComponentVillageChurch.java.patch b/patches/net/minecraft/src/ComponentVillageChurch.java.patch new file mode 100644 index 0000000..24a11a7 --- /dev/null +++ b/patches/net/minecraft/src/ComponentVillageChurch.java.patch @@ -0,0 +1,195 @@ +--- net/minecraft/src/ComponentVillageChurch.java ++++ net/minecraft/src/ComponentVillageChurch.java +@@ -4,102 +4,110 @@ + import java.util.Random; + + public class ComponentVillageChurch extends ComponentVillage { +- public ComponentVillageChurch() { +- } +- +- public ComponentVillageChurch(ComponentVillageStartPiece var1, int var2, Random var3, StructureBoundingBox var4, int var5) { +- super(var1, var2); +- this.coordBaseMode = var5; +- this.boundingBox = var4; +- } +- +- public static ComponentVillageChurch func_74919_a(ComponentVillageStartPiece var0, List var1, Random var2, int var3, int var4, int var5, int var6, int var7) { +- StructureBoundingBox var8 = StructureBoundingBox.getComponentToAddBoundingBox(var3, var4, var5, 0, 0, 0, 5, 12, 9, var6); +- return canVillageGoDeeper(var8) && StructureComponent.findIntersecting(var1, var8) == null ? new ComponentVillageChurch(var0, var7, var2, var8, var6) : null; +- } +- +- public boolean addComponentParts(World var1, Random var2, StructureBoundingBox var3) { +- if(this.field_143015_k < 0) { +- this.field_143015_k = this.getAverageGroundLevel(var1, var3); +- if(this.field_143015_k < 0) { ++ public ComponentVillageChurch() {} ++ ++ public ComponentVillageChurch(ComponentVillageStartPiece par1ComponentVillageStartPiece, int par2, Random par3Random, StructureBoundingBox par4StructureBoundingBox, int par5) { ++ super(par1ComponentVillageStartPiece, par2); ++ this.coordBaseMode = par5; ++ this.boundingBox = par4StructureBoundingBox; ++ } ++ ++ public static ComponentVillageChurch func_74919_a(ComponentVillageStartPiece par0ComponentVillageStartPiece, List par1List, Random par2Random, int par3, int par4, int par5, int par6, int par7) { ++ StructureBoundingBox var8 = StructureBoundingBox.getComponentToAddBoundingBox(par3, par4, par5, 0, 0, 0, 5, 12, 9, par6); ++ return canVillageGoDeeper(var8) && StructureComponent.findIntersecting(par1List, var8) == null ? new ComponentVillageChurch(par0ComponentVillageStartPiece, par7, par2Random, var8, par6) : null; ++ } ++ ++ /** ++ * second Part of Structure generating, this for example places Spiderwebs, Mob Spawners, it closes Mineshafts at the ++ * end, it adds Fences... ++ */ ++ public boolean addComponentParts(World par1World, Random par2Random, StructureBoundingBox par3StructureBoundingBox) { ++ if (this.field_143015_k < 0) { ++ this.field_143015_k = this.getAverageGroundLevel(par1World, par3StructureBoundingBox); ++ ++ if (this.field_143015_k < 0) { + return true; + } + + this.boundingBox.offset(0, this.field_143015_k - this.boundingBox.maxY + 12 - 1, 0); + } + +- this.fillWithBlocks(var1, var3, 1, 1, 1, 3, 3, 7, 0, 0, false); +- this.fillWithBlocks(var1, var3, 1, 5, 1, 3, 9, 3, 0, 0, false); +- this.fillWithBlocks(var1, var3, 1, 0, 0, 3, 0, 8, Block.cobblestone.blockID, Block.cobblestone.blockID, false); +- this.fillWithBlocks(var1, var3, 1, 1, 0, 3, 10, 0, Block.cobblestone.blockID, Block.cobblestone.blockID, false); +- this.fillWithBlocks(var1, var3, 0, 1, 1, 0, 10, 3, Block.cobblestone.blockID, Block.cobblestone.blockID, false); +- this.fillWithBlocks(var1, var3, 4, 1, 1, 4, 10, 3, Block.cobblestone.blockID, Block.cobblestone.blockID, false); +- this.fillWithBlocks(var1, var3, 0, 0, 4, 0, 4, 7, Block.cobblestone.blockID, Block.cobblestone.blockID, false); +- this.fillWithBlocks(var1, var3, 4, 0, 4, 4, 4, 7, Block.cobblestone.blockID, Block.cobblestone.blockID, false); +- this.fillWithBlocks(var1, var3, 1, 1, 8, 3, 4, 8, Block.cobblestone.blockID, Block.cobblestone.blockID, false); +- this.fillWithBlocks(var1, var3, 1, 5, 4, 3, 10, 4, Block.cobblestone.blockID, Block.cobblestone.blockID, false); +- this.fillWithBlocks(var1, var3, 1, 5, 5, 3, 5, 7, Block.cobblestone.blockID, Block.cobblestone.blockID, false); +- this.fillWithBlocks(var1, var3, 0, 9, 0, 4, 9, 4, Block.cobblestone.blockID, Block.cobblestone.blockID, false); +- this.fillWithBlocks(var1, var3, 0, 4, 0, 4, 4, 4, Block.cobblestone.blockID, Block.cobblestone.blockID, false); +- this.placeBlockAtCurrentPosition(var1, Block.cobblestone.blockID, 0, 0, 11, 2, var3); +- this.placeBlockAtCurrentPosition(var1, Block.cobblestone.blockID, 0, 4, 11, 2, var3); +- this.placeBlockAtCurrentPosition(var1, Block.cobblestone.blockID, 0, 2, 11, 0, var3); +- this.placeBlockAtCurrentPosition(var1, Block.cobblestone.blockID, 0, 2, 11, 4, var3); +- this.placeBlockAtCurrentPosition(var1, Block.cobblestone.blockID, 0, 1, 1, 6, var3); +- this.placeBlockAtCurrentPosition(var1, Block.cobblestone.blockID, 0, 1, 1, 7, var3); +- this.placeBlockAtCurrentPosition(var1, Block.cobblestone.blockID, 0, 2, 1, 7, var3); +- this.placeBlockAtCurrentPosition(var1, Block.cobblestone.blockID, 0, 3, 1, 6, var3); +- this.placeBlockAtCurrentPosition(var1, Block.cobblestone.blockID, 0, 3, 1, 7, var3); +- this.placeBlockAtCurrentPosition(var1, Block.stairsCobblestone.blockID, this.getMetadataWithOffset(Block.stairsCobblestone.blockID, 3), 1, 1, 5, var3); +- this.placeBlockAtCurrentPosition(var1, Block.stairsCobblestone.blockID, this.getMetadataWithOffset(Block.stairsCobblestone.blockID, 3), 2, 1, 6, var3); +- this.placeBlockAtCurrentPosition(var1, Block.stairsCobblestone.blockID, this.getMetadataWithOffset(Block.stairsCobblestone.blockID, 3), 3, 1, 5, var3); +- this.placeBlockAtCurrentPosition(var1, Block.stairsCobblestone.blockID, this.getMetadataWithOffset(Block.stairsCobblestone.blockID, 1), 1, 2, 7, var3); +- this.placeBlockAtCurrentPosition(var1, Block.stairsCobblestone.blockID, this.getMetadataWithOffset(Block.stairsCobblestone.blockID, 0), 3, 2, 7, var3); +- this.placeBlockAtCurrentPosition(var1, Block.thinGlass.blockID, 0, 0, 2, 2, var3); +- this.placeBlockAtCurrentPosition(var1, Block.thinGlass.blockID, 0, 0, 3, 2, var3); +- this.placeBlockAtCurrentPosition(var1, Block.thinGlass.blockID, 0, 4, 2, 2, var3); +- this.placeBlockAtCurrentPosition(var1, Block.thinGlass.blockID, 0, 4, 3, 2, var3); +- this.placeBlockAtCurrentPosition(var1, Block.thinGlass.blockID, 0, 0, 6, 2, var3); +- this.placeBlockAtCurrentPosition(var1, Block.thinGlass.blockID, 0, 0, 7, 2, var3); +- this.placeBlockAtCurrentPosition(var1, Block.thinGlass.blockID, 0, 4, 6, 2, var3); +- this.placeBlockAtCurrentPosition(var1, Block.thinGlass.blockID, 0, 4, 7, 2, var3); +- this.placeBlockAtCurrentPosition(var1, Block.thinGlass.blockID, 0, 2, 6, 0, var3); +- this.placeBlockAtCurrentPosition(var1, Block.thinGlass.blockID, 0, 2, 7, 0, var3); +- this.placeBlockAtCurrentPosition(var1, Block.thinGlass.blockID, 0, 2, 6, 4, var3); +- this.placeBlockAtCurrentPosition(var1, Block.thinGlass.blockID, 0, 2, 7, 4, var3); +- this.placeBlockAtCurrentPosition(var1, Block.thinGlass.blockID, 0, 0, 3, 6, var3); +- this.placeBlockAtCurrentPosition(var1, Block.thinGlass.blockID, 0, 4, 3, 6, var3); +- this.placeBlockAtCurrentPosition(var1, Block.thinGlass.blockID, 0, 2, 3, 8, var3); +- this.placeBlockAtCurrentPosition(var1, Block.torchWood.blockID, 0, 2, 4, 7, var3); +- this.placeBlockAtCurrentPosition(var1, Block.torchWood.blockID, 0, 1, 4, 6, var3); +- this.placeBlockAtCurrentPosition(var1, Block.torchWood.blockID, 0, 3, 4, 6, var3); +- this.placeBlockAtCurrentPosition(var1, Block.torchWood.blockID, 0, 2, 4, 5, var3); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 1, 1, 1, 3, 3, 7, 0, 0, false); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 1, 5, 1, 3, 9, 3, 0, 0, false); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 1, 0, 0, 3, 0, 8, Block.cobblestone.blockID, Block.cobblestone.blockID, false); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 1, 1, 0, 3, 10, 0, Block.cobblestone.blockID, Block.cobblestone.blockID, false); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 0, 1, 1, 0, 10, 3, Block.cobblestone.blockID, Block.cobblestone.blockID, false); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 4, 1, 1, 4, 10, 3, Block.cobblestone.blockID, Block.cobblestone.blockID, false); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 0, 0, 4, 0, 4, 7, Block.cobblestone.blockID, Block.cobblestone.blockID, false); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 4, 0, 4, 4, 4, 7, Block.cobblestone.blockID, Block.cobblestone.blockID, false); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 1, 1, 8, 3, 4, 8, Block.cobblestone.blockID, Block.cobblestone.blockID, false); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 1, 5, 4, 3, 10, 4, Block.cobblestone.blockID, Block.cobblestone.blockID, false); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 1, 5, 5, 3, 5, 7, Block.cobblestone.blockID, Block.cobblestone.blockID, false); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 0, 9, 0, 4, 9, 4, Block.cobblestone.blockID, Block.cobblestone.blockID, false); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 0, 4, 0, 4, 4, 4, Block.cobblestone.blockID, Block.cobblestone.blockID, false); ++ this.placeBlockAtCurrentPosition(par1World, Block.cobblestone.blockID, 0, 0, 11, 2, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.cobblestone.blockID, 0, 4, 11, 2, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.cobblestone.blockID, 0, 2, 11, 0, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.cobblestone.blockID, 0, 2, 11, 4, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.cobblestone.blockID, 0, 1, 1, 6, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.cobblestone.blockID, 0, 1, 1, 7, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.cobblestone.blockID, 0, 2, 1, 7, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.cobblestone.blockID, 0, 3, 1, 6, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.cobblestone.blockID, 0, 3, 1, 7, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.stairsCobblestone.blockID, this.getMetadataWithOffset(Block.stairsCobblestone.blockID, 3), 1, 1, 5, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.stairsCobblestone.blockID, this.getMetadataWithOffset(Block.stairsCobblestone.blockID, 3), 2, 1, 6, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.stairsCobblestone.blockID, this.getMetadataWithOffset(Block.stairsCobblestone.blockID, 3), 3, 1, 5, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.stairsCobblestone.blockID, this.getMetadataWithOffset(Block.stairsCobblestone.blockID, 1), 1, 2, 7, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.stairsCobblestone.blockID, this.getMetadataWithOffset(Block.stairsCobblestone.blockID, 0), 3, 2, 7, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.thinGlass.blockID, 0, 0, 2, 2, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.thinGlass.blockID, 0, 0, 3, 2, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.thinGlass.blockID, 0, 4, 2, 2, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.thinGlass.blockID, 0, 4, 3, 2, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.thinGlass.blockID, 0, 0, 6, 2, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.thinGlass.blockID, 0, 0, 7, 2, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.thinGlass.blockID, 0, 4, 6, 2, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.thinGlass.blockID, 0, 4, 7, 2, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.thinGlass.blockID, 0, 2, 6, 0, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.thinGlass.blockID, 0, 2, 7, 0, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.thinGlass.blockID, 0, 2, 6, 4, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.thinGlass.blockID, 0, 2, 7, 4, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.thinGlass.blockID, 0, 0, 3, 6, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.thinGlass.blockID, 0, 4, 3, 6, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.thinGlass.blockID, 0, 2, 3, 8, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.torchWood.blockID, 0, 2, 4, 7, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.torchWood.blockID, 0, 1, 4, 6, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.torchWood.blockID, 0, 3, 4, 6, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.torchWood.blockID, 0, 2, 4, 5, par3StructureBoundingBox); + int var4 = this.getMetadataWithOffset(Block.ladder.blockID, 4); +- + int var5; +- for(var5 = 1; var5 <= 9; ++var5) { +- this.placeBlockAtCurrentPosition(var1, Block.ladder.blockID, var4, 3, var5, 3, var3); +- } +- +- this.placeBlockAtCurrentPosition(var1, 0, 0, 2, 1, 0, var3); +- this.placeBlockAtCurrentPosition(var1, 0, 0, 2, 2, 0, var3); +- this.placeDoorAtCurrentPosition(var1, var3, var2, 2, 1, 0, this.getMetadataWithOffset(Block.doorWood.blockID, 1)); +- if(this.getBlockIdAtCurrentPosition(var1, 2, 0, -1, var3) == 0 && this.getBlockIdAtCurrentPosition(var1, 2, -1, -1, var3) != 0) { +- this.placeBlockAtCurrentPosition(var1, Block.stairsCobblestone.blockID, this.getMetadataWithOffset(Block.stairsCobblestone.blockID, 3), 2, 0, -1, var3); +- } +- +- for(var5 = 0; var5 < 9; ++var5) { +- for(int var6 = 0; var6 < 5; ++var6) { +- this.clearCurrentPositionBlocksUpwards(var1, var6, 12, var5, var3); +- this.fillCurrentPositionBlocksDownwards(var1, Block.cobblestone.blockID, 0, var6, -1, var5, var3); ++ ++ for (var5 = 1; var5 <= 9; ++var5) { ++ this.placeBlockAtCurrentPosition(par1World, Block.ladder.blockID, var4, 3, var5, 3, par3StructureBoundingBox); ++ } ++ ++ this.placeBlockAtCurrentPosition(par1World, 0, 0, 2, 1, 0, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, 0, 0, 2, 2, 0, par3StructureBoundingBox); ++ this.placeDoorAtCurrentPosition(par1World, par3StructureBoundingBox, par2Random, 2, 1, 0, this.getMetadataWithOffset(Block.doorWood.blockID, 1)); ++ ++ if (this.getBlockIdAtCurrentPosition(par1World, 2, 0, -1, par3StructureBoundingBox) == 0 && this.getBlockIdAtCurrentPosition(par1World, 2, -1, -1, par3StructureBoundingBox) != 0) { ++ this.placeBlockAtCurrentPosition(par1World, Block.stairsCobblestone.blockID, this.getMetadataWithOffset(Block.stairsCobblestone.blockID, 3), 2, 0, -1, par3StructureBoundingBox); ++ } ++ ++ for (var5 = 0; var5 < 9; ++var5) { ++ for (int var6 = 0; var6 < 5; ++var6) { ++ this.clearCurrentPositionBlocksUpwards(par1World, var6, 12, var5, par3StructureBoundingBox); ++ this.fillCurrentPositionBlocksDownwards(par1World, Block.cobblestone.blockID, 0, var6, -1, var5, par3StructureBoundingBox); + } + } + +- this.spawnVillagers(var1, var3, 2, 1, 2, 1); ++ this.spawnVillagers(par1World, par3StructureBoundingBox, 2, 1, 2, 1); + return true; + } + +- protected int getVillagerType(int var1) { ++ /** ++ * Returns the villager type to spawn in this component, based on the number of villagers already spawned. ++ */ ++ protected int getVillagerType(int par1) { + return 2; + } + } diff --git a/patches/net/minecraft/src/ComponentVillageField.java.patch b/patches/net/minecraft/src/ComponentVillageField.java.patch new file mode 100644 index 0000000..6cdadf4 --- /dev/null +++ b/patches/net/minecraft/src/ComponentVillageField.java.patch @@ -0,0 +1,185 @@ +--- net/minecraft/src/ComponentVillageField.java ++++ net/minecraft/src/ComponentVillageField.java +@@ -4,95 +4,112 @@ + import java.util.Random; + + public class ComponentVillageField extends ComponentVillage { ++ ++ /** First crop type for this field. */ + private int cropTypeA; ++ ++ /** Second crop type for this field. */ + private int cropTypeB; ++ ++ /** Third crop type for this field. */ + private int cropTypeC; ++ ++ /** Fourth crop type for this field. */ + private int cropTypeD; + +- public ComponentVillageField() { +- } +- +- public ComponentVillageField(ComponentVillageStartPiece var1, int var2, Random var3, StructureBoundingBox var4, int var5) { +- super(var1, var2); +- this.coordBaseMode = var5; +- this.boundingBox = var4; +- this.cropTypeA = this.getRandomCrop(var3); +- this.cropTypeB = this.getRandomCrop(var3); +- this.cropTypeC = this.getRandomCrop(var3); +- this.cropTypeD = this.getRandomCrop(var3); +- } +- +- protected void func_143012_a(NBTTagCompound var1) { +- super.func_143012_a(var1); +- var1.setInteger("CA", this.cropTypeA); +- var1.setInteger("CB", this.cropTypeB); +- var1.setInteger("CC", this.cropTypeC); +- var1.setInteger("CD", this.cropTypeD); +- } +- +- protected void func_143011_b(NBTTagCompound var1) { +- super.func_143011_b(var1); +- this.cropTypeA = var1.getInteger("CA"); +- this.cropTypeB = var1.getInteger("CB"); +- this.cropTypeC = var1.getInteger("CC"); +- this.cropTypeD = var1.getInteger("CD"); +- } +- +- private int getRandomCrop(Random var1) { +- switch(var1.nextInt(5)) { +- case 0: +- return Block.carrot.blockID; +- case 1: +- return Block.potato.blockID; +- default: +- return Block.crops.blockID; ++ public ComponentVillageField() {} ++ ++ public ComponentVillageField(ComponentVillageStartPiece par1ComponentVillageStartPiece, int par2, Random par3Random, StructureBoundingBox par4StructureBoundingBox, int par5) { ++ super(par1ComponentVillageStartPiece, par2); ++ this.coordBaseMode = par5; ++ this.boundingBox = par4StructureBoundingBox; ++ this.cropTypeA = this.getRandomCrop(par3Random); ++ this.cropTypeB = this.getRandomCrop(par3Random); ++ this.cropTypeC = this.getRandomCrop(par3Random); ++ this.cropTypeD = this.getRandomCrop(par3Random); ++ } ++ ++ protected void func_143012_a(NBTTagCompound par1NBTTagCompound) { ++ super.func_143012_a(par1NBTTagCompound); ++ par1NBTTagCompound.setInteger("CA", this.cropTypeA); ++ par1NBTTagCompound.setInteger("CB", this.cropTypeB); ++ par1NBTTagCompound.setInteger("CC", this.cropTypeC); ++ par1NBTTagCompound.setInteger("CD", this.cropTypeD); ++ } ++ ++ protected void func_143011_b(NBTTagCompound par1NBTTagCompound) { ++ super.func_143011_b(par1NBTTagCompound); ++ this.cropTypeA = par1NBTTagCompound.getInteger("CA"); ++ this.cropTypeB = par1NBTTagCompound.getInteger("CB"); ++ this.cropTypeC = par1NBTTagCompound.getInteger("CC"); ++ this.cropTypeD = par1NBTTagCompound.getInteger("CD"); ++ } ++ ++ /** ++ * Returns a crop type to be planted on this field. ++ */ ++ private int getRandomCrop(Random par1Random) { ++ switch (par1Random.nextInt(5)) { ++ case 0: ++ return Block.carrot.blockID; ++ ++ case 1: ++ return Block.potato.blockID; ++ ++ default: ++ return Block.crops.blockID; + } + } + +- public static ComponentVillageField func_74900_a(ComponentVillageStartPiece var0, List var1, Random var2, int var3, int var4, int var5, int var6, int var7) { +- StructureBoundingBox var8 = StructureBoundingBox.getComponentToAddBoundingBox(var3, var4, var5, 0, 0, 0, 13, 4, 9, var6); +- return canVillageGoDeeper(var8) && StructureComponent.findIntersecting(var1, var8) == null ? new ComponentVillageField(var0, var7, var2, var8, var6) : null; ++ public static ComponentVillageField func_74900_a(ComponentVillageStartPiece par0ComponentVillageStartPiece, List par1List, Random par2Random, int par3, int par4, int par5, int par6, int par7) { ++ StructureBoundingBox var8 = StructureBoundingBox.getComponentToAddBoundingBox(par3, par4, par5, 0, 0, 0, 13, 4, 9, par6); ++ return canVillageGoDeeper(var8) && StructureComponent.findIntersecting(par1List, var8) == null ? new ComponentVillageField(par0ComponentVillageStartPiece, par7, par2Random, var8, par6) : null; + } + +- public boolean addComponentParts(World var1, Random var2, StructureBoundingBox var3) { +- if(this.field_143015_k < 0) { +- this.field_143015_k = this.getAverageGroundLevel(var1, var3); +- if(this.field_143015_k < 0) { ++ /** ++ * second Part of Structure generating, this for example places Spiderwebs, Mob Spawners, it closes Mineshafts at the ++ * end, it adds Fences... ++ */ ++ public boolean addComponentParts(World par1World, Random par2Random, StructureBoundingBox par3StructureBoundingBox) { ++ if (this.field_143015_k < 0) { ++ this.field_143015_k = this.getAverageGroundLevel(par1World, par3StructureBoundingBox); ++ ++ if (this.field_143015_k < 0) { + return true; + } + + this.boundingBox.offset(0, this.field_143015_k - this.boundingBox.maxY + 4 - 1, 0); + } + +- this.fillWithBlocks(var1, var3, 0, 1, 0, 12, 4, 8, 0, 0, false); +- this.fillWithBlocks(var1, var3, 1, 0, 1, 2, 0, 7, Block.tilledField.blockID, Block.tilledField.blockID, false); +- this.fillWithBlocks(var1, var3, 4, 0, 1, 5, 0, 7, Block.tilledField.blockID, Block.tilledField.blockID, false); +- this.fillWithBlocks(var1, var3, 7, 0, 1, 8, 0, 7, Block.tilledField.blockID, Block.tilledField.blockID, false); +- this.fillWithBlocks(var1, var3, 10, 0, 1, 11, 0, 7, Block.tilledField.blockID, Block.tilledField.blockID, false); +- this.fillWithBlocks(var1, var3, 0, 0, 0, 0, 0, 8, Block.wood.blockID, Block.wood.blockID, false); +- this.fillWithBlocks(var1, var3, 6, 0, 0, 6, 0, 8, Block.wood.blockID, Block.wood.blockID, false); +- this.fillWithBlocks(var1, var3, 12, 0, 0, 12, 0, 8, Block.wood.blockID, Block.wood.blockID, false); +- this.fillWithBlocks(var1, var3, 1, 0, 0, 11, 0, 0, Block.wood.blockID, Block.wood.blockID, false); +- this.fillWithBlocks(var1, var3, 1, 0, 8, 11, 0, 8, Block.wood.blockID, Block.wood.blockID, false); +- this.fillWithBlocks(var1, var3, 3, 0, 1, 3, 0, 7, Block.waterMoving.blockID, Block.waterMoving.blockID, false); +- this.fillWithBlocks(var1, var3, 9, 0, 1, 9, 0, 7, Block.waterMoving.blockID, Block.waterMoving.blockID, false); +- ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 0, 1, 0, 12, 4, 8, 0, 0, false); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 1, 0, 1, 2, 0, 7, Block.tilledField.blockID, Block.tilledField.blockID, false); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 4, 0, 1, 5, 0, 7, Block.tilledField.blockID, Block.tilledField.blockID, false); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 7, 0, 1, 8, 0, 7, Block.tilledField.blockID, Block.tilledField.blockID, false); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 10, 0, 1, 11, 0, 7, Block.tilledField.blockID, Block.tilledField.blockID, false); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 0, 0, 0, 0, 0, 8, Block.wood.blockID, Block.wood.blockID, false); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 6, 0, 0, 6, 0, 8, Block.wood.blockID, Block.wood.blockID, false); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 12, 0, 0, 12, 0, 8, Block.wood.blockID, Block.wood.blockID, false); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 1, 0, 0, 11, 0, 0, Block.wood.blockID, Block.wood.blockID, false); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 1, 0, 8, 11, 0, 8, Block.wood.blockID, Block.wood.blockID, false); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 3, 0, 1, 3, 0, 7, Block.waterMoving.blockID, Block.waterMoving.blockID, false); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 9, 0, 1, 9, 0, 7, Block.waterMoving.blockID, Block.waterMoving.blockID, false); + int var4; +- for(var4 = 1; var4 <= 7; ++var4) { +- this.placeBlockAtCurrentPosition(var1, this.cropTypeA, MathHelper.getRandomIntegerInRange(var2, 2, 7), 1, 1, var4, var3); +- this.placeBlockAtCurrentPosition(var1, this.cropTypeA, MathHelper.getRandomIntegerInRange(var2, 2, 7), 2, 1, var4, var3); +- this.placeBlockAtCurrentPosition(var1, this.cropTypeB, MathHelper.getRandomIntegerInRange(var2, 2, 7), 4, 1, var4, var3); +- this.placeBlockAtCurrentPosition(var1, this.cropTypeB, MathHelper.getRandomIntegerInRange(var2, 2, 7), 5, 1, var4, var3); +- this.placeBlockAtCurrentPosition(var1, this.cropTypeC, MathHelper.getRandomIntegerInRange(var2, 2, 7), 7, 1, var4, var3); +- this.placeBlockAtCurrentPosition(var1, this.cropTypeC, MathHelper.getRandomIntegerInRange(var2, 2, 7), 8, 1, var4, var3); +- this.placeBlockAtCurrentPosition(var1, this.cropTypeD, MathHelper.getRandomIntegerInRange(var2, 2, 7), 10, 1, var4, var3); +- this.placeBlockAtCurrentPosition(var1, this.cropTypeD, MathHelper.getRandomIntegerInRange(var2, 2, 7), 11, 1, var4, var3); ++ ++ for (var4 = 1; var4 <= 7; ++var4) { ++ this.placeBlockAtCurrentPosition(par1World, this.cropTypeA, MathHelper.getRandomIntegerInRange(par2Random, 2, 7), 1, 1, var4, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, this.cropTypeA, MathHelper.getRandomIntegerInRange(par2Random, 2, 7), 2, 1, var4, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, this.cropTypeB, MathHelper.getRandomIntegerInRange(par2Random, 2, 7), 4, 1, var4, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, this.cropTypeB, MathHelper.getRandomIntegerInRange(par2Random, 2, 7), 5, 1, var4, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, this.cropTypeC, MathHelper.getRandomIntegerInRange(par2Random, 2, 7), 7, 1, var4, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, this.cropTypeC, MathHelper.getRandomIntegerInRange(par2Random, 2, 7), 8, 1, var4, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, this.cropTypeD, MathHelper.getRandomIntegerInRange(par2Random, 2, 7), 10, 1, var4, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, this.cropTypeD, MathHelper.getRandomIntegerInRange(par2Random, 2, 7), 11, 1, var4, par3StructureBoundingBox); + } + +- for(var4 = 0; var4 < 9; ++var4) { +- for(int var5 = 0; var5 < 13; ++var5) { +- this.clearCurrentPositionBlocksUpwards(var1, var5, 4, var4, var3); +- this.fillCurrentPositionBlocksDownwards(var1, Block.dirt.blockID, 0, var5, -1, var4, var3); ++ for (var4 = 0; var4 < 9; ++var4) { ++ for (int var5 = 0; var5 < 13; ++var5) { ++ this.clearCurrentPositionBlocksUpwards(par1World, var5, 4, var4, par3StructureBoundingBox); ++ this.fillCurrentPositionBlocksDownwards(par1World, Block.dirt.blockID, 0, var5, -1, var4, par3StructureBoundingBox); + } + } + diff --git a/patches/net/minecraft/src/ComponentVillageField2.java.patch b/patches/net/minecraft/src/ComponentVillageField2.java.patch new file mode 100644 index 0000000..9fe3968 --- /dev/null +++ b/patches/net/minecraft/src/ComponentVillageField2.java.patch @@ -0,0 +1,151 @@ +--- net/minecraft/src/ComponentVillageField2.java ++++ net/minecraft/src/ComponentVillageField2.java +@@ -4,79 +4,92 @@ + import java.util.Random; + + public class ComponentVillageField2 extends ComponentVillage { ++ ++ /** First crop type for this field. */ + private int cropTypeA; ++ ++ /** Second crop type for this field. */ + private int cropTypeB; + +- public ComponentVillageField2() { +- } +- +- public ComponentVillageField2(ComponentVillageStartPiece var1, int var2, Random var3, StructureBoundingBox var4, int var5) { +- super(var1, var2); +- this.coordBaseMode = var5; +- this.boundingBox = var4; +- this.cropTypeA = this.pickRandomCrop(var3); +- this.cropTypeB = this.pickRandomCrop(var3); +- } +- +- protected void func_143012_a(NBTTagCompound var1) { +- super.func_143012_a(var1); +- var1.setInteger("CA", this.cropTypeA); +- var1.setInteger("CB", this.cropTypeB); +- } +- +- protected void func_143011_b(NBTTagCompound var1) { +- super.func_143011_b(var1); +- this.cropTypeA = var1.getInteger("CA"); +- this.cropTypeB = var1.getInteger("CB"); +- } +- +- private int pickRandomCrop(Random var1) { +- switch(var1.nextInt(5)) { +- case 0: +- return Block.carrot.blockID; +- case 1: +- return Block.potato.blockID; +- default: +- return Block.crops.blockID; ++ public ComponentVillageField2() {} ++ ++ public ComponentVillageField2(ComponentVillageStartPiece par1ComponentVillageStartPiece, int par2, Random par3Random, StructureBoundingBox par4StructureBoundingBox, int par5) { ++ super(par1ComponentVillageStartPiece, par2); ++ this.coordBaseMode = par5; ++ this.boundingBox = par4StructureBoundingBox; ++ this.cropTypeA = this.pickRandomCrop(par3Random); ++ this.cropTypeB = this.pickRandomCrop(par3Random); ++ } ++ ++ protected void func_143012_a(NBTTagCompound par1NBTTagCompound) { ++ super.func_143012_a(par1NBTTagCompound); ++ par1NBTTagCompound.setInteger("CA", this.cropTypeA); ++ par1NBTTagCompound.setInteger("CB", this.cropTypeB); ++ } ++ ++ protected void func_143011_b(NBTTagCompound par1NBTTagCompound) { ++ super.func_143011_b(par1NBTTagCompound); ++ this.cropTypeA = par1NBTTagCompound.getInteger("CA"); ++ this.cropTypeB = par1NBTTagCompound.getInteger("CB"); ++ } ++ ++ /** ++ * Returns a crop type to be planted on this field. ++ */ ++ private int pickRandomCrop(Random par1Random) { ++ switch (par1Random.nextInt(5)) { ++ case 0: ++ return Block.carrot.blockID; ++ ++ case 1: ++ return Block.potato.blockID; ++ ++ default: ++ return Block.crops.blockID; + } + } + +- public static ComponentVillageField2 func_74902_a(ComponentVillageStartPiece var0, List var1, Random var2, int var3, int var4, int var5, int var6, int var7) { +- StructureBoundingBox var8 = StructureBoundingBox.getComponentToAddBoundingBox(var3, var4, var5, 0, 0, 0, 7, 4, 9, var6); +- return canVillageGoDeeper(var8) && StructureComponent.findIntersecting(var1, var8) == null ? new ComponentVillageField2(var0, var7, var2, var8, var6) : null; ++ public static ComponentVillageField2 func_74902_a(ComponentVillageStartPiece par0ComponentVillageStartPiece, List par1List, Random par2Random, int par3, int par4, int par5, int par6, int par7) { ++ StructureBoundingBox var8 = StructureBoundingBox.getComponentToAddBoundingBox(par3, par4, par5, 0, 0, 0, 7, 4, 9, par6); ++ return canVillageGoDeeper(var8) && StructureComponent.findIntersecting(par1List, var8) == null ? new ComponentVillageField2(par0ComponentVillageStartPiece, par7, par2Random, var8, par6) : null; + } + +- public boolean addComponentParts(World var1, Random var2, StructureBoundingBox var3) { +- if(this.field_143015_k < 0) { +- this.field_143015_k = this.getAverageGroundLevel(var1, var3); +- if(this.field_143015_k < 0) { ++ /** ++ * second Part of Structure generating, this for example places Spiderwebs, Mob Spawners, it closes Mineshafts at the ++ * end, it adds Fences... ++ */ ++ public boolean addComponentParts(World par1World, Random par2Random, StructureBoundingBox par3StructureBoundingBox) { ++ if (this.field_143015_k < 0) { ++ this.field_143015_k = this.getAverageGroundLevel(par1World, par3StructureBoundingBox); ++ ++ if (this.field_143015_k < 0) { + return true; + } + + this.boundingBox.offset(0, this.field_143015_k - this.boundingBox.maxY + 4 - 1, 0); + } + +- this.fillWithBlocks(var1, var3, 0, 1, 0, 6, 4, 8, 0, 0, false); +- this.fillWithBlocks(var1, var3, 1, 0, 1, 2, 0, 7, Block.tilledField.blockID, Block.tilledField.blockID, false); +- this.fillWithBlocks(var1, var3, 4, 0, 1, 5, 0, 7, Block.tilledField.blockID, Block.tilledField.blockID, false); +- this.fillWithBlocks(var1, var3, 0, 0, 0, 0, 0, 8, Block.wood.blockID, Block.wood.blockID, false); +- this.fillWithBlocks(var1, var3, 6, 0, 0, 6, 0, 8, Block.wood.blockID, Block.wood.blockID, false); +- this.fillWithBlocks(var1, var3, 1, 0, 0, 5, 0, 0, Block.wood.blockID, Block.wood.blockID, false); +- this.fillWithBlocks(var1, var3, 1, 0, 8, 5, 0, 8, Block.wood.blockID, Block.wood.blockID, false); +- this.fillWithBlocks(var1, var3, 3, 0, 1, 3, 0, 7, Block.waterMoving.blockID, Block.waterMoving.blockID, false); +- ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 0, 1, 0, 6, 4, 8, 0, 0, false); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 1, 0, 1, 2, 0, 7, Block.tilledField.blockID, Block.tilledField.blockID, false); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 4, 0, 1, 5, 0, 7, Block.tilledField.blockID, Block.tilledField.blockID, false); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 0, 0, 0, 0, 0, 8, Block.wood.blockID, Block.wood.blockID, false); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 6, 0, 0, 6, 0, 8, Block.wood.blockID, Block.wood.blockID, false); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 1, 0, 0, 5, 0, 0, Block.wood.blockID, Block.wood.blockID, false); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 1, 0, 8, 5, 0, 8, Block.wood.blockID, Block.wood.blockID, false); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 3, 0, 1, 3, 0, 7, Block.waterMoving.blockID, Block.waterMoving.blockID, false); + int var4; +- for(var4 = 1; var4 <= 7; ++var4) { +- this.placeBlockAtCurrentPosition(var1, this.cropTypeA, MathHelper.getRandomIntegerInRange(var2, 2, 7), 1, 1, var4, var3); +- this.placeBlockAtCurrentPosition(var1, this.cropTypeA, MathHelper.getRandomIntegerInRange(var2, 2, 7), 2, 1, var4, var3); +- this.placeBlockAtCurrentPosition(var1, this.cropTypeB, MathHelper.getRandomIntegerInRange(var2, 2, 7), 4, 1, var4, var3); +- this.placeBlockAtCurrentPosition(var1, this.cropTypeB, MathHelper.getRandomIntegerInRange(var2, 2, 7), 5, 1, var4, var3); ++ ++ for (var4 = 1; var4 <= 7; ++var4) { ++ this.placeBlockAtCurrentPosition(par1World, this.cropTypeA, MathHelper.getRandomIntegerInRange(par2Random, 2, 7), 1, 1, var4, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, this.cropTypeA, MathHelper.getRandomIntegerInRange(par2Random, 2, 7), 2, 1, var4, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, this.cropTypeB, MathHelper.getRandomIntegerInRange(par2Random, 2, 7), 4, 1, var4, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, this.cropTypeB, MathHelper.getRandomIntegerInRange(par2Random, 2, 7), 5, 1, var4, par3StructureBoundingBox); + } + +- for(var4 = 0; var4 < 9; ++var4) { +- for(int var5 = 0; var5 < 7; ++var5) { +- this.clearCurrentPositionBlocksUpwards(var1, var5, 4, var4, var3); +- this.fillCurrentPositionBlocksDownwards(var1, Block.dirt.blockID, 0, var5, -1, var4, var3); ++ for (var4 = 0; var4 < 9; ++var4) { ++ for (int var5 = 0; var5 < 7; ++var5) { ++ this.clearCurrentPositionBlocksUpwards(par1World, var5, 4, var4, par3StructureBoundingBox); ++ this.fillCurrentPositionBlocksDownwards(par1World, Block.dirt.blockID, 0, var5, -1, var4, par3StructureBoundingBox); + } + } + diff --git a/patches/net/minecraft/src/ComponentVillageHall.java.patch b/patches/net/minecraft/src/ComponentVillageHall.java.patch new file mode 100644 index 0000000..6d4bb45 --- /dev/null +++ b/patches/net/minecraft/src/ComponentVillageHall.java.patch @@ -0,0 +1,209 @@ +--- net/minecraft/src/ComponentVillageHall.java ++++ net/minecraft/src/ComponentVillageHall.java +@@ -4,108 +4,116 @@ + import java.util.Random; + + public class ComponentVillageHall extends ComponentVillage { +- public ComponentVillageHall() { +- } +- +- public ComponentVillageHall(ComponentVillageStartPiece var1, int var2, Random var3, StructureBoundingBox var4, int var5) { +- super(var1, var2); +- this.coordBaseMode = var5; +- this.boundingBox = var4; +- } +- +- public static ComponentVillageHall func_74906_a(ComponentVillageStartPiece var0, List var1, Random var2, int var3, int var4, int var5, int var6, int var7) { +- StructureBoundingBox var8 = StructureBoundingBox.getComponentToAddBoundingBox(var3, var4, var5, 0, 0, 0, 9, 7, 11, var6); +- return canVillageGoDeeper(var8) && StructureComponent.findIntersecting(var1, var8) == null ? new ComponentVillageHall(var0, var7, var2, var8, var6) : null; +- } +- +- public boolean addComponentParts(World var1, Random var2, StructureBoundingBox var3) { +- if(this.field_143015_k < 0) { +- this.field_143015_k = this.getAverageGroundLevel(var1, var3); +- if(this.field_143015_k < 0) { ++ public ComponentVillageHall() {} ++ ++ public ComponentVillageHall(ComponentVillageStartPiece par1ComponentVillageStartPiece, int par2, Random par3Random, StructureBoundingBox par4StructureBoundingBox, int par5) { ++ super(par1ComponentVillageStartPiece, par2); ++ this.coordBaseMode = par5; ++ this.boundingBox = par4StructureBoundingBox; ++ } ++ ++ public static ComponentVillageHall func_74906_a(ComponentVillageStartPiece par0ComponentVillageStartPiece, List par1List, Random par2Random, int par3, int par4, int par5, int par6, int par7) { ++ StructureBoundingBox var8 = StructureBoundingBox.getComponentToAddBoundingBox(par3, par4, par5, 0, 0, 0, 9, 7, 11, par6); ++ return canVillageGoDeeper(var8) && StructureComponent.findIntersecting(par1List, var8) == null ? new ComponentVillageHall(par0ComponentVillageStartPiece, par7, par2Random, var8, par6) : null; ++ } ++ ++ /** ++ * second Part of Structure generating, this for example places Spiderwebs, Mob Spawners, it closes Mineshafts at the ++ * end, it adds Fences... ++ */ ++ public boolean addComponentParts(World par1World, Random par2Random, StructureBoundingBox par3StructureBoundingBox) { ++ if (this.field_143015_k < 0) { ++ this.field_143015_k = this.getAverageGroundLevel(par1World, par3StructureBoundingBox); ++ ++ if (this.field_143015_k < 0) { + return true; + } + + this.boundingBox.offset(0, this.field_143015_k - this.boundingBox.maxY + 7 - 1, 0); + } + +- this.fillWithBlocks(var1, var3, 1, 1, 1, 7, 4, 4, 0, 0, false); +- this.fillWithBlocks(var1, var3, 2, 1, 6, 8, 4, 10, 0, 0, false); +- this.fillWithBlocks(var1, var3, 2, 0, 6, 8, 0, 10, Block.dirt.blockID, Block.dirt.blockID, false); +- this.placeBlockAtCurrentPosition(var1, Block.cobblestone.blockID, 0, 6, 0, 6, var3); +- this.fillWithBlocks(var1, var3, 2, 1, 6, 2, 1, 10, Block.fence.blockID, Block.fence.blockID, false); +- this.fillWithBlocks(var1, var3, 8, 1, 6, 8, 1, 10, Block.fence.blockID, Block.fence.blockID, false); +- this.fillWithBlocks(var1, var3, 3, 1, 10, 7, 1, 10, Block.fence.blockID, Block.fence.blockID, false); +- this.fillWithBlocks(var1, var3, 1, 0, 1, 7, 0, 4, Block.planks.blockID, Block.planks.blockID, false); +- this.fillWithBlocks(var1, var3, 0, 0, 0, 0, 3, 5, Block.cobblestone.blockID, Block.cobblestone.blockID, false); +- this.fillWithBlocks(var1, var3, 8, 0, 0, 8, 3, 5, Block.cobblestone.blockID, Block.cobblestone.blockID, false); +- this.fillWithBlocks(var1, var3, 1, 0, 0, 7, 1, 0, Block.cobblestone.blockID, Block.cobblestone.blockID, false); +- this.fillWithBlocks(var1, var3, 1, 0, 5, 7, 1, 5, Block.cobblestone.blockID, Block.cobblestone.blockID, false); +- this.fillWithBlocks(var1, var3, 1, 2, 0, 7, 3, 0, Block.planks.blockID, Block.planks.blockID, false); +- this.fillWithBlocks(var1, var3, 1, 2, 5, 7, 3, 5, Block.planks.blockID, Block.planks.blockID, false); +- this.fillWithBlocks(var1, var3, 0, 4, 1, 8, 4, 1, Block.planks.blockID, Block.planks.blockID, false); +- this.fillWithBlocks(var1, var3, 0, 4, 4, 8, 4, 4, Block.planks.blockID, Block.planks.blockID, false); +- this.fillWithBlocks(var1, var3, 0, 5, 2, 8, 5, 3, Block.planks.blockID, Block.planks.blockID, false); +- this.placeBlockAtCurrentPosition(var1, Block.planks.blockID, 0, 0, 4, 2, var3); +- this.placeBlockAtCurrentPosition(var1, Block.planks.blockID, 0, 0, 4, 3, var3); +- this.placeBlockAtCurrentPosition(var1, Block.planks.blockID, 0, 8, 4, 2, var3); +- this.placeBlockAtCurrentPosition(var1, Block.planks.blockID, 0, 8, 4, 3, var3); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 1, 1, 1, 7, 4, 4, 0, 0, false); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 2, 1, 6, 8, 4, 10, 0, 0, false); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 2, 0, 6, 8, 0, 10, Block.dirt.blockID, Block.dirt.blockID, false); ++ this.placeBlockAtCurrentPosition(par1World, Block.cobblestone.blockID, 0, 6, 0, 6, par3StructureBoundingBox); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 2, 1, 6, 2, 1, 10, Block.fence.blockID, Block.fence.blockID, false); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 8, 1, 6, 8, 1, 10, Block.fence.blockID, Block.fence.blockID, false); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 3, 1, 10, 7, 1, 10, Block.fence.blockID, Block.fence.blockID, false); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 1, 0, 1, 7, 0, 4, Block.planks.blockID, Block.planks.blockID, false); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 0, 0, 0, 0, 3, 5, Block.cobblestone.blockID, Block.cobblestone.blockID, false); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 8, 0, 0, 8, 3, 5, Block.cobblestone.blockID, Block.cobblestone.blockID, false); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 1, 0, 0, 7, 1, 0, Block.cobblestone.blockID, Block.cobblestone.blockID, false); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 1, 0, 5, 7, 1, 5, Block.cobblestone.blockID, Block.cobblestone.blockID, false); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 1, 2, 0, 7, 3, 0, Block.planks.blockID, Block.planks.blockID, false); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 1, 2, 5, 7, 3, 5, Block.planks.blockID, Block.planks.blockID, false); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 0, 4, 1, 8, 4, 1, Block.planks.blockID, Block.planks.blockID, false); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 0, 4, 4, 8, 4, 4, Block.planks.blockID, Block.planks.blockID, false); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 0, 5, 2, 8, 5, 3, Block.planks.blockID, Block.planks.blockID, false); ++ this.placeBlockAtCurrentPosition(par1World, Block.planks.blockID, 0, 0, 4, 2, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.planks.blockID, 0, 0, 4, 3, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.planks.blockID, 0, 8, 4, 2, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.planks.blockID, 0, 8, 4, 3, par3StructureBoundingBox); + int var4 = this.getMetadataWithOffset(Block.stairsWoodOak.blockID, 3); + int var5 = this.getMetadataWithOffset(Block.stairsWoodOak.blockID, 2); +- + int var6; + int var7; +- for(var6 = -1; var6 <= 2; ++var6) { +- for(var7 = 0; var7 <= 8; ++var7) { +- this.placeBlockAtCurrentPosition(var1, Block.stairsWoodOak.blockID, var4, var7, 4 + var6, var6, var3); +- this.placeBlockAtCurrentPosition(var1, Block.stairsWoodOak.blockID, var5, var7, 4 + var6, 5 - var6, var3); +- } +- } +- +- this.placeBlockAtCurrentPosition(var1, Block.wood.blockID, 0, 0, 2, 1, var3); +- this.placeBlockAtCurrentPosition(var1, Block.wood.blockID, 0, 0, 2, 4, var3); +- this.placeBlockAtCurrentPosition(var1, Block.wood.blockID, 0, 8, 2, 1, var3); +- this.placeBlockAtCurrentPosition(var1, Block.wood.blockID, 0, 8, 2, 4, var3); +- this.placeBlockAtCurrentPosition(var1, Block.thinGlass.blockID, 0, 0, 2, 2, var3); +- this.placeBlockAtCurrentPosition(var1, Block.thinGlass.blockID, 0, 0, 2, 3, var3); +- this.placeBlockAtCurrentPosition(var1, Block.thinGlass.blockID, 0, 8, 2, 2, var3); +- this.placeBlockAtCurrentPosition(var1, Block.thinGlass.blockID, 0, 8, 2, 3, var3); +- this.placeBlockAtCurrentPosition(var1, Block.thinGlass.blockID, 0, 2, 2, 5, var3); +- this.placeBlockAtCurrentPosition(var1, Block.thinGlass.blockID, 0, 3, 2, 5, var3); +- this.placeBlockAtCurrentPosition(var1, Block.thinGlass.blockID, 0, 5, 2, 0, var3); +- this.placeBlockAtCurrentPosition(var1, Block.thinGlass.blockID, 0, 6, 2, 5, var3); +- this.placeBlockAtCurrentPosition(var1, Block.fence.blockID, 0, 2, 1, 3, var3); +- this.placeBlockAtCurrentPosition(var1, Block.pressurePlatePlanks.blockID, 0, 2, 2, 3, var3); +- this.placeBlockAtCurrentPosition(var1, Block.planks.blockID, 0, 1, 1, 4, var3); +- this.placeBlockAtCurrentPosition(var1, Block.stairsWoodOak.blockID, this.getMetadataWithOffset(Block.stairsWoodOak.blockID, 3), 2, 1, 4, var3); +- this.placeBlockAtCurrentPosition(var1, Block.stairsWoodOak.blockID, this.getMetadataWithOffset(Block.stairsWoodOak.blockID, 1), 1, 1, 3, var3); +- this.fillWithBlocks(var1, var3, 5, 0, 1, 7, 0, 3, Block.stoneDoubleSlab.blockID, Block.stoneDoubleSlab.blockID, false); +- this.placeBlockAtCurrentPosition(var1, Block.stoneDoubleSlab.blockID, 0, 6, 1, 1, var3); +- this.placeBlockAtCurrentPosition(var1, Block.stoneDoubleSlab.blockID, 0, 6, 1, 2, var3); +- this.placeBlockAtCurrentPosition(var1, 0, 0, 2, 1, 0, var3); +- this.placeBlockAtCurrentPosition(var1, 0, 0, 2, 2, 0, var3); +- this.placeBlockAtCurrentPosition(var1, Block.torchWood.blockID, 0, 2, 3, 1, var3); +- this.placeDoorAtCurrentPosition(var1, var3, var2, 2, 1, 0, this.getMetadataWithOffset(Block.doorWood.blockID, 1)); +- if(this.getBlockIdAtCurrentPosition(var1, 2, 0, -1, var3) == 0 && this.getBlockIdAtCurrentPosition(var1, 2, -1, -1, var3) != 0) { +- this.placeBlockAtCurrentPosition(var1, Block.stairsCobblestone.blockID, this.getMetadataWithOffset(Block.stairsCobblestone.blockID, 3), 2, 0, -1, var3); +- } +- +- this.placeBlockAtCurrentPosition(var1, 0, 0, 6, 1, 5, var3); +- this.placeBlockAtCurrentPosition(var1, 0, 0, 6, 2, 5, var3); +- this.placeBlockAtCurrentPosition(var1, Block.torchWood.blockID, 0, 6, 3, 4, var3); +- this.placeDoorAtCurrentPosition(var1, var3, var2, 6, 1, 5, this.getMetadataWithOffset(Block.doorWood.blockID, 1)); +- +- for(var6 = 0; var6 < 5; ++var6) { +- for(var7 = 0; var7 < 9; ++var7) { +- this.clearCurrentPositionBlocksUpwards(var1, var7, 7, var6, var3); +- this.fillCurrentPositionBlocksDownwards(var1, Block.cobblestone.blockID, 0, var7, -1, var6, var3); +- } +- } +- +- this.spawnVillagers(var1, var3, 4, 1, 2, 2); ++ ++ for (var6 = -1; var6 <= 2; ++var6) { ++ for (var7 = 0; var7 <= 8; ++var7) { ++ this.placeBlockAtCurrentPosition(par1World, Block.stairsWoodOak.blockID, var4, var7, 4 + var6, var6, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.stairsWoodOak.blockID, var5, var7, 4 + var6, 5 - var6, par3StructureBoundingBox); ++ } ++ } ++ ++ this.placeBlockAtCurrentPosition(par1World, Block.wood.blockID, 0, 0, 2, 1, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.wood.blockID, 0, 0, 2, 4, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.wood.blockID, 0, 8, 2, 1, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.wood.blockID, 0, 8, 2, 4, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.thinGlass.blockID, 0, 0, 2, 2, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.thinGlass.blockID, 0, 0, 2, 3, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.thinGlass.blockID, 0, 8, 2, 2, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.thinGlass.blockID, 0, 8, 2, 3, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.thinGlass.blockID, 0, 2, 2, 5, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.thinGlass.blockID, 0, 3, 2, 5, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.thinGlass.blockID, 0, 5, 2, 0, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.thinGlass.blockID, 0, 6, 2, 5, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.fence.blockID, 0, 2, 1, 3, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.pressurePlatePlanks.blockID, 0, 2, 2, 3, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.planks.blockID, 0, 1, 1, 4, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.stairsWoodOak.blockID, this.getMetadataWithOffset(Block.stairsWoodOak.blockID, 3), 2, 1, 4, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.stairsWoodOak.blockID, this.getMetadataWithOffset(Block.stairsWoodOak.blockID, 1), 1, 1, 3, par3StructureBoundingBox); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 5, 0, 1, 7, 0, 3, Block.stoneDoubleSlab.blockID, Block.stoneDoubleSlab.blockID, false); ++ this.placeBlockAtCurrentPosition(par1World, Block.stoneDoubleSlab.blockID, 0, 6, 1, 1, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.stoneDoubleSlab.blockID, 0, 6, 1, 2, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, 0, 0, 2, 1, 0, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, 0, 0, 2, 2, 0, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.torchWood.blockID, 0, 2, 3, 1, par3StructureBoundingBox); ++ this.placeDoorAtCurrentPosition(par1World, par3StructureBoundingBox, par2Random, 2, 1, 0, this.getMetadataWithOffset(Block.doorWood.blockID, 1)); ++ ++ if (this.getBlockIdAtCurrentPosition(par1World, 2, 0, -1, par3StructureBoundingBox) == 0 && this.getBlockIdAtCurrentPosition(par1World, 2, -1, -1, par3StructureBoundingBox) != 0) { ++ this.placeBlockAtCurrentPosition(par1World, Block.stairsCobblestone.blockID, this.getMetadataWithOffset(Block.stairsCobblestone.blockID, 3), 2, 0, -1, par3StructureBoundingBox); ++ } ++ ++ this.placeBlockAtCurrentPosition(par1World, 0, 0, 6, 1, 5, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, 0, 0, 6, 2, 5, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.torchWood.blockID, 0, 6, 3, 4, par3StructureBoundingBox); ++ this.placeDoorAtCurrentPosition(par1World, par3StructureBoundingBox, par2Random, 6, 1, 5, this.getMetadataWithOffset(Block.doorWood.blockID, 1)); ++ ++ for (var6 = 0; var6 < 5; ++var6) { ++ for (var7 = 0; var7 < 9; ++var7) { ++ this.clearCurrentPositionBlocksUpwards(par1World, var7, 7, var6, par3StructureBoundingBox); ++ this.fillCurrentPositionBlocksDownwards(par1World, Block.cobblestone.blockID, 0, var7, -1, var6, par3StructureBoundingBox); ++ } ++ } ++ ++ this.spawnVillagers(par1World, par3StructureBoundingBox, 4, 1, 2, 2); + return true; + } + +- protected int getVillagerType(int var1) { +- return var1 == 0 ? 4 : 0; ++ /** ++ * Returns the villager type to spawn in this component, based on the number of villagers already spawned. ++ */ ++ protected int getVillagerType(int par1) { ++ return par1 == 0 ? 4 : 0; + } + } diff --git a/patches/net/minecraft/src/ComponentVillageHouse1.java.patch b/patches/net/minecraft/src/ComponentVillageHouse1.java.patch new file mode 100644 index 0000000..2222697 --- /dev/null +++ b/patches/net/minecraft/src/ComponentVillageHouse1.java.patch @@ -0,0 +1,205 @@ +--- net/minecraft/src/ComponentVillageHouse1.java ++++ net/minecraft/src/ComponentVillageHouse1.java +@@ -4,111 +4,119 @@ + import java.util.Random; + + public class ComponentVillageHouse1 extends ComponentVillage { +- public ComponentVillageHouse1() { +- } +- +- public ComponentVillageHouse1(ComponentVillageStartPiece var1, int var2, Random var3, StructureBoundingBox var4, int var5) { +- super(var1, var2); +- this.coordBaseMode = var5; +- this.boundingBox = var4; +- } +- +- public static ComponentVillageHouse1 func_74898_a(ComponentVillageStartPiece var0, List var1, Random var2, int var3, int var4, int var5, int var6, int var7) { +- StructureBoundingBox var8 = StructureBoundingBox.getComponentToAddBoundingBox(var3, var4, var5, 0, 0, 0, 9, 9, 6, var6); +- return canVillageGoDeeper(var8) && StructureComponent.findIntersecting(var1, var8) == null ? new ComponentVillageHouse1(var0, var7, var2, var8, var6) : null; +- } +- +- public boolean addComponentParts(World var1, Random var2, StructureBoundingBox var3) { +- if(this.field_143015_k < 0) { +- this.field_143015_k = this.getAverageGroundLevel(var1, var3); +- if(this.field_143015_k < 0) { ++ public ComponentVillageHouse1() {} ++ ++ public ComponentVillageHouse1(ComponentVillageStartPiece par1ComponentVillageStartPiece, int par2, Random par3Random, StructureBoundingBox par4StructureBoundingBox, int par5) { ++ super(par1ComponentVillageStartPiece, par2); ++ this.coordBaseMode = par5; ++ this.boundingBox = par4StructureBoundingBox; ++ } ++ ++ public static ComponentVillageHouse1 func_74898_a(ComponentVillageStartPiece par0ComponentVillageStartPiece, List par1List, Random par2Random, int par3, int par4, int par5, int par6, int par7) { ++ StructureBoundingBox var8 = StructureBoundingBox.getComponentToAddBoundingBox(par3, par4, par5, 0, 0, 0, 9, 9, 6, par6); ++ return canVillageGoDeeper(var8) && StructureComponent.findIntersecting(par1List, var8) == null ? new ComponentVillageHouse1(par0ComponentVillageStartPiece, par7, par2Random, var8, par6) : null; ++ } ++ ++ /** ++ * second Part of Structure generating, this for example places Spiderwebs, Mob Spawners, it closes Mineshafts at the ++ * end, it adds Fences... ++ */ ++ public boolean addComponentParts(World par1World, Random par2Random, StructureBoundingBox par3StructureBoundingBox) { ++ if (this.field_143015_k < 0) { ++ this.field_143015_k = this.getAverageGroundLevel(par1World, par3StructureBoundingBox); ++ ++ if (this.field_143015_k < 0) { + return true; + } + + this.boundingBox.offset(0, this.field_143015_k - this.boundingBox.maxY + 9 - 1, 0); + } + +- this.fillWithBlocks(var1, var3, 1, 1, 1, 7, 5, 4, 0, 0, false); +- this.fillWithBlocks(var1, var3, 0, 0, 0, 8, 0, 5, Block.cobblestone.blockID, Block.cobblestone.blockID, false); +- this.fillWithBlocks(var1, var3, 0, 5, 0, 8, 5, 5, Block.cobblestone.blockID, Block.cobblestone.blockID, false); +- this.fillWithBlocks(var1, var3, 0, 6, 1, 8, 6, 4, Block.cobblestone.blockID, Block.cobblestone.blockID, false); +- this.fillWithBlocks(var1, var3, 0, 7, 2, 8, 7, 3, Block.cobblestone.blockID, Block.cobblestone.blockID, false); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 1, 1, 1, 7, 5, 4, 0, 0, false); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 0, 0, 0, 8, 0, 5, Block.cobblestone.blockID, Block.cobblestone.blockID, false); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 0, 5, 0, 8, 5, 5, Block.cobblestone.blockID, Block.cobblestone.blockID, false); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 0, 6, 1, 8, 6, 4, Block.cobblestone.blockID, Block.cobblestone.blockID, false); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 0, 7, 2, 8, 7, 3, Block.cobblestone.blockID, Block.cobblestone.blockID, false); + int var4 = this.getMetadataWithOffset(Block.stairsWoodOak.blockID, 3); + int var5 = this.getMetadataWithOffset(Block.stairsWoodOak.blockID, 2); +- + int var6; + int var7; +- for(var6 = -1; var6 <= 2; ++var6) { +- for(var7 = 0; var7 <= 8; ++var7) { +- this.placeBlockAtCurrentPosition(var1, Block.stairsWoodOak.blockID, var4, var7, 6 + var6, var6, var3); +- this.placeBlockAtCurrentPosition(var1, Block.stairsWoodOak.blockID, var5, var7, 6 + var6, 5 - var6, var3); ++ ++ for (var6 = -1; var6 <= 2; ++var6) { ++ for (var7 = 0; var7 <= 8; ++var7) { ++ this.placeBlockAtCurrentPosition(par1World, Block.stairsWoodOak.blockID, var4, var7, 6 + var6, var6, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.stairsWoodOak.blockID, var5, var7, 6 + var6, 5 - var6, par3StructureBoundingBox); + } + } + +- this.fillWithBlocks(var1, var3, 0, 1, 0, 0, 1, 5, Block.cobblestone.blockID, Block.cobblestone.blockID, false); +- this.fillWithBlocks(var1, var3, 1, 1, 5, 8, 1, 5, Block.cobblestone.blockID, Block.cobblestone.blockID, false); +- this.fillWithBlocks(var1, var3, 8, 1, 0, 8, 1, 4, Block.cobblestone.blockID, Block.cobblestone.blockID, false); +- this.fillWithBlocks(var1, var3, 2, 1, 0, 7, 1, 0, Block.cobblestone.blockID, Block.cobblestone.blockID, false); +- this.fillWithBlocks(var1, var3, 0, 2, 0, 0, 4, 0, Block.cobblestone.blockID, Block.cobblestone.blockID, false); +- this.fillWithBlocks(var1, var3, 0, 2, 5, 0, 4, 5, Block.cobblestone.blockID, Block.cobblestone.blockID, false); +- this.fillWithBlocks(var1, var3, 8, 2, 5, 8, 4, 5, Block.cobblestone.blockID, Block.cobblestone.blockID, false); +- this.fillWithBlocks(var1, var3, 8, 2, 0, 8, 4, 0, Block.cobblestone.blockID, Block.cobblestone.blockID, false); +- this.fillWithBlocks(var1, var3, 0, 2, 1, 0, 4, 4, Block.planks.blockID, Block.planks.blockID, false); +- this.fillWithBlocks(var1, var3, 1, 2, 5, 7, 4, 5, Block.planks.blockID, Block.planks.blockID, false); +- this.fillWithBlocks(var1, var3, 8, 2, 1, 8, 4, 4, Block.planks.blockID, Block.planks.blockID, false); +- this.fillWithBlocks(var1, var3, 1, 2, 0, 7, 4, 0, Block.planks.blockID, Block.planks.blockID, false); +- this.placeBlockAtCurrentPosition(var1, Block.thinGlass.blockID, 0, 4, 2, 0, var3); +- this.placeBlockAtCurrentPosition(var1, Block.thinGlass.blockID, 0, 5, 2, 0, var3); +- this.placeBlockAtCurrentPosition(var1, Block.thinGlass.blockID, 0, 6, 2, 0, var3); +- this.placeBlockAtCurrentPosition(var1, Block.thinGlass.blockID, 0, 4, 3, 0, var3); +- this.placeBlockAtCurrentPosition(var1, Block.thinGlass.blockID, 0, 5, 3, 0, var3); +- this.placeBlockAtCurrentPosition(var1, Block.thinGlass.blockID, 0, 6, 3, 0, var3); +- this.placeBlockAtCurrentPosition(var1, Block.thinGlass.blockID, 0, 0, 2, 2, var3); +- this.placeBlockAtCurrentPosition(var1, Block.thinGlass.blockID, 0, 0, 2, 3, var3); +- this.placeBlockAtCurrentPosition(var1, Block.thinGlass.blockID, 0, 0, 3, 2, var3); +- this.placeBlockAtCurrentPosition(var1, Block.thinGlass.blockID, 0, 0, 3, 3, var3); +- this.placeBlockAtCurrentPosition(var1, Block.thinGlass.blockID, 0, 8, 2, 2, var3); +- this.placeBlockAtCurrentPosition(var1, Block.thinGlass.blockID, 0, 8, 2, 3, var3); +- this.placeBlockAtCurrentPosition(var1, Block.thinGlass.blockID, 0, 8, 3, 2, var3); +- this.placeBlockAtCurrentPosition(var1, Block.thinGlass.blockID, 0, 8, 3, 3, var3); +- this.placeBlockAtCurrentPosition(var1, Block.thinGlass.blockID, 0, 2, 2, 5, var3); +- this.placeBlockAtCurrentPosition(var1, Block.thinGlass.blockID, 0, 3, 2, 5, var3); +- this.placeBlockAtCurrentPosition(var1, Block.thinGlass.blockID, 0, 5, 2, 5, var3); +- this.placeBlockAtCurrentPosition(var1, Block.thinGlass.blockID, 0, 6, 2, 5, var3); +- this.fillWithBlocks(var1, var3, 1, 4, 1, 7, 4, 1, Block.planks.blockID, Block.planks.blockID, false); +- this.fillWithBlocks(var1, var3, 1, 4, 4, 7, 4, 4, Block.planks.blockID, Block.planks.blockID, false); +- this.fillWithBlocks(var1, var3, 1, 3, 4, 7, 3, 4, Block.bookShelf.blockID, Block.bookShelf.blockID, false); +- this.placeBlockAtCurrentPosition(var1, Block.planks.blockID, 0, 7, 1, 4, var3); +- this.placeBlockAtCurrentPosition(var1, Block.stairsWoodOak.blockID, this.getMetadataWithOffset(Block.stairsWoodOak.blockID, 0), 7, 1, 3, var3); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 0, 1, 0, 0, 1, 5, Block.cobblestone.blockID, Block.cobblestone.blockID, false); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 1, 1, 5, 8, 1, 5, Block.cobblestone.blockID, Block.cobblestone.blockID, false); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 8, 1, 0, 8, 1, 4, Block.cobblestone.blockID, Block.cobblestone.blockID, false); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 2, 1, 0, 7, 1, 0, Block.cobblestone.blockID, Block.cobblestone.blockID, false); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 0, 2, 0, 0, 4, 0, Block.cobblestone.blockID, Block.cobblestone.blockID, false); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 0, 2, 5, 0, 4, 5, Block.cobblestone.blockID, Block.cobblestone.blockID, false); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 8, 2, 5, 8, 4, 5, Block.cobblestone.blockID, Block.cobblestone.blockID, false); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 8, 2, 0, 8, 4, 0, Block.cobblestone.blockID, Block.cobblestone.blockID, false); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 0, 2, 1, 0, 4, 4, Block.planks.blockID, Block.planks.blockID, false); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 1, 2, 5, 7, 4, 5, Block.planks.blockID, Block.planks.blockID, false); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 8, 2, 1, 8, 4, 4, Block.planks.blockID, Block.planks.blockID, false); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 1, 2, 0, 7, 4, 0, Block.planks.blockID, Block.planks.blockID, false); ++ this.placeBlockAtCurrentPosition(par1World, Block.thinGlass.blockID, 0, 4, 2, 0, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.thinGlass.blockID, 0, 5, 2, 0, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.thinGlass.blockID, 0, 6, 2, 0, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.thinGlass.blockID, 0, 4, 3, 0, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.thinGlass.blockID, 0, 5, 3, 0, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.thinGlass.blockID, 0, 6, 3, 0, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.thinGlass.blockID, 0, 0, 2, 2, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.thinGlass.blockID, 0, 0, 2, 3, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.thinGlass.blockID, 0, 0, 3, 2, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.thinGlass.blockID, 0, 0, 3, 3, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.thinGlass.blockID, 0, 8, 2, 2, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.thinGlass.blockID, 0, 8, 2, 3, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.thinGlass.blockID, 0, 8, 3, 2, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.thinGlass.blockID, 0, 8, 3, 3, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.thinGlass.blockID, 0, 2, 2, 5, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.thinGlass.blockID, 0, 3, 2, 5, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.thinGlass.blockID, 0, 5, 2, 5, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.thinGlass.blockID, 0, 6, 2, 5, par3StructureBoundingBox); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 1, 4, 1, 7, 4, 1, Block.planks.blockID, Block.planks.blockID, false); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 1, 4, 4, 7, 4, 4, Block.planks.blockID, Block.planks.blockID, false); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 1, 3, 4, 7, 3, 4, Block.bookShelf.blockID, Block.bookShelf.blockID, false); ++ this.placeBlockAtCurrentPosition(par1World, Block.planks.blockID, 0, 7, 1, 4, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.stairsWoodOak.blockID, this.getMetadataWithOffset(Block.stairsWoodOak.blockID, 0), 7, 1, 3, par3StructureBoundingBox); + var6 = this.getMetadataWithOffset(Block.stairsWoodOak.blockID, 3); +- this.placeBlockAtCurrentPosition(var1, Block.stairsWoodOak.blockID, var6, 6, 1, 4, var3); +- this.placeBlockAtCurrentPosition(var1, Block.stairsWoodOak.blockID, var6, 5, 1, 4, var3); +- this.placeBlockAtCurrentPosition(var1, Block.stairsWoodOak.blockID, var6, 4, 1, 4, var3); +- this.placeBlockAtCurrentPosition(var1, Block.stairsWoodOak.blockID, var6, 3, 1, 4, var3); +- this.placeBlockAtCurrentPosition(var1, Block.fence.blockID, 0, 6, 1, 3, var3); +- this.placeBlockAtCurrentPosition(var1, Block.pressurePlatePlanks.blockID, 0, 6, 2, 3, var3); +- this.placeBlockAtCurrentPosition(var1, Block.fence.blockID, 0, 4, 1, 3, var3); +- this.placeBlockAtCurrentPosition(var1, Block.pressurePlatePlanks.blockID, 0, 4, 2, 3, var3); +- this.placeBlockAtCurrentPosition(var1, Block.workbench.blockID, 0, 7, 1, 1, var3); +- this.placeBlockAtCurrentPosition(var1, 0, 0, 1, 1, 0, var3); +- this.placeBlockAtCurrentPosition(var1, 0, 0, 1, 2, 0, var3); +- this.placeDoorAtCurrentPosition(var1, var3, var2, 1, 1, 0, this.getMetadataWithOffset(Block.doorWood.blockID, 1)); +- if(this.getBlockIdAtCurrentPosition(var1, 1, 0, -1, var3) == 0 && this.getBlockIdAtCurrentPosition(var1, 1, -1, -1, var3) != 0) { +- this.placeBlockAtCurrentPosition(var1, Block.stairsCobblestone.blockID, this.getMetadataWithOffset(Block.stairsCobblestone.blockID, 3), 1, 0, -1, var3); ++ this.placeBlockAtCurrentPosition(par1World, Block.stairsWoodOak.blockID, var6, 6, 1, 4, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.stairsWoodOak.blockID, var6, 5, 1, 4, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.stairsWoodOak.blockID, var6, 4, 1, 4, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.stairsWoodOak.blockID, var6, 3, 1, 4, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.fence.blockID, 0, 6, 1, 3, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.pressurePlatePlanks.blockID, 0, 6, 2, 3, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.fence.blockID, 0, 4, 1, 3, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.pressurePlatePlanks.blockID, 0, 4, 2, 3, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.workbench.blockID, 0, 7, 1, 1, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, 0, 0, 1, 1, 0, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, 0, 0, 1, 2, 0, par3StructureBoundingBox); ++ this.placeDoorAtCurrentPosition(par1World, par3StructureBoundingBox, par2Random, 1, 1, 0, this.getMetadataWithOffset(Block.doorWood.blockID, 1)); ++ ++ if (this.getBlockIdAtCurrentPosition(par1World, 1, 0, -1, par3StructureBoundingBox) == 0 && this.getBlockIdAtCurrentPosition(par1World, 1, -1, -1, par3StructureBoundingBox) != 0) { ++ this.placeBlockAtCurrentPosition(par1World, Block.stairsCobblestone.blockID, this.getMetadataWithOffset(Block.stairsCobblestone.blockID, 3), 1, 0, -1, par3StructureBoundingBox); + } + +- for(var7 = 0; var7 < 6; ++var7) { +- for(int var8 = 0; var8 < 9; ++var8) { +- this.clearCurrentPositionBlocksUpwards(var1, var8, 9, var7, var3); +- this.fillCurrentPositionBlocksDownwards(var1, Block.cobblestone.blockID, 0, var8, -1, var7, var3); ++ for (var7 = 0; var7 < 6; ++var7) { ++ for (int var8 = 0; var8 < 9; ++var8) { ++ this.clearCurrentPositionBlocksUpwards(par1World, var8, 9, var7, par3StructureBoundingBox); ++ this.fillCurrentPositionBlocksDownwards(par1World, Block.cobblestone.blockID, 0, var8, -1, var7, par3StructureBoundingBox); + } + } + +- this.spawnVillagers(var1, var3, 2, 1, 2, 1); ++ this.spawnVillagers(par1World, par3StructureBoundingBox, 2, 1, 2, 1); + return true; + } + +- protected int getVillagerType(int var1) { ++ /** ++ * Returns the villager type to spawn in this component, based on the number of villagers already spawned. ++ */ ++ protected int getVillagerType(int par1) { + return 1; + } + } diff --git a/patches/net/minecraft/src/ComponentVillageHouse2.java.patch b/patches/net/minecraft/src/ComponentVillageHouse2.java.patch new file mode 100644 index 0000000..a3b3bc1 --- /dev/null +++ b/patches/net/minecraft/src/ComponentVillageHouse2.java.patch @@ -0,0 +1,207 @@ +--- net/minecraft/src/ComponentVillageHouse2.java ++++ net/minecraft/src/ComponentVillageHouse2.java +@@ -4,108 +4,119 @@ + import java.util.Random; + + public class ComponentVillageHouse2 extends ComponentVillage { +- private static final WeightedRandomChestContent[] villageBlacksmithChestContents = new WeightedRandomChestContent[]{new WeightedRandomChestContent(Item.diamond.itemID, 0, 1, 3, 3), new WeightedRandomChestContent(Item.ingotIron.itemID, 0, 1, 5, 10), new WeightedRandomChestContent(Item.ingotGold.itemID, 0, 1, 3, 5), new WeightedRandomChestContent(Item.bread.itemID, 0, 1, 3, 15), new WeightedRandomChestContent(Item.appleRed.itemID, 0, 1, 3, 15), new WeightedRandomChestContent(Item.pickaxeIron.itemID, 0, 1, 1, 5), new WeightedRandomChestContent(Item.swordIron.itemID, 0, 1, 1, 5), new WeightedRandomChestContent(Item.plateIron.itemID, 0, 1, 1, 5), new WeightedRandomChestContent(Item.helmetIron.itemID, 0, 1, 1, 5), new WeightedRandomChestContent(Item.legsIron.itemID, 0, 1, 1, 5), new WeightedRandomChestContent(Item.bootsIron.itemID, 0, 1, 1, 5), new WeightedRandomChestContent(Block.obsidian.blockID, 0, 3, 7, 5), new WeightedRandomChestContent(Block.sapling.blockID, 0, 3, 7, 5), new WeightedRandomChestContent(Item.saddle.itemID, 0, 1, 1, 3), new WeightedRandomChestContent(Item.horseArmorIron.itemID, 0, 1, 1, 1), new WeightedRandomChestContent(Item.horseArmorGold.itemID, 0, 1, 1, 1), new WeightedRandomChestContent(Item.horseArmorDiamond.itemID, 0, 1, 1, 1)}; ++ ++ /** List of items that Village's Blacksmith chest can contain. */ ++ private static final WeightedRandomChestContent[] villageBlacksmithChestContents = new WeightedRandomChestContent[] {new WeightedRandomChestContent(Item.diamond.itemID, 0, 1, 3, 3), new WeightedRandomChestContent(Item.ingotIron.itemID, 0, 1, 5, 10), new WeightedRandomChestContent(Item.ingotGold.itemID, 0, 1, 3, 5), new WeightedRandomChestContent(Item.bread.itemID, 0, 1, 3, 15), new WeightedRandomChestContent(Item.appleRed.itemID, 0, 1, 3, 15), new WeightedRandomChestContent(Item.pickaxeIron.itemID, 0, 1, 1, 5), new WeightedRandomChestContent(Item.swordIron.itemID, 0, 1, 1, 5), new WeightedRandomChestContent(Item.plateIron.itemID, 0, 1, 1, 5), new WeightedRandomChestContent(Item.helmetIron.itemID, 0, 1, 1, 5), new WeightedRandomChestContent(Item.legsIron.itemID, 0, 1, 1, 5), new WeightedRandomChestContent(Item.bootsIron.itemID, 0, 1, 1, 5), new WeightedRandomChestContent(Block.obsidian.blockID, 0, 3, 7, 5), new WeightedRandomChestContent(Block.sapling.blockID, 0, 3, 7, 5), new WeightedRandomChestContent(Item.saddle.itemID, 0, 1, 1, 3), new WeightedRandomChestContent(Item.horseArmorIron.itemID, 0, 1, 1, 1), new WeightedRandomChestContent(Item.horseArmorGold.itemID, 0, 1, 1, 1), new WeightedRandomChestContent(Item.horseArmorDiamond.itemID, 0, 1, 1, 1)}; + private boolean hasMadeChest; + +- public ComponentVillageHouse2() { +- } +- +- public ComponentVillageHouse2(ComponentVillageStartPiece var1, int var2, Random var3, StructureBoundingBox var4, int var5) { +- super(var1, var2); +- this.coordBaseMode = var5; +- this.boundingBox = var4; +- } +- +- public static ComponentVillageHouse2 func_74915_a(ComponentVillageStartPiece var0, List var1, Random var2, int var3, int var4, int var5, int var6, int var7) { +- StructureBoundingBox var8 = StructureBoundingBox.getComponentToAddBoundingBox(var3, var4, var5, 0, 0, 0, 10, 6, 7, var6); +- return canVillageGoDeeper(var8) && StructureComponent.findIntersecting(var1, var8) == null ? new ComponentVillageHouse2(var0, var7, var2, var8, var6) : null; +- } +- +- protected void func_143012_a(NBTTagCompound var1) { +- super.func_143012_a(var1); +- var1.setBoolean("Chest", this.hasMadeChest); +- } +- +- protected void func_143011_b(NBTTagCompound var1) { +- super.func_143011_b(var1); +- this.hasMadeChest = var1.getBoolean("Chest"); +- } +- +- public boolean addComponentParts(World var1, Random var2, StructureBoundingBox var3) { +- if(this.field_143015_k < 0) { +- this.field_143015_k = this.getAverageGroundLevel(var1, var3); +- if(this.field_143015_k < 0) { ++ public ComponentVillageHouse2() {} ++ ++ public ComponentVillageHouse2(ComponentVillageStartPiece par1ComponentVillageStartPiece, int par2, Random par3Random, StructureBoundingBox par4StructureBoundingBox, int par5) { ++ super(par1ComponentVillageStartPiece, par2); ++ this.coordBaseMode = par5; ++ this.boundingBox = par4StructureBoundingBox; ++ } ++ ++ public static ComponentVillageHouse2 func_74915_a(ComponentVillageStartPiece par0ComponentVillageStartPiece, List par1List, Random par2Random, int par3, int par4, int par5, int par6, int par7) { ++ StructureBoundingBox var8 = StructureBoundingBox.getComponentToAddBoundingBox(par3, par4, par5, 0, 0, 0, 10, 6, 7, par6); ++ return canVillageGoDeeper(var8) && StructureComponent.findIntersecting(par1List, var8) == null ? new ComponentVillageHouse2(par0ComponentVillageStartPiece, par7, par2Random, var8, par6) : null; ++ } ++ ++ protected void func_143012_a(NBTTagCompound par1NBTTagCompound) { ++ super.func_143012_a(par1NBTTagCompound); ++ par1NBTTagCompound.setBoolean("Chest", this.hasMadeChest); ++ } ++ ++ protected void func_143011_b(NBTTagCompound par1NBTTagCompound) { ++ super.func_143011_b(par1NBTTagCompound); ++ this.hasMadeChest = par1NBTTagCompound.getBoolean("Chest"); ++ } ++ ++ /** ++ * second Part of Structure generating, this for example places Spiderwebs, Mob Spawners, it closes Mineshafts at the ++ * end, it adds Fences... ++ */ ++ public boolean addComponentParts(World par1World, Random par2Random, StructureBoundingBox par3StructureBoundingBox) { ++ if (this.field_143015_k < 0) { ++ this.field_143015_k = this.getAverageGroundLevel(par1World, par3StructureBoundingBox); ++ ++ if (this.field_143015_k < 0) { + return true; + } + + this.boundingBox.offset(0, this.field_143015_k - this.boundingBox.maxY + 6 - 1, 0); + } + +- this.fillWithBlocks(var1, var3, 0, 1, 0, 9, 4, 6, 0, 0, false); +- this.fillWithBlocks(var1, var3, 0, 0, 0, 9, 0, 6, Block.cobblestone.blockID, Block.cobblestone.blockID, false); +- this.fillWithBlocks(var1, var3, 0, 4, 0, 9, 4, 6, Block.cobblestone.blockID, Block.cobblestone.blockID, false); +- this.fillWithBlocks(var1, var3, 0, 5, 0, 9, 5, 6, Block.stoneSingleSlab.blockID, Block.stoneSingleSlab.blockID, false); +- this.fillWithBlocks(var1, var3, 1, 5, 1, 8, 5, 5, 0, 0, false); +- this.fillWithBlocks(var1, var3, 1, 1, 0, 2, 3, 0, Block.planks.blockID, Block.planks.blockID, false); +- this.fillWithBlocks(var1, var3, 0, 1, 0, 0, 4, 0, Block.wood.blockID, Block.wood.blockID, false); +- this.fillWithBlocks(var1, var3, 3, 1, 0, 3, 4, 0, Block.wood.blockID, Block.wood.blockID, false); +- this.fillWithBlocks(var1, var3, 0, 1, 6, 0, 4, 6, Block.wood.blockID, Block.wood.blockID, false); +- this.placeBlockAtCurrentPosition(var1, Block.planks.blockID, 0, 3, 3, 1, var3); +- this.fillWithBlocks(var1, var3, 3, 1, 2, 3, 3, 2, Block.planks.blockID, Block.planks.blockID, false); +- this.fillWithBlocks(var1, var3, 4, 1, 3, 5, 3, 3, Block.planks.blockID, Block.planks.blockID, false); +- this.fillWithBlocks(var1, var3, 0, 1, 1, 0, 3, 5, Block.planks.blockID, Block.planks.blockID, false); +- this.fillWithBlocks(var1, var3, 1, 1, 6, 5, 3, 6, Block.planks.blockID, Block.planks.blockID, false); +- this.fillWithBlocks(var1, var3, 5, 1, 0, 5, 3, 0, Block.fence.blockID, Block.fence.blockID, false); +- this.fillWithBlocks(var1, var3, 9, 1, 0, 9, 3, 0, Block.fence.blockID, Block.fence.blockID, false); +- this.fillWithBlocks(var1, var3, 6, 1, 4, 9, 4, 6, Block.cobblestone.blockID, Block.cobblestone.blockID, false); +- this.placeBlockAtCurrentPosition(var1, Block.lavaMoving.blockID, 0, 7, 1, 5, var3); +- this.placeBlockAtCurrentPosition(var1, Block.lavaMoving.blockID, 0, 8, 1, 5, var3); +- this.placeBlockAtCurrentPosition(var1, Block.fenceIron.blockID, 0, 9, 2, 5, var3); +- this.placeBlockAtCurrentPosition(var1, Block.fenceIron.blockID, 0, 9, 2, 4, var3); +- this.fillWithBlocks(var1, var3, 7, 2, 4, 8, 2, 5, 0, 0, false); +- this.placeBlockAtCurrentPosition(var1, Block.cobblestone.blockID, 0, 6, 1, 3, var3); +- this.placeBlockAtCurrentPosition(var1, Block.furnaceIdle.blockID, 0, 6, 2, 3, var3); +- this.placeBlockAtCurrentPosition(var1, Block.furnaceIdle.blockID, 0, 6, 3, 3, var3); +- this.placeBlockAtCurrentPosition(var1, Block.stoneDoubleSlab.blockID, 0, 8, 1, 1, var3); +- this.placeBlockAtCurrentPosition(var1, Block.thinGlass.blockID, 0, 0, 2, 2, var3); +- this.placeBlockAtCurrentPosition(var1, Block.thinGlass.blockID, 0, 0, 2, 4, var3); +- this.placeBlockAtCurrentPosition(var1, Block.thinGlass.blockID, 0, 2, 2, 6, var3); +- this.placeBlockAtCurrentPosition(var1, Block.thinGlass.blockID, 0, 4, 2, 6, var3); +- this.placeBlockAtCurrentPosition(var1, Block.fence.blockID, 0, 2, 1, 4, var3); +- this.placeBlockAtCurrentPosition(var1, Block.pressurePlatePlanks.blockID, 0, 2, 2, 4, var3); +- this.placeBlockAtCurrentPosition(var1, Block.planks.blockID, 0, 1, 1, 5, var3); +- this.placeBlockAtCurrentPosition(var1, Block.stairsWoodOak.blockID, this.getMetadataWithOffset(Block.stairsWoodOak.blockID, 3), 2, 1, 5, var3); +- this.placeBlockAtCurrentPosition(var1, Block.stairsWoodOak.blockID, this.getMetadataWithOffset(Block.stairsWoodOak.blockID, 1), 1, 1, 4, var3); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 0, 1, 0, 9, 4, 6, 0, 0, false); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 0, 0, 0, 9, 0, 6, Block.cobblestone.blockID, Block.cobblestone.blockID, false); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 0, 4, 0, 9, 4, 6, Block.cobblestone.blockID, Block.cobblestone.blockID, false); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 0, 5, 0, 9, 5, 6, Block.stoneSingleSlab.blockID, Block.stoneSingleSlab.blockID, false); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 1, 5, 1, 8, 5, 5, 0, 0, false); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 1, 1, 0, 2, 3, 0, Block.planks.blockID, Block.planks.blockID, false); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 0, 1, 0, 0, 4, 0, Block.wood.blockID, Block.wood.blockID, false); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 3, 1, 0, 3, 4, 0, Block.wood.blockID, Block.wood.blockID, false); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 0, 1, 6, 0, 4, 6, Block.wood.blockID, Block.wood.blockID, false); ++ this.placeBlockAtCurrentPosition(par1World, Block.planks.blockID, 0, 3, 3, 1, par3StructureBoundingBox); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 3, 1, 2, 3, 3, 2, Block.planks.blockID, Block.planks.blockID, false); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 4, 1, 3, 5, 3, 3, Block.planks.blockID, Block.planks.blockID, false); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 0, 1, 1, 0, 3, 5, Block.planks.blockID, Block.planks.blockID, false); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 1, 1, 6, 5, 3, 6, Block.planks.blockID, Block.planks.blockID, false); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 5, 1, 0, 5, 3, 0, Block.fence.blockID, Block.fence.blockID, false); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 9, 1, 0, 9, 3, 0, Block.fence.blockID, Block.fence.blockID, false); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 6, 1, 4, 9, 4, 6, Block.cobblestone.blockID, Block.cobblestone.blockID, false); ++ this.placeBlockAtCurrentPosition(par1World, Block.lavaMoving.blockID, 0, 7, 1, 5, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.lavaMoving.blockID, 0, 8, 1, 5, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.fenceIron.blockID, 0, 9, 2, 5, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.fenceIron.blockID, 0, 9, 2, 4, par3StructureBoundingBox); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 7, 2, 4, 8, 2, 5, 0, 0, false); ++ this.placeBlockAtCurrentPosition(par1World, Block.cobblestone.blockID, 0, 6, 1, 3, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.furnaceIdle.blockID, 0, 6, 2, 3, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.furnaceIdle.blockID, 0, 6, 3, 3, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.stoneDoubleSlab.blockID, 0, 8, 1, 1, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.thinGlass.blockID, 0, 0, 2, 2, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.thinGlass.blockID, 0, 0, 2, 4, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.thinGlass.blockID, 0, 2, 2, 6, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.thinGlass.blockID, 0, 4, 2, 6, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.fence.blockID, 0, 2, 1, 4, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.pressurePlatePlanks.blockID, 0, 2, 2, 4, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.planks.blockID, 0, 1, 1, 5, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.stairsWoodOak.blockID, this.getMetadataWithOffset(Block.stairsWoodOak.blockID, 3), 2, 1, 5, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.stairsWoodOak.blockID, this.getMetadataWithOffset(Block.stairsWoodOak.blockID, 1), 1, 1, 4, par3StructureBoundingBox); + int var4; + int var5; +- if(!this.hasMadeChest) { ++ ++ if (!this.hasMadeChest) { + var4 = this.getYWithOffset(1); + var5 = this.getXWithOffset(5, 5); + int var6 = this.getZWithOffset(5, 5); +- if(var3.isVecInside(var5, var4, var6)) { ++ ++ if (par3StructureBoundingBox.isVecInside(var5, var4, var6)) { + this.hasMadeChest = true; +- this.generateStructureChestContents(var1, var3, var2, 5, 1, 5, villageBlacksmithChestContents, 3 + var2.nextInt(6)); +- } +- } +- +- for(var4 = 6; var4 <= 8; ++var4) { +- if(this.getBlockIdAtCurrentPosition(var1, var4, 0, -1, var3) == 0 && this.getBlockIdAtCurrentPosition(var1, var4, -1, -1, var3) != 0) { +- this.placeBlockAtCurrentPosition(var1, Block.stairsCobblestone.blockID, this.getMetadataWithOffset(Block.stairsCobblestone.blockID, 3), var4, 0, -1, var3); +- } +- } +- +- for(var4 = 0; var4 < 7; ++var4) { +- for(var5 = 0; var5 < 10; ++var5) { +- this.clearCurrentPositionBlocksUpwards(var1, var5, 6, var4, var3); +- this.fillCurrentPositionBlocksDownwards(var1, Block.cobblestone.blockID, 0, var5, -1, var4, var3); +- } +- } +- +- this.spawnVillagers(var1, var3, 7, 1, 1, 1); ++ this.generateStructureChestContents(par1World, par3StructureBoundingBox, par2Random, 5, 1, 5, villageBlacksmithChestContents, 3 + par2Random.nextInt(6)); ++ } ++ } ++ ++ for (var4 = 6; var4 <= 8; ++var4) { ++ if (this.getBlockIdAtCurrentPosition(par1World, var4, 0, -1, par3StructureBoundingBox) == 0 && this.getBlockIdAtCurrentPosition(par1World, var4, -1, -1, par3StructureBoundingBox) != 0) { ++ this.placeBlockAtCurrentPosition(par1World, Block.stairsCobblestone.blockID, this.getMetadataWithOffset(Block.stairsCobblestone.blockID, 3), var4, 0, -1, par3StructureBoundingBox); ++ } ++ } ++ ++ for (var4 = 0; var4 < 7; ++var4) { ++ for (var5 = 0; var5 < 10; ++var5) { ++ this.clearCurrentPositionBlocksUpwards(par1World, var5, 6, var4, par3StructureBoundingBox); ++ this.fillCurrentPositionBlocksDownwards(par1World, Block.cobblestone.blockID, 0, var5, -1, var4, par3StructureBoundingBox); ++ } ++ } ++ ++ this.spawnVillagers(par1World, par3StructureBoundingBox, 7, 1, 1, 1); + return true; + } + +- protected int getVillagerType(int var1) { ++ /** ++ * Returns the villager type to spawn in this component, based on the number of villagers already spawned. ++ */ ++ protected int getVillagerType(int par1) { + return 3; + } + } diff --git a/patches/net/minecraft/src/ComponentVillageHouse3.java.patch b/patches/net/minecraft/src/ComponentVillageHouse3.java.patch new file mode 100644 index 0000000..5659839 --- /dev/null +++ b/patches/net/minecraft/src/ComponentVillageHouse3.java.patch @@ -0,0 +1,262 @@ +--- net/minecraft/src/ComponentVillageHouse3.java ++++ net/minecraft/src/ComponentVillageHouse3.java +@@ -4,140 +4,146 @@ + import java.util.Random; + + public class ComponentVillageHouse3 extends ComponentVillage { +- public ComponentVillageHouse3() { +- } +- +- public ComponentVillageHouse3(ComponentVillageStartPiece var1, int var2, Random var3, StructureBoundingBox var4, int var5) { +- super(var1, var2); +- this.coordBaseMode = var5; +- this.boundingBox = var4; +- } +- +- public static ComponentVillageHouse3 func_74921_a(ComponentVillageStartPiece var0, List var1, Random var2, int var3, int var4, int var5, int var6, int var7) { +- StructureBoundingBox var8 = StructureBoundingBox.getComponentToAddBoundingBox(var3, var4, var5, 0, 0, 0, 9, 7, 12, var6); +- return canVillageGoDeeper(var8) && StructureComponent.findIntersecting(var1, var8) == null ? new ComponentVillageHouse3(var0, var7, var2, var8, var6) : null; +- } +- +- public boolean addComponentParts(World var1, Random var2, StructureBoundingBox var3) { +- if(this.field_143015_k < 0) { +- this.field_143015_k = this.getAverageGroundLevel(var1, var3); +- if(this.field_143015_k < 0) { ++ public ComponentVillageHouse3() {} ++ ++ public ComponentVillageHouse3(ComponentVillageStartPiece par1ComponentVillageStartPiece, int par2, Random par3Random, StructureBoundingBox par4StructureBoundingBox, int par5) { ++ super(par1ComponentVillageStartPiece, par2); ++ this.coordBaseMode = par5; ++ this.boundingBox = par4StructureBoundingBox; ++ } ++ ++ public static ComponentVillageHouse3 func_74921_a(ComponentVillageStartPiece par0ComponentVillageStartPiece, List par1List, Random par2Random, int par3, int par4, int par5, int par6, int par7) { ++ StructureBoundingBox var8 = StructureBoundingBox.getComponentToAddBoundingBox(par3, par4, par5, 0, 0, 0, 9, 7, 12, par6); ++ return canVillageGoDeeper(var8) && StructureComponent.findIntersecting(par1List, var8) == null ? new ComponentVillageHouse3(par0ComponentVillageStartPiece, par7, par2Random, var8, par6) : null; ++ } ++ ++ /** ++ * second Part of Structure generating, this for example places Spiderwebs, Mob Spawners, it closes Mineshafts at the ++ * end, it adds Fences... ++ */ ++ public boolean addComponentParts(World par1World, Random par2Random, StructureBoundingBox par3StructureBoundingBox) { ++ if (this.field_143015_k < 0) { ++ this.field_143015_k = this.getAverageGroundLevel(par1World, par3StructureBoundingBox); ++ ++ if (this.field_143015_k < 0) { + return true; + } + + this.boundingBox.offset(0, this.field_143015_k - this.boundingBox.maxY + 7 - 1, 0); + } + +- this.fillWithBlocks(var1, var3, 1, 1, 1, 7, 4, 4, 0, 0, false); +- this.fillWithBlocks(var1, var3, 2, 1, 6, 8, 4, 10, 0, 0, false); +- this.fillWithBlocks(var1, var3, 2, 0, 5, 8, 0, 10, Block.planks.blockID, Block.planks.blockID, false); +- this.fillWithBlocks(var1, var3, 1, 0, 1, 7, 0, 4, Block.planks.blockID, Block.planks.blockID, false); +- this.fillWithBlocks(var1, var3, 0, 0, 0, 0, 3, 5, Block.cobblestone.blockID, Block.cobblestone.blockID, false); +- this.fillWithBlocks(var1, var3, 8, 0, 0, 8, 3, 10, Block.cobblestone.blockID, Block.cobblestone.blockID, false); +- this.fillWithBlocks(var1, var3, 1, 0, 0, 7, 2, 0, Block.cobblestone.blockID, Block.cobblestone.blockID, false); +- this.fillWithBlocks(var1, var3, 1, 0, 5, 2, 1, 5, Block.cobblestone.blockID, Block.cobblestone.blockID, false); +- this.fillWithBlocks(var1, var3, 2, 0, 6, 2, 3, 10, Block.cobblestone.blockID, Block.cobblestone.blockID, false); +- this.fillWithBlocks(var1, var3, 3, 0, 10, 7, 3, 10, Block.cobblestone.blockID, Block.cobblestone.blockID, false); +- this.fillWithBlocks(var1, var3, 1, 2, 0, 7, 3, 0, Block.planks.blockID, Block.planks.blockID, false); +- this.fillWithBlocks(var1, var3, 1, 2, 5, 2, 3, 5, Block.planks.blockID, Block.planks.blockID, false); +- this.fillWithBlocks(var1, var3, 0, 4, 1, 8, 4, 1, Block.planks.blockID, Block.planks.blockID, false); +- this.fillWithBlocks(var1, var3, 0, 4, 4, 3, 4, 4, Block.planks.blockID, Block.planks.blockID, false); +- this.fillWithBlocks(var1, var3, 0, 5, 2, 8, 5, 3, Block.planks.blockID, Block.planks.blockID, false); +- this.placeBlockAtCurrentPosition(var1, Block.planks.blockID, 0, 0, 4, 2, var3); +- this.placeBlockAtCurrentPosition(var1, Block.planks.blockID, 0, 0, 4, 3, var3); +- this.placeBlockAtCurrentPosition(var1, Block.planks.blockID, 0, 8, 4, 2, var3); +- this.placeBlockAtCurrentPosition(var1, Block.planks.blockID, 0, 8, 4, 3, var3); +- this.placeBlockAtCurrentPosition(var1, Block.planks.blockID, 0, 8, 4, 4, var3); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 1, 1, 1, 7, 4, 4, 0, 0, false); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 2, 1, 6, 8, 4, 10, 0, 0, false); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 2, 0, 5, 8, 0, 10, Block.planks.blockID, Block.planks.blockID, false); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 1, 0, 1, 7, 0, 4, Block.planks.blockID, Block.planks.blockID, false); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 0, 0, 0, 0, 3, 5, Block.cobblestone.blockID, Block.cobblestone.blockID, false); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 8, 0, 0, 8, 3, 10, Block.cobblestone.blockID, Block.cobblestone.blockID, false); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 1, 0, 0, 7, 2, 0, Block.cobblestone.blockID, Block.cobblestone.blockID, false); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 1, 0, 5, 2, 1, 5, Block.cobblestone.blockID, Block.cobblestone.blockID, false); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 2, 0, 6, 2, 3, 10, Block.cobblestone.blockID, Block.cobblestone.blockID, false); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 3, 0, 10, 7, 3, 10, Block.cobblestone.blockID, Block.cobblestone.blockID, false); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 1, 2, 0, 7, 3, 0, Block.planks.blockID, Block.planks.blockID, false); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 1, 2, 5, 2, 3, 5, Block.planks.blockID, Block.planks.blockID, false); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 0, 4, 1, 8, 4, 1, Block.planks.blockID, Block.planks.blockID, false); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 0, 4, 4, 3, 4, 4, Block.planks.blockID, Block.planks.blockID, false); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 0, 5, 2, 8, 5, 3, Block.planks.blockID, Block.planks.blockID, false); ++ this.placeBlockAtCurrentPosition(par1World, Block.planks.blockID, 0, 0, 4, 2, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.planks.blockID, 0, 0, 4, 3, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.planks.blockID, 0, 8, 4, 2, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.planks.blockID, 0, 8, 4, 3, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.planks.blockID, 0, 8, 4, 4, par3StructureBoundingBox); + int var4 = this.getMetadataWithOffset(Block.stairsWoodOak.blockID, 3); + int var5 = this.getMetadataWithOffset(Block.stairsWoodOak.blockID, 2); +- + int var6; + int var7; +- for(var6 = -1; var6 <= 2; ++var6) { +- for(var7 = 0; var7 <= 8; ++var7) { +- this.placeBlockAtCurrentPosition(var1, Block.stairsWoodOak.blockID, var4, var7, 4 + var6, var6, var3); +- if((var6 > -1 || var7 <= 1) && (var6 > 0 || var7 <= 3) && (var6 > 1 || var7 <= 4 || var7 >= 6)) { +- this.placeBlockAtCurrentPosition(var1, Block.stairsWoodOak.blockID, var5, var7, 4 + var6, 5 - var6, var3); ++ ++ for (var6 = -1; var6 <= 2; ++var6) { ++ for (var7 = 0; var7 <= 8; ++var7) { ++ this.placeBlockAtCurrentPosition(par1World, Block.stairsWoodOak.blockID, var4, var7, 4 + var6, var6, par3StructureBoundingBox); ++ ++ if ((var6 > -1 || var7 <= 1) && (var6 > 0 || var7 <= 3) && (var6 > 1 || var7 <= 4 || var7 >= 6)) { ++ this.placeBlockAtCurrentPosition(par1World, Block.stairsWoodOak.blockID, var5, var7, 4 + var6, 5 - var6, par3StructureBoundingBox); + } + } + } + +- this.fillWithBlocks(var1, var3, 3, 4, 5, 3, 4, 10, Block.planks.blockID, Block.planks.blockID, false); +- this.fillWithBlocks(var1, var3, 7, 4, 2, 7, 4, 10, Block.planks.blockID, Block.planks.blockID, false); +- this.fillWithBlocks(var1, var3, 4, 5, 4, 4, 5, 10, Block.planks.blockID, Block.planks.blockID, false); +- this.fillWithBlocks(var1, var3, 6, 5, 4, 6, 5, 10, Block.planks.blockID, Block.planks.blockID, false); +- this.fillWithBlocks(var1, var3, 5, 6, 3, 5, 6, 10, Block.planks.blockID, Block.planks.blockID, false); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 3, 4, 5, 3, 4, 10, Block.planks.blockID, Block.planks.blockID, false); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 7, 4, 2, 7, 4, 10, Block.planks.blockID, Block.planks.blockID, false); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 4, 5, 4, 4, 5, 10, Block.planks.blockID, Block.planks.blockID, false); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 6, 5, 4, 6, 5, 10, Block.planks.blockID, Block.planks.blockID, false); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 5, 6, 3, 5, 6, 10, Block.planks.blockID, Block.planks.blockID, false); + var6 = this.getMetadataWithOffset(Block.stairsWoodOak.blockID, 0); +- + int var8; +- for(var7 = 4; var7 >= 1; --var7) { +- this.placeBlockAtCurrentPosition(var1, Block.planks.blockID, 0, var7, 2 + var7, 7 - var7, var3); +- +- for(var8 = 8 - var7; var8 <= 10; ++var8) { +- this.placeBlockAtCurrentPosition(var1, Block.stairsWoodOak.blockID, var6, var7, 2 + var7, var8, var3); ++ ++ for (var7 = 4; var7 >= 1; --var7) { ++ this.placeBlockAtCurrentPosition(par1World, Block.planks.blockID, 0, var7, 2 + var7, 7 - var7, par3StructureBoundingBox); ++ ++ for (var8 = 8 - var7; var8 <= 10; ++var8) { ++ this.placeBlockAtCurrentPosition(par1World, Block.stairsWoodOak.blockID, var6, var7, 2 + var7, var8, par3StructureBoundingBox); + } + } + + var7 = this.getMetadataWithOffset(Block.stairsWoodOak.blockID, 1); +- this.placeBlockAtCurrentPosition(var1, Block.planks.blockID, 0, 6, 6, 3, var3); +- this.placeBlockAtCurrentPosition(var1, Block.planks.blockID, 0, 7, 5, 4, var3); +- this.placeBlockAtCurrentPosition(var1, Block.stairsWoodOak.blockID, var7, 6, 6, 4, var3); +- ++ this.placeBlockAtCurrentPosition(par1World, Block.planks.blockID, 0, 6, 6, 3, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.planks.blockID, 0, 7, 5, 4, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.stairsWoodOak.blockID, var7, 6, 6, 4, par3StructureBoundingBox); + int var9; +- for(var8 = 6; var8 <= 8; ++var8) { +- for(var9 = 5; var9 <= 10; ++var9) { +- this.placeBlockAtCurrentPosition(var1, Block.stairsWoodOak.blockID, var7, var8, 12 - var8, var9, var3); +- } +- } +- +- this.placeBlockAtCurrentPosition(var1, Block.wood.blockID, 0, 0, 2, 1, var3); +- this.placeBlockAtCurrentPosition(var1, Block.wood.blockID, 0, 0, 2, 4, var3); +- this.placeBlockAtCurrentPosition(var1, Block.thinGlass.blockID, 0, 0, 2, 2, var3); +- this.placeBlockAtCurrentPosition(var1, Block.thinGlass.blockID, 0, 0, 2, 3, var3); +- this.placeBlockAtCurrentPosition(var1, Block.wood.blockID, 0, 4, 2, 0, var3); +- this.placeBlockAtCurrentPosition(var1, Block.thinGlass.blockID, 0, 5, 2, 0, var3); +- this.placeBlockAtCurrentPosition(var1, Block.wood.blockID, 0, 6, 2, 0, var3); +- this.placeBlockAtCurrentPosition(var1, Block.wood.blockID, 0, 8, 2, 1, var3); +- this.placeBlockAtCurrentPosition(var1, Block.thinGlass.blockID, 0, 8, 2, 2, var3); +- this.placeBlockAtCurrentPosition(var1, Block.thinGlass.blockID, 0, 8, 2, 3, var3); +- this.placeBlockAtCurrentPosition(var1, Block.wood.blockID, 0, 8, 2, 4, var3); +- this.placeBlockAtCurrentPosition(var1, Block.planks.blockID, 0, 8, 2, 5, var3); +- this.placeBlockAtCurrentPosition(var1, Block.wood.blockID, 0, 8, 2, 6, var3); +- this.placeBlockAtCurrentPosition(var1, Block.thinGlass.blockID, 0, 8, 2, 7, var3); +- this.placeBlockAtCurrentPosition(var1, Block.thinGlass.blockID, 0, 8, 2, 8, var3); +- this.placeBlockAtCurrentPosition(var1, Block.wood.blockID, 0, 8, 2, 9, var3); +- this.placeBlockAtCurrentPosition(var1, Block.wood.blockID, 0, 2, 2, 6, var3); +- this.placeBlockAtCurrentPosition(var1, Block.thinGlass.blockID, 0, 2, 2, 7, var3); +- this.placeBlockAtCurrentPosition(var1, Block.thinGlass.blockID, 0, 2, 2, 8, var3); +- this.placeBlockAtCurrentPosition(var1, Block.wood.blockID, 0, 2, 2, 9, var3); +- this.placeBlockAtCurrentPosition(var1, Block.wood.blockID, 0, 4, 4, 10, var3); +- this.placeBlockAtCurrentPosition(var1, Block.thinGlass.blockID, 0, 5, 4, 10, var3); +- this.placeBlockAtCurrentPosition(var1, Block.wood.blockID, 0, 6, 4, 10, var3); +- this.placeBlockAtCurrentPosition(var1, Block.planks.blockID, 0, 5, 5, 10, var3); +- this.placeBlockAtCurrentPosition(var1, 0, 0, 2, 1, 0, var3); +- this.placeBlockAtCurrentPosition(var1, 0, 0, 2, 2, 0, var3); +- this.placeBlockAtCurrentPosition(var1, Block.torchWood.blockID, 0, 2, 3, 1, var3); +- this.placeDoorAtCurrentPosition(var1, var3, var2, 2, 1, 0, this.getMetadataWithOffset(Block.doorWood.blockID, 1)); +- this.fillWithBlocks(var1, var3, 1, 0, -1, 3, 2, -1, 0, 0, false); +- if(this.getBlockIdAtCurrentPosition(var1, 2, 0, -1, var3) == 0 && this.getBlockIdAtCurrentPosition(var1, 2, -1, -1, var3) != 0) { +- this.placeBlockAtCurrentPosition(var1, Block.stairsCobblestone.blockID, this.getMetadataWithOffset(Block.stairsCobblestone.blockID, 3), 2, 0, -1, var3); +- } +- +- for(var8 = 0; var8 < 5; ++var8) { +- for(var9 = 0; var9 < 9; ++var9) { +- this.clearCurrentPositionBlocksUpwards(var1, var9, 7, var8, var3); +- this.fillCurrentPositionBlocksDownwards(var1, Block.cobblestone.blockID, 0, var9, -1, var8, var3); +- } +- } +- +- for(var8 = 5; var8 < 11; ++var8) { +- for(var9 = 2; var9 < 9; ++var9) { +- this.clearCurrentPositionBlocksUpwards(var1, var9, 7, var8, var3); +- this.fillCurrentPositionBlocksDownwards(var1, Block.cobblestone.blockID, 0, var9, -1, var8, var3); +- } +- } +- +- this.spawnVillagers(var1, var3, 4, 1, 2, 2); ++ ++ for (var8 = 6; var8 <= 8; ++var8) { ++ for (var9 = 5; var9 <= 10; ++var9) { ++ this.placeBlockAtCurrentPosition(par1World, Block.stairsWoodOak.blockID, var7, var8, 12 - var8, var9, par3StructureBoundingBox); ++ } ++ } ++ ++ this.placeBlockAtCurrentPosition(par1World, Block.wood.blockID, 0, 0, 2, 1, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.wood.blockID, 0, 0, 2, 4, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.thinGlass.blockID, 0, 0, 2, 2, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.thinGlass.blockID, 0, 0, 2, 3, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.wood.blockID, 0, 4, 2, 0, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.thinGlass.blockID, 0, 5, 2, 0, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.wood.blockID, 0, 6, 2, 0, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.wood.blockID, 0, 8, 2, 1, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.thinGlass.blockID, 0, 8, 2, 2, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.thinGlass.blockID, 0, 8, 2, 3, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.wood.blockID, 0, 8, 2, 4, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.planks.blockID, 0, 8, 2, 5, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.wood.blockID, 0, 8, 2, 6, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.thinGlass.blockID, 0, 8, 2, 7, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.thinGlass.blockID, 0, 8, 2, 8, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.wood.blockID, 0, 8, 2, 9, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.wood.blockID, 0, 2, 2, 6, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.thinGlass.blockID, 0, 2, 2, 7, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.thinGlass.blockID, 0, 2, 2, 8, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.wood.blockID, 0, 2, 2, 9, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.wood.blockID, 0, 4, 4, 10, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.thinGlass.blockID, 0, 5, 4, 10, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.wood.blockID, 0, 6, 4, 10, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.planks.blockID, 0, 5, 5, 10, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, 0, 0, 2, 1, 0, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, 0, 0, 2, 2, 0, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.torchWood.blockID, 0, 2, 3, 1, par3StructureBoundingBox); ++ this.placeDoorAtCurrentPosition(par1World, par3StructureBoundingBox, par2Random, 2, 1, 0, this.getMetadataWithOffset(Block.doorWood.blockID, 1)); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 1, 0, -1, 3, 2, -1, 0, 0, false); ++ ++ if (this.getBlockIdAtCurrentPosition(par1World, 2, 0, -1, par3StructureBoundingBox) == 0 && this.getBlockIdAtCurrentPosition(par1World, 2, -1, -1, par3StructureBoundingBox) != 0) { ++ this.placeBlockAtCurrentPosition(par1World, Block.stairsCobblestone.blockID, this.getMetadataWithOffset(Block.stairsCobblestone.blockID, 3), 2, 0, -1, par3StructureBoundingBox); ++ } ++ ++ for (var8 = 0; var8 < 5; ++var8) { ++ for (var9 = 0; var9 < 9; ++var9) { ++ this.clearCurrentPositionBlocksUpwards(par1World, var9, 7, var8, par3StructureBoundingBox); ++ this.fillCurrentPositionBlocksDownwards(par1World, Block.cobblestone.blockID, 0, var9, -1, var8, par3StructureBoundingBox); ++ } ++ } ++ ++ for (var8 = 5; var8 < 11; ++var8) { ++ for (var9 = 2; var9 < 9; ++var9) { ++ this.clearCurrentPositionBlocksUpwards(par1World, var9, 7, var8, par3StructureBoundingBox); ++ this.fillCurrentPositionBlocksDownwards(par1World, Block.cobblestone.blockID, 0, var9, -1, var8, par3StructureBoundingBox); ++ } ++ } ++ ++ this.spawnVillagers(par1World, par3StructureBoundingBox, 4, 1, 2, 2); + return true; + } + } diff --git a/patches/net/minecraft/src/ComponentVillageHouse4_Garden.java.patch b/patches/net/minecraft/src/ComponentVillageHouse4_Garden.java.patch new file mode 100644 index 0000000..68ca72b --- /dev/null +++ b/patches/net/minecraft/src/ComponentVillageHouse4_Garden.java.patch @@ -0,0 +1,210 @@ +--- net/minecraft/src/ComponentVillageHouse4_Garden.java ++++ net/minecraft/src/ComponentVillageHouse4_Garden.java +@@ -6,112 +6,119 @@ + public class ComponentVillageHouse4_Garden extends ComponentVillage { + private boolean isRoofAccessible; + +- public ComponentVillageHouse4_Garden() { +- } +- +- public ComponentVillageHouse4_Garden(ComponentVillageStartPiece var1, int var2, Random var3, StructureBoundingBox var4, int var5) { +- super(var1, var2); +- this.coordBaseMode = var5; +- this.boundingBox = var4; +- this.isRoofAccessible = var3.nextBoolean(); +- } +- +- protected void func_143012_a(NBTTagCompound var1) { +- super.func_143012_a(var1); +- var1.setBoolean("Terrace", this.isRoofAccessible); +- } +- +- protected void func_143011_b(NBTTagCompound var1) { +- super.func_143011_b(var1); +- this.isRoofAccessible = var1.getBoolean("Terrace"); +- } +- +- public static ComponentVillageHouse4_Garden func_74912_a(ComponentVillageStartPiece var0, List var1, Random var2, int var3, int var4, int var5, int var6, int var7) { +- StructureBoundingBox var8 = StructureBoundingBox.getComponentToAddBoundingBox(var3, var4, var5, 0, 0, 0, 5, 6, 5, var6); +- return StructureComponent.findIntersecting(var1, var8) != null ? null : new ComponentVillageHouse4_Garden(var0, var7, var2, var8, var6); +- } +- +- public boolean addComponentParts(World var1, Random var2, StructureBoundingBox var3) { +- if(this.field_143015_k < 0) { +- this.field_143015_k = this.getAverageGroundLevel(var1, var3); +- if(this.field_143015_k < 0) { ++ public ComponentVillageHouse4_Garden() {} ++ ++ public ComponentVillageHouse4_Garden(ComponentVillageStartPiece par1ComponentVillageStartPiece, int par2, Random par3Random, StructureBoundingBox par4StructureBoundingBox, int par5) { ++ super(par1ComponentVillageStartPiece, par2); ++ this.coordBaseMode = par5; ++ this.boundingBox = par4StructureBoundingBox; ++ this.isRoofAccessible = par3Random.nextBoolean(); ++ } ++ ++ protected void func_143012_a(NBTTagCompound par1NBTTagCompound) { ++ super.func_143012_a(par1NBTTagCompound); ++ par1NBTTagCompound.setBoolean("Terrace", this.isRoofAccessible); ++ } ++ ++ protected void func_143011_b(NBTTagCompound par1NBTTagCompound) { ++ super.func_143011_b(par1NBTTagCompound); ++ this.isRoofAccessible = par1NBTTagCompound.getBoolean("Terrace"); ++ } ++ ++ public static ComponentVillageHouse4_Garden func_74912_a(ComponentVillageStartPiece par0ComponentVillageStartPiece, List par1List, Random par2Random, int par3, int par4, int par5, int par6, int par7) { ++ StructureBoundingBox var8 = StructureBoundingBox.getComponentToAddBoundingBox(par3, par4, par5, 0, 0, 0, 5, 6, 5, par6); ++ return StructureComponent.findIntersecting(par1List, var8) != null ? null : new ComponentVillageHouse4_Garden(par0ComponentVillageStartPiece, par7, par2Random, var8, par6); ++ } ++ ++ /** ++ * second Part of Structure generating, this for example places Spiderwebs, Mob Spawners, it closes Mineshafts at the ++ * end, it adds Fences... ++ */ ++ public boolean addComponentParts(World par1World, Random par2Random, StructureBoundingBox par3StructureBoundingBox) { ++ if (this.field_143015_k < 0) { ++ this.field_143015_k = this.getAverageGroundLevel(par1World, par3StructureBoundingBox); ++ ++ if (this.field_143015_k < 0) { + return true; + } + + this.boundingBox.offset(0, this.field_143015_k - this.boundingBox.maxY + 6 - 1, 0); + } + +- this.fillWithBlocks(var1, var3, 0, 0, 0, 4, 0, 4, Block.cobblestone.blockID, Block.cobblestone.blockID, false); +- this.fillWithBlocks(var1, var3, 0, 4, 0, 4, 4, 4, Block.wood.blockID, Block.wood.blockID, false); +- this.fillWithBlocks(var1, var3, 1, 4, 1, 3, 4, 3, Block.planks.blockID, Block.planks.blockID, false); +- this.placeBlockAtCurrentPosition(var1, Block.cobblestone.blockID, 0, 0, 1, 0, var3); +- this.placeBlockAtCurrentPosition(var1, Block.cobblestone.blockID, 0, 0, 2, 0, var3); +- this.placeBlockAtCurrentPosition(var1, Block.cobblestone.blockID, 0, 0, 3, 0, var3); +- this.placeBlockAtCurrentPosition(var1, Block.cobblestone.blockID, 0, 4, 1, 0, var3); +- this.placeBlockAtCurrentPosition(var1, Block.cobblestone.blockID, 0, 4, 2, 0, var3); +- this.placeBlockAtCurrentPosition(var1, Block.cobblestone.blockID, 0, 4, 3, 0, var3); +- this.placeBlockAtCurrentPosition(var1, Block.cobblestone.blockID, 0, 0, 1, 4, var3); +- this.placeBlockAtCurrentPosition(var1, Block.cobblestone.blockID, 0, 0, 2, 4, var3); +- this.placeBlockAtCurrentPosition(var1, Block.cobblestone.blockID, 0, 0, 3, 4, var3); +- this.placeBlockAtCurrentPosition(var1, Block.cobblestone.blockID, 0, 4, 1, 4, var3); +- this.placeBlockAtCurrentPosition(var1, Block.cobblestone.blockID, 0, 4, 2, 4, var3); +- this.placeBlockAtCurrentPosition(var1, Block.cobblestone.blockID, 0, 4, 3, 4, var3); +- this.fillWithBlocks(var1, var3, 0, 1, 1, 0, 3, 3, Block.planks.blockID, Block.planks.blockID, false); +- this.fillWithBlocks(var1, var3, 4, 1, 1, 4, 3, 3, Block.planks.blockID, Block.planks.blockID, false); +- this.fillWithBlocks(var1, var3, 1, 1, 4, 3, 3, 4, Block.planks.blockID, Block.planks.blockID, false); +- this.placeBlockAtCurrentPosition(var1, Block.thinGlass.blockID, 0, 0, 2, 2, var3); +- this.placeBlockAtCurrentPosition(var1, Block.thinGlass.blockID, 0, 2, 2, 4, var3); +- this.placeBlockAtCurrentPosition(var1, Block.thinGlass.blockID, 0, 4, 2, 2, var3); +- this.placeBlockAtCurrentPosition(var1, Block.planks.blockID, 0, 1, 1, 0, var3); +- this.placeBlockAtCurrentPosition(var1, Block.planks.blockID, 0, 1, 2, 0, var3); +- this.placeBlockAtCurrentPosition(var1, Block.planks.blockID, 0, 1, 3, 0, var3); +- this.placeBlockAtCurrentPosition(var1, Block.planks.blockID, 0, 2, 3, 0, var3); +- this.placeBlockAtCurrentPosition(var1, Block.planks.blockID, 0, 3, 3, 0, var3); +- this.placeBlockAtCurrentPosition(var1, Block.planks.blockID, 0, 3, 2, 0, var3); +- this.placeBlockAtCurrentPosition(var1, Block.planks.blockID, 0, 3, 1, 0, var3); +- if(this.getBlockIdAtCurrentPosition(var1, 2, 0, -1, var3) == 0 && this.getBlockIdAtCurrentPosition(var1, 2, -1, -1, var3) != 0) { +- this.placeBlockAtCurrentPosition(var1, Block.stairsCobblestone.blockID, this.getMetadataWithOffset(Block.stairsCobblestone.blockID, 3), 2, 0, -1, var3); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 0, 0, 0, 4, 0, 4, Block.cobblestone.blockID, Block.cobblestone.blockID, false); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 0, 4, 0, 4, 4, 4, Block.wood.blockID, Block.wood.blockID, false); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 1, 4, 1, 3, 4, 3, Block.planks.blockID, Block.planks.blockID, false); ++ this.placeBlockAtCurrentPosition(par1World, Block.cobblestone.blockID, 0, 0, 1, 0, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.cobblestone.blockID, 0, 0, 2, 0, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.cobblestone.blockID, 0, 0, 3, 0, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.cobblestone.blockID, 0, 4, 1, 0, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.cobblestone.blockID, 0, 4, 2, 0, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.cobblestone.blockID, 0, 4, 3, 0, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.cobblestone.blockID, 0, 0, 1, 4, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.cobblestone.blockID, 0, 0, 2, 4, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.cobblestone.blockID, 0, 0, 3, 4, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.cobblestone.blockID, 0, 4, 1, 4, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.cobblestone.blockID, 0, 4, 2, 4, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.cobblestone.blockID, 0, 4, 3, 4, par3StructureBoundingBox); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 0, 1, 1, 0, 3, 3, Block.planks.blockID, Block.planks.blockID, false); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 4, 1, 1, 4, 3, 3, Block.planks.blockID, Block.planks.blockID, false); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 1, 1, 4, 3, 3, 4, Block.planks.blockID, Block.planks.blockID, false); ++ this.placeBlockAtCurrentPosition(par1World, Block.thinGlass.blockID, 0, 0, 2, 2, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.thinGlass.blockID, 0, 2, 2, 4, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.thinGlass.blockID, 0, 4, 2, 2, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.planks.blockID, 0, 1, 1, 0, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.planks.blockID, 0, 1, 2, 0, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.planks.blockID, 0, 1, 3, 0, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.planks.blockID, 0, 2, 3, 0, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.planks.blockID, 0, 3, 3, 0, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.planks.blockID, 0, 3, 2, 0, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.planks.blockID, 0, 3, 1, 0, par3StructureBoundingBox); ++ ++ if (this.getBlockIdAtCurrentPosition(par1World, 2, 0, -1, par3StructureBoundingBox) == 0 && this.getBlockIdAtCurrentPosition(par1World, 2, -1, -1, par3StructureBoundingBox) != 0) { ++ this.placeBlockAtCurrentPosition(par1World, Block.stairsCobblestone.blockID, this.getMetadataWithOffset(Block.stairsCobblestone.blockID, 3), 2, 0, -1, par3StructureBoundingBox); + } + +- this.fillWithBlocks(var1, var3, 1, 1, 1, 3, 3, 3, 0, 0, false); +- if(this.isRoofAccessible) { +- this.placeBlockAtCurrentPosition(var1, Block.fence.blockID, 0, 0, 5, 0, var3); +- this.placeBlockAtCurrentPosition(var1, Block.fence.blockID, 0, 1, 5, 0, var3); +- this.placeBlockAtCurrentPosition(var1, Block.fence.blockID, 0, 2, 5, 0, var3); +- this.placeBlockAtCurrentPosition(var1, Block.fence.blockID, 0, 3, 5, 0, var3); +- this.placeBlockAtCurrentPosition(var1, Block.fence.blockID, 0, 4, 5, 0, var3); +- this.placeBlockAtCurrentPosition(var1, Block.fence.blockID, 0, 0, 5, 4, var3); +- this.placeBlockAtCurrentPosition(var1, Block.fence.blockID, 0, 1, 5, 4, var3); +- this.placeBlockAtCurrentPosition(var1, Block.fence.blockID, 0, 2, 5, 4, var3); +- this.placeBlockAtCurrentPosition(var1, Block.fence.blockID, 0, 3, 5, 4, var3); +- this.placeBlockAtCurrentPosition(var1, Block.fence.blockID, 0, 4, 5, 4, var3); +- this.placeBlockAtCurrentPosition(var1, Block.fence.blockID, 0, 4, 5, 1, var3); +- this.placeBlockAtCurrentPosition(var1, Block.fence.blockID, 0, 4, 5, 2, var3); +- this.placeBlockAtCurrentPosition(var1, Block.fence.blockID, 0, 4, 5, 3, var3); +- this.placeBlockAtCurrentPosition(var1, Block.fence.blockID, 0, 0, 5, 1, var3); +- this.placeBlockAtCurrentPosition(var1, Block.fence.blockID, 0, 0, 5, 2, var3); +- this.placeBlockAtCurrentPosition(var1, Block.fence.blockID, 0, 0, 5, 3, var3); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 1, 1, 1, 3, 3, 3, 0, 0, false); ++ ++ if (this.isRoofAccessible) { ++ this.placeBlockAtCurrentPosition(par1World, Block.fence.blockID, 0, 0, 5, 0, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.fence.blockID, 0, 1, 5, 0, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.fence.blockID, 0, 2, 5, 0, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.fence.blockID, 0, 3, 5, 0, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.fence.blockID, 0, 4, 5, 0, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.fence.blockID, 0, 0, 5, 4, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.fence.blockID, 0, 1, 5, 4, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.fence.blockID, 0, 2, 5, 4, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.fence.blockID, 0, 3, 5, 4, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.fence.blockID, 0, 4, 5, 4, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.fence.blockID, 0, 4, 5, 1, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.fence.blockID, 0, 4, 5, 2, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.fence.blockID, 0, 4, 5, 3, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.fence.blockID, 0, 0, 5, 1, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.fence.blockID, 0, 0, 5, 2, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.fence.blockID, 0, 0, 5, 3, par3StructureBoundingBox); + } + + int var4; +- if(this.isRoofAccessible) { ++ ++ if (this.isRoofAccessible) { + var4 = this.getMetadataWithOffset(Block.ladder.blockID, 3); +- this.placeBlockAtCurrentPosition(var1, Block.ladder.blockID, var4, 3, 1, 3, var3); +- this.placeBlockAtCurrentPosition(var1, Block.ladder.blockID, var4, 3, 2, 3, var3); +- this.placeBlockAtCurrentPosition(var1, Block.ladder.blockID, var4, 3, 3, 3, var3); +- this.placeBlockAtCurrentPosition(var1, Block.ladder.blockID, var4, 3, 4, 3, var3); ++ this.placeBlockAtCurrentPosition(par1World, Block.ladder.blockID, var4, 3, 1, 3, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.ladder.blockID, var4, 3, 2, 3, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.ladder.blockID, var4, 3, 3, 3, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.ladder.blockID, var4, 3, 4, 3, par3StructureBoundingBox); + } + +- this.placeBlockAtCurrentPosition(var1, Block.torchWood.blockID, 0, 2, 3, 1, var3); ++ this.placeBlockAtCurrentPosition(par1World, Block.torchWood.blockID, 0, 2, 3, 1, par3StructureBoundingBox); + +- for(var4 = 0; var4 < 5; ++var4) { +- for(int var5 = 0; var5 < 5; ++var5) { +- this.clearCurrentPositionBlocksUpwards(var1, var5, 6, var4, var3); +- this.fillCurrentPositionBlocksDownwards(var1, Block.cobblestone.blockID, 0, var5, -1, var4, var3); ++ for (var4 = 0; var4 < 5; ++var4) { ++ for (int var5 = 0; var5 < 5; ++var5) { ++ this.clearCurrentPositionBlocksUpwards(par1World, var5, 6, var4, par3StructureBoundingBox); ++ this.fillCurrentPositionBlocksDownwards(par1World, Block.cobblestone.blockID, 0, var5, -1, var4, par3StructureBoundingBox); + } + } + +- this.spawnVillagers(var1, var3, 1, 1, 2, 1); ++ this.spawnVillagers(par1World, par3StructureBoundingBox, 1, 1, 2, 1); + return true; + } + } diff --git a/patches/net/minecraft/src/ComponentVillagePathGen.java.patch b/patches/net/minecraft/src/ComponentVillagePathGen.java.patch new file mode 100644 index 0000000..3a0c8ad --- /dev/null +++ b/patches/net/minecraft/src/ComponentVillagePathGen.java.patch @@ -0,0 +1,197 @@ +--- net/minecraft/src/ComponentVillagePathGen.java ++++ net/minecraft/src/ComponentVillagePathGen.java +@@ -6,85 +6,95 @@ + public class ComponentVillagePathGen extends ComponentVillageRoadPiece { + private int averageGroundLevel; + +- public ComponentVillagePathGen() { +- } +- +- public ComponentVillagePathGen(ComponentVillageStartPiece var1, int var2, Random var3, StructureBoundingBox var4, int var5) { +- super(var1, var2); +- this.coordBaseMode = var5; +- this.boundingBox = var4; +- this.averageGroundLevel = Math.max(var4.getXSize(), var4.getZSize()); +- } +- +- protected void func_143012_a(NBTTagCompound var1) { +- super.func_143012_a(var1); +- var1.setInteger("Length", this.averageGroundLevel); +- } +- +- protected void func_143011_b(NBTTagCompound var1) { +- super.func_143011_b(var1); +- this.averageGroundLevel = var1.getInteger("Length"); +- } +- +- public void buildComponent(StructureComponent var1, List var2, Random var3) { ++ public ComponentVillagePathGen() {} ++ ++ public ComponentVillagePathGen(ComponentVillageStartPiece par1ComponentVillageStartPiece, int par2, Random par3Random, StructureBoundingBox par4StructureBoundingBox, int par5) { ++ super(par1ComponentVillageStartPiece, par2); ++ this.coordBaseMode = par5; ++ this.boundingBox = par4StructureBoundingBox; ++ this.averageGroundLevel = Math.max(par4StructureBoundingBox.getXSize(), par4StructureBoundingBox.getZSize()); ++ } ++ ++ protected void func_143012_a(NBTTagCompound par1NBTTagCompound) { ++ super.func_143012_a(par1NBTTagCompound); ++ par1NBTTagCompound.setInteger("Length", this.averageGroundLevel); ++ } ++ ++ protected void func_143011_b(NBTTagCompound par1NBTTagCompound) { ++ super.func_143011_b(par1NBTTagCompound); ++ this.averageGroundLevel = par1NBTTagCompound.getInteger("Length"); ++ } ++ ++ /** ++ * Initiates construction of the Structure Component picked, at the current Location of StructGen ++ */ ++ public void buildComponent(StructureComponent par1StructureComponent, List par2List, Random par3Random) { + boolean var4 = false; +- + int var5; + StructureComponent var6; +- for(var5 = var3.nextInt(5); var5 < this.averageGroundLevel - 8; var5 += 2 + var3.nextInt(5)) { +- var6 = this.getNextComponentNN((ComponentVillageStartPiece)var1, var2, var3, 0, var5); +- if(var6 != null) { +- var5 += Math.max(var6.boundingBox.getXSize(), var6.boundingBox.getZSize()); +- var4 = true; +- } +- } +- +- for(var5 = var3.nextInt(5); var5 < this.averageGroundLevel - 8; var5 += 2 + var3.nextInt(5)) { +- var6 = this.getNextComponentPP((ComponentVillageStartPiece)var1, var2, var3, 0, var5); +- if(var6 != null) { +- var5 += Math.max(var6.boundingBox.getXSize(), var6.boundingBox.getZSize()); +- var4 = true; +- } +- } +- +- if(var4 && var3.nextInt(3) > 0) { +- switch(this.coordBaseMode) { +- case 0: +- StructureVillagePieces.getNextStructureComponentVillagePath((ComponentVillageStartPiece)var1, var2, var3, this.boundingBox.minX - 1, this.boundingBox.minY, this.boundingBox.maxZ - 2, 1, this.getComponentType()); +- break; +- case 1: +- StructureVillagePieces.getNextStructureComponentVillagePath((ComponentVillageStartPiece)var1, var2, var3, this.boundingBox.minX, this.boundingBox.minY, this.boundingBox.minZ - 1, 2, this.getComponentType()); +- break; +- case 2: +- StructureVillagePieces.getNextStructureComponentVillagePath((ComponentVillageStartPiece)var1, var2, var3, this.boundingBox.minX - 1, this.boundingBox.minY, this.boundingBox.minZ, 1, this.getComponentType()); +- break; +- case 3: +- StructureVillagePieces.getNextStructureComponentVillagePath((ComponentVillageStartPiece)var1, var2, var3, this.boundingBox.maxX - 2, this.boundingBox.minY, this.boundingBox.minZ - 1, 2, this.getComponentType()); +- } +- } +- +- if(var4 && var3.nextInt(3) > 0) { +- switch(this.coordBaseMode) { +- case 0: +- StructureVillagePieces.getNextStructureComponentVillagePath((ComponentVillageStartPiece)var1, var2, var3, this.boundingBox.maxX + 1, this.boundingBox.minY, this.boundingBox.maxZ - 2, 3, this.getComponentType()); +- break; +- case 1: +- StructureVillagePieces.getNextStructureComponentVillagePath((ComponentVillageStartPiece)var1, var2, var3, this.boundingBox.minX, this.boundingBox.minY, this.boundingBox.maxZ + 1, 0, this.getComponentType()); +- break; +- case 2: +- StructureVillagePieces.getNextStructureComponentVillagePath((ComponentVillageStartPiece)var1, var2, var3, this.boundingBox.maxX + 1, this.boundingBox.minY, this.boundingBox.minZ, 3, this.getComponentType()); +- break; +- case 3: +- StructureVillagePieces.getNextStructureComponentVillagePath((ComponentVillageStartPiece)var1, var2, var3, this.boundingBox.maxX - 2, this.boundingBox.minY, this.boundingBox.maxZ + 1, 0, this.getComponentType()); +- } +- } +- ++ ++ for (var5 = par3Random.nextInt(5); var5 < this.averageGroundLevel - 8; var5 += 2 + par3Random.nextInt(5)) { ++ var6 = this.getNextComponentNN((ComponentVillageStartPiece)par1StructureComponent, par2List, par3Random, 0, var5); ++ ++ if (var6 != null) { ++ var5 += Math.max(var6.boundingBox.getXSize(), var6.boundingBox.getZSize()); ++ var4 = true; ++ } ++ } ++ ++ for (var5 = par3Random.nextInt(5); var5 < this.averageGroundLevel - 8; var5 += 2 + par3Random.nextInt(5)) { ++ var6 = this.getNextComponentPP((ComponentVillageStartPiece)par1StructureComponent, par2List, par3Random, 0, var5); ++ ++ if (var6 != null) { ++ var5 += Math.max(var6.boundingBox.getXSize(), var6.boundingBox.getZSize()); ++ var4 = true; ++ } ++ } ++ ++ if (var4 && par3Random.nextInt(3) > 0) { ++ switch (this.coordBaseMode) { ++ case 0: ++ StructureVillagePieces.getNextStructureComponentVillagePath((ComponentVillageStartPiece)par1StructureComponent, par2List, par3Random, this.boundingBox.minX - 1, this.boundingBox.minY, this.boundingBox.maxZ - 2, 1, this.getComponentType()); ++ break; ++ ++ case 1: ++ StructureVillagePieces.getNextStructureComponentVillagePath((ComponentVillageStartPiece)par1StructureComponent, par2List, par3Random, this.boundingBox.minX, this.boundingBox.minY, this.boundingBox.minZ - 1, 2, this.getComponentType()); ++ break; ++ ++ case 2: ++ StructureVillagePieces.getNextStructureComponentVillagePath((ComponentVillageStartPiece)par1StructureComponent, par2List, par3Random, this.boundingBox.minX - 1, this.boundingBox.minY, this.boundingBox.minZ, 1, this.getComponentType()); ++ break; ++ ++ case 3: ++ StructureVillagePieces.getNextStructureComponentVillagePath((ComponentVillageStartPiece)par1StructureComponent, par2List, par3Random, this.boundingBox.maxX - 2, this.boundingBox.minY, this.boundingBox.minZ - 1, 2, this.getComponentType()); ++ } ++ } ++ ++ if (var4 && par3Random.nextInt(3) > 0) { ++ switch (this.coordBaseMode) { ++ case 0: ++ StructureVillagePieces.getNextStructureComponentVillagePath((ComponentVillageStartPiece)par1StructureComponent, par2List, par3Random, this.boundingBox.maxX + 1, this.boundingBox.minY, this.boundingBox.maxZ - 2, 3, this.getComponentType()); ++ break; ++ ++ case 1: ++ StructureVillagePieces.getNextStructureComponentVillagePath((ComponentVillageStartPiece)par1StructureComponent, par2List, par3Random, this.boundingBox.minX, this.boundingBox.minY, this.boundingBox.maxZ + 1, 0, this.getComponentType()); ++ break; ++ ++ case 2: ++ StructureVillagePieces.getNextStructureComponentVillagePath((ComponentVillageStartPiece)par1StructureComponent, par2List, par3Random, this.boundingBox.maxX + 1, this.boundingBox.minY, this.boundingBox.minZ, 3, this.getComponentType()); ++ break; ++ ++ case 3: ++ StructureVillagePieces.getNextStructureComponentVillagePath((ComponentVillageStartPiece)par1StructureComponent, par2List, par3Random, this.boundingBox.maxX - 2, this.boundingBox.minY, this.boundingBox.maxZ + 1, 0, this.getComponentType()); ++ } ++ } + } + +- public static StructureBoundingBox func_74933_a(ComponentVillageStartPiece var0, List var1, Random var2, int var3, int var4, int var5, int var6) { +- for(int var7 = 7 * MathHelper.getRandomIntegerInRange(var2, 3, 5); var7 >= 7; var7 -= 7) { +- StructureBoundingBox var8 = StructureBoundingBox.getComponentToAddBoundingBox(var3, var4, var5, 0, 0, 0, 3, 3, var7, var6); +- if(StructureComponent.findIntersecting(var1, var8) == null) { ++ public static StructureBoundingBox func_74933_a(ComponentVillageStartPiece par0ComponentVillageStartPiece, List par1List, Random par2Random, int par3, int par4, int par5, int par6) { ++ for (int var7 = 7 * MathHelper.getRandomIntegerInRange(par2Random, 3, 5); var7 >= 7; var7 -= 7) { ++ StructureBoundingBox var8 = StructureBoundingBox.getComponentToAddBoundingBox(par3, par4, par5, 0, 0, 0, 3, 3, var7, par6); ++ ++ if (StructureComponent.findIntersecting(par1List, var8) == null) { + return var8; + } + } +@@ -92,14 +102,18 @@ + return null; + } + +- public boolean addComponentParts(World var1, Random var2, StructureBoundingBox var3) { ++ /** ++ * second Part of Structure generating, this for example places Spiderwebs, Mob Spawners, it closes Mineshafts at the ++ * end, it adds Fences... ++ */ ++ public boolean addComponentParts(World par1World, Random par2Random, StructureBoundingBox par3StructureBoundingBox) { + int var4 = this.getBiomeSpecificBlock(Block.gravel.blockID, 0); + +- for(int var5 = this.boundingBox.minX; var5 <= this.boundingBox.maxX; ++var5) { +- for(int var6 = this.boundingBox.minZ; var6 <= this.boundingBox.maxZ; ++var6) { +- if(var3.isVecInside(var5, 64, var6)) { +- int var7 = var1.getTopSolidOrLiquidBlock(var5, var6) - 1; +- var1.setBlock(var5, var7, var6, var4, 0, 2); ++ for (int var5 = this.boundingBox.minX; var5 <= this.boundingBox.maxX; ++var5) { ++ for (int var6 = this.boundingBox.minZ; var6 <= this.boundingBox.maxZ; ++var6) { ++ if (par3StructureBoundingBox.isVecInside(var5, 64, var6)) { ++ int var7 = par1World.getTopSolidOrLiquidBlock(var5, var6) - 1; ++ par1World.setBlock(var5, var7, var6, var4, 0, 2); + } + } + } diff --git a/patches/net/minecraft/src/ComponentVillageRoadPiece.java.patch b/patches/net/minecraft/src/ComponentVillageRoadPiece.java.patch new file mode 100644 index 0000000..d2fee75 --- /dev/null +++ b/patches/net/minecraft/src/ComponentVillageRoadPiece.java.patch @@ -0,0 +1,16 @@ +--- net/minecraft/src/ComponentVillageRoadPiece.java ++++ net/minecraft/src/ComponentVillageRoadPiece.java +@@ -1,10 +1,9 @@ + package net.minecraft.src; + + public abstract class ComponentVillageRoadPiece extends ComponentVillage { +- public ComponentVillageRoadPiece() { +- } ++ public ComponentVillageRoadPiece() {} + +- protected ComponentVillageRoadPiece(ComponentVillageStartPiece var1, int var2) { +- super(var1, var2); ++ protected ComponentVillageRoadPiece(ComponentVillageStartPiece par1ComponentVillageStartPiece, int par2) { ++ super(par1ComponentVillageStartPiece, par2); + } + } diff --git a/patches/net/minecraft/src/ComponentVillageStartPiece.java.patch b/patches/net/minecraft/src/ComponentVillageStartPiece.java.patch new file mode 100644 index 0000000..58c5c49 --- /dev/null +++ b/patches/net/minecraft/src/ComponentVillageStartPiece.java.patch @@ -0,0 +1,46 @@ +--- net/minecraft/src/ComponentVillageStartPiece.java ++++ net/minecraft/src/ComponentVillageStartPiece.java +@@ -6,22 +6,30 @@ + + public class ComponentVillageStartPiece extends ComponentVillageWell { + public WorldChunkManager worldChunkMngr; ++ ++ /** Boolean that determines if the village is in a desert or not. */ + public boolean inDesert; ++ ++ /** World terrain type, 0 for normal, 1 for flap map */ + public int terrainType; + public StructureVillagePieceWeight structVillagePieceWeight; +- public List e; +- public List i = new ArrayList(); +- public List j = new ArrayList(); +- +- public ComponentVillageStartPiece() { +- } +- +- public ComponentVillageStartPiece(WorldChunkManager var1, int var2, Random var3, int var4, int var5, List var6, int var7) { +- super((ComponentVillageStartPiece)null, 0, var3, var4, var5); +- this.worldChunkMngr = var1; +- this.e = var6; +- this.terrainType = var7; +- BiomeGenBase var8 = var1.getBiomeGenAt(var4, var5); ++ ++ /** ++ * Contains List of all spawnable Structure Piece Weights. If no more Pieces of a type can be spawned, they are removed ++ * from this list ++ */ ++ public List structureVillageWeightedPieceList; ++ public List field_74932_i = new ArrayList(); ++ public List field_74930_j = new ArrayList(); ++ ++ public ComponentVillageStartPiece() {} ++ ++ public ComponentVillageStartPiece(WorldChunkManager par1WorldChunkManager, int par2, Random par3Random, int par4, int par5, List par6List, int par7) { ++ super((ComponentVillageStartPiece)null, 0, par3Random, par4, par5); ++ this.worldChunkMngr = par1WorldChunkManager; ++ this.structureVillageWeightedPieceList = par6List; ++ this.terrainType = par7; ++ BiomeGenBase var8 = par1WorldChunkManager.getBiomeGenAt(par4, par5); + this.inDesert = var8 == BiomeGenBase.desert || var8 == BiomeGenBase.desertHills; + } + diff --git a/patches/net/minecraft/src/ComponentVillageTorch.java.patch b/patches/net/minecraft/src/ComponentVillageTorch.java.patch new file mode 100644 index 0000000..bbc2299 --- /dev/null +++ b/patches/net/minecraft/src/ComponentVillageTorch.java.patch @@ -0,0 +1,73 @@ +--- net/minecraft/src/ComponentVillageTorch.java ++++ net/minecraft/src/ComponentVillageTorch.java +@@ -4,39 +4,43 @@ + import java.util.Random; + + public class ComponentVillageTorch extends ComponentVillage { +- public ComponentVillageTorch() { +- } +- +- public ComponentVillageTorch(ComponentVillageStartPiece var1, int var2, Random var3, StructureBoundingBox var4, int var5) { +- super(var1, var2); +- this.coordBaseMode = var5; +- this.boundingBox = var4; +- } +- +- public static StructureBoundingBox func_74904_a(ComponentVillageStartPiece var0, List var1, Random var2, int var3, int var4, int var5, int var6) { +- StructureBoundingBox var7 = StructureBoundingBox.getComponentToAddBoundingBox(var3, var4, var5, 0, 0, 0, 3, 4, 2, var6); +- return StructureComponent.findIntersecting(var1, var7) != null ? null : var7; +- } +- +- public boolean addComponentParts(World var1, Random var2, StructureBoundingBox var3) { +- if(this.field_143015_k < 0) { +- this.field_143015_k = this.getAverageGroundLevel(var1, var3); +- if(this.field_143015_k < 0) { ++ public ComponentVillageTorch() {} ++ ++ public ComponentVillageTorch(ComponentVillageStartPiece par1ComponentVillageStartPiece, int par2, Random par3Random, StructureBoundingBox par4StructureBoundingBox, int par5) { ++ super(par1ComponentVillageStartPiece, par2); ++ this.coordBaseMode = par5; ++ this.boundingBox = par4StructureBoundingBox; ++ } ++ ++ public static StructureBoundingBox func_74904_a(ComponentVillageStartPiece par0ComponentVillageStartPiece, List par1List, Random par2Random, int par3, int par4, int par5, int par6) { ++ StructureBoundingBox var7 = StructureBoundingBox.getComponentToAddBoundingBox(par3, par4, par5, 0, 0, 0, 3, 4, 2, par6); ++ return StructureComponent.findIntersecting(par1List, var7) != null ? null : var7; ++ } ++ ++ /** ++ * second Part of Structure generating, this for example places Spiderwebs, Mob Spawners, it closes Mineshafts at the ++ * end, it adds Fences... ++ */ ++ public boolean addComponentParts(World par1World, Random par2Random, StructureBoundingBox par3StructureBoundingBox) { ++ if (this.field_143015_k < 0) { ++ this.field_143015_k = this.getAverageGroundLevel(par1World, par3StructureBoundingBox); ++ ++ if (this.field_143015_k < 0) { + return true; + } + + this.boundingBox.offset(0, this.field_143015_k - this.boundingBox.maxY + 4 - 1, 0); + } + +- this.fillWithBlocks(var1, var3, 0, 0, 0, 2, 3, 1, 0, 0, false); +- this.placeBlockAtCurrentPosition(var1, Block.fence.blockID, 0, 1, 0, 0, var3); +- this.placeBlockAtCurrentPosition(var1, Block.fence.blockID, 0, 1, 1, 0, var3); +- this.placeBlockAtCurrentPosition(var1, Block.fence.blockID, 0, 1, 2, 0, var3); +- this.placeBlockAtCurrentPosition(var1, Block.cloth.blockID, 15, 1, 3, 0, var3); +- this.placeBlockAtCurrentPosition(var1, Block.torchWood.blockID, 0, 0, 3, 0, var3); +- this.placeBlockAtCurrentPosition(var1, Block.torchWood.blockID, 0, 1, 3, 1, var3); +- this.placeBlockAtCurrentPosition(var1, Block.torchWood.blockID, 0, 2, 3, 0, var3); +- this.placeBlockAtCurrentPosition(var1, Block.torchWood.blockID, 0, 1, 3, -1, var3); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 0, 0, 0, 2, 3, 1, 0, 0, false); ++ this.placeBlockAtCurrentPosition(par1World, Block.fence.blockID, 0, 1, 0, 0, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.fence.blockID, 0, 1, 1, 0, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.fence.blockID, 0, 1, 2, 0, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.cloth.blockID, 15, 1, 3, 0, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.torchWood.blockID, 0, 0, 3, 0, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.torchWood.blockID, 0, 1, 3, 1, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.torchWood.blockID, 0, 2, 3, 0, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.torchWood.blockID, 0, 1, 3, -1, par3StructureBoundingBox); + return true; + } + } diff --git a/patches/net/minecraft/src/ComponentVillageWell.java.patch b/patches/net/minecraft/src/ComponentVillageWell.java.patch new file mode 100644 index 0000000..b4dba30 --- /dev/null +++ b/patches/net/minecraft/src/ComponentVillageWell.java.patch @@ -0,0 +1,117 @@ +--- net/minecraft/src/ComponentVillageWell.java ++++ net/minecraft/src/ComponentVillageWell.java +@@ -4,60 +4,68 @@ + import java.util.Random; + + public class ComponentVillageWell extends ComponentVillage { +- public ComponentVillageWell() { +- } +- +- public ComponentVillageWell(ComponentVillageStartPiece var1, int var2, Random var3, int var4, int var5) { +- super(var1, var2); +- this.coordBaseMode = var3.nextInt(4); +- switch(this.coordBaseMode) { +- case 0: +- case 2: +- this.boundingBox = new StructureBoundingBox(var4, 64, var5, var4 + 6 - 1, 78, var5 + 6 - 1); +- break; +- default: +- this.boundingBox = new StructureBoundingBox(var4, 64, var5, var4 + 6 - 1, 78, var5 + 6 - 1); ++ public ComponentVillageWell() {} ++ ++ public ComponentVillageWell(ComponentVillageStartPiece par1ComponentVillageStartPiece, int par2, Random par3Random, int par4, int par5) { ++ super(par1ComponentVillageStartPiece, par2); ++ this.coordBaseMode = par3Random.nextInt(4); ++ ++ switch (this.coordBaseMode) { ++ case 0: ++ case 2: ++ this.boundingBox = new StructureBoundingBox(par4, 64, par5, par4 + 6 - 1, 78, par5 + 6 - 1); ++ break; ++ ++ default: ++ this.boundingBox = new StructureBoundingBox(par4, 64, par5, par4 + 6 - 1, 78, par5 + 6 - 1); + } +- +- } +- +- public void buildComponent(StructureComponent var1, List var2, Random var3) { +- StructureVillagePieces.getNextStructureComponentVillagePath((ComponentVillageStartPiece)var1, var2, var3, this.boundingBox.minX - 1, this.boundingBox.maxY - 4, this.boundingBox.minZ + 1, 1, this.getComponentType()); +- StructureVillagePieces.getNextStructureComponentVillagePath((ComponentVillageStartPiece)var1, var2, var3, this.boundingBox.maxX + 1, this.boundingBox.maxY - 4, this.boundingBox.minZ + 1, 3, this.getComponentType()); +- StructureVillagePieces.getNextStructureComponentVillagePath((ComponentVillageStartPiece)var1, var2, var3, this.boundingBox.minX + 1, this.boundingBox.maxY - 4, this.boundingBox.minZ - 1, 2, this.getComponentType()); +- StructureVillagePieces.getNextStructureComponentVillagePath((ComponentVillageStartPiece)var1, var2, var3, this.boundingBox.minX + 1, this.boundingBox.maxY - 4, this.boundingBox.maxZ + 1, 0, this.getComponentType()); +- } +- +- public boolean addComponentParts(World var1, Random var2, StructureBoundingBox var3) { +- if(this.field_143015_k < 0) { +- this.field_143015_k = this.getAverageGroundLevel(var1, var3); +- if(this.field_143015_k < 0) { ++ } ++ ++ /** ++ * Initiates construction of the Structure Component picked, at the current Location of StructGen ++ */ ++ public void buildComponent(StructureComponent par1StructureComponent, List par2List, Random par3Random) { ++ StructureVillagePieces.getNextStructureComponentVillagePath((ComponentVillageStartPiece)par1StructureComponent, par2List, par3Random, this.boundingBox.minX - 1, this.boundingBox.maxY - 4, this.boundingBox.minZ + 1, 1, this.getComponentType()); ++ StructureVillagePieces.getNextStructureComponentVillagePath((ComponentVillageStartPiece)par1StructureComponent, par2List, par3Random, this.boundingBox.maxX + 1, this.boundingBox.maxY - 4, this.boundingBox.minZ + 1, 3, this.getComponentType()); ++ StructureVillagePieces.getNextStructureComponentVillagePath((ComponentVillageStartPiece)par1StructureComponent, par2List, par3Random, this.boundingBox.minX + 1, this.boundingBox.maxY - 4, this.boundingBox.minZ - 1, 2, this.getComponentType()); ++ StructureVillagePieces.getNextStructureComponentVillagePath((ComponentVillageStartPiece)par1StructureComponent, par2List, par3Random, this.boundingBox.minX + 1, this.boundingBox.maxY - 4, this.boundingBox.maxZ + 1, 0, this.getComponentType()); ++ } ++ ++ /** ++ * second Part of Structure generating, this for example places Spiderwebs, Mob Spawners, it closes Mineshafts at the ++ * end, it adds Fences... ++ */ ++ public boolean addComponentParts(World par1World, Random par2Random, StructureBoundingBox par3StructureBoundingBox) { ++ if (this.field_143015_k < 0) { ++ this.field_143015_k = this.getAverageGroundLevel(par1World, par3StructureBoundingBox); ++ ++ if (this.field_143015_k < 0) { + return true; + } + + this.boundingBox.offset(0, this.field_143015_k - this.boundingBox.maxY + 3, 0); + } + +- this.fillWithBlocks(var1, var3, 1, 0, 1, 4, 12, 4, Block.cobblestone.blockID, Block.waterMoving.blockID, false); +- this.placeBlockAtCurrentPosition(var1, 0, 0, 2, 12, 2, var3); +- this.placeBlockAtCurrentPosition(var1, 0, 0, 3, 12, 2, var3); +- this.placeBlockAtCurrentPosition(var1, 0, 0, 2, 12, 3, var3); +- this.placeBlockAtCurrentPosition(var1, 0, 0, 3, 12, 3, var3); +- this.placeBlockAtCurrentPosition(var1, Block.fence.blockID, 0, 1, 13, 1, var3); +- this.placeBlockAtCurrentPosition(var1, Block.fence.blockID, 0, 1, 14, 1, var3); +- this.placeBlockAtCurrentPosition(var1, Block.fence.blockID, 0, 4, 13, 1, var3); +- this.placeBlockAtCurrentPosition(var1, Block.fence.blockID, 0, 4, 14, 1, var3); +- this.placeBlockAtCurrentPosition(var1, Block.fence.blockID, 0, 1, 13, 4, var3); +- this.placeBlockAtCurrentPosition(var1, Block.fence.blockID, 0, 1, 14, 4, var3); +- this.placeBlockAtCurrentPosition(var1, Block.fence.blockID, 0, 4, 13, 4, var3); +- this.placeBlockAtCurrentPosition(var1, Block.fence.blockID, 0, 4, 14, 4, var3); +- this.fillWithBlocks(var1, var3, 1, 15, 1, 4, 15, 4, Block.cobblestone.blockID, Block.cobblestone.blockID, false); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 1, 0, 1, 4, 12, 4, Block.cobblestone.blockID, Block.waterMoving.blockID, false); ++ this.placeBlockAtCurrentPosition(par1World, 0, 0, 2, 12, 2, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, 0, 0, 3, 12, 2, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, 0, 0, 2, 12, 3, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, 0, 0, 3, 12, 3, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.fence.blockID, 0, 1, 13, 1, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.fence.blockID, 0, 1, 14, 1, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.fence.blockID, 0, 4, 13, 1, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.fence.blockID, 0, 4, 14, 1, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.fence.blockID, 0, 1, 13, 4, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.fence.blockID, 0, 1, 14, 4, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.fence.blockID, 0, 4, 13, 4, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.fence.blockID, 0, 4, 14, 4, par3StructureBoundingBox); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 1, 15, 1, 4, 15, 4, Block.cobblestone.blockID, Block.cobblestone.blockID, false); + +- for(int var4 = 0; var4 <= 5; ++var4) { +- for(int var5 = 0; var5 <= 5; ++var5) { +- if(var5 == 0 || var5 == 5 || var4 == 0 || var4 == 5) { +- this.placeBlockAtCurrentPosition(var1, Block.gravel.blockID, 0, var5, 11, var4, var3); +- this.clearCurrentPositionBlocksUpwards(var1, var5, 12, var4, var3); ++ for (int var4 = 0; var4 <= 5; ++var4) { ++ for (int var5 = 0; var5 <= 5; ++var5) { ++ if (var5 == 0 || var5 == 5 || var4 == 0 || var4 == 5) { ++ this.placeBlockAtCurrentPosition(par1World, Block.gravel.blockID, 0, var5, 11, var4, par3StructureBoundingBox); ++ this.clearCurrentPositionBlocksUpwards(par1World, var5, 12, var4, par3StructureBoundingBox); + } + } + } diff --git a/patches/net/minecraft/src/ComponentVillageWoodHut.java.patch b/patches/net/minecraft/src/ComponentVillageWoodHut.java.patch new file mode 100644 index 0000000..3f4983b --- /dev/null +++ b/patches/net/minecraft/src/ComponentVillageWoodHut.java.patch @@ -0,0 +1,180 @@ +--- net/minecraft/src/ComponentVillageWoodHut.java ++++ net/minecraft/src/ComponentVillageWoodHut.java +@@ -7,93 +7,100 @@ + private boolean isTallHouse; + private int tablePosition; + +- public ComponentVillageWoodHut() { +- } +- +- public ComponentVillageWoodHut(ComponentVillageStartPiece var1, int var2, Random var3, StructureBoundingBox var4, int var5) { +- super(var1, var2); +- this.coordBaseMode = var5; +- this.boundingBox = var4; +- this.isTallHouse = var3.nextBoolean(); +- this.tablePosition = var3.nextInt(3); +- } +- +- protected void func_143012_a(NBTTagCompound var1) { +- super.func_143012_a(var1); +- var1.setInteger("T", this.tablePosition); +- var1.setBoolean("C", this.isTallHouse); +- } +- +- protected void func_143011_b(NBTTagCompound var1) { +- super.func_143011_b(var1); +- this.tablePosition = var1.getInteger("T"); +- this.isTallHouse = var1.getBoolean("C"); +- } +- +- public static ComponentVillageWoodHut func_74908_a(ComponentVillageStartPiece var0, List var1, Random var2, int var3, int var4, int var5, int var6, int var7) { +- StructureBoundingBox var8 = StructureBoundingBox.getComponentToAddBoundingBox(var3, var4, var5, 0, 0, 0, 4, 6, 5, var6); +- return canVillageGoDeeper(var8) && StructureComponent.findIntersecting(var1, var8) == null ? new ComponentVillageWoodHut(var0, var7, var2, var8, var6) : null; +- } +- +- public boolean addComponentParts(World var1, Random var2, StructureBoundingBox var3) { +- if(this.field_143015_k < 0) { +- this.field_143015_k = this.getAverageGroundLevel(var1, var3); +- if(this.field_143015_k < 0) { ++ public ComponentVillageWoodHut() {} ++ ++ public ComponentVillageWoodHut(ComponentVillageStartPiece par1ComponentVillageStartPiece, int par2, Random par3Random, StructureBoundingBox par4StructureBoundingBox, int par5) { ++ super(par1ComponentVillageStartPiece, par2); ++ this.coordBaseMode = par5; ++ this.boundingBox = par4StructureBoundingBox; ++ this.isTallHouse = par3Random.nextBoolean(); ++ this.tablePosition = par3Random.nextInt(3); ++ } ++ ++ protected void func_143012_a(NBTTagCompound par1NBTTagCompound) { ++ super.func_143012_a(par1NBTTagCompound); ++ par1NBTTagCompound.setInteger("T", this.tablePosition); ++ par1NBTTagCompound.setBoolean("C", this.isTallHouse); ++ } ++ ++ protected void func_143011_b(NBTTagCompound par1NBTTagCompound) { ++ super.func_143011_b(par1NBTTagCompound); ++ this.tablePosition = par1NBTTagCompound.getInteger("T"); ++ this.isTallHouse = par1NBTTagCompound.getBoolean("C"); ++ } ++ ++ public static ComponentVillageWoodHut func_74908_a(ComponentVillageStartPiece par0ComponentVillageStartPiece, List par1List, Random par2Random, int par3, int par4, int par5, int par6, int par7) { ++ StructureBoundingBox var8 = StructureBoundingBox.getComponentToAddBoundingBox(par3, par4, par5, 0, 0, 0, 4, 6, 5, par6); ++ return canVillageGoDeeper(var8) && StructureComponent.findIntersecting(par1List, var8) == null ? new ComponentVillageWoodHut(par0ComponentVillageStartPiece, par7, par2Random, var8, par6) : null; ++ } ++ ++ /** ++ * second Part of Structure generating, this for example places Spiderwebs, Mob Spawners, it closes Mineshafts at the ++ * end, it adds Fences... ++ */ ++ public boolean addComponentParts(World par1World, Random par2Random, StructureBoundingBox par3StructureBoundingBox) { ++ if (this.field_143015_k < 0) { ++ this.field_143015_k = this.getAverageGroundLevel(par1World, par3StructureBoundingBox); ++ ++ if (this.field_143015_k < 0) { + return true; + } + + this.boundingBox.offset(0, this.field_143015_k - this.boundingBox.maxY + 6 - 1, 0); + } + +- this.fillWithBlocks(var1, var3, 1, 1, 1, 3, 5, 4, 0, 0, false); +- this.fillWithBlocks(var1, var3, 0, 0, 0, 3, 0, 4, Block.cobblestone.blockID, Block.cobblestone.blockID, false); +- this.fillWithBlocks(var1, var3, 1, 0, 1, 2, 0, 3, Block.dirt.blockID, Block.dirt.blockID, false); +- if(this.isTallHouse) { +- this.fillWithBlocks(var1, var3, 1, 4, 1, 2, 4, 3, Block.wood.blockID, Block.wood.blockID, false); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 1, 1, 1, 3, 5, 4, 0, 0, false); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 0, 0, 0, 3, 0, 4, Block.cobblestone.blockID, Block.cobblestone.blockID, false); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 1, 0, 1, 2, 0, 3, Block.dirt.blockID, Block.dirt.blockID, false); ++ ++ if (this.isTallHouse) { ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 1, 4, 1, 2, 4, 3, Block.wood.blockID, Block.wood.blockID, false); + } else { +- this.fillWithBlocks(var1, var3, 1, 5, 1, 2, 5, 3, Block.wood.blockID, Block.wood.blockID, false); +- } +- +- this.placeBlockAtCurrentPosition(var1, Block.wood.blockID, 0, 1, 4, 0, var3); +- this.placeBlockAtCurrentPosition(var1, Block.wood.blockID, 0, 2, 4, 0, var3); +- this.placeBlockAtCurrentPosition(var1, Block.wood.blockID, 0, 1, 4, 4, var3); +- this.placeBlockAtCurrentPosition(var1, Block.wood.blockID, 0, 2, 4, 4, var3); +- this.placeBlockAtCurrentPosition(var1, Block.wood.blockID, 0, 0, 4, 1, var3); +- this.placeBlockAtCurrentPosition(var1, Block.wood.blockID, 0, 0, 4, 2, var3); +- this.placeBlockAtCurrentPosition(var1, Block.wood.blockID, 0, 0, 4, 3, var3); +- this.placeBlockAtCurrentPosition(var1, Block.wood.blockID, 0, 3, 4, 1, var3); +- this.placeBlockAtCurrentPosition(var1, Block.wood.blockID, 0, 3, 4, 2, var3); +- this.placeBlockAtCurrentPosition(var1, Block.wood.blockID, 0, 3, 4, 3, var3); +- this.fillWithBlocks(var1, var3, 0, 1, 0, 0, 3, 0, Block.wood.blockID, Block.wood.blockID, false); +- this.fillWithBlocks(var1, var3, 3, 1, 0, 3, 3, 0, Block.wood.blockID, Block.wood.blockID, false); +- this.fillWithBlocks(var1, var3, 0, 1, 4, 0, 3, 4, Block.wood.blockID, Block.wood.blockID, false); +- this.fillWithBlocks(var1, var3, 3, 1, 4, 3, 3, 4, Block.wood.blockID, Block.wood.blockID, false); +- this.fillWithBlocks(var1, var3, 0, 1, 1, 0, 3, 3, Block.planks.blockID, Block.planks.blockID, false); +- this.fillWithBlocks(var1, var3, 3, 1, 1, 3, 3, 3, Block.planks.blockID, Block.planks.blockID, false); +- this.fillWithBlocks(var1, var3, 1, 1, 0, 2, 3, 0, Block.planks.blockID, Block.planks.blockID, false); +- this.fillWithBlocks(var1, var3, 1, 1, 4, 2, 3, 4, Block.planks.blockID, Block.planks.blockID, false); +- this.placeBlockAtCurrentPosition(var1, Block.thinGlass.blockID, 0, 0, 2, 2, var3); +- this.placeBlockAtCurrentPosition(var1, Block.thinGlass.blockID, 0, 3, 2, 2, var3); +- if(this.tablePosition > 0) { +- this.placeBlockAtCurrentPosition(var1, Block.fence.blockID, 0, this.tablePosition, 1, 3, var3); +- this.placeBlockAtCurrentPosition(var1, Block.pressurePlatePlanks.blockID, 0, this.tablePosition, 2, 3, var3); +- } +- +- this.placeBlockAtCurrentPosition(var1, 0, 0, 1, 1, 0, var3); +- this.placeBlockAtCurrentPosition(var1, 0, 0, 1, 2, 0, var3); +- this.placeDoorAtCurrentPosition(var1, var3, var2, 1, 1, 0, this.getMetadataWithOffset(Block.doorWood.blockID, 1)); +- if(this.getBlockIdAtCurrentPosition(var1, 1, 0, -1, var3) == 0 && this.getBlockIdAtCurrentPosition(var1, 1, -1, -1, var3) != 0) { +- this.placeBlockAtCurrentPosition(var1, Block.stairsCobblestone.blockID, this.getMetadataWithOffset(Block.stairsCobblestone.blockID, 3), 1, 0, -1, var3); +- } +- +- for(int var4 = 0; var4 < 5; ++var4) { +- for(int var5 = 0; var5 < 4; ++var5) { +- this.clearCurrentPositionBlocksUpwards(var1, var5, 6, var4, var3); +- this.fillCurrentPositionBlocksDownwards(var1, Block.cobblestone.blockID, 0, var5, -1, var4, var3); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 1, 5, 1, 2, 5, 3, Block.wood.blockID, Block.wood.blockID, false); ++ } ++ ++ this.placeBlockAtCurrentPosition(par1World, Block.wood.blockID, 0, 1, 4, 0, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.wood.blockID, 0, 2, 4, 0, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.wood.blockID, 0, 1, 4, 4, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.wood.blockID, 0, 2, 4, 4, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.wood.blockID, 0, 0, 4, 1, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.wood.blockID, 0, 0, 4, 2, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.wood.blockID, 0, 0, 4, 3, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.wood.blockID, 0, 3, 4, 1, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.wood.blockID, 0, 3, 4, 2, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.wood.blockID, 0, 3, 4, 3, par3StructureBoundingBox); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 0, 1, 0, 0, 3, 0, Block.wood.blockID, Block.wood.blockID, false); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 3, 1, 0, 3, 3, 0, Block.wood.blockID, Block.wood.blockID, false); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 0, 1, 4, 0, 3, 4, Block.wood.blockID, Block.wood.blockID, false); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 3, 1, 4, 3, 3, 4, Block.wood.blockID, Block.wood.blockID, false); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 0, 1, 1, 0, 3, 3, Block.planks.blockID, Block.planks.blockID, false); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 3, 1, 1, 3, 3, 3, Block.planks.blockID, Block.planks.blockID, false); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 1, 1, 0, 2, 3, 0, Block.planks.blockID, Block.planks.blockID, false); ++ this.fillWithBlocks(par1World, par3StructureBoundingBox, 1, 1, 4, 2, 3, 4, Block.planks.blockID, Block.planks.blockID, false); ++ this.placeBlockAtCurrentPosition(par1World, Block.thinGlass.blockID, 0, 0, 2, 2, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.thinGlass.blockID, 0, 3, 2, 2, par3StructureBoundingBox); ++ ++ if (this.tablePosition > 0) { ++ this.placeBlockAtCurrentPosition(par1World, Block.fence.blockID, 0, this.tablePosition, 1, 3, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, Block.pressurePlatePlanks.blockID, 0, this.tablePosition, 2, 3, par3StructureBoundingBox); ++ } ++ ++ this.placeBlockAtCurrentPosition(par1World, 0, 0, 1, 1, 0, par3StructureBoundingBox); ++ this.placeBlockAtCurrentPosition(par1World, 0, 0, 1, 2, 0, par3StructureBoundingBox); ++ this.placeDoorAtCurrentPosition(par1World, par3StructureBoundingBox, par2Random, 1, 1, 0, this.getMetadataWithOffset(Block.doorWood.blockID, 1)); ++ ++ if (this.getBlockIdAtCurrentPosition(par1World, 1, 0, -1, par3StructureBoundingBox) == 0 && this.getBlockIdAtCurrentPosition(par1World, 1, -1, -1, par3StructureBoundingBox) != 0) { ++ this.placeBlockAtCurrentPosition(par1World, Block.stairsCobblestone.blockID, this.getMetadataWithOffset(Block.stairsCobblestone.blockID, 3), 1, 0, -1, par3StructureBoundingBox); ++ } ++ ++ for (int var4 = 0; var4 < 5; ++var4) { ++ for (int var5 = 0; var5 < 4; ++var5) { ++ this.clearCurrentPositionBlocksUpwards(par1World, var5, 6, var4, par3StructureBoundingBox); ++ this.fillCurrentPositionBlocksDownwards(par1World, Block.cobblestone.blockID, 0, var5, -1, var4, par3StructureBoundingBox); + } + } + +- this.spawnVillagers(var1, var3, 1, 1, 2, 1); ++ this.spawnVillagers(par1World, par3StructureBoundingBox, 1, 1, 2, 1); + return true; + } + } diff --git a/patches/net/minecraft/src/CompressedStreamTools.java.patch b/patches/net/minecraft/src/CompressedStreamTools.java.patch new file mode 100644 index 0000000..78ca1b7 --- /dev/null +++ b/patches/net/minecraft/src/CompressedStreamTools.java.patch @@ -0,0 +1,161 @@ +--- net/minecraft/src/CompressedStreamTools.java ++++ net/minecraft/src/CompressedStreamTools.java +@@ -17,12 +17,16 @@ + import java.util.zip.GZIPOutputStream; + + public class CompressedStreamTools { +- public static NBTTagCompound readCompressed(InputStream var0) throws IOException { +- DataInputStream var1 = new DataInputStream(new BufferedInputStream(new GZIPInputStream(var0))); + ++ /** ++ * Load the gzipped compound from the inputstream. ++ */ ++ public static NBTTagCompound readCompressed(InputStream par0InputStream) throws IOException { ++ DataInputStream var1 = new DataInputStream(new BufferedInputStream(new GZIPInputStream(par0InputStream))); + NBTTagCompound var2; ++ + try { +- var2 = read((DataInput)var1); ++ var2 = read(var1); + } finally { + var1.close(); + } +@@ -30,23 +34,25 @@ + return var2; + } + +- public static void writeCompressed(NBTTagCompound var0, OutputStream var1) throws IOException { +- DataOutputStream var2 = new DataOutputStream(new GZIPOutputStream(var1)); ++ /** ++ * Write the compound, gzipped, to the outputstream. ++ */ ++ public static void writeCompressed(NBTTagCompound par0NBTTagCompound, OutputStream par1OutputStream) throws IOException { ++ DataOutputStream var2 = new DataOutputStream(new GZIPOutputStream(par1OutputStream)); + + try { +- write(var0, (DataOutput)var2); ++ write(par0NBTTagCompound, var2); + } finally { + var2.close(); + } +- + } + +- public static NBTTagCompound decompress(byte[] var0) throws IOException { +- DataInputStream var1 = new DataInputStream(new BufferedInputStream(new GZIPInputStream(new ByteArrayInputStream(var0)))); +- ++ public static NBTTagCompound decompress(byte[] par0ArrayOfByte) throws IOException { ++ DataInputStream var1 = new DataInputStream(new BufferedInputStream(new GZIPInputStream(new ByteArrayInputStream(par0ArrayOfByte)))); + NBTTagCompound var2; ++ + try { +- var2 = read((DataInput)var1); ++ var2 = read(var1); + } finally { + var1.close(); + } +@@ -54,12 +60,12 @@ + return var2; + } + +- public static byte[] compress(NBTTagCompound var0) throws IOException { ++ public static byte[] compress(NBTTagCompound par0NBTTagCompound) throws IOException { + ByteArrayOutputStream var1 = new ByteArrayOutputStream(); + DataOutputStream var2 = new DataOutputStream(new GZIPOutputStream(var1)); + + try { +- write(var0, (DataOutput)var2); ++ write(par0NBTTagCompound, var2); + } finally { + var2.close(); + } +@@ -67,44 +73,45 @@ + return var1.toByteArray(); + } + +- public static void safeWrite(NBTTagCompound var0, File var1) throws IOException { +- File var2 = new File(var1.getAbsolutePath() + "_tmp"); +- if(var2.exists()) { ++ public static void safeWrite(NBTTagCompound par0NBTTagCompound, File par1File) throws IOException { ++ File var2 = new File(par1File.getAbsolutePath() + "_tmp"); ++ ++ if (var2.exists()) { + var2.delete(); + } + +- write(var0, var2); +- if(var1.exists()) { +- var1.delete(); ++ write(par0NBTTagCompound, var2); ++ ++ if (par1File.exists()) { ++ par1File.delete(); + } + +- if(var1.exists()) { +- throw new IOException("Failed to delete " + var1); ++ if (par1File.exists()) { ++ throw new IOException("Failed to delete " + par1File); + } else { +- var2.renameTo(var1); ++ var2.renameTo(par1File); + } + } + +- public static void write(NBTTagCompound var0, File var1) throws IOException { +- DataOutputStream var2 = new DataOutputStream(new FileOutputStream(var1)); ++ public static void write(NBTTagCompound par0NBTTagCompound, File par1File) throws IOException { ++ DataOutputStream var2 = new DataOutputStream(new FileOutputStream(par1File)); + + try { +- write(var0, (DataOutput)var2); ++ write(par0NBTTagCompound, var2); + } finally { + var2.close(); + } +- + } + +- public static NBTTagCompound read(File var0) throws IOException { +- if(!var0.exists()) { ++ public static NBTTagCompound read(File par0File) throws IOException { ++ if (!par0File.exists()) { + return null; + } else { +- DataInputStream var1 = new DataInputStream(new FileInputStream(var0)); +- ++ DataInputStream var1 = new DataInputStream(new FileInputStream(par0File)); + NBTTagCompound var2; ++ + try { +- var2 = read((DataInput)var1); ++ var2 = read(var1); + } finally { + var1.close(); + } +@@ -113,16 +120,20 @@ + } + } + +- public static NBTTagCompound read(DataInput var0) throws IOException { +- NBTBase var1 = NBTBase.readNamedTag(var0); +- if(var1 instanceof NBTTagCompound) { ++ /** ++ * Reads from a CompressedStream. ++ */ ++ public static NBTTagCompound read(DataInput par0DataInput) throws IOException { ++ NBTBase var1 = NBTBase.readNamedTag(par0DataInput); ++ ++ if (var1 instanceof NBTTagCompound) { + return (NBTTagCompound)var1; + } else { + throw new IOException("Root tag must be a named compound tag"); + } + } + +- public static void write(NBTTagCompound var0, DataOutput var1) throws IOException { +- NBTBase.writeNamedTag(var0, var1); ++ public static void write(NBTTagCompound par0NBTTagCompound, DataOutput par1DataOutput) throws IOException { ++ NBTBase.writeNamedTag(par0NBTTagCompound, par1DataOutput); + } + } diff --git a/patches/net/minecraft/src/Container.java.patch b/patches/net/minecraft/src/Container.java.patch new file mode 100644 index 0000000..f62a0cc --- /dev/null +++ b/patches/net/minecraft/src/Container.java.patch @@ -0,0 +1,961 @@ +--- net/minecraft/src/Container.java ++++ net/minecraft/src/Container.java +@@ -7,71 +7,106 @@ + import java.util.Set; + + public abstract class Container { +- public List b = new ArrayList(); +- public List c = new ArrayList(); ++ ++ /** the list of all items(stacks) for the corresponding slot */ ++ public List inventoryItemStacks = new ArrayList(); ++ ++ /** the list of all slots in the inventory */ ++ public List inventorySlots = new ArrayList(); + public int windowId; + private short transactionID; + private int field_94535_f = -1; + private int field_94536_g; +- private final Set h = new HashSet(); +- protected List e = new ArrayList(); +- private Set i = new HashSet(); +- +- protected Slot addSlotToContainer(Slot var1) { +- var1.slotNumber = this.c.size(); +- this.c.add(var1); +- this.b.add((Object)null); +- return var1; +- } +- +- public void onCraftGuiOpened(ICrafting var1) { +- if(this.e.contains(var1)) { ++ private final Set field_94537_h = new HashSet(); ++ ++ /** ++ * list of all people that need to be notified when this craftinventory changes ++ */ ++ protected List crafters = new ArrayList(); ++ private Set playerList = new HashSet(); ++ ++ /** ++ * the slot is assumed empty ++ */ ++ ++ // Spout Start - Inventory sorting ++ public IInventory getIInventory() { ++ return null; ++ } ++ ++ public boolean isSortableInventory() { ++ return false; ++ } ++ // Spout End ++ ++ protected Slot addSlotToContainer(Slot par1Slot) { ++ par1Slot.slotNumber = this.inventorySlots.size(); ++ this.inventorySlots.add(par1Slot); ++ this.inventoryItemStacks.add((Object)null); ++ return par1Slot; ++ } ++ ++ public void addCraftingToCrafters(ICrafting par1ICrafting) { ++ if (this.crafters.contains(par1ICrafting)) { + throw new IllegalArgumentException("Listener already listening"); + } else { +- this.e.add(var1); +- var1.updateCraftingInventory(this, this.getInventory()); ++ this.crafters.add(par1ICrafting); ++ par1ICrafting.sendContainerAndContentsToPlayer(this, this.getInventory()); + this.detectAndSendChanges(); + } + } + +- public void removeCraftingFromCrafters(ICrafting var1) { +- this.e.remove(var1); ++ /** ++ * Remove this crafting listener from the listener list. ++ */ ++ public void removeCraftingFromCrafters(ICrafting par1ICrafting) { ++ this.crafters.remove(par1ICrafting); + } + ++ /** ++ * returns a list if itemStacks, for each slot. ++ */ + public List getInventory() { + ArrayList var1 = new ArrayList(); + +- for(int var2 = 0; var2 < this.c.size(); ++var2) { +- var1.add(((Slot)this.c.get(var2)).getStack()); ++ for (int var2 = 0; var2 < this.inventorySlots.size(); ++var2) { ++ var1.add(((Slot)this.inventorySlots.get(var2)).getStack()); + } + + return var1; + } + ++ /** ++ * Looks for changes made in the container, sends them to every listener. ++ */ + public void detectAndSendChanges() { +- for(int var1 = 0; var1 < this.c.size(); ++var1) { +- ItemStack var2 = ((Slot)this.c.get(var1)).getStack(); +- ItemStack var3 = (ItemStack)this.b.get(var1); +- if(!ItemStack.areItemStacksEqual(var3, var2)) { ++ for (int var1 = 0; var1 < this.inventorySlots.size(); ++var1) { ++ ItemStack var2 = ((Slot)this.inventorySlots.get(var1)).getStack(); ++ ItemStack var3 = (ItemStack)this.inventoryItemStacks.get(var1); ++ ++ if (!ItemStack.areItemStacksEqual(var3, var2)) { + var3 = var2 == null ? null : var2.copy(); +- this.b.set(var1, var3); ++ this.inventoryItemStacks.set(var1, var3); + +- for(int var4 = 0; var4 < this.e.size(); ++var4) { +- ((ICrafting)this.e.get(var4)).sendSlotContents(this, var1, var3); ++ for (int var4 = 0; var4 < this.crafters.size(); ++var4) { ++ ((ICrafting)this.crafters.get(var4)).sendSlotContents(this, var1, var3); + } + } + } +- + } + +- public boolean enchantItem(EntityPlayer var1, int var2) { ++ /** ++ * enchants the item on the table using the specified slot; also deducts XP from player ++ */ ++ public boolean enchantItem(EntityPlayer par1EntityPlayer, int par2) { + return false; + } + +- public Slot getSlotFromInventory(IInventory var1, int var2) { +- for(int var3 = 0; var3 < this.c.size(); ++var3) { +- Slot var4 = (Slot)this.c.get(var3); +- if(var4.isHere(var1, var2)) { ++ public Slot getSlotFromInventory(IInventory par1IInventory, int par2) { ++ for (int var3 = 0; var3 < this.inventorySlots.size(); ++var3) { ++ Slot var4 = (Slot)this.inventorySlots.get(var3); ++ ++ if (var4.isSlotInInventory(par1IInventory, par2)) { + return var4; + } + } +@@ -79,57 +114,66 @@ + return null; + } + +- public Slot getSlot(int var1) { +- return (Slot)this.c.get(var1); ++ public Slot getSlot(int par1) { ++ return (Slot)this.inventorySlots.get(par1); + } + +- public ItemStack transferStackInSlot(EntityPlayer var1, int var2) { +- Slot var3 = (Slot)this.c.get(var2); ++ /** ++ * Called when a player shift-clicks on a slot. You must override this or you will crash when someone does that. ++ */ ++ public ItemStack transferStackInSlot(EntityPlayer par1EntityPlayer, int par2) { ++ Slot var3 = (Slot)this.inventorySlots.get(par2); + return var3 != null ? var3.getStack() : null; + } + +- public ItemStack slotClick(int var1, int var2, int var3, EntityPlayer var4) { ++ public ItemStack slotClick(int par1, int par2, int par3, EntityPlayer par4EntityPlayer) { + ItemStack var5 = null; +- InventoryPlayer var6 = var4.inventory; ++ InventoryPlayer var6 = par4EntityPlayer.inventory; + int var9; + ItemStack var17; +- if(var3 == 5) { ++ ++ if (par3 == 5) { + int var7 = this.field_94536_g; +- this.field_94536_g = func_94532_c(var2); +- if((var7 != 1 || this.field_94536_g != 2) && var7 != this.field_94536_g) { +- this.func_94533_d(); +- } else if(var6.getItemStack() == null) { +- this.func_94533_d(); +- } else if(this.field_94536_g == 0) { +- this.field_94535_f = func_94529_b(var2); +- if(func_94528_d(this.field_94535_f)) { ++ this.field_94536_g = func_94532_c(par2); ++ ++ if ((var7 != 1 || this.field_94536_g != 2) && var7 != this.field_94536_g) { ++ this.func_94533_d(); ++ } else if (var6.getItemStack() == null) { ++ this.func_94533_d(); ++ } else if (this.field_94536_g == 0) { ++ this.field_94535_f = func_94529_b(par2); ++ ++ if (func_94528_d(this.field_94535_f)) { + this.field_94536_g = 1; +- this.h.clear(); ++ this.field_94537_h.clear(); + } else { + this.func_94533_d(); + } +- } else if(this.field_94536_g == 1) { +- Slot var8 = (Slot)this.c.get(var1); +- if(var8 != null && func_94527_a(var8, var6.getItemStack(), true) && var8.isItemValid(var6.getItemStack()) && var6.getItemStack().stackSize > this.h.size() && this.canDragIntoSlot(var8)) { +- this.h.add(var8); ++ } else if (this.field_94536_g == 1) { ++ Slot var8 = (Slot)this.inventorySlots.get(par1); ++ ++ if (var8 != null && func_94527_a(var8, var6.getItemStack(), true) && var8.isItemValid(var6.getItemStack()) && var6.getItemStack().stackSize > this.field_94537_h.size() && this.canDragIntoSlot(var8)) { ++ this.field_94537_h.add(var8); + } +- } else if(this.field_94536_g == 2) { +- if(!this.h.isEmpty()) { ++ } else if (this.field_94536_g == 2) { ++ if (!this.field_94537_h.isEmpty()) { + var17 = var6.getItemStack().copy(); + var9 = var6.getItemStack().stackSize; +- Iterator var10 = this.h.iterator(); ++ Iterator var10 = this.field_94537_h.iterator(); + +- while(var10.hasNext()) { ++ while (var10.hasNext()) { + Slot var11 = (Slot)var10.next(); +- if(var11 != null && func_94527_a(var11, var6.getItemStack(), true) && var11.isItemValid(var6.getItemStack()) && var6.getItemStack().stackSize >= this.h.size() && this.canDragIntoSlot(var11)) { ++ ++ if (var11 != null && func_94527_a(var11, var6.getItemStack(), true) && var11.isItemValid(var6.getItemStack()) && var6.getItemStack().stackSize >= this.field_94537_h.size() && this.canDragIntoSlot(var11)) { + ItemStack var12 = var17.copy(); + int var13 = var11.getHasStack() ? var11.getStack().stackSize : 0; +- func_94525_a(this.h, this.field_94535_f, var12, var13); +- if(var12.stackSize > var12.getMaxStackSize()) { ++ func_94525_a(this.field_94537_h, this.field_94535_f, var12, var13); ++ ++ if (var12.stackSize > var12.getMaxStackSize()) { + var12.stackSize = var12.getMaxStackSize(); + } + +- if(var12.stackSize > var11.getSlotStackLimit()) { ++ if (var12.stackSize > var11.getSlotStackLimit()) { + var12.stackSize = var11.getSlotStackLimit(); + } + +@@ -139,7 +183,8 @@ + } + + var17.stackSize = var9; +- if(var17.stackSize <= 0) { ++ ++ if (var17.stackSize <= 0) { + var17 = null; + } + +@@ -150,112 +195,125 @@ + } else { + this.func_94533_d(); + } +- } else if(this.field_94536_g != 0) { ++ } else if (this.field_94536_g != 0) { + this.func_94533_d(); + } else { + Slot var16; +- int var19; +- ItemStack var22; +- if((var3 == 0 || var3 == 1) && (var2 == 0 || var2 == 1)) { +- if(var1 == -999) { +- if(var6.getItemStack() != null && var1 == -999) { +- if(var2 == 0) { +- var4.dropPlayerItem(var6.getItemStack()); ++ int var21; ++ ItemStack var23; ++ ++ if ((par3 == 0 || par3 == 1) && (par2 == 0 || par2 == 1)) { ++ if (par1 == -999) { ++ if (var6.getItemStack() != null && par1 == -999) { ++ if (par2 == 0) { ++ par4EntityPlayer.dropPlayerItem(var6.getItemStack()); + var6.setItemStack((ItemStack)null); + } + +- if(var2 == 1) { +- var4.dropPlayerItem(var6.getItemStack().splitStack(1)); +- if(var6.getItemStack().stackSize == 0) { ++ if (par2 == 1) { ++ par4EntityPlayer.dropPlayerItem(var6.getItemStack().splitStack(1)); ++ ++ if (var6.getItemStack().stackSize == 0) { + var6.setItemStack((ItemStack)null); + } + } + } +- } else if(var3 == 1) { +- if(var1 < 0) { ++ } else if (par3 == 1) { ++ if (par1 < 0) { + return null; + } + +- var16 = (Slot)this.c.get(var1); +- if(var16 != null && var16.canTakeStack(var4)) { +- var17 = this.transferStackInSlot(var4, var1); +- if(var17 != null) { ++ var16 = (Slot)this.inventorySlots.get(par1); ++ ++ if (var16 != null && var16.canTakeStack(par4EntityPlayer)) { ++ var17 = this.transferStackInSlot(par4EntityPlayer, par1); ++ ++ if (var17 != null) { + var9 = var17.itemID; + var5 = var17.copy(); +- if(var16 != null && var16.getStack() != null && var16.getStack().itemID == var9) { +- this.retrySlotClick(var1, var2, true, var4); ++ ++ if (var16 != null && var16.getStack() != null && var16.getStack().itemID == var9) { ++ this.retrySlotClick(par1, par2, true, par4EntityPlayer); + } + } + } + } else { +- if(var1 < 0) { ++ if (par1 < 0) { + return null; + } + +- var16 = (Slot)this.c.get(var1); +- if(var16 != null) { ++ var16 = (Slot)this.inventorySlots.get(par1); ++ ++ if (var16 != null) { + var17 = var16.getStack(); +- ItemStack var20 = var6.getItemStack(); +- if(var17 != null) { ++ ItemStack var19 = var6.getItemStack(); ++ ++ if (var17 != null) { + var5 = var17.copy(); + } + +- if(var17 == null) { +- if(var20 != null && var16.isItemValid(var20)) { +- var19 = var2 == 0 ? var20.stackSize : 1; +- if(var19 > var16.getSlotStackLimit()) { +- var19 = var16.getSlotStackLimit(); +- } +- +- if(var20.stackSize >= var19) { +- var16.putStack(var20.splitStack(var19)); +- } +- +- if(var20.stackSize == 0) { ++ if (var17 == null) { ++ if (var19 != null && var16.isItemValid(var19)) { ++ var21 = par2 == 0 ? var19.stackSize : 1; ++ ++ if (var21 > var16.getSlotStackLimit()) { ++ var21 = var16.getSlotStackLimit(); ++ } ++ ++ if (var19.stackSize >= var21) { ++ var16.putStack(var19.splitStack(var21)); ++ } ++ ++ if (var19.stackSize == 0) { + var6.setItemStack((ItemStack)null); + } + } +- } else if(var16.canTakeStack(var4)) { +- if(var20 == null) { +- var19 = var2 == 0 ? var17.stackSize : (var17.stackSize + 1) / 2; +- var22 = var16.decrStackSize(var19); +- var6.setItemStack(var22); +- if(var17.stackSize == 0) { ++ } else if (var16.canTakeStack(par4EntityPlayer)) { ++ if (var19 == null) { ++ var21 = par2 == 0 ? var17.stackSize : (var17.stackSize + 1) / 2; ++ var23 = var16.decrStackSize(var21); ++ var6.setItemStack(var23); ++ ++ if (var17.stackSize == 0) { + var16.putStack((ItemStack)null); + } + +- var16.onPickupFromSlot(var4, var6.getItemStack()); +- } else if(var16.isItemValid(var20)) { +- if(var17.itemID == var20.itemID && var17.getItemDamage() == var20.getItemDamage() && ItemStack.areItemStackTagsEqual(var17, var20)) { +- var19 = var2 == 0 ? var20.stackSize : 1; +- if(var19 > var16.getSlotStackLimit() - var17.stackSize) { +- var19 = var16.getSlotStackLimit() - var17.stackSize; +- } +- +- if(var19 > var20.getMaxStackSize() - var17.stackSize) { +- var19 = var20.getMaxStackSize() - var17.stackSize; +- } +- +- var20.splitStack(var19); +- if(var20.stackSize == 0) { ++ var16.onPickupFromSlot(par4EntityPlayer, var6.getItemStack()); ++ } else if (var16.isItemValid(var19)) { ++ if (var17.itemID == var19.itemID && var17.getItemDamage() == var19.getItemDamage() && ItemStack.areItemStackTagsEqual(var17, var19)) { ++ var21 = par2 == 0 ? var19.stackSize : 1; ++ ++ if (var21 > var16.getSlotStackLimit() - var17.stackSize) { ++ var21 = var16.getSlotStackLimit() - var17.stackSize; ++ } ++ ++ if (var21 > var19.getMaxStackSize() - var17.stackSize) { ++ var21 = var19.getMaxStackSize() - var17.stackSize; ++ } ++ ++ var19.splitStack(var21); ++ ++ if (var19.stackSize == 0) { + var6.setItemStack((ItemStack)null); + } + +- var17.stackSize += var19; +- } else if(var20.stackSize <= var16.getSlotStackLimit()) { +- var16.putStack(var20); ++ var17.stackSize += var21; ++ } else if (var19.stackSize <= var16.getSlotStackLimit()) { ++ var16.putStack(var19); + var6.setItemStack(var17); + } +- } else if(var17.itemID == var20.itemID && var20.getMaxStackSize() > 1 && (!var17.getHasSubtypes() || var17.getItemDamage() == var20.getItemDamage()) && ItemStack.areItemStackTagsEqual(var17, var20)) { +- var19 = var17.stackSize; +- if(var19 > 0 && var19 + var20.stackSize <= var20.getMaxStackSize()) { +- var20.stackSize += var19; +- var17 = var16.decrStackSize(var19); +- if(var17.stackSize == 0) { ++ } else if (var17.itemID == var19.itemID && var19.getMaxStackSize() > 1 && (!var17.getHasSubtypes() || var17.getItemDamage() == var19.getItemDamage()) && ItemStack.areItemStackTagsEqual(var17, var19)) { ++ var21 = var17.stackSize; ++ ++ if (var21 > 0 && var21 + var19.stackSize <= var19.getMaxStackSize()) { ++ var19.stackSize += var21; ++ var17 = var16.decrStackSize(var21); ++ ++ if (var17.stackSize == 0) { + var16.putStack((ItemStack)null); + } + +- var16.onPickupFromSlot(var4, var6.getItemStack()); ++ var16.onPickupFromSlot(par4EntityPlayer, var6.getItemStack()); + } + } + } +@@ -263,70 +321,78 @@ + var16.onSlotChanged(); + } + } +- } else if(var3 == 2 && var2 >= 0 && var2 < 9) { +- var16 = (Slot)this.c.get(var1); +- if(var16.canTakeStack(var4)) { +- var17 = var6.getStackInSlot(var2); ++ } else if (par3 == 2 && par2 >= 0 && par2 < 9) { ++ var16 = (Slot)this.inventorySlots.get(par1); ++ ++ if (var16.canTakeStack(par4EntityPlayer)) { ++ var17 = var6.getStackInSlot(par2); + boolean var18 = var17 == null || var16.inventory == var6 && var16.isItemValid(var17); +- var19 = -1; +- if(!var18) { +- var19 = var6.getFirstEmptyStack(); +- var18 |= var19 > -1; ++ var21 = -1; ++ ++ if (!var18) { ++ var21 = var6.getFirstEmptyStack(); ++ var18 |= var21 > -1; + } + +- if(var16.getHasStack() && var18) { +- var22 = var16.getStack(); +- var6.setInventorySlotContents(var2, var22.copy()); +- if((var16.inventory != var6 || !var16.isItemValid(var17)) && var17 != null) { +- if(var19 > -1) { ++ if (var16.getHasStack() && var18) { ++ var23 = var16.getStack(); ++ var6.setInventorySlotContents(par2, var23.copy()); ++ ++ if ((var16.inventory != var6 || !var16.isItemValid(var17)) && var17 != null) { ++ if (var21 > -1) { + var6.addItemStackToInventory(var17); +- var16.decrStackSize(var22.stackSize); ++ var16.decrStackSize(var23.stackSize); + var16.putStack((ItemStack)null); +- var16.onPickupFromSlot(var4, var22); ++ var16.onPickupFromSlot(par4EntityPlayer, var23); + } + } else { +- var16.decrStackSize(var22.stackSize); ++ var16.decrStackSize(var23.stackSize); + var16.putStack(var17); +- var16.onPickupFromSlot(var4, var22); ++ var16.onPickupFromSlot(par4EntityPlayer, var23); + } +- } else if(!var16.getHasStack() && var17 != null && var16.isItemValid(var17)) { +- var6.setInventorySlotContents(var2, (ItemStack)null); ++ } else if (!var16.getHasStack() && var17 != null && var16.isItemValid(var17)) { ++ var6.setInventorySlotContents(par2, (ItemStack)null); + var16.putStack(var17); + } + } +- } else if(var3 == 3 && var4.capabilities.isCreativeMode && var6.getItemStack() == null && var1 >= 0) { +- var16 = (Slot)this.c.get(var1); +- if(var16 != null && var16.getHasStack()) { ++ } else if (par3 == 3 && par4EntityPlayer.capabilities.isCreativeMode && var6.getItemStack() == null && par1 >= 0) { ++ var16 = (Slot)this.inventorySlots.get(par1); ++ ++ if (var16 != null && var16.getHasStack()) { + var17 = var16.getStack().copy(); + var17.stackSize = var17.getMaxStackSize(); + var6.setItemStack(var17); + } +- } else if(var3 == 4 && var6.getItemStack() == null && var1 >= 0) { +- var16 = (Slot)this.c.get(var1); +- if(var16 != null && var16.getHasStack() && var16.canTakeStack(var4)) { +- var17 = var16.decrStackSize(var2 == 0 ? 1 : var16.getStack().stackSize); +- var16.onPickupFromSlot(var4, var17); +- var4.dropPlayerItem(var17); ++ } else if (par3 == 4 && var6.getItemStack() == null && par1 >= 0) { ++ var16 = (Slot)this.inventorySlots.get(par1); ++ ++ if (var16 != null && var16.getHasStack() && var16.canTakeStack(par4EntityPlayer)) { ++ var17 = var16.decrStackSize(par2 == 0 ? 1 : var16.getStack().stackSize); ++ var16.onPickupFromSlot(par4EntityPlayer, var17); ++ par4EntityPlayer.dropPlayerItem(var17); + } +- } else if(var3 == 6 && var1 >= 0) { +- var16 = (Slot)this.c.get(var1); ++ } else if (par3 == 6 && par1 >= 0) { ++ var16 = (Slot)this.inventorySlots.get(par1); + var17 = var6.getItemStack(); +- if(var17 != null && (var16 == null || !var16.getHasStack() || !var16.canTakeStack(var4))) { +- var9 = var2 == 0 ? 0 : this.c.size() - 1; +- var19 = var2 == 0 ? 1 : -1; +- +- for(int var21 = 0; var21 < 2; ++var21) { +- for(int var23 = var9; var23 >= 0 && var23 < this.c.size() && var17.stackSize < var17.getMaxStackSize(); var23 += var19) { +- Slot var24 = (Slot)this.c.get(var23); +- if(var24.getHasStack() && func_94527_a(var24, var17, true) && var24.canTakeStack(var4) && this.func_94530_a(var17, var24) && (var21 != 0 || var24.getStack().stackSize != var24.getStack().getMaxStackSize())) { ++ ++ if (var17 != null && (var16 == null || !var16.getHasStack() || !var16.canTakeStack(par4EntityPlayer))) { ++ var9 = par2 == 0 ? 0 : this.inventorySlots.size() - 1; ++ var21 = par2 == 0 ? 1 : -1; ++ ++ for (int var20 = 0; var20 < 2; ++var20) { ++ for (int var22 = var9; var22 >= 0 && var22 < this.inventorySlots.size() && var17.stackSize < var17.getMaxStackSize(); var22 += var21) { ++ Slot var24 = (Slot)this.inventorySlots.get(var22); ++ ++ if (var24.getHasStack() && func_94527_a(var24, var17, true) && var24.canTakeStack(par4EntityPlayer) && this.func_94530_a(var17, var24) && (var20 != 0 || var24.getStack().stackSize != var24.getStack().getMaxStackSize())) { + int var14 = Math.min(var17.getMaxStackSize() - var17.stackSize, var24.getStack().stackSize); + ItemStack var15 = var24.decrStackSize(var14); + var17.stackSize += var14; +- if(var15.stackSize <= 0) { ++ ++ if (var15.stackSize <= 0) { + var24.putStack((ItemStack)null); + } + +- var24.onPickupFromSlot(var4, var15); ++ var24.onPickupFromSlot(par4EntityPlayer, var15); + } + } + } +@@ -339,189 +405,223 @@ + return var5; + } + +- public boolean func_94530_a(ItemStack var1, Slot var2) { ++ public boolean func_94530_a(ItemStack par1ItemStack, Slot par2Slot) { + return true; + } + +- protected void retrySlotClick(int var1, int var2, boolean var3, EntityPlayer var4) { +- this.slotClick(var1, var2, 1, var4); ++ protected void retrySlotClick(int par1, int par2, boolean par3, EntityPlayer par4EntityPlayer) { ++ this.slotClick(par1, par2, 1, par4EntityPlayer); + } + +- public void onContainerClosed(EntityPlayer var1) { +- InventoryPlayer var2 = var1.inventory; +- if(var2.getItemStack() != null) { +- var1.dropPlayerItem(var2.getItemStack()); ++ /** ++ * Called when the container is closed. ++ */ ++ public void onContainerClosed(EntityPlayer par1EntityPlayer) { ++ InventoryPlayer var2 = par1EntityPlayer.inventory; ++ ++ if (var2.getItemStack() != null) { ++ par1EntityPlayer.dropPlayerItem(var2.getItemStack()); + var2.setItemStack((ItemStack)null); + } +- +- } +- +- public void onCraftMatrixChanged(IInventory var1) { +- this.detectAndSendChanges(); +- } +- +- public void putStackInSlot(int var1, ItemStack var2) { +- this.getSlot(var1).putStack(var2); +- } +- +- public void putStacksInSlots(ItemStack[] var1) { +- for(int var2 = 0; var2 < var1.length; ++var2) { +- this.getSlot(var2).putStack(var1[var2]); +- } +- +- } +- +- public void updateProgressBar(int var1, int var2) { +- } +- +- public short getNextTransactionID(InventoryPlayer var1) { +- ++this.transactionID; +- return this.transactionID; +- } +- +- public boolean getCanCraft(EntityPlayer var1) { +- return !this.i.contains(var1); +- } +- +- public void setCanCraft(EntityPlayer var1, boolean var2) { +- if(var2) { +- this.i.remove(var1); +- } else { +- this.i.add(var1); +- } +- +- } +- +- public abstract boolean canInteractWith(EntityPlayer var1); +- +- protected boolean mergeItemStack(ItemStack var1, int var2, int var3, boolean var4) { +- boolean var5 = false; +- int var6 = var2; +- if(var4) { +- var6 = var3 - 1; +- } +- +- Slot var7; +- ItemStack var8; +- if(var1.isStackable()) { +- while(var1.stackSize > 0 && (!var4 && var6 < var3 || var4 && var6 >= var2)) { +- var7 = (Slot)this.c.get(var6); +- var8 = var7.getStack(); +- if(var8 != null && var8.itemID == var1.itemID && (!var1.getHasSubtypes() || var1.getItemDamage() == var8.getItemDamage()) && ItemStack.areItemStackTagsEqual(var1, var8)) { +- int var9 = var8.stackSize + var1.stackSize; +- if(var9 <= var1.getMaxStackSize()) { +- var1.stackSize = 0; +- var8.stackSize = var9; +- var7.onSlotChanged(); +- var5 = true; +- } else if(var8.stackSize < var1.getMaxStackSize()) { +- var1.stackSize -= var1.getMaxStackSize() - var8.stackSize; +- var8.stackSize = var1.getMaxStackSize(); +- var7.onSlotChanged(); +- var5 = true; +- } +- } +- +- if(var4) { +- --var6; +- } else { +- ++var6; +- } +- } +- } +- +- if(var1.stackSize > 0) { +- if(var4) { +- var6 = var3 - 1; +- } else { +- var6 = var2; +- } +- +- while(!var4 && var6 < var3 || var4 && var6 >= var2) { +- var7 = (Slot)this.c.get(var6); +- var8 = var7.getStack(); +- if(var8 == null) { +- var7.putStack(var1.copy()); +- var7.onSlotChanged(); +- var1.stackSize = 0; +- var5 = true; +- break; +- } +- +- if(var4) { +- --var6; +- } else { +- ++var6; +- } +- } +- } +- +- return var5; +- } +- +- public static int func_94529_b(int var0) { +- return var0 >> 2 & 3; +- } +- +- public static int func_94532_c(int var0) { +- return var0 & 3; +- } +- +- public static int func_94534_d(int var0, int var1) { +- return var0 & 3 | (var1 & 3) << 2; +- } +- +- public static boolean func_94528_d(int var0) { +- return var0 == 0 || var0 == 1; +- } +- +- protected void func_94533_d() { +- this.field_94536_g = 0; +- this.h.clear(); +- } +- +- public static boolean func_94527_a(Slot var0, ItemStack var1, boolean var2) { +- boolean var3 = var0 == null || !var0.getHasStack(); +- if(var0 != null && var0.getHasStack() && var1 != null && var1.isItemEqual(var0.getStack()) && ItemStack.areItemStackTagsEqual(var0.getStack(), var1)) { +- var3 |= var0.getStack().stackSize + (var2 ? 0 : var1.stackSize) <= var1.getMaxStackSize(); +- } +- +- return var3; +- } +- +- public static void func_94525_a(Set var0, int var1, ItemStack var2, int var3) { +- switch(var1) { +- case 0: +- var2.stackSize = MathHelper.floor_float((float)var2.stackSize / (float)var0.size()); +- break; +- case 1: +- var2.stackSize = 1; +- } +- +- var2.stackSize += var3; +- } +- +- public boolean canDragIntoSlot(Slot var1) { +- return true; +- } +- +- public static int calcRedstoneFromInventory(IInventory var0) { +- if(var0 == null) { +- return 0; +- } else { +- int var1 = 0; +- float var2 = 0.0F; +- +- for(int var3 = 0; var3 < var0.getSizeInventory(); ++var3) { +- ItemStack var4 = var0.getStackInSlot(var3); +- if(var4 != null) { +- var2 += (float)var4.stackSize / (float)Math.min(var0.getInventoryStackLimit(), var4.getMaxStackSize()); +- ++var1; +- } +- } +- +- var2 /= (float)var0.getSizeInventory(); +- return MathHelper.floor_float(var2 * 14.0F) + (var1 > 0 ? 1 : 0); +- } +- } ++ } ++ ++ /** ++ * Callback for when the crafting matrix is changed. ++ */ ++ public void onCraftMatrixChanged(IInventory par1IInventory) { ++ this.detectAndSendChanges(); ++ } ++ ++ /** ++ * args: slotID, itemStack to put in slot ++ */ ++ public void putStackInSlot(int par1, ItemStack par2ItemStack) { ++ this.getSlot(par1).putStack(par2ItemStack); ++ } ++ ++ /** ++ * places itemstacks in first x slots, x being aitemstack.lenght ++ */ ++ public void putStacksInSlots(ItemStack[] par1ArrayOfItemStack) { ++ for (int var2 = 0; var2 < par1ArrayOfItemStack.length; ++var2) { ++ this.getSlot(var2).putStack(par1ArrayOfItemStack[var2]); ++ } ++ } ++ ++ public void updateProgressBar(int par1, int par2) {} ++ ++ /** ++ * Gets a unique transaction ID. Parameter is unused. ++ */ ++ public short getNextTransactionID(InventoryPlayer par1InventoryPlayer) { ++ ++this.transactionID; ++ return this.transactionID; ++ } ++ ++ /** ++ * NotUsing because adding a player twice is an error ++ */ ++ public boolean isPlayerNotUsingContainer(EntityPlayer par1EntityPlayer) { ++ return !this.playerList.contains(par1EntityPlayer); ++ } ++ ++ /** ++ * adds or removes the player from the container based on par2 ++ */ ++ public void setPlayerIsPresent(EntityPlayer par1EntityPlayer, boolean par2) { ++ if (par2) { ++ this.playerList.remove(par1EntityPlayer); ++ } else { ++ this.playerList.add(par1EntityPlayer); ++ } ++ } ++ ++ public abstract boolean canInteractWith(EntityPlayer var1); ++ ++ /** ++ * merges provided ItemStack with the first avaliable one in the container/player inventory ++ */ ++ protected boolean mergeItemStack(ItemStack par1ItemStack, int par2, int par3, boolean par4) { ++ boolean var5 = false; ++ int var6 = par2; ++ ++ if (par4) { ++ var6 = par3 - 1; ++ } ++ ++ Slot var7; ++ ItemStack var8; ++ ++ if (par1ItemStack.isStackable()) { ++ while (par1ItemStack.stackSize > 0 && (!par4 && var6 < par3 || par4 && var6 >= par2)) { ++ var7 = (Slot)this.inventorySlots.get(var6); ++ var8 = var7.getStack(); ++ ++ if (var8 != null && var8.itemID == par1ItemStack.itemID && (!par1ItemStack.getHasSubtypes() || par1ItemStack.getItemDamage() == var8.getItemDamage()) && ItemStack.areItemStackTagsEqual(par1ItemStack, var8)) { ++ int var9 = var8.stackSize + par1ItemStack.stackSize; ++ ++ if (var9 <= par1ItemStack.getMaxStackSize()) { ++ par1ItemStack.stackSize = 0; ++ var8.stackSize = var9; ++ var7.onSlotChanged(); ++ var5 = true; ++ } else if (var8.stackSize < par1ItemStack.getMaxStackSize()) { ++ par1ItemStack.stackSize -= par1ItemStack.getMaxStackSize() - var8.stackSize; ++ var8.stackSize = par1ItemStack.getMaxStackSize(); ++ var7.onSlotChanged(); ++ var5 = true; ++ } ++ } ++ ++ if (par4) { ++ --var6; ++ } else { ++ ++var6; ++ } ++ } ++ } ++ ++ if (par1ItemStack.stackSize > 0) { ++ if (par4) { ++ var6 = par3 - 1; ++ } else { ++ var6 = par2; ++ } ++ ++ while (!par4 && var6 < par3 || par4 && var6 >= par2) { ++ var7 = (Slot)this.inventorySlots.get(var6); ++ var8 = var7.getStack(); ++ ++ if (var8 == null) { ++ var7.putStack(par1ItemStack.copy()); ++ var7.onSlotChanged(); ++ par1ItemStack.stackSize = 0; ++ var5 = true; ++ break; ++ } ++ ++ if (par4) { ++ --var6; ++ } else { ++ ++var6; ++ } ++ } ++ } ++ ++ return var5; ++ } ++ ++ public static int func_94529_b(int par0) { ++ return par0 >> 2 & 3; ++ } ++ ++ public static int func_94532_c(int par0) { ++ return par0 & 3; ++ } ++ ++ public static int func_94534_d(int par0, int par1) { ++ return par0 & 3 | (par1 & 3) << 2; ++ } ++ ++ public static boolean func_94528_d(int par0) { ++ return par0 == 0 || par0 == 1; ++ } ++ ++ protected void func_94533_d() { ++ this.field_94536_g = 0; ++ this.field_94537_h.clear(); ++ } ++ ++ public static boolean func_94527_a(Slot par0Slot, ItemStack par1ItemStack, boolean par2) { ++ boolean var3 = par0Slot == null || !par0Slot.getHasStack(); ++ ++ if (par0Slot != null && par0Slot.getHasStack() && par1ItemStack != null && par1ItemStack.isItemEqual(par0Slot.getStack()) && ItemStack.areItemStackTagsEqual(par0Slot.getStack(), par1ItemStack)) { ++ int var10002 = par2 ? 0 : par1ItemStack.stackSize; ++ var3 |= par0Slot.getStack().stackSize + var10002 <= par1ItemStack.getMaxStackSize(); ++ } ++ ++ return var3; ++ } ++ ++ public static void func_94525_a(Set par0Set, int par1, ItemStack par2ItemStack, int par3) { ++ switch (par1) { ++ case 0: ++ par2ItemStack.stackSize = MathHelper.floor_float((float)par2ItemStack.stackSize / (float)par0Set.size()); ++ break; ++ ++ case 1: ++ par2ItemStack.stackSize = 1; ++ } ++ ++ par2ItemStack.stackSize += par3; ++ } ++ ++ /** ++ * Returns true if the player can "drag-spilt" items into this slot,. returns true by default. Called to check if the ++ * slot can be added to a list of Slots to split the held ItemStack across. ++ */ ++ public boolean canDragIntoSlot(Slot par1Slot) { ++ return true; ++ } ++ ++ public static int calcRedstoneFromInventory(IInventory par0IInventory) { ++ if (par0IInventory == null) { ++ return 0; ++ } else { ++ int var1 = 0; ++ float var2 = 0.0F; ++ ++ for (int var3 = 0; var3 < par0IInventory.getSizeInventory(); ++var3) { ++ ItemStack var4 = par0IInventory.getStackInSlot(var3); ++ ++ if (var4 != null) { ++ var2 += (float)var4.stackSize / (float)Math.min(par0IInventory.getInventoryStackLimit(), var4.getMaxStackSize()); ++ ++var1; ++ } ++ } ++ ++ var2 /= (float)par0IInventory.getSizeInventory(); ++ return MathHelper.floor_float(var2 * 14.0F) + (var1 > 0 ? 1 : 0); ++ } ++ } + } diff --git a/patches/net/minecraft/src/ContainerBeacon.java.patch b/patches/net/minecraft/src/ContainerBeacon.java.patch new file mode 100644 index 0000000..c203404 --- /dev/null +++ b/patches/net/minecraft/src/ContainerBeacon.java.patch @@ -0,0 +1,177 @@ +--- net/minecraft/src/ContainerBeacon.java ++++ net/minecraft/src/ContainerBeacon.java +@@ -2,102 +2,113 @@ + + public class ContainerBeacon extends Container { + private TileEntityBeacon theBeacon; ++ ++ /** ++ * This beacon's slot where you put in Emerald, Diamond, Gold or Iron Ingot. ++ */ + private final SlotBeacon beaconSlot; + private int field_82865_g; + private int field_82867_h; + private int field_82868_i; + +- public ContainerBeacon(InventoryPlayer var1, TileEntityBeacon var2) { +- this.theBeacon = var2; +- this.addSlotToContainer(this.beaconSlot = new SlotBeacon(this, var2, 0, 136, 110)); ++ public ContainerBeacon(InventoryPlayer par1InventoryPlayer, TileEntityBeacon par2TileEntityBeacon) { ++ this.theBeacon = par2TileEntityBeacon; ++ this.addSlotToContainer(this.beaconSlot = new SlotBeacon(this, par2TileEntityBeacon, 0, 136, 110)); + byte var3 = 36; + short var4 = 137; +- + int var5; +- for(var5 = 0; var5 < 3; ++var5) { +- for(int var6 = 0; var6 < 9; ++var6) { +- this.addSlotToContainer(new Slot(var1, var6 + var5 * 9 + 9, var3 + var6 * 18, var4 + var5 * 18)); ++ ++ for (var5 = 0; var5 < 3; ++var5) { ++ for (int var6 = 0; var6 < 9; ++var6) { ++ this.addSlotToContainer(new Slot(par1InventoryPlayer, var6 + var5 * 9 + 9, var3 + var6 * 18, var4 + var5 * 18)); + } + } + +- for(var5 = 0; var5 < 9; ++var5) { +- this.addSlotToContainer(new Slot(var1, var5, var3 + var5 * 18, 58 + var4)); +- } +- +- this.field_82865_g = var2.getLevels(); +- this.field_82867_h = var2.getPrimaryEffect(); +- this.field_82868_i = var2.getSecondaryEffect(); +- } +- +- public void onCraftGuiOpened(ICrafting var1) { +- super.onCraftGuiOpened(var1); +- var1.sendProgressBarUpdate(this, 0, this.field_82865_g); +- var1.sendProgressBarUpdate(this, 1, this.field_82867_h); +- var1.sendProgressBarUpdate(this, 2, this.field_82868_i); +- } +- +- public void updateProgressBar(int var1, int var2) { +- if(var1 == 0) { +- this.theBeacon.setLevels(var2); +- } +- +- if(var1 == 1) { +- this.theBeacon.setPrimaryEffect(var2); +- } +- +- if(var1 == 2) { +- this.theBeacon.setSecondaryEffect(var2); +- } +- +- } +- ++ for (var5 = 0; var5 < 9; ++var5) { ++ this.addSlotToContainer(new Slot(par1InventoryPlayer, var5, var3 + var5 * 18, 58 + var4)); ++ } ++ ++ this.field_82865_g = par2TileEntityBeacon.getLevels(); ++ this.field_82867_h = par2TileEntityBeacon.getPrimaryEffect(); ++ this.field_82868_i = par2TileEntityBeacon.getSecondaryEffect(); ++ } ++ ++ public void addCraftingToCrafters(ICrafting par1ICrafting) { ++ super.addCraftingToCrafters(par1ICrafting); ++ par1ICrafting.sendProgressBarUpdate(this, 0, this.field_82865_g); ++ par1ICrafting.sendProgressBarUpdate(this, 1, this.field_82867_h); ++ par1ICrafting.sendProgressBarUpdate(this, 2, this.field_82868_i); ++ } ++ ++ public void updateProgressBar(int par1, int par2) { ++ if (par1 == 0) { ++ this.theBeacon.setLevels(par2); ++ } ++ ++ if (par1 == 1) { ++ this.theBeacon.setPrimaryEffect(par2); ++ } ++ ++ if (par1 == 2) { ++ this.theBeacon.setSecondaryEffect(par2); ++ } ++ } ++ ++ /** ++ * Returns the Tile Entity behind this beacon inventory / container ++ */ + public TileEntityBeacon getBeacon() { + return this.theBeacon; + } + +- public boolean canInteractWith(EntityPlayer var1) { +- return this.theBeacon.isUseableByPlayer(var1); ++ public boolean canInteractWith(EntityPlayer par1EntityPlayer) { ++ return this.theBeacon.isUseableByPlayer(par1EntityPlayer); + } + +- public ItemStack transferStackInSlot(EntityPlayer var1, int var2) { ++ /** ++ * Called when a player shift-clicks on a slot. You must override this or you will crash when someone does that. ++ */ ++ public ItemStack transferStackInSlot(EntityPlayer par1EntityPlayer, int par2) { + ItemStack var3 = null; +- Slot var4 = (Slot)this.c.get(var2); +- if(var4 != null && var4.getHasStack()) { ++ Slot var4 = (Slot)this.inventorySlots.get(par2); ++ ++ if (var4 != null && var4.getHasStack()) { + ItemStack var5 = var4.getStack(); + var3 = var5.copy(); +- if(var2 == 0) { +- if(!this.mergeItemStack(var5, 1, 37, true)) { ++ ++ if (par2 == 0) { ++ if (!this.mergeItemStack(var5, 1, 37, true)) { + return null; + } + + var4.onSlotChange(var5, var3); +- } else if(!this.beaconSlot.getHasStack() && this.beaconSlot.isItemValid(var5) && var5.stackSize == 1) { +- if(!this.mergeItemStack(var5, 0, 1, false)) { +- return null; +- } +- } else if(var2 >= 1 && var2 < 28) { +- if(!this.mergeItemStack(var5, 28, 37, false)) { +- return null; +- } +- } else if(var2 >= 28 && var2 < 37) { +- if(!this.mergeItemStack(var5, 1, 28, false)) { +- return null; +- } +- } else if(!this.mergeItemStack(var5, 1, 37, false)) { ++ } else if (!this.beaconSlot.getHasStack() && this.beaconSlot.isItemValid(var5) && var5.stackSize == 1) { ++ if (!this.mergeItemStack(var5, 0, 1, false)) { ++ return null; ++ } ++ } else if (par2 >= 1 && par2 < 28) { ++ if (!this.mergeItemStack(var5, 28, 37, false)) { ++ return null; ++ } ++ } else if (par2 >= 28 && par2 < 37) { ++ if (!this.mergeItemStack(var5, 1, 28, false)) { ++ return null; ++ } ++ } else if (!this.mergeItemStack(var5, 1, 37, false)) { + return null; + } + +- if(var5.stackSize == 0) { ++ if (var5.stackSize == 0) { + var4.putStack((ItemStack)null); + } else { + var4.onSlotChanged(); + } + +- if(var5.stackSize == var3.stackSize) { ++ if (var5.stackSize == var3.stackSize) { + return null; + } + +- var4.onPickupFromSlot(var1, var5); ++ var4.onPickupFromSlot(par1EntityPlayer, var5); + } + + return var3; diff --git a/patches/net/minecraft/src/ContainerBrewingStand.java.patch b/patches/net/minecraft/src/ContainerBrewingStand.java.patch new file mode 100644 index 0000000..df2a260 --- /dev/null +++ b/patches/net/minecraft/src/ContainerBrewingStand.java.patch @@ -0,0 +1,179 @@ +--- net/minecraft/src/ContainerBrewingStand.java ++++ net/minecraft/src/ContainerBrewingStand.java +@@ -2,40 +2,51 @@ + + public class ContainerBrewingStand extends Container { + private TileEntityBrewingStand tileBrewingStand; ++ ++ /** Instance of Slot. */ + private final Slot theSlot; + private int brewTime; + +- public ContainerBrewingStand(InventoryPlayer var1, TileEntityBrewingStand var2) { +- this.tileBrewingStand = var2; +- this.addSlotToContainer(new SlotBrewingStandPotion(var1.player, var2, 0, 56, 46)); +- this.addSlotToContainer(new SlotBrewingStandPotion(var1.player, var2, 1, 79, 53)); +- this.addSlotToContainer(new SlotBrewingStandPotion(var1.player, var2, 2, 102, 46)); +- this.theSlot = this.addSlotToContainer(new SlotBrewingStandIngredient(this, var2, 3, 79, 17)); +- ++ public ContainerBrewingStand(InventoryPlayer par1InventoryPlayer, TileEntityBrewingStand par2TileEntityBrewingStand) { ++ this.tileBrewingStand = par2TileEntityBrewingStand; ++ this.addSlotToContainer(new SlotBrewingStandPotion(par1InventoryPlayer.player, par2TileEntityBrewingStand, 0, 56, 46)); ++ this.addSlotToContainer(new SlotBrewingStandPotion(par1InventoryPlayer.player, par2TileEntityBrewingStand, 1, 79, 53)); ++ this.addSlotToContainer(new SlotBrewingStandPotion(par1InventoryPlayer.player, par2TileEntityBrewingStand, 2, 102, 46)); ++ this.theSlot = this.addSlotToContainer(new SlotBrewingStandIngredient(this, par2TileEntityBrewingStand, 3, 79, 17)); + int var3; +- for(var3 = 0; var3 < 3; ++var3) { +- for(int var4 = 0; var4 < 9; ++var4) { +- this.addSlotToContainer(new Slot(var1, var4 + var3 * 9 + 9, 8 + var4 * 18, 84 + var3 * 18)); ++ ++ for (var3 = 0; var3 < 3; ++var3) { ++ for (int var4 = 0; var4 < 9; ++var4) { ++ this.addSlotToContainer(new Slot(par1InventoryPlayer, var4 + var3 * 9 + 9, 8 + var4 * 18, 84 + var3 * 18)); + } + } + +- for(var3 = 0; var3 < 9; ++var3) { +- this.addSlotToContainer(new Slot(var1, var3, 8 + var3 * 18, 142)); ++ for (var3 = 0; var3 < 9; ++var3) { ++ this.addSlotToContainer(new Slot(par1InventoryPlayer, var3, 8 + var3 * 18, 142)); + } +- +- } +- +- public void onCraftGuiOpened(ICrafting var1) { +- super.onCraftGuiOpened(var1); +- var1.sendProgressBarUpdate(this, 0, this.tileBrewingStand.getBrewTime()); +- } +- ++ } ++ ++ // Spout Start ++ public IInventory getIInventory() { ++ return tileBrewingStand; ++ } ++ // Spout End ++ ++ public void addCraftingToCrafters(ICrafting par1ICrafting) { ++ super.addCraftingToCrafters(par1ICrafting); ++ par1ICrafting.sendProgressBarUpdate(this, 0, this.tileBrewingStand.getBrewTime()); ++ } ++ ++ /** ++ * Looks for changes made in the container, sends them to every listener. ++ */ + public void detectAndSendChanges() { + super.detectAndSendChanges(); + +- for(int var1 = 0; var1 < this.e.size(); ++var1) { +- ICrafting var2 = (ICrafting)this.e.get(var1); +- if(this.brewTime != this.tileBrewingStand.getBrewTime()) { ++ for (int var1 = 0; var1 < this.crafters.size(); ++var1) { ++ ICrafting var2 = (ICrafting)this.crafters.get(var1); ++ ++ if (this.brewTime != this.tileBrewingStand.getBrewTime()) { + var2.sendProgressBarUpdate(this, 0, this.tileBrewingStand.getBrewTime()); + } + } +@@ -43,62 +54,66 @@ + this.brewTime = this.tileBrewingStand.getBrewTime(); + } + +- public void updateProgressBar(int var1, int var2) { +- if(var1 == 0) { +- this.tileBrewingStand.setBrewTime(var2); ++ public void updateProgressBar(int par1, int par2) { ++ if (par1 == 0) { ++ this.tileBrewingStand.setBrewTime(par2); + } +- +- } +- +- public boolean canInteractWith(EntityPlayer var1) { +- return this.tileBrewingStand.isUseableByPlayer(var1); +- } +- +- public ItemStack transferStackInSlot(EntityPlayer var1, int var2) { ++ } ++ ++ public boolean canInteractWith(EntityPlayer par1EntityPlayer) { ++ return this.tileBrewingStand.isUseableByPlayer(par1EntityPlayer); ++ } ++ ++ /** ++ * Called when a player shift-clicks on a slot. You must override this or you will crash when someone does that. ++ */ ++ public ItemStack transferStackInSlot(EntityPlayer par1EntityPlayer, int par2) { + ItemStack var3 = null; +- Slot var4 = (Slot)this.c.get(var2); +- if(var4 != null && var4.getHasStack()) { ++ Slot var4 = (Slot)this.inventorySlots.get(par2); ++ ++ if (var4 != null && var4.getHasStack()) { + ItemStack var5 = var4.getStack(); + var3 = var5.copy(); +- if((var2 < 0 || var2 > 2) && var2 != 3) { +- if(!this.theSlot.getHasStack() && this.theSlot.isItemValid(var5)) { +- if(!this.mergeItemStack(var5, 3, 4, false)) { +- return null; +- } +- } else if(SlotBrewingStandPotion.canHoldPotion(var3)) { +- if(!this.mergeItemStack(var5, 0, 3, false)) { +- return null; +- } +- } else if(var2 >= 4 && var2 < 31) { +- if(!this.mergeItemStack(var5, 31, 40, false)) { +- return null; +- } +- } else if(var2 >= 31 && var2 < 40) { +- if(!this.mergeItemStack(var5, 4, 31, false)) { +- return null; +- } +- } else if(!this.mergeItemStack(var5, 4, 40, false)) { ++ ++ if ((par2 < 0 || par2 > 2) && par2 != 3) { ++ if (!this.theSlot.getHasStack() && this.theSlot.isItemValid(var5)) { ++ if (!this.mergeItemStack(var5, 3, 4, false)) { ++ return null; ++ } ++ } else if (SlotBrewingStandPotion.canHoldPotion(var3)) { ++ if (!this.mergeItemStack(var5, 0, 3, false)) { ++ return null; ++ } ++ } else if (par2 >= 4 && par2 < 31) { ++ if (!this.mergeItemStack(var5, 31, 40, false)) { ++ return null; ++ } ++ } else if (par2 >= 31 && par2 < 40) { ++ if (!this.mergeItemStack(var5, 4, 31, false)) { ++ return null; ++ } ++ } else if (!this.mergeItemStack(var5, 4, 40, false)) { + return null; + } + } else { +- if(!this.mergeItemStack(var5, 4, 40, true)) { ++ if (!this.mergeItemStack(var5, 4, 40, true)) { + return null; + } + + var4.onSlotChange(var5, var3); + } + +- if(var5.stackSize == 0) { ++ if (var5.stackSize == 0) { + var4.putStack((ItemStack)null); + } else { + var4.onSlotChanged(); + } + +- if(var5.stackSize == var3.stackSize) { ++ if (var5.stackSize == var3.stackSize) { + return null; + } + +- var4.onPickupFromSlot(var1, var5); ++ var4.onPickupFromSlot(par1EntityPlayer, var5); + } + + return var3; diff --git a/patches/net/minecraft/src/ContainerChest.java.patch b/patches/net/minecraft/src/ContainerChest.java.patch new file mode 100644 index 0000000..6a92ccd --- /dev/null +++ b/patches/net/minecraft/src/ContainerChest.java.patch @@ -0,0 +1,124 @@ +--- net/minecraft/src/ContainerChest.java ++++ net/minecraft/src/ContainerChest.java +@@ -4,51 +4,66 @@ + private IInventory lowerChestInventory; + private int numRows; + +- public ContainerChest(IInventory var1, IInventory var2) { +- this.lowerChestInventory = var2; +- this.numRows = var2.getSizeInventory() / 9; +- var2.openChest(); ++ public ContainerChest(IInventory par1IInventory, IInventory par2IInventory) { ++ this.lowerChestInventory = par2IInventory; ++ this.numRows = par2IInventory.getSizeInventory() / 9; ++ par2IInventory.openChest(); + int var3 = (this.numRows - 4) * 18; +- + int var4; + int var5; +- for(var4 = 0; var4 < this.numRows; ++var4) { +- for(var5 = 0; var5 < 9; ++var5) { +- this.addSlotToContainer(new Slot(var2, var5 + var4 * 9, 8 + var5 * 18, 18 + var4 * 18)); +- } +- } +- +- for(var4 = 0; var4 < 3; ++var4) { +- for(var5 = 0; var5 < 9; ++var5) { +- this.addSlotToContainer(new Slot(var1, var5 + var4 * 9 + 9, 8 + var5 * 18, 103 + var4 * 18 + var3)); +- } +- } +- +- for(var4 = 0; var4 < 9; ++var4) { +- this.addSlotToContainer(new Slot(var1, var4, 8 + var4 * 18, 161 + var3)); +- } +- +- } +- +- public boolean canInteractWith(EntityPlayer var1) { +- return this.lowerChestInventory.isUseableByPlayer(var1); +- } +- +- public ItemStack transferStackInSlot(EntityPlayer var1, int var2) { ++ ++ for (var4 = 0; var4 < this.numRows; ++var4) { ++ for (var5 = 0; var5 < 9; ++var5) { ++ this.addSlotToContainer(new Slot(par2IInventory, var5 + var4 * 9, 8 + var5 * 18, 18 + var4 * 18)); ++ } ++ } ++ ++ for (var4 = 0; var4 < 3; ++var4) { ++ for (var5 = 0; var5 < 9; ++var5) { ++ this.addSlotToContainer(new Slot(par1IInventory, var5 + var4 * 9 + 9, 8 + var5 * 18, 103 + var4 * 18 + var3)); ++ } ++ } ++ ++ for (var4 = 0; var4 < 9; ++var4) { ++ this.addSlotToContainer(new Slot(par1IInventory, var4, 8 + var4 * 18, 161 + var3)); ++ } ++ } ++ ++ // Spout Start - Chest sorting ++ public IInventory getIInventory() { ++ return lowerChestInventory; ++ } ++ ++ @Override ++ public boolean isSortableInventory() { ++ return true; ++ } ++ // Spout End ++ ++ public boolean canInteractWith(EntityPlayer par1EntityPlayer) { ++ return this.lowerChestInventory.isUseableByPlayer(par1EntityPlayer); ++ } ++ ++ /** ++ * Called when a player shift-clicks on a slot. You must override this or you will crash when someone does that. ++ */ ++ public ItemStack transferStackInSlot(EntityPlayer par1EntityPlayer, int par2) { + ItemStack var3 = null; +- Slot var4 = (Slot)this.c.get(var2); +- if(var4 != null && var4.getHasStack()) { ++ Slot var4 = (Slot)this.inventorySlots.get(par2); ++ ++ if (var4 != null && var4.getHasStack()) { + ItemStack var5 = var4.getStack(); + var3 = var5.copy(); +- if(var2 < this.numRows * 9) { +- if(!this.mergeItemStack(var5, this.numRows * 9, this.c.size(), true)) { ++ ++ if (par2 < this.numRows * 9) { ++ if (!this.mergeItemStack(var5, this.numRows * 9, this.inventorySlots.size(), true)) { + return null; + } +- } else if(!this.mergeItemStack(var5, 0, this.numRows * 9, false)) { ++ } else if (!this.mergeItemStack(var5, 0, this.numRows * 9, false)) { + return null; + } + +- if(var5.stackSize == 0) { ++ if (var5.stackSize == 0) { + var4.putStack((ItemStack)null); + } else { + var4.onSlotChanged(); +@@ -58,11 +73,17 @@ + return var3; + } + +- public void onContainerClosed(EntityPlayer var1) { +- super.onContainerClosed(var1); ++ /** ++ * Called when the container is closed. ++ */ ++ public void onContainerClosed(EntityPlayer par1EntityPlayer) { ++ super.onContainerClosed(par1EntityPlayer); + this.lowerChestInventory.closeChest(); + } +- ++ ++ /** ++ * Return this chest container's lower chest inventory. ++ */ + public IInventory getLowerChestInventory() { + return this.lowerChestInventory; + } diff --git a/patches/net/minecraft/src/ContainerCreative.java.patch b/patches/net/minecraft/src/ContainerCreative.java.patch new file mode 100644 index 0000000..11b5cac --- /dev/null +++ b/patches/net/minecraft/src/ContainerCreative.java.patch @@ -0,0 +1,129 @@ +--- net/minecraft/src/ContainerCreative.java ++++ net/minecraft/src/ContainerCreative.java +@@ -4,60 +4,78 @@ + import java.util.List; + + class ContainerCreative extends Container { +- public List a = new ArrayList(); +- +- public ContainerCreative(EntityPlayer var1) { +- InventoryPlayer var2 = var1.inventory; +- ++ ++ /** the list of items in this container */ ++ public List itemList = new ArrayList(); ++ ++ public ContainerCreative(EntityPlayer par1EntityPlayer) { ++ InventoryPlayer var2 = par1EntityPlayer.inventory; + int var3; +- for(var3 = 0; var3 < 5; ++var3) { +- for(int var4 = 0; var4 < 9; ++var4) { ++ ++ for (var3 = 0; var3 < 5; ++var3) { ++ for (int var4 = 0; var4 < 9; ++var4) { + this.addSlotToContainer(new Slot(GuiContainerCreative.getInventory(), var3 * 9 + var4, 9 + var4 * 18, 18 + var3 * 18)); + } + } + +- for(var3 = 0; var3 < 9; ++var3) { ++ for (var3 = 0; var3 < 9; ++var3) { + this.addSlotToContainer(new Slot(var2, var3, 9 + var3 * 18, 112)); + } + + this.scrollTo(0.0F); + } + +- public boolean canInteractWith(EntityPlayer var1) { ++ public boolean canInteractWith(EntityPlayer par1EntityPlayer) { + return true; + } + +- public void scrollTo(float var1) { +- int var2 = this.a.size() / 9 - 5 + 1; +- int var3 = (int)((double)(var1 * (float)var2) + 0.5D); +- if(var3 < 0) { ++ /** ++ * Updates the gui slots ItemStack's based on scroll position. ++ */ ++ public void scrollTo(float par1) { ++ int var2 = this.itemList.size() / 9 - 5 + 1; ++ int var3 = (int)((double)(par1 * (float)var2) + 0.5D); ++ ++ if (var3 < 0) { + var3 = 0; + } + +- for(int var4 = 0; var4 < 5; ++var4) { +- for(int var5 = 0; var5 < 9; ++var5) { ++ for (int var4 = 0; var4 < 5; ++var4) { ++ for (int var5 = 0; var5 < 9; ++var5) { + int var6 = var5 + (var4 + var3) * 9; +- if(var6 >= 0 && var6 < this.a.size()) { +- GuiContainerCreative.getInventory().setInventorySlotContents(var5 + var4 * 9, (ItemStack)this.a.get(var6)); ++ ++ if (var6 >= 0 && var6 < this.itemList.size()) { ++ GuiContainerCreative.getInventory().setInventorySlotContents(var5 + var4 * 9, (ItemStack)this.itemList.get(var6)); + } else { + GuiContainerCreative.getInventory().setInventorySlotContents(var5 + var4 * 9, (ItemStack)null); + } + } + } +- + } + ++ /** ++ * theCreativeContainer seems to be hard coded to 9x5 items ++ */ + public boolean hasMoreThan1PageOfItemsInList() { +- return this.a.size() > 45; +- } +- +- protected void retrySlotClick(int var1, int var2, boolean var3, EntityPlayer var4) { +- } +- +- public ItemStack transferStackInSlot(EntityPlayer var1, int var2) { +- if(var2 >= this.c.size() - 9 && var2 < this.c.size()) { +- Slot var3 = (Slot)this.c.get(var2); +- if(var3 != null && var3.getHasStack()) { ++ return this.itemList.size() > 45; ++ } ++ ++ // Spout Start ++ public IInventory getIInventory() { ++ return null; ++ } ++ // Spout End ++ ++ protected void retrySlotClick(int par1, int par2, boolean par3, EntityPlayer par4EntityPlayer) {} ++ ++ /** ++ * Called when a player shift-clicks on a slot. You must override this or you will crash when someone does that. ++ */ ++ public ItemStack transferStackInSlot(EntityPlayer par1EntityPlayer, int par2) { ++ if (par2 >= this.inventorySlots.size() - 9 && par2 < this.inventorySlots.size()) { ++ Slot var3 = (Slot)this.inventorySlots.get(par2); ++ ++ if (var3 != null && var3.getHasStack()) { + var3.putStack((ItemStack)null); + } + } +@@ -65,11 +83,15 @@ + return null; + } + +- public boolean func_94530_a(ItemStack var1, Slot var2) { +- return var2.yDisplayPosition > 90; ++ public boolean func_94530_a(ItemStack par1ItemStack, Slot par2Slot) { ++ return par2Slot.yDisplayPosition > 90; + } + +- public boolean canDragIntoSlot(Slot var1) { +- return var1.inventory instanceof InventoryPlayer || var1.yDisplayPosition > 90 && var1.xDisplayPosition <= 162; ++ /** ++ * Returns true if the player can "drag-spilt" items into this slot,. returns true by default. Called to check if the ++ * slot can be added to a list of Slots to split the held ItemStack across. ++ */ ++ public boolean canDragIntoSlot(Slot par1Slot) { ++ return par1Slot.inventory instanceof InventoryPlayer || par1Slot.yDisplayPosition > 90 && par1Slot.xDisplayPosition <= 162; + } + } diff --git a/patches/net/minecraft/src/ContainerDispenser.java.patch b/patches/net/minecraft/src/ContainerDispenser.java.patch new file mode 100644 index 0000000..4b64118 --- /dev/null +++ b/patches/net/minecraft/src/ContainerDispenser.java.patch @@ -0,0 +1,105 @@ +--- net/minecraft/src/ContainerDispenser.java ++++ net/minecraft/src/ContainerDispenser.java +@@ -3,58 +3,68 @@ + public class ContainerDispenser extends Container { + private TileEntityDispenser tileEntityDispenser; + +- public ContainerDispenser(IInventory var1, TileEntityDispenser var2) { +- this.tileEntityDispenser = var2; +- ++ public ContainerDispenser(IInventory par1IInventory, TileEntityDispenser par2TileEntityDispenser) { ++ this.tileEntityDispenser = par2TileEntityDispenser; + int var3; + int var4; +- for(var3 = 0; var3 < 3; ++var3) { +- for(var4 = 0; var4 < 3; ++var4) { +- this.addSlotToContainer(new Slot(var2, var4 + var3 * 3, 62 + var4 * 18, 17 + var3 * 18)); +- } +- } +- +- for(var3 = 0; var3 < 3; ++var3) { +- for(var4 = 0; var4 < 9; ++var4) { +- this.addSlotToContainer(new Slot(var1, var4 + var3 * 9 + 9, 8 + var4 * 18, 84 + var3 * 18)); +- } +- } +- +- for(var3 = 0; var3 < 9; ++var3) { +- this.addSlotToContainer(new Slot(var1, var3, 8 + var3 * 18, 142)); +- } +- +- } +- +- public boolean canInteractWith(EntityPlayer var1) { +- return this.tileEntityDispenser.isUseableByPlayer(var1); +- } +- +- public ItemStack transferStackInSlot(EntityPlayer var1, int var2) { ++ ++ for (var3 = 0; var3 < 3; ++var3) { ++ for (var4 = 0; var4 < 3; ++var4) { ++ this.addSlotToContainer(new Slot(par2TileEntityDispenser, var4 + var3 * 3, 62 + var4 * 18, 17 + var3 * 18)); ++ } ++ } ++ ++ for (var3 = 0; var3 < 3; ++var3) { ++ for (var4 = 0; var4 < 9; ++var4) { ++ this.addSlotToContainer(new Slot(par1IInventory, var4 + var3 * 9 + 9, 8 + var4 * 18, 84 + var3 * 18)); ++ } ++ } ++ ++ for (var3 = 0; var3 < 9; ++var3) { ++ this.addSlotToContainer(new Slot(par1IInventory, var3, 8 + var3 * 18, 142)); ++ } ++ } ++ ++ // Spout Start ++ public IInventory getIInventory() { ++ return tileEntityDispenser; ++ } ++ // Spout End ++ ++ public boolean canInteractWith(EntityPlayer par1EntityPlayer) { ++ return this.tileEntityDispenser.isUseableByPlayer(par1EntityPlayer); ++ } ++ ++ /** ++ * Called when a player shift-clicks on a slot. You must override this or you will crash when someone does that. ++ */ ++ public ItemStack transferStackInSlot(EntityPlayer par1EntityPlayer, int par2) { + ItemStack var3 = null; +- Slot var4 = (Slot)this.c.get(var2); +- if(var4 != null && var4.getHasStack()) { ++ Slot var4 = (Slot)this.inventorySlots.get(par2); ++ ++ if (var4 != null && var4.getHasStack()) { + ItemStack var5 = var4.getStack(); + var3 = var5.copy(); +- if(var2 < 9) { +- if(!this.mergeItemStack(var5, 9, 45, true)) { ++ ++ if (par2 < 9) { ++ if (!this.mergeItemStack(var5, 9, 45, true)) { + return null; + } +- } else if(!this.mergeItemStack(var5, 0, 9, false)) { ++ } else if (!this.mergeItemStack(var5, 0, 9, false)) { + return null; + } + +- if(var5.stackSize == 0) { ++ if (var5.stackSize == 0) { + var4.putStack((ItemStack)null); + } else { + var4.onSlotChanged(); + } + +- if(var5.stackSize == var3.stackSize) { ++ if (var5.stackSize == var3.stackSize) { + return null; + } + +- var4.onPickupFromSlot(var1, var5); ++ var4.onPickupFromSlot(par1EntityPlayer, var5); + } + + return var3; diff --git a/patches/net/minecraft/src/ContainerEnchantment.java.patch b/patches/net/minecraft/src/ContainerEnchantment.java.patch new file mode 100644 index 0000000..cf03e8b --- /dev/null +++ b/patches/net/minecraft/src/ContainerEnchantment.java.patch @@ -0,0 +1,330 @@ +--- net/minecraft/src/ContainerEnchantment.java ++++ net/minecraft/src/ContainerEnchantment.java +@@ -4,98 +4,117 @@ + import java.util.Random; + + public class ContainerEnchantment extends Container { ++ ++ /** SlotEnchantmentTable object with ItemStack to be enchanted */ + public IInventory tableInventory = new SlotEnchantmentTable(this, "Enchant", true, 1); ++ ++ /** current world (for bookshelf counting) */ + private World worldPointer; + private int posX; + private int posY; + private int posZ; +- private Random l = new Random(); ++ private Random rand = new Random(); ++ ++ /** used as seed for EnchantmentNameParts (see GuiEnchantment) */ + public long nameSeed; ++ ++ /** 3-member array storing the enchantment levels of each slot */ + public int[] enchantLevels = new int[3]; + +- public ContainerEnchantment(InventoryPlayer var1, World var2, int var3, int var4, int var5) { +- this.worldPointer = var2; +- this.posX = var3; +- this.posY = var4; +- this.posZ = var5; ++ public ContainerEnchantment(InventoryPlayer par1InventoryPlayer, World par2World, int par3, int par4, int par5) { ++ this.worldPointer = par2World; ++ this.posX = par3; ++ this.posY = par4; ++ this.posZ = par5; + this.addSlotToContainer(new SlotEnchantment(this, this.tableInventory, 0, 25, 47)); +- + int var6; +- for(var6 = 0; var6 < 3; ++var6) { +- for(int var7 = 0; var7 < 9; ++var7) { +- this.addSlotToContainer(new Slot(var1, var7 + var6 * 9 + 9, 8 + var7 * 18, 84 + var6 * 18)); ++ ++ for (var6 = 0; var6 < 3; ++var6) { ++ for (int var7 = 0; var7 < 9; ++var7) { ++ this.addSlotToContainer(new Slot(par1InventoryPlayer, var7 + var6 * 9 + 9, 8 + var7 * 18, 84 + var6 * 18)); + } + } + +- for(var6 = 0; var6 < 9; ++var6) { +- this.addSlotToContainer(new Slot(var1, var6, 8 + var6 * 18, 142)); ++ for (var6 = 0; var6 < 9; ++var6) { ++ this.addSlotToContainer(new Slot(par1InventoryPlayer, var6, 8 + var6 * 18, 142)); + } +- +- } +- +- public void onCraftGuiOpened(ICrafting var1) { +- super.onCraftGuiOpened(var1); +- var1.sendProgressBarUpdate(this, 0, this.enchantLevels[0]); +- var1.sendProgressBarUpdate(this, 1, this.enchantLevels[1]); +- var1.sendProgressBarUpdate(this, 2, this.enchantLevels[2]); +- } +- ++ } ++ ++ // Spout Start ++ public IInventory getIInventory() { ++ return tableInventory; ++ } ++ // Spout End ++ ++ public void addCraftingToCrafters(ICrafting par1ICrafting) { ++ super.addCraftingToCrafters(par1ICrafting); ++ par1ICrafting.sendProgressBarUpdate(this, 0, this.enchantLevels[0]); ++ par1ICrafting.sendProgressBarUpdate(this, 1, this.enchantLevels[1]); ++ par1ICrafting.sendProgressBarUpdate(this, 2, this.enchantLevels[2]); ++ } ++ ++ /** ++ * Looks for changes made in the container, sends them to every listener. ++ */ + public void detectAndSendChanges() { + super.detectAndSendChanges(); + +- for(int var1 = 0; var1 < this.e.size(); ++var1) { +- ICrafting var2 = (ICrafting)this.e.get(var1); ++ for (int var1 = 0; var1 < this.crafters.size(); ++var1) { ++ ICrafting var2 = (ICrafting)this.crafters.get(var1); + var2.sendProgressBarUpdate(this, 0, this.enchantLevels[0]); + var2.sendProgressBarUpdate(this, 1, this.enchantLevels[1]); + var2.sendProgressBarUpdate(this, 2, this.enchantLevels[2]); + } +- + } + +- public void updateProgressBar(int var1, int var2) { +- if(var1 >= 0 && var1 <= 2) { +- this.enchantLevels[var1] = var2; ++ public void updateProgressBar(int par1, int par2) { ++ if (par1 >= 0 && par1 <= 2) { ++ this.enchantLevels[par1] = par2; + } else { +- super.updateProgressBar(var1, var2); ++ super.updateProgressBar(par1, par2); + } +- + } + +- public void onCraftMatrixChanged(IInventory var1) { +- if(var1 == this.tableInventory) { +- ItemStack var2 = var1.getStackInSlot(0); ++ /** ++ * Callback for when the crafting matrix is changed. ++ */ ++ public void onCraftMatrixChanged(IInventory par1IInventory) { ++ if (par1IInventory == this.tableInventory) { ++ ItemStack var2 = par1IInventory.getStackInSlot(0); + int var3; +- if(var2 != null && var2.isItemEnchantable()) { +- this.nameSeed = this.l.nextLong(); +- if(!this.worldPointer.isRemote) { ++ ++ if (var2 != null && var2.isItemEnchantable()) { ++ this.nameSeed = this.rand.nextLong(); ++ ++ if (!this.worldPointer.isRemote) { + var3 = 0; +- + int var4; +- for(var4 = -1; var4 <= 1; ++var4) { +- for(int var5 = -1; var5 <= 1; ++var5) { +- if((var4 != 0 || var5 != 0) && this.worldPointer.isAirBlock(this.posX + var5, this.posY, this.posZ + var4) && this.worldPointer.isAirBlock(this.posX + var5, this.posY + 1, this.posZ + var4)) { +- if(this.worldPointer.getBlockId(this.posX + var5 * 2, this.posY, this.posZ + var4 * 2) == Block.bookShelf.blockID) { +- ++var3; +- } +- +- if(this.worldPointer.getBlockId(this.posX + var5 * 2, this.posY + 1, this.posZ + var4 * 2) == Block.bookShelf.blockID) { +- ++var3; +- } +- +- if(var5 != 0 && var4 != 0) { +- if(this.worldPointer.getBlockId(this.posX + var5 * 2, this.posY, this.posZ + var4) == Block.bookShelf.blockID) { +- ++var3; +- } +- +- if(this.worldPointer.getBlockId(this.posX + var5 * 2, this.posY + 1, this.posZ + var4) == Block.bookShelf.blockID) { +- ++var3; +- } +- +- if(this.worldPointer.getBlockId(this.posX + var5, this.posY, this.posZ + var4 * 2) == Block.bookShelf.blockID) { +- ++var3; +- } +- +- if(this.worldPointer.getBlockId(this.posX + var5, this.posY + 1, this.posZ + var4 * 2) == Block.bookShelf.blockID) { ++ ++ for (var4 = -1; var4 <= 1; ++var4) { ++ for (int var5 = -1; var5 <= 1; ++var5) { ++ if ((var4 != 0 || var5 != 0) && this.worldPointer.isAirBlock(this.posX + var5, this.posY, this.posZ + var4) && this.worldPointer.isAirBlock(this.posX + var5, this.posY + 1, this.posZ + var4)) { ++ if (this.worldPointer.getBlockId(this.posX + var5 * 2, this.posY, this.posZ + var4 * 2) == Block.bookShelf.blockID) { ++ ++var3; ++ } ++ ++ if (this.worldPointer.getBlockId(this.posX + var5 * 2, this.posY + 1, this.posZ + var4 * 2) == Block.bookShelf.blockID) { ++ ++var3; ++ } ++ ++ if (var5 != 0 && var4 != 0) { ++ if (this.worldPointer.getBlockId(this.posX + var5 * 2, this.posY, this.posZ + var4) == Block.bookShelf.blockID) { ++ ++var3; ++ } ++ ++ if (this.worldPointer.getBlockId(this.posX + var5 * 2, this.posY + 1, this.posZ + var4) == Block.bookShelf.blockID) { ++ ++var3; ++ } ++ ++ if (this.worldPointer.getBlockId(this.posX + var5, this.posY, this.posZ + var4 * 2) == Block.bookShelf.blockID) { ++ ++var3; ++ } ++ ++ if (this.worldPointer.getBlockId(this.posX + var5, this.posY + 1, this.posZ + var4 * 2) == Block.bookShelf.blockID) { + ++var3; + } + } +@@ -103,39 +122,45 @@ + } + } + +- for(var4 = 0; var4 < 3; ++var4) { +- this.enchantLevels[var4] = EnchantmentHelper.calcItemStackEnchantability(this.l, var4, var3, var2); ++ for (var4 = 0; var4 < 3; ++var4) { ++ this.enchantLevels[var4] = EnchantmentHelper.calcItemStackEnchantability(this.rand, var4, var3, var2); + } + + this.detectAndSendChanges(); + } + } else { +- for(var3 = 0; var3 < 3; ++var3) { ++ for (var3 = 0; var3 < 3; ++var3) { + this.enchantLevels[var3] = 0; + } + } + } +- + } + +- public boolean enchantItem(EntityPlayer var1, int var2) { ++ /** ++ * enchants the item on the table using the specified slot; also deducts XP from player ++ */ ++ public boolean enchantItem(EntityPlayer par1EntityPlayer, int par2) { + ItemStack var3 = this.tableInventory.getStackInSlot(0); +- if(this.enchantLevels[var2] > 0 && var3 != null && (var1.experienceLevel >= this.enchantLevels[var2] || var1.capabilities.isCreativeMode)) { +- if(!this.worldPointer.isRemote) { +- List var4 = EnchantmentHelper.buildEnchantmentList(this.l, var3, this.enchantLevels[var2]); ++ ++ if (this.enchantLevels[par2] > 0 && var3 != null && (par1EntityPlayer.experienceLevel >= this.enchantLevels[par2] || par1EntityPlayer.capabilities.isCreativeMode)) { ++ if (!this.worldPointer.isRemote) { ++ List var4 = EnchantmentHelper.buildEnchantmentList(this.rand, var3, this.enchantLevels[par2]); + boolean var5 = var3.itemID == Item.book.itemID; +- if(var4 != null) { +- var1.addExperienceLevel(-this.enchantLevels[var2]); +- if(var5) { ++ ++ if (var4 != null) { ++ par1EntityPlayer.addExperienceLevel(-this.enchantLevels[par2]); ++ ++ if (var5) { + var3.itemID = Item.enchantedBook.itemID; + } + +- int var6 = var5 ? this.l.nextInt(var4.size()) : -1; ++ int var6 = var5 ? this.rand.nextInt(var4.size()) : -1; + +- for(int var7 = 0; var7 < var4.size(); ++var7) { ++ for (int var7 = 0; var7 < var4.size(); ++var7) { + EnchantmentData var8 = (EnchantmentData)var4.get(var7); +- if(!var5 || var7 == var6) { +- if(var5) { ++ ++ if (!var5 || var7 == var6) { ++ if (var5) { + Item.enchantedBook.addEnchantment(var3, var8); + } else { + var3.addEnchantment(var8.enchantmentobj, var8.enchantmentLevel); +@@ -153,56 +178,65 @@ + } + } + +- public void onContainerClosed(EntityPlayer var1) { +- super.onContainerClosed(var1); +- if(!this.worldPointer.isRemote) { ++ /** ++ * Called when the container is closed. ++ */ ++ public void onContainerClosed(EntityPlayer par1EntityPlayer) { ++ super.onContainerClosed(par1EntityPlayer); ++ ++ if (!this.worldPointer.isRemote) { + ItemStack var2 = this.tableInventory.getStackInSlotOnClosing(0); +- if(var2 != null) { +- var1.dropPlayerItem(var2); ++ ++ if (var2 != null) { ++ par1EntityPlayer.dropPlayerItem(var2); + } +- + } + } + +- public boolean canInteractWith(EntityPlayer var1) { +- return this.worldPointer.getBlockId(this.posX, this.posY, this.posZ) != Block.enchantmentTable.blockID ? false : var1.getDistanceSq((double)this.posX + 0.5D, (double)this.posY + 0.5D, (double)this.posZ + 0.5D) <= 64.0D; ++ public boolean canInteractWith(EntityPlayer par1EntityPlayer) { ++ return this.worldPointer.getBlockId(this.posX, this.posY, this.posZ) != Block.enchantmentTable.blockID ? false : par1EntityPlayer.getDistanceSq((double)this.posX + 0.5D, (double)this.posY + 0.5D, (double)this.posZ + 0.5D) <= 64.0D; + } + +- public ItemStack transferStackInSlot(EntityPlayer var1, int var2) { ++ /** ++ * Called when a player shift-clicks on a slot. You must override this or you will crash when someone does that. ++ */ ++ public ItemStack transferStackInSlot(EntityPlayer par1EntityPlayer, int par2) { + ItemStack var3 = null; +- Slot var4 = (Slot)this.c.get(var2); +- if(var4 != null && var4.getHasStack()) { ++ Slot var4 = (Slot)this.inventorySlots.get(par2); ++ ++ if (var4 != null && var4.getHasStack()) { + ItemStack var5 = var4.getStack(); + var3 = var5.copy(); +- if(var2 == 0) { +- if(!this.mergeItemStack(var5, 1, 37, true)) { ++ ++ if (par2 == 0) { ++ if (!this.mergeItemStack(var5, 1, 37, true)) { + return null; + } + } else { +- if(((Slot)this.c.get(0)).getHasStack() || !((Slot)this.c.get(0)).isItemValid(var5)) { ++ if (((Slot)this.inventorySlots.get(0)).getHasStack() || !((Slot)this.inventorySlots.get(0)).isItemValid(var5)) { + return null; + } + +- if(var5.hasTagCompound() && var5.stackSize == 1) { +- ((Slot)this.c.get(0)).putStack(var5.copy()); ++ if (var5.hasTagCompound() && var5.stackSize == 1) { ++ ((Slot)this.inventorySlots.get(0)).putStack(var5.copy()); + var5.stackSize = 0; +- } else if(var5.stackSize >= 1) { +- ((Slot)this.c.get(0)).putStack(new ItemStack(var5.itemID, 1, var5.getItemDamage())); ++ } else if (var5.stackSize >= 1) { ++ ((Slot)this.inventorySlots.get(0)).putStack(new ItemStack(var5.itemID, 1, var5.getItemDamage())); + --var5.stackSize; + } + } + +- if(var5.stackSize == 0) { ++ if (var5.stackSize == 0) { + var4.putStack((ItemStack)null); + } else { + var4.onSlotChanged(); + } + +- if(var5.stackSize == var3.stackSize) { ++ if (var5.stackSize == var3.stackSize) { + return null; + } + +- var4.onPickupFromSlot(var1, var5); ++ var4.onPickupFromSlot(par1EntityPlayer, var5); + } + + return var3; diff --git a/patches/net/minecraft/src/ContainerFurnace.java.patch b/patches/net/minecraft/src/ContainerFurnace.java.patch new file mode 100644 index 0000000..dc8e56c --- /dev/null +++ b/patches/net/minecraft/src/ContainerFurnace.java.patch @@ -0,0 +1,199 @@ +--- net/minecraft/src/ContainerFurnace.java ++++ net/minecraft/src/ContainerFurnace.java +@@ -6,46 +6,55 @@ + private int lastBurnTime; + private int lastItemBurnTime; + +- public ContainerFurnace(InventoryPlayer var1, TileEntityFurnace var2) { +- this.furnace = var2; +- this.addSlotToContainer(new Slot(var2, 0, 56, 17)); +- this.addSlotToContainer(new Slot(var2, 1, 56, 53)); +- this.addSlotToContainer(new SlotFurnace(var1.player, var2, 2, 116, 35)); +- ++ public ContainerFurnace(InventoryPlayer par1InventoryPlayer, TileEntityFurnace par2TileEntityFurnace) { ++ this.furnace = par2TileEntityFurnace; ++ this.addSlotToContainer(new Slot(par2TileEntityFurnace, 0, 56, 17)); ++ this.addSlotToContainer(new Slot(par2TileEntityFurnace, 1, 56, 53)); ++ this.addSlotToContainer(new SlotFurnace(par1InventoryPlayer.player, par2TileEntityFurnace, 2, 116, 35)); + int var3; +- for(var3 = 0; var3 < 3; ++var3) { +- for(int var4 = 0; var4 < 9; ++var4) { +- this.addSlotToContainer(new Slot(var1, var4 + var3 * 9 + 9, 8 + var4 * 18, 84 + var3 * 18)); ++ ++ for (var3 = 0; var3 < 3; ++var3) { ++ for (int var4 = 0; var4 < 9; ++var4) { ++ this.addSlotToContainer(new Slot(par1InventoryPlayer, var4 + var3 * 9 + 9, 8 + var4 * 18, 84 + var3 * 18)); + } + } + +- for(var3 = 0; var3 < 9; ++var3) { +- this.addSlotToContainer(new Slot(var1, var3, 8 + var3 * 18, 142)); ++ for (var3 = 0; var3 < 9; ++var3) { ++ this.addSlotToContainer(new Slot(par1InventoryPlayer, var3, 8 + var3 * 18, 142)); + } +- +- } +- +- public void onCraftGuiOpened(ICrafting var1) { +- super.onCraftGuiOpened(var1); +- var1.sendProgressBarUpdate(this, 0, this.furnace.furnaceCookTime); +- var1.sendProgressBarUpdate(this, 1, this.furnace.furnaceBurnTime); +- var1.sendProgressBarUpdate(this, 2, this.furnace.currentItemBurnTime); +- } +- ++ } ++ ++ // Spout Start ++ public IInventory getIInventory() { ++ return furnace; ++ } ++ // Spout End ++ ++ public void addCraftingToCrafters(ICrafting par1ICrafting) { ++ super.addCraftingToCrafters(par1ICrafting); ++ par1ICrafting.sendProgressBarUpdate(this, 0, this.furnace.furnaceCookTime); ++ par1ICrafting.sendProgressBarUpdate(this, 1, this.furnace.furnaceBurnTime); ++ par1ICrafting.sendProgressBarUpdate(this, 2, this.furnace.currentItemBurnTime); ++ } ++ ++ /** ++ * Looks for changes made in the container, sends them to every listener. ++ */ + public void detectAndSendChanges() { + super.detectAndSendChanges(); + +- for(int var1 = 0; var1 < this.e.size(); ++var1) { +- ICrafting var2 = (ICrafting)this.e.get(var1); +- if(this.lastCookTime != this.furnace.furnaceCookTime) { ++ for (int var1 = 0; var1 < this.crafters.size(); ++var1) { ++ ICrafting var2 = (ICrafting)this.crafters.get(var1); ++ ++ if (this.lastCookTime != this.furnace.furnaceCookTime) { + var2.sendProgressBarUpdate(this, 0, this.furnace.furnaceCookTime); + } + +- if(this.lastBurnTime != this.furnace.furnaceBurnTime) { ++ if (this.lastBurnTime != this.furnace.furnaceBurnTime) { + var2.sendProgressBarUpdate(this, 1, this.furnace.furnaceBurnTime); + } + +- if(this.lastItemBurnTime != this.furnace.currentItemBurnTime) { ++ if (this.lastItemBurnTime != this.furnace.currentItemBurnTime) { + var2.sendProgressBarUpdate(this, 2, this.furnace.currentItemBurnTime); + } + } +@@ -55,68 +64,72 @@ + this.lastItemBurnTime = this.furnace.currentItemBurnTime; + } + +- public void updateProgressBar(int var1, int var2) { +- if(var1 == 0) { +- this.furnace.furnaceCookTime = var2; +- } +- +- if(var1 == 1) { +- this.furnace.furnaceBurnTime = var2; +- } +- +- if(var1 == 2) { +- this.furnace.currentItemBurnTime = var2; +- } +- +- } +- +- public boolean canInteractWith(EntityPlayer var1) { +- return this.furnace.isUseableByPlayer(var1); +- } +- +- public ItemStack transferStackInSlot(EntityPlayer var1, int var2) { ++ public void updateProgressBar(int par1, int par2) { ++ if (par1 == 0) { ++ this.furnace.furnaceCookTime = par2; ++ } ++ ++ if (par1 == 1) { ++ this.furnace.furnaceBurnTime = par2; ++ } ++ ++ if (par1 == 2) { ++ this.furnace.currentItemBurnTime = par2; ++ } ++ } ++ ++ public boolean canInteractWith(EntityPlayer par1EntityPlayer) { ++ return this.furnace.isUseableByPlayer(par1EntityPlayer); ++ } ++ ++ /** ++ * Called when a player shift-clicks on a slot. You must override this or you will crash when someone does that. ++ */ ++ public ItemStack transferStackInSlot(EntityPlayer par1EntityPlayer, int par2) { + ItemStack var3 = null; +- Slot var4 = (Slot)this.c.get(var2); +- if(var4 != null && var4.getHasStack()) { ++ Slot var4 = (Slot)this.inventorySlots.get(par2); ++ ++ if (var4 != null && var4.getHasStack()) { + ItemStack var5 = var4.getStack(); + var3 = var5.copy(); +- if(var2 == 2) { +- if(!this.mergeItemStack(var5, 3, 39, true)) { ++ ++ if (par2 == 2) { ++ if (!this.mergeItemStack(var5, 3, 39, true)) { + return null; + } + + var4.onSlotChange(var5, var3); +- } else if(var2 != 1 && var2 != 0) { +- if(FurnaceRecipes.smelting().getSmeltingResult(var5.getItem().itemID) != null) { +- if(!this.mergeItemStack(var5, 0, 1, false)) { +- return null; +- } +- } else if(TileEntityFurnace.isItemFuel(var5)) { +- if(!this.mergeItemStack(var5, 1, 2, false)) { +- return null; +- } +- } else if(var2 >= 3 && var2 < 30) { +- if(!this.mergeItemStack(var5, 30, 39, false)) { +- return null; +- } +- } else if(var2 >= 30 && var2 < 39 && !this.mergeItemStack(var5, 3, 30, false)) { ++ } else if (par2 != 1 && par2 != 0) { ++ if (FurnaceRecipes.smelting().getSmeltingResult(var5.getItem().itemID) != null) { ++ if (!this.mergeItemStack(var5, 0, 1, false)) { ++ return null; ++ } ++ } else if (TileEntityFurnace.isItemFuel(var5)) { ++ if (!this.mergeItemStack(var5, 1, 2, false)) { ++ return null; ++ } ++ } else if (par2 >= 3 && par2 < 30) { ++ if (!this.mergeItemStack(var5, 30, 39, false)) { ++ return null; ++ } ++ } else if (par2 >= 30 && par2 < 39 && !this.mergeItemStack(var5, 3, 30, false)) { + return null; + } +- } else if(!this.mergeItemStack(var5, 3, 39, false)) { ++ } else if (!this.mergeItemStack(var5, 3, 39, false)) { + return null; + } + +- if(var5.stackSize == 0) { ++ if (var5.stackSize == 0) { + var4.putStack((ItemStack)null); + } else { + var4.onSlotChanged(); + } + +- if(var5.stackSize == var3.stackSize) { ++ if (var5.stackSize == var3.stackSize) { + return null; + } + +- var4.onPickupFromSlot(var1, var5); ++ var4.onPickupFromSlot(par1EntityPlayer, var5); + } + + return var3; diff --git a/patches/net/minecraft/src/ContainerHopper.java.patch b/patches/net/minecraft/src/ContainerHopper.java.patch new file mode 100644 index 0000000..97a7a80 --- /dev/null +++ b/patches/net/minecraft/src/ContainerHopper.java.patch @@ -0,0 +1,93 @@ +--- net/minecraft/src/ContainerHopper.java ++++ net/minecraft/src/ContainerHopper.java +@@ -3,47 +3,51 @@ + public class ContainerHopper extends Container { + private final IInventory field_94538_a; + +- public ContainerHopper(InventoryPlayer var1, IInventory var2) { +- this.field_94538_a = var2; +- var2.openChest(); ++ public ContainerHopper(InventoryPlayer par1InventoryPlayer, IInventory par2IInventory) { ++ this.field_94538_a = par2IInventory; ++ par2IInventory.openChest(); + byte var3 = 51; +- + int var4; +- for(var4 = 0; var4 < var2.getSizeInventory(); ++var4) { +- this.addSlotToContainer(new Slot(var2, var4, 44 + var4 * 18, 20)); ++ ++ for (var4 = 0; var4 < par2IInventory.getSizeInventory(); ++var4) { ++ this.addSlotToContainer(new Slot(par2IInventory, var4, 44 + var4 * 18, 20)); + } + +- for(var4 = 0; var4 < 3; ++var4) { +- for(int var5 = 0; var5 < 9; ++var5) { +- this.addSlotToContainer(new Slot(var1, var5 + var4 * 9 + 9, 8 + var5 * 18, var4 * 18 + var3)); ++ for (var4 = 0; var4 < 3; ++var4) { ++ for (int var5 = 0; var5 < 9; ++var5) { ++ this.addSlotToContainer(new Slot(par1InventoryPlayer, var5 + var4 * 9 + 9, 8 + var5 * 18, var4 * 18 + var3)); + } + } + +- for(var4 = 0; var4 < 9; ++var4) { +- this.addSlotToContainer(new Slot(var1, var4, 8 + var4 * 18, 58 + var3)); ++ for (var4 = 0; var4 < 9; ++var4) { ++ this.addSlotToContainer(new Slot(par1InventoryPlayer, var4, 8 + var4 * 18, 58 + var3)); + } +- +- } +- +- public boolean canInteractWith(EntityPlayer var1) { +- return this.field_94538_a.isUseableByPlayer(var1); +- } +- +- public ItemStack transferStackInSlot(EntityPlayer var1, int var2) { ++ } ++ ++ public boolean canInteractWith(EntityPlayer par1EntityPlayer) { ++ return this.field_94538_a.isUseableByPlayer(par1EntityPlayer); ++ } ++ ++ /** ++ * Called when a player shift-clicks on a slot. You must override this or you will crash when someone does that. ++ */ ++ public ItemStack transferStackInSlot(EntityPlayer par1EntityPlayer, int par2) { + ItemStack var3 = null; +- Slot var4 = (Slot)this.c.get(var2); +- if(var4 != null && var4.getHasStack()) { ++ Slot var4 = (Slot)this.inventorySlots.get(par2); ++ ++ if (var4 != null && var4.getHasStack()) { + ItemStack var5 = var4.getStack(); + var3 = var5.copy(); +- if(var2 < this.field_94538_a.getSizeInventory()) { +- if(!this.mergeItemStack(var5, this.field_94538_a.getSizeInventory(), this.c.size(), true)) { ++ ++ if (par2 < this.field_94538_a.getSizeInventory()) { ++ if (!this.mergeItemStack(var5, this.field_94538_a.getSizeInventory(), this.inventorySlots.size(), true)) { + return null; + } +- } else if(!this.mergeItemStack(var5, 0, this.field_94538_a.getSizeInventory(), false)) { ++ } else if (!this.mergeItemStack(var5, 0, this.field_94538_a.getSizeInventory(), false)) { + return null; + } + +- if(var5.stackSize == 0) { ++ if (var5.stackSize == 0) { + var4.putStack((ItemStack)null); + } else { + var4.onSlotChanged(); +@@ -53,8 +57,11 @@ + return var3; + } + +- public void onContainerClosed(EntityPlayer var1) { +- super.onContainerClosed(var1); ++ /** ++ * Called when the container is closed. ++ */ ++ public void onContainerClosed(EntityPlayer par1EntityPlayer) { ++ super.onContainerClosed(par1EntityPlayer); + this.field_94538_a.closeChest(); + } + } diff --git a/patches/net/minecraft/src/ContainerHorseInventory.java.patch b/patches/net/minecraft/src/ContainerHorseInventory.java.patch new file mode 100644 index 0000000..b22a670 --- /dev/null +++ b/patches/net/minecraft/src/ContainerHorseInventory.java.patch @@ -0,0 +1,124 @@ +--- net/minecraft/src/ContainerHorseInventory.java ++++ net/minecraft/src/ContainerHorseInventory.java +@@ -4,63 +4,68 @@ + private IInventory field_111243_a; + private EntityHorse theHorse; + +- public ContainerHorseInventory(IInventory var1, IInventory var2, EntityHorse var3) { +- this.field_111243_a = var2; +- this.theHorse = var3; ++ public ContainerHorseInventory(IInventory par1IInventory, IInventory par2IInventory, EntityHorse par3EntityHorse) { ++ this.field_111243_a = par2IInventory; ++ this.theHorse = par3EntityHorse; + byte var4 = 3; +- var2.openChest(); ++ par2IInventory.openChest(); + int var5 = (var4 - 4) * 18; +- this.addSlotToContainer(new ContainerHorseInventorySlotSaddle(this, var2, 0, 8, 18)); +- this.addSlotToContainer(new ContainerHorseInventorySlotArmor(this, var2, 1, 8, 36, var3)); ++ this.addSlotToContainer(new ContainerHorseInventorySlotSaddle(this, par2IInventory, 0, 8, 18)); ++ this.addSlotToContainer(new ContainerHorseInventorySlotArmor(this, par2IInventory, 1, 8, 36, par3EntityHorse)); + int var6; + int var7; +- if(var3.isChested()) { +- for(var6 = 0; var6 < var4; ++var6) { +- for(var7 = 0; var7 < 5; ++var7) { +- this.addSlotToContainer(new Slot(var2, 2 + var7 + var6 * 5, 80 + var7 * 18, 18 + var6 * 18)); ++ ++ if (par3EntityHorse.isChested()) { ++ for (var6 = 0; var6 < var4; ++var6) { ++ for (var7 = 0; var7 < 5; ++var7) { ++ this.addSlotToContainer(new Slot(par2IInventory, 2 + var7 + var6 * 5, 80 + var7 * 18, 18 + var6 * 18)); + } + } + } + +- for(var6 = 0; var6 < 3; ++var6) { +- for(var7 = 0; var7 < 9; ++var7) { +- this.addSlotToContainer(new Slot(var1, var7 + var6 * 9 + 9, 8 + var7 * 18, 102 + var6 * 18 + var5)); ++ for (var6 = 0; var6 < 3; ++var6) { ++ for (var7 = 0; var7 < 9; ++var7) { ++ this.addSlotToContainer(new Slot(par1IInventory, var7 + var6 * 9 + 9, 8 + var7 * 18, 102 + var6 * 18 + var5)); + } + } + +- for(var6 = 0; var6 < 9; ++var6) { +- this.addSlotToContainer(new Slot(var1, var6, 8 + var6 * 18, 160 + var5)); ++ for (var6 = 0; var6 < 9; ++var6) { ++ this.addSlotToContainer(new Slot(par1IInventory, var6, 8 + var6 * 18, 160 + var5)); + } +- +- } +- +- public boolean canInteractWith(EntityPlayer var1) { +- return this.field_111243_a.isUseableByPlayer(var1) && this.theHorse.isEntityAlive() && this.theHorse.getDistanceToEntity(var1) < 8.0F; +- } +- +- public ItemStack transferStackInSlot(EntityPlayer var1, int var2) { ++ } ++ ++ public boolean canInteractWith(EntityPlayer par1EntityPlayer) { ++ return this.field_111243_a.isUseableByPlayer(par1EntityPlayer) && this.theHorse.isEntityAlive() && this.theHorse.getDistanceToEntity(par1EntityPlayer) < 8.0F; ++ } ++ ++ /** ++ * Called when a player shift-clicks on a slot. You must override this or you will crash when someone does that. ++ */ ++ public ItemStack transferStackInSlot(EntityPlayer par1EntityPlayer, int par2) { + ItemStack var3 = null; +- Slot var4 = (Slot)this.c.get(var2); +- if(var4 != null && var4.getHasStack()) { ++ Slot var4 = (Slot)this.inventorySlots.get(par2); ++ ++ if (var4 != null && var4.getHasStack()) { + ItemStack var5 = var4.getStack(); + var3 = var5.copy(); +- if(var2 < this.field_111243_a.getSizeInventory()) { +- if(!this.mergeItemStack(var5, this.field_111243_a.getSizeInventory(), this.c.size(), true)) { +- return null; +- } +- } else if(this.getSlot(1).isItemValid(var5) && !this.getSlot(1).getHasStack()) { +- if(!this.mergeItemStack(var5, 1, 2, false)) { +- return null; +- } +- } else if(this.getSlot(0).isItemValid(var5)) { +- if(!this.mergeItemStack(var5, 0, 1, false)) { +- return null; +- } +- } else if(this.field_111243_a.getSizeInventory() <= 2 || !this.mergeItemStack(var5, 2, this.field_111243_a.getSizeInventory(), false)) { ++ ++ if (par2 < this.field_111243_a.getSizeInventory()) { ++ if (!this.mergeItemStack(var5, this.field_111243_a.getSizeInventory(), this.inventorySlots.size(), true)) { ++ return null; ++ } ++ } else if (this.getSlot(1).isItemValid(var5) && !this.getSlot(1).getHasStack()) { ++ if (!this.mergeItemStack(var5, 1, 2, false)) { ++ return null; ++ } ++ } else if (this.getSlot(0).isItemValid(var5)) { ++ if (!this.mergeItemStack(var5, 0, 1, false)) { ++ return null; ++ } ++ } else if (this.field_111243_a.getSizeInventory() <= 2 || !this.mergeItemStack(var5, 2, this.field_111243_a.getSizeInventory(), false)) { + return null; + } + +- if(var5.stackSize == 0) { ++ if (var5.stackSize == 0) { + var4.putStack((ItemStack)null); + } else { + var4.onSlotChanged(); +@@ -70,8 +75,11 @@ + return var3; + } + +- public void onContainerClosed(EntityPlayer var1) { +- super.onContainerClosed(var1); ++ /** ++ * Called when the container is closed. ++ */ ++ public void onContainerClosed(EntityPlayer par1EntityPlayer) { ++ super.onContainerClosed(par1EntityPlayer); + this.field_111243_a.closeChest(); + } + } diff --git a/patches/net/minecraft/src/ContainerHorseInventorySlotArmor.java.patch b/patches/net/minecraft/src/ContainerHorseInventorySlotArmor.java.patch new file mode 100644 index 0000000..8f5a774 --- /dev/null +++ b/patches/net/minecraft/src/ContainerHorseInventorySlotArmor.java.patch @@ -0,0 +1,29 @@ +--- net/minecraft/src/ContainerHorseInventorySlotArmor.java ++++ net/minecraft/src/ContainerHorseInventorySlotArmor.java +@@ -2,16 +2,20 @@ + + class ContainerHorseInventorySlotArmor extends Slot { + final EntityHorse theHorse; ++ + final ContainerHorseInventory field_111240_b; + +- ContainerHorseInventorySlotArmor(ContainerHorseInventory var1, IInventory var2, int var3, int var4, int var5, EntityHorse var6) { +- super(var2, var3, var4, var5); +- this.field_111240_b = var1; +- this.theHorse = var6; ++ ContainerHorseInventorySlotArmor(ContainerHorseInventory par1ContainerHorseInventory, IInventory par2IInventory, int par3, int par4, int par5, EntityHorse par6EntityHorse) { ++ super(par2IInventory, par3, par4, par5); ++ this.field_111240_b = par1ContainerHorseInventory; ++ this.theHorse = par6EntityHorse; + } + +- public boolean isItemValid(ItemStack var1) { +- return super.isItemValid(var1) && this.theHorse.func_110259_cr() && EntityHorse.func_110211_v(var1.itemID); ++ /** ++ * Check if the stack is a valid item for this slot. Always true beside for the armor slots. ++ */ ++ public boolean isItemValid(ItemStack par1ItemStack) { ++ return super.isItemValid(par1ItemStack) && this.theHorse.func_110259_cr() && EntityHorse.func_110211_v(par1ItemStack.itemID); + } + + public boolean func_111238_b() { diff --git a/patches/net/minecraft/src/ContainerHorseInventorySlotSaddle.java.patch b/patches/net/minecraft/src/ContainerHorseInventorySlotSaddle.java.patch new file mode 100644 index 0000000..d3f378d --- /dev/null +++ b/patches/net/minecraft/src/ContainerHorseInventorySlotSaddle.java.patch @@ -0,0 +1,23 @@ +--- net/minecraft/src/ContainerHorseInventorySlotSaddle.java ++++ net/minecraft/src/ContainerHorseInventorySlotSaddle.java +@@ -3,12 +3,15 @@ + class ContainerHorseInventorySlotSaddle extends Slot { + final ContainerHorseInventory field_111239_a; + +- ContainerHorseInventorySlotSaddle(ContainerHorseInventory var1, IInventory var2, int var3, int var4, int var5) { +- super(var2, var3, var4, var5); +- this.field_111239_a = var1; ++ ContainerHorseInventorySlotSaddle(ContainerHorseInventory par1ContainerHorseInventory, IInventory par2IInventory, int par3, int par4, int par5) { ++ super(par2IInventory, par3, par4, par5); ++ this.field_111239_a = par1ContainerHorseInventory; + } + +- public boolean isItemValid(ItemStack var1) { +- return super.isItemValid(var1) && var1.itemID == Item.saddle.itemID && !this.getHasStack(); ++ /** ++ * Check if the stack is a valid item for this slot. Always true beside for the armor slots. ++ */ ++ public boolean isItemValid(ItemStack par1ItemStack) { ++ return super.isItemValid(par1ItemStack) && par1ItemStack.itemID == Item.saddle.itemID && !this.getHasStack(); + } + } diff --git a/patches/net/minecraft/src/ContainerMerchant.java.patch b/patches/net/minecraft/src/ContainerMerchant.java.patch new file mode 100644 index 0000000..c331502 --- /dev/null +++ b/patches/net/minecraft/src/ContainerMerchant.java.patch @@ -0,0 +1,194 @@ +--- net/minecraft/src/ContainerMerchant.java ++++ net/minecraft/src/ContainerMerchant.java +@@ -1,114 +1,138 @@ + package net.minecraft.src; + + public class ContainerMerchant extends Container { ++ ++ /** Instance of Merchant. */ + private IMerchant theMerchant; + private InventoryMerchant merchantInventory; ++ ++ /** Instance of World. */ + private final World theWorld; + +- public ContainerMerchant(InventoryPlayer var1, IMerchant var2, World var3) { +- this.theMerchant = var2; +- this.theWorld = var3; +- this.merchantInventory = new InventoryMerchant(var1.player, var2); ++ public ContainerMerchant(InventoryPlayer par1InventoryPlayer, IMerchant par2IMerchant, World par3World) { ++ this.theMerchant = par2IMerchant; ++ this.theWorld = par3World; ++ this.merchantInventory = new InventoryMerchant(par1InventoryPlayer.player, par2IMerchant); + this.addSlotToContainer(new Slot(this.merchantInventory, 0, 36, 53)); + this.addSlotToContainer(new Slot(this.merchantInventory, 1, 62, 53)); +- this.addSlotToContainer(new SlotMerchantResult(var1.player, var2, this.merchantInventory, 2, 120, 53)); +- ++ this.addSlotToContainer(new SlotMerchantResult(par1InventoryPlayer.player, par2IMerchant, this.merchantInventory, 2, 120, 53)); + int var4; +- for(var4 = 0; var4 < 3; ++var4) { +- for(int var5 = 0; var5 < 9; ++var5) { +- this.addSlotToContainer(new Slot(var1, var5 + var4 * 9 + 9, 8 + var5 * 18, 84 + var4 * 18)); ++ ++ for (var4 = 0; var4 < 3; ++var4) { ++ for (int var5 = 0; var5 < 9; ++var5) { ++ this.addSlotToContainer(new Slot(par1InventoryPlayer, var5 + var4 * 9 + 9, 8 + var5 * 18, 84 + var4 * 18)); + } + } + +- for(var4 = 0; var4 < 9; ++var4) { +- this.addSlotToContainer(new Slot(var1, var4, 8 + var4 * 18, 142)); ++ for (var4 = 0; var4 < 9; ++var4) { ++ this.addSlotToContainer(new Slot(par1InventoryPlayer, var4, 8 + var4 * 18, 142)); + } +- + } + + public InventoryMerchant getMerchantInventory() { + return this.merchantInventory; + } + +- public void onCraftGuiOpened(ICrafting var1) { +- super.onCraftGuiOpened(var1); +- } +- ++ public void addCraftingToCrafters(ICrafting par1ICrafting) { ++ super.addCraftingToCrafters(par1ICrafting); ++ } ++ ++ // Spout Start ++ public IInventory getIInventory() { ++ return merchantInventory; ++ } ++ // Spout End ++ ++ /** ++ * Looks for changes made in the container, sends them to every listener. ++ */ + public void detectAndSendChanges() { + super.detectAndSendChanges(); + } + +- public void onCraftMatrixChanged(IInventory var1) { ++ /** ++ * Callback for when the crafting matrix is changed. ++ */ ++ public void onCraftMatrixChanged(IInventory par1IInventory) { + this.merchantInventory.resetRecipeAndSlots(); +- super.onCraftMatrixChanged(var1); +- } +- +- public void setCurrentRecipeIndex(int var1) { +- this.merchantInventory.setCurrentRecipeIndex(var1); +- } +- +- public void updateProgressBar(int var1, int var2) { +- } +- +- public boolean canInteractWith(EntityPlayer var1) { +- return this.theMerchant.getCustomer() == var1; +- } +- +- public ItemStack transferStackInSlot(EntityPlayer var1, int var2) { ++ super.onCraftMatrixChanged(par1IInventory); ++ } ++ ++ public void setCurrentRecipeIndex(int par1) { ++ this.merchantInventory.setCurrentRecipeIndex(par1); ++ } ++ ++ public void updateProgressBar(int par1, int par2) {} ++ ++ public boolean canInteractWith(EntityPlayer par1EntityPlayer) { ++ return this.theMerchant.getCustomer() == par1EntityPlayer; ++ } ++ ++ /** ++ * Called when a player shift-clicks on a slot. You must override this or you will crash when someone does that. ++ */ ++ public ItemStack transferStackInSlot(EntityPlayer par1EntityPlayer, int par2) { + ItemStack var3 = null; +- Slot var4 = (Slot)this.c.get(var2); +- if(var4 != null && var4.getHasStack()) { ++ Slot var4 = (Slot)this.inventorySlots.get(par2); ++ ++ if (var4 != null && var4.getHasStack()) { + ItemStack var5 = var4.getStack(); + var3 = var5.copy(); +- if(var2 == 2) { +- if(!this.mergeItemStack(var5, 3, 39, true)) { ++ ++ if (par2 == 2) { ++ if (!this.mergeItemStack(var5, 3, 39, true)) { + return null; + } + + var4.onSlotChange(var5, var3); +- } else if(var2 != 0 && var2 != 1) { +- if(var2 >= 3 && var2 < 30) { +- if(!this.mergeItemStack(var5, 30, 39, false)) { ++ } else if (par2 != 0 && par2 != 1) { ++ if (par2 >= 3 && par2 < 30) { ++ if (!this.mergeItemStack(var5, 30, 39, false)) { + return null; + } +- } else if(var2 >= 30 && var2 < 39 && !this.mergeItemStack(var5, 3, 30, false)) { ++ } else if (par2 >= 30 && par2 < 39 && !this.mergeItemStack(var5, 3, 30, false)) { + return null; + } +- } else if(!this.mergeItemStack(var5, 3, 39, false)) { ++ } else if (!this.mergeItemStack(var5, 3, 39, false)) { + return null; + } + +- if(var5.stackSize == 0) { ++ if (var5.stackSize == 0) { + var4.putStack((ItemStack)null); + } else { + var4.onSlotChanged(); + } + +- if(var5.stackSize == var3.stackSize) { ++ if (var5.stackSize == var3.stackSize) { + return null; + } + +- var4.onPickupFromSlot(var1, var5); ++ var4.onPickupFromSlot(par1EntityPlayer, var5); + } + + return var3; + } + +- public void onContainerClosed(EntityPlayer var1) { +- super.onContainerClosed(var1); ++ /** ++ * Called when the container is closed. ++ */ ++ public void onContainerClosed(EntityPlayer par1EntityPlayer) { ++ super.onContainerClosed(par1EntityPlayer); + this.theMerchant.setCustomer((EntityPlayer)null); +- super.onContainerClosed(var1); +- if(!this.theWorld.isRemote) { ++ super.onContainerClosed(par1EntityPlayer); ++ ++ if (!this.theWorld.isRemote) { + ItemStack var2 = this.merchantInventory.getStackInSlotOnClosing(0); +- if(var2 != null) { +- var1.dropPlayerItem(var2); ++ ++ if (var2 != null) { ++ par1EntityPlayer.dropPlayerItem(var2); + } + + var2 = this.merchantInventory.getStackInSlotOnClosing(1); +- if(var2 != null) { +- var1.dropPlayerItem(var2); +- } + ++ if (var2 != null) { ++ par1EntityPlayer.dropPlayerItem(var2); ++ } + } + } + } diff --git a/patches/net/minecraft/src/ContainerPlayer.java.patch b/patches/net/minecraft/src/ContainerPlayer.java.patch new file mode 100644 index 0000000..a2640f6 --- /dev/null +++ b/patches/net/minecraft/src/ContainerPlayer.java.patch @@ -0,0 +1,199 @@ +--- net/minecraft/src/ContainerPlayer.java ++++ net/minecraft/src/ContainerPlayer.java +@@ -1,116 +1,144 @@ + package net.minecraft.src; + + public class ContainerPlayer extends Container { ++ ++ /** The crafting matrix inventory. */ + public InventoryCrafting craftMatrix = new InventoryCrafting(this, 2, 2); + public IInventory craftResult = new InventoryCraftResult(); ++ ++ /** Determines if inventory manipulation should be handled. */ + public boolean isLocalWorld; + private final EntityPlayer thePlayer; + +- public ContainerPlayer(InventoryPlayer var1, boolean var2, EntityPlayer var3) { +- this.isLocalWorld = var2; +- this.thePlayer = var3; +- this.addSlotToContainer(new SlotCrafting(var1.player, this.craftMatrix, this.craftResult, 0, 144, 36)); +- ++ public ContainerPlayer(InventoryPlayer par1InventoryPlayer, boolean par2, EntityPlayer par3EntityPlayer) { ++ this.isLocalWorld = par2; ++ this.thePlayer = par3EntityPlayer; ++ this.addSlotToContainer(new SlotCrafting(par1InventoryPlayer.player, this.craftMatrix, this.craftResult, 0, 144, 36)); + int var4; + int var5; +- for(var4 = 0; var4 < 2; ++var4) { +- for(var5 = 0; var5 < 2; ++var5) { ++ ++ for (var4 = 0; var4 < 2; ++var4) { ++ for (var5 = 0; var5 < 2; ++var5) { + this.addSlotToContainer(new Slot(this.craftMatrix, var5 + var4 * 2, 88 + var5 * 18, 26 + var4 * 18)); + } + } + +- for(var4 = 0; var4 < 4; ++var4) { +- this.addSlotToContainer(new SlotArmor(this, var1, var1.getSizeInventory() - 1 - var4, 8, 8 + var4 * 18, var4)); ++ for (var4 = 0; var4 < 4; ++var4) { ++ this.addSlotToContainer(new SlotArmor(this, par1InventoryPlayer, par1InventoryPlayer.getSizeInventory() - 1 - var4, 8, 8 + var4 * 18, var4)); + } + +- for(var4 = 0; var4 < 3; ++var4) { +- for(var5 = 0; var5 < 9; ++var5) { +- this.addSlotToContainer(new Slot(var1, var5 + (var4 + 1) * 9, 8 + var5 * 18, 84 + var4 * 18)); ++ for (var4 = 0; var4 < 3; ++var4) { ++ for (var5 = 0; var5 < 9; ++var5) { ++ this.addSlotToContainer(new Slot(par1InventoryPlayer, var5 + (var4 + 1) * 9, 8 + var5 * 18, 84 + var4 * 18)); + } + } + +- for(var4 = 0; var4 < 9; ++var4) { +- this.addSlotToContainer(new Slot(var1, var4, 8 + var4 * 18, 142)); ++ for (var4 = 0; var4 < 9; ++var4) { ++ this.addSlotToContainer(new Slot(par1InventoryPlayer, var4, 8 + var4 * 18, 142)); + } + + this.onCraftMatrixChanged(this.craftMatrix); + } + +- public void onCraftMatrixChanged(IInventory var1) { ++ // Spout Start - Inventory sorting ++ public IInventory getIInventory() { ++ return Minecraft.getMinecraft().thePlayer.inventory; ++ } ++ ++ @Override ++ public boolean isSortableInventory() { ++ return true; ++ } ++ // Spout End ++ ++ /** ++ * Callback for when the crafting matrix is changed. ++ */ ++ public void onCraftMatrixChanged(IInventory par1IInventory) { + this.craftResult.setInventorySlotContents(0, CraftingManager.getInstance().findMatchingRecipe(this.craftMatrix, this.thePlayer.worldObj)); + } + +- public void onContainerClosed(EntityPlayer var1) { +- super.onContainerClosed(var1); ++ /** ++ * Called when the container is closed. ++ */ ++ public void onContainerClosed(EntityPlayer par1EntityPlayer) { ++ super.onContainerClosed(par1EntityPlayer); + +- for(int var2 = 0; var2 < 4; ++var2) { ++ for (int var2 = 0; var2 < 4; ++var2) { + ItemStack var3 = this.craftMatrix.getStackInSlotOnClosing(var2); +- if(var3 != null) { +- var1.dropPlayerItem(var3); ++ ++ if (var3 != null) { ++ par1EntityPlayer.dropPlayerItem(var3); + } + } + + this.craftResult.setInventorySlotContents(0, (ItemStack)null); + } + +- public boolean canInteractWith(EntityPlayer var1) { ++ public boolean canInteractWith(EntityPlayer par1EntityPlayer) { + return true; + } + +- public ItemStack transferStackInSlot(EntityPlayer var1, int var2) { ++ /** ++ * Called when a player shift-clicks on a slot. You must override this or you will crash when someone does that. ++ */ ++ public ItemStack transferStackInSlot(EntityPlayer par1EntityPlayer, int par2) { + ItemStack var3 = null; +- Slot var4 = (Slot)this.c.get(var2); +- if(var4 != null && var4.getHasStack()) { ++ Slot var4 = (Slot)this.inventorySlots.get(par2); ++ ++ if (var4 != null && var4.getHasStack()) { + ItemStack var5 = var4.getStack(); + var3 = var5.copy(); +- if(var2 == 0) { +- if(!this.mergeItemStack(var5, 9, 45, true)) { ++ ++ if (par2 == 0) { ++ if (!this.mergeItemStack(var5, 9, 45, true)) { + return null; + } + + var4.onSlotChange(var5, var3); +- } else if(var2 >= 1 && var2 < 5) { +- if(!this.mergeItemStack(var5, 9, 45, false)) { +- return null; +- } +- } else if(var2 >= 5 && var2 < 9) { +- if(!this.mergeItemStack(var5, 9, 45, false)) { +- return null; +- } +- } else if(var3.getItem() instanceof ItemArmor && !((Slot)this.c.get(5 + ((ItemArmor)var3.getItem()).armorType)).getHasStack()) { ++ } else if (par2 >= 1 && par2 < 5) { ++ if (!this.mergeItemStack(var5, 9, 45, false)) { ++ return null; ++ } ++ } else if (par2 >= 5 && par2 < 9) { ++ if (!this.mergeItemStack(var5, 9, 45, false)) { ++ return null; ++ } ++ } else if (var3.getItem() instanceof ItemArmor && !((Slot)this.inventorySlots.get(5 + ((ItemArmor)var3.getItem()).armorType)).getHasStack()) { + int var6 = 5 + ((ItemArmor)var3.getItem()).armorType; +- if(!this.mergeItemStack(var5, var6, var6 + 1, false)) { +- return null; +- } +- } else if(var2 >= 9 && var2 < 36) { +- if(!this.mergeItemStack(var5, 36, 45, false)) { +- return null; +- } +- } else if(var2 >= 36 && var2 < 45) { +- if(!this.mergeItemStack(var5, 9, 36, false)) { +- return null; +- } +- } else if(!this.mergeItemStack(var5, 9, 45, false)) { ++ ++ if (!this.mergeItemStack(var5, var6, var6 + 1, false)) { ++ return null; ++ } ++ } else if (par2 >= 9 && par2 < 36) { ++ if (!this.mergeItemStack(var5, 36, 45, false)) { ++ return null; ++ } ++ } else if (par2 >= 36 && par2 < 45) { ++ if (!this.mergeItemStack(var5, 9, 36, false)) { ++ return null; ++ } ++ } else if (!this.mergeItemStack(var5, 9, 45, false)) { + return null; + } + +- if(var5.stackSize == 0) { ++ if (var5.stackSize == 0) { + var4.putStack((ItemStack)null); + } else { + var4.onSlotChanged(); + } + +- if(var5.stackSize == var3.stackSize) { ++ if (var5.stackSize == var3.stackSize) { + return null; + } + +- var4.onPickupFromSlot(var1, var5); ++ var4.onPickupFromSlot(par1EntityPlayer, var5); + } + + return var3; + } + +- public boolean func_94530_a(ItemStack var1, Slot var2) { +- return var2.inventory != this.craftResult && super.func_94530_a(var1, var2); ++ public boolean func_94530_a(ItemStack par1ItemStack, Slot par2Slot) { ++ return par2Slot.inventory != this.craftResult && super.func_94530_a(par1ItemStack, par2Slot); + } + } diff --git a/patches/net/minecraft/src/ContainerRepair.java.patch b/patches/net/minecraft/src/ContainerRepair.java.patch new file mode 100644 index 0000000..ca7cd8f --- /dev/null +++ b/patches/net/minecraft/src/ContainerRepair.java.patch @@ -0,0 +1,516 @@ +--- net/minecraft/src/ContainerRepair.java ++++ net/minecraft/src/ContainerRepair.java +@@ -4,55 +4,73 @@ + import java.util.Map; + + public class ContainerRepair extends Container { ++ ++ /** Here comes out item you merged and/or renamed. */ + private IInventory outputSlot = new InventoryCraftResult(); ++ ++ /** ++ * The 2slots where you put your items in that you want to merge and/or rename. ++ */ + private IInventory inputSlots = new ContainerRepairINNER1(this, "Repair", true, 2); + private World theWorld; + private int field_82861_i; + private int field_82858_j; + private int field_82859_k; ++ ++ /** The maximum cost of repairing/renaming in the anvil. */ + public int maximumCost; ++ ++ /** determined by damage of input item and stackSize of repair materials */ + private int stackSizeToBeUsedInRepair; +- private String m; ++ private String repairedItemName; ++ ++ /** The player that has this container open. */ + private final EntityPlayer thePlayer; + +- public ContainerRepair(InventoryPlayer var1, World var2, int var3, int var4, int var5, EntityPlayer var6) { +- this.theWorld = var2; +- this.field_82861_i = var3; +- this.field_82858_j = var4; +- this.field_82859_k = var5; +- this.thePlayer = var6; ++ public ContainerRepair(InventoryPlayer par1InventoryPlayer, World par2World, int par3, int par4, int par5, EntityPlayer par6EntityPlayer) { ++ this.theWorld = par2World; ++ this.field_82861_i = par3; ++ this.field_82858_j = par4; ++ this.field_82859_k = par5; ++ this.thePlayer = par6EntityPlayer; + this.addSlotToContainer(new Slot(this.inputSlots, 0, 27, 47)); + this.addSlotToContainer(new Slot(this.inputSlots, 1, 76, 47)); +- this.addSlotToContainer(new ContainerRepairINNER2(this, this.outputSlot, 2, 134, 47, var2, var3, var4, var5)); +- ++ this.addSlotToContainer(new ContainerRepairINNER2(this, this.outputSlot, 2, 134, 47, par2World, par3, par4, par5)); + int var7; +- for(var7 = 0; var7 < 3; ++var7) { +- for(int var8 = 0; var8 < 9; ++var8) { +- this.addSlotToContainer(new Slot(var1, var8 + var7 * 9 + 9, 8 + var8 * 18, 84 + var7 * 18)); ++ ++ for (var7 = 0; var7 < 3; ++var7) { ++ for (int var8 = 0; var8 < 9; ++var8) { ++ this.addSlotToContainer(new Slot(par1InventoryPlayer, var8 + var7 * 9 + 9, 8 + var8 * 18, 84 + var7 * 18)); + } + } + +- for(var7 = 0; var7 < 9; ++var7) { +- this.addSlotToContainer(new Slot(var1, var7, 8 + var7 * 18, 142)); ++ for (var7 = 0; var7 < 9; ++var7) { ++ this.addSlotToContainer(new Slot(par1InventoryPlayer, var7, 8 + var7 * 18, 142)); + } +- + } + +- public void onCraftMatrixChanged(IInventory var1) { +- super.onCraftMatrixChanged(var1); +- if(var1 == this.inputSlots) { ++ /** ++ * Callback for when the crafting matrix is changed. ++ */ ++ public void onCraftMatrixChanged(IInventory par1IInventory) { ++ super.onCraftMatrixChanged(par1IInventory); ++ ++ if (par1IInventory == this.inputSlots) { + this.updateRepairOutput(); + } +- + } + ++ /** ++ * called when the Anvil Input Slot changes, calculates the new result and puts it in the output slot ++ */ + public void updateRepairOutput() { + ItemStack var1 = this.inputSlots.getStackInSlot(0); + this.maximumCost = 0; + int var2 = 0; + byte var3 = 0; + int var4 = 0; +- if(var1 == null) { ++ ++ if (var1 == null) { + this.outputSlot.setInventorySlotContents(0, (ItemStack)null); + this.maximumCost = 0; + } else { +@@ -69,17 +87,20 @@ + int var14; + Iterator var21; + Enchantment var22; +- if(var6 != null) { ++ ++ if (var6 != null) { + var8 = var6.itemID == Item.enchantedBook.itemID && Item.enchantedBook.func_92110_g(var6).tagCount() > 0; +- if(var5.isItemStackDamageable() && Item.itemsList[var5.itemID].getIsRepairable(var1, var6)) { ++ ++ if (var5.isItemStackDamageable() && Item.itemsList[var5.itemID].getIsRepairable(var1, var6)) { + var9 = Math.min(var5.getItemDamageForDisplay(), var5.getMaxDamage() / 4); +- if(var9 <= 0) { ++ ++ if (var9 <= 0) { + this.outputSlot.setInventorySlotContents(0, (ItemStack)null); + this.maximumCost = 0; + return; + } + +- for(var10 = 0; var9 > 0 && var10 < var6.stackSize; ++var10) { ++ for (var10 = 0; var9 > 0 && var10 < var6.stackSize; ++var10) { + var11 = var5.getItemDamageForDisplay() - var9; + var5.setItemDamage(var11); + var2 += Math.max(1, var9 / 100) + var7.size(); +@@ -88,23 +109,24 @@ + + this.stackSizeToBeUsedInRepair = var10; + } else { +- if(!var8 && (var5.itemID != var6.itemID || !var5.isItemStackDamageable())) { ++ if (!var8 && (var5.itemID != var6.itemID || !var5.isItemStackDamageable())) { + this.outputSlot.setInventorySlotContents(0, (ItemStack)null); + this.maximumCost = 0; + return; + } + +- if(var5.isItemStackDamageable() && !var8) { ++ if (var5.isItemStackDamageable() && !var8) { + var9 = var1.getMaxDamage() - var1.getItemDamageForDisplay(); + var10 = var6.getMaxDamage() - var6.getItemDamageForDisplay(); + var11 = var10 + var5.getMaxDamage() * 12 / 100; + int var12 = var9 + var11; + var13 = var5.getMaxDamage() - var12; +- if(var13 < 0) { ++ ++ if (var13 < 0) { + var13 = 0; + } + +- if(var13 < var5.getItemDamage()) { ++ if (var13 < var5.getItemDamage()) { + var5.setItemDamage(var13); + var2 += Math.max(1, var11 / 100); + } +@@ -113,13 +135,14 @@ + Map var20 = EnchantmentHelper.getEnchantments(var6); + var21 = var20.keySet().iterator(); + +- while(var21.hasNext()) { ++ while (var21.hasNext()) { + var11 = ((Integer)var21.next()).intValue(); + var22 = Enchantment.enchantmentsList[var11]; + var13 = var7.containsKey(Integer.valueOf(var11)) ? ((Integer)var7.get(Integer.valueOf(var11))).intValue() : 0; + var14 = ((Integer)var20.get(Integer.valueOf(var11))).intValue(); + int var10000; +- if(var13 == var14) { ++ ++ if (var13 == var14) { + ++var14; + var10000 = var14; + } else { +@@ -129,49 +152,56 @@ + var14 = var10000; + int var15 = var14 - var13; + boolean var16 = var22.canApply(var1); +- if(this.thePlayer.capabilities.isCreativeMode || var1.itemID == ItemEnchantedBook.enchantedBook.itemID) { ++ ++ if (this.thePlayer.capabilities.isCreativeMode || var1.itemID == ItemEnchantedBook.enchantedBook.itemID) { + var16 = true; + } + + Iterator var17 = var7.keySet().iterator(); + +- while(var17.hasNext()) { ++ while (var17.hasNext()) { + int var18 = ((Integer)var17.next()).intValue(); +- if(var18 != var11 && !var22.canApplyTogether(Enchantment.enchantmentsList[var18])) { ++ ++ if (var18 != var11 && !var22.canApplyTogether(Enchantment.enchantmentsList[var18])) { + var16 = false; + var2 += var15; + } + } + +- if(var16) { +- if(var14 > var22.getMaxLevel()) { ++ if (var16) { ++ if (var14 > var22.getMaxLevel()) { + var14 = var22.getMaxLevel(); + } + + var7.put(Integer.valueOf(var11), Integer.valueOf(var14)); + int var23 = 0; +- switch(var22.getWeight()) { +- case 1: +- var23 = 8; +- break; +- case 2: +- var23 = 4; +- case 3: +- case 4: +- case 6: +- case 7: +- case 8: +- case 9: +- default: +- break; +- case 5: +- var23 = 2; +- break; +- case 10: +- var23 = 1; ++ ++ switch (var22.getWeight()) { ++ case 1: ++ var23 = 8; ++ break; ++ ++ case 2: ++ var23 = 4; ++ ++ case 3: ++ case 4: ++ case 6: ++ case 7: ++ case 8: ++ case 9: ++ default: ++ break; ++ ++ case 5: ++ var23 = 2; ++ break; ++ ++ case 10: ++ var23 = 1; + } + +- if(var8) { ++ if (var8) { + var23 = Math.max(1, var23 / 2); + } + +@@ -181,84 +211,92 @@ + } + } + +- if(org.apache.commons.lang3.StringUtils.isBlank(this.m)) { +- if(var1.hasDisplayName()) { ++ if (org.apache.commons.lang3.StringUtils.isBlank(this.repairedItemName)) { ++ if (var1.hasDisplayName()) { + var4 = var1.isItemStackDamageable() ? 7 : var1.stackSize * 5; + var2 += var4; + var5.func_135074_t(); + } +- } else if(!this.m.equals(var1.getDisplayName())) { ++ } else if (!this.repairedItemName.equals(var1.getDisplayName())) { + var4 = var1.isItemStackDamageable() ? 7 : var1.stackSize * 5; + var2 += var4; +- if(var1.hasDisplayName()) { ++ ++ if (var1.hasDisplayName()) { + var19 += var4 / 2; + } + +- var5.setItemName(this.m); ++ var5.setItemName(this.repairedItemName); + } + + var9 = 0; + +- for(var21 = var7.keySet().iterator(); var21.hasNext(); var19 += var9 + var13 * var14) { ++ for (var21 = var7.keySet().iterator(); var21.hasNext(); var19 += var9 + var13 * var14) { + var11 = ((Integer)var21.next()).intValue(); + var22 = Enchantment.enchantmentsList[var11]; + var13 = ((Integer)var7.get(Integer.valueOf(var11))).intValue(); + var14 = 0; + ++var9; +- switch(var22.getWeight()) { +- case 1: +- var14 = 8; +- break; +- case 2: +- var14 = 4; +- case 3: +- case 4: +- case 6: +- case 7: +- case 8: +- case 9: +- default: +- break; +- case 5: +- var14 = 2; +- break; +- case 10: +- var14 = 1; ++ ++ switch (var22.getWeight()) { ++ case 1: ++ var14 = 8; ++ break; ++ ++ case 2: ++ var14 = 4; ++ ++ case 3: ++ case 4: ++ case 6: ++ case 7: ++ case 8: ++ case 9: ++ default: ++ break; ++ ++ case 5: ++ var14 = 2; ++ break; ++ ++ case 10: ++ var14 = 1; + } + +- if(var8) { ++ if (var8) { + var14 = Math.max(1, var14 / 2); + } + } + +- if(var8) { ++ if (var8) { + var19 = Math.max(1, var19 / 2); + } + + this.maximumCost = var19 + var2; +- if(var2 <= 0) { ++ ++ if (var2 <= 0) { + var5 = null; + } + +- if(var4 == var2 && var4 > 0 && this.maximumCost >= 40) { ++ if (var4 == var2 && var4 > 0 && this.maximumCost >= 40) { + this.maximumCost = 39; + } + +- if(this.maximumCost >= 40 && !this.thePlayer.capabilities.isCreativeMode) { ++ if (this.maximumCost >= 40 && !this.thePlayer.capabilities.isCreativeMode) { + var5 = null; + } + +- if(var5 != null) { ++ if (var5 != null) { + var10 = var5.getRepairCost(); +- if(var6 != null && var10 < var6.getRepairCost()) { ++ ++ if (var6 != null && var10 < var6.getRepairCost()) { + var10 = var6.getRepairCost(); + } + +- if(var5.hasDisplayName()) { ++ if (var5.hasDisplayName()) { + var10 -= 9; + } + +- if(var10 < 0) { ++ if (var10 < 0) { + var10 = 0; + } + +@@ -272,90 +310,103 @@ + } + } + +- public void onCraftGuiOpened(ICrafting var1) { +- super.onCraftGuiOpened(var1); +- var1.sendProgressBarUpdate(this, 0, this.maximumCost); ++ public void addCraftingToCrafters(ICrafting par1ICrafting) { ++ super.addCraftingToCrafters(par1ICrafting); ++ par1ICrafting.sendProgressBarUpdate(this, 0, this.maximumCost); + } + +- public void updateProgressBar(int var1, int var2) { +- if(var1 == 0) { +- this.maximumCost = var2; ++ public void updateProgressBar(int par1, int par2) { ++ if (par1 == 0) { ++ this.maximumCost = par2; + } +- + } + +- public void onContainerClosed(EntityPlayer var1) { +- super.onContainerClosed(var1); +- if(!this.theWorld.isRemote) { +- for(int var2 = 0; var2 < this.inputSlots.getSizeInventory(); ++var2) { ++ /** ++ * Called when the container is closed. ++ */ ++ public void onContainerClosed(EntityPlayer par1EntityPlayer) { ++ super.onContainerClosed(par1EntityPlayer); ++ ++ if (!this.theWorld.isRemote) { ++ for (int var2 = 0; var2 < this.inputSlots.getSizeInventory(); ++var2) { + ItemStack var3 = this.inputSlots.getStackInSlotOnClosing(var2); +- if(var3 != null) { +- var1.dropPlayerItem(var3); ++ ++ if (var3 != null) { ++ par1EntityPlayer.dropPlayerItem(var3); + } + } +- + } + } + +- public boolean canInteractWith(EntityPlayer var1) { +- return this.theWorld.getBlockId(this.field_82861_i, this.field_82858_j, this.field_82859_k) != Block.anvil.blockID ? false : var1.getDistanceSq((double)this.field_82861_i + 0.5D, (double)this.field_82858_j + 0.5D, (double)this.field_82859_k + 0.5D) <= 64.0D; ++ public boolean canInteractWith(EntityPlayer par1EntityPlayer) { ++ return this.theWorld.getBlockId(this.field_82861_i, this.field_82858_j, this.field_82859_k) != Block.anvil.blockID ? false : par1EntityPlayer.getDistanceSq((double)this.field_82861_i + 0.5D, (double)this.field_82858_j + 0.5D, (double)this.field_82859_k + 0.5D) <= 64.0D; + } + +- public ItemStack transferStackInSlot(EntityPlayer var1, int var2) { ++ /** ++ * Called when a player shift-clicks on a slot. You must override this or you will crash when someone does that. ++ */ ++ public ItemStack transferStackInSlot(EntityPlayer par1EntityPlayer, int par2) { + ItemStack var3 = null; +- Slot var4 = (Slot)this.c.get(var2); +- if(var4 != null && var4.getHasStack()) { ++ Slot var4 = (Slot)this.inventorySlots.get(par2); ++ ++ if (var4 != null && var4.getHasStack()) { + ItemStack var5 = var4.getStack(); + var3 = var5.copy(); +- if(var2 == 2) { +- if(!this.mergeItemStack(var5, 3, 39, true)) { ++ ++ if (par2 == 2) { ++ if (!this.mergeItemStack(var5, 3, 39, true)) { + return null; + } + + var4.onSlotChange(var5, var3); +- } else if(var2 != 0 && var2 != 1) { +- if(var2 >= 3 && var2 < 39 && !this.mergeItemStack(var5, 0, 2, false)) { ++ } else if (par2 != 0 && par2 != 1) { ++ if (par2 >= 3 && par2 < 39 && !this.mergeItemStack(var5, 0, 2, false)) { + return null; + } +- } else if(!this.mergeItemStack(var5, 3, 39, false)) { ++ } else if (!this.mergeItemStack(var5, 3, 39, false)) { + return null; + } + +- if(var5.stackSize == 0) { ++ if (var5.stackSize == 0) { + var4.putStack((ItemStack)null); + } else { + var4.onSlotChanged(); + } + +- if(var5.stackSize == var3.stackSize) { ++ if (var5.stackSize == var3.stackSize) { + return null; + } + +- var4.onPickupFromSlot(var1, var5); ++ var4.onPickupFromSlot(par1EntityPlayer, var5); + } + + return var3; + } + +- public void updateItemName(String var1) { +- this.m = var1; +- if(this.getSlot(2).getHasStack()) { ++ /** ++ * used by the Anvil GUI to update the Item Name being typed by the player ++ */ ++ public void updateItemName(String par1Str) { ++ this.repairedItemName = par1Str; ++ ++ if (this.getSlot(2).getHasStack()) { + ItemStack var2 = this.getSlot(2).getStack(); +- if(org.apache.commons.lang3.StringUtils.isBlank(var1)) { ++ ++ if (org.apache.commons.lang3.StringUtils.isBlank(par1Str)) { + var2.func_135074_t(); + } else { +- var2.setItemName(this.m); ++ var2.setItemName(this.repairedItemName); + } + } + + this.updateRepairOutput(); + } + +- static IInventory getRepairInputInventory(ContainerRepair var0) { +- return var0.inputSlots; ++ static IInventory getRepairInputInventory(ContainerRepair par0ContainerRepair) { ++ return par0ContainerRepair.inputSlots; + } + +- static int getStackSizeUsedInRepair(ContainerRepair var0) { +- return var0.stackSizeToBeUsedInRepair; ++ static int getStackSizeUsedInRepair(ContainerRepair par0ContainerRepair) { ++ return par0ContainerRepair.stackSizeToBeUsedInRepair; + } + } diff --git a/patches/net/minecraft/src/ContainerRepairINNER1.java.patch b/patches/net/minecraft/src/ContainerRepairINNER1.java.patch new file mode 100644 index 0000000..e7ee91c --- /dev/null +++ b/patches/net/minecraft/src/ContainerRepairINNER1.java.patch @@ -0,0 +1,30 @@ +--- net/minecraft/src/ContainerRepairINNER1.java ++++ net/minecraft/src/ContainerRepairINNER1.java +@@ -3,17 +3,23 @@ + class ContainerRepairINNER1 extends InventoryBasic { + final ContainerRepair repairContainer; + +- ContainerRepairINNER1(ContainerRepair var1, String var2, boolean var3, int var4) { +- super(var2, var3, var4); +- this.repairContainer = var1; ++ ContainerRepairINNER1(ContainerRepair par1ContainerRepair, String par2Str, boolean par3, int par4) { ++ super(par2Str, par3, par4); ++ this.repairContainer = par1ContainerRepair; + } + ++ /** ++ * Called when an the contents of an Inventory change, usually ++ */ + public void onInventoryChanged() { + super.onInventoryChanged(); + this.repairContainer.onCraftMatrixChanged(this); + } + +- public boolean isItemValidForSlot(int var1, ItemStack var2) { ++ /** ++ * Returns true if automation is allowed to insert the given stack (ignoring stack size) into the given slot. ++ */ ++ public boolean isItemValidForSlot(int par1, ItemStack par2ItemStack) { + return true; + } + } diff --git a/patches/net/minecraft/src/ContainerRepairINNER2.java.patch b/patches/net/minecraft/src/ContainerRepairINNER2.java.patch new file mode 100644 index 0000000..e7d2c4f --- /dev/null +++ b/patches/net/minecraft/src/ContainerRepairINNER2.java.patch @@ -0,0 +1,95 @@ +--- net/minecraft/src/ContainerRepairINNER2.java ++++ net/minecraft/src/ContainerRepairINNER2.java +@@ -2,37 +2,49 @@ + + class ContainerRepairINNER2 extends Slot { + final World field_135071_a; ++ + final int field_135069_b; ++ + final int field_135070_c; ++ + final int field_135067_d; ++ + final ContainerRepair repairContainer; + +- ContainerRepairINNER2(ContainerRepair var1, IInventory var2, int var3, int var4, int var5, World var6, int var7, int var8, int var9) { +- super(var2, var3, var4, var5); +- this.repairContainer = var1; +- this.field_135071_a = var6; +- this.field_135069_b = var7; +- this.field_135070_c = var8; +- this.field_135067_d = var9; ++ ContainerRepairINNER2(ContainerRepair par1ContainerRepair, IInventory par2IInventory, int par3, int par4, int par5, World par6World, int par7, int par8, int par9) { ++ super(par2IInventory, par3, par4, par5); ++ this.repairContainer = par1ContainerRepair; ++ this.field_135071_a = par6World; ++ this.field_135069_b = par7; ++ this.field_135070_c = par8; ++ this.field_135067_d = par9; + } + +- public boolean isItemValid(ItemStack var1) { ++ /** ++ * Check if the stack is a valid item for this slot. Always true beside for the armor slots. ++ */ ++ public boolean isItemValid(ItemStack par1ItemStack) { + return false; + } + +- public boolean canTakeStack(EntityPlayer var1) { +- return (var1.capabilities.isCreativeMode || var1.experienceLevel >= this.repairContainer.maximumCost) && this.repairContainer.maximumCost > 0 && this.getHasStack(); ++ /** ++ * Return whether this slot's stack can be taken from this slot. ++ */ ++ public boolean canTakeStack(EntityPlayer par1EntityPlayer) { ++ return (par1EntityPlayer.capabilities.isCreativeMode || par1EntityPlayer.experienceLevel >= this.repairContainer.maximumCost) && this.repairContainer.maximumCost > 0 && this.getHasStack(); + } + +- public void onPickupFromSlot(EntityPlayer var1, ItemStack var2) { +- if(!var1.capabilities.isCreativeMode) { +- var1.addExperienceLevel(-this.repairContainer.maximumCost); ++ public void onPickupFromSlot(EntityPlayer par1EntityPlayer, ItemStack par2ItemStack) { ++ if (!par1EntityPlayer.capabilities.isCreativeMode) { ++ par1EntityPlayer.addExperienceLevel(-this.repairContainer.maximumCost); + } + + ContainerRepair.getRepairInputInventory(this.repairContainer).setInventorySlotContents(0, (ItemStack)null); +- if(ContainerRepair.getStackSizeUsedInRepair(this.repairContainer) > 0) { ++ ++ if (ContainerRepair.getStackSizeUsedInRepair(this.repairContainer) > 0) { + ItemStack var3 = ContainerRepair.getRepairInputInventory(this.repairContainer).getStackInSlot(1); +- if(var3 != null && var3.stackSize > ContainerRepair.getStackSizeUsedInRepair(this.repairContainer)) { ++ ++ if (var3 != null && var3.stackSize > ContainerRepair.getStackSizeUsedInRepair(this.repairContainer)) { + var3.stackSize -= ContainerRepair.getStackSizeUsedInRepair(this.repairContainer); + ContainerRepair.getRepairInputInventory(this.repairContainer).setInventorySlotContents(1, var3); + } else { +@@ -43,21 +55,22 @@ + } + + this.repairContainer.maximumCost = 0; +- if(!var1.capabilities.isCreativeMode && !this.field_135071_a.isRemote && this.field_135071_a.getBlockId(this.field_135069_b, this.field_135070_c, this.field_135067_d) == Block.anvil.blockID && var1.getRNG().nextFloat() < 0.12F) { ++ ++ if (!par1EntityPlayer.capabilities.isCreativeMode && !this.field_135071_a.isRemote && this.field_135071_a.getBlockId(this.field_135069_b, this.field_135070_c, this.field_135067_d) == Block.anvil.blockID && par1EntityPlayer.getRNG().nextFloat() < 0.12F) { + int var6 = this.field_135071_a.getBlockMetadata(this.field_135069_b, this.field_135070_c, this.field_135067_d); + int var4 = var6 & 3; + int var5 = var6 >> 2; + ++var5; +- if(var5 > 2) { ++ ++ if (var5 > 2) { + this.field_135071_a.setBlockToAir(this.field_135069_b, this.field_135070_c, this.field_135067_d); + this.field_135071_a.playAuxSFX(1020, this.field_135069_b, this.field_135070_c, this.field_135067_d, 0); + } else { +- this.field_135071_a.setBlockMetadata(this.field_135069_b, this.field_135070_c, this.field_135067_d, var4 | var5 << 2, 2); ++ this.field_135071_a.setBlockMetadataWithNotify(this.field_135069_b, this.field_135070_c, this.field_135067_d, var4 | var5 << 2, 2); + this.field_135071_a.playAuxSFX(1021, this.field_135069_b, this.field_135070_c, this.field_135067_d, 0); + } +- } else if(!this.field_135071_a.isRemote) { ++ } else if (!this.field_135071_a.isRemote) { + this.field_135071_a.playAuxSFX(1021, this.field_135069_b, this.field_135070_c, this.field_135067_d, 0); + } +- + } + } diff --git a/patches/net/minecraft/src/ContainerSheep.java.patch b/patches/net/minecraft/src/ContainerSheep.java.patch new file mode 100644 index 0000000..45aa47f --- /dev/null +++ b/patches/net/minecraft/src/ContainerSheep.java.patch @@ -0,0 +1,17 @@ +--- net/minecraft/src/ContainerSheep.java ++++ net/minecraft/src/ContainerSheep.java +@@ -3,11 +3,11 @@ + class ContainerSheep extends Container { + final EntitySheep field_90034_a; + +- ContainerSheep(EntitySheep var1) { +- this.field_90034_a = var1; ++ ContainerSheep(EntitySheep par1EntitySheep) { ++ this.field_90034_a = par1EntitySheep; + } + +- public boolean canInteractWith(EntityPlayer var1) { ++ public boolean canInteractWith(EntityPlayer par1EntityPlayer) { + return false; + } + } diff --git a/patches/net/minecraft/src/ContainerWorkbench.java.patch b/patches/net/minecraft/src/ContainerWorkbench.java.patch new file mode 100644 index 0000000..f72bda5 --- /dev/null +++ b/patches/net/minecraft/src/ContainerWorkbench.java.patch @@ -0,0 +1,170 @@ +--- net/minecraft/src/ContainerWorkbench.java ++++ net/minecraft/src/ContainerWorkbench.java +@@ -1,6 +1,8 @@ + package net.minecraft.src; + + public class ContainerWorkbench extends Container { ++ ++ /** The crafting matrix inventory (3x3). */ + public InventoryCrafting craftMatrix = new InventoryCrafting(this, 3, 3); + public IInventory craftResult = new InventoryCraftResult(); + private World worldObj; +@@ -8,96 +10,114 @@ + private int posY; + private int posZ; + +- public ContainerWorkbench(InventoryPlayer var1, World var2, int var3, int var4, int var5) { +- this.worldObj = var2; +- this.posX = var3; +- this.posY = var4; +- this.posZ = var5; +- this.addSlotToContainer(new SlotCrafting(var1.player, this.craftMatrix, this.craftResult, 0, 124, 35)); +- +- int var6; ++ public ContainerWorkbench(InventoryPlayer par1InventoryPlayer, World par2World, int par3, int par4, int par5) { ++ this.worldObj = par2World; ++ this.posX = par3; ++ this.posY = par4; ++ this.posZ = par5; ++ this.addSlotToContainer(new SlotCrafting(par1InventoryPlayer.player, this.craftMatrix, this.craftResult, 0, 124, 35)); + int var7; +- for(var6 = 0; var6 < 3; ++var6) { +- for(var7 = 0; var7 < 3; ++var7) { ++ int var6; ++ ++ for (var6 = 0; var6 < 3; ++var6) { ++ for (var7 = 0; var7 < 3; ++var7) { + this.addSlotToContainer(new Slot(this.craftMatrix, var7 + var6 * 3, 30 + var7 * 18, 17 + var6 * 18)); + } + } + +- for(var6 = 0; var6 < 3; ++var6) { +- for(var7 = 0; var7 < 9; ++var7) { +- this.addSlotToContainer(new Slot(var1, var7 + var6 * 9 + 9, 8 + var7 * 18, 84 + var6 * 18)); ++ for (var6 = 0; var6 < 3; ++var6) { ++ for (var7 = 0; var7 < 9; ++var7) { ++ this.addSlotToContainer(new Slot(par1InventoryPlayer, var7 + var6 * 9 + 9, 8 + var7 * 18, 84 + var6 * 18)); + } + } + +- for(var6 = 0; var6 < 9; ++var6) { +- this.addSlotToContainer(new Slot(var1, var6, 8 + var6 * 18, 142)); ++ for (var6 = 0; var6 < 9; ++var6) { ++ this.addSlotToContainer(new Slot(par1InventoryPlayer, var6, 8 + var6 * 18, 142)); + } + + this.onCraftMatrixChanged(this.craftMatrix); + } + +- public void onCraftMatrixChanged(IInventory var1) { ++ // Spout Start ++ public IInventory getIInventory() { ++ return null; ++ } ++ // Spout End ++ ++ /** ++ * Callback for when the crafting matrix is changed. ++ */ ++ public void onCraftMatrixChanged(IInventory par1IInventory) { + this.craftResult.setInventorySlotContents(0, CraftingManager.getInstance().findMatchingRecipe(this.craftMatrix, this.worldObj)); + } + +- public void onContainerClosed(EntityPlayer var1) { +- super.onContainerClosed(var1); +- if(!this.worldObj.isRemote) { +- for(int var2 = 0; var2 < 9; ++var2) { ++ /** ++ * Called when the container is closed. ++ */ ++ public void onContainerClosed(EntityPlayer par1EntityPlayer) { ++ super.onContainerClosed(par1EntityPlayer); ++ ++ if (!this.worldObj.isRemote) { ++ for (int var2 = 0; var2 < 9; ++var2) { + ItemStack var3 = this.craftMatrix.getStackInSlotOnClosing(var2); +- if(var3 != null) { +- var1.dropPlayerItem(var3); ++ ++ if (var3 != null) { ++ par1EntityPlayer.dropPlayerItem(var3); + } + } +- + } + } + +- public boolean canInteractWith(EntityPlayer var1) { +- return this.worldObj.getBlockId(this.posX, this.posY, this.posZ) != Block.workbench.blockID ? false : var1.getDistanceSq((double)this.posX + 0.5D, (double)this.posY + 0.5D, (double)this.posZ + 0.5D) <= 64.0D; ++ public boolean canInteractWith(EntityPlayer par1EntityPlayer) { ++ return this.worldObj.getBlockId(this.posX, this.posY, this.posZ) != Block.workbench.blockID ? false : par1EntityPlayer.getDistanceSq((double)this.posX + 0.5D, (double)this.posY + 0.5D, (double)this.posZ + 0.5D) <= 64.0D; + } + +- public ItemStack transferStackInSlot(EntityPlayer var1, int var2) { ++ /** ++ * Called when a player shift-clicks on a slot. You must override this or you will crash when someone does that. ++ */ ++ public ItemStack transferStackInSlot(EntityPlayer par1EntityPlayer, int par2) { + ItemStack var3 = null; +- Slot var4 = (Slot)this.c.get(var2); +- if(var4 != null && var4.getHasStack()) { ++ Slot var4 = (Slot)this.inventorySlots.get(par2); ++ ++ if (var4 != null && var4.getHasStack()) { + ItemStack var5 = var4.getStack(); + var3 = var5.copy(); +- if(var2 == 0) { +- if(!this.mergeItemStack(var5, 10, 46, true)) { ++ ++ if (par2 == 0) { ++ if (!this.mergeItemStack(var5, 10, 46, true)) { + return null; + } + + var4.onSlotChange(var5, var3); +- } else if(var2 >= 10 && var2 < 37) { +- if(!this.mergeItemStack(var5, 37, 46, false)) { +- return null; +- } +- } else if(var2 >= 37 && var2 < 46) { +- if(!this.mergeItemStack(var5, 10, 37, false)) { +- return null; +- } +- } else if(!this.mergeItemStack(var5, 10, 46, false)) { ++ } else if (par2 >= 10 && par2 < 37) { ++ if (!this.mergeItemStack(var5, 37, 46, false)) { ++ return null; ++ } ++ } else if (par2 >= 37 && par2 < 46) { ++ if (!this.mergeItemStack(var5, 10, 37, false)) { ++ return null; ++ } ++ } else if (!this.mergeItemStack(var5, 10, 46, false)) { + return null; + } + +- if(var5.stackSize == 0) { ++ if (var5.stackSize == 0) { + var4.putStack((ItemStack)null); + } else { + var4.onSlotChanged(); + } + +- if(var5.stackSize == var3.stackSize) { ++ if (var5.stackSize == var3.stackSize) { + return null; + } + +- var4.onPickupFromSlot(var1, var5); ++ var4.onPickupFromSlot(par1EntityPlayer, var5); + } + + return var3; + } + +- public boolean func_94530_a(ItemStack var1, Slot var2) { +- return var2.inventory != this.craftResult && super.func_94530_a(var1, var2); ++ public boolean func_94530_a(ItemStack par1ItemStack, Slot par2Slot) { ++ return par2Slot.inventory != this.craftResult && super.func_94530_a(par1ItemStack, par2Slot); + } + } diff --git a/patches/net/minecraft/src/ConvertingProgressUpdate.java.patch b/patches/net/minecraft/src/ConvertingProgressUpdate.java.patch new file mode 100644 index 0000000..bc0b42a --- /dev/null +++ b/patches/net/minecraft/src/ConvertingProgressUpdate.java.patch @@ -0,0 +1,54 @@ +--- net/minecraft/src/ConvertingProgressUpdate.java ++++ net/minecraft/src/ConvertingProgressUpdate.java +@@ -4,24 +4,32 @@ + + public class ConvertingProgressUpdate implements IProgressUpdate { + private long field_96245_b; +- final MinecraftServer a; +- +- public ConvertingProgressUpdate(MinecraftServer var1) { +- this.a = var1; +- this.field_96245_b = MinecraftServer.getCurrentTimeMillis(); +- } +- +- public void displaySavingString(String var1) { +- } +- +- public void setLoadingProgress(int var1) { +- if(MinecraftServer.getCurrentTimeMillis() - this.field_96245_b >= 1000L) { +- this.field_96245_b = MinecraftServer.getCurrentTimeMillis(); +- this.a.getLogAgent().logInfo("Converting... " + var1 + "%"); ++ ++ /** Reference to the MinecraftServer object. */ ++ final MinecraftServer mcServer; ++ ++ public ConvertingProgressUpdate(MinecraftServer par1MinecraftServer) { ++ this.mcServer = par1MinecraftServer; ++ this.field_96245_b = MinecraftServer.getSystemTimeMillis(); ++ } ++ ++ /** ++ * "Saving level", or the loading,or downloading equivelent ++ */ ++ public void displayProgressMessage(String par1Str) {} ++ ++ /** ++ * Updates the progress bar on the loading screen to the specified amount. Args: loadProgress ++ */ ++ public void setLoadingProgress(int par1) { ++ if (MinecraftServer.getSystemTimeMillis() - this.field_96245_b >= 1000L) { ++ this.field_96245_b = MinecraftServer.getSystemTimeMillis(); ++ this.mcServer.getLogAgent().logInfo("Converting... " + par1 + "%"); + } +- +- } +- +- public void displayLoadingString(String var1) { +- } ++ } ++ ++ /** ++ * This is called with "Working..." by resetProgressAndMessage ++ */ ++ public void resetProgresAndWorkingMessage(String par1Str) {} + } diff --git a/patches/net/minecraft/src/CraftingManager.java.patch b/patches/net/minecraft/src/CraftingManager.java.patch new file mode 100644 index 0000000..d782752 --- /dev/null +++ b/patches/net/minecraft/src/CraftingManager.java.patch @@ -0,0 +1,439 @@ +--- net/minecraft/src/CraftingManager.java ++++ net/minecraft/src/CraftingManager.java +@@ -6,9 +6,16 @@ + import java.util.List; + + public class CraftingManager { ++ ++ /** The static instance of this class */ + private static final CraftingManager instance = new CraftingManager(); +- private List b = new ArrayList(); +- ++ ++ /** A list of all the recipes added */ ++ private List recipes = new ArrayList(); ++ ++ /** ++ * Returns the static instance of this class ++ */ + public static final CraftingManager getInstance() { + return instance; + } +@@ -21,188 +28,194 @@ + (new RecipesCrafting()).addRecipes(this); + (new RecipesArmor()).addRecipes(this); + (new RecipesDyes()).addRecipes(this); +- this.b.add(new RecipesArmorDyes()); +- this.b.add(new RecipesMapCloning()); +- this.b.add(new RecipesMapExtending()); +- this.b.add(new RecipeFireworks()); +- this.addRecipe(new ItemStack(Item.paper, 3), new Object[]{"###", Character.valueOf('#'), Item.reed}); +- this.addShapelessRecipe(new ItemStack(Item.book, 1), new Object[]{Item.paper, Item.paper, Item.paper, Item.leather}); +- this.addShapelessRecipe(new ItemStack(Item.writableBook, 1), new Object[]{Item.book, new ItemStack(Item.dyePowder, 1, 0), Item.feather}); +- this.addRecipe(new ItemStack(Block.fence, 2), new Object[]{"###", "###", Character.valueOf('#'), Item.stick}); +- this.addRecipe(new ItemStack(Block.cobblestoneWall, 6, 0), new Object[]{"###", "###", Character.valueOf('#'), Block.cobblestone}); +- this.addRecipe(new ItemStack(Block.cobblestoneWall, 6, 1), new Object[]{"###", "###", Character.valueOf('#'), Block.cobblestoneMossy}); +- this.addRecipe(new ItemStack(Block.netherFence, 6), new Object[]{"###", "###", Character.valueOf('#'), Block.netherBrick}); +- this.addRecipe(new ItemStack(Block.fenceGate, 1), new Object[]{"#W#", "#W#", Character.valueOf('#'), Item.stick, Character.valueOf('W'), Block.planks}); +- this.addRecipe(new ItemStack(Block.jukebox, 1), new Object[]{"###", "#X#", "###", Character.valueOf('#'), Block.planks, Character.valueOf('X'), Item.diamond}); +- this.addRecipe(new ItemStack(Item.leash, 2), new Object[]{"~~ ", "~O ", " ~", Character.valueOf('~'), Item.silk, Character.valueOf('O'), Item.slimeBall}); +- this.addRecipe(new ItemStack(Block.music, 1), new Object[]{"###", "#X#", "###", Character.valueOf('#'), Block.planks, Character.valueOf('X'), Item.redstone}); +- this.addRecipe(new ItemStack(Block.bookShelf, 1), new Object[]{"###", "XXX", "###", Character.valueOf('#'), Block.planks, Character.valueOf('X'), Item.book}); +- this.addRecipe(new ItemStack(Block.blockSnow, 1), new Object[]{"##", "##", Character.valueOf('#'), Item.snowball}); +- this.addRecipe(new ItemStack(Block.snow, 6), new Object[]{"###", Character.valueOf('#'), Block.blockSnow}); +- this.addRecipe(new ItemStack(Block.blockClay, 1), new Object[]{"##", "##", Character.valueOf('#'), Item.clay}); +- this.addRecipe(new ItemStack(Block.brick, 1), new Object[]{"##", "##", Character.valueOf('#'), Item.brick}); +- this.addRecipe(new ItemStack(Block.glowStone, 1), new Object[]{"##", "##", Character.valueOf('#'), Item.glowstone}); +- this.addRecipe(new ItemStack(Block.blockNetherQuartz, 1), new Object[]{"##", "##", Character.valueOf('#'), Item.netherQuartz}); +- this.addRecipe(new ItemStack(Block.cloth, 1), new Object[]{"##", "##", Character.valueOf('#'), Item.silk}); +- this.addRecipe(new ItemStack(Block.tnt, 1), new Object[]{"X#X", "#X#", "X#X", Character.valueOf('X'), Item.gunpowder, Character.valueOf('#'), Block.sand}); +- this.addRecipe(new ItemStack(Block.stoneSingleSlab, 6, 3), new Object[]{"###", Character.valueOf('#'), Block.cobblestone}); +- this.addRecipe(new ItemStack(Block.stoneSingleSlab, 6, 0), new Object[]{"###", Character.valueOf('#'), Block.stone}); +- this.addRecipe(new ItemStack(Block.stoneSingleSlab, 6, 1), new Object[]{"###", Character.valueOf('#'), Block.sandStone}); +- this.addRecipe(new ItemStack(Block.stoneSingleSlab, 6, 4), new Object[]{"###", Character.valueOf('#'), Block.brick}); +- this.addRecipe(new ItemStack(Block.stoneSingleSlab, 6, 5), new Object[]{"###", Character.valueOf('#'), Block.stoneBrick}); +- this.addRecipe(new ItemStack(Block.stoneSingleSlab, 6, 6), new Object[]{"###", Character.valueOf('#'), Block.netherBrick}); +- this.addRecipe(new ItemStack(Block.stoneSingleSlab, 6, 7), new Object[]{"###", Character.valueOf('#'), Block.blockNetherQuartz}); +- this.addRecipe(new ItemStack(Block.woodSingleSlab, 6, 0), new Object[]{"###", Character.valueOf('#'), new ItemStack(Block.planks, 1, 0)}); +- this.addRecipe(new ItemStack(Block.woodSingleSlab, 6, 2), new Object[]{"###", Character.valueOf('#'), new ItemStack(Block.planks, 1, 2)}); +- this.addRecipe(new ItemStack(Block.woodSingleSlab, 6, 1), new Object[]{"###", Character.valueOf('#'), new ItemStack(Block.planks, 1, 1)}); +- this.addRecipe(new ItemStack(Block.woodSingleSlab, 6, 3), new Object[]{"###", Character.valueOf('#'), new ItemStack(Block.planks, 1, 3)}); +- this.addRecipe(new ItemStack(Block.ladder, 3), new Object[]{"# #", "###", "# #", Character.valueOf('#'), Item.stick}); +- this.addRecipe(new ItemStack(Item.doorWood, 1), new Object[]{"##", "##", "##", Character.valueOf('#'), Block.planks}); +- this.addRecipe(new ItemStack(Block.trapdoor, 2), new Object[]{"###", "###", Character.valueOf('#'), Block.planks}); +- this.addRecipe(new ItemStack(Item.doorIron, 1), new Object[]{"##", "##", "##", Character.valueOf('#'), Item.ingotIron}); +- this.addRecipe(new ItemStack(Item.sign, 3), new Object[]{"###", "###", " X ", Character.valueOf('#'), Block.planks, Character.valueOf('X'), Item.stick}); +- this.addRecipe(new ItemStack(Item.cake, 1), new Object[]{"AAA", "BEB", "CCC", Character.valueOf('A'), Item.bucketMilk, Character.valueOf('B'), Item.sugar, Character.valueOf('C'), Item.wheat, Character.valueOf('E'), Item.egg}); +- this.addRecipe(new ItemStack(Item.sugar, 1), new Object[]{"#", Character.valueOf('#'), Item.reed}); +- this.addRecipe(new ItemStack(Block.planks, 4, 0), new Object[]{"#", Character.valueOf('#'), new ItemStack(Block.wood, 1, 0)}); +- this.addRecipe(new ItemStack(Block.planks, 4, 1), new Object[]{"#", Character.valueOf('#'), new ItemStack(Block.wood, 1, 1)}); +- this.addRecipe(new ItemStack(Block.planks, 4, 2), new Object[]{"#", Character.valueOf('#'), new ItemStack(Block.wood, 1, 2)}); +- this.addRecipe(new ItemStack(Block.planks, 4, 3), new Object[]{"#", Character.valueOf('#'), new ItemStack(Block.wood, 1, 3)}); +- this.addRecipe(new ItemStack(Item.stick, 4), new Object[]{"#", "#", Character.valueOf('#'), Block.planks}); +- this.addRecipe(new ItemStack(Block.torchWood, 4), new Object[]{"X", "#", Character.valueOf('X'), Item.coal, Character.valueOf('#'), Item.stick}); +- this.addRecipe(new ItemStack(Block.torchWood, 4), new Object[]{"X", "#", Character.valueOf('X'), new ItemStack(Item.coal, 1, 1), Character.valueOf('#'), Item.stick}); +- this.addRecipe(new ItemStack(Item.bowlEmpty, 4), new Object[]{"# #", " # ", Character.valueOf('#'), Block.planks}); +- this.addRecipe(new ItemStack(Item.glassBottle, 3), new Object[]{"# #", " # ", Character.valueOf('#'), Block.glass}); +- this.addRecipe(new ItemStack(Block.rail, 16), new Object[]{"X X", "X#X", "X X", Character.valueOf('X'), Item.ingotIron, Character.valueOf('#'), Item.stick}); +- this.addRecipe(new ItemStack(Block.railPowered, 6), new Object[]{"X X", "X#X", "XRX", Character.valueOf('X'), Item.ingotGold, Character.valueOf('R'), Item.redstone, Character.valueOf('#'), Item.stick}); +- this.addRecipe(new ItemStack(Block.railActivator, 6), new Object[]{"XSX", "X#X", "XSX", Character.valueOf('X'), Item.ingotIron, Character.valueOf('#'), Block.torchRedstoneActive, Character.valueOf('S'), Item.stick}); +- this.addRecipe(new ItemStack(Block.railDetector, 6), new Object[]{"X X", "X#X", "XRX", Character.valueOf('X'), Item.ingotIron, Character.valueOf('R'), Item.redstone, Character.valueOf('#'), Block.pressurePlateStone}); +- this.addRecipe(new ItemStack(Item.minecartEmpty, 1), new Object[]{"# #", "###", Character.valueOf('#'), Item.ingotIron}); +- this.addRecipe(new ItemStack(Item.cauldron, 1), new Object[]{"# #", "# #", "###", Character.valueOf('#'), Item.ingotIron}); +- this.addRecipe(new ItemStack(Item.brewingStand, 1), new Object[]{" B ", "###", Character.valueOf('#'), Block.cobblestone, Character.valueOf('B'), Item.blazeRod}); +- this.addRecipe(new ItemStack(Block.pumpkinLantern, 1), new Object[]{"A", "B", Character.valueOf('A'), Block.pumpkin, Character.valueOf('B'), Block.torchWood}); +- this.addRecipe(new ItemStack(Item.minecartCrate, 1), new Object[]{"A", "B", Character.valueOf('A'), Block.chest, Character.valueOf('B'), Item.minecartEmpty}); +- this.addRecipe(new ItemStack(Item.minecartPowered, 1), new Object[]{"A", "B", Character.valueOf('A'), Block.furnaceIdle, Character.valueOf('B'), Item.minecartEmpty}); +- this.addRecipe(new ItemStack(Item.tntMinecart, 1), new Object[]{"A", "B", Character.valueOf('A'), Block.tnt, Character.valueOf('B'), Item.minecartEmpty}); +- this.addRecipe(new ItemStack(Item.minecartHopper, 1), new Object[]{"A", "B", Character.valueOf('A'), Block.hopperBlock, Character.valueOf('B'), Item.minecartEmpty}); +- this.addRecipe(new ItemStack(Item.boat, 1), new Object[]{"# #", "###", Character.valueOf('#'), Block.planks}); +- this.addRecipe(new ItemStack(Item.bucketEmpty, 1), new Object[]{"# #", " # ", Character.valueOf('#'), Item.ingotIron}); +- this.addRecipe(new ItemStack(Item.flowerPot, 1), new Object[]{"# #", " # ", Character.valueOf('#'), Item.brick}); +- this.addRecipe(new ItemStack(Item.flintAndSteel, 1), new Object[]{"A ", " B", Character.valueOf('A'), Item.ingotIron, Character.valueOf('B'), Item.flint}); +- this.addRecipe(new ItemStack(Item.bread, 1), new Object[]{"###", Character.valueOf('#'), Item.wheat}); +- this.addRecipe(new ItemStack(Block.stairsWoodOak, 4), new Object[]{"# ", "## ", "###", Character.valueOf('#'), new ItemStack(Block.planks, 1, 0)}); +- this.addRecipe(new ItemStack(Block.stairsWoodBirch, 4), new Object[]{"# ", "## ", "###", Character.valueOf('#'), new ItemStack(Block.planks, 1, 2)}); +- this.addRecipe(new ItemStack(Block.stairsWoodSpruce, 4), new Object[]{"# ", "## ", "###", Character.valueOf('#'), new ItemStack(Block.planks, 1, 1)}); +- this.addRecipe(new ItemStack(Block.stairsWoodJungle, 4), new Object[]{"# ", "## ", "###", Character.valueOf('#'), new ItemStack(Block.planks, 1, 3)}); +- this.addRecipe(new ItemStack(Item.fishingRod, 1), new Object[]{" #", " #X", "# X", Character.valueOf('#'), Item.stick, Character.valueOf('X'), Item.silk}); +- this.addRecipe(new ItemStack(Item.carrotOnAStick, 1), new Object[]{"# ", " X", Character.valueOf('#'), Item.fishingRod, Character.valueOf('X'), Item.carrot}).func_92100_c(); +- this.addRecipe(new ItemStack(Block.stairsCobblestone, 4), new Object[]{"# ", "## ", "###", Character.valueOf('#'), Block.cobblestone}); +- this.addRecipe(new ItemStack(Block.stairsBrick, 4), new Object[]{"# ", "## ", "###", Character.valueOf('#'), Block.brick}); +- this.addRecipe(new ItemStack(Block.stairsStoneBrick, 4), new Object[]{"# ", "## ", "###", Character.valueOf('#'), Block.stoneBrick}); +- this.addRecipe(new ItemStack(Block.stairsNetherBrick, 4), new Object[]{"# ", "## ", "###", Character.valueOf('#'), Block.netherBrick}); +- this.addRecipe(new ItemStack(Block.stairsSandStone, 4), new Object[]{"# ", "## ", "###", Character.valueOf('#'), Block.sandStone}); +- this.addRecipe(new ItemStack(Block.stairsNetherQuartz, 4), new Object[]{"# ", "## ", "###", Character.valueOf('#'), Block.blockNetherQuartz}); +- this.addRecipe(new ItemStack(Item.painting, 1), new Object[]{"###", "#X#", "###", Character.valueOf('#'), Item.stick, Character.valueOf('X'), Block.cloth}); +- this.addRecipe(new ItemStack(Item.itemFrame, 1), new Object[]{"###", "#X#", "###", Character.valueOf('#'), Item.stick, Character.valueOf('X'), Item.leather}); +- this.addRecipe(new ItemStack(Item.appleGold, 1, 0), new Object[]{"###", "#X#", "###", Character.valueOf('#'), Item.ingotGold, Character.valueOf('X'), Item.appleRed}); +- this.addRecipe(new ItemStack(Item.appleGold, 1, 1), new Object[]{"###", "#X#", "###", Character.valueOf('#'), Block.blockGold, Character.valueOf('X'), Item.appleRed}); +- this.addRecipe(new ItemStack(Item.goldenCarrot, 1, 0), new Object[]{"###", "#X#", "###", Character.valueOf('#'), Item.goldNugget, Character.valueOf('X'), Item.carrot}); +- this.addRecipe(new ItemStack(Item.speckledMelon, 1), new Object[]{"###", "#X#", "###", Character.valueOf('#'), Item.goldNugget, Character.valueOf('X'), Item.melon}); +- this.addRecipe(new ItemStack(Block.lever, 1), new Object[]{"X", "#", Character.valueOf('#'), Block.cobblestone, Character.valueOf('X'), Item.stick}); +- this.addRecipe(new ItemStack(Block.tripWireSource, 2), new Object[]{"I", "S", "#", Character.valueOf('#'), Block.planks, Character.valueOf('S'), Item.stick, Character.valueOf('I'), Item.ingotIron}); +- this.addRecipe(new ItemStack(Block.torchRedstoneActive, 1), new Object[]{"X", "#", Character.valueOf('#'), Item.stick, Character.valueOf('X'), Item.redstone}); +- this.addRecipe(new ItemStack(Item.redstoneRepeater, 1), new Object[]{"#X#", "III", Character.valueOf('#'), Block.torchRedstoneActive, Character.valueOf('X'), Item.redstone, Character.valueOf('I'), Block.stone}); +- this.addRecipe(new ItemStack(Item.comparator, 1), new Object[]{" # ", "#X#", "III", Character.valueOf('#'), Block.torchRedstoneActive, Character.valueOf('X'), Item.netherQuartz, Character.valueOf('I'), Block.stone}); +- this.addRecipe(new ItemStack(Item.pocketSundial, 1), new Object[]{" # ", "#X#", " # ", Character.valueOf('#'), Item.ingotGold, Character.valueOf('X'), Item.redstone}); +- this.addRecipe(new ItemStack(Item.compass, 1), new Object[]{" # ", "#X#", " # ", Character.valueOf('#'), Item.ingotIron, Character.valueOf('X'), Item.redstone}); +- this.addRecipe(new ItemStack(Item.emptyMap, 1), new Object[]{"###", "#X#", "###", Character.valueOf('#'), Item.paper, Character.valueOf('X'), Item.compass}); +- this.addRecipe(new ItemStack(Block.stoneButton, 1), new Object[]{"#", Character.valueOf('#'), Block.stone}); +- this.addRecipe(new ItemStack(Block.woodenButton, 1), new Object[]{"#", Character.valueOf('#'), Block.planks}); +- this.addRecipe(new ItemStack(Block.pressurePlateStone, 1), new Object[]{"##", Character.valueOf('#'), Block.stone}); +- this.addRecipe(new ItemStack(Block.pressurePlatePlanks, 1), new Object[]{"##", Character.valueOf('#'), Block.planks}); +- this.addRecipe(new ItemStack(Block.pressurePlateIron, 1), new Object[]{"##", Character.valueOf('#'), Item.ingotIron}); +- this.addRecipe(new ItemStack(Block.pressurePlateGold, 1), new Object[]{"##", Character.valueOf('#'), Item.ingotGold}); +- this.addRecipe(new ItemStack(Block.dispenser, 1), new Object[]{"###", "#X#", "#R#", Character.valueOf('#'), Block.cobblestone, Character.valueOf('X'), Item.bow, Character.valueOf('R'), Item.redstone}); +- this.addRecipe(new ItemStack(Block.dropper, 1), new Object[]{"###", "# #", "#R#", Character.valueOf('#'), Block.cobblestone, Character.valueOf('R'), Item.redstone}); +- this.addRecipe(new ItemStack(Block.pistonBase, 1), new Object[]{"TTT", "#X#", "#R#", Character.valueOf('#'), Block.cobblestone, Character.valueOf('X'), Item.ingotIron, Character.valueOf('R'), Item.redstone, Character.valueOf('T'), Block.planks}); +- this.addRecipe(new ItemStack(Block.pistonStickyBase, 1), new Object[]{"S", "P", Character.valueOf('S'), Item.slimeBall, Character.valueOf('P'), Block.pistonBase}); +- this.addRecipe(new ItemStack(Item.bed, 1), new Object[]{"###", "XXX", Character.valueOf('#'), Block.cloth, Character.valueOf('X'), Block.planks}); +- this.addRecipe(new ItemStack(Block.enchantmentTable, 1), new Object[]{" B ", "D#D", "###", Character.valueOf('#'), Block.obsidian, Character.valueOf('B'), Item.book, Character.valueOf('D'), Item.diamond}); +- this.addRecipe(new ItemStack(Block.anvil, 1), new Object[]{"III", " i ", "iii", Character.valueOf('I'), Block.blockIron, Character.valueOf('i'), Item.ingotIron}); +- this.addShapelessRecipe(new ItemStack(Item.eyeOfEnder, 1), new Object[]{Item.enderPearl, Item.blazePowder}); +- this.addShapelessRecipe(new ItemStack(Item.fireballCharge, 3), new Object[]{Item.gunpowder, Item.blazePowder, Item.coal}); +- this.addShapelessRecipe(new ItemStack(Item.fireballCharge, 3), new Object[]{Item.gunpowder, Item.blazePowder, new ItemStack(Item.coal, 1, 1)}); +- this.addRecipe(new ItemStack(Block.daylightSensor), new Object[]{"GGG", "QQQ", "WWW", Character.valueOf('G'), Block.glass, Character.valueOf('Q'), Item.netherQuartz, Character.valueOf('W'), Block.woodSingleSlab}); +- this.addRecipe(new ItemStack(Block.hopperBlock), new Object[]{"I I", "ICI", " I ", Character.valueOf('I'), Item.ingotIron, Character.valueOf('C'), Block.chest}); +- Collections.sort(this.b, new RecipeSorter(this)); ++ this.recipes.add(new RecipesArmorDyes()); ++ this.recipes.add(new RecipesMapCloning()); ++ this.recipes.add(new RecipesMapExtending()); ++ this.recipes.add(new RecipeFireworks()); ++ this.addRecipe(new ItemStack(Item.paper, 3), new Object[] {"###", '#', Item.reed}); ++ this.addShapelessRecipe(new ItemStack(Item.book, 1), new Object[] {Item.paper, Item.paper, Item.paper, Item.leather}); ++ this.addShapelessRecipe(new ItemStack(Item.writableBook, 1), new Object[] {Item.book, new ItemStack(Item.dyePowder, 1, 0), Item.feather}); ++ this.addRecipe(new ItemStack(Block.fence, 2), new Object[] {"###", "###", '#', Item.stick}); ++ this.addRecipe(new ItemStack(Block.cobblestoneWall, 6, 0), new Object[] {"###", "###", '#', Block.cobblestone}); ++ this.addRecipe(new ItemStack(Block.cobblestoneWall, 6, 1), new Object[] {"###", "###", '#', Block.cobblestoneMossy}); ++ this.addRecipe(new ItemStack(Block.netherFence, 6), new Object[] {"###", "###", '#', Block.netherBrick}); ++ this.addRecipe(new ItemStack(Block.fenceGate, 1), new Object[] {"#W#", "#W#", '#', Item.stick, 'W', Block.planks}); ++ this.addRecipe(new ItemStack(Block.jukebox, 1), new Object[] {"###", "#X#", "###", '#', Block.planks, 'X', Item.diamond}); ++ this.addRecipe(new ItemStack(Item.leash, 2), new Object[] {"~~ ", "~O ", " ~", '~', Item.silk, 'O', Item.slimeBall}); ++ this.addRecipe(new ItemStack(Block.music, 1), new Object[] {"###", "#X#", "###", '#', Block.planks, 'X', Item.redstone}); ++ this.addRecipe(new ItemStack(Block.bookShelf, 1), new Object[] {"###", "XXX", "###", '#', Block.planks, 'X', Item.book}); ++ this.addRecipe(new ItemStack(Block.blockSnow, 1), new Object[] {"##", "##", '#', Item.snowball}); ++ this.addRecipe(new ItemStack(Block.snow, 6), new Object[] {"###", '#', Block.blockSnow}); ++ this.addRecipe(new ItemStack(Block.blockClay, 1), new Object[] {"##", "##", '#', Item.clay}); ++ this.addRecipe(new ItemStack(Block.brick, 1), new Object[] {"##", "##", '#', Item.brick}); ++ this.addRecipe(new ItemStack(Block.glowStone, 1), new Object[] {"##", "##", '#', Item.glowstone}); ++ this.addRecipe(new ItemStack(Block.blockNetherQuartz, 1), new Object[] {"##", "##", '#', Item.netherQuartz}); ++ this.addRecipe(new ItemStack(Block.cloth, 1), new Object[] {"##", "##", '#', Item.silk}); ++ this.addRecipe(new ItemStack(Block.tnt, 1), new Object[] {"X#X", "#X#", "X#X", 'X', Item.gunpowder, '#', Block.sand}); ++ this.addRecipe(new ItemStack(Block.stoneSingleSlab, 6, 3), new Object[] {"###", '#', Block.cobblestone}); ++ this.addRecipe(new ItemStack(Block.stoneSingleSlab, 6, 0), new Object[] {"###", '#', Block.stone}); ++ this.addRecipe(new ItemStack(Block.stoneSingleSlab, 6, 1), new Object[] {"###", '#', Block.sandStone}); ++ this.addRecipe(new ItemStack(Block.stoneSingleSlab, 6, 4), new Object[] {"###", '#', Block.brick}); ++ this.addRecipe(new ItemStack(Block.stoneSingleSlab, 6, 5), new Object[] {"###", '#', Block.stoneBrick}); ++ this.addRecipe(new ItemStack(Block.stoneSingleSlab, 6, 6), new Object[] {"###", '#', Block.netherBrick}); ++ this.addRecipe(new ItemStack(Block.stoneSingleSlab, 6, 7), new Object[] {"###", '#', Block.blockNetherQuartz}); ++ this.addRecipe(new ItemStack(Block.woodSingleSlab, 6, 0), new Object[] {"###", '#', new ItemStack(Block.planks, 1, 0)}); ++ this.addRecipe(new ItemStack(Block.woodSingleSlab, 6, 2), new Object[] {"###", '#', new ItemStack(Block.planks, 1, 2)}); ++ this.addRecipe(new ItemStack(Block.woodSingleSlab, 6, 1), new Object[] {"###", '#', new ItemStack(Block.planks, 1, 1)}); ++ this.addRecipe(new ItemStack(Block.woodSingleSlab, 6, 3), new Object[] {"###", '#', new ItemStack(Block.planks, 1, 3)}); ++ this.addRecipe(new ItemStack(Block.ladder, 3), new Object[] {"# #", "###", "# #", '#', Item.stick}); ++ this.addRecipe(new ItemStack(Item.doorWood, 1), new Object[] {"##", "##", "##", '#', Block.planks}); ++ this.addRecipe(new ItemStack(Block.trapdoor, 2), new Object[] {"###", "###", '#', Block.planks}); ++ this.addRecipe(new ItemStack(Item.doorIron, 1), new Object[] {"##", "##", "##", '#', Item.ingotIron}); ++ this.addRecipe(new ItemStack(Item.sign, 3), new Object[] {"###", "###", " X ", '#', Block.planks, 'X', Item.stick}); ++ this.addRecipe(new ItemStack(Item.cake, 1), new Object[] {"AAA", "BEB", "CCC", 'A', Item.bucketMilk, 'B', Item.sugar, 'C', Item.wheat, 'E', Item.egg}); ++ this.addRecipe(new ItemStack(Item.sugar, 1), new Object[] {"#", '#', Item.reed}); ++ this.addRecipe(new ItemStack(Block.planks, 4, 0), new Object[] {"#", '#', new ItemStack(Block.wood, 1, 0)}); ++ this.addRecipe(new ItemStack(Block.planks, 4, 1), new Object[] {"#", '#', new ItemStack(Block.wood, 1, 1)}); ++ this.addRecipe(new ItemStack(Block.planks, 4, 2), new Object[] {"#", '#', new ItemStack(Block.wood, 1, 2)}); ++ this.addRecipe(new ItemStack(Block.planks, 4, 3), new Object[] {"#", '#', new ItemStack(Block.wood, 1, 3)}); ++ this.addRecipe(new ItemStack(Item.stick, 4), new Object[] {"#", "#", '#', Block.planks}); ++ this.addRecipe(new ItemStack(Block.torchWood, 4), new Object[] {"X", "#", 'X', Item.coal, '#', Item.stick}); ++ this.addRecipe(new ItemStack(Block.torchWood, 4), new Object[] {"X", "#", 'X', new ItemStack(Item.coal, 1, 1), '#', Item.stick}); ++ this.addRecipe(new ItemStack(Item.bowlEmpty, 4), new Object[] {"# #", " # ", '#', Block.planks}); ++ this.addRecipe(new ItemStack(Item.glassBottle, 3), new Object[] {"# #", " # ", '#', Block.glass}); ++ this.addRecipe(new ItemStack(Block.rail, 16), new Object[] {"X X", "X#X", "X X", 'X', Item.ingotIron, '#', Item.stick}); ++ this.addRecipe(new ItemStack(Block.railPowered, 6), new Object[] {"X X", "X#X", "XRX", 'X', Item.ingotGold, 'R', Item.redstone, '#', Item.stick}); ++ this.addRecipe(new ItemStack(Block.railActivator, 6), new Object[] {"XSX", "X#X", "XSX", 'X', Item.ingotIron, '#', Block.torchRedstoneActive, 'S', Item.stick}); ++ this.addRecipe(new ItemStack(Block.railDetector, 6), new Object[] {"X X", "X#X", "XRX", 'X', Item.ingotIron, 'R', Item.redstone, '#', Block.pressurePlateStone}); ++ this.addRecipe(new ItemStack(Item.minecartEmpty, 1), new Object[] {"# #", "###", '#', Item.ingotIron}); ++ this.addRecipe(new ItemStack(Item.cauldron, 1), new Object[] {"# #", "# #", "###", '#', Item.ingotIron}); ++ this.addRecipe(new ItemStack(Item.brewingStand, 1), new Object[] {" B ", "###", '#', Block.cobblestone, 'B', Item.blazeRod}); ++ this.addRecipe(new ItemStack(Block.pumpkinLantern, 1), new Object[] {"A", "B", 'A', Block.pumpkin, 'B', Block.torchWood}); ++ this.addRecipe(new ItemStack(Item.minecartCrate, 1), new Object[] {"A", "B", 'A', Block.chest, 'B', Item.minecartEmpty}); ++ this.addRecipe(new ItemStack(Item.minecartPowered, 1), new Object[] {"A", "B", 'A', Block.furnaceIdle, 'B', Item.minecartEmpty}); ++ this.addRecipe(new ItemStack(Item.minecartTnt, 1), new Object[] {"A", "B", 'A', Block.tnt, 'B', Item.minecartEmpty}); ++ this.addRecipe(new ItemStack(Item.minecartHopper, 1), new Object[] {"A", "B", 'A', Block.hopperBlock, 'B', Item.minecartEmpty}); ++ this.addRecipe(new ItemStack(Item.boat, 1), new Object[] {"# #", "###", '#', Block.planks}); ++ this.addRecipe(new ItemStack(Item.bucketEmpty, 1), new Object[] {"# #", " # ", '#', Item.ingotIron}); ++ this.addRecipe(new ItemStack(Item.flowerPot, 1), new Object[] {"# #", " # ", '#', Item.brick}); ++ this.addRecipe(new ItemStack(Item.flintAndSteel, 1), new Object[] {"A ", " B", 'A', Item.ingotIron, 'B', Item.flint}); ++ this.addRecipe(new ItemStack(Item.bread, 1), new Object[] {"###", '#', Item.wheat}); ++ this.addRecipe(new ItemStack(Block.stairsWoodOak, 4), new Object[] {"# ", "## ", "###", '#', new ItemStack(Block.planks, 1, 0)}); ++ this.addRecipe(new ItemStack(Block.stairsWoodBirch, 4), new Object[] {"# ", "## ", "###", '#', new ItemStack(Block.planks, 1, 2)}); ++ this.addRecipe(new ItemStack(Block.stairsWoodSpruce, 4), new Object[] {"# ", "## ", "###", '#', new ItemStack(Block.planks, 1, 1)}); ++ this.addRecipe(new ItemStack(Block.stairsWoodJungle, 4), new Object[] {"# ", "## ", "###", '#', new ItemStack(Block.planks, 1, 3)}); ++ this.addRecipe(new ItemStack(Item.fishingRod, 1), new Object[] {" #", " #X", "# X", '#', Item.stick, 'X', Item.silk}); ++ this.addRecipe(new ItemStack(Item.carrotOnAStick, 1), new Object[] {"# ", " X", '#', Item.fishingRod, 'X', Item.carrot}).func_92100_c(); ++ this.addRecipe(new ItemStack(Block.stairsCobblestone, 4), new Object[] {"# ", "## ", "###", '#', Block.cobblestone}); ++ this.addRecipe(new ItemStack(Block.stairsBrick, 4), new Object[] {"# ", "## ", "###", '#', Block.brick}); ++ this.addRecipe(new ItemStack(Block.stairsStoneBrick, 4), new Object[] {"# ", "## ", "###", '#', Block.stoneBrick}); ++ this.addRecipe(new ItemStack(Block.stairsNetherBrick, 4), new Object[] {"# ", "## ", "###", '#', Block.netherBrick}); ++ this.addRecipe(new ItemStack(Block.stairsSandStone, 4), new Object[] {"# ", "## ", "###", '#', Block.sandStone}); ++ this.addRecipe(new ItemStack(Block.stairsNetherQuartz, 4), new Object[] {"# ", "## ", "###", '#', Block.blockNetherQuartz}); ++ this.addRecipe(new ItemStack(Item.painting, 1), new Object[] {"###", "#X#", "###", '#', Item.stick, 'X', Block.cloth}); ++ this.addRecipe(new ItemStack(Item.itemFrame, 1), new Object[] {"###", "#X#", "###", '#', Item.stick, 'X', Item.leather}); ++ this.addRecipe(new ItemStack(Item.appleGold, 1, 0), new Object[] {"###", "#X#", "###", '#', Item.ingotGold, 'X', Item.appleRed}); ++ this.addRecipe(new ItemStack(Item.appleGold, 1, 1), new Object[] {"###", "#X#", "###", '#', Block.blockGold, 'X', Item.appleRed}); ++ this.addRecipe(new ItemStack(Item.goldenCarrot, 1, 0), new Object[] {"###", "#X#", "###", '#', Item.goldNugget, 'X', Item.carrot}); ++ this.addRecipe(new ItemStack(Item.speckledMelon, 1), new Object[] {"###", "#X#", "###", '#', Item.goldNugget, 'X', Item.melon}); ++ this.addRecipe(new ItemStack(Block.lever, 1), new Object[] {"X", "#", '#', Block.cobblestone, 'X', Item.stick}); ++ this.addRecipe(new ItemStack(Block.tripWireSource, 2), new Object[] {"I", "S", "#", '#', Block.planks, 'S', Item.stick, 'I', Item.ingotIron}); ++ this.addRecipe(new ItemStack(Block.torchRedstoneActive, 1), new Object[] {"X", "#", '#', Item.stick, 'X', Item.redstone}); ++ this.addRecipe(new ItemStack(Item.redstoneRepeater, 1), new Object[] {"#X#", "III", '#', Block.torchRedstoneActive, 'X', Item.redstone, 'I', Block.stone}); ++ this.addRecipe(new ItemStack(Item.comparator, 1), new Object[] {" # ", "#X#", "III", '#', Block.torchRedstoneActive, 'X', Item.netherQuartz, 'I', Block.stone}); ++ this.addRecipe(new ItemStack(Item.pocketSundial, 1), new Object[] {" # ", "#X#", " # ", '#', Item.ingotGold, 'X', Item.redstone}); ++ this.addRecipe(new ItemStack(Item.compass, 1), new Object[] {" # ", "#X#", " # ", '#', Item.ingotIron, 'X', Item.redstone}); ++ this.addRecipe(new ItemStack(Item.emptyMap, 1), new Object[] {"###", "#X#", "###", '#', Item.paper, 'X', Item.compass}); ++ this.addRecipe(new ItemStack(Block.stoneButton, 1), new Object[] {"#", '#', Block.stone}); ++ this.addRecipe(new ItemStack(Block.woodenButton, 1), new Object[] {"#", '#', Block.planks}); ++ this.addRecipe(new ItemStack(Block.pressurePlateStone, 1), new Object[] {"##", '#', Block.stone}); ++ this.addRecipe(new ItemStack(Block.pressurePlatePlanks, 1), new Object[] {"##", '#', Block.planks}); ++ this.addRecipe(new ItemStack(Block.pressurePlateIron, 1), new Object[] {"##", '#', Item.ingotIron}); ++ this.addRecipe(new ItemStack(Block.pressurePlateGold, 1), new Object[] {"##", '#', Item.ingotGold}); ++ this.addRecipe(new ItemStack(Block.dispenser, 1), new Object[] {"###", "#X#", "#R#", '#', Block.cobblestone, 'X', Item.bow, 'R', Item.redstone}); ++ this.addRecipe(new ItemStack(Block.dropper, 1), new Object[] {"###", "# #", "#R#", '#', Block.cobblestone, 'R', Item.redstone}); ++ this.addRecipe(new ItemStack(Block.pistonBase, 1), new Object[] {"TTT", "#X#", "#R#", '#', Block.cobblestone, 'X', Item.ingotIron, 'R', Item.redstone, 'T', Block.planks}); ++ this.addRecipe(new ItemStack(Block.pistonStickyBase, 1), new Object[] {"S", "P", 'S', Item.slimeBall, 'P', Block.pistonBase}); ++ this.addRecipe(new ItemStack(Item.bed, 1), new Object[] {"###", "XXX", '#', Block.cloth, 'X', Block.planks}); ++ this.addRecipe(new ItemStack(Block.enchantmentTable, 1), new Object[] {" B ", "D#D", "###", '#', Block.obsidian, 'B', Item.book, 'D', Item.diamond}); ++ this.addRecipe(new ItemStack(Block.anvil, 1), new Object[] {"III", " i ", "iii", 'I', Block.blockIron, 'i', Item.ingotIron}); ++ this.addShapelessRecipe(new ItemStack(Item.eyeOfEnder, 1), new Object[] {Item.enderPearl, Item.blazePowder}); ++ this.addShapelessRecipe(new ItemStack(Item.fireballCharge, 3), new Object[] {Item.gunpowder, Item.blazePowder, Item.coal}); ++ this.addShapelessRecipe(new ItemStack(Item.fireballCharge, 3), new Object[] {Item.gunpowder, Item.blazePowder, new ItemStack(Item.coal, 1, 1)}); ++ this.addRecipe(new ItemStack(Block.daylightSensor), new Object[] {"GGG", "QQQ", "WWW", 'G', Block.glass, 'Q', Item.netherQuartz, 'W', Block.woodSingleSlab}); ++ this.addRecipe(new ItemStack(Block.hopperBlock), new Object[] {"I I", "ICI", " I ", 'I', Item.ingotIron, 'C', Block.chest}); ++ Collections.sort(this.recipes, new RecipeSorter(this)); ++ // System.out.println(this.recipes.size() + " recipes"); // Spout Removed?!? + } + +- ShapedRecipes addRecipe(ItemStack var1, Object... var2) { ++ public ShapedRecipes addRecipe(ItemStack par1ItemStack, Object ... par2ArrayOfObj) { + String var3 = ""; + int var4 = 0; + int var5 = 0; + int var6 = 0; +- if(var2[var4] instanceof String[]) { +- String[] var11 = (String[])((String[])var2[var4++]); +- +- for(int var8 = 0; var8 < var11.length; ++var8) { +- String var9 = var11[var8]; ++ ++ if (par2ArrayOfObj[var4] instanceof String[]) { ++ String[] var7 = (String[])((String[])par2ArrayOfObj[var4++]); ++ ++ for (int var8 = 0; var8 < var7.length; ++var8) { ++ String var9 = var7[var8]; + ++var6; + var5 = var9.length(); + var3 = var3 + var9; + } + } else { +- while(var2[var4] instanceof String) { +- String var7 = (String)var2[var4++]; ++ while (par2ArrayOfObj[var4] instanceof String) { ++ String var11 = (String)par2ArrayOfObj[var4++]; + ++var6; +- var5 = var7.length(); +- var3 = var3 + var7; ++ var5 = var11.length(); ++ var3 = var3 + var11; + } + } + + HashMap var12; +- for(var12 = new HashMap(); var4 < var2.length; var4 += 2) { +- Character var13 = (Character)var2[var4]; +- ItemStack var15 = null; +- if(var2[var4 + 1] instanceof Item) { +- var15 = new ItemStack((Item)var2[var4 + 1]); +- } else if(var2[var4 + 1] instanceof Block) { +- var15 = new ItemStack((Block)var2[var4 + 1], 1, Short.MAX_VALUE); +- } else if(var2[var4 + 1] instanceof ItemStack) { +- var15 = (ItemStack)var2[var4 + 1]; ++ ++ for (var12 = new HashMap(); var4 < par2ArrayOfObj.length; var4 += 2) { ++ Character var13 = (Character)par2ArrayOfObj[var4]; ++ ItemStack var14 = null; ++ ++ if (par2ArrayOfObj[var4 + 1] instanceof Item) { ++ var14 = new ItemStack((Item)par2ArrayOfObj[var4 + 1]); ++ } else if (par2ArrayOfObj[var4 + 1] instanceof Block) { ++ var14 = new ItemStack((Block)par2ArrayOfObj[var4 + 1], 1, 32767); ++ } else if (par2ArrayOfObj[var4 + 1] instanceof ItemStack) { ++ var14 = (ItemStack)par2ArrayOfObj[var4 + 1]; + } + +- var12.put(var13, var15); ++ var12.put(var13, var14); + } + +- ItemStack[] var14 = new ItemStack[var5 * var6]; ++ ItemStack[] var15 = new ItemStack[var5 * var6]; + +- for(int var16 = 0; var16 < var5 * var6; ++var16) { ++ for (int var16 = 0; var16 < var5 * var6; ++var16) { + char var10 = var3.charAt(var16); +- if(var12.containsKey(Character.valueOf(var10))) { +- var14[var16] = ((ItemStack)var12.get(Character.valueOf(var10))).copy(); ++ ++ if (var12.containsKey(Character.valueOf(var10))) { ++ var15[var16] = ((ItemStack)var12.get(Character.valueOf(var10))).copy(); + } else { +- var14[var16] = null; ++ var15[var16] = null; + } + } + +- ShapedRecipes var17 = new ShapedRecipes(var5, var6, var14, var1); +- this.b.add(var17); ++ ShapedRecipes var17 = new ShapedRecipes(var5, var6, var15, par1ItemStack); ++ this.recipes.add(var17); + return var17; + } + +- void addShapelessRecipe(ItemStack var1, Object... var2) { ++ public void addShapelessRecipe(ItemStack par1ItemStack, Object ... par2ArrayOfObj) { + ArrayList var3 = new ArrayList(); +- Object[] var4 = var2; +- int var5 = var2.length; ++ Object[] var4 = par2ArrayOfObj; ++ int var5 = par2ArrayOfObj.length; + +- for(int var6 = 0; var6 < var5; ++var6) { ++ for (int var6 = 0; var6 < var5; ++var6) { + Object var7 = var4[var6]; +- if(var7 instanceof ItemStack) { ++ ++ if (var7 instanceof ItemStack) { + var3.add(((ItemStack)var7).copy()); +- } else if(var7 instanceof Item) { ++ } else if (var7 instanceof Item) { + var3.add(new ItemStack((Item)var7)); + } else { +- if(!(var7 instanceof Block)) { ++ if (!(var7 instanceof Block)) { + throw new RuntimeException("Invalid shapeless recipy!"); + } + +@@ -210,23 +223,24 @@ + } + } + +- this.b.add(new ShapelessRecipes(var1, var3)); ++ this.recipes.add(new ShapelessRecipes(par1ItemStack, var3)); + } + +- public ItemStack findMatchingRecipe(InventoryCrafting var1, World var2) { ++ public ItemStack findMatchingRecipe(InventoryCrafting par1InventoryCrafting, World par2World) { + int var3 = 0; + ItemStack var4 = null; + ItemStack var5 = null; +- + int var6; +- for(var6 = 0; var6 < var1.getSizeInventory(); ++var6) { +- ItemStack var7 = var1.getStackInSlot(var6); +- if(var7 != null) { +- if(var3 == 0) { ++ ++ for (var6 = 0; var6 < par1InventoryCrafting.getSizeInventory(); ++var6) { ++ ItemStack var7 = par1InventoryCrafting.getStackInSlot(var6); ++ ++ if (var7 != null) { ++ if (var3 == 0) { + var4 = var7; + } + +- if(var3 == 1) { ++ if (var3 == 1) { + var5 = var7; + } + +@@ -234,22 +248,24 @@ + } + } + +- if(var3 == 2 && var4.itemID == var5.itemID && var4.stackSize == 1 && var5.stackSize == 1 && Item.itemsList[var4.itemID].isDamageable()) { ++ if (var3 == 2 && var4.itemID == var5.itemID && var4.stackSize == 1 && var5.stackSize == 1 && Item.itemsList[var4.itemID].isDamageable()) { + Item var11 = Item.itemsList[var4.itemID]; + int var13 = var11.getMaxDamage() - var4.getItemDamageForDisplay(); + int var8 = var11.getMaxDamage() - var5.getItemDamageForDisplay(); + int var9 = var13 + var8 + var11.getMaxDamage() * 5 / 100; + int var10 = var11.getMaxDamage() - var9; +- if(var10 < 0) { ++ ++ if (var10 < 0) { + var10 = 0; + } + + return new ItemStack(var4.itemID, 1, var10); + } else { +- for(var6 = 0; var6 < this.b.size(); ++var6) { +- IRecipe var12 = (IRecipe)this.b.get(var6); +- if(var12.matches(var1, var2)) { +- return var12.getCraftingResult(var1); ++ for (var6 = 0; var6 < this.recipes.size(); ++var6) { ++ IRecipe var12 = (IRecipe)this.recipes.get(var6); ++ ++ if (var12.matches(par1InventoryCrafting, par2World)) { ++ return var12.getCraftingResult(par1InventoryCrafting); + } + } + +@@ -257,7 +273,10 @@ + } + } + ++ /** ++ * returns the List<> of all recipes ++ */ + public List getRecipeList() { +- return this.b; ++ return this.recipes; + } + } diff --git a/patches/net/minecraft/src/CrashReport.java.patch b/patches/net/minecraft/src/CrashReport.java.patch new file mode 100644 index 0000000..0daeede --- /dev/null +++ b/patches/net/minecraft/src/CrashReport.java.patch @@ -0,0 +1,297 @@ +--- net/minecraft/src/CrashReport.java ++++ net/minecraft/src/CrashReport.java +@@ -12,20 +12,32 @@ + import java.util.List; + + public class CrashReport { +- private final String a; +- private final Throwable b; ++ ++ /** Description of the crash report. */ ++ private final String description; ++ ++ /** The Throwable that is the "cause" for this crash and Crash Report. */ ++ private final Throwable cause; + private final CrashReportCategory field_85061_c = new CrashReportCategory(this, "System Details"); +- private final List d = new ArrayList(); +- private File e; ++ ++ /** Holds the keys and values of all crash report sections. */ ++ private final List crashReportSections = new ArrayList(); ++ ++ /** File of crash report. */ ++ private File crashReportFile; + private boolean field_85059_f = true; +- private StackTraceElement[] g = new StackTraceElement[0]; ++ private StackTraceElement[] field_85060_g = new StackTraceElement[0]; + +- public CrashReport(String var1, Throwable var2) { +- this.a = var1; +- this.b = var2; ++ public CrashReport(String par1Str, Throwable par2Throwable) { ++ this.description = par1Str; ++ this.cause = par2Throwable; + this.populateEnvironment(); + } + ++ /** ++ * Populates this crash report with initial information about the running server and operating system / java ++ * environment ++ */ + private void populateEnvironment() { + this.field_85061_c.addCrashSectionCallable("Minecraft Version", new CallableMinecraftVersion(this)); + this.field_85061_c.addCrashSectionCallable("Operating System", new CallableOSInfo(this)); +@@ -38,68 +50,83 @@ + this.field_85061_c.addCrashSectionCallable("IntCache", new CallableIntCache(this)); + } + ++ /** ++ * Returns the description of the Crash Report. ++ */ + public String getDescription() { +- return this.a; ++ return this.description; + } + ++ /** ++ * Returns the Throwable object that is the cause for the crash and Crash Report. ++ */ + public Throwable getCrashCause() { +- return this.b; ++ return this.cause; + } + +- public void getSectionsInStringBuilder(StringBuilder var1) { +- if(this.g != null && this.g.length > 0) { +- var1.append("-- Head --\n"); +- var1.append("Stacktrace:\n"); +- StackTraceElement[] var2 = this.g; ++ /** ++ * Gets the various sections of the crash report into the given StringBuilder ++ */ ++ public void getSectionsInStringBuilder(StringBuilder par1StringBuilder) { ++ if (this.field_85060_g != null && this.field_85060_g.length > 0) { ++ par1StringBuilder.append("-- Head --\n"); ++ par1StringBuilder.append("Stacktrace:\n"); ++ StackTraceElement[] var2 = this.field_85060_g; + int var3 = var2.length; + +- for(int var4 = 0; var4 < var3; ++var4) { ++ for (int var4 = 0; var4 < var3; ++var4) { + StackTraceElement var5 = var2[var4]; +- var1.append("\t").append("at ").append(var5.toString()); +- var1.append("\n"); ++ par1StringBuilder.append("\t").append("at ").append(var5.toString()); ++ par1StringBuilder.append("\n"); + } + +- var1.append("\n"); ++ par1StringBuilder.append("\n"); + } + +- Iterator var6 = this.d.iterator(); ++ Iterator var6 = this.crashReportSections.iterator(); + +- while(var6.hasNext()) { ++ while (var6.hasNext()) { + CrashReportCategory var7 = (CrashReportCategory)var6.next(); +- var7.func_85072_a(var1); +- var1.append("\n\n"); ++ var7.func_85072_a(par1StringBuilder); ++ par1StringBuilder.append("\n\n"); + } + +- this.field_85061_c.func_85072_a(var1); ++ this.field_85061_c.func_85072_a(par1StringBuilder); + } + ++ /** ++ * Gets the stack trace of the Throwable that caused this crash report, or if that fails, the cause .toString(). ++ */ + public String getCauseStackTraceOrString() { + StringWriter var1 = null; + PrintWriter var2 = null; +- String var3 = this.b.toString(); ++ String var3 = this.cause.toString(); + + try { + var1 = new StringWriter(); + var2 = new PrintWriter(var1); +- this.b.printStackTrace(var2); ++ this.cause.printStackTrace(var2); + var3 = var1.toString(); + } finally { + try { +- if(var1 != null) { ++ if (var1 != null) { + var1.close(); + } + +- if(var2 != null) { ++ if (var2 != null) { + var2.close(); + } + } catch (IOException var10) { ++ ; + } +- + } + + return var3; + } + ++ /** ++ * Gets the complete report with headers, stack trace, and different sections as a string. ++ */ + public String getCompleteReport() { + StringBuilder var1 = new StringBuilder(); + var1.append("---- Minecraft Crash Report ----\n"); +@@ -110,12 +137,12 @@ + var1.append((new SimpleDateFormat()).format(new Date())); + var1.append("\n"); + var1.append("Description: "); +- var1.append(this.a); ++ var1.append(this.description); + var1.append("\n\n"); + var1.append(this.getCauseStackTraceOrString()); + var1.append("\n\nA detailed walkthrough of the error, its code path and all known details is as follows:\n"); + +- for(int var2 = 0; var2 < 87; ++var2) { ++ for (int var2 = 0; var2 < 87; ++var2) { + var1.append("-"); + } + +@@ -124,26 +151,32 @@ + return var1.toString(); + } + ++ /** ++ * Gets the file this crash report is saved into. ++ */ + public File getFile() { +- return this.e; ++ return this.crashReportFile; + } + +- public boolean saveToFile(File var1, ILogAgent var2) { +- if(this.e != null) { ++ /** ++ * Saves the complete crash report to the given File. ++ */ ++ public boolean saveToFile(File par1File, ILogAgent par2ILogAgent) { ++ if (this.crashReportFile != null) { + return false; + } else { +- if(var1.getParentFile() != null) { +- var1.getParentFile().mkdirs(); ++ if (par1File.getParentFile() != null) { ++ par1File.getParentFile().mkdirs(); + } + + try { +- FileWriter var3 = new FileWriter(var1); ++ FileWriter var3 = new FileWriter(par1File); + var3.write(this.getCompleteReport()); + var3.close(); +- this.e = var1; ++ this.crashReportFile = par1File; + return true; + } catch (Throwable var4) { +- var2.logSevereException("Could not save crash report to " + var1, var4); ++ par2ILogAgent.logSevereException("Could not save crash report to " + par1File, var4); + return false; + } + } +@@ -153,42 +186,55 @@ + return this.field_85061_c; + } + +- public CrashReportCategory makeCategory(String var1) { +- return this.makeCategoryDepth(var1, 1); ++ /** ++ * Creates a CrashReportCategory ++ */ ++ public CrashReportCategory makeCategory(String par1Str) { ++ return this.makeCategoryDepth(par1Str, 1); + } + +- public CrashReportCategory makeCategoryDepth(String var1, int var2) { +- CrashReportCategory var3 = new CrashReportCategory(this, var1); +- if(this.field_85059_f) { +- int var4 = var3.func_85073_a(var2); +- StackTraceElement[] var5 = this.b.getStackTrace(); ++ /** ++ * Creates a CrashReportCategory for the given stack trace depth ++ */ ++ public CrashReportCategory makeCategoryDepth(String par1Str, int par2) { ++ CrashReportCategory var3 = new CrashReportCategory(this, par1Str); ++ ++ if (this.field_85059_f) { ++ int var4 = var3.func_85073_a(par2); ++ StackTraceElement[] var5 = this.cause.getStackTrace(); + StackTraceElement var6 = null; + StackTraceElement var7 = null; +- if(var5 != null && var5.length - var4 < var5.length) { ++ ++ if (var5 != null && var5.length - var4 < var5.length) { + var6 = var5[var5.length - var4]; +- if(var5.length + 1 - var4 < var5.length) { ++ ++ if (var5.length + 1 - var4 < var5.length) { + var7 = var5[var5.length + 1 - var4]; + } + } + + this.field_85059_f = var3.func_85069_a(var6, var7); +- if(var4 > 0 && !this.d.isEmpty()) { +- CrashReportCategory var8 = (CrashReportCategory)this.d.get(this.d.size() - 1); ++ ++ if (var4 > 0 && !this.crashReportSections.isEmpty()) { ++ CrashReportCategory var8 = (CrashReportCategory)this.crashReportSections.get(this.crashReportSections.size() - 1); + var8.func_85070_b(var4); +- } else if(var5 != null && var5.length >= var4) { +- this.g = new StackTraceElement[var5.length - var4]; +- System.arraycopy(var5, 0, this.g, 0, this.g.length); ++ } else if (var5 != null && var5.length >= var4) { ++ this.field_85060_g = new StackTraceElement[var5.length - var4]; ++ System.arraycopy(var5, 0, this.field_85060_g, 0, this.field_85060_g.length); + } else { + this.field_85059_f = false; + } + } + +- this.d.add(var3); ++ this.crashReportSections.add(var3); + return var3; + } + ++ /** ++ * Gets a random witty comment for inclusion in this CrashReport ++ */ + private static String getWittyComment() { +- String[] var0 = new String[]{"Who set us up the TNT?", "Everything\'s going to plan. No, really, that was supposed to happen.", "Uh... Did I do that?", "Oops.", "Why did you do that?", "I feel sad now :(", "My bad.", "I\'m sorry, Dave.", "I let you down. Sorry :(", "On the bright side, I bought you a teddy bear!", "Daisy, daisy...", "Oh - I know what I did wrong!", "Hey, that tickles! Hehehe!", "I blame Dinnerbone.", "You should try our sister game, Minceraft!", "Don\'t be sad. I\'ll do better next time, I promise!", "Don\'t be sad, have a hug! <3", "I just don\'t know what went wrong :(", "Shall we play a game?", "Quite honestly, I wouldn\'t worry myself about that.", "I bet Cylons wouldn\'t have this problem.", "Sorry :(", "Surprise! Haha. Well, this is awkward.", "Would you like a cupcake?", "Hi. I\'m Minecraft, and I\'m a crashaholic.", "Ooh. Shiny.", "This doesn\'t make any sense!", "Why is it breaking :(", "Don\'t do that.", "Ouch. That hurt :(", "You\'re mean.", "This is a token for 1 free hug. Redeem at your nearest Mojangsta: [~~HUG~~]", "There are four lights!"}; ++ String[] var0 = new String[] {"Who set us up the TNT?", "Everything\'s going to plan. No, really, that was supposed to happen.", "Uh... Did I do that?", "Oops.", "Why did you do that?", "I feel sad now :(", "My bad.", "I\'m sorry, Dave.", "I let you down. Sorry :(", "On the bright side, I bought you a teddy bear!", "Daisy, daisy...", "Oh - I know what I did wrong!", "Hey, that tickles! Hehehe!", "I blame Dinnerbone.", "You should try our sister game, Minceraft!", "Don\'t be sad. I\'ll do better next time, I promise!", "Don\'t be sad, have a hug! <3", "I just don\'t know what went wrong :(", "Shall we play a game?", "Quite honestly, I wouldn\'t worry myself about that.", "I bet Cylons wouldn\'t have this problem.", "Sorry :(", "Surprise! Haha. Well, this is awkward.", "Would you like a cupcake?", "Hi. I\'m Minecraft, and I\'m a crashaholic.", "Ooh. Shiny.", "This doesn\'t make any sense!", "Why is it breaking :(", "Don\'t do that.", "Ouch. That hurt :(", "You\'re mean.", "This is a token for 1 free hug. Redeem at your nearest Mojangsta: [~~HUG~~]", "There are four lights!"}; + + try { + return var0[(int)(System.nanoTime() % (long)var0.length)]; +@@ -197,12 +243,16 @@ + } + } + +- public static CrashReport makeCrashReport(Throwable var0, String var1) { ++ /** ++ * Creates a crash report for the exception ++ */ ++ public static CrashReport makeCrashReport(Throwable par0Throwable, String par1Str) { + CrashReport var2; +- if(var0 instanceof ReportedException) { +- var2 = ((ReportedException)var0).getCrashReport(); ++ ++ if (par0Throwable instanceof ReportedException) { ++ var2 = ((ReportedException)par0Throwable).getCrashReport(); + } else { +- var2 = new CrashReport(var1, var0); ++ var2 = new CrashReport(par1Str, par0Throwable); + } + + return var2; diff --git a/patches/net/minecraft/src/CrashReportCategory.java.patch b/patches/net/minecraft/src/CrashReportCategory.java.patch new file mode 100644 index 0000000..ddcd2cc --- /dev/null +++ b/patches/net/minecraft/src/CrashReportCategory.java.patch @@ -0,0 +1,237 @@ +--- net/minecraft/src/CrashReportCategory.java ++++ net/minecraft/src/CrashReportCategory.java +@@ -7,30 +7,32 @@ + + public class CrashReportCategory { + private final CrashReport theCrashReport; +- private final String b; +- private final List c = new ArrayList(); +- private StackTraceElement[] d = new StackTraceElement[0]; +- +- public CrashReportCategory(CrashReport var1, String var2) { +- this.theCrashReport = var1; +- this.b = var2; +- } +- +- public static String func_85074_a(double var0, double var2, double var4) { +- return String.format("%.2f,%.2f,%.2f - %s", new Object[]{Double.valueOf(var0), Double.valueOf(var2), Double.valueOf(var4), getLocationInfo(MathHelper.floor_double(var0), MathHelper.floor_double(var2), MathHelper.floor_double(var4))}); +- } +- +- public static String getLocationInfo(int var0, int var1, int var2) { ++ private final String field_85076_b; ++ private final List field_85077_c = new ArrayList(); ++ private StackTraceElement[] stackTrace = new StackTraceElement[0]; ++ ++ public CrashReportCategory(CrashReport par1CrashReport, String par2Str) { ++ this.theCrashReport = par1CrashReport; ++ this.field_85076_b = par2Str; ++ } ++ ++ public static String func_85074_a(double par0, double par2, double par4) { ++ return String.format("%.2f,%.2f,%.2f - %s", new Object[] {Double.valueOf(par0), Double.valueOf(par2), Double.valueOf(par4), getLocationInfo(MathHelper.floor_double(par0), MathHelper.floor_double(par2), MathHelper.floor_double(par4))}); ++ } ++ ++ /** ++ * Returns a string with world information on location.Args:x,y,z ++ */ ++ public static String getLocationInfo(int par0, int par1, int par2) { + StringBuilder var3 = new StringBuilder(); + + try { +- var3.append(String.format("World: (%d,%d,%d)", new Object[]{Integer.valueOf(var0), Integer.valueOf(var1), Integer.valueOf(var2)})); ++ var3.append(String.format("World: (%d,%d,%d)", new Object[] {Integer.valueOf(par0), Integer.valueOf(par1), Integer.valueOf(par2)})); + } catch (Throwable var16) { + var3.append("(Error finding world loc)"); + } + + var3.append(", "); +- + int var4; + int var5; + int var6; +@@ -40,17 +42,18 @@ + int var10; + int var11; + int var12; ++ + try { +- var4 = var0 >> 4; +- var5 = var2 >> 4; +- var6 = var0 & 15; +- var7 = var1 >> 4; +- var8 = var2 & 15; ++ var4 = par0 >> 4; ++ var5 = par2 >> 4; ++ var6 = par0 & 15; ++ var7 = par1 >> 4; ++ var8 = par2 & 15; + var9 = var4 << 4; + var10 = var5 << 4; + var11 = (var4 + 1 << 4) - 1; + var12 = (var5 + 1 << 4) - 1; +- var3.append(String.format("Chunk: (at %d,%d,%d in %d,%d; contains blocks %d,0,%d to %d,255,%d)", new Object[]{Integer.valueOf(var6), Integer.valueOf(var7), Integer.valueOf(var8), Integer.valueOf(var4), Integer.valueOf(var5), Integer.valueOf(var9), Integer.valueOf(var10), Integer.valueOf(var11), Integer.valueOf(var12)})); ++ var3.append(String.format("Chunk: (at %d,%d,%d in %d,%d; contains blocks %d,0,%d to %d,255,%d)", new Object[] {Integer.valueOf(var6), Integer.valueOf(var7), Integer.valueOf(var8), Integer.valueOf(var4), Integer.valueOf(var5), Integer.valueOf(var9), Integer.valueOf(var10), Integer.valueOf(var11), Integer.valueOf(var12)})); + } catch (Throwable var15) { + var3.append("(Error finding chunk loc)"); + } +@@ -58,8 +61,8 @@ + var3.append(", "); + + try { +- var4 = var0 >> 9; +- var5 = var2 >> 9; ++ var4 = par0 >> 9; ++ var5 = par2 >> 9; + var6 = var4 << 5; + var7 = var5 << 5; + var8 = (var4 + 1 << 5) - 1; +@@ -68,7 +71,7 @@ + var11 = var5 << 9; + var12 = (var4 + 1 << 9) - 1; + int var13 = (var5 + 1 << 9) - 1; +- var3.append(String.format("Region: (%d,%d; contains chunks %d,%d to %d,%d, blocks %d,0,%d to %d,255,%d)", new Object[]{Integer.valueOf(var4), Integer.valueOf(var5), Integer.valueOf(var6), Integer.valueOf(var7), Integer.valueOf(var8), Integer.valueOf(var9), Integer.valueOf(var10), Integer.valueOf(var11), Integer.valueOf(var12), Integer.valueOf(var13)})); ++ var3.append(String.format("Region: (%d,%d; contains chunks %d,%d to %d,%d, blocks %d,0,%d to %d,255,%d)", new Object[] {Integer.valueOf(var4), Integer.valueOf(var5), Integer.valueOf(var6), Integer.valueOf(var7), Integer.valueOf(var8), Integer.valueOf(var9), Integer.valueOf(var10), Integer.valueOf(var11), Integer.valueOf(var12), Integer.valueOf(var13)})); + } catch (Throwable var14) { + var3.append("(Error finding world loc)"); + } +@@ -76,40 +79,49 @@ + return var3.toString(); + } + +- public void addCrashSectionCallable(String var1, Callable var2) { ++ /** ++ * Adds a Crashreport section with the given name with the value set to the result of the given Callable; ++ */ ++ public void addCrashSectionCallable(String par1Str, Callable par2Callable) { + try { +- this.addCrashSection(var1, var2.call()); ++ this.addCrashSection(par1Str, par2Callable.call()); + } catch (Throwable var4) { +- this.addCrashSectionThrowable(var1, var4); ++ this.addCrashSectionThrowable(par1Str, var4); + } +- +- } +- +- public void addCrashSection(String var1, Object var2) { +- this.c.add(new CrashReportCategoryEntry(var1, var2)); +- } +- +- public void addCrashSectionThrowable(String var1, Throwable var2) { +- this.addCrashSection(var1, var2); +- } +- +- public int func_85073_a(int var1) { ++ } ++ ++ /** ++ * Adds a Crashreport section with the given name with the given value (convered .toString()) ++ */ ++ public void addCrashSection(String par1Str, Object par2Obj) { ++ this.field_85077_c.add(new CrashReportCategoryEntry(par1Str, par2Obj)); ++ } ++ ++ /** ++ * Adds a Crashreport section with the given name with the given Throwable ++ */ ++ public void addCrashSectionThrowable(String par1Str, Throwable par2Throwable) { ++ this.addCrashSection(par1Str, par2Throwable); ++ } ++ ++ public int func_85073_a(int par1) { + StackTraceElement[] var2 = Thread.currentThread().getStackTrace(); +- this.d = new StackTraceElement[var2.length - 3 - var1]; +- System.arraycopy(var2, 3 + var1, this.d, 0, this.d.length); +- return this.d.length; ++ this.stackTrace = new StackTraceElement[var2.length - 3 - par1]; ++ System.arraycopy(var2, 3 + par1, this.stackTrace, 0, this.stackTrace.length); ++ return this.stackTrace.length; + } + +- public boolean func_85069_a(StackTraceElement var1, StackTraceElement var2) { +- if(this.d.length != 0 && var1 != null) { +- StackTraceElement var3 = this.d[0]; +- if(var3.isNativeMethod() == var1.isNativeMethod() && var3.getClassName().equals(var1.getClassName()) && var3.getFileName().equals(var1.getFileName()) && var3.getMethodName().equals(var1.getMethodName())) { +- if(var2 != null != this.d.length > 1) { ++ public boolean func_85069_a(StackTraceElement par1StackTraceElement, StackTraceElement par2StackTraceElement) { ++ if (this.stackTrace.length != 0 && par1StackTraceElement != null) { ++ StackTraceElement var3 = this.stackTrace[0]; ++ ++ if (var3.isNativeMethod() == par1StackTraceElement.isNativeMethod() && var3.getClassName().equals(par1StackTraceElement.getClassName()) && var3.getFileName().equals(par1StackTraceElement.getFileName()) && var3.getMethodName().equals(par1StackTraceElement.getMethodName())) { ++ if (par2StackTraceElement != null != this.stackTrace.length > 1) { + return false; +- } else if(var2 != null && !this.d[1].equals(var2)) { ++ } else if (par2StackTraceElement != null && !this.stackTrace[1].equals(par2StackTraceElement)) { + return false; + } else { +- this.d[0] = var1; ++ this.stackTrace[0] = par1StackTraceElement; + return true; + } + } else { +@@ -120,42 +132,41 @@ + } + } + +- public void func_85070_b(int var1) { +- StackTraceElement[] var2 = new StackTraceElement[this.d.length - var1]; +- System.arraycopy(this.d, 0, var2, 0, var2.length); +- this.d = var2; ++ public void func_85070_b(int par1) { ++ StackTraceElement[] var2 = new StackTraceElement[this.stackTrace.length - par1]; ++ System.arraycopy(this.stackTrace, 0, var2, 0, var2.length); ++ this.stackTrace = var2; + } + +- public void func_85072_a(StringBuilder var1) { +- var1.append("-- ").append(this.b).append(" --\n"); +- var1.append("Details:"); +- Iterator var2 = this.c.iterator(); ++ public void func_85072_a(StringBuilder par1StringBuilder) { ++ par1StringBuilder.append("-- ").append(this.field_85076_b).append(" --\n"); ++ par1StringBuilder.append("Details:"); ++ Iterator var2 = this.field_85077_c.iterator(); + +- while(var2.hasNext()) { ++ while (var2.hasNext()) { + CrashReportCategoryEntry var3 = (CrashReportCategoryEntry)var2.next(); +- var1.append("\n\t"); +- var1.append(var3.func_85089_a()); +- var1.append(": "); +- var1.append(var3.func_85090_b()); ++ par1StringBuilder.append("\n\t"); ++ par1StringBuilder.append(var3.func_85089_a()); ++ par1StringBuilder.append(": "); ++ par1StringBuilder.append(var3.func_85090_b()); + } + +- if(this.d != null && this.d.length > 0) { +- var1.append("\nStacktrace:"); +- StackTraceElement[] var6 = this.d; ++ if (this.stackTrace != null && this.stackTrace.length > 0) { ++ par1StringBuilder.append("\nStacktrace:"); ++ StackTraceElement[] var6 = this.stackTrace; + int var7 = var6.length; + +- for(int var4 = 0; var4 < var7; ++var4) { ++ for (int var4 = 0; var4 < var7; ++var4) { + StackTraceElement var5 = var6[var4]; +- var1.append("\n\tat "); +- var1.append(var5.toString()); ++ par1StringBuilder.append("\n\tat "); ++ par1StringBuilder.append(var5.toString()); + } + } +- + } + +- public static void addBlockCrashInfo(CrashReportCategory var0, int var1, int var2, int var3, int var4, int var5) { +- var0.addCrashSectionCallable("Block type", new CallableBlockType(var4)); +- var0.addCrashSectionCallable("Block data value", new CallableBlockDataValue(var5)); +- var0.addCrashSectionCallable("Block location", new CallableBlockLocation(var1, var2, var3)); ++ public static void addBlockCrashInfo(CrashReportCategory par0CrashReportCategory, int par1, int par2, int par3, int par4, int par5) { ++ par0CrashReportCategory.addCrashSectionCallable("Block type", new CallableBlockType(par4)); ++ par0CrashReportCategory.addCrashSectionCallable("Block data value", new CallableBlockDataValue(par5)); ++ par0CrashReportCategory.addCrashSectionCallable("Block location", new CallableBlockLocation(par1, par2, par3)); + } + } diff --git a/patches/net/minecraft/src/CrashReportCategoryEntry.java.patch b/patches/net/minecraft/src/CrashReportCategoryEntry.java.patch new file mode 100644 index 0000000..0181949 --- /dev/null +++ b/patches/net/minecraft/src/CrashReportCategoryEntry.java.patch @@ -0,0 +1,44 @@ +--- net/minecraft/src/CrashReportCategoryEntry.java ++++ net/minecraft/src/CrashReportCategoryEntry.java +@@ -1,27 +1,27 @@ + package net.minecraft.src; + + class CrashReportCategoryEntry { +- private final String a; +- private final String b; +- +- public CrashReportCategoryEntry(String var1, Object var2) { +- this.a = var1; +- if(var2 == null) { +- this.b = "~~NULL~~"; +- } else if(var2 instanceof Throwable) { +- Throwable var3 = (Throwable)var2; +- this.b = "~~ERROR~~ " + var3.getClass().getSimpleName() + ": " + var3.getMessage(); ++ private final String field_85092_a; ++ private final String field_85091_b; ++ ++ public CrashReportCategoryEntry(String par1Str, Object par2Obj) { ++ this.field_85092_a = par1Str; ++ ++ if (par2Obj == null) { ++ this.field_85091_b = "~~NULL~~"; ++ } else if (par2Obj instanceof Throwable) { ++ Throwable var3 = (Throwable)par2Obj; ++ this.field_85091_b = "~~ERROR~~ " + var3.getClass().getSimpleName() + ": " + var3.getMessage(); + } else { +- this.b = var2.toString(); ++ this.field_85091_b = par2Obj.toString(); + } +- + } + + public String func_85089_a() { +- return this.a; ++ return this.field_85092_a; + } + + public String func_85090_b() { +- return this.b; ++ return this.field_85091_b; + } + } diff --git a/patches/net/minecraft/src/CreativeCrafting.java.patch b/patches/net/minecraft/src/CreativeCrafting.java.patch new file mode 100644 index 0000000..c0e630e --- /dev/null +++ b/patches/net/minecraft/src/CreativeCrafting.java.patch @@ -0,0 +1,40 @@ +--- net/minecraft/src/CreativeCrafting.java ++++ net/minecraft/src/CreativeCrafting.java +@@ -5,17 +5,24 @@ + public class CreativeCrafting implements ICrafting { + private final Minecraft mc; + +- public CreativeCrafting(Minecraft var1) { +- this.mc = var1; +- } +- +- public void updateCraftingInventory(Container var1, List var2) { +- } +- +- public void sendSlotContents(Container var1, int var2, ItemStack var3) { +- this.mc.playerController.sendSlotPacket(var3, var2); +- } +- +- public void sendProgressBarUpdate(Container var1, int var2, int var3) { +- } ++ public CreativeCrafting(Minecraft par1Minecraft) { ++ this.mc = par1Minecraft; ++ } ++ ++ public void sendContainerAndContentsToPlayer(Container par1Container, List par2List) {} ++ ++ /** ++ * Sends the contents of an inventory slot to the client-side Container. This doesn't have to match the actual contents ++ * of that slot. Args: Container, slot number, slot contents ++ */ ++ public void sendSlotContents(Container par1Container, int par2, ItemStack par3ItemStack) { ++ this.mc.playerController.sendSlotPacket(par3ItemStack, par2); ++ } ++ ++ /** ++ * Sends two ints to the client-side Container. Used for furnace burning time, smelting progress, brewing progress, and ++ * enchanting level. Normally the first int identifies which variable to update, and the second contains the new value. ++ * Both are truncated to shorts in non-local SMP. ++ */ ++ public void sendProgressBarUpdate(Container par1Container, int par2, int par3) {} + } diff --git a/patches/net/minecraft/src/CreativeTabBlock.java.patch b/patches/net/minecraft/src/CreativeTabBlock.java.patch new file mode 100644 index 0000000..2a9d15f --- /dev/null +++ b/patches/net/minecraft/src/CreativeTabBlock.java.patch @@ -0,0 +1,18 @@ +--- net/minecraft/src/CreativeTabBlock.java ++++ net/minecraft/src/CreativeTabBlock.java +@@ -1,10 +1,13 @@ + package net.minecraft.src; + + final class CreativeTabBlock extends CreativeTabs { +- CreativeTabBlock(int var1, String var2) { +- super(var1, var2); ++ CreativeTabBlock(int par1, String par2Str) { ++ super(par1, par2Str); + } + ++ /** ++ * the itemID for the item to be displayed on the tab ++ */ + public int getTabIconItemIndex() { + return Block.plantRed.blockID; + } diff --git a/patches/net/minecraft/src/CreativeTabBrewing.java.patch b/patches/net/minecraft/src/CreativeTabBrewing.java.patch new file mode 100644 index 0000000..dcdde7f --- /dev/null +++ b/patches/net/minecraft/src/CreativeTabBrewing.java.patch @@ -0,0 +1,18 @@ +--- net/minecraft/src/CreativeTabBrewing.java ++++ net/minecraft/src/CreativeTabBrewing.java +@@ -1,10 +1,13 @@ + package net.minecraft.src; + + final class CreativeTabBrewing extends CreativeTabs { +- CreativeTabBrewing(int var1, String var2) { +- super(var1, var2); ++ CreativeTabBrewing(int par1, String par2Str) { ++ super(par1, par2Str); + } + ++ /** ++ * the itemID for the item to be displayed on the tab ++ */ + public int getTabIconItemIndex() { + return Item.potion.itemID; + } diff --git a/patches/net/minecraft/src/CreativeTabCombat.java.patch b/patches/net/minecraft/src/CreativeTabCombat.java.patch new file mode 100644 index 0000000..5571778 --- /dev/null +++ b/patches/net/minecraft/src/CreativeTabCombat.java.patch @@ -0,0 +1,18 @@ +--- net/minecraft/src/CreativeTabCombat.java ++++ net/minecraft/src/CreativeTabCombat.java +@@ -1,10 +1,13 @@ + package net.minecraft.src; + + final class CreativeTabCombat extends CreativeTabs { +- CreativeTabCombat(int var1, String var2) { +- super(var1, var2); ++ CreativeTabCombat(int par1, String par2Str) { ++ super(par1, par2Str); + } + ++ /** ++ * the itemID for the item to be displayed on the tab ++ */ + public int getTabIconItemIndex() { + return Block.brick.blockID; + } diff --git a/patches/net/minecraft/src/CreativeTabDeco.java.patch b/patches/net/minecraft/src/CreativeTabDeco.java.patch new file mode 100644 index 0000000..724a58c --- /dev/null +++ b/patches/net/minecraft/src/CreativeTabDeco.java.patch @@ -0,0 +1,18 @@ +--- net/minecraft/src/CreativeTabDeco.java ++++ net/minecraft/src/CreativeTabDeco.java +@@ -1,10 +1,13 @@ + package net.minecraft.src; + + final class CreativeTabDeco extends CreativeTabs { +- CreativeTabDeco(int var1, String var2) { +- super(var1, var2); ++ CreativeTabDeco(int par1, String par2Str) { ++ super(par1, par2Str); + } + ++ /** ++ * the itemID for the item to be displayed on the tab ++ */ + public int getTabIconItemIndex() { + return Item.redstone.itemID; + } diff --git a/patches/net/minecraft/src/CreativeTabFood.java.patch b/patches/net/minecraft/src/CreativeTabFood.java.patch new file mode 100644 index 0000000..10380ed --- /dev/null +++ b/patches/net/minecraft/src/CreativeTabFood.java.patch @@ -0,0 +1,18 @@ +--- net/minecraft/src/CreativeTabFood.java ++++ net/minecraft/src/CreativeTabFood.java +@@ -1,10 +1,13 @@ + package net.minecraft.src; + + final class CreativeTabFood extends CreativeTabs { +- CreativeTabFood(int var1, String var2) { +- super(var1, var2); ++ CreativeTabFood(int par1, String par2Str) { ++ super(par1, par2Str); + } + ++ /** ++ * the itemID for the item to be displayed on the tab ++ */ + public int getTabIconItemIndex() { + return Item.axeIron.itemID; + } diff --git a/patches/net/minecraft/src/CreativeTabInventory.java.patch b/patches/net/minecraft/src/CreativeTabInventory.java.patch new file mode 100644 index 0000000..59fe5fa --- /dev/null +++ b/patches/net/minecraft/src/CreativeTabInventory.java.patch @@ -0,0 +1,18 @@ +--- net/minecraft/src/CreativeTabInventory.java ++++ net/minecraft/src/CreativeTabInventory.java +@@ -1,10 +1,13 @@ + package net.minecraft.src; + + final class CreativeTabInventory extends CreativeTabs { +- CreativeTabInventory(int var1, String var2) { +- super(var1, var2); ++ CreativeTabInventory(int par1, String par2Str) { ++ super(par1, par2Str); + } + ++ /** ++ * the itemID for the item to be displayed on the tab ++ */ + public int getTabIconItemIndex() { + return Block.chest.blockID; + } diff --git a/patches/net/minecraft/src/CreativeTabMaterial.java.patch b/patches/net/minecraft/src/CreativeTabMaterial.java.patch new file mode 100644 index 0000000..5ff85a0 --- /dev/null +++ b/patches/net/minecraft/src/CreativeTabMaterial.java.patch @@ -0,0 +1,18 @@ +--- net/minecraft/src/CreativeTabMaterial.java ++++ net/minecraft/src/CreativeTabMaterial.java +@@ -1,10 +1,13 @@ + package net.minecraft.src; + + final class CreativeTabMaterial extends CreativeTabs { +- CreativeTabMaterial(int var1, String var2) { +- super(var1, var2); ++ CreativeTabMaterial(int par1, String par2Str) { ++ super(par1, par2Str); + } + ++ /** ++ * the itemID for the item to be displayed on the tab ++ */ + public int getTabIconItemIndex() { + return Item.stick.itemID; + } diff --git a/patches/net/minecraft/src/CreativeTabMisc.java.patch b/patches/net/minecraft/src/CreativeTabMisc.java.patch new file mode 100644 index 0000000..63f2f25 --- /dev/null +++ b/patches/net/minecraft/src/CreativeTabMisc.java.patch @@ -0,0 +1,18 @@ +--- net/minecraft/src/CreativeTabMisc.java ++++ net/minecraft/src/CreativeTabMisc.java +@@ -1,10 +1,13 @@ + package net.minecraft.src; + + final class CreativeTabMisc extends CreativeTabs { +- CreativeTabMisc(int var1, String var2) { +- super(var1, var2); ++ CreativeTabMisc(int par1, String par2Str) { ++ super(par1, par2Str); + } + ++ /** ++ * the itemID for the item to be displayed on the tab ++ */ + public int getTabIconItemIndex() { + return Item.compass.itemID; + } diff --git a/patches/net/minecraft/src/CreativeTabRedstone.java.patch b/patches/net/minecraft/src/CreativeTabRedstone.java.patch new file mode 100644 index 0000000..d374f14 --- /dev/null +++ b/patches/net/minecraft/src/CreativeTabRedstone.java.patch @@ -0,0 +1,18 @@ +--- net/minecraft/src/CreativeTabRedstone.java ++++ net/minecraft/src/CreativeTabRedstone.java +@@ -1,10 +1,13 @@ + package net.minecraft.src; + + final class CreativeTabRedstone extends CreativeTabs { +- CreativeTabRedstone(int var1, String var2) { +- super(var1, var2); ++ CreativeTabRedstone(int par1, String par2Str) { ++ super(par1, par2Str); + } + ++ /** ++ * the itemID for the item to be displayed on the tab ++ */ + public int getTabIconItemIndex() { + return Block.railPowered.blockID; + } diff --git a/patches/net/minecraft/src/CreativeTabSearch.java.patch b/patches/net/minecraft/src/CreativeTabSearch.java.patch new file mode 100644 index 0000000..406f8e5 --- /dev/null +++ b/patches/net/minecraft/src/CreativeTabSearch.java.patch @@ -0,0 +1,18 @@ +--- net/minecraft/src/CreativeTabSearch.java ++++ net/minecraft/src/CreativeTabSearch.java +@@ -1,10 +1,13 @@ + package net.minecraft.src; + + final class CreativeTabSearch extends CreativeTabs { +- CreativeTabSearch(int var1, String var2) { +- super(var1, var2); ++ CreativeTabSearch(int par1, String par2Str) { ++ super(par1, par2Str); + } + ++ /** ++ * the itemID for the item to be displayed on the tab ++ */ + public int getTabIconItemIndex() { + return Item.appleRed.itemID; + } diff --git a/patches/net/minecraft/src/CreativeTabTools.java.patch b/patches/net/minecraft/src/CreativeTabTools.java.patch new file mode 100644 index 0000000..633c539 --- /dev/null +++ b/patches/net/minecraft/src/CreativeTabTools.java.patch @@ -0,0 +1,18 @@ +--- net/minecraft/src/CreativeTabTools.java ++++ net/minecraft/src/CreativeTabTools.java +@@ -1,10 +1,13 @@ + package net.minecraft.src; + + final class CreativeTabTools extends CreativeTabs { +- CreativeTabTools(int var1, String var2) { +- super(var1, var2); ++ CreativeTabTools(int par1, String par2Str) { ++ super(par1, par2Str); + } + ++ /** ++ * the itemID for the item to be displayed on the tab ++ */ + public int getTabIconItemIndex() { + return Item.swordGold.itemID; + } diff --git a/patches/net/minecraft/src/CreativeTabTransport.java.patch b/patches/net/minecraft/src/CreativeTabTransport.java.patch new file mode 100644 index 0000000..dde098c --- /dev/null +++ b/patches/net/minecraft/src/CreativeTabTransport.java.patch @@ -0,0 +1,18 @@ +--- net/minecraft/src/CreativeTabTransport.java ++++ net/minecraft/src/CreativeTabTransport.java +@@ -1,10 +1,13 @@ + package net.minecraft.src; + + final class CreativeTabTransport extends CreativeTabs { +- CreativeTabTransport(int var1, String var2) { +- super(var1, var2); ++ CreativeTabTransport(int par1, String par2Str) { ++ super(par1, par2Str); + } + ++ /** ++ * the itemID for the item to be displayed on the tab ++ */ + public int getTabIconItemIndex() { + return Item.bucketLava.itemID; + } diff --git a/patches/net/minecraft/src/CreativeTabs.java.patch b/patches/net/minecraft/src/CreativeTabs.java.patch new file mode 100644 index 0000000..ea88dec --- /dev/null +++ b/patches/net/minecraft/src/CreativeTabs.java.patch @@ -0,0 +1,205 @@ +--- net/minecraft/src/CreativeTabs.java ++++ net/minecraft/src/CreativeTabs.java +@@ -2,31 +2,42 @@ + + import java.util.List; + ++import org.spoutcraft.client.gui.inventory.CreativeTabCustom; ++ + public class CreativeTabs { +- public static final CreativeTabs[] creativeTabArray = new CreativeTabs[12]; ++ // Spout Start - Custom item/block tab ++ public static final CreativeTabs[] creativeTabArray = new CreativeTabs[13]; ++ // Spout End + public static final CreativeTabs tabBlock = new CreativeTabCombat(0, "buildingBlocks"); + public static final CreativeTabs tabDecorations = new CreativeTabBlock(1, "decorations"); + public static final CreativeTabs tabRedstone = new CreativeTabDeco(2, "redstone"); + public static final CreativeTabs tabTransport = new CreativeTabRedstone(3, "transportation"); +- public static final CreativeTabs tabMisc = (new CreativeTabTransport(4, "misc")).func_111229_a(new EnumEnchantmentType[]{EnumEnchantmentType.all}); ++ public static final CreativeTabs tabMisc = (new CreativeTabTransport(4, "misc")).func_111229_a(new EnumEnchantmentType[] {EnumEnchantmentType.all}); + public static final CreativeTabs tabAllSearch = (new CreativeTabMisc(5, "search")).setBackgroundImageName("item_search.png"); + public static final CreativeTabs tabFood = new CreativeTabSearch(6, "food"); +- public static final CreativeTabs tabTools = (new CreativeTabFood(7, "tools")).func_111229_a(new EnumEnchantmentType[]{EnumEnchantmentType.digger}); +- public static final CreativeTabs tabCombat = (new CreativeTabTools(8, "combat")).func_111229_a(new EnumEnchantmentType[]{EnumEnchantmentType.armor, EnumEnchantmentType.armor_feet, EnumEnchantmentType.armor_head, EnumEnchantmentType.armor_legs, EnumEnchantmentType.armor_torso, EnumEnchantmentType.bow, EnumEnchantmentType.weapon}); ++ public static final CreativeTabs tabTools = (new CreativeTabFood(7, "tools")).func_111229_a(new EnumEnchantmentType[] {EnumEnchantmentType.digger}); ++ public static final CreativeTabs tabCombat = (new CreativeTabTools(8, "combat")).func_111229_a(new EnumEnchantmentType[] {EnumEnchantmentType.armor, EnumEnchantmentType.armor_feet, EnumEnchantmentType.armor_head, EnumEnchantmentType.armor_legs, EnumEnchantmentType.armor_torso, EnumEnchantmentType.bow, EnumEnchantmentType.weapon}); + public static final CreativeTabs tabBrewing = new CreativeTabBrewing(9, "brewing"); + public static final CreativeTabs tabMaterials = new CreativeTabMaterial(10, "materials"); + public static final CreativeTabs tabInventory = (new CreativeTabInventory(11, "inventory")).setBackgroundImageName("inventory.png").setNoScrollbar().setNoTitle(); ++ // Spout Start - Custom item/block tab ++ public static final CreativeTabs tabSpout = new CreativeTabCustom(12, "custom"); ++ // Spout End + private final int tabIndex; +- private final String o; +- private String p = "items.png"; ++ private final String tabLabel; ++ ++ /** Texture to use. */ ++ private String backgroundImageName = "items.png"; + private boolean hasScrollbar = true; ++ ++ /** Whether to draw the title in the foreground of the creative GUI */ + private boolean drawTitle = true; + private EnumEnchantmentType[] field_111230_s; + +- public CreativeTabs(int var1, String var2) { +- this.tabIndex = var1; +- this.o = var2; +- creativeTabArray[var1] = this; ++ public CreativeTabs(int par1, String par2Str) { ++ this.tabIndex = par1; ++ this.tabLabel = par2Str; ++ creativeTabArray[par1] = this; + } + + public int getTabIndex() { +@@ -34,9 +45,12 @@ + } + + public String getTabLabel() { +- return this.o; ++ return this.tabLabel; + } + ++ /** ++ * Gets the translated Label. ++ */ + public String getTranslatedTabLabel() { + return "itemGroup." + this.getTabLabel(); + } +@@ -45,16 +59,19 @@ + return Item.itemsList[this.getTabIconItemIndex()]; + } + ++ /** ++ * the itemID for the item to be displayed on the tab ++ */ + public int getTabIconItemIndex() { + return 1; + } + + public String getBackgroundImageName() { +- return this.p; ++ return this.backgroundImageName; + } + +- public CreativeTabs setBackgroundImageName(String var1) { +- this.p = var1; ++ public CreativeTabs setBackgroundImageName(String par1Str) { ++ this.backgroundImageName = par1Str; + return this; + } + +@@ -76,33 +93,40 @@ + return this; + } + ++ /** ++ * returns index % 6 ++ */ + public int getTabColumn() { + return this.tabIndex % 6; + } + ++ /** ++ * returns tabIndex < 6 ++ */ + public boolean isTabInFirstRow() { + return this.tabIndex < 6; + } +- ++ + public EnumEnchantmentType[] func_111225_m() { + return this.field_111230_s; + } + +- public CreativeTabs func_111229_a(EnumEnchantmentType... var1) { +- this.field_111230_s = var1; ++ public CreativeTabs func_111229_a(EnumEnchantmentType ... par1ArrayOfEnumEnchantmentType) { ++ this.field_111230_s = par1ArrayOfEnumEnchantmentType; + return this; + } + +- public boolean func_111226_a(EnumEnchantmentType var1) { +- if(this.field_111230_s == null) { ++ public boolean func_111226_a(EnumEnchantmentType par1EnumEnchantmentType) { ++ if (this.field_111230_s == null) { + return false; + } else { + EnumEnchantmentType[] var2 = this.field_111230_s; + int var3 = var2.length; + +- for(int var4 = 0; var4 < var3; ++var4) { ++ for (int var4 = 0; var4 < var3; ++var4) { + EnumEnchantmentType var5 = var2[var4]; +- if(var5 == var1) { ++ ++ if (var5 == par1EnumEnchantmentType) { + return true; + } + } +@@ -111,43 +135,49 @@ + } + } + +- public void displayAllReleventItems(List var1) { ++ /** ++ * only shows items which have tabToDisplayOn == this ++ */ ++ public void displayAllReleventItems(List par1List) { + Item[] var2 = Item.itemsList; + int var3 = var2.length; + +- for(int var4 = 0; var4 < var3; ++var4) { ++ for (int var4 = 0; var4 < var3; ++var4) { + Item var5 = var2[var4]; +- if(var5 != null && var5.getCreativeTab() == this) { +- var5.getSubItems(var5.itemID, this, var1); ++ ++ if (var5 != null && var5.getCreativeTab() == this) { ++ var5.getSubItems(var5.itemID, this, par1List); + } + } + +- if(this.func_111225_m() != null) { +- this.addEnchantmentBooksToList(var1, this.func_111225_m()); ++ if (this.func_111225_m() != null) { ++ this.addEnchantmentBooksToList(par1List, this.func_111225_m()); + } +- + } + +- public void addEnchantmentBooksToList(List var1, EnumEnchantmentType... var2) { ++ /** ++ * Adds the enchantment books from the supplied EnumEnchantmentType to the given list. ++ */ ++ public void addEnchantmentBooksToList(List par1List, EnumEnchantmentType ... par2ArrayOfEnumEnchantmentType) { + Enchantment[] var3 = Enchantment.enchantmentsList; + int var4 = var3.length; + +- for(int var5 = 0; var5 < var4; ++var5) { ++ for (int var5 = 0; var5 < var4; ++var5) { + Enchantment var6 = var3[var5]; +- if(var6 != null && var6.type != null) { ++ ++ if (var6 != null && var6.type != null) { + boolean var7 = false; + +- for(int var8 = 0; var8 < var2.length && !var7; ++var8) { +- if(var6.type == var2[var8]) { ++ for (int var8 = 0; var8 < par2ArrayOfEnumEnchantmentType.length && !var7; ++var8) { ++ if (var6.type == par2ArrayOfEnumEnchantmentType[var8]) { + var7 = true; + } + } + +- if(var7) { +- var1.add(Item.enchantedBook.getEnchantedItemStack(new EnchantmentData(var6, var6.getMaxLevel()))); ++ if (var7) { ++ par1List.add(Item.enchantedBook.getEnchantedItemStack(new EnchantmentData(var6, var6.getMaxLevel()))); + } + } + } +- + } + } diff --git a/patches/net/minecraft/src/CryptManager.java.patch b/patches/net/minecraft/src/CryptManager.java.patch new file mode 100644 index 0000000..923eaaa --- /dev/null +++ b/patches/net/minecraft/src/CryptManager.java.patch @@ -0,0 +1,165 @@ +--- net/minecraft/src/CryptManager.java ++++ net/minecraft/src/CryptManager.java +@@ -34,13 +34,17 @@ + import org.bouncycastle.jce.provider.BouncyCastleProvider; + + public class CryptManager { ++ ++ /** ++ * Generate a new shared secret AES key from a secure random source ++ */ + public static SecretKey createNewSharedKey() { + CipherKeyGenerator var0 = new CipherKeyGenerator(); + var0.init(new KeyGenerationParameters(new SecureRandom(), 128)); + return new SecretKeySpec(var0.generateKey(), "AES"); + } + +- public static KeyPair generateKeyPair() { ++ public static KeyPair createNewKeyPair() { + try { + KeyPairGenerator var0 = KeyPairGenerator.getInstance("RSA"); + var0.initialize(1024); +@@ -52,22 +56,28 @@ + } + } + +- public static byte[] getServerIdHash(String var0, PublicKey var1, SecretKey var2) { ++ /** ++ * Compute a serverId hash for use by sendSessionRequest() ++ */ ++ public static byte[] getServerIdHash(String par0Str, PublicKey par1PublicKey, SecretKey par2SecretKey) { + try { +- return digestOperation("SHA-1", new byte[][]{var0.getBytes("ISO_8859_1"), var2.getEncoded(), var1.getEncoded()}); ++ return digestOperation("SHA-1", new byte[][] {par0Str.getBytes("ISO_8859_1"), par2SecretKey.getEncoded(), par1PublicKey.getEncoded()}); + } catch (UnsupportedEncodingException var4) { + var4.printStackTrace(); + return null; + } + } + +- private static byte[] digestOperation(String var0, byte[]... var1) { ++ /** ++ * Compute a message digest on arbitrary byte[] data ++ */ ++ private static byte[] digestOperation(String par0Str, byte[] ... par1ArrayOfByte) { + try { +- MessageDigest var2 = MessageDigest.getInstance(var0); +- byte[][] var3 = var1; +- int var4 = var1.length; ++ MessageDigest var2 = MessageDigest.getInstance(par0Str); ++ byte[][] var3 = par1ArrayOfByte; ++ int var4 = par1ArrayOfByte.length; + +- for(int var5 = 0; var5 < var4; ++var5) { ++ for (int var5 = 0; var5 < var4; ++var5) { + byte[] var6 = var3[var5]; + var2.update(var6); + } +@@ -79,9 +89,12 @@ + } + } + +- public static PublicKey decodePublicKey(byte[] var0) { ++ /** ++ * Create a new PublicKey from encoded X.509 data ++ */ ++ public static PublicKey decodePublicKey(byte[] par0ArrayOfByte) { + try { +- X509EncodedKeySpec var1 = new X509EncodedKeySpec(var0); ++ X509EncodedKeySpec var1 = new X509EncodedKeySpec(par0ArrayOfByte); + KeyFactory var2 = KeyFactory.getInstance("RSA"); + return var2.generatePublic(var1); + } catch (NoSuchAlgorithmException var3) { +@@ -94,21 +107,33 @@ + return null; + } + +- public static SecretKey decryptSharedKey(PrivateKey var0, byte[] var1) { +- return new SecretKeySpec(decryptData(var0, var1), "AES"); +- } +- +- public static byte[] encryptData(Key var0, byte[] var1) { +- return cipherOperation(1, var0, var1); +- } +- +- public static byte[] decryptData(Key var0, byte[] var1) { +- return cipherOperation(2, var0, var1); +- } +- +- private static byte[] cipherOperation(int var0, Key var1, byte[] var2) { ++ /** ++ * Decrypt shared secret AES key using RSA private key ++ */ ++ public static SecretKey decryptSharedKey(PrivateKey par0PrivateKey, byte[] par1ArrayOfByte) { ++ return new SecretKeySpec(decryptData(par0PrivateKey, par1ArrayOfByte), "AES"); ++ } ++ ++ /** ++ * Encrypt byte[] data with RSA public key ++ */ ++ public static byte[] encryptData(Key par0Key, byte[] par1ArrayOfByte) { ++ return cipherOperation(1, par0Key, par1ArrayOfByte); ++ } ++ ++ /** ++ * Decrypt byte[] data with RSA private key ++ */ ++ public static byte[] decryptData(Key par0Key, byte[] par1ArrayOfByte) { ++ return cipherOperation(2, par0Key, par1ArrayOfByte); ++ } ++ ++ /** ++ * Encrypt or decrypt byte[] data using the specified key ++ */ ++ private static byte[] cipherOperation(int par0, Key par1Key, byte[] par2ArrayOfByte) { + try { +- return createTheCipherInstance(var0, var1.getAlgorithm(), var1).doFinal(var2); ++ return createTheCipherInstance(par0, par1Key.getAlgorithm(), par1Key).doFinal(par2ArrayOfByte); + } catch (IllegalBlockSizeException var4) { + var4.printStackTrace(); + } catch (BadPaddingException var5) { +@@ -119,10 +144,13 @@ + return null; + } + +- private static Cipher createTheCipherInstance(int var0, String var1, Key var2) { ++ /** ++ * Creates the Cipher Instance. ++ */ ++ private static Cipher createTheCipherInstance(int par0, String par1Str, Key par2Key) { + try { +- Cipher var3 = Cipher.getInstance(var1); +- var3.init(var0, var2); ++ Cipher var3 = Cipher.getInstance(par1Str); ++ var3.init(par0, par2Key); + return var3; + } catch (InvalidKeyException var4) { + var4.printStackTrace(); +@@ -136,18 +164,21 @@ + return null; + } + +- private static BufferedBlockCipher createBufferedBlockCipher(boolean var0, Key var1) { ++ /** ++ * Create a new BufferedBlockCipher instance ++ */ ++ private static BufferedBlockCipher createBufferedBlockCipher(boolean par0, Key par1Key) { + BufferedBlockCipher var2 = new BufferedBlockCipher(new CFBBlockCipher(new AESFastEngine(), 8)); +- var2.init(var0, new ParametersWithIV(new KeyParameter(var1.getEncoded()), var1.getEncoded(), 0, 16)); ++ var2.init(par0, new ParametersWithIV(new KeyParameter(par1Key.getEncoded()), par1Key.getEncoded(), 0, 16)); + return var2; + } + +- public static OutputStream encryptOuputStream(SecretKey var0, OutputStream var1) { +- return new CipherOutputStream(var1, createBufferedBlockCipher(true, var0)); ++ public static OutputStream encryptOuputStream(SecretKey par0SecretKey, OutputStream par1OutputStream) { ++ return new CipherOutputStream(par1OutputStream, createBufferedBlockCipher(true, par0SecretKey)); + } + +- public static InputStream decryptInputStream(SecretKey var0, InputStream var1) { +- return new CipherInputStream(var1, createBufferedBlockCipher(false, var0)); ++ public static InputStream decryptInputStream(SecretKey par0SecretKey, InputStream par1InputStream) { ++ return new CipherInputStream(par1InputStream, createBufferedBlockCipher(false, par0SecretKey)); + } + + static { diff --git a/patches/net/minecraft/src/DamageSource.java.patch b/patches/net/minecraft/src/DamageSource.java.patch new file mode 100644 index 0000000..c7a7395 --- /dev/null +++ b/patches/net/minecraft/src/DamageSource.java.patch @@ -0,0 +1,207 @@ +--- net/minecraft/src/DamageSource.java ++++ net/minecraft/src/DamageSource.java +@@ -15,52 +15,80 @@ + public static DamageSource wither = (new DamageSource("wither")).setDamageBypassesArmor(); + public static DamageSource anvil = new DamageSource("anvil"); + public static DamageSource fallingBlock = new DamageSource("fallingBlock"); ++ ++ /** This kind of damage can be blocked or not. */ + private boolean isUnblockable; + private boolean isDamageAllowedInCreativeMode; + private float hungerDamage = 0.3F; ++ ++ /** This kind of damage is based on fire or not. */ + private boolean fireDamage; ++ ++ /** This kind of damage is based on a projectile or not. */ + private boolean projectile; ++ ++ /** ++ * Whether this damage source will have its damage amount scaled based on the current difficulty. ++ */ + private boolean difficultyScaled; + private boolean magicDamage; + private boolean explosion; +- public String o; +- +- public static DamageSource causeMobDamage(EntityLivingBase var0) { +- return new EntityDamageSource("mob", var0); +- } +- +- public static DamageSource causePlayerDamage(EntityPlayer var0) { +- return new EntityDamageSource("player", var0); +- } +- +- public static DamageSource causeArrowDamage(EntityArrow var0, Entity var1) { +- return (new EntityDamageSourceIndirect("arrow", var0, var1)).setProjectile(); +- } +- +- public static DamageSource causeFireballDamage(EntityFireball var0, Entity var1) { +- return var1 == null ? (new EntityDamageSourceIndirect("onFire", var0, var0)).setFireDamage().setProjectile() : (new EntityDamageSourceIndirect("fireball", var0, var1)).setFireDamage().setProjectile(); +- } +- +- public static DamageSource causeThrownDamage(Entity var0, Entity var1) { +- return (new EntityDamageSourceIndirect("thrown", var0, var1)).setProjectile(); +- } +- +- public static DamageSource causeIndirectMagicDamage(Entity var0, Entity var1) { +- return (new EntityDamageSourceIndirect("indirectMagic", var0, var1)).setDamageBypassesArmor().setMagicDamage(); +- } +- +- public static DamageSource causeThornsDamage(Entity var0) { +- return (new EntityDamageSource("thorns", var0)).setMagicDamage(); +- } +- +- public static DamageSource setExplosionSource(Explosion var0) { +- return var0 != null && var0.getExplosivePlacedBy() != null ? (new EntityDamageSource("explosion.player", var0.getExplosivePlacedBy())).setDifficultyScaled().setExplosion() : (new DamageSource("explosion")).setDifficultyScaled().setExplosion(); +- } +- ++ public String damageType; ++ ++ public static DamageSource causeMobDamage(EntityLivingBase par0EntityLivingBase) { ++ return new EntityDamageSource("mob", par0EntityLivingBase); ++ } ++ ++ /** ++ * returns an EntityDamageSource of type player ++ */ ++ public static DamageSource causePlayerDamage(EntityPlayer par0EntityPlayer) { ++ return new EntityDamageSource("player", par0EntityPlayer); ++ } ++ ++ /** ++ * returns EntityDamageSourceIndirect of an arrow ++ */ ++ public static DamageSource causeArrowDamage(EntityArrow par0EntityArrow, Entity par1Entity) { ++ return (new EntityDamageSourceIndirect("arrow", par0EntityArrow, par1Entity)).setProjectile(); ++ } ++ ++ /** ++ * returns EntityDamageSourceIndirect of a fireball ++ */ ++ public static DamageSource causeFireballDamage(EntityFireball par0EntityFireball, Entity par1Entity) { ++ return par1Entity == null ? (new EntityDamageSourceIndirect("onFire", par0EntityFireball, par0EntityFireball)).setFireDamage().setProjectile() : (new EntityDamageSourceIndirect("fireball", par0EntityFireball, par1Entity)).setFireDamage().setProjectile(); ++ } ++ ++ public static DamageSource causeThrownDamage(Entity par0Entity, Entity par1Entity) { ++ return (new EntityDamageSourceIndirect("thrown", par0Entity, par1Entity)).setProjectile(); ++ } ++ ++ public static DamageSource causeIndirectMagicDamage(Entity par0Entity, Entity par1Entity) { ++ return (new EntityDamageSourceIndirect("indirectMagic", par0Entity, par1Entity)).setDamageBypassesArmor().setMagicDamage(); ++ } ++ ++ /** ++ * Returns the EntityDamageSource of the Thorns enchantment ++ */ ++ public static DamageSource causeThornsDamage(Entity par0Entity) { ++ return (new EntityDamageSource("thorns", par0Entity)).setMagicDamage(); ++ } ++ ++ public static DamageSource setExplosionSource(Explosion par0Explosion) { ++ return par0Explosion != null && par0Explosion.getExplosivePlacedBy() != null ? (new EntityDamageSource("explosion.player", par0Explosion.getExplosivePlacedBy())).setDifficultyScaled().setExplosion() : (new DamageSource("explosion")).setDifficultyScaled().setExplosion(); ++ } ++ ++ /** ++ * Returns true if the damage is projectile based. ++ */ + public boolean isProjectile() { + return this.projectile; + } + ++ /** ++ * Define the damage type as projectile based. ++ */ + public DamageSource setProjectile() { + this.projectile = true; + return this; +@@ -79,6 +107,9 @@ + return this.isUnblockable; + } + ++ /** ++ * How much satiate(food) is consumed by this DamageSource ++ */ + public float getHungerDamage() { + return this.hungerDamage; + } +@@ -87,8 +118,8 @@ + return this.isDamageAllowedInCreativeMode; + } + +- protected DamageSource(String var1) { +- this.o = var1; ++ protected DamageSource(String par1Str) { ++ this.damageType = par1Str; + } + + public Entity getSourceOfDamage() { +@@ -110,39 +141,63 @@ + return this; + } + ++ /** ++ * Define the damage type as fire based. ++ */ + protected DamageSource setFireDamage() { + this.fireDamage = true; + return this; + } + +- public ChatMessageComponent getDeathMessage(EntityLivingBase var1) { +- EntityLivingBase var2 = var1.func_94060_bK(); +- String var3 = "death.attack." + this.o; ++ /** ++ * Returns the message to be displayed on player death. ++ */ ++ public ChatMessageComponent getDeathMessage(EntityLivingBase par1EntityLivingBase) { ++ EntityLivingBase var2 = par1EntityLivingBase.func_94060_bK(); ++ String var3 = "death.attack." + this.damageType; + String var4 = var3 + ".player"; +- return var2 != null && StatCollector.func_94522_b(var4) ? ChatMessageComponent.createFromTranslationWithSubstitutions(var4, new Object[]{var1.getTranslatedEntityName(), var2.getTranslatedEntityName()}) : ChatMessageComponent.createFromTranslationWithSubstitutions(var3, new Object[]{var1.getTranslatedEntityName()}); ++ return var2 != null && StatCollector.func_94522_b(var4) ? ChatMessageComponent.createFromTranslationWithSubstitutions(var4, new Object[] {par1EntityLivingBase.getTranslatedEntityName(), var2.getTranslatedEntityName()}): ChatMessageComponent.createFromTranslationWithSubstitutions(var3, new Object[] {par1EntityLivingBase.getTranslatedEntityName()}); + } + ++ /** ++ * Returns true if the damage is fire based. ++ */ + public boolean isFireDamage() { + return this.fireDamage; + } + ++ /** ++ * Return the name of damage type. ++ */ + public String getDamageType() { +- return this.o; ++ return this.damageType; + } + ++ /** ++ * Set whether this damage source will have its damage amount scaled based on the current difficulty. ++ */ + public DamageSource setDifficultyScaled() { + this.difficultyScaled = true; + return this; + } + ++ /** ++ * Return whether this damage source will have its damage amount scaled based on the current difficulty. ++ */ + public boolean isDifficultyScaled() { + return this.difficultyScaled; + } + ++ /** ++ * Returns true if the damage is magic based. ++ */ + public boolean isMagicDamage() { + return this.magicDamage; + } + ++ /** ++ * Define the damage type as magic based. ++ */ + public DamageSource setMagicDamage() { + this.magicDamage = true; + return this; diff --git a/patches/net/minecraft/src/DataWatcher.java.patch b/patches/net/minecraft/src/DataWatcher.java.patch new file mode 100644 index 0000000..ce6574c --- /dev/null +++ b/patches/net/minecraft/src/DataWatcher.java.patch @@ -0,0 +1,471 @@ +--- net/minecraft/src/DataWatcher.java ++++ net/minecraft/src/DataWatcher.java +@@ -12,121 +12,157 @@ + import java.util.concurrent.locks.ReentrantReadWriteLock; + + public class DataWatcher { ++ ++ /** When isBlank is true the DataWatcher is not watching any objects */ + private boolean isBlank = true; +- private static final HashMap b = new HashMap(); +- private final Map c = new HashMap(); ++ private static final HashMap dataTypes = new HashMap(); ++ private final Map watchedObjects = new HashMap(); ++ ++ /** true if one or more object was changed */ + private boolean objectChanged; +- private ReadWriteLock e = new ReentrantReadWriteLock(); +- +- public void addObject(int var1, Object var2) { +- Integer var3 = (Integer)b.get(var2.getClass()); +- if(var3 == null) { +- throw new IllegalArgumentException("Unknown data type: " + var2.getClass()); +- } else if(var1 > 31) { +- throw new IllegalArgumentException("Data value id is too big with " + var1 + "! (Max is " + 31 + ")"); +- } else if(this.c.containsKey(Integer.valueOf(var1))) { +- throw new IllegalArgumentException("Duplicate id value for " + var1 + "!"); ++ private ReadWriteLock lock = new ReentrantReadWriteLock(); ++ ++ /** ++ * adds a new object to dataWatcher to watch, to update an already existing object see updateObject. Arguments: data ++ * Value Id, Object to add ++ */ ++ public void addObject(int par1, Object par2Obj) { ++ Integer var3 = (Integer)dataTypes.get(par2Obj.getClass()); ++ ++ if (var3 == null) { ++ throw new IllegalArgumentException("Unknown data type: " + par2Obj.getClass()); ++ } else if (par1 > 31) { ++ throw new IllegalArgumentException("Data value id is too big with " + par1 + "! (Max is " + 31 + ")"); ++ } else if (this.watchedObjects.containsKey(Integer.valueOf(par1))) { ++ throw new IllegalArgumentException("Duplicate id value for " + par1 + "!"); + } else { +- WatchableObject var4 = new WatchableObject(var3.intValue(), var1, var2); +- this.e.writeLock().lock(); +- this.c.put(Integer.valueOf(var1), var4); +- this.e.writeLock().unlock(); ++ WatchableObject var4 = new WatchableObject(var3.intValue(), par1, par2Obj); ++ this.lock.writeLock().lock(); ++ this.watchedObjects.put(Integer.valueOf(par1), var4); ++ this.lock.writeLock().unlock(); + this.isBlank = false; + } + } + +- public void addObjectByDataType(int var1, int var2) { +- WatchableObject var3 = new WatchableObject(var2, var1, (Object)null); +- this.e.writeLock().lock(); +- this.c.put(Integer.valueOf(var1), var3); +- this.e.writeLock().unlock(); ++ /** ++ * Add a new object for the DataWatcher to watch, using the specified data type. ++ */ ++ public void addObjectByDataType(int par1, int par2) { ++ WatchableObject var3 = new WatchableObject(par2, par1, (Object)null); ++ this.lock.writeLock().lock(); ++ this.watchedObjects.put(Integer.valueOf(par1), var3); ++ this.lock.writeLock().unlock(); + this.isBlank = false; + } + +- public byte getWatchableObjectByte(int var1) { +- return ((Byte)this.getWatchedObject(var1).getObject()).byteValue(); +- } +- +- public short getWatchableObjectShort(int var1) { +- return ((Short)this.getWatchedObject(var1).getObject()).shortValue(); +- } +- +- public int getWatchableObjectInt(int var1) { +- return ((Integer)this.getWatchedObject(var1).getObject()).intValue(); +- } +- +- public float getWatchableObjectFloat(int var1) { +- return ((Float)this.getWatchedObject(var1).getObject()).floatValue(); +- } +- +- public String getWatchableObjectString(int var1) { +- return (String)this.getWatchedObject(var1).getObject(); +- } +- +- public ItemStack getWatchableObjectItemStack(int var1) { +- return (ItemStack)this.getWatchedObject(var1).getObject(); +- } +- +- private WatchableObject getWatchedObject(int var1) { +- this.e.readLock().lock(); +- ++ /** ++ * gets the bytevalue of a watchable object ++ */ ++ public byte getWatchableObjectByte(int par1) { ++ return ((Byte)this.getWatchedObject(par1).getObject()).byteValue(); ++ } ++ ++ public short getWatchableObjectShort(int par1) { ++ return ((Short)this.getWatchedObject(par1).getObject()).shortValue(); ++ } ++ ++ /** ++ * gets a watchable object and returns it as a Integer ++ */ ++ public int getWatchableObjectInt(int par1) { ++ return ((Integer)this.getWatchedObject(par1).getObject()).intValue(); ++ } ++ ++ public float getWatchableObjectFloat(int par1) { ++ return ((Float)this.getWatchedObject(par1).getObject()).floatValue(); ++ } ++ ++ /** ++ * gets a watchable object and returns it as a String ++ */ ++ public String getWatchableObjectString(int par1) { ++ return (String)this.getWatchedObject(par1).getObject(); ++ } ++ ++ /** ++ * Get a watchable object as an ItemStack. ++ */ ++ public ItemStack getWatchableObjectItemStack(int par1) { ++ return (ItemStack)this.getWatchedObject(par1).getObject(); ++ } ++ ++ /** ++ * is threadsafe, unless it throws an exception, then ++ */ ++ private WatchableObject getWatchedObject(int par1) { ++ this.lock.readLock().lock(); + WatchableObject var2; ++ + try { +- var2 = (WatchableObject)this.c.get(Integer.valueOf(var1)); ++ var2 = (WatchableObject)this.watchedObjects.get(Integer.valueOf(par1)); + } catch (Throwable var6) { + CrashReport var4 = CrashReport.makeCrashReport(var6, "Getting synched entity data"); + CrashReportCategory var5 = var4.makeCategory("Synched entity data"); +- var5.addCrashSection("Data ID", Integer.valueOf(var1)); ++ var5.addCrashSection("Data ID", Integer.valueOf(par1)); + throw new ReportedException(var4); + } + +- this.e.readLock().unlock(); ++ this.lock.readLock().unlock(); + return var2; + } + +- public void updateObject(int var1, Object var2) { +- WatchableObject var3 = this.getWatchedObject(var1); +- if(!var2.equals(var3.getObject())) { +- var3.setObject(var2); ++ /** ++ * updates an already existing object ++ */ ++ public void updateObject(int par1, Object par2Obj) { ++ WatchableObject var3 = this.getWatchedObject(par1); ++ ++ if (!par2Obj.equals(var3.getObject())) { ++ var3.setObject(par2Obj); + var3.setWatched(true); + this.objectChanged = true; + } +- + } + +- public void setObjectWatched(int var1) { +- WatchableObject.setWatchableObjectWatched(this.getWatchedObject(var1), true); ++ public void setObjectWatched(int par1) { ++ WatchableObject.setWatchableObjectWatched(this.getWatchedObject(par1), true); + this.objectChanged = true; + } + +- public boolean hasObjectChanged() { ++ public boolean hasChanges() { + return this.objectChanged; + } + +- public static void writeObjectsInListToStream(List var0, DataOutput var1) throws IOException { +- if(var0 != null) { +- Iterator var2 = var0.iterator(); ++ /** ++ * writes every object in passed list to dataoutputstream, terminated by 0x7F ++ */ ++ public static void writeObjectsInListToStream(List par0List, DataOutput par1DataOutput) throws IOException { ++ if (par0List != null) { ++ Iterator var2 = par0List.iterator(); + +- while(var2.hasNext()) { ++ while (var2.hasNext()) { + WatchableObject var3 = (WatchableObject)var2.next(); +- writeWatchableObject(var1, var3); ++ writeWatchableObject(par1DataOutput, var3); + } + } + +- var1.writeByte(127); ++ par1DataOutput.writeByte(127); + } + + public List unwatchAndReturnAllWatched() { + ArrayList var1 = null; +- if(this.objectChanged) { +- this.e.readLock().lock(); +- Iterator var2 = this.c.values().iterator(); +- +- while(var2.hasNext()) { ++ ++ if (this.objectChanged) { ++ this.lock.readLock().lock(); ++ Iterator var2 = this.watchedObjects.values().iterator(); ++ ++ while (var2.hasNext()) { + WatchableObject var3 = (WatchableObject)var2.next(); +- if(var3.isWatched()) { ++ ++ if (var3.isWatched()) { + var3.setWatched(false); +- if(var1 == null) { ++ ++ if (var1 == null) { + var1 = new ArrayList(); + } + +@@ -134,109 +170,123 @@ + } + } + +- this.e.readLock().unlock(); ++ this.lock.readLock().unlock(); + } + + this.objectChanged = false; + return var1; + } + +- public void writeWatchableObjects(DataOutput var1) throws IOException { +- this.e.readLock().lock(); +- Iterator var2 = this.c.values().iterator(); ++ public void writeWatchableObjects(DataOutput par1DataOutput) throws IOException { ++ this.lock.readLock().lock(); ++ Iterator var2 = this.watchedObjects.values().iterator(); + +- while(var2.hasNext()) { ++ while (var2.hasNext()) { + WatchableObject var3 = (WatchableObject)var2.next(); +- writeWatchableObject(var1, var3); ++ writeWatchableObject(par1DataOutput, var3); + } + +- this.e.readLock().unlock(); +- var1.writeByte(127); ++ this.lock.readLock().unlock(); ++ par1DataOutput.writeByte(127); + } + + public List getAllWatched() { + ArrayList var1 = null; +- this.e.readLock().lock(); +- ++ this.lock.readLock().lock(); + WatchableObject var3; +- for(Iterator var2 = this.c.values().iterator(); var2.hasNext(); var1.add(var3)) { ++ ++ for (Iterator var2 = this.watchedObjects.values().iterator(); var2.hasNext(); var1.add(var3)) { + var3 = (WatchableObject)var2.next(); +- if(var1 == null) { ++ ++ if (var1 == null) { + var1 = new ArrayList(); + } + } + +- this.e.readLock().unlock(); ++ this.lock.readLock().unlock(); + return var1; + } + +- private static void writeWatchableObject(DataOutput var0, WatchableObject var1) throws IOException { +- int var2 = (var1.getObjectType() << 5 | var1.getDataValueId() & 31) & 255; +- var0.writeByte(var2); +- switch(var1.getObjectType()) { +- case 0: +- var0.writeByte(((Byte)var1.getObject()).byteValue()); +- break; +- case 1: +- var0.writeShort(((Short)var1.getObject()).shortValue()); +- break; +- case 2: +- var0.writeInt(((Integer)var1.getObject()).intValue()); +- break; +- case 3: +- var0.writeFloat(((Float)var1.getObject()).floatValue()); +- break; +- case 4: +- Packet.writeString((String)var1.getObject(), var0); +- break; +- case 5: +- ItemStack var4 = (ItemStack)var1.getObject(); +- Packet.writeItemStack(var4, var0); +- break; +- case 6: +- ChunkCoordinates var3 = (ChunkCoordinates)var1.getObject(); +- var0.writeInt(var3.posX); +- var0.writeInt(var3.posY); +- var0.writeInt(var3.posZ); +- } +- +- } +- +- public static List readWatchableObjects(DataInput var0) throws IOException { +- ArrayList var1 = null; +- +- for(byte var2 = var0.readByte(); var2 != 127; var2 = var0.readByte()) { +- if(var1 == null) { +- var1 = new ArrayList(); +- } +- +- int var3 = (var2 & 224) >> 5; +- int var4 = var2 & 31; +- WatchableObject var5 = null; +- switch(var3) { ++ private static void writeWatchableObject(DataOutput par0DataOutput, WatchableObject par1WatchableObject) throws IOException { ++ int var2 = (par1WatchableObject.getObjectType() << 5 | par1WatchableObject.getDataValueId() & 31) & 255; ++ par0DataOutput.writeByte(var2); ++ ++ switch (par1WatchableObject.getObjectType()) { + case 0: +- var5 = new WatchableObject(var3, var4, Byte.valueOf(var0.readByte())); ++ par0DataOutput.writeByte(((Byte)par1WatchableObject.getObject()).byteValue()); + break; ++ + case 1: +- var5 = new WatchableObject(var3, var4, Short.valueOf(var0.readShort())); ++ par0DataOutput.writeShort(((Short)par1WatchableObject.getObject()).shortValue()); + break; ++ + case 2: +- var5 = new WatchableObject(var3, var4, Integer.valueOf(var0.readInt())); ++ par0DataOutput.writeInt(((Integer)par1WatchableObject.getObject()).intValue()); + break; ++ + case 3: +- var5 = new WatchableObject(var3, var4, Float.valueOf(var0.readFloat())); ++ par0DataOutput.writeFloat(((Float)par1WatchableObject.getObject()).floatValue()); + break; ++ + case 4: +- var5 = new WatchableObject(var3, var4, Packet.readString(var0, 64)); ++ Packet.writeString((String)par1WatchableObject.getObject(), par0DataOutput); + break; ++ + case 5: +- var5 = new WatchableObject(var3, var4, Packet.readItemStack(var0)); ++ ItemStack var4 = (ItemStack)par1WatchableObject.getObject(); ++ Packet.writeItemStack(var4, par0DataOutput); + break; ++ + case 6: +- int var6 = var0.readInt(); +- int var7 = var0.readInt(); +- int var8 = var0.readInt(); +- var5 = new WatchableObject(var3, var4, new ChunkCoordinates(var6, var7, var8)); ++ ChunkCoordinates var3 = (ChunkCoordinates)par1WatchableObject.getObject(); ++ par0DataOutput.writeInt(var3.posX); ++ par0DataOutput.writeInt(var3.posY); ++ par0DataOutput.writeInt(var3.posZ); ++ } ++ } ++ ++ public static List readWatchableObjects(DataInput par0DataInput) throws IOException { ++ ArrayList var1 = null; ++ ++ for (byte var2 = par0DataInput.readByte(); var2 != 127; var2 = par0DataInput.readByte()) { ++ if (var1 == null) { ++ var1 = new ArrayList(); ++ } ++ ++ int var3 = (var2 & 224) >> 5; ++ int var4 = var2 & 31; ++ WatchableObject var5 = null; ++ ++ switch (var3) { ++ case 0: ++ var5 = new WatchableObject(var3, var4, Byte.valueOf(par0DataInput.readByte())); ++ break; ++ ++ case 1: ++ var5 = new WatchableObject(var3, var4, Short.valueOf(par0DataInput.readShort())); ++ break; ++ ++ case 2: ++ var5 = new WatchableObject(var3, var4, Integer.valueOf(par0DataInput.readInt())); ++ break; ++ ++ case 3: ++ var5 = new WatchableObject(var3, var4, Float.valueOf(par0DataInput.readFloat())); ++ break; ++ ++ case 4: ++ var5 = new WatchableObject(var3, var4, Packet.readString(par0DataInput, 64)); ++ break; ++ ++ case 5: ++ var5 = new WatchableObject(var3, var4, Packet.readItemStack(par0DataInput)); ++ break; ++ ++ case 6: ++ int var6 = par0DataInput.readInt(); ++ int var7 = par0DataInput.readInt(); ++ int var8 = par0DataInput.readInt(); ++ var5 = new WatchableObject(var3, var4, new ChunkCoordinates(var6, var7, var8)); + } + + var1.add(var5); +@@ -245,19 +295,20 @@ + return var1; + } + +- public void updateWatchedObjectsFromList(List var1) { +- this.e.writeLock().lock(); +- Iterator var2 = var1.iterator(); ++ public void updateWatchedObjectsFromList(List par1List) { ++ this.lock.writeLock().lock(); ++ Iterator var2 = par1List.iterator(); + +- while(var2.hasNext()) { ++ while (var2.hasNext()) { + WatchableObject var3 = (WatchableObject)var2.next(); +- WatchableObject var4 = (WatchableObject)this.c.get(Integer.valueOf(var3.getDataValueId())); +- if(var4 != null) { ++ WatchableObject var4 = (WatchableObject)this.watchedObjects.get(Integer.valueOf(var3.getDataValueId())); ++ ++ if (var4 != null) { + var4.setObject(var3.getObject()); + } + } + +- this.e.writeLock().unlock(); ++ this.lock.writeLock().unlock(); + this.objectChanged = true; + } + +@@ -270,12 +321,12 @@ + } + + static { +- b.put(Byte.class, Integer.valueOf(0)); +- b.put(Short.class, Integer.valueOf(1)); +- b.put(Integer.class, Integer.valueOf(2)); +- b.put(Float.class, Integer.valueOf(3)); +- b.put(String.class, Integer.valueOf(4)); +- b.put(ItemStack.class, Integer.valueOf(5)); +- b.put(ChunkCoordinates.class, Integer.valueOf(6)); ++ dataTypes.put(Byte.class, Integer.valueOf(0)); ++ dataTypes.put(Short.class, Integer.valueOf(1)); ++ dataTypes.put(Integer.class, Integer.valueOf(2)); ++ dataTypes.put(Float.class, Integer.valueOf(3)); ++ dataTypes.put(String.class, Integer.valueOf(4)); ++ dataTypes.put(ItemStack.class, Integer.valueOf(5)); ++ dataTypes.put(ChunkCoordinates.class, Integer.valueOf(6)); + } + } diff --git a/patches/net/minecraft/src/DedicatedPlayerList.java.patch b/patches/net/minecraft/src/DedicatedPlayerList.java.patch new file mode 100644 index 0000000..bf2fd87 --- /dev/null +++ b/patches/net/minecraft/src/DedicatedPlayerList.java.patch @@ -0,0 +1,210 @@ +--- net/minecraft/src/DedicatedPlayerList.java ++++ net/minecraft/src/DedicatedPlayerList.java +@@ -9,17 +9,18 @@ + import net.minecraft.server.MinecraftServer; + + public class DedicatedPlayerList extends ServerConfigurationManager { +- private File d; +- private File e; +- +- public DedicatedPlayerList(DedicatedServer var1) { +- super(var1); +- this.d = var1.getFile("ops.txt"); +- this.e = var1.getFile("white-list.txt"); +- this.viewDistance = var1.getIntProperty("view-distance", 10); +- this.maxPlayers = var1.getIntProperty("max-players", 20); +- this.setWhiteListEnabled(var1.getBooleanProperty("white-list", false)); +- if(!var1.isSinglePlayer()) { ++ private File opsList; ++ private File whiteList; ++ ++ public DedicatedPlayerList(DedicatedServer par1DedicatedServer) { ++ super(par1DedicatedServer); ++ this.opsList = par1DedicatedServer.getFile("ops.txt"); ++ this.whiteList = par1DedicatedServer.getFile("white-list.txt"); ++ this.viewDistance = par1DedicatedServer.getIntProperty("view-distance", 10); ++ this.maxPlayers = par1DedicatedServer.getIntProperty("max-players", 20); ++ this.setWhiteListEnabled(par1DedicatedServer.getBooleanProperty("white-list", false)); ++ ++ if (!par1DedicatedServer.isSinglePlayer()) { + this.getBannedPlayers().setListActive(true); + this.getBannedIPs().setListActive(true); + } +@@ -31,38 +32,53 @@ + this.loadOpsList(); + this.readWhiteList(); + this.saveOpsList(); +- if(!this.e.exists()) { ++ ++ if (!this.whiteList.exists()) { + this.saveWhiteList(); + } +- + } + +- public void setWhiteListEnabled(boolean var1) { +- super.setWhiteListEnabled(var1); +- this.getDedicatedServerInstance().setProperty("white-list", Boolean.valueOf(var1)); ++ public void setWhiteListEnabled(boolean par1) { ++ super.setWhiteListEnabled(par1); ++ this.getDedicatedServerInstance().setProperty("white-list", Boolean.valueOf(par1)); + this.getDedicatedServerInstance().saveProperties(); + } + +- public void addOp(String var1) { +- super.addOp(var1); +- this.saveOpsList(); +- } +- +- public void removeOp(String var1) { +- super.removeOp(var1); +- this.saveOpsList(); +- } +- +- public void removeFromWhitelist(String var1) { +- super.removeFromWhitelist(var1); +- this.saveWhiteList(); +- } +- +- public void addToWhiteList(String var1) { +- super.addToWhiteList(var1); +- this.saveWhiteList(); +- } +- ++ /** ++ * This adds a username to the ops list, then saves the op list ++ */ ++ public void addOp(String par1Str) { ++ super.addOp(par1Str); ++ this.saveOpsList(); ++ } ++ ++ /** ++ * This removes a username from the ops list, then saves the op list ++ */ ++ public void removeOp(String par1Str) { ++ super.removeOp(par1Str); ++ this.saveOpsList(); ++ } ++ ++ /** ++ * Remove the specified player from the whitelist. ++ */ ++ public void removeFromWhitelist(String par1Str) { ++ super.removeFromWhitelist(par1Str); ++ this.saveWhiteList(); ++ } ++ ++ /** ++ * Add the specified player to the white list. ++ */ ++ public void addToWhiteList(String par1Str) { ++ super.addToWhiteList(par1Str); ++ this.saveWhiteList(); ++ } ++ ++ /** ++ * Either does nothing, or calls readWhiteList. ++ */ + public void loadWhiteList() { + this.readWhiteList(); + } +@@ -70,30 +86,25 @@ + private void loadOpsList() { + try { + this.getOps().clear(); +- BufferedReader var1 = new BufferedReader(new FileReader(this.d)); ++ BufferedReader var1 = new BufferedReader(new FileReader(this.opsList)); + String var2 = ""; + +- while(true) { +- var2 = var1.readLine(); +- if(var2 == null) { +- var1.close(); +- break; +- } +- ++ while ((var2 = var1.readLine()) != null) { + this.getOps().add(var2.trim().toLowerCase()); + } ++ ++ var1.close(); + } catch (Exception var3) { + this.getDedicatedServerInstance().getLogAgent().logWarning("Failed to load operators list: " + var3); + } +- + } + + private void saveOpsList() { + try { +- PrintWriter var1 = new PrintWriter(new FileWriter(this.d, false)); ++ PrintWriter var1 = new PrintWriter(new FileWriter(this.opsList, false)); + Iterator var2 = this.getOps().iterator(); + +- while(var2.hasNext()) { ++ while (var2.hasNext()) { + String var3 = (String)var2.next(); + var1.println(var3); + } +@@ -102,36 +113,30 @@ + } catch (Exception var4) { + this.getDedicatedServerInstance().getLogAgent().logWarning("Failed to save operators list: " + var4); + } +- + } + + private void readWhiteList() { + try { + this.getWhiteListedPlayers().clear(); +- BufferedReader var1 = new BufferedReader(new FileReader(this.e)); ++ BufferedReader var1 = new BufferedReader(new FileReader(this.whiteList)); + String var2 = ""; + +- while(true) { +- var2 = var1.readLine(); +- if(var2 == null) { +- var1.close(); +- break; +- } +- ++ while ((var2 = var1.readLine()) != null) { + this.getWhiteListedPlayers().add(var2.trim().toLowerCase()); + } ++ ++ var1.close(); + } catch (Exception var3) { + this.getDedicatedServerInstance().getLogAgent().logWarning("Failed to load white-list: " + var3); + } +- + } + + private void saveWhiteList() { + try { +- PrintWriter var1 = new PrintWriter(new FileWriter(this.e, false)); ++ PrintWriter var1 = new PrintWriter(new FileWriter(this.whiteList, false)); + Iterator var2 = this.getWhiteListedPlayers().iterator(); + +- while(var2.hasNext()) { ++ while (var2.hasNext()) { + String var3 = (String)var2.next(); + var1.println(var3); + } +@@ -140,12 +145,14 @@ + } catch (Exception var4) { + this.getDedicatedServerInstance().getLogAgent().logWarning("Failed to save white-list: " + var4); + } +- + } + +- public boolean isAllowedToLogin(String var1) { +- var1 = var1.trim().toLowerCase(); +- return !this.isWhiteListEnabled() || this.isPlayerOpped(var1) || this.getWhiteListedPlayers().contains(var1); ++ /** ++ * Determine if the player is allowed to connect based on current server settings. ++ */ ++ public boolean isAllowedToLogin(String par1Str) { ++ par1Str = par1Str.trim().toLowerCase(); ++ return !this.isWhiteListEnabled() || this.isPlayerOpped(par1Str) || this.getWhiteListedPlayers().contains(par1Str); + } + + public DedicatedServer getDedicatedServerInstance() { diff --git a/patches/net/minecraft/src/DedicatedServer.java.patch b/patches/net/minecraft/src/DedicatedServer.java.patch new file mode 100644 index 0000000..20b13ce --- /dev/null +++ b/patches/net/minecraft/src/DedicatedServer.java.patch @@ -0,0 +1,398 @@ +--- net/minecraft/src/DedicatedServer.java ++++ net/minecraft/src/DedicatedServer.java +@@ -10,7 +10,7 @@ + import net.minecraft.server.MinecraftServer; + + public class DedicatedServer extends MinecraftServer implements IServer { +- private final List l = Collections.synchronizedList(new ArrayList()); ++ private final List pendingCommandList = Collections.synchronizedList(new ArrayList()); + private final ILogAgent field_98131_l; + private RConThreadQuery theRConThreadQuery; + private RConThreadMain theRConThreadMain; +@@ -20,41 +20,47 @@ + private NetworkListenThread networkThread; + private boolean guiIsEnabled; + +- public DedicatedServer(File var1) { +- super(var1); +- this.field_98131_l = new LogAgent("Minecraft-Server", (String)null, (new File(var1, "server.log")).getAbsolutePath()); ++ public DedicatedServer(File par1File) { ++ super(par1File); ++ this.field_98131_l = new LogAgent("Minecraft-Server", (String)null, (new File(par1File, "server.log")).getAbsolutePath()); + new DedicatedServerSleepThread(this); + } + ++ /** ++ * Initialises the server and starts it. ++ */ + protected boolean startServer() throws IOException { + DedicatedServerCommandThread var1 = new DedicatedServerCommandThread(this); + var1.setDaemon(true); + var1.start(); + this.getLogAgent().logInfo("Starting minecraft server version 1.6.4"); +- if(Runtime.getRuntime().maxMemory() / 1024L / 1024L < 512L) { ++ ++ if (Runtime.getRuntime().maxMemory() / 1024L / 1024L < 512L) { + this.getLogAgent().logWarning("To start the server with more ram, launch it as \"java -Xmx1024M -Xms1024M -jar minecraft_server.jar\""); + } + + this.getLogAgent().logInfo("Loading properties"); + this.settings = new PropertyManager(new File("server.properties"), this.getLogAgent()); +- if(this.isSinglePlayer()) { ++ ++ if (this.isSinglePlayer()) { + this.setHostname("127.0.0.1"); + } else { + this.setOnlineMode(this.settings.getBooleanProperty("online-mode", true)); +- this.setHostname(this.settings.getStringProperty("server-ip", "")); ++ this.setHostname(this.settings.getProperty("server-ip", "")); + } + + this.setCanSpawnAnimals(this.settings.getBooleanProperty("spawn-animals", true)); + this.setCanSpawnNPCs(this.settings.getBooleanProperty("spawn-npcs", true)); + this.setAllowPvp(this.settings.getBooleanProperty("pvp", true)); + this.setAllowFlight(this.settings.getBooleanProperty("allow-flight", false)); +- this.setTexturePack(this.settings.getStringProperty("texture-pack", "")); +- this.setMOTD(this.settings.getStringProperty("motd", "A Minecraft Server")); ++ this.setTexturePack(this.settings.getProperty("texture-pack", "")); ++ this.setMOTD(this.settings.getProperty("motd", "A Minecraft Server")); + this.setForceGamemode(this.settings.getBooleanProperty("force-gamemode", false)); + this.func_143006_e(this.settings.getIntProperty("player-idle-timeout", 0)); +- if(this.settings.getIntProperty("difficulty", 1) < 0) { ++ ++ if (this.settings.getIntProperty("difficulty", 1) < 0) { + this.settings.setProperty("difficulty", Integer.valueOf(0)); +- } else if(this.settings.getIntProperty("difficulty", 1) > 3) { ++ } else if (this.settings.getIntProperty("difficulty", 1) > 3) { + this.settings.setProperty("difficulty", Integer.valueOf(3)); + } + +@@ -63,28 +69,29 @@ + this.gameType = WorldSettings.getGameTypeById(var2); + this.getLogAgent().logInfo("Default game type: " + this.gameType); + InetAddress var3 = null; +- if(this.getServerHostname().length() > 0) { ++ ++ if (this.getServerHostname().length() > 0) { + var3 = InetAddress.getByName(this.getServerHostname()); + } + +- if(this.getServerPort() < 0) { ++ if (this.getServerPort() < 0) { + this.setServerPort(this.settings.getIntProperty("server-port", 25565)); + } + + this.getLogAgent().logInfo("Generating keypair"); +- this.setKeyPair(CryptManager.generateKeyPair()); ++ this.setKeyPair(CryptManager.createNewKeyPair()); + this.getLogAgent().logInfo("Starting Minecraft server on " + (this.getServerHostname().length() == 0 ? "*" : this.getServerHostname()) + ":" + this.getServerPort()); + + try { + this.networkThread = new DedicatedServerListenThread(this, var3, this.getServerPort()); + } catch (IOException var16) { + this.getLogAgent().logWarning("**** FAILED TO BIND TO PORT!"); +- this.getLogAgent().logWarningFormatted("The exception was: {0}", new Object[]{var16.toString()}); ++ this.getLogAgent().logWarningFormatted("The exception was: {0}", new Object[] {var16.toString()}); + this.getLogAgent().logWarning("Perhaps a server is already running on that port?"); + return false; + } + +- if(!this.isServerInOnlineMode()) { ++ if (!this.isServerInOnlineMode()) { + this.getLogAgent().logWarning("**** SERVER IS RUNNING IN OFFLINE/INSECURE MODE!"); + this.getLogAgent().logWarning("The server will make no attempt to authenticate usernames. Beware."); + this.getLogAgent().logWarning("While this makes the game possible to play without internet access, it also opens up the ability for hackers to connect with any username they choose."); +@@ -93,18 +100,21 @@ + + this.setConfigurationManager(new DedicatedPlayerList(this)); + long var4 = System.nanoTime(); +- if(this.getFolderName() == null) { +- this.setFolderName(this.settings.getStringProperty("level-name", "world")); ++ ++ if (this.getFolderName() == null) { ++ this.setFolderName(this.settings.getProperty("level-name", "world")); + } + +- String var6 = this.settings.getStringProperty("level-seed", ""); +- String var7 = this.settings.getStringProperty("level-type", "DEFAULT"); +- String var8 = this.settings.getStringProperty("generator-settings", ""); ++ String var6 = this.settings.getProperty("level-seed", ""); ++ String var7 = this.settings.getProperty("level-type", "DEFAULT"); ++ String var8 = this.settings.getProperty("generator-settings", ""); + long var9 = (new Random()).nextLong(); +- if(var6.length() > 0) { ++ ++ if (var6.length() > 0) { + try { + long var11 = Long.parseLong(var6); +- if(var11 != 0L) { ++ ++ if (var11 != 0L) { + var9 = var11; + } + } catch (NumberFormatException var15) { +@@ -113,7 +123,8 @@ + } + + WorldType var17 = WorldType.parseWorldType(var7); +- if(var17 == null) { ++ ++ if (var17 == null) { + var17 = WorldType.DEFAULT; + } + +@@ -124,15 +135,16 @@ + this.getLogAgent().logInfo("Preparing level \"" + this.getFolderName() + "\""); + this.loadAllWorlds(this.getFolderName(), this.getFolderName(), var9, var17, var8); + long var12 = System.nanoTime() - var4; +- String var14 = String.format("%.3fs", new Object[]{Double.valueOf((double)var12 / 1.0E9D)}); ++ String var14 = String.format("%.3fs", new Object[] {Double.valueOf((double)var12 / 1.0E9D)}); + this.getLogAgent().logInfo("Done (" + var14 + ")! For help, type \"help\" or \"?\""); +- if(this.settings.getBooleanProperty("enable-query", false)) { ++ ++ if (this.settings.getBooleanProperty("enable-query", false)) { + this.getLogAgent().logInfo("Starting GS4 status listener"); + this.theRConThreadQuery = new RConThreadQuery(this); + this.theRConThreadQuery.startThread(); + } + +- if(this.settings.getBooleanProperty("enable-rcon", false)) { ++ if (this.settings.getBooleanProperty("enable-rcon", false)) { + this.getLogAgent().logInfo("Starting remote control listener"); + this.theRConThreadMain = new RConThreadMain(this); + this.theRConThreadMain.startThread(); +@@ -149,16 +161,25 @@ + return this.gameType; + } + ++ /** ++ * Defaults to "1" (Easy) for the dedicated server, defaults to "2" (Normal) on the client. ++ */ + public int getDifficulty() { + return this.settings.getIntProperty("difficulty", 1); + } + ++ /** ++ * Defaults to false. ++ */ + public boolean isHardcore() { + return this.settings.getBooleanProperty("hardcore", false); + } + +- protected void finalTick(CrashReport var1) { +- while(this.isServerRunning()) { ++ /** ++ * Called on exit from the main run() loop. ++ */ ++ protected void finalTick(CrashReport par1CrashReport) { ++ while (this.isServerRunning()) { + this.executePendingCommands(); + + try { +@@ -167,21 +188,26 @@ + var3.printStackTrace(); + } + } +- +- } +- +- public CrashReport addServerInfoToCrashReport(CrashReport var1) { +- var1 = super.addServerInfoToCrashReport(var1); +- var1.getCategory().addCrashSectionCallable("Is Modded", new CallableType(this)); +- var1.getCategory().addCrashSectionCallable("Type", new CallableServerType(this)); +- return var1; +- } +- ++ } ++ ++ /** ++ * Adds the server info, including from theWorldServer, to the crash report. ++ */ ++ public CrashReport addServerInfoToCrashReport(CrashReport par1CrashReport) { ++ par1CrashReport = super.addServerInfoToCrashReport(par1CrashReport); ++ par1CrashReport.getCategory().addCrashSectionCallable("Is Modded", new CallableType(this)); ++ par1CrashReport.getCategory().addCrashSectionCallable("Type", new CallableServerType(this)); ++ return par1CrashReport; ++ } ++ ++ /** ++ * Directly calls System.exit(0), instantly killing the program. ++ */ + protected void systemExitNow() { + System.exit(0); + } + +- protected void updateTimeLightAndEntities() { ++ public void updateTimeLightAndEntities() { + super.updateTimeLightAndEntities(); + this.executePendingCommands(); + } +@@ -194,26 +220,28 @@ + return this.settings.getBooleanProperty("spawn-monsters", true); + } + +- public void addServerStatsToSnooper(PlayerUsageSnooper var1) { +- var1.addData("whitelist_enabled", Boolean.valueOf(this.getDedicatedPlayerList().isWhiteListEnabled())); +- var1.addData("whitelist_count", Integer.valueOf(this.getDedicatedPlayerList().getWhiteListedPlayers().size())); +- super.addServerStatsToSnooper(var1); ++ public void addServerStatsToSnooper(PlayerUsageSnooper par1PlayerUsageSnooper) { ++ par1PlayerUsageSnooper.addData("whitelist_enabled", Boolean.valueOf(this.getDedicatedPlayerList().isWhiteListEnabled())); ++ par1PlayerUsageSnooper.addData("whitelist_count", Integer.valueOf(this.getDedicatedPlayerList().getWhiteListedPlayers().size())); ++ super.addServerStatsToSnooper(par1PlayerUsageSnooper); + } + ++ /** ++ * Returns whether snooping is enabled or not. ++ */ + public boolean isSnooperEnabled() { + return this.settings.getBooleanProperty("snooper-enabled", true); + } + +- public void addPendingCommand(String var1, ICommandSender var2) { +- this.l.add(new ServerCommand(var1, var2)); ++ public void addPendingCommand(String par1Str, ICommandSender par2ICommandSender) { ++ this.pendingCommandList.add(new ServerCommand(par1Str, par2ICommandSender)); + } + + public void executePendingCommands() { +- while(!this.l.isEmpty()) { +- ServerCommand var1 = (ServerCommand)this.l.remove(0); +- this.getCommandManager().executeCommand(var1.sender, var1.a); ++ while (!this.pendingCommandList.isEmpty()) { ++ ServerCommand var1 = (ServerCommand)this.pendingCommandList.remove(0); ++ this.getCommandManager().executeCommand(var1.sender, var1.command); + } +- + } + + public boolean isDedicatedServer() { +@@ -228,26 +256,44 @@ + return this.networkThread; + } + +- public int getIntProperty(String var1, int var2) { +- return this.settings.getIntProperty(var1, var2); +- } +- +- public String getStringProperty(String var1, String var2) { +- return this.settings.getStringProperty(var1, var2); +- } +- +- public boolean getBooleanProperty(String var1, boolean var2) { +- return this.settings.getBooleanProperty(var1, var2); +- } +- +- public void setProperty(String var1, Object var2) { +- this.settings.setProperty(var1, var2); +- } +- ++ /** ++ * Gets an integer property. If it does not exist, set it to the specified value. ++ */ ++ public int getIntProperty(String par1Str, int par2) { ++ return this.settings.getIntProperty(par1Str, par2); ++ } ++ ++ /** ++ * Gets a string property. If it does not exist, set it to the specified value. ++ */ ++ public String getStringProperty(String par1Str, String par2Str) { ++ return this.settings.getProperty(par1Str, par2Str); ++ } ++ ++ /** ++ * Gets a boolean property. If it does not exist, set it to the specified value. ++ */ ++ public boolean getBooleanProperty(String par1Str, boolean par2) { ++ return this.settings.getBooleanProperty(par1Str, par2); ++ } ++ ++ /** ++ * Saves an Object with the given property name. ++ */ ++ public void setProperty(String par1Str, Object par2Obj) { ++ this.settings.setProperty(par1Str, par2Obj); ++ } ++ ++ /** ++ * Saves all of the server properties to the properties file. ++ */ + public void saveProperties() { + this.settings.saveProperties(); + } + ++ /** ++ * Returns the filename where server properties are stored ++ */ + public String getSettingsFilename() { + File var1 = this.settings.getPropertiesFile(); + return var1 != null ? var1.getAbsolutePath() : "No settings file"; +@@ -257,31 +303,43 @@ + return this.guiIsEnabled; + } + +- public String shareToLAN(EnumGameType var1, boolean var2) { ++ /** ++ * On dedicated does nothing. On integrated, sets commandsAllowedForAll, gameType and allows external connections. ++ */ ++ public String shareToLAN(EnumGameType par1EnumGameType, boolean par2) { + return ""; + } + ++ /** ++ * Return whether command blocks are enabled. ++ */ + public boolean isCommandBlockEnabled() { + return this.settings.getBooleanProperty("enable-command-block", false); + } + ++ /** ++ * Return the spawn protection area's size. ++ */ + public int getSpawnProtectionSize() { + return this.settings.getIntProperty("spawn-protection", super.getSpawnProtectionSize()); + } + +- public boolean isBlockProtected(World var1, int var2, int var3, int var4, EntityPlayer var5) { +- if(var1.provider.dimensionId != 0) { +- return false; +- } else if(this.getDedicatedPlayerList().getOps().isEmpty()) { +- return false; +- } else if(this.getDedicatedPlayerList().isPlayerOpped(var5.getCommandSenderName())) { +- return false; +- } else if(this.getSpawnProtectionSize() <= 0) { ++ /** ++ * Returns true if a player does not have permission to edit the block at the given coordinates. ++ */ ++ public boolean isBlockProtected(World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer) { ++ if (par1World.provider.dimensionId != 0) { ++ return false; ++ } else if (this.getDedicatedPlayerList().getOps().isEmpty()) { ++ return false; ++ } else if (this.getDedicatedPlayerList().isPlayerOpped(par5EntityPlayer.getCommandSenderName())) { ++ return false; ++ } else if (this.getSpawnProtectionSize() <= 0) { + return false; + } else { +- ChunkCoordinates var6 = var1.getSpawnPoint(); +- int var7 = MathHelper.abs_int(var2 - var6.posX); +- int var8 = MathHelper.abs_int(var4 - var6.posZ); ++ ChunkCoordinates var6 = par1World.getSpawnPoint(); ++ int var7 = MathHelper.abs_int(par2 - var6.posX); ++ int var8 = MathHelper.abs_int(par4 - var6.posZ); + int var9 = Math.max(var7, var8); + return var9 <= this.getSpawnProtectionSize(); + } +@@ -295,9 +353,9 @@ + return this.settings.getIntProperty("op-permission-level", 4); + } + +- public void func_143006_e(int var1) { +- super.func_143006_e(var1); +- this.settings.setProperty("player-idle-timeout", Integer.valueOf(var1)); ++ public void func_143006_e(int par1) { ++ super.func_143006_e(par1); ++ this.settings.setProperty("player-idle-timeout", Integer.valueOf(par1)); + this.saveProperties(); + } + diff --git a/patches/net/minecraft/src/DedicatedServerCommandThread.java.patch b/patches/net/minecraft/src/DedicatedServerCommandThread.java.patch new file mode 100644 index 0000000..76f63bd --- /dev/null +++ b/patches/net/minecraft/src/DedicatedServerCommandThread.java.patch @@ -0,0 +1,32 @@ +--- net/minecraft/src/DedicatedServerCommandThread.java ++++ net/minecraft/src/DedicatedServerCommandThread.java +@@ -7,25 +7,20 @@ + class DedicatedServerCommandThread extends Thread { + final DedicatedServer server; + +- DedicatedServerCommandThread(DedicatedServer var1) { +- this.server = var1; ++ DedicatedServerCommandThread(DedicatedServer par1DedicatedServer) { ++ this.server = par1DedicatedServer; + } + + public void run() { + BufferedReader var1 = new BufferedReader(new InputStreamReader(System.in)); ++ String var2; + + try { +- while(!this.server.isServerStopped() && this.server.isServerRunning()) { +- String var2 = var1.readLine(); +- if(var2 == null) { +- break; +- } +- ++ while (!this.server.isServerStopped() && this.server.isServerRunning() && (var2 = var1.readLine()) != null) { + this.server.addPendingCommand(var2, this.server); + } + } catch (IOException var4) { + var4.printStackTrace(); + } +- + } + } diff --git a/patches/net/minecraft/src/DedicatedServerListenThread.java.patch b/patches/net/minecraft/src/DedicatedServerListenThread.java.patch new file mode 100644 index 0000000..4034a45 --- /dev/null +++ b/patches/net/minecraft/src/DedicatedServerListenThread.java.patch @@ -0,0 +1,48 @@ +--- net/minecraft/src/DedicatedServerListenThread.java ++++ net/minecraft/src/DedicatedServerListenThread.java +@@ -1,14 +1,17 @@ + package net.minecraft.src; + ++import java.io.IOException; + import java.net.InetAddress; + import net.minecraft.server.MinecraftServer; + + public class DedicatedServerListenThread extends NetworkListenThread { ++ ++ /** Instance of ServerListenThread. */ + private final ServerListenThread theServerListenThread; + +- public DedicatedServerListenThread(MinecraftServer var1, InetAddress var2, int var3) { +- super(var1); +- this.theServerListenThread = new ServerListenThread(this, var2, var3); ++ public DedicatedServerListenThread(MinecraftServer par1MinecraftServer, InetAddress par2InetAddress, int par3) throws IOException { ++ super(par1MinecraftServer); ++ this.theServerListenThread = new ServerListenThread(this, par2InetAddress, par3); + this.theServerListenThread.start(); + } + +@@ -18,17 +21,20 @@ + this.theServerListenThread.interrupt(); + } + +- public void handleNetworkListenThread() { ++ /** ++ * processes packets and pending connections ++ */ ++ public void networkTick() { + this.theServerListenThread.processPendingConnections(); +- super.handleNetworkListenThread(); ++ super.networkTick(); + } + + public DedicatedServer getDedicatedServer() { + return (DedicatedServer)super.getServer(); + } + +- public void func_71761_a(InetAddress var1) { +- this.theServerListenThread.func_71769_a(var1); ++ public void func_71761_a(InetAddress par1InetAddress) { ++ this.theServerListenThread.func_71769_a(par1InetAddress); + } + + public MinecraftServer getServer() { diff --git a/patches/net/minecraft/src/DedicatedServerSleepThread.java.patch b/patches/net/minecraft/src/DedicatedServerSleepThread.java.patch new file mode 100644 index 0000000..c0879f9 --- /dev/null +++ b/patches/net/minecraft/src/DedicatedServerSleepThread.java.patch @@ -0,0 +1,31 @@ +--- net/minecraft/src/DedicatedServerSleepThread.java ++++ net/minecraft/src/DedicatedServerSleepThread.java +@@ -1,19 +1,24 @@ + package net.minecraft.src; + + class DedicatedServerSleepThread extends Thread { ++ ++ /** Instance of the DecitatedServer. */ + final DedicatedServer theDecitatedServer; + +- DedicatedServerSleepThread(DedicatedServer var1) { +- this.theDecitatedServer = var1; ++ DedicatedServerSleepThread(DedicatedServer par1DedicatedServer) { ++ this.theDecitatedServer = par1DedicatedServer; + this.setDaemon(true); + this.start(); + } + + public void run() { +- while(true) { ++ while (true) { + try { +- Thread.sleep(2147483647L); ++ while (true) { ++ Thread.sleep(2147483647L); ++ } + } catch (InterruptedException var2) { ++ ; + } + } + } diff --git a/patches/net/minecraft/src/DefaultResourcePack.java.patch b/patches/net/minecraft/src/DefaultResourcePack.java.patch new file mode 100644 index 0000000..d31a4e1 --- /dev/null +++ b/patches/net/minecraft/src/DefaultResourcePack.java.patch @@ -0,0 +1,97 @@ +--- net/minecraft/src/DefaultResourcePack.java ++++ net/minecraft/src/DefaultResourcePack.java +@@ -13,62 +13,63 @@ + import javax.imageio.ImageIO; + + public class DefaultResourcePack implements ResourcePack { +- public static final Set a = ImmutableSet.of("minecraft"); +- private final Map b = Maps.newHashMap(); +- private final File c; ++ public static final Set defaultResourceDomains = ImmutableSet.of("minecraft"); ++ private final Map mapResourceFiles = Maps.newHashMap(); ++ public final File fileAssets; + +- public DefaultResourcePack(File var1) { +- this.c = var1; +- this.readAssetsDir(this.c); ++ public DefaultResourcePack(File par1File) { ++ this.fileAssets = par1File; ++ this.readAssetsDir(this.fileAssets); + } + +- public InputStream getInputStream(ResourceLocation var1) throws IOException { +- InputStream var2 = this.getResourceStream(var1); +- if(var2 != null) { ++ public InputStream getInputStream(ResourceLocation par1ResourceLocation) throws IOException { ++ InputStream var2 = this.getResourceStream(par1ResourceLocation); ++ ++ if (var2 != null) { + return var2; + } else { +- File var3 = (File)this.b.get(var1.toString()); +- if(var3 != null) { ++ File var3 = (File)this.mapResourceFiles.get(par1ResourceLocation.toString()); ++ ++ if (var3 != null) { + return new FileInputStream(var3); + } else { +- throw new FileNotFoundException(var1.getResourcePath()); ++ throw new FileNotFoundException(par1ResourceLocation.getResourcePath()); + } + } + } + +- private InputStream getResourceStream(ResourceLocation var1) { +- return DefaultResourcePack.class.getResourceAsStream("/assets/minecraft/" + var1.getResourcePath()); +- } +- +- public void addResourceFile(String var1, File var2) { +- this.b.put((new ResourceLocation(var1)).toString(), var2); +- } +- +- public boolean resourceExists(ResourceLocation var1) { +- return this.getResourceStream(var1) != null || this.b.containsKey(var1.toString()); ++ private InputStream getResourceStream(ResourceLocation par1ResourceLocation) { ++ return DefaultResourcePack.class.getResourceAsStream("/assets/minecraft/" + par1ResourceLocation.getResourcePath()); ++ } ++ ++ public void addResourceFile(String par1Str, File par2File) { ++ this.mapResourceFiles.put((new ResourceLocation(par1Str)).toString(), par2File); ++ } ++ ++ public boolean resourceExists(ResourceLocation par1ResourceLocation) { ++ return this.getResourceStream(par1ResourceLocation) != null || this.mapResourceFiles.containsKey(par1ResourceLocation.toString()); + } + + public Set getResourceDomains() { +- return a; ++ return defaultResourceDomains; + } + +- public void readAssetsDir(File var1) { +- if(var1.isDirectory()) { +- File[] var2 = var1.listFiles(); ++ public void readAssetsDir(File par1File) { ++ if (par1File.isDirectory()) { ++ File[] var2 = par1File.listFiles(); + int var3 = var2.length; + +- for(int var4 = 0; var4 < var3; ++var4) { ++ for (int var4 = 0; var4 < var3; ++var4) { + File var5 = var2[var4]; + this.readAssetsDir(var5); + } + } else { +- this.addResourceFile(AbstractResourcePack.getRelativeName(this.c, var1), var1); ++ this.addResourceFile(AbstractResourcePack.getRelativeName(this.fileAssets, par1File), par1File); + } +- + } + +- public MetadataSection getPackMetadata(MetadataSerializer var1, String var2) throws IOException { +- return AbstractResourcePack.readMetadata(var1, DefaultResourcePack.class.getResourceAsStream("/" + (new ResourceLocation("pack.mcmeta")).getResourcePath()), var2); ++ public MetadataSection getPackMetadata(MetadataSerializer par1MetadataSerializer, String par2Str) throws IOException { ++ return AbstractResourcePack.readMetadata(par1MetadataSerializer, DefaultResourcePack.class.getResourceAsStream("/" + (new ResourceLocation("pack.mcmeta")).getResourcePath()), par2Str); + } + + public BufferedImage getPackImage() throws IOException { diff --git a/patches/net/minecraft/src/DemoWorldManager.java.patch b/patches/net/minecraft/src/DemoWorldManager.java.patch new file mode 100644 index 0000000..ed03209 --- /dev/null +++ b/patches/net/minecraft/src/DemoWorldManager.java.patch @@ -0,0 +1,157 @@ +--- net/minecraft/src/DemoWorldManager.java ++++ net/minecraft/src/DemoWorldManager.java +@@ -6,8 +6,8 @@ + private int field_73104_e; + private int field_73102_f; + +- public DemoWorldManager(World var1) { +- super(var1); ++ public DemoWorldManager(World par1World) { ++ super(par1World); + } + + public void updateBlockRemoving() { +@@ -15,75 +15,92 @@ + ++this.field_73102_f; + long var1 = this.theWorld.getTotalWorldTime(); + long var3 = var1 / 24000L + 1L; +- if(!this.field_73105_c && this.field_73102_f > 20) { ++ ++ if (!this.field_73105_c && this.field_73102_f > 20) { + this.field_73105_c = true; +- this.thisPlayerMP.playerNetServerHandler.sendPacket(new Packet70GameEvent(5, 0)); ++ this.thisPlayerMP.playerNetServerHandler.sendPacketToPlayer(new Packet70GameEvent(5, 0)); + } + + this.demoTimeExpired = var1 > 120500L; +- if(this.demoTimeExpired) { ++ ++ if (this.demoTimeExpired) { + ++this.field_73104_e; + } + +- if(var1 % 24000L == 500L) { +- if(var3 <= 6L) { ++ if (var1 % 24000L == 500L) { ++ if (var3 <= 6L) { + this.thisPlayerMP.sendChatToPlayer(ChatMessageComponent.createFromTranslationKey("demo.day." + var3)); + } +- } else if(var3 == 1L) { +- if(var1 == 100L) { +- this.thisPlayerMP.playerNetServerHandler.sendPacket(new Packet70GameEvent(5, 101)); +- } else if(var1 == 175L) { +- this.thisPlayerMP.playerNetServerHandler.sendPacket(new Packet70GameEvent(5, 102)); +- } else if(var1 == 250L) { +- this.thisPlayerMP.playerNetServerHandler.sendPacket(new Packet70GameEvent(5, 103)); ++ } else if (var3 == 1L) { ++ if (var1 == 100L) { ++ this.thisPlayerMP.playerNetServerHandler.sendPacketToPlayer(new Packet70GameEvent(5, 101)); ++ } else if (var1 == 175L) { ++ this.thisPlayerMP.playerNetServerHandler.sendPacketToPlayer(new Packet70GameEvent(5, 102)); ++ } else if (var1 == 250L) { ++ this.thisPlayerMP.playerNetServerHandler.sendPacketToPlayer(new Packet70GameEvent(5, 103)); + } +- } else if(var3 == 5L && var1 % 24000L == 22000L) { ++ } else if (var3 == 5L && var1 % 24000L == 22000L) { + this.thisPlayerMP.sendChatToPlayer(ChatMessageComponent.createFromTranslationKey("demo.day.warning")); + } +- + } + ++ /** ++ * Sends a message to the player reminding them that this is the demo version ++ */ + private void sendDemoReminder() { +- if(this.field_73104_e > 100) { ++ if (this.field_73104_e > 100) { + this.thisPlayerMP.sendChatToPlayer(ChatMessageComponent.createFromTranslationKey("demo.reminder")); + this.field_73104_e = 0; + } +- +- } +- +- public void onBlockClicked(int var1, int var2, int var3, int var4) { +- if(this.demoTimeExpired) { +- this.sendDemoReminder(); +- } else { +- super.onBlockClicked(var1, var2, var3, var4); +- } +- } +- +- public void blockRemoving(int var1, int var2, int var3) { +- if(!this.demoTimeExpired) { +- super.blockRemoving(var1, var2, var3); +- } +- } +- +- public boolean tryHarvestBlock(int var1, int var2, int var3) { +- return this.demoTimeExpired ? false : super.tryHarvestBlock(var1, var2, var3); +- } +- +- public boolean tryUseItem(EntityPlayer var1, World var2, ItemStack var3) { +- if(this.demoTimeExpired) { +- this.sendDemoReminder(); +- return false; +- } else { +- return super.tryUseItem(var1, var2, var3); +- } +- } +- +- public boolean activateBlockOrUseItem(EntityPlayer var1, World var2, ItemStack var3, int var4, int var5, int var6, int var7, float var8, float var9, float var10) { +- if(this.demoTimeExpired) { +- this.sendDemoReminder(); +- return false; +- } else { +- return super.activateBlockOrUseItem(var1, var2, var3, var4, var5, var6, var7, var8, var9, var10); ++ } ++ ++ /** ++ * if not creative, it calls destroyBlockInWorldPartially untill the block is broken first. par4 is the specific side. ++ * tryHarvestBlock can also be the result of this call ++ */ ++ public void onBlockClicked(int par1, int par2, int par3, int par4) { ++ if (this.demoTimeExpired) { ++ this.sendDemoReminder(); ++ } else { ++ super.onBlockClicked(par1, par2, par3, par4); ++ } ++ } ++ ++ public void uncheckedTryHarvestBlock(int par1, int par2, int par3) { ++ if (!this.demoTimeExpired) { ++ super.uncheckedTryHarvestBlock(par1, par2, par3); ++ } ++ } ++ ++ /** ++ * Attempts to harvest a block at the given coordinate ++ */ ++ public boolean tryHarvestBlock(int par1, int par2, int par3) { ++ return this.demoTimeExpired ? false : super.tryHarvestBlock(par1, par2, par3); ++ } ++ ++ /** ++ * Attempts to right-click use an item by the given EntityPlayer in the given World ++ */ ++ public boolean tryUseItem(EntityPlayer par1EntityPlayer, World par2World, ItemStack par3ItemStack) { ++ if (this.demoTimeExpired) { ++ this.sendDemoReminder(); ++ return false; ++ } else { ++ return super.tryUseItem(par1EntityPlayer, par2World, par3ItemStack); ++ } ++ } ++ ++ /** ++ * Activate the clicked on block, otherwise use the held item. Args: player, world, itemStack, x, y, z, side, xOffset, ++ * yOffset, zOffset ++ */ ++ public boolean activateBlockOrUseItem(EntityPlayer par1EntityPlayer, World par2World, ItemStack par3ItemStack, int par4, int par5, int par6, int par7, float par8, float par9, float par10) { ++ if (this.demoTimeExpired) { ++ this.sendDemoReminder(); ++ return false; ++ } else { ++ return super.activateBlockOrUseItem(par1EntityPlayer, par2World, par3ItemStack, par4, par5, par6, par7, par8, par9, par10); + } + } + } diff --git a/patches/net/minecraft/src/DemoWorldServer.java.patch b/patches/net/minecraft/src/DemoWorldServer.java.patch new file mode 100644 index 0000000..e975434 --- /dev/null +++ b/patches/net/minecraft/src/DemoWorldServer.java.patch @@ -0,0 +1,12 @@ +--- net/minecraft/src/DemoWorldServer.java ++++ net/minecraft/src/DemoWorldServer.java +@@ -6,7 +6,7 @@ + private static final long demoWorldSeed = (long)"North Carolina".hashCode(); + public static final WorldSettings demoWorldSettings = (new WorldSettings(demoWorldSeed, EnumGameType.SURVIVAL, true, false, WorldType.DEFAULT)).enableBonusChest(); + +- public DemoWorldServer(MinecraftServer var1, ISaveHandler var2, String var3, int var4, Profiler var5, ILogAgent var6) { +- super(var1, var2, var3, var4, demoWorldSettings, var5, var6); ++ public DemoWorldServer(MinecraftServer par1MinecraftServer, ISaveHandler par2ISaveHandler, String par3Str, int par4, Profiler par5Profiler, ILogAgent par6ILogAgent) { ++ super(par1MinecraftServer, par2ISaveHandler, par3Str, par4, demoWorldSettings, par5Profiler, par6ILogAgent); + } + } diff --git a/patches/net/minecraft/src/DerivedWorldInfo.java.patch b/patches/net/minecraft/src/DerivedWorldInfo.java.patch new file mode 100644 index 0000000..9ad1755 --- /dev/null +++ b/patches/net/minecraft/src/DerivedWorldInfo.java.patch @@ -0,0 +1,284 @@ +--- net/minecraft/src/DerivedWorldInfo.java ++++ net/minecraft/src/DerivedWorldInfo.java +@@ -1,32 +1,52 @@ + package net.minecraft.src; + + public class DerivedWorldInfo extends WorldInfo { ++ ++ /** Instance of WorldInfo. */ + private final WorldInfo theWorldInfo; + +- public DerivedWorldInfo(WorldInfo var1) { +- this.theWorldInfo = var1; ++ public DerivedWorldInfo(WorldInfo par1WorldInfo) { ++ this.theWorldInfo = par1WorldInfo; + } + ++ /** ++ * Gets the NBTTagCompound for the worldInfo ++ */ + public NBTTagCompound getNBTTagCompound() { + return this.theWorldInfo.getNBTTagCompound(); + } + +- public NBTTagCompound cloneNBTCompound(NBTTagCompound var1) { +- return this.theWorldInfo.cloneNBTCompound(var1); ++ /** ++ * Creates a new NBTTagCompound for the world, with the given NBTTag as the "Player" ++ */ ++ public NBTTagCompound cloneNBTCompound(NBTTagCompound par1NBTTagCompound) { ++ return this.theWorldInfo.cloneNBTCompound(par1NBTTagCompound); + } + ++ /** ++ * Returns the seed of current world. ++ */ + public long getSeed() { + return this.theWorldInfo.getSeed(); + } + ++ /** ++ * Returns the x spawn position ++ */ + public int getSpawnX() { + return this.theWorldInfo.getSpawnX(); + } + ++ /** ++ * Return the Y axis spawning point of the player. ++ */ + public int getSpawnY() { + return this.theWorldInfo.getSpawnY(); + } + ++ /** ++ * Returns the z spawn position ++ */ + public int getSpawnZ() { + return this.theWorldInfo.getSpawnZ(); + } +@@ -35,6 +55,9 @@ + return this.theWorldInfo.getWorldTotalTime(); + } + ++ /** ++ * Get current world time ++ */ + public long getWorldTime() { + return this.theWorldInfo.getWorldTime(); + } +@@ -43,86 +66,141 @@ + return this.theWorldInfo.getSizeOnDisk(); + } + ++ /** ++ * Returns the player's NBTTagCompound to be loaded ++ */ + public NBTTagCompound getPlayerNBTTagCompound() { + return this.theWorldInfo.getPlayerNBTTagCompound(); + } + +- public int getDimension() { +- return this.theWorldInfo.getDimension(); ++ /** ++ * Returns vanilla MC dimension (-1,0,1). For custom dimension compatibility, always prefer WorldProvider.dimensionID ++ * accessed from World.provider.dimensionID ++ */ ++ public int getVanillaDimension() { ++ return this.theWorldInfo.getVanillaDimension(); + } + ++ /** ++ * Get current world name ++ */ + public String getWorldName() { + return this.theWorldInfo.getWorldName(); + } + ++ /** ++ * Returns the save version of this world ++ */ + public int getSaveVersion() { + return this.theWorldInfo.getSaveVersion(); + } + ++ /** ++ * Return the last time the player was in this world. ++ */ + public long getLastTimePlayed() { + return this.theWorldInfo.getLastTimePlayed(); + } + ++ /** ++ * Returns true if it is thundering, false otherwise. ++ */ + public boolean isThundering() { + return this.theWorldInfo.isThundering(); + } + ++ /** ++ * Returns the number of ticks until next thunderbolt. ++ */ + public int getThunderTime() { + return this.theWorldInfo.getThunderTime(); + } + ++ /** ++ * Returns true if it is raining, false otherwise. ++ */ + public boolean isRaining() { + return this.theWorldInfo.isRaining(); + } + ++ /** ++ * Return the number of ticks until rain. ++ */ + public int getRainTime() { + return this.theWorldInfo.getRainTime(); + } + ++ /** ++ * Gets the GameType. ++ */ + public EnumGameType getGameType() { + return this.theWorldInfo.getGameType(); + } + +- public void setSpawnX(int var1) { +- } +- +- public void setSpawnY(int var1) { +- } +- +- public void setSpawnZ(int var1) { +- } +- +- public void incrementTotalWorldTime(long var1) { +- } +- +- public void setWorldTime(long var1) { +- } +- +- public void setSpawnPosition(int var1, int var2, int var3) { +- } +- +- public void setWorldName(String var1) { +- } +- +- public void setSaveVersion(int var1) { +- } +- +- public void setThundering(boolean var1) { +- } +- +- public void setThunderTime(int var1) { +- } +- +- public void setRaining(boolean var1) { +- } +- +- public void setRainTime(int var1) { +- } +- ++ /** ++ * Set the x spawn position to the passed in value ++ */ ++ public void setSpawnX(int par1) {} ++ ++ /** ++ * Sets the y spawn position ++ */ ++ public void setSpawnY(int par1) {} ++ ++ /** ++ * Set the z spawn position to the passed in value ++ */ ++ public void setSpawnZ(int par1) {} ++ ++ public void incrementTotalWorldTime(long par1) {} ++ ++ /** ++ * Set current world time ++ */ ++ public void setWorldTime(long par1) {} ++ ++ /** ++ * Sets the spawn zone position. Args: x, y, z ++ */ ++ public void setSpawnPosition(int par1, int par2, int par3) {} ++ ++ public void setWorldName(String par1Str) {} ++ ++ /** ++ * Sets the save version of the world ++ */ ++ public void setSaveVersion(int par1) {} ++ ++ /** ++ * Sets whether it is thundering or not. ++ */ ++ public void setThundering(boolean par1) {} ++ ++ /** ++ * Defines the number of ticks until next thunderbolt. ++ */ ++ public void setThunderTime(int par1) {} ++ ++ /** ++ * Sets whether it is raining or not. ++ */ ++ public void setRaining(boolean par1) {} ++ ++ /** ++ * Sets the number of ticks until rain. ++ */ ++ public void setRainTime(int par1) {} ++ ++ /** ++ * Get whether the map features (e.g. strongholds) generation is enabled or disabled. ++ */ + public boolean isMapFeaturesEnabled() { + return this.theWorldInfo.isMapFeaturesEnabled(); + } + ++ /** ++ * Returns true if hardcore mode is enabled, otherwise false ++ */ + public boolean isHardcoreModeEnabled() { + return this.theWorldInfo.isHardcoreModeEnabled(); + } +@@ -131,20 +209,30 @@ + return this.theWorldInfo.getTerrainType(); + } + +- public void setTerrainType(WorldType var1) { +- } ++ public void setTerrainType(WorldType par1WorldType) {} + ++ /** ++ * Returns true if commands are allowed on this World. ++ */ + public boolean areCommandsAllowed() { + return this.theWorldInfo.areCommandsAllowed(); + } + ++ /** ++ * Returns true if the World is initialized. ++ */ + public boolean isInitialized() { + return this.theWorldInfo.isInitialized(); + } + +- public void setServerInitialized(boolean var1) { +- } ++ /** ++ * Sets the initialization status of the World. ++ */ ++ public void setServerInitialized(boolean par1) {} + ++ /** ++ * Gets the GameRules class Instance. ++ */ + public GameRules getGameRulesInstance() { + return this.theWorldInfo.getGameRulesInstance(); + } diff --git a/patches/net/minecraft/src/DestroyBlockProgress.java.patch b/patches/net/minecraft/src/DestroyBlockProgress.java.patch new file mode 100644 index 0000000..e124b9c --- /dev/null +++ b/patches/net/minecraft/src/DestroyBlockProgress.java.patch @@ -0,0 +1,78 @@ +--- net/minecraft/src/DestroyBlockProgress.java ++++ net/minecraft/src/DestroyBlockProgress.java +@@ -1,18 +1,31 @@ + package net.minecraft.src; + + public class DestroyBlockProgress { ++ ++ /** ++ * entity ID of the player associated with this partially destroyed Block. Used to identify the Blocks in the client ++ * Renderer, max 1 per player on a server ++ */ + private final int miningPlayerEntId; + private final int partialBlockX; + private final int partialBlockY; + private final int partialBlockZ; ++ ++ /** ++ * damage ranges from 1 to 10. -1 causes the client to delete the partial block renderer. ++ */ + private int partialBlockProgress; ++ ++ /** ++ * keeps track of how many ticks this PartiallyDestroyedBlock already exists ++ */ + private int createdAtCloudUpdateTick; + +- public DestroyBlockProgress(int var1, int var2, int var3, int var4) { +- this.miningPlayerEntId = var1; +- this.partialBlockX = var2; +- this.partialBlockY = var3; +- this.partialBlockZ = var4; ++ public DestroyBlockProgress(int par1, int par2, int par3, int par4) { ++ this.miningPlayerEntId = par1; ++ this.partialBlockX = par2; ++ this.partialBlockY = par3; ++ this.partialBlockZ = par4; + } + + public int getPartialBlockX() { +@@ -27,22 +40,32 @@ + return this.partialBlockZ; + } + +- public void setPartialBlockDamage(int var1) { +- if(var1 > 10) { +- var1 = 10; ++ /** ++ * inserts damage value into this partially destroyed Block. -1 causes client renderer to delete it, otherwise ranges ++ * from 1 to 10 ++ */ ++ public void setPartialBlockDamage(int par1) { ++ if (par1 > 10) { ++ par1 = 10; + } + +- this.partialBlockProgress = var1; ++ this.partialBlockProgress = par1; + } + + public int getPartialBlockDamage() { + return this.partialBlockProgress; + } + +- public void setCloudUpdateTick(int var1) { +- this.createdAtCloudUpdateTick = var1; ++ /** ++ * saves the current Cloud update tick into the PartiallyDestroyedBlock ++ */ ++ public void setCloudUpdateTick(int par1) { ++ this.createdAtCloudUpdateTick = par1; + } + ++ /** ++ * retrieves the 'date' at which the PartiallyDestroyedBlock was created ++ */ + public int getCreationCloudUpdateTick() { + return this.createdAtCloudUpdateTick; + } diff --git a/patches/net/minecraft/src/Direction.java.patch b/patches/net/minecraft/src/Direction.java.patch new file mode 100644 index 0000000..cc1b3c9 --- /dev/null +++ b/patches/net/minecraft/src/Direction.java.patch @@ -0,0 +1,45 @@ +--- net/minecraft/src/Direction.java ++++ net/minecraft/src/Direction.java +@@ -1,17 +1,30 @@ + package net.minecraft.src; + + public class Direction { +- public static final int[] offsetX = new int[]{0, -1, 0, 1}; +- public static final int[] offsetZ = new int[]{1, 0, -1, 0}; +- public static final String[] c = new String[]{"SOUTH", "WEST", "NORTH", "EAST"}; +- public static final int[] directionToFacing = new int[]{3, 4, 2, 5}; +- public static final int[] facingToDirection = new int[]{-1, -1, 2, 0, 1, 3}; +- public static final int[] rotateOpposite = new int[]{2, 3, 0, 1}; +- public static final int[] enderEyeMetaToDirection = new int[]{1, 2, 3, 0}; +- public static final int[] rotateLeft = new int[]{3, 0, 1, 2}; +- public static final int[][] bedDirection = new int[][]{{1, 0, 3, 2, 5, 4}, {1, 0, 5, 4, 2, 3}, {1, 0, 2, 3, 4, 5}, {1, 0, 4, 5, 3, 2}}; +- +- public static int getMovementDirection(double var0, double var2) { +- return MathHelper.abs((float)var0) > MathHelper.abs((float)var2) ? (var0 > 0.0D ? 1 : 3) : (var2 > 0.0D ? 2 : 0); ++ public static final int[] offsetX = new int[] {0, -1, 0, 1}; ++ public static final int[] offsetZ = new int[] {1, 0, -1, 0}; ++ public static final String[] directions = new String[] {"SOUTH", "WEST", "NORTH", "EAST"}; ++ ++ /** Maps a Direction value (2D) to a Facing value (3D). */ ++ public static final int[] directionToFacing = new int[] {3, 4, 2, 5}; ++ ++ /** Maps a Facing value (3D) to a Direction value (2D). */ ++ public static final int[] facingToDirection = new int[] { -1, -1, 2, 0, 1, 3}; ++ ++ /** Maps a direction to that opposite of it. */ ++ public static final int[] rotateOpposite = new int[] {2, 3, 0, 1}; ++ ++ /** Maps a direction to that to the right of it. */ ++ public static final int[] rotateRight = new int[] {1, 2, 3, 0}; ++ ++ /** Maps a direction to that to the left of it. */ ++ public static final int[] rotateLeft = new int[] {3, 0, 1, 2}; ++ public static final int[][] bedDirection = new int[][] {{1, 0, 3, 2, 5, 4}, {1, 0, 5, 4, 2, 3}, {1, 0, 2, 3, 4, 5}, {1, 0, 4, 5, 3, 2}}; ++ ++ /** ++ * Returns the movement direction from a velocity vector. ++ */ ++ public static int getMovementDirection(double par0, double par2) { ++ return MathHelper.abs((float)par0) > MathHelper.abs((float)par2) ? (par0 > 0.0D ? 1 : 3) : (par2 > 0.0D ? 2 : 0); + } + } diff --git a/patches/net/minecraft/src/DispenserBehaviorArrow.java.patch b/patches/net/minecraft/src/DispenserBehaviorArrow.java.patch new file mode 100644 index 0000000..507d132 --- /dev/null +++ b/patches/net/minecraft/src/DispenserBehaviorArrow.java.patch @@ -0,0 +1,17 @@ +--- net/minecraft/src/DispenserBehaviorArrow.java ++++ net/minecraft/src/DispenserBehaviorArrow.java +@@ -1,8 +1,12 @@ + package net.minecraft.src; + + final class DispenserBehaviorArrow extends BehaviorProjectileDispense { +- protected IProjectile getProjectileEntity(World var1, IPosition var2) { +- EntityArrow var3 = new EntityArrow(var1, var2.getX(), var2.getY(), var2.getZ()); ++ ++ /** ++ * Return the projectile entity spawned by this dispense behavior. ++ */ ++ protected IProjectile getProjectileEntity(World par1World, IPosition par2IPosition) { ++ EntityArrow var3 = new EntityArrow(par1World, par2IPosition.getX(), par2IPosition.getY(), par2IPosition.getZ()); + var3.canBePickedUp = 1; + return var3; + } diff --git a/patches/net/minecraft/src/DispenserBehaviorBoat.java.patch b/patches/net/minecraft/src/DispenserBehaviorBoat.java.patch new file mode 100644 index 0000000..0bc85b7 --- /dev/null +++ b/patches/net/minecraft/src/DispenserBehaviorBoat.java.patch @@ -0,0 +1,60 @@ +--- net/minecraft/src/DispenserBehaviorBoat.java ++++ net/minecraft/src/DispenserBehaviorBoat.java +@@ -3,22 +3,26 @@ + final class DispenserBehaviorBoat extends BehaviorDefaultDispenseItem { + private final BehaviorDefaultDispenseItem defaultDispenserItemBehavior = new BehaviorDefaultDispenseItem(); + +- public ItemStack dispenseStack(IBlockSource var1, ItemStack var2) { +- EnumFacing var3 = BlockDispenser.getFacing(var1.getBlockMetadata()); +- World var4 = var1.getWorld(); +- double var5 = var1.getX() + (double)((float)var3.getFrontOffsetX() * 1.125F); +- double var7 = var1.getY() + (double)((float)var3.getFrontOffsetY() * 1.125F); +- double var9 = var1.getZ() + (double)((float)var3.getFrontOffsetZ() * 1.125F); +- int var11 = var1.getXInt() + var3.getFrontOffsetX(); +- int var12 = var1.getYInt() + var3.getFrontOffsetY(); +- int var13 = var1.getZInt() + var3.getFrontOffsetZ(); ++ /** ++ * Dispense the specified stack, play the dispense sound and spawn particles. ++ */ ++ public ItemStack dispenseStack(IBlockSource par1IBlockSource, ItemStack par2ItemStack) { ++ EnumFacing var3 = BlockDispenser.getFacing(par1IBlockSource.getBlockMetadata()); ++ World var4 = par1IBlockSource.getWorld(); ++ double var5 = par1IBlockSource.getX() + (double)((float)var3.getFrontOffsetX() * 1.125F); ++ double var7 = par1IBlockSource.getY() + (double)((float)var3.getFrontOffsetY() * 1.125F); ++ double var9 = par1IBlockSource.getZ() + (double)((float)var3.getFrontOffsetZ() * 1.125F); ++ int var11 = par1IBlockSource.getXInt() + var3.getFrontOffsetX(); ++ int var12 = par1IBlockSource.getYInt() + var3.getFrontOffsetY(); ++ int var13 = par1IBlockSource.getZInt() + var3.getFrontOffsetZ(); + Material var14 = var4.getBlockMaterial(var11, var12, var13); + double var15; +- if(Material.water.equals(var14)) { ++ ++ if (Material.water.equals(var14)) { + var15 = 1.0D; + } else { +- if(!Material.air.equals(var14) || !Material.water.equals(var4.getBlockMaterial(var11, var12 - 1, var13))) { +- return this.defaultDispenserItemBehavior.dispense(var1, var2); ++ if (!Material.air.equals(var14) || !Material.water.equals(var4.getBlockMaterial(var11, var12 - 1, var13))) { ++ return this.defaultDispenserItemBehavior.dispense(par1IBlockSource, par2ItemStack); + } + + var15 = 0.0D; +@@ -26,11 +30,14 @@ + + EntityBoat var17 = new EntityBoat(var4, var5, var7 + var15, var9); + var4.spawnEntityInWorld(var17); +- var2.splitStack(1); +- return var2; ++ par2ItemStack.splitStack(1); ++ return par2ItemStack; + } + +- protected void playDispenseSound(IBlockSource var1) { +- var1.getWorld().playAuxSFX(1000, var1.getXInt(), var1.getYInt(), var1.getZInt(), 0); ++ /** ++ * Play the dispense sound from the specified block. ++ */ ++ protected void playDispenseSound(IBlockSource par1IBlockSource) { ++ par1IBlockSource.getWorld().playAuxSFX(1000, par1IBlockSource.getXInt(), par1IBlockSource.getYInt(), par1IBlockSource.getZInt(), 0); + } + } diff --git a/patches/net/minecraft/src/DispenserBehaviorDye.java.patch b/patches/net/minecraft/src/DispenserBehaviorDye.java.patch new file mode 100644 index 0000000..6b209a2 --- /dev/null +++ b/patches/net/minecraft/src/DispenserBehaviorDye.java.patch @@ -0,0 +1,58 @@ +--- net/minecraft/src/DispenserBehaviorDye.java ++++ net/minecraft/src/DispenserBehaviorDye.java +@@ -3,33 +3,39 @@ + final class DispenserBehaviorDye extends BehaviorDefaultDispenseItem { + private boolean field_96461_b = true; + +- protected ItemStack dispenseStack(IBlockSource var1, ItemStack var2) { +- if(var2.getItemDamage() == 15) { +- EnumFacing var3 = BlockDispenser.getFacing(var1.getBlockMetadata()); +- World var4 = var1.getWorld(); +- int var5 = var1.getXInt() + var3.getFrontOffsetX(); +- int var6 = var1.getYInt() + var3.getFrontOffsetY(); +- int var7 = var1.getZInt() + var3.getFrontOffsetZ(); +- if(ItemDye.func_96604_a(var2, var4, var5, var6, var7)) { +- if(!var4.isRemote) { ++ /** ++ * Dispense the specified stack, play the dispense sound and spawn particles. ++ */ ++ protected ItemStack dispenseStack(IBlockSource par1IBlockSource, ItemStack par2ItemStack) { ++ if (par2ItemStack.getItemDamage() == 15) { ++ EnumFacing var3 = BlockDispenser.getFacing(par1IBlockSource.getBlockMetadata()); ++ World var4 = par1IBlockSource.getWorld(); ++ int var5 = par1IBlockSource.getXInt() + var3.getFrontOffsetX(); ++ int var6 = par1IBlockSource.getYInt() + var3.getFrontOffsetY(); ++ int var7 = par1IBlockSource.getZInt() + var3.getFrontOffsetZ(); ++ ++ if (ItemDye.func_96604_a(par2ItemStack, var4, var5, var6, var7)) { ++ if (!var4.isRemote) { + var4.playAuxSFX(2005, var5, var6, var7, 0); + } + } else { + this.field_96461_b = false; + } + +- return var2; ++ return par2ItemStack; + } else { +- return super.dispenseStack(var1, var2); ++ return super.dispenseStack(par1IBlockSource, par2ItemStack); + } + } + +- protected void playDispenseSound(IBlockSource var1) { +- if(this.field_96461_b) { +- var1.getWorld().playAuxSFX(1000, var1.getXInt(), var1.getYInt(), var1.getZInt(), 0); ++ /** ++ * Play the dispense sound from the specified block. ++ */ ++ protected void playDispenseSound(IBlockSource par1IBlockSource) { ++ if (this.field_96461_b) { ++ par1IBlockSource.getWorld().playAuxSFX(1000, par1IBlockSource.getXInt(), par1IBlockSource.getYInt(), par1IBlockSource.getZInt(), 0); + } else { +- var1.getWorld().playAuxSFX(1001, var1.getXInt(), var1.getYInt(), var1.getZInt(), 0); ++ par1IBlockSource.getWorld().playAuxSFX(1001, par1IBlockSource.getXInt(), par1IBlockSource.getYInt(), par1IBlockSource.getZInt(), 0); + } +- + } + } diff --git a/patches/net/minecraft/src/DispenserBehaviorEgg.java.patch b/patches/net/minecraft/src/DispenserBehaviorEgg.java.patch new file mode 100644 index 0000000..438ea02 --- /dev/null +++ b/patches/net/minecraft/src/DispenserBehaviorEgg.java.patch @@ -0,0 +1,16 @@ +--- net/minecraft/src/DispenserBehaviorEgg.java ++++ net/minecraft/src/DispenserBehaviorEgg.java +@@ -1,7 +1,11 @@ + package net.minecraft.src; + + final class DispenserBehaviorEgg extends BehaviorProjectileDispense { +- protected IProjectile getProjectileEntity(World var1, IPosition var2) { +- return new EntityEgg(var1, var2.getX(), var2.getY(), var2.getZ()); ++ ++ /** ++ * Return the projectile entity spawned by this dispense behavior. ++ */ ++ protected IProjectile getProjectileEntity(World par1World, IPosition par2IPosition) { ++ return new EntityEgg(par1World, par2IPosition.getX(), par2IPosition.getY(), par2IPosition.getZ()); + } + } diff --git a/patches/net/minecraft/src/DispenserBehaviorEmptyBucket.java.patch b/patches/net/minecraft/src/DispenserBehaviorEmptyBucket.java.patch new file mode 100644 index 0000000..9b20061 --- /dev/null +++ b/patches/net/minecraft/src/DispenserBehaviorEmptyBucket.java.patch @@ -0,0 +1,56 @@ +--- net/minecraft/src/DispenserBehaviorEmptyBucket.java ++++ net/minecraft/src/DispenserBehaviorEmptyBucket.java +@@ -3,33 +3,38 @@ + final class DispenserBehaviorEmptyBucket extends BehaviorDefaultDispenseItem { + private final BehaviorDefaultDispenseItem defaultDispenserItemBehavior = new BehaviorDefaultDispenseItem(); + +- public ItemStack dispenseStack(IBlockSource var1, ItemStack var2) { +- EnumFacing var3 = BlockDispenser.getFacing(var1.getBlockMetadata()); +- World var4 = var1.getWorld(); +- int var5 = var1.getXInt() + var3.getFrontOffsetX(); +- int var6 = var1.getYInt() + var3.getFrontOffsetY(); +- int var7 = var1.getZInt() + var3.getFrontOffsetZ(); ++ /** ++ * Dispense the specified stack, play the dispense sound and spawn particles. ++ */ ++ public ItemStack dispenseStack(IBlockSource par1IBlockSource, ItemStack par2ItemStack) { ++ EnumFacing var3 = BlockDispenser.getFacing(par1IBlockSource.getBlockMetadata()); ++ World var4 = par1IBlockSource.getWorld(); ++ int var5 = par1IBlockSource.getXInt() + var3.getFrontOffsetX(); ++ int var6 = par1IBlockSource.getYInt() + var3.getFrontOffsetY(); ++ int var7 = par1IBlockSource.getZInt() + var3.getFrontOffsetZ(); + Material var8 = var4.getBlockMaterial(var5, var6, var7); + int var9 = var4.getBlockMetadata(var5, var6, var7); + Item var10; +- if(Material.water.equals(var8) && var9 == 0) { ++ ++ if (Material.water.equals(var8) && var9 == 0) { + var10 = Item.bucketWater; + } else { +- if(!Material.lava.equals(var8) || var9 != 0) { +- return super.dispenseStack(var1, var2); ++ if (!Material.lava.equals(var8) || var9 != 0) { ++ return super.dispenseStack(par1IBlockSource, par2ItemStack); + } + + var10 = Item.bucketLava; + } + + var4.setBlockToAir(var5, var6, var7); +- if(--var2.stackSize == 0) { +- var2.itemID = var10.itemID; +- var2.stackSize = 1; +- } else if(((TileEntityDispenser)var1.getBlockTileEntity()).addItem(new ItemStack(var10)) < 0) { +- this.defaultDispenserItemBehavior.dispense(var1, new ItemStack(var10)); ++ ++ if (--par2ItemStack.stackSize == 0) { ++ par2ItemStack.itemID = var10.itemID; ++ par2ItemStack.stackSize = 1; ++ } else if (((TileEntityDispenser)par1IBlockSource.getBlockTileEntity()).addItem(new ItemStack(var10)) < 0) { ++ this.defaultDispenserItemBehavior.dispense(par1IBlockSource, new ItemStack(var10)); + } + +- return var2; ++ return par2ItemStack; + } + } diff --git a/patches/net/minecraft/src/DispenserBehaviorExperience.java.patch b/patches/net/minecraft/src/DispenserBehaviorExperience.java.patch new file mode 100644 index 0000000..bf9d335 --- /dev/null +++ b/patches/net/minecraft/src/DispenserBehaviorExperience.java.patch @@ -0,0 +1,17 @@ +--- net/minecraft/src/DispenserBehaviorExperience.java ++++ net/minecraft/src/DispenserBehaviorExperience.java +@@ -1,8 +1,12 @@ + package net.minecraft.src; + + final class DispenserBehaviorExperience extends BehaviorProjectileDispense { +- protected IProjectile getProjectileEntity(World var1, IPosition var2) { +- return new EntityExpBottle(var1, var2.getX(), var2.getY(), var2.getZ()); ++ ++ /** ++ * Return the projectile entity spawned by this dispense behavior. ++ */ ++ protected IProjectile getProjectileEntity(World par1World, IPosition par2IPosition) { ++ return new EntityExpBottle(par1World, par2IPosition.getX(), par2IPosition.getY(), par2IPosition.getZ()); + } + + protected float func_82498_a() { diff --git a/patches/net/minecraft/src/DispenserBehaviorFilledBucket.java.patch b/patches/net/minecraft/src/DispenserBehaviorFilledBucket.java.patch new file mode 100644 index 0000000..bca7318 --- /dev/null +++ b/patches/net/minecraft/src/DispenserBehaviorFilledBucket.java.patch @@ -0,0 +1,36 @@ +--- net/minecraft/src/DispenserBehaviorFilledBucket.java ++++ net/minecraft/src/DispenserBehaviorFilledBucket.java +@@ -3,18 +3,22 @@ + final class DispenserBehaviorFilledBucket extends BehaviorDefaultDispenseItem { + private final BehaviorDefaultDispenseItem defaultDispenserItemBehavior = new BehaviorDefaultDispenseItem(); + +- public ItemStack dispenseStack(IBlockSource var1, ItemStack var2) { +- ItemBucket var3 = (ItemBucket)var2.getItem(); +- int var4 = var1.getXInt(); +- int var5 = var1.getYInt(); +- int var6 = var1.getZInt(); +- EnumFacing var7 = BlockDispenser.getFacing(var1.getBlockMetadata()); +- if(var3.tryPlaceContainedLiquid(var1.getWorld(), var4 + var7.getFrontOffsetX(), var5 + var7.getFrontOffsetY(), var6 + var7.getFrontOffsetZ())) { +- var2.itemID = Item.bucketEmpty.itemID; +- var2.stackSize = 1; +- return var2; ++ /** ++ * Dispense the specified stack, play the dispense sound and spawn particles. ++ */ ++ public ItemStack dispenseStack(IBlockSource par1IBlockSource, ItemStack par2ItemStack) { ++ ItemBucket var3 = (ItemBucket)par2ItemStack.getItem(); ++ int var4 = par1IBlockSource.getXInt(); ++ int var5 = par1IBlockSource.getYInt(); ++ int var6 = par1IBlockSource.getZInt(); ++ EnumFacing var7 = BlockDispenser.getFacing(par1IBlockSource.getBlockMetadata()); ++ ++ if (var3.tryPlaceContainedLiquid(par1IBlockSource.getWorld(), var4 + var7.getFrontOffsetX(), var5 + var7.getFrontOffsetY(), var6 + var7.getFrontOffsetZ())) { ++ par2ItemStack.itemID = Item.bucketEmpty.itemID; ++ par2ItemStack.stackSize = 1; ++ return par2ItemStack; + } else { +- return this.defaultDispenserItemBehavior.dispense(var1, var2); ++ return this.defaultDispenserItemBehavior.dispense(par1IBlockSource, par2ItemStack); + } + } + } diff --git a/patches/net/minecraft/src/DispenserBehaviorFire.java.patch b/patches/net/minecraft/src/DispenserBehaviorFire.java.patch new file mode 100644 index 0000000..db40b76 --- /dev/null +++ b/patches/net/minecraft/src/DispenserBehaviorFire.java.patch @@ -0,0 +1,59 @@ +--- net/minecraft/src/DispenserBehaviorFire.java ++++ net/minecraft/src/DispenserBehaviorFire.java +@@ -3,33 +3,40 @@ + final class DispenserBehaviorFire extends BehaviorDefaultDispenseItem { + private boolean field_96466_b = true; + +- protected ItemStack dispenseStack(IBlockSource var1, ItemStack var2) { +- EnumFacing var3 = BlockDispenser.getFacing(var1.getBlockMetadata()); +- World var4 = var1.getWorld(); +- int var5 = var1.getXInt() + var3.getFrontOffsetX(); +- int var6 = var1.getYInt() + var3.getFrontOffsetY(); +- int var7 = var1.getZInt() + var3.getFrontOffsetZ(); +- if(var4.isAirBlock(var5, var6, var7)) { ++ /** ++ * Dispense the specified stack, play the dispense sound and spawn particles. ++ */ ++ protected ItemStack dispenseStack(IBlockSource par1IBlockSource, ItemStack par2ItemStack) { ++ EnumFacing var3 = BlockDispenser.getFacing(par1IBlockSource.getBlockMetadata()); ++ World var4 = par1IBlockSource.getWorld(); ++ int var5 = par1IBlockSource.getXInt() + var3.getFrontOffsetX(); ++ int var6 = par1IBlockSource.getYInt() + var3.getFrontOffsetY(); ++ int var7 = par1IBlockSource.getZInt() + var3.getFrontOffsetZ(); ++ ++ if (var4.isAirBlock(var5, var6, var7)) { + var4.setBlock(var5, var6, var7, Block.fire.blockID); +- if(var2.attemptDamageItem(1, var4.s)) { +- var2.stackSize = 0; ++ ++ if (par2ItemStack.attemptDamageItem(1, var4.rand)) { ++ par2ItemStack.stackSize = 0; + } +- } else if(var4.getBlockId(var5, var6, var7) == Block.tnt.blockID) { ++ } else if (var4.getBlockId(var5, var6, var7) == Block.tnt.blockID) { + Block.tnt.onBlockDestroyedByPlayer(var4, var5, var6, var7, 1); + var4.setBlockToAir(var5, var6, var7); + } else { + this.field_96466_b = false; + } + +- return var2; ++ return par2ItemStack; + } + +- protected void playDispenseSound(IBlockSource var1) { +- if(this.field_96466_b) { +- var1.getWorld().playAuxSFX(1000, var1.getXInt(), var1.getYInt(), var1.getZInt(), 0); ++ /** ++ * Play the dispense sound from the specified block. ++ */ ++ protected void playDispenseSound(IBlockSource par1IBlockSource) { ++ if (this.field_96466_b) { ++ par1IBlockSource.getWorld().playAuxSFX(1000, par1IBlockSource.getXInt(), par1IBlockSource.getYInt(), par1IBlockSource.getZInt(), 0); + } else { +- var1.getWorld().playAuxSFX(1001, var1.getXInt(), var1.getYInt(), var1.getZInt(), 0); ++ par1IBlockSource.getWorld().playAuxSFX(1001, par1IBlockSource.getXInt(), par1IBlockSource.getYInt(), par1IBlockSource.getZInt(), 0); + } +- + } + } diff --git a/patches/net/minecraft/src/DispenserBehaviorFireball.java.patch b/patches/net/minecraft/src/DispenserBehaviorFireball.java.patch new file mode 100644 index 0000000..86806ad --- /dev/null +++ b/patches/net/minecraft/src/DispenserBehaviorFireball.java.patch @@ -0,0 +1,42 @@ +--- net/minecraft/src/DispenserBehaviorFireball.java ++++ net/minecraft/src/DispenserBehaviorFireball.java +@@ -3,23 +3,30 @@ + import java.util.Random; + + final class DispenserBehaviorFireball extends BehaviorDefaultDispenseItem { +- public ItemStack dispenseStack(IBlockSource var1, ItemStack var2) { +- EnumFacing var3 = BlockDispenser.getFacing(var1.getBlockMetadata()); +- IPosition var4 = BlockDispenser.getIPositionFromBlockSource(var1); ++ ++ /** ++ * Dispense the specified stack, play the dispense sound and spawn particles. ++ */ ++ public ItemStack dispenseStack(IBlockSource par1IBlockSource, ItemStack par2ItemStack) { ++ EnumFacing var3 = BlockDispenser.getFacing(par1IBlockSource.getBlockMetadata()); ++ IPosition var4 = BlockDispenser.getIPositionFromBlockSource(par1IBlockSource); + double var5 = var4.getX() + (double)((float)var3.getFrontOffsetX() * 0.3F); + double var7 = var4.getY() + (double)((float)var3.getFrontOffsetX() * 0.3F); + double var9 = var4.getZ() + (double)((float)var3.getFrontOffsetZ() * 0.3F); +- World var11 = var1.getWorld(); +- Random var12 = var11.s; ++ World var11 = par1IBlockSource.getWorld(); ++ Random var12 = var11.rand; + double var13 = var12.nextGaussian() * 0.05D + (double)var3.getFrontOffsetX(); + double var15 = var12.nextGaussian() * 0.05D + (double)var3.getFrontOffsetY(); + double var17 = var12.nextGaussian() * 0.05D + (double)var3.getFrontOffsetZ(); + var11.spawnEntityInWorld(new EntitySmallFireball(var11, var5, var7, var9, var13, var15, var17)); +- var2.splitStack(1); +- return var2; ++ par2ItemStack.splitStack(1); ++ return par2ItemStack; + } + +- protected void playDispenseSound(IBlockSource var1) { +- var1.getWorld().playAuxSFX(1009, var1.getXInt(), var1.getYInt(), var1.getZInt(), 0); ++ /** ++ * Play the dispense sound from the specified block. ++ */ ++ protected void playDispenseSound(IBlockSource par1IBlockSource) { ++ par1IBlockSource.getWorld().playAuxSFX(1009, par1IBlockSource.getXInt(), par1IBlockSource.getYInt(), par1IBlockSource.getZInt(), 0); + } + } diff --git a/patches/net/minecraft/src/DispenserBehaviorFireworks.java.patch b/patches/net/minecraft/src/DispenserBehaviorFireworks.java.patch new file mode 100644 index 0000000..7cf4287 --- /dev/null +++ b/patches/net/minecraft/src/DispenserBehaviorFireworks.java.patch @@ -0,0 +1,39 @@ +--- net/minecraft/src/DispenserBehaviorFireworks.java ++++ net/minecraft/src/DispenserBehaviorFireworks.java +@@ -1,18 +1,25 @@ + package net.minecraft.src; + + final class DispenserBehaviorFireworks extends BehaviorDefaultDispenseItem { +- public ItemStack dispenseStack(IBlockSource var1, ItemStack var2) { +- EnumFacing var3 = BlockDispenser.getFacing(var1.getBlockMetadata()); +- double var4 = var1.getX() + (double)var3.getFrontOffsetX(); +- double var6 = (double)((float)var1.getYInt() + 0.2F); +- double var8 = var1.getZ() + (double)var3.getFrontOffsetZ(); +- EntityFireworkRocket var10 = new EntityFireworkRocket(var1.getWorld(), var4, var6, var8, var2); +- var1.getWorld().spawnEntityInWorld(var10); +- var2.splitStack(1); +- return var2; ++ ++ /** ++ * Dispense the specified stack, play the dispense sound and spawn particles. ++ */ ++ public ItemStack dispenseStack(IBlockSource par1IBlockSource, ItemStack par2ItemStack) { ++ EnumFacing var3 = BlockDispenser.getFacing(par1IBlockSource.getBlockMetadata()); ++ double var4 = par1IBlockSource.getX() + (double)var3.getFrontOffsetX(); ++ double var6 = (double)((float)par1IBlockSource.getYInt() + 0.2F); ++ double var8 = par1IBlockSource.getZ() + (double)var3.getFrontOffsetZ(); ++ EntityFireworkRocket var10 = new EntityFireworkRocket(par1IBlockSource.getWorld(), var4, var6, var8, par2ItemStack); ++ par1IBlockSource.getWorld().spawnEntityInWorld(var10); ++ par2ItemStack.splitStack(1); ++ return par2ItemStack; + } + +- protected void playDispenseSound(IBlockSource var1) { +- var1.getWorld().playAuxSFX(1002, var1.getXInt(), var1.getYInt(), var1.getZInt(), 0); ++ /** ++ * Play the dispense sound from the specified block. ++ */ ++ protected void playDispenseSound(IBlockSource par1IBlockSource) { ++ par1IBlockSource.getWorld().playAuxSFX(1002, par1IBlockSource.getXInt(), par1IBlockSource.getYInt(), par1IBlockSource.getZInt(), 0); + } + } diff --git a/patches/net/minecraft/src/DispenserBehaviorMobEgg.java.patch b/patches/net/minecraft/src/DispenserBehaviorMobEgg.java.patch new file mode 100644 index 0000000..026d0d7 --- /dev/null +++ b/patches/net/minecraft/src/DispenserBehaviorMobEgg.java.patch @@ -0,0 +1,35 @@ +--- net/minecraft/src/DispenserBehaviorMobEgg.java ++++ net/minecraft/src/DispenserBehaviorMobEgg.java +@@ -1,17 +1,22 @@ + package net.minecraft.src; + + final class DispenserBehaviorMobEgg extends BehaviorDefaultDispenseItem { +- public ItemStack dispenseStack(IBlockSource var1, ItemStack var2) { +- EnumFacing var3 = BlockDispenser.getFacing(var1.getBlockMetadata()); +- double var4 = var1.getX() + (double)var3.getFrontOffsetX(); +- double var6 = (double)((float)var1.getYInt() + 0.2F); +- double var8 = var1.getZ() + (double)var3.getFrontOffsetZ(); +- Entity var10 = ItemMonsterPlacer.spawnCreature(var1.getWorld(), var2.getItemDamage(), var4, var6, var8); +- if(var10 instanceof EntityLivingBase && var2.hasDisplayName()) { +- ((EntityLiving)var10).setCustomNameTag(var2.getDisplayName()); ++ ++ /** ++ * Dispense the specified stack, play the dispense sound and spawn particles. ++ */ ++ public ItemStack dispenseStack(IBlockSource par1IBlockSource, ItemStack par2ItemStack) { ++ EnumFacing var3 = BlockDispenser.getFacing(par1IBlockSource.getBlockMetadata()); ++ double var4 = par1IBlockSource.getX() + (double)var3.getFrontOffsetX(); ++ double var6 = (double)((float)par1IBlockSource.getYInt() + 0.2F); ++ double var8 = par1IBlockSource.getZ() + (double)var3.getFrontOffsetZ(); ++ Entity var10 = ItemMonsterPlacer.spawnCreature(par1IBlockSource.getWorld(), par2ItemStack.getItemDamage(), var4, var6, var8); ++ ++ if (var10 instanceof EntityLivingBase && par2ItemStack.hasDisplayName()) { ++ ((EntityLiving)var10).setCustomNameTag(par2ItemStack.getDisplayName()); + } + +- var2.splitStack(1); +- return var2; ++ par2ItemStack.splitStack(1); ++ return par2ItemStack; + } + } diff --git a/patches/net/minecraft/src/DispenserBehaviorPotion.java.patch b/patches/net/minecraft/src/DispenserBehaviorPotion.java.patch new file mode 100644 index 0000000..58f1604 --- /dev/null +++ b/patches/net/minecraft/src/DispenserBehaviorPotion.java.patch @@ -0,0 +1,15 @@ +--- net/minecraft/src/DispenserBehaviorPotion.java ++++ net/minecraft/src/DispenserBehaviorPotion.java +@@ -3,7 +3,10 @@ + final class DispenserBehaviorPotion implements IBehaviorDispenseItem { + private final BehaviorDefaultDispenseItem defaultDispenserItemBehavior = new BehaviorDefaultDispenseItem(); + +- public ItemStack dispense(IBlockSource var1, ItemStack var2) { +- return ItemPotion.isSplash(var2.getItemDamage()) ? (new DispenserBehaviorPotionProjectile(this, var2)).dispense(var1, var2) : this.defaultDispenserItemBehavior.dispense(var1, var2); ++ /** ++ * Dispenses the specified ItemStack from a dispenser. ++ */ ++ public ItemStack dispense(IBlockSource par1IBlockSource, ItemStack par2ItemStack) { ++ return ItemPotion.isSplash(par2ItemStack.getItemDamage()) ? (new DispenserBehaviorPotionProjectile(this, par2ItemStack)).dispense(par1IBlockSource, par2ItemStack) : this.defaultDispenserItemBehavior.dispense(par1IBlockSource, par2ItemStack); + } + } diff --git a/patches/net/minecraft/src/DispenserBehaviorPotionProjectile.java.patch b/patches/net/minecraft/src/DispenserBehaviorPotionProjectile.java.patch new file mode 100644 index 0000000..0739396 --- /dev/null +++ b/patches/net/minecraft/src/DispenserBehaviorPotionProjectile.java.patch @@ -0,0 +1,27 @@ +--- net/minecraft/src/DispenserBehaviorPotionProjectile.java ++++ net/minecraft/src/DispenserBehaviorPotionProjectile.java +@@ -2,15 +2,19 @@ + + class DispenserBehaviorPotionProjectile extends BehaviorProjectileDispense { + final ItemStack potionItemStack; ++ + final DispenserBehaviorPotion dispenserPotionBehavior; + +- DispenserBehaviorPotionProjectile(DispenserBehaviorPotion var1, ItemStack var2) { +- this.dispenserPotionBehavior = var1; +- this.potionItemStack = var2; ++ DispenserBehaviorPotionProjectile(DispenserBehaviorPotion par1DispenserBehaviorPotion, ItemStack par2ItemStack) { ++ this.dispenserPotionBehavior = par1DispenserBehaviorPotion; ++ this.potionItemStack = par2ItemStack; + } + +- protected IProjectile getProjectileEntity(World var1, IPosition var2) { +- return new EntityPotion(var1, var2.getX(), var2.getY(), var2.getZ(), this.potionItemStack.copy()); ++ /** ++ * Return the projectile entity spawned by this dispense behavior. ++ */ ++ protected IProjectile getProjectileEntity(World par1World, IPosition par2IPosition) { ++ return new EntityPotion(par1World, par2IPosition.getX(), par2IPosition.getY(), par2IPosition.getZ(), this.potionItemStack.copy()); + } + + protected float func_82498_a() { diff --git a/patches/net/minecraft/src/DispenserBehaviorSnowball.java.patch b/patches/net/minecraft/src/DispenserBehaviorSnowball.java.patch new file mode 100644 index 0000000..8b625a5 --- /dev/null +++ b/patches/net/minecraft/src/DispenserBehaviorSnowball.java.patch @@ -0,0 +1,16 @@ +--- net/minecraft/src/DispenserBehaviorSnowball.java ++++ net/minecraft/src/DispenserBehaviorSnowball.java +@@ -1,7 +1,11 @@ + package net.minecraft.src; + + final class DispenserBehaviorSnowball extends BehaviorProjectileDispense { +- protected IProjectile getProjectileEntity(World var1, IPosition var2) { +- return new EntitySnowball(var1, var2.getX(), var2.getY(), var2.getZ()); ++ ++ /** ++ * Return the projectile entity spawned by this dispense behavior. ++ */ ++ protected IProjectile getProjectileEntity(World par1World, IPosition par2IPosition) { ++ return new EntitySnowball(par1World, par2IPosition.getX(), par2IPosition.getY(), par2IPosition.getZ()); + } + } diff --git a/patches/net/minecraft/src/DispenserBehaviorTNT.java.patch b/patches/net/minecraft/src/DispenserBehaviorTNT.java.patch new file mode 100644 index 0000000..b53b63d --- /dev/null +++ b/patches/net/minecraft/src/DispenserBehaviorTNT.java.patch @@ -0,0 +1,30 @@ +--- net/minecraft/src/DispenserBehaviorTNT.java ++++ net/minecraft/src/DispenserBehaviorTNT.java +@@ -1,15 +1,19 @@ + package net.minecraft.src; + + final class DispenserBehaviorTNT extends BehaviorDefaultDispenseItem { +- protected ItemStack dispenseStack(IBlockSource var1, ItemStack var2) { +- EnumFacing var3 = BlockDispenser.getFacing(var1.getBlockMetadata()); +- World var4 = var1.getWorld(); +- int var5 = var1.getXInt() + var3.getFrontOffsetX(); +- int var6 = var1.getYInt() + var3.getFrontOffsetY(); +- int var7 = var1.getZInt() + var3.getFrontOffsetZ(); ++ ++ /** ++ * Dispense the specified stack, play the dispense sound and spawn particles. ++ */ ++ protected ItemStack dispenseStack(IBlockSource par1IBlockSource, ItemStack par2ItemStack) { ++ EnumFacing var3 = BlockDispenser.getFacing(par1IBlockSource.getBlockMetadata()); ++ World var4 = par1IBlockSource.getWorld(); ++ int var5 = par1IBlockSource.getXInt() + var3.getFrontOffsetX(); ++ int var6 = par1IBlockSource.getYInt() + var3.getFrontOffsetY(); ++ int var7 = par1IBlockSource.getZInt() + var3.getFrontOffsetZ(); + EntityTNTPrimed var8 = new EntityTNTPrimed(var4, (double)((float)var5 + 0.5F), (double)((float)var6 + 0.5F), (double)((float)var7 + 0.5F), (EntityLivingBase)null); + var4.spawnEntityInWorld(var8); +- --var2.stackSize; +- return var2; ++ --par2ItemStack.stackSize; ++ return par2ItemStack; + } + } diff --git a/patches/net/minecraft/src/DynamicTexture.java.patch b/patches/net/minecraft/src/DynamicTexture.java.patch new file mode 100644 index 0000000..82eb6f7 --- /dev/null +++ b/patches/net/minecraft/src/DynamicTexture.java.patch @@ -0,0 +1,40 @@ +--- net/minecraft/src/DynamicTexture.java ++++ net/minecraft/src/DynamicTexture.java +@@ -5,24 +5,27 @@ + + public class DynamicTexture extends AbstractTexture { + private final int[] dynamicTextureData; ++ ++ /** width of this icon in pixels */ + private final int width; ++ ++ /** height of this icon in pixels */ + private final int height; + +- public DynamicTexture(BufferedImage var1) { +- this(var1.getWidth(), var1.getHeight()); +- var1.getRGB(0, 0, var1.getWidth(), var1.getHeight(), this.dynamicTextureData, 0, var1.getWidth()); ++ public DynamicTexture(BufferedImage par1BufferedImage) { ++ this(par1BufferedImage.getWidth(), par1BufferedImage.getHeight()); ++ par1BufferedImage.getRGB(0, 0, par1BufferedImage.getWidth(), par1BufferedImage.getHeight(), this.dynamicTextureData, 0, par1BufferedImage.getWidth()); + this.updateDynamicTexture(); + } + +- public DynamicTexture(int var1, int var2) { +- this.width = var1; +- this.height = var2; +- this.dynamicTextureData = new int[var1 * var2]; +- TextureUtil.allocateTexture(this.getGlTextureId(), var1, var2); ++ public DynamicTexture(int par1, int par2) { ++ this.width = par1; ++ this.height = par2; ++ this.dynamicTextureData = new int[par1 * par2]; ++ TextureUtil.allocateTexture(this.getGlTextureId(), par1, par2); + } + +- public void loadTexture(ResourceManager var1) throws IOException { +- } ++ public void loadTexture(ResourceManager par1ResourceManager) throws IOException {} + + public void updateDynamicTexture() { + TextureUtil.uploadTexture(this.getGlTextureId(), this.dynamicTextureData, this.width, this.height); diff --git a/patches/net/minecraft/src/EffectRenderer.java.patch b/patches/net/minecraft/src/EffectRenderer.java.patch new file mode 100644 index 0000000..16c486c --- /dev/null +++ b/patches/net/minecraft/src/EffectRenderer.java.patch @@ -0,0 +1,372 @@ +--- net/minecraft/src/EffectRenderer.java ++++ net/minecraft/src/EffectRenderer.java +@@ -3,70 +3,96 @@ + import java.util.ArrayList; + import java.util.List; + import java.util.Random; ++ + import org.lwjgl.opengl.GL11; + ++import com.prupe.mcpatcher.sky.FireworksHelper; ++ ++import org.newdawn.slick.opengl.Texture; ++ ++//Spout Start ++import org.spoutcraft.api.block.design.BlockDesign; ++import org.spoutcraft.api.Spoutcraft; ++import org.spoutcraft.api.material.CustomBlock; ++import org.spoutcraft.api.material.MaterialData; ++import org.spoutcraft.client.io.CustomTextureManager; ++import org.spoutcraft.client.SpoutClient; ++import org.spoutcraft.client.block.SpoutcraftChunk; ++import org.spoutcraft.client.config.Configuration; ++//Spout End ++ + public class EffectRenderer { + private static final ResourceLocation particleTextures = new ResourceLocation("textures/particle/particles.png"); +- protected World worldObj; +- private List[] c = new List[4]; ++ /** Reference to the World object. */ ++ // MCPatcher Start - protected to public ++ public World worldObj; ++ // MCPatcher End ++ private List[] fxLayers = new List[5]; + private TextureManager renderer; +- private Random e = new Random(); +- +- public EffectRenderer(World var1, TextureManager var2) { +- if(var1 != null) { +- this.worldObj = var1; +- } +- +- this.renderer = var2; +- +- for(int var3 = 0; var3 < 4; ++var3) { +- this.c[var3] = new ArrayList(); +- } +- ++ ++ /** RNG. */ ++ private Random rand = new Random(); ++ ++ public EffectRenderer(World par1World, TextureManager par2TextureManager) { ++ if (par1World != null) { ++ this.worldObj = par1World; ++ } ++ ++ this.renderer = par2TextureManager; ++ ++ for (int var3 = 0; var3 < 5; ++var3) { ++ this.fxLayers[var3] = new ArrayList(); ++ } + } ++ ++ public void addEffect(EntityFX par1EntityFX) { ++ int var2 = FireworksHelper.getFXLayer(par1EntityFX); + +- public void addEffect(EntityFX var1) { +- int var2 = var1.getFXLayer(); +- if(this.c[var2].size() >= 4000) { +- this.c[var2].remove(0); ++ if (this.fxLayers[var2].size() >= 4000) { ++ this.fxLayers[var2].remove(0); + } + +- this.c[var2].add(var1); ++ this.fxLayers[var2].add(par1EntityFX); + } + + public void updateEffects() { +- for(int var1 = 0; var1 < 4; ++var1) { +- for(int var2 = 0; var2 < this.c[var1].size(); ++var2) { +- EntityFX var3 = (EntityFX)this.c[var1].get(var2); ++ for (int var1 = 0; var1 < 5; ++var1) { ++ for (int var2 = 0; var2 < this.fxLayers[var1].size(); ++var2) { ++ EntityFX var3 = (EntityFX)this.fxLayers[var1].get(var2); + var3.onUpdate(); +- if(var3.isDead) { +- this.c[var1].remove(var2--); ++ ++ if (var3.isDead) { ++ this.fxLayers[var1].remove(var2--); + } + } + } +- + } + +- public void renderParticles(Entity var1, float var2) { ++ /** ++ * Renders all current particles. Args player, partialTickTime ++ */ ++ public void renderParticles(Entity par1Entity, float par2) { + float var3 = ActiveRenderInfo.rotationX; + float var4 = ActiveRenderInfo.rotationZ; + float var5 = ActiveRenderInfo.rotationYZ; + float var6 = ActiveRenderInfo.rotationXY; + float var7 = ActiveRenderInfo.rotationXZ; +- EntityFX.interpPosX = var1.lastTickPosX + (var1.posX - var1.lastTickPosX) * (double)var2; +- EntityFX.interpPosY = var1.lastTickPosY + (var1.posY - var1.lastTickPosY) * (double)var2; +- EntityFX.interpPosZ = var1.lastTickPosZ + (var1.posZ - var1.lastTickPosZ) * (double)var2; ++ EntityFX.interpPosX = par1Entity.lastTickPosX + (par1Entity.posX - par1Entity.lastTickPosX) * (double)par2; ++ EntityFX.interpPosY = par1Entity.lastTickPosY + (par1Entity.posY - par1Entity.lastTickPosY) * (double)par2; ++ EntityFX.interpPosZ = par1Entity.lastTickPosZ + (par1Entity.posZ - par1Entity.lastTickPosZ) * (double)par2; + +- for(int var8 = 0; var8 < 3; ++var8) { +- if(!this.c[var8].isEmpty()) { +- switch(var8) { ++ for (int var8 = 0; var8 < 5; ++var8) { ++ if (!FireworksHelper.skipThisLayer(this.fxLayers[var8].isEmpty(), var8)) { ++ switch (var8) { + case 0: + default: + this.renderer.bindTexture(particleTextures); + break; ++ + case 1: + this.renderer.bindTexture(TextureMap.locationBlocksTexture); + break; ++ + case 2: + this.renderer.bindTexture(TextureMap.locationItemsTexture); + } +@@ -74,15 +100,15 @@ + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + GL11.glDepthMask(false); + GL11.glEnable(GL11.GL_BLEND); +- GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); ++ FireworksHelper.setParticleBlendMethod(var8); + GL11.glAlphaFunc(GL11.GL_GREATER, 0.003921569F); + Tessellator var9 = Tessellator.instance; + var9.startDrawingQuads(); + +- for(int var10 = 0; var10 < this.c[var8].size(); ++var10) { +- EntityFX var11 = (EntityFX)this.c[var8].get(var10); +- var9.setBrightness(var11.getBrightnessForRender(var2)); +- var11.renderParticle(var9, var2, var3, var7, var4, var5, var6); ++ for (int var10 = 0; var10 < this.fxLayers[var8].size(); ++var10) { ++ EntityFX var11 = (EntityFX)this.fxLayers[var8].get(var10); ++ var9.setBrightness(var11.getBrightnessForRender(par2)); ++ var11.renderParticle(var9, par2, var3, var7, var4, var5, var6); + } + + var9.draw(); +@@ -91,95 +117,148 @@ + GL11.glAlphaFunc(GL11.GL_GREATER, 0.1F); + } + } +- + } + +- public void renderLitParticles(Entity var1, float var2) { +- float var3 = (float)Math.PI / 180.0F; +- float var4 = MathHelper.cos(var1.rotationYaw * ((float)Math.PI / 180.0F)); +- float var5 = MathHelper.sin(var1.rotationYaw * ((float)Math.PI / 180.0F)); +- float var6 = -var5 * MathHelper.sin(var1.rotationPitch * ((float)Math.PI / 180.0F)); +- float var7 = var4 * MathHelper.sin(var1.rotationPitch * ((float)Math.PI / 180.0F)); +- float var8 = MathHelper.cos(var1.rotationPitch * ((float)Math.PI / 180.0F)); ++ public void renderLitParticles(Entity par1Entity, float par2) { ++ float var3 = 0.017453292F; ++ float var4 = MathHelper.cos(par1Entity.rotationYaw * 0.017453292F); ++ float var5 = MathHelper.sin(par1Entity.rotationYaw * 0.017453292F); ++ float var6 = -var5 * MathHelper.sin(par1Entity.rotationPitch * 0.017453292F); ++ float var7 = var4 * MathHelper.sin(par1Entity.rotationPitch * 0.017453292F); ++ float var8 = MathHelper.cos(par1Entity.rotationPitch * 0.017453292F); + byte var9 = 3; +- List var10 = this.c[var9]; +- if(!var10.isEmpty()) { ++ List var10 = this.fxLayers[var9]; ++ ++ if (!var10.isEmpty()) { + Tessellator var11 = Tessellator.instance; + +- for(int var12 = 0; var12 < var10.size(); ++var12) { ++ for (int var12 = 0; var12 < var10.size(); ++var12) { + EntityFX var13 = (EntityFX)var10.get(var12); +- var11.setBrightness(var13.getBrightnessForRender(var2)); +- var13.renderParticle(var11, var2, var4, var8, var5, var6, var7); +- } +- +- } +- } +- +- public void clearEffects(World var1) { +- this.worldObj = var1; +- +- for(int var2 = 0; var2 < 4; ++var2) { +- this.c[var2].clear(); +- } +- +- } +- +- public void addBlockDestroyEffects(int var1, int var2, int var3, int var4, int var5) { +- if(var4 != 0) { +- Block var6 = Block.blocksList[var4]; ++ var11.setBrightness(var13.getBrightnessForRender(par2)); ++ var13.renderParticle(var11, par2, var4, var8, var5, var6, var7); ++ } ++ } ++ } ++ ++ public void clearEffects(World par1World) { ++ this.worldObj = par1World; ++ ++ for (int var2 = 0; var2 < 5; ++var2) { ++ this.fxLayers[var2].clear(); ++ } ++ } ++ ++ public void addBlockDestroyEffects(int par1, int par2, int par3, int par4, int par5) { ++ if (par4 != 0) { ++ Block var6 = Block.blocksList[par4]; ++ // Spout Start ++ Texture texture = null; ++ short customId = 0; ++ if (SpoutClient.getInstance().getRawWorld() != null) { ++ SpoutcraftChunk sChunk = Spoutcraft.getChunkAt(SpoutClient.getInstance().getRawWorld(), par1, par2, par3); ++ customId = sChunk.getCustomBlockId(par1, par2, par3); ++ short[] customBlockIds = sChunk.getCustomBlockIds(); ++ byte[] customBlockData = sChunk.getCustomBlockData(); ++ if (customId > 0) { ++ if (Configuration.displayCustomParticles) { ++ CustomBlock block = MaterialData.getCustomBlock(customId); ++ if (block != null) { ++ BlockDesign design = block.getBlockDesign(customBlockData[customId]); ++ if (design != null) { ++ texture = CustomTextureManager.getTextureFromUrl(block.getAddon(), design.getTextureURL()); ++ } ++ } ++ } else { ++ return; ++ } ++ } ++ } ++ // Spout End + byte var7 = 4; + +- for(int var8 = 0; var8 < var7; ++var8) { +- for(int var9 = 0; var9 < var7; ++var9) { +- for(int var10 = 0; var10 < var7; ++var10) { +- double var11 = (double)var1 + ((double)var8 + 0.5D) / (double)var7; +- double var13 = (double)var2 + ((double)var9 + 0.5D) / (double)var7; +- double var15 = (double)var3 + ((double)var10 + 0.5D) / (double)var7; +- this.addEffect((new EntityDiggingFX(this.worldObj, var11, var13, var15, var11 - (double)var1 - 0.5D, var13 - (double)var2 - 0.5D, var15 - (double)var3 - 0.5D, var6, var5)).applyColourMultiplier(var1, var2, var3)); ++ for (int var8 = 0; var8 < var7; ++var8) { ++ for (int var9 = 0; var9 < var7; ++var9) { ++ for (int var10 = 0; var10 < var7; ++var10) { ++ double var11 = (double)par1 + ((double)var8 + 0.5D) / (double)var7; ++ double var13 = (double)par2 + ((double)var9 + 0.5D) / (double)var7; ++ double var15 = (double)par3 + ((double)var10 + 0.5D) / (double)var7; ++ this.addEffect((new EntityDiggingFX(this.worldObj, var11, var13, var15, var11 - (double)par1 - 0.5D, var13 - (double)par2 - 0.5D, var15 - (double)par3 - 0.5D, var6, par5, texture)).applyColourMultiplier(par1, par2, par3)); + } + } + } +- + } + } + +- public void addBlockHitEffects(int var1, int var2, int var3, int var4) { +- int var5 = this.worldObj.getBlockId(var1, var2, var3); +- if(var5 != 0) { ++ /** ++ * Adds block hit particles for the specified block. Args: x, y, z, sideHit ++ */ ++ public void addBlockHitEffects(int par1, int par2, int par3, int par4) { ++ int var5 = this.worldObj.getBlockId(par1, par2, par3); ++ ++ if (var5 != 0) { + Block var6 = Block.blocksList[var5]; ++ ++ // Spout Start ++ Texture texture = null; ++ ++ short customId = 0; ++ if (SpoutClient.getInstance().getRawWorld() != null) { ++ SpoutcraftChunk sChunk = Spoutcraft.getChunkAt(SpoutClient.getInstance().getRawWorld(), par1, par2, par3); ++ customId = sChunk.getCustomBlockId(par1, par2, par3); ++ short[] customBlockIds = sChunk.getCustomBlockIds(); ++ byte[] customBlockData = sChunk.getCustomBlockData(); ++ ++ if (customId > 0) { ++ if (Configuration.displayCustomParticles) { ++ CustomBlock block = MaterialData.getCustomBlock(customId); ++ if (block != null) { ++ BlockDesign design = block.getBlockDesign(customBlockData[customId]); ++ if (design != null) { ++ texture = CustomTextureManager.getTextureFromUrl(block.getAddon(), design.getTextureURL()); ++ } ++ } ++ } else { ++ return; ++ } ++ } ++ ++ } ++ // Spout End ++ + float var7 = 0.1F; +- double var8 = (double)var1 + this.e.nextDouble() * (var6.getBlockBoundsMaxX() - var6.getMinX() - (double)(var7 * 2.0F)) + (double)var7 + var6.getMinX(); +- double var10 = (double)var2 + this.e.nextDouble() * (var6.getBlockBoundsMaxY() - var6.getBlockBoundsMinY() - (double)(var7 * 2.0F)) + (double)var7 + var6.getBlockBoundsMinY(); +- double var12 = (double)var3 + this.e.nextDouble() * (var6.getBlockBoundsMaxZ() - var6.getBlockBoundsMinZ() - (double)(var7 * 2.0F)) + (double)var7 + var6.getBlockBoundsMinZ(); +- if(var4 == 0) { +- var10 = (double)var2 + var6.getBlockBoundsMinY() - (double)var7; +- } +- +- if(var4 == 1) { +- var10 = (double)var2 + var6.getBlockBoundsMaxY() + (double)var7; +- } +- +- if(var4 == 2) { +- var12 = (double)var3 + var6.getBlockBoundsMinZ() - (double)var7; +- } +- +- if(var4 == 3) { +- var12 = (double)var3 + var6.getBlockBoundsMaxZ() + (double)var7; +- } +- +- if(var4 == 4) { +- var8 = (double)var1 + var6.getMinX() - (double)var7; +- } +- +- if(var4 == 5) { +- var8 = (double)var1 + var6.getBlockBoundsMaxX() + (double)var7; +- } +- +- this.addEffect((new EntityDiggingFX(this.worldObj, var8, var10, var12, 0.0D, 0.0D, 0.0D, var6, this.worldObj.getBlockMetadata(var1, var2, var3))).applyColourMultiplier(var1, var2, var3).multiplyVelocity(0.2F).multipleParticleScaleBy(0.6F)); ++ double var8 = (double)par1 + this.rand.nextDouble() * (var6.getBlockBoundsMaxX() - var6.getBlockBoundsMinX() - (double)(var7 * 2.0F)) + (double)var7 + var6.getBlockBoundsMinX(); ++ double var10 = (double)par2 + this.rand.nextDouble() * (var6.getBlockBoundsMaxY() - var6.getBlockBoundsMinY() - (double)(var7 * 2.0F)) + (double)var7 + var6.getBlockBoundsMinY(); ++ double var12 = (double)par3 + this.rand.nextDouble() * (var6.getBlockBoundsMaxZ() - var6.getBlockBoundsMinZ() - (double)(var7 * 2.0F)) + (double)var7 + var6.getBlockBoundsMinZ(); ++ ++ if (par4 == 0) { ++ var10 = (double)par2 + var6.getBlockBoundsMinY() - (double)var7; ++ } ++ ++ if (par4 == 1) { ++ var10 = (double)par2 + var6.getBlockBoundsMaxY() + (double)var7; ++ } ++ ++ if (par4 == 2) { ++ var12 = (double)par3 + var6.getBlockBoundsMinZ() - (double)var7; ++ } ++ ++ if (par4 == 3) { ++ var12 = (double)par3 + var6.getBlockBoundsMaxZ() + (double)var7; ++ } ++ ++ if (par4 == 4) { ++ var8 = (double)par1 + var6.getBlockBoundsMinX() - (double)var7; ++ } ++ ++ if (par4 == 5) { ++ var8 = (double)par1 + var6.getBlockBoundsMaxX() + (double)var7; ++ } ++ ++ this.addEffect((new EntityDiggingFX(this.worldObj, var8, var10, var12, 0.0D, 0.0D, 0.0D, var6, this.worldObj.getBlockMetadata(par1, par2, par3), texture)).applyColourMultiplier(par1, par2, par3).multiplyVelocity(0.2F).multipleParticleScaleBy(0.6F)); + } + } + + public String getStatistics() { +- return "" + (this.c[0].size() + this.c[1].size() + this.c[2].size()); ++ return "" + (this.fxLayers[0].size() + this.fxLayers[1].size() + this.fxLayers[2].size()); + } + } diff --git a/patches/net/minecraft/src/EmptyChunk.java.patch b/patches/net/minecraft/src/EmptyChunk.java.patch new file mode 100644 index 0000000..6058ddb --- /dev/null +++ b/patches/net/minecraft/src/EmptyChunk.java.patch @@ -0,0 +1,264 @@ +--- net/minecraft/src/EmptyChunk.java ++++ net/minecraft/src/EmptyChunk.java +@@ -4,109 +4,176 @@ + import java.util.Random; + + public class EmptyChunk extends Chunk { +- public EmptyChunk(World var1, int var2, int var3) { +- super(var1, var2, var3); +- } +- +- public boolean isAtLocation(int var1, int var2) { +- return var1 == this.xPosition && var2 == this.zPosition; +- } +- +- public int getHeightValue(int var1, int var2) { +- return 0; +- } +- +- public void generateHeightMap() { +- } +- +- public void generateSkylightMap() { +- } +- +- public int getBlockID(int var1, int var2, int var3) { +- return 0; +- } +- +- public int getBlockLightOpacity(int var1, int var2, int var3) { ++ public EmptyChunk(World par1World, int par2, int par3) { ++ super(par1World, par2, par3); ++ } ++ ++ /** ++ * Checks whether the chunk is at the X/Z location specified ++ */ ++ public boolean isAtLocation(int par1, int par2) { ++ return par1 == this.xPosition && par2 == this.zPosition; ++ } ++ ++ /** ++ * Returns the value in the height map at this x, z coordinate in the chunk ++ */ ++ public int getHeightValue(int par1, int par2) { ++ return 0; ++ } ++ ++ /** ++ * Generates the height map for a chunk from scratch ++ */ ++ public void generateHeightMap() {} ++ ++ /** ++ * Generates the initial skylight map for the chunk upon generation or load. ++ */ ++ public void generateSkylightMap() {} ++ ++ /** ++ * Return the ID of a block in the chunk. ++ */ ++ public int getBlockID(int par1, int par2, int par3) { ++ return 0; ++ } ++ ++ public int getBlockLightOpacity(int par1, int par2, int par3) { + return 255; + } + +- public boolean setBlockIDWithMetadata(int var1, int var2, int var3, int var4, int var5) { ++ /** ++ * Sets a blockID of a position within a chunk with metadata. Args: x, y, z, blockID, metadata ++ */ ++ public boolean setBlockIDWithMetadata(int par1, int par2, int par3, int par4, int par5) { + return true; + } + +- public int getBlockMetadata(int var1, int var2, int var3) { +- return 0; +- } +- +- public boolean setBlockMetadata(int var1, int var2, int var3, int var4) { +- return false; +- } +- +- public int getSavedLightValue(EnumSkyBlock var1, int var2, int var3, int var4) { +- return 0; +- } +- +- public void setLightValue(EnumSkyBlock var1, int var2, int var3, int var4, int var5) { +- } +- +- public int getBlockLightValue(int var1, int var2, int var3, int var4) { +- return 0; +- } +- +- public void addEntity(Entity var1) { +- } +- +- public void removeEntity(Entity var1) { +- } +- +- public void removeEntityAtIndex(Entity var1, int var2) { +- } +- +- public boolean canBlockSeeTheSky(int var1, int var2, int var3) { +- return false; +- } +- +- public TileEntity getChunkBlockTileEntity(int var1, int var2, int var3) { ++ /** ++ * Return the metadata corresponding to the given coordinates inside a chunk. ++ */ ++ public int getBlockMetadata(int par1, int par2, int par3) { ++ return 0; ++ } ++ ++ /** ++ * Set the metadata of a block in the chunk ++ */ ++ public boolean setBlockMetadata(int par1, int par2, int par3, int par4) { ++ return false; ++ } ++ ++ /** ++ * Gets the amount of light saved in this block (doesn't adjust for daylight) ++ */ ++ public int getSavedLightValue(EnumSkyBlock par1EnumSkyBlock, int par2, int par3, int par4) { ++ return 0; ++ } ++ ++ /** ++ * Sets the light value at the coordinate. If enumskyblock is set to sky it sets it in the skylightmap and if its a ++ * block then into the blocklightmap. Args enumSkyBlock, x, y, z, lightValue ++ */ ++ public void setLightValue(EnumSkyBlock par1EnumSkyBlock, int par2, int par3, int par4, int par5) {} ++ ++ /** ++ * Gets the amount of light on a block taking into account sunlight ++ */ ++ public int getBlockLightValue(int par1, int par2, int par3, int par4) { ++ return 0; ++ } ++ ++ /** ++ * Adds an entity to the chunk. Args: entity ++ */ ++ public void addEntity(Entity par1Entity) {} ++ ++ /** ++ * removes entity using its y chunk coordinate as its index ++ */ ++ public void removeEntity(Entity par1Entity) {} ++ ++ /** ++ * Removes entity at the specified index from the entity array. ++ */ ++ public void removeEntityAtIndex(Entity par1Entity, int par2) {} ++ ++ /** ++ * Returns whether is not a block above this one blocking sight to the sky (done via checking against the heightmap) ++ */ ++ public boolean canBlockSeeTheSky(int par1, int par2, int par3) { ++ return false; ++ } ++ ++ /** ++ * Gets the TileEntity for a given block in this chunk ++ */ ++ public TileEntity getChunkBlockTileEntity(int par1, int par2, int par3) { + return null; + } + +- public void addTileEntity(TileEntity var1) { +- } +- +- public void setChunkBlockTileEntity(int var1, int var2, int var3, TileEntity var4) { +- } +- +- public void removeChunkBlockTileEntity(int var1, int var2, int var3) { +- } +- +- public void onChunkLoad() { +- } +- +- public void onChunkUnload() { +- } +- +- public void setChunkModified() { +- } +- +- public void getEntitiesWithinAABBForEntity(Entity var1, AxisAlignedBB var2, List var3, IEntitySelector var4) { +- } +- +- public void getEntitiesOfTypeWithinAAAB(Class var1, AxisAlignedBB var2, List var3, IEntitySelector var4) { +- } +- +- public boolean needsSaving(boolean var1) { ++ /** ++ * Adds a TileEntity to a chunk ++ */ ++ public void addTileEntity(TileEntity par1TileEntity) {} ++ ++ /** ++ * Sets the TileEntity for a given block in this chunk ++ */ ++ public void setChunkBlockTileEntity(int par1, int par2, int par3, TileEntity par4TileEntity) {} ++ ++ /** ++ * Removes the TileEntity for a given block in this chunk ++ */ ++ public void removeChunkBlockTileEntity(int par1, int par2, int par3) {} ++ ++ /** ++ * Called when this Chunk is loaded by the ChunkProvider ++ */ ++ public void onChunkLoad() {} ++ ++ /** ++ * Called when this Chunk is unloaded by the ChunkProvider ++ */ ++ public void onChunkUnload() {} ++ ++ /** ++ * Sets the isModified flag for this Chunk ++ */ ++ public void setChunkModified() {} ++ ++ /** ++ * Fills the given list of all entities that intersect within the given bounding box that aren't the passed entity ++ * Args: entity, aabb, listToFill ++ */ ++ public void getEntitiesWithinAABBForEntity(Entity par1Entity, AxisAlignedBB par2AxisAlignedBB, List par3List, IEntitySelector par4IEntitySelector) {} ++ ++ /** ++ * Gets all entities that can be assigned to the specified class. Args: entityClass, aabb, listToFill ++ */ ++ public void getEntitiesOfTypeWithinAAAB(Class par1Class, AxisAlignedBB par2AxisAlignedBB, List par3List, IEntitySelector par4IEntitySelector) {} ++ ++ /** ++ * Returns true if this Chunk needs to be saved ++ */ ++ public boolean needsSaving(boolean par1) { + return false; + } + +- public Random getRandomWithSeed(long var1) { +- 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) ^ var1); ++ public Random getRandomWithSeed(long par1) { ++ 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) ^ par1); + } + + public boolean isEmpty() { + return true; + } + +- public boolean getAreLevelsEmpty(int var1, int var2) { ++ /** ++ * Returns whether the ExtendedBlockStorages containing levels (in blocks) from arg 1 to arg 2 are fully empty (true) ++ * or not (false). ++ */ ++ public boolean getAreLevelsEmpty(int par1, int par2) { + return true; + } + } diff --git a/patches/net/minecraft/src/Enchantment.java.patch b/patches/net/minecraft/src/Enchantment.java.patch new file mode 100644 index 0000000..9939638 --- /dev/null +++ b/patches/net/minecraft/src/Enchantment.java.patch @@ -0,0 +1,229 @@ +--- net/minecraft/src/Enchantment.java ++++ net/minecraft/src/Enchantment.java +@@ -4,42 +4,105 @@ + + public abstract class Enchantment { + public static final Enchantment[] enchantmentsList = new Enchantment[256]; ++ ++ /** The list of enchantments applicable by the anvil from a book */ + public static final Enchantment[] enchantmentsBookList; ++ ++ /** Converts environmental damage to armour damage */ + public static final Enchantment protection = new EnchantmentProtection(0, 10, 0); ++ ++ /** Protection against fire */ + public static final Enchantment fireProtection = new EnchantmentProtection(1, 5, 1); ++ ++ /** Less fall damage */ + public static final Enchantment featherFalling = new EnchantmentProtection(2, 5, 2); ++ ++ /** Protection against explosions */ + public static final Enchantment blastProtection = new EnchantmentProtection(3, 2, 3); ++ ++ /** Protection against projectile entities (e.g. arrows) */ + public static final Enchantment projectileProtection = new EnchantmentProtection(4, 5, 4); ++ ++ /** ++ * Decreases the rate of air loss underwater; increases time between damage while suffocating ++ */ + public static final Enchantment respiration = new EnchantmentOxygen(5, 2); ++ ++ /** Increases underwater mining rate */ + public static final Enchantment aquaAffinity = new EnchantmentWaterWorker(6, 2); + public static final Enchantment thorns = new EnchantmentThorns(7, 1); ++ ++ /** Extra damage to mobs */ + public static final Enchantment sharpness = new EnchantmentDamage(16, 10, 0); ++ ++ /** Extra damage to zombies, zombie pigmen and skeletons */ + public static final Enchantment smite = new EnchantmentDamage(17, 5, 1); ++ ++ /** Extra damage to spiders, cave spiders and silverfish */ + public static final Enchantment baneOfArthropods = new EnchantmentDamage(18, 5, 2); ++ ++ /** Knocks mob and players backwards upon hit */ + public static final Enchantment knockback = new EnchantmentKnockback(19, 5); ++ ++ /** Lights mobs on fire */ + public static final Enchantment fireAspect = new EnchantmentFireAspect(20, 2); ++ ++ /** Mobs have a chance to drop more loot */ + public static final Enchantment looting = new EnchantmentLootBonus(21, 2, EnumEnchantmentType.weapon); ++ ++ /** Faster resource gathering while in use */ + public static final Enchantment efficiency = new EnchantmentDigging(32, 10); ++ ++ /** ++ * Blocks mined will drop themselves, even if it should drop something else (e.g. stone will drop stone, not ++ * cobblestone) ++ */ + public static final Enchantment silkTouch = new EnchantmentUntouching(33, 1); ++ ++ /** ++ * Sometimes, the tool's durability will not be spent when the tool is used ++ */ + public static final Enchantment unbreaking = new EnchantmentDurability(34, 5); ++ ++ /** Can multiply the drop rate of items from blocks */ + public static final Enchantment fortune = new EnchantmentLootBonus(35, 2, EnumEnchantmentType.digger); ++ ++ /** Power enchantment for bows, add's extra damage to arrows. */ + public static final Enchantment power = new EnchantmentArrowDamage(48, 10); ++ ++ /** ++ * Knockback enchantments for bows, the arrows will knockback the target when hit. ++ */ + public static final Enchantment punch = new EnchantmentArrowKnockback(49, 2); ++ ++ /** ++ * Flame enchantment for bows. Arrows fired by the bow will be on fire. Any target hit will also set on fire. ++ */ + public static final Enchantment flame = new EnchantmentArrowFire(50, 2); ++ ++ /** ++ * Infinity enchantment for bows. The bow will not consume arrows anymore, but will still required at least one arrow ++ * on inventory use the bow. ++ */ + public static final Enchantment infinity = new EnchantmentArrowInfinite(51, 1); + public final int effectId; + private final int weight; ++ ++ /** The EnumEnchantmentType given to this Enchantment. */ + public EnumEnchantmentType type; +- protected String B; +- +- protected Enchantment(int var1, int var2, EnumEnchantmentType var3) { +- this.effectId = var1; +- this.weight = var2; +- this.type = var3; +- if(enchantmentsList[var1] != null) { ++ ++ /** Used in localisation and stats. */ ++ protected String name; ++ ++ protected Enchantment(int par1, int par2, EnumEnchantmentType par3EnumEnchantmentType) { ++ this.effectId = par1; ++ this.weight = par2; ++ this.type = par3EnumEnchantmentType; ++ ++ if (enchantmentsList[par1] != null) { + throw new IllegalArgumentException("Duplicate enchantment id!"); + } else { +- enchantmentsList[var1] = this; ++ enchantmentsList[par1] = this; + } + } + +@@ -47,50 +110,80 @@ + return this.weight; + } + ++ /** ++ * Returns the minimum level that the enchantment can have. ++ */ + public int getMinLevel() { + return 1; + } + ++ /** ++ * Returns the maximum level that the enchantment can have. ++ */ + public int getMaxLevel() { + return 1; + } + +- public int getMinEnchantability(int var1) { +- return 1 + var1 * 10; +- } +- +- public int getMaxEnchantability(int var1) { +- return this.getMinEnchantability(var1) + 5; +- } +- +- public int calcModifierDamage(int var1, DamageSource var2) { ++ /** ++ * Returns the minimal value of enchantability needed on the enchantment level passed. ++ */ ++ public int getMinEnchantability(int par1) { ++ return 1 + par1 * 10; ++ } ++ ++ /** ++ * Returns the maximum value of enchantability nedded on the enchantment level passed. ++ */ ++ public int getMaxEnchantability(int par1) { ++ return this.getMinEnchantability(par1) + 5; ++ } ++ ++ /** ++ * Calculates de damage protection of the enchantment based on level and damage source passed. ++ */ ++ public int calcModifierDamage(int par1, DamageSource par2DamageSource) { + return 0; + } + +- public float calcModifierLiving(int var1, EntityLivingBase var2) { ++ /** ++ * Calculates de (magic) damage done by the enchantment on a living entity based on level and entity passed. ++ */ ++ public float calcModifierLiving(int par1, EntityLivingBase par2EntityLivingBase) { + return 0.0F; + } + +- public boolean canApplyTogether(Enchantment var1) { +- return this != var1; ++ /** ++ * Determines if the enchantment passed can be applyied together with this enchantment. ++ */ ++ public boolean canApplyTogether(Enchantment par1Enchantment) { ++ return this != par1Enchantment; + } + +- public Enchantment setName(String var1) { +- this.B = var1; ++ /** ++ * Sets the enchantment name ++ */ ++ public Enchantment setName(String par1Str) { ++ this.name = par1Str; + return this; + } + ++ /** ++ * Return the name of key in translation table of this enchantment. ++ */ + public String getName() { +- return "enchantment." + this.B; ++ return "enchantment." + this.name; + } + +- public String getTranslatedName(int var1) { ++ /** ++ * Returns the correct traslated name of the enchantment and the level in roman numbers. ++ */ ++ public String getTranslatedName(int par1) { + String var2 = StatCollector.translateToLocal(this.getName()); +- return var2 + " " + StatCollector.translateToLocal("enchantment.level." + var1); ++ return var2 + " " + StatCollector.translateToLocal("enchantment.level." + par1); + } + +- public boolean canApply(ItemStack var1) { +- return this.type.canEnchantItem(var1.getItem()); ++ public boolean canApply(ItemStack par1ItemStack) { ++ return this.type.canEnchantItem(par1ItemStack.getItem()); + } + + static { +@@ -98,9 +191,10 @@ + Enchantment[] var1 = enchantmentsList; + int var2 = var1.length; + +- for(int var3 = 0; var3 < var2; ++var3) { ++ for (int var3 = 0; var3 < var2; ++var3) { + Enchantment var4 = var1[var3]; +- if(var4 != null) { ++ ++ if (var4 != null) { + var0.add(var4); + } + } diff --git a/patches/net/minecraft/src/EnchantmentArrowDamage.java.patch b/patches/net/minecraft/src/EnchantmentArrowDamage.java.patch new file mode 100644 index 0000000..e26d024 --- /dev/null +++ b/patches/net/minecraft/src/EnchantmentArrowDamage.java.patch @@ -0,0 +1,41 @@ +--- net/minecraft/src/EnchantmentArrowDamage.java ++++ net/minecraft/src/EnchantmentArrowDamage.java +@@ -1,19 +1,28 @@ + package net.minecraft.src; + + public class EnchantmentArrowDamage extends Enchantment { +- public EnchantmentArrowDamage(int var1, int var2) { +- super(var1, var2, EnumEnchantmentType.bow); ++ public EnchantmentArrowDamage(int par1, int par2) { ++ super(par1, par2, EnumEnchantmentType.bow); + this.setName("arrowDamage"); + } + +- public int getMinEnchantability(int var1) { +- return 1 + (var1 - 1) * 10; +- } +- +- public int getMaxEnchantability(int var1) { +- return this.getMinEnchantability(var1) + 15; +- } +- ++ /** ++ * Returns the minimal value of enchantability needed on the enchantment level passed. ++ */ ++ public int getMinEnchantability(int par1) { ++ return 1 + (par1 - 1) * 10; ++ } ++ ++ /** ++ * Returns the maximum value of enchantability nedded on the enchantment level passed. ++ */ ++ public int getMaxEnchantability(int par1) { ++ return this.getMinEnchantability(par1) + 15; ++ } ++ ++ /** ++ * Returns the maximum level that the enchantment can have. ++ */ + public int getMaxLevel() { + return 5; + } diff --git a/patches/net/minecraft/src/EnchantmentArrowFire.java.patch b/patches/net/minecraft/src/EnchantmentArrowFire.java.patch new file mode 100644 index 0000000..91aadf1 --- /dev/null +++ b/patches/net/minecraft/src/EnchantmentArrowFire.java.patch @@ -0,0 +1,35 @@ +--- net/minecraft/src/EnchantmentArrowFire.java ++++ net/minecraft/src/EnchantmentArrowFire.java +@@ -1,19 +1,28 @@ + package net.minecraft.src; + + public class EnchantmentArrowFire extends Enchantment { +- public EnchantmentArrowFire(int var1, int var2) { +- super(var1, var2, EnumEnchantmentType.bow); ++ public EnchantmentArrowFire(int par1, int par2) { ++ super(par1, par2, EnumEnchantmentType.bow); + this.setName("arrowFire"); + } + +- public int getMinEnchantability(int var1) { ++ /** ++ * Returns the minimal value of enchantability needed on the enchantment level passed. ++ */ ++ public int getMinEnchantability(int par1) { + return 20; + } + +- public int getMaxEnchantability(int var1) { ++ /** ++ * Returns the maximum value of enchantability nedded on the enchantment level passed. ++ */ ++ public int getMaxEnchantability(int par1) { + return 50; + } + ++ /** ++ * Returns the maximum level that the enchantment can have. ++ */ + public int getMaxLevel() { + return 1; + } diff --git a/patches/net/minecraft/src/EnchantmentArrowInfinite.java.patch b/patches/net/minecraft/src/EnchantmentArrowInfinite.java.patch new file mode 100644 index 0000000..2bee232 --- /dev/null +++ b/patches/net/minecraft/src/EnchantmentArrowInfinite.java.patch @@ -0,0 +1,35 @@ +--- net/minecraft/src/EnchantmentArrowInfinite.java ++++ net/minecraft/src/EnchantmentArrowInfinite.java +@@ -1,19 +1,28 @@ + package net.minecraft.src; + + public class EnchantmentArrowInfinite extends Enchantment { +- public EnchantmentArrowInfinite(int var1, int var2) { +- super(var1, var2, EnumEnchantmentType.bow); ++ public EnchantmentArrowInfinite(int par1, int par2) { ++ super(par1, par2, EnumEnchantmentType.bow); + this.setName("arrowInfinite"); + } + +- public int getMinEnchantability(int var1) { ++ /** ++ * Returns the minimal value of enchantability needed on the enchantment level passed. ++ */ ++ public int getMinEnchantability(int par1) { + return 20; + } + +- public int getMaxEnchantability(int var1) { ++ /** ++ * Returns the maximum value of enchantability nedded on the enchantment level passed. ++ */ ++ public int getMaxEnchantability(int par1) { + return 50; + } + ++ /** ++ * Returns the maximum level that the enchantment can have. ++ */ + public int getMaxLevel() { + return 1; + } diff --git a/patches/net/minecraft/src/EnchantmentArrowKnockback.java.patch b/patches/net/minecraft/src/EnchantmentArrowKnockback.java.patch new file mode 100644 index 0000000..ddd6bd1 --- /dev/null +++ b/patches/net/minecraft/src/EnchantmentArrowKnockback.java.patch @@ -0,0 +1,41 @@ +--- net/minecraft/src/EnchantmentArrowKnockback.java ++++ net/minecraft/src/EnchantmentArrowKnockback.java +@@ -1,19 +1,28 @@ + package net.minecraft.src; + + public class EnchantmentArrowKnockback extends Enchantment { +- public EnchantmentArrowKnockback(int var1, int var2) { +- super(var1, var2, EnumEnchantmentType.bow); ++ public EnchantmentArrowKnockback(int par1, int par2) { ++ super(par1, par2, EnumEnchantmentType.bow); + this.setName("arrowKnockback"); + } + +- public int getMinEnchantability(int var1) { +- return 12 + (var1 - 1) * 20; +- } +- +- public int getMaxEnchantability(int var1) { +- return this.getMinEnchantability(var1) + 25; +- } +- ++ /** ++ * Returns the minimal value of enchantability needed on the enchantment level passed. ++ */ ++ public int getMinEnchantability(int par1) { ++ return 12 + (par1 - 1) * 20; ++ } ++ ++ /** ++ * Returns the maximum value of enchantability nedded on the enchantment level passed. ++ */ ++ public int getMaxEnchantability(int par1) { ++ return this.getMinEnchantability(par1) + 25; ++ } ++ ++ /** ++ * Returns the maximum level that the enchantment can have. ++ */ + public int getMaxLevel() { + return 2; + } diff --git a/patches/net/minecraft/src/EnchantmentDamage.java.patch b/patches/net/minecraft/src/EnchantmentDamage.java.patch new file mode 100644 index 0000000..be24383 --- /dev/null +++ b/patches/net/minecraft/src/EnchantmentDamage.java.patch @@ -0,0 +1,109 @@ +--- net/minecraft/src/EnchantmentDamage.java ++++ net/minecraft/src/EnchantmentDamage.java +@@ -1,42 +1,78 @@ + package net.minecraft.src; + + public class EnchantmentDamage extends Enchantment { +- private static final String[] C = new String[]{"all", "undead", "arthropods"}; +- private static final int[] baseEnchantability = new int[]{1, 5, 5}; +- private static final int[] levelEnchantability = new int[]{11, 8, 8}; +- private static final int[] thresholdEnchantability = new int[]{20, 20, 20}; ++ ++ /** Holds the name to be translated of each protection type. */ ++ private static final String[] protectionName = new String[] {"all", "undead", "arthropods"}; ++ ++ /** ++ * Holds the base factor of enchantability needed to be able to use the enchant. ++ */ ++ private static final int[] baseEnchantability = new int[] {1, 5, 5}; ++ ++ /** ++ * Holds how much each level increased the enchantability factor to be able to use this enchant. ++ */ ++ private static final int[] levelEnchantability = new int[] {11, 8, 8}; ++ ++ /** ++ * Used on the formula of base enchantability, this is the 'window' factor of values to be able to use thing enchant. ++ */ ++ private static final int[] thresholdEnchantability = new int[] {20, 20, 20}; ++ ++ /** ++ * Defines the type of damage of the enchantment, 0 = all, 1 = undead, 3 = arthropods ++ */ + public final int damageType; + +- public EnchantmentDamage(int var1, int var2, int var3) { +- super(var1, var2, EnumEnchantmentType.weapon); +- this.damageType = var3; +- } +- +- public int getMinEnchantability(int var1) { +- return baseEnchantability[this.damageType] + (var1 - 1) * levelEnchantability[this.damageType]; +- } +- +- public int getMaxEnchantability(int var1) { +- return this.getMinEnchantability(var1) + thresholdEnchantability[this.damageType]; +- } +- ++ public EnchantmentDamage(int par1, int par2, int par3) { ++ super(par1, par2, EnumEnchantmentType.weapon); ++ this.damageType = par3; ++ } ++ ++ /** ++ * Returns the minimal value of enchantability needed on the enchantment level passed. ++ */ ++ public int getMinEnchantability(int par1) { ++ return baseEnchantability[this.damageType] + (par1 - 1) * levelEnchantability[this.damageType]; ++ } ++ ++ /** ++ * Returns the maximum value of enchantability nedded on the enchantment level passed. ++ */ ++ public int getMaxEnchantability(int par1) { ++ return this.getMinEnchantability(par1) + thresholdEnchantability[this.damageType]; ++ } ++ ++ /** ++ * Returns the maximum level that the enchantment can have. ++ */ + public int getMaxLevel() { + return 5; + } + +- public float calcModifierLiving(int var1, EntityLivingBase var2) { +- return this.damageType == 0 ? (float)var1 * 1.25F : (this.damageType == 1 && var2.getCreatureAttribute() == EnumCreatureAttribute.UNDEAD ? (float)var1 * 2.5F : (this.damageType == 2 && var2.getCreatureAttribute() == EnumCreatureAttribute.ARTHROPOD ? (float)var1 * 2.5F : 0.0F)); ++ /** ++ * Calculates de (magic) damage done by the enchantment on a living entity based on level and entity passed. ++ */ ++ public float calcModifierLiving(int par1, EntityLivingBase par2EntityLivingBase) { ++ return this.damageType == 0 ? (float)par1 * 1.25F : (this.damageType == 1 && par2EntityLivingBase.getCreatureAttribute() == EnumCreatureAttribute.UNDEAD ? (float)par1 * 2.5F : (this.damageType == 2 && par2EntityLivingBase.getCreatureAttribute() == EnumCreatureAttribute.ARTHROPOD ? (float)par1 * 2.5F : 0.0F)); + } + ++ /** ++ * Return the name of key in translation table of this enchantment. ++ */ + public String getName() { +- return "enchantment.damage." + C[this.damageType]; +- } +- +- public boolean canApplyTogether(Enchantment var1) { +- return !(var1 instanceof EnchantmentDamage); +- } +- +- public boolean canApply(ItemStack var1) { +- return var1.getItem() instanceof ItemAxe ? true : super.canApply(var1); ++ return "enchantment.damage." + protectionName[this.damageType]; ++ } ++ ++ /** ++ * Determines if the enchantment passed can be applyied together with this enchantment. ++ */ ++ public boolean canApplyTogether(Enchantment par1Enchantment) { ++ return !(par1Enchantment instanceof EnchantmentDamage); ++ } ++ ++ public boolean canApply(ItemStack par1ItemStack) { ++ return par1ItemStack.getItem() instanceof ItemAxe ? true : super.canApply(par1ItemStack); + } + } diff --git a/patches/net/minecraft/src/EnchantmentData.java.patch b/patches/net/minecraft/src/EnchantmentData.java.patch new file mode 100644 index 0000000..3e511e1 --- /dev/null +++ b/patches/net/minecraft/src/EnchantmentData.java.patch @@ -0,0 +1,29 @@ +--- net/minecraft/src/EnchantmentData.java ++++ net/minecraft/src/EnchantmentData.java +@@ -1,16 +1,20 @@ + package net.minecraft.src; + + public class EnchantmentData extends WeightedRandomItem { ++ ++ /** Enchantment object associated with this EnchantmentData */ + public final Enchantment enchantmentobj; ++ ++ /** Enchantment level associated with this EnchantmentData */ + public final int enchantmentLevel; + +- public EnchantmentData(Enchantment var1, int var2) { +- super(var1.getWeight()); +- this.enchantmentobj = var1; +- this.enchantmentLevel = var2; ++ public EnchantmentData(Enchantment par1Enchantment, int par2) { ++ super(par1Enchantment.getWeight()); ++ this.enchantmentobj = par1Enchantment; ++ this.enchantmentLevel = par2; + } + +- public EnchantmentData(int var1, int var2) { +- this(Enchantment.enchantmentsList[var1], var2); ++ public EnchantmentData(int par1, int par2) { ++ this(Enchantment.enchantmentsList[par1], par2); + } + } diff --git a/patches/net/minecraft/src/EnchantmentDigging.java.patch b/patches/net/minecraft/src/EnchantmentDigging.java.patch new file mode 100644 index 0000000..fa2f213 --- /dev/null +++ b/patches/net/minecraft/src/EnchantmentDigging.java.patch @@ -0,0 +1,48 @@ +--- net/minecraft/src/EnchantmentDigging.java ++++ net/minecraft/src/EnchantmentDigging.java +@@ -1,24 +1,33 @@ + package net.minecraft.src; + + public class EnchantmentDigging extends Enchantment { +- protected EnchantmentDigging(int var1, int var2) { +- super(var1, var2, EnumEnchantmentType.digger); ++ protected EnchantmentDigging(int par1, int par2) { ++ super(par1, par2, EnumEnchantmentType.digger); + this.setName("digging"); + } + +- public int getMinEnchantability(int var1) { +- return 1 + 10 * (var1 - 1); +- } +- +- public int getMaxEnchantability(int var1) { +- return super.getMinEnchantability(var1) + 50; +- } +- ++ /** ++ * Returns the minimal value of enchantability needed on the enchantment level passed. ++ */ ++ public int getMinEnchantability(int par1) { ++ return 1 + 10 * (par1 - 1); ++ } ++ ++ /** ++ * Returns the maximum value of enchantability nedded on the enchantment level passed. ++ */ ++ public int getMaxEnchantability(int par1) { ++ return super.getMinEnchantability(par1) + 50; ++ } ++ ++ /** ++ * Returns the maximum level that the enchantment can have. ++ */ + public int getMaxLevel() { + return 5; + } + +- public boolean canApply(ItemStack var1) { +- return var1.getItem().itemID == Item.shears.itemID ? true : super.canApply(var1); ++ public boolean canApply(ItemStack par1ItemStack) { ++ return par1ItemStack.getItem().itemID == Item.shears.itemID ? true : super.canApply(par1ItemStack); + } + } diff --git a/patches/net/minecraft/src/EnchantmentDurability.java.patch b/patches/net/minecraft/src/EnchantmentDurability.java.patch new file mode 100644 index 0000000..fbc4199 --- /dev/null +++ b/patches/net/minecraft/src/EnchantmentDurability.java.patch @@ -0,0 +1,59 @@ +--- net/minecraft/src/EnchantmentDurability.java ++++ net/minecraft/src/EnchantmentDurability.java +@@ -3,28 +3,42 @@ + import java.util.Random; + + public class EnchantmentDurability extends Enchantment { +- protected EnchantmentDurability(int var1, int var2) { +- super(var1, var2, EnumEnchantmentType.digger); ++ protected EnchantmentDurability(int par1, int par2) { ++ super(par1, par2, EnumEnchantmentType.digger); + this.setName("durability"); + } + +- public int getMinEnchantability(int var1) { +- return 5 + (var1 - 1) * 8; +- } +- +- public int getMaxEnchantability(int var1) { +- return super.getMinEnchantability(var1) + 50; +- } +- ++ /** ++ * Returns the minimal value of enchantability needed on the enchantment level passed. ++ */ ++ public int getMinEnchantability(int par1) { ++ return 5 + (par1 - 1) * 8; ++ } ++ ++ /** ++ * Returns the maximum value of enchantability nedded on the enchantment level passed. ++ */ ++ public int getMaxEnchantability(int par1) { ++ return super.getMinEnchantability(par1) + 50; ++ } ++ ++ /** ++ * Returns the maximum level that the enchantment can have. ++ */ + public int getMaxLevel() { + return 3; + } + +- public boolean canApply(ItemStack var1) { +- return var1.isItemStackDamageable() ? true : super.canApply(var1); ++ public boolean canApply(ItemStack par1ItemStack) { ++ return par1ItemStack.isItemStackDamageable() ? true : super.canApply(par1ItemStack); + } + +- public static boolean negateDamage(ItemStack var0, int var1, Random var2) { +- return var0.getItem() instanceof ItemArmor && var2.nextFloat() < 0.6F ? false : var2.nextInt(var1 + 1) > 0; ++ /** ++ * Used by ItemStack.attemptDamageItem. Randomly determines if a point of damage should be negated using the ++ * enchantment level (par1). If the ItemStack is Armor then there is a flat 60% chance for damage to be negated no ++ * matter the enchantment level, otherwise there is a 1-(par/1) chance for damage to be negated. ++ */ ++ public static boolean negateDamage(ItemStack par0ItemStack, int par1, Random par2Random) { ++ return par0ItemStack.getItem() instanceof ItemArmor && par2Random.nextFloat() < 0.6F ? false : par2Random.nextInt(par1 + 1) > 0; + } + } diff --git a/patches/net/minecraft/src/EnchantmentFireAspect.java.patch b/patches/net/minecraft/src/EnchantmentFireAspect.java.patch new file mode 100644 index 0000000..3f84ec4 --- /dev/null +++ b/patches/net/minecraft/src/EnchantmentFireAspect.java.patch @@ -0,0 +1,41 @@ +--- net/minecraft/src/EnchantmentFireAspect.java ++++ net/minecraft/src/EnchantmentFireAspect.java +@@ -1,19 +1,28 @@ + package net.minecraft.src; + + public class EnchantmentFireAspect extends Enchantment { +- protected EnchantmentFireAspect(int var1, int var2) { +- super(var1, var2, EnumEnchantmentType.weapon); ++ protected EnchantmentFireAspect(int par1, int par2) { ++ super(par1, par2, EnumEnchantmentType.weapon); + this.setName("fire"); + } + +- public int getMinEnchantability(int var1) { +- return 10 + 20 * (var1 - 1); +- } +- +- public int getMaxEnchantability(int var1) { +- return super.getMinEnchantability(var1) + 50; +- } +- ++ /** ++ * Returns the minimal value of enchantability needed on the enchantment level passed. ++ */ ++ public int getMinEnchantability(int par1) { ++ return 10 + 20 * (par1 - 1); ++ } ++ ++ /** ++ * Returns the maximum value of enchantability nedded on the enchantment level passed. ++ */ ++ public int getMaxEnchantability(int par1) { ++ return super.getMinEnchantability(par1) + 50; ++ } ++ ++ /** ++ * Returns the maximum level that the enchantment can have. ++ */ + public int getMaxLevel() { + return 2; + } diff --git a/patches/net/minecraft/src/EnchantmentHelper.java.patch b/patches/net/minecraft/src/EnchantmentHelper.java.patch new file mode 100644 index 0000000..dd16a3c --- /dev/null +++ b/patches/net/minecraft/src/EnchantmentHelper.java.patch @@ -0,0 +1,524 @@ +--- net/minecraft/src/EnchantmentHelper.java ++++ net/minecraft/src/EnchantmentHelper.java +@@ -9,22 +9,37 @@ + import java.util.Random; + + public class EnchantmentHelper { +- private static final Random a = new Random(); ++ ++ /** Is the random seed of enchantment effects. */ ++ private static final Random enchantmentRand = new Random(); ++ ++ /** ++ * Used to calculate the extra armor of enchantments on armors equipped on player. ++ */ + private static final EnchantmentModifierDamage enchantmentModifierDamage = new EnchantmentModifierDamage((Empty3)null); ++ ++ /** ++ * Used to calculate the (magic) extra damage done by enchantments on current equipped item of player. ++ */ + private static final EnchantmentModifierLiving enchantmentModifierLiving = new EnchantmentModifierLiving((Empty3)null); + +- public static int getEnchantmentLevel(int var0, ItemStack var1) { +- if(var1 == null) { ++ /** ++ * Returns the level of enchantment on the ItemStack passed. ++ */ ++ public static int getEnchantmentLevel(int par0, ItemStack par1ItemStack) { ++ if (par1ItemStack == null) { + return 0; + } else { +- NBTTagList var2 = var1.getEnchantmentTagList(); +- if(var2 == null) { ++ NBTTagList var2 = par1ItemStack.getEnchantmentTagList(); ++ ++ if (var2 == null) { + return 0; + } else { +- for(int var3 = 0; var3 < var2.tagCount(); ++var3) { ++ for (int var3 = 0; var3 < var2.tagCount(); ++var3) { + short var4 = ((NBTTagCompound)var2.tagAt(var3)).getShort("id"); + short var5 = ((NBTTagCompound)var2.tagAt(var3)).getShort("lvl"); +- if(var4 == var0) { ++ ++ if (var4 == par0) { + return var5; + } + } +@@ -34,11 +49,15 @@ + } + } + +- public static Map getEnchantments(ItemStack var0) { ++ /** ++ * Return the enchantments for the specified stack. ++ */ ++ public static Map getEnchantments(ItemStack par0ItemStack) { + LinkedHashMap var1 = new LinkedHashMap(); +- NBTTagList var2 = var0.itemID == Item.enchantedBook.itemID ? Item.enchantedBook.func_92110_g(var0) : var0.getEnchantmentTagList(); +- if(var2 != null) { +- for(int var3 = 0; var3 < var2.tagCount(); ++var3) { ++ NBTTagList var2 = par0ItemStack.itemID == Item.enchantedBook.itemID ? Item.enchantedBook.func_92110_g(par0ItemStack) : par0ItemStack.getEnchantmentTagList(); ++ ++ if (var2 != null) { ++ for (int var3 = 0; var3 < var2.tagCount(); ++var3) { + short var4 = ((NBTTagCompound)var2.tagAt(var3)).getShort("id"); + short var5 = ((NBTTagCompound)var2.tagAt(var3)).getShort("lvl"); + var1.put(Integer.valueOf(var4), Integer.valueOf(var5)); +@@ -48,43 +67,50 @@ + return var1; + } + +- public static void setEnchantments(Map var0, ItemStack var1) { ++ /** ++ * Set the enchantments for the specified stack. ++ */ ++ public static void setEnchantments(Map par0Map, ItemStack par1ItemStack) { + NBTTagList var2 = new NBTTagList(); +- Iterator var3 = var0.keySet().iterator(); ++ Iterator var3 = par0Map.keySet().iterator(); + +- while(var3.hasNext()) { ++ while (var3.hasNext()) { + int var4 = ((Integer)var3.next()).intValue(); + NBTTagCompound var5 = new NBTTagCompound(); + var5.setShort("id", (short)var4); +- var5.setShort("lvl", (short)((Integer)var0.get(Integer.valueOf(var4))).intValue()); ++ var5.setShort("lvl", (short)((Integer)par0Map.get(Integer.valueOf(var4))).intValue()); + var2.appendTag(var5); +- if(var1.itemID == Item.enchantedBook.itemID) { +- Item.enchantedBook.addEnchantment(var1, new EnchantmentData(var4, ((Integer)var0.get(Integer.valueOf(var4))).intValue())); +- } +- } +- +- if(var2.tagCount() > 0) { +- if(var1.itemID != Item.enchantedBook.itemID) { +- var1.setTagInfo("ench", var2); +- } +- } else if(var1.hasTagCompound()) { +- var1.getTagCompound().removeTag("ench"); +- } +- ++ ++ if (par1ItemStack.itemID == Item.enchantedBook.itemID) { ++ Item.enchantedBook.addEnchantment(par1ItemStack, new EnchantmentData(var4, ((Integer)par0Map.get(Integer.valueOf(var4))).intValue())); ++ } ++ } ++ ++ if (var2.tagCount() > 0) { ++ if (par1ItemStack.itemID != Item.enchantedBook.itemID) { ++ par1ItemStack.setTagInfo("ench", var2); ++ } ++ } else if (par1ItemStack.hasTagCompound()) { ++ par1ItemStack.getTagCompound().removeTag("ench"); ++ } + } + +- public static int getMaxEnchantmentLevel(int var0, ItemStack[] var1) { +- if(var1 == null) { ++ /** ++ * Returns the biggest level of the enchantment on the array of ItemStack passed. ++ */ ++ public static int getMaxEnchantmentLevel(int par0, ItemStack[] par1ArrayOfItemStack) { ++ if (par1ArrayOfItemStack == null) { + return 0; + } else { + int var2 = 0; +- ItemStack[] var3 = var1; +- int var4 = var1.length; ++ ItemStack[] var3 = par1ArrayOfItemStack; ++ int var4 = par1ArrayOfItemStack.length; + +- for(int var5 = 0; var5 < var4; ++var5) { ++ for (int var5 = 0; var5 < var4; ++var5) { + ItemStack var6 = var3[var5]; +- int var7 = getEnchantmentLevel(var0, var6); +- if(var7 > var2) { ++ int var7 = getEnchantmentLevel(par0, var6); ++ ++ if (var7 > var2) { + var2 = var7; + } + } +@@ -93,94 +119,129 @@ + } + } + +- private static void applyEnchantmentModifier(IEnchantmentModifier var0, ItemStack var1) { +- if(var1 != null) { +- NBTTagList var2 = var1.getEnchantmentTagList(); +- if(var2 != null) { +- for(int var3 = 0; var3 < var2.tagCount(); ++var3) { ++ /** ++ * Executes the enchantment modifier on the ItemStack passed. ++ */ ++ private static void applyEnchantmentModifier(IEnchantmentModifier par0IEnchantmentModifier, ItemStack par1ItemStack) { ++ if (par1ItemStack != null) { ++ NBTTagList var2 = par1ItemStack.getEnchantmentTagList(); ++ ++ if (var2 != null) { ++ for (int var3 = 0; var3 < var2.tagCount(); ++var3) { + short var4 = ((NBTTagCompound)var2.tagAt(var3)).getShort("id"); + short var5 = ((NBTTagCompound)var2.tagAt(var3)).getShort("lvl"); +- if(Enchantment.enchantmentsList[var4] != null) { +- var0.calculateModifier(Enchantment.enchantmentsList[var4], var5); ++ ++ if (Enchantment.enchantmentsList[var4] != null) { ++ par0IEnchantmentModifier.calculateModifier(Enchantment.enchantmentsList[var4], var5); + } + } +- + } + } + } + +- private static void applyEnchantmentModifierArray(IEnchantmentModifier var0, ItemStack[] var1) { +- ItemStack[] var2 = var1; +- int var3 = var1.length; ++ /** ++ * Executes the enchantment modifier on the array of ItemStack passed. ++ */ ++ private static void applyEnchantmentModifierArray(IEnchantmentModifier par0IEnchantmentModifier, ItemStack[] par1ArrayOfItemStack) { ++ ItemStack[] var2 = par1ArrayOfItemStack; ++ int var3 = par1ArrayOfItemStack.length; + +- for(int var4 = 0; var4 < var3; ++var4) { ++ for (int var4 = 0; var4 < var3; ++var4) { + ItemStack var5 = var2[var4]; +- applyEnchantmentModifier(var0, var5); ++ applyEnchantmentModifier(par0IEnchantmentModifier, var5); + } +- + } + +- public static int getEnchantmentModifierDamage(ItemStack[] var0, DamageSource var1) { ++ /** ++ * Returns the modifier of protection enchantments on armors equipped on player. ++ */ ++ public static int getEnchantmentModifierDamage(ItemStack[] par0ArrayOfItemStack, DamageSource par1DamageSource) { + enchantmentModifierDamage.damageModifier = 0; +- enchantmentModifierDamage.source = var1; +- applyEnchantmentModifierArray(enchantmentModifierDamage, var0); +- if(enchantmentModifierDamage.damageModifier > 25) { ++ enchantmentModifierDamage.source = par1DamageSource; ++ applyEnchantmentModifierArray(enchantmentModifierDamage, par0ArrayOfItemStack); ++ ++ if (enchantmentModifierDamage.damageModifier > 25) { + enchantmentModifierDamage.damageModifier = 25; + } + +- return (enchantmentModifierDamage.damageModifier + 1 >> 1) + a.nextInt((enchantmentModifierDamage.damageModifier >> 1) + 1); ++ return (enchantmentModifierDamage.damageModifier + 1 >> 1) + enchantmentRand.nextInt((enchantmentModifierDamage.damageModifier >> 1) + 1); + } + +- public static float getEnchantmentModifierLiving(EntityLivingBase var0, EntityLivingBase var1) { ++ /** ++ * Return the (magic) extra damage of the enchantments on player equipped item. ++ */ ++ public static float getEnchantmentModifierLiving(EntityLivingBase par0EntityLivingBase, EntityLivingBase par1EntityLivingBase) { + enchantmentModifierLiving.livingModifier = 0.0F; +- enchantmentModifierLiving.entityLiving = var1; +- applyEnchantmentModifier(enchantmentModifierLiving, var0.getHeldItem()); ++ enchantmentModifierLiving.entityLiving = par1EntityLivingBase; ++ applyEnchantmentModifier(enchantmentModifierLiving, par0EntityLivingBase.getHeldItem()); + return enchantmentModifierLiving.livingModifier; + } + +- public static int getKnockbackModifier(EntityLivingBase var0, EntityLivingBase var1) { +- return getEnchantmentLevel(Enchantment.knockback.effectId, var0.getHeldItem()); +- } +- +- public static int getFireAspectModifier(EntityLivingBase var0) { +- return getEnchantmentLevel(Enchantment.fireAspect.effectId, var0.getHeldItem()); +- } +- +- public static int getRespiration(EntityLivingBase var0) { +- return getMaxEnchantmentLevel(Enchantment.respiration.effectId, var0.getInventory()); +- } +- +- public static int getEfficiencyModifier(EntityLivingBase var0) { +- return getEnchantmentLevel(Enchantment.efficiency.effectId, var0.getHeldItem()); +- } +- +- public static boolean getSilkTouchModifier(EntityLivingBase var0) { +- return getEnchantmentLevel(Enchantment.silkTouch.effectId, var0.getHeldItem()) > 0; +- } +- +- public static int getFortuneModifier(EntityLivingBase var0) { +- return getEnchantmentLevel(Enchantment.fortune.effectId, var0.getHeldItem()); +- } +- +- public static int getLootingModifier(EntityLivingBase var0) { +- return getEnchantmentLevel(Enchantment.looting.effectId, var0.getHeldItem()); +- } +- +- public static boolean getAquaAffinityModifier(EntityLivingBase var0) { +- return getMaxEnchantmentLevel(Enchantment.aquaAffinity.effectId, var0.getInventory()) > 0; +- } +- +- public static int func_92098_i(EntityLivingBase var0) { +- return getMaxEnchantmentLevel(Enchantment.thorns.effectId, var0.getInventory()); +- } +- +- public static ItemStack func_92099_a(Enchantment var0, EntityLivingBase var1) { +- ItemStack[] var2 = var1.getInventory(); ++ /** ++ * Returns the knockback value of enchantments on equipped player item. ++ */ ++ public static int getKnockbackModifier(EntityLivingBase par0EntityLivingBase, EntityLivingBase par1EntityLivingBase) { ++ return getEnchantmentLevel(Enchantment.knockback.effectId, par0EntityLivingBase.getHeldItem()); ++ } ++ ++ public static int getFireAspectModifier(EntityLivingBase par0EntityLivingBase) { ++ return getEnchantmentLevel(Enchantment.fireAspect.effectId, par0EntityLivingBase.getHeldItem()); ++ } ++ ++ /** ++ * Returns the 'Water Breathing' modifier of enchantments on player equipped armors. ++ */ ++ public static int getRespiration(EntityLivingBase par0EntityLivingBase) { ++ return getMaxEnchantmentLevel(Enchantment.respiration.effectId, par0EntityLivingBase.getLastActiveItems()); ++ } ++ ++ /** ++ * Return the extra efficiency of tools based on enchantments on equipped player item. ++ */ ++ public static int getEfficiencyModifier(EntityLivingBase par0EntityLivingBase) { ++ return getEnchantmentLevel(Enchantment.efficiency.effectId, par0EntityLivingBase.getHeldItem()); ++ } ++ ++ /** ++ * Returns the silk touch status of enchantments on current equipped item of player. ++ */ ++ public static boolean getSilkTouchModifier(EntityLivingBase par0EntityLivingBase) { ++ return getEnchantmentLevel(Enchantment.silkTouch.effectId, par0EntityLivingBase.getHeldItem()) > 0; ++ } ++ ++ /** ++ * Returns the fortune enchantment modifier of the current equipped item of player. ++ */ ++ public static int getFortuneModifier(EntityLivingBase par0EntityLivingBase) { ++ return getEnchantmentLevel(Enchantment.fortune.effectId, par0EntityLivingBase.getHeldItem()); ++ } ++ ++ /** ++ * Returns the looting enchantment modifier of the current equipped item of player. ++ */ ++ public static int getLootingModifier(EntityLivingBase par0EntityLivingBase) { ++ return getEnchantmentLevel(Enchantment.looting.effectId, par0EntityLivingBase.getHeldItem()); ++ } ++ ++ /** ++ * Returns the aqua affinity status of enchantments on current equipped item of player. ++ */ ++ public static boolean getAquaAffinityModifier(EntityLivingBase par0EntityLivingBase) { ++ return getMaxEnchantmentLevel(Enchantment.aquaAffinity.effectId, par0EntityLivingBase.getLastActiveItems()) > 0; ++ } ++ ++ public static int func_92098_i(EntityLivingBase par0EntityLivingBase) { ++ return getMaxEnchantmentLevel(Enchantment.thorns.effectId, par0EntityLivingBase.getLastActiveItems()); ++ } ++ ++ public static ItemStack func_92099_a(Enchantment par0Enchantment, EntityLivingBase par1EntityLivingBase) { ++ ItemStack[] var2 = par1EntityLivingBase.getLastActiveItems(); + int var3 = var2.length; + +- for(int var4 = 0; var4 < var3; ++var4) { ++ for (int var4 = 0; var4 < var3; ++var4) { + ItemStack var5 = var2[var4]; +- if(var5 != null && getEnchantmentLevel(var0.effectId, var5) > 0) { ++ ++ if (var5 != null && getEnchantmentLevel(par0Enchantment.effectId, var5) > 0) { + return var5; + } + } +@@ -188,90 +249,114 @@ + return null; + } + +- public static int calcItemStackEnchantability(Random var0, int var1, int var2, ItemStack var3) { +- Item var4 = var3.getItem(); ++ /** ++ * Returns the enchantability of itemstack, it's uses a singular formula for each index (2nd parameter: 0, 1 and 2), ++ * cutting to the max enchantability power of the table (3rd parameter) ++ */ ++ public static int calcItemStackEnchantability(Random par0Random, int par1, int par2, ItemStack par3ItemStack) { ++ Item var4 = par3ItemStack.getItem(); + int var5 = var4.getItemEnchantability(); +- if(var5 <= 0) { ++ ++ if (var5 <= 0) { + return 0; + } else { +- if(var2 > 15) { +- var2 = 15; ++ if (par2 > 15) { ++ par2 = 15; + } + +- int var6 = var0.nextInt(8) + 1 + (var2 >> 1) + var0.nextInt(var2 + 1); +- return var1 == 0 ? Math.max(var6 / 3, 1) : (var1 == 1 ? var6 * 2 / 3 + 1 : Math.max(var6, var2 * 2)); ++ int var6 = par0Random.nextInt(8) + 1 + (par2 >> 1) + par0Random.nextInt(par2 + 1); ++ return par1 == 0 ? Math.max(var6 / 3, 1) : (par1 == 1 ? var6 * 2 / 3 + 1 : Math.max(var6, par2 * 2)); + } + } + +- public static ItemStack addRandomEnchantment(Random var0, ItemStack var1, int var2) { +- List var3 = buildEnchantmentList(var0, var1, var2); +- boolean var4 = var1.itemID == Item.book.itemID; +- if(var4) { +- var1.itemID = Item.enchantedBook.itemID; ++ /** ++ * Adds a random enchantment to the specified item. Args: random, itemStack, enchantabilityLevel ++ */ ++ public static ItemStack addRandomEnchantment(Random par0Random, ItemStack par1ItemStack, int par2) { ++ List var3 = buildEnchantmentList(par0Random, par1ItemStack, par2); ++ boolean var4 = par1ItemStack.itemID == Item.book.itemID; ++ ++ if (var4) { ++ par1ItemStack.itemID = Item.enchantedBook.itemID; + } + +- if(var3 != null) { ++ if (var3 != null) { + Iterator var5 = var3.iterator(); + +- while(var5.hasNext()) { ++ while (var5.hasNext()) { + EnchantmentData var6 = (EnchantmentData)var5.next(); +- if(var4) { +- Item.enchantedBook.addEnchantment(var1, var6); ++ ++ if (var4) { ++ Item.enchantedBook.addEnchantment(par1ItemStack, var6); + } else { +- var1.addEnchantment(var6.enchantmentobj, var6.enchantmentLevel); ++ par1ItemStack.addEnchantment(var6.enchantmentobj, var6.enchantmentLevel); + } + } + } + +- return var1; ++ return par1ItemStack; + } + +- public static List buildEnchantmentList(Random var0, ItemStack var1, int var2) { +- Item var3 = var1.getItem(); ++ /** ++ * Create a list of random EnchantmentData (enchantments) that can be added together to the ItemStack, the 3rd ++ * parameter is the total enchantability level. ++ */ ++ public static List buildEnchantmentList(Random par0Random, ItemStack par1ItemStack, int par2) { ++ Item var3 = par1ItemStack.getItem(); + int var4 = var3.getItemEnchantability(); +- if(var4 <= 0) { ++ ++ if (var4 <= 0) { + return null; + } else { + var4 /= 2; +- var4 = 1 + var0.nextInt((var4 >> 1) + 1) + var0.nextInt((var4 >> 1) + 1); +- int var5 = var4 + var2; +- float var6 = (var0.nextFloat() + var0.nextFloat() - 1.0F) * 0.15F; ++ var4 = 1 + par0Random.nextInt((var4 >> 1) + 1) + par0Random.nextInt((var4 >> 1) + 1); ++ int var5 = var4 + par2; ++ float var6 = (par0Random.nextFloat() + par0Random.nextFloat() - 1.0F) * 0.15F; + int var7 = (int)((float)var5 * (1.0F + var6) + 0.5F); +- if(var7 < 1) { ++ ++ if (var7 < 1) { + var7 = 1; + } + + ArrayList var8 = null; +- Map var9 = mapEnchantmentData(var7, var1); +- if(var9 != null && !var9.isEmpty()) { +- EnchantmentData var10 = (EnchantmentData)WeightedRandom.getRandomItem(var0, var9.values()); +- if(var10 != null) { ++ Map var9 = mapEnchantmentData(var7, par1ItemStack); ++ ++ if (var9 != null && !var9.isEmpty()) { ++ EnchantmentData var10 = (EnchantmentData)WeightedRandom.getRandomItem(par0Random, var9.values()); ++ ++ if (var10 != null) { + var8 = new ArrayList(); + var8.add(var10); + +- for(int var11 = var7; var0.nextInt(50) <= var11; var11 >>= 1) { ++ for (int var11 = var7; par0Random.nextInt(50) <= var11; var11 >>= 1) { + Iterator var12 = var9.keySet().iterator(); + +- while(var12.hasNext()) { ++ while (var12.hasNext()) { + Integer var13 = (Integer)var12.next(); + boolean var14 = true; + Iterator var15 = var8.iterator(); + +- while(var15.hasNext()) { +- EnchantmentData var16 = (EnchantmentData)var15.next(); +- if(!var16.enchantmentobj.canApplyTogether(Enchantment.enchantmentsList[var13.intValue()])) { ++ while (true) { ++ if (var15.hasNext()) { ++ EnchantmentData var16 = (EnchantmentData)var15.next(); ++ ++ if (var16.enchantmentobj.canApplyTogether(Enchantment.enchantmentsList[var13.intValue()])) { ++ continue; ++ } ++ + var14 = false; +- break; +- } +- } +- +- if(!var14) { +- var12.remove(); ++ } ++ ++ if (!var14) { ++ var12.remove(); ++ } ++ ++ break; + } + } + +- if(!var9.isEmpty()) { +- EnchantmentData var17 = (EnchantmentData)WeightedRandom.getRandomItem(var0, var9.values()); ++ if (!var9.isEmpty()) { ++ EnchantmentData var17 = (EnchantmentData)WeightedRandom.getRandomItem(par0Random, var9.values()); + var8.add(var17); + } + } +@@ -282,19 +367,24 @@ + } + } + +- public static Map mapEnchantmentData(int var0, ItemStack var1) { +- Item var2 = var1.getItem(); ++ /** ++ * Creates a 'Map' of EnchantmentData (enchantments) possible to add on the ItemStack and the enchantability level ++ * passed. ++ */ ++ public static Map mapEnchantmentData(int par0, ItemStack par1ItemStack) { ++ Item var2 = par1ItemStack.getItem(); + HashMap var3 = null; +- boolean var4 = var1.itemID == Item.book.itemID; ++ boolean var4 = par1ItemStack.itemID == Item.book.itemID; + Enchantment[] var5 = Enchantment.enchantmentsList; + int var6 = var5.length; + +- for(int var7 = 0; var7 < var6; ++var7) { ++ for (int var7 = 0; var7 < var6; ++var7) { + Enchantment var8 = var5[var7]; +- if(var8 != null && (var8.type.canEnchantItem(var2) || var4)) { +- for(int var9 = var8.getMinLevel(); var9 <= var8.getMaxLevel(); ++var9) { +- if(var0 >= var8.getMinEnchantability(var9) && var0 <= var8.getMaxEnchantability(var9)) { +- if(var3 == null) { ++ ++ if (var8 != null && (var8.type.canEnchantItem(var2) || var4)) { ++ for (int var9 = var8.getMinLevel(); var9 <= var8.getMaxLevel(); ++var9) { ++ if (par0 >= var8.getMinEnchantability(var9) && par0 <= var8.getMaxEnchantability(var9)) { ++ if (var3 == null) { + var3 = new HashMap(); + } + diff --git a/patches/net/minecraft/src/EnchantmentKnockback.java.patch b/patches/net/minecraft/src/EnchantmentKnockback.java.patch new file mode 100644 index 0000000..a196b1d --- /dev/null +++ b/patches/net/minecraft/src/EnchantmentKnockback.java.patch @@ -0,0 +1,41 @@ +--- net/minecraft/src/EnchantmentKnockback.java ++++ net/minecraft/src/EnchantmentKnockback.java +@@ -1,19 +1,28 @@ + package net.minecraft.src; + + public class EnchantmentKnockback extends Enchantment { +- protected EnchantmentKnockback(int var1, int var2) { +- super(var1, var2, EnumEnchantmentType.weapon); ++ protected EnchantmentKnockback(int par1, int par2) { ++ super(par1, par2, EnumEnchantmentType.weapon); + this.setName("knockback"); + } + +- public int getMinEnchantability(int var1) { +- return 5 + 20 * (var1 - 1); +- } +- +- public int getMaxEnchantability(int var1) { +- return super.getMinEnchantability(var1) + 50; +- } +- ++ /** ++ * Returns the minimal value of enchantability needed on the enchantment level passed. ++ */ ++ public int getMinEnchantability(int par1) { ++ return 5 + 20 * (par1 - 1); ++ } ++ ++ /** ++ * Returns the maximum value of enchantability nedded on the enchantment level passed. ++ */ ++ public int getMaxEnchantability(int par1) { ++ return super.getMinEnchantability(par1) + 50; ++ } ++ ++ /** ++ * Returns the maximum level that the enchantment can have. ++ */ + public int getMaxLevel() { + return 2; + } diff --git a/patches/net/minecraft/src/EnchantmentLootBonus.java.patch b/patches/net/minecraft/src/EnchantmentLootBonus.java.patch new file mode 100644 index 0000000..538a085 --- /dev/null +++ b/patches/net/minecraft/src/EnchantmentLootBonus.java.patch @@ -0,0 +1,59 @@ +--- net/minecraft/src/EnchantmentLootBonus.java ++++ net/minecraft/src/EnchantmentLootBonus.java +@@ -1,28 +1,40 @@ + package net.minecraft.src; + + public class EnchantmentLootBonus extends Enchantment { +- protected EnchantmentLootBonus(int var1, int var2, EnumEnchantmentType var3) { +- super(var1, var2, var3); ++ protected EnchantmentLootBonus(int par1, int par2, EnumEnchantmentType par3EnumEnchantmentType) { ++ super(par1, par2, par3EnumEnchantmentType); + this.setName("lootBonus"); +- if(var3 == EnumEnchantmentType.digger) { ++ ++ if (par3EnumEnchantmentType == EnumEnchantmentType.digger) { + this.setName("lootBonusDigger"); + } +- +- } +- +- public int getMinEnchantability(int var1) { +- return 15 + (var1 - 1) * 9; +- } +- +- public int getMaxEnchantability(int var1) { +- return super.getMinEnchantability(var1) + 50; +- } +- ++ } ++ ++ /** ++ * Returns the minimal value of enchantability needed on the enchantment level passed. ++ */ ++ public int getMinEnchantability(int par1) { ++ return 15 + (par1 - 1) * 9; ++ } ++ ++ /** ++ * Returns the maximum value of enchantability nedded on the enchantment level passed. ++ */ ++ public int getMaxEnchantability(int par1) { ++ return super.getMinEnchantability(par1) + 50; ++ } ++ ++ /** ++ * Returns the maximum level that the enchantment can have. ++ */ + public int getMaxLevel() { + return 3; + } + +- public boolean canApplyTogether(Enchantment var1) { +- return super.canApplyTogether(var1) && var1.effectId != silkTouch.effectId; ++ /** ++ * Determines if the enchantment passed can be applyied together with this enchantment. ++ */ ++ public boolean canApplyTogether(Enchantment par1Enchantment) { ++ return super.canApplyTogether(par1Enchantment) && par1Enchantment.effectId != silkTouch.effectId; + } + } diff --git a/patches/net/minecraft/src/EnchantmentModifierDamage.java.patch b/patches/net/minecraft/src/EnchantmentModifierDamage.java.patch new file mode 100644 index 0000000..80f1eaf --- /dev/null +++ b/patches/net/minecraft/src/EnchantmentModifierDamage.java.patch @@ -0,0 +1,39 @@ +--- net/minecraft/src/EnchantmentModifierDamage.java ++++ net/minecraft/src/EnchantmentModifierDamage.java +@@ -1,17 +1,28 @@ + package net.minecraft.src; + + final class EnchantmentModifierDamage implements IEnchantmentModifier { ++ ++ /** ++ * Used to calculate the damage modifier (extra armor) on enchantments that the player have on equipped armors. ++ */ + public int damageModifier; ++ ++ /** ++ * Used as parameter to calculate the damage modifier (extra armor) on enchantments that the player have on equipped ++ * armors. ++ */ + public DamageSource source; + +- private EnchantmentModifierDamage() { +- } +- +- public void calculateModifier(Enchantment var1, int var2) { +- this.damageModifier += var1.calcModifierDamage(var2, this.source); +- } +- +- EnchantmentModifierDamage(Empty3 var1) { ++ private EnchantmentModifierDamage() {} ++ ++ /** ++ * Generic method use to calculate modifiers of offensive or defensive enchantment values. ++ */ ++ public void calculateModifier(Enchantment par1Enchantment, int par2) { ++ this.damageModifier += par1Enchantment.calcModifierDamage(par2, this.source); ++ } ++ ++ EnchantmentModifierDamage(Empty3 par1Empty3) { + this(); + } + } diff --git a/patches/net/minecraft/src/EnchantmentModifierLiving.java.patch b/patches/net/minecraft/src/EnchantmentModifierLiving.java.patch new file mode 100644 index 0000000..7f62de7 --- /dev/null +++ b/patches/net/minecraft/src/EnchantmentModifierLiving.java.patch @@ -0,0 +1,38 @@ +--- net/minecraft/src/EnchantmentModifierLiving.java ++++ net/minecraft/src/EnchantmentModifierLiving.java +@@ -1,17 +1,27 @@ + package net.minecraft.src; + + final class EnchantmentModifierLiving implements IEnchantmentModifier { ++ ++ /** ++ * Used to calculate the (magic) extra damage based on enchantments of current equipped player item. ++ */ + public float livingModifier; ++ ++ /** ++ * Used as parameter to calculate the (magic) extra damage based on enchantments of current equipped player item. ++ */ + public EntityLivingBase entityLiving; + +- private EnchantmentModifierLiving() { +- } +- +- public void calculateModifier(Enchantment var1, int var2) { +- this.livingModifier += var1.calcModifierLiving(var2, this.entityLiving); +- } +- +- EnchantmentModifierLiving(Empty3 var1) { ++ private EnchantmentModifierLiving() {} ++ ++ /** ++ * Generic method use to calculate modifiers of offensive or defensive enchantment values. ++ */ ++ public void calculateModifier(Enchantment par1Enchantment, int par2) { ++ this.livingModifier += par1Enchantment.calcModifierLiving(par2, this.entityLiving); ++ } ++ ++ EnchantmentModifierLiving(Empty3 par1Empty3) { + this(); + } + } diff --git a/patches/net/minecraft/src/EnchantmentNameParts.java.patch b/patches/net/minecraft/src/EnchantmentNameParts.java.patch new file mode 100644 index 0000000..d820207 --- /dev/null +++ b/patches/net/minecraft/src/EnchantmentNameParts.java.patch @@ -0,0 +1,50 @@ +--- net/minecraft/src/EnchantmentNameParts.java ++++ net/minecraft/src/EnchantmentNameParts.java +@@ -3,26 +3,38 @@ + import java.util.Random; + + public class EnchantmentNameParts { ++ ++ /** The static instance of this class. */ + public static final EnchantmentNameParts instance = new EnchantmentNameParts(); +- private Random b = new Random(); +- private String[] c = "the elder scrolls klaatu berata niktu xyzzy bless curse light darkness fire air earth water hot dry cold wet ignite snuff embiggen twist shorten stretch fiddle destroy imbue galvanize enchant free limited range of towards inside sphere cube self other ball mental physical grow shrink demon elemental spirit animal creature beast humanoid undead fresh stale ".split(" "); +- ++ ++ /** The RNG used to generate enchant names. */ ++ private Random rand = new Random(); ++ ++ /** List of words used to generate an enchant name. */ ++ private String[] wordList = "the elder scrolls klaatu berata niktu xyzzy bless curse light darkness fire air earth water hot dry cold wet ignite snuff embiggen twist shorten stretch fiddle destroy imbue galvanize enchant free limited range of towards inside sphere cube self other ball mental physical grow shrink demon elemental spirit animal creature beast humanoid undead fresh stale ".split(" "); ++ ++ /** ++ * Generates a random enchant name. ++ */ + public String generateRandomEnchantName() { +- int var1 = this.b.nextInt(2) + 3; ++ int var1 = this.rand.nextInt(2) + 3; + String var2 = ""; + +- for(int var3 = 0; var3 < var1; ++var3) { +- if(var3 > 0) { ++ for (int var3 = 0; var3 < var1; ++var3) { ++ if (var3 > 0) { + var2 = var2 + " "; + } + +- var2 = var2 + this.c[this.b.nextInt(this.c.length)]; ++ var2 = var2 + this.wordList[this.rand.nextInt(this.wordList.length)]; + } + + return var2; + } + +- public void setRandSeed(long var1) { +- this.b.setSeed(var1); ++ /** ++ * Sets the seed for the enchant name RNG. ++ */ ++ public void setRandSeed(long par1) { ++ this.rand.setSeed(par1); + } + } diff --git a/patches/net/minecraft/src/EnchantmentOxygen.java.patch b/patches/net/minecraft/src/EnchantmentOxygen.java.patch new file mode 100644 index 0000000..804c219 --- /dev/null +++ b/patches/net/minecraft/src/EnchantmentOxygen.java.patch @@ -0,0 +1,41 @@ +--- net/minecraft/src/EnchantmentOxygen.java ++++ net/minecraft/src/EnchantmentOxygen.java +@@ -1,19 +1,28 @@ + package net.minecraft.src; + + public class EnchantmentOxygen extends Enchantment { +- public EnchantmentOxygen(int var1, int var2) { +- super(var1, var2, EnumEnchantmentType.armor_head); ++ public EnchantmentOxygen(int par1, int par2) { ++ super(par1, par2, EnumEnchantmentType.armor_head); + this.setName("oxygen"); + } + +- public int getMinEnchantability(int var1) { +- return 10 * var1; +- } +- +- public int getMaxEnchantability(int var1) { +- return this.getMinEnchantability(var1) + 30; +- } +- ++ /** ++ * Returns the minimal value of enchantability needed on the enchantment level passed. ++ */ ++ public int getMinEnchantability(int par1) { ++ return 10 * par1; ++ } ++ ++ /** ++ * Returns the maximum value of enchantability nedded on the enchantment level passed. ++ */ ++ public int getMaxEnchantability(int par1) { ++ return this.getMinEnchantability(par1) + 30; ++ } ++ ++ /** ++ * Returns the maximum level that the enchantment can have. ++ */ + public int getMaxLevel() { + return 3; + } diff --git a/patches/net/minecraft/src/EnchantmentProtection.java.patch b/patches/net/minecraft/src/EnchantmentProtection.java.patch new file mode 100644 index 0000000..92c318f --- /dev/null +++ b/patches/net/minecraft/src/EnchantmentProtection.java.patch @@ -0,0 +1,162 @@ +--- net/minecraft/src/EnchantmentProtection.java ++++ net/minecraft/src/EnchantmentProtection.java +@@ -1,70 +1,112 @@ + package net.minecraft.src; + + public class EnchantmentProtection extends Enchantment { +- private static final String[] C = new String[]{"all", "fire", "fall", "explosion", "projectile"}; +- private static final int[] baseEnchantability = new int[]{1, 10, 5, 5, 3}; +- private static final int[] levelEnchantability = new int[]{11, 8, 6, 8, 6}; +- private static final int[] thresholdEnchantability = new int[]{20, 12, 10, 12, 15}; ++ ++ /** Holds the name to be translated of each protection type. */ ++ private static final String[] protectionName = new String[] {"all", "fire", "fall", "explosion", "projectile"}; ++ ++ /** ++ * Holds the base factor of enchantability needed to be able to use the enchant. ++ */ ++ private static final int[] baseEnchantability = new int[] {1, 10, 5, 5, 3}; ++ ++ /** ++ * Holds how much each level increased the enchantability factor to be able to use this enchant. ++ */ ++ private static final int[] levelEnchantability = new int[] {11, 8, 6, 8, 6}; ++ ++ /** ++ * Used on the formula of base enchantability, this is the 'window' factor of values to be able to use thing enchant. ++ */ ++ private static final int[] thresholdEnchantability = new int[] {20, 12, 10, 12, 15}; ++ ++ /** ++ * Defines the type of protection of the enchantment, 0 = all, 1 = fire, 2 = fall (feather fall), 3 = explosion and 4 = ++ * projectile. ++ */ + public final int protectionType; + +- public EnchantmentProtection(int var1, int var2, int var3) { +- super(var1, var2, EnumEnchantmentType.armor); +- this.protectionType = var3; +- if(var3 == 2) { ++ public EnchantmentProtection(int par1, int par2, int par3) { ++ super(par1, par2, EnumEnchantmentType.armor); ++ this.protectionType = par3; ++ ++ if (par3 == 2) { + this.type = EnumEnchantmentType.armor_feet; + } +- +- } +- +- public int getMinEnchantability(int var1) { +- return baseEnchantability[this.protectionType] + (var1 - 1) * levelEnchantability[this.protectionType]; +- } +- +- public int getMaxEnchantability(int var1) { +- return this.getMinEnchantability(var1) + thresholdEnchantability[this.protectionType]; +- } +- ++ } ++ ++ /** ++ * Returns the minimal value of enchantability needed on the enchantment level passed. ++ */ ++ public int getMinEnchantability(int par1) { ++ return baseEnchantability[this.protectionType] + (par1 - 1) * levelEnchantability[this.protectionType]; ++ } ++ ++ /** ++ * Returns the maximum value of enchantability nedded on the enchantment level passed. ++ */ ++ public int getMaxEnchantability(int par1) { ++ return this.getMinEnchantability(par1) + thresholdEnchantability[this.protectionType]; ++ } ++ ++ /** ++ * Returns the maximum level that the enchantment can have. ++ */ + public int getMaxLevel() { + return 4; + } + +- public int calcModifierDamage(int var1, DamageSource var2) { +- if(var2.canHarmInCreative()) { ++ /** ++ * Calculates de damage protection of the enchantment based on level and damage source passed. ++ */ ++ public int calcModifierDamage(int par1, DamageSource par2DamageSource) { ++ if (par2DamageSource.canHarmInCreative()) { + return 0; + } else { +- float var3 = (float)(6 + var1 * var1) / 3.0F; +- return this.protectionType == 0 ? MathHelper.floor_float(var3 * (12.0F / 16.0F)) : (this.protectionType == 1 && var2.isFireDamage() ? MathHelper.floor_float(var3 * 1.25F) : (this.protectionType == 2 && var2 == DamageSource.fall ? MathHelper.floor_float(var3 * 2.5F) : (this.protectionType == 3 && var2.isExplosion() ? MathHelper.floor_float(var3 * 1.5F) : (this.protectionType == 4 && var2.isProjectile() ? MathHelper.floor_float(var3 * 1.5F) : 0)))); ++ float var3 = (float)(6 + par1 * par1) / 3.0F; ++ return this.protectionType == 0 ? MathHelper.floor_float(var3 * 0.75F) : (this.protectionType == 1 && par2DamageSource.isFireDamage() ? MathHelper.floor_float(var3 * 1.25F) : (this.protectionType == 2 && par2DamageSource == DamageSource.fall ? MathHelper.floor_float(var3 * 2.5F) : (this.protectionType == 3 && par2DamageSource.isExplosion() ? MathHelper.floor_float(var3 * 1.5F) : (this.protectionType == 4 && par2DamageSource.isProjectile() ? MathHelper.floor_float(var3 * 1.5F) : 0)))); + } + } + ++ /** ++ * Return the name of key in translation table of this enchantment. ++ */ + public String getName() { +- return "enchantment.protect." + C[this.protectionType]; ++ return "enchantment.protect." + protectionName[this.protectionType]; + } + +- public boolean canApplyTogether(Enchantment var1) { +- if(var1 instanceof EnchantmentProtection) { +- EnchantmentProtection var2 = (EnchantmentProtection)var1; ++ /** ++ * Determines if the enchantment passed can be applyied together with this enchantment. ++ */ ++ public boolean canApplyTogether(Enchantment par1Enchantment) { ++ if (par1Enchantment instanceof EnchantmentProtection) { ++ EnchantmentProtection var2 = (EnchantmentProtection)par1Enchantment; + return var2.protectionType == this.protectionType ? false : this.protectionType == 2 || var2.protectionType == 2; + } else { +- return super.canApplyTogether(var1); +- } +- } +- +- public static int getFireTimeForEntity(Entity var0, int var1) { +- int var2 = EnchantmentHelper.getMaxEnchantmentLevel(Enchantment.fireProtection.effectId, var0.getInventory()); +- if(var2 > 0) { +- var1 -= MathHelper.floor_float((float)var1 * (float)var2 * 0.15F); +- } +- +- return var1; +- } +- +- public static double func_92092_a(Entity var0, double var1) { +- int var3 = EnchantmentHelper.getMaxEnchantmentLevel(Enchantment.blastProtection.effectId, var0.getInventory()); +- if(var3 > 0) { +- var1 -= (double)MathHelper.floor_double(var1 * (double)((float)var3 * 0.15F)); +- } +- +- return var1; ++ return super.canApplyTogether(par1Enchantment); ++ } ++ } ++ ++ /** ++ * Gets the amount of ticks an entity should be set fire, adjusted for fire protection. ++ */ ++ public static int getFireTimeForEntity(Entity par0Entity, int par1) { ++ int var2 = EnchantmentHelper.getMaxEnchantmentLevel(Enchantment.fireProtection.effectId, par0Entity.getLastActiveItems()); ++ ++ if (var2 > 0) { ++ par1 -= MathHelper.floor_float((float)par1 * (float)var2 * 0.15F); ++ } ++ ++ return par1; ++ } ++ ++ public static double func_92092_a(Entity par0Entity, double par1) { ++ int var3 = EnchantmentHelper.getMaxEnchantmentLevel(Enchantment.blastProtection.effectId, par0Entity.getLastActiveItems()); ++ ++ if (var3 > 0) { ++ par1 -= (double)MathHelper.floor_double(par1 * (double)((float)var3 * 0.15F)); ++ } ++ ++ return par1; + } + } diff --git a/patches/net/minecraft/src/EnchantmentThorns.java.patch b/patches/net/minecraft/src/EnchantmentThorns.java.patch new file mode 100644 index 0000000..6478ebe --- /dev/null +++ b/patches/net/minecraft/src/EnchantmentThorns.java.patch @@ -0,0 +1,93 @@ +--- net/minecraft/src/EnchantmentThorns.java ++++ net/minecraft/src/EnchantmentThorns.java +@@ -3,47 +3,57 @@ + import java.util.Random; + + public class EnchantmentThorns extends Enchantment { +- public EnchantmentThorns(int var1, int var2) { +- super(var1, var2, EnumEnchantmentType.armor_torso); ++ public EnchantmentThorns(int par1, int par2) { ++ super(par1, par2, EnumEnchantmentType.armor_torso); + this.setName("thorns"); + } + +- public int getMinEnchantability(int var1) { +- return 10 + 20 * (var1 - 1); +- } +- +- public int getMaxEnchantability(int var1) { +- return super.getMinEnchantability(var1) + 50; +- } +- ++ /** ++ * Returns the minimal value of enchantability needed on the enchantment level passed. ++ */ ++ public int getMinEnchantability(int par1) { ++ return 10 + 20 * (par1 - 1); ++ } ++ ++ /** ++ * Returns the maximum value of enchantability nedded on the enchantment level passed. ++ */ ++ public int getMaxEnchantability(int par1) { ++ return super.getMinEnchantability(par1) + 50; ++ } ++ ++ /** ++ * Returns the maximum level that the enchantment can have. ++ */ + public int getMaxLevel() { + return 3; + } + +- public boolean canApply(ItemStack var1) { +- return var1.getItem() instanceof ItemArmor ? true : super.canApply(var1); +- } +- +- public static boolean func_92094_a(int var0, Random var1) { +- return var0 <= 0 ? false : var1.nextFloat() < 0.15F * (float)var0; +- } +- +- public static int func_92095_b(int var0, Random var1) { +- return var0 > 10 ? var0 - 10 : 1 + var1.nextInt(4); +- } +- +- public static void func_92096_a(Entity var0, EntityLivingBase var1, Random var2) { +- int var3 = EnchantmentHelper.func_92098_i(var1); +- ItemStack var4 = EnchantmentHelper.func_92099_a(Enchantment.thorns, var1); +- if(func_92094_a(var3, var2)) { +- var0.attackEntityFrom(DamageSource.causeThornsDamage(var1), (float)func_92095_b(var3, var2)); +- var0.playSound("damage.thorns", 0.5F, 1.0F); +- if(var4 != null) { +- var4.damageItem(3, var1); ++ public boolean canApply(ItemStack par1ItemStack) { ++ return par1ItemStack.getItem() instanceof ItemArmor ? true : super.canApply(par1ItemStack); ++ } ++ ++ public static boolean func_92094_a(int par0, Random par1Random) { ++ return par0 <= 0 ? false : par1Random.nextFloat() < 0.15F * (float)par0; ++ } ++ ++ public static int func_92095_b(int par0, Random par1Random) { ++ return par0 > 10 ? par0 - 10 : 1 + par1Random.nextInt(4); ++ } ++ ++ public static void func_92096_a(Entity par0Entity, EntityLivingBase par1EntityLivingBase, Random par2Random) { ++ int var3 = EnchantmentHelper.func_92098_i(par1EntityLivingBase); ++ ItemStack var4 = EnchantmentHelper.func_92099_a(Enchantment.thorns, par1EntityLivingBase); ++ ++ if (func_92094_a(var3, par2Random)) { ++ par0Entity.attackEntityFrom(DamageSource.causeThornsDamage(par1EntityLivingBase), (float)func_92095_b(var3, par2Random)); ++ par0Entity.playSound("damage.thorns", 0.5F, 1.0F); ++ ++ if (var4 != null) { ++ var4.damageItem(3, par1EntityLivingBase); + } +- } else if(var4 != null) { +- var4.damageItem(1, var1); ++ } else if (var4 != null) { ++ var4.damageItem(1, par1EntityLivingBase); + } +- + } + } diff --git a/patches/net/minecraft/src/EnchantmentUntouching.java.patch b/patches/net/minecraft/src/EnchantmentUntouching.java.patch new file mode 100644 index 0000000..efc051f --- /dev/null +++ b/patches/net/minecraft/src/EnchantmentUntouching.java.patch @@ -0,0 +1,52 @@ +--- net/minecraft/src/EnchantmentUntouching.java ++++ net/minecraft/src/EnchantmentUntouching.java +@@ -1,28 +1,40 @@ + package net.minecraft.src; + + public class EnchantmentUntouching extends Enchantment { +- protected EnchantmentUntouching(int var1, int var2) { +- super(var1, var2, EnumEnchantmentType.digger); ++ protected EnchantmentUntouching(int par1, int par2) { ++ super(par1, par2, EnumEnchantmentType.digger); + this.setName("untouching"); + } + +- public int getMinEnchantability(int var1) { ++ /** ++ * Returns the minimal value of enchantability needed on the enchantment level passed. ++ */ ++ public int getMinEnchantability(int par1) { + return 15; + } + +- public int getMaxEnchantability(int var1) { +- return super.getMinEnchantability(var1) + 50; ++ /** ++ * Returns the maximum value of enchantability nedded on the enchantment level passed. ++ */ ++ public int getMaxEnchantability(int par1) { ++ return super.getMinEnchantability(par1) + 50; + } + ++ /** ++ * Returns the maximum level that the enchantment can have. ++ */ + public int getMaxLevel() { + return 1; + } + +- public boolean canApplyTogether(Enchantment var1) { +- return super.canApplyTogether(var1) && var1.effectId != fortune.effectId; ++ /** ++ * Determines if the enchantment passed can be applyied together with this enchantment. ++ */ ++ public boolean canApplyTogether(Enchantment par1Enchantment) { ++ return super.canApplyTogether(par1Enchantment) && par1Enchantment.effectId != fortune.effectId; + } + +- public boolean canApply(ItemStack var1) { +- return var1.getItem().itemID == Item.shears.itemID ? true : super.canApply(var1); ++ public boolean canApply(ItemStack par1ItemStack) { ++ return par1ItemStack.getItem().itemID == Item.shears.itemID ? true : super.canApply(par1ItemStack); + } + } diff --git a/patches/net/minecraft/src/EnchantmentWaterWorker.java.patch b/patches/net/minecraft/src/EnchantmentWaterWorker.java.patch new file mode 100644 index 0000000..84941e0 --- /dev/null +++ b/patches/net/minecraft/src/EnchantmentWaterWorker.java.patch @@ -0,0 +1,36 @@ +--- net/minecraft/src/EnchantmentWaterWorker.java ++++ net/minecraft/src/EnchantmentWaterWorker.java +@@ -1,19 +1,28 @@ + package net.minecraft.src; + + public class EnchantmentWaterWorker extends Enchantment { +- public EnchantmentWaterWorker(int var1, int var2) { +- super(var1, var2, EnumEnchantmentType.armor_head); ++ public EnchantmentWaterWorker(int par1, int par2) { ++ super(par1, par2, EnumEnchantmentType.armor_head); + this.setName("waterWorker"); + } + +- public int getMinEnchantability(int var1) { ++ /** ++ * Returns the minimal value of enchantability needed on the enchantment level passed. ++ */ ++ public int getMinEnchantability(int par1) { + return 1; + } + +- public int getMaxEnchantability(int var1) { +- return this.getMinEnchantability(var1) + 40; ++ /** ++ * Returns the maximum value of enchantability nedded on the enchantment level passed. ++ */ ++ public int getMaxEnchantability(int par1) { ++ return this.getMinEnchantability(par1) + 40; + } + ++ /** ++ * Returns the maximum level that the enchantment can have. ++ */ + public int getMaxLevel() { + return 1; + } diff --git a/patches/net/minecraft/src/Entity.java.patch b/patches/net/minecraft/src/Entity.java.patch new file mode 100644 index 0000000..38d636b --- /dev/null +++ b/patches/net/minecraft/src/Entity.java.patch @@ -0,0 +1,2654 @@ +--- net/minecraft/src/Entity.java ++++ net/minecraft/src/Entity.java +@@ -1,67 +1,176 @@ + package net.minecraft.src; + ++import java.util.LinkedList; + import java.util.List; + import java.util.Random; + import java.util.UUID; ++ + import net.minecraft.server.MinecraftServer; ++import net.minecraft.src.EntityPlayer; ++ ++import org.spoutcraft.client.SpoutClient; ++import org.spoutcraft.client.entity.CraftEntityFactory; + + public abstract class Entity { + private static int nextEntityID; +- public int entityId = nextEntityID++; +- public double renderDistanceWeight = 1.0D; ++ // Spout Start ++ public static List toProcess = new LinkedList(); ++ // Spout End ++ public int entityId; ++ public double renderDistanceWeight; ++ ++ /** ++ * Blocks entities from spawning when they do their AABB check to make sure the spot is clear of entities that can ++ * prevent spawning. ++ */ + public boolean preventEntitySpawning; ++ ++ /** The entity that is riding this entity */ + public Entity riddenByEntity; ++ ++ /** The entity we are currently riding */ + public Entity ridingEntity; + public boolean forceSpawn; ++ ++ /** Reference to the World object. */ + public World worldObj; + public double prevPosX; + public double prevPosY; + public double prevPosZ; ++ ++ /** Entity position X */ + public double posX; ++ ++ /** Entity position Y */ + public double posY; ++ ++ /** Entity position Z */ + public double posZ; ++ ++ /** Entity motion X */ + public double motionX; ++ ++ /** Entity motion Y */ + public double motionY; ++ ++ /** Entity motion Z */ + public double motionZ; ++ ++ /** Entity rotation Yaw */ + public float rotationYaw; ++ ++ /** Entity rotation Pitch */ + public float rotationPitch; + public float prevRotationYaw; + public float prevRotationPitch; +- public final AxisAlignedBB boundingBox = AxisAlignedBB.getBoundingBox(0.0D, 0.0D, 0.0D, 0.0D, 0.0D, 0.0D); ++ ++ /** Axis aligned bounding box. */ ++ public final AxisAlignedBB boundingBox; + public boolean onGround; ++ ++ /** ++ * True if after a move this entity has collided with something on X- or Z-axis ++ */ + public boolean isCollidedHorizontally; ++ ++ /** ++ * True if after a move this entity has collided with something on Y-axis ++ */ + public boolean isCollidedVertically; ++ ++ /** ++ * True if after a move this entity has collided with something either vertically or horizontally ++ */ + public boolean isCollided; + public boolean velocityChanged; + protected boolean isInWeb; +- public boolean field_70135_K = true; ++ public boolean field_70135_K; ++ ++ /** ++ * Gets set by setDead, so this must be the flag whether an Entity is dead (inactive may be better term) ++ */ + public boolean isDead; + public float yOffset; +- public float width = 0.6F; +- public float height = 1.8F; ++ ++ /** How wide this entity is considered to be */ ++ public float width; ++ ++ /** How high this entity is considered to be */ ++ public float height; ++ ++ /** The previous ticks distance walked multiplied by 0.6 */ + public float prevDistanceWalkedModified; ++ ++ /** The distance walked multiplied by 0.6 */ + public float distanceWalkedModified; + public float distanceWalkedOnStepModified; + public float fallDistance; +- private int nextStepDistance = 1; ++ ++ /** ++ * The distance that has to be exceeded in order to triger a new step sound and an onEntityWalking event on a block ++ */ ++ private int nextStepDistance; ++ ++ /** ++ * The entity's X coordinate at the previous tick, used to calculate position during rendering routines ++ */ + public double lastTickPosX; ++ ++ /** ++ * The entity's Y coordinate at the previous tick, used to calculate position during rendering routines ++ */ + public double lastTickPosY; ++ ++ /** ++ * The entity's Z coordinate at the previous tick, used to calculate position during rendering routines ++ */ + public double lastTickPosZ; + public float ySize; ++ ++ /** ++ * How high this entity can step up when running into a block to try to get over it (currently make note the entity ++ * will always step up this amount and not just the amount needed) ++ */ + public float stepHeight; ++ ++ /** ++ * Whether this entity won't clip with collision or not (make note it won't disable gravity) ++ */ + public boolean noClip; ++ ++ /** ++ * Reduces the velocity applied by entity collisions by the specified percent. ++ */ + public float entityCollisionReduction; +- protected Random ab = new Random(); ++ protected Random rand; ++ ++ /** How many ticks has this entity had ran since being alive */ + public int ticksExisted; +- public int fireResistance = 1; +- private int fire; ++ ++ /** ++ * The amount of ticks you have to stand inside of fire before be set on fire ++ */ ++ public int fireResistance; ++ // Spout Start - private to public ++ public int fire; ++ // Spout End ++ ++ /** ++ * Whether this entity is currently inside of water (if it handles water movement that is) ++ */ + protected boolean inWater; ++ ++ /** ++ * Remaining time an entity will be "immune" to further damage after being hurt. ++ */ + public int hurtResistantTime; +- private boolean firstUpdate = true; ++ private boolean firstUpdate; + protected boolean isImmuneToFire; +- protected DataWatcher dataWatcher = new DataWatcher(); ++ protected DataWatcher dataWatcher; + private double entityRiderPitchDelta; + private double entityRiderYawDelta; ++ ++ /** Has this entity been added to the chunk its within */ + public boolean addedToChunk; + public int chunkCoordX; + public int chunkCoordY; +@@ -69,27 +178,60 @@ + public int serverPosX; + public int serverPosY; + public int serverPosZ; ++ ++ /** ++ * Render entity even if it is outside the camera frustum. Only true in EntityFish for now. Used in RenderGlobal: ++ * render if ignoreFrustumCheck or in frustum. ++ */ + public boolean ignoreFrustumCheck; + public boolean isAirBorne; + public int timeUntilPortal; ++ ++ /** Whether the entity is inside a Portal */ + protected boolean inPortal; + protected int portalCounter; ++ ++ /** Which dimension the player is in (-1 = the Nether, 0 = normal world) */ + public int dimension; + protected int teleportDirection; + private boolean invulnerable; +- private UUID i = UUID.randomUUID(); +- public EnumEntitySize myEntitySize = EnumEntitySize.SIZE_2; ++ private UUID entityUniqueID; ++ // Spout Start ++ public boolean partiallyInWater = false; ++ public org.spoutcraft.client.entity.CraftEntity spoutEnty; ++ public UUID uniqueId = UUID.randomUUID(); ++ public boolean wasOnGround; ++ public boolean clientonly = false; ++ // Spout End ++ public EnumEntitySize myEntitySize; + +- public Entity(World var1) { +- this.worldObj = var1; ++ public Entity(World par1World) { ++ this.entityId = nextEntityID++; ++ this.renderDistanceWeight = 1.0D; ++ this.boundingBox = AxisAlignedBB.getBoundingBox(0.0D, 0.0D, 0.0D, 0.0D, 0.0D, 0.0D); ++ this.field_70135_K = true; ++ this.width = 0.6F; ++ this.height = 1.8F; ++ this.nextStepDistance = 1; ++ this.rand = new Random(); ++ this.fireResistance = 1; ++ this.firstUpdate = true; ++ this.dataWatcher = new DataWatcher(); ++ this.entityUniqueID = UUID.randomUUID(); ++ this.myEntitySize = EnumEntitySize.SIZE_2; ++ this.worldObj = par1World; + this.setPosition(0.0D, 0.0D, 0.0D); +- if(var1 != null) { +- this.dimension = var1.provider.dimensionId; ++ ++ if (par1World != null) { ++ this.dimension = par1World.provider.dimensionId; + } + + this.dataWatcher.addObject(0, Byte.valueOf((byte)0)); + this.dataWatcher.addObject(1, Short.valueOf((short)300)); + this.entityInit(); ++ // Spout Start ++ this.spoutEnty = CraftEntityFactory.getCraftEntity(this); ++ // Spout End + } + + protected abstract void entityInit(); +@@ -98,19 +240,24 @@ + return this.dataWatcher; + } + +- public boolean equals(Object var1) { +- return var1 instanceof Entity ? ((Entity)var1).entityId == this.entityId : false; ++ public boolean equals(Object par1Obj) { ++ return par1Obj instanceof Entity ? ((Entity)par1Obj).entityId == this.entityId : false; + } + + public int hashCode() { + return this.entityId; + } + ++ /** ++ * Keeps moving the entity up so it isn't colliding with blocks and other requirements for this entity to be spawned ++ * (only actually used on players though its also on Entity) ++ */ + protected void preparePlayerToSpawn() { +- if(this.worldObj != null) { +- while(this.posY > 0.0D) { ++ if (this.worldObj != null) { ++ while (this.posY > 0.0D) { + this.setPosition(this.posX, this.posY, this.posZ); +- if(this.worldObj.getCollidingBoundingBoxes(this, this.boundingBox).isEmpty()) { ++ ++ if (this.worldObj.getCollidingBoundingBoxes(this, this.boundingBox).isEmpty()) { + break; + } + +@@ -122,65 +269,83 @@ + } + } + ++ /** ++ * Will get destroyed next tick. ++ */ + public void setDead() { + this.isDead = true; + } + +- protected void setSize(float var1, float var2) { ++ /** ++ * Sets the width and height of the entity. Args: width, height ++ */ ++ protected void setSize(float par1, float par2) { + float var3; +- if(var1 != this.width || var2 != this.height) { +- var3 = this.width; +- this.width = var1; +- this.height = var2; ++ ++ if (par1 != this.width || par2 != this.height) { ++ var3 = this.width; ++ this.width = par1; ++ this.height = par2; + this.boundingBox.maxX = this.boundingBox.minX + (double)this.width; + this.boundingBox.maxZ = this.boundingBox.minZ + (double)this.width; + this.boundingBox.maxY = this.boundingBox.minY + (double)this.height; +- if(this.width > var3 && !this.firstUpdate && !this.worldObj.isRemote) { ++ if (this.width > var3 && !this.firstUpdate && !this.worldObj.isRemote) { + this.moveEntity((double)(var3 - this.width), 0.0D, (double)(var3 - this.width)); + } + } + +- var3 = var1 % 2.0F; +- if((double)var3 < 0.375D) { ++ var3 = par1 % 2.0F; ++ ++ if ((double)var3 < 0.375D) { + this.myEntitySize = EnumEntitySize.SIZE_1; +- } else if((double)var3 < 0.75D) { ++ } else if ((double)var3 < 0.75D) { + this.myEntitySize = EnumEntitySize.SIZE_2; +- } else if((double)var3 < 1.0D) { ++ } else if ((double)var3 < 1.0D) { + this.myEntitySize = EnumEntitySize.SIZE_3; +- } else if((double)var3 < 1.375D) { ++ } else if ((double)var3 < 1.375D) { + this.myEntitySize = EnumEntitySize.SIZE_4; +- } else if((double)var3 < 1.75D) { ++ } else if ((double)var3 < 1.75D) { + this.myEntitySize = EnumEntitySize.SIZE_5; + } else { + this.myEntitySize = EnumEntitySize.SIZE_6; + } +- +- } +- +- protected void setRotation(float var1, float var2) { +- this.rotationYaw = var1 % 360.0F; +- this.rotationPitch = var2 % 360.0F; +- } +- +- public void setPosition(double var1, double var3, double var5) { +- this.posX = var1; +- this.posY = var3; +- this.posZ = var5; ++ } ++ ++ /** ++ * Sets the rotation of the entity ++ */ ++ protected void setRotation(float par1, float par2) { ++ this.rotationYaw = par1 % 360.0F; ++ this.rotationPitch = par2 % 360.0F; ++ } ++ ++ /** ++ * Sets the x,y,z of the entity from the given parameters. Also seems to set up a bounding box. ++ */ ++ public void setPosition(double par1, double par3, double par5) { ++ this.posX = par1; ++ this.posY = par3; ++ this.posZ = par5; + float var7 = this.width / 2.0F; + float var8 = this.height; +- this.boundingBox.setBounds(var1 - (double)var7, var3 - (double)this.yOffset + (double)this.ySize, var5 - (double)var7, var1 + (double)var7, var3 - (double)this.yOffset + (double)this.ySize + (double)var8, var5 + (double)var7); ++ this.boundingBox.setBounds(par1 - (double)var7, par3 - (double)this.yOffset + (double)this.ySize, par5 - (double)var7, par1 + (double)var7, par3 - (double)this.yOffset + (double)this.ySize + (double)var8, par5 + (double)var7); + } + +- public void setAngles(float var1, float var2) { ++ /** ++ * Adds par1*0.15 to the entity's yaw, and *subtracts* par2*0.15 from the pitch. Clamps pitch from -90 to 90. Both ++ * arguments in degrees. ++ */ ++ public void setAngles(float par1, float par2) { + float var3 = this.rotationPitch; + float var4 = this.rotationYaw; +- this.rotationYaw = (float)((double)this.rotationYaw + (double)var1 * 0.15D); +- this.rotationPitch = (float)((double)this.rotationPitch - (double)var2 * 0.15D); +- if(this.rotationPitch < -90.0F) { ++ this.rotationYaw = (float)((double)this.rotationYaw + (double)par1 * 0.15D); ++ this.rotationPitch = (float)((double)this.rotationPitch - (double)par2 * 0.15D); ++ ++ if (this.rotationPitch < -90.0F) { + this.rotationPitch = -90.0F; + } + +- if(this.rotationPitch > 90.0F) { ++ if (this.rotationPitch > 90.0F) { + this.rotationPitch = 90.0F; + } + +@@ -188,16 +353,25 @@ + this.prevRotationYaw += this.rotationYaw - var4; + } + ++ /** ++ * Called to update the entity's position/logic. ++ */ + public void onUpdate() { + this.onEntityUpdate(); + } + ++ /** ++ * Gets called every tick from main Entity class ++ */ + public void onEntityUpdate() { + this.worldObj.theProfiler.startSection("entityBaseTick"); +- if(this.ridingEntity != null && this.ridingEntity.isDead) { ++ ++ if (this.ridingEntity != null && this.ridingEntity.isDead) { + this.ridingEntity = null; + } +- ++ // Spout Start ++ partiallyInWater = isInsideOfMaterial(Material.water, -1); ++ // Spout End + this.prevDistanceWalkedModified = this.distanceWalkedModified; + this.prevPosX = this.posX; + this.prevPosY = this.posY; +@@ -205,17 +379,20 @@ + this.prevRotationPitch = this.rotationPitch; + this.prevRotationYaw = this.rotationYaw; + int var2; +- if(!this.worldObj.isRemote && this.worldObj instanceof WorldServer) { ++ ++ if (!this.worldObj.isRemote && this.worldObj instanceof WorldServer) { + this.worldObj.theProfiler.startSection("portal"); + MinecraftServer var1 = ((WorldServer)this.worldObj).getMinecraftServer(); + var2 = this.getMaxInPortalTime(); +- if(this.inPortal) { +- if(var1.getAllowNether()) { +- if(this.ridingEntity == null && this.portalCounter++ >= var2) { ++ ++ if (this.inPortal) { ++ if (var1.getAllowNether()) { ++ if (this.ridingEntity == null && this.portalCounter++ >= var2) { + this.portalCounter = var2; + this.timeUntilPortal = this.getPortalCooldown(); + byte var3; +- if(this.worldObj.provider.dimensionId == -1) { ++ ++ if (this.worldObj.provider.dimensionId == -1) { + var3 = 0; + } else { + var3 = -1; +@@ -227,43 +404,46 @@ + this.inPortal = false; + } + } else { +- if(this.portalCounter > 0) { ++ if (this.portalCounter > 0) { + this.portalCounter -= 4; + } + +- if(this.portalCounter < 0) { ++ if (this.portalCounter < 0) { + this.portalCounter = 0; + } + } + +- if(this.timeUntilPortal > 0) { ++ if (this.timeUntilPortal > 0) { + --this.timeUntilPortal; + } + + this.worldObj.theProfiler.endSection(); + } + +- if(this.isSprinting() && !this.isInWater()) { ++ if (this.isSprinting() && !this.isInWater()) { + int var5 = MathHelper.floor_double(this.posX); +- var2 = MathHelper.floor_double(this.posY - (double)0.2F - (double)this.yOffset); ++ var2 = MathHelper.floor_double(this.posY - 0.20000000298023224D - (double)this.yOffset); + int var6 = MathHelper.floor_double(this.posZ); + int var4 = this.worldObj.getBlockId(var5, var2, var6); +- if(var4 > 0) { +- this.worldObj.spawnParticle("tilecrack_" + var4 + "_" + this.worldObj.getBlockMetadata(var5, var2, var6), this.posX + ((double)this.ab.nextFloat() - 0.5D) * (double)this.width, this.boundingBox.minY + 0.1D, this.posZ + ((double)this.ab.nextFloat() - 0.5D) * (double)this.width, -this.motionX * 4.0D, 1.5D, -this.motionZ * 4.0D); ++ ++ if (var4 > 0) { ++ this.worldObj.spawnParticle("tilecrack_" + var4 + "_" + this.worldObj.getBlockMetadata(var5, var2, var6), this.posX + ((double)this.rand.nextFloat() - 0.5D) * (double)this.width, this.boundingBox.minY + 0.1D, this.posZ + ((double)this.rand.nextFloat() - 0.5D) * (double)this.width, -this.motionX * 4.0D, 1.5D, -this.motionZ * 4.0D); + } + } + + this.handleWaterMovement(); +- if(this.worldObj.isRemote) { ++ ++ if (this.worldObj.isRemote) { + this.fire = 0; +- } else if(this.fire > 0) { +- if(this.isImmuneToFire) { ++ } else if (this.fire > 0) { ++ if (this.isImmuneToFire) { + this.fire -= 4; +- if(this.fire < 0) { ++ ++ if (this.fire < 0) { + this.fire = 0; + } + } else { +- if(this.fire % 20 == 0) { ++ if (this.fire % 20 == 0) { + this.attackEntityFrom(DamageSource.onFire, 1.0F); + } + +@@ -271,61 +451,81 @@ + } + } + +- if(this.handleLavaMovement()) { ++ if (this.handleLavaMovement()) { + this.setOnFireFromLava(); + this.fallDistance *= 0.5F; + } + +- if(this.posY < -64.0D) { ++ if (this.posY < -64.0D) { + this.kill(); + } + +- if(!this.worldObj.isRemote) { +- this.setFlag(0, this.fire > 0); ++ if (!this.worldObj.isRemote) { ++ this.setFlag(0, this.fire > 0); + } + + this.firstUpdate = false; + this.worldObj.theProfiler.endSection(); + } + ++ /** ++ * Return the amount of time this entity should stay in a portal before being transported. ++ */ + public int getMaxInPortalTime() { + return 0; + } + ++ /** ++ * Called whenever the entity is walking inside of lava. ++ */ + protected void setOnFireFromLava() { +- if(!this.isImmuneToFire) { ++ if (!this.isImmuneToFire) { + this.attackEntityFrom(DamageSource.lava, 4.0F); + this.setFire(15); + } +- + } + +- public void setFire(int var1) { +- int var2 = var1 * 20; ++ /** ++ * Sets entity to burn for x amount of seconds, cannot lower amount of existing fire. ++ */ ++ public void setFire(int par1) { ++ int var2 = par1 * 20; + var2 = EnchantmentProtection.getFireTimeForEntity(this, var2); +- if(this.fire < var2) { ++ ++ if (this.fire < var2) { + this.fire = var2; + } +- + } + ++ /** ++ * Removes fire from entity. ++ */ + public void extinguish() { + this.fire = 0; + } + ++ /** ++ * sets the dead flag. Used when you fall off the bottom of the world. ++ */ + protected void kill() { + this.setDead(); + } + +- public boolean isOffsetPositionInLiquid(double var1, double var3, double var5) { +- AxisAlignedBB var7 = this.boundingBox.getOffsetBoundingBox(var1, var3, var5); ++ /** ++ * Checks if the offset position from the entity's current position is inside of liquid. Args: x, y, z ++ */ ++ public boolean isOffsetPositionInLiquid(double par1, double par3, double par5) { ++ AxisAlignedBB var7 = this.boundingBox.getOffsetBoundingBox(par1, par3, par5); + List var8 = this.worldObj.getCollidingBoundingBoxes(this, var7); + return !var8.isEmpty() ? false : !this.worldObj.isAnyLiquid(var7); + } + +- public void moveEntity(double var1, double var3, double var5) { +- if(this.noClip) { +- this.boundingBox.offset(var1, var3, var5); ++ /** ++ * Tries to moves the entity by the passed in displacement. Args: x, y, z ++ */ ++ public void moveEntity(double par1, double par3, double par5) { ++ if (this.noClip) { ++ this.boundingBox.offset(par1, par3, par5); + this.posX = (this.boundingBox.minX + this.boundingBox.maxX) / 2.0D; + this.posY = this.boundingBox.minY + (double)this.yOffset - (double)this.ySize; + this.posZ = (this.boundingBox.minZ + this.boundingBox.maxZ) / 2.0D; +@@ -335,169 +535,179 @@ + double var7 = this.posX; + double var9 = this.posY; + double var11 = this.posZ; +- if(this.isInWeb) { ++ ++ if (this.isInWeb) { + this.isInWeb = false; +- var1 *= 0.25D; +- var3 *= (double)0.05F; +- var5 *= 0.25D; ++ par1 *= 0.25D; ++ par3 *= 0.05000000074505806D; ++ par5 *= 0.25D; + this.motionX = 0.0D; + this.motionY = 0.0D; + this.motionZ = 0.0D; + } + +- double var13 = var1; +- double var15 = var3; +- double var17 = var5; ++ double var13 = par1; ++ double var15 = par3; ++ double var17 = par5; + AxisAlignedBB var19 = this.boundingBox.copy(); + boolean var20 = this.onGround && this.isSneaking() && this instanceof EntityPlayer; +- if(var20) { ++ ++ if (var20) { + double var21; +- for(var21 = 0.05D; var1 != 0.0D && this.worldObj.getCollidingBoundingBoxes(this, this.boundingBox.getOffsetBoundingBox(var1, -1.0D, 0.0D)).isEmpty(); var13 = var1) { +- if(var1 < var21 && var1 >= -var21) { +- var1 = 0.0D; +- } else if(var1 > 0.0D) { +- var1 -= var21; +- } else { +- var1 += var21; +- } +- } +- +- for(; var5 != 0.0D && this.worldObj.getCollidingBoundingBoxes(this, this.boundingBox.getOffsetBoundingBox(0.0D, -1.0D, var5)).isEmpty(); var17 = var5) { +- if(var5 < var21 && var5 >= -var21) { +- var5 = 0.0D; +- } else if(var5 > 0.0D) { +- var5 -= var21; +- } else { +- var5 += var21; +- } +- } +- +- while(var1 != 0.0D && var5 != 0.0D && this.worldObj.getCollidingBoundingBoxes(this, this.boundingBox.getOffsetBoundingBox(var1, -1.0D, var5)).isEmpty()) { +- if(var1 < var21 && var1 >= -var21) { +- var1 = 0.0D; +- } else if(var1 > 0.0D) { +- var1 -= var21; +- } else { +- var1 += var21; +- } +- +- if(var5 < var21 && var5 >= -var21) { +- var5 = 0.0D; +- } else if(var5 > 0.0D) { +- var5 -= var21; +- } else { +- var5 += var21; +- } +- +- var13 = var1; +- var17 = var5; +- } +- } +- +- List var35 = this.worldObj.getCollidingBoundingBoxes(this, this.boundingBox.addCoord(var1, var3, var5)); +- +- for(int var22 = 0; var22 < var35.size(); ++var22) { +- var3 = ((AxisAlignedBB)var35.get(var22)).calculateYOffset(this.boundingBox, var3); +- } +- +- this.boundingBox.offset(0.0D, var3, 0.0D); +- if(!this.field_70135_K && var15 != var3) { +- var5 = 0.0D; +- var3 = var5; +- var1 = var5; +- } +- +- boolean var36 = this.onGround || var15 != var3 && var15 < 0.0D; +- ++ ++ for (var21 = 0.05D; par1 != 0.0D && this.worldObj.getCollidingBoundingBoxes(this, this.boundingBox.getOffsetBoundingBox(par1, -1.0D, 0.0D)).isEmpty(); var13 = par1) { ++ if (par1 < var21 && par1 >= -var21) { ++ par1 = 0.0D; ++ } else if (par1 > 0.0D) { ++ par1 -= var21; ++ } else { ++ par1 += var21; ++ } ++ } ++ ++ for (; par5 != 0.0D && this.worldObj.getCollidingBoundingBoxes(this, this.boundingBox.getOffsetBoundingBox(0.0D, -1.0D, par5)).isEmpty(); var17 = par5) { ++ if (par5 < var21 && par5 >= -var21) { ++ par5 = 0.0D; ++ } else if (par5 > 0.0D) { ++ par5 -= var21; ++ } else { ++ par5 += var21; ++ } ++ } ++ ++ while (par1 != 0.0D && par5 != 0.0D && this.worldObj.getCollidingBoundingBoxes(this, this.boundingBox.getOffsetBoundingBox(par1, -1.0D, par5)).isEmpty()) { ++ if (par1 < var21 && par1 >= -var21) { ++ par1 = 0.0D; ++ } else if (par1 > 0.0D) { ++ par1 -= var21; ++ } else { ++ par1 += var21; ++ } ++ ++ if (par5 < var21 && par5 >= -var21) { ++ par5 = 0.0D; ++ } else if (par5 > 0.0D) { ++ par5 -= var21; ++ } else { ++ par5 += var21; ++ } ++ ++ var13 = par1; ++ var17 = par5; ++ } ++ } ++ ++ List var36 = this.worldObj.getCollidingBoundingBoxes(this, this.boundingBox.addCoord(par1, par3, par5)); ++ ++ for (int var22 = 0; var22 < var36.size(); ++var22) { ++ par3 = ((AxisAlignedBB)var36.get(var22)).calculateYOffset(this.boundingBox, par3); ++ } ++ ++ this.boundingBox.offset(0.0D, par3, 0.0D); ++ ++ if (!this.field_70135_K && var15 != par3) { ++ par5 = 0.0D; ++ par3 = 0.0D; ++ par1 = 0.0D; ++ } ++ ++ boolean var35 = this.onGround || var15 != par3 && var15 < 0.0D; + int var23; +- for(var23 = 0; var23 < var35.size(); ++var23) { +- var1 = ((AxisAlignedBB)var35.get(var23)).calculateXOffset(this.boundingBox, var1); +- } +- +- this.boundingBox.offset(var1, 0.0D, 0.0D); +- if(!this.field_70135_K && var13 != var1) { +- var5 = 0.0D; +- var3 = var5; +- var1 = var5; +- } +- +- for(var23 = 0; var23 < var35.size(); ++var23) { +- var5 = ((AxisAlignedBB)var35.get(var23)).calculateZOffset(this.boundingBox, var5); +- } +- +- this.boundingBox.offset(0.0D, 0.0D, var5); +- if(!this.field_70135_K && var17 != var5) { +- var5 = 0.0D; +- var3 = var5; +- var1 = var5; ++ ++ for (var23 = 0; var23 < var36.size(); ++var23) { ++ par1 = ((AxisAlignedBB)var36.get(var23)).calculateXOffset(this.boundingBox, par1); ++ } ++ ++ this.boundingBox.offset(par1, 0.0D, 0.0D); ++ ++ if (!this.field_70135_K && var13 != par1) { ++ par5 = 0.0D; ++ par3 = 0.0D; ++ par1 = 0.0D; ++ } ++ ++ for (var23 = 0; var23 < var36.size(); ++var23) { ++ par5 = ((AxisAlignedBB)var36.get(var23)).calculateZOffset(this.boundingBox, par5); ++ } ++ ++ this.boundingBox.offset(0.0D, 0.0D, par5); ++ ++ if (!this.field_70135_K && var17 != par5) { ++ par5 = 0.0D; ++ par3 = 0.0D; ++ par1 = 0.0D; + } + + double var25; + double var27; + int var30; + double var37; +- if(this.stepHeight > 0.0F && var36 && (var20 || this.ySize < 0.05F) && (var13 != var1 || var17 != var5)) { +- var37 = var1; +- var25 = var3; +- var27 = var5; +- var1 = var13; +- var3 = (double)this.stepHeight; +- var5 = var17; ++ ++ if (this.stepHeight > 0.0F && var35 && (var20 || this.ySize < 0.05F) && (var13 != par1 || var17 != par5)) { ++ var37 = par1; ++ var25 = par3; ++ var27 = par5; ++ par1 = var13; ++ par3 = (double)this.stepHeight; ++ par5 = var17; + AxisAlignedBB var29 = this.boundingBox.copy(); + this.boundingBox.setBB(var19); +- var35 = this.worldObj.getCollidingBoundingBoxes(this, this.boundingBox.addCoord(var13, var3, var17)); +- +- for(var30 = 0; var30 < var35.size(); ++var30) { +- var3 = ((AxisAlignedBB)var35.get(var30)).calculateYOffset(this.boundingBox, var3); +- } +- +- this.boundingBox.offset(0.0D, var3, 0.0D); +- if(!this.field_70135_K && var15 != var3) { +- var5 = 0.0D; +- var3 = var5; +- var1 = var5; +- } +- +- for(var30 = 0; var30 < var35.size(); ++var30) { +- var1 = ((AxisAlignedBB)var35.get(var30)).calculateXOffset(this.boundingBox, var1); +- } +- +- this.boundingBox.offset(var1, 0.0D, 0.0D); +- if(!this.field_70135_K && var13 != var1) { +- var5 = 0.0D; +- var3 = var5; +- var1 = var5; +- } +- +- for(var30 = 0; var30 < var35.size(); ++var30) { +- var5 = ((AxisAlignedBB)var35.get(var30)).calculateZOffset(this.boundingBox, var5); +- } +- +- this.boundingBox.offset(0.0D, 0.0D, var5); +- if(!this.field_70135_K && var17 != var5) { +- var5 = 0.0D; +- var3 = var5; +- var1 = var5; +- } +- +- if(!this.field_70135_K && var15 != var3) { +- var5 = 0.0D; +- var3 = var5; +- var1 = var5; ++ var36 = this.worldObj.getCollidingBoundingBoxes(this, this.boundingBox.addCoord(var13, par3, var17)); ++ ++ for (var30 = 0; var30 < var36.size(); ++var30) { ++ par3 = ((AxisAlignedBB)var36.get(var30)).calculateYOffset(this.boundingBox, par3); ++ } ++ ++ this.boundingBox.offset(0.0D, par3, 0.0D); ++ ++ if (!this.field_70135_K && var15 != par3) { ++ par5 = 0.0D; ++ par3 = 0.0D; ++ par1 = 0.0D; ++ } ++ ++ for (var30 = 0; var30 < var36.size(); ++var30) { ++ par1 = ((AxisAlignedBB)var36.get(var30)).calculateXOffset(this.boundingBox, par1); ++ } ++ ++ this.boundingBox.offset(par1, 0.0D, 0.0D); ++ ++ if (!this.field_70135_K && var13 != par1) { ++ par5 = 0.0D; ++ par3 = 0.0D; ++ par1 = 0.0D; ++ } ++ ++ for (var30 = 0; var30 < var36.size(); ++var30) { ++ par5 = ((AxisAlignedBB)var36.get(var30)).calculateZOffset(this.boundingBox, par5); ++ } ++ ++ this.boundingBox.offset(0.0D, 0.0D, par5); ++ ++ if (!this.field_70135_K && var17 != par5) { ++ par5 = 0.0D; ++ par3 = 0.0D; ++ par1 = 0.0D; ++ } ++ ++ if (!this.field_70135_K && var15 != par3) { ++ par5 = 0.0D; ++ par3 = 0.0D; ++ par1 = 0.0D; + } else { +- var3 = (double)(-this.stepHeight); ++ par3 = (double)(-this.stepHeight); + +- for(var30 = 0; var30 < var35.size(); ++var30) { +- var3 = ((AxisAlignedBB)var35.get(var30)).calculateYOffset(this.boundingBox, var3); ++ for (var30 = 0; var30 < var36.size(); ++var30) { ++ par3 = ((AxisAlignedBB)var36.get(var30)).calculateYOffset(this.boundingBox, par3); + } + +- this.boundingBox.offset(0.0D, var3, 0.0D); ++ this.boundingBox.offset(0.0D, par3, 0.0D); + } + +- if(var37 * var37 + var27 * var27 >= var1 * var1 + var5 * var5) { +- var1 = var37; +- var3 = var25; +- var5 = var27; ++ if (var37 * var37 + var27 * var27 >= par1 * par1 + par5 * par5) { ++ par1 = var37; ++ par3 = var25; ++ par5 = var27; + this.boundingBox.setBB(var29); + } + } +@@ -507,57 +717,64 @@ + this.posX = (this.boundingBox.minX + this.boundingBox.maxX) / 2.0D; + this.posY = this.boundingBox.minY + (double)this.yOffset - (double)this.ySize; + this.posZ = (this.boundingBox.minZ + this.boundingBox.maxZ) / 2.0D; +- this.isCollidedHorizontally = var13 != var1 || var17 != var5; +- this.isCollidedVertically = var15 != var3; +- this.onGround = var15 != var3 && var15 < 0.0D; ++ this.isCollidedHorizontally = var13 != par1 || var17 != par5; ++ this.isCollidedVertically = var15 != par3; ++ this.onGround = var15 != par3 && var15 < 0.0D; + this.isCollided = this.isCollidedHorizontally || this.isCollidedVertically; +- this.updateFallState(var3, this.onGround); +- if(var13 != var1) { ++ this.updateFallState(par3, this.onGround); ++ ++ if (var13 != par1) { + this.motionX = 0.0D; + } + +- if(var15 != var3) { ++ if (var15 != par3) { + this.motionY = 0.0D; + } + +- if(var17 != var5) { ++ if (var17 != par5) { + this.motionZ = 0.0D; + } + + var37 = this.posX - var7; + var25 = this.posY - var9; + var27 = this.posZ - var11; +- if(this.canTriggerWalking() && !var20 && this.ridingEntity == null) { +- int var38 = MathHelper.floor_double(this.posX); +- var30 = MathHelper.floor_double(this.posY - (double)0.2F - (double)this.yOffset); ++ ++ if (this.canTriggerWalking() && !var20 && this.ridingEntity == null) { ++ int var39 = MathHelper.floor_double(this.posX); ++ var30 = MathHelper.floor_double(this.posY - 0.20000000298023224D - (double)this.yOffset); + int var31 = MathHelper.floor_double(this.posZ); +- int var32 = this.worldObj.getBlockId(var38, var30, var31); +- if(var32 == 0) { +- int var33 = this.worldObj.blockGetRenderType(var38, var30 - 1, var31); +- if(var33 == 11 || var33 == 32 || var33 == 21) { +- var32 = this.worldObj.getBlockId(var38, var30 - 1, var31); ++ int var32 = this.worldObj.getBlockId(var39, var30, var31); ++ ++ if (var32 == 0) { ++ int var33 = this.worldObj.blockGetRenderType(var39, var30 - 1, var31); ++ ++ if (var33 == 11 || var33 == 32 || var33 == 21) { ++ var32 = this.worldObj.getBlockId(var39, var30 - 1, var31); + } + } + +- if(var32 != Block.ladder.blockID) { ++ if (var32 != Block.ladder.blockID) { + var25 = 0.0D; + } + + this.distanceWalkedModified = (float)((double)this.distanceWalkedModified + (double)MathHelper.sqrt_double(var37 * var37 + var27 * var27) * 0.6D); + this.distanceWalkedOnStepModified = (float)((double)this.distanceWalkedOnStepModified + (double)MathHelper.sqrt_double(var37 * var37 + var25 * var25 + var27 * var27) * 0.6D); +- if(this.distanceWalkedOnStepModified > (float)this.nextStepDistance && var32 > 0) { ++ ++ if (this.distanceWalkedOnStepModified > (float)this.nextStepDistance && var32 > 0) { + this.nextStepDistance = (int)this.distanceWalkedOnStepModified + 1; +- if(this.isInWater()) { +- float var42 = MathHelper.sqrt_double(this.motionX * this.motionX * (double)0.2F + this.motionY * this.motionY + this.motionZ * this.motionZ * (double)0.2F) * 0.35F; +- if(var42 > 1.0F) { ++ ++ if (this.isInWater()) { ++ float var42 = MathHelper.sqrt_double(this.motionX * this.motionX * 0.20000000298023224D + this.motionY * this.motionY + this.motionZ * this.motionZ * 0.20000000298023224D) * 0.35F; ++ ++ if (var42 > 1.0F) { + var42 = 1.0F; + } + +- this.playSound("liquid.swim", var42, 1.0F + (this.ab.nextFloat() - this.ab.nextFloat()) * 0.4F); ++ this.playSound("liquid.swim", var42, 1.0F + (this.rand.nextFloat() - this.rand.nextFloat()) * 0.4F); + } + +- this.playStepSound(var38, var30, var31, var32); +- Block.blocksList[var32].onEntityWalking(this.worldObj, var38, var30, var31, this); ++ this.playStepSound(var39, var30, var31, var32); ++ Block.blocksList[var32].onEntityWalking(this.worldObj, var39, var30, var31, this); + } + } + +@@ -565,26 +782,29 @@ + this.doBlockCollisions(); + } catch (Throwable var34) { + CrashReport var41 = CrashReport.makeCrashReport(var34, "Checking entity tile collision"); +- CrashReportCategory var40 = var41.makeCategory("Entity being checked for collision"); +- this.addEntityCrashInfo(var40); ++ CrashReportCategory var38 = var41.makeCategory("Entity being checked for collision"); ++ this.addEntityCrashInfo(var38); + throw new ReportedException(var41); + } + +- boolean var39 = this.isWet(); +- if(this.worldObj.isBoundingBoxBurning(this.boundingBox.contract(0.001D, 0.001D, 0.001D))) { ++ boolean var40 = this.isWet(); ++ ++ if (this.worldObj.isBoundingBoxBurning(this.boundingBox.contract(0.001D, 0.001D, 0.001D))) { + this.dealFireDamage(1); +- if(!var39) { ++ ++ if (!var40) { + ++this.fire; +- if(this.fire == 0) { ++ ++ if (this.fire == 0) { + this.setFire(8); + } + } +- } else if(this.fire <= 0) { ++ } else if (this.fire <= 0) { + this.fire = -this.fireResistance; + } + +- if(var39 && this.fire > 0) { +- this.playSound("random.fizz", 0.7F, 1.6F + (this.ab.nextFloat() - this.ab.nextFloat()) * 0.4F); ++ if (var40 && this.fire > 0) { ++ this.playSound("random.fizz", 0.7F, 1.6F + (this.rand.nextFloat() - this.rand.nextFloat()) * 0.4F); + this.fire = -this.fireResistance; + } + +@@ -592,6 +812,9 @@ + } + } + ++ /** ++ * Checks for block collisions, and calls the associated onBlockCollided method for the collided block. ++ */ + protected void doBlockCollisions() { + int var1 = MathHelper.floor_double(this.boundingBox.minX + 0.001D); + int var2 = MathHelper.floor_double(this.boundingBox.minY + 0.001D); +@@ -599,12 +822,14 @@ + int var4 = MathHelper.floor_double(this.boundingBox.maxX - 0.001D); + int var5 = MathHelper.floor_double(this.boundingBox.maxY - 0.001D); + int var6 = MathHelper.floor_double(this.boundingBox.maxZ - 0.001D); +- if(this.worldObj.checkChunksExist(var1, var2, var3, var4, var5, var6)) { +- for(int var7 = var1; var7 <= var4; ++var7) { +- for(int var8 = var2; var8 <= var5; ++var8) { +- for(int var9 = var3; var9 <= var6; ++var9) { ++ ++ if (this.worldObj.checkChunksExist(var1, var2, var3, var4, var5, var6)) { ++ for (int var7 = var1; var7 <= var4; ++var7) { ++ for (int var8 = var2; var8 <= var5; ++var8) { ++ for (int var9 = var3; var9 <= var6; ++var9) { + int var10 = this.worldObj.getBlockId(var7, var8, var9); +- if(var10 > 0) { ++ ++ if (var10 > 0) { + try { + Block.blocksList[var10].onEntityCollidedWithBlock(this.worldObj, var7, var8, var9, this); + } catch (Throwable var14) { +@@ -618,93 +843,126 @@ + } + } + } +- + } + +- protected void playStepSound(int var1, int var2, int var3, int var4) { +- StepSound var5 = Block.blocksList[var4].stepSound; +- if(this.worldObj.getBlockId(var1, var2 + 1, var3) == Block.snow.blockID) { ++ /** ++ * Plays step sound at given x, y, z for the entity ++ */ ++ protected void playStepSound(int par1, int par2, int par3, int par4) { ++ StepSound var5 = Block.blocksList[par4].stepSound; ++ ++ if (this.worldObj.getBlockId(par1, par2 + 1, par3) == Block.snow.blockID) { + var5 = Block.snow.stepSound; + this.playSound(var5.getStepSound(), var5.getVolume() * 0.15F, var5.getPitch()); +- } else if(!Block.blocksList[var4].blockMaterial.isLiquid()) { ++ } else if (!Block.blocksList[par4].blockMaterial.isLiquid()) { + this.playSound(var5.getStepSound(), var5.getVolume() * 0.15F, var5.getPitch()); + } +- +- } +- +- public void playSound(String var1, float var2, float var3) { +- this.worldObj.playSoundAtEntity(this, var1, var2, var3); +- } +- ++ } ++ ++ public void playSound(String par1Str, float par2, float par3) { ++ this.worldObj.playSoundAtEntity(this, par1Str, par2, par3); ++ } ++ ++ /** ++ * returns if this entity triggers Block.onEntityWalking on the blocks they walk on. used for spiders and wolves to ++ * prevent them from trampling crops ++ */ + protected boolean canTriggerWalking() { + return true; + } + +- protected void updateFallState(double var1, boolean var3) { +- if(var3) { +- if(this.fallDistance > 0.0F) { ++ /** ++ * Takes in the distance the entity has fallen this tick and whether its on the ground to update the fall distance and ++ * deal fall damage if landing on the ground. Args: distanceFallenThisTick, onGround ++ */ ++ protected void updateFallState(double par1, boolean par3) { ++ if (par3) { ++ if (this.fallDistance > 0.0F) { + this.fall(this.fallDistance); + this.fallDistance = 0.0F; + } +- } else if(var1 < 0.0D) { +- this.fallDistance = (float)((double)this.fallDistance - var1); ++ } else if (par1 < 0.0D) { ++ this.fallDistance = (float)((double)this.fallDistance - par1); + } +- +- } +- ++ } ++ ++ /** ++ * First layer of player interaction ++ */ ++ public boolean interactFirst(EntityPlayer par1EntityPlayer) { ++ return false; ++ } ++ ++ /** ++ * returns the bounding box for this entity ++ */ + public AxisAlignedBB getBoundingBox() { + return null; + } + +- protected void dealFireDamage(int var1) { +- if(!this.isImmuneToFire) { +- this.attackEntityFrom(DamageSource.inFire, (float)var1); ++ /** ++ * Will deal the specified amount of damage to the entity if the entity isn't immune to fire damage. Args: amountDamage ++ */ ++ protected void dealFireDamage(int par1) { ++ if (!this.isImmuneToFire) { ++ this.attackEntityFrom(DamageSource.inFire, (float)par1); + } +- + } + + public final boolean isImmuneToFire() { + return this.isImmuneToFire; + } + +- protected void fall(float var1) { +- if(this.riddenByEntity != null) { +- this.riddenByEntity.fall(var1); ++ /** ++ * Called when the mob is falling. Calculates and applies fall damage. ++ */ ++ protected void fall(float par1) { ++ if (this.riddenByEntity != null) { ++ this.riddenByEntity.fall(par1); + } +- + } + ++ /** ++ * Checks if this entity is either in water or on an open air block in rain (used in wolves). ++ */ + public boolean isWet() { + return this.inWater || this.worldObj.canLightningStrikeAt(MathHelper.floor_double(this.posX), MathHelper.floor_double(this.posY), MathHelper.floor_double(this.posZ)) || this.worldObj.canLightningStrikeAt(MathHelper.floor_double(this.posX), MathHelper.floor_double(this.posY + (double)this.height), MathHelper.floor_double(this.posZ)); + } + ++ /** ++ * Checks if this entity is inside water (if inWater field is true as a result of handleWaterMovement() returning true) ++ */ + public boolean isInWater() { + return this.inWater; + } + ++ /** ++ * Returns if this entity is in water and will end up adding the waters velocity to the entity ++ */ + public boolean handleWaterMovement() { +- if(this.worldObj.handleMaterialAcceleration(this.boundingBox.expand(0.0D, (double)-0.4F, 0.0D).contract(0.001D, 0.001D, 0.001D), Material.water, this)) { +- if(!this.inWater && !this.firstUpdate) { +- float var1 = MathHelper.sqrt_double(this.motionX * this.motionX * (double)0.2F + this.motionY * this.motionY + this.motionZ * this.motionZ * (double)0.2F) * 0.2F; +- if(var1 > 1.0F) { ++ if (this.worldObj.handleMaterialAcceleration(this.boundingBox.expand(0.0D, -0.4000000059604645D, 0.0D).contract(0.001D, 0.001D, 0.001D), Material.water, this)) { ++ if (!this.inWater && !this.firstUpdate) { ++ float var1 = MathHelper.sqrt_double(this.motionX * this.motionX * 0.20000000298023224D + this.motionY * this.motionY + this.motionZ * this.motionZ * 0.20000000298023224D) * 0.2F; ++ ++ if (var1 > 1.0F) { + var1 = 1.0F; + } + +- this.playSound("liquid.splash", var1, 1.0F + (this.ab.nextFloat() - this.ab.nextFloat()) * 0.4F); ++ this.playSound("liquid.splash", var1, 1.0F + (this.rand.nextFloat() - this.rand.nextFloat()) * 0.4F); + float var2 = (float)MathHelper.floor_double(this.boundingBox.minY); +- +- int var3; + float var4; + float var5; +- for(var3 = 0; (float)var3 < 1.0F + this.width * 20.0F; ++var3) { +- var4 = (this.ab.nextFloat() * 2.0F - 1.0F) * this.width; +- var5 = (this.ab.nextFloat() * 2.0F - 1.0F) * this.width; +- this.worldObj.spawnParticle("bubble", this.posX + (double)var4, (double)(var2 + 1.0F), this.posZ + (double)var5, this.motionX, this.motionY - (double)(this.ab.nextFloat() * 0.2F), this.motionZ); ++ int var3; ++ ++ for (var3 = 0; (float)var3 < 1.0F + this.width * 20.0F; ++var3) { ++ var4 = (this.rand.nextFloat() * 2.0F - 1.0F) * this.width; ++ var5 = (this.rand.nextFloat() * 2.0F - 1.0F) * this.width; ++ this.worldObj.spawnParticle("bubble", this.posX + (double)var4, (double)(var2 + 1.0F), this.posZ + (double)var5, this.motionX, this.motionY - (double)(this.rand.nextFloat() * 0.2F), this.motionZ); + } + +- for(var3 = 0; (float)var3 < 1.0F + this.width * 20.0F; ++var3) { +- var4 = (this.ab.nextFloat() * 2.0F - 1.0F) * this.width; +- var5 = (this.ab.nextFloat() * 2.0F - 1.0F) * this.width; ++ for (var3 = 0; (float)var3 < 1.0F + this.width * 20.0F; ++var3) { ++ var4 = (this.rand.nextFloat() * 2.0F - 1.0F) * this.width; ++ var5 = (this.rand.nextFloat() * 2.0F - 1.0F) * this.width; + this.worldObj.spawnParticle("splash", this.posX + (double)var4, (double)(var2 + 1.0F), this.posZ + (double)var5, this.motionX, this.motionY, this.motionZ); + } + } +@@ -719,14 +977,26 @@ + return this.inWater; + } + +- public boolean isInsideOfMaterial(Material var1) { +- double var2 = this.posY + (double)this.getEyeHeight(); ++ /** ++ * Checks if the current block the entity is within of the specified material type ++ */ ++ // Spout Start ++ public boolean isInsideOfMaterial(Material material) { ++ return isInsideOfMaterial(material, 0); ++ } ++ ++ public boolean isInsideOfMaterial(Material material, float offset) { ++ double var2 = this.posY + (double)this.getEyeHeight() + offset; ++ // Spout End + int var4 = MathHelper.floor_double(this.posX); + int var5 = MathHelper.floor_float((float)MathHelper.floor_double(var2)); + int var6 = MathHelper.floor_double(this.posZ); + int var7 = this.worldObj.getBlockId(var4, var5, var6); +- if(var7 != 0 && Block.blocksList[var7].blockMaterial == var1) { +- float var8 = BlockFluid.getFluidHeightPercent(this.worldObj.getBlockMetadata(var4, var5, var6)) - 1.0F / 9.0F; ++ ++ // Spout Start ++ if (var7 != 0 && Block.blocksList[var7].blockMaterial == material) { ++ // Spout End ++ float var8 = BlockFluid.getFluidHeightPercent(this.worldObj.getBlockMetadata(var4, var5, var6)) - 0.11111111F; + float var9 = (float)(var5 + 1) - var8; + return var2 < (double)var9; + } else { +@@ -738,156 +1008,214 @@ + return 0.0F; + } + ++ /** ++ * Whether or not the current entity is in lava ++ */ + public boolean handleLavaMovement() { +- return this.worldObj.isMaterialInBB(this.boundingBox.expand((double)-0.1F, (double)-0.4F, (double)-0.1F), Material.lava); ++ return this.worldObj.isMaterialInBB(this.boundingBox.expand(-0.10000000149011612D, -0.4000000059604645D, -0.10000000149011612D), Material.lava); + } + +- public void moveFlying(float var1, float var2, float var3) { +- float var4 = var1 * var1 + var2 * var2; +- if(var4 >= 1.0E-4F) { ++ /** ++ * Used in both water and by flying objects ++ */ ++ public void moveFlying(float par1, float par2, float par3) { ++ float var4 = par1 * par1 + par2 * par2; ++ ++ if (var4 >= 1.0E-4F) { + var4 = MathHelper.sqrt_float(var4); +- if(var4 < 1.0F) { ++ ++ if (var4 < 1.0F) { + var4 = 1.0F; + } + +- var4 = var3 / var4; +- var1 *= var4; +- var2 *= var4; ++ var4 = par3 / var4; ++ par1 *= var4; ++ par2 *= var4; + float var5 = MathHelper.sin(this.rotationYaw * (float)Math.PI / 180.0F); + float var6 = MathHelper.cos(this.rotationYaw * (float)Math.PI / 180.0F); +- this.motionX += (double)(var1 * var6 - var2 * var5); +- this.motionZ += (double)(var2 * var6 + var1 * var5); ++ this.motionX += (double)(par1 * var6 - par2 * var5); ++ this.motionZ += (double)(par2 * var6 + par1 * var5); + } + } + +- public int getBrightnessForRender(float var1) { ++ public int getBrightnessForRender(float par1) { + int var2 = MathHelper.floor_double(this.posX); + int var3 = MathHelper.floor_double(this.posZ); +- if(this.worldObj.blockExists(var2, 0, var3)) { +- double var4 = (this.boundingBox.maxY - this.boundingBox.minY) * 0.66D; +- int var6 = MathHelper.floor_double(this.posY - (double)this.yOffset + var4); +- return this.worldObj.getLightBrightnessForSkyBlocks(var2, var6, var3, 0); ++ ++ if (this.worldObj.blockExists(var2, 0, var3)) { ++ if (SpoutClient.getInstance().xrayMode) { ++ return 15728640; ++ } else { ++ double var4 = (this.boundingBox.maxY - this.boundingBox.minY) * 0.66D; ++ int var6 = MathHelper.floor_double(this.posY - (double)this.yOffset + var4); ++ return this.worldObj.getLightBrightnessForSkyBlocks(var2, var6, var3, 0); ++ } + } else { + return 0; + } + } + +- public float getBrightness(float var1) { ++ /** ++ * Gets how bright this entity is. ++ */ ++ public float getBrightness(float par1) { + int var2 = MathHelper.floor_double(this.posX); + int var3 = MathHelper.floor_double(this.posZ); +- if(this.worldObj.blockExists(var2, 0, var3)) { +- double var4 = (this.boundingBox.maxY - this.boundingBox.minY) * 0.66D; +- int var6 = MathHelper.floor_double(this.posY - (double)this.yOffset + var4); +- return this.worldObj.getLightBrightness(var2, var6, var3); ++ ++ if (this.worldObj.blockExists(var2, 0, var3)) { ++ if (SpoutClient.getInstance().xrayMode) { ++ return 1000.0F; ++ } else { ++ double var4 = (this.boundingBox.maxY - this.boundingBox.minY) * 0.66D; ++ int var6 = MathHelper.floor_double(this.posY - (double)this.yOffset + var4); ++ return this.worldObj.getLightBrightness(var2, var6, var3); ++ } + } else { + return 0.0F; + } + } + +- public void setWorld(World var1) { +- this.worldObj = var1; ++ /** ++ * Sets the reference to the World object. ++ */ ++ public void setWorld(World par1World) { ++ this.worldObj = par1World; + } + +- public void setPositionAndRotation(double var1, double var3, double var5, float var7, float var8) { +- this.prevPosX = this.posX = var1; +- this.prevPosY = this.posY = var3; +- this.prevPosZ = this.posZ = var5; +- this.prevRotationYaw = this.rotationYaw = var7; +- this.prevRotationPitch = this.rotationPitch = var8; ++ /** ++ * Sets the entity's position and rotation. Args: posX, posY, posZ, yaw, pitch ++ */ ++ public void setPositionAndRotation(double par1, double par3, double par5, float par7, float par8) { ++ this.prevPosX = this.posX = par1; ++ this.prevPosY = this.posY = par3; ++ this.prevPosZ = this.posZ = par5; ++ this.prevRotationYaw = this.rotationYaw = par7; ++ this.prevRotationPitch = this.rotationPitch = par8; + this.ySize = 0.0F; +- double var9 = (double)(this.prevRotationYaw - var7); +- if(var9 < -180.0D) { ++ double var9 = (double)(this.prevRotationYaw - par7); ++ ++ if (var9 < -180.0D) { + this.prevRotationYaw += 360.0F; + } + +- if(var9 >= 180.0D) { ++ if (var9 >= 180.0D) { + this.prevRotationYaw -= 360.0F; + } + + this.setPosition(this.posX, this.posY, this.posZ); +- this.setRotation(var7, var8); ++ this.setRotation(par7, par8); + } + +- public void setLocationAndAngles(double var1, double var3, double var5, float var7, float var8) { +- this.lastTickPosX = this.prevPosX = this.posX = var1; +- this.lastTickPosY = this.prevPosY = this.posY = var3 + (double)this.yOffset; +- this.lastTickPosZ = this.prevPosZ = this.posZ = var5; +- this.rotationYaw = var7; +- this.rotationPitch = var8; ++ /** ++ * Sets the location and Yaw/Pitch of an entity in the world ++ */ ++ public void setLocationAndAngles(double par1, double par3, double par5, float par7, float par8) { ++ this.lastTickPosX = this.prevPosX = this.posX = par1; ++ this.lastTickPosY = this.prevPosY = this.posY = par3 + (double)this.yOffset; ++ this.lastTickPosZ = this.prevPosZ = this.posZ = par5; ++ this.rotationYaw = par7; ++ this.rotationPitch = par8; + this.setPosition(this.posX, this.posY, this.posZ); + } + +- public float getDistanceToEntity(Entity var1) { +- float var2 = (float)(this.posX - var1.posX); +- float var3 = (float)(this.posY - var1.posY); +- float var4 = (float)(this.posZ - var1.posZ); ++ /** ++ * Returns the distance to the entity. Args: entity ++ */ ++ public float getDistanceToEntity(Entity par1Entity) { ++ float var2 = (float)(this.posX - par1Entity.posX); ++ float var3 = (float)(this.posY - par1Entity.posY); ++ float var4 = (float)(this.posZ - par1Entity.posZ); + return MathHelper.sqrt_float(var2 * var2 + var3 * var3 + var4 * var4); + } + +- public double getDistanceSq(double var1, double var3, double var5) { +- double var7 = this.posX - var1; +- double var9 = this.posY - var3; +- double var11 = this.posZ - var5; ++ /** ++ * Gets the squared distance to the position. Args: x, y, z ++ */ ++ public double getDistanceSq(double par1, double par3, double par5) { ++ double var7 = this.posX - par1; ++ double var9 = this.posY - par3; ++ double var11 = this.posZ - par5; + return var7 * var7 + var9 * var9 + var11 * var11; + } + +- public double getDistance(double var1, double var3, double var5) { +- double var7 = this.posX - var1; +- double var9 = this.posY - var3; +- double var11 = this.posZ - var5; ++ /** ++ * Gets the distance to the position. Args: x, y, z ++ */ ++ public double getDistance(double par1, double par3, double par5) { ++ double var7 = this.posX - par1; ++ double var9 = this.posY - par3; ++ double var11 = this.posZ - par5; + return (double)MathHelper.sqrt_double(var7 * var7 + var9 * var9 + var11 * var11); + } + +- public double getDistanceSqToEntity(Entity var1) { +- double var2 = this.posX - var1.posX; +- double var4 = this.posY - var1.posY; +- double var6 = this.posZ - var1.posZ; ++ /** ++ * Returns the squared distance to the entity. Args: entity ++ */ ++ public double getDistanceSqToEntity(Entity par1Entity) { ++ double var2 = this.posX - par1Entity.posX; ++ double var4 = this.posY - par1Entity.posY; ++ double var6 = this.posZ - par1Entity.posZ; + return var2 * var2 + var4 * var4 + var6 * var6; + } + +- public void onCollideWithPlayer(EntityPlayer var1) { +- } ++ /** ++ * Called by a player entity when they collide with an entity ++ */ ++ public void onCollideWithPlayer(EntityPlayer par1EntityPlayer) {} + +- public void applyEntityCollision(Entity var1) { +- if(var1.riddenByEntity != this && var1.ridingEntity != this) { +- double var2 = var1.posX - this.posX; +- double var4 = var1.posZ - this.posZ; ++ /** ++ * Applies a velocity to each of the entities pushing them away from each other. Args: entity ++ */ ++ public void applyEntityCollision(Entity par1Entity) { ++ if (par1Entity.riddenByEntity != this && par1Entity.ridingEntity != this) { ++ double var2 = par1Entity.posX - this.posX; ++ double var4 = par1Entity.posZ - this.posZ; + double var6 = MathHelper.abs_max(var2, var4); +- if(var6 >= (double)0.01F) { ++ ++ if (var6 >= 0.009999999776482582D) { + var6 = (double)MathHelper.sqrt_double(var6); + var2 /= var6; + var4 /= var6; + double var8 = 1.0D / var6; +- if(var8 > 1.0D) { ++ ++ if (var8 > 1.0D) { + var8 = 1.0D; + } + + var2 *= var8; + var4 *= var8; +- var2 *= (double)0.05F; +- var4 *= (double)0.05F; ++ var2 *= 0.05000000074505806D; ++ var4 *= 0.05000000074505806D; + var2 *= (double)(1.0F - this.entityCollisionReduction); + var4 *= (double)(1.0F - this.entityCollisionReduction); + this.addVelocity(-var2, 0.0D, -var4); +- var1.addVelocity(var2, 0.0D, var4); ++ par1Entity.addVelocity(var2, 0.0D, var4); + } +- + } + } + +- public void addVelocity(double var1, double var3, double var5) { +- this.motionX += var1; +- this.motionY += var3; +- this.motionZ += var5; ++ /** ++ * Adds to the current velocity of the entity. Args: x, y, z ++ */ ++ public void addVelocity(double par1, double par3, double par5) { ++ this.motionX += par1; ++ this.motionY += par3; ++ this.motionZ += par5; + this.isAirBorne = true; + } + ++ /** ++ * Sets that this entity has been attacked. ++ */ + protected void setBeenAttacked() { + this.velocityChanged = true; + } + +- public boolean attackEntityFrom(DamageSource var1, float var2) { +- if(this.isEntityInvulnerable()) { ++ /** ++ * Called when the entity is attacked. ++ */ ++ public boolean attackEntityFrom(DamageSource par1DamageSource, float par2) { ++ if (this.isEntityInvulnerable()) { + return false; + } else { + this.setBeenAttacked(); +@@ -895,75 +1223,110 @@ + } + } + ++ /** ++ * Returns true if other Entities should be prevented from moving through this Entity. ++ */ + public boolean canBeCollidedWith() { + return false; + } + ++ /** ++ * Returns true if this entity should push and be pushed by other entities when colliding. ++ */ + public boolean canBePushed() { + return false; + } + +- public void addToPlayerScore(Entity var1, int var2) { +- } ++ /** ++ * Adds a value to the player score. Currently not actually used and the entity passed in does nothing. Args: entity, ++ * scoreToAdd ++ */ ++ public void addToPlayerScore(Entity par1Entity, int par2) {} + +- public boolean isInRangeToRenderVec3D(Vec3 var1) { +- double var2 = this.posX - var1.xCoord; +- double var4 = this.posY - var1.yCoord; +- double var6 = this.posZ - var1.zCoord; ++ /** ++ * Checks using a Vec3d to determine if this entity is within range of that vector to be rendered. Args: vec3D ++ */ ++ public boolean isInRangeToRenderVec3D(Vec3 par1Vec3) { ++ double var2 = this.posX - par1Vec3.xCoord; ++ double var4 = this.posY - par1Vec3.yCoord; ++ double var6 = this.posZ - par1Vec3.zCoord; + double var8 = var2 * var2 + var4 * var4 + var6 * var6; + return this.isInRangeToRenderDist(var8); + } + +- public boolean isInRangeToRenderDist(double var1) { ++ /** ++ * Checks if the entity is in range to render by using the past in distance and comparing it to its average edge length ++ * * 64 * renderDistanceWeight Args: distance ++ */ ++ public boolean isInRangeToRenderDist(double par1) { + double var3 = this.boundingBox.getAverageEdgeLength(); + var3 *= 64.0D * this.renderDistanceWeight; +- return var1 < var3 * var3; +- } +- +- public boolean writeMountToNBT(NBTTagCompound var1) { +- String var2 = this.getEntityString(); +- if(!this.isDead && var2 != null) { +- var1.setString("id", var2); +- this.writeToNBT(var1); +- return true; +- } else { +- return false; +- } +- } +- +- public boolean writeToNBTOptional(NBTTagCompound var1) { +- String var2 = this.getEntityString(); +- if(!this.isDead && var2 != null && this.riddenByEntity == null) { +- var1.setString("id", var2); +- this.writeToNBT(var1); +- return true; +- } else { +- return false; +- } +- } +- +- public void writeToNBT(NBTTagCompound var1) { ++ return par1 < var3 * var3; ++ } ++ ++ /** ++ * Like writeToNBTOptional but does not check if the entity is ridden. Used for saving ridden entities with their ++ * riders. ++ */ ++ public boolean writeMountToNBT(NBTTagCompound par1NBTTagCompound) { ++ ++ String var2 = this.getEntityString(); ++ ++ if (!this.isDead && var2 != null) { ++ par1NBTTagCompound.setString("id", var2); ++ this.writeToNBT(par1NBTTagCompound); ++ return true; ++ } else { ++ return false; ++ } ++ } ++ ++ /** ++ * Either write this entity to the NBT tag given and return true, or return false without doing anything. If this ++ * returns false the entity is not saved on disk. Ridden entities return false here as they are saved with their rider. ++ */ ++ public boolean writeToNBTOptional(NBTTagCompound par1NBTTagCompound) { ++ String var2 = this.getEntityString(); ++ ++ if (!this.isDead && var2 != null && this.riddenByEntity == null) { ++ par1NBTTagCompound.setString("id", var2); ++ this.writeToNBT(par1NBTTagCompound); ++ return true; ++ } else { ++ return false; ++ } ++ } ++ ++ /** ++ * Save the entity to NBT (calls an abstract helper method to write extra data) ++ */ ++ public void writeToNBT(NBTTagCompound par1NBTTagCompound) { + try { +- var1.setTag("Pos", this.newDoubleNBTList(new double[]{this.posX, this.posY + (double)this.ySize, this.posZ})); +- var1.setTag("Motion", this.newDoubleNBTList(new double[]{this.motionX, this.motionY, this.motionZ})); +- var1.setTag("Rotation", this.newFloatNBTList(new float[]{this.rotationYaw, this.rotationPitch})); +- var1.setFloat("FallDistance", this.fallDistance); +- var1.setShort("Fire", (short)this.fire); +- var1.setShort("Air", (short)this.getAir()); +- var1.setBoolean("OnGround", this.onGround); +- var1.setInteger("Dimension", this.dimension); +- var1.setBoolean("Invulnerable", this.invulnerable); +- var1.setInteger("PortalCooldown", this.timeUntilPortal); +- var1.setLong("UUIDMost", this.i.getMostSignificantBits()); +- var1.setLong("UUIDLeast", this.i.getLeastSignificantBits()); +- this.writeEntityToNBT(var1); +- if(this.ridingEntity != null) { ++ par1NBTTagCompound.setTag("Pos", this.newDoubleNBTList(new double[] {this.posX, this.posY + (double)this.ySize, this.posZ})); ++ par1NBTTagCompound.setTag("Motion", this.newDoubleNBTList(new double[] {this.motionX, this.motionY, this.motionZ})); ++ par1NBTTagCompound.setTag("Rotation", this.newFloatNBTList(new float[] {this.rotationYaw, this.rotationPitch})); ++ par1NBTTagCompound.setFloat("FallDistance", this.fallDistance); ++ par1NBTTagCompound.setShort("Fire", (short)this.fire); ++ par1NBTTagCompound.setShort("Air", (short)this.getAir()); ++ par1NBTTagCompound.setBoolean("OnGround", this.onGround); ++ par1NBTTagCompound.setInteger("Dimension", this.dimension); ++ // Spout Start ++ par1NBTTagCompound.setLong("ID_LSB", uniqueId.getLeastSignificantBits()); ++ par1NBTTagCompound.setLong("ID_MSB", uniqueId.getMostSignificantBits()); ++ // Spout End ++ par1NBTTagCompound.setBoolean("Invulnerable", this.invulnerable); ++ par1NBTTagCompound.setInteger("PortalCooldown", this.timeUntilPortal); ++ par1NBTTagCompound.setLong("UUIDMost", this.entityUniqueID.getMostSignificantBits()); ++ par1NBTTagCompound.setLong("UUIDLeast", this.entityUniqueID.getLeastSignificantBits()); ++ this.writeEntityToNBT(par1NBTTagCompound); ++ ++ if (this.ridingEntity != null) { + NBTTagCompound var2 = new NBTTagCompound("Riding"); +- if(this.ridingEntity.writeMountToNBT(var2)) { +- var1.setTag("Riding", var2); ++ ++ if (this.ridingEntity.writeMountToNBT(var2)) { ++ par1NBTTagCompound.setTag("Riding", var2); + } + } +- + } catch (Throwable var5) { + CrashReport var3 = CrashReport.makeCrashReport(var5, "Saving entity NBT"); + CrashReportCategory var4 = var3.makeCategory("Entity being saved"); +@@ -972,46 +1335,60 @@ + } + } + +- public void readFromNBT(NBTTagCompound var1) { ++ /** ++ * Reads the entity from NBT (calls an abstract helper method to read specialized data) ++ */ ++ public void readFromNBT(NBTTagCompound par1NBTTagCompound) { + try { +- NBTTagList var2 = var1.getTagList("Pos"); +- NBTTagList var6 = var1.getTagList("Motion"); +- NBTTagList var7 = var1.getTagList("Rotation"); +- this.motionX = ((NBTTagDouble)var6.tagAt(0)).data; +- this.motionY = ((NBTTagDouble)var6.tagAt(1)).data; +- this.motionZ = ((NBTTagDouble)var6.tagAt(2)).data; +- if(Math.abs(this.motionX) > 10.0D) { ++ NBTTagList var2 = par1NBTTagCompound.getTagList("Pos"); ++ NBTTagList var7 = par1NBTTagCompound.getTagList("Motion"); ++ NBTTagList var6 = par1NBTTagCompound.getTagList("Rotation"); ++ this.motionX = ((NBTTagDouble)var7.tagAt(0)).data; ++ this.motionY = ((NBTTagDouble)var7.tagAt(1)).data; ++ this.motionZ = ((NBTTagDouble)var7.tagAt(2)).data; ++ ++ if (Math.abs(this.motionX) > 10.0D) { + this.motionX = 0.0D; + } + +- if(Math.abs(this.motionY) > 10.0D) { ++ if (Math.abs(this.motionY) > 10.0D) { + this.motionY = 0.0D; + } + +- if(Math.abs(this.motionZ) > 10.0D) { ++ if (Math.abs(this.motionZ) > 10.0D) { + this.motionZ = 0.0D; + } + + this.prevPosX = this.lastTickPosX = this.posX = ((NBTTagDouble)var2.tagAt(0)).data; + this.prevPosY = this.lastTickPosY = this.posY = ((NBTTagDouble)var2.tagAt(1)).data; + this.prevPosZ = this.lastTickPosZ = this.posZ = ((NBTTagDouble)var2.tagAt(2)).data; +- this.prevRotationYaw = this.rotationYaw = ((NBTTagFloat)var7.tagAt(0)).data; +- this.prevRotationPitch = this.rotationPitch = ((NBTTagFloat)var7.tagAt(1)).data; +- this.fallDistance = var1.getFloat("FallDistance"); +- this.fire = var1.getShort("Fire"); +- this.setAir(var1.getShort("Air")); +- this.onGround = var1.getBoolean("OnGround"); +- this.dimension = var1.getInteger("Dimension"); +- this.invulnerable = var1.getBoolean("Invulnerable"); +- this.timeUntilPortal = var1.getInteger("PortalCooldown"); +- if(var1.hasKey("UUIDMost") && var1.hasKey("UUIDLeast")) { +- this.i = new UUID(var1.getLong("UUIDMost"), var1.getLong("UUIDLeast")); ++ this.prevRotationYaw = this.rotationYaw = ((NBTTagFloat)var6.tagAt(0)).data; ++ this.prevRotationPitch = this.rotationPitch = ((NBTTagFloat)var6.tagAt(1)).data; ++ this.fallDistance = par1NBTTagCompound.getFloat("FallDistance"); ++ this.fire = par1NBTTagCompound.getShort("Fire"); ++ this.setAir(par1NBTTagCompound.getShort("Air")); ++ this.onGround = par1NBTTagCompound.getBoolean("OnGround"); ++ this.dimension = par1NBTTagCompound.getInteger("Dimension"); ++ this.invulnerable = par1NBTTagCompound.getBoolean("Invulnerable"); ++ this.timeUntilPortal = par1NBTTagCompound.getInteger("PortalCooldown"); ++ ++ if (par1NBTTagCompound.hasKey("UUIDMost") && par1NBTTagCompound.hasKey("UUIDLeast")) { ++ this.entityUniqueID = new UUID(par1NBTTagCompound.getLong("UUIDMost"), par1NBTTagCompound.getLong("UUIDLeast")); + } + + this.setPosition(this.posX, this.posY, this.posZ); + this.setRotation(this.rotationYaw, this.rotationPitch); +- this.readEntityFromNBT(var1); +- if(this.shouldSetPosAfterLoading()) { ++ // Spout Start ++ long lsb = par1NBTTagCompound.getLong("ID_LSB"); ++ long msb = par1NBTTagCompound.getLong("ID_MSB"); ++ UUID id = new UUID(msb, lsb); ++ if (!id.equals(new UUID(0, 0))) { ++ uniqueId = id; ++ } ++ // Spout End ++ this.readEntityFromNBT(par1NBTTagCompound); ++ ++ if (this.shouldSetPosAfterLoading()) { + this.setPosition(this.posX, this.posY, this.posZ); + } + +@@ -1027,23 +1404,33 @@ + return true; + } + ++ /** ++ * Returns the string that identifies this Entity's class ++ */ + protected final String getEntityString() { + return EntityList.getEntityString(this); + } + ++ /** ++ * (abstract) Protected helper method to read subclass entity data from NBT. ++ */ + protected abstract void readEntityFromNBT(NBTTagCompound var1); + ++ /** ++ * (abstract) Protected helper method to write subclass entity data to NBT. ++ */ + protected abstract void writeEntityToNBT(NBTTagCompound var1); + +- public void onChunkLoad() { +- } +- +- protected NBTTagList newDoubleNBTList(double... var1) { ++ public void onChunkLoad() {} ++ /** ++ * creates a NBT list from the array of doubles passed to this function ++ */ ++ protected NBTTagList newDoubleNBTList(double ... par1ArrayOfDouble) { + NBTTagList var2 = new NBTTagList(); +- double[] var3 = var1; +- int var4 = var1.length; ++ double[] var3 = par1ArrayOfDouble; ++ int var4 = par1ArrayOfDouble.length; + +- for(int var5 = 0; var5 < var4; ++var5) { ++ for (int var5 = 0; var5 < var4; ++var5) { + double var6 = var3[var5]; + var2.appendTag(new NBTTagDouble((String)null, var6)); + } +@@ -1051,12 +1438,15 @@ + return var2; + } + +- protected NBTTagList newFloatNBTList(float... var1) { ++ /** ++ * Returns a new NBTTagList filled with the specified floats ++ */ ++ protected NBTTagList newFloatNBTList(float ... par1ArrayOfFloat) { + NBTTagList var2 = new NBTTagList(); +- float[] var3 = var1; +- int var4 = var1.length; ++ float[] var3 = par1ArrayOfFloat; ++ int var4 = par1ArrayOfFloat.length; + +- for(int var5 = 0; var5 < var4; ++var5) { ++ for (int var5 = 0; var5 < var4; ++var5) { + float var6 = var3[var5]; + var2.appendTag(new NBTTagFloat((String)null, var6)); + } +@@ -1068,38 +1458,54 @@ + return this.height / 2.0F; + } + +- public EntityItem dropItem(int var1, int var2) { +- return this.dropItemWithOffset(var1, var2, 0.0F); +- } +- +- public EntityItem dropItemWithOffset(int var1, int var2, float var3) { +- return this.entityDropItem(new ItemStack(var1, var2, 0), var3); +- } +- +- public EntityItem entityDropItem(ItemStack var1, float var2) { +- if(var1.stackSize == 0) { ++ /** ++ * Drops an item stack at the entity's position. Args: itemID, count ++ */ ++ public EntityItem dropItem(int par1, int par2) { ++ return this.dropItemWithOffset(par1, par2, 0.0F); ++ } ++ ++ /** ++ * Drops an item stack with a specified y offset. Args: itemID, count, yOffset ++ */ ++ public EntityItem dropItemWithOffset(int par1, int par2, float par3) { ++ return this.entityDropItem(new ItemStack(par1, par2, 0), par3); ++ } ++ ++ /** ++ * Drops an item at the position of the entity. ++ */ ++ public EntityItem entityDropItem(ItemStack par1ItemStack, float par2) { ++ if (par1ItemStack.stackSize == 0) { + return null; + } else { +- EntityItem var3 = new EntityItem(this.worldObj, this.posX, this.posY + (double)var2, this.posZ, var1); ++ EntityItem var3 = new EntityItem(this.worldObj, this.posX, this.posY + (double)par2, this.posZ, par1ItemStack); + var3.delayBeforeCanPickup = 10; + this.worldObj.spawnEntityInWorld(var3); + return var3; + } + } + ++ /** ++ * Checks whether target entity is alive. ++ */ + public boolean isEntityAlive() { + return !this.isDead; + } + ++ /** ++ * Checks if this entity is inside of an opaque block ++ */ + public boolean isEntityInsideOpaqueBlock() { +- for(int var1 = 0; var1 < 8; ++var1) { ++ for (int var1 = 0; var1 < 8; ++var1) { + float var2 = ((float)((var1 >> 0) % 2) - 0.5F) * this.width * 0.8F; + float var3 = ((float)((var1 >> 1) % 2) - 0.5F) * 0.1F; + float var4 = ((float)((var1 >> 2) % 2) - 0.5F) * this.width * 0.8F; + int var5 = MathHelper.floor_double(this.posX + (double)var2); + int var6 = MathHelper.floor_double(this.posY + (double)this.getEyeHeight() + (double)var3); + int var7 = MathHelper.floor_double(this.posZ + (double)var4); +- if(this.worldObj.isBlockNormalCube(var5, var6, var7)) { ++ ++ if (this.worldObj.isBlockNormalCube(var5, var6, var7)) { + return true; + } + } +@@ -1107,135 +1513,172 @@ + return false; + } + +- public boolean interactFirst(EntityPlayer var1) { +- return false; ++ /** ++ * Only used by renderer in EntityLivingBase subclasses.\nDetermines if an entity is visible or not to a specfic ++ * player, if the entity is normally invisible.\nFor EntityLivingBase subclasses, returning false when invisible will ++ * render the entity semitransparent. ++ */ ++ public boolean isInvisibleToPlayer(EntityPlayer par1EntityPlayer) { ++ return this.isInvisible(); + } + +- public AxisAlignedBB getCollisionBox(Entity var1) { ++ /** ++ * Returns a boundingBox used to collide the entity with other entities and blocks. This enables the entity to be ++ * pushable on contact, like boats or minecarts. ++ */ ++ public AxisAlignedBB getCollisionBox(Entity par1Entity) { + return null; + } + ++ /** ++ * Handles updating while being ridden by an entity ++ */ + public void updateRidden() { +- if(this.ridingEntity.isDead) { ++ if (this.ridingEntity.isDead) { + this.ridingEntity = null; + } else { + this.motionX = 0.0D; + this.motionY = 0.0D; + this.motionZ = 0.0D; + this.onUpdate(); +- if(this.ridingEntity != null) { ++ ++ if (this.ridingEntity != null) { + this.ridingEntity.updateRiderPosition(); + this.entityRiderYawDelta += (double)(this.ridingEntity.rotationYaw - this.ridingEntity.prevRotationYaw); + +- for(this.entityRiderPitchDelta += (double)(this.ridingEntity.rotationPitch - this.ridingEntity.prevRotationPitch); this.entityRiderYawDelta >= 180.0D; this.entityRiderYawDelta -= 360.0D) { ++ for (this.entityRiderPitchDelta += (double)(this.ridingEntity.rotationPitch - this.ridingEntity.prevRotationPitch); this.entityRiderYawDelta >= 180.0D; this.entityRiderYawDelta -= 360.0D) { ++ ; + } + +- while(this.entityRiderYawDelta < -180.0D) { ++ while (this.entityRiderYawDelta < -180.0D) { + this.entityRiderYawDelta += 360.0D; + } + +- while(this.entityRiderPitchDelta >= 180.0D) { ++ while (this.entityRiderPitchDelta >= 180.0D) { + this.entityRiderPitchDelta -= 360.0D; + } + +- while(this.entityRiderPitchDelta < -180.0D) { ++ while (this.entityRiderPitchDelta < -180.0D) { + this.entityRiderPitchDelta += 360.0D; + } + + double var1 = this.entityRiderYawDelta * 0.5D; + double var3 = this.entityRiderPitchDelta * 0.5D; + float var5 = 10.0F; +- if(var1 > (double)var5) { ++ ++ if (var1 > (double)var5) { + var1 = (double)var5; + } + +- if(var1 < (double)(-var5)) { ++ if (var1 < (double)(-var5)) { + var1 = (double)(-var5); + } + +- if(var3 > (double)var5) { ++ if (var3 > (double)var5) { + var3 = (double)var5; + } + +- if(var3 < (double)(-var5)) { ++ if (var3 < (double)(-var5)) { + var3 = (double)(-var5); + } + + this.entityRiderYawDelta -= var1; +- this.entityRiderPitchDelta -= var3; ++ this.entityRiderPitchDelta -= var3; + } + } + } + + public void updateRiderPosition() { +- if(this.riddenByEntity != null) { ++ if (this.riddenByEntity != null) { + this.riddenByEntity.setPosition(this.posX, this.posY + this.getMountedYOffset() + this.riddenByEntity.getYOffset(), this.posZ); + } + } + ++ /** ++ * Returns the Y Offset of this entity. ++ */ + public double getYOffset() { + return (double)this.yOffset; + } + ++ /** ++ * Returns the Y offset from the entity's position for any entity riding this one. ++ */ + public double getMountedYOffset() { + return (double)this.height * 0.75D; + } + +- public void mountEntity(Entity var1) { ++ /** ++ * Called when a player mounts an entity. e.g. mounts a pig, mounts a boat. ++ */ ++ public void mountEntity(Entity par1Entity) { + this.entityRiderPitchDelta = 0.0D; + this.entityRiderYawDelta = 0.0D; +- if(var1 == null) { +- if(this.ridingEntity != null) { ++ ++ if (par1Entity == null) { ++ if (this.ridingEntity != null) { + this.setLocationAndAngles(this.ridingEntity.posX, this.ridingEntity.boundingBox.minY + (double)this.ridingEntity.height, this.ridingEntity.posZ, this.rotationYaw, this.rotationPitch); + this.ridingEntity.riddenByEntity = null; + } + + this.ridingEntity = null; + } else { +- if(this.ridingEntity != null) { ++ if (this.ridingEntity != null) { + this.ridingEntity.riddenByEntity = null; + } + +- this.ridingEntity = var1; +- var1.riddenByEntity = this; ++ this.ridingEntity = par1Entity; ++ par1Entity.riddenByEntity = this; + } + } + +- public void setPositionAndRotation2(double var1, double var3, double var5, float var7, float var8, int var9) { +- this.setPosition(var1, var3, var5); +- this.setRotation(var7, var8); +- List var10 = this.worldObj.getCollidingBoundingBoxes(this, this.boundingBox.contract(1.0D / 32.0D, 0.0D, 1.0D / 32.0D)); +- if(!var10.isEmpty()) { ++ /** ++ * Sets the position and rotation. Only difference from the other one is no bounding on the rotation. Args: posX, posY, ++ * posZ, yaw, pitch ++ */ ++ public void setPositionAndRotation2(double par1, double par3, double par5, float par7, float par8, int par9) { ++ this.setPosition(par1, par3, par5); ++ this.setRotation(par7, par8); ++ List var10 = this.worldObj.getCollidingBoundingBoxes(this, this.boundingBox.contract(0.03125D, 0.0D, 0.03125D)); ++ ++ if (!var10.isEmpty()) { + double var11 = 0.0D; + +- for(int var13 = 0; var13 < var10.size(); ++var13) { ++ for (int var13 = 0; var13 < var10.size(); ++var13) { + AxisAlignedBB var14 = (AxisAlignedBB)var10.get(var13); +- if(var14.maxY > var11) { ++ ++ if (var14.maxY > var11) { + var11 = var14.maxY; + } + } + +- var3 += var11 - this.boundingBox.minY; +- this.setPosition(var1, var3, var5); ++ par3 += var11 - this.boundingBox.minY; ++ this.setPosition(par1, par3, par5); + } +- + } + + public float getCollisionBorderSize() { + return 0.1F; + } + ++ /** ++ * returns a (normalized) vector of where this entity is looking ++ */ + public Vec3 getLookVec() { + return null; + } + ++ /** ++ * Called by portal blocks when an entity is within it. ++ */ + public void setInPortal() { +- if(this.timeUntilPortal > 0) { ++ if (this.timeUntilPortal > 0) { + this.timeUntilPortal = this.getPortalCooldown(); + } else { + double var1 = this.prevPosX - this.posX; + double var3 = this.prevPosZ - this.posZ; +- if(!this.worldObj.isRemote && !this.inPortal) { ++ ++ if (!this.worldObj.isRemote && !this.inPortal) { + this.teleportDirection = Direction.getMovementDirection(var1, var3); + } + +@@ -1243,116 +1686,162 @@ + } + } + ++ /** ++ * Return the amount of cooldown before this entity can use a portal again. ++ */ + public int getPortalCooldown() { + return 900; + } + +- public void setVelocity(double var1, double var3, double var5) { +- this.motionX = var1; +- this.motionY = var3; +- this.motionZ = var5; +- } +- +- public void handleHealthUpdate(byte var1) { +- } +- +- public void performHurtAnimation() { +- } +- +- public ItemStack[] getInventory() { ++ /** ++ * Sets the velocity to the args. Args: x, y, z ++ */ ++ public void setVelocity(double par1, double par3, double par5) { ++ this.motionX = par1; ++ this.motionY = par3; ++ this.motionZ = par5; ++ } ++ ++ public void handleHealthUpdate(byte par1) {} ++ ++ /** ++ * Setups the entity to do the hurt animation. Only used by packets in multiplayer. ++ */ ++ public void performHurtAnimation() {} ++ ++ public ItemStack[] getLastActiveItems() { + return null; + } + +- public void setCurrentItemOrArmor(int var1, ItemStack var2) { +- } ++ /** ++ * Sets the held item, or an armor slot. Slot 0 is held item. Slot 1-4 is armor. Params: Item, slot ++ */ ++ public void setCurrentItemOrArmor(int par1, ItemStack par2ItemStack) {} + ++ /** ++ * Returns true if the entity is on fire. Used by render to add the fire effect on rendering. ++ */ + public boolean isBurning() { + return !this.isImmuneToFire && (this.fire > 0 || this.getFlag(0)); + } + ++ /** ++ * Returns true if the entity is riding another entity, used by render to rotate the legs to be in 'sit' position for ++ * players. ++ */ + public boolean isRiding() { + return this.ridingEntity != null; + } + ++ /** ++ * Returns if this entity is sneaking. ++ */ + public boolean isSneaking() { + return this.getFlag(1); + } + +- public void setSneaking(boolean var1) { +- this.setFlag(1, var1); ++ /** ++ * Sets the sneaking flag. ++ */ ++ public void setSneaking(boolean par1) { ++ this.setFlag(1, par1); + } + ++ /** ++ * Get if the Entity is sprinting. ++ */ + public boolean isSprinting() { + return this.getFlag(3); + } + +- public void setSprinting(boolean var1) { +- this.setFlag(3, var1); ++ /** ++ * Set sprinting switch for Entity. ++ */ ++ public void setSprinting(boolean par1) { ++ this.setFlag(3, par1); + } + + public boolean isInvisible() { + return this.getFlag(5); + } + +- public boolean isInvisibleToPlayer(EntityPlayer var1) { ++ public boolean func_98034_c(EntityPlayer par1EntityPlayer) { + return this.isInvisible(); + } + +- public void setInvisible(boolean var1) { +- this.setFlag(5, var1); ++ public void setInvisible(boolean par1) { ++ this.setFlag(5, par1); + } + + public boolean isEating() { + return this.getFlag(4); + } + +- public void setEating(boolean var1) { +- this.setFlag(4, var1); +- } +- +- protected boolean getFlag(int var1) { +- return (this.dataWatcher.getWatchableObjectByte(0) & 1 << var1) != 0; +- } +- +- protected void setFlag(int var1, boolean var2) { ++ public void setEating(boolean par1) { ++ this.setFlag(4, par1); ++ } ++ ++ /** ++ * Returns true if the flag is active for the entity. Known flags: 0) is burning; 1) is sneaking; 2) is riding ++ * something; 3) is sprinting; 4) is eating ++ */ ++ protected boolean getFlag(int par1) { ++ return (this.dataWatcher.getWatchableObjectByte(0) & 1 << par1) != 0; ++ } ++ ++ /** ++ * Enable or disable a entity flag, see getEntityFlag to read the know flags. ++ */ ++ // Spout Start - protected to public ++ public void setFlag(int par1, boolean par2) { ++ // Spout End + byte var3 = this.dataWatcher.getWatchableObjectByte(0); +- if(var2) { +- this.dataWatcher.updateObject(0, Byte.valueOf((byte)(var3 | 1 << var1))); ++ ++ if (par2) { ++ this.dataWatcher.updateObject(0, Byte.valueOf((byte)(var3 | 1 << par1))); + } else { +- this.dataWatcher.updateObject(0, Byte.valueOf((byte)(var3 & ~(1 << var1)))); ++ this.dataWatcher.updateObject(0, Byte.valueOf((byte)(var3 & ~(1 << par1)))); + } +- + } + + public int getAir() { + return this.dataWatcher.getWatchableObjectShort(1); + } + +- public void setAir(int var1) { +- this.dataWatcher.updateObject(1, Short.valueOf((short)var1)); ++ public void setAir(int par1) { ++ this.dataWatcher.updateObject(1, Short.valueOf((short)par1)); + } + +- public void onStruckByLightning(EntityLightningBolt var1) { ++ /** ++ * Called when a lightning bolt hits the entity. ++ */ ++ public void onStruckByLightning(EntityLightningBolt par1EntityLightningBolt) { + this.dealFireDamage(5); + ++this.fire; +- if(this.fire == 0) { ++ ++ if (this.fire == 0) { + this.setFire(8); + } +- +- } +- +- public void onKillEntity(EntityLivingBase var1) { +- } +- +- protected boolean pushOutOfBlocks(double var1, double var3, double var5) { +- int var7 = MathHelper.floor_double(var1); +- int var8 = MathHelper.floor_double(var3); +- int var9 = MathHelper.floor_double(var5); +- double var10 = var1 - (double)var7; +- double var12 = var3 - (double)var8; +- double var14 = var5 - (double)var9; ++ } ++ ++ /** ++ * This method gets called when the entity kills another one. ++ */ ++ public void onKillEntity(EntityLivingBase par1EntityLivingBase) {} ++ ++ /** ++ * Adds velocity to push the entity out of blocks at the specified x, y, z position Args: x, y, z ++ */ ++ protected boolean pushOutOfBlocks(double par1, double par3, double par5) { ++ int var7 = MathHelper.floor_double(par1); ++ int var8 = MathHelper.floor_double(par3); ++ int var9 = MathHelper.floor_double(par5); ++ double var10 = par1 - (double)var7; ++ double var12 = par3 - (double)var8; ++ double var14 = par5 - (double)var9; + List var16 = this.worldObj.getCollidingBlockBounds(this.boundingBox); +- if(var16.isEmpty() && !this.worldObj.isBlockFullCube(var7, var8, var9)) { ++ ++ if (var16.isEmpty() && !this.worldObj.isBlockFullCube(var7, var8, var9)) { + return false; + } else { + boolean var17 = !this.worldObj.isBlockFullCube(var7 - 1, var8, var9); +@@ -1363,53 +1852,55 @@ + boolean var22 = !this.worldObj.isBlockFullCube(var7, var8, var9 + 1); + byte var23 = 3; + double var24 = 9999.0D; +- if(var17 && var10 < var24) { ++ ++ if (var17 && var10 < var24) { + var24 = var10; + var23 = 0; + } + +- if(var18 && 1.0D - var10 < var24) { ++ if (var18 && 1.0D - var10 < var24) { + var24 = 1.0D - var10; + var23 = 1; + } + +- if(var20 && 1.0D - var12 < var24) { ++ if (var20 && 1.0D - var12 < var24) { + var24 = 1.0D - var12; + var23 = 3; + } + +- if(var21 && var14 < var24) { ++ if (var21 && var14 < var24) { + var24 = var14; + var23 = 4; + } + +- if(var22 && 1.0D - var14 < var24) { ++ if (var22 && 1.0D - var14 < var24) { + var24 = 1.0D - var14; + var23 = 5; + } + +- float var26 = this.ab.nextFloat() * 0.2F + 0.1F; +- if(var23 == 0) { ++ float var26 = this.rand.nextFloat() * 0.2F + 0.1F; ++ ++ if (var23 == 0) { + this.motionX = (double)(-var26); + } + +- if(var23 == 1) { ++ if (var23 == 1) { + this.motionX = (double)var26; + } + +- if(var23 == 2) { ++ if (var23 == 2) { + this.motionY = (double)(-var26); + } + +- if(var23 == 3) { ++ if (var23 == 3) { + this.motionY = (double)var26; + } + +- if(var23 == 4) { ++ if (var23 == 4) { + this.motionZ = (double)(-var26); + } + +- if(var23 == 5) { ++ if (var23 == 5) { + this.motionZ = (double)var26; + } + +@@ -1417,72 +1908,108 @@ + } + } + ++ /** ++ * Sets the Entity inside a web block. ++ */ + public void setInWeb() { + this.isInWeb = true; + this.fallDistance = 0.0F; + } + ++ /** ++ * Gets the username of the entity. ++ */ + public String getEntityName() { + String var1 = EntityList.getEntityString(this); +- if(var1 == null) { ++ ++ if (var1 == null) { + var1 = "generic"; + } + + return StatCollector.translateToLocal("entity." + var1 + ".name"); + } + ++ /** ++ * Return the Entity parts making up this Entity (currently only for dragons) ++ */ + public Entity[] getParts() { + return null; + } + +- public boolean isEntityEqual(Entity var1) { +- return this == var1; ++ /** ++ * Returns true if Entity argument is equal to this Entity ++ */ ++ public boolean isEntityEqual(Entity par1Entity) { ++ return this == par1Entity; + } + + public float getRotationYawHead() { + return 0.0F; + } + +- public void setRotationYawHead(float var1) { +- } ++ /** ++ * Sets the head's yaw rotation of the entity. ++ */ ++ public void setRotationYawHead(float par1) {} + ++ /** ++ * If returns false, the item will not inflict any damage against entities. ++ */ + public boolean canAttackWithItem() { + return true; + } + +- public boolean hitByEntity(Entity var1) { ++ /** ++ * Called when a player attacks an entity. If this returns true the attack will not happen. ++ */ ++ public boolean hitByEntity(Entity par1Entity) { + return false; + } + + public String toString() { +- return String.format("%s[\'%s\'/%d, l=\'%s\', x=%.2f, y=%.2f, z=%.2f]", new Object[]{this.getClass().getSimpleName(), this.getEntityName(), Integer.valueOf(this.entityId), this.worldObj == null ? "~NULL~" : this.worldObj.getWorldInfo().getWorldName(), Double.valueOf(this.posX), Double.valueOf(this.posY), Double.valueOf(this.posZ)}); ++ return String.format("%s[\'%s\'/%d, l=\'%s\', x=%.2f, y=%.2f, z=%.2f]", new Object[] {this.getClass().getSimpleName(), this.getEntityName(), Integer.valueOf(this.entityId), this.worldObj == null ? "~NULL~" : this.worldObj.getWorldInfo().getWorldName(), Double.valueOf(this.posX), Double.valueOf(this.posY), Double.valueOf(this.posZ)}); + } + ++ /** ++ * Return whether this entity is invulnerable to damage. ++ */ + public boolean isEntityInvulnerable() { + return this.invulnerable; + } + +- public void copyLocationAndAnglesFrom(Entity var1) { +- this.setLocationAndAngles(var1.posX, var1.posY, var1.posZ, var1.rotationYaw, var1.rotationPitch); ++ /** ++ * Sets this entity's location and angles to the location and angles of the passed in entity. ++ */ ++ public void copyLocationAndAnglesFrom(Entity par1Entity) { ++ this.setLocationAndAngles(par1Entity.posX, par1Entity.posY, par1Entity.posZ, par1Entity.rotationYaw, par1Entity.rotationPitch); + } + +- public void copyDataFrom(Entity var1, boolean var2) { ++ /** ++ * Copies important data from another entity to this entity. Used when teleporting entities between worlds, as this ++ * actually deletes the teleporting entity and re-creates it on the other side. Params: Entity to copy from, unused ++ * (always true) ++ */ ++ public void copyDataFrom(Entity par1Entity, boolean par2) { + NBTTagCompound var3 = new NBTTagCompound(); +- var1.writeToNBT(var3); ++ par1Entity.writeToNBT(var3); + this.readFromNBT(var3); +- this.timeUntilPortal = var1.timeUntilPortal; +- this.teleportDirection = var1.teleportDirection; ++ this.timeUntilPortal = par1Entity.timeUntilPortal; ++ this.teleportDirection = par1Entity.teleportDirection; + } + +- public void travelToDimension(int var1) { +- if(!this.worldObj.isRemote && !this.isDead) { ++ /** ++ * Teleports the entity to another dimension. Params: Dimension number to teleport to ++ */ ++ public void travelToDimension(int par1) { ++ if (!this.worldObj.isRemote && !this.isDead) { + this.worldObj.theProfiler.startSection("changeDimension"); + MinecraftServer var2 = MinecraftServer.getServer(); + int var3 = this.dimension; + WorldServer var4 = var2.worldServerForDimension(var3); +- WorldServer var5 = var2.worldServerForDimension(var1); +- this.dimension = var1; +- if(var3 == 1 && var1 == 1) { ++ WorldServer var5 = var2.worldServerForDimension(par1); ++ this.dimension = par1; ++ ++ if (var3 == 1 && par1 == 1) { + var5 = var2.worldServerForDimension(0); + this.dimension = 0; + } +@@ -1493,9 +2020,11 @@ + var2.getConfigurationManager().transferEntityToWorld(this, var3, var4, var5); + this.worldObj.theProfiler.endStartSection("reloading"); + Entity var6 = EntityList.createEntityByName(EntityList.getEntityString(this), var5); +- if(var6 != null) { ++ ++ if (var6 != null) { + var6.copyDataFrom(this, true); +- if(var3 == 1 && var1 == 1) { ++ ++ if (var3 == 1 && par1 == 1) { + ChunkCoordinates var7 = var5.getSpawnPoint(); + var7.posY = this.worldObj.getTopSolidOrLiquidBlock(var7.posX, var7.posZ); + var6.setLocationAndAngles((double)var7.posX, (double)var7.posY, (double)var7.posZ, var6.rotationYaw, var6.rotationPitch); +@@ -1512,14 +2041,21 @@ + } + } + +- public float getBlockExplosionResistance(Explosion var1, World var2, int var3, int var4, int var5, Block var6) { +- return var6.getExplosionResistance(this); ++ /** ++ * Gets a block's resistance to this entity's explosion. Used to make rails immune to TNT minecarts' explosions and ++ * Wither skulls more destructive. ++ */ ++ public float getBlockExplosionResistance(Explosion par1Explosion, World par2World, int par3, int par4, int par5, Block par6Block) { ++ return par6Block.getExplosionResistance(this); + } + +- public boolean shouldExplodeBlock(Explosion var1, World var2, int var3, int var4, int var5, int var6, float var7) { ++ public boolean shouldExplodeBlock(Explosion par1Explosion, World par2World, int par3, int par4, int par5, int par6, float par7) { + return true; + } + ++ /** ++ * The number of iterations PathFinder.getSafePoint will execute before giving up. ++ */ + public int getMaxSafePointTries() { + return 3; + } +@@ -1528,31 +2064,40 @@ + return this.teleportDirection; + } + ++ /** ++ * Return whether this entity should NOT trigger a pressure plate or a tripwire. ++ */ + public boolean doesEntityNotTriggerPressurePlate() { + return false; + } + +- public void addEntityCrashInfo(CrashReportCategory var1) { +- var1.addCrashSectionCallable("Entity Type", new CallableEntityType(this)); +- var1.addCrashSection("Entity ID", Integer.valueOf(this.entityId)); +- var1.addCrashSectionCallable("Entity Name", new CallableEntityName(this)); +- var1.addCrashSection("Entity\'s Exact location", String.format("%.2f, %.2f, %.2f", new Object[]{Double.valueOf(this.posX), Double.valueOf(this.posY), Double.valueOf(this.posZ)})); +- var1.addCrashSection("Entity\'s Block location", CrashReportCategory.getLocationInfo(MathHelper.floor_double(this.posX), MathHelper.floor_double(this.posY), MathHelper.floor_double(this.posZ))); +- var1.addCrashSection("Entity\'s Momentum", String.format("%.2f, %.2f, %.2f", new Object[]{Double.valueOf(this.motionX), Double.valueOf(this.motionY), Double.valueOf(this.motionZ)})); ++ public void addEntityCrashInfo(CrashReportCategory par1CrashReportCategory) { ++ par1CrashReportCategory.addCrashSectionCallable("Entity Type", new CallableEntityType(this)); ++ par1CrashReportCategory.addCrashSection("Entity ID", Integer.valueOf(this.entityId)); ++ par1CrashReportCategory.addCrashSectionCallable("Entity Name", new CallableEntityName(this)); ++ par1CrashReportCategory.addCrashSection("Entity\'s Exact location", String.format("%.2f, %.2f, %.2f", new Object[] {Double.valueOf(this.posX), Double.valueOf(this.posY), Double.valueOf(this.posZ)})); ++ par1CrashReportCategory.addCrashSection("Entity\'s Block location", CrashReportCategory.getLocationInfo(MathHelper.floor_double(this.posX), MathHelper.floor_double(this.posY), MathHelper.floor_double(this.posZ))); ++ par1CrashReportCategory.addCrashSection("Entity\'s Momentum", String.format("%.2f, %.2f, %.2f", new Object[] {Double.valueOf(this.motionX), Double.valueOf(this.motionY), Double.valueOf(this.motionZ)})); + } + ++ /** ++ * Return whether this entity should be rendered as on fire. ++ */ + public boolean canRenderOnFire() { + return this.isBurning(); + } + + public UUID getUniqueID() { +- return this.i; ++ return this.entityUniqueID; + } + + public boolean isPushedByWater() { + return true; + } + ++ /** ++ * Returns the translated name of the entity. ++ */ + public String getTranslatedEntityName() { + return this.getEntityName(); + } diff --git a/patches/net/minecraft/src/EntityAIArrowAttack.java.patch b/patches/net/minecraft/src/EntityAIArrowAttack.java.patch new file mode 100644 index 0000000..f4a4323 --- /dev/null +++ b/patches/net/minecraft/src/EntityAIArrowAttack.java.patch @@ -0,0 +1,149 @@ +--- net/minecraft/src/EntityAIArrowAttack.java ++++ net/minecraft/src/EntityAIArrowAttack.java +@@ -1,40 +1,60 @@ + package net.minecraft.src; + + public class EntityAIArrowAttack extends EntityAIBase { ++ ++ /** The entity the AI instance has been applied to */ + private final EntityLiving entityHost; ++ ++ /** ++ * The entity (as a RangedAttackMob) the AI instance has been applied to. ++ */ + private final IRangedAttackMob rangedAttackEntityHost; + private EntityLivingBase attackTarget; ++ ++ /** ++ * A decrementing tick that spawns a ranged attack once this value reaches 0. It is then set back to the ++ * maxRangedAttackTime. ++ */ + private int rangedAttackTime; + private double entityMoveSpeed; + private int field_75318_f; + private int field_96561_g; ++ ++ /** ++ * The maximum time the AI has to wait before peforming another ranged attack. ++ */ + private int maxRangedAttackTime; + private float field_96562_i; + private float field_82642_h; + +- public EntityAIArrowAttack(IRangedAttackMob var1, double var2, int var4, float var5) { +- this(var1, var2, var4, var4, var5); ++ public EntityAIArrowAttack(IRangedAttackMob par1IRangedAttackMob, double par2, int par4, float par5) { ++ this(par1IRangedAttackMob, par2, par4, par4, par5); + } + +- public EntityAIArrowAttack(IRangedAttackMob var1, double var2, int var4, int var5, float var6) { ++ public EntityAIArrowAttack(IRangedAttackMob par1IRangedAttackMob, double par2, int par4, int par5, float par6) { + this.rangedAttackTime = -1; +- if(!(var1 instanceof EntityLivingBase)) { ++ ++ if (!(par1IRangedAttackMob instanceof EntityLivingBase)) { + throw new IllegalArgumentException("ArrowAttackGoal requires Mob implements RangedAttackMob"); + } else { +- this.rangedAttackEntityHost = var1; +- this.entityHost = (EntityLiving)var1; +- this.entityMoveSpeed = var2; +- this.field_96561_g = var4; +- this.maxRangedAttackTime = var5; +- this.field_96562_i = var6; +- this.field_82642_h = var6 * var6; ++ this.rangedAttackEntityHost = par1IRangedAttackMob; ++ this.entityHost = (EntityLiving)par1IRangedAttackMob; ++ this.entityMoveSpeed = par2; ++ this.field_96561_g = par4; ++ this.maxRangedAttackTime = par5; ++ this.field_96562_i = par6; ++ this.field_82642_h = par6 * par6; + this.setMutexBits(3); + } + } + ++ /** ++ * Returns whether the EntityAIBase should begin execution. ++ */ + public boolean shouldExecute() { + EntityLivingBase var1 = this.entityHost.getAttackTarget(); +- if(var1 == null) { ++ ++ if (var1 == null) { + return false; + } else { + this.attackTarget = var1; +@@ -42,26 +62,36 @@ + } + } + ++ /** ++ * Returns whether an in-progress EntityAIBase should continue executing ++ */ + public boolean continueExecuting() { + return this.shouldExecute() || !this.entityHost.getNavigator().noPath(); + } + ++ /** ++ * Resets the task ++ */ + public void resetTask() { + this.attackTarget = null; + this.field_75318_f = 0; + this.rangedAttackTime = -1; + } + ++ /** ++ * Updates the task ++ */ + public void updateTask() { + double var1 = this.entityHost.getDistanceSq(this.attackTarget.posX, this.attackTarget.boundingBox.minY, this.attackTarget.posZ); + boolean var3 = this.entityHost.getEntitySenses().canSee(this.attackTarget); +- if(var3) { ++ ++ if (var3) { + ++this.field_75318_f; + } else { + this.field_75318_f = 0; + } + +- if(var1 <= (double)this.field_82642_h && this.field_75318_f >= 20) { ++ if (var1 <= (double)this.field_82642_h && this.field_75318_f >= 20) { + this.entityHost.getNavigator().clearPathEntity(); + } else { + this.entityHost.getNavigator().tryMoveToEntityLiving(this.attackTarget, this.entityMoveSpeed); +@@ -69,27 +99,28 @@ + + this.entityHost.getLookHelper().setLookPositionWithEntity(this.attackTarget, 30.0F, 30.0F); + float var4; +- if(--this.rangedAttackTime == 0) { +- if(var1 > (double)this.field_82642_h || !var3) { ++ ++ if (--this.rangedAttackTime == 0) { ++ if (var1 > (double)this.field_82642_h || !var3) { + return; + } + + var4 = MathHelper.sqrt_double(var1) / this.field_96562_i; + float var5 = var4; +- if(var4 < 0.1F) { ++ ++ if (var4 < 0.1F) { + var5 = 0.1F; + } + +- if(var5 > 1.0F) { ++ if (var5 > 1.0F) { + var5 = 1.0F; + } + + this.rangedAttackEntityHost.attackEntityWithRangedAttack(this.attackTarget, var5); + this.rangedAttackTime = MathHelper.floor_float(var4 * (float)(this.maxRangedAttackTime - this.field_96561_g) + (float)this.field_96561_g); +- } else if(this.rangedAttackTime < 0) { ++ } else if (this.rangedAttackTime < 0) { + var4 = MathHelper.sqrt_double(var1) / this.field_96562_i; + this.rangedAttackTime = MathHelper.floor_float(var4 * (float)(this.maxRangedAttackTime - this.field_96561_g) + (float)this.field_96561_g); + } +- + } + } diff --git a/patches/net/minecraft/src/EntityAIAttackOnCollide.java.patch b/patches/net/minecraft/src/EntityAIAttackOnCollide.java.patch new file mode 100644 index 0000000..e5b8a78 --- /dev/null +++ b/patches/net/minecraft/src/EntityAIAttackOnCollide.java.patch @@ -0,0 +1,121 @@ +--- net/minecraft/src/EntityAIAttackOnCollide.java ++++ net/minecraft/src/EntityAIAttackOnCollide.java +@@ -3,33 +3,47 @@ + public class EntityAIAttackOnCollide extends EntityAIBase { + World worldObj; + EntityCreature attacker; ++ ++ /** ++ * An amount of decrementing ticks that allows the entity to attack once the tick reaches 0. ++ */ + int attackTick; +- double speedTowardsTarget; ++ double field_75440_e; ++ ++ /** ++ * When true, the mob will continue chasing its target, even if it can't find a path to them right now. ++ */ + boolean longMemory; ++ ++ /** The PathEntity of our entity. */ + PathEntity entityPathEntity; +- Class g; ++ Class classTarget; + private int field_75445_i; + +- public EntityAIAttackOnCollide(EntityCreature var1, Class var2, double var3, boolean var5) { +- this(var1, var3, var5); +- this.g = var2; ++ public EntityAIAttackOnCollide(EntityCreature par1EntityCreature, Class par2Class, double par3, boolean par5) { ++ this(par1EntityCreature, par3, par5); ++ this.classTarget = par2Class; + } + +- public EntityAIAttackOnCollide(EntityCreature var1, double var2, boolean var4) { +- this.attacker = var1; +- this.worldObj = var1.worldObj; +- this.speedTowardsTarget = var2; +- this.longMemory = var4; ++ public EntityAIAttackOnCollide(EntityCreature par1EntityCreature, double par2, boolean par4) { ++ this.attacker = par1EntityCreature; ++ this.worldObj = par1EntityCreature.worldObj; ++ this.field_75440_e = par2; ++ this.longMemory = par4; + this.setMutexBits(3); + } + ++ /** ++ * Returns whether the EntityAIBase should begin execution. ++ */ + public boolean shouldExecute() { + EntityLivingBase var1 = this.attacker.getAttackTarget(); +- if(var1 == null) { +- return false; +- } else if(!var1.isEntityAlive()) { +- return false; +- } else if(this.g != null && !this.g.isAssignableFrom(var1.getClass())) { ++ ++ if (var1 == null) { ++ return false; ++ } else if (!var1.isEntityAlive()) { ++ return false; ++ } else if (this.classTarget != null && !this.classTarget.isAssignableFrom(var1.getClass())) { + return false; + } else { + this.entityPathEntity = this.attacker.getNavigator().getPathToEntityLiving(var1); +@@ -37,34 +51,49 @@ + } + } + ++ /** ++ * Returns whether an in-progress EntityAIBase should continue executing ++ */ + public boolean continueExecuting() { + EntityLivingBase var1 = this.attacker.getAttackTarget(); + return var1 == null ? false : (!var1.isEntityAlive() ? false : (!this.longMemory ? !this.attacker.getNavigator().noPath() : this.attacker.func_110176_b(MathHelper.floor_double(var1.posX), MathHelper.floor_double(var1.posY), MathHelper.floor_double(var1.posZ)))); + } + ++ /** ++ * Execute a one shot task or start executing a continuous task ++ */ + public void startExecuting() { +- this.attacker.getNavigator().setPath(this.entityPathEntity, this.speedTowardsTarget); ++ this.attacker.getNavigator().setPath(this.entityPathEntity, this.field_75440_e); + this.field_75445_i = 0; + } + ++ /** ++ * Resets the task ++ */ + public void resetTask() { + this.attacker.getNavigator().clearPathEntity(); + } + ++ /** ++ * Updates the task ++ */ + public void updateTask() { + EntityLivingBase var1 = this.attacker.getAttackTarget(); + this.attacker.getLookHelper().setLookPositionWithEntity(var1, 30.0F, 30.0F); +- if((this.longMemory || this.attacker.getEntitySenses().canSee(var1)) && --this.field_75445_i <= 0) { ++ ++ if ((this.longMemory || this.attacker.getEntitySenses().canSee(var1)) && --this.field_75445_i <= 0) { + this.field_75445_i = 4 + this.attacker.getRNG().nextInt(7); +- this.attacker.getNavigator().tryMoveToEntityLiving(var1, this.speedTowardsTarget); ++ this.attacker.getNavigator().tryMoveToEntityLiving(var1, this.field_75440_e); + } + + this.attackTick = Math.max(this.attackTick - 1, 0); + double var2 = (double)(this.attacker.width * 2.0F * this.attacker.width * 2.0F + var1.width); +- if(this.attacker.getDistanceSq(var1.posX, var1.boundingBox.minY, var1.posZ) <= var2) { +- if(this.attackTick <= 0) { ++ ++ if (this.attacker.getDistanceSq(var1.posX, var1.boundingBox.minY, var1.posZ) <= var2) { ++ if (this.attackTick <= 0) { + this.attackTick = 20; +- if(this.attacker.getHeldItem() != null) { ++ ++ if (this.attacker.getHeldItem() != null) { + this.attacker.swingItem(); + } + diff --git a/patches/net/minecraft/src/EntityAIAvoidEntity.java.patch b/patches/net/minecraft/src/EntityAIAvoidEntity.java.patch new file mode 100644 index 0000000..a160ef7 --- /dev/null +++ b/patches/net/minecraft/src/EntityAIAvoidEntity.java.patch @@ -0,0 +1,125 @@ +--- net/minecraft/src/EntityAIAvoidEntity.java ++++ net/minecraft/src/EntityAIAvoidEntity.java +@@ -4,38 +4,51 @@ + + public class EntityAIAvoidEntity extends EntityAIBase { + public final IEntitySelector field_98218_a = new EntityAIAvoidEntitySelector(this); ++ ++ /** The entity we are attached to */ + private EntityCreature theEntity; + private double farSpeed; + private double nearSpeed; + private Entity closestLivingEntity; + private float distanceFromEntity; ++ ++ /** The PathEntity of our entity */ + private PathEntity entityPathEntity; ++ ++ /** The PathNavigate of our entity */ + private PathNavigate entityPathNavigate; +- private Class i; +- +- public EntityAIAvoidEntity(EntityCreature var1, Class var2, float var3, double var4, double var6) { +- this.theEntity = var1; +- this.i = var2; +- this.distanceFromEntity = var3; +- this.farSpeed = var4; +- this.nearSpeed = var6; +- this.entityPathNavigate = var1.getNavigator(); ++ ++ /** The class of the entity we should avoid */ ++ private Class targetEntityClass; ++ ++ public EntityAIAvoidEntity(EntityCreature par1EntityCreature, Class par2Class, float par3, double par4, double par6) { ++ this.theEntity = par1EntityCreature; ++ this.targetEntityClass = par2Class; ++ this.distanceFromEntity = par3; ++ this.farSpeed = par4; ++ this.nearSpeed = par6; ++ this.entityPathNavigate = par1EntityCreature.getNavigator(); + this.setMutexBits(1); + } + ++ /** ++ * Returns whether the EntityAIBase should begin execution. ++ */ + public boolean shouldExecute() { +- if(this.i == EntityPlayer.class) { +- if(this.theEntity instanceof EntityTameable && ((EntityTameable)this.theEntity).isTamed()) { ++ if (this.targetEntityClass == EntityPlayer.class) { ++ if (this.theEntity instanceof EntityTameable && ((EntityTameable)this.theEntity).isTamed()) { + return false; + } + + this.closestLivingEntity = this.theEntity.worldObj.getClosestPlayerToEntity(this.theEntity, (double)this.distanceFromEntity); +- if(this.closestLivingEntity == null) { ++ ++ if (this.closestLivingEntity == null) { + return false; + } + } else { +- List var1 = this.theEntity.worldObj.selectEntitiesWithinAABB(this.i, this.theEntity.boundingBox.expand((double)this.distanceFromEntity, 3.0D, (double)this.distanceFromEntity), this.field_98218_a); +- if(var1.isEmpty()) { ++ List var1 = this.theEntity.worldObj.selectEntitiesWithinAABB(this.targetEntityClass, this.theEntity.boundingBox.expand((double)this.distanceFromEntity, 3.0D, (double)this.distanceFromEntity), this.field_98218_a); ++ ++ if (var1.isEmpty()) { + return false; + } + +@@ -43,9 +56,10 @@ + } + + Vec3 var2 = RandomPositionGenerator.findRandomTargetBlockAwayFrom(this.theEntity, 16, 7, this.theEntity.worldObj.getWorldVec3Pool().getVecFromPool(this.closestLivingEntity.posX, this.closestLivingEntity.posY, this.closestLivingEntity.posZ)); +- if(var2 == null) { ++ ++ if (var2 == null) { + return false; +- } else if(this.closestLivingEntity.getDistanceSq(var2.xCoord, var2.yCoord, var2.zCoord) < this.closestLivingEntity.getDistanceSqToEntity(this.theEntity)) { ++ } else if (this.closestLivingEntity.getDistanceSq(var2.xCoord, var2.yCoord, var2.zCoord) < this.closestLivingEntity.getDistanceSqToEntity(this.theEntity)) { + return false; + } else { + this.entityPathEntity = this.entityPathNavigate.getPathToXYZ(var2.xCoord, var2.yCoord, var2.zCoord); +@@ -53,28 +67,39 @@ + } + } + ++ /** ++ * Returns whether an in-progress EntityAIBase should continue executing ++ */ + public boolean continueExecuting() { + return !this.entityPathNavigate.noPath(); + } + ++ /** ++ * Execute a one shot task or start executing a continuous task ++ */ + public void startExecuting() { + this.entityPathNavigate.setPath(this.entityPathEntity, this.farSpeed); + } + ++ /** ++ * Resets the task ++ */ + public void resetTask() { + this.closestLivingEntity = null; + } + ++ /** ++ * Updates the task ++ */ + public void updateTask() { +- if(this.theEntity.getDistanceSqToEntity(this.closestLivingEntity) < 49.0D) { ++ if (this.theEntity.getDistanceSqToEntity(this.closestLivingEntity) < 49.0D) { + this.theEntity.getNavigator().setSpeed(this.nearSpeed); + } else { + this.theEntity.getNavigator().setSpeed(this.farSpeed); + } +- + } + +- static EntityCreature func_98217_a(EntityAIAvoidEntity var0) { +- return var0.theEntity; ++ static EntityCreature func_98217_a(EntityAIAvoidEntity par0EntityAIAvoidEntity) { ++ return par0EntityAIAvoidEntity.theEntity; + } + } diff --git a/patches/net/minecraft/src/EntityAIAvoidEntitySelector.java.patch b/patches/net/minecraft/src/EntityAIAvoidEntitySelector.java.patch new file mode 100644 index 0000000..51dbefd --- /dev/null +++ b/patches/net/minecraft/src/EntityAIAvoidEntitySelector.java.patch @@ -0,0 +1,21 @@ +--- net/minecraft/src/EntityAIAvoidEntitySelector.java ++++ net/minecraft/src/EntityAIAvoidEntitySelector.java +@@ -3,11 +3,14 @@ + class EntityAIAvoidEntitySelector implements IEntitySelector { + final EntityAIAvoidEntity entityAvoiderAI; + +- EntityAIAvoidEntitySelector(EntityAIAvoidEntity var1) { +- this.entityAvoiderAI = var1; ++ EntityAIAvoidEntitySelector(EntityAIAvoidEntity par1EntityAIAvoidEntity) { ++ this.entityAvoiderAI = par1EntityAIAvoidEntity; + } + +- public boolean isEntityApplicable(Entity var1) { +- return var1.isEntityAlive() && EntityAIAvoidEntity.func_98217_a(this.entityAvoiderAI).getEntitySenses().canSee(var1); ++ /** ++ * Return whether the specified entity is applicable to this filter. ++ */ ++ public boolean isEntityApplicable(Entity par1Entity) { ++ return par1Entity.isEntityAlive() && EntityAIAvoidEntity.func_98217_a(this.entityAvoiderAI).getEntitySenses().canSee(par1Entity); + } + } diff --git a/patches/net/minecraft/src/EntityAIBase.java.patch b/patches/net/minecraft/src/EntityAIBase.java.patch new file mode 100644 index 0000000..ed716ac --- /dev/null +++ b/patches/net/minecraft/src/EntityAIBase.java.patch @@ -0,0 +1,76 @@ +--- net/minecraft/src/EntityAIBase.java ++++ net/minecraft/src/EntityAIBase.java +@@ -1,31 +1,59 @@ + package net.minecraft.src; + + public abstract class EntityAIBase { ++ ++ /** ++ * A bitmask telling which other tasks may not run concurrently. The test is a simple bitwise AND - if it yields zero, ++ * the two tasks may run concurrently, if not - they must run exclusively from each other. ++ */ + private int mutexBits; + ++ /** ++ * Returns whether the EntityAIBase should begin execution. ++ */ + public abstract boolean shouldExecute(); + ++ /** ++ * Returns whether an in-progress EntityAIBase should continue executing ++ */ + public boolean continueExecuting() { + return this.shouldExecute(); + } + +- public boolean isContinuous() { ++ /** ++ * Determine if this AI Task is interruptible by a higher (= lower value) priority task. ++ */ ++ public boolean isInterruptible() { + return true; + } + +- public void startExecuting() { +- } +- +- public void resetTask() { +- } +- +- public void updateTask() { +- } +- +- public void setMutexBits(int var1) { +- this.mutexBits = var1; +- } +- ++ /** ++ * Execute a one shot task or start executing a continuous task ++ */ ++ public void startExecuting() {} ++ ++ /** ++ * Resets the task ++ */ ++ public void resetTask() {} ++ ++ /** ++ * Updates the task ++ */ ++ public void updateTask() {} ++ ++ /** ++ * Sets a bitmask telling which other tasks may not run concurrently. The test is a simple bitwise AND - if it yields ++ * zero, the two tasks may run concurrently, if not - they must run exclusively from each other. ++ */ ++ public void setMutexBits(int par1) { ++ this.mutexBits = par1; ++ } ++ ++ /** ++ * Get a bitmask telling which other tasks may not run concurrently. The test is a simple bitwise AND - if it yields ++ * zero, the two tasks may run concurrently, if not - they must run exclusively from each other. ++ */ + public int getMutexBits() { + return this.mutexBits; + } diff --git a/patches/net/minecraft/src/EntityAIBeg.java.patch b/patches/net/minecraft/src/EntityAIBeg.java.patch new file mode 100644 index 0000000..233a85e --- /dev/null +++ b/patches/net/minecraft/src/EntityAIBeg.java.patch @@ -0,0 +1,66 @@ +--- net/minecraft/src/EntityAIBeg.java ++++ net/minecraft/src/EntityAIBeg.java +@@ -7,39 +7,57 @@ + private float minPlayerDistance; + private int field_75384_e; + +- public EntityAIBeg(EntityWolf var1, float var2) { +- this.theWolf = var1; +- this.worldObject = var1.worldObj; +- this.minPlayerDistance = var2; ++ public EntityAIBeg(EntityWolf par1EntityWolf, float par2) { ++ this.theWolf = par1EntityWolf; ++ this.worldObject = par1EntityWolf.worldObj; ++ this.minPlayerDistance = par2; + this.setMutexBits(2); + } + ++ /** ++ * Returns whether the EntityAIBase should begin execution. ++ */ + public boolean shouldExecute() { + this.thePlayer = this.worldObject.getClosestPlayerToEntity(this.theWolf, (double)this.minPlayerDistance); + return this.thePlayer == null ? false : this.hasPlayerGotBoneInHand(this.thePlayer); + } + ++ /** ++ * Returns whether an in-progress EntityAIBase should continue executing ++ */ + public boolean continueExecuting() { + return !this.thePlayer.isEntityAlive() ? false : (this.theWolf.getDistanceSqToEntity(this.thePlayer) > (double)(this.minPlayerDistance * this.minPlayerDistance) ? false : this.field_75384_e > 0 && this.hasPlayerGotBoneInHand(this.thePlayer)); + } + ++ /** ++ * Execute a one shot task or start executing a continuous task ++ */ + public void startExecuting() { + this.theWolf.func_70918_i(true); + this.field_75384_e = 40 + this.theWolf.getRNG().nextInt(40); + } + ++ /** ++ * Resets the task ++ */ + public void resetTask() { + this.theWolf.func_70918_i(false); + this.thePlayer = null; + } + ++ /** ++ * Updates the task ++ */ + public void updateTask() { + this.theWolf.getLookHelper().setLookPosition(this.thePlayer.posX, this.thePlayer.posY + (double)this.thePlayer.getEyeHeight(), this.thePlayer.posZ, 10.0F, (float)this.theWolf.getVerticalFaceSpeed()); + --this.field_75384_e; + } + +- private boolean hasPlayerGotBoneInHand(EntityPlayer var1) { +- ItemStack var2 = var1.inventory.getCurrentItem(); ++ /** ++ * Gets if the Player has the Bone in the hand. ++ */ ++ private boolean hasPlayerGotBoneInHand(EntityPlayer par1EntityPlayer) { ++ ItemStack var2 = par1EntityPlayer.inventory.getCurrentItem(); + return var2 == null ? false : (!this.theWolf.isTamed() && var2.itemID == Item.bone.itemID ? true : this.theWolf.isBreedingItem(var2)); + } + } diff --git a/patches/net/minecraft/src/EntityAIBreakDoor.java.patch b/patches/net/minecraft/src/EntityAIBreakDoor.java.patch new file mode 100644 index 0000000..9715588 --- /dev/null +++ b/patches/net/minecraft/src/EntityAIBreakDoor.java.patch @@ -0,0 +1,72 @@ +--- net/minecraft/src/EntityAIBreakDoor.java ++++ net/minecraft/src/EntityAIBreakDoor.java +@@ -4,47 +4,63 @@ + private int breakingTime; + private int field_75358_j = -1; + +- public EntityAIBreakDoor(EntityLiving var1) { +- super(var1); ++ public EntityAIBreakDoor(EntityLiving par1EntityLiving) { ++ super(par1EntityLiving); + } + ++ /** ++ * Returns whether the EntityAIBase should begin execution. ++ */ + public boolean shouldExecute() { + return !super.shouldExecute() ? false : (!this.theEntity.worldObj.getGameRules().getGameRuleBooleanValue("mobGriefing") ? false : !this.targetDoor.isDoorOpen(this.theEntity.worldObj, this.entityPosX, this.entityPosY, this.entityPosZ)); + } + ++ /** ++ * Execute a one shot task or start executing a continuous task ++ */ + public void startExecuting() { + super.startExecuting(); + this.breakingTime = 0; + } + ++ /** ++ * Returns whether an in-progress EntityAIBase should continue executing ++ */ + public boolean continueExecuting() { + double var1 = this.theEntity.getDistanceSq((double)this.entityPosX, (double)this.entityPosY, (double)this.entityPosZ); + return this.breakingTime <= 240 && !this.targetDoor.isDoorOpen(this.theEntity.worldObj, this.entityPosX, this.entityPosY, this.entityPosZ) && var1 < 4.0D; + } + ++ /** ++ * Resets the task ++ */ + public void resetTask() { + super.resetTask(); + this.theEntity.worldObj.destroyBlockInWorldPartially(this.theEntity.entityId, this.entityPosX, this.entityPosY, this.entityPosZ, -1); + } + ++ /** ++ * Updates the task ++ */ + public void updateTask() { + super.updateTask(); +- if(this.theEntity.getRNG().nextInt(20) == 0) { ++ ++ if (this.theEntity.getRNG().nextInt(20) == 0) { + this.theEntity.worldObj.playAuxSFX(1010, this.entityPosX, this.entityPosY, this.entityPosZ, 0); + } + + ++this.breakingTime; + int var1 = (int)((float)this.breakingTime / 240.0F * 10.0F); +- if(var1 != this.field_75358_j) { ++ ++ if (var1 != this.field_75358_j) { + this.theEntity.worldObj.destroyBlockInWorldPartially(this.theEntity.entityId, this.entityPosX, this.entityPosY, this.entityPosZ, var1); + this.field_75358_j = var1; + } + +- if(this.breakingTime == 240 && this.theEntity.worldObj.difficultySetting == 3) { ++ if (this.breakingTime == 240 && this.theEntity.worldObj.difficultySetting == 3) { + this.theEntity.worldObj.setBlockToAir(this.entityPosX, this.entityPosY, this.entityPosZ); + this.theEntity.worldObj.playAuxSFX(1012, this.entityPosX, this.entityPosY, this.entityPosZ, 0); + this.theEntity.worldObj.playAuxSFX(2001, this.entityPosX, this.entityPosY, this.entityPosZ, this.targetDoor.blockID); + } +- + } + } diff --git a/patches/net/minecraft/src/EntityAIControlledByPlayer.java.patch b/patches/net/minecraft/src/EntityAIControlledByPlayer.java.patch new file mode 100644 index 0000000..198f1f9 --- /dev/null +++ b/patches/net/minecraft/src/EntityAIControlledByPlayer.java.patch @@ -0,0 +1,200 @@ +--- net/minecraft/src/EntityAIControlledByPlayer.java ++++ net/minecraft/src/EntityAIControlledByPlayer.java +@@ -4,47 +4,69 @@ + private final EntityLiving thisEntity; + private final float maxSpeed; + private float currentSpeed; ++ ++ /** Whether the entity's speed is boosted. */ + private boolean speedBoosted; ++ ++ /** ++ * Counter for speed boosting, upon reaching maxSpeedBoostTime the speed boost will be disabled ++ */ + private int speedBoostTime; ++ ++ /** Maximum time the entity's speed should be boosted for. */ + private int maxSpeedBoostTime; + +- public EntityAIControlledByPlayer(EntityLiving var1, float var2) { +- this.thisEntity = var1; +- this.maxSpeed = var2; ++ public EntityAIControlledByPlayer(EntityLiving par1EntityLiving, float par2) { ++ this.thisEntity = par1EntityLiving; ++ this.maxSpeed = par2; + this.setMutexBits(7); + } + ++ /** ++ * Execute a one shot task or start executing a continuous task ++ */ + public void startExecuting() { + this.currentSpeed = 0.0F; + } + ++ /** ++ * Resets the task ++ */ + public void resetTask() { + this.speedBoosted = false; + this.currentSpeed = 0.0F; + } + ++ /** ++ * Returns whether the EntityAIBase should begin execution. ++ */ + public boolean shouldExecute() { + return this.thisEntity.isEntityAlive() && this.thisEntity.riddenByEntity != null && this.thisEntity.riddenByEntity instanceof EntityPlayer && (this.speedBoosted || this.thisEntity.canBeSteered()); + } + ++ /** ++ * Updates the task ++ */ + public void updateTask() { + EntityPlayer var1 = (EntityPlayer)this.thisEntity.riddenByEntity; + EntityCreature var2 = (EntityCreature)this.thisEntity; + float var3 = MathHelper.wrapAngleTo180_float(var1.rotationYaw - this.thisEntity.rotationYaw) * 0.5F; +- if(var3 > 5.0F) { ++ ++ if (var3 > 5.0F) { + var3 = 5.0F; + } + +- if(var3 < -5.0F) { ++ if (var3 < -5.0F) { + var3 = -5.0F; + } + + this.thisEntity.rotationYaw = MathHelper.wrapAngleTo180_float(this.thisEntity.rotationYaw + var3); +- if(this.currentSpeed < this.maxSpeed) { ++ ++ if (this.currentSpeed < this.maxSpeed) { + this.currentSpeed += (this.maxSpeed - this.currentSpeed) * 0.01F; + } + +- if(this.currentSpeed > this.maxSpeed) { ++ if (this.currentSpeed > this.maxSpeed) { + this.currentSpeed = this.maxSpeed; + } + +@@ -52,8 +74,9 @@ + int var5 = MathHelper.floor_double(this.thisEntity.posY); + int var6 = MathHelper.floor_double(this.thisEntity.posZ); + float var7 = this.currentSpeed; +- if(this.speedBoosted) { +- if(this.speedBoostTime++ > this.maxSpeedBoostTime) { ++ ++ if (this.speedBoosted) { ++ if (this.speedBoostTime++ > this.maxSpeedBoostTime) { + this.speedBoosted = false; + } + +@@ -61,10 +84,12 @@ + } + + float var8 = 0.91F; +- if(this.thisEntity.onGround) { +- var8 = 546.0F * 0.1F * 0.1F * 0.1F; ++ ++ if (this.thisEntity.onGround) { ++ var8 = 0.54600006F; + int var9 = this.thisEntity.worldObj.getBlockId(MathHelper.floor_float((float)var4), MathHelper.floor_float((float)var5) - 1, MathHelper.floor_float((float)var6)); +- if(var9 > 0) { ++ ++ if (var9 > 0) { + var8 = Block.blocksList[var9].slipperiness * 0.91F; + } + } +@@ -78,23 +103,25 @@ + float var14 = var7 * var13; + float var15 = -(var14 * var10); + float var16 = var14 * var11; +- if(MathHelper.abs(var15) > MathHelper.abs(var16)) { +- if(var15 < 0.0F) { ++ ++ if (MathHelper.abs(var15) > MathHelper.abs(var16)) { ++ if (var15 < 0.0F) { + var15 -= this.thisEntity.width / 2.0F; + } + +- if(var15 > 0.0F) { ++ if (var15 > 0.0F) { + var15 += this.thisEntity.width / 2.0F; + } + + var16 = 0.0F; + } else { + var15 = 0.0F; +- if(var16 < 0.0F) { ++ ++ if (var16 < 0.0F) { + var16 -= this.thisEntity.width / 2.0F; + } + +- if(var16 > 0.0F) { ++ if (var16 > 0.0F) { + var16 += this.thisEntity.width / 2.0F; + } + } +@@ -102,20 +129,24 @@ + int var17 = MathHelper.floor_double(this.thisEntity.posX + (double)var15); + int var18 = MathHelper.floor_double(this.thisEntity.posZ + (double)var16); + PathPoint var19 = new PathPoint(MathHelper.floor_float(this.thisEntity.width + 1.0F), MathHelper.floor_float(this.thisEntity.height + var1.height + 1.0F), MathHelper.floor_float(this.thisEntity.width + 1.0F)); +- if(var4 != var17 || var6 != var18) { ++ ++ if (var4 != var17 || var6 != var18) { + int var20 = this.thisEntity.worldObj.getBlockId(var4, var5, var6); + int var21 = this.thisEntity.worldObj.getBlockId(var4, var5 - 1, var6); + boolean var22 = this.func_98216_b(var20) || Block.blocksList[var20] == null && this.func_98216_b(var21); +- if(!var22 && PathFinder.func_82565_a(this.thisEntity, var17, var5, var18, var19, false, false, true) == 0 && PathFinder.func_82565_a(this.thisEntity, var4, var5 + 1, var6, var19, false, false, true) == 1 && PathFinder.func_82565_a(this.thisEntity, var17, var5 + 1, var18, var19, false, false, true) == 1) { ++ ++ if (!var22 && PathFinder.func_82565_a(this.thisEntity, var17, var5, var18, var19, false, false, true) == 0 && PathFinder.func_82565_a(this.thisEntity, var4, var5 + 1, var6, var19, false, false, true) == 1 && PathFinder.func_82565_a(this.thisEntity, var17, var5 + 1, var18, var19, false, false, true) == 1) { + var2.getJumpHelper().setJumping(); + } + } + +- if(!var1.capabilities.isCreativeMode && this.currentSpeed >= this.maxSpeed * 0.5F && this.thisEntity.getRNG().nextFloat() < 0.006F && !this.speedBoosted) { ++ if (!var1.capabilities.isCreativeMode && this.currentSpeed >= this.maxSpeed * 0.5F && this.thisEntity.getRNG().nextFloat() < 0.006F && !this.speedBoosted) { + ItemStack var24 = var1.getHeldItem(); +- if(var24 != null && var24.itemID == Item.carrotOnAStick.itemID) { ++ ++ if (var24 != null && var24.itemID == Item.carrotOnAStick.itemID) { + var24.damageItem(1, var1); +- if(var24.stackSize == 0) { ++ ++ if (var24.stackSize == 0) { + ItemStack var25 = new ItemStack(Item.fishingRod); + var25.setTagCompound(var24.stackTagCompound); + var1.inventory.mainInventory[var1.inventory.currentItem] = var25; +@@ -126,20 +157,29 @@ + this.thisEntity.moveEntityWithHeading(0.0F, var7); + } + +- private boolean func_98216_b(int var1) { +- return Block.blocksList[var1] != null && (Block.blocksList[var1].getRenderType() == 10 || Block.blocksList[var1] instanceof BlockHalfSlab); ++ private boolean func_98216_b(int par1) { ++ return Block.blocksList[par1] != null && (Block.blocksList[par1].getRenderType() == 10 || Block.blocksList[par1] instanceof BlockHalfSlab); + } + ++ /** ++ * Return whether the entity's speed is boosted. ++ */ + public boolean isSpeedBoosted() { + return this.speedBoosted; + } + ++ /** ++ * Boost the entity's movement speed. ++ */ + public void boostSpeed() { + this.speedBoosted = true; + this.speedBoostTime = 0; + this.maxSpeedBoostTime = this.thisEntity.getRNG().nextInt(841) + 140; + } + ++ /** ++ * Return whether the entity is being controlled by a player. ++ */ + public boolean isControlledByPlayer() { + return !this.isSpeedBoosted() && this.currentSpeed > this.maxSpeed * 0.3F; + } diff --git a/patches/net/minecraft/src/EntityAICreeperSwell.java.patch b/patches/net/minecraft/src/EntityAICreeperSwell.java.patch new file mode 100644 index 0000000..31f9cd4 --- /dev/null +++ b/patches/net/minecraft/src/EntityAICreeperSwell.java.patch @@ -0,0 +1,62 @@ +--- net/minecraft/src/EntityAICreeperSwell.java ++++ net/minecraft/src/EntityAICreeperSwell.java +@@ -1,34 +1,52 @@ + package net.minecraft.src; + + public class EntityAICreeperSwell extends EntityAIBase { ++ ++ /** The creeper that is swelling. */ + EntityCreeper swellingCreeper; ++ ++ /** ++ * The creeper's attack target. This is used for the changing of the creeper's state. ++ */ + EntityLivingBase creeperAttackTarget; + +- public EntityAICreeperSwell(EntityCreeper var1) { +- this.swellingCreeper = var1; ++ public EntityAICreeperSwell(EntityCreeper par1EntityCreeper) { ++ this.swellingCreeper = par1EntityCreeper; + this.setMutexBits(1); + } + ++ /** ++ * Returns whether the EntityAIBase should begin execution. ++ */ + public boolean shouldExecute() { + EntityLivingBase var1 = this.swellingCreeper.getAttackTarget(); + return this.swellingCreeper.getCreeperState() > 0 || var1 != null && this.swellingCreeper.getDistanceSqToEntity(var1) < 9.0D; + } + ++ /** ++ * Execute a one shot task or start executing a continuous task ++ */ + public void startExecuting() { + this.swellingCreeper.getNavigator().clearPathEntity(); + this.creeperAttackTarget = this.swellingCreeper.getAttackTarget(); + } + ++ /** ++ * Resets the task ++ */ + public void resetTask() { + this.creeperAttackTarget = null; + } + ++ /** ++ * Updates the task ++ */ + public void updateTask() { +- if(this.creeperAttackTarget == null) { +- this.swellingCreeper.setCreeperState(-1); +- } else if(this.swellingCreeper.getDistanceSqToEntity(this.creeperAttackTarget) > 49.0D) { +- this.swellingCreeper.setCreeperState(-1); +- } else if(!this.swellingCreeper.getEntitySenses().canSee(this.creeperAttackTarget)) { ++ if (this.creeperAttackTarget == null) { ++ this.swellingCreeper.setCreeperState(-1); ++ } else if (this.swellingCreeper.getDistanceSqToEntity(this.creeperAttackTarget) > 49.0D) { ++ this.swellingCreeper.setCreeperState(-1); ++ } else if (!this.swellingCreeper.getEntitySenses().canSee(this.creeperAttackTarget)) { + this.swellingCreeper.setCreeperState(-1); + } else { + this.swellingCreeper.setCreeperState(1); diff --git a/patches/net/minecraft/src/EntityAIDefendVillage.java.patch b/patches/net/minecraft/src/EntityAIDefendVillage.java.patch new file mode 100644 index 0000000..d431f46 --- /dev/null +++ b/patches/net/minecraft/src/EntityAIDefendVillage.java.patch @@ -0,0 +1,50 @@ +--- net/minecraft/src/EntityAIDefendVillage.java ++++ net/minecraft/src/EntityAIDefendVillage.java +@@ -2,22 +2,31 @@ + + public class EntityAIDefendVillage extends EntityAITarget { + EntityIronGolem irongolem; ++ ++ /** ++ * The aggressor of the iron golem's village which is now the golem's attack target. ++ */ + EntityLivingBase villageAgressorTarget; + +- public EntityAIDefendVillage(EntityIronGolem var1) { +- super(var1, false, true); +- this.irongolem = var1; ++ public EntityAIDefendVillage(EntityIronGolem par1EntityIronGolem) { ++ super(par1EntityIronGolem, false, true); ++ this.irongolem = par1EntityIronGolem; + this.setMutexBits(1); + } + ++ /** ++ * Returns whether the EntityAIBase should begin execution. ++ */ + public boolean shouldExecute() { + Village var1 = this.irongolem.getVillage(); +- if(var1 == null) { ++ ++ if (var1 == null) { + return false; + } else { + this.villageAgressorTarget = var1.findNearestVillageAggressor(this.irongolem); +- if(!this.isSuitableTarget(this.villageAgressorTarget, false)) { +- if(this.taskOwner.getRNG().nextInt(20) == 0) { ++ ++ if (!this.isSuitableTarget(this.villageAgressorTarget, false)) { ++ if (this.taskOwner.getRNG().nextInt(20) == 0) { + this.villageAgressorTarget = var1.func_82685_c(this.irongolem); + return this.isSuitableTarget(this.villageAgressorTarget, false); + } else { +@@ -29,6 +38,9 @@ + } + } + ++ /** ++ * Execute a one shot task or start executing a continuous task ++ */ + public void startExecuting() { + this.irongolem.setAttackTarget(this.villageAgressorTarget); + super.startExecuting(); diff --git a/patches/net/minecraft/src/EntityAIDoorInteract.java.patch b/patches/net/minecraft/src/EntityAIDoorInteract.java.patch new file mode 100644 index 0000000..1730a50 --- /dev/null +++ b/patches/net/minecraft/src/EntityAIDoorInteract.java.patch @@ -0,0 +1,94 @@ +--- net/minecraft/src/EntityAIDoorInteract.java ++++ net/minecraft/src/EntityAIDoorInteract.java +@@ -6,29 +6,39 @@ + protected int entityPosY; + protected int entityPosZ; + protected BlockDoor targetDoor; ++ ++ /** ++ * If is true then the Entity has stopped Door Interaction and compoleted the task. ++ */ + boolean hasStoppedDoorInteraction; + float entityPositionX; + float entityPositionZ; + +- public EntityAIDoorInteract(EntityLiving var1) { +- this.theEntity = var1; ++ public EntityAIDoorInteract(EntityLiving par1EntityLiving) { ++ this.theEntity = par1EntityLiving; + } + ++ /** ++ * Returns whether the EntityAIBase should begin execution. ++ */ + public boolean shouldExecute() { +- if(!this.theEntity.isCollidedHorizontally) { ++ if (!this.theEntity.isCollidedHorizontally) { + return false; + } else { + PathNavigate var1 = this.theEntity.getNavigator(); + PathEntity var2 = var1.getPath(); +- if(var2 != null && !var2.isFinished() && var1.getCanBreakDoors()) { +- for(int var3 = 0; var3 < Math.min(var2.getCurrentPathIndex() + 2, var2.getCurrentPathLength()); ++var3) { ++ ++ if (var2 != null && !var2.isFinished() && var1.getCanBreakDoors()) { ++ for (int var3 = 0; var3 < Math.min(var2.getCurrentPathIndex() + 2, var2.getCurrentPathLength()); ++var3) { + PathPoint var4 = var2.getPathPointFromIndex(var3); + this.entityPosX = var4.xCoord; + this.entityPosY = var4.yCoord + 1; + this.entityPosZ = var4.zCoord; +- if(this.theEntity.getDistanceSq((double)this.entityPosX, this.theEntity.posY, (double)this.entityPosZ) <= 2.25D) { ++ ++ if (this.theEntity.getDistanceSq((double)this.entityPosX, this.theEntity.posY, (double)this.entityPosZ) <= 2.25D) { + this.targetDoor = this.findUsableDoor(this.entityPosX, this.entityPosY, this.entityPosZ); +- if(this.targetDoor != null) { ++ ++ if (this.targetDoor != null) { + return true; + } + } +@@ -45,28 +55,40 @@ + } + } + ++ /** ++ * Returns whether an in-progress EntityAIBase should continue executing ++ */ + public boolean continueExecuting() { + return !this.hasStoppedDoorInteraction; + } + ++ /** ++ * Execute a one shot task or start executing a continuous task ++ */ + public void startExecuting() { + this.hasStoppedDoorInteraction = false; + this.entityPositionX = (float)((double)((float)this.entityPosX + 0.5F) - this.theEntity.posX); + this.entityPositionZ = (float)((double)((float)this.entityPosZ + 0.5F) - this.theEntity.posZ); + } + ++ /** ++ * Updates the task ++ */ + public void updateTask() { + float var1 = (float)((double)((float)this.entityPosX + 0.5F) - this.theEntity.posX); + float var2 = (float)((double)((float)this.entityPosZ + 0.5F) - this.theEntity.posZ); + float var3 = this.entityPositionX * var1 + this.entityPositionZ * var2; +- if(var3 < 0.0F) { ++ ++ if (var3 < 0.0F) { + this.hasStoppedDoorInteraction = true; + } +- + } + +- private BlockDoor findUsableDoor(int var1, int var2, int var3) { +- int var4 = this.theEntity.worldObj.getBlockId(var1, var2, var3); ++ /** ++ * Determines if a door can be broken with AI. ++ */ ++ private BlockDoor findUsableDoor(int par1, int par2, int par3) { ++ int var4 = this.theEntity.worldObj.getBlockId(par1, par2, par3); + return var4 != Block.doorWood.blockID ? null : (BlockDoor)Block.blocksList[var4]; + } + } diff --git a/patches/net/minecraft/src/EntityAIEatGrass.java.patch b/patches/net/minecraft/src/EntityAIEatGrass.java.patch new file mode 100644 index 0000000..008073b --- /dev/null +++ b/patches/net/minecraft/src/EntityAIEatGrass.java.patch @@ -0,0 +1,84 @@ +--- net/minecraft/src/EntityAIEatGrass.java ++++ net/minecraft/src/EntityAIEatGrass.java +@@ -3,16 +3,21 @@ + public class EntityAIEatGrass extends EntityAIBase { + private EntityLiving theEntity; + private World theWorld; ++ ++ /** A decrementing tick used for the sheep's head offset and animation. */ + int eatGrassTick; + +- public EntityAIEatGrass(EntityLiving var1) { +- this.theEntity = var1; +- this.theWorld = var1.worldObj; ++ public EntityAIEatGrass(EntityLiving par1EntityLiving) { ++ this.theEntity = par1EntityLiving; ++ this.theWorld = par1EntityLiving.worldObj; + this.setMutexBits(7); + } + ++ /** ++ * Returns whether the EntityAIBase should begin execution. ++ */ + public boolean shouldExecute() { +- if(this.theEntity.getRNG().nextInt(this.theEntity.isChild() ? 50 : 1000) != 0) { ++ if (this.theEntity.getRNG().nextInt(this.theEntity.isChild() ? 50 : 1000) != 0) { + return false; + } else { + int var1 = MathHelper.floor_double(this.theEntity.posX); +@@ -22,16 +27,25 @@ + } + } + ++ /** ++ * Execute a one shot task or start executing a continuous task ++ */ + public void startExecuting() { + this.eatGrassTick = 40; + this.theWorld.setEntityState(this.theEntity, (byte)10); + this.theEntity.getNavigator().clearPathEntity(); + } + ++ /** ++ * Resets the task ++ */ + public void resetTask() { + this.eatGrassTick = 0; + } + ++ /** ++ * Returns whether an in-progress EntityAIBase should continue executing ++ */ + public boolean continueExecuting() { + return this.eatGrassTick > 0; + } +@@ -40,21 +54,25 @@ + return this.eatGrassTick; + } + ++ /** ++ * Updates the task ++ */ + public void updateTask() { + this.eatGrassTick = Math.max(0, this.eatGrassTick - 1); +- if(this.eatGrassTick == 4) { ++ ++ if (this.eatGrassTick == 4) { + int var1 = MathHelper.floor_double(this.theEntity.posX); + int var2 = MathHelper.floor_double(this.theEntity.posY); + int var3 = MathHelper.floor_double(this.theEntity.posZ); +- if(this.theWorld.getBlockId(var1, var2, var3) == Block.tallGrass.blockID) { ++ ++ if (this.theWorld.getBlockId(var1, var2, var3) == Block.tallGrass.blockID) { + this.theWorld.destroyBlock(var1, var2, var3, false); + this.theEntity.eatGrassBonus(); +- } else if(this.theWorld.getBlockId(var1, var2 - 1, var3) == Block.grass.blockID) { ++ } else if (this.theWorld.getBlockId(var1, var2 - 1, var3) == Block.grass.blockID) { + this.theWorld.playAuxSFX(2001, var1, var2 - 1, var3, Block.grass.blockID); + this.theWorld.setBlock(var1, var2 - 1, var3, Block.dirt.blockID, 0, 2); + this.theEntity.eatGrassBonus(); + } +- + } + } + } diff --git a/patches/net/minecraft/src/EntityAIFleeSun.java.patch b/patches/net/minecraft/src/EntityAIFleeSun.java.patch new file mode 100644 index 0000000..2bac06d --- /dev/null +++ b/patches/net/minecraft/src/EntityAIFleeSun.java.patch @@ -0,0 +1,72 @@ +--- net/minecraft/src/EntityAIFleeSun.java ++++ net/minecraft/src/EntityAIFleeSun.java +@@ -10,23 +10,27 @@ + private double movementSpeed; + private World theWorld; + +- public EntityAIFleeSun(EntityCreature var1, double var2) { +- this.theCreature = var1; +- this.movementSpeed = var2; +- this.theWorld = var1.worldObj; ++ public EntityAIFleeSun(EntityCreature par1EntityCreature, double par2) { ++ this.theCreature = par1EntityCreature; ++ this.movementSpeed = par2; ++ this.theWorld = par1EntityCreature.worldObj; + this.setMutexBits(1); + } + ++ /** ++ * Returns whether the EntityAIBase should begin execution. ++ */ + public boolean shouldExecute() { +- if(!this.theWorld.isDaytime()) { +- return false; +- } else if(!this.theCreature.isBurning()) { +- return false; +- } else if(!this.theWorld.canBlockSeeTheSky(MathHelper.floor_double(this.theCreature.posX), (int)this.theCreature.boundingBox.minY, MathHelper.floor_double(this.theCreature.posZ))) { ++ if (!this.theWorld.isDaytime()) { ++ return false; ++ } else if (!this.theCreature.isBurning()) { ++ return false; ++ } else if (!this.theWorld.canBlockSeeTheSky(MathHelper.floor_double(this.theCreature.posX), (int)this.theCreature.boundingBox.minY, MathHelper.floor_double(this.theCreature.posZ))) { + return false; + } else { + Vec3 var1 = this.findPossibleShelter(); +- if(var1 == null) { ++ ++ if (var1 == null) { + return false; + } else { + this.shelterX = var1.xCoord; +@@ -37,10 +41,16 @@ + } + } + ++ /** ++ * Returns whether an in-progress EntityAIBase should continue executing ++ */ + public boolean continueExecuting() { + return !this.theCreature.getNavigator().noPath(); + } + ++ /** ++ * Execute a one shot task or start executing a continuous task ++ */ + public void startExecuting() { + this.theCreature.getNavigator().tryMoveToXYZ(this.shelterX, this.shelterY, this.shelterZ, this.movementSpeed); + } +@@ -48,11 +58,12 @@ + private Vec3 findPossibleShelter() { + Random var1 = this.theCreature.getRNG(); + +- for(int var2 = 0; var2 < 10; ++var2) { ++ for (int var2 = 0; var2 < 10; ++var2) { + int var3 = MathHelper.floor_double(this.theCreature.posX + (double)var1.nextInt(20) - 10.0D); + int var4 = MathHelper.floor_double(this.theCreature.boundingBox.minY + (double)var1.nextInt(6) - 3.0D); + int var5 = MathHelper.floor_double(this.theCreature.posZ + (double)var1.nextInt(20) - 10.0D); +- if(!this.theWorld.canBlockSeeTheSky(var3, var4, var5) && this.theCreature.getBlockPathWeight(var3, var4, var5) < 0.0F) { ++ ++ if (!this.theWorld.canBlockSeeTheSky(var3, var4, var5) && this.theCreature.getBlockPathWeight(var3, var4, var5) < 0.0F) { + return this.theWorld.getWorldVec3Pool().getVecFromPool((double)var3, (double)var4, (double)var5); + } + } diff --git a/patches/net/minecraft/src/EntityAIFollowGolem.java.patch b/patches/net/minecraft/src/EntityAIFollowGolem.java.patch new file mode 100644 index 0000000..be40c05 --- /dev/null +++ b/patches/net/minecraft/src/EntityAIFollowGolem.java.patch @@ -0,0 +1,89 @@ +--- net/minecraft/src/EntityAIFollowGolem.java ++++ net/minecraft/src/EntityAIFollowGolem.java +@@ -9,26 +9,31 @@ + private int takeGolemRoseTick; + private boolean tookGolemRose; + +- public EntityAIFollowGolem(EntityVillager var1) { +- this.theVillager = var1; ++ public EntityAIFollowGolem(EntityVillager par1EntityVillager) { ++ this.theVillager = par1EntityVillager; + this.setMutexBits(3); + } + ++ /** ++ * Returns whether the EntityAIBase should begin execution. ++ */ + public boolean shouldExecute() { +- if(this.theVillager.getGrowingAge() >= 0) { ++ if (this.theVillager.getGrowingAge() >= 0) { + return false; +- } else if(!this.theVillager.worldObj.isDaytime()) { ++ } else if (!this.theVillager.worldObj.isDaytime()) { + return false; + } else { + List var1 = this.theVillager.worldObj.getEntitiesWithinAABB(EntityIronGolem.class, this.theVillager.boundingBox.expand(6.0D, 2.0D, 6.0D)); +- if(var1.isEmpty()) { ++ ++ if (var1.isEmpty()) { + return false; + } else { + Iterator var2 = var1.iterator(); + +- while(var2.hasNext()) { ++ while (var2.hasNext()) { + EntityIronGolem var3 = (EntityIronGolem)var2.next(); +- if(var3.getHoldRoseTick() > 0) { ++ ++ if (var3.getHoldRoseTick() > 0) { + this.theGolem = var3; + break; + } +@@ -39,32 +44,44 @@ + } + } + ++ /** ++ * Returns whether an in-progress EntityAIBase should continue executing ++ */ + public boolean continueExecuting() { + return this.theGolem.getHoldRoseTick() > 0; + } + ++ /** ++ * Execute a one shot task or start executing a continuous task ++ */ + public void startExecuting() { + this.takeGolemRoseTick = this.theVillager.getRNG().nextInt(320); + this.tookGolemRose = false; + this.theGolem.getNavigator().clearPathEntity(); + } + ++ /** ++ * Resets the task ++ */ + public void resetTask() { + this.theGolem = null; + this.theVillager.getNavigator().clearPathEntity(); + } + ++ /** ++ * Updates the task ++ */ + public void updateTask() { + this.theVillager.getLookHelper().setLookPositionWithEntity(this.theGolem, 30.0F, 30.0F); +- if(this.theGolem.getHoldRoseTick() == this.takeGolemRoseTick) { ++ ++ if (this.theGolem.getHoldRoseTick() == this.takeGolemRoseTick) { + this.theVillager.getNavigator().tryMoveToEntityLiving(this.theGolem, 0.5D); + this.tookGolemRose = true; + } + +- if(this.tookGolemRose && this.theVillager.getDistanceSqToEntity(this.theGolem) < 4.0D) { ++ if (this.tookGolemRose && this.theVillager.getDistanceSqToEntity(this.theGolem) < 4.0D) { + this.theGolem.setHoldingRose(false); + this.theVillager.getNavigator().clearPathEntity(); + } +- + } + } diff --git a/patches/net/minecraft/src/EntityAIFollowOwner.java.patch b/patches/net/minecraft/src/EntityAIFollowOwner.java.patch new file mode 100644 index 0000000..9dade8d --- /dev/null +++ b/patches/net/minecraft/src/EntityAIFollowOwner.java.patch @@ -0,0 +1,109 @@ +--- net/minecraft/src/EntityAIFollowOwner.java ++++ net/minecraft/src/EntityAIFollowOwner.java +@@ -11,23 +11,27 @@ + float minDist; + private boolean field_75344_i; + +- public EntityAIFollowOwner(EntityTameable var1, double var2, float var4, float var5) { +- this.thePet = var1; +- this.theWorld = var1.worldObj; +- this.field_75336_f = var2; +- this.petPathfinder = var1.getNavigator(); +- this.minDist = var4; +- this.maxDist = var5; ++ public EntityAIFollowOwner(EntityTameable par1EntityTameable, double par2, float par4, float par5) { ++ this.thePet = par1EntityTameable; ++ this.theWorld = par1EntityTameable.worldObj; ++ this.field_75336_f = par2; ++ this.petPathfinder = par1EntityTameable.getNavigator(); ++ this.minDist = par4; ++ this.maxDist = par5; + this.setMutexBits(3); + } + ++ /** ++ * Returns whether the EntityAIBase should begin execution. ++ */ + public boolean shouldExecute() { + EntityLivingBase var1 = this.thePet.func_130012_q(); +- if(var1 == null) { +- return false; +- } else if(this.thePet.isSitting()) { +- return false; +- } else if(this.thePet.getDistanceSqToEntity(var1) < (double)(this.minDist * this.minDist)) { ++ ++ if (var1 == null) { ++ return false; ++ } else if (this.thePet.isSitting()) { ++ return false; ++ } else if (this.thePet.getDistanceSqToEntity(var1) < (double)(this.minDist * this.minDist)) { + return false; + } else { + this.theOwner = var1; +@@ -35,44 +39,57 @@ + } + } + ++ /** ++ * Returns whether an in-progress EntityAIBase should continue executing ++ */ + public boolean continueExecuting() { + return !this.petPathfinder.noPath() && this.thePet.getDistanceSqToEntity(this.theOwner) > (double)(this.maxDist * this.maxDist) && !this.thePet.isSitting(); + } + ++ /** ++ * Execute a one shot task or start executing a continuous task ++ */ + public void startExecuting() { + this.field_75343_h = 0; + this.field_75344_i = this.thePet.getNavigator().getAvoidsWater(); + this.thePet.getNavigator().setAvoidsWater(false); + } + ++ /** ++ * Resets the task ++ */ + public void resetTask() { + this.theOwner = null; + this.petPathfinder.clearPathEntity(); + this.thePet.getNavigator().setAvoidsWater(this.field_75344_i); + } + ++ /** ++ * Updates the task ++ */ + public void updateTask() { + this.thePet.getLookHelper().setLookPositionWithEntity(this.theOwner, 10.0F, (float)this.thePet.getVerticalFaceSpeed()); +- if(!this.thePet.isSitting()) { +- if(--this.field_75343_h <= 0) { ++ ++ if (!this.thePet.isSitting()) { ++ if (--this.field_75343_h <= 0) { + this.field_75343_h = 10; +- if(!this.petPathfinder.tryMoveToEntityLiving(this.theOwner, this.field_75336_f)) { +- if(!this.thePet.getLeashed()) { +- if(this.thePet.getDistanceSqToEntity(this.theOwner) >= 144.0D) { ++ ++ if (!this.petPathfinder.tryMoveToEntityLiving(this.theOwner, this.field_75336_f)) { ++ if (!this.thePet.getLeashed()) { ++ if (this.thePet.getDistanceSqToEntity(this.theOwner) >= 144.0D) { + int var1 = MathHelper.floor_double(this.theOwner.posX) - 2; + int var2 = MathHelper.floor_double(this.theOwner.posZ) - 2; + int var3 = MathHelper.floor_double(this.theOwner.boundingBox.minY); + +- for(int var4 = 0; var4 <= 4; ++var4) { +- for(int var5 = 0; var5 <= 4; ++var5) { +- if((var4 < 1 || var5 < 1 || var4 > 3 || var5 > 3) && this.theWorld.doesBlockHaveSolidTopSurface(var1 + var4, var3 - 1, var2 + var5) && !this.theWorld.isBlockNormalCube(var1 + var4, var3, var2 + var5) && !this.theWorld.isBlockNormalCube(var1 + var4, var3 + 1, var2 + var5)) { ++ for (int var4 = 0; var4 <= 4; ++var4) { ++ for (int var5 = 0; var5 <= 4; ++var5) { ++ if ((var4 < 1 || var5 < 1 || var4 > 3 || var5 > 3) && this.theWorld.doesBlockHaveSolidTopSurface(var1 + var4, var3 - 1, var2 + var5) && !this.theWorld.isBlockNormalCube(var1 + var4, var3, var2 + var5) && !this.theWorld.isBlockNormalCube(var1 + var4, var3 + 1, var2 + var5)) { + this.thePet.setLocationAndAngles((double)((float)(var1 + var4) + 0.5F), (double)var3, (double)((float)(var2 + var5) + 0.5F), this.thePet.rotationYaw, this.thePet.rotationPitch); + this.petPathfinder.clearPathEntity(); + return; + } + } + } +- + } + } + } diff --git a/patches/net/minecraft/src/EntityAIFollowParent.java.patch b/patches/net/minecraft/src/EntityAIFollowParent.java.patch new file mode 100644 index 0000000..39d224f --- /dev/null +++ b/patches/net/minecraft/src/EntityAIFollowParent.java.patch @@ -0,0 +1,98 @@ +--- net/minecraft/src/EntityAIFollowParent.java ++++ net/minecraft/src/EntityAIFollowParent.java +@@ -4,18 +4,23 @@ + import java.util.List; + + public class EntityAIFollowParent extends EntityAIBase { ++ ++ /** The child that is following its parent. */ + EntityAnimal childAnimal; + EntityAnimal parentAnimal; + double field_75347_c; + private int field_75345_d; + +- public EntityAIFollowParent(EntityAnimal var1, double var2) { +- this.childAnimal = var1; +- this.field_75347_c = var2; ++ public EntityAIFollowParent(EntityAnimal par1EntityAnimal, double par2) { ++ this.childAnimal = par1EntityAnimal; ++ this.field_75347_c = par2; + } + ++ /** ++ * Returns whether the EntityAIBase should begin execution. ++ */ + public boolean shouldExecute() { +- if(this.childAnimal.getGrowingAge() >= 0) { ++ if (this.childAnimal.getGrowingAge() >= 0) { + return false; + } else { + List var1 = this.childAnimal.worldObj.getEntitiesWithinAABB(this.childAnimal.getClass(), this.childAnimal.boundingBox.expand(8.0D, 4.0D, 8.0D)); +@@ -23,20 +28,22 @@ + double var3 = Double.MAX_VALUE; + Iterator var5 = var1.iterator(); + +- while(var5.hasNext()) { ++ while (var5.hasNext()) { + EntityAnimal var6 = (EntityAnimal)var5.next(); +- if(var6.getGrowingAge() >= 0) { ++ ++ if (var6.getGrowingAge() >= 0) { + double var7 = this.childAnimal.getDistanceSqToEntity(var6); +- if(var7 <= var3) { ++ ++ if (var7 <= var3) { + var3 = var7; + var2 = var6; + } + } + } + +- if(var2 == null) { ++ if (var2 == null) { + return false; +- } else if(var3 < 9.0D) { ++ } else if (var3 < 9.0D) { + return false; + } else { + this.parentAnimal = var2; +@@ -45,8 +52,11 @@ + } + } + ++ /** ++ * Returns whether an in-progress EntityAIBase should continue executing ++ */ + public boolean continueExecuting() { +- if(!this.parentAnimal.isEntityAlive()) { ++ if (!this.parentAnimal.isEntityAlive()) { + return false; + } else { + double var1 = this.childAnimal.getDistanceSqToEntity(this.parentAnimal); +@@ -54,16 +64,25 @@ + } + } + ++ /** ++ * Execute a one shot task or start executing a continuous task ++ */ + public void startExecuting() { + this.field_75345_d = 0; + } + ++ /** ++ * Resets the task ++ */ + public void resetTask() { + this.parentAnimal = null; + } + ++ /** ++ * Updates the task ++ */ + public void updateTask() { +- if(--this.field_75345_d <= 0) { ++ if (--this.field_75345_d <= 0) { + this.field_75345_d = 10; + this.childAnimal.getNavigator().tryMoveToEntityLiving(this.parentAnimal, this.field_75347_c); + } diff --git a/patches/net/minecraft/src/EntityAIHurtByTarget.java.patch b/patches/net/minecraft/src/EntityAIHurtByTarget.java.patch new file mode 100644 index 0000000..cb2371d --- /dev/null +++ b/patches/net/minecraft/src/EntityAIHurtByTarget.java.patch @@ -0,0 +1,45 @@ +--- net/minecraft/src/EntityAIHurtByTarget.java ++++ net/minecraft/src/EntityAIHurtByTarget.java +@@ -7,28 +7,36 @@ + boolean entityCallsForHelp; + private int field_142052_b; + +- public EntityAIHurtByTarget(EntityCreature var1, boolean var2) { +- super(var1, false); +- this.entityCallsForHelp = var2; ++ public EntityAIHurtByTarget(EntityCreature par1EntityCreature, boolean par2) { ++ super(par1EntityCreature, false); ++ this.entityCallsForHelp = par2; + this.setMutexBits(1); + } + ++ /** ++ * Returns whether the EntityAIBase should begin execution. ++ */ + public boolean shouldExecute() { + int var1 = this.taskOwner.func_142015_aE(); + return var1 != this.field_142052_b && this.isSuitableTarget(this.taskOwner.getAITarget(), false); + } + ++ /** ++ * Execute a one shot task or start executing a continuous task ++ */ + public void startExecuting() { + this.taskOwner.setAttackTarget(this.taskOwner.getAITarget()); + this.field_142052_b = this.taskOwner.func_142015_aE(); +- if(this.entityCallsForHelp) { ++ ++ if (this.entityCallsForHelp) { + double var1 = this.getTargetDistance(); + List var3 = this.taskOwner.worldObj.getEntitiesWithinAABB(this.taskOwner.getClass(), AxisAlignedBB.getAABBPool().getAABB(this.taskOwner.posX, this.taskOwner.posY, this.taskOwner.posZ, this.taskOwner.posX + 1.0D, this.taskOwner.posY + 1.0D, this.taskOwner.posZ + 1.0D).expand(var1, 10.0D, var1)); + Iterator var4 = var3.iterator(); + +- while(var4.hasNext()) { ++ while (var4.hasNext()) { + EntityCreature var5 = (EntityCreature)var4.next(); +- if(this.taskOwner != var5 && var5.getAttackTarget() == null && !var5.isOnSameTeam(this.taskOwner.getAITarget())) { ++ ++ if (this.taskOwner != var5 && var5.getAttackTarget() == null && !var5.isOnSameTeam(this.taskOwner.getAITarget())) { + var5.setAttackTarget(this.taskOwner.getAITarget()); + } + } diff --git a/patches/net/minecraft/src/EntityAILeapAtTarget.java.patch b/patches/net/minecraft/src/EntityAILeapAtTarget.java.patch new file mode 100644 index 0000000..2efe396 --- /dev/null +++ b/patches/net/minecraft/src/EntityAILeapAtTarget.java.patch @@ -0,0 +1,61 @@ +--- net/minecraft/src/EntityAILeapAtTarget.java ++++ net/minecraft/src/EntityAILeapAtTarget.java +@@ -1,19 +1,29 @@ + package net.minecraft.src; + + public class EntityAILeapAtTarget extends EntityAIBase { ++ ++ /** The entity that is leaping. */ + EntityLiving leaper; ++ ++ /** The entity that the leaper is leaping towards. */ + EntityLivingBase leapTarget; ++ ++ /** The entity's motionY after leaping. */ + float leapMotionY; + +- public EntityAILeapAtTarget(EntityLiving var1, float var2) { +- this.leaper = var1; +- this.leapMotionY = var2; ++ public EntityAILeapAtTarget(EntityLiving par1EntityLiving, float par2) { ++ this.leaper = par1EntityLiving; ++ this.leapMotionY = par2; + this.setMutexBits(5); + } + ++ /** ++ * Returns whether the EntityAIBase should begin execution. ++ */ + public boolean shouldExecute() { + this.leapTarget = this.leaper.getAttackTarget(); +- if(this.leapTarget == null) { ++ ++ if (this.leapTarget == null) { + return false; + } else { + double var1 = this.leaper.getDistanceSqToEntity(this.leapTarget); +@@ -21,16 +31,22 @@ + } + } + ++ /** ++ * Returns whether an in-progress EntityAIBase should continue executing ++ */ + public boolean continueExecuting() { + return !this.leaper.onGround; + } + ++ /** ++ * Execute a one shot task or start executing a continuous task ++ */ + public void startExecuting() { + double var1 = this.leapTarget.posX - this.leaper.posX; + double var3 = this.leapTarget.posZ - this.leaper.posZ; + float var5 = MathHelper.sqrt_double(var1 * var1 + var3 * var3); +- this.leaper.motionX += var1 / (double)var5 * 0.5D * (double)0.8F + this.leaper.motionX * (double)0.2F; +- this.leaper.motionZ += var3 / (double)var5 * 0.5D * (double)0.8F + this.leaper.motionZ * (double)0.2F; ++ this.leaper.motionX += var1 / (double)var5 * 0.5D * 0.800000011920929D + this.leaper.motionX * 0.20000000298023224D; ++ this.leaper.motionZ += var3 / (double)var5 * 0.5D * 0.800000011920929D + this.leaper.motionZ * 0.20000000298023224D; + this.leaper.motionY = (double)this.leapMotionY; + } + } diff --git a/patches/net/minecraft/src/EntityAILookAtTradePlayer.java.patch b/patches/net/minecraft/src/EntityAILookAtTradePlayer.java.patch new file mode 100644 index 0000000..9721e17 --- /dev/null +++ b/patches/net/minecraft/src/EntityAILookAtTradePlayer.java.patch @@ -0,0 +1,23 @@ +--- net/minecraft/src/EntityAILookAtTradePlayer.java ++++ net/minecraft/src/EntityAILookAtTradePlayer.java +@@ -3,13 +3,16 @@ + public class EntityAILookAtTradePlayer extends EntityAIWatchClosest { + private final EntityVillager theMerchant; + +- public EntityAILookAtTradePlayer(EntityVillager var1) { +- super(var1, EntityPlayer.class, 8.0F); +- this.theMerchant = var1; ++ public EntityAILookAtTradePlayer(EntityVillager par1EntityVillager) { ++ super(par1EntityVillager, EntityPlayer.class, 8.0F); ++ this.theMerchant = par1EntityVillager; + } + ++ /** ++ * Returns whether the EntityAIBase should begin execution. ++ */ + public boolean shouldExecute() { +- if(this.theMerchant.isTrading()) { ++ if (this.theMerchant.isTrading()) { + this.closestEntity = this.theMerchant.getCustomer(); + return true; + } else { diff --git a/patches/net/minecraft/src/EntityAILookAtVillager.java.patch b/patches/net/minecraft/src/EntityAILookAtVillager.java.patch new file mode 100644 index 0000000..e3b947c --- /dev/null +++ b/patches/net/minecraft/src/EntityAILookAtVillager.java.patch @@ -0,0 +1,58 @@ +--- net/minecraft/src/EntityAILookAtVillager.java ++++ net/minecraft/src/EntityAILookAtVillager.java +@@ -5,15 +5,18 @@ + private EntityVillager theVillager; + private int lookTime; + +- public EntityAILookAtVillager(EntityIronGolem var1) { +- this.theGolem = var1; ++ public EntityAILookAtVillager(EntityIronGolem par1EntityIronGolem) { ++ this.theGolem = par1EntityIronGolem; + this.setMutexBits(3); + } + ++ /** ++ * Returns whether the EntityAIBase should begin execution. ++ */ + public boolean shouldExecute() { +- if(!this.theGolem.worldObj.isDaytime()) { ++ if (!this.theGolem.worldObj.isDaytime()) { + return false; +- } else if(this.theGolem.getRNG().nextInt(8000) != 0) { ++ } else if (this.theGolem.getRNG().nextInt(8000) != 0) { + return false; + } else { + this.theVillager = (EntityVillager)this.theGolem.worldObj.findNearestEntityWithinAABB(EntityVillager.class, this.theGolem.boundingBox.expand(6.0D, 2.0D, 6.0D), this.theGolem); +@@ -21,20 +24,32 @@ + } + } + ++ /** ++ * Returns whether an in-progress EntityAIBase should continue executing ++ */ + public boolean continueExecuting() { + return this.lookTime > 0; + } + ++ /** ++ * Execute a one shot task or start executing a continuous task ++ */ + public void startExecuting() { + this.lookTime = 400; + this.theGolem.setHoldingRose(true); + } + ++ /** ++ * Resets the task ++ */ + public void resetTask() { + this.theGolem.setHoldingRose(false); + this.theVillager = null; + } + ++ /** ++ * Updates the task ++ */ + public void updateTask() { + this.theGolem.getLookHelper().setLookPositionWithEntity(this.theVillager, 30.0F, 30.0F); + --this.lookTime; diff --git a/patches/net/minecraft/src/EntityAILookIdle.java.patch b/patches/net/minecraft/src/EntityAILookIdle.java.patch new file mode 100644 index 0000000..148c6f9 --- /dev/null +++ b/patches/net/minecraft/src/EntityAILookIdle.java.patch @@ -0,0 +1,59 @@ +--- net/minecraft/src/EntityAILookIdle.java ++++ net/minecraft/src/EntityAILookIdle.java +@@ -1,31 +1,53 @@ + package net.minecraft.src; + + public class EntityAILookIdle extends EntityAIBase { ++ ++ /** The entity that is looking idle. */ + private EntityLiving idleEntity; ++ ++ /** X offset to look at */ + private double lookX; ++ ++ /** Z offset to look at */ + private double lookZ; ++ ++ /** ++ * A decrementing tick that stops the entity from being idle once it reaches 0. ++ */ + private int idleTime; + +- public EntityAILookIdle(EntityLiving var1) { +- this.idleEntity = var1; ++ public EntityAILookIdle(EntityLiving par1EntityLiving) { ++ this.idleEntity = par1EntityLiving; + this.setMutexBits(3); + } + ++ /** ++ * Returns whether the EntityAIBase should begin execution. ++ */ + public boolean shouldExecute() { + return this.idleEntity.getRNG().nextFloat() < 0.02F; + } + ++ /** ++ * Returns whether an in-progress EntityAIBase should continue executing ++ */ + public boolean continueExecuting() { + return this.idleTime >= 0; + } + ++ /** ++ * Execute a one shot task or start executing a continuous task ++ */ + public void startExecuting() { +- double var1 = Math.PI * 2.0D * this.idleEntity.getRNG().nextDouble(); ++ double var1 = (Math.PI * 2D) * this.idleEntity.getRNG().nextDouble(); + this.lookX = Math.cos(var1); + this.lookZ = Math.sin(var1); + this.idleTime = 20 + this.idleEntity.getRNG().nextInt(20); + } + ++ /** ++ * Updates the task ++ */ + public void updateTask() { + --this.idleTime; + this.idleEntity.getLookHelper().setLookPosition(this.idleEntity.posX + this.lookX, this.idleEntity.posY + (double)this.idleEntity.getEyeHeight(), this.idleEntity.posZ + this.lookZ, 10.0F, (float)this.idleEntity.getVerticalFaceSpeed()); diff --git a/patches/net/minecraft/src/EntityAIMate.java.patch b/patches/net/minecraft/src/EntityAIMate.java.patch new file mode 100644 index 0000000..286770b --- /dev/null +++ b/patches/net/minecraft/src/EntityAIMate.java.patch @@ -0,0 +1,113 @@ +--- net/minecraft/src/EntityAIMate.java ++++ net/minecraft/src/EntityAIMate.java +@@ -8,18 +8,27 @@ + private EntityAnimal theAnimal; + World theWorld; + private EntityAnimal targetMate; ++ ++ /** ++ * Delay preventing a baby from spawning immediately when two mate-able animals find each other. ++ */ + int spawnBabyDelay; ++ ++ /** The speed the creature moves at during mating behavior. */ + double moveSpeed; + +- public EntityAIMate(EntityAnimal var1, double var2) { +- this.theAnimal = var1; +- this.theWorld = var1.worldObj; +- this.moveSpeed = var2; ++ public EntityAIMate(EntityAnimal par1EntityAnimal, double par2) { ++ this.theAnimal = par1EntityAnimal; ++ this.theWorld = par1EntityAnimal.worldObj; ++ this.moveSpeed = par2; + this.setMutexBits(3); + } + ++ /** ++ * Returns whether the EntityAIBase should begin execution. ++ */ + public boolean shouldExecute() { +- if(!this.theAnimal.isInLove()) { ++ if (!this.theAnimal.isInLove()) { + return false; + } else { + this.targetMate = this.getNearbyMate(); +@@ -27,25 +36,38 @@ + } + } + ++ /** ++ * Returns whether an in-progress EntityAIBase should continue executing ++ */ + public boolean continueExecuting() { + return this.targetMate.isEntityAlive() && this.targetMate.isInLove() && this.spawnBabyDelay < 60; + } + ++ /** ++ * Resets the task ++ */ + public void resetTask() { + this.targetMate = null; + this.spawnBabyDelay = 0; + } + ++ /** ++ * Updates the task ++ */ + public void updateTask() { + this.theAnimal.getLookHelper().setLookPositionWithEntity(this.targetMate, 10.0F, (float)this.theAnimal.getVerticalFaceSpeed()); + this.theAnimal.getNavigator().tryMoveToEntityLiving(this.targetMate, this.moveSpeed); + ++this.spawnBabyDelay; +- if(this.spawnBabyDelay >= 60 && this.theAnimal.getDistanceSqToEntity(this.targetMate) < 9.0D) { ++ ++ if (this.spawnBabyDelay >= 60 && this.theAnimal.getDistanceSqToEntity(this.targetMate) < 9.0D) { + this.spawnBaby(); + } +- + } + ++ /** ++ * Loops through nearby animals and finds another animal of the same type that can be mated with. Returns the first ++ * valid mate found. ++ */ + private EntityAnimal getNearbyMate() { + float var1 = 8.0F; + List var2 = this.theWorld.getEntitiesWithinAABB(this.theAnimal.getClass(), this.theAnimal.boundingBox.expand((double)var1, (double)var1, (double)var1)); +@@ -53,9 +75,10 @@ + EntityAnimal var5 = null; + Iterator var6 = var2.iterator(); + +- while(var6.hasNext()) { ++ while (var6.hasNext()) { + EntityAnimal var7 = (EntityAnimal)var6.next(); +- if(this.theAnimal.canMateWith(var7) && this.theAnimal.getDistanceSqToEntity(var7) < var3) { ++ ++ if (this.theAnimal.canMateWith(var7) && this.theAnimal.getDistanceSqToEntity(var7) < var3) { + var5 = var7; + var3 = this.theAnimal.getDistanceSqToEntity(var7); + } +@@ -64,9 +87,13 @@ + return var5; + } + ++ /** ++ * Spawns a baby animal of the same type. ++ */ + private void spawnBaby() { + EntityAgeable var1 = this.theAnimal.createChild(this.targetMate); +- if(var1 != null) { ++ ++ if (var1 != null) { + this.theAnimal.setGrowingAge(6000); + this.targetMate.setGrowingAge(6000); + this.theAnimal.resetInLove(); +@@ -76,7 +103,7 @@ + this.theWorld.spawnEntityInWorld(var1); + Random var2 = this.theAnimal.getRNG(); + +- for(int var3 = 0; var3 < 7; ++var3) { ++ for (int var3 = 0; var3 < 7; ++var3) { + double var4 = var2.nextGaussian() * 0.02D; + double var6 = var2.nextGaussian() * 0.02D; + double var8 = var2.nextGaussian() * 0.02D; diff --git a/patches/net/minecraft/src/EntityAIMoveIndoors.java.patch b/patches/net/minecraft/src/EntityAIMoveIndoors.java.patch new file mode 100644 index 0000000..42a5284 --- /dev/null +++ b/patches/net/minecraft/src/EntityAIMoveIndoors.java.patch @@ -0,0 +1,70 @@ +--- net/minecraft/src/EntityAIMoveIndoors.java ++++ net/minecraft/src/EntityAIMoveIndoors.java +@@ -6,20 +6,24 @@ + private int insidePosX = -1; + private int insidePosZ = -1; + +- public EntityAIMoveIndoors(EntityCreature var1) { +- this.entityObj = var1; ++ public EntityAIMoveIndoors(EntityCreature par1EntityCreature) { ++ this.entityObj = par1EntityCreature; + this.setMutexBits(1); + } + ++ /** ++ * Returns whether the EntityAIBase should begin execution. ++ */ + public boolean shouldExecute() { +- if((!this.entityObj.worldObj.isDaytime() || this.entityObj.worldObj.isRaining()) && !this.entityObj.worldObj.provider.hasNoSky) { +- if(this.entityObj.getRNG().nextInt(50) != 0) { ++ if ((!this.entityObj.worldObj.isDaytime() || this.entityObj.worldObj.isRaining()) && !this.entityObj.worldObj.provider.hasNoSky) { ++ if (this.entityObj.getRNG().nextInt(50) != 0) { + return false; +- } else if(this.insidePosX != -1 && this.entityObj.getDistanceSq((double)this.insidePosX, this.entityObj.posY, (double)this.insidePosZ) < 4.0D) { ++ } else if (this.insidePosX != -1 && this.entityObj.getDistanceSq((double)this.insidePosX, this.entityObj.posY, (double)this.insidePosZ) < 4.0D) { + return false; + } else { + Village var1 = this.entityObj.worldObj.villageCollectionObj.findNearestVillage(MathHelper.floor_double(this.entityObj.posX), MathHelper.floor_double(this.entityObj.posY), MathHelper.floor_double(this.entityObj.posZ), 14); +- if(var1 == null) { ++ ++ if (var1 == null) { + return false; + } else { + this.doorInfo = var1.findNearestDoorUnrestricted(MathHelper.floor_double(this.entityObj.posX), MathHelper.floor_double(this.entityObj.posY), MathHelper.floor_double(this.entityObj.posZ)); +@@ -31,23 +35,33 @@ + } + } + ++ /** ++ * Returns whether an in-progress EntityAIBase should continue executing ++ */ + public boolean continueExecuting() { + return !this.entityObj.getNavigator().noPath(); + } + ++ /** ++ * Execute a one shot task or start executing a continuous task ++ */ + public void startExecuting() { + this.insidePosX = -1; +- if(this.entityObj.getDistanceSq((double)this.doorInfo.getInsidePosX(), (double)this.doorInfo.posY, (double)this.doorInfo.getInsidePosZ()) > 256.0D) { ++ ++ if (this.entityObj.getDistanceSq((double)this.doorInfo.getInsidePosX(), (double)this.doorInfo.posY, (double)this.doorInfo.getInsidePosZ()) > 256.0D) { + Vec3 var1 = RandomPositionGenerator.findRandomTargetBlockTowards(this.entityObj, 14, 3, this.entityObj.worldObj.getWorldVec3Pool().getVecFromPool((double)this.doorInfo.getInsidePosX() + 0.5D, (double)this.doorInfo.getInsidePosY(), (double)this.doorInfo.getInsidePosZ() + 0.5D)); +- if(var1 != null) { ++ ++ if (var1 != null) { + this.entityObj.getNavigator().tryMoveToXYZ(var1.xCoord, var1.yCoord, var1.zCoord, 1.0D); + } + } else { + this.entityObj.getNavigator().tryMoveToXYZ((double)this.doorInfo.getInsidePosX() + 0.5D, (double)this.doorInfo.getInsidePosY(), (double)this.doorInfo.getInsidePosZ() + 0.5D, 1.0D); + } +- + } + ++ /** ++ * Resets the task ++ */ + public void resetTask() { + this.insidePosX = this.doorInfo.getInsidePosX(); + this.insidePosZ = this.doorInfo.getInsidePosZ(); diff --git a/patches/net/minecraft/src/EntityAIMoveThroughVillage.java.patch b/patches/net/minecraft/src/EntityAIMoveThroughVillage.java.patch new file mode 100644 index 0000000..700d341 --- /dev/null +++ b/patches/net/minecraft/src/EntityAIMoveThroughVillage.java.patch @@ -0,0 +1,150 @@ +--- net/minecraft/src/EntityAIMoveThroughVillage.java ++++ net/minecraft/src/EntityAIMoveThroughVillage.java +@@ -7,40 +7,50 @@ + public class EntityAIMoveThroughVillage extends EntityAIBase { + private EntityCreature theEntity; + private double movementSpeed; ++ ++ /** The PathNavigate of our entity. */ + private PathEntity entityPathNavigate; + private VillageDoorInfo doorInfo; + private boolean isNocturnal; +- private List f = new ArrayList(); ++ private List doorList = new ArrayList(); + +- public EntityAIMoveThroughVillage(EntityCreature var1, double var2, boolean var4) { +- this.theEntity = var1; +- this.movementSpeed = var2; +- this.isNocturnal = var4; ++ public EntityAIMoveThroughVillage(EntityCreature par1EntityCreature, double par2, boolean par4) { ++ this.theEntity = par1EntityCreature; ++ this.movementSpeed = par2; ++ this.isNocturnal = par4; + this.setMutexBits(1); + } + ++ /** ++ * Returns whether the EntityAIBase should begin execution. ++ */ + public boolean shouldExecute() { + this.func_75414_f(); +- if(this.isNocturnal && this.theEntity.worldObj.isDaytime()) { ++ ++ if (this.isNocturnal && this.theEntity.worldObj.isDaytime()) { + return false; + } else { + Village var1 = this.theEntity.worldObj.villageCollectionObj.findNearestVillage(MathHelper.floor_double(this.theEntity.posX), MathHelper.floor_double(this.theEntity.posY), MathHelper.floor_double(this.theEntity.posZ), 0); +- if(var1 == null) { ++ ++ if (var1 == null) { + return false; + } else { + this.doorInfo = this.func_75412_a(var1); +- if(this.doorInfo == null) { ++ ++ if (this.doorInfo == null) { + return false; + } else { + boolean var2 = this.theEntity.getNavigator().getCanBreakDoors(); + this.theEntity.getNavigator().setBreakDoors(false); + this.entityPathNavigate = this.theEntity.getNavigator().getPathToXYZ((double)this.doorInfo.posX, (double)this.doorInfo.posY, (double)this.doorInfo.posZ); + this.theEntity.getNavigator().setBreakDoors(var2); +- if(this.entityPathNavigate != null) { ++ ++ if (this.entityPathNavigate != null) { + return true; + } else { + Vec3 var3 = RandomPositionGenerator.findRandomTargetBlockTowards(this.theEntity, 10, 7, this.theEntity.worldObj.getWorldVec3Pool().getVecFromPool((double)this.doorInfo.posX, (double)this.doorInfo.posY, (double)this.doorInfo.posZ)); +- if(var3 == null) { ++ ++ if (var3 == null) { + return false; + } else { + this.theEntity.getNavigator().setBreakDoors(false); +@@ -54,8 +64,11 @@ + } + } + ++ /** ++ * Returns whether an in-progress EntityAIBase should continue executing ++ */ + public boolean continueExecuting() { +- if(this.theEntity.getNavigator().noPath()) { ++ if (this.theEntity.getNavigator().noPath()) { + return false; + } else { + float var1 = this.theEntity.width + 4.0F; +@@ -63,27 +76,33 @@ + } + } + ++ /** ++ * Execute a one shot task or start executing a continuous task ++ */ + public void startExecuting() { + this.theEntity.getNavigator().setPath(this.entityPathNavigate, this.movementSpeed); + } + ++ /** ++ * Resets the task ++ */ + public void resetTask() { +- if(this.theEntity.getNavigator().noPath() || this.theEntity.getDistanceSq((double)this.doorInfo.posX, (double)this.doorInfo.posY, (double)this.doorInfo.posZ) < 16.0D) { +- this.f.add(this.doorInfo); ++ if (this.theEntity.getNavigator().noPath() || this.theEntity.getDistanceSq((double)this.doorInfo.posX, (double)this.doorInfo.posY, (double)this.doorInfo.posZ) < 16.0D) { ++ this.doorList.add(this.doorInfo); + } +- + } + +- private VillageDoorInfo func_75412_a(Village var1) { ++ private VillageDoorInfo func_75412_a(Village par1Village) { + VillageDoorInfo var2 = null; + int var3 = Integer.MAX_VALUE; +- List var4 = var1.getVillageDoorInfoList(); ++ List var4 = par1Village.getVillageDoorInfoList(); + Iterator var5 = var4.iterator(); + +- while(var5.hasNext()) { ++ while (var5.hasNext()) { + VillageDoorInfo var6 = (VillageDoorInfo)var5.next(); + int var7 = var6.getDistanceSquared(MathHelper.floor_double(this.theEntity.posX), MathHelper.floor_double(this.theEntity.posY), MathHelper.floor_double(this.theEntity.posZ)); +- if(var7 < var3 && !this.func_75413_a(var6)) { ++ ++ if (var7 < var3 && !this.func_75413_a(var6)) { + var2 = var6; + var3 = var7; + } +@@ -92,25 +111,24 @@ + return var2; + } + +- private boolean func_75413_a(VillageDoorInfo var1) { +- Iterator var2 = this.f.iterator(); +- ++ private boolean func_75413_a(VillageDoorInfo par1VillageDoorInfo) { ++ Iterator var2 = this.doorList.iterator(); + VillageDoorInfo var3; ++ + do { +- if(!var2.hasNext()) { ++ if (!var2.hasNext()) { + return false; + } + + var3 = (VillageDoorInfo)var2.next(); +- } while(var1.posX != var3.posX || var1.posY != var3.posY || var1.posZ != var3.posZ); ++ } while (par1VillageDoorInfo.posX != var3.posX || par1VillageDoorInfo.posY != var3.posY || par1VillageDoorInfo.posZ != var3.posZ); + + return true; + } + + private void func_75414_f() { +- if(this.f.size() > 15) { +- this.f.remove(0); ++ if (this.doorList.size() > 15) { ++ this.doorList.remove(0); + } +- + } + } diff --git a/patches/net/minecraft/src/EntityAIMoveTowardsRestriction.java.patch b/patches/net/minecraft/src/EntityAIMoveTowardsRestriction.java.patch new file mode 100644 index 0000000..13e5787 --- /dev/null +++ b/patches/net/minecraft/src/EntityAIMoveTowardsRestriction.java.patch @@ -0,0 +1,48 @@ +--- net/minecraft/src/EntityAIMoveTowardsRestriction.java ++++ net/minecraft/src/EntityAIMoveTowardsRestriction.java +@@ -7,19 +7,23 @@ + private double movePosZ; + private double movementSpeed; + +- public EntityAIMoveTowardsRestriction(EntityCreature var1, double var2) { +- this.theEntity = var1; +- this.movementSpeed = var2; ++ public EntityAIMoveTowardsRestriction(EntityCreature par1EntityCreature, double par2) { ++ this.theEntity = par1EntityCreature; ++ this.movementSpeed = par2; + this.setMutexBits(1); + } + ++ /** ++ * Returns whether the EntityAIBase should begin execution. ++ */ + public boolean shouldExecute() { +- if(this.theEntity.func_110173_bK()) { ++ if (this.theEntity.func_110173_bK()) { + return false; + } else { + ChunkCoordinates var1 = this.theEntity.getHomePosition(); + Vec3 var2 = RandomPositionGenerator.findRandomTargetBlockTowards(this.theEntity, 16, 7, this.theEntity.worldObj.getWorldVec3Pool().getVecFromPool((double)var1.posX, (double)var1.posY, (double)var1.posZ)); +- if(var2 == null) { ++ ++ if (var2 == null) { + return false; + } else { + this.movePosX = var2.xCoord; +@@ -30,10 +34,16 @@ + } + } + ++ /** ++ * Returns whether an in-progress EntityAIBase should continue executing ++ */ + public boolean continueExecuting() { + return !this.theEntity.getNavigator().noPath(); + } + ++ /** ++ * Execute a one shot task or start executing a continuous task ++ */ + public void startExecuting() { + this.theEntity.getNavigator().tryMoveToXYZ(this.movePosX, this.movePosY, this.movePosZ, this.movementSpeed); + } diff --git a/patches/net/minecraft/src/EntityAIMoveTowardsTarget.java.patch b/patches/net/minecraft/src/EntityAIMoveTowardsTarget.java.patch new file mode 100644 index 0000000..9bde700 --- /dev/null +++ b/patches/net/minecraft/src/EntityAIMoveTowardsTarget.java.patch @@ -0,0 +1,67 @@ +--- net/minecraft/src/EntityAIMoveTowardsTarget.java ++++ net/minecraft/src/EntityAIMoveTowardsTarget.java +@@ -7,24 +7,33 @@ + private double movePosY; + private double movePosZ; + private double speed; ++ ++ /** ++ * If the distance to the target entity is further than this, this AI task will not run. ++ */ + private float maxTargetDistance; + +- public EntityAIMoveTowardsTarget(EntityCreature var1, double var2, float var4) { +- this.theEntity = var1; +- this.speed = var2; +- this.maxTargetDistance = var4; ++ public EntityAIMoveTowardsTarget(EntityCreature par1EntityCreature, double par2, float par4) { ++ this.theEntity = par1EntityCreature; ++ this.speed = par2; ++ this.maxTargetDistance = par4; + this.setMutexBits(1); + } + ++ /** ++ * Returns whether the EntityAIBase should begin execution. ++ */ + public boolean shouldExecute() { + this.targetEntity = this.theEntity.getAttackTarget(); +- if(this.targetEntity == null) { ++ ++ if (this.targetEntity == null) { + return false; +- } else if(this.targetEntity.getDistanceSqToEntity(this.theEntity) > (double)(this.maxTargetDistance * this.maxTargetDistance)) { ++ } else if (this.targetEntity.getDistanceSqToEntity(this.theEntity) > (double)(this.maxTargetDistance * this.maxTargetDistance)) { + return false; + } else { + Vec3 var1 = RandomPositionGenerator.findRandomTargetBlockTowards(this.theEntity, 16, 7, this.theEntity.worldObj.getWorldVec3Pool().getVecFromPool(this.targetEntity.posX, this.targetEntity.posY, this.targetEntity.posZ)); +- if(var1 == null) { ++ ++ if (var1 == null) { + return false; + } else { + this.movePosX = var1.xCoord; +@@ -35,14 +44,23 @@ + } + } + ++ /** ++ * Returns whether an in-progress EntityAIBase should continue executing ++ */ + public boolean continueExecuting() { + return !this.theEntity.getNavigator().noPath() && this.targetEntity.isEntityAlive() && this.targetEntity.getDistanceSqToEntity(this.theEntity) < (double)(this.maxTargetDistance * this.maxTargetDistance); + } + ++ /** ++ * Resets the task ++ */ + public void resetTask() { + this.targetEntity = null; + } + ++ /** ++ * Execute a one shot task or start executing a continuous task ++ */ + public void startExecuting() { + this.theEntity.getNavigator().tryMoveToXYZ(this.movePosX, this.movePosY, this.movePosZ, this.speed); + } diff --git a/patches/net/minecraft/src/EntityAINearestAttackableTarget.java.patch b/patches/net/minecraft/src/EntityAINearestAttackableTarget.java.patch new file mode 100644 index 0000000..a1f4188 --- /dev/null +++ b/patches/net/minecraft/src/EntityAINearestAttackableTarget.java.patch @@ -0,0 +1,78 @@ +--- net/minecraft/src/EntityAINearestAttackableTarget.java ++++ net/minecraft/src/EntityAINearestAttackableTarget.java +@@ -4,37 +4,47 @@ + import java.util.List; + + public class EntityAINearestAttackableTarget extends EntityAITarget { +- private final Class a; ++ private final Class targetClass; + private final int targetChance; ++ ++ /** Instance of EntityAINearestAttackableTargetSorter. */ + private final EntityAINearestAttackableTargetSorter theNearestAttackableTargetSorter; ++ ++ /** ++ * This filter is applied to the Entity search. Only matching entities will be targetted. (null -> no restrictions) ++ */ + private final IEntitySelector targetEntitySelector; + private EntityLivingBase targetEntity; + +- public EntityAINearestAttackableTarget(EntityCreature var1, Class var2, int var3, boolean var4) { +- this(var1, var2, var3, var4, false); +- } +- +- public EntityAINearestAttackableTarget(EntityCreature var1, Class var2, int var3, boolean var4, boolean var5) { +- this(var1, var2, var3, var4, var5, (IEntitySelector)null); +- } +- +- public EntityAINearestAttackableTarget(EntityCreature var1, Class var2, int var3, boolean var4, boolean var5, IEntitySelector var6) { +- super(var1, var4, var5); +- this.a = var2; +- this.targetChance = var3; +- this.theNearestAttackableTargetSorter = new EntityAINearestAttackableTargetSorter(var1); ++ public EntityAINearestAttackableTarget(EntityCreature par1EntityCreature, Class par2Class, int par3, boolean par4) { ++ this(par1EntityCreature, par2Class, par3, par4, false); ++ } ++ ++ public EntityAINearestAttackableTarget(EntityCreature par1EntityCreature, Class par2Class, int par3, boolean par4, boolean par5) { ++ this(par1EntityCreature, par2Class, par3, par4, par5, (IEntitySelector)null); ++ } ++ ++ public EntityAINearestAttackableTarget(EntityCreature par1EntityCreature, Class par2Class, int par3, boolean par4, boolean par5, IEntitySelector par6IEntitySelector) { ++ super(par1EntityCreature, par4, par5); ++ this.targetClass = par2Class; ++ this.targetChance = par3; ++ this.theNearestAttackableTargetSorter = new EntityAINearestAttackableTargetSorter(par1EntityCreature); + this.setMutexBits(1); +- this.targetEntitySelector = new EntityAINearestAttackableTargetSelector(this, var6); ++ this.targetEntitySelector = new EntityAINearestAttackableTargetSelector(this, par6IEntitySelector); + } + ++ /** ++ * Returns whether the EntityAIBase should begin execution. ++ */ + public boolean shouldExecute() { +- if(this.targetChance > 0 && this.taskOwner.getRNG().nextInt(this.targetChance) != 0) { ++ if (this.targetChance > 0 && this.taskOwner.getRNG().nextInt(this.targetChance) != 0) { + return false; + } else { + double var1 = this.getTargetDistance(); +- List var3 = this.taskOwner.worldObj.selectEntitiesWithinAABB(this.a, this.taskOwner.boundingBox.expand(var1, 4.0D, var1), this.targetEntitySelector); ++ List var3 = this.taskOwner.worldObj.selectEntitiesWithinAABB(this.targetClass, this.taskOwner.boundingBox.expand(var1, 4.0D, var1), this.targetEntitySelector); + Collections.sort(var3, this.theNearestAttackableTargetSorter); +- if(var3.isEmpty()) { ++ ++ if (var3.isEmpty()) { + return false; + } else { + this.targetEntity = (EntityLivingBase)var3.get(0); +@@ -43,6 +53,9 @@ + } + } + ++ /** ++ * Execute a one shot task or start executing a continuous task ++ */ + public void startExecuting() { + this.taskOwner.setAttackTarget(this.targetEntity); + super.startExecuting(); diff --git a/patches/net/minecraft/src/EntityAINearestAttackableTargetSelector.java.patch b/patches/net/minecraft/src/EntityAINearestAttackableTargetSelector.java.patch new file mode 100644 index 0000000..87bd0aa --- /dev/null +++ b/patches/net/minecraft/src/EntityAINearestAttackableTargetSelector.java.patch @@ -0,0 +1,26 @@ +--- net/minecraft/src/EntityAINearestAttackableTargetSelector.java ++++ net/minecraft/src/EntityAINearestAttackableTargetSelector.java +@@ -2,14 +2,18 @@ + + class EntityAINearestAttackableTargetSelector implements IEntitySelector { + final IEntitySelector field_111103_c; ++ + final EntityAINearestAttackableTarget field_111102_d; + +- EntityAINearestAttackableTargetSelector(EntityAINearestAttackableTarget var1, IEntitySelector var2) { +- this.field_111102_d = var1; +- this.field_111103_c = var2; ++ EntityAINearestAttackableTargetSelector(EntityAINearestAttackableTarget par1EntityAINearestAttackableTarget, IEntitySelector par2IEntitySelector) { ++ this.field_111102_d = par1EntityAINearestAttackableTarget; ++ this.field_111103_c = par2IEntitySelector; + } + +- public boolean isEntityApplicable(Entity var1) { +- return !(var1 instanceof EntityLivingBase) ? false : (this.field_111103_c != null && !this.field_111103_c.isEntityApplicable(var1) ? false : this.field_111102_d.isSuitableTarget((EntityLivingBase)var1, false)); ++ /** ++ * Return whether the specified entity is applicable to this filter. ++ */ ++ public boolean isEntityApplicable(Entity par1Entity) { ++ return !(par1Entity instanceof EntityLivingBase) ? false : (this.field_111103_c != null && !this.field_111103_c.isEntityApplicable(par1Entity) ? false : this.field_111102_d.isSuitableTarget((EntityLivingBase)par1Entity, false)); + } + } diff --git a/patches/net/minecraft/src/EntityAINearestAttackableTargetSorter.java.patch b/patches/net/minecraft/src/EntityAINearestAttackableTargetSorter.java.patch new file mode 100644 index 0000000..88aeede --- /dev/null +++ b/patches/net/minecraft/src/EntityAINearestAttackableTargetSorter.java.patch @@ -0,0 +1,27 @@ +--- net/minecraft/src/EntityAINearestAttackableTargetSorter.java ++++ net/minecraft/src/EntityAINearestAttackableTargetSorter.java +@@ -5,17 +5,17 @@ + public class EntityAINearestAttackableTargetSorter implements Comparator { + private final Entity theEntity; + +- public EntityAINearestAttackableTargetSorter(Entity var1) { +- this.theEntity = var1; ++ public EntityAINearestAttackableTargetSorter(Entity par1Entity) { ++ this.theEntity = par1Entity; + } + +- public int compareDistanceSq(Entity var1, Entity var2) { +- double var3 = this.theEntity.getDistanceSqToEntity(var1); +- double var5 = this.theEntity.getDistanceSqToEntity(var2); ++ public int compareDistanceSq(Entity par1Entity, Entity par2Entity) { ++ double var3 = this.theEntity.getDistanceSqToEntity(par1Entity); ++ double var5 = this.theEntity.getDistanceSqToEntity(par2Entity); + return var3 < var5 ? -1 : (var3 > var5 ? 1 : 0); + } + +- public int compare(Object var1, Object var2) { +- return this.compareDistanceSq((Entity)var1, (Entity)var2); ++ public int compare(Object par1Obj, Object par2Obj) { ++ return this.compareDistanceSq((Entity)par1Obj, (Entity)par2Obj); + } + } diff --git a/patches/net/minecraft/src/EntityAIOcelotAttack.java.patch b/patches/net/minecraft/src/EntityAIOcelotAttack.java.patch new file mode 100644 index 0000000..7cfd243 --- /dev/null +++ b/patches/net/minecraft/src/EntityAIOcelotAttack.java.patch @@ -0,0 +1,72 @@ +--- net/minecraft/src/EntityAIOcelotAttack.java ++++ net/minecraft/src/EntityAIOcelotAttack.java +@@ -6,15 +6,19 @@ + EntityLivingBase theVictim; + int attackCountdown; + +- public EntityAIOcelotAttack(EntityLiving var1) { +- this.theEntity = var1; +- this.theWorld = var1.worldObj; ++ public EntityAIOcelotAttack(EntityLiving par1EntityLiving) { ++ this.theEntity = par1EntityLiving; ++ this.theWorld = par1EntityLiving.worldObj; + this.setMutexBits(3); + } + ++ /** ++ * Returns whether the EntityAIBase should begin execution. ++ */ + public boolean shouldExecute() { + EntityLivingBase var1 = this.theEntity.getAttackTarget(); +- if(var1 == null) { ++ ++ if (var1 == null) { + return false; + } else { + this.theVictim = var1; +@@ -22,30 +26,41 @@ + } + } + ++ /** ++ * Returns whether an in-progress EntityAIBase should continue executing ++ */ + public boolean continueExecuting() { + return !this.theVictim.isEntityAlive() ? false : (this.theEntity.getDistanceSqToEntity(this.theVictim) > 225.0D ? false : !this.theEntity.getNavigator().noPath() || this.shouldExecute()); + } + ++ /** ++ * Resets the task ++ */ + public void resetTask() { + this.theVictim = null; + this.theEntity.getNavigator().clearPathEntity(); + } + ++ /** ++ * Updates the task ++ */ + public void updateTask() { + this.theEntity.getLookHelper().setLookPositionWithEntity(this.theVictim, 30.0F, 30.0F); + double var1 = (double)(this.theEntity.width * 2.0F * this.theEntity.width * 2.0F); + double var3 = this.theEntity.getDistanceSq(this.theVictim.posX, this.theVictim.boundingBox.minY, this.theVictim.posZ); + double var5 = 0.8D; +- if(var3 > var1 && var3 < 16.0D) { ++ ++ if (var3 > var1 && var3 < 16.0D) { + var5 = 1.33D; +- } else if(var3 < 225.0D) { ++ } else if (var3 < 225.0D) { + var5 = 0.6D; + } + + this.theEntity.getNavigator().tryMoveToEntityLiving(this.theVictim, var5); + this.attackCountdown = Math.max(this.attackCountdown - 1, 0); +- if(var3 <= var1) { +- if(this.attackCountdown <= 0) { ++ ++ if (var3 <= var1) { ++ if (this.attackCountdown <= 0) { + this.attackCountdown = 20; + this.theEntity.attackEntityAsMob(this.theVictim); + } diff --git a/patches/net/minecraft/src/EntityAIOcelotSit.java.patch b/patches/net/minecraft/src/EntityAIOcelotSit.java.patch new file mode 100644 index 0000000..3414e99 --- /dev/null +++ b/patches/net/minecraft/src/EntityAIOcelotSit.java.patch @@ -0,0 +1,144 @@ +--- net/minecraft/src/EntityAIOcelotSit.java ++++ net/minecraft/src/EntityAIOcelotSit.java +@@ -3,27 +3,46 @@ + public class EntityAIOcelotSit extends EntityAIBase { + private final EntityOcelot theOcelot; + private final double field_75404_b; ++ ++ /** Tracks for how long the task has been executing */ + private int currentTick; + private int field_75402_d; ++ ++ /** For how long the Ocelot should be sitting */ + private int maxSittingTicks; ++ ++ /** X Coordinate of a nearby sitable block */ + private int sitableBlockX; ++ ++ /** Y Coordinate of a nearby sitable block */ + private int sitableBlockY; ++ ++ /** Z Coordinate of a nearby sitable block */ + private int sitableBlockZ; + +- public EntityAIOcelotSit(EntityOcelot var1, double var2) { +- this.theOcelot = var1; +- this.field_75404_b = var2; ++ public EntityAIOcelotSit(EntityOcelot par1EntityOcelot, double par2) { ++ this.theOcelot = par1EntityOcelot; ++ this.field_75404_b = par2; + this.setMutexBits(5); + } + ++ /** ++ * Returns whether the EntityAIBase should begin execution. ++ */ + public boolean shouldExecute() { +- return this.theOcelot.isTamed() && !this.theOcelot.isSitting() && this.theOcelot.getRNG().nextDouble() <= (double)0.0065F && this.getNearbySitableBlockDistance(); ++ return this.theOcelot.isTamed() && !this.theOcelot.isSitting() && this.theOcelot.getRNG().nextDouble() <= 0.006500000134110451D && this.getNearbySitableBlockDistance(); + } + ++ /** ++ * Returns whether an in-progress EntityAIBase should continue executing ++ */ + public boolean continueExecuting() { + return this.currentTick <= this.maxSittingTicks && this.field_75402_d <= 60 && this.isSittableBlock(this.theOcelot.worldObj, this.sitableBlockX, this.sitableBlockY, this.sitableBlockZ); + } + ++ /** ++ * Execute a one shot task or start executing a continuous task ++ */ + public void startExecuting() { + this.theOcelot.getNavigator().tryMoveToXYZ((double)((float)this.sitableBlockX) + 0.5D, (double)(this.sitableBlockY + 1), (double)((float)this.sitableBlockZ) + 0.5D, this.field_75404_b); + this.currentTick = 0; +@@ -32,34 +51,44 @@ + this.theOcelot.func_70907_r().setSitting(false); + } + ++ /** ++ * Resets the task ++ */ + public void resetTask() { + this.theOcelot.setSitting(false); + } + ++ /** ++ * Updates the task ++ */ + public void updateTask() { + ++this.currentTick; + this.theOcelot.func_70907_r().setSitting(false); +- if(this.theOcelot.getDistanceSq((double)this.sitableBlockX, (double)(this.sitableBlockY + 1), (double)this.sitableBlockZ) > 1.0D) { ++ ++ if (this.theOcelot.getDistanceSq((double)this.sitableBlockX, (double)(this.sitableBlockY + 1), (double)this.sitableBlockZ) > 1.0D) { + this.theOcelot.setSitting(false); + this.theOcelot.getNavigator().tryMoveToXYZ((double)((float)this.sitableBlockX) + 0.5D, (double)(this.sitableBlockY + 1), (double)((float)this.sitableBlockZ) + 0.5D, this.field_75404_b); + ++this.field_75402_d; +- } else if(!this.theOcelot.isSitting()) { ++ } else if (!this.theOcelot.isSitting()) { + this.theOcelot.setSitting(true); + } else { + --this.field_75402_d; + } +- + } + ++ /** ++ * Searches for a block to sit on within a 8 block range, returns 0 if none found ++ */ + private boolean getNearbySitableBlockDistance() { + int var1 = (int)this.theOcelot.posY; +- double var2 = (double)Integer.MAX_VALUE; ++ double var2 = 2.147483647E9D; + +- for(int var4 = (int)this.theOcelot.posX - 8; (double)var4 < this.theOcelot.posX + 8.0D; ++var4) { +- for(int var5 = (int)this.theOcelot.posZ - 8; (double)var5 < this.theOcelot.posZ + 8.0D; ++var5) { +- if(this.isSittableBlock(this.theOcelot.worldObj, var4, var1, var5) && this.theOcelot.worldObj.isAirBlock(var4, var1 + 1, var5)) { ++ for (int var4 = (int)this.theOcelot.posX - 8; (double)var4 < this.theOcelot.posX + 8.0D; ++var4) { ++ for (int var5 = (int)this.theOcelot.posZ - 8; (double)var5 < this.theOcelot.posZ + 8.0D; ++var5) { ++ if (this.isSittableBlock(this.theOcelot.worldObj, var4, var1, var5) && this.theOcelot.worldObj.isAirBlock(var4, var1 + 1, var5)) { + double var6 = this.theOcelot.getDistanceSq((double)var4, (double)var1, (double)var5); +- if(var6 < var2) { ++ ++ if (var6 < var2) { + this.sitableBlockX = var4; + this.sitableBlockY = var1; + this.sitableBlockZ = var5; +@@ -69,23 +98,28 @@ + } + } + +- return var2 < (double)Integer.MAX_VALUE; ++ return var2 < 2.147483647E9D; + } + +- private boolean isSittableBlock(World var1, int var2, int var3, int var4) { +- int var5 = var1.getBlockId(var2, var3, var4); +- int var6 = var1.getBlockMetadata(var2, var3, var4); +- if(var5 == Block.chest.blockID) { +- TileEntityChest var7 = (TileEntityChest)var1.getBlockTileEntity(var2, var3, var4); +- if(var7.numUsingPlayers < 1) { ++ /** ++ * Determines whether the Ocelot wants to sit on the block at given coordinate ++ */ ++ private boolean isSittableBlock(World par1World, int par2, int par3, int par4) { ++ int var5 = par1World.getBlockId(par2, par3, par4); ++ int var6 = par1World.getBlockMetadata(par2, par3, par4); ++ ++ if (var5 == Block.chest.blockID) { ++ TileEntityChest var7 = (TileEntityChest)par1World.getBlockTileEntity(par2, par3, par4); ++ ++ if (var7.numUsingPlayers < 1) { + return true; + } + } else { +- if(var5 == Block.furnaceBurning.blockID) { ++ if (var5 == Block.furnaceBurning.blockID) { + return true; + } + +- if(var5 == Block.bed.blockID && !BlockBed.isBlockHeadOfBed(var6)) { ++ if (var5 == Block.bed.blockID && !BlockBed.isBlockHeadOfBed(var6)) { + return true; + } + } diff --git a/patches/net/minecraft/src/EntityAIOpenDoor.java.patch b/patches/net/minecraft/src/EntityAIOpenDoor.java.patch new file mode 100644 index 0000000..2855834 --- /dev/null +++ b/patches/net/minecraft/src/EntityAIOpenDoor.java.patch @@ -0,0 +1,48 @@ +--- net/minecraft/src/EntityAIOpenDoor.java ++++ net/minecraft/src/EntityAIOpenDoor.java +@@ -4,28 +4,39 @@ + boolean field_75361_i; + int field_75360_j; + +- public EntityAIOpenDoor(EntityLiving var1, boolean var2) { +- super(var1); +- this.theEntity = var1; +- this.field_75361_i = var2; ++ public EntityAIOpenDoor(EntityLiving par1EntityLiving, boolean par2) { ++ super(par1EntityLiving); ++ this.theEntity = par1EntityLiving; ++ this.field_75361_i = par2; + } + ++ /** ++ * Returns whether an in-progress EntityAIBase should continue executing ++ */ + public boolean continueExecuting() { + return this.field_75361_i && this.field_75360_j > 0 && super.continueExecuting(); + } + ++ /** ++ * Execute a one shot task or start executing a continuous task ++ */ + public void startExecuting() { + this.field_75360_j = 20; + this.targetDoor.onPoweredBlockChange(this.theEntity.worldObj, this.entityPosX, this.entityPosY, this.entityPosZ, true); + } + ++ /** ++ * Resets the task ++ */ + public void resetTask() { +- if(this.field_75361_i) { ++ if (this.field_75361_i) { + this.targetDoor.onPoweredBlockChange(this.theEntity.worldObj, this.entityPosX, this.entityPosY, this.entityPosZ, false); + } +- + } + ++ /** ++ * Updates the task ++ */ + public void updateTask() { + --this.field_75360_j; + super.updateTask(); diff --git a/patches/net/minecraft/src/EntityAIOwnerHurtByTarget.java.patch b/patches/net/minecraft/src/EntityAIOwnerHurtByTarget.java.patch new file mode 100644 index 0000000..5ef1fdf --- /dev/null +++ b/patches/net/minecraft/src/EntityAIOwnerHurtByTarget.java.patch @@ -0,0 +1,46 @@ +--- net/minecraft/src/EntityAIOwnerHurtByTarget.java ++++ net/minecraft/src/EntityAIOwnerHurtByTarget.java +@@ -5,18 +5,22 @@ + EntityLivingBase theOwnerAttacker; + private int field_142051_e; + +- public EntityAIOwnerHurtByTarget(EntityTameable var1) { +- super(var1, false); +- this.theDefendingTameable = var1; ++ public EntityAIOwnerHurtByTarget(EntityTameable par1EntityTameable) { ++ super(par1EntityTameable, false); ++ this.theDefendingTameable = par1EntityTameable; + this.setMutexBits(1); + } + ++ /** ++ * Returns whether the EntityAIBase should begin execution. ++ */ + public boolean shouldExecute() { +- if(!this.theDefendingTameable.isTamed()) { ++ if (!this.theDefendingTameable.isTamed()) { + return false; + } else { + EntityLivingBase var1 = this.theDefendingTameable.func_130012_q(); +- if(var1 == null) { ++ ++ if (var1 == null) { + return false; + } else { + this.theOwnerAttacker = var1.getAITarget(); +@@ -26,10 +30,14 @@ + } + } + ++ /** ++ * Execute a one shot task or start executing a continuous task ++ */ + public void startExecuting() { + this.taskOwner.setAttackTarget(this.theOwnerAttacker); + EntityLivingBase var1 = this.theDefendingTameable.func_130012_q(); +- if(var1 != null) { ++ ++ if (var1 != null) { + this.field_142051_e = var1.func_142015_aE(); + } + diff --git a/patches/net/minecraft/src/EntityAIOwnerHurtTarget.java.patch b/patches/net/minecraft/src/EntityAIOwnerHurtTarget.java.patch new file mode 100644 index 0000000..ae359f9 --- /dev/null +++ b/patches/net/minecraft/src/EntityAIOwnerHurtTarget.java.patch @@ -0,0 +1,46 @@ +--- net/minecraft/src/EntityAIOwnerHurtTarget.java ++++ net/minecraft/src/EntityAIOwnerHurtTarget.java +@@ -5,18 +5,22 @@ + EntityLivingBase theTarget; + private int field_142050_e; + +- public EntityAIOwnerHurtTarget(EntityTameable var1) { +- super(var1, false); +- this.theEntityTameable = var1; ++ public EntityAIOwnerHurtTarget(EntityTameable par1EntityTameable) { ++ super(par1EntityTameable, false); ++ this.theEntityTameable = par1EntityTameable; + this.setMutexBits(1); + } + ++ /** ++ * Returns whether the EntityAIBase should begin execution. ++ */ + public boolean shouldExecute() { +- if(!this.theEntityTameable.isTamed()) { ++ if (!this.theEntityTameable.isTamed()) { + return false; + } else { + EntityLivingBase var1 = this.theEntityTameable.func_130012_q(); +- if(var1 == null) { ++ ++ if (var1 == null) { + return false; + } else { + this.theTarget = var1.getLastAttacker(); +@@ -26,10 +30,14 @@ + } + } + ++ /** ++ * Execute a one shot task or start executing a continuous task ++ */ + public void startExecuting() { + this.taskOwner.setAttackTarget(this.theTarget); + EntityLivingBase var1 = this.theEntityTameable.func_130012_q(); +- if(var1 != null) { ++ ++ if (var1 != null) { + this.field_142050_e = var1.getLastAttackerTime(); + } + diff --git a/patches/net/minecraft/src/EntityAIPanic.java.patch b/patches/net/minecraft/src/EntityAIPanic.java.patch new file mode 100644 index 0000000..617b492 --- /dev/null +++ b/patches/net/minecraft/src/EntityAIPanic.java.patch @@ -0,0 +1,47 @@ +--- net/minecraft/src/EntityAIPanic.java ++++ net/minecraft/src/EntityAIPanic.java +@@ -7,18 +7,22 @@ + private double randPosY; + private double randPosZ; + +- public EntityAIPanic(EntityCreature var1, double var2) { +- this.theEntityCreature = var1; +- this.speed = var2; ++ public EntityAIPanic(EntityCreature par1EntityCreature, double par2) { ++ this.theEntityCreature = par1EntityCreature; ++ this.speed = par2; + this.setMutexBits(1); + } + ++ /** ++ * Returns whether the EntityAIBase should begin execution. ++ */ + public boolean shouldExecute() { +- if(this.theEntityCreature.getAITarget() == null && !this.theEntityCreature.isBurning()) { ++ if (this.theEntityCreature.getAITarget() == null && !this.theEntityCreature.isBurning()) { + return false; + } else { + Vec3 var1 = RandomPositionGenerator.findRandomTarget(this.theEntityCreature, 5, 4); +- if(var1 == null) { ++ ++ if (var1 == null) { + return false; + } else { + this.randPosX = var1.xCoord; +@@ -29,10 +33,16 @@ + } + } + ++ /** ++ * Execute a one shot task or start executing a continuous task ++ */ + public void startExecuting() { + this.theEntityCreature.getNavigator().tryMoveToXYZ(this.randPosX, this.randPosY, this.randPosZ, this.speed); + } + ++ /** ++ * Returns whether an in-progress EntityAIBase should continue executing ++ */ + public boolean continueExecuting() { + return !this.theEntityCreature.getNavigator().noPath(); + } diff --git a/patches/net/minecraft/src/EntityAIPlay.java.patch b/patches/net/minecraft/src/EntityAIPlay.java.patch new file mode 100644 index 0000000..e130d85 --- /dev/null +++ b/patches/net/minecraft/src/EntityAIPlay.java.patch @@ -0,0 +1,112 @@ +--- net/minecraft/src/EntityAIPlay.java ++++ net/minecraft/src/EntityAIPlay.java +@@ -9,36 +9,42 @@ + private double field_75261_c; + private int playTime; + +- public EntityAIPlay(EntityVillager var1, double var2) { +- this.villagerObj = var1; +- this.field_75261_c = var2; ++ public EntityAIPlay(EntityVillager par1EntityVillager, double par2) { ++ this.villagerObj = par1EntityVillager; ++ this.field_75261_c = par2; + this.setMutexBits(1); + } + ++ /** ++ * Returns whether the EntityAIBase should begin execution. ++ */ + public boolean shouldExecute() { +- if(this.villagerObj.getGrowingAge() >= 0) { ++ if (this.villagerObj.getGrowingAge() >= 0) { + return false; +- } else if(this.villagerObj.getRNG().nextInt(400) != 0) { ++ } else if (this.villagerObj.getRNG().nextInt(400) != 0) { + return false; + } else { + List var1 = this.villagerObj.worldObj.getEntitiesWithinAABB(EntityVillager.class, this.villagerObj.boundingBox.expand(6.0D, 3.0D, 6.0D)); + double var2 = Double.MAX_VALUE; + Iterator var4 = var1.iterator(); + +- while(var4.hasNext()) { ++ while (var4.hasNext()) { + EntityVillager var5 = (EntityVillager)var4.next(); +- if(var5 != this.villagerObj && !var5.isPlaying() && var5.getGrowingAge() < 0) { ++ ++ if (var5 != this.villagerObj && !var5.isPlaying() && var5.getGrowingAge() < 0) { + double var6 = var5.getDistanceSqToEntity(this.villagerObj); +- if(var6 <= var2) { ++ ++ if (var6 <= var2) { + var2 = var6; + this.targetVillager = var5; + } + } + } + +- if(this.targetVillager == null) { ++ if (this.targetVillager == null) { + Vec3 var8 = RandomPositionGenerator.findRandomTarget(this.villagerObj, 16, 3); +- if(var8 == null) { ++ ++ if (var8 == null) { + return false; + } + } +@@ -47,37 +53,50 @@ + } + } + ++ /** ++ * Returns whether an in-progress EntityAIBase should continue executing ++ */ + public boolean continueExecuting() { + return this.playTime > 0; + } + ++ /** ++ * Execute a one shot task or start executing a continuous task ++ */ + public void startExecuting() { +- if(this.targetVillager != null) { ++ if (this.targetVillager != null) { + this.villagerObj.setPlaying(true); + } + + this.playTime = 1000; + } + ++ /** ++ * Resets the task ++ */ + public void resetTask() { + this.villagerObj.setPlaying(false); + this.targetVillager = null; + } + ++ /** ++ * Updates the task ++ */ + public void updateTask() { + --this.playTime; +- if(this.targetVillager != null) { +- if(this.villagerObj.getDistanceSqToEntity(this.targetVillager) > 4.0D) { ++ ++ if (this.targetVillager != null) { ++ if (this.villagerObj.getDistanceSqToEntity(this.targetVillager) > 4.0D) { + this.villagerObj.getNavigator().tryMoveToEntityLiving(this.targetVillager, this.field_75261_c); + } +- } else if(this.villagerObj.getNavigator().noPath()) { ++ } else if (this.villagerObj.getNavigator().noPath()) { + Vec3 var1 = RandomPositionGenerator.findRandomTarget(this.villagerObj, 16, 3); +- if(var1 == null) { ++ ++ if (var1 == null) { + return; + } + + this.villagerObj.getNavigator().tryMoveToXYZ(var1.xCoord, var1.yCoord, var1.zCoord, this.field_75261_c); + } +- + } + } diff --git a/patches/net/minecraft/src/EntityAIRestrictOpenDoor.java.patch b/patches/net/minecraft/src/EntityAIRestrictOpenDoor.java.patch new file mode 100644 index 0000000..a6dc8be --- /dev/null +++ b/patches/net/minecraft/src/EntityAIRestrictOpenDoor.java.patch @@ -0,0 +1,61 @@ +--- net/minecraft/src/EntityAIRestrictOpenDoor.java ++++ net/minecraft/src/EntityAIRestrictOpenDoor.java +@@ -4,16 +4,20 @@ + private EntityCreature entityObj; + private VillageDoorInfo frontDoor; + +- public EntityAIRestrictOpenDoor(EntityCreature var1) { +- this.entityObj = var1; ++ public EntityAIRestrictOpenDoor(EntityCreature par1EntityCreature) { ++ this.entityObj = par1EntityCreature; + } + ++ /** ++ * Returns whether the EntityAIBase should begin execution. ++ */ + public boolean shouldExecute() { +- if(this.entityObj.worldObj.isDaytime()) { ++ if (this.entityObj.worldObj.isDaytime()) { + return false; + } else { + Village var1 = this.entityObj.worldObj.villageCollectionObj.findNearestVillage(MathHelper.floor_double(this.entityObj.posX), MathHelper.floor_double(this.entityObj.posY), MathHelper.floor_double(this.entityObj.posZ), 16); +- if(var1 == null) { ++ ++ if (var1 == null) { + return false; + } else { + this.frontDoor = var1.findNearestDoor(MathHelper.floor_double(this.entityObj.posX), MathHelper.floor_double(this.entityObj.posY), MathHelper.floor_double(this.entityObj.posZ)); +@@ -22,21 +26,33 @@ + } + } + ++ /** ++ * Returns whether an in-progress EntityAIBase should continue executing ++ */ + public boolean continueExecuting() { + return this.entityObj.worldObj.isDaytime() ? false : !this.frontDoor.isDetachedFromVillageFlag && this.frontDoor.isInside(MathHelper.floor_double(this.entityObj.posX), MathHelper.floor_double(this.entityObj.posZ)); + } + ++ /** ++ * Execute a one shot task or start executing a continuous task ++ */ + public void startExecuting() { + this.entityObj.getNavigator().setBreakDoors(false); + this.entityObj.getNavigator().setEnterDoors(false); + } + ++ /** ++ * Resets the task ++ */ + public void resetTask() { + this.entityObj.getNavigator().setBreakDoors(true); + this.entityObj.getNavigator().setEnterDoors(true); + this.frontDoor = null; + } + ++ /** ++ * Updates the task ++ */ + public void updateTask() { + this.frontDoor.incrementDoorOpeningRestrictionCounter(); + } diff --git a/patches/net/minecraft/src/EntityAIRestrictSun.java.patch b/patches/net/minecraft/src/EntityAIRestrictSun.java.patch new file mode 100644 index 0000000..477f36e --- /dev/null +++ b/patches/net/minecraft/src/EntityAIRestrictSun.java.patch @@ -0,0 +1,32 @@ +--- net/minecraft/src/EntityAIRestrictSun.java ++++ net/minecraft/src/EntityAIRestrictSun.java +@@ -3,18 +3,27 @@ + public class EntityAIRestrictSun extends EntityAIBase { + private EntityCreature theEntity; + +- public EntityAIRestrictSun(EntityCreature var1) { +- this.theEntity = var1; ++ public EntityAIRestrictSun(EntityCreature par1EntityCreature) { ++ this.theEntity = par1EntityCreature; + } + ++ /** ++ * Returns whether the EntityAIBase should begin execution. ++ */ + public boolean shouldExecute() { + return this.theEntity.worldObj.isDaytime(); + } + ++ /** ++ * Execute a one shot task or start executing a continuous task ++ */ + public void startExecuting() { + this.theEntity.getNavigator().setAvoidSun(true); + } + ++ /** ++ * Resets the task ++ */ + public void resetTask() { + this.theEntity.getNavigator().setAvoidSun(false); + } diff --git a/patches/net/minecraft/src/EntityAIRunAroundLikeCrazy.java.patch b/patches/net/minecraft/src/EntityAIRunAroundLikeCrazy.java.patch new file mode 100644 index 0000000..b83e619 --- /dev/null +++ b/patches/net/minecraft/src/EntityAIRunAroundLikeCrazy.java.patch @@ -0,0 +1,69 @@ +--- net/minecraft/src/EntityAIRunAroundLikeCrazy.java ++++ net/minecraft/src/EntityAIRunAroundLikeCrazy.java +@@ -7,16 +7,20 @@ + private double field_111176_d; + private double field_111177_e; + +- public EntityAIRunAroundLikeCrazy(EntityHorse var1, double var2) { +- this.horseHost = var1; +- this.field_111178_b = var2; ++ public EntityAIRunAroundLikeCrazy(EntityHorse par1EntityHorse, double par2) { ++ this.horseHost = par1EntityHorse; ++ this.field_111178_b = par2; + this.setMutexBits(1); + } + ++ /** ++ * Returns whether the EntityAIBase should begin execution. ++ */ + public boolean shouldExecute() { +- if(!this.horseHost.isTame() && this.horseHost.riddenByEntity != null) { ++ if (!this.horseHost.isTame() && this.horseHost.riddenByEntity != null) { + Vec3 var1 = RandomPositionGenerator.findRandomTarget(this.horseHost, 5, 4); +- if(var1 == null) { ++ ++ if (var1 == null) { + return false; + } else { + this.field_111179_c = var1.xCoord; +@@ -29,20 +33,30 @@ + } + } + ++ /** ++ * Execute a one shot task or start executing a continuous task ++ */ + public void startExecuting() { + this.horseHost.getNavigator().tryMoveToXYZ(this.field_111179_c, this.field_111176_d, this.field_111177_e, this.field_111178_b); + } + ++ /** ++ * Returns whether an in-progress EntityAIBase should continue executing ++ */ + public boolean continueExecuting() { + return !this.horseHost.getNavigator().noPath() && this.horseHost.riddenByEntity != null; + } + ++ /** ++ * Updates the task ++ */ + public void updateTask() { +- if(this.horseHost.getRNG().nextInt(50) == 0) { +- if(this.horseHost.riddenByEntity instanceof EntityPlayer) { ++ if (this.horseHost.getRNG().nextInt(50) == 0) { ++ if (this.horseHost.riddenByEntity instanceof EntityPlayer) { + int var1 = this.horseHost.getTemper(); + int var2 = this.horseHost.getMaxTemper(); +- if(var2 > 0 && this.horseHost.getRNG().nextInt(var2) < var1) { ++ ++ if (var2 > 0 && this.horseHost.getRNG().nextInt(var2) < var1) { + this.horseHost.setTamedBy((EntityPlayer)this.horseHost.riddenByEntity); + this.horseHost.worldObj.setEntityState(this.horseHost, (byte)7); + return; +@@ -56,6 +70,5 @@ + this.horseHost.makeHorseRearWithSound(); + this.horseHost.worldObj.setEntityState(this.horseHost, (byte)6); + } +- + } + } diff --git a/patches/net/minecraft/src/EntityAISit.java.patch b/patches/net/minecraft/src/EntityAISit.java.patch new file mode 100644 index 0000000..66dd9af --- /dev/null +++ b/patches/net/minecraft/src/EntityAISit.java.patch @@ -0,0 +1,62 @@ +--- net/minecraft/src/EntityAISit.java ++++ net/minecraft/src/EntityAISit.java +@@ -2,19 +2,24 @@ + + public class EntityAISit extends EntityAIBase { + private EntityTameable theEntity; ++ ++ /** If the EntityTameable is sitting. */ + private boolean isSitting; + +- public EntityAISit(EntityTameable var1) { +- this.theEntity = var1; ++ public EntityAISit(EntityTameable par1EntityTameable) { ++ this.theEntity = par1EntityTameable; + this.setMutexBits(5); + } + ++ /** ++ * Returns whether the EntityAIBase should begin execution. ++ */ + public boolean shouldExecute() { +- if(!this.theEntity.isTamed()) { +- return false; +- } else if(this.theEntity.isInWater()) { +- return false; +- } else if(!this.theEntity.onGround) { ++ if (!this.theEntity.isTamed()) { ++ return false; ++ } else if (this.theEntity.isInWater()) { ++ return false; ++ } else if (!this.theEntity.onGround) { + return false; + } else { + EntityLivingBase var1 = this.theEntity.func_130012_q(); +@@ -22,16 +27,25 @@ + } + } + ++ /** ++ * Execute a one shot task or start executing a continuous task ++ */ + public void startExecuting() { + this.theEntity.getNavigator().clearPathEntity(); + this.theEntity.setSitting(true); + } + ++ /** ++ * Resets the task ++ */ + public void resetTask() { + this.theEntity.setSitting(false); + } + +- public void setSitting(boolean var1) { +- this.isSitting = var1; ++ /** ++ * Sets the sitting flag. ++ */ ++ public void setSitting(boolean par1) { ++ this.isSitting = par1; + } + } diff --git a/patches/net/minecraft/src/EntityAISwimming.java.patch b/patches/net/minecraft/src/EntityAISwimming.java.patch new file mode 100644 index 0000000..890aad2 --- /dev/null +++ b/patches/net/minecraft/src/EntityAISwimming.java.patch @@ -0,0 +1,33 @@ +--- net/minecraft/src/EntityAISwimming.java ++++ net/minecraft/src/EntityAISwimming.java +@@ -3,20 +3,25 @@ + public class EntityAISwimming extends EntityAIBase { + private EntityLiving theEntity; + +- public EntityAISwimming(EntityLiving var1) { +- this.theEntity = var1; ++ public EntityAISwimming(EntityLiving par1EntityLiving) { ++ this.theEntity = par1EntityLiving; + this.setMutexBits(4); +- var1.getNavigator().setCanSwim(true); ++ par1EntityLiving.getNavigator().setCanSwim(true); + } + ++ /** ++ * Returns whether the EntityAIBase should begin execution. ++ */ + public boolean shouldExecute() { + return this.theEntity.isInWater() || this.theEntity.handleLavaMovement(); + } + ++ /** ++ * Updates the task ++ */ + public void updateTask() { +- if(this.theEntity.getRNG().nextFloat() < 0.8F) { ++ if (this.theEntity.getRNG().nextFloat() < 0.8F) { + this.theEntity.getJumpHelper().setJumping(); + } +- + } + } diff --git a/patches/net/minecraft/src/EntityAITarget.java.patch b/patches/net/minecraft/src/EntityAITarget.java.patch new file mode 100644 index 0000000..2b93056 --- /dev/null +++ b/patches/net/minecraft/src/EntityAITarget.java.patch @@ -0,0 +1,192 @@ +--- net/minecraft/src/EntityAITarget.java ++++ net/minecraft/src/EntityAITarget.java +@@ -1,38 +1,61 @@ + package net.minecraft.src; + + public abstract class EntityAITarget extends EntityAIBase { ++ ++ /** The entity that this task belongs to */ + protected EntityCreature taskOwner; ++ ++ /** ++ * If true, EntityAI targets must be able to be seen (cannot be blocked by walls) to be suitable targets. ++ */ + protected boolean shouldCheckSight; ++ ++ /** ++ * When true, only entities that can be reached with minimal effort will be targetted. ++ */ + private boolean nearbyOnly; ++ ++ /** ++ * When nearbyOnly is true: 0 -> No target, but OK to search; 1 -> Nearby target found; 2 -> Target too far. ++ */ + private int targetSearchStatus; ++ ++ /** ++ * When nearbyOnly is true, this throttles target searching to avoid excessive pathfinding. ++ */ + private int targetSearchDelay; + private int field_75298_g; + +- public EntityAITarget(EntityCreature var1, boolean var2) { +- this(var1, var2, false); +- } +- +- public EntityAITarget(EntityCreature var1, boolean var2, boolean var3) { +- this.taskOwner = var1; +- this.shouldCheckSight = var2; +- this.nearbyOnly = var3; +- } +- ++ public EntityAITarget(EntityCreature par1EntityCreature, boolean par2) { ++ this(par1EntityCreature, par2, false); ++ } ++ ++ public EntityAITarget(EntityCreature par1EntityCreature, boolean par2, boolean par3) { ++ this.taskOwner = par1EntityCreature; ++ this.shouldCheckSight = par2; ++ this.nearbyOnly = par3; ++ } ++ ++ /** ++ * Returns whether an in-progress EntityAIBase should continue executing ++ */ + public boolean continueExecuting() { + EntityLivingBase var1 = this.taskOwner.getAttackTarget(); +- if(var1 == null) { ++ ++ if (var1 == null) { + return false; +- } else if(!var1.isEntityAlive()) { ++ } else if (!var1.isEntityAlive()) { + return false; + } else { + double var2 = this.getTargetDistance(); +- if(this.taskOwner.getDistanceSqToEntity(var1) > var2 * var2) { ++ ++ if (this.taskOwner.getDistanceSqToEntity(var1) > var2 * var2) { + return false; + } else { +- if(this.shouldCheckSight) { +- if(this.taskOwner.getEntitySenses().canSee(var1)) { ++ if (this.shouldCheckSight) { ++ if (this.taskOwner.getEntitySenses().canSee(var1)) { + this.field_75298_g = 0; +- } else if(++this.field_75298_g > 60) { ++ } else if (++this.field_75298_g > 60) { + return false; + } + } +@@ -47,53 +70,62 @@ + return var1 == null ? 16.0D : var1.getAttributeValue(); + } + ++ /** ++ * Execute a one shot task or start executing a continuous task ++ */ + public void startExecuting() { + this.targetSearchStatus = 0; + this.targetSearchDelay = 0; + this.field_75298_g = 0; + } + ++ /** ++ * Resets the task ++ */ + public void resetTask() { + this.taskOwner.setAttackTarget((EntityLivingBase)null); + } + +- protected boolean isSuitableTarget(EntityLivingBase var1, boolean var2) { +- if(var1 == null) { +- return false; +- } else if(var1 == this.taskOwner) { +- return false; +- } else if(!var1.isEntityAlive()) { +- return false; +- } else if(!this.taskOwner.canAttackClass(var1.getClass())) { ++ /** ++ * A method used to see if an entity is a suitable target through a number of checks. ++ */ ++ protected boolean isSuitableTarget(EntityLivingBase par1EntityLivingBase, boolean par2) { ++ if (par1EntityLivingBase == null) { ++ return false; ++ } else if (par1EntityLivingBase == this.taskOwner) { ++ return false; ++ } else if (!par1EntityLivingBase.isEntityAlive()) { ++ return false; ++ } else if (!this.taskOwner.canAttackClass(par1EntityLivingBase.getClass())) { + return false; + } else { +- if(this.taskOwner instanceof EntityOwnable && org.apache.commons.lang3.StringUtils.isNotEmpty(((EntityOwnable)this.taskOwner).getOwnerName())) { +- if(var1 instanceof EntityOwnable && ((EntityOwnable)this.taskOwner).getOwnerName().equals(((EntityOwnable)var1).getOwnerName())) { ++ if (this.taskOwner instanceof EntityOwnable && org.apache.commons.lang3.StringUtils.isNotEmpty(((EntityOwnable)this.taskOwner).getOwnerName())) { ++ if (par1EntityLivingBase instanceof EntityOwnable && ((EntityOwnable)this.taskOwner).getOwnerName().equals(((EntityOwnable)par1EntityLivingBase).getOwnerName())) { + return false; + } + +- if(var1 == ((EntityOwnable)this.taskOwner).getOwner()) { ++ if (par1EntityLivingBase == ((EntityOwnable)this.taskOwner).getOwner()) { + return false; + } +- } else if(var1 instanceof EntityPlayer && !var2 && ((EntityPlayer)var1).capabilities.disableDamage) { ++ } else if (par1EntityLivingBase instanceof EntityPlayer && !par2 && ((EntityPlayer)par1EntityLivingBase).capabilities.disableDamage) { + return false; + } + +- if(!this.taskOwner.func_110176_b(MathHelper.floor_double(var1.posX), MathHelper.floor_double(var1.posY), MathHelper.floor_double(var1.posZ))) { ++ if (!this.taskOwner.func_110176_b(MathHelper.floor_double(par1EntityLivingBase.posX), MathHelper.floor_double(par1EntityLivingBase.posY), MathHelper.floor_double(par1EntityLivingBase.posZ))) { + return false; +- } else if(this.shouldCheckSight && !this.taskOwner.getEntitySenses().canSee(var1)) { ++ } else if (this.shouldCheckSight && !this.taskOwner.getEntitySenses().canSee(par1EntityLivingBase)) { + return false; + } else { +- if(this.nearbyOnly) { +- if(--this.targetSearchDelay <= 0) { ++ if (this.nearbyOnly) { ++ if (--this.targetSearchDelay <= 0) { + this.targetSearchStatus = 0; + } + +- if(this.targetSearchStatus == 0) { +- this.targetSearchStatus = this.canEasilyReach(var1) ? 1 : 2; ++ if (this.targetSearchStatus == 0) { ++ this.targetSearchStatus = this.canEasilyReach(par1EntityLivingBase) ? 1 : 2; + } + +- if(this.targetSearchStatus == 2) { ++ if (this.targetSearchStatus == 2) { + return false; + } + } +@@ -103,18 +135,23 @@ + } + } + +- private boolean canEasilyReach(EntityLivingBase var1) { ++ /** ++ * Checks to see if this entity can find a short path to the given target. ++ */ ++ private boolean canEasilyReach(EntityLivingBase par1EntityLivingBase) { + this.targetSearchDelay = 10 + this.taskOwner.getRNG().nextInt(5); +- PathEntity var2 = this.taskOwner.getNavigator().getPathToEntityLiving(var1); +- if(var2 == null) { ++ PathEntity var2 = this.taskOwner.getNavigator().getPathToEntityLiving(par1EntityLivingBase); ++ ++ if (var2 == null) { + return false; + } else { + PathPoint var3 = var2.getFinalPathPoint(); +- if(var3 == null) { ++ ++ if (var3 == null) { + return false; + } else { +- int var4 = var3.xCoord - MathHelper.floor_double(var1.posX); +- int var5 = var3.zCoord - MathHelper.floor_double(var1.posZ); ++ int var4 = var3.xCoord - MathHelper.floor_double(par1EntityLivingBase.posX); ++ int var5 = var3.zCoord - MathHelper.floor_double(par1EntityLivingBase.posZ); + return (double)(var4 * var4 + var5 * var5) <= 2.25D; + } + } diff --git a/patches/net/minecraft/src/EntityAITargetNonTamed.java.patch b/patches/net/minecraft/src/EntityAITargetNonTamed.java.patch new file mode 100644 index 0000000..e38704b --- /dev/null +++ b/patches/net/minecraft/src/EntityAITargetNonTamed.java.patch @@ -0,0 +1,20 @@ +--- net/minecraft/src/EntityAITargetNonTamed.java ++++ net/minecraft/src/EntityAITargetNonTamed.java +@@ -3,11 +3,14 @@ + public class EntityAITargetNonTamed extends EntityAINearestAttackableTarget { + private EntityTameable theTameable; + +- public EntityAITargetNonTamed(EntityTameable var1, Class var2, int var3, boolean var4) { +- super(var1, var2, var3, var4); +- this.theTameable = var1; ++ public EntityAITargetNonTamed(EntityTameable par1EntityTameable, Class par2Class, int par3, boolean par4) { ++ super(par1EntityTameable, par2Class, par3, par4); ++ this.theTameable = par1EntityTameable; + } + ++ /** ++ * Returns whether the EntityAIBase should begin execution. ++ */ + public boolean shouldExecute() { + return !this.theTameable.isTamed() && super.shouldExecute(); + } diff --git a/patches/net/minecraft/src/EntityAITaskEntry.java.patch b/patches/net/minecraft/src/EntityAITaskEntry.java.patch new file mode 100644 index 0000000..32959e7 --- /dev/null +++ b/patches/net/minecraft/src/EntityAITaskEntry.java.patch @@ -0,0 +1,26 @@ +--- net/minecraft/src/EntityAITaskEntry.java ++++ net/minecraft/src/EntityAITaskEntry.java +@@ -1,13 +1,19 @@ + package net.minecraft.src; + + class EntityAITaskEntry { ++ ++ /** The EntityAIBase object. */ + public EntityAIBase action; ++ ++ /** Priority of the EntityAIBase */ + public int priority; ++ ++ /** The EntityAITasks object of which this is an entry. */ + final EntityAITasks tasks; + +- public EntityAITaskEntry(EntityAITasks var1, int var2, EntityAIBase var3) { +- this.tasks = var1; +- this.priority = var2; +- this.action = var3; ++ public EntityAITaskEntry(EntityAITasks par1EntityAITasks, int par2, EntityAIBase par3EntityAIBase) { ++ this.tasks = par1EntityAITasks; ++ this.priority = par2; ++ this.action = par3EntityAIBase; + } + } diff --git a/patches/net/minecraft/src/EntityAITasks.java.patch b/patches/net/minecraft/src/EntityAITasks.java.patch new file mode 100644 index 0000000..9e011dc --- /dev/null +++ b/patches/net/minecraft/src/EntityAITasks.java.patch @@ -0,0 +1,205 @@ +--- net/minecraft/src/EntityAITasks.java ++++ net/minecraft/src/EntityAITasks.java +@@ -5,76 +5,80 @@ + import java.util.List; + + public class EntityAITasks { +- private List a = new ArrayList(); +- private List b = new ArrayList(); ++ ++ /** A list of EntityAITaskEntrys in EntityAITasks. */ ++ private List taskEntries = new ArrayList(); ++ ++ /** A list of EntityAITaskEntrys that are currently being executed. */ ++ private List executingTaskEntries = new ArrayList(); ++ ++ /** Instance of Profiler. */ + private final Profiler theProfiler; + private int tickCount; + private int tickRate = 3; + +- public EntityAITasks(Profiler var1) { +- this.theProfiler = var1; +- } +- +- public void addTask(int var1, EntityAIBase var2) { +- this.a.add(new EntityAITaskEntry(this, var1, var2)); +- } +- +- public void removeTask(EntityAIBase var1) { +- Iterator var2 = this.a.iterator(); +- +- while(var2.hasNext()) { ++ public EntityAITasks(Profiler par1Profiler) { ++ this.theProfiler = par1Profiler; ++ } ++ ++ public void addTask(int par1, EntityAIBase par2EntityAIBase) { ++ this.taskEntries.add(new EntityAITaskEntry(this, par1, par2EntityAIBase)); ++ } ++ ++ /** ++ * removes the indicated task from the entity's AI tasks. ++ */ ++ public void removeTask(EntityAIBase par1EntityAIBase) { ++ Iterator var2 = this.taskEntries.iterator(); ++ ++ while (var2.hasNext()) { + EntityAITaskEntry var3 = (EntityAITaskEntry)var2.next(); + EntityAIBase var4 = var3.action; +- if(var4 == var1) { +- if(this.b.contains(var3)) { ++ ++ if (var4 == par1EntityAIBase) { ++ if (this.executingTaskEntries.contains(var3)) { + var4.resetTask(); +- this.b.remove(var3); ++ this.executingTaskEntries.remove(var3); + } + + var2.remove(); + } + } +- + } + + public void onUpdateTasks() { + ArrayList var1 = new ArrayList(); + Iterator var2; + EntityAITaskEntry var3; +- if(this.tickCount++ % this.tickRate == 0) { +- var2 = this.a.iterator(); +- +- label59: +- while(true) { +- while(true) { +- if(!var2.hasNext()) { +- break label59; +- } +- +- var3 = (EntityAITaskEntry)var2.next(); +- boolean var4 = this.b.contains(var3); +- if(!var4) { +- break; +- } +- +- if(!this.canUse(var3) || !this.canContinue(var3)) { +- var3.action.resetTask(); +- this.b.remove(var3); +- break; +- } ++ ++ if (this.tickCount++ % this.tickRate == 0) { ++ var2 = this.taskEntries.iterator(); ++ ++ while (var2.hasNext()) { ++ var3 = (EntityAITaskEntry)var2.next(); ++ boolean var4 = this.executingTaskEntries.contains(var3); ++ ++ if (var4) { ++ if (this.canUse(var3) && this.canContinue(var3)) { ++ continue; ++ } ++ ++ var3.action.resetTask(); ++ this.executingTaskEntries.remove(var3); + } + +- if(this.canUse(var3) && var3.action.shouldExecute()) { ++ if (this.canUse(var3) && var3.action.shouldExecute()) { + var1.add(var3); +- this.b.add(var3); ++ this.executingTaskEntries.add(var3); + } + } + } else { +- var2 = this.b.iterator(); ++ var2 = this.executingTaskEntries.iterator(); + +- while(var2.hasNext()) { ++ while (var2.hasNext()) { + var3 = (EntityAITaskEntry)var2.next(); +- if(!var3.action.continueExecuting()) { ++ ++ if (!var3.action.continueExecuting()) { + var3.action.resetTask(); + var2.remove(); + } +@@ -84,7 +88,7 @@ + this.theProfiler.startSection("goalStart"); + var2 = var1.iterator(); + +- while(var2.hasNext()) { ++ while (var2.hasNext()) { + var3 = (EntityAITaskEntry)var2.next(); + this.theProfiler.startSection(var3.action.getClass().getSimpleName()); + var3.action.startExecuting(); +@@ -93,9 +97,9 @@ + + this.theProfiler.endSection(); + this.theProfiler.startSection("goalTick"); +- var2 = this.b.iterator(); ++ var2 = this.executingTaskEntries.iterator(); + +- while(var2.hasNext()) { ++ while (var2.hasNext()) { + var3 = (EntityAITaskEntry)var2.next(); + var3.action.updateTask(); + } +@@ -103,26 +107,34 @@ + this.theProfiler.endSection(); + } + +- private boolean canContinue(EntityAITaskEntry var1) { ++ /** ++ * Determine if a specific AI Task should continue being executed. ++ */ ++ private boolean canContinue(EntityAITaskEntry par1EntityAITaskEntry) { + this.theProfiler.startSection("canContinue"); +- boolean var2 = var1.action.continueExecuting(); ++ boolean var2 = par1EntityAITaskEntry.action.continueExecuting(); + this.theProfiler.endSection(); + return var2; + } + +- private boolean canUse(EntityAITaskEntry var1) { ++ /** ++ * Determine if a specific AI Task can be executed, which means that all running higher (= lower int value) priority ++ * tasks are compatible with it or all lower priority tasks can be interrupted. ++ */ ++ private boolean canUse(EntityAITaskEntry par1EntityAITaskEntry) { + this.theProfiler.startSection("canUse"); +- Iterator var2 = this.a.iterator(); ++ Iterator var2 = this.taskEntries.iterator(); + +- while(var2.hasNext()) { ++ while (var2.hasNext()) { + EntityAITaskEntry var3 = (EntityAITaskEntry)var2.next(); +- if(var3 != var1) { +- if(var1.priority >= var3.priority) { +- if(this.b.contains(var3) && !this.areTasksCompatible(var1, var3)) { ++ ++ if (var3 != par1EntityAITaskEntry) { ++ if (par1EntityAITaskEntry.priority >= var3.priority) { ++ if (this.executingTaskEntries.contains(var3) && !this.areTasksCompatible(par1EntityAITaskEntry, var3)) { + this.theProfiler.endSection(); + return false; + } +- } else if(this.b.contains(var3) && !var3.action.isContinuous()) { ++ } else if (this.executingTaskEntries.contains(var3) && !var3.action.isInterruptible()) { + this.theProfiler.endSection(); + return false; + } +@@ -133,7 +145,10 @@ + return true; + } + +- private boolean areTasksCompatible(EntityAITaskEntry var1, EntityAITaskEntry var2) { +- return (var1.action.getMutexBits() & var2.action.getMutexBits()) == 0; ++ /** ++ * Returns whether two EntityAITaskEntries can be executed concurrently ++ */ ++ private boolean areTasksCompatible(EntityAITaskEntry par1EntityAITaskEntry, EntityAITaskEntry par2EntityAITaskEntry) { ++ return (par1EntityAITaskEntry.action.getMutexBits() & par2EntityAITaskEntry.action.getMutexBits()) == 0; + } + } diff --git a/patches/net/minecraft/src/EntityAITempt.java.patch b/patches/net/minecraft/src/EntityAITempt.java.patch new file mode 100644 index 0000000..4bbc261 --- /dev/null +++ b/patches/net/minecraft/src/EntityAITempt.java.patch @@ -0,0 +1,141 @@ +--- net/minecraft/src/EntityAITempt.java ++++ net/minecraft/src/EntityAITempt.java +@@ -1,35 +1,64 @@ + package net.minecraft.src; + + public class EntityAITempt extends EntityAIBase { ++ ++ /** The entity using this AI that is tempted by the player. */ + private EntityCreature temptedEntity; + private double field_75282_b; ++ ++ /** X position of player tempting this mob */ + private double targetX; ++ ++ /** Y position of player tempting this mob */ + private double targetY; ++ ++ /** Z position of player tempting this mob */ + private double targetZ; + private double field_75278_f; + private double field_75279_g; ++ ++ /** The player that is tempting the entity that is using this AI. */ + private EntityPlayer temptingPlayer; ++ ++ /** ++ * A counter that is decremented each time the shouldExecute method is called. The shouldExecute method will always ++ * return false if delayTemptCounter is greater than 0. ++ */ + private int delayTemptCounter; ++ ++ /** True if this EntityAITempt task is running */ + private boolean isRunning; ++ ++ /** ++ * This field saves the ID of the items that can be used to breed entities with this behaviour. ++ */ + private int breedingFood; ++ ++ /** ++ * Whether the entity using this AI will be scared by the tempter's sudden movement. ++ */ + private boolean scaredByPlayerMovement; + private boolean field_75286_m; + +- public EntityAITempt(EntityCreature var1, double var2, int var4, boolean var5) { +- this.temptedEntity = var1; +- this.field_75282_b = var2; +- this.breedingFood = var4; +- this.scaredByPlayerMovement = var5; ++ public EntityAITempt(EntityCreature par1EntityCreature, double par2, int par4, boolean par5) { ++ this.temptedEntity = par1EntityCreature; ++ this.field_75282_b = par2; ++ this.breedingFood = par4; ++ this.scaredByPlayerMovement = par5; + this.setMutexBits(3); + } + ++ /** ++ * Returns whether the EntityAIBase should begin execution. ++ */ + public boolean shouldExecute() { +- if(this.delayTemptCounter > 0) { ++ if (this.delayTemptCounter > 0) { + --this.delayTemptCounter; + return false; + } else { + this.temptingPlayer = this.temptedEntity.worldObj.getClosestPlayerToEntity(this.temptedEntity, 10.0D); +- if(this.temptingPlayer == null) { ++ ++ if (this.temptingPlayer == null) { + return false; + } else { + ItemStack var1 = this.temptingPlayer.getCurrentEquippedItem(); +@@ -38,14 +67,17 @@ + } + } + ++ /** ++ * Returns whether an in-progress EntityAIBase should continue executing ++ */ + public boolean continueExecuting() { +- if(this.scaredByPlayerMovement) { +- if(this.temptedEntity.getDistanceSqToEntity(this.temptingPlayer) < 36.0D) { +- if(this.temptingPlayer.getDistanceSq(this.targetX, this.targetY, this.targetZ) > 0.1D * 0.1D) { ++ if (this.scaredByPlayerMovement) { ++ if (this.temptedEntity.getDistanceSqToEntity(this.temptingPlayer) < 36.0D) { ++ if (this.temptingPlayer.getDistanceSq(this.targetX, this.targetY, this.targetZ) > 0.010000000000000002D) { + return false; + } + +- if(Math.abs((double)this.temptingPlayer.rotationPitch - this.field_75278_f) > 5.0D || Math.abs((double)this.temptingPlayer.rotationYaw - this.field_75279_g) > 5.0D) { ++ if (Math.abs((double)this.temptingPlayer.rotationPitch - this.field_75278_f) > 5.0D || Math.abs((double)this.temptingPlayer.rotationYaw - this.field_75279_g) > 5.0D) { + return false; + } + } else { +@@ -61,6 +93,9 @@ + return this.shouldExecute(); + } + ++ /** ++ * Execute a one shot task or start executing a continuous task ++ */ + public void startExecuting() { + this.targetX = this.temptingPlayer.posX; + this.targetY = this.temptingPlayer.posY; +@@ -70,6 +105,9 @@ + this.temptedEntity.getNavigator().setAvoidsWater(false); + } + ++ /** ++ * Resets the task ++ */ + public void resetTask() { + this.temptingPlayer = null; + this.temptedEntity.getNavigator().clearPathEntity(); +@@ -78,16 +116,22 @@ + this.temptedEntity.getNavigator().setAvoidsWater(this.field_75286_m); + } + ++ /** ++ * Updates the task ++ */ + public void updateTask() { + this.temptedEntity.getLookHelper().setLookPositionWithEntity(this.temptingPlayer, 30.0F, (float)this.temptedEntity.getVerticalFaceSpeed()); +- if(this.temptedEntity.getDistanceSqToEntity(this.temptingPlayer) < 6.25D) { ++ ++ if (this.temptedEntity.getDistanceSqToEntity(this.temptingPlayer) < 6.25D) { + this.temptedEntity.getNavigator().clearPathEntity(); + } else { + this.temptedEntity.getNavigator().tryMoveToEntityLiving(this.temptingPlayer, this.field_75282_b); + } +- + } + ++ /** ++ * @see #isRunning ++ */ + public boolean isRunning() { + return this.isRunning; + } diff --git a/patches/net/minecraft/src/EntityAITradePlayer.java.patch b/patches/net/minecraft/src/EntityAITradePlayer.java.patch new file mode 100644 index 0000000..5eab3da --- /dev/null +++ b/patches/net/minecraft/src/EntityAITradePlayer.java.patch @@ -0,0 +1,51 @@ +--- net/minecraft/src/EntityAITradePlayer.java ++++ net/minecraft/src/EntityAITradePlayer.java +@@ -3,19 +3,22 @@ + public class EntityAITradePlayer extends EntityAIBase { + private EntityVillager villager; + +- public EntityAITradePlayer(EntityVillager var1) { +- this.villager = var1; ++ public EntityAITradePlayer(EntityVillager par1EntityVillager) { ++ this.villager = par1EntityVillager; + this.setMutexBits(5); + } + ++ /** ++ * Returns whether the EntityAIBase should begin execution. ++ */ + public boolean shouldExecute() { +- if(!this.villager.isEntityAlive()) { +- return false; +- } else if(this.villager.isInWater()) { +- return false; +- } else if(!this.villager.onGround) { +- return false; +- } else if(this.villager.velocityChanged) { ++ if (!this.villager.isEntityAlive()) { ++ return false; ++ } else if (this.villager.isInWater()) { ++ return false; ++ } else if (!this.villager.onGround) { ++ return false; ++ } else if (this.villager.velocityChanged) { + return false; + } else { + EntityPlayer var1 = this.villager.getCustomer(); +@@ -23,10 +26,16 @@ + } + } + ++ /** ++ * Execute a one shot task or start executing a continuous task ++ */ + public void startExecuting() { + this.villager.getNavigator().clearPathEntity(); + } + ++ /** ++ * Resets the task ++ */ + public void resetTask() { + this.villager.setCustomer((EntityPlayer)null); + } diff --git a/patches/net/minecraft/src/EntityAIVillagerMate.java.patch b/patches/net/minecraft/src/EntityAIVillagerMate.java.patch new file mode 100644 index 0000000..9e5de92 --- /dev/null +++ b/patches/net/minecraft/src/EntityAIVillagerMate.java.patch @@ -0,0 +1,98 @@ +--- net/minecraft/src/EntityAIVillagerMate.java ++++ net/minecraft/src/EntityAIVillagerMate.java +@@ -7,26 +7,31 @@ + private int matingTimeout; + Village villageObj; + +- public EntityAIVillagerMate(EntityVillager var1) { +- this.villagerObj = var1; +- this.worldObj = var1.worldObj; ++ public EntityAIVillagerMate(EntityVillager par1EntityVillager) { ++ this.villagerObj = par1EntityVillager; ++ this.worldObj = par1EntityVillager.worldObj; + this.setMutexBits(3); + } + ++ /** ++ * Returns whether the EntityAIBase should begin execution. ++ */ + public boolean shouldExecute() { +- if(this.villagerObj.getGrowingAge() != 0) { ++ if (this.villagerObj.getGrowingAge() != 0) { + return false; +- } else if(this.villagerObj.getRNG().nextInt(500) != 0) { ++ } else if (this.villagerObj.getRNG().nextInt(500) != 0) { + return false; + } else { + this.villageObj = this.worldObj.villageCollectionObj.findNearestVillage(MathHelper.floor_double(this.villagerObj.posX), MathHelper.floor_double(this.villagerObj.posY), MathHelper.floor_double(this.villagerObj.posZ), 0); +- if(this.villageObj == null) { ++ ++ if (this.villageObj == null) { + return false; +- } else if(!this.checkSufficientDoorsPresentForNewVillager()) { ++ } else if (!this.checkSufficientDoorsPresentForNewVillager()) { + return false; + } else { + Entity var1 = this.worldObj.findNearestEntityWithinAABB(EntityVillager.class, this.villagerObj.boundingBox.expand(8.0D, 3.0D, 8.0D), this.villagerObj); +- if(var1 == null) { ++ ++ if (var1 == null) { + return false; + } else { + this.mate = (EntityVillager)var1; +@@ -36,38 +41,50 @@ + } + } + ++ /** ++ * Execute a one shot task or start executing a continuous task ++ */ + public void startExecuting() { + this.matingTimeout = 300; + this.villagerObj.setMating(true); + } + ++ /** ++ * Resets the task ++ */ + public void resetTask() { + this.villageObj = null; + this.mate = null; + this.villagerObj.setMating(false); + } + ++ /** ++ * Returns whether an in-progress EntityAIBase should continue executing ++ */ + public boolean continueExecuting() { + return this.matingTimeout >= 0 && this.checkSufficientDoorsPresentForNewVillager() && this.villagerObj.getGrowingAge() == 0; + } + ++ /** ++ * Updates the task ++ */ + public void updateTask() { + --this.matingTimeout; + this.villagerObj.getLookHelper().setLookPositionWithEntity(this.mate, 10.0F, 30.0F); +- if(this.villagerObj.getDistanceSqToEntity(this.mate) > 2.25D) { ++ ++ if (this.villagerObj.getDistanceSqToEntity(this.mate) > 2.25D) { + this.villagerObj.getNavigator().tryMoveToEntityLiving(this.mate, 0.25D); +- } else if(this.matingTimeout == 0 && this.mate.isMating()) { ++ } else if (this.matingTimeout == 0 && this.mate.isMating()) { + this.giveBirth(); + } + +- if(this.villagerObj.getRNG().nextInt(35) == 0) { ++ if (this.villagerObj.getRNG().nextInt(35) == 0) { + this.worldObj.setEntityState(this.villagerObj, (byte)12); + } +- + } + + private boolean checkSufficientDoorsPresentForNewVillager() { +- if(!this.villageObj.isMatingSeason()) { ++ if (!this.villageObj.isMatingSeason()) { + return false; + } else { + int var1 = (int)((double)((float)this.villageObj.getNumVillageDoors()) * 0.35D); diff --git a/patches/net/minecraft/src/EntityAIWander.java.patch b/patches/net/minecraft/src/EntityAIWander.java.patch new file mode 100644 index 0000000..0a6a42b --- /dev/null +++ b/patches/net/minecraft/src/EntityAIWander.java.patch @@ -0,0 +1,50 @@ +--- net/minecraft/src/EntityAIWander.java ++++ net/minecraft/src/EntityAIWander.java +@@ -7,20 +7,24 @@ + private double zPosition; + private double speed; + +- public EntityAIWander(EntityCreature var1, double var2) { +- this.entity = var1; +- this.speed = var2; ++ public EntityAIWander(EntityCreature par1EntityCreature, double par2) { ++ this.entity = par1EntityCreature; ++ this.speed = par2; + this.setMutexBits(1); + } + ++ /** ++ * Returns whether the EntityAIBase should begin execution. ++ */ + public boolean shouldExecute() { +- if(this.entity.getAge() >= 100) { ++ if (this.entity.getAge() >= 100) { + return false; +- } else if(this.entity.getRNG().nextInt(120) != 0) { ++ } else if (this.entity.getRNG().nextInt(120) != 0) { + return false; + } else { + Vec3 var1 = RandomPositionGenerator.findRandomTarget(this.entity, 10, 7); +- if(var1 == null) { ++ ++ if (var1 == null) { + return false; + } else { + this.xPosition = var1.xCoord; +@@ -31,10 +35,16 @@ + } + } + ++ /** ++ * Returns whether an in-progress EntityAIBase should continue executing ++ */ + public boolean continueExecuting() { + return !this.entity.getNavigator().noPath(); + } + ++ /** ++ * Execute a one shot task or start executing a continuous task ++ */ + public void startExecuting() { + this.entity.getNavigator().tryMoveToXYZ(this.xPosition, this.yPosition, this.zPosition, this.speed); + } diff --git a/patches/net/minecraft/src/EntityAIWatchClosest.java.patch b/patches/net/minecraft/src/EntityAIWatchClosest.java.patch new file mode 100644 index 0000000..2766bcd --- /dev/null +++ b/patches/net/minecraft/src/EntityAIWatchClosest.java.patch @@ -0,0 +1,94 @@ +--- net/minecraft/src/EntityAIWatchClosest.java ++++ net/minecraft/src/EntityAIWatchClosest.java +@@ -2,58 +2,77 @@ + + public class EntityAIWatchClosest extends EntityAIBase { + private EntityLiving theWatcher; ++ ++ /** The closest entity which is being watched by this one. */ + protected Entity closestEntity; ++ ++ /** This is the Maximum distance that the AI will look for the Entity */ + private float maxDistanceForPlayer; + private int lookTime; + private float field_75331_e; +- private Class f; ++ private Class watchedClass; + +- public EntityAIWatchClosest(EntityLiving var1, Class var2, float var3) { +- this.theWatcher = var1; +- this.f = var2; +- this.maxDistanceForPlayer = var3; ++ public EntityAIWatchClosest(EntityLiving par1EntityLiving, Class par2Class, float par3) { ++ this.theWatcher = par1EntityLiving; ++ this.watchedClass = par2Class; ++ this.maxDistanceForPlayer = par3; + this.field_75331_e = 0.02F; + this.setMutexBits(2); + } + +- public EntityAIWatchClosest(EntityLiving var1, Class var2, float var3, float var4) { +- this.theWatcher = var1; +- this.f = var2; +- this.maxDistanceForPlayer = var3; +- this.field_75331_e = var4; ++ public EntityAIWatchClosest(EntityLiving par1EntityLiving, Class par2Class, float par3, float par4) { ++ this.theWatcher = par1EntityLiving; ++ this.watchedClass = par2Class; ++ this.maxDistanceForPlayer = par3; ++ this.field_75331_e = par4; + this.setMutexBits(2); + } + ++ /** ++ * Returns whether the EntityAIBase should begin execution. ++ */ + public boolean shouldExecute() { +- if(this.theWatcher.getRNG().nextFloat() >= this.field_75331_e) { ++ if (this.theWatcher.getRNG().nextFloat() >= this.field_75331_e) { + return false; + } else { +- if(this.theWatcher.getAttackTarget() != null) { ++ if (this.theWatcher.getAttackTarget() != null) { + this.closestEntity = this.theWatcher.getAttackTarget(); + } + +- if(this.f == EntityPlayer.class) { ++ if (this.watchedClass == EntityPlayer.class) { + this.closestEntity = this.theWatcher.worldObj.getClosestPlayerToEntity(this.theWatcher, (double)this.maxDistanceForPlayer); + } else { +- this.closestEntity = this.theWatcher.worldObj.findNearestEntityWithinAABB(this.f, this.theWatcher.boundingBox.expand((double)this.maxDistanceForPlayer, 3.0D, (double)this.maxDistanceForPlayer), this.theWatcher); ++ this.closestEntity = this.theWatcher.worldObj.findNearestEntityWithinAABB(this.watchedClass, this.theWatcher.boundingBox.expand((double)this.maxDistanceForPlayer, 3.0D, (double)this.maxDistanceForPlayer), this.theWatcher); + } + + return this.closestEntity != null; + } + } + ++ /** ++ * Returns whether an in-progress EntityAIBase should continue executing ++ */ + public boolean continueExecuting() { + return !this.closestEntity.isEntityAlive() ? false : (this.theWatcher.getDistanceSqToEntity(this.closestEntity) > (double)(this.maxDistanceForPlayer * this.maxDistanceForPlayer) ? false : this.lookTime > 0); + } + ++ /** ++ * Execute a one shot task or start executing a continuous task ++ */ + public void startExecuting() { + this.lookTime = 40 + this.theWatcher.getRNG().nextInt(40); + } + ++ /** ++ * Resets the task ++ */ + public void resetTask() { + this.closestEntity = null; + } + ++ /** ++ * Updates the task ++ */ + public void updateTask() { + this.theWatcher.getLookHelper().setLookPosition(this.closestEntity.posX, this.closestEntity.posY + (double)this.closestEntity.getEyeHeight(), this.closestEntity.posZ, 10.0F, (float)this.theWatcher.getVerticalFaceSpeed()); + --this.lookTime; diff --git a/patches/net/minecraft/src/EntityAIWatchClosest2.java.patch b/patches/net/minecraft/src/EntityAIWatchClosest2.java.patch new file mode 100644 index 0000000..097ecc2 --- /dev/null +++ b/patches/net/minecraft/src/EntityAIWatchClosest2.java.patch @@ -0,0 +1,13 @@ +--- net/minecraft/src/EntityAIWatchClosest2.java ++++ net/minecraft/src/EntityAIWatchClosest2.java +@@ -1,8 +1,8 @@ + package net.minecraft.src; + + public class EntityAIWatchClosest2 extends EntityAIWatchClosest { +- public EntityAIWatchClosest2(EntityLiving var1, Class var2, float var3, float var4) { +- super(var1, var2, var3, var4); ++ public EntityAIWatchClosest2(EntityLiving par1EntityLiving, Class par2Class, float par3, float par4) { ++ super(par1EntityLiving, par2Class, par3, par4); + this.setMutexBits(3); + } + } diff --git a/patches/net/minecraft/src/EntityAgeable.java.patch b/patches/net/minecraft/src/EntityAgeable.java.patch new file mode 100644 index 0000000..12dc22d --- /dev/null +++ b/patches/net/minecraft/src/EntityAgeable.java.patch @@ -0,0 +1,188 @@ +--- net/minecraft/src/EntityAgeable.java ++++ net/minecraft/src/EntityAgeable.java +@@ -4,31 +4,39 @@ + private float field_98056_d = -1.0F; + private float field_98057_e; + +- public EntityAgeable(World var1) { +- super(var1); ++ public EntityAgeable(World par1World) { ++ super(par1World); + } + + public abstract EntityAgeable createChild(EntityAgeable var1); + +- public boolean interact(EntityPlayer var1) { +- ItemStack var2 = var1.inventory.getCurrentItem(); +- if(var2 != null && var2.itemID == Item.monsterPlacer.itemID) { +- if(!this.worldObj.isRemote) { ++ /** ++ * Called when a player interacts with a mob. e.g. gets milk from a cow, gets into the saddle on a pig. ++ */ ++ public boolean interact(EntityPlayer par1EntityPlayer) { ++ ItemStack var2 = par1EntityPlayer.inventory.getCurrentItem(); ++ ++ if (var2 != null && var2.itemID == Item.monsterPlacer.itemID) { ++ if (!this.worldObj.isRemote) { + Class var3 = EntityList.getClassFromID(var2.getItemDamage()); +- if(var3 != null && var3.isAssignableFrom(this.getClass())) { ++ ++ if (var3 != null && var3.isAssignableFrom(this.getClass())) { + EntityAgeable var4 = this.createChild(this); +- if(var4 != null) { ++ ++ if (var4 != null) { + var4.setGrowingAge(-24000); + var4.setLocationAndAngles(this.posX, this.posY, this.posZ, 0.0F, 0.0F); + this.worldObj.spawnEntityInWorld(var4); +- if(var2.hasDisplayName()) { ++ ++ if (var2.hasDisplayName()) { + var4.setCustomNameTag(var2.getDisplayName()); + } + +- if(!var1.capabilities.isCreativeMode) { ++ if (!par1EntityPlayer.capabilities.isCreativeMode) { + --var2.stackSize; +- if(var2.stackSize <= 0) { +- var1.inventory.setInventorySlotContents(var1.inventory.currentItem, (ItemStack)null); ++ ++ if (var2.stackSize <= 0) { ++ par1EntityPlayer.inventory.setInventorySlotContents(par1EntityPlayer.inventory.currentItem, (ItemStack)null); + } + } + } +@@ -46,71 +54,105 @@ + this.dataWatcher.addObject(12, new Integer(0)); + } + ++ /** ++ * The age value may be negative or positive or zero. If it's negative, it get's incremented on each tick, if it's ++ * positive, it get's decremented each tick. Don't confuse this with EntityLiving.getAge. With a negative value the ++ * Entity is considered a child. ++ */ + public int getGrowingAge() { + return this.dataWatcher.getWatchableObjectInt(12); + } + +- public void addGrowth(int var1) { ++ /** ++ * "Adds the value of the parameter times 20 to the age of this entity. If the entity is an adult (if the entity's age ++ * is greater than 0), it will have no effect." ++ */ ++ public void addGrowth(int par1) { + int var2 = this.getGrowingAge(); +- var2 += var1 * 20; +- if(var2 > 0) { ++ var2 += par1 * 20; ++ ++ if (var2 > 0) { + var2 = 0; + } + + this.setGrowingAge(var2); + } + +- public void setGrowingAge(int var1) { +- this.dataWatcher.updateObject(12, Integer.valueOf(var1)); ++ /** ++ * The age value may be negative or positive or zero. If it's negative, it get's incremented on each tick, if it's ++ * positive, it get's decremented each tick. With a negative value the Entity is considered a child. ++ */ ++ public void setGrowingAge(int par1) { ++ this.dataWatcher.updateObject(12, Integer.valueOf(par1)); + this.setScaleForAge(this.isChild()); + } + +- public void writeEntityToNBT(NBTTagCompound var1) { +- super.writeEntityToNBT(var1); +- var1.setInteger("Age", this.getGrowingAge()); +- } +- +- public void readEntityFromNBT(NBTTagCompound var1) { +- super.readEntityFromNBT(var1); +- this.setGrowingAge(var1.getInteger("Age")); +- } +- ++ /** ++ * (abstract) Protected helper method to write subclass entity data to NBT. ++ */ ++ public void writeEntityToNBT(NBTTagCompound par1NBTTagCompound) { ++ super.writeEntityToNBT(par1NBTTagCompound); ++ par1NBTTagCompound.setInteger("Age", this.getGrowingAge()); ++ } ++ ++ /** ++ * (abstract) Protected helper method to read subclass entity data from NBT. ++ */ ++ public void readEntityFromNBT(NBTTagCompound par1NBTTagCompound) { ++ super.readEntityFromNBT(par1NBTTagCompound); ++ this.setGrowingAge(par1NBTTagCompound.getInteger("Age")); ++ } ++ ++ /** ++ * Called frequently so the entity can update its state every tick as required. For example, zombies and skeletons use ++ * this to react to sunlight and start to burn. ++ */ + public void onLivingUpdate() { + super.onLivingUpdate(); +- if(this.worldObj.isRemote) { ++ ++ if (this.worldObj.isRemote) { + this.setScaleForAge(this.isChild()); + } else { + int var1 = this.getGrowingAge(); +- if(var1 < 0) { ++ ++ if (var1 < 0) { + ++var1; + this.setGrowingAge(var1); +- } else if(var1 > 0) { ++ } else if (var1 > 0) { + --var1; + this.setGrowingAge(var1); + } + } +- + } + ++ /** ++ * If Animal, checks if the age timer is negative ++ */ + public boolean isChild() { + return this.getGrowingAge() < 0; + } + +- public void setScaleForAge(boolean var1) { +- this.setScale(var1 ? 0.5F : 1.0F); ++ /** ++ * "Sets the scale for an ageable entity according to the boolean parameter, which says if it's a child." ++ */ ++ public void setScaleForAge(boolean par1) { ++ this.setScale(par1 ? 0.5F : 1.0F); + } + +- protected final void setSize(float var1, float var2) { ++ /** ++ * Sets the width and height of the entity. Args: width, height ++ */ ++ protected final void setSize(float par1, float par2) { + boolean var3 = this.field_98056_d > 0.0F; +- this.field_98056_d = var1; +- this.field_98057_e = var2; +- if(!var3) { ++ this.field_98056_d = par1; ++ this.field_98057_e = par2; ++ ++ if (!var3) { + this.setScale(1.0F); + } +- + } + +- protected final void setScale(float var1) { +- super.setSize(this.field_98056_d * var1, this.field_98057_e * var1); ++ protected final void setScale(float par1) { ++ super.setSize(this.field_98056_d * par1, this.field_98057_e * par1); + } + } diff --git a/patches/net/minecraft/src/EntityAmbientCreature.java.patch b/patches/net/minecraft/src/EntityAmbientCreature.java.patch new file mode 100644 index 0000000..a7063fe --- /dev/null +++ b/patches/net/minecraft/src/EntityAmbientCreature.java.patch @@ -0,0 +1,24 @@ +--- net/minecraft/src/EntityAmbientCreature.java ++++ net/minecraft/src/EntityAmbientCreature.java +@@ -1,15 +1,18 @@ + package net.minecraft.src; + + public abstract class EntityAmbientCreature extends EntityLiving implements IAnimals { +- public EntityAmbientCreature(World var1) { +- super(var1); ++ public EntityAmbientCreature(World par1World) { ++ super(par1World); + } + + public boolean allowLeashing() { + return false; + } + +- protected boolean interact(EntityPlayer var1) { ++ /** ++ * Called when a player interacts with a mob. e.g. gets milk from a cow, gets into the saddle on a pig. ++ */ ++ protected boolean interact(EntityPlayer par1EntityPlayer) { + return false; + } + } diff --git a/patches/net/minecraft/src/EntityAnimal.java.patch b/patches/net/minecraft/src/EntityAnimal.java.patch new file mode 100644 index 0000000..6b93919 --- /dev/null +++ b/patches/net/minecraft/src/EntityAnimal.java.patch @@ -0,0 +1,420 @@ +--- net/minecraft/src/EntityAnimal.java ++++ net/minecraft/src/EntityAnimal.java +@@ -4,75 +4,94 @@ + + public abstract class EntityAnimal extends EntityAgeable implements IAnimals { + private int inLove; ++ ++ /** ++ * This is representation of a counter for reproduction progress. (Note that this is different from the inLove which ++ * represent being in Love-Mode) ++ */ + private int breeding; + +- public EntityAnimal(World var1) { +- super(var1); ++ public EntityAnimal(World par1World) { ++ super(par1World); + } + ++ /** ++ * main AI tick function, replaces updateEntityActionState ++ */ + protected void updateAITick() { +- if(this.getGrowingAge() != 0) { ++ if (this.getGrowingAge() != 0) { + this.inLove = 0; + } + + super.updateAITick(); + } + ++ /** ++ * Called frequently so the entity can update its state every tick as required. For example, zombies and skeletons use ++ * this to react to sunlight and start to burn. ++ */ + public void onLivingUpdate() { + super.onLivingUpdate(); +- if(this.getGrowingAge() != 0) { ++ ++ if (this.getGrowingAge() != 0) { + this.inLove = 0; + } + +- if(this.inLove > 0) { ++ if (this.inLove > 0) { + --this.inLove; + String var1 = "heart"; +- if(this.inLove % 10 == 0) { +- double var2 = this.ab.nextGaussian() * 0.02D; +- double var4 = this.ab.nextGaussian() * 0.02D; +- double var6 = this.ab.nextGaussian() * 0.02D; +- this.worldObj.spawnParticle(var1, this.posX + (double)(this.ab.nextFloat() * this.width * 2.0F) - (double)this.width, this.posY + 0.5D + (double)(this.ab.nextFloat() * this.height), this.posZ + (double)(this.ab.nextFloat() * this.width * 2.0F) - (double)this.width, var2, var4, var6); ++ ++ if (this.inLove % 10 == 0) { ++ double var2 = this.rand.nextGaussian() * 0.02D; ++ double var4 = this.rand.nextGaussian() * 0.02D; ++ double var6 = this.rand.nextGaussian() * 0.02D; ++ this.worldObj.spawnParticle(var1, this.posX + (double)(this.rand.nextFloat() * this.width * 2.0F) - (double)this.width, this.posY + 0.5D + (double)(this.rand.nextFloat() * this.height), this.posZ + (double)(this.rand.nextFloat() * this.width * 2.0F) - (double)this.width, var2, var4, var6); + } + } else { + this.breeding = 0; + } +- + } + +- protected void attackEntity(Entity var1, float var2) { +- if(var1 instanceof EntityPlayer) { +- if(var2 < 3.0F) { +- double var3 = var1.posX - this.posX; +- double var5 = var1.posZ - this.posZ; +- this.rotationYaw = (float)(Math.atan2(var5, var3) * 180.0D / (double)((float)Math.PI)) - 90.0F; ++ /** ++ * Basic mob attack. Default to touch of death in EntityCreature. Overridden by each mob to define their attack. ++ */ ++ protected void attackEntity(Entity par1Entity, float par2) { ++ if (par1Entity instanceof EntityPlayer) { ++ if (par2 < 3.0F) { ++ double var3 = par1Entity.posX - this.posX; ++ double var5 = par1Entity.posZ - this.posZ; ++ this.rotationYaw = (float)(Math.atan2(var5, var3) * 180.0D / Math.PI) - 90.0F; + this.hasAttacked = true; + } + +- EntityPlayer var7 = (EntityPlayer)var1; +- if(var7.getCurrentEquippedItem() == null || !this.isBreedingItem(var7.getCurrentEquippedItem())) { ++ EntityPlayer var7 = (EntityPlayer)par1Entity; ++ ++ if (var7.getCurrentEquippedItem() == null || !this.isBreedingItem(var7.getCurrentEquippedItem())) { + this.entityToAttack = null; + } +- } else if(var1 instanceof EntityAnimal) { +- EntityAnimal var8 = (EntityAnimal)var1; +- if(this.getGrowingAge() > 0 && var8.getGrowingAge() < 0) { +- if((double)var2 < 2.5D) { ++ } else if (par1Entity instanceof EntityAnimal) { ++ EntityAnimal var8 = (EntityAnimal)par1Entity; ++ ++ if (this.getGrowingAge() > 0 && var8.getGrowingAge() < 0) { ++ if ((double)par2 < 2.5D) { + this.hasAttacked = true; + } +- } else if(this.inLove > 0 && var8.inLove > 0) { +- if(var8.entityToAttack == null) { ++ } else if (this.inLove > 0 && var8.inLove > 0) { ++ if (var8.entityToAttack == null) { + var8.entityToAttack = this; + } + +- if(var8.entityToAttack == this && (double)var2 < 3.5D) { ++ if (var8.entityToAttack == this && (double)par2 < 3.5D) { + ++var8.inLove; + ++this.inLove; + ++this.breeding; +- if(this.breeding % 4 == 0) { +- this.worldObj.spawnParticle("heart", this.posX + (double)(this.ab.nextFloat() * this.width * 2.0F) - (double)this.width, this.posY + 0.5D + (double)(this.ab.nextFloat() * this.height), this.posZ + (double)(this.ab.nextFloat() * this.width * 2.0F) - (double)this.width, 0.0D, 0.0D, 0.0D); ++ ++ if (this.breeding % 4 == 0) { ++ this.worldObj.spawnParticle("heart", this.posX + (double)(this.rand.nextFloat() * this.width * 2.0F) - (double)this.width, this.posY + 0.5D + (double)(this.rand.nextFloat() * this.height), this.posZ + (double)(this.rand.nextFloat() * this.width * 2.0F) - (double)this.width, 0.0D, 0.0D, 0.0D); + } + +- if(this.breeding == 60) { +- this.procreate((EntityAnimal)var1); ++ if (this.breeding == 60) { ++ this.procreate((EntityAnimal)par1Entity); + } + } else { + this.breeding = 0; +@@ -82,99 +101,124 @@ + this.entityToAttack = null; + } + } +- + } + +- private void procreate(EntityAnimal var1) { +- EntityAgeable var2 = this.createChild(var1); +- if(var2 != null) { ++ /** ++ * Creates a baby animal according to the animal type of the target at the actual position and spawns 'love' particles. ++ */ ++ private void procreate(EntityAnimal par1EntityAnimal) { ++ EntityAgeable var2 = this.createChild(par1EntityAnimal); ++ ++ if (var2 != null) { + this.setGrowingAge(6000); +- var1.setGrowingAge(6000); ++ par1EntityAnimal.setGrowingAge(6000); + this.inLove = 0; + this.breeding = 0; + this.entityToAttack = null; +- var1.entityToAttack = null; +- var1.breeding = 0; +- var1.inLove = 0; ++ par1EntityAnimal.entityToAttack = null; ++ par1EntityAnimal.breeding = 0; ++ par1EntityAnimal.inLove = 0; + var2.setGrowingAge(-24000); + var2.setLocationAndAngles(this.posX, this.posY, this.posZ, this.rotationYaw, this.rotationPitch); + +- for(int var3 = 0; var3 < 7; ++var3) { +- double var4 = this.ab.nextGaussian() * 0.02D; +- double var6 = this.ab.nextGaussian() * 0.02D; +- double var8 = this.ab.nextGaussian() * 0.02D; +- this.worldObj.spawnParticle("heart", this.posX + (double)(this.ab.nextFloat() * this.width * 2.0F) - (double)this.width, this.posY + 0.5D + (double)(this.ab.nextFloat() * this.height), this.posZ + (double)(this.ab.nextFloat() * this.width * 2.0F) - (double)this.width, var4, var6, var8); ++ for (int var3 = 0; var3 < 7; ++var3) { ++ double var4 = this.rand.nextGaussian() * 0.02D; ++ double var6 = this.rand.nextGaussian() * 0.02D; ++ double var8 = this.rand.nextGaussian() * 0.02D; ++ this.worldObj.spawnParticle("heart", this.posX + (double)(this.rand.nextFloat() * this.width * 2.0F) - (double)this.width, this.posY + 0.5D + (double)(this.rand.nextFloat() * this.height), this.posZ + (double)(this.rand.nextFloat() * this.width * 2.0F) - (double)this.width, var4, var6, var8); + } + + this.worldObj.spawnEntityInWorld(var2); + } +- + } + +- public boolean attackEntityFrom(DamageSource var1, float var2) { +- if(this.isEntityInvulnerable()) { ++ /** ++ * Called when the entity is attacked. ++ */ ++ public boolean attackEntityFrom(DamageSource par1DamageSource, float par2) { ++ if (this.isEntityInvulnerable()) { + return false; + } else { + this.fleeingTick = 60; +- if(!this.isAIEnabled()) { ++ ++ if (!this.isAIEnabled()) { + AttributeInstance var3 = this.getEntityAttribute(SharedMonsterAttributes.movementSpeed); +- if(var3.getModifier(h) == null) { ++ ++ if (var3.getModifier(field_110179_h) == null) { + var3.applyModifier(field_110181_i); + } + } + + this.entityToAttack = null; + this.inLove = 0; +- return super.attackEntityFrom(var1, var2); ++ return super.attackEntityFrom(par1DamageSource, par2); + } + } + +- public float getBlockPathWeight(int var1, int var2, int var3) { +- return this.worldObj.getBlockId(var1, var2 - 1, var3) == Block.grass.blockID ? 10.0F : this.worldObj.getLightBrightness(var1, var2, var3) - 0.5F; +- } +- +- public void writeEntityToNBT(NBTTagCompound var1) { +- super.writeEntityToNBT(var1); +- var1.setInteger("InLove", this.inLove); +- } +- +- public void readEntityFromNBT(NBTTagCompound var1) { +- super.readEntityFromNBT(var1); +- this.inLove = var1.getInteger("InLove"); +- } +- ++ /** ++ * Takes a coordinate in and returns a weight to determine how likely this creature will try to path to the block. ++ * Args: x, y, z ++ */ ++ public float getBlockPathWeight(int par1, int par2, int par3) { ++ return this.worldObj.getBlockId(par1, par2 - 1, par3) == Block.grass.blockID ? 10.0F : this.worldObj.getLightBrightness(par1, par2, par3) - 0.5F; ++ } ++ ++ /** ++ * (abstract) Protected helper method to write subclass entity data to NBT. ++ */ ++ public void writeEntityToNBT(NBTTagCompound par1NBTTagCompound) { ++ super.writeEntityToNBT(par1NBTTagCompound); ++ par1NBTTagCompound.setInteger("InLove", this.inLove); ++ } ++ ++ /** ++ * (abstract) Protected helper method to read subclass entity data from NBT. ++ */ ++ public void readEntityFromNBT(NBTTagCompound par1NBTTagCompound) { ++ super.readEntityFromNBT(par1NBTTagCompound); ++ this.inLove = par1NBTTagCompound.getInteger("InLove"); ++ } ++ ++ /** ++ * Finds the closest player within 16 blocks to attack, or null if this Entity isn't interested in attacking (Animals, ++ * Spiders at day, peaceful PigZombies). ++ */ + protected Entity findPlayerToAttack() { +- if(this.fleeingTick > 0) { ++ if (this.fleeingTick > 0) { + return null; + } else { + float var1 = 8.0F; + List var2; + int var3; + EntityAnimal var4; +- if(this.inLove > 0) { ++ ++ if (this.inLove > 0) { + var2 = this.worldObj.getEntitiesWithinAABB(this.getClass(), this.boundingBox.expand((double)var1, (double)var1, (double)var1)); + +- for(var3 = 0; var3 < var2.size(); ++var3) { ++ for (var3 = 0; var3 < var2.size(); ++var3) { + var4 = (EntityAnimal)var2.get(var3); +- if(var4 != this && var4.inLove > 0) { ++ ++ if (var4 != this && var4.inLove > 0) { + return var4; + } + } +- } else if(this.getGrowingAge() == 0) { ++ } else if (this.getGrowingAge() == 0) { + var2 = this.worldObj.getEntitiesWithinAABB(EntityPlayer.class, this.boundingBox.expand((double)var1, (double)var1, (double)var1)); + +- for(var3 = 0; var3 < var2.size(); ++var3) { ++ for (var3 = 0; var3 < var2.size(); ++var3) { + EntityPlayer var5 = (EntityPlayer)var2.get(var3); +- if(var5.getCurrentEquippedItem() != null && this.isBreedingItem(var5.getCurrentEquippedItem())) { ++ ++ if (var5.getCurrentEquippedItem() != null && this.isBreedingItem(var5.getCurrentEquippedItem())) { + return var5; + } + } +- } else if(this.getGrowingAge() > 0) { ++ } else if (this.getGrowingAge() > 0) { + var2 = this.worldObj.getEntitiesWithinAABB(this.getClass(), this.boundingBox.expand((double)var1, (double)var1, (double)var1)); + +- for(var3 = 0; var3 < var2.size(); ++var3) { ++ for (var3 = 0; var3 < var2.size(); ++var3) { + var4 = (EntityAnimal)var2.get(var3); +- if(var4 != this && var4.getGrowingAge() < 0) { ++ ++ if (var4 != this && var4.getGrowingAge() < 0) { + return var4; + } + } +@@ -184,6 +228,9 @@ + } + } + ++ /** ++ * Checks if the entity's current position is a valid location to spawn this entity. ++ */ + public boolean getCanSpawnHere() { + int var1 = MathHelper.floor_double(this.posX); + int var2 = MathHelper.floor_double(this.boundingBox.minY); +@@ -191,36 +238,54 @@ + return this.worldObj.getBlockId(var1, var2 - 1, var3) == Block.grass.blockID && this.worldObj.getFullBlockLightValue(var1, var2, var3) > 8 && super.getCanSpawnHere(); + } + ++ /** ++ * Get number of ticks, at least during which the living entity will be silent. ++ */ + public int getTalkInterval() { + return 120; + } + ++ /** ++ * Determines if an entity can be despawned, used on idle far away entities ++ */ + protected boolean canDespawn() { + return false; + } + +- protected int getExperiencePoints(EntityPlayer var1) { +- return 1 + this.worldObj.s.nextInt(3); +- } +- +- public boolean isBreedingItem(ItemStack var1) { +- return var1.itemID == Item.wheat.itemID; +- } +- +- public boolean interact(EntityPlayer var1) { +- ItemStack var2 = var1.inventory.getCurrentItem(); +- if(var2 != null && this.isBreedingItem(var2) && this.getGrowingAge() == 0 && this.inLove <= 0) { +- if(!var1.capabilities.isCreativeMode) { ++ /** ++ * Get the experience points the entity currently has. ++ */ ++ protected int getExperiencePoints(EntityPlayer par1EntityPlayer) { ++ return 1 + this.worldObj.rand.nextInt(3); ++ } ++ ++ /** ++ * Checks if the parameter is an item which this animal can be fed to breed it (wheat, carrots or seeds depending on ++ * the animal type) ++ */ ++ public boolean isBreedingItem(ItemStack par1ItemStack) { ++ return par1ItemStack.itemID == Item.wheat.itemID; ++ } ++ ++ /** ++ * Called when a player interacts with a mob. e.g. gets milk from a cow, gets into the saddle on a pig. ++ */ ++ public boolean interact(EntityPlayer par1EntityPlayer) { ++ ItemStack var2 = par1EntityPlayer.inventory.getCurrentItem(); ++ ++ if (var2 != null && this.isBreedingItem(var2) && this.getGrowingAge() == 0 && this.inLove <= 0) { ++ if (!par1EntityPlayer.capabilities.isCreativeMode) { + --var2.stackSize; +- if(var2.stackSize <= 0) { +- var1.inventory.setInventorySlotContents(var1.inventory.currentItem, (ItemStack)null); ++ ++ if (var2.stackSize <= 0) { ++ par1EntityPlayer.inventory.setInventorySlotContents(par1EntityPlayer.inventory.currentItem, (ItemStack)null); + } + } + + this.func_110196_bT(); + return true; + } else { +- return super.interact(var1); ++ return super.interact(par1EntityPlayer); + } + } + +@@ -230,6 +295,9 @@ + this.worldObj.setEntityState(this, (byte)18); + } + ++ /** ++ * Returns if the entity is currently in 'love mode'. ++ */ + public boolean isInLove() { + return this.inLove > 0; + } +@@ -238,21 +306,23 @@ + this.inLove = 0; + } + +- public boolean canMateWith(EntityAnimal var1) { +- return var1 == this ? false : (var1.getClass() != this.getClass() ? false : this.isInLove() && var1.isInLove()); ++ /** ++ * Returns true if the mob is currently able to mate with the specified mob. ++ */ ++ public boolean canMateWith(EntityAnimal par1EntityAnimal) { ++ return par1EntityAnimal == this ? false : (par1EntityAnimal.getClass() != this.getClass() ? false : this.isInLove() && par1EntityAnimal.isInLove()); + } + +- public void handleHealthUpdate(byte var1) { +- if(var1 == 18) { +- for(int var2 = 0; var2 < 7; ++var2) { +- double var3 = this.ab.nextGaussian() * 0.02D; +- double var5 = this.ab.nextGaussian() * 0.02D; +- double var7 = this.ab.nextGaussian() * 0.02D; +- this.worldObj.spawnParticle("heart", this.posX + (double)(this.ab.nextFloat() * this.width * 2.0F) - (double)this.width, this.posY + 0.5D + (double)(this.ab.nextFloat() * this.height), this.posZ + (double)(this.ab.nextFloat() * this.width * 2.0F) - (double)this.width, var3, var5, var7); ++ public void handleHealthUpdate(byte par1) { ++ if (par1 == 18) { ++ for (int var2 = 0; var2 < 7; ++var2) { ++ double var3 = this.rand.nextGaussian() * 0.02D; ++ double var5 = this.rand.nextGaussian() * 0.02D; ++ double var7 = this.rand.nextGaussian() * 0.02D; ++ this.worldObj.spawnParticle("heart", this.posX + (double)(this.rand.nextFloat() * this.width * 2.0F) - (double)this.width, this.posY + 0.5D + (double)(this.rand.nextFloat() * this.height), this.posZ + (double)(this.rand.nextFloat() * this.width * 2.0F) - (double)this.width, var3, var5, var7); + } + } else { +- super.handleHealthUpdate(var1); ++ super.handleHealthUpdate(par1); + } +- + } + } diff --git a/patches/net/minecraft/src/EntityArrow.java.patch b/patches/net/minecraft/src/EntityArrow.java.patch new file mode 100644 index 0000000..20afef7 --- /dev/null +++ b/patches/net/minecraft/src/EntityArrow.java.patch @@ -0,0 +1,622 @@ +--- net/minecraft/src/EntityArrow.java ++++ net/minecraft/src/EntityArrow.java +@@ -9,154 +9,182 @@ + private int inTile; + private int inData; + private boolean inGround; ++ ++ /** 1 if the player can pick up the arrow */ + public int canBePickedUp; ++ ++ /** Seems to be some sort of timer for animating an arrow. */ + public int arrowShake; ++ ++ /** The owner of this arrow. */ + public Entity shootingEntity; + private int ticksInGround; + private int ticksInAir; + private double damage = 2.0D; ++ ++ /** The amount of knockback an arrow applies when it hits a mob. */ + private int knockbackStrength; + +- public EntityArrow(World var1) { +- super(var1); ++ public EntityArrow(World par1World) { ++ super(par1World); + this.renderDistanceWeight = 10.0D; + this.setSize(0.5F, 0.5F); + } + +- public EntityArrow(World var1, double var2, double var4, double var6) { +- super(var1); ++ public EntityArrow(World par1World, double par2, double par4, double par6) { ++ super(par1World); + this.renderDistanceWeight = 10.0D; + this.setSize(0.5F, 0.5F); +- this.setPosition(var2, var4, var6); ++ this.setPosition(par2, par4, par6); + this.yOffset = 0.0F; + } + +- public EntityArrow(World var1, EntityLivingBase var2, EntityLivingBase var3, float var4, float var5) { +- super(var1); ++ public EntityArrow(World par1World, EntityLivingBase par2EntityLivingBase, EntityLivingBase par3EntityLivingBase, float par4, float par5) { ++ super(par1World); + this.renderDistanceWeight = 10.0D; +- this.shootingEntity = var2; +- if(var2 instanceof EntityPlayer) { ++ this.shootingEntity = par2EntityLivingBase; ++ ++ if (par2EntityLivingBase instanceof EntityPlayer) { + this.canBePickedUp = 1; + } + +- this.posY = var2.posY + (double)var2.getEyeHeight() - (double)0.1F; +- double var6 = var3.posX - var2.posX; +- double var8 = var3.boundingBox.minY + (double)(var3.height / 3.0F) - this.posY; +- double var10 = var3.posZ - var2.posZ; ++ this.posY = par2EntityLivingBase.posY + (double)par2EntityLivingBase.getEyeHeight() - 0.10000000149011612D; ++ double var6 = par3EntityLivingBase.posX - par2EntityLivingBase.posX; ++ double var8 = par3EntityLivingBase.boundingBox.minY + (double)(par3EntityLivingBase.height / 3.0F) - this.posY; ++ double var10 = par3EntityLivingBase.posZ - par2EntityLivingBase.posZ; + double var12 = (double)MathHelper.sqrt_double(var6 * var6 + var10 * var10); +- if(var12 >= 1.0E-7D) { +- float var14 = (float)(Math.atan2(var10, var6) * 180.0D / (double)((float)Math.PI)) - 90.0F; +- float var15 = (float)(-(Math.atan2(var8, var12) * 180.0D / (double)((float)Math.PI))); ++ ++ if (var12 >= 1.0E-7D) { ++ float var14 = (float)(Math.atan2(var10, var6) * 180.0D / Math.PI) - 90.0F; ++ float var15 = (float)(-(Math.atan2(var8, var12) * 180.0D / Math.PI)); + double var16 = var6 / var12; + double var18 = var10 / var12; +- this.setLocationAndAngles(var2.posX + var16, this.posY, var2.posZ + var18, var14, var15); ++ this.setLocationAndAngles(par2EntityLivingBase.posX + var16, this.posY, par2EntityLivingBase.posZ + var18, var14, var15); + this.yOffset = 0.0F; + float var20 = (float)var12 * 0.2F; +- this.setThrowableHeading(var6, var8 + (double)var20, var10, var4, var5); ++ this.setThrowableHeading(var6, var8 + (double)var20, var10, par4, par5); + } + } + +- public EntityArrow(World var1, EntityLivingBase var2, float var3) { +- super(var1); ++ public EntityArrow(World par1World, EntityLivingBase par2EntityLivingBase, float par3) { ++ super(par1World); + this.renderDistanceWeight = 10.0D; +- this.shootingEntity = var2; +- if(var2 instanceof EntityPlayer) { ++ this.shootingEntity = par2EntityLivingBase; ++ ++ if (par2EntityLivingBase instanceof EntityPlayer) { + this.canBePickedUp = 1; + } + + this.setSize(0.5F, 0.5F); +- this.setLocationAndAngles(var2.posX, var2.posY + (double)var2.getEyeHeight(), var2.posZ, var2.rotationYaw, var2.rotationPitch); ++ this.setLocationAndAngles(par2EntityLivingBase.posX, par2EntityLivingBase.posY + (double)par2EntityLivingBase.getEyeHeight(), par2EntityLivingBase.posZ, par2EntityLivingBase.rotationYaw, par2EntityLivingBase.rotationPitch); + this.posX -= (double)(MathHelper.cos(this.rotationYaw / 180.0F * (float)Math.PI) * 0.16F); +- this.posY -= (double)0.1F; ++ this.posY -= 0.10000000149011612D; + this.posZ -= (double)(MathHelper.sin(this.rotationYaw / 180.0F * (float)Math.PI) * 0.16F); + this.setPosition(this.posX, this.posY, this.posZ); + this.yOffset = 0.0F; + this.motionX = (double)(-MathHelper.sin(this.rotationYaw / 180.0F * (float)Math.PI) * MathHelper.cos(this.rotationPitch / 180.0F * (float)Math.PI)); + this.motionZ = (double)(MathHelper.cos(this.rotationYaw / 180.0F * (float)Math.PI) * MathHelper.cos(this.rotationPitch / 180.0F * (float)Math.PI)); + this.motionY = (double)(-MathHelper.sin(this.rotationPitch / 180.0F * (float)Math.PI)); +- this.setThrowableHeading(this.motionX, this.motionY, this.motionZ, var3 * 1.5F, 1.0F); ++ this.setThrowableHeading(this.motionX, this.motionY, this.motionZ, par3 * 1.5F, 1.0F); + } + + protected void entityInit() { + this.dataWatcher.addObject(16, Byte.valueOf((byte)0)); + } + +- public void setThrowableHeading(double var1, double var3, double var5, float var7, float var8) { +- float var9 = MathHelper.sqrt_double(var1 * var1 + var3 * var3 + var5 * var5); +- var1 /= (double)var9; +- var3 /= (double)var9; +- var5 /= (double)var9; +- var1 += this.ab.nextGaussian() * (double)(this.ab.nextBoolean() ? -1 : 1) * (double)0.0075F * (double)var8; +- var3 += this.ab.nextGaussian() * (double)(this.ab.nextBoolean() ? -1 : 1) * (double)0.0075F * (double)var8; +- var5 += this.ab.nextGaussian() * (double)(this.ab.nextBoolean() ? -1 : 1) * (double)0.0075F * (double)var8; +- var1 *= (double)var7; +- var3 *= (double)var7; +- var5 *= (double)var7; +- this.motionX = var1; +- this.motionY = var3; +- this.motionZ = var5; +- float var10 = MathHelper.sqrt_double(var1 * var1 + var5 * var5); +- this.prevRotationYaw = this.rotationYaw = (float)(Math.atan2(var1, var5) * 180.0D / (double)((float)Math.PI)); +- this.prevRotationPitch = this.rotationPitch = (float)(Math.atan2(var3, (double)var10) * 180.0D / (double)((float)Math.PI)); ++ /** ++ * Similar to setArrowHeading, it's point the throwable entity to a x, y, z direction. ++ */ ++ public void setThrowableHeading(double par1, double par3, double par5, float par7, float par8) { ++ float var9 = MathHelper.sqrt_double(par1 * par1 + par3 * par3 + par5 * par5); ++ par1 /= (double)var9; ++ par3 /= (double)var9; ++ par5 /= (double)var9; ++ par1 += this.rand.nextGaussian() * (double)(this.rand.nextBoolean() ? -1 : 1) * 0.007499999832361937D * (double)par8; ++ par3 += this.rand.nextGaussian() * (double)(this.rand.nextBoolean() ? -1 : 1) * 0.007499999832361937D * (double)par8; ++ par5 += this.rand.nextGaussian() * (double)(this.rand.nextBoolean() ? -1 : 1) * 0.007499999832361937D * (double)par8; ++ par1 *= (double)par7; ++ par3 *= (double)par7; ++ par5 *= (double)par7; ++ this.motionX = par1; ++ this.motionY = par3; ++ this.motionZ = par5; ++ float var10 = MathHelper.sqrt_double(par1 * par1 + par5 * par5); ++ this.prevRotationYaw = this.rotationYaw = (float)(Math.atan2(par1, par5) * 180.0D / Math.PI); ++ this.prevRotationPitch = this.rotationPitch = (float)(Math.atan2(par3, (double)var10) * 180.0D / Math.PI); + this.ticksInGround = 0; + } + +- public void setPositionAndRotation2(double var1, double var3, double var5, float var7, float var8, int var9) { +- this.setPosition(var1, var3, var5); +- this.setRotation(var7, var8); ++ /** ++ * Sets the position and rotation. Only difference from the other one is no bounding on the rotation. Args: posX, posY, ++ * posZ, yaw, pitch ++ */ ++ public void setPositionAndRotation2(double par1, double par3, double par5, float par7, float par8, int par9) { ++ this.setPosition(par1, par3, par5); ++ this.setRotation(par7, par8); + } + +- public void setVelocity(double var1, double var3, double var5) { +- this.motionX = var1; +- this.motionY = var3; +- this.motionZ = var5; +- if(this.prevRotationPitch == 0.0F && this.prevRotationYaw == 0.0F) { +- float var7 = MathHelper.sqrt_double(var1 * var1 + var5 * var5); +- this.prevRotationYaw = this.rotationYaw = (float)(Math.atan2(var1, var5) * 180.0D / (double)((float)Math.PI)); +- this.prevRotationPitch = this.rotationPitch = (float)(Math.atan2(var3, (double)var7) * 180.0D / (double)((float)Math.PI)); ++ /** ++ * Sets the velocity to the args. Args: x, y, z ++ */ ++ public void setVelocity(double par1, double par3, double par5) { ++ this.motionX = par1; ++ this.motionY = par3; ++ this.motionZ = par5; ++ ++ if (this.prevRotationPitch == 0.0F && this.prevRotationYaw == 0.0F) { ++ float var7 = MathHelper.sqrt_double(par1 * par1 + par5 * par5); ++ this.prevRotationYaw = this.rotationYaw = (float)(Math.atan2(par1, par5) * 180.0D / Math.PI); ++ this.prevRotationPitch = this.rotationPitch = (float)(Math.atan2(par3, (double)var7) * 180.0D / Math.PI); + this.prevRotationPitch = this.rotationPitch; + this.prevRotationYaw = this.rotationYaw; + this.setLocationAndAngles(this.posX, this.posY, this.posZ, this.rotationYaw, this.rotationPitch); + this.ticksInGround = 0; + } +- + } + ++ /** ++ * Called to update the entity's position/logic. ++ */ + public void onUpdate() { + super.onUpdate(); +- if(this.prevRotationPitch == 0.0F && this.prevRotationYaw == 0.0F) { ++ ++ if (this.prevRotationPitch == 0.0F && this.prevRotationYaw == 0.0F) { + float var1 = MathHelper.sqrt_double(this.motionX * this.motionX + this.motionZ * this.motionZ); +- this.prevRotationYaw = this.rotationYaw = (float)(Math.atan2(this.motionX, this.motionZ) * 180.0D / (double)((float)Math.PI)); +- this.prevRotationPitch = this.rotationPitch = (float)(Math.atan2(this.motionY, (double)var1) * 180.0D / (double)((float)Math.PI)); ++ this.prevRotationYaw = this.rotationYaw = (float)(Math.atan2(this.motionX, this.motionZ) * 180.0D / Math.PI); ++ this.prevRotationPitch = this.rotationPitch = (float)(Math.atan2(this.motionY, (double)var1) * 180.0D / Math.PI); + } + + int var16 = this.worldObj.getBlockId(this.xTile, this.yTile, this.zTile); +- if(var16 > 0) { ++ ++ if (var16 > 0) { + Block.blocksList[var16].setBlockBoundsBasedOnState(this.worldObj, this.xTile, this.yTile, this.zTile); + AxisAlignedBB var2 = Block.blocksList[var16].getCollisionBoundingBoxFromPool(this.worldObj, this.xTile, this.yTile, this.zTile); +- if(var2 != null && var2.isVecInside(this.worldObj.getWorldVec3Pool().getVecFromPool(this.posX, this.posY, this.posZ))) { ++ ++ if (var2 != null && var2.isVecInside(this.worldObj.getWorldVec3Pool().getVecFromPool(this.posX, this.posY, this.posZ))) { + this.inGround = true; + } + } + +- if(this.arrowShake > 0) { ++ if (this.arrowShake > 0) { + --this.arrowShake; + } + +- if(this.inGround) { ++ if (this.inGround) { + int var18 = this.worldObj.getBlockId(this.xTile, this.yTile, this.zTile); + int var19 = this.worldObj.getBlockMetadata(this.xTile, this.yTile, this.zTile); +- if(var18 == this.inTile && var19 == this.inData) { ++ ++ if (var18 == this.inTile && var19 == this.inData) { + ++this.ticksInGround; +- if(this.ticksInGround == 1200) { ++ ++ if (this.ticksInGround == 1200) { + this.setDead(); + } +- + } else { + this.inGround = false; +- this.motionX *= (double)(this.ab.nextFloat() * 0.2F); +- this.motionY *= (double)(this.ab.nextFloat() * 0.2F); +- this.motionZ *= (double)(this.ab.nextFloat() * 0.2F); ++ this.motionX *= (double)(this.rand.nextFloat() * 0.2F); ++ this.motionY *= (double)(this.rand.nextFloat() * 0.2F); ++ this.motionZ *= (double)(this.rand.nextFloat() * 0.2F); + this.ticksInGround = 0; + this.ticksInAir = 0; + } +@@ -164,28 +192,32 @@ + ++this.ticksInAir; + Vec3 var17 = this.worldObj.getWorldVec3Pool().getVecFromPool(this.posX, this.posY, this.posZ); + Vec3 var3 = this.worldObj.getWorldVec3Pool().getVecFromPool(this.posX + this.motionX, this.posY + this.motionY, this.posZ + this.motionZ); +- MovingObjectPosition var4 = this.worldObj.rayTraceBlocks(var17, var3, false, true); ++ MovingObjectPosition var4 = this.worldObj.rayTraceBlocks_do_do(var17, var3, false, true); + var17 = this.worldObj.getWorldVec3Pool().getVecFromPool(this.posX, this.posY, this.posZ); + var3 = this.worldObj.getWorldVec3Pool().getVecFromPool(this.posX + this.motionX, this.posY + this.motionY, this.posZ + this.motionZ); +- if(var4 != null) { ++ ++ if (var4 != null) { + var3 = this.worldObj.getWorldVec3Pool().getVecFromPool(var4.hitVec.xCoord, var4.hitVec.yCoord, var4.hitVec.zCoord); + } + + Entity var5 = null; + List var6 = this.worldObj.getEntitiesWithinAABBExcludingEntity(this, this.boundingBox.addCoord(this.motionX, this.motionY, this.motionZ).expand(1.0D, 1.0D, 1.0D)); + double var7 = 0.0D; +- + int var9; + float var11; +- for(var9 = 0; var9 < var6.size(); ++var9) { ++ ++ for (var9 = 0; var9 < var6.size(); ++var9) { + Entity var10 = (Entity)var6.get(var9); +- if(var10.canBeCollidedWith() && (var10 != this.shootingEntity || this.ticksInAir >= 5)) { ++ ++ if (var10.canBeCollidedWith() && (var10 != this.shootingEntity || this.ticksInAir >= 5)) { + var11 = 0.3F; + AxisAlignedBB var12 = var10.boundingBox.expand((double)var11, (double)var11, (double)var11); + MovingObjectPosition var13 = var12.calculateIntercept(var17, var3); +- if(var13 != null) { ++ ++ if (var13 != null) { + double var14 = var17.distanceTo(var13.hitVec); +- if(var14 < var7 || var7 == 0.0D) { ++ ++ if (var14 < var7 || var7 == 0.0D) { + var5 = var10; + var7 = var14; + } +@@ -193,69 +225,76 @@ + } + } + +- if(var5 != null) { ++ if (var5 != null) { + var4 = new MovingObjectPosition(var5); + } + +- if(var4 != null && var4.entityHit != null && var4.entityHit instanceof EntityPlayer) { ++ if (var4 != null && var4.entityHit != null && var4.entityHit instanceof EntityPlayer) { + EntityPlayer var20 = (EntityPlayer)var4.entityHit; +- if(var20.capabilities.disableDamage || this.shootingEntity instanceof EntityPlayer && !((EntityPlayer)this.shootingEntity).canAttackPlayer(var20)) { ++ ++ if (var20.capabilities.disableDamage || this.shootingEntity instanceof EntityPlayer && !((EntityPlayer)this.shootingEntity).canAttackPlayer(var20)) { + var4 = null; + } + } + + float var21; + float var27; +- if(var4 != null) { +- if(var4.entityHit != null) { ++ ++ if (var4 != null) { ++ if (var4.entityHit != null) { + var21 = MathHelper.sqrt_double(this.motionX * this.motionX + this.motionY * this.motionY + this.motionZ * this.motionZ); + int var22 = MathHelper.ceiling_double_int((double)var21 * this.damage); +- if(this.getIsCritical()) { +- var22 += this.ab.nextInt(var22 / 2 + 2); ++ ++ if (this.getIsCritical()) { ++ var22 += this.rand.nextInt(var22 / 2 + 2); + } + + DamageSource var23 = null; +- if(this.shootingEntity == null) { ++ ++ if (this.shootingEntity == null) { + var23 = DamageSource.causeArrowDamage(this, this); + } else { + var23 = DamageSource.causeArrowDamage(this, this.shootingEntity); + } + +- if(this.isBurning() && !(var4.entityHit instanceof EntityEnderman)) { ++ if (this.isBurning() && !(var4.entityHit instanceof EntityEnderman)) { + var4.entityHit.setFire(5); + } + +- if(var4.entityHit.attackEntityFrom(var23, (float)var22)) { +- if(var4.entityHit instanceof EntityLivingBase) { ++ if (var4.entityHit.attackEntityFrom(var23, (float)var22)) { ++ if (var4.entityHit instanceof EntityLivingBase) { + EntityLivingBase var25 = (EntityLivingBase)var4.entityHit; +- if(!this.worldObj.isRemote) { ++ ++ if (!this.worldObj.isRemote) { + var25.setArrowCountInEntity(var25.getArrowCountInEntity() + 1); + } + +- if(this.knockbackStrength > 0) { ++ if (this.knockbackStrength > 0) { + var27 = MathHelper.sqrt_double(this.motionX * this.motionX + this.motionZ * this.motionZ); +- if(var27 > 0.0F) { +- var4.entityHit.addVelocity(this.motionX * (double)this.knockbackStrength * (double)0.6F / (double)var27, 0.1D, this.motionZ * (double)this.knockbackStrength * (double)0.6F / (double)var27); ++ ++ if (var27 > 0.0F) { ++ var4.entityHit.addVelocity(this.motionX * (double)this.knockbackStrength * 0.6000000238418579D / (double)var27, 0.1D, this.motionZ * (double)this.knockbackStrength * 0.6000000238418579D / (double)var27); + } + } + +- if(this.shootingEntity != null) { +- EnchantmentThorns.func_92096_a(this.shootingEntity, var25, this.ab); ++ if (this.shootingEntity != null) { ++ EnchantmentThorns.func_92096_a(this.shootingEntity, var25, this.rand); + } + +- if(this.shootingEntity != null && var4.entityHit != this.shootingEntity && var4.entityHit instanceof EntityPlayer && this.shootingEntity instanceof EntityPlayerMP) { +- ((EntityPlayerMP)this.shootingEntity).playerNetServerHandler.sendPacket(new Packet70GameEvent(6, 0)); ++ if (this.shootingEntity != null && var4.entityHit != this.shootingEntity && var4.entityHit instanceof EntityPlayer && this.shootingEntity instanceof EntityPlayerMP) { ++ ((EntityPlayerMP)this.shootingEntity).playerNetServerHandler.sendPacketToPlayer(new Packet70GameEvent(6, 0)); + } + } + +- this.playSound("random.bowhit", 1.0F, 1.2F / (this.ab.nextFloat() * 0.2F + 0.9F)); +- if(!(var4.entityHit instanceof EntityEnderman)) { ++ this.playSound("random.bowhit", 1.0F, 1.2F / (this.rand.nextFloat() * 0.2F + 0.9F)); ++ ++ if (!(var4.entityHit instanceof EntityEnderman)) { + this.setDead(); + } + } else { +- this.motionX *= (double)-0.1F; +- this.motionY *= (double)-0.1F; +- this.motionZ *= (double)-0.1F; ++ this.motionX *= -0.10000000149011612D; ++ this.motionY *= -0.10000000149011612D; ++ this.motionZ *= -0.10000000149011612D; + this.rotationYaw += 180.0F; + this.prevRotationYaw += 180.0F; + this.ticksInAir = 0; +@@ -270,21 +309,22 @@ + this.motionY = (double)((float)(var4.hitVec.yCoord - this.posY)); + this.motionZ = (double)((float)(var4.hitVec.zCoord - this.posZ)); + var21 = MathHelper.sqrt_double(this.motionX * this.motionX + this.motionY * this.motionY + this.motionZ * this.motionZ); +- this.posX -= this.motionX / (double)var21 * (double)0.05F; +- this.posY -= this.motionY / (double)var21 * (double)0.05F; +- this.posZ -= this.motionZ / (double)var21 * (double)0.05F; +- this.playSound("random.bowhit", 1.0F, 1.2F / (this.ab.nextFloat() * 0.2F + 0.9F)); ++ this.posX -= this.motionX / (double)var21 * 0.05000000074505806D; ++ this.posY -= this.motionY / (double)var21 * 0.05000000074505806D; ++ this.posZ -= this.motionZ / (double)var21 * 0.05000000074505806D; ++ this.playSound("random.bowhit", 1.0F, 1.2F / (this.rand.nextFloat() * 0.2F + 0.9F)); + this.inGround = true; + this.arrowShake = 7; + this.setIsCritical(false); +- if(this.inTile != 0) { ++ ++ if (this.inTile != 0) { + Block.blocksList[this.inTile].onEntityCollidedWithBlock(this.worldObj, this.xTile, this.yTile, this.zTile, this); + } + } + } + +- if(this.getIsCritical()) { +- for(var9 = 0; var9 < 4; ++var9) { ++ if (this.getIsCritical()) { ++ for (var9 = 0; var9 < 4; ++var9) { + this.worldObj.spawnParticle("crit", this.posX + this.motionX * (double)var9 / 4.0D, this.posY + this.motionY * (double)var9 / 4.0D, this.posZ + this.motionZ * (double)var9 / 4.0D, -this.motionX, -this.motionY + 0.2D, -this.motionZ); + } + } +@@ -293,20 +333,21 @@ + this.posY += this.motionY; + this.posZ += this.motionZ; + var21 = MathHelper.sqrt_double(this.motionX * this.motionX + this.motionZ * this.motionZ); +- this.rotationYaw = (float)(Math.atan2(this.motionX, this.motionZ) * 180.0D / (double)((float)Math.PI)); ++ this.rotationYaw = (float)(Math.atan2(this.motionX, this.motionZ) * 180.0D / Math.PI); + +- for(this.rotationPitch = (float)(Math.atan2(this.motionY, (double)var21) * 180.0D / (double)((float)Math.PI)); this.rotationPitch - this.prevRotationPitch < -180.0F; this.prevRotationPitch -= 360.0F) { ++ for (this.rotationPitch = (float)(Math.atan2(this.motionY, (double)var21) * 180.0D / Math.PI); this.rotationPitch - this.prevRotationPitch < -180.0F; this.prevRotationPitch -= 360.0F) { ++ ; + } + +- while(this.rotationPitch - this.prevRotationPitch >= 180.0F) { ++ while (this.rotationPitch - this.prevRotationPitch >= 180.0F) { + this.prevRotationPitch += 360.0F; + } + +- while(this.rotationYaw - this.prevRotationYaw < -180.0F) { ++ while (this.rotationYaw - this.prevRotationYaw < -180.0F) { + this.prevRotationYaw -= 360.0F; + } + +- while(this.rotationYaw - this.prevRotationYaw >= 180.0F) { ++ while (this.rotationYaw - this.prevRotationYaw >= 180.0F) { + this.prevRotationYaw += 360.0F; + } + +@@ -314,8 +355,9 @@ + this.rotationYaw = this.prevRotationYaw + (this.rotationYaw - this.prevRotationYaw) * 0.2F; + float var24 = 0.99F; + var11 = 0.05F; +- if(this.isInWater()) { +- for(int var26 = 0; var26 < 4; ++var26) { ++ ++ if (this.isInWater()) { ++ for (int var26 = 0; var26 < 4; ++var26) { + var27 = 0.25F; + this.worldObj.spawnParticle("bubble", this.posX - this.motionX * (double)var27, this.posY - this.motionY * (double)var27, this.posZ - this.motionZ * (double)var27, this.motionX, this.motionY, this.motionZ); + } +@@ -332,54 +374,67 @@ + } + } + +- public void writeEntityToNBT(NBTTagCompound var1) { +- var1.setShort("xTile", (short)this.xTile); +- var1.setShort("yTile", (short)this.yTile); +- var1.setShort("zTile", (short)this.zTile); +- var1.setByte("inTile", (byte)this.inTile); +- var1.setByte("inData", (byte)this.inData); +- var1.setByte("shake", (byte)this.arrowShake); +- var1.setByte("inGround", (byte)(this.inGround ? 1 : 0)); +- var1.setByte("pickup", (byte)this.canBePickedUp); +- var1.setDouble("damage", this.damage); +- } +- +- public void readEntityFromNBT(NBTTagCompound var1) { +- this.xTile = var1.getShort("xTile"); +- this.yTile = var1.getShort("yTile"); +- this.zTile = var1.getShort("zTile"); +- this.inTile = var1.getByte("inTile") & 255; +- this.inData = var1.getByte("inData") & 255; +- this.arrowShake = var1.getByte("shake") & 255; +- this.inGround = var1.getByte("inGround") == 1; +- if(var1.hasKey("damage")) { +- this.damage = var1.getDouble("damage"); +- } +- +- if(var1.hasKey("pickup")) { +- this.canBePickedUp = var1.getByte("pickup"); +- } else if(var1.hasKey("player")) { +- this.canBePickedUp = var1.getBoolean("player") ? 1 : 0; +- } +- +- } +- +- public void onCollideWithPlayer(EntityPlayer var1) { +- if(!this.worldObj.isRemote && this.inGround && this.arrowShake <= 0) { +- boolean var2 = this.canBePickedUp == 1 || this.canBePickedUp == 2 && var1.capabilities.isCreativeMode; +- if(this.canBePickedUp == 1 && !var1.inventory.addItemStackToInventory(new ItemStack(Item.arrow, 1))) { ++ /** ++ * (abstract) Protected helper method to write subclass entity data to NBT. ++ */ ++ public void writeEntityToNBT(NBTTagCompound par1NBTTagCompound) { ++ par1NBTTagCompound.setShort("xTile", (short)this.xTile); ++ par1NBTTagCompound.setShort("yTile", (short)this.yTile); ++ par1NBTTagCompound.setShort("zTile", (short)this.zTile); ++ par1NBTTagCompound.setByte("inTile", (byte)this.inTile); ++ par1NBTTagCompound.setByte("inData", (byte)this.inData); ++ par1NBTTagCompound.setByte("shake", (byte)this.arrowShake); ++ par1NBTTagCompound.setByte("inGround", (byte)(this.inGround ? 1 : 0)); ++ par1NBTTagCompound.setByte("pickup", (byte)this.canBePickedUp); ++ par1NBTTagCompound.setDouble("damage", this.damage); ++ } ++ ++ /** ++ * (abstract) Protected helper method to read subclass entity data from NBT. ++ */ ++ public void readEntityFromNBT(NBTTagCompound par1NBTTagCompound) { ++ this.xTile = par1NBTTagCompound.getShort("xTile"); ++ this.yTile = par1NBTTagCompound.getShort("yTile"); ++ this.zTile = par1NBTTagCompound.getShort("zTile"); ++ this.inTile = par1NBTTagCompound.getByte("inTile") & 255; ++ this.inData = par1NBTTagCompound.getByte("inData") & 255; ++ this.arrowShake = par1NBTTagCompound.getByte("shake") & 255; ++ this.inGround = par1NBTTagCompound.getByte("inGround") == 1; ++ ++ if (par1NBTTagCompound.hasKey("damage")) { ++ this.damage = par1NBTTagCompound.getDouble("damage"); ++ } ++ ++ if (par1NBTTagCompound.hasKey("pickup")) { ++ this.canBePickedUp = par1NBTTagCompound.getByte("pickup"); ++ } else if (par1NBTTagCompound.hasKey("player")) { ++ this.canBePickedUp = par1NBTTagCompound.getBoolean("player") ? 1 : 0; ++ } ++ } ++ ++ /** ++ * Called by a player entity when they collide with an entity ++ */ ++ public void onCollideWithPlayer(EntityPlayer par1EntityPlayer) { ++ if (!this.worldObj.isRemote && this.inGround && this.arrowShake <= 0) { ++ boolean var2 = this.canBePickedUp == 1 || this.canBePickedUp == 2 && par1EntityPlayer.capabilities.isCreativeMode; ++ ++ if (this.canBePickedUp == 1 && !par1EntityPlayer.inventory.addItemStackToInventory(new ItemStack(Item.arrow, 1))) { + var2 = false; + } + +- if(var2) { +- this.playSound("random.pop", 0.2F, ((this.ab.nextFloat() - this.ab.nextFloat()) * 0.7F + 1.0F) * 2.0F); +- var1.onItemPickup(this, 1); ++ if (var2) { ++ this.playSound("random.pop", 0.2F, ((this.rand.nextFloat() - this.rand.nextFloat()) * 0.7F + 1.0F) * 2.0F); ++ par1EntityPlayer.onItemPickup(this, 1); + this.setDead(); + } +- + } + } + ++ /** ++ * returns if this entity triggers Block.onEntityWalking on the blocks they walk on. used for spiders and wolves to ++ * prevent them from trampling crops ++ */ + protected boolean canTriggerWalking() { + return false; + } +@@ -388,32 +443,44 @@ + return 0.0F; + } + +- public void setDamage(double var1) { +- this.damage = var1; ++ public void setDamage(double par1) { ++ this.damage = par1; + } + + public double getDamage() { + return this.damage; + } + +- public void setKnockbackStrength(int var1) { +- this.knockbackStrength = var1; ++ /** ++ * Sets the amount of knockback the arrow applies when it hits a mob. ++ */ ++ public void setKnockbackStrength(int par1) { ++ this.knockbackStrength = par1; + } + ++ /** ++ * If returns false, the item will not inflict any damage against entities. ++ */ + public boolean canAttackWithItem() { + return false; + } + +- public void setIsCritical(boolean var1) { ++ /** ++ * Whether the arrow has a stream of critical hit particles flying behind it. ++ */ ++ public void setIsCritical(boolean par1) { + byte var2 = this.dataWatcher.getWatchableObjectByte(16); +- if(var1) { ++ ++ if (par1) { + this.dataWatcher.updateObject(16, Byte.valueOf((byte)(var2 | 1))); + } else { + this.dataWatcher.updateObject(16, Byte.valueOf((byte)(var2 & -2))); + } +- + } + ++ /** ++ * Whether the arrow has a stream of critical hit particles flying behind it. ++ */ + public boolean getIsCritical() { + byte var1 = this.dataWatcher.getWatchableObjectByte(16); + return (var1 & 1) != 0; diff --git a/patches/net/minecraft/src/EntityAuraFX.java.patch b/patches/net/minecraft/src/EntityAuraFX.java.patch new file mode 100644 index 0000000..00defd1 --- /dev/null +++ b/patches/net/minecraft/src/EntityAuraFX.java.patch @@ -0,0 +1,65 @@ +--- net/minecraft/src/EntityAuraFX.java ++++ net/minecraft/src/EntityAuraFX.java +@@ -1,22 +1,30 @@ + package net.minecraft.src; + ++// MCPatcher Start ++import com.prupe.mcpatcher.cc.ColorizeEntity; ++import com.prupe.mcpatcher.cc.Colorizer; ++// MCPatcher End ++ + public class EntityAuraFX extends EntityFX { +- public EntityAuraFX(World var1, double var2, double var4, double var6, double var8, double var10, double var12) { +- super(var1, var2, var4, var6, var8, var10, var12); +- float var14 = this.ab.nextFloat() * 0.1F + 0.2F; ++ public EntityAuraFX(World par1World, double par2, double par4, double par6, double par8, double par10, double par12) { ++ super(par1World, par2, par4, par6, par8, par10, par12); ++ float var14 = this.rand.nextFloat() * 0.1F + 0.2F; + this.particleRed = var14; + this.particleGreen = var14; + this.particleBlue = var14; + this.setParticleTextureIndex(0); + this.setSize(0.02F, 0.02F); +- this.particleScale *= this.ab.nextFloat() * 0.6F + 0.5F; +- this.motionX *= (double)0.02F; +- this.motionY *= (double)0.02F; +- this.motionZ *= (double)0.02F; ++ this.particleScale *= this.rand.nextFloat() * 0.6F + 0.5F; ++ this.motionX *= 0.019999999552965164D; ++ this.motionY *= 0.019999999552965164D; ++ this.motionZ *= 0.019999999552965164D; + this.particleMaxAge = (int)(20.0D / (Math.random() * 0.8D + 0.2D)); + this.noClip = true; + } + ++ /** ++ * Called to update the entity's position/logic. ++ */ + public void onUpdate() { + this.prevPosX = this.posX; + this.prevPosY = this.posY; +@@ -25,9 +33,21 @@ + this.motionX *= 0.99D; + this.motionY *= 0.99D; + this.motionZ *= 0.99D; +- if(this.particleMaxAge-- <= 0) { ++ ++ if (this.particleMaxAge-- <= 0) { + this.setDead(); + } +- +- } ++ } ++ ++ // MCPatcher Start ++ public EntityAuraFX colorize() { ++ if (ColorizeEntity.computeMyceliumParticleColor()) { ++ this.particleRed = Colorizer.setColor[0]; ++ this.particleGreen = Colorizer.setColor[1]; ++ this.particleBlue = Colorizer.setColor[2]; ++ } ++ ++ return this; ++ } ++ // MCPatcher End + } diff --git a/patches/net/minecraft/src/EntityBat.java.patch b/patches/net/minecraft/src/EntityBat.java.patch new file mode 100644 index 0000000..8ee25e0 --- /dev/null +++ b/patches/net/minecraft/src/EntityBat.java.patch @@ -0,0 +1,293 @@ +--- net/minecraft/src/EntityBat.java ++++ net/minecraft/src/EntityBat.java +@@ -3,10 +3,15 @@ + import java.util.Calendar; + + public class EntityBat extends EntityAmbientCreature { +- private ChunkCoordinates spawnPosition; +- +- public EntityBat(World var1) { +- super(var1); ++ ++ /** ++ * randomly selected ChunkCoordinates in a 7x6x7 box around the bat (y offset -2 to 4) towards which it will fly. upon ++ * getting close a new target will be selected ++ */ ++ private ChunkCoordinates currentFlightTarget; ++ ++ public EntityBat(World par1World) { ++ super(par1World); + this.setSize(0.5F, 0.9F); + this.setIsBatHanging(true); + } +@@ -16,35 +21,51 @@ + this.dataWatcher.addObject(16, new Byte((byte)0)); + } + ++ /** ++ * Returns the volume for the sounds this mob makes. ++ */ + protected float getSoundVolume() { + return 0.1F; + } + ++ /** ++ * Gets the pitch of living sounds in living entities. ++ */ + protected float getSoundPitch() { + return super.getSoundPitch() * 0.95F; + } + ++ /** ++ * Returns the sound this mob makes while it's alive. ++ */ + protected String getLivingSound() { +- return this.getIsBatHanging() && this.ab.nextInt(4) != 0 ? null : "mob.bat.idle"; ++ return this.getIsBatHanging() && this.rand.nextInt(4) != 0 ? null : "mob.bat.idle"; + } + ++ /** ++ * Returns the sound this mob makes when it is hurt. ++ */ + protected String getHurtSound() { + return "mob.bat.hurt"; + } + ++ /** ++ * Returns the sound this mob makes on death. ++ */ + protected String getDeathSound() { + return "mob.bat.death"; + } + ++ /** ++ * Returns true if this entity should push and be pushed by other entities when colliding. ++ */ + public boolean canBePushed() { + return false; + } + +- protected void collideWithEntity(Entity var1) { +- } ++ protected void collideWithEntity(Entity par1Entity) {} + +- protected void collideWithNearbyEntities() { +- } ++ protected void collideWithNearbyEntities() {} + + protected void applyEntityAttributes() { + super.applyEntityAttributes(); +@@ -55,112 +76,144 @@ + return (this.dataWatcher.getWatchableObjectByte(16) & 1) != 0; + } + +- public void setIsBatHanging(boolean var1) { ++ public void setIsBatHanging(boolean par1) { + byte var2 = this.dataWatcher.getWatchableObjectByte(16); +- if(var1) { ++ ++ if (par1) { + this.dataWatcher.updateObject(16, Byte.valueOf((byte)(var2 | 1))); + } else { + this.dataWatcher.updateObject(16, Byte.valueOf((byte)(var2 & -2))); + } +- + } + ++ /** ++ * Returns true if the newer Entity AI code should be run ++ */ + protected boolean isAIEnabled() { + return true; + } + ++ /** ++ * Called to update the entity's position/logic. ++ */ + public void onUpdate() { + super.onUpdate(); +- if(this.getIsBatHanging()) { ++ ++ if (this.getIsBatHanging()) { + this.motionX = this.motionY = this.motionZ = 0.0D; + this.posY = (double)MathHelper.floor_double(this.posY) + 1.0D - (double)this.height; + } else { +- this.motionY *= (double)0.6F; ++ this.motionY *= 0.6000000238418579D; + } +- + } + + protected void updateAITasks() { + super.updateAITasks(); +- if(this.getIsBatHanging()) { +- if(!this.worldObj.isBlockNormalCube(MathHelper.floor_double(this.posX), (int)this.posY + 1, MathHelper.floor_double(this.posZ))) { ++ ++ if (this.getIsBatHanging()) { ++ if (!this.worldObj.isBlockNormalCube(MathHelper.floor_double(this.posX), (int)this.posY + 1, MathHelper.floor_double(this.posZ))) { + this.setIsBatHanging(false); + this.worldObj.playAuxSFXAtEntity((EntityPlayer)null, 1015, (int)this.posX, (int)this.posY, (int)this.posZ, 0); + } else { +- if(this.ab.nextInt(200) == 0) { +- this.rotationYawHead = (float)this.ab.nextInt(360); ++ if (this.rand.nextInt(200) == 0) { ++ this.rotationYawHead = (float)this.rand.nextInt(360); + } + +- if(this.worldObj.getClosestPlayerToEntity(this, 4.0D) != null) { ++ if (this.worldObj.getClosestPlayerToEntity(this, 4.0D) != null) { + this.setIsBatHanging(false); + this.worldObj.playAuxSFXAtEntity((EntityPlayer)null, 1015, (int)this.posX, (int)this.posY, (int)this.posZ, 0); + } + } + } else { +- if(this.spawnPosition != null && (!this.worldObj.isAirBlock(this.spawnPosition.posX, this.spawnPosition.posY, this.spawnPosition.posZ) || this.spawnPosition.posY < 1)) { +- this.spawnPosition = null; +- } +- +- if(this.spawnPosition == null || this.ab.nextInt(30) == 0 || this.spawnPosition.getDistanceSquared((int)this.posX, (int)this.posY, (int)this.posZ) < 4.0F) { +- this.spawnPosition = new ChunkCoordinates((int)this.posX + this.ab.nextInt(7) - this.ab.nextInt(7), (int)this.posY + this.ab.nextInt(6) - 2, (int)this.posZ + this.ab.nextInt(7) - this.ab.nextInt(7)); +- } +- +- double var1 = (double)this.spawnPosition.posX + 0.5D - this.posX; +- double var3 = (double)this.spawnPosition.posY + 0.1D - this.posY; +- double var5 = (double)this.spawnPosition.posZ + 0.5D - this.posZ; +- this.motionX += (Math.signum(var1) * 0.5D - this.motionX) * (double)0.1F; +- this.motionY += (Math.signum(var3) * (double)0.7F - this.motionY) * (double)0.1F; +- this.motionZ += (Math.signum(var5) * 0.5D - this.motionZ) * (double)0.1F; +- float var7 = (float)(Math.atan2(this.motionZ, this.motionX) * 180.0D / (double)((float)Math.PI)) - 90.0F; ++ if (this.currentFlightTarget != null && (!this.worldObj.isAirBlock(this.currentFlightTarget.posX, this.currentFlightTarget.posY, this.currentFlightTarget.posZ) || this.currentFlightTarget.posY < 1)) { ++ this.currentFlightTarget = null; ++ } ++ ++ if (this.currentFlightTarget == null || this.rand.nextInt(30) == 0 || this.currentFlightTarget.getDistanceSquared((int)this.posX, (int)this.posY, (int)this.posZ) < 4.0F) { ++ this.currentFlightTarget = new ChunkCoordinates((int)this.posX + this.rand.nextInt(7) - this.rand.nextInt(7), (int)this.posY + this.rand.nextInt(6) - 2, (int)this.posZ + this.rand.nextInt(7) - this.rand.nextInt(7)); ++ } ++ ++ double var1 = (double)this.currentFlightTarget.posX + 0.5D - this.posX; ++ double var3 = (double)this.currentFlightTarget.posY + 0.1D - this.posY; ++ double var5 = (double)this.currentFlightTarget.posZ + 0.5D - this.posZ; ++ this.motionX += (Math.signum(var1) * 0.5D - this.motionX) * 0.10000000149011612D; ++ this.motionY += (Math.signum(var3) * 0.699999988079071D - this.motionY) * 0.10000000149011612D; ++ this.motionZ += (Math.signum(var5) * 0.5D - this.motionZ) * 0.10000000149011612D; ++ float var7 = (float)(Math.atan2(this.motionZ, this.motionX) * 180.0D / Math.PI) - 90.0F; + float var8 = MathHelper.wrapAngleTo180_float(var7 - this.rotationYaw); + this.moveForward = 0.5F; + this.rotationYaw += var8; +- if(this.ab.nextInt(100) == 0 && this.worldObj.isBlockNormalCube(MathHelper.floor_double(this.posX), (int)this.posY + 1, MathHelper.floor_double(this.posZ))) { ++ ++ if (this.rand.nextInt(100) == 0 && this.worldObj.isBlockNormalCube(MathHelper.floor_double(this.posX), (int)this.posY + 1, MathHelper.floor_double(this.posZ))) { + this.setIsBatHanging(true); + } + } +- + } + ++ /** ++ * returns if this entity triggers Block.onEntityWalking on the blocks they walk on. used for spiders and wolves to ++ * prevent them from trampling crops ++ */ + protected boolean canTriggerWalking() { + return false; + } + +- protected void fall(float var1) { +- } +- +- protected void updateFallState(double var1, boolean var3) { +- } +- ++ /** ++ * Called when the mob is falling. Calculates and applies fall damage. ++ */ ++ protected void fall(float par1) {} ++ ++ /** ++ * Takes in the distance the entity has fallen this tick and whether its on the ground to update the fall distance and ++ * deal fall damage if landing on the ground. Args: distanceFallenThisTick, onGround ++ */ ++ protected void updateFallState(double par1, boolean par3) {} ++ ++ /** ++ * Return whether this entity should NOT trigger a pressure plate or a tripwire. ++ */ + public boolean doesEntityNotTriggerPressurePlate() { + return true; + } + +- public boolean attackEntityFrom(DamageSource var1, float var2) { +- if(this.isEntityInvulnerable()) { ++ /** ++ * Called when the entity is attacked. ++ */ ++ public boolean attackEntityFrom(DamageSource par1DamageSource, float par2) { ++ if (this.isEntityInvulnerable()) { + return false; + } else { +- if(!this.worldObj.isRemote && this.getIsBatHanging()) { ++ if (!this.worldObj.isRemote && this.getIsBatHanging()) { + this.setIsBatHanging(false); + } + +- return super.attackEntityFrom(var1, var2); ++ return super.attackEntityFrom(par1DamageSource, par2); + } + } + +- public void readEntityFromNBT(NBTTagCompound var1) { +- super.readEntityFromNBT(var1); +- this.dataWatcher.updateObject(16, Byte.valueOf(var1.getByte("BatFlags"))); +- } +- +- public void writeEntityToNBT(NBTTagCompound var1) { +- super.writeEntityToNBT(var1); +- var1.setByte("BatFlags", this.dataWatcher.getWatchableObjectByte(16)); +- } +- ++ /** ++ * (abstract) Protected helper method to read subclass entity data from NBT. ++ */ ++ public void readEntityFromNBT(NBTTagCompound par1NBTTagCompound) { ++ super.readEntityFromNBT(par1NBTTagCompound); ++ this.dataWatcher.updateObject(16, Byte.valueOf(par1NBTTagCompound.getByte("BatFlags"))); ++ } ++ ++ /** ++ * (abstract) Protected helper method to write subclass entity data to NBT. ++ */ ++ public void writeEntityToNBT(NBTTagCompound par1NBTTagCompound) { ++ super.writeEntityToNBT(par1NBTTagCompound); ++ par1NBTTagCompound.setByte("BatFlags", this.dataWatcher.getWatchableObjectByte(16)); ++ } ++ ++ /** ++ * Checks if the entity's current position is a valid location to spawn this entity. ++ */ + public boolean getCanSpawnHere() { + int var1 = MathHelper.floor_double(this.boundingBox.minY); +- if(var1 >= 63) { ++ ++ if (var1 >= 63) { + return false; + } else { + int var2 = MathHelper.floor_double(this.posX); +@@ -168,15 +221,16 @@ + int var4 = this.worldObj.getBlockLightValue(var2, var1, var3); + byte var5 = 4; + Calendar var6 = this.worldObj.getCurrentDate(); +- if((var6.get(2) + 1 != 10 || var6.get(5) < 20) && (var6.get(2) + 1 != 11 || var6.get(5) > 3)) { +- if(this.ab.nextBoolean()) { ++ ++ if ((var6.get(2) + 1 != 10 || var6.get(5) < 20) && (var6.get(2) + 1 != 11 || var6.get(5) > 3)) { ++ if (this.rand.nextBoolean()) { + return false; + } + } else { + var5 = 7; + } + +- return var4 > this.ab.nextInt(var5) ? false : super.getCanSpawnHere(); ++ return var4 > this.rand.nextInt(var5) ? false : super.getCanSpawnHere(); + } + } + } diff --git a/patches/net/minecraft/src/EntityBlaze.java.patch b/patches/net/minecraft/src/EntityBlaze.java.patch new file mode 100644 index 0000000..97e91b7 --- /dev/null +++ b/patches/net/minecraft/src/EntityBlaze.java.patch @@ -0,0 +1,239 @@ +--- net/minecraft/src/EntityBlaze.java ++++ net/minecraft/src/EntityBlaze.java +@@ -1,12 +1,16 @@ + package net.minecraft.src; + + public class EntityBlaze extends EntityMob { ++ ++ /** Random offset used in floating behaviour */ + private float heightOffset = 0.5F; ++ ++ /** ticks until heightOffset is randomized */ + private int heightOffsetUpdateTime; + private int field_70846_g; + +- public EntityBlaze(World var1) { +- super(var1); ++ public EntityBlaze(World par1World) { ++ super(par1World); + this.isImmuneToFire = true; + this.experienceValue = 10; + } +@@ -21,72 +25,94 @@ + this.dataWatcher.addObject(16, new Byte((byte)0)); + } + ++ /** ++ * Returns the sound this mob makes while it's alive. ++ */ + protected String getLivingSound() { + return "mob.blaze.breathe"; + } + ++ /** ++ * Returns the sound this mob makes when it is hurt. ++ */ + protected String getHurtSound() { + return "mob.blaze.hit"; + } + ++ /** ++ * Returns the sound this mob makes on death. ++ */ + protected String getDeathSound() { + return "mob.blaze.death"; + } + +- public int getBrightnessForRender(float var1) { ++ public int getBrightnessForRender(float par1) { + return 15728880; + } + +- public float getBrightness(float var1) { ++ /** ++ * Gets how bright this entity is. ++ */ ++ public float getBrightness(float par1) { + return 1.0F; + } + ++ /** ++ * Called frequently so the entity can update its state every tick as required. For example, zombies and skeletons use ++ * this to react to sunlight and start to burn. ++ */ + public void onLivingUpdate() { +- if(!this.worldObj.isRemote) { +- if(this.isWet()) { ++ if (!this.worldObj.isRemote) { ++ if (this.isWet()) { + this.attackEntityFrom(DamageSource.drown, 1.0F); + } + + --this.heightOffsetUpdateTime; +- if(this.heightOffsetUpdateTime <= 0) { ++ ++ if (this.heightOffsetUpdateTime <= 0) { + this.heightOffsetUpdateTime = 100; +- this.heightOffset = 0.5F + (float)this.ab.nextGaussian() * 3.0F; +- } +- +- if(this.getEntityToAttack() != null && this.getEntityToAttack().posY + (double)this.getEntityToAttack().getEyeHeight() > this.posY + (double)this.getEyeHeight() + (double)this.heightOffset) { +- this.motionY += ((double)0.3F - this.motionY) * (double)0.3F; +- } +- } +- +- if(this.ab.nextInt(24) == 0) { +- this.worldObj.playSoundEffect(this.posX + 0.5D, this.posY + 0.5D, this.posZ + 0.5D, "fire.fire", 1.0F + this.ab.nextFloat(), this.ab.nextFloat() * 0.7F + 0.3F); +- } +- +- if(!this.onGround && this.motionY < 0.0D) { ++ this.heightOffset = 0.5F + (float)this.rand.nextGaussian() * 3.0F; ++ } ++ ++ if (this.getEntityToAttack() != null && this.getEntityToAttack().posY + (double)this.getEntityToAttack().getEyeHeight() > this.posY + (double)this.getEyeHeight() + (double)this.heightOffset) { ++ this.motionY += (0.30000001192092896D - this.motionY) * 0.30000001192092896D; ++ } ++ } ++ ++ if (this.rand.nextInt(24) == 0) { ++ this.worldObj.playSoundEffect(this.posX + 0.5D, this.posY + 0.5D, this.posZ + 0.5D, "fire.fire", 1.0F + this.rand.nextFloat(), this.rand.nextFloat() * 0.7F + 0.3F); ++ } ++ ++ if (!this.onGround && this.motionY < 0.0D) { + this.motionY *= 0.6D; + } + +- for(int var1 = 0; var1 < 2; ++var1) { +- this.worldObj.spawnParticle("largesmoke", this.posX + (this.ab.nextDouble() - 0.5D) * (double)this.width, this.posY + this.ab.nextDouble() * (double)this.height, this.posZ + (this.ab.nextDouble() - 0.5D) * (double)this.width, 0.0D, 0.0D, 0.0D); ++ for (int var1 = 0; var1 < 2; ++var1) { ++ this.worldObj.spawnParticle("largesmoke", this.posX + (this.rand.nextDouble() - 0.5D) * (double)this.width, this.posY + this.rand.nextDouble() * (double)this.height, this.posZ + (this.rand.nextDouble() - 0.5D) * (double)this.width, 0.0D, 0.0D, 0.0D); + } + + super.onLivingUpdate(); + } + +- protected void attackEntity(Entity var1, float var2) { +- if(this.attackTime <= 0 && var2 < 2.0F && var1.boundingBox.maxY > this.boundingBox.minY && var1.boundingBox.minY < this.boundingBox.maxY) { ++ /** ++ * Basic mob attack. Default to touch of death in EntityCreature. Overridden by each mob to define their attack. ++ */ ++ protected void attackEntity(Entity par1Entity, float par2) { ++ if (this.attackTime <= 0 && par2 < 2.0F && par1Entity.boundingBox.maxY > this.boundingBox.minY && par1Entity.boundingBox.minY < this.boundingBox.maxY) { + this.attackTime = 20; +- this.attackEntityAsMob(var1); +- } else if(var2 < 30.0F) { +- double var3 = var1.posX - this.posX; +- double var5 = var1.boundingBox.minY + (double)(var1.height / 2.0F) - (this.posY + (double)(this.height / 2.0F)); +- double var7 = var1.posZ - this.posZ; +- if(this.attackTime == 0) { ++ this.attackEntityAsMob(par1Entity); ++ } else if (par2 < 30.0F) { ++ double var3 = par1Entity.posX - this.posX; ++ double var5 = par1Entity.boundingBox.minY + (double)(par1Entity.height / 2.0F) - (this.posY + (double)(this.height / 2.0F)); ++ double var7 = par1Entity.posZ - this.posZ; ++ ++ if (this.attackTime == 0) { + ++this.field_70846_g; +- if(this.field_70846_g == 1) { ++ ++ if (this.field_70846_g == 1) { + this.attackTime = 60; + this.func_70844_e(true); +- } else if(this.field_70846_g <= 4) { ++ } else if (this.field_70846_g <= 4) { + this.attackTime = 6; + } else { + this.attackTime = 100; +@@ -94,53 +120,64 @@ + this.func_70844_e(false); + } + +- if(this.field_70846_g > 1) { +- float var9 = MathHelper.sqrt_float(var2) * 0.5F; ++ if (this.field_70846_g > 1) { ++ float var9 = MathHelper.sqrt_float(par2) * 0.5F; + this.worldObj.playAuxSFXAtEntity((EntityPlayer)null, 1009, (int)this.posX, (int)this.posY, (int)this.posZ, 0); + +- for(int var10 = 0; var10 < 1; ++var10) { +- EntitySmallFireball var11 = new EntitySmallFireball(this.worldObj, this, var3 + this.ab.nextGaussian() * (double)var9, var5, var7 + this.ab.nextGaussian() * (double)var9); ++ for (int var10 = 0; var10 < 1; ++var10) { ++ EntitySmallFireball var11 = new EntitySmallFireball(this.worldObj, this, var3 + this.rand.nextGaussian() * (double)var9, var5, var7 + this.rand.nextGaussian() * (double)var9); + var11.posY = this.posY + (double)(this.height / 2.0F) + 0.5D; + this.worldObj.spawnEntityInWorld(var11); + } + } + } + +- this.rotationYaw = (float)(Math.atan2(var7, var3) * 180.0D / (double)((float)Math.PI)) - 90.0F; ++ this.rotationYaw = (float)(Math.atan2(var7, var3) * 180.0D / Math.PI) - 90.0F; + this.hasAttacked = true; + } +- +- } +- +- protected void fall(float var1) { +- } +- ++ } ++ ++ /** ++ * Called when the mob is falling. Calculates and applies fall damage. ++ */ ++ protected void fall(float par1) {} ++ ++ /** ++ * Returns the item ID for the item the mob drops on death. ++ */ + protected int getDropItemId() { + return Item.blazeRod.itemID; + } + ++ /** ++ * Returns true if the entity is on fire. Used by render to add the fire effect on rendering. ++ */ + public boolean isBurning() { + return this.func_70845_n(); + } + +- protected void dropFewItems(boolean var1, int var2) { +- if(var1) { +- int var3 = this.ab.nextInt(2 + var2); ++ /** ++ * Drop 0-2 items of this living's type. @param par1 - Whether this entity has recently been hit by a player. @param ++ * par2 - Level of Looting used to kill this mob. ++ */ ++ protected void dropFewItems(boolean par1, int par2) { ++ if (par1) { ++ int var3 = this.rand.nextInt(2 + par2); + +- for(int var4 = 0; var4 < var3; ++var4) { ++ for (int var4 = 0; var4 < var3; ++var4) { + this.dropItem(Item.blazeRod.itemID, 1); + } + } +- + } + + public boolean func_70845_n() { + return (this.dataWatcher.getWatchableObjectByte(16) & 1) != 0; + } + +- public void func_70844_e(boolean var1) { ++ public void func_70844_e(boolean par1) { + byte var2 = this.dataWatcher.getWatchableObjectByte(16); +- if(var1) { ++ ++ if (par1) { + var2 = (byte)(var2 | 1); + } else { + var2 &= -2; +@@ -149,6 +186,9 @@ + this.dataWatcher.updateObject(16, Byte.valueOf(var2)); + } + ++ /** ++ * Checks to make sure the light is not too bright where the mob is spawning ++ */ + protected boolean isValidLightLevel() { + return true; + } diff --git a/patches/net/minecraft/src/EntityBoat.java.patch b/patches/net/minecraft/src/EntityBoat.java.patch new file mode 100644 index 0000000..ff25a9d --- /dev/null +++ b/patches/net/minecraft/src/EntityBoat.java.patch @@ -0,0 +1,536 @@ +--- net/minecraft/src/EntityBoat.java ++++ net/minecraft/src/EntityBoat.java +@@ -15,8 +15,8 @@ + private double velocityY; + private double velocityZ; + +- public EntityBoat(World var1) { +- super(var1); ++ public EntityBoat(World par1World) { ++ super(par1World); + this.field_70279_a = true; + this.speedMultiplier = 0.07D; + this.preventEntitySpawning = true; +@@ -24,6 +24,10 @@ + this.yOffset = this.height / 2.0F; + } + ++ /** ++ * returns if this entity triggers Block.onEntityWalking on the blocks they walk on. used for spiders and wolves to ++ * prevent them from trampling crops ++ */ + protected boolean canTriggerWalking() { + return false; + } +@@ -34,48 +38,65 @@ + this.dataWatcher.addObject(19, new Float(0.0F)); + } + +- public AxisAlignedBB getCollisionBox(Entity var1) { +- return var1.boundingBox; ++ /** ++ * Returns a boundingBox used to collide the entity with other entities and blocks. This enables the entity to be ++ * pushable on contact, like boats or minecarts. ++ */ ++ public AxisAlignedBB getCollisionBox(Entity par1Entity) { ++ return par1Entity.boundingBox; + } + ++ /** ++ * returns the bounding box for this entity ++ */ + public AxisAlignedBB getBoundingBox() { + return this.boundingBox; + } + ++ /** ++ * Returns true if this entity should push and be pushed by other entities when colliding. ++ */ + public boolean canBePushed() { + return true; + } + +- public EntityBoat(World var1, double var2, double var4, double var6) { +- this(var1); +- this.setPosition(var2, var4 + (double)this.yOffset, var6); ++ public EntityBoat(World par1World, double par2, double par4, double par6) { ++ this(par1World); ++ this.setPosition(par2, par4 + (double)this.yOffset, par6); + this.motionX = 0.0D; + this.motionY = 0.0D; + this.motionZ = 0.0D; +- this.prevPosX = var2; +- this.prevPosY = var4; +- this.prevPosZ = var6; ++ this.prevPosX = par2; ++ this.prevPosY = par4; ++ this.prevPosZ = par6; + } + ++ /** ++ * Returns the Y offset from the entity's position for any entity riding this one. ++ */ + public double getMountedYOffset() { +- return (double)this.height * 0.0D - (double)0.3F; ++ return (double)this.height * 0.0D - 0.30000001192092896D; + } + +- public boolean attackEntityFrom(DamageSource var1, float var2) { +- if(this.isEntityInvulnerable()) { ++ /** ++ * Called when the entity is attacked. ++ */ ++ public boolean attackEntityFrom(DamageSource par1DamageSource, float par2) { ++ if (this.isEntityInvulnerable()) { + return false; +- } else if(!this.worldObj.isRemote && !this.isDead) { ++ } else if (!this.worldObj.isRemote && !this.isDead) { + this.setForwardDirection(-this.getForwardDirection()); + this.setTimeSinceHit(10); +- this.setDamageTaken(this.getDamageTaken() + var2 * 10.0F); ++ this.setDamageTaken(this.getDamageTaken() + par2 * 10.0F); + this.setBeenAttacked(); +- boolean var3 = var1.getEntity() instanceof EntityPlayer && ((EntityPlayer)var1.getEntity()).capabilities.isCreativeMode; +- if(var3 || this.getDamageTaken() > 40.0F) { +- if(this.riddenByEntity != null) { ++ boolean var3 = par1DamageSource.getEntity() instanceof EntityPlayer && ((EntityPlayer)par1DamageSource.getEntity()).capabilities.isCreativeMode; ++ ++ if (var3 || this.getDamageTaken() > 40.0F) { ++ if (this.riddenByEntity != null) { + this.riddenByEntity.mountEntity(this); + } + +- if(!var3) { ++ if (!var3) { + this.dropItemWithOffset(Item.boat.itemID, 1, 0.0F); + } + +@@ -88,54 +109,72 @@ + } + } + ++ /** ++ * Setups the entity to do the hurt animation. Only used by packets in multiplayer. ++ */ + public void performHurtAnimation() { + this.setForwardDirection(-this.getForwardDirection()); + this.setTimeSinceHit(10); + this.setDamageTaken(this.getDamageTaken() * 11.0F); + } + ++ /** ++ * Returns true if other Entities should be prevented from moving through this Entity. ++ */ + public boolean canBeCollidedWith() { + return !this.isDead; + } + +- public void setPositionAndRotation2(double var1, double var3, double var5, float var7, float var8, int var9) { +- if(this.field_70279_a) { +- this.boatPosRotationIncrements = var9 + 5; ++ /** ++ * Sets the position and rotation. Only difference from the other one is no bounding on the rotation. Args: posX, posY, ++ * posZ, yaw, pitch ++ */ ++ public void setPositionAndRotation2(double par1, double par3, double par5, float par7, float par8, int par9) { ++ if (this.field_70279_a) { ++ this.boatPosRotationIncrements = par9 + 5; + } else { +- double var10 = var1 - this.posX; +- double var12 = var3 - this.posY; +- double var14 = var5 - this.posZ; ++ double var10 = par1 - this.posX; ++ double var12 = par3 - this.posY; ++ double var14 = par5 - this.posZ; + double var16 = var10 * var10 + var12 * var12 + var14 * var14; +- if(var16 <= 1.0D) { ++ ++ if (var16 <= 1.0D) { + return; + } + + this.boatPosRotationIncrements = 3; + } + +- this.boatX = var1; +- this.boatY = var3; +- this.boatZ = var5; +- this.boatYaw = (double)var7; +- this.boatPitch = (double)var8; ++ this.boatX = par1; ++ this.boatY = par3; ++ this.boatZ = par5; ++ this.boatYaw = (double)par7; ++ this.boatPitch = (double)par8; + this.motionX = this.velocityX; + this.motionY = this.velocityY; + this.motionZ = this.velocityZ; + } + +- public void setVelocity(double var1, double var3, double var5) { +- this.velocityX = this.motionX = var1; +- this.velocityY = this.motionY = var3; +- this.velocityZ = this.motionZ = var5; ++ /** ++ * Sets the velocity to the args. Args: x, y, z ++ */ ++ public void setVelocity(double par1, double par3, double par5) { ++ this.velocityX = this.motionX = par1; ++ this.velocityY = this.motionY = par3; ++ this.velocityZ = this.motionZ = par5; + } + ++ /** ++ * Called to update the entity's position/logic. ++ */ + public void onUpdate() { + super.onUpdate(); +- if(this.getTimeSinceHit() > 0) { ++ ++ if (this.getTimeSinceHit() > 0) { + this.setTimeSinceHit(this.getTimeSinceHit() - 1); + } + +- if(this.getDamageTaken() > 0.0F) { ++ if (this.getDamageTaken() > 0.0F) { + this.setDamageTaken(this.getDamageTaken() - 1.0F); + } + +@@ -145,11 +184,12 @@ + byte var1 = 5; + double var2 = 0.0D; + +- for(int var4 = 0; var4 < var1; ++var4) { ++ for (int var4 = 0; var4 < var1; ++var4) { + double var5 = this.boundingBox.minY + (this.boundingBox.maxY - this.boundingBox.minY) * (double)(var4 + 0) / (double)var1 - 0.125D; + double var7 = this.boundingBox.minY + (this.boundingBox.maxY - this.boundingBox.minY) * (double)(var4 + 1) / (double)var1 - 0.125D; + AxisAlignedBB var9 = AxisAlignedBB.getAABBPool().getAABB(this.boundingBox.minX, var5, this.boundingBox.minZ, this.boundingBox.maxX, var7, this.boundingBox.maxZ); +- if(this.worldObj.isAABBInMaterial(var9, Material.water)) { ++ ++ if (this.worldObj.isAABBInMaterial(var9, Material.water)) { + var2 += 1.0D / (double)var1; + } + } +@@ -157,16 +197,18 @@ + double var23 = Math.sqrt(this.motionX * this.motionX + this.motionZ * this.motionZ); + double var6; + double var8; +- if(var23 > 0.26249999999999996D) { ++ ++ if (var23 > 0.26249999999999996D) { + var6 = Math.cos((double)this.rotationYaw * Math.PI / 180.0D); + var8 = Math.sin((double)this.rotationYaw * Math.PI / 180.0D); + +- for(int var10 = 0; (double)var10 < 1.0D + var23 * 60.0D; ++var10) { +- double var11 = (double)(this.ab.nextFloat() * 2.0F - 1.0F); +- double var13 = (double)(this.ab.nextInt(2) * 2 - 1) * 0.7D; ++ for (int var10 = 0; (double)var10 < 1.0D + var23 * 60.0D; ++var10) { ++ double var11 = (double)(this.rand.nextFloat() * 2.0F - 1.0F); ++ double var13 = (double)(this.rand.nextInt(2) * 2 - 1) * 0.7D; + double var15; + double var17; +- if(this.ab.nextBoolean()) { ++ ++ if (this.rand.nextBoolean()) { + var15 = this.posX - var6 * var11 * 0.8D + var8 * var13; + var17 = this.posZ - var8 * var11 * 0.8D - var6 * var13; + this.worldObj.spawnParticle("splash", var15, this.posY - 0.125D, var17, this.motionX, this.motionY, this.motionZ); +@@ -180,8 +222,9 @@ + + double var12; + double var25; +- if(this.worldObj.isRemote && this.field_70279_a) { +- if(this.boatPosRotationIncrements > 0) { ++ ++ if (this.worldObj.isRemote && this.field_70279_a) { ++ if (this.boatPosRotationIncrements > 0) { + var6 = this.posX + (this.boatX - this.posX) / (double)this.boatPosRotationIncrements; + var8 = this.posY + (this.boatY - this.posY) / (double)this.boatPosRotationIncrements; + var25 = this.posZ + (this.boatZ - this.posZ) / (double)this.boatPosRotationIncrements; +@@ -196,194 +239,229 @@ + var8 = this.posY + this.motionY; + var25 = this.posZ + this.motionZ; + this.setPosition(var6, var8, var25); +- if(this.onGround) { ++ ++ if (this.onGround) { + this.motionX *= 0.5D; + this.motionY *= 0.5D; + this.motionZ *= 0.5D; + } + +- this.motionX *= (double)0.99F; +- this.motionY *= (double)0.95F; +- this.motionZ *= (double)0.99F; ++ this.motionX *= 0.9900000095367432D; ++ this.motionY *= 0.949999988079071D; ++ this.motionZ *= 0.9900000095367432D; + } +- + } else { +- if(var2 < 1.0D) { ++ if (var2 < 1.0D) { + var6 = var2 * 2.0D - 1.0D; +- this.motionY += (double)0.04F * var6; ++ this.motionY += 0.03999999910593033D * var6; + } else { +- if(this.motionY < 0.0D) { ++ if (this.motionY < 0.0D) { + this.motionY /= 2.0D; + } + +- this.motionY += (double)0.007F; ++ this.motionY += 0.007000000216066837D; + } + +- if(this.riddenByEntity != null && this.riddenByEntity instanceof EntityLivingBase) { ++ if (this.riddenByEntity != null && this.riddenByEntity instanceof EntityLivingBase) { + var6 = (double)((EntityLivingBase)this.riddenByEntity).moveForward; +- if(var6 > 0.0D) { ++ ++ if (var6 > 0.0D) { + var8 = -Math.sin((double)(this.riddenByEntity.rotationYaw * (float)Math.PI / 180.0F)); + var25 = Math.cos((double)(this.riddenByEntity.rotationYaw * (float)Math.PI / 180.0F)); +- this.motionX += var8 * this.speedMultiplier * (double)0.05F; +- this.motionZ += var25 * this.speedMultiplier * (double)0.05F; ++ this.motionX += var8 * this.speedMultiplier * 0.05000000074505806D; ++ this.motionZ += var25 * this.speedMultiplier * 0.05000000074505806D; + } + } + + var6 = Math.sqrt(this.motionX * this.motionX + this.motionZ * this.motionZ); +- if(var6 > 0.35D) { ++ ++ if (var6 > 0.35D) { + var8 = 0.35D / var6; + this.motionX *= var8; + this.motionZ *= var8; + var6 = 0.35D; + } + +- if(var6 > var23 && this.speedMultiplier < 0.35D) { ++ if (var6 > var23 && this.speedMultiplier < 0.35D) { + this.speedMultiplier += (0.35D - this.speedMultiplier) / 35.0D; +- if(this.speedMultiplier > 0.35D) { ++ ++ if (this.speedMultiplier > 0.35D) { + this.speedMultiplier = 0.35D; + } + } else { + this.speedMultiplier -= (this.speedMultiplier - 0.07D) / 35.0D; +- if(this.speedMultiplier < 0.07D) { ++ ++ if (this.speedMultiplier < 0.07D) { + this.speedMultiplier = 0.07D; + } + } + +- if(this.onGround) { ++ if (this.onGround) { + this.motionX *= 0.5D; + this.motionY *= 0.5D; + this.motionZ *= 0.5D; + } + + this.moveEntity(this.motionX, this.motionY, this.motionZ); +- if(this.isCollidedHorizontally && var23 > 0.2D) { +- if(!this.worldObj.isRemote && !this.isDead) { ++ ++ if (this.isCollidedHorizontally && var23 > 0.2D) { ++ if (!this.worldObj.isRemote && !this.isDead) { + this.setDead(); +- + int var24; +- for(var24 = 0; var24 < 3; ++var24) { ++ ++ for (var24 = 0; var24 < 3; ++var24) { + this.dropItemWithOffset(Block.planks.blockID, 1, 0.0F); + } + +- for(var24 = 0; var24 < 2; ++var24) { ++ for (var24 = 0; var24 < 2; ++var24) { + this.dropItemWithOffset(Item.stick.itemID, 1, 0.0F); + } + } + } else { +- this.motionX *= (double)0.99F; +- this.motionY *= (double)0.95F; +- this.motionZ *= (double)0.99F; ++ this.motionX *= 0.9900000095367432D; ++ this.motionY *= 0.949999988079071D; ++ this.motionZ *= 0.9900000095367432D; + } + + this.rotationPitch = 0.0F; + var8 = (double)this.rotationYaw; + var25 = this.prevPosX - this.posX; + var12 = this.prevPosZ - this.posZ; +- if(var25 * var25 + var12 * var12 > 0.001D) { ++ ++ if (var25 * var25 + var12 * var12 > 0.001D) { + var8 = (double)((float)(Math.atan2(var12, var25) * 180.0D / Math.PI)); + } + + double var14 = MathHelper.wrapAngleTo180_double(var8 - (double)this.rotationYaw); +- if(var14 > 20.0D) { ++ ++ if (var14 > 20.0D) { + var14 = 20.0D; + } + +- if(var14 < -20.0D) { ++ if (var14 < -20.0D) { + var14 = -20.0D; + } + + this.rotationYaw = (float)((double)this.rotationYaw + var14); + this.setRotation(this.rotationYaw, this.rotationPitch); +- if(!this.worldObj.isRemote) { +- List var16 = this.worldObj.getEntitiesWithinAABBExcludingEntity(this, this.boundingBox.expand((double)0.2F, 0.0D, (double)0.2F)); ++ ++ if (!this.worldObj.isRemote) { ++ List var16 = this.worldObj.getEntitiesWithinAABBExcludingEntity(this, this.boundingBox.expand(0.20000000298023224D, 0.0D, 0.20000000298023224D)); + int var26; +- if(var16 != null && !var16.isEmpty()) { +- for(var26 = 0; var26 < var16.size(); ++var26) { ++ ++ if (var16 != null && !var16.isEmpty()) { ++ for (var26 = 0; var26 < var16.size(); ++var26) { + Entity var18 = (Entity)var16.get(var26); +- if(var18 != this.riddenByEntity && var18.canBePushed() && var18 instanceof EntityBoat) { ++ ++ if (var18 != this.riddenByEntity && var18.canBePushed() && var18 instanceof EntityBoat) { + var18.applyEntityCollision(this); + } + } + } + +- for(var26 = 0; var26 < 4; ++var26) { ++ for (var26 = 0; var26 < 4; ++var26) { + int var27 = MathHelper.floor_double(this.posX + ((double)(var26 % 2) - 0.5D) * 0.8D); + int var19 = MathHelper.floor_double(this.posZ + ((double)(var26 / 2) - 0.5D) * 0.8D); + +- for(int var20 = 0; var20 < 2; ++var20) { ++ for (int var20 = 0; var20 < 2; ++var20) { + int var21 = MathHelper.floor_double(this.posY) + var20; + int var22 = this.worldObj.getBlockId(var27, var21, var19); +- if(var22 == Block.snow.blockID) { ++ ++ if (var22 == Block.snow.blockID) { + this.worldObj.setBlockToAir(var27, var21, var19); +- } else if(var22 == Block.waterlily.blockID) { ++ } else if (var22 == Block.waterlily.blockID) { + this.worldObj.destroyBlock(var27, var21, var19, true); + } + } + } + +- if(this.riddenByEntity != null && this.riddenByEntity.isDead) { ++ if (this.riddenByEntity != null && this.riddenByEntity.isDead) { + this.riddenByEntity = null; + } +- + } + } + } + + public void updateRiderPosition() { +- if(this.riddenByEntity != null) { ++ if (this.riddenByEntity != null) { + double var1 = Math.cos((double)this.rotationYaw * Math.PI / 180.0D) * 0.4D; + double var3 = Math.sin((double)this.rotationYaw * Math.PI / 180.0D) * 0.4D; + this.riddenByEntity.setPosition(this.posX + var1, this.posY + this.getMountedYOffset() + this.riddenByEntity.getYOffset(), this.posZ + var3); + } + } + +- protected void writeEntityToNBT(NBTTagCompound var1) { +- } ++ /** ++ * (abstract) Protected helper method to write subclass entity data to NBT. ++ */ ++ protected void writeEntityToNBT(NBTTagCompound par1NBTTagCompound) {} + +- protected void readEntityFromNBT(NBTTagCompound var1) { +- } ++ /** ++ * (abstract) Protected helper method to read subclass entity data from NBT. ++ */ ++ protected void readEntityFromNBT(NBTTagCompound par1NBTTagCompound) {} + + public float getShadowSize() { + return 0.0F; + } + +- public boolean interactFirst(EntityPlayer var1) { +- if(this.riddenByEntity != null && this.riddenByEntity instanceof EntityPlayer && this.riddenByEntity != var1) { ++ /** ++ * First layer of player interaction ++ */ ++ public boolean interactFirst(EntityPlayer par1EntityPlayer) { ++ if (this.riddenByEntity != null && this.riddenByEntity instanceof EntityPlayer && this.riddenByEntity != par1EntityPlayer) { + return true; + } else { +- if(!this.worldObj.isRemote) { +- var1.mountEntity(this); ++ if (!this.worldObj.isRemote) { ++ par1EntityPlayer.mountEntity(this); + } + + return true; + } + } + +- public void setDamageTaken(float var1) { +- this.dataWatcher.updateObject(19, Float.valueOf(var1)); ++ /** ++ * Sets the damage taken from the last hit. ++ */ ++ public void setDamageTaken(float par1) { ++ this.dataWatcher.updateObject(19, Float.valueOf(par1)); + } + ++ /** ++ * Gets the damage taken from the last hit. ++ */ + public float getDamageTaken() { + return this.dataWatcher.getWatchableObjectFloat(19); + } + +- public void setTimeSinceHit(int var1) { +- this.dataWatcher.updateObject(17, Integer.valueOf(var1)); ++ /** ++ * Sets the time to count down from since the last time entity was hit. ++ */ ++ public void setTimeSinceHit(int par1) { ++ this.dataWatcher.updateObject(17, Integer.valueOf(par1)); + } + ++ /** ++ * Gets the time since the last hit. ++ */ + public int getTimeSinceHit() { + return this.dataWatcher.getWatchableObjectInt(17); + } + +- public void setForwardDirection(int var1) { +- this.dataWatcher.updateObject(18, Integer.valueOf(var1)); ++ /** ++ * Sets the forward direction of the entity. ++ */ ++ public void setForwardDirection(int par1) { ++ this.dataWatcher.updateObject(18, Integer.valueOf(par1)); + } + ++ /** ++ * Gets the forward direction of the entity. ++ */ + public int getForwardDirection() { + return this.dataWatcher.getWatchableObjectInt(18); + } + +- public void func_70270_d(boolean var1) { +- this.field_70279_a = var1; ++ public void func_70270_d(boolean par1) { ++ this.field_70279_a = par1; + } + } diff --git a/patches/net/minecraft/src/EntityBodyHelper.java.patch b/patches/net/minecraft/src/EntityBodyHelper.java.patch new file mode 100644 index 0000000..942f79b --- /dev/null +++ b/patches/net/minecraft/src/EntityBodyHelper.java.patch @@ -0,0 +1,73 @@ +--- net/minecraft/src/EntityBodyHelper.java ++++ net/minecraft/src/EntityBodyHelper.java +@@ -1,31 +1,36 @@ + package net.minecraft.src; + + public class EntityBodyHelper { ++ ++ /** Instance of EntityLiving. */ + private EntityLivingBase theLiving; + private int field_75666_b; + private float field_75667_c; + +- public EntityBodyHelper(EntityLivingBase var1) { +- this.theLiving = var1; ++ public EntityBodyHelper(EntityLivingBase par1EntityLivingBase) { ++ this.theLiving = par1EntityLivingBase; + } + + public void func_75664_a() { + double var1 = this.theLiving.posX - this.theLiving.prevPosX; + double var3 = this.theLiving.posZ - this.theLiving.prevPosZ; +- if(var1 * var1 + var3 * var3 > (double)2.5000003E-7F) { ++ ++ if (var1 * var1 + var3 * var3 > 2.500000277905201E-7D) { + this.theLiving.renderYawOffset = this.theLiving.rotationYaw; + this.theLiving.rotationYawHead = this.func_75665_a(this.theLiving.renderYawOffset, this.theLiving.rotationYawHead, 75.0F); + this.field_75667_c = this.theLiving.rotationYawHead; + this.field_75666_b = 0; + } else { + float var5 = 75.0F; +- if(Math.abs(this.theLiving.rotationYawHead - this.field_75667_c) > 15.0F) { ++ ++ if (Math.abs(this.theLiving.rotationYawHead - this.field_75667_c) > 15.0F) { + this.field_75666_b = 0; + this.field_75667_c = this.theLiving.rotationYawHead; + } else { + ++this.field_75666_b; + boolean var6 = true; +- if(this.field_75666_b > 10) { ++ ++ if (this.field_75666_b > 10) { + var5 = Math.max(1.0F - (float)(this.field_75666_b - 10) / 10.0F, 0.0F) * 75.0F; + } + } +@@ -34,16 +39,17 @@ + } + } + +- private float func_75665_a(float var1, float var2, float var3) { +- float var4 = MathHelper.wrapAngleTo180_float(var1 - var2); +- if(var4 < -var3) { +- var4 = -var3; +- } +- +- if(var4 >= var3) { +- var4 = var3; +- } +- +- return var1 - var4; ++ private float func_75665_a(float par1, float par2, float par3) { ++ float var4 = MathHelper.wrapAngleTo180_float(par1 - par2); ++ ++ if (var4 < -par3) { ++ var4 = -par3; ++ } ++ ++ if (var4 >= par3) { ++ var4 = par3; ++ } ++ ++ return par1 - var4; + } + } diff --git a/patches/net/minecraft/src/EntityBreakingFX.java.patch b/patches/net/minecraft/src/EntityBreakingFX.java.patch new file mode 100644 index 0000000..ad49d70 --- /dev/null +++ b/patches/net/minecraft/src/EntityBreakingFX.java.patch @@ -0,0 +1,114 @@ +--- net/minecraft/src/EntityBreakingFX.java ++++ net/minecraft/src/EntityBreakingFX.java +@@ -1,53 +1,81 @@ + package net.minecraft.src; + ++import net.minecraft.src.Item; ++import net.minecraft.src.Minecraft; ++import net.minecraft.src.World; ++ ++import org.newdawn.slick.opengl.Texture; ++ ++import org.spoutcraft.client.io.CustomTextureManager; ++import org.spoutcraft.client.SpoutClient; ++ + public class EntityBreakingFX extends EntityFX { +- public EntityBreakingFX(World var1, double var2, double var4, double var6, Item var8) { +- this(var1, var2, var4, var6, var8, 0); +- } +- +- public EntityBreakingFX(World var1, double var2, double var4, double var6, Item var8, int var9) { +- super(var1, var2, var4, var6, 0.0D, 0.0D, 0.0D); +- this.setParticleIcon(var8.getIconFromDamage(var9)); ++ ++ public Texture currentTexture = null; ++ ++ // Spout > Lots of things changed in this class. ++ public EntityBreakingFX(World par1World, double par2, double par4, double par6, Item par8Item) { ++ this(par1World, par2, par4, par6, par8Item, 0, null); ++ } ++ ++ public EntityBreakingFX(World par1World, double par2, double par4, double par6, Item par8Item, int par9) { ++ this(par1World, par2, par4, par6, par8Item, par9, null); ++ } ++ ++ public EntityBreakingFX(World par1World, double par2, double par4, double par6, Item par8Item, int par9, Texture texture) { ++ super(par1World, par2, par4, par6, 0.0D, 0.0D, 0.0D); ++ this.currentTexture = texture; ++ this.setParticleIcon(par8Item.getIconFromDamage(par9)); + this.particleRed = this.particleGreen = this.particleBlue = 1.0F; + this.particleGravity = Block.blockSnow.blockParticleGravity; + this.particleScale /= 2.0F; +- } +- +- public EntityBreakingFX(World var1, double var2, double var4, double var6, double var8, double var10, double var12, Item var14, int var15) { +- this(var1, var2, var4, var6, var14, var15); +- this.motionX *= (double)0.1F; +- this.motionY *= (double)0.1F; +- this.motionZ *= (double)0.1F; +- this.motionX += var8; +- this.motionY += var10; +- this.motionZ += var12; ++ ++ } ++ ++ public EntityBreakingFX(World par1World, double par2, double par4, double par6, double par8, double par10, double par12, Item par14Item, int par15) { ++ this(par1World, par2, par4, par6, par8, par10, par12, par14Item, par15, null); ++ } ++ ++ public EntityBreakingFX(World par1World, double par2, double par4, double par6, double par8, double par10, double par12, Item par14Item, int par15, Texture texture) { ++ this(par1World, par2, par4, par6, par14Item, par15, texture); ++ this.motionX *= 0.10000000149011612D; ++ this.motionY *= 0.10000000149011612D; ++ this.motionZ *= 0.10000000149011612D; ++ this.motionX += par8; ++ this.motionY += par10; ++ this.motionZ += par12; + } + + public int getFXLayer() { + return 2; + } + +- public void renderParticle(Tessellator var1, float var2, float var3, float var4, float var5, float var6, float var7) { ++ public void renderParticle(Tessellator par1Tessellator, float par2, float par3, float par4, float par5, float par6, float par7) { ++ if (currentTexture != null) { ++ SpoutClient.getHandle().renderEngine.bindTexture(currentTexture.getTextureID()); ++ } + float var8 = ((float)this.particleTextureIndexX + this.particleTextureJitterX / 4.0F) / 16.0F; +- float var9 = var8 + 0.999F / 64.0F; ++ float var9 = var8 + 0.015609375F; + float var10 = ((float)this.particleTextureIndexY + this.particleTextureJitterY / 4.0F) / 16.0F; +- float var11 = var10 + 0.999F / 64.0F; ++ float var11 = var10 + 0.015609375F; + float var12 = 0.1F * this.particleScale; +- if(this.particleIcon != null) { ++ ++ if (this.particleIcon != null) { + var8 = this.particleIcon.getInterpolatedU((double)(this.particleTextureJitterX / 4.0F * 16.0F)); + var9 = this.particleIcon.getInterpolatedU((double)((this.particleTextureJitterX + 1.0F) / 4.0F * 16.0F)); + var10 = this.particleIcon.getInterpolatedV((double)(this.particleTextureJitterY / 4.0F * 16.0F)); + var11 = this.particleIcon.getInterpolatedV((double)((this.particleTextureJitterY + 1.0F) / 4.0F * 16.0F)); + } +- +- float var13 = (float)(this.prevPosX + (this.posX - this.prevPosX) * (double)var2 - interpPosX); +- float var14 = (float)(this.prevPosY + (this.posY - this.prevPosY) * (double)var2 - interpPosY); +- float var15 = (float)(this.prevPosZ + (this.posZ - this.prevPosZ) * (double)var2 - interpPosZ); ++ ++ // ToDo: More work needed here to set the custom X/Y coords of the vertex calculations since we are not using icons for custom blocks. ++ float var13 = (float)(this.prevPosX + (this.posX - this.prevPosX) * (double)par2 - interpPosX); ++ float var14 = (float)(this.prevPosY + (this.posY - this.prevPosY) * (double)par2 - interpPosY); ++ float var15 = (float)(this.prevPosZ + (this.posZ - this.prevPosZ) * (double)par2 - interpPosZ); + float var16 = 1.0F; +- var1.setColorOpaque_F(var16 * this.particleRed, var16 * this.particleGreen, var16 * this.particleBlue); +- var1.addVertexWithUV((double)(var13 - var3 * var12 - var6 * var12), (double)(var14 - var4 * var12), (double)(var15 - var5 * var12 - var7 * var12), (double)var8, (double)var11); +- var1.addVertexWithUV((double)(var13 - var3 * var12 + var6 * var12), (double)(var14 + var4 * var12), (double)(var15 - var5 * var12 + var7 * var12), (double)var8, (double)var10); +- var1.addVertexWithUV((double)(var13 + var3 * var12 + var6 * var12), (double)(var14 + var4 * var12), (double)(var15 + var5 * var12 + var7 * var12), (double)var9, (double)var10); +- var1.addVertexWithUV((double)(var13 + var3 * var12 - var6 * var12), (double)(var14 - var4 * var12), (double)(var15 + var5 * var12 - var7 * var12), (double)var9, (double)var11); ++ par1Tessellator.setColorOpaque_F(var16 * this.particleRed, var16 * this.particleGreen, var16 * this.particleBlue); ++ par1Tessellator.addVertexWithUV((double)(var13 - par3 * var12 - par6 * var12), (double)(var14 - par4 * var12), (double)(var15 - par5 * var12 - par7 * var12), (double)var8, (double)var11); ++ par1Tessellator.addVertexWithUV((double)(var13 - par3 * var12 + par6 * var12), (double)(var14 + par4 * var12), (double)(var15 - par5 * var12 + par7 * var12), (double)var8, (double)var10); ++ par1Tessellator.addVertexWithUV((double)(var13 + par3 * var12 + par6 * var12), (double)(var14 + par4 * var12), (double)(var15 + par5 * var12 + par7 * var12), (double)var9, (double)var10); ++ par1Tessellator.addVertexWithUV((double)(var13 + par3 * var12 - par6 * var12), (double)(var14 - par4 * var12), (double)(var15 + par5 * var12 - par7 * var12), (double)var9, (double)var11); + } + } diff --git a/patches/net/minecraft/src/EntityBubbleFX.java.patch b/patches/net/minecraft/src/EntityBubbleFX.java.patch new file mode 100644 index 0000000..2f0af07 --- /dev/null +++ b/patches/net/minecraft/src/EntityBubbleFX.java.patch @@ -0,0 +1,74 @@ +--- net/minecraft/src/EntityBubbleFX.java ++++ net/minecraft/src/EntityBubbleFX.java +@@ -1,36 +1,51 @@ + package net.minecraft.src; + ++// MCPatcher Start ++import com.prupe.mcpatcher.cc.ColorizeBlock; ++// MCPatcher End ++ + public class EntityBubbleFX extends EntityFX { +- public EntityBubbleFX(World var1, double var2, double var4, double var6, double var8, double var10, double var12) { +- super(var1, var2, var4, var6, var8, var10, var12); +- this.particleRed = 1.0F; +- this.particleGreen = 1.0F; +- this.particleBlue = 1.0F; ++ public EntityBubbleFX(World par1World, double par2, double par4, double par6, double par8, double par10, double par12) { ++ super(par1World, par2, par4, par6, par8, par10, par12); ++ // MCPatcher Start ++ if (ColorizeBlock.computeWaterColor(this.posX, this.posY, this.posZ)) { ++ this.particleRed = ColorizeBlock.waterColor[0]; ++ this.particleGreen = ColorizeBlock.waterColor[1]; ++ this.particleBlue = ColorizeBlock.waterColor[2]; ++ } else { ++ this.particleRed = 1.0F; ++ this.particleGreen = 1.0F; ++ this.particleBlue = 1.0F; ++ } ++ // MCPatcher End + this.setParticleTextureIndex(32); + this.setSize(0.02F, 0.02F); +- this.particleScale *= this.ab.nextFloat() * 0.6F + 0.2F; +- this.motionX = var8 * (double)0.2F + (double)((float)(Math.random() * 2.0D - 1.0D) * 0.02F); +- this.motionY = var10 * (double)0.2F + (double)((float)(Math.random() * 2.0D - 1.0D) * 0.02F); +- this.motionZ = var12 * (double)0.2F + (double)((float)(Math.random() * 2.0D - 1.0D) * 0.02F); ++ this.particleScale *= this.rand.nextFloat() * 0.6F + 0.2F; ++ this.motionX = par8 * 0.20000000298023224D + (double)((float)(Math.random() * 2.0D - 1.0D) * 0.02F); ++ this.motionY = par10 * 0.20000000298023224D + (double)((float)(Math.random() * 2.0D - 1.0D) * 0.02F); ++ this.motionZ = par12 * 0.20000000298023224D + (double)((float)(Math.random() * 2.0D - 1.0D) * 0.02F); + this.particleMaxAge = (int)(8.0D / (Math.random() * 0.8D + 0.2D)); + } + ++ /** ++ * Called to update the entity's position/logic. ++ */ + public void onUpdate() { + this.prevPosX = this.posX; + this.prevPosY = this.posY; + this.prevPosZ = this.posZ; + this.motionY += 0.002D; + this.moveEntity(this.motionX, this.motionY, this.motionZ); +- this.motionX *= (double)0.85F; +- this.motionY *= (double)0.85F; +- this.motionZ *= (double)0.85F; +- if(this.worldObj.getBlockMaterial(MathHelper.floor_double(this.posX), MathHelper.floor_double(this.posY), MathHelper.floor_double(this.posZ)) != Material.water) { +- this.setDead(); +- } +- +- if(this.particleMaxAge-- <= 0) { +- this.setDead(); +- } +- ++ this.motionX *= 0.8500000238418579D; ++ this.motionY *= 0.8500000238418579D; ++ this.motionZ *= 0.8500000238418579D; ++ ++ if (this.worldObj.getBlockMaterial(MathHelper.floor_double(this.posX), MathHelper.floor_double(this.posY), MathHelper.floor_double(this.posZ)) != Material.water) { ++ this.setDead(); ++ } ++ ++ if (this.particleMaxAge-- <= 0) { ++ this.setDead(); ++ } + } + } diff --git a/patches/net/minecraft/src/EntityCaveSpider.java.patch b/patches/net/minecraft/src/EntityCaveSpider.java.patch new file mode 100644 index 0000000..7b9aebf --- /dev/null +++ b/patches/net/minecraft/src/EntityCaveSpider.java.patch @@ -0,0 +1,53 @@ +--- net/minecraft/src/EntityCaveSpider.java ++++ net/minecraft/src/EntityCaveSpider.java +@@ -1,8 +1,8 @@ + package net.minecraft.src; + + public class EntityCaveSpider extends EntitySpider { +- public EntityCaveSpider(World var1) { +- super(var1); ++ public EntityCaveSpider(World par1World) { ++ super(par1World); + this.setSize(0.7F, 0.5F); + } + +@@ -11,20 +11,21 @@ + this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setAttribute(12.0D); + } + +- public boolean attackEntityAsMob(Entity var1) { +- if(super.attackEntityAsMob(var1)) { +- if(var1 instanceof EntityLivingBase) { ++ public boolean attackEntityAsMob(Entity par1Entity) { ++ if (super.attackEntityAsMob(par1Entity)) { ++ if (par1Entity instanceof EntityLivingBase) { + byte var2 = 0; +- if(this.worldObj.difficultySetting > 1) { +- if(this.worldObj.difficultySetting == 2) { ++ ++ if (this.worldObj.difficultySetting > 1) { ++ if (this.worldObj.difficultySetting == 2) { + var2 = 7; +- } else if(this.worldObj.difficultySetting == 3) { ++ } else if (this.worldObj.difficultySetting == 3) { + var2 = 15; + } + } + +- if(var2 > 0) { +- ((EntityLivingBase)var1).addPotionEffect(new PotionEffect(Potion.poison.id, var2 * 20, 0)); ++ if (var2 > 0) { ++ ((EntityLivingBase)par1Entity).addPotionEffect(new PotionEffect(Potion.poison.id, var2 * 20, 0)); + } + } + +@@ -34,7 +35,7 @@ + } + } + +- public EntityLivingData onSpawnWithEgg(EntityLivingData var1) { +- return var1; ++ public EntityLivingData onSpawnWithEgg(EntityLivingData par1EntityLivingData) { ++ return par1EntityLivingData; + } + } diff --git a/patches/net/minecraft/src/EntityChicken.java.patch b/patches/net/minecraft/src/EntityChicken.java.patch new file mode 100644 index 0000000..e17a139 --- /dev/null +++ b/patches/net/minecraft/src/EntityChicken.java.patch @@ -0,0 +1,172 @@ +--- net/minecraft/src/EntityChicken.java ++++ net/minecraft/src/EntityChicken.java +@@ -6,12 +6,14 @@ + public float field_70884_g; + public float field_70888_h; + public float field_70889_i = 1.0F; ++ ++ /** The time until the next egg is spawned. */ + public int timeUntilNextEgg; + +- public EntityChicken(World var1) { +- super(var1); ++ public EntityChicken(World par1World) { ++ super(par1World); + this.setSize(0.3F, 0.7F); +- this.timeUntilNextEgg = this.ab.nextInt(6000) + 6000; ++ this.timeUntilNextEgg = this.rand.nextInt(6000) + 6000; + this.tasks.addTask(0, new EntityAISwimming(this)); + this.tasks.addTask(1, new EntityAIPanic(this, 1.4D)); + this.tasks.addTask(2, new EntityAIMate(this, 1.0D)); +@@ -22,6 +24,9 @@ + this.tasks.addTask(7, new EntityAILookIdle(this)); + } + ++ /** ++ * Returns true if the newer Entity AI code should be run ++ */ + public boolean isAIEnabled() { + return true; + } +@@ -32,84 +37,117 @@ + this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setAttribute(0.25D); + } + ++ /** ++ * Called frequently so the entity can update its state every tick as required. For example, zombies and skeletons use ++ * this to react to sunlight and start to burn. ++ */ + public void onLivingUpdate() { + super.onLivingUpdate(); + this.field_70888_h = this.field_70886_e; + this.field_70884_g = this.destPos; + this.destPos = (float)((double)this.destPos + (double)(this.onGround ? -1 : 4) * 0.3D); +- if(this.destPos < 0.0F) { ++ ++ if (this.destPos < 0.0F) { + this.destPos = 0.0F; + } + +- if(this.destPos > 1.0F) { ++ if (this.destPos > 1.0F) { + this.destPos = 1.0F; + } + +- if(!this.onGround && this.field_70889_i < 1.0F) { ++ if (!this.onGround && this.field_70889_i < 1.0F) { + this.field_70889_i = 1.0F; + } + + this.field_70889_i = (float)((double)this.field_70889_i * 0.9D); +- if(!this.onGround && this.motionY < 0.0D) { ++ ++ if (!this.onGround && this.motionY < 0.0D) { + this.motionY *= 0.6D; + } + + this.field_70886_e += this.field_70889_i * 2.0F; +- if(!this.isChild() && !this.worldObj.isRemote && --this.timeUntilNextEgg <= 0) { +- this.playSound("mob.chicken.plop", 1.0F, (this.ab.nextFloat() - this.ab.nextFloat()) * 0.2F + 1.0F); ++ ++ if (!this.isChild() && !this.worldObj.isRemote && --this.timeUntilNextEgg <= 0) { ++ this.playSound("mob.chicken.plop", 1.0F, (this.rand.nextFloat() - this.rand.nextFloat()) * 0.2F + 1.0F); + this.dropItem(Item.egg.itemID, 1); +- this.timeUntilNextEgg = this.ab.nextInt(6000) + 6000; ++ this.timeUntilNextEgg = this.rand.nextInt(6000) + 6000; + } +- +- } +- +- protected void fall(float var1) { +- } +- ++ } ++ ++ /** ++ * Called when the mob is falling. Calculates and applies fall damage. ++ */ ++ protected void fall(float par1) {} ++ ++ /** ++ * Returns the sound this mob makes while it's alive. ++ */ + protected String getLivingSound() { + return "mob.chicken.say"; + } + ++ /** ++ * Returns the sound this mob makes when it is hurt. ++ */ + protected String getHurtSound() { + return "mob.chicken.hurt"; + } + ++ /** ++ * Returns the sound this mob makes on death. ++ */ + protected String getDeathSound() { + return "mob.chicken.hurt"; + } + +- protected void playStepSound(int var1, int var2, int var3, int var4) { ++ /** ++ * Plays step sound at given x, y, z for the entity ++ */ ++ protected void playStepSound(int par1, int par2, int par3, int par4) { + this.playSound("mob.chicken.step", 0.15F, 1.0F); + } + ++ /** ++ * Returns the item ID for the item the mob drops on death. ++ */ + protected int getDropItemId() { + return Item.feather.itemID; + } + +- protected void dropFewItems(boolean var1, int var2) { +- int var3 = this.ab.nextInt(3) + this.ab.nextInt(1 + var2); ++ /** ++ * Drop 0-2 items of this living's type. @param par1 - Whether this entity has recently been hit by a player. @param ++ * par2 - Level of Looting used to kill this mob. ++ */ ++ protected void dropFewItems(boolean par1, int par2) { ++ int var3 = this.rand.nextInt(3) + this.rand.nextInt(1 + par2); + +- for(int var4 = 0; var4 < var3; ++var4) { ++ for (int var4 = 0; var4 < var3; ++var4) { + this.dropItem(Item.feather.itemID, 1); + } + +- if(this.isBurning()) { ++ if (this.isBurning()) { + this.dropItem(Item.chickenCooked.itemID, 1); + } else { + this.dropItem(Item.chickenRaw.itemID, 1); + } +- + } + +- public EntityChicken spawnBabyAnimal(EntityAgeable var1) { ++ /** ++ * This function is used when two same-species animals in 'love mode' breed to generate the new baby animal. ++ */ ++ public EntityChicken spawnBabyAnimal(EntityAgeable par1EntityAgeable) { + return new EntityChicken(this.worldObj); + } + +- public boolean isBreedingItem(ItemStack var1) { +- return var1 != null && var1.getItem() instanceof ItemSeeds; ++ /** ++ * Checks if the parameter is an item which this animal can be fed to breed it (wheat, carrots or seeds depending on ++ * the animal type) ++ */ ++ public boolean isBreedingItem(ItemStack par1ItemStack) { ++ return par1ItemStack != null && par1ItemStack.getItem() instanceof ItemSeeds; + } + +- public EntityAgeable createChild(EntityAgeable var1) { +- return this.spawnBabyAnimal(var1); ++ public EntityAgeable createChild(EntityAgeable par1EntityAgeable) { ++ return this.spawnBabyAnimal(par1EntityAgeable); + } + } diff --git a/patches/net/minecraft/src/EntityClientPlayerMP.java.patch b/patches/net/minecraft/src/EntityClientPlayerMP.java.patch new file mode 100644 index 0000000..0e8ba99 --- /dev/null +++ b/patches/net/minecraft/src/EntityClientPlayerMP.java.patch @@ -0,0 +1,311 @@ +--- net/minecraft/src/EntityClientPlayerMP.java ++++ net/minecraft/src/EntityClientPlayerMP.java +@@ -1,49 +1,83 @@ + package net.minecraft.src; + ++import org.spoutcraft.api.gui.ScreenType; ++import org.spoutcraft.client.SpoutClient; ++import org.spoutcraft.client.packet.PacketKeyPress; ++ + public class EntityClientPlayerMP extends EntityPlayerSP { + public NetClientHandler sendQueue; + private double oldPosX; ++ ++ /** Old Minimum Y of the bounding box */ + private double oldMinY; + private double oldPosY; + private double oldPosZ; + private float oldRotationYaw; + private float oldRotationPitch; ++ ++ /** Check if was on ground last update */ + private boolean wasOnGround; ++ ++ /** should the player stop sneaking? */ + private boolean shouldStopSneaking; + private boolean wasSneaking; + private int field_71168_co; ++ ++ /** has the client player's health been set? */ + private boolean hasSetHealth; +- private String ce; ++ private String field_142022_ce; + +- public EntityClientPlayerMP(Minecraft var1, World var2, Session var3, NetClientHandler var4) { +- super(var1, var2, var3, 0); +- this.sendQueue = var4; ++ public EntityClientPlayerMP(Minecraft par1Minecraft, World par2World, Session par3Session, NetClientHandler par4NetClientHandler) { ++ super(par1Minecraft, par2World, par3Session, 0); ++ this.sendQueue = par4NetClientHandler; + } + +- public boolean attackEntityFrom(DamageSource var1, float var2) { ++ /** ++ * Called when the entity is attacked. ++ */ ++ public boolean attackEntityFrom(DamageSource par1DamageSource, float par2) { + return false; + } + +- public void heal(float var1) { +- } ++ /** ++ * Heal living entity (param: amount of half-hearts) ++ */ ++ public void heal(int par1) {} + ++ /** ++ * Called to update the entity's position/logic. ++ */ + public void onUpdate() { +- if(this.worldObj.blockExists(MathHelper.floor_double(this.posX), 0, MathHelper.floor_double(this.posZ))) { ++ if (this.worldObj.blockExists(MathHelper.floor_double(this.posX), 0, MathHelper.floor_double(this.posZ))) { + super.onUpdate(); +- if(this.isRiding()) { ++ if (this.isRiding()) { + this.sendQueue.addToSendQueue(new Packet12PlayerLook(this.rotationYaw, this.rotationPitch, this.onGround)); + this.sendQueue.addToSendQueue(new Packet27PlayerInput(this.moveStrafing, this.moveForward, this.movementInput.jump, this.movementInput.sneak)); + } else { + this.sendMotionUpdates(); + } ++ } + ++ // Spout Start ++ if (!this.isRiding()) { ++ if (!this.isSprinting() && runToggle) { ++ if (canSprint()) { ++ setSprinting(true); ++ this.sendQueue.addToSendQueue(new Packet19EntityAction(this, 4)); ++ } ++ } + } ++ // Spout End + } + ++ /** ++ * Send updated motion and position information to the server ++ */ + public void sendMotionUpdates() { + boolean var1 = this.isSprinting(); +- if(var1 != this.wasSneaking) { +- if(var1) { ++ ++ if (var1 != this.wasSneaking) { ++ if (var1) { + this.sendQueue.addToSendQueue(new Packet19EntityAction(this, 4)); + } else { + this.sendQueue.addToSendQueue(new Packet19EntityAction(this, 5)); +@@ -53,8 +87,9 @@ + } + + boolean var2 = this.isSneaking(); +- if(var2 != this.shouldStopSneaking) { +- if(var2) { ++ ++ if (var2 != this.shouldStopSneaking) { ++ if (var2) { + this.sendQueue.addToSendQueue(new Packet19EntityAction(this, 1)); + } else { + this.sendQueue.addToSendQueue(new Packet19EntityAction(this, 2)); +@@ -68,16 +103,19 @@ + double var7 = this.posZ - this.oldPosZ; + double var9 = (double)(this.rotationYaw - this.oldRotationYaw); + double var11 = (double)(this.rotationPitch - this.oldRotationPitch); +- boolean var13 = var3 * var3 + var5 * var5 + var7 * var7 > 9.0E-4D || this.field_71168_co >= 20; ++ // Spout Start - Send more updates while airborne. ++ boolean var13 = var3 * var3 + var5 * var5 + var7 * var7 > 9.0E-4D || this.field_71168_co >= (this.isAirBorne ? 4 : 20); ++ // Spout End + boolean var14 = var9 != 0.0D || var11 != 0.0D; +- if(this.ridingEntity != null) { ++ ++ if (this.ridingEntity != null) { + this.sendQueue.addToSendQueue(new Packet13PlayerLookMove(this.motionX, -999.0D, -999.0D, this.motionZ, this.rotationYaw, this.rotationPitch, this.onGround)); + var13 = false; +- } else if(var13 && var14) { ++ } else if (var13 && var14) { + this.sendQueue.addToSendQueue(new Packet13PlayerLookMove(this.posX, this.boundingBox.minY, this.posY, this.posZ, this.rotationYaw, this.rotationPitch, this.onGround)); +- } else if(var13) { ++ } else if (var13) { + this.sendQueue.addToSendQueue(new Packet11PlayerPosition(this.posX, this.boundingBox.minY, this.posY, this.posZ, this.onGround)); +- } else if(var14) { ++ } else if (var14) { + this.sendQueue.addToSendQueue(new Packet12PlayerLook(this.rotationYaw, this.rotationPitch, this.onGround)); + } else { + this.sendQueue.addToSendQueue(new Packet10Flying(this.onGround)); +@@ -85,7 +123,8 @@ + + ++this.field_71168_co; + this.wasOnGround = this.onGround; +- if(var13) { ++ ++ if (var13) { + this.oldPosX = this.posX; + this.oldMinY = this.boundingBox.minY; + this.oldPosY = this.posY; +@@ -93,26 +132,36 @@ + this.field_71168_co = 0; + } + +- if(var14) { ++ if (var14) { + this.oldRotationYaw = this.rotationYaw; + this.oldRotationPitch = this.rotationPitch; + } +- + } + +- public EntityItem dropOneItem(boolean var1) { +- int var2 = var1 ? 3 : 4; ++ /** ++ * Called when player presses the drop item key ++ */ ++ public EntityItem dropOneItem(boolean par1) { ++ int var2 = par1 ? 3 : 4; + this.sendQueue.addToSendQueue(new Packet14BlockDig(var2, 0, 0, 0, 0)); + return null; + } + +- protected void joinEntityItemWithWorld(EntityItem var1) { +- } +- +- public void sendChatMessage(String var1) { +- this.sendQueue.addToSendQueue(new Packet3Chat(var1)); +- } +- ++ /** ++ * Joins the passed in entity item with the world. Args: entityItem ++ */ ++ protected void joinEntityItemWithWorld(EntityItem par1EntityItem) {} ++ ++ /** ++ * Sends a chat message from the player. Args: chatMessage ++ */ ++ public void sendChatMessage(String par1Str) { ++ this.sendQueue.addToSendQueue(new Packet3Chat(par1Str)); ++ } ++ ++ /** ++ * Swings the item the player is holding. ++ */ + public void swingItem() { + super.swingItem(); + this.sendQueue.addToSendQueue(new Packet18Animation(this, 1)); +@@ -122,12 +171,21 @@ + this.sendQueue.addToSendQueue(new Packet205ClientCommand(1)); + } + +- protected void damageEntity(DamageSource var1, float var2) { +- if(!this.isEntityInvulnerable()) { +- this.setHealth(this.getHealth() - var2); ++ /** ++ * Deals damage to the entity. If its a EntityPlayer then will take damage from the armor first and then health second ++ * with the reduced value. Args: damageAmount ++ */ ++ // Spout Start - private to public ++ public void damageEntity(DamageSource par1DamageSource, float par2) { ++ // Spout End ++ if (!this.isEntityInvulnerable()) { ++ this.setHealth(this.getHealth() - par2); + } + } + ++ /** ++ * sets current screen to null (used on escape buttons of GUIs) ++ */ + public void closeScreen() { + this.sendQueue.addToSendQueue(new Packet101CloseWindow(this.openContainer.windowId)); + this.func_92015_f(); +@@ -138,34 +196,43 @@ + super.closeScreen(); + } + +- public void setPlayerSPHealth(float var1) { +- if(this.hasSetHealth) { +- super.setPlayerSPHealth(var1); ++ /** ++ * Updates health locally. ++ */ ++ public void setPlayerSPHealth(float par1) { ++ if (this.hasSetHealth) { ++ super.setPlayerSPHealth(par1); + } else { +- this.setHealth(var1); ++ this.setHealth(par1); + this.hasSetHealth = true; + } +- +- } +- +- public void addStat(StatBase var1, int var2) { +- if(var1 != null) { +- if(var1.isIndependent) { +- super.addStat(var1, var2); +- } +- +- } +- } +- +- public void incrementStat(StatBase var1, int var2) { +- if(var1 != null) { +- if(!var1.isIndependent) { +- super.addStat(var1, var2); +- } +- +- } +- } +- ++ } ++ ++ /** ++ * Adds a value to a statistic field. ++ */ ++ public void addStat(StatBase par1StatBase, int par2) { ++ if (par1StatBase != null) { ++ if (par1StatBase.isIndependent) { ++ super.addStat(par1StatBase, par2); ++ } ++ } ++ } ++ ++ /** ++ * Used by NetClientHandler.handleStatistic ++ */ ++ public void incrementStat(StatBase par1StatBase, int par2) { ++ if (par1StatBase != null) { ++ if (!par1StatBase.isIndependent) { ++ super.addStat(par1StatBase, par2); ++ } ++ } ++ } ++ ++ /** ++ * Sends the player's abilities to the server (if there is one). ++ */ + public void sendPlayerAbilities() { + this.sendQueue.addToSendQueue(new Packet202PlayerAbilities(this.capabilities)); + } +@@ -178,11 +245,21 @@ + this.sendQueue.addToSendQueue(new Packet19EntityAction(this, 7)); + } + +- public void func_142020_c(String var1) { +- this.ce = var1; ++ public void func_142020_c(String par1Str) { ++ this.field_142022_ce = par1Str; + } + + public String func_142021_k() { +- return this.ce; ++ return this.field_142022_ce; + } ++ ++ // Spout Start ++ @Override ++ public void handleKeyPress(int i, boolean keyReleased) { ++ if (SpoutClient.getInstance().isSpoutEnabled()) { ++ SpoutClient.getInstance().getPacketManager().sendSpoutPacket(new PacketKeyPress(i, keyReleased, (MovementInputFromOptions)movementInput, ScreenType.GAME_SCREEN)); ++ } ++ ++ super.handleKeyPress(i, keyReleased); ++ } + } diff --git a/patches/net/minecraft/src/EntityCloudFX.java.patch b/patches/net/minecraft/src/EntityCloudFX.java.patch new file mode 100644 index 0000000..400c2f8 --- /dev/null +++ b/patches/net/minecraft/src/EntityCloudFX.java.patch @@ -0,0 +1,94 @@ +--- net/minecraft/src/EntityCloudFX.java ++++ net/minecraft/src/EntityCloudFX.java +@@ -3,17 +3,17 @@ + public class EntityCloudFX extends EntityFX { + float field_70569_a; + +- public EntityCloudFX(World var1, double var2, double var4, double var6, double var8, double var10, double var12) { +- super(var1, var2, var4, var6, 0.0D, 0.0D, 0.0D); ++ public EntityCloudFX(World par1World, double par2, double par4, double par6, double par8, double par10, double par12) { ++ super(par1World, par2, par4, par6, 0.0D, 0.0D, 0.0D); + float var14 = 2.5F; +- this.motionX *= (double)0.1F; +- this.motionY *= (double)0.1F; +- this.motionZ *= (double)0.1F; +- this.motionX += var8; +- this.motionY += var10; +- this.motionZ += var12; +- this.particleRed = this.particleGreen = this.particleBlue = 1.0F - (float)(Math.random() * (double)0.3F); +- this.particleScale *= 12.0F / 16.0F; ++ this.motionX *= 0.10000000149011612D; ++ this.motionY *= 0.10000000149011612D; ++ this.motionZ *= 0.10000000149011612D; ++ this.motionX += par8; ++ this.motionY += par10; ++ this.motionZ += par12; ++ this.particleRed = this.particleGreen = this.particleBlue = 1.0F - (float)(Math.random() * 0.30000001192092896D); ++ this.particleScale *= 0.75F; + this.particleScale *= var14; + this.field_70569_a = this.particleScale; + this.particleMaxAge = (int)(8.0D / (Math.random() * 0.8D + 0.3D)); +@@ -21,44 +21,49 @@ + this.noClip = false; + } + +- public void renderParticle(Tessellator var1, float var2, float var3, float var4, float var5, float var6, float var7) { +- float var8 = ((float)this.particleAge + var2) / (float)this.particleMaxAge * 32.0F; +- if(var8 < 0.0F) { ++ public void renderParticle(Tessellator par1Tessellator, float par2, float par3, float par4, float par5, float par6, float par7) { ++ float var8 = ((float)this.particleAge + par2) / (float)this.particleMaxAge * 32.0F; ++ ++ if (var8 < 0.0F) { + var8 = 0.0F; + } + +- if(var8 > 1.0F) { ++ if (var8 > 1.0F) { + var8 = 1.0F; + } + + this.particleScale = this.field_70569_a * var8; +- super.renderParticle(var1, var2, var3, var4, var5, var6, var7); ++ super.renderParticle(par1Tessellator, par2, par3, par4, par5, par6, par7); + } + ++ /** ++ * Called to update the entity's position/logic. ++ */ + public void onUpdate() { + this.prevPosX = this.posX; + this.prevPosY = this.posY; + this.prevPosZ = this.posZ; +- if(this.particleAge++ >= this.particleMaxAge) { ++ ++ if (this.particleAge++ >= this.particleMaxAge) { + this.setDead(); + } + + this.setParticleTextureIndex(7 - this.particleAge * 8 / this.particleMaxAge); + this.moveEntity(this.motionX, this.motionY, this.motionZ); +- this.motionX *= (double)0.96F; +- this.motionY *= (double)0.96F; +- this.motionZ *= (double)0.96F; ++ this.motionX *= 0.9599999785423279D; ++ this.motionY *= 0.9599999785423279D; ++ this.motionZ *= 0.9599999785423279D; + EntityPlayer var1 = this.worldObj.getClosestPlayerToEntity(this, 2.0D); +- if(var1 != null && this.posY > var1.boundingBox.minY) { ++ ++ if (var1 != null && this.posY > var1.boundingBox.minY) { + this.posY += (var1.boundingBox.minY - this.posY) * 0.2D; + this.motionY += (var1.motionY - this.motionY) * 0.2D; + this.setPosition(this.posX, this.posY, this.posZ); + } + +- if(this.onGround) { +- this.motionX *= (double)0.7F; +- this.motionZ *= (double)0.7F; ++ if (this.onGround) { ++ this.motionX *= 0.699999988079071D; ++ this.motionZ *= 0.699999988079071D; + } +- + } + } diff --git a/patches/net/minecraft/src/EntityCow.java.patch b/patches/net/minecraft/src/EntityCow.java.patch new file mode 100644 index 0000000..4ab3ca0 --- /dev/null +++ b/patches/net/minecraft/src/EntityCow.java.patch @@ -0,0 +1,146 @@ +--- net/minecraft/src/EntityCow.java ++++ net/minecraft/src/EntityCow.java +@@ -1,8 +1,8 @@ + package net.minecraft.src; + + public class EntityCow extends EntityAnimal { +- public EntityCow(World var1) { +- super(var1); ++ public EntityCow(World par1World) { ++ super(par1World); + this.setSize(0.9F, 1.3F); + this.getNavigator().setAvoidsWater(true); + this.tasks.addTask(0, new EntityAISwimming(this)); +@@ -15,6 +15,9 @@ + this.tasks.addTask(7, new EntityAILookIdle(this)); + } + ++ /** ++ * Returns true if the newer Entity AI code should be run ++ */ + public boolean isAIEnabled() { + return true; + } +@@ -22,73 +25,101 @@ + protected void applyEntityAttributes() { + super.applyEntityAttributes(); + this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setAttribute(10.0D); +- this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setAttribute((double)0.2F); ++ this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setAttribute(0.20000000298023224D); + } + ++ /** ++ * Returns the sound this mob makes while it's alive. ++ */ + protected String getLivingSound() { + return "mob.cow.say"; + } + ++ /** ++ * Returns the sound this mob makes when it is hurt. ++ */ + protected String getHurtSound() { + return "mob.cow.hurt"; + } + ++ /** ++ * Returns the sound this mob makes on death. ++ */ + protected String getDeathSound() { + return "mob.cow.hurt"; + } + +- protected void playStepSound(int var1, int var2, int var3, int var4) { ++ /** ++ * Plays step sound at given x, y, z for the entity ++ */ ++ protected void playStepSound(int par1, int par2, int par3, int par4) { + this.playSound("mob.cow.step", 0.15F, 1.0F); + } + ++ /** ++ * Returns the volume for the sounds this mob makes. ++ */ + protected float getSoundVolume() { + return 0.4F; + } + ++ /** ++ * Returns the item ID for the item the mob drops on death. ++ */ + protected int getDropItemId() { + return Item.leather.itemID; + } + +- protected void dropFewItems(boolean var1, int var2) { +- int var3 = this.ab.nextInt(3) + this.ab.nextInt(1 + var2); +- ++ /** ++ * Drop 0-2 items of this living's type. @param par1 - Whether this entity has recently been hit by a player. @param ++ * par2 - Level of Looting used to kill this mob. ++ */ ++ protected void dropFewItems(boolean par1, int par2) { ++ int var3 = this.rand.nextInt(3) + this.rand.nextInt(1 + par2); + int var4; +- for(var4 = 0; var4 < var3; ++var4) { ++ ++ for (var4 = 0; var4 < var3; ++var4) { + this.dropItem(Item.leather.itemID, 1); + } + +- var3 = this.ab.nextInt(3) + 1 + this.ab.nextInt(1 + var2); ++ var3 = this.rand.nextInt(3) + 1 + this.rand.nextInt(1 + par2); + +- for(var4 = 0; var4 < var3; ++var4) { +- if(this.isBurning()) { ++ for (var4 = 0; var4 < var3; ++var4) { ++ if (this.isBurning()) { + this.dropItem(Item.beefCooked.itemID, 1); + } else { + this.dropItem(Item.beefRaw.itemID, 1); + } + } +- + } + +- public boolean interact(EntityPlayer var1) { +- ItemStack var2 = var1.inventory.getCurrentItem(); +- if(var2 != null && var2.itemID == Item.bucketEmpty.itemID && !var1.capabilities.isCreativeMode) { +- if(var2.stackSize-- == 1) { +- var1.inventory.setInventorySlotContents(var1.inventory.currentItem, new ItemStack(Item.bucketMilk)); +- } else if(!var1.inventory.addItemStackToInventory(new ItemStack(Item.bucketMilk))) { +- var1.dropPlayerItem(new ItemStack(Item.bucketMilk.itemID, 1, 0)); ++ /** ++ * Called when a player interacts with a mob. e.g. gets milk from a cow, gets into the saddle on a pig. ++ */ ++ public boolean interact(EntityPlayer par1EntityPlayer) { ++ ItemStack var2 = par1EntityPlayer.inventory.getCurrentItem(); ++ ++ if (var2 != null && var2.itemID == Item.bucketEmpty.itemID && !par1EntityPlayer.capabilities.isCreativeMode) { ++ if (var2.stackSize-- == 1) { ++ par1EntityPlayer.inventory.setInventorySlotContents(par1EntityPlayer.inventory.currentItem, new ItemStack(Item.bucketMilk)); ++ } else if (!par1EntityPlayer.inventory.addItemStackToInventory(new ItemStack(Item.bucketMilk))) { ++ par1EntityPlayer.dropPlayerItem(new ItemStack(Item.bucketMilk.itemID, 1, 0)); + } + + return true; + } else { +- return super.interact(var1); ++ return super.interact(par1EntityPlayer); + } + } + +- public EntityCow spawnBabyAnimal(EntityAgeable var1) { ++ /** ++ * This function is used when two same-species animals in 'love mode' breed to generate the new baby animal. ++ */ ++ public EntityCow spawnBabyAnimal(EntityAgeable par1EntityAgeable) { + return new EntityCow(this.worldObj); + } + +- public EntityAgeable createChild(EntityAgeable var1) { +- return this.spawnBabyAnimal(var1); ++ public EntityAgeable createChild(EntityAgeable par1EntityAgeable) { ++ return this.spawnBabyAnimal(par1EntityAgeable); + } + } diff --git a/patches/net/minecraft/src/EntityCreature.java.patch b/patches/net/minecraft/src/EntityCreature.java.patch new file mode 100644 index 0000000..893a68f --- /dev/null +++ b/patches/net/minecraft/src/EntityCreature.java.patch @@ -0,0 +1,381 @@ +--- net/minecraft/src/EntityCreature.java ++++ net/minecraft/src/EntityCreature.java +@@ -3,42 +3,63 @@ + import java.util.UUID; + + public abstract class EntityCreature extends EntityLiving { +- public static final UUID h = UUID.fromString("E199AD21-BA8A-4C53-8D13-6182D5C69D3A"); +- public static final AttributeModifier field_110181_i = (new AttributeModifier(h, "Fleeing speed bonus", 2.0D, 2)).setSaved(false); +- private PathEntity pathToEntity; +- protected Entity entityToAttack; ++ public static final UUID field_110179_h = UUID.fromString("E199AD21-BA8A-4C53-8D13-6182D5C69D3A"); ++ public static final AttributeModifier field_110181_i = (new AttributeModifier(field_110179_h, "Fleeing speed bonus", 2.0D, 2)).setSaved(false); ++ // Spout Start - private to public ++ public PathEntity pathToEntity; ++ // Spout End ++ ++ /** The Entity this EntityCreature is set to attack. */ ++ // Spout Start - private to public ++ public Entity entityToAttack; ++ // Spout End ++ ++ /** ++ * returns true if a creature has attacked recently only used for creepers and skeletons ++ */ + protected boolean hasAttacked; ++ ++ /** Used to make a creature speed up and wander away when hit. */ + protected int fleeingTick; + private ChunkCoordinates homePosition = new ChunkCoordinates(0, 0, 0); ++ ++ /** If -1 there is no maximum distance */ + private float maximumHomeDistance = -1.0F; + private EntityAIBase field_110178_bs = new EntityAIMoveTowardsRestriction(this, 1.0D); + private boolean field_110180_bt; + +- public EntityCreature(World var1) { +- super(var1); ++ public EntityCreature(World par1World) { ++ super(par1World); + } + ++ /** ++ * Disables a mob's ability to move on its own while true. ++ */ + protected boolean isMovementCeased() { + return false; + } + + protected void updateEntityActionState() { + this.worldObj.theProfiler.startSection("ai"); +- if(this.fleeingTick > 0 && --this.fleeingTick == 0) { ++ ++ if (this.fleeingTick > 0 && --this.fleeingTick == 0) { + AttributeInstance var1 = this.getEntityAttribute(SharedMonsterAttributes.movementSpeed); + var1.removeModifier(field_110181_i); + } + + this.hasAttacked = this.isMovementCeased(); + float var21 = 16.0F; +- if(this.entityToAttack == null) { ++ ++ if (this.entityToAttack == null) { + this.entityToAttack = this.findPlayerToAttack(); +- if(this.entityToAttack != null) { ++ ++ if (this.entityToAttack != null) { + this.pathToEntity = this.worldObj.getPathEntityToEntity(this, this.entityToAttack, var21, true, false, false, true); + } +- } else if(this.entityToAttack.isEntityAlive()) { ++ } else if (this.entityToAttack.isEntityAlive()) { + float var2 = this.entityToAttack.getDistanceToEntity(this); +- if(this.canEntityBeSeen(this.entityToAttack)) { ++ ++ if (this.canEntityBeSeen(this.entityToAttack)) { + this.attackEntity(this.entityToAttack, var2); + } + } else { +@@ -46,26 +67,27 @@ + } + + this.worldObj.theProfiler.endSection(); +- if(this.hasAttacked || this.entityToAttack == null || this.pathToEntity != null && this.ab.nextInt(20) != 0) { +- if(!this.hasAttacked && (this.pathToEntity == null && this.ab.nextInt(180) == 0 || this.ab.nextInt(120) == 0 || this.fleeingTick > 0) && this.entityAge < 100) { +- this.updateWanderPath(); +- } +- } else { ++ ++ if (!this.hasAttacked && this.entityToAttack != null && (this.pathToEntity == null || this.rand.nextInt(20) == 0)) { + this.pathToEntity = this.worldObj.getPathEntityToEntity(this, this.entityToAttack, var21, true, false, false, true); ++ } else if (!this.hasAttacked && (this.pathToEntity == null && this.rand.nextInt(180) == 0 || this.rand.nextInt(120) == 0 || this.fleeingTick > 0) && this.entityAge < 100) { ++ this.updateWanderPath(); + } + + int var22 = MathHelper.floor_double(this.boundingBox.minY + 0.5D); + boolean var3 = this.isInWater(); + boolean var4 = this.handleLavaMovement(); + this.rotationPitch = 0.0F; +- if(this.pathToEntity != null && this.ab.nextInt(100) != 0) { ++ ++ if (this.pathToEntity != null && this.rand.nextInt(100) != 0) { + this.worldObj.theProfiler.startSection("followpath"); + Vec3 var5 = this.pathToEntity.getPosition(this); + double var6 = (double)(this.width * 2.0F); + +- while(var5 != null && var5.squareDistanceTo(this.posX, var5.yCoord, this.posZ) < var6 * var6) { ++ while (var5 != null && var5.squareDistanceTo(this.posX, var5.yCoord, this.posZ) < var6 * var6) { + this.pathToEntity.incrementPathIndex(); +- if(this.pathToEntity.isFinished()) { ++ ++ if (this.pathToEntity.isFinished()) { + var5 = null; + this.pathToEntity = null; + } else { +@@ -74,46 +96,49 @@ + } + + this.isJumping = false; +- if(var5 != null) { ++ ++ if (var5 != null) { + double var8 = var5.xCoord - this.posX; + double var10 = var5.zCoord - this.posZ; + double var12 = var5.yCoord - (double)var22; +- float var14 = (float)(Math.atan2(var10, var8) * 180.0D / (double)((float)Math.PI)) - 90.0F; ++ float var14 = (float)(Math.atan2(var10, var8) * 180.0D / Math.PI) - 90.0F; + float var15 = MathHelper.wrapAngleTo180_float(var14 - this.rotationYaw); + this.moveForward = (float)this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).getAttributeValue(); +- if(var15 > 30.0F) { ++ ++ if (var15 > 30.0F) { + var15 = 30.0F; + } + +- if(var15 < -30.0F) { ++ if (var15 < -30.0F) { + var15 = -30.0F; + } + + this.rotationYaw += var15; +- if(this.hasAttacked && this.entityToAttack != null) { ++ ++ if (this.hasAttacked && this.entityToAttack != null) { + double var16 = this.entityToAttack.posX - this.posX; + double var18 = this.entityToAttack.posZ - this.posZ; + float var20 = this.rotationYaw; +- this.rotationYaw = (float)(Math.atan2(var18, var16) * 180.0D / (double)((float)Math.PI)) - 90.0F; ++ this.rotationYaw = (float)(Math.atan2(var18, var16) * 180.0D / Math.PI) - 90.0F; + var15 = (var20 - this.rotationYaw + 90.0F) * (float)Math.PI / 180.0F; + this.moveStrafing = -MathHelper.sin(var15) * this.moveForward * 1.0F; + this.moveForward = MathHelper.cos(var15) * this.moveForward * 1.0F; + } + +- if(var12 > 0.0D) { ++ if (var12 > 0.0D) { + this.isJumping = true; + } + } + +- if(this.entityToAttack != null) { ++ if (this.entityToAttack != null) { + this.faceEntity(this.entityToAttack, 30.0F, 30.0F); + } + +- if(this.isCollidedHorizontally && !this.hasPath()) { ++ if (this.isCollidedHorizontally && !this.hasPath()) { + this.isJumping = true; + } + +- if(this.ab.nextFloat() < 0.8F && (var3 || var4)) { ++ if (this.rand.nextFloat() < 0.8F && (var3 || var4)) { + this.isJumping = true; + } + +@@ -124,6 +149,9 @@ + } + } + ++ /** ++ * Time remaining during which the Animal is sped up and flees. ++ */ + protected void updateWanderPath() { + this.worldObj.theProfiler.startSection("stroll"); + boolean var1 = false; +@@ -132,12 +160,13 @@ + int var4 = -1; + float var5 = -99999.0F; + +- for(int var6 = 0; var6 < 10; ++var6) { +- int var7 = MathHelper.floor_double(this.posX + (double)this.ab.nextInt(13) - 6.0D); +- int var8 = MathHelper.floor_double(this.posY + (double)this.ab.nextInt(7) - 3.0D); +- int var9 = MathHelper.floor_double(this.posZ + (double)this.ab.nextInt(13) - 6.0D); ++ for (int var6 = 0; var6 < 10; ++var6) { ++ int var7 = MathHelper.floor_double(this.posX + (double)this.rand.nextInt(13) - 6.0D); ++ int var8 = MathHelper.floor_double(this.posY + (double)this.rand.nextInt(7) - 3.0D); ++ int var9 = MathHelper.floor_double(this.posZ + (double)this.rand.nextInt(13) - 6.0D); + float var10 = this.getBlockPathWeight(var7, var8, var9); +- if(var10 > var5) { ++ ++ if (var10 > var5) { + var5 = var10; + var2 = var7; + var3 = var8; +@@ -146,24 +175,37 @@ + } + } + +- if(var1) { ++ if (var1) { + this.pathToEntity = this.worldObj.getEntityPathToXYZ(this, var2, var3, var4, 10.0F, true, false, false, true); + } + + this.worldObj.theProfiler.endSection(); + } + +- protected void attackEntity(Entity var1, float var2) { +- } ++ /** ++ * Basic mob attack. Default to touch of death in EntityCreature. Overridden by each mob to define their attack. ++ */ ++ protected void attackEntity(Entity par1Entity, float par2) {} + +- public float getBlockPathWeight(int var1, int var2, int var3) { ++ /** ++ * Takes a coordinate in and returns a weight to determine how likely this creature will try to path to the block. ++ * Args: x, y, z ++ */ ++ public float getBlockPathWeight(int par1, int par2, int par3) { + return 0.0F; + } + ++ /** ++ * Finds the closest player within 16 blocks to attack, or null if this Entity isn't interested in attacking (Animals, ++ * Spiders at day, peaceful PigZombies). ++ */ + protected Entity findPlayerToAttack() { + return null; + } + ++ /** ++ * Checks if the entity's current position is a valid location to spawn this entity. ++ */ + public boolean getCanSpawnHere() { + int var1 = MathHelper.floor_double(this.posX); + int var2 = MathHelper.floor_double(this.boundingBox.minY); +@@ -171,35 +213,50 @@ + return super.getCanSpawnHere() && this.getBlockPathWeight(var1, var2, var3) >= 0.0F; + } + ++ /** ++ * Returns true if entity has a path to follow ++ */ + public boolean hasPath() { + return this.pathToEntity != null; + } + +- public void setPathToEntity(PathEntity var1) { +- this.pathToEntity = var1; ++ /** ++ * sets the Entities walk path in EntityCreature ++ */ ++ public void setPathToEntity(PathEntity par1PathEntity) { ++ this.pathToEntity = par1PathEntity; + } + ++ /** ++ * Returns current entities target ++ */ + public Entity getEntityToAttack() { + return this.entityToAttack; + } + +- public void setTarget(Entity var1) { +- this.entityToAttack = var1; ++ /** ++ * Sets the entity which is to be attacked. ++ */ ++ public void setTarget(Entity par1Entity) { ++ this.entityToAttack = par1Entity; + } + + public boolean func_110173_bK() { + return this.func_110176_b(MathHelper.floor_double(this.posX), MathHelper.floor_double(this.posY), MathHelper.floor_double(this.posZ)); + } + +- public boolean func_110176_b(int var1, int var2, int var3) { +- return this.maximumHomeDistance == -1.0F ? true : this.homePosition.getDistanceSquared(var1, var2, var3) < this.maximumHomeDistance * this.maximumHomeDistance; +- } +- +- public void setHomeArea(int var1, int var2, int var3, int var4) { +- this.homePosition.set(var1, var2, var3); +- this.maximumHomeDistance = (float)var4; +- } +- ++ public boolean func_110176_b(int par1, int par2, int par3) { ++ return this.maximumHomeDistance == -1.0F ? true : this.homePosition.getDistanceSquared(par1, par2, par3) < this.maximumHomeDistance * this.maximumHomeDistance; ++ } ++ ++ public void setHomeArea(int par1, int par2, int par3, int par4) { ++ this.homePosition.set(par1, par2, par3); ++ this.maximumHomeDistance = (float)par4; ++ } ++ ++ /** ++ * Returns the chunk coordinate object of the home position. ++ */ + public ChunkCoordinates getHomePosition() { + return this.homePosition; + } +@@ -212,36 +269,42 @@ + this.maximumHomeDistance = -1.0F; + } + ++ /** ++ * Returns whether a home area is defined for this entity. ++ */ + public boolean hasHome() { + return this.maximumHomeDistance != -1.0F; + } + + protected void func_110159_bB() { + super.func_110159_bB(); +- if(this.getLeashed() && this.getLeashedToEntity() != null && this.getLeashedToEntity().worldObj == this.worldObj) { ++ ++ if (this.getLeashed() && this.getLeashedToEntity() != null && this.getLeashedToEntity().worldObj == this.worldObj) { + Entity var1 = this.getLeashedToEntity(); + this.setHomeArea((int)var1.posX, (int)var1.posY, (int)var1.posZ, 5); + float var2 = this.getDistanceToEntity(var1); +- if(this instanceof EntityTameable && ((EntityTameable)this).isSitting()) { +- if(var2 > 10.0F) { ++ ++ if (this instanceof EntityTameable && ((EntityTameable)this).isSitting()) { ++ if (var2 > 10.0F) { + this.clearLeashed(true, true); + } + + return; + } + +- if(!this.field_110180_bt) { ++ if (!this.field_110180_bt) { + this.tasks.addTask(2, this.field_110178_bs); + this.getNavigator().setAvoidsWater(false); + this.field_110180_bt = true; + } + + this.func_142017_o(var2); +- if(var2 > 4.0F) { ++ ++ if (var2 > 4.0F) { + this.getNavigator().tryMoveToEntityLiving(var1, 1.0D); + } + +- if(var2 > 6.0F) { ++ if (var2 > 6.0F) { + double var3 = (var1.posX - this.posX) / (double)var2; + double var5 = (var1.posY - this.posY) / (double)var2; + double var7 = (var1.posZ - this.posZ) / (double)var2; +@@ -250,18 +313,16 @@ + this.motionZ += var7 * Math.abs(var7) * 0.4D; + } + +- if(var2 > 10.0F) { ++ if (var2 > 10.0F) { + this.clearLeashed(true, true); + } +- } else if(!this.getLeashed() && this.field_110180_bt) { ++ } else if (!this.getLeashed() && this.field_110180_bt) { + this.field_110180_bt = false; + this.tasks.removeTask(this.field_110178_bs); + this.getNavigator().setAvoidsWater(true); + this.detachHome(); + } +- +- } +- +- protected void func_142017_o(float var1) { +- } ++ } ++ ++ protected void func_142017_o(float par1) {} + } diff --git a/patches/net/minecraft/src/EntityCreeper.java.patch b/patches/net/minecraft/src/EntityCreeper.java.patch new file mode 100644 index 0000000..00bd8de --- /dev/null +++ b/patches/net/minecraft/src/EntityCreeper.java.patch @@ -0,0 +1,247 @@ +--- net/minecraft/src/EntityCreeper.java ++++ net/minecraft/src/EntityCreeper.java +@@ -1,13 +1,24 @@ + package net.minecraft.src; + + public class EntityCreeper extends EntityMob { ++ ++ /** ++ * Time when this creeper was last in an active state (Messed up code here, probably causes creeper animation to go ++ * weird) ++ */ + private int lastActiveTime; ++ ++ /** ++ * The amount of time since the creeper was close enough to the player to ignite ++ */ + private int timeSinceIgnited; + private int fuseTime = 30; ++ ++ /** Explosion radius for this creeper. */ + private int explosionRadius = 3; + +- public EntityCreeper(World var1) { +- super(var1); ++ public EntityCreeper(World par1World) { ++ super(par1World); + this.tasks.addTask(1, new EntityAISwimming(this)); + this.tasks.addTask(2, new EntityAICreeperSwell(this)); + this.tasks.addTask(3, new EntityAIAvoidEntity(this, EntityOcelot.class, 6.0F, 1.0D, 1.2D)); +@@ -24,70 +35,93 @@ + this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setAttribute(0.25D); + } + ++ /** ++ * Returns true if the newer Entity AI code should be run ++ */ + public boolean isAIEnabled() { + return true; + } + ++ /** ++ * The number of iterations PathFinder.getSafePoint will execute before giving up. ++ */ + public int getMaxSafePointTries() { + return this.getAttackTarget() == null ? 3 : 3 + (int)(this.getHealth() - 1.0F); + } + +- protected void fall(float var1) { +- super.fall(var1); +- this.timeSinceIgnited = (int)((float)this.timeSinceIgnited + var1 * 1.5F); +- if(this.timeSinceIgnited > this.fuseTime - 5) { ++ /** ++ * Called when the mob is falling. Calculates and applies fall damage. ++ */ ++ protected void fall(float par1) { ++ super.fall(par1); ++ this.timeSinceIgnited = (int)((float)this.timeSinceIgnited + par1 * 1.5F); ++ ++ if (this.timeSinceIgnited > this.fuseTime - 5) { + this.timeSinceIgnited = this.fuseTime - 5; + } +- + } + + protected void entityInit() { + super.entityInit(); +- this.dataWatcher.addObject(16, Byte.valueOf((byte)-1)); ++ this.dataWatcher.addObject(16, Byte.valueOf((byte) - 1)); + this.dataWatcher.addObject(17, Byte.valueOf((byte)0)); + } + +- public void writeEntityToNBT(NBTTagCompound var1) { +- super.writeEntityToNBT(var1); +- if(this.dataWatcher.getWatchableObjectByte(17) == 1) { +- var1.setBoolean("powered", true); +- } +- +- var1.setShort("Fuse", (short)this.fuseTime); +- var1.setByte("ExplosionRadius", (byte)this.explosionRadius); +- } +- +- public void readEntityFromNBT(NBTTagCompound var1) { +- super.readEntityFromNBT(var1); +- this.dataWatcher.updateObject(17, Byte.valueOf((byte)(var1.getBoolean("powered") ? 1 : 0))); +- if(var1.hasKey("Fuse")) { +- this.fuseTime = var1.getShort("Fuse"); +- } +- +- if(var1.hasKey("ExplosionRadius")) { +- this.explosionRadius = var1.getByte("ExplosionRadius"); +- } +- +- } +- ++ /** ++ * (abstract) Protected helper method to write subclass entity data to NBT. ++ */ ++ public void writeEntityToNBT(NBTTagCompound par1NBTTagCompound) { ++ super.writeEntityToNBT(par1NBTTagCompound); ++ ++ if (this.dataWatcher.getWatchableObjectByte(17) == 1) { ++ par1NBTTagCompound.setBoolean("powered", true); ++ } ++ ++ par1NBTTagCompound.setShort("Fuse", (short)this.fuseTime); ++ par1NBTTagCompound.setByte("ExplosionRadius", (byte)this.explosionRadius); ++ } ++ ++ /** ++ * (abstract) Protected helper method to read subclass entity data from NBT. ++ */ ++ public void readEntityFromNBT(NBTTagCompound par1NBTTagCompound) { ++ super.readEntityFromNBT(par1NBTTagCompound); ++ this.dataWatcher.updateObject(17, Byte.valueOf((byte)(par1NBTTagCompound.getBoolean("powered") ? 1 : 0))); ++ ++ if (par1NBTTagCompound.hasKey("Fuse")) { ++ this.fuseTime = par1NBTTagCompound.getShort("Fuse"); ++ } ++ ++ if (par1NBTTagCompound.hasKey("ExplosionRadius")) { ++ this.explosionRadius = par1NBTTagCompound.getByte("ExplosionRadius"); ++ } ++ } ++ ++ /** ++ * Called to update the entity's position/logic. ++ */ + public void onUpdate() { +- if(this.isEntityAlive()) { ++ if (this.isEntityAlive()) { + this.lastActiveTime = this.timeSinceIgnited; + int var1 = this.getCreeperState(); +- if(var1 > 0 && this.timeSinceIgnited == 0) { ++ ++ if (var1 > 0 && this.timeSinceIgnited == 0) { + this.playSound("random.fuse", 1.0F, 0.5F); + } + + this.timeSinceIgnited += var1; +- if(this.timeSinceIgnited < 0) { ++ ++ if (this.timeSinceIgnited < 0) { + this.timeSinceIgnited = 0; + } + +- if(this.timeSinceIgnited >= this.fuseTime) { ++ if (this.timeSinceIgnited >= this.fuseTime) { + this.timeSinceIgnited = this.fuseTime; +- if(!this.worldObj.isRemote) { ++ ++ if (!this.worldObj.isRemote) { + boolean var2 = this.worldObj.getGameRules().getGameRuleBooleanValue("mobGriefing"); +- if(this.getPowered()) { ++ ++ if (this.getPowered()) { + this.worldObj.createExplosion(this, this.posX, this.posY, this.posZ, (float)(this.explosionRadius * 2), var2); + } else { + this.worldObj.createExplosion(this, this.posX, this.posY, this.posZ, (float)this.explosionRadius, var2); +@@ -101,49 +135,76 @@ + super.onUpdate(); + } + ++ /** ++ * Returns the sound this mob makes when it is hurt. ++ */ + protected String getHurtSound() { + return "mob.creeper.say"; + } + ++ /** ++ * Returns the sound this mob makes on death. ++ */ + protected String getDeathSound() { + return "mob.creeper.death"; + } + +- public void onDeath(DamageSource var1) { +- super.onDeath(var1); +- if(var1.getEntity() instanceof EntitySkeleton) { +- int var2 = Item.record13.itemID + this.ab.nextInt(Item.recordWait.itemID - Item.record13.itemID + 1); ++ /** ++ * Called when the mob's health reaches 0. ++ */ ++ public void onDeath(DamageSource par1DamageSource) { ++ super.onDeath(par1DamageSource); ++ ++ if (par1DamageSource.getEntity() instanceof EntitySkeleton) { ++ int var2 = Item.record13.itemID + this.rand.nextInt(Item.recordWait.itemID - Item.record13.itemID + 1); + this.dropItem(var2, 1); + } +- + } + +- public boolean attackEntityAsMob(Entity var1) { ++ public boolean attackEntityAsMob(Entity par1Entity) { + return true; + } + ++ /** ++ * Returns true if the creeper is powered by a lightning bolt. ++ */ + public boolean getPowered() { + return this.dataWatcher.getWatchableObjectByte(17) == 1; + } + +- public float getCreeperFlashIntensity(float var1) { +- return ((float)this.lastActiveTime + (float)(this.timeSinceIgnited - this.lastActiveTime) * var1) / (float)(this.fuseTime - 2); ++ /** ++ * Params: (Float)Render tick. Returns the intensity of the creeper's flash when it is ignited. ++ */ ++ public float getCreeperFlashIntensity(float par1) { ++ return ((float)this.lastActiveTime + (float)(this.timeSinceIgnited - this.lastActiveTime) * par1) / (float)(this.fuseTime - 2); + } + ++ /** ++ * Returns the item ID for the item the mob drops on death. ++ */ + protected int getDropItemId() { + return Item.gunpowder.itemID; + } + ++ /** ++ * Returns the current state of creeper, -1 is idle, 1 is 'in fuse' ++ */ + public int getCreeperState() { + return this.dataWatcher.getWatchableObjectByte(16); + } + +- public void setCreeperState(int var1) { +- this.dataWatcher.updateObject(16, Byte.valueOf((byte)var1)); ++ /** ++ * Sets the state of creeper, -1 to idle and 1 to be 'in fuse' ++ */ ++ public void setCreeperState(int par1) { ++ this.dataWatcher.updateObject(16, Byte.valueOf((byte)par1)); + } + +- public void onStruckByLightning(EntityLightningBolt var1) { +- super.onStruckByLightning(var1); ++ /** ++ * Called when a lightning bolt hits the entity. ++ */ ++ public void onStruckByLightning(EntityLightningBolt par1EntityLightningBolt) { ++ super.onStruckByLightning(par1EntityLightningBolt); + this.dataWatcher.updateObject(17, Byte.valueOf((byte)1)); + } + } diff --git a/patches/net/minecraft/src/EntityCrit2FX.java.patch b/patches/net/minecraft/src/EntityCrit2FX.java.patch new file mode 100644 index 0000000..5e809b1 --- /dev/null +++ b/patches/net/minecraft/src/EntityCrit2FX.java.patch @@ -0,0 +1,69 @@ +--- net/minecraft/src/EntityCrit2FX.java ++++ net/minecraft/src/EntityCrit2FX.java +@@ -1,44 +1,49 @@ + package net.minecraft.src; + + public class EntityCrit2FX extends EntityFX { ++ ++ /** Entity that had been hit and done the Critical hit on. */ + private Entity theEntity; + private int currentLife; + private int maximumLife; +- private String aD; ++ private String particleName; + +- public EntityCrit2FX(World var1, Entity var2) { +- this(var1, var2, "crit"); ++ public EntityCrit2FX(World par1World, Entity par2Entity) { ++ this(par1World, par2Entity, "crit"); + } + +- public EntityCrit2FX(World var1, Entity var2, String var3) { +- super(var1, var2.posX, var2.boundingBox.minY + (double)(var2.height / 2.0F), var2.posZ, var2.motionX, var2.motionY, var2.motionZ); +- this.theEntity = var2; ++ public EntityCrit2FX(World par1World, Entity par2Entity, String par3Str) { ++ super(par1World, par2Entity.posX, par2Entity.boundingBox.minY + (double)(par2Entity.height / 2.0F), par2Entity.posZ, par2Entity.motionX, par2Entity.motionY, par2Entity.motionZ); ++ this.theEntity = par2Entity; + this.maximumLife = 3; +- this.aD = var3; ++ this.particleName = par3Str; + this.onUpdate(); + } + +- public void renderParticle(Tessellator var1, float var2, float var3, float var4, float var5, float var6, float var7) { +- } ++ public void renderParticle(Tessellator par1Tessellator, float par2, float par3, float par4, float par5, float par6, float par7) {} + ++ /** ++ * Called to update the entity's position/logic. ++ */ + public void onUpdate() { +- for(int var1 = 0; var1 < 16; ++var1) { +- double var2 = (double)(this.ab.nextFloat() * 2.0F - 1.0F); +- double var4 = (double)(this.ab.nextFloat() * 2.0F - 1.0F); +- double var6 = (double)(this.ab.nextFloat() * 2.0F - 1.0F); +- if(var2 * var2 + var4 * var4 + var6 * var6 <= 1.0D) { ++ for (int var1 = 0; var1 < 16; ++var1) { ++ double var2 = (double)(this.rand.nextFloat() * 2.0F - 1.0F); ++ double var4 = (double)(this.rand.nextFloat() * 2.0F - 1.0F); ++ double var6 = (double)(this.rand.nextFloat() * 2.0F - 1.0F); ++ ++ if (var2 * var2 + var4 * var4 + var6 * var6 <= 1.0D) { + double var8 = this.theEntity.posX + var2 * (double)this.theEntity.width / 4.0D; + double var10 = this.theEntity.boundingBox.minY + (double)(this.theEntity.height / 2.0F) + var4 * (double)this.theEntity.height / 4.0D; + double var12 = this.theEntity.posZ + var6 * (double)this.theEntity.width / 4.0D; +- this.worldObj.spawnParticle(this.aD, var8, var10, var12, var2, var4 + 0.2D, var6); ++ this.worldObj.spawnParticle(this.particleName, var8, var10, var12, var2, var4 + 0.2D, var6); + } + } + + ++this.currentLife; +- if(this.currentLife >= this.maximumLife) { ++ ++ if (this.currentLife >= this.maximumLife) { + this.setDead(); + } +- + } + + public int getFXLayer() { diff --git a/patches/net/minecraft/src/EntityCritFX.java.patch b/patches/net/minecraft/src/EntityCritFX.java.patch new file mode 100644 index 0000000..143886a --- /dev/null +++ b/patches/net/minecraft/src/EntityCritFX.java.patch @@ -0,0 +1,98 @@ +--- net/minecraft/src/EntityCritFX.java ++++ net/minecraft/src/EntityCritFX.java +@@ -3,62 +3,67 @@ + public class EntityCritFX extends EntityFX { + float initialParticleScale; + +- public EntityCritFX(World var1, double var2, double var4, double var6, double var8, double var10, double var12) { +- this(var1, var2, var4, var6, var8, var10, var12, 1.0F); ++ public EntityCritFX(World par1World, double par2, double par4, double par6, double par8, double par10, double par12) { ++ this(par1World, par2, par4, par6, par8, par10, par12, 1.0F); + } + +- public EntityCritFX(World var1, double var2, double var4, double var6, double var8, double var10, double var12, float var14) { +- super(var1, var2, var4, var6, 0.0D, 0.0D, 0.0D); +- this.motionX *= (double)0.1F; +- this.motionY *= (double)0.1F; +- this.motionZ *= (double)0.1F; +- this.motionX += var8 * 0.4D; +- this.motionY += var10 * 0.4D; +- this.motionZ += var12 * 0.4D; +- this.particleRed = this.particleGreen = this.particleBlue = (float)(Math.random() * (double)0.3F + (double)0.6F); +- this.particleScale *= 12.0F / 16.0F; +- this.particleScale *= var14; ++ public EntityCritFX(World par1World, double par2, double par4, double par6, double par8, double par10, double par12, float par14) { ++ super(par1World, par2, par4, par6, 0.0D, 0.0D, 0.0D); ++ this.motionX *= 0.10000000149011612D; ++ this.motionY *= 0.10000000149011612D; ++ this.motionZ *= 0.10000000149011612D; ++ this.motionX += par8 * 0.4D; ++ this.motionY += par10 * 0.4D; ++ this.motionZ += par12 * 0.4D; ++ this.particleRed = this.particleGreen = this.particleBlue = (float)(Math.random() * 0.30000001192092896D + 0.6000000238418579D); ++ this.particleScale *= 0.75F; ++ this.particleScale *= par14; + this.initialParticleScale = this.particleScale; + this.particleMaxAge = (int)(6.0D / (Math.random() * 0.8D + 0.6D)); +- this.particleMaxAge = (int)((float)this.particleMaxAge * var14); ++ this.particleMaxAge = (int)((float)this.particleMaxAge * par14); + this.noClip = false; + this.setParticleTextureIndex(65); + this.onUpdate(); + } + +- public void renderParticle(Tessellator var1, float var2, float var3, float var4, float var5, float var6, float var7) { +- float var8 = ((float)this.particleAge + var2) / (float)this.particleMaxAge * 32.0F; +- if(var8 < 0.0F) { ++ public void renderParticle(Tessellator par1Tessellator, float par2, float par3, float par4, float par5, float par6, float par7) { ++ float var8 = ((float)this.particleAge + par2) / (float)this.particleMaxAge * 32.0F; ++ ++ if (var8 < 0.0F) { + var8 = 0.0F; + } + +- if(var8 > 1.0F) { ++ if (var8 > 1.0F) { + var8 = 1.0F; + } + + this.particleScale = this.initialParticleScale * var8; +- super.renderParticle(var1, var2, var3, var4, var5, var6, var7); ++ super.renderParticle(par1Tessellator, par2, par3, par4, par5, par6, par7); + } + ++ /** ++ * Called to update the entity's position/logic. ++ */ + public void onUpdate() { + this.prevPosX = this.posX; + this.prevPosY = this.posY; + this.prevPosZ = this.posZ; +- if(this.particleAge++ >= this.particleMaxAge) { ++ ++ if (this.particleAge++ >= this.particleMaxAge) { + this.setDead(); + } + + this.moveEntity(this.motionX, this.motionY, this.motionZ); + this.particleGreen = (float)((double)this.particleGreen * 0.96D); + this.particleBlue = (float)((double)this.particleBlue * 0.9D); +- this.motionX *= (double)0.7F; +- this.motionY *= (double)0.7F; +- this.motionZ *= (double)0.7F; +- this.motionY -= (double)0.02F; +- if(this.onGround) { +- this.motionX *= (double)0.7F; +- this.motionZ *= (double)0.7F; +- } ++ this.motionX *= 0.699999988079071D; ++ this.motionY *= 0.699999988079071D; ++ this.motionZ *= 0.699999988079071D; ++ this.motionY -= 0.019999999552965164D; + ++ if (this.onGround) { ++ this.motionX *= 0.699999988079071D; ++ this.motionZ *= 0.699999988079071D; ++ } + } + } diff --git a/patches/net/minecraft/src/EntityDamageSource.java.patch b/patches/net/minecraft/src/EntityDamageSource.java.patch new file mode 100644 index 0000000..8a1ab0f --- /dev/null +++ b/patches/net/minecraft/src/EntityDamageSource.java.patch @@ -0,0 +1,37 @@ +--- net/minecraft/src/EntityDamageSource.java ++++ net/minecraft/src/EntityDamageSource.java +@@ -3,22 +3,28 @@ + public class EntityDamageSource extends DamageSource { + protected Entity damageSourceEntity; + +- public EntityDamageSource(String var1, Entity var2) { +- super(var1); +- this.damageSourceEntity = var2; ++ public EntityDamageSource(String par1Str, Entity par2Entity) { ++ super(par1Str); ++ this.damageSourceEntity = par2Entity; + } + + public Entity getEntity() { + return this.damageSourceEntity; + } + +- public ChatMessageComponent getDeathMessage(EntityLivingBase var1) { ++ /** ++ * Returns the message to be displayed on player death. ++ */ ++ public ChatMessageComponent getDeathMessage(EntityLivingBase par1EntityLivingBase) { + ItemStack var2 = this.damageSourceEntity instanceof EntityLivingBase ? ((EntityLivingBase)this.damageSourceEntity).getHeldItem() : null; +- String var3 = "death.attack." + this.o; ++ String var3 = "death.attack." + this.damageType; + String var4 = var3 + ".item"; +- return var2 != null && var2.hasDisplayName() && StatCollector.func_94522_b(var4) ? ChatMessageComponent.createFromTranslationWithSubstitutions(var4, new Object[]{var1.getTranslatedEntityName(), this.damageSourceEntity.getTranslatedEntityName(), var2.getDisplayName()}) : ChatMessageComponent.createFromTranslationWithSubstitutions(var3, new Object[]{var1.getTranslatedEntityName(), this.damageSourceEntity.getTranslatedEntityName()}); ++ return var2 != null && var2.hasDisplayName() && StatCollector.func_94522_b(var4) ? ChatMessageComponent.createFromTranslationWithSubstitutions(var4, new Object[] {par1EntityLivingBase.getTranslatedEntityName(), this.damageSourceEntity.getTranslatedEntityName(), var2.getDisplayName()}): ChatMessageComponent.createFromTranslationWithSubstitutions(var3, new Object[] {par1EntityLivingBase.getTranslatedEntityName(), this.damageSourceEntity.getTranslatedEntityName()}); + } + ++ /** ++ * Return whether this damage source will have its damage amount scaled based on the current difficulty. ++ */ + public boolean isDifficultyScaled() { + return this.damageSourceEntity != null && this.damageSourceEntity instanceof EntityLivingBase && !(this.damageSourceEntity instanceof EntityPlayer); + } diff --git a/patches/net/minecraft/src/EntityDamageSourceIndirect.java.patch b/patches/net/minecraft/src/EntityDamageSourceIndirect.java.patch new file mode 100644 index 0000000..4de2183 --- /dev/null +++ b/patches/net/minecraft/src/EntityDamageSourceIndirect.java.patch @@ -0,0 +1,33 @@ +--- net/minecraft/src/EntityDamageSourceIndirect.java ++++ net/minecraft/src/EntityDamageSourceIndirect.java +@@ -3,9 +3,9 @@ + public class EntityDamageSourceIndirect extends EntityDamageSource { + private Entity indirectEntity; + +- public EntityDamageSourceIndirect(String var1, Entity var2, Entity var3) { +- super(var1, var2); +- this.indirectEntity = var3; ++ public EntityDamageSourceIndirect(String par1Str, Entity par2Entity, Entity par3Entity) { ++ super(par1Str, par2Entity); ++ this.indirectEntity = par3Entity; + } + + public Entity getSourceOfDamage() { +@@ -16,11 +16,14 @@ + return this.indirectEntity; + } + +- public ChatMessageComponent getDeathMessage(EntityLivingBase var1) { ++ /** ++ * Returns the message to be displayed on player death. ++ */ ++ public ChatMessageComponent getDeathMessage(EntityLivingBase par1EntityLivingBase) { + String var2 = this.indirectEntity == null ? this.damageSourceEntity.getTranslatedEntityName() : this.indirectEntity.getTranslatedEntityName(); + ItemStack var3 = this.indirectEntity instanceof EntityLivingBase ? ((EntityLivingBase)this.indirectEntity).getHeldItem() : null; +- String var4 = "death.attack." + this.o; ++ String var4 = "death.attack." + this.damageType; + String var5 = var4 + ".item"; +- return var3 != null && var3.hasDisplayName() && StatCollector.func_94522_b(var5) ? ChatMessageComponent.createFromTranslationWithSubstitutions(var5, new Object[]{var1.getTranslatedEntityName(), var2, var3.getDisplayName()}) : ChatMessageComponent.createFromTranslationWithSubstitutions(var4, new Object[]{var1.getTranslatedEntityName(), var2}); ++ return var3 != null && var3.hasDisplayName() && StatCollector.func_94522_b(var5) ? ChatMessageComponent.createFromTranslationWithSubstitutions(var5, new Object[] {par1EntityLivingBase.getTranslatedEntityName(), var2, var3.getDisplayName()}): ChatMessageComponent.createFromTranslationWithSubstitutions(var4, new Object[] {par1EntityLivingBase.getTranslatedEntityName(), var2}); + } + } diff --git a/patches/net/minecraft/src/EntityDiggingFX.java.patch b/patches/net/minecraft/src/EntityDiggingFX.java.patch new file mode 100644 index 0000000..9047b8e --- /dev/null +++ b/patches/net/minecraft/src/EntityDiggingFX.java.patch @@ -0,0 +1,122 @@ +--- net/minecraft/src/EntityDiggingFX.java ++++ net/minecraft/src/EntityDiggingFX.java +@@ -1,22 +1,46 @@ + package net.minecraft.src; + ++import net.minecraft.src.Block; ++import net.minecraft.src.Minecraft; ++ ++import org.newdawn.slick.opengl.Texture; ++import org.spoutcraft.client.item.SpoutItem; ++import org.spoutcraft.api.material.MaterialData; ++import org.spoutcraft.api.block.design.BlockDesign; ++import org.spoutcraft.client.inventory.CraftItemStack; ++import org.spoutcraft.client.io.CustomTextureManager; ++import org.spoutcraft.client.io.FileUtil; ++import org.spoutcraft.client.SpoutClient; ++ + public class EntityDiggingFX extends EntityFX { + private Block blockInstance; ++ ++ // Spout > Lots of things changed in this class. ++ public boolean custom = false; ++ public Texture currentTexture = null; + +- public EntityDiggingFX(World var1, double var2, double var4, double var6, double var8, double var10, double var12, Block var14, int var15) { +- super(var1, var2, var4, var6, var8, var10, var12); +- this.blockInstance = var14; +- this.setParticleIcon(var14.getIcon(0, var15)); +- this.particleGravity = var14.blockParticleGravity; ++ public EntityDiggingFX(World par1World, double par2, double par4, double par6, double par8, double par10, double par12, Block par14Block, int par15) { ++ this(par1World, par2, par4, par6, par8, par10, par12, par14Block, par15, null); ++ } ++ ++ public EntityDiggingFX(World par1World, double par2, double par4, double par6, double par8, double par10, double par12, Block par14Block, int par15, Texture texture) { ++ super(par1World, par2, par4, par6, par8, par10, par12); ++ this.blockInstance = par14Block; ++ this.currentTexture = texture; ++ this.setParticleIcon(par14Block.getIcon(0, par15)); ++ this.particleGravity = par14Block.blockParticleGravity; + this.particleRed = this.particleGreen = this.particleBlue = 0.6F; + this.particleScale /= 2.0F; + } + +- public EntityDiggingFX applyColourMultiplier(int var1, int var2, int var3) { +- if(this.blockInstance == Block.grass) { ++ /** ++ * If the block has a colour multiplier, copies it to this particle and returns this particle. ++ */ ++ public EntityDiggingFX applyColourMultiplier(int par1, int par2, int par3) { ++ if (this.blockInstance == Block.grass) { + return this; + } else { +- int var4 = this.blockInstance.colorMultiplier(this.worldObj, var1, var2, var3); ++ int var4 = this.blockInstance.colorMultiplier(this.worldObj, par1, par2, par3); + this.particleRed *= (float)(var4 >> 16 & 255) / 255.0F; + this.particleGreen *= (float)(var4 >> 8 & 255) / 255.0F; + this.particleBlue *= (float)(var4 & 255) / 255.0F; +@@ -24,11 +48,14 @@ + } + } + +- public EntityDiggingFX applyRenderColor(int var1) { +- if(this.blockInstance == Block.grass) { ++ /** ++ * Creates a new EntityDiggingFX with the block render color applied to the base particle color ++ */ ++ public EntityDiggingFX applyRenderColor(int par1) { ++ if (this.blockInstance == Block.grass) { + return this; + } else { +- int var2 = this.blockInstance.getRenderColor(var1); ++ int var2 = this.blockInstance.getRenderColor(par1); + this.particleRed *= (float)(var2 >> 16 & 255) / 255.0F; + this.particleGreen *= (float)(var2 >> 8 & 255) / 255.0F; + this.particleBlue *= (float)(var2 & 255) / 255.0F; +@@ -40,27 +67,34 @@ + return 1; + } + +- public void renderParticle(Tessellator var1, float var2, float var3, float var4, float var5, float var6, float var7) { ++ public void renderParticle(Tessellator par1Tessellator, float par2, float par3, float par4, float par5, float par6, float par7) { ++ if (this.currentTexture != null) { ++ SpoutClient.getHandle().renderEngine.bindTexture(currentTexture.getTextureID()); ++ } ++ + float var8 = ((float)this.particleTextureIndexX + this.particleTextureJitterX / 4.0F) / 16.0F; +- float var9 = var8 + 0.999F / 64.0F; ++ float var9 = var8 + 0.015609375F; + float var10 = ((float)this.particleTextureIndexY + this.particleTextureJitterY / 4.0F) / 16.0F; +- float var11 = var10 + 0.999F / 64.0F; ++ float var11 = var10 + 0.015609375F; + float var12 = 0.1F * this.particleScale; +- if(this.particleIcon != null) { ++ ++ if (currentTexture == null && this.particleIcon != null) { + var8 = this.particleIcon.getInterpolatedU((double)(this.particleTextureJitterX / 4.0F * 16.0F)); + var9 = this.particleIcon.getInterpolatedU((double)((this.particleTextureJitterX + 1.0F) / 4.0F * 16.0F)); + var10 = this.particleIcon.getInterpolatedV((double)(this.particleTextureJitterY / 4.0F * 16.0F)); + var11 = this.particleIcon.getInterpolatedV((double)((this.particleTextureJitterY + 1.0F) / 4.0F * 16.0F)); + } ++ ++ // ToDo: More work needed here to set the custom X/Y coords of the vertex calculations since we are not using icons for custom blocks. + +- float var13 = (float)(this.prevPosX + (this.posX - this.prevPosX) * (double)var2 - interpPosX); +- float var14 = (float)(this.prevPosY + (this.posY - this.prevPosY) * (double)var2 - interpPosY); +- float var15 = (float)(this.prevPosZ + (this.posZ - this.prevPosZ) * (double)var2 - interpPosZ); ++ float var13 = (float)(this.prevPosX + (this.posX - this.prevPosX) * (double)par2 - interpPosX); ++ float var14 = (float)(this.prevPosY + (this.posY - this.prevPosY) * (double)par2 - interpPosY); ++ float var15 = (float)(this.prevPosZ + (this.posZ - this.prevPosZ) * (double)par2 - interpPosZ); + float var16 = 1.0F; +- var1.setColorOpaque_F(var16 * this.particleRed, var16 * this.particleGreen, var16 * this.particleBlue); +- var1.addVertexWithUV((double)(var13 - var3 * var12 - var6 * var12), (double)(var14 - var4 * var12), (double)(var15 - var5 * var12 - var7 * var12), (double)var8, (double)var11); +- var1.addVertexWithUV((double)(var13 - var3 * var12 + var6 * var12), (double)(var14 + var4 * var12), (double)(var15 - var5 * var12 + var7 * var12), (double)var8, (double)var10); +- var1.addVertexWithUV((double)(var13 + var3 * var12 + var6 * var12), (double)(var14 + var4 * var12), (double)(var15 + var5 * var12 + var7 * var12), (double)var9, (double)var10); +- var1.addVertexWithUV((double)(var13 + var3 * var12 - var6 * var12), (double)(var14 - var4 * var12), (double)(var15 + var5 * var12 - var7 * var12), (double)var9, (double)var11); ++ par1Tessellator.setColorOpaque_F(var16 * this.particleRed, var16 * this.particleGreen, var16 * this.particleBlue); ++ par1Tessellator.addVertexWithUV((double)(var13 - par3 * var12 - par6 * var12), (double)(var14 - par4 * var12), (double)(var15 - par5 * var12 - par7 * var12), (double)var8, (double)var11); ++ par1Tessellator.addVertexWithUV((double)(var13 - par3 * var12 + par6 * var12), (double)(var14 + par4 * var12), (double)(var15 - par5 * var12 + par7 * var12), (double)var8, (double)var10); ++ par1Tessellator.addVertexWithUV((double)(var13 + par3 * var12 + par6 * var12), (double)(var14 + par4 * var12), (double)(var15 + par5 * var12 + par7 * var12), (double)var9, (double)var10); ++ par1Tessellator.addVertexWithUV((double)(var13 + par3 * var12 - par6 * var12), (double)(var14 - par4 * var12), (double)(var15 + par5 * var12 - par7 * var12), (double)var9, (double)var11); + } + } diff --git a/patches/net/minecraft/src/EntityDragon.java.patch b/patches/net/minecraft/src/EntityDragon.java.patch new file mode 100644 index 0000000..6daa9ee --- /dev/null +++ b/patches/net/minecraft/src/EntityDragon.java.patch @@ -0,0 +1,715 @@ +--- net/minecraft/src/EntityDragon.java ++++ net/minecraft/src/EntityDragon.java +@@ -7,26 +7,55 @@ + public double targetX; + public double targetY; + public double targetZ; ++ ++ /** ++ * Ring buffer array for the last 64 Y-positions and yaw rotations. Used to calculate offsets for the animations. ++ */ + public double[][] ringBuffer = new double[64][3]; ++ ++ /** ++ * Index into the ring buffer. Incremented once per tick and restarts at 0 once it reaches the end of the buffer. ++ */ + public int ringBufferIndex = -1; +- public EntityDragonPart[] dragonPartArray = new EntityDragonPart[]{this.dragonPartHead = new EntityDragonPart(this, "head", 6.0F, 6.0F), this.dragonPartBody = new EntityDragonPart(this, "body", 8.0F, 8.0F), this.dragonPartTail1 = new EntityDragonPart(this, "tail", 4.0F, 4.0F), this.dragonPartTail2 = new EntityDragonPart(this, "tail", 4.0F, 4.0F), this.dragonPartTail3 = new EntityDragonPart(this, "tail", 4.0F, 4.0F), this.dragonPartWing1 = new EntityDragonPart(this, "wing", 4.0F, 4.0F), this.dragonPartWing2 = new EntityDragonPart(this, "wing", 4.0F, 4.0F)}; ++ ++ /** An array containing all body parts of this dragon */ ++ public EntityDragonPart[] dragonPartArray; ++ ++ /** The head bounding box of a dragon */ + public EntityDragonPart dragonPartHead; ++ ++ /** The body bounding box of a dragon */ + public EntityDragonPart dragonPartBody; + public EntityDragonPart dragonPartTail1; + public EntityDragonPart dragonPartTail2; + public EntityDragonPart dragonPartTail3; + public EntityDragonPart dragonPartWing1; + public EntityDragonPart dragonPartWing2; ++ ++ /** Animation time at previous tick. */ + public float prevAnimTime; ++ ++ /** ++ * Animation time, used to control the speed of the animation cycles (wings flapping, jaw opening, etc.) ++ */ + public float animTime; ++ ++ /** Force selecting a new flight target at next tick if set to true. */ + public boolean forceNewTarget; ++ ++ /** ++ * Activated if the dragon is flying though obsidian, white stone or bedrock. Slows movement and animation speed. ++ */ + public boolean slowed; + private Entity target; + public int deathTicks; ++ ++ /** The current endercrystal that is healing this dragon */ + public EntityEnderCrystal healingEnderCrystal; + +- public EntityDragon(World var1) { +- super(var1); ++ public EntityDragon(World par1World) { ++ super(par1World); ++ this.dragonPartArray = new EntityDragonPart[] {this.dragonPartHead = new EntityDragonPart(this, "head", 6.0F, 6.0F), this.dragonPartBody = new EntityDragonPart(this, "body", 8.0F, 8.0F), this.dragonPartTail1 = new EntityDragonPart(this, "tail", 4.0F, 4.0F), this.dragonPartTail2 = new EntityDragonPart(this, "tail", 4.0F, 4.0F), this.dragonPartTail3 = new EntityDragonPart(this, "tail", 4.0F, 4.0F), this.dragonPartWing1 = new EntityDragonPart(this, "wing", 4.0F, 4.0F), this.dragonPartWing2 = new EntityDragonPart(this, "wing", 4.0F, 4.0F)}; + this.setHealth(this.getMaxHealth()); + this.setSize(16.0F, 8.0F); + this.noClip = true; +@@ -44,62 +73,75 @@ + super.entityInit(); + } + +- public double[] getMovementOffsets(int var1, float var2) { +- if(this.getHealth() <= 0.0F) { +- var2 = 0.0F; ++ /** ++ * Returns a double[3] array with movement offsets, used to calculate trailing tail/neck positions. [0] = yaw offset, ++ * [1] = y offset, [2] = unused, always 0. Parameters: buffer index offset, partial ticks. ++ */ ++ public double[] getMovementOffsets(int par1, float par2) { ++ if (this.getHealth() <= 0.0F) { ++ par2 = 0.0F; + } + +- var2 = 1.0F - var2; +- int var3 = this.ringBufferIndex - var1 * 1 & 63; +- int var4 = this.ringBufferIndex - var1 * 1 - 1 & 63; ++ par2 = 1.0F - par2; ++ int var3 = this.ringBufferIndex - par1 * 1 & 63; ++ int var4 = this.ringBufferIndex - par1 * 1 - 1 & 63; + double[] var5 = new double[3]; + double var6 = this.ringBuffer[var3][0]; + double var8 = MathHelper.wrapAngleTo180_double(this.ringBuffer[var4][0] - var6); +- var5[0] = var6 + var8 * (double)var2; ++ var5[0] = var6 + var8 * (double)par2; + var6 = this.ringBuffer[var3][1]; + var8 = this.ringBuffer[var4][1] - var6; +- var5[1] = var6 + var8 * (double)var2; +- var5[2] = this.ringBuffer[var3][2] + (this.ringBuffer[var4][2] - this.ringBuffer[var3][2]) * (double)var2; ++ var5[1] = var6 + var8 * (double)par2; ++ var5[2] = this.ringBuffer[var3][2] + (this.ringBuffer[var4][2] - this.ringBuffer[var3][2]) * (double)par2; + return var5; + } + ++ /** ++ * Called frequently so the entity can update its state every tick as required. For example, zombies and skeletons use ++ * this to react to sunlight and start to burn. ++ */ + public void onLivingUpdate() { + float var1; + float var2; +- if(this.worldObj.isRemote) { ++ ++ if (this.worldObj.isRemote) { + var1 = MathHelper.cos(this.animTime * (float)Math.PI * 2.0F); + var2 = MathHelper.cos(this.prevAnimTime * (float)Math.PI * 2.0F); +- if(var2 <= -0.3F && var1 >= -0.3F) { +- this.worldObj.playSound(this.posX, this.posY, this.posZ, "mob.enderdragon.wings", 5.0F, 0.8F + this.ab.nextFloat() * 0.3F, false); ++ ++ if (var2 <= -0.3F && var1 >= -0.3F) { ++ this.worldObj.playSound(this.posX, this.posY, this.posZ, "mob.enderdragon.wings", 5.0F, 0.8F + this.rand.nextFloat() * 0.3F, false); + } + } + + this.prevAnimTime = this.animTime; + float var3; +- if(this.getHealth() <= 0.0F) { +- var1 = (this.ab.nextFloat() - 0.5F) * 8.0F; +- var2 = (this.ab.nextFloat() - 0.5F) * 4.0F; +- var3 = (this.ab.nextFloat() - 0.5F) * 8.0F; ++ ++ if (this.getHealth() <= 0.0F) { ++ var1 = (this.rand.nextFloat() - 0.5F) * 8.0F; ++ var2 = (this.rand.nextFloat() - 0.5F) * 4.0F; ++ var3 = (this.rand.nextFloat() - 0.5F) * 8.0F; + this.worldObj.spawnParticle("largeexplode", this.posX + (double)var1, this.posY + 2.0D + (double)var2, this.posZ + (double)var3, 0.0D, 0.0D, 0.0D); + } else { + this.updateDragonEnderCrystal(); + var1 = 0.2F / (MathHelper.sqrt_double(this.motionX * this.motionX + this.motionZ * this.motionZ) * 10.0F + 1.0F); + var1 *= (float)Math.pow(2.0D, this.motionY); +- if(this.slowed) { ++ ++ if (this.slowed) { + this.animTime += var1 * 0.5F; + } else { + this.animTime += var1; + } + + this.rotationYaw = MathHelper.wrapAngleTo180_float(this.rotationYaw); +- if(this.ringBufferIndex < 0) { +- for(int var25 = 0; var25 < this.ringBuffer.length; ++var25) { ++ ++ if (this.ringBufferIndex < 0) { ++ for (int var25 = 0; var25 < this.ringBuffer.length; ++var25) { + this.ringBuffer[var25][0] = (double)this.rotationYaw; + this.ringBuffer[var25][1] = this.posY; + } + } + +- if(++this.ringBufferIndex == this.ringBuffer.length) { ++ if (++this.ringBufferIndex == this.ringBuffer.length) { + this.ringBufferIndex = 0; + } + +@@ -110,8 +152,9 @@ + double var8; + double var26; + float var31; +- if(this.worldObj.isRemote) { +- if(this.newPosRotationIncrements > 0) { ++ ++ if (this.worldObj.isRemote) { ++ if (this.newPosRotationIncrements > 0) { + var26 = this.posX + (this.newPosX - this.posX) / (double)this.newPosRotationIncrements; + var4 = this.posY + (this.newPosY - this.posY) / (double)this.newPosRotationIncrements; + var6 = this.posZ + (this.newPosZ - this.posZ) / (double)this.newPosRotationIncrements; +@@ -127,70 +170,77 @@ + var4 = this.targetY - this.posY; + var6 = this.targetZ - this.posZ; + var8 = var26 * var26 + var4 * var4 + var6 * var6; +- if(this.target != null) { ++ ++ if (this.target != null) { + this.targetX = this.target.posX; + this.targetZ = this.target.posZ; + double var10 = this.targetX - this.posX; + double var12 = this.targetZ - this.posZ; + double var14 = Math.sqrt(var10 * var10 + var12 * var12); +- double var16 = (double)0.4F + var14 / 80.0D - 1.0D; +- if(var16 > 10.0D) { ++ double var16 = 0.4000000059604645D + var14 / 80.0D - 1.0D; ++ ++ if (var16 > 10.0D) { + var16 = 10.0D; + } + + this.targetY = this.target.boundingBox.minY + var16; + } else { +- this.targetX += this.ab.nextGaussian() * 2.0D; +- this.targetZ += this.ab.nextGaussian() * 2.0D; ++ this.targetX += this.rand.nextGaussian() * 2.0D; ++ this.targetZ += this.rand.nextGaussian() * 2.0D; + } + +- if(this.forceNewTarget || var8 < 100.0D || var8 > 22500.0D || this.isCollidedHorizontally || this.isCollidedVertically) { ++ if (this.forceNewTarget || var8 < 100.0D || var8 > 22500.0D || this.isCollidedHorizontally || this.isCollidedVertically) { + this.setNewTarget(); + } + + var4 /= (double)MathHelper.sqrt_double(var26 * var26 + var6 * var6); + var31 = 0.6F; +- if(var4 < (double)(-var31)) { ++ ++ if (var4 < (double)(-var31)) { + var4 = (double)(-var31); + } + +- if(var4 > (double)var31) { ++ if (var4 > (double)var31) { + var4 = (double)var31; + } + +- this.motionY += var4 * (double)0.1F; ++ this.motionY += var4 * 0.10000000149011612D; + this.rotationYaw = MathHelper.wrapAngleTo180_float(this.rotationYaw); +- double var11 = 180.0D - Math.atan2(var26, var6) * 180.0D / (double)((float)Math.PI); ++ double var11 = 180.0D - Math.atan2(var26, var6) * 180.0D / Math.PI; + double var13 = MathHelper.wrapAngleTo180_double(var11 - (double)this.rotationYaw); +- if(var13 > 50.0D) { ++ ++ if (var13 > 50.0D) { + var13 = 50.0D; + } + +- if(var13 < -50.0D) { ++ if (var13 < -50.0D) { + var13 = -50.0D; + } + + Vec3 var15 = this.worldObj.getWorldVec3Pool().getVecFromPool(this.targetX - this.posX, this.targetY - this.posY, this.targetZ - this.posZ).normalize(); + Vec3 var39 = this.worldObj.getWorldVec3Pool().getVecFromPool((double)MathHelper.sin(this.rotationYaw * (float)Math.PI / 180.0F), this.motionY, (double)(-MathHelper.cos(this.rotationYaw * (float)Math.PI / 180.0F))).normalize(); + float var17 = (float)(var39.dotProduct(var15) + 0.5D) / 1.5F; +- if(var17 < 0.0F) { ++ ++ if (var17 < 0.0F) { + var17 = 0.0F; + } + + this.randomYawVelocity *= 0.8F; + float var18 = MathHelper.sqrt_double(this.motionX * this.motionX + this.motionZ * this.motionZ) * 1.0F + 1.0F; + double var19 = Math.sqrt(this.motionX * this.motionX + this.motionZ * this.motionZ) * 1.0D + 1.0D; +- if(var19 > 40.0D) { ++ ++ if (var19 > 40.0D) { + var19 = 40.0D; + } + +- this.randomYawVelocity = (float)((double)this.randomYawVelocity + var13 * ((double)0.7F / var19 / (double)var18)); ++ this.randomYawVelocity = (float)((double)this.randomYawVelocity + var13 * (0.699999988079071D / var19 / (double)var18)); + this.rotationYaw += this.randomYawVelocity * 0.1F; + float var21 = (float)(2.0D / (var19 + 1.0D)); + float var22 = 0.06F; + this.moveFlying(0.0F, -1.0F, var22 * (var17 * var21 + (1.0F - var21))); +- if(this.slowed) { +- this.moveEntity(this.motionX * (double)0.8F, this.motionY * (double)0.8F, this.motionZ * (double)0.8F); ++ ++ if (this.slowed) { ++ this.moveEntity(this.motionX * 0.800000011920929D, this.motionY * 0.800000011920929D, this.motionZ * 0.800000011920929D); + } else { + this.moveEntity(this.motionX, this.motionY, this.motionZ); + } +@@ -200,7 +250,7 @@ + var24 = 0.8F + 0.15F * var24; + this.motionX *= (double)var24; + this.motionZ *= (double)var24; +- this.motionY *= (double)0.91F; ++ this.motionY *= 0.9100000262260437D; + } + + this.renderYawOffset = this.rotationYaw; +@@ -226,7 +276,8 @@ + this.dragonPartWing1.setLocationAndAngles(this.posX + (double)(var7 * 4.5F), this.posY + 2.0D, this.posZ + (double)(var28 * 4.5F), 0.0F, 0.0F); + this.dragonPartWing2.onUpdate(); + this.dragonPartWing2.setLocationAndAngles(this.posX - (double)(var7 * 4.5F), this.posY + 2.0D, this.posZ - (double)(var28 * 4.5F), 0.0F, 0.0F); +- if(!this.worldObj.isRemote && this.hurtTime == 0) { ++ ++ if (!this.worldObj.isRemote && this.hurtTime == 0) { + this.collideWithEntities(this.worldObj.getEntitiesWithinAABBExcludingEntity(this, this.dragonPartWing1.boundingBox.expand(4.0D, 2.0D, 4.0D).offset(0.0D, -2.0D, 0.0D))); + this.collideWithEntities(this.worldObj.getEntitiesWithinAABBExcludingEntity(this, this.dragonPartWing2.boundingBox.expand(4.0D, 2.0D, 4.0D).offset(0.0D, -2.0D, 0.0D))); + this.attackEntitiesInList(this.worldObj.getEntitiesWithinAABBExcludingEntity(this, this.dragonPartHead.boundingBox.expand(1.0D, 1.0D, 1.0D))); +@@ -239,17 +290,18 @@ + this.dragonPartHead.onUpdate(); + this.dragonPartHead.setLocationAndAngles(this.posX + (double)(var31 * 5.5F * var3), this.posY + (var9[1] - var29[1]) * 1.0D + (double)(var27 * 5.5F), this.posZ - (double)(var33 * 5.5F * var3), 0.0F, 0.0F); + +- for(int var30 = 0; var30 < 3; ++var30) { ++ for (int var30 = 0; var30 < 3; ++var30) { + EntityDragonPart var32 = null; +- if(var30 == 0) { ++ ++ if (var30 == 0) { + var32 = this.dragonPartTail1; + } + +- if(var30 == 1) { ++ if (var30 == 1) { + var32 = this.dragonPartTail2; + } + +- if(var30 == 2) { ++ if (var30 == 2) { + var32 = this.dragonPartTail3; + } + +@@ -263,37 +315,40 @@ + var32.setLocationAndAngles(this.posX - (double)((var28 * var38 + var37 * var40) * var3), this.posY + (var34[1] - var29[1]) * 1.0D - (double)((var40 + var38) * var27) + 1.5D, this.posZ + (double)((var7 * var38 + var36 * var40) * var3), 0.0F, 0.0F); + } + +- if(!this.worldObj.isRemote) { ++ if (!this.worldObj.isRemote) { + this.slowed = this.destroyBlocksInAABB(this.dragonPartHead.boundingBox) | this.destroyBlocksInAABB(this.dragonPartBody.boundingBox); + } +- + } + } + ++ /** ++ * Updates the state of the enderdragon's current endercrystal. ++ */ + private void updateDragonEnderCrystal() { +- if(this.healingEnderCrystal != null) { +- if(this.healingEnderCrystal.isDead) { +- if(!this.worldObj.isRemote) { ++ if (this.healingEnderCrystal != null) { ++ if (this.healingEnderCrystal.isDead) { ++ if (!this.worldObj.isRemote) { + this.attackEntityFromPart(this.dragonPartHead, DamageSource.setExplosionSource((Explosion)null), 10.0F); + } + + this.healingEnderCrystal = null; +- } else if(this.ticksExisted % 10 == 0 && this.getHealth() < this.getMaxHealth()) { ++ } else if (this.ticksExisted % 10 == 0 && this.getHealth() < this.getMaxHealth()) { + this.setHealth(this.getHealth() + 1.0F); + } + } + +- if(this.ab.nextInt(10) == 0) { ++ if (this.rand.nextInt(10) == 0) { + float var1 = 32.0F; + List var2 = this.worldObj.getEntitiesWithinAABB(EntityEnderCrystal.class, this.boundingBox.expand((double)var1, (double)var1, (double)var1)); + EntityEnderCrystal var3 = null; + double var4 = Double.MAX_VALUE; + Iterator var6 = var2.iterator(); + +- while(var6.hasNext()) { ++ while (var6.hasNext()) { + EntityEnderCrystal var7 = (EntityEnderCrystal)var6.next(); + double var8 = var7.getDistanceSqToEntity(this); +- if(var8 < var4) { ++ ++ if (var8 < var4) { + var4 = var8; + var3 = var7; + } +@@ -301,80 +356,95 @@ + + this.healingEnderCrystal = var3; + } +- + } + +- private void collideWithEntities(List var1) { ++ /** ++ * Pushes all entities inside the list away from the enderdragon. ++ */ ++ private void collideWithEntities(List par1List) { + double var2 = (this.dragonPartBody.boundingBox.minX + this.dragonPartBody.boundingBox.maxX) / 2.0D; + double var4 = (this.dragonPartBody.boundingBox.minZ + this.dragonPartBody.boundingBox.maxZ) / 2.0D; +- Iterator var6 = var1.iterator(); ++ Iterator var6 = par1List.iterator(); + +- while(var6.hasNext()) { ++ while (var6.hasNext()) { + Entity var7 = (Entity)var6.next(); +- if(var7 instanceof EntityLivingBase) { ++ ++ if (var7 instanceof EntityLivingBase) { + double var8 = var7.posX - var2; + double var10 = var7.posZ - var4; + double var12 = var8 * var8 + var10 * var10; +- var7.addVelocity(var8 / var12 * 4.0D, (double)0.2F, var10 / var12 * 4.0D); ++ var7.addVelocity(var8 / var12 * 4.0D, 0.20000000298023224D, var10 / var12 * 4.0D); + } + } +- + } + +- private void attackEntitiesInList(List var1) { +- for(int var2 = 0; var2 < var1.size(); ++var2) { +- Entity var3 = (Entity)var1.get(var2); +- if(var3 instanceof EntityLivingBase) { ++ /** ++ * Attacks all entities inside this list, dealing 5 hearts of damage. ++ */ ++ private void attackEntitiesInList(List par1List) { ++ for (int var2 = 0; var2 < par1List.size(); ++var2) { ++ Entity var3 = (Entity)par1List.get(var2); ++ ++ if (var3 instanceof EntityLivingBase) { + var3.attackEntityFrom(DamageSource.causeMobDamage(this), 10.0F); + } + } +- + } + ++ /** ++ * Sets a new target for the flight AI. It can be a random coordinate or a nearby player. ++ */ + private void setNewTarget() { + this.forceNewTarget = false; +- if(this.ab.nextInt(2) == 0 && !this.worldObj.h.isEmpty()) { +- this.target = (Entity)this.worldObj.h.get(this.ab.nextInt(this.worldObj.h.size())); ++ ++ if (this.rand.nextInt(2) == 0 && !this.worldObj.playerEntities.isEmpty()) { ++ this.target = (Entity)this.worldObj.playerEntities.get(this.rand.nextInt(this.worldObj.playerEntities.size())); + } else { + boolean var1 = false; + + do { + this.targetX = 0.0D; +- this.targetY = (double)(70.0F + this.ab.nextFloat() * 50.0F); ++ this.targetY = (double)(70.0F + this.rand.nextFloat() * 50.0F); + this.targetZ = 0.0D; +- this.targetX += (double)(this.ab.nextFloat() * 120.0F - 60.0F); +- this.targetZ += (double)(this.ab.nextFloat() * 120.0F - 60.0F); ++ this.targetX += (double)(this.rand.nextFloat() * 120.0F - 60.0F); ++ this.targetZ += (double)(this.rand.nextFloat() * 120.0F - 60.0F); + double var2 = this.posX - this.targetX; + double var4 = this.posY - this.targetY; + double var6 = this.posZ - this.targetZ; + var1 = var2 * var2 + var4 * var4 + var6 * var6 > 100.0D; +- } while(!var1); ++ } while (!var1); + + this.target = null; + } +- +- } +- +- private float simplifyAngle(double var1) { +- return (float)MathHelper.wrapAngleTo180_double(var1); +- } +- +- private boolean destroyBlocksInAABB(AxisAlignedBB var1) { +- int var2 = MathHelper.floor_double(var1.minX); +- int var3 = MathHelper.floor_double(var1.minY); +- int var4 = MathHelper.floor_double(var1.minZ); +- int var5 = MathHelper.floor_double(var1.maxX); +- int var6 = MathHelper.floor_double(var1.maxY); +- int var7 = MathHelper.floor_double(var1.maxZ); ++ } ++ ++ /** ++ * Simplifies the value of a number by adding/subtracting 180 to the point that the number is between -180 and 180. ++ */ ++ private float simplifyAngle(double par1) { ++ return (float)MathHelper.wrapAngleTo180_double(par1); ++ } ++ ++ /** ++ * Destroys all blocks that aren't associated with 'The End' inside the given bounding box. ++ */ ++ private boolean destroyBlocksInAABB(AxisAlignedBB par1AxisAlignedBB) { ++ int var2 = MathHelper.floor_double(par1AxisAlignedBB.minX); ++ int var3 = MathHelper.floor_double(par1AxisAlignedBB.minY); ++ int var4 = MathHelper.floor_double(par1AxisAlignedBB.minZ); ++ int var5 = MathHelper.floor_double(par1AxisAlignedBB.maxX); ++ int var6 = MathHelper.floor_double(par1AxisAlignedBB.maxY); ++ int var7 = MathHelper.floor_double(par1AxisAlignedBB.maxZ); + boolean var8 = false; + boolean var9 = false; + +- for(int var10 = var2; var10 <= var5; ++var10) { +- for(int var11 = var3; var11 <= var6; ++var11) { +- for(int var12 = var4; var12 <= var7; ++var12) { ++ for (int var10 = var2; var10 <= var5; ++var10) { ++ for (int var11 = var3; var11 <= var6; ++var11) { ++ for (int var12 = var4; var12 <= var7; ++var12) { + int var13 = this.worldObj.getBlockId(var10, var11, var12); +- if(var13 != 0) { +- if(var13 != Block.obsidian.blockID && var13 != Block.whiteStone.blockID && var13 != Block.bedrock.blockID && this.worldObj.getGameRules().getGameRuleBooleanValue("mobGriefing")) { ++ ++ if (var13 != 0) { ++ if (var13 != Block.obsidian.blockID && var13 != Block.whiteStone.blockID && var13 != Block.bedrock.blockID && this.worldObj.getGameRules().getGameRuleBooleanValue("mobGriefing")) { + var9 = this.worldObj.setBlockToAir(var10, var11, var12) || var9; + } else { + var8 = true; +@@ -384,76 +454,86 @@ + } + } + +- if(var9) { +- double var16 = var1.minX + (var1.maxX - var1.minX) * (double)this.ab.nextFloat(); +- double var17 = var1.minY + (var1.maxY - var1.minY) * (double)this.ab.nextFloat(); +- double var14 = var1.minZ + (var1.maxZ - var1.minZ) * (double)this.ab.nextFloat(); ++ if (var9) { ++ double var16 = par1AxisAlignedBB.minX + (par1AxisAlignedBB.maxX - par1AxisAlignedBB.minX) * (double)this.rand.nextFloat(); ++ double var17 = par1AxisAlignedBB.minY + (par1AxisAlignedBB.maxY - par1AxisAlignedBB.minY) * (double)this.rand.nextFloat(); ++ double var14 = par1AxisAlignedBB.minZ + (par1AxisAlignedBB.maxZ - par1AxisAlignedBB.minZ) * (double)this.rand.nextFloat(); + this.worldObj.spawnParticle("largeexplode", var16, var17, var14, 0.0D, 0.0D, 0.0D); + } + + return var8; + } + +- public boolean attackEntityFromPart(EntityDragonPart var1, DamageSource var2, float var3) { +- if(var1 != this.dragonPartHead) { +- var3 = var3 / 4.0F + 1.0F; ++ public boolean attackEntityFromPart(EntityDragonPart par1EntityDragonPart, DamageSource par2DamageSource, float par3) { ++ if (par1EntityDragonPart != this.dragonPartHead) { ++ par3 = par3 / 4.0F + 1.0F; + } + + float var4 = this.rotationYaw * (float)Math.PI / 180.0F; + float var5 = MathHelper.sin(var4); + float var6 = MathHelper.cos(var4); +- this.targetX = this.posX + (double)(var5 * 5.0F) + (double)((this.ab.nextFloat() - 0.5F) * 2.0F); +- this.targetY = this.posY + (double)(this.ab.nextFloat() * 3.0F) + 1.0D; +- this.targetZ = this.posZ - (double)(var6 * 5.0F) + (double)((this.ab.nextFloat() - 0.5F) * 2.0F); ++ this.targetX = this.posX + (double)(var5 * 5.0F) + (double)((this.rand.nextFloat() - 0.5F) * 2.0F); ++ this.targetY = this.posY + (double)(this.rand.nextFloat() * 3.0F) + 1.0D; ++ this.targetZ = this.posZ - (double)(var6 * 5.0F) + (double)((this.rand.nextFloat() - 0.5F) * 2.0F); + this.target = null; +- if(var2.getEntity() instanceof EntityPlayer || var2.isExplosion()) { +- this.func_82195_e(var2, var3); ++ ++ if (par2DamageSource.getEntity() instanceof EntityPlayer || par2DamageSource.isExplosion()) { ++ this.func_82195_e(par2DamageSource, par3); + } + + return true; + } + +- public boolean attackEntityFrom(DamageSource var1, float var2) { ++ /** ++ * Called when the entity is attacked. ++ */ ++ public boolean attackEntityFrom(DamageSource par1DamageSource, float par2) { + return false; + } + +- protected boolean func_82195_e(DamageSource var1, float var2) { +- return super.attackEntityFrom(var1, var2); ++ protected boolean func_82195_e(DamageSource par1DamageSource, float par2) { ++ return super.attackEntityFrom(par1DamageSource, par2); + } + ++ /** ++ * handles entity death timer, experience orb and particle creation ++ */ + protected void onDeathUpdate() { + ++this.deathTicks; +- if(this.deathTicks >= 180 && this.deathTicks <= 200) { +- float var1 = (this.ab.nextFloat() - 0.5F) * 8.0F; +- float var2 = (this.ab.nextFloat() - 0.5F) * 4.0F; +- float var3 = (this.ab.nextFloat() - 0.5F) * 8.0F; ++ ++ if (this.deathTicks >= 180 && this.deathTicks <= 200) { ++ float var1 = (this.rand.nextFloat() - 0.5F) * 8.0F; ++ float var2 = (this.rand.nextFloat() - 0.5F) * 4.0F; ++ float var3 = (this.rand.nextFloat() - 0.5F) * 8.0F; + this.worldObj.spawnParticle("hugeexplosion", this.posX + (double)var1, this.posY + 2.0D + (double)var2, this.posZ + (double)var3, 0.0D, 0.0D, 0.0D); + } + + int var4; + int var5; +- if(!this.worldObj.isRemote) { +- if(this.deathTicks > 150 && this.deathTicks % 5 == 0) { ++ ++ if (!this.worldObj.isRemote) { ++ if (this.deathTicks > 150 && this.deathTicks % 5 == 0) { + var4 = 1000; + +- while(var4 > 0) { ++ while (var4 > 0) { + var5 = EntityXPOrb.getXPSplit(var4); + var4 -= var5; + this.worldObj.spawnEntityInWorld(new EntityXPOrb(this.worldObj, this.posX, this.posY, this.posZ, var5)); + } + } + +- if(this.deathTicks == 1) { ++ if (this.deathTicks == 1) { + this.worldObj.func_82739_e(1018, (int)this.posX, (int)this.posY, (int)this.posZ, 0); + } + } + +- this.moveEntity(0.0D, (double)0.1F, 0.0D); ++ this.moveEntity(0.0D, 0.10000000149011612D, 0.0D); + this.renderYawOffset = this.rotationYaw += 20.0F; +- if(this.deathTicks == 200 && !this.worldObj.isRemote) { ++ ++ if (this.deathTicks == 200 && !this.worldObj.isRemote) { + var4 = 2000; + +- while(var4 > 0) { ++ while (var4 > 0) { + var5 = EntityXPOrb.getXPSplit(var4); + var4 -= var5; + this.worldObj.spawnEntityInWorld(new EntityXPOrb(this.worldObj, this.posX, this.posY, this.posZ, var5)); +@@ -462,28 +542,31 @@ + this.createEnderPortal(MathHelper.floor_double(this.posX), MathHelper.floor_double(this.posZ)); + this.setDead(); + } +- + } + +- private void createEnderPortal(int var1, int var2) { ++ /** ++ * Creates the ender portal leading back to the normal world after defeating the enderdragon. ++ */ ++ private void createEnderPortal(int par1, int par2) { + byte var3 = 64; + BlockEndPortal.bossDefeated = true; + byte var4 = 4; + +- for(int var5 = var3 - 1; var5 <= var3 + 32; ++var5) { +- for(int var6 = var1 - var4; var6 <= var1 + var4; ++var6) { +- for(int var7 = var2 - var4; var7 <= var2 + var4; ++var7) { +- double var8 = (double)(var6 - var1); +- double var10 = (double)(var7 - var2); ++ for (int var5 = var3 - 1; var5 <= var3 + 32; ++var5) { ++ for (int var6 = par1 - var4; var6 <= par1 + var4; ++var6) { ++ for (int var7 = par2 - var4; var7 <= par2 + var4; ++var7) { ++ double var8 = (double)(var6 - par1); ++ double var10 = (double)(var7 - par2); + double var12 = var8 * var8 + var10 * var10; +- if(var12 <= ((double)var4 - 0.5D) * ((double)var4 - 0.5D)) { +- if(var5 < var3) { +- if(var12 <= ((double)(var4 - 1) - 0.5D) * ((double)(var4 - 1) - 0.5D)) { ++ ++ if (var12 <= ((double)var4 - 0.5D) * ((double)var4 - 0.5D)) { ++ if (var5 < var3) { ++ if (var12 <= ((double)(var4 - 1) - 0.5D) * ((double)(var4 - 1) - 0.5D)) { + this.worldObj.setBlock(var6, var5, var7, Block.bedrock.blockID); + } +- } else if(var5 > var3) { ++ } else if (var5 > var3) { + this.worldObj.setBlock(var6, var5, var7, 0); +- } else if(var12 > ((double)(var4 - 1) - 0.5D) * ((double)(var4 - 1) - 0.5D)) { ++ } else if (var12 > ((double)(var4 - 1) - 0.5D) * ((double)(var4 - 1) - 0.5D)) { + this.worldObj.setBlock(var6, var5, var7, Block.bedrock.blockID); + } else { + this.worldObj.setBlock(var6, var5, var7, Block.endPortal.blockID); +@@ -493,25 +576,33 @@ + } + } + +- this.worldObj.setBlock(var1, var3 + 0, var2, Block.bedrock.blockID); +- this.worldObj.setBlock(var1, var3 + 1, var2, Block.bedrock.blockID); +- this.worldObj.setBlock(var1, var3 + 2, var2, Block.bedrock.blockID); +- this.worldObj.setBlock(var1 - 1, var3 + 2, var2, Block.torchWood.blockID); +- this.worldObj.setBlock(var1 + 1, var3 + 2, var2, Block.torchWood.blockID); +- this.worldObj.setBlock(var1, var3 + 2, var2 - 1, Block.torchWood.blockID); +- this.worldObj.setBlock(var1, var3 + 2, var2 + 1, Block.torchWood.blockID); +- this.worldObj.setBlock(var1, var3 + 3, var2, Block.bedrock.blockID); +- this.worldObj.setBlock(var1, var3 + 4, var2, Block.dragonEgg.blockID); ++ this.worldObj.setBlock(par1, var3 + 0, par2, Block.bedrock.blockID); ++ this.worldObj.setBlock(par1, var3 + 1, par2, Block.bedrock.blockID); ++ this.worldObj.setBlock(par1, var3 + 2, par2, Block.bedrock.blockID); ++ this.worldObj.setBlock(par1 - 1, var3 + 2, par2, Block.torchWood.blockID); ++ this.worldObj.setBlock(par1 + 1, var3 + 2, par2, Block.torchWood.blockID); ++ this.worldObj.setBlock(par1, var3 + 2, par2 - 1, Block.torchWood.blockID); ++ this.worldObj.setBlock(par1, var3 + 2, par2 + 1, Block.torchWood.blockID); ++ this.worldObj.setBlock(par1, var3 + 3, par2, Block.bedrock.blockID); ++ this.worldObj.setBlock(par1, var3 + 4, par2, Block.dragonEgg.blockID); + BlockEndPortal.bossDefeated = false; + } + +- protected void despawnEntity() { +- } ++ /** ++ * Makes the entity despawn if requirements are reached ++ */ ++ protected void despawnEntity() {} + ++ /** ++ * Return the Entity parts making up this Entity (currently only for dragons) ++ */ + public Entity[] getParts() { + return this.dragonPartArray; + } + ++ /** ++ * Returns true if other Entities should be prevented from moving through this Entity. ++ */ + public boolean canBeCollidedWith() { + return false; + } +@@ -520,14 +611,23 @@ + return this.worldObj; + } + ++ /** ++ * Returns the sound this mob makes while it's alive. ++ */ + protected String getLivingSound() { + return "mob.enderdragon.growl"; + } + ++ /** ++ * Returns the sound this mob makes when it is hurt. ++ */ + protected String getHurtSound() { + return "mob.enderdragon.hit"; + } + ++ /** ++ * Returns the volume for the sounds this mob makes. ++ */ + protected float getSoundVolume() { + return 5.0F; + } diff --git a/patches/net/minecraft/src/EntityDragonPart.java.patch b/patches/net/minecraft/src/EntityDragonPart.java.patch new file mode 100644 index 0000000..814c0e7 --- /dev/null +++ b/patches/net/minecraft/src/EntityDragonPart.java.patch @@ -0,0 +1,75 @@ +--- net/minecraft/src/EntityDragonPart.java ++++ net/minecraft/src/EntityDragonPart.java +@@ -1,34 +1,50 @@ + package net.minecraft.src; + + public class EntityDragonPart extends Entity { ++ ++ /** The dragon entity this dragon part belongs to */ + public final IEntityMultiPart entityDragonObj; +- public final String b; +- +- public EntityDragonPart(IEntityMultiPart var1, String var2, float var3, float var4) { +- super(var1.func_82194_d()); +- this.setSize(var3, var4); +- this.entityDragonObj = var1; +- this.b = var2; +- } +- +- protected void entityInit() { +- } +- +- protected void readEntityFromNBT(NBTTagCompound var1) { +- } +- +- protected void writeEntityToNBT(NBTTagCompound var1) { +- } +- ++ ++ /** The name of the Dragon Part */ ++ public final String name; ++ ++ public EntityDragonPart(IEntityMultiPart par1IEntityMultiPart, String par2Str, float par3, float par4) { ++ super(par1IEntityMultiPart.func_82194_d()); ++ this.setSize(par3, par4); ++ this.entityDragonObj = par1IEntityMultiPart; ++ this.name = par2Str; ++ } ++ ++ protected void entityInit() {} ++ ++ /** ++ * (abstract) Protected helper method to read subclass entity data from NBT. ++ */ ++ protected void readEntityFromNBT(NBTTagCompound par1NBTTagCompound) {} ++ ++ /** ++ * (abstract) Protected helper method to write subclass entity data to NBT. ++ */ ++ protected void writeEntityToNBT(NBTTagCompound par1NBTTagCompound) {} ++ ++ /** ++ * Returns true if other Entities should be prevented from moving through this Entity. ++ */ + public boolean canBeCollidedWith() { + return true; + } + +- public boolean attackEntityFrom(DamageSource var1, float var2) { +- return this.isEntityInvulnerable() ? false : this.entityDragonObj.attackEntityFromPart(this, var1, var2); ++ /** ++ * Called when the entity is attacked. ++ */ ++ public boolean attackEntityFrom(DamageSource par1DamageSource, float par2) { ++ return this.isEntityInvulnerable() ? false : this.entityDragonObj.attackEntityFromPart(this, par1DamageSource, par2); + } + +- public boolean isEntityEqual(Entity var1) { +- return this == var1 || this.entityDragonObj == var1; ++ /** ++ * Returns true if Entity argument is equal to this Entity ++ */ ++ public boolean isEntityEqual(Entity par1Entity) { ++ return this == par1Entity || this.entityDragonObj == par1Entity; + } + } diff --git a/patches/net/minecraft/src/EntityDropParticleFX.java.patch b/patches/net/minecraft/src/EntityDropParticleFX.java.patch new file mode 100644 index 0000000..48222ea --- /dev/null +++ b/patches/net/minecraft/src/EntityDropParticleFX.java.patch @@ -0,0 +1,157 @@ +--- net/minecraft/src/EntityDropParticleFX.java ++++ net/minecraft/src/EntityDropParticleFX.java +@@ -1,16 +1,35 @@ + package net.minecraft.src; + ++// MCPatcher Start ++import com.prupe.mcpatcher.cc.ColorizeBlock; ++import com.prupe.mcpatcher.cc.ColorizeEntity; ++import com.prupe.mcpatcher.cc.Colorizer; ++// MCPatcher End ++ + public class EntityDropParticleFX extends EntityFX { ++ ++ /** the material type for dropped items/blocks */ + private Material materialType; ++ ++ /** The height of the current bob */ + private int bobTimer; + +- public EntityDropParticleFX(World var1, double var2, double var4, double var6, Material var8) { +- super(var1, var2, var4, var6, 0.0D, 0.0D, 0.0D); ++ public EntityDropParticleFX(World par1World, double par2, double par4, double par6, Material par8Material) { ++ super(par1World, par2, par4, par6, 0.0D, 0.0D, 0.0D); + this.motionX = this.motionY = this.motionZ = 0.0D; +- if(var8 == Material.water) { +- this.particleRed = 0.0F; +- this.particleGreen = 0.0F; +- this.particleBlue = 1.0F; ++ ++ if (par8Material == Material.water) { ++ // MCPatcher Start ++ if (ColorizeBlock.computeWaterColor(this.posX, this.posY, this.posZ)) { ++ this.particleRed = ColorizeBlock.waterColor[0]; ++ this.particleGreen = ColorizeBlock.waterColor[1]; ++ this.particleBlue = ColorizeBlock.waterColor[2]; ++ } else { ++ this.particleRed = 0.2F; ++ this.particleGreen = 0.3F; ++ this.particleBlue = 1.0F; ++ } ++ // MCPatcher End + } else { + this.particleRed = 1.0F; + this.particleGreen = 0.0F; +@@ -20,36 +39,48 @@ + this.setParticleTextureIndex(113); + this.setSize(0.01F, 0.01F); + this.particleGravity = 0.06F; +- this.materialType = var8; ++ this.materialType = par8Material; + this.bobTimer = 40; + this.particleMaxAge = (int)(64.0D / (Math.random() * 0.8D + 0.2D)); + this.motionX = this.motionY = this.motionZ = 0.0D; + } + +- public int getBrightnessForRender(float var1) { +- return this.materialType == Material.water ? super.getBrightnessForRender(var1) : 257; +- } +- +- public float getBrightness(float var1) { +- return this.materialType == Material.water ? super.getBrightness(var1) : 1.0F; +- } +- ++ public int getBrightnessForRender(float par1) { ++ return this.materialType == Material.water ? super.getBrightnessForRender(par1) : 257; ++ } ++ ++ /** ++ * Gets how bright this entity is. ++ */ ++ public float getBrightness(float par1) { ++ return this.materialType == Material.water ? super.getBrightness(par1) : 1.0F; ++ } ++ ++ /** ++ * Called to update the entity's position/logic. ++ */ + public void onUpdate() { + this.prevPosX = this.posX; + this.prevPosY = this.posY; + this.prevPosZ = this.posZ; +- if(this.materialType == Material.water) { +- this.particleRed = 0.2F; +- this.particleGreen = 0.3F; +- this.particleBlue = 1.0F; +- } else { +- this.particleRed = 1.0F; +- this.particleGreen = 16.0F / (float)(40 - this.bobTimer + 16); +- this.particleBlue = 4.0F / (float)(40 - this.bobTimer + 8); ++ ++ // MCPatcher Start ++ if (this.materialType != Material.water) { ++ if (ColorizeEntity.computeLavaDropColor(40 - this.bobTimer)) { ++ this.particleRed = Colorizer.setColor[0]; ++ this.particleGreen = Colorizer.setColor[1]; ++ this.particleBlue = Colorizer.setColor[2]; ++ } else { ++ this.particleRed = 1.0F; ++ this.particleGreen = 16.0F / (float)(40 - this.bobTimer + 16); ++ this.particleBlue = 4.0F / (float)(40 - this.bobTimer + 8); ++ } ++ // MCPatcher End + } + + this.motionY -= (double)this.particleGravity; +- if(this.bobTimer-- > 0) { ++ ++ if (this.bobTimer-- > 0) { + this.motionX *= 0.02D; + this.motionY *= 0.02D; + this.motionZ *= 0.02D; +@@ -59,32 +90,34 @@ + } + + this.moveEntity(this.motionX, this.motionY, this.motionZ); +- this.motionX *= (double)0.98F; +- this.motionY *= (double)0.98F; +- this.motionZ *= (double)0.98F; +- if(this.particleMaxAge-- <= 0) { ++ this.motionX *= 0.9800000190734863D; ++ this.motionY *= 0.9800000190734863D; ++ this.motionZ *= 0.9800000190734863D; ++ ++ if (this.particleMaxAge-- <= 0) { + this.setDead(); + } + +- if(this.onGround) { +- if(this.materialType == Material.water) { ++ if (this.onGround) { ++ if (this.materialType == Material.water) { + this.setDead(); + this.worldObj.spawnParticle("splash", this.posX, this.posY, this.posZ, 0.0D, 0.0D, 0.0D); + } else { + this.setParticleTextureIndex(114); + } + +- this.motionX *= (double)0.7F; +- this.motionZ *= (double)0.7F; ++ this.motionX *= 0.699999988079071D; ++ this.motionZ *= 0.699999988079071D; + } + + Material var1 = this.worldObj.getBlockMaterial(MathHelper.floor_double(this.posX), MathHelper.floor_double(this.posY), MathHelper.floor_double(this.posZ)); +- if(var1.isLiquid() || var1.isSolid()) { ++ ++ if (var1.isLiquid() || var1.isSolid()) { + double var2 = (double)((float)(MathHelper.floor_double(this.posY) + 1) - BlockFluid.getFluidHeightPercent(this.worldObj.getBlockMetadata(MathHelper.floor_double(this.posX), MathHelper.floor_double(this.posY), MathHelper.floor_double(this.posZ)))); +- if(this.posY < var2) { ++ ++ if (this.posY < var2) { + this.setDead(); + } + } +- + } + } diff --git a/patches/net/minecraft/src/EntityEgg.java.patch b/patches/net/minecraft/src/EntityEgg.java.patch new file mode 100644 index 0000000..eff5927 --- /dev/null +++ b/patches/net/minecraft/src/EntityEgg.java.patch @@ -0,0 +1,71 @@ +--- net/minecraft/src/EntityEgg.java ++++ net/minecraft/src/EntityEgg.java +@@ -1,30 +1,34 @@ + package net.minecraft.src; + + public class EntityEgg extends EntityThrowable { +- public EntityEgg(World var1) { +- super(var1); +- } +- +- public EntityEgg(World var1, EntityLivingBase var2) { +- super(var1, var2); +- } +- +- public EntityEgg(World var1, double var2, double var4, double var6) { +- super(var1, var2, var4, var6); +- } +- +- protected void onImpact(MovingObjectPosition var1) { +- if(var1.entityHit != null) { +- var1.entityHit.attackEntityFrom(DamageSource.causeThrownDamage(this, this.getThrower()), 0.0F); ++ public EntityEgg(World par1World) { ++ super(par1World); ++ } ++ ++ public EntityEgg(World par1World, EntityLivingBase par2EntityLivingBase) { ++ super(par1World, par2EntityLivingBase); ++ } ++ ++ public EntityEgg(World par1World, double par2, double par4, double par6) { ++ super(par1World, par2, par4, par6); ++ } ++ ++ /** ++ * Called when this EntityThrowable hits a block or entity. ++ */ ++ protected void onImpact(MovingObjectPosition par1MovingObjectPosition) { ++ if (par1MovingObjectPosition.entityHit != null) { ++ par1MovingObjectPosition.entityHit.attackEntityFrom(DamageSource.causeThrownDamage(this, this.getThrower()), 0.0F); + } + +- if(!this.worldObj.isRemote && this.ab.nextInt(8) == 0) { ++ if (!this.worldObj.isRemote && this.rand.nextInt(8) == 0) { + byte var2 = 1; +- if(this.ab.nextInt(32) == 0) { ++ ++ if (this.rand.nextInt(32) == 0) { + var2 = 4; + } + +- for(int var3 = 0; var3 < var2; ++var3) { ++ for (int var3 = 0; var3 < var2; ++var3) { + EntityChicken var4 = new EntityChicken(this.worldObj); + var4.setGrowingAge(-24000); + var4.setLocationAndAngles(this.posX, this.posY, this.posZ, this.rotationYaw, 0.0F); +@@ -32,13 +36,12 @@ + } + } + +- for(int var5 = 0; var5 < 8; ++var5) { ++ for (int var5 = 0; var5 < 8; ++var5) { + this.worldObj.spawnParticle("snowballpoof", this.posX, this.posY, this.posZ, 0.0D, 0.0D, 0.0D); + } + +- if(!this.worldObj.isRemote) { ++ if (!this.worldObj.isRemote) { + this.setDead(); + } +- + } + } diff --git a/patches/net/minecraft/src/EntityEggInfo.java.patch b/patches/net/minecraft/src/EntityEggInfo.java.patch new file mode 100644 index 0000000..fa78025 --- /dev/null +++ b/patches/net/minecraft/src/EntityEggInfo.java.patch @@ -0,0 +1,26 @@ +--- net/minecraft/src/EntityEggInfo.java ++++ net/minecraft/src/EntityEggInfo.java +@@ -1,13 +1,19 @@ + package net.minecraft.src; + + public class EntityEggInfo { ++ ++ /** The entityID of the spawned mob */ + public int spawnedID; ++ ++ /** Base color of the egg */ + public int primaryColor; ++ ++ /** Color of the egg spots */ + public int secondaryColor; + +- public EntityEggInfo(int var1, int var2, int var3) { +- this.spawnedID = var1; +- this.primaryColor = var2; +- this.secondaryColor = var3; ++ public EntityEggInfo(int par1, int par2, int par3) { ++ this.spawnedID = par1; ++ this.primaryColor = par2; ++ this.secondaryColor = par3; + } + } diff --git a/patches/net/minecraft/src/EntityEnchantmentTableParticleFX.java.patch b/patches/net/minecraft/src/EntityEnchantmentTableParticleFX.java.patch new file mode 100644 index 0000000..c57c084 --- /dev/null +++ b/patches/net/minecraft/src/EntityEnchantmentTableParticleFX.java.patch @@ -0,0 +1,83 @@ +--- net/minecraft/src/EntityEnchantmentTableParticleFX.java ++++ net/minecraft/src/EntityEnchantmentTableParticleFX.java +@@ -6,16 +6,16 @@ + private double field_70567_ar; + private double field_70566_as; + +- public EntityEnchantmentTableParticleFX(World var1, double var2, double var4, double var6, double var8, double var10, double var12) { +- super(var1, var2, var4, var6, var8, var10, var12); +- this.motionX = var8; +- this.motionY = var10; +- this.motionZ = var12; +- this.field_70568_aq = this.posX = var2; +- this.field_70567_ar = this.posY = var4; +- this.field_70566_as = this.posZ = var6; +- float var14 = this.ab.nextFloat() * 0.6F + 0.4F; +- this.field_70565_a = this.particleScale = this.ab.nextFloat() * 0.5F + 0.2F; ++ public EntityEnchantmentTableParticleFX(World par1World, double par2, double par4, double par6, double par8, double par10, double par12) { ++ super(par1World, par2, par4, par6, par8, par10, par12); ++ this.motionX = par8; ++ this.motionY = par10; ++ this.motionZ = par12; ++ this.field_70568_aq = this.posX = par2; ++ this.field_70567_ar = this.posY = par4; ++ this.field_70566_as = this.posZ = par6; ++ float var14 = this.rand.nextFloat() * 0.6F + 0.4F; ++ this.field_70565_a = this.particleScale = this.rand.nextFloat() * 0.5F + 0.2F; + this.particleRed = this.particleGreen = this.particleBlue = 1.0F * var14; + this.particleGreen *= 0.9F; + this.particleRed *= 0.9F; +@@ -24,29 +24,36 @@ + this.setParticleTextureIndex((int)(Math.random() * 26.0D + 1.0D + 224.0D)); + } + +- public int getBrightnessForRender(float var1) { +- int var2 = super.getBrightnessForRender(var1); ++ public int getBrightnessForRender(float par1) { ++ int var2 = super.getBrightnessForRender(par1); + float var3 = (float)this.particleAge / (float)this.particleMaxAge; + var3 *= var3; + var3 *= var3; + int var4 = var2 & 255; + int var5 = var2 >> 16 & 255; + var5 += (int)(var3 * 15.0F * 16.0F); +- if(var5 > 240) { ++ ++ if (var5 > 240) { + var5 = 240; + } + + return var4 | var5 << 16; + } + +- public float getBrightness(float var1) { +- float var2 = super.getBrightness(var1); ++ /** ++ * Gets how bright this entity is. ++ */ ++ public float getBrightness(float par1) { ++ float var2 = super.getBrightness(par1); + float var3 = (float)this.particleAge / (float)this.particleMaxAge; + var3 *= var3; + var3 *= var3; + return var2 * (1.0F - var3) + var3; + } + ++ /** ++ * Called to update the entity's position/logic. ++ */ + public void onUpdate() { + this.prevPosX = this.posX; + this.prevPosY = this.posY; +@@ -59,9 +66,9 @@ + this.posX = this.field_70568_aq + this.motionX * (double)var1; + this.posY = this.field_70567_ar + this.motionY * (double)var1 - (double)(var2 * 1.2F); + this.posZ = this.field_70566_as + this.motionZ * (double)var1; +- if(this.particleAge++ >= this.particleMaxAge) { ++ ++ if (this.particleAge++ >= this.particleMaxAge) { + this.setDead(); + } +- + } + } diff --git a/patches/net/minecraft/src/EntityEnderCrystal.java.patch b/patches/net/minecraft/src/EntityEnderCrystal.java.patch new file mode 100644 index 0000000..13a86db --- /dev/null +++ b/patches/net/minecraft/src/EntityEnderCrystal.java.patch @@ -0,0 +1,114 @@ +--- net/minecraft/src/EntityEnderCrystal.java ++++ net/minecraft/src/EntityEnderCrystal.java +@@ -1,23 +1,29 @@ + package net.minecraft.src; + + public class EntityEnderCrystal extends Entity { ++ ++ /** Used to create the rotation animation when rendering the crystal. */ + public int innerRotation; + public int health; + +- public EntityEnderCrystal(World var1) { +- super(var1); ++ public EntityEnderCrystal(World par1World) { ++ super(par1World); + this.preventEntitySpawning = true; + this.setSize(2.0F, 2.0F); + this.yOffset = this.height / 2.0F; + this.health = 5; +- this.innerRotation = this.ab.nextInt(100000); +- } +- +- public EntityEnderCrystal(World var1, double var2, double var4, double var6) { +- this(var1); +- this.setPosition(var2, var4, var6); +- } +- ++ this.innerRotation = this.rand.nextInt(100000); ++ } ++ ++ public EntityEnderCrystal(World par1World, double par2, double par4, double par6) { ++ this(par1World); ++ this.setPosition(par2, par4, par6); ++ } ++ ++ /** ++ * returns if this entity triggers Block.onEntityWalking on the blocks they walk on. used for spiders and wolves to ++ * prevent them from trampling crops ++ */ + protected boolean canTriggerWalking() { + return false; + } +@@ -26,6 +32,9 @@ + this.dataWatcher.addObject(8, Integer.valueOf(this.health)); + } + ++ /** ++ * Called to update the entity's position/logic. ++ */ + public void onUpdate() { + this.prevPosX = this.posX; + this.prevPosY = this.posY; +@@ -35,35 +44,47 @@ + int var1 = MathHelper.floor_double(this.posX); + int var2 = MathHelper.floor_double(this.posY); + int var3 = MathHelper.floor_double(this.posZ); +- if(this.worldObj.getBlockId(var1, var2, var3) != Block.fire.blockID) { ++ ++ if (this.worldObj.getBlockId(var1, var2, var3) != Block.fire.blockID) { + this.worldObj.setBlock(var1, var2, var3, Block.fire.blockID); + } +- +- } +- +- protected void writeEntityToNBT(NBTTagCompound var1) { +- } +- +- protected void readEntityFromNBT(NBTTagCompound var1) { +- } ++ } ++ ++ /** ++ * (abstract) Protected helper method to write subclass entity data to NBT. ++ */ ++ protected void writeEntityToNBT(NBTTagCompound par1NBTTagCompound) {} ++ ++ /** ++ * (abstract) Protected helper method to read subclass entity data from NBT. ++ */ ++ protected void readEntityFromNBT(NBTTagCompound par1NBTTagCompound) {} + + public float getShadowSize() { + return 0.0F; + } + ++ /** ++ * Returns true if other Entities should be prevented from moving through this Entity. ++ */ + public boolean canBeCollidedWith() { + return true; + } + +- public boolean attackEntityFrom(DamageSource var1, float var2) { +- if(this.isEntityInvulnerable()) { ++ /** ++ * Called when the entity is attacked. ++ */ ++ public boolean attackEntityFrom(DamageSource par1DamageSource, float par2) { ++ if (this.isEntityInvulnerable()) { + return false; + } else { +- if(!this.isDead && !this.worldObj.isRemote) { ++ if (!this.isDead && !this.worldObj.isRemote) { + this.health = 0; +- if(this.health <= 0) { ++ ++ if (this.health <= 0) { + this.setDead(); +- if(!this.worldObj.isRemote) { ++ ++ if (!this.worldObj.isRemote) { + this.worldObj.createExplosion((Entity)null, this.posX, this.posY, this.posZ, 6.0F, true); + } + } diff --git a/patches/net/minecraft/src/EntityEnderEye.java.patch b/patches/net/minecraft/src/EntityEnderEye.java.patch new file mode 100644 index 0000000..97f754d --- /dev/null +++ b/patches/net/minecraft/src/EntityEnderEye.java.patch @@ -0,0 +1,243 @@ +--- net/minecraft/src/EntityEnderEye.java ++++ net/minecraft/src/EntityEnderEye.java +@@ -1,64 +1,84 @@ + package net.minecraft.src; + + public class EntityEnderEye extends Entity { ++ ++ /** 'x' location the eye should float towards. */ + private double targetX; ++ ++ /** 'y' location the eye should float towards. */ + private double targetY; ++ ++ /** 'z' location the eye should float towards. */ + private double targetZ; + private int despawnTimer; + private boolean shatterOrDrop; + +- public EntityEnderEye(World var1) { +- super(var1); ++ public EntityEnderEye(World par1World) { ++ super(par1World); + this.setSize(0.25F, 0.25F); + } + +- protected void entityInit() { +- } ++ protected void entityInit() {} + +- public boolean isInRangeToRenderDist(double var1) { ++ /** ++ * Checks if the entity is in range to render by using the past in distance and comparing it to its average edge length ++ * * 64 * renderDistanceWeight Args: distance ++ */ ++ public boolean isInRangeToRenderDist(double par1) { + double var3 = this.boundingBox.getAverageEdgeLength() * 4.0D; + var3 *= 64.0D; +- return var1 < var3 * var3; ++ return par1 < var3 * var3; + } + +- public EntityEnderEye(World var1, double var2, double var4, double var6) { +- super(var1); ++ public EntityEnderEye(World par1World, double par2, double par4, double par6) { ++ super(par1World); + this.despawnTimer = 0; + this.setSize(0.25F, 0.25F); +- this.setPosition(var2, var4, var6); ++ this.setPosition(par2, par4, par6); + this.yOffset = 0.0F; + } + +- public void moveTowards(double var1, int var3, double var4) { +- double var6 = var1 - this.posX; +- double var8 = var4 - this.posZ; ++ /** ++ * The location the eye should float/move towards. Currently used for moving towards the nearest stronghold. Args: ++ * strongholdX, strongholdY, strongholdZ ++ */ ++ public void moveTowards(double par1, int par3, double par4) { ++ double var6 = par1 - this.posX; ++ double var8 = par4 - this.posZ; + float var10 = MathHelper.sqrt_double(var6 * var6 + var8 * var8); +- if(var10 > 12.0F) { ++ ++ if (var10 > 12.0F) { + this.targetX = this.posX + var6 / (double)var10 * 12.0D; + this.targetZ = this.posZ + var8 / (double)var10 * 12.0D; + this.targetY = this.posY + 8.0D; + } else { +- this.targetX = var1; +- this.targetY = (double)var3; +- this.targetZ = var4; ++ this.targetX = par1; ++ this.targetY = (double)par3; ++ this.targetZ = par4; + } + + this.despawnTimer = 0; +- this.shatterOrDrop = this.ab.nextInt(5) > 0; ++ this.shatterOrDrop = this.rand.nextInt(5) > 0; + } + +- public void setVelocity(double var1, double var3, double var5) { +- this.motionX = var1; +- this.motionY = var3; +- this.motionZ = var5; +- if(this.prevRotationPitch == 0.0F && this.prevRotationYaw == 0.0F) { +- float var7 = MathHelper.sqrt_double(var1 * var1 + var5 * var5); +- this.prevRotationYaw = this.rotationYaw = (float)(Math.atan2(var1, var5) * 180.0D / (double)((float)Math.PI)); +- this.prevRotationPitch = this.rotationPitch = (float)(Math.atan2(var3, (double)var7) * 180.0D / (double)((float)Math.PI)); ++ /** ++ * Sets the velocity to the args. Args: x, y, z ++ */ ++ public void setVelocity(double par1, double par3, double par5) { ++ this.motionX = par1; ++ this.motionY = par3; ++ this.motionZ = par5; ++ ++ if (this.prevRotationPitch == 0.0F && this.prevRotationYaw == 0.0F) { ++ float var7 = MathHelper.sqrt_double(par1 * par1 + par5 * par5); ++ this.prevRotationYaw = this.rotationYaw = (float)(Math.atan2(par1, par5) * 180.0D / Math.PI); ++ this.prevRotationPitch = this.rotationPitch = (float)(Math.atan2(par3, (double)var7) * 180.0D / Math.PI); + } +- + } + ++ /** ++ * Called to update the entity's position/logic. ++ */ + public void onUpdate() { + this.lastTickPosX = this.posX; + this.lastTickPosY = this.posY; +@@ -68,87 +88,103 @@ + this.posY += this.motionY; + this.posZ += this.motionZ; + float var1 = MathHelper.sqrt_double(this.motionX * this.motionX + this.motionZ * this.motionZ); +- this.rotationYaw = (float)(Math.atan2(this.motionX, this.motionZ) * 180.0D / (double)((float)Math.PI)); ++ this.rotationYaw = (float)(Math.atan2(this.motionX, this.motionZ) * 180.0D / Math.PI); + +- for(this.rotationPitch = (float)(Math.atan2(this.motionY, (double)var1) * 180.0D / (double)((float)Math.PI)); this.rotationPitch - this.prevRotationPitch < -180.0F; this.prevRotationPitch -= 360.0F) { ++ for (this.rotationPitch = (float)(Math.atan2(this.motionY, (double)var1) * 180.0D / Math.PI); this.rotationPitch - this.prevRotationPitch < -180.0F; this.prevRotationPitch -= 360.0F) { ++ ; + } + +- while(this.rotationPitch - this.prevRotationPitch >= 180.0F) { ++ while (this.rotationPitch - this.prevRotationPitch >= 180.0F) { + this.prevRotationPitch += 360.0F; + } + +- while(this.rotationYaw - this.prevRotationYaw < -180.0F) { ++ while (this.rotationYaw - this.prevRotationYaw < -180.0F) { + this.prevRotationYaw -= 360.0F; + } + +- while(this.rotationYaw - this.prevRotationYaw >= 180.0F) { ++ while (this.rotationYaw - this.prevRotationYaw >= 180.0F) { + this.prevRotationYaw += 360.0F; + } + + this.rotationPitch = this.prevRotationPitch + (this.rotationPitch - this.prevRotationPitch) * 0.2F; + this.rotationYaw = this.prevRotationYaw + (this.rotationYaw - this.prevRotationYaw) * 0.2F; +- if(!this.worldObj.isRemote) { ++ ++ if (!this.worldObj.isRemote) { + double var2 = this.targetX - this.posX; + double var4 = this.targetZ - this.posZ; + float var6 = (float)Math.sqrt(var2 * var2 + var4 * var4); + float var7 = (float)Math.atan2(var4, var2); + double var8 = (double)var1 + (double)(var6 - var1) * 0.0025D; +- if(var6 < 1.0F) { ++ ++ if (var6 < 1.0F) { + var8 *= 0.8D; + this.motionY *= 0.8D; + } + + this.motionX = Math.cos((double)var7) * var8; + this.motionZ = Math.sin((double)var7) * var8; +- if(this.posY < this.targetY) { +- this.motionY += (1.0D - this.motionY) * (double)0.015F; ++ ++ if (this.posY < this.targetY) { ++ this.motionY += (1.0D - this.motionY) * 0.014999999664723873D; + } else { +- this.motionY += (-1.0D - this.motionY) * (double)0.015F; ++ this.motionY += (-1.0D - this.motionY) * 0.014999999664723873D; + } + } + + float var10 = 0.25F; +- if(this.isInWater()) { +- for(int var3 = 0; var3 < 4; ++var3) { ++ ++ if (this.isInWater()) { ++ for (int var3 = 0; var3 < 4; ++var3) { + this.worldObj.spawnParticle("bubble", this.posX - this.motionX * (double)var10, this.posY - this.motionY * (double)var10, this.posZ - this.motionZ * (double)var10, this.motionX, this.motionY, this.motionZ); + } + } else { +- this.worldObj.spawnParticle("portal", this.posX - this.motionX * (double)var10 + this.ab.nextDouble() * 0.6D - 0.3D, this.posY - this.motionY * (double)var10 - 0.5D, this.posZ - this.motionZ * (double)var10 + this.ab.nextDouble() * 0.6D - 0.3D, this.motionX, this.motionY, this.motionZ); ++ this.worldObj.spawnParticle("portal", this.posX - this.motionX * (double)var10 + this.rand.nextDouble() * 0.6D - 0.3D, this.posY - this.motionY * (double)var10 - 0.5D, this.posZ - this.motionZ * (double)var10 + this.rand.nextDouble() * 0.6D - 0.3D, this.motionX, this.motionY, this.motionZ); + } + +- if(!this.worldObj.isRemote) { ++ if (!this.worldObj.isRemote) { + this.setPosition(this.posX, this.posY, this.posZ); + ++this.despawnTimer; +- if(this.despawnTimer > 80 && !this.worldObj.isRemote) { ++ ++ if (this.despawnTimer > 80 && !this.worldObj.isRemote) { + this.setDead(); +- if(this.shatterOrDrop) { ++ ++ if (this.shatterOrDrop) { + this.worldObj.spawnEntityInWorld(new EntityItem(this.worldObj, this.posX, this.posY, this.posZ, new ItemStack(Item.eyeOfEnder))); + } else { + this.worldObj.playAuxSFX(2003, (int)Math.round(this.posX), (int)Math.round(this.posY), (int)Math.round(this.posZ), 0); + } + } + } +- +- } +- +- public void writeEntityToNBT(NBTTagCompound var1) { +- } +- +- public void readEntityFromNBT(NBTTagCompound var1) { +- } ++ } ++ ++ /** ++ * (abstract) Protected helper method to write subclass entity data to NBT. ++ */ ++ public void writeEntityToNBT(NBTTagCompound par1NBTTagCompound) {} ++ ++ /** ++ * (abstract) Protected helper method to read subclass entity data from NBT. ++ */ ++ public void readEntityFromNBT(NBTTagCompound par1NBTTagCompound) {} + + public float getShadowSize() { + return 0.0F; + } + +- public float getBrightness(float var1) { ++ /** ++ * Gets how bright this entity is. ++ */ ++ public float getBrightness(float par1) { + return 1.0F; + } + +- public int getBrightnessForRender(float var1) { ++ public int getBrightnessForRender(float par1) { + return 15728880; + } + ++ /** ++ * If returns false, the item will not inflict any damage against entities. ++ */ + public boolean canAttackWithItem() { + return false; + } diff --git a/patches/net/minecraft/src/EntityEnderPearl.java.patch b/patches/net/minecraft/src/EntityEnderPearl.java.patch new file mode 100644 index 0000000..d0a7fd2 --- /dev/null +++ b/patches/net/minecraft/src/EntityEnderPearl.java.patch @@ -0,0 +1,71 @@ +--- net/minecraft/src/EntityEnderPearl.java ++++ net/minecraft/src/EntityEnderPearl.java +@@ -1,32 +1,36 @@ + package net.minecraft.src; + + public class EntityEnderPearl extends EntityThrowable { +- public EntityEnderPearl(World var1) { +- super(var1); +- } +- +- public EntityEnderPearl(World var1, EntityLivingBase var2) { +- super(var1, var2); +- } +- +- public EntityEnderPearl(World var1, double var2, double var4, double var6) { +- super(var1, var2, var4, var6); +- } +- +- protected void onImpact(MovingObjectPosition var1) { +- if(var1.entityHit != null) { +- var1.entityHit.attackEntityFrom(DamageSource.causeThrownDamage(this, this.getThrower()), 0.0F); +- } +- +- for(int var2 = 0; var2 < 32; ++var2) { +- this.worldObj.spawnParticle("portal", this.posX, this.posY + this.ab.nextDouble() * 2.0D, this.posZ, this.ab.nextGaussian(), 0.0D, this.ab.nextGaussian()); +- } +- +- if(!this.worldObj.isRemote) { +- if(this.getThrower() != null && this.getThrower() instanceof EntityPlayerMP) { ++ public EntityEnderPearl(World par1World) { ++ super(par1World); ++ } ++ ++ public EntityEnderPearl(World par1World, EntityLivingBase par2EntityLivingBase) { ++ super(par1World, par2EntityLivingBase); ++ } ++ ++ public EntityEnderPearl(World par1World, double par2, double par4, double par6) { ++ super(par1World, par2, par4, par6); ++ } ++ ++ /** ++ * Called when this EntityThrowable hits a block or entity. ++ */ ++ protected void onImpact(MovingObjectPosition par1MovingObjectPosition) { ++ if (par1MovingObjectPosition.entityHit != null) { ++ par1MovingObjectPosition.entityHit.attackEntityFrom(DamageSource.causeThrownDamage(this, this.getThrower()), 0.0F); ++ } ++ ++ for (int var2 = 0; var2 < 32; ++var2) { ++ this.worldObj.spawnParticle("portal", this.posX, this.posY + this.rand.nextDouble() * 2.0D, this.posZ, this.rand.nextGaussian(), 0.0D, this.rand.nextGaussian()); ++ } ++ ++ if (!this.worldObj.isRemote) { ++ if (this.getThrower() != null && this.getThrower() instanceof EntityPlayerMP) { + EntityPlayerMP var3 = (EntityPlayerMP)this.getThrower(); +- if(!var3.playerNetServerHandler.connectionClosed && var3.worldObj == this.worldObj) { +- if(this.getThrower().isRiding()) { ++ ++ if (!var3.playerNetServerHandler.connectionClosed && var3.worldObj == this.worldObj) { ++ if (this.getThrower().isRiding()) { + this.getThrower().mountEntity((Entity)null); + } + +@@ -38,6 +42,5 @@ + + this.setDead(); + } +- + } + } diff --git a/patches/net/minecraft/src/EntityEnderman.java.patch b/patches/net/minecraft/src/EntityEnderman.java.patch new file mode 100644 index 0000000..7522bfe --- /dev/null +++ b/patches/net/minecraft/src/EntityEnderman.java.patch @@ -0,0 +1,507 @@ +--- net/minecraft/src/EntityEnderman.java ++++ net/minecraft/src/EntityEnderman.java +@@ -3,16 +3,24 @@ + import java.util.UUID; + + public class EntityEnderman extends EntityMob { +- private static final UUID bp = UUID.fromString("020E0DFB-87AE-4653-9556-831010E291A0"); +- private static final AttributeModifier attackingSpeedBoostModifier = (new AttributeModifier(bp, "Attacking speed boost", (double)6.2F, 0)).setSaved(false); ++ private static final UUID attackingSpeedBoostModifierUUID = UUID.fromString("020E0DFB-87AE-4653-9556-831010E291A0"); ++ private static final AttributeModifier attackingSpeedBoostModifier = (new AttributeModifier(attackingSpeedBoostModifierUUID, "Attacking speed boost", 6.199999809265137D, 0)).setSaved(false); + private static boolean[] carriableBlocks = new boolean[256]; ++ ++ /** ++ * Counter to delay the teleportation of an enderman towards the currently attacked target ++ */ + private int teleportDelay; ++ ++ /** ++ * A player must stare at an enderman for 5 ticks before it becomes aggressive. This field counts those ticks. ++ */ + private int stareTimer; + private Entity lastEntityToAttack; + private boolean isAggressive; + +- public EntityEnderman(World var1) { +- super(var1); ++ public EntityEnderman(World par1World) { ++ super(par1World); + this.setSize(0.6F, 2.9F); + this.stepHeight = 1.0F; + } +@@ -20,7 +28,7 @@ + protected void applyEntityAttributes() { + super.applyEntityAttributes(); + this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setAttribute(40.0D); +- this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setAttribute((double)0.3F); ++ this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setAttribute(0.30000001192092896D); + this.getEntityAttribute(SharedMonsterAttributes.attackDamage).setAttribute(7.0D); + } + +@@ -31,28 +39,40 @@ + this.dataWatcher.addObject(18, new Byte((byte)0)); + } + +- public void writeEntityToNBT(NBTTagCompound var1) { +- super.writeEntityToNBT(var1); +- var1.setShort("carried", (short)this.getCarried()); +- var1.setShort("carriedData", (short)this.getCarryingData()); +- } +- +- public void readEntityFromNBT(NBTTagCompound var1) { +- super.readEntityFromNBT(var1); +- this.setCarried(var1.getShort("carried")); +- this.setCarryingData(var1.getShort("carriedData")); +- } +- ++ /** ++ * (abstract) Protected helper method to write subclass entity data to NBT. ++ */ ++ public void writeEntityToNBT(NBTTagCompound par1NBTTagCompound) { ++ super.writeEntityToNBT(par1NBTTagCompound); ++ par1NBTTagCompound.setShort("carried", (short)this.getCarried()); ++ par1NBTTagCompound.setShort("carriedData", (short)this.getCarryingData()); ++ } ++ ++ /** ++ * (abstract) Protected helper method to read subclass entity data from NBT. ++ */ ++ public void readEntityFromNBT(NBTTagCompound par1NBTTagCompound) { ++ super.readEntityFromNBT(par1NBTTagCompound); ++ this.setCarried(par1NBTTagCompound.getShort("carried")); ++ this.setCarryingData(par1NBTTagCompound.getShort("carriedData")); ++ } ++ ++ /** ++ * Finds the closest player within 16 blocks to attack, or null if this Entity isn't interested in attacking (Animals, ++ * Spiders at day, peaceful PigZombies). ++ */ + protected Entity findPlayerToAttack() { + EntityPlayer var1 = this.worldObj.getClosestVulnerablePlayerToEntity(this, 64.0D); +- if(var1 != null) { +- if(this.shouldAttackPlayer(var1)) { ++ ++ if (var1 != null) { ++ if (this.shouldAttackPlayer(var1)) { + this.isAggressive = true; +- if(this.stareTimer == 0) { ++ ++ if (this.stareTimer == 0) { + this.worldObj.playSoundAtEntity(var1, "mob.endermen.stare", 1.0F, 1.0F); + } + +- if(this.stareTimer++ == 5) { ++ if (this.stareTimer++ == 5) { + this.stareTimer = 0; + this.setScreaming(true); + return var1; +@@ -65,71 +85,85 @@ + return null; + } + +- private boolean shouldAttackPlayer(EntityPlayer var1) { +- ItemStack var2 = var1.inventory.armorInventory[3]; +- if(var2 != null && var2.itemID == Block.pumpkin.blockID) { ++ /** ++ * Checks to see if this enderman should be attacking this player ++ */ ++ private boolean shouldAttackPlayer(EntityPlayer par1EntityPlayer) { ++ ItemStack var2 = par1EntityPlayer.inventory.armorInventory[3]; ++ ++ if (var2 != null && var2.itemID == Block.pumpkin.blockID) { + return false; + } else { +- Vec3 var3 = var1.getLook(1.0F).normalize(); +- Vec3 var4 = this.worldObj.getWorldVec3Pool().getVecFromPool(this.posX - var1.posX, this.boundingBox.minY + (double)(this.height / 2.0F) - (var1.posY + (double)var1.getEyeHeight()), this.posZ - var1.posZ); ++ Vec3 var3 = par1EntityPlayer.getLook(1.0F).normalize(); ++ Vec3 var4 = this.worldObj.getWorldVec3Pool().getVecFromPool(this.posX - par1EntityPlayer.posX, this.boundingBox.minY + (double)(this.height / 2.0F) - (par1EntityPlayer.posY + (double)par1EntityPlayer.getEyeHeight()), this.posZ - par1EntityPlayer.posZ); + double var5 = var4.lengthVector(); + var4 = var4.normalize(); + double var7 = var3.dotProduct(var4); +- return var7 > 1.0D - 0.025D / var5 ? var1.canEntityBeSeen(this) : false; ++ return var7 > 1.0D - 0.025D / var5 ? par1EntityPlayer.canEntityBeSeen(this) : false; + } + } + ++ /** ++ * Called frequently so the entity can update its state every tick as required. For example, zombies and skeletons use ++ * this to react to sunlight and start to burn. ++ */ + public void onLivingUpdate() { +- if(this.isWet()) { ++ if (this.isWet()) { + this.attackEntityFrom(DamageSource.drown, 1.0F); + } + +- if(this.lastEntityToAttack != this.entityToAttack) { ++ if (this.lastEntityToAttack != this.entityToAttack) { + AttributeInstance var1 = this.getEntityAttribute(SharedMonsterAttributes.movementSpeed); + var1.removeModifier(attackingSpeedBoostModifier); +- if(this.entityToAttack != null) { ++ ++ if (this.entityToAttack != null) { + var1.applyModifier(attackingSpeedBoostModifier); + } + } + + this.lastEntityToAttack = this.entityToAttack; + int var6; +- if(!this.worldObj.isRemote && this.worldObj.getGameRules().getGameRuleBooleanValue("mobGriefing")) { ++ ++ if (!this.worldObj.isRemote && this.worldObj.getGameRules().getGameRuleBooleanValue("mobGriefing")) { + int var2; + int var3; + int var4; +- if(this.getCarried() == 0) { +- if(this.ab.nextInt(20) == 0) { +- var6 = MathHelper.floor_double(this.posX - 2.0D + this.ab.nextDouble() * 4.0D); +- var2 = MathHelper.floor_double(this.posY + this.ab.nextDouble() * 3.0D); +- var3 = MathHelper.floor_double(this.posZ - 2.0D + this.ab.nextDouble() * 4.0D); ++ ++ if (this.getCarried() == 0) { ++ if (this.rand.nextInt(20) == 0) { ++ var6 = MathHelper.floor_double(this.posX - 2.0D + this.rand.nextDouble() * 4.0D); ++ var2 = MathHelper.floor_double(this.posY + this.rand.nextDouble() * 3.0D); ++ var3 = MathHelper.floor_double(this.posZ - 2.0D + this.rand.nextDouble() * 4.0D); + var4 = this.worldObj.getBlockId(var6, var2, var3); +- if(carriableBlocks[var4]) { ++ ++ if (carriableBlocks[var4]) { + this.setCarried(this.worldObj.getBlockId(var6, var2, var3)); + this.setCarryingData(this.worldObj.getBlockMetadata(var6, var2, var3)); + this.worldObj.setBlock(var6, var2, var3, 0); + } + } +- } else if(this.ab.nextInt(2000) == 0) { +- var6 = MathHelper.floor_double(this.posX - 1.0D + this.ab.nextDouble() * 2.0D); +- var2 = MathHelper.floor_double(this.posY + this.ab.nextDouble() * 2.0D); +- var3 = MathHelper.floor_double(this.posZ - 1.0D + this.ab.nextDouble() * 2.0D); ++ } else if (this.rand.nextInt(2000) == 0) { ++ var6 = MathHelper.floor_double(this.posX - 1.0D + this.rand.nextDouble() * 2.0D); ++ var2 = MathHelper.floor_double(this.posY + this.rand.nextDouble() * 2.0D); ++ var3 = MathHelper.floor_double(this.posZ - 1.0D + this.rand.nextDouble() * 2.0D); + var4 = this.worldObj.getBlockId(var6, var2, var3); + int var5 = this.worldObj.getBlockId(var6, var2 - 1, var3); +- if(var4 == 0 && var5 > 0 && Block.blocksList[var5].renderAsNormalBlock()) { ++ ++ if (var4 == 0 && var5 > 0 && Block.blocksList[var5].renderAsNormalBlock()) { + this.worldObj.setBlock(var6, var2, var3, this.getCarried(), this.getCarryingData(), 3); + this.setCarried(0); + } + } + } + +- for(var6 = 0; var6 < 2; ++var6) { +- this.worldObj.spawnParticle("portal", this.posX + (this.ab.nextDouble() - 0.5D) * (double)this.width, this.posY + this.ab.nextDouble() * (double)this.height - 0.25D, this.posZ + (this.ab.nextDouble() - 0.5D) * (double)this.width, (this.ab.nextDouble() - 0.5D) * 2.0D, -this.ab.nextDouble(), (this.ab.nextDouble() - 0.5D) * 2.0D); ++ for (var6 = 0; var6 < 2; ++var6) { ++ this.worldObj.spawnParticle("portal", this.posX + (this.rand.nextDouble() - 0.5D) * (double)this.width, this.posY + this.rand.nextDouble() * (double)this.height - 0.25D, this.posZ + (this.rand.nextDouble() - 0.5D) * (double)this.width, (this.rand.nextDouble() - 0.5D) * 2.0D, -this.rand.nextDouble(), (this.rand.nextDouble() - 0.5D) * 2.0D); + } + +- if(this.worldObj.isDaytime() && !this.worldObj.isRemote) { ++ if (this.worldObj.isDaytime() && !this.worldObj.isRemote) { + float var7 = this.getBrightness(1.0F); +- if(var7 > 0.5F && this.worldObj.canBlockSeeTheSky(MathHelper.floor_double(this.posX), MathHelper.floor_double(this.posY), MathHelper.floor_double(this.posZ)) && this.ab.nextFloat() * 30.0F < (var7 - 0.4F) * 2.0F) { ++ ++ if (var7 > 0.5F && this.worldObj.canBlockSeeTheSky(MathHelper.floor_double(this.posX), MathHelper.floor_double(this.posY), MathHelper.floor_double(this.posZ)) && this.rand.nextFloat() * 30.0F < (var7 - 0.4F) * 2.0F) { + this.entityToAttack = null; + this.setScreaming(false); + this.isAggressive = false; +@@ -137,31 +171,32 @@ + } + } + +- if(this.isWet() || this.isBurning()) { ++ if (this.isWet() || this.isBurning()) { + this.entityToAttack = null; + this.setScreaming(false); + this.isAggressive = false; + this.teleportRandomly(); + } + +- if(this.isScreaming() && !this.isAggressive && this.ab.nextInt(100) == 0) { ++ if (this.isScreaming() && !this.isAggressive && this.rand.nextInt(100) == 0) { + this.setScreaming(false); + } + + this.isJumping = false; +- if(this.entityToAttack != null) { ++ ++ if (this.entityToAttack != null) { + this.faceEntity(this.entityToAttack, 100.0F, 100.0F); + } + +- if(!this.worldObj.isRemote && this.isEntityAlive()) { +- if(this.entityToAttack != null) { +- if(this.entityToAttack instanceof EntityPlayer && this.shouldAttackPlayer((EntityPlayer)this.entityToAttack)) { +- if(this.entityToAttack.getDistanceSqToEntity(this) < 16.0D) { ++ if (!this.worldObj.isRemote && this.isEntityAlive()) { ++ if (this.entityToAttack != null) { ++ if (this.entityToAttack instanceof EntityPlayer && this.shouldAttackPlayer((EntityPlayer)this.entityToAttack)) { ++ if (this.entityToAttack.getDistanceSqToEntity(this) < 16.0D) { + this.teleportRandomly(); + } + + this.teleportDelay = 0; +- } else if(this.entityToAttack.getDistanceSqToEntity(this) > 256.0D && this.teleportDelay++ >= 30 && this.teleportToEntity(this.entityToAttack)) { ++ } else if (this.entityToAttack.getDistanceSqToEntity(this) > 256.0D && this.teleportDelay++ >= 30 && this.teleportToEntity(this.entityToAttack)) { + this.teleportDelay = 0; + } + } else { +@@ -173,73 +208,82 @@ + super.onLivingUpdate(); + } + ++ /** ++ * Teleport the enderman to a random nearby position ++ */ + protected boolean teleportRandomly() { +- double var1 = this.posX + (this.ab.nextDouble() - 0.5D) * 64.0D; +- double var3 = this.posY + (double)(this.ab.nextInt(64) - 32); +- double var5 = this.posZ + (this.ab.nextDouble() - 0.5D) * 64.0D; ++ double var1 = this.posX + (this.rand.nextDouble() - 0.5D) * 64.0D; ++ double var3 = this.posY + (double)(this.rand.nextInt(64) - 32); ++ double var5 = this.posZ + (this.rand.nextDouble() - 0.5D) * 64.0D; + return this.teleportTo(var1, var3, var5); + } + +- protected boolean teleportToEntity(Entity var1) { +- Vec3 var2 = this.worldObj.getWorldVec3Pool().getVecFromPool(this.posX - var1.posX, this.boundingBox.minY + (double)(this.height / 2.0F) - var1.posY + (double)var1.getEyeHeight(), this.posZ - var1.posZ); ++ /** ++ * Teleport the enderman to another entity ++ */ ++ protected boolean teleportToEntity(Entity par1Entity) { ++ Vec3 var2 = this.worldObj.getWorldVec3Pool().getVecFromPool(this.posX - par1Entity.posX, this.boundingBox.minY + (double)(this.height / 2.0F) - par1Entity.posY + (double)par1Entity.getEyeHeight(), this.posZ - par1Entity.posZ); + var2 = var2.normalize(); + double var3 = 16.0D; +- double var5 = this.posX + (this.ab.nextDouble() - 0.5D) * 8.0D - var2.xCoord * var3; +- double var7 = this.posY + (double)(this.ab.nextInt(16) - 8) - var2.yCoord * var3; +- double var9 = this.posZ + (this.ab.nextDouble() - 0.5D) * 8.0D - var2.zCoord * var3; ++ double var5 = this.posX + (this.rand.nextDouble() - 0.5D) * 8.0D - var2.xCoord * var3; ++ double var7 = this.posY + (double)(this.rand.nextInt(16) - 8) - var2.yCoord * var3; ++ double var9 = this.posZ + (this.rand.nextDouble() - 0.5D) * 8.0D - var2.zCoord * var3; + return this.teleportTo(var5, var7, var9); + } + +- protected boolean teleportTo(double var1, double var3, double var5) { ++ /** ++ * Teleport the enderman ++ */ ++ protected boolean teleportTo(double par1, double par3, double par5) { + double var7 = this.posX; + double var9 = this.posY; + double var11 = this.posZ; +- this.posX = var1; +- this.posY = var3; +- this.posZ = var5; ++ this.posX = par1; ++ this.posY = par3; ++ this.posZ = par5; + boolean var13 = false; + int var14 = MathHelper.floor_double(this.posX); + int var15 = MathHelper.floor_double(this.posY); + int var16 = MathHelper.floor_double(this.posZ); + int var18; +- if(this.worldObj.blockExists(var14, var15, var16)) { ++ ++ if (this.worldObj.blockExists(var14, var15, var16)) { + boolean var17 = false; + +- while(true) { +- while(!var17 && var15 > 0) { +- var18 = this.worldObj.getBlockId(var14, var15 - 1, var16); +- if(var18 != 0 && Block.blocksList[var18].blockMaterial.blocksMovement()) { +- var17 = true; +- } else { +- --this.posY; +- --var15; +- } +- } +- +- if(var17) { +- this.setPosition(this.posX, this.posY, this.posZ); +- if(this.worldObj.getCollidingBoundingBoxes(this, this.boundingBox).isEmpty() && !this.worldObj.isAnyLiquid(this.boundingBox)) { +- var13 = true; +- } +- } +- break; ++ while (!var17 && var15 > 0) { ++ var18 = this.worldObj.getBlockId(var14, var15 - 1, var16); ++ ++ if (var18 != 0 && Block.blocksList[var18].blockMaterial.blocksMovement()) { ++ var17 = true; ++ } else { ++ --this.posY; ++ --var15; ++ } ++ } ++ ++ if (var17) { ++ this.setPosition(this.posX, this.posY, this.posZ); ++ ++ if (this.worldObj.getCollidingBoundingBoxes(this, this.boundingBox).isEmpty() && !this.worldObj.isAnyLiquid(this.boundingBox)) { ++ var13 = true; ++ } + } + } + +- if(!var13) { ++ if (!var13) { + this.setPosition(var7, var9, var11); + return false; + } else { + short var30 = 128; + +- for(var18 = 0; var18 < var30; ++var18) { ++ for (var18 = 0; var18 < var30; ++var18) { + double var19 = (double)var18 / ((double)var30 - 1.0D); +- float var21 = (this.ab.nextFloat() - 0.5F) * 0.2F; +- float var22 = (this.ab.nextFloat() - 0.5F) * 0.2F; +- float var23 = (this.ab.nextFloat() - 0.5F) * 0.2F; +- double var24 = var7 + (this.posX - var7) * var19 + (this.ab.nextDouble() - 0.5D) * (double)this.width * 2.0D; +- double var26 = var9 + (this.posY - var9) * var19 + this.ab.nextDouble() * (double)this.height; +- double var28 = var11 + (this.posZ - var11) * var19 + (this.ab.nextDouble() - 0.5D) * (double)this.width * 2.0D; ++ float var21 = (this.rand.nextFloat() - 0.5F) * 0.2F; ++ float var22 = (this.rand.nextFloat() - 0.5F) * 0.2F; ++ float var23 = (this.rand.nextFloat() - 0.5F) * 0.2F; ++ double var24 = var7 + (this.posX - var7) * var19 + (this.rand.nextDouble() - 0.5D) * (double)this.width * 2.0D; ++ double var26 = var9 + (this.posY - var9) * var19 + this.rand.nextDouble() * (double)this.height; ++ double var28 = var11 + (this.posZ - var11) * var19 + (this.rand.nextDouble() - 0.5D) * (double)this.width * 2.0D; + this.worldObj.spawnParticle("portal", var24, var26, var28, (double)var21, (double)var22, (double)var23); + } + +@@ -249,71 +293,103 @@ + } + } + ++ /** ++ * Returns the sound this mob makes while it's alive. ++ */ + protected String getLivingSound() { + return this.isScreaming() ? "mob.endermen.scream" : "mob.endermen.idle"; + } + ++ /** ++ * Returns the sound this mob makes when it is hurt. ++ */ + protected String getHurtSound() { + return "mob.endermen.hit"; + } + ++ /** ++ * Returns the sound this mob makes on death. ++ */ + protected String getDeathSound() { + return "mob.endermen.death"; + } + ++ /** ++ * Returns the item ID for the item the mob drops on death. ++ */ + protected int getDropItemId() { + return Item.enderPearl.itemID; + } + +- protected void dropFewItems(boolean var1, int var2) { ++ /** ++ * Drop 0-2 items of this living's type. @param par1 - Whether this entity has recently been hit by a player. @param ++ * par2 - Level of Looting used to kill this mob. ++ */ ++ protected void dropFewItems(boolean par1, int par2) { + int var3 = this.getDropItemId(); +- if(var3 > 0) { +- int var4 = this.ab.nextInt(2 + var2); +- +- for(int var5 = 0; var5 < var4; ++var5) { ++ ++ if (var3 > 0) { ++ int var4 = this.rand.nextInt(2 + par2); ++ ++ for (int var5 = 0; var5 < var4; ++var5) { + this.dropItem(var3, 1); + } + } +- +- } +- +- public void setCarried(int var1) { +- this.dataWatcher.updateObject(16, Byte.valueOf((byte)(var1 & 255))); +- } +- ++ } ++ ++ /** ++ * Set the id of the block an enderman carries ++ */ ++ public void setCarried(int par1) { ++ this.dataWatcher.updateObject(16, Byte.valueOf((byte)(par1 & 255))); ++ } ++ ++ /** ++ * Get the id of the block an enderman carries ++ */ + public int getCarried() { + return this.dataWatcher.getWatchableObjectByte(16); + } + +- public void setCarryingData(int var1) { +- this.dataWatcher.updateObject(17, Byte.valueOf((byte)(var1 & 255))); ++ /** ++ * Set the metadata of the block an enderman carries ++ */ ++ public void setCarryingData(int par1) { ++ this.dataWatcher.updateObject(17, Byte.valueOf((byte)(par1 & 255))); + } + ++ /** ++ * Get the metadata of the block an enderman carries ++ */ + public int getCarryingData() { + return this.dataWatcher.getWatchableObjectByte(17); + } + +- public boolean attackEntityFrom(DamageSource var1, float var2) { +- if(this.isEntityInvulnerable()) { ++ /** ++ * Called when the entity is attacked. ++ */ ++ public boolean attackEntityFrom(DamageSource par1DamageSource, float par2) { ++ if (this.isEntityInvulnerable()) { + return false; + } else { + this.setScreaming(true); +- if(var1 instanceof EntityDamageSource && var1.getEntity() instanceof EntityPlayer) { ++ ++ if (par1DamageSource instanceof EntityDamageSource && par1DamageSource.getEntity() instanceof EntityPlayer) { + this.isAggressive = true; + } + +- if(var1 instanceof EntityDamageSourceIndirect) { ++ if (par1DamageSource instanceof EntityDamageSourceIndirect) { + this.isAggressive = false; + +- for(int var3 = 0; var3 < 64; ++var3) { +- if(this.teleportRandomly()) { ++ for (int var3 = 0; var3 < 64; ++var3) { ++ if (this.teleportRandomly()) { + return true; + } + } + + return false; + } else { +- return super.attackEntityFrom(var1, var2); ++ return super.attackEntityFrom(par1DamageSource, par2); + } + } + } +@@ -322,8 +398,8 @@ + return this.dataWatcher.getWatchableObjectByte(18) > 0; + } + +- public void setScreaming(boolean var1) { +- this.dataWatcher.updateObject(18, Byte.valueOf((byte)(var1 ? 1 : 0))); ++ public void setScreaming(boolean par1) { ++ this.dataWatcher.updateObject(18, Byte.valueOf((byte)(par1 ? 1 : 0))); + } + + static { diff --git a/patches/net/minecraft/src/EntityExpBottle.java.patch b/patches/net/minecraft/src/EntityExpBottle.java.patch new file mode 100644 index 0000000..c93e21d --- /dev/null +++ b/patches/net/minecraft/src/EntityExpBottle.java.patch @@ -0,0 +1,63 @@ +--- net/minecraft/src/EntityExpBottle.java ++++ net/minecraft/src/EntityExpBottle.java +@@ -1,18 +1,21 @@ + package net.minecraft.src; + + public class EntityExpBottle extends EntityThrowable { +- public EntityExpBottle(World var1) { +- super(var1); +- } +- +- public EntityExpBottle(World var1, EntityLivingBase var2) { +- super(var1, var2); +- } +- +- public EntityExpBottle(World var1, double var2, double var4, double var6) { +- super(var1, var2, var4, var6); +- } +- ++ public EntityExpBottle(World par1World) { ++ super(par1World); ++ } ++ ++ public EntityExpBottle(World par1World, EntityLivingBase par2EntityLivingBase) { ++ super(par1World, par2EntityLivingBase); ++ } ++ ++ public EntityExpBottle(World par1World, double par2, double par4, double par6) { ++ super(par1World, par2, par4, par6); ++ } ++ ++ /** ++ * Gets the amount of gravity to apply to the thrown entity with each tick. ++ */ + protected float getGravityVelocity() { + return 0.07F; + } +@@ -25,12 +28,15 @@ + return -20.0F; + } + +- protected void onImpact(MovingObjectPosition var1) { +- if(!this.worldObj.isRemote) { ++ /** ++ * Called when this EntityThrowable hits a block or entity. ++ */ ++ protected void onImpact(MovingObjectPosition par1MovingObjectPosition) { ++ if (!this.worldObj.isRemote) { + this.worldObj.playAuxSFX(2002, (int)Math.round(this.posX), (int)Math.round(this.posY), (int)Math.round(this.posZ), 0); +- int var2 = 3 + this.worldObj.s.nextInt(5) + this.worldObj.s.nextInt(5); ++ int var2 = 3 + this.worldObj.rand.nextInt(5) + this.worldObj.rand.nextInt(5); + +- while(var2 > 0) { ++ while (var2 > 0) { + int var3 = EntityXPOrb.getXPSplit(var2); + var2 -= var3; + this.worldObj.spawnEntityInWorld(new EntityXPOrb(this.worldObj, this.posX, this.posY, this.posZ, var3)); +@@ -38,6 +44,5 @@ + + this.setDead(); + } +- + } + } diff --git a/patches/net/minecraft/src/EntityExplodeFX.java.patch b/patches/net/minecraft/src/EntityExplodeFX.java.patch new file mode 100644 index 0000000..a351d41 --- /dev/null +++ b/patches/net/minecraft/src/EntityExplodeFX.java.patch @@ -0,0 +1,57 @@ +--- net/minecraft/src/EntityExplodeFX.java ++++ net/minecraft/src/EntityExplodeFX.java +@@ -1,34 +1,38 @@ + package net.minecraft.src; + + public class EntityExplodeFX extends EntityFX { +- public EntityExplodeFX(World var1, double var2, double var4, double var6, double var8, double var10, double var12) { +- super(var1, var2, var4, var6, var8, var10, var12); +- this.motionX = var8 + (double)((float)(Math.random() * 2.0D - 1.0D) * 0.05F); +- this.motionY = var10 + (double)((float)(Math.random() * 2.0D - 1.0D) * 0.05F); +- this.motionZ = var12 + (double)((float)(Math.random() * 2.0D - 1.0D) * 0.05F); +- this.particleRed = this.particleGreen = this.particleBlue = this.ab.nextFloat() * 0.3F + 0.7F; +- this.particleScale = this.ab.nextFloat() * this.ab.nextFloat() * 6.0F + 1.0F; +- this.particleMaxAge = (int)(16.0D / ((double)this.ab.nextFloat() * 0.8D + 0.2D)) + 2; ++ public EntityExplodeFX(World par1World, double par2, double par4, double par6, double par8, double par10, double par12) { ++ super(par1World, par2, par4, par6, par8, par10, par12); ++ this.motionX = par8 + (double)((float)(Math.random() * 2.0D - 1.0D) * 0.05F); ++ this.motionY = par10 + (double)((float)(Math.random() * 2.0D - 1.0D) * 0.05F); ++ this.motionZ = par12 + (double)((float)(Math.random() * 2.0D - 1.0D) * 0.05F); ++ this.particleRed = this.particleGreen = this.particleBlue = this.rand.nextFloat() * 0.3F + 0.7F; ++ this.particleScale = this.rand.nextFloat() * this.rand.nextFloat() * 6.0F + 1.0F; ++ this.particleMaxAge = (int)(16.0D / ((double)this.rand.nextFloat() * 0.8D + 0.2D)) + 2; + } + ++ /** ++ * Called to update the entity's position/logic. ++ */ + public void onUpdate() { + this.prevPosX = this.posX; + this.prevPosY = this.posY; + this.prevPosZ = this.posZ; +- if(this.particleAge++ >= this.particleMaxAge) { ++ ++ if (this.particleAge++ >= this.particleMaxAge) { + this.setDead(); + } + + this.setParticleTextureIndex(7 - this.particleAge * 8 / this.particleMaxAge); + this.motionY += 0.004D; + this.moveEntity(this.motionX, this.motionY, this.motionZ); +- this.motionX *= (double)0.9F; +- this.motionY *= (double)0.9F; +- this.motionZ *= (double)0.9F; +- if(this.onGround) { +- this.motionX *= (double)0.7F; +- this.motionZ *= (double)0.7F; +- } ++ this.motionX *= 0.8999999761581421D; ++ this.motionY *= 0.8999999761581421D; ++ this.motionZ *= 0.8999999761581421D; + ++ if (this.onGround) { ++ this.motionX *= 0.699999988079071D; ++ this.motionZ *= 0.699999988079071D; ++ } + } + } diff --git a/patches/net/minecraft/src/EntityFX.java.patch b/patches/net/minecraft/src/EntityFX.java.patch new file mode 100644 index 0000000..3579322 --- /dev/null +++ b/patches/net/minecraft/src/EntityFX.java.patch @@ -0,0 +1,302 @@ +--- net/minecraft/src/EntityFX.java ++++ net/minecraft/src/EntityFX.java +@@ -2,72 +2,99 @@ + + public class EntityFX extends Entity { + protected int particleTextureIndexX; +- protected int particleTextureIndexY; ++ protected int particleTextureIndexY; + protected float particleTextureJitterX; + protected float particleTextureJitterY; +- protected int particleAge; +- protected int particleMaxAge; +- protected float particleScale; +- protected float particleGravity; +- protected float particleRed; +- protected float particleGreen; +- protected float particleBlue; ++ // Spout Start - protected to public ++ public int particleAge; ++ public int particleMaxAge; ++ public float particleScale; ++ public float particleGravity; ++ // Spout End ++ ++ /** The red amount of color. Used as a percentage, 1.0 = 255 and 0.0 = 0. */ ++ // Spout Start - protected to public ++ public float particleRed; ++ // Spout End ++ ++ /** ++ * The green amount of color. Used as a percentage, 1.0 = 255 and 0.0 = 0. ++ */ ++ // Spout Start - protected to public ++ public float particleGreen; ++ // Spout End ++ ++ /** ++ * The blue amount of color. Used as a percentage, 1.0 = 255 and 0.0 = 0. ++ */ ++ // Spout Start - protected to public ++ public float particleBlue; ++ // Spout End ++ ++ /** Particle alpha */ + protected float particleAlpha; ++ ++ /** The icon field from which the given particle pulls its texture. */ + protected Icon particleIcon; + public static double interpPosX; + public static double interpPosY; + public static double interpPosZ; + +- protected EntityFX(World var1, double var2, double var4, double var6) { +- super(var1); +- this.particleAlpha = 1.0F; ++ // Spout Start - protected to public ++ public EntityFX(World par1World, double par2, double par4, double par6) { ++ // Spout End ++ super(par1World); ++ this.particleAlpha = 1.0F; + this.setSize(0.2F, 0.2F); + this.yOffset = this.height / 2.0F; +- this.setPosition(var2, var4, var6); +- this.lastTickPosX = var2; +- this.lastTickPosY = var4; +- this.lastTickPosZ = var6; ++ this.setPosition(par2, par4, par6); ++ this.lastTickPosX = par2; ++ this.lastTickPosY = par4; ++ this.lastTickPosZ = par6; + this.particleRed = this.particleGreen = this.particleBlue = 1.0F; +- this.particleTextureJitterX = this.ab.nextFloat() * 3.0F; +- this.particleTextureJitterY = this.ab.nextFloat() * 3.0F; +- this.particleScale = (this.ab.nextFloat() * 0.5F + 0.5F) * 2.0F; +- this.particleMaxAge = (int)(4.0F / (this.ab.nextFloat() * 0.9F + 0.1F)); ++ this.particleTextureJitterX = this.rand.nextFloat() * 3.0F; ++ this.particleTextureJitterY = this.rand.nextFloat() * 3.0F; ++ this.particleScale = (this.rand.nextFloat() * 0.5F + 0.5F) * 2.0F; ++ this.particleMaxAge = (int)(4.0F / (this.rand.nextFloat() * 0.9F + 0.1F)); + this.particleAge = 0; + } + +- public EntityFX(World var1, double var2, double var4, double var6, double var8, double var10, double var12) { +- this(var1, var2, var4, var6); +- this.motionX = var8 + (double)((float)(Math.random() * 2.0D - 1.0D) * 0.4F); +- this.motionY = var10 + (double)((float)(Math.random() * 2.0D - 1.0D) * 0.4F); +- this.motionZ = var12 + (double)((float)(Math.random() * 2.0D - 1.0D) * 0.4F); ++ public EntityFX(World par1World, double par2, double par4, double par6, double par8, double par10, double par12) { ++ this(par1World, par2, par4, par6); ++ this.motionX = par8 + (double)((float)(Math.random() * 2.0D - 1.0D) * 0.4F); ++ this.motionY = par10 + (double)((float)(Math.random() * 2.0D - 1.0D) * 0.4F); ++ this.motionZ = par12 + (double)((float)(Math.random() * 2.0D - 1.0D) * 0.4F); + float var14 = (float)(Math.random() + Math.random() + 1.0D) * 0.15F; + float var15 = MathHelper.sqrt_double(this.motionX * this.motionX + this.motionY * this.motionY + this.motionZ * this.motionZ); +- this.motionX = this.motionX / (double)var15 * (double)var14 * (double)0.4F; +- this.motionY = this.motionY / (double)var15 * (double)var14 * (double)0.4F + (double)0.1F; +- this.motionZ = this.motionZ / (double)var15 * (double)var14 * (double)0.4F; +- } +- +- public EntityFX multiplyVelocity(float var1) { +- this.motionX *= (double)var1; +- this.motionY = (this.motionY - (double)0.1F) * (double)var1 + (double)0.1F; +- this.motionZ *= (double)var1; +- return this; +- } +- +- public EntityFX multipleParticleScaleBy(float var1) { +- this.setSize(0.2F * var1, 0.2F * var1); +- this.particleScale *= var1; +- return this; +- } +- +- public void setRBGColorF(float var1, float var2, float var3) { +- this.particleRed = var1; +- this.particleGreen = var2; +- this.particleBlue = var3; +- } +- +- public void setAlphaF(float var1) { +- this.particleAlpha = var1; ++ this.motionX = this.motionX / (double)var15 * (double)var14 * 0.4000000059604645D; ++ this.motionY = this.motionY / (double)var15 * (double)var14 * 0.4000000059604645D + 0.10000000149011612D; ++ this.motionZ = this.motionZ / (double)var15 * (double)var14 * 0.4000000059604645D; ++ } ++ ++ public EntityFX multiplyVelocity(float par1) { ++ this.motionX *= (double)par1; ++ this.motionY = (this.motionY - 0.10000000149011612D) * (double)par1 + 0.10000000149011612D; ++ this.motionZ *= (double)par1; ++ return this; ++ } ++ ++ public EntityFX multipleParticleScaleBy(float par1) { ++ this.setSize(0.2F * par1, 0.2F * par1); ++ this.particleScale *= par1; ++ return this; ++ } ++ ++ public void setRBGColorF(float par1, float par2, float par3) { ++ this.particleRed = par1; ++ this.particleGreen = par2; ++ this.particleBlue = par3; ++ } ++ ++ /** ++ * Sets the particle alpha (float) ++ */ ++ public void setAlphaF(float par1) { ++ this.particleAlpha = par1; + } + + public float getRedColorF() { +@@ -82,93 +109,110 @@ + return this.particleBlue; + } + ++ /** ++ * returns if this entity triggers Block.onEntityWalking on the blocks they walk on. used for spiders and wolves to ++ * prevent them from trampling crops ++ */ + protected boolean canTriggerWalking() { + return false; + } + +- protected void entityInit() { +- } ++ protected void entityInit() {} + ++ /** ++ * Called to update the entity's position/logic. ++ */ + public void onUpdate() { + this.prevPosX = this.posX; + this.prevPosY = this.posY; + this.prevPosZ = this.posZ; +- if(this.particleAge++ >= this.particleMaxAge) { ++ ++ if (this.particleAge++ >= this.particleMaxAge) { + this.setDead(); + } + + this.motionY -= 0.04D * (double)this.particleGravity; + this.moveEntity(this.motionX, this.motionY, this.motionZ); +- this.motionX *= (double)0.98F; +- this.motionY *= (double)0.98F; +- this.motionZ *= (double)0.98F; +- if(this.onGround) { +- this.motionX *= (double)0.7F; +- this.motionZ *= (double)0.7F; ++ this.motionX *= 0.9800000190734863D; ++ this.motionY *= 0.9800000190734863D; ++ this.motionZ *= 0.9800000190734863D; ++ ++ if (this.onGround) { ++ this.motionX *= 0.699999988079071D; ++ this.motionZ *= 0.699999988079071D; + } +- + } + +- public void renderParticle(Tessellator var1, float var2, float var3, float var4, float var5, float var6, float var7) { ++ public void renderParticle(Tessellator par1Tessellator, float par2, float par3, float par4, float par5, float par6, float par7) { + float var8 = (float)this.particleTextureIndexX / 16.0F; +- float var9 = var8 + 0.999F / 16.0F; ++ float var9 = var8 + 0.0624375F; + float var10 = (float)this.particleTextureIndexY / 16.0F; +- float var11 = var10 + 0.999F / 16.0F; ++ float var11 = var10 + 0.0624375F; + float var12 = 0.1F * this.particleScale; +- if(this.particleIcon != null) { ++ ++ if (this.particleIcon != null) { + var8 = this.particleIcon.getMinU(); + var9 = this.particleIcon.getMaxU(); + var10 = this.particleIcon.getMinV(); + var11 = this.particleIcon.getMaxV(); + } + +- float var13 = (float)(this.prevPosX + (this.posX - this.prevPosX) * (double)var2 - interpPosX); +- float var14 = (float)(this.prevPosY + (this.posY - this.prevPosY) * (double)var2 - interpPosY); +- float var15 = (float)(this.prevPosZ + (this.posZ - this.prevPosZ) * (double)var2 - interpPosZ); ++ float var13 = (float)(this.prevPosX + (this.posX - this.prevPosX) * (double)par2 - interpPosX); ++ float var14 = (float)(this.prevPosY + (this.posY - this.prevPosY) * (double)par2 - interpPosY); ++ float var15 = (float)(this.prevPosZ + (this.posZ - this.prevPosZ) * (double)par2 - interpPosZ); + float var16 = 1.0F; +- var1.setColorRGBA_F(this.particleRed * var16, this.particleGreen * var16, this.particleBlue * var16, this.particleAlpha); +- var1.addVertexWithUV((double)(var13 - var3 * var12 - var6 * var12), (double)(var14 - var4 * var12), (double)(var15 - var5 * var12 - var7 * var12), (double)var9, (double)var11); +- var1.addVertexWithUV((double)(var13 - var3 * var12 + var6 * var12), (double)(var14 + var4 * var12), (double)(var15 - var5 * var12 + var7 * var12), (double)var9, (double)var10); +- var1.addVertexWithUV((double)(var13 + var3 * var12 + var6 * var12), (double)(var14 + var4 * var12), (double)(var15 + var5 * var12 + var7 * var12), (double)var8, (double)var10); +- var1.addVertexWithUV((double)(var13 + var3 * var12 - var6 * var12), (double)(var14 - var4 * var12), (double)(var15 + var5 * var12 - var7 * var12), (double)var8, (double)var11); ++ par1Tessellator.setColorRGBA_F(this.particleRed * var16, this.particleGreen * var16, this.particleBlue * var16, this.particleAlpha); ++ par1Tessellator.addVertexWithUV((double)(var13 - par3 * var12 - par6 * var12), (double)(var14 - par4 * var12), (double)(var15 - par5 * var12 - par7 * var12), (double)var9, (double)var11); ++ par1Tessellator.addVertexWithUV((double)(var13 - par3 * var12 + par6 * var12), (double)(var14 + par4 * var12), (double)(var15 - par5 * var12 + par7 * var12), (double)var9, (double)var10); ++ par1Tessellator.addVertexWithUV((double)(var13 + par3 * var12 + par6 * var12), (double)(var14 + par4 * var12), (double)(var15 + par5 * var12 + par7 * var12), (double)var8, (double)var10); ++ par1Tessellator.addVertexWithUV((double)(var13 + par3 * var12 - par6 * var12), (double)(var14 - par4 * var12), (double)(var15 + par5 * var12 - par7 * var12), (double)var8, (double)var11); + } + + public int getFXLayer() { + return 0; + } + +- public void writeEntityToNBT(NBTTagCompound var1) { +- } +- +- public void readEntityFromNBT(NBTTagCompound var1) { +- } +- +- public void setParticleIcon(Icon var1) { +- if(this.getFXLayer() == 1) { +- this.particleIcon = var1; ++ /** ++ * (abstract) Protected helper method to write subclass entity data to NBT. ++ */ ++ public void writeEntityToNBT(NBTTagCompound par1NBTTagCompound) {} ++ ++ /** ++ * (abstract) Protected helper method to read subclass entity data from NBT. ++ */ ++ public void readEntityFromNBT(NBTTagCompound par1NBTTagCompound) {} ++ ++ public void setParticleIcon(Icon par1Icon) { ++ if (this.getFXLayer() == 1) { ++ this.particleIcon = par1Icon; + } else { +- if(this.getFXLayer() != 2) { ++ if (this.getFXLayer() != 2) { + throw new RuntimeException("Invalid call to Particle.setTex, use coordinate methods"); + } + +- this.particleIcon = var1; ++ this.particleIcon = par1Icon; + } +- + } + +- public void setParticleTextureIndex(int var1) { +- if(this.getFXLayer() != 0) { ++ /** ++ * Public method to set private field particleTextureIndex. ++ */ ++ public void setParticleTextureIndex(int par1) { ++ if (this.getFXLayer() != 0) { + throw new RuntimeException("Invalid call to Particle.setMiscTex"); + } else { +- this.particleTextureIndexX = var1 % 16; +- this.particleTextureIndexY = var1 / 16; ++ this.particleTextureIndexX = par1 % 16; ++ this.particleTextureIndexY = par1 / 16; + } + } + + public void nextTextureIndexX() { +- ++this.particleTextureIndexX; ++ ++this.particleTextureIndexX; + } + ++ /** ++ * If returns false, the item will not inflict any damage against entities. ++ */ + public boolean canAttackWithItem() { + return false; + } diff --git a/patches/net/minecraft/src/EntityFallingSand.java.patch b/patches/net/minecraft/src/EntityFallingSand.java.patch new file mode 100644 index 0000000..41dec7b --- /dev/null +++ b/patches/net/minecraft/src/EntityFallingSand.java.patch @@ -0,0 +1,344 @@ +--- net/minecraft/src/EntityFallingSand.java ++++ net/minecraft/src/EntityFallingSand.java +@@ -6,74 +6,91 @@ + public class EntityFallingSand extends Entity { + public int blockID; + public int metadata; ++ ++ /** How long the block has been falling for. */ + public int fallTime; + public boolean shouldDropItem; + private boolean isBreakingAnvil; + private boolean isAnvil; ++ ++ /** Maximum amount of damage dealt to entities hit by falling block */ + private int fallHurtMax; ++ ++ /** Actual damage dealt to entities hit by falling block */ + private float fallHurtAmount; + public NBTTagCompound fallingBlockTileEntityData; + +- public EntityFallingSand(World var1) { +- super(var1); +- this.shouldDropItem = true; +- this.fallHurtMax = 40; +- this.fallHurtAmount = 2.0F; +- } +- +- public EntityFallingSand(World var1, double var2, double var4, double var6, int var8) { +- this(var1, var2, var4, var6, var8, 0); +- } +- +- public EntityFallingSand(World var1, double var2, double var4, double var6, int var8, int var9) { +- super(var1); +- this.shouldDropItem = true; +- this.fallHurtMax = 40; +- this.fallHurtAmount = 2.0F; +- this.blockID = var8; +- this.metadata = var9; ++ public EntityFallingSand(World par1World) { ++ super(par1World); ++ this.shouldDropItem = true; ++ this.fallHurtMax = 40; ++ this.fallHurtAmount = 2.0F; ++ } ++ ++ public EntityFallingSand(World par1World, double par2, double par4, double par6, int par8) { ++ this(par1World, par2, par4, par6, par8, 0); ++ } ++ ++ public EntityFallingSand(World par1World, double par2, double par4, double par6, int par8, int par9) { ++ super(par1World); ++ this.shouldDropItem = true; ++ this.fallHurtMax = 40; ++ this.fallHurtAmount = 2.0F; ++ this.blockID = par8; ++ this.metadata = par9; + this.preventEntitySpawning = true; + this.setSize(0.98F, 0.98F); + this.yOffset = this.height / 2.0F; +- this.setPosition(var2, var4, var6); ++ this.setPosition(par2, par4, par6); + this.motionX = 0.0D; + this.motionY = 0.0D; + this.motionZ = 0.0D; +- this.prevPosX = var2; +- this.prevPosY = var4; +- this.prevPosZ = var6; ++ this.prevPosX = par2; ++ this.prevPosY = par4; ++ this.prevPosZ = par6; + } + ++ /** ++ * returns if this entity triggers Block.onEntityWalking on the blocks they walk on. used for spiders and wolves to ++ * prevent them from trampling crops ++ */ + protected boolean canTriggerWalking() { + return false; + } + +- protected void entityInit() { +- } ++ protected void entityInit() {} + ++ /** ++ * Returns true if other Entities should be prevented from moving through this Entity. ++ */ + public boolean canBeCollidedWith() { + return !this.isDead; + } + ++ /** ++ * Called to update the entity's position/logic. ++ */ + public void onUpdate() { +- if(this.blockID == 0) { ++ if (this.blockID == 0) { + this.setDead(); + } else { + this.prevPosX = this.posX; + this.prevPosY = this.posY; + this.prevPosZ = this.posZ; + ++this.fallTime; +- this.motionY -= (double)0.04F; ++ this.motionY -= 0.03999999910593033D; + this.moveEntity(this.motionX, this.motionY, this.motionZ); +- this.motionX *= (double)0.98F; +- this.motionY *= (double)0.98F; +- this.motionZ *= (double)0.98F; +- if(!this.worldObj.isRemote) { ++ this.motionX *= 0.9800000190734863D; ++ this.motionY *= 0.9800000190734863D; ++ this.motionZ *= 0.9800000190734863D; ++ ++ if (!this.worldObj.isRemote) { + int var1 = MathHelper.floor_double(this.posX); + int var2 = MathHelper.floor_double(this.posY); + int var3 = MathHelper.floor_double(this.posZ); +- if(this.fallTime == 1) { +- if(this.worldObj.getBlockId(var1, var2, var3) != this.blockID) { ++ ++ if (this.fallTime == 1) { ++ if (this.worldObj.getBlockId(var1, var2, var3) != this.blockID) { + this.setDead(); + return; + } +@@ -81,27 +98,31 @@ + this.worldObj.setBlockToAir(var1, var2, var3); + } + +- if(this.onGround) { +- this.motionX *= (double)0.7F; +- this.motionZ *= (double)0.7F; ++ if (this.onGround) { ++ this.motionX *= 0.699999988079071D; ++ this.motionZ *= 0.699999988079071D; + this.motionY *= -0.5D; +- if(this.worldObj.getBlockId(var1, var2, var3) != Block.pistonMoving.blockID) { ++ ++ if (this.worldObj.getBlockId(var1, var2, var3) != Block.pistonMoving.blockID) { + this.setDead(); +- if(!this.isBreakingAnvil && this.worldObj.canPlaceEntityOnSide(this.blockID, var1, var2, var3, true, 1, (Entity)null, (ItemStack)null) && !BlockSand.canFallBelow(this.worldObj, var1, var2 - 1, var3) && this.worldObj.setBlock(var1, var2, var3, this.blockID, this.metadata, 3)) { +- if(Block.blocksList[this.blockID] instanceof BlockSand) { ++ ++ if (!this.isBreakingAnvil && this.worldObj.canPlaceEntityOnSide(this.blockID, var1, var2, var3, true, 1, (Entity)null, (ItemStack)null) && !BlockSand.canFallBelow(this.worldObj, var1, var2 - 1, var3) && this.worldObj.setBlock(var1, var2, var3, this.blockID, this.metadata, 3)) { ++ if (Block.blocksList[this.blockID] instanceof BlockSand) { + ((BlockSand)Block.blocksList[this.blockID]).onFinishFalling(this.worldObj, var1, var2, var3, this.metadata); + } + +- if(this.fallingBlockTileEntityData != null && Block.blocksList[this.blockID] instanceof ITileEntityProvider) { ++ if (this.fallingBlockTileEntityData != null && Block.blocksList[this.blockID] instanceof ITileEntityProvider) { + TileEntity var4 = this.worldObj.getBlockTileEntity(var1, var2, var3); +- if(var4 != null) { ++ ++ if (var4 != null) { + NBTTagCompound var5 = new NBTTagCompound(); + var4.writeToNBT(var5); + Iterator var6 = this.fallingBlockTileEntityData.getTags().iterator(); + +- while(var6.hasNext()) { ++ while (var6.hasNext()) { + NBTBase var7 = (NBTBase)var6.next(); +- if(!var7.getName().equals("x") && !var7.getName().equals("y") && !var7.getName().equals("z")) { ++ ++ if (!var7.getName().equals("x") && !var7.getName().equals("y") && !var7.getName().equals("z")) { + var5.setTag(var7.getName(), var7.copy()); + } + } +@@ -110,40 +131,44 @@ + var4.onInventoryChanged(); + } + } +- } else if(this.shouldDropItem && !this.isBreakingAnvil) { ++ } else if (this.shouldDropItem && !this.isBreakingAnvil) { + this.entityDropItem(new ItemStack(this.blockID, 1, Block.blocksList[this.blockID].damageDropped(this.metadata)), 0.0F); + } + } +- } else if(this.fallTime > 100 && !this.worldObj.isRemote && (var2 < 1 || var2 > 256) || this.fallTime > 600) { +- if(this.shouldDropItem) { ++ } else if (this.fallTime > 100 && !this.worldObj.isRemote && (var2 < 1 || var2 > 256) || this.fallTime > 600) { ++ if (this.shouldDropItem) { + this.entityDropItem(new ItemStack(this.blockID, 1, Block.blocksList[this.blockID].damageDropped(this.metadata)), 0.0F); + } + + this.setDead(); + } + } +- + } + } + +- protected void fall(float var1) { +- if(this.isAnvil) { +- int var2 = MathHelper.ceiling_float_int(var1 - 1.0F); +- if(var2 > 0) { ++ /** ++ * Called when the mob is falling. Calculates and applies fall damage. ++ */ ++ protected void fall(float par1) { ++ if (this.isAnvil) { ++ int var2 = MathHelper.ceiling_float_int(par1 - 1.0F); ++ ++ if (var2 > 0) { + ArrayList var3 = new ArrayList(this.worldObj.getEntitiesWithinAABBExcludingEntity(this, this.boundingBox)); + DamageSource var4 = this.blockID == Block.anvil.blockID ? DamageSource.anvil : DamageSource.fallingBlock; + Iterator var5 = var3.iterator(); + +- while(var5.hasNext()) { ++ while (var5.hasNext()) { + Entity var6 = (Entity)var5.next(); + var6.attackEntityFrom(var4, (float)Math.min(MathHelper.floor_float((float)var2 * this.fallHurtAmount), this.fallHurtMax)); + } + +- if(this.blockID == Block.anvil.blockID && (double)this.ab.nextFloat() < (double)0.05F + (double)var2 * 0.05D) { ++ if (this.blockID == Block.anvil.blockID && (double)this.rand.nextFloat() < 0.05000000074505806D + (double)var2 * 0.05D) { + int var7 = this.metadata >> 2; + int var8 = this.metadata & 3; + ++var7; +- if(var7 > 2) { ++ ++ if (var7 > 2) { + this.isBreakingAnvil = true; + } else { + this.metadata = var8 | var7 << 2; +@@ -151,53 +176,58 @@ + } + } + } +- + } + +- protected void writeEntityToNBT(NBTTagCompound var1) { +- var1.setByte("Tile", (byte)this.blockID); +- var1.setInteger("TileID", this.blockID); +- var1.setByte("Data", (byte)this.metadata); +- var1.setByte("Time", (byte)this.fallTime); +- var1.setBoolean("DropItem", this.shouldDropItem); +- var1.setBoolean("HurtEntities", this.isAnvil); +- var1.setFloat("FallHurtAmount", this.fallHurtAmount); +- var1.setInteger("FallHurtMax", this.fallHurtMax); +- if(this.fallingBlockTileEntityData != null) { +- var1.setCompoundTag("TileEntityData", this.fallingBlockTileEntityData); ++ /** ++ * (abstract) Protected helper method to write subclass entity data to NBT. ++ */ ++ protected void writeEntityToNBT(NBTTagCompound par1NBTTagCompound) { ++ par1NBTTagCompound.setByte("Tile", (byte)this.blockID); ++ par1NBTTagCompound.setInteger("TileID", this.blockID); ++ par1NBTTagCompound.setByte("Data", (byte)this.metadata); ++ par1NBTTagCompound.setByte("Time", (byte)this.fallTime); ++ par1NBTTagCompound.setBoolean("DropItem", this.shouldDropItem); ++ par1NBTTagCompound.setBoolean("HurtEntities", this.isAnvil); ++ par1NBTTagCompound.setFloat("FallHurtAmount", this.fallHurtAmount); ++ par1NBTTagCompound.setInteger("FallHurtMax", this.fallHurtMax); ++ ++ if (this.fallingBlockTileEntityData != null) { ++ par1NBTTagCompound.setCompoundTag("TileEntityData", this.fallingBlockTileEntityData); + } +- + } + +- protected void readEntityFromNBT(NBTTagCompound var1) { +- if(var1.hasKey("TileID")) { +- this.blockID = var1.getInteger("TileID"); ++ /** ++ * (abstract) Protected helper method to read subclass entity data from NBT. ++ */ ++ protected void readEntityFromNBT(NBTTagCompound par1NBTTagCompound) { ++ if (par1NBTTagCompound.hasKey("TileID")) { ++ this.blockID = par1NBTTagCompound.getInteger("TileID"); + } else { +- this.blockID = var1.getByte("Tile") & 255; ++ this.blockID = par1NBTTagCompound.getByte("Tile") & 255; + } + +- this.metadata = var1.getByte("Data") & 255; +- this.fallTime = var1.getByte("Time") & 255; +- if(var1.hasKey("HurtEntities")) { +- this.isAnvil = var1.getBoolean("HurtEntities"); +- this.fallHurtAmount = var1.getFloat("FallHurtAmount"); +- this.fallHurtMax = var1.getInteger("FallHurtMax"); +- } else if(this.blockID == Block.anvil.blockID) { ++ this.metadata = par1NBTTagCompound.getByte("Data") & 255; ++ this.fallTime = par1NBTTagCompound.getByte("Time") & 255; ++ ++ if (par1NBTTagCompound.hasKey("HurtEntities")) { ++ this.isAnvil = par1NBTTagCompound.getBoolean("HurtEntities"); ++ this.fallHurtAmount = par1NBTTagCompound.getFloat("FallHurtAmount"); ++ this.fallHurtMax = par1NBTTagCompound.getInteger("FallHurtMax"); ++ } else if (this.blockID == Block.anvil.blockID) { + this.isAnvil = true; + } + +- if(var1.hasKey("DropItem")) { +- this.shouldDropItem = var1.getBoolean("DropItem"); +- } +- +- if(var1.hasKey("TileEntityData")) { +- this.fallingBlockTileEntityData = var1.getCompoundTag("TileEntityData"); +- } +- +- if(this.blockID == 0) { ++ if (par1NBTTagCompound.hasKey("DropItem")) { ++ this.shouldDropItem = par1NBTTagCompound.getBoolean("DropItem"); ++ } ++ ++ if (par1NBTTagCompound.hasKey("TileEntityData")) { ++ this.fallingBlockTileEntityData = par1NBTTagCompound.getCompoundTag("TileEntityData"); ++ } ++ ++ if (this.blockID == 0) { + this.blockID = Block.sand.blockID; + } +- + } + + public float getShadowSize() { +@@ -208,17 +238,20 @@ + return this.worldObj; + } + +- public void setIsAnvil(boolean var1) { +- this.isAnvil = var1; ++ public void setIsAnvil(boolean par1) { ++ this.isAnvil = par1; + } + ++ /** ++ * Return whether this entity should be rendered as on fire. ++ */ + public boolean canRenderOnFire() { + return false; + } + +- public void addEntityCrashInfo(CrashReportCategory var1) { +- super.addEntityCrashInfo(var1); +- var1.addCrashSection("Immitating block ID", Integer.valueOf(this.blockID)); +- var1.addCrashSection("Immitating block data", Integer.valueOf(this.metadata)); ++ public void addEntityCrashInfo(CrashReportCategory par1CrashReportCategory) { ++ super.addEntityCrashInfo(par1CrashReportCategory); ++ par1CrashReportCategory.addCrashSection("Immitating block ID", Integer.valueOf(this.blockID)); ++ par1CrashReportCategory.addCrashSection("Immitating block data", Integer.valueOf(this.metadata)); + } + } diff --git a/patches/net/minecraft/src/EntityFireball.java.patch b/patches/net/minecraft/src/EntityFireball.java.patch new file mode 100644 index 0000000..4bc540b --- /dev/null +++ b/patches/net/minecraft/src/EntityFireball.java.patch @@ -0,0 +1,345 @@ +--- net/minecraft/src/EntityFireball.java ++++ net/minecraft/src/EntityFireball.java +@@ -14,58 +14,73 @@ + public double accelerationX; + public double accelerationY; + public double accelerationZ; ++ // Spout Start ++ public float yield = 1F; ++ public boolean incendiary = true; ++ // Spout End + +- public EntityFireball(World var1) { +- super(var1); ++ public EntityFireball(World par1World) { ++ super(par1World); + this.setSize(1.0F, 1.0F); + } + +- protected void entityInit() { +- } ++ protected void entityInit() {} + +- public boolean isInRangeToRenderDist(double var1) { ++ /** ++ * Checks if the entity is in range to render by using the past in distance and comparing it to its average edge length ++ * * 64 * renderDistanceWeight Args: distance ++ */ ++ public boolean isInRangeToRenderDist(double par1) { + double var3 = this.boundingBox.getAverageEdgeLength() * 4.0D; + var3 *= 64.0D; +- return var1 < var3 * var3; +- } +- +- public EntityFireball(World var1, double var2, double var4, double var6, double var8, double var10, double var12) { +- super(var1); +- this.setSize(1.0F, 1.0F); +- this.setLocationAndAngles(var2, var4, var6, this.rotationYaw, this.rotationPitch); +- this.setPosition(var2, var4, var6); +- double var14 = (double)MathHelper.sqrt_double(var8 * var8 + var10 * var10 + var12 * var12); +- this.accelerationX = var8 / var14 * 0.1D; +- this.accelerationY = var10 / var14 * 0.1D; +- this.accelerationZ = var12 / var14 * 0.1D; +- } +- +- public EntityFireball(World var1, EntityLivingBase var2, double var3, double var5, double var7) { +- super(var1); +- this.shootingEntity = var2; +- this.setSize(1.0F, 1.0F); +- this.setLocationAndAngles(var2.posX, var2.posY, var2.posZ, var2.rotationYaw, var2.rotationPitch); ++ return par1 < var3 * var3; ++ } ++ ++ public EntityFireball(World par1World, double par2, double par4, double par6, double par8, double par10, double par12) { ++ super(par1World); ++ this.setSize(1.0F, 1.0F); ++ this.setLocationAndAngles(par2, par4, par6, this.rotationYaw, this.rotationPitch); ++ this.setPosition(par2, par4, par6); ++ double var14 = (double)MathHelper.sqrt_double(par8 * par8 + par10 * par10 + par12 * par12); ++ this.accelerationX = par8 / var14 * 0.1D; ++ this.accelerationY = par10 / var14 * 0.1D; ++ this.accelerationZ = par12 / var14 * 0.1D; ++ } ++ ++ public EntityFireball(World par1World, EntityLivingBase par2EntityLivingBase, double par3, double par5, double par7) { ++ super(par1World); ++ this.shootingEntity = par2EntityLivingBase; ++ this.setSize(1.0F, 1.0F); ++ this.setLocationAndAngles(par2EntityLivingBase.posX, par2EntityLivingBase.posY, par2EntityLivingBase.posZ, par2EntityLivingBase.rotationYaw, par2EntityLivingBase.rotationPitch); + this.setPosition(this.posX, this.posY, this.posZ); + this.yOffset = 0.0F; + this.motionX = this.motionY = this.motionZ = 0.0D; +- var3 += this.ab.nextGaussian() * 0.4D; +- var5 += this.ab.nextGaussian() * 0.4D; +- var7 += this.ab.nextGaussian() * 0.4D; +- double var9 = (double)MathHelper.sqrt_double(var3 * var3 + var5 * var5 + var7 * var7); +- this.accelerationX = var3 / var9 * 0.1D; +- this.accelerationY = var5 / var9 * 0.1D; +- this.accelerationZ = var7 / var9 * 0.1D; ++ par3 += this.rand.nextGaussian() * 0.4D; ++ par5 += this.rand.nextGaussian() * 0.4D; ++ par7 += this.rand.nextGaussian() * 0.4D; ++ double var9 = (double)MathHelper.sqrt_double(par3 * par3 + par5 * par5 + par7 * par7); ++ this.accelerationX = par3 / var9 * 0.1D; ++ this.accelerationY = par5 / var9 * 0.1D; ++ this.accelerationZ = par7 / var9 * 0.1D; + } + ++ /** ++ * Called to update the entity's position/logic. ++ */ + public void onUpdate() { +- if(this.worldObj.isRemote || (this.shootingEntity == null || !this.shootingEntity.isDead) && this.worldObj.blockExists((int)this.posX, (int)this.posY, (int)this.posZ)) { ++ if (!this.worldObj.isRemote && (this.shootingEntity != null && this.shootingEntity.isDead || !this.worldObj.blockExists((int)this.posX, (int)this.posY, (int)this.posZ))) { ++ this.setDead(); ++ } else { + super.onUpdate(); + this.setFire(1); +- if(this.inGround) { ++ ++ if (this.inGround) { + int var1 = this.worldObj.getBlockId(this.xTile, this.yTile, this.zTile); +- if(var1 == this.inTile) { ++ ++ if (var1 == this.inTile) { + ++this.ticksAlive; +- if(this.ticksAlive == 600) { ++ ++ if (this.ticksAlive == 600) { + this.setDead(); + } + +@@ -73,9 +88,9 @@ + } + + this.inGround = false; +- this.motionX *= (double)(this.ab.nextFloat() * 0.2F); +- this.motionY *= (double)(this.ab.nextFloat() * 0.2F); +- this.motionZ *= (double)(this.ab.nextFloat() * 0.2F); ++ this.motionX *= (double)(this.rand.nextFloat() * 0.2F); ++ this.motionY *= (double)(this.rand.nextFloat() * 0.2F); ++ this.motionZ *= (double)(this.rand.nextFloat() * 0.2F); + this.ticksAlive = 0; + this.ticksInAir = 0; + } else { +@@ -84,10 +99,11 @@ + + Vec3 var15 = this.worldObj.getWorldVec3Pool().getVecFromPool(this.posX, this.posY, this.posZ); + Vec3 var2 = this.worldObj.getWorldVec3Pool().getVecFromPool(this.posX + this.motionX, this.posY + this.motionY, this.posZ + this.motionZ); +- MovingObjectPosition var3 = this.worldObj.rayTraceBlocks(var15, var2); ++ MovingObjectPosition var3 = this.worldObj.clip(var15, var2); + var15 = this.worldObj.getWorldVec3Pool().getVecFromPool(this.posX, this.posY, this.posZ); + var2 = this.worldObj.getWorldVec3Pool().getVecFromPool(this.posX + this.motionX, this.posY + this.motionY, this.posZ + this.motionZ); +- if(var3 != null) { ++ ++ if (var3 != null) { + var2 = this.worldObj.getWorldVec3Pool().getVecFromPool(var3.hitVec.xCoord, var3.hitVec.yCoord, var3.hitVec.zCoord); + } + +@@ -95,15 +111,18 @@ + List var5 = this.worldObj.getEntitiesWithinAABBExcludingEntity(this, this.boundingBox.addCoord(this.motionX, this.motionY, this.motionZ).expand(1.0D, 1.0D, 1.0D)); + double var6 = 0.0D; + +- for(int var8 = 0; var8 < var5.size(); ++var8) { ++ for (int var8 = 0; var8 < var5.size(); ++var8) { + Entity var9 = (Entity)var5.get(var8); +- if(var9.canBeCollidedWith() && (!var9.isEntityEqual(this.shootingEntity) || this.ticksInAir >= 25)) { ++ ++ if (var9.canBeCollidedWith() && (!var9.isEntityEqual(this.shootingEntity) || this.ticksInAir >= 25)) { + float var10 = 0.3F; + AxisAlignedBB var11 = var9.boundingBox.expand((double)var10, (double)var10, (double)var10); + MovingObjectPosition var12 = var11.calculateIntercept(var15, var2); +- if(var12 != null) { ++ ++ if (var12 != null) { + double var13 = var15.distanceTo(var12.hitVec); +- if(var13 < var6 || var6 == 0.0D) { ++ ++ if (var13 < var6 || var6 == 0.0D) { + var4 = var9; + var6 = var13; + } +@@ -111,11 +130,11 @@ + } + } + +- if(var4 != null) { ++ if (var4 != null) { + var3 = new MovingObjectPosition(var4); + } + +- if(var3 != null) { ++ if (var3 != null) { + this.onImpact(var3); + } + +@@ -123,30 +142,32 @@ + this.posY += this.motionY; + this.posZ += this.motionZ; + float var16 = MathHelper.sqrt_double(this.motionX * this.motionX + this.motionZ * this.motionZ); +- this.rotationYaw = (float)(Math.atan2(this.motionZ, this.motionX) * 180.0D / (double)((float)Math.PI)) + 90.0F; ++ this.rotationYaw = (float)(Math.atan2(this.motionZ, this.motionX) * 180.0D / Math.PI) + 90.0F; + +- for(this.rotationPitch = (float)(Math.atan2((double)var16, this.motionY) * 180.0D / (double)((float)Math.PI)) - 90.0F; this.rotationPitch - this.prevRotationPitch < -180.0F; this.prevRotationPitch -= 360.0F) { ++ for (this.rotationPitch = (float)(Math.atan2((double)var16, this.motionY) * 180.0D / Math.PI) - 90.0F; this.rotationPitch - this.prevRotationPitch < -180.0F; this.prevRotationPitch -= 360.0F) { ++ ; + } + +- while(this.rotationPitch - this.prevRotationPitch >= 180.0F) { ++ while (this.rotationPitch - this.prevRotationPitch >= 180.0F) { + this.prevRotationPitch += 360.0F; + } + +- while(this.rotationYaw - this.prevRotationYaw < -180.0F) { ++ while (this.rotationYaw - this.prevRotationYaw < -180.0F) { + this.prevRotationYaw -= 360.0F; + } + +- while(this.rotationYaw - this.prevRotationYaw >= 180.0F) { ++ while (this.rotationYaw - this.prevRotationYaw >= 180.0F) { + this.prevRotationYaw += 360.0F; + } + + this.rotationPitch = this.prevRotationPitch + (this.rotationPitch - this.prevRotationPitch) * 0.2F; + this.rotationYaw = this.prevRotationYaw + (this.rotationYaw - this.prevRotationYaw) * 0.2F; + float var17 = this.getMotionFactor(); +- if(this.isInWater()) { +- for(int var18 = 0; var18 < 4; ++var18) { +- float var19 = 0.25F; +- this.worldObj.spawnParticle("bubble", this.posX - this.motionX * (double)var19, this.posY - this.motionY * (double)var19, this.posZ - this.motionZ * (double)var19, this.motionX, this.motionY, this.motionZ); ++ ++ if (this.isInWater()) { ++ for (int var19 = 0; var19 < 4; ++var19) { ++ float var18 = 0.25F; ++ this.worldObj.spawnParticle("bubble", this.posX - this.motionX * (double)var18, this.posY - this.motionY * (double)var18, this.posZ - this.motionZ * (double)var18, this.motionX, this.motionY, this.motionZ); + } + + var17 = 0.8F; +@@ -160,43 +181,56 @@ + this.motionZ *= (double)var17; + this.worldObj.spawnParticle("smoke", this.posX, this.posY + 0.5D, this.posZ, 0.0D, 0.0D, 0.0D); + this.setPosition(this.posX, this.posY, this.posZ); +- } else { +- this.setDead(); + } + } + ++ /** ++ * Return the motion factor for this projectile. The factor is multiplied by the original motion. ++ */ + protected float getMotionFactor() { + return 0.95F; + } + ++ /** ++ * Called when this EntityFireball hits a block or entity. ++ */ + protected abstract void onImpact(MovingObjectPosition var1); + +- public void writeEntityToNBT(NBTTagCompound var1) { +- var1.setShort("xTile", (short)this.xTile); +- var1.setShort("yTile", (short)this.yTile); +- var1.setShort("zTile", (short)this.zTile); +- var1.setByte("inTile", (byte)this.inTile); +- var1.setByte("inGround", (byte)(this.inGround ? 1 : 0)); +- var1.setTag("direction", this.newDoubleNBTList(new double[]{this.motionX, this.motionY, this.motionZ})); ++ /** ++ * (abstract) Protected helper method to write subclass entity data to NBT. ++ */ ++ public void writeEntityToNBT(NBTTagCompound par1NBTTagCompound) { ++ par1NBTTagCompound.setShort("xTile", (short)this.xTile); ++ par1NBTTagCompound.setShort("yTile", (short)this.yTile); ++ par1NBTTagCompound.setShort("zTile", (short)this.zTile); ++ par1NBTTagCompound.setByte("inTile", (byte)this.inTile); ++ par1NBTTagCompound.setByte("inGround", (byte)(this.inGround ? 1 : 0)); ++ par1NBTTagCompound.setTag("direction", this.newDoubleNBTList(new double[] {this.motionX, this.motionY, this.motionZ})); + } + +- public void readEntityFromNBT(NBTTagCompound var1) { +- this.xTile = var1.getShort("xTile"); +- this.yTile = var1.getShort("yTile"); +- this.zTile = var1.getShort("zTile"); +- this.inTile = var1.getByte("inTile") & 255; +- this.inGround = var1.getByte("inGround") == 1; +- if(var1.hasKey("direction")) { +- NBTTagList var2 = var1.getTagList("direction"); ++ /** ++ * (abstract) Protected helper method to read subclass entity data from NBT. ++ */ ++ public void readEntityFromNBT(NBTTagCompound par1NBTTagCompound) { ++ this.xTile = par1NBTTagCompound.getShort("xTile"); ++ this.yTile = par1NBTTagCompound.getShort("yTile"); ++ this.zTile = par1NBTTagCompound.getShort("zTile"); ++ this.inTile = par1NBTTagCompound.getByte("inTile") & 255; ++ this.inGround = par1NBTTagCompound.getByte("inGround") == 1; ++ ++ if (par1NBTTagCompound.hasKey("direction")) { ++ NBTTagList var2 = par1NBTTagCompound.getTagList("direction"); + this.motionX = ((NBTTagDouble)var2.tagAt(0)).data; + this.motionY = ((NBTTagDouble)var2.tagAt(1)).data; + this.motionZ = ((NBTTagDouble)var2.tagAt(2)).data; + } else { + this.setDead(); + } +- + } + ++ /** ++ * Returns true if other Entities should be prevented from moving through this Entity. ++ */ + public boolean canBeCollidedWith() { + return true; + } +@@ -205,14 +239,19 @@ + return 1.0F; + } + +- public boolean attackEntityFrom(DamageSource var1, float var2) { +- if(this.isEntityInvulnerable()) { ++ /** ++ * Called when the entity is attacked. ++ */ ++ public boolean attackEntityFrom(DamageSource par1DamageSource, float par2) { ++ if (this.isEntityInvulnerable()) { + return false; + } else { + this.setBeenAttacked(); +- if(var1.getEntity() != null) { +- Vec3 var3 = var1.getEntity().getLookVec(); +- if(var3 != null) { ++ ++ if (par1DamageSource.getEntity() != null) { ++ Vec3 var3 = par1DamageSource.getEntity().getLookVec(); ++ ++ if (var3 != null) { + this.motionX = var3.xCoord; + this.motionY = var3.yCoord; + this.motionZ = var3.zCoord; +@@ -221,8 +260,8 @@ + this.accelerationZ = this.motionZ * 0.1D; + } + +- if(var1.getEntity() instanceof EntityLivingBase) { +- this.shootingEntity = (EntityLivingBase)var1.getEntity(); ++ if (par1DamageSource.getEntity() instanceof EntityLivingBase) { ++ this.shootingEntity = (EntityLivingBase)par1DamageSource.getEntity(); + } + + return true; +@@ -236,11 +275,14 @@ + return 0.0F; + } + +- public float getBrightness(float var1) { ++ /** ++ * Gets how bright this entity is. ++ */ ++ public float getBrightness(float par1) { + return 1.0F; + } + +- public int getBrightnessForRender(float var1) { ++ public int getBrightnessForRender(float par1) { + return 15728880; + } + } diff --git a/patches/net/minecraft/src/EntityFireworkOverlayFX.java.patch b/patches/net/minecraft/src/EntityFireworkOverlayFX.java.patch new file mode 100644 index 0000000..5388c2c --- /dev/null +++ b/patches/net/minecraft/src/EntityFireworkOverlayFX.java.patch @@ -0,0 +1,42 @@ +--- net/minecraft/src/EntityFireworkOverlayFX.java ++++ net/minecraft/src/EntityFireworkOverlayFX.java +@@ -1,25 +1,25 @@ + package net.minecraft.src; + + public class EntityFireworkOverlayFX extends EntityFX { +- protected EntityFireworkOverlayFX(World var1, double var2, double var4, double var6) { +- super(var1, var2, var4, var6); ++ protected EntityFireworkOverlayFX(World par1World, double par2, double par4, double par6) { ++ super(par1World, par2, par4, par6); + this.particleMaxAge = 4; + } + +- public void renderParticle(Tessellator var1, float var2, float var3, float var4, float var5, float var6, float var7) { ++ public void renderParticle(Tessellator par1Tessellator, float par2, float par3, float par4, float par5, float par6, float par7) { + float var8 = 0.25F; + float var9 = var8 + 0.25F; +- float var10 = 2.0F / 16.0F; ++ float var10 = 0.125F; + float var11 = var10 + 0.25F; +- float var12 = 7.1F * MathHelper.sin(((float)this.particleAge + var2 - 1.0F) * 0.25F * (float)Math.PI); +- this.particleAlpha = 0.6F - ((float)this.particleAge + var2 - 1.0F) * 0.25F * 0.5F; +- float var13 = (float)(this.prevPosX + (this.posX - this.prevPosX) * (double)var2 - interpPosX); +- float var14 = (float)(this.prevPosY + (this.posY - this.prevPosY) * (double)var2 - interpPosY); +- float var15 = (float)(this.prevPosZ + (this.posZ - this.prevPosZ) * (double)var2 - interpPosZ); +- var1.setColorRGBA_F(this.particleRed, this.particleGreen, this.particleBlue, this.particleAlpha); +- var1.addVertexWithUV((double)(var13 - var3 * var12 - var6 * var12), (double)(var14 - var4 * var12), (double)(var15 - var5 * var12 - var7 * var12), (double)var9, (double)var11); +- var1.addVertexWithUV((double)(var13 - var3 * var12 + var6 * var12), (double)(var14 + var4 * var12), (double)(var15 - var5 * var12 + var7 * var12), (double)var9, (double)var10); +- var1.addVertexWithUV((double)(var13 + var3 * var12 + var6 * var12), (double)(var14 + var4 * var12), (double)(var15 + var5 * var12 + var7 * var12), (double)var8, (double)var10); +- var1.addVertexWithUV((double)(var13 + var3 * var12 - var6 * var12), (double)(var14 - var4 * var12), (double)(var15 + var5 * var12 - var7 * var12), (double)var8, (double)var11); ++ float var12 = 7.1F * MathHelper.sin(((float)this.particleAge + par2 - 1.0F) * 0.25F * (float)Math.PI); ++ this.particleAlpha = 0.6F - ((float)this.particleAge + par2 - 1.0F) * 0.25F * 0.5F; ++ float var13 = (float)(this.prevPosX + (this.posX - this.prevPosX) * (double)par2 - interpPosX); ++ float var14 = (float)(this.prevPosY + (this.posY - this.prevPosY) * (double)par2 - interpPosY); ++ float var15 = (float)(this.prevPosZ + (this.posZ - this.prevPosZ) * (double)par2 - interpPosZ); ++ par1Tessellator.setColorRGBA_F(this.particleRed, this.particleGreen, this.particleBlue, this.particleAlpha); ++ par1Tessellator.addVertexWithUV((double)(var13 - par3 * var12 - par6 * var12), (double)(var14 - par4 * var12), (double)(var15 - par5 * var12 - par7 * var12), (double)var9, (double)var11); ++ par1Tessellator.addVertexWithUV((double)(var13 - par3 * var12 + par6 * var12), (double)(var14 + par4 * var12), (double)(var15 - par5 * var12 + par7 * var12), (double)var9, (double)var10); ++ par1Tessellator.addVertexWithUV((double)(var13 + par3 * var12 + par6 * var12), (double)(var14 + par4 * var12), (double)(var15 + par5 * var12 + par7 * var12), (double)var8, (double)var10); ++ par1Tessellator.addVertexWithUV((double)(var13 + par3 * var12 - par6 * var12), (double)(var14 - par4 * var12), (double)(var15 + par5 * var12 - par7 * var12), (double)var8, (double)var11); + } + } diff --git a/patches/net/minecraft/src/EntityFireworkRocket.java.patch b/patches/net/minecraft/src/EntityFireworkRocket.java.patch new file mode 100644 index 0000000..b3106b8 --- /dev/null +++ b/patches/net/minecraft/src/EntityFireworkRocket.java.patch @@ -0,0 +1,244 @@ +--- net/minecraft/src/EntityFireworkRocket.java ++++ net/minecraft/src/EntityFireworkRocket.java +@@ -1,11 +1,17 @@ + package net.minecraft.src; + + public class EntityFireworkRocket extends Entity { ++ ++ /** The age of the firework in ticks. */ + private int fireworkAge; ++ ++ /** ++ * The lifetime of the firework in ticks. When the age reaches the lifetime the firework explodes. ++ */ + private int lifetime; + +- public EntityFireworkRocket(World var1) { +- super(var1); ++ public EntityFireworkRocket(World par1World) { ++ super(par1World); + this.setSize(0.25F, 0.25F); + } + +@@ -13,44 +19,56 @@ + this.dataWatcher.addObjectByDataType(8, 5); + } + +- public boolean isInRangeToRenderDist(double var1) { +- return var1 < 4096.0D; ++ /** ++ * Checks if the entity is in range to render by using the past in distance and comparing it to its average edge length ++ * * 64 * renderDistanceWeight Args: distance ++ */ ++ public boolean isInRangeToRenderDist(double par1) { ++ return par1 < 4096.0D; + } + +- public EntityFireworkRocket(World var1, double var2, double var4, double var6, ItemStack var8) { +- super(var1); ++ public EntityFireworkRocket(World par1World, double par2, double par4, double par6, ItemStack par8ItemStack) { ++ super(par1World); + this.fireworkAge = 0; + this.setSize(0.25F, 0.25F); +- this.setPosition(var2, var4, var6); ++ this.setPosition(par2, par4, par6); + this.yOffset = 0.0F; + int var9 = 1; +- if(var8 != null && var8.hasTagCompound()) { +- this.dataWatcher.updateObject(8, var8); +- NBTTagCompound var10 = var8.getTagCompound(); ++ ++ if (par8ItemStack != null && par8ItemStack.hasTagCompound()) { ++ this.dataWatcher.updateObject(8, par8ItemStack); ++ NBTTagCompound var10 = par8ItemStack.getTagCompound(); + NBTTagCompound var11 = var10.getCompoundTag("Fireworks"); +- if(var11 != null) { ++ ++ if (var11 != null) { + var9 += var11.getByte("Flight"); + } + } + +- this.motionX = this.ab.nextGaussian() * 0.001D; +- this.motionZ = this.ab.nextGaussian() * 0.001D; ++ this.motionX = this.rand.nextGaussian() * 0.001D; ++ this.motionZ = this.rand.nextGaussian() * 0.001D; + this.motionY = 0.05D; +- this.lifetime = 10 * var9 + this.ab.nextInt(6) + this.ab.nextInt(7); ++ this.lifetime = 10 * var9 + this.rand.nextInt(6) + this.rand.nextInt(7); + } + +- public void setVelocity(double var1, double var3, double var5) { +- this.motionX = var1; +- this.motionY = var3; +- this.motionZ = var5; +- if(this.prevRotationPitch == 0.0F && this.prevRotationYaw == 0.0F) { +- float var7 = MathHelper.sqrt_double(var1 * var1 + var5 * var5); +- this.prevRotationYaw = this.rotationYaw = (float)(Math.atan2(var1, var5) * 180.0D / (double)((float)Math.PI)); +- this.prevRotationPitch = this.rotationPitch = (float)(Math.atan2(var3, (double)var7) * 180.0D / (double)((float)Math.PI)); ++ /** ++ * Sets the velocity to the args. Args: x, y, z ++ */ ++ public void setVelocity(double par1, double par3, double par5) { ++ this.motionX = par1; ++ this.motionY = par3; ++ this.motionZ = par5; ++ ++ if (this.prevRotationPitch == 0.0F && this.prevRotationYaw == 0.0F) { ++ float var7 = MathHelper.sqrt_double(par1 * par1 + par5 * par5); ++ this.prevRotationYaw = this.rotationYaw = (float)(Math.atan2(par1, par5) * 180.0D / Math.PI); ++ this.prevRotationPitch = this.rotationPitch = (float)(Math.atan2(par3, (double)var7) * 180.0D / Math.PI); + } +- + } + ++ /** ++ * Called to update the entity's position/logic. ++ */ + public void onUpdate() { + this.lastTickPosX = this.posX; + this.lastTickPosY = this.posY; +@@ -61,92 +79,108 @@ + this.motionY += 0.04D; + this.moveEntity(this.motionX, this.motionY, this.motionZ); + float var1 = MathHelper.sqrt_double(this.motionX * this.motionX + this.motionZ * this.motionZ); +- this.rotationYaw = (float)(Math.atan2(this.motionX, this.motionZ) * 180.0D / (double)((float)Math.PI)); ++ this.rotationYaw = (float)(Math.atan2(this.motionX, this.motionZ) * 180.0D / Math.PI); + +- for(this.rotationPitch = (float)(Math.atan2(this.motionY, (double)var1) * 180.0D / (double)((float)Math.PI)); this.rotationPitch - this.prevRotationPitch < -180.0F; this.prevRotationPitch -= 360.0F) { ++ for (this.rotationPitch = (float)(Math.atan2(this.motionY, (double)var1) * 180.0D / Math.PI); this.rotationPitch - this.prevRotationPitch < -180.0F; this.prevRotationPitch -= 360.0F) { ++ ; + } + +- while(this.rotationPitch - this.prevRotationPitch >= 180.0F) { ++ while (this.rotationPitch - this.prevRotationPitch >= 180.0F) { + this.prevRotationPitch += 360.0F; + } + +- while(this.rotationYaw - this.prevRotationYaw < -180.0F) { ++ while (this.rotationYaw - this.prevRotationYaw < -180.0F) { + this.prevRotationYaw -= 360.0F; + } + +- while(this.rotationYaw - this.prevRotationYaw >= 180.0F) { ++ while (this.rotationYaw - this.prevRotationYaw >= 180.0F) { + this.prevRotationYaw += 360.0F; + } + + this.rotationPitch = this.prevRotationPitch + (this.rotationPitch - this.prevRotationPitch) * 0.2F; + this.rotationYaw = this.prevRotationYaw + (this.rotationYaw - this.prevRotationYaw) * 0.2F; +- if(this.fireworkAge == 0) { ++ ++ if (this.fireworkAge == 0) { + this.worldObj.playSoundAtEntity(this, "fireworks.launch", 3.0F, 1.0F); + } + + ++this.fireworkAge; +- if(this.worldObj.isRemote && this.fireworkAge % 2 < 2) { +- this.worldObj.spawnParticle("fireworksSpark", this.posX, this.posY - 0.3D, this.posZ, this.ab.nextGaussian() * 0.05D, -this.motionY * 0.5D, this.ab.nextGaussian() * 0.05D); ++ ++ if (this.worldObj.isRemote && this.fireworkAge % 2 < 2) { ++ this.worldObj.spawnParticle("fireworksSpark", this.posX, this.posY - 0.3D, this.posZ, this.rand.nextGaussian() * 0.05D, -this.motionY * 0.5D, this.rand.nextGaussian() * 0.05D); + } + +- if(!this.worldObj.isRemote && this.fireworkAge > this.lifetime) { ++ if (!this.worldObj.isRemote && this.fireworkAge > this.lifetime) { + this.worldObj.setEntityState(this, (byte)17); + this.setDead(); + } +- + } + +- public void handleHealthUpdate(byte var1) { +- if(var1 == 17 && this.worldObj.isRemote) { ++ public void handleHealthUpdate(byte par1) { ++ if (par1 == 17 && this.worldObj.isRemote) { + ItemStack var2 = this.dataWatcher.getWatchableObjectItemStack(8); + NBTTagCompound var3 = null; +- if(var2 != null && var2.hasTagCompound()) { ++ ++ if (var2 != null && var2.hasTagCompound()) { + var3 = var2.getTagCompound().getCompoundTag("Fireworks"); + } + + this.worldObj.func_92088_a(this.posX, this.posY, this.posZ, this.motionX, this.motionY, this.motionZ, var3); + } + +- super.handleHealthUpdate(var1); ++ super.handleHealthUpdate(par1); + } + +- public void writeEntityToNBT(NBTTagCompound var1) { +- var1.setInteger("Life", this.fireworkAge); +- var1.setInteger("LifeTime", this.lifetime); ++ /** ++ * (abstract) Protected helper method to write subclass entity data to NBT. ++ */ ++ public void writeEntityToNBT(NBTTagCompound par1NBTTagCompound) { ++ par1NBTTagCompound.setInteger("Life", this.fireworkAge); ++ par1NBTTagCompound.setInteger("LifeTime", this.lifetime); + ItemStack var2 = this.dataWatcher.getWatchableObjectItemStack(8); +- if(var2 != null) { ++ ++ if (var2 != null) { + NBTTagCompound var3 = new NBTTagCompound(); + var2.writeToNBT(var3); +- var1.setCompoundTag("FireworksItem", var3); ++ par1NBTTagCompound.setCompoundTag("FireworksItem", var3); + } +- + } + +- public void readEntityFromNBT(NBTTagCompound var1) { +- this.fireworkAge = var1.getInteger("Life"); +- this.lifetime = var1.getInteger("LifeTime"); +- NBTTagCompound var2 = var1.getCompoundTag("FireworksItem"); +- if(var2 != null) { ++ /** ++ * (abstract) Protected helper method to read subclass entity data from NBT. ++ */ ++ public void readEntityFromNBT(NBTTagCompound par1NBTTagCompound) { ++ this.fireworkAge = par1NBTTagCompound.getInteger("Life"); ++ this.lifetime = par1NBTTagCompound.getInteger("LifeTime"); ++ NBTTagCompound var2 = par1NBTTagCompound.getCompoundTag("FireworksItem"); ++ ++ if (var2 != null) { + ItemStack var3 = ItemStack.loadItemStackFromNBT(var2); +- if(var3 != null) { ++ ++ if (var3 != null) { + this.dataWatcher.updateObject(8, var3); + } + } +- + } + + public float getShadowSize() { + return 0.0F; + } + +- public float getBrightness(float var1) { +- return super.getBrightness(var1); +- } +- +- public int getBrightnessForRender(float var1) { +- return super.getBrightnessForRender(var1); +- } +- ++ /** ++ * Gets how bright this entity is. ++ */ ++ public float getBrightness(float par1) { ++ return super.getBrightness(par1); ++ } ++ ++ public int getBrightnessForRender(float par1) { ++ return super.getBrightnessForRender(par1); ++ } ++ ++ /** ++ * If returns false, the item will not inflict any damage against entities. ++ */ + public boolean canAttackWithItem() { + return false; + } diff --git a/patches/net/minecraft/src/EntityFireworkSparkFX.java.patch b/patches/net/minecraft/src/EntityFireworkSparkFX.java.patch new file mode 100644 index 0000000..58f2ac0 --- /dev/null +++ b/patches/net/minecraft/src/EntityFireworkSparkFX.java.patch @@ -0,0 +1,160 @@ +--- net/minecraft/src/EntityFireworkSparkFX.java ++++ net/minecraft/src/EntityFireworkSparkFX.java +@@ -10,66 +10,76 @@ + private float fadeColourBlue; + private boolean hasFadeColour; + +- public EntityFireworkSparkFX(World var1, double var2, double var4, double var6, double var8, double var10, double var12, EffectRenderer var14) { +- super(var1, var2, var4, var6); +- this.motionX = var8; +- this.motionY = var10; +- this.motionZ = var12; +- this.field_92047_az = var14; +- this.particleScale *= 12.0F / 16.0F; +- this.particleMaxAge = 48 + this.ab.nextInt(12); ++ public EntityFireworkSparkFX(World par1World, double par2, double par4, double par6, double par8, double par10, double par12, EffectRenderer par14EffectRenderer) { ++ super(par1World, par2, par4, par6); ++ this.motionX = par8; ++ this.motionY = par10; ++ this.motionZ = par12; ++ this.field_92047_az = par14EffectRenderer; ++ this.particleScale *= 0.75F; ++ this.particleMaxAge = 48 + this.rand.nextInt(12); + this.noClip = false; + } + +- public void setTrail(boolean var1) { +- this.field_92054_ax = var1; +- } +- +- public void setTwinkle(boolean var1) { +- this.field_92048_ay = var1; +- } +- +- public void setColour(int var1) { +- float var2 = (float)((var1 & 16711680) >> 16) / 255.0F; +- float var3 = (float)((var1 & '\uff00') >> 8) / 255.0F; +- float var4 = (float)((var1 & 255) >> 0) / 255.0F; ++ public void setTrail(boolean par1) { ++ this.field_92054_ax = par1; ++ } ++ ++ public void setTwinkle(boolean par1) { ++ this.field_92048_ay = par1; ++ } ++ ++ public void setColour(int par1) { ++ float var2 = (float)((par1 & 16711680) >> 16) / 255.0F; ++ float var3 = (float)((par1 & 65280) >> 8) / 255.0F; ++ float var4 = (float)((par1 & 255) >> 0) / 255.0F; + float var5 = 1.0F; + this.setRBGColorF(var2 * var5, var3 * var5, var4 * var5); + } + +- public void setFadeColour(int var1) { +- this.fadeColourRed = (float)((var1 & 16711680) >> 16) / 255.0F; +- this.fadeColourGreen = (float)((var1 & '\uff00') >> 8) / 255.0F; +- this.fadeColourBlue = (float)((var1 & 255) >> 0) / 255.0F; ++ public void setFadeColour(int par1) { ++ this.fadeColourRed = (float)((par1 & 16711680) >> 16) / 255.0F; ++ this.fadeColourGreen = (float)((par1 & 65280) >> 8) / 255.0F; ++ this.fadeColourBlue = (float)((par1 & 255) >> 0) / 255.0F; + this.hasFadeColour = true; + } + ++ /** ++ * returns the bounding box for this entity ++ */ + public AxisAlignedBB getBoundingBox() { + return null; + } + ++ /** ++ * Returns true if this entity should push and be pushed by other entities when colliding. ++ */ + public boolean canBePushed() { + return false; + } + +- public void renderParticle(Tessellator var1, float var2, float var3, float var4, float var5, float var6, float var7) { +- if(!this.field_92048_ay || this.particleAge < this.particleMaxAge / 3 || (this.particleAge + this.particleMaxAge) / 3 % 2 == 0) { +- super.renderParticle(var1, var2, var3, var4, var5, var6, var7); ++ public void renderParticle(Tessellator par1Tessellator, float par2, float par3, float par4, float par5, float par6, float par7) { ++ if (!this.field_92048_ay || this.particleAge < this.particleMaxAge / 3 || (this.particleAge + this.particleMaxAge) / 3 % 2 == 0) { ++ super.renderParticle(par1Tessellator, par2, par3, par4, par5, par6, par7); + } +- + } + ++ /** ++ * Called to update the entity's position/logic. ++ */ + public void onUpdate() { + this.prevPosX = this.posX; + this.prevPosY = this.posY; + this.prevPosZ = this.posZ; +- if(this.particleAge++ >= this.particleMaxAge) { ++ ++ if (this.particleAge++ >= this.particleMaxAge) { + this.setDead(); + } + +- if(this.particleAge > this.particleMaxAge / 2) { ++ if (this.particleAge > this.particleMaxAge / 2) { + this.setAlphaF(1.0F - ((float)this.particleAge - (float)(this.particleMaxAge / 2)) / (float)this.particleMaxAge); +- if(this.hasFadeColour) { ++ ++ if (this.hasFadeColour) { + this.particleRed += (this.fadeColourRed - this.particleRed) * 0.2F; + this.particleGreen += (this.fadeColourGreen - this.particleGreen) * 0.2F; + this.particleBlue += (this.fadeColourBlue - this.particleBlue) * 0.2F; +@@ -79,19 +89,21 @@ + this.setParticleTextureIndex(this.baseTextureIndex + (7 - this.particleAge * 8 / this.particleMaxAge)); + this.motionY -= 0.004D; + this.moveEntity(this.motionX, this.motionY, this.motionZ); +- this.motionX *= (double)0.91F; +- this.motionY *= (double)0.91F; +- this.motionZ *= (double)0.91F; +- if(this.onGround) { +- this.motionX *= (double)0.7F; +- this.motionZ *= (double)0.7F; ++ this.motionX *= 0.9100000262260437D; ++ this.motionY *= 0.9100000262260437D; ++ this.motionZ *= 0.9100000262260437D; ++ ++ if (this.onGround) { ++ this.motionX *= 0.699999988079071D; ++ this.motionZ *= 0.699999988079071D; + } + +- if(this.field_92054_ax && this.particleAge < this.particleMaxAge / 2 && (this.particleAge + this.particleMaxAge) % 2 == 0) { ++ if (this.field_92054_ax && this.particleAge < this.particleMaxAge / 2 && (this.particleAge + this.particleMaxAge) % 2 == 0) { + EntityFireworkSparkFX var1 = new EntityFireworkSparkFX(this.worldObj, this.posX, this.posY, this.posZ, 0.0D, 0.0D, 0.0D, this.field_92047_az); + var1.setRBGColorF(this.particleRed, this.particleGreen, this.particleBlue); + var1.particleAge = var1.particleMaxAge / 2; +- if(this.hasFadeColour) { ++ ++ if (this.hasFadeColour) { + var1.hasFadeColour = true; + var1.fadeColourRed = this.fadeColourRed; + var1.fadeColourGreen = this.fadeColourGreen; +@@ -101,14 +113,16 @@ + var1.field_92048_ay = this.field_92048_ay; + this.field_92047_az.addEffect(var1); + } +- + } + +- public int getBrightnessForRender(float var1) { ++ public int getBrightnessForRender(float par1) { + return 15728880; + } + +- public float getBrightness(float var1) { ++ /** ++ * Gets how bright this entity is. ++ */ ++ public float getBrightness(float par1) { + return 1.0F; + } + } diff --git a/patches/net/minecraft/src/EntityFireworkStarterFX.java.patch b/patches/net/minecraft/src/EntityFireworkStarterFX.java.patch new file mode 100644 index 0000000..ac32583 --- /dev/null +++ b/patches/net/minecraft/src/EntityFireworkStarterFX.java.patch @@ -0,0 +1,288 @@ +--- net/minecraft/src/EntityFireworkStarterFX.java ++++ net/minecraft/src/EntityFireworkStarterFX.java +@@ -6,23 +6,26 @@ + private NBTTagList fireworkExplosions; + boolean twinkle; + +- public EntityFireworkStarterFX(World var1, double var2, double var4, double var6, double var8, double var10, double var12, EffectRenderer var14, NBTTagCompound var15) { +- super(var1, var2, var4, var6, 0.0D, 0.0D, 0.0D); +- this.motionX = var8; +- this.motionY = var10; +- this.motionZ = var12; +- this.theEffectRenderer = var14; ++ public EntityFireworkStarterFX(World par1World, double par2, double par4, double par6, double par8, double par10, double par12, EffectRenderer par14EffectRenderer, NBTTagCompound par15NBTTagCompound) { ++ super(par1World, par2, par4, par6, 0.0D, 0.0D, 0.0D); ++ this.motionX = par8; ++ this.motionY = par10; ++ this.motionZ = par12; ++ this.theEffectRenderer = par14EffectRenderer; + this.particleMaxAge = 8; +- if(var15 != null) { +- this.fireworkExplosions = var15.getTagList("Explosions"); +- if(this.fireworkExplosions.tagCount() == 0) { ++ ++ if (par15NBTTagCompound != null) { ++ this.fireworkExplosions = par15NBTTagCompound.getTagList("Explosions"); ++ ++ if (this.fireworkExplosions.tagCount() == 0) { + this.fireworkExplosions = null; + } else { + this.particleMaxAge = this.fireworkExplosions.tagCount() * 2 - 1; + +- for(int var16 = 0; var16 < this.fireworkExplosions.tagCount(); ++var16) { ++ for (int var16 = 0; var16 < this.fireworkExplosions.tagCount(); ++var16) { + NBTTagCompound var17 = (NBTTagCompound)this.fireworkExplosions.tagAt(var16); +- if(var17.getBoolean("Flicker")) { ++ ++ if (var17.getBoolean("Flicker")) { + this.twinkle = true; + this.particleMaxAge += 15; + break; +@@ -30,23 +33,27 @@ + } + } + } +- +- } +- +- public void renderParticle(Tessellator var1, float var2, float var3, float var4, float var5, float var6, float var7) { +- } +- ++ } ++ ++ public void renderParticle(Tessellator par1Tessellator, float par2, float par3, float par4, float par5, float par6, float par7) {} ++ ++ /** ++ * Called to update the entity's position/logic. ++ */ + public void onUpdate() { + boolean var1; +- if(this.fireworkAge == 0 && this.fireworkExplosions != null) { ++ ++ if (this.fireworkAge == 0 && this.fireworkExplosions != null) { + var1 = this.func_92037_i(); + boolean var2 = false; +- if(this.fireworkExplosions.tagCount() >= 3) { ++ ++ if (this.fireworkExplosions.tagCount() >= 3) { + var2 = true; + } else { +- for(int var3 = 0; var3 < this.fireworkExplosions.tagCount(); ++var3) { ++ for (int var3 = 0; var3 < this.fireworkExplosions.tagCount(); ++var3) { + NBTTagCompound var4 = (NBTTagCompound)this.fireworkExplosions.tagAt(var3); +- if(var4.getByte("Type") == 1) { ++ ++ if (var4.getByte("Type") == 1) { + var2 = true; + break; + } +@@ -54,10 +61,10 @@ + } + + String var15 = "fireworks." + (var2 ? "largeBlast" : "blast") + (var1 ? "_far" : ""); +- this.worldObj.playSound(this.posX, this.posY, this.posZ, var15, 20.0F, 0.95F + this.ab.nextFloat() * 0.1F, true); ++ this.worldObj.playSound(this.posX, this.posY, this.posZ, var15, 20.0F, 0.95F + this.rand.nextFloat() * 0.1F, true); + } + +- if(this.fireworkAge % 2 == 0 && this.fireworkExplosions != null && this.fireworkAge / 2 < this.fireworkExplosions.tagCount()) { ++ if (this.fireworkAge % 2 == 0 && this.fireworkExplosions != null && this.fireworkAge / 2 < this.fireworkExplosions.tagCount()) { + int var13 = this.fireworkAge / 2; + NBTTagCompound var14 = (NBTTagCompound)this.fireworkExplosions.tagAt(var13); + byte var17 = var14.getByte("Type"); +@@ -65,13 +72,14 @@ + boolean var5 = var14.getBoolean("Flicker"); + int[] var6 = var14.getIntArray("Colors"); + int[] var7 = var14.getIntArray("FadeColors"); +- if(var17 == 1) { ++ ++ if (var17 == 1) { + this.createBall(0.5D, 4, var6, var7, var18, var5); +- } else if(var17 == 2) { +- this.createShaped(0.5D, new double[][]{{0.0D, 1.0D}, {0.3455D, 0.309D}, {0.9511D, 0.309D}, {0.3795918367346939D, -0.12653061224489795D}, {0.6122448979591837D, -0.8040816326530612D}, {0.0D, -0.35918367346938773D}}, var6, var7, var18, var5, false); +- } else if(var17 == 3) { +- this.createShaped(0.5D, new double[][]{{0.0D, 0.2D}, {0.2D, 0.2D}, {0.2D, 0.6D}, {0.6D, 0.6D}, {0.6D, 0.2D}, {0.2D, 0.2D}, {0.2D, 0.0D}, {0.4D, 0.0D}, {0.4D, -0.6D}, {0.2D, -0.6D}, {0.2D, -0.4D}, {0.0D, -0.4D}}, var6, var7, var18, var5, true); +- } else if(var17 == 4) { ++ } else if (var17 == 2) { ++ this.createShaped(0.5D, new double[][] {{0.0D, 1.0D}, {0.3455D, 0.309D}, {0.9511D, 0.309D}, {0.3795918367346939D, -0.12653061224489795D}, {0.6122448979591837D, -0.8040816326530612D}, {0.0D, -0.35918367346938773D}}, var6, var7, var18, var5, false); ++ } else if (var17 == 3) { ++ this.createShaped(0.5D, new double[][] {{0.0D, 0.2D}, {0.2D, 0.2D}, {0.2D, 0.6D}, {0.6D, 0.6D}, {0.6D, 0.2D}, {0.2D, 0.2D}, {0.2D, 0.0D}, {0.4D, 0.0D}, {0.4D, -0.6D}, {0.2D, -0.6D}, {0.2D, -0.4D}, {0.0D, -0.4D}}, var6, var7, var18, var5, true); ++ } else if (var17 == 4) { + this.createBurst(var6, var7, var18, var5); + } else { + this.createBall(0.25D, 2, var6, var7, var18, var5); +@@ -79,7 +87,7 @@ + + int var8 = var6[0]; + float var9 = (float)((var8 & 16711680) >> 16) / 255.0F; +- float var10 = (float)((var8 & '\uff00') >> 8) / 255.0F; ++ float var10 = (float)((var8 & 65280) >> 8) / 255.0F; + float var11 = (float)((var8 & 255) >> 0) / 255.0F; + EntityFireworkOverlayFX var12 = new EntityFireworkOverlayFX(this.worldObj, this.posX, this.posY, this.posZ); + var12.setRBGColorF(var9, var10, var11); +@@ -87,16 +95,16 @@ + } + + ++this.fireworkAge; +- if(this.fireworkAge > this.particleMaxAge) { +- if(this.twinkle) { ++ ++ if (this.fireworkAge > this.particleMaxAge) { ++ if (this.twinkle) { + var1 = this.func_92037_i(); + String var16 = "fireworks." + (var1 ? "twinkle_far" : "twinkle"); +- this.worldObj.playSound(this.posX, this.posY, this.posZ, var16, 20.0F, 0.9F + this.ab.nextFloat() * 0.15F, true); ++ this.worldObj.playSound(this.posX, this.posY, this.posZ, var16, 20.0F, 0.9F + this.rand.nextFloat() * 0.15F, true); + } + + this.setDead(); + } +- + } + + private boolean func_92037_i() { +@@ -104,65 +112,78 @@ + return var1 == null || var1.renderViewEntity == null || var1.renderViewEntity.getDistanceSq(this.posX, this.posY, this.posZ) >= 256.0D; + } + +- private void createParticle(double var1, double var3, double var5, double var7, double var9, double var11, int[] var13, int[] var14, boolean var15, boolean var16) { +- EntityFireworkSparkFX var17 = new EntityFireworkSparkFX(this.worldObj, var1, var3, var5, var7, var9, var11, this.theEffectRenderer); +- var17.setTrail(var15); +- var17.setTwinkle(var16); +- int var18 = this.ab.nextInt(var13.length); +- var17.setColour(var13[var18]); +- if(var14 != null && var14.length > 0) { +- var17.setFadeColour(var14[this.ab.nextInt(var14.length)]); ++ /** ++ * Creates a single particle. Args: x, y, z, x velocity, y velocity, z velocity, colours, fade colours, whether to ++ * trail, whether to twinkle ++ */ ++ private void createParticle(double par1, double par3, double par5, double par7, double par9, double par11, int[] par13ArrayOfInteger, int[] par14ArrayOfInteger, boolean par15, boolean par16) { ++ EntityFireworkSparkFX var17 = new EntityFireworkSparkFX(this.worldObj, par1, par3, par5, par7, par9, par11, this.theEffectRenderer); ++ var17.setTrail(par15); ++ var17.setTwinkle(par16); ++ int var18 = this.rand.nextInt(par13ArrayOfInteger.length); ++ var17.setColour(par13ArrayOfInteger[var18]); ++ ++ if (par14ArrayOfInteger != null && par14ArrayOfInteger.length > 0) { ++ var17.setFadeColour(par14ArrayOfInteger[this.rand.nextInt(par14ArrayOfInteger.length)]); + } + + this.theEffectRenderer.addEffect(var17); + } + +- private void createBall(double var1, int var3, int[] var4, int[] var5, boolean var6, boolean var7) { ++ /** ++ * Creates a small ball or large ball type explosion. Args: particle speed, size, colours, fade colours, whether to ++ * trail, whether to flicker ++ */ ++ private void createBall(double par1, int par3, int[] par4ArrayOfInteger, int[] par5ArrayOfInteger, boolean par6, boolean par7) { + double var8 = this.posX; + double var10 = this.posY; + double var12 = this.posZ; + +- for(int var14 = -var3; var14 <= var3; ++var14) { +- for(int var15 = -var3; var15 <= var3; ++var15) { +- for(int var16 = -var3; var16 <= var3; ++var16) { +- double var17 = (double)var15 + (this.ab.nextDouble() - this.ab.nextDouble()) * 0.5D; +- double var19 = (double)var14 + (this.ab.nextDouble() - this.ab.nextDouble()) * 0.5D; +- double var21 = (double)var16 + (this.ab.nextDouble() - this.ab.nextDouble()) * 0.5D; +- double var23 = (double)MathHelper.sqrt_double(var17 * var17 + var19 * var19 + var21 * var21) / var1 + this.ab.nextGaussian() * 0.05D; +- this.createParticle(var8, var10, var12, var17 / var23, var19 / var23, var21 / var23, var4, var5, var6, var7); +- if(var14 != -var3 && var14 != var3 && var15 != -var3 && var15 != var3) { +- var16 += var3 * 2 - 1; ++ for (int var14 = -par3; var14 <= par3; ++var14) { ++ for (int var15 = -par3; var15 <= par3; ++var15) { ++ for (int var16 = -par3; var16 <= par3; ++var16) { ++ double var17 = (double)var15 + (this.rand.nextDouble() - this.rand.nextDouble()) * 0.5D; ++ double var19 = (double)var14 + (this.rand.nextDouble() - this.rand.nextDouble()) * 0.5D; ++ double var21 = (double)var16 + (this.rand.nextDouble() - this.rand.nextDouble()) * 0.5D; ++ double var23 = (double)MathHelper.sqrt_double(var17 * var17 + var19 * var19 + var21 * var21) / par1 + this.rand.nextGaussian() * 0.05D; ++ this.createParticle(var8, var10, var12, var17 / var23, var19 / var23, var21 / var23, par4ArrayOfInteger, par5ArrayOfInteger, par6, par7); ++ ++ if (var14 != -par3 && var14 != par3 && var15 != -par3 && var15 != par3) { ++ var16 += par3 * 2 - 1; + } + } + } + } +- + } + +- private void createShaped(double var1, double[][] var3, int[] var4, int[] var5, boolean var6, boolean var7, boolean var8) { +- double var9 = var3[0][0]; +- double var11 = var3[0][1]; +- this.createParticle(this.posX, this.posY, this.posZ, var9 * var1, var11 * var1, 0.0D, var4, var5, var6, var7); +- float var13 = this.ab.nextFloat() * (float)Math.PI; +- double var14 = var8 ? 0.034D : 0.34D; ++ /** ++ * Creates a creeper-shaped or star-shaped explosion. Args: particle speed, shape, colours, fade colours, whether to ++ * trail, whether to flicker, unknown ++ */ ++ private void createShaped(double par1, double[][] par3ArrayOfDouble, int[] par4ArrayOfInteger, int[] par5ArrayOfInteger, boolean par6, boolean par7, boolean par8) { ++ double var9 = par3ArrayOfDouble[0][0]; ++ double var11 = par3ArrayOfDouble[0][1]; ++ this.createParticle(this.posX, this.posY, this.posZ, var9 * par1, var11 * par1, 0.0D, par4ArrayOfInteger, par5ArrayOfInteger, par6, par7); ++ float var13 = this.rand.nextFloat() * (float)Math.PI; ++ double var14 = par8 ? 0.034D : 0.34D; + +- for(int var16 = 0; var16 < 3; ++var16) { ++ for (int var16 = 0; var16 < 3; ++var16) { + double var17 = (double)var13 + (double)((float)var16 * (float)Math.PI) * var14; + double var19 = var9; + double var21 = var11; + +- for(int var23 = 1; var23 < var3.length; ++var23) { +- double var24 = var3[var23][0]; +- double var26 = var3[var23][1]; ++ for (int var23 = 1; var23 < par3ArrayOfDouble.length; ++var23) { ++ double var24 = par3ArrayOfDouble[var23][0]; ++ double var26 = par3ArrayOfDouble[var23][1]; + +- for(double var28 = 0.25D; var28 <= 1.0D; var28 += 0.25D) { +- double var30 = (var19 + (var24 - var19) * var28) * var1; +- double var32 = (var21 + (var26 - var21) * var28) * var1; ++ for (double var28 = 0.25D; var28 <= 1.0D; var28 += 0.25D) { ++ double var30 = (var19 + (var24 - var19) * var28) * par1; ++ double var32 = (var21 + (var26 - var21) * var28) * par1; + double var34 = var30 * Math.sin(var17); + var30 *= Math.cos(var17); + +- for(double var36 = -1.0D; var36 <= 1.0D; var36 += 2.0D) { +- this.createParticle(this.posX, this.posY, this.posZ, var30 * var36, var32, var34 * var36, var4, var5, var6, var7); ++ for (double var36 = -1.0D; var36 <= 1.0D; var36 += 2.0D) { ++ this.createParticle(this.posX, this.posY, this.posZ, var30 * var36, var32, var34 * var36, par4ArrayOfInteger, par5ArrayOfInteger, par6, par7); + } + } + +@@ -170,20 +191,21 @@ + var21 = var26; + } + } +- + } + +- private void createBurst(int[] var1, int[] var2, boolean var3, boolean var4) { +- double var5 = this.ab.nextGaussian() * 0.05D; +- double var7 = this.ab.nextGaussian() * 0.05D; ++ /** ++ * Creates a burst type explosion. Args: colours, fade colours, whether to trail, whether to flicker ++ */ ++ private void createBurst(int[] par1ArrayOfInteger, int[] par2ArrayOfInteger, boolean par3, boolean par4) { ++ double var5 = this.rand.nextGaussian() * 0.05D; ++ double var7 = this.rand.nextGaussian() * 0.05D; + +- for(int var9 = 0; var9 < 70; ++var9) { +- double var10 = this.motionX * 0.5D + this.ab.nextGaussian() * 0.15D + var5; +- double var12 = this.motionZ * 0.5D + this.ab.nextGaussian() * 0.15D + var7; +- double var14 = this.motionY * 0.5D + this.ab.nextDouble() * 0.5D; +- this.createParticle(this.posX, this.posY, this.posZ, var10, var14, var12, var1, var2, var3, var4); ++ for (int var9 = 0; var9 < 70; ++var9) { ++ double var10 = this.motionX * 0.5D + this.rand.nextGaussian() * 0.15D + var5; ++ double var12 = this.motionZ * 0.5D + this.rand.nextGaussian() * 0.15D + var7; ++ double var14 = this.motionY * 0.5D + this.rand.nextDouble() * 0.5D; ++ this.createParticle(this.posX, this.posY, this.posZ, var10, var14, var12, par1ArrayOfInteger, par2ArrayOfInteger, par3, par4); + } +- + } + + public int getFXLayer() { diff --git a/patches/net/minecraft/src/EntityFishHook.java.patch b/patches/net/minecraft/src/EntityFishHook.java.patch new file mode 100644 index 0000000..0ea8245 --- /dev/null +++ b/patches/net/minecraft/src/EntityFishHook.java.patch @@ -0,0 +1,515 @@ +--- net/minecraft/src/EntityFishHook.java ++++ net/minecraft/src/EntityFishHook.java +@@ -3,8 +3,14 @@ + import java.util.List; + + public class EntityFishHook extends Entity { ++ ++ /** The tile this entity is on, X position */ + private int xTile; ++ ++ /** The tile this entity is on, Y position */ + private int yTile; ++ ++ /** The tile this entity is on, Z position */ + private int zTile; + private int inTile; + private boolean inGround; +@@ -12,7 +18,14 @@ + public EntityPlayer angler; + private int ticksInGround; + private int ticksInAir; ++ ++ /** the number of ticks remaining until this fish can no longer be caught */ + private int ticksCatchable; ++ ++ /** ++ * The entity that the fishing rod is connected to, if any. When you right click on the fishing rod and the hook falls ++ * on to an entity, this it that entity. ++ */ + public Entity bobber; + private int fishPosRotationIncrements; + private double fishX; +@@ -24,8 +37,8 @@ + private double velocityY; + private double velocityZ; + +- public EntityFishHook(World var1) { +- super(var1); ++ public EntityFishHook(World par1World) { ++ super(par1World); + this.xTile = -1; + this.yTile = -1; + this.zTile = -1; +@@ -33,26 +46,26 @@ + this.ignoreFrustumCheck = true; + } + +- public EntityFishHook(World var1, double var2, double var4, double var6, EntityPlayer var8) { +- this(var1); +- this.setPosition(var2, var4, var6); ++ public EntityFishHook(World par1World, double par2, double par4, double par6, EntityPlayer par8EntityPlayer) { ++ this(par1World); ++ this.setPosition(par2, par4, par6); + this.ignoreFrustumCheck = true; +- this.angler = var8; +- var8.fishEntity = this; ++ this.angler = par8EntityPlayer; ++ par8EntityPlayer.fishEntity = this; + } + +- public EntityFishHook(World var1, EntityPlayer var2) { +- super(var1); ++ public EntityFishHook(World par1World, EntityPlayer par2EntityPlayer) { ++ super(par1World); + this.xTile = -1; + this.yTile = -1; + this.zTile = -1; + this.ignoreFrustumCheck = true; +- this.angler = var2; ++ this.angler = par2EntityPlayer; + this.angler.fishEntity = this; + this.setSize(0.25F, 0.25F); +- this.setLocationAndAngles(var2.posX, var2.posY + 1.62D - (double)var2.yOffset, var2.posZ, var2.rotationYaw, var2.rotationPitch); ++ this.setLocationAndAngles(par2EntityPlayer.posX, par2EntityPlayer.posY + 1.62D - (double)par2EntityPlayer.yOffset, par2EntityPlayer.posZ, par2EntityPlayer.rotationYaw, par2EntityPlayer.rotationPitch); + this.posX -= (double)(MathHelper.cos(this.rotationYaw / 180.0F * (float)Math.PI) * 0.16F); +- this.posY -= (double)0.1F; ++ this.posY -= 0.10000000149011612D; + this.posZ -= (double)(MathHelper.sin(this.rotationYaw / 180.0F * (float)Math.PI) * 0.16F); + this.setPosition(this.posX, this.posY, this.posZ); + this.yOffset = 0.0F; +@@ -63,56 +76,70 @@ + this.calculateVelocity(this.motionX, this.motionY, this.motionZ, 1.5F, 1.0F); + } + +- protected void entityInit() { +- } ++ protected void entityInit() {} + +- public boolean isInRangeToRenderDist(double var1) { ++ /** ++ * Checks if the entity is in range to render by using the past in distance and comparing it to its average edge length ++ * * 64 * renderDistanceWeight Args: distance ++ */ ++ public boolean isInRangeToRenderDist(double par1) { + double var3 = this.boundingBox.getAverageEdgeLength() * 4.0D; + var3 *= 64.0D; +- return var1 < var3 * var3; ++ return par1 < var3 * var3; + } + +- public void calculateVelocity(double var1, double var3, double var5, float var7, float var8) { +- float var9 = MathHelper.sqrt_double(var1 * var1 + var3 * var3 + var5 * var5); +- var1 /= (double)var9; +- var3 /= (double)var9; +- var5 /= (double)var9; +- var1 += this.ab.nextGaussian() * (double)0.0075F * (double)var8; +- var3 += this.ab.nextGaussian() * (double)0.0075F * (double)var8; +- var5 += this.ab.nextGaussian() * (double)0.0075F * (double)var8; +- var1 *= (double)var7; +- var3 *= (double)var7; +- var5 *= (double)var7; +- this.motionX = var1; +- this.motionY = var3; +- this.motionZ = var5; +- float var10 = MathHelper.sqrt_double(var1 * var1 + var5 * var5); +- this.prevRotationYaw = this.rotationYaw = (float)(Math.atan2(var1, var5) * 180.0D / (double)((float)Math.PI)); +- this.prevRotationPitch = this.rotationPitch = (float)(Math.atan2(var3, (double)var10) * 180.0D / (double)((float)Math.PI)); ++ public void calculateVelocity(double par1, double par3, double par5, float par7, float par8) { ++ float var9 = MathHelper.sqrt_double(par1 * par1 + par3 * par3 + par5 * par5); ++ par1 /= (double)var9; ++ par3 /= (double)var9; ++ par5 /= (double)var9; ++ par1 += this.rand.nextGaussian() * 0.007499999832361937D * (double)par8; ++ par3 += this.rand.nextGaussian() * 0.007499999832361937D * (double)par8; ++ par5 += this.rand.nextGaussian() * 0.007499999832361937D * (double)par8; ++ par1 *= (double)par7; ++ par3 *= (double)par7; ++ par5 *= (double)par7; ++ this.motionX = par1; ++ this.motionY = par3; ++ this.motionZ = par5; ++ float var10 = MathHelper.sqrt_double(par1 * par1 + par5 * par5); ++ this.prevRotationYaw = this.rotationYaw = (float)(Math.atan2(par1, par5) * 180.0D / Math.PI); ++ this.prevRotationPitch = this.rotationPitch = (float)(Math.atan2(par3, (double)var10) * 180.0D / Math.PI); + this.ticksInGround = 0; + } + +- public void setPositionAndRotation2(double var1, double var3, double var5, float var7, float var8, int var9) { +- this.fishX = var1; +- this.fishY = var3; +- this.fishZ = var5; +- this.fishYaw = (double)var7; +- this.fishPitch = (double)var8; +- this.fishPosRotationIncrements = var9; ++ /** ++ * Sets the position and rotation. Only difference from the other one is no bounding on the rotation. Args: posX, posY, ++ * posZ, yaw, pitch ++ */ ++ public void setPositionAndRotation2(double par1, double par3, double par5, float par7, float par8, int par9) { ++ this.fishX = par1; ++ this.fishY = par3; ++ this.fishZ = par5; ++ this.fishYaw = (double)par7; ++ this.fishPitch = (double)par8; ++ this.fishPosRotationIncrements = par9; + this.motionX = this.velocityX; + this.motionY = this.velocityY; + this.motionZ = this.velocityZ; + } + +- public void setVelocity(double var1, double var3, double var5) { +- this.velocityX = this.motionX = var1; +- this.velocityY = this.motionY = var3; +- this.velocityZ = this.motionZ = var5; ++ /** ++ * Sets the velocity to the args. Args: x, y, z ++ */ ++ public void setVelocity(double par1, double par3, double par5) { ++ this.velocityX = this.motionX = par1; ++ this.velocityY = this.motionY = par3; ++ this.velocityZ = this.motionZ = par5; + } + ++ /** ++ * Called to update the entity's position/logic. ++ */ + public void onUpdate() { + super.onUpdate(); +- if(this.fishPosRotationIncrements > 0) { ++ ++ if (this.fishPosRotationIncrements > 0) { + double var21 = this.posX + (this.fishX - this.posX) / (double)this.fishPosRotationIncrements; + double var22 = this.posY + (this.fishY - this.posY) / (double)this.fishPosRotationIncrements; + double var23 = this.posZ + (this.fishZ - this.posZ) / (double)this.fishPosRotationIncrements; +@@ -123,16 +150,17 @@ + this.setPosition(var21, var22, var23); + this.setRotation(this.rotationYaw, this.rotationPitch); + } else { +- if(!this.worldObj.isRemote) { ++ if (!this.worldObj.isRemote) { + ItemStack var1 = this.angler.getCurrentEquippedItem(); +- if(this.angler.isDead || !this.angler.isEntityAlive() || var1 == null || var1.getItem() != Item.fishingRod || this.getDistanceSqToEntity(this.angler) > 1024.0D) { ++ ++ if (this.angler.isDead || !this.angler.isEntityAlive() || var1 == null || var1.getItem() != Item.fishingRod || this.getDistanceSqToEntity(this.angler) > 1024.0D) { + this.setDead(); + this.angler.fishEntity = null; + return; + } + +- if(this.bobber != null) { +- if(!this.bobber.isDead) { ++ if (this.bobber != null) { ++ if (!this.bobber.isDead) { + this.posX = this.bobber.posX; + this.posY = this.bobber.boundingBox.minY + (double)this.bobber.height * 0.8D; + this.posZ = this.bobber.posZ; +@@ -143,15 +171,17 @@ + } + } + +- if(this.shake > 0) { ++ if (this.shake > 0) { + --this.shake; + } + +- if(this.inGround) { ++ if (this.inGround) { + int var19 = this.worldObj.getBlockId(this.xTile, this.yTile, this.zTile); +- if(var19 == this.inTile) { ++ ++ if (var19 == this.inTile) { + ++this.ticksInGround; +- if(this.ticksInGround == 1200) { ++ ++ if (this.ticksInGround == 1200) { + this.setDead(); + } + +@@ -159,9 +189,9 @@ + } + + this.inGround = false; +- this.motionX *= (double)(this.ab.nextFloat() * 0.2F); +- this.motionY *= (double)(this.ab.nextFloat() * 0.2F); +- this.motionZ *= (double)(this.ab.nextFloat() * 0.2F); ++ this.motionX *= (double)(this.rand.nextFloat() * 0.2F); ++ this.motionY *= (double)(this.rand.nextFloat() * 0.2F); ++ this.motionZ *= (double)(this.rand.nextFloat() * 0.2F); + this.ticksInGround = 0; + this.ticksInAir = 0; + } else { +@@ -170,27 +200,31 @@ + + Vec3 var20 = this.worldObj.getWorldVec3Pool().getVecFromPool(this.posX, this.posY, this.posZ); + Vec3 var2 = this.worldObj.getWorldVec3Pool().getVecFromPool(this.posX + this.motionX, this.posY + this.motionY, this.posZ + this.motionZ); +- MovingObjectPosition var3 = this.worldObj.rayTraceBlocks(var20, var2); ++ MovingObjectPosition var3 = this.worldObj.clip(var20, var2); + var20 = this.worldObj.getWorldVec3Pool().getVecFromPool(this.posX, this.posY, this.posZ); + var2 = this.worldObj.getWorldVec3Pool().getVecFromPool(this.posX + this.motionX, this.posY + this.motionY, this.posZ + this.motionZ); +- if(var3 != null) { ++ ++ if (var3 != null) { + var2 = this.worldObj.getWorldVec3Pool().getVecFromPool(var3.hitVec.xCoord, var3.hitVec.yCoord, var3.hitVec.zCoord); + } + + Entity var4 = null; + List var5 = this.worldObj.getEntitiesWithinAABBExcludingEntity(this, this.boundingBox.addCoord(this.motionX, this.motionY, this.motionZ).expand(1.0D, 1.0D, 1.0D)); + double var6 = 0.0D; +- + double var13; +- for(int var8 = 0; var8 < var5.size(); ++var8) { ++ ++ for (int var8 = 0; var8 < var5.size(); ++var8) { + Entity var9 = (Entity)var5.get(var8); +- if(var9.canBeCollidedWith() && (var9 != this.angler || this.ticksInAir >= 5)) { ++ ++ if (var9.canBeCollidedWith() && (var9 != this.angler || this.ticksInAir >= 5)) { + float var10 = 0.3F; + AxisAlignedBB var11 = var9.boundingBox.expand((double)var10, (double)var10, (double)var10); + MovingObjectPosition var12 = var11.calculateIntercept(var20, var2); +- if(var12 != null) { ++ ++ if (var12 != null) { + var13 = var20.distanceTo(var12.hitVec); +- if(var13 < var6 || var6 == 0.0D) { ++ ++ if (var13 < var6 || var6 == 0.0D) { + var4 = var9; + var6 = var13; + } +@@ -198,13 +232,13 @@ + } + } + +- if(var4 != null) { ++ if (var4 != null) { + var3 = new MovingObjectPosition(var4); + } + +- if(var3 != null) { +- if(var3.entityHit != null) { +- if(var3.entityHit.attackEntityFrom(DamageSource.causeThrownDamage(this, this.angler), 0.0F)) { ++ if (var3 != null) { ++ if (var3.entityHit != null) { ++ if (var3.entityHit.attackEntityFrom(DamageSource.causeThrownDamage(this, this.angler), 0.0F)) { + this.bobber = var3.entityHit; + } + } else { +@@ -212,85 +246,90 @@ + } + } + +- if(!this.inGround) { ++ if (!this.inGround) { + this.moveEntity(this.motionX, this.motionY, this.motionZ); + float var24 = MathHelper.sqrt_double(this.motionX * this.motionX + this.motionZ * this.motionZ); +- this.rotationYaw = (float)(Math.atan2(this.motionX, this.motionZ) * 180.0D / (double)((float)Math.PI)); ++ this.rotationYaw = (float)(Math.atan2(this.motionX, this.motionZ) * 180.0D / Math.PI); + +- for(this.rotationPitch = (float)(Math.atan2(this.motionY, (double)var24) * 180.0D / (double)((float)Math.PI)); this.rotationPitch - this.prevRotationPitch < -180.0F; this.prevRotationPitch -= 360.0F) { ++ for (this.rotationPitch = (float)(Math.atan2(this.motionY, (double)var24) * 180.0D / Math.PI); this.rotationPitch - this.prevRotationPitch < -180.0F; this.prevRotationPitch -= 360.0F) { ++ ; + } + +- while(this.rotationPitch - this.prevRotationPitch >= 180.0F) { ++ while (this.rotationPitch - this.prevRotationPitch >= 180.0F) { + this.prevRotationPitch += 360.0F; + } + +- while(this.rotationYaw - this.prevRotationYaw < -180.0F) { ++ while (this.rotationYaw - this.prevRotationYaw < -180.0F) { + this.prevRotationYaw -= 360.0F; + } + +- while(this.rotationYaw - this.prevRotationYaw >= 180.0F) { ++ while (this.rotationYaw - this.prevRotationYaw >= 180.0F) { + this.prevRotationYaw += 360.0F; + } + + this.rotationPitch = this.prevRotationPitch + (this.rotationPitch - this.prevRotationPitch) * 0.2F; + this.rotationYaw = this.prevRotationYaw + (this.rotationYaw - this.prevRotationYaw) * 0.2F; + float var25 = 0.92F; +- if(this.onGround || this.isCollidedHorizontally) { ++ ++ if (this.onGround || this.isCollidedHorizontally) { + var25 = 0.5F; + } + + byte var26 = 5; + double var27 = 0.0D; + +- for(int var28 = 0; var28 < var26; ++var28) { ++ for (int var28 = 0; var28 < var26; ++var28) { + double var14 = this.boundingBox.minY + (this.boundingBox.maxY - this.boundingBox.minY) * (double)(var28 + 0) / (double)var26 - 0.125D + 0.125D; + double var16 = this.boundingBox.minY + (this.boundingBox.maxY - this.boundingBox.minY) * (double)(var28 + 1) / (double)var26 - 0.125D + 0.125D; + AxisAlignedBB var18 = AxisAlignedBB.getAABBPool().getAABB(this.boundingBox.minX, var14, this.boundingBox.minZ, this.boundingBox.maxX, var16, this.boundingBox.maxZ); +- if(this.worldObj.isAABBInMaterial(var18, Material.water)) { ++ ++ if (this.worldObj.isAABBInMaterial(var18, Material.water)) { + var27 += 1.0D / (double)var26; + } + } + +- if(var27 > 0.0D) { +- if(this.ticksCatchable > 0) { ++ if (var27 > 0.0D) { ++ if (this.ticksCatchable > 0) { + --this.ticksCatchable; + } else { + short var29 = 500; +- if(this.worldObj.canLightningStrikeAt(MathHelper.floor_double(this.posX), MathHelper.floor_double(this.posY) + 1, MathHelper.floor_double(this.posZ))) { ++ ++ if (this.worldObj.canLightningStrikeAt(MathHelper.floor_double(this.posX), MathHelper.floor_double(this.posY) + 1, MathHelper.floor_double(this.posZ))) { + var29 = 300; + } + +- if(this.ab.nextInt(var29) == 0) { +- this.ticksCatchable = this.ab.nextInt(30) + 10; +- this.motionY -= (double)0.2F; +- this.playSound("random.splash", 0.25F, 1.0F + (this.ab.nextFloat() - this.ab.nextFloat()) * 0.4F); ++ if (this.rand.nextInt(var29) == 0) { ++ this.ticksCatchable = this.rand.nextInt(30) + 10; ++ this.motionY -= 0.20000000298023224D; ++ this.playSound("random.splash", 0.25F, 1.0F + (this.rand.nextFloat() - this.rand.nextFloat()) * 0.4F); + float var30 = (float)MathHelper.floor_double(this.boundingBox.minY); +- + int var15; + float var17; + float var31; +- for(var15 = 0; (float)var15 < 1.0F + this.width * 20.0F; ++var15) { +- var31 = (this.ab.nextFloat() * 2.0F - 1.0F) * this.width; +- var17 = (this.ab.nextFloat() * 2.0F - 1.0F) * this.width; +- this.worldObj.spawnParticle("bubble", this.posX + (double)var31, (double)(var30 + 1.0F), this.posZ + (double)var17, this.motionX, this.motionY - (double)(this.ab.nextFloat() * 0.2F), this.motionZ); ++ ++ for (var15 = 0; (float)var15 < 1.0F + this.width * 20.0F; ++var15) { ++ var31 = (this.rand.nextFloat() * 2.0F - 1.0F) * this.width; ++ var17 = (this.rand.nextFloat() * 2.0F - 1.0F) * this.width; ++ this.worldObj.spawnParticle("bubble", this.posX + (double)var31, (double)(var30 + 1.0F), this.posZ + (double)var17, this.motionX, this.motionY - (double)(this.rand.nextFloat() * 0.2F), this.motionZ); + } + +- for(var15 = 0; (float)var15 < 1.0F + this.width * 20.0F; ++var15) { +- var31 = (this.ab.nextFloat() * 2.0F - 1.0F) * this.width; +- var17 = (this.ab.nextFloat() * 2.0F - 1.0F) * this.width; ++ for (var15 = 0; (float)var15 < 1.0F + this.width * 20.0F; ++var15) { ++ var31 = (this.rand.nextFloat() * 2.0F - 1.0F) * this.width; ++ var17 = (this.rand.nextFloat() * 2.0F - 1.0F) * this.width; + this.worldObj.spawnParticle("splash", this.posX + (double)var31, (double)(var30 + 1.0F), this.posZ + (double)var17, this.motionX, this.motionY, this.motionZ); + } + } + } + } + +- if(this.ticksCatchable > 0) { +- this.motionY -= (double)(this.ab.nextFloat() * this.ab.nextFloat() * this.ab.nextFloat()) * 0.2D; ++ if (this.ticksCatchable > 0) { ++ this.motionY -= (double)(this.rand.nextFloat() * this.rand.nextFloat() * this.rand.nextFloat()) * 0.2D; + } + + var13 = var27 * 2.0D - 1.0D; +- this.motionY += (double)0.04F * var13; +- if(var27 > 0.0D) { ++ this.motionY += 0.03999999910593033D * var13; ++ ++ if (var27 > 0.0D) { + var25 = (float)((double)var25 * 0.9D); + this.motionY *= 0.8D; + } +@@ -303,22 +342,28 @@ + } + } + +- public void writeEntityToNBT(NBTTagCompound var1) { +- var1.setShort("xTile", (short)this.xTile); +- var1.setShort("yTile", (short)this.yTile); +- var1.setShort("zTile", (short)this.zTile); +- var1.setByte("inTile", (byte)this.inTile); +- var1.setByte("shake", (byte)this.shake); +- var1.setByte("inGround", (byte)(this.inGround ? 1 : 0)); ++ /** ++ * (abstract) Protected helper method to write subclass entity data to NBT. ++ */ ++ public void writeEntityToNBT(NBTTagCompound par1NBTTagCompound) { ++ par1NBTTagCompound.setShort("xTile", (short)this.xTile); ++ par1NBTTagCompound.setShort("yTile", (short)this.yTile); ++ par1NBTTagCompound.setShort("zTile", (short)this.zTile); ++ par1NBTTagCompound.setByte("inTile", (byte)this.inTile); ++ par1NBTTagCompound.setByte("shake", (byte)this.shake); ++ par1NBTTagCompound.setByte("inGround", (byte)(this.inGround ? 1 : 0)); + } + +- public void readEntityFromNBT(NBTTagCompound var1) { +- this.xTile = var1.getShort("xTile"); +- this.yTile = var1.getShort("yTile"); +- this.zTile = var1.getShort("zTile"); +- this.inTile = var1.getByte("inTile") & 255; +- this.shake = var1.getByte("shake") & 255; +- this.inGround = var1.getByte("inGround") == 1; ++ /** ++ * (abstract) Protected helper method to read subclass entity data from NBT. ++ */ ++ public void readEntityFromNBT(NBTTagCompound par1NBTTagCompound) { ++ this.xTile = par1NBTTagCompound.getShort("xTile"); ++ this.yTile = par1NBTTagCompound.getShort("yTile"); ++ this.zTile = par1NBTTagCompound.getShort("zTile"); ++ this.inTile = par1NBTTagCompound.getByte("inTile") & 255; ++ this.shake = par1NBTTagCompound.getByte("shake") & 255; ++ this.inGround = par1NBTTagCompound.getByte("inGround") == 1; + } + + public float getShadowSize() { +@@ -326,11 +371,12 @@ + } + + public int catchFish() { +- if(this.worldObj.isRemote) { ++ if (this.worldObj.isRemote) { + return 0; + } else { + byte var1 = 0; +- if(this.bobber != null) { ++ ++ if (this.bobber != null) { + double var2 = this.angler.posX - this.posX; + double var4 = this.angler.posY - this.posY; + double var6 = this.angler.posZ - this.posZ; +@@ -340,7 +386,7 @@ + this.bobber.motionY += var4 * var10 + (double)MathHelper.sqrt_double(var8) * 0.08D; + this.bobber.motionZ += var6 * var10; + var1 = 3; +- } else if(this.ticksCatchable > 0) { ++ } else if (this.ticksCatchable > 0) { + EntityItem var13 = new EntityItem(this.worldObj, this.posX, this.posY, this.posZ, new ItemStack(Item.fishRaw)); + double var3 = this.angler.posX - this.posX; + double var5 = this.angler.posY - this.posY; +@@ -352,11 +398,11 @@ + var13.motionZ = var7 * var11; + this.worldObj.spawnEntityInWorld(var13); + this.angler.addStat(StatList.fishCaughtStat, 1); +- this.angler.worldObj.spawnEntityInWorld(new EntityXPOrb(this.angler.worldObj, this.angler.posX, this.angler.posY + 0.5D, this.angler.posZ + 0.5D, this.ab.nextInt(6) + 1)); ++ this.angler.worldObj.spawnEntityInWorld(new EntityXPOrb(this.angler.worldObj, this.angler.posX, this.angler.posY + 0.5D, this.angler.posZ + 0.5D, this.rand.nextInt(6) + 1)); + var1 = 1; + } + +- if(this.inGround) { ++ if (this.inGround) { + var1 = 2; + } + +@@ -366,11 +412,14 @@ + } + } + ++ /** ++ * Will get destroyed next tick. ++ */ + public void setDead() { + super.setDead(); +- if(this.angler != null) { ++ ++ if (this.angler != null) { + this.angler.fishEntity = null; + } +- + } + } diff --git a/patches/net/minecraft/src/EntityFlameFX.java.patch b/patches/net/minecraft/src/EntityFlameFX.java.patch new file mode 100644 index 0000000..1e734d6 --- /dev/null +++ b/patches/net/minecraft/src/EntityFlameFX.java.patch @@ -0,0 +1,125 @@ +--- net/minecraft/src/EntityFlameFX.java ++++ net/minecraft/src/EntityFlameFX.java +@@ -1,16 +1,18 @@ + package net.minecraft.src; + + public class EntityFlameFX extends EntityFX { ++ ++ /** the scale of the flame FX */ + private float flameScale; + +- public EntityFlameFX(World var1, double var2, double var4, double var6, double var8, double var10, double var12) { +- super(var1, var2, var4, var6, var8, var10, var12); +- this.motionX = this.motionX * (double)0.01F + var8; +- this.motionY = this.motionY * (double)0.01F + var10; +- this.motionZ = this.motionZ * (double)0.01F + var12; +- double var10000 = var2 + (double)((this.ab.nextFloat() - this.ab.nextFloat()) * 0.05F); +- var10000 = var4 + (double)((this.ab.nextFloat() - this.ab.nextFloat()) * 0.05F); +- var10000 = var6 + (double)((this.ab.nextFloat() - this.ab.nextFloat()) * 0.05F); ++ public EntityFlameFX(World par1World, double par2, double par4, double par6, double par8, double par10, double par12) { ++ super(par1World, par2, par4, par6, par8, par10, par12); ++ this.motionX = this.motionX * 0.009999999776482582D + par8; ++ this.motionY = this.motionY * 0.009999999776482582D + par10; ++ this.motionZ = this.motionZ * 0.009999999776482582D + par12; ++ double var10000 = par2 + (double)((this.rand.nextFloat() - this.rand.nextFloat()) * 0.05F); ++ var10000 = par4 + (double)((this.rand.nextFloat() - this.rand.nextFloat()) * 0.05F); ++ var10000 = par6 + (double)((this.rand.nextFloat() - this.rand.nextFloat()) * 0.05F); + this.flameScale = this.particleScale; + this.particleRed = this.particleGreen = this.particleBlue = 1.0F; + this.particleMaxAge = (int)(8.0D / (Math.random() * 0.8D + 0.2D)) + 4; +@@ -18,63 +20,73 @@ + this.setParticleTextureIndex(48); + } + +- public void renderParticle(Tessellator var1, float var2, float var3, float var4, float var5, float var6, float var7) { +- float var8 = ((float)this.particleAge + var2) / (float)this.particleMaxAge; ++ public void renderParticle(Tessellator par1Tessellator, float par2, float par3, float par4, float par5, float par6, float par7) { ++ float var8 = ((float)this.particleAge + par2) / (float)this.particleMaxAge; + this.particleScale = this.flameScale * (1.0F - var8 * var8 * 0.5F); +- super.renderParticle(var1, var2, var3, var4, var5, var6, var7); ++ super.renderParticle(par1Tessellator, par2, par3, par4, par5, par6, par7); + } + +- public int getBrightnessForRender(float var1) { +- float var2 = ((float)this.particleAge + var1) / (float)this.particleMaxAge; +- if(var2 < 0.0F) { ++ public int getBrightnessForRender(float par1) { ++ float var2 = ((float)this.particleAge + par1) / (float)this.particleMaxAge; ++ ++ if (var2 < 0.0F) { + var2 = 0.0F; + } + +- if(var2 > 1.0F) { ++ if (var2 > 1.0F) { + var2 = 1.0F; + } + +- int var3 = super.getBrightnessForRender(var1); ++ int var3 = super.getBrightnessForRender(par1); + int var4 = var3 & 255; + int var5 = var3 >> 16 & 255; + var4 += (int)(var2 * 15.0F * 16.0F); +- if(var4 > 240) { ++ ++ if (var4 > 240) { + var4 = 240; + } + + return var4 | var5 << 16; + } + +- public float getBrightness(float var1) { +- float var2 = ((float)this.particleAge + var1) / (float)this.particleMaxAge; +- if(var2 < 0.0F) { ++ /** ++ * Gets how bright this entity is. ++ */ ++ public float getBrightness(float par1) { ++ float var2 = ((float)this.particleAge + par1) / (float)this.particleMaxAge; ++ ++ if (var2 < 0.0F) { + var2 = 0.0F; + } + +- if(var2 > 1.0F) { ++ if (var2 > 1.0F) { + var2 = 1.0F; + } + +- float var3 = super.getBrightness(var1); ++ float var3 = super.getBrightness(par1); + return var3 * var2 + (1.0F - var2); + } + ++ /** ++ * Called to update the entity's position/logic. ++ */ + public void onUpdate() { + this.prevPosX = this.posX; + this.prevPosY = this.posY; + this.prevPosZ = this.posZ; +- if(this.particleAge++ >= this.particleMaxAge) { ++ ++ if (this.particleAge++ >= this.particleMaxAge) { + this.setDead(); + } + + this.moveEntity(this.motionX, this.motionY, this.motionZ); +- this.motionX *= (double)0.96F; +- this.motionY *= (double)0.96F; +- this.motionZ *= (double)0.96F; +- if(this.onGround) { +- this.motionX *= (double)0.7F; +- this.motionZ *= (double)0.7F; +- } ++ this.motionX *= 0.9599999785423279D; ++ this.motionY *= 0.9599999785423279D; ++ this.motionZ *= 0.9599999785423279D; + ++ if (this.onGround) { ++ this.motionX *= 0.699999988079071D; ++ this.motionZ *= 0.699999988079071D; ++ } + } + } diff --git a/patches/net/minecraft/src/EntityFlying.java.patch b/patches/net/minecraft/src/EntityFlying.java.patch new file mode 100644 index 0000000..400d63e --- /dev/null +++ b/patches/net/minecraft/src/EntityFlying.java.patch @@ -0,0 +1,106 @@ +--- net/minecraft/src/EntityFlying.java ++++ net/minecraft/src/EntityFlying.java +@@ -1,46 +1,58 @@ + package net.minecraft.src; + + public abstract class EntityFlying extends EntityLiving { +- public EntityFlying(World var1) { +- super(var1); +- } +- +- protected void fall(float var1) { +- } +- +- protected void updateFallState(double var1, boolean var3) { +- } +- +- public void moveEntityWithHeading(float var1, float var2) { +- if(this.isInWater()) { +- this.moveFlying(var1, var2, 0.02F); ++ public EntityFlying(World par1World) { ++ super(par1World); ++ } ++ ++ /** ++ * Called when the mob is falling. Calculates and applies fall damage. ++ */ ++ protected void fall(float par1) {} ++ ++ /** ++ * Takes in the distance the entity has fallen this tick and whether its on the ground to update the fall distance and ++ * deal fall damage if landing on the ground. Args: distanceFallenThisTick, onGround ++ */ ++ protected void updateFallState(double par1, boolean par3) {} ++ ++ /** ++ * Moves the entity based on the specified heading. Args: strafe, forward ++ */ ++ public void moveEntityWithHeading(float par1, float par2) { ++ if (this.isInWater()) { ++ this.moveFlying(par1, par2, 0.02F); + this.moveEntity(this.motionX, this.motionY, this.motionZ); +- this.motionX *= (double)0.8F; +- this.motionY *= (double)0.8F; +- this.motionZ *= (double)0.8F; +- } else if(this.handleLavaMovement()) { +- this.moveFlying(var1, var2, 0.02F); ++ this.motionX *= 0.800000011920929D; ++ this.motionY *= 0.800000011920929D; ++ this.motionZ *= 0.800000011920929D; ++ } else if (this.handleLavaMovement()) { ++ this.moveFlying(par1, par2, 0.02F); + this.moveEntity(this.motionX, this.motionY, this.motionZ); + this.motionX *= 0.5D; + this.motionY *= 0.5D; + this.motionZ *= 0.5D; + } else { + float var3 = 0.91F; +- if(this.onGround) { +- var3 = 546.0F * 0.1F * 0.1F * 0.1F; ++ ++ if (this.onGround) { ++ var3 = 0.54600006F; + int var4 = this.worldObj.getBlockId(MathHelper.floor_double(this.posX), MathHelper.floor_double(this.boundingBox.minY) - 1, MathHelper.floor_double(this.posZ)); +- if(var4 > 0) { ++ ++ if (var4 > 0) { + var3 = Block.blocksList[var4].slipperiness * 0.91F; + } + } + + float var8 = 0.16277136F / (var3 * var3 * var3); +- this.moveFlying(var1, var2, this.onGround ? 0.1F * var8 : 0.02F); ++ this.moveFlying(par1, par2, this.onGround ? 0.1F * var8 : 0.02F); + var3 = 0.91F; +- if(this.onGround) { +- var3 = 546.0F * 0.1F * 0.1F * 0.1F; ++ ++ if (this.onGround) { ++ var3 = 0.54600006F; + int var5 = this.worldObj.getBlockId(MathHelper.floor_double(this.posX), MathHelper.floor_double(this.boundingBox.minY) - 1, MathHelper.floor_double(this.posZ)); +- if(var5 > 0) { ++ ++ if (var5 > 0) { + var3 = Block.blocksList[var5].slipperiness * 0.91F; + } + } +@@ -55,7 +67,8 @@ + double var10 = this.posX - this.prevPosX; + double var9 = this.posZ - this.prevPosZ; + float var7 = MathHelper.sqrt_double(var10 * var10 + var9 * var9) * 4.0F; +- if(var7 > 1.0F) { ++ ++ if (var7 > 1.0F) { + var7 = 1.0F; + } + +@@ -63,6 +76,9 @@ + this.limbSwing += this.limbSwingAmount; + } + ++ /** ++ * returns true if this entity is by a ladder, false otherwise ++ */ + public boolean isOnLadder() { + return false; + } diff --git a/patches/net/minecraft/src/EntityFootStepFX.java.patch b/patches/net/minecraft/src/EntityFootStepFX.java.patch new file mode 100644 index 0000000..8bae2ca --- /dev/null +++ b/patches/net/minecraft/src/EntityFootStepFX.java.patch @@ -0,0 +1,71 @@ +--- net/minecraft/src/EntityFootStepFX.java ++++ net/minecraft/src/EntityFootStepFX.java +@@ -8,24 +8,25 @@ + private int footstepMaxAge; + private TextureManager currentFootSteps; + +- public EntityFootStepFX(TextureManager var1, World var2, double var3, double var5, double var7) { +- super(var2, var3, var5, var7, 0.0D, 0.0D, 0.0D); +- this.currentFootSteps = var1; ++ public EntityFootStepFX(TextureManager par1TextureManager, World par2World, double par3, double par5, double par7) { ++ super(par2World, par3, par5, par7, 0.0D, 0.0D, 0.0D); ++ this.currentFootSteps = par1TextureManager; + this.motionX = this.motionY = this.motionZ = 0.0D; + this.footstepMaxAge = 200; + } + +- public void renderParticle(Tessellator var1, float var2, float var3, float var4, float var5, float var6, float var7) { +- float var8 = ((float)this.footstepAge + var2) / (float)this.footstepMaxAge; ++ public void renderParticle(Tessellator par1Tessellator, float par2, float par3, float par4, float par5, float par6, float par7) { ++ float var8 = ((float)this.footstepAge + par2) / (float)this.footstepMaxAge; + var8 *= var8; + float var9 = 2.0F - var8 * 2.0F; +- if(var9 > 1.0F) { ++ ++ if (var9 > 1.0F) { + var9 = 1.0F; + } + + var9 *= 0.2F; + GL11.glDisable(GL11.GL_LIGHTING); +- float var10 = 2.0F / 16.0F; ++ float var10 = 0.125F; + float var11 = (float)(this.posX - interpPosX); + float var12 = (float)(this.posY - interpPosY); + float var13 = (float)(this.posZ - interpPosZ); +@@ -33,23 +34,26 @@ + this.currentFootSteps.bindTexture(field_110126_a); + GL11.glEnable(GL11.GL_BLEND); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); +- var1.startDrawingQuads(); +- var1.setColorRGBA_F(var14, var14, var14, var9); +- var1.addVertexWithUV((double)(var11 - var10), (double)var12, (double)(var13 + var10), 0.0D, 1.0D); +- var1.addVertexWithUV((double)(var11 + var10), (double)var12, (double)(var13 + var10), 1.0D, 1.0D); +- var1.addVertexWithUV((double)(var11 + var10), (double)var12, (double)(var13 - var10), 1.0D, 0.0D); +- var1.addVertexWithUV((double)(var11 - var10), (double)var12, (double)(var13 - var10), 0.0D, 0.0D); +- var1.draw(); ++ par1Tessellator.startDrawingQuads(); ++ par1Tessellator.setColorRGBA_F(var14, var14, var14, var9); ++ par1Tessellator.addVertexWithUV((double)(var11 - var10), (double)var12, (double)(var13 + var10), 0.0D, 1.0D); ++ par1Tessellator.addVertexWithUV((double)(var11 + var10), (double)var12, (double)(var13 + var10), 1.0D, 1.0D); ++ par1Tessellator.addVertexWithUV((double)(var11 + var10), (double)var12, (double)(var13 - var10), 1.0D, 0.0D); ++ par1Tessellator.addVertexWithUV((double)(var11 - var10), (double)var12, (double)(var13 - var10), 0.0D, 0.0D); ++ par1Tessellator.draw(); + GL11.glDisable(GL11.GL_BLEND); + GL11.glEnable(GL11.GL_LIGHTING); + } + ++ /** ++ * Called to update the entity's position/logic. ++ */ + public void onUpdate() { + ++this.footstepAge; +- if(this.footstepAge == this.footstepMaxAge) { ++ ++ if (this.footstepAge == this.footstepMaxAge) { + this.setDead(); + } +- + } + + public int getFXLayer() { diff --git a/patches/net/minecraft/src/EntityGhast.java.patch b/patches/net/minecraft/src/EntityGhast.java.patch new file mode 100644 index 0000000..0852a20 --- /dev/null +++ b/patches/net/minecraft/src/EntityGhast.java.patch @@ -0,0 +1,308 @@ +--- net/minecraft/src/EntityGhast.java ++++ net/minecraft/src/EntityGhast.java +@@ -1,18 +1,26 @@ + package net.minecraft.src; + ++//Spout Start ++import org.spoutcraft.api.entity.EntitySkinType; ++//Spout End ++ + public class EntityGhast extends EntityFlying implements IMob { + public int courseChangeCooldown; + public double waypointX; + public double waypointY; + public double waypointZ; + private Entity targetedEntity; ++ ++ /** Cooldown time between target loss and new target aquirement. */ + private int aggroCooldown; + public int prevAttackCounter; + public int attackCounter; ++ ++ /** The explosion radius of spawned fireballs. */ + private int explosionStrength = 1; + +- public EntityGhast(World var1) { +- super(var1); ++ public EntityGhast(World par1World) { ++ super(par1World); + this.setSize(4.0F, 4.0F); + this.isImmuneToFire = true; + this.experienceValue = 5; +@@ -21,16 +29,19 @@ + public boolean func_110182_bF() { + return this.dataWatcher.getWatchableObjectByte(16) != 0; + } +- +- public boolean attackEntityFrom(DamageSource var1, float var2) { +- if(this.isEntityInvulnerable()) { ++ ++ /** ++ * Called when the entity is attacked. ++ */ ++ public boolean attackEntityFrom(DamageSource par1DamageSource, float par2) { ++ if (this.isEntityInvulnerable()) { + return false; +- } else if("fireball".equals(var1.getDamageType()) && var1.getEntity() instanceof EntityPlayer) { +- super.attackEntityFrom(var1, 1000.0F); +- ((EntityPlayer)var1.getEntity()).triggerAchievement(AchievementList.ghast); ++ } else if ("fireball".equals(par1DamageSource.getDamageType()) && par1DamageSource.getEntity() instanceof EntityPlayer) { ++ super.attackEntityFrom(par1DamageSource, 1000.0F); ++ ((EntityPlayer)par1DamageSource.getEntity()).triggerAchievement(AchievementList.ghast); + return true; + } else { +- return super.attackEntityFrom(var1, var2); ++ return super.attackEntityFrom(par1DamageSource, par2); + } + } + +@@ -44,8 +55,21 @@ + this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setAttribute(10.0D); + } + ++ /** ++ * Called to update the entity's position/logic. ++ */ ++ ++ public void onUpdate() { ++ super.onUpdate(); ++ byte var1 = this.dataWatcher.getWatchableObjectByte(16); ++ this.texture = var1 == 1 ? "/mob/ghast_fire.png" : "/mob/ghast.png"; ++ // Spout Start ++ setTextureToRender((byte) (var1 == 1 ? EntitySkinType.GHAST_MOUTH.getId() : 0)); ++ // Spout End ++ } ++ + protected void updateEntityActionState() { +- if(!this.worldObj.isRemote && this.worldObj.difficultySetting == 0) { ++ if (!this.worldObj.isRemote && this.worldObj.difficultySetting == 0) { + this.setDead(); + } + +@@ -55,16 +79,18 @@ + double var3 = this.waypointY - this.posY; + double var5 = this.waypointZ - this.posZ; + double var7 = var1 * var1 + var3 * var3 + var5 * var5; +- if(var7 < 1.0D || var7 > 3600.0D) { +- this.waypointX = this.posX + (double)((this.ab.nextFloat() * 2.0F - 1.0F) * 16.0F); +- this.waypointY = this.posY + (double)((this.ab.nextFloat() * 2.0F - 1.0F) * 16.0F); +- this.waypointZ = this.posZ + (double)((this.ab.nextFloat() * 2.0F - 1.0F) * 16.0F); ++ ++ if (var7 < 1.0D || var7 > 3600.0D) { ++ this.waypointX = this.posX + (double)((this.rand.nextFloat() * 2.0F - 1.0F) * 16.0F); ++ this.waypointY = this.posY + (double)((this.rand.nextFloat() * 2.0F - 1.0F) * 16.0F); ++ this.waypointZ = this.posZ + (double)((this.rand.nextFloat() * 2.0F - 1.0F) * 16.0F); + } + +- if(this.courseChangeCooldown-- <= 0) { +- this.courseChangeCooldown += this.ab.nextInt(5) + 2; ++ if (this.courseChangeCooldown-- <= 0) { ++ this.courseChangeCooldown += this.rand.nextInt(5) + 2; + var7 = (double)MathHelper.sqrt_double(var7); +- if(this.isCourseTraversable(this.waypointX, this.waypointY, this.waypointZ, var7)) { ++ ++ if (this.isCourseTraversable(this.waypointX, this.waypointY, this.waypointZ, var7)) { + this.motionX += var1 / var7 * 0.1D; + this.motionY += var3 / var7 * 0.1D; + this.motionZ += var5 / var7 * 0.1D; +@@ -75,30 +101,34 @@ + } + } + +- if(this.targetedEntity != null && this.targetedEntity.isDead) { ++ if (this.targetedEntity != null && this.targetedEntity.isDead) { + this.targetedEntity = null; + } + +- if(this.targetedEntity == null || this.aggroCooldown-- <= 0) { ++ if (this.targetedEntity == null || this.aggroCooldown-- <= 0) { + this.targetedEntity = this.worldObj.getClosestVulnerablePlayerToEntity(this, 100.0D); +- if(this.targetedEntity != null) { ++ ++ if (this.targetedEntity != null) { + this.aggroCooldown = 20; + } + } + + double var9 = 64.0D; +- if(this.targetedEntity != null && this.targetedEntity.getDistanceSqToEntity(this) < var9 * var9) { ++ ++ if (this.targetedEntity != null && this.targetedEntity.getDistanceSqToEntity(this) < var9 * var9) { + double var11 = this.targetedEntity.posX - this.posX; + double var13 = this.targetedEntity.boundingBox.minY + (double)(this.targetedEntity.height / 2.0F) - (this.posY + (double)(this.height / 2.0F)); + double var15 = this.targetedEntity.posZ - this.posZ; + this.renderYawOffset = this.rotationYaw = -((float)Math.atan2(var11, var15)) * 180.0F / (float)Math.PI; +- if(this.canEntityBeSeen(this.targetedEntity)) { +- if(this.attackCounter == 10) { ++ ++ if (this.canEntityBeSeen(this.targetedEntity)) { ++ if (this.attackCounter == 10) { + this.worldObj.playAuxSFXAtEntity((EntityPlayer)null, 1007, (int)this.posX, (int)this.posY, (int)this.posZ, 0); + } + + ++this.attackCounter; +- if(this.attackCounter == 20) { ++ ++ if (this.attackCounter == 20) { + this.worldObj.playAuxSFXAtEntity((EntityPlayer)null, 1008, (int)this.posX, (int)this.posY, (int)this.posZ, 0); + EntityLargeFireball var17 = new EntityLargeFireball(this.worldObj, this, var11, var13, var15); + var17.field_92057_e = this.explosionStrength; +@@ -110,35 +140,40 @@ + this.worldObj.spawnEntityInWorld(var17); + this.attackCounter = -40; + } +- } else if(this.attackCounter > 0) { ++ } else if (this.attackCounter > 0) { + --this.attackCounter; + } + } else { + this.renderYawOffset = this.rotationYaw = -((float)Math.atan2(this.motionX, this.motionZ)) * 180.0F / (float)Math.PI; +- if(this.attackCounter > 0) { ++ ++ if (this.attackCounter > 0) { + --this.attackCounter; + } + } + +- if(!this.worldObj.isRemote) { ++ if (!this.worldObj.isRemote) { + byte var21 = this.dataWatcher.getWatchableObjectByte(16); + byte var12 = (byte)(this.attackCounter > 10 ? 1 : 0); +- if(var21 != var12) { ++ ++ if (var21 != var12) { + this.dataWatcher.updateObject(16, Byte.valueOf(var12)); + } + } +- + } + +- private boolean isCourseTraversable(double var1, double var3, double var5, double var7) { +- double var9 = (this.waypointX - this.posX) / var7; +- double var11 = (this.waypointY - this.posY) / var7; +- double var13 = (this.waypointZ - this.posZ) / var7; ++ /** ++ * True if the ghast has an unobstructed line of travel to the waypoint. ++ */ ++ private boolean isCourseTraversable(double par1, double par3, double par5, double par7) { ++ double var9 = (this.waypointX - this.posX) / par7; ++ double var11 = (this.waypointY - this.posY) / par7; ++ double var13 = (this.waypointZ - this.posZ) / par7; + AxisAlignedBB var15 = this.boundingBox.copy(); + +- for(int var16 = 1; (double)var16 < var7; ++var16) { ++ for (int var16 = 1; (double)var16 < par7; ++var16) { + var15.offset(var9, var11, var13); +- if(!this.worldObj.getCollidingBoundingBoxes(this, var15).isEmpty()) { ++ ++ if (!this.worldObj.getCollidingBoundingBoxes(this, var15).isEmpty()) { + return false; + } + } +@@ -146,60 +181,90 @@ + return true; + } + ++ /** ++ * Returns the sound this mob makes while it's alive. ++ */ + protected String getLivingSound() { + return "mob.ghast.moan"; + } + ++ /** ++ * Returns the sound this mob makes when it is hurt. ++ */ + protected String getHurtSound() { + return "mob.ghast.scream"; + } + ++ /** ++ * Returns the sound this mob makes on death. ++ */ + protected String getDeathSound() { + return "mob.ghast.death"; + } + ++ /** ++ * Returns the item ID for the item the mob drops on death. ++ */ + protected int getDropItemId() { + return Item.gunpowder.itemID; + } + +- protected void dropFewItems(boolean var1, int var2) { +- int var3 = this.ab.nextInt(2) + this.ab.nextInt(1 + var2); +- ++ /** ++ * Drop 0-2 items of this living's type. @param par1 - Whether this entity has recently been hit by a player. @param ++ * par2 - Level of Looting used to kill this mob. ++ */ ++ protected void dropFewItems(boolean par1, int par2) { ++ int var3 = this.rand.nextInt(2) + this.rand.nextInt(1 + par2); + int var4; +- for(var4 = 0; var4 < var3; ++var4) { ++ ++ for (var4 = 0; var4 < var3; ++var4) { + this.dropItem(Item.ghastTear.itemID, 1); + } + +- var3 = this.ab.nextInt(3) + this.ab.nextInt(1 + var2); ++ var3 = this.rand.nextInt(3) + this.rand.nextInt(1 + par2); + +- for(var4 = 0; var4 < var3; ++var4) { ++ for (var4 = 0; var4 < var3; ++var4) { + this.dropItem(Item.gunpowder.itemID, 1); + } +- + } + ++ /** ++ * Returns the volume for the sounds this mob makes. ++ */ + protected float getSoundVolume() { + return 10.0F; + } + ++ /** ++ * Checks if the entity's current position is a valid location to spawn this entity. ++ */ + public boolean getCanSpawnHere() { +- return this.ab.nextInt(20) == 0 && super.getCanSpawnHere() && this.worldObj.difficultySetting > 0; ++ return this.rand.nextInt(20) == 0 && super.getCanSpawnHere() && this.worldObj.difficultySetting > 0; + } + ++ /** ++ * Will return how many at most can spawn in a chunk at once. ++ */ + public int getMaxSpawnedInChunk() { + return 1; + } + +- public void writeEntityToNBT(NBTTagCompound var1) { +- super.writeEntityToNBT(var1); +- var1.setInteger("ExplosionPower", this.explosionStrength); ++ /** ++ * (abstract) Protected helper method to write subclass entity data to NBT. ++ */ ++ public void writeEntityToNBT(NBTTagCompound par1NBTTagCompound) { ++ super.writeEntityToNBT(par1NBTTagCompound); ++ par1NBTTagCompound.setInteger("ExplosionPower", this.explosionStrength); + } + +- public void readEntityFromNBT(NBTTagCompound var1) { +- super.readEntityFromNBT(var1); +- if(var1.hasKey("ExplosionPower")) { +- this.explosionStrength = var1.getInteger("ExplosionPower"); ++ /** ++ * (abstract) Protected helper method to read subclass entity data from NBT. ++ */ ++ public void readEntityFromNBT(NBTTagCompound par1NBTTagCompound) { ++ super.readEntityFromNBT(par1NBTTagCompound); ++ ++ if (par1NBTTagCompound.hasKey("ExplosionPower")) { ++ this.explosionStrength = par1NBTTagCompound.getInteger("ExplosionPower"); + } +- + } + } diff --git a/patches/net/minecraft/src/EntityGiantZombie.java.patch b/patches/net/minecraft/src/EntityGiantZombie.java.patch new file mode 100644 index 0000000..94bbb2d --- /dev/null +++ b/patches/net/minecraft/src/EntityGiantZombie.java.patch @@ -0,0 +1,27 @@ +--- net/minecraft/src/EntityGiantZombie.java ++++ net/minecraft/src/EntityGiantZombie.java +@@ -1,8 +1,8 @@ + package net.minecraft.src; + + public class EntityGiantZombie extends EntityMob { +- public EntityGiantZombie(World var1) { +- super(var1); ++ public EntityGiantZombie(World par1World) { ++ super(par1World); + this.yOffset *= 6.0F; + this.setSize(this.width * 6.0F, this.height * 6.0F); + } +@@ -14,7 +14,11 @@ + this.getEntityAttribute(SharedMonsterAttributes.attackDamage).setAttribute(50.0D); + } + +- public float getBlockPathWeight(int var1, int var2, int var3) { +- return this.worldObj.getLightBrightness(var1, var2, var3) - 0.5F; ++ /** ++ * Takes a coordinate in and returns a weight to determine how likely this creature will try to path to the block. ++ * Args: x, y, z ++ */ ++ public float getBlockPathWeight(int par1, int par2, int par3) { ++ return this.worldObj.getLightBrightness(par1, par2, par3) - 0.5F; + } + } diff --git a/patches/net/minecraft/src/EntityGolem.java.patch b/patches/net/minecraft/src/EntityGolem.java.patch new file mode 100644 index 0000000..9721260 --- /dev/null +++ b/patches/net/minecraft/src/EntityGolem.java.patch @@ -0,0 +1,56 @@ +--- net/minecraft/src/EntityGolem.java ++++ net/minecraft/src/EntityGolem.java +@@ -1,29 +1,46 @@ + package net.minecraft.src; + + public abstract class EntityGolem extends EntityCreature implements IAnimals { +- public EntityGolem(World var1) { +- super(var1); +- } +- +- protected void fall(float var1) { +- } +- ++ public EntityGolem(World par1World) { ++ super(par1World); ++ } ++ ++ /** ++ * Called when the mob is falling. Calculates and applies fall damage. ++ */ ++ protected void fall(float par1) {} ++ ++ /** ++ * Returns the sound this mob makes while it's alive. ++ */ + protected String getLivingSound() { + return "none"; + } + ++ /** ++ * Returns the sound this mob makes when it is hurt. ++ */ + protected String getHurtSound() { + return "none"; + } + ++ /** ++ * Returns the sound this mob makes on death. ++ */ + protected String getDeathSound() { + return "none"; + } + ++ /** ++ * Get number of ticks, at least during which the living entity will be silent. ++ */ + public int getTalkInterval() { + return 120; + } + ++ /** ++ * Determines if an entity can be despawned, used on idle far away entities ++ */ + protected boolean canDespawn() { + return false; + } diff --git a/patches/net/minecraft/src/EntityHanging.java.patch b/patches/net/minecraft/src/EntityHanging.java.patch new file mode 100644 index 0000000..7c42a99 --- /dev/null +++ b/patches/net/minecraft/src/EntityHanging.java.patch @@ -0,0 +1,380 @@ +--- net/minecraft/src/EntityHanging.java ++++ net/minecraft/src/EntityHanging.java +@@ -10,33 +10,33 @@ + public int yPosition; + public int zPosition; + +- public EntityHanging(World var1) { +- super(var1); ++ public EntityHanging(World par1World) { ++ super(par1World); + this.yOffset = 0.0F; + this.setSize(0.5F, 0.5F); + } + +- public EntityHanging(World var1, int var2, int var3, int var4, int var5) { +- this(var1); +- this.xPosition = var2; +- this.yPosition = var3; +- this.zPosition = var4; +- } +- +- protected void entityInit() { +- } +- +- public void setDirection(int var1) { +- this.hangingDirection = var1; +- this.prevRotationYaw = this.rotationYaw = (float)(var1 * 90); ++ public EntityHanging(World par1World, int par2, int par3, int par4, int par5) { ++ this(par1World); ++ this.xPosition = par2; ++ this.yPosition = par3; ++ this.zPosition = par4; ++ } ++ ++ protected void entityInit() {} ++ ++ public void setDirection(int par1) { ++ this.hangingDirection = par1; ++ this.prevRotationYaw = this.rotationYaw = (float)(par1 * 90); + float var2 = (float)this.getWidthPixels(); + float var3 = (float)this.getHeightPixels(); + float var4 = (float)this.getWidthPixels(); +- if(var1 != 2 && var1 != 0) { ++ ++ if (par1 != 2 && par1 != 0) { + var2 = 0.5F; + } else { + var4 = 0.5F; +- this.rotationYaw = this.prevRotationYaw = (float)(Direction.rotateOpposite[var1] * 90); ++ this.rotationYaw = this.prevRotationYaw = (float)(Direction.rotateOpposite[par1] * 90); + } + + var2 /= 32.0F; +@@ -45,36 +45,37 @@ + float var5 = (float)this.xPosition + 0.5F; + float var6 = (float)this.yPosition + 0.5F; + float var7 = (float)this.zPosition + 0.5F; +- float var8 = 9.0F / 16.0F; +- if(var1 == 2) { ++ float var8 = 0.5625F; ++ ++ if (par1 == 2) { + var7 -= var8; + } + +- if(var1 == 1) { ++ if (par1 == 1) { + var5 -= var8; + } + +- if(var1 == 0) { ++ if (par1 == 0) { + var7 += var8; + } + +- if(var1 == 3) { ++ if (par1 == 3) { + var5 += var8; + } + +- if(var1 == 2) { ++ if (par1 == 2) { + var5 -= this.func_70517_b(this.getWidthPixels()); + } + +- if(var1 == 1) { ++ if (par1 == 1) { + var7 += this.func_70517_b(this.getWidthPixels()); + } + +- if(var1 == 0) { ++ if (par1 == 0) { + var5 += this.func_70517_b(this.getWidthPixels()); + } + +- if(var1 == 3) { ++ if (par1 == 3) { + var7 -= this.func_70517_b(this.getWidthPixels()); + } + +@@ -84,26 +85,33 @@ + this.boundingBox.setBounds((double)(var5 - var2 - var9), (double)(var6 - var3 - var9), (double)(var7 - var4 - var9), (double)(var5 + var2 + var9), (double)(var6 + var3 + var9), (double)(var7 + var4 + var9)); + } + +- private float func_70517_b(int var1) { +- return var1 == 32 ? 0.5F : (var1 == 64 ? 0.5F : 0.0F); ++ private float func_70517_b(int par1) { ++ return par1 == 32 ? 0.5F : (par1 == 64 ? 0.5F : 0.0F); + } + ++ /** ++ * Called to update the entity's position/logic. ++ */ + public void onUpdate() { + this.prevPosX = this.posX; + this.prevPosY = this.posY; + this.prevPosZ = this.posZ; +- if(this.tickCounter1++ == 100 && !this.worldObj.isRemote) { ++ ++ if (this.tickCounter1++ == 100 && !this.worldObj.isRemote) { + this.tickCounter1 = 0; +- if(!this.isDead && !this.onValidSurface()) { ++ ++ if (!this.isDead && !this.onValidSurface()) { + this.setDead(); + this.onBroken((Entity)null); + } + } +- + } + ++ /** ++ * checks to make sure painting can be placed there ++ */ + public boolean onValidSurface() { +- if(!this.worldObj.getCollidingBoundingBoxes(this, this.boundingBox).isEmpty()) { ++ if (!this.worldObj.getCollidingBoundingBoxes(this, this.boundingBox).isEmpty()) { + return false; + } else { + int var1 = Math.max(1, this.getWidthPixels() / 16); +@@ -111,34 +119,36 @@ + int var3 = this.xPosition; + int var4 = this.yPosition; + int var5 = this.zPosition; +- if(this.hangingDirection == 2) { ++ ++ if (this.hangingDirection == 2) { + var3 = MathHelper.floor_double(this.posX - (double)((float)this.getWidthPixels() / 32.0F)); + } + +- if(this.hangingDirection == 1) { ++ if (this.hangingDirection == 1) { + var5 = MathHelper.floor_double(this.posZ - (double)((float)this.getWidthPixels() / 32.0F)); + } + +- if(this.hangingDirection == 0) { ++ if (this.hangingDirection == 0) { + var3 = MathHelper.floor_double(this.posX - (double)((float)this.getWidthPixels() / 32.0F)); + } + +- if(this.hangingDirection == 3) { ++ if (this.hangingDirection == 3) { + var5 = MathHelper.floor_double(this.posZ - (double)((float)this.getWidthPixels() / 32.0F)); + } + + var4 = MathHelper.floor_double(this.posY - (double)((float)this.getHeightPixels() / 32.0F)); + +- for(int var6 = 0; var6 < var1; ++var6) { +- for(int var7 = 0; var7 < var2; ++var7) { ++ for (int var6 = 0; var6 < var1; ++var6) { ++ for (int var7 = 0; var7 < var2; ++var7) { + Material var8; +- if(this.hangingDirection != 2 && this.hangingDirection != 0) { ++ ++ if (this.hangingDirection != 2 && this.hangingDirection != 0) { + var8 = this.worldObj.getBlockMaterial(this.xPosition, var4 + var7, var5 + var6); + } else { + var8 = this.worldObj.getBlockMaterial(var3 + var6, var4 + var7, this.zPosition); + } + +- if(!var8.isSolid()) { ++ if (!var8.isSolid()) { + return false; + } + } +@@ -146,101 +156,126 @@ + + List var9 = this.worldObj.getEntitiesWithinAABBExcludingEntity(this, this.boundingBox); + Iterator var10 = var9.iterator(); +- + Entity var11; ++ + do { +- if(!var10.hasNext()) { ++ if (!var10.hasNext()) { + return true; + } + + var11 = (Entity)var10.next(); +- } while(!(var11 instanceof EntityHanging)); ++ } while (!(var11 instanceof EntityHanging)); + + return false; + } + } + ++ /** ++ * Returns true if other Entities should be prevented from moving through this Entity. ++ */ + public boolean canBeCollidedWith() { + return true; + } + +- public boolean hitByEntity(Entity var1) { +- return var1 instanceof EntityPlayer ? this.attackEntityFrom(DamageSource.causePlayerDamage((EntityPlayer)var1), 0.0F) : false; ++ /** ++ * Called when a player attacks an entity. If this returns true the attack will not happen. ++ */ ++ public boolean hitByEntity(Entity par1Entity) { ++ return par1Entity instanceof EntityPlayer ? this.attackEntityFrom(DamageSource.causePlayerDamage((EntityPlayer)par1Entity), 0.0F) : false; + } + +- public boolean attackEntityFrom(DamageSource var1, float var2) { +- if(this.isEntityInvulnerable()) { ++ /** ++ * Called when the entity is attacked. ++ */ ++ public boolean attackEntityFrom(DamageSource par1DamageSource, float par2) { ++ if (this.isEntityInvulnerable()) { + return false; + } else { +- if(!this.isDead && !this.worldObj.isRemote) { ++ if (!this.isDead && !this.worldObj.isRemote) { + this.setDead(); + this.setBeenAttacked(); +- this.onBroken(var1.getEntity()); ++ this.onBroken(par1DamageSource.getEntity()); + } + + return true; + } + } + +- public void moveEntity(double var1, double var3, double var5) { +- if(!this.worldObj.isRemote && !this.isDead && var1 * var1 + var3 * var3 + var5 * var5 > 0.0D) { +- this.setDead(); +- this.onBroken((Entity)null); +- } +- +- } +- +- public void addVelocity(double var1, double var3, double var5) { +- if(!this.worldObj.isRemote && !this.isDead && var1 * var1 + var3 * var3 + var5 * var5 > 0.0D) { +- this.setDead(); +- this.onBroken((Entity)null); +- } +- +- } +- +- public void writeEntityToNBT(NBTTagCompound var1) { +- var1.setByte("Direction", (byte)this.hangingDirection); +- var1.setInteger("TileX", this.xPosition); +- var1.setInteger("TileY", this.yPosition); +- var1.setInteger("TileZ", this.zPosition); +- switch(this.hangingDirection) { +- case 0: +- var1.setByte("Dir", (byte)2); +- break; +- case 1: +- var1.setByte("Dir", (byte)1); +- break; +- case 2: +- var1.setByte("Dir", (byte)0); +- break; +- case 3: +- var1.setByte("Dir", (byte)3); +- } +- +- } +- +- public void readEntityFromNBT(NBTTagCompound var1) { +- if(var1.hasKey("Direction")) { +- this.hangingDirection = var1.getByte("Direction"); +- } else { +- switch(var1.getByte("Dir")) { ++ /** ++ * Tries to moves the entity by the passed in displacement. Args: x, y, z ++ */ ++ public void moveEntity(double par1, double par3, double par5) { ++ if (!this.worldObj.isRemote && !this.isDead && par1 * par1 + par3 * par3 + par5 * par5 > 0.0D) { ++ this.setDead(); ++ this.onBroken((Entity)null); ++ } ++ } ++ ++ /** ++ * Adds to the current velocity of the entity. Args: x, y, z ++ */ ++ public void addVelocity(double par1, double par3, double par5) { ++ if (!this.worldObj.isRemote && !this.isDead && par1 * par1 + par3 * par3 + par5 * par5 > 0.0D) { ++ this.setDead(); ++ this.onBroken((Entity)null); ++ } ++ } ++ ++ /** ++ * (abstract) Protected helper method to write subclass entity data to NBT. ++ */ ++ public void writeEntityToNBT(NBTTagCompound par1NBTTagCompound) { ++ par1NBTTagCompound.setByte("Direction", (byte)this.hangingDirection); ++ par1NBTTagCompound.setInteger("TileX", this.xPosition); ++ par1NBTTagCompound.setInteger("TileY", this.yPosition); ++ par1NBTTagCompound.setInteger("TileZ", this.zPosition); ++ ++ switch (this.hangingDirection) { + case 0: +- this.hangingDirection = 2; ++ par1NBTTagCompound.setByte("Dir", (byte)2); + break; ++ + case 1: +- this.hangingDirection = 1; ++ par1NBTTagCompound.setByte("Dir", (byte)1); + break; ++ + case 2: +- this.hangingDirection = 0; ++ par1NBTTagCompound.setByte("Dir", (byte)0); + break; ++ + case 3: +- this.hangingDirection = 3; ++ par1NBTTagCompound.setByte("Dir", (byte)3); ++ } ++ } ++ ++ /** ++ * (abstract) Protected helper method to read subclass entity data from NBT. ++ */ ++ public void readEntityFromNBT(NBTTagCompound par1NBTTagCompound) { ++ if (par1NBTTagCompound.hasKey("Direction")) { ++ this.hangingDirection = par1NBTTagCompound.getByte("Direction"); ++ } else { ++ switch (par1NBTTagCompound.getByte("Dir")) { ++ case 0: ++ this.hangingDirection = 2; ++ break; ++ ++ case 1: ++ this.hangingDirection = 1; ++ break; ++ ++ case 2: ++ this.hangingDirection = 0; ++ break; ++ ++ case 3: ++ this.hangingDirection = 3; + } + } + +- this.xPosition = var1.getInteger("TileX"); +- this.yPosition = var1.getInteger("TileY"); +- this.zPosition = var1.getInteger("TileZ"); ++ this.xPosition = par1NBTTagCompound.getInteger("TileX"); ++ this.yPosition = par1NBTTagCompound.getInteger("TileY"); ++ this.zPosition = par1NBTTagCompound.getInteger("TileZ"); + this.setDirection(this.hangingDirection); + } + +@@ -248,6 +283,9 @@ + + public abstract int getHeightPixels(); + ++ /** ++ * Called when this entity is broken. Entity parameter may be null. ++ */ + public abstract void onBroken(Entity var1); + + protected boolean shouldSetPosAfterLoading() { diff --git a/patches/net/minecraft/src/EntityHeartFX.java.patch b/patches/net/minecraft/src/EntityHeartFX.java.patch new file mode 100644 index 0000000..36dc004 --- /dev/null +++ b/patches/net/minecraft/src/EntityHeartFX.java.patch @@ -0,0 +1,91 @@ +--- net/minecraft/src/EntityHeartFX.java ++++ net/minecraft/src/EntityHeartFX.java +@@ -3,59 +3,65 @@ + public class EntityHeartFX extends EntityFX { + float particleScaleOverTime; + +- public EntityHeartFX(World var1, double var2, double var4, double var6, double var8, double var10, double var12) { +- this(var1, var2, var4, var6, var8, var10, var12, 2.0F); ++ public EntityHeartFX(World par1World, double par2, double par4, double par6, double par8, double par10, double par12) { ++ this(par1World, par2, par4, par6, par8, par10, par12, 2.0F); + } + +- public EntityHeartFX(World var1, double var2, double var4, double var6, double var8, double var10, double var12, float var14) { +- super(var1, var2, var4, var6, 0.0D, 0.0D, 0.0D); +- this.motionX *= (double)0.01F; +- this.motionY *= (double)0.01F; +- this.motionZ *= (double)0.01F; ++ public EntityHeartFX(World par1World, double par2, double par4, double par6, double par8, double par10, double par12, float par14) { ++ super(par1World, par2, par4, par6, 0.0D, 0.0D, 0.0D); ++ this.motionX *= 0.009999999776482582D; ++ this.motionY *= 0.009999999776482582D; ++ this.motionZ *= 0.009999999776482582D; + this.motionY += 0.1D; +- this.particleScale *= 12.0F / 16.0F; +- this.particleScale *= var14; ++ this.particleScale *= 0.75F; ++ this.particleScale *= par14; + this.particleScaleOverTime = this.particleScale; + this.particleMaxAge = 16; + this.noClip = false; + this.setParticleTextureIndex(80); + } + +- public void renderParticle(Tessellator var1, float var2, float var3, float var4, float var5, float var6, float var7) { +- float var8 = ((float)this.particleAge + var2) / (float)this.particleMaxAge * 32.0F; +- if(var8 < 0.0F) { ++ public void renderParticle(Tessellator par1Tessellator, float par2, float par3, float par4, float par5, float par6, float par7) { ++ float var8 = ((float)this.particleAge + par2) / (float)this.particleMaxAge * 32.0F; ++ ++ if (var8 < 0.0F) { + var8 = 0.0F; + } + +- if(var8 > 1.0F) { ++ if (var8 > 1.0F) { + var8 = 1.0F; + } + + this.particleScale = this.particleScaleOverTime * var8; +- super.renderParticle(var1, var2, var3, var4, var5, var6, var7); ++ super.renderParticle(par1Tessellator, par2, par3, par4, par5, par6, par7); + } + ++ /** ++ * Called to update the entity's position/logic. ++ */ + public void onUpdate() { + this.prevPosX = this.posX; + this.prevPosY = this.posY; + this.prevPosZ = this.posZ; +- if(this.particleAge++ >= this.particleMaxAge) { ++ ++ if (this.particleAge++ >= this.particleMaxAge) { + this.setDead(); + } + + this.moveEntity(this.motionX, this.motionY, this.motionZ); +- if(this.posY == this.prevPosY) { ++ ++ if (this.posY == this.prevPosY) { + this.motionX *= 1.1D; + this.motionZ *= 1.1D; + } + +- this.motionX *= (double)0.86F; +- this.motionY *= (double)0.86F; +- this.motionZ *= (double)0.86F; +- if(this.onGround) { +- this.motionX *= (double)0.7F; +- this.motionZ *= (double)0.7F; +- } ++ this.motionX *= 0.8600000143051147D; ++ this.motionY *= 0.8600000143051147D; ++ this.motionZ *= 0.8600000143051147D; + ++ if (this.onGround) { ++ this.motionX *= 0.699999988079071D; ++ this.motionZ *= 0.699999988079071D; ++ } + } + } diff --git a/patches/net/minecraft/src/EntityHorse.java.patch b/patches/net/minecraft/src/EntityHorse.java.patch new file mode 100644 index 0000000..7ec21c7 --- /dev/null +++ b/patches/net/minecraft/src/EntityHorse.java.patch @@ -0,0 +1,1672 @@ +--- net/minecraft/src/EntityHorse.java ++++ net/minecraft/src/EntityHorse.java +@@ -6,13 +6,13 @@ + public class EntityHorse extends EntityAnimal implements IInvBasic { + private static final IEntitySelector horseBreedingSelector = new EntityHorseBredSelector(); + private static final Attribute horseJumpStrength = (new RangedAttribute("horse.jumpStrength", 0.7D, 0.0D, 2.0D)).func_111117_a("Jump Strength").setShouldWatch(true); +- private static final String[] bw = new String[]{null, "textures/entity/horse/armor/horse_armor_iron.png", "textures/entity/horse/armor/horse_armor_gold.png", "textures/entity/horse/armor/horse_armor_diamond.png"}; +- private static final String[] bx = new String[]{"", "meo", "goo", "dio"}; +- private static final int[] armorValues = new int[]{0, 5, 7, 11}; +- private static final String[] bz = new String[]{"textures/entity/horse/horse_white.png", "textures/entity/horse/horse_creamy.png", "textures/entity/horse/horse_chestnut.png", "textures/entity/horse/horse_brown.png", "textures/entity/horse/horse_black.png", "textures/entity/horse/horse_gray.png", "textures/entity/horse/horse_darkbrown.png"}; +- private static final String[] bA = new String[]{"hwh", "hcr", "hch", "hbr", "hbl", "hgr", "hdb"}; +- private static final String[] bB = new String[]{null, "textures/entity/horse/horse_markings_white.png", "textures/entity/horse/horse_markings_whitefield.png", "textures/entity/horse/horse_markings_whitedots.png", "textures/entity/horse/horse_markings_blackdots.png"}; +- private static final String[] bC = new String[]{"", "wo_", "wmo", "wdo", "bdo"}; ++ private static final String[] horseArmorTextures = new String[] {null, "textures/entity/horse/armor/horse_armor_iron.png", "textures/entity/horse/armor/horse_armor_gold.png", "textures/entity/horse/armor/horse_armor_diamond.png"}; ++ private static final String[] field_110273_bx = new String[] {"", "meo", "goo", "dio"}; ++ private static final int[] armorValues = new int[] {0, 5, 7, 11}; ++ private static final String[] horseTextures = new String[] {"textures/entity/horse/horse_white.png", "textures/entity/horse/horse_creamy.png", "textures/entity/horse/horse_chestnut.png", "textures/entity/horse/horse_brown.png", "textures/entity/horse/horse_black.png", "textures/entity/horse/horse_gray.png", "textures/entity/horse/horse_darkbrown.png"}; ++ private static final String[] field_110269_bA = new String[] {"hwh", "hcr", "hch", "hbr", "hbl", "hgr", "hdb"}; ++ private static final String[] horseMarkingTextures = new String[] {null, "textures/entity/horse/horse_markings_white.png", "textures/entity/horse/horse_markings_whitefield.png", "textures/entity/horse/horse_markings_whitedots.png", "textures/entity/horse/horse_markings_blackdots.png"}; ++ private static final String[] field_110292_bC = new String[] {"", "wo_", "wmo", "wdo", "bdo"}; + private int eatingHaystackCounter; + private int openMouthCounter; + private int jumpRearingCounter; +@@ -21,6 +21,10 @@ + protected boolean horseJumping; + private AnimalChest horseChest; + private boolean hasReproduced; ++ ++ /** ++ * "The higher this value, the more likely the horse is to be tamed next time a player rides it." ++ */ + protected int temper; + protected float jumpPower; + private boolean field_110294_bI; +@@ -31,11 +35,11 @@ + private float mouthOpenness; + private float prevMouthOpenness; + private int field_110285_bP; +- private String bQ; +- private String[] bR = new String[3]; ++ private String field_110286_bQ; ++ private String[] field_110280_bR = new String[3]; + +- public EntityHorse(World var1) { +- super(var1); ++ public EntityHorse(World par1World) { ++ super(par1World); + this.setSize(1.4F, 1.6F); + this.isImmuneToFire = false; + this.setChested(false); +@@ -60,17 +64,20 @@ + this.dataWatcher.addObject(22, Integer.valueOf(0)); + } + +- public void setHorseType(int var1) { +- this.dataWatcher.updateObject(19, Byte.valueOf((byte)var1)); ++ public void setHorseType(int par1) { ++ this.dataWatcher.updateObject(19, Byte.valueOf((byte)par1)); + this.func_110230_cF(); + } + ++ /** ++ * returns the horse type ++ */ + public int getHorseType() { + return this.dataWatcher.getWatchableObjectByte(19); + } + +- public void setHorseVariant(int var1) { +- this.dataWatcher.updateObject(20, Integer.valueOf(var1)); ++ public void setHorseVariant(int par1) { ++ this.dataWatcher.updateObject(20, Integer.valueOf(par1)); + this.func_110230_cF(); + } + +@@ -78,39 +85,47 @@ + return this.dataWatcher.getWatchableObjectInt(20); + } + ++ /** ++ * Gets the username of the entity. ++ */ + public String getEntityName() { +- if(this.hasCustomNameTag()) { ++ if (this.hasCustomNameTag()) { + return this.getCustomNameTag(); + } else { + int var1 = this.getHorseType(); +- switch(var1) { +- case 0: +- default: +- return StatCollector.translateToLocal("entity.horse.name"); +- case 1: +- return StatCollector.translateToLocal("entity.donkey.name"); +- case 2: +- return StatCollector.translateToLocal("entity.mule.name"); +- case 3: +- return StatCollector.translateToLocal("entity.zombiehorse.name"); +- case 4: +- return StatCollector.translateToLocal("entity.skeletonhorse.name"); ++ ++ switch (var1) { ++ case 0: ++ default: ++ return StatCollector.translateToLocal("entity.horse.name"); ++ ++ case 1: ++ return StatCollector.translateToLocal("entity.donkey.name"); ++ ++ case 2: ++ return StatCollector.translateToLocal("entity.mule.name"); ++ ++ case 3: ++ return StatCollector.translateToLocal("entity.zombiehorse.name"); ++ ++ case 4: ++ return StatCollector.translateToLocal("entity.skeletonhorse.name"); + } + } + } + +- private boolean getHorseWatchableBoolean(int var1) { +- return (this.dataWatcher.getWatchableObjectInt(16) & var1) != 0; ++ private boolean getHorseWatchableBoolean(int par1) { ++ return (this.dataWatcher.getWatchableObjectInt(16) & par1) != 0; + } + +- private void setHorseWatchableBoolean(int var1, boolean var2) { ++ private void setHorseWatchableBoolean(int par1, boolean par2) { + int var3 = this.dataWatcher.getWatchableObjectInt(16); +- if(var2) { +- this.dataWatcher.updateObject(16, Integer.valueOf(var3 | var1)); ++ ++ if (par2) { ++ this.dataWatcher.updateObject(16, Integer.valueOf(var3 | par1)); + } else { +- this.dataWatcher.updateObject(16, Integer.valueOf(var3 & ~var1)); ++ this.dataWatcher.updateObject(16, Integer.valueOf(var3 & ~par1)); + } +- + } + + public boolean isAdultHorse() { +@@ -129,8 +144,8 @@ + return this.dataWatcher.getWatchableObjectString(21); + } + +- public void setOwnerName(String var1) { +- this.dataWatcher.updateObject(21, var1); ++ public void setOwnerName(String par1Str) { ++ this.dataWatcher.updateObject(21, par1Str); + } + + public float getHorseSize() { +@@ -138,36 +153,37 @@ + return var1 >= 0 ? 1.0F : 0.5F + (float)(-24000 - var1) / -24000.0F * 0.5F; + } + +- public void setScaleForAge(boolean var1) { +- if(var1) { ++ /** ++ * "Sets the scale for an ageable entity according to the boolean parameter, which says if it's a child." ++ */ ++ public void setScaleForAge(boolean par1) { ++ if (par1) { + this.setScale(this.getHorseSize()); + } else { + this.setScale(1.0F); + } +- + } + + public boolean isHorseJumping() { + return this.horseJumping; + } + +- public void setHorseTamed(boolean var1) { +- this.setHorseWatchableBoolean(2, var1); ++ public void setHorseTamed(boolean par1) { ++ this.setHorseWatchableBoolean(2, par1); + } + +- public void setHorseJumping(boolean var1) { +- this.horseJumping = var1; ++ public void setHorseJumping(boolean par1) { ++ this.horseJumping = par1; + } + + public boolean allowLeashing() { + return !this.func_110256_cu() && super.allowLeashing(); + } + +- protected void func_142017_o(float var1) { +- if(var1 > 6.0F && this.isEatingHaystack()) { ++ protected void func_142017_o(float par1) { ++ if (par1 > 6.0F && this.isEatingHaystack()) { + this.setEatingHaystack(false); + } +- + } + + public boolean isChested() { +@@ -178,8 +194,11 @@ + return this.dataWatcher.getWatchableObjectInt(22); + } + +- public int getHorseArmorIndex(ItemStack var1) { +- return var1 == null ? 0 : (var1.itemID == Item.horseArmorIron.itemID ? 1 : (var1.itemID == Item.horseArmorGold.itemID ? 2 : (var1.itemID == Item.horseArmorDiamond.itemID ? 3 : 0))); ++ /** ++ * 0 = iron, 1 = gold, 2 = diamond ++ */ ++ public int getHorseArmorIndex(ItemStack par1ItemStack) { ++ return par1ItemStack == null ? 0 : (par1ItemStack.itemID == Item.horseArmorIron.itemID ? 1 : (par1ItemStack.itemID == Item.horseArmorGold.itemID ? 2 : (par1ItemStack.itemID == Item.horseArmorDiamond.itemID ? 3 : 0))); + } + + public boolean isEatingHaystack() { +@@ -198,50 +217,59 @@ + return this.hasReproduced; + } + +- public void func_110236_r(int var1) { +- this.dataWatcher.updateObject(22, Integer.valueOf(var1)); ++ public void func_110236_r(int par1) { ++ this.dataWatcher.updateObject(22, Integer.valueOf(par1)); + this.func_110230_cF(); + } + +- public void func_110242_l(boolean var1) { +- this.setHorseWatchableBoolean(16, var1); +- } +- +- public void setChested(boolean var1) { +- this.setHorseWatchableBoolean(8, var1); +- } +- +- public void setHasReproduced(boolean var1) { +- this.hasReproduced = var1; +- } +- +- public void setHorseSaddled(boolean var1) { +- this.setHorseWatchableBoolean(4, var1); ++ public void func_110242_l(boolean par1) { ++ this.setHorseWatchableBoolean(16, par1); ++ } ++ ++ public void setChested(boolean par1) { ++ this.setHorseWatchableBoolean(8, par1); ++ } ++ ++ public void setHasReproduced(boolean par1) { ++ this.hasReproduced = par1; ++ } ++ ++ public void setHorseSaddled(boolean par1) { ++ this.setHorseWatchableBoolean(4, par1); + } + + public int getTemper() { + return this.temper; + } + +- public void setTemper(int var1) { +- this.temper = var1; ++ public void setTemper(int par1) { ++ this.temper = par1; + } + +- public int increaseTemper(int var1) { +- int var2 = MathHelper.clamp_int(this.getTemper() + var1, 0, this.getMaxTemper()); ++ public int increaseTemper(int par1) { ++ int var2 = MathHelper.clamp_int(this.getTemper() + par1, 0, this.getMaxTemper()); + this.setTemper(var2); + return var2; + } + +- public boolean attackEntityFrom(DamageSource var1, float var2) { +- Entity var3 = var1.getEntity(); +- return this.riddenByEntity != null && this.riddenByEntity.equals(var3) ? false : super.attackEntityFrom(var1, var2); ++ /** ++ * Called when the entity is attacked. ++ */ ++ public boolean attackEntityFrom(DamageSource par1DamageSource, float par2) { ++ Entity var3 = par1DamageSource.getEntity(); ++ return this.riddenByEntity != null && this.riddenByEntity.equals(var3) ? false : super.attackEntityFrom(par1DamageSource, par2); + } + ++ /** ++ * Returns the current armor value as determined by a call to InventoryPlayer.getTotalArmorValue ++ */ + public int getTotalArmorValue() { + return armorValues[this.func_110241_cb()]; + } + ++ /** ++ * Returns true if this entity should push and be pushed by other entities when colliding. ++ */ + public boolean canBePushed() { + return this.riddenByEntity == null; + } +@@ -254,7 +282,7 @@ + } + + public void dropChests() { +- if(!this.worldObj.isRemote && this.isChested()) { ++ if (!this.worldObj.isRemote && this.isChested()) { + this.dropItem(Block.chest.blockID, 1); + this.setChested(false); + } +@@ -262,46 +290,53 @@ + + private void func_110266_cB() { + this.openHorseMouth(); +- this.worldObj.playSoundAtEntity(this, "eating", 1.0F, 1.0F + (this.ab.nextFloat() - this.ab.nextFloat()) * 0.2F); ++ this.worldObj.playSoundAtEntity(this, "eating", 1.0F, 1.0F + (this.rand.nextFloat() - this.rand.nextFloat()) * 0.2F); + } + +- protected void fall(float var1) { +- if(var1 > 1.0F) { ++ /** ++ * Called when the mob is falling. Calculates and applies fall damage. ++ */ ++ protected void fall(float par1) { ++ if (par1 > 1.0F) { + this.playSound("mob.horse.land", 0.4F, 1.0F); + } + +- int var2 = MathHelper.ceiling_float_int(var1 * 0.5F - 3.0F); +- if(var2 > 0) { ++ int var2 = MathHelper.ceiling_float_int(par1 * 0.5F - 3.0F); ++ ++ if (var2 > 0) { + this.attackEntityFrom(DamageSource.fall, (float)var2); +- if(this.riddenByEntity != null) { ++ ++ if (this.riddenByEntity != null) { + this.riddenByEntity.attackEntityFrom(DamageSource.fall, (float)var2); + } + + int var3 = this.worldObj.getBlockId(MathHelper.floor_double(this.posX), MathHelper.floor_double(this.posY - 0.2D - (double)this.prevRotationYaw), MathHelper.floor_double(this.posZ)); +- if(var3 > 0) { ++ ++ if (var3 > 0) { + StepSound var4 = Block.blocksList[var3].stepSound; +- this.worldObj.playSoundAtEntity(this, var4.getStepSound(), var4.getVolume() * 0.5F, var4.getPitch() * (12.0F / 16.0F)); ++ this.worldObj.playSoundAtEntity(this, var4.getStepSound(), var4.getVolume() * 0.5F, var4.getPitch() * 0.75F); + } +- + } + } + + private int func_110225_cC() { + int var1 = this.getHorseType(); +- return !this.isChested() || var1 != 1 && var1 != 2 ? 2 : 17; ++ return this.isChested() && (var1 == 1 || var1 == 2) ? 17 : 2; + } + + private void func_110226_cD() { + AnimalChest var1 = this.horseChest; + this.horseChest = new AnimalChest("HorseChest", this.func_110225_cC()); + this.horseChest.func_110133_a(this.getEntityName()); +- if(var1 != null) { ++ ++ if (var1 != null) { + var1.func_110132_b(this); + int var2 = Math.min(var1.getSizeInventory(), this.horseChest.getSizeInventory()); + +- for(int var3 = 0; var3 < var2; ++var3) { ++ for (int var3 = 0; var3 < var2; ++var3) { + ItemStack var4 = var1.getStackInSlot(var3); +- if(var4 != null) { ++ ++ if (var4 != null) { + this.horseChest.setInventorySlotContents(var3, var4.copy()); + } + } +@@ -314,46 +349,53 @@ + } + + private void func_110232_cE() { +- if(!this.worldObj.isRemote) { ++ if (!this.worldObj.isRemote) { + this.setHorseSaddled(this.horseChest.getStackInSlot(0) != null); +- if(this.func_110259_cr()) { ++ ++ if (this.func_110259_cr()) { + this.func_110236_r(this.getHorseArmorIndex(this.horseChest.getStackInSlot(1))); + } + } +- + } + +- public void onInventoryChanged(InventoryBasic var1) { ++ /** ++ * Called by InventoryBasic.onInventoryChanged() on a array that is never filled. ++ */ ++ public void onInventoryChanged(InventoryBasic par1InventoryBasic) { + int var2 = this.func_110241_cb(); + boolean var3 = this.isHorseSaddled(); + this.func_110232_cE(); +- if(this.ticksExisted > 20) { +- if(var2 == 0 && var2 != this.func_110241_cb()) { ++ ++ if (this.ticksExisted > 20) { ++ if (var2 == 0 && var2 != this.func_110241_cb()) { + this.playSound("mob.horse.armor", 0.5F, 1.0F); + } + +- if(!var3 && this.isHorseSaddled()) { ++ if (!var3 && this.isHorseSaddled()) { + this.playSound("mob.horse.leather", 0.5F, 1.0F); + } + } +- + } + ++ /** ++ * Checks if the entity's current position is a valid location to spawn this entity. ++ */ + public boolean getCanSpawnHere() { + this.prepareChunkForSpawn(); + return super.getCanSpawnHere(); + } + +- protected EntityHorse getClosestHorse(Entity var1, double var2) { ++ protected EntityHorse getClosestHorse(Entity par1Entity, double par2) { + double var4 = Double.MAX_VALUE; + Entity var6 = null; +- List var7 = this.worldObj.getEntitiesWithinAABBExcludingEntity(var1, var1.boundingBox.addCoord(var2, var2, var2), horseBreedingSelector); ++ List var7 = this.worldObj.getEntitiesWithinAABBExcludingEntity(par1Entity, par1Entity.boundingBox.addCoord(par2, par2, par2), horseBreedingSelector); + Iterator var8 = var7.iterator(); + +- while(var8.hasNext()) { ++ while (var8.hasNext()) { + Entity var9 = (Entity)var8.next(); +- double var10 = var9.getDistanceSq(var1.posX, var1.posY, var1.posZ); +- if(var10 < var4) { ++ double var10 = var9.getDistanceSq(par1Entity.posX, par1Entity.posY, par1Entity.posZ); ++ ++ if (var10 < var4) { + var6 = var9; + var4 = var10; + } +@@ -366,21 +408,31 @@ + return this.getEntityAttribute(horseJumpStrength).getAttributeValue(); + } + ++ /** ++ * Returns the sound this mob makes on death. ++ */ + protected String getDeathSound() { + this.openHorseMouth(); + int var1 = this.getHorseType(); + return var1 == 3 ? "mob.horse.zombie.death" : (var1 == 4 ? "mob.horse.skeleton.death" : (var1 != 1 && var1 != 2 ? "mob.horse.death" : "mob.horse.donkey.death")); + } + ++ /** ++ * Returns the item ID for the item the mob drops on death. ++ */ + protected int getDropItemId() { +- boolean var1 = this.ab.nextInt(4) == 0; ++ boolean var1 = this.rand.nextInt(4) == 0; + int var2 = this.getHorseType(); + return var2 == 4 ? Item.bone.itemID : (var2 == 3 ? (var1 ? 0 : Item.rottenFlesh.itemID) : Item.leather.itemID); + } + ++ /** ++ * Returns the sound this mob makes when it is hurt. ++ */ + protected String getHurtSound() { + this.openHorseMouth(); +- if(this.ab.nextInt(3) == 0) { ++ ++ if (this.rand.nextInt(3) == 0) { + this.makeHorseRear(); + } + +@@ -392,9 +444,13 @@ + return this.getHorseWatchableBoolean(4); + } + ++ /** ++ * Returns the sound this mob makes while it's alive. ++ */ + protected String getLivingSound() { + this.openHorseMouth(); +- if(this.ab.nextInt(10) == 0 && !this.isMovementBlocked()) { ++ ++ if (this.rand.nextInt(10) == 0 && !this.isMovementBlocked()) { + this.makeHorseRear(); + } + +@@ -409,40 +465,49 @@ + return var1 != 3 && var1 != 4 ? (var1 != 1 && var1 != 2 ? "mob.horse.angry" : "mob.horse.donkey.angry") : null; + } + +- protected void playStepSound(int var1, int var2, int var3, int var4) { +- StepSound var5 = Block.blocksList[var4].stepSound; +- if(this.worldObj.getBlockId(var1, var2 + 1, var3) == Block.snow.blockID) { ++ /** ++ * Plays step sound at given x, y, z for the entity ++ */ ++ protected void playStepSound(int par1, int par2, int par3, int par4) { ++ StepSound var5 = Block.blocksList[par4].stepSound; ++ ++ if (this.worldObj.getBlockId(par1, par2 + 1, par3) == Block.snow.blockID) { + var5 = Block.snow.stepSound; + } + +- if(!Block.blocksList[var4].blockMaterial.isLiquid()) { ++ if (!Block.blocksList[par4].blockMaterial.isLiquid()) { + int var6 = this.getHorseType(); +- if(this.riddenByEntity != null && var6 != 1 && var6 != 2) { ++ ++ if (this.riddenByEntity != null && var6 != 1 && var6 != 2) { + ++this.field_110285_bP; +- if(this.field_110285_bP > 5 && this.field_110285_bP % 3 == 0) { ++ ++ if (this.field_110285_bP > 5 && this.field_110285_bP % 3 == 0) { + this.playSound("mob.horse.gallop", var5.getVolume() * 0.15F, var5.getPitch()); +- if(var6 == 0 && this.ab.nextInt(10) == 0) { ++ ++ if (var6 == 0 && this.rand.nextInt(10) == 0) { + this.playSound("mob.horse.breathe", var5.getVolume() * 0.6F, var5.getPitch()); + } +- } else if(this.field_110285_bP <= 5) { ++ } else if (this.field_110285_bP <= 5) { + this.playSound("mob.horse.wood", var5.getVolume() * 0.15F, var5.getPitch()); + } +- } else if(var5 == Block.soundWoodFootstep) { ++ } else if (var5 == Block.soundWoodFootstep) { + this.playSound("mob.horse.soft", var5.getVolume() * 0.15F, var5.getPitch()); + } else { + this.playSound("mob.horse.wood", var5.getVolume() * 0.15F, var5.getPitch()); + } + } +- + } + + protected void applyEntityAttributes() { + super.applyEntityAttributes(); + this.getAttributeMap().func_111150_b(horseJumpStrength); + this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setAttribute(53.0D); +- this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setAttribute((double)0.225F); ++ this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setAttribute(0.22499999403953552D); + } + ++ /** ++ * Will return how many at most can spawn in a chunk at once. ++ */ + public int getMaxSpawnedInChunk() { + return 6; + } +@@ -451,10 +516,16 @@ + return 100; + } + ++ /** ++ * Returns the volume for the sounds this mob makes. ++ */ + protected float getSoundVolume() { + return 0.8F; + } + ++ /** ++ * Get number of ticks, at least during which the living entity will be silent. ++ */ + public int getTalkInterval() { + return 400; + } +@@ -464,156 +535,165 @@ + } + + private void func_110230_cF() { +- this.bQ = null; ++ this.field_110286_bQ = null; + } + + private void setHorseTexturePaths() { +- this.bQ = "horse/"; +- this.bR[0] = null; +- this.bR[1] = null; +- this.bR[2] = null; ++ this.field_110286_bQ = "horse/"; ++ this.field_110280_bR[0] = null; ++ this.field_110280_bR[1] = null; ++ this.field_110280_bR[2] = null; + int var1 = this.getHorseType(); + int var2 = this.getHorseVariant(); + int var3; +- if(var1 == 0) { ++ ++ if (var1 == 0) { + var3 = var2 & 255; +- int var4 = (var2 & '\uff00') >> 8; +- this.bR[0] = bz[var3]; +- this.bQ = this.bQ + bA[var3]; +- this.bR[1] = bB[var4]; +- this.bQ = this.bQ + bC[var4]; ++ int var4 = (var2 & 65280) >> 8; ++ this.field_110280_bR[0] = horseTextures[var3]; ++ this.field_110286_bQ = this.field_110286_bQ + field_110269_bA[var3]; ++ this.field_110280_bR[1] = horseMarkingTextures[var4]; ++ this.field_110286_bQ = this.field_110286_bQ + field_110292_bC[var4]; + } else { +- this.bR[0] = ""; +- this.bQ = this.bQ + "_" + var1 + "_"; ++ this.field_110280_bR[0] = ""; ++ this.field_110286_bQ = this.field_110286_bQ + "_" + var1 + "_"; + } + + var3 = this.func_110241_cb(); +- this.bR[2] = bw[var3]; +- this.bQ = this.bQ + bx[var3]; ++ this.field_110280_bR[2] = horseArmorTextures[var3]; ++ this.field_110286_bQ = this.field_110286_bQ + field_110273_bx[var3]; + } + + public String getHorseTexture() { +- if(this.bQ == null) { ++ if (this.field_110286_bQ == null) { + this.setHorseTexturePaths(); + } + +- return this.bQ; ++ return this.field_110286_bQ; + } + + public String[] getVariantTexturePaths() { +- if(this.bQ == null) { ++ if (this.field_110286_bQ == null) { + this.setHorseTexturePaths(); + } + +- return this.bR; ++ return this.field_110280_bR; + } + +- public void openGUI(EntityPlayer var1) { +- if(!this.worldObj.isRemote && (this.riddenByEntity == null || this.riddenByEntity == var1) && this.isTame()) { ++ public void openGUI(EntityPlayer par1EntityPlayer) { ++ if (!this.worldObj.isRemote && (this.riddenByEntity == null || this.riddenByEntity == par1EntityPlayer) && this.isTame()) { + this.horseChest.func_110133_a(this.getEntityName()); +- var1.displayGUIHorse(this, this.horseChest); ++ par1EntityPlayer.displayGUIHorse(this, this.horseChest); + } +- + } + +- public boolean interact(EntityPlayer var1) { +- ItemStack var2 = var1.inventory.getCurrentItem(); +- if(var2 != null && var2.itemID == Item.monsterPlacer.itemID) { +- return super.interact(var1); +- } else if(!this.isTame() && this.func_110256_cu()) { ++ /** ++ * Called when a player interacts with a mob. e.g. gets milk from a cow, gets into the saddle on a pig. ++ */ ++ public boolean interact(EntityPlayer par1EntityPlayer) { ++ ItemStack var2 = par1EntityPlayer.inventory.getCurrentItem(); ++ ++ if (var2 != null && var2.itemID == Item.monsterPlacer.itemID) { ++ return super.interact(par1EntityPlayer); ++ } else if (!this.isTame() && this.func_110256_cu()) { + return false; +- } else if(this.isTame() && this.isAdultHorse() && var1.isSneaking()) { +- this.openGUI(var1); ++ } else if (this.isTame() && this.isAdultHorse() && par1EntityPlayer.isSneaking()) { ++ this.openGUI(par1EntityPlayer); + return true; +- } else if(this.func_110253_bW() && this.riddenByEntity != null) { +- return super.interact(var1); ++ } else if (this.func_110253_bW() && this.riddenByEntity != null) { ++ return super.interact(par1EntityPlayer); + } else { +- if(var2 != null) { ++ if (var2 != null) { + boolean var3 = false; +- if(this.func_110259_cr()) { ++ ++ if (this.func_110259_cr()) { + byte var4 = -1; +- if(var2.itemID == Item.horseArmorIron.itemID) { ++ ++ if (var2.itemID == Item.horseArmorIron.itemID) { + var4 = 1; +- } else if(var2.itemID == Item.horseArmorGold.itemID) { ++ } else if (var2.itemID == Item.horseArmorGold.itemID) { + var4 = 2; +- } else if(var2.itemID == Item.horseArmorDiamond.itemID) { ++ } else if (var2.itemID == Item.horseArmorDiamond.itemID) { + var4 = 3; + } + +- if(var4 >= 0) { +- if(!this.isTame()) { ++ if (var4 >= 0) { ++ if (!this.isTame()) { + this.makeHorseRearWithSound(); + return true; + } + +- this.openGUI(var1); ++ this.openGUI(par1EntityPlayer); + return true; + } + } + +- if(!var3 && !this.func_110256_cu()) { ++ if (!var3 && !this.func_110256_cu()) { + float var7 = 0.0F; + short var5 = 0; + byte var6 = 0; +- if(var2.itemID == Item.wheat.itemID) { ++ ++ if (var2.itemID == Item.wheat.itemID) { + var7 = 2.0F; + var5 = 60; + var6 = 3; +- } else if(var2.itemID == Item.sugar.itemID) { ++ } else if (var2.itemID == Item.sugar.itemID) { + var7 = 1.0F; + var5 = 30; + var6 = 3; +- } else if(var2.itemID == Item.bread.itemID) { ++ } else if (var2.itemID == Item.bread.itemID) { + var7 = 7.0F; + var5 = 180; + var6 = 3; +- } else if(var2.itemID == Block.hay.blockID) { ++ } else if (var2.itemID == Block.hay.blockID) { + var7 = 20.0F; + var5 = 180; +- } else if(var2.itemID == Item.appleRed.itemID) { ++ } else if (var2.itemID == Item.appleRed.itemID) { + var7 = 3.0F; + var5 = 60; + var6 = 3; +- } else if(var2.itemID == Item.goldenCarrot.itemID) { ++ } else if (var2.itemID == Item.goldenCarrot.itemID) { + var7 = 4.0F; + var5 = 60; + var6 = 5; +- if(this.isTame() && this.getGrowingAge() == 0) { ++ ++ if (this.isTame() && this.getGrowingAge() == 0) { + var3 = true; + this.func_110196_bT(); + } +- } else if(var2.itemID == Item.appleGold.itemID) { ++ } else if (var2.itemID == Item.appleGold.itemID) { + var7 = 10.0F; + var5 = 240; + var6 = 10; +- if(this.isTame() && this.getGrowingAge() == 0) { ++ ++ if (this.isTame() && this.getGrowingAge() == 0) { + var3 = true; + this.func_110196_bT(); + } + } + +- if(this.getHealth() < this.getMaxHealth() && var7 > 0.0F) { ++ if (this.getHealth() < this.getMaxHealth() && var7 > 0.0F) { + this.heal(var7); + var3 = true; + } + +- if(!this.isAdultHorse() && var5 > 0) { ++ if (!this.isAdultHorse() && var5 > 0) { + this.addGrowth(var5); + var3 = true; + } + +- if(var6 > 0 && (var3 || !this.isTame()) && var6 < this.getMaxTemper()) { ++ if (var6 > 0 && (var3 || !this.isTame()) && var6 < this.getMaxTemper()) { + var3 = true; + this.increaseTemper(var6); + } + +- if(var3) { ++ if (var3) { + this.func_110266_cB(); + } + } + +- if(!this.isTame() && !var3) { +- if(var2 != null && var2.func_111282_a(var1, this)) { ++ if (!this.isTame() && !var3) { ++ if (var2 != null && var2.func_111282_a(par1EntityPlayer, this)) { + return true; + } + +@@ -621,49 +701,49 @@ + return true; + } + +- if(!var3 && this.func_110229_cs() && !this.isChested() && var2.itemID == Block.chest.blockID) { ++ if (!var3 && this.func_110229_cs() && !this.isChested() && var2.itemID == Block.chest.blockID) { + this.setChested(true); +- this.playSound("mob.chickenplop", 1.0F, (this.ab.nextFloat() - this.ab.nextFloat()) * 0.2F + 1.0F); ++ this.playSound("mob.chickenplop", 1.0F, (this.rand.nextFloat() - this.rand.nextFloat()) * 0.2F + 1.0F); + var3 = true; + this.func_110226_cD(); + } + +- if(!var3 && this.func_110253_bW() && !this.isHorseSaddled() && var2.itemID == Item.saddle.itemID) { +- this.openGUI(var1); ++ if (!var3 && this.func_110253_bW() && !this.isHorseSaddled() && var2.itemID == Item.saddle.itemID) { ++ this.openGUI(par1EntityPlayer); + return true; + } + +- if(var3) { +- if(!var1.capabilities.isCreativeMode && --var2.stackSize == 0) { +- var1.inventory.setInventorySlotContents(var1.inventory.currentItem, (ItemStack)null); ++ if (var3) { ++ if (!par1EntityPlayer.capabilities.isCreativeMode && --var2.stackSize == 0) { ++ par1EntityPlayer.inventory.setInventorySlotContents(par1EntityPlayer.inventory.currentItem, (ItemStack)null); + } + + return true; + } + } + +- if(this.func_110253_bW() && this.riddenByEntity == null) { +- if(var2 != null && var2.func_111282_a(var1, this)) { ++ if (this.func_110253_bW() && this.riddenByEntity == null) { ++ if (var2 != null && var2.func_111282_a(par1EntityPlayer, this)) { + return true; + } else { +- this.func_110237_h(var1); ++ this.func_110237_h(par1EntityPlayer); + return true; + } + } else { +- return super.interact(var1); ++ return super.interact(par1EntityPlayer); + } + } + } + +- private void func_110237_h(EntityPlayer var1) { +- var1.rotationYaw = this.rotationYaw; +- var1.rotationPitch = this.rotationPitch; ++ private void func_110237_h(EntityPlayer par1EntityPlayer) { ++ par1EntityPlayer.rotationYaw = this.rotationYaw; ++ par1EntityPlayer.rotationPitch = this.rotationPitch; + this.setEatingHaystack(false); + this.setRearing(false); +- if(!this.worldObj.isRemote) { +- var1.mountEntity(this); +- } + ++ if (!this.worldObj.isRemote) { ++ par1EntityPlayer.mountEntity(this); ++ } + } + + public boolean func_110259_cr() { +@@ -675,6 +755,9 @@ + return var1 == 2 || var1 == 1; + } + ++ /** ++ * Dead and sleeping entities cannot move ++ */ + protected boolean isMovementBlocked() { + return this.riddenByEntity != null && this.isHorseSaddled() ? true : this.isEatingHaystack() || this.isRearing(); + } +@@ -688,7 +771,11 @@ + return this.func_110256_cu() || this.getHorseType() == 2; + } + +- public boolean isBreedingItem(ItemStack var1) { ++ /** ++ * Checks if the parameter is an item which this animal can be fed to breed it (wheat, carrots or seeds depending on ++ * the animal type) ++ */ ++ public boolean isBreedingItem(ItemStack par1ItemStack) { + return false; + } + +@@ -696,159 +783,178 @@ + this.field_110278_bp = 1; + } + +- public void onDeath(DamageSource var1) { +- super.onDeath(var1); +- if(!this.worldObj.isRemote) { ++ /** ++ * Called when the mob's health reaches 0. ++ */ ++ public void onDeath(DamageSource par1DamageSource) { ++ super.onDeath(par1DamageSource); ++ ++ if (!this.worldObj.isRemote) { + this.dropChestItems(); + } +- + } + ++ /** ++ * Called frequently so the entity can update its state every tick as required. For example, zombies and skeletons use ++ * this to react to sunlight and start to burn. ++ */ + public void onLivingUpdate() { +- if(this.ab.nextInt(200) == 0) { ++ if (this.rand.nextInt(200) == 0) { + this.func_110210_cH(); + } + + super.onLivingUpdate(); +- if(!this.worldObj.isRemote) { +- if(this.ab.nextInt(900) == 0 && this.deathTime == 0) { ++ ++ if (!this.worldObj.isRemote) { ++ if (this.rand.nextInt(900) == 0 && this.deathTime == 0) { + this.heal(1.0F); + } + +- if(!this.isEatingHaystack() && this.riddenByEntity == null && this.ab.nextInt(300) == 0 && this.worldObj.getBlockId(MathHelper.floor_double(this.posX), MathHelper.floor_double(this.posY) - 1, MathHelper.floor_double(this.posZ)) == Block.grass.blockID) { ++ if (!this.isEatingHaystack() && this.riddenByEntity == null && this.rand.nextInt(300) == 0 && this.worldObj.getBlockId(MathHelper.floor_double(this.posX), MathHelper.floor_double(this.posY) - 1, MathHelper.floor_double(this.posZ)) == Block.grass.blockID) { + this.setEatingHaystack(true); + } + +- if(this.isEatingHaystack() && ++this.eatingHaystackCounter > 50) { ++ if (this.isEatingHaystack() && ++this.eatingHaystackCounter > 50) { + this.eatingHaystackCounter = 0; + this.setEatingHaystack(false); + } + +- if(this.func_110205_ce() && !this.isAdultHorse() && !this.isEatingHaystack()) { ++ if (this.func_110205_ce() && !this.isAdultHorse() && !this.isEatingHaystack()) { + EntityHorse var1 = this.getClosestHorse(this, 16.0D); +- if(var1 != null && this.getDistanceSqToEntity(var1) > 4.0D) { ++ ++ if (var1 != null && this.getDistanceSqToEntity(var1) > 4.0D) { + PathEntity var2 = this.worldObj.getPathEntityToEntity(this, var1, 16.0F, true, false, false, true); + this.setPathToEntity(var2); + } + } + } +- + } + ++ /** ++ * Called to update the entity's position/logic. ++ */ + public void onUpdate() { + super.onUpdate(); +- if(this.worldObj.isRemote && this.dataWatcher.hasObjectChanged()) { ++ ++ if (this.worldObj.isRemote && this.dataWatcher.hasChanges()) { + this.dataWatcher.func_111144_e(); + this.func_110230_cF(); + } + +- if(this.openMouthCounter > 0 && ++this.openMouthCounter > 30) { ++ if (this.openMouthCounter > 0 && ++this.openMouthCounter > 30) { + this.openMouthCounter = 0; + this.setHorseWatchableBoolean(128, false); + } + +- if(!this.worldObj.isRemote && this.jumpRearingCounter > 0 && ++this.jumpRearingCounter > 20) { ++ if (!this.worldObj.isRemote && this.jumpRearingCounter > 0 && ++this.jumpRearingCounter > 20) { + this.jumpRearingCounter = 0; + this.setRearing(false); + } + +- if(this.field_110278_bp > 0 && ++this.field_110278_bp > 8) { ++ if (this.field_110278_bp > 0 && ++this.field_110278_bp > 8) { + this.field_110278_bp = 0; + } + +- if(this.field_110279_bq > 0) { ++ if (this.field_110279_bq > 0) { + ++this.field_110279_bq; +- if(this.field_110279_bq > 300) { ++ ++ if (this.field_110279_bq > 300) { + this.field_110279_bq = 0; + } + } + + this.prevHeadLean = this.headLean; +- if(this.isEatingHaystack()) { ++ ++ if (this.isEatingHaystack()) { + this.headLean += (1.0F - this.headLean) * 0.4F + 0.05F; +- if(this.headLean > 1.0F) { ++ ++ if (this.headLean > 1.0F) { + this.headLean = 1.0F; + } + } else { + this.headLean += (0.0F - this.headLean) * 0.4F - 0.05F; +- if(this.headLean < 0.0F) { ++ ++ if (this.headLean < 0.0F) { + this.headLean = 0.0F; + } + } + + this.prevRearingAmount = this.rearingAmount; +- if(this.isRearing()) { ++ ++ if (this.isRearing()) { + this.prevHeadLean = this.headLean = 0.0F; + this.rearingAmount += (1.0F - this.rearingAmount) * 0.4F + 0.05F; +- if(this.rearingAmount > 1.0F) { ++ ++ if (this.rearingAmount > 1.0F) { + this.rearingAmount = 1.0F; + } + } else { + this.field_110294_bI = false; + this.rearingAmount += (0.8F * this.rearingAmount * this.rearingAmount * this.rearingAmount - this.rearingAmount) * 0.6F - 0.05F; +- if(this.rearingAmount < 0.0F) { ++ ++ if (this.rearingAmount < 0.0F) { + this.rearingAmount = 0.0F; + } + } + + this.prevMouthOpenness = this.mouthOpenness; +- if(this.getHorseWatchableBoolean(128)) { ++ ++ if (this.getHorseWatchableBoolean(128)) { + this.mouthOpenness += (1.0F - this.mouthOpenness) * 0.7F + 0.05F; +- if(this.mouthOpenness > 1.0F) { ++ ++ if (this.mouthOpenness > 1.0F) { + this.mouthOpenness = 1.0F; + } + } else { + this.mouthOpenness += (0.0F - this.mouthOpenness) * 0.7F - 0.05F; +- if(this.mouthOpenness < 0.0F) { ++ ++ if (this.mouthOpenness < 0.0F) { + this.mouthOpenness = 0.0F; + } + } +- + } + + private void openHorseMouth() { +- if(!this.worldObj.isRemote) { ++ if (!this.worldObj.isRemote) { + this.openMouthCounter = 1; + this.setHorseWatchableBoolean(128, true); + } +- + } + + private boolean func_110200_cJ() { + return this.riddenByEntity == null && this.ridingEntity == null && this.isTame() && this.isAdultHorse() && !this.func_110222_cv() && this.getHealth() >= this.getMaxHealth(); + } + +- public void setEating(boolean var1) { +- this.setHorseWatchableBoolean(32, var1); +- } +- +- public void setEatingHaystack(boolean var1) { +- this.setEating(var1); +- } +- +- public void setRearing(boolean var1) { +- if(var1) { ++ public void setEating(boolean par1) { ++ this.setHorseWatchableBoolean(32, par1); ++ } ++ ++ public void setEatingHaystack(boolean par1) { ++ this.setEating(par1); ++ } ++ ++ public void setRearing(boolean par1) { ++ if (par1) { + this.setEatingHaystack(false); + } + +- this.setHorseWatchableBoolean(64, var1); ++ this.setHorseWatchableBoolean(64, par1); + } + + private void makeHorseRear() { +- if(!this.worldObj.isRemote) { ++ if (!this.worldObj.isRemote) { + this.jumpRearingCounter = 1; + this.setRearing(true); + } +- + } + + public void makeHorseRearWithSound() { + this.makeHorseRear(); + String var1 = this.getAngrySoundName(); +- if(var1 != null) { ++ ++ if (var1 != null) { + this.playSound(var1, this.getSoundVolume(), this.getSoundPitch()); + } +- + } + + public void dropChestItems() { +@@ -856,51 +962,57 @@ + this.dropChests(); + } + +- private void dropItemsInChest(Entity var1, AnimalChest var2) { +- if(var2 != null && !this.worldObj.isRemote) { +- for(int var3 = 0; var3 < var2.getSizeInventory(); ++var3) { +- ItemStack var4 = var2.getStackInSlot(var3); +- if(var4 != null) { ++ private void dropItemsInChest(Entity par1Entity, AnimalChest par2AnimalChest) { ++ if (par2AnimalChest != null && !this.worldObj.isRemote) { ++ for (int var3 = 0; var3 < par2AnimalChest.getSizeInventory(); ++var3) { ++ ItemStack var4 = par2AnimalChest.getStackInSlot(var3); ++ ++ if (var4 != null) { + this.entityDropItem(var4, 0.0F); + } + } +- + } + } + +- public boolean setTamedBy(EntityPlayer var1) { +- this.setOwnerName(var1.getCommandSenderName()); ++ public boolean setTamedBy(EntityPlayer par1EntityPlayer) { ++ this.setOwnerName(par1EntityPlayer.getCommandSenderName()); + this.setHorseTamed(true); + return true; + } + +- public void moveEntityWithHeading(float var1, float var2) { +- if(this.riddenByEntity != null && this.isHorseSaddled()) { ++ /** ++ * Moves the entity based on the specified heading. Args: strafe, forward ++ */ ++ public void moveEntityWithHeading(float par1, float par2) { ++ if (this.riddenByEntity != null && this.isHorseSaddled()) { + this.prevRotationYaw = this.rotationYaw = this.riddenByEntity.rotationYaw; + this.rotationPitch = this.riddenByEntity.rotationPitch * 0.5F; + this.setRotation(this.rotationYaw, this.rotationPitch); + this.rotationYawHead = this.renderYawOffset = this.rotationYaw; +- var1 = ((EntityLivingBase)this.riddenByEntity).moveStrafing * 0.5F; +- var2 = ((EntityLivingBase)this.riddenByEntity).moveForward; +- if(var2 <= 0.0F) { +- var2 *= 0.25F; ++ par1 = ((EntityLivingBase)this.riddenByEntity).moveStrafing * 0.5F; ++ par2 = ((EntityLivingBase)this.riddenByEntity).moveForward; ++ ++ if (par2 <= 0.0F) { ++ par2 *= 0.25F; + this.field_110285_bP = 0; + } + +- if(this.onGround && this.jumpPower == 0.0F && this.isRearing() && !this.field_110294_bI) { +- var1 = 0.0F; +- var2 = 0.0F; ++ if (this.onGround && this.jumpPower == 0.0F && this.isRearing() && !this.field_110294_bI) { ++ par1 = 0.0F; ++ par2 = 0.0F; + } + +- if(this.jumpPower > 0.0F && !this.isHorseJumping() && this.onGround) { ++ if (this.jumpPower > 0.0F && !this.isHorseJumping() && this.onGround) { + this.motionY = this.getHorseJumpStrength() * (double)this.jumpPower; +- if(this.isPotionActive(Potion.jump)) { ++ ++ if (this.isPotionActive(Potion.jump)) { + this.motionY += (double)((float)(this.getActivePotionEffect(Potion.jump).getAmplifier() + 1) * 0.1F); + } + + this.setHorseJumping(true); + this.isAirBorne = true; +- if(var2 > 0.0F) { ++ ++ if (par2 > 0.0F) { + float var3 = MathHelper.sin(this.rotationYaw * (float)Math.PI / 180.0F); + float var4 = MathHelper.cos(this.rotationYaw * (float)Math.PI / 180.0F); + this.motionX += (double)(-0.4F * var3 * this.jumpPower); +@@ -913,12 +1025,13 @@ + + this.stepHeight = 1.0F; + this.jumpMovementFactor = this.getAIMoveSpeed() * 0.1F; +- if(!this.worldObj.isRemote) { ++ ++ if (!this.worldObj.isRemote) { + this.setAIMoveSpeed((float)this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).getAttributeValue()); +- super.moveEntityWithHeading(var1, var2); ++ super.moveEntityWithHeading(par1, par2); + } + +- if(this.onGround) { ++ if (this.onGround) { + this.jumpPower = 0.0F; + this.setHorseJumping(false); + } +@@ -927,7 +1040,8 @@ + double var8 = this.posX - this.prevPosX; + double var5 = this.posZ - this.prevPosZ; + float var7 = MathHelper.sqrt_double(var8 * var8 + var5 * var5) * 4.0F; +- if(var7 > 1.0F) { ++ ++ if (var7 > 1.0F) { + var7 = 1.0F; + } + +@@ -936,27 +1050,32 @@ + } else { + this.stepHeight = 0.5F; + this.jumpMovementFactor = 0.02F; +- super.moveEntityWithHeading(var1, var2); ++ super.moveEntityWithHeading(par1, par2); + } + } + +- public void writeEntityToNBT(NBTTagCompound var1) { +- super.writeEntityToNBT(var1); +- var1.setBoolean("EatingHaystack", this.isEatingHaystack()); +- var1.setBoolean("ChestedHorse", this.isChested()); +- var1.setBoolean("HasReproduced", this.getHasReproduced()); +- var1.setBoolean("Bred", this.func_110205_ce()); +- var1.setInteger("Type", this.getHorseType()); +- var1.setInteger("Variant", this.getHorseVariant()); +- var1.setInteger("Temper", this.getTemper()); +- var1.setBoolean("Tame", this.isTame()); +- var1.setString("OwnerName", this.getOwnerName()); +- if(this.isChested()) { ++ /** ++ * (abstract) Protected helper method to write subclass entity data to NBT. ++ */ ++ public void writeEntityToNBT(NBTTagCompound par1NBTTagCompound) { ++ super.writeEntityToNBT(par1NBTTagCompound); ++ par1NBTTagCompound.setBoolean("EatingHaystack", this.isEatingHaystack()); ++ par1NBTTagCompound.setBoolean("ChestedHorse", this.isChested()); ++ par1NBTTagCompound.setBoolean("HasReproduced", this.getHasReproduced()); ++ par1NBTTagCompound.setBoolean("Bred", this.func_110205_ce()); ++ par1NBTTagCompound.setInteger("Type", this.getHorseType()); ++ par1NBTTagCompound.setInteger("Variant", this.getHorseVariant()); ++ par1NBTTagCompound.setInteger("Temper", this.getTemper()); ++ par1NBTTagCompound.setBoolean("Tame", this.isTame()); ++ par1NBTTagCompound.setString("OwnerName", this.getOwnerName()); ++ ++ if (this.isChested()) { + NBTTagList var2 = new NBTTagList(); + +- for(int var3 = 2; var3 < this.horseChest.getSizeInventory(); ++var3) { ++ for (int var3 = 2; var3 < this.horseChest.getSizeInventory(); ++var3) { + ItemStack var4 = this.horseChest.getStackInSlot(var3); +- if(var4 != null) { ++ ++ if (var4 != null) { + NBTTagCompound var5 = new NBTTagCompound(); + var5.setByte("Slot", (byte)var3); + var4.writeToNBT(var5); +@@ -964,79 +1083,91 @@ + } + } + +- var1.setTag("Items", var2); +- } +- +- if(this.horseChest.getStackInSlot(1) != null) { +- var1.setTag("ArmorItem", this.horseChest.getStackInSlot(1).writeToNBT(new NBTTagCompound("ArmorItem"))); +- } +- +- if(this.horseChest.getStackInSlot(0) != null) { +- var1.setTag("SaddleItem", this.horseChest.getStackInSlot(0).writeToNBT(new NBTTagCompound("SaddleItem"))); +- } +- ++ par1NBTTagCompound.setTag("Items", var2); ++ } ++ ++ if (this.horseChest.getStackInSlot(1) != null) { ++ par1NBTTagCompound.setTag("ArmorItem", this.horseChest.getStackInSlot(1).writeToNBT(new NBTTagCompound("ArmorItem"))); ++ } ++ ++ if (this.horseChest.getStackInSlot(0) != null) { ++ par1NBTTagCompound.setTag("SaddleItem", this.horseChest.getStackInSlot(0).writeToNBT(new NBTTagCompound("SaddleItem"))); ++ } + } + +- public void readEntityFromNBT(NBTTagCompound var1) { +- super.readEntityFromNBT(var1); +- this.setEatingHaystack(var1.getBoolean("EatingHaystack")); +- this.func_110242_l(var1.getBoolean("Bred")); +- this.setChested(var1.getBoolean("ChestedHorse")); +- this.setHasReproduced(var1.getBoolean("HasReproduced")); +- this.setHorseType(var1.getInteger("Type")); +- this.setHorseVariant(var1.getInteger("Variant")); +- this.setTemper(var1.getInteger("Temper")); +- this.setHorseTamed(var1.getBoolean("Tame")); +- if(var1.hasKey("OwnerName")) { +- this.setOwnerName(var1.getString("OwnerName")); ++ /** ++ * (abstract) Protected helper method to read subclass entity data from NBT. ++ */ ++ public void readEntityFromNBT(NBTTagCompound par1NBTTagCompound) { ++ super.readEntityFromNBT(par1NBTTagCompound); ++ this.setEatingHaystack(par1NBTTagCompound.getBoolean("EatingHaystack")); ++ this.func_110242_l(par1NBTTagCompound.getBoolean("Bred")); ++ this.setChested(par1NBTTagCompound.getBoolean("ChestedHorse")); ++ this.setHasReproduced(par1NBTTagCompound.getBoolean("HasReproduced")); ++ this.setHorseType(par1NBTTagCompound.getInteger("Type")); ++ this.setHorseVariant(par1NBTTagCompound.getInteger("Variant")); ++ this.setTemper(par1NBTTagCompound.getInteger("Temper")); ++ this.setHorseTamed(par1NBTTagCompound.getBoolean("Tame")); ++ ++ if (par1NBTTagCompound.hasKey("OwnerName")) { ++ this.setOwnerName(par1NBTTagCompound.getString("OwnerName")); + } + + AttributeInstance var2 = this.getAttributeMap().getAttributeInstanceByName("Speed"); +- if(var2 != null) { ++ ++ if (var2 != null) { + this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setAttribute(var2.getBaseValue() * 0.25D); + } + +- if(this.isChested()) { +- NBTTagList var3 = var1.getTagList("Items"); ++ if (this.isChested()) { ++ NBTTagList var3 = par1NBTTagCompound.getTagList("Items"); + this.func_110226_cD(); + +- for(int var4 = 0; var4 < var3.tagCount(); ++var4) { ++ for (int var4 = 0; var4 < var3.tagCount(); ++var4) { + NBTTagCompound var5 = (NBTTagCompound)var3.tagAt(var4); + int var6 = var5.getByte("Slot") & 255; +- if(var6 >= 2 && var6 < this.horseChest.getSizeInventory()) { ++ ++ if (var6 >= 2 && var6 < this.horseChest.getSizeInventory()) { + this.horseChest.setInventorySlotContents(var6, ItemStack.loadItemStackFromNBT(var5)); + } + } + } + + ItemStack var7; +- if(var1.hasKey("ArmorItem")) { +- var7 = ItemStack.loadItemStackFromNBT(var1.getCompoundTag("ArmorItem")); +- if(var7 != null && func_110211_v(var7.itemID)) { ++ ++ if (par1NBTTagCompound.hasKey("ArmorItem")) { ++ var7 = ItemStack.loadItemStackFromNBT(par1NBTTagCompound.getCompoundTag("ArmorItem")); ++ ++ if (var7 != null && func_110211_v(var7.itemID)) { + this.horseChest.setInventorySlotContents(1, var7); + } + } + +- if(var1.hasKey("SaddleItem")) { +- var7 = ItemStack.loadItemStackFromNBT(var1.getCompoundTag("SaddleItem")); +- if(var7 != null && var7.itemID == Item.saddle.itemID) { ++ if (par1NBTTagCompound.hasKey("SaddleItem")) { ++ var7 = ItemStack.loadItemStackFromNBT(par1NBTTagCompound.getCompoundTag("SaddleItem")); ++ ++ if (var7 != null && var7.itemID == Item.saddle.itemID) { + this.horseChest.setInventorySlotContents(0, var7); + } +- } else if(var1.getBoolean("Saddle")) { ++ } else if (par1NBTTagCompound.getBoolean("Saddle")) { + this.horseChest.setInventorySlotContents(0, new ItemStack(Item.saddle)); + } + + this.func_110232_cE(); + } + +- public boolean canMateWith(EntityAnimal var1) { +- if(var1 == this) { ++ /** ++ * Returns true if the mob is currently able to mate with the specified mob. ++ */ ++ public boolean canMateWith(EntityAnimal par1EntityAnimal) { ++ if (par1EntityAnimal == this) { + return false; +- } else if(var1.getClass() != this.getClass()) { ++ } else if (par1EntityAnimal.getClass() != this.getClass()) { + return false; + } else { +- EntityHorse var2 = (EntityHorse)var1; +- if(this.func_110200_cJ() && var2.func_110200_cJ()) { ++ EntityHorse var2 = (EntityHorse)par1EntityAnimal; ++ ++ if (this.func_110200_cJ() && var2.func_110200_cJ()) { + int var3 = this.getHorseType(); + int var4 = var2.getHorseType(); + return var3 == var4 || var3 == 0 && var4 == 1 || var3 == 1 && var4 == 0; +@@ -1046,188 +1177,201 @@ + } + } + +- public EntityAgeable createChild(EntityAgeable var1) { +- EntityHorse var2 = (EntityHorse)var1; ++ public EntityAgeable createChild(EntityAgeable par1EntityAgeable) { ++ EntityHorse var2 = (EntityHorse)par1EntityAgeable; + EntityHorse var3 = new EntityHorse(this.worldObj); + int var4 = this.getHorseType(); + int var5 = var2.getHorseType(); + int var6 = 0; +- if(var4 == var5) { ++ ++ if (var4 == var5) { + var6 = var4; +- } else if(var4 == 0 && var5 == 1 || var4 == 1 && var5 == 0) { ++ } else if (var4 == 0 && var5 == 1 || var4 == 1 && var5 == 0) { + var6 = 2; + } + +- if(var6 == 0) { +- int var8 = this.ab.nextInt(9); ++ if (var6 == 0) { ++ int var8 = this.rand.nextInt(9); + int var7; +- if(var8 < 4) { ++ ++ if (var8 < 4) { + var7 = this.getHorseVariant() & 255; +- } else if(var8 < 8) { ++ } else if (var8 < 8) { + var7 = var2.getHorseVariant() & 255; + } else { +- var7 = this.ab.nextInt(7); ++ var7 = this.rand.nextInt(7); + } + +- int var9 = this.ab.nextInt(5); +- if(var9 < 4) { +- var7 |= this.getHorseVariant() & '\uff00'; +- } else if(var9 < 8) { +- var7 |= var2.getHorseVariant() & '\uff00'; ++ int var9 = this.rand.nextInt(5); ++ ++ if (var9 < 4) { ++ var7 |= this.getHorseVariant() & 65280; ++ } else if (var9 < 8) { ++ var7 |= var2.getHorseVariant() & 65280; + } else { +- var7 |= this.ab.nextInt(5) << 8 & '\uff00'; ++ var7 |= this.rand.nextInt(5) << 8 & 65280; + } + + var3.setHorseVariant(var7); + } + + var3.setHorseType(var6); +- double var14 = this.getEntityAttribute(SharedMonsterAttributes.maxHealth).getBaseValue() + var1.getEntityAttribute(SharedMonsterAttributes.maxHealth).getBaseValue() + (double)this.func_110267_cL(); ++ double var14 = this.getEntityAttribute(SharedMonsterAttributes.maxHealth).getBaseValue() + par1EntityAgeable.getEntityAttribute(SharedMonsterAttributes.maxHealth).getBaseValue() + (double)this.func_110267_cL(); + var3.getEntityAttribute(SharedMonsterAttributes.maxHealth).setAttribute(var14 / 3.0D); +- double var13 = this.getEntityAttribute(horseJumpStrength).getBaseValue() + var1.getEntityAttribute(horseJumpStrength).getBaseValue() + this.func_110245_cM(); ++ double var13 = this.getEntityAttribute(horseJumpStrength).getBaseValue() + par1EntityAgeable.getEntityAttribute(horseJumpStrength).getBaseValue() + this.func_110245_cM(); + var3.getEntityAttribute(horseJumpStrength).setAttribute(var13 / 3.0D); +- double var11 = this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).getBaseValue() + var1.getEntityAttribute(SharedMonsterAttributes.movementSpeed).getBaseValue() + this.func_110203_cN(); ++ double var11 = this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).getBaseValue() + par1EntityAgeable.getEntityAttribute(SharedMonsterAttributes.movementSpeed).getBaseValue() + this.func_110203_cN(); + var3.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setAttribute(var11 / 3.0D); + return var3; + } + +- public EntityLivingData onSpawnWithEgg(EntityLivingData var1) { +- Object var6 = super.onSpawnWithEgg(var1); ++ public EntityLivingData onSpawnWithEgg(EntityLivingData par1EntityLivingData) { ++ Object par1EntityLivingData1 = super.onSpawnWithEgg(par1EntityLivingData); + boolean var2 = false; + int var3 = 0; + int var7; +- if(var6 instanceof EntityHorseGroupData) { +- var7 = ((EntityHorseGroupData)var6).field_111107_a; +- var3 = ((EntityHorseGroupData)var6).field_111106_b & 255 | this.ab.nextInt(5) << 8; ++ ++ if (par1EntityLivingData1 instanceof EntityHorseGroupData) { ++ var7 = ((EntityHorseGroupData)par1EntityLivingData1).field_111107_a; ++ var3 = ((EntityHorseGroupData)par1EntityLivingData1).field_111106_b & 255 | this.rand.nextInt(5) << 8; + } else { +- if(this.ab.nextInt(10) == 0) { ++ if (this.rand.nextInt(10) == 0) { + var7 = 1; + } else { +- int var4 = this.ab.nextInt(7); +- int var5 = this.ab.nextInt(5); ++ int var4 = this.rand.nextInt(7); ++ int var5 = this.rand.nextInt(5); + var7 = 0; + var3 = var4 | var5 << 8; + } + +- var6 = new EntityHorseGroupData(var7, var3); ++ par1EntityLivingData1 = new EntityHorseGroupData(var7, var3); + } + + this.setHorseType(var7); + this.setHorseVariant(var3); +- if(this.ab.nextInt(5) == 0) { ++ ++ if (this.rand.nextInt(5) == 0) { + this.setGrowingAge(-24000); + } + +- if(var7 != 4 && var7 != 3) { ++ if (var7 != 4 && var7 != 3) { + this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setAttribute((double)this.func_110267_cL()); +- if(var7 == 0) { ++ ++ if (var7 == 0) { + this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setAttribute(this.func_110203_cN()); + } else { +- this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setAttribute((double)0.175F); ++ this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setAttribute(0.17499999701976776D); + } + } else { + this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setAttribute(15.0D); +- this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setAttribute((double)0.2F); ++ this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setAttribute(0.20000000298023224D); + } + +- if(var7 != 2 && var7 != 1) { ++ if (var7 != 2 && var7 != 1) { + this.getEntityAttribute(horseJumpStrength).setAttribute(this.func_110245_cM()); + } else { + this.getEntityAttribute(horseJumpStrength).setAttribute(0.5D); + } + + this.setHealth(this.getMaxHealth()); +- return (EntityLivingData)var6; +- } +- +- public float getGrassEatingAmount(float var1) { +- return this.prevHeadLean + (this.headLean - this.prevHeadLean) * var1; +- } +- +- public float getRearingAmount(float var1) { +- return this.prevRearingAmount + (this.rearingAmount - this.prevRearingAmount) * var1; +- } +- +- public float func_110201_q(float var1) { +- return this.prevMouthOpenness + (this.mouthOpenness - this.prevMouthOpenness) * var1; +- } +- ++ return (EntityLivingData)par1EntityLivingData1; ++ } ++ ++ public float getGrassEatingAmount(float par1) { ++ return this.prevHeadLean + (this.headLean - this.prevHeadLean) * par1; ++ } ++ ++ public float getRearingAmount(float par1) { ++ return this.prevRearingAmount + (this.rearingAmount - this.prevRearingAmount) * par1; ++ } ++ ++ public float func_110201_q(float par1) { ++ return this.prevMouthOpenness + (this.mouthOpenness - this.prevMouthOpenness) * par1; ++ } ++ ++ /** ++ * Returns true if the newer Entity AI code should be run ++ */ + protected boolean isAIEnabled() { + return true; + } + +- public void setJumpPower(int var1) { +- if(this.isHorseSaddled()) { +- if(var1 < 0) { +- var1 = 0; ++ public void setJumpPower(int par1) { ++ if (this.isHorseSaddled()) { ++ if (par1 < 0) { ++ par1 = 0; + } else { + this.field_110294_bI = true; + this.makeHorseRear(); + } + +- if(var1 >= 90) { ++ if (par1 >= 90) { + this.jumpPower = 1.0F; + } else { +- this.jumpPower = 0.4F + 0.4F * (float)var1 / 90.0F; ++ this.jumpPower = 0.4F + 0.4F * (float)par1 / 90.0F; + } + } +- + } + +- protected void spawnHorseParticles(boolean var1) { +- String var2 = var1 ? "heart" : "smoke"; ++ /** ++ * "Spawns particles for the horse entity. par1 tells whether to spawn hearts. If it is false, it spawns smoke." ++ */ ++ protected void spawnHorseParticles(boolean par1) { ++ String var2 = par1 ? "heart" : "smoke"; + +- for(int var3 = 0; var3 < 7; ++var3) { +- double var4 = this.ab.nextGaussian() * 0.02D; +- double var6 = this.ab.nextGaussian() * 0.02D; +- double var8 = this.ab.nextGaussian() * 0.02D; +- this.worldObj.spawnParticle(var2, this.posX + (double)(this.ab.nextFloat() * this.width * 2.0F) - (double)this.width, this.posY + 0.5D + (double)(this.ab.nextFloat() * this.height), this.posZ + (double)(this.ab.nextFloat() * this.width * 2.0F) - (double)this.width, var4, var6, var8); ++ for (int var3 = 0; var3 < 7; ++var3) { ++ double var4 = this.rand.nextGaussian() * 0.02D; ++ double var6 = this.rand.nextGaussian() * 0.02D; ++ double var8 = this.rand.nextGaussian() * 0.02D; ++ this.worldObj.spawnParticle(var2, this.posX + (double)(this.rand.nextFloat() * this.width * 2.0F) - (double)this.width, this.posY + 0.5D + (double)(this.rand.nextFloat() * this.height), this.posZ + (double)(this.rand.nextFloat() * this.width * 2.0F) - (double)this.width, var4, var6, var8); + } +- + } + +- public void handleHealthUpdate(byte var1) { +- if(var1 == 7) { ++ public void handleHealthUpdate(byte par1) { ++ if (par1 == 7) { + this.spawnHorseParticles(true); +- } else if(var1 == 6) { ++ } else if (par1 == 6) { + this.spawnHorseParticles(false); + } else { +- super.handleHealthUpdate(var1); ++ super.handleHealthUpdate(par1); + } +- + } + + public void updateRiderPosition() { + super.updateRiderPosition(); +- if(this.prevRearingAmount > 0.0F) { ++ ++ if (this.prevRearingAmount > 0.0F) { + float var1 = MathHelper.sin(this.renderYawOffset * (float)Math.PI / 180.0F); + float var2 = MathHelper.cos(this.renderYawOffset * (float)Math.PI / 180.0F); + float var3 = 0.7F * this.prevRearingAmount; + float var4 = 0.15F * this.prevRearingAmount; + this.riddenByEntity.setPosition(this.posX + (double)(var3 * var1), this.posY + this.getMountedYOffset() + this.riddenByEntity.getYOffset() + (double)var4, this.posZ - (double)(var3 * var2)); +- if(this.riddenByEntity instanceof EntityLivingBase) { ++ ++ if (this.riddenByEntity instanceof EntityLivingBase) { + ((EntityLivingBase)this.riddenByEntity).renderYawOffset = this.renderYawOffset; + } + } +- + } + + private float func_110267_cL() { +- return 15.0F + (float)this.ab.nextInt(8) + (float)this.ab.nextInt(9); ++ return 15.0F + (float)this.rand.nextInt(8) + (float)this.rand.nextInt(9); + } + + private double func_110245_cM() { +- return (double)0.4F + this.ab.nextDouble() * 0.2D + this.ab.nextDouble() * 0.2D + this.ab.nextDouble() * 0.2D; ++ return 0.4000000059604645D + this.rand.nextDouble() * 0.2D + this.rand.nextDouble() * 0.2D + this.rand.nextDouble() * 0.2D; + } + + private double func_110203_cN() { +- return ((double)0.45F + this.ab.nextDouble() * 0.3D + this.ab.nextDouble() * 0.3D + this.ab.nextDouble() * 0.3D) * 0.25D; +- } +- +- public static boolean func_110211_v(int var0) { +- return var0 == Item.horseArmorIron.itemID || var0 == Item.horseArmorGold.itemID || var0 == Item.horseArmorDiamond.itemID; +- } +- ++ return (0.44999998807907104D + this.rand.nextDouble() * 0.3D + this.rand.nextDouble() * 0.3D + this.rand.nextDouble() * 0.3D) * 0.25D; ++ } ++ ++ public static boolean func_110211_v(int par0) { ++ return par0 == Item.horseArmorIron.itemID || par0 == Item.horseArmorGold.itemID || par0 == Item.horseArmorDiamond.itemID; ++ } ++ ++ /** ++ * returns true if this entity is by a ladder, false otherwise ++ */ + public boolean isOnLadder() { + return false; + } diff --git a/patches/net/minecraft/src/EntityHorseBredSelector.java.patch b/patches/net/minecraft/src/EntityHorseBredSelector.java.patch new file mode 100644 index 0000000..0fdb0fd --- /dev/null +++ b/patches/net/minecraft/src/EntityHorseBredSelector.java.patch @@ -0,0 +1,16 @@ +--- net/minecraft/src/EntityHorseBredSelector.java ++++ net/minecraft/src/EntityHorseBredSelector.java +@@ -1,7 +1,11 @@ + package net.minecraft.src; + + final class EntityHorseBredSelector implements IEntitySelector { +- public boolean isEntityApplicable(Entity var1) { +- return var1 instanceof EntityHorse && ((EntityHorse)var1).func_110205_ce(); ++ ++ /** ++ * Return whether the specified entity is applicable to this filter. ++ */ ++ public boolean isEntityApplicable(Entity par1Entity) { ++ return par1Entity instanceof EntityHorse && ((EntityHorse)par1Entity).func_110205_ce(); + } + } diff --git a/patches/net/minecraft/src/EntityHorseGroupData.java.patch b/patches/net/minecraft/src/EntityHorseGroupData.java.patch new file mode 100644 index 0000000..ac542dc --- /dev/null +++ b/patches/net/minecraft/src/EntityHorseGroupData.java.patch @@ -0,0 +1,14 @@ +--- net/minecraft/src/EntityHorseGroupData.java ++++ net/minecraft/src/EntityHorseGroupData.java +@@ -4,8 +4,8 @@ + public int field_111107_a; + public int field_111106_b; + +- public EntityHorseGroupData(int var1, int var2) { +- this.field_111107_a = var1; +- this.field_111106_b = var2; ++ public EntityHorseGroupData(int par1, int par2) { ++ this.field_111107_a = par1; ++ this.field_111106_b = par2; + } + } diff --git a/patches/net/minecraft/src/EntityHugeExplodeFX.java.patch b/patches/net/minecraft/src/EntityHugeExplodeFX.java.patch new file mode 100644 index 0000000..df250da --- /dev/null +++ b/patches/net/minecraft/src/EntityHugeExplodeFX.java.patch @@ -0,0 +1,48 @@ +--- net/minecraft/src/EntityHugeExplodeFX.java ++++ net/minecraft/src/EntityHugeExplodeFX.java +@@ -2,28 +2,32 @@ + + public class EntityHugeExplodeFX extends EntityFX { + private int timeSinceStart; ++ ++ /** the maximum time for the explosion */ + private int maximumTime = 8; + +- public EntityHugeExplodeFX(World var1, double var2, double var4, double var6, double var8, double var10, double var12) { +- super(var1, var2, var4, var6, 0.0D, 0.0D, 0.0D); +- } +- +- public void renderParticle(Tessellator var1, float var2, float var3, float var4, float var5, float var6, float var7) { +- } +- ++ public EntityHugeExplodeFX(World par1World, double par2, double par4, double par6, double par8, double par10, double par12) { ++ super(par1World, par2, par4, par6, 0.0D, 0.0D, 0.0D); ++ } ++ ++ public void renderParticle(Tessellator par1Tessellator, float par2, float par3, float par4, float par5, float par6, float par7) {} ++ ++ /** ++ * Called to update the entity's position/logic. ++ */ + public void onUpdate() { +- for(int var1 = 0; var1 < 6; ++var1) { +- double var2 = this.posX + (this.ab.nextDouble() - this.ab.nextDouble()) * 4.0D; +- double var4 = this.posY + (this.ab.nextDouble() - this.ab.nextDouble()) * 4.0D; +- double var6 = this.posZ + (this.ab.nextDouble() - this.ab.nextDouble()) * 4.0D; ++ for (int var1 = 0; var1 < 6; ++var1) { ++ double var2 = this.posX + (this.rand.nextDouble() - this.rand.nextDouble()) * 4.0D; ++ double var4 = this.posY + (this.rand.nextDouble() - this.rand.nextDouble()) * 4.0D; ++ double var6 = this.posZ + (this.rand.nextDouble() - this.rand.nextDouble()) * 4.0D; + this.worldObj.spawnParticle("largeexplode", var2, var4, var6, (double)((float)this.timeSinceStart / (float)this.maximumTime), 0.0D, 0.0D); + } + + ++this.timeSinceStart; +- if(this.timeSinceStart == this.maximumTime) { ++ ++ if (this.timeSinceStart == this.maximumTime) { + this.setDead(); + } +- + } + + public int getFXLayer() { diff --git a/patches/net/minecraft/src/EntityIronGolem.java.patch b/patches/net/minecraft/src/EntityIronGolem.java.patch new file mode 100644 index 0000000..fef97d4 --- /dev/null +++ b/patches/net/minecraft/src/EntityIronGolem.java.patch @@ -0,0 +1,276 @@ +--- net/minecraft/src/EntityIronGolem.java ++++ net/minecraft/src/EntityIronGolem.java +@@ -1,13 +1,15 @@ + package net.minecraft.src; + + public class EntityIronGolem extends EntityGolem { ++ ++ /** deincrements, and a distance-to-home check is done at 0 */ + private int homeCheckTimer; + Village villageObj; + private int attackTimer; + private int holdRoseTick; + +- public EntityIronGolem(World var1) { +- super(var1); ++ public EntityIronGolem(World par1World) { ++ super(par1World); + this.setSize(1.4F, 2.9F); + this.getNavigator().setAvoidsWater(true); + this.tasks.addTask(1, new EntityAIAttackOnCollide(this, 1.0D, true)); +@@ -28,15 +30,22 @@ + this.dataWatcher.addObject(16, Byte.valueOf((byte)0)); + } + ++ /** ++ * Returns true if the newer Entity AI code should be run ++ */ + public boolean isAIEnabled() { + return true; + } + ++ /** ++ * main AI tick function, replaces updateEntityActionState ++ */ + protected void updateAITick() { +- if(--this.homeCheckTimer <= 0) { +- this.homeCheckTimer = 70 + this.ab.nextInt(50); ++ if (--this.homeCheckTimer <= 0) { ++ this.homeCheckTimer = 70 + this.rand.nextInt(50); + this.villageObj = this.worldObj.villageCollectionObj.findNearestVillage(MathHelper.floor_double(this.posX), MathHelper.floor_double(this.posY), MathHelper.floor_double(this.posZ), 32); +- if(this.villageObj == null) { ++ ++ if (this.villageObj == null) { + this.detachHome(); + } else { + ChunkCoordinates var1 = this.villageObj.getCenter(); +@@ -53,76 +62,93 @@ + this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setAttribute(0.25D); + } + +- protected int decreaseAirSupply(int var1) { +- return var1; ++ /** ++ * Decrements the entity's air supply when underwater ++ */ ++ protected int decreaseAirSupply(int par1) { ++ return par1; + } + +- protected void collideWithEntity(Entity var1) { +- if(var1 instanceof IMob && this.getRNG().nextInt(20) == 0) { +- this.setAttackTarget((EntityLivingBase)var1); ++ protected void collideWithEntity(Entity par1Entity) { ++ if (par1Entity instanceof IMob && this.getRNG().nextInt(20) == 0) { ++ this.setAttackTarget((EntityLivingBase)par1Entity); + } + +- super.collideWithEntity(var1); ++ super.collideWithEntity(par1Entity); + } + ++ /** ++ * Called frequently so the entity can update its state every tick as required. For example, zombies and skeletons use ++ * this to react to sunlight and start to burn. ++ */ + public void onLivingUpdate() { + super.onLivingUpdate(); +- if(this.attackTimer > 0) { ++ ++ if (this.attackTimer > 0) { + --this.attackTimer; + } + +- if(this.holdRoseTick > 0) { ++ if (this.holdRoseTick > 0) { + --this.holdRoseTick; + } + +- if(this.motionX * this.motionX + this.motionZ * this.motionZ > (double)2.5000003E-7F && this.ab.nextInt(5) == 0) { ++ if (this.motionX * this.motionX + this.motionZ * this.motionZ > 2.500000277905201E-7D && this.rand.nextInt(5) == 0) { + int var1 = MathHelper.floor_double(this.posX); +- int var2 = MathHelper.floor_double(this.posY - (double)0.2F - (double)this.yOffset); ++ int var2 = MathHelper.floor_double(this.posY - 0.20000000298023224D - (double)this.yOffset); + int var3 = MathHelper.floor_double(this.posZ); + int var4 = this.worldObj.getBlockId(var1, var2, var3); +- if(var4 > 0) { +- this.worldObj.spawnParticle("tilecrack_" + var4 + "_" + this.worldObj.getBlockMetadata(var1, var2, var3), this.posX + ((double)this.ab.nextFloat() - 0.5D) * (double)this.width, this.boundingBox.minY + 0.1D, this.posZ + ((double)this.ab.nextFloat() - 0.5D) * (double)this.width, 4.0D * ((double)this.ab.nextFloat() - 0.5D), 0.5D, ((double)this.ab.nextFloat() - 0.5D) * 4.0D); ++ ++ if (var4 > 0) { ++ this.worldObj.spawnParticle("tilecrack_" + var4 + "_" + this.worldObj.getBlockMetadata(var1, var2, var3), this.posX + ((double)this.rand.nextFloat() - 0.5D) * (double)this.width, this.boundingBox.minY + 0.1D, this.posZ + ((double)this.rand.nextFloat() - 0.5D) * (double)this.width, 4.0D * ((double)this.rand.nextFloat() - 0.5D), 0.5D, ((double)this.rand.nextFloat() - 0.5D) * 4.0D); + } + } +- +- } +- +- public boolean canAttackClass(Class var1) { +- return this.isPlayerCreated() && EntityPlayer.class.isAssignableFrom(var1) ? false : super.canAttackClass(var1); +- } +- +- public void writeEntityToNBT(NBTTagCompound var1) { +- super.writeEntityToNBT(var1); +- var1.setBoolean("PlayerCreated", this.isPlayerCreated()); +- } +- +- public void readEntityFromNBT(NBTTagCompound var1) { +- super.readEntityFromNBT(var1); +- this.setPlayerCreated(var1.getBoolean("PlayerCreated")); +- } +- +- public boolean attackEntityAsMob(Entity var1) { ++ } ++ ++ /** ++ * Returns true if this entity can attack entities of the specified class. ++ */ ++ public boolean canAttackClass(Class par1Class) { ++ return this.isPlayerCreated() && EntityPlayer.class.isAssignableFrom(par1Class) ? false : super.canAttackClass(par1Class); ++ } ++ ++ /** ++ * (abstract) Protected helper method to write subclass entity data to NBT. ++ */ ++ public void writeEntityToNBT(NBTTagCompound par1NBTTagCompound) { ++ super.writeEntityToNBT(par1NBTTagCompound); ++ par1NBTTagCompound.setBoolean("PlayerCreated", this.isPlayerCreated()); ++ } ++ ++ /** ++ * (abstract) Protected helper method to read subclass entity data from NBT. ++ */ ++ public void readEntityFromNBT(NBTTagCompound par1NBTTagCompound) { ++ super.readEntityFromNBT(par1NBTTagCompound); ++ this.setPlayerCreated(par1NBTTagCompound.getBoolean("PlayerCreated")); ++ } ++ ++ public boolean attackEntityAsMob(Entity par1Entity) { + this.attackTimer = 10; + this.worldObj.setEntityState(this, (byte)4); +- boolean var2 = var1.attackEntityFrom(DamageSource.causeMobDamage(this), (float)(7 + this.ab.nextInt(15))); +- if(var2) { +- var1.motionY += (double)0.4F; ++ boolean var2 = par1Entity.attackEntityFrom(DamageSource.causeMobDamage(this), (float)(7 + this.rand.nextInt(15))); ++ ++ if (var2) { ++ par1Entity.motionY += 0.4000000059604645D; + } + + this.playSound("mob.irongolem.throw", 1.0F, 1.0F); + return var2; + } + +- public void handleHealthUpdate(byte var1) { +- if(var1 == 4) { ++ public void handleHealthUpdate(byte par1) { ++ if (par1 == 4) { + this.attackTimer = 10; + this.playSound("mob.irongolem.throw", 1.0F, 1.0F); +- } else if(var1 == 11) { ++ } else if (par1 == 11) { + this.holdRoseTick = 400; + } else { +- super.handleHealthUpdate(var1); ++ super.handleHealthUpdate(par1); + } +- + } + + public Village getVillage() { +@@ -133,41 +159,56 @@ + return this.attackTimer; + } + +- public void setHoldingRose(boolean var1) { +- this.holdRoseTick = var1 ? 400 : 0; ++ public void setHoldingRose(boolean par1) { ++ this.holdRoseTick = par1 ? 400 : 0; + this.worldObj.setEntityState(this, (byte)11); + } + ++ /** ++ * Returns the sound this mob makes while it's alive. ++ */ + protected String getLivingSound() { + return "none"; + } + ++ /** ++ * Returns the sound this mob makes when it is hurt. ++ */ + protected String getHurtSound() { + return "mob.irongolem.hit"; + } + ++ /** ++ * Returns the sound this mob makes on death. ++ */ + protected String getDeathSound() { + return "mob.irongolem.death"; + } + +- protected void playStepSound(int var1, int var2, int var3, int var4) { ++ /** ++ * Plays step sound at given x, y, z for the entity ++ */ ++ protected void playStepSound(int par1, int par2, int par3, int par4) { + this.playSound("mob.irongolem.walk", 1.0F, 1.0F); + } + +- protected void dropFewItems(boolean var1, int var2) { +- int var3 = this.ab.nextInt(3); +- ++ /** ++ * Drop 0-2 items of this living's type. @param par1 - Whether this entity has recently been hit by a player. @param ++ * par2 - Level of Looting used to kill this mob. ++ */ ++ protected void dropFewItems(boolean par1, int par2) { ++ int var3 = this.rand.nextInt(3); + int var4; +- for(var4 = 0; var4 < var3; ++var4) { ++ ++ for (var4 = 0; var4 < var3; ++var4) { + this.dropItem(Block.plantRed.blockID, 1); + } + +- var4 = 3 + this.ab.nextInt(3); ++ var4 = 3 + this.rand.nextInt(3); + +- for(int var5 = 0; var5 < var4; ++var5) { ++ for (int var5 = 0; var5 < var4; ++var5) { + this.dropItem(Item.ingotIron.itemID, 1); + } +- + } + + public int getHoldRoseTick() { +@@ -178,21 +219,24 @@ + return (this.dataWatcher.getWatchableObjectByte(16) & 1) != 0; + } + +- public void setPlayerCreated(boolean var1) { ++ public void setPlayerCreated(boolean par1) { + byte var2 = this.dataWatcher.getWatchableObjectByte(16); +- if(var1) { ++ ++ if (par1) { + this.dataWatcher.updateObject(16, Byte.valueOf((byte)(var2 | 1))); + } else { + this.dataWatcher.updateObject(16, Byte.valueOf((byte)(var2 & -2))); + } +- + } + +- public void onDeath(DamageSource var1) { +- if(!this.isPlayerCreated() && this.attackingPlayer != null && this.villageObj != null) { ++ /** ++ * Called when the mob's health reaches 0. ++ */ ++ public void onDeath(DamageSource par1DamageSource) { ++ if (!this.isPlayerCreated() && this.attackingPlayer != null && this.villageObj != null) { + this.villageObj.setReputationForPlayer(this.attackingPlayer.getCommandSenderName(), -5); + } + +- super.onDeath(var1); ++ super.onDeath(par1DamageSource); + } + } diff --git a/patches/net/minecraft/src/EntityItem.java.patch b/patches/net/minecraft/src/EntityItem.java.patch new file mode 100644 index 0000000..c95fbe4 --- /dev/null +++ b/patches/net/minecraft/src/EntityItem.java.patch @@ -0,0 +1,432 @@ +--- net/minecraft/src/EntityItem.java ++++ net/minecraft/src/EntityItem.java +@@ -2,36 +2,54 @@ + + import java.util.Iterator; + ++import net.minecraft.src.DamageSource; ++ ++import org.spoutcraft.api.Spoutcraft; ++import org.spoutcraft.api.material.CustomBlock; ++import org.spoutcraft.api.material.MaterialData; ++ + public class EntityItem extends Entity { ++ ++ /** ++ * The age of this EntityItem (used to animate it up and down as well as expire it) ++ */ + public int age; + public int delayBeforeCanPickup; ++ ++ /** The health of this EntityItem. (For example, damage for tools) */ + private int health; ++ ++ /** The EntityItem's random initial float height. */ + public float hoverStart; + +- public EntityItem(World var1, double var2, double var4, double var6) { +- super(var1); ++ public EntityItem(World par1World, double par2, double par4, double par6) { ++ super(par1World); + this.health = 5; + this.hoverStart = (float)(Math.random() * Math.PI * 2.0D); + this.setSize(0.25F, 0.25F); + this.yOffset = this.height / 2.0F; +- this.setPosition(var2, var4, var6); ++ this.setPosition(par2, par4, par6); + this.rotationYaw = (float)(Math.random() * 360.0D); +- this.motionX = (double)((float)(Math.random() * (double)0.2F - (double)0.1F)); +- this.motionY = (double)0.2F; +- this.motionZ = (double)((float)(Math.random() * (double)0.2F - (double)0.1F)); +- } +- +- public EntityItem(World var1, double var2, double var4, double var6, ItemStack var8) { +- this(var1, var2, var4, var6); +- this.setEntityItemStack(var8); +- } +- ++ this.motionX = (double)((float)(Math.random() * 0.20000000298023224D - 0.10000000149011612D)); ++ this.motionY = 0.20000000298023224D; ++ this.motionZ = (double)((float)(Math.random() * 0.20000000298023224D - 0.10000000149011612D)); ++ } ++ ++ public EntityItem(World par1World, double par2, double par4, double par6, ItemStack par8ItemStack) { ++ this(par1World, par2, par4, par6); ++ this.setEntityItemStack(par8ItemStack); ++ } ++ ++ /** ++ * returns if this entity triggers Block.onEntityWalking on the blocks they walk on. used for spiders and wolves to ++ * prevent them from trampling crops ++ */ + protected boolean canTriggerWalking() { + return false; + } + +- public EntityItem(World var1) { +- super(var1); ++ public EntityItem(World par1World) { ++ super(par1World); + this.health = 5; + this.hoverStart = (float)(Math.random() * Math.PI * 2.0D); + this.setSize(0.25F, 0.25F); +@@ -42,88 +60,117 @@ + this.getDataWatcher().addObjectByDataType(10, 5); + } + ++ /** ++ * Called to update the entity's position/logic. ++ */ + public void onUpdate() { + super.onUpdate(); +- if(this.delayBeforeCanPickup > 0) { ++ ++ if (this.delayBeforeCanPickup > 0) { + --this.delayBeforeCanPickup; + } + + this.prevPosX = this.posX; + this.prevPosY = this.posY; + this.prevPosZ = this.posZ; +- this.motionY -= (double)0.04F; ++ this.motionY -= 0.03999999910593033D; + this.noClip = this.pushOutOfBlocks(this.posX, (this.boundingBox.minY + this.boundingBox.maxY) / 2.0D, this.posZ); + this.moveEntity(this.motionX, this.motionY, this.motionZ); + boolean var1 = (int)this.prevPosX != (int)this.posX || (int)this.prevPosY != (int)this.posY || (int)this.prevPosZ != (int)this.posZ; +- if(var1 || this.ticksExisted % 25 == 0) { +- if(this.worldObj.getBlockMaterial(MathHelper.floor_double(this.posX), MathHelper.floor_double(this.posY), MathHelper.floor_double(this.posZ)) == Material.lava) { +- this.motionY = (double)0.2F; +- this.motionX = (double)((this.ab.nextFloat() - this.ab.nextFloat()) * 0.2F); +- this.motionZ = (double)((this.ab.nextFloat() - this.ab.nextFloat()) * 0.2F); +- this.playSound("random.fizz", 0.4F, 2.0F + this.ab.nextFloat() * 0.4F); ++ ++ if (var1 || this.ticksExisted % 25 == 0) { ++ if (this.worldObj.getBlockMaterial(MathHelper.floor_double(this.posX), MathHelper.floor_double(this.posY), MathHelper.floor_double(this.posZ)) == Material.lava) { ++ this.motionY = 0.20000000298023224D; ++ this.motionX = (double)((this.rand.nextFloat() - this.rand.nextFloat()) * 0.2F); ++ this.motionZ = (double)((this.rand.nextFloat() - this.rand.nextFloat()) * 0.2F); ++ this.playSound("random.fizz", 0.4F, 2.0F + this.rand.nextFloat() * 0.4F); + } + +- if(!this.worldObj.isRemote) { ++ if (!this.worldObj.isRemote) { + this.searchForOtherItemsNearby(); + } + } + + float var2 = 0.98F; +- if(this.onGround) { +- var2 = 0.1F * 0.1F * 58.8F; ++ ++ if (this.onGround) { ++ var2 = 0.58800006F; + int var3 = this.worldObj.getBlockId(MathHelper.floor_double(this.posX), MathHelper.floor_double(this.boundingBox.minY) - 1, MathHelper.floor_double(this.posZ)); +- if(var3 > 0) { ++ ++ if (var3 > 0) { + var2 = Block.blocksList[var3].slipperiness * 0.98F; ++ // Spout Start ++ if (!worldObj.isRemote) { ++ int x = MathHelper.floor_double(this.posX); ++ int y = MathHelper.floor_double(this.boundingBox.minY) - 1; ++ int z = MathHelper.floor_double(this.posZ); ++ short customId = Spoutcraft.getChunkAt(worldObj, x, y, z).getCustomBlockId(x, y, z); ++ if (customId > 0) { ++ CustomBlock block = MaterialData.getCustomBlock(customId); ++ if (block != null) { ++ var2 = block.getFriction() * 0.98F; ++ } ++ } ++ } ++ // Spout End + } + } + + this.motionX *= (double)var2; +- this.motionY *= (double)0.98F; ++ this.motionY *= 0.9800000190734863D; + this.motionZ *= (double)var2; +- if(this.onGround) { ++ ++ if (this.onGround) { + this.motionY *= -0.5D; + } + + ++this.age; +- if(!this.worldObj.isRemote && this.age >= 6000) { ++ ++ if (!this.worldObj.isRemote && this.age >= 6000) { + this.setDead(); + } +- + } + ++ /** ++ * Looks for other itemstacks nearby and tries to stack them together ++ */ + private void searchForOtherItemsNearby() { + Iterator var1 = this.worldObj.getEntitiesWithinAABB(EntityItem.class, this.boundingBox.expand(0.5D, 0.0D, 0.5D)).iterator(); + +- while(var1.hasNext()) { ++ while (var1.hasNext()) { + EntityItem var2 = (EntityItem)var1.next(); + this.combineItems(var2); + } +- + } + +- public boolean combineItems(EntityItem var1) { +- if(var1 == this) { ++ /** ++ * Tries to merge this item with the item passed as the parameter. Returns true if successful. Either this item or the ++ * other item will be removed from the world. ++ */ ++ public boolean combineItems(EntityItem par1EntityItem) { ++ if (par1EntityItem == this) { + return false; +- } else if(var1.isEntityAlive() && this.isEntityAlive()) { ++ } else if (par1EntityItem.isEntityAlive() && this.isEntityAlive()) { + ItemStack var2 = this.getEntityItem(); +- ItemStack var3 = var1.getEntityItem(); +- if(var3.getItem() != var2.getItem()) { +- return false; +- } else if(var3.hasTagCompound() ^ var2.hasTagCompound()) { +- return false; +- } else if(var3.hasTagCompound() && !var3.getTagCompound().equals(var2.getTagCompound())) { +- return false; +- } else if(var3.getItem().getHasSubtypes() && var3.getItemDamage() != var2.getItemDamage()) { +- return false; +- } else if(var3.stackSize < var2.stackSize) { +- return var1.combineItems(this); +- } else if(var3.stackSize + var2.stackSize > var3.getMaxStackSize()) { ++ ItemStack var3 = par1EntityItem.getEntityItem(); ++ ++ if (var3.getItem() != var2.getItem()) { ++ return false; ++ } else if (var3.hasTagCompound() ^ var2.hasTagCompound()) { ++ return false; ++ } else if (var3.hasTagCompound() && !var3.getTagCompound().equals(var2.getTagCompound())) { ++ return false; ++ } else if (var3.getItem().getHasSubtypes() && var3.getItemDamage() != var2.getItemDamage()) { ++ return false; ++ } else if (var3.stackSize < var2.stackSize) { ++ return par1EntityItem.combineItems(this); ++ } else if (var3.stackSize + var2.stackSize > var3.getMaxStackSize()) { + return false; + } else { + var3.stackSize += var2.stackSize; +- var1.delayBeforeCanPickup = Math.max(var1.delayBeforeCanPickup, this.delayBeforeCanPickup); +- var1.age = Math.min(var1.age, this.age); +- var1.setEntityItemStack(var3); ++ par1EntityItem.delayBeforeCanPickup = Math.max(par1EntityItem.delayBeforeCanPickup, this.delayBeforeCanPickup); ++ par1EntityItem.age = Math.min(par1EntityItem.age, this.age); ++ par1EntityItem.setEntityItemStack(var3); + this.setDead(); + return true; + } +@@ -132,27 +179,41 @@ + } + } + ++ /** ++ * sets the age of the item so that it'll despawn one minute after it has been dropped (instead of five). Used when ++ * items are dropped from players in creative mode ++ */ + public void setAgeToCreativeDespawnTime() { + this.age = 4800; + } + ++ /** ++ * Returns if this entity is in water and will end up adding the waters velocity to the entity ++ */ + public boolean handleWaterMovement() { + return this.worldObj.handleMaterialAcceleration(this.boundingBox, Material.water, this); + } + +- protected void dealFireDamage(int var1) { +- this.attackEntityFrom(DamageSource.inFire, (float)var1); ++ /** ++ * Will deal the specified amount of damage to the entity if the entity isn't immune to fire damage. Args: amountDamage ++ */ ++ protected void dealFireDamage(int par1) { ++ this.attackEntityFrom(DamageSource.inFire, (float)par1); + } + +- public boolean attackEntityFrom(DamageSource var1, float var2) { +- if(this.isEntityInvulnerable()) { ++ /** ++ * Called when the entity is attacked. ++ */ ++ public boolean attackEntityFrom(DamageSource par1DamageSource, float par2) { ++ if (this.isEntityInvulnerable()) { + return false; +- } else if(this.getEntityItem() != null && this.getEntityItem().itemID == Item.netherStar.itemID && var1.isExplosion()) { ++ } else if (this.getEntityItem() != null && this.getEntityItem().itemID == Item.netherStar.itemID && par1DamageSource.isExplosion()) { + return false; + } else { + this.setBeenAttacked(); +- this.health = (int)((float)this.health - var2); +- if(this.health <= 0) { ++ this.health = (int)((float)this.health - par2); ++ ++ if (this.health <= 0) { + this.setDead(); + } + +@@ -160,77 +221,101 @@ + } + } + +- public void writeEntityToNBT(NBTTagCompound var1) { +- var1.setShort("Health", (short)((byte)this.health)); +- var1.setShort("Age", (short)this.age); +- if(this.getEntityItem() != null) { +- var1.setCompoundTag("Item", this.getEntityItem().writeToNBT(new NBTTagCompound())); ++ /** ++ * (abstract) Protected helper method to write subclass entity data to NBT. ++ */ ++ public void writeEntityToNBT(NBTTagCompound par1NBTTagCompound) { ++ par1NBTTagCompound.setShort("Health", (short)((byte)this.health)); ++ par1NBTTagCompound.setShort("Age", (short)this.age); ++ ++ if (this.getEntityItem() != null) { ++ par1NBTTagCompound.setCompoundTag("Item", this.getEntityItem().writeToNBT(new NBTTagCompound())); + } +- + } + +- public void readEntityFromNBT(NBTTagCompound var1) { +- this.health = var1.getShort("Health") & 255; +- this.age = var1.getShort("Age"); +- NBTTagCompound var2 = var1.getCompoundTag("Item"); ++ /** ++ * (abstract) Protected helper method to read subclass entity data from NBT. ++ */ ++ public void readEntityFromNBT(NBTTagCompound par1NBTTagCompound) { ++ this.health = par1NBTTagCompound.getShort("Health") & 255; ++ this.age = par1NBTTagCompound.getShort("Age"); ++ NBTTagCompound var2 = par1NBTTagCompound.getCompoundTag("Item"); + this.setEntityItemStack(ItemStack.loadItemStackFromNBT(var2)); +- if(this.getEntityItem() == null) { ++ ++ if (this.getEntityItem() == null) { + this.setDead(); + } +- + } + +- public void onCollideWithPlayer(EntityPlayer var1) { +- if(!this.worldObj.isRemote) { ++ /** ++ * Called by a player entity when they collide with an entity ++ */ ++ public void onCollideWithPlayer(EntityPlayer par1EntityPlayer) { ++ if (!this.worldObj.isRemote) { + ItemStack var2 = this.getEntityItem(); + int var3 = var2.stackSize; +- if(this.delayBeforeCanPickup == 0 && var1.inventory.addItemStackToInventory(var2)) { +- if(var2.itemID == Block.wood.blockID) { +- var1.triggerAchievement(AchievementList.mineWood); +- } +- +- if(var2.itemID == Item.leather.itemID) { +- var1.triggerAchievement(AchievementList.killCow); +- } +- +- if(var2.itemID == Item.diamond.itemID) { +- var1.triggerAchievement(AchievementList.diamonds); +- } +- +- if(var2.itemID == Item.blazeRod.itemID) { +- var1.triggerAchievement(AchievementList.blazeRod); +- } +- +- this.playSound("random.pop", 0.2F, ((this.ab.nextFloat() - this.ab.nextFloat()) * 0.7F + 1.0F) * 2.0F); +- var1.onItemPickup(this, var3); +- if(var2.stackSize <= 0) { ++ ++ if (this.delayBeforeCanPickup == 0 && par1EntityPlayer.inventory.addItemStackToInventory(var2)) { ++ if (var2.itemID == Block.wood.blockID) { ++ par1EntityPlayer.triggerAchievement(AchievementList.mineWood); ++ } ++ ++ if (var2.itemID == Item.leather.itemID) { ++ par1EntityPlayer.triggerAchievement(AchievementList.killCow); ++ } ++ ++ if (var2.itemID == Item.diamond.itemID) { ++ par1EntityPlayer.triggerAchievement(AchievementList.diamonds); ++ } ++ ++ if (var2.itemID == Item.blazeRod.itemID) { ++ par1EntityPlayer.triggerAchievement(AchievementList.blazeRod); ++ } ++ ++ this.playSound("random.pop", 0.2F, ((this.rand.nextFloat() - this.rand.nextFloat()) * 0.7F + 1.0F) * 2.0F); ++ par1EntityPlayer.onItemPickup(this, var3); ++ ++ if (var2.stackSize <= 0) { + this.setDead(); + } + } +- + } + } + ++ /** ++ * Gets the username of the entity. ++ */ + public String getEntityName() { + return StatCollector.translateToLocal("item." + this.getEntityItem().getUnlocalizedName()); + } + ++ /** ++ * If returns false, the item will not inflict any damage against entities. ++ */ + public boolean canAttackWithItem() { + return false; + } + +- public void travelToDimension(int var1) { +- super.travelToDimension(var1); +- if(!this.worldObj.isRemote) { ++ /** ++ * Teleports the entity to another dimension. Params: Dimension number to teleport to ++ */ ++ public void travelToDimension(int par1) { ++ super.travelToDimension(par1); ++ ++ if (!this.worldObj.isRemote) { + this.searchForOtherItemsNearby(); + } +- + } + ++ /** ++ * Returns the ItemStack corresponding to the Entity (Note: if no item exists, will log an error but still return an ++ * ItemStack containing Block.stone) ++ */ + public ItemStack getEntityItem() { + ItemStack var1 = this.getDataWatcher().getWatchableObjectItemStack(10); +- if(var1 == null) { +- if(this.worldObj != null) { ++ ++ if (var1 == null) { ++ if (this.worldObj != null) { + this.worldObj.getWorldLogAgent().logSevere("Item entity " + this.entityId + " has no item?!"); + } + +@@ -240,8 +325,11 @@ + } + } + +- public void setEntityItemStack(ItemStack var1) { +- this.getDataWatcher().updateObject(10, var1); ++ /** ++ * Sets the ItemStack for this entity ++ */ ++ public void setEntityItemStack(ItemStack par1ItemStack) { ++ this.getDataWatcher().updateObject(10, par1ItemStack); + this.getDataWatcher().setObjectWatched(10); + } + } diff --git a/patches/net/minecraft/src/EntityItemFrame.java.patch b/patches/net/minecraft/src/EntityItemFrame.java.patch new file mode 100644 index 0000000..1fab61a --- /dev/null +++ b/patches/net/minecraft/src/EntityItemFrame.java.patch @@ -0,0 +1,190 @@ +--- net/minecraft/src/EntityItemFrame.java ++++ net/minecraft/src/EntityItemFrame.java +@@ -1,15 +1,17 @@ + package net.minecraft.src; + + public class EntityItemFrame extends EntityHanging { ++ ++ /** Chance for this item frame's item to drop from the frame. */ + private float itemDropChance = 1.0F; + +- public EntityItemFrame(World var1) { +- super(var1); ++ public EntityItemFrame(World par1World) { ++ super(par1World); + } + +- public EntityItemFrame(World var1, int var2, int var3, int var4, int var5) { +- super(var1, var2, var3, var4, var5); +- this.setDirection(var5); ++ public EntityItemFrame(World par1World, int par2, int par3, int par4, int par5) { ++ super(par1World, par2, par3, par4, par5); ++ this.setDirection(par5); + } + + protected void entityInit() { +@@ -25,39 +27,51 @@ + return 9; + } + +- public boolean isInRangeToRenderDist(double var1) { ++ /** ++ * Checks if the entity is in range to render by using the past in distance and comparing it to its average edge length ++ * * 64 * renderDistanceWeight Args: distance ++ */ ++ public boolean isInRangeToRenderDist(double par1) { + double var3 = 16.0D; + var3 *= 64.0D * this.renderDistanceWeight; +- return var1 < var3 * var3; ++ return par1 < var3 * var3; + } + +- public void onBroken(Entity var1) { ++ /** ++ * Called when this entity is broken. Entity parameter may be null. ++ */ ++ public void onBroken(Entity par1Entity) { + ItemStack var2 = this.getDisplayedItem(); +- if(var1 instanceof EntityPlayer) { +- EntityPlayer var3 = (EntityPlayer)var1; +- if(var3.capabilities.isCreativeMode) { ++ ++ if (par1Entity instanceof EntityPlayer) { ++ EntityPlayer var3 = (EntityPlayer)par1Entity; ++ ++ if (var3.capabilities.isCreativeMode) { + this.removeFrameFromMap(var2); + return; + } + } + + this.entityDropItem(new ItemStack(Item.itemFrame), 0.0F); +- if(var2 != null && this.ab.nextFloat() < this.itemDropChance) { ++ ++ if (var2 != null && this.rand.nextFloat() < this.itemDropChance) { + var2 = var2.copy(); + this.removeFrameFromMap(var2); + this.entityDropItem(var2, 0.0F); + } +- + } + +- private void removeFrameFromMap(ItemStack var1) { +- if(var1 != null) { +- if(var1.itemID == Item.map.itemID) { +- MapData var2 = ((ItemMap)var1.getItem()).getMapData(var1, this.worldObj); +- var2.g.remove("frame-" + this.entityId); ++ /** ++ * Removes the dot representing this frame's position from the map when the item frame is broken. ++ */ ++ private void removeFrameFromMap(ItemStack par1ItemStack) { ++ if (par1ItemStack != null) { ++ if (par1ItemStack.itemID == Item.map.itemID) { ++ MapData var2 = ((ItemMap)par1ItemStack.getItem()).getMapData(par1ItemStack, this.worldObj); ++ var2.playersVisibleOnMap.remove("frame-" + this.entityId); + } + +- var1.setItemFrame((EntityItemFrame)null); ++ par1ItemStack.setItemFrame((EntityItemFrame)null); + } + } + +@@ -65,55 +79,71 @@ + return this.getDataWatcher().getWatchableObjectItemStack(2); + } + +- public void setDisplayedItem(ItemStack var1) { +- var1 = var1.copy(); +- var1.stackSize = 1; +- var1.setItemFrame(this); +- this.getDataWatcher().updateObject(2, var1); ++ public void setDisplayedItem(ItemStack par1ItemStack) { ++ par1ItemStack = par1ItemStack.copy(); ++ par1ItemStack.stackSize = 1; ++ par1ItemStack.setItemFrame(this); ++ this.getDataWatcher().updateObject(2, par1ItemStack); + this.getDataWatcher().setObjectWatched(2); + } + ++ /** ++ * Return the rotation of the item currently on this frame. ++ */ + public int getRotation() { + return this.getDataWatcher().getWatchableObjectByte(3); + } + +- public void setItemRotation(int var1) { +- this.getDataWatcher().updateObject(3, Byte.valueOf((byte)(var1 % 4))); ++ public void setItemRotation(int par1) { ++ this.getDataWatcher().updateObject(3, Byte.valueOf((byte)(par1 % 4))); + } + +- public void writeEntityToNBT(NBTTagCompound var1) { +- if(this.getDisplayedItem() != null) { +- var1.setCompoundTag("Item", this.getDisplayedItem().writeToNBT(new NBTTagCompound())); +- var1.setByte("ItemRotation", (byte)this.getRotation()); +- var1.setFloat("ItemDropChance", this.itemDropChance); ++ /** ++ * (abstract) Protected helper method to write subclass entity data to NBT. ++ */ ++ public void writeEntityToNBT(NBTTagCompound par1NBTTagCompound) { ++ if (this.getDisplayedItem() != null) { ++ par1NBTTagCompound.setCompoundTag("Item", this.getDisplayedItem().writeToNBT(new NBTTagCompound())); ++ par1NBTTagCompound.setByte("ItemRotation", (byte)this.getRotation()); ++ par1NBTTagCompound.setFloat("ItemDropChance", this.itemDropChance); + } + +- super.writeEntityToNBT(var1); ++ super.writeEntityToNBT(par1NBTTagCompound); + } + +- public void readEntityFromNBT(NBTTagCompound var1) { +- NBTTagCompound var2 = var1.getCompoundTag("Item"); +- if(var2 != null && !var2.hasNoTags()) { ++ /** ++ * (abstract) Protected helper method to read subclass entity data from NBT. ++ */ ++ public void readEntityFromNBT(NBTTagCompound par1NBTTagCompound) { ++ NBTTagCompound var2 = par1NBTTagCompound.getCompoundTag("Item"); ++ ++ if (var2 != null && !var2.hasNoTags()) { + this.setDisplayedItem(ItemStack.loadItemStackFromNBT(var2)); +- this.setItemRotation(var1.getByte("ItemRotation")); +- if(var1.hasKey("ItemDropChance")) { +- this.itemDropChance = var1.getFloat("ItemDropChance"); ++ this.setItemRotation(par1NBTTagCompound.getByte("ItemRotation")); ++ ++ if (par1NBTTagCompound.hasKey("ItemDropChance")) { ++ this.itemDropChance = par1NBTTagCompound.getFloat("ItemDropChance"); + } + } + +- super.readEntityFromNBT(var1); ++ super.readEntityFromNBT(par1NBTTagCompound); + } + +- public boolean interactFirst(EntityPlayer var1) { +- if(this.getDisplayedItem() == null) { +- ItemStack var2 = var1.getHeldItem(); +- if(var2 != null && !this.worldObj.isRemote) { ++ /** ++ * First layer of player interaction ++ */ ++ public boolean interactFirst(EntityPlayer par1EntityPlayer) { ++ if (this.getDisplayedItem() == null) { ++ ItemStack var2 = par1EntityPlayer.getHeldItem(); ++ ++ if (var2 != null && !this.worldObj.isRemote) { + this.setDisplayedItem(var2); +- if(!var1.capabilities.isCreativeMode && --var2.stackSize <= 0) { +- var1.inventory.setInventorySlotContents(var1.inventory.currentItem, (ItemStack)null); ++ ++ if (!par1EntityPlayer.capabilities.isCreativeMode && --var2.stackSize <= 0) { ++ par1EntityPlayer.inventory.setInventorySlotContents(par1EntityPlayer.inventory.currentItem, (ItemStack)null); + } + } +- } else if(!this.worldObj.isRemote) { ++ } else if (!this.worldObj.isRemote) { + this.setItemRotation(this.getRotation() + 1); + } + diff --git a/patches/net/minecraft/src/EntityJumpHelper.java.patch b/patches/net/minecraft/src/EntityJumpHelper.java.patch new file mode 100644 index 0000000..3daa98a --- /dev/null +++ b/patches/net/minecraft/src/EntityJumpHelper.java.patch @@ -0,0 +1,22 @@ +--- net/minecraft/src/EntityJumpHelper.java ++++ net/minecraft/src/EntityJumpHelper.java +@@ -4,14 +4,17 @@ + private EntityLiving entity; + private boolean isJumping; + +- public EntityJumpHelper(EntityLiving var1) { +- this.entity = var1; ++ public EntityJumpHelper(EntityLiving par1EntityLiving) { ++ this.entity = par1EntityLiving; + } + + public void setJumping() { + this.isJumping = true; + } + ++ /** ++ * Called to actually make the entity jump if isJumping is true. ++ */ + public void doJump() { + this.entity.setJumping(this.isJumping); + this.isJumping = false; diff --git a/patches/net/minecraft/src/EntityLargeExplodeFX.java.patch b/patches/net/minecraft/src/EntityLargeExplodeFX.java.patch new file mode 100644 index 0000000..e8d9458 --- /dev/null +++ b/patches/net/minecraft/src/EntityLargeExplodeFX.java.patch @@ -0,0 +1,95 @@ +--- net/minecraft/src/EntityLargeExplodeFX.java ++++ net/minecraft/src/EntityLargeExplodeFX.java +@@ -6,59 +6,65 @@ + private static final ResourceLocation field_110127_a = new ResourceLocation("textures/entity/explosion.png"); + private int field_70581_a; + private int field_70584_aq; ++ ++ /** The Rendering Engine. */ + private TextureManager theRenderEngine; + private float field_70582_as; + +- public EntityLargeExplodeFX(TextureManager var1, World var2, double var3, double var5, double var7, double var9, double var11, double var13) { +- super(var2, var3, var5, var7, 0.0D, 0.0D, 0.0D); +- this.theRenderEngine = var1; +- this.field_70584_aq = 6 + this.ab.nextInt(4); +- this.particleRed = this.particleGreen = this.particleBlue = this.ab.nextFloat() * 0.6F + 0.4F; +- this.field_70582_as = 1.0F - (float)var9 * 0.5F; ++ public EntityLargeExplodeFX(TextureManager par1TextureManager, World par2World, double par3, double par5, double par7, double par9, double par11, double par13) { ++ super(par2World, par3, par5, par7, 0.0D, 0.0D, 0.0D); ++ this.theRenderEngine = par1TextureManager; ++ this.field_70584_aq = 6 + this.rand.nextInt(4); ++ this.particleRed = this.particleGreen = this.particleBlue = this.rand.nextFloat() * 0.6F + 0.4F; ++ this.field_70582_as = 1.0F - (float)par9 * 0.5F; + } + +- public void renderParticle(Tessellator var1, float var2, float var3, float var4, float var5, float var6, float var7) { +- int var8 = (int)(((float)this.field_70581_a + var2) * 15.0F / (float)this.field_70584_aq); +- if(var8 <= 15) { ++ public void renderParticle(Tessellator par1Tessellator, float par2, float par3, float par4, float par5, float par6, float par7) { ++ int var8 = (int)(((float)this.field_70581_a + par2) * 15.0F / (float)this.field_70584_aq); ++ ++ if (var8 <= 15) { + this.theRenderEngine.bindTexture(field_110127_a); + float var9 = (float)(var8 % 4) / 4.0F; +- float var10 = var9 + 0.999F / 4.0F; ++ float var10 = var9 + 0.24975F; + float var11 = (float)(var8 / 4) / 4.0F; +- float var12 = var11 + 0.999F / 4.0F; ++ float var12 = var11 + 0.24975F; + float var13 = 2.0F * this.field_70582_as; +- float var14 = (float)(this.prevPosX + (this.posX - this.prevPosX) * (double)var2 - interpPosX); +- float var15 = (float)(this.prevPosY + (this.posY - this.prevPosY) * (double)var2 - interpPosY); +- float var16 = (float)(this.prevPosZ + (this.posZ - this.prevPosZ) * (double)var2 - interpPosZ); ++ float var14 = (float)(this.prevPosX + (this.posX - this.prevPosX) * (double)par2 - interpPosX); ++ float var15 = (float)(this.prevPosY + (this.posY - this.prevPosY) * (double)par2 - interpPosY); ++ float var16 = (float)(this.prevPosZ + (this.posZ - this.prevPosZ) * (double)par2 - interpPosZ); + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + GL11.glDisable(GL11.GL_LIGHTING); + RenderHelper.disableStandardItemLighting(); +- var1.startDrawingQuads(); +- var1.setColorRGBA_F(this.particleRed, this.particleGreen, this.particleBlue, 1.0F); +- var1.setNormal(0.0F, 1.0F, 0.0F); +- var1.setBrightness(240); +- var1.addVertexWithUV((double)(var14 - var3 * var13 - var6 * var13), (double)(var15 - var4 * var13), (double)(var16 - var5 * var13 - var7 * var13), (double)var10, (double)var12); +- var1.addVertexWithUV((double)(var14 - var3 * var13 + var6 * var13), (double)(var15 + var4 * var13), (double)(var16 - var5 * var13 + var7 * var13), (double)var10, (double)var11); +- var1.addVertexWithUV((double)(var14 + var3 * var13 + var6 * var13), (double)(var15 + var4 * var13), (double)(var16 + var5 * var13 + var7 * var13), (double)var9, (double)var11); +- var1.addVertexWithUV((double)(var14 + var3 * var13 - var6 * var13), (double)(var15 - var4 * var13), (double)(var16 + var5 * var13 - var7 * var13), (double)var9, (double)var12); +- var1.draw(); ++ par1Tessellator.startDrawingQuads(); ++ par1Tessellator.setColorRGBA_F(this.particleRed, this.particleGreen, this.particleBlue, 1.0F); ++ par1Tessellator.setNormal(0.0F, 1.0F, 0.0F); ++ par1Tessellator.setBrightness(240); ++ par1Tessellator.addVertexWithUV((double)(var14 - par3 * var13 - par6 * var13), (double)(var15 - par4 * var13), (double)(var16 - par5 * var13 - par7 * var13), (double)var10, (double)var12); ++ par1Tessellator.addVertexWithUV((double)(var14 - par3 * var13 + par6 * var13), (double)(var15 + par4 * var13), (double)(var16 - par5 * var13 + par7 * var13), (double)var10, (double)var11); ++ par1Tessellator.addVertexWithUV((double)(var14 + par3 * var13 + par6 * var13), (double)(var15 + par4 * var13), (double)(var16 + par5 * var13 + par7 * var13), (double)var9, (double)var11); ++ par1Tessellator.addVertexWithUV((double)(var14 + par3 * var13 - par6 * var13), (double)(var15 - par4 * var13), (double)(var16 + par5 * var13 - par7 * var13), (double)var9, (double)var12); ++ par1Tessellator.draw(); + GL11.glPolygonOffset(0.0F, 0.0F); + GL11.glEnable(GL11.GL_LIGHTING); + } + } + +- public int getBrightnessForRender(float var1) { +- return '\uf0f0'; ++ public int getBrightnessForRender(float par1) { ++ return 61680; + } + ++ /** ++ * Called to update the entity's position/logic. ++ */ + public void onUpdate() { + this.prevPosX = this.posX; + this.prevPosY = this.posY; + this.prevPosZ = this.posZ; + ++this.field_70581_a; +- if(this.field_70581_a == this.field_70584_aq) { ++ ++ if (this.field_70581_a == this.field_70584_aq) { + this.setDead(); + } +- + } + + public int getFXLayer() { diff --git a/patches/net/minecraft/src/EntityLargeFireball.java.patch b/patches/net/minecraft/src/EntityLargeFireball.java.patch new file mode 100644 index 0000000..492bc59 --- /dev/null +++ b/patches/net/minecraft/src/EntityLargeFireball.java.patch @@ -0,0 +1,80 @@ +--- net/minecraft/src/EntityLargeFireball.java ++++ net/minecraft/src/EntityLargeFireball.java +@@ -3,40 +3,48 @@ + public class EntityLargeFireball extends EntityFireball { + public int field_92057_e = 1; + +- public EntityLargeFireball(World var1) { +- super(var1); +- } +- +- public EntityLargeFireball(World var1, double var2, double var4, double var6, double var8, double var10, double var12) { +- super(var1, var2, var4, var6, var8, var10, var12); +- } +- +- public EntityLargeFireball(World var1, EntityLivingBase var2, double var3, double var5, double var7) { +- super(var1, var2, var3, var5, var7); +- } +- +- protected void onImpact(MovingObjectPosition var1) { +- if(!this.worldObj.isRemote) { +- if(var1.entityHit != null) { +- var1.entityHit.attackEntityFrom(DamageSource.causeFireballDamage(this, this.shootingEntity), 6.0F); ++ public EntityLargeFireball(World par1World) { ++ super(par1World); ++ } ++ ++ public EntityLargeFireball(World par1World, double par2, double par4, double par6, double par8, double par10, double par12) { ++ super(par1World, par2, par4, par6, par8, par10, par12); ++ } ++ ++ public EntityLargeFireball(World par1World, EntityLivingBase par2EntityLivingBase, double par3, double par5, double par7) { ++ super(par1World, par2EntityLivingBase, par3, par5, par7); ++ } ++ ++ /** ++ * Called when this EntityFireball hits a block or entity. ++ */ ++ protected void onImpact(MovingObjectPosition par1MovingObjectPosition) { ++ if (!this.worldObj.isRemote) { ++ if (par1MovingObjectPosition.entityHit != null) { ++ par1MovingObjectPosition.entityHit.attackEntityFrom(DamageSource.causeFireballDamage(this, this.shootingEntity), 6.0F); + } + + this.worldObj.newExplosion((Entity)null, this.posX, this.posY, this.posZ, (float)this.field_92057_e, true, this.worldObj.getGameRules().getGameRuleBooleanValue("mobGriefing")); + this.setDead(); + } +- +- } +- +- public void writeEntityToNBT(NBTTagCompound var1) { +- super.writeEntityToNBT(var1); +- var1.setInteger("ExplosionPower", this.field_92057_e); +- } +- +- public void readEntityFromNBT(NBTTagCompound var1) { +- super.readEntityFromNBT(var1); +- if(var1.hasKey("ExplosionPower")) { +- this.field_92057_e = var1.getInteger("ExplosionPower"); ++ } ++ ++ /** ++ * (abstract) Protected helper method to write subclass entity data to NBT. ++ */ ++ public void writeEntityToNBT(NBTTagCompound par1NBTTagCompound) { ++ super.writeEntityToNBT(par1NBTTagCompound); ++ par1NBTTagCompound.setInteger("ExplosionPower", this.field_92057_e); ++ } ++ ++ /** ++ * (abstract) Protected helper method to read subclass entity data from NBT. ++ */ ++ public void readEntityFromNBT(NBTTagCompound par1NBTTagCompound) { ++ super.readEntityFromNBT(par1NBTTagCompound); ++ ++ if (par1NBTTagCompound.hasKey("ExplosionPower")) { ++ this.field_92057_e = par1NBTTagCompound.getInteger("ExplosionPower"); + } +- + } + } diff --git a/patches/net/minecraft/src/EntityLavaFX.java.patch b/patches/net/minecraft/src/EntityLavaFX.java.patch new file mode 100644 index 0000000..97d2e8a --- /dev/null +++ b/patches/net/minecraft/src/EntityLavaFX.java.patch @@ -0,0 +1,105 @@ +--- net/minecraft/src/EntityLavaFX.java ++++ net/minecraft/src/EntityLavaFX.java +@@ -3,68 +3,77 @@ + public class EntityLavaFX extends EntityFX { + private float lavaParticleScale; + +- public EntityLavaFX(World var1, double var2, double var4, double var6) { +- super(var1, var2, var4, var6, 0.0D, 0.0D, 0.0D); +- this.motionX *= (double)0.8F; +- this.motionY *= (double)0.8F; +- this.motionZ *= (double)0.8F; +- this.motionY = (double)(this.ab.nextFloat() * 0.4F + 0.05F); ++ public EntityLavaFX(World par1World, double par2, double par4, double par6) { ++ super(par1World, par2, par4, par6, 0.0D, 0.0D, 0.0D); ++ this.motionX *= 0.800000011920929D; ++ this.motionY *= 0.800000011920929D; ++ this.motionZ *= 0.800000011920929D; ++ this.motionY = (double)(this.rand.nextFloat() * 0.4F + 0.05F); + this.particleRed = this.particleGreen = this.particleBlue = 1.0F; +- this.particleScale *= this.ab.nextFloat() * 2.0F + 0.2F; ++ this.particleScale *= this.rand.nextFloat() * 2.0F + 0.2F; + this.lavaParticleScale = this.particleScale; + this.particleMaxAge = (int)(16.0D / (Math.random() * 0.8D + 0.2D)); + this.noClip = false; + this.setParticleTextureIndex(49); + } + +- public int getBrightnessForRender(float var1) { +- float var2 = ((float)this.particleAge + var1) / (float)this.particleMaxAge; +- if(var2 < 0.0F) { ++ public int getBrightnessForRender(float par1) { ++ float var2 = ((float)this.particleAge + par1) / (float)this.particleMaxAge; ++ ++ if (var2 < 0.0F) { + var2 = 0.0F; + } + +- if(var2 > 1.0F) { ++ if (var2 > 1.0F) { + var2 = 1.0F; + } + +- int var3 = super.getBrightnessForRender(var1); ++ int var3 = super.getBrightnessForRender(par1); + short var4 = 240; + int var5 = var3 >> 16 & 255; + return var4 | var5 << 16; + } + +- public float getBrightness(float var1) { ++ /** ++ * Gets how bright this entity is. ++ */ ++ public float getBrightness(float par1) { + return 1.0F; + } + +- public void renderParticle(Tessellator var1, float var2, float var3, float var4, float var5, float var6, float var7) { +- float var8 = ((float)this.particleAge + var2) / (float)this.particleMaxAge; ++ public void renderParticle(Tessellator par1Tessellator, float par2, float par3, float par4, float par5, float par6, float par7) { ++ float var8 = ((float)this.particleAge + par2) / (float)this.particleMaxAge; + this.particleScale = this.lavaParticleScale * (1.0F - var8 * var8); +- super.renderParticle(var1, var2, var3, var4, var5, var6, var7); ++ super.renderParticle(par1Tessellator, par2, par3, par4, par5, par6, par7); + } + ++ /** ++ * Called to update the entity's position/logic. ++ */ + public void onUpdate() { + this.prevPosX = this.posX; + this.prevPosY = this.posY; + this.prevPosZ = this.posZ; +- if(this.particleAge++ >= this.particleMaxAge) { ++ ++ if (this.particleAge++ >= this.particleMaxAge) { + this.setDead(); + } + + float var1 = (float)this.particleAge / (float)this.particleMaxAge; +- if(this.ab.nextFloat() > var1) { ++ ++ if (this.rand.nextFloat() > var1) { + this.worldObj.spawnParticle("smoke", this.posX, this.posY, this.posZ, this.motionX, this.motionY, this.motionZ); + } + + this.motionY -= 0.03D; + this.moveEntity(this.motionX, this.motionY, this.motionZ); +- this.motionX *= (double)0.999F; +- this.motionY *= (double)0.999F; +- this.motionZ *= (double)0.999F; +- if(this.onGround) { +- this.motionX *= (double)0.7F; +- this.motionZ *= (double)0.7F; +- } ++ this.motionX *= 0.9990000128746033D; ++ this.motionY *= 0.9990000128746033D; ++ this.motionZ *= 0.9990000128746033D; + ++ if (this.onGround) { ++ this.motionX *= 0.699999988079071D; ++ this.motionZ *= 0.699999988079071D; ++ } + } + } diff --git a/patches/net/minecraft/src/EntityLeashKnot.java.patch b/patches/net/minecraft/src/EntityLeashKnot.java.patch new file mode 100644 index 0000000..9441334 --- /dev/null +++ b/patches/net/minecraft/src/EntityLeashKnot.java.patch @@ -0,0 +1,177 @@ +--- net/minecraft/src/EntityLeashKnot.java ++++ net/minecraft/src/EntityLeashKnot.java +@@ -4,21 +4,20 @@ + import java.util.List; + + public class EntityLeashKnot extends EntityHanging { +- public EntityLeashKnot(World var1) { +- super(var1); ++ public EntityLeashKnot(World par1World) { ++ super(par1World); + } + +- public EntityLeashKnot(World var1, int var2, int var3, int var4) { +- super(var1, var2, var3, var4, 0); +- this.setPosition((double)var2 + 0.5D, (double)var3 + 0.5D, (double)var4 + 0.5D); ++ public EntityLeashKnot(World par1World, int par2, int par3, int par4) { ++ super(par1World, par2, par3, par4, 0); ++ this.setPosition((double)par2 + 0.5D, (double)par3 + 0.5D, (double)par4 + 0.5D); + } + + protected void entityInit() { + super.entityInit(); + } + +- public void setDirection(int var1) { +- } ++ public void setDirection(int par1) {} + + public int getWidthPixels() { + return 9; +@@ -28,39 +27,59 @@ + return 9; + } + +- public boolean isInRangeToRenderDist(double var1) { +- return var1 < 1024.0D; +- } +- +- public void onBroken(Entity var1) { +- } +- +- public boolean writeToNBTOptional(NBTTagCompound var1) { ++ /** ++ * Checks if the entity is in range to render by using the past in distance and comparing it to its average edge length ++ * * 64 * renderDistanceWeight Args: distance ++ */ ++ public boolean isInRangeToRenderDist(double par1) { ++ return par1 < 1024.0D; ++ } ++ ++ /** ++ * Called when this entity is broken. Entity parameter may be null. ++ */ ++ public void onBroken(Entity par1Entity) {} ++ ++ /** ++ * Either write this entity to the NBT tag given and return true, or return false without doing anything. If this ++ * returns false the entity is not saved on disk. Ridden entities return false here as they are saved with their rider. ++ */ ++ public boolean writeToNBTOptional(NBTTagCompound par1NBTTagCompound) { + return false; + } + +- public void writeEntityToNBT(NBTTagCompound var1) { +- } +- +- public void readEntityFromNBT(NBTTagCompound var1) { +- } +- +- public boolean interactFirst(EntityPlayer var1) { +- ItemStack var2 = var1.getHeldItem(); ++ /** ++ * (abstract) Protected helper method to write subclass entity data to NBT. ++ */ ++ public void writeEntityToNBT(NBTTagCompound par1NBTTagCompound) {} ++ ++ /** ++ * (abstract) Protected helper method to read subclass entity data from NBT. ++ */ ++ public void readEntityFromNBT(NBTTagCompound par1NBTTagCompound) {} ++ ++ /** ++ * First layer of player interaction ++ */ ++ public boolean interactFirst(EntityPlayer par1EntityPlayer) { ++ ItemStack var2 = par1EntityPlayer.getHeldItem(); + boolean var3 = false; + double var4; + List var6; + Iterator var7; + EntityLiving var8; +- if(var2 != null && var2.itemID == Item.leash.itemID && !this.worldObj.isRemote) { ++ ++ if (var2 != null && var2.itemID == Item.leash.itemID && !this.worldObj.isRemote) { + var4 = 7.0D; + var6 = this.worldObj.getEntitiesWithinAABB(EntityLiving.class, AxisAlignedBB.getAABBPool().getAABB(this.posX - var4, this.posY - var4, this.posZ - var4, this.posX + var4, this.posY + var4, this.posZ + var4)); +- if(var6 != null) { ++ ++ if (var6 != null) { + var7 = var6.iterator(); + +- while(var7.hasNext()) { ++ while (var7.hasNext()) { + var8 = (EntityLiving)var7.next(); +- if(var8.getLeashed() && var8.getLeashedToEntity() == var1) { ++ ++ if (var8.getLeashed() && var8.getLeashedToEntity() == par1EntityPlayer) { + var8.setLeashedToEntity(this, true); + var3 = true; + } +@@ -68,17 +87,20 @@ + } + } + +- if(!this.worldObj.isRemote && !var3) { ++ if (!this.worldObj.isRemote && !var3) { + this.setDead(); +- if(var1.capabilities.isCreativeMode) { ++ ++ if (par1EntityPlayer.capabilities.isCreativeMode) { + var4 = 7.0D; + var6 = this.worldObj.getEntitiesWithinAABB(EntityLiving.class, AxisAlignedBB.getAABBPool().getAABB(this.posX - var4, this.posY - var4, this.posZ - var4, this.posX + var4, this.posY + var4, this.posZ + var4)); +- if(var6 != null) { ++ ++ if (var6 != null) { + var7 = var6.iterator(); + +- while(var7.hasNext()) { ++ while (var7.hasNext()) { + var8 = (EntityLiving)var7.next(); +- if(var8.getLeashed() && var8.getLeashedToEntity() == this) { ++ ++ if (var8.getLeashed() && var8.getLeashedToEntity() == this) { + var8.clearLeashed(true, false); + } + } +@@ -89,27 +111,32 @@ + return true; + } + ++ /** ++ * checks to make sure painting can be placed there ++ */ + public boolean onValidSurface() { + int var1 = this.worldObj.getBlockId(this.xPosition, this.yPosition, this.zPosition); + return Block.blocksList[var1] != null && Block.blocksList[var1].getRenderType() == 11; + } + +- public static EntityLeashKnot func_110129_a(World var0, int var1, int var2, int var3) { +- EntityLeashKnot var4 = new EntityLeashKnot(var0, var1, var2, var3); ++ public static EntityLeashKnot func_110129_a(World par0World, int par1, int par2, int par3) { ++ EntityLeashKnot var4 = new EntityLeashKnot(par0World, par1, par2, par3); + var4.forceSpawn = true; +- var0.spawnEntityInWorld(var4); ++ par0World.spawnEntityInWorld(var4); + return var4; + } + +- public static EntityLeashKnot getKnotForBlock(World var0, int var1, int var2, int var3) { +- List var4 = var0.getEntitiesWithinAABB(EntityLeashKnot.class, AxisAlignedBB.getAABBPool().getAABB((double)var1 - 1.0D, (double)var2 - 1.0D, (double)var3 - 1.0D, (double)var1 + 1.0D, (double)var2 + 1.0D, (double)var3 + 1.0D)); ++ public static EntityLeashKnot getKnotForBlock(World par0World, int par1, int par2, int par3) { ++ List var4 = par0World.getEntitiesWithinAABB(EntityLeashKnot.class, AxisAlignedBB.getAABBPool().getAABB((double)par1 - 1.0D, (double)par2 - 1.0D, (double)par3 - 1.0D, (double)par1 + 1.0D, (double)par2 + 1.0D, (double)par3 + 1.0D)); + Object var5 = null; +- if(var4 != null) { ++ ++ if (var4 != null) { + Iterator var6 = var4.iterator(); + +- while(var6.hasNext()) { ++ while (var6.hasNext()) { + EntityLeashKnot var7 = (EntityLeashKnot)var6.next(); +- if(var7.xPosition == var1 && var7.yPosition == var2 && var7.zPosition == var3) { ++ ++ if (var7.xPosition == par1 && var7.yPosition == par2 && var7.zPosition == par3) { + return var7; + } + } diff --git a/patches/net/minecraft/src/EntityLightningBolt.java.patch b/patches/net/minecraft/src/EntityLightningBolt.java.patch new file mode 100644 index 0000000..f0730c5 --- /dev/null +++ b/patches/net/minecraft/src/EntityLightningBolt.java.patch @@ -0,0 +1,160 @@ +--- net/minecraft/src/EntityLightningBolt.java ++++ net/minecraft/src/EntityLightningBolt.java +@@ -3,88 +3,114 @@ + import java.util.List; + + public class EntityLightningBolt extends EntityWeatherEffect { ++ ++ /** ++ * Declares which state the lightning bolt is in. Whether it's in the air, hit the ground, etc. ++ */ + private int lightningState; ++ ++ /** ++ * A random long that is used to change the vertex of the lightning rendered in RenderLightningBolt ++ */ + public long boltVertex; ++ ++ /** ++ * Determines the time before the EntityLightningBolt is destroyed. It is a random integer decremented over time. ++ */ + private int boltLivingTime; + +- public EntityLightningBolt(World var1, double var2, double var4, double var6) { +- super(var1); +- this.setLocationAndAngles(var2, var4, var6, 0.0F, 0.0F); ++ public EntityLightningBolt(World par1World, double par2, double par4, double par6) { ++ super(par1World); ++ this.setLocationAndAngles(par2, par4, par6, 0.0F, 0.0F); + this.lightningState = 2; +- this.boltVertex = this.ab.nextLong(); +- this.boltLivingTime = this.ab.nextInt(3) + 1; +- if(!var1.isRemote && var1.getGameRules().getGameRuleBooleanValue("doFireTick") && var1.difficultySetting >= 2 && var1.doChunksNearChunkExist(MathHelper.floor_double(var2), MathHelper.floor_double(var4), MathHelper.floor_double(var6), 10)) { +- int var8 = MathHelper.floor_double(var2); +- int var9 = MathHelper.floor_double(var4); +- int var10 = MathHelper.floor_double(var6); +- if(var1.getBlockId(var8, var9, var10) == 0 && Block.fire.canPlaceBlockAt(var1, var8, var9, var10)) { +- var1.setBlock(var8, var9, var10, Block.fire.blockID); ++ this.boltVertex = this.rand.nextLong(); ++ this.boltLivingTime = this.rand.nextInt(3) + 1; ++ ++ if (!par1World.isRemote && par1World.getGameRules().getGameRuleBooleanValue("doFireTick") && par1World.difficultySetting >= 2 && par1World.doChunksNearChunkExist(MathHelper.floor_double(par2), MathHelper.floor_double(par4), MathHelper.floor_double(par6), 10)) { ++ int var8 = MathHelper.floor_double(par2); ++ int var9 = MathHelper.floor_double(par4); ++ int var10 = MathHelper.floor_double(par6); ++ ++ if (par1World.getBlockId(var8, var9, var10) == 0 && Block.fire.canPlaceBlockAt(par1World, var8, var9, var10)) { ++ par1World.setBlock(var8, var9, var10, Block.fire.blockID); + } + +- for(var8 = 0; var8 < 4; ++var8) { +- var9 = MathHelper.floor_double(var2) + this.ab.nextInt(3) - 1; +- var10 = MathHelper.floor_double(var4) + this.ab.nextInt(3) - 1; +- int var11 = MathHelper.floor_double(var6) + this.ab.nextInt(3) - 1; +- if(var1.getBlockId(var9, var10, var11) == 0 && Block.fire.canPlaceBlockAt(var1, var9, var10, var11)) { +- var1.setBlock(var9, var10, var11, Block.fire.blockID); ++ for (var8 = 0; var8 < 4; ++var8) { ++ var9 = MathHelper.floor_double(par2) + this.rand.nextInt(3) - 1; ++ var10 = MathHelper.floor_double(par4) + this.rand.nextInt(3) - 1; ++ int var11 = MathHelper.floor_double(par6) + this.rand.nextInt(3) - 1; ++ ++ if (par1World.getBlockId(var9, var10, var11) == 0 && Block.fire.canPlaceBlockAt(par1World, var9, var10, var11)) { ++ par1World.setBlock(var9, var10, var11, Block.fire.blockID); + } + } + } +- + } + ++ /** ++ * Called to update the entity's position/logic. ++ */ + public void onUpdate() { + super.onUpdate(); +- if(this.lightningState == 2) { +- this.worldObj.playSoundEffect(this.posX, this.posY, this.posZ, "ambient.weather.thunder", 10000.0F, 0.8F + this.ab.nextFloat() * 0.2F); +- this.worldObj.playSoundEffect(this.posX, this.posY, this.posZ, "random.explode", 2.0F, 0.5F + this.ab.nextFloat() * 0.2F); ++ ++ if (this.lightningState == 2) { ++ this.worldObj.playSoundEffect(this.posX, this.posY, this.posZ, "ambient.weather.thunder", 10000.0F, 0.8F + this.rand.nextFloat() * 0.2F); ++ this.worldObj.playSoundEffect(this.posX, this.posY, this.posZ, "random.explode", 2.0F, 0.5F + this.rand.nextFloat() * 0.2F); + } + + --this.lightningState; +- if(this.lightningState < 0) { +- if(this.boltLivingTime == 0) { ++ ++ if (this.lightningState < 0) { ++ if (this.boltLivingTime == 0) { + this.setDead(); +- } else if(this.lightningState < -this.ab.nextInt(10)) { ++ } else if (this.lightningState < -this.rand.nextInt(10)) { + --this.boltLivingTime; + this.lightningState = 1; +- this.boltVertex = this.ab.nextLong(); +- if(!this.worldObj.isRemote && this.worldObj.getGameRules().getGameRuleBooleanValue("doFireTick") && this.worldObj.doChunksNearChunkExist(MathHelper.floor_double(this.posX), MathHelper.floor_double(this.posY), MathHelper.floor_double(this.posZ), 10)) { ++ this.boltVertex = this.rand.nextLong(); ++ ++ if (!this.worldObj.isRemote && this.worldObj.getGameRules().getGameRuleBooleanValue("doFireTick") && this.worldObj.doChunksNearChunkExist(MathHelper.floor_double(this.posX), MathHelper.floor_double(this.posY), MathHelper.floor_double(this.posZ), 10)) { + int var1 = MathHelper.floor_double(this.posX); + int var2 = MathHelper.floor_double(this.posY); + int var3 = MathHelper.floor_double(this.posZ); +- if(this.worldObj.getBlockId(var1, var2, var3) == 0 && Block.fire.canPlaceBlockAt(this.worldObj, var1, var2, var3)) { ++ ++ if (this.worldObj.getBlockId(var1, var2, var3) == 0 && Block.fire.canPlaceBlockAt(this.worldObj, var1, var2, var3)) { + this.worldObj.setBlock(var1, var2, var3, Block.fire.blockID); + } + } + } + } + +- if(this.lightningState >= 0) { +- if(this.worldObj.isRemote) { ++ if (this.lightningState >= 0) { ++ if (this.worldObj.isRemote) { + this.worldObj.lastLightningBolt = 2; + } else { + double var6 = 3.0D; + List var7 = this.worldObj.getEntitiesWithinAABBExcludingEntity(this, AxisAlignedBB.getAABBPool().getAABB(this.posX - var6, this.posY - var6, this.posZ - var6, this.posX + var6, this.posY + 6.0D + var6, this.posZ + var6)); + +- for(int var4 = 0; var4 < var7.size(); ++var4) { ++ for (int var4 = 0; var4 < var7.size(); ++var4) { + Entity var5 = (Entity)var7.get(var4); + var5.onStruckByLightning(this); + } + } + } +- +- } +- +- protected void entityInit() { +- } +- +- protected void readEntityFromNBT(NBTTagCompound var1) { +- } +- +- protected void writeEntityToNBT(NBTTagCompound var1) { +- } +- +- public boolean isInRangeToRenderVec3D(Vec3 var1) { ++ } ++ ++ protected void entityInit() {} ++ ++ /** ++ * (abstract) Protected helper method to read subclass entity data from NBT. ++ */ ++ protected void readEntityFromNBT(NBTTagCompound par1NBTTagCompound) {} ++ ++ /** ++ * (abstract) Protected helper method to write subclass entity data to NBT. ++ */ ++ protected void writeEntityToNBT(NBTTagCompound par1NBTTagCompound) {} ++ ++ /** ++ * Checks using a Vec3d to determine if this entity is within range of that vector to be rendered. Args: vec3D ++ */ ++ public boolean isInRangeToRenderVec3D(Vec3 par1Vec3) { + return this.lightningState >= 0; + } + } diff --git a/patches/net/minecraft/src/EntityList.java.patch b/patches/net/minecraft/src/EntityList.java.patch new file mode 100644 index 0000000..8aff784 --- /dev/null +++ b/patches/net/minecraft/src/EntityList.java.patch @@ -0,0 +1,237 @@ +--- net/minecraft/src/EntityList.java ++++ net/minecraft/src/EntityList.java +@@ -4,34 +4,61 @@ + import java.util.LinkedHashMap; + import java.util.Map; + ++import com.prupe.mcpatcher.cc.ColorizeItem; ++ + public class EntityList { +- private static Map b = new HashMap(); +- private static Map c = new HashMap(); +- private static Map d = new HashMap(); +- private static Map e = new HashMap(); +- private static Map f = new HashMap(); +- public static HashMap a = new LinkedHashMap(); +- +- private static void addMapping(Class var0, String var1, int var2) { +- b.put(var1, var0); +- c.put(var0, var1); +- d.put(Integer.valueOf(var2), var0); +- e.put(var0, Integer.valueOf(var2)); +- f.put(var1, Integer.valueOf(var2)); +- } +- +- private static void addMapping(Class var0, String var1, int var2, int var3, int var4) { +- addMapping(var0, var1, var2); +- a.put(Integer.valueOf(var2), new EntityEggInfo(var2, var3, var4)); +- } +- +- public static Entity createEntityByName(String var0, World var1) { ++ ++ /** Provides a mapping between entity classes and a string */ ++ private static Map stringToClassMapping = new HashMap(); ++ ++ /** Provides a mapping between a string and an entity classes */ ++ private static Map classToStringMapping = new HashMap(); ++ ++ /** provides a mapping between an entityID and an Entity Class */ ++ private static Map IDtoClassMapping = new HashMap(); ++ ++ /** provides a mapping between an Entity Class and an entity ID */ ++ private static Map classToIDMapping = new HashMap(); ++ ++ /** Maps entity names to their numeric identifiers */ ++ private static Map stringToIDMapping = new HashMap(); ++ ++ /** This is a HashMap of the Creative Entity Eggs/Spawners. */ ++ public static HashMap entityEggs = new LinkedHashMap(); ++ ++ /** ++ * adds a mapping between Entity classes and both a string representation and an ID ++ */ ++ private static void addMapping(Class par0Class, String par1Str, int par2) { ++ stringToClassMapping.put(par1Str, par0Class); ++ classToStringMapping.put(par0Class, par1Str); ++ IDtoClassMapping.put(Integer.valueOf(par2), par0Class); ++ classToIDMapping.put(par0Class, Integer.valueOf(par2)); ++ stringToIDMapping.put(par1Str, Integer.valueOf(par2)); ++ } ++ ++ /** ++ * Adds a entity mapping with egg info. ++ */ ++ private static void addMapping(Class par0Class, String par1Str, int par2, int par3, int par4) { ++ // MCPatcher Start ++ ColorizeItem.setupSpawnerEgg(par1Str, par2, par3, par4); ++ // MCPatcher End ++ addMapping(par0Class, par1Str, par2); ++ entityEggs.put(Integer.valueOf(par2), new EntityEggInfo(par2, par3, par4)); ++ } ++ ++ /** ++ * Create a new instance of an entity in the world by using the entity name. ++ */ ++ public static Entity createEntityByName(String par0Str, World par1World) { + Entity var2 = null; + + try { +- Class var3 = (Class)b.get(var0); +- if(var3 != null) { +- var2 = (Entity)var3.getConstructor(new Class[]{World.class}).newInstance(new Object[]{var1}); ++ Class var3 = (Class)stringToClassMapping.get(par0Str); ++ ++ if (var3 != null) { ++ var2 = (Entity)var3.getConstructor(new Class[] {World.class}).newInstance(new Object[] {par1World}); + } + } catch (Exception var4) { + var4.printStackTrace(); +@@ -40,76 +67,99 @@ + return var2; + } + +- public static Entity createEntityFromNBT(NBTTagCompound var0, World var1) { ++ /** ++ * create a new instance of an entity from NBT store ++ */ ++ public static Entity createEntityFromNBT(NBTTagCompound par0NBTTagCompound, World par1World) { + Entity var2 = null; +- if("Minecart".equals(var0.getString("id"))) { +- switch(var0.getInteger("Type")) { +- case 0: +- var0.setString("id", "MinecartRideable"); +- break; +- case 1: +- var0.setString("id", "MinecartChest"); +- break; +- case 2: +- var0.setString("id", "MinecartFurnace"); ++ ++ if ("Minecart".equals(par0NBTTagCompound.getString("id"))) { ++ switch (par0NBTTagCompound.getInteger("Type")) { ++ case 0: ++ par0NBTTagCompound.setString("id", "MinecartRideable"); ++ break; ++ ++ case 1: ++ par0NBTTagCompound.setString("id", "MinecartChest"); ++ break; ++ ++ case 2: ++ par0NBTTagCompound.setString("id", "MinecartFurnace"); + } + +- var0.removeTag("Type"); ++ par0NBTTagCompound.removeTag("Type"); + } + + try { +- Class var3 = (Class)b.get(var0.getString("id")); +- if(var3 != null) { +- var2 = (Entity)var3.getConstructor(new Class[]{World.class}).newInstance(new Object[]{var1}); ++ Class var3 = (Class)stringToClassMapping.get(par0NBTTagCompound.getString("id")); ++ ++ if (var3 != null) { ++ var2 = (Entity)var3.getConstructor(new Class[] {World.class}).newInstance(new Object[] {par1World}); + } + } catch (Exception var4) { + var4.printStackTrace(); + } + +- if(var2 != null) { +- var2.readFromNBT(var0); ++ if (var2 != null) { ++ var2.readFromNBT(par0NBTTagCompound); + } else { +- var1.getWorldLogAgent().logWarning("Skipping Entity with id " + var0.getString("id")); ++ par1World.getWorldLogAgent().logWarning("Skipping Entity with id " + par0NBTTagCompound.getString("id")); + } + + return var2; + } + +- public static Entity createEntityByID(int var0, World var1) { ++ /** ++ * Create a new instance of an entity in the world by using an entity ID. ++ */ ++ public static Entity createEntityByID(int par0, World par1World) { + Entity var2 = null; + + try { +- Class var3 = getClassFromID(var0); +- if(var3 != null) { +- var2 = (Entity)var3.getConstructor(new Class[]{World.class}).newInstance(new Object[]{var1}); ++ Class var3 = getClassFromID(par0); ++ ++ if (var3 != null) { ++ var2 = (Entity)var3.getConstructor(new Class[] {World.class}).newInstance(new Object[] {par1World}); + } + } catch (Exception var4) { + var4.printStackTrace(); + } + +- if(var2 == null) { +- var1.getWorldLogAgent().logWarning("Skipping Entity with id " + var0); ++ if (var2 == null) { ++ par1World.getWorldLogAgent().logWarning("Skipping Entity with id " + par0); + } + + return var2; + } + +- public static int getEntityID(Entity var0) { +- Class var1 = var0.getClass(); +- return e.containsKey(var1) ? ((Integer)e.get(var1)).intValue() : 0; +- } +- +- public static Class getClassFromID(int var0) { +- return (Class)d.get(Integer.valueOf(var0)); +- } +- +- public static String getEntityString(Entity var0) { +- return (String)c.get(var0.getClass()); +- } +- +- public static String getStringFromID(int var0) { +- Class var1 = getClassFromID(var0); +- return var1 != null ? (String)c.get(var1) : null; ++ /** ++ * gets the entityID of a specific entity ++ */ ++ public static int getEntityID(Entity par0Entity) { ++ Class var1 = par0Entity.getClass(); ++ return classToIDMapping.containsKey(var1) ? ((Integer)classToIDMapping.get(var1)).intValue() : 0; ++ } ++ ++ /** ++ * Return the class assigned to this entity ID. ++ */ ++ public static Class getClassFromID(int par0) { ++ return (Class)IDtoClassMapping.get(Integer.valueOf(par0)); ++ } ++ ++ /** ++ * Gets the string representation of a specific entity. ++ */ ++ public static String getEntityString(Entity par0Entity) { ++ return (String)classToStringMapping.get(par0Entity.getClass()); ++ } ++ ++ /** ++ * Finds the class using IDtoClassMapping and classToStringMapping ++ */ ++ public static String getStringFromID(int par0) { ++ Class var1 = getClassFromID(par0); ++ return var1 != null ? (String)classToStringMapping.get(var1) : null; + } + + static { +@@ -143,7 +193,7 @@ + addMapping(EntitySkeleton.class, "Skeleton", 51, 12698049, 4802889); + addMapping(EntitySpider.class, "Spider", 52, 3419431, 11013646); + addMapping(EntityGiantZombie.class, "Giant", 53); +- addMapping(EntityZombie.class, "Zombie", 54, '\uafaf', 7969893); ++ addMapping(EntityZombie.class, "Zombie", 54, 44975, 7969893); + addMapping(EntitySlime.class, "Slime", 55, 5349438, 8306542); + addMapping(EntityGhast.class, "Ghast", 56, 16382457, 12369084); + addMapping(EntityPigZombie.class, "PigZombie", 57, 15373203, 5009705); diff --git a/patches/net/minecraft/src/EntityLiving.java.patch b/patches/net/minecraft/src/EntityLiving.java.patch new file mode 100644 index 0000000..4d9b93b --- /dev/null +++ b/patches/net/minecraft/src/EntityLiving.java.patch @@ -0,0 +1,1306 @@ +--- net/minecraft/src/EntityLiving.java ++++ net/minecraft/src/EntityLiving.java +@@ -5,43 +5,63 @@ + import java.util.UUID; + + public abstract class EntityLiving extends EntityLivingBase { ++ ++ /** Number of ticks since this EntityLiving last produced its sound */ + public int livingSoundTime; ++ ++ /** The experience points the Entity gives. */ + protected int experienceValue; + private EntityLookHelper lookHelper; + private EntityMoveHelper moveHelper; ++ ++ /** Entity jumping helper */ + private EntityJumpHelper jumpHelper; + private EntityBodyHelper bodyHelper; + private PathNavigate navigator; + protected final EntityAITasks tasks; + protected final EntityAITasks targetTasks; ++ ++ /** The active target the Task system uses for tracking */ ++ //Spout Start + private EntityLivingBase attackTarget; + private EntitySenses senses; ++ ++ /** Equipment (armor and held item) for this entity. */ + private ItemStack[] equipment = new ItemStack[5]; ++ ++ /** Chances for each equipment piece from dropping when this entity dies. */ + protected float[] equipmentDropChances = new float[5]; ++ ++ /** Whether this entity can pick up items from the ground. */ + private boolean canPickUpLoot; ++ ++ /** Whether this entity should NOT despawn. */ + private boolean persistenceRequired; + protected float defaultPitch; ++ ++ /** This entity's current target. */ + private Entity currentTarget; ++ ++ /** How long to keep a specific target entity */ + protected int numTicksToChaseTarget; + private boolean isLeashed; + private Entity leashedToEntity; + private NBTTagCompound field_110170_bx; + +- public EntityLiving(World var1) { +- super(var1); +- this.tasks = new EntityAITasks(var1 != null && var1.theProfiler != null ? var1.theProfiler : null); +- this.targetTasks = new EntityAITasks(var1 != null && var1.theProfiler != null ? var1.theProfiler : null); ++ public EntityLiving(World par1World) { ++ super(par1World); ++ this.tasks = new EntityAITasks(par1World != null && par1World.theProfiler != null ? par1World.theProfiler : null); ++ this.targetTasks = new EntityAITasks(par1World != null && par1World.theProfiler != null ? par1World.theProfiler : null); + this.lookHelper = new EntityLookHelper(this); + this.moveHelper = new EntityMoveHelper(this); + this.jumpHelper = new EntityJumpHelper(this); + this.bodyHelper = new EntityBodyHelper(this); +- this.navigator = new PathNavigate(this, var1); ++ this.navigator = new PathNavigate(this, par1World); + this.senses = new EntitySenses(this); + +- for(int var2 = 0; var2 < this.equipmentDropChances.length; ++var2) { ++ for (int var2 = 0; var2 < this.equipmentDropChances.length; ++var2) { + this.equipmentDropChances[var2] = 0.085F; + } +- + } + + protected void applyEntityAttributes() { +@@ -65,24 +85,39 @@ + return this.navigator; + } + ++ /** ++ * returns the EntitySenses Object for the EntityLiving ++ */ + public EntitySenses getEntitySenses() { + return this.senses; + } + ++ /** ++ * Gets the active target the Task system uses for tracking ++ */ + public EntityLivingBase getAttackTarget() { + return this.attackTarget; + } + +- public void setAttackTarget(EntityLivingBase var1) { +- this.attackTarget = var1; +- } +- +- public boolean canAttackClass(Class var1) { +- return EntityCreeper.class != var1 && EntityGhast.class != var1; +- } +- +- public void eatGrassBonus() { +- } ++ /** ++ * Sets the active target the Task system uses for tracking ++ */ ++ public void setAttackTarget(EntityLivingBase par1EntityLivingBase) { ++ this.attackTarget = par1EntityLivingBase; ++ } ++ ++ /** ++ * Returns true if this entity can attack entities of the specified class. ++ */ ++ public boolean canAttackClass(Class par1Class) { ++ return EntityCreeper.class != par1Class && EntityGhast.class != par1Class; ++ } ++ ++ /** ++ * This function applies the benefits of growing back wool and faster growing up to the acting entity. (This function ++ * is used in the AIEatGrass) ++ */ ++ public void eatGrassBonus() {} + + protected void entityInit() { + super.entityInit(); +@@ -90,22 +125,32 @@ + this.dataWatcher.addObject(10, ""); + } + ++ /** ++ * Get number of ticks, at least during which the living entity will be silent. ++ */ + public int getTalkInterval() { + return 80; + } + ++ /** ++ * Plays living's sound at its position ++ */ + public void playLivingSound() { + String var1 = this.getLivingSound(); +- if(var1 != null) { ++ ++ if (var1 != null) { + this.playSound(var1, this.getSoundVolume(), this.getSoundPitch()); + } +- + } + ++ /** ++ * Gets called every tick from main Entity class ++ */ + public void onEntityUpdate() { + super.onEntityUpdate(); + this.worldObj.theProfiler.startSection("mobBaseTick"); +- if(this.isEntityAlive() && this.ab.nextInt(1000) < this.livingSoundTime++) { ++ ++ if (this.isEntityAlive() && this.rand.nextInt(1000) < this.livingSoundTime++) { + this.livingSoundTime = -this.getTalkInterval(); + this.playLivingSound(); + } +@@ -113,14 +158,17 @@ + this.worldObj.theProfiler.endSection(); + } + +- protected int getExperiencePoints(EntityPlayer var1) { +- if(this.experienceValue > 0) { ++ /** ++ * Get the experience points the entity currently has. ++ */ ++ protected int getExperiencePoints(EntityPlayer par1EntityPlayer) { ++ if (this.experienceValue > 0) { + int var2 = this.experienceValue; +- ItemStack[] var3 = this.getInventory(); ++ ItemStack[] var3 = this.getLastActiveItems(); + +- for(int var4 = 0; var4 < var3.length; ++var4) { +- if(var3[var4] != null && this.equipmentDropChances[var4] <= 1.0F) { +- var2 += 1 + this.ab.nextInt(3); ++ for (int var4 = 0; var4 < var3.length; ++var4) { ++ if (var3[var4] != null && this.equipmentDropChances[var4] <= 1.0F) { ++ var2 += 1 + this.rand.nextInt(3); + } + } + +@@ -130,213 +178,241 @@ + } + } + ++ /** ++ * Spawns an explosion particle around the Entity's location ++ */ + public void spawnExplosionParticle() { +- for(int var1 = 0; var1 < 20; ++var1) { +- double var2 = this.ab.nextGaussian() * 0.02D; +- double var4 = this.ab.nextGaussian() * 0.02D; +- double var6 = this.ab.nextGaussian() * 0.02D; ++ for (int var1 = 0; var1 < 20; ++var1) { ++ double var2 = this.rand.nextGaussian() * 0.02D; ++ double var4 = this.rand.nextGaussian() * 0.02D; ++ double var6 = this.rand.nextGaussian() * 0.02D; + double var8 = 10.0D; +- this.worldObj.spawnParticle("explode", this.posX + (double)(this.ab.nextFloat() * this.width * 2.0F) - (double)this.width - var2 * var8, this.posY + (double)(this.ab.nextFloat() * this.height) - var4 * var8, this.posZ + (double)(this.ab.nextFloat() * this.width * 2.0F) - (double)this.width - var6 * var8, var2, var4, var6); ++ this.worldObj.spawnParticle("explode", this.posX + (double)(this.rand.nextFloat() * this.width * 2.0F) - (double)this.width - var2 * var8, this.posY + (double)(this.rand.nextFloat() * this.height) - var4 * var8, this.posZ + (double)(this.rand.nextFloat() * this.width * 2.0F) - (double)this.width - var6 * var8, var2, var4, var6); + } +- + } + ++ /** ++ * Called to update the entity's position/logic. ++ */ + public void onUpdate() { + super.onUpdate(); +- if(!this.worldObj.isRemote) { ++ ++ if (!this.worldObj.isRemote) { + this.func_110159_bB(); + } +- + } + +- protected float func_110146_f(float var1, float var2) { +- if(this.isAIEnabled()) { ++ protected float func_110146_f(float par1, float par2) { ++ if (this.isAIEnabled()) { + this.bodyHelper.func_75664_a(); +- return var2; ++ return par2; + } else { +- return super.func_110146_f(var1, var2); ++ return super.func_110146_f(par1, par2); + } + } + ++ /** ++ * Returns the sound this mob makes while it's alive. ++ */ + protected String getLivingSound() { + return null; + } + ++ /** ++ * Returns the item ID for the item the mob drops on death. ++ */ + protected int getDropItemId() { + return 0; + } + +- protected void dropFewItems(boolean var1, int var2) { ++ /** ++ * Drop 0-2 items of this living's type. @param par1 - Whether this entity has recently been hit by a player. @param ++ * par2 - Level of Looting used to kill this mob. ++ */ ++ protected void dropFewItems(boolean par1, int par2) { + int var3 = this.getDropItemId(); +- if(var3 > 0) { +- int var4 = this.ab.nextInt(3); +- if(var2 > 0) { +- var4 += this.ab.nextInt(var2 + 1); ++ ++ if (var3 > 0) { ++ int var4 = this.rand.nextInt(3); ++ ++ if (par2 > 0) { ++ var4 += this.rand.nextInt(par2 + 1); + } + +- for(int var5 = 0; var5 < var4; ++var5) { ++ for (int var5 = 0; var5 < var4; ++var5) { + this.dropItem(var3, 1); + } + } +- + } + +- public void writeEntityToNBT(NBTTagCompound var1) { +- super.writeEntityToNBT(var1); +- var1.setBoolean("CanPickUpLoot", this.canPickUpLoot()); +- var1.setBoolean("PersistenceRequired", this.persistenceRequired); ++ /** ++ * (abstract) Protected helper method to write subclass entity data to NBT. ++ */ ++ public void writeEntityToNBT(NBTTagCompound par1NBTTagCompound) { ++ super.writeEntityToNBT(par1NBTTagCompound); ++ par1NBTTagCompound.setBoolean("CanPickUpLoot", this.canPickUpLoot()); ++ par1NBTTagCompound.setBoolean("PersistenceRequired", this.persistenceRequired); + NBTTagList var2 = new NBTTagList(); +- + NBTTagCompound var4; +- for(int var3 = 0; var3 < this.equipment.length; ++var3) { ++ ++ for (int var3 = 0; var3 < this.equipment.length; ++var3) { + var4 = new NBTTagCompound(); +- if(this.equipment[var3] != null) { ++ ++ if (this.equipment[var3] != null) { + this.equipment[var3].writeToNBT(var4); + } + + var2.appendTag(var4); + } + +- var1.setTag("Equipment", var2); ++ par1NBTTagCompound.setTag("Equipment", var2); + NBTTagList var6 = new NBTTagList(); + +- for(int var7 = 0; var7 < this.equipmentDropChances.length; ++var7) { ++ for (int var7 = 0; var7 < this.equipmentDropChances.length; ++var7) { + var6.appendTag(new NBTTagFloat(var7 + "", this.equipmentDropChances[var7])); + } + +- var1.setTag("DropChances", var6); +- var1.setString("CustomName", this.getCustomNameTag()); +- var1.setBoolean("CustomNameVisible", this.getAlwaysRenderNameTag()); +- var1.setBoolean("Leashed", this.isLeashed); +- if(this.leashedToEntity != null) { ++ par1NBTTagCompound.setTag("DropChances", var6); ++ par1NBTTagCompound.setString("CustomName", this.getCustomNameTag()); ++ par1NBTTagCompound.setBoolean("CustomNameVisible", this.getAlwaysRenderNameTag()); ++ par1NBTTagCompound.setBoolean("Leashed", this.isLeashed); ++ ++ if (this.leashedToEntity != null) { + var4 = new NBTTagCompound("Leash"); +- if(this.leashedToEntity instanceof EntityLivingBase) { ++ ++ if (this.leashedToEntity instanceof EntityLivingBase) { + var4.setLong("UUIDMost", this.leashedToEntity.getUniqueID().getMostSignificantBits()); + var4.setLong("UUIDLeast", this.leashedToEntity.getUniqueID().getLeastSignificantBits()); +- } else if(this.leashedToEntity instanceof EntityHanging) { ++ } else if (this.leashedToEntity instanceof EntityHanging) { + EntityHanging var5 = (EntityHanging)this.leashedToEntity; + var4.setInteger("X", var5.xPosition); + var4.setInteger("Y", var5.yPosition); + var4.setInteger("Z", var5.zPosition); + } + +- var1.setTag("Leash", var4); ++ par1NBTTagCompound.setTag("Leash", var4); + } +- + } + +- public void readEntityFromNBT(NBTTagCompound var1) { +- super.readEntityFromNBT(var1); +- this.setCanPickUpLoot(var1.getBoolean("CanPickUpLoot")); +- this.persistenceRequired = var1.getBoolean("PersistenceRequired"); +- if(var1.hasKey("CustomName") && var1.getString("CustomName").length() > 0) { +- this.setCustomNameTag(var1.getString("CustomName")); ++ /** ++ * (abstract) Protected helper method to read subclass entity data from NBT. ++ */ ++ ++ public void readEntityFromNBT(NBTTagCompound par1NBTTagCompound) { ++ super.readEntityFromNBT(par1NBTTagCompound); ++ this.setCanPickUpLoot(par1NBTTagCompound.getBoolean("CanPickUpLoot")); ++ this.persistenceRequired = par1NBTTagCompound.getBoolean("PersistenceRequired"); ++ ++ if (par1NBTTagCompound.hasKey("CustomName") && par1NBTTagCompound.getString("CustomName").length() > 0) { ++ this.setCustomNameTag(par1NBTTagCompound.getString("CustomName")); + } + +- this.setAlwaysRenderNameTag(var1.getBoolean("CustomNameVisible")); ++ this.setAlwaysRenderNameTag(par1NBTTagCompound.getBoolean("CustomNameVisible")); + NBTTagList var2; + int var3; +- if(var1.hasKey("Equipment")) { +- var2 = var1.getTagList("Equipment"); +- +- for(var3 = 0; var3 < this.equipment.length; ++var3) { ++ ++ if (par1NBTTagCompound.hasKey("Equipment")) { ++ var2 = par1NBTTagCompound.getTagList("Equipment"); ++ ++ for (var3 = 0; var3 < this.equipment.length; ++var3) { + this.equipment[var3] = ItemStack.loadItemStackFromNBT((NBTTagCompound)var2.tagAt(var3)); + } + } + +- if(var1.hasKey("DropChances")) { +- var2 = var1.getTagList("DropChances"); ++ if (par1NBTTagCompound.hasKey("DropChances")) { ++ var2 = par1NBTTagCompound.getTagList("DropChances"); + +- for(var3 = 0; var3 < var2.tagCount(); ++var3) { ++ for (var3 = 0; var3 < var2.tagCount(); ++var3) { + this.equipmentDropChances[var3] = ((NBTTagFloat)var2.tagAt(var3)).data; + } + } + +- this.isLeashed = var1.getBoolean("Leashed"); +- if(this.isLeashed && var1.hasKey("Leash")) { +- this.field_110170_bx = var1.getCompoundTag("Leash"); ++ this.isLeashed = par1NBTTagCompound.getBoolean("Leashed"); ++ ++ if (this.isLeashed && par1NBTTagCompound.hasKey("Leash")) { ++ this.field_110170_bx = par1NBTTagCompound.getCompoundTag("Leash"); + } +- +- } +- +- public void setMoveForward(float var1) { +- this.moveForward = var1; +- } +- +- public void setAIMoveSpeed(float var1) { +- super.setAIMoveSpeed(var1); +- this.setMoveForward(var1); +- } +- ++ } ++ ++ public void setMoveForward(float par1) { ++ this.moveForward = par1; ++ } ++ ++ /** ++ * set the movespeed used for the new AI system ++ */ ++ public void setAIMoveSpeed(float par1) { ++ super.setAIMoveSpeed(par1); ++ this.setMoveForward(par1); ++ } ++ ++ /** ++ * Called frequently so the entity can update its state every tick as required. For example, zombies and skeletons use ++ * this to react to sunlight and start to burn. ++ */ + public void onLivingUpdate() { + super.onLivingUpdate(); + this.worldObj.theProfiler.startSection("looting"); +- if(!this.worldObj.isRemote && this.canPickUpLoot() && !this.dead && this.worldObj.getGameRules().getGameRuleBooleanValue("mobGriefing")) { ++ ++ if (!this.worldObj.isRemote && this.canPickUpLoot() && !this.dead && this.worldObj.getGameRules().getGameRuleBooleanValue("mobGriefing")) { + List var1 = this.worldObj.getEntitiesWithinAABB(EntityItem.class, this.boundingBox.expand(1.0D, 0.0D, 1.0D)); + Iterator var2 = var1.iterator(); + +- label122: +- while(true) { +- EntityItem var3; +- ItemStack var4; +- int var5; +- do { +- do { +- do { +- if(!var2.hasNext()) { +- break label122; +- } +- +- var3 = (EntityItem)var2.next(); +- } while(var3.isDead); +- } while(var3.getEntityItem() == null); +- +- var4 = var3.getEntityItem(); +- var5 = getArmorPosition(var4); +- } while(var5 <= -1); +- +- boolean var6 = true; +- ItemStack var7 = this.getEquipmentInSlot(var5); +- if(var7 != null) { +- if(var5 == 0) { +- if(var4.getItem() instanceof ItemSword && !(var7.getItem() instanceof ItemSword)) { +- var6 = true; +- } else if(var4.getItem() instanceof ItemSword && var7.getItem() instanceof ItemSword) { +- ItemSword var10 = (ItemSword)var4.getItem(); +- ItemSword var11 = (ItemSword)var7.getItem(); +- if(var10.func_82803_g() != var11.func_82803_g()) { +- var6 = var10.func_82803_g() > var11.func_82803_g(); ++ while (var2.hasNext()) { ++ EntityItem var3 = (EntityItem)var2.next(); ++ ++ if (!var3.isDead && var3.getEntityItem() != null) { ++ ItemStack var4 = var3.getEntityItem(); ++ int var5 = getArmorPosition(var4); ++ ++ if (var5 > -1) { ++ boolean var6 = true; ++ ItemStack var7 = this.getCurrentItemOrArmor(var5); ++ ++ if (var7 != null) { ++ if (var5 == 0) { ++ if (var4.getItem() instanceof ItemSword && !(var7.getItem() instanceof ItemSword)) { ++ var6 = true; ++ } else if (var4.getItem() instanceof ItemSword && var7.getItem() instanceof ItemSword) { ++ ItemSword var8 = (ItemSword)var4.getItem(); ++ ItemSword var9 = (ItemSword)var7.getItem(); ++ ++ if (var8.func_82803_g() == var9.func_82803_g()) { ++ var6 = var4.getItemDamage() > var7.getItemDamage() || var4.hasTagCompound() && !var7.hasTagCompound(); ++ } else { ++ var6 = var8.func_82803_g() > var9.func_82803_g(); ++ } ++ } else { ++ var6 = false; ++ } ++ } else if (var4.getItem() instanceof ItemArmor && !(var7.getItem() instanceof ItemArmor)) { ++ var6 = true; ++ } else if (var4.getItem() instanceof ItemArmor && var7.getItem() instanceof ItemArmor) { ++ ItemArmor var10 = (ItemArmor)var4.getItem(); ++ ItemArmor var11 = (ItemArmor)var7.getItem(); ++ ++ if (var10.damageReduceAmount == var11.damageReduceAmount) { ++ var6 = var4.getItemDamage() > var7.getItemDamage() || var4.hasTagCompound() && !var7.hasTagCompound(); ++ } else { ++ var6 = var10.damageReduceAmount > var11.damageReduceAmount; ++ } + } else { +- var6 = var4.getItemDamage() > var7.getItemDamage() || var4.hasTagCompound() && !var7.hasTagCompound(); +- } +- } else { +- var6 = false; +- } +- } else if(var4.getItem() instanceof ItemArmor && !(var7.getItem() instanceof ItemArmor)) { +- var6 = true; +- } else if(var4.getItem() instanceof ItemArmor && var7.getItem() instanceof ItemArmor) { +- ItemArmor var8 = (ItemArmor)var4.getItem(); +- ItemArmor var9 = (ItemArmor)var7.getItem(); +- if(var8.damageReduceAmount != var9.damageReduceAmount) { +- var6 = var8.damageReduceAmount > var9.damageReduceAmount; +- } else { +- var6 = var4.getItemDamage() > var7.getItemDamage() || var4.hasTagCompound() && !var7.hasTagCompound(); +- } +- } else { +- var6 = false; +- } +- } +- +- if(var6) { +- if(var7 != null && this.ab.nextFloat() - 0.1F < this.equipmentDropChances[var5]) { +- this.entityDropItem(var7, 0.0F); +- } +- +- this.setCurrentItemOrArmor(var5, var4); +- this.equipmentDropChances[var5] = 2.0F; +- this.persistenceRequired = true; +- this.onItemPickup(var3, 1); +- var3.setDead(); ++ var6 = false; ++ } ++ } ++ ++ if (var6) { ++ if (var7 != null && this.rand.nextFloat() - 0.1F < this.equipmentDropChances[var5]) { ++ this.entityDropItem(var7, 0.0F); ++ } ++ ++ this.setCurrentItemOrArmor(var5, var4); ++ this.equipmentDropChances[var5] = 2.0F; ++ this.persistenceRequired = true; ++ this.onItemPickup(var3, 1); ++ var3.setDead(); ++ } ++ } + } + } + } +@@ -344,35 +420,45 @@ + this.worldObj.theProfiler.endSection(); + } + ++ /** ++ * Returns true if the newer Entity AI code should be run ++ */ + protected boolean isAIEnabled() { + return false; + } + ++ /** ++ * Determines if an entity can be despawned, used on idle far away entities ++ */ + protected boolean canDespawn() { + return true; + } + ++ /** ++ * Makes the entity despawn if requirements are reached ++ */ + protected void despawnEntity() { +- if(this.persistenceRequired) { ++ if (this.persistenceRequired) { + this.entityAge = 0; + } else { + EntityPlayer var1 = this.worldObj.getClosestPlayerToEntity(this, -1.0D); +- if(var1 != null) { ++ ++ if (var1 != null) { + double var2 = var1.posX - this.posX; + double var4 = var1.posY - this.posY; + double var6 = var1.posZ - this.posZ; + double var8 = var2 * var2 + var4 * var4 + var6 * var6; +- if(this.canDespawn() && var8 > 16384.0D) { ++ ++ if (this.canDespawn() && var8 > 16384.0D) { + this.setDead(); + } + +- if(this.entityAge > 600 && this.ab.nextInt(800) == 0 && var8 > 1024.0D && this.canDespawn()) { ++ if (this.entityAge > 600 && this.rand.nextInt(800) == 0 && var8 > 1024.0D && this.canDespawn()) { + this.setDead(); +- } else if(var8 < 1024.0D) { ++ } else if (var8 < 1024.0D) { + this.entityAge = 0; + } + } +- + } + } + +@@ -413,24 +499,27 @@ + this.moveForward = 0.0F; + this.despawnEntity(); + float var1 = 8.0F; +- if(this.ab.nextFloat() < 0.02F) { ++ ++ if (this.rand.nextFloat() < 0.02F) { + EntityPlayer var2 = this.worldObj.getClosestPlayerToEntity(this, (double)var1); +- if(var2 != null) { ++ ++ if (var2 != null) { + this.currentTarget = var2; +- this.numTicksToChaseTarget = 10 + this.ab.nextInt(20); ++ this.numTicksToChaseTarget = 10 + this.rand.nextInt(20); + } else { +- this.randomYawVelocity = (this.ab.nextFloat() - 0.5F) * 20.0F; ++ this.randomYawVelocity = (this.rand.nextFloat() - 0.5F) * 20.0F; + } + } + +- if(this.currentTarget != null) { ++ if (this.currentTarget != null) { + this.faceEntity(this.currentTarget, 10.0F, (float)this.getVerticalFaceSpeed()); +- if(this.numTicksToChaseTarget-- <= 0 || this.currentTarget.isDead || this.currentTarget.getDistanceSqToEntity(this) > (double)(var1 * var1)) { ++ ++ if (this.numTicksToChaseTarget-- <= 0 || this.currentTarget.isDead || this.currentTarget.getDistanceSqToEntity(this) > (double)(var1 * var1)) { + this.currentTarget = null; + } + } else { +- if(this.ab.nextFloat() < 0.05F) { +- this.randomYawVelocity = (this.ab.nextFloat() - 0.5F) * 20.0F; ++ if (this.rand.nextFloat() < 0.05F) { ++ this.randomYawVelocity = (this.rand.nextFloat() - 0.5F) * 20.0F; + } + + this.rotationYaw += this.randomYawVelocity; +@@ -439,66 +528,91 @@ + + boolean var4 = this.isInWater(); + boolean var3 = this.handleLavaMovement(); +- if(var4 || var3) { +- this.isJumping = this.ab.nextFloat() < 0.8F; ++ ++ if (var4 || var3) { ++ this.isJumping = this.rand.nextFloat() < 0.8F; + } +- + } + ++ /** ++ * The speed it takes to move the entityliving's rotationPitch through the faceEntity method. This is only currently ++ * use in wolves. ++ */ + public int getVerticalFaceSpeed() { + return 40; + } + +- public void faceEntity(Entity var1, float var2, float var3) { +- double var4 = var1.posX - this.posX; +- double var8 = var1.posZ - this.posZ; ++ /** ++ * Changes pitch and yaw so that the entity calling the function is facing the entity provided as an argument. ++ */ ++ public void faceEntity(Entity par1Entity, float par2, float par3) { ++ double var4 = par1Entity.posX - this.posX; ++ double var8 = par1Entity.posZ - this.posZ; + double var6; +- if(var1 instanceof EntityLivingBase) { +- EntityLivingBase var10 = (EntityLivingBase)var1; ++ ++ if (par1Entity instanceof EntityLivingBase) { ++ EntityLivingBase var10 = (EntityLivingBase)par1Entity; + var6 = var10.posY + (double)var10.getEyeHeight() - (this.posY + (double)this.getEyeHeight()); + } else { +- var6 = (var1.boundingBox.minY + var1.boundingBox.maxY) / 2.0D - (this.posY + (double)this.getEyeHeight()); ++ var6 = (par1Entity.boundingBox.minY + par1Entity.boundingBox.maxY) / 2.0D - (this.posY + (double)this.getEyeHeight()); + } + + double var14 = (double)MathHelper.sqrt_double(var4 * var4 + var8 * var8); +- float var12 = (float)(Math.atan2(var8, var4) * 180.0D / (double)((float)Math.PI)) - 90.0F; +- float var13 = (float)(-(Math.atan2(var6, var14) * 180.0D / (double)((float)Math.PI))); +- this.rotationPitch = this.updateRotation(this.rotationPitch, var13, var3); +- this.rotationYaw = this.updateRotation(this.rotationYaw, var12, var2); +- } +- +- private float updateRotation(float var1, float var2, float var3) { +- float var4 = MathHelper.wrapAngleTo180_float(var2 - var1); +- if(var4 > var3) { +- var4 = var3; +- } +- +- if(var4 < -var3) { +- var4 = -var3; +- } +- +- return var1 + var4; +- } +- ++ float var12 = (float)(Math.atan2(var8, var4) * 180.0D / Math.PI) - 90.0F; ++ float var13 = (float)(-(Math.atan2(var6, var14) * 180.0D / Math.PI)); ++ this.rotationPitch = this.updateRotation(this.rotationPitch, var13, par3); ++ this.rotationYaw = this.updateRotation(this.rotationYaw, var12, par2); ++ } ++ ++ /** ++ * Arguments: current rotation, intended rotation, max increment. ++ */ ++ private float updateRotation(float par1, float par2, float par3) { ++ float var4 = MathHelper.wrapAngleTo180_float(par2 - par1); ++ ++ if (var4 > par3) { ++ var4 = par3; ++ } ++ ++ if (var4 < -par3) { ++ var4 = -par3; ++ } ++ ++ return par1 + var4; ++ } ++ ++ /** ++ * Checks if the entity's current position is a valid location to spawn this entity. ++ */ + public boolean getCanSpawnHere() { + return this.worldObj.checkNoEntityCollision(this.boundingBox) && this.worldObj.getCollidingBoundingBoxes(this, this.boundingBox).isEmpty() && !this.worldObj.isAnyLiquid(this.boundingBox); + } + ++ /** ++ * Returns render size modifier ++ */ + public float getRenderSizeModifier() { + return 1.0F; + } + ++ /** ++ * Will return how many at most can spawn in a chunk at once. ++ */ + public int getMaxSpawnedInChunk() { + return 4; + } + ++ /** ++ * The number of iterations PathFinder.getSafePoint will execute before giving up. ++ */ + public int getMaxSafePointTries() { +- if(this.getAttackTarget() == null) { ++ if (this.getAttackTarget() == null) { + return 3; + } else { + int var1 = (int)(this.getHealth() - this.getMaxHealth() * 0.33F); + var1 -= (3 - this.worldObj.difficultySetting) * 4; +- if(var1 < 0) { ++ ++ if (var1 < 0) { + var1 = 0; + } + +@@ -506,39 +620,53 @@ + } + } + ++ /** ++ * Returns the item that this EntityLiving is holding, if any. ++ */ + public ItemStack getHeldItem() { + return this.equipment[0]; + } + +- public ItemStack getEquipmentInSlot(int var1) { +- return this.equipment[var1]; +- } +- +- public ItemStack func_130225_q(int var1) { +- return this.equipment[var1 + 1]; +- } +- +- public void setCurrentItemOrArmor(int var1, ItemStack var2) { +- this.equipment[var1] = var2; +- } +- +- public ItemStack[] getInventory() { ++ /** ++ * 0 = item, 1-n is armor ++ */ ++ public ItemStack getCurrentItemOrArmor(int par1) { ++ return this.equipment[par1]; ++ } ++ ++ public ItemStack func_130225_q(int par1) { ++ return this.equipment[par1 + 1]; ++ } ++ ++ /** ++ * Sets the held item, or an armor slot. Slot 0 is held item. Slot 1-4 is armor. Params: Item, slot ++ */ ++ public void setCurrentItemOrArmor(int par1, ItemStack par2ItemStack) { ++ this.equipment[par1] = par2ItemStack; ++ } ++ ++ public ItemStack[] getLastActiveItems() { + return this.equipment; + } + +- protected void dropEquipment(boolean var1, int var2) { +- for(int var3 = 0; var3 < this.getInventory().length; ++var3) { +- ItemStack var4 = this.getEquipmentInSlot(var3); ++ /** ++ * Drop the equipment for this entity. ++ */ ++ protected void dropEquipment(boolean par1, int par2) { ++ for (int var3 = 0; var3 < this.getLastActiveItems().length; ++var3) { ++ ItemStack var4 = this.getCurrentItemOrArmor(var3); + boolean var5 = this.equipmentDropChances[var3] > 1.0F; +- if(var4 != null && (var1 || var5) && this.ab.nextFloat() - (float)var2 * 0.01F < this.equipmentDropChances[var3]) { +- if(!var5 && var4.isItemStackDamageable()) { ++ ++ if (var4 != null && (par1 || var5) && this.rand.nextFloat() - (float)par2 * 0.01F < this.equipmentDropChances[var3]) { ++ if (!var5 && var4.isItemStackDamageable()) { + int var6 = Math.max(var4.getMaxDamage() - 25, 1); +- int var7 = var4.getMaxDamage() - this.ab.nextInt(this.ab.nextInt(var6) + 1); +- if(var7 > var6) { ++ int var7 = var4.getMaxDamage() - this.rand.nextInt(this.rand.nextInt(var6) + 1); ++ ++ if (var7 > var6) { + var7 = var6; + } + +- if(var7 < 1) { ++ if (var7 < 1) { + var7 = 1; + } + +@@ -548,54 +676,61 @@ + this.entityDropItem(var4, 0.0F); + } + } +- + } + ++ /** ++ * Makes entity wear random armor based on difficulty ++ */ + protected void addRandomArmor() { +- if(this.ab.nextFloat() < 0.15F * this.worldObj.getLocationTensionFactor(this.posX, this.posY, this.posZ)) { +- int var1 = this.ab.nextInt(2); ++ if (this.rand.nextFloat() < 0.15F * this.worldObj.getLocationTensionFactor(this.posX, this.posY, this.posZ)) { ++ int var1 = this.rand.nextInt(2); + float var2 = this.worldObj.difficultySetting == 3 ? 0.1F : 0.25F; +- if(this.ab.nextFloat() < 0.095F) { +- ++var1; +- } +- +- if(this.ab.nextFloat() < 0.095F) { +- ++var1; +- } +- +- if(this.ab.nextFloat() < 0.095F) { +- ++var1; +- } +- +- for(int var3 = 3; var3 >= 0; --var3) { ++ ++ if (this.rand.nextFloat() < 0.095F) { ++ ++var1; ++ } ++ ++ if (this.rand.nextFloat() < 0.095F) { ++ ++var1; ++ } ++ ++ if (this.rand.nextFloat() < 0.095F) { ++ ++var1; ++ } ++ ++ for (int var3 = 3; var3 >= 0; --var3) { + ItemStack var4 = this.func_130225_q(var3); +- if(var3 < 3 && this.ab.nextFloat() < var2) { ++ ++ if (var3 < 3 && this.rand.nextFloat() < var2) { + break; + } + +- if(var4 == null) { ++ if (var4 == null) { + Item var5 = getArmorItemForSlot(var3 + 1, var1); +- if(var5 != null) { ++ ++ if (var5 != null) { + this.setCurrentItemOrArmor(var3 + 1, new ItemStack(var5)); + } + } + } + } +- + } + +- public static int getArmorPosition(ItemStack var0) { +- if(var0.itemID != Block.pumpkin.blockID && var0.itemID != Item.skull.itemID) { +- if(var0.getItem() instanceof ItemArmor) { +- switch(((ItemArmor)var0.getItem()).armorType) { +- case 0: +- return 4; +- case 1: +- return 3; +- case 2: +- return 2; +- case 3: +- return 1; ++ public static int getArmorPosition(ItemStack par0ItemStack) { ++ if (par0ItemStack.itemID != Block.pumpkin.blockID && par0ItemStack.itemID != Item.skull.itemID) { ++ if (par0ItemStack.getItem() instanceof ItemArmor) { ++ switch (((ItemArmor)par0ItemStack.getItem()).armorType) { ++ case 0: ++ return 4; ++ ++ case 1: ++ return 3; ++ ++ case 2: ++ return 2; ++ ++ case 3: ++ return 1; + } + } + +@@ -605,85 +740,103 @@ + } + } + +- public static Item getArmorItemForSlot(int var0, int var1) { +- switch(var0) { +- case 4: +- if(var1 == 0) { +- return Item.helmetLeather; +- } else if(var1 == 1) { +- return Item.helmetGold; +- } else if(var1 == 2) { +- return Item.helmetChain; +- } else if(var1 == 3) { +- return Item.helmetIron; +- } else if(var1 == 4) { +- return Item.helmetDiamond; +- } +- case 3: +- if(var1 == 0) { +- return Item.plateLeather; +- } else if(var1 == 1) { +- return Item.plateGold; +- } else if(var1 == 2) { +- return Item.plateChain; +- } else if(var1 == 3) { +- return Item.plateIron; +- } else if(var1 == 4) { +- return Item.plateDiamond; +- } +- case 2: +- if(var1 == 0) { +- return Item.legsLeather; +- } else if(var1 == 1) { +- return Item.legsGold; +- } else if(var1 == 2) { +- return Item.legsChain; +- } else if(var1 == 3) { +- return Item.legsIron; +- } else if(var1 == 4) { +- return Item.legsDiamond; +- } +- case 1: +- if(var1 == 0) { +- return Item.bootsLeather; +- } else if(var1 == 1) { +- return Item.bootsGold; +- } else if(var1 == 2) { +- return Item.bootsChain; +- } else if(var1 == 3) { +- return Item.bootsIron; +- } else if(var1 == 4) { +- return Item.bootsDiamond; +- } +- default: +- return null; ++ /** ++ * Params: Armor slot, Item tier ++ */ ++ public static Item getArmorItemForSlot(int par0, int par1) { ++ switch (par0) { ++ case 4: ++ if (par1 == 0) { ++ return Item.helmetLeather; ++ } else if (par1 == 1) { ++ return Item.helmetGold; ++ } else if (par1 == 2) { ++ return Item.helmetChain; ++ } else if (par1 == 3) { ++ return Item.helmetIron; ++ } else if (par1 == 4) { ++ return Item.helmetDiamond; ++ } ++ ++ case 3: ++ if (par1 == 0) { ++ return Item.plateLeather; ++ } else if (par1 == 1) { ++ return Item.plateGold; ++ } else if (par1 == 2) { ++ return Item.plateChain; ++ } else if (par1 == 3) { ++ return Item.plateIron; ++ } else if (par1 == 4) { ++ return Item.plateDiamond; ++ } ++ ++ case 2: ++ if (par1 == 0) { ++ return Item.legsLeather; ++ } else if (par1 == 1) { ++ return Item.legsGold; ++ } else if (par1 == 2) { ++ return Item.legsChain; ++ } else if (par1 == 3) { ++ return Item.legsIron; ++ } else if (par1 == 4) { ++ return Item.legsDiamond; ++ } ++ ++ case 1: ++ if (par1 == 0) { ++ return Item.bootsLeather; ++ } else if (par1 == 1) { ++ return Item.bootsGold; ++ } else if (par1 == 2) { ++ return Item.bootsChain; ++ } else if (par1 == 3) { ++ return Item.bootsIron; ++ } else if (par1 == 4) { ++ return Item.bootsDiamond; ++ } ++ ++ default: ++ return null; + } + } + ++ /** ++ * Enchants the entity's armor and held item based on difficulty ++ */ + protected void enchantEquipment() { + float var1 = this.worldObj.getLocationTensionFactor(this.posX, this.posY, this.posZ); +- if(this.getHeldItem() != null && this.ab.nextFloat() < 0.25F * var1) { +- EnchantmentHelper.addRandomEnchantment(this.ab, this.getHeldItem(), (int)(5.0F + var1 * (float)this.ab.nextInt(18))); ++ ++ if (this.getHeldItem() != null && this.rand.nextFloat() < 0.25F * var1) { ++ EnchantmentHelper.addRandomEnchantment(this.rand, this.getHeldItem(), (int)(5.0F + var1 * (float)this.rand.nextInt(18))); + } + +- for(int var2 = 0; var2 < 4; ++var2) { ++ for (int var2 = 0; var2 < 4; ++var2) { + ItemStack var3 = this.func_130225_q(var2); +- if(var3 != null && this.ab.nextFloat() < 0.5F * var1) { +- EnchantmentHelper.addRandomEnchantment(this.ab, var3, (int)(5.0F + var1 * (float)this.ab.nextInt(18))); ++ ++ if (var3 != null && this.rand.nextFloat() < 0.5F * var1) { ++ EnchantmentHelper.addRandomEnchantment(this.rand, var3, (int)(5.0F + var1 * (float)this.rand.nextInt(18))); + } + } +- +- } +- +- public EntityLivingData onSpawnWithEgg(EntityLivingData var1) { +- this.getEntityAttribute(SharedMonsterAttributes.followRange).applyModifier(new AttributeModifier("Random spawn bonus", this.ab.nextGaussian() * 0.05D, 1)); +- return var1; +- } +- ++ } ++ ++ public EntityLivingData onSpawnWithEgg(EntityLivingData par1EntityLivingData) { ++ this.getEntityAttribute(SharedMonsterAttributes.followRange).applyModifier(new AttributeModifier("Random spawn bonus", this.rand.nextGaussian() * 0.05D, 1)); ++ return par1EntityLivingData; ++ } ++ ++ /** ++ * returns true if all the conditions for steering the entity are met. For pigs, this is true if it is being ridden by ++ * a player and the player is holding a carrot-on-a-stick ++ */ + public boolean canBeSteered() { + return false; + } + ++ /** ++ * Gets the username of the entity. ++ */ + public String getEntityName() { + return this.hasCustomNameTag() ? this.getCustomNameTag() : super.getEntityName(); + } +@@ -692,8 +845,8 @@ + this.persistenceRequired = true; + } + +- public void setCustomNameTag(String var1) { +- this.dataWatcher.updateObject(10, var1); ++ public void setCustomNameTag(String par1Str) { ++ this.dataWatcher.updateObject(10, par1Str); + } + + public String getCustomNameTag() { +@@ -704,8 +857,8 @@ + return this.dataWatcher.getWatchableObjectString(10).length() > 0; + } + +- public void setAlwaysRenderNameTag(boolean var1) { +- this.dataWatcher.updateObject(11, Byte.valueOf((byte)(var1 ? 1 : 0))); ++ public void setAlwaysRenderNameTag(boolean par1) { ++ this.dataWatcher.updateObject(11, Byte.valueOf((byte)(par1 ? 1 : 0))); + } + + public boolean getAlwaysRenderNameTag() { +@@ -716,79 +869,85 @@ + return this.getAlwaysRenderNameTag(); + } + +- public void setEquipmentDropChance(int var1, float var2) { +- this.equipmentDropChances[var1] = var2; ++ public void setEquipmentDropChance(int par1, float par2) { ++ this.equipmentDropChances[par1] = par2; + } + + public boolean canPickUpLoot() { + return this.canPickUpLoot; + } + +- public void setCanPickUpLoot(boolean var1) { +- this.canPickUpLoot = var1; ++ public void setCanPickUpLoot(boolean par1) { ++ this.canPickUpLoot = par1; + } + + public boolean isNoDespawnRequired() { + return this.persistenceRequired; + } + +- public final boolean interactFirst(EntityPlayer var1) { +- if(this.getLeashed() && this.getLeashedToEntity() == var1) { +- this.clearLeashed(true, !var1.capabilities.isCreativeMode); ++ /** ++ * First layer of player interaction ++ */ ++ public final boolean interactFirst(EntityPlayer par1EntityPlayer) { ++ if (this.getLeashed() && this.getLeashedToEntity() == par1EntityPlayer) { ++ this.clearLeashed(true, !par1EntityPlayer.capabilities.isCreativeMode); + return true; + } else { +- ItemStack var2 = var1.inventory.getCurrentItem(); +- if(var2 != null && var2.itemID == Item.leash.itemID && this.allowLeashing()) { +- if(!(this instanceof EntityTameable) || !((EntityTameable)this).isTamed()) { +- this.setLeashedToEntity(var1, true); +- --var2.stackSize; +- return true; +- } +- +- if(var1.getCommandSenderName().equalsIgnoreCase(((EntityTameable)this).getOwnerName())) { +- this.setLeashedToEntity(var1, true); +- --var2.stackSize; +- return true; +- } +- } +- +- if(this.interact(var1)) { +- return true; +- } else { +- return super.interactFirst(var1); +- } ++ ItemStack var2 = par1EntityPlayer.inventory.getCurrentItem(); ++ ++ if (var2 != null && var2.itemID == Item.leash.itemID && this.allowLeashing()) { ++ if (!(this instanceof EntityTameable) || !((EntityTameable)this).isTamed()) { ++ this.setLeashedToEntity(par1EntityPlayer, true); ++ --var2.stackSize; ++ return true; ++ } ++ ++ if (par1EntityPlayer.getCommandSenderName().equalsIgnoreCase(((EntityTameable)this).getOwnerName())) { ++ this.setLeashedToEntity(par1EntityPlayer, true); ++ --var2.stackSize; ++ return true; ++ } ++ } ++ ++ return this.interact(par1EntityPlayer) ? true : super.interactFirst(par1EntityPlayer); + } + } + +- protected boolean interact(EntityPlayer var1) { ++ /** ++ * Called when a player interacts with a mob. e.g. gets milk from a cow, gets into the saddle on a pig. ++ */ ++ protected boolean interact(EntityPlayer par1EntityPlayer) { + return false; + } + + protected void func_110159_bB() { +- if(this.field_110170_bx != null) { ++ if (this.field_110170_bx != null) { + this.recreateLeash(); + } + +- if(this.isLeashed) { +- if(this.leashedToEntity == null || this.leashedToEntity.isDead) { ++ if (this.isLeashed) { ++ if (this.leashedToEntity == null || this.leashedToEntity.isDead) { + this.clearLeashed(true, true); + } + } + } + +- public void clearLeashed(boolean var1, boolean var2) { +- if(this.isLeashed) { ++ /** ++ * Removes the leash from this entity. Second parameter tells whether to send a packet to surrounding players. ++ */ ++ public void clearLeashed(boolean par1, boolean par2) { ++ if (this.isLeashed) { + this.isLeashed = false; + this.leashedToEntity = null; +- if(!this.worldObj.isRemote && var2) { ++ ++ if (!this.worldObj.isRemote && par2) { + this.dropItem(Item.leash.itemID, 1); + } + +- if(!this.worldObj.isRemote && var1 && this.worldObj instanceof WorldServer) { +- ((WorldServer)this.worldObj).getEntityTracker().sendPacketToTrackedPlayers(this, new Packet39AttachEntity(1, this, (Entity)null)); ++ if (!this.worldObj.isRemote && par1 && this.worldObj instanceof WorldServer) { ++ ((WorldServer)this.worldObj).getEntityTracker().sendPacketToAllPlayersTrackingEntity(this, new Packet39AttachEntity(1, this, (Entity)null)); + } + } +- + } + + public boolean allowLeashing() { +@@ -803,35 +962,41 @@ + return this.leashedToEntity; + } + +- public void setLeashedToEntity(Entity var1, boolean var2) { ++ /** ++ * Sets the entity to be leashed to.\nArgs:\n@param par1Entity: The entity to be tethered to.\n@param par2: Whether to ++ * send an attaching notification packet to surrounding players. ++ */ ++ public void setLeashedToEntity(Entity par1Entity, boolean par2) { + this.isLeashed = true; +- this.leashedToEntity = var1; +- if(!this.worldObj.isRemote && var2 && this.worldObj instanceof WorldServer) { +- ((WorldServer)this.worldObj).getEntityTracker().sendPacketToTrackedPlayers(this, new Packet39AttachEntity(1, this, this.leashedToEntity)); +- } ++ this.leashedToEntity = par1Entity; + ++ if (!this.worldObj.isRemote && par2 && this.worldObj instanceof WorldServer) { ++ ((WorldServer)this.worldObj).getEntityTracker().sendPacketToAllPlayersTrackingEntity(this, new Packet39AttachEntity(1, this, this.leashedToEntity)); ++ } + } + + private void recreateLeash() { +- if(this.isLeashed && this.field_110170_bx != null) { +- if(this.field_110170_bx.hasKey("UUIDMost") && this.field_110170_bx.hasKey("UUIDLeast")) { ++ if (this.isLeashed && this.field_110170_bx != null) { ++ if (this.field_110170_bx.hasKey("UUIDMost") && this.field_110170_bx.hasKey("UUIDLeast")) { + UUID var5 = new UUID(this.field_110170_bx.getLong("UUIDMost"), this.field_110170_bx.getLong("UUIDLeast")); + List var6 = this.worldObj.getEntitiesWithinAABB(EntityLivingBase.class, this.boundingBox.expand(10.0D, 10.0D, 10.0D)); + Iterator var7 = var6.iterator(); + +- while(var7.hasNext()) { ++ while (var7.hasNext()) { + EntityLivingBase var8 = (EntityLivingBase)var7.next(); +- if(var8.getUniqueID().equals(var5)) { ++ ++ if (var8.getUniqueID().equals(var5)) { + this.leashedToEntity = var8; + break; + } + } +- } else if(this.field_110170_bx.hasKey("X") && this.field_110170_bx.hasKey("Y") && this.field_110170_bx.hasKey("Z")) { ++ } else if (this.field_110170_bx.hasKey("X") && this.field_110170_bx.hasKey("Y") && this.field_110170_bx.hasKey("Z")) { + int var1 = this.field_110170_bx.getInteger("X"); + int var2 = this.field_110170_bx.getInteger("Y"); + int var3 = this.field_110170_bx.getInteger("Z"); + EntityLeashKnot var4 = EntityLeashKnot.getKnotForBlock(this.worldObj, var1, var2, var3); +- if(var4 == null) { ++ ++ if (var4 == null) { + var4 = EntityLeashKnot.func_110129_a(this.worldObj, var1, var2, var3); + } + +@@ -842,5 +1007,5 @@ + } + + this.field_110170_bx = null; +- } ++ } + } diff --git a/patches/net/minecraft/src/EntityLivingBase.java.patch b/patches/net/minecraft/src/EntityLivingBase.java.patch new file mode 100644 index 0000000..6d009f2 --- /dev/null +++ b/patches/net/minecraft/src/EntityLivingBase.java.patch @@ -0,0 +1,2491 @@ +--- net/minecraft/src/EntityLivingBase.java ++++ net/minecraft/src/EntityLivingBase.java +@@ -1,5 +1,8 @@ + package net.minecraft.src; + ++import com.prupe.mcpatcher.cc.ColorizeEntity; ++import com.prupe.mcpatcher.mob.MobRandomizer$ExtraInfo; ++ + import java.util.Collection; + import java.util.HashMap; + import java.util.Iterator; +@@ -7,26 +10,56 @@ + import java.util.Random; + import java.util.UUID; + ++ ++//Spout Start ++import org.spoutcraft.api.entity.EntitySkinType; ++import org.spoutcraft.api.material.CustomBlock; ++import org.spoutcraft.api.material.MaterialData; ++import org.spoutcraft.client.entity.EntityData; ++import org.spoutcraft.client.io.CustomTextureManager; ++//Spout End ++ + public abstract class EntityLivingBase extends Entity { +- private static final UUID b = UUID.fromString("662A6B8D-DA3E-4C1C-8813-96EA6097278D"); +- private static final AttributeModifier sprintingSpeedBoostModifier = (new AttributeModifier(b, "Sprinting speed boost", (double)0.3F, 2)).setSaved(false); ++ private static final UUID sprintingSpeedBoostModifierUUID = UUID.fromString("662A6B8D-DA3E-4C1C-8813-96EA6097278D"); ++ private static final AttributeModifier sprintingSpeedBoostModifier = (new AttributeModifier(sprintingSpeedBoostModifierUUID, "Sprinting speed boost", 0.30000001192092896D, 2)).setSaved(false); + private BaseAttributeMap attributeMap; + private final CombatTracker _combatTracker = new CombatTracker(this); +- private final HashMap f = new HashMap(); ++ private final HashMap activePotionsMap = new HashMap(); ++ ++ /** The equipment this mob was previously wearing, used for syncing. */ + private final ItemStack[] previousEquipment = new ItemStack[5]; ++ ++ /** Whether an arm swing is currently in progress. */ + public boolean isSwingInProgress; + public int swingProgressInt; + public int arrowHitTimer; + public float prevHealth; ++ ++ /** ++ * The amount of time remaining this entity should act 'hurt'. (Visual appearance of red tint) ++ */ + public int hurtTime; ++ ++ /** What the hurt time was max set to last. */ + public int maxHurtTime; ++ ++ /** The yaw at which this entity was last attacked from. */ + public float attackedAtYaw; ++ ++ /** ++ * The amount of time remaining this entity should act 'dead', i.e. have a corpse in the world. ++ */ + public int deathTime; + public int attackTime; + public float prevSwingProgress; + public float swingProgress; + public float prevLimbSwingAmount; + public float limbSwingAmount; ++ ++ /** ++ * Only relevant when limbYaw is not 0(the entity is moving). Influences where in its swing legs and arms currently ++ * are. ++ */ + public float limbSwing; + public int maxHurtResistantTime = 20; + public float prevCameraPitch; +@@ -35,48 +68,111 @@ + public float field_70770_ap; + public float renderYawOffset; + public float prevRenderYawOffset; ++ ++ /** Entity head rotation yaw */ + public float rotationYawHead; ++ ++ /** Entity head rotation yaw at previous tick */ + public float prevRotationYawHead; ++ ++ /** ++ * A factor used to determine how far this entity will move each tick if it is jumping or falling. ++ */ + public float jumpMovementFactor = 0.02F; ++ ++ /** The most recent player that has attacked this entity */ + protected EntityPlayer attackingPlayer; ++ ++ /** ++ * Set to 60 when hit by the player or the player's wolf, then decrements. Used to determine whether the entity should ++ * drop items on death. ++ */ + protected int recentlyHit; ++ ++ /** ++ * This gets set on entity death, but never used. Looks like a duplicate of isDead ++ */ + protected boolean dead; ++ ++ /** Holds the living entity age, used to control the despawn. */ + protected int entityAge; + protected float field_70768_au; + protected float field_110154_aX; + protected float field_70764_aw; + protected float field_70763_ax; + protected float field_70741_aB; ++ ++ /** The score value of the Mob, the amount of points the mob is worth. */ + protected int scoreValue; +- protected float lastDamage; ++ ++ /** ++ * Damage taken in the last hit. Mobs are resistant to damage less than this for a short time after taking damage. ++ */ ++ ++ //Spout Start ++ protected String texture = "/mob/char.png"; ++ public float lastDamage; ++ private EntityData entityData = new EntityData(); ++ public String username = null; ++ public String displayName = null; ++ public int maxAir = 300; ++ // Spout End ++ ++ /** used to check whether entity is jumping. */ + protected boolean isJumping; + public float moveStrafing; + public float moveForward; + protected float randomYawVelocity; ++ ++ /** ++ * The number of updates over which the new position and rotation are to be applied to the entity. ++ */ + protected int newPosRotationIncrements; ++ ++ /** The new X position to be applied to the entity. */ + protected double newPosX; ++ ++ /** The new Y position to be applied to the entity. */ + protected double newPosY; + protected double newPosZ; ++ ++ /** The new yaw rotation to be applied to the entity. */ + protected double newRotationYaw; ++ ++ /** The new yaw rotation to be applied to the entity. */ + protected double newRotationPitch; ++ ++ /** Whether the DataWatcher needs to be updated with the active potions */ + private boolean potionsNeedUpdate = true; ++ ++ /** is only being set, has no uses as of MC 1.1 */ + private EntityLivingBase entityLivingToAttack; + private int revengeTimer; + private EntityLivingBase lastAttacker; ++ ++ /** Holds the value of ticksExisted when setLastAttacker was last called. */ + private int lastAttackerTime; ++ ++ /** ++ * A factor used to determine how far this entity will move each tick if it is walking on land. Adjusted by speed, and ++ * slipperiness of the current block. ++ */ + private float landMovementFactor; ++ ++ /** Number of ticks since last jump */ + private int jumpTicks; + private float field_110151_bq; ++ public int overridePotionColor; + +- public EntityLivingBase(World var1) { +- super(var1); ++ public EntityLivingBase(World par1World) { ++ super(par1World); + this.applyEntityAttributes(); + this.setHealth(this.getMaxHealth()); + this.preventEntitySpawning = true; + this.field_70770_ap = (float)(Math.random() + 1.0D) * 0.01F; + this.setPosition(this.posX, this.posY, this.posZ); + this.field_70769_ao = (float)Math.random() * 12398.0F; +- this.rotationYaw = (float)(Math.random() * (double)((float)Math.PI) * 2.0D); ++ this.rotationYaw = (float)(Math.random() * Math.PI * 2.0D); + this.rotationYawHead = this.rotationYaw; + this.stepHeight = 0.5F; + } +@@ -92,64 +188,76 @@ + this.getAttributeMap().func_111150_b(SharedMonsterAttributes.maxHealth); + this.getAttributeMap().func_111150_b(SharedMonsterAttributes.knockbackResistance); + this.getAttributeMap().func_111150_b(SharedMonsterAttributes.movementSpeed); +- if(!this.isAIEnabled()) { +- this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setAttribute((double)0.1F); ++ ++ if (!this.isAIEnabled()) { ++ this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setAttribute(0.10000000149011612D); + } +- + } + +- protected void updateFallState(double var1, boolean var3) { +- if(!this.isInWater()) { ++ /** ++ * Takes in the distance the entity has fallen this tick and whether its on the ground to update the fall distance and ++ * deal fall damage if landing on the ground. Args: distanceFallenThisTick, onGround ++ */ ++ protected void updateFallState(double par1, boolean par3) { ++ if (!this.isInWater()) { + this.handleWaterMovement(); + } + +- if(var3 && this.fallDistance > 0.0F) { ++ if (par3 && this.fallDistance > 0.0F) { + int var4 = MathHelper.floor_double(this.posX); +- int var5 = MathHelper.floor_double(this.posY - (double)0.2F - (double)this.yOffset); ++ int var5 = MathHelper.floor_double(this.posY - 0.20000000298023224D - (double)this.yOffset); + int var6 = MathHelper.floor_double(this.posZ); + int var7 = this.worldObj.getBlockId(var4, var5, var6); +- if(var7 == 0) { ++ ++ if (var7 == 0) { + int var8 = this.worldObj.blockGetRenderType(var4, var5 - 1, var6); +- if(var8 == 11 || var8 == 32 || var8 == 21) { ++ ++ if (var8 == 11 || var8 == 32 || var8 == 21) { + var7 = this.worldObj.getBlockId(var4, var5 - 1, var6); + } + } + +- if(var7 > 0) { ++ if (var7 > 0) { + Block.blocksList[var7].onFallenUpon(this.worldObj, var4, var5, var6, this, this.fallDistance); + } + } + +- super.updateFallState(var1, var3); ++ super.updateFallState(par1, par3); + } + + public boolean canBreatheUnderwater() { + return false; + } + ++ /** ++ * Gets called every tick from main Entity class ++ */ + public void onEntityUpdate() { + this.prevSwingProgress = this.swingProgress; + super.onEntityUpdate(); + this.worldObj.theProfiler.startSection("livingEntityBaseTick"); +- if(this.isEntityAlive() && this.isEntityInsideOpaqueBlock()) { ++ ++ if (this.isEntityAlive() && this.isEntityInsideOpaqueBlock()) { + this.attackEntityFrom(DamageSource.inWall, 1.0F); + } + +- if(this.isImmuneToFire() || this.worldObj.isRemote) { ++ if (this.isImmuneToFire() || this.worldObj.isRemote) { + this.extinguish(); + } + + boolean var1 = this instanceof EntityPlayer && ((EntityPlayer)this).capabilities.disableDamage; +- if(this.isEntityAlive() && this.isInsideOfMaterial(Material.water)) { +- if(!this.canBreatheUnderwater() && !this.isPotionActive(Potion.waterBreathing.id) && !var1) { ++ ++ if (this.isEntityAlive() && this.isInsideOfMaterial(Material.water)) { ++ if (!this.canBreatheUnderwater() && !this.isPotionActive(Potion.waterBreathing.id) && !var1) { + this.setAir(this.decreaseAirSupply(this.getAir())); +- if(this.getAir() == -20) { ++ ++ if (this.getAir() == -20) { + this.setAir(0); + +- for(int var2 = 0; var2 < 8; ++var2) { +- float var3 = this.ab.nextFloat() - this.ab.nextFloat(); +- float var4 = this.ab.nextFloat() - this.ab.nextFloat(); +- float var5 = this.ab.nextFloat() - this.ab.nextFloat(); ++ for (int var2 = 0; var2 < 8; ++var2) { ++ float var3 = this.rand.nextFloat() - this.rand.nextFloat(); ++ float var4 = this.rand.nextFloat() - this.rand.nextFloat(); ++ float var5 = this.rand.nextFloat() - this.rand.nextFloat(); + this.worldObj.spawnParticle("bubble", this.posX + (double)var3, this.posY + (double)var4, this.posZ + (double)var5, this.motionX, this.motionY, this.motionZ); + } + +@@ -158,41 +266,45 @@ + } + + this.extinguish(); +- if(!this.worldObj.isRemote && this.isRiding() && this.ridingEntity instanceof EntityLivingBase) { ++ ++ if (!this.worldObj.isRemote && this.isRiding() && this.ridingEntity instanceof EntityLivingBase) { + this.mountEntity((Entity)null); + } + } else { +- this.setAir(300); ++ // Spout Start - 300 to maxAir ++ this.setAir(maxAir); ++ // Spout End + } + + this.prevCameraPitch = this.cameraPitch; +- if(this.attackTime > 0) { ++ ++ if (this.attackTime > 0) { + --this.attackTime; + } + +- if(this.hurtTime > 0) { ++ if (this.hurtTime > 0) { + --this.hurtTime; + } + +- if(this.hurtResistantTime > 0) { ++ if (this.hurtResistantTime > 0) { + --this.hurtResistantTime; + } + +- if(this.getHealth() <= 0.0F) { ++ if (this.getHealth() <= 0.0F) { + this.onDeathUpdate(); + } + +- if(this.recentlyHit > 0) { ++ if (this.recentlyHit > 0) { + --this.recentlyHit; + } else { + this.attackingPlayer = null; + } + +- if(this.lastAttacker != null && !this.lastAttacker.isEntityAlive()) { ++ if (this.lastAttacker != null && !this.lastAttacker.isEntityAlive()) { + this.lastAttacker = null; + } + +- if(this.entityLivingToAttack != null && !this.entityLivingToAttack.isEntityAlive()) { ++ if (this.entityLivingToAttack != null && !this.entityLivingToAttack.isEntityAlive()) { + this.setRevengeTarget((EntityLivingBase)null); + } + +@@ -205,18 +317,26 @@ + this.worldObj.theProfiler.endSection(); + } + ++ /** ++ * If Animal, checks if the age timer is negative ++ */ + public boolean isChild() { + return false; + } + ++ /** ++ * handles entity death timer, experience orb and particle creation ++ */ + protected void onDeathUpdate() { + ++this.deathTime; +- if(this.deathTime == 20) { ++ ++ if (this.deathTime == 20) { + int var1; +- if(!this.worldObj.isRemote && (this.recentlyHit > 0 || this.isPlayer()) && !this.isChild() && this.worldObj.getGameRules().getGameRuleBooleanValue("doMobLoot")) { ++ ++ if (!this.worldObj.isRemote && (this.recentlyHit > 0 || this.isPlayer()) && !this.isChild() && this.worldObj.getGameRules().getGameRuleBooleanValue("doMobLoot")) { + var1 = this.getExperiencePoints(this.attackingPlayer); + +- while(var1 > 0) { ++ while (var1 > 0) { + int var2 = EntityXPOrb.getXPSplit(var1); + var1 -= var2; + this.worldObj.spawnEntityInWorld(new EntityXPOrb(this.worldObj, this.posX, this.posY, this.posZ, var2)); +@@ -225,31 +345,39 @@ + + this.setDead(); + +- for(var1 = 0; var1 < 20; ++var1) { +- double var8 = this.ab.nextGaussian() * 0.02D; +- double var4 = this.ab.nextGaussian() * 0.02D; +- double var6 = this.ab.nextGaussian() * 0.02D; +- this.worldObj.spawnParticle("explode", this.posX + (double)(this.ab.nextFloat() * this.width * 2.0F) - (double)this.width, this.posY + (double)(this.ab.nextFloat() * this.height), this.posZ + (double)(this.ab.nextFloat() * this.width * 2.0F) - (double)this.width, var8, var4, var6); ++ for (var1 = 0; var1 < 20; ++var1) { ++ double var8 = this.rand.nextGaussian() * 0.02D; ++ double var4 = this.rand.nextGaussian() * 0.02D; ++ double var6 = this.rand.nextGaussian() * 0.02D; ++ this.worldObj.spawnParticle("explode", this.posX + (double)(this.rand.nextFloat() * this.width * 2.0F) - (double)this.width, this.posY + (double)(this.rand.nextFloat() * this.height), this.posZ + (double)(this.rand.nextFloat() * this.width * 2.0F) - (double)this.width, var8, var4, var6); + } + } +- + } + +- protected int decreaseAirSupply(int var1) { ++ /** ++ * Decrements the entity's air supply when underwater ++ */ ++ protected int decreaseAirSupply(int par1) { + int var2 = EnchantmentHelper.getRespiration(this); +- return var2 > 0 && this.ab.nextInt(var2 + 1) > 0 ? var1 : var1 - 1; ++ return var2 > 0 && this.rand.nextInt(var2 + 1) > 0 ? par1 : par1 - 1; + } + +- protected int getExperiencePoints(EntityPlayer var1) { ++ /** ++ * Get the experience points the entity currently has. ++ */ ++ protected int getExperiencePoints(EntityPlayer par1EntityPlayer) { + return 0; + } + ++ /** ++ * Only use is to identify if class is an instance of player for experience dropping ++ */ + protected boolean isPlayer() { + return false; + } + + public Random getRNG() { +- return this.ab; ++ return this.rand; + } + + public EntityLivingBase getAITarget() { +@@ -260,8 +388,8 @@ + return this.revengeTimer; + } + +- public void setRevengeTarget(EntityLivingBase var1) { +- this.entityLivingToAttack = var1; ++ public void setRevengeTarget(EntityLivingBase par1EntityLivingBase) { ++ this.entityLivingToAttack = par1EntityLivingBase; + this.revengeTimer = this.ticksExisted; + } + +@@ -273,9 +401,9 @@ + return this.lastAttackerTime; + } + +- public void setLastAttacker(Entity var1) { +- if(var1 instanceof EntityLivingBase) { +- this.lastAttacker = (EntityLivingBase)var1; ++ public void setLastAttacker(Entity par1Entity) { ++ if (par1Entity instanceof EntityLivingBase) { ++ this.lastAttacker = (EntityLivingBase)par1Entity; + } else { + this.lastAttacker = null; + } +@@ -287,189 +415,209 @@ + return this.entityAge; + } + +- public void writeEntityToNBT(NBTTagCompound var1) { +- var1.setFloat("HealF", this.getHealth()); +- var1.setShort("Health", (short)((int)Math.ceil((double)this.getHealth()))); +- var1.setShort("HurtTime", (short)this.hurtTime); +- var1.setShort("DeathTime", (short)this.deathTime); +- var1.setShort("AttackTime", (short)this.attackTime); +- var1.setFloat("AbsorptionAmount", this.getAbsorptionAmount()); +- ItemStack[] var2 = this.getInventory(); ++ /** ++ * (abstract) Protected helper method to write subclass entity data to NBT. ++ */ ++ public void writeEntityToNBT(NBTTagCompound par1NBTTagCompound) { ++ MobRandomizer$ExtraInfo.writeToNBT(this, par1NBTTagCompound); ++ par1NBTTagCompound.setFloat("HealF", this.getHealth()); ++ par1NBTTagCompound.setShort("Health", (short)((int)Math.ceil((double)this.getHealth()))); ++ par1NBTTagCompound.setShort("HurtTime", (short)this.hurtTime); ++ par1NBTTagCompound.setShort("DeathTime", (short)this.deathTime); ++ par1NBTTagCompound.setShort("AttackTime", (short)this.attackTime); ++ par1NBTTagCompound.setFloat("AbsorptionAmount", this.getAbsorptionAmount()); ++ ItemStack[] var2 = this.getLastActiveItems(); + int var3 = var2.length; +- + int var4; + ItemStack var5; +- for(var4 = 0; var4 < var3; ++var4) { ++ ++ for (var4 = 0; var4 < var3; ++var4) { + var5 = var2[var4]; +- if(var5 != null) { ++ ++ if (var5 != null) { + this.attributeMap.removeAttributeModifiers(var5.getAttributeModifiers()); + } + } + +- var1.setTag("Attributes", SharedMonsterAttributes.func_111257_a(this.getAttributeMap())); +- var2 = this.getInventory(); ++ par1NBTTagCompound.setTag("Attributes", SharedMonsterAttributes.func_111257_a(this.getAttributeMap())); ++ var2 = this.getLastActiveItems(); + var3 = var2.length; + +- for(var4 = 0; var4 < var3; ++var4) { ++ for (var4 = 0; var4 < var3; ++var4) { + var5 = var2[var4]; +- if(var5 != null) { ++ ++ if (var5 != null) { + this.attributeMap.applyAttributeModifiers(var5.getAttributeModifiers()); + } + } + +- if(!this.f.isEmpty()) { ++ if (!this.activePotionsMap.isEmpty()) { + NBTTagList var6 = new NBTTagList(); +- Iterator var7 = this.f.values().iterator(); ++ Iterator var7 = this.activePotionsMap.values().iterator(); + +- while(var7.hasNext()) { ++ while (var7.hasNext()) { + PotionEffect var8 = (PotionEffect)var7.next(); + var6.appendTag(var8.writeCustomPotionEffectToNBT(new NBTTagCompound())); + } + +- var1.setTag("ActiveEffects", var6); ++ par1NBTTagCompound.setTag("ActiveEffects", var6); + } +- + } + +- public void readEntityFromNBT(NBTTagCompound var1) { +- this.setAbsorptionAmount(var1.getFloat("AbsorptionAmount")); +- if(var1.hasKey("Attributes") && this.worldObj != null && !this.worldObj.isRemote) { +- SharedMonsterAttributes.func_111260_a(this.getAttributeMap(), var1.getTagList("Attributes"), this.worldObj == null ? null : this.worldObj.getWorldLogAgent()); ++ /** ++ * (abstract) Protected helper method to read subclass entity data from NBT. ++ */ ++ public void readEntityFromNBT(NBTTagCompound par1NBTTagCompound) { ++ MobRandomizer$ExtraInfo.readFromNBT(this, par1NBTTagCompound); ++ this.setAbsorptionAmount(par1NBTTagCompound.getFloat("AbsorptionAmount")); ++ ++ if (par1NBTTagCompound.hasKey("Attributes") && this.worldObj != null && !this.worldObj.isRemote) { ++ SharedMonsterAttributes.func_111260_a(this.getAttributeMap(), par1NBTTagCompound.getTagList("Attributes"), this.worldObj == null ? null : this.worldObj.getWorldLogAgent()); + } + +- if(var1.hasKey("ActiveEffects")) { +- NBTTagList var2 = var1.getTagList("ActiveEffects"); ++ if (par1NBTTagCompound.hasKey("ActiveEffects")) { ++ NBTTagList var2 = par1NBTTagCompound.getTagList("ActiveEffects"); + +- for(int var3 = 0; var3 < var2.tagCount(); ++var3) { ++ for (int var3 = 0; var3 < var2.tagCount(); ++var3) { + NBTTagCompound var4 = (NBTTagCompound)var2.tagAt(var3); + PotionEffect var5 = PotionEffect.readCustomPotionEffectFromNBT(var4); +- this.f.put(Integer.valueOf(var5.getPotionID()), var5); ++ this.activePotionsMap.put(Integer.valueOf(var5.getPotionID()), var5); + } + } + +- if(var1.hasKey("HealF")) { +- this.setHealth(var1.getFloat("HealF")); ++ if (par1NBTTagCompound.hasKey("HealF")) { ++ this.setHealth(par1NBTTagCompound.getFloat("HealF")); + } else { +- NBTBase var6 = var1.getTag("Health"); +- if(var6 == null) { ++ NBTBase var6 = par1NBTTagCompound.getTag("Health"); ++ ++ if (var6 == null) { + this.setHealth(this.getMaxHealth()); +- } else if(var6.getId() == 5) { ++ } else if (var6.getId() == 5) { + this.setHealth(((NBTTagFloat)var6).data); +- } else if(var6.getId() == 2) { ++ } else if (var6.getId() == 2) { + this.setHealth((float)((NBTTagShort)var6).data); + } + } + +- this.hurtTime = var1.getShort("HurtTime"); +- this.deathTime = var1.getShort("DeathTime"); +- this.attackTime = var1.getShort("AttackTime"); ++ this.hurtTime = par1NBTTagCompound.getShort("HurtTime"); ++ this.deathTime = par1NBTTagCompound.getShort("DeathTime"); ++ this.attackTime = par1NBTTagCompound.getShort("AttackTime"); + } + + protected void updatePotionEffects() { +- Iterator var1 = this.f.keySet().iterator(); ++ Iterator var1 = this.activePotionsMap.keySet().iterator(); + +- while(var1.hasNext()) { ++ while (var1.hasNext()) { + Integer var2 = (Integer)var1.next(); +- PotionEffect var3 = (PotionEffect)this.f.get(var2); +- if(!var3.onUpdate(this)) { +- if(!this.worldObj.isRemote) { ++ PotionEffect var3 = (PotionEffect)this.activePotionsMap.get(var2); ++ ++ if (!var3.onUpdate(this)) { ++ if (!this.worldObj.isRemote) { + var1.remove(); + this.onFinishedPotionEffect(var3); + } +- } else if(var3.getDuration() % 600 == 0) { ++ } else if (var3.getDuration() % 600 == 0) { + this.onChangedPotionEffect(var3, false); + } + } + + int var11; +- if(this.potionsNeedUpdate) { +- if(!this.worldObj.isRemote) { +- if(this.f.isEmpty()) { +- this.dataWatcher.updateObject(8, Byte.valueOf((byte)0)); +- this.dataWatcher.updateObject(7, Integer.valueOf(0)); +- this.setInvisible(false); +- } else { +- var11 = PotionHelper.calcPotionLiquidColor(this.f.values()); +- this.dataWatcher.updateObject(8, Byte.valueOf((byte)(PotionHelper.func_82817_b(this.f.values()) ? 1 : 0))); +- this.dataWatcher.updateObject(7, Integer.valueOf(var11)); +- this.setInvisible(this.isPotionActive(Potion.invisibility.id)); +- } ++ ++ if (this.potionsNeedUpdate) { ++ if (this.activePotionsMap.isEmpty()) { ++ this.dataWatcher.updateObject(8, Byte.valueOf((byte)0)); ++ this.dataWatcher.updateObject(7, Integer.valueOf(0)); ++ this.overridePotionColor = 0; ++ this.setInvisible(false); ++ } else { ++ var11 = PotionHelper.calcPotionLiquidColor(this.activePotionsMap.values()); ++ this.dataWatcher.updateObject(8, Byte.valueOf((byte)(PotionHelper.func_82817_b(this.activePotionsMap.values()) ? 1 : 0))); ++ this.dataWatcher.updateObject(7, Integer.valueOf(var11)); ++ this.overridePotionColor = var11; ++ this.setInvisible(this.isPotionActive(Potion.invisibility.id)); + } + + this.potionsNeedUpdate = false; + } + +- var11 = this.dataWatcher.getWatchableObjectInt(7); ++ var11 = ColorizeEntity.getPotionEffectColor(this.dataWatcher.getWatchableObjectInt(7), this); + boolean var12 = this.dataWatcher.getWatchableObjectByte(8) > 0; +- if(var11 > 0) { ++ ++ if (var11 > 0) { + boolean var4 = false; +- if(!this.isInvisible()) { +- var4 = this.ab.nextBoolean(); ++ ++ if (!this.isInvisible()) { ++ var4 = this.rand.nextBoolean(); + } else { +- var4 = this.ab.nextInt(15) == 0; +- } +- +- if(var12) { +- var4 &= this.ab.nextInt(5) == 0; +- } +- +- if(var4 && var11 > 0) { ++ var4 = this.rand.nextInt(15) == 0; ++ } ++ ++ if (var12) { ++ var4 &= this.rand.nextInt(5) == 0; ++ } ++ ++ if (var4 && var11 > 0) { + double var5 = (double)(var11 >> 16 & 255) / 255.0D; + double var7 = (double)(var11 >> 8 & 255) / 255.0D; + double var9 = (double)(var11 >> 0 & 255) / 255.0D; +- this.worldObj.spawnParticle(var12 ? "mobSpellAmbient" : "mobSpell", this.posX + (this.ab.nextDouble() - 0.5D) * (double)this.width, this.posY + this.ab.nextDouble() * (double)this.height - (double)this.yOffset, this.posZ + (this.ab.nextDouble() - 0.5D) * (double)this.width, var5, var7, var9); ++ this.worldObj.spawnParticle(var12 ? "mobSpellAmbient" : "mobSpell", this.posX + (this.rand.nextDouble() - 0.5D) * (double)this.width, this.posY + this.rand.nextDouble() * (double)this.height - (double)this.yOffset, this.posZ + (this.rand.nextDouble() - 0.5D) * (double)this.width, var5, var7, var9); + } + } +- + } + + public void clearActivePotions() { +- Iterator var1 = this.f.keySet().iterator(); ++ Iterator var1 = this.activePotionsMap.keySet().iterator(); + +- while(var1.hasNext()) { ++ while (var1.hasNext()) { + Integer var2 = (Integer)var1.next(); +- PotionEffect var3 = (PotionEffect)this.f.get(var2); +- if(!this.worldObj.isRemote) { ++ PotionEffect var3 = (PotionEffect)this.activePotionsMap.get(var2); ++ ++ if (!this.worldObj.isRemote) { + var1.remove(); + this.onFinishedPotionEffect(var3); + } + } +- + } + + public Collection getActivePotionEffects() { +- return this.f.values(); +- } +- +- public boolean isPotionActive(int var1) { +- return this.f.containsKey(Integer.valueOf(var1)); +- } +- +- public boolean isPotionActive(Potion var1) { +- return this.f.containsKey(Integer.valueOf(var1.id)); +- } +- +- public PotionEffect getActivePotionEffect(Potion var1) { +- return (PotionEffect)this.f.get(Integer.valueOf(var1.id)); +- } +- +- public void addPotionEffect(PotionEffect var1) { +- if(this.isPotionApplicable(var1)) { +- if(this.f.containsKey(Integer.valueOf(var1.getPotionID()))) { +- ((PotionEffect)this.f.get(Integer.valueOf(var1.getPotionID()))).combine(var1); +- this.onChangedPotionEffect((PotionEffect)this.f.get(Integer.valueOf(var1.getPotionID())), true); ++ return this.activePotionsMap.values(); ++ } ++ ++ public boolean isPotionActive(int par1) { ++ return this.activePotionsMap.containsKey(Integer.valueOf(par1)); ++ } ++ ++ public boolean isPotionActive(Potion par1Potion) { ++ return this.activePotionsMap.containsKey(Integer.valueOf(par1Potion.id)); ++ } ++ ++ /** ++ * returns the PotionEffect for the supplied Potion if it is active, null otherwise. ++ */ ++ public PotionEffect getActivePotionEffect(Potion par1Potion) { ++ return (PotionEffect)this.activePotionsMap.get(Integer.valueOf(par1Potion.id)); ++ } ++ ++ /** ++ * adds a PotionEffect to the entity ++ */ ++ public void addPotionEffect(PotionEffect par1PotionEffect) { ++ if (this.isPotionApplicable(par1PotionEffect)) { ++ if (this.activePotionsMap.containsKey(Integer.valueOf(par1PotionEffect.getPotionID()))) { ++ ((PotionEffect)this.activePotionsMap.get(Integer.valueOf(par1PotionEffect.getPotionID()))).combine(par1PotionEffect); ++ this.onChangedPotionEffect((PotionEffect)this.activePotionsMap.get(Integer.valueOf(par1PotionEffect.getPotionID())), true); + } else { +- this.f.put(Integer.valueOf(var1.getPotionID()), var1); +- this.onNewPotionEffect(var1); ++ this.activePotionsMap.put(Integer.valueOf(par1PotionEffect.getPotionID()), par1PotionEffect); ++ this.onNewPotionEffect(par1PotionEffect); + } +- + } + } + +- public boolean isPotionApplicable(PotionEffect var1) { +- if(this.getCreatureAttribute() == EnumCreatureAttribute.UNDEAD) { +- int var2 = var1.getPotionID(); +- if(var2 == Potion.regeneration.id || var2 == Potion.poison.id) { ++ public boolean isPotionApplicable(PotionEffect par1PotionEffect) { ++ if (this.getCreatureAttribute() == EnumCreatureAttribute.UNDEAD) { ++ int var2 = par1PotionEffect.getPotionID(); ++ ++ if (var2 == Potion.regeneration.id || var2 == Potion.poison.id) { + return false; + } + } +@@ -477,145 +625,165 @@ + return true; + } + ++ /** ++ * Returns true if this entity is undead. ++ */ + public boolean isEntityUndead() { + return this.getCreatureAttribute() == EnumCreatureAttribute.UNDEAD; + } + +- public void removePotionEffectClient(int var1) { +- this.f.remove(Integer.valueOf(var1)); ++ /** ++ * Remove the speified potion effect from this entity. ++ */ ++ public void removePotionEffectClient(int par1) { ++ this.activePotionsMap.remove(Integer.valueOf(par1)); + } + +- public void removePotionEffect(int var1) { +- PotionEffect var2 = (PotionEffect)this.f.remove(Integer.valueOf(var1)); +- if(var2 != null) { ++ /** ++ * Remove the specified potion effect from this entity. ++ */ ++ public void removePotionEffect(int par1) { ++ PotionEffect var2 = (PotionEffect)this.activePotionsMap.remove(Integer.valueOf(par1)); ++ ++ if (var2 != null) { + this.onFinishedPotionEffect(var2); + } +- +- } +- +- protected void onNewPotionEffect(PotionEffect var1) { +- this.potionsNeedUpdate = true; +- if(!this.worldObj.isRemote) { +- Potion.potionTypes[var1.getPotionID()].applyAttributesModifiersToEntity(this, this.getAttributeMap(), var1.getAmplifier()); +- } +- +- } +- +- protected void onChangedPotionEffect(PotionEffect var1, boolean var2) { +- this.potionsNeedUpdate = true; +- if(var2 && !this.worldObj.isRemote) { +- Potion.potionTypes[var1.getPotionID()].removeAttributesModifiersFromEntity(this, this.getAttributeMap(), var1.getAmplifier()); +- Potion.potionTypes[var1.getPotionID()].applyAttributesModifiersToEntity(this, this.getAttributeMap(), var1.getAmplifier()); +- } +- +- } +- +- protected void onFinishedPotionEffect(PotionEffect var1) { +- this.potionsNeedUpdate = true; +- if(!this.worldObj.isRemote) { +- Potion.potionTypes[var1.getPotionID()].removeAttributesModifiersFromEntity(this, this.getAttributeMap(), var1.getAmplifier()); +- } +- +- } +- +- public void heal(float var1) { ++ } ++ ++ protected void onNewPotionEffect(PotionEffect par1PotionEffect) { ++ this.potionsNeedUpdate = true; ++ ++ if (!this.worldObj.isRemote) { ++ Potion.potionTypes[par1PotionEffect.getPotionID()].applyAttributesModifiersToEntity(this, this.getAttributeMap(), par1PotionEffect.getAmplifier()); ++ } ++ } ++ ++ protected void onChangedPotionEffect(PotionEffect par1PotionEffect, boolean par2) { ++ this.potionsNeedUpdate = true; ++ ++ if (par2 && !this.worldObj.isRemote) { ++ Potion.potionTypes[par1PotionEffect.getPotionID()].removeAttributesModifiersFromEntity(this, this.getAttributeMap(), par1PotionEffect.getAmplifier()); ++ Potion.potionTypes[par1PotionEffect.getPotionID()].applyAttributesModifiersToEntity(this, this.getAttributeMap(), par1PotionEffect.getAmplifier()); ++ } ++ } ++ ++ protected void onFinishedPotionEffect(PotionEffect par1PotionEffect) { ++ this.potionsNeedUpdate = true; ++ ++ if (!this.worldObj.isRemote) { ++ Potion.potionTypes[par1PotionEffect.getPotionID()].removeAttributesModifiersFromEntity(this, this.getAttributeMap(), par1PotionEffect.getAmplifier()); ++ } ++ } ++ ++ /** ++ * Heal living entity (param: amount of half-hearts) ++ */ ++ public void heal(float par1) { + float var2 = this.getHealth(); +- if(var2 > 0.0F) { +- this.setHealth(var2 + var1); +- } + ++ if (var2 > 0.0F) { ++ this.setHealth(var2 + par1); ++ } + } + + public final float getHealth() { + return this.dataWatcher.getWatchableObjectFloat(6); + } + +- public void setHealth(float var1) { +- this.dataWatcher.updateObject(6, Float.valueOf(MathHelper.clamp_float(var1, 0.0F, this.getMaxHealth()))); ++ public void setHealth(float par1) { ++ this.dataWatcher.updateObject(6, Float.valueOf(MathHelper.clamp_float(par1, 0.0F, this.getMaxHealth()))); + } + +- public boolean attackEntityFrom(DamageSource var1, float var2) { +- if(this.isEntityInvulnerable()) { ++ /** ++ * Called when the entity is attacked. ++ */ ++ public boolean attackEntityFrom(DamageSource par1DamageSource, float par2) { ++ if (this.isEntityInvulnerable()) { + return false; +- } else if(this.worldObj.isRemote) { ++ } else if (this.worldObj.isRemote) { + return false; + } else { + this.entityAge = 0; +- if(this.getHealth() <= 0.0F) { ++ ++ if (this.getHealth() <= 0.0F) { + return false; +- } else if(var1.isFireDamage() && this.isPotionActive(Potion.fireResistance)) { ++ } else if (par1DamageSource.isFireDamage() && this.isPotionActive(Potion.fireResistance)) { + return false; + } else { +- if((var1 == DamageSource.anvil || var1 == DamageSource.fallingBlock) && this.getEquipmentInSlot(4) != null) { +- this.getEquipmentInSlot(4).damageItem((int)(var2 * 4.0F + this.ab.nextFloat() * var2 * 2.0F), this); +- var2 *= 12.0F / 16.0F; ++ if ((par1DamageSource == DamageSource.anvil || par1DamageSource == DamageSource.fallingBlock) && this.getCurrentItemOrArmor(4) != null) { ++ this.getCurrentItemOrArmor(4).damageItem((int)(par2 * 4.0F + this.rand.nextFloat() * par2 * 2.0F), this); ++ par2 *= 0.75F; + } + + this.limbSwingAmount = 1.5F; + boolean var3 = true; +- if((float)this.hurtResistantTime > (float)this.maxHurtResistantTime / 2.0F) { +- if(var2 <= this.lastDamage) { ++ ++ if ((float)this.hurtResistantTime > (float)this.maxHurtResistantTime / 2.0F) { ++ if (par2 <= this.lastDamage) { + return false; + } + +- this.damageEntity(var1, var2 - this.lastDamage); +- this.lastDamage = var2; ++ this.damageEntity(par1DamageSource, par2 - this.lastDamage); ++ this.lastDamage = par2; + var3 = false; + } else { +- this.lastDamage = var2; ++ this.lastDamage = par2; + this.prevHealth = this.getHealth(); + this.hurtResistantTime = this.maxHurtResistantTime; +- this.damageEntity(var1, var2); ++ this.damageEntity(par1DamageSource, par2); + this.hurtTime = this.maxHurtTime = 10; + } + + this.attackedAtYaw = 0.0F; +- Entity var4 = var1.getEntity(); +- if(var4 != null) { +- if(var4 instanceof EntityLivingBase) { ++ Entity var4 = par1DamageSource.getEntity(); ++ ++ if (var4 != null) { ++ if (var4 instanceof EntityLivingBase) { + this.setRevengeTarget((EntityLivingBase)var4); + } + +- if(var4 instanceof EntityPlayer) { ++ if (var4 instanceof EntityPlayer) { + this.recentlyHit = 100; + this.attackingPlayer = (EntityPlayer)var4; +- } else if(var4 instanceof EntityWolf) { ++ } else if (var4 instanceof EntityWolf) { + EntityWolf var5 = (EntityWolf)var4; +- if(var5.isTamed()) { ++ ++ if (var5.isTamed()) { + this.recentlyHit = 100; + this.attackingPlayer = null; + } + } + } + +- if(var3) { ++ if (var3) { + this.worldObj.setEntityState(this, (byte)2); +- if(var1 != DamageSource.drown) { ++ ++ if (par1DamageSource != DamageSource.drown) { + this.setBeenAttacked(); + } + +- if(var4 != null) { ++ if (var4 != null) { + double var9 = var4.posX - this.posX; +- + double var7; +- for(var7 = var4.posZ - this.posZ; var9 * var9 + var7 * var7 < 1.0E-4D; var7 = (Math.random() - Math.random()) * 0.01D) { ++ ++ for (var7 = var4.posZ - this.posZ; var9 * var9 + var7 * var7 < 1.0E-4D; var7 = (Math.random() - Math.random()) * 0.01D) { + var9 = (Math.random() - Math.random()) * 0.01D; + } + +- this.attackedAtYaw = (float)(Math.atan2(var7, var9) * 180.0D / (double)((float)Math.PI)) - this.rotationYaw; +- this.knockBack(var4, var2, var9, var7); ++ this.attackedAtYaw = (float)(Math.atan2(var7, var9) * 180.0D / Math.PI) - this.rotationYaw; ++ this.knockBack(var4, par2, var9, var7); + } else { + this.attackedAtYaw = (float)((int)(Math.random() * 2.0D) * 180); + } + } + +- if(this.getHealth() <= 0.0F) { +- if(var3) { ++ if (this.getHealth() <= 0.0F) { ++ if (var3) { + this.playSound(this.getDeathSound(), this.getSoundVolume(), this.getSoundPitch()); + } + +- this.onDeath(var1); +- } else if(var3) { ++ this.onDeath(par1DamageSource); ++ } else if (var3) { + this.playSound(this.getHurtSound(), this.getSoundVolume(), this.getSoundPitch()); + } + +@@ -624,46 +792,56 @@ + } + } + +- public void renderBrokenItemStack(ItemStack var1) { +- this.playSound("random.break", 0.8F, 0.8F + this.worldObj.s.nextFloat() * 0.4F); ++ /** ++ * Renders broken item particles using the given ItemStack ++ */ ++ public void renderBrokenItemStack(ItemStack par1ItemStack) { ++ this.playSound("random.break", 0.8F, 0.8F + this.worldObj.rand.nextFloat() * 0.4F); + +- for(int var2 = 0; var2 < 5; ++var2) { +- Vec3 var3 = this.worldObj.getWorldVec3Pool().getVecFromPool(((double)this.ab.nextFloat() - 0.5D) * 0.1D, Math.random() * 0.1D + 0.1D, 0.0D); ++ for (int var2 = 0; var2 < 5; ++var2) { ++ Vec3 var3 = this.worldObj.getWorldVec3Pool().getVecFromPool(((double)this.rand.nextFloat() - 0.5D) * 0.1D, Math.random() * 0.1D + 0.1D, 0.0D); + var3.rotateAroundX(-this.rotationPitch * (float)Math.PI / 180.0F); + var3.rotateAroundY(-this.rotationYaw * (float)Math.PI / 180.0F); +- Vec3 var4 = this.worldObj.getWorldVec3Pool().getVecFromPool(((double)this.ab.nextFloat() - 0.5D) * 0.3D, (double)(-this.ab.nextFloat()) * 0.6D - 0.3D, 0.6D); ++ Vec3 var4 = this.worldObj.getWorldVec3Pool().getVecFromPool(((double)this.rand.nextFloat() - 0.5D) * 0.3D, (double)(-this.rand.nextFloat()) * 0.6D - 0.3D, 0.6D); + var4.rotateAroundX(-this.rotationPitch * (float)Math.PI / 180.0F); + var4.rotateAroundY(-this.rotationYaw * (float)Math.PI / 180.0F); + var4 = var4.addVector(this.posX, this.posY + (double)this.getEyeHeight(), this.posZ); +- this.worldObj.spawnParticle("iconcrack_" + var1.getItem().itemID, var4.xCoord, var4.yCoord, var4.zCoord, var3.xCoord, var3.yCoord + 0.05D, var3.zCoord); ++ this.worldObj.spawnParticle("iconcrack_" + par1ItemStack.getItem().itemID, var4.xCoord, var4.yCoord, var4.zCoord, var3.xCoord, var3.yCoord + 0.05D, var3.zCoord); + } +- + } + +- public void onDeath(DamageSource var1) { +- Entity var2 = var1.getEntity(); ++ /** ++ * Called when the mob's health reaches 0. ++ */ ++ public void onDeath(DamageSource par1DamageSource) { ++ Entity var2 = par1DamageSource.getEntity(); + EntityLivingBase var3 = this.func_94060_bK(); +- if(this.scoreValue >= 0 && var3 != null) { ++ ++ if (this.scoreValue >= 0 && var3 != null) { + var3.addToPlayerScore(this, this.scoreValue); + } + +- if(var2 != null) { ++ if (var2 != null) { + var2.onKillEntity(this); + } + + this.dead = true; +- if(!this.worldObj.isRemote) { ++ ++ if (!this.worldObj.isRemote) { + int var4 = 0; +- if(var2 instanceof EntityPlayer) { ++ ++ if (var2 instanceof EntityPlayer) { + var4 = EnchantmentHelper.getLootingModifier((EntityLivingBase)var2); + } + +- if(!this.isChild() && this.worldObj.getGameRules().getGameRuleBooleanValue("doMobLoot")) { ++ if (!this.isChild() && this.worldObj.getGameRules().getGameRuleBooleanValue("doMobLoot")) { + this.dropFewItems(this.recentlyHit > 0, var4); + this.dropEquipment(this.recentlyHit > 0, var4); +- if(this.recentlyHit > 0) { +- int var5 = this.ab.nextInt(200) - var4; +- if(var5 < 5) { ++ ++ if (this.recentlyHit > 0) { ++ int var5 = this.rand.nextInt(200) - var4; ++ ++ if (var5 < 5) { + this.dropRareDrop(var5 <= 0 ? 1 : 0); + } + } +@@ -673,41 +851,57 @@ + this.worldObj.setEntityState(this, (byte)3); + } + +- protected void dropEquipment(boolean var1, int var2) { +- } ++ /** ++ * Drop the equipment for this entity. ++ */ ++ protected void dropEquipment(boolean par1, int par2) {} + +- public void knockBack(Entity var1, float var2, double var3, double var5) { +- if(this.ab.nextDouble() >= this.getEntityAttribute(SharedMonsterAttributes.knockbackResistance).getAttributeValue()) { ++ /** ++ * knocks back this entity ++ */ ++ public void knockBack(Entity par1Entity, float par2, double par3, double par5) { ++ if (this.rand.nextDouble() >= this.getEntityAttribute(SharedMonsterAttributes.knockbackResistance).getAttributeValue()) { + this.isAirBorne = true; +- float var7 = MathHelper.sqrt_double(var3 * var3 + var5 * var5); ++ float var7 = MathHelper.sqrt_double(par3 * par3 + par5 * par5); + float var8 = 0.4F; + this.motionX /= 2.0D; + this.motionY /= 2.0D; + this.motionZ /= 2.0D; +- this.motionX -= var3 / (double)var7 * (double)var8; ++ this.motionX -= par3 / (double)var7 * (double)var8; + this.motionY += (double)var8; +- this.motionZ -= var5 / (double)var7 * (double)var8; +- if(this.motionY > (double)0.4F) { +- this.motionY = (double)0.4F; ++ this.motionZ -= par5 / (double)var7 * (double)var8; ++ ++ if (this.motionY > 0.4000000059604645D) { ++ this.motionY = 0.4000000059604645D; + } +- + } + } + ++ /** ++ * Returns the sound this mob makes when it is hurt. ++ */ + protected String getHurtSound() { + return "damage.hit"; + } + ++ /** ++ * Returns the sound this mob makes on death. ++ */ + protected String getDeathSound() { + return "damage.hit"; + } + +- protected void dropRareDrop(int var1) { +- } +- +- protected void dropFewItems(boolean var1, int var2) { +- } +- ++ protected void dropRareDrop(int par1) {} ++ ++ /** ++ * Drop 0-2 items of this living's type. @param par1 - Whether this entity has recently been hit by a player. @param ++ * par2 - Level of Looting used to kill this mob. ++ */ ++ protected void dropFewItems(boolean par1, int par2) {} ++ ++ /** ++ * returns true if this entity is by a ladder, false otherwise ++ */ + public boolean isOnLadder() { + int var1 = MathHelper.floor_double(this.posX); + int var2 = MathHelper.floor_double(this.boundingBox.minY); +@@ -716,45 +910,62 @@ + return var4 == Block.ladder.blockID || var4 == Block.vine.blockID; + } + ++ /** ++ * Checks whether target entity is alive. ++ */ + public boolean isEntityAlive() { + return !this.isDead && this.getHealth() > 0.0F; + } + +- protected void fall(float var1) { +- super.fall(var1); ++ /** ++ * Called when the mob is falling. Calculates and applies fall damage. ++ */ ++ protected void fall(float par1) { ++ super.fall(par1); ++ // Spout Start - Gravity mod ++ par1 *= getData().getGravityMod(); ++ // Spout End + PotionEffect var2 = this.getActivePotionEffect(Potion.jump); + float var3 = var2 != null ? (float)(var2.getAmplifier() + 1) : 0.0F; +- int var4 = MathHelper.ceiling_float_int(var1 - 3.0F - var3); +- if(var4 > 0) { +- if(var4 > 4) { ++ int var4 = MathHelper.ceiling_float_int(par1 - 3.0F - var3); ++ ++ if (var4 > 0) { ++ if (var4 > 4) { + this.playSound("damage.fallbig", 1.0F, 1.0F); + } else { + this.playSound("damage.fallsmall", 1.0F, 1.0F); + } + + this.attackEntityFrom(DamageSource.fall, (float)var4); +- int var5 = this.worldObj.getBlockId(MathHelper.floor_double(this.posX), MathHelper.floor_double(this.posY - (double)0.2F - (double)this.yOffset), MathHelper.floor_double(this.posZ)); +- if(var5 > 0) { ++ int var5 = this.worldObj.getBlockId(MathHelper.floor_double(this.posX), MathHelper.floor_double(this.posY - 0.20000000298023224D - (double)this.yOffset), MathHelper.floor_double(this.posZ)); ++ ++ if (var5 > 0) { + StepSound var6 = Block.blocksList[var5].stepSound; +- this.playSound(var6.getStepSound(), var6.getVolume() * 0.5F, var6.getPitch() * (12.0F / 16.0F)); ++ this.playSound(var6.getStepSound(), var6.getVolume() * 0.5F, var6.getPitch() * 0.75F); + } + } +- + } + ++ /** ++ * Setups the entity to do the hurt animation. Only used by packets in multiplayer. ++ */ + public void performHurtAnimation() { + this.hurtTime = this.maxHurtTime = 10; + this.attackedAtYaw = 0.0F; + } + ++ /** ++ * Returns the current armor value as determined by a call to InventoryPlayer.getTotalArmorValue ++ */ + public int getTotalArmorValue() { + int var1 = 0; +- ItemStack[] var2 = this.getInventory(); ++ ItemStack[] var2 = this.getLastActiveItems(); + int var3 = var2.length; + +- for(int var4 = 0; var4 < var3; ++var4) { ++ for (int var4 = 0; var4 < var3; ++var4) { + ItemStack var5 = var2[var4]; +- if(var5 != null && var5.getItem() instanceof ItemArmor) { ++ ++ if (var5 != null && var5.getItem() instanceof ItemArmor) { + int var6 = ((ItemArmor)var5.getItem()).damageReduceAmount; + var1 += var6; + } +@@ -763,65 +974,78 @@ + return var1; + } + +- protected void damageArmor(float var1) { +- } ++ protected void damageArmor(float par1) {} + +- protected float applyArmorCalculations(DamageSource var1, float var2) { +- if(!var1.isUnblockable()) { ++ /** ++ * Reduces damage, depending on armor ++ */ ++ protected float applyArmorCalculations(DamageSource par1DamageSource, float par2) { ++ if (!par1DamageSource.isUnblockable()) { + int var3 = 25 - this.getTotalArmorValue(); +- float var4 = var2 * (float)var3; +- this.damageArmor(var2); +- var2 = var4 / 25.0F; ++ float var4 = par2 * (float)var3; ++ this.damageArmor(par2); ++ par2 = var4 / 25.0F; + } + +- return var2; ++ return par2; + } + +- protected float applyPotionDamageCalculations(DamageSource var1, float var2) { +- if(this instanceof EntityZombie) { +- var2 = var2; ++ /** ++ * Reduces damage, depending on potions ++ */ ++ protected float applyPotionDamageCalculations(DamageSource par1DamageSource, float par2) { ++ if (this instanceof EntityZombie) { ++ par2 = par2; + } + + int var3; + int var4; + float var5; +- if(this.isPotionActive(Potion.resistance) && var1 != DamageSource.outOfWorld) { ++ ++ if (this.isPotionActive(Potion.resistance) && par1DamageSource != DamageSource.outOfWorld) { + var3 = (this.getActivePotionEffect(Potion.resistance).getAmplifier() + 1) * 5; + var4 = 25 - var3; +- var5 = var2 * (float)var4; +- var2 = var5 / 25.0F; ++ var5 = par2 * (float)var4; ++ par2 = var5 / 25.0F; + } + +- if(var2 <= 0.0F) { ++ if (par2 <= 0.0F) { + return 0.0F; + } else { +- var3 = EnchantmentHelper.getEnchantmentModifierDamage(this.getInventory(), var1); +- if(var3 > 20) { ++ var3 = EnchantmentHelper.getEnchantmentModifierDamage(this.getLastActiveItems(), par1DamageSource); ++ ++ if (var3 > 20) { + var3 = 20; + } + +- if(var3 > 0 && var3 <= 20) { ++ if (var3 > 0 && var3 <= 20) { + var4 = 25 - var3; +- var5 = var2 * (float)var4; +- var2 = var5 / 25.0F; ++ var5 = par2 * (float)var4; ++ par2 = var5 / 25.0F; + } + +- return var2; ++ return par2; + } + } + +- protected void damageEntity(DamageSource var1, float var2) { +- if(!this.isEntityInvulnerable()) { +- var2 = this.applyArmorCalculations(var1, var2); +- var2 = this.applyPotionDamageCalculations(var1, var2); +- float var3 = var2; +- var2 = Math.max(var2 - this.getAbsorptionAmount(), 0.0F); +- this.setAbsorptionAmount(this.getAbsorptionAmount() - (var3 - var2)); +- if(var2 != 0.0F) { ++ /** ++ * Deals damage to the entity. If its a EntityPlayer then will take damage from the armor first and then health second ++ * with the reduced value. Args: damageAmount ++ */ ++ // Spout Start Protected > Public ++ public void damageEntity(DamageSource par1DamageSource, float par2) { ++ if (!this.isEntityInvulnerable()) { ++ par2 = this.applyArmorCalculations(par1DamageSource, par2); ++ par2 = this.applyPotionDamageCalculations(par1DamageSource, par2); ++ float var3 = par2; ++ par2 = Math.max(par2 - this.getAbsorptionAmount(), 0.0F); ++ this.setAbsorptionAmount(this.getAbsorptionAmount() - (var3 - par2)); ++ ++ if (par2 != 0.0F) { + float var4 = this.getHealth(); +- this.setHealth(var4 - var2); +- this.func_110142_aN().func_94547_a(var1, var4, var2); +- this.setAbsorptionAmount(this.getAbsorptionAmount() - var2); ++ this.setHealth(var4 - par2); ++ this.func_110142_aN().func_94547_a(par1DamageSource, var4, par2); ++ this.setAbsorptionAmount(this.getAbsorptionAmount() - par2); + } + } + } +@@ -838,56 +1062,76 @@ + return (float)this.getEntityAttribute(SharedMonsterAttributes.maxHealth).getAttributeValue(); + } + ++ /** ++ * counts the amount of arrows stuck in the entity. getting hit by arrows increases this, used in rendering ++ */ + public final int getArrowCountInEntity() { + return this.dataWatcher.getWatchableObjectByte(9); + } + +- public final void setArrowCountInEntity(int var1) { +- this.dataWatcher.updateObject(9, Byte.valueOf((byte)var1)); ++ /** ++ * sets the amount of arrows stuck in the entity. used for rendering those ++ */ ++ public final void setArrowCountInEntity(int par1) { ++ this.dataWatcher.updateObject(9, Byte.valueOf((byte)par1)); + } + ++ /** ++ * Returns an integer indicating the end point of the swing animation, used by {@link #swingProgress} to provide a ++ * progress indicator. Takes dig speed enchantments into account. ++ */ + private int getArmSwingAnimationEnd() { + return this.isPotionActive(Potion.digSpeed) ? 6 - (1 + this.getActivePotionEffect(Potion.digSpeed).getAmplifier()) * 1 : (this.isPotionActive(Potion.digSlowdown) ? 6 + (1 + this.getActivePotionEffect(Potion.digSlowdown).getAmplifier()) * 2 : 6); + } + ++ /** ++ * Swings the item the player is holding. ++ */ + public void swingItem() { +- if(!this.isSwingInProgress || this.swingProgressInt >= this.getArmSwingAnimationEnd() / 2 || this.swingProgressInt < 0) { ++ if (!this.isSwingInProgress || this.swingProgressInt >= this.getArmSwingAnimationEnd() / 2 || this.swingProgressInt < 0) { + this.swingProgressInt = -1; + this.isSwingInProgress = true; +- if(this.worldObj instanceof WorldServer) { +- ((WorldServer)this.worldObj).getEntityTracker().sendPacketToTrackedPlayers(this, new Packet18Animation(this, 1)); ++ ++ if (this.worldObj instanceof WorldServer) { ++ ((WorldServer)this.worldObj).getEntityTracker().sendPacketToAllPlayersTrackingEntity(this, new Packet18Animation(this, 1)); + } + } +- + } + +- public void handleHealthUpdate(byte var1) { +- if(var1 == 2) { ++ public void handleHealthUpdate(byte par1) { ++ if (par1 == 2) { + this.limbSwingAmount = 1.5F; + this.hurtResistantTime = this.maxHurtResistantTime; + this.hurtTime = this.maxHurtTime = 10; + this.attackedAtYaw = 0.0F; +- this.playSound(this.getHurtSound(), this.getSoundVolume(), (this.ab.nextFloat() - this.ab.nextFloat()) * 0.2F + 1.0F); ++ this.playSound(this.getHurtSound(), this.getSoundVolume(), (this.rand.nextFloat() - this.rand.nextFloat()) * 0.2F + 1.0F); + this.attackEntityFrom(DamageSource.generic, 0.0F); +- } else if(var1 == 3) { +- this.playSound(this.getDeathSound(), this.getSoundVolume(), (this.ab.nextFloat() - this.ab.nextFloat()) * 0.2F + 1.0F); ++ } else if (par1 == 3) { ++ this.playSound(this.getDeathSound(), this.getSoundVolume(), (this.rand.nextFloat() - this.rand.nextFloat()) * 0.2F + 1.0F); + this.setHealth(0.0F); + this.onDeath(DamageSource.generic); + } else { +- super.handleHealthUpdate(var1); ++ super.handleHealthUpdate(par1); + } +- + } + ++ /** ++ * sets the dead flag. Used when you fall off the bottom of the world. ++ */ + protected void kill() { + this.attackEntityFrom(DamageSource.outOfWorld, 4.0F); + } + ++ /** ++ * Updates the arm swing progress counters and animation progress ++ */ + protected void updateArmSwingProgress() { + int var1 = this.getArmSwingAnimationEnd(); +- if(this.isSwingInProgress) { ++ ++ if (this.isSwingInProgress) { + ++this.swingProgressInt; +- if(this.swingProgressInt >= var1) { ++ ++ if (this.swingProgressInt >= var1) { + this.swingProgressInt = 0; + this.isSwingInProgress = false; + } +@@ -898,77 +1142,108 @@ + this.swingProgress = (float)this.swingProgressInt / (float)var1; + } + +- public AttributeInstance getEntityAttribute(Attribute var1) { +- return this.getAttributeMap().getAttributeInstance(var1); ++ public AttributeInstance getEntityAttribute(Attribute par1Attribute) { ++ return this.getAttributeMap().getAttributeInstance(par1Attribute); + } + + public BaseAttributeMap getAttributeMap() { +- if(this.attributeMap == null) { ++ if (this.attributeMap == null) { + this.attributeMap = new ServersideAttributeMap(); + } + + return this.attributeMap; + } + ++ /** ++ * Get this Entity's EnumCreatureAttribute ++ */ + public EnumCreatureAttribute getCreatureAttribute() { + return EnumCreatureAttribute.UNDEFINED; + } + ++ /** ++ * Returns the item that this EntityLiving is holding, if any. ++ */ + public abstract ItemStack getHeldItem(); + +- public abstract ItemStack getEquipmentInSlot(int var1); ++ /** ++ * 0 = item, 1-n is armor ++ */ ++ public abstract ItemStack getCurrentItemOrArmor(int var1); + ++ /** ++ * Sets the held item, or an armor slot. Slot 0 is held item. Slot 1-4 is armor. Params: Item, slot ++ */ + public abstract void setCurrentItemOrArmor(int var1, ItemStack var2); + +- public void setSprinting(boolean var1) { +- super.setSprinting(var1); ++ /** ++ * Set sprinting switch for Entity. ++ */ ++ public void setSprinting(boolean par1) { ++ super.setSprinting(par1); + AttributeInstance var2 = this.getEntityAttribute(SharedMonsterAttributes.movementSpeed); +- if(var2.getModifier(b) != null) { ++ ++ if (var2.getModifier(sprintingSpeedBoostModifierUUID) != null) { + var2.removeModifier(sprintingSpeedBoostModifier); + } + +- if(var1) { ++ if (par1) { + var2.applyModifier(sprintingSpeedBoostModifier); + } +- + } + +- public abstract ItemStack[] getInventory(); ++ public abstract ItemStack[] getLastActiveItems(); + ++ /** ++ * Returns the volume for the sounds this mob makes. ++ */ + protected float getSoundVolume() { + return 1.0F; + } + ++ /** ++ * Gets the pitch of living sounds in living entities. ++ */ + protected float getSoundPitch() { +- return this.isChild() ? (this.ab.nextFloat() - this.ab.nextFloat()) * 0.2F + 1.5F : (this.ab.nextFloat() - this.ab.nextFloat()) * 0.2F + 1.0F; ++ return this.isChild() ? (this.rand.nextFloat() - this.rand.nextFloat()) * 0.2F + 1.5F : (this.rand.nextFloat() - this.rand.nextFloat()) * 0.2F + 1.0F; + } + ++ /** ++ * Dead and sleeping entities cannot move ++ */ + protected boolean isMovementBlocked() { + return this.getHealth() <= 0.0F; + } + +- public void setPositionAndUpdate(double var1, double var3, double var5) { +- this.setLocationAndAngles(var1, var3, var5, this.rotationYaw, this.rotationPitch); ++ /** ++ * Move the entity to the coordinates informed, but keep yaw/pitch values. ++ */ ++ public void setPositionAndUpdate(double par1, double par3, double par5) { ++ this.setLocationAndAngles(par1, par3, par5, this.rotationYaw, this.rotationPitch); + } + +- public void dismountEntity(Entity var1) { +- double var3 = var1.posX; +- double var5 = var1.boundingBox.minY + (double)var1.height; +- double var7 = var1.posZ; ++ /** ++ * Moves the entity to a position out of the way of its mount. ++ */ ++ public void dismountEntity(Entity par1Entity) { ++ double var3 = par1Entity.posX; ++ double var5 = par1Entity.boundingBox.minY + (double)par1Entity.height; ++ double var7 = par1Entity.posZ; + +- for(double var9 = -1.5D; var9 < 2.0D; ++var9) { +- for(double var11 = -1.5D; var11 < 2.0D; ++var11) { +- if(var9 != 0.0D || var11 != 0.0D) { ++ for (double var9 = -1.5D; var9 < 2.0D; ++var9) { ++ for (double var11 = -1.5D; var11 < 2.0D; ++var11) { ++ if (var9 != 0.0D || var11 != 0.0D) { + int var13 = (int)(this.posX + var9); + int var14 = (int)(this.posZ + var11); + AxisAlignedBB var2 = this.boundingBox.getOffsetBoundingBox(var9, 1.0D, var11); +- if(this.worldObj.getCollidingBlockBounds(var2).isEmpty()) { +- if(this.worldObj.doesBlockHaveSolidTopSurface(var13, (int)this.posY, var14)) { ++ ++ if (this.worldObj.getCollidingBlockBounds(var2).isEmpty()) { ++ if (this.worldObj.doesBlockHaveSolidTopSurface(var13, (int)this.posY, var14)) { + this.setPositionAndUpdate(this.posX + var9, this.posY + 1.0D, this.posZ + var11); + return; + } + +- if(this.worldObj.doesBlockHaveSolidTopSurface(var13, (int)this.posY - 1, var14) || this.worldObj.getBlockMaterial(var13, (int)this.posY - 1, var14) == Material.water) { ++ if (this.worldObj.doesBlockHaveSolidTopSurface(var13, (int)this.posY - 1, var14) || this.worldObj.getBlockMaterial(var13, (int)this.posY - 1, var14) == Material.water) { + var3 = this.posX + var9; + var5 = this.posY + 1.0D; + var7 = this.posZ + var11; +@@ -985,18 +1260,28 @@ + return false; + } + +- public Icon getItemIcon(ItemStack var1, int var2) { +- return var1.getIconIndex(); ++ /** ++ * Gets the Icon Index of the item currently held ++ */ ++ public Icon getItemIcon(ItemStack par1ItemStack, int par2) { ++ return par1ItemStack.getIconIndex(); + } + ++ /** ++ * Causes this entity to do an upwards motion (jumping). ++ */ + protected void jump() { +- this.motionY = (double)0.42F; +- if(this.isPotionActive(Potion.jump)) { ++ ++ // Spout Start - Added jumping modifier ++ this.motionY = 0.41999998688697815D * getData().getJumpingMod(); ++ // Spout End ++ ++ if (this.isPotionActive(Potion.jump)) { + this.motionY += (double)((float)(this.getActivePotionEffect(Potion.jump).getAmplifier() + 1) * 0.1F); + } + +- if(this.isSprinting()) { +- float var1 = this.rotationYaw * ((float)Math.PI / 180.0F); ++ if (this.isSprinting()) { ++ float var1 = this.rotationYaw * 0.017453292F; + this.motionX -= (double)(MathHelper.sin(var1) * 0.2F); + this.motionZ += (double)(MathHelper.cos(var1) * 0.2F); + } +@@ -1004,114 +1289,161 @@ + this.isAirBorne = true; + } + +- public void moveEntityWithHeading(float var1, float var2) { +- double var3; +- if(!this.isInWater() || this instanceof EntityPlayer && ((EntityPlayer)this).capabilities.isFlying) { +- if(!this.handleLavaMovement() || this instanceof EntityPlayer && ((EntityPlayer)this).capabilities.isFlying) { +- float var8 = 0.91F; +- if(this.onGround) { +- var8 = 546.0F * 0.1F * 0.1F * 0.1F; +- int var4 = this.worldObj.getBlockId(MathHelper.floor_double(this.posX), MathHelper.floor_double(this.boundingBox.minY) - 1, MathHelper.floor_double(this.posZ)); +- if(var4 > 0) { +- var8 = Block.blocksList[var4].slipperiness * 0.91F; +- } +- } +- +- float var9 = 0.16277136F / (var8 * var8 * var8); +- float var5; +- if(this.onGround) { +- var5 = this.getAIMoveSpeed() * var9; +- } else { +- var5 = this.jumpMovementFactor; +- } +- +- this.moveFlying(var1, var2, var5); +- var8 = 0.91F; +- if(this.onGround) { +- var8 = 546.0F * 0.1F * 0.1F * 0.1F; +- int var6 = this.worldObj.getBlockId(MathHelper.floor_double(this.posX), MathHelper.floor_double(this.boundingBox.minY) - 1, MathHelper.floor_double(this.posZ)); +- if(var6 > 0) { +- var8 = Block.blocksList[var6].slipperiness * 0.91F; +- } +- } +- +- if(this.isOnLadder()) { +- float var11 = 0.15F; +- if(this.motionX < (double)(-var11)) { +- this.motionX = (double)(-var11); +- } +- +- if(this.motionX > (double)var11) { +- this.motionX = (double)var11; +- } +- +- if(this.motionZ < (double)(-var11)) { +- this.motionZ = (double)(-var11); +- } +- +- if(this.motionZ > (double)var11) { +- this.motionZ = (double)var11; +- } +- +- this.fallDistance = 0.0F; +- if(this.motionY < -0.15D) { +- this.motionY = -0.15D; +- } +- +- boolean var7 = this.isSneaking() && this instanceof EntityPlayer; +- if(var7 && this.motionY < 0.0D) { +- this.motionY = 0.0D; +- } +- } +- +- this.moveEntity(this.motionX, this.motionY, this.motionZ); +- if(this.isCollidedHorizontally && this.isOnLadder()) { +- this.motionY = 0.2D; +- } +- +- if(this.worldObj.isRemote && (!this.worldObj.blockExists((int)this.posX, 0, (int)this.posZ) || !this.worldObj.getChunkFromBlockCoords((int)this.posX, (int)this.posZ).isChunkLoaded)) { +- if(this.posY > 0.0D) { +- this.motionY = -0.1D; +- } else { +- this.motionY = 0.0D; +- } +- } else { +- this.motionY -= 0.08D; +- } +- +- this.motionY *= (double)0.98F; +- this.motionX *= (double)var8; +- this.motionZ *= (double)var8; +- } else { +- var3 = this.posY; +- this.moveFlying(var1, var2, 0.02F); +- this.moveEntity(this.motionX, this.motionY, this.motionZ); +- this.motionX *= 0.5D; +- this.motionY *= 0.5D; +- this.motionZ *= 0.5D; +- this.motionY -= 0.02D; +- if(this.isCollidedHorizontally && this.isOffsetPositionInLiquid(this.motionX, this.motionY + (double)0.6F - this.posY + var3, this.motionZ)) { +- this.motionY = (double)0.3F; +- } ++ /** ++ * Moves the entity based on the specified heading. Args: strafe, forward ++ */ ++ public void moveEntityWithHeading(float par1, float par2) { ++ double var10; ++ ++ if (this.isInWater() && (!(this instanceof EntityPlayer) || !((EntityPlayer)this).capabilities.isFlying)) { ++ var10 = this.posY; ++ // Spout Start - Swimming mod ++ this.moveFlying(par1, par2, ((float) ((this.isAIEnabled() ? 0.04F : 0.02F) * getData().getSwimmingMod()))); ++ // Spout End ++ this.moveEntity(this.motionX, this.motionY, this.motionZ); ++ this.motionX *= 0.800000011920929D; ++ this.motionY *= 0.800000011920929D; ++ this.motionZ *= 0.800000011920929D; ++ // Spout Start - Added gravity modifier ++ this.motionY -= 0.02D * getData().getGravityMod(); ++ // Spout End ++ ++ if (this.isCollidedHorizontally && this.isOffsetPositionInLiquid(this.motionX, this.motionY + 0.6000000238418579D - this.posY + var10, this.motionZ)) { ++ this.motionY = 0.30000001192092896D; + } +- } else { +- var3 = this.posY; +- this.moveFlying(var1, var2, this.isAIEnabled() ? 0.04F : 0.02F); ++ } else if (this.handleLavaMovement() && (!(this instanceof EntityPlayer) || !((EntityPlayer)this).capabilities.isFlying)) { ++ var10 = this.posY; ++ // Spout Start - Added swimming modifier ++ this.moveFlying(par1, par2, (float)(0.02F * getData().getSwimmingMod())); ++ // Spout End + this.moveEntity(this.motionX, this.motionY, this.motionZ); +- this.motionX *= (double)0.8F; +- this.motionY *= (double)0.8F; +- this.motionZ *= (double)0.8F; ++ this.motionX *= 0.5D; ++ this.motionY *= 0.5D; ++ this.motionZ *= 0.5D; + this.motionY -= 0.02D; +- if(this.isCollidedHorizontally && this.isOffsetPositionInLiquid(this.motionX, this.motionY + (double)0.6F - this.posY + var3, this.motionZ)) { +- this.motionY = (double)0.3F; +- } ++ ++ if (this.isCollidedHorizontally && this.isOffsetPositionInLiquid(this.motionX, this.motionY + 0.6000000238418579D - this.posY + var10, this.motionZ)) { ++ this.motionY = 0.30000001192092896D; ++ } ++ } else { ++ float var3 = 0.91F; ++ ++ if (this.onGround) { ++ var3 = 0.54600006F; ++ int var4 = this.worldObj.getBlockId(MathHelper.floor_double(this.posX), MathHelper.floor_double(this.boundingBox.minY) - 1, MathHelper.floor_double(this.posZ)); ++ ++ if (var4 > 0) { ++ var3 = Block.blocksList[var4].slipperiness * 0.91F; ++ } ++ } ++ ++ float var8 = 0.16277136F / (var3 * var3 * var3); ++ float var5; ++ ++ if (this.onGround) { ++ if (this.isAIEnabled()) { ++ // Spout Start ++ var5 = (float) (this.getAIMoveSpeed() * getData().getWalkingMod()); ++ // Spout End ++ } else { ++ // Spout Start ++ var5 = (float) (this.landMovementFactor * getData().getWalkingMod()); ++ // Spout End ++ } ++ ++ var5 *= var8; ++ } else { ++ // Spout Start - Added AirSpeed modifier ++ var5 = (float) (this.jumpMovementFactor * getData().getAirspeedMod()); ++ // Spout End ++ } ++ ++ this.moveFlying(par1, par2, var5); ++ var3 = 0.91F; ++ ++ if (this.onGround) { ++ var3 = 0.54600006F; ++ int var6 = this.worldObj.getBlockId(MathHelper.floor_double(this.posX), MathHelper.floor_double(this.boundingBox.minY) - 1, MathHelper.floor_double(this.posZ)); ++ ++ if (var6 > 0) { ++ var3 = Block.blocksList[var6].slipperiness * 0.91F; ++ // Spout Start ++ int x = MathHelper.floor_double(this.posX); ++ int y = MathHelper.floor_double(this.boundingBox.minY) - 1; ++ int z = MathHelper.floor_double(this.posZ); ++ org.spoutcraft.client.block.SpoutcraftChunk chunk = org.spoutcraft.api.Spoutcraft.getChunkAt(worldObj, x, y, z); ++ short customId = chunk.getCustomBlockId(x, y, z); ++ if (customId > 0) { ++ CustomBlock block = MaterialData.getCustomBlock(customId); ++ if (block != null) { ++ var3 = block.getFriction() * 0.98F; ++ } ++ } ++ // Spout End ++ } ++ } ++ ++ if (this.isOnLadder()) { ++ float var11 = 0.15F; ++ ++ if (this.motionX < (double)(-var11)) { ++ this.motionX = (double)(-var11); ++ } ++ ++ if (this.motionX > (double)var11) { ++ this.motionX = (double)var11; ++ } ++ ++ if (this.motionZ < (double)(-var11)) { ++ this.motionZ = (double)(-var11); ++ } ++ ++ if (this.motionZ > (double)var11) { ++ this.motionZ = (double)var11; ++ } ++ ++ this.fallDistance = 0.0F; ++ ++ if (this.motionY < -0.15D) { ++ this.motionY = -0.15D; ++ } ++ ++ boolean var7 = this.isSneaking() && this instanceof EntityPlayer; ++ ++ if (var7 && this.motionY < 0.0D) { ++ this.motionY = 0.0D; ++ } ++ } ++ ++ this.moveEntity(this.motionX, this.motionY, this.motionZ); ++ ++ if (this.isCollidedHorizontally && this.isOnLadder()) { ++ this.motionY = 0.2D; ++ } ++ ++ if (this.worldObj.isRemote && (!this.worldObj.blockExists((int)this.posX, 0, (int)this.posZ) || !this.worldObj.getChunkFromBlockCoords((int)this.posX, (int)this.posZ).isChunkLoaded)) { ++ if (this.posY > 0.0D) { ++ this.motionY = -0.1D; ++ } else { ++ this.motionY = 0.0D; ++ } ++ } else { ++ // Spout Start - Added gravity modifier ++ this.motionY -= 0.08D * getData().getGravityMod(); ++ // Spout End ++ } ++ ++ this.motionY *= 0.9800000190734863D; ++ this.motionX *= (double)var3; ++ this.motionZ *= (double)var3; + } + + this.prevLimbSwingAmount = this.limbSwingAmount; +- var3 = this.posX - this.prevPosX; +- double var10 = this.posZ - this.prevPosZ; +- float var12 = MathHelper.sqrt_double(var3 * var3 + var10 * var10) * 4.0F; +- if(var12 > 1.0F) { ++ var10 = this.posX - this.prevPosX; ++ double var9 = this.posZ - this.prevPosZ; ++ float var12 = MathHelper.sqrt_double(var10 * var10 + var9 * var9) * 4.0F; ++ ++ if (var12 > 1.0F) { + var12 = 1.0F; + } + +@@ -1119,52 +1451,72 @@ + this.limbSwing += this.limbSwingAmount; + } + ++ /** ++ * Returns true if the newer Entity AI code should be run ++ */ + protected boolean isAIEnabled() { + return false; + } + ++ /** ++ * the movespeed used for the new AI system ++ */ + public float getAIMoveSpeed() { + return this.isAIEnabled() ? this.landMovementFactor : 0.1F; + } + +- public void setAIMoveSpeed(float var1) { +- this.landMovementFactor = var1; ++ /** ++ * set the movespeed used for the new AI system ++ */ ++ public void setAIMoveSpeed(float par1) { ++ this.landMovementFactor = par1; + } + +- public boolean attackEntityAsMob(Entity var1) { +- this.setLastAttacker(var1); ++ public boolean attackEntityAsMob(Entity par1Entity) { ++ this.setLastAttacker(par1Entity); + return false; + } + ++ /** ++ * Returns whether player is sleeping or not ++ */ + public boolean isPlayerSleeping() { + return false; + } + ++ /** ++ * Called to update the entity's position/logic. ++ */ + public void onUpdate() { + super.onUpdate(); +- if(!this.worldObj.isRemote) { ++ ++ if (!this.worldObj.isRemote) { + int var1 = this.getArrowCountInEntity(); +- if(var1 > 0) { +- if(this.arrowHitTimer <= 0) { ++ ++ if (var1 > 0) { ++ if (this.arrowHitTimer <= 0) { + this.arrowHitTimer = 20 * (30 - var1); + } + + --this.arrowHitTimer; +- if(this.arrowHitTimer <= 0) { ++ ++ if (this.arrowHitTimer <= 0) { + this.setArrowCountInEntity(var1 - 1); + } + } + +- for(int var2 = 0; var2 < 5; ++var2) { ++ for (int var2 = 0; var2 < 5; ++var2) { + ItemStack var3 = this.previousEquipment[var2]; +- ItemStack var4 = this.getEquipmentInSlot(var2); +- if(!ItemStack.areItemStacksEqual(var4, var3)) { +- ((WorldServer)this.worldObj).getEntityTracker().sendPacketToTrackedPlayers(this, new Packet5PlayerInventory(this.entityId, var2, var4)); +- if(var3 != null) { ++ ItemStack var4 = this.getCurrentItemOrArmor(var2); ++ ++ if (!ItemStack.areItemStacksEqual(var4, var3)) { ++ ((WorldServer)this.worldObj).getEntityTracker().sendPacketToAllPlayersTrackingEntity(this, new Packet5PlayerInventory(this.entityId, var2, var4)); ++ ++ if (var3 != null) { + this.attributeMap.removeAttributeModifiers(var3.getAttributeModifiers()); + } + +- if(var4 != null) { ++ if (var4 != null) { + this.attributeMap.applyAttributeModifiers(var4.getAttributeModifiers()); + } + +@@ -1181,17 +1533,18 @@ + float var7 = 0.0F; + this.field_70768_au = this.field_110154_aX; + float var8 = 0.0F; +- if(var5 > 0.0025000002F) { ++ ++ if (var5 > 0.0025000002F) { + var8 = 1.0F; + var7 = (float)Math.sqrt((double)var5) * 3.0F; + var6 = (float)Math.atan2(var10, var9) * 180.0F / (float)Math.PI - 90.0F; + } + +- if(this.swingProgress > 0.0F) { ++ if (this.swingProgress > 0.0F) { + var6 = this.rotationYaw; + } + +- if(!this.onGround) { ++ if (!this.onGround) { + var8 = 0.0F; + } + +@@ -1201,35 +1554,35 @@ + this.worldObj.theProfiler.endSection(); + this.worldObj.theProfiler.startSection("rangeChecks"); + +- while(this.rotationYaw - this.prevRotationYaw < -180.0F) { ++ while (this.rotationYaw - this.prevRotationYaw < -180.0F) { + this.prevRotationYaw -= 360.0F; + } + +- while(this.rotationYaw - this.prevRotationYaw >= 180.0F) { ++ while (this.rotationYaw - this.prevRotationYaw >= 180.0F) { + this.prevRotationYaw += 360.0F; + } + +- while(this.renderYawOffset - this.prevRenderYawOffset < -180.0F) { ++ while (this.renderYawOffset - this.prevRenderYawOffset < -180.0F) { + this.prevRenderYawOffset -= 360.0F; + } + +- while(this.renderYawOffset - this.prevRenderYawOffset >= 180.0F) { ++ while (this.renderYawOffset - this.prevRenderYawOffset >= 180.0F) { + this.prevRenderYawOffset += 360.0F; + } + +- while(this.rotationPitch - this.prevRotationPitch < -180.0F) { ++ while (this.rotationPitch - this.prevRotationPitch < -180.0F) { + this.prevRotationPitch -= 360.0F; + } + +- while(this.rotationPitch - this.prevRotationPitch >= 180.0F) { ++ while (this.rotationPitch - this.prevRotationPitch >= 180.0F) { + this.prevRotationPitch += 360.0F; + } + +- while(this.rotationYawHead - this.prevRotationYawHead < -180.0F) { ++ while (this.rotationYawHead - this.prevRotationYawHead < -180.0F) { + this.prevRotationYawHead -= 360.0F; + } + +- while(this.rotationYawHead - this.prevRotationYawHead >= 180.0F) { ++ while (this.rotationYawHead - this.prevRotationYawHead >= 180.0F) { + this.prevRotationYawHead += 360.0F; + } + +@@ -1237,37 +1590,43 @@ + this.field_70764_aw += var7; + } + +- protected float func_110146_f(float var1, float var2) { +- float var3 = MathHelper.wrapAngleTo180_float(var1 - this.renderYawOffset); ++ protected float func_110146_f(float par1, float par2) { ++ float var3 = MathHelper.wrapAngleTo180_float(par1 - this.renderYawOffset); + this.renderYawOffset += var3 * 0.3F; + float var4 = MathHelper.wrapAngleTo180_float(this.rotationYaw - this.renderYawOffset); + boolean var5 = var4 < -90.0F || var4 >= 90.0F; +- if(var4 < -75.0F) { ++ ++ if (var4 < -75.0F) { + var4 = -75.0F; + } + +- if(var4 >= 75.0F) { ++ if (var4 >= 75.0F) { + var4 = 75.0F; + } + + this.renderYawOffset = this.rotationYaw - var4; +- if(var4 * var4 > 2500.0F) { ++ ++ if (var4 * var4 > 2500.0F) { + this.renderYawOffset += var4 * 0.2F; + } + +- if(var5) { +- var2 *= -1.0F; ++ if (var5) { ++ par2 *= -1.0F; + } + +- return var2; ++ return par2; + } + ++ /** ++ * Called frequently so the entity can update its state every tick as required. For example, zombies and skeletons use ++ * this to react to sunlight and start to burn. ++ */ + public void onLivingUpdate() { +- if(this.jumpTicks > 0) { ++ if (this.jumpTicks > 0) { + --this.jumpTicks; + } + +- if(this.newPosRotationIncrements > 0) { ++ if (this.newPosRotationIncrements > 0) { + double var1 = this.posX + (this.newPosX - this.posX) / (double)this.newPosRotationIncrements; + double var3 = this.posY + (this.newPosY - this.posY) / (double)this.newPosRotationIncrements; + double var5 = this.posZ + (this.newPosZ - this.posZ) / (double)this.newPosRotationIncrements; +@@ -1277,32 +1636,33 @@ + --this.newPosRotationIncrements; + this.setPosition(var1, var3, var5); + this.setRotation(this.rotationYaw, this.rotationPitch); +- } else if(!this.isClientWorld()) { ++ } else if (!this.isClientWorld()) { + this.motionX *= 0.98D; + this.motionY *= 0.98D; + this.motionZ *= 0.98D; + } + +- if(Math.abs(this.motionX) < 0.005D) { ++ if (Math.abs(this.motionX) < 0.005D) { + this.motionX = 0.0D; + } + +- if(Math.abs(this.motionY) < 0.005D) { ++ if (Math.abs(this.motionY) < 0.005D) { + this.motionY = 0.0D; + } + +- if(Math.abs(this.motionZ) < 0.005D) { ++ if (Math.abs(this.motionZ) < 0.005D) { + this.motionZ = 0.0D; + } + + this.worldObj.theProfiler.startSection("ai"); +- if(this.isMovementBlocked()) { ++ ++ if (this.isMovementBlocked()) { + this.isJumping = false; + this.moveStrafing = 0.0F; + this.moveForward = 0.0F; + this.randomYawVelocity = 0.0F; +- } else if(this.isClientWorld()) { +- if(this.isAIEnabled()) { ++ } else if (this.isClientWorld()) { ++ if (this.isAIEnabled()) { + this.worldObj.theProfiler.startSection("newAi"); + this.updateAITasks(); + this.worldObj.theProfiler.endSection(); +@@ -1316,14 +1676,15 @@ + + this.worldObj.theProfiler.endSection(); + this.worldObj.theProfiler.startSection("jump"); +- if(this.isJumping) { +- if(!this.isInWater() && !this.handleLavaMovement()) { +- if(this.onGround && this.jumpTicks == 0) { ++ ++ if (this.isJumping) { ++ if (!this.isInWater() && !this.handleLavaMovement()) { ++ if (this.onGround && this.jumpTicks == 0) { + this.jump(); + this.jumpTicks = 10; + } + } else { +- this.motionY += (double)0.04F; ++ this.motionY += 0.03999999910593033D; + } + } else { + this.jumpTicks = 0; +@@ -1337,33 +1698,37 @@ + this.moveEntityWithHeading(this.moveStrafing, this.moveForward); + this.worldObj.theProfiler.endSection(); + this.worldObj.theProfiler.startSection("push"); +- if(!this.worldObj.isRemote) { ++ ++ if (!this.worldObj.isRemote) { + this.collideWithNearbyEntities(); + } + + this.worldObj.theProfiler.endSection(); + } + +- protected void updateAITasks() { +- } ++ protected void updateAITasks() {} + + protected void collideWithNearbyEntities() { +- List var1 = this.worldObj.getEntitiesWithinAABBExcludingEntity(this, this.boundingBox.expand((double)0.2F, 0.0D, (double)0.2F)); +- if(var1 != null && !var1.isEmpty()) { +- for(int var2 = 0; var2 < var1.size(); ++var2) { ++ List var1 = this.worldObj.getEntitiesWithinAABBExcludingEntity(this, this.boundingBox.expand(0.20000000298023224D, 0.0D, 0.20000000298023224D)); ++ ++ if (var1 != null && !var1.isEmpty()) { ++ for (int var2 = 0; var2 < var1.size(); ++var2) { + Entity var3 = (Entity)var1.get(var2); +- if(var3.canBePushed()) { ++ ++ if (var3.canBePushed()) { + this.collideWithEntity(var3); + } + } + } +- +- } +- +- protected void collideWithEntity(Entity var1) { +- var1.applyEntityCollision(this); +- } +- ++ } ++ ++ protected void collideWithEntity(Entity par1Entity) { ++ par1Entity.applyEntityCollision(this); ++ } ++ ++ /** ++ * Handles updating while being ridden by an entity ++ */ + public void updateRidden() { + super.updateRidden(); + this.field_70768_au = this.field_110154_aX; +@@ -1371,110 +1736,148 @@ + this.fallDistance = 0.0F; + } + +- public void setPositionAndRotation2(double var1, double var3, double var5, float var7, float var8, int var9) { ++ /** ++ * Sets the position and rotation. Only difference from the other one is no bounding on the rotation. Args: posX, posY, ++ * posZ, yaw, pitch ++ */ ++ public void setPositionAndRotation2(double par1, double par3, double par5, float par7, float par8, int par9) { + this.yOffset = 0.0F; +- this.newPosX = var1; +- this.newPosY = var3; +- this.newPosZ = var5; +- this.newRotationYaw = (double)var7; +- this.newRotationPitch = (double)var8; +- this.newPosRotationIncrements = var9; ++ this.newPosX = par1; ++ this.newPosY = par3; ++ this.newPosZ = par5; ++ this.newRotationYaw = (double)par7; ++ this.newRotationPitch = (double)par8; ++ this.newPosRotationIncrements = par9; + } + +- protected void updateAITick() { +- } ++ /** ++ * main AI tick function, replaces updateEntityActionState ++ */ ++ protected void updateAITick() {} + + protected void updateEntityActionState() { + ++this.entityAge; + } + +- public void setJumping(boolean var1) { +- this.isJumping = var1; ++ public void setJumping(boolean par1) { ++ this.isJumping = par1; + } + +- public void onItemPickup(Entity var1, int var2) { +- if(!var1.isDead && !this.worldObj.isRemote) { ++ /** ++ * Called whenever an item is picked up from walking over it. Args: pickedUpEntity, stackSize ++ */ ++ public void onItemPickup(Entity par1Entity, int par2) { ++ if (!par1Entity.isDead && !this.worldObj.isRemote) { + EntityTracker var3 = ((WorldServer)this.worldObj).getEntityTracker(); +- if(var1 instanceof EntityItem) { +- var3.sendPacketToTrackedPlayers(var1, new Packet22Collect(var1.entityId, this.entityId)); +- } +- +- if(var1 instanceof EntityArrow) { +- var3.sendPacketToTrackedPlayers(var1, new Packet22Collect(var1.entityId, this.entityId)); +- } +- +- if(var1 instanceof EntityXPOrb) { +- var3.sendPacketToTrackedPlayers(var1, new Packet22Collect(var1.entityId, this.entityId)); ++ ++ if (par1Entity instanceof EntityItem) { ++ var3.sendPacketToAllPlayersTrackingEntity(par1Entity, new Packet22Collect(par1Entity.entityId, this.entityId)); ++ } ++ ++ if (par1Entity instanceof EntityArrow) { ++ var3.sendPacketToAllPlayersTrackingEntity(par1Entity, new Packet22Collect(par1Entity.entityId, this.entityId)); ++ } ++ ++ if (par1Entity instanceof EntityXPOrb) { ++ var3.sendPacketToAllPlayersTrackingEntity(par1Entity, new Packet22Collect(par1Entity.entityId, this.entityId)); + } + } +- +- } +- +- public boolean canEntityBeSeen(Entity var1) { +- return this.worldObj.rayTraceBlocks(this.worldObj.getWorldVec3Pool().getVecFromPool(this.posX, this.posY + (double)this.getEyeHeight(), this.posZ), this.worldObj.getWorldVec3Pool().getVecFromPool(var1.posX, var1.posY + (double)var1.getEyeHeight(), var1.posZ)) == null; +- } +- ++ } ++ ++ /** ++ * returns true if the entity provided in the argument can be seen. (Raytrace) ++ */ ++ public boolean canEntityBeSeen(Entity par1Entity) { ++ return this.worldObj.clip(this.worldObj.getWorldVec3Pool().getVecFromPool(this.posX, this.posY + (double)this.getEyeHeight(), this.posZ), this.worldObj.getWorldVec3Pool().getVecFromPool(par1Entity.posX, par1Entity.posY + (double)par1Entity.getEyeHeight(), par1Entity.posZ)) == null; ++ } ++ ++ /** ++ * returns a (normalized) vector of where this entity is looking ++ */ + public Vec3 getLookVec() { + return this.getLook(1.0F); + } + +- public Vec3 getLook(float var1) { ++ /** ++ * interpolated look vector ++ */ ++ public Vec3 getLook(float par1) { + float var2; + float var3; + float var4; + float var5; +- if(var1 == 1.0F) { +- var2 = MathHelper.cos(-this.rotationYaw * ((float)Math.PI / 180.0F) - (float)Math.PI); +- var3 = MathHelper.sin(-this.rotationYaw * ((float)Math.PI / 180.0F) - (float)Math.PI); +- var4 = -MathHelper.cos(-this.rotationPitch * ((float)Math.PI / 180.0F)); +- var5 = MathHelper.sin(-this.rotationPitch * ((float)Math.PI / 180.0F)); ++ ++ if (par1 == 1.0F) { ++ var2 = MathHelper.cos(-this.rotationYaw * 0.017453292F - (float)Math.PI); ++ var3 = MathHelper.sin(-this.rotationYaw * 0.017453292F - (float)Math.PI); ++ var4 = -MathHelper.cos(-this.rotationPitch * 0.017453292F); ++ var5 = MathHelper.sin(-this.rotationPitch * 0.017453292F); + return this.worldObj.getWorldVec3Pool().getVecFromPool((double)(var3 * var4), (double)var5, (double)(var2 * var4)); + } else { +- var2 = this.prevRotationPitch + (this.rotationPitch - this.prevRotationPitch) * var1; +- var3 = this.prevRotationYaw + (this.rotationYaw - this.prevRotationYaw) * var1; +- var4 = MathHelper.cos(-var3 * ((float)Math.PI / 180.0F) - (float)Math.PI); +- var5 = MathHelper.sin(-var3 * ((float)Math.PI / 180.0F) - (float)Math.PI); +- float var6 = -MathHelper.cos(-var2 * ((float)Math.PI / 180.0F)); +- float var7 = MathHelper.sin(-var2 * ((float)Math.PI / 180.0F)); ++ var2 = this.prevRotationPitch + (this.rotationPitch - this.prevRotationPitch) * par1; ++ var3 = this.prevRotationYaw + (this.rotationYaw - this.prevRotationYaw) * par1; ++ var4 = MathHelper.cos(-var3 * 0.017453292F - (float)Math.PI); ++ var5 = MathHelper.sin(-var3 * 0.017453292F - (float)Math.PI); ++ float var6 = -MathHelper.cos(-var2 * 0.017453292F); ++ float var7 = MathHelper.sin(-var2 * 0.017453292F); + return this.worldObj.getWorldVec3Pool().getVecFromPool((double)(var5 * var6), (double)var7, (double)(var4 * var6)); + } + } + +- public float getSwingProgress(float var1) { ++ /** ++ * Returns where in the swing animation the living entity is (from 0 to 1). Args: partialTickTime ++ */ ++ public float getSwingProgress(float par1) { + float var2 = this.swingProgress - this.prevSwingProgress; +- if(var2 < 0.0F) { ++ ++ if (var2 < 0.0F) { + ++var2; + } + +- return this.prevSwingProgress + var2 * var1; ++ return this.prevSwingProgress + var2 * par1; + } + +- public Vec3 getPosition(float var1) { +- if(var1 == 1.0F) { ++ /** ++ * interpolated position vector ++ */ ++ public Vec3 getPosition(float par1) { ++ if (par1 == 1.0F) { + return this.worldObj.getWorldVec3Pool().getVecFromPool(this.posX, this.posY, this.posZ); + } else { +- double var2 = this.prevPosX + (this.posX - this.prevPosX) * (double)var1; +- double var4 = this.prevPosY + (this.posY - this.prevPosY) * (double)var1; +- double var6 = this.prevPosZ + (this.posZ - this.prevPosZ) * (double)var1; ++ double var2 = this.prevPosX + (this.posX - this.prevPosX) * (double)par1; ++ double var4 = this.prevPosY + (this.posY - this.prevPosY) * (double)par1; ++ double var6 = this.prevPosZ + (this.posZ - this.prevPosZ) * (double)par1; + return this.worldObj.getWorldVec3Pool().getVecFromPool(var2, var4, var6); + } + } + +- public MovingObjectPosition rayTrace(double var1, float var3) { +- Vec3 var4 = this.getPosition(var3); +- Vec3 var5 = this.getLook(var3); +- Vec3 var6 = var4.addVector(var5.xCoord * var1, var5.yCoord * var1, var5.zCoord * var1); +- return this.worldObj.rayTraceBlocks(var4, var6); ++ /** ++ * Performs a ray trace for the distance specified and using the partial tick time. Args: distance, partialTickTime ++ */ ++ public MovingObjectPosition rayTrace(double par1, float par3) { ++ Vec3 var4 = this.getPosition(par3); ++ Vec3 var5 = this.getLook(par3); ++ Vec3 var6 = var4.addVector(var5.xCoord * par1, var5.yCoord * par1, var5.zCoord * par1); ++ return this.worldObj.clip(var4, var6); + } + ++ /** ++ * Returns whether the entity is in a local (client) world ++ */ + public boolean isClientWorld() { + return !this.worldObj.isRemote; + } + ++ /** ++ * Returns true if other Entities should be prevented from moving through this Entity. ++ */ + public boolean canBeCollidedWith() { + return !this.isDead; + } + ++ /** ++ * Returns true if this entity should push and be pushed by other entities when colliding. ++ */ + public boolean canBePushed() { + return !this.isDead; + } +@@ -1483,39 +1886,105 @@ + return this.height * 0.85F; + } + ++ /** ++ * Sets that this entity has been attacked. ++ */ + protected void setBeenAttacked() { +- this.velocityChanged = this.ab.nextDouble() >= this.getEntityAttribute(SharedMonsterAttributes.knockbackResistance).getAttributeValue(); ++ this.velocityChanged = this.rand.nextDouble() >= this.getEntityAttribute(SharedMonsterAttributes.knockbackResistance).getAttributeValue(); + } + + public float getRotationYawHead() { + return this.rotationYawHead; + } + +- public void setRotationYawHead(float var1) { +- this.rotationYawHead = var1; ++ /** ++ * Sets the head's yaw rotation of the entity. ++ */ ++ public void setRotationYawHead(float par1) { ++ this.rotationYawHead = par1; + } + + public float getAbsorptionAmount() { + return this.field_110151_bq; + } + +- public void setAbsorptionAmount(float var1) { +- if(var1 < 0.0F) { +- var1 = 0.0F; ++ public void setAbsorptionAmount(float par1) { ++ if (par1 < 0.0F) { ++ par1 = 0.0F; + } + +- this.field_110151_bq = var1; ++ this.field_110151_bq = par1; + } + + public Team getTeam() { + return null; + } + +- public boolean isOnSameTeam(EntityLivingBase var1) { +- return this.isOnTeam(var1.getTeam()); +- } +- +- public boolean isOnTeam(Team var1) { +- return this.getTeam() != null ? this.getTeam().isSameTeam(var1) : false; +- } ++ public boolean isOnSameTeam(EntityLivingBase par1EntityLivingBase) { ++ return this.isOnTeam(par1EntityLivingBase.getTeam()); ++ } ++ ++ /** ++ * Returns true if the entity is on a specific team. ++ */ ++ public boolean isOnTeam(Team par1Team) { ++ return this.getTeam() != null ? this.getTeam().isSameTeam(par1Team) : false; ++ } ++ ++ // Spout Start ++ public EntityData getData() { ++ return entityData; ++ } ++ ++ public void setData(EntityData e) { ++ this.entityData = e; ++ } ++ ++ public String getCustomTextureUrl(byte id){ ++ if (getData().getCustomTextures() == null) { ++ return null; ++ } ++ return getData().getCustomTextures().get(id); ++ } ++ ++ public String getCustomTexture(byte id){ ++ if(getCustomTextureUrl(id) != null ) { ++ return CustomTextureManager.getTexturePathFromUrl(getCustomTextureUrl(id)); ++ } ++ return null; ++ } ++ ++ public String getCustomTexture(EntitySkinType type, String def) { ++ String tex = getCustomTexture(type.getId()); ++ if (tex == null) { ++ tex = def; ++ } ++ return tex; ++ } ++ ++ public void setCustomTexture(String url, byte id){ ++ if (url != null) { ++ CustomTextureManager.downloadTexture(url); ++ } ++ if (getData().getCustomTextures() != null) { ++ getData().getCustomTextures().put(id, url); ++ } ++ } ++ ++ public void setTextureToRender(byte textureToRender) { ++ getData().setTextureToRender(textureToRender); ++ } ++ ++ public byte getTextureToRender() { ++ return getData().getTextureToRender(); ++ } ++ ++ public void setDisplayName(String var1) { ++ this.displayName = var1; ++ } ++ ++ public String getDisplayName() { ++ return this.displayName; ++ } ++ // Spout End + } diff --git a/patches/net/minecraft/src/EntityLookHelper.java.patch b/patches/net/minecraft/src/EntityLookHelper.java.patch new file mode 100644 index 0000000..8b90f5f --- /dev/null +++ b/patches/net/minecraft/src/EntityLookHelper.java.patch @@ -0,0 +1,144 @@ +--- net/minecraft/src/EntityLookHelper.java ++++ net/minecraft/src/EntityLookHelper.java +@@ -2,50 +2,71 @@ + + public class EntityLookHelper { + private EntityLiving entity; ++ ++ /** ++ * The amount of change that is made each update for an entity facing a direction. ++ */ + private float deltaLookYaw; ++ ++ /** ++ * The amount of change that is made each update for an entity facing a direction. ++ */ + private float deltaLookPitch; ++ ++ /** Whether or not the entity is trying to look at something. */ + private boolean isLooking; + private double posX; + private double posY; + private double posZ; + +- public EntityLookHelper(EntityLiving var1) { +- this.entity = var1; ++ public EntityLookHelper(EntityLiving par1EntityLiving) { ++ this.entity = par1EntityLiving; + } + +- public void setLookPositionWithEntity(Entity var1, float var2, float var3) { +- this.posX = var1.posX; +- if(var1 instanceof EntityLivingBase) { +- this.posY = var1.posY + (double)var1.getEyeHeight(); ++ /** ++ * Sets position to look at using entity ++ */ ++ public void setLookPositionWithEntity(Entity par1Entity, float par2, float par3) { ++ this.posX = par1Entity.posX; ++ ++ if (par1Entity instanceof EntityLivingBase) { ++ this.posY = par1Entity.posY + (double)par1Entity.getEyeHeight(); + } else { +- this.posY = (var1.boundingBox.minY + var1.boundingBox.maxY) / 2.0D; ++ this.posY = (par1Entity.boundingBox.minY + par1Entity.boundingBox.maxY) / 2.0D; + } + +- this.posZ = var1.posZ; +- this.deltaLookYaw = var2; +- this.deltaLookPitch = var3; +- this.isLooking = true; +- } +- +- public void setLookPosition(double var1, double var3, double var5, float var7, float var8) { +- this.posX = var1; +- this.posY = var3; +- this.posZ = var5; +- this.deltaLookYaw = var7; +- this.deltaLookPitch = var8; +- this.isLooking = true; +- } +- ++ this.posZ = par1Entity.posZ; ++ this.deltaLookYaw = par2; ++ this.deltaLookPitch = par3; ++ this.isLooking = true; ++ } ++ ++ /** ++ * Sets position to look at ++ */ ++ public void setLookPosition(double par1, double par3, double par5, float par7, float par8) { ++ this.posX = par1; ++ this.posY = par3; ++ this.posZ = par5; ++ this.deltaLookYaw = par7; ++ this.deltaLookPitch = par8; ++ this.isLooking = true; ++ } ++ ++ /** ++ * Updates look ++ */ + public void onUpdateLook() { + this.entity.rotationPitch = 0.0F; +- if(this.isLooking) { ++ ++ if (this.isLooking) { + this.isLooking = false; + double var1 = this.posX - this.entity.posX; + double var3 = this.posY - (this.entity.posY + (double)this.entity.getEyeHeight()); + double var5 = this.posZ - this.entity.posZ; + double var7 = (double)MathHelper.sqrt_double(var1 * var1 + var5 * var5); +- float var9 = (float)(Math.atan2(var5, var1) * 180.0D / (double)((float)Math.PI)) - 90.0F; +- float var10 = (float)(-(Math.atan2(var3, var7) * 180.0D / (double)((float)Math.PI))); ++ float var9 = (float)(Math.atan2(var5, var1) * 180.0D / Math.PI) - 90.0F; ++ float var10 = (float)(-(Math.atan2(var3, var7) * 180.0D / Math.PI)); + this.entity.rotationPitch = this.updateRotation(this.entity.rotationPitch, var10, this.deltaLookPitch); + this.entity.rotationYawHead = this.updateRotation(this.entity.rotationYawHead, var9, this.deltaLookYaw); + } else { +@@ -53,28 +74,29 @@ + } + + float var11 = MathHelper.wrapAngleTo180_float(this.entity.rotationYawHead - this.entity.renderYawOffset); +- if(!this.entity.getNavigator().noPath()) { +- if(var11 < -75.0F) { ++ ++ if (!this.entity.getNavigator().noPath()) { ++ if (var11 < -75.0F) { + this.entity.rotationYawHead = this.entity.renderYawOffset - 75.0F; + } + +- if(var11 > 75.0F) { ++ if (var11 > 75.0F) { + this.entity.rotationYawHead = this.entity.renderYawOffset + 75.0F; + } + } +- + } + +- private float updateRotation(float var1, float var2, float var3) { +- float var4 = MathHelper.wrapAngleTo180_float(var2 - var1); +- if(var4 > var3) { +- var4 = var3; +- } +- +- if(var4 < -var3) { +- var4 = -var3; +- } +- +- return var1 + var4; ++ private float updateRotation(float par1, float par2, float par3) { ++ float var4 = MathHelper.wrapAngleTo180_float(par2 - par1); ++ ++ if (var4 > par3) { ++ var4 = par3; ++ } ++ ++ if (var4 < -par3) { ++ var4 = -par3; ++ } ++ ++ return par1 + var4; + } + } diff --git a/patches/net/minecraft/src/EntityMagmaCube.java.patch b/patches/net/minecraft/src/EntityMagmaCube.java.patch new file mode 100644 index 0000000..7d810f7 --- /dev/null +++ b/patches/net/minecraft/src/EntityMagmaCube.java.patch @@ -0,0 +1,170 @@ +--- net/minecraft/src/EntityMagmaCube.java ++++ net/minecraft/src/EntityMagmaCube.java +@@ -1,32 +1,44 @@ + package net.minecraft.src; + + public class EntityMagmaCube extends EntitySlime { +- public EntityMagmaCube(World var1) { +- super(var1); ++ public EntityMagmaCube(World par1World) { ++ super(par1World); + this.isImmuneToFire = true; + } + + protected void applyEntityAttributes() { + super.applyEntityAttributes(); +- this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setAttribute((double)0.2F); ++ this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setAttribute(0.20000000298023224D); + } + ++ /** ++ * Checks if the entity's current position is a valid location to spawn this entity. ++ */ + public boolean getCanSpawnHere() { + return this.worldObj.difficultySetting > 0 && this.worldObj.checkNoEntityCollision(this.boundingBox) && this.worldObj.getCollidingBoundingBoxes(this, this.boundingBox).isEmpty() && !this.worldObj.isAnyLiquid(this.boundingBox); + } + ++ /** ++ * Returns the current armor value as determined by a call to InventoryPlayer.getTotalArmorValue ++ */ + public int getTotalArmorValue() { + return this.getSlimeSize() * 3; + } + +- public int getBrightnessForRender(float var1) { ++ public int getBrightnessForRender(float par1) { + return 15728880; + } + +- public float getBrightness(float var1) { ++ /** ++ * Gets how bright this entity is. ++ */ ++ public float getBrightness(float par1) { + return 1.0F; + } + ++ /** ++ * Returns the name of a particle effect that may be randomly created by EntitySlime.onUpdate() ++ */ + protected String getSlimeParticle() { + return "flame"; + } +@@ -35,29 +47,43 @@ + return new EntityMagmaCube(this.worldObj); + } + ++ /** ++ * Returns the item ID for the item the mob drops on death. ++ */ + protected int getDropItemId() { + return Item.magmaCream.itemID; + } + +- protected void dropFewItems(boolean var1, int var2) { ++ /** ++ * Drop 0-2 items of this living's type. @param par1 - Whether this entity has recently been hit by a player. @param ++ * par2 - Level of Looting used to kill this mob. ++ */ ++ protected void dropFewItems(boolean par1, int par2) { + int var3 = this.getDropItemId(); +- if(var3 > 0 && this.getSlimeSize() > 1) { +- int var4 = this.ab.nextInt(4) - 2; +- if(var2 > 0) { +- var4 += this.ab.nextInt(var2 + 1); ++ ++ if (var3 > 0 && this.getSlimeSize() > 1) { ++ int var4 = this.rand.nextInt(4) - 2; ++ ++ if (par2 > 0) { ++ var4 += this.rand.nextInt(par2 + 1); + } + +- for(int var5 = 0; var5 < var4; ++var5) { ++ for (int var5 = 0; var5 < var4; ++var5) { + this.dropItem(var3, 1); + } + } +- + } + ++ /** ++ * Returns true if the entity is on fire. Used by render to add the fire effect on rendering. ++ */ + public boolean isBurning() { + return false; + } + ++ /** ++ * Gets the amount of time the slime needs to wait between jumps. ++ */ + protected int getJumpDelay() { + return super.getJumpDelay() * 4; + } +@@ -66,38 +92,64 @@ + this.squishAmount *= 0.9F; + } + ++ /** ++ * Causes this entity to do an upwards motion (jumping). ++ */ + protected void jump() { + this.motionY = (double)(0.42F + (float)this.getSlimeSize() * 0.1F); + this.isAirBorne = true; + } + +- protected void fall(float var1) { +- } ++ /** ++ * Called when the mob is falling. Calculates and applies fall damage. ++ */ ++ protected void fall(float par1) {} + ++ /** ++ * Indicates weather the slime is able to damage the player (based upon the slime's size) ++ */ + protected boolean canDamagePlayer() { + return true; + } + ++ /** ++ * Gets the amount of damage dealt to the player when "attacked" by the slime. ++ */ + protected int getAttackStrength() { + return super.getAttackStrength() + 2; + } + ++ /** ++ * Returns the sound this mob makes when it is hurt. ++ */ + protected String getHurtSound() { + return "mob.slime." + (this.getSlimeSize() > 1 ? "big" : "small"); + } + ++ /** ++ * Returns the sound this mob makes on death. ++ */ + protected String getDeathSound() { + return "mob.slime." + (this.getSlimeSize() > 1 ? "big" : "small"); + } + ++ /** ++ * Returns the name of the sound played when the slime jumps. ++ */ + protected String getJumpSound() { + return this.getSlimeSize() > 1 ? "mob.magmacube.big" : "mob.magmacube.small"; + } + ++ /** ++ * Whether or not the current entity is in lava ++ */ + public boolean handleLavaMovement() { + return false; + } + ++ /** ++ * Returns true if the slime makes a sound when it lands after a jump (based upon the slime's size) ++ */ + protected boolean makesSoundOnLand() { + return true; + } diff --git a/patches/net/minecraft/src/EntityMinecart.java.patch b/patches/net/minecraft/src/EntityMinecart.java.patch new file mode 100644 index 0000000..a0f6d58 --- /dev/null +++ b/patches/net/minecraft/src/EntityMinecart.java.patch @@ -0,0 +1,1218 @@ +--- net/minecraft/src/EntityMinecart.java ++++ net/minecraft/src/EntityMinecart.java +@@ -6,8 +6,12 @@ + public abstract class EntityMinecart extends Entity { + private boolean isInReverse; + private final IUpdatePlayerListBox field_82344_g; +- private String c; +- private static final int[][][] matrix = new int[][][]{{{0, 0, -1}, {0, 0, 1}}, {{-1, 0, 0}, {1, 0, 0}}, {{-1, -1, 0}, {1, 0, 0}}, {{-1, 0, 0}, {1, -1, 0}}, {{0, 0, -1}, {0, -1, 1}}, {{0, -1, -1}, {0, 0, 1}}, {{0, 0, 1}, {1, 0, 0}}, {{0, 0, 1}, {-1, 0, 0}}, {{0, 0, -1}, {-1, 0, 0}}, {{0, 0, -1}, {1, 0, 0}}}; ++ private String entityName; ++ ++ /** Minecart rotational logic matrix */ ++ private static final int[][][] matrix = new int[][][] {{{0, 0, -1}, {0, 0, 1}}, {{ -1, 0, 0}, {1, 0, 0}}, {{ -1, -1, 0}, {1, 0, 0}}, {{ -1, 0, 0}, {1, -1, 0}}, {{0, 0, -1}, {0, -1, 1}}, {{0, -1, -1}, {0, 0, 1}}, {{0, 0, 1}, {1, 0, 0}}, {{0, 0, 1}, { -1, 0, 0}}, {{0, 0, -1}, { -1, 0, 0}}, {{0, 0, -1}, {1, 0, 0}}}; ++ ++ /** appears to be the progress of the turn */ + private int turnProgress; + private double minecartX; + private double minecartY; +@@ -18,31 +22,46 @@ + private double velocityY; + private double velocityZ; + +- public EntityMinecart(World var1) { +- super(var1); ++ public EntityMinecart(World par1World) { ++ super(par1World); + this.preventEntitySpawning = true; + this.setSize(0.98F, 0.7F); + this.yOffset = this.height / 2.0F; +- this.field_82344_g = var1 != null ? var1.getMinecartSoundUpdater(this) : null; ++ this.field_82344_g = par1World != null ? par1World.getMinecartSoundUpdater(this) : null; + } + +- public static EntityMinecart createMinecart(World var0, double var1, double var3, double var5, int var7) { +- switch(var7) { +- case 1: +- return new EntityMinecartChest(var0, var1, var3, var5); +- case 2: +- return new EntityMinecartFurnace(var0, var1, var3, var5); +- case 3: +- return new EntityMinecartTNT(var0, var1, var3, var5); +- case 4: +- return new EntityMinecartMobSpawner(var0, var1, var3, var5); +- case 5: +- return new EntityMinecartHopper(var0, var1, var3, var5); +- default: +- return new EntityMinecartEmpty(var0, var1, var3, var5); ++ /** ++ * Creates a new minecart of the specified type in the specified location in the given world. par0World - world to ++ * create the minecart in, double par1,par3,par5 represent x,y,z respectively. int par7 specifies the type: 1 for ++ * MinecartChest, 2 for MinecartFurnace, 3 for MinecartTNT, 4 for MinecartMobSpawner, 5 for MinecartHopper and 0 for a ++ * standard empty minecart ++ */ ++ public static EntityMinecart createMinecart(World par0World, double par1, double par3, double par5, int par7) { ++ switch (par7) { ++ case 1: ++ return new EntityMinecartChest(par0World, par1, par3, par5); ++ ++ case 2: ++ return new EntityMinecartFurnace(par0World, par1, par3, par5); ++ ++ case 3: ++ return new EntityMinecartTNT(par0World, par1, par3, par5); ++ ++ case 4: ++ return new EntityMinecartMobSpawner(par0World, par1, par3, par5); ++ ++ case 5: ++ return new EntityMinecartHopper(par0World, par1, par3, par5); ++ ++ default: ++ return new EntityMinecartEmpty(par0World, par1, par3, par5); + } + } + ++ /** ++ * returns if this entity triggers Block.onEntityWalking on the blocks they walk on. used for spiders and wolves to ++ * prevent them from trampling crops ++ */ + protected boolean canTriggerWalking() { + return false; + } +@@ -56,52 +75,69 @@ + this.dataWatcher.addObject(22, Byte.valueOf((byte)0)); + } + +- public AxisAlignedBB getCollisionBox(Entity var1) { +- return var1.canBePushed() ? var1.boundingBox : null; ++ /** ++ * Returns a boundingBox used to collide the entity with other entities and blocks. This enables the entity to be ++ * pushable on contact, like boats or minecarts. ++ */ ++ public AxisAlignedBB getCollisionBox(Entity par1Entity) { ++ return par1Entity.canBePushed() ? par1Entity.boundingBox : null; + } + ++ /** ++ * returns the bounding box for this entity ++ */ + public AxisAlignedBB getBoundingBox() { + return null; + } + ++ /** ++ * Returns true if this entity should push and be pushed by other entities when colliding. ++ */ + public boolean canBePushed() { + return true; + } + +- public EntityMinecart(World var1, double var2, double var4, double var6) { +- this(var1); +- this.setPosition(var2, var4, var6); ++ public EntityMinecart(World par1World, double par2, double par4, double par6) { ++ this(par1World); ++ this.setPosition(par2, par4, par6); + this.motionX = 0.0D; + this.motionY = 0.0D; + this.motionZ = 0.0D; +- this.prevPosX = var2; +- this.prevPosY = var4; +- this.prevPosZ = var6; ++ this.prevPosX = par2; ++ this.prevPosY = par4; ++ this.prevPosZ = par6; + } + ++ /** ++ * Returns the Y offset from the entity's position for any entity riding this one. ++ */ + public double getMountedYOffset() { +- return (double)this.height * 0.0D - (double)0.3F; ++ return (double)this.height * 0.0D - 0.30000001192092896D; + } + +- public boolean attackEntityFrom(DamageSource var1, float var2) { +- if(!this.worldObj.isRemote && !this.isDead) { +- if(this.isEntityInvulnerable()) { ++ /** ++ * Called when the entity is attacked. ++ */ ++ public boolean attackEntityFrom(DamageSource par1DamageSource, float par2) { ++ if (!this.worldObj.isRemote && !this.isDead) { ++ if (this.isEntityInvulnerable()) { + return false; + } else { + this.setRollingDirection(-this.getRollingDirection()); + this.setRollingAmplitude(10); + this.setBeenAttacked(); +- this.setDamage(this.getDamage() + var2 * 10.0F); +- boolean var3 = var1.getEntity() instanceof EntityPlayer && ((EntityPlayer)var1.getEntity()).capabilities.isCreativeMode; +- if(var3 || this.getDamage() > 40.0F) { +- if(this.riddenByEntity != null) { ++ this.setDamage(this.getDamage() + par2 * 10.0F); ++ boolean var3 = par1DamageSource.getEntity() instanceof EntityPlayer && ((EntityPlayer)par1DamageSource.getEntity()).capabilities.isCreativeMode; ++ ++ if (var3 || this.getDamage() > 40.0F) { ++ if (this.riddenByEntity != null) { + this.riddenByEntity.mountEntity(this); + } + +- if(var3 && !this.isInvNameLocalized()) { ++ if (var3 && !this.isInvNameLocalized()) { + this.setDead(); + } else { +- this.killMinecart(var1); ++ this.killMinecart(par1DamageSource); + } + } + +@@ -112,63 +148,79 @@ + } + } + +- public void killMinecart(DamageSource var1) { ++ public void killMinecart(DamageSource par1DamageSource) { + this.setDead(); + ItemStack var2 = new ItemStack(Item.minecartEmpty, 1); +- if(this.c != null) { +- var2.setItemName(this.c); ++ ++ if (this.entityName != null) { ++ var2.setItemName(this.entityName); + } + + this.entityDropItem(var2, 0.0F); + } + ++ /** ++ * Setups the entity to do the hurt animation. Only used by packets in multiplayer. ++ */ + public void performHurtAnimation() { + this.setRollingDirection(-this.getRollingDirection()); + this.setRollingAmplitude(10); + this.setDamage(this.getDamage() + this.getDamage() * 10.0F); + } + ++ /** ++ * Returns true if other Entities should be prevented from moving through this Entity. ++ */ + public boolean canBeCollidedWith() { + return !this.isDead; + } + ++ /** ++ * Will get destroyed next tick. ++ */ + public void setDead() { + super.setDead(); +- if(this.field_82344_g != null) { ++ ++ if (this.field_82344_g != null) { + this.field_82344_g.update(); + } +- + } + ++ /** ++ * Called to update the entity's position/logic. ++ */ + public void onUpdate() { +- if(this.field_82344_g != null) { ++ if (this.field_82344_g != null) { + this.field_82344_g.update(); + } + +- if(this.getRollingAmplitude() > 0) { ++ if (this.getRollingAmplitude() > 0) { + this.setRollingAmplitude(this.getRollingAmplitude() - 1); + } + +- if(this.getDamage() > 0.0F) { ++ if (this.getDamage() > 0.0F) { + this.setDamage(this.getDamage() - 1.0F); + } + +- if(this.posY < -64.0D) { ++ if (this.posY < -64.0D) { + this.kill(); + } + + int var2; +- if(!this.worldObj.isRemote && this.worldObj instanceof WorldServer) { ++ ++ if (!this.worldObj.isRemote && this.worldObj instanceof WorldServer) { + this.worldObj.theProfiler.startSection("portal"); + MinecraftServer var1 = ((WorldServer)this.worldObj).getMinecraftServer(); + var2 = this.getMaxInPortalTime(); +- if(this.inPortal) { +- if(var1.getAllowNether()) { +- if(this.ridingEntity == null && this.portalCounter++ >= var2) { ++ ++ if (this.inPortal) { ++ if (var1.getAllowNether()) { ++ if (this.ridingEntity == null && this.portalCounter++ >= var2) { + this.portalCounter = var2; + this.timeUntilPortal = this.getPortalCooldown(); + byte var3; +- if(this.worldObj.provider.dimensionId == -1) { ++ ++ if (this.worldObj.provider.dimensionId == -1) { + var3 = 0; + } else { + var3 = -1; +@@ -180,24 +232,24 @@ + this.inPortal = false; + } + } else { +- if(this.portalCounter > 0) { ++ if (this.portalCounter > 0) { + this.portalCounter -= 4; + } + +- if(this.portalCounter < 0) { ++ if (this.portalCounter < 0) { + this.portalCounter = 0; + } + } + +- if(this.timeUntilPortal > 0) { ++ if (this.timeUntilPortal > 0) { + --this.timeUntilPortal; + } + + this.worldObj.theProfiler.endSection(); + } + +- if(this.worldObj.isRemote) { +- if(this.turnProgress > 0) { ++ if (this.worldObj.isRemote) { ++ if (this.turnProgress > 0) { + double var19 = this.posX + (this.minecartX - this.posX) / (double)this.turnProgress; + double var21 = this.posY + (this.minecartY - this.posY) / (double)this.turnProgress; + double var5 = this.posZ + (this.minecartZ - this.posZ) / (double)this.turnProgress; +@@ -211,26 +263,28 @@ + this.setPosition(this.posX, this.posY, this.posZ); + this.setRotation(this.rotationYaw, this.rotationPitch); + } +- + } else { + this.prevPosX = this.posX; + this.prevPosY = this.posY; + this.prevPosZ = this.posZ; +- this.motionY -= (double)0.04F; ++ this.motionY -= 0.03999999910593033D; + int var18 = MathHelper.floor_double(this.posX); + var2 = MathHelper.floor_double(this.posY); + int var20 = MathHelper.floor_double(this.posZ); +- if(BlockRailBase.isRailBlockAt(this.worldObj, var18, var2 - 1, var20)) { ++ ++ if (BlockRailBase.isRailBlockAt(this.worldObj, var18, var2 - 1, var20)) { + --var2; + } + + double var4 = 0.4D; +- double var6 = 1.0D / 128.0D; ++ double var6 = 0.0078125D; + int var8 = this.worldObj.getBlockId(var18, var2, var20); +- if(BlockRailBase.isRailBlock(var8)) { ++ ++ if (BlockRailBase.isRailBlock(var8)) { + int var9 = this.worldObj.getBlockMetadata(var18, var2, var20); + this.updateOnTrack(var18, var2, var20, var4, var6, var8, var9); +- if(var8 == Block.railActivator.blockID) { ++ ++ if (var8 == Block.railActivator.blockID) { + this.onActivatorRailPass(var18, var2, var20, (var9 & 8) != 0); + } + } else { +@@ -241,123 +295,132 @@ + this.rotationPitch = 0.0F; + double var22 = this.prevPosX - this.posX; + double var11 = this.prevPosZ - this.posZ; +- if(var22 * var22 + var11 * var11 > 0.001D) { ++ ++ if (var22 * var22 + var11 * var11 > 0.001D) { + this.rotationYaw = (float)(Math.atan2(var11, var22) * 180.0D / Math.PI); +- if(this.isInReverse) { ++ ++ if (this.isInReverse) { + this.rotationYaw += 180.0F; + } + } + + double var13 = (double)MathHelper.wrapAngleTo180_float(this.rotationYaw - this.prevRotationYaw); +- if(var13 < -170.0D || var13 >= 170.0D) { ++ ++ if (var13 < -170.0D || var13 >= 170.0D) { + this.rotationYaw += 180.0F; + this.isInReverse = !this.isInReverse; + } + + this.setRotation(this.rotationYaw, this.rotationPitch); +- List var15 = this.worldObj.getEntitiesWithinAABBExcludingEntity(this, this.boundingBox.expand((double)0.2F, 0.0D, (double)0.2F)); +- if(var15 != null && !var15.isEmpty()) { +- for(int var16 = 0; var16 < var15.size(); ++var16) { ++ List var15 = this.worldObj.getEntitiesWithinAABBExcludingEntity(this, this.boundingBox.expand(0.20000000298023224D, 0.0D, 0.20000000298023224D)); ++ ++ if (var15 != null && !var15.isEmpty()) { ++ for (int var16 = 0; var16 < var15.size(); ++var16) { + Entity var17 = (Entity)var15.get(var16); +- if(var17 != this.riddenByEntity && var17.canBePushed() && var17 instanceof EntityMinecart) { ++ ++ if (var17 != this.riddenByEntity && var17.canBePushed() && var17 instanceof EntityMinecart) { + var17.applyEntityCollision(this); + } + } + } + +- if(this.riddenByEntity != null && this.riddenByEntity.isDead) { +- if(this.riddenByEntity.ridingEntity == this) { ++ if (this.riddenByEntity != null && this.riddenByEntity.isDead) { ++ if (this.riddenByEntity.ridingEntity == this) { + this.riddenByEntity.ridingEntity = null; + } + + this.riddenByEntity = null; + } +- +- } +- } +- +- public void onActivatorRailPass(int var1, int var2, int var3, boolean var4) { +- } +- +- protected void func_94088_b(double var1) { +- if(this.motionX < -var1) { +- this.motionX = -var1; +- } +- +- if(this.motionX > var1) { +- this.motionX = var1; +- } +- +- if(this.motionZ < -var1) { +- this.motionZ = -var1; +- } +- +- if(this.motionZ > var1) { +- this.motionZ = var1; +- } +- +- if(this.onGround) { ++ } ++ } ++ ++ /** ++ * Called every tick the minecart is on an activator rail. ++ */ ++ public void onActivatorRailPass(int par1, int par2, int par3, boolean par4) {} ++ ++ protected void func_94088_b(double par1) { ++ if (this.motionX < -par1) { ++ this.motionX = -par1; ++ } ++ ++ if (this.motionX > par1) { ++ this.motionX = par1; ++ } ++ ++ if (this.motionZ < -par1) { ++ this.motionZ = -par1; ++ } ++ ++ if (this.motionZ > par1) { ++ this.motionZ = par1; ++ } ++ ++ if (this.onGround) { + this.motionX *= 0.5D; + this.motionY *= 0.5D; + this.motionZ *= 0.5D; + } + + this.moveEntity(this.motionX, this.motionY, this.motionZ); +- if(!this.onGround) { +- this.motionX *= (double)0.95F; +- this.motionY *= (double)0.95F; +- this.motionZ *= (double)0.95F; ++ ++ if (!this.onGround) { ++ this.motionX *= 0.949999988079071D; ++ this.motionY *= 0.949999988079071D; ++ this.motionZ *= 0.949999988079071D; + } +- + } + +- protected void updateOnTrack(int var1, int var2, int var3, double var4, double var6, int var8, int var9) { ++ protected void updateOnTrack(int par1, int par2, int par3, double par4, double par6, int par8, int par9) { + this.fallDistance = 0.0F; + Vec3 var10 = this.func_70489_a(this.posX, this.posY, this.posZ); +- this.posY = (double)var2; ++ this.posY = (double)par2; + boolean var11 = false; + boolean var12 = false; +- if(var8 == Block.railPowered.blockID) { +- var11 = (var9 & 8) != 0; ++ ++ if (par8 == Block.railPowered.blockID) { ++ var11 = (par9 & 8) != 0; + var12 = !var11; + } + +- if(((BlockRailBase)Block.blocksList[var8]).isPowered()) { +- var9 &= 7; +- } +- +- if(var9 >= 2 && var9 <= 5) { +- this.posY = (double)(var2 + 1); +- } +- +- if(var9 == 2) { +- this.motionX -= var6; +- } +- +- if(var9 == 3) { +- this.motionX += var6; +- } +- +- if(var9 == 4) { +- this.motionZ += var6; +- } +- +- if(var9 == 5) { +- this.motionZ -= var6; +- } +- +- int[][] var13 = matrix[var9]; ++ if (((BlockRailBase)Block.blocksList[par8]).isPowered()) { ++ par9 &= 7; ++ } ++ ++ if (par9 >= 2 && par9 <= 5) { ++ this.posY = (double)(par2 + 1); ++ } ++ ++ if (par9 == 2) { ++ this.motionX -= par6; ++ } ++ ++ if (par9 == 3) { ++ this.motionX += par6; ++ } ++ ++ if (par9 == 4) { ++ this.motionZ += par6; ++ } ++ ++ if (par9 == 5) { ++ this.motionZ -= par6; ++ } ++ ++ int[][] var13 = matrix[par9]; + double var14 = (double)(var13[1][0] - var13[0][0]); + double var16 = (double)(var13[1][2] - var13[0][2]); + double var18 = Math.sqrt(var14 * var14 + var16 * var16); + double var20 = this.motionX * var14 + this.motionZ * var16; +- if(var20 < 0.0D) { ++ ++ if (var20 < 0.0D) { + var14 = -var14; + var16 = -var16; + } + + double var22 = Math.sqrt(this.motionX * this.motionX + this.motionZ * this.motionZ); +- if(var22 > 2.0D) { ++ ++ if (var22 > 2.0D) { + var22 = 2.0D; + } + +@@ -367,13 +430,16 @@ + double var26; + double var28; + double var30; +- if(this.riddenByEntity != null && this.riddenByEntity instanceof EntityLivingBase) { ++ ++ if (this.riddenByEntity != null && this.riddenByEntity instanceof EntityLivingBase) { + var24 = (double)((EntityLivingBase)this.riddenByEntity).moveForward; +- if(var24 > 0.0D) { ++ ++ if (var24 > 0.0D) { + var26 = -Math.sin((double)(this.riddenByEntity.rotationYaw * (float)Math.PI / 180.0F)); + var28 = Math.cos((double)(this.riddenByEntity.rotationYaw * (float)Math.PI / 180.0F)); + var30 = this.motionX * this.motionX + this.motionZ * this.motionZ; +- if(var30 < 0.01D) { ++ ++ if (var30 < 0.01D) { + this.motionX += var26 * 0.1D; + this.motionZ += var28 * 0.1D; + var12 = false; +@@ -381,9 +447,10 @@ + } + } + +- if(var12) { ++ if (var12) { + var24 = Math.sqrt(this.motionX * this.motionX + this.motionZ * this.motionZ); +- if(var24 < 0.03D) { ++ ++ if (var24 < 0.03D) { + this.motionX *= 0.0D; + this.motionY *= 0.0D; + this.motionZ *= 0.0D; +@@ -395,20 +462,21 @@ + } + + var24 = 0.0D; +- var26 = (double)var1 + 0.5D + (double)var13[0][0] * 0.5D; +- var28 = (double)var3 + 0.5D + (double)var13[0][2] * 0.5D; +- var30 = (double)var1 + 0.5D + (double)var13[1][0] * 0.5D; +- double var32 = (double)var3 + 0.5D + (double)var13[1][2] * 0.5D; ++ var26 = (double)par1 + 0.5D + (double)var13[0][0] * 0.5D; ++ var28 = (double)par3 + 0.5D + (double)var13[0][2] * 0.5D; ++ var30 = (double)par1 + 0.5D + (double)var13[1][0] * 0.5D; ++ double var32 = (double)par3 + 0.5D + (double)var13[1][2] * 0.5D; + var14 = var30 - var26; + var16 = var32 - var28; + double var34; + double var36; +- if(var14 == 0.0D) { +- this.posX = (double)var1 + 0.5D; +- var24 = this.posZ - (double)var3; +- } else if(var16 == 0.0D) { +- this.posZ = (double)var3 + 0.5D; +- var24 = this.posX - (double)var1; ++ ++ if (var14 == 0.0D) { ++ this.posX = (double)par1 + 0.5D; ++ var24 = this.posZ - (double)par3; ++ } else if (var16 == 0.0D) { ++ this.posZ = (double)par3 + 0.5D; ++ var24 = this.posX - (double)par1; + } else { + var34 = this.posX - var26; + var36 = this.posZ - var28; +@@ -420,40 +488,44 @@ + this.setPosition(this.posX, this.posY + (double)this.yOffset, this.posZ); + var34 = this.motionX; + var36 = this.motionZ; +- if(this.riddenByEntity != null) { ++ ++ if (this.riddenByEntity != null) { + var34 *= 0.75D; + var36 *= 0.75D; + } + +- if(var34 < -var4) { +- var34 = -var4; +- } +- +- if(var34 > var4) { +- var34 = var4; +- } +- +- if(var36 < -var4) { +- var36 = -var4; +- } +- +- if(var36 > var4) { +- var36 = var4; ++ if (var34 < -par4) { ++ var34 = -par4; ++ } ++ ++ if (var34 > par4) { ++ var34 = par4; ++ } ++ ++ if (var36 < -par4) { ++ var36 = -par4; ++ } ++ ++ if (var36 > par4) { ++ var36 = par4; + } + + this.moveEntity(var34, 0.0D, var36); +- if(var13[0][1] != 0 && MathHelper.floor_double(this.posX) - var1 == var13[0][0] && MathHelper.floor_double(this.posZ) - var3 == var13[0][2]) { ++ ++ if (var13[0][1] != 0 && MathHelper.floor_double(this.posX) - par1 == var13[0][0] && MathHelper.floor_double(this.posZ) - par3 == var13[0][2]) { + this.setPosition(this.posX, this.posY + (double)var13[0][1], this.posZ); +- } else if(var13[1][1] != 0 && MathHelper.floor_double(this.posX) - var1 == var13[1][0] && MathHelper.floor_double(this.posZ) - var3 == var13[1][2]) { ++ } else if (var13[1][1] != 0 && MathHelper.floor_double(this.posX) - par1 == var13[1][0] && MathHelper.floor_double(this.posZ) - par3 == var13[1][2]) { + this.setPosition(this.posX, this.posY + (double)var13[1][1], this.posZ); + } + + this.applyDrag(); + Vec3 var38 = this.func_70489_a(this.posX, this.posY, this.posZ); +- if(var38 != null && var10 != null) { ++ ++ if (var38 != null && var10 != null) { + double var39 = (var10.yCoord - var38.yCoord) * 0.05D; + var22 = Math.sqrt(this.motionX * this.motionX + this.motionZ * this.motionZ); +- if(var22 > 0.0D) { ++ ++ if (var22 > 0.0D) { + this.motionX = this.motionX / var22 * (var22 + var39); + this.motionZ = this.motionZ / var22 * (var22 + var39); + } +@@ -463,68 +535,72 @@ + + int var45 = MathHelper.floor_double(this.posX); + int var40 = MathHelper.floor_double(this.posZ); +- if(var45 != var1 || var40 != var3) { ++ ++ if (var45 != par1 || var40 != par3) { + var22 = Math.sqrt(this.motionX * this.motionX + this.motionZ * this.motionZ); +- this.motionX = var22 * (double)(var45 - var1); +- this.motionZ = var22 * (double)(var40 - var3); ++ this.motionX = var22 * (double)(var45 - par1); ++ this.motionZ = var22 * (double)(var40 - par3); + } + +- if(var11) { ++ if (var11) { + double var41 = Math.sqrt(this.motionX * this.motionX + this.motionZ * this.motionZ); +- if(var41 > 0.01D) { ++ ++ if (var41 > 0.01D) { + double var43 = 0.06D; + this.motionX += this.motionX / var41 * var43; + this.motionZ += this.motionZ / var41 * var43; +- } else if(var9 == 1) { +- if(this.worldObj.isBlockNormalCube(var1 - 1, var2, var3)) { ++ } else if (par9 == 1) { ++ if (this.worldObj.isBlockNormalCube(par1 - 1, par2, par3)) { + this.motionX = 0.02D; +- } else if(this.worldObj.isBlockNormalCube(var1 + 1, var2, var3)) { ++ } else if (this.worldObj.isBlockNormalCube(par1 + 1, par2, par3)) { + this.motionX = -0.02D; + } +- } else if(var9 == 0) { +- if(this.worldObj.isBlockNormalCube(var1, var2, var3 - 1)) { ++ } else if (par9 == 0) { ++ if (this.worldObj.isBlockNormalCube(par1, par2, par3 - 1)) { + this.motionZ = 0.02D; +- } else if(this.worldObj.isBlockNormalCube(var1, var2, var3 + 1)) { ++ } else if (this.worldObj.isBlockNormalCube(par1, par2, par3 + 1)) { + this.motionZ = -0.02D; + } + } + } +- + } + + protected void applyDrag() { +- if(this.riddenByEntity != null) { +- this.motionX *= (double)0.997F; ++ if (this.riddenByEntity != null) { ++ this.motionX *= 0.996999979019165D; + this.motionY *= 0.0D; +- this.motionZ *= (double)0.997F; ++ this.motionZ *= 0.996999979019165D; + } else { +- this.motionX *= (double)0.96F; ++ this.motionX *= 0.9599999785423279D; + this.motionY *= 0.0D; +- this.motionZ *= (double)0.96F; ++ this.motionZ *= 0.9599999785423279D; + } +- + } + +- public Vec3 func_70495_a(double var1, double var3, double var5, double var7) { +- int var9 = MathHelper.floor_double(var1); +- int var10 = MathHelper.floor_double(var3); +- int var11 = MathHelper.floor_double(var5); +- if(BlockRailBase.isRailBlockAt(this.worldObj, var9, var10 - 1, var11)) { ++ public Vec3 func_70495_a(double par1, double par3, double par5, double par7) { ++ int var9 = MathHelper.floor_double(par1); ++ int var10 = MathHelper.floor_double(par3); ++ int var11 = MathHelper.floor_double(par5); ++ ++ if (BlockRailBase.isRailBlockAt(this.worldObj, var9, var10 - 1, var11)) { + --var10; + } + + int var12 = this.worldObj.getBlockId(var9, var10, var11); +- if(!BlockRailBase.isRailBlock(var12)) { ++ ++ if (!BlockRailBase.isRailBlock(var12)) { + return null; + } else { + int var13 = this.worldObj.getBlockMetadata(var9, var10, var11); +- if(((BlockRailBase)Block.blocksList[var12]).isPowered()) { ++ ++ if (((BlockRailBase)Block.blocksList[var12]).isPowered()) { + var13 &= 7; + } + +- var3 = (double)var10; +- if(var13 >= 2 && var13 <= 5) { +- var3 = (double)(var10 + 1); ++ par3 = (double)var10; ++ ++ if (var13 >= 2 && var13 <= 5) { ++ par3 = (double)(var10 + 1); + } + + int[][] var14 = matrix[var13]; +@@ -533,36 +609,40 @@ + double var19 = Math.sqrt(var15 * var15 + var17 * var17); + var15 /= var19; + var17 /= var19; +- var1 += var15 * var7; +- var5 += var17 * var7; +- if(var14[0][1] != 0 && MathHelper.floor_double(var1) - var9 == var14[0][0] && MathHelper.floor_double(var5) - var11 == var14[0][2]) { +- var3 += (double)var14[0][1]; +- } else if(var14[1][1] != 0 && MathHelper.floor_double(var1) - var9 == var14[1][0] && MathHelper.floor_double(var5) - var11 == var14[1][2]) { +- var3 += (double)var14[1][1]; ++ par1 += var15 * par7; ++ par5 += var17 * par7; ++ ++ if (var14[0][1] != 0 && MathHelper.floor_double(par1) - var9 == var14[0][0] && MathHelper.floor_double(par5) - var11 == var14[0][2]) { ++ par3 += (double)var14[0][1]; ++ } else if (var14[1][1] != 0 && MathHelper.floor_double(par1) - var9 == var14[1][0] && MathHelper.floor_double(par5) - var11 == var14[1][2]) { ++ par3 += (double)var14[1][1]; + } + +- return this.func_70489_a(var1, var3, var5); ++ return this.func_70489_a(par1, par3, par5); + } + } + +- public Vec3 func_70489_a(double var1, double var3, double var5) { +- int var7 = MathHelper.floor_double(var1); +- int var8 = MathHelper.floor_double(var3); +- int var9 = MathHelper.floor_double(var5); +- if(BlockRailBase.isRailBlockAt(this.worldObj, var7, var8 - 1, var9)) { ++ public Vec3 func_70489_a(double par1, double par3, double par5) { ++ int var7 = MathHelper.floor_double(par1); ++ int var8 = MathHelper.floor_double(par3); ++ int var9 = MathHelper.floor_double(par5); ++ ++ if (BlockRailBase.isRailBlockAt(this.worldObj, var7, var8 - 1, var9)) { + --var8; + } + + int var10 = this.worldObj.getBlockId(var7, var8, var9); +- if(BlockRailBase.isRailBlock(var10)) { ++ ++ if (BlockRailBase.isRailBlock(var10)) { + int var11 = this.worldObj.getBlockMetadata(var7, var8, var9); +- var3 = (double)var8; +- if(((BlockRailBase)Block.blocksList[var10]).isPowered()) { ++ par3 = (double)var8; ++ ++ if (((BlockRailBase)Block.blocksList[var10]).isPowered()) { + var11 &= 7; + } + +- if(var11 >= 2 && var11 <= 5) { +- var3 = (double)(var8 + 1); ++ if (var11 >= 2 && var11 <= 5) { ++ par3 = (double)(var8 + 1); + } + + int[][] var12 = matrix[var11]; +@@ -576,175 +656,213 @@ + double var27 = var21 - var15; + double var29 = (var23 - var17) * 2.0D; + double var31 = var25 - var19; +- if(var27 == 0.0D) { +- var1 = (double)var7 + 0.5D; +- var13 = var5 - (double)var9; +- } else if(var31 == 0.0D) { +- var5 = (double)var9 + 0.5D; +- var13 = var1 - (double)var7; ++ ++ if (var27 == 0.0D) { ++ par1 = (double)var7 + 0.5D; ++ var13 = par5 - (double)var9; ++ } else if (var31 == 0.0D) { ++ par5 = (double)var9 + 0.5D; ++ var13 = par1 - (double)var7; + } else { +- double var33 = var1 - var15; +- double var35 = var5 - var19; ++ double var33 = par1 - var15; ++ double var35 = par5 - var19; + var13 = (var33 * var27 + var35 * var31) * 2.0D; + } + +- var1 = var15 + var27 * var13; +- var3 = var17 + var29 * var13; +- var5 = var19 + var31 * var13; +- if(var29 < 0.0D) { +- ++var3; +- } +- +- if(var29 > 0.0D) { +- var3 += 0.5D; +- } +- +- return this.worldObj.getWorldVec3Pool().getVecFromPool(var1, var3, var5); ++ par1 = var15 + var27 * var13; ++ par3 = var17 + var29 * var13; ++ par5 = var19 + var31 * var13; ++ ++ if (var29 < 0.0D) { ++ ++par3; ++ } ++ ++ if (var29 > 0.0D) { ++ par3 += 0.5D; ++ } ++ ++ return this.worldObj.getWorldVec3Pool().getVecFromPool(par1, par3, par5); + } else { + return null; + } + } + +- protected void readEntityFromNBT(NBTTagCompound var1) { +- if(var1.getBoolean("CustomDisplayTile")) { +- this.setDisplayTile(var1.getInteger("DisplayTile")); +- this.setDisplayTileData(var1.getInteger("DisplayData")); +- this.setDisplayTileOffset(var1.getInteger("DisplayOffset")); +- } +- +- if(var1.hasKey("CustomName") && var1.getString("CustomName").length() > 0) { +- this.c = var1.getString("CustomName"); +- } +- ++ /** ++ * (abstract) Protected helper method to read subclass entity data from NBT. ++ */ ++ protected void readEntityFromNBT(NBTTagCompound par1NBTTagCompound) { ++ if (par1NBTTagCompound.getBoolean("CustomDisplayTile")) { ++ this.setDisplayTile(par1NBTTagCompound.getInteger("DisplayTile")); ++ this.setDisplayTileData(par1NBTTagCompound.getInteger("DisplayData")); ++ this.setDisplayTileOffset(par1NBTTagCompound.getInteger("DisplayOffset")); ++ } ++ ++ if (par1NBTTagCompound.hasKey("CustomName") && par1NBTTagCompound.getString("CustomName").length() > 0) { ++ this.entityName = par1NBTTagCompound.getString("CustomName"); ++ } + } + +- protected void writeEntityToNBT(NBTTagCompound var1) { +- if(this.hasDisplayTile()) { +- var1.setBoolean("CustomDisplayTile", true); +- var1.setInteger("DisplayTile", this.getDisplayTile() == null ? 0 : this.getDisplayTile().blockID); +- var1.setInteger("DisplayData", this.getDisplayTileData()); +- var1.setInteger("DisplayOffset", this.getDisplayTileOffset()); +- } +- +- if(this.c != null && this.c.length() > 0) { +- var1.setString("CustomName", this.c); +- } +- ++ /** ++ * (abstract) Protected helper method to write subclass entity data to NBT. ++ */ ++ protected void writeEntityToNBT(NBTTagCompound par1NBTTagCompound) { ++ if (this.hasDisplayTile()) { ++ par1NBTTagCompound.setBoolean("CustomDisplayTile", true); ++ par1NBTTagCompound.setInteger("DisplayTile", this.getDisplayTile() == null ? 0 : this.getDisplayTile().blockID); ++ par1NBTTagCompound.setInteger("DisplayData", this.getDisplayTileData()); ++ par1NBTTagCompound.setInteger("DisplayOffset", this.getDisplayTileOffset()); ++ } ++ ++ if (this.entityName != null && this.entityName.length() > 0) { ++ par1NBTTagCompound.setString("CustomName", this.entityName); ++ } + } + + public float getShadowSize() { + return 0.0F; + } + +- public void applyEntityCollision(Entity var1) { +- if(!this.worldObj.isRemote) { +- if(var1 != this.riddenByEntity) { +- if(var1 instanceof EntityLivingBase && !(var1 instanceof EntityPlayer) && !(var1 instanceof EntityIronGolem) && this.getMinecartType() == 0 && this.motionX * this.motionX + this.motionZ * this.motionZ > 0.01D && this.riddenByEntity == null && var1.ridingEntity == null) { +- var1.mountEntity(this); ++ /** ++ * Applies a velocity to each of the entities pushing them away from each other. Args: entity ++ */ ++ public void applyEntityCollision(Entity par1Entity) { ++ if (!this.worldObj.isRemote) { ++ if (par1Entity != this.riddenByEntity) { ++ if (par1Entity instanceof EntityLivingBase && !(par1Entity instanceof EntityPlayer) && !(par1Entity instanceof EntityIronGolem) && this.getMinecartType() == 0 && this.motionX * this.motionX + this.motionZ * this.motionZ > 0.01D && this.riddenByEntity == null && par1Entity.ridingEntity == null) { ++ par1Entity.mountEntity(this); + } + +- double var2 = var1.posX - this.posX; +- double var4 = var1.posZ - this.posZ; ++ double var2 = par1Entity.posX - this.posX; ++ double var4 = par1Entity.posZ - this.posZ; + double var6 = var2 * var2 + var4 * var4; +- if(var6 >= (double)1.0E-4F) { ++ ++ if (var6 >= 9.999999747378752E-5D) { + var6 = (double)MathHelper.sqrt_double(var6); + var2 /= var6; + var4 /= var6; + double var8 = 1.0D / var6; +- if(var8 > 1.0D) { ++ ++ if (var8 > 1.0D) { + var8 = 1.0D; + } + + var2 *= var8; + var4 *= var8; +- var2 *= (double)0.1F; +- var4 *= (double)0.1F; ++ var2 *= 0.10000000149011612D; ++ var4 *= 0.10000000149011612D; + var2 *= (double)(1.0F - this.entityCollisionReduction); + var4 *= (double)(1.0F - this.entityCollisionReduction); + var2 *= 0.5D; + var4 *= 0.5D; +- if(var1 instanceof EntityMinecart) { +- double var10 = var1.posX - this.posX; +- double var12 = var1.posZ - this.posZ; ++ ++ if (par1Entity instanceof EntityMinecart) { ++ double var10 = par1Entity.posX - this.posX; ++ double var12 = par1Entity.posZ - this.posZ; + Vec3 var14 = this.worldObj.getWorldVec3Pool().getVecFromPool(var10, 0.0D, var12).normalize(); + Vec3 var15 = this.worldObj.getWorldVec3Pool().getVecFromPool((double)MathHelper.cos(this.rotationYaw * (float)Math.PI / 180.0F), 0.0D, (double)MathHelper.sin(this.rotationYaw * (float)Math.PI / 180.0F)).normalize(); + double var16 = Math.abs(var14.dotProduct(var15)); +- if(var16 < (double)0.8F) { ++ ++ if (var16 < 0.800000011920929D) { + return; + } + +- double var18 = var1.motionX + this.motionX; +- double var20 = var1.motionZ + this.motionZ; +- if(((EntityMinecart)var1).getMinecartType() == 2 && this.getMinecartType() != 2) { +- this.motionX *= (double)0.2F; +- this.motionZ *= (double)0.2F; +- this.addVelocity(var1.motionX - var2, 0.0D, var1.motionZ - var4); +- var1.motionX *= (double)0.95F; +- var1.motionZ *= (double)0.95F; +- } else if(((EntityMinecart)var1).getMinecartType() != 2 && this.getMinecartType() == 2) { +- var1.motionX *= (double)0.2F; +- var1.motionZ *= (double)0.2F; +- var1.addVelocity(this.motionX + var2, 0.0D, this.motionZ + var4); +- this.motionX *= (double)0.95F; +- this.motionZ *= (double)0.95F; ++ double var18 = par1Entity.motionX + this.motionX; ++ double var20 = par1Entity.motionZ + this.motionZ; ++ ++ if (((EntityMinecart)par1Entity).getMinecartType() == 2 && this.getMinecartType() != 2) { ++ this.motionX *= 0.20000000298023224D; ++ this.motionZ *= 0.20000000298023224D; ++ this.addVelocity(par1Entity.motionX - var2, 0.0D, par1Entity.motionZ - var4); ++ par1Entity.motionX *= 0.949999988079071D; ++ par1Entity.motionZ *= 0.949999988079071D; ++ } else if (((EntityMinecart)par1Entity).getMinecartType() != 2 && this.getMinecartType() == 2) { ++ par1Entity.motionX *= 0.20000000298023224D; ++ par1Entity.motionZ *= 0.20000000298023224D; ++ par1Entity.addVelocity(this.motionX + var2, 0.0D, this.motionZ + var4); ++ this.motionX *= 0.949999988079071D; ++ this.motionZ *= 0.949999988079071D; + } else { + var18 /= 2.0D; + var20 /= 2.0D; +- this.motionX *= (double)0.2F; +- this.motionZ *= (double)0.2F; ++ this.motionX *= 0.20000000298023224D; ++ this.motionZ *= 0.20000000298023224D; + this.addVelocity(var18 - var2, 0.0D, var20 - var4); +- var1.motionX *= (double)0.2F; +- var1.motionZ *= (double)0.2F; +- var1.addVelocity(var18 + var2, 0.0D, var20 + var4); ++ par1Entity.motionX *= 0.20000000298023224D; ++ par1Entity.motionZ *= 0.20000000298023224D; ++ par1Entity.addVelocity(var18 + var2, 0.0D, var20 + var4); + } + } else { + this.addVelocity(-var2, 0.0D, -var4); +- var1.addVelocity(var2 / 4.0D, 0.0D, var4 / 4.0D); ++ par1Entity.addVelocity(var2 / 4.0D, 0.0D, var4 / 4.0D); + } + } +- + } + } + } + +- public void setPositionAndRotation2(double var1, double var3, double var5, float var7, float var8, int var9) { +- this.minecartX = var1; +- this.minecartY = var3; +- this.minecartZ = var5; +- this.minecartYaw = (double)var7; +- this.minecartPitch = (double)var8; +- this.turnProgress = var9 + 2; ++ /** ++ * Sets the position and rotation. Only difference from the other one is no bounding on the rotation. Args: posX, posY, ++ * posZ, yaw, pitch ++ */ ++ public void setPositionAndRotation2(double par1, double par3, double par5, float par7, float par8, int par9) { ++ this.minecartX = par1; ++ this.minecartY = par3; ++ this.minecartZ = par5; ++ this.minecartYaw = (double)par7; ++ this.minecartPitch = (double)par8; ++ this.turnProgress = par9 + 2; + this.motionX = this.velocityX; + this.motionY = this.velocityY; + this.motionZ = this.velocityZ; + } + +- public void setVelocity(double var1, double var3, double var5) { +- this.velocityX = this.motionX = var1; +- this.velocityY = this.motionY = var3; +- this.velocityZ = this.motionZ = var5; +- } +- +- public void setDamage(float var1) { +- this.dataWatcher.updateObject(19, Float.valueOf(var1)); +- } +- ++ /** ++ * Sets the velocity to the args. Args: x, y, z ++ */ ++ public void setVelocity(double par1, double par3, double par5) { ++ this.velocityX = this.motionX = par1; ++ this.velocityY = this.motionY = par3; ++ this.velocityZ = this.motionZ = par5; ++ } ++ ++ /** ++ * Sets the current amount of damage the minecart has taken. Decreases over time. The cart breaks when this is over 40. ++ */ ++ public void setDamage(float par1) { ++ this.dataWatcher.updateObject(19, Float.valueOf(par1)); ++ } ++ ++ /** ++ * Gets the current amount of damage the minecart has taken. Decreases over time. The cart breaks when this is over 40. ++ */ + public float getDamage() { + return this.dataWatcher.getWatchableObjectFloat(19); + } + +- public void setRollingAmplitude(int var1) { +- this.dataWatcher.updateObject(17, Integer.valueOf(var1)); ++ /** ++ * Sets the rolling amplitude the cart rolls while being attacked. ++ */ ++ public void setRollingAmplitude(int par1) { ++ this.dataWatcher.updateObject(17, Integer.valueOf(par1)); + } + ++ /** ++ * Gets the rolling amplitude the cart rolls while being attacked. ++ */ + public int getRollingAmplitude() { + return this.dataWatcher.getWatchableObjectInt(17); + } + +- public void setRollingDirection(int var1) { +- this.dataWatcher.updateObject(18, Integer.valueOf(var1)); ++ /** ++ * Sets the rolling direction the cart rolls while being attacked. Can be 1 or -1. ++ */ ++ public void setRollingDirection(int par1) { ++ this.dataWatcher.updateObject(18, Integer.valueOf(par1)); + } + ++ /** ++ * Gets the rolling direction the cart rolls while being attacked. Can be 1 or -1. ++ */ + public int getRollingDirection() { + return this.dataWatcher.getWatchableObjectInt(18); + } +@@ -752,10 +870,10 @@ + public abstract int getMinecartType(); + + public Block getDisplayTile() { +- if(!this.hasDisplayTile()) { ++ if (!this.hasDisplayTile()) { + return this.getDefaultDisplayTile(); + } else { +- int var1 = this.getDataWatcher().getWatchableObjectInt(20) & '\uffff'; ++ int var1 = this.getDataWatcher().getWatchableObjectInt(20) & 65535; + return var1 > 0 && var1 < Block.blocksList.length ? Block.blocksList[var1] : null; + } + } +@@ -780,20 +898,20 @@ + return 6; + } + +- public void setDisplayTile(int var1) { +- this.getDataWatcher().updateObject(20, Integer.valueOf(var1 & '\uffff' | this.getDisplayTileData() << 16)); ++ public void setDisplayTile(int par1) { ++ this.getDataWatcher().updateObject(20, Integer.valueOf(par1 & 65535 | this.getDisplayTileData() << 16)); + this.setHasDisplayTile(true); + } + +- public void setDisplayTileData(int var1) { ++ public void setDisplayTileData(int par1) { + Block var2 = this.getDisplayTile(); + int var3 = var2 == null ? 0 : var2.blockID; +- this.getDataWatcher().updateObject(20, Integer.valueOf(var3 & '\uffff' | var1 << 16)); ++ this.getDataWatcher().updateObject(20, Integer.valueOf(var3 & 65535 | par1 << 16)); + this.setHasDisplayTile(true); + } + +- public void setDisplayTileOffset(int var1) { +- this.getDataWatcher().updateObject(21, Integer.valueOf(var1)); ++ public void setDisplayTileOffset(int par1) { ++ this.getDataWatcher().updateObject(21, Integer.valueOf(par1)); + this.setHasDisplayTile(true); + } + +@@ -801,23 +919,33 @@ + return this.getDataWatcher().getWatchableObjectByte(22) == 1; + } + +- public void setHasDisplayTile(boolean var1) { +- this.getDataWatcher().updateObject(22, Byte.valueOf((byte)(var1 ? 1 : 0))); +- } +- +- public void setMinecartName(String var1) { +- this.c = var1; +- } +- ++ public void setHasDisplayTile(boolean par1) { ++ this.getDataWatcher().updateObject(22, Byte.valueOf((byte)(par1 ? 1 : 0))); ++ } ++ ++ /** ++ * Sets the minecart's name. ++ */ ++ public void setMinecartName(String par1Str) { ++ this.entityName = par1Str; ++ } ++ ++ /** ++ * Gets the username of the entity. ++ */ + public String getEntityName() { +- return this.c != null ? this.c : super.getEntityName(); ++ return this.entityName != null ? this.entityName : super.getEntityName(); + } + ++ /** ++ * If this returns false, the inventory name will be used as an unlocalized name, and translated into the player's ++ * language. Otherwise it will be used directly. ++ */ + public boolean isInvNameLocalized() { +- return this.c != null; ++ return this.entityName != null; + } + + public String func_95999_t() { +- return this.c; ++ return this.entityName; + } + } diff --git a/patches/net/minecraft/src/EntityMinecartChest.java.patch b/patches/net/minecraft/src/EntityMinecartChest.java.patch new file mode 100644 index 0000000..619b31c --- /dev/null +++ b/patches/net/minecraft/src/EntityMinecartChest.java.patch @@ -0,0 +1,35 @@ +--- net/minecraft/src/EntityMinecartChest.java ++++ net/minecraft/src/EntityMinecartChest.java +@@ -1,19 +1,22 @@ + package net.minecraft.src; + + public class EntityMinecartChest extends EntityMinecartContainer { +- public EntityMinecartChest(World var1) { +- super(var1); +- } +- +- public EntityMinecartChest(World var1, double var2, double var4, double var6) { +- super(var1, var2, var4, var6); +- } +- +- public void killMinecart(DamageSource var1) { +- super.killMinecart(var1); ++ public EntityMinecartChest(World par1World) { ++ super(par1World); ++ } ++ ++ public EntityMinecartChest(World par1World, double par2, double par4, double par6) { ++ super(par1World, par2, par4, par6); ++ } ++ ++ public void killMinecart(DamageSource par1DamageSource) { ++ super.killMinecart(par1DamageSource); + this.dropItemWithOffset(Block.chest.blockID, 1, 0.0F); + } + ++ /** ++ * Returns the number of slots in the inventory. ++ */ + public int getSizeInventory() { + return 27; + } diff --git a/patches/net/minecraft/src/EntityMinecartContainer.java.patch b/patches/net/minecraft/src/EntityMinecartContainer.java.patch new file mode 100644 index 0000000..7bc2d43 --- /dev/null +++ b/patches/net/minecraft/src/EntityMinecartContainer.java.patch @@ -0,0 +1,330 @@ +--- net/minecraft/src/EntityMinecartContainer.java ++++ net/minecraft/src/EntityMinecartContainer.java +@@ -2,60 +2,75 @@ + + public abstract class EntityMinecartContainer extends EntityMinecart implements IInventory { + private ItemStack[] minecartContainerItems = new ItemStack[36]; ++ ++ /** ++ * When set to true, the minecart will drop all items when setDead() is called. When false (such as when travelling ++ * dimensions) it preserves its contents. ++ */ + private boolean dropContentsWhenDead = true; + +- public EntityMinecartContainer(World var1) { +- super(var1); +- } +- +- public EntityMinecartContainer(World var1, double var2, double var4, double var6) { +- super(var1, var2, var4, var6); +- } +- +- public void killMinecart(DamageSource var1) { +- super.killMinecart(var1); +- +- for(int var2 = 0; var2 < this.getSizeInventory(); ++var2) { ++ public EntityMinecartContainer(World par1World) { ++ super(par1World); ++ } ++ ++ public EntityMinecartContainer(World par1World, double par2, double par4, double par6) { ++ super(par1World, par2, par4, par6); ++ } ++ ++ public void killMinecart(DamageSource par1DamageSource) { ++ super.killMinecart(par1DamageSource); ++ ++ for (int var2 = 0; var2 < this.getSizeInventory(); ++var2) { + ItemStack var3 = this.getStackInSlot(var2); +- if(var3 != null) { +- float var4 = this.ab.nextFloat() * 0.8F + 0.1F; +- float var5 = this.ab.nextFloat() * 0.8F + 0.1F; +- float var6 = this.ab.nextFloat() * 0.8F + 0.1F; +- +- while(var3.stackSize > 0) { +- int var7 = this.ab.nextInt(21) + 10; +- if(var7 > var3.stackSize) { ++ ++ if (var3 != null) { ++ float var4 = this.rand.nextFloat() * 0.8F + 0.1F; ++ float var5 = this.rand.nextFloat() * 0.8F + 0.1F; ++ float var6 = this.rand.nextFloat() * 0.8F + 0.1F; ++ ++ while (var3.stackSize > 0) { ++ int var7 = this.rand.nextInt(21) + 10; ++ ++ if (var7 > var3.stackSize) { + var7 = var3.stackSize; + } + + var3.stackSize -= var7; + EntityItem var8 = new EntityItem(this.worldObj, this.posX + (double)var4, this.posY + (double)var5, this.posZ + (double)var6, new ItemStack(var3.itemID, var7, var3.getItemDamage())); + float var9 = 0.05F; +- var8.motionX = (double)((float)this.ab.nextGaussian() * var9); +- var8.motionY = (double)((float)this.ab.nextGaussian() * var9 + 0.2F); +- var8.motionZ = (double)((float)this.ab.nextGaussian() * var9); ++ var8.motionX = (double)((float)this.rand.nextGaussian() * var9); ++ var8.motionY = (double)((float)this.rand.nextGaussian() * var9 + 0.2F); ++ var8.motionZ = (double)((float)this.rand.nextGaussian() * var9); + this.worldObj.spawnEntityInWorld(var8); + } + } + } +- +- } +- +- public ItemStack getStackInSlot(int var1) { +- return this.minecartContainerItems[var1]; +- } +- +- public ItemStack decrStackSize(int var1, int var2) { +- if(this.minecartContainerItems[var1] != null) { ++ } ++ ++ /** ++ * Returns the stack in slot i ++ */ ++ public ItemStack getStackInSlot(int par1) { ++ return this.minecartContainerItems[par1]; ++ } ++ ++ /** ++ * Removes from an inventory slot (first arg) up to a specified number (second arg) of items and returns them in a new ++ * stack. ++ */ ++ public ItemStack decrStackSize(int par1, int par2) { ++ if (this.minecartContainerItems[par1] != null) { + ItemStack var3; +- if(this.minecartContainerItems[var1].stackSize <= var2) { +- var3 = this.minecartContainerItems[var1]; +- this.minecartContainerItems[var1] = null; ++ ++ if (this.minecartContainerItems[par1].stackSize <= par2) { ++ var3 = this.minecartContainerItems[par1]; ++ this.minecartContainerItems[par1] = null; + return var3; + } else { +- var3 = this.minecartContainerItems[var1].splitStack(var2); +- if(this.minecartContainerItems[var1].stackSize == 0) { +- this.minecartContainerItems[var1] = null; ++ var3 = this.minecartContainerItems[par1].splitStack(par2); ++ ++ if (this.minecartContainerItems[par1].stackSize == 0) { ++ this.minecartContainerItems[par1] = null; + } + + return var3; +@@ -65,79 +80,108 @@ + } + } + +- public ItemStack getStackInSlotOnClosing(int var1) { +- if(this.minecartContainerItems[var1] != null) { +- ItemStack var2 = this.minecartContainerItems[var1]; +- this.minecartContainerItems[var1] = null; ++ /** ++ * When some containers are closed they call this on each slot, then drop whatever it returns as an EntityItem - like ++ * when you close a workbench GUI. ++ */ ++ public ItemStack getStackInSlotOnClosing(int par1) { ++ if (this.minecartContainerItems[par1] != null) { ++ ItemStack var2 = this.minecartContainerItems[par1]; ++ this.minecartContainerItems[par1] = null; + return var2; + } else { + return null; + } + } + +- public void setInventorySlotContents(int var1, ItemStack var2) { +- this.minecartContainerItems[var1] = var2; +- if(var2 != null && var2.stackSize > this.getInventoryStackLimit()) { +- var2.stackSize = this.getInventoryStackLimit(); ++ /** ++ * Sets the given item stack to the specified slot in the inventory (can be crafting or armor sections). ++ */ ++ public void setInventorySlotContents(int par1, ItemStack par2ItemStack) { ++ this.minecartContainerItems[par1] = par2ItemStack; ++ ++ if (par2ItemStack != null && par2ItemStack.stackSize > this.getInventoryStackLimit()) { ++ par2ItemStack.stackSize = this.getInventoryStackLimit(); + } +- +- } +- +- public void onInventoryChanged() { +- } +- +- public boolean isUseableByPlayer(EntityPlayer var1) { +- return this.isDead ? false : var1.getDistanceSqToEntity(this) <= 64.0D; +- } +- +- public void openChest() { +- } +- +- public void closeChest() { +- } +- +- public boolean isItemValidForSlot(int var1, ItemStack var2) { ++ } ++ ++ /** ++ * Called when an the contents of an Inventory change, usually ++ */ ++ public void onInventoryChanged() {} ++ ++ /** ++ * Do not make give this method the name canInteractWith because it clashes with Container ++ */ ++ public boolean isUseableByPlayer(EntityPlayer par1EntityPlayer) { ++ return this.isDead ? false : par1EntityPlayer.getDistanceSqToEntity(this) <= 64.0D; ++ } ++ ++ public void openChest() {} ++ ++ public void closeChest() {} ++ ++ /** ++ * Returns true if automation is allowed to insert the given stack (ignoring stack size) into the given slot. ++ */ ++ public boolean isItemValidForSlot(int par1, ItemStack par2ItemStack) { + return true; + } + ++ /** ++ * Returns the name of the inventory. ++ */ + public String getInvName() { + return this.isInvNameLocalized() ? this.func_95999_t() : "container.minecart"; + } + ++ /** ++ * Returns the maximum stack size for a inventory slot. Seems to always be 64, possibly will be extended. *Isn't this ++ * more of a set than a get?* ++ */ + public int getInventoryStackLimit() { + return 64; + } + +- public void travelToDimension(int var1) { ++ /** ++ * Teleports the entity to another dimension. Params: Dimension number to teleport to ++ */ ++ public void travelToDimension(int par1) { + this.dropContentsWhenDead = false; +- super.travelToDimension(var1); ++ super.travelToDimension(par1); + } + ++ /** ++ * Will get destroyed next tick. ++ */ + public void setDead() { +- if(this.dropContentsWhenDead) { +- for(int var1 = 0; var1 < this.getSizeInventory(); ++var1) { ++ if (this.dropContentsWhenDead) { ++ for (int var1 = 0; var1 < this.getSizeInventory(); ++var1) { + ItemStack var2 = this.getStackInSlot(var1); +- if(var2 != null) { +- float var3 = this.ab.nextFloat() * 0.8F + 0.1F; +- float var4 = this.ab.nextFloat() * 0.8F + 0.1F; +- float var5 = this.ab.nextFloat() * 0.8F + 0.1F; +- +- while(var2.stackSize > 0) { +- int var6 = this.ab.nextInt(21) + 10; +- if(var6 > var2.stackSize) { ++ ++ if (var2 != null) { ++ float var3 = this.rand.nextFloat() * 0.8F + 0.1F; ++ float var4 = this.rand.nextFloat() * 0.8F + 0.1F; ++ float var5 = this.rand.nextFloat() * 0.8F + 0.1F; ++ ++ while (var2.stackSize > 0) { ++ int var6 = this.rand.nextInt(21) + 10; ++ ++ if (var6 > var2.stackSize) { + var6 = var2.stackSize; + } + + var2.stackSize -= var6; + EntityItem var7 = new EntityItem(this.worldObj, this.posX + (double)var3, this.posY + (double)var4, this.posZ + (double)var5, new ItemStack(var2.itemID, var6, var2.getItemDamage())); +- if(var2.hasTagCompound()) { ++ ++ if (var2.hasTagCompound()) { + var7.getEntityItem().setTagCompound((NBTTagCompound)var2.getTagCompound().copy()); + } + + float var8 = 0.05F; +- var7.motionX = (double)((float)this.ab.nextGaussian() * var8); +- var7.motionY = (double)((float)this.ab.nextGaussian() * var8 + 0.2F); +- var7.motionZ = (double)((float)this.ab.nextGaussian() * var8); ++ var7.motionX = (double)((float)this.rand.nextGaussian() * var8); ++ var7.motionY = (double)((float)this.rand.nextGaussian() * var8 + 0.2F); ++ var7.motionZ = (double)((float)this.rand.nextGaussian() * var8); + this.worldObj.spawnEntityInWorld(var7); + } + } +@@ -147,12 +191,15 @@ + super.setDead(); + } + +- protected void writeEntityToNBT(NBTTagCompound var1) { +- super.writeEntityToNBT(var1); ++ /** ++ * (abstract) Protected helper method to write subclass entity data to NBT. ++ */ ++ protected void writeEntityToNBT(NBTTagCompound par1NBTTagCompound) { ++ super.writeEntityToNBT(par1NBTTagCompound); + NBTTagList var2 = new NBTTagList(); + +- for(int var3 = 0; var3 < this.minecartContainerItems.length; ++var3) { +- if(this.minecartContainerItems[var3] != null) { ++ for (int var3 = 0; var3 < this.minecartContainerItems.length; ++var3) { ++ if (this.minecartContainerItems[var3] != null) { + NBTTagCompound var4 = new NBTTagCompound(); + var4.setByte("Slot", (byte)var3); + this.minecartContainerItems[var3].writeToNBT(var4); +@@ -160,27 +207,33 @@ + } + } + +- var1.setTag("Items", var2); ++ par1NBTTagCompound.setTag("Items", var2); + } + +- protected void readEntityFromNBT(NBTTagCompound var1) { +- super.readEntityFromNBT(var1); +- NBTTagList var2 = var1.getTagList("Items"); ++ /** ++ * (abstract) Protected helper method to read subclass entity data from NBT. ++ */ ++ protected void readEntityFromNBT(NBTTagCompound par1NBTTagCompound) { ++ super.readEntityFromNBT(par1NBTTagCompound); ++ NBTTagList var2 = par1NBTTagCompound.getTagList("Items"); + this.minecartContainerItems = new ItemStack[this.getSizeInventory()]; + +- for(int var3 = 0; var3 < var2.tagCount(); ++var3) { ++ for (int var3 = 0; var3 < var2.tagCount(); ++var3) { + NBTTagCompound var4 = (NBTTagCompound)var2.tagAt(var3); + int var5 = var4.getByte("Slot") & 255; +- if(var5 >= 0 && var5 < this.minecartContainerItems.length) { ++ ++ if (var5 >= 0 && var5 < this.minecartContainerItems.length) { + this.minecartContainerItems[var5] = ItemStack.loadItemStackFromNBT(var4); + } + } +- + } + +- public boolean interactFirst(EntityPlayer var1) { +- if(!this.worldObj.isRemote) { +- var1.displayGUIChest(this); ++ /** ++ * First layer of player interaction ++ */ ++ public boolean interactFirst(EntityPlayer par1EntityPlayer) { ++ if (!this.worldObj.isRemote) { ++ par1EntityPlayer.displayGUIChest(this); + } + + return true; diff --git a/patches/net/minecraft/src/EntityMinecartEmpty.java.patch b/patches/net/minecraft/src/EntityMinecartEmpty.java.patch new file mode 100644 index 0000000..38bac4c --- /dev/null +++ b/patches/net/minecraft/src/EntityMinecartEmpty.java.patch @@ -0,0 +1,41 @@ +--- net/minecraft/src/EntityMinecartEmpty.java ++++ net/minecraft/src/EntityMinecartEmpty.java +@@ -1,22 +1,25 @@ + package net.minecraft.src; + + public class EntityMinecartEmpty extends EntityMinecart { +- public EntityMinecartEmpty(World var1) { +- super(var1); +- } +- +- public EntityMinecartEmpty(World var1, double var2, double var4, double var6) { +- super(var1, var2, var4, var6); +- } +- +- public boolean interactFirst(EntityPlayer var1) { +- if(this.riddenByEntity != null && this.riddenByEntity instanceof EntityPlayer && this.riddenByEntity != var1) { ++ public EntityMinecartEmpty(World par1World) { ++ super(par1World); ++ } ++ ++ public EntityMinecartEmpty(World par1World, double par2, double par4, double par6) { ++ super(par1World, par2, par4, par6); ++ } ++ ++ /** ++ * First layer of player interaction ++ */ ++ public boolean interactFirst(EntityPlayer par1EntityPlayer) { ++ if (this.riddenByEntity != null && this.riddenByEntity instanceof EntityPlayer && this.riddenByEntity != par1EntityPlayer) { + return true; +- } else if(this.riddenByEntity != null && this.riddenByEntity != var1) { ++ } else if (this.riddenByEntity != null && this.riddenByEntity != par1EntityPlayer) { + return false; + } else { +- if(!this.worldObj.isRemote) { +- var1.mountEntity(this); ++ if (!this.worldObj.isRemote) { ++ par1EntityPlayer.mountEntity(this); + } + + return true; diff --git a/patches/net/minecraft/src/EntityMinecartFurnace.java.patch b/patches/net/minecraft/src/EntityMinecartFurnace.java.patch new file mode 100644 index 0000000..79cc717 --- /dev/null +++ b/patches/net/minecraft/src/EntityMinecartFurnace.java.patch @@ -0,0 +1,183 @@ +--- net/minecraft/src/EntityMinecartFurnace.java ++++ net/minecraft/src/EntityMinecartFurnace.java +@@ -5,12 +5,12 @@ + public double pushX; + public double pushZ; + +- public EntityMinecartFurnace(World var1) { +- super(var1); ++ public EntityMinecartFurnace(World par1World) { ++ super(par1World); + } + +- public EntityMinecartFurnace(World var1, double var2, double var4, double var6) { +- super(var1, var2, var4, var6); ++ public EntityMinecartFurnace(World par1World, double par2, double par4, double par6) { ++ super(par1World, par2, par4, par6); + } + + public int getMinecartType() { +@@ -22,39 +22,45 @@ + this.dataWatcher.addObject(16, new Byte((byte)0)); + } + ++ /** ++ * Called to update the entity's position/logic. ++ */ + public void onUpdate() { + super.onUpdate(); +- if(this.fuel > 0) { ++ ++ if (this.fuel > 0) { + --this.fuel; + } + +- if(this.fuel <= 0) { ++ if (this.fuel <= 0) { + this.pushX = this.pushZ = 0.0D; + } + + this.setMinecartPowered(this.fuel > 0); +- if(this.isMinecartPowered() && this.ab.nextInt(4) == 0) { ++ ++ if (this.isMinecartPowered() && this.rand.nextInt(4) == 0) { + this.worldObj.spawnParticle("largesmoke", this.posX, this.posY + 0.8D, this.posZ, 0.0D, 0.0D, 0.0D); + } +- + } + +- public void killMinecart(DamageSource var1) { +- super.killMinecart(var1); +- if(!var1.isExplosion()) { ++ public void killMinecart(DamageSource par1DamageSource) { ++ super.killMinecart(par1DamageSource); ++ ++ if (!par1DamageSource.isExplosion()) { + this.entityDropItem(new ItemStack(Block.furnaceIdle, 1), 0.0F); + } +- + } + +- protected void updateOnTrack(int var1, int var2, int var3, double var4, double var6, int var8, int var9) { +- super.updateOnTrack(var1, var2, var3, var4, var6, var8, var9); ++ protected void updateOnTrack(int par1, int par2, int par3, double par4, double par6, int par8, int par9) { ++ super.updateOnTrack(par1, par2, par3, par4, par6, par8, par9); + double var10 = this.pushX * this.pushX + this.pushZ * this.pushZ; +- if(var10 > 1.0E-4D && this.motionX * this.motionX + this.motionZ * this.motionZ > 0.001D) { ++ ++ if (var10 > 1.0E-4D && this.motionX * this.motionX + this.motionZ * this.motionZ > 0.001D) { + var10 = (double)MathHelper.sqrt_double(var10); + this.pushX /= var10; + this.pushZ /= var10; +- if(this.pushX * this.motionX + this.pushZ * this.motionZ < 0.0D) { ++ ++ if (this.pushX * this.motionX + this.pushZ * this.motionZ < 0.0D) { + this.pushX = 0.0D; + this.pushZ = 0.0D; + } else { +@@ -62,70 +68,79 @@ + this.pushZ = this.motionZ; + } + } +- + } + + protected void applyDrag() { + double var1 = this.pushX * this.pushX + this.pushZ * this.pushZ; +- if(var1 > 1.0E-4D) { ++ ++ if (var1 > 1.0E-4D) { + var1 = (double)MathHelper.sqrt_double(var1); + this.pushX /= var1; + this.pushZ /= var1; + double var3 = 0.05D; +- this.motionX *= (double)0.8F; ++ this.motionX *= 0.800000011920929D; + this.motionY *= 0.0D; +- this.motionZ *= (double)0.8F; ++ this.motionZ *= 0.800000011920929D; + this.motionX += this.pushX * var3; + this.motionZ += this.pushZ * var3; + } else { +- this.motionX *= (double)0.98F; ++ this.motionX *= 0.9800000190734863D; + this.motionY *= 0.0D; +- this.motionZ *= (double)0.98F; ++ this.motionZ *= 0.9800000190734863D; + } + + super.applyDrag(); + } + +- public boolean interactFirst(EntityPlayer var1) { +- ItemStack var2 = var1.inventory.getCurrentItem(); +- if(var2 != null && var2.itemID == Item.coal.itemID) { +- if(!var1.capabilities.isCreativeMode && --var2.stackSize == 0) { +- var1.inventory.setInventorySlotContents(var1.inventory.currentItem, (ItemStack)null); ++ /** ++ * First layer of player interaction ++ */ ++ public boolean interactFirst(EntityPlayer par1EntityPlayer) { ++ ItemStack var2 = par1EntityPlayer.inventory.getCurrentItem(); ++ ++ if (var2 != null && var2.itemID == Item.coal.itemID) { ++ if (!par1EntityPlayer.capabilities.isCreativeMode && --var2.stackSize == 0) { ++ par1EntityPlayer.inventory.setInventorySlotContents(par1EntityPlayer.inventory.currentItem, (ItemStack)null); + } + + this.fuel += 3600; + } + +- this.pushX = this.posX - var1.posX; +- this.pushZ = this.posZ - var1.posZ; ++ this.pushX = this.posX - par1EntityPlayer.posX; ++ this.pushZ = this.posZ - par1EntityPlayer.posZ; + return true; + } + +- protected void writeEntityToNBT(NBTTagCompound var1) { +- super.writeEntityToNBT(var1); +- var1.setDouble("PushX", this.pushX); +- var1.setDouble("PushZ", this.pushZ); +- var1.setShort("Fuel", (short)this.fuel); ++ /** ++ * (abstract) Protected helper method to write subclass entity data to NBT. ++ */ ++ protected void writeEntityToNBT(NBTTagCompound par1NBTTagCompound) { ++ super.writeEntityToNBT(par1NBTTagCompound); ++ par1NBTTagCompound.setDouble("PushX", this.pushX); ++ par1NBTTagCompound.setDouble("PushZ", this.pushZ); ++ par1NBTTagCompound.setShort("Fuel", (short)this.fuel); + } + +- protected void readEntityFromNBT(NBTTagCompound var1) { +- super.readEntityFromNBT(var1); +- this.pushX = var1.getDouble("PushX"); +- this.pushZ = var1.getDouble("PushZ"); +- this.fuel = var1.getShort("Fuel"); ++ /** ++ * (abstract) Protected helper method to read subclass entity data from NBT. ++ */ ++ protected void readEntityFromNBT(NBTTagCompound par1NBTTagCompound) { ++ super.readEntityFromNBT(par1NBTTagCompound); ++ this.pushX = par1NBTTagCompound.getDouble("PushX"); ++ this.pushZ = par1NBTTagCompound.getDouble("PushZ"); ++ this.fuel = par1NBTTagCompound.getShort("Fuel"); + } + + protected boolean isMinecartPowered() { + return (this.dataWatcher.getWatchableObjectByte(16) & 1) != 0; + } + +- protected void setMinecartPowered(boolean var1) { +- if(var1) { ++ protected void setMinecartPowered(boolean par1) { ++ if (par1) { + this.dataWatcher.updateObject(16, Byte.valueOf((byte)(this.dataWatcher.getWatchableObjectByte(16) | 1))); + } else { + this.dataWatcher.updateObject(16, Byte.valueOf((byte)(this.dataWatcher.getWatchableObjectByte(16) & -2))); + } +- + } + + public Block getDefaultDisplayTile() { diff --git a/patches/net/minecraft/src/EntityMinecartHopper.java.patch b/patches/net/minecraft/src/EntityMinecartHopper.java.patch new file mode 100644 index 0000000..cd08a7e --- /dev/null +++ b/patches/net/minecraft/src/EntityMinecartHopper.java.patch @@ -0,0 +1,198 @@ +--- net/minecraft/src/EntityMinecartHopper.java ++++ net/minecraft/src/EntityMinecartHopper.java +@@ -3,15 +3,17 @@ + import java.util.List; + + public class EntityMinecartHopper extends EntityMinecartContainer implements Hopper { ++ ++ /** Whether this hopper minecart is being blocked by an activator rail. */ + private boolean isBlocked = true; + private int transferTicker = -1; + +- public EntityMinecartHopper(World var1) { +- super(var1); ++ public EntityMinecartHopper(World par1World) { ++ super(par1World); + } + +- public EntityMinecartHopper(World var1, double var2, double var4, double var6) { +- super(var1, var2, var4, var6); ++ public EntityMinecartHopper(World par1World, double par2, double par4, double par6) { ++ super(par1World, par2, par4, par6); + } + + public int getMinecartType() { +@@ -26,71 +28,104 @@ + return 1; + } + ++ /** ++ * Returns the number of slots in the inventory. ++ */ + public int getSizeInventory() { + return 5; + } + +- public boolean interactFirst(EntityPlayer var1) { +- if(!this.worldObj.isRemote) { +- var1.displayGUIHopperMinecart(this); ++ /** ++ * First layer of player interaction ++ */ ++ public boolean interactFirst(EntityPlayer par1EntityPlayer) { ++ if (!this.worldObj.isRemote) { ++ par1EntityPlayer.displayGUIHopperMinecart(this); + } + + return true; + } + +- public void onActivatorRailPass(int var1, int var2, int var3, boolean var4) { +- boolean var5 = !var4; +- if(var5 != this.getBlocked()) { ++ /** ++ * Called every tick the minecart is on an activator rail. ++ */ ++ public void onActivatorRailPass(int par1, int par2, int par3, boolean par4) { ++ boolean var5 = !par4; ++ ++ if (var5 != this.getBlocked()) { + this.setBlocked(var5); + } +- + } + ++ /** ++ * Get whether this hopper minecart is being blocked by an activator rail. ++ */ + public boolean getBlocked() { + return this.isBlocked; + } + +- public void setBlocked(boolean var1) { +- this.isBlocked = var1; ++ /** ++ * Set whether this hopper minecart is being blocked by an activator rail. ++ */ ++ public void setBlocked(boolean par1) { ++ this.isBlocked = par1; + } + ++ /** ++ * Returns the worldObj for this tileEntity. ++ */ + public World getWorldObj() { + return this.worldObj; + } + ++ /** ++ * Gets the world X position for this hopper entity. ++ */ + public double getXPos() { + return this.posX; + } + ++ /** ++ * Gets the world Y position for this hopper entity. ++ */ + public double getYPos() { + return this.posY; + } + ++ /** ++ * Gets the world Z position for this hopper entity. ++ */ + public double getZPos() { + return this.posZ; + } + ++ /** ++ * Called to update the entity's position/logic. ++ */ + public void onUpdate() { + super.onUpdate(); +- if(!this.worldObj.isRemote && this.isEntityAlive() && this.getBlocked()) { ++ ++ if (!this.worldObj.isRemote && this.isEntityAlive() && this.getBlocked()) { + --this.transferTicker; +- if(!this.canTransfer()) { ++ ++ if (!this.canTransfer()) { + this.setTransferTicker(0); +- if(this.func_96112_aD()) { ++ ++ if (this.func_96112_aD()) { + this.setTransferTicker(4); + this.onInventoryChanged(); + } + } + } +- + } + + public boolean func_96112_aD() { +- if(TileEntityHopper.suckItemsIntoHopper(this)) { ++ if (TileEntityHopper.suckItemsIntoHopper(this)) { + return true; + } else { + List var1 = this.worldObj.selectEntitiesWithinAABB(EntityItem.class, this.boundingBox.expand(0.25D, 0.0D, 0.25D), IEntitySelector.selectAnything); +- if(var1.size() > 0) { ++ ++ if (var1.size() > 0) { + TileEntityHopper.insertStackFromEntity(this, (EntityItem)var1.get(0)); + } + +@@ -98,25 +133,37 @@ + } + } + +- public void killMinecart(DamageSource var1) { +- super.killMinecart(var1); ++ public void killMinecart(DamageSource par1DamageSource) { ++ super.killMinecart(par1DamageSource); + this.dropItemWithOffset(Block.hopperBlock.blockID, 1, 0.0F); + } + +- protected void writeEntityToNBT(NBTTagCompound var1) { +- super.writeEntityToNBT(var1); +- var1.setInteger("TransferCooldown", this.transferTicker); +- } +- +- protected void readEntityFromNBT(NBTTagCompound var1) { +- super.readEntityFromNBT(var1); +- this.transferTicker = var1.getInteger("TransferCooldown"); +- } +- +- public void setTransferTicker(int var1) { +- this.transferTicker = var1; +- } +- ++ /** ++ * (abstract) Protected helper method to write subclass entity data to NBT. ++ */ ++ protected void writeEntityToNBT(NBTTagCompound par1NBTTagCompound) { ++ super.writeEntityToNBT(par1NBTTagCompound); ++ par1NBTTagCompound.setInteger("TransferCooldown", this.transferTicker); ++ } ++ ++ /** ++ * (abstract) Protected helper method to read subclass entity data from NBT. ++ */ ++ protected void readEntityFromNBT(NBTTagCompound par1NBTTagCompound) { ++ super.readEntityFromNBT(par1NBTTagCompound); ++ this.transferTicker = par1NBTTagCompound.getInteger("TransferCooldown"); ++ } ++ ++ /** ++ * Sets the transfer ticker, used to determine the delay between transfers. ++ */ ++ public void setTransferTicker(int par1) { ++ this.transferTicker = par1; ++ } ++ ++ /** ++ * Returns whether the hopper cart can currently transfer an item. ++ */ + public boolean canTransfer() { + return this.transferTicker > 0; + } diff --git a/patches/net/minecraft/src/EntityMinecartMobSpawner.java.patch b/patches/net/minecraft/src/EntityMinecartMobSpawner.java.patch new file mode 100644 index 0000000..5060a4c --- /dev/null +++ b/patches/net/minecraft/src/EntityMinecartMobSpawner.java.patch @@ -0,0 +1,67 @@ +--- net/minecraft/src/EntityMinecartMobSpawner.java ++++ net/minecraft/src/EntityMinecartMobSpawner.java +@@ -1,14 +1,16 @@ + package net.minecraft.src; + + public class EntityMinecartMobSpawner extends EntityMinecart { ++ ++ /** Mob spawner logic for this spawner minecart. */ + private final MobSpawnerBaseLogic mobSpawnerLogic = new EntityMinecartMobSpawnerLogic(this); + +- public EntityMinecartMobSpawner(World var1) { +- super(var1); ++ public EntityMinecartMobSpawner(World par1World) { ++ super(par1World); + } + +- public EntityMinecartMobSpawner(World var1, double var2, double var4, double var6) { +- super(var1, var2, var4, var6); ++ public EntityMinecartMobSpawner(World par1World, double par2, double par4, double par6) { ++ super(par1World, par2, par4, par6); + } + + public int getMinecartType() { +@@ -19,20 +21,29 @@ + return Block.mobSpawner; + } + +- protected void readEntityFromNBT(NBTTagCompound var1) { +- super.readEntityFromNBT(var1); +- this.mobSpawnerLogic.readFromNBT(var1); +- } +- +- protected void writeEntityToNBT(NBTTagCompound var1) { +- super.writeEntityToNBT(var1); +- this.mobSpawnerLogic.writeToNBT(var1); +- } +- +- public void handleHealthUpdate(byte var1) { +- this.mobSpawnerLogic.setDelayToMin(var1); +- } +- ++ /** ++ * (abstract) Protected helper method to read subclass entity data from NBT. ++ */ ++ protected void readEntityFromNBT(NBTTagCompound par1NBTTagCompound) { ++ super.readEntityFromNBT(par1NBTTagCompound); ++ this.mobSpawnerLogic.readFromNBT(par1NBTTagCompound); ++ } ++ ++ /** ++ * (abstract) Protected helper method to write subclass entity data to NBT. ++ */ ++ protected void writeEntityToNBT(NBTTagCompound par1NBTTagCompound) { ++ super.writeEntityToNBT(par1NBTTagCompound); ++ this.mobSpawnerLogic.writeToNBT(par1NBTTagCompound); ++ } ++ ++ public void handleHealthUpdate(byte par1) { ++ this.mobSpawnerLogic.setDelayToMin(par1); ++ } ++ ++ /** ++ * Called to update the entity's position/logic. ++ */ + public void onUpdate() { + super.onUpdate(); + this.mobSpawnerLogic.updateSpawner(); diff --git a/patches/net/minecraft/src/EntityMinecartMobSpawnerLogic.java.patch b/patches/net/minecraft/src/EntityMinecartMobSpawnerLogic.java.patch new file mode 100644 index 0000000..650e24f --- /dev/null +++ b/patches/net/minecraft/src/EntityMinecartMobSpawnerLogic.java.patch @@ -0,0 +1,23 @@ +--- net/minecraft/src/EntityMinecartMobSpawnerLogic.java ++++ net/minecraft/src/EntityMinecartMobSpawnerLogic.java +@@ -1,14 +1,16 @@ + package net.minecraft.src; + + class EntityMinecartMobSpawnerLogic extends MobSpawnerBaseLogic { ++ ++ /** The spawner minecart using this mob spawner logic. */ + final EntityMinecartMobSpawner spawnerMinecart; + +- EntityMinecartMobSpawnerLogic(EntityMinecartMobSpawner var1) { +- this.spawnerMinecart = var1; ++ EntityMinecartMobSpawnerLogic(EntityMinecartMobSpawner par1EntityMinecartMobSpawner) { ++ this.spawnerMinecart = par1EntityMinecartMobSpawner; + } + +- public void func_98267_a(int var1) { +- this.spawnerMinecart.worldObj.setEntityState(this.spawnerMinecart, (byte)var1); ++ public void func_98267_a(int par1) { ++ this.spawnerMinecart.worldObj.setEntityState(this.spawnerMinecart, (byte)par1); + } + + public World getSpawnerWorld() { diff --git a/patches/net/minecraft/src/EntityMinecartTNT.java.patch b/patches/net/minecraft/src/EntityMinecartTNT.java.patch new file mode 100644 index 0000000..e4efe15 --- /dev/null +++ b/patches/net/minecraft/src/EntityMinecartTNT.java.patch @@ -0,0 +1,202 @@ +--- net/minecraft/src/EntityMinecartTNT.java ++++ net/minecraft/src/EntityMinecartTNT.java +@@ -3,12 +3,12 @@ + public class EntityMinecartTNT extends EntityMinecart { + private int minecartTNTFuse = -1; + +- public EntityMinecartTNT(World var1) { +- super(var1); ++ public EntityMinecartTNT(World par1World) { ++ super(par1World); + } + +- public EntityMinecartTNT(World var1, double var2, double var4, double var6) { +- super(var1, var2, var4, var6); ++ public EntityMinecartTNT(World par1World, double par2, double par4, double par6) { ++ super(par1World, par2, par4, par6); + } + + public int getMinecartType() { +@@ -19,110 +19,137 @@ + return Block.tnt; + } + ++ /** ++ * Called to update the entity's position/logic. ++ */ + public void onUpdate() { + super.onUpdate(); +- if(this.minecartTNTFuse > 0) { ++ ++ if (this.minecartTNTFuse > 0) { + --this.minecartTNTFuse; + this.worldObj.spawnParticle("smoke", this.posX, this.posY + 0.5D, this.posZ, 0.0D, 0.0D, 0.0D); +- } else if(this.minecartTNTFuse == 0) { ++ } else if (this.minecartTNTFuse == 0) { + this.explodeCart(this.motionX * this.motionX + this.motionZ * this.motionZ); + } + +- if(this.isCollidedHorizontally) { ++ if (this.isCollidedHorizontally) { + double var1 = this.motionX * this.motionX + this.motionZ * this.motionZ; +- if(var1 >= (double)0.01F) { ++ ++ if (var1 >= 0.009999999776482582D) { + this.explodeCart(var1); + } + } +- + } + +- public void killMinecart(DamageSource var1) { +- super.killMinecart(var1); ++ public void killMinecart(DamageSource par1DamageSource) { ++ super.killMinecart(par1DamageSource); + double var2 = this.motionX * this.motionX + this.motionZ * this.motionZ; +- if(!var1.isExplosion()) { ++ ++ if (!par1DamageSource.isExplosion()) { + this.entityDropItem(new ItemStack(Block.tnt, 1), 0.0F); + } + +- if(var1.isFireDamage() || var1.isExplosion() || var2 >= (double)0.01F) { ++ if (par1DamageSource.isFireDamage() || par1DamageSource.isExplosion() || var2 >= 0.009999999776482582D) { + this.explodeCart(var2); + } +- + } + +- protected void explodeCart(double var1) { +- if(!this.worldObj.isRemote) { +- double var3 = Math.sqrt(var1); +- if(var3 > 5.0D) { ++ /** ++ * Makes the minecart explode. ++ */ ++ protected void explodeCart(double par1) { ++ if (!this.worldObj.isRemote) { ++ double var3 = Math.sqrt(par1); ++ ++ if (var3 > 5.0D) { + var3 = 5.0D; + } + +- this.worldObj.createExplosion(this, this.posX, this.posY, this.posZ, (float)(4.0D + this.ab.nextDouble() * 1.5D * var3), true); ++ this.worldObj.createExplosion(this, this.posX, this.posY, this.posZ, (float)(4.0D + this.rand.nextDouble() * 1.5D * var3), true); + this.setDead(); + } +- + } + +- protected void fall(float var1) { +- if(var1 >= 3.0F) { +- float var2 = var1 / 10.0F; ++ /** ++ * Called when the mob is falling. Calculates and applies fall damage. ++ */ ++ protected void fall(float par1) { ++ if (par1 >= 3.0F) { ++ float var2 = par1 / 10.0F; + this.explodeCart((double)(var2 * var2)); + } + +- super.fall(var1); ++ super.fall(par1); + } + +- public void onActivatorRailPass(int var1, int var2, int var3, boolean var4) { +- if(var4 && this.minecartTNTFuse < 0) { ++ /** ++ * Called every tick the minecart is on an activator rail. ++ */ ++ public void onActivatorRailPass(int par1, int par2, int par3, boolean par4) { ++ if (par4 && this.minecartTNTFuse < 0) { + this.ignite(); + } +- + } + +- public void handleHealthUpdate(byte var1) { +- if(var1 == 10) { ++ public void handleHealthUpdate(byte par1) { ++ if (par1 == 10) { + this.ignite(); + } else { +- super.handleHealthUpdate(var1); ++ super.handleHealthUpdate(par1); + } +- + } + ++ /** ++ * Ignites this TNT cart. ++ */ + public void ignite() { + this.minecartTNTFuse = 80; +- if(!this.worldObj.isRemote) { ++ ++ if (!this.worldObj.isRemote) { + this.worldObj.setEntityState(this, (byte)10); + this.worldObj.playSoundAtEntity(this, "random.fuse", 1.0F, 1.0F); + } +- + } + + public int func_94104_d() { + return this.minecartTNTFuse; + } + ++ /** ++ * Returns true if the TNT minecart is ignited. ++ */ + public boolean isIgnited() { + return this.minecartTNTFuse > -1; + } + +- public float getBlockExplosionResistance(Explosion var1, World var2, int var3, int var4, int var5, Block var6) { +- return !this.isIgnited() || !BlockRailBase.isRailBlock(var6.blockID) && !BlockRailBase.isRailBlockAt(var2, var3, var4 + 1, var5) ? super.getBlockExplosionResistance(var1, var2, var3, var4, var5, var6) : 0.0F; +- } +- +- public boolean shouldExplodeBlock(Explosion var1, World var2, int var3, int var4, int var5, int var6, float var7) { +- return !this.isIgnited() || !BlockRailBase.isRailBlock(var6) && !BlockRailBase.isRailBlockAt(var2, var3, var4 + 1, var5) ? super.shouldExplodeBlock(var1, var2, var3, var4, var5, var6, var7) : false; +- } +- +- protected void readEntityFromNBT(NBTTagCompound var1) { +- super.readEntityFromNBT(var1); +- if(var1.hasKey("TNTFuse")) { +- this.minecartTNTFuse = var1.getInteger("TNTFuse"); ++ /** ++ * Gets a block's resistance to this entity's explosion. Used to make rails immune to TNT minecarts' explosions and ++ * Wither skulls more destructive. ++ */ ++ public float getBlockExplosionResistance(Explosion par1Explosion, World par2World, int par3, int par4, int par5, Block par6Block) { ++ return this.isIgnited() && (BlockRailBase.isRailBlock(par6Block.blockID) || BlockRailBase.isRailBlockAt(par2World, par3, par4 + 1, par5)) ? 0.0F : super.getBlockExplosionResistance(par1Explosion, par2World, par3, par4, par5, par6Block); ++ } ++ ++ public boolean shouldExplodeBlock(Explosion par1Explosion, World par2World, int par3, int par4, int par5, int par6, float par7) { ++ return this.isIgnited() && (BlockRailBase.isRailBlock(par6) || BlockRailBase.isRailBlockAt(par2World, par3, par4 + 1, par5)) ? false : super.shouldExplodeBlock(par1Explosion, par2World, par3, par4, par5, par6, par7); ++ } ++ ++ /** ++ * (abstract) Protected helper method to read subclass entity data from NBT. ++ */ ++ protected void readEntityFromNBT(NBTTagCompound par1NBTTagCompound) { ++ super.readEntityFromNBT(par1NBTTagCompound); ++ ++ if (par1NBTTagCompound.hasKey("TNTFuse")) { ++ this.minecartTNTFuse = par1NBTTagCompound.getInteger("TNTFuse"); + } +- + } + +- protected void writeEntityToNBT(NBTTagCompound var1) { +- super.writeEntityToNBT(var1); +- var1.setInteger("TNTFuse", this.minecartTNTFuse); ++ /** ++ * (abstract) Protected helper method to write subclass entity data to NBT. ++ */ ++ protected void writeEntityToNBT(NBTTagCompound par1NBTTagCompound) { ++ super.writeEntityToNBT(par1NBTTagCompound); ++ par1NBTTagCompound.setInteger("TNTFuse", this.minecartTNTFuse); + } + } diff --git a/patches/net/minecraft/src/EntityMob.java.patch b/patches/net/minecraft/src/EntityMob.java.patch new file mode 100644 index 0000000..17091e5 --- /dev/null +++ b/patches/net/minecraft/src/EntityMob.java.patch @@ -0,0 +1,180 @@ +--- net/minecraft/src/EntityMob.java ++++ net/minecraft/src/EntityMob.java +@@ -1,41 +1,57 @@ + package net.minecraft.src; + + public abstract class EntityMob extends EntityCreature implements IMob { +- public EntityMob(World var1) { +- super(var1); ++ public EntityMob(World par1World) { ++ super(par1World); + this.experienceValue = 5; + } + ++ /** ++ * Called frequently so the entity can update its state every tick as required. For example, zombies and skeletons use ++ * this to react to sunlight and start to burn. ++ */ + public void onLivingUpdate() { + this.updateArmSwingProgress(); + float var1 = this.getBrightness(1.0F); +- if(var1 > 0.5F) { ++ ++ if (var1 > 0.5F) { + this.entityAge += 2; + } + + super.onLivingUpdate(); + } + ++ /** ++ * Called to update the entity's position/logic. ++ */ + public void onUpdate() { + super.onUpdate(); +- if(!this.worldObj.isRemote && this.worldObj.difficultySetting == 0) { ++ ++ if (!this.worldObj.isRemote && this.worldObj.difficultySetting == 0) { + this.setDead(); + } +- + } + ++ /** ++ * Finds the closest player within 16 blocks to attack, or null if this Entity isn't interested in attacking (Animals, ++ * Spiders at day, peaceful PigZombies). ++ */ + protected Entity findPlayerToAttack() { + EntityPlayer var1 = this.worldObj.getClosestVulnerablePlayerToEntity(this, 16.0D); + return var1 != null && this.canEntityBeSeen(var1) ? var1 : null; + } + +- public boolean attackEntityFrom(DamageSource var1, float var2) { +- if(this.isEntityInvulnerable()) { ++ /** ++ * Called when the entity is attacked. ++ */ ++ public boolean attackEntityFrom(DamageSource par1DamageSource, float par2) { ++ if (this.isEntityInvulnerable()) { + return false; +- } else if(super.attackEntityFrom(var1, var2)) { +- Entity var3 = var1.getEntity(); +- if(this.riddenByEntity != var3 && this.ridingEntity != var3) { +- if(var3 != this) { ++ } else if (super.attackEntityFrom(par1DamageSource, par2)) { ++ Entity var3 = par1DamageSource.getEntity(); ++ ++ if (this.riddenByEntity != var3 && this.ridingEntity != var3) { ++ if (var3 != this) { + this.entityToAttack = var3; + } + +@@ -48,66 +64,83 @@ + } + } + +- public boolean attackEntityAsMob(Entity var1) { ++ public boolean attackEntityAsMob(Entity par1Entity) { + float var2 = (float)this.getEntityAttribute(SharedMonsterAttributes.attackDamage).getAttributeValue(); + int var3 = 0; +- if(var1 instanceof EntityLivingBase) { +- var2 += EnchantmentHelper.getEnchantmentModifierLiving(this, (EntityLivingBase)var1); +- var3 += EnchantmentHelper.getKnockbackModifier(this, (EntityLivingBase)var1); ++ ++ if (par1Entity instanceof EntityLivingBase) { ++ var2 += EnchantmentHelper.getEnchantmentModifierLiving(this, (EntityLivingBase)par1Entity); ++ var3 += EnchantmentHelper.getKnockbackModifier(this, (EntityLivingBase)par1Entity); + } + +- boolean var4 = var1.attackEntityFrom(DamageSource.causeMobDamage(this), var2); +- if(var4) { +- if(var3 > 0) { +- var1.addVelocity((double)(-MathHelper.sin(this.rotationYaw * (float)Math.PI / 180.0F) * (float)var3 * 0.5F), 0.1D, (double)(MathHelper.cos(this.rotationYaw * (float)Math.PI / 180.0F) * (float)var3 * 0.5F)); ++ boolean var4 = par1Entity.attackEntityFrom(DamageSource.causeMobDamage(this), var2); ++ ++ if (var4) { ++ if (var3 > 0) { ++ par1Entity.addVelocity((double)(-MathHelper.sin(this.rotationYaw * (float)Math.PI / 180.0F) * (float)var3 * 0.5F), 0.1D, (double)(MathHelper.cos(this.rotationYaw * (float)Math.PI / 180.0F) * (float)var3 * 0.5F)); + this.motionX *= 0.6D; + this.motionZ *= 0.6D; + } + + int var5 = EnchantmentHelper.getFireAspectModifier(this); +- if(var5 > 0) { +- var1.setFire(var5 * 4); ++ ++ if (var5 > 0) { ++ par1Entity.setFire(var5 * 4); + } + +- if(var1 instanceof EntityLivingBase) { +- EnchantmentThorns.func_92096_a(this, (EntityLivingBase)var1, this.ab); ++ if (par1Entity instanceof EntityLivingBase) { ++ EnchantmentThorns.func_92096_a(this, (EntityLivingBase)par1Entity, this.rand); + } + } + + return var4; + } + +- protected void attackEntity(Entity var1, float var2) { +- if(this.attackTime <= 0 && var2 < 2.0F && var1.boundingBox.maxY > this.boundingBox.minY && var1.boundingBox.minY < this.boundingBox.maxY) { ++ /** ++ * Basic mob attack. Default to touch of death in EntityCreature. Overridden by each mob to define their attack. ++ */ ++ protected void attackEntity(Entity par1Entity, float par2) { ++ if (this.attackTime <= 0 && par2 < 2.0F && par1Entity.boundingBox.maxY > this.boundingBox.minY && par1Entity.boundingBox.minY < this.boundingBox.maxY) { + this.attackTime = 20; +- this.attackEntityAsMob(var1); ++ this.attackEntityAsMob(par1Entity); + } +- +- } +- +- public float getBlockPathWeight(int var1, int var2, int var3) { +- return 0.5F - this.worldObj.getLightBrightness(var1, var2, var3); +- } +- ++ } ++ ++ /** ++ * Takes a coordinate in and returns a weight to determine how likely this creature will try to path to the block. ++ * Args: x, y, z ++ */ ++ public float getBlockPathWeight(int par1, int par2, int par3) { ++ return 0.5F - this.worldObj.getLightBrightness(par1, par2, par3); ++ } ++ ++ /** ++ * Checks to make sure the light is not too bright where the mob is spawning ++ */ + protected boolean isValidLightLevel() { + int var1 = MathHelper.floor_double(this.posX); + int var2 = MathHelper.floor_double(this.boundingBox.minY); + int var3 = MathHelper.floor_double(this.posZ); +- if(this.worldObj.getSavedLightValue(EnumSkyBlock.Sky, var1, var2, var3) > this.ab.nextInt(32)) { ++ ++ if (this.worldObj.getSavedLightValue(EnumSkyBlock.Sky, var1, var2, var3) > this.rand.nextInt(32)) { + return false; + } else { + int var4 = this.worldObj.getBlockLightValue(var1, var2, var3); +- if(this.worldObj.isThundering()) { ++ ++ if (this.worldObj.isThundering()) { + int var5 = this.worldObj.skylightSubtracted; + this.worldObj.skylightSubtracted = 10; + var4 = this.worldObj.getBlockLightValue(var1, var2, var3); + this.worldObj.skylightSubtracted = var5; + } + +- return var4 <= this.ab.nextInt(8); ++ return var4 <= this.rand.nextInt(8); + } + } + ++ /** ++ * Checks if the entity's current position is a valid location to spawn this entity. ++ */ + public boolean getCanSpawnHere() { + return this.worldObj.difficultySetting > 0 && this.isValidLightLevel() && super.getCanSpawnHere(); + } diff --git a/patches/net/minecraft/src/EntityMooshroom.java.patch b/patches/net/minecraft/src/EntityMooshroom.java.patch new file mode 100644 index 0000000..eaa75d5 --- /dev/null +++ b/patches/net/minecraft/src/EntityMooshroom.java.patch @@ -0,0 +1,84 @@ +--- net/minecraft/src/EntityMooshroom.java ++++ net/minecraft/src/EntityMooshroom.java +@@ -1,55 +1,63 @@ + package net.minecraft.src; + + public class EntityMooshroom extends EntityCow { +- public EntityMooshroom(World var1) { +- super(var1); ++ public EntityMooshroom(World par1World) { ++ super(par1World); + this.setSize(0.9F, 1.3F); + } + +- public boolean interact(EntityPlayer var1) { +- ItemStack var2 = var1.inventory.getCurrentItem(); +- if(var2 != null && var2.itemID == Item.bowlEmpty.itemID && this.getGrowingAge() >= 0) { +- if(var2.stackSize == 1) { +- var1.inventory.setInventorySlotContents(var1.inventory.currentItem, new ItemStack(Item.bowlSoup)); ++ /** ++ * Called when a player interacts with a mob. e.g. gets milk from a cow, gets into the saddle on a pig. ++ */ ++ public boolean interact(EntityPlayer par1EntityPlayer) { ++ ItemStack var2 = par1EntityPlayer.inventory.getCurrentItem(); ++ ++ if (var2 != null && var2.itemID == Item.bowlEmpty.itemID && this.getGrowingAge() >= 0) { ++ if (var2.stackSize == 1) { ++ par1EntityPlayer.inventory.setInventorySlotContents(par1EntityPlayer.inventory.currentItem, new ItemStack(Item.bowlSoup)); + return true; + } + +- if(var1.inventory.addItemStackToInventory(new ItemStack(Item.bowlSoup)) && !var1.capabilities.isCreativeMode) { +- var1.inventory.decrStackSize(var1.inventory.currentItem, 1); ++ if (par1EntityPlayer.inventory.addItemStackToInventory(new ItemStack(Item.bowlSoup)) && !par1EntityPlayer.capabilities.isCreativeMode) { ++ par1EntityPlayer.inventory.decrStackSize(par1EntityPlayer.inventory.currentItem, 1); + return true; + } + } + +- if(var2 != null && var2.itemID == Item.shears.itemID && this.getGrowingAge() >= 0) { ++ if (var2 != null && var2.itemID == Item.shears.itemID && this.getGrowingAge() >= 0) { + this.setDead(); + this.worldObj.spawnParticle("largeexplode", this.posX, this.posY + (double)(this.height / 2.0F), this.posZ, 0.0D, 0.0D, 0.0D); +- if(!this.worldObj.isRemote) { ++ ++ if (!this.worldObj.isRemote) { + EntityCow var3 = new EntityCow(this.worldObj); + var3.setLocationAndAngles(this.posX, this.posY, this.posZ, this.rotationYaw, this.rotationPitch); + var3.setHealth(this.getHealth()); + var3.renderYawOffset = this.renderYawOffset; + this.worldObj.spawnEntityInWorld(var3); + +- for(int var4 = 0; var4 < 5; ++var4) { ++ for (int var4 = 0; var4 < 5; ++var4) { + this.worldObj.spawnEntityInWorld(new EntityItem(this.worldObj, this.posX, this.posY + (double)this.height, this.posZ, new ItemStack(Block.mushroomRed))); + } + } + + return true; + } else { +- return super.interact(var1); ++ return super.interact(par1EntityPlayer); + } + } + +- public EntityMooshroom func_94900_c(EntityAgeable var1) { ++ public EntityMooshroom func_94900_c(EntityAgeable par1EntityAgeable) { + return new EntityMooshroom(this.worldObj); + } + +- public EntityCow spawnBabyAnimal(EntityAgeable var1) { +- return this.func_94900_c(var1); ++ /** ++ * This function is used when two same-species animals in 'love mode' breed to generate the new baby animal. ++ */ ++ public EntityCow spawnBabyAnimal(EntityAgeable par1EntityAgeable) { ++ return this.func_94900_c(par1EntityAgeable); + } + +- public EntityAgeable createChild(EntityAgeable var1) { +- return this.func_94900_c(var1); ++ public EntityAgeable createChild(EntityAgeable par1EntityAgeable) { ++ return this.func_94900_c(par1EntityAgeable); + } + } diff --git a/patches/net/minecraft/src/EntityMoveHelper.java.patch b/patches/net/minecraft/src/EntityMoveHelper.java.patch new file mode 100644 index 0000000..cebc62d --- /dev/null +++ b/patches/net/minecraft/src/EntityMoveHelper.java.patch @@ -0,0 +1,106 @@ +--- net/minecraft/src/EntityMoveHelper.java ++++ net/minecraft/src/EntityMoveHelper.java +@@ -1,18 +1,22 @@ + package net.minecraft.src; + + public class EntityMoveHelper { ++ ++ /** The EntityLiving that is being moved */ + private EntityLiving entity; + private double posX; + private double posY; + private double posZ; ++ ++ /** The speed at which the entity should move */ + private double speed; + private boolean update; + +- public EntityMoveHelper(EntityLiving var1) { +- this.entity = var1; +- this.posX = var1.posX; +- this.posY = var1.posY; +- this.posZ = var1.posZ; ++ public EntityMoveHelper(EntityLiving par1EntityLiving) { ++ this.entity = par1EntityLiving; ++ this.posX = par1EntityLiving.posX; ++ this.posY = par1EntityLiving.posY; ++ this.posZ = par1EntityLiving.posZ; + } + + public boolean isUpdating() { +@@ -23,45 +27,54 @@ + return this.speed; + } + +- public void setMoveTo(double var1, double var3, double var5, double var7) { +- this.posX = var1; +- this.posY = var3; +- this.posZ = var5; +- this.speed = var7; ++ /** ++ * Sets the speed and location to move to ++ */ ++ public void setMoveTo(double par1, double par3, double par5, double par7) { ++ this.posX = par1; ++ this.posY = par3; ++ this.posZ = par5; ++ this.speed = par7; + this.update = true; + } + + public void onUpdateMoveHelper() { + this.entity.setMoveForward(0.0F); +- if(this.update) { ++ ++ if (this.update) { + this.update = false; + int var1 = MathHelper.floor_double(this.entity.boundingBox.minY + 0.5D); + double var2 = this.posX - this.entity.posX; + double var4 = this.posZ - this.entity.posZ; + double var6 = this.posY - (double)var1; + double var8 = var2 * var2 + var6 * var6 + var4 * var4; +- if(var8 >= (double)2.5000003E-7F) { +- float var10 = (float)(Math.atan2(var4, var2) * 180.0D / (double)((float)Math.PI)) - 90.0F; ++ ++ if (var8 >= 2.500000277905201E-7D) { ++ float var10 = (float)(Math.atan2(var4, var2) * 180.0D / Math.PI) - 90.0F; + this.entity.rotationYaw = this.limitAngle(this.entity.rotationYaw, var10, 30.0F); + this.entity.setAIMoveSpeed((float)(this.speed * this.entity.getEntityAttribute(SharedMonsterAttributes.movementSpeed).getAttributeValue())); +- if(var6 > 0.0D && var2 * var2 + var4 * var4 < 1.0D) { ++ ++ if (var6 > 0.0D && var2 * var2 + var4 * var4 < 1.0D) { + this.entity.getJumpHelper().setJumping(); + } +- + } + } + } + +- private float limitAngle(float var1, float var2, float var3) { +- float var4 = MathHelper.wrapAngleTo180_float(var2 - var1); +- if(var4 > var3) { +- var4 = var3; +- } +- +- if(var4 < -var3) { +- var4 = -var3; +- } +- +- return var1 + var4; ++ /** ++ * Limits the given angle to a upper and lower limit. ++ */ ++ private float limitAngle(float par1, float par2, float par3) { ++ float var4 = MathHelper.wrapAngleTo180_float(par2 - par1); ++ ++ if (var4 > par3) { ++ var4 = par3; ++ } ++ ++ if (var4 < -par3) { ++ var4 = -par3; ++ } ++ ++ return par1 + var4; + } + } diff --git a/patches/net/minecraft/src/EntityNoteFX.java.patch b/patches/net/minecraft/src/EntityNoteFX.java.patch new file mode 100644 index 0000000..94272e6 --- /dev/null +++ b/patches/net/minecraft/src/EntityNoteFX.java.patch @@ -0,0 +1,97 @@ +--- net/minecraft/src/EntityNoteFX.java ++++ net/minecraft/src/EntityNoteFX.java +@@ -3,62 +3,68 @@ + public class EntityNoteFX extends EntityFX { + float noteParticleScale; + +- public EntityNoteFX(World var1, double var2, double var4, double var6, double var8, double var10, double var12) { +- this(var1, var2, var4, var6, var8, var10, var12, 2.0F); ++ public EntityNoteFX(World par1World, double par2, double par4, double par6, double par8, double par10, double par12) { ++ this(par1World, par2, par4, par6, par8, par10, par12, 2.0F); + } + +- public EntityNoteFX(World var1, double var2, double var4, double var6, double var8, double var10, double var12, float var14) { +- super(var1, var2, var4, var6, 0.0D, 0.0D, 0.0D); +- this.motionX *= (double)0.01F; +- this.motionY *= (double)0.01F; +- this.motionZ *= (double)0.01F; ++ public EntityNoteFX(World par1World, double par2, double par4, double par6, double par8, double par10, double par12, float par14) { ++ super(par1World, par2, par4, par6, 0.0D, 0.0D, 0.0D); ++ this.motionX *= 0.009999999776482582D; ++ this.motionY *= 0.009999999776482582D; ++ this.motionZ *= 0.009999999776482582D; + this.motionY += 0.2D; +- this.particleRed = MathHelper.sin(((float)var8 + 0.0F) * (float)Math.PI * 2.0F) * 0.65F + 0.35F; +- this.particleGreen = MathHelper.sin(((float)var8 + 1.0F / 3.0F) * (float)Math.PI * 2.0F) * 0.65F + 0.35F; +- this.particleBlue = MathHelper.sin(((float)var8 + 2.0F / 3.0F) * (float)Math.PI * 2.0F) * 0.65F + 0.35F; +- this.particleScale *= 12.0F / 16.0F; +- this.particleScale *= var14; ++ this.particleRed = MathHelper.sin(((float)par8 + 0.0F) * (float)Math.PI * 2.0F) * 0.65F + 0.35F; ++ this.particleGreen = MathHelper.sin(((float)par8 + 0.33333334F) * (float)Math.PI * 2.0F) * 0.65F + 0.35F; ++ this.particleBlue = MathHelper.sin(((float)par8 + 0.6666667F) * (float)Math.PI * 2.0F) * 0.65F + 0.35F; ++ this.particleScale *= 0.75F; ++ this.particleScale *= par14; + this.noteParticleScale = this.particleScale; + this.particleMaxAge = 6; + this.noClip = false; + this.setParticleTextureIndex(64); + } + +- public void renderParticle(Tessellator var1, float var2, float var3, float var4, float var5, float var6, float var7) { +- float var8 = ((float)this.particleAge + var2) / (float)this.particleMaxAge * 32.0F; +- if(var8 < 0.0F) { ++ public void renderParticle(Tessellator par1Tessellator, float par2, float par3, float par4, float par5, float par6, float par7) { ++ float var8 = ((float)this.particleAge + par2) / (float)this.particleMaxAge * 32.0F; ++ ++ if (var8 < 0.0F) { + var8 = 0.0F; + } + +- if(var8 > 1.0F) { ++ if (var8 > 1.0F) { + var8 = 1.0F; + } + + this.particleScale = this.noteParticleScale * var8; +- super.renderParticle(var1, var2, var3, var4, var5, var6, var7); ++ super.renderParticle(par1Tessellator, par2, par3, par4, par5, par6, par7); + } + ++ /** ++ * Called to update the entity's position/logic. ++ */ + public void onUpdate() { + this.prevPosX = this.posX; + this.prevPosY = this.posY; + this.prevPosZ = this.posZ; +- if(this.particleAge++ >= this.particleMaxAge) { ++ ++ if (this.particleAge++ >= this.particleMaxAge) { + this.setDead(); + } + + this.moveEntity(this.motionX, this.motionY, this.motionZ); +- if(this.posY == this.prevPosY) { ++ ++ if (this.posY == this.prevPosY) { + this.motionX *= 1.1D; + this.motionZ *= 1.1D; + } + +- this.motionX *= (double)0.66F; +- this.motionY *= (double)0.66F; +- this.motionZ *= (double)0.66F; +- if(this.onGround) { +- this.motionX *= (double)0.7F; +- this.motionZ *= (double)0.7F; +- } ++ this.motionX *= 0.6600000262260437D; ++ this.motionY *= 0.6600000262260437D; ++ this.motionZ *= 0.6600000262260437D; + ++ if (this.onGround) { ++ this.motionX *= 0.699999988079071D; ++ this.motionZ *= 0.699999988079071D; ++ } + } + } diff --git a/patches/net/minecraft/src/EntityOcelot.java.patch b/patches/net/minecraft/src/EntityOcelot.java.patch new file mode 100644 index 0000000..7eb02a6 --- /dev/null +++ b/patches/net/minecraft/src/EntityOcelot.java.patch @@ -0,0 +1,338 @@ +--- net/minecraft/src/EntityOcelot.java ++++ net/minecraft/src/EntityOcelot.java +@@ -1,10 +1,14 @@ + package net.minecraft.src; + + public class EntityOcelot extends EntityTameable { ++ ++ /** ++ * The tempt AI task for this mob, used to prevent taming while it is fleeing. ++ */ + private EntityAITempt aiTempt; + +- public EntityOcelot(World var1) { +- super(var1); ++ public EntityOcelot(World par1World) { ++ super(par1World); + this.setSize(0.6F, 0.8F); + this.getNavigator().setAvoidsWater(true); + this.tasks.addTask(1, new EntityAISwimming(this)); +@@ -26,13 +30,17 @@ + this.dataWatcher.addObject(18, Byte.valueOf((byte)0)); + } + ++ /** ++ * main AI tick function, replaces updateEntityActionState ++ */ + public void updateAITick() { +- if(this.getMoveHelper().isUpdating()) { ++ if (this.getMoveHelper().isUpdating()) { + double var1 = this.getMoveHelper().getSpeed(); +- if(var1 == 0.6D) { ++ ++ if (var1 == 0.6D) { + this.setSneaking(true); + this.setSprinting(false); +- } else if(var1 == 1.33D) { ++ } else if (var1 == 1.33D) { + this.setSneaking(false); + this.setSprinting(true); + } else { +@@ -43,13 +51,18 @@ + this.setSneaking(false); + this.setSprinting(false); + } +- + } + ++ /** ++ * Determines if an entity can be despawned, used on idle far away entities ++ */ + protected boolean canDespawn() { + return !this.isTamed() && this.ticksExisted > 2400; + } + ++ /** ++ * Returns true if the newer Entity AI code should be run ++ */ + public boolean isAIEnabled() { + return true; + } +@@ -57,78 +70,111 @@ + protected void applyEntityAttributes() { + super.applyEntityAttributes(); + this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setAttribute(10.0D); +- this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setAttribute((double)0.3F); +- } +- +- protected void fall(float var1) { +- } +- +- public void writeEntityToNBT(NBTTagCompound var1) { +- super.writeEntityToNBT(var1); +- var1.setInteger("CatType", this.getTameSkin()); +- } +- +- public void readEntityFromNBT(NBTTagCompound var1) { +- super.readEntityFromNBT(var1); +- this.setTameSkin(var1.getInteger("CatType")); +- } +- ++ this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setAttribute(0.30000001192092896D); ++ } ++ ++ /** ++ * Called when the mob is falling. Calculates and applies fall damage. ++ */ ++ protected void fall(float par1) {} ++ ++ /** ++ * (abstract) Protected helper method to write subclass entity data to NBT. ++ */ ++ public void writeEntityToNBT(NBTTagCompound par1NBTTagCompound) { ++ super.writeEntityToNBT(par1NBTTagCompound); ++ par1NBTTagCompound.setInteger("CatType", this.getTameSkin()); ++ } ++ ++ /** ++ * (abstract) Protected helper method to read subclass entity data from NBT. ++ */ ++ public void readEntityFromNBT(NBTTagCompound par1NBTTagCompound) { ++ super.readEntityFromNBT(par1NBTTagCompound); ++ this.setTameSkin(par1NBTTagCompound.getInteger("CatType")); ++ } ++ ++ /** ++ * Returns the sound this mob makes while it's alive. ++ */ + protected String getLivingSound() { +- return this.isTamed() ? (this.isInLove() ? "mob.cat.purr" : (this.ab.nextInt(4) == 0 ? "mob.cat.purreow" : "mob.cat.meow")) : ""; ++ return this.isTamed() ? (this.isInLove() ? "mob.cat.purr" : (this.rand.nextInt(4) == 0 ? "mob.cat.purreow" : "mob.cat.meow")) : ""; + } + ++ /** ++ * Returns the sound this mob makes when it is hurt. ++ */ + protected String getHurtSound() { + return "mob.cat.hitt"; + } + ++ /** ++ * Returns the sound this mob makes on death. ++ */ + protected String getDeathSound() { + return "mob.cat.hitt"; + } + ++ /** ++ * Returns the volume for the sounds this mob makes. ++ */ + protected float getSoundVolume() { + return 0.4F; + } + ++ /** ++ * Returns the item ID for the item the mob drops on death. ++ */ + protected int getDropItemId() { + return Item.leather.itemID; + } + +- public boolean attackEntityAsMob(Entity var1) { +- return var1.attackEntityFrom(DamageSource.causeMobDamage(this), 3.0F); ++ public boolean attackEntityAsMob(Entity par1Entity) { ++ return par1Entity.attackEntityFrom(DamageSource.causeMobDamage(this), 3.0F); + } + +- public boolean attackEntityFrom(DamageSource var1, float var2) { +- if(this.isEntityInvulnerable()) { ++ /** ++ * Called when the entity is attacked. ++ */ ++ public boolean attackEntityFrom(DamageSource par1DamageSource, float par2) { ++ if (this.isEntityInvulnerable()) { + return false; + } else { + this.aiSit.setSitting(false); +- return super.attackEntityFrom(var1, var2); ++ return super.attackEntityFrom(par1DamageSource, par2); + } + } + +- protected void dropFewItems(boolean var1, int var2) { +- } +- +- public boolean interact(EntityPlayer var1) { +- ItemStack var2 = var1.inventory.getCurrentItem(); +- if(this.isTamed()) { +- if(var1.getCommandSenderName().equalsIgnoreCase(this.getOwnerName()) && !this.worldObj.isRemote && !this.isBreedingItem(var2)) { ++ /** ++ * Drop 0-2 items of this living's type. @param par1 - Whether this entity has recently been hit by a player. @param ++ * par2 - Level of Looting used to kill this mob. ++ */ ++ protected void dropFewItems(boolean par1, int par2) {} ++ ++ /** ++ * Called when a player interacts with a mob. e.g. gets milk from a cow, gets into the saddle on a pig. ++ */ ++ public boolean interact(EntityPlayer par1EntityPlayer) { ++ ItemStack var2 = par1EntityPlayer.inventory.getCurrentItem(); ++ ++ if (this.isTamed()) { ++ if (par1EntityPlayer.getCommandSenderName().equalsIgnoreCase(this.getOwnerName()) && !this.worldObj.isRemote && !this.isBreedingItem(var2)) { + this.aiSit.setSitting(!this.isSitting()); + } +- } else if(this.aiTempt.isRunning() && var2 != null && var2.itemID == Item.fishRaw.itemID && var1.getDistanceSqToEntity(this) < 9.0D) { +- if(!var1.capabilities.isCreativeMode) { ++ } else if (this.aiTempt.isRunning() && var2 != null && var2.itemID == Item.fishRaw.itemID && par1EntityPlayer.getDistanceSqToEntity(this) < 9.0D) { ++ if (!par1EntityPlayer.capabilities.isCreativeMode) { + --var2.stackSize; + } + +- if(var2.stackSize <= 0) { +- var1.inventory.setInventorySlotContents(var1.inventory.currentItem, (ItemStack)null); ++ if (var2.stackSize <= 0) { ++ par1EntityPlayer.inventory.setInventorySlotContents(par1EntityPlayer.inventory.currentItem, (ItemStack)null); + } + +- if(!this.worldObj.isRemote) { +- if(this.ab.nextInt(3) == 0) { ++ if (!this.worldObj.isRemote) { ++ if (this.rand.nextInt(3) == 0) { + this.setTamed(true); +- this.setTameSkin(1 + this.worldObj.s.nextInt(3)); +- this.setOwner(var1.getCommandSenderName()); ++ this.setTameSkin(1 + this.worldObj.rand.nextInt(3)); ++ this.setOwner(par1EntityPlayer.getCommandSenderName()); + this.playTameEffect(true); + this.aiSit.setSitting(true); + this.worldObj.setEntityState(this, (byte)7); +@@ -141,12 +187,16 @@ + return true; + } + +- return super.interact(var1); ++ return super.interact(par1EntityPlayer); + } + +- public EntityOcelot spawnBabyAnimal(EntityAgeable var1) { ++ /** ++ * This function is used when two same-species animals in 'love mode' breed to generate the new baby animal. ++ */ ++ public EntityOcelot spawnBabyAnimal(EntityAgeable par1EntityAgeable) { + EntityOcelot var2 = new EntityOcelot(this.worldObj); +- if(this.isTamed()) { ++ ++ if (this.isTamed()) { + var2.setOwner(this.getOwnerName()); + var2.setTamed(true); + var2.setTameSkin(this.getTameSkin()); +@@ -155,19 +205,26 @@ + return var2; + } + +- public boolean isBreedingItem(ItemStack var1) { +- return var1 != null && var1.itemID == Item.fishRaw.itemID; ++ /** ++ * Checks if the parameter is an item which this animal can be fed to breed it (wheat, carrots or seeds depending on ++ * the animal type) ++ */ ++ public boolean isBreedingItem(ItemStack par1ItemStack) { ++ return par1ItemStack != null && par1ItemStack.itemID == Item.fishRaw.itemID; + } + +- public boolean canMateWith(EntityAnimal var1) { +- if(var1 == this) { +- return false; +- } else if(!this.isTamed()) { +- return false; +- } else if(!(var1 instanceof EntityOcelot)) { ++ /** ++ * Returns true if the mob is currently able to mate with the specified mob. ++ */ ++ public boolean canMateWith(EntityAnimal par1EntityAnimal) { ++ if (par1EntityAnimal == this) { ++ return false; ++ } else if (!this.isTamed()) { ++ return false; ++ } else if (!(par1EntityAnimal instanceof EntityOcelot)) { + return false; + } else { +- EntityOcelot var2 = (EntityOcelot)var1; ++ EntityOcelot var2 = (EntityOcelot)par1EntityAnimal; + return !var2.isTamed() ? false : this.isInLove() && var2.isInLove(); + } + } +@@ -176,24 +233,29 @@ + return this.dataWatcher.getWatchableObjectByte(18); + } + +- public void setTameSkin(int var1) { +- this.dataWatcher.updateObject(18, Byte.valueOf((byte)var1)); ++ public void setTameSkin(int par1) { ++ this.dataWatcher.updateObject(18, Byte.valueOf((byte)par1)); + } + ++ /** ++ * Checks if the entity's current position is a valid location to spawn this entity. ++ */ + public boolean getCanSpawnHere() { +- if(this.worldObj.s.nextInt(3) == 0) { ++ if (this.worldObj.rand.nextInt(3) == 0) { + return false; + } else { +- if(this.worldObj.checkNoEntityCollision(this.boundingBox) && this.worldObj.getCollidingBoundingBoxes(this, this.boundingBox).isEmpty() && !this.worldObj.isAnyLiquid(this.boundingBox)) { ++ if (this.worldObj.checkNoEntityCollision(this.boundingBox) && this.worldObj.getCollidingBoundingBoxes(this, this.boundingBox).isEmpty() && !this.worldObj.isAnyLiquid(this.boundingBox)) { + int var1 = MathHelper.floor_double(this.posX); + int var2 = MathHelper.floor_double(this.boundingBox.minY); + int var3 = MathHelper.floor_double(this.posZ); +- if(var2 < 63) { ++ ++ if (var2 < 63) { + return false; + } + + int var4 = this.worldObj.getBlockId(var1, var2 - 1, var3); +- if(var4 == Block.grass.blockID || var4 == Block.leaves.blockID) { ++ ++ if (var4 == Block.grass.blockID || var4 == Block.leaves.blockID) { + return true; + } + } +@@ -202,14 +264,18 @@ + } + } + ++ /** ++ * Gets the username of the entity. ++ */ + public String getEntityName() { + return this.hasCustomNameTag() ? this.getCustomNameTag() : (this.isTamed() ? "entity.Cat.name" : super.getEntityName()); + } + +- public EntityLivingData onSpawnWithEgg(EntityLivingData var1) { +- var1 = super.onSpawnWithEgg(var1); +- if(this.worldObj.s.nextInt(7) == 0) { +- for(int var2 = 0; var2 < 2; ++var2) { ++ public EntityLivingData onSpawnWithEgg(EntityLivingData par1EntityLivingData) { ++ par1EntityLivingData = super.onSpawnWithEgg(par1EntityLivingData); ++ ++ if (this.worldObj.rand.nextInt(7) == 0) { ++ for (int var2 = 0; var2 < 2; ++var2) { + EntityOcelot var3 = new EntityOcelot(this.worldObj); + var3.setLocationAndAngles(this.posX, this.posY, this.posZ, this.rotationYaw, 0.0F); + var3.setGrowingAge(-24000); +@@ -217,10 +283,10 @@ + } + } + +- return var1; ++ return par1EntityLivingData; + } + +- public EntityAgeable createChild(EntityAgeable var1) { +- return this.spawnBabyAnimal(var1); ++ public EntityAgeable createChild(EntityAgeable par1EntityAgeable) { ++ return this.spawnBabyAnimal(par1EntityAgeable); + } + } diff --git a/patches/net/minecraft/src/EntityOtherPlayerMP.java.patch b/patches/net/minecraft/src/EntityOtherPlayerMP.java.patch new file mode 100644 index 0000000..5512c50 --- /dev/null +++ b/patches/net/minecraft/src/EntityOtherPlayerMP.java.patch @@ -0,0 +1,183 @@ +--- net/minecraft/src/EntityOtherPlayerMP.java ++++ net/minecraft/src/EntityOtherPlayerMP.java +@@ -9,32 +9,45 @@ + private double otherPlayerMPYaw; + private double otherPlayerMPPitch; + +- public EntityOtherPlayerMP(World var1, String var2) { +- super(var1, var2); ++ public EntityOtherPlayerMP(World par1World, String par2Str) { ++ super(par1World, par2Str); + this.yOffset = 0.0F; +- this.stepHeight = 0.0F; ++ this.stepHeight = 0.0F; + this.noClip = true; + this.field_71082_cx = 0.25F; +- this.renderDistanceWeight = 10.0D; ++ this.renderDistanceWeight = 10.0D; + } + ++ /** ++ * sets the players height back to normal after doing things like sleeping and dieing ++ */ + protected void resetHeight() { + this.yOffset = 0.0F; + } + +- public boolean attackEntityFrom(DamageSource var1, float var2) { ++ /** ++ * Called when the entity is attacked. ++ */ ++ public boolean attackEntityFrom(DamageSource par1DamageSource, float par2) { + return true; + } + +- public void setPositionAndRotation2(double var1, double var3, double var5, float var7, float var8, int var9) { +- this.otherPlayerMPX = var1; +- this.otherPlayerMPY = var3; +- this.otherPlayerMPZ = var5; +- this.otherPlayerMPYaw = (double)var7; +- this.otherPlayerMPPitch = (double)var8; +- this.otherPlayerMPPosRotationIncrements = var9; ++ /** ++ * Sets the position and rotation. Only difference from the other one is no bounding on the rotation. Args: posX, posY, ++ * posZ, yaw, pitch ++ */ ++ public void setPositionAndRotation2(double par1, double par3, double par5, float par7, float par8, int par9) { ++ this.otherPlayerMPX = par1; ++ this.otherPlayerMPY = par3; ++ this.otherPlayerMPZ = par5; ++ this.otherPlayerMPYaw = (double)par7; ++ this.otherPlayerMPPitch = (double)par8; ++ this.otherPlayerMPPosRotationIncrements = par9; + } + ++ /** ++ * Called to update the entity's position/logic. ++ */ + public void onUpdate() { + this.field_71082_cx = 0.0F; + super.onUpdate(); +@@ -42,39 +55,46 @@ + double var1 = this.posX - this.prevPosX; + double var3 = this.posZ - this.prevPosZ; + float var5 = MathHelper.sqrt_double(var1 * var1 + var3 * var3) * 4.0F; +- if(var5 > 1.0F) { ++ ++ if (var5 > 1.0F) { + var5 = 1.0F; + } + + this.limbSwingAmount += (var5 - this.limbSwingAmount) * 0.4F; + this.limbSwing += this.limbSwingAmount; +- if(!this.isItemInUse && this.isEating() && this.inventory.mainInventory[this.inventory.currentItem] != null) { ++ ++ if (!this.isItemInUse && this.isEating() && this.inventory.mainInventory[this.inventory.currentItem] != null) { + ItemStack var6 = this.inventory.mainInventory[this.inventory.currentItem]; + this.setItemInUse(this.inventory.mainInventory[this.inventory.currentItem], Item.itemsList[var6.itemID].getMaxItemUseDuration(var6)); + this.isItemInUse = true; +- } else if(this.isItemInUse && !this.isEating()) { ++ } else if (this.isItemInUse && !this.isEating()) { + this.clearItemInUse(); + this.isItemInUse = false; + } +- + } + + public float getShadowSize() { + return 0.0F; + } + ++ /** ++ * Called frequently so the entity can update its state every tick as required. For example, zombies and skeletons use ++ * this to react to sunlight and start to burn. ++ */ + public void onLivingUpdate() { + super.updateEntityActionState(); +- if(this.otherPlayerMPPosRotationIncrements > 0) { ++ ++ if (this.otherPlayerMPPosRotationIncrements > 0) { + double var1 = this.posX + (this.otherPlayerMPX - this.posX) / (double)this.otherPlayerMPPosRotationIncrements; + double var3 = this.posY + (this.otherPlayerMPY - this.posY) / (double)this.otherPlayerMPPosRotationIncrements; + double var5 = this.posZ + (this.otherPlayerMPZ - this.posZ) / (double)this.otherPlayerMPPosRotationIncrements; +- + double var7; +- for(var7 = this.otherPlayerMPYaw - (double)this.rotationYaw; var7 < -180.0D; var7 += 360.0D) { ++ ++ for (var7 = this.otherPlayerMPYaw - (double)this.rotationYaw; var7 < -180.0D; var7 += 360.0D) { ++ ; + } + +- while(var7 >= 180.0D) { ++ while (var7 >= 180.0D) { + var7 -= 360.0D; + } + +@@ -87,16 +107,17 @@ + + this.prevCameraYaw = this.cameraYaw; + float var9 = MathHelper.sqrt_double(this.motionX * this.motionX + this.motionZ * this.motionZ); +- float var2 = (float)Math.atan(-this.motionY * (double)0.2F) * 15.0F; +- if(var9 > 0.1F) { ++ float var2 = (float)Math.atan(-this.motionY * 0.20000000298023224D) * 15.0F; ++ ++ if (var9 > 0.1F) { + var9 = 0.1F; + } + +- if(!this.onGround || this.getHealth() <= 0.0F) { ++ if (!this.onGround || this.getHealth() <= 0.0F) { + var9 = 0.0F; + } + +- if(this.onGround || this.getHealth() <= 0.0F) { ++ if (this.onGround || this.getHealth() <= 0.0F) { + var2 = 0.0F; + } + +@@ -104,28 +125,36 @@ + this.cameraPitch += (var2 - this.cameraPitch) * 0.8F; + } + +- public void setCurrentItemOrArmor(int var1, ItemStack var2) { +- if(var1 == 0) { +- this.inventory.mainInventory[this.inventory.currentItem] = var2; ++ /** ++ * Sets the held item, or an armor slot. Slot 0 is held item. Slot 1-4 is armor. Params: Item, slot ++ */ ++ public void setCurrentItemOrArmor(int par1, ItemStack par2ItemStack) { ++ if (par1 == 0) { ++ this.inventory.mainInventory[this.inventory.currentItem] = par2ItemStack; + } else { +- this.inventory.armorInventory[var1 - 1] = var2; ++ this.inventory.armorInventory[par1 - 1] = par2ItemStack; + } +- + } + + public float getEyeHeight() { + return 1.82F; + } + +- public void sendChatToPlayer(ChatMessageComponent var1) { +- Minecraft.getMinecraft().ingameGUI.getChatGUI().printChatMessage(var1.toStringWithFormatting(true)); ++ public void sendChatToPlayer(ChatMessageComponent par1ChatMessageComponent) { ++ Minecraft.getMinecraft().ingameGUI.getChatGUI().printChatMessage(par1ChatMessageComponent.toStringWithFormatting(true)); + } + +- public boolean canCommandSenderUseCommand(int var1, String var2) { ++ /** ++ * Returns true if the command sender is allowed to use the given command. ++ */ ++ public boolean canCommandSenderUseCommand(int par1, String par2Str) { + return false; + } + +- public ChunkCoordinates getCommandSenderPosition() { ++ /** ++ * Return the position for this command sender. ++ */ ++ public ChunkCoordinates getPlayerCoordinates() { + return new ChunkCoordinates(MathHelper.floor_double(this.posX + 0.5D), MathHelper.floor_double(this.posY + 0.5D), MathHelper.floor_double(this.posZ + 0.5D)); + } + } diff --git a/patches/net/minecraft/src/EntityPainting.java.patch b/patches/net/minecraft/src/EntityPainting.java.patch new file mode 100644 index 0000000..b29cb0d --- /dev/null +++ b/patches/net/minecraft/src/EntityPainting.java.patch @@ -0,0 +1,129 @@ +--- net/minecraft/src/EntityPainting.java ++++ net/minecraft/src/EntityPainting.java +@@ -5,70 +5,79 @@ + public class EntityPainting extends EntityHanging { + public EnumArt art; + +- public EntityPainting(World var1) { +- super(var1); ++ public EntityPainting(World par1World) { ++ super(par1World); + } + +- public EntityPainting(World var1, int var2, int var3, int var4, int var5) { +- super(var1, var2, var3, var4, var5); ++ public EntityPainting(World par1World, int par2, int par3, int par4, int par5) { ++ super(par1World, par2, par3, par4, par5); + ArrayList var6 = new ArrayList(); + EnumArt[] var7 = EnumArt.values(); + int var8 = var7.length; + +- for(int var9 = 0; var9 < var8; ++var9) { ++ for (int var9 = 0; var9 < var8; ++var9) { + EnumArt var10 = var7[var9]; + this.art = var10; +- this.setDirection(var5); +- if(this.onValidSurface()) { ++ this.setDirection(par5); ++ ++ if (this.onValidSurface()) { + var6.add(var10); + } + } + +- if(!var6.isEmpty()) { +- this.art = (EnumArt)var6.get(this.ab.nextInt(var6.size())); ++ if (!var6.isEmpty()) { ++ this.art = (EnumArt)var6.get(this.rand.nextInt(var6.size())); + } + +- this.setDirection(var5); ++ this.setDirection(par5); + } + +- public EntityPainting(World var1, int var2, int var3, int var4, int var5, String var6) { +- this(var1, var2, var3, var4, var5); ++ public EntityPainting(World par1World, int par2, int par3, int par4, int par5, String par6Str) { ++ this(par1World, par2, par3, par4, par5); + EnumArt[] var7 = EnumArt.values(); + int var8 = var7.length; + +- for(int var9 = 0; var9 < var8; ++var9) { ++ for (int var9 = 0; var9 < var8; ++var9) { + EnumArt var10 = var7[var9]; +- if(var10.B.equals(var6)) { ++ ++ if (var10.title.equals(par6Str)) { + this.art = var10; + break; + } + } + +- this.setDirection(var5); +- } +- +- public void writeEntityToNBT(NBTTagCompound var1) { +- var1.setString("Motive", this.art.B); +- super.writeEntityToNBT(var1); +- } +- +- public void readEntityFromNBT(NBTTagCompound var1) { +- String var2 = var1.getString("Motive"); ++ this.setDirection(par5); ++ } ++ ++ /** ++ * (abstract) Protected helper method to write subclass entity data to NBT. ++ */ ++ public void writeEntityToNBT(NBTTagCompound par1NBTTagCompound) { ++ par1NBTTagCompound.setString("Motive", this.art.title); ++ super.writeEntityToNBT(par1NBTTagCompound); ++ } ++ ++ /** ++ * (abstract) Protected helper method to read subclass entity data from NBT. ++ */ ++ public void readEntityFromNBT(NBTTagCompound par1NBTTagCompound) { ++ String var2 = par1NBTTagCompound.getString("Motive"); + EnumArt[] var3 = EnumArt.values(); + int var4 = var3.length; + +- for(int var5 = 0; var5 < var4; ++var5) { ++ for (int var5 = 0; var5 < var4; ++var5) { + EnumArt var6 = var3[var5]; +- if(var6.B.equals(var2)) { ++ ++ if (var6.title.equals(var2)) { + this.art = var6; + } + } + +- if(this.art == null) { ++ if (this.art == null) { + this.art = EnumArt.Kebab; + } + +- super.readEntityFromNBT(var1); ++ super.readEntityFromNBT(par1NBTTagCompound); + } + + public int getWidthPixels() { +@@ -79,10 +88,14 @@ + return this.art.sizeY; + } + +- public void onBroken(Entity var1) { +- if(var1 instanceof EntityPlayer) { +- EntityPlayer var2 = (EntityPlayer)var1; +- if(var2.capabilities.isCreativeMode) { ++ /** ++ * Called when this entity is broken. Entity parameter may be null. ++ */ ++ public void onBroken(Entity par1Entity) { ++ if (par1Entity instanceof EntityPlayer) { ++ EntityPlayer var2 = (EntityPlayer)par1Entity; ++ ++ if (var2.capabilities.isCreativeMode) { + return; + } + } diff --git a/patches/net/minecraft/src/EntityPickupFX.java.patch b/patches/net/minecraft/src/EntityPickupFX.java.patch new file mode 100644 index 0000000..52f4161 --- /dev/null +++ b/patches/net/minecraft/src/EntityPickupFX.java.patch @@ -0,0 +1,70 @@ +--- net/minecraft/src/EntityPickupFX.java ++++ net/minecraft/src/EntityPickupFX.java +@@ -7,32 +7,34 @@ + private Entity entityPickingUp; + private int age; + private int maxAge; ++ ++ /** renamed from yOffset to fix shadowing Entity.yOffset */ + private float yOffs; + +- public EntityPickupFX(World var1, Entity var2, Entity var3, float var4) { +- super(var1, var2.posX, var2.posY, var2.posZ, var2.motionX, var2.motionY, var2.motionZ); +- this.entityToPickUp = var2; +- this.entityPickingUp = var3; ++ public EntityPickupFX(World par1World, Entity par2Entity, Entity par3Entity, float par4) { ++ super(par1World, par2Entity.posX, par2Entity.posY, par2Entity.posZ, par2Entity.motionX, par2Entity.motionY, par2Entity.motionZ); ++ this.entityToPickUp = par2Entity; ++ this.entityPickingUp = par3Entity; + this.maxAge = 3; +- this.yOffs = var4; ++ this.yOffs = par4; + } + +- public void renderParticle(Tessellator var1, float var2, float var3, float var4, float var5, float var6, float var7) { +- float var8 = ((float)this.age + var2) / (float)this.maxAge; ++ public void renderParticle(Tessellator par1Tessellator, float par2, float par3, float par4, float par5, float par6, float par7) { ++ float var8 = ((float)this.age + par2) / (float)this.maxAge; + var8 *= var8; + double var9 = this.entityToPickUp.posX; + double var11 = this.entityToPickUp.posY; + double var13 = this.entityToPickUp.posZ; +- double var15 = this.entityPickingUp.lastTickPosX + (this.entityPickingUp.posX - this.entityPickingUp.lastTickPosX) * (double)var2; +- double var17 = this.entityPickingUp.lastTickPosY + (this.entityPickingUp.posY - this.entityPickingUp.lastTickPosY) * (double)var2 + (double)this.yOffs; +- double var19 = this.entityPickingUp.lastTickPosZ + (this.entityPickingUp.posZ - this.entityPickingUp.lastTickPosZ) * (double)var2; ++ double var15 = this.entityPickingUp.lastTickPosX + (this.entityPickingUp.posX - this.entityPickingUp.lastTickPosX) * (double)par2; ++ double var17 = this.entityPickingUp.lastTickPosY + (this.entityPickingUp.posY - this.entityPickingUp.lastTickPosY) * (double)par2 + (double)this.yOffs; ++ double var19 = this.entityPickingUp.lastTickPosZ + (this.entityPickingUp.posZ - this.entityPickingUp.lastTickPosZ) * (double)par2; + double var21 = var9 + (var15 - var9) * (double)var8; + double var23 = var11 + (var17 - var11) * (double)var8; + double var25 = var13 + (var19 - var13) * (double)var8; + int var27 = MathHelper.floor_double(var21); + int var28 = MathHelper.floor_double(var23 + (double)(this.yOffset / 2.0F)); + int var29 = MathHelper.floor_double(var25); +- int var30 = this.getBrightnessForRender(var2); ++ int var30 = this.getBrightnessForRender(par2); + int var31 = var30 % 65536; + int var32 = var30 / 65536; + OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, (float)var31 / 1.0F, (float)var32 / 1.0F); +@@ -40,15 +42,18 @@ + var21 -= interpPosX; + var23 -= interpPosY; + var25 -= interpPosZ; +- RenderManager.instance.renderEntityWithPosYaw(this.entityToPickUp, (double)((float)var21), (double)((float)var23), (double)((float)var25), this.entityToPickUp.rotationYaw, var2); ++ RenderManager.instance.renderEntityWithPosYaw(this.entityToPickUp, (double)((float)var21), (double)((float)var23), (double)((float)var25), this.entityToPickUp.rotationYaw, par2); + } + ++ /** ++ * Called to update the entity's position/logic. ++ */ + public void onUpdate() { + ++this.age; +- if(this.age == this.maxAge) { ++ ++ if (this.age == this.maxAge) { + this.setDead(); + } +- + } + + public int getFXLayer() { diff --git a/patches/net/minecraft/src/EntityPig.java.patch b/patches/net/minecraft/src/EntityPig.java.patch new file mode 100644 index 0000000..555d6e3 --- /dev/null +++ b/patches/net/minecraft/src/EntityPig.java.patch @@ -0,0 +1,232 @@ +--- net/minecraft/src/EntityPig.java ++++ net/minecraft/src/EntityPig.java +@@ -1,10 +1,12 @@ + package net.minecraft.src; + + public class EntityPig extends EntityAnimal { ++ ++ /** AI task for player control. */ + private final EntityAIControlledByPlayer aiControlledByPlayer; + +- public EntityPig(World var1) { +- super(var1); ++ public EntityPig(World par1World) { ++ super(par1World); + this.setSize(0.9F, 0.9F); + this.getNavigator().setAvoidsWater(true); + this.tasks.addTask(0, new EntityAISwimming(this)); +@@ -19,6 +21,9 @@ + this.tasks.addTask(8, new EntityAILookIdle(this)); + } + ++ /** ++ * Returns true if the newer Entity AI code should be run ++ */ + public boolean isAIEnabled() { + return true; + } +@@ -33,6 +38,10 @@ + super.updateAITasks(); + } + ++ /** ++ * returns true if all the conditions for steering the entity are met. For pigs, this is true if it is being ridden by ++ * a player and the player is holding a carrot-on-a-stick ++ */ + public boolean canBeSteered() { + ItemStack var1 = ((EntityPlayer)this.riddenByEntity).getHeldItem(); + return var1 != null && var1.itemID == Item.carrotOnAStick.itemID; +@@ -43,79 +52,114 @@ + this.dataWatcher.addObject(16, Byte.valueOf((byte)0)); + } + +- public void writeEntityToNBT(NBTTagCompound var1) { +- super.writeEntityToNBT(var1); +- var1.setBoolean("Saddle", this.getSaddled()); +- } +- +- public void readEntityFromNBT(NBTTagCompound var1) { +- super.readEntityFromNBT(var1); +- this.setSaddled(var1.getBoolean("Saddle")); +- } +- ++ /** ++ * (abstract) Protected helper method to write subclass entity data to NBT. ++ */ ++ public void writeEntityToNBT(NBTTagCompound par1NBTTagCompound) { ++ super.writeEntityToNBT(par1NBTTagCompound); ++ par1NBTTagCompound.setBoolean("Saddle", this.getSaddled()); ++ } ++ ++ /** ++ * (abstract) Protected helper method to read subclass entity data from NBT. ++ */ ++ public void readEntityFromNBT(NBTTagCompound par1NBTTagCompound) { ++ super.readEntityFromNBT(par1NBTTagCompound); ++ this.setSaddled(par1NBTTagCompound.getBoolean("Saddle")); ++ } ++ ++ /** ++ * Returns the sound this mob makes while it's alive. ++ */ + protected String getLivingSound() { + return "mob.pig.say"; + } + ++ /** ++ * Returns the sound this mob makes when it is hurt. ++ */ + protected String getHurtSound() { + return "mob.pig.say"; + } + ++ /** ++ * Returns the sound this mob makes on death. ++ */ + protected String getDeathSound() { + return "mob.pig.death"; + } + +- protected void playStepSound(int var1, int var2, int var3, int var4) { ++ /** ++ * Plays step sound at given x, y, z for the entity ++ */ ++ protected void playStepSound(int par1, int par2, int par3, int par4) { + this.playSound("mob.pig.step", 0.15F, 1.0F); + } + +- public boolean interact(EntityPlayer var1) { +- if(super.interact(var1)) { +- return true; +- } else if(!this.getSaddled() || this.worldObj.isRemote || this.riddenByEntity != null && this.riddenByEntity != var1) { ++ /** ++ * Called when a player interacts with a mob. e.g. gets milk from a cow, gets into the saddle on a pig. ++ */ ++ public boolean interact(EntityPlayer par1EntityPlayer) { ++ if (super.interact(par1EntityPlayer)) { ++ return true; ++ } else if (this.getSaddled() && !this.worldObj.isRemote && (this.riddenByEntity == null || this.riddenByEntity == par1EntityPlayer)) { ++ par1EntityPlayer.mountEntity(this); ++ return true; ++ } else { + return false; +- } else { +- var1.mountEntity(this); +- return true; + } + } + ++ /** ++ * Returns the item ID for the item the mob drops on death. ++ */ + protected int getDropItemId() { + return this.isBurning() ? Item.porkCooked.itemID : Item.porkRaw.itemID; + } + +- protected void dropFewItems(boolean var1, int var2) { +- int var3 = this.ab.nextInt(3) + 1 + this.ab.nextInt(1 + var2); ++ /** ++ * Drop 0-2 items of this living's type. @param par1 - Whether this entity has recently been hit by a player. @param ++ * par2 - Level of Looting used to kill this mob. ++ */ ++ protected void dropFewItems(boolean par1, int par2) { ++ int var3 = this.rand.nextInt(3) + 1 + this.rand.nextInt(1 + par2); + +- for(int var4 = 0; var4 < var3; ++var4) { +- if(this.isBurning()) { ++ for (int var4 = 0; var4 < var3; ++var4) { ++ if (this.isBurning()) { + this.dropItem(Item.porkCooked.itemID, 1); + } else { + this.dropItem(Item.porkRaw.itemID, 1); + } + } + +- if(this.getSaddled()) { ++ if (this.getSaddled()) { + this.dropItem(Item.saddle.itemID, 1); + } +- + } + ++ /** ++ * Returns true if the pig is saddled. ++ */ + public boolean getSaddled() { + return (this.dataWatcher.getWatchableObjectByte(16) & 1) != 0; + } + +- public void setSaddled(boolean var1) { +- if(var1) { ++ /** ++ * Set or remove the saddle of the pig. ++ */ ++ public void setSaddled(boolean par1) { ++ if (par1) { + this.dataWatcher.updateObject(16, Byte.valueOf((byte)1)); + } else { + this.dataWatcher.updateObject(16, Byte.valueOf((byte)0)); + } +- + } + +- public void onStruckByLightning(EntityLightningBolt var1) { +- if(!this.worldObj.isRemote) { ++ /** ++ * Called when a lightning bolt hits the entity. ++ */ ++ public void onStruckByLightning(EntityLightningBolt par1EntityLightningBolt) { ++ if (!this.worldObj.isRemote) { + EntityPigZombie var2 = new EntityPigZombie(this.worldObj); + var2.setLocationAndAngles(this.posX, this.posY, this.posZ, this.rotationYaw, this.rotationPitch); + this.worldObj.spawnEntityInWorld(var2); +@@ -123,27 +167,40 @@ + } + } + +- protected void fall(float var1) { +- super.fall(var1); +- if(var1 > 5.0F && this.riddenByEntity instanceof EntityPlayer) { ++ /** ++ * Called when the mob is falling. Calculates and applies fall damage. ++ */ ++ protected void fall(float par1) { ++ super.fall(par1); ++ ++ if (par1 > 5.0F && this.riddenByEntity instanceof EntityPlayer) { + ((EntityPlayer)this.riddenByEntity).triggerAchievement(AchievementList.flyPig); + } +- + } + +- public EntityPig spawnBabyAnimal(EntityAgeable var1) { ++ /** ++ * This function is used when two same-species animals in 'love mode' breed to generate the new baby animal. ++ */ ++ public EntityPig spawnBabyAnimal(EntityAgeable par1EntityAgeable) { + return new EntityPig(this.worldObj); + } + +- public boolean isBreedingItem(ItemStack var1) { +- return var1 != null && var1.itemID == Item.carrot.itemID; ++ /** ++ * Checks if the parameter is an item which this animal can be fed to breed it (wheat, carrots or seeds depending on ++ * the animal type) ++ */ ++ public boolean isBreedingItem(ItemStack par1ItemStack) { ++ return par1ItemStack != null && par1ItemStack.itemID == Item.carrot.itemID; + } + ++ /** ++ * Return the AI task for player control. ++ */ + public EntityAIControlledByPlayer getAIControlledByPlayer() { + return this.aiControlledByPlayer; + } + +- public EntityAgeable createChild(EntityAgeable var1) { +- return this.spawnBabyAnimal(var1); ++ public EntityAgeable createChild(EntityAgeable par1EntityAgeable) { ++ return this.spawnBabyAnimal(par1EntityAgeable); + } + } diff --git a/patches/net/minecraft/src/EntityPigZombie.java.patch b/patches/net/minecraft/src/EntityPigZombie.java.patch new file mode 100644 index 0000000..06350f5 --- /dev/null +++ b/patches/net/minecraft/src/EntityPigZombie.java.patch @@ -0,0 +1,233 @@ +--- net/minecraft/src/EntityPigZombie.java ++++ net/minecraft/src/EntityPigZombie.java +@@ -4,14 +4,18 @@ + import java.util.UUID; + + public class EntityPigZombie extends EntityZombie { +- private static final UUID bq = UUID.fromString("49455A49-7EC5-45BA-B886-3B90B23A1718"); +- private static final AttributeModifier field_110190_br = (new AttributeModifier(bq, "Attacking speed boost", 0.45D, 0)).setSaved(false); ++ private static final UUID field_110189_bq = UUID.fromString("49455A49-7EC5-45BA-B886-3B90B23A1718"); ++ private static final AttributeModifier field_110190_br = (new AttributeModifier(field_110189_bq, "Attacking speed boost", 0.45D, 0)).setSaved(false); ++ ++ /** Above zero if this PigZombie is Angry. */ + private int angerLevel; ++ ++ /** A random delay until this PigZombie next makes a sound. */ + private int randomSoundDelay; + private Entity field_110191_bu; + +- public EntityPigZombie(World var1) { +- super(var1); ++ public EntityPigZombie(World par1World) { ++ super(par1World); + this.isImmuneToFire = true; + } + +@@ -22,56 +26,82 @@ + this.getEntityAttribute(SharedMonsterAttributes.attackDamage).setAttribute(5.0D); + } + ++ /** ++ * Returns true if the newer Entity AI code should be run ++ */ + protected boolean isAIEnabled() { + return false; + } + ++ /** ++ * Called to update the entity's position/logic. ++ */ + public void onUpdate() { +- if(this.field_110191_bu != this.entityToAttack && !this.worldObj.isRemote) { ++ if (this.field_110191_bu != this.entityToAttack && !this.worldObj.isRemote) { + AttributeInstance var1 = this.getEntityAttribute(SharedMonsterAttributes.movementSpeed); + var1.removeModifier(field_110190_br); +- if(this.entityToAttack != null) { ++ ++ if (this.entityToAttack != null) { + var1.applyModifier(field_110190_br); + } + } + + this.field_110191_bu = this.entityToAttack; +- if(this.randomSoundDelay > 0 && --this.randomSoundDelay == 0) { +- this.playSound("mob.zombiepig.zpigangry", this.getSoundVolume() * 2.0F, ((this.ab.nextFloat() - this.ab.nextFloat()) * 0.2F + 1.0F) * 1.8F); ++ ++ if (this.randomSoundDelay > 0 && --this.randomSoundDelay == 0) { ++ this.playSound("mob.zombiepig.zpigangry", this.getSoundVolume() * 2.0F, ((this.rand.nextFloat() - this.rand.nextFloat()) * 0.2F + 1.0F) * 1.8F); + } + + super.onUpdate(); + } + ++ /** ++ * Checks if the entity's current position is a valid location to spawn this entity. ++ */ + public boolean getCanSpawnHere() { + return this.worldObj.difficultySetting > 0 && this.worldObj.checkNoEntityCollision(this.boundingBox) && this.worldObj.getCollidingBoundingBoxes(this, this.boundingBox).isEmpty() && !this.worldObj.isAnyLiquid(this.boundingBox); + } + +- public void writeEntityToNBT(NBTTagCompound var1) { +- super.writeEntityToNBT(var1); +- var1.setShort("Anger", (short)this.angerLevel); +- } +- +- public void readEntityFromNBT(NBTTagCompound var1) { +- super.readEntityFromNBT(var1); +- this.angerLevel = var1.getShort("Anger"); +- } +- ++ /** ++ * (abstract) Protected helper method to write subclass entity data to NBT. ++ */ ++ public void writeEntityToNBT(NBTTagCompound par1NBTTagCompound) { ++ super.writeEntityToNBT(par1NBTTagCompound); ++ par1NBTTagCompound.setShort("Anger", (short)this.angerLevel); ++ } ++ ++ /** ++ * (abstract) Protected helper method to read subclass entity data from NBT. ++ */ ++ public void readEntityFromNBT(NBTTagCompound par1NBTTagCompound) { ++ super.readEntityFromNBT(par1NBTTagCompound); ++ this.angerLevel = par1NBTTagCompound.getShort("Anger"); ++ } ++ ++ /** ++ * Finds the closest player within 16 blocks to attack, or null if this Entity isn't interested in attacking (Animals, ++ * Spiders at day, peaceful PigZombies). ++ */ + protected Entity findPlayerToAttack() { + return this.angerLevel == 0 ? null : super.findPlayerToAttack(); + } + +- public boolean attackEntityFrom(DamageSource var1, float var2) { +- if(this.isEntityInvulnerable()) { ++ /** ++ * Called when the entity is attacked. ++ */ ++ public boolean attackEntityFrom(DamageSource par1DamageSource, float par2) { ++ if (this.isEntityInvulnerable()) { + return false; + } else { +- Entity var3 = var1.getEntity(); +- if(var3 instanceof EntityPlayer) { ++ Entity var3 = par1DamageSource.getEntity(); ++ ++ if (var3 instanceof EntityPlayer) { + List var4 = this.worldObj.getEntitiesWithinAABBExcludingEntity(this, this.boundingBox.expand(32.0D, 32.0D, 32.0D)); + +- for(int var5 = 0; var5 < var4.size(); ++var5) { ++ for (int var5 = 0; var5 < var4.size(); ++var5) { + Entity var6 = (Entity)var4.get(var5); +- if(var6 instanceof EntityPigZombie) { ++ ++ if (var6 instanceof EntityPigZombie) { + EntityPigZombie var7 = (EntityPigZombie)var6; + var7.becomeAngryAt(var3); + } +@@ -80,63 +110,87 @@ + this.becomeAngryAt(var3); + } + +- return super.attackEntityFrom(var1, var2); ++ return super.attackEntityFrom(par1DamageSource, par2); + } + } + +- private void becomeAngryAt(Entity var1) { +- this.entityToAttack = var1; +- this.angerLevel = 400 + this.ab.nextInt(400); +- this.randomSoundDelay = this.ab.nextInt(40); ++ /** ++ * Causes this PigZombie to become angry at the supplied Entity (which will be a player). ++ */ ++ private void becomeAngryAt(Entity par1Entity) { ++ this.entityToAttack = par1Entity; ++ this.angerLevel = 400 + this.rand.nextInt(400); ++ this.randomSoundDelay = this.rand.nextInt(40); + } + ++ /** ++ * Returns the sound this mob makes while it's alive. ++ */ + protected String getLivingSound() { + return "mob.zombiepig.zpig"; + } + ++ /** ++ * Returns the sound this mob makes when it is hurt. ++ */ + protected String getHurtSound() { + return "mob.zombiepig.zpighurt"; + } + ++ /** ++ * Returns the sound this mob makes on death. ++ */ + protected String getDeathSound() { + return "mob.zombiepig.zpigdeath"; + } + +- protected void dropFewItems(boolean var1, int var2) { +- int var3 = this.ab.nextInt(2 + var2); +- ++ /** ++ * Drop 0-2 items of this living's type. @param par1 - Whether this entity has recently been hit by a player. @param ++ * par2 - Level of Looting used to kill this mob. ++ */ ++ protected void dropFewItems(boolean par1, int par2) { ++ int var3 = this.rand.nextInt(2 + par2); + int var4; +- for(var4 = 0; var4 < var3; ++var4) { ++ ++ for (var4 = 0; var4 < var3; ++var4) { + this.dropItem(Item.rottenFlesh.itemID, 1); + } + +- var3 = this.ab.nextInt(2 + var2); ++ var3 = this.rand.nextInt(2 + par2); + +- for(var4 = 0; var4 < var3; ++var4) { ++ for (var4 = 0; var4 < var3; ++var4) { + this.dropItem(Item.goldNugget.itemID, 1); + } +- + } + +- public boolean interact(EntityPlayer var1) { ++ /** ++ * Called when a player interacts with a mob. e.g. gets milk from a cow, gets into the saddle on a pig. ++ */ ++ public boolean interact(EntityPlayer par1EntityPlayer) { + return false; + } + +- protected void dropRareDrop(int var1) { ++ protected void dropRareDrop(int par1) { + this.dropItem(Item.ingotGold.itemID, 1); + } + ++ /** ++ * Returns the item ID for the item the mob drops on death. ++ */ + protected int getDropItemId() { + return Item.rottenFlesh.itemID; + } + ++ /** ++ * Makes entity wear random armor based on difficulty ++ */ + protected void addRandomArmor() { + this.setCurrentItemOrArmor(0, new ItemStack(Item.swordGold)); + } + +- public EntityLivingData onSpawnWithEgg(EntityLivingData var1) { +- super.onSpawnWithEgg(var1); ++ public EntityLivingData onSpawnWithEgg(EntityLivingData par1EntityLivingData) { ++ super.onSpawnWithEgg(par1EntityLivingData); + this.setVillager(false); +- return var1; ++ return par1EntityLivingData; + } + } diff --git a/patches/net/minecraft/src/EntityPlayer.java.patch b/patches/net/minecraft/src/EntityPlayer.java.patch new file mode 100644 index 0000000..5557022 --- /dev/null +++ b/patches/net/minecraft/src/EntityPlayer.java.patch @@ -0,0 +1,2396 @@ +--- net/minecraft/src/EntityPlayer.java ++++ net/minecraft/src/EntityPlayer.java +@@ -3,17 +3,60 @@ + import java.util.Collection; + import java.util.Iterator; + import java.util.List; ++import java.util.Map.Entry; ++ ++import org.newdawn.slick.opengl.Texture; ++ ++import net.minecraft.src.ItemStack; ++ ++ ++//Spout Start ++import org.bukkit.ChatColor; ++import org.spoutcraft.api.Spoutcraft; ++import org.spoutcraft.api.block.design.BlockDesign; ++import org.spoutcraft.api.material.MaterialData; ++import org.spoutcraft.api.util.FixedLocation; ++import org.spoutcraft.client.SpoutClient; ++import org.spoutcraft.client.config.Configuration; ++import org.spoutcraft.client.gui.minimap.GuiOverviewMap; ++import org.spoutcraft.client.io.CustomTextureManager; ++import org.spoutcraft.client.packet.PacketRenderDistance; ++import org.spoutcraft.client.player.ClientPlayer; ++import org.spoutcraft.client.special.Resources; ++import org.spoutcraft.client.special.VIP; ++//Spout End + + public abstract class EntityPlayer extends EntityLivingBase implements ICommandSender { ++ ++ /** Inventory of the player */ + public InventoryPlayer inventory = new InventoryPlayer(this); + private InventoryEnderChest theInventoryEnderChest = new InventoryEnderChest(); ++ ++ /** ++ * The Container for the player's inventory (which opens when they press E) ++ */ + public Container inventoryContainer; ++ ++ /** The Container the player has open. */ + public Container openContainer; ++ ++ /** The player's food stats. (See class FoodStats) */ + protected FoodStats foodStats = new FoodStats(); +- protected int flyToggleTimer; ++ ++ /** ++ * Used to tell if the player pressed jump twice. If this is at 0 and it's pressed (And they are allowed to fly, as ++ * defined in the player's movementInput) it sets this to 7. If it's pressed and it's greater than 0 enable fly. ++ */ ++ protected int flyToggleTimer; + public float prevCameraYaw; + public float cameraYaw; +- protected final String bu; ++ // Spout Start ++ public String playerCloakUrl; ++ // Spout End ++ ++ /** ++ * Used by EntityPlayer to prevent too many xp orbs from getting absorbed at once. ++ */ + public int xpCooldown; + public double field_71091_bM; + public double field_71096_bN; +@@ -21,36 +64,87 @@ + public double field_71094_bP; + public double field_71095_bQ; + public double field_71085_bR; ++ ++ /** Boolean value indicating weather a player is sleeping or not */ + protected boolean sleeping; ++ ++ /** ++ * The chunk coordinates of the bed the player is in (null if player isn't in a bed). ++ */ + public ChunkCoordinates playerLocation; + private int sleepTimer; + public float field_71079_bU; + public float field_71082_cx; + public float field_71089_bV; ++ ++ /** ++ * Holds the last coordinate to spawn based on last bed that the player sleep. ++ */ + private ChunkCoordinates spawnChunk; ++ ++ /** ++ * Whether this player's spawn point is forced, preventing execution of bed checks. ++ */ + private boolean spawnForced; ++ ++ /** Holds the coordinate of the player when enter a minecraft to ride. */ + private ChunkCoordinates startMinecartRidingCoordinate; ++ ++ /** The player's capabilities. (See class PlayerCapabilities) */ + public PlayerCapabilities capabilities = new PlayerCapabilities(); ++ ++ /** The current experience level the player is on. */ + public int experienceLevel; ++ ++ /** ++ * The total amount of experience the player has. This also includes the amount of experience within their Experience ++ * Bar. ++ */ + public int experienceTotal; ++ ++ /** ++ * The current amount of experience the player has within their Experience Bar. ++ */ + public float experience; +- private ItemStack itemInUse; ++ ++ /** ++ * This is the item that is in use when the player is holding down the useItemButton (e.g., bow, food, sword) ++ */ ++ // Spout Start Private > Public ++ public ItemStack itemInUse; ++ ++ /** ++ * This field starts off equal to getMaxItemUseDuration and is decremented on each tick ++ */ + private int itemInUseCount; + protected float speedOnGround = 0.1F; + protected float speedInAir = 0.02F; + private int field_82249_h; ++ ++ /** ++ * An instance of a fishing rod's hook. If this isn't null, the icon image of the fishing rod is slightly different ++ */ + public EntityFishHook fishEntity; ++ // Spout Start ++ public boolean sneakToggle = false; ++ public boolean runToggle = false; ++ public boolean treadWaterToggle = false; ++ public boolean autoforwardToggle = false; ++ public boolean autoBackwardToggle = false; ++ public MovementInput movementInput = new MovementInputFromOptions(SpoutClient.getHandle().gameSettings); // Spout - always have an instance! ++ public VIP vip = null; ++ // Spout End + +- public EntityPlayer(World var1, String var2) { +- super(var1); +- this.bu = var2; +- this.inventoryContainer = new ContainerPlayer(this.inventory, !var1.isRemote, this); ++ public EntityPlayer(World par1World, String par2Str) { ++ super(par1World); ++ this.username = par2Str; ++ this.inventoryContainer = new ContainerPlayer(this.inventory, !par1World.isRemote, this); + this.openContainer = this.inventoryContainer; + this.yOffset = 1.62F; +- ChunkCoordinates var3 = var1.getSpawnPoint(); +- this.setLocationAndAngles((double)var3.posX + 0.5D, (double)(var3.posY + 1), (double)var3.posZ + 0.5D, 0.0F, 0.0F); ++ ChunkCoordinates var3 = par1World.getSpawnPoint(); ++ this.setLocationAndAngles((double)var3.posX + 0.5D, (double)(var3.posY + 1), (double)var3.posZ + 0.5D, 0.0F, 0.0F); + this.field_70741_aB = 180.0F; +- this.fireResistance = 20; ++ this.fireResistance = 20; + } + + protected void applyEntityAttributes() { +@@ -65,24 +159,36 @@ + this.dataWatcher.addObject(18, Integer.valueOf(0)); + } + ++ /** ++ * returns the ItemStack containing the itemInUse ++ */ + public ItemStack getItemInUse() { + return this.itemInUse; + } + ++ /** ++ * Returns the item in use count ++ */ + public int getItemInUseCount() { + return this.itemInUseCount; + } + ++ /** ++ * Checks if the entity is currently using an item (e.g., bow, food, sword) by holding down the useItemButton ++ */ + public boolean isUsingItem() { + return this.itemInUse != null; + } + ++ /** ++ * gets the duration for how long the current itemInUse has been in use ++ */ + public int getItemInUseDuration() { + return this.isUsingItem() ? this.itemInUse.getMaxItemUseDuration() - this.itemInUseCount : 0; + } + + public void stopUsingItem() { +- if(this.itemInUse != null) { ++ if (this.itemInUse != null) { + this.itemInUse.onPlayerStoppedUsing(this.worldObj, this, this.itemInUseCount); + } + +@@ -92,25 +198,29 @@ + public void clearItemInUse() { + this.itemInUse = null; + this.itemInUseCount = 0; +- if(!this.worldObj.isRemote) { ++ ++ if (!this.worldObj.isRemote) { + this.setEating(false); + } +- + } + + public boolean isBlocking() { + return this.isUsingItem() && Item.itemsList[this.itemInUse.itemID].getItemUseAction(this.itemInUse) == EnumAction.block; + } + ++ /** ++ * Called to update the entity's position/logic. ++ */ + public void onUpdate() { +- if(this.itemInUse != null) { ++ if (this.itemInUse != null) { + ItemStack var1 = this.inventory.getCurrentItem(); +- if(var1 == this.itemInUse) { +- if(this.itemInUseCount <= 25 && this.itemInUseCount % 4 == 0) { ++ ++ if (var1 == this.itemInUse) { ++ if (this.itemInUseCount <= 25 && this.itemInUseCount % 4 == 0) { + this.updateItemUse(var1, 5); + } + +- if(--this.itemInUseCount == 0 && !this.worldObj.isRemote) { ++ if (--this.itemInUseCount == 0 && !this.worldObj.isRemote) { + this.onItemUseFinish(); + } + } else { +@@ -118,37 +228,40 @@ + } + } + +- if(this.xpCooldown > 0) { ++ if (this.xpCooldown > 0) { + --this.xpCooldown; + } + +- if(this.isPlayerSleeping()) { ++ if (this.isPlayerSleeping()) { + ++this.sleepTimer; +- if(this.sleepTimer > 100) { ++ ++ if (this.sleepTimer > 100) { + this.sleepTimer = 100; + } + +- if(!this.worldObj.isRemote) { +- if(!this.isInBed()) { ++ if (!this.worldObj.isRemote) { ++ if (!this.isInBed()) { + this.wakeUpPlayer(true, true, false); +- } else if(this.worldObj.isDaytime()) { ++ } else if (this.worldObj.isDaytime()) { + this.wakeUpPlayer(false, true, true); + } + } +- } else if(this.sleepTimer > 0) { ++ } else if (this.sleepTimer > 0) { + ++this.sleepTimer; +- if(this.sleepTimer >= 110) { ++ ++ if (this.sleepTimer >= 110) { + this.sleepTimer = 0; + } + } + + super.onUpdate(); +- if(!this.worldObj.isRemote && this.openContainer != null && !this.openContainer.canInteractWith(this)) { ++ ++ if (!this.worldObj.isRemote && this.openContainer != null && !this.openContainer.canInteractWith(this)) { + this.closeScreen(); + this.openContainer = this.inventoryContainer; + } + +- if(this.isBurning() && this.capabilities.disableDamage) { ++ if (this.isBurning() && this.capabilities.disableDamage) { + this.extinguish(); + } + +@@ -159,27 +272,28 @@ + double var3 = this.posY - this.field_71095_bQ; + double var5 = this.posZ - this.field_71085_bR; + double var7 = 10.0D; +- if(var9 > var7) { ++ ++ if (var9 > var7) { + this.field_71091_bM = this.field_71094_bP = this.posX; + } + +- if(var5 > var7) { ++ if (var5 > var7) { + this.field_71097_bO = this.field_71085_bR = this.posZ; + } + +- if(var3 > var7) { ++ if (var3 > var7) { + this.field_71096_bN = this.field_71095_bQ = this.posY; + } + +- if(var9 < -var7) { ++ if (var9 < -var7) { + this.field_71091_bM = this.field_71094_bP = this.posX; + } + +- if(var5 < -var7) { ++ if (var5 < -var7) { + this.field_71097_bO = this.field_71085_bR = this.posZ; + } + +- if(var3 < -var7) { ++ if (var3 < -var7) { + this.field_71096_bN = this.field_71095_bQ = this.posY; + } + +@@ -187,102 +301,145 @@ + this.field_71085_bR += var5 * 0.25D; + this.field_71095_bQ += var3 * 0.25D; + this.addStat(StatList.minutesPlayedStat, 1); +- if(this.ridingEntity == null) { ++ ++ if (this.ridingEntity == null) { + this.startMinecartRidingCoordinate = null; + } + +- if(!this.worldObj.isRemote) { ++ if (!this.worldObj.isRemote) { + this.foodStats.onUpdate(this); + } +- + } + ++ /** ++ * Return the amount of time this entity should stay in a portal before being transported. ++ */ + public int getMaxInPortalTime() { + return this.capabilities.disableDamage ? 0 : 80; + } + ++ /** ++ * Return the amount of cooldown before this entity can use a portal again. ++ */ + public int getPortalCooldown() { + return 10; + } + +- public void playSound(String var1, float var2, float var3) { +- this.worldObj.playSoundToNearExcept(this, var1, var2, var3); ++ public void playSound(String par1Str, float par2, float par3) { ++ this.worldObj.playSoundToNearExcept(this, par1Str, par2, par3); + } + +- protected void updateItemUse(ItemStack var1, int var2) { +- if(var1.getItemUseAction() == EnumAction.drink) { +- this.playSound("random.drink", 0.5F, this.worldObj.s.nextFloat() * 0.1F + 0.9F); ++ /** ++ * Plays sounds and makes particles for item in use state ++ */ ++ protected void updateItemUse(ItemStack par1ItemStack, int par2) { ++ if (par1ItemStack.getItemUseAction() == EnumAction.drink) { ++ this.playSound("random.drink", 0.5F, this.worldObj.rand.nextFloat() * 0.1F + 0.9F); + } + +- if(var1.getItemUseAction() == EnumAction.eat) { +- for(int var3 = 0; var3 < var2; ++var3) { +- Vec3 var4 = this.worldObj.getWorldVec3Pool().getVecFromPool(((double)this.ab.nextFloat() - 0.5D) * 0.1D, Math.random() * 0.1D + 0.1D, 0.0D); ++ if (par1ItemStack.getItemUseAction() == EnumAction.eat) { ++ for (int var3 = 0; var3 < par2; ++var3) { ++ Vec3 var4 = this.worldObj.getWorldVec3Pool().getVecFromPool(((double)this.rand.nextFloat() - 0.5D) * 0.1D, Math.random() * 0.1D + 0.1D, 0.0D); + var4.rotateAroundX(-this.rotationPitch * (float)Math.PI / 180.0F); + var4.rotateAroundY(-this.rotationYaw * (float)Math.PI / 180.0F); +- Vec3 var5 = this.worldObj.getWorldVec3Pool().getVecFromPool(((double)this.ab.nextFloat() - 0.5D) * 0.3D, (double)(-this.ab.nextFloat()) * 0.6D - 0.3D, 0.6D); ++ Vec3 var5 = this.worldObj.getWorldVec3Pool().getVecFromPool(((double)this.rand.nextFloat() - 0.5D) * 0.3D, (double)(-this.rand.nextFloat()) * 0.6D - 0.3D, 0.6D); + var5.rotateAroundX(-this.rotationPitch * (float)Math.PI / 180.0F); + var5.rotateAroundY(-this.rotationYaw * (float)Math.PI / 180.0F); + var5 = var5.addVector(this.posX, this.posY + (double)this.getEyeHeight(), this.posZ); +- this.worldObj.spawnParticle("iconcrack_" + var1.getItem().itemID, var5.xCoord, var5.yCoord, var5.zCoord, var4.xCoord, var4.yCoord + 0.05D, var4.zCoord); ++ // Spout Start ++ if (par1ItemStack.itemID == 318) { ++ BlockDesign design = null; ++ Texture texture = null; ++ org.spoutcraft.api.material.CustomItem item = MaterialData.getCustomItem(par1ItemStack.getItemDamage()); ++ if (item != null) { ++ String textureURI = item.getTexture(); ++ if (textureURI == null) { ++ org.spoutcraft.api.material.CustomBlock block = MaterialData.getCustomBlock(par1ItemStack.getItemDamage()); ++ design = block != null ? block.getBlockDesign() : null; ++ textureURI = design != null ? design.getTextureURL() : null; ++ } ++ if (textureURI != null) { ++ texture = CustomTextureManager.getTextureFromUrl(item.getAddon(), textureURI); ++ } ++ } ++ this.worldObj.spawnParticle("iconcrack_" + par1ItemStack.getItem().itemID, var5.xCoord, var5.yCoord, var5.zCoord, var4.xCoord, var4.yCoord + 0.05D, var4.zCoord, texture); ++ } else { ++ this.worldObj.spawnParticle("iconcrack_" + par1ItemStack.getItem().itemID, var5.xCoord, var5.yCoord, var5.zCoord, var4.xCoord, var4.yCoord + 0.05D, var4.zCoord); ++ } ++ // Spout End + } + +- this.playSound("random.eat", 0.5F + 0.5F * (float)this.ab.nextInt(2), (this.ab.nextFloat() - this.ab.nextFloat()) * 0.2F + 1.0F); ++ this.playSound("random.eat", 0.5F + 0.5F * (float)this.rand.nextInt(2), (this.rand.nextFloat() - this.rand.nextFloat()) * 0.2F + 1.0F); + } +- + } + ++ /** ++ * Used for when item use count runs out, ie: eating completed ++ */ + protected void onItemUseFinish() { +- if(this.itemInUse != null) { ++ if (this.itemInUse != null) { + this.updateItemUse(this.itemInUse, 16); + int var1 = this.itemInUse.stackSize; + ItemStack var2 = this.itemInUse.onFoodEaten(this.worldObj, this); +- if(var2 != this.itemInUse || var2 != null && var2.stackSize != var1) { ++ ++ if (var2 != this.itemInUse || var2 != null && var2.stackSize != var1) { + this.inventory.mainInventory[this.inventory.currentItem] = var2; +- if(var2.stackSize == 0) { ++ ++ if (var2.stackSize == 0) { + this.inventory.mainInventory[this.inventory.currentItem] = null; + } + } + + this.clearItemInUse(); + } +- + } + +- public void handleHealthUpdate(byte var1) { +- if(var1 == 9) { ++ public void handleHealthUpdate(byte par1) { ++ if (par1 == 9) { + this.onItemUseFinish(); + } else { +- super.handleHealthUpdate(var1); ++ super.handleHealthUpdate(par1); + } +- + } + ++ /** ++ * Dead and sleeping entities cannot move ++ */ + protected boolean isMovementBlocked() { + return this.getHealth() <= 0.0F || this.isPlayerSleeping(); + } + ++ /** ++ * sets current screen to null (used on escape buttons of GUIs) ++ */ + protected void closeScreen() { + this.openContainer = this.inventoryContainer; + } + +- public void mountEntity(Entity var1) { +- if(this.ridingEntity != null && var1 == null) { +- if(!this.worldObj.isRemote) { ++ /** ++ * Called when a player mounts an entity. e.g. mounts a pig, mounts a boat. ++ */ ++ public void mountEntity(Entity par1Entity) { ++ if (this.ridingEntity != null && par1Entity == null) { ++ if (!this.worldObj.isRemote) { + this.dismountEntity(this.ridingEntity); + } + +- if(this.ridingEntity != null) { ++ if (this.ridingEntity != null) { + this.ridingEntity.riddenByEntity = null; + } + + this.ridingEntity = null; + } else { +- super.mountEntity(var1); ++ super.mountEntity(par1Entity); + } + } + ++ /** ++ * Handles updating while being ridden by an entity ++ */ + public void updateRidden() { +- if(!this.worldObj.isRemote && this.isSneaking()) { ++ if (!this.worldObj.isRemote && this.isSneaking()) { + this.mountEntity((Entity)null); + this.setSneaking(false); + } else { +@@ -295,15 +452,19 @@ + this.prevCameraYaw = this.cameraYaw; + this.cameraYaw = 0.0F; + this.addMountedMovementStat(this.posX - var1, this.posY - var3, this.posZ - var5); +- if(this.ridingEntity instanceof EntityPig) { ++ ++ if (this.ridingEntity instanceof EntityPig) { + this.rotationPitch = var8; + this.rotationYaw = var7; + this.renderYawOffset = ((EntityPig)this.ridingEntity).renderYawOffset; + } +- + } + } + ++ /** ++ * Keeps moving the entity up so it isn't colliding with blocks and other requirements for this entity to be spawned ++ * (only actually used on players though its also on Entity) ++ */ + public void preparePlayerToSpawn() { + this.yOffset = 1.62F; + this.setSize(0.6F, 1.8F); +@@ -317,97 +478,120 @@ + this.updateArmSwingProgress(); + } + ++ /** ++ * Called frequently so the entity can update its state every tick as required. For example, zombies and skeletons use ++ * this to react to sunlight and start to burn. ++ */ + public void onLivingUpdate() { +- if(this.flyToggleTimer > 0) { ++ if (this.flyToggleTimer > 0) { + --this.flyToggleTimer; + } + +- if(this.worldObj.difficultySetting == 0 && this.getHealth() < this.getMaxHealth() && this.worldObj.getGameRules().getGameRuleBooleanValue("naturalRegeneration") && this.ticksExisted % 20 * 12 == 0) { ++ if (this.worldObj.difficultySetting == 0 && this.getHealth() < this.getMaxHealth() && this.worldObj.getGameRules().getGameRuleBooleanValue("naturalRegeneration") && this.ticksExisted % 20 * 12 == 0) { + this.heal(1.0F); + } + + this.inventory.decrementAnimations(); + this.prevCameraYaw = this.cameraYaw; + super.onLivingUpdate(); ++ + AttributeInstance var1 = this.getEntityAttribute(SharedMonsterAttributes.movementSpeed); +- if(!this.worldObj.isRemote) { ++ ++ if (!this.worldObj.isRemote) { + var1.setAttribute((double)this.capabilities.getWalkSpeed()); + } + + this.jumpMovementFactor = this.speedInAir; +- if(this.isSprinting()) { ++ ++ // Spout Start - No sprinting while moving backwards ++ if (this.isSprinting() && this.movementInput.moveForward >= 0F) { ++ // Spout End + this.jumpMovementFactor = (float)((double)this.jumpMovementFactor + (double)this.speedInAir * 0.3D); + } + + this.setAIMoveSpeed((float)var1.getAttributeValue()); + float var2 = MathHelper.sqrt_double(this.motionX * this.motionX + this.motionZ * this.motionZ); +- float var3 = (float)Math.atan(-this.motionY * (double)0.2F) * 15.0F; +- if(var2 > 0.1F) { ++ float var3 = (float)Math.atan(-this.motionY * 0.20000000298023224D) * 15.0F; ++ ++ if (var2 > 0.1F) { + var2 = 0.1F; + } + +- if(!this.onGround || this.getHealth() <= 0.0F) { ++ if (!this.onGround || this.getHealth() <= 0.0F) { + var2 = 0.0F; + } + +- if(this.onGround || this.getHealth() <= 0.0F) { ++ if (this.onGround || this.getHealth() <= 0.0F) { + var3 = 0.0F; + } + + this.cameraYaw += (var2 - this.cameraYaw) * 0.4F; + this.cameraPitch += (var3 - this.cameraPitch) * 0.8F; +- if(this.getHealth() > 0.0F) { ++ ++ if (this.getHealth() > 0.0F) { + AxisAlignedBB var4 = null; +- if(this.ridingEntity != null && !this.ridingEntity.isDead) { ++ ++ if (this.ridingEntity != null && !this.ridingEntity.isDead) { + var4 = this.boundingBox.func_111270_a(this.ridingEntity.boundingBox).expand(1.0D, 0.0D, 1.0D); + } else { + var4 = this.boundingBox.expand(1.0D, 0.5D, 1.0D); + } + + List var5 = this.worldObj.getEntitiesWithinAABBExcludingEntity(this, var4); +- if(var5 != null) { +- for(int var6 = 0; var6 < var5.size(); ++var6) { ++ ++ if (var5 != null) { ++ for (int var6 = 0; var6 < var5.size(); ++var6) { + Entity var7 = (Entity)var5.get(var6); +- if(!var7.isDead) { ++ ++ if (!var7.isDead) { + this.collideWithPlayer(var7); + } + } + } + } +- + } + +- private void collideWithPlayer(Entity var1) { +- var1.onCollideWithPlayer(this); ++ private void collideWithPlayer(Entity par1Entity) { ++ par1Entity.onCollideWithPlayer(this); + } + + public int getScore() { + return this.dataWatcher.getWatchableObjectInt(18); + } + +- public void setScore(int var1) { +- this.dataWatcher.updateObject(18, Integer.valueOf(var1)); ++ /** ++ * Set player's score ++ */ ++ public void setScore(int par1) { ++ this.dataWatcher.updateObject(18, Integer.valueOf(par1)); + } + +- public void addScore(int var1) { ++ /** ++ * Add to player's score ++ */ ++ public void addScore(int par1) { + int var2 = this.getScore(); +- this.dataWatcher.updateObject(18, Integer.valueOf(var2 + var1)); ++ this.dataWatcher.updateObject(18, Integer.valueOf(var2 + par1)); + } + +- public void onDeath(DamageSource var1) { +- super.onDeath(var1); ++ /** ++ * Called when the mob's health reaches 0. ++ */ ++ public void onDeath(DamageSource par1DamageSource) { ++ super.onDeath(par1DamageSource); + this.setSize(0.2F, 0.2F); + this.setPosition(this.posX, this.posY, this.posZ); +- this.motionY = (double)0.1F; +- if(this.bu.equals("Notch")) { ++ this.motionY = 0.10000000149011612D; ++ ++ if (this.username.equals("Notch")) { + this.dropPlayerItemWithRandomChoice(new ItemStack(Item.appleRed, 1), true); + } + +- if(!this.worldObj.getGameRules().getGameRuleBooleanValue("keepInventory")) { ++ if (!this.worldObj.getGameRules().getGameRuleBooleanValue("keepInventory")) { + this.inventory.dropAllItems(); + } + +- if(var1 != null) { ++ if (par1DamageSource != null) { + this.motionX = (double)(-MathHelper.cos((this.attackedAtYaw + this.rotationYaw) * (float)Math.PI / 180.0F) * 0.1F); + this.motionZ = (double)(-MathHelper.sin((this.attackedAtYaw + this.rotationYaw) * (float)Math.PI / 180.0F) * 0.1F); + } else { +@@ -418,10 +602,15 @@ + this.addStat(StatList.deathsStat, 1); + } + +- public void addToPlayerScore(Entity var1, int var2) { +- this.addScore(var2); ++ /** ++ * Adds a value to the player score. Currently not actually used and the entity passed in does nothing. Args: entity, ++ * scoreToAdd ++ */ ++ public void addToPlayerScore(Entity par1Entity, int par2) { ++ this.addScore(par2); + Collection var3 = this.getWorldScoreboard().func_96520_a(ScoreObjectiveCriteria.totalKillCount); +- if(var1 instanceof EntityPlayer) { ++ ++ if (par1Entity instanceof EntityPlayer) { + this.addStat(StatList.playerKillsStat, 1); + var3.addAll(this.getWorldScoreboard().func_96520_a(ScoreObjectiveCriteria.playerKillCount)); + } else { +@@ -430,48 +619,58 @@ + + Iterator var4 = var3.iterator(); + +- while(var4.hasNext()) { ++ while (var4.hasNext()) { + ScoreObjective var5 = (ScoreObjective)var4.next(); + Score var6 = this.getWorldScoreboard().func_96529_a(this.getEntityName(), var5); + var6.func_96648_a(); + } +- +- } +- +- public EntityItem dropOneItem(boolean var1) { +- return this.dropPlayerItemWithRandomChoice(this.inventory.decrStackSize(this.inventory.currentItem, var1 && this.inventory.getCurrentItem() != null ? this.inventory.getCurrentItem().stackSize : 1), false); +- } +- +- public EntityItem dropPlayerItem(ItemStack var1) { +- return this.dropPlayerItemWithRandomChoice(var1, false); +- } +- +- public EntityItem dropPlayerItemWithRandomChoice(ItemStack var1, boolean var2) { +- if(var1 == null) { ++ } ++ ++ /** ++ * Called when player presses the drop item key ++ */ ++ public EntityItem dropOneItem(boolean par1) { ++ return this.dropPlayerItemWithRandomChoice(this.inventory.decrStackSize(this.inventory.currentItem, par1 && this.inventory.getCurrentItem() != null ? this.inventory.getCurrentItem().stackSize : 1), false); ++ } ++ ++ /** ++ * Args: itemstack - called when player drops an item stack that's not in his inventory (like items still placed in a ++ * workbench while the workbench'es GUI gets closed) ++ */ ++ public EntityItem dropPlayerItem(ItemStack par1ItemStack) { ++ return this.dropPlayerItemWithRandomChoice(par1ItemStack, false); ++ } ++ ++ /** ++ * Args: itemstack, flag ++ */ ++ public EntityItem dropPlayerItemWithRandomChoice(ItemStack par1ItemStack, boolean par2) { ++ if (par1ItemStack == null) { + return null; +- } else if(var1.stackSize == 0) { ++ } else if (par1ItemStack.stackSize == 0) { + return null; + } else { +- EntityItem var3 = new EntityItem(this.worldObj, this.posX, this.posY - (double)0.3F + (double)this.getEyeHeight(), this.posZ, var1); ++ EntityItem var3 = new EntityItem(this.worldObj, this.posX, this.posY - 0.30000001192092896D + (double)this.getEyeHeight(), this.posZ, par1ItemStack); + var3.delayBeforeCanPickup = 40; + float var4 = 0.1F; + float var5; +- if(var2) { +- var5 = this.ab.nextFloat() * 0.5F; +- float var6 = this.ab.nextFloat() * (float)Math.PI * 2.0F; ++ ++ if (par2) { ++ var5 = this.rand.nextFloat() * 0.5F; ++ float var6 = this.rand.nextFloat() * (float)Math.PI * 2.0F; + var3.motionX = (double)(-MathHelper.sin(var6) * var5); + var3.motionZ = (double)(MathHelper.cos(var6) * var5); +- var3.motionY = (double)0.2F; ++ var3.motionY = 0.20000000298023224D; + } else { + var4 = 0.3F; + var3.motionX = (double)(-MathHelper.sin(this.rotationYaw / 180.0F * (float)Math.PI) * MathHelper.cos(this.rotationPitch / 180.0F * (float)Math.PI) * var4); + var3.motionZ = (double)(MathHelper.cos(this.rotationYaw / 180.0F * (float)Math.PI) * MathHelper.cos(this.rotationPitch / 180.0F * (float)Math.PI) * var4); + var3.motionY = (double)(-MathHelper.sin(this.rotationPitch / 180.0F * (float)Math.PI) * var4 + 0.1F); + var4 = 0.02F; +- var5 = this.ab.nextFloat() * (float)Math.PI * 2.0F; +- var4 *= this.ab.nextFloat(); ++ var5 = this.rand.nextFloat() * (float)Math.PI * 2.0F; ++ var4 *= this.rand.nextFloat(); + var3.motionX += Math.cos((double)var5) * (double)var4; +- var3.motionY += (double)((this.ab.nextFloat() - this.ab.nextFloat()) * 0.1F); ++ var3.motionY += (double)((this.rand.nextFloat() - this.rand.nextFloat()) * 0.1F); + var3.motionZ += Math.sin((double)var5) * (double)var4; + } + +@@ -481,18 +680,27 @@ + } + } + +- protected void joinEntityItemWithWorld(EntityItem var1) { +- this.worldObj.spawnEntityInWorld(var1); ++ /** ++ * Joins the passed in entity item with the world. Args: entityItem ++ */ ++ protected void joinEntityItemWithWorld(EntityItem par1EntityItem) { ++ this.worldObj.spawnEntityInWorld(par1EntityItem); + } + +- public float getCurrentPlayerStrVsBlock(Block var1, boolean var2) { +- float var3 = this.inventory.getStrVsBlock(var1); +- if(var3 > 1.0F) { ++ /** ++ * Returns how strong the player is against the specified block at this moment ++ */ ++ public float getCurrentPlayerStrVsBlock(Block par1Block, boolean par2) { ++ float var3 = this.inventory.getStrVsBlock(par1Block); ++ ++ if (var3 > 1.0F) { + int var4 = EnchantmentHelper.getEfficiencyModifier(this); + ItemStack var5 = this.inventory.getCurrentItem(); +- if(var4 > 0 && var5 != null) { ++ ++ if (var4 > 0 && var5 != null) { + float var6 = (float)(var4 * var4 + 1); +- if(!var5.canHarvestBlock(var1) && var3 <= 1.0F) { ++ ++ if (!var5.canHarvestBlock(par1Block) && var3 <= 1.0F) { + var3 += var6 * 0.08F; + } else { + var3 += var6; +@@ -500,175 +708,204 @@ + } + } + +- if(this.isPotionActive(Potion.digSpeed)) { ++ if (this.isPotionActive(Potion.digSpeed)) { + var3 *= 1.0F + (float)(this.getActivePotionEffect(Potion.digSpeed).getAmplifier() + 1) * 0.2F; + } + +- if(this.isPotionActive(Potion.digSlowdown)) { ++ if (this.isPotionActive(Potion.digSlowdown)) { + var3 *= 1.0F - (float)(this.getActivePotionEffect(Potion.digSlowdown).getAmplifier() + 1) * 0.2F; + } + +- if(this.isInsideOfMaterial(Material.water) && !EnchantmentHelper.getAquaAffinityModifier(this)) { ++ if (this.isInsideOfMaterial(Material.water) && !EnchantmentHelper.getAquaAffinityModifier(this)) { + var3 /= 5.0F; + } + +- if(!this.onGround) { ++ if (!this.onGround) { + var3 /= 5.0F; + } + + return var3; + } + +- public boolean canHarvestBlock(Block var1) { +- return this.inventory.canHarvestBlock(var1); ++ /** ++ * Checks if the player has the ability to harvest a block (checks current inventory item for a tool if necessary) ++ */ ++ public boolean canHarvestBlock(Block par1Block) { ++ return this.inventory.canHarvestBlock(par1Block); + } + +- public void readEntityFromNBT(NBTTagCompound var1) { +- super.readEntityFromNBT(var1); +- NBTTagList var2 = var1.getTagList("Inventory"); ++ /** ++ * (abstract) Protected helper method to read subclass entity data from NBT. ++ */ ++ public void readEntityFromNBT(NBTTagCompound par1NBTTagCompound) { ++ super.readEntityFromNBT(par1NBTTagCompound); ++ NBTTagList var2 = par1NBTTagCompound.getTagList("Inventory"); + this.inventory.readFromNBT(var2); +- this.inventory.currentItem = var1.getInteger("SelectedItemSlot"); +- this.sleeping = var1.getBoolean("Sleeping"); +- this.sleepTimer = var1.getShort("SleepTimer"); +- this.experience = var1.getFloat("XpP"); +- this.experienceLevel = var1.getInteger("XpLevel"); +- this.experienceTotal = var1.getInteger("XpTotal"); +- this.setScore(var1.getInteger("Score")); +- if(this.sleeping) { ++ this.inventory.currentItem = par1NBTTagCompound.getInteger("SelectedItemSlot"); ++ this.sleeping = par1NBTTagCompound.getBoolean("Sleeping"); ++ this.sleepTimer = par1NBTTagCompound.getShort("SleepTimer"); ++ this.experience = par1NBTTagCompound.getFloat("XpP"); ++ this.experienceLevel = par1NBTTagCompound.getInteger("XpLevel"); ++ this.experienceTotal = par1NBTTagCompound.getInteger("XpTotal"); ++ this.setScore(par1NBTTagCompound.getInteger("Score")); ++ ++ if (this.sleeping) { + this.playerLocation = new ChunkCoordinates(MathHelper.floor_double(this.posX), MathHelper.floor_double(this.posY), MathHelper.floor_double(this.posZ)); + this.wakeUpPlayer(true, true, false); + } + +- if(var1.hasKey("SpawnX") && var1.hasKey("SpawnY") && var1.hasKey("SpawnZ")) { +- this.spawnChunk = new ChunkCoordinates(var1.getInteger("SpawnX"), var1.getInteger("SpawnY"), var1.getInteger("SpawnZ")); +- this.spawnForced = var1.getBoolean("SpawnForced"); ++ if (par1NBTTagCompound.hasKey("SpawnX") && par1NBTTagCompound.hasKey("SpawnY") && par1NBTTagCompound.hasKey("SpawnZ")) { ++ this.spawnChunk = new ChunkCoordinates(par1NBTTagCompound.getInteger("SpawnX"), par1NBTTagCompound.getInteger("SpawnY"), par1NBTTagCompound.getInteger("SpawnZ")); ++ this.spawnForced = par1NBTTagCompound.getBoolean("SpawnForced"); + } + +- this.foodStats.readNBT(var1); +- this.capabilities.readCapabilitiesFromNBT(var1); +- if(var1.hasKey("EnderItems")) { +- NBTTagList var3 = var1.getTagList("EnderItems"); ++ this.foodStats.readNBT(par1NBTTagCompound); ++ this.capabilities.readCapabilitiesFromNBT(par1NBTTagCompound); ++ ++ if (par1NBTTagCompound.hasKey("EnderItems")) { ++ NBTTagList var3 = par1NBTTagCompound.getTagList("EnderItems"); + this.theInventoryEnderChest.loadInventoryFromNBT(var3); + } +- + } + +- public void writeEntityToNBT(NBTTagCompound var1) { +- super.writeEntityToNBT(var1); +- var1.setTag("Inventory", this.inventory.writeToNBT(new NBTTagList())); +- var1.setInteger("SelectedItemSlot", this.inventory.currentItem); +- var1.setBoolean("Sleeping", this.sleeping); +- var1.setShort("SleepTimer", (short)this.sleepTimer); +- var1.setFloat("XpP", this.experience); +- var1.setInteger("XpLevel", this.experienceLevel); +- var1.setInteger("XpTotal", this.experienceTotal); +- var1.setInteger("Score", this.getScore()); +- if(this.spawnChunk != null) { +- var1.setInteger("SpawnX", this.spawnChunk.posX); +- var1.setInteger("SpawnY", this.spawnChunk.posY); +- var1.setInteger("SpawnZ", this.spawnChunk.posZ); +- var1.setBoolean("SpawnForced", this.spawnForced); ++ /** ++ * (abstract) Protected helper method to write subclass entity data to NBT. ++ */ ++ public void writeEntityToNBT(NBTTagCompound par1NBTTagCompound) { ++ super.writeEntityToNBT(par1NBTTagCompound); ++ par1NBTTagCompound.setTag("Inventory", this.inventory.writeToNBT(new NBTTagList())); ++ par1NBTTagCompound.setInteger("SelectedItemSlot", this.inventory.currentItem); ++ par1NBTTagCompound.setBoolean("Sleeping", this.sleeping); ++ par1NBTTagCompound.setShort("SleepTimer", (short)this.sleepTimer); ++ par1NBTTagCompound.setFloat("XpP", this.experience); ++ par1NBTTagCompound.setInteger("XpLevel", this.experienceLevel); ++ par1NBTTagCompound.setInteger("XpTotal", this.experienceTotal); ++ par1NBTTagCompound.setInteger("Score", this.getScore()); ++ ++ if (this.spawnChunk != null) { ++ par1NBTTagCompound.setInteger("SpawnX", this.spawnChunk.posX); ++ par1NBTTagCompound.setInteger("SpawnY", this.spawnChunk.posY); ++ par1NBTTagCompound.setInteger("SpawnZ", this.spawnChunk.posZ); ++ par1NBTTagCompound.setBoolean("SpawnForced", this.spawnForced); + } + +- this.foodStats.writeNBT(var1); +- this.capabilities.writeCapabilitiesToNBT(var1); +- var1.setTag("EnderItems", this.theInventoryEnderChest.saveInventoryToNBT()); +- } +- +- public void displayGUIChest(IInventory var1) { +- } +- +- public void displayGUIHopper(TileEntityHopper var1) { +- } +- +- public void displayGUIHopperMinecart(EntityMinecartHopper var1) { +- } +- +- public void displayGUIHorse(EntityHorse var1, IInventory var2) { +- } +- +- public void displayGUIEnchantment(int var1, int var2, int var3, String var4) { +- } +- +- public void displayGUIAnvil(int var1, int var2, int var3) { +- } +- +- public void displayGUIWorkbench(int var1, int var2, int var3) { +- } ++ this.foodStats.writeNBT(par1NBTTagCompound); ++ this.capabilities.writeCapabilitiesToNBT(par1NBTTagCompound); ++ par1NBTTagCompound.setTag("EnderItems", this.theInventoryEnderChest.saveInventoryToNBT()); ++ } ++ ++ /** ++ * Displays the GUI for interacting with a chest inventory. Args: chestInventory ++ */ ++ public void displayGUIChest(IInventory par1IInventory) {} ++ ++ public void displayGUIHopper(TileEntityHopper par1TileEntityHopper) {} ++ ++ public void displayGUIHopperMinecart(EntityMinecartHopper par1EntityMinecartHopper) {} ++ ++ public void displayGUIHorse(EntityHorse par1EntityHorse, IInventory par2IInventory) {} ++ ++ public void displayGUIEnchantment(int par1, int par2, int par3, String par4Str) {} ++ ++ /** ++ * Displays the GUI for interacting with an anvil. ++ */ ++ public void displayGUIAnvil(int par1, int par2, int par3) {} ++ ++ /** ++ * Displays the crafting GUI for a workbench. ++ */ ++ public void displayGUIWorkbench(int par1, int par2, int par3) {} + + public float getEyeHeight() { + return 0.12F; + } + ++ /** ++ * sets the players height back to normal after doing things like sleeping and dieing ++ */ + protected void resetHeight() { + this.yOffset = 1.62F; + } + +- public boolean attackEntityFrom(DamageSource var1, float var2) { +- if(this.isEntityInvulnerable()) { ++ /** ++ * Called when the entity is attacked. ++ */ ++ public boolean attackEntityFrom(DamageSource par1DamageSource, float par2) { ++ if (this.isEntityInvulnerable()) { + return false; +- } else if(this.capabilities.disableDamage && !var1.canHarmInCreative()) { ++ } else if (this.capabilities.disableDamage && !par1DamageSource.canHarmInCreative()) { + return false; + } else { + this.entityAge = 0; +- if(this.getHealth() <= 0.0F) { ++ ++ if (this.getHealth() <= 0.0F) { + return false; + } else { +- if(this.isPlayerSleeping() && !this.worldObj.isRemote) { ++ if (this.isPlayerSleeping() && !this.worldObj.isRemote) { + this.wakeUpPlayer(true, true, false); + } + +- if(var1.isDifficultyScaled()) { +- if(this.worldObj.difficultySetting == 0) { +- var2 = 0.0F; +- } +- +- if(this.worldObj.difficultySetting == 1) { +- var2 = var2 / 2.0F + 1.0F; +- } +- +- if(this.worldObj.difficultySetting == 3) { +- var2 = var2 * 3.0F / 2.0F; ++ if (par1DamageSource.isDifficultyScaled()) { ++ if (this.worldObj.difficultySetting == 0) { ++ par2 = 0.0F; ++ } ++ ++ if (this.worldObj.difficultySetting == 1) { ++ par2 = par2 / 2.0F + 1.0F; ++ } ++ ++ if (this.worldObj.difficultySetting == 3) { ++ par2 = par2 * 3.0F / 2.0F; + } + } + +- if(var2 == 0.0F) { ++ if (par2 == 0.0F) { + return false; + } else { +- Entity var3 = var1.getEntity(); +- if(var3 instanceof EntityArrow && ((EntityArrow)var3).shootingEntity != null) { ++ Entity var3 = par1DamageSource.getEntity(); ++ ++ if (var3 instanceof EntityArrow && ((EntityArrow)var3).shootingEntity != null) { + var3 = ((EntityArrow)var3).shootingEntity; + } + +- this.addStat(StatList.damageTakenStat, Math.round(var2 * 10.0F)); +- return super.attackEntityFrom(var1, var2); ++ this.addStat(StatList.damageTakenStat, Math.round(par2 * 10.0F)); ++ return super.attackEntityFrom(par1DamageSource, par2); + } + } + } + } + +- public boolean canAttackPlayer(EntityPlayer var1) { ++ public boolean canAttackPlayer(EntityPlayer par1EntityPlayer) { + Team var2 = this.getTeam(); +- Team var3 = var1.getTeam(); ++ Team var3 = par1EntityPlayer.getTeam(); + return var2 == null ? true : (!var2.isSameTeam(var3) ? true : var2.getAllowFriendlyFire()); + } + +- protected void damageArmor(float var1) { +- this.inventory.damageArmor(var1); ++ protected void damageArmor(float par1) { ++ this.inventory.damageArmor(par1); + } + ++ /** ++ * Returns the current armor value as determined by a call to InventoryPlayer.getTotalArmorValue ++ */ + public int getTotalArmorValue() { + return this.inventory.getTotalArmorValue(); + } + ++ /** ++ * When searching for vulnerable players, if a player is invisible, the return value of this is the chance of seeing ++ * them anyway. ++ */ + public float getArmorVisibility() { + int var1 = 0; + ItemStack[] var2 = this.inventory.armorInventory; + int var3 = var2.length; + +- for(int var4 = 0; var4 < var3; ++var4) { ++ for (int var4 = 0; var4 < var3; ++var4) { + ItemStack var5 = var2[var4]; +- if(var5 != null) { ++ ++ if (var5 != null) { + ++var1; + } + } +@@ -676,58 +913,77 @@ + return (float)var1 / (float)this.inventory.armorInventory.length; + } + +- protected void damageEntity(DamageSource var1, float var2) { +- if(!this.isEntityInvulnerable()) { +- if(!var1.isUnblockable() && this.isBlocking() && var2 > 0.0F) { +- var2 = (1.0F + var2) * 0.5F; ++ /** ++ * Deals damage to the entity. If its a EntityPlayer then will take damage from the armor first and then health second ++ * with the reduced value. Args: damageAmount ++ */ ++ // Spout Start - protected to public ++ public void damageEntity(DamageSource par1DamageSource, float par2) { ++ // Spout End ++ if (!this.isEntityInvulnerable()) { ++ if (!par1DamageSource.isUnblockable() && this.isBlocking() && par2 > 0.0F) { ++ par2 = (1.0F + par2) * 0.5F; + } + +- var2 = this.applyArmorCalculations(var1, var2); +- var2 = this.applyPotionDamageCalculations(var1, var2); +- float var3 = var2; +- var2 = Math.max(var2 - this.getAbsorptionAmount(), 0.0F); +- this.setAbsorptionAmount(this.getAbsorptionAmount() - (var3 - var2)); +- if(var2 != 0.0F) { +- this.addExhaustion(var1.getHungerDamage()); ++ par2 = this.applyArmorCalculations(par1DamageSource, par2); ++ par2 = this.applyPotionDamageCalculations(par1DamageSource, par2); ++ float var3 = par2; ++ par2 = Math.max(par2 - this.getAbsorptionAmount(), 0.0F); ++ this.setAbsorptionAmount(this.getAbsorptionAmount() - (var3 - par2)); ++ ++ if (par2 != 0.0F) { ++ this.addExhaustion(par1DamageSource.getHungerDamage()); + float var4 = this.getHealth(); +- this.setHealth(this.getHealth() - var2); +- this.func_110142_aN().func_94547_a(var1, var4, var2); ++ this.setHealth(this.getHealth() - par2); ++ this.func_110142_aN().func_94547_a(par1DamageSource, var4, par2); + } + } + } + +- public void displayGUIFurnace(TileEntityFurnace var1) { +- } +- +- public void displayGUIDispenser(TileEntityDispenser var1) { +- } +- +- public void displayGUIEditSign(TileEntity var1) { +- } +- +- public void displayGUIBrewingStand(TileEntityBrewingStand var1) { +- } +- +- public void displayGUIBeacon(TileEntityBeacon var1) { +- } +- +- public void displayGUIMerchant(IMerchant var1, String var2) { +- } +- +- public void displayGUIBook(ItemStack var1) { +- } +- +- public boolean interactWith(Entity var1) { ++ /** ++ * Displays the furnace GUI for the passed in furnace entity. Args: tileEntityFurnace ++ */ ++ public void displayGUIFurnace(TileEntityFurnace par1TileEntityFurnace) {} ++ ++ /** ++ * Displays the dipsenser GUI for the passed in dispenser entity. Args: TileEntityDispenser ++ */ ++ public void displayGUIDispenser(TileEntityDispenser par1TileEntityDispenser) {} ++ ++ /** ++ * Displays the GUI for editing a sign. Args: tileEntitySign ++ */ ++ public void displayGUIEditSign(TileEntity par1TileEntity) {} ++ ++ /** ++ * Displays the GUI for interacting with a brewing stand. ++ */ ++ public void displayGUIBrewingStand(TileEntityBrewingStand par1TileEntityBrewingStand) {} ++ ++ /** ++ * Displays the GUI for interacting with a beacon. ++ */ ++ public void displayGUIBeacon(TileEntityBeacon par1TileEntityBeacon) {} ++ ++ public void displayGUIMerchant(IMerchant par1IMerchant, String par2Str) {} ++ ++ /** ++ * Displays the GUI for interacting with a book. ++ */ ++ public void displayGUIBook(ItemStack par1ItemStack) {} ++ ++ public boolean interactWith(Entity par1Entity) { + ItemStack var2 = this.getCurrentEquippedItem(); + ItemStack var3 = var2 != null ? var2.copy() : null; +- if(!var1.interactFirst(this)) { +- if(var2 != null && var1 instanceof EntityLivingBase) { +- if(this.capabilities.isCreativeMode) { ++ ++ if (!par1Entity.interactFirst(this)) { ++ if (var2 != null && par1Entity instanceof EntityLivingBase) { ++ if (this.capabilities.isCreativeMode) { + var2 = var3; + } + +- if(var2.func_111282_a(this, (EntityLivingBase)var1)) { +- if(var2.stackSize <= 0 && !this.capabilities.isCreativeMode) { ++ if (var2.func_111282_a(this, (EntityLivingBase)par1Entity)) { ++ if (var2.stackSize <= 0 && !this.capabilities.isCreativeMode) { + this.destroyCurrentEquippedItem(); + } + +@@ -737,10 +993,10 @@ + + return false; + } else { +- if(var2 != null && var2 == this.getCurrentEquippedItem()) { +- if(var2.stackSize <= 0 && !this.capabilities.isCreativeMode) { ++ if (var2 != null && var2 == this.getCurrentEquippedItem()) { ++ if (var2.stackSize <= 0 && !this.capabilities.isCreativeMode) { + this.destroyCurrentEquippedItem(); +- } else if(var2.stackSize < var3.stackSize && this.capabilities.isCreativeMode) { ++ } else if (var2.stackSize < var3.stackSize && this.capabilities.isCreativeMode) { + var2.stackSize = var3.stackSize; + } + } +@@ -749,224 +1005,269 @@ + } + } + ++ /** ++ * Returns the currently being used item by the player. ++ */ + public ItemStack getCurrentEquippedItem() { + return this.inventory.getCurrentItem(); + } + ++ /** ++ * Destroys the currently equipped item from the player's inventory. ++ */ + public void destroyCurrentEquippedItem() { + this.inventory.setInventorySlotContents(this.inventory.currentItem, (ItemStack)null); + } + ++ /** ++ * Returns the Y Offset of this entity. ++ */ + public double getYOffset() { + return (double)(this.yOffset - 0.5F); + } + +- public void attackTargetEntityWithCurrentItem(Entity var1) { +- if(var1.canAttackWithItem()) { +- if(!var1.hitByEntity(this)) { ++ /** ++ * Attacks for the player the targeted entity with the currently equipped item. The equipped item has hitEntity called ++ * on it. Args: targetEntity ++ */ ++ public void attackTargetEntityWithCurrentItem(Entity par1Entity) { ++ if (par1Entity.canAttackWithItem()) { ++ if (!par1Entity.hitByEntity(this)) { + float var2 = (float)this.getEntityAttribute(SharedMonsterAttributes.attackDamage).getAttributeValue(); + int var3 = 0; + float var4 = 0.0F; +- if(var1 instanceof EntityLivingBase) { +- var4 = EnchantmentHelper.getEnchantmentModifierLiving(this, (EntityLivingBase)var1); +- var3 += EnchantmentHelper.getKnockbackModifier(this, (EntityLivingBase)var1); ++ ++ if (par1Entity instanceof EntityLivingBase) { ++ var4 = EnchantmentHelper.getEnchantmentModifierLiving(this, (EntityLivingBase)par1Entity); ++ var3 += EnchantmentHelper.getKnockbackModifier(this, (EntityLivingBase)par1Entity); + } + +- if(this.isSprinting()) { ++ if (this.isSprinting()) { + ++var3; + } + +- if(var2 > 0.0F || var4 > 0.0F) { +- boolean var5 = this.fallDistance > 0.0F && !this.onGround && !this.isOnLadder() && !this.isInWater() && !this.isPotionActive(Potion.blindness) && this.ridingEntity == null && var1 instanceof EntityLivingBase; +- if(var5 && var2 > 0.0F) { ++ if (var2 > 0.0F || var4 > 0.0F) { ++ boolean var5 = this.fallDistance > 0.0F && !this.onGround && !this.isOnLadder() && !this.isInWater() && !this.isPotionActive(Potion.blindness) && this.ridingEntity == null && par1Entity instanceof EntityLivingBase; ++ ++ if (var5 && var2 > 0.0F) { + var2 *= 1.5F; + } + + var2 += var4; + boolean var6 = false; + int var7 = EnchantmentHelper.getFireAspectModifier(this); +- if(var1 instanceof EntityLivingBase && var7 > 0 && !var1.isBurning()) { ++ ++ if (par1Entity instanceof EntityLivingBase && var7 > 0 && !par1Entity.isBurning()) { + var6 = true; +- var1.setFire(1); ++ par1Entity.setFire(1); + } + +- boolean var8 = var1.attackEntityFrom(DamageSource.causePlayerDamage(this), var2); +- if(var8) { +- if(var3 > 0) { +- var1.addVelocity((double)(-MathHelper.sin(this.rotationYaw * (float)Math.PI / 180.0F) * (float)var3 * 0.5F), 0.1D, (double)(MathHelper.cos(this.rotationYaw * (float)Math.PI / 180.0F) * (float)var3 * 0.5F)); ++ boolean var8 = par1Entity.attackEntityFrom(DamageSource.causePlayerDamage(this), var2); ++ ++ if (var8) { ++ if (var3 > 0) { ++ par1Entity.addVelocity((double)(-MathHelper.sin(this.rotationYaw * (float)Math.PI / 180.0F) * (float)var3 * 0.5F), 0.1D, (double)(MathHelper.cos(this.rotationYaw * (float)Math.PI / 180.0F) * (float)var3 * 0.5F)); + this.motionX *= 0.6D; + this.motionZ *= 0.6D; + this.setSprinting(false); + } + +- if(var5) { +- this.onCriticalHit(var1); +- } +- +- if(var4 > 0.0F) { +- this.onEnchantmentCritical(var1); +- } +- +- if(var2 >= 18.0F) { ++ if (var5) { ++ this.onCriticalHit(par1Entity); ++ } ++ ++ if (var4 > 0.0F) { ++ this.onEnchantmentCritical(par1Entity); ++ } ++ ++ if (var2 >= 18.0F) { + this.triggerAchievement(AchievementList.overkill); + } + +- this.setLastAttacker(var1); +- if(var1 instanceof EntityLivingBase) { +- EnchantmentThorns.func_92096_a(this, (EntityLivingBase)var1, this.ab); ++ this.setLastAttacker(par1Entity); ++ ++ if (par1Entity instanceof EntityLivingBase) { ++ EnchantmentThorns.func_92096_a(this, (EntityLivingBase)par1Entity, this.rand); + } + } + + ItemStack var9 = this.getCurrentEquippedItem(); +- Object var10 = var1; +- if(var1 instanceof EntityDragonPart) { +- IEntityMultiPart var11 = ((EntityDragonPart)var1).entityDragonObj; +- if(var11 != null && var11 instanceof EntityLivingBase) { ++ Object var10 = par1Entity; ++ ++ if (par1Entity instanceof EntityDragonPart) { ++ IEntityMultiPart var11 = ((EntityDragonPart)par1Entity).entityDragonObj; ++ ++ if (var11 != null && var11 instanceof EntityLivingBase) { + var10 = (EntityLivingBase)var11; + } + } + +- if(var9 != null && var10 instanceof EntityLivingBase) { ++ if (var9 != null && var10 instanceof EntityLivingBase) { + var9.hitEntity((EntityLivingBase)var10, this); +- if(var9.stackSize <= 0) { ++ ++ if (var9.stackSize <= 0) { + this.destroyCurrentEquippedItem(); + } + } + +- if(var1 instanceof EntityLivingBase) { ++ if (par1Entity instanceof EntityLivingBase) { + this.addStat(StatList.damageDealtStat, Math.round(var2 * 10.0F)); +- if(var7 > 0 && var8) { +- var1.setFire(var7 * 4); +- } else if(var6) { +- var1.extinguish(); ++ ++ if (var7 > 0 && var8) { ++ par1Entity.setFire(var7 * 4); ++ } else if (var6) { ++ par1Entity.extinguish(); + } + } + + this.addExhaustion(0.3F); + } +- + } + } + } + +- public void onCriticalHit(Entity var1) { +- } +- +- public void onEnchantmentCritical(Entity var1) { +- } +- +- public void respawnPlayer() { +- } +- ++ /** ++ * Called when the player performs a critical hit on the Entity. Args: entity that was hit critically ++ */ ++ public void onCriticalHit(Entity par1Entity) {} ++ ++ public void onEnchantmentCritical(Entity par1Entity) {} ++ ++ public void respawnPlayer() {} ++ ++ /** ++ * Will get destroyed next tick. ++ */ + public void setDead() { + super.setDead(); + this.inventoryContainer.onContainerClosed(this); +- if(this.openContainer != null) { ++ ++ if (this.openContainer != null) { + this.openContainer.onContainerClosed(this); + } +- + } + ++ /** ++ * Checks if this entity is inside of an opaque block ++ */ + public boolean isEntityInsideOpaqueBlock() { + return !this.sleeping && super.isEntityInsideOpaqueBlock(); + } + +- public EnumStatus sleepInBedAt(int var1, int var2, int var3) { +- if(!this.worldObj.isRemote) { +- if(this.isPlayerSleeping() || !this.isEntityAlive()) { ++ /** ++ * Attempts to have the player sleep in a bed at the specified location. ++ */ ++ public EnumStatus sleepInBedAt(int par1, int par2, int par3) { ++ if (!this.worldObj.isRemote) { ++ if (this.isPlayerSleeping() || !this.isEntityAlive()) { + return EnumStatus.OTHER_PROBLEM; + } + +- if(!this.worldObj.provider.isSurfaceWorld()) { ++ if (!this.worldObj.provider.isSurfaceWorld()) { + return EnumStatus.NOT_POSSIBLE_HERE; + } + +- if(this.worldObj.isDaytime()) { ++ if (this.worldObj.isDaytime()) { + return EnumStatus.NOT_POSSIBLE_NOW; + } + +- if(Math.abs(this.posX - (double)var1) > 3.0D || Math.abs(this.posY - (double)var2) > 2.0D || Math.abs(this.posZ - (double)var3) > 3.0D) { ++ if (Math.abs(this.posX - (double)par1) > 3.0D || Math.abs(this.posY - (double)par2) > 2.0D || Math.abs(this.posZ - (double)par3) > 3.0D) { + return EnumStatus.TOO_FAR_AWAY; + } + + double var4 = 8.0D; + double var6 = 5.0D; +- List var8 = this.worldObj.getEntitiesWithinAABB(EntityMob.class, AxisAlignedBB.getAABBPool().getAABB((double)var1 - var4, (double)var2 - var6, (double)var3 - var4, (double)var1 + var4, (double)var2 + var6, (double)var3 + var4)); +- if(!var8.isEmpty()) { ++ List var8 = this.worldObj.getEntitiesWithinAABB(EntityMob.class, AxisAlignedBB.getAABBPool().getAABB((double)par1 - var4, (double)par2 - var6, (double)par3 - var4, (double)par1 + var4, (double)par2 + var6, (double)par3 + var4)); ++ ++ if (!var8.isEmpty()) { + return EnumStatus.NOT_SAFE; + } + } + +- if(this.isRiding()) { ++ if (this.isRiding()) { + this.mountEntity((Entity)null); + } + + this.setSize(0.2F, 0.2F); + this.yOffset = 0.2F; +- if(this.worldObj.blockExists(var1, var2, var3)) { +- int var9 = this.worldObj.getBlockMetadata(var1, var2, var3); +- int var5 = BlockBed.getDirection(var9); +- float var10 = 0.5F; ++ ++ if (this.worldObj.blockExists(par1, par2, par3)) { ++ int var10 = this.worldObj.getBlockMetadata(par1, par2, par3); ++ int var5 = BlockBed.getDirection(var10); ++ float var9 = 0.5F; + float var7 = 0.5F; +- switch(var5) { ++ ++ switch (var5) { + case 0: + var7 = 0.9F; + break; ++ + case 1: +- var10 = 0.1F; ++ var9 = 0.1F; + break; ++ + case 2: + var7 = 0.1F; + break; ++ + case 3: +- var10 = 0.9F; ++ var9 = 0.9F; + } + + this.func_71013_b(var5); +- this.setPosition((double)((float)var1 + var10), (double)((float)var2 + 15.0F / 16.0F), (double)((float)var3 + var7)); ++ this.setPosition((double)((float)par1 + var9), (double)((float)par2 + 0.9375F), (double)((float)par3 + var7)); + } else { +- this.setPosition((double)((float)var1 + 0.5F), (double)((float)var2 + 15.0F / 16.0F), (double)((float)var3 + 0.5F)); ++ this.setPosition((double)((float)par1 + 0.5F), (double)((float)par2 + 0.9375F), (double)((float)par3 + 0.5F)); + } + + this.sleeping = true; + this.sleepTimer = 0; +- this.playerLocation = new ChunkCoordinates(var1, var2, var3); ++ this.playerLocation = new ChunkCoordinates(par1, par2, par3); + this.motionX = this.motionZ = this.motionY = 0.0D; +- if(!this.worldObj.isRemote) { ++ ++ if (!this.worldObj.isRemote) { + this.worldObj.updateAllPlayersSleepingFlag(); + } + + return EnumStatus.OK; + } + +- private void func_71013_b(int var1) { ++ private void func_71013_b(int par1) { + this.field_71079_bU = 0.0F; + this.field_71089_bV = 0.0F; +- switch(var1) { ++ ++ switch (par1) { + case 0: + this.field_71089_bV = -1.8F; + break; ++ + case 1: + this.field_71079_bU = 1.8F; + break; ++ + case 2: + this.field_71089_bV = 1.8F; + break; ++ + case 3: + this.field_71079_bU = -1.8F; + } +- + } + +- public void wakeUpPlayer(boolean var1, boolean var2, boolean var3) { ++ /** ++ * Wake up the player if they're sleeping. ++ */ ++ public void wakeUpPlayer(boolean par1, boolean par2, boolean par3) { + this.setSize(0.6F, 1.8F); + this.resetHeight(); + ChunkCoordinates var4 = this.playerLocation; + ChunkCoordinates var5 = this.playerLocation; +- if(var4 != null && this.worldObj.getBlockId(var4.posX, var4.posY, var4.posZ) == Block.bed.blockID) { ++ ++ if (var4 != null && this.worldObj.getBlockId(var4.posX, var4.posY, var4.posZ) == Block.bed.blockID) { + BlockBed.setBedOccupied(this.worldObj, var4.posX, var4.posY, var4.posZ, false); + var5 = BlockBed.getNearestEmptyChunkCoordinates(this.worldObj, var4.posX, var4.posY, var4.posZ, 0); +- if(var5 == null) { ++ ++ if (var5 == null) { + var5 = new ChunkCoordinates(var4.posX, var4.posY + 1, var4.posZ); + } + +@@ -974,55 +1275,69 @@ + } + + this.sleeping = false; +- if(!this.worldObj.isRemote && var2) { ++ ++ if (!this.worldObj.isRemote && par2) { + this.worldObj.updateAllPlayersSleepingFlag(); + } + +- if(var1) { ++ if (par1) { + this.sleepTimer = 0; + } else { + this.sleepTimer = 100; + } + +- if(var3) { ++ if (par3) { + this.setSpawnChunk(this.playerLocation, false); + } +- + } + ++ /** ++ * Checks if the player is currently in a bed ++ */ + private boolean isInBed() { + return this.worldObj.getBlockId(this.playerLocation.posX, this.playerLocation.posY, this.playerLocation.posZ) == Block.bed.blockID; + } + +- public static ChunkCoordinates verifyRespawnCoordinates(World var0, ChunkCoordinates var1, boolean var2) { +- IChunkProvider var3 = var0.getChunkProvider(); +- var3.loadChunk(var1.posX - 3 >> 4, var1.posZ - 3 >> 4); +- var3.loadChunk(var1.posX + 3 >> 4, var1.posZ - 3 >> 4); +- var3.loadChunk(var1.posX - 3 >> 4, var1.posZ + 3 >> 4); +- var3.loadChunk(var1.posX + 3 >> 4, var1.posZ + 3 >> 4); +- if(var0.getBlockId(var1.posX, var1.posY, var1.posZ) == Block.bed.blockID) { +- ChunkCoordinates var8 = BlockBed.getNearestEmptyChunkCoordinates(var0, var1.posX, var1.posY, var1.posZ, 0); ++ /** ++ * Ensure that a block enabling respawning exists at the specified coordinates and find an empty space nearby to spawn. ++ */ ++ public static ChunkCoordinates verifyRespawnCoordinates(World par0World, ChunkCoordinates par1ChunkCoordinates, boolean par2) { ++ IChunkProvider var3 = par0World.getChunkProvider(); ++ var3.loadChunk(par1ChunkCoordinates.posX - 3 >> 4, par1ChunkCoordinates.posZ - 3 >> 4); ++ var3.loadChunk(par1ChunkCoordinates.posX + 3 >> 4, par1ChunkCoordinates.posZ - 3 >> 4); ++ var3.loadChunk(par1ChunkCoordinates.posX - 3 >> 4, par1ChunkCoordinates.posZ + 3 >> 4); ++ var3.loadChunk(par1ChunkCoordinates.posX + 3 >> 4, par1ChunkCoordinates.posZ + 3 >> 4); ++ ++ if (par0World.getBlockId(par1ChunkCoordinates.posX, par1ChunkCoordinates.posY, par1ChunkCoordinates.posZ) == Block.bed.blockID) { ++ ChunkCoordinates var8 = BlockBed.getNearestEmptyChunkCoordinates(par0World, par1ChunkCoordinates.posX, par1ChunkCoordinates.posY, par1ChunkCoordinates.posZ, 0); + return var8; + } else { +- Material var4 = var0.getBlockMaterial(var1.posX, var1.posY, var1.posZ); +- Material var5 = var0.getBlockMaterial(var1.posX, var1.posY + 1, var1.posZ); ++ Material var4 = par0World.getBlockMaterial(par1ChunkCoordinates.posX, par1ChunkCoordinates.posY, par1ChunkCoordinates.posZ); ++ Material var5 = par0World.getBlockMaterial(par1ChunkCoordinates.posX, par1ChunkCoordinates.posY + 1, par1ChunkCoordinates.posZ); + boolean var6 = !var4.isSolid() && !var4.isLiquid(); + boolean var7 = !var5.isSolid() && !var5.isLiquid(); +- return var2 && var6 && var7 ? var1 : null; ++ return par2 && var6 && var7 ? par1ChunkCoordinates : null; + } + } + ++ /** ++ * Returns the orientation of the bed in degrees. ++ */ + public float getBedOrientationInDegrees() { +- if(this.playerLocation != null) { ++ if (this.playerLocation != null) { + int var1 = this.worldObj.getBlockMetadata(this.playerLocation.posX, this.playerLocation.posY, this.playerLocation.posZ); + int var2 = BlockBed.getDirection(var1); +- switch(var2) { ++ ++ switch (var2) { + case 0: + return 90.0F; ++ + case 1: + return 0.0F; ++ + case 2: + return 270.0F; ++ + case 3: + return 180.0F; + } +@@ -1031,10 +1346,16 @@ + return 0.0F; + } + ++ /** ++ * Returns whether player is sleeping or not ++ */ + public boolean isPlayerSleeping() { + return this.sleeping; + } + ++ /** ++ * Returns whether or not the player is asleep and the screen has fully faded. ++ */ + public boolean isPlayerFullyAsleep() { + return this.sleeping && this.sleepTimer >= 100; + } +@@ -1043,23 +1364,28 @@ + return this.sleepTimer; + } + +- protected boolean getHideCape(int var1) { +- return (this.dataWatcher.getWatchableObjectByte(16) & 1 << var1) != 0; ++ protected boolean getHideCape(int par1) { ++ return (this.dataWatcher.getWatchableObjectByte(16) & 1 << par1) != 0; + } + +- protected void setHideCape(int var1, boolean var2) { ++ protected void setHideCape(int par1, boolean par2) { + byte var3 = this.dataWatcher.getWatchableObjectByte(16); +- if(var2) { +- this.dataWatcher.updateObject(16, Byte.valueOf((byte)(var3 | 1 << var1))); ++ ++ if (par2) { ++ this.dataWatcher.updateObject(16, Byte.valueOf((byte)(var3 | 1 << par1))); + } else { +- this.dataWatcher.updateObject(16, Byte.valueOf((byte)(var3 & ~(1 << var1)))); ++ this.dataWatcher.updateObject(16, Byte.valueOf((byte)(var3 & ~(1 << par1)))); + } +- +- } +- +- public void addChatMessage(String var1) { +- } +- ++ } ++ ++ /** ++ * Add a chat message to the player ++ */ ++ public void addChatMessage(String par1Str) {} ++ ++ /** ++ * Returns the location of the bed the player will respawn at, or null if the player has not slept in a bed. ++ */ + public ChunkCoordinates getBedLocation() { + return this.spawnChunk; + } +@@ -1068,161 +1394,207 @@ + return this.spawnForced; + } + +- public void setSpawnChunk(ChunkCoordinates var1, boolean var2) { +- if(var1 != null) { +- this.spawnChunk = new ChunkCoordinates(var1); +- this.spawnForced = var2; ++ /** ++ * Defines a spawn coordinate to player spawn. Used by bed after the player sleep on it. ++ */ ++ public void setSpawnChunk(ChunkCoordinates par1ChunkCoordinates, boolean par2) { ++ if (par1ChunkCoordinates != null) { ++ this.spawnChunk = new ChunkCoordinates(par1ChunkCoordinates); ++ this.spawnForced = par2; + } else { + this.spawnChunk = null; + this.spawnForced = false; + } +- +- } +- +- public void triggerAchievement(StatBase var1) { +- this.addStat(var1, 1); +- } +- +- public void addStat(StatBase var1, int var2) { +- } +- ++ } ++ ++ /** ++ * Will trigger the specified trigger. ++ */ ++ public void triggerAchievement(StatBase par1StatBase) { ++ this.addStat(par1StatBase, 1); ++ } ++ ++ /** ++ * Adds a value to a statistic field. ++ */ ++ public void addStat(StatBase par1StatBase, int par2) {} ++ ++ /** ++ * Causes this entity to do an upwards motion (jumping). ++ */ + protected void jump() { + super.jump(); + this.addStat(StatList.jumpStat, 1); +- if(this.isSprinting()) { ++ ++ if (this.isSprinting()) { + this.addExhaustion(0.8F); + } else { + this.addExhaustion(0.2F); + } +- + } + +- public void moveEntityWithHeading(float var1, float var2) { ++ /** ++ * Moves the entity based on the specified heading. Args: strafe, forward ++ */ ++ public void moveEntityWithHeading(float par1, float par2) { + double var3 = this.posX; + double var5 = this.posY; + double var7 = this.posZ; +- if(this.capabilities.isFlying && this.ridingEntity == null) { ++ ++ if (this.capabilities.isFlying && this.ridingEntity == null) { + double var9 = this.motionY; + float var11 = this.jumpMovementFactor; + this.jumpMovementFactor = this.capabilities.getFlySpeed(); +- super.moveEntityWithHeading(var1, var2); ++ // Spout Start ++ if (SpoutClient.getInstance().isFlySpeedCheat()) { ++ jumpMovementFactor *= Configuration.getFlightSpeedFactor(); ++ } ++ // Spout End ++ super.moveEntityWithHeading(par1, par2); + this.motionY = var9 * 0.6D; + this.jumpMovementFactor = var11; + } else { +- super.moveEntityWithHeading(var1, var2); ++ super.moveEntityWithHeading(par1, par2); + } + + this.addMovementStat(this.posX - var3, this.posY - var5, this.posZ - var7); + } + ++ /** ++ * the movespeed used for the new AI system ++ */ + public float getAIMoveSpeed() { + return (float)this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).getAttributeValue(); + } + +- public void addMovementStat(double var1, double var3, double var5) { +- if(this.ridingEntity == null) { ++ /** ++ * Adds a value to a movement statistic field - like run, walk, swin or climb. ++ */ ++ public void addMovementStat(double par1, double par3, double par5) { ++ if (this.ridingEntity == null) { + int var7; +- if(this.isInsideOfMaterial(Material.water)) { +- var7 = Math.round(MathHelper.sqrt_double(var1 * var1 + var3 * var3 + var5 * var5) * 100.0F); +- if(var7 > 0) { ++ ++ if (this.isInsideOfMaterial(Material.water)) { ++ var7 = Math.round(MathHelper.sqrt_double(par1 * par1 + par3 * par3 + par5 * par5) * 100.0F); ++ ++ if (var7 > 0) { + this.addStat(StatList.distanceDoveStat, var7); + this.addExhaustion(0.015F * (float)var7 * 0.01F); + } +- } else if(this.isInWater()) { +- var7 = Math.round(MathHelper.sqrt_double(var1 * var1 + var5 * var5) * 100.0F); +- if(var7 > 0) { ++ } else if (this.isInWater()) { ++ var7 = Math.round(MathHelper.sqrt_double(par1 * par1 + par5 * par5) * 100.0F); ++ ++ if (var7 > 0) { + this.addStat(StatList.distanceSwumStat, var7); + this.addExhaustion(0.015F * (float)var7 * 0.01F); + } +- } else if(this.isOnLadder()) { +- if(var3 > 0.0D) { +- this.addStat(StatList.distanceClimbedStat, (int)Math.round(var3 * 100.0D)); ++ } else if (this.isOnLadder()) { ++ if (par3 > 0.0D) { ++ this.addStat(StatList.distanceClimbedStat, (int)Math.round(par3 * 100.0D)); + } +- } else if(this.onGround) { +- var7 = Math.round(MathHelper.sqrt_double(var1 * var1 + var5 * var5) * 100.0F); +- if(var7 > 0) { ++ } else if (this.onGround) { ++ var7 = Math.round(MathHelper.sqrt_double(par1 * par1 + par5 * par5) * 100.0F); ++ ++ if (var7 > 0) { + this.addStat(StatList.distanceWalkedStat, var7); +- if(this.isSprinting()) { +- this.addExhaustion(10.0F * 0.01F * (float)var7 * 0.01F); ++ ++ if (this.isSprinting()) { ++ this.addExhaustion(0.099999994F * (float)var7 * 0.01F); + } else { + this.addExhaustion(0.01F * (float)var7 * 0.01F); + } + } + } else { +- var7 = Math.round(MathHelper.sqrt_double(var1 * var1 + var5 * var5) * 100.0F); +- if(var7 > 25) { ++ var7 = Math.round(MathHelper.sqrt_double(par1 * par1 + par5 * par5) * 100.0F); ++ ++ if (var7 > 25) { + this.addStat(StatList.distanceFlownStat, var7); + } + } +- + } + } + +- private void addMountedMovementStat(double var1, double var3, double var5) { +- if(this.ridingEntity != null) { +- int var7 = Math.round(MathHelper.sqrt_double(var1 * var1 + var3 * var3 + var5 * var5) * 100.0F); +- if(var7 > 0) { +- if(this.ridingEntity instanceof EntityMinecart) { ++ /** ++ * Adds a value to a mounted movement statistic field - by minecart, boat, or pig. ++ */ ++ private void addMountedMovementStat(double par1, double par3, double par5) { ++ if (this.ridingEntity != null) { ++ int var7 = Math.round(MathHelper.sqrt_double(par1 * par1 + par3 * par3 + par5 * par5) * 100.0F); ++ ++ if (var7 > 0) { ++ if (this.ridingEntity instanceof EntityMinecart) { + this.addStat(StatList.distanceByMinecartStat, var7); +- if(this.startMinecartRidingCoordinate == null) { ++ ++ if (this.startMinecartRidingCoordinate == null) { + this.startMinecartRidingCoordinate = new ChunkCoordinates(MathHelper.floor_double(this.posX), MathHelper.floor_double(this.posY), MathHelper.floor_double(this.posZ)); +- } else if((double)this.startMinecartRidingCoordinate.getDistanceSquared(MathHelper.floor_double(this.posX), MathHelper.floor_double(this.posY), MathHelper.floor_double(this.posZ)) >= 1000000.0D) { ++ } else if ((double)this.startMinecartRidingCoordinate.getDistanceSquared(MathHelper.floor_double(this.posX), MathHelper.floor_double(this.posY), MathHelper.floor_double(this.posZ)) >= 1000000.0D) { + this.addStat(AchievementList.onARail, 1); + } +- } else if(this.ridingEntity instanceof EntityBoat) { ++ } else if (this.ridingEntity instanceof EntityBoat) { + this.addStat(StatList.distanceByBoatStat, var7); +- } else if(this.ridingEntity instanceof EntityPig) { ++ } else if (this.ridingEntity instanceof EntityPig) { + this.addStat(StatList.distanceByPigStat, var7); + } + } + } +- + } + +- protected void fall(float var1) { +- if(!this.capabilities.allowFlying) { +- if(var1 >= 2.0F) { +- this.addStat(StatList.distanceFallenStat, (int)Math.round((double)var1 * 100.0D)); ++ /** ++ * Called when the mob is falling. Calculates and applies fall damage. ++ */ ++ protected void fall(float par1) { ++ if (!this.capabilities.allowFlying) { ++ if (par1 >= 2.0F) { ++ this.addStat(StatList.distanceFallenStat, (int)Math.round((double)par1 * 100.0D)); + } + +- super.fall(var1); ++ super.fall(par1); + } + } + +- public void onKillEntity(EntityLivingBase var1) { +- if(var1 instanceof IMob) { ++ /** ++ * This method gets called when the entity kills another one. ++ */ ++ public void onKillEntity(EntityLivingBase par1EntityLivingBase) { ++ if (par1EntityLivingBase instanceof IMob) { + this.triggerAchievement(AchievementList.killEnemy); + } +- + } + ++ /** ++ * Sets the Entity inside a web block. ++ */ + public void setInWeb() { +- if(!this.capabilities.isFlying) { ++ if (!this.capabilities.isFlying) { + super.setInWeb(); + } +- + } + +- public Icon getItemIcon(ItemStack var1, int var2) { +- Icon var3 = super.getItemIcon(var1, var2); +- if(var1.itemID == Item.fishingRod.itemID && this.fishEntity != null) { ++ /** ++ * Gets the Icon Index of the item currently held ++ */ ++ public Icon getItemIcon(ItemStack par1ItemStack, int par2) { ++ Icon var3 = super.getItemIcon(par1ItemStack, par2); ++ ++ if (par1ItemStack.itemID == Item.fishingRod.itemID && this.fishEntity != null) { + var3 = Item.fishingRod.func_94597_g(); + } else { +- if(var1.getItem().requiresMultipleRenderPasses()) { +- return var1.getItem().getIconFromDamageForRenderPass(var1.getItemDamage(), var2); ++ if (par1ItemStack.getItem().requiresMultipleRenderPasses()) { ++ return par1ItemStack.getItem().getIconFromDamageForRenderPass(par1ItemStack.getItemDamage(), par2); + } + +- if(this.itemInUse != null && var1.itemID == Item.bow.itemID) { +- int var4 = var1.getMaxItemUseDuration() - this.itemInUseCount; +- if(var4 >= 18) { ++ if (this.itemInUse != null && par1ItemStack.itemID == Item.bow.itemID) { ++ int var4 = par1ItemStack.getMaxItemUseDuration() - this.itemInUseCount; ++ ++ if (var4 >= 18) { + return Item.bow.getItemIconForUseDuration(2); + } + +- if(var4 > 13) { ++ if (var4 > 13) { + return Item.bow.getItemIconForUseDuration(1); + } + +- if(var4 > 0) { ++ if (var4 > 0) { + return Item.bow.getItemIconForUseDuration(0); + } + } +@@ -1231,92 +1603,119 @@ + return var3; + } + +- public ItemStack getCurrentArmor(int var1) { +- return this.inventory.armorItemInSlot(var1); ++ public ItemStack getCurrentArmor(int par1) { ++ return this.inventory.armorItemInSlot(par1); + } + +- public void addExperience(int var1) { +- this.addScore(var1); ++ /** ++ * This method increases the player's current amount of experience. ++ */ ++ public void addExperience(int par1) { ++ this.addScore(par1); + int var2 = Integer.MAX_VALUE - this.experienceTotal; +- if(var1 > var2) { +- var1 = var2; ++ ++ if (par1 > var2) { ++ par1 = var2; + } + +- this.experience += (float)var1 / (float)this.xpBarCap(); ++ this.experience += (float)par1 / (float)this.xpBarCap(); + +- for(this.experienceTotal += var1; this.experience >= 1.0F; this.experience /= (float)this.xpBarCap()) { ++ for (this.experienceTotal += par1; this.experience >= 1.0F; this.experience /= (float)this.xpBarCap()) { + this.experience = (this.experience - 1.0F) * (float)this.xpBarCap(); + this.addExperienceLevel(1); + } +- + } + +- public void addExperienceLevel(int var1) { +- this.experienceLevel += var1; +- if(this.experienceLevel < 0) { ++ /** ++ * Add experience levels to this player. ++ */ ++ public void addExperienceLevel(int par1) { ++ this.experienceLevel += par1; ++ ++ if (this.experienceLevel < 0) { + this.experienceLevel = 0; + this.experience = 0.0F; + this.experienceTotal = 0; + } + +- if(var1 > 0 && this.experienceLevel % 5 == 0 && (float)this.field_82249_h < (float)this.ticksExisted - 100.0F) { ++ if (par1 > 0 && this.experienceLevel % 5 == 0 && (float)this.field_82249_h < (float)this.ticksExisted - 100.0F) { + float var2 = this.experienceLevel > 30 ? 1.0F : (float)this.experienceLevel / 30.0F; +- this.worldObj.playSoundAtEntity(this, "random.levelup", var2 * (12.0F / 16.0F), 1.0F); ++ this.worldObj.playSoundAtEntity(this, "random.levelup", var2 * 0.75F, 1.0F); + this.field_82249_h = this.ticksExisted; + } +- + } + ++ /** ++ * This method returns the cap amount of experience that the experience bar can hold. With each level, the experience ++ * cap on the player's experience bar is raised by 10. ++ */ + public int xpBarCap() { + return this.experienceLevel >= 30 ? 62 + (this.experienceLevel - 30) * 7 : (this.experienceLevel >= 15 ? 17 + (this.experienceLevel - 15) * 3 : 17); + } + +- public void addExhaustion(float var1) { +- if(!this.capabilities.disableDamage) { +- if(!this.worldObj.isRemote) { +- this.foodStats.addExhaustion(var1); ++ /** ++ * increases exhaustion level by supplied amount ++ */ ++ public void addExhaustion(float par1) { ++ if (!this.capabilities.disableDamage) { ++ if (!this.worldObj.isRemote) { ++ this.foodStats.addExhaustion(par1); + } +- + } + } + ++ /** ++ * Returns the player's FoodStats object. ++ */ + public FoodStats getFoodStats() { + return this.foodStats; + } + +- public boolean canEat(boolean var1) { +- return (var1 || this.foodStats.needFood()) && !this.capabilities.disableDamage; ++ public boolean canEat(boolean par1) { ++ return (par1 || this.foodStats.needFood()) && !this.capabilities.disableDamage; + } + ++ /** ++ * Checks if the player's health is not full and not zero. ++ */ + public boolean shouldHeal() { + return this.getHealth() > 0.0F && this.getHealth() < this.getMaxHealth(); + } + +- public void setItemInUse(ItemStack var1, int var2) { +- if(var1 != this.itemInUse) { +- this.itemInUse = var1; +- this.itemInUseCount = var2; +- if(!this.worldObj.isRemote) { ++ /** ++ * sets the itemInUse when the use item button is clicked. Args: itemstack, int maxItemUseDuration ++ */ ++ public void setItemInUse(ItemStack par1ItemStack, int par2) { ++ if (par1ItemStack != this.itemInUse) { ++ this.itemInUse = par1ItemStack; ++ this.itemInUseCount = par2; ++ ++ if (!this.worldObj.isRemote) { + this.setEating(true); + } +- + } + } + +- public boolean isCurrentToolAdventureModeExempt(int var1, int var2, int var3) { +- if(this.capabilities.allowEdit) { ++ /** ++ * Returns true if the given block can be mined with the current tool in adventure mode. ++ */ ++ public boolean isCurrentToolAdventureModeExempt(int par1, int par2, int par3) { ++ if (this.capabilities.allowEdit) { + return true; + } else { +- int var4 = this.worldObj.getBlockId(var1, var2, var3); +- if(var4 > 0) { ++ int var4 = this.worldObj.getBlockId(par1, par2, par3); ++ ++ if (var4 > 0) { + Block var5 = Block.blocksList[var4]; +- if(var5.blockMaterial.isAdventureModeExempt()) { ++ ++ if (var5.blockMaterial.isAdventureModeExempt()) { + return true; + } + +- if(this.getCurrentEquippedItem() != null) { ++ if (this.getCurrentEquippedItem() != null) { + ItemStack var6 = this.getCurrentEquippedItem(); +- if(var6.canHarvestBlock(var5) || var6.getStrVsBlock(var5) > 1.0F) { ++ ++ if (var6.canHarvestBlock(var5) || var6.getStrVsBlock(var5) > 1.0F) { + return true; + } + } +@@ -1326,12 +1725,15 @@ + } + } + +- public boolean canPlayerEdit(int var1, int var2, int var3, int var4, ItemStack var5) { +- return this.capabilities.allowEdit ? true : (var5 != null ? var5.canEditBlocks() : false); ++ public boolean canPlayerEdit(int par1, int par2, int par3, int par4, ItemStack par5ItemStack) { ++ return this.capabilities.allowEdit ? true : (par5ItemStack != null ? par5ItemStack.canEditBlocks() : false); + } + +- protected int getExperiencePoints(EntityPlayer var1) { +- if(this.worldObj.getGameRules().getGameRuleBooleanValue("keepInventory")) { ++ /** ++ * Get the experience points the entity currently has. ++ */ ++ protected int getExperiencePoints(EntityPlayer par1EntityPlayer) { ++ if (this.worldObj.getGameRules().getGameRuleBooleanValue("keepInventory")) { + return 0; + } else { + int var2 = this.experienceLevel * 7; +@@ -1339,83 +1741,151 @@ + } + } + ++ /** ++ * Only use is to identify if class is an instance of player for experience dropping ++ */ + protected boolean isPlayer() { + return true; + } + ++ /** ++ * Gets the username of the entity. ++ */ + public String getEntityName() { +- return this.bu; ++ return this.username; + } + + public boolean getAlwaysRenderNameTagForRender() { + return true; + } + +- public void clonePlayer(EntityPlayer var1, boolean var2) { +- if(var2) { +- this.inventory.copyInventory(var1.inventory); +- this.setHealth(var1.getHealth()); +- this.foodStats = var1.foodStats; +- this.experienceLevel = var1.experienceLevel; +- this.experienceTotal = var1.experienceTotal; +- this.experience = var1.experience; +- this.setScore(var1.getScore()); +- this.teleportDirection = var1.teleportDirection; +- } else if(this.worldObj.getGameRules().getGameRuleBooleanValue("keepInventory")) { +- this.inventory.copyInventory(var1.inventory); +- this.experienceLevel = var1.experienceLevel; +- this.experienceTotal = var1.experienceTotal; +- this.experience = var1.experience; +- this.setScore(var1.getScore()); +- } +- +- this.theInventoryEnderChest = var1.theInventoryEnderChest; +- } +- ++ /** ++ * Copies the values from the given player into this player if boolean par2 is true. Always clones Ender Chest ++ * Inventory. ++ */ ++ public void clonePlayer(EntityPlayer par1EntityPlayer, boolean par2) { ++ if (par2) { ++ this.inventory.copyInventory(par1EntityPlayer.inventory); ++ this.setHealth(par1EntityPlayer.getHealth()); ++ this.foodStats = par1EntityPlayer.foodStats; ++ this.experienceLevel = par1EntityPlayer.experienceLevel; ++ this.experienceTotal = par1EntityPlayer.experienceTotal; ++ this.experience = par1EntityPlayer.experience; ++ this.setScore(par1EntityPlayer.getScore()); ++ this.teleportDirection = par1EntityPlayer.teleportDirection; ++ } else if (this.worldObj.getGameRules().getGameRuleBooleanValue("keepInventory")) { ++ this.inventory.copyInventory(par1EntityPlayer.inventory); ++ this.experienceLevel = par1EntityPlayer.experienceLevel; ++ this.experienceTotal = par1EntityPlayer.experienceTotal; ++ this.experience = par1EntityPlayer.experience; ++ this.setScore(par1EntityPlayer.getScore()); ++ } ++ ++ this.theInventoryEnderChest = par1EntityPlayer.theInventoryEnderChest; ++ } ++ // Spout Start - Added back handle key press ++ public void handleKeyPress(int i, boolean keyReleased) { ++ } ++ ++ public boolean isTreadingWater() { ++ return (this.inWater || this.partiallyInWater) && this.treadWaterToggle; ++ } ++ // Spout End ++ ++ // Spout Start - Easter egg ++ public void doFancyStuff() { ++ if (isSneaking()) { ++ return; ++ } ++ if (Minecraft.getMinecraft().isGamePaused) { ++ return; ++ } ++ if (Minecraft.getMinecraft().thePlayer.getDistanceSqToEntity(this) > 16) { ++ return; ++ } ++ ++ if (vip != null) { ++ for (Entry particle : vip.getParticles().entrySet()) { ++ if (rand.nextInt(particle.getValue()) == 0) { ++ Minecraft.getMinecraft().renderGlobal.spawnParticle(particle.getKey(), posX + rand.nextFloat() - 0.5, boundingBox.minY + Math.max(0, rand.nextFloat() - 0.25F), posZ + rand.nextFloat() - 0.5, 0, 0, 0.0F); ++ } ++ } ++ } ++ } ++ // Spout End ++ ++ /** ++ * returns if this entity triggers Block.onEntityWalking on the blocks they walk on. used for spiders and wolves to ++ * prevent them from trampling crops ++ */ + protected boolean canTriggerWalking() { + return !this.capabilities.isFlying; + } + +- public void sendPlayerAbilities() { +- } +- +- public void setGameType(EnumGameType var1) { +- } +- ++ /** ++ * Sends the player's abilities to the server (if there is one). ++ */ ++ public void sendPlayerAbilities() {} ++ ++ /** ++ * Sets the player's game mode and sends it to them. ++ */ ++ public void setGameType(EnumGameType par1EnumGameType) {} ++ ++ /** ++ * Gets the name of this command sender (usually username, but possibly "Rcon") ++ */ + public String getCommandSenderName() { +- return this.bu; ++ return this.username; + } + + public World getEntityWorld() { + return this.worldObj; + } + ++ /** ++ * Returns the InventoryEnderChest of this player. ++ */ + public InventoryEnderChest getInventoryEnderChest() { + return this.theInventoryEnderChest; + } + +- public ItemStack getEquipmentInSlot(int var1) { +- return var1 == 0 ? this.inventory.getCurrentItem() : this.inventory.armorInventory[var1 - 1]; ++ /** ++ * 0 = item, 1-n is armor ++ */ ++ public ItemStack getCurrentItemOrArmor(int par1) { ++ return par1 == 0 ? this.inventory.getCurrentItem() : this.inventory.armorInventory[par1 - 1]; + } + ++ /** ++ * Returns the item that this EntityLiving is holding, if any. ++ */ + public ItemStack getHeldItem() { + return this.inventory.getCurrentItem(); + } + +- public void setCurrentItemOrArmor(int var1, ItemStack var2) { +- this.inventory.armorInventory[var1] = var2; ++ /** ++ * Sets the held item, or an armor slot. Slot 0 is held item. Slot 1-4 is armor. Params: Item, slot ++ */ ++ public void setCurrentItemOrArmor(int par1, ItemStack par2ItemStack) { ++ this.inventory.armorInventory[par1] = par2ItemStack; + } + +- public boolean isInvisibleToPlayer(EntityPlayer var1) { +- if(!this.isInvisible()) { ++ /** ++ * Only used by renderer in EntityLivingBase subclasses.\nDetermines if an entity is visible or not to a specfic ++ * player, if the entity is normally invisible.\nFor EntityLivingBase subclasses, returning false when invisible will ++ * render the entity semitransparent. ++ */ ++ public boolean isInvisibleToPlayer(EntityPlayer par1EntityPlayer) { ++ if (!this.isInvisible()) { + return false; + } else { + Team var2 = this.getTeam(); +- return var2 == null || var1 == null || var1.getTeam() != var2 || !var2.func_98297_h(); ++ return var2 == null || par1EntityPlayer == null || par1EntityPlayer.getTeam() != var2 || !var2.func_98297_h(); + } + } + +- public ItemStack[] getInventory() { ++ public ItemStack[] getLastActiveItems() { + return this.inventory.armorInventory; + } + +@@ -1432,22 +1902,25 @@ + } + + public Team getTeam() { +- return this.getWorldScoreboard().getPlayersTeam(this.bu); ++ return this.getWorldScoreboard().getPlayersTeam(this.username); + } + ++ /** ++ * Returns the translated name of the entity. ++ */ + public String getTranslatedEntityName() { +- return ScorePlayerTeam.formatPlayerName(this.getTeam(), this.bu); ++ return ScorePlayerTeam.formatPlayerName(this.getTeam(), this.username); + } + +- public void setAbsorptionAmount(float var1) { +- if(var1 < 0.0F) { +- var1 = 0.0F; ++ public void setAbsorptionAmount(float par1) { ++ if (par1 < 0.0F) { ++ par1 = 0.0F; + } + +- this.getDataWatcher().updateObject(17, Float.valueOf(var1)); ++ this.getDataWatcher().updateObject(17, Float.valueOf(par1)); + } + + public float getAbsorptionAmount() { + return this.getDataWatcher().getWatchableObjectFloat(17); +- } ++ } + } diff --git a/patches/net/minecraft/src/EntityPlayerMP.java.patch b/patches/net/minecraft/src/EntityPlayerMP.java.patch new file mode 100644 index 0000000..d568132 --- /dev/null +++ b/patches/net/minecraft/src/EntityPlayerMP.java.patch @@ -0,0 +1,1167 @@ +--- net/minecraft/src/EntityPlayerMP.java ++++ net/minecraft/src/EntityPlayerMP.java +@@ -12,82 +12,136 @@ + import net.minecraft.server.MinecraftServer; + + public class EntityPlayerMP extends EntityPlayer implements ICrafting { +- private String bN = "en_US"; ++ private String translator = "en_US"; ++ ++ /** ++ * The NetServerHandler assigned to this player by the ServerConfigurationManager. ++ */ + public NetServerHandler playerNetServerHandler; +- public MinecraftServer b; ++ ++ /** Reference to the MinecraftServer object. */ ++ public MinecraftServer mcServer; ++ ++ /** The ItemInWorldManager belonging to this player */ + public ItemInWorldManager theItemInWorldManager; ++ ++ /** player X position as seen by PlayerManager */ + public double managedPosX; ++ ++ /** player Z position as seen by PlayerManager */ + public double managedPosZ; +- public final List f = new LinkedList(); +- public final List g = new LinkedList(); ++ ++ /** LinkedList that holds the loaded chunks. */ ++ public final List loadedChunks = new LinkedList(); ++ ++ /** entities added to this list will be packet29'd to the player */ ++ public final List destroyedItemsNetCache = new LinkedList(); + private float field_130068_bO = Float.MIN_VALUE; ++ ++ /** set to getHealth */ + private float lastHealth = -1.0E8F; ++ ++ /** set to foodStats.GetFoodLevel */ + private int lastFoodLevel = -99999999; ++ ++ /** set to foodStats.getSaturationLevel() == 0.0F each tick */ + private boolean wasHungry = true; ++ ++ /** Amount of experience the client was last set to */ + private int lastExperience = -99999999; +- private int ticksOfInvuln = 60; ++ ++ /** de-increments onUpdate, attackEntityFrom is ignored if this >0 */ ++ private int initialInvulnerability = 60; ++ ++ /** must be between 3>x>15 (strictly between) */ + private int renderDistance; + private int chatVisibility; + private boolean chatColours = true; + private long field_143005_bX = 0L; ++ ++ /** ++ * The currently in use window ID. Incremented every time a window is opened. ++ */ + private int currentWindowId; +- public boolean isChangingQuantityOnly; ++ ++ /** ++ * poor mans concurency flag, lets hope the jvm doesn't re-order the setting of this flag wrt the inventory change on ++ * the next line ++ */ ++ public boolean playerInventoryBeingManipulated; + public int ping; ++ ++ /** ++ * Set when a player beats the ender dragon, used to respawn the player at the spawn point while retaining inventory ++ * and XP ++ */ + public boolean playerConqueredTheEnd; + +- public EntityPlayerMP(MinecraftServer var1, World var2, String var3, ItemInWorldManager var4) { +- super(var2, var3); +- var4.thisPlayerMP = this; +- this.theItemInWorldManager = var4; +- this.renderDistance = var1.getConfigurationManager().getViewDistance(); +- ChunkCoordinates var5 = var2.getSpawnPoint(); ++ public EntityPlayerMP(MinecraftServer par1MinecraftServer, World par2World, String par3Str, ItemInWorldManager par4ItemInWorldManager) { ++ super(par2World, par3Str); ++ par4ItemInWorldManager.thisPlayerMP = this; ++ this.theItemInWorldManager = par4ItemInWorldManager; ++ this.renderDistance = par1MinecraftServer.getConfigurationManager().getViewDistance(); ++ ChunkCoordinates var5 = par2World.getSpawnPoint(); + int var6 = var5.posX; + int var7 = var5.posZ; + int var8 = var5.posY; +- if(!var2.provider.hasNoSky && var2.getWorldInfo().getGameType() != EnumGameType.ADVENTURE) { +- int var9 = Math.max(5, var1.getSpawnProtectionSize() - 6); +- var6 += this.ab.nextInt(var9 * 2) - var9; +- var7 += this.ab.nextInt(var9 * 2) - var9; +- var8 = var2.getTopSolidOrLiquidBlock(var6, var7); ++ ++ if (!par2World.provider.hasNoSky && par2World.getWorldInfo().getGameType() != EnumGameType.ADVENTURE) { ++ int var9 = Math.max(5, par1MinecraftServer.getSpawnProtectionSize() - 6); ++ var6 += this.rand.nextInt(var9 * 2) - var9; ++ var7 += this.rand.nextInt(var9 * 2) - var9; ++ var8 = par2World.getTopSolidOrLiquidBlock(var6, var7); + } + +- this.b = var1; ++ this.mcServer = par1MinecraftServer; + this.stepHeight = 0.0F; + this.yOffset = 0.0F; + this.setLocationAndAngles((double)var6 + 0.5D, (double)var8, (double)var7 + 0.5D, 0.0F, 0.0F); + +- while(!var2.getCollidingBoundingBoxes(this, this.boundingBox).isEmpty()) { ++ while (!par2World.getCollidingBoundingBoxes(this, this.boundingBox).isEmpty()) { + this.setPosition(this.posX, this.posY + 1.0D, this.posZ); + } +- + } + +- public void readEntityFromNBT(NBTTagCompound var1) { +- super.readEntityFromNBT(var1); +- if(var1.hasKey("playerGameType")) { +- if(MinecraftServer.getServer().getForceGamemode()) { ++ /** ++ * (abstract) Protected helper method to read subclass entity data from NBT. ++ */ ++ public void readEntityFromNBT(NBTTagCompound par1NBTTagCompound) { ++ super.readEntityFromNBT(par1NBTTagCompound); ++ ++ if (par1NBTTagCompound.hasKey("playerGameType")) { ++ if (MinecraftServer.getServer().getForceGamemode()) { + this.theItemInWorldManager.setGameType(MinecraftServer.getServer().getGameType()); + } else { +- this.theItemInWorldManager.setGameType(EnumGameType.getByID(var1.getInteger("playerGameType"))); ++ this.theItemInWorldManager.setGameType(EnumGameType.getByID(par1NBTTagCompound.getInteger("playerGameType"))); + } + } +- +- } +- +- public void writeEntityToNBT(NBTTagCompound var1) { +- super.writeEntityToNBT(var1); +- var1.setInteger("playerGameType", this.theItemInWorldManager.getGameType().getID()); +- } +- +- public void addExperienceLevel(int var1) { +- super.addExperienceLevel(var1); ++ } ++ ++ /** ++ * (abstract) Protected helper method to write subclass entity data to NBT. ++ */ ++ public void writeEntityToNBT(NBTTagCompound par1NBTTagCompound) { ++ super.writeEntityToNBT(par1NBTTagCompound); ++ par1NBTTagCompound.setInteger("playerGameType", this.theItemInWorldManager.getGameType().getID()); ++ } ++ ++ /** ++ * Add experience levels to this player. ++ */ ++ public void addExperienceLevel(int par1) { ++ super.addExperienceLevel(par1); + this.lastExperience = -1; + } + + public void addSelfToInternalCraftingInventory() { +- this.openContainer.onCraftGuiOpened(this); ++ this.openContainer.addCraftingToCrafters(this); + } + ++ /** ++ * sets the players height back to normal after doing things like sleeping and dieing ++ */ + protected void resetHeight() { + this.yOffset = 0.0F; + } +@@ -96,104 +150,109 @@ + return 1.62F; + } + ++ /** ++ * Called to update the entity's position/logic. ++ */ + public void onUpdate() { + this.theItemInWorldManager.updateBlockRemoving(); +- --this.ticksOfInvuln; ++ --this.initialInvulnerability; + this.openContainer.detectAndSendChanges(); +- if(!this.worldObj.isRemote && !this.openContainer.canInteractWith(this)) { ++ ++ if (!this.worldObj.isRemote && !this.openContainer.canInteractWith(this)) { + this.closeScreen(); + this.openContainer = this.inventoryContainer; + } + +- while(!this.g.isEmpty()) { +- int var1 = Math.min(this.g.size(), 127); ++ while (!this.destroyedItemsNetCache.isEmpty()) { ++ int var1 = Math.min(this.destroyedItemsNetCache.size(), 127); + int[] var2 = new int[var1]; +- Iterator var3 = this.g.iterator(); ++ Iterator var3 = this.destroyedItemsNetCache.iterator(); + int var4 = 0; + +- while(var3.hasNext() && var4 < var1) { ++ while (var3.hasNext() && var4 < var1) { + var2[var4++] = ((Integer)var3.next()).intValue(); + var3.remove(); + } + +- this.playerNetServerHandler.sendPacket(new Packet29DestroyEntity(var2)); ++ this.playerNetServerHandler.sendPacketToPlayer(new Packet29DestroyEntity(var2)); + } + +- if(!this.f.isEmpty()) { ++ if (!this.loadedChunks.isEmpty()) { + ArrayList var6 = new ArrayList(); +- Iterator var7 = this.f.iterator(); ++ Iterator var7 = this.loadedChunks.iterator(); + ArrayList var8 = new ArrayList(); + +- while(var7.hasNext() && var6.size() < 5) { ++ while (var7.hasNext() && var6.size() < 5) { + ChunkCoordIntPair var9 = (ChunkCoordIntPair)var7.next(); + var7.remove(); +- if(var9 != null && this.worldObj.blockExists(var9.chunkXPos << 4, 0, var9.chunkZPos << 4)) { ++ ++ if (var9 != null && this.worldObj.blockExists(var9.chunkXPos << 4, 0, var9.chunkZPos << 4)) { + var6.add(this.worldObj.getChunkFromChunkCoords(var9.chunkXPos, var9.chunkZPos)); +- var8.addAll(((WorldServer)this.worldObj).getTileEntityList(var9.chunkXPos * 16, 0, var9.chunkZPos * 16, var9.chunkXPos * 16 + 16, 256, var9.chunkZPos * 16 + 16)); ++ var8.addAll(((WorldServer)this.worldObj).getAllTileEntityInBox(var9.chunkXPos * 16, 0, var9.chunkZPos * 16, var9.chunkXPos * 16 + 16, 256, var9.chunkZPos * 16 + 16)); + } + } + +- if(!var6.isEmpty()) { +- this.playerNetServerHandler.sendPacket(new Packet56MapChunks(var6)); ++ if (!var6.isEmpty()) { ++ this.playerNetServerHandler.sendPacketToPlayer(new Packet56MapChunks(var6)); + Iterator var10 = var8.iterator(); + +- while(var10.hasNext()) { ++ while (var10.hasNext()) { + TileEntity var5 = (TileEntity)var10.next(); +- this.getTileEntityInfo(var5); ++ this.sendTileEntityToPlayer(var5); + } + + var10 = var6.iterator(); + +- while(var10.hasNext()) { ++ while (var10.hasNext()) { + Chunk var11 = (Chunk)var10.next(); + this.getServerForPlayer().getEntityTracker().func_85172_a(this, var11); + } + } + } + +- if(this.field_143005_bX > 0L && this.b.func_143007_ar() > 0 && MinecraftServer.getCurrentTimeMillis() - this.field_143005_bX > (long)(this.b.func_143007_ar() * 1000 * 60)) { +- this.playerNetServerHandler.kickPlayer("You have been idle for too long!"); ++ if (this.field_143005_bX > 0L && this.mcServer.func_143007_ar() > 0 && MinecraftServer.getSystemTimeMillis() - this.field_143005_bX > (long)(this.mcServer.func_143007_ar() * 1000 * 60)) { ++ this.playerNetServerHandler.kickPlayerFromServer("You have been idle for too long!"); + } +- + } + + public void onUpdateEntity() { + try { + super.onUpdate(); + +- for(int var1 = 0; var1 < this.inventory.getSizeInventory(); ++var1) { ++ for (int var1 = 0; var1 < this.inventory.getSizeInventory(); ++var1) { + ItemStack var6 = this.inventory.getStackInSlot(var1); +- if(var6 != null && Item.itemsList[var6.itemID].isMap() && this.playerNetServerHandler.getNumChunkDataPackets() <= 5) { +- Packet var8 = ((ItemMapBase)Item.itemsList[var6.itemID]).getUpdatePacket(var6, this.worldObj, this); +- if(var8 != null) { +- this.playerNetServerHandler.sendPacket(var8); ++ ++ if (var6 != null && Item.itemsList[var6.itemID].isMap() && this.playerNetServerHandler.packetSize() <= 5) { ++ Packet var8 = ((ItemMapBase)Item.itemsList[var6.itemID]).createMapDataPacket(var6, this.worldObj, this); ++ ++ if (var8 != null) { ++ this.playerNetServerHandler.sendPacketToPlayer(var8); + } + } + } + +- if(this.getHealth() != this.lastHealth || this.lastFoodLevel != this.foodStats.getFoodLevel() || this.foodStats.getSaturationLevel() == 0.0F != this.wasHungry) { +- this.playerNetServerHandler.sendPacket(new Packet8UpdateHealth(this.getHealth(), this.foodStats.getFoodLevel(), this.foodStats.getSaturationLevel())); ++ if (this.getHealth() != this.lastHealth || this.lastFoodLevel != this.foodStats.getFoodLevel() || this.foodStats.getSaturationLevel() == 0.0F != this.wasHungry) { ++ this.playerNetServerHandler.sendPacketToPlayer(new Packet8UpdateHealth(this.getHealth(), this.foodStats.getFoodLevel(), this.foodStats.getSaturationLevel())); + this.lastHealth = this.getHealth(); + this.lastFoodLevel = this.foodStats.getFoodLevel(); + this.wasHungry = this.foodStats.getSaturationLevel() == 0.0F; + } + +- if(this.getHealth() + this.getAbsorptionAmount() != this.field_130068_bO) { ++ if (this.getHealth() + this.getAbsorptionAmount() != this.field_130068_bO) { + this.field_130068_bO = this.getHealth() + this.getAbsorptionAmount(); + Collection var5 = this.getWorldScoreboard().func_96520_a(ScoreObjectiveCriteria.health); + Iterator var7 = var5.iterator(); + +- while(var7.hasNext()) { ++ while (var7.hasNext()) { + ScoreObjective var9 = (ScoreObjective)var7.next(); +- this.getWorldScoreboard().func_96529_a(this.getEntityName(), var9).func_96651_a(Arrays.asList(new EntityPlayer[]{this})); ++ this.getWorldScoreboard().func_96529_a(this.getEntityName(), var9).func_96651_a(Arrays.asList(new EntityPlayer[] {this})); + } + } + +- if(this.experienceTotal != this.lastExperience) { ++ if (this.experienceTotal != this.lastExperience) { + this.lastExperience = this.experienceTotal; +- this.playerNetServerHandler.sendPacket(new Packet43Experience(this.experience, this.experienceTotal, this.experienceLevel)); ++ this.playerNetServerHandler.sendPacketToPlayer(new Packet43Experience(this.experience, this.experienceTotal, this.experienceLevel)); + } +- + } catch (Throwable var4) { + CrashReport var2 = CrashReport.makeCrashReport(var4, "Ticking player"); + CrashReportCategory var3 = var2.makeCategory("Player being ticked"); +@@ -202,401 +261,504 @@ + } + } + +- public void onDeath(DamageSource var1) { +- this.b.getConfigurationManager().sendChatMsg(this.func_110142_aN().func_94546_b()); +- if(!this.worldObj.getGameRules().getGameRuleBooleanValue("keepInventory")) { ++ /** ++ * Called when the mob's health reaches 0. ++ */ ++ public void onDeath(DamageSource par1DamageSource) { ++ this.mcServer.getConfigurationManager().sendChatMsg(this.func_110142_aN().func_94546_b()); ++ ++ if (!this.worldObj.getGameRules().getGameRuleBooleanValue("keepInventory")) { + this.inventory.dropAllItems(); + } + + Collection var2 = this.worldObj.getScoreboard().func_96520_a(ScoreObjectiveCriteria.deathCount); + Iterator var3 = var2.iterator(); + +- while(var3.hasNext()) { ++ while (var3.hasNext()) { + ScoreObjective var4 = (ScoreObjective)var3.next(); + Score var5 = this.getWorldScoreboard().func_96529_a(this.getEntityName(), var4); + var5.func_96648_a(); + } + + EntityLivingBase var6 = this.func_94060_bK(); +- if(var6 != null) { ++ ++ if (var6 != null) { + var6.addToPlayerScore(this, this.scoreValue); + } + + this.addStat(StatList.deathsStat, 1); + } + +- public boolean attackEntityFrom(DamageSource var1, float var2) { +- if(this.isEntityInvulnerable()) { ++ /** ++ * Called when the entity is attacked. ++ */ ++ public boolean attackEntityFrom(DamageSource par1DamageSource, float par2) { ++ if (this.isEntityInvulnerable()) { + return false; + } else { +- boolean var3 = this.b.isDedicatedServer() && this.b.isPVPEnabled() && "fall".equals(var1.o); +- if(!var3 && this.ticksOfInvuln > 0 && var1 != DamageSource.outOfWorld) { ++ boolean var3 = this.mcServer.isDedicatedServer() && this.mcServer.isPVPEnabled() && "fall".equals(par1DamageSource.damageType); ++ ++ if (!var3 && this.initialInvulnerability > 0 && par1DamageSource != DamageSource.outOfWorld) { + return false; + } else { +- if(var1 instanceof EntityDamageSource) { +- Entity var4 = var1.getEntity(); +- if(var4 instanceof EntityPlayer && !this.canAttackPlayer((EntityPlayer)var4)) { ++ if (par1DamageSource instanceof EntityDamageSource) { ++ Entity var4 = par1DamageSource.getEntity(); ++ ++ if (var4 instanceof EntityPlayer && !this.canAttackPlayer((EntityPlayer)var4)) { + return false; + } + +- if(var4 instanceof EntityArrow) { ++ if (var4 instanceof EntityArrow) { + EntityArrow var5 = (EntityArrow)var4; +- if(var5.shootingEntity instanceof EntityPlayer && !this.canAttackPlayer((EntityPlayer)var5.shootingEntity)) { ++ ++ if (var5.shootingEntity instanceof EntityPlayer && !this.canAttackPlayer((EntityPlayer)var5.shootingEntity)) { + return false; + } + } + } + +- return super.attackEntityFrom(var1, var2); ++ return super.attackEntityFrom(par1DamageSource, par2); + } + } + } + +- public boolean canAttackPlayer(EntityPlayer var1) { +- return !this.b.isPVPEnabled() ? false : super.canAttackPlayer(var1); ++ public boolean canAttackPlayer(EntityPlayer par1EntityPlayer) { ++ return !this.mcServer.isPVPEnabled() ? false : super.canAttackPlayer(par1EntityPlayer); + } + +- public void travelToDimension(int var1) { +- if(this.dimension == 1 && var1 == 1) { ++ /** ++ * Teleports the entity to another dimension. Params: Dimension number to teleport to ++ */ ++ public void travelToDimension(int par1) { ++ if (this.dimension == 1 && par1 == 1) { + this.triggerAchievement(AchievementList.theEnd2); + this.worldObj.removeEntity(this); + this.playerConqueredTheEnd = true; +- this.playerNetServerHandler.sendPacket(new Packet70GameEvent(4, 0)); ++ this.playerNetServerHandler.sendPacketToPlayer(new Packet70GameEvent(4, 0)); + } else { +- if(this.dimension == 0 && var1 == 1) { ++ if (this.dimension == 0 && par1 == 1) { + this.triggerAchievement(AchievementList.theEnd); +- ChunkCoordinates var2 = this.b.worldServerForDimension(var1).getEntrancePortalLocation(); +- if(var2 != null) { ++ ChunkCoordinates var2 = this.mcServer.worldServerForDimension(par1).getEntrancePortalLocation(); ++ ++ if (var2 != null) { + this.playerNetServerHandler.setPlayerLocation((double)var2.posX, (double)var2.posY, (double)var2.posZ, 0.0F, 0.0F); + } + +- var1 = 1; ++ par1 = 1; + } else { + this.triggerAchievement(AchievementList.portal); + } + +- this.b.getConfigurationManager().transferPlayerToDimension(this, var1); ++ this.mcServer.getConfigurationManager().transferPlayerToDimension(this, par1); + this.lastExperience = -1; + this.lastHealth = -1.0F; + this.lastFoodLevel = -1; + } +- + } + +- private void getTileEntityInfo(TileEntity var1) { +- if(var1 != null) { +- Packet var2 = var1.getDescriptionPacket(); +- if(var2 != null) { +- this.playerNetServerHandler.sendPacket(var2); ++ /** ++ * called from onUpdate for all tileEntity in specific chunks ++ */ ++ private void sendTileEntityToPlayer(TileEntity par1TileEntity) { ++ if (par1TileEntity != null) { ++ Packet var2 = par1TileEntity.getDescriptionPacket(); ++ ++ if (var2 != null) { ++ this.playerNetServerHandler.sendPacketToPlayer(var2); + } + } +- + } + +- public void onItemPickup(Entity var1, int var2) { +- super.onItemPickup(var1, var2); ++ /** ++ * Called whenever an item is picked up from walking over it. Args: pickedUpEntity, stackSize ++ */ ++ public void onItemPickup(Entity par1Entity, int par2) { ++ super.onItemPickup(par1Entity, par2); + this.openContainer.detectAndSendChanges(); + } + +- public EnumStatus sleepInBedAt(int var1, int var2, int var3) { +- EnumStatus var4 = super.sleepInBedAt(var1, var2, var3); +- if(var4 == EnumStatus.OK) { +- Packet17Sleep var5 = new Packet17Sleep(this, 0, var1, var2, var3); +- this.getServerForPlayer().getEntityTracker().sendPacketToTrackedPlayers(this, var5); ++ /** ++ * Attempts to have the player sleep in a bed at the specified location. ++ */ ++ public EnumStatus sleepInBedAt(int par1, int par2, int par3) { ++ EnumStatus var4 = super.sleepInBedAt(par1, par2, par3); ++ ++ if (var4 == EnumStatus.OK) { ++ Packet17Sleep var5 = new Packet17Sleep(this, 0, par1, par2, par3); ++ this.getServerForPlayer().getEntityTracker().sendPacketToAllPlayersTrackingEntity(this, var5); + this.playerNetServerHandler.setPlayerLocation(this.posX, this.posY, this.posZ, this.rotationYaw, this.rotationPitch); +- this.playerNetServerHandler.sendPacket(var5); ++ this.playerNetServerHandler.sendPacketToPlayer(var5); + } + + return var4; + } + +- public void wakeUpPlayer(boolean var1, boolean var2, boolean var3) { +- if(this.isPlayerSleeping()) { +- this.getServerForPlayer().getEntityTracker().sendPacketToTrackedPlayersAndTrackedEntity(this, new Packet18Animation(this, 3)); ++ /** ++ * Wake up the player if they're sleeping. ++ */ ++ public void wakeUpPlayer(boolean par1, boolean par2, boolean par3) { ++ if (this.isPlayerSleeping()) { ++ this.getServerForPlayer().getEntityTracker().sendPacketToAllAssociatedPlayers(this, new Packet18Animation(this, 3)); + } + +- super.wakeUpPlayer(var1, var2, var3); +- if(this.playerNetServerHandler != null) { ++ super.wakeUpPlayer(par1, par2, par3); ++ ++ if (this.playerNetServerHandler != null) { + this.playerNetServerHandler.setPlayerLocation(this.posX, this.posY, this.posZ, this.rotationYaw, this.rotationPitch); + } +- + } + +- public void mountEntity(Entity var1) { +- super.mountEntity(var1); +- this.playerNetServerHandler.sendPacket(new Packet39AttachEntity(0, this, this.ridingEntity)); ++ /** ++ * Called when a player mounts an entity. e.g. mounts a pig, mounts a boat. ++ */ ++ public void mountEntity(Entity par1Entity) { ++ super.mountEntity(par1Entity); ++ this.playerNetServerHandler.sendPacketToPlayer(new Packet39AttachEntity(0, this, this.ridingEntity)); + this.playerNetServerHandler.setPlayerLocation(this.posX, this.posY, this.posZ, this.rotationYaw, this.rotationPitch); + } + +- protected void updateFallState(double var1, boolean var3) { +- } +- +- public void handleFalling(double var1, boolean var3) { +- super.updateFallState(var1, var3); +- } +- +- public void displayGUIEditSign(TileEntity var1) { +- if(var1 instanceof TileEntitySign) { +- ((TileEntitySign)var1).func_142010_a(this); +- this.playerNetServerHandler.sendPacket(new Packet133TileEditorOpen(0, var1.xCoord, var1.yCoord, var1.zCoord)); ++ /** ++ * Takes in the distance the entity has fallen this tick and whether its on the ground to update the fall distance and ++ * deal fall damage if landing on the ground. Args: distanceFallenThisTick, onGround ++ */ ++ protected void updateFallState(double par1, boolean par3) {} ++ ++ /** ++ * likeUpdateFallState, but called from updateFlyingState, rather than moveEntity ++ */ ++ public void updateFlyingState(double par1, boolean par3) { ++ super.updateFallState(par1, par3); ++ } ++ ++ /** ++ * Displays the GUI for editing a sign. Args: tileEntitySign ++ */ ++ public void displayGUIEditSign(TileEntity par1TileEntity) { ++ if (par1TileEntity instanceof TileEntitySign) { ++ ((TileEntitySign)par1TileEntity).func_142010_a(this); ++ this.playerNetServerHandler.sendPacketToPlayer(new Packet133TileEditorOpen(0, par1TileEntity.xCoord, par1TileEntity.yCoord, par1TileEntity.zCoord)); + } +- + } + +- private void getNextWindowId() { ++ private void incrementWindowID() { + this.currentWindowId = this.currentWindowId % 100 + 1; + } + +- public void displayGUIWorkbench(int var1, int var2, int var3) { +- this.getNextWindowId(); +- this.playerNetServerHandler.sendPacket(new Packet100OpenWindow(this.currentWindowId, 1, "Crafting", 9, true)); +- this.openContainer = new ContainerWorkbench(this.inventory, this.worldObj, var1, var2, var3); +- this.openContainer.windowId = this.currentWindowId; +- this.openContainer.onCraftGuiOpened(this); +- } +- +- public void displayGUIEnchantment(int var1, int var2, int var3, String var4) { +- this.getNextWindowId(); +- this.playerNetServerHandler.sendPacket(new Packet100OpenWindow(this.currentWindowId, 4, var4 == null ? "" : var4, 9, var4 != null)); +- this.openContainer = new ContainerEnchantment(this.inventory, this.worldObj, var1, var2, var3); +- this.openContainer.windowId = this.currentWindowId; +- this.openContainer.onCraftGuiOpened(this); +- } +- +- public void displayGUIAnvil(int var1, int var2, int var3) { +- this.getNextWindowId(); +- this.playerNetServerHandler.sendPacket(new Packet100OpenWindow(this.currentWindowId, 8, "Repairing", 9, true)); +- this.openContainer = new ContainerRepair(this.inventory, this.worldObj, var1, var2, var3, this); +- this.openContainer.windowId = this.currentWindowId; +- this.openContainer.onCraftGuiOpened(this); +- } +- +- public void displayGUIChest(IInventory var1) { +- if(this.openContainer != this.inventoryContainer) { ++ /** ++ * Displays the crafting GUI for a workbench. ++ */ ++ public void displayGUIWorkbench(int par1, int par2, int par3) { ++ this.incrementWindowID(); ++ this.playerNetServerHandler.sendPacketToPlayer(new Packet100OpenWindow(this.currentWindowId, 1, "Crafting", 9, true)); ++ this.openContainer = new ContainerWorkbench(this.inventory, this.worldObj, par1, par2, par3); ++ this.openContainer.windowId = this.currentWindowId; ++ this.openContainer.addCraftingToCrafters(this); ++ } ++ ++ public void displayGUIEnchantment(int par1, int par2, int par3, String par4Str) { ++ this.incrementWindowID(); ++ this.playerNetServerHandler.sendPacketToPlayer(new Packet100OpenWindow(this.currentWindowId, 4, par4Str == null ? "" : par4Str, 9, par4Str != null)); ++ this.openContainer = new ContainerEnchantment(this.inventory, this.worldObj, par1, par2, par3); ++ this.openContainer.windowId = this.currentWindowId; ++ this.openContainer.addCraftingToCrafters(this); ++ } ++ ++ /** ++ * Displays the GUI for interacting with an anvil. ++ */ ++ public void displayGUIAnvil(int par1, int par2, int par3) { ++ this.incrementWindowID(); ++ this.playerNetServerHandler.sendPacketToPlayer(new Packet100OpenWindow(this.currentWindowId, 8, "Repairing", 9, true)); ++ this.openContainer = new ContainerRepair(this.inventory, this.worldObj, par1, par2, par3, this); ++ this.openContainer.windowId = this.currentWindowId; ++ this.openContainer.addCraftingToCrafters(this); ++ } ++ ++ /** ++ * Displays the GUI for interacting with a chest inventory. Args: chestInventory ++ */ ++ public void displayGUIChest(IInventory par1IInventory) { ++ if (this.openContainer != this.inventoryContainer) { + this.closeScreen(); + } + +- this.getNextWindowId(); +- this.playerNetServerHandler.sendPacket(new Packet100OpenWindow(this.currentWindowId, 0, var1.getInvName(), var1.getSizeInventory(), var1.isInvNameLocalized())); +- this.openContainer = new ContainerChest(this.inventory, var1); +- this.openContainer.windowId = this.currentWindowId; +- this.openContainer.onCraftGuiOpened(this); +- } +- +- public void displayGUIHopper(TileEntityHopper var1) { +- this.getNextWindowId(); +- this.playerNetServerHandler.sendPacket(new Packet100OpenWindow(this.currentWindowId, 9, var1.getInvName(), var1.getSizeInventory(), var1.isInvNameLocalized())); +- this.openContainer = new ContainerHopper(this.inventory, var1); +- this.openContainer.windowId = this.currentWindowId; +- this.openContainer.onCraftGuiOpened(this); +- } +- +- public void displayGUIHopperMinecart(EntityMinecartHopper var1) { +- this.getNextWindowId(); +- this.playerNetServerHandler.sendPacket(new Packet100OpenWindow(this.currentWindowId, 9, var1.getInvName(), var1.getSizeInventory(), var1.isInvNameLocalized())); +- this.openContainer = new ContainerHopper(this.inventory, var1); +- this.openContainer.windowId = this.currentWindowId; +- this.openContainer.onCraftGuiOpened(this); +- } +- +- public void displayGUIFurnace(TileEntityFurnace var1) { +- this.getNextWindowId(); +- this.playerNetServerHandler.sendPacket(new Packet100OpenWindow(this.currentWindowId, 2, var1.getInvName(), var1.getSizeInventory(), var1.isInvNameLocalized())); +- this.openContainer = new ContainerFurnace(this.inventory, var1); +- this.openContainer.windowId = this.currentWindowId; +- this.openContainer.onCraftGuiOpened(this); +- } +- +- public void displayGUIDispenser(TileEntityDispenser var1) { +- this.getNextWindowId(); +- this.playerNetServerHandler.sendPacket(new Packet100OpenWindow(this.currentWindowId, var1 instanceof TileEntityDropper ? 10 : 3, var1.getInvName(), var1.getSizeInventory(), var1.isInvNameLocalized())); +- this.openContainer = new ContainerDispenser(this.inventory, var1); +- this.openContainer.windowId = this.currentWindowId; +- this.openContainer.onCraftGuiOpened(this); +- } +- +- public void displayGUIBrewingStand(TileEntityBrewingStand var1) { +- this.getNextWindowId(); +- this.playerNetServerHandler.sendPacket(new Packet100OpenWindow(this.currentWindowId, 5, var1.getInvName(), var1.getSizeInventory(), var1.isInvNameLocalized())); +- this.openContainer = new ContainerBrewingStand(this.inventory, var1); +- this.openContainer.windowId = this.currentWindowId; +- this.openContainer.onCraftGuiOpened(this); +- } +- +- public void displayGUIBeacon(TileEntityBeacon var1) { +- this.getNextWindowId(); +- this.playerNetServerHandler.sendPacket(new Packet100OpenWindow(this.currentWindowId, 7, var1.getInvName(), var1.getSizeInventory(), var1.isInvNameLocalized())); +- this.openContainer = new ContainerBeacon(this.inventory, var1); +- this.openContainer.windowId = this.currentWindowId; +- this.openContainer.onCraftGuiOpened(this); +- } +- +- public void displayGUIMerchant(IMerchant var1, String var2) { +- this.getNextWindowId(); +- this.openContainer = new ContainerMerchant(this.inventory, var1, this.worldObj); +- this.openContainer.windowId = this.currentWindowId; +- this.openContainer.onCraftGuiOpened(this); ++ this.incrementWindowID(); ++ this.playerNetServerHandler.sendPacketToPlayer(new Packet100OpenWindow(this.currentWindowId, 0, par1IInventory.getInvName(), par1IInventory.getSizeInventory(), par1IInventory.isInvNameLocalized())); ++ this.openContainer = new ContainerChest(this.inventory, par1IInventory); ++ this.openContainer.windowId = this.currentWindowId; ++ this.openContainer.addCraftingToCrafters(this); ++ } ++ ++ public void displayGUIHopper(TileEntityHopper par1TileEntityHopper) { ++ this.incrementWindowID(); ++ this.playerNetServerHandler.sendPacketToPlayer(new Packet100OpenWindow(this.currentWindowId, 9, par1TileEntityHopper.getInvName(), par1TileEntityHopper.getSizeInventory(), par1TileEntityHopper.isInvNameLocalized())); ++ this.openContainer = new ContainerHopper(this.inventory, par1TileEntityHopper); ++ this.openContainer.windowId = this.currentWindowId; ++ this.openContainer.addCraftingToCrafters(this); ++ } ++ ++ public void displayGUIHopperMinecart(EntityMinecartHopper par1EntityMinecartHopper) { ++ this.incrementWindowID(); ++ this.playerNetServerHandler.sendPacketToPlayer(new Packet100OpenWindow(this.currentWindowId, 9, par1EntityMinecartHopper.getInvName(), par1EntityMinecartHopper.getSizeInventory(), par1EntityMinecartHopper.isInvNameLocalized())); ++ this.openContainer = new ContainerHopper(this.inventory, par1EntityMinecartHopper); ++ this.openContainer.windowId = this.currentWindowId; ++ this.openContainer.addCraftingToCrafters(this); ++ } ++ ++ /** ++ * Displays the furnace GUI for the passed in furnace entity. Args: tileEntityFurnace ++ */ ++ public void displayGUIFurnace(TileEntityFurnace par1TileEntityFurnace) { ++ this.incrementWindowID(); ++ this.playerNetServerHandler.sendPacketToPlayer(new Packet100OpenWindow(this.currentWindowId, 2, par1TileEntityFurnace.getInvName(), par1TileEntityFurnace.getSizeInventory(), par1TileEntityFurnace.isInvNameLocalized())); ++ this.openContainer = new ContainerFurnace(this.inventory, par1TileEntityFurnace); ++ this.openContainer.windowId = this.currentWindowId; ++ this.openContainer.addCraftingToCrafters(this); ++ } ++ ++ /** ++ * Displays the dipsenser GUI for the passed in dispenser entity. Args: TileEntityDispenser ++ */ ++ public void displayGUIDispenser(TileEntityDispenser par1TileEntityDispenser) { ++ this.incrementWindowID(); ++ this.playerNetServerHandler.sendPacketToPlayer(new Packet100OpenWindow(this.currentWindowId, par1TileEntityDispenser instanceof TileEntityDropper ? 10 : 3, par1TileEntityDispenser.getInvName(), par1TileEntityDispenser.getSizeInventory(), par1TileEntityDispenser.isInvNameLocalized())); ++ this.openContainer = new ContainerDispenser(this.inventory, par1TileEntityDispenser); ++ this.openContainer.windowId = this.currentWindowId; ++ this.openContainer.addCraftingToCrafters(this); ++ } ++ ++ /** ++ * Displays the GUI for interacting with a brewing stand. ++ */ ++ public void displayGUIBrewingStand(TileEntityBrewingStand par1TileEntityBrewingStand) { ++ this.incrementWindowID(); ++ this.playerNetServerHandler.sendPacketToPlayer(new Packet100OpenWindow(this.currentWindowId, 5, par1TileEntityBrewingStand.getInvName(), par1TileEntityBrewingStand.getSizeInventory(), par1TileEntityBrewingStand.isInvNameLocalized())); ++ this.openContainer = new ContainerBrewingStand(this.inventory, par1TileEntityBrewingStand); ++ this.openContainer.windowId = this.currentWindowId; ++ this.openContainer.addCraftingToCrafters(this); ++ } ++ ++ /** ++ * Displays the GUI for interacting with a beacon. ++ */ ++ public void displayGUIBeacon(TileEntityBeacon par1TileEntityBeacon) { ++ this.incrementWindowID(); ++ this.playerNetServerHandler.sendPacketToPlayer(new Packet100OpenWindow(this.currentWindowId, 7, par1TileEntityBeacon.getInvName(), par1TileEntityBeacon.getSizeInventory(), par1TileEntityBeacon.isInvNameLocalized())); ++ this.openContainer = new ContainerBeacon(this.inventory, par1TileEntityBeacon); ++ this.openContainer.windowId = this.currentWindowId; ++ this.openContainer.addCraftingToCrafters(this); ++ } ++ ++ public void displayGUIMerchant(IMerchant par1IMerchant, String par2Str) { ++ this.incrementWindowID(); ++ this.openContainer = new ContainerMerchant(this.inventory, par1IMerchant, this.worldObj); ++ this.openContainer.windowId = this.currentWindowId; ++ this.openContainer.addCraftingToCrafters(this); + InventoryMerchant var3 = ((ContainerMerchant)this.openContainer).getMerchantInventory(); +- this.playerNetServerHandler.sendPacket(new Packet100OpenWindow(this.currentWindowId, 6, var2 == null ? "" : var2, var3.getSizeInventory(), var2 != null)); +- MerchantRecipeList var4 = var1.getRecipes(this); +- if(var4 != null) { ++ this.playerNetServerHandler.sendPacketToPlayer(new Packet100OpenWindow(this.currentWindowId, 6, par2Str == null ? "" : par2Str, var3.getSizeInventory(), par2Str != null)); ++ MerchantRecipeList var4 = par1IMerchant.getRecipes(this); ++ ++ if (var4 != null) { + try { + ByteArrayOutputStream var5 = new ByteArrayOutputStream(); + DataOutputStream var6 = new DataOutputStream(var5); + var6.writeInt(this.currentWindowId); + var4.writeRecipiesToStream(var6); +- this.playerNetServerHandler.sendPacket(new Packet250CustomPayload("MC|TrList", var5.toByteArray())); ++ this.playerNetServerHandler.sendPacketToPlayer(new Packet250CustomPayload("MC|TrList", var5.toByteArray())); + } catch (IOException var7) { + var7.printStackTrace(); + } + } +- + } + +- public void displayGUIHorse(EntityHorse var1, IInventory var2) { +- if(this.openContainer != this.inventoryContainer) { ++ public void displayGUIHorse(EntityHorse par1EntityHorse, IInventory par2IInventory) { ++ if (this.openContainer != this.inventoryContainer) { + this.closeScreen(); + } + +- this.getNextWindowId(); +- this.playerNetServerHandler.sendPacket(new Packet100OpenWindow(this.currentWindowId, 11, var2.getInvName(), var2.getSizeInventory(), var2.isInvNameLocalized(), var1.entityId)); +- this.openContainer = new ContainerHorseInventory(this.inventory, var2, var1); ++ this.incrementWindowID(); ++ this.playerNetServerHandler.sendPacketToPlayer(new Packet100OpenWindow(this.currentWindowId, 11, par2IInventory.getInvName(), par2IInventory.getSizeInventory(), par2IInventory.isInvNameLocalized(), par1EntityHorse.entityId)); ++ this.openContainer = new ContainerHorseInventory(this.inventory, par2IInventory, par1EntityHorse); + this.openContainer.windowId = this.currentWindowId; +- this.openContainer.onCraftGuiOpened(this); ++ this.openContainer.addCraftingToCrafters(this); + } + +- public void sendSlotContents(Container var1, int var2, ItemStack var3) { +- if(!(var1.getSlot(var2) instanceof SlotCrafting)) { +- if(!this.isChangingQuantityOnly) { +- this.playerNetServerHandler.sendPacket(new Packet103SetSlot(var1.windowId, var2, var3)); ++ /** ++ * Sends the contents of an inventory slot to the client-side Container. This doesn't have to match the actual contents ++ * of that slot. Args: Container, slot number, slot contents ++ */ ++ public void sendSlotContents(Container par1Container, int par2, ItemStack par3ItemStack) { ++ if (!(par1Container.getSlot(par2) instanceof SlotCrafting)) { ++ if (!this.playerInventoryBeingManipulated) { ++ this.playerNetServerHandler.sendPacketToPlayer(new Packet103SetSlot(par1Container.windowId, par2, par3ItemStack)); + } + } + } + +- public void sendContainerToPlayer(Container var1) { +- this.updateCraftingInventory(var1, var1.getInventory()); +- } +- +- public void updateCraftingInventory(Container var1, List var2) { +- this.playerNetServerHandler.sendPacket(new Packet104WindowItems(var1.windowId, var2)); +- this.playerNetServerHandler.sendPacket(new Packet103SetSlot(-1, -1, this.inventory.getItemStack())); +- } +- +- public void sendProgressBarUpdate(Container var1, int var2, int var3) { +- this.playerNetServerHandler.sendPacket(new Packet105UpdateProgressbar(var1.windowId, var2, var3)); +- } +- ++ public void sendContainerToPlayer(Container par1Container) { ++ this.sendContainerAndContentsToPlayer(par1Container, par1Container.getInventory()); ++ } ++ ++ public void sendContainerAndContentsToPlayer(Container par1Container, List par2List) { ++ this.playerNetServerHandler.sendPacketToPlayer(new Packet104WindowItems(par1Container.windowId, par2List)); ++ this.playerNetServerHandler.sendPacketToPlayer(new Packet103SetSlot(-1, -1, this.inventory.getItemStack())); ++ } ++ ++ /** ++ * Sends two ints to the client-side Container. Used for furnace burning time, smelting progress, brewing progress, and ++ * enchanting level. Normally the first int identifies which variable to update, and the second contains the new value. ++ * Both are truncated to shorts in non-local SMP. ++ */ ++ public void sendProgressBarUpdate(Container par1Container, int par2, int par3) { ++ this.playerNetServerHandler.sendPacketToPlayer(new Packet105UpdateProgressbar(par1Container.windowId, par2, par3)); ++ } ++ ++ /** ++ * sets current screen to null (used on escape buttons of GUIs) ++ */ + public void closeScreen() { +- this.playerNetServerHandler.sendPacket(new Packet101CloseWindow(this.openContainer.windowId)); ++ this.playerNetServerHandler.sendPacketToPlayer(new Packet101CloseWindow(this.openContainer.windowId)); + this.closeContainer(); + } + ++ /** ++ * updates item held by mouse ++ */ + public void updateHeldItem() { +- if(!this.isChangingQuantityOnly) { +- this.playerNetServerHandler.sendPacket(new Packet103SetSlot(-1, -1, this.inventory.getItemStack())); ++ if (!this.playerInventoryBeingManipulated) { ++ this.playerNetServerHandler.sendPacketToPlayer(new Packet103SetSlot(-1, -1, this.inventory.getItemStack())); + } + } + ++ /** ++ * Closes the container the player currently has open. ++ */ + public void closeContainer() { + this.openContainer.onContainerClosed(this); + this.openContainer = this.inventoryContainer; + } + +- public void setEntityActionState(float var1, float var2, boolean var3, boolean var4) { +- if(this.ridingEntity != null) { +- if(var1 >= -1.0F && var1 <= 1.0F) { +- this.moveStrafing = var1; +- } +- +- if(var2 >= -1.0F && var2 <= 1.0F) { +- this.moveForward = var2; +- } +- +- this.isJumping = var3; +- this.setSneaking(var4); ++ public void setEntityActionState(float par1, float par2, boolean par3, boolean par4) { ++ if (this.ridingEntity != null) { ++ if (par1 >= -1.0F && par1 <= 1.0F) { ++ this.moveStrafing = par1; ++ } ++ ++ if (par2 >= -1.0F && par2 <= 1.0F) { ++ this.moveForward = par2; ++ } ++ ++ this.isJumping = par3; ++ this.setSneaking(par4); + } +- + } + +- public void addStat(StatBase var1, int var2) { +- if(var1 != null) { +- if(!var1.isIndependent) { +- this.playerNetServerHandler.sendPacket(new Packet200Statistic(var1.statId, var2)); ++ /** ++ * Adds a value to a statistic field. ++ */ ++ public void addStat(StatBase par1StatBase, int par2) { ++ if (par1StatBase != null) { ++ if (!par1StatBase.isIndependent) { ++ this.playerNetServerHandler.sendPacketToPlayer(new Packet200Statistic(par1StatBase.statId, par2)); + } +- + } + } + + public void mountEntityAndWakeUp() { +- if(this.riddenByEntity != null) { ++ if (this.riddenByEntity != null) { + this.riddenByEntity.mountEntity(this); + } + +- if(this.sleeping) { ++ if (this.sleeping) { + this.wakeUpPlayer(true, false, false); + } +- + } + ++ /** ++ * this function is called when a players inventory is sent to him, lastHealth is updated on any dimension transitions, ++ * then reset. ++ */ + public void setPlayerHealthUpdated() { + this.lastHealth = -1.0E8F; + } + +- public void addChatMessage(String var1) { +- this.playerNetServerHandler.sendPacket(new Packet3Chat(ChatMessageComponent.createFromTranslationKey(var1))); ++ /** ++ * Add a chat message to the player ++ */ ++ public void addChatMessage(String par1Str) { ++ this.playerNetServerHandler.sendPacketToPlayer(new Packet3Chat(ChatMessageComponent.createFromTranslationKey(par1Str))); + } + ++ /** ++ * Used for when item use count runs out, ie: eating completed ++ */ + protected void onItemUseFinish() { +- this.playerNetServerHandler.sendPacket(new Packet38EntityStatus(this.entityId, (byte)9)); ++ this.playerNetServerHandler.sendPacketToPlayer(new Packet38EntityStatus(this.entityId, (byte)9)); + super.onItemUseFinish(); + } + +- public void setItemInUse(ItemStack var1, int var2) { +- super.setItemInUse(var1, var2); +- if(var1 != null && var1.getItem() != null && var1.getItem().getItemUseAction(var1) == EnumAction.eat) { +- this.getServerForPlayer().getEntityTracker().sendPacketToTrackedPlayersAndTrackedEntity(this, new Packet18Animation(this, 5)); ++ /** ++ * sets the itemInUse when the use item button is clicked. Args: itemstack, int maxItemUseDuration ++ */ ++ public void setItemInUse(ItemStack par1ItemStack, int par2) { ++ super.setItemInUse(par1ItemStack, par2); ++ ++ if (par1ItemStack != null && par1ItemStack.getItem() != null && par1ItemStack.getItem().getItemUseAction(par1ItemStack) == EnumAction.eat) { ++ this.getServerForPlayer().getEntityTracker().sendPacketToAllAssociatedPlayers(this, new Packet18Animation(this, 5)); + } +- + } + +- public void clonePlayer(EntityPlayer var1, boolean var2) { +- super.clonePlayer(var1, var2); ++ /** ++ * Copies the values from the given player into this player if boolean par2 is true. Always clones Ender Chest ++ * Inventory. ++ */ ++ public void clonePlayer(EntityPlayer par1EntityPlayer, boolean par2) { ++ super.clonePlayer(par1EntityPlayer, par2); + this.lastExperience = -1; + this.lastHealth = -1.0F; + this.lastFoodLevel = -1; +- this.g.addAll(((EntityPlayerMP)var1).g); +- } +- +- protected void onNewPotionEffect(PotionEffect var1) { +- super.onNewPotionEffect(var1); +- this.playerNetServerHandler.sendPacket(new Packet41EntityEffect(this.entityId, var1)); +- } +- +- protected void onChangedPotionEffect(PotionEffect var1, boolean var2) { +- super.onChangedPotionEffect(var1, var2); +- this.playerNetServerHandler.sendPacket(new Packet41EntityEffect(this.entityId, var1)); +- } +- +- protected void onFinishedPotionEffect(PotionEffect var1) { +- super.onFinishedPotionEffect(var1); +- this.playerNetServerHandler.sendPacket(new Packet42RemoveEntityEffect(this.entityId, var1)); +- } +- +- public void setPositionAndUpdate(double var1, double var3, double var5) { +- this.playerNetServerHandler.setPlayerLocation(var1, var3, var5, this.rotationYaw, this.rotationPitch); +- } +- +- public void onCriticalHit(Entity var1) { +- this.getServerForPlayer().getEntityTracker().sendPacketToTrackedPlayersAndTrackedEntity(this, new Packet18Animation(var1, 6)); +- } +- +- public void onEnchantmentCritical(Entity var1) { +- this.getServerForPlayer().getEntityTracker().sendPacketToTrackedPlayersAndTrackedEntity(this, new Packet18Animation(var1, 7)); +- } +- ++ this.destroyedItemsNetCache.addAll(((EntityPlayerMP)par1EntityPlayer).destroyedItemsNetCache); ++ } ++ ++ protected void onNewPotionEffect(PotionEffect par1PotionEffect) { ++ super.onNewPotionEffect(par1PotionEffect); ++ this.playerNetServerHandler.sendPacketToPlayer(new Packet41EntityEffect(this.entityId, par1PotionEffect)); ++ } ++ ++ protected void onChangedPotionEffect(PotionEffect par1PotionEffect, boolean par2) { ++ super.onChangedPotionEffect(par1PotionEffect, par2); ++ this.playerNetServerHandler.sendPacketToPlayer(new Packet41EntityEffect(this.entityId, par1PotionEffect)); ++ } ++ ++ protected void onFinishedPotionEffect(PotionEffect par1PotionEffect) { ++ super.onFinishedPotionEffect(par1PotionEffect); ++ this.playerNetServerHandler.sendPacketToPlayer(new Packet42RemoveEntityEffect(this.entityId, par1PotionEffect)); ++ } ++ ++ /** ++ * Move the entity to the coordinates informed, but keep yaw/pitch values. ++ */ ++ public void setPositionAndUpdate(double par1, double par3, double par5) { ++ this.playerNetServerHandler.setPlayerLocation(par1, par3, par5, this.rotationYaw, this.rotationPitch); ++ } ++ ++ /** ++ * Called when the player performs a critical hit on the Entity. Args: entity that was hit critically ++ */ ++ public void onCriticalHit(Entity par1Entity) { ++ this.getServerForPlayer().getEntityTracker().sendPacketToAllAssociatedPlayers(this, new Packet18Animation(par1Entity, 6)); ++ } ++ ++ public void onEnchantmentCritical(Entity par1Entity) { ++ this.getServerForPlayer().getEntityTracker().sendPacketToAllAssociatedPlayers(this, new Packet18Animation(par1Entity, 7)); ++ } ++ ++ /** ++ * Sends the player's abilities to the server (if there is one). ++ */ + public void sendPlayerAbilities() { +- if(this.playerNetServerHandler != null) { +- this.playerNetServerHandler.sendPacket(new Packet202PlayerAbilities(this.capabilities)); ++ if (this.playerNetServerHandler != null) { ++ this.playerNetServerHandler.sendPacketToPlayer(new Packet202PlayerAbilities(this.capabilities)); + } + } + +@@ -604,56 +766,73 @@ + return (WorldServer)this.worldObj; + } + +- public void setGameType(EnumGameType var1) { +- this.theItemInWorldManager.setGameType(var1); +- this.playerNetServerHandler.sendPacket(new Packet70GameEvent(3, var1.getID())); +- } +- +- public void sendChatToPlayer(ChatMessageComponent var1) { +- this.playerNetServerHandler.sendPacket(new Packet3Chat(var1)); +- } +- +- public boolean canCommandSenderUseCommand(int var1, String var2) { +- return "seed".equals(var2) && !this.b.isDedicatedServer() ? true : (!"tell".equals(var2) && !"help".equals(var2) && !"me".equals(var2) ? (this.b.getConfigurationManager().isPlayerOpped(this.bu) ? this.b.func_110455_j() >= var1 : false) : true); +- } +- ++ /** ++ * Sets the player's game mode and sends it to them. ++ */ ++ public void setGameType(EnumGameType par1EnumGameType) { ++ this.theItemInWorldManager.setGameType(par1EnumGameType); ++ this.playerNetServerHandler.sendPacketToPlayer(new Packet70GameEvent(3, par1EnumGameType.getID())); ++ } ++ ++ public void sendChatToPlayer(ChatMessageComponent par1ChatMessageComponent) { ++ this.playerNetServerHandler.sendPacketToPlayer(new Packet3Chat(par1ChatMessageComponent)); ++ } ++ ++ /** ++ * Returns true if the command sender is allowed to use the given command. ++ */ ++ public boolean canCommandSenderUseCommand(int par1, String par2Str) { ++ return "seed".equals(par2Str) && !this.mcServer.isDedicatedServer() ? true : (!"tell".equals(par2Str) && !"help".equals(par2Str) && !"me".equals(par2Str) ? (this.mcServer.getConfigurationManager().isPlayerOpped(this.username) ? this.mcServer.func_110455_j() >= par1 : false) : true); ++ } ++ ++ /** ++ * Gets the player's IP address. Used in /banip. ++ */ + public String getPlayerIP() { +- String var1 = this.playerNetServerHandler.netManager.getRemoteAddress().toString(); ++ String var1 = this.playerNetServerHandler.netManager.getSocketAddress().toString(); + var1 = var1.substring(var1.indexOf("/") + 1); + var1 = var1.substring(0, var1.indexOf(":")); + return var1; + } + +- public void updateClientInfo(Packet204ClientInfo var1) { +- this.bN = var1.getLanguage(); +- int var2 = 256 >> var1.getRenderDistance(); +- if(var2 > 3 && var2 < 15) { ++ public void updateClientInfo(Packet204ClientInfo par1Packet204ClientInfo) { ++ this.translator = par1Packet204ClientInfo.getLanguage(); ++ int var2 = 256 >> par1Packet204ClientInfo.getRenderDistance(); ++ ++ if (var2 > 3 && var2 < 15) { + this.renderDistance = var2; + } + +- this.chatVisibility = var1.getChatVisibility(); +- this.chatColours = var1.getChatColours(); +- if(this.b.isSinglePlayer() && this.b.getServerOwner().equals(this.bu)) { +- this.b.setDifficultyForAllWorlds(var1.getDifficulty()); ++ this.chatVisibility = par1Packet204ClientInfo.getChatVisibility(); ++ this.chatColours = par1Packet204ClientInfo.getChatColours(); ++ ++ if (this.mcServer.isSinglePlayer() && this.mcServer.getServerOwner().equals(this.username)) { ++ this.mcServer.setDifficultyForAllWorlds(par1Packet204ClientInfo.getDifficulty()); + } + +- this.setHideCape(1, !var1.getShowCape()); ++ this.setHideCape(1, !par1Packet204ClientInfo.getShowCape()); + } + + public int getChatVisibility() { + return this.chatVisibility; + } + +- public void requestTexturePackLoad(String var1, int var2) { +- String var3 = var1 + "\u0000" + var2; +- this.playerNetServerHandler.sendPacket(new Packet250CustomPayload("MC|TPack", var3.getBytes())); ++ /** ++ * on recieving this message the client (if permission is given) will download the requested textures ++ */ ++ public void requestTexturePackLoad(String par1Str, int par2) { ++ String var3 = par1Str + "\u0000" + par2; ++ this.playerNetServerHandler.sendPacketToPlayer(new Packet250CustomPayload("MC|TPack", var3.getBytes())); + } + +- public ChunkCoordinates getCommandSenderPosition() { ++ /** ++ * Return the position for this command sender. ++ */ ++ public ChunkCoordinates getPlayerCoordinates() { + return new ChunkCoordinates(MathHelper.floor_double(this.posX), MathHelper.floor_double(this.posY + 0.5D), MathHelper.floor_double(this.posZ)); + } + + public void func_143004_u() { +- this.field_143005_bX = MinecraftServer.getCurrentTimeMillis(); ++ this.field_143005_bX = MinecraftServer.getSystemTimeMillis(); + } + } diff --git a/patches/net/minecraft/src/EntityPlayerSP.java.patch b/patches/net/minecraft/src/EntityPlayerSP.java.patch new file mode 100644 index 0000000..488bbb7 --- /dev/null +++ b/patches/net/minecraft/src/EntityPlayerSP.java.patch @@ -0,0 +1,857 @@ +--- net/minecraft/src/EntityPlayerSP.java ++++ net/minecraft/src/EntityPlayerSP.java +@@ -1,9 +1,28 @@ + package net.minecraft.src; + ++// Spout Start ++ ++import org.spoutcraft.api.Spoutcraft; ++import org.spoutcraft.api.util.FixedLocation; ++import org.spoutcraft.client.SpoutClient; ++import org.spoutcraft.client.config.Configuration; ++import org.spoutcraft.client.gui.minimap.GuiOverviewMap; ++import org.spoutcraft.client.packet.PacketRenderDistance; ++import org.spoutcraft.client.player.ClientPlayer; ++// Spout End ++ + public class EntityPlayerSP extends AbstractClientPlayer { +- public MovementInput movementInput; ++ ++ public MovementInput movementInput; + protected Minecraft mc; ++ ++ /** ++ * Used to tell if the player pressed forward twice. If this is at 0 and it's pressed (And they are allowed to sprint, ++ * aka enough food on the ground etc) it sets this to 7. If it's pressed and it's greater than 0 enable sprinting. ++ */ + protected int sprintToggleTimer; ++ ++ /** Ticks left before sprinting is disabled. */ + public int sprintingTicksLeft; + public float renderArmYaw; + public float renderArmPitch; +@@ -14,39 +33,60 @@ + private MouseFilter field_71162_ch = new MouseFilter(); + private MouseFilter field_71160_ci = new MouseFilter(); + private MouseFilter field_71161_cj = new MouseFilter(); ++ ++ /** The amount of time an entity has been in a Portal */ + public float timeInPortal; ++ ++ /** The amount of time an entity has been in a Portal the previous tick */ + public float prevTimeInPortal; ++ // Spout Start ++ public FixedLocation lastClickLocation = null; ++ private KeyBinding fogKey = null; ++ // Spout End + +- public EntityPlayerSP(Minecraft var1, World var2, Session var3, int var4) { +- super(var2, var3.getUsername()); +- this.mc = var1; +- this.dimension = var4; ++ public EntityPlayerSP(Minecraft par1Minecraft, World par2World, Session par3Session, int par4) { ++ super(par2World, par3Session.getUsername()); ++ this.mc = par1Minecraft; ++ this.dimension = par4; ++ // Spout Start ++ ((ClientPlayer) spoutEnty).setPlayer(this); ++ SpoutClient.getInstance().player = (ClientPlayer) spoutEnty; ++ // Spout End + } + + public void updateEntityActionState() { + super.updateEntityActionState(); + this.moveStrafing = this.movementInput.moveStrafe; + this.moveForward = this.movementInput.moveForward; +- this.isJumping = this.movementInput.jump; ++ // Spout Start ++ this.isJumping = this.movementInput.jump || this.isTreadingWater(); ++ // Spout End + this.prevRenderArmYaw = this.renderArmYaw; + this.prevRenderArmPitch = this.renderArmPitch; + this.renderArmPitch = (float)((double)this.renderArmPitch + (double)(this.rotationPitch - this.renderArmPitch) * 0.5D); + this.renderArmYaw = (float)((double)this.renderArmYaw + (double)(this.rotationYaw - this.renderArmYaw) * 0.5D); + } +- ++ ++ /** ++ * Called frequently so the entity can update its state every tick as required. For example, zombies and skeletons use ++ * this to react to sunlight and start to burn. ++ */ + public void onLivingUpdate() { +- if(this.sprintingTicksLeft > 0) { ++ // Spout Start ++ if (this.sprintingTicksLeft > 0 && !runToggle) { ++ // Spout End + --this.sprintingTicksLeft; +- if(this.sprintingTicksLeft == 0) { ++ ++ if (this.sprintingTicksLeft == 0) { + this.setSprinting(false); + } + } + +- if(this.sprintToggleTimer > 0) { ++ if (this.sprintToggleTimer > 0) { + --this.sprintToggleTimer; + } + +- if(this.mc.playerController.enableEverythingIsScrewedUpMode()) { ++ if (this.mc.playerController.enableEverythingIsScrewedUpMode()) { + this.posX = this.posZ = 0.5D; + this.posX = 0.0D; + this.posZ = 0.0D; +@@ -54,56 +94,68 @@ + this.rotationPitch = 10.0F; + this.posY = 68.5D; + } else { +- if(!this.mc.statFileWriter.hasAchievementUnlocked(AchievementList.openInventory)) { +- this.mc.guiAchievement.queueAchievementInformation(AchievementList.openInventory); ++ if (!this.mc.statFileWriter.hasAchievementUnlocked(AchievementList.openInventory)) { ++ // Spout Start ++ //this.mc.guiAchievement.queueAchievementInformation(AchievementList.openInventory); ++ // Spout End + } + + this.prevTimeInPortal = this.timeInPortal; +- if(this.inPortal) { +- if(this.mc.currentScreen != null) { ++ ++ if (this.inPortal) { ++ if (this.mc.currentScreen != null) { + this.mc.displayGuiScreen((GuiScreen)null); + } + +- if(this.timeInPortal == 0.0F) { +- this.mc.sndManager.playSoundFX("portal.trigger", 1.0F, this.ab.nextFloat() * 0.4F + 0.8F); ++ if (this.timeInPortal == 0.0F) { ++ this.mc.sndManager.playSoundFX("portal.trigger", 1.0F, this.rand.nextFloat() * 0.4F + 0.8F); + } + + this.timeInPortal += 0.0125F; +- if(this.timeInPortal >= 1.0F) { ++ ++ if (this.timeInPortal >= 1.0F) { + this.timeInPortal = 1.0F; + } + + this.inPortal = false; +- } else if(this.isPotionActive(Potion.confusion) && this.getActivePotionEffect(Potion.confusion).getDuration() > 60) { +- this.timeInPortal += 2.0F / 3.0F * 0.01F; +- if(this.timeInPortal > 1.0F) { ++ } else if (this.isPotionActive(Potion.confusion) && this.getActivePotionEffect(Potion.confusion).getDuration() > 60) { ++ this.timeInPortal += 0.006666667F; ++ ++ if (this.timeInPortal > 1.0F) { + this.timeInPortal = 1.0F; + } + } else { +- if(this.timeInPortal > 0.0F) { ++ if (this.timeInPortal > 0.0F) { + this.timeInPortal -= 0.05F; + } + +- if(this.timeInPortal < 0.0F) { ++ if (this.timeInPortal < 0.0F) { + this.timeInPortal = 0.0F; + } + } + +- if(this.timeUntilPortal > 0) { ++ if (this.timeUntilPortal > 0) { + --this.timeUntilPortal; + } + ++ // Spout Start ++ boolean wasFlightUp = movementInput.flyingUp; ++ // Spout End ++ + boolean var1 = this.movementInput.jump; + float var2 = 0.8F; + boolean var3 = this.movementInput.moveForward >= var2; +- this.movementInput.updatePlayerMoveState(); +- if(this.isUsingItem() && !this.isRiding()) { ++ // Spout Start - Keep parameter ++ this.movementInput.updatePlayerMoveState(this); ++ // Spout End ++ ++ if (this.isUsingItem() && !this.isRiding()) { + this.movementInput.moveStrafe *= 0.2F; + this.movementInput.moveForward *= 0.2F; + this.sprintToggleTimer = 0; + } + +- if(this.movementInput.sneak && this.ySize < 0.2F) { ++ if (this.movementInput.sneak && this.ySize < 0.2F) { + this.ySize = 0.2F; + } + +@@ -112,8 +164,9 @@ + this.pushOutOfBlocks(this.posX + (double)this.width * 0.35D, this.boundingBox.minY + 0.5D, this.posZ - (double)this.width * 0.35D); + this.pushOutOfBlocks(this.posX + (double)this.width * 0.35D, this.boundingBox.minY + 0.5D, this.posZ + (double)this.width * 0.35D); + boolean var4 = (float)this.getFoodStats().getFoodLevel() > 6.0F || this.capabilities.allowFlying; +- if(this.onGround && !var3 && this.movementInput.moveForward >= var2 && !this.isSprinting() && var4 && !this.isUsingItem() && !this.isPotionActive(Potion.blindness)) { +- if(this.sprintToggleTimer == 0) { ++ ++ if (this.onGround && !var3 && this.movementInput.moveForward >= var2 && !this.isSprinting() && var4 && !this.isUsingItem() && !this.isPotionActive(Potion.blindness)) { ++ if (this.sprintToggleTimer == 0) { + this.sprintToggleTimer = 7; + } else { + this.setSprinting(true); +@@ -121,16 +174,18 @@ + } + } + +- if(this.isSneaking()) { ++ if (this.isSneaking()) { + this.sprintToggleTimer = 0; + } + +- if(this.isSprinting() && (this.movementInput.moveForward < var2 || this.isCollidedHorizontally || !var4)) { ++ if (this.isSprinting() && (this.movementInput.moveForward < var2 || this.isCollidedHorizontally || !var4)) { + this.setSprinting(false); + } + +- if(this.capabilities.allowFlying && !var1 && this.movementInput.jump) { +- if(this.flyToggleTimer == 0) { ++ // Spout Start ++ if (this.capabilities.allowFlying && !wasFlightUp && this.movementInput.flyingUp) { ++ // Spout End ++ if (this.flyToggleTimer == 0) { + this.flyToggleTimer = 7; + } else { + this.capabilities.isFlying = !this.capabilities.isFlying; +@@ -139,33 +194,45 @@ + } + } + +- if(this.capabilities.isFlying) { +- if(this.movementInput.sneak) { +- this.motionY -= 0.15D; ++ if (this.capabilities.isFlying) { ++ // Spout Start ++ if (this.movementInput.flyingDown) { ++ if (SpoutClient.getInstance().isFlySpeedCheat()) { ++ this.motionY -= 0.15D * Configuration.getFlightSpeedFactor(); ++ } else { ++ this.motionY -= 0.15D; ++ } + } + +- if(this.movementInput.jump) { +- this.motionY += 0.15D; ++ if (this.movementInput.flyingUp) { ++ if (SpoutClient.getInstance().isFlySpeedCheat()) { ++ this.motionY += 0.15D * Configuration.getFlightSpeedFactor(); ++ } else { ++ this.motionY += 0.15D; ++ } + } ++ // Spout End + } + +- if(this.isRidingHorse()) { +- if(this.horseJumpPowerCounter < 0) { ++ if (this.isRidingHorse()) { ++ if (this.horseJumpPowerCounter < 0) { + ++this.horseJumpPowerCounter; +- if(this.horseJumpPowerCounter == 0) { ++ ++ if (this.horseJumpPowerCounter == 0) { + this.horseJumpPower = 0.0F; + } + } + +- if(var1 && !this.movementInput.jump) { ++ if (var1 && !this.movementInput.jump) { + this.horseJumpPowerCounter = -10; + this.func_110318_g(); +- } else if(!var1 && this.movementInput.jump) { ++ } else if (!var1 && this.movementInput.jump) { + this.horseJumpPowerCounter = 0; + this.horseJumpPower = 0.0F; +- } else if(var1) { ++ } else if (var1) { + ++this.horseJumpPowerCounter; +- if(this.horseJumpPowerCounter < 10) { ++ ++ if (this.horseJumpPowerCounter < 10) { + this.horseJumpPower = (float)this.horseJumpPowerCounter * 0.1F; + } else { + this.horseJumpPower = 0.8F + 2.0F / (float)(this.horseJumpPowerCounter - 9) * 0.1F; +@@ -174,28 +241,34 @@ + } else { + this.horseJumpPower = 0.0F; + } +- ++ + super.onLivingUpdate(); +- if(this.onGround && this.capabilities.isFlying) { ++ ++ if (this.onGround && this.capabilities.isFlying) { + this.capabilities.isFlying = false; + this.sendPlayerAbilities(); + } +- + } + } + ++ /** ++ * Gets the player's field of view multiplier. (ex. when flying) ++ */ + public float getFOVMultiplier() { + float var1 = 1.0F; +- if(this.capabilities.isFlying) { ++ ++ if (this.capabilities.isFlying) { + var1 *= 1.1F; + } + + AttributeInstance var2 = this.getEntityAttribute(SharedMonsterAttributes.movementSpeed); + var1 = (float)((double)var1 * ((var2.getAttributeValue() / (double)this.capabilities.getWalkSpeed() + 1.0D) / 2.0D)); +- if(this.isUsingItem() && this.getItemInUse().itemID == Item.bow.itemID) { ++ ++ if (this.isUsingItem() && this.getItemInUse().itemID == Item.bow.itemID) { + int var3 = this.getItemInUseDuration(); + float var4 = (float)var3 / 20.0F; +- if(var4 > 1.0F) { ++ ++ if (var4 > 1.0F) { + var4 = 1.0F; + } else { + var4 *= var4; +@@ -207,100 +280,143 @@ + return var1; + } + ++ /** ++ * sets current screen to null (used on escape buttons of GUIs) ++ */ + public void closeScreen() { + super.closeScreen(); + this.mc.displayGuiScreen((GuiScreen)null); + } + +- public void displayGUIEditSign(TileEntity var1) { +- if(var1 instanceof TileEntitySign) { +- this.mc.displayGuiScreen(new GuiEditSign((TileEntitySign)var1)); +- } else if(var1 instanceof TileEntityCommandBlock) { +- this.mc.displayGuiScreen(new GuiCommandBlock((TileEntityCommandBlock)var1)); +- } +- +- } +- +- public void displayGUIBook(ItemStack var1) { +- Item var2 = var1.getItem(); +- if(var2 == Item.writtenBook) { +- this.mc.displayGuiScreen(new GuiScreenBook(this, var1, false)); +- } else if(var2 == Item.writableBook) { +- this.mc.displayGuiScreen(new GuiScreenBook(this, var1, true)); +- } +- +- } +- +- public void displayGUIChest(IInventory var1) { +- this.mc.displayGuiScreen(new GuiChest(this.inventory, var1)); +- } +- +- public void displayGUIHopper(TileEntityHopper var1) { +- this.mc.displayGuiScreen(new GuiHopper(this.inventory, var1)); +- } +- +- public void displayGUIHopperMinecart(EntityMinecartHopper var1) { +- this.mc.displayGuiScreen(new GuiHopper(this.inventory, var1)); +- } +- +- public void displayGUIHorse(EntityHorse var1, IInventory var2) { +- this.mc.displayGuiScreen(new GuiScreenHorseInventory(this.inventory, var2, var1)); +- } +- +- public void displayGUIWorkbench(int var1, int var2, int var3) { +- this.mc.displayGuiScreen(new GuiCrafting(this.inventory, this.worldObj, var1, var2, var3)); +- } +- +- public void displayGUIEnchantment(int var1, int var2, int var3, String var4) { +- this.mc.displayGuiScreen(new GuiEnchantment(this.inventory, this.worldObj, var1, var2, var3, var4)); +- } +- +- public void displayGUIAnvil(int var1, int var2, int var3) { +- this.mc.displayGuiScreen(new GuiRepair(this.inventory, this.worldObj, var1, var2, var3)); +- } +- +- public void displayGUIFurnace(TileEntityFurnace var1) { +- this.mc.displayGuiScreen(new GuiFurnace(this.inventory, var1)); +- } +- +- public void displayGUIBrewingStand(TileEntityBrewingStand var1) { +- this.mc.displayGuiScreen(new GuiBrewingStand(this.inventory, var1)); +- } +- +- public void displayGUIBeacon(TileEntityBeacon var1) { +- this.mc.displayGuiScreen(new GuiBeacon(this.inventory, var1)); +- } +- +- public void displayGUIDispenser(TileEntityDispenser var1) { +- this.mc.displayGuiScreen(new GuiDispenser(this.inventory, var1)); +- } +- +- public void displayGUIMerchant(IMerchant var1, String var2) { +- this.mc.displayGuiScreen(new GuiMerchant(this.inventory, var1, this.worldObj, var2)); +- } +- +- public void onCriticalHit(Entity var1) { +- this.mc.effectRenderer.addEffect(new EntityCrit2FX(this.mc.theWorld, var1)); +- } +- +- public void onEnchantmentCritical(Entity var1) { +- EntityCrit2FX var2 = new EntityCrit2FX(this.mc.theWorld, var1, "magicCrit"); ++ /** ++ * Displays the GUI for editing a sign. Args: tileEntitySign ++ */ ++ public void displayGUIEditSign(TileEntity par1TileEntity) { ++ if (par1TileEntity instanceof TileEntitySign) { ++ this.mc.displayGuiScreen(new GuiEditSign((TileEntitySign)par1TileEntity)); ++ } else if (par1TileEntity instanceof TileEntityCommandBlock) { ++ this.mc.displayGuiScreen(new GuiCommandBlock((TileEntityCommandBlock)par1TileEntity)); ++ } ++ } ++ ++ /** ++ * Displays the GUI for interacting with a book. ++ */ ++ public void displayGUIBook(ItemStack par1ItemStack) { ++ Item var2 = par1ItemStack.getItem(); ++ ++ if (var2 == Item.writtenBook) { ++ this.mc.displayGuiScreen(new GuiScreenBook(this, par1ItemStack, false)); ++ } else if (var2 == Item.writableBook) { ++ this.mc.displayGuiScreen(new GuiScreenBook(this, par1ItemStack, true)); ++ } ++ } ++ ++ /** ++ * Displays the GUI for interacting with a chest inventory. Args: chestInventory ++ */ ++ public void displayGUIChest(IInventory par1IInventory) { ++ this.mc.displayGuiScreen(new GuiChest(this.inventory, par1IInventory)); ++ } ++ ++ public void displayGUIHopper(TileEntityHopper par1TileEntityHopper) { ++ this.mc.displayGuiScreen(new GuiHopper(this.inventory, par1TileEntityHopper)); ++ } ++ ++ public void displayGUIHopperMinecart(EntityMinecartHopper par1EntityMinecartHopper) { ++ this.mc.displayGuiScreen(new GuiHopper(this.inventory, par1EntityMinecartHopper)); ++ } ++ ++ public void displayGUIHorse(EntityHorse par1EntityHorse, IInventory par2IInventory) { ++ this.mc.displayGuiScreen(new GuiScreenHorseInventory(this.inventory, par2IInventory, par1EntityHorse)); ++ } ++ ++ /** ++ * Displays the crafting GUI for a workbench. ++ */ ++ public void displayGUIWorkbench(int par1, int par2, int par3) { ++ this.mc.displayGuiScreen(new GuiCrafting(this.inventory, this.worldObj, par1, par2, par3)); ++ } ++ ++ public void displayGUIEnchantment(int par1, int par2, int par3, String par4Str) { ++ this.mc.displayGuiScreen(new GuiEnchantment(this.inventory, this.worldObj, par1, par2, par3, par4Str)); ++ } ++ ++ /** ++ * Displays the GUI for interacting with an anvil. ++ */ ++ public void displayGUIAnvil(int par1, int par2, int par3) { ++ this.mc.displayGuiScreen(new GuiRepair(this.inventory, this.worldObj, par1, par2, par3)); ++ } ++ ++ /** ++ * Displays the furnace GUI for the passed in furnace entity. Args: tileEntityFurnace ++ */ ++ public void displayGUIFurnace(TileEntityFurnace par1TileEntityFurnace) { ++ this.mc.displayGuiScreen(new GuiFurnace(this.inventory, par1TileEntityFurnace)); ++ } ++ ++ /** ++ * Displays the GUI for interacting with a brewing stand. ++ */ ++ public void displayGUIBrewingStand(TileEntityBrewingStand par1TileEntityBrewingStand) { ++ this.mc.displayGuiScreen(new GuiBrewingStand(this.inventory, par1TileEntityBrewingStand)); ++ } ++ ++ /** ++ * Displays the GUI for interacting with a beacon. ++ */ ++ public void displayGUIBeacon(TileEntityBeacon par1TileEntityBeacon) { ++ this.mc.displayGuiScreen(new GuiBeacon(this.inventory, par1TileEntityBeacon)); ++ } ++ ++ /** ++ * Displays the dipsenser GUI for the passed in dispenser entity. Args: TileEntityDispenser ++ */ ++ public void displayGUIDispenser(TileEntityDispenser par1TileEntityDispenser) { ++ this.mc.displayGuiScreen(new GuiDispenser(this.inventory, par1TileEntityDispenser)); ++ } ++ ++ public void displayGUIMerchant(IMerchant par1IMerchant, String par2Str) { ++ this.mc.displayGuiScreen(new GuiMerchant(this.inventory, par1IMerchant, this.worldObj, par2Str)); ++ } ++ ++ /** ++ * Called when the player performs a critical hit on the Entity. Args: entity that was hit critically ++ */ ++ public void onCriticalHit(Entity par1Entity) { ++ this.mc.effectRenderer.addEffect(new EntityCrit2FX(this.mc.theWorld, par1Entity)); ++ } ++ ++ public void onEnchantmentCritical(Entity par1Entity) { ++ EntityCrit2FX var2 = new EntityCrit2FX(this.mc.theWorld, par1Entity, "magicCrit"); + this.mc.effectRenderer.addEffect(var2); + } + +- public void onItemPickup(Entity var1, int var2) { +- this.mc.effectRenderer.addEffect(new EntityPickupFX(this.mc.theWorld, var1, this, -0.5F)); ++ /** ++ * Called whenever an item is picked up from walking over it. Args: pickedUpEntity, stackSize ++ */ ++ public void onItemPickup(Entity par1Entity, int par2) { ++ this.mc.effectRenderer.addEffect(new EntityPickupFX(this.mc.theWorld, par1Entity, this, -0.5F)); + } + ++ /** ++ * Returns if this entity is sneaking. ++ */ + public boolean isSneaking() { + return this.movementInput.sneak && !this.sleeping; + } + +- public void setPlayerSPHealth(float var1) { +- float var2 = this.getHealth() - var1; +- if(var2 <= 0.0F) { +- this.setHealth(var1); +- if(var2 < 0.0F) { ++ /** ++ * Updates health locally. ++ */ ++ public void setPlayerSPHealth(float par1) { ++ float var2 = this.getHealth() - par1; ++ ++ if (var2 <= 0.0F) { ++ this.setHealth(par1); ++ ++ if (var2 < 0.0F) { + this.hurtResistantTime = this.maxHurtResistantTime / 2; + } + } else { +@@ -310,82 +426,93 @@ + this.damageEntity(DamageSource.generic, var2); + this.hurtTime = this.maxHurtTime = 10; + } +- +- } +- +- public void addChatMessage(String var1) { +- this.mc.ingameGUI.getChatGUI().addTranslatedMessage(var1, new Object[0]); +- } +- +- public void addStat(StatBase var1, int var2) { +- if(var1 != null) { +- if(var1.isAchievement()) { +- Achievement var3 = (Achievement)var1; +- if(var3.parentAchievement == null || this.mc.statFileWriter.hasAchievementUnlocked(var3.parentAchievement)) { +- if(!this.mc.statFileWriter.hasAchievementUnlocked(var3)) { ++ } ++ ++ /** ++ * Add a chat message to the player ++ */ ++ public void addChatMessage(String par1Str) { ++ this.mc.ingameGUI.getChatGUI().addTranslatedMessage(par1Str, new Object[0]); ++ } ++ ++ /** ++ * Adds a value to a statistic field. ++ */ ++ public void addStat(StatBase par1StatBase, int par2) { ++ if (par1StatBase != null) { ++ if (par1StatBase.isAchievement()) { ++ Achievement var3 = (Achievement)par1StatBase; ++ ++ if (var3.parentAchievement == null || this.mc.statFileWriter.hasAchievementUnlocked(var3.parentAchievement)) { ++ if (!this.mc.statFileWriter.hasAchievementUnlocked(var3)) { + this.mc.guiAchievement.queueTakenAchievement(var3); + } + +- this.mc.statFileWriter.readStat(var1, var2); ++ this.mc.statFileWriter.readStat(par1StatBase, par2); + } + } else { +- this.mc.statFileWriter.readStat(var1, var2); ++ this.mc.statFileWriter.readStat(par1StatBase, par2); + } +- + } + } + +- private boolean isBlockTranslucent(int var1, int var2, int var3) { +- return this.worldObj.isBlockNormalCube(var1, var2, var3); ++ private boolean isBlockTranslucent(int par1, int par2, int par3) { ++ return this.worldObj.isBlockNormalCube(par1, par2, par3); + } + +- protected boolean pushOutOfBlocks(double var1, double var3, double var5) { +- int var7 = MathHelper.floor_double(var1); +- int var8 = MathHelper.floor_double(var3); +- int var9 = MathHelper.floor_double(var5); +- double var10 = var1 - (double)var7; +- double var12 = var5 - (double)var9; +- if(this.isBlockTranslucent(var7, var8, var9) || this.isBlockTranslucent(var7, var8 + 1, var9)) { ++ /** ++ * Adds velocity to push the entity out of blocks at the specified x, y, z position Args: x, y, z ++ */ ++ protected boolean pushOutOfBlocks(double par1, double par3, double par5) { ++ int var7 = MathHelper.floor_double(par1); ++ int var8 = MathHelper.floor_double(par3); ++ int var9 = MathHelper.floor_double(par5); ++ double var10 = par1 - (double)var7; ++ double var12 = par5 - (double)var9; ++ ++ if (this.isBlockTranslucent(var7, var8, var9) || this.isBlockTranslucent(var7, var8 + 1, var9)) { + boolean var14 = !this.isBlockTranslucent(var7 - 1, var8, var9) && !this.isBlockTranslucent(var7 - 1, var8 + 1, var9); + boolean var15 = !this.isBlockTranslucent(var7 + 1, var8, var9) && !this.isBlockTranslucent(var7 + 1, var8 + 1, var9); + boolean var16 = !this.isBlockTranslucent(var7, var8, var9 - 1) && !this.isBlockTranslucent(var7, var8 + 1, var9 - 1); + boolean var17 = !this.isBlockTranslucent(var7, var8, var9 + 1) && !this.isBlockTranslucent(var7, var8 + 1, var9 + 1); + byte var18 = -1; + double var19 = 9999.0D; +- if(var14 && var10 < var19) { ++ ++ if (var14 && var10 < var19) { + var19 = var10; + var18 = 0; + } + +- if(var15 && 1.0D - var10 < var19) { ++ if (var15 && 1.0D - var10 < var19) { + var19 = 1.0D - var10; + var18 = 1; + } + +- if(var16 && var12 < var19) { ++ if (var16 && var12 < var19) { + var19 = var12; + var18 = 4; + } + +- if(var17 && 1.0D - var12 < var19) { ++ if (var17 && 1.0D - var12 < var19) { + var19 = 1.0D - var12; + var18 = 5; + } + + float var21 = 0.1F; +- if(var18 == 0) { ++ ++ if (var18 == 0) { + this.motionX = (double)(-var21); + } + +- if(var18 == 1) { ++ if (var18 == 1) { + this.motionX = (double)var21; + } + +- if(var18 == 4) { ++ if (var18 == 4) { + this.motionZ = (double)(-var21); + } + +- if(var18 == 5) { ++ if (var18 == 5) { + this.motionZ = (double)var21; + } + } +@@ -393,37 +520,56 @@ + return false; + } + +- public void setSprinting(boolean var1) { +- super.setSprinting(var1); +- this.sprintingTicksLeft = var1 ? 600 : 0; +- } +- +- public void setXPStats(float var1, int var2, int var3) { +- this.experience = var1; +- this.experienceTotal = var2; +- this.experienceLevel = var3; +- } +- +- public void sendChatToPlayer(ChatMessageComponent var1) { +- this.mc.ingameGUI.getChatGUI().printChatMessage(var1.toStringWithFormatting(true)); +- } +- +- public boolean canCommandSenderUseCommand(int var1, String var2) { +- return var1 <= 0; +- } +- +- public ChunkCoordinates getCommandSenderPosition() { ++ /** ++ * Set sprinting switch for Entity. ++ */ ++ public void setSprinting(boolean par1) { ++ super.setSprinting(par1); ++ this.sprintingTicksLeft = par1 ? 600 : 0; ++ } ++ ++ /** ++ * Sets the current XP, total XP, and level number. ++ */ ++ public void setXPStats(float par1, int par2, int par3) { ++ this.experience = par1; ++ this.experienceTotal = par2; ++ this.experienceLevel = par3; ++ } ++ ++ //ToDO: This printChatMessage() method may not need to be called, its blocked within 1.5.2 ++ public void sendChatToPlayer(ChatMessageComponent par1ChatMessageComponent) { ++ this.mc.ingameGUI.getChatGUI().printChatMessage(par1ChatMessageComponent.toStringWithFormatting(true)); ++ } ++ ++ /** ++ * Returns true if the command sender is allowed to use the given command. ++ */ ++ public boolean canCommandSenderUseCommand(int par1, String par2Str) { ++ return par1 <= 0; ++ } ++ ++ /** ++ * Return the position for this command sender. ++ */ ++ public ChunkCoordinates getPlayerCoordinates() { + return new ChunkCoordinates(MathHelper.floor_double(this.posX + 0.5D), MathHelper.floor_double(this.posY + 0.5D), MathHelper.floor_double(this.posZ + 0.5D)); + } + ++ /** ++ * Returns the item that this EntityLiving is holding, if any. ++ */ + public ItemStack getHeldItem() { + return this.inventory.getCurrentItem(); + } + +- public void playSound(String var1, float var2, float var3) { +- this.worldObj.playSound(this.posX, this.posY - (double)this.yOffset, this.posZ, var1, var2, var3, false); ++ public void playSound(String par1Str, float par2, float par3) { ++ this.worldObj.playSound(this.posX, this.posY - (double)this.yOffset, this.posZ, par1Str, par2, par3, false); + } +- ++ ++ /** ++ * Returns whether the entity is in a local (client) world ++ */ + public boolean isClientWorld() { + return true; + } +@@ -436,6 +582,101 @@ + return this.horseJumpPower; + } + +- protected void func_110318_g() { +- } ++ protected void func_110318_g() {} ++ ++ // Spout ++ public boolean canSprint() { ++ return this.getFoodStats().getFoodLevel() > 6.0F; ++ } ++ ++ @Override ++ public void handleKeyPress(int key, boolean keyReleased) { ++ if (keyReleased) { ++ final GameSettings settings = SpoutClient.getHandle().gameSettings; ++ ++ // Fog toggle ++ if (key == settings.keyBindToggleFog.keyCode) { ++ byte view = (byte)settings.renderDistance; ++ byte newView = (byte) SpoutClient.getInstance().getActivePlayer().getNextRenderDistance().getValue(); ++ fogKey = settings.keyBindToggleFog; ++ settings.keyBindToggleFog = new KeyBinding("key.fog", -1); ++ if (view != newView) { ++ Configuration.setRenderDistance(newView); ++ Configuration.write(); ++ if (this instanceof EntityClientPlayerMP && Spoutcraft.getClient().isSpoutEnabled()) { ++ SpoutClient.getInstance().getPacketManager().sendSpoutPacket(new PacketRenderDistance((byte)newView)); ++ } ++ } ++ // Sneak toggle ++ } else if (key == settings.keySneakToggle.keyCode) { ++ sneakToggle = !sneakToggle; ++ if (sneakToggle) { ++ runToggle = false; ++ setSprinting(false); ++ treadWaterToggle = false; ++ } ++ // Run toggle ++ } else if (key == settings.keyRunToggle.keyCode) { ++ runToggle = !runToggle; ++ setSprinting(runToggle); ++ if (runToggle) { ++ sneakToggle = false; ++ treadWaterToggle = false; ++ } ++ // Water tread ++ } else if (key == settings.keyTreadWaterToggle.keyCode) { ++ treadWaterToggle = !treadWaterToggle; ++ if (treadWaterToggle) { ++ runToggle = false; ++ setSprinting(false); ++ sneakToggle = false; ++ } ++ // Auto forward ++ } else if (key == settings.keyAutoForward.keyCode) { ++ if (Spoutcraft.hasPermission("spout.plugin.autorun.forward")) { ++ autoforwardToggle = !autoforwardToggle; ++ autoBackwardToggle = false; ++ } ++ } else if (key == settings.keyBindForward.keyCode && autoforwardToggle) { ++ autoforwardToggle = false; ++ autoBackwardToggle = false; ++ // Auto backward ++ } else if (key == settings.keyAutoBackward.keyCode) { ++ if (Spoutcraft.hasPermission("spout.plugin.autorun.backward")) { ++ autoBackwardToggle = !autoBackwardToggle; ++ autoforwardToggle = false; ++ } ++ } else if (key == settings.keyBindBack.keyCode && autoBackwardToggle) { ++ autoBackwardToggle = false; ++ autoforwardToggle = false; ++ // Overview map ++ } else if (key == settings.keyWaypoint.keyCode){ ++ if(Spoutcraft.hasPermission("spout.plugin.overviewmap")) { ++ mc.displayGuiScreen(new GuiOverviewMap()); ++ } ++ } else if (key == settings.keyHideChat.keyCode){ ++ if (Spoutcraft.getActivePlayer() != null) { ++ Spoutcraft.getActivePlayer().getMainScreen().getChatTextBox().setVisible(!Spoutcraft.getActivePlayer().getMainScreen().getChatTextBox().isVisible()); ++ } ++ } ++ ++ if (this.capabilities.allowFlying && key == settings.keyFlyToggle.keyCode) { ++ this.capabilities.isFlying = !this.capabilities.isFlying; ++ if (this.capabilities.isFlying) { ++ posY += 0.1D; ++ this.motionY += 0.15D; ++ } ++ } ++ } ++ } ++ ++ @Override ++ public void onUpdate() { ++ if (fogKey != null) { ++ SpoutClient.getHandle().gameSettings.keyBindToggleFog = fogKey; ++ fogKey = null; ++ } ++ super.onUpdate(); ++ } ++ // Spout End + } diff --git a/patches/net/minecraft/src/EntityPortalFX.java.patch b/patches/net/minecraft/src/EntityPortalFX.java.patch new file mode 100644 index 0000000..8451a8b --- /dev/null +++ b/patches/net/minecraft/src/EntityPortalFX.java.patch @@ -0,0 +1,111 @@ +--- net/minecraft/src/EntityPortalFX.java ++++ net/minecraft/src/EntityPortalFX.java +@@ -1,60 +1,76 @@ + package net.minecraft.src; + ++// MCPatcher Start ++import com.prupe.mcpatcher.cc.ColorizeEntity; ++// MCPatcher End ++ + public class EntityPortalFX extends EntityFX { + private float portalParticleScale; + private double portalPosX; + private double portalPosY; + private double portalPosZ; + +- public EntityPortalFX(World var1, double var2, double var4, double var6, double var8, double var10, double var12) { +- super(var1, var2, var4, var6, var8, var10, var12); +- this.motionX = var8; +- this.motionY = var10; +- this.motionZ = var12; +- this.portalPosX = this.posX = var2; +- this.portalPosY = this.posY = var4; +- this.portalPosZ = this.posZ = var6; +- float var14 = this.ab.nextFloat() * 0.6F + 0.4F; +- this.portalParticleScale = this.particleScale = this.ab.nextFloat() * 0.2F + 0.5F; ++ public EntityPortalFX(World par1World, double par2, double par4, double par6, double par8, double par10, double par12) { ++ super(par1World, par2, par4, par6, par8, par10, par12); ++ this.motionX = par8; ++ this.motionY = par10; ++ this.motionZ = par12; ++ this.portalPosX = this.posX = par2; ++ this.portalPosY = this.posY = par4; ++ this.portalPosZ = this.posZ = par6; ++ float var14 = this.rand.nextFloat() * 0.6F + 0.4F; ++ this.portalParticleScale = this.particleScale = this.rand.nextFloat() * 0.2F + 0.5F; + this.particleRed = this.particleGreen = this.particleBlue = 1.0F * var14; +- this.particleGreen *= 0.3F; +- this.particleRed *= 0.9F; ++ // MCPatcher Start ++ this.particleGreen *= ColorizeEntity.portalColor[1]; ++ this.particleRed *= ColorizeEntity.portalColor[0]; ++ // MCPatcher End + this.particleMaxAge = (int)(Math.random() * 10.0D) + 40; + this.noClip = true; + this.setParticleTextureIndex((int)(Math.random() * 8.0D)); ++ // MCPatcher Start ++ this.particleBlue = ColorizeEntity.portalColor[2]; ++ // MCPatcher End + } + +- public void renderParticle(Tessellator var1, float var2, float var3, float var4, float var5, float var6, float var7) { +- float var8 = ((float)this.particleAge + var2) / (float)this.particleMaxAge; ++ public void renderParticle(Tessellator par1Tessellator, float par2, float par3, float par4, float par5, float par6, float par7) { ++ float var8 = ((float)this.particleAge + par2) / (float)this.particleMaxAge; + var8 = 1.0F - var8; + var8 *= var8; + var8 = 1.0F - var8; + this.particleScale = this.portalParticleScale * var8; +- super.renderParticle(var1, var2, var3, var4, var5, var6, var7); ++ super.renderParticle(par1Tessellator, par2, par3, par4, par5, par6, par7); + } + +- public int getBrightnessForRender(float var1) { +- int var2 = super.getBrightnessForRender(var1); ++ public int getBrightnessForRender(float par1) { ++ int var2 = super.getBrightnessForRender(par1); + float var3 = (float)this.particleAge / (float)this.particleMaxAge; + var3 *= var3; + var3 *= var3; + int var4 = var2 & 255; + int var5 = var2 >> 16 & 255; + var5 += (int)(var3 * 15.0F * 16.0F); +- if(var5 > 240) { ++ ++ if (var5 > 240) { + var5 = 240; + } + + return var4 | var5 << 16; + } + +- public float getBrightness(float var1) { +- float var2 = super.getBrightness(var1); ++ /** ++ * Gets how bright this entity is. ++ */ ++ public float getBrightness(float par1) { ++ float var2 = super.getBrightness(par1); + float var3 = (float)this.particleAge / (float)this.particleMaxAge; + var3 = var3 * var3 * var3 * var3; + return var2 * (1.0F - var3) + var3; + } + ++ /** ++ * Called to update the entity's position/logic. ++ */ + public void onUpdate() { + this.prevPosX = this.posX; + this.prevPosY = this.posY; +@@ -66,9 +82,9 @@ + this.posX = this.portalPosX + this.motionX * (double)var1; + this.posY = this.portalPosY + this.motionY * (double)var1 + (double)(1.0F - var2); + this.posZ = this.portalPosZ + this.motionZ * (double)var1; +- if(this.particleAge++ >= this.particleMaxAge) { ++ ++ if (this.particleAge++ >= this.particleMaxAge) { + this.setDead(); + } +- + } + } diff --git a/patches/net/minecraft/src/EntityPotion.java.patch b/patches/net/minecraft/src/EntityPotion.java.patch new file mode 100644 index 0000000..f600bc3 --- /dev/null +++ b/patches/net/minecraft/src/EntityPotion.java.patch @@ -0,0 +1,209 @@ +--- net/minecraft/src/EntityPotion.java ++++ net/minecraft/src/EntityPotion.java +@@ -4,30 +4,37 @@ + import java.util.List; + + public class EntityPotion extends EntityThrowable { ++ ++ /** ++ * The damage value of the thrown potion that this EntityPotion represents. ++ */ + private ItemStack potionDamage; + +- public EntityPotion(World var1) { +- super(var1); +- } +- +- public EntityPotion(World var1, EntityLivingBase var2, int var3) { +- this(var1, var2, new ItemStack(Item.potion, 1, var3)); +- } +- +- public EntityPotion(World var1, EntityLivingBase var2, ItemStack var3) { +- super(var1, var2); +- this.potionDamage = var3; +- } +- +- public EntityPotion(World var1, double var2, double var4, double var6, int var8) { +- this(var1, var2, var4, var6, new ItemStack(Item.potion, 1, var8)); +- } +- +- public EntityPotion(World var1, double var2, double var4, double var6, ItemStack var8) { +- super(var1, var2, var4, var6); +- this.potionDamage = var8; +- } +- ++ public EntityPotion(World par1World) { ++ super(par1World); ++ } ++ ++ public EntityPotion(World par1World, EntityLivingBase par2EntityLivingBase, int par3) { ++ this(par1World, par2EntityLivingBase, new ItemStack(Item.potion, 1, par3)); ++ } ++ ++ public EntityPotion(World par1World, EntityLivingBase par2EntityLivingBase, ItemStack par3ItemStack) { ++ super(par1World, par2EntityLivingBase); ++ this.potionDamage = par3ItemStack; ++ } ++ ++ public EntityPotion(World par1World, double par2, double par4, double par6, int par8) { ++ this(par1World, par2, par4, par6, new ItemStack(Item.potion, 1, par8)); ++ } ++ ++ public EntityPotion(World par1World, double par2, double par4, double par6, ItemStack par8ItemStack) { ++ super(par1World, par2, par4, par6); ++ this.potionDamage = par8ItemStack; ++ } ++ ++ /** ++ * Gets the amount of gravity to apply to the thrown entity with each tick. ++ */ + protected float getGravityVelocity() { + return 0.05F; + } +@@ -40,60 +47,64 @@ + return -20.0F; + } + +- public void setPotionDamage(int var1) { +- if(this.potionDamage == null) { ++ public void setPotionDamage(int par1) { ++ if (this.potionDamage == null) { + this.potionDamage = new ItemStack(Item.potion, 1, 0); + } + +- this.potionDamage.setItemDamage(var1); ++ this.potionDamage.setItemDamage(par1); + } + ++ /** ++ * Returns the damage value of the thrown potion that this EntityPotion represents. ++ */ + public int getPotionDamage() { +- if(this.potionDamage == null) { ++ if (this.potionDamage == null) { + this.potionDamage = new ItemStack(Item.potion, 1, 0); + } + + return this.potionDamage.getItemDamage(); + } + +- protected void onImpact(MovingObjectPosition var1) { +- if(!this.worldObj.isRemote) { ++ /** ++ * Called when this EntityThrowable hits a block or entity. ++ */ ++ protected void onImpact(MovingObjectPosition par1MovingObjectPosition) { ++ if (!this.worldObj.isRemote) { + List var2 = Item.potion.getEffects(this.potionDamage); +- if(var2 != null && !var2.isEmpty()) { ++ ++ if (var2 != null && !var2.isEmpty()) { + AxisAlignedBB var3 = this.boundingBox.expand(4.0D, 2.0D, 4.0D); + List var4 = this.worldObj.getEntitiesWithinAABB(EntityLivingBase.class, var3); +- if(var4 != null && !var4.isEmpty()) { ++ ++ if (var4 != null && !var4.isEmpty()) { + Iterator var5 = var4.iterator(); + +- label48: +- while(true) { +- EntityLivingBase var6; +- double var7; +- do { +- if(!var5.hasNext()) { +- break label48; ++ while (var5.hasNext()) { ++ EntityLivingBase var6 = (EntityLivingBase)var5.next(); ++ double var7 = this.getDistanceSqToEntity(var6); ++ ++ if (var7 < 16.0D) { ++ double var9 = 1.0D - Math.sqrt(var7) / 4.0D; ++ ++ if (var6 == par1MovingObjectPosition.entityHit) { ++ var9 = 1.0D; + } + +- var6 = (EntityLivingBase)var5.next(); +- var7 = this.getDistanceSqToEntity(var6); +- } while(var7 >= 16.0D); +- +- double var9 = 1.0D - Math.sqrt(var7) / 4.0D; +- if(var6 == var1.entityHit) { +- var9 = 1.0D; +- } +- +- Iterator var11 = var2.iterator(); +- +- while(var11.hasNext()) { +- PotionEffect var12 = (PotionEffect)var11.next(); +- int var13 = var12.getPotionID(); +- if(Potion.potionTypes[var13].isInstant()) { +- Potion.potionTypes[var13].affectEntity(this.getThrower(), var6, var12.getAmplifier(), var9); +- } else { +- int var14 = (int)(var9 * (double)var12.getDuration() + 0.5D); +- if(var14 > 20) { +- var6.addPotionEffect(new PotionEffect(var13, var14, var12.getAmplifier())); ++ Iterator var11 = var2.iterator(); ++ ++ while (var11.hasNext()) { ++ PotionEffect var12 = (PotionEffect)var11.next(); ++ int var13 = var12.getPotionID(); ++ ++ if (Potion.potionTypes[var13].isInstant()) { ++ Potion.potionTypes[var13].affectEntity(this.getThrower(), var6, var12.getAmplifier(), var9); ++ } else { ++ int var14 = (int)(var9 * (double)var12.getDuration() + 0.5D); ++ ++ if (var14 > 20) { ++ var6.addPotionEffect(new PotionEffect(var13, var14, var12.getAmplifier())); ++ } + } + } + } +@@ -104,28 +115,33 @@ + this.worldObj.playAuxSFX(2002, (int)Math.round(this.posX), (int)Math.round(this.posY), (int)Math.round(this.posZ), this.getPotionDamage()); + this.setDead(); + } +- + } + +- public void readEntityFromNBT(NBTTagCompound var1) { +- super.readEntityFromNBT(var1); +- if(var1.hasKey("Potion")) { +- this.potionDamage = ItemStack.loadItemStackFromNBT(var1.getCompoundTag("Potion")); ++ /** ++ * (abstract) Protected helper method to read subclass entity data from NBT. ++ */ ++ public void readEntityFromNBT(NBTTagCompound par1NBTTagCompound) { ++ super.readEntityFromNBT(par1NBTTagCompound); ++ ++ if (par1NBTTagCompound.hasKey("Potion")) { ++ this.potionDamage = ItemStack.loadItemStackFromNBT(par1NBTTagCompound.getCompoundTag("Potion")); + } else { +- this.setPotionDamage(var1.getInteger("potionValue")); ++ this.setPotionDamage(par1NBTTagCompound.getInteger("potionValue")); + } + +- if(this.potionDamage == null) { ++ if (this.potionDamage == null) { + this.setDead(); + } +- + } + +- public void writeEntityToNBT(NBTTagCompound var1) { +- super.writeEntityToNBT(var1); +- if(this.potionDamage != null) { +- var1.setCompoundTag("Potion", this.potionDamage.writeToNBT(new NBTTagCompound())); +- } ++ /** ++ * (abstract) Protected helper method to write subclass entity data to NBT. ++ */ ++ public void writeEntityToNBT(NBTTagCompound par1NBTTagCompound) { ++ super.writeEntityToNBT(par1NBTTagCompound); + ++ if (this.potionDamage != null) { ++ par1NBTTagCompound.setCompoundTag("Potion", this.potionDamage.writeToNBT(new NBTTagCompound())); ++ } + } + } diff --git a/patches/net/minecraft/src/EntityRainFX.java.patch b/patches/net/minecraft/src/EntityRainFX.java.patch new file mode 100644 index 0000000..d0e0db5 --- /dev/null +++ b/patches/net/minecraft/src/EntityRainFX.java.patch @@ -0,0 +1,90 @@ +--- net/minecraft/src/EntityRainFX.java ++++ net/minecraft/src/EntityRainFX.java +@@ -1,49 +1,68 @@ + package net.minecraft.src; + ++// MCPatcher Start ++import com.prupe.mcpatcher.cc.ColorizeBlock; ++// MCPatcher End ++ + public class EntityRainFX extends EntityFX { +- public EntityRainFX(World var1, double var2, double var4, double var6) { +- super(var1, var2, var4, var6, 0.0D, 0.0D, 0.0D); +- this.motionX *= (double)0.3F; ++ public EntityRainFX(World par1World, double par2, double par4, double par6) { ++ super(par1World, par2, par4, par6, 0.0D, 0.0D, 0.0D); ++ this.motionX *= 0.30000001192092896D; + this.motionY = (double)((float)Math.random() * 0.2F + 0.1F); +- this.motionZ *= (double)0.3F; +- this.particleRed = 1.0F; +- this.particleGreen = 1.0F; +- this.particleBlue = 1.0F; +- this.setParticleTextureIndex(19 + this.ab.nextInt(4)); ++ this.motionZ *= 0.30000001192092896D; ++ ++ // MCPatcher Start ++ if (ColorizeBlock.computeWaterColor(this.posX, this.posY, this.posZ)) { ++ this.particleRed = ColorizeBlock.waterColor[0]; ++ this.particleGreen = ColorizeBlock.waterColor[1]; ++ this.particleBlue = ColorizeBlock.waterColor[2]; ++ } else { ++ this.particleRed = 0.2F; ++ this.particleGreen = 0.3F; ++ this.particleBlue = 1.0F; ++ } ++ // MCPatcher End ++ ++ this.setParticleTextureIndex(19 + this.rand.nextInt(4)); + this.setSize(0.01F, 0.01F); + this.particleGravity = 0.06F; + this.particleMaxAge = (int)(8.0D / (Math.random() * 0.8D + 0.2D)); + } + ++ /** ++ * Called to update the entity's position/logic. ++ */ + public void onUpdate() { + this.prevPosX = this.posX; + this.prevPosY = this.posY; + this.prevPosZ = this.posZ; + this.motionY -= (double)this.particleGravity; + this.moveEntity(this.motionX, this.motionY, this.motionZ); +- this.motionX *= (double)0.98F; +- this.motionY *= (double)0.98F; +- this.motionZ *= (double)0.98F; +- if(this.particleMaxAge-- <= 0) { ++ this.motionX *= 0.9800000190734863D; ++ this.motionY *= 0.9800000190734863D; ++ this.motionZ *= 0.9800000190734863D; ++ ++ if (this.particleMaxAge-- <= 0) { + this.setDead(); + } + +- if(this.onGround) { +- if(Math.random() < 0.5D) { ++ if (this.onGround) { ++ if (Math.random() < 0.5D) { + this.setDead(); + } + +- this.motionX *= (double)0.7F; +- this.motionZ *= (double)0.7F; ++ this.motionX *= 0.699999988079071D; ++ this.motionZ *= 0.699999988079071D; + } + + Material var1 = this.worldObj.getBlockMaterial(MathHelper.floor_double(this.posX), MathHelper.floor_double(this.posY), MathHelper.floor_double(this.posZ)); +- if(var1.isLiquid() || var1.isSolid()) { ++ ++ if (var1.isLiquid() || var1.isSolid()) { + double var2 = (double)((float)(MathHelper.floor_double(this.posY) + 1) - BlockFluid.getFluidHeightPercent(this.worldObj.getBlockMetadata(MathHelper.floor_double(this.posX), MathHelper.floor_double(this.posY), MathHelper.floor_double(this.posZ)))); +- if(this.posY < var2) { ++ ++ if (this.posY < var2) { + this.setDead(); + } + } +- + } + } diff --git a/patches/net/minecraft/src/EntityReddustFX.java.patch b/patches/net/minecraft/src/EntityReddustFX.java.patch new file mode 100644 index 0000000..3f86091 --- /dev/null +++ b/patches/net/minecraft/src/EntityReddustFX.java.patch @@ -0,0 +1,121 @@ +--- net/minecraft/src/EntityReddustFX.java ++++ net/minecraft/src/EntityReddustFX.java +@@ -1,69 +1,89 @@ + package net.minecraft.src; + ++// MCPatcher Start ++import com.prupe.mcpatcher.cc.ColorizeBlock; ++import com.prupe.mcpatcher.cc.Colorizer; ++// MCPatcher End ++ + public class EntityReddustFX extends EntityFX { + float reddustParticleScale; + +- public EntityReddustFX(World var1, double var2, double var4, double var6, float var8, float var9, float var10) { +- this(var1, var2, var4, var6, 1.0F, var8, var9, var10); ++ public EntityReddustFX(World par1World, double par2, double par4, double par6, float par8, float par9, float par10) { ++ this(par1World, par2, par4, par6, 1.0F, par8, par9, par10); + } + +- public EntityReddustFX(World var1, double var2, double var4, double var6, float var8, float var9, float var10, float var11) { +- super(var1, var2, var4, var6, 0.0D, 0.0D, 0.0D); +- this.motionX *= (double)0.1F; +- this.motionY *= (double)0.1F; +- this.motionZ *= (double)0.1F; +- if(var9 == 0.0F) { +- var9 = 1.0F; ++ public EntityReddustFX(World par1World, double par2, double par4, double par6, float par8, float par9, float par10, float par11) { ++ super(par1World, par2, par4, par6, 0.0D, 0.0D, 0.0D); ++ this.motionX *= 0.10000000149011612D; ++ this.motionY *= 0.10000000149011612D; ++ this.motionZ *= 0.10000000149011612D; ++ ++ if (par9 == 0.0F) { ++ par9 = 1.0F; ++ ++ // MCPatcher Start ++ if (ColorizeBlock.computeRedstoneWireColor(15)) { ++ par9 = Colorizer.setColor[0]; ++ par10 = Colorizer.setColor[1]; ++ par11 = Colorizer.setColor[2]; ++ } ++ // MCPatcher End + } + + float var12 = (float)Math.random() * 0.4F + 0.6F; +- this.particleRed = ((float)(Math.random() * (double)0.2F) + 0.8F) * var9 * var12; +- this.particleGreen = ((float)(Math.random() * (double)0.2F) + 0.8F) * var10 * var12; +- this.particleBlue = ((float)(Math.random() * (double)0.2F) + 0.8F) * var11 * var12; +- this.particleScale *= 12.0F / 16.0F; +- this.particleScale *= var8; ++ this.particleRed = ((float)(Math.random() * 0.20000000298023224D) + 0.8F) * par9 * var12; ++ this.particleGreen = ((float)(Math.random() * 0.20000000298023224D) + 0.8F) * par10 * var12; ++ this.particleBlue = ((float)(Math.random() * 0.20000000298023224D) + 0.8F) * par11 * var12; ++ this.particleScale *= 0.75F; ++ this.particleScale *= par8; + this.reddustParticleScale = this.particleScale; + this.particleMaxAge = (int)(8.0D / (Math.random() * 0.8D + 0.2D)); +- this.particleMaxAge = (int)((float)this.particleMaxAge * var8); ++ this.particleMaxAge = (int)((float)this.particleMaxAge * par8); + this.noClip = false; + } + +- public void renderParticle(Tessellator var1, float var2, float var3, float var4, float var5, float var6, float var7) { +- float var8 = ((float)this.particleAge + var2) / (float)this.particleMaxAge * 32.0F; +- if(var8 < 0.0F) { ++ public void renderParticle(Tessellator par1Tessellator, float par2, float par3, float par4, float par5, float par6, float par7) { ++ float var8 = ((float)this.particleAge + par2) / (float)this.particleMaxAge * 32.0F; ++ ++ if (var8 < 0.0F) { + var8 = 0.0F; + } + +- if(var8 > 1.0F) { ++ if (var8 > 1.0F) { + var8 = 1.0F; + } + + this.particleScale = this.reddustParticleScale * var8; +- super.renderParticle(var1, var2, var3, var4, var5, var6, var7); ++ super.renderParticle(par1Tessellator, par2, par3, par4, par5, par6, par7); + } + ++ /** ++ * Called to update the entity's position/logic. ++ */ + public void onUpdate() { + this.prevPosX = this.posX; + this.prevPosY = this.posY; + this.prevPosZ = this.posZ; +- if(this.particleAge++ >= this.particleMaxAge) { ++ ++ if (this.particleAge++ >= this.particleMaxAge) { + this.setDead(); + } + + this.setParticleTextureIndex(7 - this.particleAge * 8 / this.particleMaxAge); + this.moveEntity(this.motionX, this.motionY, this.motionZ); +- if(this.posY == this.prevPosY) { ++ ++ if (this.posY == this.prevPosY) { + this.motionX *= 1.1D; + this.motionZ *= 1.1D; + } + +- this.motionX *= (double)0.96F; +- this.motionY *= (double)0.96F; +- this.motionZ *= (double)0.96F; +- if(this.onGround) { +- this.motionX *= (double)0.7F; +- this.motionZ *= (double)0.7F; +- } ++ this.motionX *= 0.9599999785423279D; ++ this.motionY *= 0.9599999785423279D; ++ this.motionZ *= 0.9599999785423279D; + ++ if (this.onGround) { ++ this.motionX *= 0.699999988079071D; ++ this.motionZ *= 0.699999988079071D; ++ } + } + } diff --git a/patches/net/minecraft/src/EntityRenderer.java.patch b/patches/net/minecraft/src/EntityRenderer.java.patch new file mode 100644 index 0000000..9e3b684 --- /dev/null +++ b/patches/net/minecraft/src/EntityRenderer.java.patch @@ -0,0 +1,2125 @@ +--- net/minecraft/src/EntityRenderer.java ++++ net/minecraft/src/EntityRenderer.java +@@ -3,83 +3,184 @@ + import java.nio.FloatBuffer; + import java.util.List; + import java.util.Random; ++ + import org.lwjgl.input.Mouse; + import org.lwjgl.opengl.Display; + import org.lwjgl.opengl.GL11; + import org.lwjgl.opengl.GLContext; +-import org.lwjgl.opengl.NVFogDistance; +-import org.lwjgl.util.glu.Project; +- ++import org.lwjgl.util.glu.GLU; ++import org.lwjgl.util.vector.*; ++ ++import com.prupe.mcpatcher.cc.ColorizeWorld; ++import com.prupe.mcpatcher.cc.Colorizer; ++import com.prupe.mcpatcher.cc.Lightmap; ++import com.prupe.mcpatcher.ctm.RenderPass; ++ ++import org.spoutcraft.client.config.Configuration; ++import org.spoutcraft.client.spoutworth.SpoutWorth; + public class EntityRenderer { + private static final ResourceLocation locationRainPng = new ResourceLocation("textures/environment/rain.png"); + private static final ResourceLocation locationSnowPng = new ResourceLocation("textures/environment/snow.png"); + public static boolean anaglyphEnable; ++ ++ /** Anaglyph field (0=R, 1=GB) */ + public static int anaglyphField; ++ ++ /** A reference to the Minecraft object. */ + private Minecraft mc; + private float farPlaneDistance; + public ItemRenderer itemRenderer; ++ ++ /** Entity renderer update count */ + private int rendererUpdateCount; ++ ++ /** Pointed entity */ + private Entity pointedEntity; + private MouseFilter mouseFilterXAxis = new MouseFilter(); + private MouseFilter mouseFilterYAxis = new MouseFilter(); ++ ++ /** Mouse filter dummy 1 */ + private MouseFilter mouseFilterDummy1 = new MouseFilter(); ++ ++ /** Mouse filter dummy 2 */ + private MouseFilter mouseFilterDummy2 = new MouseFilter(); ++ ++ /** Mouse filter dummy 3 */ + private MouseFilter mouseFilterDummy3 = new MouseFilter(); ++ ++ /** Mouse filter dummy 4 */ + private MouseFilter mouseFilterDummy4 = new MouseFilter(); + private float thirdPersonDistance = 4.0F; ++ ++ /** Third person distance temp */ + private float thirdPersonDistanceTemp = 4.0F; + private float debugCamYaw; + private float prevDebugCamYaw; + private float debugCamPitch; + private float prevDebugCamPitch; ++ ++ /** Smooth cam yaw */ + private float smoothCamYaw; ++ ++ /** Smooth cam pitch */ + private float smoothCamPitch; ++ ++ /** Smooth cam filter X */ + private float smoothCamFilterX; ++ ++ /** Smooth cam filter Y */ + private float smoothCamFilterY; ++ ++ /** Smooth cam partial ticks */ + private float smoothCamPartialTicks; + private float debugCamFOV; + private float prevDebugCamFOV; + private float camRoll; + private float prevCamRoll; ++ ++ /** ++ * The texture id of the blocklight/skylight texture used for lighting effects ++ */ + private final DynamicTexture lightmapTexture; ++ ++ /** ++ * Colors computed in updateLightmap() and loaded into the lightmap emptyTexture ++ */ + private final int[] lightmapColors; + private final ResourceLocation locationLightMap; ++ ++ /** FOV modifier hand */ + private float fovModifierHand; ++ ++ /** FOV modifier hand prev */ + private float fovModifierHandPrev; ++ ++ /** FOV multiplier temp */ + private float fovMultiplierTemp; + private float field_82831_U; + private float field_82832_V; ++ ++ /** Cloud fog mode */ + private boolean cloudFog; + private double cameraZoom = 1.0D; + private double cameraYaw; + private double cameraPitch; ++ ++ /** Previous frame time in milliseconds */ + private long prevFrameTime = Minecraft.getSystemTime(); ++ ++ /** End time of last render (ns) */ + private long renderEndNanoTime; ++ ++ /** ++ * Is set, updateCameraAndRender() calls updateLightmap(); set by updateTorchFlicker() ++ */ + private boolean lightmapUpdateNeeded; +- float torchFlickerX; ++ ++ /** Torch flicker X */ ++ public float torchFlickerX; ++ ++ /** Torch flicker DX */ + float torchFlickerDX; ++ ++ /** Torch flicker Y */ + float torchFlickerY; ++ ++ /** Torch flicker DY */ + float torchFlickerDY; +- private Random ae = new Random(); ++ private Random random = new Random(); ++ ++ /** Rain sound counter */ + private int rainSoundCounter; ++ ++ /** Rain X coords */ + float[] rainXCoords; ++ ++ /** Rain Y coords */ + float[] rainYCoords; +- FloatBuffer j = GLAllocation.createDirectFloatBuffer(16); ++ ++ /** Fog color buffer */ ++ FloatBuffer fogColorBuffer = GLAllocation.createDirectFloatBuffer(16); ++ ++ /** red component of the fog color */ + float fogColorRed; ++ ++ /** green component of the fog color */ + float fogColorGreen; ++ ++ /** blue component of the fog color */ + float fogColorBlue; ++ ++ /** Fog color 2 */ + private float fogColor2; ++ ++ /** Fog color 1 */ + private float fogColor1; ++ ++ /** ++ * Debug view direction (0=OFF, 1=Front, 2=Right, 3=Back, 4=Left, 5=TiltLeft, 6=TiltRight) ++ */ + public int debugViewDirection; + +- public EntityRenderer(Minecraft var1) { +- this.mc = var1; +- this.itemRenderer = new ItemRenderer(var1); ++ // Spout Start ++ private WorldProvider updatedWorldProvider = null; ++ private boolean showDebugInfo = false; ++ public static Matrix4f view = new Matrix4f(); ++ public static Matrix4f projection = new Matrix4f(); ++ public int betterGrassLoop; ++ // Spout End ++ ++ public EntityRenderer(Minecraft par1Minecraft) { ++ this.mc = par1Minecraft; ++ this.itemRenderer = new ItemRenderer(par1Minecraft); + this.lightmapTexture = new DynamicTexture(16, 16); +- this.locationLightMap = var1.getTextureManager().getDynamicTextureLocation("lightMap", this.lightmapTexture); ++ this.locationLightMap = par1Minecraft.getTextureManager().getDynamicTextureLocation("lightMap", this.lightmapTexture); + this.lightmapColors = this.lightmapTexture.getTextureData(); + } + ++ /** ++ * Updates the entity renderer ++ */ + public void updateRenderer() { + this.updateFovModifierHand(); + this.updateTorchFlicker(); +@@ -91,7 +192,8 @@ + this.prevCamRoll = this.camRoll; + float var1; + float var2; +- if(this.mc.gameSettings.smoothCamera) { ++ ++ if (this.mc.gameSettings.smoothCamera) { + var1 = this.mc.gameSettings.mouseSensitivity * 0.6F + 0.2F; + var2 = var1 * var1 * var1 * 8.0F; + this.smoothCamFilterX = this.mouseFilterXAxis.smooth(this.smoothCamYaw, 0.05F * var2); +@@ -101,7 +203,7 @@ + this.smoothCamPitch = 0.0F; + } + +- if(this.mc.renderViewEntity == null) { ++ if (this.mc.renderViewEntity == null) { + this.mc.renderViewEntity = this.mc.thePlayer; + } + +@@ -113,65 +215,73 @@ + this.itemRenderer.updateEquippedItem(); + this.addRainParticles(); + this.field_82832_V = this.field_82831_U; +- if(BossStatus.field_82825_d) { ++ ++ if (BossStatus.field_82825_d) { + this.field_82831_U += 0.05F; +- if(this.field_82831_U > 1.0F) { ++ ++ if (this.field_82831_U > 1.0F) { + this.field_82831_U = 1.0F; + } + + BossStatus.field_82825_d = false; +- } else if(this.field_82831_U > 0.0F) { ++ } else if (this.field_82831_U > 0.0F) { + this.field_82831_U -= 0.0125F; + } +- + } + +- public void getMouseOver(float var1) { +- if(this.mc.renderViewEntity != null) { +- if(this.mc.theWorld != null) { ++ /** ++ * Finds what block or object the mouse is over at the specified partial tick time. Args: partialTickTime ++ */ ++ public void getMouseOver(float par1) { ++ if (this.mc.renderViewEntity != null) { ++ if (this.mc.theWorld != null) { + this.mc.pointedEntityLiving = null; + double var2 = (double)this.mc.playerController.getBlockReachDistance(); +- this.mc.objectMouseOver = this.mc.renderViewEntity.rayTrace(var2, var1); ++ this.mc.objectMouseOver = this.mc.renderViewEntity.rayTrace(var2, par1); + double var4 = var2; +- Vec3 var6 = this.mc.renderViewEntity.getPosition(var1); +- if(this.mc.playerController.extendedReach()) { ++ Vec3 var6 = this.mc.renderViewEntity.getPosition(par1); ++ ++ if (this.mc.playerController.extendedReach()) { + var2 = 6.0D; +- var4 = var2; ++ var4 = 6.0D; + } else { +- if(var2 > 3.0D) { ++ if (var2 > 3.0D) { + var4 = 3.0D; + } + + var2 = var4; + } + +- if(this.mc.objectMouseOver != null) { ++ if (this.mc.objectMouseOver != null) { + var4 = this.mc.objectMouseOver.hitVec.distanceTo(var6); + } + +- Vec3 var7 = this.mc.renderViewEntity.getLook(var1); ++ Vec3 var7 = this.mc.renderViewEntity.getLook(par1); + Vec3 var8 = var6.addVector(var7.xCoord * var2, var7.yCoord * var2, var7.zCoord * var2); + this.pointedEntity = null; + float var9 = 1.0F; + List var10 = this.mc.theWorld.getEntitiesWithinAABBExcludingEntity(this.mc.renderViewEntity, this.mc.renderViewEntity.boundingBox.addCoord(var7.xCoord * var2, var7.yCoord * var2, var7.zCoord * var2).expand((double)var9, (double)var9, (double)var9)); + double var11 = var4; + +- for(int var13 = 0; var13 < var10.size(); ++var13) { ++ for (int var13 = 0; var13 < var10.size(); ++var13) { + Entity var14 = (Entity)var10.get(var13); +- if(var14.canBeCollidedWith()) { ++ ++ if (var14.canBeCollidedWith()) { + float var15 = var14.getCollisionBorderSize(); + AxisAlignedBB var16 = var14.boundingBox.expand((double)var15, (double)var15, (double)var15); + MovingObjectPosition var17 = var16.calculateIntercept(var6, var8); +- if(var16.isVecInside(var6)) { +- if(0.0D < var11 || var11 == 0.0D) { ++ ++ if (var16.isVecInside(var6)) { ++ if (0.0D < var11 || var11 == 0.0D) { + this.pointedEntity = var14; + var11 = 0.0D; + } +- } else if(var17 != null) { ++ } else if (var17 != null) { + double var18 = var6.distanceTo(var17.hitVec); +- if(var18 < var11 || var11 == 0.0D) { +- if(var14 == this.mc.renderViewEntity.ridingEntity) { +- if(var11 == 0.0D) { ++ ++ if (var18 < var11 || var11 == 0.0D) { ++ if (var14 == this.mc.renderViewEntity.ridingEntity) { ++ if (var11 == 0.0D) { + this.pointedEntity = var14; + } + } else { +@@ -183,67 +293,76 @@ + } + } + +- if(this.pointedEntity != null && (var11 < var4 || this.mc.objectMouseOver == null)) { ++ if (this.pointedEntity != null && (var11 < var4 || this.mc.objectMouseOver == null)) { + this.mc.objectMouseOver = new MovingObjectPosition(this.pointedEntity); +- if(this.pointedEntity instanceof EntityLivingBase) { ++ ++ if (this.pointedEntity instanceof EntityLivingBase) { + this.mc.pointedEntityLiving = (EntityLivingBase)this.pointedEntity; + } + } +- + } + } + } + ++ /** ++ * Update FOV modifier hand ++ */ + private void updateFovModifierHand() { + EntityPlayerSP var1 = (EntityPlayerSP)this.mc.renderViewEntity; + this.fovMultiplierTemp = var1.getFOVMultiplier(); + this.fovModifierHandPrev = this.fovModifierHand; + this.fovModifierHand += (this.fovMultiplierTemp - this.fovModifierHand) * 0.5F; +- if(this.fovModifierHand > 1.5F) { ++ ++ if (this.fovModifierHand > 1.5F) { + this.fovModifierHand = 1.5F; + } + +- if(this.fovModifierHand < 0.1F) { ++ if (this.fovModifierHand < 0.1F) { + this.fovModifierHand = 0.1F; + } +- + } + +- private float getFOVModifier(float var1, boolean var2) { +- if(this.debugViewDirection > 0) { ++ /** ++ * Changes the field of view of the player depending on if they are underwater or not ++ */ ++ private float getFOVModifier(float par1, boolean par2) { ++ if (this.debugViewDirection > 0) { + return 90.0F; + } else { + EntityPlayer var3 = (EntityPlayer)this.mc.renderViewEntity; + float var4 = 70.0F; +- if(var2) { ++ ++ if (par2) { + var4 += this.mc.gameSettings.fovSetting * 40.0F; +- var4 *= this.fovModifierHandPrev + (this.fovModifierHand - this.fovModifierHandPrev) * var1; ++ var4 *= this.fovModifierHandPrev + (this.fovModifierHand - this.fovModifierHandPrev) * par1; + } + +- if(var3.getHealth() <= 0.0F) { +- float var5 = (float)var3.deathTime + var1; ++ if (var3.getHealth() <= 0.0F) { ++ float var5 = (float)var3.deathTime + par1; + var4 /= (1.0F - 500.0F / (var5 + 500.0F)) * 2.0F + 1.0F; + } + +- int var6 = ActiveRenderInfo.getBlockIdAtEntityViewpoint(this.mc.theWorld, var3, var1); +- if(var6 != 0 && Block.blocksList[var6].blockMaterial == Material.water) { ++ int var6 = ActiveRenderInfo.getBlockIdAtEntityViewpoint(this.mc.theWorld, var3, par1); ++ ++ if (var6 != 0 && Block.blocksList[var6].blockMaterial == Material.water) { + var4 = var4 * 60.0F / 70.0F; + } + +- return var4 + this.prevDebugCamFOV + (this.debugCamFOV - this.prevDebugCamFOV) * var1; ++ return var4 + this.prevDebugCamFOV + (this.debugCamFOV - this.prevDebugCamFOV) * par1; + } + } + +- private void hurtCameraEffect(float var1) { ++ private void hurtCameraEffect(float par1) { + EntityLivingBase var2 = this.mc.renderViewEntity; +- float var3 = (float)var2.hurtTime - var1; ++ float var3 = (float)var2.hurtTime - par1; + float var4; +- if(var2.getHealth() <= 0.0F) { +- var4 = (float)var2.deathTime + var1; ++ ++ if (var2.getHealth() <= 0.0F) { ++ var4 = (float)var2.deathTime + par1; + GL11.glRotatef(40.0F - 8000.0F / (var4 + 200.0F), 0.0F, 0.0F, 1.0F); + } + +- if(var3 >= 0.0F) { ++ if (var3 >= 0.0F) { + var3 /= (float)var2.maxHurtTime; + var3 = MathHelper.sin(var3 * var3 * var3 * var3 * (float)Math.PI); + var4 = var2.attackedAtYaw; +@@ -253,13 +372,16 @@ + } + } + +- private void setupViewBobbing(float var1) { +- if(this.mc.renderViewEntity instanceof EntityPlayer) { ++ /** ++ * Setups all the GL settings for view bobbing. Args: partialTickTime ++ */ ++ private void setupViewBobbing(float par1) { ++ if (this.mc.renderViewEntity instanceof EntityPlayer) { + EntityPlayer var2 = (EntityPlayer)this.mc.renderViewEntity; + float var3 = var2.distanceWalkedModified - var2.prevDistanceWalkedModified; +- float var4 = -(var2.distanceWalkedModified + var3 * var1); +- float var5 = var2.prevCameraYaw + (var2.cameraYaw - var2.prevCameraYaw) * var1; +- float var6 = var2.prevCameraPitch + (var2.cameraPitch - var2.prevCameraPitch) * var1; ++ float var4 = -(var2.distanceWalkedModified + var3 * par1); ++ float var5 = var2.prevCameraYaw + (var2.cameraYaw - var2.prevCameraYaw) * par1; ++ float var6 = var2.prevCameraPitch + (var2.cameraPitch - var2.prevCameraPitch) * par1; + GL11.glTranslatef(MathHelper.sin(var4 * (float)Math.PI) * var5 * 0.5F, -Math.abs(MathHelper.cos(var4 * (float)Math.PI) * var5), 0.0F); + GL11.glRotatef(MathHelper.sin(var4 * (float)Math.PI) * var5 * 3.0F, 0.0F, 0.0F, 1.0F); + GL11.glRotatef(Math.abs(MathHelper.cos(var4 * (float)Math.PI - 0.2F) * var5) * 5.0F, 1.0F, 0.0F, 0.0F); +@@ -267,41 +389,49 @@ + } + } + +- private void orientCamera(float var1) { ++ /** ++ * sets up player's eye (or camera in third person mode) ++ */ ++ private void orientCamera(float par1) { + EntityLivingBase var2 = this.mc.renderViewEntity; + float var3 = var2.yOffset - 1.62F; +- double var4 = var2.prevPosX + (var2.posX - var2.prevPosX) * (double)var1; +- double var6 = var2.prevPosY + (var2.posY - var2.prevPosY) * (double)var1 - (double)var3; +- double var8 = var2.prevPosZ + (var2.posZ - var2.prevPosZ) * (double)var1; +- GL11.glRotatef(this.prevCamRoll + (this.camRoll - this.prevCamRoll) * var1, 0.0F, 0.0F, 1.0F); +- if(var2.isPlayerSleeping()) { ++ double var4 = var2.prevPosX + (var2.posX - var2.prevPosX) * (double)par1; ++ double var6 = var2.prevPosY + (var2.posY - var2.prevPosY) * (double)par1 - (double)var3; ++ double var8 = var2.prevPosZ + (var2.posZ - var2.prevPosZ) * (double)par1; ++ GL11.glRotatef(this.prevCamRoll + (this.camRoll - this.prevCamRoll) * par1, 0.0F, 0.0F, 1.0F); ++ ++ if (var2.isPlayerSleeping()) { + var3 = (float)((double)var3 + 1.0D); + GL11.glTranslatef(0.0F, 0.3F, 0.0F); +- if(!this.mc.gameSettings.debugCamEnable) { ++ ++ if (!this.mc.gameSettings.debugCamEnable) { + int var10 = this.mc.theWorld.getBlockId(MathHelper.floor_double(var2.posX), MathHelper.floor_double(var2.posY), MathHelper.floor_double(var2.posZ)); +- if(var10 == Block.bed.blockID) { ++ ++ if (var10 == Block.bed.blockID) { + int var11 = this.mc.theWorld.getBlockMetadata(MathHelper.floor_double(var2.posX), MathHelper.floor_double(var2.posY), MathHelper.floor_double(var2.posZ)); + int var12 = var11 & 3; + GL11.glRotatef((float)(var12 * 90), 0.0F, 1.0F, 0.0F); + } + +- GL11.glRotatef(var2.prevRotationYaw + (var2.rotationYaw - var2.prevRotationYaw) * var1 + 180.0F, 0.0F, -1.0F, 0.0F); +- GL11.glRotatef(var2.prevRotationPitch + (var2.rotationPitch - var2.prevRotationPitch) * var1, -1.0F, 0.0F, 0.0F); ++ GL11.glRotatef(var2.prevRotationYaw + (var2.rotationYaw - var2.prevRotationYaw) * par1 + 180.0F, 0.0F, -1.0F, 0.0F); ++ GL11.glRotatef(var2.prevRotationPitch + (var2.rotationPitch - var2.prevRotationPitch) * par1, -1.0F, 0.0F, 0.0F); + } +- } else if(this.mc.gameSettings.thirdPersonView > 0) { +- double var27 = (double)(this.thirdPersonDistanceTemp + (this.thirdPersonDistance - this.thirdPersonDistanceTemp) * var1); ++ } else if (this.mc.gameSettings.thirdPersonView > 0) { ++ double var27 = (double)(this.thirdPersonDistanceTemp + (this.thirdPersonDistance - this.thirdPersonDistanceTemp) * par1); + float var13; + float var28; +- if(this.mc.gameSettings.debugCamEnable) { +- var28 = this.prevDebugCamYaw + (this.debugCamYaw - this.prevDebugCamYaw) * var1; +- var13 = this.prevDebugCamPitch + (this.debugCamPitch - this.prevDebugCamPitch) * var1; ++ ++ if (this.mc.gameSettings.debugCamEnable) { ++ var28 = this.prevDebugCamYaw + (this.debugCamYaw - this.prevDebugCamYaw) * par1; ++ var13 = this.prevDebugCamPitch + (this.debugCamPitch - this.prevDebugCamPitch) * par1; + GL11.glTranslatef(0.0F, 0.0F, (float)(-var27)); + GL11.glRotatef(var13, 1.0F, 0.0F, 0.0F); + GL11.glRotatef(var28, 0.0F, 1.0F, 0.0F); + } else { + var28 = var2.rotationYaw; + var13 = var2.rotationPitch; +- if(this.mc.gameSettings.thirdPersonView == 2) { ++ ++ if (this.mc.gameSettings.thirdPersonView == 2) { + var13 += 180.0F; + } + +@@ -309,23 +439,25 @@ + double var16 = (double)(MathHelper.cos(var28 / 180.0F * (float)Math.PI) * MathHelper.cos(var13 / 180.0F * (float)Math.PI)) * var27; + double var18 = (double)(-MathHelper.sin(var13 / 180.0F * (float)Math.PI)) * var27; + +- for(int var20 = 0; var20 < 8; ++var20) { ++ for (int var20 = 0; var20 < 8; ++var20) { + float var21 = (float)((var20 & 1) * 2 - 1); + float var22 = (float)((var20 >> 1 & 1) * 2 - 1); + float var23 = (float)((var20 >> 2 & 1) * 2 - 1); + var21 *= 0.1F; + var22 *= 0.1F; + var23 *= 0.1F; +- MovingObjectPosition var24 = this.mc.theWorld.rayTraceBlocks(this.mc.theWorld.getWorldVec3Pool().getVecFromPool(var4 + (double)var21, var6 + (double)var22, var8 + (double)var23), this.mc.theWorld.getWorldVec3Pool().getVecFromPool(var4 - var14 + (double)var21 + (double)var23, var6 - var18 + (double)var22, var8 - var16 + (double)var23)); +- if(var24 != null) { ++ MovingObjectPosition var24 = this.mc.theWorld.clip(this.mc.theWorld.getWorldVec3Pool().getVecFromPool(var4 + (double)var21, var6 + (double)var22, var8 + (double)var23), this.mc.theWorld.getWorldVec3Pool().getVecFromPool(var4 - var14 + (double)var21 + (double)var23, var6 - var18 + (double)var22, var8 - var16 + (double)var23)); ++ ++ if (var24 != null) { + double var25 = var24.hitVec.distanceTo(this.mc.theWorld.getWorldVec3Pool().getVecFromPool(var4, var6, var8)); +- if(var25 < var27) { ++ ++ if (var25 < var27) { + var27 = var25; + } + } + } + +- if(this.mc.gameSettings.thirdPersonView == 2) { ++ if (this.mc.gameSettings.thirdPersonView == 2) { + GL11.glRotatef(180.0F, 0.0F, 1.0F, 0.0F); + } + +@@ -339,148 +471,186 @@ + GL11.glTranslatef(0.0F, 0.0F, -0.1F); + } + +- if(!this.mc.gameSettings.debugCamEnable) { +- GL11.glRotatef(var2.prevRotationPitch + (var2.rotationPitch - var2.prevRotationPitch) * var1, 1.0F, 0.0F, 0.0F); +- GL11.glRotatef(var2.prevRotationYaw + (var2.rotationYaw - var2.prevRotationYaw) * var1 + 180.0F, 0.0F, 1.0F, 0.0F); ++ if (!this.mc.gameSettings.debugCamEnable) { ++ GL11.glRotatef(var2.prevRotationPitch + (var2.rotationPitch - var2.prevRotationPitch) * par1, 1.0F, 0.0F, 0.0F); ++ GL11.glRotatef(var2.prevRotationYaw + (var2.rotationYaw - var2.prevRotationYaw) * par1 + 180.0F, 0.0F, 1.0F, 0.0F); + } + + GL11.glTranslatef(0.0F, var3, 0.0F); +- var4 = var2.prevPosX + (var2.posX - var2.prevPosX) * (double)var1; +- var6 = var2.prevPosY + (var2.posY - var2.prevPosY) * (double)var1 - (double)var3; +- var8 = var2.prevPosZ + (var2.posZ - var2.prevPosZ) * (double)var1; +- this.cloudFog = this.mc.renderGlobal.hasCloudFog(var4, var6, var8, var1); ++ var4 = var2.prevPosX + (var2.posX - var2.prevPosX) * (double)par1; ++ var6 = var2.prevPosY + (var2.posY - var2.prevPosY) * (double)par1 - (double)var3; ++ var8 = var2.prevPosZ + (var2.posZ - var2.prevPosZ) * (double)par1; ++ this.cloudFog = this.mc.renderGlobal.hasCloudFog(var4, var6, var8, par1); + } + +- private void setupCameraTransform(float var1, int var2) { +- this.farPlaneDistance = (float)(256 >> this.mc.gameSettings.renderDistance); ++ /** ++ * sets up projection, view effects, camera position/rotation ++ */ ++ private void setupCameraTransform(float par1, int par2) { ++ // Spout Start ++ this.farPlaneDistance = (float) (32 << 3 - this.mc.gameSettings.renderDistance); ++ if (Configuration.isFarView()) { ++ if (this.farPlaneDistance < 256.0F) { ++ this.farPlaneDistance *= 3.0F; ++ } else { ++ this.farPlaneDistance *= 2.0F; ++ } ++ } ++ ++ if (Configuration.isFancyFog()) { ++ this.farPlaneDistance *= 0.95F; ++ } else { ++ this.farPlaneDistance *= 0.83F; ++ } ++ // Spout End + GL11.glMatrixMode(GL11.GL_PROJECTION); + GL11.glLoadIdentity(); + float var3 = 0.07F; +- if(this.mc.gameSettings.anaglyph) { +- GL11.glTranslatef((float)(-(var2 * 2 - 1)) * var3, 0.0F, 0.0F); ++ ++ if (this.mc.gameSettings.anaglyph) { ++ GL11.glTranslatef((float)(-(par2 * 2 - 1)) * var3, 0.0F, 0.0F); + } + +- if(this.cameraZoom != 1.0D) { ++ if (this.cameraZoom != 1.0D) { + GL11.glTranslatef((float)this.cameraYaw, (float)(-this.cameraPitch), 0.0F); + GL11.glScaled(this.cameraZoom, this.cameraZoom, 1.0D); + } + +- Project.gluPerspective(this.getFOVModifier(var1, true), (float)this.mc.displayWidth / (float)this.mc.displayHeight, 0.05F, this.farPlaneDistance * 2.0F); ++ GLU.gluPerspective(this.getFOVModifier(par1, true), (float)this.mc.displayWidth / (float)this.mc.displayHeight, 0.05F, this.farPlaneDistance * 2.0F); + float var4; +- if(this.mc.playerController.enableEverythingIsScrewedUpMode()) { +- var4 = 2.0F / 3.0F; ++ ++ if (this.mc.playerController.enableEverythingIsScrewedUpMode()) { ++ var4 = 0.6666667F; + GL11.glScalef(1.0F, var4, 1.0F); + } + + GL11.glMatrixMode(GL11.GL_MODELVIEW); + GL11.glLoadIdentity(); +- if(this.mc.gameSettings.anaglyph) { +- GL11.glTranslatef((float)(var2 * 2 - 1) * 0.1F, 0.0F, 0.0F); +- } +- +- this.hurtCameraEffect(var1); +- if(this.mc.gameSettings.viewBobbing) { +- this.setupViewBobbing(var1); +- } +- +- var4 = this.mc.thePlayer.prevTimeInPortal + (this.mc.thePlayer.timeInPortal - this.mc.thePlayer.prevTimeInPortal) * var1; +- if(var4 > 0.0F) { ++ ++ if (this.mc.gameSettings.anaglyph) { ++ GL11.glTranslatef((float)(par2 * 2 - 1) * 0.1F, 0.0F, 0.0F); ++ } ++ ++ this.hurtCameraEffect(par1); ++ ++ if (this.mc.gameSettings.viewBobbing) { ++ this.setupViewBobbing(par1); ++ } ++ ++ var4 = this.mc.thePlayer.prevTimeInPortal + (this.mc.thePlayer.timeInPortal - this.mc.thePlayer.prevTimeInPortal) * par1; ++ ++ if (var4 > 0.0F) { + byte var5 = 20; +- if(this.mc.thePlayer.isPotionActive(Potion.confusion)) { ++ ++ if (this.mc.thePlayer.isPotionActive(Potion.confusion)) { + var5 = 7; + } + + float var6 = 5.0F / (var4 * var4 + 5.0F) - var4 * 0.04F; + var6 *= var6; +- GL11.glRotatef(((float)this.rendererUpdateCount + var1) * (float)var5, 0.0F, 1.0F, 1.0F); ++ GL11.glRotatef(((float)this.rendererUpdateCount + par1) * (float)var5, 0.0F, 1.0F, 1.0F); + GL11.glScalef(1.0F / var6, 1.0F, 1.0F); +- GL11.glRotatef(-((float)this.rendererUpdateCount + var1) * (float)var5, 0.0F, 1.0F, 1.0F); ++ GL11.glRotatef(-((float)this.rendererUpdateCount + par1) * (float)var5, 0.0F, 1.0F, 1.0F); + } + +- this.orientCamera(var1); +- if(this.debugViewDirection > 0) { ++ this.orientCamera(par1); ++ ++ if (this.debugViewDirection > 0) { + int var7 = this.debugViewDirection - 1; +- if(var7 == 1) { ++ ++ if (var7 == 1) { + GL11.glRotatef(90.0F, 0.0F, 1.0F, 0.0F); + } + +- if(var7 == 2) { ++ if (var7 == 2) { + GL11.glRotatef(180.0F, 0.0F, 1.0F, 0.0F); + } + +- if(var7 == 3) { ++ if (var7 == 3) { + GL11.glRotatef(-90.0F, 0.0F, 1.0F, 0.0F); + } + +- if(var7 == 4) { ++ if (var7 == 4) { + GL11.glRotatef(90.0F, 1.0F, 0.0F, 0.0F); + } + +- if(var7 == 5) { ++ if (var7 == 5) { + GL11.glRotatef(-90.0F, 1.0F, 0.0F, 0.0F); + } + } +- + } + +- private void renderHand(float var1, int var2) { +- if(this.debugViewDirection <= 0) { ++ /** ++ * Render player hand ++ */ ++ private void renderHand(float par1, int par2) { ++ if (this.debugViewDirection <= 0) { + GL11.glMatrixMode(GL11.GL_PROJECTION); + GL11.glLoadIdentity(); + float var3 = 0.07F; +- if(this.mc.gameSettings.anaglyph) { +- GL11.glTranslatef((float)(-(var2 * 2 - 1)) * var3, 0.0F, 0.0F); ++ ++ if (this.mc.gameSettings.anaglyph) { ++ GL11.glTranslatef((float)(-(par2 * 2 - 1)) * var3, 0.0F, 0.0F); + } + +- if(this.cameraZoom != 1.0D) { ++ if (this.cameraZoom != 1.0D) { + GL11.glTranslatef((float)this.cameraYaw, (float)(-this.cameraPitch), 0.0F); + GL11.glScaled(this.cameraZoom, this.cameraZoom, 1.0D); + } + +- Project.gluPerspective(this.getFOVModifier(var1, false), (float)this.mc.displayWidth / (float)this.mc.displayHeight, 0.05F, this.farPlaneDistance * 2.0F); +- if(this.mc.playerController.enableEverythingIsScrewedUpMode()) { +- float var4 = 2.0F / 3.0F; ++ GLU.gluPerspective(this.getFOVModifier(par1, false), (float)this.mc.displayWidth / (float)this.mc.displayHeight, 0.05F, this.farPlaneDistance * 2.0F); ++ ++ if (this.mc.playerController.enableEverythingIsScrewedUpMode()) { ++ float var4 = 0.6666667F; + GL11.glScalef(1.0F, var4, 1.0F); + } + + GL11.glMatrixMode(GL11.GL_MODELVIEW); + GL11.glLoadIdentity(); +- if(this.mc.gameSettings.anaglyph) { +- GL11.glTranslatef((float)(var2 * 2 - 1) * 0.1F, 0.0F, 0.0F); ++ ++ if (this.mc.gameSettings.anaglyph) { ++ GL11.glTranslatef((float)(par2 * 2 - 1) * 0.1F, 0.0F, 0.0F); + } + + GL11.glPushMatrix(); +- this.hurtCameraEffect(var1); +- if(this.mc.gameSettings.viewBobbing) { +- this.setupViewBobbing(var1); ++ this.hurtCameraEffect(par1); ++ ++ if (this.mc.gameSettings.viewBobbing) { ++ this.setupViewBobbing(par1); + } + +- if(this.mc.gameSettings.thirdPersonView == 0 && !this.mc.renderViewEntity.isPlayerSleeping() && !this.mc.gameSettings.hideGUI && !this.mc.playerController.enableEverythingIsScrewedUpMode()) { +- this.enableLightmap((double)var1); +- this.itemRenderer.renderItemInFirstPerson(var1); +- this.disableLightmap((double)var1); ++ if (this.mc.gameSettings.thirdPersonView == 0 && !this.mc.renderViewEntity.isPlayerSleeping() && !this.mc.gameSettings.hideGUI && !this.mc.playerController.enableEverythingIsScrewedUpMode()) { ++ this.enableLightmap((double)par1); ++ this.itemRenderer.renderItemInFirstPerson(par1); ++ this.disableLightmap((double)par1); + } + + GL11.glPopMatrix(); +- if(this.mc.gameSettings.thirdPersonView == 0 && !this.mc.renderViewEntity.isPlayerSleeping()) { +- this.itemRenderer.renderOverlays(var1); +- this.hurtCameraEffect(var1); +- } +- +- if(this.mc.gameSettings.viewBobbing) { +- this.setupViewBobbing(var1); +- } +- ++ ++ if (this.mc.gameSettings.thirdPersonView == 0 && !this.mc.renderViewEntity.isPlayerSleeping()) { ++ this.itemRenderer.renderOverlays(par1); ++ this.hurtCameraEffect(par1); ++ } ++ ++ if (this.mc.gameSettings.viewBobbing) { ++ this.setupViewBobbing(par1); ++ } + } + } + +- public void disableLightmap(double var1) { ++ /** ++ * Disable secondary texture unit used by lightmap ++ */ ++ public void disableLightmap(double par1) { + OpenGlHelper.setActiveTexture(OpenGlHelper.lightmapTexUnit); + GL11.glDisable(GL11.GL_TEXTURE_2D); + OpenGlHelper.setActiveTexture(OpenGlHelper.defaultTexUnit); + } + +- public void enableLightmap(double var1) { ++ /** ++ * Enable lightmap in secondary texture unit ++ */ ++ public void enableLightmap(double par1) { + OpenGlHelper.setActiveTexture(OpenGlHelper.lightmapTexUnit); + GL11.glMatrixMode(GL11.GL_TEXTURE); + GL11.glLoadIdentity(); +@@ -496,10 +666,13 @@ + GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_WRAP_S, GL11.GL_CLAMP); + GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_WRAP_T, GL11.GL_CLAMP); + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); +- GL11.glEnable(GL11.GL_TEXTURE_2D); ++ GL11.glEnable(GL11.GL_TEXTURE_2D); + OpenGlHelper.setActiveTexture(OpenGlHelper.defaultTexUnit); + } + ++ /** ++ * Recompute a random value that is applied to block color in updateLightmap() ++ */ + private void updateTorchFlicker() { + this.torchFlickerDX = (float)((double)this.torchFlickerDX + (Math.random() - Math.random()) * Math.random() * Math.random()); + this.torchFlickerDY = (float)((double)this.torchFlickerDY + (Math.random() - Math.random()) * Math.random() * Math.random()); +@@ -510,14 +683,19 @@ + this.lightmapUpdateNeeded = true; + } + +- private void updateLightmap(float var1) { ++ private void updateLightmap(float par1) { + WorldClient var2 = this.mc.theWorld; +- if(var2 != null) { +- for(int var3 = 0; var3 < 256; ++var3) { ++ ++ if (Lightmap.computeLightmap(this, var2, this.lightmapColors, par1)) { ++ this.lightmapTexture.updateDynamicTexture(); ++ this.lightmapUpdateNeeded = false; ++ } else if (var2 != null) { ++ for (int var3 = 0; var3 < 256; ++var3) { + float var4 = var2.getSunBrightness(1.0F) * 0.95F + 0.05F; + float var5 = var2.provider.lightBrightnessTable[var3 / 16] * var4; + float var6 = var2.provider.lightBrightnessTable[var3 % 16] * (this.torchFlickerX * 0.1F + 1.5F); +- if(var2.lastLightningBolt > 0) { ++ ++ if (var2.lastLightningBolt > 0) { + var5 = var2.provider.lightBrightnessTable[var3 / 16]; + } + +@@ -532,28 +710,31 @@ + var14 = var14 * 0.96F + 0.03F; + var15 = var15 * 0.96F + 0.03F; + float var16; +- if(this.field_82831_U > 0.0F) { +- var16 = this.field_82832_V + (this.field_82831_U - this.field_82832_V) * var1; ++ ++ if (this.field_82831_U > 0.0F) { ++ var16 = this.field_82832_V + (this.field_82831_U - this.field_82832_V) * par1; + var13 = var13 * (1.0F - var16) + var13 * 0.7F * var16; + var14 = var14 * (1.0F - var16) + var14 * 0.6F * var16; + var15 = var15 * (1.0F - var16) + var15 * 0.6F * var16; + } + +- if(var2.provider.dimensionId == 1) { +- var13 = 0.22F + var6 * (12.0F / 16.0F); +- var14 = 0.28F + var11 * (12.0F / 16.0F); +- var15 = 0.25F + var12 * (12.0F / 16.0F); ++ if (var2.provider.dimensionId == 1) { ++ var13 = 0.22F + var6 * 0.75F; ++ var14 = 0.28F + var11 * 0.75F; ++ var15 = 0.25F + var12 * 0.75F; + } + + float var17; +- if(this.mc.thePlayer.isPotionActive(Potion.nightVision)) { +- var16 = this.getNightVisionBrightness(this.mc.thePlayer, var1); ++ ++ if (this.mc.thePlayer.isPotionActive(Potion.nightVision)) { ++ var16 = this.getNightVisionBrightness(this.mc.thePlayer, par1); + var17 = 1.0F / var13; +- if(var17 > 1.0F / var14) { ++ ++ if (var17 > 1.0F / var14) { + var17 = 1.0F / var14; + } + +- if(var17 > 1.0F / var15) { ++ if (var17 > 1.0F / var15) { + var17 = 1.0F / var15; + } + +@@ -562,15 +743,15 @@ + var15 = var15 * (1.0F - var16) + var15 * var17 * var16; + } + +- if(var13 > 1.0F) { ++ if (var13 > 1.0F) { + var13 = 1.0F; + } + +- if(var14 > 1.0F) { ++ if (var14 > 1.0F) { + var14 = 1.0F; + } + +- if(var15 > 1.0F) { ++ if (var15 > 1.0F) { + var15 = 1.0F; + } + +@@ -587,27 +768,28 @@ + var13 = var13 * 0.96F + 0.03F; + var14 = var14 * 0.96F + 0.03F; + var15 = var15 * 0.96F + 0.03F; +- if(var13 > 1.0F) { ++ ++ if (var13 > 1.0F) { + var13 = 1.0F; + } + +- if(var14 > 1.0F) { ++ if (var14 > 1.0F) { + var14 = 1.0F; + } + +- if(var15 > 1.0F) { ++ if (var15 > 1.0F) { + var15 = 1.0F; + } + +- if(var13 < 0.0F) { ++ if (var13 < 0.0F) { + var13 = 0.0F; + } + +- if(var14 < 0.0F) { ++ if (var14 < 0.0F) { + var14 = 0.0F; + } + +- if(var15 < 0.0F) { ++ if (var15 < 0.0F) { + var15 = 0.0F; + } + +@@ -623,21 +805,59 @@ + } + } + +- private float getNightVisionBrightness(EntityPlayer var1, float var2) { +- int var3 = var1.getActivePotionEffect(Potion.nightVision).getDuration(); +- return var3 > 200 ? 1.0F : 0.7F + MathHelper.sin(((float)var3 - var2) * (float)Math.PI * 0.2F) * 0.3F; ++ /** ++ * Gets the night vision brightness ++ */ ++ private float getNightVisionBrightness(EntityPlayer par1EntityPlayer, float par2) { ++ int var3 = par1EntityPlayer.getActivePotionEffect(Potion.nightVision).getDuration(); ++ return var3 > 200 ? 1.0F : 0.7F + MathHelper.sin(((float)var3 - par2) * (float)Math.PI * 0.2F) * 0.3F; + } + +- public void updateCameraAndRender(float var1) { ++ /** ++ * Will update any inputs that effect the camera angle (mouse) and then render the world and GUI ++ */ ++ public void updateCameraAndRender(float par1) { ++ // Spout Start ++ World world = this.mc.theWorld; ++ Block.leaves.setGraphicsLevel(Configuration.isFancyTrees()); ++ if (!Configuration.isWeather() && world != null && world.worldInfo != null) { ++ world.worldInfo.setRaining(false); ++ } ++ ++ if (world != null) { ++ long rawTime = world.getWorldTime(); ++ long time = rawTime % 24000L; ++ if (Configuration.getTime() == 2) { // Day ++ if (time <= 1000L) { ++ world.worldInfo.setWorldTime(rawTime - time + 1001L); ++ } ++ ++ if (time >= 11000L) { ++ world.worldInfo.setWorldTime(rawTime - time + 24001L); ++ } ++ } else if (Configuration.getTime() == 1) { // Night ++ if (time <= 14000L) { ++ world.worldInfo.setWorldTime(rawTime - time + 14001L); ++ } ++ ++ if (time >= 22000L) { ++ world.worldInfo.setWorldTime(rawTime - time + 24000L + 14001L); ++ } ++ } ++ } ++ // Spout End ++ + this.mc.mcProfiler.startSection("lightTex"); +- if(this.lightmapUpdateNeeded) { +- this.updateLightmap(var1); ++ ++ if (this.lightmapUpdateNeeded) { ++ this.updateLightmap(par1); + } + + this.mc.mcProfiler.endSection(); + boolean var2 = Display.isActive(); +- if(!var2 && this.mc.gameSettings.pauseOnLostFocus && (!this.mc.gameSettings.touchscreen || !Mouse.isButtonDown(1))) { +- if(Minecraft.getSystemTime() - this.prevFrameTime > 500L) { ++ ++ if (!var2 && this.mc.gameSettings.pauseOnLostFocus && (!this.mc.gameSettings.touchscreen || !Mouse.isButtonDown(1))) { ++ if (Minecraft.getSystemTime() - this.prevFrameTime > 500L) { + this.mc.displayInGameMenu(); + } + } else { +@@ -645,22 +865,24 @@ + } + + this.mc.mcProfiler.startSection("mouse"); +- if(this.mc.inGameHasFocus && var2) { ++ ++ if (this.mc.inGameHasFocus && var2) { + this.mc.mouseHelper.mouseXYChange(); + float var3 = this.mc.gameSettings.mouseSensitivity * 0.6F + 0.2F; + float var4 = var3 * var3 * var3 * 8.0F; + float var5 = (float)this.mc.mouseHelper.deltaX * var4; + float var6 = (float)this.mc.mouseHelper.deltaY * var4; + byte var7 = 1; +- if(this.mc.gameSettings.invertMouse) { ++ ++ if (this.mc.gameSettings.invertMouse) { + var7 = -1; + } + +- if(this.mc.gameSettings.smoothCamera) { ++ if (this.mc.gameSettings.smoothCamera) { + this.smoothCamYaw += var5; + this.smoothCamPitch += var6; +- float var8 = var1 - this.smoothCamPartialTicks; +- this.smoothCamPartialTicks = var1; ++ float var8 = par1 - this.smoothCamPartialTicks; ++ this.smoothCamPartialTicks = par1; + var5 = this.smoothCamFilterX * var8; + var6 = this.smoothCamFilterY * var8; + this.mc.thePlayer.setAngles(var5, var6 * (float)var7); +@@ -670,7 +892,8 @@ + } + + this.mc.mcProfiler.endSection(); +- if(!this.mc.skipRenderWorld) { ++ ++ if (!this.mc.skipRenderWorld) { + anaglyphEnable = this.mc.gameSettings.anaglyph; + ScaledResolution var13 = new ScaledResolution(this.mc.gameSettings, this.mc.displayWidth, this.mc.displayHeight); + int var14 = var13.getScaledWidth(); +@@ -678,18 +901,38 @@ + int var16 = Mouse.getX() * var14 / this.mc.displayWidth; + int var17 = var15 - Mouse.getY() * var15 / this.mc.displayHeight - 1; + int var18 = performanceToFps(this.mc.gameSettings.limitFramerate); +- if(this.mc.theWorld != null) { ++ ++ if (this.mc.theWorld != null) { + this.mc.mcProfiler.startSection("level"); +- if(this.mc.gameSettings.limitFramerate == 0) { +- this.renderWorld(var1, 0L); ++ ++ if (this.mc.gameSettings.limitFramerate == 0) { ++ this.renderWorld(par1, 0L); + } else { +- this.renderWorld(var1, this.renderEndNanoTime + (long)(1000000000 / var18)); ++ this.renderWorld(par1, this.renderEndNanoTime + (long)(1000000000 / var18)); + } + + this.renderEndNanoTime = System.nanoTime(); + this.mc.mcProfiler.endStartSection("gui"); +- if(!this.mc.gameSettings.hideGUI || this.mc.currentScreen != null) { +- this.mc.ingameGUI.renderGameOverlay(var1, this.mc.currentScreen != null, var16, var17); ++ ++ if (!this.mc.gameSettings.hideGUI || this.mc.currentScreen != null) { ++ // Spout Start ++ if (Configuration.getFastDebug() != 0) { ++ if (Minecraft.isDebugInfoEnabled()) { ++ this.showDebugInfo = !this.showDebugInfo; ++ } ++ ++ if (this.showDebugInfo) { ++ this.mc.gameSettings.showDebugInfo = true; ++ } ++ } ++ // Spout End ++ ++ this.mc.ingameGUI.renderGameOverlay(par1, this.mc.currentScreen != null, var16, var17); ++ // Spout Start ++ if (Configuration.getFastDebug() != 0) { ++ this.mc.gameSettings.showDebugInfo = false; ++ } ++ // Spout End + } + + this.mc.mcProfiler.endSection(); +@@ -703,11 +946,11 @@ + this.renderEndNanoTime = System.nanoTime(); + } + +- if(this.mc.currentScreen != null) { ++ if (this.mc.currentScreen != null) { + GL11.glClear(GL11.GL_DEPTH_BUFFER_BIT); + + try { +- this.mc.currentScreen.drawScreen(var16, var17, var1); ++ this.mc.currentScreen.drawScreen(var16, var17, par1); + } catch (Throwable var12) { + CrashReport var10 = CrashReport.makeCrashReport(var12, "Rendering screen"); + CrashReportCategory var11 = var10.makeCategory("Screen render details"); +@@ -716,37 +959,55 @@ + var11.addCrashSectionCallable("Screen size", new CallableScreenSize(this, var13)); + throw new ReportedException(var10); + } ++ ++ if (this.mc.currentScreen != null && this.mc.currentScreen.guiParticles != null) { ++ this.mc.currentScreen.guiParticles.draw(par1); ++ } ++ ++ if (this.mc.currentScreen!= null) { ++ this.mc.currentScreen.drawScreenPre(var16, var17, par1); ++ } else { ++ System.out.println("SpoutDebug: CurrentScreen was null prior to trying to drawScreenPre"); ++ } ++ ++ if (this.mc.currentScreen != null && this.mc.currentScreen.guiParticles != null) { ++ this.mc.currentScreen.guiParticles.draw(par1); ++ } + } +- + } + } + +- public void renderWorld(float var1, long var2) { ++ public void renderWorld(float par1, long par2) { + this.mc.mcProfiler.startSection("lightTex"); +- if(this.lightmapUpdateNeeded) { +- this.updateLightmap(var1); ++ ++ if (this.lightmapUpdateNeeded) { ++ this.updateLightmap(par1); + } + + GL11.glEnable(GL11.GL_CULL_FACE); + GL11.glEnable(GL11.GL_DEPTH_TEST); +- if(this.mc.renderViewEntity == null) { ++ ++ if (this.mc.renderViewEntity == null) { + this.mc.renderViewEntity = this.mc.thePlayer; + } + + this.mc.mcProfiler.endStartSection("pick"); +- this.getMouseOver(var1); ++ this.getMouseOver(par1); + EntityLivingBase var4 = this.mc.renderViewEntity; + RenderGlobal var5 = this.mc.renderGlobal; + EffectRenderer var6 = this.mc.effectRenderer; +- double var7 = var4.lastTickPosX + (var4.posX - var4.lastTickPosX) * (double)var1; +- double var9 = var4.lastTickPosY + (var4.posY - var4.lastTickPosY) * (double)var1; +- double var11 = var4.lastTickPosZ + (var4.posZ - var4.lastTickPosZ) * (double)var1; ++ double var7 = var4.lastTickPosX + (var4.posX - var4.lastTickPosX) * (double)par1; ++ double var9 = var4.lastTickPosY + (var4.posY - var4.lastTickPosY) * (double)par1; ++ double var11 = var4.lastTickPosZ + (var4.posZ - var4.lastTickPosZ) * (double)par1; + this.mc.mcProfiler.endStartSection("center"); + +- for(int var13 = 0; var13 < 2; ++var13) { +- if(this.mc.gameSettings.anaglyph) { ++ // Spout Start ++ for (int var13 = 0; var13 < (this.mc.gameSettings.anaglyph ? 2 : 1); ++var13) { ++ // Spout End ++ if (this.mc.gameSettings.anaglyph) { + anaglyphField = var13; +- if(anaglyphField == 0) { ++ ++ if (anaglyphField == 0) { + GL11.glColorMask(false, true, true, false); + } else { + GL11.glColorMask(true, false, false, false); +@@ -755,71 +1016,83 @@ + + this.mc.mcProfiler.endStartSection("clear"); + GL11.glViewport(0, 0, this.mc.displayWidth, this.mc.displayHeight); +- this.updateFogColor(var1); +- GL11.glClear(GL11.GL_DEPTH_BUFFER_BIT | GL11.GL_COLOR_BUFFER_BIT); ++ this.updateFogColor(par1); ++ GL11.glClear(GL11.GL_COLOR_BUFFER_BIT | GL11.GL_DEPTH_BUFFER_BIT); + GL11.glEnable(GL11.GL_CULL_FACE); + this.mc.mcProfiler.endStartSection("camera"); +- this.setupCameraTransform(var1, var13); ++ this.setupCameraTransform(par1, var13); + ActiveRenderInfo.updateRenderInfo(this.mc.thePlayer, this.mc.gameSettings.thirdPersonView == 2); + this.mc.mcProfiler.endStartSection("frustrum"); + ClippingHelperImpl.getInstance(); +- if(this.mc.gameSettings.renderDistance < 2) { +- this.setupFog(-1, var1); ++ ++ // Spout Start ++ if (this.mc.gameSettings.renderDistance < 2 || Configuration.isFarView()) { ++ // Spout End ++ this.setupFog(-1, par1); + this.mc.mcProfiler.endStartSection("sky"); +- var5.renderSky(var1); ++ var5.renderSky(par1); + } + + GL11.glEnable(GL11.GL_FOG); +- this.setupFog(1, var1); +- if(this.mc.gameSettings.ambientOcclusion != 0) { ++ this.setupFog(1, par1); ++ ++ // Spout Start ++ if (RenderPass.setAmbientOcclusion(this.mc.gameSettings.ambientOcclusion >= 2)) { ++ // Spout End + GL11.glShadeModel(GL11.GL_SMOOTH); + } + + this.mc.mcProfiler.endStartSection("culling"); + Frustrum var14 = new Frustrum(); + var14.setPosition(var7, var9, var11); +- this.mc.renderGlobal.clipRenderersByFrustum(var14, var1); +- if(var13 == 0) { ++ this.mc.renderGlobal.clipRenderersByFrustum(var14, par1); ++ ++ if (var13 == 0) { + this.mc.mcProfiler.endStartSection("updatechunks"); + +- while(!this.mc.renderGlobal.updateRenderers(var4, false) && var2 != 0L) { +- long var15 = var2 - System.nanoTime(); +- if(var15 < 0L || var15 > 1000000000L) { ++ while (!this.mc.renderGlobal.updateRenderers(var4, false) && par2 != 0L) { ++ long var15 = par2 - System.nanoTime(); ++ ++ if (var15 < 0L || var15 > 1000000000L) { + break; + } + } + } + +- if(var4.posY < 128.0D) { +- this.renderCloudsCheck(var5, var1); ++ if (var4.posY < 128.0D) { ++ this.renderCloudsCheck(var5, par1); + } +- + this.mc.mcProfiler.endStartSection("prepareterrain"); +- this.setupFog(0, var1); ++ this.setupFog(0, par1); + GL11.glEnable(GL11.GL_FOG); + this.mc.getTextureManager().bindTexture(TextureMap.locationBlocksTexture); + RenderHelper.disableStandardItemLighting(); + this.mc.mcProfiler.endStartSection("terrain"); +- var5.sortAndRender(var4, 0, (double)var1); ++ var5.sortAndRender(var4, 0, (double)par1); ++ // MCPatcher Start ++ RenderPass.doRenderPass(var5, var4, 2, (double)par1); ++ // MCPatcher End + GL11.glShadeModel(GL11.GL_FLAT); + EntityPlayer var17; +- if(this.debugViewDirection == 0) { ++ ++ if (this.debugViewDirection == 0) { + RenderHelper.enableStandardItemLighting(); + this.mc.mcProfiler.endStartSection("entities"); +- var5.renderEntities(var4.getPosition(var1), var14, var1); +- this.enableLightmap((double)var1); ++ var5.renderEntities(var4.getPosition(par1), var14, par1); ++ this.enableLightmap((double)par1); + this.mc.mcProfiler.endStartSection("litParticles"); +- var6.renderLitParticles(var4, var1); ++ var6.renderLitParticles(var4, par1); + RenderHelper.disableStandardItemLighting(); +- this.setupFog(0, var1); ++ this.setupFog(0, par1); + this.mc.mcProfiler.endStartSection("particles"); +- var6.renderParticles(var4, var1); +- this.disableLightmap((double)var1); +- if(this.mc.objectMouseOver != null && var4.isInsideOfMaterial(Material.water) && var4 instanceof EntityPlayer && !this.mc.gameSettings.hideGUI) { ++ var6.renderParticles(var4, par1); ++ this.disableLightmap((double)par1); ++ ++ if (this.mc.objectMouseOver != null && var4.isInsideOfMaterial(Material.water) && var4 instanceof EntityPlayer && !this.mc.gameSettings.hideGUI) { + var17 = (EntityPlayer)var4; + GL11.glDisable(GL11.GL_ALPHA_TEST); + this.mc.mcProfiler.endStartSection("outline"); +- var5.drawSelectionBox(var17, this.mc.objectMouseOver, 0, var1); ++ var5.drawSelectionBox(var17, this.mc.objectMouseOver, 0, par1); + GL11.glEnable(GL11.GL_ALPHA_TEST); + } + } +@@ -828,20 +1101,26 @@ + GL11.glEnable(GL11.GL_CULL_FACE); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + GL11.glDepthMask(true); +- this.setupFog(0, var1); ++ this.setupFog(0, par1); + GL11.glEnable(GL11.GL_BLEND); + GL11.glDisable(GL11.GL_CULL_FACE); + this.mc.getTextureManager().bindTexture(TextureMap.locationBlocksTexture); +- if(this.mc.gameSettings.fancyGraphics) { ++ ++ if (this.mc.gameSettings.fancyGraphics) { + this.mc.mcProfiler.endStartSection("water"); +- if(this.mc.gameSettings.ambientOcclusion != 0) { ++ ++ ++ // Spout Start ++ if (RenderPass.setAmbientOcclusion(this.mc.gameSettings.ambientOcclusion >= 2)) { ++ // Spout End + GL11.glShadeModel(GL11.GL_SMOOTH); + } + + GL11.glColorMask(false, false, false, false); +- int var18 = var5.sortAndRender(var4, 1, (double)var1); +- if(this.mc.gameSettings.anaglyph) { +- if(anaglyphField == 0) { ++ int var18 = var5.sortAndRender(var4, 1, (double)par1); ++ ++ if (this.mc.gameSettings.anaglyph) { ++ if (anaglyphField == 0) { + GL11.glColorMask(false, true, true, true); + } else { + GL11.glColorMask(true, false, false, true); +@@ -850,46 +1129,53 @@ + GL11.glColorMask(true, true, true, true); + } + +- if(var18 > 0) { +- var5.renderAllRenderLists(1, (double)var1); ++ if (var18 > 0) { ++ var5.renderAllRenderLists(1, (double)par1); + } + + GL11.glShadeModel(GL11.GL_FLAT); + } else { + this.mc.mcProfiler.endStartSection("water"); +- var5.sortAndRender(var4, 1, (double)var1); ++ var5.sortAndRender(var4, 1, (double)par1); + } + ++ // MCPatcher Start ++ this.renderRainSnow(par1); ++ RenderPass.doRenderPass(var5, var4, 3, (double)par1); ++ // MCPatcher End + GL11.glDepthMask(true); + GL11.glEnable(GL11.GL_CULL_FACE); + GL11.glDisable(GL11.GL_BLEND); +- if(this.cameraZoom == 1.0D && var4 instanceof EntityPlayer && !this.mc.gameSettings.hideGUI && this.mc.objectMouseOver != null && !var4.isInsideOfMaterial(Material.water)) { ++ ++ if (this.cameraZoom == 1.0D && var4 instanceof EntityPlayer && !this.mc.gameSettings.hideGUI && this.mc.objectMouseOver != null && !var4.isInsideOfMaterial(Material.water)) { + var17 = (EntityPlayer)var4; + GL11.glDisable(GL11.GL_ALPHA_TEST); + this.mc.mcProfiler.endStartSection("outline"); +- var5.drawSelectionBox(var17, this.mc.objectMouseOver, 0, var1); ++ var5.drawSelectionBox(var17, this.mc.objectMouseOver, 0, par1); + GL11.glEnable(GL11.GL_ALPHA_TEST); + } + + this.mc.mcProfiler.endStartSection("destroyProgress"); + GL11.glEnable(GL11.GL_BLEND); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE); +- var5.drawBlockDamageTexture(Tessellator.instance, (EntityPlayer)var4, var1); ++ var5.drawBlockDamageTexture(Tessellator.instance, (EntityPlayer)var4, par1); + GL11.glDisable(GL11.GL_BLEND); + this.mc.mcProfiler.endStartSection("weather"); +- this.renderRainSnow(var1); ++ this.renderRainSnow(par1); + GL11.glDisable(GL11.GL_FOG); +- if(var4.posY >= 128.0D) { +- this.renderCloudsCheck(var5, var1); ++ ++ if (var4.posY >= 128.0D) { ++ this.renderCloudsCheck(var5, par1); + } + + this.mc.mcProfiler.endStartSection("hand"); +- if(this.cameraZoom == 1.0D) { ++ ++ if (this.cameraZoom == 1.0D) { + GL11.glClear(GL11.GL_DEPTH_BUFFER_BIT); +- this.renderHand(var1, var13); ++ this.renderHand(par1, var13); + } + +- if(!this.mc.gameSettings.anaglyph) { ++ if (!this.mc.gameSettings.anaglyph) { + this.mc.mcProfiler.endSection(); + return; + } +@@ -899,28 +1185,43 @@ + this.mc.mcProfiler.endSection(); + } + +- private void renderCloudsCheck(RenderGlobal var1, float var2) { +- if(this.mc.gameSettings.shouldRenderClouds()) { ++ /** ++ * Render clouds if enabled ++ */ ++ private void renderCloudsCheck(RenderGlobal par1RenderGlobal, float par2) { ++ if (this.mc.gameSettings.shouldRenderClouds()) { + this.mc.mcProfiler.endStartSection("clouds"); + GL11.glPushMatrix(); +- this.setupFog(0, var2); ++ this.setupFog(0, par2); + GL11.glEnable(GL11.GL_FOG); +- var1.renderClouds(var2); ++ par1RenderGlobal.renderClouds(par2); + GL11.glDisable(GL11.GL_FOG); +- this.setupFog(1, var2); ++ this.setupFog(1, par2); + GL11.glPopMatrix(); + } +- + } + + private void addRainParticles() { + float var1 = this.mc.theWorld.getRainStrength(1.0F); +- if(!this.mc.gameSettings.fancyGraphics) { +- var1 /= 2.0F; +- } +- +- if(var1 != 0.0F) { +- this.ae.setSeed((long)this.rendererUpdateCount * 312987231L); ++ ++ // Spout Start ++ if (!Configuration.isWeather()) { ++ return; ++ } ++ if (SpoutWorth.getInstance().isBelowIdeal()) { ++ var1 /= 4.0F; ++ } ++ if (!Configuration.isFancyWeather()) { ++ var1 /= 2.0F; ++ } ++ // Spout End ++ ++ if (!this.mc.gameSettings.fancyGraphics) { ++ var1 /= 2.0F; ++ } ++ ++ if (var1 != 0.0F) { ++ this.random.setSeed((long)this.rendererUpdateCount * 312987231L); + EntityLivingBase var2 = this.mc.renderViewEntity; + WorldClient var3 = this.mc.theWorld; + int var4 = MathHelper.floor_double(var2.posX); +@@ -932,27 +1233,31 @@ + double var12 = 0.0D; + int var14 = 0; + int var15 = (int)(100.0F * var1 * var1); +- if(this.mc.gameSettings.particleSetting == 1) { ++ ++ if (this.mc.gameSettings.particleSetting == 1) { + var15 >>= 1; +- } else if(this.mc.gameSettings.particleSetting == 2) { ++ } else if (this.mc.gameSettings.particleSetting == 2) { + var15 = 0; + } + +- for(int var16 = 0; var16 < var15; ++var16) { +- int var17 = var4 + this.ae.nextInt(var7) - this.ae.nextInt(var7); +- int var18 = var6 + this.ae.nextInt(var7) - this.ae.nextInt(var7); ++ for (int var16 = 0; var16 < var15; ++var16) { ++ int var17 = var4 + this.random.nextInt(var7) - this.random.nextInt(var7); ++ int var18 = var6 + this.random.nextInt(var7) - this.random.nextInt(var7); + int var19 = var3.getPrecipitationHeight(var17, var18); + int var20 = var3.getBlockId(var17, var19 - 1, var18); + BiomeGenBase var21 = var3.getBiomeGenForCoords(var17, var18); +- if(var19 <= var5 + var7 && var19 >= var5 - var7 && var21.canSpawnLightningBolt() && var21.getFloatTemperature() >= 0.2F) { +- float var22 = this.ae.nextFloat(); +- float var23 = this.ae.nextFloat(); +- if(var20 > 0) { +- if(Block.blocksList[var20].blockMaterial == Material.lava) { ++ ++ if (var19 <= var5 + var7 && var19 >= var5 - var7 && var21.canSpawnLightningBolt() && var21.getFloatTemperature() >= 0.2F) { ++ float var22 = this.random.nextFloat(); ++ float var23 = this.random.nextFloat(); ++ ++ if (var20 > 0) { ++ if (Block.blocksList[var20].blockMaterial == Material.lava) { + this.mc.effectRenderer.addEffect(new EntitySmokeFX(var3, (double)((float)var17 + var22), (double)((float)var19 + 0.1F) - Block.blocksList[var20].getBlockBoundsMinY(), (double)((float)var18 + var23), 0.0D, 0.0D, 0.0D)); + } else { + ++var14; +- if(this.ae.nextInt(var14) == 0) { ++ ++ if (this.random.nextInt(var14) == 0) { + var8 = (double)((float)var17 + var22); + var10 = (double)((float)var19 + 0.1F) - Block.blocksList[var20].getBlockBoundsMinY(); + var12 = (double)((float)var18 + var23); +@@ -964,28 +1269,38 @@ + } + } + +- if(var14 > 0 && this.ae.nextInt(3) < this.rainSoundCounter++) { ++ if (var14 > 0 && this.random.nextInt(3) < this.rainSoundCounter++) { + this.rainSoundCounter = 0; +- if(var10 > var2.posY + 1.0D && var3.getPrecipitationHeight(MathHelper.floor_double(var2.posX), MathHelper.floor_double(var2.posZ)) > MathHelper.floor_double(var2.posY)) { ++ ++ if (var10 > var2.posY + 1.0D && var3.getPrecipitationHeight(MathHelper.floor_double(var2.posX), MathHelper.floor_double(var2.posZ)) > MathHelper.floor_double(var2.posY)) { + this.mc.theWorld.playSound(var8, var10, var12, "ambient.weather.rain", 0.1F, 0.5F, false); + } else { + this.mc.theWorld.playSound(var8, var10, var12, "ambient.weather.rain", 0.2F, 1.0F, false); + } + } +- + } + } + +- protected void renderRainSnow(float var1) { +- float var2 = this.mc.theWorld.getRainStrength(var1); +- if(var2 > 0.0F) { +- this.enableLightmap((double)var1); +- if(this.rainXCoords == null) { ++ /** ++ * Render rain and snow ++ */ ++ protected void renderRainSnow(float par1) { ++ // Spout Start ++ if (!Configuration.isWeather()) { ++ return; ++ } ++ // Spout End ++ float var2 = this.mc.theWorld.getRainStrength(par1); ++ ++ if (var2 > 0.0F) { ++ this.enableLightmap((double)par1); ++ ++ if (this.rainXCoords == null) { + this.rainXCoords = new float[1024]; + this.rainYCoords = new float[1024]; + +- for(int var3 = 0; var3 < 32; ++var3) { +- for(int var4 = 0; var4 < 32; ++var4) { ++ for (int var3 = 0; var3 < 32; ++var3) { ++ for (int var4 = 0; var4 < 32; ++var4) { + float var5 = (float)(var4 - 16); + float var6 = (float)(var3 - 16); + float var7 = MathHelper.sqrt_float(var5 * var5 + var6 * var6); +@@ -1006,58 +1321,66 @@ + GL11.glEnable(GL11.GL_BLEND); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + GL11.glAlphaFunc(GL11.GL_GREATER, 0.01F); +- this.mc.getTextureManager().bindTexture(locationSnowPng); +- double var9 = var41.lastTickPosX + (var41.posX - var41.lastTickPosX) * (double)var1; +- double var11 = var41.lastTickPosY + (var41.posY - var41.lastTickPosY) * (double)var1; +- double var13 = var41.lastTickPosZ + (var41.posZ - var41.lastTickPosZ) * (double)var1; ++ this.mc.getTextureManager().bindTexture(locationSnowPng); ++ double var9 = var41.lastTickPosX + (var41.posX - var41.lastTickPosX) * (double)par1; ++ double var11 = var41.lastTickPosY + (var41.posY - var41.lastTickPosY) * (double)par1; ++ double var13 = var41.lastTickPosZ + (var41.posZ - var41.lastTickPosZ) * (double)par1; + int var15 = MathHelper.floor_double(var11); + byte var16 = 5; +- if(this.mc.gameSettings.fancyGraphics) { ++ ++ // Spout Start ++ if (Configuration.isFancyWeather()) { ++ // Spout End + var16 = 10; + } + + boolean var17 = false; + byte var18 = -1; +- float var19 = (float)this.rendererUpdateCount + var1; +- if(this.mc.gameSettings.fancyGraphics) { ++ float var19 = (float)this.rendererUpdateCount + par1; ++ ++ if (this.mc.gameSettings.fancyGraphics) { + var16 = 10; + } + + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + var17 = false; + +- for(int var20 = var45 - var16; var20 <= var45 + var16; ++var20) { +- for(int var21 = var43 - var16; var21 <= var43 + var16; ++var21) { ++ for (int var20 = var45 - var16; var20 <= var45 + var16; ++var20) { ++ for (int var21 = var43 - var16; var21 <= var43 + var16; ++var21) { + int var22 = (var20 - var45 + 16) * 32 + var21 - var43 + 16; + float var23 = this.rainXCoords[var22] * 0.5F; + float var24 = this.rainYCoords[var22] * 0.5F; + BiomeGenBase var25 = var42.getBiomeGenForCoords(var21, var20); +- if(var25.canSpawnLightningBolt() || var25.getEnableSnow()) { ++ ++ if (var25.canSpawnLightningBolt() || var25.getEnableSnow()) { + int var26 = var42.getPrecipitationHeight(var21, var20); + int var27 = var44 - var16; + int var28 = var44 + var16; +- if(var27 < var26) { ++ ++ if (var27 < var26) { + var27 = var26; + } + +- if(var28 < var26) { ++ if (var28 < var26) { + var28 = var26; + } + + float var29 = 1.0F; + int var30 = var26; +- if(var26 < var15) { ++ ++ if (var26 < var15) { + var30 = var15; + } + +- if(var27 != var28) { +- this.ae.setSeed((long)(var21 * var21 * 3121 + var21 * 45238971 ^ var20 * var20 * 418711 + var20 * 13761)); ++ if (var27 != var28) { ++ this.random.setSeed((long)(var21 * var21 * 3121 + var21 * 45238971 ^ var20 * var20 * 418711 + var20 * 13761)); + float var31 = var25.getFloatTemperature(); +- float var32; + double var35; +- if(var42.getWorldChunkManager().getTemperatureAtHeight(var31, var26) >= 0.15F) { +- if(var18 != 0) { +- if(var18 >= 0) { ++ float var32; ++ ++ if (var42.getWorldChunkManager().getTemperatureAtHeight(var31, var26) >= 0.15F) { ++ if (var18 != 0) { ++ if (var18 >= 0) { + var8.draw(); + } + +@@ -1066,7 +1389,7 @@ + var8.startDrawingQuads(); + } + +- var32 = ((float)(this.rendererUpdateCount + var21 * var21 * 3121 + var21 * 45238971 + var20 * var20 * 418711 + var20 * 13761 & 31) + var1) / 32.0F * (3.0F + this.ae.nextFloat()); ++ var32 = ((float)(this.rendererUpdateCount + var21 * var21 * 3121 + var21 * 45238971 + var20 * var20 * 418711 + var20 * 13761 & 31) + par1) / 32.0F * (3.0F + this.random.nextFloat()); + double var33 = (double)((float)var21 + 0.5F) - var41.posX; + var35 = (double)((float)var20 + 0.5F) - var41.posZ; + float var37 = MathHelper.sqrt_double(var33 * var33 + var35 * var35) / (float)var16; +@@ -1080,8 +1403,8 @@ + var8.addVertexWithUV((double)((float)var21 - var23) + 0.5D, (double)var28, (double)((float)var20 - var24) + 0.5D, (double)(0.0F * var29), (double)((float)var28 * var29 / 4.0F + var32 * var29)); + var8.setTranslation(0.0D, 0.0D, 0.0D); + } else { +- if(var18 != 1) { +- if(var18 >= 0) { ++ if (var18 != 1) { ++ if (var18 >= 0) { + var8.draw(); + } + +@@ -1090,9 +1413,9 @@ + var8.startDrawingQuads(); + } + +- var32 = ((float)(this.rendererUpdateCount & 511) + var1) / 512.0F; +- float var46 = this.ae.nextFloat() + var19 * 0.01F * (float)this.ae.nextGaussian(); +- float var34 = this.ae.nextFloat() + var19 * (float)this.ae.nextGaussian() * 0.001F; ++ var32 = ((float)(this.rendererUpdateCount & 511) + par1) / 512.0F; ++ float var46 = this.random.nextFloat() + var19 * 0.01F * (float)this.random.nextGaussian(); ++ float var34 = this.random.nextFloat() + var19 * (float)this.random.nextGaussian() * 0.001F; + var35 = (double)((float)var21 + 0.5F) - var41.posX; + double var47 = (double)((float)var20 + 0.5F) - var41.posZ; + float var39 = MathHelper.sqrt_double(var35 * var35 + var47 * var47) / (float)var16; +@@ -1111,17 +1434,20 @@ + } + } + +- if(var18 >= 0) { ++ if (var18 >= 0) { + var8.draw(); + } + + GL11.glEnable(GL11.GL_CULL_FACE); + GL11.glDisable(GL11.GL_BLEND); + GL11.glAlphaFunc(GL11.GL_GREATER, 0.1F); +- this.disableLightmap((double)var1); ++ this.disableLightmap((double)par1); + } + } + ++ /** ++ * Setup orthogonal projection for rendering GUI screen overlays ++ */ + public void setupOverlayRendering() { + ScaledResolution var1 = new ScaledResolution(this.mc.gameSettings, this.mc.displayWidth, this.mc.displayHeight); + GL11.glClear(GL11.GL_DEPTH_BUFFER_BIT); +@@ -1133,30 +1459,46 @@ + GL11.glTranslatef(0.0F, 0.0F, -2000.0F); + } + +- private void updateFogColor(float var1) { ++ /** ++ * calculates fog and calls glClearColor ++ */ ++ private void updateFogColor(float par1) { + WorldClient var2 = this.mc.theWorld; + EntityLivingBase var3 = this.mc.renderViewEntity; + float var4 = 1.0F / (float)(4 - this.mc.gameSettings.renderDistance); ++ // MCPatcher Start ++ ColorizeWorld.setupForFog(var3); ++ ++ if (ColorizeWorld.computeFogColor(var2, par1)) { ++ this.fogColorRed = Colorizer.setColor[0]; ++ this.fogColorGreen = Colorizer.setColor[1]; ++ this.fogColorBlue = Colorizer.setColor[2]; ++ } ++ // MCPatcher End ++ + var4 = 1.0F - (float)Math.pow((double)var4, 0.25D); +- Vec3 var5 = var2.getSkyColor(this.mc.renderViewEntity, var1); ++ Vec3 var5 = var2.getSkyColor(this.mc.renderViewEntity, par1); + float var6 = (float)var5.xCoord; + float var7 = (float)var5.yCoord; + float var8 = (float)var5.zCoord; +- Vec3 var9 = var2.getFogColor(var1); ++ Vec3 var9 = var2.getFogColor(par1); + this.fogColorRed = (float)var9.xCoord; + this.fogColorGreen = (float)var9.yCoord; + this.fogColorBlue = (float)var9.zCoord; + float var11; +- if(this.mc.gameSettings.renderDistance < 2) { +- Vec3 var10 = MathHelper.sin(var2.getCelestialAngleRadians(var1)) > 0.0F ? var2.getWorldVec3Pool().getVecFromPool(-1.0D, 0.0D, 0.0D) : var2.getWorldVec3Pool().getVecFromPool(1.0D, 0.0D, 0.0D); +- var11 = (float)var3.getLook(var1).dotProduct(var10); +- if(var11 < 0.0F) { ++ ++ if (this.mc.gameSettings.renderDistance < 2) { ++ Vec3 var10 = MathHelper.sin(var2.getCelestialAngleRadians(par1)) > 0.0F ? var2.getWorldVec3Pool().getVecFromPool(-1.0D, 0.0D, 0.0D) : var2.getWorldVec3Pool().getVecFromPool(1.0D, 0.0D, 0.0D); ++ var11 = (float)var3.getLook(par1).dotProduct(var10); ++ ++ if (var11 < 0.0F) { + var11 = 0.0F; + } + +- if(var11 > 0.0F) { +- float[] var12 = var2.provider.calcSunriseSunsetColors(var2.getCelestialAngle(var1), var1); +- if(var12 != null) { ++ if (var11 > 0.0F) { ++ float[] var12 = var2.provider.calcSunriseSunsetColors(var2.getCelestialAngle(par1), par1); ++ ++ if (var12 != null) { + var11 *= var12[3]; + this.fogColorRed = this.fogColorRed * (1.0F - var11) + var12[0] * var11; + this.fogColorGreen = this.fogColorGreen * (1.0F - var11) + var12[1] * var11; +@@ -1168,9 +1510,10 @@ + this.fogColorRed += (var6 - this.fogColorRed) * var4; + this.fogColorGreen += (var7 - this.fogColorGreen) * var4; + this.fogColorBlue += (var8 - this.fogColorBlue) * var4; +- float var19 = var2.getRainStrength(var1); ++ float var19 = var2.getRainStrength(par1); + float var20; +- if(var19 > 0.0F) { ++ ++ if (var19 > 0.0F) { + var11 = 1.0F - var19 * 0.5F; + var20 = 1.0F - var19 * 0.4F; + this.fogColorRed *= var11; +@@ -1178,48 +1521,58 @@ + this.fogColorBlue *= var20; + } + +- var11 = var2.getWeightedThunderStrength(var1); +- if(var11 > 0.0F) { ++ var11 = var2.getWeightedThunderStrength(par1); ++ ++ if (var11 > 0.0F) { + var20 = 1.0F - var11 * 0.5F; + this.fogColorRed *= var20; + this.fogColorGreen *= var20; + this.fogColorBlue *= var20; + } + +- int var21 = ActiveRenderInfo.getBlockIdAtEntityViewpoint(this.mc.theWorld, var3, var1); ++ int var21 = ActiveRenderInfo.getBlockIdAtEntityViewpoint(this.mc.theWorld, var3, par1); + float var22; +- if(this.cloudFog) { +- Vec3 var13 = var2.getCloudColour(var1); ++ ++ if (this.cloudFog) { ++ Vec3 var13 = var2.getCloudColour(par1); + this.fogColorRed = (float)var13.xCoord; + this.fogColorGreen = (float)var13.yCoord; + this.fogColorBlue = (float)var13.zCoord; +- } else if(var21 != 0 && Block.blocksList[var21].blockMaterial == Material.water) { ++ } else if (var21 != 0 && Block.blocksList[var21].blockMaterial == Material.water) { + var22 = (float)EnchantmentHelper.getRespiration(var3) * 0.2F; + this.fogColorRed = 0.02F + var22; + this.fogColorGreen = 0.02F + var22; + this.fogColorBlue = 0.2F + var22; +- } else if(var21 != 0 && Block.blocksList[var21].blockMaterial == Material.lava) { ++ ++ if (ColorizeWorld.computeFogColor(Colorizer.COLOR_MAP_UNDERWATER)) { ++ this.fogColorRed = Colorizer.setColor[0] + var22; ++ this.fogColorGreen = Colorizer.setColor[1] + var22; ++ this.fogColorBlue = Colorizer.setColor[2] + var22; ++ } ++ } else if (var21 != 0 && Block.blocksList[var21].blockMaterial == Material.lava) { + this.fogColorRed = 0.6F; + this.fogColorGreen = 0.1F; + this.fogColorBlue = 0.0F; + } + +- var22 = this.fogColor2 + (this.fogColor1 - this.fogColor2) * var1; ++ var22 = this.fogColor2 + (this.fogColor1 - this.fogColor2) * par1; + this.fogColorRed *= var22; + this.fogColorGreen *= var22; + this.fogColorBlue *= var22; +- double var14 = (var3.lastTickPosY + (var3.posY - var3.lastTickPosY) * (double)var1) * var2.provider.getVoidFogYFactor(); +- if(var3.isPotionActive(Potion.blindness)) { ++ double var14 = (var3.lastTickPosY + (var3.posY - var3.lastTickPosY) * (double)par1) * var2.provider.getVoidFogYFactor(); ++ ++ if (var3.isPotionActive(Potion.blindness)) { + int var16 = var3.getActivePotionEffect(Potion.blindness).getDuration(); +- if(var16 < 20) { ++ ++ if (var16 < 20) { + var14 *= (double)(1.0F - (float)var16 / 20.0F); + } else { + var14 = 0.0D; + } + } + +- if(var14 < 1.0D) { +- if(var14 < 0.0D) { ++ if (var14 < 1.0D) { ++ if (var14 < 0.0D) { + var14 = 0.0D; + } + +@@ -1230,22 +1583,25 @@ + } + + float var23; +- if(this.field_82831_U > 0.0F) { +- var23 = this.field_82832_V + (this.field_82831_U - this.field_82832_V) * var1; ++ ++ if (this.field_82831_U > 0.0F) { ++ var23 = this.field_82832_V + (this.field_82831_U - this.field_82832_V) * par1; + this.fogColorRed = this.fogColorRed * (1.0F - var23) + this.fogColorRed * 0.7F * var23; + this.fogColorGreen = this.fogColorGreen * (1.0F - var23) + this.fogColorGreen * 0.6F * var23; + this.fogColorBlue = this.fogColorBlue * (1.0F - var23) + this.fogColorBlue * 0.6F * var23; + } + + float var17; +- if(var3.isPotionActive(Potion.nightVision)) { +- var23 = this.getNightVisionBrightness(this.mc.thePlayer, var1); ++ ++ if (var3.isPotionActive(Potion.nightVision)) { ++ var23 = this.getNightVisionBrightness(this.mc.thePlayer, par1); + var17 = 1.0F / this.fogColorRed; +- if(var17 > 1.0F / this.fogColorGreen) { ++ ++ if (var17 > 1.0F / this.fogColorGreen) { + var17 = 1.0F / this.fogColorGreen; + } + +- if(var17 > 1.0F / this.fogColorBlue) { ++ if (var17 > 1.0F / this.fogColorBlue) { + var17 = 1.0F / this.fogColorBlue; + } + +@@ -1254,7 +1610,7 @@ + this.fogColorBlue = this.fogColorBlue * (1.0F - var23) + this.fogColorBlue * var17 * var23; + } + +- if(this.mc.gameSettings.anaglyph) { ++ if (this.mc.gameSettings.anaglyph) { + var23 = (this.fogColorRed * 30.0F + this.fogColorGreen * 59.0F + this.fogColorBlue * 11.0F) / 100.0F; + var17 = (this.fogColorRed * 30.0F + this.fogColorGreen * 70.0F) / 100.0F; + float var18 = (this.fogColorRed * 30.0F + this.fogColorBlue * 70.0F) / 100.0F; +@@ -1266,20 +1622,27 @@ + GL11.glClearColor(this.fogColorRed, this.fogColorGreen, this.fogColorBlue, 0.0F); + } + +- private void setupFog(int var1, float var2) { ++ /** ++ * Sets up the fog to be rendered. If the arg passed in is -1 the fog starts at 0 and goes to 80% of far plane distance ++ * and is used for sky rendering. ++ */ ++ ++ private void setupFog(int par1, float par2) { + EntityLivingBase var3 = this.mc.renderViewEntity; + boolean var4 = false; +- if(var3 instanceof EntityPlayer) { ++ ++ if (var3 instanceof EntityPlayer) { + var4 = ((EntityPlayer)var3).capabilities.isCreativeMode; + } + +- if(var1 == 999) { ++ if (par1 == 999) { + GL11.glFog(GL11.GL_FOG_COLOR, this.setFogColorBuffer(0.0F, 0.0F, 0.0F, 1.0F)); + GL11.glFogi(GL11.GL_FOG_MODE, GL11.GL_LINEAR); + GL11.glFogf(GL11.GL_FOG_START, 0.0F); + GL11.glFogf(GL11.GL_FOG_END, 8.0F); +- if(GLContext.getCapabilities().GL_NV_fog_distance) { +- GL11.glFogi(NVFogDistance.GL_FOG_DISTANCE_MODE_NV, NVFogDistance.GL_EYE_RADIAL_NV); ++ ++ if (GLContext.getCapabilities().GL_NV_fog_distance) { ++ GL11.glFogi(34138, 34139); + } + + GL11.glFogf(GL11.GL_FOG_START, 0.0F); +@@ -1287,17 +1650,20 @@ + GL11.glFog(GL11.GL_FOG_COLOR, this.setFogColorBuffer(this.fogColorRed, this.fogColorGreen, this.fogColorBlue, 1.0F)); + GL11.glNormal3f(0.0F, -1.0F, 0.0F); + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); +- int var5 = ActiveRenderInfo.getBlockIdAtEntityViewpoint(this.mc.theWorld, var3, var2); ++ int var5 = ActiveRenderInfo.getBlockIdAtEntityViewpoint(this.mc.theWorld, var3, par2); + float var6; +- if(var3.isPotionActive(Potion.blindness)) { ++ ++ if (var3.isPotionActive(Potion.blindness)) { + var6 = 5.0F; + int var7 = var3.getActivePotionEffect(Potion.blindness).getDuration(); +- if(var7 < 20) { ++ ++ if (var7 < 20) { + var6 = 5.0F + (this.farPlaneDistance - 5.0F) * (1.0F - (float)var7 / 20.0F); + } + + GL11.glFogi(GL11.GL_FOG_MODE, GL11.GL_LINEAR); +- if(var1 < 0) { ++ ++ if (par1 < 0) { + GL11.glFogf(GL11.GL_FOG_START, 0.0F); + GL11.glFogf(GL11.GL_FOG_END, var6 * 0.8F); + } else { +@@ -1305,59 +1671,127 @@ + GL11.glFogf(GL11.GL_FOG_END, var6); + } + +- if(GLContext.getCapabilities().GL_NV_fog_distance) { +- GL11.glFogi(NVFogDistance.GL_FOG_DISTANCE_MODE_NV, NVFogDistance.GL_EYE_RADIAL_NV); +- } +- } else if(this.cloudFog) { +- GL11.glFogi(GL11.GL_FOG_MODE, GL11.GL_EXP); +- GL11.glFogf(GL11.GL_FOG_DENSITY, 0.1F); +- } else if(var5 > 0 && Block.blocksList[var5].blockMaterial == Material.water) { +- GL11.glFogi(GL11.GL_FOG_MODE, GL11.GL_EXP); +- if(var3.isPotionActive(Potion.waterBreathing)) { +- GL11.glFogf(GL11.GL_FOG_DENSITY, 0.05F); +- } else { +- GL11.glFogf(GL11.GL_FOG_DENSITY, 0.1F - (float)EnchantmentHelper.getRespiration(var3) * 0.03F); +- } +- } else if(var5 > 0 && Block.blocksList[var5].blockMaterial == Material.lava) { +- GL11.glFogi(GL11.GL_FOG_MODE, GL11.GL_EXP); +- GL11.glFogf(GL11.GL_FOG_DENSITY, 2.0F); ++ if (GLContext.getCapabilities().GL_NV_fog_distance) { ++ GL11.glFogi(34138, 34139); ++ } + } else { +- var6 = this.farPlaneDistance; +- if(this.mc.theWorld.provider.getWorldHasVoidParticles() && !var4) { +- double var10 = (double)((var3.getBrightnessForRender(var2) & 15728640) >> 20) / 16.0D + (var3.lastTickPosY + (var3.posY - var3.lastTickPosY) * (double)var2 + 4.0D) / 32.0D; +- if(var10 < 1.0D) { +- if(var10 < 0.0D) { +- var10 = 0.0D; +- } +- +- var10 *= var10; +- float var9 = 100.0F * (float)var10; +- if(var9 < 5.0F) { +- var9 = 5.0F; +- } +- +- if(var6 > var9) { +- var6 = var9; +- } +- } +- } +- +- GL11.glFogi(GL11.GL_FOG_MODE, GL11.GL_LINEAR); +- if(var1 < 0) { +- GL11.glFogf(GL11.GL_FOG_START, 0.0F); +- GL11.glFogf(GL11.GL_FOG_END, var6 * 0.8F); ++ float var8; ++ float var9; ++ float var10; ++ float var11; ++ float var12; ++ ++ if (this.cloudFog) { ++ GL11.glFogi(GL11.GL_FOG_MODE, GL11.GL_EXP); ++ // Spout Start ++ float density = 0.1F; ++ if (var3.isPotionActive(Potion.waterBreathing)) { ++ density = 0.05F; ++ } ++ if (Configuration.isClearWater()) { ++ density = 0.02F; ++ } ++ GL11.glFogf(GL11.GL_FOG_DENSITY, density); ++ // Spout End ++ GL11.glFogf(GL11.GL_FOG_DENSITY, 0.1F); ++ var6 = 1.0F; ++ var12 = 1.0F; ++ var8 = 1.0F; ++ ++ if (this.mc.gameSettings.anaglyph) { ++ var9 = (var6 * 30.0F + var12 * 59.0F + var8 * 11.0F) / 100.0F; ++ var10 = (var6 * 30.0F + var12 * 70.0F) / 100.0F; ++ var11 = (var6 * 30.0F + var8 * 70.0F) / 100.0F; ++ } ++ } else if (var5 > 0 && Block.blocksList[var5].blockMaterial == Material.water) { ++ GL11.glFogi(GL11.GL_FOG_MODE, GL11.GL_EXP); ++ // Spout Start ++ float density = 0.1F; ++ if (Configuration.isClearWater() || (var3.isPotionActive(Potion.waterBreathing))) { ++ density = 0.05F; ++ } else { ++ density = 0.1F; ++ } ++ GL11.glFogf(GL11.GL_FOG_DENSITY, density); ++ // Spout End ++ var6 = 0.4F; ++ var12 = 0.4F; ++ var8 = 0.9F; ++ ++ if (this.mc.gameSettings.anaglyph) { ++ var9 = (var6 * 30.0F + var12 * 59.0F + var8 * 11.0F) / 100.0F; ++ var10 = (var6 * 30.0F + var12 * 70.0F) / 100.0F; ++ var11 = (var6 * 30.0F + var8 * 70.0F) / 100.0F; ++ } ++ } else if (var5 > 0 && Block.blocksList[var5].blockMaterial == Material.lava) { ++ GL11.glFogi(GL11.GL_FOG_MODE, GL11.GL_EXP); ++ GL11.glFogf(GL11.GL_FOG_DENSITY, 2.0F); ++ var6 = 0.4F; ++ var12 = 0.3F; ++ var8 = 0.3F; ++ ++ if (this.mc.gameSettings.anaglyph) { ++ var9 = (var6 * 30.0F + var12 * 59.0F + var8 * 11.0F) / 100.0F; ++ var10 = (var6 * 30.0F + var12 * 70.0F) / 100.0F; ++ var11 = (var6 * 30.0F + var8 * 70.0F) / 100.0F; ++ } + } else { +- GL11.glFogf(GL11.GL_FOG_START, var6 * 0.25F); +- GL11.glFogf(GL11.GL_FOG_END, var6); +- } +- +- if(GLContext.getCapabilities().GL_NV_fog_distance) { +- GL11.glFogi(NVFogDistance.GL_FOG_DISTANCE_MODE_NV, NVFogDistance.GL_EYE_RADIAL_NV); +- } +- +- if(this.mc.theWorld.provider.doesXZShowFog((int)var3.posX, (int)var3.posZ)) { +- GL11.glFogf(GL11.GL_FOG_START, var6 * 0.05F); +- GL11.glFogf(GL11.GL_FOG_END, Math.min(var6, 192.0F) * 0.5F); ++ var6 = this.farPlaneDistance; ++ ++ if (this.mc.theWorld.provider.getWorldHasVoidParticles() && !var4) { ++ double var13 = (double)((var3.getBrightnessForRender(par2) & 15728640) >> 20) / 16.0D + (var3.lastTickPosY + (var3.posY - var3.lastTickPosY) * (double)par2 + 4.0D) / 32.0D; ++ ++ if (var13 < 1.0D) { ++ if (var13 < 0.0D) { ++ var13 = 0.0D; ++ } ++ ++ var13 *= var13; ++ var9 = 100.0F * (float)var13; ++ ++ if (var9 < 5.0F) { ++ var9 = 5.0F; ++ } ++ ++ if (var6 > var9) { ++ var6 = var9; ++ } ++ } ++ } ++ ++ // Spout Start ++ if (!Configuration.isVoidFog()) { ++ var6 = 0.8F * this.farPlaneDistance; ++ var12 = this.farPlaneDistance; ++ } ++ // Spout End ++ ++ GL11.glFogi(GL11.GL_FOG_MODE, GL11.GL_LINEAR); ++ ++ if (par1 < 0) { ++ GL11.glFogf(GL11.GL_FOG_START, 0.0F); ++ GL11.glFogf(GL11.GL_FOG_END, var6 * 0.8F); ++ } else { ++ GL11.glFogf(GL11.GL_FOG_START, var6 * 0.25F); ++ GL11.glFogf(GL11.GL_FOG_END, var6); ++ } ++ ++ if (GLContext.getCapabilities().GL_NV_fog_distance) { ++ // Spout Start ++ //TODO: Previous fog calculation may work better. ++ //GL11.glFogi(34138, 34139); ++ if (Configuration.isFancyFog()) { ++ GL11.glFogi('\u855a', '\u855b'); ++ } else { ++ GL11.glFogi('\u855a', '\u855c'); ++ } ++ // Spout End ++ } ++ ++ if (this.mc.theWorld.provider.doesXZShowFog((int)var3.posX, (int)var3.posZ)) { ++ GL11.glFogf(GL11.GL_FOG_START, var6 * 0.05F); ++ GL11.glFogf(GL11.GL_FOG_END, Math.min(var6, 192.0F) * 0.5F); ++ } + } + } + +@@ -1366,27 +1800,43 @@ + } + } + +- private FloatBuffer setFogColorBuffer(float var1, float var2, float var3, float var4) { +- this.j.clear(); +- this.j.put(var1).put(var2).put(var3).put(var4); +- this.j.flip(); +- return this.j; ++ /** ++ * Update and return fogColorBuffer with the RGBA values passed as arguments ++ */ ++ private FloatBuffer setFogColorBuffer(float par1, float par2, float par3, float par4) { ++ this.fogColorBuffer.clear(); ++ this.fogColorBuffer.put(par1).put(par2).put(par3).put(par4); ++ this.fogColorBuffer.flip(); ++ return this.fogColorBuffer; + } + +- public static int performanceToFps(int var0) { ++ /** ++ * Converts performance value (0-2) to FPS (35-200) ++ */ ++ public static int performanceToFps(int par0) { + short var1 = 200; +- if(var0 == 1) { ++ ++ if (par0 == 1) { + var1 = 120; + } + +- if(var0 == 2) { ++ if (par0 == 2) { + var1 = 35; + } + + return var1; + } + +- static Minecraft getRendererMinecraft(EntityRenderer var0) { +- return var0.mc; +- } ++ /** ++ * Get minecraft reference from the EntityRenderer ++ */ ++ static Minecraft getRendererMinecraft(EntityRenderer par0EntityRenderer) { ++ return par0EntityRenderer.mc; ++ } ++ ++ // MCPatcher Start ++ public float getNightVisionStrength(float var1) { ++ return this.mc.thePlayer.isPotionActive(Potion.nightVision) ? this.getNightVisionBrightness(this.mc.thePlayer, var1) : 0.0F; ++ } ++ // MCPatcher End + } diff --git a/patches/net/minecraft/src/EntitySelectorAlive.java.patch b/patches/net/minecraft/src/EntitySelectorAlive.java.patch new file mode 100644 index 0000000..4b1e2d0 --- /dev/null +++ b/patches/net/minecraft/src/EntitySelectorAlive.java.patch @@ -0,0 +1,16 @@ +--- net/minecraft/src/EntitySelectorAlive.java ++++ net/minecraft/src/EntitySelectorAlive.java +@@ -1,7 +1,11 @@ + package net.minecraft.src; + + final class EntitySelectorAlive implements IEntitySelector { +- public boolean isEntityApplicable(Entity var1) { +- return var1.isEntityAlive(); ++ ++ /** ++ * Return whether the specified entity is applicable to this filter. ++ */ ++ public boolean isEntityApplicable(Entity par1Entity) { ++ return par1Entity.isEntityAlive(); + } + } diff --git a/patches/net/minecraft/src/EntitySelectorArmoredMob.java.patch b/patches/net/minecraft/src/EntitySelectorArmoredMob.java.patch new file mode 100644 index 0000000..e3c113a --- /dev/null +++ b/patches/net/minecraft/src/EntitySelectorArmoredMob.java.patch @@ -0,0 +1,31 @@ +--- net/minecraft/src/EntitySelectorArmoredMob.java ++++ net/minecraft/src/EntitySelectorArmoredMob.java +@@ -3,18 +3,21 @@ + public class EntitySelectorArmoredMob implements IEntitySelector { + private final ItemStack field_96567_c; + +- public EntitySelectorArmoredMob(ItemStack var1) { +- this.field_96567_c = var1; ++ public EntitySelectorArmoredMob(ItemStack par1ItemStack) { ++ this.field_96567_c = par1ItemStack; + } + +- public boolean isEntityApplicable(Entity var1) { +- if(!var1.isEntityAlive()) { ++ /** ++ * Return whether the specified entity is applicable to this filter. ++ */ ++ public boolean isEntityApplicable(Entity par1Entity) { ++ if (!par1Entity.isEntityAlive()) { + return false; +- } else if(!(var1 instanceof EntityLivingBase)) { ++ } else if (!(par1Entity instanceof EntityLivingBase)) { + return false; + } else { +- EntityLivingBase var2 = (EntityLivingBase)var1; +- return var2.getEquipmentInSlot(EntityLiving.getArmorPosition(this.field_96567_c)) != null ? false : (var2 instanceof EntityLiving ? ((EntityLiving)var2).canPickUpLoot() : var2 instanceof EntityPlayer); ++ EntityLivingBase var2 = (EntityLivingBase)par1Entity; ++ return var2.getCurrentItemOrArmor(EntityLiving.getArmorPosition(this.field_96567_c)) != null ? false : (var2 instanceof EntityLiving ? ((EntityLiving)var2).canPickUpLoot() : var2 instanceof EntityPlayer); + } + } + } diff --git a/patches/net/minecraft/src/EntitySelectorInventory.java.patch b/patches/net/minecraft/src/EntitySelectorInventory.java.patch new file mode 100644 index 0000000..a795ce8 --- /dev/null +++ b/patches/net/minecraft/src/EntitySelectorInventory.java.patch @@ -0,0 +1,16 @@ +--- net/minecraft/src/EntitySelectorInventory.java ++++ net/minecraft/src/EntitySelectorInventory.java +@@ -1,7 +1,11 @@ + package net.minecraft.src; + + final class EntitySelectorInventory implements IEntitySelector { +- public boolean isEntityApplicable(Entity var1) { +- return var1 instanceof IInventory && var1.isEntityAlive(); ++ ++ /** ++ * Return whether the specified entity is applicable to this filter. ++ */ ++ public boolean isEntityApplicable(Entity par1Entity) { ++ return par1Entity instanceof IInventory && par1Entity.isEntityAlive(); + } + } diff --git a/patches/net/minecraft/src/EntitySenses.java.patch b/patches/net/minecraft/src/EntitySenses.java.patch new file mode 100644 index 0000000..559a38a --- /dev/null +++ b/patches/net/minecraft/src/EntitySenses.java.patch @@ -0,0 +1,59 @@ +--- net/minecraft/src/EntitySenses.java ++++ net/minecraft/src/EntitySenses.java +@@ -5,31 +5,42 @@ + + public class EntitySenses { + EntityLiving entityObj; +- List b = new ArrayList(); +- List c = new ArrayList(); +- +- public EntitySenses(EntityLiving var1) { +- this.entityObj = var1; ++ ++ /** Cache of entities which we can see */ ++ List seenEntities = new ArrayList(); ++ ++ /** Cache of entities which we cannot see */ ++ List unseenEntities = new ArrayList(); ++ ++ public EntitySenses(EntityLiving par1EntityLiving) { ++ this.entityObj = par1EntityLiving; + } + ++ /** ++ * Clears canSeeCachePositive and canSeeCacheNegative. ++ */ + public void clearSensingCache() { +- this.b.clear(); +- this.c.clear(); ++ this.seenEntities.clear(); ++ this.unseenEntities.clear(); + } + +- public boolean canSee(Entity var1) { +- if(this.b.contains(var1)) { ++ /** ++ * Checks, whether 'our' entity can see the entity given as argument (true) or not (false), caching the result. ++ */ ++ public boolean canSee(Entity par1Entity) { ++ if (this.seenEntities.contains(par1Entity)) { + return true; +- } else if(this.c.contains(var1)) { ++ } else if (this.unseenEntities.contains(par1Entity)) { + return false; + } else { + this.entityObj.worldObj.theProfiler.startSection("canSee"); +- boolean var2 = this.entityObj.canEntityBeSeen(var1); ++ boolean var2 = this.entityObj.canEntityBeSeen(par1Entity); + this.entityObj.worldObj.theProfiler.endSection(); +- if(var2) { +- this.b.add(var1); ++ ++ if (var2) { ++ this.seenEntities.add(par1Entity); + } else { +- this.c.add(var1); ++ this.unseenEntities.add(par1Entity); + } + + return var2; diff --git a/patches/net/minecraft/src/EntitySheep.java.patch b/patches/net/minecraft/src/EntitySheep.java.patch new file mode 100644 index 0000000..173579b --- /dev/null +++ b/patches/net/minecraft/src/EntitySheep.java.patch @@ -0,0 +1,343 @@ +--- net/minecraft/src/EntitySheep.java ++++ net/minecraft/src/EntitySheep.java +@@ -4,12 +4,24 @@ + + public class EntitySheep extends EntityAnimal { + private final InventoryCrafting field_90016_e = new InventoryCrafting(new ContainerSheep(this), 2, 1); +- public static final float[][] fleeceColorTable = new float[][]{{1.0F, 1.0F, 1.0F}, {0.85F, 0.5F, 0.2F}, {0.7F, 0.3F, 0.85F}, {0.4F, 0.6F, 0.85F}, {0.9F, 0.9F, 0.2F}, {0.5F, 0.8F, 0.1F}, {0.95F, 0.5F, 0.65F}, {0.3F, 0.3F, 0.3F}, {0.6F, 0.6F, 0.6F}, {0.3F, 0.5F, 0.6F}, {0.5F, 0.25F, 0.7F}, {0.2F, 0.3F, 0.7F}, {0.4F, 0.3F, 0.2F}, {0.4F, 0.5F, 0.2F}, {0.6F, 0.2F, 0.2F}, {0.1F, 0.1F, 0.1F}}; ++ ++ /** ++ * Holds the RGB table of the sheep colors - in OpenGL glColor3f values - used to render the sheep colored fleece. ++ */ ++ // Spout Start - Removed final ++ public static float[][] fleeceColorTable = new float[][] {{1.0F, 1.0F, 1.0F}, {0.85F, 0.5F, 0.2F}, {0.7F, 0.3F, 0.85F}, {0.4F, 0.6F, 0.85F}, {0.9F, 0.9F, 0.2F}, {0.5F, 0.8F, 0.1F}, {0.95F, 0.5F, 0.65F}, {0.3F, 0.3F, 0.3F}, {0.6F, 0.6F, 0.6F}, {0.3F, 0.5F, 0.6F}, {0.5F, 0.25F, 0.7F}, {0.2F, 0.3F, 0.7F}, {0.4F, 0.3F, 0.2F}, {0.4F, 0.5F, 0.2F}, {0.6F, 0.2F, 0.2F}, {0.1F, 0.1F, 0.1F}}; ++ // Spout End ++ ++ /** ++ * Used to control movement as well as wool regrowth. Set to 40 on handleHealthUpdate and counts down with each tick. ++ */ + private int sheepTimer; ++ ++ /** The eat grass AI task for this mob. */ + private EntityAIEatGrass aiEatGrass = new EntityAIEatGrass(this); + +- public EntitySheep(World var1) { +- super(var1); ++ public EntitySheep(World par1World) { ++ super(par1World); + this.setSize(0.9F, 1.3F); + this.getNavigator().setAvoidsWater(true); + this.tasks.addTask(0, new EntityAISwimming(this)); +@@ -25,6 +37,9 @@ + this.field_90016_e.setInventorySlotContents(1, new ItemStack(Item.dyePowder, 1, 0)); + } + ++ /** ++ * Returns true if the newer Entity AI code should be run ++ */ + protected boolean isAIEnabled() { + return true; + } +@@ -34,8 +49,12 @@ + super.updateAITasks(); + } + ++ /** ++ * Called frequently so the entity can update its state every tick as required. For example, zombies and skeletons use ++ * this to react to sunlight and start to burn. ++ */ + public void onLivingUpdate() { +- if(this.worldObj.isRemote) { ++ if (this.worldObj.isRemote) { + this.sheepTimer = Math.max(0, this.sheepTimer - 1); + } + +@@ -45,7 +64,7 @@ + protected void applyEntityAttributes() { + super.applyEntityAttributes(); + this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setAttribute(8.0D); +- this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setAttribute((double)0.23F); ++ this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setAttribute(0.23000000417232513D); + } + + protected void entityInit() { +@@ -53,86 +72,113 @@ + this.dataWatcher.addObject(16, new Byte((byte)0)); + } + +- protected void dropFewItems(boolean var1, int var2) { +- if(!this.getSheared()) { ++ /** ++ * Drop 0-2 items of this living's type. @param par1 - Whether this entity has recently been hit by a player. @param ++ * par2 - Level of Looting used to kill this mob. ++ */ ++ protected void dropFewItems(boolean par1, int par2) { ++ if (!this.getSheared()) { + this.entityDropItem(new ItemStack(Block.cloth.blockID, 1, this.getFleeceColor()), 0.0F); + } +- + } + ++ /** ++ * Returns the item ID for the item the mob drops on death. ++ */ + protected int getDropItemId() { + return Block.cloth.blockID; + } + +- public void handleHealthUpdate(byte var1) { +- if(var1 == 10) { ++ public void handleHealthUpdate(byte par1) { ++ if (par1 == 10) { + this.sheepTimer = 40; + } else { +- super.handleHealthUpdate(var1); ++ super.handleHealthUpdate(par1); + } +- +- } +- +- public float func_70894_j(float var1) { +- return this.sheepTimer <= 0 ? 0.0F : (this.sheepTimer >= 4 && this.sheepTimer <= 36 ? 1.0F : (this.sheepTimer < 4 ? ((float)this.sheepTimer - var1) / 4.0F : -((float)(this.sheepTimer - 40) - var1) / 4.0F)); +- } +- +- public float func_70890_k(float var1) { +- if(this.sheepTimer > 4 && this.sheepTimer <= 36) { +- float var2 = ((float)(this.sheepTimer - 4) - var1) / 32.0F; +- return (float)Math.PI * 0.2F + (float)Math.PI * 0.07F * MathHelper.sin(var2 * 28.7F); ++ } ++ ++ public float func_70894_j(float par1) { ++ return this.sheepTimer <= 0 ? 0.0F : (this.sheepTimer >= 4 && this.sheepTimer <= 36 ? 1.0F : (this.sheepTimer < 4 ? ((float)this.sheepTimer - par1) / 4.0F : -((float)(this.sheepTimer - 40) - par1) / 4.0F)); ++ } ++ ++ public float func_70890_k(float par1) { ++ if (this.sheepTimer > 4 && this.sheepTimer <= 36) { ++ float var2 = ((float)(this.sheepTimer - 4) - par1) / 32.0F; ++ return ((float)Math.PI / 5F) + ((float)Math.PI * 7F / 100F) * MathHelper.sin(var2 * 28.7F); + } else { +- return this.sheepTimer > 0 ? (float)Math.PI * 0.2F : this.rotationPitch / (180.0F / (float)Math.PI); ++ return this.sheepTimer > 0 ? ((float)Math.PI / 5F) : this.rotationPitch / (180F / (float)Math.PI); + } + } + +- public boolean interact(EntityPlayer var1) { +- ItemStack var2 = var1.inventory.getCurrentItem(); +- if(var2 != null && var2.itemID == Item.shears.itemID && !this.getSheared() && !this.isChild()) { +- if(!this.worldObj.isRemote) { ++ /** ++ * Called when a player interacts with a mob. e.g. gets milk from a cow, gets into the saddle on a pig. ++ */ ++ public boolean interact(EntityPlayer par1EntityPlayer) { ++ ItemStack var2 = par1EntityPlayer.inventory.getCurrentItem(); ++ ++ if (var2 != null && var2.itemID == Item.shears.itemID && !this.getSheared() && !this.isChild()) { ++ if (!this.worldObj.isRemote) { + this.setSheared(true); +- int var3 = 1 + this.ab.nextInt(3); ++ int var3 = 1 + this.rand.nextInt(3); + +- for(int var4 = 0; var4 < var3; ++var4) { ++ for (int var4 = 0; var4 < var3; ++var4) { + EntityItem var5 = this.entityDropItem(new ItemStack(Block.cloth.blockID, 1, this.getFleeceColor()), 1.0F); +- var5.motionY += (double)(this.ab.nextFloat() * 0.05F); +- var5.motionX += (double)((this.ab.nextFloat() - this.ab.nextFloat()) * 0.1F); +- var5.motionZ += (double)((this.ab.nextFloat() - this.ab.nextFloat()) * 0.1F); ++ var5.motionY += (double)(this.rand.nextFloat() * 0.05F); ++ var5.motionX += (double)((this.rand.nextFloat() - this.rand.nextFloat()) * 0.1F); ++ var5.motionZ += (double)((this.rand.nextFloat() - this.rand.nextFloat()) * 0.1F); + } + } + +- var2.damageItem(1, var1); ++ var2.damageItem(1, par1EntityPlayer); + this.playSound("mob.sheep.shear", 1.0F, 1.0F); + } + +- return super.interact(var1); +- } +- +- public void writeEntityToNBT(NBTTagCompound var1) { +- super.writeEntityToNBT(var1); +- var1.setBoolean("Sheared", this.getSheared()); +- var1.setByte("Color", (byte)this.getFleeceColor()); +- } +- +- public void readEntityFromNBT(NBTTagCompound var1) { +- super.readEntityFromNBT(var1); +- this.setSheared(var1.getBoolean("Sheared")); +- this.setFleeceColor(var1.getByte("Color")); +- } +- ++ return super.interact(par1EntityPlayer); ++ } ++ ++ /** ++ * (abstract) Protected helper method to write subclass entity data to NBT. ++ */ ++ public void writeEntityToNBT(NBTTagCompound par1NBTTagCompound) { ++ super.writeEntityToNBT(par1NBTTagCompound); ++ par1NBTTagCompound.setBoolean("Sheared", this.getSheared()); ++ par1NBTTagCompound.setByte("Color", (byte)this.getFleeceColor()); ++ } ++ ++ /** ++ * (abstract) Protected helper method to read subclass entity data from NBT. ++ */ ++ public void readEntityFromNBT(NBTTagCompound par1NBTTagCompound) { ++ super.readEntityFromNBT(par1NBTTagCompound); ++ this.setSheared(par1NBTTagCompound.getBoolean("Sheared")); ++ this.setFleeceColor(par1NBTTagCompound.getByte("Color")); ++ } ++ ++ /** ++ * Returns the sound this mob makes while it's alive. ++ */ + protected String getLivingSound() { + return "mob.sheep.say"; + } + ++ /** ++ * Returns the sound this mob makes when it is hurt. ++ */ + protected String getHurtSound() { + return "mob.sheep.say"; + } + ++ /** ++ * Returns the sound this mob makes on death. ++ */ + protected String getDeathSound() { + return "mob.sheep.say"; + } + +- protected void playStepSound(int var1, int var2, int var3, int var4) { ++ /** ++ * Plays step sound at given x, y, z for the entity ++ */ ++ protected void playStepSound(int par1, int par2, int par3, int par4) { + this.playSound("mob.sheep.step", 0.15F, 1.0F); + } + +@@ -140,73 +186,87 @@ + return this.dataWatcher.getWatchableObjectByte(16) & 15; + } + +- public void setFleeceColor(int var1) { ++ public void setFleeceColor(int par1) { + byte var2 = this.dataWatcher.getWatchableObjectByte(16); +- this.dataWatcher.updateObject(16, Byte.valueOf((byte)(var2 & 240 | var1 & 15))); ++ this.dataWatcher.updateObject(16, Byte.valueOf((byte)(var2 & 240 | par1 & 15))); + } + ++ /** ++ * returns true if a sheeps wool has been sheared ++ */ + public boolean getSheared() { + return (this.dataWatcher.getWatchableObjectByte(16) & 16) != 0; + } + +- public void setSheared(boolean var1) { ++ /** ++ * make a sheep sheared if set to true ++ */ ++ public void setSheared(boolean par1) { + byte var2 = this.dataWatcher.getWatchableObjectByte(16); +- if(var1) { ++ ++ if (par1) { + this.dataWatcher.updateObject(16, Byte.valueOf((byte)(var2 | 16))); + } else { + this.dataWatcher.updateObject(16, Byte.valueOf((byte)(var2 & -17))); + } +- +- } +- +- public static int getRandomFleeceColor(Random var0) { +- int var1 = var0.nextInt(100); +- return var1 < 5 ? 15 : (var1 < 10 ? 7 : (var1 < 15 ? 8 : (var1 < 18 ? 12 : (var0.nextInt(500) == 0 ? 6 : 0)))); +- } +- +- public EntitySheep func_90015_b(EntityAgeable var1) { +- EntitySheep var2 = (EntitySheep)var1; ++ } ++ ++ /** ++ * This method is called when a sheep spawns in the world to select the color of sheep fleece. ++ */ ++ public static int getRandomFleeceColor(Random par0Random) { ++ int var1 = par0Random.nextInt(100); ++ return var1 < 5 ? 15 : (var1 < 10 ? 7 : (var1 < 15 ? 8 : (var1 < 18 ? 12 : (par0Random.nextInt(500) == 0 ? 6 : 0)))); ++ } ++ ++ public EntitySheep func_90015_b(EntityAgeable par1EntityAgeable) { ++ EntitySheep var2 = (EntitySheep)par1EntityAgeable; + EntitySheep var3 = new EntitySheep(this.worldObj); + int var4 = this.func_90014_a(this, var2); + var3.setFleeceColor(15 - var4); + return var3; + } + ++ /** ++ * This function applies the benefits of growing back wool and faster growing up to the acting entity. (This function ++ * is used in the AIEatGrass) ++ */ + public void eatGrassBonus() { + this.setSheared(false); +- if(this.isChild()) { ++ ++ if (this.isChild()) { + this.addGrowth(60); + } +- +- } +- +- public EntityLivingData onSpawnWithEgg(EntityLivingData var1) { +- var1 = super.onSpawnWithEgg(var1); +- this.setFleeceColor(getRandomFleeceColor(this.worldObj.s)); +- return var1; +- } +- +- private int func_90014_a(EntityAnimal var1, EntityAnimal var2) { +- int var3 = this.func_90013_b(var1); +- int var4 = this.func_90013_b(var2); ++ } ++ ++ public EntityLivingData onSpawnWithEgg(EntityLivingData par1EntityLivingData) { ++ par1EntityLivingData = super.onSpawnWithEgg(par1EntityLivingData); ++ this.setFleeceColor(getRandomFleeceColor(this.worldObj.rand)); ++ return par1EntityLivingData; ++ } ++ ++ private int func_90014_a(EntityAnimal par1EntityAnimal, EntityAnimal par2EntityAnimal) { ++ int var3 = this.func_90013_b(par1EntityAnimal); ++ int var4 = this.func_90013_b(par2EntityAnimal); + this.field_90016_e.getStackInSlot(0).setItemDamage(var3); + this.field_90016_e.getStackInSlot(1).setItemDamage(var4); +- ItemStack var5 = CraftingManager.getInstance().findMatchingRecipe(this.field_90016_e, ((EntitySheep)var1).worldObj); ++ ItemStack var5 = CraftingManager.getInstance().findMatchingRecipe(this.field_90016_e, ((EntitySheep)par1EntityAnimal).worldObj); + int var6; +- if(var5 != null && var5.getItem().itemID == Item.dyePowder.itemID) { ++ ++ if (var5 != null && var5.getItem().itemID == Item.dyePowder.itemID) { + var6 = var5.getItemDamage(); + } else { +- var6 = this.worldObj.s.nextBoolean() ? var3 : var4; ++ var6 = this.worldObj.rand.nextBoolean() ? var3 : var4; + } + + return var6; + } + +- private int func_90013_b(EntityAnimal var1) { +- return 15 - ((EntitySheep)var1).getFleeceColor(); ++ private int func_90013_b(EntityAnimal par1EntityAnimal) { ++ return 15 - ((EntitySheep)par1EntityAnimal).getFleeceColor(); + } + +- public EntityAgeable createChild(EntityAgeable var1) { +- return this.func_90015_b(var1); ++ public EntityAgeable createChild(EntityAgeable par1EntityAgeable) { ++ return this.func_90015_b(par1EntityAgeable); + } + } diff --git a/patches/net/minecraft/src/EntitySilverfish.java.patch b/patches/net/minecraft/src/EntitySilverfish.java.patch new file mode 100644 index 0000000..67bfcfd --- /dev/null +++ b/patches/net/minecraft/src/EntitySilverfish.java.patch @@ -0,0 +1,242 @@ +--- net/minecraft/src/EntitySilverfish.java ++++ net/minecraft/src/EntitySilverfish.java +@@ -1,69 +1,104 @@ + package net.minecraft.src; + + public class EntitySilverfish extends EntityMob { ++ ++ /** ++ * A cooldown before this entity will search for another Silverfish to join them in battle. ++ */ + private int allySummonCooldown; + +- public EntitySilverfish(World var1) { +- super(var1); ++ public EntitySilverfish(World par1World) { ++ super(par1World); + this.setSize(0.3F, 0.7F); + } + + protected void applyEntityAttributes() { + super.applyEntityAttributes(); + this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setAttribute(8.0D); +- this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setAttribute((double)0.6F); ++ this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setAttribute(0.6000000238418579D); + this.getEntityAttribute(SharedMonsterAttributes.attackDamage).setAttribute(1.0D); + } + ++ /** ++ * returns if this entity triggers Block.onEntityWalking on the blocks they walk on. used for spiders and wolves to ++ * prevent them from trampling crops ++ */ + protected boolean canTriggerWalking() { + return false; + } + ++ /** ++ * Finds the closest player within 16 blocks to attack, or null if this Entity isn't interested in attacking (Animals, ++ * Spiders at day, peaceful PigZombies). ++ */ + protected Entity findPlayerToAttack() { + double var1 = 8.0D; + return this.worldObj.getClosestVulnerablePlayerToEntity(this, var1); + } + ++ /** ++ * Returns the sound this mob makes while it's alive. ++ */ + protected String getLivingSound() { + return "mob.silverfish.say"; + } + ++ /** ++ * Returns the sound this mob makes when it is hurt. ++ */ + protected String getHurtSound() { + return "mob.silverfish.hit"; + } + ++ /** ++ * Returns the sound this mob makes on death. ++ */ + protected String getDeathSound() { + return "mob.silverfish.kill"; + } + +- public boolean attackEntityFrom(DamageSource var1, float var2) { +- if(this.isEntityInvulnerable()) { ++ /** ++ * Called when the entity is attacked. ++ */ ++ public boolean attackEntityFrom(DamageSource par1DamageSource, float par2) { ++ if (this.isEntityInvulnerable()) { + return false; + } else { +- if(this.allySummonCooldown <= 0 && (var1 instanceof EntityDamageSource || var1 == DamageSource.magic)) { ++ if (this.allySummonCooldown <= 0 && (par1DamageSource instanceof EntityDamageSource || par1DamageSource == DamageSource.magic)) { + this.allySummonCooldown = 20; + } + +- return super.attackEntityFrom(var1, var2); ++ return super.attackEntityFrom(par1DamageSource, par2); + } + } + +- protected void attackEntity(Entity var1, float var2) { +- if(this.attackTime <= 0 && var2 < 1.2F && var1.boundingBox.maxY > this.boundingBox.minY && var1.boundingBox.minY < this.boundingBox.maxY) { ++ /** ++ * Basic mob attack. Default to touch of death in EntityCreature. Overridden by each mob to define their attack. ++ */ ++ protected void attackEntity(Entity par1Entity, float par2) { ++ if (this.attackTime <= 0 && par2 < 1.2F && par1Entity.boundingBox.maxY > this.boundingBox.minY && par1Entity.boundingBox.minY < this.boundingBox.maxY) { + this.attackTime = 20; +- this.attackEntityAsMob(var1); ++ this.attackEntityAsMob(par1Entity); + } +- + } + +- protected void playStepSound(int var1, int var2, int var3, int var4) { ++ /** ++ * Plays step sound at given x, y, z for the entity ++ */ ++ protected void playStepSound(int par1, int par2, int par3, int par4) { + this.playSound("mob.silverfish.step", 0.15F, 1.0F); + } + ++ /** ++ * Returns the item ID for the item the mob drops on death. ++ */ + protected int getDropItemId() { + return 0; + } + ++ /** ++ * Called to update the entity's position/logic. ++ */ + public void onUpdate() { + this.renderYawOffset = this.rotationYaw; + super.onUpdate(); +@@ -71,32 +106,37 @@ + + protected void updateEntityActionState() { + super.updateEntityActionState(); +- if(!this.worldObj.isRemote) { ++ ++ if (!this.worldObj.isRemote) { + int var1; + int var2; + int var3; + int var5; +- if(this.allySummonCooldown > 0) { ++ ++ if (this.allySummonCooldown > 0) { + --this.allySummonCooldown; +- if(this.allySummonCooldown == 0) { ++ ++ if (this.allySummonCooldown == 0) { + var1 = MathHelper.floor_double(this.posX); + var2 = MathHelper.floor_double(this.posY); + var3 = MathHelper.floor_double(this.posZ); + boolean var4 = false; + +- for(var5 = 0; !var4 && var5 <= 5 && var5 >= -5; var5 = var5 <= 0 ? 1 - var5 : 0 - var5) { +- for(int var6 = 0; !var4 && var6 <= 10 && var6 >= -10; var6 = var6 <= 0 ? 1 - var6 : 0 - var6) { +- for(int var7 = 0; !var4 && var7 <= 10 && var7 >= -10; var7 = var7 <= 0 ? 1 - var7 : 0 - var7) { ++ for (var5 = 0; !var4 && var5 <= 5 && var5 >= -5; var5 = var5 <= 0 ? 1 - var5 : 0 - var5) { ++ for (int var6 = 0; !var4 && var6 <= 10 && var6 >= -10; var6 = var6 <= 0 ? 1 - var6 : 0 - var6) { ++ for (int var7 = 0; !var4 && var7 <= 10 && var7 >= -10; var7 = var7 <= 0 ? 1 - var7 : 0 - var7) { + int var8 = this.worldObj.getBlockId(var1 + var6, var2 + var5, var3 + var7); +- if(var8 == Block.silverfish.blockID) { +- if(!this.worldObj.getGameRules().getGameRuleBooleanValue("mobGriefing")) { ++ ++ if (var8 == Block.silverfish.blockID) { ++ if (!this.worldObj.getGameRules().getGameRuleBooleanValue("mobGriefing")) { + int var9 = this.worldObj.getBlockMetadata(var1 + var6, var2 + var5, var3 + var7); + Block var10 = Block.stone; +- if(var9 == 1) { ++ ++ if (var9 == 1) { + var10 = Block.cobblestone; + } + +- if(var9 == 2) { ++ if (var9 == 2) { + var10 = Block.stoneBrick; + } + +@@ -106,7 +146,8 @@ + } + + Block.silverfish.onBlockDestroyedByPlayer(this.worldObj, var1 + var6, var2 + var5, var3 + var7, 0); +- if(this.ab.nextBoolean()) { ++ ++ if (this.rand.nextBoolean()) { + var4 = true; + break; + } +@@ -117,36 +158,46 @@ + } + } + +- if(this.entityToAttack == null && !this.hasPath()) { ++ if (this.entityToAttack == null && !this.hasPath()) { + var1 = MathHelper.floor_double(this.posX); + var2 = MathHelper.floor_double(this.posY + 0.5D); + var3 = MathHelper.floor_double(this.posZ); +- int var11 = this.ab.nextInt(6); ++ int var11 = this.rand.nextInt(6); + var5 = this.worldObj.getBlockId(var1 + Facing.offsetsXForSide[var11], var2 + Facing.offsetsYForSide[var11], var3 + Facing.offsetsZForSide[var11]); +- if(BlockSilverfish.getPosingIdByMetadata(var5)) { ++ ++ if (BlockSilverfish.getPosingIdByMetadata(var5)) { + this.worldObj.setBlock(var1 + Facing.offsetsXForSide[var11], var2 + Facing.offsetsYForSide[var11], var3 + Facing.offsetsZForSide[var11], Block.silverfish.blockID, BlockSilverfish.getMetadataForBlockType(var5), 3); + this.spawnExplosionParticle(); + this.setDead(); + } else { + this.updateWanderPath(); + } +- } else if(this.entityToAttack != null && !this.hasPath()) { ++ } else if (this.entityToAttack != null && !this.hasPath()) { + this.entityToAttack = null; + } +- + } + } + +- public float getBlockPathWeight(int var1, int var2, int var3) { +- return this.worldObj.getBlockId(var1, var2 - 1, var3) == Block.stone.blockID ? 10.0F : super.getBlockPathWeight(var1, var2, var3); ++ /** ++ * Takes a coordinate in and returns a weight to determine how likely this creature will try to path to the block. ++ * Args: x, y, z ++ */ ++ public float getBlockPathWeight(int par1, int par2, int par3) { ++ return this.worldObj.getBlockId(par1, par2 - 1, par3) == Block.stone.blockID ? 10.0F : super.getBlockPathWeight(par1, par2, par3); + } + ++ /** ++ * Checks to make sure the light is not too bright where the mob is spawning ++ */ + protected boolean isValidLightLevel() { + return true; + } + ++ /** ++ * Checks if the entity's current position is a valid location to spawn this entity. ++ */ + public boolean getCanSpawnHere() { +- if(super.getCanSpawnHere()) { ++ if (super.getCanSpawnHere()) { + EntityPlayer var1 = this.worldObj.getClosestPlayerToEntity(this, 5.0D); + return var1 == null; + } else { +@@ -154,6 +205,9 @@ + } + } + ++ /** ++ * Get this Entity's EnumCreatureAttribute ++ */ + public EnumCreatureAttribute getCreatureAttribute() { + return EnumCreatureAttribute.ARTHROPOD; + } diff --git a/patches/net/minecraft/src/EntitySkeleton.java.patch b/patches/net/minecraft/src/EntitySkeleton.java.patch new file mode 100644 index 0000000..5e0b823 --- /dev/null +++ b/patches/net/minecraft/src/EntitySkeleton.java.patch @@ -0,0 +1,391 @@ +--- net/minecraft/src/EntitySkeleton.java ++++ net/minecraft/src/EntitySkeleton.java +@@ -6,8 +6,8 @@ + private EntityAIArrowAttack aiArrowAttack = new EntityAIArrowAttack(this, 1.0D, 20, 60, 15.0F); + private EntityAIAttackOnCollide aiAttackOnCollide = new EntityAIAttackOnCollide(this, EntityPlayer.class, 1.2D, false); + +- public EntitySkeleton(World var1) { +- super(var1); ++ public EntitySkeleton(World par1World) { ++ super(par1World); + this.tasks.addTask(1, new EntityAISwimming(this)); + this.tasks.addTask(2, new EntityAIRestrictSun(this)); + this.tasks.addTask(3, new EntityAIFleeSun(this, 1.0D)); +@@ -16,10 +16,10 @@ + this.tasks.addTask(6, new EntityAILookIdle(this)); + this.targetTasks.addTask(1, new EntityAIHurtByTarget(this, false)); + this.targetTasks.addTask(2, new EntityAINearestAttackableTarget(this, EntityPlayer.class, 0, true)); +- if(var1 != null && !var1.isRemote) { ++ ++ if (par1World != null && !par1World.isRemote) { + this.setCombatTask(); + } +- + } + + protected void applyEntityAttributes() { +@@ -32,30 +32,45 @@ + this.dataWatcher.addObject(13, new Byte((byte)0)); + } + ++ /** ++ * Returns true if the newer Entity AI code should be run ++ */ + public boolean isAIEnabled() { + return true; + } + ++ /** ++ * Returns the sound this mob makes while it's alive. ++ */ + protected String getLivingSound() { + return "mob.skeleton.say"; + } + ++ /** ++ * Returns the sound this mob makes when it is hurt. ++ */ + protected String getHurtSound() { + return "mob.skeleton.hurt"; + } + ++ /** ++ * Returns the sound this mob makes on death. ++ */ + protected String getDeathSound() { + return "mob.skeleton.death"; + } + +- protected void playStepSound(int var1, int var2, int var3, int var4) { ++ /** ++ * Plays step sound at given x, y, z for the entity ++ */ ++ protected void playStepSound(int par1, int par2, int par3, int par4) { + this.playSound("mob.skeleton.step", 0.15F, 1.0F); + } + +- public boolean attackEntityAsMob(Entity var1) { +- if(super.attackEntityAsMob(var1)) { +- if(this.getSkeletonType() == 1 && var1 instanceof EntityLivingBase) { +- ((EntityLivingBase)var1).addPotionEffect(new PotionEffect(Potion.wither.id, 200)); ++ public boolean attackEntityAsMob(Entity par1Entity) { ++ if (super.attackEntityAsMob(par1Entity)) { ++ if (this.getSkeletonType() == 1 && par1Entity instanceof EntityLivingBase) { ++ ((EntityLivingBase)par1Entity).addPotionEffect(new PotionEffect(Potion.wither.id, 200)); + } + + return true; +@@ -64,20 +79,30 @@ + } + } + ++ /** ++ * Get this Entity's EnumCreatureAttribute ++ */ + public EnumCreatureAttribute getCreatureAttribute() { + return EnumCreatureAttribute.UNDEAD; + } + ++ /** ++ * Called frequently so the entity can update its state every tick as required. For example, zombies and skeletons use ++ * this to react to sunlight and start to burn. ++ */ + public void onLivingUpdate() { +- if(this.worldObj.isDaytime() && !this.worldObj.isRemote) { ++ if (this.worldObj.isDaytime() && !this.worldObj.isRemote) { + float var1 = this.getBrightness(1.0F); +- if(var1 > 0.5F && this.ab.nextFloat() * 30.0F < (var1 - 0.4F) * 2.0F && this.worldObj.canBlockSeeTheSky(MathHelper.floor_double(this.posX), MathHelper.floor_double(this.posY), MathHelper.floor_double(this.posZ))) { ++ ++ if (var1 > 0.5F && this.rand.nextFloat() * 30.0F < (var1 - 0.4F) * 2.0F && this.worldObj.canBlockSeeTheSky(MathHelper.floor_double(this.posX), MathHelper.floor_double(this.posY), MathHelper.floor_double(this.posZ))) { + boolean var2 = true; +- ItemStack var3 = this.getEquipmentInSlot(4); +- if(var3 != null) { +- if(var3.isItemStackDamageable()) { +- var3.setItemDamage(var3.getItemDamageForDisplay() + this.ab.nextInt(2)); +- if(var3.getItemDamageForDisplay() >= var3.getMaxDamage()) { ++ ItemStack var3 = this.getCurrentItemOrArmor(4); ++ ++ if (var3 != null) { ++ if (var3.isItemStackDamageable()) { ++ var3.setItemDamage(var3.getItemDamageForDisplay() + this.rand.nextInt(2)); ++ ++ if (var3.getItemDamageForDisplay() >= var3.getMaxDamage()) { + this.renderBrokenItemStack(var3); + this.setCurrentItemOrArmor(4, (ItemStack)null); + } +@@ -86,85 +111,102 @@ + var2 = false; + } + +- if(var2) { ++ if (var2) { + this.setFire(8); + } + } + } + +- if(this.worldObj.isRemote && this.getSkeletonType() == 1) { ++ if (this.worldObj.isRemote && this.getSkeletonType() == 1) { + this.setSize(0.72F, 2.34F); + } + + super.onLivingUpdate(); + } + ++ /** ++ * Handles updating while being ridden by an entity ++ */ + public void updateRidden() { + super.updateRidden(); +- if(this.ridingEntity instanceof EntityCreature) { ++ ++ if (this.ridingEntity instanceof EntityCreature) { + EntityCreature var1 = (EntityCreature)this.ridingEntity; + this.renderYawOffset = var1.renderYawOffset; + } +- + } + +- public void onDeath(DamageSource var1) { +- super.onDeath(var1); +- if(var1.getSourceOfDamage() instanceof EntityArrow && var1.getEntity() instanceof EntityPlayer) { +- EntityPlayer var2 = (EntityPlayer)var1.getEntity(); ++ /** ++ * Called when the mob's health reaches 0. ++ */ ++ public void onDeath(DamageSource par1DamageSource) { ++ super.onDeath(par1DamageSource); ++ ++ if (par1DamageSource.getSourceOfDamage() instanceof EntityArrow && par1DamageSource.getEntity() instanceof EntityPlayer) { ++ EntityPlayer var2 = (EntityPlayer)par1DamageSource.getEntity(); + double var3 = var2.posX - this.posX; + double var5 = var2.posZ - this.posZ; +- if(var3 * var3 + var5 * var5 >= 2500.0D) { ++ ++ if (var3 * var3 + var5 * var5 >= 2500.0D) { + var2.triggerAchievement(AchievementList.snipeSkeleton); + } + } +- + } + ++ /** ++ * Returns the item ID for the item the mob drops on death. ++ */ + protected int getDropItemId() { + return Item.arrow.itemID; + } + +- protected void dropFewItems(boolean var1, int var2) { ++ /** ++ * Drop 0-2 items of this living's type. @param par1 - Whether this entity has recently been hit by a player. @param ++ * par2 - Level of Looting used to kill this mob. ++ */ ++ protected void dropFewItems(boolean par1, int par2) { + int var3; + int var4; +- if(this.getSkeletonType() == 1) { +- var3 = this.ab.nextInt(3 + var2) - 1; +- +- for(var4 = 0; var4 < var3; ++var4) { ++ ++ if (this.getSkeletonType() == 1) { ++ var3 = this.rand.nextInt(3 + par2) - 1; ++ ++ for (var4 = 0; var4 < var3; ++var4) { + this.dropItem(Item.coal.itemID, 1); + } + } else { +- var3 = this.ab.nextInt(3 + var2); ++ var3 = this.rand.nextInt(3 + par2); + +- for(var4 = 0; var4 < var3; ++var4) { ++ for (var4 = 0; var4 < var3; ++var4) { + this.dropItem(Item.arrow.itemID, 1); + } + } + +- var3 = this.ab.nextInt(3 + var2); ++ var3 = this.rand.nextInt(3 + par2); + +- for(var4 = 0; var4 < var3; ++var4) { ++ for (var4 = 0; var4 < var3; ++var4) { + this.dropItem(Item.bone.itemID, 1); + } +- + } + +- protected void dropRareDrop(int var1) { +- if(this.getSkeletonType() == 1) { ++ protected void dropRareDrop(int par1) { ++ if (this.getSkeletonType() == 1) { + this.entityDropItem(new ItemStack(Item.skull.itemID, 1, 1), 0.0F); + } +- + } + ++ /** ++ * Makes entity wear random armor based on difficulty ++ */ + protected void addRandomArmor() { + super.addRandomArmor(); + this.setCurrentItemOrArmor(0, new ItemStack(Item.bow)); + } + +- public EntityLivingData onSpawnWithEgg(EntityLivingData var1) { +- var1 = super.onSpawnWithEgg(var1); +- if(this.worldObj.provider instanceof WorldProviderHell && this.getRNG().nextInt(5) > 0) { ++ public EntityLivingData onSpawnWithEgg(EntityLivingData par1EntityLivingData) { ++ par1EntityLivingData = super.onSpawnWithEgg(par1EntityLivingData); ++ ++ if (this.worldObj.provider instanceof WorldProviderHell && this.getRNG().nextInt(5) > 0) { + this.tasks.addTask(4, this.aiAttackOnCollide); + this.setSkeletonType(1); + this.setCurrentItemOrArmor(0, new ItemStack(Item.swordStone)); +@@ -175,44 +217,53 @@ + this.enchantEquipment(); + } + +- this.setCanPickUpLoot(this.ab.nextFloat() < 0.55F * this.worldObj.getLocationTensionFactor(this.posX, this.posY, this.posZ)); +- if(this.getEquipmentInSlot(4) == null) { ++ this.setCanPickUpLoot(this.rand.nextFloat() < 0.55F * this.worldObj.getLocationTensionFactor(this.posX, this.posY, this.posZ)); ++ ++ if (this.getCurrentItemOrArmor(4) == null) { + Calendar var2 = this.worldObj.getCurrentDate(); +- if(var2.get(2) + 1 == 10 && var2.get(5) == 31 && this.ab.nextFloat() < 0.25F) { +- this.setCurrentItemOrArmor(4, new ItemStack(this.ab.nextFloat() < 0.1F ? Block.pumpkinLantern : Block.pumpkin)); ++ ++ if (var2.get(2) + 1 == 10 && var2.get(5) == 31 && this.rand.nextFloat() < 0.25F) { ++ this.setCurrentItemOrArmor(4, new ItemStack(this.rand.nextFloat() < 0.1F ? Block.pumpkinLantern : Block.pumpkin)); + this.equipmentDropChances[4] = 0.0F; + } + } + +- return var1; ++ return par1EntityLivingData; + } + ++ /** ++ * sets this entity's combat AI. ++ */ + public void setCombatTask() { + this.tasks.removeTask(this.aiAttackOnCollide); + this.tasks.removeTask(this.aiArrowAttack); + ItemStack var1 = this.getHeldItem(); +- if(var1 != null && var1.itemID == Item.bow.itemID) { ++ ++ if (var1 != null && var1.itemID == Item.bow.itemID) { + this.tasks.addTask(4, this.aiArrowAttack); + } else { + this.tasks.addTask(4, this.aiAttackOnCollide); + } +- + } + +- public void attackEntityWithRangedAttack(EntityLivingBase var1, float var2) { +- EntityArrow var3 = new EntityArrow(this.worldObj, this, var1, 1.6F, (float)(14 - this.worldObj.difficultySetting * 4)); ++ /** ++ * Attack the specified entity using a ranged attack. ++ */ ++ public void attackEntityWithRangedAttack(EntityLivingBase par1EntityLivingBase, float par2) { ++ EntityArrow var3 = new EntityArrow(this.worldObj, this, par1EntityLivingBase, 1.6F, (float)(14 - this.worldObj.difficultySetting * 4)); + int var4 = EnchantmentHelper.getEnchantmentLevel(Enchantment.power.effectId, this.getHeldItem()); + int var5 = EnchantmentHelper.getEnchantmentLevel(Enchantment.punch.effectId, this.getHeldItem()); +- var3.setDamage((double)(var2 * 2.0F) + this.ab.nextGaussian() * 0.25D + (double)((float)this.worldObj.difficultySetting * 0.11F)); +- if(var4 > 0) { ++ var3.setDamage((double)(par2 * 2.0F) + this.rand.nextGaussian() * 0.25D + (double)((float)this.worldObj.difficultySetting * 0.11F)); ++ ++ if (var4 > 0) { + var3.setDamage(var3.getDamage() + (double)var4 * 0.5D + 0.5D); + } + +- if(var5 > 0) { ++ if (var5 > 0) { + var3.setKnockbackStrength(var5); + } + +- if(EnchantmentHelper.getEnchantmentLevel(Enchantment.flame.effectId, this.getHeldItem()) > 0 || this.getSkeletonType() == 1) { ++ if (EnchantmentHelper.getEnchantmentLevel(Enchantment.flame.effectId, this.getHeldItem()) > 0 || this.getSkeletonType() == 1) { + var3.setFire(100); + } + +@@ -220,44 +271,63 @@ + this.worldObj.spawnEntityInWorld(var3); + } + ++ /** ++ * Return this skeleton's type. ++ */ + public int getSkeletonType() { + return this.dataWatcher.getWatchableObjectByte(13); + } + +- public void setSkeletonType(int var1) { +- this.dataWatcher.updateObject(13, Byte.valueOf((byte)var1)); +- this.isImmuneToFire = var1 == 1; +- if(var1 == 1) { ++ /** ++ * Set this skeleton's type. ++ */ ++ public void setSkeletonType(int par1) { ++ this.dataWatcher.updateObject(13, Byte.valueOf((byte)par1)); ++ this.isImmuneToFire = par1 == 1; ++ ++ if (par1 == 1) { + this.setSize(0.72F, 2.34F); + } else { + this.setSize(0.6F, 1.8F); + } +- + } + +- public void readEntityFromNBT(NBTTagCompound var1) { +- super.readEntityFromNBT(var1); +- if(var1.hasKey("SkeletonType")) { +- byte var2 = var1.getByte("SkeletonType"); ++ /** ++ * (abstract) Protected helper method to read subclass entity data from NBT. ++ */ ++ public void readEntityFromNBT(NBTTagCompound par1NBTTagCompound) { ++ super.readEntityFromNBT(par1NBTTagCompound); ++ ++ if (par1NBTTagCompound.hasKey("SkeletonType")) { ++ byte var2 = par1NBTTagCompound.getByte("SkeletonType"); + this.setSkeletonType(var2); + } + + this.setCombatTask(); + } + +- public void writeEntityToNBT(NBTTagCompound var1) { +- super.writeEntityToNBT(var1); +- var1.setByte("SkeletonType", (byte)this.getSkeletonType()); ++ /** ++ * (abstract) Protected helper method to write subclass entity data to NBT. ++ */ ++ public void writeEntityToNBT(NBTTagCompound par1NBTTagCompound) { ++ super.writeEntityToNBT(par1NBTTagCompound); ++ par1NBTTagCompound.setByte("SkeletonType", (byte)this.getSkeletonType()); + } + +- public void setCurrentItemOrArmor(int var1, ItemStack var2) { +- super.setCurrentItemOrArmor(var1, var2); +- if(!this.worldObj.isRemote && var1 == 0) { ++ /** ++ * Sets the held item, or an armor slot. Slot 0 is held item. Slot 1-4 is armor. Params: Item, slot ++ */ ++ public void setCurrentItemOrArmor(int par1, ItemStack par2ItemStack) { ++ super.setCurrentItemOrArmor(par1, par2ItemStack); ++ ++ if (!this.worldObj.isRemote && par1 == 0) { + this.setCombatTask(); + } +- + } + ++ /** ++ * Returns the Y Offset of this entity. ++ */ + public double getYOffset() { + return super.getYOffset() - 0.5D; + } diff --git a/patches/net/minecraft/src/EntitySlime.java.patch b/patches/net/minecraft/src/EntitySlime.java.patch new file mode 100644 index 0000000..a280ef7 --- /dev/null +++ b/patches/net/minecraft/src/EntitySlime.java.patch @@ -0,0 +1,330 @@ +--- net/minecraft/src/EntitySlime.java ++++ net/minecraft/src/EntitySlime.java +@@ -4,13 +4,15 @@ + public float squishAmount; + public float squishFactor; + public float prevSquishFactor; ++ ++ /** the time between each jump of the slime */ + private int slimeJumpDelay; + +- public EntitySlime(World var1) { +- super(var1); +- int var2 = 1 << this.ab.nextInt(3); ++ public EntitySlime(World par1World) { ++ super(par1World); ++ int var2 = 1 << this.rand.nextInt(3); + this.yOffset = 0.0F; +- this.slimeJumpDelay = this.ab.nextInt(20) + 10; ++ this.slimeJumpDelay = this.rand.nextInt(20) + 10; + this.setSlimeSize(var2); + } + +@@ -19,39 +21,57 @@ + this.dataWatcher.addObject(16, new Byte((byte)1)); + } + +- protected void setSlimeSize(int var1) { +- this.dataWatcher.updateObject(16, new Byte((byte)var1)); +- this.setSize(0.6F * (float)var1, 0.6F * (float)var1); ++ protected void setSlimeSize(int par1) { ++ this.dataWatcher.updateObject(16, new Byte((byte)par1)); ++ this.setSize(0.6F * (float)par1, 0.6F * (float)par1); + this.setPosition(this.posX, this.posY, this.posZ); +- this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setAttribute((double)(var1 * var1)); ++ this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setAttribute((double)(par1 * par1)); + this.setHealth(this.getMaxHealth()); +- this.experienceValue = var1; ++ this.experienceValue = par1; + } + ++ /** ++ * Returns the size of the slime. ++ */ + public int getSlimeSize() { + return this.dataWatcher.getWatchableObjectByte(16); + } + +- public void writeEntityToNBT(NBTTagCompound var1) { +- super.writeEntityToNBT(var1); +- var1.setInteger("Size", this.getSlimeSize() - 1); +- } +- +- public void readEntityFromNBT(NBTTagCompound var1) { +- super.readEntityFromNBT(var1); +- this.setSlimeSize(var1.getInteger("Size") + 1); +- } +- ++ /** ++ * (abstract) Protected helper method to write subclass entity data to NBT. ++ */ ++ public void writeEntityToNBT(NBTTagCompound par1NBTTagCompound) { ++ super.writeEntityToNBT(par1NBTTagCompound); ++ par1NBTTagCompound.setInteger("Size", this.getSlimeSize() - 1); ++ } ++ ++ /** ++ * (abstract) Protected helper method to read subclass entity data from NBT. ++ */ ++ public void readEntityFromNBT(NBTTagCompound par1NBTTagCompound) { ++ super.readEntityFromNBT(par1NBTTagCompound); ++ this.setSlimeSize(par1NBTTagCompound.getInteger("Size") + 1); ++ } ++ ++ /** ++ * Returns the name of a particle effect that may be randomly created by EntitySlime.onUpdate() ++ */ + protected String getSlimeParticle() { + return "slime"; + } + ++ /** ++ * Returns the name of the sound played when the slime jumps. ++ */ + protected String getJumpSound() { + return "mob.slime." + (this.getSlimeSize() > 1 ? "big" : "small"); + } + ++ /** ++ * Called to update the entity's position/logic. ++ */ + public void onUpdate() { +- if(!this.worldObj.isRemote && this.worldObj.difficultySetting == 0 && this.getSlimeSize() > 0) { ++ if (!this.worldObj.isRemote && this.worldObj.difficultySetting == 0 && this.getSlimeSize() > 0) { + this.isDead = true; + } + +@@ -60,86 +80,97 @@ + boolean var1 = this.onGround; + super.onUpdate(); + int var2; +- if(this.onGround && !var1) { ++ ++ if (this.onGround && !var1) { + var2 = this.getSlimeSize(); + +- for(int var3 = 0; var3 < var2 * 8; ++var3) { +- float var4 = this.ab.nextFloat() * (float)Math.PI * 2.0F; +- float var5 = this.ab.nextFloat() * 0.5F + 0.5F; ++ for (int var3 = 0; var3 < var2 * 8; ++var3) { ++ float var4 = this.rand.nextFloat() * (float)Math.PI * 2.0F; ++ float var5 = this.rand.nextFloat() * 0.5F + 0.5F; + float var6 = MathHelper.sin(var4) * (float)var2 * 0.5F * var5; + float var7 = MathHelper.cos(var4) * (float)var2 * 0.5F * var5; + this.worldObj.spawnParticle(this.getSlimeParticle(), this.posX + (double)var6, this.boundingBox.minY, this.posZ + (double)var7, 0.0D, 0.0D, 0.0D); + } + +- if(this.makesSoundOnLand()) { +- this.playSound(this.getJumpSound(), this.getSoundVolume(), ((this.ab.nextFloat() - this.ab.nextFloat()) * 0.2F + 1.0F) / 0.8F); ++ if (this.makesSoundOnLand()) { ++ this.playSound(this.getJumpSound(), this.getSoundVolume(), ((this.rand.nextFloat() - this.rand.nextFloat()) * 0.2F + 1.0F) / 0.8F); + } + + this.squishAmount = -0.5F; +- } else if(!this.onGround && var1) { ++ } else if (!this.onGround && var1) { + this.squishAmount = 1.0F; + } + + this.alterSquishAmount(); +- if(this.worldObj.isRemote) { ++ ++ if (this.worldObj.isRemote) { + var2 = this.getSlimeSize(); + this.setSize(0.6F * (float)var2, 0.6F * (float)var2); + } +- + } + + protected void updateEntityActionState() { + this.despawnEntity(); + EntityPlayer var1 = this.worldObj.getClosestVulnerablePlayerToEntity(this, 16.0D); +- if(var1 != null) { ++ ++ if (var1 != null) { + this.faceEntity(var1, 10.0F, 20.0F); + } + +- if(this.onGround && this.slimeJumpDelay-- <= 0) { ++ if (this.onGround && this.slimeJumpDelay-- <= 0) { + this.slimeJumpDelay = this.getJumpDelay(); +- if(var1 != null) { ++ ++ if (var1 != null) { + this.slimeJumpDelay /= 3; + } + + this.isJumping = true; +- if(this.makesSoundOnJump()) { +- this.playSound(this.getJumpSound(), this.getSoundVolume(), ((this.ab.nextFloat() - this.ab.nextFloat()) * 0.2F + 1.0F) * 0.8F); ++ ++ if (this.makesSoundOnJump()) { ++ this.playSound(this.getJumpSound(), this.getSoundVolume(), ((this.rand.nextFloat() - this.rand.nextFloat()) * 0.2F + 1.0F) * 0.8F); + } + +- this.moveStrafing = 1.0F - this.ab.nextFloat() * 2.0F; ++ this.moveStrafing = 1.0F - this.rand.nextFloat() * 2.0F; + this.moveForward = (float)(1 * this.getSlimeSize()); + } else { + this.isJumping = false; +- if(this.onGround) { ++ ++ if (this.onGround) { + this.moveStrafing = this.moveForward = 0.0F; + } + } +- + } + + protected void alterSquishAmount() { + this.squishAmount *= 0.6F; + } + ++ /** ++ * Gets the amount of time the slime needs to wait between jumps. ++ */ + protected int getJumpDelay() { +- return this.ab.nextInt(20) + 10; ++ return this.rand.nextInt(20) + 10; + } + + protected EntitySlime createInstance() { + return new EntitySlime(this.worldObj); + } + ++ /** ++ * Will get destroyed next tick. ++ */ + public void setDead() { + int var1 = this.getSlimeSize(); +- if(!this.worldObj.isRemote && var1 > 1 && this.getHealth() <= 0.0F) { +- int var2 = 2 + this.ab.nextInt(3); +- +- for(int var3 = 0; var3 < var2; ++var3) { ++ ++ if (!this.worldObj.isRemote && var1 > 1 && this.getHealth() <= 0.0F) { ++ int var2 = 2 + this.rand.nextInt(3); ++ ++ for (int var3 = 0; var3 < var2; ++var3) { + float var4 = ((float)(var3 % 2) - 0.5F) * (float)var1 / 4.0F; + float var5 = ((float)(var3 / 2) - 0.5F) * (float)var1 / 4.0F; + EntitySlime var6 = this.createInstance(); + var6.setSlimeSize(var1 / 2); +- var6.setLocationAndAngles(this.posX + (double)var4, this.posY + 0.5D, this.posZ + (double)var5, this.ab.nextFloat() * 360.0F, 0.0F); ++ var6.setLocationAndAngles(this.posX + (double)var4, this.posY + 0.5D, this.posZ + (double)var5, this.rand.nextFloat() * 360.0F, 0.0F); + this.worldObj.spawnEntityInWorld(var6); + } + } +@@ -147,48 +178,71 @@ + super.setDead(); + } + +- public void onCollideWithPlayer(EntityPlayer var1) { +- if(this.canDamagePlayer()) { ++ /** ++ * Called by a player entity when they collide with an entity ++ */ ++ public void onCollideWithPlayer(EntityPlayer par1EntityPlayer) { ++ if (this.canDamagePlayer()) { + int var2 = this.getSlimeSize(); +- if(this.canEntityBeSeen(var1) && this.getDistanceSqToEntity(var1) < 0.6D * (double)var2 * 0.6D * (double)var2 && var1.attackEntityFrom(DamageSource.causeMobDamage(this), (float)this.getAttackStrength())) { +- this.playSound("mob.attack", 1.0F, (this.ab.nextFloat() - this.ab.nextFloat()) * 0.2F + 1.0F); ++ ++ if (this.canEntityBeSeen(par1EntityPlayer) && this.getDistanceSqToEntity(par1EntityPlayer) < 0.6D * (double)var2 * 0.6D * (double)var2 && par1EntityPlayer.attackEntityFrom(DamageSource.causeMobDamage(this), (float)this.getAttackStrength())) { ++ this.playSound("mob.attack", 1.0F, (this.rand.nextFloat() - this.rand.nextFloat()) * 0.2F + 1.0F); + } + } +- + } + ++ /** ++ * Indicates weather the slime is able to damage the player (based upon the slime's size) ++ */ + protected boolean canDamagePlayer() { + return this.getSlimeSize() > 1; + } + ++ /** ++ * Gets the amount of damage dealt to the player when "attacked" by the slime. ++ */ + protected int getAttackStrength() { + return this.getSlimeSize(); + } + ++ /** ++ * Returns the sound this mob makes when it is hurt. ++ */ + protected String getHurtSound() { + return "mob.slime." + (this.getSlimeSize() > 1 ? "big" : "small"); + } + ++ /** ++ * Returns the sound this mob makes on death. ++ */ + protected String getDeathSound() { + return "mob.slime." + (this.getSlimeSize() > 1 ? "big" : "small"); + } + ++ /** ++ * Returns the item ID for the item the mob drops on death. ++ */ + protected int getDropItemId() { + return this.getSlimeSize() == 1 ? Item.slimeBall.itemID : 0; + } + ++ /** ++ * Checks if the entity's current position is a valid location to spawn this entity. ++ */ + public boolean getCanSpawnHere() { + Chunk var1 = this.worldObj.getChunkFromBlockCoords(MathHelper.floor_double(this.posX), MathHelper.floor_double(this.posZ)); +- if(this.worldObj.getWorldInfo().getTerrainType() == WorldType.FLAT && this.ab.nextInt(4) != 1) { ++ ++ if (this.worldObj.getWorldInfo().getTerrainType() == WorldType.FLAT && this.rand.nextInt(4) != 1) { + return false; + } else { +- if(this.getSlimeSize() == 1 || this.worldObj.difficultySetting > 0) { ++ if (this.getSlimeSize() == 1 || this.worldObj.difficultySetting > 0) { + BiomeGenBase var2 = this.worldObj.getBiomeGenForCoords(MathHelper.floor_double(this.posX), MathHelper.floor_double(this.posZ)); +- if(var2 == BiomeGenBase.swampland && this.posY > 50.0D && this.posY < 70.0D && this.ab.nextFloat() < 0.5F && this.ab.nextFloat() < this.worldObj.getCurrentMoonPhaseFactor() && this.worldObj.getBlockLightValue(MathHelper.floor_double(this.posX), MathHelper.floor_double(this.posY), MathHelper.floor_double(this.posZ)) <= this.ab.nextInt(8)) { ++ ++ if (var2 == BiomeGenBase.swampland && this.posY > 50.0D && this.posY < 70.0D && this.rand.nextFloat() < 0.5F && this.rand.nextFloat() < this.worldObj.getCurrentMoonPhaseFactor() && this.worldObj.getBlockLightValue(MathHelper.floor_double(this.posX), MathHelper.floor_double(this.posY), MathHelper.floor_double(this.posZ)) <= this.rand.nextInt(8)) { + return super.getCanSpawnHere(); + } + +- if(this.ab.nextInt(10) == 0 && var1.getRandomWithSeed(987234911L).nextInt(10) == 0 && this.posY < 40.0D) { ++ if (this.rand.nextInt(10) == 0 && var1.getRandomWithSeed(987234911L).nextInt(10) == 0 && this.posY < 40.0D) { + return super.getCanSpawnHere(); + } + } +@@ -197,18 +251,31 @@ + } + } + ++ /** ++ * Returns the volume for the sounds this mob makes. ++ */ + protected float getSoundVolume() { + return 0.4F * (float)this.getSlimeSize(); + } + ++ /** ++ * The speed it takes to move the entityliving's rotationPitch through the faceEntity method. This is only currently ++ * use in wolves. ++ */ + public int getVerticalFaceSpeed() { + return 0; + } + ++ /** ++ * Returns true if the slime makes a sound when it jumps (based upon the slime's size) ++ */ + protected boolean makesSoundOnJump() { + return this.getSlimeSize() > 0; + } + ++ /** ++ * Returns true if the slime makes a sound when it lands after a jump (based upon the slime's size) ++ */ + protected boolean makesSoundOnLand() { + return this.getSlimeSize() > 2; + } diff --git a/patches/net/minecraft/src/EntitySmallFireball.java.patch b/patches/net/minecraft/src/EntitySmallFireball.java.patch new file mode 100644 index 0000000..eae2722 --- /dev/null +++ b/patches/net/minecraft/src/EntitySmallFireball.java.patch @@ -0,0 +1,127 @@ +--- net/minecraft/src/EntitySmallFireball.java ++++ net/minecraft/src/EntitySmallFireball.java +@@ -1,66 +1,80 @@ + package net.minecraft.src; + + public class EntitySmallFireball extends EntityFireball { +- public EntitySmallFireball(World var1) { +- super(var1); +- this.setSize(5.0F / 16.0F, 5.0F / 16.0F); +- } +- +- public EntitySmallFireball(World var1, EntityLivingBase var2, double var3, double var5, double var7) { +- super(var1, var2, var3, var5, var7); +- this.setSize(5.0F / 16.0F, 5.0F / 16.0F); +- } +- +- public EntitySmallFireball(World var1, double var2, double var4, double var6, double var8, double var10, double var12) { +- super(var1, var2, var4, var6, var8, var10, var12); +- this.setSize(5.0F / 16.0F, 5.0F / 16.0F); +- } +- +- protected void onImpact(MovingObjectPosition var1) { +- if(!this.worldObj.isRemote) { +- if(var1.entityHit != null) { +- if(!var1.entityHit.isImmuneToFire() && var1.entityHit.attackEntityFrom(DamageSource.causeFireballDamage(this, this.shootingEntity), 5.0F)) { +- var1.entityHit.setFire(5); ++ public EntitySmallFireball(World par1World) { ++ super(par1World); ++ this.setSize(0.3125F, 0.3125F); ++ } ++ ++ public EntitySmallFireball(World par1World, EntityLivingBase par2EntityLivingBase, double par3, double par5, double par7) { ++ super(par1World, par2EntityLivingBase, par3, par5, par7); ++ this.setSize(0.3125F, 0.3125F); ++ } ++ ++ public EntitySmallFireball(World par1World, double par2, double par4, double par6, double par8, double par10, double par12) { ++ super(par1World, par2, par4, par6, par8, par10, par12); ++ this.setSize(0.3125F, 0.3125F); ++ } ++ ++ /** ++ * Called when this EntityFireball hits a block or entity. ++ */ ++ protected void onImpact(MovingObjectPosition par1MovingObjectPosition) { ++ if (!this.worldObj.isRemote) { ++ if (par1MovingObjectPosition.entityHit != null) { ++ if (!par1MovingObjectPosition.entityHit.isImmuneToFire() && par1MovingObjectPosition.entityHit.attackEntityFrom(DamageSource.causeFireballDamage(this, this.shootingEntity), 5.0F)) { ++ par1MovingObjectPosition.entityHit.setFire(5); + } + } else { +- int var2 = var1.blockX; +- int var3 = var1.blockY; +- int var4 = var1.blockZ; +- switch(var1.sideHit) { +- case 0: +- --var3; +- break; +- case 1: +- ++var3; +- break; +- case 2: +- --var4; +- break; +- case 3: +- ++var4; +- break; +- case 4: +- --var2; +- break; +- case 5: +- ++var2; ++ int var2 = par1MovingObjectPosition.blockX; ++ int var3 = par1MovingObjectPosition.blockY; ++ int var4 = par1MovingObjectPosition.blockZ; ++ ++ switch (par1MovingObjectPosition.sideHit) { ++ case 0: ++ --var3; ++ break; ++ ++ case 1: ++ ++var3; ++ break; ++ ++ case 2: ++ --var4; ++ break; ++ ++ case 3: ++ ++var4; ++ break; ++ ++ case 4: ++ --var2; ++ break; ++ ++ case 5: ++ ++var2; + } + +- if(this.worldObj.isAirBlock(var2, var3, var4)) { ++ if (this.worldObj.isAirBlock(var2, var3, var4)) { + this.worldObj.setBlock(var2, var3, var4, Block.fire.blockID); + } + } + + this.setDead(); + } +- + } + ++ /** ++ * Returns true if other Entities should be prevented from moving through this Entity. ++ */ + public boolean canBeCollidedWith() { + return false; + } + +- public boolean attackEntityFrom(DamageSource var1, float var2) { ++ /** ++ * Called when the entity is attacked. ++ */ ++ public boolean attackEntityFrom(DamageSource par1DamageSource, float par2) { + return false; + } + } diff --git a/patches/net/minecraft/src/EntitySmokeFX.java.patch b/patches/net/minecraft/src/EntitySmokeFX.java.patch new file mode 100644 index 0000000..6ed4de0 --- /dev/null +++ b/patches/net/minecraft/src/EntitySmokeFX.java.patch @@ -0,0 +1,101 @@ +--- net/minecraft/src/EntitySmokeFX.java ++++ net/minecraft/src/EntitySmokeFX.java +@@ -3,64 +3,70 @@ + public class EntitySmokeFX extends EntityFX { + float smokeParticleScale; + +- public EntitySmokeFX(World var1, double var2, double var4, double var6, double var8, double var10, double var12) { +- this(var1, var2, var4, var6, var8, var10, var12, 1.0F); ++ public EntitySmokeFX(World par1World, double par2, double par4, double par6, double par8, double par10, double par12) { ++ this(par1World, par2, par4, par6, par8, par10, par12, 1.0F); + } + +- public EntitySmokeFX(World var1, double var2, double var4, double var6, double var8, double var10, double var12, float var14) { +- super(var1, var2, var4, var6, 0.0D, 0.0D, 0.0D); +- this.motionX *= (double)0.1F; +- this.motionY *= (double)0.1F; +- this.motionZ *= (double)0.1F; +- this.motionX += var8; +- this.motionY += var10; +- this.motionZ += var12; +- this.particleRed = this.particleGreen = this.particleBlue = (float)(Math.random() * (double)0.3F); +- this.particleScale *= 12.0F / 16.0F; +- this.particleScale *= var14; ++ public EntitySmokeFX(World par1World, double par2, double par4, double par6, double par8, double par10, double par12, float par14) { ++ super(par1World, par2, par4, par6, 0.0D, 0.0D, 0.0D); ++ this.motionX *= 0.10000000149011612D; ++ this.motionY *= 0.10000000149011612D; ++ this.motionZ *= 0.10000000149011612D; ++ this.motionX += par8; ++ this.motionY += par10; ++ this.motionZ += par12; ++ this.particleRed = this.particleGreen = this.particleBlue = (float)(Math.random() * 0.30000001192092896D); ++ this.particleScale *= 0.75F; ++ this.particleScale *= par14; + this.smokeParticleScale = this.particleScale; + this.particleMaxAge = (int)(8.0D / (Math.random() * 0.8D + 0.2D)); +- this.particleMaxAge = (int)((float)this.particleMaxAge * var14); ++ this.particleMaxAge = (int)((float)this.particleMaxAge * par14); + this.noClip = false; + } + +- public void renderParticle(Tessellator var1, float var2, float var3, float var4, float var5, float var6, float var7) { +- float var8 = ((float)this.particleAge + var2) / (float)this.particleMaxAge * 32.0F; +- if(var8 < 0.0F) { ++ public void renderParticle(Tessellator par1Tessellator, float par2, float par3, float par4, float par5, float par6, float par7) { ++ float var8 = ((float)this.particleAge + par2) / (float)this.particleMaxAge * 32.0F; ++ ++ if (var8 < 0.0F) { + var8 = 0.0F; + } + +- if(var8 > 1.0F) { ++ if (var8 > 1.0F) { + var8 = 1.0F; + } + + this.particleScale = this.smokeParticleScale * var8; +- super.renderParticle(var1, var2, var3, var4, var5, var6, var7); ++ super.renderParticle(par1Tessellator, par2, par3, par4, par5, par6, par7); + } + ++ /** ++ * Called to update the entity's position/logic. ++ */ + public void onUpdate() { + this.prevPosX = this.posX; + this.prevPosY = this.posY; + this.prevPosZ = this.posZ; +- if(this.particleAge++ >= this.particleMaxAge) { ++ ++ if (this.particleAge++ >= this.particleMaxAge) { + this.setDead(); + } + + this.setParticleTextureIndex(7 - this.particleAge * 8 / this.particleMaxAge); + this.motionY += 0.004D; + this.moveEntity(this.motionX, this.motionY, this.motionZ); +- if(this.posY == this.prevPosY) { ++ ++ if (this.posY == this.prevPosY) { + this.motionX *= 1.1D; + this.motionZ *= 1.1D; + } + +- this.motionX *= (double)0.96F; +- this.motionY *= (double)0.96F; +- this.motionZ *= (double)0.96F; +- if(this.onGround) { +- this.motionX *= (double)0.7F; +- this.motionZ *= (double)0.7F; +- } ++ this.motionX *= 0.9599999785423279D; ++ this.motionY *= 0.9599999785423279D; ++ this.motionZ *= 0.9599999785423279D; + ++ if (this.onGround) { ++ this.motionX *= 0.699999988079071D; ++ this.motionZ *= 0.699999988079071D; ++ } + } + } diff --git a/patches/net/minecraft/src/EntitySnowShovelFX.java.patch b/patches/net/minecraft/src/EntitySnowShovelFX.java.patch new file mode 100644 index 0000000..e2fecd8 --- /dev/null +++ b/patches/net/minecraft/src/EntitySnowShovelFX.java.patch @@ -0,0 +1,94 @@ +--- net/minecraft/src/EntitySnowShovelFX.java ++++ net/minecraft/src/EntitySnowShovelFX.java +@@ -3,59 +3,64 @@ + public class EntitySnowShovelFX extends EntityFX { + float snowDigParticleScale; + +- public EntitySnowShovelFX(World var1, double var2, double var4, double var6, double var8, double var10, double var12) { +- this(var1, var2, var4, var6, var8, var10, var12, 1.0F); ++ public EntitySnowShovelFX(World par1World, double par2, double par4, double par6, double par8, double par10, double par12) { ++ this(par1World, par2, par4, par6, par8, par10, par12, 1.0F); + } + +- public EntitySnowShovelFX(World var1, double var2, double var4, double var6, double var8, double var10, double var12, float var14) { +- super(var1, var2, var4, var6, var8, var10, var12); +- this.motionX *= (double)0.1F; +- this.motionY *= (double)0.1F; +- this.motionZ *= (double)0.1F; +- this.motionX += var8; +- this.motionY += var10; +- this.motionZ += var12; +- this.particleRed = this.particleGreen = this.particleBlue = 1.0F - (float)(Math.random() * (double)0.3F); +- this.particleScale *= 12.0F / 16.0F; +- this.particleScale *= var14; ++ public EntitySnowShovelFX(World par1World, double par2, double par4, double par6, double par8, double par10, double par12, float par14) { ++ super(par1World, par2, par4, par6, par8, par10, par12); ++ this.motionX *= 0.10000000149011612D; ++ this.motionY *= 0.10000000149011612D; ++ this.motionZ *= 0.10000000149011612D; ++ this.motionX += par8; ++ this.motionY += par10; ++ this.motionZ += par12; ++ this.particleRed = this.particleGreen = this.particleBlue = 1.0F - (float)(Math.random() * 0.30000001192092896D); ++ this.particleScale *= 0.75F; ++ this.particleScale *= par14; + this.snowDigParticleScale = this.particleScale; + this.particleMaxAge = (int)(8.0D / (Math.random() * 0.8D + 0.2D)); +- this.particleMaxAge = (int)((float)this.particleMaxAge * var14); ++ this.particleMaxAge = (int)((float)this.particleMaxAge * par14); + this.noClip = false; + } + +- public void renderParticle(Tessellator var1, float var2, float var3, float var4, float var5, float var6, float var7) { +- float var8 = ((float)this.particleAge + var2) / (float)this.particleMaxAge * 32.0F; +- if(var8 < 0.0F) { ++ public void renderParticle(Tessellator par1Tessellator, float par2, float par3, float par4, float par5, float par6, float par7) { ++ float var8 = ((float)this.particleAge + par2) / (float)this.particleMaxAge * 32.0F; ++ ++ if (var8 < 0.0F) { + var8 = 0.0F; + } + +- if(var8 > 1.0F) { ++ if (var8 > 1.0F) { + var8 = 1.0F; + } + + this.particleScale = this.snowDigParticleScale * var8; +- super.renderParticle(var1, var2, var3, var4, var5, var6, var7); ++ super.renderParticle(par1Tessellator, par2, par3, par4, par5, par6, par7); + } + ++ /** ++ * Called to update the entity's position/logic. ++ */ + public void onUpdate() { + this.prevPosX = this.posX; + this.prevPosY = this.posY; + this.prevPosZ = this.posZ; +- if(this.particleAge++ >= this.particleMaxAge) { ++ ++ if (this.particleAge++ >= this.particleMaxAge) { + this.setDead(); + } + + this.setParticleTextureIndex(7 - this.particleAge * 8 / this.particleMaxAge); + this.motionY -= 0.03D; + this.moveEntity(this.motionX, this.motionY, this.motionZ); +- this.motionX *= (double)0.99F; +- this.motionY *= (double)0.99F; +- this.motionZ *= (double)0.99F; +- if(this.onGround) { +- this.motionX *= (double)0.7F; +- this.motionZ *= (double)0.7F; +- } ++ this.motionX *= 0.9900000095367432D; ++ this.motionY *= 0.9900000095367432D; ++ this.motionZ *= 0.9900000095367432D; + ++ if (this.onGround) { ++ this.motionX *= 0.699999988079071D; ++ this.motionZ *= 0.699999988079071D; ++ } + } + } diff --git a/patches/net/minecraft/src/EntitySnowball.java.patch b/patches/net/minecraft/src/EntitySnowball.java.patch new file mode 100644 index 0000000..1abc327 --- /dev/null +++ b/patches/net/minecraft/src/EntitySnowball.java.patch @@ -0,0 +1,60 @@ +--- net/minecraft/src/EntitySnowball.java ++++ net/minecraft/src/EntitySnowball.java +@@ -1,35 +1,38 @@ + package net.minecraft.src; + + public class EntitySnowball extends EntityThrowable { +- public EntitySnowball(World var1) { +- super(var1); +- } +- +- public EntitySnowball(World var1, EntityLivingBase var2) { +- super(var1, var2); +- } +- +- public EntitySnowball(World var1, double var2, double var4, double var6) { +- super(var1, var2, var4, var6); +- } +- +- protected void onImpact(MovingObjectPosition var1) { +- if(var1.entityHit != null) { ++ public EntitySnowball(World par1World) { ++ super(par1World); ++ } ++ ++ public EntitySnowball(World par1World, EntityLivingBase par2EntityLivingBase) { ++ super(par1World, par2EntityLivingBase); ++ } ++ ++ public EntitySnowball(World par1World, double par2, double par4, double par6) { ++ super(par1World, par2, par4, par6); ++ } ++ ++ /** ++ * Called when this EntityThrowable hits a block or entity. ++ */ ++ protected void onImpact(MovingObjectPosition par1MovingObjectPosition) { ++ if (par1MovingObjectPosition.entityHit != null) { + byte var2 = 0; +- if(var1.entityHit instanceof EntityBlaze) { ++ ++ if (par1MovingObjectPosition.entityHit instanceof EntityBlaze) { + var2 = 3; + } + +- var1.entityHit.attackEntityFrom(DamageSource.causeThrownDamage(this, this.getThrower()), (float)var2); ++ par1MovingObjectPosition.entityHit.attackEntityFrom(DamageSource.causeThrownDamage(this, this.getThrower()), (float)var2); + } + +- for(int var3 = 0; var3 < 8; ++var3) { ++ for (int var3 = 0; var3 < 8; ++var3) { + this.worldObj.spawnParticle("snowballpoof", this.posX, this.posY, this.posZ, 0.0D, 0.0D, 0.0D); + } + +- if(!this.worldObj.isRemote) { ++ if (!this.worldObj.isRemote) { + this.setDead(); + } +- + } + } diff --git a/patches/net/minecraft/src/EntitySnowman.java.patch b/patches/net/minecraft/src/EntitySnowman.java.patch new file mode 100644 index 0000000..46401cd --- /dev/null +++ b/patches/net/minecraft/src/EntitySnowman.java.patch @@ -0,0 +1,103 @@ +--- net/minecraft/src/EntitySnowman.java ++++ net/minecraft/src/EntitySnowman.java +@@ -1,8 +1,8 @@ + package net.minecraft.src; + + public class EntitySnowman extends EntityGolem implements IRangedAttackMob { +- public EntitySnowman(World var1) { +- super(var1); ++ public EntitySnowman(World par1World) { ++ super(par1World); + this.setSize(0.4F, 1.8F); + this.getNavigator().setAvoidsWater(true); + this.tasks.addTask(1, new EntityAIArrowAttack(this, 1.25D, 20, 10.0F)); +@@ -12,6 +12,9 @@ + this.targetTasks.addTask(1, new EntityAINearestAttackableTarget(this, EntityLiving.class, 0, true, false, IMob.mobSelector)); + } + ++ /** ++ * Returns true if the newer Entity AI code should be run ++ */ + public boolean isAIEnabled() { + return true; + } +@@ -19,50 +22,65 @@ + protected void applyEntityAttributes() { + super.applyEntityAttributes(); + this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setAttribute(4.0D); +- this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setAttribute((double)0.2F); ++ this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setAttribute(0.20000000298023224D); + } + ++ /** ++ * Called frequently so the entity can update its state every tick as required. For example, zombies and skeletons use ++ * this to react to sunlight and start to burn. ++ */ + public void onLivingUpdate() { + super.onLivingUpdate(); +- if(this.isWet()) { ++ ++ if (this.isWet()) { + this.attackEntityFrom(DamageSource.drown, 1.0F); + } + + int var1 = MathHelper.floor_double(this.posX); + int var2 = MathHelper.floor_double(this.posZ); +- if(this.worldObj.getBiomeGenForCoords(var1, var2).getFloatTemperature() > 1.0F) { ++ ++ if (this.worldObj.getBiomeGenForCoords(var1, var2).getFloatTemperature() > 1.0F) { + this.attackEntityFrom(DamageSource.onFire, 1.0F); + } + +- for(var1 = 0; var1 < 4; ++var1) { ++ for (var1 = 0; var1 < 4; ++var1) { + var2 = MathHelper.floor_double(this.posX + (double)((float)(var1 % 2 * 2 - 1) * 0.25F)); + int var3 = MathHelper.floor_double(this.posY); + int var4 = MathHelper.floor_double(this.posZ + (double)((float)(var1 / 2 % 2 * 2 - 1) * 0.25F)); +- if(this.worldObj.getBlockId(var2, var3, var4) == 0 && this.worldObj.getBiomeGenForCoords(var2, var4).getFloatTemperature() < 0.8F && Block.snow.canPlaceBlockAt(this.worldObj, var2, var3, var4)) { ++ ++ if (this.worldObj.getBlockId(var2, var3, var4) == 0 && this.worldObj.getBiomeGenForCoords(var2, var4).getFloatTemperature() < 0.8F && Block.snow.canPlaceBlockAt(this.worldObj, var2, var3, var4)) { + this.worldObj.setBlock(var2, var3, var4, Block.snow.blockID); + } + } +- + } + ++ /** ++ * Returns the item ID for the item the mob drops on death. ++ */ + protected int getDropItemId() { + return Item.snowball.itemID; + } + +- protected void dropFewItems(boolean var1, int var2) { +- int var3 = this.ab.nextInt(16); ++ /** ++ * Drop 0-2 items of this living's type. @param par1 - Whether this entity has recently been hit by a player. @param ++ * par2 - Level of Looting used to kill this mob. ++ */ ++ protected void dropFewItems(boolean par1, int par2) { ++ int var3 = this.rand.nextInt(16); + +- for(int var4 = 0; var4 < var3; ++var4) { ++ for (int var4 = 0; var4 < var3; ++var4) { + this.dropItem(Item.snowball.itemID, 1); + } +- + } + +- public void attackEntityWithRangedAttack(EntityLivingBase var1, float var2) { ++ /** ++ * Attack the specified entity using a ranged attack. ++ */ ++ public void attackEntityWithRangedAttack(EntityLivingBase par1EntityLivingBase, float par2) { + EntitySnowball var3 = new EntitySnowball(this.worldObj, this); +- double var4 = var1.posX - this.posX; +- double var6 = var1.posY + (double)var1.getEyeHeight() - (double)1.1F - var3.posY; +- double var8 = var1.posZ - this.posZ; ++ double var4 = par1EntityLivingBase.posX - this.posX; ++ double var6 = par1EntityLivingBase.posY + (double)par1EntityLivingBase.getEyeHeight() - 1.100000023841858D - var3.posY; ++ double var8 = par1EntityLivingBase.posZ - this.posZ; + float var10 = MathHelper.sqrt_double(var4 * var4 + var8 * var8) * 0.2F; + var3.setThrowableHeading(var4, var6 + (double)var10, var8, 1.6F, 12.0F); + this.playSound("random.bow", 1.0F, 1.0F / (this.getRNG().nextFloat() * 0.4F + 0.8F)); diff --git a/patches/net/minecraft/src/EntitySorter.java.patch b/patches/net/minecraft/src/EntitySorter.java.patch new file mode 100644 index 0000000..2639fc1 --- /dev/null +++ b/patches/net/minecraft/src/EntitySorter.java.patch @@ -0,0 +1,52 @@ +--- net/minecraft/src/EntitySorter.java ++++ net/minecraft/src/EntitySorter.java +@@ -3,27 +3,36 @@ + import java.util.Comparator; + + public class EntitySorter implements Comparator { ++ ++ /** Entity position X */ + private double entityPosX; ++ ++ /** Entity position Y */ + private double entityPosY; ++ ++ /** Entity position Z */ + private double entityPosZ; + +- public EntitySorter(Entity var1) { +- this.entityPosX = -var1.posX; +- this.entityPosY = -var1.posY; +- this.entityPosZ = -var1.posZ; ++ public EntitySorter(Entity par1Entity) { ++ this.entityPosX = -par1Entity.posX; ++ this.entityPosY = -par1Entity.posY; ++ this.entityPosZ = -par1Entity.posZ; + } + +- public int sortByDistanceToEntity(WorldRenderer var1, WorldRenderer var2) { +- double var3 = (double)var1.posXPlus + this.entityPosX; +- double var5 = (double)var1.posYPlus + this.entityPosY; +- double var7 = (double)var1.posZPlus + this.entityPosZ; +- double var9 = (double)var2.posXPlus + this.entityPosX; +- double var11 = (double)var2.posYPlus + this.entityPosY; +- double var13 = (double)var2.posZPlus + this.entityPosZ; ++ /** ++ * Sorts the two world renderers according to their distance to a given entity. ++ */ ++ public int sortByDistanceToEntity(WorldRenderer par1WorldRenderer, WorldRenderer par2WorldRenderer) { ++ double var3 = (double)par1WorldRenderer.posXPlus + this.entityPosX; ++ double var5 = (double)par1WorldRenderer.posYPlus + this.entityPosY; ++ double var7 = (double)par1WorldRenderer.posZPlus + this.entityPosZ; ++ double var9 = (double)par2WorldRenderer.posXPlus + this.entityPosX; ++ double var11 = (double)par2WorldRenderer.posYPlus + this.entityPosY; ++ double var13 = (double)par2WorldRenderer.posZPlus + this.entityPosZ; + return (int)((var3 * var3 + var5 * var5 + var7 * var7 - (var9 * var9 + var11 * var11 + var13 * var13)) * 1024.0D); + } + +- public int compare(Object var1, Object var2) { +- return this.sortByDistanceToEntity((WorldRenderer)var1, (WorldRenderer)var2); ++ public int compare(Object par1Obj, Object par2Obj) { ++ return this.sortByDistanceToEntity((WorldRenderer)par1Obj, (WorldRenderer)par2Obj); + } + } diff --git a/patches/net/minecraft/src/EntitySpellParticleFX.java.patch b/patches/net/minecraft/src/EntitySpellParticleFX.java.patch new file mode 100644 index 0000000..f95ffb8 --- /dev/null +++ b/patches/net/minecraft/src/EntitySpellParticleFX.java.patch @@ -0,0 +1,99 @@ +--- net/minecraft/src/EntitySpellParticleFX.java ++++ net/minecraft/src/EntitySpellParticleFX.java +@@ -1,61 +1,73 @@ + package net.minecraft.src; + + public class EntitySpellParticleFX extends EntityFX { ++ ++ /** Base spell texture index */ + private int baseSpellTextureIndex = 128; + +- public EntitySpellParticleFX(World var1, double var2, double var4, double var6, double var8, double var10, double var12) { +- super(var1, var2, var4, var6, var8, var10, var12); +- this.motionY *= (double)0.2F; +- if(var8 == 0.0D && var12 == 0.0D) { +- this.motionX *= (double)0.1F; +- this.motionZ *= (double)0.1F; ++ public EntitySpellParticleFX(World par1World, double par2, double par4, double par6, double par8, double par10, double par12) { ++ super(par1World, par2, par4, par6, par8, par10, par12); ++ this.motionY *= 0.20000000298023224D; ++ ++ if (par8 == 0.0D && par12 == 0.0D) { ++ this.motionX *= 0.10000000149011612D; ++ this.motionZ *= 0.10000000149011612D; + } + +- this.particleScale *= 12.0F / 16.0F; ++ this.particleScale *= 0.75F; + this.particleMaxAge = (int)(8.0D / (Math.random() * 0.8D + 0.2D)); + this.noClip = false; + } + +- public void renderParticle(Tessellator var1, float var2, float var3, float var4, float var5, float var6, float var7) { +- float var8 = ((float)this.particleAge + var2) / (float)this.particleMaxAge * 32.0F; +- if(var8 < 0.0F) { ++ public void renderParticle(Tessellator par1Tessellator, float par2, float par3, float par4, float par5, float par6, float par7) { ++ float var8 = ((float)this.particleAge + par2) / (float)this.particleMaxAge * 32.0F; ++ ++ if (var8 < 0.0F) { + var8 = 0.0F; + } + +- if(var8 > 1.0F) { ++ if (var8 > 1.0F) { + var8 = 1.0F; + } + +- super.renderParticle(var1, var2, var3, var4, var5, var6, var7); ++ super.renderParticle(par1Tessellator, par2, par3, par4, par5, par6, par7); + } + ++ /** ++ * Called to update the entity's position/logic. ++ */ + public void onUpdate() { + this.prevPosX = this.posX; + this.prevPosY = this.posY; + this.prevPosZ = this.posZ; +- if(this.particleAge++ >= this.particleMaxAge) { ++ ++ if (this.particleAge++ >= this.particleMaxAge) { + this.setDead(); + } + + this.setParticleTextureIndex(this.baseSpellTextureIndex + (7 - this.particleAge * 8 / this.particleMaxAge)); + this.motionY += 0.004D; + this.moveEntity(this.motionX, this.motionY, this.motionZ); +- if(this.posY == this.prevPosY) { ++ ++ if (this.posY == this.prevPosY) { + this.motionX *= 1.1D; + this.motionZ *= 1.1D; + } + +- this.motionX *= (double)0.96F; +- this.motionY *= (double)0.96F; +- this.motionZ *= (double)0.96F; +- if(this.onGround) { +- this.motionX *= (double)0.7F; +- this.motionZ *= (double)0.7F; ++ this.motionX *= 0.9599999785423279D; ++ this.motionY *= 0.9599999785423279D; ++ this.motionZ *= 0.9599999785423279D; ++ ++ if (this.onGround) { ++ this.motionX *= 0.699999988079071D; ++ this.motionZ *= 0.699999988079071D; + } +- + } + +- public void setBaseSpellTextureIndex(int var1) { +- this.baseSpellTextureIndex = var1; ++ /** ++ * Sets the base spell texture index ++ */ ++ public void setBaseSpellTextureIndex(int par1) { ++ this.baseSpellTextureIndex = par1; + } + } diff --git a/patches/net/minecraft/src/EntitySpider.java.patch b/patches/net/minecraft/src/EntitySpider.java.patch new file mode 100644 index 0000000..926cc14 --- /dev/null +++ b/patches/net/minecraft/src/EntitySpider.java.patch @@ -0,0 +1,233 @@ +--- net/minecraft/src/EntitySpider.java ++++ net/minecraft/src/EntitySpider.java +@@ -1,8 +1,8 @@ + package net.minecraft.src; + + public class EntitySpider extends EntityMob { +- public EntitySpider(World var1) { +- super(var1); ++ public EntitySpider(World par1World) { ++ super(par1World); + this.setSize(1.4F, 0.9F); + } + +@@ -11,23 +11,31 @@ + this.dataWatcher.addObject(16, new Byte((byte)0)); + } + ++ /** ++ * Called to update the entity's position/logic. ++ */ + public void onUpdate() { + super.onUpdate(); +- if(!this.worldObj.isRemote) { ++ ++ if (!this.worldObj.isRemote) { + this.setBesideClimbableBlock(this.isCollidedHorizontally); + } +- + } + + protected void applyEntityAttributes() { + super.applyEntityAttributes(); + this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setAttribute(16.0D); +- this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setAttribute((double)0.8F); ++ this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setAttribute(0.800000011920929D); + } + ++ /** ++ * Finds the closest player within 16 blocks to attack, or null if this Entity isn't interested in attacking (Animals, ++ * Spiders at day, peaceful PigZombies). ++ */ + protected Entity findPlayerToAttack() { + float var1 = this.getBrightness(1.0F); +- if(var1 < 0.5F) { ++ ++ if (var1 < 0.5F) { + double var2 = 16.0D; + return this.worldObj.getClosestVulnerablePlayerToEntity(this, var2); + } else { +@@ -35,77 +43,116 @@ + } + } + ++ /** ++ * Returns the sound this mob makes while it's alive. ++ */ + protected String getLivingSound() { + return "mob.spider.say"; + } + ++ /** ++ * Returns the sound this mob makes when it is hurt. ++ */ + protected String getHurtSound() { + return "mob.spider.say"; + } + ++ /** ++ * Returns the sound this mob makes on death. ++ */ + protected String getDeathSound() { + return "mob.spider.death"; + } + +- protected void playStepSound(int var1, int var2, int var3, int var4) { ++ /** ++ * Plays step sound at given x, y, z for the entity ++ */ ++ protected void playStepSound(int par1, int par2, int par3, int par4) { + this.playSound("mob.spider.step", 0.15F, 1.0F); + } + +- protected void attackEntity(Entity var1, float var2) { ++ /** ++ * Basic mob attack. Default to touch of death in EntityCreature. Overridden by each mob to define their attack. ++ */ ++ protected void attackEntity(Entity par1Entity, float par2) { + float var3 = this.getBrightness(1.0F); +- if(var3 > 0.5F && this.ab.nextInt(100) == 0) { ++ ++ if (var3 > 0.5F && this.rand.nextInt(100) == 0) { + this.entityToAttack = null; + } else { +- if(var2 > 2.0F && var2 < 6.0F && this.ab.nextInt(10) == 0) { +- if(this.onGround) { +- double var4 = var1.posX - this.posX; +- double var6 = var1.posZ - this.posZ; ++ if (par2 > 2.0F && par2 < 6.0F && this.rand.nextInt(10) == 0) { ++ if (this.onGround) { ++ double var4 = par1Entity.posX - this.posX; ++ double var6 = par1Entity.posZ - this.posZ; + float var8 = MathHelper.sqrt_double(var4 * var4 + var6 * var6); +- this.motionX = var4 / (double)var8 * 0.5D * (double)0.8F + this.motionX * (double)0.2F; +- this.motionZ = var6 / (double)var8 * 0.5D * (double)0.8F + this.motionZ * (double)0.2F; +- this.motionY = (double)0.4F; ++ this.motionX = var4 / (double)var8 * 0.5D * 0.800000011920929D + this.motionX * 0.20000000298023224D; ++ this.motionZ = var6 / (double)var8 * 0.5D * 0.800000011920929D + this.motionZ * 0.20000000298023224D; ++ this.motionY = 0.4000000059604645D; + } + } else { +- super.attackEntity(var1, var2); ++ super.attackEntity(par1Entity, par2); + } +- + } + } + ++ /** ++ * Returns the item ID for the item the mob drops on death. ++ */ + protected int getDropItemId() { + return Item.silk.itemID; + } + +- protected void dropFewItems(boolean var1, int var2) { +- super.dropFewItems(var1, var2); +- if(var1 && (this.ab.nextInt(3) == 0 || this.ab.nextInt(1 + var2) > 0)) { ++ /** ++ * Drop 0-2 items of this living's type. @param par1 - Whether this entity has recently been hit by a player. @param ++ * par2 - Level of Looting used to kill this mob. ++ */ ++ protected void dropFewItems(boolean par1, int par2) { ++ super.dropFewItems(par1, par2); ++ ++ if (par1 && (this.rand.nextInt(3) == 0 || this.rand.nextInt(1 + par2) > 0)) { + this.dropItem(Item.spiderEye.itemID, 1); + } +- + } + ++ /** ++ * returns true if this entity is by a ladder, false otherwise ++ */ + public boolean isOnLadder() { + return this.isBesideClimbableBlock(); + } + +- public void setInWeb() { +- } ++ /** ++ * Sets the Entity inside a web block. ++ */ ++ public void setInWeb() {} + ++ /** ++ * Get this Entity's EnumCreatureAttribute ++ */ + public EnumCreatureAttribute getCreatureAttribute() { + return EnumCreatureAttribute.ARTHROPOD; + } + +- public boolean isPotionApplicable(PotionEffect var1) { +- return var1.getPotionID() == Potion.poison.id ? false : super.isPotionApplicable(var1); ++ public boolean isPotionApplicable(PotionEffect par1PotionEffect) { ++ return par1PotionEffect.getPotionID() == Potion.poison.id ? false : super.isPotionApplicable(par1PotionEffect); + } + ++ /** ++ * Returns true if the WatchableObject (Byte) is 0x01 otherwise returns false. The WatchableObject is updated using ++ * setBesideClimableBlock. ++ */ + public boolean isBesideClimbableBlock() { + return (this.dataWatcher.getWatchableObjectByte(16) & 1) != 0; + } + +- public void setBesideClimbableBlock(boolean var1) { ++ /** ++ * Updates the WatchableObject (Byte) created in entityInit(), setting it to 0x01 if par1 is true or 0x00 if it is ++ * false. ++ */ ++ public void setBesideClimbableBlock(boolean par1) { + byte var2 = this.dataWatcher.getWatchableObjectByte(16); +- if(var1) { ++ ++ if (par1) { + var2 = (byte)(var2 | 1); + } else { + var2 &= -2; +@@ -114,9 +161,10 @@ + this.dataWatcher.updateObject(16, Byte.valueOf(var2)); + } + +- public EntityLivingData onSpawnWithEgg(EntityLivingData var1) { +- Object var3 = super.onSpawnWithEgg(var1); +- if(this.worldObj.s.nextInt(100) == 0) { ++ public EntityLivingData onSpawnWithEgg(EntityLivingData par1EntityLivingData) { ++ Object par1EntityLivingData1 = super.onSpawnWithEgg(par1EntityLivingData); ++ ++ if (this.worldObj.rand.nextInt(100) == 0) { + EntitySkeleton var2 = new EntitySkeleton(this.worldObj); + var2.setLocationAndAngles(this.posX, this.posY, this.posZ, this.rotationYaw, 0.0F); + var2.onSpawnWithEgg((EntityLivingData)null); +@@ -124,20 +172,22 @@ + var2.mountEntity(this); + } + +- if(var3 == null) { +- var3 = new SpiderEffectsGroupData(); +- if(this.worldObj.difficultySetting > 2 && this.worldObj.s.nextFloat() < 0.1F * this.worldObj.getLocationTensionFactor(this.posX, this.posY, this.posZ)) { +- ((SpiderEffectsGroupData)var3).func_111104_a(this.worldObj.s); ++ if (par1EntityLivingData1 == null) { ++ par1EntityLivingData1 = new SpiderEffectsGroupData(); ++ ++ if (this.worldObj.difficultySetting > 2 && this.worldObj.rand.nextFloat() < 0.1F * this.worldObj.getLocationTensionFactor(this.posX, this.posY, this.posZ)) { ++ ((SpiderEffectsGroupData)par1EntityLivingData1).func_111104_a(this.worldObj.rand); + } + } + +- if(var3 instanceof SpiderEffectsGroupData) { +- int var4 = ((SpiderEffectsGroupData)var3).field_111105_a; +- if(var4 > 0 && Potion.potionTypes[var4] != null) { ++ if (par1EntityLivingData1 instanceof SpiderEffectsGroupData) { ++ int var4 = ((SpiderEffectsGroupData)par1EntityLivingData1).field_111105_a; ++ ++ if (var4 > 0 && Potion.potionTypes[var4] != null) { + this.addPotionEffect(new PotionEffect(var4, Integer.MAX_VALUE)); + } + } + +- return (EntityLivingData)var3; ++ return (EntityLivingData)par1EntityLivingData1; + } + } diff --git a/patches/net/minecraft/src/EntitySplashFX.java.patch b/patches/net/minecraft/src/EntitySplashFX.java.patch new file mode 100644 index 0000000..de4fadc --- /dev/null +++ b/patches/net/minecraft/src/EntitySplashFX.java.patch @@ -0,0 +1,38 @@ +--- net/minecraft/src/EntitySplashFX.java ++++ net/minecraft/src/EntitySplashFX.java +@@ -1,15 +1,27 @@ + package net.minecraft.src; + ++// MCPatcher Start ++import com.prupe.mcpatcher.cc.ColorizeBlock; ++// MCPatcher End ++ + public class EntitySplashFX extends EntityRainFX { +- public EntitySplashFX(World var1, double var2, double var4, double var6, double var8, double var10, double var12) { +- super(var1, var2, var4, var6); ++ public EntitySplashFX(World par1World, double par2, double par4, double par6, double par8, double par10, double par12) { ++ super(par1World, par2, par4, par6); + this.particleGravity = 0.04F; + this.nextTextureIndexX(); +- if(var10 == 0.0D && (var8 != 0.0D || var12 != 0.0D)) { +- this.motionX = var8; +- this.motionY = var10 + 0.1D; +- this.motionZ = var12; +- } +- ++ ++ if (par10 == 0.0D && (par8 != 0.0D || par12 != 0.0D)) { ++ this.motionX = par8; ++ this.motionY = par10 + 0.1D; ++ this.motionZ = par12; ++ } ++ ++ // MCPatcher Start ++ if (ColorizeBlock.computeWaterColor(this.posX, this.posY, this.posZ)) { ++ this.particleRed = ColorizeBlock.waterColor[0]; ++ this.particleGreen = ColorizeBlock.waterColor[1]; ++ this.particleBlue = ColorizeBlock.waterColor[2]; ++ } ++ // MCPatcher End + } + } diff --git a/patches/net/minecraft/src/EntitySquid.java.patch b/patches/net/minecraft/src/EntitySquid.java.patch new file mode 100644 index 0000000..98ee93e --- /dev/null +++ b/patches/net/minecraft/src/EntitySquid.java.patch @@ -0,0 +1,211 @@ +--- net/minecraft/src/EntitySquid.java ++++ net/minecraft/src/EntitySquid.java +@@ -5,21 +5,33 @@ + public float prevSquidPitch; + public float squidYaw; + public float prevSquidYaw; ++ ++ /** ++ * appears to be rotation in radians; we already have pitch & yaw, so this completes the triumvirate. ++ */ + public float squidRotation; ++ ++ /** previous squidRotation in radians. */ + public float prevSquidRotation; ++ ++ /** angle of the tentacles in radians */ + public float tentacleAngle; +- public float lastTentacleAngle; ++ ++ /** the last calculated angle of the tentacles in radians */ ++ public float prevTentacleAngle; + private float randomMotionSpeed; ++ ++ /** change in squidRotation in radians. */ + private float rotationVelocity; + private float field_70871_bB; + private float randomMotionVecX; + private float randomMotionVecY; + private float randomMotionVecZ; + +- public EntitySquid(World var1) { +- super(var1); ++ public EntitySquid(World par1World) { ++ super(par1World); + this.setSize(0.95F, 0.95F); +- this.rotationVelocity = 1.0F / (this.ab.nextFloat() + 1.0F) * 0.2F; ++ this.rotationVelocity = 1.0F / (this.rand.nextFloat() + 1.0F) * 0.2F; + } + + protected void applyEntityAttributes() { +@@ -27,63 +39,96 @@ + this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setAttribute(10.0D); + } + ++ /** ++ * Returns the sound this mob makes while it's alive. ++ */ + protected String getLivingSound() { + return null; + } + ++ /** ++ * Returns the sound this mob makes when it is hurt. ++ */ + protected String getHurtSound() { + return null; + } + ++ /** ++ * Returns the sound this mob makes on death. ++ */ + protected String getDeathSound() { + return null; + } + ++ /** ++ * Returns the volume for the sounds this mob makes. ++ */ + protected float getSoundVolume() { + return 0.4F; + } + ++ /** ++ * Returns the item ID for the item the mob drops on death. ++ */ + protected int getDropItemId() { + return 0; + } + ++ /** ++ * returns if this entity triggers Block.onEntityWalking on the blocks they walk on. used for spiders and wolves to ++ * prevent them from trampling crops ++ */ + protected boolean canTriggerWalking() { + return false; + } + +- protected void dropFewItems(boolean var1, int var2) { +- int var3 = this.ab.nextInt(3 + var2) + 1; ++ /** ++ * Drop 0-2 items of this living's type. @param par1 - Whether this entity has recently been hit by a player. @param ++ * par2 - Level of Looting used to kill this mob. ++ */ ++ protected void dropFewItems(boolean par1, int par2) { ++ int var3 = this.rand.nextInt(3 + par2) + 1; + +- for(int var4 = 0; var4 < var3; ++var4) { ++ for (int var4 = 0; var4 < var3; ++var4) { + this.entityDropItem(new ItemStack(Item.dyePowder, 1, 0), 0.0F); + } +- + } + ++ /** ++ * Checks if this entity is inside water (if inWater field is true as a result of handleWaterMovement() returning true) ++ */ + public boolean isInWater() { +- return this.worldObj.handleMaterialAcceleration(this.boundingBox.expand(0.0D, (double)-0.6F, 0.0D), Material.water, this); ++ return this.worldObj.handleMaterialAcceleration(this.boundingBox.expand(0.0D, -0.6000000238418579D, 0.0D), Material.water, this); + } + ++ /** ++ * Called frequently so the entity can update its state every tick as required. For example, zombies and skeletons use ++ * this to react to sunlight and start to burn. ++ */ + public void onLivingUpdate() { + super.onLivingUpdate(); + this.prevSquidPitch = this.squidPitch; + this.prevSquidYaw = this.squidYaw; + this.prevSquidRotation = this.squidRotation; +- this.lastTentacleAngle = this.tentacleAngle; ++ this.prevTentacleAngle = this.tentacleAngle; + this.squidRotation += this.rotationVelocity; +- if(this.squidRotation > (float)Math.PI * 2.0F) { +- this.squidRotation -= (float)Math.PI * 2.0F; +- if(this.ab.nextInt(10) == 0) { +- this.rotationVelocity = 1.0F / (this.ab.nextFloat() + 1.0F) * 0.2F; ++ ++ if (this.squidRotation > ((float)Math.PI * 2F)) { ++ this.squidRotation -= ((float)Math.PI * 2F); ++ ++ if (this.rand.nextInt(10) == 0) { ++ this.rotationVelocity = 1.0F / (this.rand.nextFloat() + 1.0F) * 0.2F; + } + } + +- if(this.isInWater()) { ++ if (this.isInWater()) { + float var1; +- if(this.squidRotation < (float)Math.PI) { ++ ++ if (this.squidRotation < (float)Math.PI) { + var1 = this.squidRotation / (float)Math.PI; + this.tentacleAngle = MathHelper.sin(var1 * var1 * (float)Math.PI) * (float)Math.PI * 0.25F; +- if((double)var1 > 0.75D) { ++ ++ if ((double)var1 > 0.75D) { + this.randomMotionSpeed = 1.0F; + this.field_70871_bB = 1.0F; + } else { +@@ -95,7 +140,7 @@ + this.field_70871_bB *= 0.99F; + } + +- if(!this.worldObj.isRemote) { ++ if (!this.worldObj.isRemote) { + this.motionX = (double)(this.randomMotionVecX * this.randomMotionSpeed); + this.motionY = (double)(this.randomMotionVecY * this.randomMotionSpeed); + this.motionZ = (double)(this.randomMotionVecZ * this.randomMotionSpeed); +@@ -108,36 +153,43 @@ + this.squidPitch += (-((float)Math.atan2((double)var1, this.motionY)) * 180.0F / (float)Math.PI - this.squidPitch) * 0.1F; + } else { + this.tentacleAngle = MathHelper.abs(MathHelper.sin(this.squidRotation)) * (float)Math.PI * 0.25F; +- if(!this.worldObj.isRemote) { ++ ++ if (!this.worldObj.isRemote) { + this.motionX = 0.0D; + this.motionY -= 0.08D; +- this.motionY *= (double)0.98F; ++ this.motionY *= 0.9800000190734863D; + this.motionZ = 0.0D; + } + + this.squidPitch = (float)((double)this.squidPitch + (double)(-90.0F - this.squidPitch) * 0.02D); + } +- + } + +- public void moveEntityWithHeading(float var1, float var2) { ++ /** ++ * Moves the entity based on the specified heading. Args: strafe, forward ++ */ ++ public void moveEntityWithHeading(float par1, float par2) { + this.moveEntity(this.motionX, this.motionY, this.motionZ); + } + + protected void updateEntityActionState() { + ++this.entityAge; +- if(this.entityAge > 100) { ++ ++ if (this.entityAge > 100) { + this.randomMotionVecX = this.randomMotionVecY = this.randomMotionVecZ = 0.0F; +- } else if(this.ab.nextInt(50) == 0 || !this.inWater || this.randomMotionVecX == 0.0F && this.randomMotionVecY == 0.0F && this.randomMotionVecZ == 0.0F) { +- float var1 = this.ab.nextFloat() * (float)Math.PI * 2.0F; ++ } else if (this.rand.nextInt(50) == 0 || !this.inWater || this.randomMotionVecX == 0.0F && this.randomMotionVecY == 0.0F && this.randomMotionVecZ == 0.0F) { ++ float var1 = this.rand.nextFloat() * (float)Math.PI * 2.0F; + this.randomMotionVecX = MathHelper.cos(var1) * 0.2F; +- this.randomMotionVecY = -0.1F + this.ab.nextFloat() * 0.2F; ++ this.randomMotionVecY = -0.1F + this.rand.nextFloat() * 0.2F; + this.randomMotionVecZ = MathHelper.sin(var1) * 0.2F; + } + + this.despawnEntity(); + } + ++ /** ++ * Checks if the entity's current position is a valid location to spawn this entity. ++ */ + public boolean getCanSpawnHere() { + return this.posY > 45.0D && this.posY < 63.0D && super.getCanSpawnHere(); + } diff --git a/patches/net/minecraft/src/EntitySuspendFX.java.patch b/patches/net/minecraft/src/EntitySuspendFX.java.patch new file mode 100644 index 0000000..71cdcf7 --- /dev/null +++ b/patches/net/minecraft/src/EntitySuspendFX.java.patch @@ -0,0 +1,63 @@ +--- net/minecraft/src/EntitySuspendFX.java ++++ net/minecraft/src/EntitySuspendFX.java +@@ -1,32 +1,43 @@ + package net.minecraft.src; + ++// MCPatcher Start ++import com.prupe.mcpatcher.cc.ColorizeBlock; ++import com.prupe.mcpatcher.cc.Colorizer; ++// MCPatcher End ++ + public class EntitySuspendFX extends EntityFX { +- public EntitySuspendFX(World var1, double var2, double var4, double var6, double var8, double var10, double var12) { +- super(var1, var2, var4 - 0.125D, var6, var8, var10, var12); +- this.particleRed = 0.4F; +- this.particleGreen = 0.4F; +- this.particleBlue = 0.7F; ++ public EntitySuspendFX(World par1World, double par2, double par4, double par6, double par8, double par10, double par12) { ++ super(par1World, par2, par4 - 0.125D, par6, par8, par10, par12); ++ // MCPatcher Start ++ Colorizer.setColorF(ColorizeBlock.colorizeBiome(6710962, Colorizer.COLOR_MAP_UNDERWATER, (int)par2, (int)par4, (int)par6)); ++ this.particleRed = Colorizer.setColor[0]; ++ this.particleGreen = Colorizer.setColor[1]; ++ this.particleBlue = Colorizer.setColor[2]; ++ // MCPatcher End + this.setParticleTextureIndex(0); + this.setSize(0.01F, 0.01F); +- this.particleScale *= this.ab.nextFloat() * 0.6F + 0.2F; +- this.motionX = var8 * 0.0D; +- this.motionY = var10 * 0.0D; +- this.motionZ = var12 * 0.0D; ++ this.particleScale *= this.rand.nextFloat() * 0.6F + 0.2F; ++ this.motionX = par8 * 0.0D; ++ this.motionY = par10 * 0.0D; ++ this.motionZ = par12 * 0.0D; + this.particleMaxAge = (int)(16.0D / (Math.random() * 0.8D + 0.2D)); + } + ++ /** ++ * Called to update the entity's position/logic. ++ */ + public void onUpdate() { + this.prevPosX = this.posX; + this.prevPosY = this.posY; + this.prevPosZ = this.posZ; + this.moveEntity(this.motionX, this.motionY, this.motionZ); +- if(this.worldObj.getBlockMaterial(MathHelper.floor_double(this.posX), MathHelper.floor_double(this.posY), MathHelper.floor_double(this.posZ)) != Material.water) { +- this.setDead(); +- } +- +- if(this.particleMaxAge-- <= 0) { +- this.setDead(); +- } +- ++ ++ if (this.worldObj.getBlockMaterial(MathHelper.floor_double(this.posX), MathHelper.floor_double(this.posY), MathHelper.floor_double(this.posZ)) != Material.water) { ++ this.setDead(); ++ } ++ ++ if (this.particleMaxAge-- <= 0) { ++ this.setDead(); ++ } + } + } diff --git a/patches/net/minecraft/src/EntityTNTPrimed.java.patch b/patches/net/minecraft/src/EntityTNTPrimed.java.patch new file mode 100644 index 0000000..a318010 --- /dev/null +++ b/patches/net/minecraft/src/EntityTNTPrimed.java.patch @@ -0,0 +1,138 @@ +--- net/minecraft/src/EntityTNTPrimed.java ++++ net/minecraft/src/EntityTNTPrimed.java +@@ -1,65 +1,77 @@ + package net.minecraft.src; + + public class EntityTNTPrimed extends Entity { ++ ++ /** How long the fuse is */ + public int fuse; + private EntityLivingBase tntPlacedBy; + +- public EntityTNTPrimed(World var1) { +- super(var1); ++ public EntityTNTPrimed(World par1World) { ++ super(par1World); + this.preventEntitySpawning = true; + this.setSize(0.98F, 0.98F); + this.yOffset = this.height / 2.0F; + } + +- public EntityTNTPrimed(World var1, double var2, double var4, double var6, EntityLivingBase var8) { +- this(var1); +- this.setPosition(var2, var4, var6); +- float var9 = (float)(Math.random() * (double)((float)Math.PI) * 2.0D); ++ public EntityTNTPrimed(World par1World, double par2, double par4, double par6, EntityLivingBase par8EntityLivingBase) { ++ this(par1World); ++ this.setPosition(par2, par4, par6); ++ float var9 = (float)(Math.random() * Math.PI * 2.0D); + this.motionX = (double)(-((float)Math.sin((double)var9)) * 0.02F); +- this.motionY = (double)0.2F; ++ this.motionY = 0.20000000298023224D; + this.motionZ = (double)(-((float)Math.cos((double)var9)) * 0.02F); + this.fuse = 80; +- this.prevPosX = var2; +- this.prevPosY = var4; +- this.prevPosZ = var6; +- this.tntPlacedBy = var8; +- } +- +- protected void entityInit() { +- } +- ++ this.prevPosX = par2; ++ this.prevPosY = par4; ++ this.prevPosZ = par6; ++ this.tntPlacedBy = par8EntityLivingBase; ++ } ++ ++ protected void entityInit() {} ++ ++ /** ++ * returns if this entity triggers Block.onEntityWalking on the blocks they walk on. used for spiders and wolves to ++ * prevent them from trampling crops ++ */ + protected boolean canTriggerWalking() { + return false; + } + ++ /** ++ * Returns true if other Entities should be prevented from moving through this Entity. ++ */ + public boolean canBeCollidedWith() { + return !this.isDead; + } + ++ /** ++ * Called to update the entity's position/logic. ++ */ + public void onUpdate() { + this.prevPosX = this.posX; + this.prevPosY = this.posY; + this.prevPosZ = this.posZ; +- this.motionY -= (double)0.04F; ++ this.motionY -= 0.03999999910593033D; + this.moveEntity(this.motionX, this.motionY, this.motionZ); +- this.motionX *= (double)0.98F; +- this.motionY *= (double)0.98F; +- this.motionZ *= (double)0.98F; +- if(this.onGround) { +- this.motionX *= (double)0.7F; +- this.motionZ *= (double)0.7F; ++ this.motionX *= 0.9800000190734863D; ++ this.motionY *= 0.9800000190734863D; ++ this.motionZ *= 0.9800000190734863D; ++ ++ if (this.onGround) { ++ this.motionX *= 0.699999988079071D; ++ this.motionZ *= 0.699999988079071D; + this.motionY *= -0.5D; + } + +- if(this.fuse-- <= 0) { ++ if (this.fuse-- <= 0) { + this.setDead(); +- if(!this.worldObj.isRemote) { ++ ++ if (!this.worldObj.isRemote) { + this.explode(); + } + } else { + this.worldObj.spawnParticle("smoke", this.posX, this.posY + 0.5D, this.posZ, 0.0D, 0.0D, 0.0D); + } +- + } + + private void explode() { +@@ -67,18 +79,27 @@ + this.worldObj.createExplosion(this, this.posX, this.posY, this.posZ, var1, true); + } + +- protected void writeEntityToNBT(NBTTagCompound var1) { +- var1.setByte("Fuse", (byte)this.fuse); ++ /** ++ * (abstract) Protected helper method to write subclass entity data to NBT. ++ */ ++ protected void writeEntityToNBT(NBTTagCompound par1NBTTagCompound) { ++ par1NBTTagCompound.setByte("Fuse", (byte)this.fuse); + } + +- protected void readEntityFromNBT(NBTTagCompound var1) { +- this.fuse = var1.getByte("Fuse"); ++ /** ++ * (abstract) Protected helper method to read subclass entity data from NBT. ++ */ ++ protected void readEntityFromNBT(NBTTagCompound par1NBTTagCompound) { ++ this.fuse = par1NBTTagCompound.getByte("Fuse"); + } + + public float getShadowSize() { + return 0.0F; + } + ++ /** ++ * returns null or the entityliving it was placed or ignited by ++ */ + public EntityLivingBase getTntPlacedBy() { + return this.tntPlacedBy; + } diff --git a/patches/net/minecraft/src/EntityTameable.java.patch b/patches/net/minecraft/src/EntityTameable.java.patch new file mode 100644 index 0000000..5a268d8 --- /dev/null +++ b/patches/net/minecraft/src/EntityTameable.java.patch @@ -0,0 +1,192 @@ +--- net/minecraft/src/EntityTameable.java ++++ net/minecraft/src/EntityTameable.java +@@ -3,8 +3,8 @@ + public abstract class EntityTameable extends EntityAnimal implements EntityOwnable { + protected EntityAISit aiSit = new EntityAISit(this); + +- public EntityTameable(World var1) { +- super(var1); ++ public EntityTameable(World par1World) { ++ super(par1World); + } + + protected void entityInit() { +@@ -13,89 +13,99 @@ + this.dataWatcher.addObject(17, ""); + } + +- public void writeEntityToNBT(NBTTagCompound var1) { +- super.writeEntityToNBT(var1); +- if(this.getOwnerName() == null) { +- var1.setString("Owner", ""); ++ /** ++ * (abstract) Protected helper method to write subclass entity data to NBT. ++ */ ++ public void writeEntityToNBT(NBTTagCompound par1NBTTagCompound) { ++ super.writeEntityToNBT(par1NBTTagCompound); ++ ++ if (this.getOwnerName() == null) { ++ par1NBTTagCompound.setString("Owner", ""); + } else { +- var1.setString("Owner", this.getOwnerName()); ++ par1NBTTagCompound.setString("Owner", this.getOwnerName()); + } + +- var1.setBoolean("Sitting", this.isSitting()); ++ par1NBTTagCompound.setBoolean("Sitting", this.isSitting()); + } + +- public void readEntityFromNBT(NBTTagCompound var1) { +- super.readEntityFromNBT(var1); +- String var2 = var1.getString("Owner"); +- if(var2.length() > 0) { ++ /** ++ * (abstract) Protected helper method to read subclass entity data from NBT. ++ */ ++ public void readEntityFromNBT(NBTTagCompound par1NBTTagCompound) { ++ super.readEntityFromNBT(par1NBTTagCompound); ++ String var2 = par1NBTTagCompound.getString("Owner"); ++ ++ if (var2.length() > 0) { + this.setOwner(var2); + this.setTamed(true); + } + +- this.aiSit.setSitting(var1.getBoolean("Sitting")); +- this.setSitting(var1.getBoolean("Sitting")); ++ this.aiSit.setSitting(par1NBTTagCompound.getBoolean("Sitting")); ++ this.setSitting(par1NBTTagCompound.getBoolean("Sitting")); + } + +- protected void playTameEffect(boolean var1) { ++ /** ++ * Play the taming effect, will either be hearts or smoke depending on status ++ */ ++ protected void playTameEffect(boolean par1) { + String var2 = "heart"; +- if(!var1) { ++ ++ if (!par1) { + var2 = "smoke"; + } + +- for(int var3 = 0; var3 < 7; ++var3) { +- double var4 = this.ab.nextGaussian() * 0.02D; +- double var6 = this.ab.nextGaussian() * 0.02D; +- double var8 = this.ab.nextGaussian() * 0.02D; +- this.worldObj.spawnParticle(var2, this.posX + (double)(this.ab.nextFloat() * this.width * 2.0F) - (double)this.width, this.posY + 0.5D + (double)(this.ab.nextFloat() * this.height), this.posZ + (double)(this.ab.nextFloat() * this.width * 2.0F) - (double)this.width, var4, var6, var8); ++ for (int var3 = 0; var3 < 7; ++var3) { ++ double var4 = this.rand.nextGaussian() * 0.02D; ++ double var6 = this.rand.nextGaussian() * 0.02D; ++ double var8 = this.rand.nextGaussian() * 0.02D; ++ this.worldObj.spawnParticle(var2, this.posX + (double)(this.rand.nextFloat() * this.width * 2.0F) - (double)this.width, this.posY + 0.5D + (double)(this.rand.nextFloat() * this.height), this.posZ + (double)(this.rand.nextFloat() * this.width * 2.0F) - (double)this.width, var4, var6, var8); + } +- + } + +- public void handleHealthUpdate(byte var1) { +- if(var1 == 7) { ++ public void handleHealthUpdate(byte par1) { ++ if (par1 == 7) { + this.playTameEffect(true); +- } else if(var1 == 6) { ++ } else if (par1 == 6) { + this.playTameEffect(false); + } else { +- super.handleHealthUpdate(var1); ++ super.handleHealthUpdate(par1); + } +- + } + + public boolean isTamed() { + return (this.dataWatcher.getWatchableObjectByte(16) & 4) != 0; + } + +- public void setTamed(boolean var1) { ++ public void setTamed(boolean par1) { + byte var2 = this.dataWatcher.getWatchableObjectByte(16); +- if(var1) { ++ ++ if (par1) { + this.dataWatcher.updateObject(16, Byte.valueOf((byte)(var2 | 4))); + } else { + this.dataWatcher.updateObject(16, Byte.valueOf((byte)(var2 & -5))); + } +- + } + + public boolean isSitting() { + return (this.dataWatcher.getWatchableObjectByte(16) & 1) != 0; + } + +- public void setSitting(boolean var1) { ++ public void setSitting(boolean par1) { + byte var2 = this.dataWatcher.getWatchableObjectByte(16); +- if(var1) { ++ ++ if (par1) { + this.dataWatcher.updateObject(16, Byte.valueOf((byte)(var2 | 1))); + } else { + this.dataWatcher.updateObject(16, Byte.valueOf((byte)(var2 & -2))); + } +- + } + + public String getOwnerName() { + return this.dataWatcher.getWatchableObjectString(17); + } + +- public void setOwner(String var1) { +- this.dataWatcher.updateObject(17, var1); ++ public void setOwner(String par1Str) { ++ this.dataWatcher.updateObject(17, par1Str); + } + + public EntityLivingBase func_130012_q() { +@@ -106,14 +116,15 @@ + return this.aiSit; + } + +- public boolean func_142018_a(EntityLivingBase var1, EntityLivingBase var2) { ++ public boolean func_142018_a(EntityLivingBase par1EntityLivingBase, EntityLivingBase par2EntityLivingBase) { + return true; + } + + public Team getTeam() { +- if(this.isTamed()) { ++ if (this.isTamed()) { + EntityLivingBase var1 = this.func_130012_q(); +- if(var1 != null) { ++ ++ if (var1 != null) { + return var1.getTeam(); + } + } +@@ -121,19 +132,20 @@ + return super.getTeam(); + } + +- public boolean isOnSameTeam(EntityLivingBase var1) { +- if(this.isTamed()) { ++ public boolean isOnSameTeam(EntityLivingBase par1EntityLivingBase) { ++ if (this.isTamed()) { + EntityLivingBase var2 = this.func_130012_q(); +- if(var1 == var2) { ++ ++ if (par1EntityLivingBase == var2) { + return true; + } + +- if(var2 != null) { +- return var2.isOnSameTeam(var1); ++ if (var2 != null) { ++ return var2.isOnSameTeam(par1EntityLivingBase); + } + } + +- return super.isOnSameTeam(var1); ++ return super.isOnSameTeam(par1EntityLivingBase); + } + + public Entity getOwner() { diff --git a/patches/net/minecraft/src/EntityThrowable.java.patch b/patches/net/minecraft/src/EntityThrowable.java.patch new file mode 100644 index 0000000..0e17010 --- /dev/null +++ b/patches/net/minecraft/src/EntityThrowable.java.patch @@ -0,0 +1,383 @@ +--- net/minecraft/src/EntityThrowable.java ++++ net/minecraft/src/EntityThrowable.java +@@ -9,32 +9,41 @@ + private int inTile; + protected boolean inGround; + public int throwableShake; +- private EntityLivingBase thrower; +- private String h; ++ ++ /** ++ * Is the entity that throws this 'thing' (snowball, ender pearl, eye of ender or potion) ++ */ ++ // Spout Start - private to public ++ public EntityLivingBase thrower; ++ // Spout End ++ private String throwerName; + private int ticksInGround; + private int ticksInAir; + +- public EntityThrowable(World var1) { +- super(var1); ++ public EntityThrowable(World par1World) { ++ super(par1World); + this.setSize(0.25F, 0.25F); + } + +- protected void entityInit() { +- } ++ protected void entityInit() {} + +- public boolean isInRangeToRenderDist(double var1) { ++ /** ++ * Checks if the entity is in range to render by using the past in distance and comparing it to its average edge length ++ * * 64 * renderDistanceWeight Args: distance ++ */ ++ public boolean isInRangeToRenderDist(double par1) { + double var3 = this.boundingBox.getAverageEdgeLength() * 4.0D; + var3 *= 64.0D; +- return var1 < var3 * var3; ++ return par1 < var3 * var3; + } + +- public EntityThrowable(World var1, EntityLivingBase var2) { +- super(var1); +- this.thrower = var2; ++ public EntityThrowable(World par1World, EntityLivingBase par2EntityLivingBase) { ++ super(par1World); ++ this.thrower = par2EntityLivingBase; + this.setSize(0.25F, 0.25F); +- this.setLocationAndAngles(var2.posX, var2.posY + (double)var2.getEyeHeight(), var2.posZ, var2.rotationYaw, var2.rotationPitch); ++ this.setLocationAndAngles(par2EntityLivingBase.posX, par2EntityLivingBase.posY + (double)par2EntityLivingBase.getEyeHeight(), par2EntityLivingBase.posZ, par2EntityLivingBase.rotationYaw, par2EntityLivingBase.rotationPitch); + this.posX -= (double)(MathHelper.cos(this.rotationYaw / 180.0F * (float)Math.PI) * 0.16F); +- this.posY -= (double)0.1F; ++ this.posY -= 0.10000000149011612D; + this.posZ -= (double)(MathHelper.sin(this.rotationYaw / 180.0F * (float)Math.PI) * 0.16F); + this.setPosition(this.posX, this.posY, this.posZ); + this.yOffset = 0.0F; +@@ -45,11 +54,11 @@ + this.setThrowableHeading(this.motionX, this.motionY, this.motionZ, this.func_70182_d(), 1.0F); + } + +- public EntityThrowable(World var1, double var2, double var4, double var6) { +- super(var1); ++ public EntityThrowable(World par1World, double par2, double par4, double par6) { ++ super(par1World); + this.ticksInGround = 0; + this.setSize(0.25F, 0.25F); +- this.setPosition(var2, var4, var6); ++ this.setPosition(par2, par4, par6); + this.yOffset = 0.0F; + } + +@@ -61,52 +70,64 @@ + return 0.0F; + } + +- public void setThrowableHeading(double var1, double var3, double var5, float var7, float var8) { +- float var9 = MathHelper.sqrt_double(var1 * var1 + var3 * var3 + var5 * var5); +- var1 /= (double)var9; +- var3 /= (double)var9; +- var5 /= (double)var9; +- var1 += this.ab.nextGaussian() * (double)0.0075F * (double)var8; +- var3 += this.ab.nextGaussian() * (double)0.0075F * (double)var8; +- var5 += this.ab.nextGaussian() * (double)0.0075F * (double)var8; +- var1 *= (double)var7; +- var3 *= (double)var7; +- var5 *= (double)var7; +- this.motionX = var1; +- this.motionY = var3; +- this.motionZ = var5; +- float var10 = MathHelper.sqrt_double(var1 * var1 + var5 * var5); +- this.prevRotationYaw = this.rotationYaw = (float)(Math.atan2(var1, var5) * 180.0D / (double)((float)Math.PI)); +- this.prevRotationPitch = this.rotationPitch = (float)(Math.atan2(var3, (double)var10) * 180.0D / (double)((float)Math.PI)); ++ /** ++ * Similar to setArrowHeading, it's point the throwable entity to a x, y, z direction. ++ */ ++ public void setThrowableHeading(double par1, double par3, double par5, float par7, float par8) { ++ float var9 = MathHelper.sqrt_double(par1 * par1 + par3 * par3 + par5 * par5); ++ par1 /= (double)var9; ++ par3 /= (double)var9; ++ par5 /= (double)var9; ++ par1 += this.rand.nextGaussian() * 0.007499999832361937D * (double)par8; ++ par3 += this.rand.nextGaussian() * 0.007499999832361937D * (double)par8; ++ par5 += this.rand.nextGaussian() * 0.007499999832361937D * (double)par8; ++ par1 *= (double)par7; ++ par3 *= (double)par7; ++ par5 *= (double)par7; ++ this.motionX = par1; ++ this.motionY = par3; ++ this.motionZ = par5; ++ float var10 = MathHelper.sqrt_double(par1 * par1 + par5 * par5); ++ this.prevRotationYaw = this.rotationYaw = (float)(Math.atan2(par1, par5) * 180.0D / Math.PI); ++ this.prevRotationPitch = this.rotationPitch = (float)(Math.atan2(par3, (double)var10) * 180.0D / Math.PI); + this.ticksInGround = 0; + } + +- public void setVelocity(double var1, double var3, double var5) { +- this.motionX = var1; +- this.motionY = var3; +- this.motionZ = var5; +- if(this.prevRotationPitch == 0.0F && this.prevRotationYaw == 0.0F) { +- float var7 = MathHelper.sqrt_double(var1 * var1 + var5 * var5); +- this.prevRotationYaw = this.rotationYaw = (float)(Math.atan2(var1, var5) * 180.0D / (double)((float)Math.PI)); +- this.prevRotationPitch = this.rotationPitch = (float)(Math.atan2(var3, (double)var7) * 180.0D / (double)((float)Math.PI)); ++ /** ++ * Sets the velocity to the args. Args: x, y, z ++ */ ++ public void setVelocity(double par1, double par3, double par5) { ++ this.motionX = par1; ++ this.motionY = par3; ++ this.motionZ = par5; ++ ++ if (this.prevRotationPitch == 0.0F && this.prevRotationYaw == 0.0F) { ++ float var7 = MathHelper.sqrt_double(par1 * par1 + par5 * par5); ++ this.prevRotationYaw = this.rotationYaw = (float)(Math.atan2(par1, par5) * 180.0D / Math.PI); ++ this.prevRotationPitch = this.rotationPitch = (float)(Math.atan2(par3, (double)var7) * 180.0D / Math.PI); + } +- + } + ++ /** ++ * Called to update the entity's position/logic. ++ */ + public void onUpdate() { + this.lastTickPosX = this.posX; + this.lastTickPosY = this.posY; + this.lastTickPosZ = this.posZ; + super.onUpdate(); +- if(this.throwableShake > 0) { ++ ++ if (this.throwableShake > 0) { + --this.throwableShake; + } + +- if(this.inGround) { ++ if (this.inGround) { + int var1 = this.worldObj.getBlockId(this.xTile, this.yTile, this.zTile); +- if(var1 == this.inTile) { ++ ++ if (var1 == this.inTile) { + ++this.ticksInGround; +- if(this.ticksInGround == 1200) { ++ ++ if (this.ticksInGround == 1200) { + this.setDead(); + } + +@@ -114,39 +135,43 @@ + } + + this.inGround = false; +- this.motionX *= (double)(this.ab.nextFloat() * 0.2F); +- this.motionY *= (double)(this.ab.nextFloat() * 0.2F); +- this.motionZ *= (double)(this.ab.nextFloat() * 0.2F); ++ this.motionX *= (double)(this.rand.nextFloat() * 0.2F); ++ this.motionY *= (double)(this.rand.nextFloat() * 0.2F); ++ this.motionZ *= (double)(this.rand.nextFloat() * 0.2F); + this.ticksInGround = 0; + this.ticksInAir = 0; + } else { + ++this.ticksInAir; + } + +- Vec3 var16 = this.worldObj.getWorldVec3Pool().getVecFromPool(this.posX, this.posY, this.posZ); ++ Vec3 var17 = this.worldObj.getWorldVec3Pool().getVecFromPool(this.posX, this.posY, this.posZ); + Vec3 var2 = this.worldObj.getWorldVec3Pool().getVecFromPool(this.posX + this.motionX, this.posY + this.motionY, this.posZ + this.motionZ); +- MovingObjectPosition var3 = this.worldObj.rayTraceBlocks(var16, var2); +- var16 = this.worldObj.getWorldVec3Pool().getVecFromPool(this.posX, this.posY, this.posZ); ++ MovingObjectPosition var3 = this.worldObj.clip(var17, var2); ++ var17 = this.worldObj.getWorldVec3Pool().getVecFromPool(this.posX, this.posY, this.posZ); + var2 = this.worldObj.getWorldVec3Pool().getVecFromPool(this.posX + this.motionX, this.posY + this.motionY, this.posZ + this.motionZ); +- if(var3 != null) { ++ ++ if (var3 != null) { + var2 = this.worldObj.getWorldVec3Pool().getVecFromPool(var3.hitVec.xCoord, var3.hitVec.yCoord, var3.hitVec.zCoord); + } + +- if(!this.worldObj.isRemote) { ++ if (!this.worldObj.isRemote) { + Entity var4 = null; + List var5 = this.worldObj.getEntitiesWithinAABBExcludingEntity(this, this.boundingBox.addCoord(this.motionX, this.motionY, this.motionZ).expand(1.0D, 1.0D, 1.0D)); + double var6 = 0.0D; + EntityLivingBase var8 = this.getThrower(); + +- for(int var9 = 0; var9 < var5.size(); ++var9) { ++ for (int var9 = 0; var9 < var5.size(); ++var9) { + Entity var10 = (Entity)var5.get(var9); +- if(var10.canBeCollidedWith() && (var10 != var8 || this.ticksInAir >= 5)) { ++ ++ if (var10.canBeCollidedWith() && (var10 != var8 || this.ticksInAir >= 5)) { + float var11 = 0.3F; + AxisAlignedBB var12 = var10.boundingBox.expand((double)var11, (double)var11, (double)var11); +- MovingObjectPosition var13 = var12.calculateIntercept(var16, var2); +- if(var13 != null) { +- double var14 = var16.distanceTo(var13.hitVec); +- if(var14 < var6 || var6 == 0.0D) { ++ MovingObjectPosition var13 = var12.calculateIntercept(var17, var2); ++ ++ if (var13 != null) { ++ double var14 = var17.distanceTo(var13.hitVec); ++ ++ if (var14 < var6 || var6 == 0.0D) { + var4 = var10; + var6 = var14; + } +@@ -154,13 +179,13 @@ + } + } + +- if(var4 != null) { ++ if (var4 != null) { + var3 = new MovingObjectPosition(var4); + } + } + +- if(var3 != null) { +- if(var3.typeOfHit == EnumMovingObjectType.TILE && this.worldObj.getBlockId(var3.blockX, var3.blockY, var3.blockZ) == Block.portal.blockID) { ++ if (var3 != null) { ++ if (var3.typeOfHit == EnumMovingObjectType.TILE && this.worldObj.getBlockId(var3.blockX, var3.blockY, var3.blockZ) == Block.portal.blockID) { + this.setInPortal(); + } else { + this.onImpact(var3); +@@ -170,76 +195,91 @@ + this.posX += this.motionX; + this.posY += this.motionY; + this.posZ += this.motionZ; +- float var17 = MathHelper.sqrt_double(this.motionX * this.motionX + this.motionZ * this.motionZ); +- this.rotationYaw = (float)(Math.atan2(this.motionX, this.motionZ) * 180.0D / (double)((float)Math.PI)); ++ float var16 = MathHelper.sqrt_double(this.motionX * this.motionX + this.motionZ * this.motionZ); ++ this.rotationYaw = (float)(Math.atan2(this.motionX, this.motionZ) * 180.0D / Math.PI); + +- for(this.rotationPitch = (float)(Math.atan2(this.motionY, (double)var17) * 180.0D / (double)((float)Math.PI)); this.rotationPitch - this.prevRotationPitch < -180.0F; this.prevRotationPitch -= 360.0F) { ++ for (this.rotationPitch = (float)(Math.atan2(this.motionY, (double)var16) * 180.0D / Math.PI); this.rotationPitch - this.prevRotationPitch < -180.0F; this.prevRotationPitch -= 360.0F) { ++ ; + } + +- while(this.rotationPitch - this.prevRotationPitch >= 180.0F) { ++ while (this.rotationPitch - this.prevRotationPitch >= 180.0F) { + this.prevRotationPitch += 360.0F; + } + +- while(this.rotationYaw - this.prevRotationYaw < -180.0F) { ++ while (this.rotationYaw - this.prevRotationYaw < -180.0F) { + this.prevRotationYaw -= 360.0F; + } + +- while(this.rotationYaw - this.prevRotationYaw >= 180.0F) { ++ while (this.rotationYaw - this.prevRotationYaw >= 180.0F) { + this.prevRotationYaw += 360.0F; + } + + this.rotationPitch = this.prevRotationPitch + (this.rotationPitch - this.prevRotationPitch) * 0.2F; + this.rotationYaw = this.prevRotationYaw + (this.rotationYaw - this.prevRotationYaw) * 0.2F; +- float var18 = 0.99F; +- float var19 = this.getGravityVelocity(); +- if(this.isInWater()) { +- for(int var7 = 0; var7 < 4; ++var7) { +- float var20 = 0.25F; +- this.worldObj.spawnParticle("bubble", this.posX - this.motionX * (double)var20, this.posY - this.motionY * (double)var20, this.posZ - this.motionZ * (double)var20, this.motionX, this.motionY, this.motionZ); ++ float var19 = 0.99F; ++ float var20 = this.getGravityVelocity(); ++ ++ if (this.isInWater()) { ++ for (int var7 = 0; var7 < 4; ++var7) { ++ float var18 = 0.25F; ++ this.worldObj.spawnParticle("bubble", this.posX - this.motionX * (double)var18, this.posY - this.motionY * (double)var18, this.posZ - this.motionZ * (double)var18, this.motionX, this.motionY, this.motionZ); + } + +- var18 = 0.8F; ++ var19 = 0.8F; + } + +- this.motionX *= (double)var18; +- this.motionY *= (double)var18; +- this.motionZ *= (double)var18; +- this.motionY -= (double)var19; ++ this.motionX *= (double)var19; ++ this.motionY *= (double)var19; ++ this.motionZ *= (double)var19; ++ this.motionY -= (double)var20; + this.setPosition(this.posX, this.posY, this.posZ); + } + ++ /** ++ * Gets the amount of gravity to apply to the thrown entity with each tick. ++ */ + protected float getGravityVelocity() { + return 0.03F; + } + ++ /** ++ * Called when this EntityThrowable hits a block or entity. ++ */ + protected abstract void onImpact(MovingObjectPosition var1); + +- public void writeEntityToNBT(NBTTagCompound var1) { +- var1.setShort("xTile", (short)this.xTile); +- var1.setShort("yTile", (short)this.yTile); +- var1.setShort("zTile", (short)this.zTile); +- var1.setByte("inTile", (byte)this.inTile); +- var1.setByte("shake", (byte)this.throwableShake); +- var1.setByte("inGround", (byte)(this.inGround ? 1 : 0)); +- if((this.h == null || this.h.length() == 0) && this.thrower != null && this.thrower instanceof EntityPlayer) { +- this.h = this.thrower.getEntityName(); ++ /** ++ * (abstract) Protected helper method to write subclass entity data to NBT. ++ */ ++ public void writeEntityToNBT(NBTTagCompound par1NBTTagCompound) { ++ par1NBTTagCompound.setShort("xTile", (short)this.xTile); ++ par1NBTTagCompound.setShort("yTile", (short)this.yTile); ++ par1NBTTagCompound.setShort("zTile", (short)this.zTile); ++ par1NBTTagCompound.setByte("inTile", (byte)this.inTile); ++ par1NBTTagCompound.setByte("shake", (byte)this.throwableShake); ++ par1NBTTagCompound.setByte("inGround", (byte)(this.inGround ? 1 : 0)); ++ ++ if ((this.throwerName == null || this.throwerName.length() == 0) && this.thrower != null && this.thrower instanceof EntityPlayer) { ++ this.throwerName = this.thrower.getEntityName(); + } + +- var1.setString("ownerName", this.h == null ? "" : this.h); ++ par1NBTTagCompound.setString("ownerName", this.throwerName == null ? "" : this.throwerName); + } + +- public void readEntityFromNBT(NBTTagCompound var1) { +- this.xTile = var1.getShort("xTile"); +- this.yTile = var1.getShort("yTile"); +- this.zTile = var1.getShort("zTile"); +- this.inTile = var1.getByte("inTile") & 255; +- this.throwableShake = var1.getByte("shake") & 255; +- this.inGround = var1.getByte("inGround") == 1; +- this.h = var1.getString("ownerName"); +- if(this.h != null && this.h.length() == 0) { +- this.h = null; +- } ++ /** ++ * (abstract) Protected helper method to read subclass entity data from NBT. ++ */ ++ public void readEntityFromNBT(NBTTagCompound par1NBTTagCompound) { ++ this.xTile = par1NBTTagCompound.getShort("xTile"); ++ this.yTile = par1NBTTagCompound.getShort("yTile"); ++ this.zTile = par1NBTTagCompound.getShort("zTile"); ++ this.inTile = par1NBTTagCompound.getByte("inTile") & 255; ++ this.throwableShake = par1NBTTagCompound.getByte("shake") & 255; ++ this.inGround = par1NBTTagCompound.getByte("inGround") == 1; ++ this.throwerName = par1NBTTagCompound.getString("ownerName"); + ++ if (this.throwerName != null && this.throwerName.length() == 0) { ++ this.throwerName = null; ++ } + } + + public float getShadowSize() { +@@ -247,8 +287,8 @@ + } + + public EntityLivingBase getThrower() { +- if(this.thrower == null && this.h != null && this.h.length() > 0) { +- this.thrower = this.worldObj.getPlayerEntityByName(this.h); ++ if (this.thrower == null && this.throwerName != null && this.throwerName.length() > 0) { ++ this.thrower = this.worldObj.getPlayerEntityByName(this.throwerName); + } + + return this.thrower; diff --git a/patches/net/minecraft/src/EntityTracker.java.patch b/patches/net/minecraft/src/EntityTracker.java.patch new file mode 100644 index 0000000..1246664 --- /dev/null +++ b/patches/net/minecraft/src/EntityTracker.java.patch @@ -0,0 +1,346 @@ +--- net/minecraft/src/EntityTracker.java ++++ net/minecraft/src/EntityTracker.java +@@ -7,105 +7,113 @@ + + public class EntityTracker { + private final WorldServer theWorld; +- private Set b = new HashSet(); +- private IntHashMap trackedEntityHashTable = new IntHashMap(); +- private int maxTrackingDistanceThreshold; +- +- public EntityTracker(WorldServer var1) { +- this.theWorld = var1; +- this.maxTrackingDistanceThreshold = var1.getMinecraftServer().getConfigurationManager().getEntityViewDistance(); ++ ++ /** ++ * List of tracked entities, used for iteration operations on tracked entities. ++ */ ++ private Set trackedEntities = new HashSet(); ++ private IntHashMap trackedEntityIDs = new IntHashMap(); ++ private int entityViewDistance; ++ ++ public EntityTracker(WorldServer par1WorldServer) { ++ this.theWorld = par1WorldServer; ++ this.entityViewDistance = par1WorldServer.getMinecraftServer().getConfigurationManager().getEntityViewDistance(); + } + +- public void trackEntity(Entity var1) { +- if(var1 instanceof EntityPlayerMP) { +- this.trackEntity(var1, 512, 2); +- EntityPlayerMP var2 = (EntityPlayerMP)var1; +- Iterator var3 = this.b.iterator(); ++ /** ++ * if entity is a player sends all tracked events to the player, otherwise, adds with a visibility and update arate ++ * based on the class type ++ */ ++ public void addEntityToTracker(Entity par1Entity) { ++ if (par1Entity instanceof EntityPlayerMP) { ++ this.addEntityToTracker(par1Entity, 512, 2); ++ EntityPlayerMP var2 = (EntityPlayerMP)par1Entity; ++ Iterator var3 = this.trackedEntities.iterator(); + +- while(var3.hasNext()) { ++ while (var3.hasNext()) { + EntityTrackerEntry var4 = (EntityTrackerEntry)var3.next(); +- if(var4.trackedEntity != var2) { +- var4.updatePlayerEntity(var2); ++ ++ if (var4.myEntity != var2) { ++ var4.tryStartWachingThis(var2); + } + } +- } else if(var1 instanceof EntityFishHook) { +- this.trackEntity(var1, 64, 5, true); +- } else if(var1 instanceof EntityArrow) { +- this.trackEntity(var1, 64, 20, false); +- } else if(var1 instanceof EntitySmallFireball) { +- this.trackEntity(var1, 64, 10, false); +- } else if(var1 instanceof EntityFireball) { +- this.trackEntity(var1, 64, 10, false); +- } else if(var1 instanceof EntitySnowball) { +- this.trackEntity(var1, 64, 10, true); +- } else if(var1 instanceof EntityEnderPearl) { +- this.trackEntity(var1, 64, 10, true); +- } else if(var1 instanceof EntityEnderEye) { +- this.trackEntity(var1, 64, 4, true); +- } else if(var1 instanceof EntityEgg) { +- this.trackEntity(var1, 64, 10, true); +- } else if(var1 instanceof EntityPotion) { +- this.trackEntity(var1, 64, 10, true); +- } else if(var1 instanceof EntityExpBottle) { +- this.trackEntity(var1, 64, 10, true); +- } else if(var1 instanceof EntityFireworkRocket) { +- this.trackEntity(var1, 64, 10, true); +- } else if(var1 instanceof EntityItem) { +- this.trackEntity(var1, 64, 20, true); +- } else if(var1 instanceof EntityMinecart) { +- this.trackEntity(var1, 80, 3, true); +- } else if(var1 instanceof EntityBoat) { +- this.trackEntity(var1, 80, 3, true); +- } else if(var1 instanceof EntitySquid) { +- this.trackEntity(var1, 64, 3, true); +- } else if(var1 instanceof EntityWither) { +- this.trackEntity(var1, 80, 3, false); +- } else if(var1 instanceof EntityBat) { +- this.trackEntity(var1, 80, 3, false); +- } else if(var1 instanceof IAnimals) { +- this.trackEntity(var1, 80, 3, true); +- } else if(var1 instanceof EntityDragon) { +- this.trackEntity(var1, 160, 3, true); +- } else if(var1 instanceof EntityTNTPrimed) { +- this.trackEntity(var1, 160, 10, true); +- } else if(var1 instanceof EntityFallingSand) { +- this.trackEntity(var1, 160, 20, true); +- } else if(var1 instanceof EntityHanging) { +- this.trackEntity(var1, 160, Integer.MAX_VALUE, false); +- } else if(var1 instanceof EntityXPOrb) { +- this.trackEntity(var1, 160, 20, true); +- } else if(var1 instanceof EntityEnderCrystal) { +- this.trackEntity(var1, 256, Integer.MAX_VALUE, false); ++ } else if (par1Entity instanceof EntityFishHook) { ++ this.addEntityToTracker(par1Entity, 64, 5, true); ++ } else if (par1Entity instanceof EntityArrow) { ++ this.addEntityToTracker(par1Entity, 64, 20, false); ++ } else if (par1Entity instanceof EntitySmallFireball) { ++ this.addEntityToTracker(par1Entity, 64, 10, false); ++ } else if (par1Entity instanceof EntityFireball) { ++ this.addEntityToTracker(par1Entity, 64, 10, false); ++ } else if (par1Entity instanceof EntitySnowball) { ++ this.addEntityToTracker(par1Entity, 64, 10, true); ++ } else if (par1Entity instanceof EntityEnderPearl) { ++ this.addEntityToTracker(par1Entity, 64, 10, true); ++ } else if (par1Entity instanceof EntityEnderEye) { ++ this.addEntityToTracker(par1Entity, 64, 4, true); ++ } else if (par1Entity instanceof EntityEgg) { ++ this.addEntityToTracker(par1Entity, 64, 10, true); ++ } else if (par1Entity instanceof EntityPotion) { ++ this.addEntityToTracker(par1Entity, 64, 10, true); ++ } else if (par1Entity instanceof EntityExpBottle) { ++ this.addEntityToTracker(par1Entity, 64, 10, true); ++ } else if (par1Entity instanceof EntityFireworkRocket) { ++ this.addEntityToTracker(par1Entity, 64, 10, true); ++ } else if (par1Entity instanceof EntityItem) { ++ this.addEntityToTracker(par1Entity, 64, 20, true); ++ } else if (par1Entity instanceof EntityMinecart) { ++ this.addEntityToTracker(par1Entity, 80, 3, true); ++ } else if (par1Entity instanceof EntityBoat) { ++ this.addEntityToTracker(par1Entity, 80, 3, true); ++ } else if (par1Entity instanceof EntitySquid) { ++ this.addEntityToTracker(par1Entity, 64, 3, true); ++ } else if (par1Entity instanceof EntityWither) { ++ this.addEntityToTracker(par1Entity, 80, 3, false); ++ } else if (par1Entity instanceof EntityBat) { ++ this.addEntityToTracker(par1Entity, 80, 3, false); ++ } else if (par1Entity instanceof IAnimals) { ++ this.addEntityToTracker(par1Entity, 80, 3, true); ++ } else if (par1Entity instanceof EntityDragon) { ++ this.addEntityToTracker(par1Entity, 160, 3, true); ++ } else if (par1Entity instanceof EntityTNTPrimed) { ++ this.addEntityToTracker(par1Entity, 160, 10, true); ++ } else if (par1Entity instanceof EntityFallingSand) { ++ this.addEntityToTracker(par1Entity, 160, 20, true); ++ } else if (par1Entity instanceof EntityHanging) { ++ this.addEntityToTracker(par1Entity, 160, Integer.MAX_VALUE, false); ++ } else if (par1Entity instanceof EntityXPOrb) { ++ this.addEntityToTracker(par1Entity, 160, 20, true); ++ } else if (par1Entity instanceof EntityEnderCrystal) { ++ this.addEntityToTracker(par1Entity, 256, Integer.MAX_VALUE, false); + } +- +- } +- +- public void trackEntity(Entity var1, int var2, int var3) { +- this.trackEntity(var1, var2, var3, false); +- } +- +- public void trackEntity(Entity var1, int var2, int var3, boolean var4) { +- if(var2 > this.maxTrackingDistanceThreshold) { +- var2 = this.maxTrackingDistanceThreshold; ++ } ++ ++ public void addEntityToTracker(Entity par1Entity, int par2, int par3) { ++ this.addEntityToTracker(par1Entity, par2, par3, false); ++ } ++ ++ public void addEntityToTracker(Entity par1Entity, int par2, int par3, boolean par4) { ++ if (par2 > this.entityViewDistance) { ++ par2 = this.entityViewDistance; + } + + try { +- if(this.trackedEntityHashTable.containsItem(var1.entityId)) { ++ if (this.trackedEntityIDs.containsItem(par1Entity.entityId)) { + throw new IllegalStateException("Entity is already tracked!"); + } + +- EntityTrackerEntry var5 = new EntityTrackerEntry(var1, var2, var3, var4); +- this.b.add(var5); +- this.trackedEntityHashTable.addKey(var1.entityId, var5); +- var5.updatePlayerEntities(this.theWorld.h); ++ EntityTrackerEntry var5 = new EntityTrackerEntry(par1Entity, par2, par3, par4); ++ this.trackedEntities.add(var5); ++ this.trackedEntityIDs.addKey(par1Entity.entityId, var5); ++ var5.sendEventsToPlayers(this.theWorld.playerEntities); + } catch (Throwable var11) { + CrashReport var6 = CrashReport.makeCrashReport(var11, "Adding entity to track"); + CrashReportCategory var7 = var6.makeCategory("Entity To Track"); +- var7.addCrashSection("Tracking range", var2 + " blocks"); +- var7.addCrashSectionCallable("Update interval", new CallableEntityTracker(this, var3)); +- var1.addEntityCrashInfo(var7); ++ var7.addCrashSection("Tracking range", par2 + " blocks"); ++ var7.addCrashSectionCallable("Update interval", new CallableEntityTracker(this, par3)); ++ par1Entity.addEntityCrashInfo(var7); + CrashReportCategory var8 = var6.makeCategory("Entity That Is Already Tracked"); +- ((EntityTrackerEntry)this.trackedEntityHashTable.lookup(var1.entityId)).trackedEntity.addEntityCrashInfo(var8); ++ ((EntityTrackerEntry)this.trackedEntityIDs.lookup(par1Entity.entityId)).myEntity.addEntityCrashInfo(var8); + + try { + throw new ReportedException(var6); +@@ -114,89 +122,94 @@ + var10.printStackTrace(); + } + } +- + } + +- public void untrackEntity(Entity var1) { +- if(var1 instanceof EntityPlayerMP) { +- EntityPlayerMP var2 = (EntityPlayerMP)var1; +- Iterator var3 = this.b.iterator(); ++ public void removeEntityFromAllTrackingPlayers(Entity par1Entity) { ++ if (par1Entity instanceof EntityPlayerMP) { ++ EntityPlayerMP var2 = (EntityPlayerMP)par1Entity; ++ Iterator var3 = this.trackedEntities.iterator(); + +- while(var3.hasNext()) { ++ while (var3.hasNext()) { + EntityTrackerEntry var4 = (EntityTrackerEntry)var3.next(); +- var4.removeFromTrackedPlayers(var2); ++ var4.removeFromWatchingList(var2); + } + } + +- EntityTrackerEntry var5 = (EntityTrackerEntry)this.trackedEntityHashTable.removeObject(var1.entityId); +- if(var5 != null) { +- this.b.remove(var5); +- var5.sendDestroyEntityPacketToTrackedPlayers(); +- } ++ EntityTrackerEntry var5 = (EntityTrackerEntry)this.trackedEntityIDs.removeObject(par1Entity.entityId); + ++ if (var5 != null) { ++ this.trackedEntities.remove(var5); ++ var5.informAllAssociatedPlayersOfItemDestruction(); ++ } + } + + public void updateTrackedEntities() { + ArrayList var1 = new ArrayList(); +- Iterator var2 = this.b.iterator(); ++ Iterator var2 = this.trackedEntities.iterator(); + +- while(var2.hasNext()) { ++ while (var2.hasNext()) { + EntityTrackerEntry var3 = (EntityTrackerEntry)var2.next(); +- var3.updatePlayerList(this.theWorld.h); +- if(var3.playerEntitiesUpdated && var3.trackedEntity instanceof EntityPlayerMP) { +- var1.add((EntityPlayerMP)var3.trackedEntity); ++ var3.sendLocationToAllClients(this.theWorld.playerEntities); ++ ++ if (var3.playerEntitiesUpdated && var3.myEntity instanceof EntityPlayerMP) { ++ var1.add((EntityPlayerMP)var3.myEntity); + } + } + +- for(int var6 = 0; var6 < var1.size(); ++var6) { ++ for (int var6 = 0; var6 < var1.size(); ++var6) { + EntityPlayerMP var7 = (EntityPlayerMP)var1.get(var6); +- Iterator var4 = this.b.iterator(); ++ Iterator var4 = this.trackedEntities.iterator(); + +- while(var4.hasNext()) { ++ while (var4.hasNext()) { + EntityTrackerEntry var5 = (EntityTrackerEntry)var4.next(); +- if(var5.trackedEntity != var7) { +- var5.updatePlayerEntity(var7); ++ ++ if (var5.myEntity != var7) { ++ var5.tryStartWachingThis(var7); + } + } + } +- +- } +- +- public void sendPacketToTrackedPlayers(Entity var1, Packet var2) { +- EntityTrackerEntry var3 = (EntityTrackerEntry)this.trackedEntityHashTable.lookup(var1.entityId); +- if(var3 != null) { +- var3.sendPacketToTrackedPlayers(var2); +- } +- +- } +- +- public void sendPacketToTrackedPlayersAndTrackedEntity(Entity var1, Packet var2) { +- EntityTrackerEntry var3 = (EntityTrackerEntry)this.trackedEntityHashTable.lookup(var1.entityId); +- if(var3 != null) { +- var3.sendPacketToTrackedPlayersAndTrackedEntity(var2); +- } +- +- } +- +- public void removePlayerFromTrackers(EntityPlayerMP var1) { +- Iterator var2 = this.b.iterator(); +- +- while(var2.hasNext()) { ++ } ++ ++ /** ++ * does not send the packet to the entity if the entity is a player ++ */ ++ public void sendPacketToAllPlayersTrackingEntity(Entity par1Entity, Packet par2Packet) { ++ EntityTrackerEntry var3 = (EntityTrackerEntry)this.trackedEntityIDs.lookup(par1Entity.entityId); ++ ++ if (var3 != null) { ++ var3.sendPacketToAllTrackingPlayers(par2Packet); ++ } ++ } ++ ++ /** ++ * sends to the entity if the entity is a player ++ */ ++ public void sendPacketToAllAssociatedPlayers(Entity par1Entity, Packet par2Packet) { ++ EntityTrackerEntry var3 = (EntityTrackerEntry)this.trackedEntityIDs.lookup(par1Entity.entityId); ++ ++ if (var3 != null) { ++ var3.sendPacketToAllAssociatedPlayers(par2Packet); ++ } ++ } ++ ++ public void removePlayerFromTrackers(EntityPlayerMP par1EntityPlayerMP) { ++ Iterator var2 = this.trackedEntities.iterator(); ++ ++ while (var2.hasNext()) { + EntityTrackerEntry var3 = (EntityTrackerEntry)var2.next(); +- var3.removeTrackedPlayerSymmetric(var1); ++ var3.removePlayerFromTracker(par1EntityPlayerMP); + } +- + } + +- public void func_85172_a(EntityPlayerMP var1, Chunk var2) { +- Iterator var3 = this.b.iterator(); ++ public void func_85172_a(EntityPlayerMP par1EntityPlayerMP, Chunk par2Chunk) { ++ Iterator var3 = this.trackedEntities.iterator(); + +- while(var3.hasNext()) { ++ while (var3.hasNext()) { + EntityTrackerEntry var4 = (EntityTrackerEntry)var3.next(); +- if(var4.trackedEntity != var1 && var4.trackedEntity.chunkCoordX == var2.xPosition && var4.trackedEntity.chunkCoordZ == var2.zPosition) { +- var4.updatePlayerEntity(var1); ++ ++ if (var4.myEntity != par1EntityPlayerMP && var4.myEntity.chunkCoordX == par2Chunk.xPosition && var4.myEntity.chunkCoordZ == par2Chunk.zPosition) { ++ var4.tryStartWachingThis(par1EntityPlayerMP); + } + } +- + } + } diff --git a/patches/net/minecraft/src/EntityTrackerEntry.java.patch b/patches/net/minecraft/src/EntityTrackerEntry.java.patch new file mode 100644 index 0000000..ffe91c1 --- /dev/null +++ b/patches/net/minecraft/src/EntityTrackerEntry.java.patch @@ -0,0 +1,742 @@ +--- net/minecraft/src/EntityTrackerEntry.java ++++ net/minecraft/src/EntityTrackerEntry.java +@@ -7,416 +7,454 @@ + import java.util.Set; + + public class EntityTrackerEntry { +- public Entity trackedEntity; +- public int trackingDistanceThreshold; ++ public Entity myEntity; ++ public int blocksDistanceThreshold; ++ ++ /** check for sync when ticks % updateFrequency==0 */ + public int updateFrequency; +- public int encodedPosX; +- public int encodedPosY; +- public int encodedPosZ; +- public int encodedRotationYaw; +- public int encodedRotationPitch; ++ public int lastScaledXPosition; ++ public int lastScaledYPosition; ++ public int lastScaledZPosition; ++ public int lastYaw; ++ public int lastPitch; + public int lastHeadMotion; +- public double lastTrackedEntityMotionX; +- public double lastTrackedEntityMotionY; ++ public double motionX; ++ public double motionY; + public double motionZ; +- public int updateCounter; +- private double lastTrackedEntityPosX; +- private double lastTrackedEntityPosY; +- private double lastTrackedEntityPosZ; +- private boolean firstUpdateDone; ++ public int ticks; ++ private double posX; ++ private double posY; ++ private double posZ; ++ ++ /** set to true on first sendLocationToClients */ ++ private boolean isDataInitialized; + private boolean sendVelocityUpdates; ++ ++ /** ++ * every 400 ticks a full teleport packet is sent, rather than just a "move me +x" command, so that position remains ++ * fully synced. ++ */ + private int ticksSinceLastForcedTeleport; + private Entity field_85178_v; + private boolean ridingEntity; + public boolean playerEntitiesUpdated; +- public Set o = new HashSet(); +- +- public EntityTrackerEntry(Entity var1, int var2, int var3, boolean var4) { +- this.trackedEntity = var1; +- this.trackingDistanceThreshold = var2; +- this.updateFrequency = var3; +- this.sendVelocityUpdates = var4; +- this.encodedPosX = MathHelper.floor_double(var1.posX * 32.0D); +- this.encodedPosY = MathHelper.floor_double(var1.posY * 32.0D); +- this.encodedPosZ = MathHelper.floor_double(var1.posZ * 32.0D); +- this.encodedRotationYaw = MathHelper.floor_float(var1.rotationYaw * 256.0F / 360.0F); +- this.encodedRotationPitch = MathHelper.floor_float(var1.rotationPitch * 256.0F / 360.0F); +- this.lastHeadMotion = MathHelper.floor_float(var1.getRotationYawHead() * 256.0F / 360.0F); ++ ++ /** ++ * Holds references to all the players that are currently receiving position updates for this entity. ++ */ ++ public Set trackingPlayers = new HashSet(); ++ ++ public EntityTrackerEntry(Entity par1Entity, int par2, int par3, boolean par4) { ++ this.myEntity = par1Entity; ++ this.blocksDistanceThreshold = par2; ++ this.updateFrequency = par3; ++ this.sendVelocityUpdates = par4; ++ this.lastScaledXPosition = MathHelper.floor_double(par1Entity.posX * 32.0D); ++ this.lastScaledYPosition = MathHelper.floor_double(par1Entity.posY * 32.0D); ++ this.lastScaledZPosition = MathHelper.floor_double(par1Entity.posZ * 32.0D); ++ this.lastYaw = MathHelper.floor_float(par1Entity.rotationYaw * 256.0F / 360.0F); ++ this.lastPitch = MathHelper.floor_float(par1Entity.rotationPitch * 256.0F / 360.0F); ++ this.lastHeadMotion = MathHelper.floor_float(par1Entity.getRotationYawHead() * 256.0F / 360.0F); + } + +- public boolean equals(Object var1) { +- return var1 instanceof EntityTrackerEntry ? ((EntityTrackerEntry)var1).trackedEntity.entityId == this.trackedEntity.entityId : false; ++ public boolean equals(Object par1Obj) { ++ return par1Obj instanceof EntityTrackerEntry ? ((EntityTrackerEntry)par1Obj).myEntity.entityId == this.myEntity.entityId : false; + } + + public int hashCode() { +- return this.trackedEntity.entityId; ++ return this.myEntity.entityId; + } + +- public void updatePlayerList(List var1) { ++ /** ++ * also sends velocity, rotation, and riding info. ++ */ ++ public void sendLocationToAllClients(List par1List) { + this.playerEntitiesUpdated = false; +- if(!this.firstUpdateDone || this.trackedEntity.getDistanceSq(this.lastTrackedEntityPosX, this.lastTrackedEntityPosY, this.lastTrackedEntityPosZ) > 16.0D) { +- this.lastTrackedEntityPosX = this.trackedEntity.posX; +- this.lastTrackedEntityPosY = this.trackedEntity.posY; +- this.lastTrackedEntityPosZ = this.trackedEntity.posZ; +- this.firstUpdateDone = true; ++ ++ if (!this.isDataInitialized || this.myEntity.getDistanceSq(this.posX, this.posY, this.posZ) > 16.0D) { ++ this.posX = this.myEntity.posX; ++ this.posY = this.myEntity.posY; ++ this.posZ = this.myEntity.posZ; ++ this.isDataInitialized = true; + this.playerEntitiesUpdated = true; +- this.updatePlayerEntities(var1); +- } +- +- if(this.field_85178_v != this.trackedEntity.ridingEntity || this.trackedEntity.ridingEntity != null && this.updateCounter % 60 == 0) { +- this.field_85178_v = this.trackedEntity.ridingEntity; +- this.sendPacketToTrackedPlayers(new Packet39AttachEntity(0, this.trackedEntity, this.trackedEntity.ridingEntity)); +- } +- +- if(this.trackedEntity instanceof EntityItemFrame && this.updateCounter % 10 == 0) { +- EntityItemFrame var23 = (EntityItemFrame)this.trackedEntity; ++ this.sendEventsToPlayers(par1List); ++ } ++ ++ if (this.field_85178_v != this.myEntity.ridingEntity || this.myEntity.ridingEntity != null && this.ticks % 60 == 0) { ++ this.field_85178_v = this.myEntity.ridingEntity; ++ this.sendPacketToAllTrackingPlayers(new Packet39AttachEntity(0, this.myEntity, this.myEntity.ridingEntity)); ++ } ++ ++ if (this.myEntity instanceof EntityItemFrame && this.ticks % 10 == 0) { ++ EntityItemFrame var23 = (EntityItemFrame)this.myEntity; + ItemStack var24 = var23.getDisplayedItem(); +- if(var24 != null && var24.getItem() instanceof ItemMap) { +- MapData var26 = Item.map.getMapData(var24, this.trackedEntity.worldObj); +- Iterator var27 = var1.iterator(); +- +- while(var27.hasNext()) { ++ ++ if (var24 != null && var24.getItem() instanceof ItemMap) { ++ MapData var26 = Item.map.getMapData(var24, this.myEntity.worldObj); ++ Iterator var27 = par1List.iterator(); ++ ++ while (var27.hasNext()) { + EntityPlayer var28 = (EntityPlayer)var27.next(); + EntityPlayerMP var29 = (EntityPlayerMP)var28; + var26.updateVisiblePlayers(var29, var24); +- if(var29.playerNetServerHandler.getNumChunkDataPackets() <= 5) { +- Packet var30 = Item.map.getUpdatePacket(var24, this.trackedEntity.worldObj, var29); +- if(var30 != null) { +- var29.playerNetServerHandler.sendPacket(var30); ++ ++ if (var29.playerNetServerHandler.packetSize() <= 5) { ++ Packet var30 = Item.map.createMapDataPacket(var24, this.myEntity.worldObj, var29); ++ ++ if (var30 != null) { ++ var29.playerNetServerHandler.sendPacketToPlayer(var30); + } + } + } + } + + this.func_111190_b(); +- } else if(this.updateCounter % this.updateFrequency == 0 || this.trackedEntity.isAirBorne || this.trackedEntity.getDataWatcher().hasObjectChanged()) { ++ } else if (this.ticks % this.updateFrequency == 0 || this.myEntity.isAirBorne || this.myEntity.getDataWatcher().hasChanges()) { + int var2; + int var3; +- if(this.trackedEntity.ridingEntity == null) { ++ ++ if (this.myEntity.ridingEntity == null) { + ++this.ticksSinceLastForcedTeleport; +- var2 = this.trackedEntity.myEntitySize.multiplyBy32AndRound(this.trackedEntity.posX); +- var3 = MathHelper.floor_double(this.trackedEntity.posY * 32.0D); +- int var25 = this.trackedEntity.myEntitySize.multiplyBy32AndRound(this.trackedEntity.posZ); +- int var5 = MathHelper.floor_float(this.trackedEntity.rotationYaw * 256.0F / 360.0F); +- int var6 = MathHelper.floor_float(this.trackedEntity.rotationPitch * 256.0F / 360.0F); +- int var7 = var2 - this.encodedPosX; +- int var8 = var3 - this.encodedPosY; +- int var9 = var25 - this.encodedPosZ; ++ var2 = this.myEntity.myEntitySize.multiplyBy32AndRound(this.myEntity.posX); ++ var3 = MathHelper.floor_double(this.myEntity.posY * 32.0D); ++ int var4 = this.myEntity.myEntitySize.multiplyBy32AndRound(this.myEntity.posZ); ++ int var5 = MathHelper.floor_float(this.myEntity.rotationYaw * 256.0F / 360.0F); ++ int var6 = MathHelper.floor_float(this.myEntity.rotationPitch * 256.0F / 360.0F); ++ int var7 = var2 - this.lastScaledXPosition; ++ int var8 = var3 - this.lastScaledYPosition; ++ int var9 = var4 - this.lastScaledZPosition; + Object var10 = null; +- boolean var11 = Math.abs(var7) >= 4 || Math.abs(var8) >= 4 || Math.abs(var9) >= 4 || this.updateCounter % 60 == 0; +- boolean var12 = Math.abs(var5 - this.encodedRotationYaw) >= 4 || Math.abs(var6 - this.encodedRotationPitch) >= 4; +- if(this.updateCounter > 0 || this.trackedEntity instanceof EntityArrow) { +- if(var7 >= -128 && var7 < 128 && var8 >= -128 && var8 < 128 && var9 >= -128 && var9 < 128 && this.ticksSinceLastForcedTeleport <= 400 && !this.ridingEntity) { +- if(var11 && var12) { +- var10 = new Packet33RelEntityMoveLook(this.trackedEntity.entityId, (byte)var7, (byte)var8, (byte)var9, (byte)var5, (byte)var6); +- } else if(var11) { +- var10 = new Packet31RelEntityMove(this.trackedEntity.entityId, (byte)var7, (byte)var8, (byte)var9); +- } else if(var12) { +- var10 = new Packet32EntityLook(this.trackedEntity.entityId, (byte)var5, (byte)var6); ++ boolean var11 = Math.abs(var7) >= 4 || Math.abs(var8) >= 4 || Math.abs(var9) >= 4 || this.ticks % 60 == 0; ++ boolean var12 = Math.abs(var5 - this.lastYaw) >= 4 || Math.abs(var6 - this.lastPitch) >= 4; ++ ++ if (this.ticks > 0 || this.myEntity instanceof EntityArrow) { ++ if (var7 >= -128 && var7 < 128 && var8 >= -128 && var8 < 128 && var9 >= -128 && var9 < 128 && this.ticksSinceLastForcedTeleport <= 400 && !this.ridingEntity) { ++ if (var11 && var12) { ++ var10 = new Packet33RelEntityMoveLook(this.myEntity.entityId, (byte)var7, (byte)var8, (byte)var9, (byte)var5, (byte)var6); ++ } else if (var11) { ++ var10 = new Packet31RelEntityMove(this.myEntity.entityId, (byte)var7, (byte)var8, (byte)var9); ++ } else if (var12) { ++ var10 = new Packet32EntityLook(this.myEntity.entityId, (byte)var5, (byte)var6); + } + } else { + this.ticksSinceLastForcedTeleport = 0; +- var10 = new Packet34EntityTeleport(this.trackedEntity.entityId, var2, var3, var25, (byte)var5, (byte)var6); ++ var10 = new Packet34EntityTeleport(this.myEntity.entityId, var2, var3, var4, (byte)var5, (byte)var6); + } + } + +- if(this.sendVelocityUpdates) { +- double var13 = this.trackedEntity.motionX - this.lastTrackedEntityMotionX; +- double var15 = this.trackedEntity.motionY - this.lastTrackedEntityMotionY; +- double var17 = this.trackedEntity.motionZ - this.motionZ; ++ if (this.sendVelocityUpdates) { ++ double var13 = this.myEntity.motionX - this.motionX; ++ double var15 = this.myEntity.motionY - this.motionY; ++ double var17 = this.myEntity.motionZ - this.motionZ; + double var19 = 0.02D; + double var21 = var13 * var13 + var15 * var15 + var17 * var17; +- if(var21 > var19 * var19 || var21 > 0.0D && this.trackedEntity.motionX == 0.0D && this.trackedEntity.motionY == 0.0D && this.trackedEntity.motionZ == 0.0D) { +- this.lastTrackedEntityMotionX = this.trackedEntity.motionX; +- this.lastTrackedEntityMotionY = this.trackedEntity.motionY; +- this.motionZ = this.trackedEntity.motionZ; +- this.sendPacketToTrackedPlayers(new Packet28EntityVelocity(this.trackedEntity.entityId, this.lastTrackedEntityMotionX, this.lastTrackedEntityMotionY, this.motionZ)); ++ ++ if (var21 > var19 * var19 || var21 > 0.0D && this.myEntity.motionX == 0.0D && this.myEntity.motionY == 0.0D && this.myEntity.motionZ == 0.0D) { ++ this.motionX = this.myEntity.motionX; ++ this.motionY = this.myEntity.motionY; ++ this.motionZ = this.myEntity.motionZ; ++ this.sendPacketToAllTrackingPlayers(new Packet28EntityVelocity(this.myEntity.entityId, this.motionX, this.motionY, this.motionZ)); + } + } + +- if(var10 != null) { +- this.sendPacketToTrackedPlayers((Packet)var10); ++ if (var10 != null) { ++ this.sendPacketToAllTrackingPlayers((Packet)var10); + } + + this.func_111190_b(); +- if(var11) { +- this.encodedPosX = var2; +- this.encodedPosY = var3; +- this.encodedPosZ = var25; ++ ++ if (var11) { ++ this.lastScaledXPosition = var2; ++ this.lastScaledYPosition = var3; ++ this.lastScaledZPosition = var4; + } + +- if(var12) { +- this.encodedRotationYaw = var5; +- this.encodedRotationPitch = var6; ++ if (var12) { ++ this.lastYaw = var5; ++ this.lastPitch = var6; + } + + this.ridingEntity = false; + } else { +- var2 = MathHelper.floor_float(this.trackedEntity.rotationYaw * 256.0F / 360.0F); +- var3 = MathHelper.floor_float(this.trackedEntity.rotationPitch * 256.0F / 360.0F); +- boolean var4 = Math.abs(var2 - this.encodedRotationYaw) >= 4 || Math.abs(var3 - this.encodedRotationPitch) >= 4; +- if(var4) { +- this.sendPacketToTrackedPlayers(new Packet32EntityLook(this.trackedEntity.entityId, (byte)var2, (byte)var3)); +- this.encodedRotationYaw = var2; +- this.encodedRotationPitch = var3; ++ var2 = MathHelper.floor_float(this.myEntity.rotationYaw * 256.0F / 360.0F); ++ var3 = MathHelper.floor_float(this.myEntity.rotationPitch * 256.0F / 360.0F); ++ boolean var25 = Math.abs(var2 - this.lastYaw) >= 4 || Math.abs(var3 - this.lastPitch) >= 4; ++ ++ if (var25) { ++ this.sendPacketToAllTrackingPlayers(new Packet32EntityLook(this.myEntity.entityId, (byte)var2, (byte)var3)); ++ this.lastYaw = var2; ++ this.lastPitch = var3; + } + +- this.encodedPosX = this.trackedEntity.myEntitySize.multiplyBy32AndRound(this.trackedEntity.posX); +- this.encodedPosY = MathHelper.floor_double(this.trackedEntity.posY * 32.0D); +- this.encodedPosZ = this.trackedEntity.myEntitySize.multiplyBy32AndRound(this.trackedEntity.posZ); ++ this.lastScaledXPosition = this.myEntity.myEntitySize.multiplyBy32AndRound(this.myEntity.posX); ++ this.lastScaledYPosition = MathHelper.floor_double(this.myEntity.posY * 32.0D); ++ this.lastScaledZPosition = this.myEntity.myEntitySize.multiplyBy32AndRound(this.myEntity.posZ); + this.func_111190_b(); + this.ridingEntity = true; + } + +- var2 = MathHelper.floor_float(this.trackedEntity.getRotationYawHead() * 256.0F / 360.0F); +- if(Math.abs(var2 - this.lastHeadMotion) >= 4) { +- this.sendPacketToTrackedPlayers(new Packet35EntityHeadRotation(this.trackedEntity.entityId, (byte)var2)); ++ var2 = MathHelper.floor_float(this.myEntity.getRotationYawHead() * 256.0F / 360.0F); ++ ++ if (Math.abs(var2 - this.lastHeadMotion) >= 4) { ++ this.sendPacketToAllTrackingPlayers(new Packet35EntityHeadRotation(this.myEntity.entityId, (byte)var2)); + this.lastHeadMotion = var2; + } + +- this.trackedEntity.isAirBorne = false; +- } +- +- ++this.updateCounter; +- if(this.trackedEntity.velocityChanged) { +- this.sendPacketToTrackedPlayersAndTrackedEntity(new Packet28EntityVelocity(this.trackedEntity)); +- this.trackedEntity.velocityChanged = false; +- } +- ++ this.myEntity.isAirBorne = false; ++ } ++ ++ ++this.ticks; ++ ++ if (this.myEntity.velocityChanged) { ++ this.sendPacketToAllAssociatedPlayers(new Packet28EntityVelocity(this.myEntity)); ++ this.myEntity.velocityChanged = false; ++ } + } + + private void func_111190_b() { +- DataWatcher var1 = this.trackedEntity.getDataWatcher(); +- if(var1.hasObjectChanged()) { +- this.sendPacketToTrackedPlayersAndTrackedEntity(new Packet40EntityMetadata(this.trackedEntity.entityId, var1, false)); ++ DataWatcher var1 = this.myEntity.getDataWatcher(); ++ ++ if (var1.hasChanges()) { ++ this.sendPacketToAllAssociatedPlayers(new Packet40EntityMetadata(this.myEntity.entityId, var1, false)); + } + +- if(this.trackedEntity instanceof EntityLivingBase) { +- ServersideAttributeMap var2 = (ServersideAttributeMap)((EntityLivingBase)this.trackedEntity).getAttributeMap(); ++ if (this.myEntity instanceof EntityLivingBase) { ++ ServersideAttributeMap var2 = (ServersideAttributeMap)((EntityLivingBase)this.myEntity).getAttributeMap(); + Set var3 = var2.func_111161_b(); +- if(!var3.isEmpty()) { +- this.sendPacketToTrackedPlayersAndTrackedEntity(new Packet44UpdateAttributes(this.trackedEntity.entityId, var3)); ++ ++ if (!var3.isEmpty()) { ++ this.sendPacketToAllAssociatedPlayers(new Packet44UpdateAttributes(this.myEntity.entityId, var3)); + } + + var3.clear(); + } +- + } + +- public void sendPacketToTrackedPlayers(Packet var1) { +- Iterator var2 = this.o.iterator(); ++ /** ++ * if this is a player, then it is not informed ++ */ ++ public void sendPacketToAllTrackingPlayers(Packet par1Packet) { ++ Iterator var2 = this.trackingPlayers.iterator(); + +- while(var2.hasNext()) { ++ while (var2.hasNext()) { + EntityPlayerMP var3 = (EntityPlayerMP)var2.next(); +- var3.playerNetServerHandler.sendPacket(var1); +- } +- +- } +- +- public void sendPacketToTrackedPlayersAndTrackedEntity(Packet var1) { +- this.sendPacketToTrackedPlayers(var1); +- if(this.trackedEntity instanceof EntityPlayerMP) { +- ((EntityPlayerMP)this.trackedEntity).playerNetServerHandler.sendPacket(var1); +- } +- +- } +- +- public void sendDestroyEntityPacketToTrackedPlayers() { +- Iterator var1 = this.o.iterator(); +- +- while(var1.hasNext()) { ++ var3.playerNetServerHandler.sendPacketToPlayer(par1Packet); ++ } ++ } ++ ++ /** ++ * if this is a player, then it recieves the message also ++ */ ++ public void sendPacketToAllAssociatedPlayers(Packet par1Packet) { ++ this.sendPacketToAllTrackingPlayers(par1Packet); ++ ++ if (this.myEntity instanceof EntityPlayerMP) { ++ ((EntityPlayerMP)this.myEntity).playerNetServerHandler.sendPacketToPlayer(par1Packet); ++ } ++ } ++ ++ public void informAllAssociatedPlayersOfItemDestruction() { ++ Iterator var1 = this.trackingPlayers.iterator(); ++ ++ while (var1.hasNext()) { + EntityPlayerMP var2 = (EntityPlayerMP)var1.next(); +- var2.g.add(Integer.valueOf(this.trackedEntity.entityId)); +- } +- +- } +- +- public void removeFromTrackedPlayers(EntityPlayerMP var1) { +- if(this.o.contains(var1)) { +- var1.g.add(Integer.valueOf(this.trackedEntity.entityId)); +- this.o.remove(var1); +- } +- +- } +- +- public void updatePlayerEntity(EntityPlayerMP var1) { +- if(var1 != this.trackedEntity) { +- double var2 = var1.posX - (double)(this.encodedPosX / 32); +- double var4 = var1.posZ - (double)(this.encodedPosZ / 32); +- if(var2 >= (double)(-this.trackingDistanceThreshold) && var2 <= (double)this.trackingDistanceThreshold && var4 >= (double)(-this.trackingDistanceThreshold) && var4 <= (double)this.trackingDistanceThreshold) { +- if(!this.o.contains(var1) && (this.isPlayerWatchingThisChunk(var1) || this.trackedEntity.forceSpawn)) { +- this.o.add(var1); +- Packet var6 = this.getSpawnPacket(); +- var1.playerNetServerHandler.sendPacket(var6); +- if(!this.trackedEntity.getDataWatcher().getIsBlank()) { +- var1.playerNetServerHandler.sendPacket(new Packet40EntityMetadata(this.trackedEntity.entityId, this.trackedEntity.getDataWatcher(), true)); ++ var2.destroyedItemsNetCache.add(Integer.valueOf(this.myEntity.entityId)); ++ } ++ } ++ ++ public void removeFromWatchingList(EntityPlayerMP par1EntityPlayerMP) { ++ if (this.trackingPlayers.contains(par1EntityPlayerMP)) { ++ par1EntityPlayerMP.destroyedItemsNetCache.add(Integer.valueOf(this.myEntity.entityId)); ++ this.trackingPlayers.remove(par1EntityPlayerMP); ++ } ++ } ++ ++ /** ++ * if the player is more than the distance threshold (typically 64) then the player is removed instead ++ */ ++ public void tryStartWachingThis(EntityPlayerMP par1EntityPlayerMP) { ++ if (par1EntityPlayerMP != this.myEntity) { ++ double var2 = par1EntityPlayerMP.posX - (double)(this.lastScaledXPosition / 32); ++ double var4 = par1EntityPlayerMP.posZ - (double)(this.lastScaledZPosition / 32); ++ ++ if (var2 >= (double)(-this.blocksDistanceThreshold) && var2 <= (double)this.blocksDistanceThreshold && var4 >= (double)(-this.blocksDistanceThreshold) && var4 <= (double)this.blocksDistanceThreshold) { ++ if (!this.trackingPlayers.contains(par1EntityPlayerMP) && (this.isPlayerWatchingThisChunk(par1EntityPlayerMP) || this.myEntity.forceSpawn)) { ++ this.trackingPlayers.add(par1EntityPlayerMP); ++ Packet var6 = this.getPacketForThisEntity(); ++ par1EntityPlayerMP.playerNetServerHandler.sendPacketToPlayer(var6); ++ ++ if (!this.myEntity.getDataWatcher().getIsBlank()) { ++ par1EntityPlayerMP.playerNetServerHandler.sendPacketToPlayer(new Packet40EntityMetadata(this.myEntity.entityId, this.myEntity.getDataWatcher(), true)); + } + +- if(this.trackedEntity instanceof EntityLivingBase) { +- ServersideAttributeMap var7 = (ServersideAttributeMap)((EntityLivingBase)this.trackedEntity).getAttributeMap(); ++ if (this.myEntity instanceof EntityLivingBase) { ++ ServersideAttributeMap var7 = (ServersideAttributeMap)((EntityLivingBase)this.myEntity).getAttributeMap(); + Collection var8 = var7.func_111160_c(); +- if(!var8.isEmpty()) { +- var1.playerNetServerHandler.sendPacket(new Packet44UpdateAttributes(this.trackedEntity.entityId, var8)); ++ ++ if (!var8.isEmpty()) { ++ par1EntityPlayerMP.playerNetServerHandler.sendPacketToPlayer(new Packet44UpdateAttributes(this.myEntity.entityId, var8)); + } + } + +- this.lastTrackedEntityMotionX = this.trackedEntity.motionX; +- this.lastTrackedEntityMotionY = this.trackedEntity.motionY; +- this.motionZ = this.trackedEntity.motionZ; +- if(this.sendVelocityUpdates && !(var6 instanceof Packet24MobSpawn)) { +- var1.playerNetServerHandler.sendPacket(new Packet28EntityVelocity(this.trackedEntity.entityId, this.trackedEntity.motionX, this.trackedEntity.motionY, this.trackedEntity.motionZ)); +- } +- +- if(this.trackedEntity.ridingEntity != null) { +- var1.playerNetServerHandler.sendPacket(new Packet39AttachEntity(0, this.trackedEntity, this.trackedEntity.ridingEntity)); +- } +- +- if(this.trackedEntity instanceof EntityLiving && ((EntityLiving)this.trackedEntity).getLeashedToEntity() != null) { +- var1.playerNetServerHandler.sendPacket(new Packet39AttachEntity(1, this.trackedEntity, ((EntityLiving)this.trackedEntity).getLeashedToEntity())); +- } +- +- if(this.trackedEntity instanceof EntityLivingBase) { +- for(int var10 = 0; var10 < 5; ++var10) { +- ItemStack var12 = ((EntityLivingBase)this.trackedEntity).getEquipmentInSlot(var10); +- if(var12 != null) { +- var1.playerNetServerHandler.sendPacket(new Packet5PlayerInventory(this.trackedEntity.entityId, var10, var12)); ++ this.motionX = this.myEntity.motionX; ++ this.motionY = this.myEntity.motionY; ++ this.motionZ = this.myEntity.motionZ; ++ ++ if (this.sendVelocityUpdates && !(var6 instanceof Packet24MobSpawn)) { ++ par1EntityPlayerMP.playerNetServerHandler.sendPacketToPlayer(new Packet28EntityVelocity(this.myEntity.entityId, this.myEntity.motionX, this.myEntity.motionY, this.myEntity.motionZ)); ++ } ++ ++ if (this.myEntity.ridingEntity != null) { ++ par1EntityPlayerMP.playerNetServerHandler.sendPacketToPlayer(new Packet39AttachEntity(0, this.myEntity, this.myEntity.ridingEntity)); ++ } ++ ++ if (this.myEntity instanceof EntityLiving && ((EntityLiving)this.myEntity).getLeashedToEntity() != null) { ++ par1EntityPlayerMP.playerNetServerHandler.sendPacketToPlayer(new Packet39AttachEntity(1, this.myEntity, ((EntityLiving)this.myEntity).getLeashedToEntity())); ++ } ++ ++ if (this.myEntity instanceof EntityLivingBase) { ++ for (int var10 = 0; var10 < 5; ++var10) { ++ ItemStack var12 = ((EntityLivingBase)this.myEntity).getCurrentItemOrArmor(var10); ++ ++ if (var12 != null) { ++ par1EntityPlayerMP.playerNetServerHandler.sendPacketToPlayer(new Packet5PlayerInventory(this.myEntity.entityId, var10, var12)); + } + } + } + +- if(this.trackedEntity instanceof EntityPlayer) { +- EntityPlayer var11 = (EntityPlayer)this.trackedEntity; +- if(var11.isPlayerSleeping()) { +- var1.playerNetServerHandler.sendPacket(new Packet17Sleep(this.trackedEntity, 0, MathHelper.floor_double(this.trackedEntity.posX), MathHelper.floor_double(this.trackedEntity.posY), MathHelper.floor_double(this.trackedEntity.posZ))); ++ if (this.myEntity instanceof EntityPlayer) { ++ EntityPlayer var11 = (EntityPlayer)this.myEntity; ++ ++ if (var11.isPlayerSleeping()) { ++ par1EntityPlayerMP.playerNetServerHandler.sendPacketToPlayer(new Packet17Sleep(this.myEntity, 0, MathHelper.floor_double(this.myEntity.posX), MathHelper.floor_double(this.myEntity.posY), MathHelper.floor_double(this.myEntity.posZ))); + } + } + +- if(this.trackedEntity instanceof EntityLivingBase) { +- EntityLivingBase var13 = (EntityLivingBase)this.trackedEntity; ++ if (this.myEntity instanceof EntityLivingBase) { ++ EntityLivingBase var13 = (EntityLivingBase)this.myEntity; + Iterator var14 = var13.getActivePotionEffects().iterator(); + +- while(var14.hasNext()) { ++ while (var14.hasNext()) { + PotionEffect var9 = (PotionEffect)var14.next(); +- var1.playerNetServerHandler.sendPacket(new Packet41EntityEffect(this.trackedEntity.entityId, var9)); ++ par1EntityPlayerMP.playerNetServerHandler.sendPacketToPlayer(new Packet41EntityEffect(this.myEntity.entityId, var9)); + } + } + } +- } else if(this.o.contains(var1)) { +- this.o.remove(var1); +- var1.g.add(Integer.valueOf(this.trackedEntity.entityId)); ++ } else if (this.trackingPlayers.contains(par1EntityPlayerMP)) { ++ this.trackingPlayers.remove(par1EntityPlayerMP); ++ par1EntityPlayerMP.destroyedItemsNetCache.add(Integer.valueOf(this.myEntity.entityId)); + } +- +- } +- } +- +- private boolean isPlayerWatchingThisChunk(EntityPlayerMP var1) { +- return var1.getServerForPlayer().getPlayerManager().isPlayerWatchingChunk(var1, this.trackedEntity.chunkCoordX, this.trackedEntity.chunkCoordZ); +- } +- +- public void updatePlayerEntities(List var1) { +- for(int var2 = 0; var2 < var1.size(); ++var2) { +- this.updatePlayerEntity((EntityPlayerMP)var1.get(var2)); +- } +- +- } +- +- private Packet getSpawnPacket() { +- if(this.trackedEntity.isDead) { +- this.trackedEntity.worldObj.getWorldLogAgent().logWarning("Fetching addPacket for removed entity"); +- } +- +- if(this.trackedEntity instanceof EntityItem) { +- return new Packet23VehicleSpawn(this.trackedEntity, 2, 1); +- } else if(this.trackedEntity instanceof EntityPlayerMP) { +- return new Packet20NamedEntitySpawn((EntityPlayer)this.trackedEntity); +- } else if(this.trackedEntity instanceof EntityMinecart) { +- EntityMinecart var9 = (EntityMinecart)this.trackedEntity; +- return new Packet23VehicleSpawn(this.trackedEntity, 10, var9.getMinecartType()); +- } else if(this.trackedEntity instanceof EntityBoat) { +- return new Packet23VehicleSpawn(this.trackedEntity, 1); +- } else if(!(this.trackedEntity instanceof IAnimals) && !(this.trackedEntity instanceof EntityDragon)) { +- if(this.trackedEntity instanceof EntityFishHook) { +- EntityPlayer var8 = ((EntityFishHook)this.trackedEntity).angler; +- return new Packet23VehicleSpawn(this.trackedEntity, 90, var8 != null ? var8.entityId : this.trackedEntity.entityId); +- } else if(this.trackedEntity instanceof EntityArrow) { +- Entity var7 = ((EntityArrow)this.trackedEntity).shootingEntity; +- return new Packet23VehicleSpawn(this.trackedEntity, 60, var7 != null ? var7.entityId : this.trackedEntity.entityId); +- } else if(this.trackedEntity instanceof EntitySnowball) { +- return new Packet23VehicleSpawn(this.trackedEntity, 61); +- } else if(this.trackedEntity instanceof EntityPotion) { +- return new Packet23VehicleSpawn(this.trackedEntity, 73, ((EntityPotion)this.trackedEntity).getPotionDamage()); +- } else if(this.trackedEntity instanceof EntityExpBottle) { +- return new Packet23VehicleSpawn(this.trackedEntity, 75); +- } else if(this.trackedEntity instanceof EntityEnderPearl) { +- return new Packet23VehicleSpawn(this.trackedEntity, 65); +- } else if(this.trackedEntity instanceof EntityEnderEye) { +- return new Packet23VehicleSpawn(this.trackedEntity, 72); +- } else if(this.trackedEntity instanceof EntityFireworkRocket) { +- return new Packet23VehicleSpawn(this.trackedEntity, 76); ++ } ++ } ++ ++ private boolean isPlayerWatchingThisChunk(EntityPlayerMP par1EntityPlayerMP) { ++ return par1EntityPlayerMP.getServerForPlayer().getPlayerManager().isPlayerWatchingChunk(par1EntityPlayerMP, this.myEntity.chunkCoordX, this.myEntity.chunkCoordZ); ++ } ++ ++ public void sendEventsToPlayers(List par1List) { ++ for (int var2 = 0; var2 < par1List.size(); ++var2) { ++ this.tryStartWachingThis((EntityPlayerMP)par1List.get(var2)); ++ } ++ } ++ ++ private Packet getPacketForThisEntity() { ++ if (this.myEntity.isDead) { ++ this.myEntity.worldObj.getWorldLogAgent().logWarning("Fetching addPacket for removed entity"); ++ } ++ ++ if (this.myEntity instanceof EntityItem) { ++ return new Packet23VehicleSpawn(this.myEntity, 2, 1); ++ } else if (this.myEntity instanceof EntityPlayerMP) { ++ return new Packet20NamedEntitySpawn((EntityPlayer)this.myEntity); ++ } else if (this.myEntity instanceof EntityMinecart) { ++ EntityMinecart var9 = (EntityMinecart)this.myEntity; ++ return new Packet23VehicleSpawn(this.myEntity, 10, var9.getMinecartType()); ++ } else if (this.myEntity instanceof EntityBoat) { ++ return new Packet23VehicleSpawn(this.myEntity, 1); ++ } else if (!(this.myEntity instanceof IAnimals) && !(this.myEntity instanceof EntityDragon)) { ++ if (this.myEntity instanceof EntityFishHook) { ++ EntityPlayer var8 = ((EntityFishHook)this.myEntity).angler; ++ return new Packet23VehicleSpawn(this.myEntity, 90, var8 != null ? var8.entityId : this.myEntity.entityId); ++ } else if (this.myEntity instanceof EntityArrow) { ++ Entity var7 = ((EntityArrow)this.myEntity).shootingEntity; ++ return new Packet23VehicleSpawn(this.myEntity, 60, var7 != null ? var7.entityId : this.myEntity.entityId); ++ } else if (this.myEntity instanceof EntitySnowball) { ++ return new Packet23VehicleSpawn(this.myEntity, 61); ++ } else if (this.myEntity instanceof EntityPotion) { ++ return new Packet23VehicleSpawn(this.myEntity, 73, ((EntityPotion)this.myEntity).getPotionDamage()); ++ } else if (this.myEntity instanceof EntityExpBottle) { ++ return new Packet23VehicleSpawn(this.myEntity, 75); ++ } else if (this.myEntity instanceof EntityEnderPearl) { ++ return new Packet23VehicleSpawn(this.myEntity, 65); ++ } else if (this.myEntity instanceof EntityEnderEye) { ++ return new Packet23VehicleSpawn(this.myEntity, 72); ++ } else if (this.myEntity instanceof EntityFireworkRocket) { ++ return new Packet23VehicleSpawn(this.myEntity, 76); + } else { + Packet23VehicleSpawn var2; +- if(this.trackedEntity instanceof EntityFireball) { +- EntityFireball var6 = (EntityFireball)this.trackedEntity; ++ ++ if (this.myEntity instanceof EntityFireball) { ++ EntityFireball var6 = (EntityFireball)this.myEntity; + var2 = null; + byte var3 = 63; +- if(this.trackedEntity instanceof EntitySmallFireball) { ++ ++ if (this.myEntity instanceof EntitySmallFireball) { + var3 = 64; +- } else if(this.trackedEntity instanceof EntityWitherSkull) { ++ } else if (this.myEntity instanceof EntityWitherSkull) { + var3 = 66; + } + +- if(var6.shootingEntity != null) { +- var2 = new Packet23VehicleSpawn(this.trackedEntity, var3, ((EntityFireball)this.trackedEntity).shootingEntity.entityId); ++ if (var6.shootingEntity != null) { ++ var2 = new Packet23VehicleSpawn(this.myEntity, var3, ((EntityFireball)this.myEntity).shootingEntity.entityId); + } else { +- var2 = new Packet23VehicleSpawn(this.trackedEntity, var3, 0); ++ var2 = new Packet23VehicleSpawn(this.myEntity, var3, 0); + } + + var2.speedX = (int)(var6.accelerationX * 8000.0D); + var2.speedY = (int)(var6.accelerationY * 8000.0D); + var2.speedZ = (int)(var6.accelerationZ * 8000.0D); + return var2; +- } else if(this.trackedEntity instanceof EntityEgg) { +- return new Packet23VehicleSpawn(this.trackedEntity, 62); +- } else if(this.trackedEntity instanceof EntityTNTPrimed) { +- return new Packet23VehicleSpawn(this.trackedEntity, 50); +- } else if(this.trackedEntity instanceof EntityEnderCrystal) { +- return new Packet23VehicleSpawn(this.trackedEntity, 51); +- } else if(this.trackedEntity instanceof EntityFallingSand) { +- EntityFallingSand var5 = (EntityFallingSand)this.trackedEntity; +- return new Packet23VehicleSpawn(this.trackedEntity, 70, var5.blockID | var5.metadata << 16); +- } else if(this.trackedEntity instanceof EntityPainting) { +- return new Packet25EntityPainting((EntityPainting)this.trackedEntity); +- } else if(this.trackedEntity instanceof EntityItemFrame) { +- EntityItemFrame var4 = (EntityItemFrame)this.trackedEntity; +- var2 = new Packet23VehicleSpawn(this.trackedEntity, 71, var4.hangingDirection); ++ } else if (this.myEntity instanceof EntityEgg) { ++ return new Packet23VehicleSpawn(this.myEntity, 62); ++ } else if (this.myEntity instanceof EntityTNTPrimed) { ++ return new Packet23VehicleSpawn(this.myEntity, 50); ++ } else if (this.myEntity instanceof EntityEnderCrystal) { ++ return new Packet23VehicleSpawn(this.myEntity, 51); ++ } else if (this.myEntity instanceof EntityFallingSand) { ++ EntityFallingSand var5 = (EntityFallingSand)this.myEntity; ++ return new Packet23VehicleSpawn(this.myEntity, 70, var5.blockID | var5.metadata << 16); ++ } else if (this.myEntity instanceof EntityPainting) { ++ return new Packet25EntityPainting((EntityPainting)this.myEntity); ++ } else if (this.myEntity instanceof EntityItemFrame) { ++ EntityItemFrame var4 = (EntityItemFrame)this.myEntity; ++ var2 = new Packet23VehicleSpawn(this.myEntity, 71, var4.hangingDirection); + var2.xPosition = MathHelper.floor_float((float)(var4.xPosition * 32)); + var2.yPosition = MathHelper.floor_float((float)(var4.yPosition * 32)); + var2.zPosition = MathHelper.floor_float((float)(var4.zPosition * 32)); + return var2; +- } else if(this.trackedEntity instanceof EntityLeashKnot) { +- EntityLeashKnot var1 = (EntityLeashKnot)this.trackedEntity; +- var2 = new Packet23VehicleSpawn(this.trackedEntity, 77); ++ } else if (this.myEntity instanceof EntityLeashKnot) { ++ EntityLeashKnot var1 = (EntityLeashKnot)this.myEntity; ++ var2 = new Packet23VehicleSpawn(this.myEntity, 77); + var2.xPosition = MathHelper.floor_float((float)(var1.xPosition * 32)); + var2.yPosition = MathHelper.floor_float((float)(var1.yPosition * 32)); + var2.zPosition = MathHelper.floor_float((float)(var1.zPosition * 32)); + return var2; +- } else if(this.trackedEntity instanceof EntityXPOrb) { +- return new Packet26EntityExpOrb((EntityXPOrb)this.trackedEntity); ++ } else if (this.myEntity instanceof EntityXPOrb) { ++ return new Packet26EntityExpOrb((EntityXPOrb)this.myEntity); + } else { +- throw new IllegalArgumentException("Don\'t know how to add " + this.trackedEntity.getClass() + "!"); ++ throw new IllegalArgumentException("Don\'t know how to add " + this.myEntity.getClass() + "!"); + } + } + } else { +- this.lastHeadMotion = MathHelper.floor_float(this.trackedEntity.getRotationYawHead() * 256.0F / 360.0F); +- return new Packet24MobSpawn((EntityLivingBase)this.trackedEntity); ++ this.lastHeadMotion = MathHelper.floor_float(this.myEntity.getRotationYawHead() * 256.0F / 360.0F); ++ return new Packet24MobSpawn((EntityLivingBase)this.myEntity); + } + } + +- public void removeTrackedPlayerSymmetric(EntityPlayerMP var1) { +- if(this.o.contains(var1)) { +- this.o.remove(var1); +- var1.g.add(Integer.valueOf(this.trackedEntity.entityId)); ++ public void removePlayerFromTracker(EntityPlayerMP par1EntityPlayerMP) { ++ if (this.trackingPlayers.contains(par1EntityPlayerMP)) { ++ this.trackingPlayers.remove(par1EntityPlayerMP); ++ par1EntityPlayerMP.destroyedItemsNetCache.add(Integer.valueOf(this.myEntity.entityId)); + } +- + } + } diff --git a/patches/net/minecraft/src/EntityVillager.java.patch b/patches/net/minecraft/src/EntityVillager.java.patch new file mode 100644 index 0000000..8620f93 --- /dev/null +++ b/patches/net/minecraft/src/EntityVillager.java.patch @@ -0,0 +1,918 @@ +--- net/minecraft/src/EntityVillager.java ++++ net/minecraft/src/EntityVillager.java +@@ -11,24 +11,41 @@ + private boolean isMating; + private boolean isPlaying; + Village villageObj; ++ ++ /** This villager's current customer. */ + private EntityPlayer buyingPlayer; ++ ++ /** Initialises the MerchantRecipeList.java */ + private MerchantRecipeList buyingList; + private int timeUntilReset; ++ ++ /** addDefaultEquipmentAndRecipies is called if this is true */ + private boolean needsInitilization; + private int wealth; +- private String by; ++ ++ /** Last player to trade with this villager, used for aggressivity. */ ++ private String lastBuyingPlayer; + private boolean field_82190_bM; + private float field_82191_bN; +- private static final Map bB = new HashMap(); +- private static final Map bC = new HashMap(); +- +- public EntityVillager(World var1) { +- this(var1, 0); ++ ++ /** ++ * a villagers recipe list is intialized off this list ; the 2 params are min/max amount they will trade for 1 emerald ++ */ ++ private static final Map villagerStockList = new HashMap(); ++ ++ /** ++ * Selling list of Blacksmith items. negative numbers mean 1 emerald for n items, positive numbers are n emeralds for 1 ++ * item ++ */ ++ private static final Map blacksmithSellingList = new HashMap(); ++ ++ public EntityVillager(World par1World) { ++ this(par1World, 0); + } + +- public EntityVillager(World var1, int var2) { +- super(var1); +- this.setProfession(var2); ++ public EntityVillager(World par1World, int par2) { ++ super(par1World); ++ this.setProfession(par2); + this.setSize(0.6F, 1.8F); + this.getNavigator().setBreakDoors(true); + this.getNavigator().setAvoidsWater(true); +@@ -54,47 +71,58 @@ + this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setAttribute(0.5D); + } + ++ /** ++ * Returns true if the newer Entity AI code should be run ++ */ + public boolean isAIEnabled() { + return true; + } + ++ /** ++ * main AI tick function, replaces updateEntityActionState ++ */ + protected void updateAITick() { +- if(--this.randomTickDivider <= 0) { ++ if (--this.randomTickDivider <= 0) { + this.worldObj.villageCollectionObj.addVillagerPosition(MathHelper.floor_double(this.posX), MathHelper.floor_double(this.posY), MathHelper.floor_double(this.posZ)); +- this.randomTickDivider = 70 + this.ab.nextInt(50); ++ this.randomTickDivider = 70 + this.rand.nextInt(50); + this.villageObj = this.worldObj.villageCollectionObj.findNearestVillage(MathHelper.floor_double(this.posX), MathHelper.floor_double(this.posY), MathHelper.floor_double(this.posZ), 32); +- if(this.villageObj == null) { ++ ++ if (this.villageObj == null) { + this.detachHome(); + } else { + ChunkCoordinates var1 = this.villageObj.getCenter(); + this.setHomeArea(var1.posX, var1.posY, var1.posZ, (int)((float)this.villageObj.getVillageRadius() * 0.6F)); +- if(this.field_82190_bM) { ++ ++ if (this.field_82190_bM) { + this.field_82190_bM = false; + this.villageObj.func_82683_b(5); + } + } + } + +- if(!this.isTrading() && this.timeUntilReset > 0) { ++ if (!this.isTrading() && this.timeUntilReset > 0) { + --this.timeUntilReset; +- if(this.timeUntilReset <= 0) { +- if(this.needsInitilization) { +- if(this.buyingList.size() > 1) { ++ ++ if (this.timeUntilReset <= 0) { ++ if (this.needsInitilization) { ++ if (this.buyingList.size() > 1) { + Iterator var3 = this.buyingList.iterator(); + +- while(var3.hasNext()) { ++ while (var3.hasNext()) { + MerchantRecipe var2 = (MerchantRecipe)var3.next(); +- if(var2.func_82784_g()) { +- var2.func_82783_a(this.ab.nextInt(6) + this.ab.nextInt(6) + 2); ++ ++ if (var2.func_82784_g()) { ++ var2.func_82783_a(this.rand.nextInt(6) + this.rand.nextInt(6) + 2); + } + } + } + + this.addDefaultEquipmentAndRecipies(1); + this.needsInitilization = false; +- if(this.villageObj != null && this.by != null) { ++ ++ if (this.villageObj != null && this.lastBuyingPlayer != null) { + this.worldObj.setEntityState(this, (byte)14); +- this.villageObj.setReputationForPlayer(this.by, 1); ++ this.villageObj.setReputationForPlayer(this.lastBuyingPlayer, 1); + } + } + +@@ -105,18 +133,22 @@ + super.updateAITick(); + } + +- public boolean interact(EntityPlayer var1) { +- ItemStack var2 = var1.inventory.getCurrentItem(); ++ /** ++ * Called when a player interacts with a mob. e.g. gets milk from a cow, gets into the saddle on a pig. ++ */ ++ public boolean interact(EntityPlayer par1EntityPlayer) { ++ ItemStack var2 = par1EntityPlayer.inventory.getCurrentItem(); + boolean var3 = var2 != null && var2.itemID == Item.monsterPlacer.itemID; +- if(!var3 && this.isEntityAlive() && !this.isTrading() && !this.isChild()) { +- if(!this.worldObj.isRemote) { +- this.setCustomer(var1); +- var1.displayGUIMerchant(this, this.getCustomNameTag()); ++ ++ if (!var3 && this.isEntityAlive() && !this.isTrading() && !this.isChild()) { ++ if (!this.worldObj.isRemote) { ++ this.setCustomer(par1EntityPlayer); ++ par1EntityPlayer.displayGUIMerchant(this, this.getCustomNameTag()); + } + + return true; + } else { +- return super.interact(var1); ++ return super.interact(par1EntityPlayer); + } + } + +@@ -125,45 +157,63 @@ + this.dataWatcher.addObject(16, Integer.valueOf(0)); + } + +- public void writeEntityToNBT(NBTTagCompound var1) { +- super.writeEntityToNBT(var1); +- var1.setInteger("Profession", this.getProfession()); +- var1.setInteger("Riches", this.wealth); +- if(this.buyingList != null) { +- var1.setCompoundTag("Offers", this.buyingList.getRecipiesAsTags()); ++ /** ++ * (abstract) Protected helper method to write subclass entity data to NBT. ++ */ ++ public void writeEntityToNBT(NBTTagCompound par1NBTTagCompound) { ++ super.writeEntityToNBT(par1NBTTagCompound); ++ par1NBTTagCompound.setInteger("Profession", this.getProfession()); ++ par1NBTTagCompound.setInteger("Riches", this.wealth); ++ ++ if (this.buyingList != null) { ++ par1NBTTagCompound.setCompoundTag("Offers", this.buyingList.getRecipiesAsTags()); + } +- + } + +- public void readEntityFromNBT(NBTTagCompound var1) { +- super.readEntityFromNBT(var1); +- this.setProfession(var1.getInteger("Profession")); +- this.wealth = var1.getInteger("Riches"); +- if(var1.hasKey("Offers")) { +- NBTTagCompound var2 = var1.getCompoundTag("Offers"); ++ /** ++ * (abstract) Protected helper method to read subclass entity data from NBT. ++ */ ++ public void readEntityFromNBT(NBTTagCompound par1NBTTagCompound) { ++ super.readEntityFromNBT(par1NBTTagCompound); ++ this.setProfession(par1NBTTagCompound.getInteger("Profession")); ++ this.wealth = par1NBTTagCompound.getInteger("Riches"); ++ ++ if (par1NBTTagCompound.hasKey("Offers")) { ++ NBTTagCompound var2 = par1NBTTagCompound.getCompoundTag("Offers"); + this.buyingList = new MerchantRecipeList(var2); + } +- + } + ++ /** ++ * Determines if an entity can be despawned, used on idle far away entities ++ */ + protected boolean canDespawn() { + return false; + } + ++ /** ++ * Returns the sound this mob makes while it's alive. ++ */ + protected String getLivingSound() { + return this.isTrading() ? "mob.villager.haggle" : "mob.villager.idle"; + } + ++ /** ++ * Returns the sound this mob makes when it is hurt. ++ */ + protected String getHurtSound() { + return "mob.villager.hit"; + } + ++ /** ++ * Returns the sound this mob makes on death. ++ */ + protected String getDeathSound() { + return "mob.villager.death"; + } + +- public void setProfession(int var1) { +- this.dataWatcher.updateObject(16, Integer.valueOf(var1)); ++ public void setProfession(int par1) { ++ this.dataWatcher.updateObject(16, Integer.valueOf(par1)); + } + + public int getProfession() { +@@ -174,59 +224,67 @@ + return this.isMating; + } + +- public void setMating(boolean var1) { +- this.isMating = var1; ++ public void setMating(boolean par1) { ++ this.isMating = par1; + } + +- public void setPlaying(boolean var1) { +- this.isPlaying = var1; ++ public void setPlaying(boolean par1) { ++ this.isPlaying = par1; + } + + public boolean isPlaying() { + return this.isPlaying; + } + +- public void setRevengeTarget(EntityLivingBase var1) { +- super.setRevengeTarget(var1); +- if(this.villageObj != null && var1 != null) { +- this.villageObj.addOrRenewAgressor(var1); +- if(var1 instanceof EntityPlayer) { ++ public void setRevengeTarget(EntityLivingBase par1EntityLivingBase) { ++ super.setRevengeTarget(par1EntityLivingBase); ++ ++ if (this.villageObj != null && par1EntityLivingBase != null) { ++ this.villageObj.addOrRenewAgressor(par1EntityLivingBase); ++ ++ if (par1EntityLivingBase instanceof EntityPlayer) { + byte var2 = -1; +- if(this.isChild()) { ++ ++ if (this.isChild()) { + var2 = -3; + } + +- this.villageObj.setReputationForPlayer(((EntityPlayer)var1).getCommandSenderName(), var2); +- if(this.isEntityAlive()) { ++ this.villageObj.setReputationForPlayer(((EntityPlayer)par1EntityLivingBase).getCommandSenderName(), var2); ++ ++ if (this.isEntityAlive()) { + this.worldObj.setEntityState(this, (byte)13); + } + } + } +- + } + +- public void onDeath(DamageSource var1) { +- if(this.villageObj != null) { +- Entity var2 = var1.getEntity(); +- if(var2 != null) { +- if(var2 instanceof EntityPlayer) { ++ /** ++ * Called when the mob's health reaches 0. ++ */ ++ public void onDeath(DamageSource par1DamageSource) { ++ if (this.villageObj != null) { ++ Entity var2 = par1DamageSource.getEntity(); ++ ++ if (var2 != null) { ++ if (var2 instanceof EntityPlayer) { + this.villageObj.setReputationForPlayer(((EntityPlayer)var2).getCommandSenderName(), -2); +- } else if(var2 instanceof IMob) { ++ } else if (var2 instanceof IMob) { + this.villageObj.endMatingSeason(); + } +- } else if(var2 == null) { ++ } else if (var2 == null) { + EntityPlayer var3 = this.worldObj.getClosestPlayerToEntity(this, 16.0D); +- if(var3 != null) { ++ ++ if (var3 != null) { + this.villageObj.endMatingSeason(); + } + } + } + +- super.onDeath(var1); ++ super.onDeath(par1DamageSource); + } + +- public void setCustomer(EntityPlayer var1) { +- this.buyingPlayer = var1; ++ public void setCustomer(EntityPlayer par1EntityPlayer) { ++ this.buyingPlayer = par1EntityPlayer; + } + + public EntityPlayer getCustomer() { +@@ -237,53 +295,61 @@ + return this.buyingPlayer != null; + } + +- public void useRecipe(MerchantRecipe var1) { +- var1.incrementToolUses(); ++ public void useRecipe(MerchantRecipe par1MerchantRecipe) { ++ par1MerchantRecipe.incrementToolUses(); + this.livingSoundTime = -this.getTalkInterval(); + this.playSound("mob.villager.yes", this.getSoundVolume(), this.getSoundPitch()); +- if(var1.hasSameIDsAs((MerchantRecipe)this.buyingList.get(this.buyingList.size() - 1))) { ++ ++ if (par1MerchantRecipe.hasSameIDsAs((MerchantRecipe)this.buyingList.get(this.buyingList.size() - 1))) { + this.timeUntilReset = 40; + this.needsInitilization = true; +- if(this.buyingPlayer != null) { +- this.by = this.buyingPlayer.getCommandSenderName(); ++ ++ if (this.buyingPlayer != null) { ++ this.lastBuyingPlayer = this.buyingPlayer.getCommandSenderName(); + } else { +- this.by = null; ++ this.lastBuyingPlayer = null; + } + } + +- if(var1.getItemToBuy().itemID == Item.emerald.itemID) { +- this.wealth += var1.getItemToBuy().stackSize; ++ if (par1MerchantRecipe.getItemToBuy().itemID == Item.emerald.itemID) { ++ this.wealth += par1MerchantRecipe.getItemToBuy().stackSize; + } +- + } + +- public void func_110297_a_(ItemStack var1) { +- if(!this.worldObj.isRemote && this.livingSoundTime > -this.getTalkInterval() + 20) { ++ public void func_110297_a_(ItemStack par1ItemStack) { ++ if (!this.worldObj.isRemote && this.livingSoundTime > -this.getTalkInterval() + 20) { + this.livingSoundTime = -this.getTalkInterval(); +- if(var1 != null) { ++ ++ if (par1ItemStack != null) { + this.playSound("mob.villager.yes", this.getSoundVolume(), this.getSoundPitch()); + } else { + this.playSound("mob.villager.no", this.getSoundVolume(), this.getSoundPitch()); + } + } +- + } + +- public MerchantRecipeList getRecipes(EntityPlayer var1) { +- if(this.buyingList == null) { ++ public MerchantRecipeList getRecipes(EntityPlayer par1EntityPlayer) { ++ if (this.buyingList == null) { + this.addDefaultEquipmentAndRecipies(1); + } + + return this.buyingList; + } + +- private float adjustProbability(float var1) { +- float var2 = var1 + this.field_82191_bN; ++ /** ++ * Adjusts the probability of obtaining a given recipe being offered by a villager ++ */ ++ private float adjustProbability(float par1) { ++ float var2 = par1 + this.field_82191_bN; + return var2 > 0.9F ? 0.9F - (var2 - 0.9F) : var2; + } + +- private void addDefaultEquipmentAndRecipies(int var1) { +- if(this.buyingList != null) { ++ /** ++ * based on the villagers profession add items, equipment, and recipies adds par1 random items to the list of things ++ * that the villager wants to buy. (at most 1 of each wanted type is added) ++ */ ++ private void addDefaultEquipmentAndRecipies(int par1) { ++ if (this.buyingList != null) { + this.field_82191_bN = MathHelper.sqrt_float((float)this.buyingList.size()) * 0.2F; + } else { + this.field_82191_bN = 0.0F; +@@ -293,194 +359,209 @@ + var2 = new MerchantRecipeList(); + int var6; + label50: +- switch(this.getProfession()) { +- case 0: +- addMerchantItem(var2, Item.wheat.itemID, this.ab, this.adjustProbability(0.9F)); +- addMerchantItem(var2, Block.cloth.blockID, this.ab, this.adjustProbability(0.5F)); +- addMerchantItem(var2, Item.chickenRaw.itemID, this.ab, this.adjustProbability(0.5F)); +- addMerchantItem(var2, Item.fishCooked.itemID, this.ab, this.adjustProbability(0.4F)); +- addBlacksmithItem(var2, Item.bread.itemID, this.ab, this.adjustProbability(0.9F)); +- addBlacksmithItem(var2, Item.melon.itemID, this.ab, this.adjustProbability(0.3F)); +- addBlacksmithItem(var2, Item.appleRed.itemID, this.ab, this.adjustProbability(0.3F)); +- addBlacksmithItem(var2, Item.cookie.itemID, this.ab, this.adjustProbability(0.3F)); +- addBlacksmithItem(var2, Item.shears.itemID, this.ab, this.adjustProbability(0.3F)); +- addBlacksmithItem(var2, Item.flintAndSteel.itemID, this.ab, this.adjustProbability(0.3F)); +- addBlacksmithItem(var2, Item.chickenCooked.itemID, this.ab, this.adjustProbability(0.3F)); +- addBlacksmithItem(var2, Item.arrow.itemID, this.ab, this.adjustProbability(0.5F)); +- if(this.ab.nextFloat() < this.adjustProbability(0.5F)) { +- var2.add(new MerchantRecipe(new ItemStack(Block.gravel, 10), new ItemStack(Item.emerald), new ItemStack(Item.flint.itemID, 4 + this.ab.nextInt(2), 0))); +- } +- break; +- case 1: +- addMerchantItem(var2, Item.paper.itemID, this.ab, this.adjustProbability(0.8F)); +- addMerchantItem(var2, Item.book.itemID, this.ab, this.adjustProbability(0.8F)); +- addMerchantItem(var2, Item.writtenBook.itemID, this.ab, this.adjustProbability(0.3F)); +- addBlacksmithItem(var2, Block.bookShelf.blockID, this.ab, this.adjustProbability(0.8F)); +- addBlacksmithItem(var2, Block.glass.blockID, this.ab, this.adjustProbability(0.2F)); +- addBlacksmithItem(var2, Item.compass.itemID, this.ab, this.adjustProbability(0.2F)); +- addBlacksmithItem(var2, Item.pocketSundial.itemID, this.ab, this.adjustProbability(0.2F)); +- if(this.ab.nextFloat() < this.adjustProbability(0.07F)) { +- Enchantment var8 = Enchantment.enchantmentsBookList[this.ab.nextInt(Enchantment.enchantmentsBookList.length)]; +- int var10 = MathHelper.getRandomIntegerInRange(this.ab, var8.getMinLevel(), var8.getMaxLevel()); +- ItemStack var11 = Item.enchantedBook.getEnchantedItemStack(new EnchantmentData(var8, var10)); +- var6 = 2 + this.ab.nextInt(5 + var10 * 10) + 3 * var10; +- var2.add(new MerchantRecipe(new ItemStack(Item.book), new ItemStack(Item.emerald, var6), var11)); +- } +- break; +- case 2: +- addBlacksmithItem(var2, Item.eyeOfEnder.itemID, this.ab, this.adjustProbability(0.3F)); +- addBlacksmithItem(var2, Item.expBottle.itemID, this.ab, this.adjustProbability(0.2F)); +- addBlacksmithItem(var2, Item.redstone.itemID, this.ab, this.adjustProbability(0.4F)); +- addBlacksmithItem(var2, Block.glowStone.blockID, this.ab, this.adjustProbability(0.3F)); +- int[] var3 = new int[]{Item.swordIron.itemID, Item.swordDiamond.itemID, Item.plateIron.itemID, Item.plateDiamond.itemID, Item.axeIron.itemID, Item.axeDiamond.itemID, Item.pickaxeIron.itemID, Item.pickaxeDiamond.itemID}; +- int[] var4 = var3; +- int var5 = var3.length; +- var6 = 0; +- +- while(true) { +- if(var6 >= var5) { +- break label50; +- } +- +- int var7 = var4[var6]; +- if(this.ab.nextFloat() < this.adjustProbability(0.05F)) { +- var2.add(new MerchantRecipe(new ItemStack(var7, 1, 0), new ItemStack(Item.emerald, 2 + this.ab.nextInt(3), 0), EnchantmentHelper.addRandomEnchantment(this.ab, new ItemStack(var7, 1, 0), 5 + this.ab.nextInt(15)))); +- } +- +- ++var6; +- } +- case 3: +- addMerchantItem(var2, Item.coal.itemID, this.ab, this.adjustProbability(0.7F)); +- addMerchantItem(var2, Item.ingotIron.itemID, this.ab, this.adjustProbability(0.5F)); +- addMerchantItem(var2, Item.ingotGold.itemID, this.ab, this.adjustProbability(0.5F)); +- addMerchantItem(var2, Item.diamond.itemID, this.ab, this.adjustProbability(0.5F)); +- addBlacksmithItem(var2, Item.swordIron.itemID, this.ab, this.adjustProbability(0.5F)); +- addBlacksmithItem(var2, Item.swordDiamond.itemID, this.ab, this.adjustProbability(0.5F)); +- addBlacksmithItem(var2, Item.axeIron.itemID, this.ab, this.adjustProbability(0.3F)); +- addBlacksmithItem(var2, Item.axeDiamond.itemID, this.ab, this.adjustProbability(0.3F)); +- addBlacksmithItem(var2, Item.pickaxeIron.itemID, this.ab, this.adjustProbability(0.5F)); +- addBlacksmithItem(var2, Item.pickaxeDiamond.itemID, this.ab, this.adjustProbability(0.5F)); +- addBlacksmithItem(var2, Item.shovelIron.itemID, this.ab, this.adjustProbability(0.2F)); +- addBlacksmithItem(var2, Item.shovelDiamond.itemID, this.ab, this.adjustProbability(0.2F)); +- addBlacksmithItem(var2, Item.hoeIron.itemID, this.ab, this.adjustProbability(0.2F)); +- addBlacksmithItem(var2, Item.hoeDiamond.itemID, this.ab, this.adjustProbability(0.2F)); +- addBlacksmithItem(var2, Item.bootsIron.itemID, this.ab, this.adjustProbability(0.2F)); +- addBlacksmithItem(var2, Item.bootsDiamond.itemID, this.ab, this.adjustProbability(0.2F)); +- addBlacksmithItem(var2, Item.helmetIron.itemID, this.ab, this.adjustProbability(0.2F)); +- addBlacksmithItem(var2, Item.helmetDiamond.itemID, this.ab, this.adjustProbability(0.2F)); +- addBlacksmithItem(var2, Item.plateIron.itemID, this.ab, this.adjustProbability(0.2F)); +- addBlacksmithItem(var2, Item.plateDiamond.itemID, this.ab, this.adjustProbability(0.2F)); +- addBlacksmithItem(var2, Item.legsIron.itemID, this.ab, this.adjustProbability(0.2F)); +- addBlacksmithItem(var2, Item.legsDiamond.itemID, this.ab, this.adjustProbability(0.2F)); +- addBlacksmithItem(var2, Item.bootsChain.itemID, this.ab, this.adjustProbability(0.1F)); +- addBlacksmithItem(var2, Item.helmetChain.itemID, this.ab, this.adjustProbability(0.1F)); +- addBlacksmithItem(var2, Item.plateChain.itemID, this.ab, this.adjustProbability(0.1F)); +- addBlacksmithItem(var2, Item.legsChain.itemID, this.ab, this.adjustProbability(0.1F)); +- break; +- case 4: +- addMerchantItem(var2, Item.coal.itemID, this.ab, this.adjustProbability(0.7F)); +- addMerchantItem(var2, Item.porkRaw.itemID, this.ab, this.adjustProbability(0.5F)); +- addMerchantItem(var2, Item.beefRaw.itemID, this.ab, this.adjustProbability(0.5F)); +- addBlacksmithItem(var2, Item.saddle.itemID, this.ab, this.adjustProbability(0.1F)); +- addBlacksmithItem(var2, Item.plateLeather.itemID, this.ab, this.adjustProbability(0.3F)); +- addBlacksmithItem(var2, Item.bootsLeather.itemID, this.ab, this.adjustProbability(0.3F)); +- addBlacksmithItem(var2, Item.helmetLeather.itemID, this.ab, this.adjustProbability(0.3F)); +- addBlacksmithItem(var2, Item.legsLeather.itemID, this.ab, this.adjustProbability(0.3F)); +- addBlacksmithItem(var2, Item.porkCooked.itemID, this.ab, this.adjustProbability(0.3F)); +- addBlacksmithItem(var2, Item.beefCooked.itemID, this.ab, this.adjustProbability(0.3F)); ++ ++ switch (this.getProfession()) { ++ case 0: ++ addMerchantItem(var2, Item.wheat.itemID, this.rand, this.adjustProbability(0.9F)); ++ addMerchantItem(var2, Block.cloth.blockID, this.rand, this.adjustProbability(0.5F)); ++ addMerchantItem(var2, Item.chickenRaw.itemID, this.rand, this.adjustProbability(0.5F)); ++ addMerchantItem(var2, Item.fishCooked.itemID, this.rand, this.adjustProbability(0.4F)); ++ addBlacksmithItem(var2, Item.bread.itemID, this.rand, this.adjustProbability(0.9F)); ++ addBlacksmithItem(var2, Item.melon.itemID, this.rand, this.adjustProbability(0.3F)); ++ addBlacksmithItem(var2, Item.appleRed.itemID, this.rand, this.adjustProbability(0.3F)); ++ addBlacksmithItem(var2, Item.cookie.itemID, this.rand, this.adjustProbability(0.3F)); ++ addBlacksmithItem(var2, Item.shears.itemID, this.rand, this.adjustProbability(0.3F)); ++ addBlacksmithItem(var2, Item.flintAndSteel.itemID, this.rand, this.adjustProbability(0.3F)); ++ addBlacksmithItem(var2, Item.chickenCooked.itemID, this.rand, this.adjustProbability(0.3F)); ++ addBlacksmithItem(var2, Item.arrow.itemID, this.rand, this.adjustProbability(0.5F)); ++ ++ if (this.rand.nextFloat() < this.adjustProbability(0.5F)) { ++ var2.add(new MerchantRecipe(new ItemStack(Block.gravel, 10), new ItemStack(Item.emerald), new ItemStack(Item.flint.itemID, 4 + this.rand.nextInt(2), 0))); ++ } ++ ++ break; ++ ++ case 1: ++ addMerchantItem(var2, Item.paper.itemID, this.rand, this.adjustProbability(0.8F)); ++ addMerchantItem(var2, Item.book.itemID, this.rand, this.adjustProbability(0.8F)); ++ addMerchantItem(var2, Item.writtenBook.itemID, this.rand, this.adjustProbability(0.3F)); ++ addBlacksmithItem(var2, Block.bookShelf.blockID, this.rand, this.adjustProbability(0.8F)); ++ addBlacksmithItem(var2, Block.glass.blockID, this.rand, this.adjustProbability(0.2F)); ++ addBlacksmithItem(var2, Item.compass.itemID, this.rand, this.adjustProbability(0.2F)); ++ addBlacksmithItem(var2, Item.pocketSundial.itemID, this.rand, this.adjustProbability(0.2F)); ++ ++ if (this.rand.nextFloat() < this.adjustProbability(0.07F)) { ++ Enchantment var8 = Enchantment.enchantmentsBookList[this.rand.nextInt(Enchantment.enchantmentsBookList.length)]; ++ int var10 = MathHelper.getRandomIntegerInRange(this.rand, var8.getMinLevel(), var8.getMaxLevel()); ++ ItemStack var11 = Item.enchantedBook.getEnchantedItemStack(new EnchantmentData(var8, var10)); ++ var6 = 2 + this.rand.nextInt(5 + var10 * 10) + 3 * var10; ++ var2.add(new MerchantRecipe(new ItemStack(Item.book), new ItemStack(Item.emerald, var6), var11)); ++ } ++ ++ break; ++ ++ case 2: ++ addBlacksmithItem(var2, Item.eyeOfEnder.itemID, this.rand, this.adjustProbability(0.3F)); ++ addBlacksmithItem(var2, Item.expBottle.itemID, this.rand, this.adjustProbability(0.2F)); ++ addBlacksmithItem(var2, Item.redstone.itemID, this.rand, this.adjustProbability(0.4F)); ++ addBlacksmithItem(var2, Block.glowStone.blockID, this.rand, this.adjustProbability(0.3F)); ++ int[] var3 = new int[] {Item.swordIron.itemID, Item.swordDiamond.itemID, Item.plateIron.itemID, Item.plateDiamond.itemID, Item.axeIron.itemID, Item.axeDiamond.itemID, Item.pickaxeIron.itemID, Item.pickaxeDiamond.itemID}; ++ int[] var4 = var3; ++ int var5 = var3.length; ++ var6 = 0; ++ ++ while (true) { ++ if (var6 >= var5) { ++ break label50; ++ } ++ ++ int var7 = var4[var6]; ++ ++ if (this.rand.nextFloat() < this.adjustProbability(0.05F)) { ++ var2.add(new MerchantRecipe(new ItemStack(var7, 1, 0), new ItemStack(Item.emerald, 2 + this.rand.nextInt(3), 0), EnchantmentHelper.addRandomEnchantment(this.rand, new ItemStack(var7, 1, 0), 5 + this.rand.nextInt(15)))); ++ } ++ ++ ++var6; ++ } ++ ++ case 3: ++ addMerchantItem(var2, Item.coal.itemID, this.rand, this.adjustProbability(0.7F)); ++ addMerchantItem(var2, Item.ingotIron.itemID, this.rand, this.adjustProbability(0.5F)); ++ addMerchantItem(var2, Item.ingotGold.itemID, this.rand, this.adjustProbability(0.5F)); ++ addMerchantItem(var2, Item.diamond.itemID, this.rand, this.adjustProbability(0.5F)); ++ addBlacksmithItem(var2, Item.swordIron.itemID, this.rand, this.adjustProbability(0.5F)); ++ addBlacksmithItem(var2, Item.swordDiamond.itemID, this.rand, this.adjustProbability(0.5F)); ++ addBlacksmithItem(var2, Item.axeIron.itemID, this.rand, this.adjustProbability(0.3F)); ++ addBlacksmithItem(var2, Item.axeDiamond.itemID, this.rand, this.adjustProbability(0.3F)); ++ addBlacksmithItem(var2, Item.pickaxeIron.itemID, this.rand, this.adjustProbability(0.5F)); ++ addBlacksmithItem(var2, Item.pickaxeDiamond.itemID, this.rand, this.adjustProbability(0.5F)); ++ addBlacksmithItem(var2, Item.shovelIron.itemID, this.rand, this.adjustProbability(0.2F)); ++ addBlacksmithItem(var2, Item.shovelDiamond.itemID, this.rand, this.adjustProbability(0.2F)); ++ addBlacksmithItem(var2, Item.hoeIron.itemID, this.rand, this.adjustProbability(0.2F)); ++ addBlacksmithItem(var2, Item.hoeDiamond.itemID, this.rand, this.adjustProbability(0.2F)); ++ addBlacksmithItem(var2, Item.bootsIron.itemID, this.rand, this.adjustProbability(0.2F)); ++ addBlacksmithItem(var2, Item.bootsDiamond.itemID, this.rand, this.adjustProbability(0.2F)); ++ addBlacksmithItem(var2, Item.helmetIron.itemID, this.rand, this.adjustProbability(0.2F)); ++ addBlacksmithItem(var2, Item.helmetDiamond.itemID, this.rand, this.adjustProbability(0.2F)); ++ addBlacksmithItem(var2, Item.plateIron.itemID, this.rand, this.adjustProbability(0.2F)); ++ addBlacksmithItem(var2, Item.plateDiamond.itemID, this.rand, this.adjustProbability(0.2F)); ++ addBlacksmithItem(var2, Item.legsIron.itemID, this.rand, this.adjustProbability(0.2F)); ++ addBlacksmithItem(var2, Item.legsDiamond.itemID, this.rand, this.adjustProbability(0.2F)); ++ addBlacksmithItem(var2, Item.bootsChain.itemID, this.rand, this.adjustProbability(0.1F)); ++ addBlacksmithItem(var2, Item.helmetChain.itemID, this.rand, this.adjustProbability(0.1F)); ++ addBlacksmithItem(var2, Item.plateChain.itemID, this.rand, this.adjustProbability(0.1F)); ++ addBlacksmithItem(var2, Item.legsChain.itemID, this.rand, this.adjustProbability(0.1F)); ++ break; ++ ++ case 4: ++ addMerchantItem(var2, Item.coal.itemID, this.rand, this.adjustProbability(0.7F)); ++ addMerchantItem(var2, Item.porkRaw.itemID, this.rand, this.adjustProbability(0.5F)); ++ addMerchantItem(var2, Item.beefRaw.itemID, this.rand, this.adjustProbability(0.5F)); ++ addBlacksmithItem(var2, Item.saddle.itemID, this.rand, this.adjustProbability(0.1F)); ++ addBlacksmithItem(var2, Item.plateLeather.itemID, this.rand, this.adjustProbability(0.3F)); ++ addBlacksmithItem(var2, Item.bootsLeather.itemID, this.rand, this.adjustProbability(0.3F)); ++ addBlacksmithItem(var2, Item.helmetLeather.itemID, this.rand, this.adjustProbability(0.3F)); ++ addBlacksmithItem(var2, Item.legsLeather.itemID, this.rand, this.adjustProbability(0.3F)); ++ addBlacksmithItem(var2, Item.porkCooked.itemID, this.rand, this.adjustProbability(0.3F)); ++ addBlacksmithItem(var2, Item.beefCooked.itemID, this.rand, this.adjustProbability(0.3F)); + } + +- if(var2.isEmpty()) { +- addMerchantItem(var2, Item.ingotGold.itemID, this.ab, 1.0F); ++ if (var2.isEmpty()) { ++ addMerchantItem(var2, Item.ingotGold.itemID, this.rand, 1.0F); + } + + Collections.shuffle(var2); +- if(this.buyingList == null) { ++ ++ if (this.buyingList == null) { + this.buyingList = new MerchantRecipeList(); + } + +- for(int var9 = 0; var9 < var1 && var9 < var2.size(); ++var9) { ++ for (int var9 = 0; var9 < par1 && var9 < var2.size(); ++var9) { + this.buyingList.addToListWithCheck((MerchantRecipe)var2.get(var9)); + } +- +- } +- +- public void setRecipes(MerchantRecipeList var1) { +- } +- +- private static void addMerchantItem(MerchantRecipeList var0, int var1, Random var2, float var3) { +- if(var2.nextFloat() < var3) { +- var0.add(new MerchantRecipe(getRandomSizedStack(var1, var2), Item.emerald)); ++ } ++ ++ public void setRecipes(MerchantRecipeList par1MerchantRecipeList) {} ++ ++ /** ++ * each recipie takes a random stack from villagerStockList and offers it for 1 emerald ++ */ ++ private static void addMerchantItem(MerchantRecipeList par0MerchantRecipeList, int par1, Random par2Random, float par3) { ++ if (par2Random.nextFloat() < par3) { ++ par0MerchantRecipeList.add(new MerchantRecipe(getRandomSizedStack(par1, par2Random), Item.emerald)); + } +- +- } +- +- private static ItemStack getRandomSizedStack(int var0, Random var1) { +- return new ItemStack(var0, getRandomCountForItem(var0, var1), 0); +- } +- +- private static int getRandomCountForItem(int var0, Random var1) { +- Tuple var2 = (Tuple)bB.get(Integer.valueOf(var0)); +- return var2 == null ? 1 : (((Integer)var2.getFirst()).intValue() >= ((Integer)var2.getSecond()).intValue() ? ((Integer)var2.getFirst()).intValue() : ((Integer)var2.getFirst()).intValue() + var1.nextInt(((Integer)var2.getSecond()).intValue() - ((Integer)var2.getFirst()).intValue())); +- } +- +- private static void addBlacksmithItem(MerchantRecipeList var0, int var1, Random var2, float var3) { +- if(var2.nextFloat() < var3) { +- int var4 = getRandomCountForBlacksmithItem(var1, var2); ++ } ++ ++ private static ItemStack getRandomSizedStack(int par0, Random par1Random) { ++ return new ItemStack(par0, getRandomCountForItem(par0, par1Random), 0); ++ } ++ ++ /** ++ * default to 1, and villagerStockList contains a min/max amount for each index ++ */ ++ private static int getRandomCountForItem(int par0, Random par1Random) { ++ Tuple var2 = (Tuple)villagerStockList.get(Integer.valueOf(par0)); ++ return var2 == null ? 1 : (((Integer)var2.getFirst()).intValue() >= ((Integer)var2.getSecond()).intValue() ? ((Integer)var2.getFirst()).intValue() : ((Integer)var2.getFirst()).intValue() + par1Random.nextInt(((Integer)var2.getSecond()).intValue() - ((Integer)var2.getFirst()).intValue())); ++ } ++ ++ private static void addBlacksmithItem(MerchantRecipeList par0MerchantRecipeList, int par1, Random par2Random, float par3) { ++ if (par2Random.nextFloat() < par3) { ++ int var4 = getRandomCountForBlacksmithItem(par1, par2Random); + ItemStack var5; + ItemStack var6; +- if(var4 < 0) { ++ ++ if (var4 < 0) { + var5 = new ItemStack(Item.emerald.itemID, 1, 0); +- var6 = new ItemStack(var1, -var4, 0); ++ var6 = new ItemStack(par1, -var4, 0); + } else { + var5 = new ItemStack(Item.emerald.itemID, var4, 0); +- var6 = new ItemStack(var1, 1, 0); ++ var6 = new ItemStack(par1, 1, 0); + } + +- var0.add(new MerchantRecipe(var5, var6)); ++ par0MerchantRecipeList.add(new MerchantRecipe(var5, var6)); + } +- +- } +- +- private static int getRandomCountForBlacksmithItem(int var0, Random var1) { +- Tuple var2 = (Tuple)bC.get(Integer.valueOf(var0)); +- return var2 == null ? 1 : (((Integer)var2.getFirst()).intValue() >= ((Integer)var2.getSecond()).intValue() ? ((Integer)var2.getFirst()).intValue() : ((Integer)var2.getFirst()).intValue() + var1.nextInt(((Integer)var2.getSecond()).intValue() - ((Integer)var2.getFirst()).intValue())); +- } +- +- public void handleHealthUpdate(byte var1) { +- if(var1 == 12) { ++ } ++ ++ private static int getRandomCountForBlacksmithItem(int par0, Random par1Random) { ++ Tuple var2 = (Tuple)blacksmithSellingList.get(Integer.valueOf(par0)); ++ return var2 == null ? 1 : (((Integer)var2.getFirst()).intValue() >= ((Integer)var2.getSecond()).intValue() ? ((Integer)var2.getFirst()).intValue() : ((Integer)var2.getFirst()).intValue() + par1Random.nextInt(((Integer)var2.getSecond()).intValue() - ((Integer)var2.getFirst()).intValue())); ++ } ++ ++ public void handleHealthUpdate(byte par1) { ++ if (par1 == 12) { + this.generateRandomParticles("heart"); +- } else if(var1 == 13) { ++ } else if (par1 == 13) { + this.generateRandomParticles("angryVillager"); +- } else if(var1 == 14) { ++ } else if (par1 == 14) { + this.generateRandomParticles("happyVillager"); + } else { +- super.handleHealthUpdate(var1); +- } +- +- } +- +- private void generateRandomParticles(String var1) { +- for(int var2 = 0; var2 < 5; ++var2) { +- double var3 = this.ab.nextGaussian() * 0.02D; +- double var5 = this.ab.nextGaussian() * 0.02D; +- double var7 = this.ab.nextGaussian() * 0.02D; +- this.worldObj.spawnParticle(var1, this.posX + (double)(this.ab.nextFloat() * this.width * 2.0F) - (double)this.width, this.posY + 1.0D + (double)(this.ab.nextFloat() * this.height), this.posZ + (double)(this.ab.nextFloat() * this.width * 2.0F) - (double)this.width, var3, var5, var7); +- } +- +- } +- +- public EntityLivingData onSpawnWithEgg(EntityLivingData var1) { +- var1 = super.onSpawnWithEgg(var1); +- this.setProfession(this.worldObj.s.nextInt(5)); +- return var1; ++ super.handleHealthUpdate(par1); ++ } ++ } ++ ++ /** ++ * par1 is the particleName ++ */ ++ private void generateRandomParticles(String par1Str) { ++ for (int var2 = 0; var2 < 5; ++var2) { ++ double var3 = this.rand.nextGaussian() * 0.02D; ++ double var5 = this.rand.nextGaussian() * 0.02D; ++ double var7 = this.rand.nextGaussian() * 0.02D; ++ this.worldObj.spawnParticle(par1Str, this.posX + (double)(this.rand.nextFloat() * this.width * 2.0F) - (double)this.width, this.posY + 1.0D + (double)(this.rand.nextFloat() * this.height), this.posZ + (double)(this.rand.nextFloat() * this.width * 2.0F) - (double)this.width, var3, var5, var7); ++ } ++ } ++ ++ public EntityLivingData onSpawnWithEgg(EntityLivingData par1EntityLivingData) { ++ par1EntityLivingData = super.onSpawnWithEgg(par1EntityLivingData); ++ this.setProfession(this.worldObj.rand.nextInt(5)); ++ return par1EntityLivingData; + } + + public void func_82187_q() { + this.field_82190_bM = true; + } + +- public EntityVillager func_90012_b(EntityAgeable var1) { ++ public EntityVillager func_90012_b(EntityAgeable par1EntityAgeable) { + EntityVillager var2 = new EntityVillager(this.worldObj); + var2.onSpawnWithEgg((EntityLivingData)null); + return var2; +@@ -490,74 +571,74 @@ + return false; + } + +- public EntityAgeable createChild(EntityAgeable var1) { +- return this.func_90012_b(var1); ++ public EntityAgeable createChild(EntityAgeable par1EntityAgeable) { ++ return this.func_90012_b(par1EntityAgeable); + } + + static { +- bB.put(Integer.valueOf(Item.coal.itemID), new Tuple(Integer.valueOf(16), Integer.valueOf(24))); +- bB.put(Integer.valueOf(Item.ingotIron.itemID), new Tuple(Integer.valueOf(8), Integer.valueOf(10))); +- bB.put(Integer.valueOf(Item.ingotGold.itemID), new Tuple(Integer.valueOf(8), Integer.valueOf(10))); +- bB.put(Integer.valueOf(Item.diamond.itemID), new Tuple(Integer.valueOf(4), Integer.valueOf(6))); +- bB.put(Integer.valueOf(Item.paper.itemID), new Tuple(Integer.valueOf(24), Integer.valueOf(36))); +- bB.put(Integer.valueOf(Item.book.itemID), new Tuple(Integer.valueOf(11), Integer.valueOf(13))); +- bB.put(Integer.valueOf(Item.writtenBook.itemID), new Tuple(Integer.valueOf(1), Integer.valueOf(1))); +- bB.put(Integer.valueOf(Item.enderPearl.itemID), new Tuple(Integer.valueOf(3), Integer.valueOf(4))); +- bB.put(Integer.valueOf(Item.eyeOfEnder.itemID), new Tuple(Integer.valueOf(2), Integer.valueOf(3))); +- bB.put(Integer.valueOf(Item.porkRaw.itemID), new Tuple(Integer.valueOf(14), Integer.valueOf(18))); +- bB.put(Integer.valueOf(Item.beefRaw.itemID), new Tuple(Integer.valueOf(14), Integer.valueOf(18))); +- bB.put(Integer.valueOf(Item.chickenRaw.itemID), new Tuple(Integer.valueOf(14), Integer.valueOf(18))); +- bB.put(Integer.valueOf(Item.fishCooked.itemID), new Tuple(Integer.valueOf(9), Integer.valueOf(13))); +- bB.put(Integer.valueOf(Item.seeds.itemID), new Tuple(Integer.valueOf(34), Integer.valueOf(48))); +- bB.put(Integer.valueOf(Item.melonSeeds.itemID), new Tuple(Integer.valueOf(30), Integer.valueOf(38))); +- bB.put(Integer.valueOf(Item.pumpkinSeeds.itemID), new Tuple(Integer.valueOf(30), Integer.valueOf(38))); +- bB.put(Integer.valueOf(Item.wheat.itemID), new Tuple(Integer.valueOf(18), Integer.valueOf(22))); +- bB.put(Integer.valueOf(Block.cloth.blockID), new Tuple(Integer.valueOf(14), Integer.valueOf(22))); +- bB.put(Integer.valueOf(Item.rottenFlesh.itemID), new Tuple(Integer.valueOf(36), Integer.valueOf(64))); +- bC.put(Integer.valueOf(Item.flintAndSteel.itemID), new Tuple(Integer.valueOf(3), Integer.valueOf(4))); +- bC.put(Integer.valueOf(Item.shears.itemID), new Tuple(Integer.valueOf(3), Integer.valueOf(4))); +- bC.put(Integer.valueOf(Item.swordIron.itemID), new Tuple(Integer.valueOf(7), Integer.valueOf(11))); +- bC.put(Integer.valueOf(Item.swordDiamond.itemID), new Tuple(Integer.valueOf(12), Integer.valueOf(14))); +- bC.put(Integer.valueOf(Item.axeIron.itemID), new Tuple(Integer.valueOf(6), Integer.valueOf(8))); +- bC.put(Integer.valueOf(Item.axeDiamond.itemID), new Tuple(Integer.valueOf(9), Integer.valueOf(12))); +- bC.put(Integer.valueOf(Item.pickaxeIron.itemID), new Tuple(Integer.valueOf(7), Integer.valueOf(9))); +- bC.put(Integer.valueOf(Item.pickaxeDiamond.itemID), new Tuple(Integer.valueOf(10), Integer.valueOf(12))); +- bC.put(Integer.valueOf(Item.shovelIron.itemID), new Tuple(Integer.valueOf(4), Integer.valueOf(6))); +- bC.put(Integer.valueOf(Item.shovelDiamond.itemID), new Tuple(Integer.valueOf(7), Integer.valueOf(8))); +- bC.put(Integer.valueOf(Item.hoeIron.itemID), new Tuple(Integer.valueOf(4), Integer.valueOf(6))); +- bC.put(Integer.valueOf(Item.hoeDiamond.itemID), new Tuple(Integer.valueOf(7), Integer.valueOf(8))); +- bC.put(Integer.valueOf(Item.bootsIron.itemID), new Tuple(Integer.valueOf(4), Integer.valueOf(6))); +- bC.put(Integer.valueOf(Item.bootsDiamond.itemID), new Tuple(Integer.valueOf(7), Integer.valueOf(8))); +- bC.put(Integer.valueOf(Item.helmetIron.itemID), new Tuple(Integer.valueOf(4), Integer.valueOf(6))); +- bC.put(Integer.valueOf(Item.helmetDiamond.itemID), new Tuple(Integer.valueOf(7), Integer.valueOf(8))); +- bC.put(Integer.valueOf(Item.plateIron.itemID), new Tuple(Integer.valueOf(10), Integer.valueOf(14))); +- bC.put(Integer.valueOf(Item.plateDiamond.itemID), new Tuple(Integer.valueOf(16), Integer.valueOf(19))); +- bC.put(Integer.valueOf(Item.legsIron.itemID), new Tuple(Integer.valueOf(8), Integer.valueOf(10))); +- bC.put(Integer.valueOf(Item.legsDiamond.itemID), new Tuple(Integer.valueOf(11), Integer.valueOf(14))); +- bC.put(Integer.valueOf(Item.bootsChain.itemID), new Tuple(Integer.valueOf(5), Integer.valueOf(7))); +- bC.put(Integer.valueOf(Item.helmetChain.itemID), new Tuple(Integer.valueOf(5), Integer.valueOf(7))); +- bC.put(Integer.valueOf(Item.plateChain.itemID), new Tuple(Integer.valueOf(11), Integer.valueOf(15))); +- bC.put(Integer.valueOf(Item.legsChain.itemID), new Tuple(Integer.valueOf(9), Integer.valueOf(11))); +- bC.put(Integer.valueOf(Item.bread.itemID), new Tuple(Integer.valueOf(-4), Integer.valueOf(-2))); +- bC.put(Integer.valueOf(Item.melon.itemID), new Tuple(Integer.valueOf(-8), Integer.valueOf(-4))); +- bC.put(Integer.valueOf(Item.appleRed.itemID), new Tuple(Integer.valueOf(-8), Integer.valueOf(-4))); +- bC.put(Integer.valueOf(Item.cookie.itemID), new Tuple(Integer.valueOf(-10), Integer.valueOf(-7))); +- bC.put(Integer.valueOf(Block.glass.blockID), new Tuple(Integer.valueOf(-5), Integer.valueOf(-3))); +- bC.put(Integer.valueOf(Block.bookShelf.blockID), new Tuple(Integer.valueOf(3), Integer.valueOf(4))); +- bC.put(Integer.valueOf(Item.plateLeather.itemID), new Tuple(Integer.valueOf(4), Integer.valueOf(5))); +- bC.put(Integer.valueOf(Item.bootsLeather.itemID), new Tuple(Integer.valueOf(2), Integer.valueOf(4))); +- bC.put(Integer.valueOf(Item.helmetLeather.itemID), new Tuple(Integer.valueOf(2), Integer.valueOf(4))); +- bC.put(Integer.valueOf(Item.legsLeather.itemID), new Tuple(Integer.valueOf(2), Integer.valueOf(4))); +- bC.put(Integer.valueOf(Item.saddle.itemID), new Tuple(Integer.valueOf(6), Integer.valueOf(8))); +- bC.put(Integer.valueOf(Item.expBottle.itemID), new Tuple(Integer.valueOf(-4), Integer.valueOf(-1))); +- bC.put(Integer.valueOf(Item.redstone.itemID), new Tuple(Integer.valueOf(-4), Integer.valueOf(-1))); +- bC.put(Integer.valueOf(Item.compass.itemID), new Tuple(Integer.valueOf(10), Integer.valueOf(12))); +- bC.put(Integer.valueOf(Item.pocketSundial.itemID), new Tuple(Integer.valueOf(10), Integer.valueOf(12))); +- bC.put(Integer.valueOf(Block.glowStone.blockID), new Tuple(Integer.valueOf(-3), Integer.valueOf(-1))); +- bC.put(Integer.valueOf(Item.porkCooked.itemID), new Tuple(Integer.valueOf(-7), Integer.valueOf(-5))); +- bC.put(Integer.valueOf(Item.beefCooked.itemID), new Tuple(Integer.valueOf(-7), Integer.valueOf(-5))); +- bC.put(Integer.valueOf(Item.chickenCooked.itemID), new Tuple(Integer.valueOf(-8), Integer.valueOf(-6))); +- bC.put(Integer.valueOf(Item.eyeOfEnder.itemID), new Tuple(Integer.valueOf(7), Integer.valueOf(11))); +- bC.put(Integer.valueOf(Item.arrow.itemID), new Tuple(Integer.valueOf(-12), Integer.valueOf(-8))); ++ villagerStockList.put(Integer.valueOf(Item.coal.itemID), new Tuple(Integer.valueOf(16), Integer.valueOf(24))); ++ villagerStockList.put(Integer.valueOf(Item.ingotIron.itemID), new Tuple(Integer.valueOf(8), Integer.valueOf(10))); ++ villagerStockList.put(Integer.valueOf(Item.ingotGold.itemID), new Tuple(Integer.valueOf(8), Integer.valueOf(10))); ++ villagerStockList.put(Integer.valueOf(Item.diamond.itemID), new Tuple(Integer.valueOf(4), Integer.valueOf(6))); ++ villagerStockList.put(Integer.valueOf(Item.paper.itemID), new Tuple(Integer.valueOf(24), Integer.valueOf(36))); ++ villagerStockList.put(Integer.valueOf(Item.book.itemID), new Tuple(Integer.valueOf(11), Integer.valueOf(13))); ++ villagerStockList.put(Integer.valueOf(Item.writtenBook.itemID), new Tuple(Integer.valueOf(1), Integer.valueOf(1))); ++ villagerStockList.put(Integer.valueOf(Item.enderPearl.itemID), new Tuple(Integer.valueOf(3), Integer.valueOf(4))); ++ villagerStockList.put(Integer.valueOf(Item.eyeOfEnder.itemID), new Tuple(Integer.valueOf(2), Integer.valueOf(3))); ++ villagerStockList.put(Integer.valueOf(Item.porkRaw.itemID), new Tuple(Integer.valueOf(14), Integer.valueOf(18))); ++ villagerStockList.put(Integer.valueOf(Item.beefRaw.itemID), new Tuple(Integer.valueOf(14), Integer.valueOf(18))); ++ villagerStockList.put(Integer.valueOf(Item.chickenRaw.itemID), new Tuple(Integer.valueOf(14), Integer.valueOf(18))); ++ villagerStockList.put(Integer.valueOf(Item.fishCooked.itemID), new Tuple(Integer.valueOf(9), Integer.valueOf(13))); ++ villagerStockList.put(Integer.valueOf(Item.seeds.itemID), new Tuple(Integer.valueOf(34), Integer.valueOf(48))); ++ villagerStockList.put(Integer.valueOf(Item.melonSeeds.itemID), new Tuple(Integer.valueOf(30), Integer.valueOf(38))); ++ villagerStockList.put(Integer.valueOf(Item.pumpkinSeeds.itemID), new Tuple(Integer.valueOf(30), Integer.valueOf(38))); ++ villagerStockList.put(Integer.valueOf(Item.wheat.itemID), new Tuple(Integer.valueOf(18), Integer.valueOf(22))); ++ villagerStockList.put(Integer.valueOf(Block.cloth.blockID), new Tuple(Integer.valueOf(14), Integer.valueOf(22))); ++ villagerStockList.put(Integer.valueOf(Item.rottenFlesh.itemID), new Tuple(Integer.valueOf(36), Integer.valueOf(64))); ++ blacksmithSellingList.put(Integer.valueOf(Item.flintAndSteel.itemID), new Tuple(Integer.valueOf(3), Integer.valueOf(4))); ++ blacksmithSellingList.put(Integer.valueOf(Item.shears.itemID), new Tuple(Integer.valueOf(3), Integer.valueOf(4))); ++ blacksmithSellingList.put(Integer.valueOf(Item.swordIron.itemID), new Tuple(Integer.valueOf(7), Integer.valueOf(11))); ++ blacksmithSellingList.put(Integer.valueOf(Item.swordDiamond.itemID), new Tuple(Integer.valueOf(12), Integer.valueOf(14))); ++ blacksmithSellingList.put(Integer.valueOf(Item.axeIron.itemID), new Tuple(Integer.valueOf(6), Integer.valueOf(8))); ++ blacksmithSellingList.put(Integer.valueOf(Item.axeDiamond.itemID), new Tuple(Integer.valueOf(9), Integer.valueOf(12))); ++ blacksmithSellingList.put(Integer.valueOf(Item.pickaxeIron.itemID), new Tuple(Integer.valueOf(7), Integer.valueOf(9))); ++ blacksmithSellingList.put(Integer.valueOf(Item.pickaxeDiamond.itemID), new Tuple(Integer.valueOf(10), Integer.valueOf(12))); ++ blacksmithSellingList.put(Integer.valueOf(Item.shovelIron.itemID), new Tuple(Integer.valueOf(4), Integer.valueOf(6))); ++ blacksmithSellingList.put(Integer.valueOf(Item.shovelDiamond.itemID), new Tuple(Integer.valueOf(7), Integer.valueOf(8))); ++ blacksmithSellingList.put(Integer.valueOf(Item.hoeIron.itemID), new Tuple(Integer.valueOf(4), Integer.valueOf(6))); ++ blacksmithSellingList.put(Integer.valueOf(Item.hoeDiamond.itemID), new Tuple(Integer.valueOf(7), Integer.valueOf(8))); ++ blacksmithSellingList.put(Integer.valueOf(Item.bootsIron.itemID), new Tuple(Integer.valueOf(4), Integer.valueOf(6))); ++ blacksmithSellingList.put(Integer.valueOf(Item.bootsDiamond.itemID), new Tuple(Integer.valueOf(7), Integer.valueOf(8))); ++ blacksmithSellingList.put(Integer.valueOf(Item.helmetIron.itemID), new Tuple(Integer.valueOf(4), Integer.valueOf(6))); ++ blacksmithSellingList.put(Integer.valueOf(Item.helmetDiamond.itemID), new Tuple(Integer.valueOf(7), Integer.valueOf(8))); ++ blacksmithSellingList.put(Integer.valueOf(Item.plateIron.itemID), new Tuple(Integer.valueOf(10), Integer.valueOf(14))); ++ blacksmithSellingList.put(Integer.valueOf(Item.plateDiamond.itemID), new Tuple(Integer.valueOf(16), Integer.valueOf(19))); ++ blacksmithSellingList.put(Integer.valueOf(Item.legsIron.itemID), new Tuple(Integer.valueOf(8), Integer.valueOf(10))); ++ blacksmithSellingList.put(Integer.valueOf(Item.legsDiamond.itemID), new Tuple(Integer.valueOf(11), Integer.valueOf(14))); ++ blacksmithSellingList.put(Integer.valueOf(Item.bootsChain.itemID), new Tuple(Integer.valueOf(5), Integer.valueOf(7))); ++ blacksmithSellingList.put(Integer.valueOf(Item.helmetChain.itemID), new Tuple(Integer.valueOf(5), Integer.valueOf(7))); ++ blacksmithSellingList.put(Integer.valueOf(Item.plateChain.itemID), new Tuple(Integer.valueOf(11), Integer.valueOf(15))); ++ blacksmithSellingList.put(Integer.valueOf(Item.legsChain.itemID), new Tuple(Integer.valueOf(9), Integer.valueOf(11))); ++ blacksmithSellingList.put(Integer.valueOf(Item.bread.itemID), new Tuple(Integer.valueOf(-4), Integer.valueOf(-2))); ++ blacksmithSellingList.put(Integer.valueOf(Item.melon.itemID), new Tuple(Integer.valueOf(-8), Integer.valueOf(-4))); ++ blacksmithSellingList.put(Integer.valueOf(Item.appleRed.itemID), new Tuple(Integer.valueOf(-8), Integer.valueOf(-4))); ++ blacksmithSellingList.put(Integer.valueOf(Item.cookie.itemID), new Tuple(Integer.valueOf(-10), Integer.valueOf(-7))); ++ blacksmithSellingList.put(Integer.valueOf(Block.glass.blockID), new Tuple(Integer.valueOf(-5), Integer.valueOf(-3))); ++ blacksmithSellingList.put(Integer.valueOf(Block.bookShelf.blockID), new Tuple(Integer.valueOf(3), Integer.valueOf(4))); ++ blacksmithSellingList.put(Integer.valueOf(Item.plateLeather.itemID), new Tuple(Integer.valueOf(4), Integer.valueOf(5))); ++ blacksmithSellingList.put(Integer.valueOf(Item.bootsLeather.itemID), new Tuple(Integer.valueOf(2), Integer.valueOf(4))); ++ blacksmithSellingList.put(Integer.valueOf(Item.helmetLeather.itemID), new Tuple(Integer.valueOf(2), Integer.valueOf(4))); ++ blacksmithSellingList.put(Integer.valueOf(Item.legsLeather.itemID), new Tuple(Integer.valueOf(2), Integer.valueOf(4))); ++ blacksmithSellingList.put(Integer.valueOf(Item.saddle.itemID), new Tuple(Integer.valueOf(6), Integer.valueOf(8))); ++ blacksmithSellingList.put(Integer.valueOf(Item.expBottle.itemID), new Tuple(Integer.valueOf(-4), Integer.valueOf(-1))); ++ blacksmithSellingList.put(Integer.valueOf(Item.redstone.itemID), new Tuple(Integer.valueOf(-4), Integer.valueOf(-1))); ++ blacksmithSellingList.put(Integer.valueOf(Item.compass.itemID), new Tuple(Integer.valueOf(10), Integer.valueOf(12))); ++ blacksmithSellingList.put(Integer.valueOf(Item.pocketSundial.itemID), new Tuple(Integer.valueOf(10), Integer.valueOf(12))); ++ blacksmithSellingList.put(Integer.valueOf(Block.glowStone.blockID), new Tuple(Integer.valueOf(-3), Integer.valueOf(-1))); ++ blacksmithSellingList.put(Integer.valueOf(Item.porkCooked.itemID), new Tuple(Integer.valueOf(-7), Integer.valueOf(-5))); ++ blacksmithSellingList.put(Integer.valueOf(Item.beefCooked.itemID), new Tuple(Integer.valueOf(-7), Integer.valueOf(-5))); ++ blacksmithSellingList.put(Integer.valueOf(Item.chickenCooked.itemID), new Tuple(Integer.valueOf(-8), Integer.valueOf(-6))); ++ blacksmithSellingList.put(Integer.valueOf(Item.eyeOfEnder.itemID), new Tuple(Integer.valueOf(7), Integer.valueOf(11))); ++ blacksmithSellingList.put(Integer.valueOf(Item.arrow.itemID), new Tuple(Integer.valueOf(-12), Integer.valueOf(-8))); + } + } diff --git a/patches/net/minecraft/src/EntityWaterMob.java.patch b/patches/net/minecraft/src/EntityWaterMob.java.patch new file mode 100644 index 0000000..00ba358 --- /dev/null +++ b/patches/net/minecraft/src/EntityWaterMob.java.patch @@ -0,0 +1,69 @@ +--- net/minecraft/src/EntityWaterMob.java ++++ net/minecraft/src/EntityWaterMob.java +@@ -1,43 +1,59 @@ + package net.minecraft.src; + + public abstract class EntityWaterMob extends EntityCreature implements IAnimals { +- public EntityWaterMob(World var1) { +- super(var1); ++ public EntityWaterMob(World par1World) { ++ super(par1World); + } + + public boolean canBreatheUnderwater() { + return true; + } + ++ /** ++ * Checks if the entity's current position is a valid location to spawn this entity. ++ */ + public boolean getCanSpawnHere() { + return this.worldObj.checkNoEntityCollision(this.boundingBox); + } + ++ /** ++ * Get number of ticks, at least during which the living entity will be silent. ++ */ + public int getTalkInterval() { + return 120; + } + ++ /** ++ * Determines if an entity can be despawned, used on idle far away entities ++ */ + protected boolean canDespawn() { + return true; + } + +- protected int getExperiencePoints(EntityPlayer var1) { +- return 1 + this.worldObj.s.nextInt(3); ++ /** ++ * Get the experience points the entity currently has. ++ */ ++ protected int getExperiencePoints(EntityPlayer par1EntityPlayer) { ++ return 1 + this.worldObj.rand.nextInt(3); + } + ++ /** ++ * Gets called every tick from main Entity class ++ */ + public void onEntityUpdate() { + int var1 = this.getAir(); + super.onEntityUpdate(); +- if(this.isEntityAlive() && !this.isInWater()) { ++ ++ if (this.isEntityAlive() && !this.isInWater()) { + --var1; + this.setAir(var1); +- if(this.getAir() == -20) { ++ ++ if (this.getAir() == -20) { + this.setAir(0); + this.attackEntityFrom(DamageSource.drown, 2.0F); + } + } else { + this.setAir(300); + } +- + } + } diff --git a/patches/net/minecraft/src/EntityWeatherEffect.java.patch b/patches/net/minecraft/src/EntityWeatherEffect.java.patch new file mode 100644 index 0000000..9f3aa07 --- /dev/null +++ b/patches/net/minecraft/src/EntityWeatherEffect.java.patch @@ -0,0 +1,12 @@ +--- net/minecraft/src/EntityWeatherEffect.java ++++ net/minecraft/src/EntityWeatherEffect.java +@@ -1,7 +1,7 @@ + package net.minecraft.src; + + public abstract class EntityWeatherEffect extends Entity { +- public EntityWeatherEffect(World var1) { +- super(var1); ++ public EntityWeatherEffect(World par1World) { ++ super(par1World); + } + } diff --git a/patches/net/minecraft/src/EntityWitch.java.patch b/patches/net/minecraft/src/EntityWitch.java.patch new file mode 100644 index 0000000..49d1bff --- /dev/null +++ b/patches/net/minecraft/src/EntityWitch.java.patch @@ -0,0 +1,273 @@ +--- net/minecraft/src/EntityWitch.java ++++ net/minecraft/src/EntityWitch.java +@@ -5,13 +5,20 @@ + import java.util.UUID; + + public class EntityWitch extends EntityMob implements IRangedAttackMob { +- private static final UUID bp = UUID.fromString("5CD17E52-A79A-43D3-A529-90FDE04B181E"); +- private static final AttributeModifier field_110185_bq = (new AttributeModifier(bp, "Drinking speed penalty", -0.25D, 0)).setSaved(false); +- private static final int[] witchDrops = new int[]{Item.glowstone.itemID, Item.sugar.itemID, Item.redstone.itemID, Item.spiderEye.itemID, Item.glassBottle.itemID, Item.gunpowder.itemID, Item.stick.itemID, Item.stick.itemID}; ++ private static final UUID field_110184_bp = UUID.fromString("5CD17E52-A79A-43D3-A529-90FDE04B181E"); ++ private static final AttributeModifier field_110185_bq = (new AttributeModifier(field_110184_bp, "Drinking speed penalty", -0.25D, 0)).setSaved(false); ++ ++ /** List of items a witch should drop on death. */ ++ private static final int[] witchDrops = new int[] {Item.glowstone.itemID, Item.sugar.itemID, Item.redstone.itemID, Item.spiderEye.itemID, Item.glassBottle.itemID, Item.gunpowder.itemID, Item.stick.itemID, Item.stick.itemID}; ++ ++ /** ++ * Timer used as interval for a witch's attack, decremented every tick if aggressive and when reaches zero the witch ++ * will throw a potion at the target entity. ++ */ + private int witchAttackTimer; + +- public EntityWitch(World var1) { +- super(var1); ++ public EntityWitch(World par1World) { ++ super(par1World); + this.tasks.addTask(1, new EntityAISwimming(this)); + this.tasks.addTask(2, new EntityAIArrowAttack(this, 1.0D, 60, 10.0F)); + this.tasks.addTask(2, new EntityAIWander(this, 1.0D)); +@@ -26,22 +33,37 @@ + this.getDataWatcher().addObject(21, Byte.valueOf((byte)0)); + } + ++ /** ++ * Returns the sound this mob makes while it's alive. ++ */ + protected String getLivingSound() { + return "mob.witch.idle"; + } + ++ /** ++ * Returns the sound this mob makes when it is hurt. ++ */ + protected String getHurtSound() { + return "mob.witch.hurt"; + } + ++ /** ++ * Returns the sound this mob makes on death. ++ */ + protected String getDeathSound() { + return "mob.witch.death"; + } + +- public void setAggressive(boolean var1) { +- this.getDataWatcher().updateObject(21, Byte.valueOf((byte)(var1 ? 1 : 0))); ++ /** ++ * Set whether this witch is aggressive at an entity. ++ */ ++ public void setAggressive(boolean par1) { ++ this.getDataWatcher().updateObject(21, Byte.valueOf((byte)(par1 ? 1 : 0))); + } + ++ /** ++ * Return whether this witch is aggressive at an entity. ++ */ + public boolean getAggressive() { + return this.getDataWatcher().getWatchableObjectByte(21) == 1; + } +@@ -52,23 +74,32 @@ + this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setAttribute(0.25D); + } + ++ /** ++ * Returns true if the newer Entity AI code should be run ++ */ + public boolean isAIEnabled() { + return true; + } + ++ /** ++ * Called frequently so the entity can update its state every tick as required. For example, zombies and skeletons use ++ * this to react to sunlight and start to burn. ++ */ + public void onLivingUpdate() { +- if(!this.worldObj.isRemote) { +- if(this.getAggressive()) { +- if(this.witchAttackTimer-- <= 0) { ++ if (!this.worldObj.isRemote) { ++ if (this.getAggressive()) { ++ if (this.witchAttackTimer-- <= 0) { + this.setAggressive(false); +- ItemStack var6 = this.getHeldItem(); ++ ItemStack var1 = this.getHeldItem(); + this.setCurrentItemOrArmor(0, (ItemStack)null); +- if(var6 != null && var6.itemID == Item.potion.itemID) { +- List var5 = Item.potion.getEffects(var6); +- if(var5 != null) { +- Iterator var3 = var5.iterator(); +- +- while(var3.hasNext()) { ++ ++ if (var1 != null && var1.itemID == Item.potion.itemID) { ++ List var2 = Item.potion.getEffects(var1); ++ ++ if (var2 != null) { ++ Iterator var3 = var2.iterator(); ++ ++ while (var3.hasNext()) { + PotionEffect var4 = (PotionEffect)var3.next(); + this.addPotionEffect(new PotionEffect(var4)); + } +@@ -78,28 +109,29 @@ + this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).removeModifier(field_110185_bq); + } + } else { +- short var1 = -1; +- if(this.ab.nextFloat() < 0.15F && this.isBurning() && !this.isPotionActive(Potion.fireResistance)) { +- var1 = 16307; +- } else if(this.ab.nextFloat() < 0.05F && this.getHealth() < this.getMaxHealth()) { +- var1 = 16341; +- } else if(this.ab.nextFloat() < 0.25F && this.getAttackTarget() != null && !this.isPotionActive(Potion.moveSpeed) && this.getAttackTarget().getDistanceSqToEntity(this) > 121.0D) { +- var1 = 16274; +- } else if(this.ab.nextFloat() < 0.25F && this.getAttackTarget() != null && !this.isPotionActive(Potion.moveSpeed) && this.getAttackTarget().getDistanceSqToEntity(this) > 121.0D) { +- var1 = 16274; ++ short var5 = -1; ++ ++ if (this.rand.nextFloat() < 0.15F && this.isBurning() && !this.isPotionActive(Potion.fireResistance)) { ++ var5 = 16307; ++ } else if (this.rand.nextFloat() < 0.05F && this.getHealth() < this.getMaxHealth()) { ++ var5 = 16341; ++ } else if (this.rand.nextFloat() < 0.25F && this.getAttackTarget() != null && !this.isPotionActive(Potion.moveSpeed) && this.getAttackTarget().getDistanceSqToEntity(this) > 121.0D) { ++ var5 = 16274; ++ } else if (this.rand.nextFloat() < 0.25F && this.getAttackTarget() != null && !this.isPotionActive(Potion.moveSpeed) && this.getAttackTarget().getDistanceSqToEntity(this) > 121.0D) { ++ var5 = 16274; + } + +- if(var1 > -1) { +- this.setCurrentItemOrArmor(0, new ItemStack(Item.potion, 1, var1)); ++ if (var5 > -1) { ++ this.setCurrentItemOrArmor(0, new ItemStack(Item.potion, 1, var5)); + this.witchAttackTimer = this.getHeldItem().getMaxItemUseDuration(); + this.setAggressive(true); +- AttributeInstance var2 = this.getEntityAttribute(SharedMonsterAttributes.movementSpeed); +- var2.removeModifier(field_110185_bq); +- var2.applyModifier(field_110185_bq); ++ AttributeInstance var6 = this.getEntityAttribute(SharedMonsterAttributes.movementSpeed); ++ var6.removeModifier(field_110185_bq); ++ var6.applyModifier(field_110185_bq); + } + } + +- if(this.ab.nextFloat() < 7.5E-4F) { ++ if (this.rand.nextFloat() < 7.5E-4F) { + this.worldObj.setEntityState(this, (byte)15); + } + } +@@ -107,64 +139,75 @@ + super.onLivingUpdate(); + } + +- public void handleHealthUpdate(byte var1) { +- if(var1 == 15) { +- for(int var2 = 0; var2 < this.ab.nextInt(35) + 10; ++var2) { +- this.worldObj.spawnParticle("witchMagic", this.posX + this.ab.nextGaussian() * (double)0.13F, this.boundingBox.maxY + 0.5D + this.ab.nextGaussian() * (double)0.13F, this.posZ + this.ab.nextGaussian() * (double)0.13F, 0.0D, 0.0D, 0.0D); ++ public void handleHealthUpdate(byte par1) { ++ if (par1 == 15) { ++ for (int var2 = 0; var2 < this.rand.nextInt(35) + 10; ++var2) { ++ this.worldObj.spawnParticle("witchMagic", this.posX + this.rand.nextGaussian() * 0.12999999523162842D, this.boundingBox.maxY + 0.5D + this.rand.nextGaussian() * 0.12999999523162842D, this.posZ + this.rand.nextGaussian() * 0.12999999523162842D, 0.0D, 0.0D, 0.0D); + } + } else { +- super.handleHealthUpdate(var1); +- } +- +- } +- +- protected float applyPotionDamageCalculations(DamageSource var1, float var2) { +- var2 = super.applyPotionDamageCalculations(var1, var2); +- if(var1.getEntity() == this) { +- var2 = 0.0F; +- } +- +- if(var1.isMagicDamage()) { +- var2 = (float)((double)var2 * 0.15D); +- } +- +- return var2; +- } +- +- protected void dropFewItems(boolean var1, int var2) { +- int var3 = this.ab.nextInt(3) + 1; +- +- for(int var4 = 0; var4 < var3; ++var4) { +- int var5 = this.ab.nextInt(3); +- int var6 = witchDrops[this.ab.nextInt(witchDrops.length)]; +- if(var2 > 0) { +- var5 += this.ab.nextInt(var2 + 1); ++ super.handleHealthUpdate(par1); ++ } ++ } ++ ++ /** ++ * Reduces damage, depending on potions ++ */ ++ protected float applyPotionDamageCalculations(DamageSource par1DamageSource, float par2) { ++ par2 = super.applyPotionDamageCalculations(par1DamageSource, par2); ++ ++ if (par1DamageSource.getEntity() == this) { ++ par2 = 0.0F; ++ } ++ ++ if (par1DamageSource.isMagicDamage()) { ++ par2 = (float)((double)par2 * 0.15D); ++ } ++ ++ return par2; ++ } ++ ++ /** ++ * Drop 0-2 items of this living's type. @param par1 - Whether this entity has recently been hit by a player. @param ++ * par2 - Level of Looting used to kill this mob. ++ */ ++ protected void dropFewItems(boolean par1, int par2) { ++ int var3 = this.rand.nextInt(3) + 1; ++ ++ for (int var4 = 0; var4 < var3; ++var4) { ++ int var5 = this.rand.nextInt(3); ++ int var6 = witchDrops[this.rand.nextInt(witchDrops.length)]; ++ ++ if (par2 > 0) { ++ var5 += this.rand.nextInt(par2 + 1); + } + +- for(int var7 = 0; var7 < var5; ++var7) { ++ for (int var7 = 0; var7 < var5; ++var7) { + this.dropItem(var6, 1); + } + } +- + } + +- public void attackEntityWithRangedAttack(EntityLivingBase var1, float var2) { +- if(!this.getAggressive()) { ++ /** ++ * Attack the specified entity using a ranged attack. ++ */ ++ public void attackEntityWithRangedAttack(EntityLivingBase par1EntityLivingBase, float par2) { ++ if (!this.getAggressive()) { + EntityPotion var3 = new EntityPotion(this.worldObj, this, 32732); + var3.rotationPitch -= -20.0F; +- double var4 = var1.posX + var1.motionX - this.posX; +- double var6 = var1.posY + (double)var1.getEyeHeight() - (double)1.1F - this.posY; +- double var8 = var1.posZ + var1.motionZ - this.posZ; ++ double var4 = par1EntityLivingBase.posX + par1EntityLivingBase.motionX - this.posX; ++ double var6 = par1EntityLivingBase.posY + (double)par1EntityLivingBase.getEyeHeight() - 1.100000023841858D - this.posY; ++ double var8 = par1EntityLivingBase.posZ + par1EntityLivingBase.motionZ - this.posZ; + float var10 = MathHelper.sqrt_double(var4 * var4 + var8 * var8); +- if(var10 >= 8.0F && !var1.isPotionActive(Potion.moveSlowdown)) { ++ ++ if (var10 >= 8.0F && !par1EntityLivingBase.isPotionActive(Potion.moveSlowdown)) { + var3.setPotionDamage(32698); +- } else if(var1.getHealth() >= 8.0F && !var1.isPotionActive(Potion.poison)) { ++ } else if (par1EntityLivingBase.getHealth() >= 8.0F && !par1EntityLivingBase.isPotionActive(Potion.poison)) { + var3.setPotionDamage(32660); +- } else if(var10 <= 3.0F && !var1.isPotionActive(Potion.weakness) && this.ab.nextFloat() < 0.25F) { ++ } else if (var10 <= 3.0F && !par1EntityLivingBase.isPotionActive(Potion.weakness) && this.rand.nextFloat() < 0.25F) { + var3.setPotionDamage(32696); + } + +- var3.setThrowableHeading(var4, var6 + (double)(var10 * 0.2F), var8, 12.0F / 16.0F, 8.0F); ++ var3.setThrowableHeading(var4, var6 + (double)(var10 * 0.2F), var8, 0.75F, 8.0F); + this.worldObj.spawnEntityInWorld(var3); + } + } diff --git a/patches/net/minecraft/src/EntityWither.java.patch b/patches/net/minecraft/src/EntityWither.java.patch new file mode 100644 index 0000000..df6afe8 --- /dev/null +++ b/patches/net/minecraft/src/EntityWither.java.patch @@ -0,0 +1,635 @@ +--- net/minecraft/src/EntityWither.java ++++ net/minecraft/src/EntityWither.java +@@ -10,10 +10,12 @@ + private int[] field_82223_h = new int[2]; + private int[] field_82224_i = new int[2]; + private int field_82222_j; ++ ++ /** Selector used to determine the entities a wither boss should attack. */ + private static final IEntitySelector attackEntitySelector = new EntityWitherAttackFilter(); + +- public EntityWither(World var1) { +- super(var1); ++ public EntityWither(World par1World) { ++ super(par1World); + this.setHealth(this.getMaxHealth()); + this.setSize(0.9F, 4.0F); + this.isImmuneToFire = true; +@@ -36,80 +38,104 @@ + this.dataWatcher.addObject(20, new Integer(0)); + } + +- public void writeEntityToNBT(NBTTagCompound var1) { +- super.writeEntityToNBT(var1); +- var1.setInteger("Invul", this.func_82212_n()); ++ /** ++ * (abstract) Protected helper method to write subclass entity data to NBT. ++ */ ++ public void writeEntityToNBT(NBTTagCompound par1NBTTagCompound) { ++ super.writeEntityToNBT(par1NBTTagCompound); ++ par1NBTTagCompound.setInteger("Invul", this.func_82212_n()); + } + +- public void readEntityFromNBT(NBTTagCompound var1) { +- super.readEntityFromNBT(var1); +- this.func_82215_s(var1.getInteger("Invul")); ++ /** ++ * (abstract) Protected helper method to read subclass entity data from NBT. ++ */ ++ public void readEntityFromNBT(NBTTagCompound par1NBTTagCompound) { ++ super.readEntityFromNBT(par1NBTTagCompound); ++ this.func_82215_s(par1NBTTagCompound.getInteger("Invul")); + } + + public float getShadowSize() { + return this.height / 8.0F; + } + ++ /** ++ * Returns the sound this mob makes while it's alive. ++ */ + protected String getLivingSound() { + return "mob.wither.idle"; + } + ++ /** ++ * Returns the sound this mob makes when it is hurt. ++ */ + protected String getHurtSound() { + return "mob.wither.hurt"; + } + ++ /** ++ * Returns the sound this mob makes on death. ++ */ + protected String getDeathSound() { + return "mob.wither.death"; + } + ++ /** ++ * Called frequently so the entity can update its state every tick as required. For example, zombies and skeletons use ++ * this to react to sunlight and start to burn. ++ */ + public void onLivingUpdate() { +- this.motionY *= (double)0.6F; ++ this.motionY *= 0.6000000238418579D; + double var4; + double var6; + double var8; +- if(!this.worldObj.isRemote && this.getWatchedTargetId(0) > 0) { ++ ++ if (!this.worldObj.isRemote && this.getWatchedTargetId(0) > 0) { + Entity var1 = this.worldObj.getEntityByID(this.getWatchedTargetId(0)); +- if(var1 != null) { +- if(this.posY < var1.posY || !this.isArmored() && this.posY < var1.posY + 5.0D) { +- if(this.motionY < 0.0D) { ++ ++ if (var1 != null) { ++ if (this.posY < var1.posY || !this.isArmored() && this.posY < var1.posY + 5.0D) { ++ if (this.motionY < 0.0D) { + this.motionY = 0.0D; + } + +- this.motionY += (0.5D - this.motionY) * (double)0.6F; ++ this.motionY += (0.5D - this.motionY) * 0.6000000238418579D; + } + + double var2 = var1.posX - this.posX; + var4 = var1.posZ - this.posZ; + var6 = var2 * var2 + var4 * var4; +- if(var6 > 9.0D) { ++ ++ if (var6 > 9.0D) { + var8 = (double)MathHelper.sqrt_double(var6); +- this.motionX += (var2 / var8 * 0.5D - this.motionX) * (double)0.6F; +- this.motionZ += (var4 / var8 * 0.5D - this.motionZ) * (double)0.6F; ++ this.motionX += (var2 / var8 * 0.5D - this.motionX) * 0.6000000238418579D; ++ this.motionZ += (var4 / var8 * 0.5D - this.motionZ) * 0.6000000238418579D; + } + } + } + +- if(this.motionX * this.motionX + this.motionZ * this.motionZ > (double)0.05F) { +- this.rotationYaw = (float)Math.atan2(this.motionZ, this.motionX) * (180.0F / (float)Math.PI) - 90.0F; ++ if (this.motionX * this.motionX + this.motionZ * this.motionZ > 0.05000000074505806D) { ++ this.rotationYaw = (float)Math.atan2(this.motionZ, this.motionX) * (180F / (float)Math.PI) - 90.0F; + } + + super.onLivingUpdate(); +- + int var20; +- for(var20 = 0; var20 < 2; ++var20) { ++ ++ for (var20 = 0; var20 < 2; ++var20) { + this.field_82218_g[var20] = this.field_82221_e[var20]; + this.field_82217_f[var20] = this.field_82220_d[var20]; + } + + int var21; +- for(var20 = 0; var20 < 2; ++var20) { ++ ++ for (var20 = 0; var20 < 2; ++var20) { + var21 = this.getWatchedTargetId(var20 + 1); + Entity var3 = null; +- if(var21 > 0) { ++ ++ if (var21 > 0) { + var3 = this.worldObj.getEntityByID(var21); + } + +- if(var3 != null) { ++ if (var3 != null) { + var4 = this.func_82214_u(var20 + 1); + var6 = this.func_82208_v(var20 + 1); + var8 = this.func_82213_w(var20 + 1); +@@ -117,8 +143,8 @@ + double var12 = var3.posY + (double)var3.getEyeHeight() - var6; + double var14 = var3.posZ - var8; + double var16 = (double)MathHelper.sqrt_double(var10 * var10 + var14 * var14); +- float var18 = (float)(Math.atan2(var14, var10) * 180.0D / (double)((float)Math.PI)) - 90.0F; +- float var19 = (float)(-(Math.atan2(var12, var16) * 180.0D / (double)((float)Math.PI))); ++ float var18 = (float)(Math.atan2(var14, var10) * 180.0D / Math.PI) - 90.0F; ++ float var19 = (float)(-(Math.atan2(var12, var16) * 180.0D / Math.PI)); + this.field_82220_d[var20] = this.func_82204_b(this.field_82220_d[var20], var19, 40.0F); + this.field_82221_e[var20] = this.func_82204_b(this.field_82221_e[var20], var18, 10.0F); + } else { +@@ -128,66 +154,72 @@ + + boolean var22 = this.isArmored(); + +- for(var21 = 0; var21 < 3; ++var21) { ++ for (var21 = 0; var21 < 3; ++var21) { + double var23 = this.func_82214_u(var21); + double var5 = this.func_82208_v(var21); + double var7 = this.func_82213_w(var21); +- this.worldObj.spawnParticle("smoke", var23 + this.ab.nextGaussian() * (double)0.3F, var5 + this.ab.nextGaussian() * (double)0.3F, var7 + this.ab.nextGaussian() * (double)0.3F, 0.0D, 0.0D, 0.0D); +- if(var22 && this.worldObj.s.nextInt(4) == 0) { +- this.worldObj.spawnParticle("mobSpell", var23 + this.ab.nextGaussian() * (double)0.3F, var5 + this.ab.nextGaussian() * (double)0.3F, var7 + this.ab.nextGaussian() * (double)0.3F, (double)0.7F, (double)0.7F, 0.5D); +- } +- } +- +- if(this.func_82212_n() > 0) { +- for(var21 = 0; var21 < 3; ++var21) { +- this.worldObj.spawnParticle("mobSpell", this.posX + this.ab.nextGaussian() * 1.0D, this.posY + (double)(this.ab.nextFloat() * 3.3F), this.posZ + this.ab.nextGaussian() * 1.0D, (double)0.7F, (double)0.7F, (double)0.9F); +- } +- } +- ++ this.worldObj.spawnParticle("smoke", var23 + this.rand.nextGaussian() * 0.30000001192092896D, var5 + this.rand.nextGaussian() * 0.30000001192092896D, var7 + this.rand.nextGaussian() * 0.30000001192092896D, 0.0D, 0.0D, 0.0D); ++ ++ if (var22 && this.worldObj.rand.nextInt(4) == 0) { ++ this.worldObj.spawnParticle("mobSpell", var23 + this.rand.nextGaussian() * 0.30000001192092896D, var5 + this.rand.nextGaussian() * 0.30000001192092896D, var7 + this.rand.nextGaussian() * 0.30000001192092896D, 0.699999988079071D, 0.699999988079071D, 0.5D); ++ } ++ } ++ ++ if (this.func_82212_n() > 0) { ++ for (var21 = 0; var21 < 3; ++var21) { ++ this.worldObj.spawnParticle("mobSpell", this.posX + this.rand.nextGaussian() * 1.0D, this.posY + (double)(this.rand.nextFloat() * 3.3F), this.posZ + this.rand.nextGaussian() * 1.0D, 0.699999988079071D, 0.699999988079071D, 0.8999999761581421D); ++ } ++ } + } + + protected void updateAITasks() { + int var1; +- if(this.func_82212_n() > 0) { ++ ++ if (this.func_82212_n() > 0) { + var1 = this.func_82212_n() - 1; +- if(var1 <= 0) { ++ ++ if (var1 <= 0) { + this.worldObj.newExplosion(this, this.posX, this.posY + (double)this.getEyeHeight(), this.posZ, 7.0F, false, this.worldObj.getGameRules().getGameRuleBooleanValue("mobGriefing")); + this.worldObj.func_82739_e(1013, (int)this.posX, (int)this.posY, (int)this.posZ, 0); + } + + this.func_82215_s(var1); +- if(this.ticksExisted % 10 == 0) { ++ ++ if (this.ticksExisted % 10 == 0) { + this.heal(10.0F); + } +- + } else { + super.updateAITasks(); +- + int var12; +- for(var1 = 1; var1 < 3; ++var1) { +- if(this.ticksExisted >= this.field_82223_h[var1 - 1]) { +- this.field_82223_h[var1 - 1] = this.ticksExisted + 10 + this.ab.nextInt(10); +- if(this.worldObj.difficultySetting >= 2) { ++ ++ for (var1 = 1; var1 < 3; ++var1) { ++ if (this.ticksExisted >= this.field_82223_h[var1 - 1]) { ++ this.field_82223_h[var1 - 1] = this.ticksExisted + 10 + this.rand.nextInt(10); ++ ++ if (this.worldObj.difficultySetting >= 2) { + int var10001 = var1 - 1; + int var10003 = this.field_82224_i[var1 - 1]; + this.field_82224_i[var10001] = this.field_82224_i[var1 - 1] + 1; +- if(var10003 > 15) { ++ ++ if (var10003 > 15) { + float var2 = 10.0F; + float var3 = 5.0F; +- double var4 = MathHelper.getRandomDoubleInRange(this.ab, this.posX - (double)var2, this.posX + (double)var2); +- double var6 = MathHelper.getRandomDoubleInRange(this.ab, this.posY - (double)var3, this.posY + (double)var3); +- double var8 = MathHelper.getRandomDoubleInRange(this.ab, this.posZ - (double)var2, this.posZ + (double)var2); ++ double var4 = MathHelper.getRandomDoubleInRange(this.rand, this.posX - (double)var2, this.posX + (double)var2); ++ double var6 = MathHelper.getRandomDoubleInRange(this.rand, this.posY - (double)var3, this.posY + (double)var3); ++ double var8 = MathHelper.getRandomDoubleInRange(this.rand, this.posZ - (double)var2, this.posZ + (double)var2); + this.func_82209_a(var1 + 1, var4, var6, var8, true); + this.field_82224_i[var1 - 1] = 0; + } + } + + var12 = this.getWatchedTargetId(var1); +- if(var12 > 0) { ++ ++ if (var12 > 0) { + Entity var14 = this.worldObj.getEntityByID(var12); +- if(var14 != null && var14.isEntityAlive() && this.getDistanceSqToEntity(var14) <= 900.0D && this.canEntityBeSeen(var14)) { ++ ++ if (var14 != null && var14.isEntityAlive() && this.getDistanceSqToEntity(var14) <= 900.0D && this.canEntityBeSeen(var14)) { + this.func_82216_a(var1 + 1, (EntityLivingBase)var14); +- this.field_82223_h[var1 - 1] = this.ticksExisted + 40 + this.ab.nextInt(20); ++ this.field_82223_h[var1 - 1] = this.ticksExisted + 40 + this.rand.nextInt(20); + this.field_82224_i[var1 - 1] = 0; + } else { + this.func_82211_c(var1, 0); +@@ -195,16 +227,18 @@ + } else { + List var13 = this.worldObj.selectEntitiesWithinAABB(EntityLivingBase.class, this.boundingBox.expand(20.0D, 8.0D, 20.0D), attackEntitySelector); + +- for(int var16 = 0; var16 < 10 && !var13.isEmpty(); ++var16) { +- EntityLivingBase var5 = (EntityLivingBase)var13.get(this.ab.nextInt(var13.size())); +- if(var5 != this && var5.isEntityAlive() && this.canEntityBeSeen(var5)) { +- if(var5 instanceof EntityPlayer) { +- if(!((EntityPlayer)var5).capabilities.disableDamage) { ++ for (int var16 = 0; var16 < 10 && !var13.isEmpty(); ++var16) { ++ EntityLivingBase var5 = (EntityLivingBase)var13.get(this.rand.nextInt(var13.size())); ++ ++ if (var5 != this && var5.isEntityAlive() && this.canEntityBeSeen(var5)) { ++ if (var5 instanceof EntityPlayer) { ++ if (!((EntityPlayer)var5).capabilities.disableDamage) { + this.func_82211_c(var1, var5.entityId); + } + } else { + this.func_82211_c(var1, var5.entityId); + } ++ + break; + } + +@@ -214,44 +248,45 @@ + } + } + +- if(this.getAttackTarget() != null) { ++ if (this.getAttackTarget() != null) { + this.func_82211_c(0, this.getAttackTarget().entityId); + } else { + this.func_82211_c(0, 0); + } + +- if(this.field_82222_j > 0) { ++ if (this.field_82222_j > 0) { + --this.field_82222_j; +- if(this.field_82222_j == 0 && this.worldObj.getGameRules().getGameRuleBooleanValue("mobGriefing")) { ++ ++ if (this.field_82222_j == 0 && this.worldObj.getGameRules().getGameRuleBooleanValue("mobGriefing")) { + var1 = MathHelper.floor_double(this.posY); + var12 = MathHelper.floor_double(this.posX); + int var15 = MathHelper.floor_double(this.posZ); + boolean var17 = false; + +- for(int var18 = -1; var18 <= 1; ++var18) { +- for(int var19 = -1; var19 <= 1; ++var19) { +- for(int var7 = 0; var7 <= 3; ++var7) { ++ for (int var18 = -1; var18 <= 1; ++var18) { ++ for (int var19 = -1; var19 <= 1; ++var19) { ++ for (int var7 = 0; var7 <= 3; ++var7) { + int var20 = var12 + var18; + int var9 = var1 + var7; + int var10 = var15 + var19; + int var11 = this.worldObj.getBlockId(var20, var9, var10); +- if(var11 > 0 && var11 != Block.bedrock.blockID && var11 != Block.endPortal.blockID && var11 != Block.endPortalFrame.blockID) { ++ ++ if (var11 > 0 && var11 != Block.bedrock.blockID && var11 != Block.endPortal.blockID && var11 != Block.endPortalFrame.blockID) { + var17 = this.worldObj.destroyBlock(var20, var9, var10, true) || var17; + } + } + } + } + +- if(var17) { ++ if (var17) { + this.worldObj.playAuxSFXAtEntity((EntityPlayer)null, 1012, (int)this.posX, (int)this.posY, (int)this.posZ, 0); + } + } + } + +- if(this.ticksExisted % 20 == 0) { ++ if (this.ticksExisted % 20 == 0) { + this.heal(1.0F); + } +- + } + } + +@@ -260,64 +295,71 @@ + this.setHealth(this.getMaxHealth() / 3.0F); + } + +- public void setInWeb() { +- } ++ /** ++ * Sets the Entity inside a web block. ++ */ ++ public void setInWeb() {} + ++ /** ++ * Returns the current armor value as determined by a call to InventoryPlayer.getTotalArmorValue ++ */ + public int getTotalArmorValue() { + return 4; + } + +- private double func_82214_u(int var1) { +- if(var1 <= 0) { ++ private double func_82214_u(int par1) { ++ if (par1 <= 0) { + return this.posX; + } else { +- float var2 = (this.renderYawOffset + (float)(180 * (var1 - 1))) / 180.0F * (float)Math.PI; ++ float var2 = (this.renderYawOffset + (float)(180 * (par1 - 1))) / 180.0F * (float)Math.PI; + float var3 = MathHelper.cos(var2); + return this.posX + (double)var3 * 1.3D; + } + } + +- private double func_82208_v(int var1) { +- return var1 <= 0 ? this.posY + 3.0D : this.posY + 2.2D; ++ private double func_82208_v(int par1) { ++ return par1 <= 0 ? this.posY + 3.0D : this.posY + 2.2D; + } + +- private double func_82213_w(int var1) { +- if(var1 <= 0) { ++ private double func_82213_w(int par1) { ++ if (par1 <= 0) { + return this.posZ; + } else { +- float var2 = (this.renderYawOffset + (float)(180 * (var1 - 1))) / 180.0F * (float)Math.PI; ++ float var2 = (this.renderYawOffset + (float)(180 * (par1 - 1))) / 180.0F * (float)Math.PI; + float var3 = MathHelper.sin(var2); + return this.posZ + (double)var3 * 1.3D; + } + } + +- private float func_82204_b(float var1, float var2, float var3) { +- float var4 = MathHelper.wrapAngleTo180_float(var2 - var1); +- if(var4 > var3) { +- var4 = var3; +- } +- +- if(var4 < -var3) { +- var4 = -var3; +- } +- +- return var1 + var4; +- } +- +- private void func_82216_a(int var1, EntityLivingBase var2) { +- this.func_82209_a(var1, var2.posX, var2.posY + (double)var2.getEyeHeight() * 0.5D, var2.posZ, var1 == 0 && this.ab.nextFloat() < 0.001F); +- } +- +- private void func_82209_a(int var1, double var2, double var4, double var6, boolean var8) { ++ private float func_82204_b(float par1, float par2, float par3) { ++ float var4 = MathHelper.wrapAngleTo180_float(par2 - par1); ++ ++ if (var4 > par3) { ++ var4 = par3; ++ } ++ ++ if (var4 < -par3) { ++ var4 = -par3; ++ } ++ ++ return par1 + var4; ++ } ++ ++ private void func_82216_a(int par1, EntityLivingBase par2EntityLivingBase) { ++ this.func_82209_a(par1, par2EntityLivingBase.posX, par2EntityLivingBase.posY + (double)par2EntityLivingBase.getEyeHeight() * 0.5D, par2EntityLivingBase.posZ, par1 == 0 && this.rand.nextFloat() < 0.001F); ++ } ++ ++ private void func_82209_a(int par1, double par2, double par4, double par6, boolean par8) { + this.worldObj.playAuxSFXAtEntity((EntityPlayer)null, 1014, (int)this.posX, (int)this.posY, (int)this.posZ, 0); +- double var9 = this.func_82214_u(var1); +- double var11 = this.func_82208_v(var1); +- double var13 = this.func_82213_w(var1); +- double var15 = var2 - var9; +- double var17 = var4 - var11; +- double var19 = var6 - var13; ++ double var9 = this.func_82214_u(par1); ++ double var11 = this.func_82208_v(par1); ++ double var13 = this.func_82213_w(par1); ++ double var15 = par2 - var9; ++ double var17 = par4 - var11; ++ double var19 = par6 - var13; + EntityWitherSkull var21 = new EntityWitherSkull(this.worldObj, this, var15, var17, var19); +- if(var8) { ++ ++ if (par8) { + var21.setInvulnerable(true); + } + +@@ -327,65 +369,91 @@ + this.worldObj.spawnEntityInWorld(var21); + } + +- public void attackEntityWithRangedAttack(EntityLivingBase var1, float var2) { +- this.func_82216_a(0, var1); ++ /** ++ * Attack the specified entity using a ranged attack. ++ */ ++ public void attackEntityWithRangedAttack(EntityLivingBase par1EntityLivingBase, float par2) { ++ this.func_82216_a(0, par1EntityLivingBase); + } + +- public boolean attackEntityFrom(DamageSource var1, float var2) { +- if(this.isEntityInvulnerable()) { +- return false; +- } else if(var1 == DamageSource.drown) { +- return false; +- } else if(this.func_82212_n() > 0) { ++ /** ++ * Called when the entity is attacked. ++ */ ++ public boolean attackEntityFrom(DamageSource par1DamageSource, float par2) { ++ if (this.isEntityInvulnerable()) { ++ return false; ++ } else if (par1DamageSource == DamageSource.drown) { ++ return false; ++ } else if (this.func_82212_n() > 0) { + return false; + } else { + Entity var3; +- if(this.isArmored()) { +- var3 = var1.getSourceOfDamage(); +- if(var3 instanceof EntityArrow) { ++ ++ if (this.isArmored()) { ++ var3 = par1DamageSource.getSourceOfDamage(); ++ ++ if (var3 instanceof EntityArrow) { + return false; + } + } + +- var3 = var1.getEntity(); +- if(var3 != null && !(var3 instanceof EntityPlayer) && var3 instanceof EntityLivingBase && ((EntityLivingBase)var3).getCreatureAttribute() == this.getCreatureAttribute()) { ++ var3 = par1DamageSource.getEntity(); ++ ++ if (var3 != null && !(var3 instanceof EntityPlayer) && var3 instanceof EntityLivingBase && ((EntityLivingBase)var3).getCreatureAttribute() == this.getCreatureAttribute()) { + return false; + } else { +- if(this.field_82222_j <= 0) { ++ if (this.field_82222_j <= 0) { + this.field_82222_j = 20; + } + +- for(int var4 = 0; var4 < this.field_82224_i.length; ++var4) { ++ for (int var4 = 0; var4 < this.field_82224_i.length; ++var4) { + this.field_82224_i[var4] += 3; + } + +- return super.attackEntityFrom(var1, var2); ++ return super.attackEntityFrom(par1DamageSource, par2); + } + } + } + +- protected void dropFewItems(boolean var1, int var2) { ++ /** ++ * Drop 0-2 items of this living's type. @param par1 - Whether this entity has recently been hit by a player. @param ++ * par2 - Level of Looting used to kill this mob. ++ */ ++ protected void dropFewItems(boolean par1, int par2) { + this.dropItem(Item.netherStar.itemID, 1); + } + ++ /** ++ * Makes the entity despawn if requirements are reached ++ */ + protected void despawnEntity() { + this.entityAge = 0; + } + +- public int getBrightnessForRender(float var1) { ++ public int getBrightnessForRender(float par1) { + return 15728880; + } + ++ /** ++ * Returns true if other Entities should be prevented from moving through this Entity. ++ */ + public boolean canBeCollidedWith() { + return !this.isDead; + } + +- protected void fall(float var1) { +- } +- +- public void addPotionEffect(PotionEffect var1) { +- } +- ++ /** ++ * Called when the mob is falling. Calculates and applies fall damage. ++ */ ++ protected void fall(float par1) {} ++ ++ /** ++ * adds a PotionEffect to the entity ++ */ ++ public void addPotionEffect(PotionEffect par1PotionEffect) {} ++ ++ /** ++ * Returns true if the newer Entity AI code should be run ++ */ + protected boolean isAIEnabled() { + return true; + } +@@ -393,43 +461,56 @@ + protected void applyEntityAttributes() { + super.applyEntityAttributes(); + this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setAttribute(300.0D); +- this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setAttribute((double)0.6F); ++ this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setAttribute(0.6000000238418579D); + this.getEntityAttribute(SharedMonsterAttributes.followRange).setAttribute(40.0D); + } + +- public float func_82207_a(int var1) { +- return this.field_82221_e[var1]; ++ public float func_82207_a(int par1) { ++ return this.field_82221_e[par1]; + } + +- public float func_82210_r(int var1) { +- return this.field_82220_d[var1]; ++ public float func_82210_r(int par1) { ++ return this.field_82220_d[par1]; + } + + public int func_82212_n() { + return this.dataWatcher.getWatchableObjectInt(20); + } + +- public void func_82215_s(int var1) { +- this.dataWatcher.updateObject(20, Integer.valueOf(var1)); +- } +- +- public int getWatchedTargetId(int var1) { +- return this.dataWatcher.getWatchableObjectInt(17 + var1); +- } +- +- public void func_82211_c(int var1, int var2) { +- this.dataWatcher.updateObject(17 + var1, Integer.valueOf(var2)); +- } +- ++ public void func_82215_s(int par1) { ++ this.dataWatcher.updateObject(20, Integer.valueOf(par1)); ++ } ++ ++ /** ++ * Returns the target entity ID if present, or -1 if not @param par1 The target offset, should be from 0-2 ++ */ ++ public int getWatchedTargetId(int par1) { ++ return this.dataWatcher.getWatchableObjectInt(17 + par1); ++ } ++ ++ public void func_82211_c(int par1, int par2) { ++ this.dataWatcher.updateObject(17 + par1, Integer.valueOf(par2)); ++ } ++ ++ /** ++ * Returns whether the wither is armored with its boss armor or not by checking whether its health is below half of its ++ * maximum. ++ */ + public boolean isArmored() { + return this.getHealth() <= this.getMaxHealth() / 2.0F; + } + ++ /** ++ * Get this Entity's EnumCreatureAttribute ++ */ + public EnumCreatureAttribute getCreatureAttribute() { + return EnumCreatureAttribute.UNDEAD; + } + +- public void mountEntity(Entity var1) { ++ /** ++ * Called when a player mounts an entity. e.g. mounts a pig, mounts a boat. ++ */ ++ public void mountEntity(Entity par1Entity) { + this.ridingEntity = null; + } + } diff --git a/patches/net/minecraft/src/EntityWitherAttackFilter.java.patch b/patches/net/minecraft/src/EntityWitherAttackFilter.java.patch new file mode 100644 index 0000000..db933f6 --- /dev/null +++ b/patches/net/minecraft/src/EntityWitherAttackFilter.java.patch @@ -0,0 +1,16 @@ +--- net/minecraft/src/EntityWitherAttackFilter.java ++++ net/minecraft/src/EntityWitherAttackFilter.java +@@ -1,7 +1,11 @@ + package net.minecraft.src; + + final class EntityWitherAttackFilter implements IEntitySelector { +- public boolean isEntityApplicable(Entity var1) { +- return var1 instanceof EntityLivingBase && ((EntityLivingBase)var1).getCreatureAttribute() != EnumCreatureAttribute.UNDEAD; ++ ++ /** ++ * Return whether the specified entity is applicable to this filter. ++ */ ++ public boolean isEntityApplicable(Entity par1Entity) { ++ return par1Entity instanceof EntityLivingBase && ((EntityLivingBase)par1Entity).getCreatureAttribute() != EnumCreatureAttribute.UNDEAD; + } + } diff --git a/patches/net/minecraft/src/EntityWitherSkull.java.patch b/patches/net/minecraft/src/EntityWitherSkull.java.patch new file mode 100644 index 0000000..b93676f --- /dev/null +++ b/patches/net/minecraft/src/EntityWitherSkull.java.patch @@ -0,0 +1,149 @@ +--- net/minecraft/src/EntityWitherSkull.java ++++ net/minecraft/src/EntityWitherSkull.java +@@ -1,61 +1,76 @@ + package net.minecraft.src; + + public class EntityWitherSkull extends EntityFireball { +- public EntityWitherSkull(World var1) { +- super(var1); +- this.setSize(5.0F / 16.0F, 5.0F / 16.0F); +- } +- +- public EntityWitherSkull(World var1, EntityLivingBase var2, double var3, double var5, double var7) { +- super(var1, var2, var3, var5, var7); +- this.setSize(5.0F / 16.0F, 5.0F / 16.0F); +- } +- ++ public EntityWitherSkull(World par1World) { ++ super(par1World); ++ this.setSize(0.3125F, 0.3125F); ++ } ++ ++ public EntityWitherSkull(World par1World, EntityLivingBase par2EntityLivingBase, double par3, double par5, double par7) { ++ super(par1World, par2EntityLivingBase, par3, par5, par7); ++ this.setSize(0.3125F, 0.3125F); ++ } ++ ++ /** ++ * Return the motion factor for this projectile. The factor is multiplied by the original motion. ++ */ + protected float getMotionFactor() { + return this.isInvulnerable() ? 0.73F : super.getMotionFactor(); + } + +- public EntityWitherSkull(World var1, double var2, double var4, double var6, double var8, double var10, double var12) { +- super(var1, var2, var4, var6, var8, var10, var12); +- this.setSize(5.0F / 16.0F, 5.0F / 16.0F); ++ public EntityWitherSkull(World par1World, double par2, double par4, double par6, double par8, double par10, double par12) { ++ super(par1World, par2, par4, par6, par8, par10, par12); ++ this.setSize(0.3125F, 0.3125F); + } + ++ /** ++ * Returns true if the entity is on fire. Used by render to add the fire effect on rendering. ++ */ + public boolean isBurning() { + return false; + } + +- public float getBlockExplosionResistance(Explosion var1, World var2, int var3, int var4, int var5, Block var6) { +- float var7 = super.getBlockExplosionResistance(var1, var2, var3, var4, var5, var6); +- if(this.isInvulnerable() && var6 != Block.bedrock && var6 != Block.endPortal && var6 != Block.endPortalFrame) { ++ /** ++ * Gets a block's resistance to this entity's explosion. Used to make rails immune to TNT minecarts' explosions and ++ * Wither skulls more destructive. ++ */ ++ public float getBlockExplosionResistance(Explosion par1Explosion, World par2World, int par3, int par4, int par5, Block par6Block) { ++ float var7 = super.getBlockExplosionResistance(par1Explosion, par2World, par3, par4, par5, par6Block); ++ ++ if (this.isInvulnerable() && par6Block != Block.bedrock && par6Block != Block.endPortal && par6Block != Block.endPortalFrame) { + var7 = Math.min(0.8F, var7); + } + + return var7; + } + +- protected void onImpact(MovingObjectPosition var1) { +- if(!this.worldObj.isRemote) { +- if(var1.entityHit != null) { +- if(this.shootingEntity != null) { +- if(var1.entityHit.attackEntityFrom(DamageSource.causeMobDamage(this.shootingEntity), 8.0F) && !var1.entityHit.isEntityAlive()) { ++ /** ++ * Called when this EntityFireball hits a block or entity. ++ */ ++ protected void onImpact(MovingObjectPosition par1MovingObjectPosition) { ++ if (!this.worldObj.isRemote) { ++ if (par1MovingObjectPosition.entityHit != null) { ++ if (this.shootingEntity != null) { ++ if (par1MovingObjectPosition.entityHit.attackEntityFrom(DamageSource.causeMobDamage(this.shootingEntity), 8.0F) && !par1MovingObjectPosition.entityHit.isEntityAlive()) { + this.shootingEntity.heal(5.0F); + } + } else { +- var1.entityHit.attackEntityFrom(DamageSource.magic, 5.0F); ++ par1MovingObjectPosition.entityHit.attackEntityFrom(DamageSource.magic, 5.0F); + } + +- if(var1.entityHit instanceof EntityLivingBase) { ++ if (par1MovingObjectPosition.entityHit instanceof EntityLivingBase) { + byte var2 = 0; +- if(this.worldObj.difficultySetting > 1) { +- if(this.worldObj.difficultySetting == 2) { ++ ++ if (this.worldObj.difficultySetting > 1) { ++ if (this.worldObj.difficultySetting == 2) { + var2 = 10; +- } else if(this.worldObj.difficultySetting == 3) { ++ } else if (this.worldObj.difficultySetting == 3) { + var2 = 40; + } + } + +- if(var2 > 0) { +- ((EntityLivingBase)var1.entityHit).addPotionEffect(new PotionEffect(Potion.wither.id, 20 * var2, 1)); ++ if (var2 > 0) { ++ ((EntityLivingBase)par1MovingObjectPosition.entityHit).addPotionEffect(new PotionEffect(Potion.wither.id, 20 * var2, 1)); + } + } + } +@@ -63,14 +78,19 @@ + this.worldObj.newExplosion(this, this.posX, this.posY, this.posZ, 1.0F, false, this.worldObj.getGameRules().getGameRuleBooleanValue("mobGriefing")); + this.setDead(); + } +- + } + ++ /** ++ * Returns true if other Entities should be prevented from moving through this Entity. ++ */ + public boolean canBeCollidedWith() { + return false; + } + +- public boolean attackEntityFrom(DamageSource var1, float var2) { ++ /** ++ * Called when the entity is attacked. ++ */ ++ public boolean attackEntityFrom(DamageSource par1DamageSource, float par2) { + return false; + } + +@@ -78,11 +98,17 @@ + this.dataWatcher.addObject(10, Byte.valueOf((byte)0)); + } + ++ /** ++ * Return whether this skull comes from an invulnerable (aura) wither boss. ++ */ + public boolean isInvulnerable() { + return this.dataWatcher.getWatchableObjectByte(10) == 1; + } + +- public void setInvulnerable(boolean var1) { +- this.dataWatcher.updateObject(10, Byte.valueOf((byte)(var1 ? 1 : 0))); ++ /** ++ * Set whether this skull comes from an invulnerable (aura) wither boss. ++ */ ++ public void setInvulnerable(boolean par1) { ++ this.dataWatcher.updateObject(10, Byte.valueOf((byte)(par1 ? 1 : 0))); + } + } diff --git a/patches/net/minecraft/src/EntityWolf.java.patch b/patches/net/minecraft/src/EntityWolf.java.patch new file mode 100644 index 0000000..f046df2 --- /dev/null +++ b/patches/net/minecraft/src/EntityWolf.java.patch @@ -0,0 +1,587 @@ +--- net/minecraft/src/EntityWolf.java ++++ net/minecraft/src/EntityWolf.java +@@ -1,15 +1,22 @@ + package net.minecraft.src; + + public class EntityWolf extends EntityTameable { ++ // ToDO: Need Spoutcraft API Texture Override abilities. + private float field_70926_e; + private float field_70924_f; ++ ++ /** true is the wolf is wet else false */ + private boolean isShaking; + private boolean field_70928_h; ++ ++ /** ++ * This time increases while wolf is shaking and emitting water particles. ++ */ + private float timeWolfIsShaking; + private float prevTimeWolfIsShaking; + +- public EntityWolf(World var1) { +- super(var1); ++ public EntityWolf(World par1World) { ++ super(par1World); + this.setSize(0.6F, 0.8F); + this.getNavigator().setAvoidsWater(true); + this.tasks.addTask(1, new EntityAISwimming(this)); +@@ -31,29 +38,38 @@ + + protected void applyEntityAttributes() { + super.applyEntityAttributes(); +- this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setAttribute((double)0.3F); +- if(this.isTamed()) { ++ this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setAttribute(0.30000001192092896D); ++ ++ if (this.isTamed()) { + this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setAttribute(20.0D); + } else { + this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setAttribute(8.0D); + } +- + } + ++ /** ++ * Returns true if the newer Entity AI code should be run ++ */ + public boolean isAIEnabled() { + return true; + } + +- public void setAttackTarget(EntityLivingBase var1) { +- super.setAttackTarget(var1); +- if(var1 == null) { ++ /** ++ * Sets the active target the Task system uses for tracking ++ */ ++ public void setAttackTarget(EntityLivingBase par1EntityLivingBase) { ++ super.setAttackTarget(par1EntityLivingBase); ++ ++ if (par1EntityLivingBase == null) { + this.setAngry(false); +- } else if(!this.isTamed()) { ++ } else if (!this.isTamed()) { + this.setAngry(true); + } +- + } + ++ /** ++ * main AI tick function, replaces updateEntityActionState ++ */ + protected void updateAITick() { + this.dataWatcher.updateObject(18, Float.valueOf(this.getHealth())); + } +@@ -65,186 +81,238 @@ + this.dataWatcher.addObject(20, new Byte((byte)BlockColored.getBlockFromDye(1))); + } + +- protected void playStepSound(int var1, int var2, int var3, int var4) { ++ /** ++ * Plays step sound at given x, y, z for the entity ++ */ ++ protected void playStepSound(int par1, int par2, int par3, int par4) { + this.playSound("mob.wolf.step", 0.15F, 1.0F); + } + +- public void writeEntityToNBT(NBTTagCompound var1) { +- super.writeEntityToNBT(var1); +- var1.setBoolean("Angry", this.isAngry()); +- var1.setByte("CollarColor", (byte)this.getCollarColor()); ++ /** ++ * (abstract) Protected helper method to write subclass entity data to NBT. ++ */ ++ public void writeEntityToNBT(NBTTagCompound par1NBTTagCompound) { ++ super.writeEntityToNBT(par1NBTTagCompound); ++ par1NBTTagCompound.setBoolean("Angry", this.isAngry()); ++ par1NBTTagCompound.setByte("CollarColor", (byte)this.getCollarColor()); + } + +- public void readEntityFromNBT(NBTTagCompound var1) { +- super.readEntityFromNBT(var1); +- this.setAngry(var1.getBoolean("Angry")); +- if(var1.hasKey("CollarColor")) { +- this.setCollarColor(var1.getByte("CollarColor")); ++ /** ++ * (abstract) Protected helper method to read subclass entity data from NBT. ++ */ ++ public void readEntityFromNBT(NBTTagCompound par1NBTTagCompound) { ++ super.readEntityFromNBT(par1NBTTagCompound); ++ this.setAngry(par1NBTTagCompound.getBoolean("Angry")); ++ ++ if (par1NBTTagCompound.hasKey("CollarColor")) { ++ this.setCollarColor(par1NBTTagCompound.getByte("CollarColor")); + } +- + } + ++ /** ++ * Returns the sound this mob makes while it's alive. ++ */ + protected String getLivingSound() { +- return this.isAngry() ? "mob.wolf.growl" : (this.ab.nextInt(3) == 0 ? (this.isTamed() && this.dataWatcher.getWatchableObjectFloat(18) < 10.0F ? "mob.wolf.whine" : "mob.wolf.panting") : "mob.wolf.bark"); ++ return this.isAngry() ? "mob.wolf.growl" : (this.rand.nextInt(3) == 0 ? (this.isTamed() && this.dataWatcher.getWatchableObjectFloat(18) < 10.0F ? "mob.wolf.whine" : "mob.wolf.panting") : "mob.wolf.bark"); + } + ++ /** ++ * Returns the sound this mob makes when it is hurt. ++ */ + protected String getHurtSound() { + return "mob.wolf.hurt"; + } + ++ /** ++ * Returns the sound this mob makes on death. ++ */ + protected String getDeathSound() { + return "mob.wolf.death"; + } + ++ /** ++ * Returns the volume for the sounds this mob makes. ++ */ + protected float getSoundVolume() { + return 0.4F; + } + ++ /** ++ * Returns the item ID for the item the mob drops on death. ++ */ + protected int getDropItemId() { + return -1; + } + ++ /** ++ * Called frequently so the entity can update its state every tick as required. For example, zombies and skeletons use ++ * this to react to sunlight and start to burn. ++ */ + public void onLivingUpdate() { + super.onLivingUpdate(); +- if(!this.worldObj.isRemote && this.isShaking && !this.field_70928_h && !this.hasPath() && this.onGround) { ++ ++ if (!this.worldObj.isRemote && this.isShaking && !this.field_70928_h && !this.hasPath() && this.onGround) { + this.field_70928_h = true; + this.timeWolfIsShaking = 0.0F; + this.prevTimeWolfIsShaking = 0.0F; + this.worldObj.setEntityState(this, (byte)8); + } +- + } + ++ /** ++ * Called to update the entity's position/logic. ++ */ + public void onUpdate() { + super.onUpdate(); + this.field_70924_f = this.field_70926_e; +- if(this.func_70922_bv()) { ++ ++ if (this.func_70922_bv()) { + this.field_70926_e += (1.0F - this.field_70926_e) * 0.4F; + } else { + this.field_70926_e += (0.0F - this.field_70926_e) * 0.4F; + } + +- if(this.func_70922_bv()) { ++ if (this.func_70922_bv()) { + this.numTicksToChaseTarget = 10; + } + +- if(this.isWet()) { ++ if (this.isWet()) { + this.isShaking = true; + this.field_70928_h = false; + this.timeWolfIsShaking = 0.0F; + this.prevTimeWolfIsShaking = 0.0F; +- } else if((this.isShaking || this.field_70928_h) && this.field_70928_h) { +- if(this.timeWolfIsShaking == 0.0F) { +- this.playSound("mob.wolf.shake", this.getSoundVolume(), (this.ab.nextFloat() - this.ab.nextFloat()) * 0.2F + 1.0F); ++ } else if ((this.isShaking || this.field_70928_h) && this.field_70928_h) { ++ if (this.timeWolfIsShaking == 0.0F) { ++ this.playSound("mob.wolf.shake", this.getSoundVolume(), (this.rand.nextFloat() - this.rand.nextFloat()) * 0.2F + 1.0F); + } + + this.prevTimeWolfIsShaking = this.timeWolfIsShaking; + this.timeWolfIsShaking += 0.05F; +- if(this.prevTimeWolfIsShaking >= 2.0F) { ++ ++ if (this.prevTimeWolfIsShaking >= 2.0F) { + this.isShaking = false; + this.field_70928_h = false; + this.prevTimeWolfIsShaking = 0.0F; + this.timeWolfIsShaking = 0.0F; + } + +- if(this.timeWolfIsShaking > 0.4F) { ++ if (this.timeWolfIsShaking > 0.4F) { + float var1 = (float)this.boundingBox.minY; + int var2 = (int)(MathHelper.sin((this.timeWolfIsShaking - 0.4F) * (float)Math.PI) * 7.0F); + +- for(int var3 = 0; var3 < var2; ++var3) { +- float var4 = (this.ab.nextFloat() * 2.0F - 1.0F) * this.width * 0.5F; +- float var5 = (this.ab.nextFloat() * 2.0F - 1.0F) * this.width * 0.5F; ++ for (int var3 = 0; var3 < var2; ++var3) { ++ float var4 = (this.rand.nextFloat() * 2.0F - 1.0F) * this.width * 0.5F; ++ float var5 = (this.rand.nextFloat() * 2.0F - 1.0F) * this.width * 0.5F; + this.worldObj.spawnParticle("splash", this.posX + (double)var4, (double)(var1 + 0.8F), this.posZ + (double)var5, this.motionX, this.motionY, this.motionZ); + } + } + } +- + } + + public boolean getWolfShaking() { + return this.isShaking; + } + +- public float getShadingWhileShaking(float var1) { +- return 12.0F / 16.0F + (this.prevTimeWolfIsShaking + (this.timeWolfIsShaking - this.prevTimeWolfIsShaking) * var1) / 2.0F * 0.25F; ++ /** ++ * Used when calculating the amount of shading to apply while the wolf is shaking. ++ */ ++ public float getShadingWhileShaking(float par1) { ++ return 0.75F + (this.prevTimeWolfIsShaking + (this.timeWolfIsShaking - this.prevTimeWolfIsShaking) * par1) / 2.0F * 0.25F; + } + +- public float getShakeAngle(float var1, float var2) { +- float var3 = (this.prevTimeWolfIsShaking + (this.timeWolfIsShaking - this.prevTimeWolfIsShaking) * var1 + var2) / 1.8F; +- if(var3 < 0.0F) { ++ public float getShakeAngle(float par1, float par2) { ++ float var3 = (this.prevTimeWolfIsShaking + (this.timeWolfIsShaking - this.prevTimeWolfIsShaking) * par1 + par2) / 1.8F; ++ ++ if (var3 < 0.0F) { + var3 = 0.0F; +- } else if(var3 > 1.0F) { ++ } else if (var3 > 1.0F) { + var3 = 1.0F; + } + + return MathHelper.sin(var3 * (float)Math.PI) * MathHelper.sin(var3 * (float)Math.PI * 11.0F) * 0.15F * (float)Math.PI; + } + +- public float getInterestedAngle(float var1) { +- return (this.field_70924_f + (this.field_70926_e - this.field_70924_f) * var1) * 0.15F * (float)Math.PI; ++ public float getInterestedAngle(float par1) { ++ return (this.field_70924_f + (this.field_70926_e - this.field_70924_f) * par1) * 0.15F * (float)Math.PI; + } + + public float getEyeHeight() { + return this.height * 0.8F; + } + ++ /** ++ * The speed it takes to move the entityliving's rotationPitch through the faceEntity method. This is only currently ++ * use in wolves. ++ */ + public int getVerticalFaceSpeed() { + return this.isSitting() ? 20 : super.getVerticalFaceSpeed(); + } + +- public boolean attackEntityFrom(DamageSource var1, float var2) { +- if(this.isEntityInvulnerable()) { ++ /** ++ * Called when the entity is attacked. ++ */ ++ public boolean attackEntityFrom(DamageSource par1DamageSource, float par2) { ++ if (this.isEntityInvulnerable()) { + return false; + } else { +- Entity var3 = var1.getEntity(); ++ Entity var3 = par1DamageSource.getEntity(); + this.aiSit.setSitting(false); +- if(var3 != null && !(var3 instanceof EntityPlayer) && !(var3 instanceof EntityArrow)) { +- var2 = (var2 + 1.0F) / 2.0F; ++ ++ if (var3 != null && !(var3 instanceof EntityPlayer) && !(var3 instanceof EntityArrow)) { ++ par2 = (par2 + 1.0F) / 2.0F; + } + +- return super.attackEntityFrom(var1, var2); ++ return super.attackEntityFrom(par1DamageSource, par2); + } + } + +- public boolean attackEntityAsMob(Entity var1) { ++ public boolean attackEntityAsMob(Entity par1Entity) { + int var2 = this.isTamed() ? 4 : 2; +- return var1.attackEntityFrom(DamageSource.causeMobDamage(this), (float)var2); ++ return par1Entity.attackEntityFrom(DamageSource.causeMobDamage(this), (float)var2); + } + +- public void setTamed(boolean var1) { +- super.setTamed(var1); +- if(var1) { ++ public void setTamed(boolean par1) { ++ super.setTamed(par1); ++ ++ if (par1) { + this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setAttribute(20.0D); + } else { + this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setAttribute(8.0D); + } +- + } + +- public boolean interact(EntityPlayer var1) { +- ItemStack var2 = var1.inventory.getCurrentItem(); +- if(this.isTamed()) { +- if(var2 != null) { +- if(Item.itemsList[var2.itemID] instanceof ItemFood) { ++ /** ++ * Called when a player interacts with a mob. e.g. gets milk from a cow, gets into the saddle on a pig. ++ */ ++ public boolean interact(EntityPlayer par1EntityPlayer) { ++ ItemStack var2 = par1EntityPlayer.inventory.getCurrentItem(); ++ ++ if (this.isTamed()) { ++ if (var2 != null) { ++ if (Item.itemsList[var2.itemID] instanceof ItemFood) { + ItemFood var3 = (ItemFood)Item.itemsList[var2.itemID]; +- if(var3.isWolfsFavoriteMeat() && this.dataWatcher.getWatchableObjectFloat(18) < 20.0F) { +- if(!var1.capabilities.isCreativeMode) { ++ ++ if (var3.isWolfsFavoriteMeat() && this.dataWatcher.getWatchableObjectFloat(18) < 20.0F) { ++ if (!par1EntityPlayer.capabilities.isCreativeMode) { + --var2.stackSize; + } + + this.heal((float)var3.getHealAmount()); +- if(var2.stackSize <= 0) { +- var1.inventory.setInventorySlotContents(var1.inventory.currentItem, (ItemStack)null); ++ ++ if (var2.stackSize <= 0) { ++ par1EntityPlayer.inventory.setInventorySlotContents(par1EntityPlayer.inventory.currentItem, (ItemStack)null); + } + + return true; + } +- } else if(var2.itemID == Item.dyePowder.itemID) { ++ } else if (var2.itemID == Item.dyePowder.itemID) { + int var4 = BlockColored.getBlockFromDye(var2.getItemDamage()); +- if(var4 != this.getCollarColor()) { ++ ++ if (var4 != this.getCollarColor()) { + this.setCollarColor(var4); +- if(!var1.capabilities.isCreativeMode && --var2.stackSize <= 0) { +- var1.inventory.setInventorySlotContents(var1.inventory.currentItem, (ItemStack)null); ++ ++ if (!par1EntityPlayer.capabilities.isCreativeMode && --var2.stackSize <= 0) { ++ par1EntityPlayer.inventory.setInventorySlotContents(par1EntityPlayer.inventory.currentItem, (ItemStack)null); + } + + return true; +@@ -252,30 +320,30 @@ + } + } + +- if(var1.getCommandSenderName().equalsIgnoreCase(this.getOwnerName()) && !this.worldObj.isRemote && !this.isBreedingItem(var2)) { ++ if (par1EntityPlayer.getCommandSenderName().equalsIgnoreCase(this.getOwnerName()) && !this.worldObj.isRemote && !this.isBreedingItem(var2)) { + this.aiSit.setSitting(!this.isSitting()); + this.isJumping = false; + this.setPathToEntity((PathEntity)null); + this.setTarget((Entity)null); + this.setAttackTarget((EntityLivingBase)null); + } +- } else if(var2 != null && var2.itemID == Item.bone.itemID && !this.isAngry()) { +- if(!var1.capabilities.isCreativeMode) { ++ } else if (var2 != null && var2.itemID == Item.bone.itemID && !this.isAngry()) { ++ if (!par1EntityPlayer.capabilities.isCreativeMode) { + --var2.stackSize; + } + +- if(var2.stackSize <= 0) { +- var1.inventory.setInventorySlotContents(var1.inventory.currentItem, (ItemStack)null); ++ if (var2.stackSize <= 0) { ++ par1EntityPlayer.inventory.setInventorySlotContents(par1EntityPlayer.inventory.currentItem, (ItemStack)null); + } + +- if(!this.worldObj.isRemote) { +- if(this.ab.nextInt(3) == 0) { ++ if (!this.worldObj.isRemote) { ++ if (this.rand.nextInt(3) == 0) { + this.setTamed(true); + this.setPathToEntity((PathEntity)null); + this.setAttackTarget((EntityLivingBase)null); + this.aiSit.setSitting(true); + this.setHealth(20.0F); +- this.setOwner(var1.getCommandSenderName()); ++ this.setOwner(par1EntityPlayer.getCommandSenderName()); + this.playTameEffect(true); + this.worldObj.setEntityState(this, (byte)7); + } else { +@@ -287,58 +355,80 @@ + return true; + } + +- return super.interact(var1); ++ return super.interact(par1EntityPlayer); + } + +- public void handleHealthUpdate(byte var1) { +- if(var1 == 8) { ++ public void handleHealthUpdate(byte par1) { ++ if (par1 == 8) { + this.field_70928_h = true; + this.timeWolfIsShaking = 0.0F; + this.prevTimeWolfIsShaking = 0.0F; + } else { +- super.handleHealthUpdate(var1); ++ super.handleHealthUpdate(par1); + } +- + } + + public float getTailRotation() { +- return this.isAngry() ? (float)Math.PI * 0.49F : (this.isTamed() ? (0.55F - (20.0F - this.dataWatcher.getWatchableObjectFloat(18)) * 0.02F) * (float)Math.PI : (float)Math.PI * 0.2F); +- } +- +- public boolean isBreedingItem(ItemStack var1) { +- return var1 == null ? false : (!(Item.itemsList[var1.itemID] instanceof ItemFood) ? false : ((ItemFood)Item.itemsList[var1.itemID]).isWolfsFavoriteMeat()); +- } +- ++ return this.isAngry() ? 1.5393804F : (this.isTamed() ? (0.55F - (20.0F - this.dataWatcher.getWatchableObjectFloat(18)) * 0.02F) * (float)Math.PI : ((float)Math.PI / 5F)); ++ } ++ ++ /** ++ * Checks if the parameter is an item which this animal can be fed to breed it (wheat, carrots or seeds depending on ++ * the animal type) ++ */ ++ public boolean isBreedingItem(ItemStack par1ItemStack) { ++ return par1ItemStack == null ? false : (!(Item.itemsList[par1ItemStack.itemID] instanceof ItemFood) ? false : ((ItemFood)Item.itemsList[par1ItemStack.itemID]).isWolfsFavoriteMeat()); ++ } ++ ++ /** ++ * Will return how many at most can spawn in a chunk at once. ++ */ + public int getMaxSpawnedInChunk() { + return 8; + } + ++ /** ++ * Determines whether this wolf is angry or not. ++ */ + public boolean isAngry() { + return (this.dataWatcher.getWatchableObjectByte(16) & 2) != 0; + } + +- public void setAngry(boolean var1) { ++ /** ++ * Sets whether this wolf is angry or not. ++ */ ++ public void setAngry(boolean par1) { + byte var2 = this.dataWatcher.getWatchableObjectByte(16); +- if(var1) { ++ ++ if (par1) { + this.dataWatcher.updateObject(16, Byte.valueOf((byte)(var2 | 2))); + } else { + this.dataWatcher.updateObject(16, Byte.valueOf((byte)(var2 & -3))); + } +- + } + ++ /** ++ * Return this wolf's collar color. ++ */ + public int getCollarColor() { + return this.dataWatcher.getWatchableObjectByte(20) & 15; + } + +- public void setCollarColor(int var1) { +- this.dataWatcher.updateObject(20, Byte.valueOf((byte)(var1 & 15))); ++ /** ++ * Set this wolf's collar color. ++ */ ++ public void setCollarColor(int par1) { ++ this.dataWatcher.updateObject(20, Byte.valueOf((byte)(par1 & 15))); + } + +- public EntityWolf spawnBabyAnimal(EntityAgeable var1) { ++ /** ++ * This function is used when two same-species animals in 'love mode' breed to generate the new baby animal. ++ */ ++ public EntityWolf spawnBabyAnimal(EntityAgeable par1EntityAgeable) { + EntityWolf var2 = new EntityWolf(this.worldObj); + String var3 = this.getOwnerName(); +- if(var3 != null && var3.trim().length() > 0) { ++ ++ if (var3 != null && var3.trim().length() > 0) { + var2.setOwner(var3); + var2.setTamed(true); + } +@@ -346,24 +436,26 @@ + return var2; + } + +- public void func_70918_i(boolean var1) { +- if(var1) { ++ public void func_70918_i(boolean par1) { ++ if (par1) { + this.dataWatcher.updateObject(19, Byte.valueOf((byte)1)); + } else { + this.dataWatcher.updateObject(19, Byte.valueOf((byte)0)); + } +- + } + +- public boolean canMateWith(EntityAnimal var1) { +- if(var1 == this) { +- return false; +- } else if(!this.isTamed()) { +- return false; +- } else if(!(var1 instanceof EntityWolf)) { ++ /** ++ * Returns true if the mob is currently able to mate with the specified mob. ++ */ ++ public boolean canMateWith(EntityAnimal par1EntityAnimal) { ++ if (par1EntityAnimal == this) { ++ return false; ++ } else if (!this.isTamed()) { ++ return false; ++ } else if (!(par1EntityAnimal instanceof EntityWolf)) { + return false; + } else { +- EntityWolf var2 = (EntityWolf)var1; ++ EntityWolf var2 = (EntityWolf)par1EntityAnimal; + return !var2.isTamed() ? false : (var2.isSitting() ? false : this.isInLove() && var2.isInLove()); + } + } +@@ -372,26 +464,30 @@ + return this.dataWatcher.getWatchableObjectByte(19) == 1; + } + ++ /** ++ * Determines if an entity can be despawned, used on idle far away entities ++ */ + protected boolean canDespawn() { + return !this.isTamed() && this.ticksExisted > 2400; + } + +- public boolean func_142018_a(EntityLivingBase var1, EntityLivingBase var2) { +- if(!(var1 instanceof EntityCreeper) && !(var1 instanceof EntityGhast)) { +- if(var1 instanceof EntityWolf) { +- EntityWolf var3 = (EntityWolf)var1; +- if(var3.isTamed() && var3.func_130012_q() == var2) { ++ public boolean func_142018_a(EntityLivingBase par1EntityLivingBase, EntityLivingBase par2EntityLivingBase) { ++ if (!(par1EntityLivingBase instanceof EntityCreeper) && !(par1EntityLivingBase instanceof EntityGhast)) { ++ if (par1EntityLivingBase instanceof EntityWolf) { ++ EntityWolf var3 = (EntityWolf)par1EntityLivingBase; ++ ++ if (var3.isTamed() && var3.func_130012_q() == par2EntityLivingBase) { + return false; + } + } + +- return var1 instanceof EntityPlayer && var2 instanceof EntityPlayer && !((EntityPlayer)var2).canAttackPlayer((EntityPlayer)var1) ? false : !(var1 instanceof EntityHorse) || !((EntityHorse)var1).isTame(); ++ return par1EntityLivingBase instanceof EntityPlayer && par2EntityLivingBase instanceof EntityPlayer && !((EntityPlayer)par2EntityLivingBase).canAttackPlayer((EntityPlayer)par1EntityLivingBase) ? false : !(par1EntityLivingBase instanceof EntityHorse) || !((EntityHorse)par1EntityLivingBase).isTame(); + } else { + return false; + } + } + +- public EntityAgeable createChild(EntityAgeable var1) { +- return this.spawnBabyAnimal(var1); ++ public EntityAgeable createChild(EntityAgeable par1EntityAgeable) { ++ return this.spawnBabyAnimal(par1EntityAgeable); + } + } diff --git a/patches/net/minecraft/src/EntityXPOrb.java.patch b/patches/net/minecraft/src/EntityXPOrb.java.patch new file mode 100644 index 0000000..9dca237 --- /dev/null +++ b/patches/net/minecraft/src/EntityXPOrb.java.patch @@ -0,0 +1,331 @@ +--- net/minecraft/src/EntityXPOrb.java ++++ net/minecraft/src/EntityXPOrb.java +@@ -1,94 +1,128 @@ + package net.minecraft.src; + ++// Spout Start ++import org.spoutcraft.api.Spoutcraft; ++import org.spoutcraft.api.material.CustomBlock; ++import org.spoutcraft.api.material.MaterialData; ++// Spout End ++ + public class EntityXPOrb extends Entity { ++ ++ /** ++ * A constantly increasing value that RenderXPOrb uses to control the colour shifting (Green / yellow) ++ */ + public int xpColor; ++ ++ /** The age of the XP orb in ticks. */ + public int xpOrbAge; + public int field_70532_c; ++ ++ /** The health of this XP orb. */ + private int xpOrbHealth = 5; +- private int xpValue; ++ ++ /** This is how much XP this orb has. */ ++ // Spout Start - private to public ++ public int xpValue; ++ // Spout End ++ ++ /** The closest EntityPlayer to this orb. */ + private EntityPlayer closestPlayer; ++ ++ /** Threshold color for tracking players */ + private int xpTargetColor; + +- public EntityXPOrb(World var1, double var2, double var4, double var6, int var8) { +- super(var1); ++ public EntityXPOrb(World par1World, double par2, double par4, double par6, int par8) { ++ super(par1World); + this.setSize(0.5F, 0.5F); + this.yOffset = this.height / 2.0F; +- this.setPosition(var2, var4, var6); ++ this.setPosition(par2, par4, par6); + this.rotationYaw = (float)(Math.random() * 360.0D); +- this.motionX = (double)((float)(Math.random() * (double)0.2F - (double)0.1F) * 2.0F); ++ this.motionX = (double)((float)(Math.random() * 0.20000000298023224D - 0.10000000149011612D) * 2.0F); + this.motionY = (double)((float)(Math.random() * 0.2D) * 2.0F); +- this.motionZ = (double)((float)(Math.random() * (double)0.2F - (double)0.1F) * 2.0F); +- this.xpValue = var8; ++ this.motionZ = (double)((float)(Math.random() * 0.20000000298023224D - 0.10000000149011612D) * 2.0F); ++ this.xpValue = par8; + } + ++ /** ++ * returns if this entity triggers Block.onEntityWalking on the blocks they walk on. used for spiders and wolves to ++ * prevent them from trampling crops ++ */ + protected boolean canTriggerWalking() { + return false; + } + +- public EntityXPOrb(World var1) { +- super(var1); ++ public EntityXPOrb(World par1World) { ++ super(par1World); + this.setSize(0.25F, 0.25F); + this.yOffset = this.height / 2.0F; + } + +- protected void entityInit() { +- } ++ protected void entityInit() {} + +- public int getBrightnessForRender(float var1) { ++ public int getBrightnessForRender(float par1) { + float var2 = 0.5F; +- if(var2 < 0.0F) { ++ ++ if (var2 < 0.0F) { + var2 = 0.0F; + } + +- if(var2 > 1.0F) { ++ if (var2 > 1.0F) { + var2 = 1.0F; + } + +- int var3 = super.getBrightnessForRender(var1); ++ int var3 = super.getBrightnessForRender(par1); + int var4 = var3 & 255; + int var5 = var3 >> 16 & 255; + var4 += (int)(var2 * 15.0F * 16.0F); +- if(var4 > 240) { ++ ++ if (var4 > 240) { + var4 = 240; + } + + return var4 | var5 << 16; + } + ++ /** ++ * Called to update the entity's position/logic. ++ */ + public void onUpdate() { + super.onUpdate(); +- if(this.field_70532_c > 0) { ++ ++ if (this.field_70532_c > 0) { + --this.field_70532_c; + } + + this.prevPosX = this.posX; + this.prevPosY = this.posY; + this.prevPosZ = this.posZ; +- this.motionY -= (double)0.03F; +- if(this.worldObj.getBlockMaterial(MathHelper.floor_double(this.posX), MathHelper.floor_double(this.posY), MathHelper.floor_double(this.posZ)) == Material.lava) { +- this.motionY = (double)0.2F; +- this.motionX = (double)((this.ab.nextFloat() - this.ab.nextFloat()) * 0.2F); +- this.motionZ = (double)((this.ab.nextFloat() - this.ab.nextFloat()) * 0.2F); +- this.playSound("random.fizz", 0.4F, 2.0F + this.ab.nextFloat() * 0.4F); ++ this.motionY -= 0.029999999329447746D; ++ ++ if (this.worldObj.getBlockMaterial(MathHelper.floor_double(this.posX), MathHelper.floor_double(this.posY), MathHelper.floor_double(this.posZ)) == Material.lava) { ++ this.motionY = 0.20000000298023224D; ++ this.motionX = (double)((this.rand.nextFloat() - this.rand.nextFloat()) * 0.2F); ++ this.motionZ = (double)((this.rand.nextFloat() - this.rand.nextFloat()) * 0.2F); ++ this.playSound("random.fizz", 0.4F, 2.0F + this.rand.nextFloat() * 0.4F); + } + + this.pushOutOfBlocks(this.posX, (this.boundingBox.minY + this.boundingBox.maxY) / 2.0D, this.posZ); + double var1 = 8.0D; +- if(this.xpTargetColor < this.xpColor - 20 + this.entityId % 100) { +- if(this.closestPlayer == null || this.closestPlayer.getDistanceSqToEntity(this) > var1 * var1) { ++ ++ if (this.xpTargetColor < this.xpColor - 20 + this.entityId % 100) { ++ if (this.closestPlayer == null || this.closestPlayer.getDistanceSqToEntity(this) > var1 * var1) { + this.closestPlayer = this.worldObj.getClosestPlayerToEntity(this, var1); + } + + this.xpTargetColor = this.xpColor; + } + +- if(this.closestPlayer != null) { ++ if (this.closestPlayer != null) { + double var3 = (this.closestPlayer.posX - this.posX) / var1; + double var5 = (this.closestPlayer.posY + (double)this.closestPlayer.getEyeHeight() - this.posY) / var1; + double var7 = (this.closestPlayer.posZ - this.posZ) / var1; + double var9 = Math.sqrt(var3 * var3 + var5 * var5 + var7 * var7); + double var11 = 1.0D - var9; +- if(var11 > 0.0D) { ++ ++ if (var11 > 0.0D) { + var11 *= var11; + this.motionX += var3 / var9 * var11 * 0.1D; + this.motionY += var5 / var9 * var11 * 0.1D; +@@ -98,44 +132,71 @@ + + this.moveEntity(this.motionX, this.motionY, this.motionZ); + float var13 = 0.98F; +- if(this.onGround) { +- var13 = 0.1F * 0.1F * 58.8F; ++ ++ if (this.onGround) { ++ var13 = 0.58800006F; + int var4 = this.worldObj.getBlockId(MathHelper.floor_double(this.posX), MathHelper.floor_double(this.boundingBox.minY) - 1, MathHelper.floor_double(this.posZ)); +- if(var4 > 0) { ++ ++ if (var4 > 0) { + var13 = Block.blocksList[var4].slipperiness * 0.98F; ++ // Spout Start ++ if (!worldObj.isRemote) { ++ int x = MathHelper.floor_double(this.posX); ++ int y = MathHelper.floor_double(this.boundingBox.minY) - 1; ++ int z = MathHelper.floor_double(this.posZ); ++ short customId = Spoutcraft.getChunkAt(worldObj, x, y, z).getCustomBlockId(x, y, z); ++ if (customId > 0) { ++ CustomBlock block = MaterialData.getCustomBlock(customId); ++ if (block != null) { ++ var13 = block.getFriction() * 0.98F; ++ } ++ } ++ } ++ // Spout End + } + } + + this.motionX *= (double)var13; +- this.motionY *= (double)0.98F; ++ this.motionY *= 0.9800000190734863D; + this.motionZ *= (double)var13; +- if(this.onGround) { +- this.motionY *= (double)-0.9F; ++ ++ if (this.onGround) { ++ this.motionY *= -0.8999999761581421D; + } + + ++this.xpColor; + ++this.xpOrbAge; +- if(this.xpOrbAge >= 6000) { ++ ++ if (this.xpOrbAge >= 6000) { + this.setDead(); + } +- + } + ++ /** ++ * Returns if this entity is in water and will end up adding the waters velocity to the entity ++ */ + public boolean handleWaterMovement() { + return this.worldObj.handleMaterialAcceleration(this.boundingBox, Material.water, this); + } + +- protected void dealFireDamage(int var1) { +- this.attackEntityFrom(DamageSource.inFire, (float)var1); ++ /** ++ * Will deal the specified amount of damage to the entity if the entity isn't immune to fire damage. Args: amountDamage ++ */ ++ protected void dealFireDamage(int par1) { ++ this.attackEntityFrom(DamageSource.inFire, (float)par1); + } + +- public boolean attackEntityFrom(DamageSource var1, float var2) { +- if(this.isEntityInvulnerable()) { ++ /** ++ * Called when the entity is attacked. ++ */ ++ public boolean attackEntityFrom(DamageSource par1DamageSource, float par2) { ++ if (this.isEntityInvulnerable()) { + return false; + } else { + this.setBeenAttacked(); +- this.xpOrbHealth = (int)((float)this.xpOrbHealth - var2); +- if(this.xpOrbHealth <= 0) { ++ this.xpOrbHealth = (int)((float)this.xpOrbHealth - par2); ++ ++ if (this.xpOrbHealth <= 0) { + this.setDead(); + } + +@@ -143,43 +204,64 @@ + } + } + +- public void writeEntityToNBT(NBTTagCompound var1) { +- var1.setShort("Health", (short)((byte)this.xpOrbHealth)); +- var1.setShort("Age", (short)this.xpOrbAge); +- var1.setShort("Value", (short)this.xpValue); +- } +- +- public void readEntityFromNBT(NBTTagCompound var1) { +- this.xpOrbHealth = var1.getShort("Health") & 255; +- this.xpOrbAge = var1.getShort("Age"); +- this.xpValue = var1.getShort("Value"); +- } +- +- public void onCollideWithPlayer(EntityPlayer var1) { +- if(!this.worldObj.isRemote) { +- if(this.field_70532_c == 0 && var1.xpCooldown == 0) { +- var1.xpCooldown = 2; +- this.playSound("random.orb", 0.1F, 0.5F * ((this.ab.nextFloat() - this.ab.nextFloat()) * 0.7F + 1.8F)); +- var1.onItemPickup(this, 1); +- var1.addExperience(this.xpValue); ++ /** ++ * (abstract) Protected helper method to write subclass entity data to NBT. ++ */ ++ public void writeEntityToNBT(NBTTagCompound par1NBTTagCompound) { ++ par1NBTTagCompound.setShort("Health", (short)((byte)this.xpOrbHealth)); ++ par1NBTTagCompound.setShort("Age", (short)this.xpOrbAge); ++ par1NBTTagCompound.setShort("Value", (short)this.xpValue); ++ } ++ ++ /** ++ * (abstract) Protected helper method to read subclass entity data from NBT. ++ */ ++ public void readEntityFromNBT(NBTTagCompound par1NBTTagCompound) { ++ this.xpOrbHealth = par1NBTTagCompound.getShort("Health") & 255; ++ this.xpOrbAge = par1NBTTagCompound.getShort("Age"); ++ this.xpValue = par1NBTTagCompound.getShort("Value"); ++ } ++ ++ /** ++ * Called by a player entity when they collide with an entity ++ */ ++ public void onCollideWithPlayer(EntityPlayer par1EntityPlayer) { ++ if (!this.worldObj.isRemote) { ++ if (this.field_70532_c == 0 && par1EntityPlayer.xpCooldown == 0) { ++ par1EntityPlayer.xpCooldown = 2; ++ this.playSound("random.orb", 0.1F, 0.5F * ((this.rand.nextFloat() - this.rand.nextFloat()) * 0.7F + 1.8F)); ++ par1EntityPlayer.onItemPickup(this, 1); ++ par1EntityPlayer.addExperience(this.xpValue); + this.setDead(); + } +- + } + } + ++ /** ++ * Returns the XP value of this XP orb. ++ */ + public int getXpValue() { + return this.xpValue; + } + ++ /** ++ * Returns a number from 1 to 10 based on how much XP this orb is worth. This is used by RenderXPOrb to determine what ++ * texture to use. ++ */ + public int getTextureByXP() { + return this.xpValue >= 2477 ? 10 : (this.xpValue >= 1237 ? 9 : (this.xpValue >= 617 ? 8 : (this.xpValue >= 307 ? 7 : (this.xpValue >= 149 ? 6 : (this.xpValue >= 73 ? 5 : (this.xpValue >= 37 ? 4 : (this.xpValue >= 17 ? 3 : (this.xpValue >= 7 ? 2 : (this.xpValue >= 3 ? 1 : 0))))))))); + } + +- public static int getXPSplit(int var0) { +- return var0 >= 2477 ? 2477 : (var0 >= 1237 ? 1237 : (var0 >= 617 ? 617 : (var0 >= 307 ? 307 : (var0 >= 149 ? 149 : (var0 >= 73 ? 73 : (var0 >= 37 ? 37 : (var0 >= 17 ? 17 : (var0 >= 7 ? 7 : (var0 >= 3 ? 3 : 1))))))))); ++ /** ++ * Get xp split rate (Is called until the xp drop code in EntityLiving.onEntityUpdate is complete) ++ */ ++ public static int getXPSplit(int par0) { ++ return par0 >= 2477 ? 2477 : (par0 >= 1237 ? 1237 : (par0 >= 617 ? 617 : (par0 >= 307 ? 307 : (par0 >= 149 ? 149 : (par0 >= 73 ? 73 : (par0 >= 37 ? 37 : (par0 >= 17 ? 17 : (par0 >= 7 ? 7 : (par0 >= 3 ? 3 : 1))))))))); + } + ++ /** ++ * If returns false, the item will not inflict any damage against entities. ++ */ + public boolean canAttackWithItem() { + return false; + } diff --git a/patches/net/minecraft/src/EntityZombie.java.patch b/patches/net/minecraft/src/EntityZombie.java.patch new file mode 100644 index 0000000..76aa419 --- /dev/null +++ b/patches/net/minecraft/src/EntityZombie.java.patch @@ -0,0 +1,595 @@ +--- net/minecraft/src/EntityZombie.java ++++ net/minecraft/src/EntityZombie.java +@@ -5,12 +5,16 @@ + + public class EntityZombie extends EntityMob { + protected static final Attribute field_110186_bp = (new RangedAttribute("zombie.spawnReinforcements", 0.0D, 0.0D, 1.0D)).func_111117_a("Spawn Reinforcements Chance"); +- private static final UUID bq = UUID.fromString("B9766B59-9566-4402-BC1F-2EE2A276D836"); +- private static final AttributeModifier babySpeedBoostModifier = new AttributeModifier(bq, "Baby speed boost", 0.5D, 1); ++ private static final UUID babySpeedBoostUUID = UUID.fromString("B9766B59-9566-4402-BC1F-2EE2A276D836"); ++ private static final AttributeModifier babySpeedBoostModifier = new AttributeModifier(babySpeedBoostUUID, "Baby speed boost", 0.5D, 1); ++ ++ /** ++ * Ticker used to determine the time remaining for this zombie to convert into a villager when cured. ++ */ + private int conversionTime; + +- public EntityZombie(World var1) { +- super(var1); ++ public EntityZombie(World par1World) { ++ super(par1World); + this.getNavigator().setBreakDoors(true); + this.tasks.addTask(0, new EntityAISwimming(this)); + this.tasks.addTask(1, new EntityAIBreakDoor(this)); +@@ -29,9 +33,9 @@ + protected void applyEntityAttributes() { + super.applyEntityAttributes(); + this.getEntityAttribute(SharedMonsterAttributes.followRange).setAttribute(40.0D); +- this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setAttribute((double)0.23F); ++ this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setAttribute(0.23000000417232513D); + this.getEntityAttribute(SharedMonsterAttributes.attackDamage).setAttribute(3.0D); +- this.getAttributeMap().func_111150_b(field_110186_bp).setAttribute(this.ab.nextDouble() * (double)0.1F); ++ this.getAttributeMap().func_111150_b(field_110186_bp).setAttribute(this.rand.nextDouble() * 0.10000000149011612D); + } + + protected void entityInit() { +@@ -41,53 +45,80 @@ + this.getDataWatcher().addObject(14, Byte.valueOf((byte)0)); + } + ++ /** ++ * Returns the current armor value as determined by a call to InventoryPlayer.getTotalArmorValue ++ */ + public int getTotalArmorValue() { + int var1 = super.getTotalArmorValue() + 2; +- if(var1 > 20) { ++ ++ if (var1 > 20) { + var1 = 20; + } + + return var1; + } + ++ /** ++ * Returns true if the newer Entity AI code should be run ++ */ + protected boolean isAIEnabled() { + return true; + } + ++ /** ++ * If Animal, checks if the age timer is negative ++ */ + public boolean isChild() { + return this.getDataWatcher().getWatchableObjectByte(12) == 1; + } + +- public void setChild(boolean var1) { +- this.getDataWatcher().updateObject(12, Byte.valueOf((byte)(var1 ? 1 : 0))); +- if(this.worldObj != null && !this.worldObj.isRemote) { ++ /** ++ * Set whether this zombie is a child. ++ */ ++ public void setChild(boolean par1) { ++ this.getDataWatcher().updateObject(12, Byte.valueOf((byte)(par1 ? 1 : 0))); ++ ++ if (this.worldObj != null && !this.worldObj.isRemote) { + AttributeInstance var2 = this.getEntityAttribute(SharedMonsterAttributes.movementSpeed); + var2.removeModifier(babySpeedBoostModifier); +- if(var1) { ++ ++ if (par1) { + var2.applyModifier(babySpeedBoostModifier); + } + } +- + } + ++ /** ++ * Return whether this zombie is a villager. ++ */ + public boolean isVillager() { + return this.getDataWatcher().getWatchableObjectByte(13) == 1; + } + +- public void setVillager(boolean var1) { +- this.getDataWatcher().updateObject(13, Byte.valueOf((byte)(var1 ? 1 : 0))); ++ /** ++ * Set whether this zombie is a villager. ++ */ ++ public void setVillager(boolean par1) { ++ this.getDataWatcher().updateObject(13, Byte.valueOf((byte)(par1 ? 1 : 0))); + } + ++ /** ++ * Called frequently so the entity can update its state every tick as required. For example, zombies and skeletons use ++ * this to react to sunlight and start to burn. ++ */ + public void onLivingUpdate() { +- if(this.worldObj.isDaytime() && !this.worldObj.isRemote && !this.isChild()) { ++ if (this.worldObj.isDaytime() && !this.worldObj.isRemote && !this.isChild()) { + float var1 = this.getBrightness(1.0F); +- if(var1 > 0.5F && this.ab.nextFloat() * 30.0F < (var1 - 0.4F) * 2.0F && this.worldObj.canBlockSeeTheSky(MathHelper.floor_double(this.posX), MathHelper.floor_double(this.posY), MathHelper.floor_double(this.posZ))) { ++ ++ if (var1 > 0.5F && this.rand.nextFloat() * 30.0F < (var1 - 0.4F) * 2.0F && this.worldObj.canBlockSeeTheSky(MathHelper.floor_double(this.posX), MathHelper.floor_double(this.posY), MathHelper.floor_double(this.posZ))) { + boolean var2 = true; +- ItemStack var3 = this.getEquipmentInSlot(4); +- if(var3 != null) { +- if(var3.isItemStackDamageable()) { +- var3.setItemDamage(var3.getItemDamageForDisplay() + this.ab.nextInt(2)); +- if(var3.getItemDamageForDisplay() >= var3.getMaxDamage()) { ++ ItemStack var3 = this.getCurrentItemOrArmor(4); ++ ++ if (var3 != null) { ++ if (var3.isItemStackDamageable()) { ++ var3.setItemDamage(var3.getItemDamageForDisplay() + this.rand.nextInt(2)); ++ ++ if (var3.getItemDamageForDisplay() >= var3.getMaxDamage()) { + this.renderBrokenItemStack(var3); + this.setCurrentItemOrArmor(4, (ItemStack)null); + } +@@ -96,7 +127,7 @@ + var2 = false; + } + +- if(var2) { ++ if (var2) { + this.setFire(8); + } + } +@@ -105,37 +136,43 @@ + super.onLivingUpdate(); + } + +- public boolean attackEntityFrom(DamageSource var1, float var2) { +- if(!super.attackEntityFrom(var1, var2)) { ++ /** ++ * Called when the entity is attacked. ++ */ ++ public boolean attackEntityFrom(DamageSource par1DamageSource, float par2) { ++ if (!super.attackEntityFrom(par1DamageSource, par2)) { + return false; + } else { + EntityLivingBase var3 = this.getAttackTarget(); +- if(var3 == null && this.getEntityToAttack() instanceof EntityLivingBase) { ++ ++ if (var3 == null && this.getEntityToAttack() instanceof EntityLivingBase) { + var3 = (EntityLivingBase)this.getEntityToAttack(); + } + +- if(var3 == null && var1.getEntity() instanceof EntityLivingBase) { +- var3 = (EntityLivingBase)var1.getEntity(); ++ if (var3 == null && par1DamageSource.getEntity() instanceof EntityLivingBase) { ++ var3 = (EntityLivingBase)par1DamageSource.getEntity(); + } + +- if(var3 != null && this.worldObj.difficultySetting >= 3 && (double)this.ab.nextFloat() < this.getEntityAttribute(field_110186_bp).getAttributeValue()) { ++ if (var3 != null && this.worldObj.difficultySetting >= 3 && (double)this.rand.nextFloat() < this.getEntityAttribute(field_110186_bp).getAttributeValue()) { + int var4 = MathHelper.floor_double(this.posX); + int var5 = MathHelper.floor_double(this.posY); + int var6 = MathHelper.floor_double(this.posZ); + EntityZombie var7 = new EntityZombie(this.worldObj); + +- for(int var8 = 0; var8 < 50; ++var8) { +- int var9 = var4 + MathHelper.getRandomIntegerInRange(this.ab, 7, 40) * MathHelper.getRandomIntegerInRange(this.ab, -1, 1); +- int var10 = var5 + MathHelper.getRandomIntegerInRange(this.ab, 7, 40) * MathHelper.getRandomIntegerInRange(this.ab, -1, 1); +- int var11 = var6 + MathHelper.getRandomIntegerInRange(this.ab, 7, 40) * MathHelper.getRandomIntegerInRange(this.ab, -1, 1); +- if(this.worldObj.doesBlockHaveSolidTopSurface(var9, var10 - 1, var11) && this.worldObj.getBlockLightValue(var9, var10, var11) < 10) { ++ for (int var8 = 0; var8 < 50; ++var8) { ++ int var9 = var4 + MathHelper.getRandomIntegerInRange(this.rand, 7, 40) * MathHelper.getRandomIntegerInRange(this.rand, -1, 1); ++ int var10 = var5 + MathHelper.getRandomIntegerInRange(this.rand, 7, 40) * MathHelper.getRandomIntegerInRange(this.rand, -1, 1); ++ int var11 = var6 + MathHelper.getRandomIntegerInRange(this.rand, 7, 40) * MathHelper.getRandomIntegerInRange(this.rand, -1, 1); ++ ++ if (this.worldObj.doesBlockHaveSolidTopSurface(var9, var10 - 1, var11) && this.worldObj.getBlockLightValue(var9, var10, var11) < 10) { + var7.setPosition((double)var9, (double)var10, (double)var11); +- if(this.worldObj.checkNoEntityCollision(var7.boundingBox) && this.worldObj.getCollidingBoundingBoxes(var7, var7.boundingBox).isEmpty() && !this.worldObj.isAnyLiquid(var7.boundingBox)) { ++ ++ if (this.worldObj.checkNoEntityCollision(var7.boundingBox) && this.worldObj.getCollidingBoundingBoxes(var7, var7.boundingBox).isEmpty() && !this.worldObj.isAnyLiquid(var7.boundingBox)) { + this.worldObj.spawnEntityInWorld(var7); + var7.setAttackTarget(var3); + var7.onSpawnWithEgg((EntityLivingData)null); +- this.getEntityAttribute(field_110186_bp).applyModifier(new AttributeModifier("Zombie reinforcement caller charge", (double)-0.05F, 0)); +- var7.getEntityAttribute(field_110186_bp).applyModifier(new AttributeModifier("Zombie reinforcement callee charge", (double)-0.05F, 0)); ++ this.getEntityAttribute(field_110186_bp).applyModifier(new AttributeModifier("Zombie reinforcement caller charge", -0.05000000074505806D, 0)); ++ var7.getEntityAttribute(field_110186_bp).applyModifier(new AttributeModifier("Zombie reinforcement callee charge", -0.05000000074505806D, 0)); + break; + } + } +@@ -146,11 +183,15 @@ + } + } + ++ /** ++ * Called to update the entity's position/logic. ++ */ + public void onUpdate() { +- if(!this.worldObj.isRemote && this.isConverting()) { ++ if (!this.worldObj.isRemote && this.isConverting()) { + int var1 = this.getConversionTimeBoost(); + this.conversionTime -= var1; +- if(this.conversionTime <= 0) { ++ ++ if (this.conversionTime <= 0) { + this.convertToVillager(); + } + } +@@ -158,169 +199,213 @@ + super.onUpdate(); + } + +- public boolean attackEntityAsMob(Entity var1) { +- boolean var2 = super.attackEntityAsMob(var1); +- if(var2 && this.getHeldItem() == null && this.isBurning() && this.ab.nextFloat() < (float)this.worldObj.difficultySetting * 0.3F) { +- var1.setFire(2 * this.worldObj.difficultySetting); ++ public boolean attackEntityAsMob(Entity par1Entity) { ++ boolean var2 = super.attackEntityAsMob(par1Entity); ++ ++ if (var2 && this.getHeldItem() == null && this.isBurning() && this.rand.nextFloat() < (float)this.worldObj.difficultySetting * 0.3F) { ++ par1Entity.setFire(2 * this.worldObj.difficultySetting); + } + + return var2; + } + ++ /** ++ * Returns the sound this mob makes while it's alive. ++ */ + protected String getLivingSound() { + return "mob.zombie.say"; + } + ++ /** ++ * Returns the sound this mob makes when it is hurt. ++ */ + protected String getHurtSound() { + return "mob.zombie.hurt"; + } + ++ /** ++ * Returns the sound this mob makes on death. ++ */ + protected String getDeathSound() { + return "mob.zombie.death"; + } + +- protected void playStepSound(int var1, int var2, int var3, int var4) { ++ /** ++ * Plays step sound at given x, y, z for the entity ++ */ ++ protected void playStepSound(int par1, int par2, int par3, int par4) { + this.playSound("mob.zombie.step", 0.15F, 1.0F); + } + ++ /** ++ * Returns the item ID for the item the mob drops on death. ++ */ + protected int getDropItemId() { + return Item.rottenFlesh.itemID; + } + ++ /** ++ * Get this Entity's EnumCreatureAttribute ++ */ + public EnumCreatureAttribute getCreatureAttribute() { + return EnumCreatureAttribute.UNDEAD; + } + +- protected void dropRareDrop(int var1) { +- switch(this.ab.nextInt(3)) { +- case 0: +- this.dropItem(Item.ingotIron.itemID, 1); +- break; +- case 1: +- this.dropItem(Item.carrot.itemID, 1); +- break; +- case 2: +- this.dropItem(Item.potato.itemID, 1); ++ protected void dropRareDrop(int par1) { ++ switch (this.rand.nextInt(3)) { ++ case 0: ++ this.dropItem(Item.ingotIron.itemID, 1); ++ break; ++ ++ case 1: ++ this.dropItem(Item.carrot.itemID, 1); ++ break; ++ ++ case 2: ++ this.dropItem(Item.potato.itemID, 1); + } +- + } + ++ /** ++ * Makes entity wear random armor based on difficulty ++ */ + protected void addRandomArmor() { + super.addRandomArmor(); +- if(this.ab.nextFloat() < (this.worldObj.difficultySetting == 3 ? 0.05F : 0.01F)) { +- int var1 = this.ab.nextInt(3); +- if(var1 == 0) { ++ ++ if (this.rand.nextFloat() < (this.worldObj.difficultySetting == 3 ? 0.05F : 0.01F)) { ++ int var1 = this.rand.nextInt(3); ++ ++ if (var1 == 0) { + this.setCurrentItemOrArmor(0, new ItemStack(Item.swordIron)); + } else { + this.setCurrentItemOrArmor(0, new ItemStack(Item.shovelIron)); + } + } +- +- } +- +- public void writeEntityToNBT(NBTTagCompound var1) { +- super.writeEntityToNBT(var1); +- if(this.isChild()) { +- var1.setBoolean("IsBaby", true); +- } +- +- if(this.isVillager()) { +- var1.setBoolean("IsVillager", true); +- } +- +- var1.setInteger("ConversionTime", this.isConverting() ? this.conversionTime : -1); +- } +- +- public void readEntityFromNBT(NBTTagCompound var1) { +- super.readEntityFromNBT(var1); +- if(var1.getBoolean("IsBaby")) { ++ } ++ ++ /** ++ * (abstract) Protected helper method to write subclass entity data to NBT. ++ */ ++ public void writeEntityToNBT(NBTTagCompound par1NBTTagCompound) { ++ super.writeEntityToNBT(par1NBTTagCompound); ++ ++ if (this.isChild()) { ++ par1NBTTagCompound.setBoolean("IsBaby", true); ++ } ++ ++ if (this.isVillager()) { ++ par1NBTTagCompound.setBoolean("IsVillager", true); ++ } ++ ++ par1NBTTagCompound.setInteger("ConversionTime", this.isConverting() ? this.conversionTime : -1); ++ } ++ ++ /** ++ * (abstract) Protected helper method to read subclass entity data from NBT. ++ */ ++ public void readEntityFromNBT(NBTTagCompound par1NBTTagCompound) { ++ super.readEntityFromNBT(par1NBTTagCompound); ++ ++ if (par1NBTTagCompound.getBoolean("IsBaby")) { + this.setChild(true); + } + +- if(var1.getBoolean("IsVillager")) { ++ if (par1NBTTagCompound.getBoolean("IsVillager")) { + this.setVillager(true); + } + +- if(var1.hasKey("ConversionTime") && var1.getInteger("ConversionTime") > -1) { +- this.startConversion(var1.getInteger("ConversionTime")); ++ if (par1NBTTagCompound.hasKey("ConversionTime") && par1NBTTagCompound.getInteger("ConversionTime") > -1) { ++ this.startConversion(par1NBTTagCompound.getInteger("ConversionTime")); + } +- + } + +- public void onKillEntity(EntityLivingBase var1) { +- super.onKillEntity(var1); +- if(this.worldObj.difficultySetting >= 2 && var1 instanceof EntityVillager) { +- if(this.worldObj.difficultySetting == 2 && this.ab.nextBoolean()) { ++ /** ++ * This method gets called when the entity kills another one. ++ */ ++ public void onKillEntity(EntityLivingBase par1EntityLivingBase) { ++ super.onKillEntity(par1EntityLivingBase); ++ ++ if (this.worldObj.difficultySetting >= 2 && par1EntityLivingBase instanceof EntityVillager) { ++ if (this.worldObj.difficultySetting == 2 && this.rand.nextBoolean()) { + return; + } + + EntityZombie var2 = new EntityZombie(this.worldObj); +- var2.copyLocationAndAnglesFrom(var1); +- this.worldObj.removeEntity(var1); ++ var2.copyLocationAndAnglesFrom(par1EntityLivingBase); ++ this.worldObj.removeEntity(par1EntityLivingBase); + var2.onSpawnWithEgg((EntityLivingData)null); + var2.setVillager(true); +- if(var1.isChild()) { ++ ++ if (par1EntityLivingBase.isChild()) { + var2.setChild(true); + } + + this.worldObj.spawnEntityInWorld(var2); + this.worldObj.playAuxSFXAtEntity((EntityPlayer)null, 1016, (int)this.posX, (int)this.posY, (int)this.posZ, 0); + } +- + } + +- public EntityLivingData onSpawnWithEgg(EntityLivingData var1) { +- Object var4 = super.onSpawnWithEgg(var1); ++ public EntityLivingData onSpawnWithEgg(EntityLivingData par1EntityLivingData) { ++ Object par1EntityLivingData1 = super.onSpawnWithEgg(par1EntityLivingData); + float var2 = this.worldObj.getLocationTensionFactor(this.posX, this.posY, this.posZ); +- this.setCanPickUpLoot(this.ab.nextFloat() < 0.55F * var2); +- if(var4 == null) { +- var4 = new EntityZombieGroupData(this, this.worldObj.s.nextFloat() < 0.05F, this.worldObj.s.nextFloat() < 0.05F, (EntityZombieINNER1)null); ++ this.setCanPickUpLoot(this.rand.nextFloat() < 0.55F * var2); ++ ++ if (par1EntityLivingData1 == null) { ++ par1EntityLivingData1 = new EntityZombieGroupData(this, this.worldObj.rand.nextFloat() < 0.05F, this.worldObj.rand.nextFloat() < 0.05F, (EntityZombieINNER1)null); + } + +- if(var4 instanceof EntityZombieGroupData) { +- EntityZombieGroupData var3 = (EntityZombieGroupData)var4; +- if(var3.field_142046_b) { ++ if (par1EntityLivingData1 instanceof EntityZombieGroupData) { ++ EntityZombieGroupData var3 = (EntityZombieGroupData)par1EntityLivingData1; ++ ++ if (var3.field_142046_b) { + this.setVillager(true); + } + +- if(var3.field_142048_a) { ++ if (var3.field_142048_a) { + this.setChild(true); + } + } + + this.addRandomArmor(); + this.enchantEquipment(); +- if(this.getEquipmentInSlot(4) == null) { ++ ++ if (this.getCurrentItemOrArmor(4) == null) { + Calendar var5 = this.worldObj.getCurrentDate(); +- if(var5.get(2) + 1 == 10 && var5.get(5) == 31 && this.ab.nextFloat() < 0.25F) { +- this.setCurrentItemOrArmor(4, new ItemStack(this.ab.nextFloat() < 0.1F ? Block.pumpkinLantern : Block.pumpkin)); ++ ++ if (var5.get(2) + 1 == 10 && var5.get(5) == 31 && this.rand.nextFloat() < 0.25F) { ++ this.setCurrentItemOrArmor(4, new ItemStack(this.rand.nextFloat() < 0.1F ? Block.pumpkinLantern : Block.pumpkin)); + this.equipmentDropChances[4] = 0.0F; + } + } + +- this.getEntityAttribute(SharedMonsterAttributes.knockbackResistance).applyModifier(new AttributeModifier("Random spawn bonus", this.ab.nextDouble() * (double)0.05F, 0)); +- this.getEntityAttribute(SharedMonsterAttributes.followRange).applyModifier(new AttributeModifier("Random zombie-spawn bonus", this.ab.nextDouble() * 1.5D, 2)); +- if(this.ab.nextFloat() < var2 * 0.05F) { +- this.getEntityAttribute(field_110186_bp).applyModifier(new AttributeModifier("Leader zombie bonus", this.ab.nextDouble() * 0.25D + 0.5D, 0)); +- this.getEntityAttribute(SharedMonsterAttributes.maxHealth).applyModifier(new AttributeModifier("Leader zombie bonus", this.ab.nextDouble() * 3.0D + 1.0D, 2)); ++ this.getEntityAttribute(SharedMonsterAttributes.knockbackResistance).applyModifier(new AttributeModifier("Random spawn bonus", this.rand.nextDouble() * 0.05000000074505806D, 0)); ++ this.getEntityAttribute(SharedMonsterAttributes.followRange).applyModifier(new AttributeModifier("Random zombie-spawn bonus", this.rand.nextDouble() * 1.5D, 2)); ++ ++ if (this.rand.nextFloat() < var2 * 0.05F) { ++ this.getEntityAttribute(field_110186_bp).applyModifier(new AttributeModifier("Leader zombie bonus", this.rand.nextDouble() * 0.25D + 0.5D, 0)); ++ this.getEntityAttribute(SharedMonsterAttributes.maxHealth).applyModifier(new AttributeModifier("Leader zombie bonus", this.rand.nextDouble() * 3.0D + 1.0D, 2)); + } + +- return (EntityLivingData)var4; ++ return (EntityLivingData)par1EntityLivingData1; + } + +- public boolean interact(EntityPlayer var1) { +- ItemStack var2 = var1.getCurrentEquippedItem(); +- if(var2 != null && var2.getItem() == Item.appleGold && var2.getItemDamage() == 0 && this.isVillager() && this.isPotionActive(Potion.weakness)) { +- if(!var1.capabilities.isCreativeMode) { ++ /** ++ * Called when a player interacts with a mob. e.g. gets milk from a cow, gets into the saddle on a pig. ++ */ ++ public boolean interact(EntityPlayer par1EntityPlayer) { ++ ItemStack var2 = par1EntityPlayer.getCurrentEquippedItem(); ++ ++ if (var2 != null && var2.getItem() == Item.appleGold && var2.getItemDamage() == 0 && this.isVillager() && this.isPotionActive(Potion.weakness)) { ++ if (!par1EntityPlayer.capabilities.isCreativeMode) { + --var2.stackSize; + } + +- if(var2.stackSize <= 0) { +- var1.inventory.setInventorySlotContents(var1.inventory.currentItem, (ItemStack)null); ++ if (var2.stackSize <= 0) { ++ par1EntityPlayer.inventory.setInventorySlotContents(par1EntityPlayer.inventory.currentItem, (ItemStack)null); + } + +- if(!this.worldObj.isRemote) { +- this.startConversion(this.ab.nextInt(2401) + 3600); ++ if (!this.worldObj.isRemote) { ++ this.startConversion(this.rand.nextInt(2401) + 3600); + } + + return true; +@@ -329,37 +414,50 @@ + } + } + +- protected void startConversion(int var1) { +- this.conversionTime = var1; ++ /** ++ * Starts converting this zombie into a villager. The zombie converts into a villager after the specified time in ++ * ticks. ++ */ ++ protected void startConversion(int par1) { ++ this.conversionTime = par1; + this.getDataWatcher().updateObject(14, Byte.valueOf((byte)1)); + this.removePotionEffect(Potion.weakness.id); +- this.addPotionEffect(new PotionEffect(Potion.damageBoost.id, var1, Math.min(this.worldObj.difficultySetting - 1, 0))); ++ this.addPotionEffect(new PotionEffect(Potion.damageBoost.id, par1, Math.min(this.worldObj.difficultySetting - 1, 0))); + this.worldObj.setEntityState(this, (byte)16); + } + +- public void handleHealthUpdate(byte var1) { +- if(var1 == 16) { +- this.worldObj.playSound(this.posX + 0.5D, this.posY + 0.5D, this.posZ + 0.5D, "mob.zombie.remedy", 1.0F + this.ab.nextFloat(), this.ab.nextFloat() * 0.7F + 0.3F, false); ++ public void handleHealthUpdate(byte par1) { ++ if (par1 == 16) { ++ this.worldObj.playSound(this.posX + 0.5D, this.posY + 0.5D, this.posZ + 0.5D, "mob.zombie.remedy", 1.0F + this.rand.nextFloat(), this.rand.nextFloat() * 0.7F + 0.3F, false); + } else { +- super.handleHealthUpdate(var1); ++ super.handleHealthUpdate(par1); + } +- + } + ++ /** ++ * Determines if an entity can be despawned, used on idle far away entities ++ */ + protected boolean canDespawn() { + return !this.isConverting(); + } + ++ /** ++ * Returns whether this zombie is in the process of converting to a villager ++ */ + public boolean isConverting() { + return this.getDataWatcher().getWatchableObjectByte(14) == 1; + } + ++ /** ++ * Convert this zombie into a villager. ++ */ + protected void convertToVillager() { + EntityVillager var1 = new EntityVillager(this.worldObj); + var1.copyLocationAndAnglesFrom(this); + var1.onSpawnWithEgg((EntityLivingData)null); + var1.func_82187_q(); +- if(this.isChild()) { ++ ++ if (this.isChild()) { + var1.setGrowingAge(-24000); + } + +@@ -369,17 +467,22 @@ + this.worldObj.playAuxSFXAtEntity((EntityPlayer)null, 1017, (int)this.posX, (int)this.posY, (int)this.posZ, 0); + } + ++ /** ++ * Return the amount of time decremented from conversionTime every tick. ++ */ + protected int getConversionTimeBoost() { + int var1 = 1; +- if(this.ab.nextFloat() < 0.01F) { ++ ++ if (this.rand.nextFloat() < 0.01F) { + int var2 = 0; + +- for(int var3 = (int)this.posX - 4; var3 < (int)this.posX + 4 && var2 < 14; ++var3) { +- for(int var4 = (int)this.posY - 4; var4 < (int)this.posY + 4 && var2 < 14; ++var4) { +- for(int var5 = (int)this.posZ - 4; var5 < (int)this.posZ + 4 && var2 < 14; ++var5) { ++ for (int var3 = (int)this.posX - 4; var3 < (int)this.posX + 4 && var2 < 14; ++var3) { ++ for (int var4 = (int)this.posY - 4; var4 < (int)this.posY + 4 && var2 < 14; ++var4) { ++ for (int var5 = (int)this.posZ - 4; var5 < (int)this.posZ + 4 && var2 < 14; ++var5) { + int var6 = this.worldObj.getBlockId(var3, var4, var5); +- if(var6 == Block.fenceIron.blockID || var6 == Block.bed.blockID) { +- if(this.ab.nextFloat() < 0.3F) { ++ ++ if (var6 == Block.fenceIron.blockID || var6 == Block.bed.blockID) { ++ if (this.rand.nextFloat() < 0.3F) { + ++var1; + } + diff --git a/patches/net/minecraft/src/EntityZombieGroupData.java.patch b/patches/net/minecraft/src/EntityZombieGroupData.java.patch new file mode 100644 index 0000000..ad5f3fb --- /dev/null +++ b/patches/net/minecraft/src/EntityZombieGroupData.java.patch @@ -0,0 +1,27 @@ +--- net/minecraft/src/EntityZombieGroupData.java ++++ net/minecraft/src/EntityZombieGroupData.java +@@ -3,17 +3,18 @@ + class EntityZombieGroupData implements EntityLivingData { + public boolean field_142048_a; + public boolean field_142046_b; ++ + final EntityZombie field_142047_c; + +- private EntityZombieGroupData(EntityZombie var1, boolean var2, boolean var3) { +- this.field_142047_c = var1; ++ private EntityZombieGroupData(EntityZombie par1EntityZombie, boolean par2, boolean par3) { ++ this.field_142047_c = par1EntityZombie; + this.field_142048_a = false; + this.field_142046_b = false; +- this.field_142048_a = var2; +- this.field_142046_b = var3; ++ this.field_142048_a = par2; ++ this.field_142046_b = par3; + } + +- EntityZombieGroupData(EntityZombie var1, boolean var2, boolean var3, EntityZombieINNER1 var4) { +- this(var1, var2, var3); ++ EntityZombieGroupData(EntityZombie par1EntityZombie, boolean par2, boolean par3, EntityZombieINNER1 par4EntityZombieINNER1) { ++ this(par1EntityZombie, par2, par3); + } + } diff --git a/patches/net/minecraft/src/EnumArmorMaterial.java.patch b/patches/net/minecraft/src/EnumArmorMaterial.java.patch new file mode 100644 index 0000000..cce3cce --- /dev/null +++ b/patches/net/minecraft/src/EnumArmorMaterial.java.patch @@ -0,0 +1,70 @@ +--- net/minecraft/src/EnumArmorMaterial.java ++++ net/minecraft/src/EnumArmorMaterial.java +@@ -7,28 +7,53 @@ + GOLD(7, new int[]{2, 5, 3, 1}, 25), + DIAMOND(33, new int[]{3, 8, 6, 3}, 10); + ++ /** ++ * Holds the maximum damage factor (each piece multiply this by it's own value) of the material, this is the item ++ * damage (how much can absorb before breaks) ++ */ + private int maxDamageFactor; ++ ++ /** ++ * Holds the damage reduction (each 1 points is half a shield on gui) of each piece of armor (helmet, plate, legs and ++ * boots) ++ */ + private int[] damageReductionAmountArray; ++ ++ /** Return the enchantability factor of the material */ + private int enchantability; + +- private EnumArmorMaterial(int var3, int[] var4, int var5) { +- this.maxDamageFactor = var3; +- this.damageReductionAmountArray = var4; +- this.enchantability = var5; +- } +- +- public int getDurability(int var1) { +- return ItemArmor.getMaxDamageArray()[var1] * this.maxDamageFactor; +- } +- +- public int getDamageReductionAmount(int var1) { +- return this.damageReductionAmountArray[var1]; +- } +- ++ private EnumArmorMaterial(int par3, int[] par4ArrayOfInteger, int par5) { ++ this.maxDamageFactor = par3; ++ this.damageReductionAmountArray = par4ArrayOfInteger; ++ this.enchantability = par5; ++ } ++ ++ /** ++ * Returns the durability for a armor slot of for this type. ++ */ ++ public int getDurability(int par1) { ++ return ItemArmor.getMaxDamageArray()[par1] * this.maxDamageFactor; ++ } ++ ++ /** ++ * Return the damage reduction (each 1 point is a half a shield on gui) of the piece index passed (0 = helmet, 1 = ++ * plate, 2 = legs and 3 = boots) ++ */ ++ public int getDamageReductionAmount(int par1) { ++ return this.damageReductionAmountArray[par1]; ++ } ++ ++ /** ++ * Return the enchantability factor of the material. ++ */ + public int getEnchantability() { + return this.enchantability; + } + ++ /** ++ * Return the crafting material for this armor material, used to determine the item that can be used to repair an armor ++ * piece with an anvil ++ */ + public int getArmorCraftingMaterial() { + return this == CLOTH ? Item.leather.itemID : (this == CHAIN ? Item.ingotIron.itemID : (this == GOLD ? Item.ingotGold.itemID : (this == IRON ? Item.ingotIron.itemID : (this == DIAMOND ? Item.diamond.itemID : 0)))); + } diff --git a/patches/net/minecraft/src/EnumArt.java.patch b/patches/net/minecraft/src/EnumArt.java.patch new file mode 100644 index 0000000..128606c --- /dev/null +++ b/patches/net/minecraft/src/EnumArt.java.patch @@ -0,0 +1,31 @@ +--- net/minecraft/src/EnumArt.java ++++ net/minecraft/src/EnumArt.java +@@ -28,18 +28,21 @@ + Skeleton("Skeleton", 64, 48, 192, 64), + DonkeyKong("DonkeyKong", 64, 48, 192, 112); + ++ /** Holds the maximum length of paintings art title. */ + public static final int maxArtTitleLength = "SkullAndRoses".length(); +- public final String B; ++ ++ /** Painting Title. */ ++ public final String title; + public final int sizeX; + public final int sizeY; + public final int offsetX; + public final int offsetY; + +- private EnumArt(String var3, int var4, int var5, int var6, int var7) { +- this.B = var3; +- this.sizeX = var4; +- this.sizeY = var5; +- this.offsetX = var6; +- this.offsetY = var7; ++ private EnumArt(String par3Str, int par4, int par5, int par6, int par7) { ++ this.title = par3Str; ++ this.sizeX = par4; ++ this.sizeY = par5; ++ this.offsetX = par6; ++ this.offsetY = par7; + } + } diff --git a/patches/net/minecraft/src/EnumChatFormatting.java.patch b/patches/net/minecraft/src/EnumChatFormatting.java.patch new file mode 100644 index 0000000..b7b2c5a --- /dev/null +++ b/patches/net/minecraft/src/EnumChatFormatting.java.patch @@ -0,0 +1,103 @@ +--- net/minecraft/src/EnumChatFormatting.java ++++ net/minecraft/src/EnumChatFormatting.java +@@ -29,22 +29,21 @@ + UNDERLINE('n', true), + ITALIC('o', true), + RESET('r'); +- +- private static final Map w = new HashMap(); +- private static final Map x = new HashMap(); +- private static final Pattern y = Pattern.compile("(?i)" + String.valueOf('\u00a7') + "[0-9A-FK-OR]"); ++ private static final Map field_96321_w = new HashMap(); ++ private static final Map field_96331_x = new HashMap(); ++ private static final Pattern field_96330_y = Pattern.compile("(?i)" + String.valueOf('\u00a7') + "[0-9A-FK-OR]"); + private final char field_96329_z; + private final boolean field_96303_A; +- private final String B; ++ private final String field_96304_B; + +- private EnumChatFormatting(char var3) { +- this(var3, false); ++ private EnumChatFormatting(char par3) { ++ this(par3, false); + } + +- private EnumChatFormatting(char var3, boolean var4) { +- this.field_96329_z = var3; +- this.field_96303_A = var4; +- this.B = "\u00a7" + var3; ++ private EnumChatFormatting(char par3, boolean par4) { ++ this.field_96329_z = par3; ++ this.field_96303_A = par4; ++ this.field_96304_B = "\u00a7" + par3; + } + + public char func_96298_a() { +@@ -55,7 +54,10 @@ + return this.field_96303_A; + } + +- public boolean Checks() { ++ /** ++ * Checks if typo is a color. ++ */ ++ public boolean isColor() { + return !this.field_96303_A && this != RESET; + } + +@@ -64,25 +66,26 @@ + } + + public String toString() { +- return this.B; +- } +- +- public static String func_110646_a(String var0) { +- return var0 == null ? null : y.matcher(var0).replaceAll(""); +- } +- +- public static EnumChatFormatting func_96300_b(String var0) { +- return var0 == null ? null : (EnumChatFormatting)x.get(var0.toLowerCase()); +- } +- +- public static Collection func_96296_a(boolean var0, boolean var1) { ++ return this.field_96304_B; ++ } ++ ++ public static String func_110646_a(String par0Str) { ++ return par0Str == null ? null : field_96330_y.matcher(par0Str).replaceAll(""); ++ } ++ ++ public static EnumChatFormatting func_96300_b(String par0Str) { ++ return par0Str == null ? null : (EnumChatFormatting)field_96331_x.get(par0Str.toLowerCase()); ++ } ++ ++ public static Collection func_96296_a(boolean par0, boolean par1) { + ArrayList var2 = new ArrayList(); + EnumChatFormatting[] var3 = values(); + int var4 = var3.length; + +- for(int var5 = 0; var5 < var4; ++var5) { ++ for (int var5 = 0; var5 < var4; ++var5) { + EnumChatFormatting var6 = var3[var5]; +- if((!var6.Checks() || var0) && (!var6.func_96301_b() || var1)) { ++ ++ if ((!var6.isColor() || par0) && (!var6.func_96301_b() || par1)) { + var2.add(var6.func_96297_d()); + } + } +@@ -94,11 +97,10 @@ + EnumChatFormatting[] var0 = values(); + int var1 = var0.length; + +- for(int var2 = 0; var2 < var1; ++var2) { ++ for (int var2 = 0; var2 < var1; ++var2) { + EnumChatFormatting var3 = var0[var2]; +- w.put(Character.valueOf(var3.func_96298_a()), var3); +- x.put(var3.func_96297_d(), var3); ++ field_96321_w.put(Character.valueOf(var3.func_96298_a()), var3); ++ field_96331_x.put(var3.func_96297_d(), var3); + } +- + } + } diff --git a/patches/net/minecraft/src/EnumCreatureType.java.patch b/patches/net/minecraft/src/EnumCreatureType.java.patch new file mode 100644 index 0000000..471c7ab --- /dev/null +++ b/patches/net/minecraft/src/EnumCreatureType.java.patch @@ -0,0 +1,58 @@ +--- net/minecraft/src/EnumCreatureType.java ++++ net/minecraft/src/EnumCreatureType.java +@@ -6,22 +6,30 @@ + ambient(EntityAmbientCreature.class, 15, Material.air, true, false), + waterCreature(EntityWaterMob.class, 5, Material.water, true, false); + +- private final Class e; ++ /** ++ * The root class of creatures associated with this EnumCreatureType (IMobs for aggressive creatures, EntityAnimals for ++ * friendly ones) ++ */ ++ private final Class creatureClass; + private final int maxNumberOfCreature; + private final Material creatureMaterial; ++ ++ /** A flag indicating whether this creature type is peaceful. */ + private final boolean isPeacefulCreature; ++ ++ /** Whether this creature type is an animal. */ + private final boolean isAnimal; + +- private EnumCreatureType(Class var3, int var4, Material var5, boolean var6, boolean var7) { +- this.e = var3; +- this.maxNumberOfCreature = var4; +- this.creatureMaterial = var5; +- this.isPeacefulCreature = var6; +- this.isAnimal = var7; ++ private EnumCreatureType(Class par3Class, int par4, Material par5Material, boolean par6, boolean par7) { ++ this.creatureClass = par3Class; ++ this.maxNumberOfCreature = par4; ++ this.creatureMaterial = par5Material; ++ this.isPeacefulCreature = par6; ++ this.isAnimal = par7; + } + + public Class getCreatureClass() { +- return this.e; ++ return this.creatureClass; + } + + public int getMaxNumberOfCreature() { +@@ -32,10 +40,16 @@ + return this.creatureMaterial; + } + ++ /** ++ * Gets whether or not this creature type is peaceful. ++ */ + public boolean getPeacefulCreature() { + return this.isPeacefulCreature; + } + ++ /** ++ * Return whether this creature type is an animal. ++ */ + public boolean getAnimal() { + return this.isAnimal; + } diff --git a/patches/net/minecraft/src/EnumDoorHelper.java.patch b/patches/net/minecraft/src/EnumDoorHelper.java.patch new file mode 100644 index 0000000..280638b --- /dev/null +++ b/patches/net/minecraft/src/EnumDoorHelper.java.patch @@ -0,0 +1,29 @@ +--- net/minecraft/src/EnumDoorHelper.java ++++ net/minecraft/src/EnumDoorHelper.java +@@ -7,22 +7,25 @@ + try { + doorEnum[EnumDoor.OPENING.ordinal()] = 1; + } catch (NoSuchFieldError var4) { ++ ; + } + + try { + doorEnum[EnumDoor.WOOD_DOOR.ordinal()] = 2; + } catch (NoSuchFieldError var3) { ++ ; + } + + try { + doorEnum[EnumDoor.GRATES.ordinal()] = 3; + } catch (NoSuchFieldError var2) { ++ ; + } + + try { + doorEnum[EnumDoor.IRON_DOOR.ordinal()] = 4; + } catch (NoSuchFieldError var1) { ++ ; + } +- + } + } diff --git a/patches/net/minecraft/src/EnumEnchantmentType.java.patch b/patches/net/minecraft/src/EnumEnchantmentType.java.patch new file mode 100644 index 0000000..336567d --- /dev/null +++ b/patches/net/minecraft/src/EnumEnchantmentType.java.patch @@ -0,0 +1,30 @@ +--- net/minecraft/src/EnumEnchantmentType.java ++++ net/minecraft/src/EnumEnchantmentType.java +@@ -11,18 +11,21 @@ + digger, + bow; + +- public boolean canEnchantItem(Item var1) { +- if(this == all) { ++ /** ++ * Return true if the item passed can be enchanted by a enchantment of this type. ++ */ ++ public boolean canEnchantItem(Item par1Item) { ++ if (this == all) { + return true; +- } else if(var1 instanceof ItemArmor) { +- if(this == armor) { ++ } else if (par1Item instanceof ItemArmor) { ++ if (this == armor) { + return true; + } else { +- ItemArmor var2 = (ItemArmor)var1; ++ ItemArmor var2 = (ItemArmor)par1Item; + return var2.armorType == 0 ? this == armor_head : (var2.armorType == 2 ? this == armor_legs : (var2.armorType == 1 ? this == armor_torso : (var2.armorType == 3 ? this == armor_feet : false))); + } + } else { +- return var1 instanceof ItemSword ? this == weapon : (var1 instanceof ItemTool ? this == digger : (var1 instanceof ItemBow ? this == bow : false)); ++ return par1Item instanceof ItemSword ? this == weapon : (par1Item instanceof ItemTool ? this == digger : (par1Item instanceof ItemBow ? this == bow : false)); + } + } + } diff --git a/patches/net/minecraft/src/EnumEntitySize.java.patch b/patches/net/minecraft/src/EnumEntitySize.java.patch new file mode 100644 index 0000000..da56a08 --- /dev/null +++ b/patches/net/minecraft/src/EnumEntitySize.java.patch @@ -0,0 +1,127 @@ +--- net/minecraft/src/EnumEntitySize.java ++++ net/minecraft/src/EnumEntitySize.java +@@ -8,62 +8,68 @@ + SIZE_5, + SIZE_6; + +- public int multiplyBy32AndRound(double var1) { +- double var3 = var1 - ((double)MathHelper.floor_double(var1) + 0.5D); +- switch(EnumEntitySizeHelper.field_96565_a[this.ordinal()]) { +- case 1: +- if(var3 < 0.0D) { +- if(var3 < -0.3125D) { +- return MathHelper.ceiling_double_int(var1 * 32.0D); +- } +- } else if(var3 < 0.3125D) { +- return MathHelper.ceiling_double_int(var1 * 32.0D); +- } +- +- return MathHelper.floor_double(var1 * 32.0D); +- case 2: +- if(var3 < 0.0D) { +- if(var3 < -0.3125D) { +- return MathHelper.floor_double(var1 * 32.0D); +- } +- } else if(var3 < 0.3125D) { +- return MathHelper.floor_double(var1 * 32.0D); +- } +- +- return MathHelper.ceiling_double_int(var1 * 32.0D); +- case 3: +- if(var3 > 0.0D) { +- return MathHelper.floor_double(var1 * 32.0D); +- } +- +- return MathHelper.ceiling_double_int(var1 * 32.0D); +- case 4: +- if(var3 < 0.0D) { +- if(var3 < -0.1875D) { +- return MathHelper.ceiling_double_int(var1 * 32.0D); +- } +- } else if(var3 < 0.1875D) { +- return MathHelper.ceiling_double_int(var1 * 32.0D); +- } +- +- return MathHelper.floor_double(var1 * 32.0D); +- case 5: +- if(var3 < 0.0D) { +- if(var3 < -0.1875D) { +- return MathHelper.floor_double(var1 * 32.0D); +- } +- } else if(var3 < 0.1875D) { +- return MathHelper.floor_double(var1 * 32.0D); +- } +- +- return MathHelper.ceiling_double_int(var1 * 32.0D); +- case 6: +- default: +- if(var3 > 0.0D) { +- return MathHelper.ceiling_double_int(var1 * 32.0D); +- } else { +- return MathHelper.floor_double(var1 * 32.0D); +- } ++ public int multiplyBy32AndRound(double par1) { ++ double var3 = par1 - ((double)MathHelper.floor_double(par1) + 0.5D); ++ ++ switch (EnumEntitySizeHelper.field_96565_a[this.ordinal()]) { ++ case 1: ++ if (var3 < 0.0D) { ++ if (var3 < -0.3125D) { ++ return MathHelper.ceiling_double_int(par1 * 32.0D); ++ } ++ } else if (var3 < 0.3125D) { ++ return MathHelper.ceiling_double_int(par1 * 32.0D); ++ } ++ ++ return MathHelper.floor_double(par1 * 32.0D); ++ ++ case 2: ++ if (var3 < 0.0D) { ++ if (var3 < -0.3125D) { ++ return MathHelper.floor_double(par1 * 32.0D); ++ } ++ } else if (var3 < 0.3125D) { ++ return MathHelper.floor_double(par1 * 32.0D); ++ } ++ ++ return MathHelper.ceiling_double_int(par1 * 32.0D); ++ ++ case 3: ++ if (var3 > 0.0D) { ++ return MathHelper.floor_double(par1 * 32.0D); ++ } ++ ++ return MathHelper.ceiling_double_int(par1 * 32.0D); ++ ++ case 4: ++ if (var3 < 0.0D) { ++ if (var3 < -0.1875D) { ++ return MathHelper.ceiling_double_int(par1 * 32.0D); ++ } ++ } else if (var3 < 0.1875D) { ++ return MathHelper.ceiling_double_int(par1 * 32.0D); ++ } ++ ++ return MathHelper.floor_double(par1 * 32.0D); ++ ++ case 5: ++ if (var3 < 0.0D) { ++ if (var3 < -0.1875D) { ++ return MathHelper.floor_double(par1 * 32.0D); ++ } ++ } else if (var3 < 0.1875D) { ++ return MathHelper.floor_double(par1 * 32.0D); ++ } ++ ++ return MathHelper.ceiling_double_int(par1 * 32.0D); ++ ++ case 6: ++ default: ++ if (var3 > 0.0D) { ++ return MathHelper.ceiling_double_int(par1 * 32.0D); ++ } else { ++ return MathHelper.floor_double(par1 * 32.0D); ++ } + } + } + } diff --git a/patches/net/minecraft/src/EnumEntitySizeHelper.java.patch b/patches/net/minecraft/src/EnumEntitySizeHelper.java.patch new file mode 100644 index 0000000..5b0bb29 --- /dev/null +++ b/patches/net/minecraft/src/EnumEntitySizeHelper.java.patch @@ -0,0 +1,41 @@ +--- net/minecraft/src/EnumEntitySizeHelper.java ++++ net/minecraft/src/EnumEntitySizeHelper.java +@@ -7,32 +7,37 @@ + try { + field_96565_a[EnumEntitySize.SIZE_1.ordinal()] = 1; + } catch (NoSuchFieldError var6) { ++ ; + } + + try { + field_96565_a[EnumEntitySize.SIZE_2.ordinal()] = 2; + } catch (NoSuchFieldError var5) { ++ ; + } + + try { + field_96565_a[EnumEntitySize.SIZE_3.ordinal()] = 3; + } catch (NoSuchFieldError var4) { ++ ; + } + + try { + field_96565_a[EnumEntitySize.SIZE_4.ordinal()] = 4; + } catch (NoSuchFieldError var3) { ++ ; + } + + try { + field_96565_a[EnumEntitySize.SIZE_5.ordinal()] = 5; + } catch (NoSuchFieldError var2) { ++ ; + } + + try { + field_96565_a[EnumEntitySize.SIZE_6.ordinal()] = 6; + } catch (NoSuchFieldError var1) { ++ ; + } +- + } + } diff --git a/patches/net/minecraft/src/EnumFacing.java.patch b/patches/net/minecraft/src/EnumFacing.java.patch new file mode 100644 index 0000000..b796038 --- /dev/null +++ b/patches/net/minecraft/src/EnumFacing.java.patch @@ -0,0 +1,70 @@ +--- net/minecraft/src/EnumFacing.java ++++ net/minecraft/src/EnumFacing.java +@@ -8,21 +8,29 @@ + EAST(4, 5, -1, 0, 0), + WEST(5, 4, 1, 0, 0); + ++ /** Face order for D-U-N-S-E-W. */ + private final int order_a; ++ ++ /** Face order for U-D-S-N-W-E. */ + private final int order_b; + private final int frontOffsetX; + private final int frontOffsetY; + private final int frontOffsetZ; ++ ++ /** List of all values in EnumFacing. Order is D-U-N-S-E-W. */ + private static final EnumFacing[] faceList = new EnumFacing[6]; + +- private EnumFacing(int var3, int var4, int var5, int var6, int var7) { +- this.order_a = var3; +- this.order_b = var4; +- this.frontOffsetX = var5; +- this.frontOffsetY = var6; +- this.frontOffsetZ = var7; ++ private EnumFacing(int par3, int par4, int par5, int par6, int par7) { ++ this.order_a = par3; ++ this.order_b = par4; ++ this.frontOffsetX = par5; ++ this.frontOffsetY = par6; ++ this.frontOffsetZ = par7; + } + ++ /** ++ * Returns a offset that addresses the block in front of this facing. ++ */ + public int getFrontOffsetX() { + return this.frontOffsetX; + } +@@ -31,22 +39,27 @@ + return this.frontOffsetY; + } + ++ /** ++ * Returns a offset that addresses the block in front of this facing. ++ */ + public int getFrontOffsetZ() { + return this.frontOffsetZ; + } + +- public static EnumFacing getFront(int var0) { +- return faceList[var0 % faceList.length]; ++ /** ++ * Returns the facing that represents the block in front of it. ++ */ ++ public static EnumFacing getFront(int par0) { ++ return faceList[par0 % faceList.length]; + } + + static { + EnumFacing[] var0 = values(); + int var1 = var0.length; + +- for(int var2 = 0; var2 < var1; ++var2) { ++ for (int var2 = 0; var2 < var1; ++var2) { + EnumFacing var3 = var0[var2]; + faceList[var3.order_a] = var3; + } +- + } + } diff --git a/patches/net/minecraft/src/EnumGameType.java.patch b/patches/net/minecraft/src/EnumGameType.java.patch new file mode 100644 index 0000000..010b380 --- /dev/null +++ b/patches/net/minecraft/src/EnumGameType.java.patch @@ -0,0 +1,121 @@ +--- net/minecraft/src/EnumGameType.java ++++ net/minecraft/src/EnumGameType.java +@@ -5,57 +5,78 @@ + SURVIVAL(0, "survival"), + CREATIVE(1, "creative"), + ADVENTURE(2, "adventure"); +- + int id; +- String f; ++ String name; + +- private EnumGameType(int var3, String var4) { +- this.id = var3; +- this.f = var4; ++ private EnumGameType(int par3, String par4Str) { ++ this.id = par3; ++ this.name = par4Str; + } + ++ /** ++ * Returns the ID of this game type ++ */ + public int getID() { + return this.id; + } + ++ /** ++ * Returns the name of this game type ++ */ + public String getName() { +- return this.f; ++ return this.name; + } + +- public void configurePlayerCapabilities(PlayerCapabilities var1) { +- if(this == CREATIVE) { +- var1.allowFlying = true; +- var1.isCreativeMode = true; +- var1.disableDamage = true; ++ /** ++ * Configures the player capabilities based on the game type ++ */ ++ public void configurePlayerCapabilities(PlayerCapabilities par1PlayerCapabilities) { ++ if (this == CREATIVE) { ++ par1PlayerCapabilities.allowFlying = true; ++ par1PlayerCapabilities.isCreativeMode = true; ++ par1PlayerCapabilities.disableDamage = true; + } else { +- var1.allowFlying = false; +- var1.isCreativeMode = false; +- var1.disableDamage = false; +- var1.isFlying = false; ++ par1PlayerCapabilities.allowFlying = false; ++ par1PlayerCapabilities.isCreativeMode = false; ++ par1PlayerCapabilities.disableDamage = false; ++ par1PlayerCapabilities.isFlying = false; + } + +- var1.allowEdit = !this.isAdventure(); ++ par1PlayerCapabilities.allowEdit = !this.isAdventure(); + } + ++ /** ++ * Returns true if this is the ADVENTURE game type ++ */ + public boolean isAdventure() { + return this == ADVENTURE; + } + ++ /** ++ * Returns true if this is the CREATIVE game type ++ */ + public boolean isCreative() { + return this == CREATIVE; + } + ++ /** ++ * Returns true if this is the SURVIVAL or ADVENTURE game type ++ */ + public boolean isSurvivalOrAdventure() { + return this == SURVIVAL || this == ADVENTURE; + } + +- public static EnumGameType getByID(int var0) { ++ /** ++ * Returns the game type with the specified ID, or SURVIVAL if none found. Args: id ++ */ ++ public static EnumGameType getByID(int par0) { + EnumGameType[] var1 = values(); + int var2 = var1.length; + +- for(int var3 = 0; var3 < var2; ++var3) { ++ for (int var3 = 0; var3 < var2; ++var3) { + EnumGameType var4 = var1[var3]; +- if(var4.id == var0) { ++ ++ if (var4.id == par0) { + return var4; + } + } +@@ -63,13 +84,17 @@ + return SURVIVAL; + } + +- public static EnumGameType getByName(String var0) { ++ /** ++ * Returns the game type with the specified name, or SURVIVAL if none found. This is case sensitive. Args: name ++ */ ++ public static EnumGameType getByName(String par0Str) { + EnumGameType[] var1 = values(); + int var2 = var1.length; + +- for(int var3 = 0; var3 < var2; ++var3) { ++ for (int var3 = 0; var3 < var2; ++var3) { + EnumGameType var4 = var1[var3]; +- if(var4.f.equals(var0)) { ++ ++ if (var4.name.equals(par0Str)) { + return var4; + } + } diff --git a/patches/net/minecraft/src/EnumOptions.java.patch b/patches/net/minecraft/src/EnumOptions.java.patch new file mode 100644 index 0000000..5896df5 --- /dev/null +++ b/patches/net/minecraft/src/EnumOptions.java.patch @@ -0,0 +1,49 @@ +--- net/minecraft/src/EnumOptions.java ++++ net/minecraft/src/EnumOptions.java +@@ -33,18 +33,18 @@ + CHAT_WIDTH("options.chat.width", true, false), + CHAT_HEIGHT_FOCUSED("options.chat.height.focused", true, false), + CHAT_HEIGHT_UNFOCUSED("options.chat.height.unfocused", true, false); +- + private final boolean enumFloat; + private final boolean enumBoolean; +- private final String I; ++ private final String enumString; + +- public static EnumOptions getEnumOptions(int var0) { ++ public static EnumOptions getEnumOptions(int par0) { + EnumOptions[] var1 = values(); + int var2 = var1.length; + +- for(int var3 = 0; var3 < var2; ++var3) { ++ for (int var3 = 0; var3 < var2; ++var3) { + EnumOptions var4 = var1[var3]; +- if(var4.returnEnumOrdinal() == var0) { ++ ++ if (var4.returnEnumOrdinal() == par0) { + return var4; + } + } +@@ -52,10 +52,10 @@ + return null; + } + +- private EnumOptions(String var3, boolean var4, boolean var5) { +- this.I = var3; +- this.enumFloat = var4; +- this.enumBoolean = var5; ++ private EnumOptions(String par3Str, boolean par4, boolean par5) { ++ this.enumString = par3Str; ++ this.enumFloat = par4; ++ this.enumBoolean = par5; + } + + public boolean getEnumFloat() { +@@ -71,6 +71,6 @@ + } + + public String getEnumString() { +- return this.I; ++ return this.enumString; + } + } diff --git a/patches/net/minecraft/src/EnumOptionsHelper.java.patch b/patches/net/minecraft/src/EnumOptionsHelper.java.patch new file mode 100644 index 0000000..65a60bb --- /dev/null +++ b/patches/net/minecraft/src/EnumOptionsHelper.java.patch @@ -0,0 +1,89 @@ +--- net/minecraft/src/EnumOptionsHelper.java ++++ net/minecraft/src/EnumOptionsHelper.java +@@ -7,72 +7,85 @@ + try { + enumOptionsMappingHelperArray[EnumOptions.INVERT_MOUSE.ordinal()] = 1; + } catch (NoSuchFieldError var14) { ++ ; + } + + try { + enumOptionsMappingHelperArray[EnumOptions.VIEW_BOBBING.ordinal()] = 2; + } catch (NoSuchFieldError var13) { ++ ; + } + + try { + enumOptionsMappingHelperArray[EnumOptions.ANAGLYPH.ordinal()] = 3; + } catch (NoSuchFieldError var12) { ++ ; + } + + try { + enumOptionsMappingHelperArray[EnumOptions.ADVANCED_OPENGL.ordinal()] = 4; + } catch (NoSuchFieldError var11) { ++ ; + } + + try { + enumOptionsMappingHelperArray[EnumOptions.RENDER_CLOUDS.ordinal()] = 5; + } catch (NoSuchFieldError var10) { ++ ; + } + + try { + enumOptionsMappingHelperArray[EnumOptions.CHAT_COLOR.ordinal()] = 6; + } catch (NoSuchFieldError var9) { ++ ; + } + + try { + enumOptionsMappingHelperArray[EnumOptions.CHAT_LINKS.ordinal()] = 7; + } catch (NoSuchFieldError var8) { ++ ; + } + + try { + enumOptionsMappingHelperArray[EnumOptions.CHAT_LINKS_PROMPT.ordinal()] = 8; + } catch (NoSuchFieldError var7) { ++ ; + } + + try { + enumOptionsMappingHelperArray[EnumOptions.USE_SERVER_TEXTURES.ordinal()] = 9; + } catch (NoSuchFieldError var6) { ++ ; + } + + try { + enumOptionsMappingHelperArray[EnumOptions.SNOOPER_ENABLED.ordinal()] = 10; + } catch (NoSuchFieldError var5) { ++ ; + } + + try { + enumOptionsMappingHelperArray[EnumOptions.USE_FULLSCREEN.ordinal()] = 11; + } catch (NoSuchFieldError var4) { ++ ; + } + + try { + enumOptionsMappingHelperArray[EnumOptions.ENABLE_VSYNC.ordinal()] = 12; + } catch (NoSuchFieldError var3) { ++ ; + } + + try { + enumOptionsMappingHelperArray[EnumOptions.SHOW_CAPE.ordinal()] = 13; + } catch (NoSuchFieldError var2) { ++ ; + } + + try { + enumOptionsMappingHelperArray[EnumOptions.TOUCHSCREEN.ordinal()] = 14; + } catch (NoSuchFieldError var1) { ++ ; + } +- + } + } diff --git a/patches/net/minecraft/src/EnumRarity.java.patch b/patches/net/minecraft/src/EnumRarity.java.patch new file mode 100644 index 0000000..d958796 --- /dev/null +++ b/patches/net/minecraft/src/EnumRarity.java.patch @@ -0,0 +1,25 @@ +--- net/minecraft/src/EnumRarity.java ++++ net/minecraft/src/EnumRarity.java +@@ -6,11 +6,17 @@ + rare(11, "Rare"), + epic(13, "Epic"); + ++ /** ++ * A decimal representation of the hex color codes of a the color assigned to this rarity type. (13 becomes d as in ++ * \247d which is light purple) ++ */ + public final int rarityColor; +- public final String f; +- +- private EnumRarity(int var3, String var4) { +- this.rarityColor = var3; +- this.f = var4; ++ ++ /** Rarity name. */ ++ public final String rarityName; ++ ++ private EnumRarity(int par3, String par4Str) { ++ this.rarityColor = par3; ++ this.rarityName = par4Str; + } + } diff --git a/patches/net/minecraft/src/EnumSkyBlock.java.patch b/patches/net/minecraft/src/EnumSkyBlock.java.patch new file mode 100644 index 0000000..d8634ca --- /dev/null +++ b/patches/net/minecraft/src/EnumSkyBlock.java.patch @@ -0,0 +1,15 @@ +--- net/minecraft/src/EnumSkyBlock.java ++++ net/minecraft/src/EnumSkyBlock.java +@@ -3,10 +3,9 @@ + public enum EnumSkyBlock { + Sky(15), + Block(0); +- + public final int defaultLightValue; + +- private EnumSkyBlock(int var3) { +- this.defaultLightValue = var3; ++ private EnumSkyBlock(int par3) { ++ this.defaultLightValue = par3; + } + } diff --git a/patches/net/minecraft/src/EnumToolMaterial.java.patch b/patches/net/minecraft/src/EnumToolMaterial.java.patch new file mode 100644 index 0000000..8cdd29a --- /dev/null +++ b/patches/net/minecraft/src/EnumToolMaterial.java.patch @@ -0,0 +1,83 @@ +--- net/minecraft/src/EnumToolMaterial.java ++++ net/minecraft/src/EnumToolMaterial.java +@@ -7,40 +7,74 @@ + EMERALD(3, 1561, 8.0F, 3.0F, 10), + GOLD(0, 32, 12.0F, 0.0F, 22); + ++ /** ++ * The level of material this tool can harvest (3 = DIAMOND, 2 = IRON, 1 = STONE, 0 = IRON/GOLD) ++ */ + private final int harvestLevel; ++ ++ /** ++ * The number of uses this material allows. (wood = 59, stone = 131, iron = 250, diamond = 1561, gold = 32) ++ */ + private final int maxUses; ++ ++ /** ++ * The strength of this tool material against blocks which it is effective against. ++ */ + private final float efficiencyOnProperMaterial; ++ ++ /** Damage versus entities. */ + private final float damageVsEntity; ++ ++ /** Defines the natural enchantability factor of the material. */ + private final int enchantability; + +- private EnumToolMaterial(int var3, int var4, float var5, float var6, int var7) { +- this.harvestLevel = var3; +- this.maxUses = var4; +- this.efficiencyOnProperMaterial = var5; +- this.damageVsEntity = var6; +- this.enchantability = var7; ++ private EnumToolMaterial(int par3, int par4, float par5, float par6, int par7) { ++ this.harvestLevel = par3; ++ this.maxUses = par4; ++ this.efficiencyOnProperMaterial = par5; ++ this.damageVsEntity = par6; ++ this.enchantability = par7; + } + ++ /** ++ * The number of uses this material allows. (wood = 59, stone = 131, iron = 250, diamond = 1561, gold = 32) ++ */ + public int getMaxUses() { + return this.maxUses; + } + ++ /** ++ * The strength of this tool material against blocks which it is effective against. ++ */ + public float getEfficiencyOnProperMaterial() { + return this.efficiencyOnProperMaterial; + } + ++ /** ++ * Damage versus entities. ++ */ + public float getDamageVsEntity() { + return this.damageVsEntity; + } + ++ /** ++ * The level of material this tool can harvest (3 = DIAMOND, 2 = IRON, 1 = STONE, 0 = IRON/GOLD) ++ */ + public int getHarvestLevel() { + return this.harvestLevel; + } + ++ /** ++ * Return the natural enchantability factor of the material. ++ */ + public int getEnchantability() { + return this.enchantability; + } + ++ /** ++ * Return the crafting material for this tool material, used to determine the item that can be used to repair a tool ++ * with an anvil ++ */ + public int getToolCraftingMaterial() { + return this == WOOD ? Block.planks.blockID : (this == STONE ? Block.cobblestone.blockID : (this == GOLD ? Item.ingotGold.itemID : (this == IRON ? Item.ingotIron.itemID : (this == EMERALD ? Item.diamond.itemID : 0)))); + } diff --git a/patches/net/minecraft/src/ExceptionMcoHttp.java.patch b/patches/net/minecraft/src/ExceptionMcoHttp.java.patch new file mode 100644 index 0000000..5f42c9c --- /dev/null +++ b/patches/net/minecraft/src/ExceptionMcoHttp.java.patch @@ -0,0 +1,12 @@ +--- net/minecraft/src/ExceptionMcoHttp.java ++++ net/minecraft/src/ExceptionMcoHttp.java +@@ -1,7 +1,7 @@ + package net.minecraft.src; + + public class ExceptionMcoHttp extends RuntimeException { +- public ExceptionMcoHttp(String var1, Exception var2) { +- super(var1, var2); ++ public ExceptionMcoHttp(String par1Str, Exception par2Exception) { ++ super(par1Str, par2Exception); + } + } diff --git a/patches/net/minecraft/src/ExceptionMcoService.java.patch b/patches/net/minecraft/src/ExceptionMcoService.java.patch new file mode 100644 index 0000000..c085fc0 --- /dev/null +++ b/patches/net/minecraft/src/ExceptionMcoService.java.patch @@ -0,0 +1,27 @@ +--- net/minecraft/src/ExceptionMcoService.java ++++ net/minecraft/src/ExceptionMcoService.java +@@ -2,17 +2,17 @@ + + public class ExceptionMcoService extends Exception { + public final int field_96392_a; +- public final String b; ++ public final String field_96391_b; + public final int field_130097_c; + +- public ExceptionMcoService(int var1, String var2, int var3) { +- super(var2); +- this.field_96392_a = var1; +- this.b = var2; +- this.field_130097_c = var3; ++ public ExceptionMcoService(int par1, String par2Str, int par3) { ++ super(par2Str); ++ this.field_96392_a = par1; ++ this.field_96391_b = par2Str; ++ this.field_130097_c = par3; + } + + public String toString() { +- return this.field_130097_c != -1 ? "Realms ( ErrorCode: " + this.field_130097_c + " )" : "Realms: " + this.b; ++ return this.field_130097_c != -1 ? "Realms ( ErrorCode: " + this.field_130097_c + " )" : "Realms: " + this.field_96391_b; + } + } diff --git a/patches/net/minecraft/src/ExceptionRetryCall.java.patch b/patches/net/minecraft/src/ExceptionRetryCall.java.patch new file mode 100644 index 0000000..040e8ee --- /dev/null +++ b/patches/net/minecraft/src/ExceptionRetryCall.java.patch @@ -0,0 +1,13 @@ +--- net/minecraft/src/ExceptionRetryCall.java ++++ net/minecraft/src/ExceptionRetryCall.java +@@ -3,8 +3,8 @@ + public class ExceptionRetryCall extends ExceptionMcoService { + public final int field_96393_c; + +- public ExceptionRetryCall(int var1) { ++ public ExceptionRetryCall(int par1) { + super(503, "Retry operation", -1); +- this.field_96393_c = var1; ++ this.field_96393_c = par1; + } + } diff --git a/patches/net/minecraft/src/Explosion.java.patch b/patches/net/minecraft/src/Explosion.java.patch new file mode 100644 index 0000000..2701a24 --- /dev/null +++ b/patches/net/minecraft/src/Explosion.java.patch @@ -0,0 +1,248 @@ +--- net/minecraft/src/Explosion.java ++++ net/minecraft/src/Explosion.java +@@ -9,42 +9,51 @@ + import java.util.Random; + + public class Explosion { ++ ++ /** whether or not the explosion sets fire to blocks around it */ + public boolean isFlaming; ++ ++ /** whether or not this explosion spawns smoke particles */ + public boolean isSmoking = true; + private int field_77289_h = 16; +- private Random j = new Random(); ++ private Random explosionRNG = new Random(); + private World worldObj; + public double explosionX; + public double explosionY; + public double explosionZ; + public Entity exploder; + public float explosionSize; +- public List h = new ArrayList(); +- private Map l = new HashMap(); +- +- public Explosion(World var1, Entity var2, double var3, double var5, double var7, float var9) { +- this.worldObj = var1; +- this.exploder = var2; +- this.explosionSize = var9; +- this.explosionX = var3; +- this.explosionY = var5; +- this.explosionZ = var7; ++ ++ /** A list of ChunkPositions of blocks affected by this explosion */ ++ public List affectedBlockPositions = new ArrayList(); ++ private Map field_77288_k = new HashMap(); ++ ++ public Explosion(World par1World, Entity par2Entity, double par3, double par5, double par7, float par9) { ++ this.worldObj = par1World; ++ this.exploder = par2Entity; ++ this.explosionSize = par9; ++ this.explosionX = par3; ++ this.explosionY = par5; ++ this.explosionZ = par7; + } + ++ /** ++ * Does the first part of the explosion (destroy blocks) ++ */ + public void doExplosionA() { + float var1 = this.explosionSize; + HashSet var2 = new HashSet(); +- + int var3; + int var4; + int var5; + double var15; + double var17; + double var19; +- for(var3 = 0; var3 < this.field_77289_h; ++var3) { +- for(var4 = 0; var4 < this.field_77289_h; ++var4) { +- for(var5 = 0; var5 < this.field_77289_h; ++var5) { +- if(var3 == 0 || var3 == this.field_77289_h - 1 || var4 == 0 || var4 == this.field_77289_h - 1 || var5 == 0 || var5 == this.field_77289_h - 1) { ++ ++ for (var3 = 0; var3 < this.field_77289_h; ++var3) { ++ for (var4 = 0; var4 < this.field_77289_h; ++var4) { ++ for (var5 = 0; var5 < this.field_77289_h; ++var5) { ++ if (var3 == 0 || var3 == this.field_77289_h - 1 || var4 == 0 || var4 == this.field_77289_h - 1 || var5 == 0 || var5 == this.field_77289_h - 1) { + double var6 = (double)((float)var3 / ((float)this.field_77289_h - 1.0F) * 2.0F - 1.0F); + double var8 = (double)((float)var4 / ((float)this.field_77289_h - 1.0F) * 2.0F - 1.0F); + double var10 = (double)((float)var5 / ((float)this.field_77289_h - 1.0F) * 2.0F - 1.0F); +@@ -52,23 +61,24 @@ + var6 /= var12; + var8 /= var12; + var10 /= var12; +- float var14 = this.explosionSize * (0.7F + this.worldObj.s.nextFloat() * 0.6F); ++ float var14 = this.explosionSize * (0.7F + this.worldObj.rand.nextFloat() * 0.6F); + var15 = this.explosionX; + var17 = this.explosionY; + var19 = this.explosionZ; + +- for(float var21 = 0.3F; var14 > 0.0F; var14 -= var21 * (12.0F / 16.0F)) { ++ for (float var21 = 0.3F; var14 > 0.0F; var14 -= var21 * 0.75F) { + int var22 = MathHelper.floor_double(var15); + int var23 = MathHelper.floor_double(var17); + int var24 = MathHelper.floor_double(var19); + int var25 = this.worldObj.getBlockId(var22, var23, var24); +- if(var25 > 0) { ++ ++ if (var25 > 0) { + Block var26 = Block.blocksList[var25]; + float var27 = this.exploder != null ? this.exploder.getBlockExplosionResistance(this, this.worldObj, var22, var23, var24, var26) : var26.getExplosionResistance(this.exploder); + var14 -= (var27 + 0.3F) * var21; + } + +- if(var14 > 0.0F && (this.exploder == null || this.exploder.shouldExplodeBlock(this, this.worldObj, var22, var23, var24, var25, var14))) { ++ if (var14 > 0.0F && (this.exploder == null || this.exploder.shouldExplodeBlock(this, this.worldObj, var22, var23, var24, var25, var14))) { + var2.add(new ChunkPosition(var22, var23, var24)); + } + +@@ -81,7 +91,7 @@ + } + } + +- this.h.addAll(var2); ++ this.affectedBlockPositions.addAll(var2); + this.explosionSize *= 2.0F; + var3 = MathHelper.floor_double(this.explosionX - (double)this.explosionSize - 1.0D); + var4 = MathHelper.floor_double(this.explosionX + (double)this.explosionSize + 1.0D); +@@ -92,15 +102,17 @@ + List var9 = this.worldObj.getEntitiesWithinAABBExcludingEntity(this.exploder, AxisAlignedBB.getAABBPool().getAABB((double)var3, (double)var5, (double)var7, (double)var4, (double)var29, (double)var30)); + Vec3 var31 = this.worldObj.getWorldVec3Pool().getVecFromPool(this.explosionX, this.explosionY, this.explosionZ); + +- for(int var11 = 0; var11 < var9.size(); ++var11) { ++ for (int var11 = 0; var11 < var9.size(); ++var11) { + Entity var32 = (Entity)var9.get(var11); + double var13 = var32.getDistance(this.explosionX, this.explosionY, this.explosionZ) / (double)this.explosionSize; +- if(var13 <= 1.0D) { ++ ++ if (var13 <= 1.0D) { + var15 = var32.posX - this.explosionX; + var17 = var32.posY + (double)var32.getEyeHeight() - this.explosionY; + var19 = var32.posZ - this.explosionZ; + double var33 = (double)MathHelper.sqrt_double(var15 * var15 + var17 * var17 + var19 * var19); +- if(var33 != 0.0D) { ++ ++ if (var33 != 0.0D) { + var15 /= var33; + var17 /= var33; + var19 /= var33; +@@ -111,8 +123,9 @@ + var32.motionX += var15 * var36; + var32.motionY += var17 * var36; + var32.motionZ += var19 * var36; +- if(var32 instanceof EntityPlayer) { +- this.l.put((EntityPlayer)var32, this.worldObj.getWorldVec3Pool().getVecFromPool(var15 * var35, var17 * var35, var19 * var35)); ++ ++ if (var32 instanceof EntityPlayer) { ++ this.field_77288_k.put((EntityPlayer)var32, this.worldObj.getWorldVec3Pool().getVecFromPool(var15 * var35, var17 * var35, var19 * var35)); + } + } + } +@@ -121,9 +134,13 @@ + this.explosionSize = var1; + } + +- public void doExplosionB(boolean var1) { +- this.worldObj.playSoundEffect(this.explosionX, this.explosionY, this.explosionZ, "random.explode", 4.0F, (1.0F + (this.worldObj.s.nextFloat() - this.worldObj.s.nextFloat()) * 0.2F) * 0.7F); +- if(this.explosionSize >= 2.0F && this.isSmoking) { ++ /** ++ * Does the second part of the explosion (sound, particles, drop spawn) ++ */ ++ public void doExplosionB(boolean par1) { ++ this.worldObj.playSoundEffect(this.explosionX, this.explosionY, this.explosionZ, "random.explode", 4.0F, (1.0F + (this.worldObj.rand.nextFloat() - this.worldObj.rand.nextFloat()) * 0.2F) * 0.7F); ++ ++ if (this.explosionSize >= 2.0F && this.isSmoking) { + this.worldObj.spawnParticle("hugeexplosion", this.explosionX, this.explosionY, this.explosionZ, 1.0D, 0.0D, 0.0D); + } else { + this.worldObj.spawnParticle("largeexplode", this.explosionX, this.explosionY, this.explosionZ, 1.0D, 0.0D, 0.0D); +@@ -135,19 +152,21 @@ + int var5; + int var6; + int var7; +- if(this.isSmoking) { +- var2 = this.h.iterator(); +- +- while(var2.hasNext()) { ++ ++ if (this.isSmoking) { ++ var2 = this.affectedBlockPositions.iterator(); ++ ++ while (var2.hasNext()) { + var3 = (ChunkPosition)var2.next(); + var4 = var3.x; + var5 = var3.y; + var6 = var3.z; + var7 = this.worldObj.getBlockId(var4, var5, var6); +- if(var1) { +- double var8 = (double)((float)var4 + this.worldObj.s.nextFloat()); +- double var10 = (double)((float)var5 + this.worldObj.s.nextFloat()); +- double var12 = (double)((float)var6 + this.worldObj.s.nextFloat()); ++ ++ if (par1) { ++ double var8 = (double)((float)var4 + this.worldObj.rand.nextFloat()); ++ double var10 = (double)((float)var5 + this.worldObj.rand.nextFloat()); ++ double var12 = (double)((float)var6 + this.worldObj.rand.nextFloat()); + double var14 = var8 - this.explosionX; + double var16 = var10 - this.explosionY; + double var18 = var12 - this.explosionZ; +@@ -156,7 +175,7 @@ + var16 /= var20; + var18 /= var20; + double var22 = 0.5D / (var20 / (double)this.explosionSize + 0.1D); +- var22 *= (double)(this.worldObj.s.nextFloat() * this.worldObj.s.nextFloat() + 0.3F); ++ var22 *= (double)(this.worldObj.rand.nextFloat() * this.worldObj.rand.nextFloat() + 0.3F); + var14 *= var22; + var16 *= var22; + var18 *= var22; +@@ -164,9 +183,10 @@ + this.worldObj.spawnParticle("smoke", var8, var10, var12, var14, var16, var18); + } + +- if(var7 > 0) { ++ if (var7 > 0) { + Block var24 = Block.blocksList[var7]; +- if(var24.canDropFromExplosion(this)) { ++ ++ if (var24.canDropFromExplosion(this)) { + var24.dropBlockAsItemWithChance(this.worldObj, var4, var5, var6, this.worldObj.getBlockMetadata(var4, var5, var6), 1.0F / this.explosionSize, 0); + } + +@@ -176,28 +196,31 @@ + } + } + +- if(this.isFlaming) { +- var2 = this.h.iterator(); ++ if (this.isFlaming) { ++ var2 = this.affectedBlockPositions.iterator(); + +- while(var2.hasNext()) { ++ while (var2.hasNext()) { + var3 = (ChunkPosition)var2.next(); + var4 = var3.x; + var5 = var3.y; + var6 = var3.z; + var7 = this.worldObj.getBlockId(var4, var5, var6); + int var25 = this.worldObj.getBlockId(var4, var5 - 1, var6); +- if(var7 == 0 && Block.opaqueCubeLookup[var25] && this.j.nextInt(3) == 0) { ++ ++ if (var7 == 0 && Block.opaqueCubeLookup[var25] && this.explosionRNG.nextInt(3) == 0) { + this.worldObj.setBlock(var4, var5, var6, Block.fire.blockID); + } + } + } +- + } + + public Map func_77277_b() { +- return this.l; ++ return this.field_77288_k; + } + ++ /** ++ * Returns either the entity that placed the explosive block, the entity that caused the explosion or null. ++ */ + public EntityLivingBase getExplosivePlacedBy() { + return this.exploder == null ? null : (this.exploder instanceof EntityTNTPrimed ? ((EntityTNTPrimed)this.exploder).getTntPlacedBy() : (this.exploder instanceof EntityLivingBase ? (EntityLivingBase)this.exploder : null)); + } diff --git a/patches/net/minecraft/src/ExtendedBlockStorage.java.patch b/patches/net/minecraft/src/ExtendedBlockStorage.java.patch new file mode 100644 index 0000000..683e697 --- /dev/null +++ b/patches/net/minecraft/src/ExtendedBlockStorage.java.patch @@ -0,0 +1,354 @@ +--- net/minecraft/src/ExtendedBlockStorage.java ++++ net/minecraft/src/ExtendedBlockStorage.java +@@ -1,121 +1,191 @@ + package net.minecraft.src; + + public class ExtendedBlockStorage { ++ ++ /** ++ * Contains the bottom-most Y block represented by this ExtendedBlockStorage. Typically a multiple of 16. ++ */ + private int yBase; ++ ++ /** ++ * A total count of the number of non-air blocks in this block storage's Chunk. ++ */ + private int blockRefCount; ++ ++ /** ++ * Contains the number of blocks in this block storage's parent chunk that require random ticking. Used to cull the ++ * Chunk from random tick updates for performance reasons. ++ */ + private int tickRefCount; ++ ++ /** ++ * Contains the least significant 8 bits of each block ID belonging to this block storage's parent Chunk. ++ */ + private byte[] blockLSBArray; ++ ++ /** ++ * Contains the most significant 4 bits of each block ID belonging to this block storage's parent Chunk. ++ */ + private NibbleArray blockMSBArray; ++ ++ /** ++ * Stores the metadata associated with blocks in this ExtendedBlockStorage. ++ */ + private NibbleArray blockMetadataArray; ++ ++ /** The NibbleArray containing a block of Block-light data. */ + private NibbleArray blocklightArray; ++ ++ /** The NibbleArray containing a block of Sky-light data. */ + private NibbleArray skylightArray; + +- public ExtendedBlockStorage(int var1, boolean var2) { +- this.yBase = var1; ++ public ExtendedBlockStorage(int par1, boolean par2) { ++ this.yBase = par1; + this.blockLSBArray = new byte[4096]; + this.blockMetadataArray = new NibbleArray(this.blockLSBArray.length, 4); + this.blocklightArray = new NibbleArray(this.blockLSBArray.length, 4); +- if(var2) { ++ ++ if (par2) { + this.skylightArray = new NibbleArray(this.blockLSBArray.length, 4); + } +- +- } +- +- public int getExtBlockID(int var1, int var2, int var3) { +- int var4 = this.blockLSBArray[var2 << 8 | var3 << 4 | var1] & 255; +- return this.blockMSBArray != null ? this.blockMSBArray.get(var1, var2, var3) << 8 | var4 : var4; +- } +- +- public void setExtBlockID(int var1, int var2, int var3, int var4) { +- int var5 = this.blockLSBArray[var2 << 8 | var3 << 4 | var1] & 255; +- if(this.blockMSBArray != null) { +- var5 |= this.blockMSBArray.get(var1, var2, var3) << 8; ++ } ++ ++ /** ++ * Returns the extended block ID for a location in a chunk, merged from a byte array and a NibbleArray to form a full ++ * 12-bit block ID. ++ */ ++ public int getExtBlockID(int par1, int par2, int par3) { ++ int var4 = this.blockLSBArray[par2 << 8 | par3 << 4 | par1] & 255; ++ return this.blockMSBArray != null ? this.blockMSBArray.get(par1, par2, par3) << 8 | var4 : var4; ++ } ++ ++ /** ++ * Sets the extended block ID for a location in a chunk, splitting bits 11..8 into a NibbleArray and bits 7..0 into a ++ * byte array. Also performs reference counting to determine whether or not to broadly cull this Chunk from the random- ++ * update tick list. ++ */ ++ public void setExtBlockID(int par1, int par2, int par3, int par4) { ++ int var5 = this.blockLSBArray[par2 << 8 | par3 << 4 | par1] & 255; ++ ++ if (this.blockMSBArray != null) { ++ var5 |= this.blockMSBArray.get(par1, par2, par3) << 8; + } + +- if(var5 == 0 && var4 != 0) { ++ if (var5 == 0 && par4 != 0) { + ++this.blockRefCount; +- if(Block.blocksList[var4] != null && Block.blocksList[var4].getTickRandomly()) { ++ ++ if (Block.blocksList[par4] != null && Block.blocksList[par4].getTickRandomly()) { + ++this.tickRefCount; + } +- } else if(var5 != 0 && var4 == 0) { ++ } else if (var5 != 0 && par4 == 0) { + --this.blockRefCount; +- if(Block.blocksList[var5] != null && Block.blocksList[var5].getTickRandomly()) { ++ ++ if (Block.blocksList[var5] != null && Block.blocksList[var5].getTickRandomly()) { + --this.tickRefCount; + } +- } else if(Block.blocksList[var5] == null || !Block.blocksList[var5].getTickRandomly() || Block.blocksList[var4] != null && Block.blocksList[var4].getTickRandomly()) { +- if((Block.blocksList[var5] == null || !Block.blocksList[var5].getTickRandomly()) && Block.blocksList[var4] != null && Block.blocksList[var4].getTickRandomly()) { +- ++this.tickRefCount; +- } +- } else { ++ } else if (Block.blocksList[var5] != null && Block.blocksList[var5].getTickRandomly() && (Block.blocksList[par4] == null || !Block.blocksList[par4].getTickRandomly())) { + --this.tickRefCount; ++ } else if ((Block.blocksList[var5] == null || !Block.blocksList[var5].getTickRandomly()) && Block.blocksList[par4] != null && Block.blocksList[par4].getTickRandomly()) { ++ ++this.tickRefCount; + } + +- this.blockLSBArray[var2 << 8 | var3 << 4 | var1] = (byte)(var4 & 255); +- if(var4 > 255) { +- if(this.blockMSBArray == null) { ++ this.blockLSBArray[par2 << 8 | par3 << 4 | par1] = (byte)(par4 & 255); ++ ++ if (par4 > 255) { ++ if (this.blockMSBArray == null) { + this.blockMSBArray = new NibbleArray(this.blockLSBArray.length, 4); + } + +- this.blockMSBArray.set(var1, var2, var3, (var4 & 3840) >> 8); +- } else if(this.blockMSBArray != null) { +- this.blockMSBArray.set(var1, var2, var3, 0); ++ this.blockMSBArray.set(par1, par2, par3, (par4 & 3840) >> 8); ++ } else if (this.blockMSBArray != null) { ++ this.blockMSBArray.set(par1, par2, par3, 0); + } +- +- } +- +- public int getExtBlockMetadata(int var1, int var2, int var3) { +- return this.blockMetadataArray.get(var1, var2, var3); +- } +- +- public void setExtBlockMetadata(int var1, int var2, int var3, int var4) { +- this.blockMetadataArray.set(var1, var2, var3, var4); +- } +- ++ } ++ ++ /** ++ * Returns the metadata associated with the block at the given coordinates in this ExtendedBlockStorage. ++ */ ++ public int getExtBlockMetadata(int par1, int par2, int par3) { ++ return this.blockMetadataArray.get(par1, par2, par3); ++ } ++ ++ /** ++ * Sets the metadata of the Block at the given coordinates in this ExtendedBlockStorage to the given metadata. ++ */ ++ public void setExtBlockMetadata(int par1, int par2, int par3, int par4) { ++ this.blockMetadataArray.set(par1, par2, par3, par4); ++ } ++ ++ /** ++ * Returns whether or not this block storage's Chunk is fully empty, based on its internal reference count. ++ */ + public boolean isEmpty() { + return this.blockRefCount == 0; + } + ++ /** ++ * Returns whether or not this block storage's Chunk will require random ticking, used to avoid looping through random ++ * block ticks when there are no blocks that would randomly tick. ++ */ + public boolean getNeedsRandomTick() { + return this.tickRefCount > 0; + } + ++ /** ++ * Returns the Y location of this ExtendedBlockStorage. ++ */ + public int getYLocation() { + return this.yBase; + } + +- public void setExtSkylightValue(int var1, int var2, int var3, int var4) { +- this.skylightArray.set(var1, var2, var3, var4); +- } +- +- public int getExtSkylightValue(int var1, int var2, int var3) { +- return this.skylightArray.get(var1, var2, var3); +- } +- +- public void setExtBlocklightValue(int var1, int var2, int var3, int var4) { +- this.blocklightArray.set(var1, var2, var3, var4); +- } +- +- public int getExtBlocklightValue(int var1, int var2, int var3) { +- return this.blocklightArray.get(var1, var2, var3); ++ /** ++ * Sets the saved Sky-light value in the extended block storage structure. ++ */ ++ public void setExtSkylightValue(int par1, int par2, int par3, int par4) { ++ this.skylightArray.set(par1, par2, par3, par4); ++ } ++ ++ /** ++ * Gets the saved Sky-light value in the extended block storage structure. ++ */ ++ public int getExtSkylightValue(int par1, int par2, int par3) { ++ return this.skylightArray.get(par1, par2, par3); ++ } ++ ++ /** ++ * Sets the saved Block-light value in the extended block storage structure. ++ */ ++ public void setExtBlocklightValue(int par1, int par2, int par3, int par4) { ++ this.blocklightArray.set(par1, par2, par3, par4); ++ } ++ ++ /** ++ * Gets the saved Block-light value in the extended block storage structure. ++ */ ++ public int getExtBlocklightValue(int par1, int par2, int par3) { ++ return this.blocklightArray.get(par1, par2, par3); + } + + public void removeInvalidBlocks() { + this.blockRefCount = 0; + this.tickRefCount = 0; + +- for(int var1 = 0; var1 < 16; ++var1) { +- for(int var2 = 0; var2 < 16; ++var2) { +- for(int var3 = 0; var3 < 16; ++var3) { ++ for (int var1 = 0; var1 < 16; ++var1) { ++ for (int var2 = 0; var2 < 16; ++var2) { ++ for (int var3 = 0; var3 < 16; ++var3) { + int var4 = this.getExtBlockID(var1, var2, var3); +- if(var4 > 0) { +- if(Block.blocksList[var4] == null) { ++ ++ if (var4 > 0) { ++ if (Block.blocksList[var4] == null) { + this.blockLSBArray[var2 << 8 | var3 << 4 | var1] = 0; +- if(this.blockMSBArray != null) { ++ ++ if (this.blockMSBArray != null) { + this.blockMSBArray.set(var1, var2, var3, 0); + } + } else { + ++this.blockRefCount; +- if(Block.blocksList[var4].getTickRandomly()) { ++ ++ if (Block.blocksList[var4].getTickRandomly()) { + ++this.tickRefCount; + } + } +@@ -123,7 +193,6 @@ + } + } + } +- + } + + public byte[] getBlockLSBArray() { +@@ -134,6 +203,9 @@ + this.blockMSBArray = null; + } + ++ /** ++ * Returns the block ID MSB (bits 11..8) array for this storage array's Chunk. ++ */ + public NibbleArray getBlockMSBArray() { + return this.blockMSBArray; + } +@@ -142,34 +214,59 @@ + return this.blockMetadataArray; + } + ++ /** ++ * Returns the NibbleArray instance containing Block-light data. ++ */ + public NibbleArray getBlocklightArray() { + return this.blocklightArray; + } + ++ /** ++ * Returns the NibbleArray instance containing Sky-light data. ++ */ + public NibbleArray getSkylightArray() { + return this.skylightArray; + } + +- public void setBlockLSBArray(byte[] var1) { +- this.blockLSBArray = var1; +- } +- +- public void setBlockMSBArray(NibbleArray var1) { +- this.blockMSBArray = var1; +- } +- +- public void setBlockMetadataArray(NibbleArray var1) { +- this.blockMetadataArray = var1; +- } +- +- public void setBlocklightArray(NibbleArray var1) { +- this.blocklightArray = var1; +- } +- +- public void setSkylightArray(NibbleArray var1) { +- this.skylightArray = var1; +- } +- ++ /** ++ * Sets the array of block ID least significant bits for this ExtendedBlockStorage. ++ */ ++ public void setBlockLSBArray(byte[] par1ArrayOfByte) { ++ this.blockLSBArray = par1ArrayOfByte; ++ } ++ ++ /** ++ * Sets the array of blockID most significant bits (blockMSBArray) for this ExtendedBlockStorage. ++ */ ++ public void setBlockMSBArray(NibbleArray par1NibbleArray) { ++ this.blockMSBArray = par1NibbleArray; ++ } ++ ++ /** ++ * Sets the NibbleArray of block metadata (blockMetadataArray) for this ExtendedBlockStorage. ++ */ ++ public void setBlockMetadataArray(NibbleArray par1NibbleArray) { ++ this.blockMetadataArray = par1NibbleArray; ++ } ++ ++ /** ++ * Sets the NibbleArray instance used for Block-light values in this particular storage block. ++ */ ++ public void setBlocklightArray(NibbleArray par1NibbleArray) { ++ this.blocklightArray = par1NibbleArray; ++ } ++ ++ /** ++ * Sets the NibbleArray instance used for Sky-light values in this particular storage block. ++ */ ++ public void setSkylightArray(NibbleArray par1NibbleArray) { ++ this.skylightArray = par1NibbleArray; ++ } ++ ++ /** ++ * Called by a Chunk to initialize the MSB array if getBlockMSBArray returns null. Returns the newly-created ++ * NibbleArray instance. ++ */ + public NibbleArray createBlockMSBArray() { + this.blockMSBArray = new NibbleArray(this.blockLSBArray.length, 4); + return this.blockMSBArray; diff --git a/patches/net/minecraft/src/Facing.java.patch b/patches/net/minecraft/src/Facing.java.patch new file mode 100644 index 0000000..654324f --- /dev/null +++ b/patches/net/minecraft/src/Facing.java.patch @@ -0,0 +1,33 @@ +--- net/minecraft/src/Facing.java ++++ net/minecraft/src/Facing.java +@@ -1,9 +1,25 @@ + package net.minecraft.src; + + public class Facing { +- public static final int[] oppositeSide = new int[]{1, 0, 3, 2, 5, 4}; +- public static final int[] offsetsXForSide = new int[]{0, 0, 0, 0, -1, 1}; +- public static final int[] offsetsYForSide = new int[]{-1, 1, 0, 0, 0, 0}; +- public static final int[] offsetsZForSide = new int[]{0, 0, -1, 1, 0, 0}; +- public static final String[] e = new String[]{"DOWN", "UP", "NORTH", "SOUTH", "WEST", "EAST"}; ++ ++ /** ++ * Converts a side to the opposite side. This is the same as XOR'ing it with 1. ++ */ ++ public static final int[] oppositeSide = new int[] {1, 0, 3, 2, 5, 4}; ++ ++ /** ++ * gives the offset required for this axis to get the block at that side. ++ */ ++ public static final int[] offsetsXForSide = new int[] {0, 0, 0, 0, -1, 1}; ++ ++ /** ++ * gives the offset required for this axis to get the block at that side. ++ */ ++ public static final int[] offsetsYForSide = new int[] { -1, 1, 0, 0, 0, 0}; ++ ++ /** ++ * gives the offset required for this axis to get the block at that side. ++ */ ++ public static final int[] offsetsZForSide = new int[] {0, 0, -1, 1, 0, 0}; ++ public static final String[] facings = new String[] {"DOWN", "UP", "NORTH", "SOUTH", "WEST", "EAST"}; + } diff --git a/patches/net/minecraft/src/FallbackResourceManager.java.patch b/patches/net/minecraft/src/FallbackResourceManager.java.patch new file mode 100644 index 0000000..a44d5b3 --- /dev/null +++ b/patches/net/minecraft/src/FallbackResourceManager.java.patch @@ -0,0 +1,96 @@ +--- net/minecraft/src/FallbackResourceManager.java ++++ net/minecraft/src/FallbackResourceManager.java +@@ -10,65 +10,68 @@ + import java.util.Set; + + public class FallbackResourceManager implements ResourceManager { +- protected final List a = new ArrayList(); ++ public final List resourcePacks = new ArrayList(); + private final MetadataSerializer frmMetadataSerializer; + +- public FallbackResourceManager(MetadataSerializer var1) { +- this.frmMetadataSerializer = var1; ++ public FallbackResourceManager(MetadataSerializer par1MetadataSerializer) { ++ this.frmMetadataSerializer = par1MetadataSerializer; + } + +- public void addResourcePack(ResourcePack var1) { +- this.a.add(var1); ++ public void addResourcePack(ResourcePack par1ResourcePack) { ++ this.resourcePacks.add(par1ResourcePack); + } + + public Set getResourceDomains() { + return null; + } + +- public Resource getResource(ResourceLocation var1) throws IOException { ++ public Resource getResource(ResourceLocation par1ResourceLocation) throws IOException { + ResourcePack var2 = null; +- ResourceLocation var3 = getLocationMcmeta(var1); +- +- for(int var4 = this.a.size() - 1; var4 >= 0; --var4) { +- ResourcePack var5 = (ResourcePack)this.a.get(var4); +- if(var2 == null && var5.resourceExists(var3)) { ++ ResourceLocation var3 = getLocationMcmeta(par1ResourceLocation); ++ ++ for (int var4 = this.resourcePacks.size() - 1; var4 >= 0; --var4) { ++ ResourcePack var5 = (ResourcePack)this.resourcePacks.get(var4); ++ ++ if (var2 == null && var5.resourceExists(var3)) { + var2 = var5; + } + +- if(var5.resourceExists(var1)) { ++ if (var5.resourceExists(par1ResourceLocation)) { + InputStream var6 = null; +- if(var2 != null) { ++ ++ if (var2 != null) { + var6 = var2.getInputStream(var3); + } + +- return new SimpleResource(var1, var5.getInputStream(var1), var6, this.frmMetadataSerializer); ++ return new SimpleResource(par1ResourceLocation, var5.getInputStream(par1ResourceLocation), var6, this.frmMetadataSerializer); + } + } + +- throw new FileNotFoundException(var1.toString()); ++ throw new FileNotFoundException(par1ResourceLocation.toString()); + } + +- public List getAllResources(ResourceLocation var1) throws IOException { ++ public List getAllResources(ResourceLocation par1ResourceLocation) throws IOException { + ArrayList var2 = Lists.newArrayList(); +- ResourceLocation var3 = getLocationMcmeta(var1); +- Iterator var4 = this.a.iterator(); ++ ResourceLocation var3 = getLocationMcmeta(par1ResourceLocation); ++ Iterator var4 = this.resourcePacks.iterator(); + +- while(var4.hasNext()) { ++ while (var4.hasNext()) { + ResourcePack var5 = (ResourcePack)var4.next(); +- if(var5.resourceExists(var1)) { ++ ++ if (var5.resourceExists(par1ResourceLocation)) { + InputStream var6 = var5.resourceExists(var3) ? var5.getInputStream(var3) : null; +- var2.add(new SimpleResource(var1, var5.getInputStream(var1), var6, this.frmMetadataSerializer)); ++ var2.add(new SimpleResource(par1ResourceLocation, var5.getInputStream(par1ResourceLocation), var6, this.frmMetadataSerializer)); + } + } + +- if(var2.isEmpty()) { +- throw new FileNotFoundException(var1.toString()); ++ if (var2.isEmpty()) { ++ throw new FileNotFoundException(par1ResourceLocation.toString()); + } else { + return var2; + } + } + +- static ResourceLocation getLocationMcmeta(ResourceLocation var0) { +- return new ResourceLocation(var0.getResourceDomain(), var0.getResourcePath() + ".mcmeta"); ++ static ResourceLocation getLocationMcmeta(ResourceLocation par0ResourceLocation) { ++ return new ResourceLocation(par0ResourceLocation.getResourceDomain(), par0ResourceLocation.getResourcePath() + ".mcmeta"); + } + } diff --git a/patches/net/minecraft/src/FileResourcePack.java.patch b/patches/net/minecraft/src/FileResourcePack.java.patch new file mode 100644 index 0000000..645a1aa --- /dev/null +++ b/patches/net/minecraft/src/FileResourcePack.java.patch @@ -0,0 +1,109 @@ +--- net/minecraft/src/FileResourcePack.java ++++ net/minecraft/src/FileResourcePack.java +@@ -16,34 +16,35 @@ + import java.util.zip.ZipFile; + + public class FileResourcePack extends AbstractResourcePack implements Closeable { +- public static final Splitter c = Splitter.on('/').omitEmptyStrings().limit(3); +- private ZipFile d; ++ public static final Splitter entryNameSplitter = Splitter.on('/').omitEmptyStrings().limit(3); ++ public ZipFile resourcePackZipFile; + +- public FileResourcePack(File var1) { +- super(var1); ++ public FileResourcePack(File par1File) { ++ super(par1File); + } + + private ZipFile getResourcePackZipFile() throws IOException { +- if(this.d == null) { +- this.d = new ZipFile(this.b); ++ if (this.resourcePackZipFile == null) { ++ this.resourcePackZipFile = new ZipFile(this.resourcePackFile); + } + +- return this.d; ++ return this.resourcePackZipFile; + } + +- protected InputStream getInputStreamByName(String var1) throws IOException { ++ protected InputStream getInputStreamByName(String par1Str) throws IOException { + ZipFile var2 = this.getResourcePackZipFile(); +- ZipEntry var3 = var2.getEntry(var1); +- if(var3 == null) { +- throw new ResourcePackFileNotFoundException(this.b, var1); ++ ZipEntry var3 = var2.getEntry(par1Str); ++ ++ if (var3 == null) { ++ throw new ResourcePackFileNotFoundException(this.resourcePackFile, par1Str); + } else { + return var2.getInputStream(var3); + } + } + +- public boolean hasResourceName(String var1) { ++ public boolean hasResourceName(String par1Str) { + try { +- return this.getResourcePackZipFile().getEntry(var1) != null; ++ return this.getResourcePackZipFile().getEntry(par1Str) != null; + } catch (IOException var3) { + return false; + } +@@ -51,6 +52,7 @@ + + public Set getResourceDomains() { + ZipFile var1; ++ + try { + var1 = this.getResourcePackZipFile(); + } catch (IOException var8) { +@@ -60,14 +62,17 @@ + Enumeration var2 = var1.entries(); + HashSet var3 = Sets.newHashSet(); + +- while(var2.hasMoreElements()) { ++ while (var2.hasMoreElements()) { + ZipEntry var4 = (ZipEntry)var2.nextElement(); + String var5 = var4.getName(); +- if(var5.startsWith("assets/")) { +- ArrayList var6 = Lists.newArrayList(c.split(var5)); +- if(var6.size() > 1) { ++ ++ if (var5.startsWith("assets/")) { ++ ArrayList var6 = Lists.newArrayList(entryNameSplitter.split(var5)); ++ ++ if (var6.size() > 1) { + String var7 = (String)var6.get(1); +- if(!var7.equals(var7.toLowerCase())) { ++ ++ if (!var7.equals(var7.toLowerCase())) { + this.logNameNotLowercase(var7); + } else { + var3.add(var7); +@@ -81,14 +86,21 @@ + + protected void finalize() { + this.close(); +- super.finalize(); ++ ++ try { ++ super.finalize(); ++ } catch (Throwable t) { ++ } + } + + public void close() { +- if(this.d != null) { +- this.d.close(); +- this.d = null; +- } ++ if (this.resourcePackZipFile != null) { ++ try { ++ this.resourcePackZipFile.close(); ++ } catch (Exception ex) { ++ } + ++ this.resourcePackZipFile = null; ++ } + } + } diff --git a/patches/net/minecraft/src/FilterIMob.java.patch b/patches/net/minecraft/src/FilterIMob.java.patch new file mode 100644 index 0000000..bbe1049 --- /dev/null +++ b/patches/net/minecraft/src/FilterIMob.java.patch @@ -0,0 +1,16 @@ +--- net/minecraft/src/FilterIMob.java ++++ net/minecraft/src/FilterIMob.java +@@ -1,7 +1,11 @@ + package net.minecraft.src; + + final class FilterIMob implements IEntitySelector { +- public boolean isEntityApplicable(Entity var1) { +- return var1 instanceof IMob; ++ ++ /** ++ * Return whether the specified entity is applicable to this filter. ++ */ ++ public boolean isEntityApplicable(Entity par1Entity) { ++ return par1Entity instanceof IMob; + } + } diff --git a/patches/net/minecraft/src/FlatGeneratorInfo.java.patch b/patches/net/minecraft/src/FlatGeneratorInfo.java.patch new file mode 100644 index 0000000..e920dc0 --- /dev/null +++ b/patches/net/minecraft/src/FlatGeneratorInfo.java.patch @@ -0,0 +1,301 @@ +--- net/minecraft/src/FlatGeneratorInfo.java ++++ net/minecraft/src/FlatGeneratorInfo.java +@@ -8,109 +8,125 @@ + import java.util.Map.Entry; + + public class FlatGeneratorInfo { +- private final List a = new ArrayList(); +- private final Map b = new HashMap(); ++ ++ /** List of layers on this preset. */ ++ private final List flatLayers = new ArrayList(); ++ ++ /** List of world features enabled on this preset. */ ++ private final Map worldFeatures = new HashMap(); + private int biomeToUse; + ++ /** ++ * Return the biome used on this preset. ++ */ + public int getBiome() { + return this.biomeToUse; + } + +- public void setBiome(int var1) { +- this.biomeToUse = var1; ++ /** ++ * Set the biome used on this preset. ++ */ ++ public void setBiome(int par1) { ++ this.biomeToUse = par1; + } + ++ /** ++ * Return the list of world features enabled on this preset. ++ */ + public Map getWorldFeatures() { +- return this.b; ++ return this.worldFeatures; + } + ++ /** ++ * Return the list of layers on this preset. ++ */ + public List getFlatLayers() { +- return this.a; ++ return this.flatLayers; + } + + public void func_82645_d() { + int var1 = 0; +- + FlatLayerInfo var3; +- for(Iterator var2 = this.a.iterator(); var2.hasNext(); var1 += var3.getLayerCount()) { ++ ++ for (Iterator var2 = this.flatLayers.iterator(); var2.hasNext(); var1 += var3.getLayerCount()) { + var3 = (FlatLayerInfo)var2.next(); + var3.setMinY(var1); + } +- + } + + public String toString() { + StringBuilder var1 = new StringBuilder(); + var1.append(2); + var1.append(";"); +- + int var2; +- for(var2 = 0; var2 < this.a.size(); ++var2) { +- if(var2 > 0) { ++ ++ for (var2 = 0; var2 < this.flatLayers.size(); ++var2) { ++ if (var2 > 0) { + var1.append(","); + } + +- var1.append(((FlatLayerInfo)this.a.get(var2)).toString()); ++ var1.append(((FlatLayerInfo)this.flatLayers.get(var2)).toString()); + } + + var1.append(";"); + var1.append(this.biomeToUse); +- if(!this.b.isEmpty()) { ++ ++ if (!this.worldFeatures.isEmpty()) { + var1.append(";"); + var2 = 0; +- Iterator var3 = this.b.entrySet().iterator(); +- +- while(true) { +- Map var5; +- do { +- if(!var3.hasNext()) { +- return var1.toString(); +- } +- +- Entry var4 = (Entry)var3.next(); +- if(var2++ > 0) { +- var1.append(","); +- } +- +- var1.append(((String)var4.getKey()).toLowerCase()); +- var5 = (Map)var4.getValue(); +- } while(var5.isEmpty()); +- +- var1.append("("); +- int var6 = 0; +- Iterator var7 = var5.entrySet().iterator(); +- +- while(var7.hasNext()) { +- Entry var8 = (Entry)var7.next(); +- if(var6++ > 0) { +- var1.append(" "); +- } +- +- var1.append((String)var8.getKey()); +- var1.append("="); +- var1.append((String)var8.getValue()); +- } +- +- var1.append(")"); ++ Iterator var3 = this.worldFeatures.entrySet().iterator(); ++ ++ while (var3.hasNext()) { ++ Entry var4 = (Entry)var3.next(); ++ ++ if (var2++ > 0) { ++ var1.append(","); ++ } ++ ++ var1.append(((String)var4.getKey()).toLowerCase()); ++ Map var5 = (Map)var4.getValue(); ++ ++ if (!var5.isEmpty()) { ++ var1.append("("); ++ int var6 = 0; ++ Iterator var7 = var5.entrySet().iterator(); ++ ++ while (var7.hasNext()) { ++ Entry var8 = (Entry)var7.next(); ++ ++ if (var6++ > 0) { ++ var1.append(" "); ++ } ++ ++ var1.append((String)var8.getKey()); ++ var1.append("="); ++ var1.append((String)var8.getValue()); ++ } ++ ++ var1.append(")"); ++ } + } + } else { + var1.append(";"); +- return var1.toString(); + } ++ ++ return var1.toString(); + } + +- private static FlatLayerInfo func_82646_a(String var0, int var1) { +- String[] var2 = var0.split("x", 2); ++ private static FlatLayerInfo func_82646_a(String par0Str, int par1) { ++ String[] var2 = par0Str.split("x", 2); + int var3 = 1; + int var5 = 0; +- if(var2.length == 2) { ++ ++ if (var2.length == 2) { + try { + var3 = Integer.parseInt(var2[0]); +- if(var1 + var3 >= 256) { +- var3 = 256 - var1; ++ ++ if (par1 + var3 >= 256) { ++ var3 = 256 - par1; + } + +- if(var3 < 0) { ++ if (var3 < 0) { + var3 = 0; + } + } catch (Throwable var7) { +@@ -119,20 +135,22 @@ + } + + int var4; ++ + try { + String var6 = var2[var2.length - 1]; + var2 = var6.split(":", 2); + var4 = Integer.parseInt(var2[0]); +- if(var2.length > 1) { ++ ++ if (var2.length > 1) { + var5 = Integer.parseInt(var2[1]); + } + +- if(Block.blocksList[var4] == null) { ++ if (Block.blocksList[var4] == null) { + var4 = 0; + var5 = 0; + } + +- if(var5 < 0 || var5 > 15) { ++ if (var5 < 0 || var5 > 15) { + var5 = 0; + } + } catch (Throwable var8) { +@@ -140,22 +158,23 @@ + } + + FlatLayerInfo var9 = new FlatLayerInfo(var3, var4, var5); +- var9.setMinY(var1); ++ var9.setMinY(par1); + return var9; + } + +- private static List func_82652_b(String var0) { +- if(var0 != null && var0.length() >= 1) { ++ private static List func_82652_b(String par0Str) { ++ if (par0Str != null && par0Str.length() >= 1) { + ArrayList var1 = new ArrayList(); +- String[] var2 = var0.split(","); ++ String[] var2 = par0Str.split(","); + int var3 = 0; + String[] var4 = var2; + int var5 = var2.length; + +- for(int var6 = 0; var6 < var5; ++var6) { ++ for (int var6 = 0; var6 < var5; ++var6) { + String var7 = var4[var6]; + FlatLayerInfo var8 = func_82646_a(var7, var3); +- if(var8 == null) { ++ ++ if (var8 == null) { + return null; + } + +@@ -169,42 +188,49 @@ + } + } + +- public static FlatGeneratorInfo createFlatGeneratorFromString(String var0) { +- if(var0 == null) { ++ public static FlatGeneratorInfo createFlatGeneratorFromString(String par0Str) { ++ if (par0Str == null) { + return getDefaultFlatGenerator(); + } else { +- String[] var1 = var0.split(";", -1); ++ String[] var1 = par0Str.split(";", -1); + int var2 = var1.length == 1 ? 0 : MathHelper.parseIntWithDefault(var1[0], 0); +- if(var2 >= 0 && var2 <= 2) { ++ ++ if (var2 >= 0 && var2 <= 2) { + FlatGeneratorInfo var3 = new FlatGeneratorInfo(); + int var4 = var1.length == 1 ? 0 : 1; + List var5 = func_82652_b(var1[var4++]); +- if(var5 != null && !var5.isEmpty()) { ++ ++ if (var5 != null && !var5.isEmpty()) { + var3.getFlatLayers().addAll(var5); + var3.func_82645_d(); + int var6 = BiomeGenBase.plains.biomeID; +- if(var2 > 0 && var1.length > var4) { ++ ++ if (var2 > 0 && var1.length > var4) { + var6 = MathHelper.parseIntWithDefault(var1[var4++], var6); + } + + var3.setBiome(var6); +- if(var2 > 0 && var1.length > var4) { ++ ++ if (var2 > 0 && var1.length > var4) { + String[] var7 = var1[var4++].toLowerCase().split(","); + String[] var8 = var7; + int var9 = var7.length; + +- for(int var10 = 0; var10 < var9; ++var10) { ++ for (int var10 = 0; var10 < var9; ++var10) { + String var11 = var8[var10]; + String[] var12 = var11.split("\\(", 2); + HashMap var13 = new HashMap(); +- if(var12[0].length() > 0) { ++ ++ if (var12[0].length() > 0) { + var3.getWorldFeatures().put(var12[0], var13); +- if(var12.length > 1 && var12[1].endsWith(")") && var12[1].length() > 1) { ++ ++ if (var12.length > 1 && var12[1].endsWith(")") && var12[1].length() > 1) { + String[] var14 = var12[1].substring(0, var12[1].length() - 1).split(" "); + +- for(int var15 = 0; var15 < var14.length; ++var15) { ++ for (int var15 = 0; var15 < var14.length; ++var15) { + String[] var16 = var14[var15].split("=", 2); +- if(var16.length == 2) { ++ ++ if (var16.length == 2) { + var13.put(var16[0], var16[1]); + } + } diff --git a/patches/net/minecraft/src/FlatLayerInfo.java.patch b/patches/net/minecraft/src/FlatLayerInfo.java.patch new file mode 100644 index 0000000..52a03e8 --- /dev/null +++ b/patches/net/minecraft/src/FlatLayerInfo.java.patch @@ -0,0 +1,88 @@ +--- net/minecraft/src/FlatLayerInfo.java ++++ net/minecraft/src/FlatLayerInfo.java +@@ -1,49 +1,71 @@ + package net.minecraft.src; + + public class FlatLayerInfo { ++ ++ /** Amount of layers for this set of layers. */ + private int layerCount; ++ ++ /** Block type used on this set of layers. */ + private int layerFillBlock; ++ ++ /** Block metadata used on this set of laeyrs. */ + private int layerFillBlockMeta; + private int layerMinimumY; + +- public FlatLayerInfo(int var1, int var2) { ++ public FlatLayerInfo(int par1, int par2) { + this.layerCount = 1; +- this.layerCount = var1; +- this.layerFillBlock = var2; +- } +- +- public FlatLayerInfo(int var1, int var2, int var3) { +- this(var1, var2); +- this.layerFillBlockMeta = var3; +- } +- ++ this.layerCount = par1; ++ this.layerFillBlock = par2; ++ } ++ ++ public FlatLayerInfo(int par1, int par2, int par3) { ++ this(par1, par2); ++ this.layerFillBlockMeta = par3; ++ } ++ ++ /** ++ * Return the amount of layers for this set of layers. ++ */ + public int getLayerCount() { + return this.layerCount; + } + ++ /** ++ * Return the block type used on this set of layers. ++ */ + public int getFillBlock() { + return this.layerFillBlock; + } + ++ /** ++ * Return the block metadata used on this set of layers. ++ */ + public int getFillBlockMeta() { + return this.layerFillBlockMeta; + } + ++ /** ++ * Return the minimum Y coordinate for this layer, set during generation. ++ */ + public int getMinY() { + return this.layerMinimumY; + } + +- public void setMinY(int var1) { +- this.layerMinimumY = var1; ++ /** ++ * Set the minimum Y coordinate for this layer. ++ */ ++ public void setMinY(int par1) { ++ this.layerMinimumY = par1; + } + + public String toString() { + String var1 = Integer.toString(this.layerFillBlock); +- if(this.layerCount > 1) { ++ ++ if (this.layerCount > 1) { + var1 = this.layerCount + "x" + var1; + } + +- if(this.layerFillBlockMeta > 0) { ++ if (this.layerFillBlockMeta > 0) { + var1 = var1 + ":" + this.layerFillBlockMeta; + } + diff --git a/patches/net/minecraft/src/FolderResourcePack.java.patch b/patches/net/minecraft/src/FolderResourcePack.java.patch new file mode 100644 index 0000000..cf86ff9 --- /dev/null +++ b/patches/net/minecraft/src/FolderResourcePack.java.patch @@ -0,0 +1,49 @@ +--- net/minecraft/src/FolderResourcePack.java ++++ net/minecraft/src/FolderResourcePack.java +@@ -11,29 +11,31 @@ + import org.apache.commons.io.filefilter.DirectoryFileFilter; + + public class FolderResourcePack extends AbstractResourcePack { +- public FolderResourcePack(File var1) { +- super(var1); +- } +- +- protected InputStream getInputStreamByName(String var1) throws IOException { +- return new BufferedInputStream(new FileInputStream(new File(this.b, var1))); +- } +- +- protected boolean hasResourceName(String var1) { +- return (new File(this.b, var1)).isFile(); ++ public FolderResourcePack(File par1File) { ++ super(par1File); ++ } ++ ++ protected InputStream getInputStreamByName(String par1Str) throws IOException { ++ return new BufferedInputStream(new FileInputStream(new File(this.resourcePackFile, par1Str))); ++ } ++ ++ protected boolean hasResourceName(String par1Str) { ++ return (new File(this.resourcePackFile, par1Str)).isFile(); + } + + public Set getResourceDomains() { + HashSet var1 = Sets.newHashSet(); +- File var2 = new File(this.b, "assets/"); +- if(var2.isDirectory()) { +- File[] var3 = var2.listFiles(DirectoryFileFilter.DIRECTORY); ++ File var2 = new File(this.resourcePackFile, "assets/"); ++ ++ if (var2.isDirectory()) { ++ File[] var3 = var2.listFiles((java.io.FileFilter)DirectoryFileFilter.DIRECTORY); + int var4 = var3.length; + +- for(int var5 = 0; var5 < var4; ++var5) { ++ for (int var5 = 0; var5 < var4; ++var5) { + File var6 = var3[var5]; + String var7 = getRelativeName(var2, var6); +- if(!var7.equals(var7.toLowerCase())) { ++ ++ if (!var7.equals(var7.toLowerCase())) { + this.logNameNotLowercase(var7); + } else { + var1.add(var7.substring(0, var7.length() - 1)); diff --git a/patches/net/minecraft/src/FoliageColorReloadListener.java.patch b/patches/net/minecraft/src/FoliageColorReloadListener.java.patch new file mode 100644 index 0000000..d960543 --- /dev/null +++ b/patches/net/minecraft/src/FoliageColorReloadListener.java.patch @@ -0,0 +1,17 @@ +--- net/minecraft/src/FoliageColorReloadListener.java ++++ net/minecraft/src/FoliageColorReloadListener.java +@@ -5,11 +5,11 @@ + public class FoliageColorReloadListener implements ResourceManagerReloadListener { + private static final ResourceLocation field_130079_a = new ResourceLocation("textures/colormap/foliage.png"); + +- public void onResourceManagerReload(ResourceManager var1) { ++ public void onResourceManagerReload(ResourceManager par1ResourceManager) { + try { +- ColorizerFoliage.setFoliageBiomeColorizer(TextureUtil.readImageData(var1, field_130079_a)); ++ ColorizerFoliage.setFoliageBiomeColorizer(TextureUtil.readImageData(par1ResourceManager, field_130079_a)); + } catch (IOException var3) { ++ ; + } +- + } + } diff --git a/patches/net/minecraft/src/FontMetadataSection.java.patch b/patches/net/minecraft/src/FontMetadataSection.java.patch new file mode 100644 index 0000000..c221ee4 --- /dev/null +++ b/patches/net/minecraft/src/FontMetadataSection.java.patch @@ -0,0 +1,16 @@ +--- net/minecraft/src/FontMetadataSection.java ++++ net/minecraft/src/FontMetadataSection.java +@@ -5,9 +5,9 @@ + private final float[] charLefts; + private final float[] charSpacings; + +- public FontMetadataSection(float[] var1, float[] var2, float[] var3) { +- this.charWidths = var1; +- this.charLefts = var2; +- this.charSpacings = var3; ++ public FontMetadataSection(float[] par1ArrayOfFloat, float[] par2ArrayOfFloat, float[] par3ArrayOfFloat) { ++ this.charWidths = par1ArrayOfFloat; ++ this.charLefts = par2ArrayOfFloat; ++ this.charSpacings = par3ArrayOfFloat; + } + } diff --git a/patches/net/minecraft/src/FontMetadataSectionSerializer.java.patch b/patches/net/minecraft/src/FontMetadataSectionSerializer.java.patch new file mode 100644 index 0000000..d3ad278 --- /dev/null +++ b/patches/net/minecraft/src/FontMetadataSectionSerializer.java.patch @@ -0,0 +1,83 @@ +--- net/minecraft/src/FontMetadataSectionSerializer.java ++++ net/minecraft/src/FontMetadataSectionSerializer.java +@@ -7,45 +7,48 @@ + import java.lang.reflect.Type; + + public class FontMetadataSectionSerializer extends BaseMetadataSectionSerializer { +- public FontMetadataSection func_110490_a(JsonElement var1, Type var2, JsonDeserializationContext var3) { +- JsonObject var4 = var1.getAsJsonObject(); ++ public FontMetadataSection func_110490_a(JsonElement par1JsonElement, Type par2Type, JsonDeserializationContext par3JsonDeserializationContext) { ++ JsonObject var4 = par1JsonElement.getAsJsonObject(); + float[] var5 = new float[256]; + float[] var6 = new float[256]; + float[] var7 = new float[256]; + float var8 = 1.0F; + float var9 = 0.0F; + float var10 = 0.0F; +- if(var4.has("characters")) { +- if(!var4.get("characters").isJsonObject()) { ++ ++ if (var4.has("characters")) { ++ if (!var4.get("characters").isJsonObject()) { + throw new JsonParseException("Invalid font->characters: expected object, was " + var4.get("characters")); + } + + JsonObject var11 = var4.getAsJsonObject("characters"); +- if(var11.has("default")) { +- if(!var11.get("default").isJsonObject()) { ++ ++ if (var11.has("default")) { ++ if (!var11.get("default").isJsonObject()) { + throw new JsonParseException("Invalid font->characters->default: expected object, was " + var11.get("default")); + } + + JsonObject var12 = var11.getAsJsonObject("default"); +- var8 = this.func_110487_a(var12.get("width"), "characters->default->width", Float.valueOf(var8), 0.0F, 2.14748365E9F); +- var9 = this.func_110487_a(var12.get("spacing"), "characters->default->spacing", Float.valueOf(var9), 0.0F, 2.14748365E9F); +- var10 = this.func_110487_a(var12.get("left"), "characters->default->left", Float.valueOf(var10), 0.0F, 2.14748365E9F); ++ var8 = this.func_110487_a(var12.get("width"), "characters->default->width", Float.valueOf(var8), 0.0F, 2.1474836E9F); ++ var9 = this.func_110487_a(var12.get("spacing"), "characters->default->spacing", Float.valueOf(var9), 0.0F, 2.1474836E9F); ++ var10 = this.func_110487_a(var12.get("left"), "characters->default->left", Float.valueOf(var10), 0.0F, 2.1474836E9F); + } + +- for(int var18 = 0; var18 < 256; ++var18) { ++ for (int var18 = 0; var18 < 256; ++var18) { + JsonElement var13 = var11.get(Integer.toString(var18)); + float var14 = var8; + float var15 = var9; + float var16 = var10; +- if(var13 != null) { +- if(!var13.isJsonObject()) { ++ ++ if (var13 != null) { ++ if (!var13.isJsonObject()) { + throw new JsonParseException("Invalid font->characters->" + var18 + ": expected object, was " + var13); + } + + JsonObject var17 = var13.getAsJsonObject(); +- var14 = this.func_110487_a(var17.get("width"), "characters->" + var18 + "->width", Float.valueOf(var8), 0.0F, 2.14748365E9F); +- var15 = this.func_110487_a(var17.get("spacing"), "characters->" + var18 + "->spacing", Float.valueOf(var9), 0.0F, 2.14748365E9F); +- var16 = this.func_110487_a(var17.get("left"), "characters->" + var18 + "->left", Float.valueOf(var10), 0.0F, 2.14748365E9F); ++ var14 = this.func_110487_a(var17.get("width"), "characters->" + var18 + "->width", Float.valueOf(var8), 0.0F, 2.1474836E9F); ++ var15 = this.func_110487_a(var17.get("spacing"), "characters->" + var18 + "->spacing", Float.valueOf(var9), 0.0F, 2.1474836E9F); ++ var16 = this.func_110487_a(var17.get("left"), "characters->" + var18 + "->left", Float.valueOf(var10), 0.0F, 2.1474836E9F); + } + + var5[var18] = var14; +@@ -57,11 +60,14 @@ + return new FontMetadataSection(var5, var7, var6); + } + ++ /** ++ * The name of this section type as it appears in JSON. ++ */ + public String getSectionName() { + return "font"; + } + +- public Object deserialize(JsonElement var1, Type var2, JsonDeserializationContext var3) { +- return this.func_110490_a(var1, var2, var3); ++ public Object deserialize(JsonElement par1JsonElement, Type par2Type, JsonDeserializationContext par3JsonDeserializationContext) { ++ return this.func_110490_a(par1JsonElement, par2Type, par3JsonDeserializationContext); + } + } diff --git a/patches/net/minecraft/src/FontRenderer.java.patch b/patches/net/minecraft/src/FontRenderer.java.patch new file mode 100644 index 0000000..333ea06 --- /dev/null +++ b/patches/net/minecraft/src/FontRenderer.java.patch @@ -0,0 +1,1124 @@ +--- net/minecraft/src/FontRenderer.java ++++ net/minecraft/src/FontRenderer.java +@@ -9,48 +9,126 @@ + import java.util.List; + import java.util.Random; + import javax.imageio.ImageIO; ++ + import org.lwjgl.opengl.GL11; + ++import com.prupe.mcpatcher.cc.ColorizeWorld; ++import com.prupe.mcpatcher.hd.FontUtils; ++ + public class FontRenderer implements ResourceManagerReloadListener { + private static final ResourceLocation[] unicodePageLocations = new ResourceLocation[256]; ++ ++ /** Array of width of all the characters in default.png */ + private int[] charWidth = new int[256]; +- public int FONT_HEIGHT = 9; +- public Random b = new Random(); ++ ++ /** the height in pixels of default text */ ++ // Spout Start - Smaller text ++ public int FONT_HEIGHT = 8; ++ // Spout End ++ public Random fontRandom = new Random(); ++ ++ /** ++ * Array of the start/end column (in upper/lower nibble) for every glyph in the /font directory. ++ */ + private byte[] glyphWidth = new byte[65536]; ++ ++ /** ++ * Array of GL texture ids for loaded glyph_XX.png images. Indexed by Unicode block (group of 256 chars). ++ */ ++ // Spout Start - Removed final modifier ++ // TODO: Something? ++ private int[] glyphTextureName = new int[256]; ++ // Spout End ++ ++ /** ++ * Array of RGB triplets defining the 16 standard chat colors followed by 16 darker version of the same colors for drop ++ * shadows. ++ */ + private int[] colorCode = new int[32]; +- private final ResourceLocation locationFontTexture; +- private final TextureManager renderEngine; ++ private ResourceLocation locationFontTexture; ++ ++ /** ++ * The currently bound GL texture ID. Avoids unnecessary glBindTexture() for the same texture if it's already bound. ++ */ ++ private int boundTextureName; ++ ++ /** The RenderEngine used to load and setup glyph textures. */ ++ // Spout start - Removed final modifier ++ private TextureManager renderEngine; ++ // Spout End ++ ++ /** Current X coordinate at which to draw the next character. */ + private float posX; ++ ++ /** Current Y coordinate at which to draw the next character. */ + private float posY; +- private boolean unicodeFlag; ++ ++ /** ++ * If true, strings should be rendered with Unicode fonts instead of the default.png font ++ */ ++ public boolean unicodeFlag; ++ ++ /** ++ * If true, the Unicode Bidirectional Algorithm should be run before rendering any string. ++ */ + private boolean bidiFlag; ++ ++ /** Used to specify new red value for the current color. */ + private float red; ++ ++ /** Used to specify new blue value for the current color. */ + private float blue; ++ ++ /** Used to specify new green value for the current color. */ + private float green; ++ ++ /** Used to speify new alpha value for the current color. */ + private float alpha; ++ ++ /** Text color of the currently rendering string. */ + private int textColor; ++ ++ /** Set if the "k" style (random) is active in currently rendering string */ + private boolean randomStyle; ++ ++ /** Set if the "l" style (bold) is active in currently rendering string */ + private boolean boldStyle; ++ ++ /** Set if the "o" style (italic) is active in currently rendering string */ + private boolean italicStyle; ++ ++ /** ++ * Set if the "n" style (underlined) is active in currently rendering string ++ */ + private boolean underlineStyle; ++ ++ /** ++ * Set if the "m" style (strikethrough) is active in currently rendering string ++ */ + private boolean strikethroughStyle; +- +- public FontRenderer(GameSettings var1, ResourceLocation var2, TextureManager var3, boolean var4) { +- this.locationFontTexture = var2; +- this.renderEngine = var3; +- this.unicodeFlag = var4; +- var3.bindTexture(this.locationFontTexture); +- +- for(int var5 = 0; var5 < 32; ++var5) { ++ public float[] charWidthf; ++ public ResourceLocation defaultFont; ++ public ResourceLocation hdFont; ++ public boolean isHD; ++ public float fontAdj; ++ ++ public FontRenderer(GameSettings par1GameSettings, ResourceLocation par2ResourceLocation, TextureManager par3TextureManager, boolean par4) { ++ this.locationFontTexture = par2ResourceLocation; ++ this.renderEngine = par3TextureManager; ++ this.unicodeFlag = par4; ++ par3TextureManager.bindTexture(this.locationFontTexture); ++ ++ for (int var5 = 0; var5 < 32; ++var5) { + int var6 = (var5 >> 3 & 1) * 85; + int var7 = (var5 >> 2 & 1) * 170 + var6; + int var8 = (var5 >> 1 & 1) * 170 + var6; + int var9 = (var5 >> 0 & 1) * 170 + var6; +- if(var5 == 6) { ++ ++ if (var5 == 6) { + var7 += 85; + } + +- if(var1.anaglyph) { ++ if (par1GameSettings.anaglyph) { + int var10 = (var7 * 30 + var8 * 59 + var9 * 11) / 100; + int var11 = (var7 * 30 + var8 * 70) / 100; + int var12 = (var7 * 30 + var9 * 70) / 100; +@@ -59,7 +137,7 @@ + var9 = var12; + } + +- if(var5 >= 16) { ++ if (var5 >= 16) { + var7 /= 4; + var8 /= 4; + var9 /= 4; +@@ -67,17 +145,18 @@ + + this.colorCode[var5] = (var7 & 255) << 16 | (var8 & 255) << 8 | var9 & 255; + } +- + this.readGlyphSizes(); + } + +- public void onResourceManagerReload(ResourceManager var1) { ++ public void onResourceManagerReload(ResourceManager par1ResourceManager) { + this.readFontTexture(); + } + +- private void readFontTexture() { ++ public void readFontTexture() { + BufferedImage var1; ++ + try { ++ this.locationFontTexture = FontUtils.getFontName(this, this.locationFontTexture); + var1 = ImageIO.read(Minecraft.getMinecraft().getResourceManager().getResource(this.locationFontTexture).getInputStream()); + } catch (IOException var17) { + throw new RuntimeException(var17); +@@ -91,35 +170,45 @@ + int var6 = var2 / 16; + byte var7 = 1; + float var8 = 8.0F / (float)var6; ++ int var9 = 0; + +- for(int var9 = 0; var9 < 256; ++var9) { ++ while (var9 < 256) { + int var10 = var9 % 16; + int var11 = var9 / 16; +- if(var9 == 32) { ++ ++ if (var9 == 32) { + this.charWidth[var9] = 3 + var7; + } + +- int var12; +- for(var12 = var6 - 1; var12 >= 0; --var12) { +- int var13 = var10 * var6 + var12; +- boolean var14 = true; +- +- for(int var15 = 0; var15 < var5 && var14; ++var15) { +- int var16 = (var11 * var6 + var15) * var2; +- if((var4[var13 + var16] >> 24 & 255) != 0) { +- var14 = false; +- } +- } +- +- if(!var14) { +- break; +- } ++ int var12 = var6 - 1; ++ ++ while (true) { ++ if (var12 >= 0) { ++ int var13 = var10 * var6 + var12; ++ boolean var14 = true; ++ ++ for (int var15 = 0; var15 < var5 && var14; ++var15) { ++ int var16 = (var11 * var6 + var15) * var2; ++ ++ if ((var4[var13 + var16] >> 24 & 255) != 0) { ++ var14 = false; ++ } ++ } ++ ++ if (var14) { ++ --var12; ++ continue; ++ } ++ } ++ ++ ++var12; ++ this.charWidth[var9] = (int)(0.5D + (double)((float)var12 * var8)) + var7; ++ ++var9; ++ break; + } +- +- ++var12; +- this.charWidth[var9] = (int)(0.5D + (double)((float)var12 * var8)) + var7; + } + ++ this.charWidthf = FontUtils.computeCharWidthsf(this, this.locationFontTexture, var1, var4, this.charWidth, 1.0F); + } + + private void readGlyphSizes() { +@@ -131,55 +220,67 @@ + } + } + +- private float renderCharAtPos(int var1, char var2, boolean var3) { +- return var2 == 32 ? 4.0F : (var1 > 0 && !this.unicodeFlag ? this.renderDefaultChar(var1 + 32, var3) : this.renderUnicodeChar(var2, var3)); ++ /** ++ * Pick how to render a single character and return the width used. ++ */ ++ private float renderCharAtPos(int par1, char par2, boolean par3) { ++ return par2 == 32 ? this.charWidthf[32] : (par1 > 0 && !this.unicodeFlag ? this.renderDefaultChar(par1 + 32, par3) : this.renderUnicodeChar(par2, par3)); + } + +- private float renderDefaultChar(int var1, boolean var2) { +- float var3 = (float)(var1 % 16 * 8); +- float var4 = (float)(var1 / 16 * 8); +- float var5 = var2 ? 1.0F : 0.0F; ++ /** ++ * Render a single character with the default.png font at current (posX,posY) location... ++ */ ++ private float renderDefaultChar(int par1, boolean par2) { ++ float var3 = (float)(par1 % 16 * 8); ++ float var4 = (float)(par1 / 16 * 8); ++ float var5 = par2 ? 1.0F : 0.0F; + this.renderEngine.bindTexture(this.locationFontTexture); +- float var6 = (float)this.charWidth[var1] - 0.01F; ++ float var6 = (float)this.charWidth[par1] - 0.01F; + GL11.glBegin(GL11.GL_TRIANGLE_STRIP); + GL11.glTexCoord2f(var3 / 128.0F, var4 / 128.0F); + GL11.glVertex3f(this.posX + var5, this.posY, 0.0F); + GL11.glTexCoord2f(var3 / 128.0F, (var4 + 7.99F) / 128.0F); + GL11.glVertex3f(this.posX - var5, this.posY + 7.99F, 0.0F); +- GL11.glTexCoord2f((var3 + var6 - 1.0F) / 128.0F, var4 / 128.0F); +- GL11.glVertex3f(this.posX + var6 - 1.0F + var5, this.posY, 0.0F); +- GL11.glTexCoord2f((var3 + var6 - 1.0F) / 128.0F, (var4 + 7.99F) / 128.0F); +- GL11.glVertex3f(this.posX + var6 - 1.0F - var5, this.posY + 7.99F, 0.0F); ++ GL11.glTexCoord2f((var3 + var6 - this.fontAdj) / 128.0F, var4 / 128.0F); ++ GL11.glVertex3f(this.posX + var6 - this.fontAdj + var5, this.posY, 0.0F); ++ GL11.glTexCoord2f((var3 + var6 - this.fontAdj) / 128.0F, (var4 + 7.99F) / 128.0F); ++ GL11.glVertex3f(this.posX + var6 - this.fontAdj - var5, this.posY + 7.99F, 0.0F); + GL11.glEnd(); +- return (float)this.charWidth[var1]; ++ return FontUtils.getCharWidthf(this, this.charWidth, par1); + } + +- private ResourceLocation getUnicodePageLocation(int var1) { +- if(unicodePageLocations[var1] == null) { +- unicodePageLocations[var1] = new ResourceLocation(String.format("textures/font/unicode_page_%02x.png", new Object[]{Integer.valueOf(var1)})); ++ private ResourceLocation getUnicodePageLocation(int par1) { ++ if (unicodePageLocations[par1] == null) { ++ unicodePageLocations[par1] = new ResourceLocation(String.format("textures/font/unicode_page_%02x.png", new Object[] {Integer.valueOf(par1)})); + } + +- return unicodePageLocations[var1]; +- } +- +- private void loadGlyphTexture(int var1) { +- this.renderEngine.bindTexture(this.getUnicodePageLocation(var1)); +- } +- +- private float renderUnicodeChar(char var1, boolean var2) { +- if(this.glyphWidth[var1] == 0) { ++ return FontUtils.getUnicodePage(unicodePageLocations[par1]); ++ } ++ ++ /** ++ * Load one of the /font/glyph_XX.png into a new GL texture and store the texture ID in glyphTextureName array. ++ */ ++ private void loadGlyphTexture(int par1) { ++ this.renderEngine.bindTexture(this.getUnicodePageLocation(par1)); ++ } ++ ++ /** ++ * Render a single Unicode character at current (posX,posY) location using one of the /font/glyph_XX.png files... ++ */ ++ private float renderUnicodeChar(char par1, boolean par2) { ++ if (this.glyphWidth[par1] == 0) { + return 0.0F; + } else { +- int var3 = var1 / 256; ++ int var3 = par1 / 256; + this.loadGlyphTexture(var3); +- int var4 = this.glyphWidth[var1] >>> 4; +- int var5 = this.glyphWidth[var1] & 15; ++ int var4 = this.glyphWidth[par1] >>> 4; ++ int var5 = this.glyphWidth[par1] & 15; + float var6 = (float)var4; + float var7 = (float)(var5 + 1); +- float var8 = (float)(var1 % 16 * 16) + var6; +- float var9 = (float)((var1 & 255) / 16 * 16); ++ float var8 = (float)(par1 % 16 * 16) + var6; ++ float var9 = (float)((par1 & 255) / 16 * 16); + float var10 = var7 - var6 - 0.02F; +- float var11 = var2 ? 1.0F : 0.0F; ++ float var11 = par2 ? 1.0F : 0.0F; + GL11.glBegin(GL11.GL_TRIANGLE_STRIP); + GL11.glTexCoord2f(var8 / 256.0F, var9 / 256.0F); + GL11.glVertex3f(this.posX + var11, this.posY, 0.0F); +@@ -194,43 +295,57 @@ + } + } + +- public int drawStringWithShadow(String var1, int var2, int var3, int var4) { +- return this.drawString(var1, var2, var3, var4, true); +- } +- +- public int drawString(String var1, int var2, int var3, int var4) { +- return this.drawString(var1, var2, var3, var4, false); +- } +- +- public int drawString(String var1, int var2, int var3, int var4, boolean var5) { ++ /** ++ * Draws the specified string with a shadow. ++ */ ++ public int drawStringWithShadow(String par1Str, int par2, int par3, int par4) { ++ return this.drawString(par1Str, par2, par3, par4, true); ++ } ++ ++ /** ++ * Draws the specified string. ++ */ ++ public int drawString(String par1Str, int par2, int par3, int par4) { ++ return this.drawString(par1Str, par2, par3, par4, false); ++ } ++ ++ /** ++ * Draws the specified string. Args: string, x, y, color, dropShadow ++ */ ++ public int drawString(String par1Str, int par2, int par3, int par4, boolean par5) { + this.resetStyles(); +- if(this.bidiFlag) { +- var1 = this.bidiReorder(var1); ++ ++ if (this.bidiFlag) { ++ par1Str = this.bidiReorder(par1Str); + } + + int var6; +- if(var5) { +- var6 = this.renderString(var1, var2 + 1, var3 + 1, var4, true); +- var6 = Math.max(var6, this.renderString(var1, var2, var3, var4, false)); ++ ++ if (par5) { ++ var6 = this.renderString(par1Str, par2 + 1, par3 + 1, par4, true); ++ var6 = Math.max(var6, this.renderString(par1Str, par2, par3, par4, false)); + } else { +- var6 = this.renderString(var1, var2, var3, var4, false); ++ var6 = this.renderString(par1Str, par2, par3, par4, false); + } + + return var6; + } + +- private String bidiReorder(String var1) { +- if(var1 != null && Bidi.requiresBidi(var1.toCharArray(), 0, var1.length())) { +- Bidi var2 = new Bidi(var1, -2); ++ /** ++ * Apply Unicode Bidirectional Algorithm to string and return a new possibly reordered string for visual rendering. ++ */ ++ private String bidiReorder(String par1Str) { ++ if (par1Str != null && Bidi.requiresBidi(par1Str.toCharArray(), 0, par1Str.length())) { ++ Bidi var2 = new Bidi(par1Str, -2); + byte[] var3 = new byte[var2.getRunCount()]; + String[] var4 = new String[var3.length]; +- + int var7; +- for(int var5 = 0; var5 < var3.length; ++var5) { ++ ++ for (int var5 = 0; var5 < var3.length; ++var5) { + int var6 = var2.getRunStart(var5); + var7 = var2.getRunLimit(var5); + int var8 = var2.getRunLevel(var5); +- String var9 = var1.substring(var6, var7); ++ String var9 = par1Str.substring(var6, var7); + var3[var5] = (byte)var8; + var4[var5] = var9; + } +@@ -238,40 +353,52 @@ + String[] var11 = (String[])var4.clone(); + Bidi.reorderVisually(var3, 0, var4, 0, var3.length); + StringBuilder var12 = new StringBuilder(); ++ var7 = 0; + +- for(var7 = 0; var7 < var4.length; ++var7) { ++ while (var7 < var4.length) { + byte var13 = var3[var7]; +- +- int var14; +- for(var14 = 0; var14 < var11.length; ++var14) { +- if(var11[var14].equals(var4[var7])) { ++ int var14 = 0; ++ ++ while (true) { ++ if (var14 < var11.length) { ++ if (!var11[var14].equals(var4[var7])) { ++ ++var14; ++ continue; ++ } ++ + var13 = var3[var14]; +- break; + } +- } +- +- if((var13 & 1) == 0) { +- var12.append(var4[var7]); +- } else { +- for(var14 = var4[var7].length() - 1; var14 >= 0; --var14) { +- char var10 = var4[var7].charAt(var14); +- if(var10 == 40) { +- var10 = 41; +- } else if(var10 == 41) { +- var10 = 40; ++ ++ if ((var13 & 1) == 0) { ++ var12.append(var4[var7]); ++ } else { ++ for (var14 = var4[var7].length() - 1; var14 >= 0; --var14) { ++ char var10 = var4[var7].charAt(var14); ++ ++ if (var10 == 40) { ++ var10 = 41; ++ } else if (var10 == 41) { ++ var10 = 40; ++ } ++ ++ var12.append(var10); + } +- +- var12.append(var10); + } ++ ++ ++var7; ++ break; + } + } + + return var12.toString(); + } else { +- return var1; ++ return par1Str; + } + } + ++ /** ++ * Reset all style flag fields in the class to false; called at the start of string rendering ++ */ + private void resetStyles() { + this.randomStyle = false; + this.boldStyle = false; +@@ -280,41 +407,47 @@ + this.strikethroughStyle = false; + } + +- private void renderStringAtPos(String var1, boolean var2) { +- for(int var3 = 0; var3 < var1.length(); ++var3) { +- char var4 = var1.charAt(var3); ++ /** ++ * Render a single line string at the current (posX,posY) and update posX ++ */ ++ private void renderStringAtPos(String par1Str, boolean par2) { ++ for (int var3 = 0; var3 < par1Str.length(); ++var3) { ++ char var4 = par1Str.charAt(var3); + int var5; + int var6; +- if(var4 == 167 && var3 + 1 < var1.length()) { +- var5 = "0123456789abcdefklmnor".indexOf(var1.toLowerCase().charAt(var3 + 1)); +- if(var5 < 16) { ++ ++ if (var4 == 167 && var3 + 1 < par1Str.length()) { ++ var5 = "0123456789abcdefklmnor".indexOf(par1Str.toLowerCase().charAt(var3 + 1)); ++ ++ if (var5 < 16) { + this.randomStyle = false; + this.boldStyle = false; + this.strikethroughStyle = false; + this.underlineStyle = false; + this.italicStyle = false; +- if(var5 < 0 || var5 > 15) { ++ ++ if (var5 < 0 || var5 > 15) { + var5 = 15; + } + +- if(var2) { ++ if (par2) { + var5 += 16; + } + +- var6 = this.colorCode[var5]; ++ var6 = ColorizeWorld.colorizeText(this.colorCode[var5], var5); + this.textColor = var6; + GL11.glColor4f((float)(var6 >> 16) / 255.0F, (float)(var6 >> 8 & 255) / 255.0F, (float)(var6 & 255) / 255.0F, this.alpha); +- } else if(var5 == 16) { ++ } else if (var5 == 16) { + this.randomStyle = true; +- } else if(var5 == 17) { ++ } else if (var5 == 17) { + this.boldStyle = true; +- } else if(var5 == 18) { ++ } else if (var5 == 18) { + this.strikethroughStyle = true; +- } else if(var5 == 19) { ++ } else if (var5 == 19) { + this.underlineStyle = true; +- } else if(var5 == 20) { ++ } else if (var5 == 20) { + this.italicStyle = true; +- } else if(var5 == 21) { ++ } else if (var5 == 21) { + this.randomStyle = false; + this.boldStyle = false; + this.strikethroughStyle = false; +@@ -325,38 +458,43 @@ + + ++var3; + } else { +- var5 = ChatAllowedCharacters.a.indexOf(var4); +- if(this.randomStyle && var5 > 0) { ++ var5 = ChatAllowedCharacters.allowedCharacters.indexOf(var4); ++ ++ if (this.randomStyle && var5 > 0) { + do { +- var6 = this.b.nextInt(ChatAllowedCharacters.a.length()); +- } while(this.charWidth[var5 + 32] != this.charWidth[var6 + 32]); ++ var6 = this.fontRandom.nextInt(ChatAllowedCharacters.allowedCharacters.length()); ++ } while (this.charWidth[var5 + 32] != this.charWidth[var6 + 32]); + + var5 = var6; + } + + float var11 = this.unicodeFlag ? 0.5F : 1.0F; +- boolean var7 = (var5 <= 0 || this.unicodeFlag) && var2; +- if(var7) { ++ boolean var7 = (var5 <= 0 || this.unicodeFlag) && par2; ++ ++ if (var7) { + this.posX -= var11; + this.posY -= var11; + } + + float var8 = this.renderCharAtPos(var5, var4, this.italicStyle); +- if(var7) { ++ ++ if (var7) { + this.posX += var11; + this.posY += var11; + } + +- if(this.boldStyle) { ++ if (this.boldStyle) { + this.posX += var11; +- if(var7) { ++ ++ if (var7) { + this.posX -= var11; + this.posY -= var11; + } + + this.renderCharAtPos(var5, var4, this.italicStyle); + this.posX -= var11; +- if(var7) { ++ ++ if (var7) { + this.posX += var11; + this.posY += var11; + } +@@ -365,7 +503,8 @@ + } + + Tessellator var9; +- if(this.strikethroughStyle) { ++ ++ if (this.strikethroughStyle) { + var9 = Tessellator.instance; + GL11.glDisable(GL11.GL_TEXTURE_2D); + var9.startDrawingQuads(); +@@ -377,7 +516,7 @@ + GL11.glEnable(GL11.GL_TEXTURE_2D); + } + +- if(this.underlineStyle) { ++ if (this.underlineStyle) { + var9 = Tessellator.instance; + GL11.glDisable(GL11.GL_TEXTURE_2D); + var9.startDrawingQuads(); +@@ -393,58 +532,73 @@ + this.posX += (float)((int)var8); + } + } +- + } + +- private int renderStringAligned(String var1, int var2, int var3, int var4, int var5, boolean var6) { +- if(this.bidiFlag) { +- var1 = this.bidiReorder(var1); +- int var7 = this.getStringWidth(var1); +- var2 = var2 + var4 - var7; ++ /** ++ * Render string either left or right aligned depending on bidiFlag ++ */ ++ private int renderStringAligned(String par1Str, int par2, int par3, int par4, int par5, boolean par6) { ++ if (this.bidiFlag) { ++ par1Str = this.bidiReorder(par1Str); ++ int var7 = this.getStringWidth(par1Str); ++ par2 = par2 + par4 - var7; + } + +- return this.renderString(var1, var2, var3, var5, var6); ++ return this.renderString(par1Str, par2, par3, par5, par6); + } + +- private int renderString(String var1, int var2, int var3, int var4, boolean var5) { +- if(var1 == null) { ++ /** ++ * Render single line string by setting GL color, current (posX,posY), and calling renderStringAtPos() ++ */ ++ private int renderString(String par1Str, int par2, int par3, int par4, boolean par5) { ++ if (par1Str == null) { + return 0; + } else { +- if((var4 & -67108864) == 0) { +- var4 |= -16777216; +- } +- +- if(var5) { +- var4 = (var4 & 16579836) >> 2 | var4 & -16777216; +- } +- +- this.red = (float)(var4 >> 16 & 255) / 255.0F; +- this.blue = (float)(var4 >> 8 & 255) / 255.0F; +- this.green = (float)(var4 & 255) / 255.0F; +- this.alpha = (float)(var4 >> 24 & 255) / 255.0F; ++ this.boundTextureName = 0; ++ par4 = ColorizeWorld.colorizeText(par4); ++ ++ if ((par4 & -67108864) == 0) { ++ par4 |= -16777216; ++ } ++ ++ if (par5) { ++ par4 = (par4 & 16579836) >> 2 | par4 & -16777216; ++ } ++ ++ this.red = (float)(par4 >> 16 & 255) / 255.0F; ++ this.blue = (float)(par4 >> 8 & 255) / 255.0F; ++ this.green = (float)(par4 & 255) / 255.0F; ++ this.alpha = (float)(par4 >> 24 & 255) / 255.0F; + GL11.glColor4f(this.red, this.blue, this.green, this.alpha); +- this.posX = (float)var2; +- this.posY = (float)var3; +- this.renderStringAtPos(var1, var5); ++ this.posX = (float)par2; ++ this.posY = (float)par3; ++ this.renderStringAtPos(par1Str, par5); + return (int)this.posX; + } + } + +- public int getStringWidth(String var1) { +- if(var1 == null) { ++ /** ++ * Returns the width of this string. Equivalent of FontMetrics.stringWidth(String s). ++ */ ++ public int getStringWidth(String par1Str) { ++ if (this.isHD) { ++ return (int)FontUtils.getStringWidthf(this, par1Str); ++ } else if (par1Str == null) { + return 0; + } else { + int var2 = 0; + boolean var3 = false; + +- for(int var4 = 0; var4 < var1.length(); ++var4) { +- char var5 = var1.charAt(var4); ++ for (int var4 = 0; var4 < par1Str.length(); ++var4) { ++ char var5 = par1Str.charAt(var4); + int var6 = this.getCharWidth(var5); +- if(var6 < 0 && var4 < var1.length() - 1) { ++ ++ if (var6 < 0 && var4 < par1Str.length() - 1) { + ++var4; +- var5 = var1.charAt(var4); +- if(var5 != 108 && var5 != 76) { +- if(var5 == 114 || var5 == 82) { ++ var5 = par1Str.charAt(var4); ++ ++ if (var5 != 108 && var5 != 76) { ++ if (var5 == 114 || var5 == 82) { + var3 = false; + } + } else { +@@ -455,7 +609,8 @@ + } + + var2 += var6; +- if(var3) { ++ ++ if (var3) { + ++var2; + } + } +@@ -464,19 +619,24 @@ + } + } + +- public int getCharWidth(char var1) { +- if(var1 == 167) { ++ /** ++ * Returns the width of this character as rendered. ++ */ ++ public int getCharWidth(char par1) { ++ if (par1 == 167) { + return -1; +- } else if(var1 == 32) { ++ } else if (par1 == 32) { + return 4; + } else { +- int var2 = ChatAllowedCharacters.a.indexOf(var1); +- if(var2 >= 0 && !this.unicodeFlag) { ++ int var2 = ChatAllowedCharacters.allowedCharacters.indexOf(par1); ++ ++ if (var2 >= 0 && !this.unicodeFlag) { + return this.charWidth[var2 + 32]; +- } else if(this.glyphWidth[var1] != 0) { +- int var3 = this.glyphWidth[var1] >>> 4; +- int var4 = this.glyphWidth[var1] & 15; +- if(var4 > 7) { ++ } else if (this.glyphWidth[par1] != 0) { ++ int var3 = this.glyphWidth[par1] >>> 4; ++ int var4 = this.glyphWidth[par1] & 15; ++ ++ if (var4 > 7) { + var4 = 15; + var3 = 0; + } +@@ -489,44 +649,53 @@ + } + } + +- public String trimStringToWidth(String var1, int var2) { +- return this.trimStringToWidth(var1, var2, false); ++ /** ++ * Trims a string to fit a specified Width. ++ */ ++ public String trimStringToWidth(String par1Str, int par2) { ++ return this.trimStringToWidth(par1Str, par2, false); + } + +- public String trimStringToWidth(String var1, int var2, boolean var3) { ++ /** ++ * Trims a string to a specified width, and will reverse it if par3 is set. ++ */ ++ public String trimStringToWidth(String par1Str, int par2, boolean par3) { + StringBuilder var4 = new StringBuilder(); + int var5 = 0; +- int var6 = var3 ? var1.length() - 1 : 0; +- int var7 = var3 ? -1 : 1; ++ int var6 = par3 ? par1Str.length() - 1 : 0; ++ int var7 = par3 ? -1 : 1; + boolean var8 = false; + boolean var9 = false; + +- for(int var10 = var6; var10 >= 0 && var10 < var1.length() && var5 < var2; var10 += var7) { +- char var11 = var1.charAt(var10); ++ for (int var10 = var6; var10 >= 0 && var10 < par1Str.length() && var5 < par2; var10 += var7) { ++ char var11 = par1Str.charAt(var10); + int var12 = this.getCharWidth(var11); +- if(var8) { ++ ++ if (var8) { + var8 = false; +- if(var11 != 108 && var11 != 76) { +- if(var11 == 114 || var11 == 82) { ++ ++ if (var11 != 108 && var11 != 76) { ++ if (var11 == 114 || var11 == 82) { + var9 = false; + } + } else { + var9 = true; + } +- } else if(var12 < 0) { ++ } else if (var12 < 0) { + var8 = true; + } else { + var5 += var12; +- if(var9) { ++ ++ if (var9) { + ++var5; + } + } + +- if(var5 > var2) { ++ if (var5 > par2) { + break; + } + +- if(var3) { ++ if (par3) { + var4.insert(0, var11); + } else { + var4.append(var11); +@@ -536,105 +705,142 @@ + return var4.toString(); + } + +- private String trimStringNewline(String var1) { +- while(var1 != null && var1.endsWith("\n")) { +- var1 = var1.substring(0, var1.length() - 1); ++ /** ++ * Remove all newline characters from the end of the string ++ */ ++ private String trimStringNewline(String par1Str) { ++ while (par1Str != null && par1Str.endsWith("\n")) { ++ par1Str = par1Str.substring(0, par1Str.length() - 1); + } + +- return var1; ++ return par1Str; + } + +- public void drawSplitString(String var1, int var2, int var3, int var4, int var5) { ++ /** ++ * Splits and draws a String with wordwrap (maximum length is parameter k) ++ */ ++ public void drawSplitString(String par1Str, int par2, int par3, int par4, int par5) { + this.resetStyles(); +- this.textColor = var5; +- var1 = this.trimStringNewline(var1); +- this.renderSplitString(var1, var2, var3, var4, false); ++ this.textColor = par5; ++ par1Str = this.trimStringNewline(par1Str); ++ this.renderSplitString(par1Str, par2, par3, par4, false); + } + +- private void renderSplitString(String var1, int var2, int var3, int var4, boolean var5) { +- List var6 = this.listFormattedStringToWidth(var1, var4); ++ /** ++ * Perform actual work of rendering a multi-line string with wordwrap and with darker drop shadow color if flag is set ++ */ ++ private void renderSplitString(String par1Str, int par2, int par3, int par4, boolean par5) { ++ List var6 = this.listFormattedStringToWidth(par1Str, par4); + +- for(Iterator var7 = var6.iterator(); var7.hasNext(); var3 += this.FONT_HEIGHT) { ++ for (Iterator var7 = var6.iterator(); var7.hasNext(); par3 += this.FONT_HEIGHT) { + String var8 = (String)var7.next(); +- this.renderStringAligned(var8, var2, var3, var4, this.textColor, var5); ++ this.renderStringAligned(var8, par2, par3, par4, this.textColor, par5); + } +- +- } +- +- public int splitStringWidth(String var1, int var2) { +- return this.FONT_HEIGHT * this.listFormattedStringToWidth(var1, var2).size(); +- } +- +- public void setUnicodeFlag(boolean var1) { +- this.unicodeFlag = var1; +- } +- ++ } ++ ++ /** ++ * Returns the width of the wordwrapped String (maximum length is parameter k) ++ */ ++ public int splitStringWidth(String par1Str, int par2) { ++ return this.FONT_HEIGHT * this.listFormattedStringToWidth(par1Str, par2).size(); ++ } ++ ++ /** ++ * Set unicodeFlag controlling whether strings should be rendered with Unicode fonts instead of the default.png font. ++ */ ++ public void setUnicodeFlag(boolean par1) { ++ this.unicodeFlag = par1; ++ } ++ ++ /** ++ * Get unicodeFlag controlling whether strings should be rendered with Unicode fonts instead of the default.png font. ++ */ + public boolean getUnicodeFlag() { + return this.unicodeFlag; + } + +- public void setBidiFlag(boolean var1) { +- this.bidiFlag = var1; +- } +- +- public List listFormattedStringToWidth(String var1, int var2) { +- return Arrays.asList(this.wrapFormattedStringToWidth(var1, var2).split("\n")); +- } +- +- String wrapFormattedStringToWidth(String var1, int var2) { +- int var3 = this.sizeStringToWidth(var1, var2); +- if(var1.length() <= var3) { +- return var1; ++ /** ++ * Set bidiFlag to control if the Unicode Bidirectional Algorithm should be run before rendering any string. ++ */ ++ public void setBidiFlag(boolean par1) { ++ this.bidiFlag = par1; ++ } ++ ++ /** ++ * Breaks a string into a list of pieces that will fit a specified width. ++ */ ++ public List listFormattedStringToWidth(String par1Str, int par2) { ++ return Arrays.asList(this.wrapFormattedStringToWidth(par1Str, par2).split("\n")); ++ } ++ ++ /** ++ * Inserts newline and formatting into a string to wrap it within the specified width. ++ */ ++ String wrapFormattedStringToWidth(String par1Str, int par2) { ++ int var3 = this.sizeStringToWidth(par1Str, par2); ++ ++ if (par1Str.length() <= var3) { ++ return par1Str; + } else { +- String var4 = var1.substring(0, var3); +- char var5 = var1.charAt(var3); ++ String var4 = par1Str.substring(0, var3); ++ char var5 = par1Str.charAt(var3); + boolean var6 = var5 == 32 || var5 == 10; +- String var7 = getFormatFromString(var4) + var1.substring(var3 + (var6 ? 1 : 0)); +- return var4 + "\n" + this.wrapFormattedStringToWidth(var7, var2); ++ String var7 = getFormatFromString(var4) + par1Str.substring(var3 + (var6 ? 1 : 0)); ++ return var4 + "\n" + this.wrapFormattedStringToWidth(var7, par2); + } + } + +- private int sizeStringToWidth(String var1, int var2) { +- int var3 = var1.length(); ++ /** ++ * Determines how many characters from the string will fit into the specified width. ++ */ ++ private int sizeStringToWidth(String par1Str, int par2) { ++ int var3 = par1Str.length(); + int var4 = 0; + int var5 = 0; + int var6 = -1; + +- for(boolean var7 = false; var5 < var3; ++var5) { +- char var8 = var1.charAt(var5); +- switch(var8) { +- case '\n': +- --var5; +- break; +- case ' ': +- var6 = var5; +- default: +- var4 += this.getCharWidth(var8); +- if(var7) { +- ++var4; +- } +- break; +- case '\u00a7': +- if(var5 < var3 - 1) { +- ++var5; +- char var9 = var1.charAt(var5); +- if(var9 != 108 && var9 != 76) { +- if(var9 == 114 || var9 == 82 || isFormatColor(var9)) { +- var7 = false; ++ for (boolean var7 = false; var5 < var3; ++var5) { ++ char var8 = par1Str.charAt(var5); ++ ++ switch (var8) { ++ case 10: ++ --var5; ++ break; ++ ++ case 167: ++ if (var5 < var3 - 1) { ++ ++var5; ++ char var9 = par1Str.charAt(var5); ++ ++ if (var9 != 108 && var9 != 76) { ++ if (var9 == 114 || var9 == 82 || isFormatColor(var9)) { ++ var7 = false; ++ } ++ } else { ++ var7 = true; + } +- } else { +- var7 = true; +- } +- } ++ } ++ ++ break; ++ ++ case 32: ++ var6 = var5; ++ ++ default: ++ var4 += this.getCharWidth(var8); ++ ++ if (var7) { ++ ++var4; ++ } + } + +- if(var8 == 10) { ++ if (var8 == 10) { + ++var5; + var6 = var5; + break; + } + +- if(var4 > var2) { ++ if (var4 > par2) { + break; + } + } +@@ -642,36 +848,46 @@ + return var5 != var3 && var6 != -1 && var6 < var5 ? var6 : var5; + } + +- private static boolean isFormatColor(char var0) { +- return var0 >= 48 && var0 <= 57 || var0 >= 97 && var0 <= 102 || var0 >= 65 && var0 <= 70; +- } +- +- private static boolean isFormatSpecial(char var0) { +- return var0 >= 107 && var0 <= 111 || var0 >= 75 && var0 <= 79 || var0 == 114 || var0 == 82; +- } +- +- private static String getFormatFromString(String var0) { ++ /** ++ * Checks if the char code is a hexadecimal character, used to set colour. ++ */ ++ private static boolean isFormatColor(char par0) { ++ return par0 >= 48 && par0 <= 57 || par0 >= 97 && par0 <= 102 || par0 >= 65 && par0 <= 70; ++ } ++ ++ /** ++ * Checks if the char code is O-K...lLrRk-o... used to set special formatting. ++ */ ++ private static boolean isFormatSpecial(char par0) { ++ return par0 >= 107 && par0 <= 111 || par0 >= 75 && par0 <= 79 || par0 == 114 || par0 == 82; ++ } ++ ++ /** ++ * Digests a string for nonprinting formatting characters then returns a string containing only that formatting. ++ */ ++ private static String getFormatFromString(String par0Str) { + String var1 = ""; + int var2 = -1; +- int var3 = var0.length(); +- +- while(true) { +- var2 = var0.indexOf(167, var2 + 1); +- if(var2 == -1) { +- return var1; +- } +- +- if(var2 < var3 - 1) { +- char var4 = var0.charAt(var2 + 1); +- if(isFormatColor(var4)) { ++ int var3 = par0Str.length(); ++ ++ while ((var2 = par0Str.indexOf(167, var2 + 1)) != -1) { ++ if (var2 < var3 - 1) { ++ char var4 = par0Str.charAt(var2 + 1); ++ ++ if (isFormatColor(var4)) { + var1 = "\u00a7" + var4; +- } else if(isFormatSpecial(var4)) { ++ } else if (isFormatSpecial(var4)) { + var1 = var1 + "\u00a7" + var4; + } + } + } ++ ++ return var1; + } + ++ /** ++ * Get bidiFlag that controls if the Unicode Bidirectional Algorithm should be run before rendering any string ++ */ + public boolean getBidiFlag() { + return this.bidiFlag; + } diff --git a/patches/net/minecraft/src/FoodStats.java.patch b/patches/net/minecraft/src/FoodStats.java.patch new file mode 100644 index 0000000..37b970f --- /dev/null +++ b/patches/net/minecraft/src/FoodStats.java.patch @@ -0,0 +1,180 @@ +--- net/minecraft/src/FoodStats.java ++++ net/minecraft/src/FoodStats.java +@@ -1,45 +1,66 @@ + package net.minecraft.src; + + public class FoodStats { ++ ++ /** The player's food level. */ + private int foodLevel = 20; ++ ++ /** The player's food saturation. */ + private float foodSaturationLevel = 5.0F; ++ ++ /** The player's food exhaustion. */ + private float foodExhaustionLevel; ++ ++ /** The player's food timer value. */ + private int foodTimer; + private int prevFoodLevel = 20; + +- public void addStats(int var1, float var2) { +- this.foodLevel = Math.min(var1 + this.foodLevel, 20); +- this.foodSaturationLevel = Math.min(this.foodSaturationLevel + (float)var1 * var2 * 2.0F, (float)this.foodLevel); +- } +- +- public void addStats(ItemFood var1) { +- this.addStats(var1.getHealAmount(), var1.getSaturationModifier()); +- } +- +- public void onUpdate(EntityPlayer var1) { +- int var2 = var1.worldObj.difficultySetting; ++ /** ++ * Args: int foodLevel, float foodSaturationModifier ++ */ ++ public void addStats(int par1, float par2) { ++ this.foodLevel = Math.min(par1 + this.foodLevel, 20); ++ this.foodSaturationLevel = Math.min(this.foodSaturationLevel + (float)par1 * par2 * 2.0F, (float)this.foodLevel); ++ } ++ ++ /** ++ * Eat some food. ++ */ ++ public void addStats(ItemFood par1ItemFood) { ++ this.addStats(par1ItemFood.getHealAmount(), par1ItemFood.getSaturationModifier()); ++ } ++ ++ /** ++ * Handles the food game logic. ++ */ ++ public void onUpdate(EntityPlayer par1EntityPlayer) { ++ int var2 = par1EntityPlayer.worldObj.difficultySetting; + this.prevFoodLevel = this.foodLevel; +- if(this.foodExhaustionLevel > 4.0F) { ++ ++ if (this.foodExhaustionLevel > 4.0F) { + this.foodExhaustionLevel -= 4.0F; +- if(this.foodSaturationLevel > 0.0F) { ++ ++ if (this.foodSaturationLevel > 0.0F) { + this.foodSaturationLevel = Math.max(this.foodSaturationLevel - 1.0F, 0.0F); +- } else if(var2 > 0) { ++ } else if (var2 > 0) { + this.foodLevel = Math.max(this.foodLevel - 1, 0); + } + } + +- if(var1.worldObj.getGameRules().getGameRuleBooleanValue("naturalRegeneration") && this.foodLevel >= 18 && var1.shouldHeal()) { ++ if (par1EntityPlayer.worldObj.getGameRules().getGameRuleBooleanValue("naturalRegeneration") && this.foodLevel >= 18 && par1EntityPlayer.shouldHeal()) { + ++this.foodTimer; +- if(this.foodTimer >= 80) { +- var1.heal(1.0F); ++ ++ if (this.foodTimer >= 80) { ++ par1EntityPlayer.heal(1.0F); + this.addExhaustion(3.0F); + this.foodTimer = 0; + } +- } else if(this.foodLevel <= 0) { ++ } else if (this.foodLevel <= 0) { + ++this.foodTimer; +- if(this.foodTimer >= 80) { +- if(var1.getHealth() > 10.0F || var2 >= 3 || var1.getHealth() > 1.0F && var2 >= 2) { +- var1.attackEntityFrom(DamageSource.starve, 1.0F); ++ ++ if (this.foodTimer >= 80) { ++ if (par1EntityPlayer.getHealth() > 10.0F || var2 >= 3 || par1EntityPlayer.getHealth() > 1.0F && var2 >= 2) { ++ par1EntityPlayer.attackEntityFrom(DamageSource.starve, 1.0F); + } + + this.foodTimer = 0; +@@ -47,26 +68,33 @@ + } else { + this.foodTimer = 0; + } +- + } + +- public void readNBT(NBTTagCompound var1) { +- if(var1.hasKey("foodLevel")) { +- this.foodLevel = var1.getInteger("foodLevel"); +- this.foodTimer = var1.getInteger("foodTickTimer"); +- this.foodSaturationLevel = var1.getFloat("foodSaturationLevel"); +- this.foodExhaustionLevel = var1.getFloat("foodExhaustionLevel"); ++ /** ++ * Reads food stats from an NBT object. ++ */ ++ public void readNBT(NBTTagCompound par1NBTTagCompound) { ++ if (par1NBTTagCompound.hasKey("foodLevel")) { ++ this.foodLevel = par1NBTTagCompound.getInteger("foodLevel"); ++ this.foodTimer = par1NBTTagCompound.getInteger("foodTickTimer"); ++ this.foodSaturationLevel = par1NBTTagCompound.getFloat("foodSaturationLevel"); ++ this.foodExhaustionLevel = par1NBTTagCompound.getFloat("foodExhaustionLevel"); + } +- +- } +- +- public void writeNBT(NBTTagCompound var1) { +- var1.setInteger("foodLevel", this.foodLevel); +- var1.setInteger("foodTickTimer", this.foodTimer); +- var1.setFloat("foodSaturationLevel", this.foodSaturationLevel); +- var1.setFloat("foodExhaustionLevel", this.foodExhaustionLevel); +- } +- ++ } ++ ++ /** ++ * Writes food stats to an NBT object. ++ */ ++ public void writeNBT(NBTTagCompound par1NBTTagCompound) { ++ par1NBTTagCompound.setInteger("foodLevel", this.foodLevel); ++ par1NBTTagCompound.setInteger("foodTickTimer", this.foodTimer); ++ par1NBTTagCompound.setFloat("foodSaturationLevel", this.foodSaturationLevel); ++ par1NBTTagCompound.setFloat("foodExhaustionLevel", this.foodExhaustionLevel); ++ } ++ ++ /** ++ * Get the player's food level. ++ */ + public int getFoodLevel() { + return this.foodLevel; + } +@@ -75,23 +103,32 @@ + return this.prevFoodLevel; + } + ++ /** ++ * If foodLevel is not max. ++ */ + public boolean needFood() { + return this.foodLevel < 20; + } + +- public void addExhaustion(float var1) { +- this.foodExhaustionLevel = Math.min(this.foodExhaustionLevel + var1, 40.0F); ++ /** ++ * adds input to foodExhaustionLevel to a max of 40 ++ */ ++ public void addExhaustion(float par1) { ++ this.foodExhaustionLevel = Math.min(this.foodExhaustionLevel + par1, 40.0F); + } + ++ /** ++ * Get the player's food saturation level. ++ */ + public float getSaturationLevel() { + return this.foodSaturationLevel; + } + +- public void setFoodLevel(int var1) { +- this.foodLevel = var1; ++ public void setFoodLevel(int par1) { ++ this.foodLevel = par1; + } + +- public void setFoodSaturationLevel(float var1) { +- this.foodSaturationLevel = var1; ++ public void setFoodSaturationLevel(float par1) { ++ this.foodSaturationLevel = par1; + } + } diff --git a/patches/net/minecraft/src/Frustrum.java.patch b/patches/net/minecraft/src/Frustrum.java.patch new file mode 100644 index 0000000..eafc2bc --- /dev/null +++ b/patches/net/minecraft/src/Frustrum.java.patch @@ -0,0 +1,38 @@ +--- net/minecraft/src/Frustrum.java ++++ net/minecraft/src/Frustrum.java +@@ -6,17 +6,23 @@ + private double yPosition; + private double zPosition; + +- public void setPosition(double var1, double var3, double var5) { +- this.xPosition = var1; +- this.yPosition = var3; +- this.zPosition = var5; +- } +- +- public boolean isBoxInFrustum(double var1, double var3, double var5, double var7, double var9, double var11) { +- return this.clippingHelper.isBoxInFrustum(var1 - this.xPosition, var3 - this.yPosition, var5 - this.zPosition, var7 - this.xPosition, var9 - this.yPosition, var11 - this.zPosition); +- } +- +- public boolean isBoundingBoxInFrustum(AxisAlignedBB var1) { +- return this.isBoxInFrustum(var1.minX, var1.minY, var1.minZ, var1.maxX, var1.maxY, var1.maxZ); ++ public void setPosition(double par1, double par3, double par5) { ++ this.xPosition = par1; ++ this.yPosition = par3; ++ this.zPosition = par5; ++ } ++ ++ /** ++ * Calls the clipping helper. Returns true if the box is inside all 6 clipping planes, otherwise returns false. ++ */ ++ public boolean isBoxInFrustum(double par1, double par3, double par5, double par7, double par9, double par11) { ++ return this.clippingHelper.isBoxInFrustum(par1 - this.xPosition, par3 - this.yPosition, par5 - this.zPosition, par7 - this.xPosition, par9 - this.yPosition, par11 - this.zPosition); ++ } ++ ++ /** ++ * Returns true if the bounding box is inside all 6 clipping planes, otherwise returns false. ++ */ ++ public boolean isBoundingBoxInFrustum(AxisAlignedBB par1AxisAlignedBB) { ++ return this.isBoxInFrustum(par1AxisAlignedBB.minX, par1AxisAlignedBB.minY, par1AxisAlignedBB.minZ, par1AxisAlignedBB.maxX, par1AxisAlignedBB.maxY, par1AxisAlignedBB.maxZ); + } + } diff --git a/patches/net/minecraft/src/FurnaceRecipes.java.patch b/patches/net/minecraft/src/FurnaceRecipes.java.patch new file mode 100644 index 0000000..3a0b452 --- /dev/null +++ b/patches/net/minecraft/src/FurnaceRecipes.java.patch @@ -0,0 +1,55 @@ +--- net/minecraft/src/FurnaceRecipes.java ++++ net/minecraft/src/FurnaceRecipes.java +@@ -5,9 +5,14 @@ + + public class FurnaceRecipes { + private static final FurnaceRecipes smeltingBase = new FurnaceRecipes(); +- private Map b = new HashMap(); +- private Map c = new HashMap(); +- ++ ++ /** The list of smelting results. */ ++ private Map smeltingList = new HashMap(); ++ private Map experienceList = new HashMap(); ++ ++ /** ++ * Used to call methods addSmelting and getSmeltingResult. ++ */ + public static final FurnaceRecipes smelting() { + return smeltingBase; + } +@@ -35,20 +40,26 @@ + this.addSmelting(Block.oreNetherQuartz.blockID, new ItemStack(Item.netherQuartz), 0.2F); + } + +- public void addSmelting(int var1, ItemStack var2, float var3) { +- this.b.put(Integer.valueOf(var1), var2); +- this.c.put(Integer.valueOf(var2.itemID), Float.valueOf(var3)); ++ /** ++ * Adds a smelting recipe. ++ */ ++ public void addSmelting(int par1, ItemStack par2ItemStack, float par3) { ++ this.smeltingList.put(Integer.valueOf(par1), par2ItemStack); ++ this.experienceList.put(Integer.valueOf(par2ItemStack.itemID), Float.valueOf(par3)); + } + +- public ItemStack getSmeltingResult(int var1) { +- return (ItemStack)this.b.get(Integer.valueOf(var1)); ++ /** ++ * Returns the smelting result of an item. ++ */ ++ public ItemStack getSmeltingResult(int par1) { ++ return (ItemStack)this.smeltingList.get(Integer.valueOf(par1)); + } + + public Map getSmeltingList() { +- return this.b; ++ return this.smeltingList; + } + +- public float getExperience(int var1) { +- return this.c.containsKey(Integer.valueOf(var1)) ? ((Float)this.c.get(Integer.valueOf(var1))).floatValue() : 0.0F; ++ public float getExperience(int par1) { ++ return this.experienceList.containsKey(Integer.valueOf(par1)) ? ((Float)this.experienceList.get(Integer.valueOf(par1))).floatValue() : 0.0F; + } + } diff --git a/patches/net/minecraft/src/GLAllocation.java.patch b/patches/net/minecraft/src/GLAllocation.java.patch new file mode 100644 index 0000000..c0d329f --- /dev/null +++ b/patches/net/minecraft/src/GLAllocation.java.patch @@ -0,0 +1,89 @@ +--- net/minecraft/src/GLAllocation.java ++++ net/minecraft/src/GLAllocation.java +@@ -13,48 +13,63 @@ + import org.lwjgl.opengl.GL11; + + public class GLAllocation { +- private static final Map a = new HashMap(); +- private static final List b = new ArrayList(); ++ private static final Map field_74531_a = new HashMap(); ++ private static final List field_74530_b = new ArrayList(); + +- public static synchronized int generateDisplayLists(int var0) { +- int var1 = GL11.glGenLists(var0); +- a.put(Integer.valueOf(var1), Integer.valueOf(var0)); ++ /** ++ * Generates the specified number of display lists and returns the first index. ++ */ ++ public static synchronized int generateDisplayLists(int par0) { ++ int var1 = GL11.glGenLists(par0); ++ field_74531_a.put(Integer.valueOf(var1), Integer.valueOf(par0)); + return var1; + } + +- public static synchronized void deleteDisplayLists(int var0) { +- GL11.glDeleteLists(var0, ((Integer)a.remove(Integer.valueOf(var0))).intValue()); ++ public static synchronized void deleteDisplayLists(int par0) { ++ GL11.glDeleteLists(par0, ((Integer)field_74531_a.remove(Integer.valueOf(par0))).intValue()); + } + + public static synchronized void func_98302_b() { +- for(int var0 = 0; var0 < b.size(); ++var0) { +- GL11.glDeleteTextures(((Integer)b.get(var0)).intValue()); ++ for (int var0 = 0; var0 < field_74530_b.size(); ++var0) { ++ GL11.glDeleteTextures(((Integer)field_74530_b.get(var0)).intValue()); + } + +- b.clear(); ++ field_74530_b.clear(); + } + ++ /** ++ * Deletes all textures and display lists. Called when Minecraft is shutdown to free up resources. ++ */ + public static synchronized void deleteTexturesAndDisplayLists() { +- Iterator var0 = a.entrySet().iterator(); ++ Iterator var0 = field_74531_a.entrySet().iterator(); + +- while(var0.hasNext()) { ++ while (var0.hasNext()) { + Entry var1 = (Entry)var0.next(); + GL11.glDeleteLists(((Integer)var1.getKey()).intValue(), ((Integer)var1.getValue()).intValue()); + } + +- a.clear(); ++ field_74531_a.clear(); + func_98302_b(); + } + +- public static synchronized ByteBuffer createDirectByteBuffer(int var0) { +- return ByteBuffer.allocateDirect(var0).order(ByteOrder.nativeOrder()); +- } +- +- public static IntBuffer createDirectIntBuffer(int var0) { +- return createDirectByteBuffer(var0 << 2).asIntBuffer(); +- } +- +- public static FloatBuffer createDirectFloatBuffer(int var0) { +- return createDirectByteBuffer(var0 << 2).asFloatBuffer(); ++ /** ++ * Creates and returns a direct byte buffer with the specified capacity. Applies native ordering to speed up access. ++ */ ++ public static synchronized ByteBuffer createDirectByteBuffer(int par0) { ++ return ByteBuffer.allocateDirect(par0).order(ByteOrder.nativeOrder()); ++ } ++ ++ /** ++ * Creates and returns a direct int buffer with the specified capacity. Applies native ordering to speed up access. ++ */ ++ public static IntBuffer createDirectIntBuffer(int par0) { ++ return createDirectByteBuffer(par0 << 2).asIntBuffer(); ++ } ++ ++ /** ++ * Creates and returns a direct float buffer with the specified capacity. Applies native ordering to speed up access. ++ */ ++ public static FloatBuffer createDirectFloatBuffer(int par0) { ++ return createDirectByteBuffer(par0 << 2).asFloatBuffer(); + } + } diff --git a/patches/net/minecraft/src/GameRuleValue.java.patch b/patches/net/minecraft/src/GameRuleValue.java.patch new file mode 100644 index 0000000..132f6bd --- /dev/null +++ b/patches/net/minecraft/src/GameRuleValue.java.patch @@ -0,0 +1,58 @@ +--- net/minecraft/src/GameRuleValue.java ++++ net/minecraft/src/GameRuleValue.java +@@ -1,35 +1,45 @@ + package net.minecraft.src; + + class GameRuleValue { +- private String a; ++ private String valueString; + private boolean valueBoolean; + private int valueInteger; + private double valueDouble; + +- public GameRuleValue(String var1) { +- this.setValue(var1); ++ public GameRuleValue(String par1Str) { ++ this.setValue(par1Str); + } + +- public void setValue(String var1) { +- this.a = var1; +- this.valueBoolean = Boolean.parseBoolean(var1); ++ /** ++ * Set this game rule value. ++ */ ++ public void setValue(String par1Str) { ++ this.valueString = par1Str; ++ this.valueBoolean = Boolean.parseBoolean(par1Str); + + try { +- this.valueInteger = Integer.parseInt(var1); ++ this.valueInteger = Integer.parseInt(par1Str); + } catch (NumberFormatException var4) { ++ ; + } + + try { +- this.valueDouble = Double.parseDouble(var1); ++ this.valueDouble = Double.parseDouble(par1Str); + } catch (NumberFormatException var3) { ++ ; + } +- + } + ++ /** ++ * Gets the GameRule's value as String. ++ */ + public String getGameRuleStringValue() { +- return this.a; ++ return this.valueString; + } + ++ /** ++ * Gets the GameRule's value as boolean. ++ */ + public boolean getGameRuleBooleanValue() { + return this.valueBoolean; + } diff --git a/patches/net/minecraft/src/GameRules.java.patch b/patches/net/minecraft/src/GameRules.java.patch new file mode 100644 index 0000000..171bee3 --- /dev/null +++ b/patches/net/minecraft/src/GameRules.java.patch @@ -0,0 +1,116 @@ +--- net/minecraft/src/GameRules.java ++++ net/minecraft/src/GameRules.java +@@ -5,7 +5,7 @@ + import java.util.TreeMap; + + public class GameRules { +- private TreeMap a = new TreeMap(); ++ private TreeMap theGameRules = new TreeMap(); + + public GameRules() { + this.addGameRule("doFireTick", "true"); +@@ -19,61 +19,81 @@ + this.addGameRule("doDaylightCycle", "true"); + } + +- public void addGameRule(String var1, String var2) { +- this.a.put(var1, new GameRuleValue(var2)); ++ /** ++ * Define a game rule and its default value. ++ */ ++ public void addGameRule(String par1Str, String par2Str) { ++ this.theGameRules.put(par1Str, new GameRuleValue(par2Str)); + } + +- public void setOrCreateGameRule(String var1, String var2) { +- GameRuleValue var3 = (GameRuleValue)this.a.get(var1); +- if(var3 != null) { +- var3.setValue(var2); ++ public void setOrCreateGameRule(String par1Str, String par2Str) { ++ GameRuleValue var3 = (GameRuleValue)this.theGameRules.get(par1Str); ++ ++ if (var3 != null) { ++ var3.setValue(par2Str); + } else { +- this.addGameRule(var1, var2); ++ this.addGameRule(par1Str, par2Str); + } +- + } + +- public String getGameRuleStringValue(String var1) { +- GameRuleValue var2 = (GameRuleValue)this.a.get(var1); ++ /** ++ * Gets the string Game Rule value. ++ */ ++ public String getGameRuleStringValue(String par1Str) { ++ GameRuleValue var2 = (GameRuleValue)this.theGameRules.get(par1Str); + return var2 != null ? var2.getGameRuleStringValue() : ""; + } + +- public boolean getGameRuleBooleanValue(String var1) { +- GameRuleValue var2 = (GameRuleValue)this.a.get(var1); ++ /** ++ * Gets the boolean Game Rule value. ++ */ ++ public boolean getGameRuleBooleanValue(String par1Str) { ++ GameRuleValue var2 = (GameRuleValue)this.theGameRules.get(par1Str); + return var2 != null ? var2.getGameRuleBooleanValue() : false; + } + ++ /** ++ * Return the defined game rules as NBT. ++ */ + public NBTTagCompound writeGameRulesToNBT() { + NBTTagCompound var1 = new NBTTagCompound("GameRules"); +- Iterator var2 = this.a.keySet().iterator(); ++ Iterator var2 = this.theGameRules.keySet().iterator(); + +- while(var2.hasNext()) { ++ while (var2.hasNext()) { + String var3 = (String)var2.next(); +- GameRuleValue var4 = (GameRuleValue)this.a.get(var3); ++ GameRuleValue var4 = (GameRuleValue)this.theGameRules.get(var3); + var1.setString(var3, var4.getGameRuleStringValue()); + } + + return var1; + } + +- public void readGameRulesFromNBT(NBTTagCompound var1) { +- Collection var2 = var1.getTags(); ++ /** ++ * Set defined game rules from NBT. ++ */ ++ public void readGameRulesFromNBT(NBTTagCompound par1NBTTagCompound) { ++ Collection var2 = par1NBTTagCompound.getTags(); + Iterator var3 = var2.iterator(); + +- while(var3.hasNext()) { ++ while (var3.hasNext()) { + NBTBase var4 = (NBTBase)var3.next(); + String var5 = var4.getName(); +- String var6 = var1.getString(var4.getName()); ++ String var6 = par1NBTTagCompound.getString(var4.getName()); + this.setOrCreateGameRule(var5, var6); + } +- + } + ++ /** ++ * Return the defined game rules. ++ */ + public String[] getRules() { +- return (String[])this.a.keySet().toArray(new String[0]); ++ return (String[])this.theGameRules.keySet().toArray(new String[0]); + } + +- public boolean hasRule(String var1) { +- return this.a.containsKey(var1); ++ /** ++ * Return whether the specified game rule is defined. ++ */ ++ public boolean hasRule(String par1Str) { ++ return this.theGameRules.containsKey(par1Str); + } + } diff --git a/patches/net/minecraft/src/GameSettings.java.patch b/patches/net/minecraft/src/GameSettings.java.patch new file mode 100644 index 0000000..df076de --- /dev/null +++ b/patches/net/minecraft/src/GameSettings.java.patch @@ -0,0 +1,999 @@ +--- net/minecraft/src/GameSettings.java ++++ net/minecraft/src/GameSettings.java +@@ -5,18 +5,23 @@ + import java.io.FileReader; + import java.io.FileWriter; + import java.io.PrintWriter; ++ + import org.lwjgl.input.Keyboard; + import org.lwjgl.input.Mouse; + import org.lwjgl.opengl.Display; + + public class GameSettings { +- private static final String[] ao = new String[]{"options.renderDistance.far", "options.renderDistance.normal", "options.renderDistance.short", "options.renderDistance.tiny"}; +- private static final String[] ap = new String[]{"options.difficulty.peaceful", "options.difficulty.easy", "options.difficulty.normal", "options.difficulty.hard"}; +- private static final String[] aq = new String[]{"options.guiScale.auto", "options.guiScale.small", "options.guiScale.normal", "options.guiScale.large"}; +- private static final String[] ar = new String[]{"options.chat.visibility.full", "options.chat.visibility.system", "options.chat.visibility.hidden"}; +- private static final String[] as = new String[]{"options.particles.all", "options.particles.decreased", "options.particles.minimal"}; +- private static final String[] at = new String[]{"performance.max", "performance.balanced", "performance.powersaver"}; +- private static final String[] au = new String[]{"options.ao.off", "options.ao.min", "options.ao.max"}; ++ private static final String[] RENDER_DISTANCES = new String[] {"options.renderDistance.far", "options.renderDistance.normal", "options.renderDistance.short", "options.renderDistance.tiny"}; ++ private static final String[] DIFFICULTIES = new String[] {"options.difficulty.peaceful", "options.difficulty.easy", "options.difficulty.normal", "options.difficulty.hard"}; ++ ++ /** GUI scale values */ ++ private static final String[] GUISCALES = new String[] {"options.guiScale.auto", "options.guiScale.small", "options.guiScale.normal", "options.guiScale.large"}; ++ private static final String[] CHAT_VISIBILITIES = new String[] {"options.chat.visibility.full", "options.chat.visibility.system", "options.chat.visibility.hidden"}; ++ private static final String[] PARTICLES = new String[] {"options.particles.all", "options.particles.decreased", "options.particles.minimal"}; ++ ++ /** Limit framerate labels */ ++ private static final String[] LIMIT_FRAMERATES = new String[] {"performance.max", "performance.balanced", "performance.powersaver"}; ++ private static final String[] AMBIENT_OCCLUSIONS = new String[] {"options.ao.off", "options.ao.min", "options.ao.max"}; + public float musicVolume = 1.0F; + public float soundVolume = 1.0F; + public float mouseSensitivity = 0.5F; +@@ -24,12 +29,20 @@ + public int renderDistance; + public boolean viewBobbing = true; + public boolean anaglyph; ++ ++ /** Advanced OpenGL */ + public boolean advancedOpengl; + public int limitFramerate = 1; + public boolean fancyGraphics = true; ++ ++ /** Smooth Lighting */ + public int ambientOcclusion = 2; ++ ++ /** Clouds flag */ + public boolean clouds = true; +- public String m = "Default"; ++ ++ /** The name of the selected texture pack. */ ++ public String skin = "Default"; + public int chatVisibility; + public boolean chatColours = true; + public boolean chatLinks = true; +@@ -40,8 +53,16 @@ + public boolean fullScreen; + public boolean enableVsync = true; + public boolean hideServerAddress; ++ ++ /** ++ * Whether to show advanced information on item tooltips, toggled by F3+H ++ */ + public boolean advancedItemTooltips; ++ ++ /** Whether to pause when the game loses focus, toggled by F3+P */ + public boolean pauseOnLostFocus = true; ++ ++ /** Whether to show your cape */ + public boolean showCape = true; + public boolean touchscreen; + public int overrideWidth; +@@ -50,7 +71,7 @@ + public float chatScale = 1.0F; + public float chatWidth = 1.0F; + public float chatHeightUnfocused = 0.44366196F; +- public float chatHeightFocused = 1.0F; ++ public float chatHeightFocused = 1.0F; + public KeyBinding keyBindForward = new KeyBinding("key.forward", 17); + public KeyBinding keyBindLeft = new KeyBinding("key.left", 30); + public KeyBinding keyBindBack = new KeyBinding("key.back", 31); +@@ -65,200 +86,267 @@ + public KeyBinding keyBindPlayerList = new KeyBinding("key.playerlist", 15); + public KeyBinding keyBindPickBlock = new KeyBinding("key.pickItem", -98); + public KeyBinding keyBindCommand = new KeyBinding("key.command", 53); +- public KeyBinding[] keyBindings = new KeyBinding[]{this.keyBindAttack, this.keyBindUseItem, this.keyBindForward, this.keyBindLeft, this.keyBindBack, this.keyBindRight, this.keyBindJump, this.keyBindSneak, this.keyBindDrop, this.keyBindInventory, this.keyBindChat, this.keyBindPlayerList, this.keyBindPickBlock, this.keyBindCommand}; ++ // Spout Start ++ public KeyBinding keyBindToggleFog = new KeyBinding("Toggle Fog", Keyboard.KEY_F); ++ public final KeyBinding keySneakToggle = new KeyBinding("Sneak Toggle", Keyboard.KEY_LCONTROL); ++ public final KeyBinding keyRunToggle = new KeyBinding("Run Toggle", Keyboard.KEY_RCONTROL); ++ public final KeyBinding keyTreadWaterToggle = new KeyBinding("Tread Water Toggle", Keyboard.KEY_Z); ++ public final KeyBinding keyAutoForward = new KeyBinding("Forward Toggle", Keyboard.KEY_G); ++ public final KeyBinding keyAutoBackward = new KeyBinding("Backward Toggle", Keyboard.KEY_H); ++ public final KeyBinding keyFlyToggle = new KeyBinding("Fly Toggle", Keyboard.KEY_O); ++ public final KeyBinding keyFlyForward = new KeyBinding("Fly Foward", 17); ++ public final KeyBinding keyFlyLeft = new KeyBinding("Fly Left", 30); ++ public final KeyBinding keyFlyBack = new KeyBinding("Fly Back", 31); ++ public final KeyBinding keyFlyRight = new KeyBinding("Fly Right", 32); ++ public final KeyBinding keyFlyUp = new KeyBinding("Fly Up", Keyboard.KEY_SPACE); ++ public final KeyBinding keyFlyDown = new KeyBinding("Fly Down", Keyboard.KEY_LSHIFT); ++ public final KeyBinding keyWaypoint = new KeyBinding("Overview Map", Keyboard.KEY_P); ++ public final KeyBinding keyHideChat = new KeyBinding("Hide Chat", Keyboard.KEY_M); ++ public final KeyBinding[] spoutcraftBindings = {keyBindToggleFog, keySneakToggle, keyRunToggle, keyTreadWaterToggle, keyAutoForward, ++ keyAutoBackward, keyFlyToggle, keyFlyForward, keyFlyLeft, keyFlyBack, keyFlyRight, keyFlyUp, keyFlyDown, keyWaypoint, keyHideChat}; ++ // Spout End ++ public KeyBinding[] keyBindings; + protected Minecraft mc; +- private File av; +- public int difficulty = 2; ++ private File optionsFile; ++ public int difficulty; + public boolean hideGUI; + public int thirdPersonView; ++ ++ /** true if debug info should be displayed instead of version */ + public boolean showDebugInfo; + public boolean showDebugProfilerChart; +- public String ad = ""; ++ ++ /** The lastServer string. */ ++ public String lastServer; ++ ++ /** No clipping for singleplayer */ + public boolean noclip; ++ ++ /** Smooth Camera Toggle */ + public boolean smoothCamera; + public boolean debugCamEnable; +- public float noclipRate = 1.0F; +- public float debugCamRate = 1.0F; ++ ++ /** No clipping movement rate */ ++ public float noclipRate; ++ ++ /** Change rate for debug camera */ ++ public float debugCamRate; + public float fovSetting; + public float gammaSetting; ++ ++ /** GUI scale */ + public int guiScale; ++ ++ /** Determines amount of particles. 0 = All, 1 = Decreased, 2 = Minimal */ + public int particleSetting; +- public String an = "en_US"; +- +- public GameSettings(Minecraft var1, File var2) { +- this.mc = var1; +- this.av = new File(var2, "options.txt"); ++ ++ /** Game settings language */ ++ public String language; ++ ++ public GameSettings(Minecraft par1Minecraft, File par2File) { ++ this.keyBindings = new KeyBinding[] {this.keyBindAttack, this.keyBindUseItem, this.keyBindForward, this.keyBindLeft, this.keyBindBack, this.keyBindRight, this.keyBindJump, this.keyBindSneak, this.keyBindDrop, this.keyBindInventory, this.keyBindChat, this.keyBindPlayerList, this.keyBindPickBlock, this.keyBindCommand}; ++ this.difficulty = 2; ++ this.lastServer = ""; ++ this.noclipRate = 1.0F; ++ this.debugCamRate = 1.0F; ++ this.language = "en_US"; ++ this.mc = par1Minecraft; ++ this.optionsFile = new File(par2File, "options.txt"); + this.loadOptions(); + } + + public GameSettings() { +- } +- +- public String getKeyBindingDescription(int var1) { +- return I18n.getString(this.keyBindings[var1].c); +- } +- +- public String getOptionDisplayString(int var1) { +- int var2 = this.keyBindings[var1].keyCode; ++ this.keyBindings = new KeyBinding[] {this.keyBindAttack, this.keyBindUseItem, this.keyBindForward, this.keyBindLeft, this.keyBindBack, this.keyBindRight, this.keyBindJump, this.keyBindSneak, this.keyBindDrop, this.keyBindInventory, this.keyBindChat, this.keyBindPlayerList, this.keyBindPickBlock, this.keyBindCommand}; ++ this.difficulty = 2; ++ this.lastServer = ""; ++ this.noclipRate = 1.0F; ++ this.debugCamRate = 1.0F; ++ this.language = "en_US"; ++ } ++ ++ public String getKeyBindingDescription(int par1) { ++ return I18n.getString(this.keyBindings[par1].keyDescription); ++ } ++ ++ /** ++ * The string that appears inside the button/slider in the options menu. ++ */ ++ public String getOptionDisplayString(int par1) { ++ int var2 = this.keyBindings[par1].keyCode; + return getKeyDisplayString(var2); + } + +- public static String getKeyDisplayString(int var0) { +- return var0 < 0 ? I18n.getStringParams("key.mouseButton", new Object[]{Integer.valueOf(var0 + 101)}) : Keyboard.getKeyName(var0); +- } +- +- public static boolean isKeyDown(KeyBinding var0) { +- return var0.keyCode < 0 ? Mouse.isButtonDown(var0.keyCode + 100) : Keyboard.isKeyDown(var0.keyCode); +- } +- +- public void setKeyBinding(int var1, int var2) { +- this.keyBindings[var1].keyCode = var2; ++ /** ++ * Represents a key or mouse button as a string. Args: key ++ */ ++ public static String getKeyDisplayString(int par0) { ++ return par0 < 0 ? I18n.getStringParams("key.mouseButton", new Object[] {Integer.valueOf(par0 + 101)}): Keyboard.getKeyName(par0); ++ } ++ ++ /** ++ * Returns whether the specified key binding is currently being pressed. ++ */ ++ public static boolean isKeyDown(KeyBinding par0KeyBinding) { ++ return par0KeyBinding.keyCode < 0 ? Mouse.isButtonDown(par0KeyBinding.keyCode + 100) : Keyboard.isKeyDown(par0KeyBinding.keyCode); ++ } ++ ++ /** ++ * Sets a key binding. ++ */ ++ public void setKeyBinding(int par1, int par2) { ++ this.keyBindings[par1].keyCode = par2; + this.saveOptions(); + } + +- public void setOptionFloatValue(EnumOptions var1, float var2) { +- if(var1 == EnumOptions.MUSIC) { +- this.musicVolume = var2; +- this.mc.sndManager.onSoundOptionsChanged(); +- } +- +- if(var1 == EnumOptions.SOUND) { +- this.soundVolume = var2; +- this.mc.sndManager.onSoundOptionsChanged(); +- } +- +- if(var1 == EnumOptions.SENSITIVITY) { +- this.mouseSensitivity = var2; +- } +- +- if(var1 == EnumOptions.FOV) { +- this.fovSetting = var2; +- } +- +- if(var1 == EnumOptions.GAMMA) { +- this.gammaSetting = var2; +- } +- +- if(var1 == EnumOptions.CHAT_OPACITY) { +- this.chatOpacity = var2; +- this.mc.ingameGUI.getChatGUI().func_96132_b(); +- } +- +- if(var1 == EnumOptions.CHAT_HEIGHT_FOCUSED) { +- this.chatHeightFocused = var2; +- this.mc.ingameGUI.getChatGUI().func_96132_b(); +- } +- +- if(var1 == EnumOptions.CHAT_HEIGHT_UNFOCUSED) { +- this.chatHeightUnfocused = var2; +- this.mc.ingameGUI.getChatGUI().func_96132_b(); +- } +- +- if(var1 == EnumOptions.CHAT_WIDTH) { +- this.chatWidth = var2; +- this.mc.ingameGUI.getChatGUI().func_96132_b(); +- } +- +- if(var1 == EnumOptions.CHAT_SCALE) { +- this.chatScale = var2; +- this.mc.ingameGUI.getChatGUI().func_96132_b(); +- } +- ++ /** ++ * If the specified option is controlled by a slider (float value), this will set the float value. ++ */ ++ public void setOptionFloatValue(EnumOptions par1EnumOptions, float par2) { ++ if (par1EnumOptions == EnumOptions.MUSIC) { ++ this.musicVolume = par2; ++ this.mc.sndManager.onSoundOptionsChanged(); ++ } ++ ++ if (par1EnumOptions == EnumOptions.SOUND) { ++ this.soundVolume = par2; ++ this.mc.sndManager.onSoundOptionsChanged(); ++ } ++ ++ if (par1EnumOptions == EnumOptions.SENSITIVITY) { ++ this.mouseSensitivity = par2; ++ } ++ ++ if (par1EnumOptions == EnumOptions.FOV) { ++ this.fovSetting = par2; ++ } ++ ++ if (par1EnumOptions == EnumOptions.GAMMA) { ++ this.gammaSetting = par2; ++ } ++ ++ if (par1EnumOptions == EnumOptions.CHAT_OPACITY) { ++ this.chatOpacity = par2; ++ this.mc.ingameGUI.getChatGUI().func_96132_b(); ++ } ++ ++ if (par1EnumOptions == EnumOptions.CHAT_HEIGHT_FOCUSED) { ++ this.chatHeightFocused = par2; ++ this.mc.ingameGUI.getChatGUI().func_96132_b(); ++ } ++ ++ if (par1EnumOptions == EnumOptions.CHAT_HEIGHT_UNFOCUSED) { ++ this.chatHeightUnfocused = par2; ++ this.mc.ingameGUI.getChatGUI().func_96132_b(); ++ } ++ ++ if (par1EnumOptions == EnumOptions.CHAT_WIDTH) { ++ this.chatWidth = par2; ++ this.mc.ingameGUI.getChatGUI().func_96132_b(); ++ } ++ ++ if (par1EnumOptions == EnumOptions.CHAT_SCALE) { ++ this.chatScale = par2; ++ this.mc.ingameGUI.getChatGUI().func_96132_b(); ++ } + } + +- public void setOptionValue(EnumOptions var1, int var2) { +- if(var1 == EnumOptions.INVERT_MOUSE) { ++ /** ++ * For non-float options. Toggles the option on/off, or cycles through the list i.e. render distances. ++ */ ++ public void setOptionValue(EnumOptions par1EnumOptions, int par2) { ++ if (par1EnumOptions == EnumOptions.INVERT_MOUSE) { + this.invertMouse = !this.invertMouse; + } + +- if(var1 == EnumOptions.RENDER_DISTANCE) { +- this.renderDistance = this.renderDistance + var2 & 3; +- } +- +- if(var1 == EnumOptions.GUI_SCALE) { +- this.guiScale = this.guiScale + var2 & 3; +- } +- +- if(var1 == EnumOptions.PARTICLES) { +- this.particleSetting = (this.particleSetting + var2) % 3; +- } +- +- if(var1 == EnumOptions.VIEW_BOBBING) { ++ if (par1EnumOptions == EnumOptions.RENDER_DISTANCE) { ++ this.renderDistance = this.renderDistance + par2 & 3; ++ } ++ ++ if (par1EnumOptions == EnumOptions.GUI_SCALE) { ++ this.guiScale = this.guiScale + par2 & 3; ++ } ++ ++ if (par1EnumOptions == EnumOptions.PARTICLES) { ++ this.particleSetting = (this.particleSetting + par2) % 3; ++ } ++ ++ if (par1EnumOptions == EnumOptions.VIEW_BOBBING) { + this.viewBobbing = !this.viewBobbing; + } + +- if(var1 == EnumOptions.RENDER_CLOUDS) { ++ if (par1EnumOptions == EnumOptions.RENDER_CLOUDS) { + this.clouds = !this.clouds; + } + +- if(var1 == EnumOptions.ADVANCED_OPENGL) { ++ if (par1EnumOptions == EnumOptions.ADVANCED_OPENGL) { + this.advancedOpengl = !this.advancedOpengl; + this.mc.renderGlobal.loadRenderers(); + } + +- if(var1 == EnumOptions.ANAGLYPH) { ++ if (par1EnumOptions == EnumOptions.ANAGLYPH) { + this.anaglyph = !this.anaglyph; + this.mc.refreshResources(); + } + +- if(var1 == EnumOptions.FRAMERATE_LIMIT) { +- this.limitFramerate = (this.limitFramerate + var2 + 3) % 3; +- } +- +- if(var1 == EnumOptions.DIFFICULTY) { +- this.difficulty = this.difficulty + var2 & 3; +- } +- +- if(var1 == EnumOptions.GRAPHICS) { ++ if (par1EnumOptions == EnumOptions.FRAMERATE_LIMIT) { ++ this.limitFramerate = (this.limitFramerate + par2 + 3) % 3; ++ } ++ ++ if (par1EnumOptions == EnumOptions.DIFFICULTY) { ++ this.difficulty = this.difficulty + par2 & 3; ++ } ++ ++ if (par1EnumOptions == EnumOptions.GRAPHICS) { + this.fancyGraphics = !this.fancyGraphics; + this.mc.renderGlobal.loadRenderers(); + } + +- if(var1 == EnumOptions.AMBIENT_OCCLUSION) { +- this.ambientOcclusion = (this.ambientOcclusion + var2) % 3; ++ if (par1EnumOptions == EnumOptions.AMBIENT_OCCLUSION) { ++ this.ambientOcclusion = (this.ambientOcclusion + par2) % 3; + this.mc.renderGlobal.loadRenderers(); + } + +- if(var1 == EnumOptions.CHAT_VISIBILITY) { +- this.chatVisibility = (this.chatVisibility + var2) % 3; ++ if (par1EnumOptions == EnumOptions.CHAT_VISIBILITY) { ++ this.chatVisibility = (this.chatVisibility + par2) % 3; + } + +- if(var1 == EnumOptions.CHAT_COLOR) { ++ if (par1EnumOptions == EnumOptions.CHAT_COLOR) { + this.chatColours = !this.chatColours; + } + +- if(var1 == EnumOptions.CHAT_LINKS) { ++ if (par1EnumOptions == EnumOptions.CHAT_LINKS) { + this.chatLinks = !this.chatLinks; + } + +- if(var1 == EnumOptions.CHAT_LINKS_PROMPT) { ++ if (par1EnumOptions == EnumOptions.CHAT_LINKS_PROMPT) { + this.chatLinksPrompt = !this.chatLinksPrompt; + } + +- if(var1 == EnumOptions.USE_SERVER_TEXTURES) { ++ if (par1EnumOptions == EnumOptions.USE_SERVER_TEXTURES) { + this.serverTextures = !this.serverTextures; + } + +- if(var1 == EnumOptions.SNOOPER_ENABLED) { ++ if (par1EnumOptions == EnumOptions.SNOOPER_ENABLED) { + this.snooperEnabled = !this.snooperEnabled; + } + +- if(var1 == EnumOptions.SHOW_CAPE) { ++ if (par1EnumOptions == EnumOptions.SHOW_CAPE) { + this.showCape = !this.showCape; + } + +- if(var1 == EnumOptions.TOUCHSCREEN) { ++ if (par1EnumOptions == EnumOptions.TOUCHSCREEN) { + this.touchscreen = !this.touchscreen; + } + +- if(var1 == EnumOptions.USE_FULLSCREEN) { ++ if (par1EnumOptions == EnumOptions.USE_FULLSCREEN) { + this.fullScreen = !this.fullScreen; +- if(this.mc.isFullScreen() != this.fullScreen) { ++ ++ if (this.mc.isFullScreen() != this.fullScreen) { + this.mc.toggleFullscreen(); + } + } + +- if(var1 == EnumOptions.ENABLE_VSYNC) { ++ if (par1EnumOptions == EnumOptions.ENABLE_VSYNC) { + this.enableVsync = !this.enableVsync; + Display.setVSyncEnabled(this.enableVsync); + } +@@ -266,77 +354,99 @@ + this.saveOptions(); + } + +- public float getOptionFloatValue(EnumOptions var1) { +- return var1 == EnumOptions.FOV ? this.fovSetting : (var1 == EnumOptions.GAMMA ? this.gammaSetting : (var1 == EnumOptions.MUSIC ? this.musicVolume : (var1 == EnumOptions.SOUND ? this.soundVolume : (var1 == EnumOptions.SENSITIVITY ? this.mouseSensitivity : (var1 == EnumOptions.CHAT_OPACITY ? this.chatOpacity : (var1 == EnumOptions.CHAT_HEIGHT_FOCUSED ? this.chatHeightFocused : (var1 == EnumOptions.CHAT_HEIGHT_UNFOCUSED ? this.chatHeightUnfocused : (var1 == EnumOptions.CHAT_SCALE ? this.chatScale : (var1 == EnumOptions.CHAT_WIDTH ? this.chatWidth : 0.0F))))))))); +- } +- +- public boolean getOptionOrdinalValue(EnumOptions var1) { +- switch(EnumOptionsHelper.enumOptionsMappingHelperArray[var1.ordinal()]) { +- case 1: +- return this.invertMouse; +- case 2: +- return this.viewBobbing; +- case 3: +- return this.anaglyph; +- case 4: +- return this.advancedOpengl; +- case 5: +- return this.clouds; +- case 6: +- return this.chatColours; +- case 7: +- return this.chatLinks; +- case 8: +- return this.chatLinksPrompt; +- case 9: +- return this.serverTextures; +- case 10: +- return this.snooperEnabled; +- case 11: +- return this.fullScreen; +- case 12: +- return this.enableVsync; +- case 13: +- return this.showCape; +- case 14: +- return this.touchscreen; +- default: +- return false; +- } +- } +- +- private static String getTranslation(String[] var0, int var1) { +- if(var1 < 0 || var1 >= var0.length) { +- var1 = 0; +- } +- +- return I18n.getString(var0[var1]); +- } +- +- public String getKeyBinding(EnumOptions var1) { +- String var2 = I18n.getString(var1.getEnumString()) + ": "; +- if(var1.getEnumFloat()) { +- float var5 = this.getOptionFloatValue(var1); +- return var1 == EnumOptions.SENSITIVITY ? (var5 == 0.0F ? var2 + I18n.getString("options.sensitivity.min") : (var5 == 1.0F ? var2 + I18n.getString("options.sensitivity.max") : var2 + (int)(var5 * 200.0F) + "%")) : (var1 == EnumOptions.FOV ? (var5 == 0.0F ? var2 + I18n.getString("options.fov.min") : (var5 == 1.0F ? var2 + I18n.getString("options.fov.max") : var2 + (int)(70.0F + var5 * 40.0F))) : (var1 == EnumOptions.GAMMA ? (var5 == 0.0F ? var2 + I18n.getString("options.gamma.min") : (var5 == 1.0F ? var2 + I18n.getString("options.gamma.max") : var2 + "+" + (int)(var5 * 100.0F) + "%")) : (var1 == EnumOptions.CHAT_OPACITY ? var2 + (int)(var5 * 90.0F + 10.0F) + "%" : (var1 == EnumOptions.CHAT_HEIGHT_UNFOCUSED ? var2 + GuiNewChat.func_96130_b(var5) + "px" : (var1 == EnumOptions.CHAT_HEIGHT_FOCUSED ? var2 + GuiNewChat.func_96130_b(var5) + "px" : (var1 == EnumOptions.CHAT_WIDTH ? var2 + GuiNewChat.func_96128_a(var5) + "px" : (var5 == 0.0F ? var2 + I18n.getString("options.off") : var2 + (int)(var5 * 100.0F) + "%"))))))); +- } else if(var1.getEnumBoolean()) { +- boolean var4 = this.getOptionOrdinalValue(var1); ++ public float getOptionFloatValue(EnumOptions par1EnumOptions) { ++ return par1EnumOptions == EnumOptions.FOV ? this.fovSetting : (par1EnumOptions == EnumOptions.GAMMA ? this.gammaSetting : (par1EnumOptions == EnumOptions.MUSIC ? this.musicVolume : (par1EnumOptions == EnumOptions.SOUND ? this.soundVolume : (par1EnumOptions == EnumOptions.SENSITIVITY ? this.mouseSensitivity : (par1EnumOptions == EnumOptions.CHAT_OPACITY ? this.chatOpacity : (par1EnumOptions == EnumOptions.CHAT_HEIGHT_FOCUSED ? this.chatHeightFocused : (par1EnumOptions == EnumOptions.CHAT_HEIGHT_UNFOCUSED ? this.chatHeightUnfocused : (par1EnumOptions == EnumOptions.CHAT_SCALE ? this.chatScale : (par1EnumOptions == EnumOptions.CHAT_WIDTH ? this.chatWidth : 0.0F))))))))); ++ } ++ ++ public boolean getOptionOrdinalValue(EnumOptions par1EnumOptions) { ++ switch (EnumOptionsHelper.enumOptionsMappingHelperArray[par1EnumOptions.ordinal()]) { ++ case 1: ++ return this.invertMouse; ++ ++ case 2: ++ return this.viewBobbing; ++ ++ case 3: ++ return this.anaglyph; ++ ++ case 4: ++ return this.advancedOpengl; ++ ++ case 5: ++ return this.clouds; ++ ++ case 6: ++ return this.chatColours; ++ ++ case 7: ++ return this.chatLinks; ++ ++ case 8: ++ return this.chatLinksPrompt; ++ ++ case 9: ++ return this.serverTextures; ++ ++ case 10: ++ return this.snooperEnabled; ++ ++ case 11: ++ return this.fullScreen; ++ ++ case 12: ++ return this.enableVsync; ++ ++ case 13: ++ return this.showCape; ++ ++ case 14: ++ return this.touchscreen; ++ ++ default: ++ return false; ++ } ++ } ++ ++ /** ++ * Returns the translation of the given index in the given String array. If the index is smaller than 0 or greater ++ * than/equal to the length of the String array, it is changed to 0. ++ */ ++ private static String getTranslation(String[] par0ArrayOfStr, int par1) { ++ if (par1 < 0 || par1 >= par0ArrayOfStr.length) { ++ par1 = 0; ++ } ++ ++ return I18n.getString(par0ArrayOfStr[par1]); ++ } ++ ++ /** ++ * Gets a key binding. ++ */ ++ public String getKeyBinding(EnumOptions par1EnumOptions) { ++ String var2 = I18n.getString(par1EnumOptions.getEnumString()) + ": "; ++ ++ if (par1EnumOptions.getEnumFloat()) { ++ float var5 = this.getOptionFloatValue(par1EnumOptions); ++ return par1EnumOptions == EnumOptions.SENSITIVITY ? (var5 == 0.0F ? var2 + I18n.getString("options.sensitivity.min") : (var5 == 1.0F ? var2 + I18n.getString("options.sensitivity.max") : var2 + (int)(var5 * 200.0F) + "%")) : (par1EnumOptions == EnumOptions.FOV ? (var5 == 0.0F ? var2 + I18n.getString("options.fov.min") : (var5 == 1.0F ? var2 + I18n.getString("options.fov.max") : var2 + (int)(70.0F + var5 * 40.0F))) : (par1EnumOptions == EnumOptions.GAMMA ? (var5 == 0.0F ? var2 + I18n.getString("options.gamma.min") : (var5 == 1.0F ? var2 + I18n.getString("options.gamma.max") : var2 + "+" + (int)(var5 * 100.0F) + "%")) : (par1EnumOptions == EnumOptions.CHAT_OPACITY ? var2 + (int)(var5 * 90.0F + 10.0F) + "%" : (par1EnumOptions == EnumOptions.CHAT_HEIGHT_UNFOCUSED ? var2 + GuiNewChat.func_96130_b(var5) + "px" : (par1EnumOptions == EnumOptions.CHAT_HEIGHT_FOCUSED ? var2 + GuiNewChat.func_96130_b(var5) + "px" : (par1EnumOptions == EnumOptions.CHAT_WIDTH ? var2 + GuiNewChat.func_96128_a(var5) + "px" : (var5 == 0.0F ? var2 + I18n.getString("options.off") : var2 + (int)(var5 * 100.0F) + "%"))))))); ++ } else if (par1EnumOptions.getEnumBoolean()) { ++ boolean var4 = this.getOptionOrdinalValue(par1EnumOptions); + return var4 ? var2 + I18n.getString("options.on") : var2 + I18n.getString("options.off"); +- } else if(var1 == EnumOptions.RENDER_DISTANCE) { +- return var2 + getTranslation(ao, this.renderDistance); +- } else if(var1 == EnumOptions.DIFFICULTY) { +- return var2 + getTranslation(ap, this.difficulty); +- } else if(var1 == EnumOptions.GUI_SCALE) { +- return var2 + getTranslation(aq, this.guiScale); +- } else if(var1 == EnumOptions.CHAT_VISIBILITY) { +- return var2 + getTranslation(ar, this.chatVisibility); +- } else if(var1 == EnumOptions.PARTICLES) { +- return var2 + getTranslation(as, this.particleSetting); +- } else if(var1 == EnumOptions.FRAMERATE_LIMIT) { +- return var2 + getTranslation(at, this.limitFramerate); +- } else if(var1 == EnumOptions.AMBIENT_OCCLUSION) { +- return var2 + getTranslation(au, this.ambientOcclusion); +- } else if(var1 == EnumOptions.GRAPHICS) { +- if(this.fancyGraphics) { ++ } else if (par1EnumOptions == EnumOptions.RENDER_DISTANCE) { ++ return var2 + getTranslation(RENDER_DISTANCES, this.renderDistance); ++ } else if (par1EnumOptions == EnumOptions.DIFFICULTY) { ++ return var2 + getTranslation(DIFFICULTIES, this.difficulty); ++ } else if (par1EnumOptions == EnumOptions.GUI_SCALE) { ++ return var2 + getTranslation(GUISCALES, this.guiScale); ++ } else if (par1EnumOptions == EnumOptions.CHAT_VISIBILITY) { ++ return var2 + getTranslation(CHAT_VISIBILITIES, this.chatVisibility); ++ } else if (par1EnumOptions == EnumOptions.PARTICLES) { ++ return var2 + getTranslation(PARTICLES, this.particleSetting); ++ } else if (par1EnumOptions == EnumOptions.FRAMERATE_LIMIT) { ++ return var2 + getTranslation(LIMIT_FRAMERATES, this.limitFramerate); ++ } else if (par1EnumOptions == EnumOptions.AMBIENT_OCCLUSION) { ++ return var2 + getTranslation(AMBIENT_OCCLUSIONS, this.ambientOcclusion); ++ } else if (par1EnumOptions == EnumOptions.GRAPHICS) { ++ if (this.fancyGraphics) { + return var2 + I18n.getString("options.graphics.fancy"); + } else { + String var3 = "options.graphics.fast"; +@@ -347,218 +457,230 @@ + } + } + ++ /** ++ * Loads the options from the options file. It appears that this has replaced the previous 'loadOptions' ++ */ + public void loadOptions() { + try { +- if(!this.av.exists()) { ++ if (!this.optionsFile.exists()) { + return; + } + +- BufferedReader var1 = new BufferedReader(new FileReader(this.av)); ++ BufferedReader var1 = new BufferedReader(new FileReader(this.optionsFile)); + String var2 = ""; + +- while(true) { +- var2 = var1.readLine(); +- if(var2 == null) { +- KeyBinding.resetKeyBindingArrayAndHash(); +- var1.close(); +- break; +- } +- ++ while ((var2 = var1.readLine()) != null) { + try { + String[] var3 = var2.split(":"); +- if(var3[0].equals("music")) { ++ ++ if (var3[0].equals("music")) { + this.musicVolume = this.parseFloat(var3[1]); + } + +- if(var3[0].equals("sound")) { ++ if (var3[0].equals("sound")) { + this.soundVolume = this.parseFloat(var3[1]); + } + +- if(var3[0].equals("mouseSensitivity")) { ++ if (var3[0].equals("mouseSensitivity")) { + this.mouseSensitivity = this.parseFloat(var3[1]); + } + +- if(var3[0].equals("fov")) { ++ if (var3[0].equals("fov")) { + this.fovSetting = this.parseFloat(var3[1]); + } + +- if(var3[0].equals("gamma")) { ++ if (var3[0].equals("gamma")) { + this.gammaSetting = this.parseFloat(var3[1]); + } + +- if(var3[0].equals("invertYMouse")) { ++ if (var3[0].equals("invertYMouse")) { + this.invertMouse = var3[1].equals("true"); + } + +- if(var3[0].equals("viewDistance")) { ++ if (var3[0].equals("viewDistance")) { + this.renderDistance = Integer.parseInt(var3[1]); + } + +- if(var3[0].equals("guiScale")) { ++ if (var3[0].equals("guiScale")) { + this.guiScale = Integer.parseInt(var3[1]); + } + +- if(var3[0].equals("particles")) { ++ if (var3[0].equals("particles")) { + this.particleSetting = Integer.parseInt(var3[1]); + } + +- if(var3[0].equals("bobView")) { ++ if (var3[0].equals("bobView")) { + this.viewBobbing = var3[1].equals("true"); + } + +- if(var3[0].equals("anaglyph3d")) { ++ if (var3[0].equals("anaglyph3d")) { + this.anaglyph = var3[1].equals("true"); + } + +- if(var3[0].equals("advancedOpengl")) { ++ if (var3[0].equals("advancedOpengl")) { + this.advancedOpengl = var3[1].equals("true"); + } + +- if(var3[0].equals("fpsLimit")) { ++ if (var3[0].equals("fpsLimit")) { + this.limitFramerate = Integer.parseInt(var3[1]); + } + +- if(var3[0].equals("difficulty")) { ++ if (var3[0].equals("difficulty")) { + this.difficulty = Integer.parseInt(var3[1]); + } + +- if(var3[0].equals("fancyGraphics")) { ++ if (var3[0].equals("fancyGraphics")) { + this.fancyGraphics = var3[1].equals("true"); + } + +- if(var3[0].equals("ao")) { +- if(var3[1].equals("true")) { ++ if (var3[0].equals("ao")) { ++ if (var3[1].equals("true")) { + this.ambientOcclusion = 2; +- } else if(var3[1].equals("false")) { ++ } else if (var3[1].equals("false")) { + this.ambientOcclusion = 0; + } else { + this.ambientOcclusion = Integer.parseInt(var3[1]); + } + } + +- if(var3[0].equals("clouds")) { ++ if (var3[0].equals("clouds")) { + this.clouds = var3[1].equals("true"); + } + +- if(var3[0].equals("skin")) { +- this.m = var3[1]; +- } +- +- if(var3[0].equals("lastServer") && var3.length >= 2) { +- this.ad = var2.substring(var2.indexOf(58) + 1); +- } +- +- if(var3[0].equals("lang") && var3.length >= 2) { +- this.an = var3[1]; +- } +- +- if(var3[0].equals("chatVisibility")) { ++ if (var3[0].equals("skin")) { ++ this.skin = var3[1]; ++ } ++ ++ if (var3[0].equals("lastServer") && var3.length >= 2) { ++ this.lastServer = var2.substring(var2.indexOf(58) + 1); ++ } ++ ++ if (var3[0].equals("lang") && var3.length >= 2) { ++ this.language = var3[1]; ++ } ++ ++ if (var3[0].equals("chatVisibility")) { + this.chatVisibility = Integer.parseInt(var3[1]); + } + +- if(var3[0].equals("chatColors")) { ++ if (var3[0].equals("chatColors")) { + this.chatColours = var3[1].equals("true"); + } + +- if(var3[0].equals("chatLinks")) { ++ if (var3[0].equals("chatLinks")) { + this.chatLinks = var3[1].equals("true"); + } + +- if(var3[0].equals("chatLinksPrompt")) { ++ if (var3[0].equals("chatLinksPrompt")) { + this.chatLinksPrompt = var3[1].equals("true"); + } + +- if(var3[0].equals("chatOpacity")) { ++ if (var3[0].equals("chatOpacity")) { + this.chatOpacity = this.parseFloat(var3[1]); + } + +- if(var3[0].equals("serverTextures")) { ++ if (var3[0].equals("serverTextures")) { + this.serverTextures = var3[1].equals("true"); + } + +- if(var3[0].equals("snooperEnabled")) { ++ if (var3[0].equals("snooperEnabled")) { + this.snooperEnabled = var3[1].equals("true"); + } + +- if(var3[0].equals("fullscreen")) { ++ if (var3[0].equals("fullscreen")) { + this.fullScreen = var3[1].equals("true"); + } + +- if(var3[0].equals("enableVsync")) { ++ if (var3[0].equals("enableVsync")) { + this.enableVsync = var3[1].equals("true"); + } + +- if(var3[0].equals("hideServerAddress")) { ++ if (var3[0].equals("hideServerAddress")) { + this.hideServerAddress = var3[1].equals("true"); + } + +- if(var3[0].equals("advancedItemTooltips")) { ++ if (var3[0].equals("advancedItemTooltips")) { + this.advancedItemTooltips = var3[1].equals("true"); + } + +- if(var3[0].equals("pauseOnLostFocus")) { ++ if (var3[0].equals("pauseOnLostFocus")) { + this.pauseOnLostFocus = var3[1].equals("true"); + } + +- if(var3[0].equals("showCape")) { ++ if (var3[0].equals("showCape")) { + this.showCape = var3[1].equals("true"); + } + +- if(var3[0].equals("touchscreen")) { ++ if (var3[0].equals("touchscreen")) { + this.touchscreen = var3[1].equals("true"); + } + +- if(var3[0].equals("overrideHeight")) { ++ if (var3[0].equals("overrideHeight")) { + this.overrideHeight = Integer.parseInt(var3[1]); + } + +- if(var3[0].equals("overrideWidth")) { ++ if (var3[0].equals("overrideWidth")) { + this.overrideWidth = Integer.parseInt(var3[1]); + } + +- if(var3[0].equals("heldItemTooltips")) { ++ if (var3[0].equals("heldItemTooltips")) { + this.heldItemTooltips = var3[1].equals("true"); + } + +- if(var3[0].equals("chatHeightFocused")) { ++ if (var3[0].equals("chatHeightFocused")) { + this.chatHeightFocused = this.parseFloat(var3[1]); + } + +- if(var3[0].equals("chatHeightUnfocused")) { ++ if (var3[0].equals("chatHeightUnfocused")) { + this.chatHeightUnfocused = this.parseFloat(var3[1]); + } + +- if(var3[0].equals("chatScale")) { ++ if (var3[0].equals("chatScale")) { + this.chatScale = this.parseFloat(var3[1]); + } + +- if(var3[0].equals("chatWidth")) { ++ if (var3[0].equals("chatWidth")) { + this.chatWidth = this.parseFloat(var3[1]); + } + +- for(int var4 = 0; var4 < this.keyBindings.length; ++var4) { +- if(var3[0].equals("key_" + this.keyBindings[var4].c)) { ++ for (int var4 = 0; var4 < this.keyBindings.length; ++var4) { ++ if (var3[0].equals("key_" + this.keyBindings[var4].keyDescription)) { + this.keyBindings[var4].keyCode = Integer.parseInt(var3[1]); + } + } ++ // Spout Start ++ for (int key = 0; key < this.spoutcraftBindings.length; ++key) { ++ if (var3[0].equals("key_" + this.spoutcraftBindings[key].keyDescription)) { ++ this.spoutcraftBindings[key].keyCode = Integer.parseInt(var3[1]); ++ } ++ } ++ // Spout End + } catch (Exception var5) { + this.mc.getLogAgent().logWarning("Skipping bad option: " + var2); + } + } ++ ++ KeyBinding.resetKeyBindingArrayAndHash(); ++ var1.close(); + } catch (Exception var6) { + this.mc.getLogAgent().logWarning("Failed to load options"); + var6.printStackTrace(); + } +- +- } +- +- private float parseFloat(String var1) { +- return var1.equals("true") ? 1.0F : (var1.equals("false") ? 0.0F : Float.parseFloat(var1)); +- } +- ++ } ++ ++ /** ++ * Parses a string into a float. ++ */ ++ private float parseFloat(String par1Str) { ++ return par1Str.equals("true") ? 1.0F : (par1Str.equals("false") ? 0.0F : Float.parseFloat(par1Str)); ++ } ++ ++ /** ++ * Saves the options to the options file. ++ */ + public void saveOptions() { + try { +- PrintWriter var1 = new PrintWriter(new FileWriter(this.av)); ++ PrintWriter var1 = new PrintWriter(new FileWriter(this.optionsFile)); + var1.println("music:" + this.musicVolume); + var1.println("sound:" + this.soundVolume); + var1.println("invertYMouse:" + this.invertMouse); +@@ -576,9 +698,9 @@ + var1.println("fancyGraphics:" + this.fancyGraphics); + var1.println("ao:" + this.ambientOcclusion); + var1.println("clouds:" + this.clouds); +- var1.println("skin:" + this.m); +- var1.println("lastServer:" + this.ad); +- var1.println("lang:" + this.an); ++ var1.println("skin:" + this.skin); ++ var1.println("lastServer:" + this.lastServer); ++ var1.println("lang:" + this.language); + var1.println("chatVisibility:" + this.chatVisibility); + var1.println("chatColors:" + this.chatColours); + var1.println("chatLinks:" + this.chatLinks); +@@ -599,28 +721,37 @@ + var1.println("chatHeightFocused:" + this.chatHeightFocused); + var1.println("chatHeightUnfocused:" + this.chatHeightUnfocused); + var1.println("chatScale:" + this.chatScale); +- var1.println("chatWidth:" + this.chatWidth); ++ var1.println("chatWidth:" + this.chatWidth); + +- for(int var2 = 0; var2 < this.keyBindings.length; ++var2) { +- var1.println("key_" + this.keyBindings[var2].c + ":" + this.keyBindings[var2].keyCode); +- } ++ for (int var2 = 0; var2 < this.keyBindings.length; ++var2) { ++ var1.println("key_" + this.keyBindings[var2].keyDescription + ":" + this.keyBindings[var2].keyCode); ++ } ++ // Spout Start ++ for (int key = 0; key < this.spoutcraftBindings.length; ++key) { ++ var1.println("key_" + this.spoutcraftBindings[key].keyDescription + ":" + this.spoutcraftBindings[key].keyCode); ++ } ++ // Spout End + + var1.close(); + } catch (Exception var3) { + this.mc.getLogAgent().logWarning("Failed to save options"); + var3.printStackTrace(); + } +- + this.sendSettingsToServer(); + } + ++ /** ++ * Send a client info packet with settings information to the server ++ */ + public void sendSettingsToServer() { +- if(this.mc.thePlayer != null) { +- this.mc.thePlayer.sendQueue.addToSendQueue(new Packet204ClientInfo(this.an, this.renderDistance, this.chatVisibility, this.chatColours, this.difficulty, this.showCape)); ++ if (this.mc.thePlayer != null) { ++ this.mc.thePlayer.sendQueue.addToSendQueue(new Packet204ClientInfo(this.language, this.renderDistance, this.chatVisibility, this.chatColours, this.difficulty, this.showCape)); + } +- + } + ++ /** ++ * Should render clouds ++ */ + public boolean shouldRenderClouds() { + return this.renderDistance < 2 && this.clouds; + } diff --git a/patches/net/minecraft/src/GameWindowListener.java.patch b/patches/net/minecraft/src/GameWindowListener.java.patch new file mode 100644 index 0000000..f468c07 --- /dev/null +++ b/patches/net/minecraft/src/GameWindowListener.java.patch @@ -0,0 +1,23 @@ +--- /dev/null ++++ net/minecraft/src/GameWindowListener.java +@@ -1,0 +1,20 @@ ++package net.minecraft.src; ++ ++import java.awt.event.WindowAdapter; ++import java.awt.event.WindowEvent; ++ ++import org.spoutcraft.client.SpoutClient; ++ ++public final class GameWindowListener extends WindowAdapter { ++ public void windowClosing(WindowEvent par1WindowEvent) { ++ // Spout Start ++ SpoutClient.getHandle().shutdown(); ++ ++ try { ++ SpoutClient.getHandle().mainThread.join(10000L); ++ } catch (InterruptedException var4) { ++ } ++ System.exit(0); ++ // Spout End ++ } ++} diff --git a/patches/net/minecraft/src/GenLayer.java.patch b/patches/net/minecraft/src/GenLayer.java.patch new file mode 100644 index 0000000..647f91e --- /dev/null +++ b/patches/net/minecraft/src/GenLayer.java.patch @@ -0,0 +1,171 @@ +--- net/minecraft/src/GenLayer.java ++++ net/minecraft/src/GenLayer.java +@@ -1,12 +1,27 @@ + package net.minecraft.src; + + public abstract class GenLayer { ++ ++ /** seed from World#getWorldSeed that is used in the LCG prng */ + private long worldGenSeed; ++ ++ /** parent GenLayer that was provided via the constructor */ + protected GenLayer parent; ++ ++ /** ++ * final part of the LCG prng that uses the chunk X, Z coords along with the other two seeds to generate pseudorandom ++ * numbers ++ */ + private long chunkSeed; ++ ++ /** base seed to the LCG prng provided via the constructor */ + private long baseSeed; + +- public static GenLayer[] initializeAllBiomeGenerators(long var0, WorldType var2) { ++ /** ++ * the first array item is a linked list of the bioms, the second is the zoom function, the third is the same as the ++ * first. ++ */ ++ public static GenLayer[] initializeAllBiomeGenerators(long par0, WorldType par2WorldType) { + GenLayerIsland var3 = new GenLayerIsland(1L); + GenLayerFuzzyZoom var9 = new GenLayerFuzzyZoom(2000L, var3); + GenLayerAddIsland var10 = new GenLayerAddIsland(1L, var9); +@@ -19,7 +34,8 @@ + var10 = new GenLayerAddIsland(4L, var11); + GenLayerAddMushroomIsland var15 = new GenLayerAddMushroomIsland(5L, var10); + byte var4 = 4; +- if(var2 == WorldType.LARGE_BIOMES) { ++ ++ if (par2WorldType == WorldType.LARGE_BIOMES) { + var4 = 6; + } + +@@ -29,21 +45,22 @@ + GenLayerRiver var14 = new GenLayerRiver(1L, var5); + GenLayerSmooth var16 = new GenLayerSmooth(1000L, var14); + GenLayer var6 = GenLayerZoom.magnify(1000L, var15, 0); +- GenLayerBiome var17 = new GenLayerBiome(200L, var6, var2); ++ GenLayerBiome var17 = new GenLayerBiome(200L, var6, par2WorldType); + var6 = GenLayerZoom.magnify(1000L, var17, 2); + Object var18 = new GenLayerHills(1000L, var6); + +- for(int var7 = 0; var7 < var4; ++var7) { ++ for (int var7 = 0; var7 < var4; ++var7) { + var18 = new GenLayerZoom((long)(1000 + var7), (GenLayer)var18); +- if(var7 == 0) { ++ ++ if (var7 == 0) { + var18 = new GenLayerAddIsland(3L, (GenLayer)var18); + } + +- if(var7 == 1) { ++ if (var7 == 1) { + var18 = new GenLayerShore(1000L, (GenLayer)var18); + } + +- if(var7 == 1) { ++ if (var7 == 1) { + var18 = new GenLayerSwampRivers(1000L, (GenLayer)var18); + } + } +@@ -51,25 +68,30 @@ + GenLayerSmooth var19 = new GenLayerSmooth(1000L, (GenLayer)var18); + GenLayerRiverMix var20 = new GenLayerRiverMix(100L, var19, var16); + GenLayerVoronoiZoom var8 = new GenLayerVoronoiZoom(10L, var20); +- var20.initWorldGenSeed(var0); +- var8.initWorldGenSeed(var0); +- return new GenLayer[]{var20, var8, var20}; +- } +- +- public GenLayer(long var1) { +- this.baseSeed = var1; +- this.baseSeed *= this.baseSeed * 6364136223846793005L + 1442695040888963407L; +- this.baseSeed += var1; +- this.baseSeed *= this.baseSeed * 6364136223846793005L + 1442695040888963407L; +- this.baseSeed += var1; +- this.baseSeed *= this.baseSeed * 6364136223846793005L + 1442695040888963407L; +- this.baseSeed += var1; +- } +- +- public void initWorldGenSeed(long var1) { +- this.worldGenSeed = var1; +- if(this.parent != null) { +- this.parent.initWorldGenSeed(var1); ++ var20.initWorldGenSeed(par0); ++ var8.initWorldGenSeed(par0); ++ return new GenLayer[] {var20, var8, var20}; ++ } ++ ++ public GenLayer(long par1) { ++ this.baseSeed = par1; ++ this.baseSeed *= this.baseSeed * 6364136223846793005L + 1442695040888963407L; ++ this.baseSeed += par1; ++ this.baseSeed *= this.baseSeed * 6364136223846793005L + 1442695040888963407L; ++ this.baseSeed += par1; ++ this.baseSeed *= this.baseSeed * 6364136223846793005L + 1442695040888963407L; ++ this.baseSeed += par1; ++ } ++ ++ /** ++ * Initialize layer's local worldGenSeed based on its own baseSeed and the world's global seed (passed in as an ++ * argument). ++ */ ++ public void initWorldGenSeed(long par1) { ++ this.worldGenSeed = par1; ++ ++ if (this.parent != null) { ++ this.parent.initWorldGenSeed(par1); + } + + this.worldGenSeed *= this.worldGenSeed * 6364136223846793005L + 1442695040888963407L; +@@ -80,22 +102,29 @@ + this.worldGenSeed += this.baseSeed; + } + +- public void initChunkSeed(long var1, long var3) { ++ /** ++ * Initialize layer's current chunkSeed based on the local worldGenSeed and the (x,z) chunk coordinates. ++ */ ++ public void initChunkSeed(long par1, long par3) { + this.chunkSeed = this.worldGenSeed; + this.chunkSeed *= this.chunkSeed * 6364136223846793005L + 1442695040888963407L; +- this.chunkSeed += var1; +- this.chunkSeed *= this.chunkSeed * 6364136223846793005L + 1442695040888963407L; +- this.chunkSeed += var3; +- this.chunkSeed *= this.chunkSeed * 6364136223846793005L + 1442695040888963407L; +- this.chunkSeed += var1; +- this.chunkSeed *= this.chunkSeed * 6364136223846793005L + 1442695040888963407L; +- this.chunkSeed += var3; ++ this.chunkSeed += par1; ++ this.chunkSeed *= this.chunkSeed * 6364136223846793005L + 1442695040888963407L; ++ this.chunkSeed += par3; ++ this.chunkSeed *= this.chunkSeed * 6364136223846793005L + 1442695040888963407L; ++ this.chunkSeed += par1; ++ this.chunkSeed *= this.chunkSeed * 6364136223846793005L + 1442695040888963407L; ++ this.chunkSeed += par3; + } + +- protected int nextInt(int var1) { +- int var2 = (int)((this.chunkSeed >> 24) % (long)var1); +- if(var2 < 0) { +- var2 += var1; ++ /** ++ * returns a LCG pseudo random number from [0, x). Args: int x ++ */ ++ protected int nextInt(int par1) { ++ int var2 = (int)((this.chunkSeed >> 24) % (long)par1); ++ ++ if (var2 < 0) { ++ var2 += par1; + } + + this.chunkSeed *= this.chunkSeed * 6364136223846793005L + 1442695040888963407L; +@@ -103,5 +132,9 @@ + return var2; + } + ++ /** ++ * Returns a list of integer values generated by this layer. These may be interpreted as temperatures, rainfall ++ * amounts, or biomeList[] indices based on the particular GenLayer subclass. ++ */ + public abstract int[] getInts(int var1, int var2, int var3, int var4); + } diff --git a/patches/net/minecraft/src/GenLayerAddIsland.java.patch b/patches/net/minecraft/src/GenLayerAddIsland.java.patch new file mode 100644 index 0000000..1346e7a --- /dev/null +++ b/patches/net/minecraft/src/GenLayerAddIsland.java.patch @@ -0,0 +1,112 @@ +--- net/minecraft/src/GenLayerAddIsland.java ++++ net/minecraft/src/GenLayerAddIsland.java +@@ -1,67 +1,71 @@ + package net.minecraft.src; + + public class GenLayerAddIsland extends GenLayer { +- public GenLayerAddIsland(long var1, GenLayer var3) { +- super(var1); +- this.parent = var3; ++ public GenLayerAddIsland(long par1, GenLayer par3GenLayer) { ++ super(par1); ++ this.parent = par3GenLayer; + } + +- public int[] getInts(int var1, int var2, int var3, int var4) { +- int var5 = var1 - 1; +- int var6 = var2 - 1; +- int var7 = var3 + 2; +- int var8 = var4 + 2; ++ /** ++ * Returns a list of integer values generated by this layer. These may be interpreted as temperatures, rainfall ++ * amounts, or biomeList[] indices based on the particular GenLayer subclass. ++ */ ++ public int[] getInts(int par1, int par2, int par3, int par4) { ++ int var5 = par1 - 1; ++ int var6 = par2 - 1; ++ int var7 = par3 + 2; ++ int var8 = par4 + 2; + int[] var9 = this.parent.getInts(var5, var6, var7, var8); +- int[] var10 = IntCache.getIntCache(var3 * var4); ++ int[] var10 = IntCache.getIntCache(par3 * par4); + +- for(int var11 = 0; var11 < var4; ++var11) { +- for(int var12 = 0; var12 < var3; ++var12) { ++ for (int var11 = 0; var11 < par4; ++var11) { ++ for (int var12 = 0; var12 < par3; ++var12) { + int var13 = var9[var12 + 0 + (var11 + 0) * var7]; + int var14 = var9[var12 + 2 + (var11 + 0) * var7]; + int var15 = var9[var12 + 0 + (var11 + 2) * var7]; + int var16 = var9[var12 + 2 + (var11 + 2) * var7]; + int var17 = var9[var12 + 1 + (var11 + 1) * var7]; +- this.initChunkSeed((long)(var12 + var1), (long)(var11 + var2)); +- if(var17 != 0 || var13 == 0 && var14 == 0 && var15 == 0 && var16 == 0) { +- if(var17 > 0 && (var13 == 0 || var14 == 0 || var15 == 0 || var16 == 0)) { +- if(this.nextInt(5) == 0) { +- if(var17 == BiomeGenBase.icePlains.biomeID) { +- var10[var12 + var11 * var3] = BiomeGenBase.frozenOcean.biomeID; +- } else { +- var10[var12 + var11 * var3] = 0; +- } +- } else { +- var10[var12 + var11 * var3] = var17; +- } +- } else { +- var10[var12 + var11 * var3] = var17; +- } +- } else { ++ this.initChunkSeed((long)(var12 + par1), (long)(var11 + par2)); ++ ++ if (var17 == 0 && (var13 != 0 || var14 != 0 || var15 != 0 || var16 != 0)) { + int var18 = 1; + int var19 = 1; +- if(var13 != 0 && this.nextInt(var18++) == 0) { ++ ++ if (var13 != 0 && this.nextInt(var18++) == 0) { + var19 = var13; + } + +- if(var14 != 0 && this.nextInt(var18++) == 0) { ++ if (var14 != 0 && this.nextInt(var18++) == 0) { + var19 = var14; + } + +- if(var15 != 0 && this.nextInt(var18++) == 0) { ++ if (var15 != 0 && this.nextInt(var18++) == 0) { + var19 = var15; + } + +- if(var16 != 0 && this.nextInt(var18++) == 0) { ++ if (var16 != 0 && this.nextInt(var18++) == 0) { + var19 = var16; + } + +- if(this.nextInt(3) == 0) { +- var10[var12 + var11 * var3] = var19; +- } else if(var19 == BiomeGenBase.icePlains.biomeID) { +- var10[var12 + var11 * var3] = BiomeGenBase.frozenOcean.biomeID; +- } else { +- var10[var12 + var11 * var3] = 0; +- } ++ if (this.nextInt(3) == 0) { ++ var10[var12 + var11 * par3] = var19; ++ } else if (var19 == BiomeGenBase.icePlains.biomeID) { ++ var10[var12 + var11 * par3] = BiomeGenBase.frozenOcean.biomeID; ++ } else { ++ var10[var12 + var11 * par3] = 0; ++ } ++ } else if (var17 > 0 && (var13 == 0 || var14 == 0 || var15 == 0 || var16 == 0)) { ++ if (this.nextInt(5) == 0) { ++ if (var17 == BiomeGenBase.icePlains.biomeID) { ++ var10[var12 + var11 * par3] = BiomeGenBase.frozenOcean.biomeID; ++ } else { ++ var10[var12 + var11 * par3] = 0; ++ } ++ } else { ++ var10[var12 + var11 * par3] = var17; ++ } ++ } else { ++ var10[var12 + var11 * par3] = var17; + } + } + } diff --git a/patches/net/minecraft/src/GenLayerAddMushroomIsland.java.patch b/patches/net/minecraft/src/GenLayerAddMushroomIsland.java.patch new file mode 100644 index 0000000..b8718d0 --- /dev/null +++ b/patches/net/minecraft/src/GenLayerAddMushroomIsland.java.patch @@ -0,0 +1,54 @@ +--- net/minecraft/src/GenLayerAddMushroomIsland.java ++++ net/minecraft/src/GenLayerAddMushroomIsland.java +@@ -1,31 +1,36 @@ + package net.minecraft.src; + + public class GenLayerAddMushroomIsland extends GenLayer { +- public GenLayerAddMushroomIsland(long var1, GenLayer var3) { +- super(var1); +- this.parent = var3; ++ public GenLayerAddMushroomIsland(long par1, GenLayer par3GenLayer) { ++ super(par1); ++ this.parent = par3GenLayer; + } + +- public int[] getInts(int var1, int var2, int var3, int var4) { +- int var5 = var1 - 1; +- int var6 = var2 - 1; +- int var7 = var3 + 2; +- int var8 = var4 + 2; ++ /** ++ * Returns a list of integer values generated by this layer. These may be interpreted as temperatures, rainfall ++ * amounts, or biomeList[] indices based on the particular GenLayer subclass. ++ */ ++ public int[] getInts(int par1, int par2, int par3, int par4) { ++ int var5 = par1 - 1; ++ int var6 = par2 - 1; ++ int var7 = par3 + 2; ++ int var8 = par4 + 2; + int[] var9 = this.parent.getInts(var5, var6, var7, var8); +- int[] var10 = IntCache.getIntCache(var3 * var4); ++ int[] var10 = IntCache.getIntCache(par3 * par4); + +- for(int var11 = 0; var11 < var4; ++var11) { +- for(int var12 = 0; var12 < var3; ++var12) { ++ for (int var11 = 0; var11 < par4; ++var11) { ++ for (int var12 = 0; var12 < par3; ++var12) { + int var13 = var9[var12 + 0 + (var11 + 0) * var7]; + int var14 = var9[var12 + 2 + (var11 + 0) * var7]; + int var15 = var9[var12 + 0 + (var11 + 2) * var7]; + int var16 = var9[var12 + 2 + (var11 + 2) * var7]; + int var17 = var9[var12 + 1 + (var11 + 1) * var7]; +- this.initChunkSeed((long)(var12 + var1), (long)(var11 + var2)); +- if(var17 == 0 && var13 == 0 && var14 == 0 && var15 == 0 && var16 == 0 && this.nextInt(100) == 0) { +- var10[var12 + var11 * var3] = BiomeGenBase.mushroomIsland.biomeID; ++ this.initChunkSeed((long)(var12 + par1), (long)(var11 + par2)); ++ ++ if (var17 == 0 && var13 == 0 && var14 == 0 && var15 == 0 && var16 == 0 && this.nextInt(100) == 0) { ++ var10[var12 + var11 * par3] = BiomeGenBase.mushroomIsland.biomeID; + } else { +- var10[var12 + var11 * var3] = var17; ++ var10[var12 + var11 * par3] = var17; + } + } + } diff --git a/patches/net/minecraft/src/GenLayerAddSnow.java.patch b/patches/net/minecraft/src/GenLayerAddSnow.java.patch new file mode 100644 index 0000000..bebf5ac --- /dev/null +++ b/patches/net/minecraft/src/GenLayerAddSnow.java.patch @@ -0,0 +1,59 @@ +--- net/minecraft/src/GenLayerAddSnow.java ++++ net/minecraft/src/GenLayerAddSnow.java +@@ -1,34 +1,40 @@ + package net.minecraft.src; + + public class GenLayerAddSnow extends GenLayer { +- public GenLayerAddSnow(long var1, GenLayer var3) { +- super(var1); +- this.parent = var3; ++ public GenLayerAddSnow(long par1, GenLayer par3GenLayer) { ++ super(par1); ++ this.parent = par3GenLayer; + } + +- public int[] getInts(int var1, int var2, int var3, int var4) { +- int var5 = var1 - 1; +- int var6 = var2 - 1; +- int var7 = var3 + 2; +- int var8 = var4 + 2; ++ /** ++ * Returns a list of integer values generated by this layer. These may be interpreted as temperatures, rainfall ++ * amounts, or biomeList[] indices based on the particular GenLayer subclass. ++ */ ++ public int[] getInts(int par1, int par2, int par3, int par4) { ++ int var5 = par1 - 1; ++ int var6 = par2 - 1; ++ int var7 = par3 + 2; ++ int var8 = par4 + 2; + int[] var9 = this.parent.getInts(var5, var6, var7, var8); +- int[] var10 = IntCache.getIntCache(var3 * var4); ++ int[] var10 = IntCache.getIntCache(par3 * par4); + +- for(int var11 = 0; var11 < var4; ++var11) { +- for(int var12 = 0; var12 < var3; ++var12) { ++ for (int var11 = 0; var11 < par4; ++var11) { ++ for (int var12 = 0; var12 < par3; ++var12) { + int var13 = var9[var12 + 1 + (var11 + 1) * var7]; +- this.initChunkSeed((long)(var12 + var1), (long)(var11 + var2)); +- if(var13 == 0) { +- var10[var12 + var11 * var3] = 0; ++ this.initChunkSeed((long)(var12 + par1), (long)(var11 + par2)); ++ ++ if (var13 == 0) { ++ var10[var12 + var11 * par3] = 0; + } else { + int var14 = this.nextInt(5); +- if(var14 == 0) { ++ ++ if (var14 == 0) { + var14 = BiomeGenBase.icePlains.biomeID; + } else { + var14 = 1; + } + +- var10[var12 + var11 * var3] = var14; ++ var10[var12 + var11 * par3] = var14; + } + } + } diff --git a/patches/net/minecraft/src/GenLayerBiome.java.patch b/patches/net/minecraft/src/GenLayerBiome.java.patch new file mode 100644 index 0000000..8f70f54 --- /dev/null +++ b/patches/net/minecraft/src/GenLayerBiome.java.patch @@ -0,0 +1,74 @@ +--- net/minecraft/src/GenLayerBiome.java ++++ net/minecraft/src/GenLayerBiome.java +@@ -1,37 +1,46 @@ + package net.minecraft.src; + + public class GenLayerBiome extends GenLayer { +- private BiomeGenBase[] allowedBiomes = new BiomeGenBase[]{BiomeGenBase.desert, BiomeGenBase.forest, BiomeGenBase.extremeHills, BiomeGenBase.swampland, BiomeGenBase.plains, BiomeGenBase.taiga, BiomeGenBase.jungle}; +- +- public GenLayerBiome(long var1, GenLayer var3, WorldType var4) { +- super(var1); +- this.parent = var3; +- if(var4 == WorldType.DEFAULT_1_1) { +- this.allowedBiomes = new BiomeGenBase[]{BiomeGenBase.desert, BiomeGenBase.forest, BiomeGenBase.extremeHills, BiomeGenBase.swampland, BiomeGenBase.plains, BiomeGenBase.taiga}; ++ ++ /** this sets all the biomes that are allowed to appear in the overworld */ ++ private BiomeGenBase[] allowedBiomes; ++ ++ public GenLayerBiome(long par1, GenLayer par3GenLayer, WorldType par4WorldType) { ++ super(par1); ++ this.allowedBiomes = new BiomeGenBase[] {BiomeGenBase.desert, BiomeGenBase.forest, BiomeGenBase.extremeHills, BiomeGenBase.swampland, BiomeGenBase.plains, BiomeGenBase.taiga, BiomeGenBase.jungle}; ++ this.parent = par3GenLayer; ++ ++ if (par4WorldType == WorldType.DEFAULT_1_1) { ++ this.allowedBiomes = new BiomeGenBase[] {BiomeGenBase.desert, BiomeGenBase.forest, BiomeGenBase.extremeHills, BiomeGenBase.swampland, BiomeGenBase.plains, BiomeGenBase.taiga}; + } +- + } + +- public int[] getInts(int var1, int var2, int var3, int var4) { +- int[] var5 = this.parent.getInts(var1, var2, var3, var4); +- int[] var6 = IntCache.getIntCache(var3 * var4); +- +- for(int var7 = 0; var7 < var4; ++var7) { +- for(int var8 = 0; var8 < var3; ++var8) { +- this.initChunkSeed((long)(var8 + var1), (long)(var7 + var2)); +- int var9 = var5[var8 + var7 * var3]; +- if(var9 == 0) { +- var6[var8 + var7 * var3] = 0; +- } else if(var9 == BiomeGenBase.mushroomIsland.biomeID) { +- var6[var8 + var7 * var3] = var9; +- } else if(var9 == 1) { +- var6[var8 + var7 * var3] = this.allowedBiomes[this.nextInt(this.allowedBiomes.length)].biomeID; ++ /** ++ * Returns a list of integer values generated by this layer. These may be interpreted as temperatures, rainfall ++ * amounts, or biomeList[] indices based on the particular GenLayer subclass. ++ */ ++ public int[] getInts(int par1, int par2, int par3, int par4) { ++ int[] var5 = this.parent.getInts(par1, par2, par3, par4); ++ int[] var6 = IntCache.getIntCache(par3 * par4); ++ ++ for (int var7 = 0; var7 < par4; ++var7) { ++ for (int var8 = 0; var8 < par3; ++var8) { ++ this.initChunkSeed((long)(var8 + par1), (long)(var7 + par2)); ++ int var9 = var5[var8 + var7 * par3]; ++ ++ if (var9 == 0) { ++ var6[var8 + var7 * par3] = 0; ++ } else if (var9 == BiomeGenBase.mushroomIsland.biomeID) { ++ var6[var8 + var7 * par3] = var9; ++ } else if (var9 == 1) { ++ var6[var8 + var7 * par3] = this.allowedBiomes[this.nextInt(this.allowedBiomes.length)].biomeID; + } else { + int var10 = this.allowedBiomes[this.nextInt(this.allowedBiomes.length)].biomeID; +- if(var10 == BiomeGenBase.taiga.biomeID) { +- var6[var8 + var7 * var3] = var10; ++ ++ if (var10 == BiomeGenBase.taiga.biomeID) { ++ var6[var8 + var7 * par3] = var10; + } else { +- var6[var8 + var7 * var3] = BiomeGenBase.icePlains.biomeID; ++ var6[var8 + var7 * par3] = BiomeGenBase.icePlains.biomeID; + } + } + } diff --git a/patches/net/minecraft/src/GenLayerFuzzyZoom.java.patch b/patches/net/minecraft/src/GenLayerFuzzyZoom.java.patch new file mode 100644 index 0000000..6d42842 --- /dev/null +++ b/patches/net/minecraft/src/GenLayerFuzzyZoom.java.patch @@ -0,0 +1,81 @@ +--- net/minecraft/src/GenLayerFuzzyZoom.java ++++ net/minecraft/src/GenLayerFuzzyZoom.java +@@ -1,28 +1,32 @@ + package net.minecraft.src; + + public class GenLayerFuzzyZoom extends GenLayer { +- public GenLayerFuzzyZoom(long var1, GenLayer var3) { +- super(var1); +- super.parent = var3; ++ public GenLayerFuzzyZoom(long par1, GenLayer par3GenLayer) { ++ super(par1); ++ super.parent = par3GenLayer; + } + +- public int[] getInts(int var1, int var2, int var3, int var4) { +- int var5 = var1 >> 1; +- int var6 = var2 >> 1; +- int var7 = (var3 >> 1) + 3; +- int var8 = (var4 >> 1) + 3; ++ /** ++ * Returns a list of integer values generated by this layer. These may be interpreted as temperatures, rainfall ++ * amounts, or biomeList[] indices based on the particular GenLayer subclass. ++ */ ++ public int[] getInts(int par1, int par2, int par3, int par4) { ++ int var5 = par1 >> 1; ++ int var6 = par2 >> 1; ++ int var7 = (par3 >> 1) + 3; ++ int var8 = (par4 >> 1) + 3; + int[] var9 = this.parent.getInts(var5, var6, var7, var8); + int[] var10 = IntCache.getIntCache(var7 * 2 * var8 * 2); + int var11 = var7 << 1; +- + int var13; +- for(int var12 = 0; var12 < var8 - 1; ++var12) { ++ ++ for (int var12 = 0; var12 < var8 - 1; ++var12) { + var13 = var12 << 1; + int var14 = var13 * var11; + int var15 = var9[0 + (var12 + 0) * var7]; + int var16 = var9[0 + (var12 + 1) * var7]; + +- for(int var17 = 0; var17 < var7 - 1; ++var17) { ++ for (int var17 = 0; var17 < var7 - 1; ++var17) { + this.initChunkSeed((long)(var17 + var5 << 1), (long)(var12 + var6 << 1)); + int var18 = var9[var17 + 1 + (var12 + 0) * var7]; + int var19 = var9[var17 + 1 + (var12 + 1) * var7]; +@@ -35,21 +39,27 @@ + } + } + +- int[] var20 = IntCache.getIntCache(var3 * var4); ++ int[] var20 = IntCache.getIntCache(par3 * par4); + +- for(var13 = 0; var13 < var4; ++var13) { +- System.arraycopy(var10, (var13 + (var2 & 1)) * (var7 << 1) + (var1 & 1), var20, var13 * var3, var3); ++ for (var13 = 0; var13 < par4; ++var13) { ++ System.arraycopy(var10, (var13 + (par2 & 1)) * (var7 << 1) + (par1 & 1), var20, var13 * par3, par3); + } + + return var20; + } + +- protected int choose(int var1, int var2) { +- return this.nextInt(2) == 0 ? var1 : var2; ++ /** ++ * randomly choose between the two args ++ */ ++ protected int choose(int par1, int par2) { ++ return this.nextInt(2) == 0 ? par1 : par2; + } + +- protected int choose(int var1, int var2, int var3, int var4) { ++ /** ++ * randomly choose between the four args ++ */ ++ protected int choose(int par1, int par2, int par3, int par4) { + int var5 = this.nextInt(4); +- return var5 == 0 ? var1 : (var5 == 1 ? var2 : (var5 == 2 ? var3 : var4)); ++ return var5 == 0 ? par1 : (var5 == 1 ? par2 : (var5 == 2 ? par3 : par4)); + } + } diff --git a/patches/net/minecraft/src/GenLayerHills.java.patch b/patches/net/minecraft/src/GenLayerHills.java.patch new file mode 100644 index 0000000..ea7bacd --- /dev/null +++ b/patches/net/minecraft/src/GenLayerHills.java.patch @@ -0,0 +1,88 @@ +--- net/minecraft/src/GenLayerHills.java ++++ net/minecraft/src/GenLayerHills.java +@@ -1,50 +1,57 @@ + package net.minecraft.src; + + public class GenLayerHills extends GenLayer { +- public GenLayerHills(long var1, GenLayer var3) { +- super(var1); +- this.parent = var3; ++ public GenLayerHills(long par1, GenLayer par3GenLayer) { ++ super(par1); ++ this.parent = par3GenLayer; + } + +- public int[] getInts(int var1, int var2, int var3, int var4) { +- int[] var5 = this.parent.getInts(var1 - 1, var2 - 1, var3 + 2, var4 + 2); +- int[] var6 = IntCache.getIntCache(var3 * var4); +- +- for(int var7 = 0; var7 < var4; ++var7) { +- for(int var8 = 0; var8 < var3; ++var8) { +- this.initChunkSeed((long)(var8 + var1), (long)(var7 + var2)); +- int var9 = var5[var8 + 1 + (var7 + 1) * (var3 + 2)]; +- if(this.nextInt(3) == 0) { ++ /** ++ * Returns a list of integer values generated by this layer. These may be interpreted as temperatures, rainfall ++ * amounts, or biomeList[] indices based on the particular GenLayer subclass. ++ */ ++ public int[] getInts(int par1, int par2, int par3, int par4) { ++ int[] var5 = this.parent.getInts(par1 - 1, par2 - 1, par3 + 2, par4 + 2); ++ int[] var6 = IntCache.getIntCache(par3 * par4); ++ ++ for (int var7 = 0; var7 < par4; ++var7) { ++ for (int var8 = 0; var8 < par3; ++var8) { ++ this.initChunkSeed((long)(var8 + par1), (long)(var7 + par2)); ++ int var9 = var5[var8 + 1 + (var7 + 1) * (par3 + 2)]; ++ ++ if (this.nextInt(3) == 0) { + int var10 = var9; +- if(var9 == BiomeGenBase.desert.biomeID) { ++ ++ if (var9 == BiomeGenBase.desert.biomeID) { + var10 = BiomeGenBase.desertHills.biomeID; +- } else if(var9 == BiomeGenBase.forest.biomeID) { ++ } else if (var9 == BiomeGenBase.forest.biomeID) { + var10 = BiomeGenBase.forestHills.biomeID; +- } else if(var9 == BiomeGenBase.taiga.biomeID) { ++ } else if (var9 == BiomeGenBase.taiga.biomeID) { + var10 = BiomeGenBase.taigaHills.biomeID; +- } else if(var9 == BiomeGenBase.plains.biomeID) { ++ } else if (var9 == BiomeGenBase.plains.biomeID) { + var10 = BiomeGenBase.forest.biomeID; +- } else if(var9 == BiomeGenBase.icePlains.biomeID) { ++ } else if (var9 == BiomeGenBase.icePlains.biomeID) { + var10 = BiomeGenBase.iceMountains.biomeID; +- } else if(var9 == BiomeGenBase.jungle.biomeID) { ++ } else if (var9 == BiomeGenBase.jungle.biomeID) { + var10 = BiomeGenBase.jungleHills.biomeID; + } + +- if(var10 == var9) { +- var6[var8 + var7 * var3] = var9; ++ if (var10 == var9) { ++ var6[var8 + var7 * par3] = var9; + } else { +- int var11 = var5[var8 + 1 + (var7 + 1 - 1) * (var3 + 2)]; +- int var12 = var5[var8 + 1 + 1 + (var7 + 1) * (var3 + 2)]; +- int var13 = var5[var8 + 1 - 1 + (var7 + 1) * (var3 + 2)]; +- int var14 = var5[var8 + 1 + (var7 + 1 + 1) * (var3 + 2)]; +- if(var11 == var9 && var12 == var9 && var13 == var9 && var14 == var9) { +- var6[var8 + var7 * var3] = var10; ++ int var11 = var5[var8 + 1 + (var7 + 1 - 1) * (par3 + 2)]; ++ int var12 = var5[var8 + 1 + 1 + (var7 + 1) * (par3 + 2)]; ++ int var13 = var5[var8 + 1 - 1 + (var7 + 1) * (par3 + 2)]; ++ int var14 = var5[var8 + 1 + (var7 + 1 + 1) * (par3 + 2)]; ++ ++ if (var11 == var9 && var12 == var9 && var13 == var9 && var14 == var9) { ++ var6[var8 + var7 * par3] = var10; + } else { +- var6[var8 + var7 * var3] = var9; ++ var6[var8 + var7 * par3] = var9; + } + } + } else { +- var6[var8 + var7 * var3] = var9; ++ var6[var8 + var7 * par3] = var9; + } + } + } diff --git a/patches/net/minecraft/src/GenLayerIsland.java.patch b/patches/net/minecraft/src/GenLayerIsland.java.patch new file mode 100644 index 0000000..abc87d9 --- /dev/null +++ b/patches/net/minecraft/src/GenLayerIsland.java.patch @@ -0,0 +1,39 @@ +--- net/minecraft/src/GenLayerIsland.java ++++ net/minecraft/src/GenLayerIsland.java +@@ -1,22 +1,26 @@ + package net.minecraft.src; + + public class GenLayerIsland extends GenLayer { +- public GenLayerIsland(long var1) { +- super(var1); ++ public GenLayerIsland(long par1) { ++ super(par1); + } + +- public int[] getInts(int var1, int var2, int var3, int var4) { +- int[] var5 = IntCache.getIntCache(var3 * var4); ++ /** ++ * Returns a list of integer values generated by this layer. These may be interpreted as temperatures, rainfall ++ * amounts, or biomeList[] indices based on the particular GenLayer subclass. ++ */ ++ public int[] getInts(int par1, int par2, int par3, int par4) { ++ int[] var5 = IntCache.getIntCache(par3 * par4); + +- for(int var6 = 0; var6 < var4; ++var6) { +- for(int var7 = 0; var7 < var3; ++var7) { +- this.initChunkSeed((long)(var1 + var7), (long)(var2 + var6)); +- var5[var7 + var6 * var3] = this.nextInt(10) == 0 ? 1 : 0; ++ for (int var6 = 0; var6 < par4; ++var6) { ++ for (int var7 = 0; var7 < par3; ++var7) { ++ this.initChunkSeed((long)(par1 + var7), (long)(par2 + var6)); ++ var5[var7 + var6 * par3] = this.nextInt(10) == 0 ? 1 : 0; + } + } + +- if(var1 > -var3 && var1 <= 0 && var2 > -var4 && var2 <= 0) { +- var5[-var1 + -var2 * var3] = 1; ++ if (par1 > -par3 && par1 <= 0 && par2 > -par4 && par2 <= 0) { ++ var5[-par1 + -par2 * par3] = 1; + } + + return var5; diff --git a/patches/net/minecraft/src/GenLayerRiver.java.patch b/patches/net/minecraft/src/GenLayerRiver.java.patch new file mode 100644 index 0000000..56326fe --- /dev/null +++ b/patches/net/minecraft/src/GenLayerRiver.java.patch @@ -0,0 +1,52 @@ +--- net/minecraft/src/GenLayerRiver.java ++++ net/minecraft/src/GenLayerRiver.java +@@ -1,30 +1,35 @@ + package net.minecraft.src; + + public class GenLayerRiver extends GenLayer { +- public GenLayerRiver(long var1, GenLayer var3) { +- super(var1); +- super.parent = var3; ++ public GenLayerRiver(long par1, GenLayer par3GenLayer) { ++ super(par1); ++ super.parent = par3GenLayer; + } + +- public int[] getInts(int var1, int var2, int var3, int var4) { +- int var5 = var1 - 1; +- int var6 = var2 - 1; +- int var7 = var3 + 2; +- int var8 = var4 + 2; ++ /** ++ * Returns a list of integer values generated by this layer. These may be interpreted as temperatures, rainfall ++ * amounts, or biomeList[] indices based on the particular GenLayer subclass. ++ */ ++ public int[] getInts(int par1, int par2, int par3, int par4) { ++ int var5 = par1 - 1; ++ int var6 = par2 - 1; ++ int var7 = par3 + 2; ++ int var8 = par4 + 2; + int[] var9 = this.parent.getInts(var5, var6, var7, var8); +- int[] var10 = IntCache.getIntCache(var3 * var4); ++ int[] var10 = IntCache.getIntCache(par3 * par4); + +- for(int var11 = 0; var11 < var4; ++var11) { +- for(int var12 = 0; var12 < var3; ++var12) { ++ for (int var11 = 0; var11 < par4; ++var11) { ++ for (int var12 = 0; var12 < par3; ++var12) { + int var13 = var9[var12 + 0 + (var11 + 1) * var7]; + int var14 = var9[var12 + 2 + (var11 + 1) * var7]; + int var15 = var9[var12 + 1 + (var11 + 0) * var7]; + int var16 = var9[var12 + 1 + (var11 + 2) * var7]; + int var17 = var9[var12 + 1 + (var11 + 1) * var7]; +- if(var17 != 0 && var13 != 0 && var14 != 0 && var15 != 0 && var16 != 0 && var17 == var13 && var17 == var15 && var17 == var14 && var17 == var16) { +- var10[var12 + var11 * var3] = -1; ++ ++ if (var17 != 0 && var13 != 0 && var14 != 0 && var15 != 0 && var16 != 0 && var17 == var13 && var17 == var15 && var17 == var14 && var17 == var16) { ++ var10[var12 + var11 * par3] = -1; + } else { +- var10[var12 + var11 * var3] = BiomeGenBase.river.biomeID; ++ var10[var12 + var11 * par3] = BiomeGenBase.river.biomeID; + } + } + } diff --git a/patches/net/minecraft/src/GenLayerRiverInit.java.patch b/patches/net/minecraft/src/GenLayerRiverInit.java.patch new file mode 100644 index 0000000..cb40a7f --- /dev/null +++ b/patches/net/minecraft/src/GenLayerRiverInit.java.patch @@ -0,0 +1,36 @@ +--- net/minecraft/src/GenLayerRiverInit.java ++++ net/minecraft/src/GenLayerRiverInit.java +@@ -1,19 +1,23 @@ + package net.minecraft.src; + + public class GenLayerRiverInit extends GenLayer { +- public GenLayerRiverInit(long var1, GenLayer var3) { +- super(var1); +- this.parent = var3; ++ public GenLayerRiverInit(long par1, GenLayer par3GenLayer) { ++ super(par1); ++ this.parent = par3GenLayer; + } + +- public int[] getInts(int var1, int var2, int var3, int var4) { +- int[] var5 = this.parent.getInts(var1, var2, var3, var4); +- int[] var6 = IntCache.getIntCache(var3 * var4); ++ /** ++ * Returns a list of integer values generated by this layer. These may be interpreted as temperatures, rainfall ++ * amounts, or biomeList[] indices based on the particular GenLayer subclass. ++ */ ++ public int[] getInts(int par1, int par2, int par3, int par4) { ++ int[] var5 = this.parent.getInts(par1, par2, par3, par4); ++ int[] var6 = IntCache.getIntCache(par3 * par4); + +- for(int var7 = 0; var7 < var4; ++var7) { +- for(int var8 = 0; var8 < var3; ++var8) { +- this.initChunkSeed((long)(var8 + var1), (long)(var7 + var2)); +- var6[var8 + var7 * var3] = var5[var8 + var7 * var3] > 0 ? this.nextInt(2) + 2 : 0; ++ for (int var7 = 0; var7 < par4; ++var7) { ++ for (int var8 = 0; var8 < par3; ++var8) { ++ this.initChunkSeed((long)(var8 + par1), (long)(var7 + par2)); ++ var6[var8 + var7 * par3] = var5[var8 + var7 * par3] > 0 ? this.nextInt(2) + 2 : 0; + } + } + diff --git a/patches/net/minecraft/src/GenLayerRiverMix.java.patch b/patches/net/minecraft/src/GenLayerRiverMix.java.patch new file mode 100644 index 0000000..cb9692f --- /dev/null +++ b/patches/net/minecraft/src/GenLayerRiverMix.java.patch @@ -0,0 +1,63 @@ +--- net/minecraft/src/GenLayerRiverMix.java ++++ net/minecraft/src/GenLayerRiverMix.java +@@ -4,30 +4,38 @@ + private GenLayer biomePatternGeneratorChain; + private GenLayer riverPatternGeneratorChain; + +- public GenLayerRiverMix(long var1, GenLayer var3, GenLayer var4) { +- super(var1); +- this.biomePatternGeneratorChain = var3; +- this.riverPatternGeneratorChain = var4; +- } +- +- public void initWorldGenSeed(long var1) { +- this.biomePatternGeneratorChain.initWorldGenSeed(var1); +- this.riverPatternGeneratorChain.initWorldGenSeed(var1); +- super.initWorldGenSeed(var1); +- } +- +- public int[] getInts(int var1, int var2, int var3, int var4) { +- int[] var5 = this.biomePatternGeneratorChain.getInts(var1, var2, var3, var4); +- int[] var6 = this.riverPatternGeneratorChain.getInts(var1, var2, var3, var4); +- int[] var7 = IntCache.getIntCache(var3 * var4); +- +- for(int var8 = 0; var8 < var3 * var4; ++var8) { +- if(var5[var8] == BiomeGenBase.ocean.biomeID) { ++ public GenLayerRiverMix(long par1, GenLayer par3GenLayer, GenLayer par4GenLayer) { ++ super(par1); ++ this.biomePatternGeneratorChain = par3GenLayer; ++ this.riverPatternGeneratorChain = par4GenLayer; ++ } ++ ++ /** ++ * Initialize layer's local worldGenSeed based on its own baseSeed and the world's global seed (passed in as an ++ * argument). ++ */ ++ public void initWorldGenSeed(long par1) { ++ this.biomePatternGeneratorChain.initWorldGenSeed(par1); ++ this.riverPatternGeneratorChain.initWorldGenSeed(par1); ++ super.initWorldGenSeed(par1); ++ } ++ ++ /** ++ * Returns a list of integer values generated by this layer. These may be interpreted as temperatures, rainfall ++ * amounts, or biomeList[] indices based on the particular GenLayer subclass. ++ */ ++ public int[] getInts(int par1, int par2, int par3, int par4) { ++ int[] var5 = this.biomePatternGeneratorChain.getInts(par1, par2, par3, par4); ++ int[] var6 = this.riverPatternGeneratorChain.getInts(par1, par2, par3, par4); ++ int[] var7 = IntCache.getIntCache(par3 * par4); ++ ++ for (int var8 = 0; var8 < par3 * par4; ++var8) { ++ if (var5[var8] == BiomeGenBase.ocean.biomeID) { + var7[var8] = var5[var8]; +- } else if(var6[var8] >= 0) { +- if(var5[var8] == BiomeGenBase.icePlains.biomeID) { ++ } else if (var6[var8] >= 0) { ++ if (var5[var8] == BiomeGenBase.icePlains.biomeID) { + var7[var8] = BiomeGenBase.frozenRiver.biomeID; +- } else if(var5[var8] != BiomeGenBase.mushroomIsland.biomeID && var5[var8] != BiomeGenBase.mushroomIslandShore.biomeID) { ++ } else if (var5[var8] != BiomeGenBase.mushroomIsland.biomeID && var5[var8] != BiomeGenBase.mushroomIslandShore.biomeID) { + var7[var8] = var6[var8]; + } else { + var7[var8] = BiomeGenBase.mushroomIslandShore.biomeID; diff --git a/patches/net/minecraft/src/GenLayerShore.java.patch b/patches/net/minecraft/src/GenLayerShore.java.patch new file mode 100644 index 0000000..320a988 --- /dev/null +++ b/patches/net/minecraft/src/GenLayerShore.java.patch @@ -0,0 +1,106 @@ +--- net/minecraft/src/GenLayerShore.java ++++ net/minecraft/src/GenLayerShore.java +@@ -1,55 +1,63 @@ + package net.minecraft.src; + + public class GenLayerShore extends GenLayer { +- public GenLayerShore(long var1, GenLayer var3) { +- super(var1); +- this.parent = var3; ++ public GenLayerShore(long par1, GenLayer par3GenLayer) { ++ super(par1); ++ this.parent = par3GenLayer; + } + +- public int[] getInts(int var1, int var2, int var3, int var4) { +- int[] var5 = this.parent.getInts(var1 - 1, var2 - 1, var3 + 2, var4 + 2); +- int[] var6 = IntCache.getIntCache(var3 * var4); ++ /** ++ * Returns a list of integer values generated by this layer. These may be interpreted as temperatures, rainfall ++ * amounts, or biomeList[] indices based on the particular GenLayer subclass. ++ */ ++ public int[] getInts(int par1, int par2, int par3, int par4) { ++ int[] var5 = this.parent.getInts(par1 - 1, par2 - 1, par3 + 2, par4 + 2); ++ int[] var6 = IntCache.getIntCache(par3 * par4); + +- for(int var7 = 0; var7 < var4; ++var7) { +- for(int var8 = 0; var8 < var3; ++var8) { +- this.initChunkSeed((long)(var8 + var1), (long)(var7 + var2)); +- int var9 = var5[var8 + 1 + (var7 + 1) * (var3 + 2)]; ++ for (int var7 = 0; var7 < par4; ++var7) { ++ for (int var8 = 0; var8 < par3; ++var8) { ++ this.initChunkSeed((long)(var8 + par1), (long)(var7 + par2)); ++ int var9 = var5[var8 + 1 + (var7 + 1) * (par3 + 2)]; + int var10; + int var11; + int var12; + int var13; +- if(var9 == BiomeGenBase.mushroomIsland.biomeID) { +- var10 = var5[var8 + 1 + (var7 + 1 - 1) * (var3 + 2)]; +- var11 = var5[var8 + 1 + 1 + (var7 + 1) * (var3 + 2)]; +- var12 = var5[var8 + 1 - 1 + (var7 + 1) * (var3 + 2)]; +- var13 = var5[var8 + 1 + (var7 + 1 + 1) * (var3 + 2)]; +- if(var10 != BiomeGenBase.ocean.biomeID && var11 != BiomeGenBase.ocean.biomeID && var12 != BiomeGenBase.ocean.biomeID && var13 != BiomeGenBase.ocean.biomeID) { +- var6[var8 + var7 * var3] = var9; +- } else { +- var6[var8 + var7 * var3] = BiomeGenBase.mushroomIslandShore.biomeID; +- } +- } else if(var9 != BiomeGenBase.ocean.biomeID && var9 != BiomeGenBase.river.biomeID && var9 != BiomeGenBase.swampland.biomeID && var9 != BiomeGenBase.extremeHills.biomeID) { +- var10 = var5[var8 + 1 + (var7 + 1 - 1) * (var3 + 2)]; +- var11 = var5[var8 + 1 + 1 + (var7 + 1) * (var3 + 2)]; +- var12 = var5[var8 + 1 - 1 + (var7 + 1) * (var3 + 2)]; +- var13 = var5[var8 + 1 + (var7 + 1 + 1) * (var3 + 2)]; +- if(var10 != BiomeGenBase.ocean.biomeID && var11 != BiomeGenBase.ocean.biomeID && var12 != BiomeGenBase.ocean.biomeID && var13 != BiomeGenBase.ocean.biomeID) { +- var6[var8 + var7 * var3] = var9; +- } else { +- var6[var8 + var7 * var3] = BiomeGenBase.beach.biomeID; +- } +- } else if(var9 == BiomeGenBase.extremeHills.biomeID) { +- var10 = var5[var8 + 1 + (var7 + 1 - 1) * (var3 + 2)]; +- var11 = var5[var8 + 1 + 1 + (var7 + 1) * (var3 + 2)]; +- var12 = var5[var8 + 1 - 1 + (var7 + 1) * (var3 + 2)]; +- var13 = var5[var8 + 1 + (var7 + 1 + 1) * (var3 + 2)]; +- if(var10 == BiomeGenBase.extremeHills.biomeID && var11 == BiomeGenBase.extremeHills.biomeID && var12 == BiomeGenBase.extremeHills.biomeID && var13 == BiomeGenBase.extremeHills.biomeID) { +- var6[var8 + var7 * var3] = var9; +- } else { +- var6[var8 + var7 * var3] = BiomeGenBase.extremeHillsEdge.biomeID; ++ ++ if (var9 == BiomeGenBase.mushroomIsland.biomeID) { ++ var10 = var5[var8 + 1 + (var7 + 1 - 1) * (par3 + 2)]; ++ var11 = var5[var8 + 1 + 1 + (var7 + 1) * (par3 + 2)]; ++ var12 = var5[var8 + 1 - 1 + (var7 + 1) * (par3 + 2)]; ++ var13 = var5[var8 + 1 + (var7 + 1 + 1) * (par3 + 2)]; ++ ++ if (var10 != BiomeGenBase.ocean.biomeID && var11 != BiomeGenBase.ocean.biomeID && var12 != BiomeGenBase.ocean.biomeID && var13 != BiomeGenBase.ocean.biomeID) { ++ var6[var8 + var7 * par3] = var9; ++ } else { ++ var6[var8 + var7 * par3] = BiomeGenBase.mushroomIslandShore.biomeID; ++ } ++ } else if (var9 != BiomeGenBase.ocean.biomeID && var9 != BiomeGenBase.river.biomeID && var9 != BiomeGenBase.swampland.biomeID && var9 != BiomeGenBase.extremeHills.biomeID) { ++ var10 = var5[var8 + 1 + (var7 + 1 - 1) * (par3 + 2)]; ++ var11 = var5[var8 + 1 + 1 + (var7 + 1) * (par3 + 2)]; ++ var12 = var5[var8 + 1 - 1 + (var7 + 1) * (par3 + 2)]; ++ var13 = var5[var8 + 1 + (var7 + 1 + 1) * (par3 + 2)]; ++ ++ if (var10 != BiomeGenBase.ocean.biomeID && var11 != BiomeGenBase.ocean.biomeID && var12 != BiomeGenBase.ocean.biomeID && var13 != BiomeGenBase.ocean.biomeID) { ++ var6[var8 + var7 * par3] = var9; ++ } else { ++ var6[var8 + var7 * par3] = BiomeGenBase.beach.biomeID; ++ } ++ } else if (var9 == BiomeGenBase.extremeHills.biomeID) { ++ var10 = var5[var8 + 1 + (var7 + 1 - 1) * (par3 + 2)]; ++ var11 = var5[var8 + 1 + 1 + (var7 + 1) * (par3 + 2)]; ++ var12 = var5[var8 + 1 - 1 + (var7 + 1) * (par3 + 2)]; ++ var13 = var5[var8 + 1 + (var7 + 1 + 1) * (par3 + 2)]; ++ ++ if (var10 == BiomeGenBase.extremeHills.biomeID && var11 == BiomeGenBase.extremeHills.biomeID && var12 == BiomeGenBase.extremeHills.biomeID && var13 == BiomeGenBase.extremeHills.biomeID) { ++ var6[var8 + var7 * par3] = var9; ++ } else { ++ var6[var8 + var7 * par3] = BiomeGenBase.extremeHillsEdge.biomeID; + } + } else { +- var6[var8 + var7 * var3] = var9; ++ var6[var8 + var7 * par3] = var9; + } + } + } diff --git a/patches/net/minecraft/src/GenLayerSmooth.java.patch b/patches/net/minecraft/src/GenLayerSmooth.java.patch new file mode 100644 index 0000000..374955b --- /dev/null +++ b/patches/net/minecraft/src/GenLayerSmooth.java.patch @@ -0,0 +1,70 @@ +--- net/minecraft/src/GenLayerSmooth.java ++++ net/minecraft/src/GenLayerSmooth.java +@@ -1,44 +1,50 @@ + package net.minecraft.src; + + public class GenLayerSmooth extends GenLayer { +- public GenLayerSmooth(long var1, GenLayer var3) { +- super(var1); +- super.parent = var3; ++ public GenLayerSmooth(long par1, GenLayer par3GenLayer) { ++ super(par1); ++ super.parent = par3GenLayer; + } + +- public int[] getInts(int var1, int var2, int var3, int var4) { +- int var5 = var1 - 1; +- int var6 = var2 - 1; +- int var7 = var3 + 2; +- int var8 = var4 + 2; ++ /** ++ * Returns a list of integer values generated by this layer. These may be interpreted as temperatures, rainfall ++ * amounts, or biomeList[] indices based on the particular GenLayer subclass. ++ */ ++ public int[] getInts(int par1, int par2, int par3, int par4) { ++ int var5 = par1 - 1; ++ int var6 = par2 - 1; ++ int var7 = par3 + 2; ++ int var8 = par4 + 2; + int[] var9 = this.parent.getInts(var5, var6, var7, var8); +- int[] var10 = IntCache.getIntCache(var3 * var4); ++ int[] var10 = IntCache.getIntCache(par3 * par4); + +- for(int var11 = 0; var11 < var4; ++var11) { +- for(int var12 = 0; var12 < var3; ++var12) { ++ for (int var11 = 0; var11 < par4; ++var11) { ++ for (int var12 = 0; var12 < par3; ++var12) { + int var13 = var9[var12 + 0 + (var11 + 1) * var7]; + int var14 = var9[var12 + 2 + (var11 + 1) * var7]; + int var15 = var9[var12 + 1 + (var11 + 0) * var7]; + int var16 = var9[var12 + 1 + (var11 + 2) * var7]; + int var17 = var9[var12 + 1 + (var11 + 1) * var7]; +- if(var13 == var14 && var15 == var16) { +- this.initChunkSeed((long)(var12 + var1), (long)(var11 + var2)); +- if(this.nextInt(2) == 0) { ++ ++ if (var13 == var14 && var15 == var16) { ++ this.initChunkSeed((long)(var12 + par1), (long)(var11 + par2)); ++ ++ if (this.nextInt(2) == 0) { + var17 = var13; + } else { + var17 = var15; + } + } else { +- if(var13 == var14) { ++ if (var13 == var14) { + var17 = var13; + } + +- if(var15 == var16) { ++ if (var15 == var16) { + var17 = var15; + } + } + +- var10[var12 + var11 * var3] = var17; ++ var10[var12 + var11 * par3] = var17; + } + } + diff --git a/patches/net/minecraft/src/GenLayerSwampRivers.java.patch b/patches/net/minecraft/src/GenLayerSwampRivers.java.patch new file mode 100644 index 0000000..a275889 --- /dev/null +++ b/patches/net/minecraft/src/GenLayerSwampRivers.java.patch @@ -0,0 +1,45 @@ +--- net/minecraft/src/GenLayerSwampRivers.java ++++ net/minecraft/src/GenLayerSwampRivers.java +@@ -1,23 +1,28 @@ + package net.minecraft.src; + + public class GenLayerSwampRivers extends GenLayer { +- public GenLayerSwampRivers(long var1, GenLayer var3) { +- super(var1); +- this.parent = var3; ++ public GenLayerSwampRivers(long par1, GenLayer par3GenLayer) { ++ super(par1); ++ this.parent = par3GenLayer; + } + +- public int[] getInts(int var1, int var2, int var3, int var4) { +- int[] var5 = this.parent.getInts(var1 - 1, var2 - 1, var3 + 2, var4 + 2); +- int[] var6 = IntCache.getIntCache(var3 * var4); +- +- for(int var7 = 0; var7 < var4; ++var7) { +- for(int var8 = 0; var8 < var3; ++var8) { +- this.initChunkSeed((long)(var8 + var1), (long)(var7 + var2)); +- int var9 = var5[var8 + 1 + (var7 + 1) * (var3 + 2)]; +- if((var9 != BiomeGenBase.swampland.biomeID || this.nextInt(6) != 0) && (var9 != BiomeGenBase.jungle.biomeID && var9 != BiomeGenBase.jungleHills.biomeID || this.nextInt(8) != 0)) { +- var6[var8 + var7 * var3] = var9; ++ /** ++ * Returns a list of integer values generated by this layer. These may be interpreted as temperatures, rainfall ++ * amounts, or biomeList[] indices based on the particular GenLayer subclass. ++ */ ++ public int[] getInts(int par1, int par2, int par3, int par4) { ++ int[] var5 = this.parent.getInts(par1 - 1, par2 - 1, par3 + 2, par4 + 2); ++ int[] var6 = IntCache.getIntCache(par3 * par4); ++ ++ for (int var7 = 0; var7 < par4; ++var7) { ++ for (int var8 = 0; var8 < par3; ++var8) { ++ this.initChunkSeed((long)(var8 + par1), (long)(var7 + par2)); ++ int var9 = var5[var8 + 1 + (var7 + 1) * (par3 + 2)]; ++ ++ if ((var9 != BiomeGenBase.swampland.biomeID || this.nextInt(6) != 0) && (var9 != BiomeGenBase.jungle.biomeID && var9 != BiomeGenBase.jungleHills.biomeID || this.nextInt(8) != 0)) { ++ var6[var8 + var7 * par3] = var9; + } else { +- var6[var8 + var7 * var3] = BiomeGenBase.river.biomeID; ++ var6[var8 + var7 * par3] = BiomeGenBase.river.biomeID; + } + } + } diff --git a/patches/net/minecraft/src/GenLayerVoronoiZoom.java.patch b/patches/net/minecraft/src/GenLayerVoronoiZoom.java.patch new file mode 100644 index 0000000..4976d11 --- /dev/null +++ b/patches/net/minecraft/src/GenLayerVoronoiZoom.java.patch @@ -0,0 +1,91 @@ +--- net/minecraft/src/GenLayerVoronoiZoom.java ++++ net/minecraft/src/GenLayerVoronoiZoom.java +@@ -1,31 +1,35 @@ + package net.minecraft.src; + + public class GenLayerVoronoiZoom extends GenLayer { +- public GenLayerVoronoiZoom(long var1, GenLayer var3) { +- super(var1); +- super.parent = var3; ++ public GenLayerVoronoiZoom(long par1, GenLayer par3GenLayer) { ++ super(par1); ++ super.parent = par3GenLayer; + } + +- public int[] getInts(int var1, int var2, int var3, int var4) { +- var1 -= 2; +- var2 -= 2; ++ /** ++ * Returns a list of integer values generated by this layer. These may be interpreted as temperatures, rainfall ++ * amounts, or biomeList[] indices based on the particular GenLayer subclass. ++ */ ++ public int[] getInts(int par1, int par2, int par3, int par4) { ++ par1 -= 2; ++ par2 -= 2; + byte var5 = 2; + int var6 = 1 << var5; +- int var7 = var1 >> var5; +- int var8 = var2 >> var5; +- int var9 = (var3 >> var5) + 3; +- int var10 = (var4 >> var5) + 3; ++ int var7 = par1 >> var5; ++ int var8 = par2 >> var5; ++ int var9 = (par3 >> var5) + 3; ++ int var10 = (par4 >> var5) + 3; + int[] var11 = this.parent.getInts(var7, var8, var9, var10); + int var12 = var9 << var5; + int var13 = var10 << var5; + int[] var14 = IntCache.getIntCache(var12 * var13); +- + int var16; +- for(int var15 = 0; var15 < var10 - 1; ++var15) { ++ ++ for (int var15 = 0; var15 < var10 - 1; ++var15) { + var16 = var11[0 + (var15 + 0) * var9]; + int var17 = var11[0 + (var15 + 1) * var9]; + +- for(int var18 = 0; var18 < var9 - 1; ++var18) { ++ for (int var18 = 0; var18 < var9 - 1; ++var18) { + double var19 = (double)var6 * 0.9D; + this.initChunkSeed((long)(var18 + var7 << var5), (long)(var15 + var8 << var5)); + double var21 = ((double)this.nextInt(1024) / 1024.0D - 0.5D) * var19; +@@ -42,19 +46,20 @@ + int var37 = var11[var18 + 1 + (var15 + 0) * var9]; + int var38 = var11[var18 + 1 + (var15 + 1) * var9]; + +- for(int var39 = 0; var39 < var6; ++var39) { ++ for (int var39 = 0; var39 < var6; ++var39) { + int var40 = ((var15 << var5) + var39) * var12 + (var18 << var5); + +- for(int var41 = 0; var41 < var6; ++var41) { ++ for (int var41 = 0; var41 < var6; ++var41) { + double var42 = ((double)var39 - var23) * ((double)var39 - var23) + ((double)var41 - var21) * ((double)var41 - var21); + double var44 = ((double)var39 - var27) * ((double)var39 - var27) + ((double)var41 - var25) * ((double)var41 - var25); + double var46 = ((double)var39 - var31) * ((double)var39 - var31) + ((double)var41 - var29) * ((double)var41 - var29); + double var48 = ((double)var39 - var35) * ((double)var39 - var35) + ((double)var41 - var33) * ((double)var41 - var33); +- if(var42 < var44 && var42 < var46 && var42 < var48) { ++ ++ if (var42 < var44 && var42 < var46 && var42 < var48) { + var14[var40++] = var16; +- } else if(var44 < var42 && var44 < var46 && var44 < var48) { ++ } else if (var44 < var42 && var44 < var46 && var44 < var48) { + var14[var40++] = var37; +- } else if(var46 < var42 && var46 < var44 && var46 < var48) { ++ } else if (var46 < var42 && var46 < var44 && var46 < var48) { + var14[var40++] = var17; + } else { + var14[var40++] = var38; +@@ -67,10 +72,10 @@ + } + } + +- int[] var50 = IntCache.getIntCache(var3 * var4); ++ int[] var50 = IntCache.getIntCache(par3 * par4); + +- for(var16 = 0; var16 < var4; ++var16) { +- System.arraycopy(var14, (var16 + (var2 & var6 - 1)) * (var9 << var5) + (var1 & var6 - 1), var50, var16 * var3, var3); ++ for (var16 = 0; var16 < par4; ++var16) { ++ System.arraycopy(var14, (var16 + (par2 & var6 - 1)) * (var9 << var5) + (par1 & var6 - 1), var50, var16 * par3, par3); + } + + return var50; diff --git a/patches/net/minecraft/src/GenLayerZoom.java.patch b/patches/net/minecraft/src/GenLayerZoom.java.patch new file mode 100644 index 0000000..384cea5 --- /dev/null +++ b/patches/net/minecraft/src/GenLayerZoom.java.patch @@ -0,0 +1,162 @@ +--- net/minecraft/src/GenLayerZoom.java ++++ net/minecraft/src/GenLayerZoom.java +@@ -1,28 +1,32 @@ + package net.minecraft.src; + + public class GenLayerZoom extends GenLayer { +- public GenLayerZoom(long var1, GenLayer var3) { +- super(var1); +- super.parent = var3; ++ public GenLayerZoom(long par1, GenLayer par3GenLayer) { ++ super(par1); ++ super.parent = par3GenLayer; + } + +- public int[] getInts(int var1, int var2, int var3, int var4) { +- int var5 = var1 >> 1; +- int var6 = var2 >> 1; +- int var7 = (var3 >> 1) + 3; +- int var8 = (var4 >> 1) + 3; ++ /** ++ * Returns a list of integer values generated by this layer. These may be interpreted as temperatures, rainfall ++ * amounts, or biomeList[] indices based on the particular GenLayer subclass. ++ */ ++ public int[] getInts(int par1, int par2, int par3, int par4) { ++ int var5 = par1 >> 1; ++ int var6 = par2 >> 1; ++ int var7 = (par3 >> 1) + 3; ++ int var8 = (par4 >> 1) + 3; + int[] var9 = this.parent.getInts(var5, var6, var7, var8); + int[] var10 = IntCache.getIntCache(var7 * 2 * var8 * 2); + int var11 = var7 << 1; +- + int var13; +- for(int var12 = 0; var12 < var8 - 1; ++var12) { ++ ++ for (int var12 = 0; var12 < var8 - 1; ++var12) { + var13 = var12 << 1; + int var14 = var13 * var11; + int var15 = var9[0 + (var12 + 0) * var7]; + int var16 = var9[0 + (var12 + 1) * var7]; + +- for(int var17 = 0; var17 < var7 - 1; ++var17) { ++ for (int var17 = 0; var17 < var7 - 1; ++var17) { + this.initChunkSeed((long)(var17 + var5 << 1), (long)(var12 + var6 << 1)); + int var18 = var9[var17 + 1 + (var12 + 0) * var7]; + int var19 = var9[var17 + 1 + (var12 + 1) * var7]; +@@ -35,63 +39,72 @@ + } + } + +- int[] var20 = IntCache.getIntCache(var3 * var4); ++ int[] var20 = IntCache.getIntCache(par3 * par4); + +- for(var13 = 0; var13 < var4; ++var13) { +- System.arraycopy(var10, (var13 + (var2 & 1)) * (var7 << 1) + (var1 & 1), var20, var13 * var3, var3); ++ for (var13 = 0; var13 < par4; ++var13) { ++ System.arraycopy(var10, (var13 + (par2 & 1)) * (var7 << 1) + (par1 & 1), var20, var13 * par3, par3); + } + + return var20; + } + +- protected int choose(int var1, int var2) { +- return this.nextInt(2) == 0 ? var1 : var2; ++ /** ++ * Chooses one of the two inputs randomly. ++ */ ++ protected int choose(int par1, int par2) { ++ return this.nextInt(2) == 0 ? par1 : par2; + } + +- protected int modeOrRandom(int var1, int var2, int var3, int var4) { +- if(var2 == var3 && var3 == var4) { +- return var2; +- } else if(var1 == var2 && var1 == var3) { +- return var1; +- } else if(var1 == var2 && var1 == var4) { +- return var1; +- } else if(var1 == var3 && var1 == var4) { +- return var1; +- } else if(var1 == var2 && var3 != var4) { +- return var1; +- } else if(var1 == var3 && var2 != var4) { +- return var1; +- } else if(var1 == var4 && var2 != var3) { +- return var1; +- } else if(var2 == var1 && var3 != var4) { +- return var2; +- } else if(var2 == var3 && var1 != var4) { +- return var2; +- } else if(var2 == var4 && var1 != var3) { +- return var2; +- } else if(var3 == var1 && var2 != var4) { +- return var3; +- } else if(var3 == var2 && var1 != var4) { +- return var3; +- } else if(var3 == var4 && var1 != var2) { +- return var3; +- } else if(var4 == var1 && var2 != var3) { +- return var3; +- } else if(var4 == var2 && var1 != var3) { +- return var3; +- } else if(var4 == var3 && var1 != var2) { +- return var3; ++ /** ++ * returns the mode (most frequently occuring number) or a random number from the 4 integers provided ++ */ ++ protected int modeOrRandom(int par1, int par2, int par3, int par4) { ++ if (par2 == par3 && par3 == par4) { ++ return par2; ++ } else if (par1 == par2 && par1 == par3) { ++ return par1; ++ } else if (par1 == par2 && par1 == par4) { ++ return par1; ++ } else if (par1 == par3 && par1 == par4) { ++ return par1; ++ } else if (par1 == par2 && par3 != par4) { ++ return par1; ++ } else if (par1 == par3 && par2 != par4) { ++ return par1; ++ } else if (par1 == par4 && par2 != par3) { ++ return par1; ++ } else if (par2 == par1 && par3 != par4) { ++ return par2; ++ } else if (par2 == par3 && par1 != par4) { ++ return par2; ++ } else if (par2 == par4 && par1 != par3) { ++ return par2; ++ } else if (par3 == par1 && par2 != par4) { ++ return par3; ++ } else if (par3 == par2 && par1 != par4) { ++ return par3; ++ } else if (par3 == par4 && par1 != par2) { ++ return par3; ++ } else if (par4 == par1 && par2 != par3) { ++ return par3; ++ } else if (par4 == par2 && par1 != par3) { ++ return par3; ++ } else if (par4 == par3 && par1 != par2) { ++ return par3; + } else { + int var5 = this.nextInt(4); +- return var5 == 0 ? var1 : (var5 == 1 ? var2 : (var5 == 2 ? var3 : var4)); ++ return var5 == 0 ? par1 : (var5 == 1 ? par2 : (var5 == 2 ? par3 : par4)); + } + } + +- public static GenLayer magnify(long var0, GenLayer var2, int var3) { +- Object var4 = var2; ++ /** ++ * Magnify a layer. Parms are seed adjustment, layer, number of times to magnify ++ */ ++ public static GenLayer magnify(long par0, GenLayer par2GenLayer, int par3) { ++ Object var4 = par2GenLayer; + +- for(int var5 = 0; var5 < var3; ++var5) { +- var4 = new GenLayerZoom(var0 + (long)var5, (GenLayer)var4); ++ for (int var5 = 0; var5 < par3; ++var5) { ++ var4 = new GenLayerZoom(par0 + (long)var5, (GenLayer)var4); + } + + return (GenLayer)var4; diff --git a/patches/net/minecraft/src/GrassColorReloadListener.java.patch b/patches/net/minecraft/src/GrassColorReloadListener.java.patch new file mode 100644 index 0000000..d265c8f --- /dev/null +++ b/patches/net/minecraft/src/GrassColorReloadListener.java.patch @@ -0,0 +1,17 @@ +--- net/minecraft/src/GrassColorReloadListener.java ++++ net/minecraft/src/GrassColorReloadListener.java +@@ -5,11 +5,11 @@ + public class GrassColorReloadListener implements ResourceManagerReloadListener { + private static final ResourceLocation field_130078_a = new ResourceLocation("textures/colormap/grass.png"); + +- public void onResourceManagerReload(ResourceManager var1) { ++ public void onResourceManagerReload(ResourceManager par1ResourceManager) { + try { +- ColorizerGrass.setGrassBiomeColorizer(TextureUtil.readImageData(var1, field_130078_a)); ++ ColorizerGrass.setGrassBiomeColorizer(TextureUtil.readImageData(par1ResourceManager, field_130078_a)); + } catch (IOException var3) { ++ ; + } +- + } + } diff --git a/patches/net/minecraft/src/Gui.java.patch b/patches/net/minecraft/src/Gui.java.patch new file mode 100644 index 0000000..cf4f467 --- /dev/null +++ b/patches/net/minecraft/src/Gui.java.patch @@ -0,0 +1,205 @@ +--- net/minecraft/src/Gui.java ++++ net/minecraft/src/Gui.java +@@ -8,68 +8,75 @@ + public static final ResourceLocation icons = new ResourceLocation("textures/gui/icons.png"); + protected float zLevel; + +- protected void drawHorizontalLine(int var1, int var2, int var3, int var4) { +- if(var2 < var1) { +- int var5 = var1; +- var1 = var2; +- var2 = var5; +- } +- +- drawRect(var1, var3, var2 + 1, var3 + 1, var4); +- } +- +- protected void drawVerticalLine(int var1, int var2, int var3, int var4) { +- if(var3 < var2) { +- int var5 = var2; +- var2 = var3; +- var3 = var5; +- } +- +- drawRect(var1, var2 + 1, var1 + 1, var3, var4); +- } +- +- public static void drawRect(int var0, int var1, int var2, int var3, int var4) { ++ protected void drawHorizontalLine(int par1, int par2, int par3, int par4) { ++ if (par2 < par1) { ++ int var5 = par1; ++ par1 = par2; ++ par2 = var5; ++ } ++ ++ drawRect(par1, par3, par2 + 1, par3 + 1, par4); ++ } ++ ++ protected void drawVerticalLine(int par1, int par2, int par3, int par4) { ++ if (par3 < par2) { ++ int var5 = par2; ++ par2 = par3; ++ par3 = var5; ++ } ++ ++ drawRect(par1, par2 + 1, par1 + 1, par3, par4); ++ } ++ ++ /** ++ * Draws a solid color rectangle with the specified coordinates and color. Args: x1, y1, x2, y2, color ++ */ ++ public static void drawRect(int par0, int par1, int par2, int par3, int par4) { + int var5; +- if(var0 < var2) { +- var5 = var0; +- var0 = var2; +- var2 = var5; +- } +- +- if(var1 < var3) { +- var5 = var1; +- var1 = var3; +- var3 = var5; +- } +- +- float var10 = (float)(var4 >> 24 & 255) / 255.0F; +- float var6 = (float)(var4 >> 16 & 255) / 255.0F; +- float var7 = (float)(var4 >> 8 & 255) / 255.0F; +- float var8 = (float)(var4 & 255) / 255.0F; ++ ++ if (par0 < par2) { ++ var5 = par0; ++ par0 = par2; ++ par2 = var5; ++ } ++ ++ if (par1 < par3) { ++ var5 = par1; ++ par1 = par3; ++ par3 = var5; ++ } ++ ++ float var10 = (float)(par4 >> 24 & 255) / 255.0F; ++ float var6 = (float)(par4 >> 16 & 255) / 255.0F; ++ float var7 = (float)(par4 >> 8 & 255) / 255.0F; ++ float var8 = (float)(par4 & 255) / 255.0F; + Tessellator var9 = Tessellator.instance; + GL11.glEnable(GL11.GL_BLEND); + GL11.glDisable(GL11.GL_TEXTURE_2D); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + GL11.glColor4f(var6, var7, var8, var10); + var9.startDrawingQuads(); +- var9.addVertex((double)var0, (double)var3, 0.0D); +- var9.addVertex((double)var2, (double)var3, 0.0D); +- var9.addVertex((double)var2, (double)var1, 0.0D); +- var9.addVertex((double)var0, (double)var1, 0.0D); ++ var9.addVertex((double)par0, (double)par3, 0.0D); ++ var9.addVertex((double)par2, (double)par3, 0.0D); ++ var9.addVertex((double)par2, (double)par1, 0.0D); ++ var9.addVertex((double)par0, (double)par1, 0.0D); + var9.draw(); + GL11.glEnable(GL11.GL_TEXTURE_2D); + GL11.glDisable(GL11.GL_BLEND); + } + +- protected void drawGradientRect(int var1, int var2, int var3, int var4, int var5, int var6) { +- float var7 = (float)(var5 >> 24 & 255) / 255.0F; +- float var8 = (float)(var5 >> 16 & 255) / 255.0F; +- float var9 = (float)(var5 >> 8 & 255) / 255.0F; +- float var10 = (float)(var5 & 255) / 255.0F; +- float var11 = (float)(var6 >> 24 & 255) / 255.0F; +- float var12 = (float)(var6 >> 16 & 255) / 255.0F; +- float var13 = (float)(var6 >> 8 & 255) / 255.0F; +- float var14 = (float)(var6 & 255) / 255.0F; ++ /** ++ * Draws a rectangle with a vertical gradient between the specified colors. ++ */ ++ protected void drawGradientRect(int par1, int par2, int par3, int par4, int par5, int par6) { ++ float var7 = (float)(par5 >> 24 & 255) / 255.0F; ++ float var8 = (float)(par5 >> 16 & 255) / 255.0F; ++ float var9 = (float)(par5 >> 8 & 255) / 255.0F; ++ float var10 = (float)(par5 & 255) / 255.0F; ++ float var11 = (float)(par6 >> 24 & 255) / 255.0F; ++ float var12 = (float)(par6 >> 16 & 255) / 255.0F; ++ float var13 = (float)(par6 >> 8 & 255) / 255.0F; ++ float var14 = (float)(par6 & 255) / 255.0F; + GL11.glDisable(GL11.GL_TEXTURE_2D); + GL11.glEnable(GL11.GL_BLEND); + GL11.glDisable(GL11.GL_ALPHA_TEST); +@@ -78,11 +85,11 @@ + Tessellator var15 = Tessellator.instance; + var15.startDrawingQuads(); + var15.setColorRGBA_F(var8, var9, var10, var7); +- var15.addVertex((double)var3, (double)var2, (double)this.zLevel); +- var15.addVertex((double)var1, (double)var2, (double)this.zLevel); ++ var15.addVertex((double)par3, (double)par2, (double)this.zLevel); ++ var15.addVertex((double)par1, (double)par2, (double)this.zLevel); + var15.setColorRGBA_F(var12, var13, var14, var11); +- var15.addVertex((double)var1, (double)var4, (double)this.zLevel); +- var15.addVertex((double)var3, (double)var4, (double)this.zLevel); ++ var15.addVertex((double)par1, (double)par4, (double)this.zLevel); ++ var15.addVertex((double)par3, (double)par4, (double)this.zLevel); + var15.draw(); + GL11.glShadeModel(GL11.GL_FLAT); + GL11.glDisable(GL11.GL_BLEND); +@@ -90,33 +97,42 @@ + GL11.glEnable(GL11.GL_TEXTURE_2D); + } + +- public void drawCenteredString(FontRenderer var1, String var2, int var3, int var4, int var5) { +- var1.drawStringWithShadow(var2, var3 - var1.getStringWidth(var2) / 2, var4, var5); +- } +- +- public void drawString(FontRenderer var1, String var2, int var3, int var4, int var5) { +- var1.drawStringWithShadow(var2, var3, var4, var5); +- } +- +- public void drawTexturedModalRect(int var1, int var2, int var3, int var4, int var5, int var6) { ++ /** ++ * Renders the specified text to the screen, center-aligned. ++ */ ++ public void drawCenteredString(FontRenderer par1FontRenderer, String par2Str, int par3, int par4, int par5) { ++ par1FontRenderer.drawStringWithShadow(par2Str, par3 - par1FontRenderer.getStringWidth(par2Str) / 2, par4, par5); ++ } ++ ++ /** ++ * Renders the specified text to the screen. ++ */ ++ public void drawString(FontRenderer par1FontRenderer, String par2Str, int par3, int par4, int par5) { ++ par1FontRenderer.drawStringWithShadow(par2Str, par3, par4, par5); ++ } ++ ++ /** ++ * Draws a textured rectangle at the stored z-value. Args: x, y, u, v, width, height ++ */ ++ public void drawTexturedModalRect(int par1, int par2, int par3, int par4, int par5, int par6) { + float var7 = 0.00390625F; + float var8 = 0.00390625F; + Tessellator var9 = Tessellator.instance; + var9.startDrawingQuads(); +- var9.addVertexWithUV((double)(var1 + 0), (double)(var2 + var6), (double)this.zLevel, (double)((float)(var3 + 0) * var7), (double)((float)(var4 + var6) * var8)); +- var9.addVertexWithUV((double)(var1 + var5), (double)(var2 + var6), (double)this.zLevel, (double)((float)(var3 + var5) * var7), (double)((float)(var4 + var6) * var8)); +- var9.addVertexWithUV((double)(var1 + var5), (double)(var2 + 0), (double)this.zLevel, (double)((float)(var3 + var5) * var7), (double)((float)(var4 + 0) * var8)); +- var9.addVertexWithUV((double)(var1 + 0), (double)(var2 + 0), (double)this.zLevel, (double)((float)(var3 + 0) * var7), (double)((float)(var4 + 0) * var8)); ++ var9.addVertexWithUV((double)(par1 + 0), (double)(par2 + par6), (double)this.zLevel, (double)((float)(par3 + 0) * var7), (double)((float)(par4 + par6) * var8)); ++ var9.addVertexWithUV((double)(par1 + par5), (double)(par2 + par6), (double)this.zLevel, (double)((float)(par3 + par5) * var7), (double)((float)(par4 + par6) * var8)); ++ var9.addVertexWithUV((double)(par1 + par5), (double)(par2 + 0), (double)this.zLevel, (double)((float)(par3 + par5) * var7), (double)((float)(par4 + 0) * var8)); ++ var9.addVertexWithUV((double)(par1 + 0), (double)(par2 + 0), (double)this.zLevel, (double)((float)(par3 + 0) * var7), (double)((float)(par4 + 0) * var8)); + var9.draw(); + } + +- public void drawTexturedModelRectFromIcon(int var1, int var2, Icon var3, int var4, int var5) { ++ public void drawTexturedModelRectFromIcon(int par1, int par2, Icon par3Icon, int par4, int par5) { + Tessellator var6 = Tessellator.instance; + var6.startDrawingQuads(); +- var6.addVertexWithUV((double)(var1 + 0), (double)(var2 + var5), (double)this.zLevel, (double)var3.getMinU(), (double)var3.getMaxV()); +- var6.addVertexWithUV((double)(var1 + var4), (double)(var2 + var5), (double)this.zLevel, (double)var3.getMaxU(), (double)var3.getMaxV()); +- var6.addVertexWithUV((double)(var1 + var4), (double)(var2 + 0), (double)this.zLevel, (double)var3.getMaxU(), (double)var3.getMinV()); +- var6.addVertexWithUV((double)(var1 + 0), (double)(var2 + 0), (double)this.zLevel, (double)var3.getMinU(), (double)var3.getMinV()); ++ var6.addVertexWithUV((double)(par1 + 0), (double)(par2 + par5), (double)this.zLevel, (double)par3Icon.getMinU(), (double)par3Icon.getMaxV()); ++ var6.addVertexWithUV((double)(par1 + par4), (double)(par2 + par5), (double)this.zLevel, (double)par3Icon.getMaxU(), (double)par3Icon.getMaxV()); ++ var6.addVertexWithUV((double)(par1 + par4), (double)(par2 + 0), (double)this.zLevel, (double)par3Icon.getMaxU(), (double)par3Icon.getMinV()); ++ var6.addVertexWithUV((double)(par1 + 0), (double)(par2 + 0), (double)this.zLevel, (double)par3Icon.getMinU(), (double)par3Icon.getMinV()); + var6.draw(); + } + } diff --git a/patches/net/minecraft/src/GuiAchievement.java.patch b/patches/net/minecraft/src/GuiAchievement.java.patch new file mode 100644 index 0000000..e6e4286 --- /dev/null +++ b/patches/net/minecraft/src/GuiAchievement.java.patch @@ -0,0 +1,187 @@ +--- net/minecraft/src/GuiAchievement.java ++++ net/minecraft/src/GuiAchievement.java +@@ -5,37 +5,82 @@ + + public class GuiAchievement extends Gui { + private static final ResourceLocation achievementTextures = new ResourceLocation("textures/gui/achievement/achievement_background.png"); ++ ++ /** Holds the instance of the game (Minecraft) */ + private Minecraft theGame; ++ ++ /** Holds the latest width scaled to fit the game window. */ + private int achievementWindowWidth; ++ ++ /** Holds the latest height scaled to fit the game window. */ + private int achievementWindowHeight; +- private String e; +- private String f; ++ private String achievementGetLocalText; ++ private String achievementStatName; ++ ++ /** Holds the achievement that will be displayed on the GUI. */ + private Achievement theAchievement; + private long achievementTime; ++ ++ /** ++ * Holds a instance of RenderItem, used to draw the achievement icons on screen (is based on ItemStack) ++ */ + private RenderItem itemRender; + private boolean haveAchiement; ++ // Spout Start ++ private boolean customNotification = false; ++ private int itemId; ++ private short data = -1; ++ private int time = -1; ++ // Spout End + +- public GuiAchievement(Minecraft var1) { +- this.theGame = var1; ++ public GuiAchievement(Minecraft par1Minecraft) { ++ this.theGame = par1Minecraft; + this.itemRender = new RenderItem(); + } + +- public void queueTakenAchievement(Achievement var1) { +- this.e = I18n.getString("achievement.get"); +- this.f = I18n.getString(var1.getName()); ++ /** ++ * Queue a taken achievement to be displayed. ++ */ ++ public void queueTakenAchievement(Achievement par1Achievement) { ++ this.achievementGetLocalText = I18n.getString("achievement.get"); ++ this.achievementStatName = I18n.getString(par1Achievement.getName()); + this.achievementTime = Minecraft.getSystemTime(); +- this.theAchievement = var1; ++ this.theAchievement = par1Achievement; + this.haveAchiement = false; + } + +- public void queueAchievementInformation(Achievement var1) { +- this.e = I18n.getString(var1.getName()); +- this.f = var1.getDescription(); ++ /** ++ * Queue a information about a achievement to be displayed. ++ */ ++ public void queueAchievementInformation(Achievement par1Achievement) { ++ this.achievementGetLocalText = I18n.getString(par1Achievement.getName()); ++ this.achievementStatName = par1Achievement.getDescription(); + this.achievementTime = Minecraft.getSystemTime() - 2500L; +- this.theAchievement = var1; ++ this.theAchievement = par1Achievement; + this.haveAchiement = true; + } +- ++ ++ // Spout Start ++ public void queueNotification(String title, String message, int toRender) { ++ queueNotification(title, message, toRender, (short) -1, -1); ++ } ++ ++ public void queueNotification(String title, String message, int toRender, short data, int time) { ++ achievementGetLocalText = title; ++ achievementStatName = message; ++ achievementTime = Minecraft.getSystemTime(); ++ theAchievement = null; ++ haveAchiement = false; ++ customNotification = true; ++ this.itemId = toRender; ++ this.time = time; ++ this.data = data; ++ } ++ // Spout End ++ ++ /** ++ * Update the display of the achievement window to match the game window. ++ */ + private void updateAchievementWindowScale() { + GL11.glViewport(0, 0, this.theGame.displayWidth, this.theGame.displayHeight); + GL11.glMatrixMode(GL11.GL_PROJECTION); +@@ -56,21 +101,39 @@ + GL11.glTranslatef(0.0F, 0.0F, -2000.0F); + } + ++ /** ++ * Updates the small achievement tooltip window, showing a queued achievement if is needed. ++ */ + public void updateAchievementWindow() { +- if(this.theAchievement != null && this.achievementTime != 0L) { +- double var1 = (double)(Minecraft.getSystemTime() - this.achievementTime) / 3000.0D; +- if(this.haveAchiement || var1 >= 0.0D && var1 <= 1.0D) { ++ // Spout Start ++ if ((this.theAchievement != null || this.customNotification == true) && this.achievementTime != 0L) { ++ double delayTime = 3000.0D; ++ if (customNotification) { ++ if (time < 1) { ++ delayTime = 7500; ++ } else { ++ delayTime = time; ++ } ++ } ++ double var1 = (double)(Minecraft.getSystemTime() - this.achievementTime) / delayTime; ++ // Spout End ++ ++ if (!this.haveAchiement && (var1 < 0.0D || var1 > 1.0D)) { ++ this.achievementTime = 0L; ++ } else { + this.updateAchievementWindowScale(); + GL11.glDisable(GL11.GL_DEPTH_TEST); + GL11.glDepthMask(false); + double var3 = var1 * 2.0D; +- if(var3 > 1.0D) { ++ ++ if (var3 > 1.0D) { + var3 = 2.0D - var3; + } + + var3 *= 4.0D; + var3 = 1.0D - var3; +- if(var3 < 0.0D) { ++ ++ if (var3 < 0.0D) { + var3 = 0.0D; + } + +@@ -83,11 +146,12 @@ + this.theGame.getTextureManager().bindTexture(achievementTextures); + GL11.glDisable(GL11.GL_LIGHTING); + this.drawTexturedModalRect(var5, var6, 96, 202, 160, 32); +- if(this.haveAchiement) { +- this.theGame.fontRenderer.drawSplitString(this.f, var5 + 30, var6 + 7, 120, -1); ++ ++ if (this.haveAchiement) { ++ this.theGame.fontRenderer.drawSplitString(this.achievementStatName, var5 + 30, var6 + 7, 120, -1); + } else { +- this.theGame.fontRenderer.drawString(this.e, var5 + 30, var6 + 7, -256); +- this.theGame.fontRenderer.drawString(this.f, var5 + 30, var6 + 18, -1); ++ this.theGame.fontRenderer.drawString(this.achievementGetLocalText, var5 + 30, var6 + 7, -256); ++ this.theGame.fontRenderer.drawString(this.achievementStatName, var5 + 30, var6 + 18, -1); + } + + RenderHelper.enableGUIStandardItemLighting(); +@@ -95,12 +159,23 @@ + GL11.glEnable(GL12.GL_RESCALE_NORMAL); + GL11.glEnable(GL11.GL_COLOR_MATERIAL); + GL11.glEnable(GL11.GL_LIGHTING); +- this.itemRender.renderItemAndEffectIntoGUI(this.theGame.fontRenderer, this.theGame.getTextureManager(), this.theAchievement.theItemStack, var5 + 8, var6 + 8); ++ // Spout Start ++ ItemStack toRender = theAchievement != null ? theAchievement.theItemStack : null; ++ if (customNotification){ ++ if (data < 1) { ++ toRender = new ItemStack(itemId, 1, 0); ++ } else { ++ toRender = new ItemStack(itemId, 1, data); ++ } ++ } ++ ++ if (toRender != null) { ++ this.itemRender.renderItemAndEffectIntoGUI(this.theGame.fontRenderer, this.theGame.getTextureManager(), toRender, var5 + 8, var6 + 8); ++ } ++ // Spout End + GL11.glDisable(GL11.GL_LIGHTING); + GL11.glDepthMask(true); + GL11.glEnable(GL11.GL_DEPTH_TEST); +- } else { +- this.achievementTime = 0L; + } + } + } diff --git a/patches/net/minecraft/src/GuiAchievements.java.patch b/patches/net/minecraft/src/GuiAchievements.java.patch new file mode 100644 index 0000000..cd7f47e --- /dev/null +++ b/patches/net/minecraft/src/GuiAchievements.java.patch @@ -0,0 +1,457 @@ +--- net/minecraft/src/GuiAchievements.java ++++ net/minecraft/src/GuiAchievements.java +@@ -6,89 +6,119 @@ + import org.lwjgl.opengl.GL12; + + public class GuiAchievements extends GuiScreen { ++ ++ /** The top x coordinate of the achievement map */ + private static final int guiMapTop = AchievementList.minDisplayColumn * 24 - 112; ++ ++ /** The left y coordinate of the achievement map */ + private static final int guiMapLeft = AchievementList.minDisplayRow * 24 - 112; ++ ++ /** The bottom x coordinate of the achievement map */ + private static final int guiMapBottom = AchievementList.maxDisplayColumn * 24 - 77; ++ ++ /** The right y coordinate of the achievement map */ + private static final int guiMapRight = AchievementList.maxDisplayRow * 24 - 77; + private static final ResourceLocation achievementTextures = new ResourceLocation("textures/gui/achievement/achievement_background.png"); + protected int achievementsPaneWidth = 256; + protected int achievementsPaneHeight = 202; ++ ++ /** The current mouse x coordinate */ + protected int mouseX; ++ ++ /** The current mouse y coordinate */ + protected int mouseY; + protected double field_74117_m; + protected double field_74115_n; ++ ++ /** The x position of the achievement map */ + protected double guiMapX; ++ ++ /** The y position of the achievement map */ + protected double guiMapY; + protected double field_74124_q; + protected double field_74123_r; ++ ++ /** Whether the Mouse Button is down or not */ + private int isMouseButtonDown; + private StatFileWriter statFileWriter; + +- public GuiAchievements(StatFileWriter var1) { +- this.statFileWriter = var1; ++ public GuiAchievements(StatFileWriter par1StatFileWriter) { ++ this.statFileWriter = par1StatFileWriter; + short var2 = 141; + short var3 = 141; + this.field_74117_m = this.guiMapX = this.field_74124_q = (double)(AchievementList.openInventory.displayColumn * 24 - var2 / 2 - 12); + this.field_74115_n = this.guiMapY = this.field_74123_r = (double)(AchievementList.openInventory.displayRow * 24 - var3 / 2); + } + ++ /** ++ * Adds the buttons (and other controls) to the screen in question. ++ */ + public void initGui() { +- this.i.clear(); +- this.i.add(new GuiSmallButton(1, this.width / 2 + 24, this.height / 2 + 74, 80, 20, I18n.getString("gui.done"))); ++ this.buttonList.clear(); ++ this.buttonList.add(new GuiSmallButton(1, this.width / 2 + 24, this.height / 2 + 74, 80, 20, I18n.getString("gui.done"))); + } + +- protected void actionPerformed(GuiButton var1) { +- if(var1.id == 1) { ++ /** ++ * Fired when a control is clicked. This is the equivalent of ActionListener.actionPerformed(ActionEvent e). ++ */ ++ protected void actionPerformed(GuiButton par1GuiButton) { ++ if (par1GuiButton.id == 1) { + this.mc.displayGuiScreen((GuiScreen)null); + this.mc.setIngameFocus(); + } + +- super.actionPerformed(var1); ++ super.actionPerformed(par1GuiButton); + } + +- protected void keyTyped(char var1, int var2) { +- if(var2 == this.mc.gameSettings.keyBindInventory.keyCode) { ++ /** ++ * Fired when a key is typed. This is the equivalent of KeyListener.keyTyped(KeyEvent e). ++ */ ++ protected void keyTyped(char par1, int par2) { ++ if (par2 == this.mc.gameSettings.keyBindInventory.keyCode) { + this.mc.displayGuiScreen((GuiScreen)null); + this.mc.setIngameFocus(); + } else { +- super.keyTyped(var1, var2); ++ super.keyTyped(par1, par2); + } +- + } + +- public void drawScreen(int var1, int var2, float var3) { +- if(Mouse.isButtonDown(0)) { ++ /** ++ * Draws the screen and all the components in it. ++ */ ++ public void drawScreen(int par1, int par2, float par3) { ++ if (Mouse.isButtonDown(0)) { + int var4 = (this.width - this.achievementsPaneWidth) / 2; + int var5 = (this.height - this.achievementsPaneHeight) / 2; + int var6 = var4 + 8; + int var7 = var5 + 17; +- if((this.isMouseButtonDown == 0 || this.isMouseButtonDown == 1) && var1 >= var6 && var1 < var6 + 224 && var2 >= var7 && var2 < var7 + 155) { +- if(this.isMouseButtonDown == 0) { ++ ++ if ((this.isMouseButtonDown == 0 || this.isMouseButtonDown == 1) && par1 >= var6 && par1 < var6 + 224 && par2 >= var7 && par2 < var7 + 155) { ++ if (this.isMouseButtonDown == 0) { + this.isMouseButtonDown = 1; + } else { +- this.guiMapX -= (double)(var1 - this.mouseX); +- this.guiMapY -= (double)(var2 - this.mouseY); ++ this.guiMapX -= (double)(par1 - this.mouseX); ++ this.guiMapY -= (double)(par2 - this.mouseY); + this.field_74124_q = this.field_74117_m = this.guiMapX; + this.field_74123_r = this.field_74115_n = this.guiMapY; + } + +- this.mouseX = var1; +- this.mouseY = var2; ++ this.mouseX = par1; ++ this.mouseY = par2; + } + +- if(this.field_74124_q < (double)guiMapTop) { ++ if (this.field_74124_q < (double)guiMapTop) { + this.field_74124_q = (double)guiMapTop; + } + +- if(this.field_74123_r < (double)guiMapLeft) { ++ if (this.field_74123_r < (double)guiMapLeft) { + this.field_74123_r = (double)guiMapLeft; + } + +- if(this.field_74124_q >= (double)guiMapBottom) { ++ if (this.field_74124_q >= (double)guiMapBottom) { + this.field_74124_q = (double)(guiMapBottom - 1); + } + +- if(this.field_74123_r >= (double)guiMapRight) { ++ if (this.field_74123_r >= (double)guiMapRight) { + this.field_74123_r = (double)(guiMapRight - 1); + } + } else { +@@ -96,7 +126,7 @@ + } + + this.drawDefaultBackground(); +- this.genAchievementBackground(var1, var2, var3); ++ this.genAchievementBackground(par1, par2, par3); + GL11.glDisable(GL11.GL_LIGHTING); + GL11.glDisable(GL11.GL_DEPTH_TEST); + this.drawTitle(); +@@ -104,43 +134,50 @@ + GL11.glEnable(GL11.GL_DEPTH_TEST); + } + ++ /** ++ * Called from the main game loop to update the screen. ++ */ + public void updateScreen() { + this.field_74117_m = this.guiMapX; + this.field_74115_n = this.guiMapY; + double var1 = this.field_74124_q - this.guiMapX; + double var3 = this.field_74123_r - this.guiMapY; +- if(var1 * var1 + var3 * var3 < 4.0D) { ++ ++ if (var1 * var1 + var3 * var3 < 4.0D) { + this.guiMapX += var1; + this.guiMapY += var3; + } else { + this.guiMapX += var1 * 0.85D; + this.guiMapY += var3 * 0.85D; + } +- + } + ++ /** ++ * Draws the "Achievements" title at the top of the GUI. ++ */ + protected void drawTitle() { + int var1 = (this.width - this.achievementsPaneWidth) / 2; + int var2 = (this.height - this.achievementsPaneHeight) / 2; + this.fontRenderer.drawString("Achievements", var1 + 15, var2 + 5, 4210752); + } + +- protected void genAchievementBackground(int var1, int var2, float var3) { +- int var4 = MathHelper.floor_double(this.field_74117_m + (this.guiMapX - this.field_74117_m) * (double)var3); +- int var5 = MathHelper.floor_double(this.field_74115_n + (this.guiMapY - this.field_74115_n) * (double)var3); +- if(var4 < guiMapTop) { ++ protected void genAchievementBackground(int par1, int par2, float par3) { ++ int var4 = MathHelper.floor_double(this.field_74117_m + (this.guiMapX - this.field_74117_m) * (double)par3); ++ int var5 = MathHelper.floor_double(this.field_74115_n + (this.guiMapY - this.field_74115_n) * (double)par3); ++ ++ if (var4 < guiMapTop) { + var4 = guiMapTop; + } + +- if(var5 < guiMapLeft) { ++ if (var5 < guiMapLeft) { + var5 = guiMapLeft; + } + +- if(var4 >= guiMapBottom) { ++ if (var4 >= guiMapBottom) { + var4 = guiMapBottom - 1; + } + +- if(var5 >= guiMapRight) { ++ if (var5 >= guiMapRight) { + var5 = guiMapRight - 1; + } + +@@ -166,33 +203,34 @@ + boolean var17 = true; + boolean var18 = true; + Random var19 = new Random(); +- + int var20; +- int var22; + int var23; +- for(var20 = 0; var20 * 16 - var13 < 155; ++var20) { ++ int var22; ++ ++ for (var20 = 0; var20 * 16 - var13 < 155; ++var20) { + float var21 = 0.6F - (float)(var11 + var20) / 25.0F * 0.3F; + GL11.glColor4f(var21, var21, var21, 1.0F); + +- for(var22 = 0; var22 * 16 - var12 < 224; ++var22) { ++ for (var22 = 0; var22 * 16 - var12 < 224; ++var22) { + var19.setSeed((long)(1234 + var10 + var22)); + var19.nextInt(); + var23 = var19.nextInt(1 + var11 + var20) + (var11 + var20) / 2; + Icon var24 = Block.sand.getIcon(0, 0); +- if(var23 <= 37 && var11 + var20 != 35) { +- if(var23 == 22) { +- if(var19.nextInt(2) == 0) { ++ ++ if (var23 <= 37 && var11 + var20 != 35) { ++ if (var23 == 22) { ++ if (var19.nextInt(2) == 0) { + var24 = Block.oreDiamond.getIcon(0, 0); + } else { + var24 = Block.oreRedstone.getIcon(0, 0); + } +- } else if(var23 == 10) { ++ } else if (var23 == 10) { + var24 = Block.oreIron.getIcon(0, 0); +- } else if(var23 == 8) { ++ } else if (var23 == 8) { + var24 = Block.oreCoal.getIcon(0, 0); +- } else if(var23 > 4) { ++ } else if (var23 > 4) { + var24 = Block.stone.getIcon(0, 0); +- } else if(var23 > 0) { ++ } else if (var23 > 0) { + var24 = Block.dirt.getIcon(0, 0); + } + } else { +@@ -207,29 +245,31 @@ + GL11.glEnable(GL11.GL_DEPTH_TEST); + GL11.glDepthFunc(GL11.GL_LEQUAL); + GL11.glDisable(GL11.GL_TEXTURE_2D); +- + int var25; + int var28; +- int var37; +- for(var20 = 0; var20 < AchievementList.e.size(); ++var20) { +- Achievement var31 = (Achievement)AchievementList.e.get(var20); +- if(var31.parentAchievement != null) { ++ int var41; ++ ++ for (var20 = 0; var20 < AchievementList.achievementList.size(); ++var20) { ++ Achievement var31 = (Achievement)AchievementList.achievementList.get(var20); ++ ++ if (var31.parentAchievement != null) { + var22 = var31.displayColumn * 24 - var4 + 11 + var8; + var23 = var31.displayRow * 24 - var5 + 11 + var9; +- var37 = var31.parentAchievement.displayColumn * 24 - var4 + 11 + var8; ++ var41 = var31.parentAchievement.displayColumn * 24 - var4 + 11 + var8; + var25 = var31.parentAchievement.displayRow * 24 - var5 + 11 + var9; + boolean var26 = this.statFileWriter.hasAchievementUnlocked(var31); + boolean var27 = this.statFileWriter.canUnlockAchievement(var31); + var28 = Math.sin((double)(Minecraft.getSystemTime() % 600L) / 600.0D * Math.PI * 2.0D) > 0.6D ? 255 : 130; + int var29 = -16777216; +- if(var26) { ++ ++ if (var26) { + var29 = -9408400; +- } else if(var27) { +- var29 = '\uff00' + (var28 << 24); ++ } else if (var27) { ++ var29 = 65280 + (var28 << 24); + } + +- this.drawHorizontalLine(var22, var37, var23, var29); +- this.drawVerticalLine(var37, var23, var25, var29); ++ this.drawHorizontalLine(var22, var41, var23, var29); ++ this.drawVerticalLine(var41, var23, var25, var29); + } + } + +@@ -239,52 +279,57 @@ + GL11.glDisable(GL11.GL_LIGHTING); + GL11.glEnable(GL12.GL_RESCALE_NORMAL); + GL11.glEnable(GL11.GL_COLOR_MATERIAL); +- +- int var38; + int var39; +- for(var22 = 0; var22 < AchievementList.e.size(); ++var22) { +- Achievement var33 = (Achievement)AchievementList.e.get(var22); +- var37 = var33.displayColumn * 24 - var4; +- var25 = var33.displayRow * 24 - var5; +- if(var37 >= -24 && var25 >= -24 && var37 <= 224 && var25 <= 155) { +- float var36; +- if(this.statFileWriter.hasAchievementUnlocked(var33)) { +- var36 = 1.0F; +- GL11.glColor4f(var36, var36, var36, 1.0F); +- } else if(this.statFileWriter.canUnlockAchievement(var33)) { +- var36 = Math.sin((double)(Minecraft.getSystemTime() % 600L) / 600.0D * Math.PI * 2.0D) < 0.6D ? 0.6F : 0.8F; +- GL11.glColor4f(var36, var36, var36, 1.0F); ++ int var40; ++ ++ for (var22 = 0; var22 < AchievementList.achievementList.size(); ++var22) { ++ Achievement var34 = (Achievement)AchievementList.achievementList.get(var22); ++ var41 = var34.displayColumn * 24 - var4; ++ var25 = var34.displayRow * 24 - var5; ++ ++ if (var41 >= -24 && var25 >= -24 && var41 <= 224 && var25 <= 155) { ++ float var38; ++ ++ if (this.statFileWriter.hasAchievementUnlocked(var34)) { ++ var38 = 1.0F; ++ GL11.glColor4f(var38, var38, var38, 1.0F); ++ } else if (this.statFileWriter.canUnlockAchievement(var34)) { ++ var38 = Math.sin((double)(Minecraft.getSystemTime() % 600L) / 600.0D * Math.PI * 2.0D) < 0.6D ? 0.6F : 0.8F; ++ GL11.glColor4f(var38, var38, var38, 1.0F); + } else { +- var36 = 0.3F; +- GL11.glColor4f(var36, var36, var36, 1.0F); ++ var38 = 0.3F; ++ GL11.glColor4f(var38, var38, var38, 1.0F); + } + + this.mc.getTextureManager().bindTexture(achievementTextures); +- var38 = var8 + var37; ++ var40 = var8 + var41; + var39 = var9 + var25; +- if(var33.getSpecial()) { +- this.drawTexturedModalRect(var38 - 2, var39 - 2, 26, 202, 26, 26); ++ ++ if (var34.getSpecial()) { ++ this.drawTexturedModalRect(var40 - 2, var39 - 2, 26, 202, 26, 26); + } else { +- this.drawTexturedModalRect(var38 - 2, var39 - 2, 0, 202, 26, 26); ++ this.drawTexturedModalRect(var40 - 2, var39 - 2, 0, 202, 26, 26); + } + +- if(!this.statFileWriter.canUnlockAchievement(var33)) { +- float var40 = 0.1F; +- GL11.glColor4f(var40, var40, var40, 1.0F); ++ if (!this.statFileWriter.canUnlockAchievement(var34)) { ++ float var37 = 0.1F; ++ GL11.glColor4f(var37, var37, var37, 1.0F); + var32.renderWithColor = false; + } + + GL11.glEnable(GL11.GL_LIGHTING); + GL11.glEnable(GL11.GL_CULL_FACE); +- var32.renderItemAndEffectIntoGUI(this.mc.fontRenderer, this.mc.getTextureManager(), var33.theItemStack, var38 + 3, var39 + 3); ++ var32.renderItemAndEffectIntoGUI(this.mc.fontRenderer, this.mc.getTextureManager(), var34.theItemStack, var40 + 3, var39 + 3); + GL11.glDisable(GL11.GL_LIGHTING); +- if(!this.statFileWriter.canUnlockAchievement(var33)) { ++ ++ if (!this.statFileWriter.canUnlockAchievement(var34)) { + var32.renderWithColor = true; + } + + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); +- if(var1 >= var8 && var2 >= var9 && var1 < var8 + 224 && var2 < var9 + 155 && var1 >= var38 && var1 <= var38 + 22 && var2 >= var39 && var2 <= var39 + 22) { +- var30 = var33; ++ ++ if (par1 >= var8 && par2 >= var9 && par1 < var8 + 224 && par2 < var9 + 155 && par1 >= var40 && par1 <= var40 + 22 && par2 >= var39 && par2 <= var39 + 22) { ++ var30 = var34; + } + } + } +@@ -299,40 +344,48 @@ + GL11.glDepthFunc(GL11.GL_LEQUAL); + GL11.glDisable(GL11.GL_DEPTH_TEST); + GL11.glEnable(GL11.GL_TEXTURE_2D); +- super.drawScreen(var1, var2, var3); +- if(var30 != null) { +- String var34 = I18n.getString(var30.getName()); ++ super.drawScreen(par1, par2, par3); ++ ++ if (var30 != null) { ++ String var33 = I18n.getString(var30.getName()); + String var35 = var30.getDescription(); +- var37 = var1 + 12; +- var25 = var2 - 4; +- if(this.statFileWriter.canUnlockAchievement(var30)) { +- var38 = Math.max(this.fontRenderer.getStringWidth(var34), 120); +- var39 = this.fontRenderer.splitStringWidth(var35, var38); +- if(this.statFileWriter.hasAchievementUnlocked(var30)) { ++ var41 = par1 + 12; ++ var25 = par2 - 4; ++ ++ if (this.statFileWriter.canUnlockAchievement(var30)) { ++ var40 = Math.max(this.fontRenderer.getStringWidth(var33), 120); ++ var39 = this.fontRenderer.splitStringWidth(var35, var40); ++ ++ if (this.statFileWriter.hasAchievementUnlocked(var30)) { + var39 += 12; + } + +- this.drawGradientRect(var37 - 3, var25 - 3, var37 + var38 + 3, var25 + var39 + 3 + 12, -1073741824, -1073741824); +- this.fontRenderer.drawSplitString(var35, var37, var25 + 12, var38, -6250336); +- if(this.statFileWriter.hasAchievementUnlocked(var30)) { +- this.fontRenderer.drawStringWithShadow(I18n.getString("achievement.taken"), var37, var25 + var39 + 4, -7302913); ++ this.drawGradientRect(var41 - 3, var25 - 3, var41 + var40 + 3, var25 + var39 + 3 + 12, -1073741824, -1073741824); ++ this.fontRenderer.drawSplitString(var35, var41, var25 + 12, var40, -6250336); ++ ++ if (this.statFileWriter.hasAchievementUnlocked(var30)) { ++ this.fontRenderer.drawStringWithShadow(I18n.getString("achievement.taken"), var41, var25 + var39 + 4, -7302913); + } + } else { +- var38 = Math.max(this.fontRenderer.getStringWidth(var34), 120); +- String var41 = I18n.getStringParams("achievement.requires", new Object[]{I18n.getString(var30.parentAchievement.getName())}); +- var28 = this.fontRenderer.splitStringWidth(var41, var38); +- this.drawGradientRect(var37 - 3, var25 - 3, var37 + var38 + 3, var25 + var28 + 12 + 3, -1073741824, -1073741824); +- this.fontRenderer.drawSplitString(var41, var37, var25 + 12, var38, -9416624); ++ var40 = Math.max(this.fontRenderer.getStringWidth(var33), 120); ++ String var36 = I18n.getStringParams("achievement.requires", new Object[] {I18n.getString(var30.parentAchievement.getName())}); ++ var28 = this.fontRenderer.splitStringWidth(var36, var40); ++ this.drawGradientRect(var41 - 3, var25 - 3, var41 + var40 + 3, var25 + var28 + 12 + 3, -1073741824, -1073741824); ++ this.fontRenderer.drawSplitString(var36, var41, var25 + 12, var40, -9416624); + } + +- this.fontRenderer.drawStringWithShadow(var34, var37, var25, this.statFileWriter.canUnlockAchievement(var30) ? (var30.getSpecial() ? -128 : -1) : (var30.getSpecial() ? -8355776 : -8355712)); ++ this.fontRenderer.drawStringWithShadow(var33, var41, var25, this.statFileWriter.canUnlockAchievement(var30) ? (var30.getSpecial() ? -128 : -1) : (var30.getSpecial() ? -8355776 : -8355712)); + } + + GL11.glEnable(GL11.GL_DEPTH_TEST); + GL11.glEnable(GL11.GL_LIGHTING); +- RenderHelper.disableStandardItemLighting(); ++ // Spout Removed - This is how you fix stuff by implementing stupidity. ++ //RenderHelper.disableStandardItemLighting(); + } + ++ /** ++ * Returns true if this GUI should pause the game when it is displayed in single-player ++ */ + public boolean doesGuiPauseGame() { + return true; + } diff --git a/patches/net/minecraft/src/GuiBeacon.java.patch b/patches/net/minecraft/src/GuiBeacon.java.patch new file mode 100644 index 0000000..2849168 --- /dev/null +++ b/patches/net/minecraft/src/GuiBeacon.java.patch @@ -0,0 +1,181 @@ +--- net/minecraft/src/GuiBeacon.java ++++ net/minecraft/src/GuiBeacon.java +@@ -11,42 +11,50 @@ + private GuiBeaconButtonConfirm beaconConfirmButton; + private boolean buttonsNotDrawn; + +- public GuiBeacon(InventoryPlayer var1, TileEntityBeacon var2) { +- super(new ContainerBeacon(var1, var2)); +- this.beacon = var2; ++ public GuiBeacon(InventoryPlayer par1InventoryPlayer, TileEntityBeacon par2TileEntityBeacon) { ++ super(new ContainerBeacon(par1InventoryPlayer, par2TileEntityBeacon)); ++ this.beacon = par2TileEntityBeacon; + this.xSize = 230; + this.ySize = 219; + } + ++ /** ++ * Adds the buttons (and other controls) to the screen in question. ++ */ + public void initGui() { + super.initGui(); +- this.i.add(this.beaconConfirmButton = new GuiBeaconButtonConfirm(this, -1, this.guiLeft + 164, this.guiTop + 107)); +- this.i.add(new GuiBeaconButtonCancel(this, -2, this.guiLeft + 190, this.guiTop + 107)); ++ this.buttonList.add(this.beaconConfirmButton = new GuiBeaconButtonConfirm(this, -1, this.guiLeft + 164, this.guiTop + 107)); ++ this.buttonList.add(new GuiBeaconButtonCancel(this, -2, this.guiLeft + 190, this.guiTop + 107)); + this.buttonsNotDrawn = true; + this.beaconConfirmButton.enabled = false; + } + ++ /** ++ * Called from the main game loop to update the screen. ++ */ + public void updateScreen() { + super.updateScreen(); +- if(this.buttonsNotDrawn && this.beacon.getLevels() >= 0) { ++ ++ if (this.buttonsNotDrawn && this.beacon.getLevels() >= 0) { + this.buttonsNotDrawn = false; +- + int var2; + int var3; + int var4; + int var5; + GuiBeaconButtonPower var6; +- for(int var1 = 0; var1 <= 2; ++var1) { ++ ++ for (int var1 = 0; var1 <= 2; ++var1) { + var2 = TileEntityBeacon.effectsList[var1].length; + var3 = var2 * 22 + (var2 - 1) * 2; + +- for(var4 = 0; var4 < var2; ++var4) { ++ for (var4 = 0; var4 < var2; ++var4) { + var5 = TileEntityBeacon.effectsList[var1][var4].id; + var6 = new GuiBeaconButtonPower(this, var1 << 8 | var5, this.guiLeft + 76 + var4 * 24 - var3 / 2, this.guiTop + 22 + var1 * 25, var5, var1); +- this.i.add(var6); +- if(var1 >= this.beacon.getLevels()) { ++ this.buttonList.add(var6); ++ ++ if (var1 >= this.beacon.getLevels()) { + var6.enabled = false; +- } else if(var5 == this.beacon.getPrimaryEffect()) { ++ } else if (var5 == this.beacon.getPrimaryEffect()) { + var6.func_82254_b(true); + } + } +@@ -56,23 +64,25 @@ + var2 = TileEntityBeacon.effectsList[var7].length + 1; + var3 = var2 * 22 + (var2 - 1) * 2; + +- for(var4 = 0; var4 < var2 - 1; ++var4) { ++ for (var4 = 0; var4 < var2 - 1; ++var4) { + var5 = TileEntityBeacon.effectsList[var7][var4].id; + var6 = new GuiBeaconButtonPower(this, var7 << 8 | var5, this.guiLeft + 167 + var4 * 24 - var3 / 2, this.guiTop + 47, var5, var7); +- this.i.add(var6); +- if(var7 >= this.beacon.getLevels()) { ++ this.buttonList.add(var6); ++ ++ if (var7 >= this.beacon.getLevels()) { + var6.enabled = false; +- } else if(var5 == this.beacon.getSecondaryEffect()) { ++ } else if (var5 == this.beacon.getSecondaryEffect()) { + var6.func_82254_b(true); + } + } + +- if(this.beacon.getPrimaryEffect() > 0) { ++ if (this.beacon.getPrimaryEffect() > 0) { + GuiBeaconButtonPower var8 = new GuiBeaconButtonPower(this, var7 << 8 | this.beacon.getPrimaryEffect(), this.guiLeft + 167 + (var2 - 1) * 24 - var3 / 2, this.guiTop + 47, this.beacon.getPrimaryEffect(), var7); +- this.i.add(var8); +- if(var7 >= this.beacon.getLevels()) { ++ this.buttonList.add(var8); ++ ++ if (var7 >= this.beacon.getLevels()) { + var8.enabled = false; +- } else if(this.beacon.getPrimaryEffect() == this.beacon.getSecondaryEffect()) { ++ } else if (this.beacon.getPrimaryEffect() == this.beacon.getSecondaryEffect()) { + var8.func_82254_b(true); + } + } +@@ -81,10 +91,13 @@ + this.beaconConfirmButton.enabled = this.beacon.getStackInSlot(0) != null && this.beacon.getPrimaryEffect() > 0; + } + +- protected void actionPerformed(GuiButton var1) { +- if(var1.id == -2) { ++ /** ++ * Fired when a control is clicked. This is the equivalent of ActionListener.actionPerformed(ActionEvent e). ++ */ ++ protected void actionPerformed(GuiButton par1GuiButton) { ++ if (par1GuiButton.id == -2) { + this.mc.displayGuiScreen((GuiScreen)null); +- } else if(var1.id == -1) { ++ } else if (par1GuiButton.id == -1) { + String var2 = "MC|Beacon"; + ByteArrayOutputStream var3 = new ByteArrayOutputStream(); + DataOutputStream var4 = new DataOutputStream(var3); +@@ -98,37 +111,41 @@ + } + + this.mc.displayGuiScreen((GuiScreen)null); +- } else if(var1 instanceof GuiBeaconButtonPower) { +- if(((GuiBeaconButtonPower)var1).func_82255_b()) { ++ } else if (par1GuiButton instanceof GuiBeaconButtonPower) { ++ if (((GuiBeaconButtonPower)par1GuiButton).func_82255_b()) { + return; + } + +- int var7 = var1.id; ++ int var7 = par1GuiButton.id; + int var8 = var7 & 255; + int var9 = var7 >> 8; +- if(var9 < 3) { ++ ++ if (var9 < 3) { + this.beacon.setPrimaryEffect(var8); + } else { + this.beacon.setSecondaryEffect(var8); + } + +- this.i.clear(); ++ this.buttonList.clear(); + this.initGui(); + this.updateScreen(); + } +- + } + +- protected void drawGuiContainerForegroundLayer(int var1, int var2) { ++ /** ++ * Draw the foreground layer for the GuiContainer (everything in front of the items) ++ */ ++ protected void drawGuiContainerForegroundLayer(int par1, int par2) { + RenderHelper.disableStandardItemLighting(); + this.drawCenteredString(this.fontRenderer, I18n.getString("tile.beacon.primary"), 62, 10, 14737632); + this.drawCenteredString(this.fontRenderer, I18n.getString("tile.beacon.secondary"), 169, 10, 14737632); +- Iterator var3 = this.i.iterator(); ++ Iterator var3 = this.buttonList.iterator(); + +- while(var3.hasNext()) { ++ while (var3.hasNext()) { + GuiButton var4 = (GuiButton)var3.next(); +- if(var4.func_82252_a()) { +- var4.func_82251_b(var1 - this.guiLeft, var2 - this.guiTop); ++ ++ if (var4.func_82252_a()) { ++ var4.func_82251_b(par1 - this.guiLeft, par2 - this.guiTop); + break; + } + } +@@ -136,7 +153,10 @@ + RenderHelper.enableGUIStandardItemLighting(); + } + +- protected void drawGuiContainerBackgroundLayer(float var1, int var2, int var3) { ++ /** ++ * Draw the background layer for the GuiContainer (everything behind the items) ++ */ ++ protected void drawGuiContainerBackgroundLayer(float par1, int par2, int par3) { + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + this.mc.getTextureManager().bindTexture(beaconGuiTextures); + int var4 = (this.width - this.xSize) / 2; diff --git a/patches/net/minecraft/src/GuiBeaconButton.java.patch b/patches/net/minecraft/src/GuiBeaconButton.java.patch new file mode 100644 index 0000000..c7387f6 --- /dev/null +++ b/patches/net/minecraft/src/GuiBeaconButton.java.patch @@ -0,0 +1,70 @@ +--- net/minecraft/src/GuiBeaconButton.java ++++ net/minecraft/src/GuiBeaconButton.java +@@ -3,36 +3,43 @@ + import org.lwjgl.opengl.GL11; + + class GuiBeaconButton extends GuiButton { ++ ++ /** Texture for this button. */ + private final ResourceLocation buttonTexture; + private final int field_82257_l; + private final int field_82258_m; + private boolean field_82256_n; + +- protected GuiBeaconButton(int var1, int var2, int var3, ResourceLocation var4, int var5, int var6) { +- super(var1, var2, var3, 22, 22, ""); +- this.buttonTexture = var4; +- this.field_82257_l = var5; +- this.field_82258_m = var6; ++ protected GuiBeaconButton(int par1, int par2, int par3, ResourceLocation par4ResourceLocation, int par5, int par6) { ++ super(par1, par2, par3, 22, 22, ""); ++ this.buttonTexture = par4ResourceLocation; ++ this.field_82257_l = par5; ++ this.field_82258_m = par6; + } + +- public void drawButton(Minecraft var1, int var2, int var3) { +- if(this.drawButton) { +- var1.getTextureManager().bindTexture(GuiBeacon.getBeaconGuiTextures()); ++ /** ++ * Draws this button to the screen. ++ */ ++ public void drawButton(Minecraft par1Minecraft, int par2, int par3) { ++ if (this.drawButton) { ++ par1Minecraft.getTextureManager().bindTexture(GuiBeacon.getBeaconGuiTextures()); + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); +- this.field_82253_i = var2 >= this.xPosition && var3 >= this.yPosition && var2 < this.xPosition + this.width && var3 < this.yPosition + this.height; ++ this.field_82253_i = par2 >= this.xPosition && par3 >= this.yPosition && par2 < this.xPosition + this.width && par3 < this.yPosition + this.height; + short var4 = 219; + int var5 = 0; +- if(!this.enabled) { ++ ++ if (!this.enabled) { + var5 += this.width * 2; +- } else if(this.field_82256_n) { ++ } else if (this.field_82256_n) { + var5 += this.width * 1; +- } else if(this.field_82253_i) { ++ } else if (this.field_82253_i) { + var5 += this.width * 3; + } + + this.drawTexturedModalRect(this.xPosition, this.yPosition, var5, var4, this.width, this.height); +- if(!GuiBeacon.getBeaconGuiTextures().equals(this.buttonTexture)) { +- var1.getTextureManager().bindTexture(this.buttonTexture); ++ ++ if (!GuiBeacon.getBeaconGuiTextures().equals(this.buttonTexture)) { ++ par1Minecraft.getTextureManager().bindTexture(this.buttonTexture); + } + + this.drawTexturedModalRect(this.xPosition + 2, this.yPosition + 2, this.field_82257_l, this.field_82258_m, 18, 18); +@@ -43,7 +50,7 @@ + return this.field_82256_n; + } + +- public void func_82254_b(boolean var1) { +- this.field_82256_n = var1; ++ public void func_82254_b(boolean par1) { ++ this.field_82256_n = par1; + } + } diff --git a/patches/net/minecraft/src/GuiBeaconButtonCancel.java.patch b/patches/net/minecraft/src/GuiBeaconButtonCancel.java.patch new file mode 100644 index 0000000..a2db720 --- /dev/null +++ b/patches/net/minecraft/src/GuiBeaconButtonCancel.java.patch @@ -0,0 +1,24 @@ +--- net/minecraft/src/GuiBeaconButtonCancel.java ++++ net/minecraft/src/GuiBeaconButtonCancel.java +@@ -1,14 +1,16 @@ + package net.minecraft.src; + + class GuiBeaconButtonCancel extends GuiBeaconButton { ++ ++ /** Beacon GUI this button belongs to. */ + final GuiBeacon beaconGui; + +- public GuiBeaconButtonCancel(GuiBeacon var1, int var2, int var3, int var4) { +- super(var2, var3, var4, GuiBeacon.getBeaconGuiTextures(), 112, 220); +- this.beaconGui = var1; ++ public GuiBeaconButtonCancel(GuiBeacon par1GuiBeacon, int par2, int par3, int par4) { ++ super(par2, par3, par4, GuiBeacon.getBeaconGuiTextures(), 112, 220); ++ this.beaconGui = par1GuiBeacon; + } + +- public void func_82251_b(int var1, int var2) { +- this.beaconGui.drawCreativeTabHoveringText(I18n.getString("gui.cancel"), var1, var2); ++ public void func_82251_b(int par1, int par2) { ++ this.beaconGui.drawCreativeTabHoveringText(I18n.getString("gui.cancel"), par1, par2); + } + } diff --git a/patches/net/minecraft/src/GuiBeaconButtonConfirm.java.patch b/patches/net/minecraft/src/GuiBeaconButtonConfirm.java.patch new file mode 100644 index 0000000..2ef87f9 --- /dev/null +++ b/patches/net/minecraft/src/GuiBeaconButtonConfirm.java.patch @@ -0,0 +1,24 @@ +--- net/minecraft/src/GuiBeaconButtonConfirm.java ++++ net/minecraft/src/GuiBeaconButtonConfirm.java +@@ -1,14 +1,16 @@ + package net.minecraft.src; + + class GuiBeaconButtonConfirm extends GuiBeaconButton { ++ ++ /** Beacon GUI this button belongs to. */ + final GuiBeacon beaconGui; + +- public GuiBeaconButtonConfirm(GuiBeacon var1, int var2, int var3, int var4) { +- super(var2, var3, var4, GuiBeacon.getBeaconGuiTextures(), 90, 220); +- this.beaconGui = var1; ++ public GuiBeaconButtonConfirm(GuiBeacon par1GuiBeacon, int par2, int par3, int par4) { ++ super(par2, par3, par4, GuiBeacon.getBeaconGuiTextures(), 90, 220); ++ this.beaconGui = par1GuiBeacon; + } + +- public void func_82251_b(int var1, int var2) { +- this.beaconGui.drawCreativeTabHoveringText(I18n.getString("gui.done"), var1, var2); ++ public void func_82251_b(int par1, int par2) { ++ this.beaconGui.drawCreativeTabHoveringText(I18n.getString("gui.done"), par1, par2); + } + } diff --git a/patches/net/minecraft/src/GuiBeaconButtonPower.java.patch b/patches/net/minecraft/src/GuiBeaconButtonPower.java.patch new file mode 100644 index 0000000..461f6a4 --- /dev/null +++ b/patches/net/minecraft/src/GuiBeaconButtonPower.java.patch @@ -0,0 +1,35 @@ +--- net/minecraft/src/GuiBeaconButtonPower.java ++++ net/minecraft/src/GuiBeaconButtonPower.java +@@ -3,21 +3,24 @@ + class GuiBeaconButtonPower extends GuiBeaconButton { + private final int field_82261_l; + private final int field_82262_m; ++ ++ /** Beacon GUI this button belongs to. */ + final GuiBeacon beaconGui; + +- public GuiBeaconButtonPower(GuiBeacon var1, int var2, int var3, int var4, int var5, int var6) { +- super(var2, var3, var4, GuiContainer.field_110408_a, 0 + Potion.potionTypes[var5].getStatusIconIndex() % 8 * 18, 198 + Potion.potionTypes[var5].getStatusIconIndex() / 8 * 18); +- this.beaconGui = var1; +- this.field_82261_l = var5; +- this.field_82262_m = var6; ++ public GuiBeaconButtonPower(GuiBeacon par1GuiBeacon, int par2, int par3, int par4, int par5, int par6) { ++ super(par2, par3, par4, GuiContainer.field_110408_a, 0 + Potion.potionTypes[par5].getStatusIconIndex() % 8 * 18, 198 + Potion.potionTypes[par5].getStatusIconIndex() / 8 * 18); ++ this.beaconGui = par1GuiBeacon; ++ this.field_82261_l = par5; ++ this.field_82262_m = par6; + } + +- public void func_82251_b(int var1, int var2) { ++ public void func_82251_b(int par1, int par2) { + String var3 = I18n.getString(Potion.potionTypes[this.field_82261_l].getName()); +- if(this.field_82262_m >= 3 && this.field_82261_l != Potion.regeneration.id) { ++ ++ if (this.field_82262_m >= 3 && this.field_82261_l != Potion.regeneration.id) { + var3 = var3 + " II"; + } + +- this.beaconGui.drawCreativeTabHoveringText(var3, var1, var2); ++ this.beaconGui.drawCreativeTabHoveringText(var3, par1, par2); + } + } diff --git a/patches/net/minecraft/src/GuiBrewingStand.java.patch b/patches/net/minecraft/src/GuiBrewingStand.java.patch new file mode 100644 index 0000000..53ac1ac --- /dev/null +++ b/patches/net/minecraft/src/GuiBrewingStand.java.patch @@ -0,0 +1,105 @@ +--- net/minecraft/src/GuiBrewingStand.java ++++ net/minecraft/src/GuiBrewingStand.java +@@ -6,58 +6,72 @@ + private static final ResourceLocation brewingStandGuiTextures = new ResourceLocation("textures/gui/container/brewing_stand.png"); + private TileEntityBrewingStand brewingStand; + +- public GuiBrewingStand(InventoryPlayer var1, TileEntityBrewingStand var2) { +- super(new ContainerBrewingStand(var1, var2)); +- this.brewingStand = var2; ++ public GuiBrewingStand(InventoryPlayer par1InventoryPlayer, TileEntityBrewingStand par2TileEntityBrewingStand) { ++ super(new ContainerBrewingStand(par1InventoryPlayer, par2TileEntityBrewingStand)); ++ this.brewingStand = par2TileEntityBrewingStand; + } + +- protected void drawGuiContainerForegroundLayer(int var1, int var2) { ++ /** ++ * Draw the foreground layer for the GuiContainer (everything in front of the items) ++ */ ++ protected void drawGuiContainerForegroundLayer(int par1, int par2) { + String var3 = this.brewingStand.isInvNameLocalized() ? this.brewingStand.getInvName() : I18n.getString(this.brewingStand.getInvName()); + this.fontRenderer.drawString(var3, this.xSize / 2 - this.fontRenderer.getStringWidth(var3) / 2, 6, 4210752); + this.fontRenderer.drawString(I18n.getString("container.inventory"), 8, this.ySize - 96 + 2, 4210752); + } + +- protected void drawGuiContainerBackgroundLayer(float var1, int var2, int var3) { ++ /** ++ * Draw the background layer for the GuiContainer (everything behind the items) ++ */ ++ protected void drawGuiContainerBackgroundLayer(float par1, int par2, int par3) { + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + this.mc.getTextureManager().bindTexture(brewingStandGuiTextures); + int var4 = (this.width - this.xSize) / 2; + int var5 = (this.height - this.ySize) / 2; + this.drawTexturedModalRect(var4, var5, 0, 0, this.xSize, this.ySize); + int var6 = this.brewingStand.getBrewTime(); +- if(var6 > 0) { ++ ++ if (var6 > 0) { + int var7 = (int)(28.0F * (1.0F - (float)var6 / 400.0F)); +- if(var7 > 0) { ++ ++ if (var7 > 0) { + this.drawTexturedModalRect(var4 + 97, var5 + 16, 176, 0, 9, var7); + } + + int var8 = var6 / 2 % 7; +- switch(var8) { +- case 0: +- var7 = 29; +- break; +- case 1: +- var7 = 24; +- break; +- case 2: +- var7 = 20; +- break; +- case 3: +- var7 = 16; +- break; +- case 4: +- var7 = 11; +- break; +- case 5: +- var7 = 6; +- break; +- case 6: +- var7 = 0; ++ ++ switch (var8) { ++ case 0: ++ var7 = 29; ++ break; ++ ++ case 1: ++ var7 = 24; ++ break; ++ ++ case 2: ++ var7 = 20; ++ break; ++ ++ case 3: ++ var7 = 16; ++ break; ++ ++ case 4: ++ var7 = 11; ++ break; ++ ++ case 5: ++ var7 = 6; ++ break; ++ ++ case 6: ++ var7 = 0; + } + +- if(var7 > 0) { ++ if (var7 > 0) { + this.drawTexturedModalRect(var4 + 65, var5 + 14 + 29 - var7, 185, 29 - var7, 12, var7); + } + } +- + } + } diff --git a/patches/net/minecraft/src/GuiButton.java.patch b/patches/net/minecraft/src/GuiButton.java.patch new file mode 100644 index 0000000..0639f00 --- /dev/null +++ b/patches/net/minecraft/src/GuiButton.java.patch @@ -0,0 +1,145 @@ +--- net/minecraft/src/GuiButton.java ++++ net/minecraft/src/GuiButton.java +@@ -4,79 +4,110 @@ + + public class GuiButton extends Gui { + protected static final ResourceLocation buttonTextures = new ResourceLocation("textures/gui/widgets.png"); ++ ++ /** Button width in pixels */ + protected int width; ++ ++ /** Button height in pixels */ + protected int height; ++ ++ /** The x position of this control. */ + public int xPosition; ++ ++ /** The y position of this control. */ + public int yPosition; +- public String f; ++ ++ /** The string displayed on this control. */ ++ public String displayString; ++ ++ /** ID for this control. */ + public int id; ++ ++ /** True if this control is enabled, false to disable. */ + public boolean enabled; ++ ++ /** Hides the button completely if false. */ + public boolean drawButton; + protected boolean field_82253_i; + +- public GuiButton(int var1, int var2, int var3, String var4) { +- this(var1, var2, var3, 200, 20, var4); ++ public GuiButton(int par1, int par2, int par3, String par4Str) { ++ this(par1, par2, par3, 200, 20, par4Str); + } + +- public GuiButton(int var1, int var2, int var3, int var4, int var5, String var6) { ++ public GuiButton(int par1, int par2, int par3, int par4, int par5, String par6Str) { + this.width = 200; + this.height = 20; + this.enabled = true; + this.drawButton = true; +- this.id = var1; +- this.xPosition = var2; +- this.yPosition = var3; +- this.width = var4; +- this.height = var5; +- this.f = var6; ++ this.id = par1; ++ this.xPosition = par2; ++ this.yPosition = par3; ++ this.width = par4; ++ this.height = par5; ++ this.displayString = par6Str; + } + +- protected int getHoverState(boolean var1) { ++ /** ++ * Returns 0 if the button is disabled, 1 if the mouse is NOT hovering over this button and 2 if it IS hovering over ++ * this button. ++ */ ++ protected int getHoverState(boolean par1) { + byte var2 = 1; +- if(!this.enabled) { ++ ++ if (!this.enabled) { + var2 = 0; +- } else if(var1) { ++ } else if (par1) { + var2 = 2; + } + + return var2; + } + +- public void drawButton(Minecraft var1, int var2, int var3) { +- if(this.drawButton) { +- FontRenderer var4 = var1.fontRenderer; +- var1.getTextureManager().bindTexture(buttonTextures); ++ /** ++ * Draws this button to the screen. ++ */ ++ public void drawButton(Minecraft par1Minecraft, int par2, int par3) { ++ if (this.drawButton) { ++ FontRenderer var4 = par1Minecraft.fontRenderer; ++ par1Minecraft.getTextureManager().bindTexture(buttonTextures); + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); +- this.field_82253_i = var2 >= this.xPosition && var3 >= this.yPosition && var2 < this.xPosition + this.width && var3 < this.yPosition + this.height; ++ this.field_82253_i = par2 >= this.xPosition && par3 >= this.yPosition && par2 < this.xPosition + this.width && par3 < this.yPosition + this.height; + int var5 = this.getHoverState(this.field_82253_i); + this.drawTexturedModalRect(this.xPosition, this.yPosition, 0, 46 + var5 * 20, this.width / 2, this.height); + this.drawTexturedModalRect(this.xPosition + this.width / 2, this.yPosition, 200 - this.width / 2, 46 + var5 * 20, this.width / 2, this.height); +- this.mouseDragged(var1, var2, var3); ++ this.mouseDragged(par1Minecraft, par2, par3); + int var6 = 14737632; +- if(!this.enabled) { ++ ++ if (!this.enabled) { + var6 = -6250336; +- } else if(this.field_82253_i) { ++ } else if (this.field_82253_i) { + var6 = 16777120; + } + +- this.drawCenteredString(var4, this.f, this.xPosition + this.width / 2, this.yPosition + (this.height - 8) / 2, var6); ++ this.drawCenteredString(var4, this.displayString, this.xPosition + this.width / 2, this.yPosition + (this.height - 8) / 2, var6); + } + } + +- protected void mouseDragged(Minecraft var1, int var2, int var3) { +- } +- +- public void mouseReleased(int var1, int var2) { +- } +- +- public boolean mousePressed(Minecraft var1, int var2, int var3) { +- return this.enabled && this.drawButton && var2 >= this.xPosition && var3 >= this.yPosition && var2 < this.xPosition + this.width && var3 < this.yPosition + this.height; ++ /** ++ * Fired when the mouse button is dragged. Equivalent of MouseListener.mouseDragged(MouseEvent e). ++ */ ++ protected void mouseDragged(Minecraft par1Minecraft, int par2, int par3) {} ++ ++ /** ++ * Fired when the mouse button is released. Equivalent of MouseListener.mouseReleased(MouseEvent e). ++ */ ++ public void mouseReleased(int par1, int par2) {} ++ ++ /** ++ * Returns true if the mouse has been pressed on this control. Equivalent of MouseListener.mousePressed(MouseEvent e). ++ */ ++ public boolean mousePressed(Minecraft par1Minecraft, int par2, int par3) { ++ return this.enabled && this.drawButton && par2 >= this.xPosition && par3 >= this.yPosition && par2 < this.xPosition + this.width && par3 < this.yPosition + this.height; + } + + public boolean func_82252_a() { + return this.field_82253_i; + } + +- public void func_82251_b(int var1, int var2) { +- } ++ public void func_82251_b(int par1, int par2) {} + } diff --git a/patches/net/minecraft/src/GuiButtonLanguage.java.patch b/patches/net/minecraft/src/GuiButtonLanguage.java.patch new file mode 100644 index 0000000..1eb8c05 --- /dev/null +++ b/patches/net/minecraft/src/GuiButtonLanguage.java.patch @@ -0,0 +1,31 @@ +--- net/minecraft/src/GuiButtonLanguage.java ++++ net/minecraft/src/GuiButtonLanguage.java +@@ -3,17 +3,21 @@ + import org.lwjgl.opengl.GL11; + + public class GuiButtonLanguage extends GuiButton { +- public GuiButtonLanguage(int var1, int var2, int var3) { +- super(var1, var2, var3, 20, 20, ""); ++ public GuiButtonLanguage(int par1, int par2, int par3) { ++ super(par1, par2, par3, 20, 20, ""); + } + +- public void drawButton(Minecraft var1, int var2, int var3) { +- if(this.drawButton) { +- var1.getTextureManager().bindTexture(GuiButton.buttonTextures); ++ /** ++ * Draws this button to the screen. ++ */ ++ public void drawButton(Minecraft par1Minecraft, int par2, int par3) { ++ if (this.drawButton) { ++ par1Minecraft.getTextureManager().bindTexture(GuiButton.buttonTextures); + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); +- boolean var4 = var2 >= this.xPosition && var3 >= this.yPosition && var2 < this.xPosition + this.width && var3 < this.yPosition + this.height; ++ boolean var4 = par2 >= this.xPosition && par3 >= this.yPosition && par2 < this.xPosition + this.width && par3 < this.yPosition + this.height; + int var5 = 106; +- if(var4) { ++ ++ if (var4) { + var5 += this.height; + } + diff --git a/patches/net/minecraft/src/GuiButtonLink.java.patch b/patches/net/minecraft/src/GuiButtonLink.java.patch new file mode 100644 index 0000000..5129a16 --- /dev/null +++ b/patches/net/minecraft/src/GuiButtonLink.java.patch @@ -0,0 +1,27 @@ +--- net/minecraft/src/GuiButtonLink.java ++++ net/minecraft/src/GuiButtonLink.java +@@ -3,19 +3,18 @@ + import java.net.URI; + + public class GuiButtonLink extends GuiButton { +- public GuiButtonLink(int var1, int var2, int var3, int var4, int var5, String var6) { +- super(var1, var2, var3, var4, var5, var6); ++ public GuiButtonLink(int par1, int par2, int par3, int par4, int par5, String par6Str) { ++ super(par1, par2, par3, par4, par5, par6Str); + } + +- public void func_96135_a(String var1) { ++ public void func_96135_a(String par1Str) { + try { +- URI var2 = new URI(var1); ++ URI var2 = new URI(par1Str); + Class var3 = Class.forName("java.awt.Desktop"); + Object var4 = var3.getMethod("getDesktop", new Class[0]).invoke((Object)null, new Object[0]); +- var3.getMethod("browse", new Class[]{URI.class}).invoke(var4, new Object[]{var2}); ++ var3.getMethod("browse", new Class[] {URI.class}).invoke(var4, new Object[] {var2}); + } catch (Throwable var5) { + var5.printStackTrace(); + } +- + } + } diff --git a/patches/net/minecraft/src/GuiButtonMerchant.java.patch b/patches/net/minecraft/src/GuiButtonMerchant.java.patch new file mode 100644 index 0000000..2d121da --- /dev/null +++ b/patches/net/minecraft/src/GuiButtonMerchant.java.patch @@ -0,0 +1,48 @@ +--- net/minecraft/src/GuiButtonMerchant.java ++++ net/minecraft/src/GuiButtonMerchant.java +@@ -3,27 +3,35 @@ + import org.lwjgl.opengl.GL11; + + class GuiButtonMerchant extends GuiButton { ++ ++ /** ++ * If true, then next page button will face to right, if false then next page button will face to left. ++ */ + private final boolean mirrored; + +- public GuiButtonMerchant(int var1, int var2, int var3, boolean var4) { +- super(var1, var2, var3, 12, 19, ""); +- this.mirrored = var4; ++ public GuiButtonMerchant(int par1, int par2, int par3, boolean par4) { ++ super(par1, par2, par3, 12, 19, ""); ++ this.mirrored = par4; + } + +- public void drawButton(Minecraft var1, int var2, int var3) { +- if(this.drawButton) { +- var1.getTextureManager().bindTexture(GuiMerchant.func_110417_h()); ++ /** ++ * Draws this button to the screen. ++ */ ++ public void drawButton(Minecraft par1Minecraft, int par2, int par3) { ++ if (this.drawButton) { ++ par1Minecraft.getTextureManager().bindTexture(GuiMerchant.func_110417_h()); + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); +- boolean var4 = var2 >= this.xPosition && var3 >= this.yPosition && var2 < this.xPosition + this.width && var3 < this.yPosition + this.height; ++ boolean var4 = par2 >= this.xPosition && par3 >= this.yPosition && par2 < this.xPosition + this.width && par3 < this.yPosition + this.height; + int var5 = 0; + int var6 = 176; +- if(!this.enabled) { ++ ++ if (!this.enabled) { + var6 += this.width * 2; +- } else if(var4) { ++ } else if (var4) { + var6 += this.width; + } + +- if(!this.mirrored) { ++ if (!this.mirrored) { + var5 += this.height; + } + diff --git a/patches/net/minecraft/src/GuiButtonNextPage.java.patch b/patches/net/minecraft/src/GuiButtonNextPage.java.patch new file mode 100644 index 0000000..6b7fd6d --- /dev/null +++ b/patches/net/minecraft/src/GuiButtonNextPage.java.patch @@ -0,0 +1,45 @@ +--- net/minecraft/src/GuiButtonNextPage.java ++++ net/minecraft/src/GuiButtonNextPage.java +@@ -3,25 +3,33 @@ + import org.lwjgl.opengl.GL11; + + class GuiButtonNextPage extends GuiButton { ++ ++ /** ++ * True for pointing right (next page), false for pointing left (previous page). ++ */ + private final boolean nextPage; + +- public GuiButtonNextPage(int var1, int var2, int var3, boolean var4) { +- super(var1, var2, var3, 23, 13, ""); +- this.nextPage = var4; ++ public GuiButtonNextPage(int par1, int par2, int par3, boolean par4) { ++ super(par1, par2, par3, 23, 13, ""); ++ this.nextPage = par4; + } + +- public void drawButton(Minecraft var1, int var2, int var3) { +- if(this.drawButton) { +- boolean var4 = var2 >= this.xPosition && var3 >= this.yPosition && var2 < this.xPosition + this.width && var3 < this.yPosition + this.height; ++ /** ++ * Draws this button to the screen. ++ */ ++ public void drawButton(Minecraft par1Minecraft, int par2, int par3) { ++ if (this.drawButton) { ++ boolean var4 = par2 >= this.xPosition && par3 >= this.yPosition && par2 < this.xPosition + this.width && par3 < this.yPosition + this.height; + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); +- var1.getTextureManager().bindTexture(GuiScreenBook.func_110404_g()); ++ par1Minecraft.getTextureManager().bindTexture(GuiScreenBook.func_110404_g()); + int var5 = 0; + int var6 = 192; +- if(var4) { ++ ++ if (var4) { + var5 += 23; + } + +- if(!this.nextPage) { ++ if (!this.nextPage) { + var6 += 13; + } + diff --git a/patches/net/minecraft/src/GuiChat.java.patch b/patches/net/minecraft/src/GuiChat.java.patch new file mode 100644 index 0000000..47db8d5 --- /dev/null +++ b/patches/net/minecraft/src/GuiChat.java.patch @@ -0,0 +1,410 @@ +--- net/minecraft/src/GuiChat.java ++++ net/minecraft/src/GuiChat.java +@@ -4,27 +4,47 @@ + import java.util.ArrayList; + import java.util.Iterator; + import java.util.List; ++ + import org.lwjgl.input.Keyboard; + import org.lwjgl.input.Mouse; + ++import org.bukkit.ChatColor; ++ ++import org.spoutcraft.client.config.Configuration; ++ + public class GuiChat extends GuiScreen { +- private String b = ""; ++ private String field_73898_b = ""; ++ ++ /** ++ * keeps position of which chat message you will select when you press up, (does not increase for duplicated messages ++ * sent immediately after each other) ++ */ + private int sentHistoryCursor = -1; + private boolean field_73897_d; + private boolean field_73905_m; + private int field_73903_n; +- private List q = new ArrayList(); +- private URI r; ++ private List field_73904_o = new ArrayList(); ++ ++ /** used to pass around the URI to various dialogues and to the host os */ ++ private URI clickedURI; ++ ++ /** Chat entry field */ + protected GuiTextField inputField; +- private String s = ""; +- +- public GuiChat() { +- } +- +- public GuiChat(String var1) { +- this.s = var1; +- } +- ++ ++ /** ++ * is the text that appears when you press the chat key and the input box appears pre-filled ++ */ ++ private String defaultInputFieldText = ""; ++ ++ public GuiChat() {} ++ ++ public GuiChat(String par1Str) { ++ this.defaultInputFieldText = par1Str; ++ } ++ ++ /** ++ * Adds the buttons (and other controls) to the screen in question. ++ */ + public void initGui() { + Keyboard.enableRepeatEvents(true); + this.sentHistoryCursor = this.mc.ingameGUI.getChatGUI().getSentMessages().size(); +@@ -32,84 +52,103 @@ + this.inputField.setMaxStringLength(100); + this.inputField.setEnableBackgroundDrawing(false); + this.inputField.setFocused(true); +- this.inputField.setText(this.s); ++ this.inputField.setText(this.defaultInputFieldText); + this.inputField.setCanLoseFocus(false); + } + ++ /** ++ * Called when the screen is unloaded. Used to disable keyboard repeat events ++ */ + public void onGuiClosed() { + Keyboard.enableRepeatEvents(false); + this.mc.ingameGUI.getChatGUI().resetScroll(); + } + ++ /** ++ * Called from the main game loop to update the screen. ++ */ + public void updateScreen() { + this.inputField.updateCursorCounter(); + } + +- protected void keyTyped(char var1, int var2) { ++ /** ++ * Fired when a key is typed. This is the equivalent of KeyListener.keyTyped(KeyEvent e). ++ */ ++ protected void keyTyped(char par1, int par2) { + this.field_73905_m = false; +- if(var2 == 15) { ++ ++ if (par2 == 15) { + this.completePlayerName(); + } else { + this.field_73897_d = false; + } + +- if(var2 == 1) { ++ if (par2 == 1) { + this.mc.displayGuiScreen((GuiScreen)null); +- } else if(var2 != 28 && var2 != 156) { +- if(var2 == 200) { ++ } else if (par2 != 28 && par2 != 156) { ++ if (par2 == 200) { + this.getSentHistory(-1); +- } else if(var2 == 208) { ++ } else if (par2 == 208) { + this.getSentHistory(1); +- } else if(var2 == 201) { ++ } else if (par2 == 201) { + this.mc.ingameGUI.getChatGUI().scroll(this.mc.ingameGUI.getChatGUI().func_96127_i() - 1); +- } else if(var2 == 209) { ++ } else if (par2 == 209) { + this.mc.ingameGUI.getChatGUI().scroll(-this.mc.ingameGUI.getChatGUI().func_96127_i() + 1); + } else { +- this.inputField.textboxKeyTyped(var1, var2); ++ this.inputField.textboxKeyTyped(par1, par2); + } + } else { + String var3 = this.inputField.getText().trim(); +- if(var3.length() > 0) { ++ ++ if (var3.length() > 0) { + this.mc.ingameGUI.getChatGUI().addToSentMessages(var3); +- if(!this.mc.handleClientCommand(var3)) { ++ ++ if (!this.mc.handleClientCommand(var3)) { + this.mc.thePlayer.sendChatMessage(var3); + } + } +- +- this.mc.displayGuiScreen((GuiScreen)null); ++ ++ this.mc.displayGuiScreen((GuiScreen)null); + } +- + } + ++ /** ++ * Handles mouse input. ++ */ + public void handleMouseInput() { + super.handleMouseInput(); + int var1 = Mouse.getEventDWheel(); +- if(var1 != 0) { +- if(var1 > 1) { ++ ++ if (var1 != 0) { ++ if (var1 > 1) { + var1 = 1; + } + +- if(var1 < -1) { ++ if (var1 < -1) { + var1 = -1; + } + +- if(!isShiftKeyDown()) { ++ if (!isShiftKeyDown()) { + var1 *= 7; + } + + this.mc.ingameGUI.getChatGUI().scroll(var1); + } +- + } + +- protected void mouseClicked(int var1, int var2, int var3) { +- if(var3 == 0 && this.mc.gameSettings.chatLinks) { ++ /** ++ * Called when the mouse is clicked. ++ */ ++ protected void mouseClicked(int par1, int par2, int par3) { ++ if (par3 == 0 && this.mc.gameSettings.chatLinks) { + ChatClickData var4 = this.mc.ingameGUI.getChatGUI().func_73766_a(Mouse.getX(), Mouse.getY()); +- if(var4 != null) { ++ ++ if (var4 != null) { + URI var5 = var4.getURI(); +- if(var5 != null) { +- if(this.mc.gameSettings.chatLinksPrompt) { +- this.r = var5; ++ ++ if (var5 != null) { ++ if (this.mc.gameSettings.chatLinksPrompt) { ++ this.clickedURI = var5; + this.mc.displayGuiScreen(new GuiConfirmOpenLink(this, var4.getClickedUrl(), 0, false)); + } else { + this.func_73896_a(var5); +@@ -120,48 +159,52 @@ + } + } + +- this.inputField.mouseClicked(var1, var2, var3); +- super.mouseClicked(var1, var2, var3); ++ this.inputField.mouseClicked(par1, par2, par3); ++ super.mouseClicked(par1, par2, par3); + } + +- public void confirmClicked(boolean var1, int var2) { +- if(var2 == 0) { +- if(var1) { +- this.func_73896_a(this.r); ++ public void confirmClicked(boolean par1, int par2) { ++ if (par2 == 0) { ++ if (par1) { ++ this.func_73896_a(this.clickedURI); + } + +- this.r = null; ++ this.clickedURI = null; + this.mc.displayGuiScreen(this); + } +- + } + +- private void func_73896_a(URI var1) { ++ private void func_73896_a(URI par1URI) { + try { + Class var2 = Class.forName("java.awt.Desktop"); + Object var3 = var2.getMethod("getDesktop", new Class[0]).invoke((Object)null, new Object[0]); +- var2.getMethod("browse", new Class[]{URI.class}).invoke(var3, new Object[]{var1}); ++ var2.getMethod("browse", new Class[] {URI.class}).invoke(var3, new Object[] {par1URI}); + } catch (Throwable var4) { + var4.printStackTrace(); + } +- + } + ++ /** ++ * Autocompletes player name ++ */ + public void completePlayerName() { + String var3; +- if(this.field_73897_d) { ++ ++ if (this.field_73897_d) { + this.inputField.deleteFromCursor(this.inputField.func_73798_a(-1, this.inputField.getCursorPosition(), false) - this.inputField.getCursorPosition()); +- if(this.field_73903_n >= this.q.size()) { ++ ++ if (this.field_73903_n >= this.field_73904_o.size()) { + this.field_73903_n = 0; + } + } else { + int var1 = this.inputField.func_73798_a(-1, this.inputField.getCursorPosition(), false); +- this.q.clear(); ++ this.field_73904_o.clear(); + this.field_73903_n = 0; + String var2 = this.inputField.getText().substring(var1).toLowerCase(); + var3 = this.inputField.getText().substring(0, this.inputField.getCursorPosition()); + this.func_73893_a(var3, var2); +- if(this.q.isEmpty()) { ++ ++ if (this.field_73904_o.isEmpty()) { + return; + } + +@@ -169,12 +212,13 @@ + this.inputField.deleteFromCursor(var1 - this.inputField.getCursorPosition()); + } + +- if(this.q.size() > 1) { ++ if (this.field_73904_o.size() > 1) { + StringBuilder var4 = new StringBuilder(); + +- for(Iterator var5 = this.q.iterator(); var5.hasNext(); var4.append(var3)) { ++ for (Iterator var5 = this.field_73904_o.iterator(); var5.hasNext(); var4.append(var3)) { + var3 = (String)var5.next(); +- if(var4.length() > 0) { ++ ++ if (var4.length() > 0) { + var4.append(", "); + } + } +@@ -182,34 +226,39 @@ + this.mc.ingameGUI.getChatGUI().printChatMessageWithOptionalDeletion(var4.toString(), 1); + } + +- this.inputField.writeText((String)this.q.get(this.field_73903_n++)); ++ this.inputField.writeText((String)this.field_73904_o.get(this.field_73903_n++)); + } + +- private void func_73893_a(String var1, String var2) { +- if(var1.length() >= 1) { +- this.mc.thePlayer.sendQueue.addToSendQueue(new Packet203AutoComplete(var1)); ++ private void func_73893_a(String par1Str, String par2Str) { ++ if (par1Str.length() >= 1) { ++ this.mc.thePlayer.sendQueue.addToSendQueue(new Packet203AutoComplete(par1Str)); + this.field_73905_m = true; + } + } + +- public void getSentHistory(int var1) { +- int var2 = this.sentHistoryCursor + var1; ++ /** ++ * input is relative and is applied directly to the sentHistoryCursor so -1 is the previous message, 1 is the next ++ * message from the current cursor position ++ */ ++ public void getSentHistory(int par1) { ++ int var2 = this.sentHistoryCursor + par1; + int var3 = this.mc.ingameGUI.getChatGUI().getSentMessages().size(); +- if(var2 < 0) { ++ ++ if (var2 < 0) { + var2 = 0; + } + +- if(var2 > var3) { ++ if (var2 > var3) { + var2 = var3; + } + +- if(var2 != this.sentHistoryCursor) { +- if(var2 == var3) { ++ if (var2 != this.sentHistoryCursor) { ++ if (var2 == var3) { + this.sentHistoryCursor = var3; +- this.inputField.setText(this.b); ++ this.inputField.setText(this.field_73898_b); + } else { +- if(this.sentHistoryCursor == var3) { +- this.b = this.inputField.getText(); ++ if (this.sentHistoryCursor == var3) { ++ this.field_73898_b = this.inputField.getText(); + } + + this.inputField.setText((String)this.mc.ingameGUI.getChatGUI().getSentMessages().get(var2)); +@@ -218,33 +267,67 @@ + } + } + +- public void drawScreen(int var1, int var2, float var3) { ++ /** ++ * Draws the screen and all the components in it. ++ */ ++ public void drawScreen(int par1, int par2, float par3) { + drawRect(2, this.height - 14, this.width - 2, this.height - 2, Integer.MIN_VALUE); + this.inputField.drawTextBox(); +- super.drawScreen(var1, var2, var3); ++ // Spout Start ++ if (Configuration.isShowingChatColorAssist()) { ++ for(int c = 0; c < 16; c++) { ++ ChatColor value = ChatColor.getByCode(c); ++ String name = value.name().toLowerCase(); ++ boolean lastUnderscore = true; ++ String parsedName = ""; ++ for(int chr = 0; chr < name.length(); chr++) { ++ char ch = name.charAt(chr); ++ if(lastUnderscore) { ++ ch = Character.toUpperCase(ch); ++ } ++ if(ch == '_') { ++ lastUnderscore = true; ++ ch = ' '; ++ } else { ++ lastUnderscore = false; ++ } ++ parsedName += ch; ++ } ++ char code = (char) ('0' + c); ++ if(c >= 10) { ++ code = (char) ('a' + c - 10); ++ } ++ fontRenderer.drawStringWithShadow("&" + code + " - " + value + parsedName, width - 90, 70 + c * 10, 0xffffffff); ++ } ++ } ++ // Spout End ++ super.drawScreen(par1, par2, par3); + } + +- public void func_73894_a(String[] var1) { +- if(this.field_73905_m) { +- this.q.clear(); +- String[] var2 = var1; +- int var3 = var1.length; ++ public void func_73894_a(String[] par1ArrayOfStr) { ++ if (this.field_73905_m) { ++ this.field_73904_o.clear(); ++ String[] var2 = par1ArrayOfStr; ++ int var3 = par1ArrayOfStr.length; + +- for(int var4 = 0; var4 < var3; ++var4) { ++ for (int var4 = 0; var4 < var3; ++var4) { + String var5 = var2[var4]; +- if(var5.length() > 0) { +- this.q.add(var5); ++ ++ if (var5.length() > 0) { ++ this.field_73904_o.add(var5); + } + } + +- if(this.q.size() > 0) { ++ if (this.field_73904_o.size() > 0) { + this.field_73897_d = true; + this.completePlayerName(); + } + } +- + } + ++ /** ++ * Returns true if this GUI should pause the game when it is displayed in single-player ++ */ + public boolean doesGuiPauseGame() { + return false; + } diff --git a/patches/net/minecraft/src/GuiChest.java.patch b/patches/net/minecraft/src/GuiChest.java.patch new file mode 100644 index 0000000..9e0b8e3 --- /dev/null +++ b/patches/net/minecraft/src/GuiChest.java.patch @@ -0,0 +1,45 @@ +--- net/minecraft/src/GuiChest.java ++++ net/minecraft/src/GuiChest.java +@@ -6,25 +6,35 @@ + private static final ResourceLocation field_110421_t = new ResourceLocation("textures/gui/container/generic_54.png"); + private IInventory upperChestInventory; + private IInventory lowerChestInventory; ++ ++ /** ++ * window height is calculated with this values, the more rows, the heigher ++ */ + private int inventoryRows; + +- public GuiChest(IInventory var1, IInventory var2) { +- super(new ContainerChest(var1, var2)); +- this.upperChestInventory = var1; +- this.lowerChestInventory = var2; ++ public GuiChest(IInventory par1IInventory, IInventory par2IInventory) { ++ super(new ContainerChest(par1IInventory, par2IInventory)); ++ this.upperChestInventory = par1IInventory; ++ this.lowerChestInventory = par2IInventory; + this.allowUserInput = false; + short var3 = 222; + int var4 = var3 - 108; +- this.inventoryRows = var2.getSizeInventory() / 9; ++ this.inventoryRows = par2IInventory.getSizeInventory() / 9; + this.ySize = var4 + this.inventoryRows * 18; + } + +- protected void drawGuiContainerForegroundLayer(int var1, int var2) { ++ /** ++ * Draw the foreground layer for the GuiContainer (everything in front of the items) ++ */ ++ protected void drawGuiContainerForegroundLayer(int par1, int par2) { + this.fontRenderer.drawString(this.lowerChestInventory.isInvNameLocalized() ? this.lowerChestInventory.getInvName() : I18n.getString(this.lowerChestInventory.getInvName()), 8, 6, 4210752); + this.fontRenderer.drawString(this.upperChestInventory.isInvNameLocalized() ? this.upperChestInventory.getInvName() : I18n.getString(this.upperChestInventory.getInvName()), 8, this.ySize - 96 + 2, 4210752); + } + +- protected void drawGuiContainerBackgroundLayer(float var1, int var2, int var3) { ++ /** ++ * Draw the background layer for the GuiContainer (everything behind the items) ++ */ ++ protected void drawGuiContainerBackgroundLayer(float par1, int par2, int par3) { + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + this.mc.getTextureManager().bindTexture(field_110421_t); + int var4 = (this.width - this.xSize) / 2; diff --git a/patches/net/minecraft/src/GuiCommandBlock.java.patch b/patches/net/minecraft/src/GuiCommandBlock.java.patch new file mode 100644 index 0000000..2bfe229 --- /dev/null +++ b/patches/net/minecraft/src/GuiCommandBlock.java.patch @@ -0,0 +1,129 @@ +--- net/minecraft/src/GuiCommandBlock.java ++++ net/minecraft/src/GuiCommandBlock.java +@@ -5,40 +5,56 @@ + import org.lwjgl.input.Keyboard; + + public class GuiCommandBlock extends GuiScreen { ++ ++ /** Text field containing the command block's command. */ + private GuiTextField commandTextField; ++ ++ /** Command block being edited. */ + private final TileEntityCommandBlock commandBlock; + private GuiButton doneBtn; + private GuiButton cancelBtn; + +- public GuiCommandBlock(TileEntityCommandBlock var1) { +- this.commandBlock = var1; ++ public GuiCommandBlock(TileEntityCommandBlock par1TileEntityCommandBlock) { ++ this.commandBlock = par1TileEntityCommandBlock; + } + ++ /** ++ * Called from the main game loop to update the screen. ++ */ + public void updateScreen() { + this.commandTextField.updateCursorCounter(); + } + ++ /** ++ * Adds the buttons (and other controls) to the screen in question. ++ */ + public void initGui() { + Keyboard.enableRepeatEvents(true); +- this.i.clear(); +- this.i.add(this.doneBtn = new GuiButton(0, this.width / 2 - 100, this.height / 4 + 96 + 12, I18n.getString("gui.done"))); +- this.i.add(this.cancelBtn = new GuiButton(1, this.width / 2 - 100, this.height / 4 + 120 + 12, I18n.getString("gui.cancel"))); ++ this.buttonList.clear(); ++ this.buttonList.add(this.doneBtn = new GuiButton(0, this.width / 2 - 100, this.height / 4 + 96 + 12, I18n.getString("gui.done"))); ++ this.buttonList.add(this.cancelBtn = new GuiButton(1, this.width / 2 - 100, this.height / 4 + 120 + 12, I18n.getString("gui.cancel"))); + this.commandTextField = new GuiTextField(this.fontRenderer, this.width / 2 - 150, 60, 300, 20); +- this.commandTextField.setMaxStringLength(Short.MAX_VALUE); ++ this.commandTextField.setMaxStringLength(32767); + this.commandTextField.setFocused(true); + this.commandTextField.setText(this.commandBlock.getCommand()); + this.doneBtn.enabled = this.commandTextField.getText().trim().length() > 0; + } + ++ /** ++ * Called when the screen is unloaded. Used to disable keyboard repeat events ++ */ + public void onGuiClosed() { + Keyboard.enableRepeatEvents(false); + } + +- protected void actionPerformed(GuiButton var1) { +- if(var1.enabled) { +- if(var1.id == 1) { ++ /** ++ * Fired when a control is clicked. This is the equivalent of ActionListener.actionPerformed(ActionEvent e). ++ */ ++ protected void actionPerformed(GuiButton par1GuiButton) { ++ if (par1GuiButton.enabled) { ++ if (par1GuiButton.id == 1) { + this.mc.displayGuiScreen((GuiScreen)null); +- } else if(var1.id == 0) { ++ } else if (par1GuiButton.id == 0) { + String var2 = "MC|AdvCdm"; + ByteArrayOutputStream var3 = new ByteArrayOutputStream(); + DataOutputStream var4 = new DataOutputStream(var3); +@@ -55,29 +71,37 @@ + + this.mc.displayGuiScreen((GuiScreen)null); + } +- + } + } + +- protected void keyTyped(char var1, int var2) { +- this.commandTextField.textboxKeyTyped(var1, var2); ++ /** ++ * Fired when a key is typed. This is the equivalent of KeyListener.keyTyped(KeyEvent e). ++ */ ++ protected void keyTyped(char par1, int par2) { ++ this.commandTextField.textboxKeyTyped(par1, par2); + this.doneBtn.enabled = this.commandTextField.getText().trim().length() > 0; +- if(var2 != 28 && var2 != 156) { +- if(var2 == 1) { ++ ++ if (par2 != 28 && par2 != 156) { ++ if (par2 == 1) { + this.actionPerformed(this.cancelBtn); + } + } else { + this.actionPerformed(this.doneBtn); + } +- +- } +- +- protected void mouseClicked(int var1, int var2, int var3) { +- super.mouseClicked(var1, var2, var3); +- this.commandTextField.mouseClicked(var1, var2, var3); +- } +- +- public void drawScreen(int var1, int var2, float var3) { ++ } ++ ++ /** ++ * Called when the mouse is clicked. ++ */ ++ protected void mouseClicked(int par1, int par2, int par3) { ++ super.mouseClicked(par1, par2, par3); ++ this.commandTextField.mouseClicked(par1, par2, par3); ++ } ++ ++ /** ++ * Draws the screen and all the components in it. ++ */ ++ public void drawScreen(int par1, int par2, float par3) { + this.drawDefaultBackground(); + this.drawCenteredString(this.fontRenderer, I18n.getString("advMode.setCommand"), this.width / 2, 20, 16777215); + this.drawString(this.fontRenderer, I18n.getString("advMode.command"), this.width / 2 - 150, 47, 10526880); +@@ -85,6 +109,6 @@ + this.drawString(this.fontRenderer, I18n.getString("advMode.randomPlayer"), this.width / 2 - 150, 108, 10526880); + this.drawString(this.fontRenderer, I18n.getString("advMode.allPlayers"), this.width / 2 - 150, 119, 10526880); + this.commandTextField.drawTextBox(); +- super.drawScreen(var1, var2, var3); ++ super.drawScreen(par1, par2, par3); + } + } diff --git a/patches/net/minecraft/src/GuiConfirmOpenLink.java.patch b/patches/net/minecraft/src/GuiConfirmOpenLink.java.patch new file mode 100644 index 0000000..0e418ec --- /dev/null +++ b/patches/net/minecraft/src/GuiConfirmOpenLink.java.patch @@ -0,0 +1,113 @@ +--- net/minecraft/src/GuiConfirmOpenLink.java ++++ net/minecraft/src/GuiConfirmOpenLink.java +@@ -1,47 +1,77 @@ + package net.minecraft.src; + ++import net.minecraft.src.GuiButton; ++ ++import org.lwjgl.Sys; ++ + public class GuiConfirmOpenLink extends GuiYesNo { +- private String p; +- private String q; +- private String r; ++ ++ /** Text to warn players from opening unsafe links. */ ++ private String openLinkWarning; ++ ++ /** Label for the Copy to Clipboard button. */ ++ private String copyLinkButtonText; ++ private String field_92028_p; + private boolean field_92027_q = true; + +- public GuiConfirmOpenLink(GuiScreen var1, String var2, int var3, boolean var4) { +- super(var1, I18n.getString(var4 ? "chat.link.confirmTrusted" : "chat.link.confirm"), var2, var3); +- this.c = I18n.getString(var4 ? "chat.link.open" : "gui.yes"); +- this.d = I18n.getString(var4 ? "gui.cancel" : "gui.no"); +- this.q = I18n.getString("chat.copy"); +- this.p = I18n.getString("chat.link.warning"); +- this.r = var2; ++ public GuiConfirmOpenLink(GuiScreen par1GuiScreen, String par2Str, int par3, boolean par4) { ++ super(par1GuiScreen, I18n.getString(par4 ? "chat.link.confirmTrusted" : "chat.link.confirm"), par2Str, par3); ++ this.buttonText1 = I18n.getString(par4 ? "chat.link.open" : "gui.yes"); ++ this.buttonText2 = I18n.getString(par4 ? "gui.cancel" : "gui.no"); ++ this.copyLinkButtonText = I18n.getString("chat.copy"); ++ this.openLinkWarning = I18n.getString("chat.link.warning"); ++ this.field_92028_p = par2Str; + } + ++ /** ++ * Adds the buttons (and other controls) to the screen in question. ++ */ + public void initGui() { +- this.i.add(new GuiButton(0, this.width / 3 - 83 + 0, this.height / 6 + 96, 100, 20, this.c)); +- this.i.add(new GuiButton(2, this.width / 3 - 83 + 105, this.height / 6 + 96, 100, 20, this.q)); +- this.i.add(new GuiButton(1, this.width / 3 - 83 + 210, this.height / 6 + 96, 100, 20, this.d)); ++ this.buttonList.add(new GuiButton(0, this.width / 3 - 83 + 0, this.height / 6 + 96, 100, 20, this.buttonText1)); ++ this.buttonList.add(new GuiButton(2, this.width / 3 - 83 + 105, this.height / 6 + 96, 100, 20, this.copyLinkButtonText)); ++ this.buttonList.add(new GuiButton(1, this.width / 3 - 83 + 210, this.height / 6 + 96, 100, 20, this.buttonText2)); + } + +- protected void actionPerformed(GuiButton var1) { +- if(var1.id == 2) { ++ /** ++ * Fired when a control is clicked. This is the equivalent of ActionListener.actionPerformed(ActionEvent e). ++ */ ++ protected void actionPerformed(GuiButton par1GuiButton) { ++ if (par1GuiButton.id == 2) { + this.copyLinkToClipboard(); + } +- +- this.parentScreen.confirmClicked(var1.id == 0, this.worldNumber); +- } +- +- public void copyLinkToClipboard() { +- setClipboardString(this.r); +- } +- +- public void drawScreen(int var1, int var2, float var3) { +- super.drawScreen(var1, var2, var3); +- if(this.field_92027_q) { +- this.drawCenteredString(this.fontRenderer, this.p, this.width / 2, 110, 16764108); ++ // Spout Start ++ if (this.parentScreen instanceof GuiChat) { ++ this.parentScreen.confirmClicked(par1GuiButton.id == 0, this.worldNumber); ++ } else if (par1GuiButton.id == 0) { ++ try { ++ Sys.openURL(this.field_92028_p); ++ } catch (Exception e) {} ++ this.mc.displayGuiScreen(null); ++ } else if (par1GuiButton.id == 1) { ++ this.mc.displayGuiScreen(null); + } +- +- } +- +- public void func_92026_h() { +- this.field_92027_q = false; +- } ++ // Spout End ++ } ++ ++/** ++ * Copies the link to the system clipboard. ++ */ ++public void copyLinkToClipboard() { ++ setClipboardString(this.field_92028_p); ++} ++ ++/** ++ * Draws the screen and all the components in it. ++ */ ++public void drawScreen(int par1, int par2, float par3) { ++ super.drawScreen(par1, par2, par3); ++ ++ if (this.field_92027_q) { ++ this.drawCenteredString(this.fontRenderer, this.openLinkWarning, this.width / 2, 110, 16764108); ++ } ++} ++ ++public void func_92026_h() { ++ this.field_92027_q = false; ++} + } diff --git a/patches/net/minecraft/src/GuiConnecting.java.patch b/patches/net/minecraft/src/GuiConnecting.java.patch new file mode 100644 index 0000000..dac041b --- /dev/null +++ b/patches/net/minecraft/src/GuiConnecting.java.patch @@ -0,0 +1,215 @@ +--- net/minecraft/src/GuiConnecting.java ++++ net/minecraft/src/GuiConnecting.java +@@ -1,104 +1,140 @@ + package net.minecraft.src; + ++import org.spoutcraft.client.gui.mainmenu.MainMenu; ++ + public class GuiConnecting extends GuiScreen { ++ ++ /** A reference to the NetClientHandler. */ + private NetClientHandler clientHandler; ++ ++ /** True if the connection attempt has been cancelled. */ + private boolean cancelled; + private final GuiScreen field_98098_c; + +- public GuiConnecting(GuiScreen var1, Minecraft var2, ServerData var3) { +- this.mc = var2; +- this.field_98098_c = var1; +- ServerAddress var4 = ServerAddress.func_78860_a(var3.b); +- var2.loadWorld((WorldClient)null); +- var2.setServerData(var3); ++ public GuiConnecting(Minecraft par2Minecraft, ServerData par3ServerData) { ++ this(null, par2Minecraft, par3ServerData); ++ } ++ ++ public GuiConnecting(GuiScreen par1GuiScreen, Minecraft par2Minecraft, ServerData par3ServerData) { ++ this.mc = par2Minecraft; ++ this.field_98098_c = par1GuiScreen; ++ ServerAddress var4 = ServerAddress.func_78860_a(par3ServerData.serverIP); ++ par2Minecraft.loadWorld((WorldClient)null); ++ par2Minecraft.setServerData(par3ServerData); + this.spawnNewServerThread(var4.getIP(), var4.getPort()); + } + +- public GuiConnecting(GuiScreen var1, Minecraft var2, String var3, int var4) { +- this.mc = var2; +- this.field_98098_c = var1; +- var2.loadWorld((WorldClient)null); +- this.spawnNewServerThread(var3, var4); +- } +- +- private void spawnNewServerThread(String var1, int var2) { +- this.mc.getLogAgent().logInfo("Connecting to " + var1 + ", " + var2); +- (new ThreadConnectToServer(this, var1, var2)).start(); +- } +- ++ public GuiConnecting(Minecraft par2Minecraft, String par3Str, int par4) { ++ this(null, par2Minecraft, par3Str, par4); ++ } ++ ++ public GuiConnecting(GuiScreen par1GuiScreen, Minecraft par2Minecraft, String par3Str, int par4) { ++ this.mc = par2Minecraft; ++ this.field_98098_c = par1GuiScreen; ++ par2Minecraft.loadWorld((WorldClient)null); ++ this.spawnNewServerThread(par3Str, par4); ++ } ++ ++ private void spawnNewServerThread(String par1Str, int par2) { ++ this.mc.getLogAgent().logInfo("Connecting to " + par1Str + ", " + par2); ++ (new ThreadConnectToServer(this, par1Str, par2)).start(); ++ } ++ ++ /** ++ * Called from the main game loop to update the screen. ++ */ + public void updateScreen() { +- if(this.clientHandler != null) { ++ if (this.clientHandler != null) { + this.clientHandler.processReadPackets(); + } +- +- } +- +- protected void keyTyped(char var1, int var2) { +- } +- ++ } ++ ++ /** ++ * Fired when a key is typed. This is the equivalent of KeyListener.keyTyped(KeyEvent e). ++ */ ++ protected void keyTyped(char par1, int par2) {} ++ ++ /** ++ * Adds the buttons (and other controls) to the screen in question. ++ */ + public void initGui() { +- this.i.clear(); +- this.i.add(new GuiButton(0, this.width / 2 - 100, this.height / 4 + 120 + 12, I18n.getString("gui.cancel"))); ++ this.buttonList.clear(); ++ this.buttonList.add(new GuiButton(0, this.width / 2 - 100, this.height / 4 + 120 + 12, I18n.getString("gui.cancel"))); + } + +- protected void actionPerformed(GuiButton var1) { +- if(var1.id == 0) { ++ /** ++ * Fired when a control is clicked. This is the equivalent of ActionListener.actionPerformed(ActionEvent e). ++ */ ++ protected void actionPerformed(GuiButton par1GuiButton) { ++ if (par1GuiButton.id == 0) { + this.cancelled = true; +- if(this.clientHandler != null) { ++ ++ if (this.clientHandler != null) { + this.clientHandler.disconnect(); + } + +- this.mc.displayGuiScreen(this.field_98098_c); ++ // Spout Start ++ this.mc.displayGuiScreen(new MainMenu()); ++ // Spout End + } +- + } + +- public void drawScreen(int var1, int var2, float var3) { ++ /** ++ * Draws the screen and all the components in it. ++ */ ++ public void drawScreen(int par1, int par2, float par3) { + this.drawDefaultBackground(); +- if(this.clientHandler == null) { ++ ++ if (this.clientHandler == null) { + this.drawCenteredString(this.fontRenderer, I18n.getString("connect.connecting"), this.width / 2, this.height / 2 - 50, 16777215); + this.drawCenteredString(this.fontRenderer, "", this.width / 2, this.height / 2 - 10, 16777215); + } else { + this.drawCenteredString(this.fontRenderer, I18n.getString("connect.authorizing"), this.width / 2, this.height / 2 - 50, 16777215); +- this.drawCenteredString(this.fontRenderer, this.clientHandler.a, this.width / 2, this.height / 2 - 10, 16777215); ++ this.drawCenteredString(this.fontRenderer, this.clientHandler.field_72560_a, this.width / 2, this.height / 2 - 10, 16777215); + } + +- super.drawScreen(var1, var2, var3); +- } +- +- static NetClientHandler setNetClientHandler(GuiConnecting var0, NetClientHandler var1) { +- return var0.clientHandler = var1; +- } +- +- static Minecraft func_74256_a(GuiConnecting var0) { +- return var0.mc; +- } +- +- static boolean isCancelled(GuiConnecting var0) { +- return var0.cancelled; +- } +- +- static Minecraft func_74254_c(GuiConnecting var0) { +- return var0.mc; +- } +- +- static NetClientHandler getNetClientHandler(GuiConnecting var0) { +- return var0.clientHandler; +- } +- +- static GuiScreen func_98097_e(GuiConnecting var0) { +- return var0.field_98098_c; +- } +- +- static Minecraft func_74250_f(GuiConnecting var0) { +- return var0.mc; +- } +- +- static Minecraft func_74251_g(GuiConnecting var0) { +- return var0.mc; +- } +- +- static Minecraft func_98096_h(GuiConnecting var0) { +- return var0.mc; ++ super.drawScreen(par1, par2, par3); ++ } ++ ++ /** ++ * Sets the NetClientHandler. ++ */ ++ static NetClientHandler setNetClientHandler(GuiConnecting par0GuiConnecting, NetClientHandler par1NetClientHandler) { ++ return par0GuiConnecting.clientHandler = par1NetClientHandler; ++ } ++ ++ static Minecraft func_74256_a(GuiConnecting par0GuiConnecting) { ++ return par0GuiConnecting.mc; ++ } ++ ++ static boolean isCancelled(GuiConnecting par0GuiConnecting) { ++ return par0GuiConnecting.cancelled; ++ } ++ ++ static Minecraft func_74254_c(GuiConnecting par0GuiConnecting) { ++ return par0GuiConnecting.mc; ++ } ++ ++ /** ++ * Gets the NetClientHandler. ++ */ ++ static NetClientHandler getNetClientHandler(GuiConnecting par0GuiConnecting) { ++ return par0GuiConnecting.clientHandler; ++ } ++ ++ static GuiScreen func_98097_e(GuiConnecting par0GuiConnecting) { ++ return par0GuiConnecting.field_98098_c; ++ } ++ ++ static Minecraft func_74250_f(GuiConnecting par0GuiConnecting) { ++ return par0GuiConnecting.mc; ++ } ++ ++ static Minecraft func_74251_g(GuiConnecting par0GuiConnecting) { ++ return par0GuiConnecting.mc; ++ } ++ ++ static Minecraft func_98096_h(GuiConnecting par0GuiConnecting) { ++ return par0GuiConnecting.mc; + } + } diff --git a/patches/net/minecraft/src/GuiContainer.java.patch b/patches/net/minecraft/src/GuiContainer.java.patch new file mode 100644 index 0000000..26e1634 --- /dev/null +++ b/patches/net/minecraft/src/GuiContainer.java.patch @@ -0,0 +1,1237 @@ +--- net/minecraft/src/GuiContainer.java ++++ net/minecraft/src/GuiContainer.java +@@ -1,34 +1,75 @@ + package net.minecraft.src; + ++import java.util.ArrayList; + import java.util.Arrays; ++import java.util.Collections; + import java.util.HashSet; + import java.util.Iterator; + import java.util.List; + import java.util.Set; ++ ++import net.minecraft.src.Minecraft; ++import net.minecraft.src.RenderHelper; ++ + import org.lwjgl.input.Keyboard; + import org.lwjgl.opengl.GL11; + import org.lwjgl.opengl.GL12; ++import org.spoutcraft.api.Spoutcraft; ++import org.spoutcraft.api.gui.Button; ++import org.spoutcraft.api.gui.GenericButton; ++import org.spoutcraft.api.gui.ScreenType; ++import org.spoutcraft.api.gui.Widget; ++import org.spoutcraft.client.MCItemStackComparator; ++import org.spoutcraft.client.gui.ScreenUtil; ++import org.spoutcraft.client.inventory.CraftItemStack; ++import org.spoutcraft.client.inventory.InventoryUtil; + + public abstract class GuiContainer extends GuiScreen { + protected static final ResourceLocation field_110408_a = new ResourceLocation("textures/gui/container/inventory.png"); +- protected static RenderItem itemRenderer = new RenderItem(); ++ ++ /** Stacks renderer. Icons, stack size, health, etc... */ ++ // Spout Start ++ protected static RenderItem itemRenderer; ++ // Spout End ++ ++ /** The X size of the inventory window in pixels. */ + protected int xSize = 176; ++ ++ /** The Y size of the inventory window in pixels. */ + protected int ySize = 166; ++ ++ /** A list of the players inventory slots. */ + public Container inventorySlots; ++ ++ /** ++ * Starting X position for the Gui. Inconsistent use for Gui backgrounds. ++ */ + protected int guiLeft; ++ ++ /** ++ * Starting Y position for the Gui. Inconsistent use for Gui backgrounds. ++ */ + protected int guiTop; + private Slot theSlot; ++ ++ /** Used when touchscreen is enabled */ + private Slot clickedSlot; ++ ++ /** Used when touchscreen is enabled */ + private boolean isRightMouseClick; ++ ++ /** Used when touchscreen is enabled */ + private ItemStack draggedStack; + private int field_85049_r; + private int field_85048_s; + private Slot returningStackDestSlot; + private long returningStackTime; ++ ++ /** Used when touchscreen is enabled */ + private ItemStack returningStack; + private Slot field_92033_y; + private long field_92032_z; +- protected final Set r = new HashSet(); ++ protected final Set field_94077_p = new HashSet(); + protected boolean field_94076_q; + private int field_94071_C; + private int field_94067_D; +@@ -40,31 +81,255 @@ + private boolean field_94074_J; + private ItemStack field_94075_K; + +- public GuiContainer(Container var1) { +- this.inventorySlots = var1; ++ // Spout Start ++ private Button orderByAlphabet, orderById; ++ static { ++ itemRenderer = GuiScreen.ourItemRenderer; ++ } ++ // Spout Start ++ ++ public GuiContainer(Container par1Container) { ++ this.inventorySlots = par1Container; + this.field_94068_E = true; + } + ++ /** ++ * Adds the buttons (and other controls) to the screen in question. ++ */ + public void initGui() { + super.initGui(); + this.mc.thePlayer.openContainer = this.inventorySlots; + this.guiLeft = (this.width - this.xSize) / 2; + this.guiTop = (this.height - this.ySize) / 2; +- } +- +- public void drawScreen(int var1, int var2, float var3) { ++ ++ // Spout Start ++ if (Spoutcraft.hasPermission("spout.plugin.sortinventory")) { ++ orderByAlphabet = new GenericButton("A-Z"); ++ orderById = new GenericButton("Id"); ++ orderByAlphabet.setTooltip("Will sort the inventory contents by their name"); ++ orderById.setTooltip("Will sort the inventory contents by their id"); ++ ScreenType type = ScreenUtil.getType(this); ++ ++ if (type == ScreenType.PLAYER_INVENTORY) { ++ if (!this.mc.thePlayer.getActivePotionEffects().isEmpty()) { ++ orderByAlphabet.setGeometry((guiLeft+146), (guiTop+65), 27, 13); ++ orderById.setGeometry((guiLeft+176), (guiTop+65), 22, 13); ++ } else { ++ orderByAlphabet.setGeometry((guiLeft+86), (guiTop+65), 27, 13); ++ orderById.setGeometry((guiLeft+116), (guiTop+65), 22, 13); ++ } ++ } else if (type == ScreenType.CHEST_INVENTORY) { ++ orderByAlphabet.setGeometry((guiLeft+115), (guiTop+3), 27, 12); ++ orderById.setGeometry((guiLeft+145), (guiTop+3), 22, 12); ++ } ++ ++ IInventory inv = inventorySlots.getIInventory(); ++ if (inv != null && inventorySlots.isSortableInventory()) { ++ getScreen().attachWidgets("Spoutcraft", orderByAlphabet, orderById); ++ } ++ } ++ // Spout End ++ } ++ ++ @Override ++ public void drawWidgets(int x, int y, float z) { ++ GL11.glDisable(GL12.GL_RESCALE_NORMAL); ++ RenderHelper.disableStandardItemLighting(); ++ GL11.glDisable(GL11.GL_LIGHTING); ++ GL11.glDisable(GL11.GL_DEPTH_TEST); ++ super.drawWidgets(x, y, z); ++ GL11.glEnable(GL11.GL_LIGHTING); ++ GL11.glEnable(GL11.GL_DEPTH_TEST); ++ } ++ ++ public void buttonClicked(Button btn) { ++ if (btn == orderByAlphabet || btn == orderById) { ++ try { ++ IInventory inv = inventorySlots.getIInventory(); ++ if (inv != null) { ++ if (inv instanceof InventoryPlayer) { ++ compactInventory(inv, true); ++ sortPlayerInventory(btn == orderByAlphabet); ++ } else { ++ compactInventory(inv, false); ++ sortInventory(inv, (btn == orderByAlphabet)); ++ } ++ } ++ } catch (Exception e) { ++ e.printStackTrace(); ++ } ++ } ++ } ++ ++ public int getNumItems(IInventory inventory) { ++ int used = 0; ++ for (int i = 0; i < inventory.getSizeInventory(); i++) { ++ if (inventory.getStackInSlot(i) != null) { ++ used++; ++ } ++ } ++ return used; ++ } ++ ++ public void compactInventory(IInventory inventory, boolean player) { ++ // To keep mp compatibility, fake window clicks ++ for (int i = 0; i < inventory.getSizeInventory(); i++) { ++ ItemStack item = inventory.getStackInSlot(i); ++ if (item != null && item.stackSize < item.getMaxStackSize()) { ++ ++ // Find a place to put this ++ int orig = i; ++ // Avoid the hotbar ++ if (orig < 9 && player) { ++ continue; ++ } ++ handleMouseClick(null, orig, 0, 0); // Pick up the item ++ ++ for (int j = 0; j < inventory.getSizeInventory(); j++) { ++ if (j != i) { ++ ItemStack other = inventory.getStackInSlot(j); ++ if (other != null && other.itemID == item.itemID && other.getItemDamage() == item.getItemDamage()) { ++ int slot = j; ++ // Avoid the hotbar ++ if (slot < 9 && player) { ++ continue; ++ } ++ handleMouseClick(null, slot, 0, 0); // Merge with the existing stack we found ++ ++ // Move onto the next item to merge if this one is completely used up ++ ItemStack cursor = Minecraft.getMinecraft().thePlayer.inventory.getItemStack(); ++ if (cursor == null) { ++ break; ++ } ++ } ++ } ++ } ++ ++ // If we didn't merge all of the item, put it back ++ ItemStack cursor = Minecraft.getMinecraft().thePlayer.inventory.getItemStack(); ++ if (cursor != null) { ++ handleMouseClick(null, orig, 0, 0); ++ } ++ } ++ } ++ } ++ ++ @SuppressWarnings("unchecked") ++ public void sortPlayerInventory(boolean byName) { ++ // To keep mp compatibility, fake window clicks ++ InventoryPlayer inventory = Minecraft.getMinecraft().thePlayer.inventory; ++ for (int itemPass = 0; itemPass < getNumItems(inventory); itemPass++) { ++ for (int pass = 0; pass < inventory.mainInventory.length; pass++) { ++ ArrayList items = new ArrayList(); ++ for (int i = 0; i < inventory.mainInventory.length; i++) { ++ ItemStack item = inventory.mainInventory[i]; ++ if (item == null || i < 9) { ++ items.add(null); ++ } else { ++ items.add(new PositionedItemStack(item, i)); ++ } ++ } ++ Collections.sort(items, new MCItemStackComparator(byName)); ++ ++ while (true) { ++ if (items.get(pass) instanceof PositionedItemStack) { ++ PositionedItemStack item = (PositionedItemStack) items.get(pass); ++ // Left click pick up item ++ int origSlot = item.position; ++ if (origSlot < 9) { ++ break; ++ } ++ int newSlot = pass; ++ if (origSlot != newSlot) { ++ // Left click pick up item ++ handleMouseClick(null, origSlot, 0, 0); ++ ++ // Left click place item down ++ handleMouseClick(null, newSlot, 0, 0); ++ ++ ItemStack cursor = Minecraft.getMinecraft().thePlayer.inventory.getItemStack(); ++ if (cursor != null) { ++ handleMouseClick(null, origSlot, 0, 0); ++ } ++ } ++ break; ++ } ++ pass++; ++ if (pass >= inventory.mainInventory.length) { ++ break; ++ } ++ } ++ } ++ } ++ } ++ ++ @SuppressWarnings("unchecked") ++ public void sortInventory(IInventory inventory, boolean byName) { ++ // To keep mp compatibility, fake window clicks ++ for (int itemPass = 0; itemPass < getNumItems(inventory); itemPass++) { ++ for (int pass = 0; pass < inventory.getSizeInventory(); pass++) { ++ ArrayList items = new ArrayList(); ++ for (int i = 0; i < inventory.getSizeInventory(); i++) { ++ ItemStack item = inventory.getStackInSlot(i); ++ if (item == null) { ++ items.add(null); ++ } else { ++ items.add(new PositionedItemStack(item, i)); ++ } ++ } ++ Collections.sort(items, new MCItemStackComparator(byName)); ++ ++ while (true) { ++ if (items.get(pass) instanceof PositionedItemStack) { ++ PositionedItemStack item = (PositionedItemStack) items.get(pass); ++ //Left click pick up item ++ Slot origSlot = getSlotFromPosition(item.position); ++ Slot newSlot = getSlotFromPosition(pass); ++ if (newSlot != origSlot) { ++ handleMouseClick(origSlot, 0, 0, 0); ++ ++ // Left click place item down ++ handleMouseClick(newSlot, 0, 0, 0); ++ ++ ItemStack cursor = Minecraft.getMinecraft().thePlayer.inventory.getItemStack(); ++ if (cursor != null) { ++ handleMouseClick(origSlot, 0, 0, 0); ++ } ++ } ++ break; ++ } ++ pass++; ++ if (pass >= inventory.getSizeInventory()) { ++ break; ++ } ++ } ++ } ++ } ++ } ++ ++ public Slot getSlotFromPosition(int pos) { ++ return InventoryUtil.getSlotFromPosition(pos, inventorySlots); ++ } ++ // Spout End ++ ++ /** ++ * Draws the screen and all the components in it. ++ */ ++ // ToDo: this method should be stripped and updated. ++ public void drawScreen(int par1, int par2, float par3) { + this.drawDefaultBackground(); + int var4 = this.guiLeft; + int var5 = this.guiTop; +- this.drawGuiContainerBackgroundLayer(var3, var1, var2); ++ this.drawGuiContainerBackgroundLayer(par3, par1, par2); + GL11.glDisable(GL12.GL_RESCALE_NORMAL); + RenderHelper.disableStandardItemLighting(); + GL11.glDisable(GL11.GL_LIGHTING); + GL11.glDisable(GL11.GL_DEPTH_TEST); +- super.drawScreen(var1, var2, var3); +- RenderHelper.enableGUIStandardItemLighting(); ++ super.drawScreen(par1, par2, par3); + GL11.glPushMatrix(); + GL11.glTranslatef((float)var4, (float)var5, 0.0F); ++ this.drawGuiContainerForegroundLayer(par1, par2); ++ RenderHelper.enableGUIStandardItemLighting(); + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + GL11.glEnable(GL12.GL_RESCALE_NORMAL); + this.theSlot = null; +@@ -72,126 +337,227 @@ + short var7 = 240; + OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, (float)var6 / 1.0F, (float)var7 / 1.0F); + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); +- + int var9; +- for(int var13 = 0; var13 < this.inventorySlots.c.size(); ++var13) { +- Slot var15 = (Slot)this.inventorySlots.c.get(var13); +- this.drawSlotInventory(var15); +- if(this.isMouseOverSlot(var15, var1, var2) && var15.func_111238_b()) { +- this.theSlot = var15; ++ ++ for (int var13 = 0; var13 < this.inventorySlots.inventorySlots.size(); ++var13) { ++ Slot var14 = (Slot)this.inventorySlots.inventorySlots.get(var13); ++ this.drawSlotInventory(var14); ++ ++ if (this.isMouseOverSlot(var14, par1, par2) && var14.func_111238_b()) { ++ this.theSlot = var14; + GL11.glDisable(GL11.GL_LIGHTING); + GL11.glDisable(GL11.GL_DEPTH_TEST); +- int var8 = var15.xDisplayPosition; +- var9 = var15.yDisplayPosition; ++ int var8 = var14.xDisplayPosition; ++ var9 = var14.yDisplayPosition; + this.drawGradientRect(var8, var9, var8 + 16, var9 + 16, -2130706433, -2130706433); + GL11.glEnable(GL11.GL_LIGHTING); + GL11.glEnable(GL11.GL_DEPTH_TEST); + } + } + +- this.drawGuiContainerForegroundLayer(var1, var2); +- InventoryPlayer var14 = this.mc.thePlayer.inventory; +- ItemStack var16 = this.draggedStack == null ? var14.getItemStack() : this.draggedStack; +- if(var16 != null) { +- byte var17 = 8; ++ InventoryPlayer var15 = this.mc.thePlayer.inventory; ++ ItemStack var16 = this.draggedStack == null ? var15.getItemStack() : this.draggedStack; ++ ++ if (var16 != null) { ++ byte var18 = 8; + var9 = this.draggedStack == null ? 8 : 16; + String var10 = null; +- if(this.draggedStack != null && this.isRightMouseClick) { ++ ++ if (this.draggedStack != null && this.isRightMouseClick) { + var16 = var16.copy(); + var16.stackSize = MathHelper.ceiling_float_int((float)var16.stackSize / 2.0F); +- } else if(this.field_94076_q && this.r.size() > 1) { ++ } else if (this.field_94076_q && this.field_94077_p.size() > 1) { + var16 = var16.copy(); + var16.stackSize = this.field_94069_F; +- if(var16.stackSize == 0) { ++ ++ if (var16.stackSize == 0) { + var10 = "" + EnumChatFormatting.YELLOW + "0"; + } + } + +- this.drawItemStack(var16, var1 - var4 - var17, var2 - var5 - var9, var10); ++ this.drawItemStack(var16, par1 - var4 - var18, par2 - var5 - var9, var10); + } + +- if(this.returningStack != null) { +- float var18 = (float)(Minecraft.getSystemTime() - this.returningStackTime) / 100.0F; +- if(var18 >= 1.0F) { +- var18 = 1.0F; ++ if (this.returningStack != null) { ++ float var17 = (float)(Minecraft.getSystemTime() - this.returningStackTime) / 100.0F; ++ ++ if (var17 >= 1.0F) { ++ var17 = 1.0F; + this.returningStack = null; + } + + var9 = this.returningStackDestSlot.xDisplayPosition - this.field_85049_r; + int var20 = this.returningStackDestSlot.yDisplayPosition - this.field_85048_s; +- int var11 = this.field_85049_r + (int)((float)var9 * var18); +- int var12 = this.field_85048_s + (int)((float)var20 * var18); ++ int var11 = this.field_85049_r + (int)((float)var9 * var17); ++ int var12 = this.field_85048_s + (int)((float)var20 * var17); + this.drawItemStack(this.returningStack, var11, var12, (String)null); + } + +- GL11.glPopMatrix(); +- if(var14.getItemStack() == null && this.theSlot != null && this.theSlot.getHasStack()) { ++ if (var15.getItemStack() == null && this.theSlot != null && this.theSlot.getHasStack()) { + ItemStack var19 = this.theSlot.getStack(); +- this.drawItemStackTooltip(var19, var1, var2); ++ this.drawItemStackTooltip(var19, par1 - var4 + 8, par2 - var5 + 8); + } + ++ GL11.glPopMatrix(); + GL11.glEnable(GL11.GL_LIGHTING); + GL11.glEnable(GL11.GL_DEPTH_TEST); +- RenderHelper.enableStandardItemLighting(); ++ RenderHelper.disableStandardItemLighting(); ++ GL11.glDisable(GL12.GL_RESCALE_NORMAL); + } + +- private void drawItemStack(ItemStack var1, int var2, int var3, String var4) { ++ private void drawItemStack(ItemStack par1ItemStack, int par2, int par3, String par4Str) { + GL11.glTranslatef(0.0F, 0.0F, 32.0F); + this.zLevel = 200.0F; + itemRenderer.zLevel = 200.0F; +- itemRenderer.renderItemAndEffectIntoGUI(this.fontRenderer, this.mc.getTextureManager(), var1, var2, var3); +- itemRenderer.renderItemOverlayIntoGUI(this.fontRenderer, this.mc.getTextureManager(), var1, var2, var3 - (this.draggedStack == null ? 0 : 8), var4); ++ itemRenderer.renderItemAndEffectIntoGUI(this.fontRenderer, this.mc.getTextureManager(), par1ItemStack, par2, par3); ++ itemRenderer.renderItemOverlayIntoGUI(this.fontRenderer, this.mc.getTextureManager(), par1ItemStack, par2, par3 - (this.draggedStack == null ? 0 : 8), par4Str); + this.zLevel = 0.0F; + itemRenderer.zLevel = 0.0F; + } + +- protected void drawItemStackTooltip(ItemStack var1, int var2, int var3) { +- List var4 = var1.getTooltip(this.mc.thePlayer, this.mc.gameSettings.advancedItemTooltips); +- +- for(int var5 = 0; var5 < var4.size(); ++var5) { +- if(var5 == 0) { +- var4.set(var5, "\u00a7" + Integer.toHexString(var1.getRarity().rarityColor) + (String)var4.get(var5)); +- } else { +- var4.set(var5, EnumChatFormatting.GRAY + (String)var4.get(var5)); +- } ++ protected void drawItemStackTooltip(ItemStack par1ItemStack, int par2, int par3) { ++ GL11.glDisable(GL12.GL_RESCALE_NORMAL); ++ RenderHelper.disableStandardItemLighting(); ++ GL11.glDisable(GL11.GL_LIGHTING); ++ GL11.glDisable(GL11.GL_DEPTH_TEST); ++ // Spout Start ++ List var4 = Arrays.asList(Spoutcraft.getMaterialManager().getToolTip(new CraftItemStack(par1ItemStack)).split("\n")); ++ // Spout End ++ ++ if (!var4.isEmpty()) { ++ int var5 = 0; ++ int var7; ++ int var6; ++ ++ for (var6 = 0; var6 < var4.size(); ++var6) { ++ var7 = this.fontRenderer.getStringWidth((String)var4.get(var6)); ++ ++ if (var7 > var5) { ++ var5 = var7; ++ } ++ } ++ ++ var6 = par2 + 12; ++ var7 = par3 - 12; ++ int var9 = 8; ++ ++ if (var4.size() > 1) { ++ var9 += 2 + (var4.size() - 1) * 10; ++ } ++ ++ if (this.guiTop + var7 + var9 + 6 > this.height) { ++ var7 = this.height - var9 - this.guiTop - 6; ++ } ++ ++ this.zLevel = 300.0F; ++ itemRenderer.zLevel = 300.0F; ++ int var10 = -267386864; ++ this.drawGradientRect(var6 - 3, var7 - 4, var6 + var5 + 3, var7 - 3, var10, var10); ++ this.drawGradientRect(var6 - 3, var7 + var9 + 3, var6 + var5 + 3, var7 + var9 + 4, var10, var10); ++ this.drawGradientRect(var6 - 3, var7 - 3, var6 + var5 + 3, var7 + var9 + 3, var10, var10); ++ this.drawGradientRect(var6 - 4, var7 - 3, var6 - 3, var7 + var9 + 3, var10, var10); ++ this.drawGradientRect(var6 + var5 + 3, var7 - 3, var6 + var5 + 4, var7 + var9 + 3, var10, var10); ++ int var11 = 1347420415; ++ int var12 = (var11 & 16711422) >> 1 | var11 & -16777216; ++ this.drawGradientRect(var6 - 3, var7 - 3 + 1, var6 - 3 + 1, var7 + var9 + 3 - 1, var11, var12); ++ this.drawGradientRect(var6 + var5 + 2, var7 - 3 + 1, var6 + var5 + 3, var7 + var9 + 3 - 1, var11, var12); ++ this.drawGradientRect(var6 - 3, var7 - 3, var6 + var5 + 3, var7 - 3 + 1, var11, var11); ++ this.drawGradientRect(var6 - 3, var7 + var9 + 2, var6 + var5 + 3, var7 + var9 + 3, var12, var12); ++ ++ for (int var13 = 0; var13 < var4.size(); ++var13) { ++ String var14 = (String)var4.get(var13); ++ ++ if (var13 == 0) { ++ var14 = "\u00a7" + Integer.toHexString(par1ItemStack.getRarity().rarityColor) + var14; ++ } else { ++ var14 = EnumChatFormatting.GRAY + var14; ++ } ++ ++ this.fontRenderer.drawStringWithShadow(var14, var6, var7, -1); ++ ++ if (var13 == 0) { ++ var7 += 2; ++ } ++ ++ var7 += 10; ++ } ++ ++ this.zLevel = 0.0F; ++ itemRenderer.zLevel = 0.0F; + } +- +- this.func_102021_a(var4, var2, var3); +- } +- +- protected void drawCreativeTabHoveringText(String var1, int var2, int var3) { +- this.func_102021_a(Arrays.asList(new String[]{var1}), var2, var3); +- } +- +- protected void func_102021_a(List var1, int var2, int var3) { +- if(!var1.isEmpty()) { ++ //ToDo: might need this ++ //this.func_102021_a(var4, par2, par3); ++ } ++ ++ /** ++ * Draws the text when mouse is over creative inventory tab. Params: current creative tab to be checked, current mouse ++ * x position, current mouse y position. ++ */ ++ protected void drawCreativeTabHoveringText(String par1Str, int par2, int par3) { ++ //Todo: may need this instead: ++ //this.func_102021_a(Arrays.asList(new String[] {par1Str}), par2, par3); ++ GL11.glDisable(GL12.GL_RESCALE_NORMAL); ++ RenderHelper.disableStandardItemLighting(); ++ GL11.glDisable(GL11.GL_LIGHTING); ++ GL11.glDisable(GL11.GL_DEPTH_TEST); ++ int var4 = this.fontRenderer.getStringWidth(par1Str); ++ int var5 = par2 + 12; ++ int var6 = par3 - 12; ++ byte var8 = 8; ++ this.zLevel = 300.0F; ++ itemRenderer.zLevel = 300.0F; ++ int var9 = -267386864; ++ this.drawGradientRect(var5 - 3, var6 - 4, var5 + var4 + 3, var6 - 3, var9, var9); ++ this.drawGradientRect(var5 - 3, var6 + var8 + 3, var5 + var4 + 3, var6 + var8 + 4, var9, var9); ++ this.drawGradientRect(var5 - 3, var6 - 3, var5 + var4 + 3, var6 + var8 + 3, var9, var9); ++ this.drawGradientRect(var5 - 4, var6 - 3, var5 - 3, var6 + var8 + 3, var9, var9); ++ this.drawGradientRect(var5 + var4 + 3, var6 - 3, var5 + var4 + 4, var6 + var8 + 3, var9, var9); ++ int var10 = 1347420415; ++ int var11 = (var10 & 16711422) >> 1 | var10 & -16777216; ++ this.drawGradientRect(var5 - 3, var6 - 3 + 1, var5 - 3 + 1, var6 + var8 + 3 - 1, var10, var11); ++ this.drawGradientRect(var5 + var4 + 2, var6 - 3 + 1, var5 + var4 + 3, var6 + var8 + 3 - 1, var10, var11); ++ this.drawGradientRect(var5 - 3, var6 - 3, var5 + var4 + 3, var6 - 3 + 1, var10, var10); ++ this.drawGradientRect(var5 - 3, var6 + var8 + 2, var5 + var4 + 3, var6 + var8 + 3, var11, var11); ++ this.fontRenderer.drawStringWithShadow(par1Str, var5, var6, -1); ++ this.zLevel = 0.0F; ++ itemRenderer.zLevel = 0.0F; ++ GL11.glEnable(GL11.GL_LIGHTING); ++ GL11.glEnable(GL11.GL_DEPTH_TEST); ++ RenderHelper.enableStandardItemLighting(); ++ GL11.glEnable(GL12.GL_RESCALE_NORMAL); ++ } ++ ++ protected void func_102021_a(List par1List, int par2, int par3) { ++ if (!par1List.isEmpty()) { + GL11.glDisable(GL12.GL_RESCALE_NORMAL); + RenderHelper.disableStandardItemLighting(); + GL11.glDisable(GL11.GL_LIGHTING); + GL11.glDisable(GL11.GL_DEPTH_TEST); + int var4 = 0; +- Iterator var5 = var1.iterator(); ++ Iterator var5 = par1List.iterator(); + +- while(var5.hasNext()) { ++ while (var5.hasNext()) { + String var6 = (String)var5.next(); + int var7 = this.fontRenderer.getStringWidth(var6); +- if(var7 > var4) { ++ ++ if (var7 > var4) { + var4 = var7; + } + } + +- int var14 = var2 + 12; +- int var15 = var3 - 12; ++ int var14 = par2 + 12; ++ int var15 = par3 - 12; + int var8 = 8; +- if(var1.size() > 1) { +- var8 += 2 + (var1.size() - 1) * 10; ++ ++ if (par1List.size() > 1) { ++ var8 += 2 + (par1List.size() - 1) * 10; + } + +- if(var14 + var4 > this.width) { ++ if (var14 + var4 > this.width) { + var14 -= 28 + var4; + } + +- if(var15 + var8 + 6 > this.height) { ++ if (var15 + var8 + 6 > this.height) { + var15 = this.height - var8 - 6; + } + +@@ -210,10 +576,11 @@ + this.drawGradientRect(var14 - 3, var15 - 3, var14 + var4 + 3, var15 - 3 + 1, var10, var10); + this.drawGradientRect(var14 - 3, var15 + var8 + 2, var14 + var4 + 3, var15 + var8 + 3, var11, var11); + +- for(int var12 = 0; var12 < var1.size(); ++var12) { +- String var13 = (String)var1.get(var12); ++ for (int var12 = 0; var12 < par1List.size(); ++var12) { ++ String var13 = (String)par1List.get(var12); + this.fontRenderer.drawStringWithShadow(var13, var14, var15, -1); +- if(var12 == 0) { ++ ++ if (var12 == 0) { + var15 += 2; + } + +@@ -228,52 +595,63 @@ + GL11.glEnable(GL12.GL_RESCALE_NORMAL); + } + } +- +- protected void drawGuiContainerForegroundLayer(int var1, int var2) { +- } +- ++ /** ++ * Draw the foreground layer for the GuiContainer (everything in front of the items) ++ */ ++ protected void drawGuiContainerForegroundLayer(int par1, int par2) {} ++ ++ /** ++ * Draw the background layer for the GuiContainer (everything behind the items) ++ */ + protected abstract void drawGuiContainerBackgroundLayer(float var1, int var2, int var3); + +- private void drawSlotInventory(Slot var1) { +- int var2 = var1.xDisplayPosition; +- int var3 = var1.yDisplayPosition; +- ItemStack var4 = var1.getStack(); ++ /** ++ * Draws an inventory slot ++ */ ++ private void drawSlotInventory(Slot par1Slot) { ++ int var2 = par1Slot.xDisplayPosition; ++ int var3 = par1Slot.yDisplayPosition; ++ ItemStack var4 = par1Slot.getStack(); + boolean var5 = false; +- boolean var6 = var1 == this.clickedSlot && this.draggedStack != null && !this.isRightMouseClick; ++ boolean var6 = par1Slot == this.clickedSlot && this.draggedStack != null && !this.isRightMouseClick; + ItemStack var7 = this.mc.thePlayer.inventory.getItemStack(); + String var8 = null; +- if(var1 == this.clickedSlot && this.draggedStack != null && this.isRightMouseClick && var4 != null) { ++ ++ if (par1Slot == this.clickedSlot && this.draggedStack != null && this.isRightMouseClick && var4 != null) { + var4 = var4.copy(); + var4.stackSize /= 2; +- } else if(this.field_94076_q && this.r.contains(var1) && var7 != null) { +- if(this.r.size() == 1) { ++ } else if (this.field_94076_q && this.field_94077_p.contains(par1Slot) && var7 != null) { ++ if (this.field_94077_p.size() == 1) { + return; + } + +- if(Container.func_94527_a(var1, var7, true) && this.inventorySlots.canDragIntoSlot(var1)) { ++ if (Container.func_94527_a(par1Slot, var7, true) && this.inventorySlots.canDragIntoSlot(par1Slot)) { + var4 = var7.copy(); + var5 = true; +- Container.func_94525_a(this.r, this.field_94071_C, var4, var1.getStack() == null ? 0 : var1.getStack().stackSize); +- if(var4.stackSize > var4.getMaxStackSize()) { ++ Container.func_94525_a(this.field_94077_p, this.field_94071_C, var4, par1Slot.getStack() == null ? 0 : par1Slot.getStack().stackSize); ++ ++ if (var4.stackSize > var4.getMaxStackSize()) { + var8 = EnumChatFormatting.YELLOW + "" + var4.getMaxStackSize(); + var4.stackSize = var4.getMaxStackSize(); + } + +- if(var4.stackSize > var1.getSlotStackLimit()) { +- var8 = EnumChatFormatting.YELLOW + "" + var1.getSlotStackLimit(); +- var4.stackSize = var1.getSlotStackLimit(); ++ if (var4.stackSize > par1Slot.getSlotStackLimit()) { ++ var8 = EnumChatFormatting.YELLOW + "" + par1Slot.getSlotStackLimit(); ++ var4.stackSize = par1Slot.getSlotStackLimit(); + } + } else { +- this.r.remove(var1); ++ this.field_94077_p.remove(par1Slot); + this.func_94066_g(); + } + } + + this.zLevel = 100.0F; + itemRenderer.zLevel = 100.0F; +- if(var4 == null) { +- Icon var9 = var1.getBackgroundIconIndex(); +- if(var9 != null) { ++ ++ if (var4 == null) { ++ Icon var9 = par1Slot.getBackgroundIconIndex(); ++ ++ if (var9 != null) { + GL11.glDisable(GL11.GL_LIGHTING); + this.mc.getTextureManager().bindTexture(TextureMap.locationItemsTexture); + this.drawTexturedModelRectFromIcon(var2, var3, var9, 16, 16); +@@ -282,8 +660,8 @@ + } + } + +- if(!var6) { +- if(var5) { ++ if (!var6) { ++ if (var5) { + drawRect(var2, var3, var2 + 16, var3 + 16, -2130706433); + } + +@@ -298,32 +676,36 @@ + + private void func_94066_g() { + ItemStack var1 = this.mc.thePlayer.inventory.getItemStack(); +- if(var1 != null && this.field_94076_q) { ++ if (var1 != null && this.field_94076_q) { + this.field_94069_F = var1.stackSize; +- + ItemStack var4; + int var5; +- for(Iterator var2 = this.r.iterator(); var2.hasNext(); this.field_94069_F -= var4.stackSize - var5) { ++ ++ for (Iterator var2 = this.field_94077_p.iterator(); var2.hasNext(); this.field_94069_F -= var4.stackSize - var5) { + Slot var3 = (Slot)var2.next(); + var4 = var1.copy(); + var5 = var3.getStack() == null ? 0 : var3.getStack().stackSize; +- Container.func_94525_a(this.r, this.field_94071_C, var4, var5); +- if(var4.stackSize > var4.getMaxStackSize()) { ++ Container.func_94525_a(this.field_94077_p, this.field_94071_C, var4, var5); ++ ++ if (var4.stackSize > var4.getMaxStackSize()) { + var4.stackSize = var4.getMaxStackSize(); + } + +- if(var4.stackSize > var3.getSlotStackLimit()) { ++ if (var4.stackSize > var3.getSlotStackLimit()) { + var4.stackSize = var3.getSlotStackLimit(); + } + } +- + } + } + +- private Slot getSlotAtPosition(int var1, int var2) { +- for(int var3 = 0; var3 < this.inventorySlots.c.size(); ++var3) { +- Slot var4 = (Slot)this.inventorySlots.c.get(var3); +- if(this.isMouseOverSlot(var4, var1, var2)) { ++ /** ++ * Returns the slot at the given coordinates or null if there is none. ++ */ ++ private Slot getSlotAtPosition(int par1, int par2) { ++ for (int var3 = 0; var3 < this.inventorySlots.inventorySlots.size(); ++var3) { ++ Slot var4 = (Slot)this.inventorySlots.inventorySlots.get(var3); ++ ++ if (this.isMouseOverSlot(var4, par1, par2)) { + return var4; + } + } +@@ -331,90 +713,85 @@ + return null; + } + +- protected void mouseClicked(int var1, int var2, int var3) { +- super.mouseClicked(var1, var2, var3); +- boolean var4 = var3 == this.mc.gameSettings.keyBindPickBlock.keyCode + 100; +- Slot var5 = this.getSlotAtPosition(var1, var2); +- long var6 = Minecraft.getSystemTime(); +- this.field_94074_J = this.field_94072_H == var5 && var6 - this.field_94070_G < 250L && this.field_94073_I == var3; +- this.field_94068_E = false; +- if(var3 == 0 || var3 == 1 || var4) { +- int var8 = this.guiLeft; +- int var9 = this.guiTop; +- boolean var10 = var1 < var8 || var2 < var9 || var1 >= var8 + this.xSize || var2 >= var9 + this.ySize; +- int var11 = -1; +- if(var5 != null) { +- var11 = var5.slotNumber; +- } +- +- if(var10) { +- var11 = -999; +- } +- +- if(this.mc.gameSettings.touchscreen && var10 && this.mc.thePlayer.inventory.getItemStack() == null) { ++ /** ++ * Called when the mouse is clicked. ++ */ ++ protected void mouseClicked(int par1, int par2, int par3) { ++ super.mouseClicked(par1, par2, par3); ++ boolean var4 = par3 == this.mc.gameSettings.keyBindPickBlock.keyCode + 100; ++ ++ if (par3 == 0 || par3 == 1 || var4) { ++ Slot var5 = this.getSlotAtPosition(par1, par2); ++ int var6 = this.guiLeft; ++ int var7 = this.guiTop; ++ boolean var8 = par1 < var6 || par2 < var7 || par1 >= var6 + this.xSize || par2 >= var7 + this.ySize; ++ int var9 = -1; ++ ++ if (var5 != null) { ++ var9 = var5.slotNumber; ++ } ++ ++ if (var8) { ++ // Spout Start ++ boolean isSpoutSlot = false; ++ for (Widget w : getScreen().getAttachedWidgets(true)) { ++ if (isInBoundingRect(w, par1, par2)) { ++ if (w instanceof org.spoutcraft.api.gui.Slot) { ++ isSpoutSlot = true; ++ break; ++ } ++ } ++ } ++ if (!isSpoutSlot) { ++ var9 = -999; ++ } ++ // Spout End ++ } ++ ++ if (this.mc.gameSettings.touchscreen && var8 && this.mc.thePlayer.inventory.getItemStack() == null) { + this.mc.displayGuiScreen((GuiScreen)null); + return; + } + +- if(var11 != -1) { +- if(this.mc.gameSettings.touchscreen) { +- if(var5 != null && var5.getHasStack()) { ++ if (var9 != -1) { ++ if (this.mc.gameSettings.touchscreen) { ++ if (var5 != null && var5.getHasStack()) { + this.clickedSlot = var5; + this.draggedStack = null; +- this.isRightMouseClick = var3 == 1; ++ this.isRightMouseClick = par3 == 1; + } else { + this.clickedSlot = null; + } +- } else if(!this.field_94076_q) { +- if(this.mc.thePlayer.inventory.getItemStack() == null) { +- if(var3 == this.mc.gameSettings.keyBindPickBlock.keyCode + 100) { +- this.handleMouseClick(var5, var11, var3, 3); +- } else { +- boolean var12 = var11 != -999 && (Keyboard.isKeyDown(Keyboard.KEY_LSHIFT) || Keyboard.isKeyDown(Keyboard.KEY_RSHIFT)); +- byte var13 = 0; +- if(var12) { +- this.field_94075_K = var5 != null && var5.getHasStack() ? var5.getStack() : null; +- var13 = 1; +- } else if(var11 == -999) { +- var13 = 4; +- } +- +- this.handleMouseClick(var5, var11, var3, var13); +- } +- +- this.field_94068_E = true; +- } else { +- this.field_94076_q = true; +- this.field_94067_D = var3; +- this.r.clear(); +- if(var3 == 0) { +- this.field_94071_C = 0; +- } else if(var3 == 1) { +- this.field_94071_C = 1; +- } +- } ++ } else if (var4) { ++ this.handleMouseClick(var5, var9, par3, 3); ++ } else { ++ boolean var10 = var9 != -999 && (Keyboard.isKeyDown(42) || Keyboard.isKeyDown(54)); ++ this.handleMouseClick(var5, var9, par3, var10 ? 1 : 0); + } + } + } +- +- this.field_94072_H = var5; +- this.field_94070_G = var6; +- this.field_94073_I = var3; + } + +- protected void mouseClickMove(int var1, int var2, int var3, long var4) { +- Slot var6 = this.getSlotAtPosition(var1, var2); ++ /** ++ * Called when a mouse button is pressed and the mouse is moved around. Parameters are : mouseX, mouseY, ++ * lastButtonClicked & timeSinceMouseClick. ++ */ ++ // ToDo: this may break a lot of stuff.... ++ protected void mouseClickMove(int par1, int par2, int par3, long par4) { ++ Slot var6 = this.getSlotAtPosition(par1, par2); + ItemStack var7 = this.mc.thePlayer.inventory.getItemStack(); +- if(this.clickedSlot != null && this.mc.gameSettings.touchscreen) { +- if(var3 == 0 || var3 == 1) { +- if(this.draggedStack == null) { +- if(var6 != this.clickedSlot) { ++ ++ if (this.clickedSlot != null && this.mc.gameSettings.touchscreen) { ++ if (par3 == 0 || par3 == 1) { ++ if (this.draggedStack == null) { ++ if (var6 != this.clickedSlot) { + this.draggedStack = this.clickedSlot.getStack().copy(); + } +- } else if(this.draggedStack.stackSize > 1 && var6 != null && Container.func_94527_a(var6, this.draggedStack, false)) { ++ } else if (this.draggedStack.stackSize > 1 && var6 != null && Container.func_94527_a(var6, this.draggedStack, false)) { + long var8 = Minecraft.getSystemTime(); +- if(this.field_92033_y == var6) { +- if(var8 - this.field_92032_z > 500L) { ++ ++ if (this.field_92033_y == var6) { ++ if (var8 - this.field_92032_z > 500L) { + this.handleMouseClick(this.clickedSlot, this.clickedSlot.slotNumber, 0, 0); + this.handleMouseClick(var6, var6.slotNumber, 1, 0); + this.handleMouseClick(this.clickedSlot, this.clickedSlot.slotNumber, 0, 0); +@@ -427,84 +804,93 @@ + } + } + } +- } else if(this.field_94076_q && var6 != null && var7 != null && var7.stackSize > this.r.size() && Container.func_94527_a(var6, var7, true) && var6.isItemValid(var7) && this.inventorySlots.canDragIntoSlot(var6)) { +- this.r.add(var6); ++ } else if (this.field_94076_q && var6 != null && var7 != null && var7.stackSize > this.field_94077_p.size() && Container.func_94527_a(var6, var7, true) && var6.isItemValid(var7) && this.inventorySlots.canDragIntoSlot(var6)) { ++ this.field_94077_p.add(var6); + this.func_94066_g(); + } +- + } + +- protected void mouseMovedOrUp(int var1, int var2, int var3) { +- Slot var4 = this.getSlotAtPosition(var1, var2); ++ /** ++ * Called when the mouse is moved or a mouse button is released. Signature: (mouseX, mouseY, which) which==-1 is ++ * mouseMove, which==0 or which==1 is mouseUp ++ */ ++ protected void mouseMovedOrUp(int par1, int par2, int par3) { ++ Slot var4 = this.getSlotAtPosition(par1, par2); + int var5 = this.guiLeft; + int var6 = this.guiTop; +- boolean var7 = var1 < var5 || var2 < var6 || var1 >= var5 + this.xSize || var2 >= var6 + this.ySize; ++ boolean var7 = par1 < var5 || par2 < var6 || par1 >= var5 + this.xSize || par2 >= var6 + this.ySize; + int var8 = -1; +- if(var4 != null) { ++ ++ if (var4 != null) { + var8 = var4.slotNumber; + } + +- if(var7) { ++ if (var7) { + var8 = -999; + } + + Slot var10; + Iterator var11; +- if(this.field_94074_J && var4 != null && var3 == 0 && this.inventorySlots.func_94530_a((ItemStack)null, var4)) { +- if(isShiftKeyDown()) { +- if(var4 != null && var4.inventory != null && this.field_94075_K != null) { +- var11 = this.inventorySlots.c.iterator(); +- +- while(var11.hasNext()) { ++ ++ if (this.field_94074_J && var4 != null && par3 == 0 && this.inventorySlots.func_94530_a((ItemStack)null, var4)) { ++ if (isShiftKeyDown()) { ++ if (var4 != null && var4.inventory != null && this.field_94075_K != null) { ++ var11 = this.inventorySlots.inventorySlots.iterator(); ++ ++ while (var11.hasNext()) { + var10 = (Slot)var11.next(); +- if(var10 != null && var10.canTakeStack(this.mc.thePlayer) && var10.getHasStack() && var10.inventory == var4.inventory && Container.func_94527_a(var10, this.field_94075_K, true)) { +- this.handleMouseClick(var10, var10.slotNumber, var3, 1); ++ ++ if (var10 != null && var10.canTakeStack(this.mc.thePlayer) && var10.getHasStack() && var10.inventory == var4.inventory && Container.func_94527_a(var10, this.field_94075_K, true)) { ++ this.handleMouseClick(var10, var10.slotNumber, par3, 1); + } + } + } + } else { +- this.handleMouseClick(var4, var8, var3, 6); ++ this.handleMouseClick(var4, var8, par3, 6); + } + + this.field_94074_J = false; + this.field_94070_G = 0L; + } else { +- if(this.field_94076_q && this.field_94067_D != var3) { ++ if (this.field_94076_q && this.field_94067_D != par3) { + this.field_94076_q = false; +- this.r.clear(); ++ this.field_94077_p.clear(); + this.field_94068_E = true; + return; + } + +- if(this.field_94068_E) { ++ if (this.field_94068_E) { + this.field_94068_E = false; + return; + } + + boolean var9; +- if(this.clickedSlot != null && this.mc.gameSettings.touchscreen) { +- if(var3 == 0 || var3 == 1) { +- if(this.draggedStack == null && var4 != this.clickedSlot) { ++ ++ if (this.clickedSlot != null && this.mc.gameSettings.touchscreen) { ++ if (par3 == 0 || par3 == 1) { ++ if (this.draggedStack == null && var4 != this.clickedSlot) { + this.draggedStack = this.clickedSlot.getStack(); + } + + var9 = Container.func_94527_a(var4, this.draggedStack, false); +- if(var8 != -1 && this.draggedStack != null && var9) { +- this.handleMouseClick(this.clickedSlot, this.clickedSlot.slotNumber, var3, 0); ++ ++ if (var8 != -1 && this.draggedStack != null && var9) { ++ this.handleMouseClick(this.clickedSlot, this.clickedSlot.slotNumber, par3, 0); + this.handleMouseClick(var4, var8, 0, 0); +- if(this.mc.thePlayer.inventory.getItemStack() != null) { +- this.handleMouseClick(this.clickedSlot, this.clickedSlot.slotNumber, var3, 0); +- this.field_85049_r = var1 - var5; +- this.field_85048_s = var2 - var6; ++ ++ if (this.mc.thePlayer.inventory.getItemStack() != null) { ++ this.handleMouseClick(this.clickedSlot, this.clickedSlot.slotNumber, par3, 0); ++ this.field_85049_r = par1 - var5; ++ this.field_85048_s = par2 - var6; + this.returningStackDestSlot = this.clickedSlot; + this.returningStack = this.draggedStack; + this.returningStackTime = Minecraft.getSystemTime(); + } else { + this.returningStack = null; + } +- } else if(this.draggedStack != null) { +- this.field_85049_r = var1 - var5; +- this.field_85048_s = var2 - var6; ++ } else if (this.draggedStack != null) { ++ this.field_85049_r = par1 - var5; ++ this.field_85048_s = par2 - var6; + this.returningStackDestSlot = this.clickedSlot; + this.returningStack = this.draggedStack; + this.returningStackTime = Minecraft.getSystemTime(); +@@ -513,77 +899,86 @@ + this.draggedStack = null; + this.clickedSlot = null; + } +- } else if(this.field_94076_q && !this.r.isEmpty()) { ++ } else if (this.field_94076_q && !this.field_94077_p.isEmpty()) { + this.handleMouseClick((Slot)null, -999, Container.func_94534_d(0, this.field_94071_C), 5); +- var11 = this.r.iterator(); ++ var11 = this.field_94077_p.iterator(); + +- while(var11.hasNext()) { ++ while (var11.hasNext()) { + var10 = (Slot)var11.next(); + this.handleMouseClick(var10, var10.slotNumber, Container.func_94534_d(1, this.field_94071_C), 5); + } + + this.handleMouseClick((Slot)null, -999, Container.func_94534_d(2, this.field_94071_C), 5); +- } else if(this.mc.thePlayer.inventory.getItemStack() != null) { +- if(var3 == this.mc.gameSettings.keyBindPickBlock.keyCode + 100) { +- this.handleMouseClick(var4, var8, var3, 3); ++ } else if (this.mc.thePlayer.inventory.getItemStack() != null) { ++ if (par3 == this.mc.gameSettings.keyBindPickBlock.keyCode + 100) { ++ this.handleMouseClick(var4, var8, par3, 3); + } else { +- var9 = var8 != -999 && (Keyboard.isKeyDown(Keyboard.KEY_LSHIFT) || Keyboard.isKeyDown(Keyboard.KEY_RSHIFT)); +- if(var9) { ++ var9 = var8 != -999 && (Keyboard.isKeyDown(42) || Keyboard.isKeyDown(54)); ++ ++ if (var9) { + this.field_94075_K = var4 != null && var4.getHasStack() ? var4.getStack() : null; + } +- +- this.handleMouseClick(var4, var8, var3, var9 ? 1 : 0); ++ // ToDo: Fixes dragging itemStack bug, but may be important later. ++ //this.handleMouseClick(var4, var8, par3, var9 ? 1 : 0); + } + } + } + +- if(this.mc.thePlayer.inventory.getItemStack() == null) { ++ if (this.mc.thePlayer.inventory.getItemStack() == null) { + this.field_94070_G = 0L; + } + + this.field_94076_q = false; + } + +- private boolean isMouseOverSlot(Slot var1, int var2, int var3) { +- return this.isPointInRegion(var1.xDisplayPosition, var1.yDisplayPosition, 16, 16, var2, var3); ++ /** ++ * Returns if the passed mouse position is over the specified slot. ++ */ ++ private boolean isMouseOverSlot(Slot par1Slot, int par2, int par3) { ++ return this.isPointInRegion(par1Slot.xDisplayPosition, par1Slot.yDisplayPosition, 16, 16, par2, par3); + } + +- protected boolean isPointInRegion(int var1, int var2, int var3, int var4, int var5, int var6) { ++ /** ++ * Args: left, top, width, height, pointX, pointY. Note: left, top are local to Gui, pointX, pointY are local to screen ++ */ ++ protected boolean isPointInRegion(int par1, int par2, int par3, int par4, int par5, int par6) { + int var7 = this.guiLeft; + int var8 = this.guiTop; +- var5 -= var7; +- var6 -= var8; +- return var5 >= var1 - 1 && var5 < var1 + var3 + 1 && var6 >= var2 - 1 && var6 < var2 + var4 + 1; ++ par5 -= var7; ++ par6 -= var8; ++ return par5 >= par1 - 1 && par5 < par1 + par3 + 1 && par6 >= par2 - 1 && par6 < par2 + par4 + 1; + } + +- protected void handleMouseClick(Slot var1, int var2, int var3, int var4) { +- if(var1 != null) { +- var2 = var1.slotNumber; ++ protected void handleMouseClick(Slot par1Slot, int par2, int par3, int par4) { ++ if (par1Slot != null) { ++ par2 = par1Slot.slotNumber; + } + +- this.mc.playerController.windowClick(this.inventorySlots.windowId, var2, var3, var4, this.mc.thePlayer); ++ this.mc.playerController.windowClick(this.inventorySlots.windowId, par2, par3, par4, this.mc.thePlayer); + } + +- protected void keyTyped(char var1, int var2) { +- if(var2 == 1 || var2 == this.mc.gameSettings.keyBindInventory.keyCode) { ++ /** ++ * Fired when a key is typed. This is the equivalent of KeyListener.keyTyped(KeyEvent e). ++ */ ++ protected void keyTyped(char par1, int par2) { ++ if (par2 == 1 || par2 == this.mc.gameSettings.keyBindInventory.keyCode) { + this.mc.thePlayer.closeScreen(); + } + +- this.checkHotbarKeys(var2); +- if(this.theSlot != null && this.theSlot.getHasStack()) { +- if(var2 == this.mc.gameSettings.keyBindPickBlock.keyCode) { +- this.handleMouseClick(this.theSlot, this.theSlot.slotNumber, 0, 3); +- } else if(var2 == this.mc.gameSettings.keyBindDrop.keyCode) { +- this.handleMouseClick(this.theSlot, this.theSlot.slotNumber, isCtrlKeyDown() ? 1 : 0, 4); +- } ++ this.checkHotbarKeys(par2); ++ ++ if (par2 == this.mc.gameSettings.keyBindPickBlock.keyCode && this.theSlot != null && this.theSlot.getHasStack()) { ++ this.handleMouseClick(this.theSlot, this.theSlot.slotNumber, this.ySize, 3); + } +- + } + +- protected boolean checkHotbarKeys(int var1) { +- if(this.mc.thePlayer.inventory.getItemStack() == null && this.theSlot != null) { +- for(int var2 = 0; var2 < 9; ++var2) { +- if(var1 == 2 + var2) { ++ /** ++ * This function is what controls the hotbar shortcut check when you press a number key when hovering a stack. ++ */ ++ protected boolean checkHotbarKeys(int par1) { ++ if (this.mc.thePlayer.inventory.getItemStack() == null && this.theSlot != null) { ++ for (int var2 = 0; var2 < 9; ++var2) { ++ if (par1 == 2 + var2) { + this.handleMouseClick(this.theSlot, this.theSlot.slotNumber, var2, 2); + return true; + } +@@ -593,21 +988,41 @@ + return false; + } + ++ /** ++ * Called when the screen is unloaded. Used to disable keyboard repeat events ++ */ + public void onGuiClosed() { +- if(this.mc.thePlayer != null) { ++ if (this.mc.thePlayer != null) { + this.inventorySlots.onContainerClosed(this.mc.thePlayer); + } + } + ++ /** ++ * Returns true if this GUI should pause the game when it is displayed in single-player ++ */ + public boolean doesGuiPauseGame() { + return false; + } + ++ /** ++ * Called from the main game loop to update the screen. ++ */ + public void updateScreen() { + super.updateScreen(); +- if(!this.mc.thePlayer.isEntityAlive() || this.mc.thePlayer.isDead) { ++ ++ if (!this.mc.thePlayer.isEntityAlive() || this.mc.thePlayer.isDead) { + this.mc.thePlayer.closeScreen(); + } +- +- } +-} ++ } ++} ++ ++// Spout Start ++class PositionedItemStack extends ItemStack { ++ final int position; ++ public PositionedItemStack(ItemStack item, int position) { ++ super(item.itemID, item.stackSize, item.getItemDamage()); ++ this.position = position; ++ } ++ ++} ++// Spout End diff --git a/patches/net/minecraft/src/GuiContainerCreative.java.patch b/patches/net/minecraft/src/GuiContainerCreative.java.patch new file mode 100644 index 0000000..7039fcb --- /dev/null +++ b/patches/net/minecraft/src/GuiContainerCreative.java.patch @@ -0,0 +1,1053 @@ +--- net/minecraft/src/GuiContainerCreative.java ++++ net/minecraft/src/GuiContainerCreative.java +@@ -4,117 +4,147 @@ + import java.util.Iterator; + import java.util.List; + import java.util.Map; ++ ++import net.minecraft.src.Minecraft; ++import net.minecraft.src.ResourceLocation; ++ + import org.lwjgl.input.Keyboard; + import org.lwjgl.input.Mouse; + import org.lwjgl.opengl.GL11; + import org.lwjgl.opengl.GL12; + ++import org.spoutcraft.api.material.CustomItem; ++import org.spoutcraft.api.material.MaterialData; ++ + public class GuiContainerCreative extends InventoryEffectRenderer { + private static final ResourceLocation field_110424_t = new ResourceLocation("textures/gui/container/creative_inventory/tabs.png"); + private static InventoryBasic inventory = new InventoryBasic("tmp", true, 45); ++ ++ /** Currently selected creative inventory tab index. */ + private static int selectedTabIndex = CreativeTabs.tabBlock.getTabIndex(); ++ ++ /** Amount scrolled in Creative mode inventory (0 = top, 1 = bottom) */ + private float currentScroll; ++ ++ /** True if the scrollbar is being dragged */ + private boolean isScrolling; ++ ++ /** ++ * True if the left mouse button was held down last time drawScreen was called. ++ */ + private boolean wasClicking; + private GuiTextField searchField; +- private List A; ++ ++ /** ++ * Used to back up the ContainerCreative's inventory slots before filling it with the player's inventory slots for the ++ * inventory tab. ++ */ ++ private List backupContainerSlots; + private Slot field_74235_v; + private boolean field_74234_w; + private CreativeCrafting field_82324_x; + +- public GuiContainerCreative(EntityPlayer var1) { +- super(new ContainerCreative(var1)); +- var1.openContainer = this.inventorySlots; ++ public GuiContainerCreative(EntityPlayer par1EntityPlayer) { ++ super(new ContainerCreative(par1EntityPlayer)); ++ par1EntityPlayer.openContainer = this.inventorySlots; + this.allowUserInput = true; +- var1.addStat(AchievementList.openInventory, 1); ++ par1EntityPlayer.addStat(AchievementList.openInventory, 1); + this.ySize = 136; + this.xSize = 195; + } + ++ /** ++ * Called from the main game loop to update the screen. ++ */ + public void updateScreen() { +- if(!this.mc.playerController.isInCreativeMode()) { ++ if (!this.mc.playerController.isInCreativeMode()) { + this.mc.displayGuiScreen(new GuiInventory(this.mc.thePlayer)); + } +- + } + +- protected void handleMouseClick(Slot var1, int var2, int var3, int var4) { ++ protected void handleMouseClick(Slot par1Slot, int par2, int par3, int par4) { + this.field_74234_w = true; +- boolean var5 = var4 == 1; +- var4 = var2 == -999 && var4 == 0 ? 4 : var4; ++ boolean var5 = par4 == 1; ++ par4 = par2 == -999 && par4 == 0 ? 4 : par4; + ItemStack var7; +- InventoryPlayer var11; +- if(var1 == null && selectedTabIndex != CreativeTabs.tabInventory.getTabIndex() && var4 != 5) { +- var11 = this.mc.thePlayer.inventory; +- if(var11.getItemStack() != null) { +- if(var3 == 0) { +- this.mc.thePlayer.dropPlayerItem(var11.getItemStack()); +- this.mc.playerController.func_78752_a(var11.getItemStack()); +- var11.setItemStack((ItemStack)null); ++ InventoryPlayer var10; ++ ++ if (par1Slot == null && selectedTabIndex != CreativeTabs.tabInventory.getTabIndex() && par4 != 5) { ++ var10 = this.mc.thePlayer.inventory; ++ ++ if (var10.getItemStack() != null) { ++ if (par3 == 0) { ++ this.mc.thePlayer.dropPlayerItem(var10.getItemStack()); ++ this.mc.playerController.func_78752_a(var10.getItemStack()); ++ var10.setItemStack((ItemStack)null); + } + +- if(var3 == 1) { +- var7 = var11.getItemStack().splitStack(1); ++ if (par3 == 1) { ++ var7 = var10.getItemStack().splitStack(1); + this.mc.thePlayer.dropPlayerItem(var7); + this.mc.playerController.func_78752_a(var7); +- if(var11.getItemStack().stackSize == 0) { +- var11.setItemStack((ItemStack)null); ++ ++ if (var10.getItemStack().stackSize == 0) { ++ var10.setItemStack((ItemStack)null); + } + } + } + } else { +- int var10; +- if(var1 == this.field_74235_v && var5) { +- for(var10 = 0; var10 < this.mc.thePlayer.inventoryContainer.getInventory().size(); ++var10) { +- this.mc.playerController.sendSlotPacket((ItemStack)null, var10); ++ int var11; ++ ++ if (par1Slot == this.field_74235_v && var5) { ++ for (var11 = 0; var11 < this.mc.thePlayer.inventoryContainer.getInventory().size(); ++var11) { ++ this.mc.playerController.sendSlotPacket((ItemStack)null, var11); + } + } else { + ItemStack var6; +- if(selectedTabIndex == CreativeTabs.tabInventory.getTabIndex()) { +- if(var1 == this.field_74235_v) { ++ ++ if (selectedTabIndex == CreativeTabs.tabInventory.getTabIndex()) { ++ if (par1Slot == this.field_74235_v) { + this.mc.thePlayer.inventory.setItemStack((ItemStack)null); +- } else if(var4 == 4 && var1 != null && var1.getHasStack()) { +- var6 = var1.decrStackSize(var3 == 0 ? 1 : var1.getStack().getMaxStackSize()); ++ } else if (par4 == 4 && par1Slot != null && par1Slot.getHasStack()) { ++ var6 = par1Slot.decrStackSize(par3 == 0 ? 1 : par1Slot.getStack().getMaxStackSize()); + this.mc.thePlayer.dropPlayerItem(var6); + this.mc.playerController.func_78752_a(var6); +- } else if(var4 == 4 && this.mc.thePlayer.inventory.getItemStack() != null) { ++ } else if (par4 == 4 && this.mc.thePlayer.inventory.getItemStack() != null) { + this.mc.thePlayer.dropPlayerItem(this.mc.thePlayer.inventory.getItemStack()); + this.mc.playerController.func_78752_a(this.mc.thePlayer.inventory.getItemStack()); + this.mc.thePlayer.inventory.setItemStack((ItemStack)null); + } else { +- this.mc.thePlayer.inventoryContainer.slotClick(var1 == null ? var2 : SlotCreativeInventory.func_75240_a((SlotCreativeInventory)var1).slotNumber, var3, var4, this.mc.thePlayer); ++ this.mc.thePlayer.inventoryContainer.slotClick(par1Slot == null ? par2 : SlotCreativeInventory.func_75240_a((SlotCreativeInventory)par1Slot).slotNumber, par3, par4, this.mc.thePlayer); + this.mc.thePlayer.inventoryContainer.detectAndSendChanges(); + } +- } else if(var4 != 5 && var1.inventory == inventory) { +- var11 = this.mc.thePlayer.inventory; +- var7 = var11.getItemStack(); +- ItemStack var8 = var1.getStack(); ++ } else if (par4 != 5 && par1Slot.inventory == inventory) { ++ var10 = this.mc.thePlayer.inventory; ++ var7 = var10.getItemStack(); ++ ItemStack var8 = par1Slot.getStack(); + ItemStack var9; +- if(var4 == 2) { +- if(var8 != null && var3 >= 0 && var3 < 9) { ++ ++ if (par4 == 2) { ++ if (var8 != null && par3 >= 0 && par3 < 9) { + var9 = var8.copy(); + var9.stackSize = var9.getMaxStackSize(); +- this.mc.thePlayer.inventory.setInventorySlotContents(var3, var9); ++ this.mc.thePlayer.inventory.setInventorySlotContents(par3, var9); + this.mc.thePlayer.inventoryContainer.detectAndSendChanges(); + } + + return; + } + +- if(var4 == 3) { +- if(var11.getItemStack() == null && var1.getHasStack()) { +- var9 = var1.getStack().copy(); ++ if (par4 == 3) { ++ if (var10.getItemStack() == null && par1Slot.getHasStack()) { ++ var9 = par1Slot.getStack().copy(); + var9.stackSize = var9.getMaxStackSize(); +- var11.setItemStack(var9); ++ var10.setItemStack(var9); + } + + return; + } + +- if(var4 == 4) { +- if(var8 != null) { ++ if (par4 == 4) { ++ if (var8 != null) { + var9 = var8.copy(); +- var9.stackSize = var3 == 0 ? 1 : var9.getMaxStackSize(); ++ var9.stackSize = par3 == 0 ? 1 : var9.getMaxStackSize(); + this.mc.thePlayer.dropPlayerItem(var9); + this.mc.playerController.func_78752_a(var9); + } +@@ -122,47 +152,51 @@ + return; + } + +- if(var7 != null && var8 != null && var7.isItemEqual(var8)) { +- if(var3 == 0) { +- if(var5) { ++ if (var7 != null && var8 != null && var7.isItemEqual(var8)) { ++ if (par3 == 0) { ++ if (var5) { + var7.stackSize = var7.getMaxStackSize(); +- } else if(var7.stackSize < var7.getMaxStackSize()) { ++ } else if (var7.stackSize < var7.getMaxStackSize()) { + ++var7.stackSize; + } +- } else if(var7.stackSize <= 1) { +- var11.setItemStack((ItemStack)null); ++ } else if (var7.stackSize <= 1) { ++ var10.setItemStack((ItemStack)null); + } else { + --var7.stackSize; + } +- } else if(var8 != null && var7 == null) { +- var11.setItemStack(ItemStack.copyItemStack(var8)); +- var7 = var11.getItemStack(); +- if(var5) { ++ } else if (var8 != null && var7 == null) { ++ var10.setItemStack(ItemStack.copyItemStack(var8)); ++ var7 = var10.getItemStack(); ++ ++ if (var5) { + var7.stackSize = var7.getMaxStackSize(); + } + } else { +- var11.setItemStack((ItemStack)null); ++ var10.setItemStack((ItemStack)null); + } + } else { +- this.inventorySlots.slotClick(var1 == null ? var2 : var1.slotNumber, var3, var4, this.mc.thePlayer); +- if(Container.func_94532_c(var3) == 2) { +- for(var10 = 0; var10 < 9; ++var10) { +- this.mc.playerController.sendSlotPacket(this.inventorySlots.getSlot(45 + var10).getStack(), 36 + var10); ++ this.inventorySlots.slotClick(par1Slot == null ? par2 : par1Slot.slotNumber, par3, par4, this.mc.thePlayer); ++ ++ if (Container.func_94532_c(par3) == 2) { ++ for (var11 = 0; var11 < 9; ++var11) { ++ this.mc.playerController.sendSlotPacket(this.inventorySlots.getSlot(45 + var11).getStack(), 36 + var11); + } +- } else if(var1 != null) { +- var6 = this.inventorySlots.getSlot(var1.slotNumber).getStack(); +- this.mc.playerController.sendSlotPacket(var6, var1.slotNumber - this.inventorySlots.c.size() + 9 + 36); ++ } else if (par1Slot != null) { ++ var6 = this.inventorySlots.getSlot(par1Slot.slotNumber).getStack(); ++ this.mc.playerController.sendSlotPacket(var6, par1Slot.slotNumber - this.inventorySlots.inventorySlots.size() + 9 + 36); + } + } + } + } +- + } + ++ /** ++ * Adds the buttons (and other controls) to the screen in question. ++ */ + public void initGui() { +- if(this.mc.playerController.isInCreativeMode()) { ++ if (this.mc.playerController.isInCreativeMode()) { + super.initGui(); +- this.i.clear(); ++ this.buttonList.clear(); + Keyboard.enableRepeatEvents(true); + this.searchField = new GuiTextField(this.fontRenderer, this.guiLeft + 82, this.guiTop + 6, 89, this.fontRenderer.FONT_HEIGHT); + this.searchField.setMaxStringLength(15); +@@ -173,89 +207,101 @@ + selectedTabIndex = -1; + this.setCurrentCreativeTab(CreativeTabs.creativeTabArray[var1]); + this.field_82324_x = new CreativeCrafting(this.mc); +- this.mc.thePlayer.inventoryContainer.onCraftGuiOpened(this.field_82324_x); ++ this.mc.thePlayer.inventoryContainer.addCraftingToCrafters(this.field_82324_x); + } else { + this.mc.displayGuiScreen(new GuiInventory(this.mc.thePlayer)); + } +- + } + ++ /** ++ * Called when the screen is unloaded. Used to disable keyboard repeat events ++ */ + public void onGuiClosed() { + super.onGuiClosed(); +- if(this.mc.thePlayer != null && this.mc.thePlayer.inventory != null) { ++ ++ if (this.mc.thePlayer != null && this.mc.thePlayer.inventory != null) { + this.mc.thePlayer.inventoryContainer.removeCraftingFromCrafters(this.field_82324_x); + } + + Keyboard.enableRepeatEvents(false); + } + +- protected void keyTyped(char var1, int var2) { +- if(selectedTabIndex != CreativeTabs.tabAllSearch.getTabIndex()) { +- if(GameSettings.isKeyDown(this.mc.gameSettings.keyBindChat)) { ++ /** ++ * Fired when a key is typed. This is the equivalent of KeyListener.keyTyped(KeyEvent e). ++ */ ++ protected void keyTyped(char par1, int par2) { ++ if (selectedTabIndex != CreativeTabs.tabAllSearch.getTabIndex()) { ++ if (GameSettings.isKeyDown(this.mc.gameSettings.keyBindChat)) { + this.setCurrentCreativeTab(CreativeTabs.tabAllSearch); + } else { +- super.keyTyped(var1, var2); ++ super.keyTyped(par1, par2); + } +- + } else { +- if(this.field_74234_w) { ++ if (this.field_74234_w) { + this.field_74234_w = false; + this.searchField.setText(""); + } + +- if(!this.checkHotbarKeys(var2)) { +- if(this.searchField.textboxKeyTyped(var1, var2)) { ++ if (!this.checkHotbarKeys(par2)) { ++ if (this.searchField.textboxKeyTyped(par1, par2)) { + this.updateCreativeSearch(); + } else { +- super.keyTyped(var1, var2); ++ super.keyTyped(par1, par2); + } +- + } + } + } + + private void updateCreativeSearch() { + ContainerCreative var1 = (ContainerCreative)this.inventorySlots; +- var1.a.clear(); ++ var1.itemList.clear(); + Item[] var2 = Item.itemsList; + int var3 = var2.length; +- + int var4; +- for(var4 = 0; var4 < var3; ++var4) { ++ ++ for (var4 = 0; var4 < var3; ++var4) { + Item var5 = var2[var4]; +- if(var5 != null && var5.getCreativeTab() != null) { +- var5.getSubItems(var5.itemID, (CreativeTabs)null, var1.a); ++ ++ if (var5 != null && var5.getCreativeTab() != null) { ++ var5.getSubItems(var5.itemID, (CreativeTabs)null, var1.itemList); + } + } + + Enchantment[] var8 = Enchantment.enchantmentsList; + var3 = var8.length; + +- for(var4 = 0; var4 < var3; ++var4) { +- Enchantment var11 = var8[var4]; +- if(var11 != null && var11.type != null) { +- Item.enchantedBook.func_92113_a(var11, var1.a); ++ for (var4 = 0; var4 < var3; ++var4) { ++ Enchantment var12 = var8[var4]; ++ ++ if (var12 != null && var12.type != null) { ++ Item.enchantedBook.func_92113_a(var12, var1.itemList); + } + } + +- Iterator var9 = var1.a.iterator(); ++ Iterator var9 = var1.itemList.iterator(); + String var10 = this.searchField.getText().toLowerCase(); + +- while(var9.hasNext()) { +- ItemStack var12 = (ItemStack)var9.next(); ++ while (var9.hasNext()) { ++ ItemStack var11 = (ItemStack)var9.next(); + boolean var13 = false; +- Iterator var6 = var12.getTooltip(this.mc.thePlayer, this.mc.gameSettings.advancedItemTooltips).iterator(); +- +- while(var6.hasNext()) { +- String var7 = (String)var6.next(); +- if(var7.toLowerCase().contains(var10)) { ++ Iterator var6 = var11.getTooltip(this.mc.thePlayer, this.mc.gameSettings.advancedItemTooltips).iterator(); ++ ++ while (true) { ++ if (var6.hasNext()) { ++ String var7 = (String)var6.next(); ++ ++ if (!var7.toLowerCase().contains(var10)) { ++ continue; ++ } ++ + var13 = true; +- break; +- } +- } +- +- if(!var13) { +- var9.remove(); ++ } ++ ++ if (!var13) { ++ var9.remove(); ++ } ++ ++ break; + } + } + +@@ -263,91 +309,116 @@ + var1.scrollTo(0.0F); + } + +- protected void drawGuiContainerForegroundLayer(int var1, int var2) { ++ /** ++ * Draw the foreground layer for the GuiContainer (everything in front of the items) ++ */ ++ protected void drawGuiContainerForegroundLayer(int par1, int par2) { + CreativeTabs var3 = CreativeTabs.creativeTabArray[selectedTabIndex]; +- if(var3.drawInForegroundOfTab()) { ++ ++ if (var3.drawInForegroundOfTab()) { + this.fontRenderer.drawString(I18n.getString(var3.getTranslatedTabLabel()), 8, 6, 4210752); + } +- + } + +- protected void mouseClicked(int var1, int var2, int var3) { +- if(var3 == 0) { +- int var4 = var1 - this.guiLeft; +- int var5 = var2 - this.guiTop; ++ /** ++ * Called when the mouse is clicked. ++ */ ++ protected void mouseClicked(int par1, int par2, int par3) { ++ if (par3 == 0) { ++ int var4 = par1 - this.guiLeft; ++ int var5 = par2 - this.guiTop; + CreativeTabs[] var6 = CreativeTabs.creativeTabArray; + int var7 = var6.length; + +- for(int var8 = 0; var8 < var7; ++var8) { ++ for (int var8 = 0; var8 < var7; ++var8) { + CreativeTabs var9 = var6[var8]; +- if(this.func_74232_a(var9, var4, var5)) { ++ ++ if (this.func_74232_a(var9, var4, var5)) { ++ //this.setCurrentCreativeTab(var9); Might not be needed in 1.5 + return; + } + } ++ ++ // Spout Start ++ // yes this is needed ++ handleSpoutMouse(par1, par2, true); ++ // Spout End + } + +- super.mouseClicked(var1, var2, var3); ++ super.mouseClicked(par1, par2, par3); + } + +- protected void mouseMovedOrUp(int var1, int var2, int var3) { +- if(var3 == 0) { +- int var4 = var1 - this.guiLeft; +- int var5 = var2 - this.guiTop; ++ /** ++ * Called when the mouse is moved or a mouse button is released. Signature: (mouseX, mouseY, which) which==-1 is ++ * mouseMove, which==0 or which==1 is mouseUp ++ */ ++ protected void mouseMovedOrUp(int par1, int par2, int par3) { ++ if (par3 == 0) { ++ int var4 = par1 - this.guiLeft; ++ int var5 = par2 - this.guiTop; + CreativeTabs[] var6 = CreativeTabs.creativeTabArray; + int var7 = var6.length; + +- for(int var8 = 0; var8 < var7; ++var8) { ++ for (int var8 = 0; var8 < var7; ++var8) { + CreativeTabs var9 = var6[var8]; +- if(this.func_74232_a(var9, var4, var5)) { ++ ++ if (this.func_74232_a(var9, var4, var5)) { + this.setCurrentCreativeTab(var9); + return; + } + } + } + +- super.mouseMovedOrUp(var1, var2, var3); ++ super.mouseMovedOrUp(par1, par2, par3); + } + ++ /** ++ * returns (if you are not on the inventoryTab) and (the flag isn't set) and( you have more than 1 page of items) ++ */ + private boolean needsScrollBars() { + return selectedTabIndex != CreativeTabs.tabInventory.getTabIndex() && CreativeTabs.creativeTabArray[selectedTabIndex].shouldHidePlayerInventory() && ((ContainerCreative)this.inventorySlots).hasMoreThan1PageOfItemsInList(); + } + +- private void setCurrentCreativeTab(CreativeTabs var1) { ++ private void setCurrentCreativeTab(CreativeTabs par1CreativeTabs) { + int var2 = selectedTabIndex; +- selectedTabIndex = var1.getTabIndex(); ++ selectedTabIndex = par1CreativeTabs.getTabIndex(); + ContainerCreative var3 = (ContainerCreative)this.inventorySlots; +- this.r.clear(); +- var3.a.clear(); +- var1.displayAllReleventItems(var3.a); +- if(var1 == CreativeTabs.tabInventory) { ++ this.field_94077_p.clear(); ++ var3.itemList.clear(); ++ par1CreativeTabs.displayAllReleventItems(var3.itemList); ++ ++ if (par1CreativeTabs == CreativeTabs.tabInventory) { + Container var4 = this.mc.thePlayer.inventoryContainer; +- if(this.A == null) { +- this.A = var3.c; ++ ++ if (this.backupContainerSlots == null) { ++ this.backupContainerSlots = var3.inventorySlots; + } + +- var3.c = new ArrayList(); ++ var3.inventorySlots = new ArrayList(); + +- for(int var5 = 0; var5 < var4.c.size(); ++var5) { +- SlotCreativeInventory var6 = new SlotCreativeInventory(this, (Slot)var4.c.get(var5), var5); +- var3.c.add(var6); ++ for (int var5 = 0; var5 < var4.inventorySlots.size(); ++var5) { ++ SlotCreativeInventory var6 = new SlotCreativeInventory(this, (Slot)var4.inventorySlots.get(var5), var5); ++ var3.inventorySlots.add(var6); + int var7; + int var8; + int var9; +- if(var5 >= 5 && var5 < 9) { ++ ++ if (var5 >= 5 && var5 < 9) { + var7 = var5 - 5; + var8 = var7 / 2; + var9 = var7 % 2; + var6.xDisplayPosition = 9 + var8 * 54; + var6.yDisplayPosition = 6 + var9 * 27; +- } else if(var5 >= 0 && var5 < 5) { ++ } else if (var5 >= 0 && var5 < 5) { + var6.yDisplayPosition = -2000; + var6.xDisplayPosition = -2000; +- } else if(var5 < var4.c.size()) { ++ } else if (var5 < var4.inventorySlots.size()) { + var7 = var5 - 9; + var8 = var7 % 9; + var9 = var7 / 9; + var6.xDisplayPosition = 9 + var8 * 18; +- if(var5 >= 36) { ++ ++ if (var5 >= 36) { + var6.yDisplayPosition = 112; + } else { + var6.yDisplayPosition = 54 + var9 * 18; +@@ -356,14 +427,14 @@ + } + + this.field_74235_v = new Slot(inventory, 0, 173, 112); +- var3.c.add(this.field_74235_v); +- } else if(var2 == CreativeTabs.tabInventory.getTabIndex()) { +- var3.c = this.A; +- this.A = null; ++ var3.inventorySlots.add(this.field_74235_v); ++ } else if (var2 == CreativeTabs.tabInventory.getTabIndex()) { ++ var3.inventorySlots = this.backupContainerSlots; ++ this.backupContainerSlots = null; + } + +- if(this.searchField != null) { +- if(var1 == CreativeTabs.tabAllSearch) { ++ if (this.searchField != null) { ++ if (par1CreativeTabs == CreativeTabs.tabAllSearch) { + this.searchField.setVisible(true); + this.searchField.setCanLoseFocus(false); + this.searchField.setFocused(true); +@@ -380,34 +451,42 @@ + var3.scrollTo(0.0F); + } + ++ /** ++ * Handles mouse input. ++ */ + public void handleMouseInput() { + super.handleMouseInput(); + int var1 = Mouse.getEventDWheel(); +- if(var1 != 0 && this.needsScrollBars()) { +- int var2 = ((ContainerCreative)this.inventorySlots).a.size() / 9 - 5 + 1; +- if(var1 > 0) { ++ ++ if (var1 != 0 && this.needsScrollBars()) { ++ int var2 = ((ContainerCreative)this.inventorySlots).itemList.size() / 9 - 5 + 1; ++ ++ if (var1 > 0) { + var1 = 1; + } + +- if(var1 < 0) { ++ if (var1 < 0) { + var1 = -1; + } + + this.currentScroll = (float)((double)this.currentScroll - (double)var1 / (double)var2); +- if(this.currentScroll < 0.0F) { ++ ++ if (this.currentScroll < 0.0F) { + this.currentScroll = 0.0F; + } + +- if(this.currentScroll > 1.0F) { ++ if (this.currentScroll > 1.0F) { + this.currentScroll = 1.0F; + } + + ((ContainerCreative)this.inventorySlots).scrollTo(this.currentScroll); + } +- + } + +- public void drawScreen(int var1, int var2, float var3) { ++ /** ++ * Draws the screen and all the components in it. ++ */ ++ public void drawScreen(int par1, int par2, float par3) { + boolean var4 = Mouse.isButtonDown(0); + int var5 = this.guiLeft; + int var6 = this.guiTop; +@@ -415,61 +494,72 @@ + int var8 = var6 + 18; + int var9 = var7 + 14; + int var10 = var8 + 112; +- if(!this.wasClicking && var4 && var1 >= var7 && var2 >= var8 && var1 < var9 && var2 < var10) { ++ ++ if (!this.wasClicking && var4 && par1 >= var7 && par2 >= var8 && par1 < var9 && par2 < var10) { + this.isScrolling = this.needsScrollBars(); + } + +- if(!var4) { ++ if (!var4) { + this.isScrolling = false; + } + + this.wasClicking = var4; +- if(this.isScrolling) { +- this.currentScroll = ((float)(var2 - var8) - 7.5F) / ((float)(var10 - var8) - 15.0F); +- if(this.currentScroll < 0.0F) { ++ ++ if (this.isScrolling) { ++ this.currentScroll = ((float)(par2 - var8) - 7.5F) / ((float)(var10 - var8) - 15.0F); ++ ++ if (this.currentScroll < 0.0F) { + this.currentScroll = 0.0F; + } + +- if(this.currentScroll > 1.0F) { ++ if (this.currentScroll > 1.0F) { + this.currentScroll = 1.0F; + } + + ((ContainerCreative)this.inventorySlots).scrollTo(this.currentScroll); + } + +- super.drawScreen(var1, var2, var3); ++ super.drawScreen(par1, par2, par3); + CreativeTabs[] var11 = CreativeTabs.creativeTabArray; + int var12 = var11.length; + +- for(int var13 = 0; var13 < var12; ++var13) { ++ for (int var13 = 0; var13 < var12; ++var13) { + CreativeTabs var14 = var11[var13]; +- if(this.renderCreativeInventoryHoveringText(var14, var1, var2)) { ++ ++ if (this.renderCreativeInventoryHoveringText(var14, par1, par2)) { + break; + } + } + +- if(this.field_74235_v != null && selectedTabIndex == CreativeTabs.tabInventory.getTabIndex() && this.isPointInRegion(this.field_74235_v.xDisplayPosition, this.field_74235_v.yDisplayPosition, 16, 16, var1, var2)) { +- this.drawCreativeTabHoveringText(I18n.getString("inventory.binSlot"), var1, var2); ++ // Spout Start ++ handleSpoutMouse(par1, par2, false); ++ // Spout End ++ ++ if (this.field_74235_v != null && selectedTabIndex == CreativeTabs.tabInventory.getTabIndex() && this.isPointInRegion(this.field_74235_v.xDisplayPosition, this.field_74235_v.yDisplayPosition, 16, 16, par1, par2)) { ++ this.drawCreativeTabHoveringText(I18n.getString("inventory.binSlot"), par1, par2); + } + + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + GL11.glDisable(GL11.GL_LIGHTING); + } + +- protected void drawItemStackTooltip(ItemStack var1, int var2, int var3) { +- if(selectedTabIndex == CreativeTabs.tabAllSearch.getTabIndex()) { +- List var4 = var1.getTooltip(this.mc.thePlayer, this.mc.gameSettings.advancedItemTooltips); +- CreativeTabs var5 = var1.getItem().getCreativeTab(); +- if(var5 == null && var1.itemID == Item.enchantedBook.itemID) { +- Map var6 = EnchantmentHelper.getEnchantments(var1); +- if(var6.size() == 1) { ++ protected void drawItemStackTooltip(ItemStack par1ItemStack, int par2, int par3) { ++ if (selectedTabIndex == CreativeTabs.tabAllSearch.getTabIndex()) { ++ List var4 = par1ItemStack.getTooltip(this.mc.thePlayer, this.mc.gameSettings.advancedItemTooltips); ++ CreativeTabs var5 = par1ItemStack.getItem().getCreativeTab(); ++ ++ if (var5 == null && par1ItemStack.itemID == Item.enchantedBook.itemID) { ++ Map var6 = EnchantmentHelper.getEnchantments(par1ItemStack); ++ ++ if (var6.size() == 1) { + Enchantment var7 = Enchantment.enchantmentsList[((Integer)var6.keySet().iterator().next()).intValue()]; + CreativeTabs[] var8 = CreativeTabs.creativeTabArray; + int var9 = var8.length; + +- for(int var10 = 0; var10 < var9; ++var10) { ++ for (int var10 = 0; var10 < var9; ++var10) { + CreativeTabs var11 = var8[var10]; +- if(var11.func_111226_a(var7.type)) { ++ ++ if (var11.func_111226_a(var7.type)) { + var5 = var11; + break; + } +@@ -477,41 +567,48 @@ + } + } + +- if(var5 != null) { ++ if (var5 != null) { + var4.add(1, "" + EnumChatFormatting.BOLD + EnumChatFormatting.BLUE + I18n.getString(var5.getTranslatedTabLabel())); + } + +- for(int var12 = 0; var12 < var4.size(); ++var12) { +- if(var12 == 0) { +- var4.set(var12, "\u00a7" + Integer.toHexString(var1.getRarity().rarityColor) + (String)var4.get(var12)); ++ for (int var12 = 0; var12 < var4.size(); ++var12) { ++ if (var12 == 0) { ++ var4.set(var12, "\u00a7" + Integer.toHexString(par1ItemStack.getRarity().rarityColor) + (String)var4.get(var12)); + } else { + var4.set(var12, EnumChatFormatting.GRAY + (String)var4.get(var12)); + } + } +- +- this.func_102021_a(var4, var2, var3); ++ // ToDO: might need this for tooltip ++ //this.func_102021_a(var4, par2, par3); + } else { +- super.drawItemStackTooltip(var1, var2, var3); ++ super.drawItemStackTooltip(par1ItemStack, par2, par3); + } +- + } +- +- protected void drawGuiContainerBackgroundLayer(float var1, int var2, int var3) { ++ ++ /** ++ * Draw the background layer for the GuiContainer (everything behind the items) ++ */ ++ protected void drawGuiContainerBackgroundLayer(float par1, int par2, int par3) { + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + RenderHelper.enableGUIStandardItemLighting(); + CreativeTabs var4 = CreativeTabs.creativeTabArray[selectedTabIndex]; + CreativeTabs[] var5 = CreativeTabs.creativeTabArray; + int var6 = var5.length; +- + int var7; +- for(var7 = 0; var7 < var6; ++var7) { ++ ++ for (var7 = 0; var7 < var6 - 1; ++var7) { //Spout don't render the last tab + CreativeTabs var8 = var5[var7]; + this.mc.getTextureManager().bindTexture(field_110424_t); +- if(var8.getTabIndex() != selectedTabIndex) { ++ ++ if (var8.getTabIndex() != selectedTabIndex) { + this.renderCreativeTab(var8); + } + } + ++ // Spout Start - Render ours separately ++ renderInInventory(true); ++ // Spout End ++ + this.mc.getTextureManager().bindTexture(new ResourceLocation("textures/gui/container/creative_inventory/tab_" + var4.getBackgroundImageName())); + this.drawTexturedModalRect(this.guiLeft, this.guiTop, 0, 0, this.xSize, this.ySize); + this.searchField.drawTextBox(); +@@ -520,82 +617,102 @@ + var6 = this.guiTop + 18; + var7 = var6 + 112; + this.mc.getTextureManager().bindTexture(field_110424_t); +- if(var4.shouldHidePlayerInventory()) { ++ ++ if (var4.shouldHidePlayerInventory()) { + this.drawTexturedModalRect(var9, var6 + (int)((float)(var7 - var6 - 17) * this.currentScroll), 232 + (this.needsScrollBars() ? 0 : 12), 0, 12, 15); + } + ++ // Spout Start ++ renderInInventory(false); // Render ours separately ++ if (selectedTabIndex == 12) { // Return, useless code now ++ return; ++ } ++ // Spout End ++ + this.renderCreativeTab(var4); +- if(var4 == CreativeTabs.tabInventory) { +- GuiInventory.func_110423_a(this.guiLeft + 43, this.guiTop + 45, 20, (float)(this.guiLeft + 43 - var2), (float)(this.guiTop + 45 - 30 - var3), this.mc.thePlayer); +- } +- +- } +- +- protected boolean func_74232_a(CreativeTabs var1, int var2, int var3) { +- int var4 = var1.getTabColumn(); +- int var5 = 28 * var4; +- byte var6 = 0; +- if(var4 == 5) { +- var5 = this.xSize - 28 + 2; +- } else if(var4 > 0) { +- var5 += var4; +- } +- +- int var7; +- if(var1.isTabInFirstRow()) { +- var7 = var6 - 32; +- } else { +- var7 = var6 + this.ySize; +- } +- +- return var2 >= var5 && var2 <= var5 + 28 && var3 >= var7 && var3 <= var7 + 32; +- } +- +- protected boolean renderCreativeInventoryHoveringText(CreativeTabs var1, int var2, int var3) { +- int var4 = var1.getTabColumn(); +- int var5 = 28 * var4; +- byte var6 = 0; +- if(var4 == 5) { +- var5 = this.xSize - 28 + 2; +- } else if(var4 > 0) { +- var5 += var4; +- } +- +- int var7; +- if(var1.isTabInFirstRow()) { +- var7 = var6 - 32; +- } else { +- var7 = var6 + this.ySize; +- } +- +- if(this.isPointInRegion(var5 + 3, var7 + 3, 23, 27, var2, var3)) { +- this.drawCreativeTabHoveringText(I18n.getString(var1.getTranslatedTabLabel()), var2, var3); ++ ++ if (var4 == CreativeTabs.tabInventory) { ++ GuiInventory.func_110423_a(this.guiLeft + 43, this.guiTop + 45, 20, (float)(this.guiLeft + 43 - par2), (float)(this.guiTop + 45 - 30 - par3), this.mc.thePlayer); ++ } ++ } ++ ++ protected boolean func_74232_a(CreativeTabs par1CreativeTabs, int par2, int par3) { ++ int var4 = par1CreativeTabs.getTabColumn(); ++ int var5 = 28 * var4; ++ byte var6 = 0; ++ ++ if (var4 == 5) { ++ var5 = this.xSize - 28 + 2; ++ } else if (var4 > 0) { ++ var5 += var4; ++ } ++ ++ int var7; ++ ++ if (par1CreativeTabs.isTabInFirstRow()) { ++ var7 = var6 - 32; ++ } else { ++ var7 = var6 + this.ySize; ++ } ++ ++ return par2 >= var5 && par2 <= var5 + 28 && par3 >= var7 && par3 <= var7 + 32; ++ } ++ ++ /** ++ * Renders the creative inventory hovering text if mouse is over it. Returns true if did render or false otherwise. ++ * Params: current creative tab to be checked, current mouse x position, current mouse y position. ++ */ ++ protected boolean renderCreativeInventoryHoveringText(CreativeTabs par1CreativeTabs, int par2, int par3) { ++ int var4 = par1CreativeTabs.getTabColumn(); ++ int var5 = 28 * var4; ++ byte var6 = 0; ++ ++ if (var4 == 5) { ++ var5 = this.xSize - 28 + 2; ++ } else if (var4 > 0) { ++ var5 += var4; ++ } ++ ++ int var7; ++ ++ if (par1CreativeTabs.isTabInFirstRow()) { ++ var7 = var6 - 32; ++ } else { ++ var7 = var6 + this.ySize; ++ } ++ ++ if (this.isPointInRegion(var5 + 3, var7 + 3, 23, 27, par2, par3)) { ++ this.drawCreativeTabHoveringText(I18n.getString(par1CreativeTabs.getTranslatedTabLabel()), par2, par3); + return true; + } else { + return false; + } + } + +- protected void renderCreativeTab(CreativeTabs var1) { +- boolean var2 = var1.getTabIndex() == selectedTabIndex; +- boolean var3 = var1.isTabInFirstRow(); +- int var4 = var1.getTabColumn(); ++ /** ++ * Renders passed creative inventory tab into the screen. ++ */ ++ protected void renderCreativeTab(CreativeTabs par1CreativeTabs) { ++ boolean var2 = par1CreativeTabs.getTabIndex() == selectedTabIndex; ++ boolean var3 = par1CreativeTabs.isTabInFirstRow(); ++ int var4 = par1CreativeTabs.getTabColumn(); + int var5 = var4 * 28; + int var6 = 0; + int var7 = this.guiLeft + 28 * var4; + int var8 = this.guiTop; + byte var9 = 32; +- if(var2) { ++ ++ if (var2) { + var6 += 32; + } + +- if(var4 == 5) { ++ if (var4 == 5) { + var7 = this.guiLeft + this.xSize - 28; +- } else if(var4 > 0) { ++ } else if (var4 > 0) { + var7 += var4; + } + +- if(var3) { ++ if (var3) { + var8 -= 28; + } else { + var6 += 64; +@@ -610,7 +727,7 @@ + var8 += 8 + (var3 ? 1 : -1); + GL11.glEnable(GL11.GL_LIGHTING); + GL11.glEnable(GL12.GL_RESCALE_NORMAL); +- ItemStack var10 = new ItemStack(var1.getTabIconItem()); ++ ItemStack var10 = new ItemStack(par1CreativeTabs.getTabIconItem()); + itemRenderer.renderItemAndEffectIntoGUI(this.fontRenderer, this.mc.getTextureManager(), var10, var7, var8); + itemRenderer.renderItemOverlayIntoGUI(this.fontRenderer, this.mc.getTextureManager(), var10, var7, var8); + GL11.glDisable(GL11.GL_LIGHTING); +@@ -618,22 +735,98 @@ + this.zLevel = 0.0F; + } + +- protected void actionPerformed(GuiButton var1) { +- if(var1.id == 0) { ++ /** ++ * Fired when a control is clicked. This is the equivalent of ActionListener.actionPerformed(ActionEvent e). ++ */ ++ protected void actionPerformed(GuiButton par1GuiButton) { ++ if (par1GuiButton.id == 0) { + this.mc.displayGuiScreen(new GuiAchievements(this.mc.statFileWriter)); + } + +- if(var1.id == 1) { ++ if (par1GuiButton.id == 1) { + this.mc.displayGuiScreen(new GuiStats(this, this.mc.statFileWriter)); + } +- + } + ++ /** ++ * Returns the current creative tab index. ++ */ + public int getCurrentTabIndex() { + return selectedTabIndex; + } + ++ /** ++ * Returns the creative inventory ++ */ + static InventoryBasic getInventory() { + return inventory; + } ++ ++ // Spout Start ++ public void handleSpoutMouse(int x, int y, boolean isClicked) { ++ int var7 = guiTop; ++ int var5 = guiLeft - 26; ++ boolean inside = x >= var5 && x <= var5 + 28 && y >= var7 && y <= var7 + 32; ++ if (inside) { ++ drawCreativeTabHoveringText("Custom Items", x, y); ++ if (isClicked) { ++ setCurrentCreativeTab(CreativeTabs.tabSpout); ++ /* ++ selectedTabIndex = CreativeTabs.tabSpout.getTabIndex(); ++ ContainerCreative var3 = (ContainerCreative)this.inventorySlots; ++ var3.itemList.clear(); ++ CreativeTabs.tabSpout.displayAllReleventItems(var3.itemList); ++ this.searchField.setVisible(false); ++ this.searchField.setCanLoseFocus(true); ++ this.searchField.setFocused(false); ++ this.currentScroll = 0.0F; ++ var3.scrollTo(0.0F); ++ */ ++ } ++ } ++ } ++ ++ public void renderInInventory(boolean beforeBackground) { ++ if (!beforeBackground && selectedTabIndex != 12) { ++ return; ++ } ++ Minecraft.getMinecraft().getTextureManager().bindTexture(new ResourceLocation("textures/gui/container/creative_inventory/tabs.png")); ++ byte var9 = 32; ++ ++ int startY = 0; ++ int diff = 75; ++ if (!beforeBackground) { ++ startY = 32; ++ diff=79; ++ } ++ ++ int var8 = this.guiTop; ++ int var7 = this.guiLeft-21; ++ ++ GL11.glDisable(GL11.GL_LIGHTING); ++ //this.drawTexturedModalRect(var7, var8, 56, 0, 28, var9); ++ this.drawTexturedModalRect(var7, var8, 56, startY, 25, var9/2); ++ this.drawTexturedModalRect(var7, var8 + var9/2, 56, startY+diff, 25, var9/2); ++ this.zLevel = 100.0F; ++ itemRenderer.zLevel = 100.0F; ++ var7 += 6; ++ var8 += 7; ++ GL11.glEnable(GL11.GL_LIGHTING); ++ GL11.glEnable(GL12.GL_RESCALE_NORMAL); ++ // Bypass stupidity ++ ItemStack var10; ++ if (MaterialData.getCustomItems().length == 0) { ++ var10 = new ItemStack(Item.flint); ++ } else { ++ CustomItem cItem = MaterialData.getCustomItems()[0]; ++ var10 = new ItemStack(cItem.getRawId(), 1, cItem.getRawData()); ++ } ++ // End of stupidity ++ itemRenderer.renderItemIntoGUI(this.fontRenderer, this.mc.getTextureManager(), var10, var7, var8); ++ itemRenderer.renderItemOverlayIntoGUI(this.fontRenderer, this.mc.getTextureManager(), var10, var7, var8); ++ GL11.glDisable(GL11.GL_LIGHTING); ++ itemRenderer.zLevel = 0.0F; ++ this.zLevel = 0.0F; ++ } ++ // Spout End + } diff --git a/patches/net/minecraft/src/GuiControls.java.patch b/patches/net/minecraft/src/GuiControls.java.patch new file mode 100644 index 0000000..042686b --- /dev/null +++ b/patches/net/minecraft/src/GuiControls.java.patch @@ -0,0 +1,193 @@ +--- net/minecraft/src/GuiControls.java ++++ net/minecraft/src/GuiControls.java +@@ -1,95 +1,128 @@ + package net.minecraft.src; + + public class GuiControls extends GuiScreen { ++ ++ /** ++ * A reference to the screen object that created this. Used for navigating between screens. ++ */ + private GuiScreen parentScreen; +- protected String a = "Controls"; ++ ++ /** The title string that is displayed in the top-center of the screen. */ ++ protected String screenTitle = "Controls"; ++ ++ /** Reference to the GameSettings object. */ + private GameSettings options; ++ ++ /** The ID of the button that has been pressed. */ + private int buttonId = -1; + +- public GuiControls(GuiScreen var1, GameSettings var2) { +- this.parentScreen = var1; +- this.options = var2; ++ public GuiControls(GuiScreen par1GuiScreen, GameSettings par2GameSettings) { ++ this.parentScreen = par1GuiScreen; ++ this.options = par2GameSettings; + } + ++ /** ++ * Gets the distance from the left border of the window to left border of the controls screen ++ */ + private int getLeftBorder() { + return this.width / 2 - 155; + } + ++ /** ++ * Adds the buttons (and other controls) to the screen in question. ++ */ + public void initGui() { + int var1 = this.getLeftBorder(); + +- for(int var2 = 0; var2 < this.options.keyBindings.length; ++var2) { +- this.i.add(new GuiSmallButton(var2, var1 + var2 % 2 * 160, this.height / 6 + 24 * (var2 >> 1), 70, 20, this.options.getOptionDisplayString(var2))); ++ for (int var2 = 0; var2 < this.options.keyBindings.length; ++var2) { ++ this.buttonList.add(new GuiSmallButton(var2, var1 + var2 % 2 * 160, this.height / 6 + 24 * (var2 >> 1), 70, 20, this.options.getOptionDisplayString(var2))); + } + +- this.i.add(new GuiButton(200, this.width / 2 - 100, this.height / 6 + 168, I18n.getString("gui.done"))); +- this.a = I18n.getString("controls.title"); ++ this.buttonList.add(new GuiButton(200, this.width / 2 - 100, this.height / 6 + 168, I18n.getString("gui.done"))); ++ this.screenTitle = I18n.getString("controls.title"); + } + +- protected void actionPerformed(GuiButton var1) { +- for(int var2 = 0; var2 < this.options.keyBindings.length; ++var2) { +- ((GuiButton)this.i.get(var2)).f = this.options.getOptionDisplayString(var2); ++ /** ++ * Fired when a control is clicked. This is the equivalent of ActionListener.actionPerformed(ActionEvent e). ++ */ ++ protected void actionPerformed(GuiButton par1GuiButton) { ++ for (int var2 = 0; var2 < this.options.keyBindings.length; ++var2) { ++ ((GuiButton)this.buttonList.get(var2)).displayString = this.options.getOptionDisplayString(var2); + } + +- if(var1.id == 200) { ++ if (par1GuiButton.id == 200) { + this.mc.displayGuiScreen(this.parentScreen); + } else { +- this.buttonId = var1.id; +- var1.f = "> " + this.options.getOptionDisplayString(var1.id) + " <"; +- } +- +- } +- +- protected void mouseClicked(int var1, int var2, int var3) { +- if(this.buttonId >= 0) { +- this.options.setKeyBinding(this.buttonId, -100 + var3); +- ((GuiButton)this.i.get(this.buttonId)).f = this.options.getOptionDisplayString(this.buttonId); +- this.buttonId = -1; +- KeyBinding.resetKeyBindingArrayAndHash(); +- } else { +- super.mouseClicked(var1, var2, var3); +- } +- +- } +- +- protected void keyTyped(char var1, int var2) { +- if(this.buttonId >= 0) { +- this.options.setKeyBinding(this.buttonId, var2); +- ((GuiButton)this.i.get(this.buttonId)).f = this.options.getOptionDisplayString(this.buttonId); +- this.buttonId = -1; +- KeyBinding.resetKeyBindingArrayAndHash(); +- } else { +- super.keyTyped(var1, var2); +- } +- +- } +- +- public void drawScreen(int var1, int var2, float var3) { ++ this.buttonId = par1GuiButton.id; ++ par1GuiButton.displayString = "> " + this.options.getOptionDisplayString(par1GuiButton.id) + " <"; ++ } ++ } ++ ++ /** ++ * Called when the mouse is clicked. ++ */ ++ protected void mouseClicked(int par1, int par2, int par3) { ++ if (this.buttonId >= 0) { ++ this.options.setKeyBinding(this.buttonId, -100 + par3); ++ ((GuiButton)this.buttonList.get(this.buttonId)).displayString = this.options.getOptionDisplayString(this.buttonId); ++ this.buttonId = -1; ++ KeyBinding.resetKeyBindingArrayAndHash(); ++ } else { ++ super.mouseClicked(par1, par2, par3); ++ } ++ } ++ ++ /** ++ * Fired when a key is typed. This is the equivalent of KeyListener.keyTyped(KeyEvent e). ++ */ ++ protected void keyTyped(char par1, int par2) { ++ if (this.buttonId >= 0) { ++ this.options.setKeyBinding(this.buttonId, par2); ++ ((GuiButton)this.buttonList.get(this.buttonId)).displayString = this.options.getOptionDisplayString(this.buttonId); ++ this.buttonId = -1; ++ KeyBinding.resetKeyBindingArrayAndHash(); ++ } else { ++ super.keyTyped(par1, par2); ++ } ++ } ++ ++ /** ++ * Draws the screen and all the components in it. ++ */ ++ public void drawScreen(int par1, int par2, float par3) { + this.drawDefaultBackground(); +- this.drawCenteredString(this.fontRenderer, this.a, this.width / 2, 20, 16777215); ++ this.drawCenteredString(this.fontRenderer, this.screenTitle, this.width / 2, 20, 16777215); + int var4 = this.getLeftBorder(); ++ int var5 = 0; + +- for(int var5 = 0; var5 < this.options.keyBindings.length; ++var5) { ++ while (var5 < this.options.keyBindings.length) { + boolean var6 = false; +- +- for(int var7 = 0; var7 < this.options.keyBindings.length; ++var7) { +- if(var7 != var5 && this.options.keyBindings[var5].keyCode == this.options.keyBindings[var7].keyCode) { ++ int var7 = 0; ++ ++ while (true) { ++ if (var7 < this.options.keyBindings.length) { ++ if (var7 == var5 || this.options.keyBindings[var5].keyCode != this.options.keyBindings[var7].keyCode) { ++ ++var7; ++ continue; ++ } ++ + var6 = true; +- break; +- } +- } +- +- if(this.buttonId == var5) { +- ((GuiButton)this.i.get(var5)).f = "" + EnumChatFormatting.WHITE + "> " + EnumChatFormatting.YELLOW + "??? " + EnumChatFormatting.WHITE + "<"; +- } else if(var6) { +- ((GuiButton)this.i.get(var5)).f = EnumChatFormatting.RED + this.options.getOptionDisplayString(var5); +- } else { +- ((GuiButton)this.i.get(var5)).f = this.options.getOptionDisplayString(var5); +- } +- +- this.drawString(this.fontRenderer, this.options.getKeyBindingDescription(var5), var4 + var5 % 2 * 160 + 70 + 6, this.height / 6 + 24 * (var5 >> 1) + 7, -1); ++ } ++ ++ if (this.buttonId == var5) { ++ ((GuiButton)this.buttonList.get(var5)).displayString = "" + EnumChatFormatting.WHITE + "> " + EnumChatFormatting.YELLOW + "??? " + EnumChatFormatting.WHITE + "<"; ++ } else if (var6) { ++ ((GuiButton)this.buttonList.get(var5)).displayString = EnumChatFormatting.RED + this.options.getOptionDisplayString(var5); ++ } else { ++ ((GuiButton)this.buttonList.get(var5)).displayString = this.options.getOptionDisplayString(var5); ++ } ++ ++ this.drawString(this.fontRenderer, this.options.getKeyBindingDescription(var5), var4 + var5 % 2 * 160 + 70 + 6, this.height / 6 + 24 * (var5 >> 1) + 7, -1); ++ ++var5; ++ break; ++ } + } + +- super.drawScreen(var1, var2, var3); ++ super.drawScreen(par1, par2, par3); + } + } diff --git a/patches/net/minecraft/src/GuiCrafting.java.patch b/patches/net/minecraft/src/GuiCrafting.java.patch new file mode 100644 index 0000000..bf5c451 --- /dev/null +++ b/patches/net/minecraft/src/GuiCrafting.java.patch @@ -0,0 +1,29 @@ +--- net/minecraft/src/GuiCrafting.java ++++ net/minecraft/src/GuiCrafting.java +@@ -5,16 +5,22 @@ + public class GuiCrafting extends GuiContainer { + private static final ResourceLocation craftingTableGuiTextures = new ResourceLocation("textures/gui/container/crafting_table.png"); + +- public GuiCrafting(InventoryPlayer var1, World var2, int var3, int var4, int var5) { +- super(new ContainerWorkbench(var1, var2, var3, var4, var5)); ++ public GuiCrafting(InventoryPlayer par1InventoryPlayer, World par2World, int par3, int par4, int par5) { ++ super(new ContainerWorkbench(par1InventoryPlayer, par2World, par3, par4, par5)); + } + +- protected void drawGuiContainerForegroundLayer(int var1, int var2) { ++ /** ++ * Draw the foreground layer for the GuiContainer (everything in front of the items) ++ */ ++ protected void drawGuiContainerForegroundLayer(int par1, int par2) { + this.fontRenderer.drawString(I18n.getString("container.crafting"), 28, 6, 4210752); + this.fontRenderer.drawString(I18n.getString("container.inventory"), 8, this.ySize - 96 + 2, 4210752); + } + +- protected void drawGuiContainerBackgroundLayer(float var1, int var2, int var3) { ++ /** ++ * Draw the background layer for the GuiContainer (everything behind the items) ++ */ ++ protected void drawGuiContainerBackgroundLayer(float par1, int par2, int par3) { + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + this.mc.getTextureManager().bindTexture(craftingTableGuiTextures); + int var4 = (this.width - this.xSize) / 2; diff --git a/patches/net/minecraft/src/GuiCreateFlatWorld.java.patch b/patches/net/minecraft/src/GuiCreateFlatWorld.java.patch new file mode 100644 index 0000000..cb9facc --- /dev/null +++ b/patches/net/minecraft/src/GuiCreateFlatWorld.java.patch @@ -0,0 +1,123 @@ +--- net/minecraft/src/GuiCreateFlatWorld.java ++++ net/minecraft/src/GuiCreateFlatWorld.java +@@ -4,54 +4,61 @@ + private static RenderItem theRenderItem = new RenderItem(); + private final GuiCreateWorld createWorldGui; + private FlatGeneratorInfo theFlatGeneratorInfo = FlatGeneratorInfo.getDefaultFlatGenerator(); +- private String d; +- private String e; +- private String p; ++ private String customizationTitle; ++ private String layerMaterialLabel; ++ private String heightLabel; + private GuiCreateFlatWorldListSlot createFlatWorldListSlotGui; + private GuiButton buttonAddLayer; + private GuiButton buttonEditLayer; + private GuiButton buttonRemoveLayer; + +- public GuiCreateFlatWorld(GuiCreateWorld var1, String var2) { +- this.createWorldGui = var1; +- this.setFlatGeneratorInfo(var2); ++ public GuiCreateFlatWorld(GuiCreateWorld par1GuiCreateWorld, String par2Str) { ++ this.createWorldGui = par1GuiCreateWorld; ++ this.setFlatGeneratorInfo(par2Str); + } + + public String getFlatGeneratorInfo() { + return this.theFlatGeneratorInfo.toString(); + } + +- public void setFlatGeneratorInfo(String var1) { +- this.theFlatGeneratorInfo = FlatGeneratorInfo.createFlatGeneratorFromString(var1); ++ public void setFlatGeneratorInfo(String par1Str) { ++ this.theFlatGeneratorInfo = FlatGeneratorInfo.createFlatGeneratorFromString(par1Str); + } + ++ /** ++ * Adds the buttons (and other controls) to the screen in question. ++ */ + public void initGui() { +- this.i.clear(); +- this.d = I18n.getString("createWorld.customize.flat.title"); +- this.e = I18n.getString("createWorld.customize.flat.tile"); +- this.p = I18n.getString("createWorld.customize.flat.height"); ++ this.buttonList.clear(); ++ this.customizationTitle = I18n.getString("createWorld.customize.flat.title"); ++ this.layerMaterialLabel = I18n.getString("createWorld.customize.flat.tile"); ++ this.heightLabel = I18n.getString("createWorld.customize.flat.height"); + this.createFlatWorldListSlotGui = new GuiCreateFlatWorldListSlot(this); +- this.i.add(this.buttonAddLayer = new GuiButton(2, this.width / 2 - 154, this.height - 52, 100, 20, I18n.getString("createWorld.customize.flat.addLayer") + " (NYI)")); +- this.i.add(this.buttonEditLayer = new GuiButton(3, this.width / 2 - 50, this.height - 52, 100, 20, I18n.getString("createWorld.customize.flat.editLayer") + " (NYI)")); +- this.i.add(this.buttonRemoveLayer = new GuiButton(4, this.width / 2 - 155, this.height - 52, 150, 20, I18n.getString("createWorld.customize.flat.removeLayer"))); +- this.i.add(new GuiButton(0, this.width / 2 - 155, this.height - 28, 150, 20, I18n.getString("gui.done"))); +- this.i.add(new GuiButton(5, this.width / 2 + 5, this.height - 52, 150, 20, I18n.getString("createWorld.customize.presets"))); +- this.i.add(new GuiButton(1, this.width / 2 + 5, this.height - 28, 150, 20, I18n.getString("gui.cancel"))); ++ this.buttonList.add(this.buttonAddLayer = new GuiButton(2, this.width / 2 - 154, this.height - 52, 100, 20, I18n.getString("createWorld.customize.flat.addLayer") + " (NYI)")); ++ this.buttonList.add(this.buttonEditLayer = new GuiButton(3, this.width / 2 - 50, this.height - 52, 100, 20, I18n.getString("createWorld.customize.flat.editLayer") + " (NYI)")); ++ this.buttonList.add(this.buttonRemoveLayer = new GuiButton(4, this.width / 2 - 155, this.height - 52, 150, 20, I18n.getString("createWorld.customize.flat.removeLayer"))); ++ this.buttonList.add(new GuiButton(0, this.width / 2 - 155, this.height - 28, 150, 20, I18n.getString("gui.done"))); ++ this.buttonList.add(new GuiButton(5, this.width / 2 + 5, this.height - 52, 150, 20, I18n.getString("createWorld.customize.presets"))); ++ this.buttonList.add(new GuiButton(1, this.width / 2 + 5, this.height - 28, 150, 20, I18n.getString("gui.cancel"))); + this.buttonAddLayer.drawButton = this.buttonEditLayer.drawButton = false; + this.theFlatGeneratorInfo.func_82645_d(); + this.func_82270_g(); + } + +- protected void actionPerformed(GuiButton var1) { ++ /** ++ * Fired when a control is clicked. This is the equivalent of ActionListener.actionPerformed(ActionEvent e). ++ */ ++ protected void actionPerformed(GuiButton par1GuiButton) { + int var2 = this.theFlatGeneratorInfo.getFlatLayers().size() - this.createFlatWorldListSlotGui.field_82454_a - 1; +- if(var1.id == 1) { +- this.mc.displayGuiScreen(this.createWorldGui); +- } else if(var1.id == 0) { +- this.createWorldGui.a = this.getFlatGeneratorInfo(); +- this.mc.displayGuiScreen(this.createWorldGui); +- } else if(var1.id == 5) { ++ ++ if (par1GuiButton.id == 1) { ++ this.mc.displayGuiScreen(this.createWorldGui); ++ } else if (par1GuiButton.id == 0) { ++ this.createWorldGui.generatorOptionsToUse = this.getFlatGeneratorInfo(); ++ this.mc.displayGuiScreen(this.createWorldGui); ++ } else if (par1GuiButton.id == 5) { + this.mc.displayGuiScreen(new GuiFlatPresets(this)); +- } else if(var1.id == 4 && this.func_82272_i()) { ++ } else if (par1GuiButton.id == 4 && this.func_82272_i()) { + this.theFlatGeneratorInfo.getFlatLayers().remove(var2); + this.createFlatWorldListSlotGui.field_82454_a = Math.min(this.createFlatWorldListSlotGui.field_82454_a, this.theFlatGeneratorInfo.getFlatLayers().size() - 1); + } +@@ -72,21 +79,24 @@ + return this.createFlatWorldListSlotGui.field_82454_a > -1 && this.createFlatWorldListSlotGui.field_82454_a < this.theFlatGeneratorInfo.getFlatLayers().size(); + } + +- public void drawScreen(int var1, int var2, float var3) { ++ /** ++ * Draws the screen and all the components in it. ++ */ ++ public void drawScreen(int par1, int par2, float par3) { + this.drawDefaultBackground(); +- this.createFlatWorldListSlotGui.drawScreen(var1, var2, var3); +- this.drawCenteredString(this.fontRenderer, this.d, this.width / 2, 8, 16777215); ++ this.createFlatWorldListSlotGui.drawScreen(par1, par2, par3); ++ this.drawCenteredString(this.fontRenderer, this.customizationTitle, this.width / 2, 8, 16777215); + int var4 = this.width / 2 - 92 - 16; +- this.drawString(this.fontRenderer, this.e, var4, 32, 16777215); +- this.drawString(this.fontRenderer, this.p, var4 + 2 + 213 - this.fontRenderer.getStringWidth(this.p), 32, 16777215); +- super.drawScreen(var1, var2, var3); ++ this.drawString(this.fontRenderer, this.layerMaterialLabel, var4, 32, 16777215); ++ this.drawString(this.fontRenderer, this.heightLabel, var4 + 2 + 213 - this.fontRenderer.getStringWidth(this.heightLabel), 32, 16777215); ++ super.drawScreen(par1, par2, par3); + } + + static RenderItem getRenderItem() { + return theRenderItem; + } + +- static FlatGeneratorInfo func_82271_a(GuiCreateFlatWorld var0) { +- return var0.theFlatGeneratorInfo; ++ static FlatGeneratorInfo func_82271_a(GuiCreateFlatWorld par0GuiCreateFlatWorld) { ++ return par0GuiCreateFlatWorld.theFlatGeneratorInfo; + } + } diff --git a/patches/net/minecraft/src/GuiCreateFlatWorldListSlot.java.patch b/patches/net/minecraft/src/GuiCreateFlatWorldListSlot.java.patch new file mode 100644 index 0000000..7fcb1ec --- /dev/null +++ b/patches/net/minecraft/src/GuiCreateFlatWorldListSlot.java.patch @@ -0,0 +1,124 @@ +--- net/minecraft/src/GuiCreateFlatWorldListSlot.java ++++ net/minecraft/src/GuiCreateFlatWorldListSlot.java +@@ -5,31 +5,33 @@ + + class GuiCreateFlatWorldListSlot extends GuiSlot { + public int field_82454_a; ++ + final GuiCreateFlatWorld createFlatWorldGui; + +- public GuiCreateFlatWorldListSlot(GuiCreateFlatWorld var1) { +- super(var1.mc, var1.width, var1.height, 43, var1.height - 60, 24); +- this.createFlatWorldGui = var1; ++ public GuiCreateFlatWorldListSlot(GuiCreateFlatWorld par1GuiCreateFlatWorld) { ++ super(par1GuiCreateFlatWorld.mc, par1GuiCreateFlatWorld.width, par1GuiCreateFlatWorld.height, 43, par1GuiCreateFlatWorld.height - 60, 24); ++ this.createFlatWorldGui = par1GuiCreateFlatWorld; + this.field_82454_a = -1; + } + +- private void func_82452_a(int var1, int var2, ItemStack var3) { +- this.func_82451_d(var1 + 1, var2 + 1); ++ private void func_82452_a(int par1, int par2, ItemStack par3ItemStack) { ++ this.func_82451_d(par1 + 1, par2 + 1); + GL11.glEnable(GL12.GL_RESCALE_NORMAL); +- if(var3 != null) { ++ ++ if (par3ItemStack != null) { + RenderHelper.enableGUIStandardItemLighting(); +- GuiCreateFlatWorld.getRenderItem().renderItemIntoGUI(this.createFlatWorldGui.fontRenderer, this.createFlatWorldGui.mc.getTextureManager(), var3, var1 + 2, var2 + 2); ++ GuiCreateFlatWorld.getRenderItem().renderItemIntoGUI(this.createFlatWorldGui.fontRenderer, this.createFlatWorldGui.mc.getTextureManager(), par3ItemStack, par1 + 2, par2 + 2); + RenderHelper.disableStandardItemLighting(); + } + + GL11.glDisable(GL12.GL_RESCALE_NORMAL); + } + +- private void func_82451_d(int var1, int var2) { +- this.func_82450_b(var1, var2, 0, 0); ++ private void func_82451_d(int par1, int par2) { ++ this.func_82450_b(par1, par2, 0, 0); + } + +- private void func_82450_b(int var1, int var2, int var3, int var4) { ++ private void func_82450_b(int par1, int par2, int par3, int par4) { + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + this.createFlatWorldGui.mc.getTextureManager().bindTexture(Gui.statIcons); + float var5 = 0.0078125F; +@@ -38,45 +40,54 @@ + boolean var8 = true; + Tessellator var9 = Tessellator.instance; + var9.startDrawingQuads(); +- var9.addVertexWithUV((double)(var1 + 0), (double)(var2 + 18), (double)this.createFlatWorldGui.zLevel, (double)((float)(var3 + 0) * 0.0078125F), (double)((float)(var4 + 18) * 0.0078125F)); +- var9.addVertexWithUV((double)(var1 + 18), (double)(var2 + 18), (double)this.createFlatWorldGui.zLevel, (double)((float)(var3 + 18) * 0.0078125F), (double)((float)(var4 + 18) * 0.0078125F)); +- var9.addVertexWithUV((double)(var1 + 18), (double)(var2 + 0), (double)this.createFlatWorldGui.zLevel, (double)((float)(var3 + 18) * 0.0078125F), (double)((float)(var4 + 0) * 0.0078125F)); +- var9.addVertexWithUV((double)(var1 + 0), (double)(var2 + 0), (double)this.createFlatWorldGui.zLevel, (double)((float)(var3 + 0) * 0.0078125F), (double)((float)(var4 + 0) * 0.0078125F)); ++ var9.addVertexWithUV((double)(par1 + 0), (double)(par2 + 18), (double)this.createFlatWorldGui.zLevel, (double)((float)(par3 + 0) * 0.0078125F), (double)((float)(par4 + 18) * 0.0078125F)); ++ var9.addVertexWithUV((double)(par1 + 18), (double)(par2 + 18), (double)this.createFlatWorldGui.zLevel, (double)((float)(par3 + 18) * 0.0078125F), (double)((float)(par4 + 18) * 0.0078125F)); ++ var9.addVertexWithUV((double)(par1 + 18), (double)(par2 + 0), (double)this.createFlatWorldGui.zLevel, (double)((float)(par3 + 18) * 0.0078125F), (double)((float)(par4 + 0) * 0.0078125F)); ++ var9.addVertexWithUV((double)(par1 + 0), (double)(par2 + 0), (double)this.createFlatWorldGui.zLevel, (double)((float)(par3 + 0) * 0.0078125F), (double)((float)(par4 + 0) * 0.0078125F)); + var9.draw(); + } + ++ /** ++ * Gets the size of the current slot list. ++ */ + protected int getSize() { + return GuiCreateFlatWorld.func_82271_a(this.createFlatWorldGui).getFlatLayers().size(); + } + +- protected void elementClicked(int var1, boolean var2) { +- this.field_82454_a = var1; ++ /** ++ * the element in the slot that was clicked, boolean for wether it was double clicked or not ++ */ ++ protected void elementClicked(int par1, boolean par2) { ++ this.field_82454_a = par1; + this.createFlatWorldGui.func_82270_g(); + } + +- protected boolean isSelected(int var1) { +- return var1 == this.field_82454_a; +- } +- +- protected void drawBackground() { +- } +- +- protected void drawSlot(int var1, int var2, int var3, int var4, Tessellator var5) { +- FlatLayerInfo var6 = (FlatLayerInfo)GuiCreateFlatWorld.func_82271_a(this.createFlatWorldGui).getFlatLayers().get(GuiCreateFlatWorld.func_82271_a(this.createFlatWorldGui).getFlatLayers().size() - var1 - 1); ++ /** ++ * returns true if the element passed in is currently selected ++ */ ++ protected boolean isSelected(int par1) { ++ return par1 == this.field_82454_a; ++ } ++ ++ protected void drawBackground() {} ++ ++ protected void drawSlot(int par1, int par2, int par3, int par4, Tessellator par5Tessellator) { ++ FlatLayerInfo var6 = (FlatLayerInfo)GuiCreateFlatWorld.func_82271_a(this.createFlatWorldGui).getFlatLayers().get(GuiCreateFlatWorld.func_82271_a(this.createFlatWorldGui).getFlatLayers().size() - par1 - 1); + ItemStack var7 = var6.getFillBlock() == 0 ? null : new ItemStack(var6.getFillBlock(), 1, var6.getFillBlockMeta()); + String var8 = var7 == null ? "Air" : Item.itemsList[var6.getFillBlock()].getItemStackDisplayName(var7); +- this.func_82452_a(var2, var3, var7); +- this.createFlatWorldGui.fontRenderer.drawString(var8, var2 + 18 + 5, var3 + 3, 16777215); ++ this.func_82452_a(par2, par3, var7); ++ this.createFlatWorldGui.fontRenderer.drawString(var8, par2 + 18 + 5, par3 + 3, 16777215); + String var9; +- if(var1 == 0) { +- var9 = I18n.getStringParams("createWorld.customize.flat.layer.top", new Object[]{Integer.valueOf(var6.getLayerCount())}); +- } else if(var1 == GuiCreateFlatWorld.func_82271_a(this.createFlatWorldGui).getFlatLayers().size() - 1) { +- var9 = I18n.getStringParams("createWorld.customize.flat.layer.bottom", new Object[]{Integer.valueOf(var6.getLayerCount())}); ++ ++ if (par1 == 0) { ++ var9 = I18n.getStringParams("createWorld.customize.flat.layer.top", new Object[] {Integer.valueOf(var6.getLayerCount())}); ++ } else if (par1 == GuiCreateFlatWorld.func_82271_a(this.createFlatWorldGui).getFlatLayers().size() - 1) { ++ var9 = I18n.getStringParams("createWorld.customize.flat.layer.bottom", new Object[] {Integer.valueOf(var6.getLayerCount())}); + } else { +- var9 = I18n.getStringParams("createWorld.customize.flat.layer", new Object[]{Integer.valueOf(var6.getLayerCount())}); ++ var9 = I18n.getStringParams("createWorld.customize.flat.layer", new Object[] {Integer.valueOf(var6.getLayerCount())}); + } + +- this.createFlatWorldGui.fontRenderer.drawString(var9, var2 + 2 + 213 - this.createFlatWorldGui.fontRenderer.getStringWidth(var9), var3 + 3, 16777215); ++ this.createFlatWorldGui.fontRenderer.drawString(var9, par2 + 2 + 213 - this.createFlatWorldGui.fontRenderer.getStringWidth(var9), par3 + 3, 16777215); + } + + protected int getScrollBarX() { diff --git a/patches/net/minecraft/src/GuiCreateWorld.java.patch b/patches/net/minecraft/src/GuiCreateWorld.java.patch new file mode 100644 index 0000000..23d3692 --- /dev/null +++ b/patches/net/minecraft/src/GuiCreateWorld.java.patch @@ -0,0 +1,548 @@ +--- net/minecraft/src/GuiCreateWorld.java ++++ net/minecraft/src/GuiCreateWorld.java +@@ -7,153 +7,213 @@ + private GuiScreen parentGuiScreen; + private GuiTextField textboxWorldName; + private GuiTextField textboxSeed; +- private String e; +- private String p = "survival"; ++ private String folderName; ++ ++ /** hardcore', 'creative' or 'survival */ ++ private String gameMode = "survival"; + private boolean generateStructures = true; + private boolean commandsAllowed; ++ ++ /** True iif player has clicked buttonAllowCommands at least once */ + private boolean commandsToggled; ++ ++ /** toggles when GUIButton 7 is pressed */ + private boolean bonusItems; ++ ++ /** True if and only if gameMode.equals("hardcore") */ + private boolean isHardcore; + private boolean createClicked; ++ ++ /** ++ * True if the extra options (Seed box, structure toggle button, world type button, etc.) are being shown ++ */ + private boolean moreOptions; ++ ++ /** The GUIButton that you click to change game modes. */ + private GuiButton buttonGameMode; ++ ++ /** ++ * The GUIButton that you click to get to options like the seed when creating a world. ++ */ + private GuiButton moreWorldOptions; ++ ++ /** The GuiButton in the 'More World Options' screen. Toggles ON/OFF */ + private GuiButton buttonGenerateStructures; + private GuiButton buttonBonusItems; ++ ++ /** The GuiButton in the more world options screen. */ + private GuiButton buttonWorldType; + private GuiButton buttonAllowCommands; ++ ++ /** GuiButton in the more world options screen. */ + private GuiButton buttonCustomize; +- private String E; +- private String F; +- private String G; +- private String H; ++ ++ /** The first line of text describing the currently selected game mode. */ ++ private String gameModeDescriptionLine1; ++ ++ /** The second line of text describing the currently selected game mode. */ ++ private String gameModeDescriptionLine2; ++ ++ /** The current textboxSeed text */ ++ private String seed; ++ ++ /** E.g. New World, Neue Welt, Nieuwe wereld, Neuvo Mundo */ ++ private String localizedNewWorldText; + private int worldTypeId; +- public String a = ""; +- private static final String[] J = new String[]{"CON", "COM", "PRN", "AUX", "CLOCK$", "NUL", "COM1", "COM2", "COM3", "COM4", "COM5", "COM6", "COM7", "COM8", "COM9", "LPT1", "LPT2", "LPT3", "LPT4", "LPT5", "LPT6", "LPT7", "LPT8", "LPT9"}; +- +- public GuiCreateWorld(GuiScreen var1) { +- this.parentGuiScreen = var1; +- this.G = ""; +- this.H = I18n.getString("selectWorld.newWorld"); ++ ++ /** Generator options to use when creating the world. */ ++ public String generatorOptionsToUse = ""; ++ ++ /** ++ * If the world name is one of these, it'll be surrounded with underscores. ++ */ ++ private static final String[] ILLEGAL_WORLD_NAMES = new String[] {"CON", "COM", "PRN", "AUX", "CLOCK$", "NUL", "COM1", "COM2", "COM3", "COM4", "COM5", "COM6", "COM7", "COM8", "COM9", "LPT1", "LPT2", "LPT3", "LPT4", "LPT5", "LPT6", "LPT7", "LPT8", "LPT9"}; ++ ++ public GuiCreateWorld(GuiScreen par1GuiScreen) { ++ this.parentGuiScreen = par1GuiScreen; ++ this.seed = ""; ++ this.localizedNewWorldText = I18n.getString("selectWorld.newWorld"); + } + ++ /** ++ * Called from the main game loop to update the screen. ++ */ + public void updateScreen() { + this.textboxWorldName.updateCursorCounter(); + this.textboxSeed.updateCursorCounter(); + } + ++ /** ++ * Adds the buttons (and other controls) to the screen in question. ++ */ + public void initGui() { + Keyboard.enableRepeatEvents(true); +- this.i.clear(); +- this.i.add(new GuiButton(0, this.width / 2 - 155, this.height - 28, 150, 20, I18n.getString("selectWorld.create"))); +- this.i.add(new GuiButton(1, this.width / 2 + 5, this.height - 28, 150, 20, I18n.getString("gui.cancel"))); +- this.i.add(this.buttonGameMode = new GuiButton(2, this.width / 2 - 75, 115, 150, 20, I18n.getString("selectWorld.gameMode"))); +- this.i.add(this.moreWorldOptions = new GuiButton(3, this.width / 2 - 75, 187, 150, 20, I18n.getString("selectWorld.moreWorldOptions"))); +- this.i.add(this.buttonGenerateStructures = new GuiButton(4, this.width / 2 - 155, 100, 150, 20, I18n.getString("selectWorld.mapFeatures"))); ++ this.buttonList.clear(); ++ this.buttonList.add(new GuiButton(0, this.width / 2 - 155, this.height - 28, 150, 20, I18n.getString("selectWorld.create"))); ++ this.buttonList.add(new GuiButton(1, this.width / 2 + 5, this.height - 28, 150, 20, I18n.getString("gui.cancel"))); ++ this.buttonList.add(this.buttonGameMode = new GuiButton(2, this.width / 2 - 75, 115, 150, 20, I18n.getString("selectWorld.gameMode"))); ++ this.buttonList.add(this.moreWorldOptions = new GuiButton(3, this.width / 2 - 75, 187, 150, 20, I18n.getString("selectWorld.moreWorldOptions"))); ++ this.buttonList.add(this.buttonGenerateStructures = new GuiButton(4, this.width / 2 - 155, 100, 150, 20, I18n.getString("selectWorld.mapFeatures"))); + this.buttonGenerateStructures.drawButton = false; +- this.i.add(this.buttonBonusItems = new GuiButton(7, this.width / 2 + 5, 151, 150, 20, I18n.getString("selectWorld.bonusItems"))); ++ this.buttonList.add(this.buttonBonusItems = new GuiButton(7, this.width / 2 + 5, 151, 150, 20, I18n.getString("selectWorld.bonusItems"))); + this.buttonBonusItems.drawButton = false; +- this.i.add(this.buttonWorldType = new GuiButton(5, this.width / 2 + 5, 100, 150, 20, I18n.getString("selectWorld.mapType"))); ++ this.buttonList.add(this.buttonWorldType = new GuiButton(5, this.width / 2 + 5, 100, 150, 20, I18n.getString("selectWorld.mapType"))); + this.buttonWorldType.drawButton = false; +- this.i.add(this.buttonAllowCommands = new GuiButton(6, this.width / 2 - 155, 151, 150, 20, I18n.getString("selectWorld.allowCommands"))); ++ this.buttonList.add(this.buttonAllowCommands = new GuiButton(6, this.width / 2 - 155, 151, 150, 20, I18n.getString("selectWorld.allowCommands"))); + this.buttonAllowCommands.drawButton = false; +- this.i.add(this.buttonCustomize = new GuiButton(8, this.width / 2 + 5, 120, 150, 20, I18n.getString("selectWorld.customizeType"))); ++ this.buttonList.add(this.buttonCustomize = new GuiButton(8, this.width / 2 + 5, 120, 150, 20, I18n.getString("selectWorld.customizeType"))); + this.buttonCustomize.drawButton = false; + this.textboxWorldName = new GuiTextField(this.fontRenderer, this.width / 2 - 100, 60, 200, 20); + this.textboxWorldName.setFocused(true); +- this.textboxWorldName.setText(this.H); ++ this.textboxWorldName.setText(this.localizedNewWorldText); + this.textboxSeed = new GuiTextField(this.fontRenderer, this.width / 2 - 100, 60, 200, 20); +- this.textboxSeed.setText(this.G); ++ this.textboxSeed.setText(this.seed); + this.func_82288_a(this.moreOptions); + this.makeUseableName(); + this.updateButtonText(); + } + ++ /** ++ * Makes a the name for a world save folder based on your world name, replacing specific characters for _s and ++ * appending -s to the end until a free name is available. ++ */ + private void makeUseableName() { +- this.e = this.textboxWorldName.getText().trim(); ++ this.folderName = this.textboxWorldName.getText().trim(); + char[] var1 = ChatAllowedCharacters.allowedCharactersArray; + int var2 = var1.length; + +- for(int var3 = 0; var3 < var2; ++var3) { ++ for (int var3 = 0; var3 < var2; ++var3) { + char var4 = var1[var3]; +- this.e = this.e.replace(var4, '_'); +- } +- +- if(MathHelper.stringNullOrLengthZero(this.e)) { +- this.e = "World"; +- } +- +- this.e = func_73913_a(this.mc.getSaveLoader(), this.e); ++ this.folderName = this.folderName.replace(var4, '_'); ++ } ++ ++ if (MathHelper.stringNullOrLengthZero(this.folderName)) { ++ this.folderName = "World"; ++ } ++ ++ this.folderName = func_73913_a(this.mc.getSaveLoader(), this.folderName); + } + + private void updateButtonText() { +- this.buttonGameMode.f = I18n.getString("selectWorld.gameMode") + " " + I18n.getString("selectWorld.gameMode." + this.p); +- this.E = I18n.getString("selectWorld.gameMode." + this.p + ".line1"); +- this.F = I18n.getString("selectWorld.gameMode." + this.p + ".line2"); +- this.buttonGenerateStructures.f = I18n.getString("selectWorld.mapFeatures") + " "; +- if(this.generateStructures) { +- this.buttonGenerateStructures.f = this.buttonGenerateStructures.f + I18n.getString("options.on"); +- } else { +- this.buttonGenerateStructures.f = this.buttonGenerateStructures.f + I18n.getString("options.off"); +- } +- +- this.buttonBonusItems.f = I18n.getString("selectWorld.bonusItems") + " "; +- if(this.bonusItems && !this.isHardcore) { +- this.buttonBonusItems.f = this.buttonBonusItems.f + I18n.getString("options.on"); +- } else { +- this.buttonBonusItems.f = this.buttonBonusItems.f + I18n.getString("options.off"); +- } +- +- this.buttonWorldType.f = I18n.getString("selectWorld.mapType") + " " + I18n.getString(WorldType.worldTypes[this.worldTypeId].getTranslateName()); +- this.buttonAllowCommands.f = I18n.getString("selectWorld.allowCommands") + " "; +- if(this.commandsAllowed && !this.isHardcore) { +- this.buttonAllowCommands.f = this.buttonAllowCommands.f + I18n.getString("options.on"); +- } else { +- this.buttonAllowCommands.f = this.buttonAllowCommands.f + I18n.getString("options.off"); +- } +- ++ this.buttonGameMode.displayString = I18n.getString("selectWorld.gameMode") + " " + I18n.getString("selectWorld.gameMode." + this.gameMode); ++ this.gameModeDescriptionLine1 = I18n.getString("selectWorld.gameMode." + this.gameMode + ".line1"); ++ this.gameModeDescriptionLine2 = I18n.getString("selectWorld.gameMode." + this.gameMode + ".line2"); ++ this.buttonGenerateStructures.displayString = I18n.getString("selectWorld.mapFeatures") + " "; ++ ++ if (this.generateStructures) { ++ this.buttonGenerateStructures.displayString = this.buttonGenerateStructures.displayString + I18n.getString("options.on"); ++ } else { ++ this.buttonGenerateStructures.displayString = this.buttonGenerateStructures.displayString + I18n.getString("options.off"); ++ } ++ ++ this.buttonBonusItems.displayString = I18n.getString("selectWorld.bonusItems") + " "; ++ ++ if (this.bonusItems && !this.isHardcore) { ++ this.buttonBonusItems.displayString = this.buttonBonusItems.displayString + I18n.getString("options.on"); ++ } else { ++ this.buttonBonusItems.displayString = this.buttonBonusItems.displayString + I18n.getString("options.off"); ++ } ++ ++ this.buttonWorldType.displayString = I18n.getString("selectWorld.mapType") + " " + I18n.getString(WorldType.worldTypes[this.worldTypeId].getTranslateName()); ++ this.buttonAllowCommands.displayString = I18n.getString("selectWorld.allowCommands") + " "; ++ ++ if (this.commandsAllowed && !this.isHardcore) { ++ this.buttonAllowCommands.displayString = this.buttonAllowCommands.displayString + I18n.getString("options.on"); ++ } else { ++ this.buttonAllowCommands.displayString = this.buttonAllowCommands.displayString + I18n.getString("options.off"); ++ } + } + +- public static String func_73913_a(ISaveFormat var0, String var1) { +- var1 = var1.replaceAll("[\\./\"]", "_"); +- String[] var2 = J; ++ public static String func_73913_a(ISaveFormat par0ISaveFormat, String par1Str) { ++ par1Str = par1Str.replaceAll("[\\./\"]", "_"); ++ String[] var2 = ILLEGAL_WORLD_NAMES; + int var3 = var2.length; + +- for(int var4 = 0; var4 < var3; ++var4) { ++ for (int var4 = 0; var4 < var3; ++var4) { + String var5 = var2[var4]; +- if(var1.equalsIgnoreCase(var5)) { +- var1 = "_" + var1 + "_"; ++ ++ if (par1Str.equalsIgnoreCase(var5)) { ++ par1Str = "_" + par1Str + "_"; + } + } + +- while(var0.getWorldInfo(var1) != null) { +- var1 = var1 + "-"; ++ while (par0ISaveFormat.getWorldInfo(par1Str) != null) { ++ par1Str = par1Str + "-"; + } + +- return var1; ++ return par1Str; + } + ++ /** ++ * Called when the screen is unloaded. Used to disable keyboard repeat events ++ */ + public void onGuiClosed() { + Keyboard.enableRepeatEvents(false); + } + +- protected void actionPerformed(GuiButton var1) { +- if(var1.enabled) { +- if(var1.id == 1) { ++ /** ++ * Fired when a control is clicked. This is the equivalent of ActionListener.actionPerformed(ActionEvent e). ++ */ ++ protected void actionPerformed(GuiButton par1GuiButton) { ++ if (par1GuiButton.enabled) { ++ if (par1GuiButton.id == 1) { + this.mc.displayGuiScreen(this.parentGuiScreen); +- } else if(var1.id == 0) { ++ } else if (par1GuiButton.id == 0) { + this.mc.displayGuiScreen((GuiScreen)null); +- if(this.createClicked) { ++ ++ if (this.createClicked) { + return; + } + + this.createClicked = true; + long var2 = (new Random()).nextLong(); + String var4 = this.textboxSeed.getText(); +- if(!MathHelper.stringNullOrLengthZero(var4)) { ++ ++ if (!MathHelper.stringNullOrLengthZero(var4)) { + try { + long var5 = Long.parseLong(var4); +- if(var5 != 0L) { ++ ++ if (var5 != 0L) { + var2 = var5; + } + } catch (NumberFormatException var7) { +@@ -161,50 +221,51 @@ + } + } + +- EnumGameType var8 = EnumGameType.getByName(this.p); ++ EnumGameType var8 = EnumGameType.getByName(this.gameMode); + WorldSettings var6 = new WorldSettings(var2, var8, this.generateStructures, this.isHardcore, WorldType.worldTypes[this.worldTypeId]); +- var6.func_82750_a(this.a); +- if(this.bonusItems && !this.isHardcore) { ++ var6.func_82750_a(this.generatorOptionsToUse); ++ ++ if (this.bonusItems && !this.isHardcore) { + var6.enableBonusChest(); + } + +- if(this.commandsAllowed && !this.isHardcore) { ++ if (this.commandsAllowed && !this.isHardcore) { + var6.enableCommands(); + } + +- this.mc.launchIntegratedServer(this.e, this.textboxWorldName.getText().trim(), var6); ++ this.mc.launchIntegratedServer(this.folderName, this.textboxWorldName.getText().trim(), var6); + this.mc.statFileWriter.readStat(StatList.createWorldStat, 1); +- } else if(var1.id == 3) { ++ } else if (par1GuiButton.id == 3) { + this.func_82287_i(); +- } else if(var1.id == 2) { +- if(this.p.equals("survival")) { +- if(!this.commandsToggled) { ++ } else if (par1GuiButton.id == 2) { ++ if (this.gameMode.equals("survival")) { ++ if (!this.commandsToggled) { + this.commandsAllowed = false; + } + + this.isHardcore = false; +- this.p = "hardcore"; ++ this.gameMode = "hardcore"; + this.isHardcore = true; + this.buttonAllowCommands.enabled = false; + this.buttonBonusItems.enabled = false; + this.updateButtonText(); +- } else if(this.p.equals("hardcore")) { +- if(!this.commandsToggled) { ++ } else if (this.gameMode.equals("hardcore")) { ++ if (!this.commandsToggled) { + this.commandsAllowed = true; + } + + this.isHardcore = false; +- this.p = "creative"; ++ this.gameMode = "creative"; + this.updateButtonText(); + this.isHardcore = false; + this.buttonAllowCommands.enabled = true; + this.buttonBonusItems.enabled = true; + } else { +- if(!this.commandsToggled) { ++ if (!this.commandsToggled) { + this.commandsAllowed = false; + } + +- this.p = "survival"; ++ this.gameMode = "survival"; + this.updateButtonText(); + this.buttonAllowCommands.enabled = true; + this.buttonBonusItems.enabled = true; +@@ -212,36 +273,37 @@ + } + + this.updateButtonText(); +- } else if(var1.id == 4) { ++ } else if (par1GuiButton.id == 4) { + this.generateStructures = !this.generateStructures; + this.updateButtonText(); +- } else if(var1.id == 7) { ++ } else if (par1GuiButton.id == 7) { + this.bonusItems = !this.bonusItems; + this.updateButtonText(); +- } else if(var1.id == 5) { ++ } else if (par1GuiButton.id == 5) { + ++this.worldTypeId; +- if(this.worldTypeId >= WorldType.worldTypes.length) { ++ ++ if (this.worldTypeId >= WorldType.worldTypes.length) { + this.worldTypeId = 0; + } + +- while(WorldType.worldTypes[this.worldTypeId] == null || !WorldType.worldTypes[this.worldTypeId].getCanBeCreated()) { ++ while (WorldType.worldTypes[this.worldTypeId] == null || !WorldType.worldTypes[this.worldTypeId].getCanBeCreated()) { + ++this.worldTypeId; +- if(this.worldTypeId >= WorldType.worldTypes.length) { ++ ++ if (this.worldTypeId >= WorldType.worldTypes.length) { + this.worldTypeId = 0; + } + } + +- this.a = ""; ++ this.generatorOptionsToUse = ""; + this.updateButtonText(); + this.func_82288_a(this.moreOptions); +- } else if(var1.id == 6) { ++ } else if (par1GuiButton.id == 6) { + this.commandsToggled = true; + this.commandsAllowed = !this.commandsAllowed; + this.updateButtonText(); +- } else if(var1.id == 8) { +- this.mc.displayGuiScreen(new GuiCreateFlatWorld(this, this.a)); ++ } else if (par1GuiButton.id == 8) { ++ this.mc.displayGuiScreen(new GuiCreateFlatWorld(this, this.generatorOptionsToUse)); + } +- + } + } + +@@ -249,53 +311,63 @@ + this.func_82288_a(!this.moreOptions); + } + +- private void func_82288_a(boolean var1) { +- this.moreOptions = var1; ++ private void func_82288_a(boolean par1) { ++ this.moreOptions = par1; + this.buttonGameMode.drawButton = !this.moreOptions; + this.buttonGenerateStructures.drawButton = this.moreOptions; + this.buttonBonusItems.drawButton = this.moreOptions; + this.buttonWorldType.drawButton = this.moreOptions; + this.buttonAllowCommands.drawButton = this.moreOptions; + this.buttonCustomize.drawButton = this.moreOptions && WorldType.worldTypes[this.worldTypeId] == WorldType.FLAT; +- if(this.moreOptions) { +- this.moreWorldOptions.f = I18n.getString("gui.done"); ++ ++ if (this.moreOptions) { ++ this.moreWorldOptions.displayString = I18n.getString("gui.done"); + } else { +- this.moreWorldOptions.f = I18n.getString("selectWorld.moreWorldOptions"); ++ this.moreWorldOptions.displayString = I18n.getString("selectWorld.moreWorldOptions"); + } +- + } + +- protected void keyTyped(char var1, int var2) { +- if(this.textboxWorldName.isFocused() && !this.moreOptions) { +- this.textboxWorldName.textboxKeyTyped(var1, var2); +- this.H = this.textboxWorldName.getText(); +- } else if(this.textboxSeed.isFocused() && this.moreOptions) { +- this.textboxSeed.textboxKeyTyped(var1, var2); +- this.G = this.textboxSeed.getText(); +- } +- +- if(var2 == 28 || var2 == 156) { +- this.actionPerformed((GuiButton)this.i.get(0)); +- } +- +- ((GuiButton)this.i.get(0)).enabled = this.textboxWorldName.getText().length() > 0; ++ /** ++ * Fired when a key is typed. This is the equivalent of KeyListener.keyTyped(KeyEvent e). ++ */ ++ protected void keyTyped(char par1, int par2) { ++ if (this.textboxWorldName.isFocused() && !this.moreOptions) { ++ this.textboxWorldName.textboxKeyTyped(par1, par2); ++ this.localizedNewWorldText = this.textboxWorldName.getText(); ++ } else if (this.textboxSeed.isFocused() && this.moreOptions) { ++ this.textboxSeed.textboxKeyTyped(par1, par2); ++ this.seed = this.textboxSeed.getText(); ++ } ++ ++ if (par2 == 28 || par2 == 156) { ++ this.actionPerformed((GuiButton)this.buttonList.get(0)); ++ } ++ ++ ((GuiButton)this.buttonList.get(0)).enabled = this.textboxWorldName.getText().length() > 0; + this.makeUseableName(); + } + +- protected void mouseClicked(int var1, int var2, int var3) { +- super.mouseClicked(var1, var2, var3); +- if(this.moreOptions) { +- this.textboxSeed.mouseClicked(var1, var2, var3); ++ /** ++ * Called when the mouse is clicked. ++ */ ++ protected void mouseClicked(int par1, int par2, int par3) { ++ super.mouseClicked(par1, par2, par3); ++ ++ if (this.moreOptions) { ++ this.textboxSeed.mouseClicked(par1, par2, par3); + } else { +- this.textboxWorldName.mouseClicked(var1, var2, var3); ++ this.textboxWorldName.mouseClicked(par1, par2, par3); + } +- + } + +- public void drawScreen(int var1, int var2, float var3) { ++ /** ++ * Draws the screen and all the components in it. ++ */ ++ public void drawScreen(int par1, int par2, float par3) { + this.drawDefaultBackground(); + this.drawCenteredString(this.fontRenderer, I18n.getString("selectWorld.create"), this.width / 2, 20, 16777215); +- if(this.moreOptions) { ++ ++ if (this.moreOptions) { + this.drawString(this.fontRenderer, I18n.getString("selectWorld.enterSeed"), this.width / 2 - 100, 47, 10526880); + this.drawString(this.fontRenderer, I18n.getString("selectWorld.seedInfo"), this.width / 2 - 100, 85, 10526880); + this.drawString(this.fontRenderer, I18n.getString("selectWorld.mapFeatures.info"), this.width / 2 - 150, 122, 10526880); +@@ -303,29 +375,29 @@ + this.textboxSeed.drawTextBox(); + } else { + this.drawString(this.fontRenderer, I18n.getString("selectWorld.enterName"), this.width / 2 - 100, 47, 10526880); +- this.drawString(this.fontRenderer, I18n.getString("selectWorld.resultFolder") + " " + this.e, this.width / 2 - 100, 85, 10526880); ++ this.drawString(this.fontRenderer, I18n.getString("selectWorld.resultFolder") + " " + this.folderName, this.width / 2 - 100, 85, 10526880); + this.textboxWorldName.drawTextBox(); +- this.drawString(this.fontRenderer, this.E, this.width / 2 - 100, 137, 10526880); +- this.drawString(this.fontRenderer, this.F, this.width / 2 - 100, 149, 10526880); ++ this.drawString(this.fontRenderer, this.gameModeDescriptionLine1, this.width / 2 - 100, 137, 10526880); ++ this.drawString(this.fontRenderer, this.gameModeDescriptionLine2, this.width / 2 - 100, 149, 10526880); + } + +- super.drawScreen(var1, var2, var3); ++ super.drawScreen(par1, par2, par3); + } + +- public void func_82286_a(WorldInfo var1) { +- this.H = I18n.getStringParams("selectWorld.newWorld.copyOf", new Object[]{var1.getWorldName()}); +- this.G = var1.getSeed() + ""; +- this.worldTypeId = var1.getTerrainType().getWorldTypeID(); +- this.a = var1.getGeneratorOptions(); +- this.generateStructures = var1.isMapFeaturesEnabled(); +- this.commandsAllowed = var1.areCommandsAllowed(); +- if(var1.isHardcoreModeEnabled()) { +- this.p = "hardcore"; +- } else if(var1.getGameType().isSurvivalOrAdventure()) { +- this.p = "survival"; +- } else if(var1.getGameType().isCreative()) { +- this.p = "creative"; +- } ++ public void func_82286_a(WorldInfo par1WorldInfo) { ++ this.localizedNewWorldText = I18n.getStringParams("selectWorld.newWorld.copyOf", new Object[] {par1WorldInfo.getWorldName()}); ++ this.seed = par1WorldInfo.getSeed() + ""; ++ this.worldTypeId = par1WorldInfo.getTerrainType().getWorldTypeID(); ++ this.generatorOptionsToUse = par1WorldInfo.getGeneratorOptions(); ++ this.generateStructures = par1WorldInfo.isMapFeaturesEnabled(); ++ this.commandsAllowed = par1WorldInfo.areCommandsAllowed(); + ++ if (par1WorldInfo.isHardcoreModeEnabled()) { ++ this.gameMode = "hardcore"; ++ } else if (par1WorldInfo.getGameType().isSurvivalOrAdventure()) { ++ this.gameMode = "survival"; ++ } else if (par1WorldInfo.getGameType().isCreative()) { ++ this.gameMode = "creative"; ++ } + } + } diff --git a/patches/net/minecraft/src/GuiDisconnected.java.patch b/patches/net/minecraft/src/GuiDisconnected.java.patch new file mode 100644 index 0000000..ea41e7c --- /dev/null +++ b/patches/net/minecraft/src/GuiDisconnected.java.patch @@ -0,0 +1,119 @@ +--- net/minecraft/src/GuiDisconnected.java ++++ net/minecraft/src/GuiDisconnected.java +@@ -3,52 +3,80 @@ + import java.util.Iterator; + import java.util.List; + ++import org.spoutcraft.client.SpoutClient; ++import org.spoutcraft.client.gui.server.GuiFavorites; ++ + public class GuiDisconnected extends GuiScreen { +- private String a; +- private String b; +- private Object[] c; +- private List d; ++ ++ /** The error message. */ ++ private String errorMessage; ++ ++ /** The details about the error. */ ++ private String errorDetail; ++ private Object[] field_74247_c; ++ private List field_74245_d; + private final GuiScreen field_98095_n; + +- public GuiDisconnected(GuiScreen var1, String var2, String var3, Object... var4) { +- this.field_98095_n = var1; +- this.a = I18n.getString(var2); +- this.b = var3; +- this.c = var4; +- } +- +- protected void keyTyped(char var1, int var2) { +- } +- +- public void initGui() { +- this.i.clear(); +- this.i.add(new GuiButton(0, this.width / 2 - 100, this.height / 4 + 120 + 12, I18n.getString("gui.toMenu"))); +- if(this.c != null) { +- this.d = this.fontRenderer.listFormattedStringToWidth(I18n.getStringParams(this.b, this.c), this.width - 50); ++ public GuiDisconnected(GuiScreen par1GuiScreen, String par2Str, String par3Str, Object ... par4ArrayOfObj) { ++ this.field_98095_n = par1GuiScreen; ++ this.errorMessage = I18n.getString(par2Str); ++ this.errorDetail = par3Str; ++ this.field_74247_c = par4ArrayOfObj; ++ // Spout Start ++ org.spoutcraft.client.ReconnectManager.detectKick(par2Str, par3Str, par4ArrayOfObj); ++ // Spout End ++ } ++ ++ /** ++ * Fired when a key is typed. This is the equivalent of KeyListener.keyTyped(KeyEvent e). ++ */ ++ protected void keyTyped(char par1, int par2) {} ++ ++ /** ++ * Adds the buttons (and other controls) to the screen in question. ++ */ ++ public void initGui() { ++ this.buttonList.clear(); ++ // Spout Start ++ this.buttonList.add(new GuiButton(0, this.width / 2 - 100, this.height / 4 + 120 + 12, "Back to " + SpoutClient.getInstance().getServerManager().getJoinedFromName())); ++ ++ // Spout End ++ if (this.field_74247_c != null) { ++ this.field_74245_d = this.fontRenderer.listFormattedStringToWidth(I18n.getStringParams(this.errorDetail, this.field_74247_c), this.width - 50); + } else { +- this.d = this.fontRenderer.listFormattedStringToWidth(I18n.getString(this.b), this.width - 50); +- } +- +- } +- +- protected void actionPerformed(GuiButton var1) { +- if(var1.id == 0) { +- this.mc.displayGuiScreen(this.field_98095_n); +- } +- +- } +- +- public void drawScreen(int var1, int var2, float var3) { ++ this.field_74245_d = this.fontRenderer.listFormattedStringToWidth(I18n.getString(this.errorDetail), this.width - 50); ++ } ++ } ++ ++ /** ++ * Fired when a control is clicked. This is the equivalent of ActionListener.actionPerformed(ActionEvent e). ++ */ ++ protected void actionPerformed(GuiButton par1GuiButton) { ++ if (par1GuiButton.id == 0) { ++ // Spout Start ++ this.mc.displayGuiScreen(SpoutClient.getInstance().getServerManager().getJoinedFrom()); ++ // Spout End ++ } ++ } ++ ++ /** ++ * Draws the screen and all the components in it. ++ */ ++ public void drawScreen(int par1, int par2, float par3) { + this.drawDefaultBackground(); +- this.drawCenteredString(this.fontRenderer, this.a, this.width / 2, this.height / 2 - 50, 11184810); ++ this.drawCenteredString(this.fontRenderer, this.errorMessage, this.width / 2, this.height / 2 - 50, 11184810); + int var4 = this.height / 2 - 30; +- if(this.d != null) { +- for(Iterator var5 = this.d.iterator(); var5.hasNext(); var4 += this.fontRenderer.FONT_HEIGHT) { ++ ++ if (this.field_74245_d != null) { ++ for (Iterator var5 = this.field_74245_d.iterator(); var5.hasNext(); var4 += this.fontRenderer.FONT_HEIGHT) { + String var6 = (String)var5.next(); + this.drawCenteredString(this.fontRenderer, var6, this.width / 2, var4, 16777215); + } + } + +- super.drawScreen(var1, var2, var3); ++ super.drawScreen(par1, par2, par3); ++ // Spout Start ++ org.spoutcraft.client.ReconnectManager.teleport(this.mc); ++ // Spout End + } + } diff --git a/patches/net/minecraft/src/GuiDispenser.java.patch b/patches/net/minecraft/src/GuiDispenser.java.patch new file mode 100644 index 0000000..ddcb5a4 --- /dev/null +++ b/patches/net/minecraft/src/GuiDispenser.java.patch @@ -0,0 +1,32 @@ +--- net/minecraft/src/GuiDispenser.java ++++ net/minecraft/src/GuiDispenser.java +@@ -6,18 +6,24 @@ + private static final ResourceLocation dispenserGuiTextures = new ResourceLocation("textures/gui/container/dispenser.png"); + public TileEntityDispenser theDispenser; + +- public GuiDispenser(InventoryPlayer var1, TileEntityDispenser var2) { +- super(new ContainerDispenser(var1, var2)); +- this.theDispenser = var2; ++ public GuiDispenser(InventoryPlayer par1InventoryPlayer, TileEntityDispenser par2TileEntityDispenser) { ++ super(new ContainerDispenser(par1InventoryPlayer, par2TileEntityDispenser)); ++ this.theDispenser = par2TileEntityDispenser; + } + +- protected void drawGuiContainerForegroundLayer(int var1, int var2) { ++ /** ++ * Draw the foreground layer for the GuiContainer (everything in front of the items) ++ */ ++ protected void drawGuiContainerForegroundLayer(int par1, int par2) { + String var3 = this.theDispenser.isInvNameLocalized() ? this.theDispenser.getInvName() : I18n.getString(this.theDispenser.getInvName()); + this.fontRenderer.drawString(var3, this.xSize / 2 - this.fontRenderer.getStringWidth(var3) / 2, 6, 4210752); + this.fontRenderer.drawString(I18n.getString("container.inventory"), 8, this.ySize - 96 + 2, 4210752); + } + +- protected void drawGuiContainerBackgroundLayer(float var1, int var2, int var3) { ++ /** ++ * Draw the background layer for the GuiContainer (everything behind the items) ++ */ ++ protected void drawGuiContainerBackgroundLayer(float par1, int par2, int par3) { + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + this.mc.getTextureManager().bindTexture(dispenserGuiTextures); + int var4 = (this.width - this.xSize) / 2; diff --git a/patches/net/minecraft/src/GuiDownloadTerrain.java.patch b/patches/net/minecraft/src/GuiDownloadTerrain.java.patch new file mode 100644 index 0000000..6a8b140 --- /dev/null +++ b/patches/net/minecraft/src/GuiDownloadTerrain.java.patch @@ -0,0 +1,66 @@ +--- net/minecraft/src/GuiDownloadTerrain.java ++++ net/minecraft/src/GuiDownloadTerrain.java +@@ -1,35 +1,50 @@ + package net.minecraft.src; + + public class GuiDownloadTerrain extends GuiScreen { ++ ++ /** Network object that downloads the terrain data. */ + private NetClientHandler netHandler; ++ ++ /** Counts the number of screen updates. */ + private int updateCounter; + +- public GuiDownloadTerrain(NetClientHandler var1) { +- this.netHandler = var1; +- } +- +- protected void keyTyped(char var1, int var2) { +- } +- ++ public GuiDownloadTerrain(NetClientHandler par1NetClientHandler) { ++ this.netHandler = par1NetClientHandler; ++ } ++ ++ /** ++ * Fired when a key is typed. This is the equivalent of KeyListener.keyTyped(KeyEvent e). ++ */ ++ protected void keyTyped(char par1, int par2) {} ++ ++ /** ++ * Adds the buttons (and other controls) to the screen in question. ++ */ + public void initGui() { +- this.i.clear(); ++ this.buttonList.clear(); + } + ++ /** ++ * Called from the main game loop to update the screen. ++ */ + public void updateScreen() { + ++this.updateCounter; +- if(this.updateCounter % 20 == 0) { ++ ++ if (this.updateCounter % 20 == 0) { + this.netHandler.addToSendQueue(new Packet0KeepAlive()); + } + +- if(this.netHandler != null) { ++ if (this.netHandler != null) { + this.netHandler.processReadPackets(); + } +- + } + +- public void drawScreen(int var1, int var2, float var3) { ++ /** ++ * Draws the screen and all the components in it. ++ */ ++ public void drawScreen(int par1, int par2, float par3) { + this.drawBackground(0); + this.drawCenteredString(this.fontRenderer, I18n.getString("multiplayer.downloadingTerrain"), this.width / 2, this.height / 2 - 50, 16777215); +- super.drawScreen(var1, var2, var3); ++ super.drawScreen(par1, par2, par3); + } + } diff --git a/patches/net/minecraft/src/GuiEditSign.java.patch b/patches/net/minecraft/src/GuiEditSign.java.patch new file mode 100644 index 0000000..3aa4dc2 --- /dev/null +++ b/patches/net/minecraft/src/GuiEditSign.java.patch @@ -0,0 +1,291 @@ +--- net/minecraft/src/GuiEditSign.java ++++ net/minecraft/src/GuiEditSign.java +@@ -3,97 +3,222 @@ + import org.lwjgl.input.Keyboard; + import org.lwjgl.opengl.GL11; + ++import org.bukkit.ChatColor; ++ ++import org.spoutcraft.api.Spoutcraft; ++ + public class GuiEditSign extends GuiScreen { +- private static final String b = ChatAllowedCharacters.a; +- protected String a = "Edit sign message:"; ++ ++ /** ++ * This String is just a local copy of the characters allowed in text rendering of minecraft. ++ */ ++ private static final String allowedCharacters = ChatAllowedCharacters.allowedCharacters; ++ ++ /** The title string that is displayed in the top-center of the screen. */ ++ protected String screenTitle = "Edit sign message:"; ++ ++ /** Reference to the sign object. */ + private TileEntitySign entitySign; ++ ++ /** Counts the number of screen updates. */ + private int updateCounter; ++ ++ /** The number of the line that is being edited. */ + private int editLine; ++ ++ /** "Done" button for the GUI. */ + private GuiButton doneBtn; + +- public GuiEditSign(TileEntitySign var1) { +- this.entitySign = var1; ++ // Spout Start ++ private int editColumn; ++ // Spout End ++ ++ public GuiEditSign(TileEntitySign par1TileEntitySign) { ++ this.entitySign = par1TileEntitySign; + } + ++ /** ++ * Adds the buttons (and other controls) to the screen in question. ++ */ + public void initGui() { +- this.i.clear(); ++ this.buttonList.clear(); + Keyboard.enableRepeatEvents(true); +- this.i.add(this.doneBtn = new GuiButton(0, this.width / 2 - 100, this.height / 4 + 120, "Done")); ++ this.buttonList.add(this.doneBtn = new GuiButton(0, this.width / 2 - 100, this.height / 4 + 120, "Done")); + this.entitySign.setEditable(false); + } + ++ /** ++ * Called when the screen is unloaded. Used to disable keyboard repeat events ++ */ + public void onGuiClosed() { ++ // Spout Start ++ entitySign.lineBeingEdited = -1; ++ entitySign.columnBeingEdited = -1; ++ entitySign.recalculateText(); ++ // Colorize text ++ if (sendAsUnicode()) { ++ for (int i = 0; i < entitySign.signText.length; i++) { ++ if (entitySign.signText[i] != null) ++ entitySign.signText[i] = entitySign.signText[i].replaceAll("(&([a-fA-F0-9]))", "\u00A7$2"); ++ } ++ } ++ // Spout End + Keyboard.enableRepeatEvents(false); + NetClientHandler var1 = this.mc.getNetHandler(); +- if(var1 != null) { +- var1.addToSendQueue(new Packet130UpdateSign(this.entitySign.xCoord, this.entitySign.yCoord, this.entitySign.zCoord, this.entitySign.a)); ++ ++ if (var1 != null) { ++ var1.addToSendQueue(new Packet130UpdateSign(this.entitySign.xCoord, this.entitySign.yCoord, this.entitySign.zCoord, this.entitySign.signText)); + } + + this.entitySign.setEditable(true); + } + ++ /** ++ * Called from the main game loop to update the screen. ++ */ + public void updateScreen() { + ++this.updateCounter; + } + +- protected void actionPerformed(GuiButton var1) { +- if(var1.enabled) { +- if(var1.id == 0) { ++ /** ++ * Fired when a control is clicked. This is the equivalent of ActionListener.actionPerformed(ActionEvent e). ++ */ ++ protected void actionPerformed(GuiButton par1GuiButton) { ++ if (par1GuiButton.enabled) { ++ if (par1GuiButton.id == 0) { ++ // Spout Start ++ if (!Spoutcraft.hasPermission("spout.plugin.signcolors")) { ++ for (int i = 0; i < entitySign.signText.length; i++) { ++ entitySign.signText[i] = ChatColor.stripColor(entitySign.signText[i]); ++ } ++ } ++ // Spout End + this.entitySign.onInventoryChanged(); + this.mc.displayGuiScreen((GuiScreen)null); + } +- + } + } + +- protected void keyTyped(char var1, int var2) { +- if(var2 == 200) { ++ /** ++ * Fired when a key is typed. This is the equivalent of KeyListener.keyTyped(KeyEvent e). ++ */ ++ // Spout Start - Rewritten Method ++ protected void keyTyped(char par1, int par2) { ++ if (par2 == 200) { // Up + this.editLine = this.editLine - 1 & 3; ++ editColumn = entitySign.signText[editLine].length(); + } + +- if(var2 == 208 || var2 == 28 || var2 == 156) { ++ if (par2 == 208 || par2 == 28 || par2 == 156) { // Down + this.editLine = this.editLine + 1 & 3; +- } +- +- if(var2 == 14 && this.entitySign.a[this.editLine].length() > 0) { +- this.entitySign.a[this.editLine] = this.entitySign.a[this.editLine].substring(0, this.entitySign.a[this.editLine].length() - 1); +- } +- +- if(b.indexOf(var1) >= 0 && this.entitySign.a[this.editLine].length() < 15) { +- this.entitySign.a[this.editLine] = this.entitySign.a[this.editLine] + var1; +- } +- +- if(var2 == 1) { +- this.actionPerformed(this.doneBtn); +- } +- ++ editColumn = entitySign.signText[editLine].length(); ++ } ++ ++ if (par2 == 205) { // Right ++ editColumn++; ++ if (editColumn > entitySign.signText[editLine].length()) { ++ editColumn--; ++ } ++ } ++ ++ if (par2 == 203) {// Left ++ editColumn--; ++ if (editColumn < 0) { ++ editColumn = 0; ++ } ++ } ++ ++ if (par2 == 14 && this.entitySign.signText[this.editLine].length() > 0) { // Backspace ++ String line = entitySign.signText[editLine]; ++ int endColumnStart = Math.min(editColumn, line.length()); ++ String before = ""; ++ if (endColumnStart > 0) { ++ before = line.substring(0, endColumnStart); ++ } ++ String after = ""; ++ if (line.length() - editColumn > 0) { ++ after = line.substring(editColumn, line.length()); ++ } ++ if (before.length() > 0) { ++ before = before.substring(0, before.length() - 1); ++ line = before + after; ++ entitySign.signText[editLine] = line; ++ endColumnStart--; ++ editColumn = endColumnStart; ++ if (editColumn < 0) { ++ editColumn = 0; ++ } ++ } ++ } ++ ++ if ((allowedCharacters.indexOf(par1) > -1 || par1 > 32) && this.entitySign.signText[this.editLine].length() < 15) { // Enter ++ String line = entitySign.signText[editLine]; ++ ++ // Prevent out of bounds on the substring call ++ int endColumnStart = Math.min(editColumn, line.length()); ++ String before = ""; ++ if (endColumnStart > 0) { ++ before = line.substring(0, endColumnStart); ++ } ++ String after = ""; ++ if (line.length() - endColumnStart > 0) { ++ after = line.substring(endColumnStart, line.length()); ++ } ++ before += par1; ++ line = before + after; ++ entitySign.signText[editLine] = line; ++ endColumnStart++; ++ editColumn = endColumnStart; ++ } ++ ++ if (par2 == 211) { // Delete ++ String line = entitySign.signText[editLine]; ++ String before = line.substring(0, editColumn); ++ String after = ""; ++ if (line.length() - editColumn > 0) { ++ after = line.substring(editColumn, line.length()); ++ } ++ if (after.length() > 0) { ++ after = after.substring(1, after.length()); ++ line = before + after; ++ entitySign.signText[editLine] = line; ++ } ++ } ++ ++ entitySign.recalculateText(); + } ++ // Spout End + +- public void drawScreen(int var1, int var2, float var3) { ++ /** ++ * Draws the screen and all the components in it. ++ */ ++ public void drawScreen(int par1, int par2, float par3) { + this.drawDefaultBackground(); +- this.drawCenteredString(this.fontRenderer, this.a, this.width / 2, 40, 16777215); ++ this.drawCenteredString(this.fontRenderer, this.screenTitle, this.width / 2, 40, 16777215); + GL11.glPushMatrix(); + GL11.glTranslatef((float)(this.width / 2), 0.0F, 50.0F); + float var4 = 93.75F; + GL11.glScalef(-var4, -var4, -var4); + GL11.glRotatef(180.0F, 0.0F, 1.0F, 0.0F); + Block var5 = this.entitySign.getBlockType(); +- if(var5 == Block.signPost) { ++ ++ if (var5 == Block.signPost) { + float var6 = (float)(this.entitySign.getBlockMetadata() * 360) / 16.0F; + GL11.glRotatef(var6, 0.0F, 1.0F, 0.0F); + GL11.glTranslatef(0.0F, -1.0625F, 0.0F); + } else { + int var8 = this.entitySign.getBlockMetadata(); + float var7 = 0.0F; +- if(var8 == 2) { ++ ++ if (var8 == 2) { + var7 = 180.0F; + } + +- if(var8 == 4) { ++ if (var8 == 4) { + var7 = 90.0F; + } + +- if(var8 == 5) { ++ if (var8 == 5) { + var7 = -90.0F; + } + +@@ -101,13 +226,25 @@ + GL11.glTranslatef(0.0F, -1.0625F, 0.0F); + } + +- if(this.updateCounter / 6 % 2 == 0) { +- this.entitySign.lineBeingEdited = this.editLine; +- } ++ // Spout Start ++ //if(this.updateCounter / 6 % 2 == 0) { ++ this.entitySign.lineBeingEdited = this.editLine; ++ entitySign.columnBeingEdited = editColumn; ++ //} ++ // Spout End + + TileEntityRenderer.instance.renderTileEntityAt(this.entitySign, -0.5D, -0.75D, -0.5D, 0.0F); + this.entitySign.lineBeingEdited = -1; ++ // Spout Start ++ entitySign.columnBeingEdited = -1; ++ // Spout End + GL11.glPopMatrix(); +- super.drawScreen(var1, var2, var3); +- } ++ super.drawScreen(par1, par2, par3); ++ } ++ ++ // Spout Start ++ public boolean sendAsUnicode() { ++ return !this.mc.theWorld.isRemote; ++ } ++ // Spout End + } diff --git a/patches/net/minecraft/src/GuiEnchantment.java.patch b/patches/net/minecraft/src/GuiEnchantment.java.patch new file mode 100644 index 0000000..044bb4c --- /dev/null +++ b/patches/net/minecraft/src/GuiEnchantment.java.patch @@ -0,0 +1,238 @@ +--- net/minecraft/src/GuiEnchantment.java ++++ net/minecraft/src/GuiEnchantment.java +@@ -8,9 +8,13 @@ + public class GuiEnchantment extends GuiContainer { + private static final ResourceLocation enchantingTableGuiTextures = new ResourceLocation("textures/gui/container/enchanting_table.png"); + private static final ResourceLocation enchantingTableBookTextures = new ResourceLocation("textures/entity/enchanting_table_book.png"); ++ ++ /** The book model used on the GUI. */ + private static final ModelBook bookModel = new ModelBook(); +- private Random E = new Random(); +- private ContainerEnchantment containerEnchantment = (ContainerEnchantment)this.inventorySlots; ++ private Random rand = new Random(); ++ ++ /** ContainerEnchantment object associated with this gui */ ++ private ContainerEnchantment containerEnchantment; + public int field_74214_o; + public float field_74213_p; + public float field_74212_q; +@@ -19,39 +23,52 @@ + public float field_74209_t; + public float field_74208_u; + ItemStack theItemStack; +- private String G; ++ private String field_94079_C; + +- public GuiEnchantment(InventoryPlayer var1, World var2, int var3, int var4, int var5, String var6) { +- super(new ContainerEnchantment(var1, var2, var3, var4, var5)); +- this.G = var6; ++ public GuiEnchantment(InventoryPlayer par1InventoryPlayer, World par2World, int par3, int par4, int par5, String par6Str) { ++ super(new ContainerEnchantment(par1InventoryPlayer, par2World, par3, par4, par5)); ++ this.containerEnchantment = (ContainerEnchantment)this.inventorySlots; ++ this.field_94079_C = par6Str; + } + +- protected void drawGuiContainerForegroundLayer(int var1, int var2) { +- this.fontRenderer.drawString(this.G == null ? I18n.getString("container.enchant") : this.G, 12, 5, 4210752); ++ /** ++ * Draw the foreground layer for the GuiContainer (everything in front of the items) ++ */ ++ protected void drawGuiContainerForegroundLayer(int par1, int par2) { ++ this.fontRenderer.drawString(this.field_94079_C == null ? I18n.getString("container.enchant") : this.field_94079_C, 12, 5, 4210752); + this.fontRenderer.drawString(I18n.getString("container.inventory"), 8, this.ySize - 96 + 2, 4210752); + } + ++ /** ++ * Called from the main game loop to update the screen. ++ */ + public void updateScreen() { + super.updateScreen(); + this.func_74205_h(); + } + +- protected void mouseClicked(int var1, int var2, int var3) { +- super.mouseClicked(var1, var2, var3); ++ /** ++ * Called when the mouse is clicked. ++ */ ++ protected void mouseClicked(int par1, int par2, int par3) { ++ super.mouseClicked(par1, par2, par3); + int var4 = (this.width - this.xSize) / 2; + int var5 = (this.height - this.ySize) / 2; + +- for(int var6 = 0; var6 < 3; ++var6) { +- int var7 = var1 - (var4 + 60); +- int var8 = var2 - (var5 + 14 + 19 * var6); +- if(var7 >= 0 && var8 >= 0 && var7 < 108 && var8 < 19 && this.containerEnchantment.enchantItem(this.mc.thePlayer, var6)) { ++ for (int var6 = 0; var6 < 3; ++var6) { ++ int var7 = par1 - (var4 + 60); ++ int var8 = par2 - (var5 + 14 + 19 * var6); ++ ++ if (var7 >= 0 && var8 >= 0 && var7 < 108 && var8 < 19 && this.containerEnchantment.enchantItem(this.mc.thePlayer, var6)) { + this.mc.playerController.sendEnchantPacket(this.containerEnchantment.windowId, var6); + } + } +- + } + +- protected void drawGuiContainerBackgroundLayer(float var1, int var2, int var3) { ++ /** ++ * Draw the background layer for the GuiContainer (everything behind the items) ++ */ ++ protected void drawGuiContainerBackgroundLayer(float par1, int par2, int par3) { + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + this.mc.getTextureManager().bindTexture(enchantingTableGuiTextures); + int var4 = (this.width - this.xSize) / 2; +@@ -64,7 +81,7 @@ + ScaledResolution var6 = new ScaledResolution(this.mc.gameSettings, this.mc.displayWidth, this.mc.displayHeight); + GL11.glViewport((var6.getScaledWidth() - 320) / 2 * var6.getScaleFactor(), (var6.getScaledHeight() - 240) / 2 * var6.getScaleFactor(), 320 * var6.getScaleFactor(), 240 * var6.getScaleFactor()); + GL11.glTranslatef(-0.34F, 0.23F, 0.0F); +- Project.gluPerspective(90.0F, 4.0F / 3.0F, 9.0F, 80.0F); ++ Project.gluPerspective(90.0F, 1.3333334F, 9.0F, 80.0F); + float var7 = 1.0F; + GL11.glMatrixMode(GL11.GL_MODELVIEW); + GL11.glLoadIdentity(); +@@ -76,32 +93,33 @@ + GL11.glRotatef(180.0F, 0.0F, 0.0F, 1.0F); + this.mc.getTextureManager().bindTexture(enchantingTableBookTextures); + GL11.glRotatef(20.0F, 1.0F, 0.0F, 0.0F); +- float var9 = this.field_74208_u + (this.field_74209_t - this.field_74208_u) * var1; ++ float var9 = this.field_74208_u + (this.field_74209_t - this.field_74208_u) * par1; + GL11.glTranslatef((1.0F - var9) * 0.2F, (1.0F - var9) * 0.1F, (1.0F - var9) * 0.25F); + GL11.glRotatef(-(1.0F - var9) * 90.0F - 90.0F, 0.0F, 1.0F, 0.0F); + GL11.glRotatef(180.0F, 1.0F, 0.0F, 0.0F); +- float var10 = this.field_74212_q + (this.field_74213_p - this.field_74212_q) * var1 + 0.25F; +- float var11 = this.field_74212_q + (this.field_74213_p - this.field_74212_q) * var1 + 12.0F / 16.0F; ++ float var10 = this.field_74212_q + (this.field_74213_p - this.field_74212_q) * par1 + 0.25F; ++ float var11 = this.field_74212_q + (this.field_74213_p - this.field_74212_q) * par1 + 0.75F; + var10 = (var10 - (float)MathHelper.truncateDoubleToInt((double)var10)) * 1.6F - 0.3F; + var11 = (var11 - (float)MathHelper.truncateDoubleToInt((double)var11)) * 1.6F - 0.3F; +- if(var10 < 0.0F) { ++ ++ if (var10 < 0.0F) { + var10 = 0.0F; + } + +- if(var11 < 0.0F) { ++ if (var11 < 0.0F) { + var11 = 0.0F; + } + +- if(var10 > 1.0F) { ++ if (var10 > 1.0F) { + var10 = 1.0F; + } + +- if(var11 > 1.0F) { ++ if (var11 > 1.0F) { + var11 = 1.0F; + } + + GL11.glEnable(GL12.GL_RESCALE_NORMAL); +- bookModel.render((Entity)null, 0.0F, var10, var11, var9, 0.0F, 1.0F / 16.0F); ++ bookModel.render((Entity)null, 0.0F, var10, var11, var9, 0.0F, 0.0625F); + GL11.glDisable(GL12.GL_RESCALE_NORMAL); + RenderHelper.disableStandardItemLighting(); + GL11.glMatrixMode(GL11.GL_PROJECTION); +@@ -113,28 +131,31 @@ + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + EnchantmentNameParts.instance.setRandSeed(this.containerEnchantment.nameSeed); + +- for(int var12 = 0; var12 < 3; ++var12) { ++ for (int var12 = 0; var12 < 3; ++var12) { + String var13 = EnchantmentNameParts.instance.generateRandomEnchantName(); + this.zLevel = 0.0F; + this.mc.getTextureManager().bindTexture(enchantingTableGuiTextures); + int var14 = this.containerEnchantment.enchantLevels[var12]; + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); +- if(var14 == 0) { ++ ++ if (var14 == 0) { + this.drawTexturedModalRect(var4 + 60, var5 + 14 + 19 * var12, 0, 185, 108, 19); + } else { + String var15 = "" + var14; + FontRenderer var16 = this.mc.standardGalacticFontRenderer; + int var17 = 6839882; +- if(this.mc.thePlayer.experienceLevel < var14 && !this.mc.thePlayer.capabilities.isCreativeMode) { ++ ++ if (this.mc.thePlayer.experienceLevel < var14 && !this.mc.thePlayer.capabilities.isCreativeMode) { + this.drawTexturedModalRect(var4 + 60, var5 + 14 + 19 * var12, 0, 185, 108, 19); + var16.drawSplitString(var13, var4 + 62, var5 + 16 + 19 * var12, 104, (var17 & 16711422) >> 1); + var16 = this.mc.fontRenderer; + var17 = 4226832; + var16.drawStringWithShadow(var15, var4 + 62 + 104 - var16.getStringWidth(var15), var5 + 16 + 19 * var12 + 7, var17); + } else { +- int var18 = var2 - (var4 + 60); +- int var19 = var3 - (var5 + 14 + 19 * var12); +- if(var18 >= 0 && var19 >= 0 && var18 < 108 && var19 < 19) { ++ int var18 = par2 - (var4 + 60); ++ int var19 = par3 - (var5 + 14 + 19 * var12); ++ ++ if (var18 >= 0 && var19 >= 0 && var18 < 108 && var19 < 19) { + this.drawTexturedModalRect(var4 + 60, var5 + 14 + 19 * var12, 0, 204, 108, 19); + var17 = 16777088; + } else { +@@ -148,17 +169,17 @@ + } + } + } +- + } + + public void func_74205_h() { + ItemStack var1 = this.inventorySlots.getSlot(0).getStack(); +- if(!ItemStack.areItemStacksEqual(var1, this.theItemStack)) { ++ ++ if (!ItemStack.areItemStacksEqual(var1, this.theItemStack)) { + this.theItemStack = var1; + + do { +- this.field_74211_r += (float)(this.E.nextInt(4) - this.E.nextInt(4)); +- } while(this.field_74213_p <= this.field_74211_r + 1.0F && this.field_74213_p >= this.field_74211_r - 1.0F); ++ this.field_74211_r += (float)(this.rand.nextInt(4) - this.rand.nextInt(4)); ++ } while (this.field_74213_p <= this.field_74211_r + 1.0F && this.field_74213_p >= this.field_74211_r - 1.0F); + } + + ++this.field_74214_o; +@@ -166,33 +187,34 @@ + this.field_74208_u = this.field_74209_t; + boolean var2 = false; + +- for(int var3 = 0; var3 < 3; ++var3) { +- if(this.containerEnchantment.enchantLevels[var3] != 0) { ++ for (int var3 = 0; var3 < 3; ++var3) { ++ if (this.containerEnchantment.enchantLevels[var3] != 0) { + var2 = true; + } + } + +- if(var2) { ++ if (var2) { + this.field_74209_t += 0.2F; + } else { + this.field_74209_t -= 0.2F; + } + +- if(this.field_74209_t < 0.0F) { ++ if (this.field_74209_t < 0.0F) { + this.field_74209_t = 0.0F; + } + +- if(this.field_74209_t > 1.0F) { ++ if (this.field_74209_t > 1.0F) { + this.field_74209_t = 1.0F; + } + + float var5 = (this.field_74211_r - this.field_74213_p) * 0.4F; + float var4 = 0.2F; +- if(var5 < -var4) { ++ ++ if (var5 < -var4) { + var5 = -var4; + } + +- if(var5 > var4) { ++ if (var5 > var4) { + var5 = var4; + } + diff --git a/patches/net/minecraft/src/GuiErrorScreen.java.patch b/patches/net/minecraft/src/GuiErrorScreen.java.patch new file mode 100644 index 0000000..5831b5f --- /dev/null +++ b/patches/net/minecraft/src/GuiErrorScreen.java.patch @@ -0,0 +1,69 @@ +--- net/minecraft/src/GuiErrorScreen.java ++++ net/minecraft/src/GuiErrorScreen.java +@@ -1,30 +1,49 @@ + package net.minecraft.src; + + public class GuiErrorScreen extends GuiScreen { +- private String a; +- private String b; +- +- public GuiErrorScreen(String var1, String var2) { +- this.a = var1; +- this.b = var2; ++ ++ /** ++ * Unused class. Would contain a message drawn to the center of the screen. ++ */ ++ private String message1; ++ ++ /** ++ * Unused class. Would contain a message drawn to the center of the screen. ++ */ ++ private String message2; ++ ++ public GuiErrorScreen(String par1Str, String par2Str) { ++ this.message1 = par1Str; ++ this.message2 = par2Str; + } + ++ /** ++ * Adds the buttons (and other controls) to the screen in question. ++ */ + public void initGui() { + super.initGui(); +- this.i.add(new GuiButton(0, this.width / 2 - 100, 140, I18n.getString("gui.cancel"))); ++ this.buttonList.add(new GuiButton(0, this.width / 2 - 100, 140, I18n.getString("gui.cancel"))); + } + +- public void drawScreen(int var1, int var2, float var3) { ++ /** ++ * Draws the screen and all the components in it. ++ */ ++ public void drawScreen(int par1, int par2, float par3) { + this.drawGradientRect(0, 0, this.width, this.height, -12574688, -11530224); +- this.drawCenteredString(this.fontRenderer, this.a, this.width / 2, 90, 16777215); +- this.drawCenteredString(this.fontRenderer, this.b, this.width / 2, 110, 16777215); +- super.drawScreen(var1, var2, var3); +- } +- +- protected void keyTyped(char var1, int var2) { +- } +- +- protected void actionPerformed(GuiButton var1) { ++ this.drawCenteredString(this.fontRenderer, this.message1, this.width / 2, 90, 16777215); ++ this.drawCenteredString(this.fontRenderer, this.message2, this.width / 2, 110, 16777215); ++ super.drawScreen(par1, par2, par3); ++ } ++ ++ /** ++ * Fired when a key is typed. This is the equivalent of KeyListener.keyTyped(KeyEvent e). ++ */ ++ protected void keyTyped(char par1, int par2) {} ++ ++ /** ++ * Fired when a control is clicked. This is the equivalent of ActionListener.actionPerformed(ActionEvent e). ++ */ ++ protected void actionPerformed(GuiButton par1GuiButton) { + this.mc.displayGuiScreen((GuiScreen)null); + } + } diff --git a/patches/net/minecraft/src/GuiFlatPresets.java.patch b/patches/net/minecraft/src/GuiFlatPresets.java.patch new file mode 100644 index 0000000..fdcf900 --- /dev/null +++ b/patches/net/minecraft/src/GuiFlatPresets.java.patch @@ -0,0 +1,231 @@ +--- net/minecraft/src/GuiFlatPresets.java ++++ net/minecraft/src/GuiFlatPresets.java +@@ -8,71 +8,94 @@ + import org.lwjgl.input.Keyboard; + + public class GuiFlatPresets extends GuiScreen { ++ ++ /** RenderItem instance used to render preset icons. */ + private static RenderItem presetIconRenderer = new RenderItem(); +- private static final List b = new ArrayList(); ++ ++ /** List of defined flat world presets. */ ++ private static final List presets = new ArrayList(); + private final GuiCreateFlatWorld createFlatWorldGui; +- private String d; +- private String e; +- private String p; ++ private String field_82300_d; ++ private String field_82308_m; ++ private String field_82306_n; + private GuiFlatPresetsListSlot theFlatPresetsListSlot; + private GuiButton theButton; + private GuiTextField theTextField; + +- public GuiFlatPresets(GuiCreateFlatWorld var1) { +- this.createFlatWorldGui = var1; ++ public GuiFlatPresets(GuiCreateFlatWorld par1GuiCreateFlatWorld) { ++ this.createFlatWorldGui = par1GuiCreateFlatWorld; + } + ++ /** ++ * Adds the buttons (and other controls) to the screen in question. ++ */ + public void initGui() { +- this.i.clear(); ++ this.buttonList.clear(); + Keyboard.enableRepeatEvents(true); +- this.d = I18n.getString("createWorld.customize.presets.title"); +- this.e = I18n.getString("createWorld.customize.presets.share"); +- this.p = I18n.getString("createWorld.customize.presets.list"); ++ this.field_82300_d = I18n.getString("createWorld.customize.presets.title"); ++ this.field_82308_m = I18n.getString("createWorld.customize.presets.share"); ++ this.field_82306_n = I18n.getString("createWorld.customize.presets.list"); + this.theTextField = new GuiTextField(this.fontRenderer, 50, 40, this.width - 100, 20); + this.theFlatPresetsListSlot = new GuiFlatPresetsListSlot(this); + this.theTextField.setMaxStringLength(1230); + this.theTextField.setText(this.createFlatWorldGui.getFlatGeneratorInfo()); +- this.i.add(this.theButton = new GuiButton(0, this.width / 2 - 155, this.height - 28, 150, 20, I18n.getString("createWorld.customize.presets.select"))); +- this.i.add(new GuiButton(1, this.width / 2 + 5, this.height - 28, 150, 20, I18n.getString("gui.cancel"))); ++ this.buttonList.add(this.theButton = new GuiButton(0, this.width / 2 - 155, this.height - 28, 150, 20, I18n.getString("createWorld.customize.presets.select"))); ++ this.buttonList.add(new GuiButton(1, this.width / 2 + 5, this.height - 28, 150, 20, I18n.getString("gui.cancel"))); + this.func_82296_g(); + } + ++ /** ++ * Called when the screen is unloaded. Used to disable keyboard repeat events ++ */ + public void onGuiClosed() { + Keyboard.enableRepeatEvents(false); + } + +- protected void mouseClicked(int var1, int var2, int var3) { +- this.theTextField.mouseClicked(var1, var2, var3); +- super.mouseClicked(var1, var2, var3); ++ /** ++ * Called when the mouse is clicked. ++ */ ++ protected void mouseClicked(int par1, int par2, int par3) { ++ this.theTextField.mouseClicked(par1, par2, par3); ++ super.mouseClicked(par1, par2, par3); + } + +- protected void keyTyped(char var1, int var2) { +- if(!this.theTextField.textboxKeyTyped(var1, var2)) { +- super.keyTyped(var1, var2); ++ /** ++ * Fired when a key is typed. This is the equivalent of KeyListener.keyTyped(KeyEvent e). ++ */ ++ protected void keyTyped(char par1, int par2) { ++ if (!this.theTextField.textboxKeyTyped(par1, par2)) { ++ super.keyTyped(par1, par2); + } +- + } + +- protected void actionPerformed(GuiButton var1) { +- if(var1.id == 0 && this.func_82293_j()) { ++ /** ++ * Fired when a control is clicked. This is the equivalent of ActionListener.actionPerformed(ActionEvent e). ++ */ ++ protected void actionPerformed(GuiButton par1GuiButton) { ++ if (par1GuiButton.id == 0 && this.func_82293_j()) { + this.createFlatWorldGui.setFlatGeneratorInfo(this.theTextField.getText()); + this.mc.displayGuiScreen(this.createFlatWorldGui); +- } else if(var1.id == 1) { ++ } else if (par1GuiButton.id == 1) { + this.mc.displayGuiScreen(this.createFlatWorldGui); + } +- + } + +- public void drawScreen(int var1, int var2, float var3) { ++ /** ++ * Draws the screen and all the components in it. ++ */ ++ public void drawScreen(int par1, int par2, float par3) { + this.drawDefaultBackground(); +- this.theFlatPresetsListSlot.drawScreen(var1, var2, var3); +- this.drawCenteredString(this.fontRenderer, this.d, this.width / 2, 8, 16777215); +- this.drawString(this.fontRenderer, this.e, 50, 30, 10526880); +- this.drawString(this.fontRenderer, this.p, 50, 70, 10526880); ++ this.theFlatPresetsListSlot.drawScreen(par1, par2, par3); ++ this.drawCenteredString(this.fontRenderer, this.field_82300_d, this.width / 2, 8, 16777215); ++ this.drawString(this.fontRenderer, this.field_82308_m, 50, 30, 10526880); ++ this.drawString(this.fontRenderer, this.field_82306_n, 50, 70, 10526880); + this.theTextField.drawTextBox(); +- super.drawScreen(var1, var2, var3); ++ super.drawScreen(par1, par2, par3); + } + ++ /** ++ * Called from the main game loop to update the screen. ++ */ + public void updateScreen() { + this.theTextField.updateCursorCounter(); + super.updateScreen(); +@@ -84,58 +107,71 @@ + } + + private boolean func_82293_j() { +- return this.theFlatPresetsListSlot.field_82459_a > -1 && this.theFlatPresetsListSlot.field_82459_a < b.size() || this.theTextField.getText().length() > 1; +- } +- +- private static void addPresetNoFeatures(String var0, int var1, BiomeGenBase var2, FlatLayerInfo... var3) { +- addPreset(var0, var1, var2, (List)null, var3); +- } +- +- private static void addPreset(String var0, int var1, BiomeGenBase var2, List var3, FlatLayerInfo... var4) { ++ return this.theFlatPresetsListSlot.field_82459_a > -1 && this.theFlatPresetsListSlot.field_82459_a < presets.size() || this.theTextField.getText().length() > 1; ++ } ++ ++ /** ++ * Add a flat world preset with no world features. ++ */ ++ private static void addPresetNoFeatures(String par0Str, int par1, BiomeGenBase par2BiomeGenBase, FlatLayerInfo ... par3ArrayOfFlatLayerInfo) { ++ addPreset(par0Str, par1, par2BiomeGenBase, (List)null, par3ArrayOfFlatLayerInfo); ++ } ++ ++ /** ++ * Add a flat world preset. ++ */ ++ private static void addPreset(String par0Str, int par1, BiomeGenBase par2BiomeGenBase, List par3List, FlatLayerInfo ... par4ArrayOfFlatLayerInfo) { + FlatGeneratorInfo var5 = new FlatGeneratorInfo(); + +- for(int var6 = var4.length - 1; var6 >= 0; --var6) { +- var5.getFlatLayers().add(var4[var6]); ++ for (int var6 = par4ArrayOfFlatLayerInfo.length - 1; var6 >= 0; --var6) { ++ var5.getFlatLayers().add(par4ArrayOfFlatLayerInfo[var6]); + } + +- var5.setBiome(var2.biomeID); ++ var5.setBiome(par2BiomeGenBase.biomeID); + var5.func_82645_d(); +- if(var3 != null) { +- Iterator var8 = var3.iterator(); +- +- while(var8.hasNext()) { ++ ++ if (par3List != null) { ++ Iterator var8 = par3List.iterator(); ++ ++ while (var8.hasNext()) { + String var7 = (String)var8.next(); + var5.getWorldFeatures().put(var7, new HashMap()); + } + } + +- b.add(new GuiFlatPresetsItem(var1, var0, var5.toString())); ++ presets.add(new GuiFlatPresetsItem(par1, par0Str, var5.toString())); + } + ++ /** ++ * Return the RenderItem instance used to render preset icons. ++ */ + static RenderItem getPresetIconRenderer() { + return presetIconRenderer; + } + ++ /** ++ * Return the list of defined flat world presets. ++ */ + static List getPresets() { +- return b; +- } +- +- static GuiFlatPresetsListSlot func_82292_a(GuiFlatPresets var0) { +- return var0.theFlatPresetsListSlot; +- } +- +- static GuiTextField func_82298_b(GuiFlatPresets var0) { +- return var0.theTextField; ++ return presets; ++ } ++ ++ static GuiFlatPresetsListSlot func_82292_a(GuiFlatPresets par0GuiFlatPresets) { ++ return par0GuiFlatPresets.theFlatPresetsListSlot; ++ } ++ ++ static GuiTextField func_82298_b(GuiFlatPresets par0GuiFlatPresets) { ++ return par0GuiFlatPresets.theTextField; + } + + static { +- addPreset("Classic Flat", Block.grass.blockID, BiomeGenBase.plains, Arrays.asList(new String[]{"village"}), new FlatLayerInfo[]{new FlatLayerInfo(1, Block.grass.blockID), new FlatLayerInfo(2, Block.dirt.blockID), new FlatLayerInfo(1, Block.bedrock.blockID)}); +- addPreset("Tunnelers\' Dream", Block.stone.blockID, BiomeGenBase.extremeHills, Arrays.asList(new String[]{"biome_1", "dungeon", "decoration", "stronghold", "mineshaft"}), new FlatLayerInfo[]{new FlatLayerInfo(1, Block.grass.blockID), new FlatLayerInfo(5, Block.dirt.blockID), new FlatLayerInfo(230, Block.stone.blockID), new FlatLayerInfo(1, Block.bedrock.blockID)}); +- addPreset("Water World", Block.waterMoving.blockID, BiomeGenBase.plains, Arrays.asList(new String[]{"village", "biome_1"}), new FlatLayerInfo[]{new FlatLayerInfo(90, Block.waterStill.blockID), new FlatLayerInfo(5, Block.sand.blockID), new FlatLayerInfo(5, Block.dirt.blockID), new FlatLayerInfo(5, Block.stone.blockID), new FlatLayerInfo(1, Block.bedrock.blockID)}); +- addPreset("Overworld", Block.tallGrass.blockID, BiomeGenBase.plains, Arrays.asList(new String[]{"village", "biome_1", "decoration", "stronghold", "mineshaft", "dungeon", "lake", "lava_lake"}), new FlatLayerInfo[]{new FlatLayerInfo(1, Block.grass.blockID), new FlatLayerInfo(3, Block.dirt.blockID), new FlatLayerInfo(59, Block.stone.blockID), new FlatLayerInfo(1, Block.bedrock.blockID)}); +- addPreset("Snowy Kingdom", Block.snow.blockID, BiomeGenBase.icePlains, Arrays.asList(new String[]{"village", "biome_1"}), new FlatLayerInfo[]{new FlatLayerInfo(1, Block.snow.blockID), new FlatLayerInfo(1, Block.grass.blockID), new FlatLayerInfo(3, Block.dirt.blockID), new FlatLayerInfo(59, Block.stone.blockID), new FlatLayerInfo(1, Block.bedrock.blockID)}); +- addPreset("Bottomless Pit", Item.feather.itemID, BiomeGenBase.plains, Arrays.asList(new String[]{"village", "biome_1"}), new FlatLayerInfo[]{new FlatLayerInfo(1, Block.grass.blockID), new FlatLayerInfo(3, Block.dirt.blockID), new FlatLayerInfo(2, Block.cobblestone.blockID)}); +- addPreset("Desert", Block.sand.blockID, BiomeGenBase.desert, Arrays.asList(new String[]{"village", "biome_1", "decoration", "stronghold", "mineshaft", "dungeon"}), new FlatLayerInfo[]{new FlatLayerInfo(8, Block.sand.blockID), new FlatLayerInfo(52, Block.sandStone.blockID), new FlatLayerInfo(3, Block.stone.blockID), new FlatLayerInfo(1, Block.bedrock.blockID)}); +- addPresetNoFeatures("Redstone Ready", Item.redstone.itemID, BiomeGenBase.desert, new FlatLayerInfo[]{new FlatLayerInfo(52, Block.sandStone.blockID), new FlatLayerInfo(3, Block.stone.blockID), new FlatLayerInfo(1, Block.bedrock.blockID)}); ++ addPreset("Classic Flat", Block.grass.blockID, BiomeGenBase.plains, Arrays.asList(new String[] {"village"}), new FlatLayerInfo[] {new FlatLayerInfo(1, Block.grass.blockID), new FlatLayerInfo(2, Block.dirt.blockID), new FlatLayerInfo(1, Block.bedrock.blockID)}); ++ addPreset("Tunnelers\' Dream", Block.stone.blockID, BiomeGenBase.extremeHills, Arrays.asList(new String[] {"biome_1", "dungeon", "decoration", "stronghold", "mineshaft"}), new FlatLayerInfo[] {new FlatLayerInfo(1, Block.grass.blockID), new FlatLayerInfo(5, Block.dirt.blockID), new FlatLayerInfo(230, Block.stone.blockID), new FlatLayerInfo(1, Block.bedrock.blockID)}); ++ addPreset("Water World", Block.waterMoving.blockID, BiomeGenBase.plains, Arrays.asList(new String[] {"village", "biome_1"}), new FlatLayerInfo[] {new FlatLayerInfo(90, Block.waterStill.blockID), new FlatLayerInfo(5, Block.sand.blockID), new FlatLayerInfo(5, Block.dirt.blockID), new FlatLayerInfo(5, Block.stone.blockID), new FlatLayerInfo(1, Block.bedrock.blockID)}); ++ addPreset("Overworld", Block.tallGrass.blockID, BiomeGenBase.plains, Arrays.asList(new String[] {"village", "biome_1", "decoration", "stronghold", "mineshaft", "dungeon", "lake", "lava_lake"}), new FlatLayerInfo[] {new FlatLayerInfo(1, Block.grass.blockID), new FlatLayerInfo(3, Block.dirt.blockID), new FlatLayerInfo(59, Block.stone.blockID), new FlatLayerInfo(1, Block.bedrock.blockID)}); ++ addPreset("Snowy Kingdom", Block.snow.blockID, BiomeGenBase.icePlains, Arrays.asList(new String[] {"village", "biome_1"}), new FlatLayerInfo[] {new FlatLayerInfo(1, Block.snow.blockID), new FlatLayerInfo(1, Block.grass.blockID), new FlatLayerInfo(3, Block.dirt.blockID), new FlatLayerInfo(59, Block.stone.blockID), new FlatLayerInfo(1, Block.bedrock.blockID)}); ++ addPreset("Bottomless Pit", Item.feather.itemID, BiomeGenBase.plains, Arrays.asList(new String[] {"village", "biome_1"}), new FlatLayerInfo[] {new FlatLayerInfo(1, Block.grass.blockID), new FlatLayerInfo(3, Block.dirt.blockID), new FlatLayerInfo(2, Block.cobblestone.blockID)}); ++ addPreset("Desert", Block.sand.blockID, BiomeGenBase.desert, Arrays.asList(new String[] {"village", "biome_1", "decoration", "stronghold", "mineshaft", "dungeon"}), new FlatLayerInfo[] {new FlatLayerInfo(8, Block.sand.blockID), new FlatLayerInfo(52, Block.sandStone.blockID), new FlatLayerInfo(3, Block.stone.blockID), new FlatLayerInfo(1, Block.bedrock.blockID)}); ++ addPresetNoFeatures("Redstone Ready", Item.redstone.itemID, BiomeGenBase.desert, new FlatLayerInfo[] {new FlatLayerInfo(52, Block.sandStone.blockID), new FlatLayerInfo(3, Block.stone.blockID), new FlatLayerInfo(1, Block.bedrock.blockID)}); + } + } diff --git a/patches/net/minecraft/src/GuiFlatPresetsItem.java.patch b/patches/net/minecraft/src/GuiFlatPresetsItem.java.patch new file mode 100644 index 0000000..937772b --- /dev/null +++ b/patches/net/minecraft/src/GuiFlatPresetsItem.java.patch @@ -0,0 +1,29 @@ +--- net/minecraft/src/GuiFlatPresetsItem.java ++++ net/minecraft/src/GuiFlatPresetsItem.java +@@ -1,13 +1,19 @@ + package net.minecraft.src; + + class GuiFlatPresetsItem { ++ ++ /** ID for the item used as icon for this preset. */ + public int iconId; +- public String b; +- public String c; +- +- public GuiFlatPresetsItem(int var1, String var2, String var3) { +- this.iconId = var1; +- this.b = var2; +- this.c = var3; ++ ++ /** Name for this preset. */ ++ public String presetName; ++ ++ /** Data for this preset. */ ++ public String presetData; ++ ++ public GuiFlatPresetsItem(int par1, String par2Str, String par3Str) { ++ this.iconId = par1; ++ this.presetName = par2Str; ++ this.presetData = par3Str; + } + } diff --git a/patches/net/minecraft/src/GuiFlatPresetsListSlot.java.patch b/patches/net/minecraft/src/GuiFlatPresetsListSlot.java.patch new file mode 100644 index 0000000..8e2876d --- /dev/null +++ b/patches/net/minecraft/src/GuiFlatPresetsListSlot.java.patch @@ -0,0 +1,103 @@ +--- net/minecraft/src/GuiFlatPresetsListSlot.java ++++ net/minecraft/src/GuiFlatPresetsListSlot.java +@@ -5,28 +5,29 @@ + + class GuiFlatPresetsListSlot extends GuiSlot { + public int field_82459_a; ++ + final GuiFlatPresets flatPresetsGui; + +- public GuiFlatPresetsListSlot(GuiFlatPresets var1) { +- super(var1.mc, var1.width, var1.height, 80, var1.height - 37, 24); +- this.flatPresetsGui = var1; ++ public GuiFlatPresetsListSlot(GuiFlatPresets par1GuiFlatPresets) { ++ super(par1GuiFlatPresets.mc, par1GuiFlatPresets.width, par1GuiFlatPresets.height, 80, par1GuiFlatPresets.height - 37, 24); ++ this.flatPresetsGui = par1GuiFlatPresets; + this.field_82459_a = -1; + } + +- private void func_82457_a(int var1, int var2, int var3) { +- this.func_82456_d(var1 + 1, var2 + 1); ++ private void func_82457_a(int par1, int par2, int par3) { ++ this.func_82456_d(par1 + 1, par2 + 1); + GL11.glEnable(GL12.GL_RESCALE_NORMAL); + RenderHelper.enableGUIStandardItemLighting(); +- GuiFlatPresets.getPresetIconRenderer().renderItemIntoGUI(this.flatPresetsGui.fontRenderer, this.flatPresetsGui.mc.getTextureManager(), new ItemStack(var3, 1, 0), var1 + 2, var2 + 2); ++ GuiFlatPresets.getPresetIconRenderer().renderItemIntoGUI(this.flatPresetsGui.fontRenderer, this.flatPresetsGui.mc.getTextureManager(), new ItemStack(par3, 1, 0), par1 + 2, par2 + 2); + RenderHelper.disableStandardItemLighting(); + GL11.glDisable(GL12.GL_RESCALE_NORMAL); + } + +- private void func_82456_d(int var1, int var2) { +- this.func_82455_b(var1, var2, 0, 0); ++ private void func_82456_d(int par1, int par2) { ++ this.func_82455_b(par1, par2, 0, 0); + } + +- private void func_82455_b(int var1, int var2, int var3, int var4) { ++ private void func_82455_b(int par1, int par2, int par3, int par4) { + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + this.flatPresetsGui.mc.getTextureManager().bindTexture(Gui.statIcons); + float var5 = 0.0078125F; +@@ -35,33 +36,41 @@ + boolean var8 = true; + Tessellator var9 = Tessellator.instance; + var9.startDrawingQuads(); +- var9.addVertexWithUV((double)(var1 + 0), (double)(var2 + 18), (double)this.flatPresetsGui.zLevel, (double)((float)(var3 + 0) * 0.0078125F), (double)((float)(var4 + 18) * 0.0078125F)); +- var9.addVertexWithUV((double)(var1 + 18), (double)(var2 + 18), (double)this.flatPresetsGui.zLevel, (double)((float)(var3 + 18) * 0.0078125F), (double)((float)(var4 + 18) * 0.0078125F)); +- var9.addVertexWithUV((double)(var1 + 18), (double)(var2 + 0), (double)this.flatPresetsGui.zLevel, (double)((float)(var3 + 18) * 0.0078125F), (double)((float)(var4 + 0) * 0.0078125F)); +- var9.addVertexWithUV((double)(var1 + 0), (double)(var2 + 0), (double)this.flatPresetsGui.zLevel, (double)((float)(var3 + 0) * 0.0078125F), (double)((float)(var4 + 0) * 0.0078125F)); ++ var9.addVertexWithUV((double)(par1 + 0), (double)(par2 + 18), (double)this.flatPresetsGui.zLevel, (double)((float)(par3 + 0) * 0.0078125F), (double)((float)(par4 + 18) * 0.0078125F)); ++ var9.addVertexWithUV((double)(par1 + 18), (double)(par2 + 18), (double)this.flatPresetsGui.zLevel, (double)((float)(par3 + 18) * 0.0078125F), (double)((float)(par4 + 18) * 0.0078125F)); ++ var9.addVertexWithUV((double)(par1 + 18), (double)(par2 + 0), (double)this.flatPresetsGui.zLevel, (double)((float)(par3 + 18) * 0.0078125F), (double)((float)(par4 + 0) * 0.0078125F)); ++ var9.addVertexWithUV((double)(par1 + 0), (double)(par2 + 0), (double)this.flatPresetsGui.zLevel, (double)((float)(par3 + 0) * 0.0078125F), (double)((float)(par4 + 0) * 0.0078125F)); + var9.draw(); + } + ++ /** ++ * Gets the size of the current slot list. ++ */ + protected int getSize() { + return GuiFlatPresets.getPresets().size(); + } + +- protected void elementClicked(int var1, boolean var2) { +- this.field_82459_a = var1; ++ /** ++ * the element in the slot that was clicked, boolean for wether it was double clicked or not ++ */ ++ protected void elementClicked(int par1, boolean par2) { ++ this.field_82459_a = par1; + this.flatPresetsGui.func_82296_g(); +- GuiFlatPresets.func_82298_b(this.flatPresetsGui).setText(((GuiFlatPresetsItem)GuiFlatPresets.getPresets().get(GuiFlatPresets.func_82292_a(this.flatPresetsGui).field_82459_a)).c); +- } +- +- protected boolean isSelected(int var1) { +- return var1 == this.field_82459_a; +- } +- +- protected void drawBackground() { +- } +- +- protected void drawSlot(int var1, int var2, int var3, int var4, Tessellator var5) { +- GuiFlatPresetsItem var6 = (GuiFlatPresetsItem)GuiFlatPresets.getPresets().get(var1); +- this.func_82457_a(var2, var3, var6.iconId); +- this.flatPresetsGui.fontRenderer.drawString(var6.b, var2 + 18 + 5, var3 + 6, 16777215); ++ GuiFlatPresets.func_82298_b(this.flatPresetsGui).setText(((GuiFlatPresetsItem)GuiFlatPresets.getPresets().get(GuiFlatPresets.func_82292_a(this.flatPresetsGui).field_82459_a)).presetData); ++ } ++ ++ /** ++ * returns true if the element passed in is currently selected ++ */ ++ protected boolean isSelected(int par1) { ++ return par1 == this.field_82459_a; ++ } ++ ++ protected void drawBackground() {} ++ ++ protected void drawSlot(int par1, int par2, int par3, int par4, Tessellator par5Tessellator) { ++ GuiFlatPresetsItem var6 = (GuiFlatPresetsItem)GuiFlatPresets.getPresets().get(par1); ++ this.func_82457_a(par2, par3, var6.iconId); ++ this.flatPresetsGui.fontRenderer.drawString(var6.presetName, par2 + 18 + 5, par3 + 6, 16777215); + } + } diff --git a/patches/net/minecraft/src/GuiFurnace.java.patch b/patches/net/minecraft/src/GuiFurnace.java.patch new file mode 100644 index 0000000..b7e1da6 --- /dev/null +++ b/patches/net/minecraft/src/GuiFurnace.java.patch @@ -0,0 +1,41 @@ +--- net/minecraft/src/GuiFurnace.java ++++ net/minecraft/src/GuiFurnace.java +@@ -6,25 +6,32 @@ + private static final ResourceLocation furnaceGuiTextures = new ResourceLocation("textures/gui/container/furnace.png"); + private TileEntityFurnace furnaceInventory; + +- public GuiFurnace(InventoryPlayer var1, TileEntityFurnace var2) { +- super(new ContainerFurnace(var1, var2)); +- this.furnaceInventory = var2; ++ public GuiFurnace(InventoryPlayer par1InventoryPlayer, TileEntityFurnace par2TileEntityFurnace) { ++ super(new ContainerFurnace(par1InventoryPlayer, par2TileEntityFurnace)); ++ this.furnaceInventory = par2TileEntityFurnace; + } + +- protected void drawGuiContainerForegroundLayer(int var1, int var2) { ++ /** ++ * Draw the foreground layer for the GuiContainer (everything in front of the items) ++ */ ++ protected void drawGuiContainerForegroundLayer(int par1, int par2) { + String var3 = this.furnaceInventory.isInvNameLocalized() ? this.furnaceInventory.getInvName() : I18n.getString(this.furnaceInventory.getInvName()); + this.fontRenderer.drawString(var3, this.xSize / 2 - this.fontRenderer.getStringWidth(var3) / 2, 6, 4210752); + this.fontRenderer.drawString(I18n.getString("container.inventory"), 8, this.ySize - 96 + 2, 4210752); + } + +- protected void drawGuiContainerBackgroundLayer(float var1, int var2, int var3) { ++ /** ++ * Draw the background layer for the GuiContainer (everything behind the items) ++ */ ++ protected void drawGuiContainerBackgroundLayer(float par1, int par2, int par3) { + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + this.mc.getTextureManager().bindTexture(furnaceGuiTextures); + int var4 = (this.width - this.xSize) / 2; + int var5 = (this.height - this.ySize) / 2; + this.drawTexturedModalRect(var4, var5, 0, 0, this.xSize, this.ySize); + int var6; +- if(this.furnaceInventory.isBurning()) { ++ ++ if (this.furnaceInventory.isBurning()) { + var6 = this.furnaceInventory.getBurnTimeRemainingScaled(12); + this.drawTexturedModalRect(var4 + 56, var5 + 36 + 12 - var6, 176, 12 - var6, 14, var6 + 2); + } diff --git a/patches/net/minecraft/src/GuiGameOver.java.patch b/patches/net/minecraft/src/GuiGameOver.java.patch new file mode 100644 index 0000000..0d6d194 --- /dev/null +++ b/patches/net/minecraft/src/GuiGameOver.java.patch @@ -0,0 +1,145 @@ +--- net/minecraft/src/GuiGameOver.java ++++ net/minecraft/src/GuiGameOver.java +@@ -1,52 +1,74 @@ + package net.minecraft.src; + + import java.util.Iterator; ++ + import org.lwjgl.opengl.GL11; + ++import org.spoutcraft.client.gui.mainmenu.MainMenu; ++ + public class GuiGameOver extends GuiScreen { ++ ++ /** ++ * The cooldown timer for the buttons, increases every tick and enables all buttons when reaching 20. ++ */ + private int cooldownTimer; + ++ /** ++ * Adds the buttons (and other controls) to the screen in question. ++ */ + public void initGui() { +- this.i.clear(); +- if(this.mc.theWorld.getWorldInfo().isHardcoreModeEnabled()) { +- if(this.mc.isIntegratedServerRunning()) { +- this.i.add(new GuiButton(1, this.width / 2 - 100, this.height / 4 + 96, I18n.getString("deathScreen.deleteWorld"))); ++ this.buttonList.clear(); ++ ++ if (this.mc.theWorld.getWorldInfo().isHardcoreModeEnabled()) { ++ if (this.mc.isIntegratedServerRunning()) { ++ this.buttonList.add(new GuiButton(1, this.width / 2 - 100, this.height / 4 + 96, I18n.getString("deathScreen.deleteWorld"))); + } else { +- this.i.add(new GuiButton(1, this.width / 2 - 100, this.height / 4 + 96, I18n.getString("deathScreen.leaveServer"))); ++ this.buttonList.add(new GuiButton(1, this.width / 2 - 100, this.height / 4 + 96, I18n.getString("deathScreen.leaveServer"))); + } + } else { +- this.i.add(new GuiButton(1, this.width / 2 - 100, this.height / 4 + 72, I18n.getString("deathScreen.respawn"))); +- this.i.add(new GuiButton(2, this.width / 2 - 100, this.height / 4 + 96, I18n.getString("deathScreen.titleScreen"))); +- if(this.mc.getSession() == null) { +- ((GuiButton)this.i.get(1)).enabled = false; ++ this.buttonList.add(new GuiButton(1, this.width / 2 - 100, this.height / 4 + 72, I18n.getString("deathScreen.respawn"))); ++ this.buttonList.add(new GuiButton(2, this.width / 2 - 100, this.height / 4 + 96, I18n.getString("deathScreen.titleScreen"))); ++ ++ if (this.mc.getSession() == null) { ++ ((GuiButton)this.buttonList.get(1)).enabled = false; + } + } + + GuiButton var2; +- for(Iterator var1 = this.i.iterator(); var1.hasNext(); var2.enabled = false) { ++ ++ for (Iterator var1 = this.buttonList.iterator(); var1.hasNext(); var2.enabled = false) { + var2 = (GuiButton)var1.next(); + } +- +- } +- +- protected void keyTyped(char var1, int var2) { +- } +- +- protected void actionPerformed(GuiButton var1) { +- switch(var1.id) { +- case 1: +- this.mc.thePlayer.respawnPlayer(); +- this.mc.displayGuiScreen((GuiScreen)null); +- break; +- case 2: +- this.mc.theWorld.sendQuittingDisconnectingPacket(); +- this.mc.loadWorld((WorldClient)null); +- this.mc.displayGuiScreen(new GuiMainMenu()); ++ } ++ ++ /** ++ * Fired when a key is typed. This is the equivalent of KeyListener.keyTyped(KeyEvent e). ++ */ ++ protected void keyTyped(char par1, int par2) {} ++ ++ /** ++ * Fired when a control is clicked. This is the equivalent of ActionListener.actionPerformed(ActionEvent e). ++ */ ++ protected void actionPerformed(GuiButton par1GuiButton) { ++ switch (par1GuiButton.id) { ++ case 1: ++ this.mc.thePlayer.respawnPlayer(); ++ this.mc.displayGuiScreen((GuiScreen)null); ++ break; ++ ++ case 2: ++ this.mc.theWorld.sendQuittingDisconnectingPacket(); ++ this.mc.loadWorld((WorldClient)null); ++ // Spout Start ++ this.mc.displayGuiScreen(new MainMenu()); ++ // Spout End + } +- + } + +- public void drawScreen(int var1, int var2, float var3) { ++ /** ++ * Draws the screen and all the components in it. ++ */ ++ public void drawScreen(int par1, int par2, float par3) { + this.drawGradientRect(0, 0, this.width, this.height, 1615855616, -1602211792); + GL11.glPushMatrix(); + GL11.glScalef(2.0F, 2.0F, 2.0F); +@@ -54,27 +76,34 @@ + String var5 = var4 ? I18n.getString("deathScreen.title.hardcore") : I18n.getString("deathScreen.title"); + this.drawCenteredString(this.fontRenderer, var5, this.width / 2 / 2, 30, 16777215); + GL11.glPopMatrix(); +- if(var4) { ++ ++ if (var4) { + this.drawCenteredString(this.fontRenderer, I18n.getString("deathScreen.hardcoreInfo"), this.width / 2, 144, 16777215); + } + + this.drawCenteredString(this.fontRenderer, I18n.getString("deathScreen.score") + ": " + EnumChatFormatting.YELLOW + this.mc.thePlayer.getScore(), this.width / 2, 100, 16777215); +- super.drawScreen(var1, var2, var3); ++ super.drawScreen(par1, par2, par3); + } + ++ /** ++ * Returns true if this GUI should pause the game when it is displayed in single-player ++ */ + public boolean doesGuiPauseGame() { + return false; + } + ++ /** ++ * Called from the main game loop to update the screen. ++ */ + public void updateScreen() { + super.updateScreen(); + ++this.cooldownTimer; + GuiButton var2; +- if(this.cooldownTimer == 20) { +- for(Iterator var1 = this.i.iterator(); var1.hasNext(); var2.enabled = true) { ++ ++ if (this.cooldownTimer == 20) { ++ for (Iterator var1 = this.buttonList.iterator(); var1.hasNext(); var2.enabled = true) { + var2 = (GuiButton)var1.next(); + } + } +- + } + } diff --git a/patches/net/minecraft/src/GuiHopper.java.patch b/patches/net/minecraft/src/GuiHopper.java.patch new file mode 100644 index 0000000..dd331fa --- /dev/null +++ b/patches/net/minecraft/src/GuiHopper.java.patch @@ -0,0 +1,35 @@ +--- net/minecraft/src/GuiHopper.java ++++ net/minecraft/src/GuiHopper.java +@@ -7,20 +7,26 @@ + private IInventory field_94081_r; + private IInventory field_94080_s; + +- public GuiHopper(InventoryPlayer var1, IInventory var2) { +- super(new ContainerHopper(var1, var2)); +- this.field_94081_r = var1; +- this.field_94080_s = var2; ++ public GuiHopper(InventoryPlayer par1InventoryPlayer, IInventory par2IInventory) { ++ super(new ContainerHopper(par1InventoryPlayer, par2IInventory)); ++ this.field_94081_r = par1InventoryPlayer; ++ this.field_94080_s = par2IInventory; + this.allowUserInput = false; + this.ySize = 133; + } + +- protected void drawGuiContainerForegroundLayer(int var1, int var2) { ++ /** ++ * Draw the foreground layer for the GuiContainer (everything in front of the items) ++ */ ++ protected void drawGuiContainerForegroundLayer(int par1, int par2) { + this.fontRenderer.drawString(this.field_94080_s.isInvNameLocalized() ? this.field_94080_s.getInvName() : I18n.getString(this.field_94080_s.getInvName()), 8, 6, 4210752); + this.fontRenderer.drawString(this.field_94081_r.isInvNameLocalized() ? this.field_94081_r.getInvName() : I18n.getString(this.field_94081_r.getInvName()), 8, this.ySize - 96 + 2, 4210752); + } + +- protected void drawGuiContainerBackgroundLayer(float var1, int var2, int var3) { ++ /** ++ * Draw the background layer for the GuiContainer (everything behind the items) ++ */ ++ protected void drawGuiContainerBackgroundLayer(float par1, int par2, int par3) { + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + this.mc.getTextureManager().bindTexture(hopperGuiTextures); + int var4 = (this.width - this.xSize) / 2; diff --git a/patches/net/minecraft/src/GuiIngame.java.patch b/patches/net/minecraft/src/GuiIngame.java.patch new file mode 100644 index 0000000..a80cc0d --- /dev/null +++ b/patches/net/minecraft/src/GuiIngame.java.patch @@ -0,0 +1,1314 @@ +--- net/minecraft/src/GuiIngame.java ++++ net/minecraft/src/GuiIngame.java +@@ -5,349 +5,456 @@ + import java.util.Iterator; + import java.util.List; + import java.util.Random; ++ + import org.lwjgl.opengl.GL11; + import org.lwjgl.opengl.GL12; ++import org.spoutcraft.api.Spoutcraft; ++import org.spoutcraft.api.gui.InGameHUD; ++import org.spoutcraft.api.material.MaterialData; ++import org.spoutcraft.client.SpoutClient; ++import org.spoutcraft.client.config.Configuration; ++import org.spoutcraft.client.gui.minimap.ZanMinimap; ++import org.spoutcraft.client.inventory.CraftItemStack; + + public class GuiIngame extends Gui { + private static final ResourceLocation vignetteTexPath = new ResourceLocation("textures/misc/vignette.png"); + private static final ResourceLocation widgetsTexPath = new ResourceLocation("textures/gui/widgets.png"); + private static final ResourceLocation pumpkinBlurTexPath = new ResourceLocation("textures/misc/pumpkinblur.png"); + private static final RenderItem itemRenderer = new RenderItem(); +- private final Random f = new Random(); ++ // Spout Start - private to public static final ++ public static final Random rand = new Random(); ++ // Spout End + private final Minecraft mc; ++ ++ /** ChatGUI instance that retains all previous chat data */ + private final GuiNewChat persistantChatGUI; + private int updateCounter; +- private String j = ""; ++ ++ /** The string specifying which record music is playing */ ++ private String recordPlaying = ""; ++ ++ /** How many ticks the record playing message will be displayed */ + private int recordPlayingUpFor; + private boolean recordIsPlaying; ++ ++ /** Previous frame vignette brightness (slowly changes by 1% each frame) */ + public float prevVignetteBrightness = 1.0F; ++ ++ /** Remaining ticks the item highlight should be visible */ + private int remainingHighlightTicks; ++ ++ /** The ItemStack that is currently being highlighted */ + private ItemStack highlightingItemStack; + +- public GuiIngame(Minecraft var1) { +- this.mc = var1; +- this.persistantChatGUI = new GuiNewChat(var1); +- } +- +- public void renderGameOverlay(float var1, boolean var2, int var3, int var4) { +- ScaledResolution var5 = new ScaledResolution(this.mc.gameSettings, this.mc.displayWidth, this.mc.displayHeight); +- int var6 = var5.getScaledWidth(); +- int var7 = var5.getScaledHeight(); +- FontRenderer var8 = this.mc.fontRenderer; ++ public GuiIngame(Minecraft par1Minecraft) { ++ this.mc = par1Minecraft; ++ this.persistantChatGUI = new GuiNewChat(par1Minecraft); ++ } ++ ++ // Spout Start ++ private final ZanMinimap map = new ZanMinimap(); ++ private static boolean needsUpdate = true; ++ ++ public static void dirtySurvival() { ++ needsUpdate = true; ++ } ++ // Spout End ++ ++ /** ++ * Render the ingame overlay with quick icon bar, ... ++ */ ++ // Spout Start - Most of function rewritten ++ // TODO: Rewrite again, it's in a horrible state, I'm surprised it works... ++ public void renderGameOverlay(float f, boolean flag, int i, int j) { ++ InGameHUD mainScreen = SpoutClient.getInstance().getActivePlayer().getMainScreen(); ++ ++ ScaledResolution scaledRes = new ScaledResolution(this.mc.gameSettings, this.mc.displayWidth, this.mc.displayHeight); ++ int screenWidth = scaledRes.getScaledWidth(); ++ int screenHeight = scaledRes.getScaledHeight(); ++ FontRenderer font = this.mc.fontRenderer; + this.mc.entityRenderer.setupOverlayRendering(); + GL11.glEnable(GL11.GL_BLEND); +- if(Minecraft.isFancyGraphicsEnabled()) { +- this.renderVignette(this.mc.thePlayer.getBrightness(var1), var6, var7); ++ ++ if (Minecraft.isFancyGraphicsEnabled()) { ++ this.renderVignette(this.mc.thePlayer.getBrightness(f), screenWidth, screenHeight); + } else { + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + } + +- ItemStack var9 = this.mc.thePlayer.inventory.armorItemInSlot(3); +- if(this.mc.gameSettings.thirdPersonView == 0 && var9 != null && var9.itemID == Block.pumpkin.blockID) { +- this.renderPumpkinBlur(var6, var7); +- } +- +- if(!this.mc.thePlayer.isPotionActive(Potion.confusion)) { +- float var10 = this.mc.thePlayer.prevTimeInPortal + (this.mc.thePlayer.timeInPortal - this.mc.thePlayer.prevTimeInPortal) * var1; +- if(var10 > 0.0F) { +- this.func_130015_b(var10, var6, var7); +- } +- } +- +- int var11; ++ ItemStack helmet = this.mc.thePlayer.inventory.armorItemInSlot(3); ++ ++ if (this.mc.gameSettings.thirdPersonView == 0 && helmet != null && helmet.itemID == Block.pumpkin.blockID) { ++ this.renderPumpkinBlur(screenWidth, screenHeight); ++ } ++ ++ if (!this.mc.thePlayer.isPotionActive(Potion.confusion)) { ++ float var10 = this.mc.thePlayer.prevTimeInPortal + (this.mc.thePlayer.timeInPortal - this.mc.thePlayer.prevTimeInPortal) * f; ++ ++ if (var10 > 0.0F) { ++ this.func_130015_b(var10, screenWidth, screenHeight); //renderPortalOverlay ++ } ++ } ++ GL11.glBlendFunc(770, 771); ++ GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); ++ this.mc.getTextureManager().bindTexture(widgetsTexPath); ++ InventoryPlayer var11 = this.mc.thePlayer.inventory; ++ this.zLevel = -90.0F; ++ this.drawTexturedModalRect(screenWidth / 2 - 91, screenHeight - 22, 0, 0, 182, 22); ++ this.drawTexturedModalRect(screenWidth / 2 - 91 - 1 + var11.currentItem * 20, screenHeight - 22 - 1, 0, 22, 24, 22); ++ this.mc.getTextureManager().bindTexture(icons); ++ GL11.glEnable(3042 /* GL_BLEND */); ++ GL11.glBlendFunc(775, 769); ++ this.drawTexturedModalRect(screenWidth / 2 - 7, screenHeight / 2 - 7, 0, 0, 16, 16); ++ GL11.glDisable(3042 /* GL_BLEND */); ++ ++ GuiIngame.rand.setSeed((long) (this.updateCounter * 312871)); ++ int var15; ++ int var17; ++ ++ this.renderBossHealth(); ++ // Toggle visibility if needed ++ if (needsUpdate && mainScreen.getHealthBar().isVisible() == mc.playerController.isInCreativeMode()) { ++ mainScreen.toggleSurvivalHUD(!mc.playerController.isInCreativeMode()); ++ } ++ needsUpdate = false; ++ ++ // Hunger Bar Begin ++ mainScreen.getHungerBar().render(); ++ // Hunger Bar End ++ ++ // Armor Bar Begin ++ mainScreen.getArmorBar().render(); ++ // Armor Bar End ++ ++ // Health Bar Begin ++ mainScreen.getHealthBar().render(); ++ // Health Bar End ++ ++ // Bubble Bar Begin ++ mainScreen.getBubbleBar().render(); ++ // Bubble Bar End ++ ++ // Exp Bar Begin ++ mainScreen.getExpBar().render(); ++ // Exp Bar End ++ ++ map.onRenderTick(); ++ ++ GL11.glDisable(GL11.GL_BLEND); ++ this.mc.mcProfiler.startSection("actionBar"); ++ GL11.glEnable(GL12.GL_RESCALE_NORMAL); ++ RenderHelper.enableGUIStandardItemLighting(); ++ ++ for (var15 = 0; var15 < 9; ++var15) { ++ int x = screenWidth / 2 - 90 + var15 * 20 + 2; ++ var17 = screenHeight - 16 - 3; ++ this.renderInventorySlot(var15, x, var17, f); ++ } ++ ++ RenderHelper.disableStandardItemLighting(); ++ GL11.glDisable(GL12.GL_RESCALE_NORMAL); ++ this.mc.mcProfiler.endSection(); ++ ++ if (this.mc.thePlayer.getSleepTimer() > 0) { ++ GL11.glDisable(2929 /*GL_DEPTH_TEST*/); ++ GL11.glDisable(3008 /*GL_ALPHA_TEST*/); ++ var15 = this.mc.thePlayer.getSleepTimer(); ++ float var26 = (float)var15 / 100.0F; ++ if (var26 > 1.0F) { ++ var26 = 1.0F - (float)(var15 - 100) / 10.0F; ++ } ++ ++ var17 = (int)(220.0F * var26) << 24 | 1052704; ++ this.drawRect(0, 0, screenWidth, screenHeight, var17); ++ GL11.glEnable(3008 /*GL_ALPHA_TEST*/); ++ GL11.glEnable(2929 /*GL_DEPTH_TEST*/); ++ } ++ ++ mainScreen.render(); ++ ++ int var111; ++ var111 = screenWidth / 2 - 91; + int var12; + int var13; +- if(!this.mc.playerController.enableEverythingIsScrewedUpMode()) { +- GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); +- this.mc.getTextureManager().bindTexture(widgetsTexPath); +- InventoryPlayer var31 = this.mc.thePlayer.inventory; +- this.zLevel = -90.0F; +- this.drawTexturedModalRect(var6 / 2 - 91, var7 - 22, 0, 0, 182, 22); +- this.drawTexturedModalRect(var6 / 2 - 91 - 1 + var31.currentItem * 20, var7 - 22 - 1, 0, 22, 24, 22); +- this.mc.getTextureManager().bindTexture(icons); +- GL11.glEnable(GL11.GL_BLEND); +- GL11.glBlendFunc(GL11.GL_ONE_MINUS_DST_COLOR, GL11.GL_ONE_MINUS_SRC_COLOR); +- this.drawTexturedModalRect(var6 / 2 - 7, var7 / 2 - 7, 0, 0, 16, 16); +- GL11.glDisable(GL11.GL_BLEND); +- this.mc.mcProfiler.startSection("bossHealth"); +- this.renderBossHealth(); +- this.mc.mcProfiler.endSection(); +- if(this.mc.playerController.shouldDrawHUD()) { +- this.func_110327_a(var6, var7); +- } +- +- GL11.glDisable(GL11.GL_BLEND); +- this.mc.mcProfiler.startSection("actionBar"); +- GL11.glEnable(GL12.GL_RESCALE_NORMAL); +- RenderHelper.enableGUIStandardItemLighting(); +- +- for(var11 = 0; var11 < 9; ++var11) { +- var12 = var6 / 2 - 90 + var11 * 20 + 2; +- var13 = var7 - 16 - 3; +- this.renderInventorySlot(var11, var12, var13, var1); +- } +- +- RenderHelper.disableStandardItemLighting(); +- GL11.glDisable(GL12.GL_RESCALE_NORMAL); +- this.mc.mcProfiler.endSection(); +- } +- +- int var32; +- if(this.mc.thePlayer.getSleepTimer() > 0) { +- this.mc.mcProfiler.startSection("sleep"); +- GL11.glDisable(GL11.GL_DEPTH_TEST); +- GL11.glDisable(GL11.GL_ALPHA_TEST); +- var32 = this.mc.thePlayer.getSleepTimer(); +- float var33 = (float)var32 / 100.0F; +- if(var33 > 1.0F) { +- var33 = 1.0F - (float)(var32 - 100) / 10.0F; +- } +- +- var12 = (int)(220.0F * var33) << 24 | 1052704; +- drawRect(0, 0, var6, var7, var12); +- GL11.glEnable(GL11.GL_ALPHA_TEST); +- GL11.glEnable(GL11.GL_DEPTH_TEST); +- this.mc.mcProfiler.endSection(); +- } +- +- var32 = 16777215; +- GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); +- var11 = var6 / 2 - 91; + int var14; +- int var15; ++ int var115; ++ int var117; + int var16; +- int var17; +- float var34; +- short var35; +- if(this.mc.thePlayer.isRidingHorse()) { ++ float var33; ++ float var313; ++ short var317; ++ ++ //ToDo: this will need TLC ++ if (this.mc.thePlayer.isRidingHorse()) { + this.mc.mcProfiler.startSection("jumpBar"); + this.mc.getTextureManager().bindTexture(Gui.icons); +- var34 = this.mc.thePlayer.getHorseJumpPower(); +- var35 = 182; +- var14 = (int)(var34 * (float)(var35 + 1)); +- var15 = var7 - 32 + 3; +- this.drawTexturedModalRect(var11, var15, 0, 84, var35, 5); +- if(var14 > 0) { +- this.drawTexturedModalRect(var11, var15, 0, 89, var14, 5); ++ var313 = this.mc.thePlayer.getHorseJumpPower(); ++ var317 = 182; ++ var14 = (int)(var313 * (float)(var317 + 1)); ++ var115 = screenHeight - 32 + 3; ++ this.drawTexturedModalRect(var111, var115, 0, 84, var317, 5); ++ ++ if (var14 > 0) { ++ this.drawTexturedModalRect(var111, var115, 0, 89, var14, 5); + } + + this.mc.mcProfiler.endSection(); +- } else if(this.mc.playerController.func_78763_f()) { ++ } else if (this.mc.playerController.func_78763_f()) { ++ ++ // Spout -> Removed, we have our own. ++ /* + this.mc.mcProfiler.startSection("expBar"); + this.mc.getTextureManager().bindTexture(Gui.icons); + var12 = this.mc.thePlayer.xpBarCap(); +- if(var12 > 0) { +- var35 = 182; +- var14 = (int)(this.mc.thePlayer.experience * (float)(var35 + 1)); +- var15 = var7 - 32 + 3; +- this.drawTexturedModalRect(var11, var15, 0, 64, var35, 5); +- if(var14 > 0) { +- this.drawTexturedModalRect(var11, var15, 0, 69, var14, 5); ++ ++ if (var12 > 0) { ++ var317 = 182; ++ var14 = (int)(this.mc.thePlayer.experience * (float)(var317 + 1)); ++ var115 = screenHeight - 32 + 3; ++ this.drawTexturedModalRect(var111, var115, 0, 64, var317, 5); ++ ++ if (var14 > 0) { ++ this.drawTexturedModalRect(var111, var115, 0, 69, var14, 5); + } + } ++ + + this.mc.mcProfiler.endSection(); +- if(this.mc.thePlayer.experienceLevel > 0) { ++ ++ // Spout Start -> We have our own ++ ++ if (this.mc.thePlayer.experienceLevel > 0) { + this.mc.mcProfiler.startSection("expLevel"); +- boolean var37 = false; +- var14 = var37 ? 16777215 : 8453920; +- String var39 = "" + this.mc.thePlayer.experienceLevel; +- var16 = (var6 - var8.getStringWidth(var39)) / 2; +- var17 = var7 - 31 - 4; ++ boolean var35 = false; ++ var14 = var35 ? 16777215 : 8453920; ++ String var42 = "" + this.mc.thePlayer.experienceLevel; ++ var16 = (screenWidth- font.getStringWidth(var42)) / 2; ++ var117 = screenHeight - 31 - 4; + boolean var18 = false; +- var8.drawString(var39, var16 + 1, var17, 0); +- var8.drawString(var39, var16 - 1, var17, 0); +- var8.drawString(var39, var16, var17 + 1, 0); +- var8.drawString(var39, var16, var17 - 1, 0); +- var8.drawString(var39, var16, var17, var14); ++ font.drawString(var42, var16 + 1, var117, 0); ++ font.drawString(var42, var16 - 1, var117, 0); ++ font.drawString(var42, var16, var117 + 1, 0); ++ font.drawString(var42, var16, var117 - 1, 0); ++ font.drawString(var42, var16, var117, var14); + this.mc.mcProfiler.endSection(); + } +- } +- +- String var36; +- if(this.mc.gameSettings.heldItemTooltips) { +- this.mc.mcProfiler.startSection("toolHighlight"); +- if(this.remainingHighlightTicks > 0 && this.highlightingItemStack != null) { +- var36 = this.highlightingItemStack.getDisplayName(); +- var13 = (var6 - var8.getStringWidth(var36)) / 2; +- var14 = var7 - 59; +- if(!this.mc.playerController.shouldDrawHUD()) { +- var14 += 14; +- } +- +- var15 = (int)((float)this.remainingHighlightTicks * 256.0F / 10.0F); +- if(var15 > 255) { +- var15 = 255; +- } +- +- if(var15 > 0) { +- GL11.glPushMatrix(); +- GL11.glEnable(GL11.GL_BLEND); +- GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); +- var8.drawStringWithShadow(var36, var13, var14, 16777215 + (var15 << 24)); +- GL11.glDisable(GL11.GL_BLEND); +- GL11.glPopMatrix(); +- } +- } +- +- this.mc.mcProfiler.endSection(); +- } +- +- if(this.mc.isDemo()) { +- this.mc.mcProfiler.startSection("demo"); +- var36 = ""; +- if(this.mc.theWorld.getTotalWorldTime() >= 120500L) { +- var36 = I18n.getString("demo.demoExpired"); +- } else { +- var36 = I18n.getStringParams("demo.remainingTime", new Object[]{StringUtils.ticksToElapsedTime((int)(120500L - this.mc.theWorld.getTotalWorldTime()))}); +- } +- +- var13 = var8.getStringWidth(var36); +- var8.drawStringWithShadow(var36, var6 - var13 - 10, 5, 16777215); +- this.mc.mcProfiler.endSection(); +- } +- +- int var21; +- int var22; +- int var23; +- if(this.mc.gameSettings.showDebugInfo) { ++ */ ++ } ++ ++ if (this.mc.gameSettings.showDebugInfo) { + this.mc.mcProfiler.startSection("debug"); + GL11.glPushMatrix(); +- var8.drawStringWithShadow("Minecraft 1.6.4 (" + this.mc.E + ")", 2, 2, 16777215); +- var8.drawStringWithShadow(this.mc.debugInfoRenders(), 2, 12, 16777215); +- var8.drawStringWithShadow(this.mc.getEntityDebug(), 2, 22, 16777215); +- var8.drawStringWithShadow(this.mc.debugInfoEntities(), 2, 32, 16777215); +- var8.drawStringWithShadow(this.mc.getWorldProviderName(), 2, 42, 16777215); +- long var38 = Runtime.getRuntime().maxMemory(); +- long var41 = Runtime.getRuntime().totalMemory(); +- long var43 = Runtime.getRuntime().freeMemory(); +- long var45 = var41 - var43; +- String var20 = "Used memory: " + var45 * 100L / var38 + "% (" + var45 / 1024L / 1024L + "MB) of " + var38 / 1024L / 1024L + "MB"; +- var21 = 14737632; +- this.drawString(var8, var20, var6 - var8.getStringWidth(var20) - 2, 2, 14737632); +- var20 = "Allocated memory: " + var41 * 100L / var38 + "% (" + var41 / 1024L / 1024L + "MB)"; +- this.drawString(var8, var20, var6 - var8.getStringWidth(var20) - 2, 12, 14737632); +- var22 = MathHelper.floor_double(this.mc.thePlayer.posX); +- var23 = MathHelper.floor_double(this.mc.thePlayer.posY); +- int var24 = MathHelper.floor_double(this.mc.thePlayer.posZ); +- this.drawString(var8, String.format("x: %.5f (%d) // c: %d (%d)", new Object[]{Double.valueOf(this.mc.thePlayer.posX), Integer.valueOf(var22), Integer.valueOf(var22 >> 4), Integer.valueOf(var22 & 15)}), 2, 64, 14737632); +- this.drawString(var8, String.format("y: %.3f (feet pos, %.3f eyes pos)", new Object[]{Double.valueOf(this.mc.thePlayer.boundingBox.minY), Double.valueOf(this.mc.thePlayer.posY)}), 2, 72, 14737632); +- this.drawString(var8, String.format("z: %.5f (%d) // c: %d (%d)", new Object[]{Double.valueOf(this.mc.thePlayer.posZ), Integer.valueOf(var24), Integer.valueOf(var24 >> 4), Integer.valueOf(var24 & 15)}), 2, 80, 14737632); +- int var25 = MathHelper.floor_double((double)(this.mc.thePlayer.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3; +- this.drawString(var8, "f: " + var25 + " (" + Direction.c[var25] + ") / " + MathHelper.wrapAngleTo180_float(this.mc.thePlayer.rotationYaw), 2, 88, 14737632); +- if(this.mc.theWorld != null && this.mc.theWorld.blockExists(var22, var23, var24)) { +- Chunk var26 = this.mc.theWorld.getChunkFromBlockCoords(var22, var24); +- this.drawString(var8, "lc: " + (var26.getTopFilledSegment() + 15) + " b: " + var26.getBiomeGenForWorldCoords(var22 & 15, var24 & 15, this.mc.theWorld.getWorldChunkManager()).y + " bl: " + var26.getSavedLightValue(EnumSkyBlock.Block, var22 & 15, var23, var24 & 15) + " sl: " + var26.getSavedLightValue(EnumSkyBlock.Sky, var22 & 15, var23, var24 & 15) + " rl: " + var26.getBlockLightValue(var22 & 15, var23, var24 & 15, 0), 2, 96, 14737632); ++ if (Configuration.getFastDebug() != 2) { ++ font.drawStringWithShadow("Spoutcraft 1.6.4 (" + this.mc.debug + ")", 2, 2, 16777215); ++ font.drawStringWithShadow(this.mc.debugInfoRenders(), 2, 12, 16777215); ++ font.drawStringWithShadow(this.mc.getEntityDebug(), 2, 22, 16777215); ++ font.drawStringWithShadow(this.mc.debugInfoEntities(), 2, 32, 16777215); ++ font.drawStringWithShadow(this.mc.getWorldProviderName(), 2, 42, 16777215); ++ long var41 = Runtime.getRuntime().maxMemory(); ++ long var34 = Runtime.getRuntime().totalMemory(); ++ long var42 = Runtime.getRuntime().freeMemory(); ++ long var43 = var34 - var42; ++ String var45 = "Used memory: " + var43 * 100L / var41 + "% (" + var43 / 1024L / 1024L + "MB) of " + var41 / 1024L / 1024L + "MB"; ++ this.drawString(font, var45, screenWidth - font.getStringWidth(var45) - 2, 2, 14737632); ++ var45 = "Allocated memory: " + var34 * 100L / var41 + "% (" + var34 / 1024L / 1024L + "MB)"; ++ this.drawString(font, var45, screenWidth - font.getStringWidth(var45) - 2, 12, 14737632); ++ int var47 = MathHelper.floor_double(this.mc.thePlayer.posX); ++ int var22 = MathHelper.floor_double(this.mc.thePlayer.posY); ++ int var23 = MathHelper.floor_double(this.mc.thePlayer.posZ); ++ if(SpoutClient.getInstance().isCoordsCheat()) { ++ this.drawString(font, String.format("x: %.5f (%d) // c: %d (%d)", new Object[] {Double.valueOf(this.mc.thePlayer.posX), Integer.valueOf(var47), Integer.valueOf(var47 >> 4), Integer.valueOf(var47 & 15)}), 2, 64, 14737632); ++ this.drawString(font, String.format("y: %.3f (feet pos, %.3f eyes pos)", new Object[] {Double.valueOf(this.mc.thePlayer.boundingBox.minY), Double.valueOf(this.mc.thePlayer.posY)}), 2, 72, 14737632); ++ this.drawString(font, String.format("z: %.5f (%d) // c: %d (%d)", new Object[] {Double.valueOf(this.mc.thePlayer.posZ), Integer.valueOf(var23), Integer.valueOf(var23 >> 4), Integer.valueOf(var23 & 15)}), 2, 80, 14737632); ++ int var24 = MathHelper.floor_double((double)(this.mc.thePlayer.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3; ++ this.drawString(font, "f: " + var24 + " (" + Direction.directions[var24] + ") / " + MathHelper.wrapAngleTo180_float(this.mc.thePlayer.rotationYaw), 2, 88, 14737632); ++ } ++ ++ if (this.mc.theWorld != null && this.mc.theWorld.blockExists(var47, var22, var23)) { ++ Chunk var48 = this.mc.theWorld.getChunkFromBlockCoords(var47, var23); ++ this.drawString(font, "lc: " + (var48.getTopFilledSegment() + 15) + " b: " + var48.getBiomeGenForWorldCoords(var47 & 15, var23 & 15, this.mc.theWorld.getWorldChunkManager()).biomeName + " bl: " + var48.getSavedLightValue(EnumSkyBlock.Block, var47 & 15, var22, var23 & 15) + " sl: " + var48.getSavedLightValue(EnumSkyBlock.Sky, var47 & 15, var22, var23 & 15) + " rl: " + var48.getBlockLightValue(var47 & 15, var22, var23 & 15, 0), 2, 96, 14737632); ++ } ++ ++ this.drawString(font, String.format("ws: %.3f, fs: %.3f, g: %b, fl: %d", new Object[] {Float.valueOf(this.mc.thePlayer.capabilities.getWalkSpeed()), Float.valueOf(this.mc.thePlayer.capabilities.getFlySpeed()), Boolean.valueOf(this.mc.thePlayer.onGround), Integer.valueOf(this.mc.theWorld.getHeightValue(var47, var23))}), 2, 104, 14737632); ++ ++ } else { ++ font.drawStringWithShadow(Integer.toString(Minecraft.framesPerSecond), 4, 2, 0xFFE303); + } +- +- this.drawString(var8, String.format("ws: %.3f, fs: %.3f, g: %b, fl: %d", new Object[]{Float.valueOf(this.mc.thePlayer.capabilities.getWalkSpeed()), Float.valueOf(this.mc.thePlayer.capabilities.getFlySpeed()), Boolean.valueOf(this.mc.thePlayer.onGround), Integer.valueOf(this.mc.theWorld.getHeightValue(var22, var24))}), 2, 104, 14737632); ++ this.mc.mcProfiler.endSection(); + GL11.glPopMatrix(); +- this.mc.mcProfiler.endSection(); +- } +- +- if(this.recordPlayingUpFor > 0) { +- this.mc.mcProfiler.startSection("overlayMessage"); +- var34 = (float)this.recordPlayingUpFor - var1; +- var13 = (int)(var34 * 255.0F / 20.0F); +- if(var13 > 255) { +- var13 = 255; +- } +- +- if(var13 > 8) { +- GL11.glPushMatrix(); +- GL11.glTranslatef((float)(var6 / 2), (float)(var7 - 68), 0.0F); +- GL11.glEnable(GL11.GL_BLEND); +- GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); +- var14 = 16777215; +- if(this.recordIsPlaying) { +- var14 = Color.HSBtoRGB(var34 / 50.0F, 0.7F, 0.6F) & 16777215; +- } +- +- var8.drawString(this.j, -var8.getStringWidth(this.j) / 2, -4, var14 + (var13 << 24 & -16777216)); +- GL11.glDisable(GL11.GL_BLEND); +- GL11.glPopMatrix(); +- } +- +- this.mc.mcProfiler.endSection(); +- } +- +- ScoreObjective var40 = this.mc.theWorld.getScoreboard().func_96539_a(1); +- if(var40 != null) { +- this.func_96136_a(var40, var7, var6, var8); +- } +- ++ ++ if (this.recordPlayingUpFor > 0) { ++ this.mc.mcProfiler.startSection("overlayMessage"); ++ var33 = (float)this.recordPlayingUpFor - f; ++ var12 = (int)(var33 * 256.0F / 20.0F); ++ ++ if (var12 > 255) { ++ var12 = 255; ++ } ++ ++ if (var12 > 0) { ++ GL11.glPushMatrix(); ++ GL11.glTranslatef((float)(screenWidth / 2), (float)(screenHeight - 48), 0.0F); ++ GL11.glEnable(GL11.GL_BLEND); ++ GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); ++ var13 = 16777215; ++ ++ if (this.recordIsPlaying) { ++ var13 = Color.HSBtoRGB(var33 / 50.0F, 0.7F, 0.6F) & 16777215; ++ } ++ ++ font.drawString(this.recordPlaying, -font.getStringWidth(this.recordPlaying) / 2, -4, var13 + (var12 << 24)); ++ GL11.glDisable(GL11.GL_BLEND); ++ GL11.glPopMatrix(); ++ } ++ ++ this.mc.mcProfiler.endSection(); ++ } ++ } + GL11.glEnable(GL11.GL_BLEND); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + GL11.glDisable(GL11.GL_ALPHA_TEST); + GL11.glPushMatrix(); +- GL11.glTranslatef(0.0F, (float)(var7 - 48), 0.0F); ++ ++ int var38; ++ // Spout Start ++ float pHealth; ++ float ppHealth; ++ ++ // Hotbar Text ++ if (Configuration.showHotbarText) { ++ String var35; ++ String custom = null; ++ pHealth = this.mc.thePlayer.getHealth(); ++ ppHealth = this.mc.thePlayer.prevHealth; ++ String var34 = "" + this.mc.thePlayer.experienceLevel; ++ var38 = (screenWidth - font.getStringWidth(var34)) / 2; ++ this.mc.mcProfiler.startSection("toolHighlight"); ++ ++ if (this.remainingHighlightTicks > 0 && this.highlightingItemStack != null) { ++ if (this.highlightingItemStack.itemID == MaterialData.flint.getRawId()) { ++ custom = Spoutcraft.getMaterialManager().getToolTip(new CraftItemStack(this.highlightingItemStack)); ++ } ++ if (custom != null) { ++ String[] split = custom.split("\n"); ++ String newCustom = split[0]; ++ var35 = newCustom; ++ } else { ++ var35 = this.highlightingItemStack.getDisplayName(); ++ } ++ var12 = (screenWidth - font.getStringWidth(var35)) / 2; ++ var13 = screenHeight - 59; ++ ++ if (!mainScreen.getHungerBar().isVisible() || !mainScreen.getHealthBar().isVisible()) { ++ var13 += 8; ++ } ++ if (!mainScreen.getArmorBar().isVisible()) { ++ var13 += 8; ++ } ++ ++ if (!mainScreen.getExpBar().isVisible()) { ++ var13 += 6; ++ } ++ ++ var38 = (int)((float)this.remainingHighlightTicks * 256.0F / 10.0F); ++ ++ if (var38 > 255) { ++ var38 = 255; ++ } ++ ++ if (var38 > 0) { ++ GL11.glPushMatrix(); ++ GL11.glEnable(GL11.GL_BLEND); ++ GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); ++ font.drawStringWithShadow(var35, var12, var13, 16777215 + (var38 << 24)); ++ GL11.glDisable(GL11.GL_BLEND); ++ GL11.glPopMatrix(); ++ } ++ } ++ ++ this.mc.mcProfiler.endSection(); ++ } ++ ++ ScoreObjective var42 = this.mc.theWorld.getScoreboard().func_96539_a(1); ++ ++ if (var42 != null) { ++ this.func_96136_a(var42, screenHeight, screenWidth, font); ++ } ++ ++ GL11.glTranslatef(0.0F, (float)(screenHeight - 48), 0.0F); + this.mc.mcProfiler.startSection("chat"); + this.persistantChatGUI.drawChat(this.updateCounter); + this.mc.mcProfiler.endSection(); + GL11.glPopMatrix(); +- var40 = this.mc.theWorld.getScoreboard().func_96539_a(0); +- if(this.mc.gameSettings.keyBindPlayerList.pressed && (!this.mc.isIntegratedServerRunning() || this.mc.thePlayer.sendQueue.c.size() > 1 || var40 != null)) { ++ var42 = this.mc.theWorld.getScoreboard().func_96539_a(0); ++ ++ if (this.mc.gameSettings.keyBindPlayerList.pressed && (!this.mc.isIntegratedServerRunning() || this.mc.thePlayer.sendQueue.playerInfoList.size() > 1)) { + this.mc.mcProfiler.startSection("playerList"); +- NetClientHandler var42 = this.mc.thePlayer.sendQueue; +- List var44 = var42.c; +- var15 = var42.currentServerMaxPlayers; +- var16 = var15; +- +- for(var17 = 1; var16 > 20; var16 = (var15 + var17 - 1) / var17) { +- ++var17; +- } +- +- int var46 = 300 / var17; +- if(var46 > 150) { +- var46 = 150; +- } +- +- int var19 = (var6 - var17 * var46) / 2; +- byte var47 = 10; +- drawRect(var19 - 1, var47 - 1, var19 + var46 * var17, var47 + 9 * var16, Integer.MIN_VALUE); +- +- for(var21 = 0; var21 < var15; ++var21) { +- var22 = var19 + var21 % var17 * var46; +- var23 = var47 + var21 / var17 * 9; +- drawRect(var22, var23, var22 + var46 - 1, var23 + 8, 553648127); ++ NetClientHandler var37 = this.mc.thePlayer.sendQueue; ++ List var39 = var37.playerInfoList; ++ var13 = var37.currentServerMaxPlayers; ++ int var40 = var13; ++ ++ for (var38 = 1; var40 > 20; var40 = (var13 + var38 - 1) / var38) { ++ ++var38; ++ } ++ ++ var16 = 300 / var38; ++ ++ if (var16 > 150) { ++ var16 = 150; ++ } ++ ++ var117 = (screenWidth - var38 * var16) / 2; ++ byte var44 = 10; ++ drawRect(var117 - 1, var44 - 1, var117 + var16 * var38, var44 + 9 * var40, Integer.MIN_VALUE); ++ ++ for (int var19 = 0; var19 < var13; ++var19) { ++ int var20 = var117 + var19 % var38 * var16; ++ int var47 = var44 + var19 / var38 * 9; ++ drawRect(var20, var47, var20 + var16 - 1, var47 + 8, 553648127); + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + GL11.glEnable(GL11.GL_ALPHA_TEST); +- if(var21 < var44.size()) { +- GuiPlayerInfo var48 = (GuiPlayerInfo)var44.get(var21); +- ScorePlayerTeam var49 = this.mc.theWorld.getScoreboard().getPlayersTeam(var48.a); +- String var50 = ScorePlayerTeam.formatPlayerName(var49, var48.a); +- var8.drawStringWithShadow(var50, var22, var23, 16777215); +- if(var40 != null) { +- int var27 = var22 + var8.getStringWidth(var50) + 5; +- int var28 = var22 + var46 - 12 - 5; +- if(var28 - var27 > 5) { +- Score var29 = var40.getScoreboard().func_96529_a(var48.a, var40); +- String var30 = EnumChatFormatting.YELLOW + "" + var29.getScorePoints(); +- var8.drawStringWithShadow(var30, var28 - var8.getStringWidth(var30), var23, 16777215); ++ ++ if (var19 < var39.size()) { ++ GuiPlayerInfo var46 = (GuiPlayerInfo)var39.get(var19); ++ ScorePlayerTeam var60 = this.mc.theWorld.getScoreboard().getPlayersTeam(var46.name); ++ String var53 = ScorePlayerTeam.formatPlayerName(var60, var46.name); ++ font.drawStringWithShadow(var53, var20, var47, 16777215); ++ ++ GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); // TODO: might not need this. ++ ++ if (var42 != null) { ++ int var51 = var20 + font.getStringWidth(var53) + 5; ++ int var50 = var20 + var16 - 12 - 5; ++ ++ if (var50 - var51 > 5) { ++ Score var56 = var42.getScoreboard().func_96529_a(var46.name, var42); ++ String var57 = EnumChatFormatting.YELLOW + "" + var56.getScorePoints(); ++ font.drawStringWithShadow(var57, var50 - font.getStringWidth(var57), var47, 16777215); + } + } +- +- GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); ++ + this.mc.getTextureManager().bindTexture(icons); +- byte var51 = 0; +- boolean var52 = false; +- byte var53; +- if(var48.responseTime < 0) { +- var53 = 5; +- } else if(var48.responseTime < 150) { +- var53 = 0; +- } else if(var48.responseTime < 300) { +- var53 = 1; +- } else if(var48.responseTime < 600) { +- var53 = 2; +- } else if(var48.responseTime < 1000) { +- var53 = 3; ++ byte var50 = 0; ++ boolean var48 = false; ++ byte var49; ++ ++ if (var46.responseTime < 0) { ++ var49 = 5; ++ } else if (var46.responseTime < 150) { ++ var49 = 0; ++ } else if (var46.responseTime < 300) { ++ var49 = 1; ++ } else if (var46.responseTime < 600) { ++ var49 = 2; ++ } else if (var46.responseTime < 1000) { ++ var49 = 3; + } else { +- var53 = 4; ++ var49 = 4; + } + + this.zLevel += 100.0F; +- this.drawTexturedModalRect(var22 + var46 - 12, var23, 0 + var51 * 10, 176 + var53 * 8, 10, 8); ++ this.drawTexturedModalRect(var20 + var16 - 12, var47, 0 + var50 * 10, 176 + var49 * 8, 10, 8); + this.zLevel -= 100.0F; + } + } +@@ -358,65 +465,69 @@ + GL11.glEnable(GL11.GL_ALPHA_TEST); + } + +- private void func_96136_a(ScoreObjective var1, int var2, int var3, FontRenderer var4) { +- Scoreboard var5 = var1.getScoreboard(); +- Collection var6 = var5.func_96534_i(var1); +- if(var6.size() <= 15) { +- int var7 = var4.getStringWidth(var1.getDisplayName()); ++ private void func_96136_a(ScoreObjective par1ScoreObjective, int par2, int par3, FontRenderer par4FontRenderer) { ++ Scoreboard var5 = par1ScoreObjective.getScoreboard(); ++ Collection var6 = var5.func_96534_i(par1ScoreObjective); + ++ if (var6.size() <= 15) { ++ int var7 = par4FontRenderer.getStringWidth(par1ScoreObjective.getDisplayName()); + String var11; +- for(Iterator var8 = var6.iterator(); var8.hasNext(); var7 = Math.max(var7, var4.getStringWidth(var11))) { ++ ++ for (Iterator var8 = var6.iterator(); var8.hasNext(); var7 = Math.max(var7, par4FontRenderer.getStringWidth(var11))) { + Score var9 = (Score)var8.next(); + ScorePlayerTeam var10 = var5.getPlayersTeam(var9.getPlayerName()); + var11 = ScorePlayerTeam.formatPlayerName(var10, var9.getPlayerName()) + ": " + EnumChatFormatting.RED + var9.getScorePoints(); + } + +- int var22 = var6.size() * var4.FONT_HEIGHT; +- int var23 = var2 / 2 + var22 / 3; +- byte var24 = 3; +- int var25 = var3 - var7 - var24; ++ int var22 = var6.size() * par4FontRenderer.FONT_HEIGHT; ++ int var23 = par2 / 2 + var22 / 3; ++ byte var25 = 3; ++ int var24 = par3 - var7 - var25; + int var12 = 0; + Iterator var13 = var6.iterator(); + +- while(var13.hasNext()) { ++ while (var13.hasNext()) { + Score var14 = (Score)var13.next(); + ++var12; + ScorePlayerTeam var15 = var5.getPlayersTeam(var14.getPlayerName()); + String var16 = ScorePlayerTeam.formatPlayerName(var15, var14.getPlayerName()); + String var17 = EnumChatFormatting.RED + "" + var14.getScorePoints(); +- int var19 = var23 - var12 * var4.FONT_HEIGHT; +- int var20 = var3 - var24 + 2; +- drawRect(var25 - 2, var19, var20, var19 + var4.FONT_HEIGHT, 1342177280); +- var4.drawString(var16, var25, var19, 553648127); +- var4.drawString(var17, var20 - var4.getStringWidth(var17), var19, 553648127); +- if(var12 == var6.size()) { +- String var21 = var1.getDisplayName(); +- drawRect(var25 - 2, var19 - var4.FONT_HEIGHT - 1, var20, var19 - 1, 1610612736); +- drawRect(var25 - 2, var19 - 1, var20, var19, 1342177280); +- var4.drawString(var21, var25 + var7 / 2 - var4.getStringWidth(var21) / 2, var19 - var4.FONT_HEIGHT, 553648127); ++ int var19 = var23 - var12 * par4FontRenderer.FONT_HEIGHT; ++ int var20 = par3 - var25 + 2; ++ drawRect(var24 - 2, var19, var20, var19 + par4FontRenderer.FONT_HEIGHT, 1342177280); ++ par4FontRenderer.drawString(var16, var24, var19, 553648127); ++ par4FontRenderer.drawString(var17, var20 - par4FontRenderer.getStringWidth(var17), var19, 553648127); ++ ++ if (var12 == var6.size()) { ++ String var21 = par1ScoreObjective.getDisplayName(); ++ drawRect(var24 - 2, var19 - par4FontRenderer.FONT_HEIGHT - 1, var20, var19 - 1, 1610612736); ++ drawRect(var24 - 2, var19 - 1, var20, var19, 1342177280); ++ par4FontRenderer.drawString(var21, var24 + var7 / 2 - par4FontRenderer.getStringWidth(var21) / 2, var19 - par4FontRenderer.FONT_HEIGHT, 553648127); + } + } +- + } + } ++ ++ //ToDo: this is a duplicate method at the moment + +- private void func_110327_a(int var1, int var2) { ++ private void func_110327_a(int par1, int par2) { + boolean var3 = this.mc.thePlayer.hurtResistantTime / 3 % 2 == 1; +- if(this.mc.thePlayer.hurtResistantTime < 10) { ++ ++ if (this.mc.thePlayer.hurtResistantTime < 10) { + var3 = false; + } + + int var4 = MathHelper.ceiling_float_int(this.mc.thePlayer.getHealth()); + int var5 = MathHelper.ceiling_float_int(this.mc.thePlayer.prevHealth); +- this.f.setSeed((long)(this.updateCounter * 312871)); ++ this.rand.setSeed((long)(this.updateCounter * 312871)); + boolean var6 = false; + FoodStats var7 = this.mc.thePlayer.getFoodStats(); + int var8 = var7.getFoodLevel(); + int var9 = var7.getPrevFoodLevel(); + AttributeInstance var10 = this.mc.thePlayer.getEntityAttribute(SharedMonsterAttributes.maxHealth); +- int var11 = var1 / 2 - 91; +- int var12 = var1 / 2 + 91; +- int var13 = var2 - 39; ++ int var11 = par1 / 2 - 91; ++ int var12 = par1 / 2 + 91; ++ int var13 = par2 - 39; + float var14 = (float)var10.getAttributeValue(); + float var15 = this.mc.thePlayer.getAbsorptionAmount(); + int var16 = MathHelper.ceiling_float_int((var14 + var15) / 2.0F / 10.0F); +@@ -425,78 +536,85 @@ + float var19 = var15; + int var20 = this.mc.thePlayer.getTotalArmorValue(); + int var21 = -1; +- if(this.mc.thePlayer.isPotionActive(Potion.regeneration)) { ++ ++ if (this.mc.thePlayer.isPotionActive(Potion.regeneration)) { + var21 = this.updateCounter % MathHelper.ceiling_float_int(var14 + 5.0F); + } + + this.mc.mcProfiler.startSection("armor"); +- +- int var22; + int var23; +- for(var22 = 0; var22 < 10; ++var22) { +- if(var20 > 0) { ++ int var22; ++ ++ for (var22 = 0; var22 < 10; ++var22) { ++ if (var20 > 0) { + var23 = var11 + var22 * 8; +- if(var22 * 2 + 1 < var20) { ++ ++ if (var22 * 2 + 1 < var20) { + this.drawTexturedModalRect(var23, var18, 34, 9, 9, 9); + } + +- if(var22 * 2 + 1 == var20) { ++ if (var22 * 2 + 1 == var20) { + this.drawTexturedModalRect(var23, var18, 25, 9, 9, 9); + } + +- if(var22 * 2 + 1 > var20) { ++ if (var22 * 2 + 1 > var20) { + this.drawTexturedModalRect(var23, var18, 16, 9, 9, 9); + } + } + } + + this.mc.mcProfiler.endStartSection("health"); +- + int var25; +- int var26; + int var27; +- for(var22 = MathHelper.ceiling_float_int((var14 + var15) / 2.0F) - 1; var22 >= 0; --var22) { ++ int var26; ++ ++ for (var22 = MathHelper.ceiling_float_int((var14 + var15) / 2.0F) - 1; var22 >= 0; --var22) { + var23 = 16; +- if(this.mc.thePlayer.isPotionActive(Potion.poison)) { ++ ++ if (this.mc.thePlayer.isPotionActive(Potion.poison)) { + var23 += 36; +- } else if(this.mc.thePlayer.isPotionActive(Potion.wither)) { ++ } else if (this.mc.thePlayer.isPotionActive(Potion.wither)) { + var23 += 72; + } + + byte var24 = 0; +- if(var3) { ++ ++ if (var3) { + var24 = 1; + } + + var25 = MathHelper.ceiling_float_int((float)(var22 + 1) / 10.0F) - 1; + var26 = var11 + var22 % 10 * 8; + var27 = var13 - var25 * var17; +- if(var4 <= 4) { +- var27 += this.f.nextInt(2); ++ ++ if (var4 <= 4) { ++ var27 += this.rand.nextInt(2); + } + +- if(var22 == var21) { ++ if (var22 == var21) { + var27 -= 2; + } + + byte var28 = 0; +- if(this.mc.theWorld.getWorldInfo().isHardcoreModeEnabled()) { ++ ++ if (this.mc.theWorld.getWorldInfo().isHardcoreModeEnabled()) { + var28 = 5; + } + + this.drawTexturedModalRect(var26, var27, 16 + var24 * 9, 9 * var28, 9, 9); +- if(var3) { +- if(var22 * 2 + 1 < var5) { ++ ++ if (var3) { ++ if (var22 * 2 + 1 < var5) { + this.drawTexturedModalRect(var26, var27, var23 + 54, 9 * var28, 9, 9); + } + +- if(var22 * 2 + 1 == var5) { ++ if (var22 * 2 + 1 == var5) { + this.drawTexturedModalRect(var26, var27, var23 + 63, 9 * var28, 9, 9); + } + } + +- if(var19 > 0.0F) { +- if(var19 == var15 && var15 % 2.0F == 1.0F) { ++ if (var19 > 0.0F) { ++ if (var19 == var15 && var15 % 2.0F == 1.0F) { + this.drawTexturedModalRect(var26, var27, var23 + 153, 9 * var28, 9, 9); + } else { + this.drawTexturedModalRect(var26, var27, var23 + 144, 9 * var28, 9, 9); +@@ -504,11 +622,11 @@ + + var19 -= 2.0F; + } else { +- if(var22 * 2 + 1 < var4) { ++ if (var22 * 2 + 1 < var4) { + this.drawTexturedModalRect(var26, var27, var23 + 36, 9 * var28, 9, 9); + } + +- if(var22 * 2 + 1 == var4) { ++ if (var22 * 2 + 1 == var4) { + this.drawTexturedModalRect(var26, var27, var23 + 45, 9 * var28, 9, 9); + } + } +@@ -516,76 +634,82 @@ + + Entity var34 = this.mc.thePlayer.ridingEntity; + int var35; +- if(var34 == null) { ++ ++ if (var34 == null) { + this.mc.mcProfiler.endStartSection("food"); + +- for(var23 = 0; var23 < 10; ++var23) { ++ for (var23 = 0; var23 < 10; ++var23) { + var35 = var13; + var25 = 16; + byte var36 = 0; +- if(this.mc.thePlayer.isPotionActive(Potion.hunger)) { ++ ++ if (this.mc.thePlayer.isPotionActive(Potion.hunger)) { + var25 += 36; + var36 = 13; + } + +- if(this.mc.thePlayer.getFoodStats().getSaturationLevel() <= 0.0F && this.updateCounter % (var8 * 3 + 1) == 0) { +- var35 = var13 + (this.f.nextInt(3) - 1); ++ if (this.mc.thePlayer.getFoodStats().getSaturationLevel() <= 0.0F && this.updateCounter % (var8 * 3 + 1) == 0) { ++ var35 = var13 + (this.rand.nextInt(3) - 1); + } + +- if(var6) { ++ if (var6) { + var36 = 1; + } + + var27 = var12 - var23 * 8 - 9; + this.drawTexturedModalRect(var27, var35, 16 + var36 * 9, 27, 9, 9); +- if(var6) { +- if(var23 * 2 + 1 < var9) { ++ ++ if (var6) { ++ if (var23 * 2 + 1 < var9) { + this.drawTexturedModalRect(var27, var35, var25 + 54, 27, 9, 9); + } + +- if(var23 * 2 + 1 == var9) { ++ if (var23 * 2 + 1 == var9) { + this.drawTexturedModalRect(var27, var35, var25 + 63, 27, 9, 9); + } + } + +- if(var23 * 2 + 1 < var8) { ++ if (var23 * 2 + 1 < var8) { + this.drawTexturedModalRect(var27, var35, var25 + 36, 27, 9, 9); + } + +- if(var23 * 2 + 1 == var8) { ++ if (var23 * 2 + 1 == var8) { + this.drawTexturedModalRect(var27, var35, var25 + 45, 27, 9, 9); + } + } +- } else if(var34 instanceof EntityLivingBase) { ++ } else if (var34 instanceof EntityLivingBase) { + this.mc.mcProfiler.endStartSection("mountHealth"); +- EntityLivingBase var37 = (EntityLivingBase)var34; +- var35 = (int)Math.ceil((double)var37.getHealth()); +- float var38 = var37.getMaxHealth(); +- var26 = (int)(var38 + 0.5F) / 2; +- if(var26 > 30) { ++ EntityLivingBase var38 = (EntityLivingBase)var34; ++ var35 = (int)Math.ceil((double)var38.getHealth()); ++ float var37 = var38.getMaxHealth(); ++ var26 = (int)(var37 + 0.5F) / 2; ++ ++ if (var26 > 30) { + var26 = 30; + } + + var27 = var13; + +- for(int var39 = 0; var26 > 0; var39 += 20) { ++ for (int var39 = 0; var26 > 0; var39 += 20) { + int var29 = Math.min(var26, 10); + var26 -= var29; + +- for(int var30 = 0; var30 < var29; ++var30) { ++ for (int var30 = 0; var30 < var29; ++var30) { + byte var31 = 52; + byte var32 = 0; +- if(var6) { ++ ++ if (var6) { + var32 = 1; + } + + int var33 = var12 - var30 * 8 - 9; + this.drawTexturedModalRect(var33, var27, var31 + var32 * 9, 9, 9, 9); +- if(var30 * 2 + 1 + var39 < var35) { ++ ++ if (var30 * 2 + 1 + var39 < var35) { + this.drawTexturedModalRect(var33, var27, var31 + 36, 9, 9, 9); + } + +- if(var30 * 2 + 1 + var39 == var35) { ++ if (var30 * 2 + 1 + var39 == var35) { + this.drawTexturedModalRect(var33, var27, var31 + 45, 9, 9, 9); + } + } +@@ -595,13 +719,14 @@ + } + + this.mc.mcProfiler.endStartSection("air"); +- if(this.mc.thePlayer.isInsideOfMaterial(Material.water)) { ++ ++ if (this.mc.thePlayer.isInsideOfMaterial(Material.water)) { + var23 = this.mc.thePlayer.getAir(); + var35 = MathHelper.ceiling_double_int((double)(var23 - 2) * 10.0D / 300.0D); + var25 = MathHelper.ceiling_double_int((double)var23 * 10.0D / 300.0D) - var35; + +- for(var26 = 0; var26 < var35 + var25; ++var26) { +- if(var26 < var35) { ++ for (var26 = 0; var26 < var35 + var25; ++var26) { ++ if (var26 < var35) { + this.drawTexturedModalRect(var12 - var26 * 8 - 9, var18, 16, 18, 9, 9); + } else { + this.drawTexturedModalRect(var12 - var26 * 8 - 9, var18, 25, 18, 9, 9); +@@ -612,8 +737,12 @@ + this.mc.mcProfiler.endSection(); + } + ++ ++ /** ++ * Renders dragon's (boss) health on the HUD ++ */ + private void renderBossHealth() { +- if(BossStatus.c != null && BossStatus.statusBarLength > 0) { ++ if (BossStatus.bossName != null && BossStatus.statusBarLength > 0) { + --BossStatus.statusBarLength; + FontRenderer var1 = this.mc.fontRenderer; + ScaledResolution var2 = new ScaledResolution(this.mc.gameSettings, this.mc.displayWidth, this.mc.displayHeight); +@@ -624,18 +753,19 @@ + byte var7 = 12; + this.drawTexturedModalRect(var5, var7, 0, 74, var4, 5); + this.drawTexturedModalRect(var5, var7, 0, 74, var4, 5); +- if(var6 > 0) { ++ ++ if (var6 > 0) { + this.drawTexturedModalRect(var5, var7, 0, 79, var6, 5); + } + +- String var8 = BossStatus.c; ++ String var8 = BossStatus.bossName; + var1.drawStringWithShadow(var8, var3 / 2 - var1.getStringWidth(var8) / 2, var7 - 10, 16777215); + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + this.mc.getTextureManager().bindTexture(icons); + } + } + +- private void renderPumpkinBlur(int var1, int var2) { ++ private void renderPumpkinBlur(int par1, int par2) { + GL11.glDisable(GL11.GL_DEPTH_TEST); + GL11.glDepthMask(false); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); +@@ -644,9 +774,9 @@ + this.mc.getTextureManager().bindTexture(pumpkinBlurTexPath); + Tessellator var3 = Tessellator.instance; + var3.startDrawingQuads(); +- var3.addVertexWithUV(0.0D, (double)var2, -90.0D, 0.0D, 1.0D); +- var3.addVertexWithUV((double)var1, (double)var2, -90.0D, 1.0D, 1.0D); +- var3.addVertexWithUV((double)var1, 0.0D, -90.0D, 1.0D, 0.0D); ++ var3.addVertexWithUV(0.0D, (double)par2, -90.0D, 0.0D, 1.0D); ++ var3.addVertexWithUV((double)par1, (double)par2, -90.0D, 1.0D, 1.0D); ++ var3.addVertexWithUV((double)par1, 0.0D, -90.0D, 1.0D, 0.0D); + var3.addVertexWithUV(0.0D, 0.0D, -90.0D, 0.0D, 0.0D); + var3.draw(); + GL11.glDepthMask(true); +@@ -655,17 +785,21 @@ + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + } + +- private void renderVignette(float var1, int var2, int var3) { +- var1 = 1.0F - var1; +- if(var1 < 0.0F) { +- var1 = 0.0F; +- } +- +- if(var1 > 1.0F) { +- var1 = 1.0F; +- } +- +- this.prevVignetteBrightness = (float)((double)this.prevVignetteBrightness + (double)(var1 - this.prevVignetteBrightness) * 0.01D); ++ /** ++ * Renders the vignette. Args: vignetteBrightness, width, height ++ */ ++ private void renderVignette(float par1, int par2, int par3) { ++ par1 = 1.0F - par1; ++ ++ if (par1 < 0.0F) { ++ par1 = 0.0F; ++ } ++ ++ if (par1 > 1.0F) { ++ par1 = 1.0F; ++ } ++ ++ this.prevVignetteBrightness = (float)((double)this.prevVignetteBrightness + (double)(par1 - this.prevVignetteBrightness) * 0.01D); + GL11.glDisable(GL11.GL_DEPTH_TEST); + GL11.glDepthMask(false); + GL11.glBlendFunc(GL11.GL_ZERO, GL11.GL_ONE_MINUS_SRC_COLOR); +@@ -673,9 +807,9 @@ + this.mc.getTextureManager().bindTexture(vignetteTexPath); + Tessellator var4 = Tessellator.instance; + var4.startDrawingQuads(); +- var4.addVertexWithUV(0.0D, (double)var3, -90.0D, 0.0D, 1.0D); +- var4.addVertexWithUV((double)var2, (double)var3, -90.0D, 1.0D, 1.0D); +- var4.addVertexWithUV((double)var2, 0.0D, -90.0D, 1.0D, 0.0D); ++ var4.addVertexWithUV(0.0D, (double)par3, -90.0D, 0.0D, 1.0D); ++ var4.addVertexWithUV((double)par2, (double)par3, -90.0D, 1.0D, 1.0D); ++ var4.addVertexWithUV((double)par2, 0.0D, -90.0D, 1.0D, 0.0D); + var4.addVertexWithUV(0.0D, 0.0D, -90.0D, 0.0D, 0.0D); + var4.draw(); + GL11.glDepthMask(true); +@@ -684,18 +818,18 @@ + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + } + +- private void func_130015_b(float var1, int var2, int var3) { +- if(var1 < 1.0F) { +- var1 *= var1; +- var1 *= var1; +- var1 = var1 * 0.8F + 0.2F; ++ private void func_130015_b(float par1, int par2, int par3) { ++ if (par1 < 1.0F) { ++ par1 *= par1; ++ par1 *= par1; ++ par1 = par1 * 0.8F + 0.2F; + } + + GL11.glDisable(GL11.GL_ALPHA_TEST); + GL11.glDisable(GL11.GL_DEPTH_TEST); + GL11.glDepthMask(false); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); +- GL11.glColor4f(1.0F, 1.0F, 1.0F, var1); ++ GL11.glColor4f(1.0F, 1.0F, 1.0F, par1); + Icon var4 = Block.portal.getBlockTextureFromSide(1); + this.mc.getTextureManager().bindTexture(TextureMap.locationBlocksTexture); + float var5 = var4.getMinU(); +@@ -704,9 +838,9 @@ + float var8 = var4.getMaxV(); + Tessellator var9 = Tessellator.instance; + var9.startDrawingQuads(); +- var9.addVertexWithUV(0.0D, (double)var3, -90.0D, (double)var5, (double)var8); +- var9.addVertexWithUV((double)var2, (double)var3, -90.0D, (double)var7, (double)var8); +- var9.addVertexWithUV((double)var2, 0.0D, -90.0D, (double)var7, (double)var6); ++ var9.addVertexWithUV(0.0D, (double)par3, -90.0D, (double)var5, (double)var8); ++ var9.addVertexWithUV((double)par2, (double)par3, -90.0D, (double)var7, (double)var8); ++ var9.addVertexWithUV((double)par2, 0.0D, -90.0D, (double)var7, (double)var6); + var9.addVertexWithUV(0.0D, 0.0D, -90.0D, (double)var5, (double)var6); + var9.draw(); + GL11.glDepthMask(true); +@@ -715,39 +849,50 @@ + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + } + +- private void renderInventorySlot(int var1, int var2, int var3, float var4) { +- ItemStack var5 = this.mc.thePlayer.inventory.mainInventory[var1]; +- if(var5 != null) { +- float var6 = (float)var5.animationsToGo - var4; +- if(var6 > 0.0F) { ++ /** ++ * Renders the specified item of the inventory slot at the specified location. Args: slot, x, y, partialTick ++ */ ++ private void renderInventorySlot(int par1, int par2, int par3, float par4) { ++ ItemStack var5 = this.mc.thePlayer.inventory.mainInventory[par1]; ++ ++ if (var5 != null) { ++ float var6 = (float)var5.animationsToGo - par4; ++ ++ if (var6 > 0.0F) { + GL11.glPushMatrix(); + float var7 = 1.0F + var6 / 5.0F; +- GL11.glTranslatef((float)(var2 + 8), (float)(var3 + 12), 0.0F); ++ GL11.glTranslatef((float)(par2 + 8), (float)(par3 + 12), 0.0F); + GL11.glScalef(1.0F / var7, (var7 + 1.0F) / 2.0F, 1.0F); +- GL11.glTranslatef((float)(-(var2 + 8)), (float)(-(var3 + 12)), 0.0F); ++ GL11.glTranslatef((float)(-(par2 + 8)), (float)(-(par3 + 12)), 0.0F); + } + +- itemRenderer.renderItemAndEffectIntoGUI(this.mc.fontRenderer, this.mc.getTextureManager(), var5, var2, var3); +- if(var6 > 0.0F) { ++ itemRenderer.renderItemAndEffectIntoGUI(this.mc.fontRenderer, this.mc.getTextureManager(), var5, par2, par3); ++ ++ if (var6 > 0.0F) { + GL11.glPopMatrix(); + } + +- itemRenderer.renderItemOverlayIntoGUI(this.mc.fontRenderer, this.mc.getTextureManager(), var5, var2, var3); ++ itemRenderer.renderItemOverlayIntoGUI(this.mc.fontRenderer, this.mc.getTextureManager(), var5, par2, par3); + } + } + ++ /** ++ * The update tick for the ingame UI ++ */ + public void updateTick() { +- if(this.recordPlayingUpFor > 0) { ++ if (this.recordPlayingUpFor > 0) { + --this.recordPlayingUpFor; + } + + ++this.updateCounter; +- if(this.mc.thePlayer != null) { ++ ++ if (this.mc.thePlayer != null) { + ItemStack var1 = this.mc.thePlayer.inventory.getCurrentItem(); +- if(var1 == null) { ++ ++ if (var1 == null) { + this.remainingHighlightTicks = 0; +- } else if(this.highlightingItemStack != null && var1.itemID == this.highlightingItemStack.itemID && ItemStack.areItemStackTagsEqual(var1, this.highlightingItemStack) && (var1.isItemStackDamageable() || var1.getItemDamage() == this.highlightingItemStack.getItemDamage())) { +- if(this.remainingHighlightTicks > 0) { ++ } else if (this.highlightingItemStack != null && var1.itemID == this.highlightingItemStack.itemID && ItemStack.areItemStackTagsEqual(var1, this.highlightingItemStack) && (var1.isItemStackDamageable() || var1.getItemDamage() == this.highlightingItemStack.getItemDamage())) { ++ if (this.remainingHighlightTicks > 0) { + --this.remainingHighlightTicks; + } + } else { +@@ -756,19 +901,21 @@ + + this.highlightingItemStack = var1; + } +- +- } +- +- public void setRecordPlayingMessage(String var1) { +- this.func_110326_a("Now playing: " + var1, true); +- } +- +- public void func_110326_a(String var1, boolean var2) { +- this.j = var1; ++ } ++ ++ public void setRecordPlayingMessage(String par1Str) { ++ this.func_110326_a("Now playing: " + par1Str, true); ++ } ++ ++ public void func_110326_a(String par1Str, boolean par2) { ++ this.recordPlaying = par1Str; + this.recordPlayingUpFor = 60; +- this.recordIsPlaying = var2; ++ this.recordIsPlaying = par2; + } +- ++ ++ /** ++ * returns a pointer to the persistant Chat GUI, containing all previous chat messages and such ++ */ + public GuiNewChat getChatGUI() { + return this.persistantChatGUI; + } diff --git a/patches/net/minecraft/src/GuiIngameMenu.java.patch b/patches/net/minecraft/src/GuiIngameMenu.java.patch new file mode 100644 index 0000000..b8db284 --- /dev/null +++ b/patches/net/minecraft/src/GuiIngameMenu.java.patch @@ -0,0 +1,158 @@ +--- net/minecraft/src/GuiIngameMenu.java ++++ net/minecraft/src/GuiIngameMenu.java +@@ -1,71 +1,112 @@ + package net.minecraft.src; + +-import java.util.List; ++// Spout Start ++ ++import org.spoutcraft.client.chunkcache.HeightMapAgent; ++import org.spoutcraft.client.gui.settings.GuiSimpleOptions; ++// Spout End + + public class GuiIngameMenu extends GuiScreen { ++ ++ /** Also counts the number of updates, not certain as to why yet. */ + private int updateCounter2; ++ ++ /** Counts the number of screen updates. */ + private int updateCounter; ++ ++ // Spout Start ++ private boolean fromSingle; + ++ /** ++ * Adds the buttons (and other controls) to the screen in question. ++ */ + public void initGui() { + this.updateCounter2 = 0; +- this.i.clear(); ++ this.buttonList.clear(); + byte var1 = -16; + boolean var2 = true; +- this.i.add(new GuiButton(1, this.width / 2 - 100, this.height / 4 + 120 + var1, I18n.getString("menu.returnToMenu"))); +- if(!this.mc.isIntegratedServerRunning()) { +- ((GuiButton)this.i.get(0)).f = I18n.getString("menu.disconnect"); ++ this.buttonList.add(new GuiButton(1, this.width / 2 - 100, this.height / 4 + 120 + var1, I18n.getString("menu.returnToMenu"))); ++ ++ if (!this.mc.isIntegratedServerRunning()) { ++ ((GuiButton)this.buttonList.get(0)).displayString = I18n.getString("menu.disconnect"); + } + +- this.i.add(new GuiButton(4, this.width / 2 - 100, this.height / 4 + 24 + var1, I18n.getString("menu.returnToGame"))); +- this.i.add(new GuiButton(0, this.width / 2 - 100, this.height / 4 + 96 + var1, 98, 20, I18n.getString("menu.options"))); +- List var10000 = this.i; +- GuiButton var3 = new GuiButton(7, this.width / 2 + 2, this.height / 4 + 96 + var1, 98, 20, I18n.getString("menu.shareToLan")); +- var10000.add(var3); +- this.i.add(new GuiButton(5, this.width / 2 - 100, this.height / 4 + 48 + var1, 98, 20, I18n.getString("gui.achievements"))); +- this.i.add(new GuiButton(6, this.width / 2 + 2, this.height / 4 + 48 + var1, 98, 20, I18n.getString("gui.stats"))); ++ this.buttonList.add(new GuiButton(4, this.width / 2 - 100, this.height / 4 + 24 + var1, I18n.getString("menu.returnToGame"))); ++ this.buttonList.add(new GuiButton(0, this.width / 2 - 100, this.height / 4 + 96 + var1, 98, 20, I18n.getString("menu.options"))); ++ GuiButton var3; ++ this.buttonList.add(var3 = new GuiButton(7, this.width / 2 + 2, this.height / 4 + 96 + var1, 98, 20, I18n.getString("menu.shareToLan"))); ++ this.buttonList.add(new GuiButton(5, this.width / 2 - 100, this.height / 4 + 48 + var1, 98, 20, I18n.getString("gui.achievements"))); ++ this.buttonList.add(new GuiButton(6, this.width / 2 + 2, this.height / 4 + 48 + var1, 98, 20, I18n.getString("gui.stats"))); + var3.enabled = this.mc.isSingleplayer() && !this.mc.getIntegratedServer().getPublic(); + } + +- protected void actionPerformed(GuiButton var1) { +- switch(var1.id) { +- case 0: +- this.mc.displayGuiScreen(new GuiOptions(this, this.mc.gameSettings)); +- break; +- case 1: +- var1.enabled = false; +- this.mc.statFileWriter.readStat(StatList.leaveGameStat, 1); +- this.mc.theWorld.sendQuittingDisconnectingPacket(); +- this.mc.loadWorld((WorldClient)null); +- this.mc.displayGuiScreen(new GuiMainMenu()); +- case 2: +- case 3: +- default: +- break; +- case 4: +- this.mc.displayGuiScreen((GuiScreen)null); +- this.mc.setIngameFocus(); +- this.mc.sndManager.resumeAllSounds(); +- break; +- case 5: +- this.mc.displayGuiScreen(new GuiAchievements(this.mc.statFileWriter)); +- break; +- case 6: +- this.mc.displayGuiScreen(new GuiStats(this, this.mc.statFileWriter)); +- break; +- case 7: +- this.mc.displayGuiScreen(new GuiShareToLan(this)); ++ /** ++ * Fired when a control is clicked. This is the equivalent of ActionListener.actionPerformed(ActionEvent e). ++ */ ++ protected void actionPerformed(GuiButton par1GuiButton) { ++ switch (par1GuiButton.id) { ++ case 0: ++ // Spout Start ++ this.mc.displayGuiScreen(GuiSimpleOptions.constructOptionsScreen(this)); ++ // Spout End ++ break; ++ ++ case 1: ++ // Spout Start ++ if (this.mc.isIntegratedServerRunning()) { ++ fromSingle = true; ++ } ++ HeightMapAgent.save(); ++ // Spout End ++ par1GuiButton.enabled = false; ++ this.mc.statFileWriter.readStat(StatList.leaveGameStat, 1); ++ this.mc.theWorld.sendQuittingDisconnectingPacket(); ++ this.mc.loadWorld((WorldClient)null); ++ // Spout Start ++ if (fromSingle) { ++ this.mc.displayGuiScreen(new GuiSelectWorld(this)); ++ } else { ++ this.mc.displayGuiScreen(new org.spoutcraft.client.gui.server.GuiFavorites(this)); ++ } ++ // Spout End ++ case 2: ++ case 3: ++ default: ++ break; ++ ++ case 4: ++ this.mc.displayGuiScreen((GuiScreen)null); ++ this.mc.setIngameFocus(); ++ this.mc.sndManager.resumeAllSounds(); ++ break; ++ ++ case 5: ++ this.mc.displayGuiScreen(new GuiAchievements(this.mc.statFileWriter)); ++ break; ++ ++ case 6: ++ this.mc.displayGuiScreen(new GuiStats(this, this.mc.statFileWriter)); ++ break; ++ ++ case 7: ++ this.mc.displayGuiScreen(new GuiShareToLan(this)); + } +- + } + ++ /** ++ * Called from the main game loop to update the screen. ++ */ + public void updateScreen() { + super.updateScreen(); + ++this.updateCounter; + } + +- public void drawScreen(int var1, int var2, float var3) { ++ /** ++ * Draws the screen and all the components in it. ++ */ ++ public void drawScreen(int par1, int par2, float par3) { + this.drawDefaultBackground(); + this.drawCenteredString(this.fontRenderer, "Game menu", this.width / 2, 40, 16777215); +- super.drawScreen(var1, var2, var3); ++ super.drawScreen(par1, par2, par3); + } + } diff --git a/patches/net/minecraft/src/GuiInventory.java.patch b/patches/net/minecraft/src/GuiInventory.java.patch new file mode 100644 index 0000000..f43d73f --- /dev/null +++ b/patches/net/minecraft/src/GuiInventory.java.patch @@ -0,0 +1,159 @@ +--- net/minecraft/src/GuiInventory.java ++++ net/minecraft/src/GuiInventory.java +@@ -4,43 +4,65 @@ + import org.lwjgl.opengl.GL12; + + public class GuiInventory extends InventoryEffectRenderer { ++ ++ /** ++ * x size of the inventory window in pixels. Defined as float, passed as int ++ */ + private float xSize_lo; ++ ++ /** ++ * y size of the inventory window in pixels. Defined as float, passed as int. ++ */ + private float ySize_lo; + +- public GuiInventory(EntityPlayer var1) { +- super(var1.inventoryContainer); ++ public GuiInventory(EntityPlayer par1EntityPlayer) { ++ super(par1EntityPlayer.inventoryContainer); + this.allowUserInput = true; +- var1.addStat(AchievementList.openInventory, 1); ++ par1EntityPlayer.addStat(AchievementList.openInventory, 1); + } + ++ /** ++ * Called from the main game loop to update the screen. ++ */ + public void updateScreen() { +- if(this.mc.playerController.isInCreativeMode()) { ++ if (this.mc.playerController.isInCreativeMode()) { + this.mc.displayGuiScreen(new GuiContainerCreative(this.mc.thePlayer)); + } +- + } + ++ /** ++ * Adds the buttons (and other controls) to the screen in question. ++ */ + public void initGui() { +- this.i.clear(); +- if(this.mc.playerController.isInCreativeMode()) { ++ this.buttonList.clear(); ++ ++ if (this.mc.playerController.isInCreativeMode()) { + this.mc.displayGuiScreen(new GuiContainerCreative(this.mc.thePlayer)); + } else { + super.initGui(); + } +- + } + +- protected void drawGuiContainerForegroundLayer(int var1, int var2) { ++ /** ++ * Draw the foreground layer for the GuiContainer (everything in front of the items) ++ */ ++ protected void drawGuiContainerForegroundLayer(int par1, int par2) { + this.fontRenderer.drawString(I18n.getString("container.crafting"), 86, 16, 4210752); + } + +- public void drawScreen(int var1, int var2, float var3) { +- super.drawScreen(var1, var2, var3); +- this.xSize_lo = (float)var1; +- this.ySize_lo = (float)var2; ++ /** ++ * Draws the screen and all the components in it. ++ */ ++ public void drawScreen(int par1, int par2, float par3) { ++ super.drawScreen(par1, par2, par3); ++ this.xSize_lo = (float)par1; ++ this.ySize_lo = (float)par2; + } + +- protected void drawGuiContainerBackgroundLayer(float var1, int var2, int var3) { ++ /** ++ * Draw the background layer for the GuiContainer (everything behind the items) ++ */ ++ protected void drawGuiContainerBackgroundLayer(float par1, int par2, int par3) { + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + this.mc.getTextureManager().bindTexture(field_110408_a); + int var4 = this.guiLeft; +@@ -49,34 +71,34 @@ + func_110423_a(var4 + 51, var5 + 75, 30, (float)(var4 + 51) - this.xSize_lo, (float)(var5 + 75 - 50) - this.ySize_lo, this.mc.thePlayer); + } + +- public static void func_110423_a(int var0, int var1, int var2, float var3, float var4, EntityLivingBase var5) { ++ public static void func_110423_a(int par0, int par1, int par2, float par3, float par4, EntityLivingBase par5EntityLivingBase) { + GL11.glEnable(GL11.GL_COLOR_MATERIAL); + GL11.glPushMatrix(); +- GL11.glTranslatef((float)var0, (float)var1, 50.0F); +- GL11.glScalef((float)(-var2), (float)var2, (float)var2); ++ GL11.glTranslatef((float)par0, (float)par1, 50.0F); ++ GL11.glScalef((float)(-par2), (float)par2, (float)par2); + GL11.glRotatef(180.0F, 0.0F, 0.0F, 1.0F); +- float var6 = var5.renderYawOffset; +- float var7 = var5.rotationYaw; +- float var8 = var5.rotationPitch; +- float var9 = var5.prevRotationYawHead; +- float var10 = var5.rotationYawHead; ++ float var6 = par5EntityLivingBase.renderYawOffset; ++ float var7 = par5EntityLivingBase.rotationYaw; ++ float var8 = par5EntityLivingBase.rotationPitch; ++ float var9 = par5EntityLivingBase.prevRotationYawHead; ++ float var10 = par5EntityLivingBase.rotationYawHead; + GL11.glRotatef(135.0F, 0.0F, 1.0F, 0.0F); + RenderHelper.enableStandardItemLighting(); + GL11.glRotatef(-135.0F, 0.0F, 1.0F, 0.0F); +- GL11.glRotatef(-((float)Math.atan((double)(var4 / 40.0F))) * 20.0F, 1.0F, 0.0F, 0.0F); +- var5.renderYawOffset = (float)Math.atan((double)(var3 / 40.0F)) * 20.0F; +- var5.rotationYaw = (float)Math.atan((double)(var3 / 40.0F)) * 40.0F; +- var5.rotationPitch = -((float)Math.atan((double)(var4 / 40.0F))) * 20.0F; +- var5.rotationYawHead = var5.rotationYaw; +- var5.prevRotationYawHead = var5.rotationYaw; +- GL11.glTranslatef(0.0F, var5.yOffset, 0.0F); ++ GL11.glRotatef(-((float)Math.atan((double)(par4 / 40.0F))) * 20.0F, 1.0F, 0.0F, 0.0F); ++ par5EntityLivingBase.renderYawOffset = (float)Math.atan((double)(par3 / 40.0F)) * 20.0F; ++ par5EntityLivingBase.rotationYaw = (float)Math.atan((double)(par3 / 40.0F)) * 40.0F; ++ par5EntityLivingBase.rotationPitch = -((float)Math.atan((double)(par4 / 40.0F))) * 20.0F; ++ par5EntityLivingBase.rotationYawHead = par5EntityLivingBase.rotationYaw; ++ par5EntityLivingBase.prevRotationYawHead = par5EntityLivingBase.rotationYaw; ++ GL11.glTranslatef(0.0F, par5EntityLivingBase.yOffset, 0.0F); + RenderManager.instance.playerViewY = 180.0F; +- RenderManager.instance.renderEntityWithPosYaw(var5, 0.0D, 0.0D, 0.0D, 0.0F, 1.0F); +- var5.renderYawOffset = var6; +- var5.rotationYaw = var7; +- var5.rotationPitch = var8; +- var5.prevRotationYawHead = var9; +- var5.rotationYawHead = var10; ++ RenderManager.instance.renderEntityWithPosYaw(par5EntityLivingBase, 0.0D, 0.0D, 0.0D, 0.0F, 1.0F); ++ par5EntityLivingBase.renderYawOffset = var6; ++ par5EntityLivingBase.rotationYaw = var7; ++ par5EntityLivingBase.rotationPitch = var8; ++ par5EntityLivingBase.prevRotationYawHead = var9; ++ par5EntityLivingBase.rotationYawHead = var10; + GL11.glPopMatrix(); + RenderHelper.disableStandardItemLighting(); + GL11.glDisable(GL12.GL_RESCALE_NORMAL); +@@ -85,14 +107,16 @@ + OpenGlHelper.setActiveTexture(OpenGlHelper.defaultTexUnit); + } + +- protected void actionPerformed(GuiButton var1) { +- if(var1.id == 0) { ++ /** ++ * Fired when a control is clicked. This is the equivalent of ActionListener.actionPerformed(ActionEvent e). ++ */ ++ protected void actionPerformed(GuiButton par1GuiButton) { ++ if (par1GuiButton.id == 0) { + this.mc.displayGuiScreen(new GuiAchievements(this.mc.statFileWriter)); + } + +- if(var1.id == 1) { ++ if (par1GuiButton.id == 1) { + this.mc.displayGuiScreen(new GuiStats(this, this.mc.statFileWriter)); + } +- + } + } diff --git a/patches/net/minecraft/src/GuiLanguage.java.patch b/patches/net/minecraft/src/GuiLanguage.java.patch new file mode 100644 index 0000000..53d60eb --- /dev/null +++ b/patches/net/minecraft/src/GuiLanguage.java.patch @@ -0,0 +1,113 @@ +--- net/minecraft/src/GuiLanguage.java ++++ net/minecraft/src/GuiLanguage.java +@@ -1,55 +1,79 @@ + package net.minecraft.src; + + public class GuiLanguage extends GuiScreen { ++ ++ /** This GUI's parent GUI. */ + protected GuiScreen parentGui; ++ ++ /** This GUI's language list. */ + private GuiSlotLanguage languageList; ++ ++ /** For saving the user's language selection to disk. */ + private final GameSettings theGameSettings; + private final LanguageManager field_135014_d; ++ ++ /** This GUI's 'Done' button. */ + private GuiSmallButton doneButton; + +- public GuiLanguage(GuiScreen var1, GameSettings var2, LanguageManager var3) { +- this.parentGui = var1; +- this.theGameSettings = var2; +- this.field_135014_d = var3; ++ public GuiLanguage(GuiScreen par1GuiScreen, GameSettings par2GameSettings, LanguageManager par3LanguageManager) { ++ this.parentGui = par1GuiScreen; ++ this.theGameSettings = par2GameSettings; ++ this.field_135014_d = par3LanguageManager; + } + ++ /** ++ * Adds the buttons (and other controls) to the screen in question. ++ */ + public void initGui() { +- this.i.add(this.doneButton = new GuiSmallButton(6, this.width / 2 - 75, this.height - 38, I18n.getString("gui.done"))); ++ this.buttonList.add(this.doneButton = new GuiSmallButton(6, this.width / 2 - 75, this.height - 38, I18n.getString("gui.done"))); + this.languageList = new GuiSlotLanguage(this); + this.languageList.registerScrollButtons(7, 8); + } + +- protected void actionPerformed(GuiButton var1) { +- if(var1.enabled) { +- switch(var1.id) { +- case 5: +- break; +- case 6: +- this.mc.displayGuiScreen(this.parentGui); +- break; +- default: +- this.languageList.actionPerformed(var1); ++ /** ++ * Fired when a control is clicked. This is the equivalent of ActionListener.actionPerformed(ActionEvent e). ++ */ ++ protected void actionPerformed(GuiButton par1GuiButton) { ++ if (par1GuiButton.enabled) { ++ switch (par1GuiButton.id) { ++ case 5: ++ break; ++ ++ case 6: ++ this.mc.displayGuiScreen(this.parentGui); ++ break; ++ ++ default: ++ this.languageList.actionPerformed(par1GuiButton); + } +- + } + } + +- public void drawScreen(int var1, int var2, float var3) { +- this.languageList.drawScreen(var1, var2, var3); ++ /** ++ * Draws the screen and all the components in it. ++ */ ++ public void drawScreen(int par1, int par2, float par3) { ++ this.languageList.drawScreen(par1, par2, par3); + this.drawCenteredString(this.fontRenderer, I18n.getString("options.language"), this.width / 2, 16, 16777215); + this.drawCenteredString(this.fontRenderer, "(" + I18n.getString("options.languageWarning") + ")", this.width / 2, this.height - 56, 8421504); +- super.drawScreen(var1, var2, var3); +- } +- +- static LanguageManager func_135011_a(GuiLanguage var0) { +- return var0.field_135014_d; +- } +- +- static GameSettings getGameSettings(GuiLanguage var0) { +- return var0.theGameSettings; +- } +- +- static GuiSmallButton getDoneButton(GuiLanguage var0) { +- return var0.doneButton; ++ super.drawScreen(par1, par2, par3); ++ } ++ ++ static LanguageManager func_135011_a(GuiLanguage par0GuiLanguage) { ++ return par0GuiLanguage.field_135014_d; ++ } ++ ++ /** ++ * Gets the relevant instance of GameSettings. Synthetic method for use in GuiSlotLanguage ++ */ ++ static GameSettings getGameSettings(GuiLanguage par0GuiLanguage) { ++ return par0GuiLanguage.theGameSettings; ++ } ++ ++ /** ++ * Returns the private doneButton field. ++ */ ++ static GuiSmallButton getDoneButton(GuiLanguage par0GuiLanguage) { ++ return par0GuiLanguage.doneButton; + } + } diff --git a/patches/net/minecraft/src/GuiMainMenu.java.patch b/patches/net/minecraft/src/GuiMainMenu.java.patch new file mode 100644 index 0000000..e70a935 --- /dev/null +++ b/patches/net/minecraft/src/GuiMainMenu.java.patch @@ -0,0 +1,579 @@ +--- net/minecraft/src/GuiMainMenu.java ++++ net/minecraft/src/GuiMainMenu.java +@@ -13,22 +13,36 @@ + import org.lwjgl.util.glu.Project; + + public class GuiMainMenu extends GuiScreen { +- private static final Random b = new Random(); ++ ++ /** The RNG used by the Main Menu Screen. */ ++ private static final Random rand = new Random(); ++ ++ /** Counts the number of screen updates. */ + private float updateCounter; +- private String d = "missingno"; ++ ++ /** The splash message. */ ++ private String splashText = "missingno"; + private GuiButton buttonResetDemo; ++ ++ /** Timer used to rotate the panorama, increases every tick. */ + private int panoramaTimer; ++ ++ /** ++ * Texture allocated for the current viewport of the main menu's panorama background. ++ */ + private DynamicTexture viewportTexture; + private boolean field_96141_q = true; + private static boolean field_96140_r; + private static boolean field_96139_s; +- private final Object u = new Object(); +- private String v; +- private String w; ++ private final Object field_104025_t = new Object(); ++ private String field_92025_p; ++ private String field_104024_v; + private static final ResourceLocation splashTexts = new ResourceLocation("texts/splashes.txt"); + private static final ResourceLocation minecraftTitleTextures = new ResourceLocation("textures/gui/title/minecraft.png"); +- private static final ResourceLocation[] titlePanoramaPaths = new ResourceLocation[]{new ResourceLocation("textures/gui/title/background/panorama_0.png"), new ResourceLocation("textures/gui/title/background/panorama_1.png"), new ResourceLocation("textures/gui/title/background/panorama_2.png"), new ResourceLocation("textures/gui/title/background/panorama_3.png"), new ResourceLocation("textures/gui/title/background/panorama_4.png"), new ResourceLocation("textures/gui/title/background/panorama_5.png")}; +- public static final String a = "Please click " + EnumChatFormatting.UNDERLINE + "here" + EnumChatFormatting.RESET + " for more information."; ++ ++ /** An array of all the paths to the panorama pictures. */ ++ private static final ResourceLocation[] titlePanoramaPaths = new ResourceLocation[] {new ResourceLocation("textures/gui/title/background/panorama_0.png"), new ResourceLocation("textures/gui/title/background/panorama_1.png"), new ResourceLocation("textures/gui/title/background/panorama_2.png"), new ResourceLocation("textures/gui/title/background/panorama_3.png"), new ResourceLocation("textures/gui/title/background/panorama_4.png"), new ResourceLocation("textures/gui/title/background/panorama_5.png")}; ++ public static final String field_96138_a = "Please click " + EnumChatFormatting.UNDERLINE + "here" + EnumChatFormatting.RESET + " for more information."; + private int field_92024_r; + private int field_92023_s; + private int field_92022_t; +@@ -40,182 +54,202 @@ + + public GuiMainMenu() { + BufferedReader var1 = null; +- + String var3; ++ + try { + ArrayList var2 = new ArrayList(); + var1 = new BufferedReader(new InputStreamReader(Minecraft.getMinecraft().getResourceManager().getResource(splashTexts).getInputStream(), Charsets.UTF_8)); + +- while(true) { +- var3 = var1.readLine(); +- if(var3 == null) { +- do { +- this.d = (String)var2.get(b.nextInt(var2.size())); +- } while(this.d.hashCode() == 125780783); +- break; +- } +- ++ while ((var3 = var1.readLine()) != null) { + var3 = var3.trim(); +- if(!var3.isEmpty()) { ++ ++ if (!var3.isEmpty()) { + var2.add(var3); + } + } ++ ++ do { ++ this.splashText = (String)var2.get(rand.nextInt(var2.size())); ++ } while (this.splashText.hashCode() == 125780783); + } catch (IOException var12) { ++ ; + } finally { +- if(var1 != null) { ++ if (var1 != null) { + try { + var1.close(); + } catch (IOException var11) { ++ ; + } + } +- + } + +- this.updateCounter = b.nextFloat(); +- this.v = ""; ++ this.updateCounter = rand.nextFloat(); ++ this.field_92025_p = ""; + String var14 = System.getProperty("os_architecture"); + var3 = System.getProperty("java_version"); +- if("ppc".equalsIgnoreCase(var14)) { +- this.v = "" + EnumChatFormatting.BOLD + "Notice!" + EnumChatFormatting.RESET + " PowerPC compatibility will be dropped in Minecraft 1.6"; +- this.w = "http://tinyurl.com/javappc"; +- } else if(var3 != null && var3.startsWith("1.5")) { +- this.v = "" + EnumChatFormatting.BOLD + "Notice!" + EnumChatFormatting.RESET + " Java 1.5 compatibility will be dropped in Minecraft 1.6"; +- this.w = "http://tinyurl.com/javappc"; ++ ++ if ("ppc".equalsIgnoreCase(var14)) { ++ this.field_92025_p = "" + EnumChatFormatting.BOLD + "Notice!" + EnumChatFormatting.RESET + " PowerPC compatibility will be dropped in Minecraft 1.6"; ++ this.field_104024_v = "http://tinyurl.com/javappc"; ++ } else if (var3 != null && var3.startsWith("1.5")) { ++ this.field_92025_p = "" + EnumChatFormatting.BOLD + "Notice!" + EnumChatFormatting.RESET + " Java 1.5 compatibility will be dropped in Minecraft 1.6"; ++ this.field_104024_v = "http://tinyurl.com/javappc"; + } +- + } + ++ /** ++ * Called from the main game loop to update the screen. ++ */ + public void updateScreen() { + ++this.panoramaTimer; + } + ++ /** ++ * Returns true if this GUI should pause the game when it is displayed in single-player ++ */ + public boolean doesGuiPauseGame() { + return false; + } + +- protected void keyTyped(char var1, int var2) { +- } ++ /** ++ * Fired when a key is typed. This is the equivalent of KeyListener.keyTyped(KeyEvent e). ++ */ ++ protected void keyTyped(char par1, int par2) {} + ++ /** ++ * Adds the buttons (and other controls) to the screen in question. ++ */ + public void initGui() { + this.viewportTexture = new DynamicTexture(256, 256); + this.field_110351_G = this.mc.getTextureManager().getDynamicTextureLocation("background", this.viewportTexture); + Calendar var1 = Calendar.getInstance(); + var1.setTime(new Date()); +- if(var1.get(2) + 1 == 11 && var1.get(5) == 9) { +- this.d = "Happy birthday, ez!"; +- } else if(var1.get(2) + 1 == 6 && var1.get(5) == 1) { +- this.d = "Happy birthday, Notch!"; +- } else if(var1.get(2) + 1 == 12 && var1.get(5) == 24) { +- this.d = "Merry X-mas!"; +- } else if(var1.get(2) + 1 == 1 && var1.get(5) == 1) { +- this.d = "Happy new year!"; +- } else if(var1.get(2) + 1 == 10 && var1.get(5) == 31) { +- this.d = "OOoooOOOoooo! Spooky!"; ++ ++ if (var1.get(2) + 1 == 11 && var1.get(5) == 9) { ++ this.splashText = "Happy birthday, ez!"; ++ } else if (var1.get(2) + 1 == 6 && var1.get(5) == 1) { ++ this.splashText = "Happy birthday, Notch!"; ++ } else if (var1.get(2) + 1 == 12 && var1.get(5) == 24) { ++ this.splashText = "Merry X-mas!"; ++ } else if (var1.get(2) + 1 == 1 && var1.get(5) == 1) { ++ this.splashText = "Happy new year!"; ++ } else if (var1.get(2) + 1 == 10 && var1.get(5) == 31) { ++ this.splashText = "OOoooOOOoooo! Spooky!"; + } + + boolean var2 = true; + int var3 = this.height / 4 + 48; +- if(this.mc.isDemo()) { ++ ++ if (this.mc.isDemo()) { + this.addDemoButtons(var3, 24); + } else { + this.addSingleplayerMultiplayerButtons(var3, 24); + } + + this.func_130020_g(); +- this.i.add(new GuiButton(0, this.width / 2 - 100, var3 + 72 + 12, 98, 20, I18n.getString("menu.options"))); +- this.i.add(new GuiButton(4, this.width / 2 + 2, var3 + 72 + 12, 98, 20, I18n.getString("menu.quit"))); +- this.i.add(new GuiButtonLanguage(5, this.width / 2 - 124, var3 + 72 + 12)); +- Object var4 = this.u; +- synchronized(var4) { +- this.field_92023_s = this.fontRenderer.getStringWidth(this.v); +- this.field_92024_r = this.fontRenderer.getStringWidth(a); ++ this.buttonList.add(new GuiButton(0, this.width / 2 - 100, var3 + 72 + 12, 98, 20, I18n.getString("menu.options"))); ++ this.buttonList.add(new GuiButton(4, this.width / 2 + 2, var3 + 72 + 12, 98, 20, I18n.getString("menu.quit"))); ++ this.buttonList.add(new GuiButtonLanguage(5, this.width / 2 - 124, var3 + 72 + 12)); ++ Object var4 = this.field_104025_t; ++ ++ synchronized (this.field_104025_t) { ++ this.field_92023_s = this.fontRenderer.getStringWidth(this.field_92025_p); ++ this.field_92024_r = this.fontRenderer.getStringWidth(field_96138_a); + int var5 = Math.max(this.field_92023_s, this.field_92024_r); + this.field_92022_t = (this.width - var5) / 2; +- this.field_92021_u = ((GuiButton)this.i.get(0)).yPosition - 24; ++ this.field_92021_u = ((GuiButton)this.buttonList.get(0)).yPosition - 24; + this.field_92020_v = this.field_92022_t + var5; + this.field_92019_w = this.field_92021_u + 24; + } + } + + private void func_130020_g() { +- if(this.field_96141_q) { +- if(!field_96140_r) { ++ if (this.field_96141_q) { ++ if (!field_96140_r) { + field_96140_r = true; + (new RunnableTitleScreen(this)).start(); +- } else if(field_96139_s) { ++ } else if (field_96139_s) { + this.func_130022_h(); + } + } +- + } + + private void func_130022_h() { + this.minecraftRealmsButton.drawButton = true; + } + +- private void addSingleplayerMultiplayerButtons(int var1, int var2) { +- this.i.add(new GuiButton(1, this.width / 2 - 100, var1, I18n.getString("menu.singleplayer"))); +- this.i.add(new GuiButton(2, this.width / 2 - 100, var1 + var2 * 1, I18n.getString("menu.multiplayer"))); +- this.i.add(this.minecraftRealmsButton = new GuiButton(14, this.width / 2 - 100, var1 + var2 * 2, I18n.getString("menu.online"))); ++ /** ++ * Adds Singleplayer and Multiplayer buttons on Main Menu for players who have bought the game. ++ */ ++ private void addSingleplayerMultiplayerButtons(int par1, int par2) { ++ this.buttonList.add(new GuiButton(1, this.width / 2 - 100, par1, I18n.getString("menu.singleplayer"))); ++ this.buttonList.add(new GuiButton(2, this.width / 2 - 100, par1 + par2 * 1, I18n.getString("menu.multiplayer"))); ++ this.buttonList.add(this.minecraftRealmsButton = new GuiButton(14, this.width / 2 - 100, par1 + par2 * 2, I18n.getString("menu.online"))); + this.minecraftRealmsButton.drawButton = false; + } + +- private void addDemoButtons(int var1, int var2) { +- this.i.add(new GuiButton(11, this.width / 2 - 100, var1, I18n.getString("menu.playdemo"))); +- this.i.add(this.buttonResetDemo = new GuiButton(12, this.width / 2 - 100, var1 + var2 * 1, I18n.getString("menu.resetdemo"))); ++ /** ++ * Adds Demo buttons on Main Menu for players who are playing Demo. ++ */ ++ private void addDemoButtons(int par1, int par2) { ++ this.buttonList.add(new GuiButton(11, this.width / 2 - 100, par1, I18n.getString("menu.playdemo"))); ++ this.buttonList.add(this.buttonResetDemo = new GuiButton(12, this.width / 2 - 100, par1 + par2 * 1, I18n.getString("menu.resetdemo"))); + ISaveFormat var3 = this.mc.getSaveLoader(); + WorldInfo var4 = var3.getWorldInfo("Demo_World"); +- if(var4 == null) { ++ ++ if (var4 == null) { + this.buttonResetDemo.enabled = false; + } +- + } + +- protected void actionPerformed(GuiButton var1) { +- if(var1.id == 0) { ++ /** ++ * Fired when a control is clicked. This is the equivalent of ActionListener.actionPerformed(ActionEvent e). ++ */ ++ protected void actionPerformed(GuiButton par1GuiButton) { ++ if (par1GuiButton.id == 0) { + this.mc.displayGuiScreen(new GuiOptions(this, this.mc.gameSettings)); + } + +- if(var1.id == 5) { ++ if (par1GuiButton.id == 5) { + this.mc.displayGuiScreen(new GuiLanguage(this, this.mc.gameSettings, this.mc.getLanguageManager())); + } + +- if(var1.id == 1) { ++ if (par1GuiButton.id == 1) { + this.mc.displayGuiScreen(new GuiSelectWorld(this)); + } + +- if(var1.id == 2) { ++ if (par1GuiButton.id == 2) { + this.mc.displayGuiScreen(new GuiMultiplayer(this)); + } + +- if(var1.id == 14 && this.minecraftRealmsButton.drawButton) { ++ if (par1GuiButton.id == 14 && this.minecraftRealmsButton.drawButton) { + this.func_140005_i(); + } + +- if(var1.id == 4) { ++ if (par1GuiButton.id == 4) { + this.mc.shutdown(); + } + +- if(var1.id == 11) { ++ if (par1GuiButton.id == 11) { + this.mc.launchIntegratedServer("Demo_World", "Demo_World", DemoWorldServer.demoWorldSettings); + } + +- if(var1.id == 12) { ++ if (par1GuiButton.id == 12) { + ISaveFormat var2 = this.mc.getSaveLoader(); + WorldInfo var3 = var2.getWorldInfo("Demo_World"); +- if(var3 != null) { ++ ++ if (var3 != null) { + GuiYesNo var4 = GuiSelectWorld.getDeleteWorldScreen(this, var3.getWorldName(), 12); + this.mc.displayGuiScreen(var4); + } + } +- + } + + private void func_140005_i() { + McoClient var1 = new McoClient(this.mc.getSession()); + + try { +- if(var1.func_140054_c().booleanValue()) { ++ if (var1.func_140054_c().booleanValue()) { + this.mc.displayGuiScreen(new GuiScreenClientOutdated(this)); + } else { + this.mc.displayGuiScreen(new GuiScreenOnlineServers(this)); +@@ -225,21 +259,20 @@ + } catch (IOException var4) { + this.mc.getLogAgent().logSevere(var4.getLocalizedMessage()); + } +- + } + +- public void confirmClicked(boolean var1, int var2) { +- if(var1 && var2 == 12) { ++ public void confirmClicked(boolean par1, int par2) { ++ if (par1 && par2 == 12) { + ISaveFormat var6 = this.mc.getSaveLoader(); + var6.flushCache(); + var6.deleteWorldDirectory("Demo_World"); + this.mc.displayGuiScreen(this); +- } else if(var2 == 13) { +- if(var1) { ++ } else if (par2 == 13) { ++ if (par1) { + try { + Class var3 = Class.forName("java.awt.Desktop"); + Object var4 = var3.getMethod("getDesktop", new Class[0]).invoke((Object)null, new Object[0]); +- var3.getMethod("browse", new Class[]{URI.class}).invoke(var4, new Object[]{new URI(this.w)}); ++ var3.getMethod("browse", new Class[] {URI.class}).invoke(var4, new Object[] {new URI(this.field_104024_v)}); + } catch (Throwable var5) { + var5.printStackTrace(); + } +@@ -247,10 +280,12 @@ + + this.mc.displayGuiScreen(this); + } +- + } + +- private void drawPanorama(int var1, int var2, float var3) { ++ /** ++ * Draws the main menu panorama ++ */ ++ private void drawPanorama(int par1, int par2, float par3) { + Tessellator var4 = Tessellator.instance; + GL11.glMatrixMode(GL11.GL_PROJECTION); + GL11.glPushMatrix(); +@@ -268,34 +303,35 @@ + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + byte var5 = 8; + +- for(int var6 = 0; var6 < var5 * var5; ++var6) { ++ for (int var6 = 0; var6 < var5 * var5; ++var6) { + GL11.glPushMatrix(); + float var7 = ((float)(var6 % var5) / (float)var5 - 0.5F) / 64.0F; + float var8 = ((float)(var6 / var5) / (float)var5 - 0.5F) / 64.0F; + float var9 = 0.0F; + GL11.glTranslatef(var7, var8, var9); +- GL11.glRotatef(MathHelper.sin(((float)this.panoramaTimer + var3) / 400.0F) * 25.0F + 20.0F, 1.0F, 0.0F, 0.0F); +- GL11.glRotatef(-((float)this.panoramaTimer + var3) * 0.1F, 0.0F, 1.0F, 0.0F); ++ GL11.glRotatef(MathHelper.sin(((float)this.panoramaTimer + par3) / 400.0F) * 25.0F + 20.0F, 1.0F, 0.0F, 0.0F); ++ GL11.glRotatef(-((float)this.panoramaTimer + par3) * 0.1F, 0.0F, 1.0F, 0.0F); + +- for(int var10 = 0; var10 < 6; ++var10) { ++ for (int var10 = 0; var10 < 6; ++var10) { + GL11.glPushMatrix(); +- if(var10 == 1) { ++ ++ if (var10 == 1) { + GL11.glRotatef(90.0F, 0.0F, 1.0F, 0.0F); + } + +- if(var10 == 2) { ++ if (var10 == 2) { + GL11.glRotatef(180.0F, 0.0F, 1.0F, 0.0F); + } + +- if(var10 == 3) { ++ if (var10 == 3) { + GL11.glRotatef(-90.0F, 0.0F, 1.0F, 0.0F); + } + +- if(var10 == 4) { ++ if (var10 == 4) { + GL11.glRotatef(90.0F, 1.0F, 0.0F, 0.0F); + } + +- if(var10 == 5) { ++ if (var10 == 5) { + GL11.glRotatef(-90.0F, 1.0F, 0.0F, 0.0F); + } + +@@ -327,7 +363,10 @@ + GL11.glEnable(GL11.GL_DEPTH_TEST); + } + +- private void rotateAndBlurSkybox(float var1) { ++ /** ++ * Rotate and blurs the skybox view in the main menu ++ */ ++ private void rotateAndBlurSkybox(float par1) { + this.mc.getTextureManager().bindTexture(this.field_110351_G); + GL11.glCopyTexSubImage2D(GL11.GL_TEXTURE_2D, 0, 0, 0, 0, 0, 256, 256); + GL11.glEnable(GL11.GL_BLEND); +@@ -337,7 +376,7 @@ + var2.startDrawingQuads(); + byte var3 = 3; + +- for(int var4 = 0; var4 < var3; ++var4) { ++ for (int var4 = 0; var4 < var3; ++var4) { + var2.setColorRGBA_F(1.0F, 1.0F, 1.0F, 1.0F / (float)(var4 + 1)); + int var5 = this.width; + int var6 = this.height; +@@ -352,19 +391,22 @@ + GL11.glColorMask(true, true, true, true); + } + +- private void renderSkybox(int var1, int var2, float var3) { ++ /** ++ * Renders the skybox in the main menu ++ */ ++ private void renderSkybox(int par1, int par2, float par3) { + GL11.glViewport(0, 0, 256, 256); +- this.drawPanorama(var1, var2, var3); ++ this.drawPanorama(par1, par2, par3); + GL11.glDisable(GL11.GL_TEXTURE_2D); + GL11.glEnable(GL11.GL_TEXTURE_2D); +- this.rotateAndBlurSkybox(var3); +- this.rotateAndBlurSkybox(var3); +- this.rotateAndBlurSkybox(var3); +- this.rotateAndBlurSkybox(var3); +- this.rotateAndBlurSkybox(var3); +- this.rotateAndBlurSkybox(var3); +- this.rotateAndBlurSkybox(var3); +- this.rotateAndBlurSkybox(var3); ++ this.rotateAndBlurSkybox(par3); ++ this.rotateAndBlurSkybox(par3); ++ this.rotateAndBlurSkybox(par3); ++ this.rotateAndBlurSkybox(par3); ++ this.rotateAndBlurSkybox(par3); ++ this.rotateAndBlurSkybox(par3); ++ this.rotateAndBlurSkybox(par3); ++ this.rotateAndBlurSkybox(par3); + GL11.glViewport(0, 0, this.mc.displayWidth, this.mc.displayHeight); + Tessellator var4 = Tessellator.instance; + var4.startDrawingQuads(); +@@ -383,8 +425,11 @@ + var4.draw(); + } + +- public void drawScreen(int var1, int var2, float var3) { +- this.renderSkybox(var1, var2, var3); ++ /** ++ * Draws the screen and all the components in it. ++ */ ++ public void drawScreen(int par1, int par2, float par3) { ++ this.renderSkybox(par1, par2, par3); + Tessellator var4 = Tessellator.instance; + short var5 = 274; + int var6 = this.width / 2 - var5 / 2; +@@ -393,7 +438,8 @@ + this.drawGradientRect(0, 0, this.width, this.height, 0, Integer.MIN_VALUE); + this.mc.getTextureManager().bindTexture(minecraftTitleTextures); + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); +- if((double)this.updateCounter < 1.0E-4D) { ++ ++ if ((double)this.updateCounter < 1.0E-4D) { + this.drawTexturedModalRect(var6 + 0, var7 + 0, 0, 0, 99, 44); + this.drawTexturedModalRect(var6 + 99, var7 + 0, 129, 0, 27, 44); + this.drawTexturedModalRect(var6 + 99 + 26, var7 + 0, 126, 0, 3, 44); +@@ -409,58 +455,63 @@ + GL11.glTranslatef((float)(this.width / 2 + 90), 70.0F, 0.0F); + GL11.glRotatef(-20.0F, 0.0F, 0.0F, 1.0F); + float var8 = 1.8F - MathHelper.abs(MathHelper.sin((float)(Minecraft.getSystemTime() % 1000L) / 1000.0F * (float)Math.PI * 2.0F) * 0.1F); +- var8 = var8 * 100.0F / (float)(this.fontRenderer.getStringWidth(this.d) + 32); ++ var8 = var8 * 100.0F / (float)(this.fontRenderer.getStringWidth(this.splashText) + 32); + GL11.glScalef(var8, var8, var8); +- this.drawCenteredString(this.fontRenderer, this.d, 0, -8, 16776960); ++ this.drawCenteredString(this.fontRenderer, this.splashText, 0, -8, 16776960); + GL11.glPopMatrix(); + String var9 = "Minecraft 1.6.4"; +- if(this.mc.isDemo()) { ++ ++ if (this.mc.isDemo()) { + var9 = var9 + " Demo"; + } + + this.drawString(this.fontRenderer, var9, 2, this.height - 10, 16777215); + String var10 = "Copyright Mojang AB. Do not distribute!"; + this.drawString(this.fontRenderer, var10, this.width - this.fontRenderer.getStringWidth(var10) - 2, this.height - 10, 16777215); +- if(this.v != null && this.v.length() > 0) { ++ ++ if (this.field_92025_p != null && this.field_92025_p.length() > 0) { + drawRect(this.field_92022_t - 2, this.field_92021_u - 2, this.field_92020_v + 2, this.field_92019_w - 1, 1428160512); +- this.drawString(this.fontRenderer, this.v, this.field_92022_t, this.field_92021_u, 16777215); +- this.drawString(this.fontRenderer, a, (this.width - this.field_92024_r) / 2, ((GuiButton)this.i.get(0)).yPosition - 12, 16777215); ++ this.drawString(this.fontRenderer, this.field_92025_p, this.field_92022_t, this.field_92021_u, 16777215); ++ this.drawString(this.fontRenderer, field_96138_a, (this.width - this.field_92024_r) / 2, ((GuiButton)this.buttonList.get(0)).yPosition - 12, 16777215); + } + +- super.drawScreen(var1, var2, var3); ++ super.drawScreen(par1, par2, par3); + } + +- protected void mouseClicked(int var1, int var2, int var3) { +- super.mouseClicked(var1, var2, var3); +- Object var4 = this.u; +- synchronized(var4) { +- if(this.v.length() > 0 && var1 >= this.field_92022_t && var1 <= this.field_92020_v && var2 >= this.field_92021_u && var2 <= this.field_92019_w) { +- GuiConfirmOpenLink var5 = new GuiConfirmOpenLink(this, this.w, 13, true); ++ /** ++ * Called when the mouse is clicked. ++ */ ++ protected void mouseClicked(int par1, int par2, int par3) { ++ super.mouseClicked(par1, par2, par3); ++ Object var4 = this.field_104025_t; ++ ++ synchronized (this.field_104025_t) { ++ if (this.field_92025_p.length() > 0 && par1 >= this.field_92022_t && par1 <= this.field_92020_v && par2 >= this.field_92021_u && par2 <= this.field_92019_w) { ++ GuiConfirmOpenLink var5 = new GuiConfirmOpenLink(this, this.field_104024_v, 13, true); + var5.func_92026_h(); + this.mc.displayGuiScreen(var5); + } +- + } + } + +- static Minecraft func_110348_a(GuiMainMenu var0) { +- return var0.mc; +- } +- +- static void func_130021_b(GuiMainMenu var0) { +- var0.func_130022_h(); +- } +- +- static boolean func_110349_a(boolean var0) { +- field_96139_s = var0; +- return var0; +- } +- +- static Minecraft func_130018_c(GuiMainMenu var0) { +- return var0.mc; +- } +- +- static Minecraft func_130019_d(GuiMainMenu var0) { +- return var0.mc; ++ static Minecraft func_110348_a(GuiMainMenu par0GuiMainMenu) { ++ return par0GuiMainMenu.mc; ++ } ++ ++ static void func_130021_b(GuiMainMenu par0GuiMainMenu) { ++ par0GuiMainMenu.func_130022_h(); ++ } ++ ++ static boolean func_110349_a(boolean par0) { ++ field_96139_s = par0; ++ return par0; ++ } ++ ++ static Minecraft func_130018_c(GuiMainMenu par0GuiMainMenu) { ++ return par0GuiMainMenu.mc; ++ } ++ ++ static Minecraft func_130019_d(GuiMainMenu par0GuiMainMenu) { ++ return par0GuiMainMenu.mc; + } + } diff --git a/patches/net/minecraft/src/GuiMemoryErrorScreen.java.patch b/patches/net/minecraft/src/GuiMemoryErrorScreen.java.patch new file mode 100644 index 0000000..92a8eab --- /dev/null +++ b/patches/net/minecraft/src/GuiMemoryErrorScreen.java.patch @@ -0,0 +1,64 @@ +--- net/minecraft/src/GuiMemoryErrorScreen.java ++++ net/minecraft/src/GuiMemoryErrorScreen.java +@@ -1,25 +1,38 @@ + package net.minecraft.src; + + public class GuiMemoryErrorScreen extends GuiScreen { +- public void initGui() { +- this.i.clear(); +- this.i.add(new GuiSmallButton(0, this.width / 2 - 155, this.height / 4 + 120 + 12, I18n.getString("gui.toMenu"))); +- this.i.add(new GuiSmallButton(1, this.width / 2 - 155 + 160, this.height / 4 + 120 + 12, I18n.getString("menu.quit"))); ++ ++ /** ++ * Adds the buttons (and other controls) to the screen in question. ++ */ ++ public void initGui() { ++ this.buttonList.clear(); ++ this.buttonList.add(new GuiSmallButton(0, this.width / 2 - 155, this.height / 4 + 120 + 12, I18n.getString("gui.toMenu"))); ++ this.buttonList.add(new GuiSmallButton(1, this.width / 2 - 155 + 160, this.height / 4 + 120 + 12, I18n.getString("menu.quit"))); + } + +- protected void actionPerformed(GuiButton var1) { +- if(var1.id == 0) { +- this.mc.displayGuiScreen(new GuiMainMenu()); +- } else if(var1.id == 1) { ++ /** ++ * Fired when a control is clicked. This is the equivalent of ActionListener.actionPerformed(ActionEvent e). ++ */ ++ protected void actionPerformed(GuiButton par1GuiButton) { ++ if (par1GuiButton.id == 0) { ++ // Spout Start ++ this.mc.displayGuiScreen(new org.spoutcraft.client.gui.mainmenu.MainMenu()); ++ // Spout End ++ } else if (par1GuiButton.id == 1) { + this.mc.shutdown(); + } +- +- } +- +- protected void keyTyped(char var1, int var2) { +- } +- +- public void drawScreen(int var1, int var2, float var3) { ++ } ++ ++ /** ++ * Fired when a key is typed. This is the equivalent of KeyListener.keyTyped(KeyEvent e). ++ */ ++ protected void keyTyped(char par1, int par2) {} ++ ++ /** ++ * Draws the screen and all the components in it. ++ */ ++ public void drawScreen(int par1, int par2, float par3) { + this.drawDefaultBackground(); + this.drawCenteredString(this.fontRenderer, "Out of memory!", this.width / 2, this.height / 4 - 60 + 20, 16777215); + this.drawString(this.fontRenderer, "Minecraft has run out of memory.", this.width / 2 - 140, this.height / 4 - 60 + 60 + 0, 10526880); +@@ -31,6 +44,6 @@ + this.drawString(this.fontRenderer, "We\'ve tried to free up enough memory to let you go back to", this.width / 2 - 140, this.height / 4 - 60 + 60 + 81, 10526880); + this.drawString(this.fontRenderer, "the main menu and back to playing, but this may not have worked.", this.width / 2 - 140, this.height / 4 - 60 + 60 + 90, 10526880); + this.drawString(this.fontRenderer, "Please restart the game if you see this message again.", this.width / 2 - 140, this.height / 4 - 60 + 60 + 99, 10526880); +- super.drawScreen(var1, var2, var3); ++ super.drawScreen(par1, par2, par3); + } + } diff --git a/patches/net/minecraft/src/GuiMerchant.java.patch b/patches/net/minecraft/src/GuiMerchant.java.patch new file mode 100644 index 0000000..d4b40b4 --- /dev/null +++ b/patches/net/minecraft/src/GuiMerchant.java.patch @@ -0,0 +1,180 @@ +--- net/minecraft/src/GuiMerchant.java ++++ net/minecraft/src/GuiMerchant.java +@@ -7,54 +7,69 @@ + + public class GuiMerchant extends GuiContainer { + private static final ResourceLocation merchantGuiTextures = new ResourceLocation("textures/gui/container/villager.png"); ++ ++ /** Instance of IMerchant interface. */ + private IMerchant theIMerchant; + private GuiButtonMerchant nextRecipeButtonIndex; + private GuiButtonMerchant previousRecipeButtonIndex; + private int currentRecipeIndex; +- private String y; ++ private String field_94082_v; + +- public GuiMerchant(InventoryPlayer var1, IMerchant var2, World var3, String var4) { +- super(new ContainerMerchant(var1, var2, var3)); +- this.theIMerchant = var2; +- this.y = var4 != null && var4.length() >= 1 ? var4 : I18n.getString("entity.Villager.name"); ++ public GuiMerchant(InventoryPlayer par1InventoryPlayer, IMerchant par2IMerchant, World par3World, String par4Str) { ++ super(new ContainerMerchant(par1InventoryPlayer, par2IMerchant, par3World)); ++ this.theIMerchant = par2IMerchant; ++ this.field_94082_v = par4Str != null && par4Str.length() >= 1 ? par4Str : I18n.getString("entity.Villager.name"); + } + ++ /** ++ * Adds the buttons (and other controls) to the screen in question. ++ */ + public void initGui() { + super.initGui(); + int var1 = (this.width - this.xSize) / 2; + int var2 = (this.height - this.ySize) / 2; +- this.i.add(this.nextRecipeButtonIndex = new GuiButtonMerchant(1, var1 + 120 + 27, var2 + 24 - 1, true)); +- this.i.add(this.previousRecipeButtonIndex = new GuiButtonMerchant(2, var1 + 36 - 19, var2 + 24 - 1, false)); ++ this.buttonList.add(this.nextRecipeButtonIndex = new GuiButtonMerchant(1, var1 + 120 + 27, var2 + 24 - 1, true)); ++ this.buttonList.add(this.previousRecipeButtonIndex = new GuiButtonMerchant(2, var1 + 36 - 19, var2 + 24 - 1, false)); + this.nextRecipeButtonIndex.enabled = false; + this.previousRecipeButtonIndex.enabled = false; + } + +- protected void drawGuiContainerForegroundLayer(int var1, int var2) { +- this.fontRenderer.drawString(this.y, this.xSize / 2 - this.fontRenderer.getStringWidth(this.y) / 2, 6, 4210752); ++ /** ++ * Draw the foreground layer for the GuiContainer (everything in front of the items) ++ */ ++ protected void drawGuiContainerForegroundLayer(int par1, int par2) { ++ this.fontRenderer.drawString(this.field_94082_v, this.xSize / 2 - this.fontRenderer.getStringWidth(this.field_94082_v) / 2, 6, 4210752); + this.fontRenderer.drawString(I18n.getString("container.inventory"), 8, this.ySize - 96 + 2, 4210752); + } + ++ /** ++ * Called from the main game loop to update the screen. ++ */ + public void updateScreen() { + super.updateScreen(); + MerchantRecipeList var1 = this.theIMerchant.getRecipes(this.mc.thePlayer); +- if(var1 != null) { ++ ++ if (var1 != null) { + this.nextRecipeButtonIndex.enabled = this.currentRecipeIndex < var1.size() - 1; + this.previousRecipeButtonIndex.enabled = this.currentRecipeIndex > 0; + } +- + } + +- protected void actionPerformed(GuiButton var1) { ++ /** ++ * Fired when a control is clicked. This is the equivalent of ActionListener.actionPerformed(ActionEvent e). ++ */ ++ protected void actionPerformed(GuiButton par1GuiButton) { + boolean var2 = false; +- if(var1 == this.nextRecipeButtonIndex) { ++ ++ if (par1GuiButton == this.nextRecipeButtonIndex) { + ++this.currentRecipeIndex; + var2 = true; +- } else if(var1 == this.previousRecipeButtonIndex) { ++ } else if (par1GuiButton == this.previousRecipeButtonIndex) { + --this.currentRecipeIndex; + var2 = true; + } + +- if(var2) { ++ if (var2) { + ((ContainerMerchant)this.inventorySlots).setCurrentRecipeIndex(this.currentRecipeIndex); + ByteArrayOutputStream var3 = new ByteArrayOutputStream(); + DataOutputStream var4 = new DataOutputStream(var3); +@@ -66,20 +81,24 @@ + var6.printStackTrace(); + } + } +- + } + +- protected void drawGuiContainerBackgroundLayer(float var1, int var2, int var3) { ++ /** ++ * Draw the background layer for the GuiContainer (everything behind the items) ++ */ ++ protected void drawGuiContainerBackgroundLayer(float par1, int par2, int par3) { + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + this.mc.getTextureManager().bindTexture(merchantGuiTextures); + int var4 = (this.width - this.xSize) / 2; + int var5 = (this.height - this.ySize) / 2; + this.drawTexturedModalRect(var4, var5, 0, 0, this.xSize, this.ySize); + MerchantRecipeList var6 = this.theIMerchant.getRecipes(this.mc.thePlayer); +- if(var6 != null && !var6.isEmpty()) { ++ ++ if (var6 != null && !var6.isEmpty()) { + int var7 = this.currentRecipeIndex; + MerchantRecipe var8 = (MerchantRecipe)var6.get(var7); +- if(var8.func_82784_g()) { ++ ++ if (var8.func_82784_g()) { + this.mc.getTextureManager().bindTexture(merchantGuiTextures); + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + GL11.glDisable(GL11.GL_LIGHTING); +@@ -87,13 +106,16 @@ + this.drawTexturedModalRect(this.guiLeft + 83, this.guiTop + 51, 212, 0, 28, 21); + } + } +- + } + +- public void drawScreen(int var1, int var2, float var3) { +- super.drawScreen(var1, var2, var3); ++ /** ++ * Draws the screen and all the components in it. ++ */ ++ public void drawScreen(int par1, int par2, float par3) { ++ super.drawScreen(par1, par2, par3); + MerchantRecipeList var4 = this.theIMerchant.getRecipes(this.mc.thePlayer); +- if(var4 != null && !var4.isEmpty()) { ++ ++ if (var4 != null && !var4.isEmpty()) { + int var5 = (this.width - this.xSize) / 2; + int var6 = (this.height - this.ySize) / 2; + int var7 = this.currentRecipeIndex; +@@ -110,7 +132,8 @@ + itemRenderer.zLevel = 100.0F; + itemRenderer.renderItemAndEffectIntoGUI(this.fontRenderer, this.mc.getTextureManager(), var9, var5 + 36, var6 + 24); + itemRenderer.renderItemOverlayIntoGUI(this.fontRenderer, this.mc.getTextureManager(), var9, var5 + 36, var6 + 24); +- if(var10 != null) { ++ ++ if (var10 != null) { + itemRenderer.renderItemAndEffectIntoGUI(this.fontRenderer, this.mc.getTextureManager(), var10, var5 + 62, var6 + 24); + itemRenderer.renderItemOverlayIntoGUI(this.fontRenderer, this.mc.getTextureManager(), var10, var5 + 62, var6 + 24); + } +@@ -119,12 +142,13 @@ + itemRenderer.renderItemOverlayIntoGUI(this.fontRenderer, this.mc.getTextureManager(), var11, var5 + 120, var6 + 24); + itemRenderer.zLevel = 0.0F; + GL11.glDisable(GL11.GL_LIGHTING); +- if(this.isPointInRegion(36, 24, 16, 16, var1, var2)) { +- this.drawItemStackTooltip(var9, var1, var2); +- } else if(var10 != null && this.isPointInRegion(62, 24, 16, 16, var1, var2)) { +- this.drawItemStackTooltip(var10, var1, var2); +- } else if(this.isPointInRegion(120, 24, 16, 16, var1, var2)) { +- this.drawItemStackTooltip(var11, var1, var2); ++ ++ if (this.isPointInRegion(36, 24, 16, 16, par1, par2)) { ++ this.drawItemStackTooltip(var9, par1, par2); ++ } else if (var10 != null && this.isPointInRegion(62, 24, 16, 16, par1, par2)) { ++ this.drawItemStackTooltip(var10, par1, par2); ++ } else if (this.isPointInRegion(120, 24, 16, 16, par1, par2)) { ++ this.drawItemStackTooltip(var11, par1, par2); + } + + GL11.glPopMatrix(); +@@ -132,9 +156,11 @@ + GL11.glEnable(GL11.GL_DEPTH_TEST); + RenderHelper.enableStandardItemLighting(); + } +- + } + ++ /** ++ * Gets the Instance of IMerchant interface. ++ */ + public IMerchant getIMerchant() { + return this.theIMerchant; + } diff --git a/patches/net/minecraft/src/GuiMultiplayer.java.patch b/patches/net/minecraft/src/GuiMultiplayer.java.patch new file mode 100644 index 0000000..5f0079f --- /dev/null +++ b/patches/net/minecraft/src/GuiMultiplayer.java.patch @@ -0,0 +1,596 @@ +--- net/minecraft/src/GuiMultiplayer.java ++++ net/minecraft/src/GuiMultiplayer.java +@@ -10,35 +10,69 @@ + import org.lwjgl.input.Keyboard; + + public class GuiMultiplayer extends GuiScreen { ++ ++ /** Number of outstanding ThreadPollServers threads */ + private static int threadsPending; +- private static Object b = new Object(); ++ ++ /** Lock object for use with synchronized() */ ++ private static Object lock = new Object(); ++ ++ /** ++ * A reference to the screen object that created this. Used for navigating between screens. ++ */ + private GuiScreen parentScreen; ++ ++ /** Slot container for the server list */ + private GuiSlotServer serverSlotContainer; + private ServerList internetServerList; ++ ++ /** Index of the currently selected server */ + private int selectedServer = -1; + private GuiButton field_96289_p; ++ ++ /** The 'Join Server' button */ + private GuiButton buttonSelect; ++ ++ /** The 'Delete' button */ + private GuiButton buttonDelete; ++ ++ /** The 'Delete' button was clicked */ + private boolean deleteClicked; ++ ++ /** The 'Add server' button was clicked */ + private boolean addClicked; ++ ++ /** The 'Edit' button was clicked */ + private boolean editClicked; ++ ++ /** The 'Direct Connect' button was clicked */ + private boolean directClicked; +- private String x; ++ ++ /** This GUI's lag tooltip text or null if no lag icon is being hovered. */ ++ private String lagTooltip; ++ ++ /** Instance of ServerData. */ + private ServerData theServerData; + private LanServerList localNetworkServerList; + private ThreadLanServerFind localServerFindThread; ++ ++ /** How many ticks this Gui is already opened */ + private int ticksOpened; + private boolean field_74024_A; +- private List D = Collections.emptyList(); ++ private List listofLanServers = Collections.emptyList(); + +- public GuiMultiplayer(GuiScreen var1) { +- this.parentScreen = var1; ++ public GuiMultiplayer(GuiScreen par1GuiScreen) { ++ this.parentScreen = par1GuiScreen; + } + ++ /** ++ * Adds the buttons (and other controls) to the screen in question. ++ */ + public void initGui() { + Keyboard.enableRepeatEvents(true); +- this.i.clear(); +- if(!this.field_74024_A) { ++ this.buttonList.clear(); ++ ++ if (!this.field_74024_A) { + this.field_74024_A = true; + this.internetServerList = new ServerList(this.mc); + this.internetServerList.loadServerList(); +@@ -59,44 +93,57 @@ + this.initGuiControls(); + } + ++ /** ++ * Populate the GuiScreen controlList ++ */ + public void initGuiControls() { +- this.i.add(this.field_96289_p = new GuiButton(7, this.width / 2 - 154, this.height - 28, 70, 20, I18n.getString("selectServer.edit"))); +- this.i.add(this.buttonDelete = new GuiButton(2, this.width / 2 - 74, this.height - 28, 70, 20, I18n.getString("selectServer.delete"))); +- this.i.add(this.buttonSelect = new GuiButton(1, this.width / 2 - 154, this.height - 52, 100, 20, I18n.getString("selectServer.select"))); +- this.i.add(new GuiButton(4, this.width / 2 - 50, this.height - 52, 100, 20, I18n.getString("selectServer.direct"))); +- this.i.add(new GuiButton(3, this.width / 2 + 4 + 50, this.height - 52, 100, 20, I18n.getString("selectServer.add"))); +- this.i.add(new GuiButton(8, this.width / 2 + 4, this.height - 28, 70, 20, I18n.getString("selectServer.refresh"))); +- this.i.add(new GuiButton(0, this.width / 2 + 4 + 76, this.height - 28, 75, 20, I18n.getString("gui.cancel"))); ++ this.buttonList.add(this.field_96289_p = new GuiButton(7, this.width / 2 - 154, this.height - 28, 70, 20, I18n.getString("selectServer.edit"))); ++ this.buttonList.add(this.buttonDelete = new GuiButton(2, this.width / 2 - 74, this.height - 28, 70, 20, I18n.getString("selectServer.delete"))); ++ this.buttonList.add(this.buttonSelect = new GuiButton(1, this.width / 2 - 154, this.height - 52, 100, 20, I18n.getString("selectServer.select"))); ++ this.buttonList.add(new GuiButton(4, this.width / 2 - 50, this.height - 52, 100, 20, I18n.getString("selectServer.direct"))); ++ this.buttonList.add(new GuiButton(3, this.width / 2 + 4 + 50, this.height - 52, 100, 20, I18n.getString("selectServer.add"))); ++ this.buttonList.add(new GuiButton(8, this.width / 2 + 4, this.height - 28, 70, 20, I18n.getString("selectServer.refresh"))); ++ this.buttonList.add(new GuiButton(0, this.width / 2 + 4 + 76, this.height - 28, 75, 20, I18n.getString("gui.cancel"))); + boolean var1 = this.selectedServer >= 0 && this.selectedServer < this.serverSlotContainer.getSize(); + this.buttonSelect.enabled = var1; + this.field_96289_p.enabled = var1; + this.buttonDelete.enabled = var1; + } + ++ /** ++ * Called from the main game loop to update the screen. ++ */ + public void updateScreen() { + super.updateScreen(); + ++this.ticksOpened; +- if(this.localNetworkServerList.getWasUpdated()) { +- this.D = this.localNetworkServerList.getLanServers(); ++ ++ if (this.localNetworkServerList.getWasUpdated()) { ++ this.listofLanServers = this.localNetworkServerList.getLanServers(); + this.localNetworkServerList.setWasNotUpdated(); + } +- + } + ++ /** ++ * Called when the screen is unloaded. Used to disable keyboard repeat events ++ */ + public void onGuiClosed() { + Keyboard.enableRepeatEvents(false); +- if(this.localServerFindThread != null) { ++ ++ if (this.localServerFindThread != null) { + this.localServerFindThread.interrupt(); + this.localServerFindThread = null; + } +- + } + +- protected void actionPerformed(GuiButton var1) { +- if(var1.enabled) { +- if(var1.id == 2) { +- String var2 = this.internetServerList.getServerData(this.selectedServer).a; +- if(var2 != null) { ++ /** ++ * Fired when a control is clicked. This is the equivalent of ActionListener.actionPerformed(ActionEvent e). ++ */ ++ protected void actionPerformed(GuiButton par1GuiButton) { ++ if (par1GuiButton.enabled) { ++ if (par1GuiButton.id == 2) { ++ String var2 = this.internetServerList.getServerData(this.selectedServer).serverName; ++ ++ if (var2 != null) { + this.deleteClicked = true; + String var3 = I18n.getString("selectServer.deleteQuestion"); + String var4 = "\'" + var2 + "\' " + I18n.getString("selectServer.deleteWarning"); +@@ -105,134 +152,147 @@ + GuiYesNo var7 = new GuiYesNo(this, var3, var4, var5, var6, this.selectedServer); + this.mc.displayGuiScreen(var7); + } +- } else if(var1.id == 1) { ++ } else if (par1GuiButton.id == 1) { + this.joinServer(this.selectedServer); +- } else if(var1.id == 4) { ++ } else if (par1GuiButton.id == 4) { + this.directClicked = true; + this.mc.displayGuiScreen(new GuiScreenServerList(this, this.theServerData = new ServerData(I18n.getString("selectServer.defaultName"), ""))); +- } else if(var1.id == 3) { ++ } else if (par1GuiButton.id == 3) { + this.addClicked = true; + this.mc.displayGuiScreen(new GuiScreenAddServer(this, this.theServerData = new ServerData(I18n.getString("selectServer.defaultName"), ""))); +- } else if(var1.id == 7) { ++ } else if (par1GuiButton.id == 7) { + this.editClicked = true; + ServerData var8 = this.internetServerList.getServerData(this.selectedServer); +- this.theServerData = new ServerData(var8.a, var8.b); ++ this.theServerData = new ServerData(var8.serverName, var8.serverIP); + this.theServerData.setHideAddress(var8.isHidingAddress()); + this.mc.displayGuiScreen(new GuiScreenAddServer(this, this.theServerData)); +- } else if(var1.id == 0) { ++ } else if (par1GuiButton.id == 0) { + this.mc.displayGuiScreen(this.parentScreen); +- } else if(var1.id == 8) { ++ } else if (par1GuiButton.id == 8) { + this.mc.displayGuiScreen(new GuiMultiplayer(this.parentScreen)); + } else { +- this.serverSlotContainer.actionPerformed(var1); ++ this.serverSlotContainer.actionPerformed(par1GuiButton); + } +- + } + } + +- public void confirmClicked(boolean var1, int var2) { +- if(this.deleteClicked) { ++ public void confirmClicked(boolean par1, int par2) { ++ if (this.deleteClicked) { + this.deleteClicked = false; +- if(var1) { +- this.internetServerList.removeServerData(var2); ++ ++ if (par1) { ++ this.internetServerList.removeServerData(par2); + this.internetServerList.saveServerList(); + this.selectedServer = -1; + } + + this.mc.displayGuiScreen(this); +- } else if(this.directClicked) { ++ } else if (this.directClicked) { + this.directClicked = false; +- if(var1) { ++ ++ if (par1) { + this.connectToServer(this.theServerData); + } else { + this.mc.displayGuiScreen(this); + } +- } else if(this.addClicked) { ++ } else if (this.addClicked) { + this.addClicked = false; +- if(var1) { ++ ++ if (par1) { + this.internetServerList.addServerData(this.theServerData); + this.internetServerList.saveServerList(); + this.selectedServer = -1; + } + + this.mc.displayGuiScreen(this); +- } else if(this.editClicked) { ++ } else if (this.editClicked) { + this.editClicked = false; +- if(var1) { ++ ++ if (par1) { + ServerData var3 = this.internetServerList.getServerData(this.selectedServer); +- var3.a = this.theServerData.a; +- var3.b = this.theServerData.b; ++ var3.serverName = this.theServerData.serverName; ++ var3.serverIP = this.theServerData.serverIP; + var3.setHideAddress(this.theServerData.isHidingAddress()); + this.internetServerList.saveServerList(); + } + + this.mc.displayGuiScreen(this); + } +- + } + +- protected void keyTyped(char var1, int var2) { ++ /** ++ * Fired when a key is typed. This is the equivalent of KeyListener.keyTyped(KeyEvent e). ++ */ ++ protected void keyTyped(char par1, int par2) { + int var3 = this.selectedServer; +- if(var2 == 59) { ++ ++ if (par2 == 59) { + this.mc.gameSettings.hideServerAddress = !this.mc.gameSettings.hideServerAddress; + this.mc.gameSettings.saveOptions(); + } else { +- if(isShiftKeyDown() && var2 == 200) { +- if(var3 > 0 && var3 < this.internetServerList.countServers()) { ++ if (isShiftKeyDown() && par2 == 200) { ++ if (var3 > 0 && var3 < this.internetServerList.countServers()) { + this.internetServerList.swapServers(var3, var3 - 1); + --this.selectedServer; +- if(var3 < this.internetServerList.countServers() - 1) { ++ ++ if (var3 < this.internetServerList.countServers() - 1) { + this.serverSlotContainer.func_77208_b(-this.serverSlotContainer.slotHeight); + } + } +- } else if(isShiftKeyDown() && var2 == 208) { +- if(var3 >= 0 & var3 < this.internetServerList.countServers() - 1) { ++ } else if (isShiftKeyDown() && par2 == 208) { ++ if (var3 >= 0 & var3 < this.internetServerList.countServers() - 1) { + this.internetServerList.swapServers(var3, var3 + 1); + ++this.selectedServer; +- if(var3 > 0) { ++ ++ if (var3 > 0) { + this.serverSlotContainer.func_77208_b(this.serverSlotContainer.slotHeight); + } + } +- } else if(var2 != 28 && var2 != 156) { +- super.keyTyped(var1, var2); ++ } else if (par2 != 28 && par2 != 156) { ++ super.keyTyped(par1, par2); + } else { +- this.actionPerformed((GuiButton)this.i.get(2)); ++ this.actionPerformed((GuiButton)this.buttonList.get(2)); + } +- + } + } + +- public void drawScreen(int var1, int var2, float var3) { +- this.x = null; ++ /** ++ * Draws the screen and all the components in it. ++ */ ++ public void drawScreen(int par1, int par2, float par3) { ++ this.lagTooltip = null; + this.drawDefaultBackground(); +- this.serverSlotContainer.drawScreen(var1, var2, var3); ++ this.serverSlotContainer.drawScreen(par1, par2, par3); + this.drawCenteredString(this.fontRenderer, I18n.getString("multiplayer.title"), this.width / 2, 20, 16777215); +- super.drawScreen(var1, var2, var3); +- if(this.x != null) { +- this.func_74007_a(this.x, var1, var2); ++ super.drawScreen(par1, par2, par3); ++ ++ if (this.lagTooltip != null) { ++ this.func_74007_a(this.lagTooltip, par1, par2); + } +- + } + +- private void joinServer(int var1) { +- if(var1 < this.internetServerList.countServers()) { +- this.connectToServer(this.internetServerList.getServerData(var1)); ++ /** ++ * Join server by slot index ++ */ ++ private void joinServer(int par1) { ++ if (par1 < this.internetServerList.countServers()) { ++ this.connectToServer(this.internetServerList.getServerData(par1)); + } else { +- var1 -= this.internetServerList.countServers(); +- if(var1 < this.D.size()) { +- LanServer var2 = (LanServer)this.D.get(var1); ++ par1 -= this.internetServerList.countServers(); ++ ++ if (par1 < this.listofLanServers.size()) { ++ LanServer var2 = (LanServer)this.listofLanServers.get(par1); + this.connectToServer(new ServerData(var2.getServerMotd(), var2.getServerIpPort())); + } +- + } + } + +- private void connectToServer(ServerData var1) { +- this.mc.displayGuiScreen(new GuiConnecting(this, this.mc, var1)); ++ private void connectToServer(ServerData par1ServerData) { ++ this.mc.displayGuiScreen(new GuiConnecting(this, this.mc, par1ServerData)); + } + +- private static void func_74017_b(ServerData var0) throws IOException { +- ServerAddress var1 = ServerAddress.func_78860_a(var0.b); ++ private static void func_74017_b(ServerData par0ServerData) throws IOException { ++ ServerAddress var1 = ServerAddress.func_78860_a(par0ServerData.serverIP); + Socket var2 = null; + DataInputStream var3 = null; + DataOutputStream var4 = null; +@@ -248,15 +308,16 @@ + Packet254ServerPing var5 = new Packet254ServerPing(78, var1.getIP(), var1.getPort()); + var4.writeByte(var5.getPacketId()); + var5.writePacketData(var4); +- if(var3.read() != 255) { ++ ++ if (var3.read() != 255) { + throw new IOException("Bad message"); + } + + String var6 = Packet.readString(var3, 256); + char[] var7 = var6.toCharArray(); + +- for(int var8 = 0; var8 < var7.length; ++var8) { +- if(var7[var8] != 167 && var7[var8] != 0 && ChatAllowedCharacters.a.indexOf(var7[var8]) < 0) { ++ for (int var8 = 0; var8 < var7.length; ++var8) { ++ if (var7[var8] != 167 && var7[var8] != 0 && ChatAllowedCharacters.allowedCharacters.indexOf(var7[var8]) < 0) { + var7[var8] = 63; + } + } +@@ -265,24 +326,27 @@ + int var9; + int var10; + String[] var27; +- if(var6.startsWith("\u00a7") && var6.length() > 1) { ++ ++ if (var6.startsWith("\u00a7") && var6.length() > 1) { + var27 = var6.substring(1).split("\u0000"); +- if(MathHelper.parseIntWithDefault(var27[0], 0) == 1) { +- var0.d = var27[3]; +- var0.field_82821_f = MathHelper.parseIntWithDefault(var27[1], var0.field_82821_f); +- var0.g = var27[2]; ++ ++ if (MathHelper.parseIntWithDefault(var27[0], 0) == 1) { ++ par0ServerData.serverMOTD = var27[3]; ++ par0ServerData.field_82821_f = MathHelper.parseIntWithDefault(var27[1], par0ServerData.field_82821_f); ++ par0ServerData.gameVersion = var27[2]; + var9 = MathHelper.parseIntWithDefault(var27[4], 0); + var10 = MathHelper.parseIntWithDefault(var27[5], 0); +- if(var9 >= 0 && var10 >= 0) { +- var0.c = EnumChatFormatting.GRAY + "" + var9 + "" + EnumChatFormatting.DARK_GRAY + "/" + EnumChatFormatting.GRAY + var10; ++ ++ if (var9 >= 0 && var10 >= 0) { ++ par0ServerData.populationInfo = EnumChatFormatting.GRAY + "" + var9 + "" + EnumChatFormatting.DARK_GRAY + "/" + EnumChatFormatting.GRAY + var10; + } else { +- var0.c = "" + EnumChatFormatting.DARK_GRAY + "???"; ++ par0ServerData.populationInfo = "" + EnumChatFormatting.DARK_GRAY + "???"; + } + } else { +- var0.g = "???"; +- var0.d = "" + EnumChatFormatting.DARK_GRAY + "???"; +- var0.field_82821_f = 79; +- var0.c = "" + EnumChatFormatting.DARK_GRAY + "???"; ++ par0ServerData.gameVersion = "???"; ++ par0ServerData.serverMOTD = "" + EnumChatFormatting.DARK_GRAY + "???"; ++ par0ServerData.field_82821_f = 79; ++ par0ServerData.populationInfo = "" + EnumChatFormatting.DARK_GRAY + "???"; + } + } else { + var27 = var6.split("\u00a7"); +@@ -294,92 +358,107 @@ + var9 = Integer.parseInt(var27[1]); + var10 = Integer.parseInt(var27[2]); + } catch (Exception var25) { ++ ; + } + +- var0.d = EnumChatFormatting.GRAY + var6; +- if(var9 >= 0 && var10 > 0) { +- var0.c = EnumChatFormatting.GRAY + "" + var9 + "" + EnumChatFormatting.DARK_GRAY + "/" + EnumChatFormatting.GRAY + var10; ++ par0ServerData.serverMOTD = EnumChatFormatting.GRAY + var6; ++ ++ if (var9 >= 0 && var10 > 0) { ++ par0ServerData.populationInfo = EnumChatFormatting.GRAY + "" + var9 + "" + EnumChatFormatting.DARK_GRAY + "/" + EnumChatFormatting.GRAY + var10; + } else { +- var0.c = "" + EnumChatFormatting.DARK_GRAY + "???"; ++ par0ServerData.populationInfo = "" + EnumChatFormatting.DARK_GRAY + "???"; + } + +- var0.g = "1.3"; +- var0.field_82821_f = 77; ++ par0ServerData.gameVersion = "1.3"; ++ par0ServerData.field_82821_f = 77; + } + } finally { + try { +- if(var3 != null) { ++ if (var3 != null) { + var3.close(); + } + } catch (Throwable var24) { ++ ; + } + + try { +- if(var4 != null) { ++ if (var4 != null) { + var4.close(); + } + } catch (Throwable var23) { ++ ; + } + + try { +- if(var2 != null) { ++ if (var2 != null) { + var2.close(); + } + } catch (Throwable var22) { ++ ; + } +- + } +- + } + +- protected void func_74007_a(String var1, int var2, int var3) { +- if(var1 != null) { +- int var4 = var2 + 12; +- int var5 = var3 - 12; +- int var6 = this.fontRenderer.getStringWidth(var1); ++ protected void func_74007_a(String par1Str, int par2, int par3) { ++ if (par1Str != null) { ++ int var4 = par2 + 12; ++ int var5 = par3 - 12; ++ int var6 = this.fontRenderer.getStringWidth(par1Str); + this.drawGradientRect(var4 - 3, var5 - 3, var4 + var6 + 3, var5 + 8 + 3, -1073741824, -1073741824); +- this.fontRenderer.drawStringWithShadow(var1, var4, var5, -1); ++ this.fontRenderer.drawStringWithShadow(par1Str, var4, var5, -1); + } + } + +- static ServerList getInternetServerList(GuiMultiplayer var0) { +- return var0.internetServerList; +- } +- +- static List getListOfLanServers(GuiMultiplayer var0) { +- return var0.D; +- } +- +- static int getSelectedServer(GuiMultiplayer var0) { +- return var0.selectedServer; +- } +- +- static int getAndSetSelectedServer(GuiMultiplayer var0, int var1) { +- return var0.selectedServer = var1; +- } +- +- static GuiButton getButtonSelect(GuiMultiplayer var0) { +- return var0.buttonSelect; +- } +- +- static GuiButton getButtonEdit(GuiMultiplayer var0) { +- return var0.field_96289_p; +- } +- +- static GuiButton getButtonDelete(GuiMultiplayer var0) { +- return var0.buttonDelete; +- } +- +- static void func_74008_b(GuiMultiplayer var0, int var1) { +- var0.joinServer(var1); +- } +- +- static int getTicksOpened(GuiMultiplayer var0) { +- return var0.ticksOpened; +- } +- ++ static ServerList getInternetServerList(GuiMultiplayer par0GuiMultiplayer) { ++ return par0GuiMultiplayer.internetServerList; ++ } ++ ++ static List getListOfLanServers(GuiMultiplayer par0GuiMultiplayer) { ++ return par0GuiMultiplayer.listofLanServers; ++ } ++ ++ static int getSelectedServer(GuiMultiplayer par0GuiMultiplayer) { ++ return par0GuiMultiplayer.selectedServer; ++ } ++ ++ static int getAndSetSelectedServer(GuiMultiplayer par0GuiMultiplayer, int par1) { ++ return par0GuiMultiplayer.selectedServer = par1; ++ } ++ ++ /** ++ * Return buttonSelect GuiButton ++ */ ++ static GuiButton getButtonSelect(GuiMultiplayer par0GuiMultiplayer) { ++ return par0GuiMultiplayer.buttonSelect; ++ } ++ ++ /** ++ * Return buttonEdit GuiButton ++ */ ++ static GuiButton getButtonEdit(GuiMultiplayer par0GuiMultiplayer) { ++ return par0GuiMultiplayer.field_96289_p; ++ } ++ ++ /** ++ * Return buttonDelete GuiButton ++ */ ++ static GuiButton getButtonDelete(GuiMultiplayer par0GuiMultiplayer) { ++ return par0GuiMultiplayer.buttonDelete; ++ } ++ ++ static void func_74008_b(GuiMultiplayer par0GuiMultiplayer, int par1) { ++ par0GuiMultiplayer.joinServer(par1); ++ } ++ ++ static int getTicksOpened(GuiMultiplayer par0GuiMultiplayer) { ++ return par0GuiMultiplayer.ticksOpened; ++ } ++ ++ /** ++ * Returns the lock object for use with synchronized() ++ */ + static Object getLock() { +- return b; ++ return lock; + } + + static int getThreadsPending() { +@@ -390,15 +469,15 @@ + return threadsPending++; + } + +- static void func_82291_a(ServerData var0) throws IOException { +- func_74017_b(var0); ++ static void func_82291_a(ServerData par0ServerData) throws IOException { ++ func_74017_b(par0ServerData); + } + + static int decreaseThreadsPending() { + return threadsPending--; + } + +- static String getAndSetLagTooltip(GuiMultiplayer var0, String var1) { +- return var0.x = var1; ++ static String getAndSetLagTooltip(GuiMultiplayer par0GuiMultiplayer, String par1Str) { ++ return par0GuiMultiplayer.lagTooltip = par1Str; + } + } diff --git a/patches/net/minecraft/src/GuiNewChat.java.patch b/patches/net/minecraft/src/GuiNewChat.java.patch new file mode 100644 index 0000000..0f97c73 --- /dev/null +++ b/patches/net/minecraft/src/GuiNewChat.java.patch @@ -0,0 +1,411 @@ +--- net/minecraft/src/GuiNewChat.java ++++ net/minecraft/src/GuiNewChat.java +@@ -3,29 +3,37 @@ + import java.util.ArrayList; + import java.util.Iterator; + import java.util.List; ++ + import org.lwjgl.opengl.GL11; + + public class GuiNewChat extends Gui { ++ ++ /** The Minecraft instance. */ + private final Minecraft mc; +- private final List b = new ArrayList(); +- private final List c = new ArrayList(); +- private final List d = new ArrayList(); ++ ++ /** A list of messages previously sent through the chat GUI */ ++ private final List sentMessages = new ArrayList(); ++ ++ /** Chat lines to be displayed in the chat box */ ++ private final List chatLines = new ArrayList(); ++ private final List field_96134_d = new ArrayList(); + private int field_73768_d; + private boolean field_73769_e; + +- public GuiNewChat(Minecraft var1) { +- this.mc = var1; ++ public GuiNewChat(Minecraft par1Minecraft) { ++ this.mc = par1Minecraft; + } + +- public void drawChat(int var1) { +- if(this.mc.gameSettings.chatVisibility != 2) { ++ public void drawChat(int par1) { ++ if (this.mc.gameSettings.chatVisibility != 2) { + int var2 = this.func_96127_i(); + boolean var3 = false; + int var4 = 0; +- int var5 = this.d.size(); ++ int var5 = this.field_96134_d.size(); + float var6 = this.mc.gameSettings.chatOpacity * 0.9F + 0.1F; +- if(var5 > 0) { +- if(this.getChatOpen()) { ++ ++ if (var5 > 0) { ++ if (this.getChatOpen()) { + var3 = true; + } + +@@ -34,41 +42,47 @@ + GL11.glPushMatrix(); + GL11.glTranslatef(2.0F, 20.0F, 0.0F); + GL11.glScalef(var7, var7, 1.0F); +- + int var9; + int var11; + int var14; +- for(var9 = 0; var9 + this.field_73768_d < this.d.size() && var9 < var2; ++var9) { +- ChatLine var10 = (ChatLine)this.d.get(var9 + this.field_73768_d); +- if(var10 != null) { +- var11 = var1 - var10.getUpdatedCounter(); +- if(var11 < 200 || var3) { ++ ++ for (var9 = 0; var9 + this.field_73768_d < this.field_96134_d.size() && var9 < var2; ++var9) { ++ ChatLine var10 = (ChatLine)this.field_96134_d.get(var9 + this.field_73768_d); ++ ++ if (var10 != null) { ++ var11 = par1 - var10.getUpdatedCounter(); ++ ++ if (var11 < 200 || var3) { + double var12 = (double)var11 / 200.0D; + var12 = 1.0D - var12; + var12 *= 10.0D; +- if(var12 < 0.0D) { ++ ++ if (var12 < 0.0D) { + var12 = 0.0D; + } + +- if(var12 > 1.0D) { ++ if (var12 > 1.0D) { + var12 = 1.0D; + } + + var12 *= var12; + var14 = (int)(255.0D * var12); +- if(var3) { ++ ++ if (var3) { + var14 = 255; + } + + var14 = (int)((float)var14 * var6); + ++var4; +- if(var14 > 3) { ++ ++ if (var14 > 3) { + byte var15 = 0; + int var16 = -var9 * 9; + drawRect(var15, var16 - 9, var15 + var8 + 4, var16, var14 / 2 << 24); + GL11.glEnable(GL11.GL_BLEND); + String var17 = var10.getChatLineString(); +- if(!this.mc.gameSettings.chatColours) { ++ ++ if (!this.mc.gameSettings.chatColours) { + var17 = StringUtils.stripControlCodes(var17); + } + +@@ -78,18 +92,19 @@ + } + } + +- if(var3) { ++ if (var3) { + var9 = this.mc.fontRenderer.FONT_HEIGHT; + GL11.glTranslatef(-3.0F, 0.0F, 0.0F); + int var18 = var5 * var9 + var5; + var11 = var4 * var9 + var4; +- int var19 = this.field_73768_d * var11 / var5; ++ int var20 = this.field_73768_d * var11 / var5; + int var13 = var11 * var11 / var18; +- if(var18 != var11) { +- var14 = var19 > 0 ? 170 : 96; +- int var20 = this.field_73769_e ? 13382451 : 3355562; +- drawRect(0, -var19, 2, -var19 - var13, var20 + (var14 << 24)); +- drawRect(2, -var19, 1, -var19 - var13, 13421772 + (var14 << 24)); ++ ++ if (var18 != var11) { ++ var14 = var20 > 0 ? 170 : 96; ++ int var19 = this.field_73769_e ? 13382451 : 3355562; ++ drawRect(0, -var20, 2, -var20 - var13, var19 + (var14 << 24)); ++ drawRect(2, -var20, 1, -var20 - var13, 13421772 + (var14 << 24)); + } + } + +@@ -98,116 +113,140 @@ + } + } + ++ /** ++ * Clears the chat. ++ */ + public void clearChatMessages() { +- this.d.clear(); +- this.c.clear(); +- this.b.clear(); +- } +- +- public void printChatMessage(String var1) { +- this.printChatMessageWithOptionalDeletion(var1, 0); +- } +- +- public void printChatMessageWithOptionalDeletion(String var1, int var2) { +- this.func_96129_a(var1, var2, this.mc.ingameGUI.getUpdateCounter(), false); +- this.mc.getLogAgent().logInfo("[CHAT] " + EnumChatFormatting.func_110646_a(var1)); +- } +- +- private void func_96129_a(String var1, int var2, int var3, boolean var4) { ++ this.field_96134_d.clear(); ++ this.chatLines.clear(); ++ this.sentMessages.clear(); ++ } ++ ++ /** ++ * takes a String and prints it to chat ++ */ ++ public void printChatMessage(String par1Str) { ++ this.printChatMessageWithOptionalDeletion(par1Str, 0); ++ } ++ ++ /** ++ * prints the String to Chat. If the ID is not 0, deletes an existing Chat Line of that ID from the GUI ++ */ ++ public void printChatMessageWithOptionalDeletion(String par1Str, int par2) { ++ this.func_96129_a(par1Str, par2, this.mc.ingameGUI.getUpdateCounter(), false); ++ // Spout Start ++ //this.mc.getLogAgent().logInfo("[CHAT] " + EnumChatFormatting.func_110646_a(par1Str)); ++ // Spout End ++ } ++ ++ private void func_96129_a(String par1Str, int par2, int par3, boolean par4) { + boolean var5 = this.getChatOpen(); + boolean var6 = true; +- if(var2 != 0) { +- this.deleteChatLine(var2); ++ ++ if (par2 != 0) { ++ this.deleteChatLine(par2); + } + +- Iterator var7 = this.mc.fontRenderer.listFormattedStringToWidth(var1, MathHelper.floor_float((float)this.func_96126_f() / this.func_96131_h())).iterator(); ++ Iterator var7 = this.mc.fontRenderer.listFormattedStringToWidth(par1Str, MathHelper.floor_float((float)this.func_96126_f() / this.func_96131_h())).iterator(); + +- while(var7.hasNext()) { ++ while (var7.hasNext()) { + String var8 = (String)var7.next(); +- if(var5 && this.field_73768_d > 0) { ++ ++ if (var5 && this.field_73768_d > 0) { + this.field_73769_e = true; + this.scroll(1); + } + +- if(!var6) { ++ if (!var6) { + var8 = " " + var8; + } + + var6 = false; +- this.d.add(0, new ChatLine(var3, var8, var2)); +- } +- +- while(this.d.size() > 100) { +- this.d.remove(this.d.size() - 1); +- } +- +- if(!var4) { +- this.c.add(0, new ChatLine(var3, var1.trim(), var2)); +- +- while(this.c.size() > 100) { +- this.c.remove(this.c.size() - 1); ++ this.field_96134_d.add(0, new ChatLine(par3, var8, par2)); ++ } ++ ++ while (this.field_96134_d.size() > 100) { ++ this.field_96134_d.remove(this.field_96134_d.size() - 1); ++ } ++ ++ if (!par4) { ++ this.chatLines.add(0, new ChatLine(par3, par1Str.trim(), par2)); ++ ++ while (this.chatLines.size() > 100) { ++ this.chatLines.remove(this.chatLines.size() - 1); + } + } +- + } + + public void func_96132_b() { +- this.d.clear(); ++ this.field_96134_d.clear(); + this.resetScroll(); + +- for(int var1 = this.c.size() - 1; var1 >= 0; --var1) { +- ChatLine var2 = (ChatLine)this.c.get(var1); ++ for (int var1 = this.chatLines.size() - 1; var1 >= 0; --var1) { ++ ChatLine var2 = (ChatLine)this.chatLines.get(var1); + this.func_96129_a(var2.getChatLineString(), var2.getChatLineID(), var2.getUpdatedCounter(), true); + } +- + } + ++ /** ++ * Gets the list of messages previously sent through the chat GUI ++ */ + public List getSentMessages() { +- return this.b; ++ return this.sentMessages; + } + +- public void addToSentMessages(String var1) { +- if(this.b.isEmpty() || !((String)this.b.get(this.b.size() - 1)).equals(var1)) { +- this.b.add(var1); ++ /** ++ * Adds this string to the list of sent messages, for recall using the up/down arrow keys ++ */ ++ public void addToSentMessages(String par1Str) { ++ if (this.sentMessages.isEmpty() || !((String)this.sentMessages.get(this.sentMessages.size() - 1)).equals(par1Str)) { ++ this.sentMessages.add(par1Str); + } +- + } + ++ /** ++ * Resets the chat scroll (executed when the GUI is closed) ++ */ + public void resetScroll() { + this.field_73768_d = 0; + this.field_73769_e = false; + } + +- public void scroll(int var1) { +- this.field_73768_d += var1; +- int var2 = this.d.size(); +- if(this.field_73768_d > var2 - this.func_96127_i()) { ++ /** ++ * Scrolls the chat by the given number of lines. ++ */ ++ public void scroll(int par1) { ++ this.field_73768_d += par1; ++ int var2 = this.field_96134_d.size(); ++ ++ if (this.field_73768_d > var2 - this.func_96127_i()) { + this.field_73768_d = var2 - this.func_96127_i(); + } + +- if(this.field_73768_d <= 0) { ++ if (this.field_73768_d <= 0) { + this.field_73768_d = 0; + this.field_73769_e = false; + } +- + } + +- public ChatClickData func_73766_a(int var1, int var2) { +- if(!this.getChatOpen()) { ++ public ChatClickData func_73766_a(int par1, int par2) { ++ if (!this.getChatOpen()) { + return null; + } else { + ScaledResolution var3 = new ScaledResolution(this.mc.gameSettings, this.mc.displayWidth, this.mc.displayHeight); + int var4 = var3.getScaleFactor(); + float var5 = this.func_96131_h(); +- int var6 = var1 / var4 - 3; +- int var7 = var2 / var4 - 25; ++ int var6 = par1 / var4 - 3; ++ int var7 = par2 / var4 - 25; + var6 = MathHelper.floor_float((float)var6 / var5); + var7 = MathHelper.floor_float((float)var7 / var5); +- if(var6 >= 0 && var7 >= 0) { +- int var8 = Math.min(this.func_96127_i(), this.d.size()); +- if(var6 <= MathHelper.floor_float((float)this.func_96126_f() / this.func_96131_h()) && var7 < this.mc.fontRenderer.FONT_HEIGHT * var8 + var8) { ++ ++ if (var6 >= 0 && var7 >= 0) { ++ int var8 = Math.min(this.func_96127_i(), this.field_96134_d.size()); ++ ++ if (var6 <= MathHelper.floor_float((float)this.func_96126_f() / this.func_96131_h()) && var7 < this.mc.fontRenderer.FONT_HEIGHT * var8 + var8) { + int var9 = var7 / (this.mc.fontRenderer.FONT_HEIGHT + 1) + this.field_73768_d; +- return new ChatClickData(this.mc.fontRenderer, (ChatLine)this.d.get(var9), var6, var7 - (var9 - this.field_73768_d) * this.mc.fontRenderer.FONT_HEIGHT + var9); ++ return new ChatClickData(this.mc.fontRenderer, (ChatLine)this.field_96134_d.get(var9), var6, var7 - (var9 - this.field_73768_d) * this.mc.fontRenderer.FONT_HEIGHT + var9); + } else { + return null; + } +@@ -217,36 +256,45 @@ + } + } + +- public void addTranslatedMessage(String var1, Object... var2) { +- this.printChatMessage(I18n.getStringParams(var1, var2)); ++ /** ++ * Adds a message to the chat after translating to the client's locale. ++ */ ++ public void addTranslatedMessage(String par1Str, Object ... par2ArrayOfObj) { ++ this.printChatMessage(I18n.getStringParams(par1Str, par2ArrayOfObj)); + } + ++ /** ++ * @return {@code true} if the chat GUI is open ++ */ + public boolean getChatOpen() { + return this.mc.currentScreen instanceof GuiChat; + } + +- public void deleteChatLine(int var1) { +- Iterator var2 = this.d.iterator(); +- ++ /** ++ * finds and deletes a Chat line by ID ++ */ ++ public void deleteChatLine(int par1) { ++ Iterator var2 = this.field_96134_d.iterator(); + ChatLine var3; ++ + do { +- if(!var2.hasNext()) { +- var2 = this.c.iterator(); ++ if (!var2.hasNext()) { ++ var2 = this.chatLines.iterator(); + + do { +- if(!var2.hasNext()) { ++ if (!var2.hasNext()) { + return; + } + + var3 = (ChatLine)var2.next(); +- } while(var3.getChatLineID() != var1); ++ } while (var3.getChatLineID() != par1); + + var2.remove(); + return; + } + + var3 = (ChatLine)var2.next(); +- } while(var3.getChatLineID() != var1); ++ } while (var3.getChatLineID() != par1); + + var2.remove(); + } +@@ -263,16 +311,16 @@ + return this.mc.gameSettings.chatScale; + } + +- public static final int func_96128_a(float var0) { ++ public static final int func_96128_a(float par0) { + short var1 = 320; + byte var2 = 40; +- return MathHelper.floor_float(var0 * (float)(var1 - var2) + (float)var2); ++ return MathHelper.floor_float(par0 * (float)(var1 - var2) + (float)var2); + } + +- public static final int func_96130_b(float var0) { ++ public static final int func_96130_b(float par0) { + short var1 = 180; + byte var2 = 20; +- return MathHelper.floor_float(var0 * (float)(var1 - var2) + (float)var2); ++ return MathHelper.floor_float(par0 * (float)(var1 - var2) + (float)var2); + } + + public int func_96127_i() { diff --git a/patches/net/minecraft/src/GuiOptions.java.patch b/patches/net/minecraft/src/GuiOptions.java.patch new file mode 100644 index 0000000..cd0d782 --- /dev/null +++ b/patches/net/minecraft/src/GuiOptions.java.patch @@ -0,0 +1,158 @@ +--- net/minecraft/src/GuiOptions.java ++++ net/minecraft/src/GuiOptions.java +@@ -1,96 +1,119 @@ + package net.minecraft.src; + + public class GuiOptions extends GuiScreen { +- private static final EnumOptions[] relevantOptions = new EnumOptions[]{EnumOptions.MUSIC, EnumOptions.SOUND, EnumOptions.INVERT_MOUSE, EnumOptions.SENSITIVITY, EnumOptions.FOV, EnumOptions.DIFFICULTY, EnumOptions.TOUCHSCREEN}; ++ ++ /** ++ * An array of options that can be changed directly from the options GUI. ++ */ ++ private static final EnumOptions[] relevantOptions = new EnumOptions[] {EnumOptions.MUSIC, EnumOptions.SOUND, EnumOptions.INVERT_MOUSE, EnumOptions.SENSITIVITY, EnumOptions.FOV, EnumOptions.DIFFICULTY, EnumOptions.TOUCHSCREEN}; ++ ++ /** ++ * A reference to the screen object that created this. Used for navigating between screens. ++ */ + private final GuiScreen parentScreen; ++ ++ /** Reference to the GameSettings object. */ + private final GameSettings options; +- protected String a = "Options"; +- +- public GuiOptions(GuiScreen var1, GameSettings var2) { +- this.parentScreen = var1; +- this.options = var2; ++ ++ /** The title string that is displayed in the top-center of the screen. */ ++ protected String screenTitle = "Options"; ++ ++ public GuiOptions(GuiScreen par1GuiScreen, GameSettings par2GameSettings) { ++ this.parentScreen = par1GuiScreen; ++ this.options = par2GameSettings; + } + ++ /** ++ * Adds the buttons (and other controls) to the screen in question. ++ */ ++ // ToDo: Need Spoutcraft API update for buttonList calls. + public void initGui() { + int var1 = 0; +- this.a = I18n.getString("options.title"); ++ this.screenTitle = I18n.getString("options.title"); + EnumOptions[] var2 = relevantOptions; + int var3 = var2.length; + +- for(int var4 = 0; var4 < var3; ++var4) { ++ for (int var4 = 0; var4 < var3; ++var4) { + EnumOptions var5 = var2[var4]; +- if(var5.getEnumFloat()) { +- this.i.add(new GuiSlider(var5.returnEnumOrdinal(), this.width / 2 - 155 + var1 % 2 * 160, this.height / 6 - 12 + 24 * (var1 >> 1), var5, this.options.getKeyBinding(var5), this.options.getOptionFloatValue(var5))); ++ ++ if (var5.getEnumFloat()) { ++ this.buttonList.add(new GuiSlider(var5.returnEnumOrdinal(), this.width / 2 - 155 + var1 % 2 * 160, this.height / 6 - 12 + 24 * (var1 >> 1), var5, this.options.getKeyBinding(var5), this.options.getOptionFloatValue(var5))); + } else { + GuiSmallButton var6 = new GuiSmallButton(var5.returnEnumOrdinal(), this.width / 2 - 155 + var1 % 2 * 160, this.height / 6 - 12 + 24 * (var1 >> 1), var5, this.options.getKeyBinding(var5)); +- if(var5 == EnumOptions.DIFFICULTY && this.mc.theWorld != null && this.mc.theWorld.getWorldInfo().isHardcoreModeEnabled()) { ++ ++ if (var5 == EnumOptions.DIFFICULTY && this.mc.theWorld != null && this.mc.theWorld.getWorldInfo().isHardcoreModeEnabled()) { + var6.enabled = false; +- var6.f = I18n.getString("options.difficulty") + ": " + I18n.getString("options.difficulty.hardcore"); ++ var6.displayString = I18n.getString("options.difficulty") + ": " + I18n.getString("options.difficulty.hardcore"); + } + +- this.i.add(var6); ++ this.buttonList.add(var6); + } + + ++var1; + } + +- this.i.add(new GuiButton(101, this.width / 2 - 152, this.height / 6 + 96 - 6, 150, 20, I18n.getString("options.video"))); +- this.i.add(new GuiButton(100, this.width / 2 + 2, this.height / 6 + 96 - 6, 150, 20, I18n.getString("options.controls"))); +- this.i.add(new GuiButton(102, this.width / 2 - 152, this.height / 6 + 120 - 6, 150, 20, I18n.getString("options.language"))); +- this.i.add(new GuiButton(103, this.width / 2 + 2, this.height / 6 + 120 - 6, 150, 20, I18n.getString("options.multiplayer.title"))); +- this.i.add(new GuiButton(105, this.width / 2 - 152, this.height / 6 + 144 - 6, 150, 20, I18n.getString("options.resourcepack"))); +- this.i.add(new GuiButton(104, this.width / 2 + 2, this.height / 6 + 144 - 6, 150, 20, I18n.getString("options.snooper.view"))); +- this.i.add(new GuiButton(200, this.width / 2 - 100, this.height / 6 + 168, I18n.getString("gui.done"))); ++ this.buttonList.add(new GuiButton(101, this.width / 2 - 152, this.height / 6 + 96 - 6, 150, 20, I18n.getString("options.video"))); ++ this.buttonList.add(new GuiButton(100, this.width / 2 + 2, this.height / 6 + 96 - 6, 150, 20, I18n.getString("options.controls"))); ++ this.buttonList.add(new GuiButton(102, this.width / 2 - 152, this.height / 6 + 120 - 6, 150, 20, I18n.getString("options.language"))); ++ this.buttonList.add(new GuiButton(103, this.width / 2 + 2, this.height / 6 + 120 - 6, 150, 20, I18n.getString("options.multiplayer.title"))); ++ this.buttonList.add(new GuiButton(105, this.width / 2 - 152, this.height / 6 + 144 - 6, 150, 20, I18n.getString("options.resourcepack"))); ++ this.buttonList.add(new GuiButton(104, this.width / 2 + 2, this.height / 6 + 144 - 6, 150, 20, I18n.getString("options.snooper.view"))); ++ this.buttonList.add(new GuiButton(200, this.width / 2 - 100, this.height / 6 + 168, I18n.getString("gui.done"))); + } + +- protected void actionPerformed(GuiButton var1) { +- if(var1.enabled) { +- if(var1.id < 100 && var1 instanceof GuiSmallButton) { +- this.options.setOptionValue(((GuiSmallButton)var1).returnEnumOptions(), 1); +- var1.f = this.options.getKeyBinding(EnumOptions.getEnumOptions(var1.id)); ++ /** ++ * Fired when a control is clicked. This is the equivalent of ActionListener.actionPerformed(ActionEvent e). ++ */ ++ protected void actionPerformed(GuiButton par1GuiButton) { ++ if (par1GuiButton.enabled) { ++ if (par1GuiButton.id < 100 && par1GuiButton instanceof GuiSmallButton) { ++ this.options.setOptionValue(((GuiSmallButton)par1GuiButton).returnEnumOptions(), 1); ++ par1GuiButton.displayString = this.options.getKeyBinding(EnumOptions.getEnumOptions(par1GuiButton.id)); + } + +- if(var1.id == 101) { ++ if (par1GuiButton.id == 101) { + this.mc.gameSettings.saveOptions(); + this.mc.displayGuiScreen(new GuiVideoSettings(this, this.options)); + } + +- if(var1.id == 100) { ++ if (par1GuiButton.id == 100) { + this.mc.gameSettings.saveOptions(); + this.mc.displayGuiScreen(new GuiControls(this, this.options)); + } + +- if(var1.id == 102) { ++ if (par1GuiButton.id == 102) { + this.mc.gameSettings.saveOptions(); + this.mc.displayGuiScreen(new GuiLanguage(this, this.options, this.mc.getLanguageManager())); + } + +- if(var1.id == 103) { ++ if (par1GuiButton.id == 103) { + this.mc.gameSettings.saveOptions(); + this.mc.displayGuiScreen(new ScreenChatOptions(this, this.options)); + } + +- if(var1.id == 104) { ++ if (par1GuiButton.id == 104) { + this.mc.gameSettings.saveOptions(); + this.mc.displayGuiScreen(new GuiSnooper(this, this.options)); + } + +- if(var1.id == 200) { ++ if (par1GuiButton.id == 200) { + this.mc.gameSettings.saveOptions(); + this.mc.displayGuiScreen(this.parentScreen); + } + +- if(var1.id == 105) { ++ if (par1GuiButton.id == 105) { + this.mc.gameSettings.saveOptions(); + this.mc.displayGuiScreen(new GuiScreenTemporaryResourcePackSelect(this, this.options)); + } +- + } + } + +- public void drawScreen(int var1, int var2, float var3) { ++ /** ++ * Draws the screen and all the components in it. ++ */ ++ public void drawScreen(int par1, int par2, float par3) { + this.drawDefaultBackground(); +- this.drawCenteredString(this.fontRenderer, this.a, this.width / 2, 15, 16777215); +- super.drawScreen(var1, var2, var3); ++ this.drawCenteredString(this.fontRenderer, this.screenTitle, this.width / 2, 15, 16777215); ++ super.drawScreen(par1, par2, par3); + } + } diff --git a/patches/net/minecraft/src/GuiParticle.java.patch b/patches/net/minecraft/src/GuiParticle.java.patch new file mode 100644 index 0000000..09a0ba9 --- /dev/null +++ b/patches/net/minecraft/src/GuiParticle.java.patch @@ -0,0 +1,45 @@ +--- /dev/null ++++ net/minecraft/src/GuiParticle.java +@@ -1,0 +1,42 @@ ++package net.minecraft.src; ++ ++import java.util.ArrayList; ++import java.util.List; ++import net.minecraft.src.Minecraft; ++import org.lwjgl.opengl.GL11; ++ ++public class GuiParticle extends Gui { ++ private List particles = new ArrayList(); ++ private Minecraft mc; ++ ++ public GuiParticle(Minecraft par1Minecraft) { ++ this.mc = par1Minecraft; ++ } ++ ++ public void update() { ++ for (int var1 = 0; var1 < this.particles.size(); ++var1) { ++ Particle var2 = (Particle)this.particles.get(var1); ++ var2.preUpdate(); ++ var2.update(this); ++ ++ if (var2.isDead) { ++ this.particles.remove(var1--); ++ } ++ } ++ } ++ ++ public void draw(float par1) { ++ mc.getMinecraft().getTextureManager().bindTexture(new ResourceLocation("textures/particle/particles.png")); ++ for (int var2 = 0; var2 < this.particles.size(); ++var2) { ++ Particle var3 = (Particle)this.particles.get(var2); ++ int var4 = (int)(var3.prevPosX + (var3.posX - var3.prevPosX) * (double)par1 - 4.0D); ++ int var5 = (int)(var3.prevPosY + (var3.posY - var3.prevPosY) * (double)par1 - 4.0D); ++ float var6 = (float)(var3.prevTintAlpha + (var3.tintAlpha - var3.prevTintAlpha) * (double)par1); ++ float var7 = (float)(var3.prevTintRed + (var3.tintRed - var3.prevTintRed) * (double)par1); ++ float var8 = (float)(var3.prevTintGreen + (var3.tintGreen - var3.prevTintGreen) * (double)par1); ++ float var9 = (float)(var3.prevTintBlue + (var3.tintBlue - var3.prevTintBlue) * (double)par1); ++ GL11.glColor4f(var7, var8, var9, var6); ++ this.drawTexturedModalRect(var4, var5, 40, 0, 8, 8); ++ } ++ } ++} diff --git a/patches/net/minecraft/src/GuiPlayerInfo.java.patch b/patches/net/minecraft/src/GuiPlayerInfo.java.patch new file mode 100644 index 0000000..a3a2a45 --- /dev/null +++ b/patches/net/minecraft/src/GuiPlayerInfo.java.patch @@ -0,0 +1,26 @@ +--- net/minecraft/src/GuiPlayerInfo.java ++++ net/minecraft/src/GuiPlayerInfo.java +@@ -1,12 +1,18 @@ + package net.minecraft.src; + + public class GuiPlayerInfo { +- public final String a; +- private final String c; ++ ++ /** The string value of the object */ ++ public final String name; ++ ++ /** Player name in lowercase. */ ++ private final String nameinLowerCase; ++ ++ /** Player response time to server in milliseconds */ + public int responseTime; + +- public GuiPlayerInfo(String var1) { +- this.a = var1; +- this.c = var1.toLowerCase(); ++ public GuiPlayerInfo(String par1Str) { ++ this.name = par1Str; ++ this.nameinLowerCase = par1Str.toLowerCase(); + } + } diff --git a/patches/net/minecraft/src/GuiRenameWorld.java.patch b/patches/net/minecraft/src/GuiRenameWorld.java.patch new file mode 100644 index 0000000..849fef5 --- /dev/null +++ b/patches/net/minecraft/src/GuiRenameWorld.java.patch @@ -0,0 +1,122 @@ +--- net/minecraft/src/GuiRenameWorld.java ++++ net/minecraft/src/GuiRenameWorld.java +@@ -5,66 +5,86 @@ + public class GuiRenameWorld extends GuiScreen { + private GuiScreen parentGuiScreen; + private GuiTextField theGuiTextField; +- private final String c; ++ private final String worldName; + +- public GuiRenameWorld(GuiScreen var1, String var2) { +- this.parentGuiScreen = var1; +- this.c = var2; ++ public GuiRenameWorld(GuiScreen par1GuiScreen, String par2Str) { ++ this.parentGuiScreen = par1GuiScreen; ++ this.worldName = par2Str; + } + ++ /** ++ * Called from the main game loop to update the screen. ++ */ + public void updateScreen() { + this.theGuiTextField.updateCursorCounter(); + } + ++ /** ++ * Adds the buttons (and other controls) to the screen in question. ++ */ + public void initGui() { + Keyboard.enableRepeatEvents(true); +- this.i.clear(); +- this.i.add(new GuiButton(0, this.width / 2 - 100, this.height / 4 + 96 + 12, I18n.getString("selectWorld.renameButton"))); +- this.i.add(new GuiButton(1, this.width / 2 - 100, this.height / 4 + 120 + 12, I18n.getString("gui.cancel"))); ++ this.buttonList.clear(); ++ this.buttonList.add(new GuiButton(0, this.width / 2 - 100, this.height / 4 + 96 + 12, I18n.getString("selectWorld.renameButton"))); ++ this.buttonList.add(new GuiButton(1, this.width / 2 - 100, this.height / 4 + 120 + 12, I18n.getString("gui.cancel"))); + ISaveFormat var1 = this.mc.getSaveLoader(); +- WorldInfo var2 = var1.getWorldInfo(this.c); ++ WorldInfo var2 = var1.getWorldInfo(this.worldName); + String var3 = var2.getWorldName(); + this.theGuiTextField = new GuiTextField(this.fontRenderer, this.width / 2 - 100, 60, 200, 20); + this.theGuiTextField.setFocused(true); + this.theGuiTextField.setText(var3); + } + ++ /** ++ * Called when the screen is unloaded. Used to disable keyboard repeat events ++ */ + public void onGuiClosed() { + Keyboard.enableRepeatEvents(false); + } + +- protected void actionPerformed(GuiButton var1) { +- if(var1.enabled) { +- if(var1.id == 1) { ++ /** ++ * Fired when a control is clicked. This is the equivalent of ActionListener.actionPerformed(ActionEvent e). ++ */ ++ protected void actionPerformed(GuiButton par1GuiButton) { ++ if (par1GuiButton.enabled) { ++ if (par1GuiButton.id == 1) { + this.mc.displayGuiScreen(this.parentGuiScreen); +- } else if(var1.id == 0) { ++ } else if (par1GuiButton.id == 0) { + ISaveFormat var2 = this.mc.getSaveLoader(); +- var2.renameWorld(this.c, this.theGuiTextField.getText().trim()); ++ var2.renameWorld(this.worldName, this.theGuiTextField.getText().trim()); + this.mc.displayGuiScreen(this.parentGuiScreen); + } +- +- } +- } +- +- protected void keyTyped(char var1, int var2) { +- this.theGuiTextField.textboxKeyTyped(var1, var2); +- ((GuiButton)this.i.get(0)).enabled = this.theGuiTextField.getText().trim().length() > 0; +- if(var2 == 28 || var2 == 156) { +- this.actionPerformed((GuiButton)this.i.get(0)); +- } +- +- } +- +- protected void mouseClicked(int var1, int var2, int var3) { +- super.mouseClicked(var1, var2, var3); +- this.theGuiTextField.mouseClicked(var1, var2, var3); +- } +- +- public void drawScreen(int var1, int var2, float var3) { ++ } ++ } ++ ++ /** ++ * Fired when a key is typed. This is the equivalent of KeyListener.keyTyped(KeyEvent e). ++ */ ++ protected void keyTyped(char par1, int par2) { ++ this.theGuiTextField.textboxKeyTyped(par1, par2); ++ ((GuiButton)this.buttonList.get(0)).enabled = this.theGuiTextField.getText().trim().length() > 0; ++ ++ if (par2 == 28 || par2 == 156) { ++ this.actionPerformed((GuiButton)this.buttonList.get(0)); ++ } ++ } ++ ++ /** ++ * Called when the mouse is clicked. ++ */ ++ protected void mouseClicked(int par1, int par2, int par3) { ++ super.mouseClicked(par1, par2, par3); ++ this.theGuiTextField.mouseClicked(par1, par2, par3); ++ } ++ ++ /** ++ * Draws the screen and all the components in it. ++ */ ++ public void drawScreen(int par1, int par2, float par3) { + this.drawDefaultBackground(); + this.drawCenteredString(this.fontRenderer, I18n.getString("selectWorld.renameTitle"), this.width / 2, 20, 16777215); + this.drawString(this.fontRenderer, I18n.getString("selectWorld.enterName"), this.width / 2 - 100, 47, 10526880); + this.theGuiTextField.drawTextBox(); +- super.drawScreen(var1, var2, var3); ++ super.drawScreen(par1, par2, par3); + } + } diff --git a/patches/net/minecraft/src/GuiRepair.java.patch b/patches/net/minecraft/src/GuiRepair.java.patch new file mode 100644 index 0000000..6c2aed3 --- /dev/null +++ b/patches/net/minecraft/src/GuiRepair.java.patch @@ -0,0 +1,222 @@ +--- net/minecraft/src/GuiRepair.java ++++ net/minecraft/src/GuiRepair.java +@@ -1,21 +1,32 @@ + package net.minecraft.src; + + import java.util.List; ++ ++import net.minecraft.src.ItemStack; ++ + import org.lwjgl.input.Keyboard; + import org.lwjgl.opengl.GL11; + ++// Spout ++import org.spoutcraft.api.Spoutcraft; ++import org.spoutcraft.client.inventory.CraftItemStack; ++// End Spout ++ + public class GuiRepair extends GuiContainer implements ICrafting { + private static final ResourceLocation anvilGuiTextures = new ResourceLocation("textures/gui/container/anvil.png"); + private ContainerRepair repairContainer; + private GuiTextField itemNameField; + private InventoryPlayer field_82325_q; + +- public GuiRepair(InventoryPlayer var1, World var2, int var3, int var4, int var5) { +- super(new ContainerRepair(var1, var2, var3, var4, var5, Minecraft.getMinecraft().thePlayer)); +- this.field_82325_q = var1; ++ public GuiRepair(InventoryPlayer par1InventoryPlayer, World par2World, int par3, int par4, int par5) { ++ super(new ContainerRepair(par1InventoryPlayer, par2World, par3, par4, par5, Minecraft.getMinecraft().thePlayer)); ++ this.field_82325_q = par1InventoryPlayer; + this.repairContainer = (ContainerRepair)this.inventorySlots; + } + ++ /** ++ * Adds the buttons (and other controls) to the screen in question. ++ */ + public void initGui() { + super.initGui(); + Keyboard.enableRepeatEvents(true); +@@ -27,36 +38,45 @@ + this.itemNameField.setEnableBackgroundDrawing(false); + this.itemNameField.setMaxStringLength(40); + this.inventorySlots.removeCraftingFromCrafters(this); +- this.inventorySlots.onCraftGuiOpened(this); ++ this.inventorySlots.addCraftingToCrafters(this); + } + ++ /** ++ * Called when the screen is unloaded. Used to disable keyboard repeat events ++ */ + public void onGuiClosed() { + super.onGuiClosed(); + Keyboard.enableRepeatEvents(false); + this.inventorySlots.removeCraftingFromCrafters(this); + } + +- protected void drawGuiContainerForegroundLayer(int var1, int var2) { ++ /** ++ * Draw the foreground layer for the GuiContainer (everything in front of the items) ++ */ ++ protected void drawGuiContainerForegroundLayer(int par1, int par2) { + GL11.glDisable(GL11.GL_LIGHTING); + this.fontRenderer.drawString(I18n.getString("container.repair"), 60, 6, 4210752); +- if(this.repairContainer.maximumCost > 0) { ++ ++ if (this.repairContainer.maximumCost > 0) { + int var3 = 8453920; + boolean var4 = true; +- String var5 = I18n.getStringParams("container.repair.cost", new Object[]{Integer.valueOf(this.repairContainer.maximumCost)}); +- if(this.repairContainer.maximumCost >= 40 && !this.mc.thePlayer.capabilities.isCreativeMode) { ++ String var5 = I18n.getStringParams("container.repair.cost", new Object[] {Integer.valueOf(this.repairContainer.maximumCost)}); ++ ++ if (this.repairContainer.maximumCost >= 40 && !this.mc.thePlayer.capabilities.isCreativeMode) { + var5 = I18n.getString("container.repair.expensive"); + var3 = 16736352; +- } else if(!this.repairContainer.getSlot(2).getHasStack()) { ++ } else if (!this.repairContainer.getSlot(2).getHasStack()) { + var4 = false; +- } else if(!this.repairContainer.getSlot(2).canTakeStack(this.field_82325_q.player)) { ++ } else if (!this.repairContainer.getSlot(2).canTakeStack(this.field_82325_q.player)) { + var3 = 16736352; + } + +- if(var4) { ++ if (var4) { + int var6 = -16777216 | (var3 & 16579836) >> 2 | var3 & -16777216; + int var7 = this.xSize - 8 - this.fontRenderer.getStringWidth(var5); + byte var8 = 67; +- if(this.fontRenderer.getUnicodeFlag()) { ++ ++ if (this.fontRenderer.getUnicodeFlag()) { + drawRect(var7 - 3, var8 - 2, this.xSize - 7, var8 + 10, -16777216); + drawRect(var7 - 2, var8 - 1, this.xSize - 8, var8 + 9, -12895429); + } else { +@@ -72,19 +92,22 @@ + GL11.glEnable(GL11.GL_LIGHTING); + } + +- protected void keyTyped(char var1, int var2) { +- if(this.itemNameField.textboxKeyTyped(var1, var2)) { ++ /** ++ * Fired when a key is typed. This is the equivalent of KeyListener.keyTyped(KeyEvent e). ++ */ ++ protected void keyTyped(char par1, int par2) { ++ if (this.itemNameField.textboxKeyTyped(par1, par2)) { + this.func_135015_g(); + } else { +- super.keyTyped(var1, var2); ++ super.keyTyped(par1, par2); + } +- + } + + private void func_135015_g() { + String var1 = this.itemNameField.getText(); + Slot var2 = this.repairContainer.getSlot(0); +- if(var2 != null && var2.getHasStack() && !var2.getStack().hasDisplayName() && var1.equals(var2.getStack().getDisplayName())) { ++ ++ if (var2 != null && var2.getHasStack() && !var2.getStack().hasDisplayName() && var1.equals(var2.getStack().getDisplayName())) { + var1 = ""; + } + +@@ -92,45 +115,76 @@ + this.mc.thePlayer.sendQueue.addToSendQueue(new Packet250CustomPayload("MC|ItemName", var1.getBytes())); + } + +- protected void mouseClicked(int var1, int var2, int var3) { +- super.mouseClicked(var1, var2, var3); +- this.itemNameField.mouseClicked(var1, var2, var3); ++ /** ++ * Called when the mouse is clicked. ++ */ ++ protected void mouseClicked(int par1, int par2, int par3) { ++ super.mouseClicked(par1, par2, par3); ++ this.itemNameField.mouseClicked(par1, par2, par3); + } + +- public void drawScreen(int var1, int var2, float var3) { +- super.drawScreen(var1, var2, var3); ++ /** ++ * Draws the screen and all the components in it. ++ */ ++ public void drawScreen(int par1, int par2, float par3) { ++ super.drawScreen(par1, par2, par3); + GL11.glDisable(GL11.GL_LIGHTING); + this.itemNameField.drawTextBox(); + } + +- protected void drawGuiContainerBackgroundLayer(float var1, int var2, int var3) { ++ /** ++ * Draw the background layer for the GuiContainer (everything behind the items) ++ */ ++ protected void drawGuiContainerBackgroundLayer(float par1, int par2, int par3) { + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + this.mc.getTextureManager().bindTexture(anvilGuiTextures); + int var4 = (this.width - this.xSize) / 2; + int var5 = (this.height - this.ySize) / 2; + this.drawTexturedModalRect(var4, var5, 0, 0, this.xSize, this.ySize); + this.drawTexturedModalRect(var4 + 59, var5 + 20, 0, this.ySize + (this.repairContainer.getSlot(0).getHasStack() ? 0 : 16), 110, 16); +- if((this.repairContainer.getSlot(0).getHasStack() || this.repairContainer.getSlot(1).getHasStack()) && !this.repairContainer.getSlot(2).getHasStack()) { ++ ++ if ((this.repairContainer.getSlot(0).getHasStack() || this.repairContainer.getSlot(1).getHasStack()) && !this.repairContainer.getSlot(2).getHasStack()) { + this.drawTexturedModalRect(var4 + 99, var5 + 45, this.xSize, 0, 28, 21); + } +- +- } +- +- public void updateCraftingInventory(Container var1, List var2) { +- this.sendSlotContents(var1, 0, var1.getSlot(0).getStack()); +- } +- +- public void sendSlotContents(Container var1, int var2, ItemStack var3) { +- if(var2 == 0) { +- this.itemNameField.setText(var3 == null ? "" : var3.getDisplayName()); +- this.itemNameField.setEnabled(var3 != null); +- if(var3 != null) { ++ } ++ ++ public void sendContainerAndContentsToPlayer(Container par1Container, List par2List) { ++ this.sendSlotContents(par1Container, 0, par1Container.getSlot(0).getStack()); ++ } ++ ++ /** ++ * Sends the contents of an inventory slot to the client-side Container. This doesn't have to match the actual contents ++ * of that slot. Args: Container, slot number, slot contents ++ */ ++ public void sendSlotContents(Container par1Container, int par2, ItemStack par3ItemStack) { ++ if (par2 == 0) { ++ this.itemNameField.setText(par3ItemStack == null ? "" : par3ItemStack.getDisplayName()); ++ this.itemNameField.setEnabled(par3ItemStack != null); ++ ++ // Spout ++ if (par3ItemStack != null && par3ItemStack.itemID != 318) { + this.func_135015_g(); + } ++ ++ if (par3ItemStack != null && par3ItemStack.itemID == 318) { ++ String custom, customName; ++ custom = Spoutcraft.getMaterialManager().getToolTip(new CraftItemStack(par3ItemStack)); ++ if (custom != null) { ++ String[] split = custom.split("\n"); ++ customName = split[0]; ++ this.itemNameField.setText(customName); ++ } else { ++ this.itemNameField.setText("Spout Custom Item"); ++ } ++ } ++ // End Spout + } +- +- } +- +- public void sendProgressBarUpdate(Container var1, int var2, int var3) { +- } ++ } ++ ++ /** ++ * Sends two ints to the client-side Container. Used for furnace burning time, smelting progress, brewing progress, and ++ * enchanting level. Normally the first int identifies which variable to update, and the second contains the new value. ++ * Both are truncated to shorts in non-local SMP. ++ */ ++ public void sendProgressBarUpdate(Container par1Container, int par2, int par3) {} + } diff --git a/patches/net/minecraft/src/GuiScreen.java.patch b/patches/net/minecraft/src/GuiScreen.java.patch new file mode 100644 index 0000000..064bf89 --- /dev/null +++ b/patches/net/minecraft/src/GuiScreen.java.patch @@ -0,0 +1,1109 @@ +--- net/minecraft/src/GuiScreen.java ++++ net/minecraft/src/GuiScreen.java +@@ -6,175 +6,818 @@ + import java.awt.datatransfer.StringSelection; + import java.awt.datatransfer.Transferable; + import java.util.ArrayList; ++import java.util.IdentityHashMap; + import java.util.List; +-import org.lwjgl.input.Keyboard; ++import java.util.concurrent.ConcurrentSkipListMap; ++ + import org.lwjgl.input.Mouse; ++import org.lwjgl.input.Keyboard; + import org.lwjgl.opengl.GL11; +- +-public class GuiScreen extends Gui { ++import org.spoutcraft.api.gui.Button; ++import org.spoutcraft.api.gui.CheckBox; ++import org.spoutcraft.api.gui.ComboBox; ++import org.spoutcraft.api.gui.Control; ++import org.spoutcraft.api.gui.GenericComboBox; ++import org.spoutcraft.api.gui.GenericComboBox.ComboBoxView; ++import org.spoutcraft.api.gui.GenericGradient; ++import org.spoutcraft.api.gui.GenericOverlayScreen; ++//import org.spoutcraft.api.gui.Keyboard; ++import org.spoutcraft.api.gui.ListWidget; ++import org.spoutcraft.api.gui.ListWidgetItem; ++import org.spoutcraft.api.gui.Orientation; ++import org.spoutcraft.api.gui.OverlayScreen; ++import org.spoutcraft.api.gui.RadioButton; ++import org.spoutcraft.api.gui.RenderPriority; ++import org.spoutcraft.api.gui.Screen; ++import org.spoutcraft.api.gui.ScreenType; ++import org.spoutcraft.api.gui.Scrollable; ++import org.spoutcraft.api.gui.Slider; ++import org.spoutcraft.api.gui.Slot; ++import org.spoutcraft.api.gui.TextField; ++import org.spoutcraft.api.gui.Widget; ++import org.spoutcraft.api.inventory.ItemStack; ++import org.spoutcraft.client.ScheduledTextFieldUpdate; ++import org.spoutcraft.client.SpoutClient; ++import org.spoutcraft.client.config.Configuration; ++import org.spoutcraft.client.controls.SimpleKeyBindingManager; ++import org.spoutcraft.client.gui.CustomScreen; ++import org.spoutcraft.client.gui.MCRenderDelegate; ++import org.spoutcraft.client.gui.ScreenUtil; ++import org.spoutcraft.client.packet.PacketComboBox; ++import org.spoutcraft.client.packet.PacketControlAction; ++import org.spoutcraft.client.packet.PacketKeyPress; ++import org.spoutcraft.client.packet.PacketSlotClick; ++ ++public class GuiScreen extends Gui { ++ ++ /** Reference to the Minecraft object. */ + protected Minecraft mc; ++ ++ /** The width of the screen object. */ + public int width; ++ ++ /** The height of the screen object. */ + public int height; +- protected List i = new ArrayList(); ++ ++ /** A list of all the buttons in this container. */ ++ protected List buttonList = new ArrayList(); + public boolean allowUserInput; ++ ++ /** The FontRenderer used by GuiScreen */ + protected FontRenderer fontRenderer; ++ public GuiParticle guiParticles; ++ ++ /** The button that was just pressed. */ + private GuiButton selectedButton; + private int eventButton; +- private long lastMouseEvent; ++ private long field_85043_c; + private int field_92018_d; + +- public void drawScreen(int var1, int var2, float var3) { +- for(int var4 = 0; var4 < this.i.size(); ++var4) { +- GuiButton var5 = (GuiButton)this.i.get(var4); +- var5.drawButton(this.mc, var1, var2); +- } +- +- } +- +- protected void keyTyped(char var1, int var2) { +- if(var2 == 1) { ++ // Spout Start ++ public GenericGradient bg; ++ public Screen screen = null; ++ private long updateTicks; ++ private Scrollable holding = null; ++ private Orientation holdingScrollBar = Orientation.VERTICAL; ++ private long lastMouseMove = 0; ++ public static int TOOLTIP_DELAY = 500; ++ long renderEndNanoTime = 0L; ++ protected static int limitedFramerate = 120; ++ private long lastClick = 0; ++ protected static RenderItem ourItemRenderer = new RenderItem(); ++ private boolean firstrun = true; ++ protected IdentityHashMap scheduledTextFieldUpdates = new IdentityHashMap(); ++ ++ /** ++ * Draws the screen with widgets - do not override - use drawScreen() instead ++ */ ++ public void drawScreenPre(int x, int y, float z) { ++ drawScreen(x, y, z); ++ drawWidgets(x, y, z); ++ ++ // Limit main menu framerate to 120 FPS as long as we aren't in a game already ++ if (this.mc.theWorld == null) { ++ long sleeptime = (this.renderEndNanoTime + (long) (1000000000 / limitedFramerate) - System.nanoTime()) / 1000000L; ++ if (sleeptime > 0L && sleeptime < 500L) { ++ try { ++ Thread.sleep(sleeptime); ++ } catch (InterruptedException var12) { ++ var12.printStackTrace(); ++ } ++ } ++ ++ this.renderEndNanoTime = System.nanoTime(); ++ } ++ ++ int i = 0; ++ int j = 0; ++ if(mc.thePlayer != null) { ++ InventoryPlayer inventoryplayer = mc.thePlayer.inventory; ++ if(inventoryplayer.getItemStack() != null) { ++ RenderHelper.disableStandardItemLighting(); ++ RenderHelper.enableGUIStandardItemLighting(); ++ GL11.glTranslatef(0.0F, 0.0F, 32F); ++ zLevel = 200F; ++ ourItemRenderer.zLevel = 200F; ++ ourItemRenderer.renderItemIntoGUI(fontRenderer, mc.renderEngine, inventoryplayer.getItemStack(), x - i - 8, y - j - 8); ++ ourItemRenderer.renderItemOverlayIntoGUI(fontRenderer, mc.renderEngine, inventoryplayer.getItemStack(), x - i - 8, y - j - 8); ++ zLevel = 0.0F; ++ ourItemRenderer.zLevel = 0.0F; ++ RenderHelper.enableStandardItemLighting(); ++ } ++ } ++ } ++ // Spout End ++ ++ /** ++ * Draws the screen and all the components in it. ++ */ ++ public void drawScreen(int par1, int par2, float par3) { ++ for (int var4 = 0; var4 < this.buttonList.size(); ++var4) { ++ GuiButton var5 = (GuiButton)this.buttonList.get(var4); ++ var5.drawButton(this.mc, par1, par2); ++ } ++ } ++ ++ /** ++ * Fired when a key is typed. This is the equivalent of KeyListener.keyTyped(KeyEvent e). ++ */ ++ protected void keyTyped(char par1, int par2) { ++ if (par2 == 1) { + this.mc.displayGuiScreen((GuiScreen)null); ++ // Spout Start ++ if (mc.currentScreen == null) { + this.mc.setIngameFocus(); +- } +- +- } +- ++ } ++ // Spout End ++ } ++ } ++ ++ // Spout Start ++ public final void update(Screen screen) { ++ if (this.screen != null) { ++ for (Widget w : this.screen.getAttachedWidgets()) { ++ screen.attachWidget(w.getAddon(), w); ++ } ++ } ++ this.screen = screen; ++ } ++ // Spout End ++ ++ /** ++ * Returns a string stored in the system clipboard. ++ */ + public static String getClipboardString() { + try { + Transferable var0 = Toolkit.getDefaultToolkit().getSystemClipboard().getContents((Object)null); +- if(var0 != null && var0.isDataFlavorSupported(DataFlavor.stringFlavor)) { ++ ++ if (var0 != null && var0.isDataFlavorSupported(DataFlavor.stringFlavor)) { + return (String)var0.getTransferData(DataFlavor.stringFlavor); + } + } catch (Exception var1) { ++ ; + } + + return ""; + } + +- public static void setClipboardString(String var0) { +- try { +- StringSelection var1 = new StringSelection(var0); ++ // Spout Start - Wrap ALL the methods! ++ // Making these protected so you can always override behaviour you don't want. ++ protected void mouseClickedPre(int mouseX, int mouseY, int eventButton) { ++ mouseClicked(mouseX, mouseY, eventButton); // Call vanilla method ++ if (getScreen() == null) { ++ return; ++ } ++ screen.setMouseX(mouseX); ++ screen.setMouseY(mouseY); ++ ++ ComboBox openCombobox = null; ++ ++ if (eventButton == 0) { ++ boolean handled = false; ++ for (int i = 4; i >= 0; i--) { ++ Widget lastWidget = null; ++ for (Widget widget : screen.getAttachedWidgets(true)) { ++ lastWidget = widget; ++ if (widget.getPriority().getId() != i) { ++ continue; ++ } ++ if (widget instanceof Control) { ++ Control control = (Control) widget; ++ if (control.isEnabled() && control.isVisible() && isInBoundingRect(control, mouseX, mouseY)) { ++ if (control.getScreen() instanceof Scrollable) { ++ if (!isInBoundingRect(control.getScreen(), mouseX, mouseY)) { ++ continue; ++ } ++ } ++ control.setFocus(true); ++ if (control instanceof Scrollable) { ++ handled = handled || handleClickOnScrollable((Scrollable) control, mouseX, mouseY); ++ if (!handled && control instanceof ListWidget) { ++ handled = handled || handleClickOnListWidget((ListWidget) control, mouseX, mouseY); ++ } ++ } ++ if (!handled) { ++ if (control instanceof Button) { ++ handleButtonClick((Button) control); ++ handled = true; ++ } else if (control instanceof Slider) { ++ ((Slider) control).setDragging(true); ++ handled = true; ++ } else if (control instanceof TextField) { ++ ((TextField) control).setCursorPosition(((TextField) control).getText().length()); ++ handled = true; ++ } else if (control instanceof Slot) { ++ handleClickOnSlot((Slot) control, 0); ++ } ++ } ++ } ++ } ++ ++ if (lastWidget instanceof ComboBox) { ++ ComboBox box = (ComboBox) lastWidget; ++ if (box.isOpen()) { ++ openCombobox = box; ++ } ++ } ++ if (handled) { ++ break; ++ } ++ } ++ if (handled) { ++ if (lastWidget == openCombobox) { ++ openCombobox = null; ++ } ++ playSoundFX("random.click", 1.0F, 1.0F); ++ break; ++ } ++ } ++ } else if (eventButton == 1) { ++ for (Widget widget : screen.getAttachedWidgets(true)) { ++ if (widget instanceof Control) { ++ Control c = (Control) widget; ++ if (c.isEnabled() && c.isVisible() && isInBoundingRect(widget, mouseX, mouseY)) { ++ if (widget instanceof Slot) { ++ handleClickOnSlot((Slot) widget, 1); ++ break; ++ } ++ } ++ } ++ } ++ } ++ if (openCombobox != null) { ++ openCombobox.closeList(); ++ } ++ } ++ ++ private void handleClickOnSlot(Slot slot, int button) { ++ try { ++ if (mc.thePlayer == null) { ++ return; ++ } ++ PacketSlotClick packet = new PacketSlotClick(slot, button,Keyboard.isKeyDown(Keyboard.KEY_LSHIFT) || Keyboard.isKeyDown(Keyboard.KEY_RSHIFT)); ++ SpoutClient.getInstance().getPacketManager().sendSpoutPacket(packet); ++ ItemStack stackOnCursor = new ItemStack(0); ++ if (mc.thePlayer.inventory.getItemStack() != null) { ++ net.minecraft.src.ItemStack mcStack = mc.thePlayer.inventory.getItemStack(); ++ stackOnCursor = new ItemStack(mcStack.itemID, mcStack.stackSize, (short) mcStack.getItemDamage()); ++ } ++ ItemStack stackInSlot = slot.getItem(); ++ if ((stackOnCursor == null || stackOnCursor.getTypeId() == 0) && stackInSlot.getTypeId() == 0) { ++ return; // Nothing to do ++ } ++ if (stackOnCursor.getTypeId() == 0 && stackInSlot.getTypeId() != 0 && button == 1) { // Split item ++ int amountSlot = stackInSlot.getAmount() / 2; ++ int amountCursor = stackInSlot.getAmount() - amountSlot; ++ if (stackInSlot.getAmount() == 1) { ++ amountSlot = 0; ++ amountCursor = 1; ++ } ++ stackOnCursor = stackInSlot.clone(); ++ stackOnCursor.setAmount(amountCursor); ++ stackInSlot.setAmount(amountSlot); ++ if (amountSlot == 0) { ++ stackInSlot = new ItemStack(0); ++ } ++ boolean success = slot.onItemTake(stackOnCursor); ++ if (success) { ++ slot.setItem(stackInSlot); ++ } else { ++ return; ++ } ++ } else if (stackOnCursor != null && (stackInSlot.getTypeId() == 0 || (stackInSlot.getTypeId() == stackOnCursor.getTypeId() && stackInSlot.getDurability() == stackOnCursor.getDurability()))) { //Put item ++ ItemStack toPut = stackOnCursor.clone(); ++ int putAmount = toPut.getAmount(); ++ if (button == 1) { ++ putAmount = 1; ++ } ++ int amount = stackInSlot.getTypeId() == 0 ? 0 : stackInSlot.getAmount(); ++ amount += putAmount; ++ int maxStackSize = toPut.getMaxStackSize(); ++ if (maxStackSize == -1) { ++ maxStackSize = 64; ++ } ++ if (amount > maxStackSize) { ++ putAmount -= amount - maxStackSize; ++ amount = maxStackSize; ++ } ++ if (putAmount <= 0) { ++ return; ++ } ++ toPut.setAmount(putAmount); ++ boolean success = slot.onItemPut(toPut); ++ if (success) { ++ stackOnCursor.setAmount(stackOnCursor.getAmount() - putAmount); ++ if (stackOnCursor.getAmount() == 0) { ++ stackOnCursor = new ItemStack(0); ++ } ++ ItemStack put = toPut.clone(); ++ put.setAmount(amount); ++ slot.setItem(put); ++ } ++ } else if (stackOnCursor == null || stackOnCursor.getTypeId() == 0) { // Take item or shift click ++ if (Keyboard.isKeyDown(Keyboard.KEY_LSHIFT) || Keyboard.isKeyDown(Keyboard.KEY_RSHIFT)) { ++ slot.onItemShiftClicked(); ++ } else { // Take item ++ boolean success = slot.onItemTake(stackInSlot); ++ if (success) { ++ stackOnCursor = stackInSlot; ++ slot.setItem(new ItemStack(0)); ++ } ++ } ++ } else if (stackOnCursor.getTypeId() != stackInSlot.getTypeId() || stackOnCursor.getDurability() != stackInSlot.getDurability()) { // Exchange slot stack and cursor stack ++ boolean success = slot.onItemExchange(stackInSlot, stackOnCursor.clone()); ++ if (success) { ++ slot.setItem(stackOnCursor.clone()); ++ stackOnCursor = stackInSlot; ++ } ++ } ++ ++ if (stackOnCursor == null || stackOnCursor.getTypeId() == 0) { ++ mc.thePlayer.inventory.setItemStack(null); ++ } else { ++ net.minecraft.src.ItemStack mcStack = new net.minecraft.src.ItemStack(stackOnCursor.getTypeId(), stackOnCursor.getAmount(), stackOnCursor.getDurability()); ++ mc.thePlayer.inventory.setItemStack(mcStack); ++ } ++ } catch(Exception e) { ++ e.printStackTrace(); ++ } ++ } ++ ++ private void playSoundFX(String sound, float f, float f1) { ++ this.mc.sndManager.playSoundFX(sound, 1.0F, 1.0F); ++ } ++ ++ private boolean handleClickOnListWidget(ListWidget lw, int mouseX, int mouseY) { ++ int x = (int) (mouseX - lw.getActualX()); ++ int y = (int) (mouseY - lw.getActualY()); ++ if (x < 5) { ++ return false; ++ } ++ int scroll = lw.getScrollPosition(Orientation.VERTICAL); ++ y += scroll; ++ y -= 5; ++ int currentHeight = 0; ++ int n = 0; ++ for (ListWidgetItem item : lw.getItems()) { ++ ++ if (currentHeight <= y && y <= currentHeight + item.getHeight()) { ++ boolean doubleclick = false; ++ if (System.currentTimeMillis() - 200 < lastClick) { ++ doubleclick = true; ++ } ++ lw.setSelection(n); ++ PacketControlAction action = null; ++ if (!doubleclick) { ++ action = new PacketControlAction(lw.getScreen(), lw, "click", lw.getSelectedRow()); ++ } else { ++ action = new PacketControlAction(lw.getScreen(), lw, "doubleclick", lw.getSelectedRow()); ++ } ++ ListWidgetItem current = lw.getSelectedItem(); ++ current.onClick(x - 5, y - currentHeight, doubleclick); ++ lw.onSelected(lw.getSelectedRow(), doubleclick); ++ if (lw instanceof ComboBoxView) { ++ PacketComboBox packet = new PacketComboBox(((ComboBoxView) lw).getComboBox()); ++ SpoutClient.getInstance().getPacketManager().sendSpoutPacket(packet); ++ } else { ++ SpoutClient.getInstance().getPacketManager().sendSpoutPacket(action); ++ } ++ ++ lastClick = System.currentTimeMillis(); ++ return true; ++ } ++ n++; ++ currentHeight += item.getHeight(); ++ } ++ return false; ++ } ++ ++ private boolean handleClickOnScrollable(Scrollable lw, int mouseX, int mouseY) { ++ int x = (int) (mouseX - lw.getActualX()); ++ int y = (int) (mouseY - lw.getActualY()); ++ int scrollY = lw.getScrollPosition(Orientation.VERTICAL); ++ int scrollX = lw.getScrollPosition(Orientation.HORIZONTAL); ++ if (x > lw.getWidth() - 16 && lw.needsScrollBar(Orientation.VERTICAL)) { ++ double scrollFactor = 0; ++ double p = (double) scrollY / (double) lw.getMaximumScrollPosition(Orientation.VERTICAL); ++ scrollFactor = 3 + p * (lw.getViewportSize(Orientation.VERTICAL) - 16.0 - 6.0); ++ if (scrollFactor <= y && y <= scrollFactor + 16) { ++ holding = lw; ++ holdingScrollBar = Orientation.VERTICAL; ++ } ++ } ++ if (y > lw.getHeight() - 16 && lw.needsScrollBar(Orientation.HORIZONTAL)) { ++ double scrollFactor = 0; ++ double p = (double) scrollX / (double) lw.getMaximumScrollPosition(Orientation.HORIZONTAL); ++ scrollFactor = 3 + p * (lw.getViewportSize(Orientation.HORIZONTAL) - 16.0 - 6.0); ++ if (scrollFactor <= x && x <= scrollFactor + 16) { ++ holding = lw; ++ holdingScrollBar = Orientation.HORIZONTAL; ++ } ++ } ++ if (holding != null) { ++ return true; ++ } ++ return false; ++ } ++ ++ private void handleButtonClick(Button control) { ++ if (control instanceof CheckBox) { ++ CheckBox check = (CheckBox) control; ++ check.setChecked(!check.isChecked()); ++ } ++ if (control instanceof RadioButton) { ++ RadioButton radio = (RadioButton) control; ++ radio.setSelected(true); ++ } ++ this.buttonClicked((Button) control); ++ SpoutClient.getInstance().getPacketManager().sendSpoutPacket(new PacketControlAction(screen, control, 1)); ++ ((Button) control).onButtonClick(); ++ if (control instanceof GenericComboBox) { ++ PacketComboBox packet = new PacketComboBox((GenericComboBox) control); ++ SpoutClient.getInstance().getPacketManager().sendSpoutPacket(packet); ++ } ++ } ++ // Spout End ++ ++ /** ++ * store a string in the system clipboard ++ */ ++ public static void setClipboardString(String par0Str) { ++ try { ++ StringSelection var1 = new StringSelection(par0Str); + Toolkit.getDefaultToolkit().getSystemClipboard().setContents(var1, (ClipboardOwner)null); + } catch (Exception var2) { ++ ; + } +- + } + +- protected void mouseClicked(int var1, int var2, int var3) { +- if(var3 == 0) { +- for(int var4 = 0; var4 < this.i.size(); ++var4) { +- GuiButton var5 = (GuiButton)this.i.get(var4); +- if(var5.mousePressed(this.mc, var1, var2)) { ++ /** ++ * Called when the mouse is clicked. ++ */ ++ protected void mouseClicked(int par1, int par2, int par3) { ++ if (par3 == 0) { ++ for (int var4 = 0; var4 < this.buttonList.size(); ++var4) { ++ GuiButton var5 = (GuiButton)this.buttonList.get(var4); ++ ++ if (var5.mousePressed(this.mc, par1, par2)) { + this.selectedButton = var5; + this.mc.sndManager.playSoundFX("random.click", 1.0F, 1.0F); + this.actionPerformed(var5); + } + } + } +- +- } +- +- protected void mouseMovedOrUp(int var1, int var2, int var3) { +- if(this.selectedButton != null && var3 == 0) { +- this.selectedButton.mouseReleased(var1, var2); ++ } ++ // Spout Start ++ protected void mouseMovedOrUpPre(int mouseX, int mouseY, int eventButton) { ++ lastMouseMove = System.currentTimeMillis(); ++ mouseMovedOrUp(mouseX, mouseY, eventButton); ++ if (getScreen() == null) { ++ return; ++ } ++ screen.setMouseX(mouseX); ++ screen.setMouseY(mouseY); ++ for (Widget widget : screen.getAttachedWidgets(true)) { ++ if (widget instanceof Control) { ++ Control control = (Control) widget; ++ if (control.isEnabled() && control.isVisible()) { ++ if (eventButton == 0) { ++ if (control.isFocus() && !isInBoundingRect(control, mouseX, mouseY)) { // released control ++ control.setFocus(false); ++ } ++ if (control instanceof Slider && ((Slider) control).isDragging()) { ++ ((Slider) control).setDragging(false); ++ SpoutClient.getInstance().getPacketManager().sendSpoutPacket(new PacketControlAction(screen, control, ((Slider) control).getSliderPosition())); ++ ((Slider) control).onSliderDrag(((Slider) control).getSliderPosition(), ((Slider) control).getSliderPosition()); ++ } ++ } ++ } ++ } ++ } ++ if (holding != null && holdingScrollBar != null) { ++ double p = 0; ++ if (holdingScrollBar == Orientation.VERTICAL) { ++ int y = (int) (mouseY - holding.getActualY()); ++ p = (double) y / holding.getViewportSize(Orientation.VERTICAL); ++ } else { ++ int x = (int) (mouseX - holding.getActualX()); ++ p = (double) x / holding.getViewportSize(Orientation.HORIZONTAL); ++ } ++ holding.setScrollPosition(holdingScrollBar, (int) ((double) holding.getMaximumScrollPosition(holdingScrollBar) * p)); ++ ++ if (eventButton == 0) { ++ holding = null; ++ } ++ } ++ } ++ ++ protected boolean shouldShowTooltip() { ++ return !Configuration.isDelayedTooltips() || System.currentTimeMillis() - TOOLTIP_DELAY > lastMouseMove; ++ } ++ // Spout End ++ ++ /** ++ * Called when the mouse is moved or a mouse button is released. Signature: (mouseX, mouseY, which) which==-1 is ++ * mouseMove, which==0 or which==1 is mouseUp ++ */ ++ protected void mouseMovedOrUp(int par1, int par2, int par3) { ++ if (this.selectedButton != null && par3 == 0) { ++ this.selectedButton.mouseReleased(par1, par2); + this.selectedButton = null; + } +- +- } +- +- protected void mouseClickMove(int var1, int var2, int var3, long var4) { +- } +- +- protected void actionPerformed(GuiButton var1) { +- } +- +- public void setWorldAndResolution(Minecraft var1, int var2, int var3) { +- this.mc = var1; +- this.fontRenderer = var1.fontRenderer; +- this.width = var2; +- this.height = var3; +- this.i.clear(); ++ } ++ ++ /** ++ * Called when a mouse button is pressed and the mouse is moved around. Parameters are : mouseX, mouseY, ++ * lastButtonClicked & timeSinceMouseClick. ++ */ ++ protected void mouseClickMove(int par1, int par2, int par3, long par4) {} ++ ++ /** ++ * Fired when a control is clicked. This is the equivalent of ActionListener.actionPerformed(ActionEvent e). ++ */ ++ protected void actionPerformed(GuiButton par1GuiButton) {} ++ ++ /** ++ * Causes the screen to lay out its subcomponents again. This is the equivalent of the Java call Container.validate() ++ */ ++ public void setWorldAndResolution(Minecraft par1Minecraft, int par2, int par3) { ++ this.mc = par1Minecraft; ++ this.guiParticles = new GuiParticle(par1Minecraft); ++ this.fontRenderer = par1Minecraft.fontRenderer; ++ this.width = par2; ++ this.height = par3; ++ this.buttonList.clear(); ++ // Spout Start ++ if (!(this instanceof CustomScreen) && screen != null && !firstrun) { ++ for (Widget w : screen.getAttachedWidgets()) { ++ screen.removeWidget(w); ++ } ++ } ++ firstrun = false; ++ bg = (GenericGradient) new GenericGradient().setHeight(this.height).setWidth(this.width); ++ // Spout End + this.initGui(); + } + +- public void initGui() { +- } ++ /** ++ * Adds the buttons (and other controls) to the screen in question. ++ */ ++ public void initGui() {} + ++ /** ++ * Delegates mouse and keyboard input. ++ */ + public void handleInput() { +- while(Mouse.next()) { ++ while (Mouse.next()) { + this.handleMouseInput(); + } + +- while(Keyboard.next()) { ++ while (Keyboard.next()) { ++ // Spout Start ++ if (mc.thePlayer instanceof EntityClientPlayerMP && SpoutClient.getInstance().isSpoutEnabled()) { ++ EntityClientPlayerMP player = (EntityClientPlayerMP) mc.thePlayer; ++ ScreenType screen = ScreenUtil.getType(this); ++ int i = Keyboard.getEventKey(); ++ boolean keyReleased = Keyboard.getEventKeyState(); ++ PacketKeyPress packet = new PacketKeyPress(i, keyReleased, (MovementInputFromOptions) player.movementInput, screen); ++ SpoutClient.getInstance().getPacketManager().sendSpoutPacket(packet); ++ } ++ ((SimpleKeyBindingManager)SpoutClient.getInstance().getKeyBindingManager()).pressKey(Keyboard.getEventKey(), Keyboard.getEventKeyState(), ScreenUtil.getType(this).getCode()); ++ // Spout End + this.handleKeyboardInput(); + } +- + } + ++ /** ++ * Handles mouse input. ++ */ ++ // Spout Start - Rewritten ++ // ToDo: needs a rewritten rewrite AND Mac keybind toggle. + public void handleMouseInput() { +- int var1 = Mouse.getEventX() * this.width / this.mc.displayWidth; +- int var2 = this.height - Mouse.getEventY() * this.height / this.mc.displayHeight - 1; +- int var3 = Mouse.getEventButton(); +- if(Minecraft.isRunningOnMac && var3 == 0 && (Keyboard.isKeyDown(Keyboard.KEY_LCONTROL) || Keyboard.isKeyDown(Keyboard.KEY_RCONTROL))) { +- var3 = 1; +- } +- +- if(Mouse.getEventButtonState()) { +- if(this.mc.gameSettings.touchscreen && this.field_92018_d++ > 0) { +- return; +- } +- +- this.eventButton = var3; +- this.lastMouseEvent = Minecraft.getSystemTime(); +- this.mouseClicked(var1, var2, this.eventButton); +- } else if(var3 != -1) { +- if(this.mc.gameSettings.touchscreen && --this.field_92018_d > 0) { +- return; +- } +- +- this.eventButton = -1; +- this.mouseMovedOrUp(var1, var2, var3); +- } else if(this.eventButton != -1 && this.lastMouseEvent > 0L) { +- long var4 = Minecraft.getSystemTime() - this.lastMouseEvent; +- this.mouseClickMove(var1, var2, this.eventButton, var4); +- } +- +- } +- ++ int x; ++ int y; ++ if (Mouse.getEventButtonState()) { ++ if (this.mc.gameSettings.touchscreen && this.field_92018_d++ > 0) { ++ return; ++ } ++ x = Mouse.getEventX() * this.width / this.mc.displayWidth; ++ y = this.height - Mouse.getEventY() * this.height / this.mc.displayHeight - 1; ++ this.mouseClickedPre(x, y, Mouse.getEventButton()); ++ } else { ++ if (this.mc.gameSettings.touchscreen && this.field_92018_d++ > 0) { ++ return; ++ } ++ x = Mouse.getEventX() * this.width / this.mc.displayWidth; ++ y = this.height - Mouse.getEventY() * this.height / this.mc.displayHeight - 1; ++ this.mouseMovedOrUpPre(x, y, Mouse.getEventButton()); ++ } ++ int scroll = Mouse.getEventDWheel(); ++ if (scroll != 0) { ++ scroll *= 7; ++ handleScroll(x, y, scroll); ++ } ++ } ++ ++ protected void handleScroll(int x, int y, int scroll) { ++ Orientation axis = Orientation.VERTICAL; ++ if (Keyboard.isKeyDown(Keyboard.KEY_LSHIFT)) { ++ axis = Orientation.HORIZONTAL; ++ } ++ for (Widget w : getScreen().getAttachedWidgets(true)) { ++ if (w != null && isInBoundingRect(w, x, y)) { ++ if (w instanceof Scrollable) { ++ // Stupid LWJGL not recognizing vertical scrolls :( ++ Scrollable lw = (Scrollable) w; ++ if (axis == Orientation.VERTICAL) { ++ lw.scroll(0, -scroll / 30); ++ } else { ++ lw.scroll(-scroll / 30, 0); ++ } ++ PacketControlAction action = new PacketControlAction(lw.getScreen() != null ? lw.getScreen() : getScreen(), lw, axis.toString(), lw.getScrollPosition(axis)); ++ SpoutClient.getInstance().getPacketManager().sendSpoutPacket(action); ++ } ++ } ++ } ++ } ++ // Spout End ++ ++ /** ++ * Handles keyboard input. ++ */ ++ // ToDo: needs isMacOS variations added. + public void handleKeyboardInput() { +- if(Keyboard.getEventKeyState()) { +- int var1 = Keyboard.getEventKey(); +- char var2 = Keyboard.getEventCharacter(); +- if(var1 == 87) { +- this.mc.toggleFullscreen(); +- return; +- } +- +- this.keyTyped(var2, var1); +- } +- ++ // Spout Start ++ boolean handled = false; ++ if (Keyboard.getEventKey() == Keyboard.KEY_ESCAPE) { ++ Keyboard.enableRepeatEvents(false); ++ } else if (getScreen() != null) { ++ boolean tab = Keyboard.getEventKey() == Keyboard.KEY_TAB; ++ TextField focusedTF = null; ++ ConcurrentSkipListMap tabIndexMap = tab ? new ConcurrentSkipListMap() : null; ++ ++ for (Widget widget : screen.getAttachedWidgets(true)) { ++ if (widget instanceof Control) { ++ Control control = (Control) widget; ++ if (control.isFocus()) { ++ if (Keyboard.getEventKeyState()) { ++ handled = control.onKeyPressed(org.spoutcraft.api.gui.Keyboard.getKey(Keyboard.getEventKey())); ++ } else { ++ handled = control.onKeyReleased(org.spoutcraft.api.gui.Keyboard.getKey(Keyboard.getEventKey())); ++ } ++ } ++ if (handled) { ++ break; ++ } ++ } ++ if (!Keyboard.getEventKeyState()) { ++ break; ++ } ++ if (widget instanceof TextField) { ++ TextField tf = (TextField) widget; ++ // Handle tabbing get all textfields of this screen and start looking for the next bigger tab-index ++ if (tab) { ++ if (tf.isFocus()) { ++ focusedTF = tf; ++ } ++ tabIndexMap.put(tf.getTabIndex(), tf); ++ // Pass typed key to text processor ++ } else if (tf.isEnabled() && tf.isFocus()) { ++ if (tf.getTextProcessor().handleInput(Keyboard.getEventCharacter(), Keyboard.getEventKey())) { ++ tf.onTextFieldChange(); ++ ScheduledTextFieldUpdate updateThread = null; ++ if (scheduledTextFieldUpdates.containsKey(tf)) { ++ updateThread = scheduledTextFieldUpdates.get(tf); ++ if (updateThread.isAlive()) { ++ updateThread.delay(); ++ } else { ++ updateThread.start(); ++ } ++ } else { ++ updateThread = new ScheduledTextFieldUpdate(screen, tf); ++ scheduledTextFieldUpdates.put(tf, updateThread); ++ updateThread.start(); ++ } ++ } ++ handled = true; ++ break; ++ } ++ } ++ if (widget instanceof ListWidget) { ++ ListWidget lw = (ListWidget) widget; ++ if (lw.isEnabled() && lw.isFocus()) { ++ PacketControlAction action = null; ++ if (Keyboard.getEventKey() == Keyboard.KEY_DOWN && Keyboard.getEventKeyState()) { ++ handled = true; ++ lw.shiftSelection(1); ++ lw.onSelected(lw.getSelectedRow(), false); ++ lw.getSelectedItem().onClick(-1, -1, false); ++ action = new PacketControlAction(lw.getScreen() != null ? lw.getScreen() : getScreen(), lw, "selected", lw.getSelectedRow()); ++ } ++ if (Keyboard.getEventKey() == Keyboard.KEY_UP && Keyboard.getEventKeyState()) { ++ handled = true; ++ lw.shiftSelection(-1); ++ lw.onSelected(lw.getSelectedRow(), false); ++ lw.getSelectedItem().onClick(-1, -1, false); ++ action = new PacketControlAction(lw.getScreen() != null ? lw.getScreen() : getScreen(), lw, "selected", lw.getSelectedRow()); ++ } ++ if (Keyboard.getEventKey() == Keyboard.KEY_RETURN && Keyboard.getEventKeyState()) { ++ handled = true; ++ if (lw.getSelectedRow() != -1) { ++ lw.onSelected(lw.getSelectedRow(), true); ++ lw.getSelectedItem().onClick(-1, -1, true); ++ action = new PacketControlAction(lw.getScreen() != null ? lw.getScreen() : getScreen(), lw, "doubleclick", lw.getSelectedRow()); ++ } ++ } ++ if (action != null) { ++ SpoutClient.getInstance().getPacketManager().sendSpoutPacket(action); ++ break; ++ } ++ } ++ } ++ } ++ ++ // Start looking for the next bigger tab-index ++ if (tab && focusedTF != null) { ++ Integer index = tabIndexMap.higherKey(focusedTF.getTabIndex()); ++ if (index == null) { ++ index = tabIndexMap.ceilingKey(0); ++ } ++ if (index != null) { ++ focusedTF.setFocus(false); ++ tabIndexMap.get(index).setFocus(true); ++ handled = true; ++ } ++ } ++ } ++ if (!handled) { ++ // Start of vanilla code - got wrapped with this if ++ if (Keyboard.getEventKeyState()) { ++ if (Keyboard.getEventKey() == 87) { ++ this.mc.toggleFullscreen(); ++ return; ++ } ++ this.keyTyped(Keyboard.getEventCharacter(), Keyboard.getEventKey()); ++ } ++ // End of vanilla code ++ } ++ // Spout End + } + ++ /** ++ * Called from the main game loop to update the screen. ++ */ ++ // Spout Start + public void updateScreen() { +- } +- +- public void onGuiClosed() { +- } +- ++ updateTicks++; ++ MCRenderDelegate.shouldRenderCursor = updateTicks / 6 % 2 == 0; ++ } ++ // Spout End ++ ++ /** ++ * Called when the screen is unloaded. Used to disable keyboard repeat events ++ */ ++ public void onGuiClosed() {} ++ ++ /** ++ * Draws either a gradient over the background screen (when it exists) or a flat gradient over background.png ++ */ + public void drawDefaultBackground() { + this.drawWorldBackground(0); + } + +- public void drawWorldBackground(int var1) { +- if(this.mc.theWorld != null) { ++ public void drawWorldBackground(int par1) { ++ if (this.mc.theWorld != null) { + this.drawGradientRect(0, 0, this.width, this.height, -1072689136, -804253680); + } else { +- this.drawBackground(var1); ++ this.drawBackground(par1); + } +- + } + +- public void drawBackground(int var1) { ++ /** ++ * Draws the background (i is always 0 as of 1.2.2) ++ */ ++ public void drawBackground(int par1) { + GL11.glDisable(GL11.GL_LIGHTING); + GL11.glDisable(GL11.GL_FOG); + Tessellator var2 = Tessellator.instance; +@@ -183,25 +826,174 @@ + float var3 = 32.0F; + var2.startDrawingQuads(); + var2.setColorOpaque_I(4210752); +- var2.addVertexWithUV(0.0D, (double)this.height, 0.0D, 0.0D, (double)((float)this.height / var3 + (float)var1)); +- var2.addVertexWithUV((double)this.width, (double)this.height, 0.0D, (double)((float)this.width / var3), (double)((float)this.height / var3 + (float)var1)); +- var2.addVertexWithUV((double)this.width, 0.0D, 0.0D, (double)((float)this.width / var3), (double)var1); +- var2.addVertexWithUV(0.0D, 0.0D, 0.0D, 0.0D, (double)var1); ++ var2.addVertexWithUV(0.0D, (double)this.height, 0.0D, 0.0D, (double)((float)this.height / var3 + (float)par1)); ++ var2.addVertexWithUV((double)this.width, (double)this.height, 0.0D, (double)((float)this.width / var3), (double)((float)this.height / var3 + (float)par1)); ++ var2.addVertexWithUV((double)this.width, 0.0D, 0.0D, (double)((float)this.width / var3), (double)par1); ++ var2.addVertexWithUV(0.0D, 0.0D, 0.0D, 0.0D, (double)par1); + var2.draw(); + } + ++ /** ++ * Returns true if this GUI should pause the game when it is displayed in single-player ++ */ + public boolean doesGuiPauseGame() { + return true; + } + +- public void confirmClicked(boolean var1, int var2) { +- } ++ public void confirmClicked(boolean par1, int par2) {} ++ ++ // Spout Start ++ public void drawWidgets(int x, int y, float z) { ++ if (getScreen() == null) { ++ return; ++ } ++ // Draw ALL the widgets! ++ screen.render(); ++ if (shouldShowTooltip()) { ++ drawTooltips(x, y); ++ } ++ } ++ ++ // Note: already inside of the sandbox ++ protected void drawTooltips(int x, int y) { ++ // Draw the tooltip! ++ String tooltip = ""; ++ // Widget tooltipWidget = null; ++ for (RenderPriority priority : RenderPriority.values()) { ++ for (Widget widget : screen.getAttachedWidgets(true)) { // We need ALL the tooltips now ++ if (widget.getPriority() == priority) { ++ if (widget.isVisible() && isInBoundingRect(widget, x, y) && widget.getTooltip() != null && !widget.getTooltip().equals("")) { ++ if (widget.getScreen() instanceof Scrollable) { ++ if (!isInBoundingRect(widget.getScreen(), x, y)) { ++ continue; ++ } ++ } ++ tooltip = widget.getTooltip(); ++ //tooltipWidget = widget; ++ // No return here, when a widget that is over it comes next, tooltip will be overwritten. ++ } else if (widget.getTooltip() == null && widget.isVisible()) { ++ return; ++ } ++ } ++ } ++ } ++ ++ if (!tooltip.equals("")) { ++ drawTooltip(tooltip, x, y); ++ } ++ } ++ ++ public void drawTooltip(String tooltip, int x, int y) { ++ GL11.glPushMatrix(); ++ String lines[] = this.fontRenderer.wrapFormattedStringToWidth(tooltip,(width-22)).split("\n"); //Autowrap tooltips to reported screen width ++ int tooltipWidth = 0; ++ int tooltipHeight = 8 * lines.length + 3; ++ for (String line : lines) { ++ tooltipWidth = Math.max(this.fontRenderer.getStringWidth(line), tooltipWidth); ++ } ++ int offsetX = 0; ++ if (x + tooltipWidth > width) { ++ offsetX = -tooltipWidth - 11; ++ if (offsetX + x < 0) { ++ offsetX = -x; ++ } ++ } ++ int offsetY = 0; ++ if (y + tooltipHeight + 2 > height) { ++ offsetY = -tooltipHeight; ++ if (offsetY + y < 0) { ++ offsetY = -y; ++ } ++ } ++ ++ x += 6; ++ y -= 6; ++ ++ int j2 = 0; ++ for (int k2 = 0; k2 < lines.length; k2++) { ++ int i3 = fontRenderer.getStringWidth(lines[k2]); ++ if (i3 > j2) { ++ j2 = i3; ++ } ++ } ++ ++ int l2 = x + offsetX; ++ int j3 = y + offsetY; ++ int k3 = j2; ++ int l3 = 8; ++ if (lines.length > 1) { ++ l3 += (lines.length - 1) * 10; ++ } ++ // zLevel = 300F; ++ int i4 = 0xf0100010; ++ drawGradientRect(l2 - 3, j3 - 4, l2 + k3 + 3, j3 - 3, i4, i4); ++ drawGradientRect(l2 - 3, j3 + l3 + 3, l2 + k3 + 3, j3 + l3 + 4, i4, i4); ++ drawGradientRect(l2 - 3, j3 - 3, l2 + k3 + 3, j3 + l3 + 3, i4, i4); ++ drawGradientRect(l2 - 4, j3 - 3, l2 - 3, j3 + l3 + 3, i4, i4); ++ drawGradientRect(l2 + k3 + 3, j3 - 3, l2 + k3 + 4, j3 + l3 + 3, i4, i4); ++ int j4 = 0x505000ff; ++ int k4 = (j4 & 0xfefefe) >> 1 | j4 & 0xff000000; ++ drawGradientRect(l2 - 3, (j3 - 3) + 1, (l2 - 3) + 1, (j3 + l3 + 3) - 1, j4, k4); ++ drawGradientRect(l2 + k3 + 2, (j3 - 3) + 1, l2 + k3 + 3, (j3 + l3 + 3) - 1, j4, k4); ++ drawGradientRect(l2 - 3, j3 - 3, l2 + k3 + 3, (j3 - 3) + 1, j4, j4); ++ drawGradientRect(l2 - 3, j3 + l3 + 2, l2 + k3 + 3, j3 + l3 + 3, k4, k4); ++ ++ this.drawGradientRect(x - 3 + offsetX, y - 3 + offsetY, x + tooltipWidth + 3 + offsetX, y + tooltipHeight + offsetY, -1073741824, -1073741824); ++ ++ //int i = 0; ++ GL11.glColor4f(1f, 1f, 1f, 1f); ++ for (String line : lines) { ++ this.fontRenderer.drawStringWithShadow(line, l2, j3, -1); ++ j3 += 10; ++ } ++ GL11.glPopMatrix(); ++ } ++ ++ public boolean isInBoundingRect(Widget widget, int x, int y) { ++ int left = (int) widget.getActualX(); ++ int top = (int) widget.getActualY(); ++ int height = (int) widget.getHeight(); ++ int width = (int) widget.getWidth(); ++ int right = left + width; ++ int bottom = top + height; ++ if (left <= x && x < right && top <= y && y < bottom) { ++ return true; ++ } ++ return false; ++ } ++ ++ public boolean isInBoundingRect(int widgetX, int widgetY, int height, int width, int x, int y) { ++ int left = widgetX; ++ int top = widgetY; ++ int right = left + width; ++ int bottom = top + height; ++ if (left <= x && x < right && top <= y && y < bottom) { ++ return true; ++ } ++ return false; ++ } ++ ++ public Screen getScreen() { ++ if (screen == null) { ++ ScreenType type = ScreenUtil.getType(this); ++ if (type == ScreenType.GAME_SCREEN || type == ScreenType.CUSTOM_SCREEN) { ++ return screen; ++ } ++ screen = new GenericOverlayScreen(); ++ ((OverlayScreen) screen).setScreenType(type); ++ } ++ return screen; ++ } ++ ++ protected void buttonClicked(Button btn) { ++ } ++ // Spout End + + public static boolean isCtrlKeyDown() { +- return Minecraft.isRunningOnMac ? Keyboard.isKeyDown(Keyboard.KEY_LMETA) || Keyboard.isKeyDown(Keyboard.KEY_RMETA) : Keyboard.isKeyDown(Keyboard.KEY_LCONTROL) || Keyboard.isKeyDown(Keyboard.KEY_RCONTROL); ++ return Minecraft.isRunningOnMac ? Keyboard.isKeyDown(219) || Keyboard.isKeyDown(220) : Keyboard.isKeyDown(29) || Keyboard.isKeyDown(157); + } + + public static boolean isShiftKeyDown() { +- return Keyboard.isKeyDown(Keyboard.KEY_LSHIFT) || Keyboard.isKeyDown(Keyboard.KEY_RSHIFT); ++ return Keyboard.isKeyDown(42) || Keyboard.isKeyDown(54); + } + } diff --git a/patches/net/minecraft/src/GuiScreenAddServer.java.patch b/patches/net/minecraft/src/GuiScreenAddServer.java.patch new file mode 100644 index 0000000..2cef221 --- /dev/null +++ b/patches/net/minecraft/src/GuiScreenAddServer.java.patch @@ -0,0 +1,148 @@ +--- net/minecraft/src/GuiScreenAddServer.java ++++ net/minecraft/src/GuiScreenAddServer.java +@@ -3,84 +3,109 @@ + import org.lwjgl.input.Keyboard; + + public class GuiScreenAddServer extends GuiScreen { ++ ++ /** This GUI's parent GUI. */ + private GuiScreen parentGui; + private GuiTextField serverAddress; + private GuiTextField serverName; ++ ++ /** ServerData to be modified by this GUI */ + private ServerData newServerData; + +- public GuiScreenAddServer(GuiScreen var1, ServerData var2) { +- this.parentGui = var1; +- this.newServerData = var2; ++ public GuiScreenAddServer(GuiScreen par1GuiScreen, ServerData par2ServerData) { ++ this.parentGui = par1GuiScreen; ++ this.newServerData = par2ServerData; + } + ++ /** ++ * Called from the main game loop to update the screen. ++ */ + public void updateScreen() { + this.serverName.updateCursorCounter(); + this.serverAddress.updateCursorCounter(); + } + ++ /** ++ * Adds the buttons (and other controls) to the screen in question. ++ */ + public void initGui() { + Keyboard.enableRepeatEvents(true); +- this.i.clear(); +- this.i.add(new GuiButton(0, this.width / 2 - 100, this.height / 4 + 96 + 12, I18n.getString("addServer.add"))); +- this.i.add(new GuiButton(1, this.width / 2 - 100, this.height / 4 + 120 + 12, I18n.getString("gui.cancel"))); +- this.i.add(new GuiButton(2, this.width / 2 - 100, 142, I18n.getString("addServer.hideAddress") + ": " + (this.newServerData.isHidingAddress() ? I18n.getString("gui.yes") : I18n.getString("gui.no")))); ++ this.buttonList.clear(); ++ this.buttonList.add(new GuiButton(0, this.width / 2 - 100, this.height / 4 + 96 + 12, I18n.getString("addServer.add"))); ++ this.buttonList.add(new GuiButton(1, this.width / 2 - 100, this.height / 4 + 120 + 12, I18n.getString("gui.cancel"))); ++ this.buttonList.add(new GuiButton(2, this.width / 2 - 100, 142, I18n.getString("addServer.hideAddress") + ": " + (this.newServerData.isHidingAddress() ? I18n.getString("gui.yes") : I18n.getString("gui.no")))); + this.serverName = new GuiTextField(this.fontRenderer, this.width / 2 - 100, 66, 200, 20); + this.serverName.setFocused(true); +- this.serverName.setText(this.newServerData.a); ++ this.serverName.setText(this.newServerData.serverName); + this.serverAddress = new GuiTextField(this.fontRenderer, this.width / 2 - 100, 106, 200, 20); + this.serverAddress.setMaxStringLength(128); +- this.serverAddress.setText(this.newServerData.b); +- ((GuiButton)this.i.get(0)).enabled = this.serverAddress.getText().length() > 0 && this.serverAddress.getText().split(":").length > 0 && this.serverName.getText().length() > 0; ++ this.serverAddress.setText(this.newServerData.serverIP); ++ ((GuiButton)this.buttonList.get(0)).enabled = this.serverAddress.getText().length() > 0 && this.serverAddress.getText().split(":").length > 0 && this.serverName.getText().length() > 0; + } + ++ /** ++ * Called when the screen is unloaded. Used to disable keyboard repeat events ++ */ + public void onGuiClosed() { + Keyboard.enableRepeatEvents(false); + } + +- protected void actionPerformed(GuiButton var1) { +- if(var1.enabled) { +- if(var1.id == 1) { ++ /** ++ * Fired when a control is clicked. This is the equivalent of ActionListener.actionPerformed(ActionEvent e). ++ */ ++ protected void actionPerformed(GuiButton par1GuiButton) { ++ if (par1GuiButton.enabled) { ++ if (par1GuiButton.id == 1) { + this.parentGui.confirmClicked(false, 0); +- } else if(var1.id == 0) { +- this.newServerData.a = this.serverName.getText(); +- this.newServerData.b = this.serverAddress.getText(); ++ } else if (par1GuiButton.id == 0) { ++ this.newServerData.serverName = this.serverName.getText(); ++ this.newServerData.serverIP = this.serverAddress.getText(); + this.parentGui.confirmClicked(true, 0); +- } else if(var1.id == 2) { ++ } else if (par1GuiButton.id == 2) { + this.newServerData.setHideAddress(!this.newServerData.isHidingAddress()); +- ((GuiButton)this.i.get(2)).f = I18n.getString("addServer.hideAddress") + ": " + (this.newServerData.isHidingAddress() ? I18n.getString("gui.yes") : I18n.getString("gui.no")); ++ ((GuiButton)this.buttonList.get(2)).displayString = I18n.getString("addServer.hideAddress") + ": " + (this.newServerData.isHidingAddress() ? I18n.getString("gui.yes") : I18n.getString("gui.no")); + } +- + } + } + +- protected void keyTyped(char var1, int var2) { +- this.serverName.textboxKeyTyped(var1, var2); +- this.serverAddress.textboxKeyTyped(var1, var2); +- if(var2 == 15) { ++ /** ++ * Fired when a key is typed. This is the equivalent of KeyListener.keyTyped(KeyEvent e). ++ */ ++ protected void keyTyped(char par1, int par2) { ++ this.serverName.textboxKeyTyped(par1, par2); ++ this.serverAddress.textboxKeyTyped(par1, par2); ++ ++ if (par2 == 15) { + this.serverName.setFocused(!this.serverName.isFocused()); + this.serverAddress.setFocused(!this.serverAddress.isFocused()); + } + +- if(var2 == 28 || var2 == 156) { +- this.actionPerformed((GuiButton)this.i.get(0)); ++ if (par2 == 28 || par2 == 156) { ++ this.actionPerformed((GuiButton)this.buttonList.get(0)); + } + +- ((GuiButton)this.i.get(0)).enabled = this.serverAddress.getText().length() > 0 && this.serverAddress.getText().split(":").length > 0 && this.serverName.getText().length() > 0; +- } +- +- protected void mouseClicked(int var1, int var2, int var3) { +- super.mouseClicked(var1, var2, var3); +- this.serverAddress.mouseClicked(var1, var2, var3); +- this.serverName.mouseClicked(var1, var2, var3); +- } +- +- public void drawScreen(int var1, int var2, float var3) { ++ ((GuiButton)this.buttonList.get(0)).enabled = this.serverAddress.getText().length() > 0 && this.serverAddress.getText().split(":").length > 0 && this.serverName.getText().length() > 0; ++ } ++ ++ /** ++ * Called when the mouse is clicked. ++ */ ++ protected void mouseClicked(int par1, int par2, int par3) { ++ super.mouseClicked(par1, par2, par3); ++ this.serverAddress.mouseClicked(par1, par2, par3); ++ this.serverName.mouseClicked(par1, par2, par3); ++ } ++ ++ /** ++ * Draws the screen and all the components in it. ++ */ ++ public void drawScreen(int par1, int par2, float par3) { + this.drawDefaultBackground(); + this.drawCenteredString(this.fontRenderer, I18n.getString("addServer.title"), this.width / 2, 17, 16777215); + this.drawString(this.fontRenderer, I18n.getString("addServer.enterName"), this.width / 2 - 100, 53, 10526880); + this.drawString(this.fontRenderer, I18n.getString("addServer.enterIp"), this.width / 2 - 100, 94, 10526880); + this.serverName.drawTextBox(); + this.serverAddress.drawTextBox(); +- super.drawScreen(var1, var2, var3); ++ super.drawScreen(par1, par2, par3); + } + } diff --git a/patches/net/minecraft/src/GuiScreenBackup.java.patch b/patches/net/minecraft/src/GuiScreenBackup.java.patch new file mode 100644 index 0000000..d4b60c2 --- /dev/null +++ b/patches/net/minecraft/src/GuiScreenBackup.java.patch @@ -0,0 +1,202 @@ +--- net/minecraft/src/GuiScreenBackup.java ++++ net/minecraft/src/GuiScreenBackup.java +@@ -7,120 +7,129 @@ + public class GuiScreenBackup extends GuiScreen { + private final GuiScreenConfigureWorld field_110380_a; + private final long field_110377_b; +- private List c = Collections.emptyList(); ++ private List field_110378_c = Collections.emptyList(); + private GuiScreenBackupSelectionList field_110375_d; + private int field_110376_e = -1; + private GuiButton field_110379_p; + +- public GuiScreenBackup(GuiScreenConfigureWorld var1, long var2) { +- this.field_110380_a = var1; +- this.field_110377_b = var2; ++ public GuiScreenBackup(GuiScreenConfigureWorld par1GuiScreenConfigureWorld, long par2) { ++ this.field_110380_a = par1GuiScreenConfigureWorld; ++ this.field_110377_b = par2; + } + ++ /** ++ * Adds the buttons (and other controls) to the screen in question. ++ */ + public void initGui() { + Keyboard.enableRepeatEvents(true); +- this.i.clear(); ++ this.buttonList.clear(); + this.field_110375_d = new GuiScreenBackupSelectionList(this); + (new GuiScreenBackupDownloadThread(this)).start(); + this.func_110369_g(); + } + + private void func_110369_g() { +- this.i.add(new GuiButton(0, this.width / 2 + 6, this.height - 52, 153, 20, I18n.getString("gui.back"))); +- this.i.add(this.field_110379_p = new GuiButton(1, this.width / 2 - 154, this.height - 52, 153, 20, I18n.getString("mco.backup.button.restore"))); ++ this.buttonList.add(new GuiButton(0, this.width / 2 + 6, this.height - 52, 153, 20, I18n.getString("gui.back"))); ++ this.buttonList.add(this.field_110379_p = new GuiButton(1, this.width / 2 - 154, this.height - 52, 153, 20, I18n.getString("mco.backup.button.restore"))); + } + ++ /** ++ * Called from the main game loop to update the screen. ++ */ + public void updateScreen() { + super.updateScreen(); + } + +- protected void actionPerformed(GuiButton var1) { +- if(var1.enabled) { +- if(var1.id == 1) { ++ /** ++ * Fired when a control is clicked. This is the equivalent of ActionListener.actionPerformed(ActionEvent e). ++ */ ++ protected void actionPerformed(GuiButton par1GuiButton) { ++ if (par1GuiButton.enabled) { ++ if (par1GuiButton.id == 1) { + String var2 = I18n.getString("mco.configure.world.restore.question.line1"); + String var3 = I18n.getString("mco.configure.world.restore.question.line2"); + this.mc.displayGuiScreen(new GuiScreenConfirmation(this, GuiScreenConfirmationType.Warning, var2, var3, 1)); +- } else if(var1.id == 0) { ++ } else if (par1GuiButton.id == 0) { + this.mc.displayGuiScreen(this.field_110380_a); + } else { +- this.field_110375_d.actionPerformed(var1); ++ this.field_110375_d.actionPerformed(par1GuiButton); + } +- + } + } + +- public void confirmClicked(boolean var1, int var2) { +- if(var1 && var2 == 1) { ++ public void confirmClicked(boolean par1, int par2) { ++ if (par1 && par2 == 1) { + this.func_110374_h(); + } else { + this.mc.displayGuiScreen(this); + } +- + } + + private void func_110374_h() { +- if(this.field_110376_e >= 0 && this.field_110376_e < this.c.size()) { +- Backup var1 = (Backup)this.c.get(this.field_110376_e); ++ if (this.field_110376_e >= 0 && this.field_110376_e < this.field_110378_c.size()) { ++ Backup var1 = (Backup)this.field_110378_c.get(this.field_110376_e); + GuiScreenBackupRestoreTask var2 = new GuiScreenBackupRestoreTask(this, var1, (GuiScreenBackupDownloadThread)null); + GuiScreenLongRunningTask var3 = new GuiScreenLongRunningTask(this.mc, this.field_110380_a, var2); + var3.func_98117_g(); + this.mc.displayGuiScreen(var3); + } +- + } + +- public void drawScreen(int var1, int var2, float var3) { ++ /** ++ * Draws the screen and all the components in it. ++ */ ++ public void drawScreen(int par1, int par2, float par3) { + this.drawDefaultBackground(); +- this.field_110375_d.drawScreen(var1, var2, var3); ++ this.field_110375_d.drawScreen(par1, par2, par3); + this.drawCenteredString(this.fontRenderer, I18n.getString("mco.backup.title"), this.width / 2, 20, 16777215); +- super.drawScreen(var1, var2, var3); +- } +- +- static Minecraft func_110366_a(GuiScreenBackup var0) { +- return var0.mc; +- } +- +- static List func_110373_a(GuiScreenBackup var0, List var1) { +- return var0.c = var1; +- } +- +- static long func_110367_b(GuiScreenBackup var0) { +- return var0.field_110377_b; +- } +- +- static Minecraft func_130030_c(GuiScreenBackup var0) { +- return var0.mc; +- } +- +- static GuiScreenConfigureWorld func_130031_d(GuiScreenBackup var0) { +- return var0.field_110380_a; +- } +- +- static Minecraft func_130035_e(GuiScreenBackup var0) { +- return var0.mc; +- } +- +- static Minecraft func_130036_f(GuiScreenBackup var0) { +- return var0.mc; +- } +- +- static List func_110370_e(GuiScreenBackup var0) { +- return var0.c; +- } +- +- static int func_130029_a(GuiScreenBackup var0, int var1) { +- return var0.field_110376_e = var1; +- } +- +- static int func_130034_h(GuiScreenBackup var0) { +- return var0.field_110376_e; +- } +- +- static FontRenderer func_130032_i(GuiScreenBackup var0) { +- return var0.fontRenderer; +- } +- +- static FontRenderer func_130033_j(GuiScreenBackup var0) { +- return var0.fontRenderer; ++ super.drawScreen(par1, par2, par3); ++ } ++ ++ static Minecraft func_110366_a(GuiScreenBackup par0GuiScreenBackup) { ++ return par0GuiScreenBackup.mc; ++ } ++ ++ static List func_110373_a(GuiScreenBackup par0GuiScreenBackup, List par1List) { ++ return par0GuiScreenBackup.field_110378_c = par1List; ++ } ++ ++ static long func_110367_b(GuiScreenBackup par0GuiScreenBackup) { ++ return par0GuiScreenBackup.field_110377_b; ++ } ++ ++ static Minecraft func_130030_c(GuiScreenBackup par0GuiScreenBackup) { ++ return par0GuiScreenBackup.mc; ++ } ++ ++ static GuiScreenConfigureWorld func_130031_d(GuiScreenBackup par0GuiScreenBackup) { ++ return par0GuiScreenBackup.field_110380_a; ++ } ++ ++ static Minecraft func_130035_e(GuiScreenBackup par0GuiScreenBackup) { ++ return par0GuiScreenBackup.mc; ++ } ++ ++ static Minecraft func_130036_f(GuiScreenBackup par0GuiScreenBackup) { ++ return par0GuiScreenBackup.mc; ++ } ++ ++ static List func_110370_e(GuiScreenBackup par0GuiScreenBackup) { ++ return par0GuiScreenBackup.field_110378_c; ++ } ++ ++ static int func_130029_a(GuiScreenBackup par0GuiScreenBackup, int par1) { ++ return par0GuiScreenBackup.field_110376_e = par1; ++ } ++ ++ static int func_130034_h(GuiScreenBackup par0GuiScreenBackup) { ++ return par0GuiScreenBackup.field_110376_e; ++ } ++ ++ static FontRenderer func_130032_i(GuiScreenBackup par0GuiScreenBackup) { ++ return par0GuiScreenBackup.fontRenderer; ++ } ++ ++ static FontRenderer func_130033_j(GuiScreenBackup par0GuiScreenBackup) { ++ return par0GuiScreenBackup.fontRenderer; + } + } diff --git a/patches/net/minecraft/src/GuiScreenBackupDownloadThread.java.patch b/patches/net/minecraft/src/GuiScreenBackupDownloadThread.java.patch new file mode 100644 index 0000000..dc5f1a4 --- /dev/null +++ b/patches/net/minecraft/src/GuiScreenBackupDownloadThread.java.patch @@ -0,0 +1,24 @@ +--- net/minecraft/src/GuiScreenBackupDownloadThread.java ++++ net/minecraft/src/GuiScreenBackupDownloadThread.java +@@ -3,18 +3,17 @@ + class GuiScreenBackupDownloadThread extends Thread { + final GuiScreenBackup field_111250_a; + +- GuiScreenBackupDownloadThread(GuiScreenBackup var1) { +- this.field_111250_a = var1; ++ GuiScreenBackupDownloadThread(GuiScreenBackup par1GuiScreenBackup) { ++ this.field_111250_a = par1GuiScreenBackup; + } + + public void run() { + McoClient var1 = new McoClient(GuiScreenBackup.func_110366_a(this.field_111250_a).getSession()); + + try { +- GuiScreenBackup.func_110373_a(this.field_111250_a, var1.func_111232_c(GuiScreenBackup.func_110367_b(this.field_111250_a)).a); ++ GuiScreenBackup.func_110373_a(this.field_111250_a, var1.func_111232_c(GuiScreenBackup.func_110367_b(this.field_111250_a)).field_111223_a); + } catch (ExceptionMcoService var3) { + GuiScreenBackup.func_130030_c(this.field_111250_a).getLogAgent().logSevere(var3.toString()); + } +- + } + } diff --git a/patches/net/minecraft/src/GuiScreenBackupRestoreTask.java.patch b/patches/net/minecraft/src/GuiScreenBackupRestoreTask.java.patch new file mode 100644 index 0000000..22afbf5 --- /dev/null +++ b/patches/net/minecraft/src/GuiScreenBackupRestoreTask.java.patch @@ -0,0 +1,44 @@ +--- net/minecraft/src/GuiScreenBackupRestoreTask.java ++++ net/minecraft/src/GuiScreenBackupRestoreTask.java +@@ -1,12 +1,16 @@ + package net.minecraft.src; + + class GuiScreenBackupRestoreTask extends TaskLongRunning { ++ ++ /** The backup being restored */ + private final Backup theBackup; ++ ++ /** The screen running this task */ + final GuiScreenBackup theBackupScreen; + +- private GuiScreenBackupRestoreTask(GuiScreenBackup var1, Backup var2) { +- this.theBackupScreen = var1; +- this.theBackup = var2; ++ private GuiScreenBackupRestoreTask(GuiScreenBackup par1GuiScreenBackup, Backup par2Backup) { ++ this.theBackupScreen = par1GuiScreenBackup; ++ this.theBackup = par2Backup; + } + + public void run() { +@@ -14,7 +18,7 @@ + + try { + McoClient var1 = new McoClient(this.getMinecraft().getSession()); +- var1.func_111235_c(GuiScreenBackup.func_110367_b(this.theBackupScreen), this.theBackup.a); ++ var1.func_111235_c(GuiScreenBackup.func_110367_b(this.theBackupScreen), this.theBackup.field_110727_a); + + try { + Thread.sleep(1000L); +@@ -29,10 +33,9 @@ + } catch (Exception var5) { + this.setFailedMessage(var5.getLocalizedMessage()); + } +- + } + +- GuiScreenBackupRestoreTask(GuiScreenBackup var1, Backup var2, GuiScreenBackupDownloadThread var3) { +- this(var1, var2); ++ GuiScreenBackupRestoreTask(GuiScreenBackup par1GuiScreenBackup, Backup par2Backup, GuiScreenBackupDownloadThread par3GuiScreenBackupDownloadThread) { ++ this(par1GuiScreenBackup, par2Backup); + } + } diff --git a/patches/net/minecraft/src/GuiScreenBackupSelectionList.java.patch b/patches/net/minecraft/src/GuiScreenBackupSelectionList.java.patch new file mode 100644 index 0000000..6020e41 --- /dev/null +++ b/patches/net/minecraft/src/GuiScreenBackupSelectionList.java.patch @@ -0,0 +1,107 @@ +--- net/minecraft/src/GuiScreenBackupSelectionList.java ++++ net/minecraft/src/GuiScreenBackupSelectionList.java +@@ -7,26 +7,35 @@ + class GuiScreenBackupSelectionList extends GuiScreenSelectLocation { + final GuiScreenBackup field_111249_a; + +- public GuiScreenBackupSelectionList(GuiScreenBackup var1) { +- super(GuiScreenBackup.func_130036_f(var1), var1.width, var1.height, 32, var1.height - 64, 36); +- this.field_111249_a = var1; ++ public GuiScreenBackupSelectionList(GuiScreenBackup par1GuiScreenBackup) { ++ super(GuiScreenBackup.func_130036_f(par1GuiScreenBackup), par1GuiScreenBackup.width, par1GuiScreenBackup.height, 32, par1GuiScreenBackup.height - 64, 36); ++ this.field_111249_a = par1GuiScreenBackup; + } + ++ /** ++ * Gets the size of the current slot list. ++ */ + protected int getSize() { + return GuiScreenBackup.func_110370_e(this.field_111249_a).size() + 1; + } + +- protected void elementClicked(int var1, boolean var2) { +- if(var1 < GuiScreenBackup.func_110370_e(this.field_111249_a).size()) { +- GuiScreenBackup.func_130029_a(this.field_111249_a, var1); ++ /** ++ * the element in the slot that was clicked, boolean for wether it was double clicked or not ++ */ ++ protected void elementClicked(int par1, boolean par2) { ++ if (par1 < GuiScreenBackup.func_110370_e(this.field_111249_a).size()) { ++ GuiScreenBackup.func_130029_a(this.field_111249_a, par1); + } + } + +- protected boolean isSelected(int var1) { +- return var1 == GuiScreenBackup.func_130034_h(this.field_111249_a); ++ /** ++ * returns true if the element passed in is currently selected ++ */ ++ protected boolean isSelected(int par1) { ++ return par1 == GuiScreenBackup.func_130034_h(this.field_111249_a); + } + +- protected boolean func_104086_b(int var1) { ++ protected boolean func_104086_b(int par1) { + return false; + } + +@@ -38,36 +47,37 @@ + this.field_111249_a.drawDefaultBackground(); + } + +- protected void drawSlot(int var1, int var2, int var3, int var4, Tessellator var5) { +- if(var1 < GuiScreenBackup.func_110370_e(this.field_111249_a).size()) { +- this.func_111246_b(var1, var2, var3, var4, var5); ++ protected void drawSlot(int par1, int par2, int par3, int par4, Tessellator par5Tessellator) { ++ if (par1 < GuiScreenBackup.func_110370_e(this.field_111249_a).size()) { ++ this.func_111246_b(par1, par2, par3, par4, par5Tessellator); + } +- +- } +- +- private void func_111246_b(int var1, int var2, int var3, int var4, Tessellator var5) { +- Backup var6 = (Backup)GuiScreenBackup.func_110370_e(this.field_111249_a).get(var1); +- this.field_111249_a.drawString(GuiScreenBackup.func_130032_i(this.field_111249_a), "Backup (" + this.func_111248_a(Long.valueOf(MinecraftServer.getCurrentTimeMillis() - var6.b.getTime())) + ")", var2 + 2, var3 + 1, 16777215); +- this.field_111249_a.drawString(GuiScreenBackup.func_130033_j(this.field_111249_a), this.func_111247_a(var6.b), var2 + 2, var3 + 12, 7105644); +- } +- +- private String func_111247_a(Date var1) { +- return DateFormat.getDateTimeInstance(3, 3).format(var1); +- } +- +- private String func_111248_a(Long var1) { +- if(var1.longValue() < 0L) { ++ } ++ ++ private void func_111246_b(int par1, int par2, int par3, int par4, Tessellator par5Tessellator) { ++ Backup var6 = (Backup)GuiScreenBackup.func_110370_e(this.field_111249_a).get(par1); ++ this.field_111249_a.drawString(GuiScreenBackup.func_130032_i(this.field_111249_a), "Backup (" + this.func_111248_a(Long.valueOf(MinecraftServer.getSystemTimeMillis() - var6.field_110725_b.getTime())) + ")", par2 + 2, par3 + 1, 16777215); ++ this.field_111249_a.drawString(GuiScreenBackup.func_130033_j(this.field_111249_a), this.func_111247_a(var6.field_110725_b), par2 + 2, par3 + 12, 7105644); ++ } ++ ++ private String func_111247_a(Date par1Date) { ++ return DateFormat.getDateTimeInstance(3, 3).format(par1Date); ++ } ++ ++ private String func_111248_a(Long par1) { ++ if (par1.longValue() < 0L) { + return "right now"; + } else { +- long var2 = var1.longValue() / 1000L; +- if(var2 < 60L) { ++ long var2 = par1.longValue() / 1000L; ++ ++ if (var2 < 60L) { + return (var2 == 1L ? "1 second" : var2 + " seconds") + " ago"; + } else { + long var4; +- if(var2 < 3600L) { ++ ++ if (var2 < 3600L) { + var4 = var2 / 60L; + return (var4 == 1L ? "1 minute" : var4 + " minutes") + " ago"; +- } else if(var2 < 86400L) { ++ } else if (var2 < 86400L) { + var4 = var2 / 3600L; + return (var4 == 1L ? "1 hour" : var4 + " hours") + " ago"; + } else { diff --git a/patches/net/minecraft/src/GuiScreenBook.java.patch b/patches/net/minecraft/src/GuiScreenBook.java.patch new file mode 100644 index 0000000..4c199af --- /dev/null +++ b/patches/net/minecraft/src/GuiScreenBook.java.patch @@ -0,0 +1,460 @@ +--- net/minecraft/src/GuiScreenBook.java ++++ net/minecraft/src/GuiScreenBook.java +@@ -7,73 +7,93 @@ + + public class GuiScreenBook extends GuiScreen { + private static final ResourceLocation bookGuiTextures = new ResourceLocation("textures/gui/book.png"); ++ ++ /** The player editing the book */ + private final EntityPlayer editingPlayer; + private final ItemStack itemstackBook; ++ ++ /** Whether the book is signed or can still be edited */ + private final boolean bookIsUnsigned; + private boolean bookModified; + private boolean editingTitle; ++ ++ /** Update ticks since the gui was opened */ + private int updateCount; + private int bookImageWidth = 192; + private int bookImageHeight = 192; + private int bookTotalPages = 1; + private int currPage; + private NBTTagList bookPages; +- private String w = ""; ++ private String bookTitle = ""; + private GuiButtonNextPage buttonNextPage; + private GuiButtonNextPage buttonPreviousPage; + private GuiButton buttonDone; ++ ++ /** The GuiButton to sign this book. */ + private GuiButton buttonSign; + private GuiButton buttonFinalize; + private GuiButton buttonCancel; + +- public GuiScreenBook(EntityPlayer var1, ItemStack var2, boolean var3) { +- this.editingPlayer = var1; +- this.itemstackBook = var2; +- this.bookIsUnsigned = var3; +- if(var2.hasTagCompound()) { +- NBTTagCompound var4 = var2.getTagCompound(); ++ public GuiScreenBook(EntityPlayer par1EntityPlayer, ItemStack par2ItemStack, boolean par3) { ++ this.editingPlayer = par1EntityPlayer; ++ this.itemstackBook = par2ItemStack; ++ this.bookIsUnsigned = par3; ++ ++ if (par2ItemStack.hasTagCompound()) { ++ NBTTagCompound var4 = par2ItemStack.getTagCompound(); + this.bookPages = var4.getTagList("pages"); +- if(this.bookPages != null) { ++ ++ if (this.bookPages != null) { + this.bookPages = (NBTTagList)this.bookPages.copy(); + this.bookTotalPages = this.bookPages.tagCount(); +- if(this.bookTotalPages < 1) { ++ ++ if (this.bookTotalPages < 1) { + this.bookTotalPages = 1; + } + } + } + +- if(this.bookPages == null && var3) { ++ if (this.bookPages == null && par3) { + this.bookPages = new NBTTagList("pages"); + this.bookPages.appendTag(new NBTTagString("1", "")); + this.bookTotalPages = 1; + } +- + } + ++ /** ++ * Called from the main game loop to update the screen. ++ */ + public void updateScreen() { + super.updateScreen(); + ++this.updateCount; + } + ++ /** ++ * Adds the buttons (and other controls) to the screen in question. ++ */ + public void initGui() { +- this.i.clear(); ++ this.buttonList.clear(); + Keyboard.enableRepeatEvents(true); +- if(this.bookIsUnsigned) { +- this.i.add(this.buttonSign = new GuiButton(3, this.width / 2 - 100, 4 + this.bookImageHeight, 98, 20, I18n.getString("book.signButton"))); +- this.i.add(this.buttonDone = new GuiButton(0, this.width / 2 + 2, 4 + this.bookImageHeight, 98, 20, I18n.getString("gui.done"))); +- this.i.add(this.buttonFinalize = new GuiButton(5, this.width / 2 - 100, 4 + this.bookImageHeight, 98, 20, I18n.getString("book.finalizeButton"))); +- this.i.add(this.buttonCancel = new GuiButton(4, this.width / 2 + 2, 4 + this.bookImageHeight, 98, 20, I18n.getString("gui.cancel"))); ++ ++ if (this.bookIsUnsigned) { ++ this.buttonList.add(this.buttonSign = new GuiButton(3, this.width / 2 - 100, 4 + this.bookImageHeight, 98, 20, I18n.getString("book.signButton"))); ++ this.buttonList.add(this.buttonDone = new GuiButton(0, this.width / 2 + 2, 4 + this.bookImageHeight, 98, 20, I18n.getString("gui.done"))); ++ this.buttonList.add(this.buttonFinalize = new GuiButton(5, this.width / 2 - 100, 4 + this.bookImageHeight, 98, 20, I18n.getString("book.finalizeButton"))); ++ this.buttonList.add(this.buttonCancel = new GuiButton(4, this.width / 2 + 2, 4 + this.bookImageHeight, 98, 20, I18n.getString("gui.cancel"))); + } else { +- this.i.add(this.buttonDone = new GuiButton(0, this.width / 2 - 100, 4 + this.bookImageHeight, 200, 20, I18n.getString("gui.done"))); ++ this.buttonList.add(this.buttonDone = new GuiButton(0, this.width / 2 - 100, 4 + this.bookImageHeight, 200, 20, I18n.getString("gui.done"))); + } + + int var1 = (this.width - this.bookImageWidth) / 2; + byte var2 = 2; +- this.i.add(this.buttonNextPage = new GuiButtonNextPage(1, var1 + 120, var2 + 154, true)); +- this.i.add(this.buttonPreviousPage = new GuiButtonNextPage(2, var1 + 38, var2 + 154, false)); ++ this.buttonList.add(this.buttonNextPage = new GuiButtonNextPage(1, var1 + 120, var2 + 154, true)); ++ this.buttonList.add(this.buttonPreviousPage = new GuiButtonNextPage(2, var1 + 38, var2 + 154, false)); + this.updateButtons(); + } + ++ /** ++ * Called when the screen is unloaded. Used to disable keyboard repeat events ++ */ + public void onGuiClosed() { + Keyboard.enableRepeatEvents(false); + } +@@ -82,28 +102,29 @@ + this.buttonNextPage.drawButton = !this.editingTitle && (this.currPage < this.bookTotalPages - 1 || this.bookIsUnsigned); + this.buttonPreviousPage.drawButton = !this.editingTitle && this.currPage > 0; + this.buttonDone.drawButton = !this.bookIsUnsigned || !this.editingTitle; +- if(this.bookIsUnsigned) { ++ ++ if (this.bookIsUnsigned) { + this.buttonSign.drawButton = !this.editingTitle; + this.buttonCancel.drawButton = this.editingTitle; + this.buttonFinalize.drawButton = this.editingTitle; +- this.buttonFinalize.enabled = this.w.trim().length() > 0; ++ this.buttonFinalize.enabled = this.bookTitle.trim().length() > 0; + } +- + } + +- private void sendBookToServer(boolean var1) { +- if(this.bookIsUnsigned && this.bookModified) { +- if(this.bookPages != null) { +- while(this.bookPages.tagCount() > 1) { ++ private void sendBookToServer(boolean par1) { ++ if (this.bookIsUnsigned && this.bookModified) { ++ if (this.bookPages != null) { ++ while (this.bookPages.tagCount() > 1) { + NBTTagString var2 = (NBTTagString)this.bookPages.tagAt(this.bookPages.tagCount() - 1); +- if(var2.a != null && var2.a.length() != 0) { ++ ++ if (var2.data != null && var2.data.length() != 0) { + break; + } + + this.bookPages.removeTag(this.bookPages.tagCount() - 1); + } + +- if(this.itemstackBook.hasTagCompound()) { ++ if (this.itemstackBook.hasTagCompound()) { + NBTTagCompound var7 = this.itemstackBook.getTagCompound(); + var7.setTag("pages", this.bookPages); + } else { +@@ -111,10 +132,11 @@ + } + + String var8 = "MC|BEdit"; +- if(var1) { ++ ++ if (par1) { + var8 = "MC|BSign"; + this.itemstackBook.setTagInfo("author", new NBTTagString("author", this.editingPlayer.getCommandSenderName())); +- this.itemstackBook.setTagInfo("title", new NBTTagString("title", this.w.trim())); ++ this.itemstackBook.setTagInfo("title", new NBTTagString("title", this.bookTitle.trim())); + this.itemstackBook.itemID = Item.writtenBook.itemID; + } + +@@ -128,34 +150,37 @@ + var6.printStackTrace(); + } + } +- + } + } + +- protected void actionPerformed(GuiButton var1) { +- if(var1.enabled) { +- if(var1.id == 0) { ++ /** ++ * Fired when a control is clicked. This is the equivalent of ActionListener.actionPerformed(ActionEvent e). ++ */ ++ protected void actionPerformed(GuiButton par1GuiButton) { ++ if (par1GuiButton.enabled) { ++ if (par1GuiButton.id == 0) { + this.mc.displayGuiScreen((GuiScreen)null); + this.sendBookToServer(false); +- } else if(var1.id == 3 && this.bookIsUnsigned) { ++ } else if (par1GuiButton.id == 3 && this.bookIsUnsigned) { + this.editingTitle = true; +- } else if(var1.id == 1) { +- if(this.currPage < this.bookTotalPages - 1) { ++ } else if (par1GuiButton.id == 1) { ++ if (this.currPage < this.bookTotalPages - 1) { + ++this.currPage; +- } else if(this.bookIsUnsigned) { ++ } else if (this.bookIsUnsigned) { + this.addNewPage(); +- if(this.currPage < this.bookTotalPages - 1) { ++ ++ if (this.currPage < this.bookTotalPages - 1) { + ++this.currPage; + } + } +- } else if(var1.id == 2) { +- if(this.currPage > 0) { ++ } else if (par1GuiButton.id == 2) { ++ if (this.currPage > 0) { + --this.currPage; + } +- } else if(var1.id == 5 && this.editingTitle) { ++ } else if (par1GuiButton.id == 5 && this.editingTitle) { + this.sendBookToServer(true); + this.mc.displayGuiScreen((GuiScreen)null); +- } else if(var1.id == 4 && this.editingTitle) { ++ } else if (par1GuiButton.id == 4 && this.editingTitle) { + this.editingTitle = false; + } + +@@ -164,80 +189,91 @@ + } + + private void addNewPage() { +- if(this.bookPages != null && this.bookPages.tagCount() < 50) { ++ if (this.bookPages != null && this.bookPages.tagCount() < 50) { + this.bookPages.appendTag(new NBTTagString("" + (this.bookTotalPages + 1), "")); + ++this.bookTotalPages; + this.bookModified = true; + } + } + +- protected void keyTyped(char var1, int var2) { +- super.keyTyped(var1, var2); +- if(this.bookIsUnsigned) { +- if(this.editingTitle) { +- this.func_74162_c(var1, var2); ++ /** ++ * Fired when a key is typed. This is the equivalent of KeyListener.keyTyped(KeyEvent e). ++ */ ++ protected void keyTyped(char par1, int par2) { ++ super.keyTyped(par1, par2); ++ ++ if (this.bookIsUnsigned) { ++ if (this.editingTitle) { ++ this.func_74162_c(par1, par2); + } else { +- this.keyTypedInBook(var1, var2); ++ this.keyTypedInBook(par1, par2); + } +- +- } +- } +- +- private void keyTypedInBook(char var1, int var2) { +- switch(var1) { +- case '\u0016': +- this.func_74160_b(GuiScreen.getClipboardString()); +- return; +- default: +- switch(var2) { ++ } ++ } ++ ++ /** ++ * Processes keystrokes when editing the text of a book ++ */ ++ private void keyTypedInBook(char par1, int par2) { ++ switch (par1) { ++ case 22: ++ this.func_74160_b(GuiScreen.getClipboardString()); ++ return; ++ ++ default: ++ switch (par2) { ++ case 14: ++ String var3 = this.func_74158_i(); ++ ++ if (var3.length() > 0) { ++ this.func_74159_a(var3.substring(0, var3.length() - 1)); ++ } ++ ++ return; ++ ++ case 28: ++ case 156: ++ this.func_74160_b("\n"); ++ return; ++ ++ default: ++ if (ChatAllowedCharacters.isAllowedCharacter(par1)) { ++ this.func_74160_b(Character.toString(par1)); ++ } ++ } ++ } ++ } ++ ++ private void func_74162_c(char par1, int par2) { ++ switch (par2) { + case 14: +- String var3 = this.func_74158_i(); +- if(var3.length() > 0) { +- this.func_74159_a(var3.substring(0, var3.length() - 1)); ++ if (!this.bookTitle.isEmpty()) { ++ this.bookTitle = this.bookTitle.substring(0, this.bookTitle.length() - 1); ++ this.updateButtons(); + } + + return; ++ + case 28: + case 156: +- this.func_74160_b("\n"); ++ if (!this.bookTitle.isEmpty()) { ++ this.sendBookToServer(true); ++ this.mc.displayGuiScreen((GuiScreen)null); ++ } ++ + return; ++ + default: +- if(ChatAllowedCharacters.isAllowedCharacter(var1)) { +- this.func_74160_b(Character.toString(var1)); ++ if (this.bookTitle.length() < 16 && ChatAllowedCharacters.isAllowedCharacter(par1)) { ++ this.bookTitle = this.bookTitle + Character.toString(par1); ++ this.updateButtons(); ++ this.bookModified = true; + } +- } +- } +- } +- +- private void func_74162_c(char var1, int var2) { +- switch(var2) { +- case 14: +- if(!this.w.isEmpty()) { +- this.w = this.w.substring(0, this.w.length() - 1); +- this.updateButtons(); +- } +- +- return; +- case 28: +- case 156: +- if(!this.w.isEmpty()) { +- this.sendBookToServer(true); +- this.mc.displayGuiScreen((GuiScreen)null); +- } +- +- return; +- default: +- if(this.w.length() < 16 && ChatAllowedCharacters.isAllowedCharacter(var1)) { +- this.w = this.w + Character.toString(var1); +- this.updateButtons(); +- this.bookModified = true; +- } +- + } + } + + private String func_74158_i() { +- if(this.bookPages != null && this.currPage >= 0 && this.currPage < this.bookPages.tagCount()) { ++ if (this.bookPages != null && this.currPage >= 0 && this.currPage < this.bookPages.tagCount()) { + NBTTagString var1 = (NBTTagString)this.bookPages.tagAt(this.currPage); + return var1.toString(); + } else { +@@ -245,26 +281,28 @@ + } + } + +- private void func_74159_a(String var1) { +- if(this.bookPages != null && this.currPage >= 0 && this.currPage < this.bookPages.tagCount()) { ++ private void func_74159_a(String par1Str) { ++ if (this.bookPages != null && this.currPage >= 0 && this.currPage < this.bookPages.tagCount()) { + NBTTagString var2 = (NBTTagString)this.bookPages.tagAt(this.currPage); +- var2.a = var1; ++ var2.data = par1Str; + this.bookModified = true; + } +- + } + +- private void func_74160_b(String var1) { ++ private void func_74160_b(String par1Str) { + String var2 = this.func_74158_i(); +- String var3 = var2 + var1; ++ String var3 = var2 + par1Str; + int var4 = this.fontRenderer.splitStringWidth(var3 + "" + EnumChatFormatting.BLACK + "_", 118); +- if(var4 <= 118 && var3.length() < 256) { ++ ++ if (var4 <= 118 && var3.length() < 256) { + this.func_74159_a(var3); + } +- + } + +- public void drawScreen(int var1, int var2, float var3) { ++ /** ++ * Draws the screen and all the components in it. ++ */ ++ public void drawScreen(int par1, int par2, float par3) { + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + this.mc.getTextureManager().bindTexture(bookGuiTextures); + int var4 = (this.width - this.bookImageWidth) / 2; +@@ -273,10 +311,12 @@ + String var6; + String var7; + int var8; +- if(this.editingTitle) { +- var6 = this.w; +- if(this.bookIsUnsigned) { +- if(this.updateCount / 6 % 2 == 0) { ++ ++ if (this.editingTitle) { ++ var6 = this.bookTitle; ++ ++ if (this.bookIsUnsigned) { ++ if (this.updateCount / 6 % 2 == 0) { + var6 = var6 + "" + EnumChatFormatting.BLACK + "_"; + } else { + var6 = var6 + "" + EnumChatFormatting.GRAY + "_"; +@@ -288,23 +328,24 @@ + this.fontRenderer.drawString(var7, var4 + 36 + (116 - var8) / 2, var5 + 16 + 16, 0); + int var9 = this.fontRenderer.getStringWidth(var6); + this.fontRenderer.drawString(var6, var4 + 36 + (116 - var9) / 2, var5 + 48, 0); +- String var10 = String.format(I18n.getString("book.byAuthor"), new Object[]{this.editingPlayer.getCommandSenderName()}); ++ String var10 = String.format(I18n.getString("book.byAuthor"), new Object[] {this.editingPlayer.getCommandSenderName()}); + int var11 = this.fontRenderer.getStringWidth(var10); + this.fontRenderer.drawString(EnumChatFormatting.DARK_GRAY + var10, var4 + 36 + (116 - var11) / 2, var5 + 48 + 10, 0); + String var12 = I18n.getString("book.finalizeWarning"); + this.fontRenderer.drawSplitString(var12, var4 + 36, var5 + 80, 116, 0); + } else { +- var6 = String.format(I18n.getString("book.pageIndicator"), new Object[]{Integer.valueOf(this.currPage + 1), Integer.valueOf(this.bookTotalPages)}); ++ var6 = String.format(I18n.getString("book.pageIndicator"), new Object[] {Integer.valueOf(this.currPage + 1), Integer.valueOf(this.bookTotalPages)}); + var7 = ""; +- if(this.bookPages != null && this.currPage >= 0 && this.currPage < this.bookPages.tagCount()) { ++ ++ if (this.bookPages != null && this.currPage >= 0 && this.currPage < this.bookPages.tagCount()) { + NBTTagString var13 = (NBTTagString)this.bookPages.tagAt(this.currPage); + var7 = var13.toString(); + } + +- if(this.bookIsUnsigned) { +- if(this.fontRenderer.getBidiFlag()) { ++ if (this.bookIsUnsigned) { ++ if (this.fontRenderer.getBidiFlag()) { + var7 = var7 + "_"; +- } else if(this.updateCount / 6 % 2 == 0) { ++ } else if (this.updateCount / 6 % 2 == 0) { + var7 = var7 + "" + EnumChatFormatting.BLACK + "_"; + } else { + var7 = var7 + "" + EnumChatFormatting.GRAY + "_"; +@@ -316,7 +357,7 @@ + this.fontRenderer.drawSplitString(var7, var4 + 36, var5 + 16 + 16, 116, 0); + } + +- super.drawScreen(var1, var2, var3); ++ super.drawScreen(par1, par2, par3); + } + + static ResourceLocation func_110404_g() { diff --git a/patches/net/minecraft/src/GuiScreenClientOutdated.java.patch b/patches/net/minecraft/src/GuiScreenClientOutdated.java.patch new file mode 100644 index 0000000..e38e0b6 --- /dev/null +++ b/patches/net/minecraft/src/GuiScreenClientOutdated.java.patch @@ -0,0 +1,68 @@ +--- net/minecraft/src/GuiScreenClientOutdated.java ++++ net/minecraft/src/GuiScreenClientOutdated.java +@@ -3,35 +3,45 @@ + public class GuiScreenClientOutdated extends GuiScreen { + private final GuiScreen previousScreen; + +- public GuiScreenClientOutdated(GuiScreen var1) { +- this.previousScreen = var1; ++ public GuiScreenClientOutdated(GuiScreen par1GuiScreen) { ++ this.previousScreen = par1GuiScreen; + } + ++ /** ++ * Adds the buttons (and other controls) to the screen in question. ++ */ + public void initGui() { +- this.i.clear(); +- this.i.add(new GuiButton(0, this.width / 2 - 100, this.height / 4 + 120 + 12, "Back")); ++ this.buttonList.clear(); ++ this.buttonList.add(new GuiButton(0, this.width / 2 - 100, this.height / 4 + 120 + 12, "Back")); + } + +- public void drawScreen(int var1, int var2, float var3) { ++ /** ++ * Draws the screen and all the components in it. ++ */ ++ public void drawScreen(int par1, int par2, float par3) { + this.drawDefaultBackground(); + String var4 = I18n.getString("mco.client.outdated.title"); + String var5 = I18n.getString("mco.client.outdated.msg"); + this.drawCenteredString(this.fontRenderer, var4, this.width / 2, this.height / 2 - 50, 16711680); + this.drawCenteredString(this.fontRenderer, var5, this.width / 2, this.height / 2 - 30, 16777215); +- super.drawScreen(var1, var2, var3); +- } +- +- protected void actionPerformed(GuiButton var1) { +- if(var1.id == 0) { +- this.mc.displayGuiScreen(this.previousScreen); +- } +- +- } +- +- protected void keyTyped(char var1, int var2) { +- if(var2 == 28 || var2 == 156) { +- this.mc.displayGuiScreen(this.previousScreen); +- } +- ++ super.drawScreen(par1, par2, par3); ++ } ++ ++ /** ++ * Fired when a control is clicked. This is the equivalent of ActionListener.actionPerformed(ActionEvent e). ++ */ ++ protected void actionPerformed(GuiButton par1GuiButton) { ++ if (par1GuiButton.id == 0) { ++ this.mc.displayGuiScreen(this.previousScreen); ++ } ++ } ++ ++ /** ++ * Fired when a key is typed. This is the equivalent of KeyListener.keyTyped(KeyEvent e). ++ */ ++ protected void keyTyped(char par1, int par2) { ++ if (par2 == 28 || par2 == 156) { ++ this.mc.displayGuiScreen(this.previousScreen); ++ } + } + } diff --git a/patches/net/minecraft/src/GuiScreenConfigureWorld.java.patch b/patches/net/minecraft/src/GuiScreenConfigureWorld.java.patch new file mode 100644 index 0000000..54e9a6f --- /dev/null +++ b/patches/net/minecraft/src/GuiScreenConfigureWorld.java.patch @@ -0,0 +1,339 @@ +--- net/minecraft/src/GuiScreenConfigureWorld.java ++++ net/minecraft/src/GuiScreenConfigureWorld.java +@@ -11,7 +11,7 @@ + private int field_96286_n; + private int field_96287_o; + private int field_96284_p = -1; +- private String r; ++ private String field_96283_q; + private GuiButton field_96281_r; + private GuiButton field_96279_s; + private GuiButton field_96278_t; +@@ -22,35 +22,41 @@ + private GuiButton field_110381_z; + private boolean field_102020_y; + +- public GuiScreenConfigureWorld(GuiScreen var1, McoServer var2) { +- this.field_96285_a = var1; +- this.field_96280_b = var2; +- } +- +- public void updateScreen() { +- } +- ++ public GuiScreenConfigureWorld(GuiScreen par1GuiScreen, McoServer par2McoServer) { ++ this.field_96285_a = par1GuiScreen; ++ this.field_96280_b = par2McoServer; ++ } ++ ++ /** ++ * Called from the main game loop to update the screen. ++ */ ++ public void updateScreen() {} ++ ++ /** ++ * Adds the buttons (and other controls) to the screen in question. ++ */ + public void initGui() { + this.field_96277_d = this.width / 2 - 200; + this.field_96286_n = 180; + this.field_96287_o = this.width / 2; + Keyboard.enableRepeatEvents(true); +- this.i.clear(); +- if(this.field_96280_b.d.equals("CLOSED")) { +- this.i.add(this.field_96281_r = new GuiButton(0, this.field_96277_d, this.func_96264_a(12), this.field_96286_n / 2 - 2, 20, I18n.getString("mco.configure.world.buttons.open"))); ++ this.buttonList.clear(); ++ ++ if (this.field_96280_b.field_96404_d.equals("CLOSED")) { ++ this.buttonList.add(this.field_96281_r = new GuiButton(0, this.field_96277_d, this.func_96264_a(12), this.field_96286_n / 2 - 2, 20, I18n.getString("mco.configure.world.buttons.open"))); + this.field_96281_r.enabled = !this.field_96280_b.field_98166_h; + } else { +- this.i.add(this.field_96279_s = new GuiButton(1, this.field_96277_d, this.func_96264_a(12), this.field_96286_n / 2 - 2, 20, I18n.getString("mco.configure.world.buttons.close"))); ++ this.buttonList.add(this.field_96279_s = new GuiButton(1, this.field_96277_d, this.func_96264_a(12), this.field_96286_n / 2 - 2, 20, I18n.getString("mco.configure.world.buttons.close"))); + this.field_96279_s.enabled = !this.field_96280_b.field_98166_h; + } + +- this.i.add(this.field_98129_x = new GuiButton(7, this.field_96277_d + this.field_96286_n / 2 + 2, this.func_96264_a(12), this.field_96286_n / 2 - 2, 20, I18n.getString("mco.configure.world.buttons.subscription"))); +- this.i.add(this.field_96278_t = new GuiButton(5, this.field_96277_d, this.func_96264_a(10), this.field_96286_n / 2 - 2, 20, I18n.getString("mco.configure.world.buttons.edit"))); +- this.i.add(this.field_96276_u = new GuiButton(6, this.field_96277_d + this.field_96286_n / 2 + 2, this.func_96264_a(10), this.field_96286_n / 2 - 2, 20, I18n.getString("mco.configure.world.buttons.reset"))); +- this.i.add(this.field_98128_v = new GuiButton(4, this.field_96287_o, this.func_96264_a(10), this.field_96286_n / 2 - 2, 20, I18n.getString("mco.configure.world.buttons.invite"))); +- this.i.add(this.field_98127_w = new GuiButton(3, this.field_96287_o + this.field_96286_n / 2 + 2, this.func_96264_a(10), this.field_96286_n / 2 - 2, 20, I18n.getString("mco.configure.world.buttons.uninvite"))); +- this.i.add(this.field_110381_z = new GuiButton(8, this.field_96287_o, this.func_96264_a(12), this.field_96286_n / 2 - 2, 20, I18n.getString("mco.configure.world.buttons.backup"))); +- this.i.add(new GuiButton(10, this.field_96287_o + this.field_96286_n / 2 + 2, this.func_96264_a(12), this.field_96286_n / 2 - 2, 20, I18n.getString("gui.back"))); ++ this.buttonList.add(this.field_98129_x = new GuiButton(7, this.field_96277_d + this.field_96286_n / 2 + 2, this.func_96264_a(12), this.field_96286_n / 2 - 2, 20, I18n.getString("mco.configure.world.buttons.subscription"))); ++ this.buttonList.add(this.field_96278_t = new GuiButton(5, this.field_96277_d, this.func_96264_a(10), this.field_96286_n / 2 - 2, 20, I18n.getString("mco.configure.world.buttons.edit"))); ++ this.buttonList.add(this.field_96276_u = new GuiButton(6, this.field_96277_d + this.field_96286_n / 2 + 2, this.func_96264_a(10), this.field_96286_n / 2 - 2, 20, I18n.getString("mco.configure.world.buttons.reset"))); ++ this.buttonList.add(this.field_98128_v = new GuiButton(4, this.field_96287_o, this.func_96264_a(10), this.field_96286_n / 2 - 2, 20, I18n.getString("mco.configure.world.buttons.invite"))); ++ this.buttonList.add(this.field_98127_w = new GuiButton(3, this.field_96287_o + this.field_96286_n / 2 + 2, this.func_96264_a(10), this.field_96286_n / 2 - 2, 20, I18n.getString("mco.configure.world.buttons.uninvite"))); ++ this.buttonList.add(this.field_110381_z = new GuiButton(8, this.field_96287_o, this.func_96264_a(12), this.field_96286_n / 2 - 2, 20, I18n.getString("mco.configure.world.buttons.backup"))); ++ this.buttonList.add(new GuiButton(10, this.field_96287_o + this.field_96286_n / 2 + 2, this.func_96264_a(12), this.field_96286_n / 2 - 2, 20, I18n.getString("gui.back"))); + this.field_96282_c = new SelectionListInvited(this); + this.field_96278_t.enabled = !this.field_96280_b.field_98166_h; + this.field_96276_u.enabled = !this.field_96280_b.field_98166_h; +@@ -59,42 +65,47 @@ + this.field_110381_z.enabled = !this.field_96280_b.field_98166_h; + } + +- private int func_96264_a(int var1) { +- return 40 + var1 * 13; ++ private int func_96264_a(int par1) { ++ return 40 + par1 * 13; + } + ++ /** ++ * Called when the screen is unloaded. Used to disable keyboard repeat events ++ */ + public void onGuiClosed() { + Keyboard.enableRepeatEvents(false); + } + +- protected void actionPerformed(GuiButton var1) { +- if(var1.enabled) { +- if(var1.id == 10) { +- if(this.field_102020_y) { ++ /** ++ * Fired when a control is clicked. This is the equivalent of ActionListener.actionPerformed(ActionEvent e). ++ */ ++ protected void actionPerformed(GuiButton par1GuiButton) { ++ if (par1GuiButton.enabled) { ++ if (par1GuiButton.id == 10) { ++ if (this.field_102020_y) { + ((GuiScreenOnlineServers)this.field_96285_a).func_102018_a(this.field_96280_b.field_96408_a); + } + + this.mc.displayGuiScreen(this.field_96285_a); +- } else if(var1.id == 5) { ++ } else if (par1GuiButton.id == 5) { + this.mc.displayGuiScreen(new GuiScreenEditOnlineWorld(this, this.field_96285_a, this.field_96280_b)); +- } else if(var1.id == 1) { ++ } else if (par1GuiButton.id == 1) { + String var2 = I18n.getString("mco.configure.world.close.question.line1"); + String var3 = I18n.getString("mco.configure.world.close.question.line2"); + this.mc.displayGuiScreen(new GuiScreenConfirmation(this, GuiScreenConfirmationType.Info, var2, var3, 1)); +- } else if(var1.id == 0) { ++ } else if (par1GuiButton.id == 0) { + this.func_96268_g(); +- } else if(var1.id == 4) { ++ } else if (par1GuiButton.id == 4) { + this.mc.displayGuiScreen(new GuiScreenInvite(this.field_96285_a, this, this.field_96280_b)); +- } else if(var1.id == 3) { ++ } else if (par1GuiButton.id == 3) { + this.func_96272_i(); +- } else if(var1.id == 6) { ++ } else if (par1GuiButton.id == 6) { + this.mc.displayGuiScreen(new GuiScreenResetWorld(this, this.field_96280_b)); +- } else if(var1.id == 7) { ++ } else if (par1GuiButton.id == 7) { + this.mc.displayGuiScreen(new GuiScreenSubscription(this, this.field_96280_b)); +- } else if(var1.id == 8) { ++ } else if (par1GuiButton.id == 8) { + this.mc.displayGuiScreen(new GuiScreenBackup(this, this.field_96280_b.field_96408_a)); + } +- + } + } + +@@ -103,9 +114,10 @@ + + try { + Boolean var2 = var1.func_96383_b(this.field_96280_b.field_96408_a); +- if(var2.booleanValue()) { ++ ++ if (var2.booleanValue()) { + this.field_102020_y = true; +- this.field_96280_b.d = "OPEN"; ++ this.field_96280_b.field_96404_d = "OPEN"; + this.initGui(); + } + } catch (ExceptionMcoService var3) { +@@ -113,7 +125,6 @@ + } catch (IOException var4) { + this.mc.getLogAgent().logWarning("Realms: could not parse response"); + } +- + } + + private void func_96275_h() { +@@ -121,9 +132,10 @@ + + try { + boolean var2 = var1.func_96378_c(this.field_96280_b.field_96408_a).booleanValue(); +- if(var2) { ++ ++ if (var2) { + this.field_102020_y = true; +- this.field_96280_b.d = "CLOSED"; ++ this.field_96280_b.field_96404_d = "CLOSED"; + this.initGui(); + } + } catch (ExceptionMcoService var3) { +@@ -131,25 +143,23 @@ + } catch (IOException var4) { + this.mc.getLogAgent().logWarning("Realms: could not parse response"); + } +- + } + + private void func_96272_i() { +- if(this.field_96284_p >= 0 && this.field_96284_p < this.field_96280_b.f.size()) { +- this.r = (String)this.field_96280_b.f.get(this.field_96284_p); +- GuiYesNo var1 = new GuiYesNo(this, "Warning!", I18n.getString("mco.configure.world.uninvite.question") + " \'" + this.r + "\'", 3); ++ if (this.field_96284_p >= 0 && this.field_96284_p < this.field_96280_b.field_96402_f.size()) { ++ this.field_96283_q = (String)this.field_96280_b.field_96402_f.get(this.field_96284_p); ++ GuiYesNo var1 = new GuiYesNo(this, "Warning!", I18n.getString("mco.configure.world.uninvite.question") + " \'" + this.field_96283_q + "\'", 3); + this.mc.displayGuiScreen(var1); + } +- + } + +- public void confirmClicked(boolean var1, int var2) { +- if(var2 == 3) { +- if(var1) { ++ public void confirmClicked(boolean par1, int par2) { ++ if (par2 == 3) { ++ if (par1) { + McoClient var3 = new McoClient(this.mc.getSession()); + + try { +- var3.func_96381_a(this.field_96280_b.field_96408_a, this.r); ++ var3.func_96381_a(this.field_96280_b.field_96408_a, this.field_96283_q); + } catch (ExceptionMcoService var5) { + this.mc.getLogAgent().logSevere(var5.toString()); + } +@@ -160,30 +170,37 @@ + this.mc.displayGuiScreen(new GuiScreenConfigureWorld(this.field_96285_a, this.field_96280_b)); + } + +- if(var2 == 1) { +- if(var1) { ++ if (par2 == 1) { ++ if (par1) { + this.func_96275_h(); + } + + this.mc.displayGuiScreen(this); + } +- +- } +- +- private void func_96267_d(int var1) { +- this.field_96280_b.f.remove(var1); +- } +- +- protected void keyTyped(char var1, int var2) { +- } +- +- protected void mouseClicked(int var1, int var2, int var3) { +- super.mouseClicked(var1, var2, var3); +- } +- +- public void drawScreen(int var1, int var2, float var3) { ++ } ++ ++ private void func_96267_d(int par1) { ++ this.field_96280_b.field_96402_f.remove(par1); ++ } ++ ++ /** ++ * Fired when a key is typed. This is the equivalent of KeyListener.keyTyped(KeyEvent e). ++ */ ++ protected void keyTyped(char par1, int par2) {} ++ ++ /** ++ * Called when the mouse is clicked. ++ */ ++ protected void mouseClicked(int par1, int par2, int par3) { ++ super.mouseClicked(par1, par2, par3); ++ } ++ ++ /** ++ * Draws the screen and all the components in it. ++ */ ++ public void drawScreen(int par1, int par2, float par3) { + this.drawDefaultBackground(); +- this.field_96282_c.func_96612_a(var1, var2, var3); ++ this.field_96282_c.func_96612_a(par1, par2, par3); + this.drawCenteredString(this.fontRenderer, I18n.getString("mco.configure.world.title"), this.width / 2, 17, 16777215); + this.drawString(this.fontRenderer, I18n.getString("mco.configure.world.name"), this.field_96277_d, this.func_96264_a(1), 10526880); + this.drawString(this.fontRenderer, this.field_96280_b.func_96398_b(), this.field_96277_d, this.func_96264_a(2), 16777215); +@@ -192,47 +209,47 @@ + this.drawString(this.fontRenderer, I18n.getString("mco.configure.world.status"), this.field_96277_d, this.func_96264_a(7), 10526880); + this.drawString(this.fontRenderer, this.func_104045_j(), this.field_96277_d, this.func_96264_a(8), 16777215); + this.drawString(this.fontRenderer, I18n.getString("mco.configure.world.invited"), this.field_96287_o, this.func_96264_a(1), 10526880); +- super.drawScreen(var1, var2, var3); ++ super.drawScreen(par1, par2, par3); + } + + private String func_104045_j() { +- if(this.field_96280_b.field_98166_h) { ++ if (this.field_96280_b.field_98166_h) { + return "Expired"; + } else { +- String var1 = this.field_96280_b.d.toLowerCase(); ++ String var1 = this.field_96280_b.field_96404_d.toLowerCase(); + return Character.toUpperCase(var1.charAt(0)) + var1.substring(1); + } + } + +- static Minecraft getMinecraft(GuiScreenConfigureWorld var0) { +- return var0.mc; +- } +- +- static int func_96271_b(GuiScreenConfigureWorld var0) { +- return var0.field_96287_o; +- } +- +- static int func_96274_a(GuiScreenConfigureWorld var0, int var1) { +- return var0.func_96264_a(var1); +- } +- +- static int func_96269_c(GuiScreenConfigureWorld var0) { +- return var0.field_96286_n; +- } +- +- static McoServer func_96266_d(GuiScreenConfigureWorld var0) { +- return var0.field_96280_b; +- } +- +- static int func_96270_b(GuiScreenConfigureWorld var0, int var1) { +- return var0.field_96284_p = var1; +- } +- +- static int func_96263_e(GuiScreenConfigureWorld var0) { +- return var0.field_96284_p; +- } +- +- static FontRenderer func_96273_f(GuiScreenConfigureWorld var0) { +- return var0.fontRenderer; ++ static Minecraft getMinecraft(GuiScreenConfigureWorld par0GuiScreenConfigureWorld) { ++ return par0GuiScreenConfigureWorld.mc; ++ } ++ ++ static int func_96271_b(GuiScreenConfigureWorld par0GuiScreenConfigureWorld) { ++ return par0GuiScreenConfigureWorld.field_96287_o; ++ } ++ ++ static int func_96274_a(GuiScreenConfigureWorld par0GuiScreenConfigureWorld, int par1) { ++ return par0GuiScreenConfigureWorld.func_96264_a(par1); ++ } ++ ++ static int func_96269_c(GuiScreenConfigureWorld par0GuiScreenConfigureWorld) { ++ return par0GuiScreenConfigureWorld.field_96286_n; ++ } ++ ++ static McoServer func_96266_d(GuiScreenConfigureWorld par0GuiScreenConfigureWorld) { ++ return par0GuiScreenConfigureWorld.field_96280_b; ++ } ++ ++ static int func_96270_b(GuiScreenConfigureWorld par0GuiScreenConfigureWorld, int par1) { ++ return par0GuiScreenConfigureWorld.field_96284_p = par1; ++ } ++ ++ static int func_96263_e(GuiScreenConfigureWorld par0GuiScreenConfigureWorld) { ++ return par0GuiScreenConfigureWorld.field_96284_p; ++ } ++ ++ static FontRenderer func_96273_f(GuiScreenConfigureWorld par0GuiScreenConfigureWorld) { ++ return par0GuiScreenConfigureWorld.fontRenderer; + } + } diff --git a/patches/net/minecraft/src/GuiScreenConfirmation.java.patch b/patches/net/minecraft/src/GuiScreenConfirmation.java.patch new file mode 100644 index 0000000..7afb874 --- /dev/null +++ b/patches/net/minecraft/src/GuiScreenConfirmation.java.patch @@ -0,0 +1,74 @@ +--- net/minecraft/src/GuiScreenConfirmation.java ++++ net/minecraft/src/GuiScreenConfirmation.java +@@ -2,37 +2,46 @@ + + public class GuiScreenConfirmation extends GuiScreen { + private final GuiScreenConfirmationType field_140045_e; +- private final String p; +- private final String q; ++ private final String field_140049_p; ++ private final String field_96288_n; + protected final GuiScreen field_140048_a; +- protected final String b; +- protected final String c; ++ protected final String field_140046_b; ++ protected final String field_140047_c; + protected final int field_140044_d; + +- public GuiScreenConfirmation(GuiScreen var1, GuiScreenConfirmationType var2, String var3, String var4, int var5) { +- this.field_140048_a = var1; +- this.field_140044_d = var5; +- this.field_140045_e = var2; +- this.p = var3; +- this.q = var4; +- this.b = I18n.getString("gui.yes"); +- this.c = I18n.getString("gui.no"); ++ public GuiScreenConfirmation(GuiScreen par1GuiScreen, GuiScreenConfirmationType par2GuiScreenConfirmationType, String par3Str, String par4Str, int par5) { ++ this.field_140048_a = par1GuiScreen; ++ this.field_140044_d = par5; ++ this.field_140045_e = par2GuiScreenConfirmationType; ++ this.field_140049_p = par3Str; ++ this.field_96288_n = par4Str; ++ this.field_140046_b = I18n.getString("gui.yes"); ++ this.field_140047_c = I18n.getString("gui.no"); + } + ++ /** ++ * Adds the buttons (and other controls) to the screen in question. ++ */ + public void initGui() { +- this.i.add(new GuiSmallButton(0, this.width / 2 - 155, this.height / 6 + 112, this.b)); +- this.i.add(new GuiSmallButton(1, this.width / 2 - 155 + 160, this.height / 6 + 112, this.c)); +- } +- +- protected void actionPerformed(GuiButton var1) { +- this.field_140048_a.confirmClicked(var1.id == 0, this.field_140044_d); +- } +- +- public void drawScreen(int var1, int var2, float var3) { ++ this.buttonList.add(new GuiSmallButton(0, this.width / 2 - 155, this.height / 6 + 112, this.field_140046_b)); ++ this.buttonList.add(new GuiSmallButton(1, this.width / 2 - 155 + 160, this.height / 6 + 112, this.field_140047_c)); ++ } ++ ++ /** ++ * Fired when a control is clicked. This is the equivalent of ActionListener.actionPerformed(ActionEvent e). ++ */ ++ protected void actionPerformed(GuiButton par1GuiButton) { ++ this.field_140048_a.confirmClicked(par1GuiButton.id == 0, this.field_140044_d); ++ } ++ ++ /** ++ * Draws the screen and all the components in it. ++ */ ++ public void drawScreen(int par1, int par2, float par3) { + this.drawDefaultBackground(); +- this.drawCenteredString(this.fontRenderer, this.field_140045_e.d, this.width / 2, 70, this.field_140045_e.field_140075_c); +- this.drawCenteredString(this.fontRenderer, this.p, this.width / 2, 90, 16777215); +- this.drawCenteredString(this.fontRenderer, this.q, this.width / 2, 110, 16777215); +- super.drawScreen(var1, var2, var3); ++ this.drawCenteredString(this.fontRenderer, this.field_140045_e.field_140072_d, this.width / 2, 70, this.field_140045_e.field_140075_c); ++ this.drawCenteredString(this.fontRenderer, this.field_140049_p, this.width / 2, 90, 16777215); ++ this.drawCenteredString(this.fontRenderer, this.field_96288_n, this.width / 2, 110, 16777215); ++ super.drawScreen(par1, par2, par3); + } + } diff --git a/patches/net/minecraft/src/GuiScreenConfirmationType.java.patch b/patches/net/minecraft/src/GuiScreenConfirmationType.java.patch new file mode 100644 index 0000000..0216c41 --- /dev/null +++ b/patches/net/minecraft/src/GuiScreenConfirmationType.java.patch @@ -0,0 +1,19 @@ +--- net/minecraft/src/GuiScreenConfirmationType.java ++++ net/minecraft/src/GuiScreenConfirmationType.java +@@ -3,12 +3,11 @@ + public enum GuiScreenConfirmationType { + Warning("Warning!", 16711680), + Info("Info!", 8226750); +- + public final int field_140075_c; +- public final String d; ++ public final String field_140072_d; + +- private GuiScreenConfirmationType(String var3, int var4) { +- this.d = var3; +- this.field_140075_c = var4; ++ private GuiScreenConfirmationType(String par3Str, int par4) { ++ this.field_140072_d = par3Str; ++ this.field_140075_c = par4; + } + } diff --git a/patches/net/minecraft/src/GuiScreenCreateOnlineWorld.java.patch b/patches/net/minecraft/src/GuiScreenCreateOnlineWorld.java.patch new file mode 100644 index 0000000..1407e56 --- /dev/null +++ b/patches/net/minecraft/src/GuiScreenCreateOnlineWorld.java.patch @@ -0,0 +1,252 @@ +--- net/minecraft/src/GuiScreenCreateOnlineWorld.java ++++ net/minecraft/src/GuiScreenCreateOnlineWorld.java +@@ -8,79 +8,90 @@ + private GuiScreen field_96260_a; + private GuiTextField field_96257_c; + private GuiTextField field_96255_b; +- private String d; +- private String e; ++ private String field_98108_c; ++ private String field_98109_n; + private static int field_96253_d; + private static int field_96261_n = 1; + private static int field_110357_r = 2; + private boolean field_96256_r; +- private String t = "You must enter a name!"; ++ private String field_96254_s = "You must enter a name!"; + private WorldTemplate field_110356_u; + +- public GuiScreenCreateOnlineWorld(GuiScreen var1) { +- super.i = Collections.synchronizedList(new ArrayList()); +- this.field_96260_a = var1; ++ public GuiScreenCreateOnlineWorld(GuiScreen par1GuiScreen) { ++ super.buttonList = Collections.synchronizedList(new ArrayList()); ++ this.field_96260_a = par1GuiScreen; + } + ++ /** ++ * Called from the main game loop to update the screen. ++ */ + public void updateScreen() { + this.field_96257_c.updateCursorCounter(); +- this.d = this.field_96257_c.getText(); ++ this.field_98108_c = this.field_96257_c.getText(); + this.field_96255_b.updateCursorCounter(); +- this.e = this.field_96255_b.getText(); ++ this.field_98109_n = this.field_96255_b.getText(); + } + ++ /** ++ * Adds the buttons (and other controls) to the screen in question. ++ */ + public void initGui() { + Keyboard.enableRepeatEvents(true); +- this.i.clear(); +- this.i.add(new GuiButton(field_96253_d, this.width / 2 - 100, this.height / 4 + 120 + 17, 97, 20, I18n.getString("mco.create.world"))); +- this.i.add(new GuiButton(field_96261_n, this.width / 2 + 5, this.height / 4 + 120 + 17, 95, 20, I18n.getString("gui.cancel"))); ++ this.buttonList.clear(); ++ this.buttonList.add(new GuiButton(field_96253_d, this.width / 2 - 100, this.height / 4 + 120 + 17, 97, 20, I18n.getString("mco.create.world"))); ++ this.buttonList.add(new GuiButton(field_96261_n, this.width / 2 + 5, this.height / 4 + 120 + 17, 95, 20, I18n.getString("gui.cancel"))); + this.field_96257_c = new GuiTextField(this.fontRenderer, this.width / 2 - 100, 65, 200, 20); + this.field_96257_c.setFocused(true); +- if(this.d != null) { +- this.field_96257_c.setText(this.d); ++ ++ if (this.field_98108_c != null) { ++ this.field_96257_c.setText(this.field_98108_c); + } + + this.field_96255_b = new GuiTextField(this.fontRenderer, this.width / 2 - 100, 111, 200, 20); +- if(this.e != null) { +- this.field_96255_b.setText(this.e); ++ ++ if (this.field_98109_n != null) { ++ this.field_96255_b.setText(this.field_98109_n); + } + +- if(this.field_110356_u == null) { +- this.i.add(new GuiButton(field_110357_r, this.width / 2 - 100, 147, 200, 20, I18n.getString("mco.template.default.name"))); ++ if (this.field_110356_u == null) { ++ this.buttonList.add(new GuiButton(field_110357_r, this.width / 2 - 100, 147, 200, 20, I18n.getString("mco.template.default.name"))); + } else { + this.field_96255_b.setText(""); + this.field_96255_b.setEnabled(false); + this.field_96255_b.setFocused(false); +- this.i.add(new GuiButton(field_110357_r, this.width / 2 - 100, 147, 200, 20, I18n.getString("mco.template.name") + ": " + this.field_110356_u.b)); ++ this.buttonList.add(new GuiButton(field_110357_r, this.width / 2 - 100, 147, 200, 20, I18n.getString("mco.template.name") + ": " + this.field_110356_u.field_110732_b)); + } +- + } + ++ /** ++ * Called when the screen is unloaded. Used to disable keyboard repeat events ++ */ + public void onGuiClosed() { + Keyboard.enableRepeatEvents(false); + } + +- protected void actionPerformed(GuiButton var1) { +- if(var1.enabled) { +- if(var1.id == field_96261_n) { ++ /** ++ * Fired when a control is clicked. This is the equivalent of ActionListener.actionPerformed(ActionEvent e). ++ */ ++ protected void actionPerformed(GuiButton par1GuiButton) { ++ if (par1GuiButton.enabled) { ++ if (par1GuiButton.id == field_96261_n) { + this.mc.displayGuiScreen(this.field_96260_a); +- } else if(var1.id == field_96253_d) { ++ } else if (par1GuiButton.id == field_96253_d) { + this.func_96252_h(); +- } else if(var1.id == field_110357_r) { ++ } else if (par1GuiButton.id == field_110357_r) { + this.mc.displayGuiScreen(new GuiScreenMcoWorldTemplate(this, this.field_110356_u)); + } +- + } + } + + private void func_96252_h() { +- if(this.func_96249_i()) { +- TaskWorldCreation var1 = new TaskWorldCreation(this, this.field_96257_c.getText(), "Minecraft Realms Server", this.e, this.field_110356_u); ++ if (this.func_96249_i()) { ++ TaskWorldCreation var1 = new TaskWorldCreation(this, this.field_96257_c.getText(), "Minecraft Realms Server", this.field_98109_n, this.field_110356_u); + GuiScreenLongRunningTask var2 = new GuiScreenLongRunningTask(this.mc, this.field_96260_a, var1); + var2.func_98117_g(); + this.mc.displayGuiScreen(var2); + } +- + } + + private boolean func_96249_i() { +@@ -88,69 +99,79 @@ + return !this.field_96256_r; + } + +- protected void keyTyped(char var1, int var2) { +- this.field_96257_c.textboxKeyTyped(var1, var2); +- this.field_96255_b.textboxKeyTyped(var1, var2); +- if(var2 == 15) { ++ /** ++ * Fired when a key is typed. This is the equivalent of KeyListener.keyTyped(KeyEvent e). ++ */ ++ protected void keyTyped(char par1, int par2) { ++ this.field_96257_c.textboxKeyTyped(par1, par2); ++ this.field_96255_b.textboxKeyTyped(par1, par2); ++ ++ if (par2 == 15) { + this.field_96257_c.setFocused(!this.field_96257_c.isFocused()); + this.field_96255_b.setFocused(!this.field_96255_b.isFocused()); + } + +- if(var2 == 28 || var2 == 156) { +- this.actionPerformed((GuiButton)this.i.get(0)); ++ if (par2 == 28 || par2 == 156) { ++ this.actionPerformed((GuiButton)this.buttonList.get(0)); + } +- +- } +- +- protected void mouseClicked(int var1, int var2, int var3) { +- super.mouseClicked(var1, var2, var3); +- this.field_96257_c.mouseClicked(var1, var2, var3); +- this.field_96255_b.mouseClicked(var1, var2, var3); +- } +- +- public void drawScreen(int var1, int var2, float var3) { ++ } ++ ++ /** ++ * Called when the mouse is clicked. ++ */ ++ protected void mouseClicked(int par1, int par2, int par3) { ++ super.mouseClicked(par1, par2, par3); ++ this.field_96257_c.mouseClicked(par1, par2, par3); ++ this.field_96255_b.mouseClicked(par1, par2, par3); ++ } ++ ++ /** ++ * Draws the screen and all the components in it. ++ */ ++ public void drawScreen(int par1, int par2, float par3) { + this.drawDefaultBackground(); + this.drawCenteredString(this.fontRenderer, I18n.getString("mco.selectServer.create"), this.width / 2, 11, 16777215); + this.drawString(this.fontRenderer, I18n.getString("mco.configure.world.name"), this.width / 2 - 100, 52, 10526880); + this.drawString(this.fontRenderer, I18n.getString("mco.create.world.seed"), this.width / 2 - 100, 98, 10526880); +- if(this.field_96256_r) { +- this.drawCenteredString(this.fontRenderer, this.t, this.width / 2, 167, 16711680); ++ ++ if (this.field_96256_r) { ++ this.drawCenteredString(this.fontRenderer, this.field_96254_s, this.width / 2, 167, 16711680); + } + + this.field_96257_c.drawTextBox(); + this.field_96255_b.drawTextBox(); +- super.drawScreen(var1, var2, var3); +- } +- +- public void func_110355_a(WorldTemplate var1) { +- this.field_110356_u = var1; +- } +- +- public void func_110354_a(Object var1) { +- this.func_110355_a((WorldTemplate)var1); +- } +- +- static Minecraft func_96248_a(GuiScreenCreateOnlineWorld var0) { +- return var0.mc; +- } +- +- static GuiScreen func_96247_b(GuiScreenCreateOnlineWorld var0) { +- return var0.field_96260_a; +- } +- +- static Minecraft func_96246_c(GuiScreenCreateOnlineWorld var0) { +- return var0.mc; +- } +- +- static Minecraft func_130026_d(GuiScreenCreateOnlineWorld var0) { +- return var0.mc; +- } +- +- static Minecraft func_130027_e(GuiScreenCreateOnlineWorld var0) { +- return var0.mc; +- } +- +- static Minecraft func_130028_f(GuiScreenCreateOnlineWorld var0) { +- return var0.mc; ++ super.drawScreen(par1, par2, par3); ++ } ++ ++ public void func_110355_a(WorldTemplate par1WorldTemplate) { ++ this.field_110356_u = par1WorldTemplate; ++ } ++ ++ public void func_110354_a(Object par1Obj) { ++ this.func_110355_a((WorldTemplate)par1Obj); ++ } ++ ++ static Minecraft func_96248_a(GuiScreenCreateOnlineWorld par0GuiScreenCreateOnlineWorld) { ++ return par0GuiScreenCreateOnlineWorld.mc; ++ } ++ ++ static GuiScreen func_96247_b(GuiScreenCreateOnlineWorld par0GuiScreenCreateOnlineWorld) { ++ return par0GuiScreenCreateOnlineWorld.field_96260_a; ++ } ++ ++ static Minecraft func_96246_c(GuiScreenCreateOnlineWorld par0GuiScreenCreateOnlineWorld) { ++ return par0GuiScreenCreateOnlineWorld.mc; ++ } ++ ++ static Minecraft func_130026_d(GuiScreenCreateOnlineWorld par0GuiScreenCreateOnlineWorld) { ++ return par0GuiScreenCreateOnlineWorld.mc; ++ } ++ ++ static Minecraft func_130027_e(GuiScreenCreateOnlineWorld par0GuiScreenCreateOnlineWorld) { ++ return par0GuiScreenCreateOnlineWorld.mc; ++ } ++ ++ static Minecraft func_130028_f(GuiScreenCreateOnlineWorld par0GuiScreenCreateOnlineWorld) { ++ return par0GuiScreenCreateOnlineWorld.mc; + } + } diff --git a/patches/net/minecraft/src/GuiScreenDemo.java.patch b/patches/net/minecraft/src/GuiScreenDemo.java.patch new file mode 100644 index 0000000..930a23a --- /dev/null +++ b/patches/net/minecraft/src/GuiScreenDemo.java.patch @@ -0,0 +1,100 @@ +--- net/minecraft/src/GuiScreenDemo.java ++++ net/minecraft/src/GuiScreenDemo.java +@@ -6,37 +6,50 @@ + public class GuiScreenDemo extends GuiScreen { + private static final ResourceLocation field_110407_a = new ResourceLocation("textures/gui/demo_background.png"); + ++ /** ++ * Adds the buttons (and other controls) to the screen in question. ++ */ + public void initGui() { +- this.i.clear(); ++ this.buttonList.clear(); + byte var1 = -16; +- this.i.add(new GuiButton(1, this.width / 2 - 116, this.height / 2 + 62 + var1, 114, 20, I18n.getString("demo.help.buy"))); +- this.i.add(new GuiButton(2, this.width / 2 + 2, this.height / 2 + 62 + var1, 114, 20, I18n.getString("demo.help.later"))); ++ this.buttonList.add(new GuiButton(1, this.width / 2 - 116, this.height / 2 + 62 + var1, 114, 20, I18n.getString("demo.help.buy"))); ++ this.buttonList.add(new GuiButton(2, this.width / 2 + 2, this.height / 2 + 62 + var1, 114, 20, I18n.getString("demo.help.later"))); + } + +- protected void actionPerformed(GuiButton var1) { +- switch(var1.id) { +- case 1: +- var1.enabled = false; +- +- try { +- Class var2 = Class.forName("java.awt.Desktop"); +- Object var3 = var2.getMethod("getDesktop", new Class[0]).invoke((Object)null, new Object[0]); +- var2.getMethod("browse", new Class[]{URI.class}).invoke(var3, new Object[]{new URI("http://www.minecraft.net/store?source=demo")}); +- } catch (Throwable var4) { +- var4.printStackTrace(); +- } +- break; +- case 2: +- this.mc.displayGuiScreen((GuiScreen)null); +- this.mc.setIngameFocus(); ++ /** ++ * Fired when a control is clicked. This is the equivalent of ActionListener.actionPerformed(ActionEvent e). ++ */ ++ protected void actionPerformed(GuiButton par1GuiButton) { ++ switch (par1GuiButton.id) { ++ case 1: ++ par1GuiButton.enabled = false; ++ ++ try { ++ Class var2 = Class.forName("java.awt.Desktop"); ++ Object var3 = var2.getMethod("getDesktop", new Class[0]).invoke((Object)null, new Object[0]); ++ var2.getMethod("browse", new Class[] {URI.class}).invoke(var3, new Object[] {new URI("http://www.minecraft.net/store?source=demo")}); ++ } catch (Throwable var4) { ++ var4.printStackTrace(); ++ } ++ ++ break; ++ ++ case 2: ++ this.mc.displayGuiScreen((GuiScreen)null); ++ this.mc.setIngameFocus(); + } +- + } + ++ /** ++ * Called from the main game loop to update the screen. ++ */ + public void updateScreen() { + super.updateScreen(); + } + ++ /** ++ * Draws either a gradient over the background screen (when it exists) or a flat gradient over background.png ++ */ + public void drawDefaultBackground() { + super.drawDefaultBackground(); + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); +@@ -46,18 +59,21 @@ + this.drawTexturedModalRect(var1, var2, 0, 0, 248, 166); + } + +- public void drawScreen(int var1, int var2, float var3) { ++ /** ++ * Draws the screen and all the components in it. ++ */ ++ public void drawScreen(int par1, int par2, float par3) { + this.drawDefaultBackground(); + int var4 = (this.width - 248) / 2 + 10; + int var5 = (this.height - 166) / 2 + 8; + this.fontRenderer.drawString(I18n.getString("demo.help.title"), var4, var5, 2039583); + var5 += 12; + GameSettings var6 = this.mc.gameSettings; +- this.fontRenderer.drawString(I18n.getStringParams("demo.help.movementShort", new Object[]{GameSettings.getKeyDisplayString(var6.keyBindForward.keyCode), GameSettings.getKeyDisplayString(var6.keyBindLeft.keyCode), GameSettings.getKeyDisplayString(var6.keyBindBack.keyCode), GameSettings.getKeyDisplayString(var6.keyBindRight.keyCode)}), var4, var5, 5197647); ++ this.fontRenderer.drawString(I18n.getStringParams("demo.help.movementShort", new Object[] {GameSettings.getKeyDisplayString(var6.keyBindForward.keyCode), GameSettings.getKeyDisplayString(var6.keyBindLeft.keyCode), GameSettings.getKeyDisplayString(var6.keyBindBack.keyCode), GameSettings.getKeyDisplayString(var6.keyBindRight.keyCode)}), var4, var5, 5197647); + this.fontRenderer.drawString(I18n.getString("demo.help.movementMouse"), var4, var5 + 12, 5197647); +- this.fontRenderer.drawString(I18n.getStringParams("demo.help.jump", new Object[]{GameSettings.getKeyDisplayString(var6.keyBindJump.keyCode)}), var4, var5 + 24, 5197647); +- this.fontRenderer.drawString(I18n.getStringParams("demo.help.inventory", new Object[]{GameSettings.getKeyDisplayString(var6.keyBindInventory.keyCode)}), var4, var5 + 36, 5197647); ++ this.fontRenderer.drawString(I18n.getStringParams("demo.help.jump", new Object[] {GameSettings.getKeyDisplayString(var6.keyBindJump.keyCode)}), var4, var5 + 24, 5197647); ++ this.fontRenderer.drawString(I18n.getStringParams("demo.help.inventory", new Object[] {GameSettings.getKeyDisplayString(var6.keyBindInventory.keyCode)}), var4, var5 + 36, 5197647); + this.fontRenderer.drawSplitString(I18n.getString("demo.help.fullWrapped"), var4, var5 + 68, 218, 2039583); +- super.drawScreen(var1, var2, var3); ++ super.drawScreen(par1, par2, par3); + } + } diff --git a/patches/net/minecraft/src/GuiScreenDisconnectedOnline.java.patch b/patches/net/minecraft/src/GuiScreenDisconnectedOnline.java.patch new file mode 100644 index 0000000..c607dd2 --- /dev/null +++ b/patches/net/minecraft/src/GuiScreenDisconnectedOnline.java.patch @@ -0,0 +1,93 @@ +--- net/minecraft/src/GuiScreenDisconnectedOnline.java ++++ net/minecraft/src/GuiScreenDisconnectedOnline.java +@@ -4,51 +4,62 @@ + import java.util.List; + + public class GuiScreenDisconnectedOnline extends GuiScreen { +- private String a; +- private String b; +- private Object[] c; +- private List d; ++ private String field_98113_a; ++ private String field_98111_b; ++ private Object[] field_98112_c; ++ private List field_98110_d; + private final GuiScreen field_98114_n; + +- public GuiScreenDisconnectedOnline(GuiScreen var1, String var2, String var3, Object... var4) { +- this.field_98114_n = var1; +- this.a = I18n.getString(var2); +- this.b = var3; +- this.c = var4; +- } +- +- protected void keyTyped(char var1, int var2) { +- } +- ++ public GuiScreenDisconnectedOnline(GuiScreen par1GuiScreen, String par2Str, String par3Str, Object ... par4ArrayOfObj) { ++ this.field_98114_n = par1GuiScreen; ++ this.field_98113_a = I18n.getString(par2Str); ++ this.field_98111_b = par3Str; ++ this.field_98112_c = par4ArrayOfObj; ++ } ++ ++ /** ++ * Fired when a key is typed. This is the equivalent of KeyListener.keyTyped(KeyEvent e). ++ */ ++ protected void keyTyped(char par1, int par2) {} ++ ++ /** ++ * Adds the buttons (and other controls) to the screen in question. ++ */ + public void initGui() { +- this.i.clear(); +- this.i.add(new GuiButton(0, this.width / 2 - 100, this.height / 4 + 120 + 12, I18n.getString("gui.back"))); +- if(this.c != null) { +- this.d = this.fontRenderer.listFormattedStringToWidth(I18n.getStringParams(this.b, this.c), this.width - 50); ++ this.buttonList.clear(); ++ this.buttonList.add(new GuiButton(0, this.width / 2 - 100, this.height / 4 + 120 + 12, I18n.getString("gui.back"))); ++ ++ if (this.field_98112_c != null) { ++ this.field_98110_d = this.fontRenderer.listFormattedStringToWidth(I18n.getStringParams(this.field_98111_b, this.field_98112_c), this.width - 50); + } else { +- this.d = this.fontRenderer.listFormattedStringToWidth(I18n.getString(this.b), this.width - 50); ++ this.field_98110_d = this.fontRenderer.listFormattedStringToWidth(I18n.getString(this.field_98111_b), this.width - 50); + } +- + } + +- protected void actionPerformed(GuiButton var1) { +- if(var1.id == 0) { ++ /** ++ * Fired when a control is clicked. This is the equivalent of ActionListener.actionPerformed(ActionEvent e). ++ */ ++ protected void actionPerformed(GuiButton par1GuiButton) { ++ if (par1GuiButton.id == 0) { + this.mc.displayGuiScreen(this.field_98114_n); + } +- + } + +- public void drawScreen(int var1, int var2, float var3) { ++ /** ++ * Draws the screen and all the components in it. ++ */ ++ public void drawScreen(int par1, int par2, float par3) { + this.drawDefaultBackground(); +- this.drawCenteredString(this.fontRenderer, this.a, this.width / 2, this.height / 2 - 50, 11184810); ++ this.drawCenteredString(this.fontRenderer, this.field_98113_a, this.width / 2, this.height / 2 - 50, 11184810); + int var4 = this.height / 2 - 30; +- if(this.d != null) { +- for(Iterator var5 = this.d.iterator(); var5.hasNext(); var4 += this.fontRenderer.FONT_HEIGHT) { ++ ++ if (this.field_98110_d != null) { ++ for (Iterator var5 = this.field_98110_d.iterator(); var5.hasNext(); var4 += this.fontRenderer.FONT_HEIGHT) { + String var6 = (String)var5.next(); + this.drawCenteredString(this.fontRenderer, var6, this.width / 2, var4, 16777215); + } + } + +- super.drawScreen(var1, var2, var3); ++ super.drawScreen(par1, par2, par3); + } + } diff --git a/patches/net/minecraft/src/GuiScreenEditOnlineWorld.java.patch b/patches/net/minecraft/src/GuiScreenEditOnlineWorld.java.patch new file mode 100644 index 0000000..258c2bc --- /dev/null +++ b/patches/net/minecraft/src/GuiScreenEditOnlineWorld.java.patch @@ -0,0 +1,140 @@ +--- net/minecraft/src/GuiScreenEditOnlineWorld.java ++++ net/minecraft/src/GuiScreenEditOnlineWorld.java +@@ -15,25 +15,31 @@ + private int field_104052_r; + private GuiScreenOnlineServersSubscreen field_104051_s; + +- public GuiScreenEditOnlineWorld(GuiScreen var1, GuiScreen var2, McoServer var3) { +- this.field_96204_a = var1; +- this.field_96202_b = var2; +- this.field_96205_n = var3; ++ public GuiScreenEditOnlineWorld(GuiScreen par1GuiScreen, GuiScreen par2GuiScreen, McoServer par3McoServer) { ++ this.field_96204_a = par1GuiScreen; ++ this.field_96202_b = par2GuiScreen; ++ this.field_96205_n = par3McoServer; + } + ++ /** ++ * Called from the main game loop to update the screen. ++ */ + public void updateScreen() { + this.field_96201_d.updateCursorCounter(); + this.field_96203_c.updateCursorCounter(); + } + ++ /** ++ * Adds the buttons (and other controls) to the screen in question. ++ */ + public void initGui() { + this.field_104054_p = this.width / 4; + this.field_104053_q = this.width / 4 - 2; + this.field_104052_r = this.width / 2 + 4; + Keyboard.enableRepeatEvents(true); +- this.i.clear(); +- this.i.add(this.field_96206_o = new GuiButton(0, this.field_104054_p, this.height / 4 + 120 + 22, this.field_104053_q, 20, I18n.getString("mco.configure.world.buttons.done"))); +- this.i.add(new GuiButton(1, this.field_104052_r, this.height / 4 + 120 + 22, this.field_104053_q, 20, I18n.getString("gui.cancel"))); ++ this.buttonList.clear(); ++ this.buttonList.add(this.field_96206_o = new GuiButton(0, this.field_104054_p, this.height / 4 + 120 + 22, this.field_104053_q, 20, I18n.getString("mco.configure.world.buttons.done"))); ++ this.buttonList.add(new GuiButton(1, this.field_104052_r, this.height / 4 + 120 + 22, this.field_104053_q, 20, I18n.getString("gui.cancel"))); + this.field_96201_d = new GuiTextField(this.fontRenderer, this.field_104054_p, 56, 212, 20); + this.field_96201_d.setFocused(true); + this.field_96201_d.setMaxStringLength(32); +@@ -42,25 +48,30 @@ + this.field_96203_c.setMaxStringLength(32); + this.field_96203_c.setText(this.field_96205_n.func_96397_a()); + this.field_104051_s = new GuiScreenOnlineServersSubscreen(this.width, this.height, this.field_104054_p, 122, this.field_96205_n.field_110729_i, this.field_96205_n.field_110728_j); +- this.i.addAll(this.field_104051_s.a); ++ this.buttonList.addAll(this.field_104051_s.field_104079_a); + } + ++ /** ++ * Called when the screen is unloaded. Used to disable keyboard repeat events ++ */ + public void onGuiClosed() { + Keyboard.enableRepeatEvents(false); + } + +- protected void actionPerformed(GuiButton var1) { +- if(var1.enabled) { +- if(var1.id == 1) { ++ /** ++ * Fired when a control is clicked. This is the equivalent of ActionListener.actionPerformed(ActionEvent e). ++ */ ++ protected void actionPerformed(GuiButton par1GuiButton) { ++ if (par1GuiButton.enabled) { ++ if (par1GuiButton.id == 1) { + this.mc.displayGuiScreen(this.field_96204_a); +- } else if(var1.id == 0) { ++ } else if (par1GuiButton.id == 0) { + this.func_96200_g(); +- } else if(var1.id == 2) { ++ } else if (par1GuiButton.id == 2) { + this.mc.displayGuiScreen(new GuiScreenResetWorld(this, this.field_96205_n)); + } else { +- this.field_104051_s.func_104069_a(var1); ++ this.field_104051_s.func_104069_a(par1GuiButton); + } +- + } + } + +@@ -80,31 +91,40 @@ + } catch (UnsupportedEncodingException var4) { + this.mc.getLogAgent().logWarning("Realms: " + var4.getLocalizedMessage()); + } +- + } + +- protected void keyTyped(char var1, int var2) { +- this.field_96201_d.textboxKeyTyped(var1, var2); +- this.field_96203_c.textboxKeyTyped(var1, var2); +- if(var2 == 15) { ++ /** ++ * Fired when a key is typed. This is the equivalent of KeyListener.keyTyped(KeyEvent e). ++ */ ++ protected void keyTyped(char par1, int par2) { ++ this.field_96201_d.textboxKeyTyped(par1, par2); ++ this.field_96203_c.textboxKeyTyped(par1, par2); ++ ++ if (par2 == 15) { + this.field_96201_d.setFocused(!this.field_96201_d.isFocused()); + this.field_96203_c.setFocused(!this.field_96203_c.isFocused()); + } + +- if(var2 == 28 || var2 == 156) { ++ if (par2 == 28 || par2 == 156) { + this.func_96200_g(); + } + + this.field_96206_o.enabled = this.field_96201_d.getText() != null && !this.field_96201_d.getText().trim().equals(""); + } + +- protected void mouseClicked(int var1, int var2, int var3) { +- super.mouseClicked(var1, var2, var3); +- this.field_96203_c.mouseClicked(var1, var2, var3); +- this.field_96201_d.mouseClicked(var1, var2, var3); ++ /** ++ * Called when the mouse is clicked. ++ */ ++ protected void mouseClicked(int par1, int par2, int par3) { ++ super.mouseClicked(par1, par2, par3); ++ this.field_96203_c.mouseClicked(par1, par2, par3); ++ this.field_96201_d.mouseClicked(par1, par2, par3); + } + +- public void drawScreen(int var1, int var2, float var3) { ++ /** ++ * Draws the screen and all the components in it. ++ */ ++ public void drawScreen(int par1, int par2, float par3) { + this.drawDefaultBackground(); + this.drawCenteredString(this.fontRenderer, I18n.getString("mco.configure.world.edit.title"), this.width / 2, 17, 16777215); + this.drawString(this.fontRenderer, I18n.getString("mco.configure.world.name"), this.field_104054_p, 43, 10526880); +@@ -112,6 +132,6 @@ + this.field_96201_d.drawTextBox(); + this.field_96203_c.drawTextBox(); + this.field_104051_s.func_104071_a(this, this.fontRenderer); +- super.drawScreen(var1, var2, var3); ++ super.drawScreen(par1, par2, par3); + } + } diff --git a/patches/net/minecraft/src/GuiScreenHorseInventory.java.patch b/patches/net/minecraft/src/GuiScreenHorseInventory.java.patch new file mode 100644 index 0000000..83200e8 --- /dev/null +++ b/patches/net/minecraft/src/GuiScreenHorseInventory.java.patch @@ -0,0 +1,65 @@ +--- net/minecraft/src/GuiScreenHorseInventory.java ++++ net/minecraft/src/GuiScreenHorseInventory.java +@@ -10,39 +10,49 @@ + private float field_110416_x; + private float field_110415_y; + +- public GuiScreenHorseInventory(IInventory var1, IInventory var2, EntityHorse var3) { +- super(new ContainerHorseInventory(var1, var2, var3)); +- this.field_110413_u = var1; +- this.field_110412_v = var2; +- this.field_110411_w = var3; ++ public GuiScreenHorseInventory(IInventory par1IInventory, IInventory par2IInventory, EntityHorse par3EntityHorse) { ++ super(new ContainerHorseInventory(par1IInventory, par2IInventory, par3EntityHorse)); ++ this.field_110413_u = par1IInventory; ++ this.field_110412_v = par2IInventory; ++ this.field_110411_w = par3EntityHorse; + this.allowUserInput = false; + } + +- protected void drawGuiContainerForegroundLayer(int var1, int var2) { ++ /** ++ * Draw the foreground layer for the GuiContainer (everything in front of the items) ++ */ ++ protected void drawGuiContainerForegroundLayer(int par1, int par2) { + this.fontRenderer.drawString(this.field_110412_v.isInvNameLocalized() ? this.field_110412_v.getInvName() : I18n.getString(this.field_110412_v.getInvName()), 8, 6, 4210752); + this.fontRenderer.drawString(this.field_110413_u.isInvNameLocalized() ? this.field_110413_u.getInvName() : I18n.getString(this.field_110413_u.getInvName()), 8, this.ySize - 96 + 2, 4210752); + } + +- protected void drawGuiContainerBackgroundLayer(float var1, int var2, int var3) { ++ /** ++ * Draw the background layer for the GuiContainer (everything behind the items) ++ */ ++ protected void drawGuiContainerBackgroundLayer(float par1, int par2, int par3) { + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + this.mc.getTextureManager().bindTexture(horseGuiTextures); + int var4 = (this.width - this.xSize) / 2; + int var5 = (this.height - this.ySize) / 2; + this.drawTexturedModalRect(var4, var5, 0, 0, this.xSize, this.ySize); +- if(this.field_110411_w.isChested()) { ++ ++ if (this.field_110411_w.isChested()) { + this.drawTexturedModalRect(var4 + 79, var5 + 17, 0, this.ySize, 90, 54); + } + +- if(this.field_110411_w.func_110259_cr()) { ++ if (this.field_110411_w.func_110259_cr()) { + this.drawTexturedModalRect(var4 + 7, var5 + 35, 0, this.ySize + 54, 18, 18); + } + + GuiInventory.func_110423_a(var4 + 51, var5 + 60, 17, (float)(var4 + 51) - this.field_110416_x, (float)(var5 + 75 - 50) - this.field_110415_y, this.field_110411_w); + } + +- public void drawScreen(int var1, int var2, float var3) { +- this.field_110416_x = (float)var1; +- this.field_110415_y = (float)var2; +- super.drawScreen(var1, var2, var3); ++ /** ++ * Draws the screen and all the components in it. ++ */ ++ public void drawScreen(int par1, int par2, float par3) { ++ this.field_110416_x = (float)par1; ++ this.field_110415_y = (float)par2; ++ super.drawScreen(par1, par2, par3); + } + } diff --git a/patches/net/minecraft/src/GuiScreenInvite.java.patch b/patches/net/minecraft/src/GuiScreenInvite.java.patch new file mode 100644 index 0000000..b1d3d1c --- /dev/null +++ b/patches/net/minecraft/src/GuiScreenInvite.java.patch @@ -0,0 +1,163 @@ +--- net/minecraft/src/GuiScreenInvite.java ++++ net/minecraft/src/GuiScreenInvite.java +@@ -10,97 +10,120 @@ + private final GuiScreenConfigureWorld field_96222_d; + private final int field_96228_n = 0; + private final int field_96229_o = 1; +- private String q = "Could not invite the provided name"; +- private String r; ++ private String field_101016_p = "Could not invite the provided name"; ++ private String field_96226_p; + private boolean field_96225_q; + +- public GuiScreenInvite(GuiScreen var1, GuiScreenConfigureWorld var2, McoServer var3) { +- this.field_96224_c = var1; +- this.field_96222_d = var2; +- this.field_96223_b = var3; ++ public GuiScreenInvite(GuiScreen par1GuiScreen, GuiScreenConfigureWorld par2GuiScreenConfigureWorld, McoServer par3McoServer) { ++ this.field_96224_c = par1GuiScreen; ++ this.field_96222_d = par2GuiScreenConfigureWorld; ++ this.field_96223_b = par3McoServer; + } + ++ /** ++ * Called from the main game loop to update the screen. ++ */ + public void updateScreen() { + this.field_96227_a.updateCursorCounter(); + } + ++ /** ++ * Adds the buttons (and other controls) to the screen in question. ++ */ + public void initGui() { + Keyboard.enableRepeatEvents(true); +- this.i.clear(); +- this.i.add(new GuiButton(0, this.width / 2 - 100, this.height / 4 + 96 + 12, I18n.getString("mco.configure.world.buttons.invite"))); +- this.i.add(new GuiButton(1, this.width / 2 - 100, this.height / 4 + 120 + 12, I18n.getString("gui.cancel"))); ++ this.buttonList.clear(); ++ this.buttonList.add(new GuiButton(0, this.width / 2 - 100, this.height / 4 + 96 + 12, I18n.getString("mco.configure.world.buttons.invite"))); ++ this.buttonList.add(new GuiButton(1, this.width / 2 - 100, this.height / 4 + 120 + 12, I18n.getString("gui.cancel"))); + this.field_96227_a = new GuiTextField(this.fontRenderer, this.width / 2 - 100, 66, 200, 20); + this.field_96227_a.setFocused(true); + } + ++ /** ++ * Called when the screen is unloaded. Used to disable keyboard repeat events ++ */ + public void onGuiClosed() { + Keyboard.enableRepeatEvents(false); + } + +- protected void actionPerformed(GuiButton var1) { +- if(var1.enabled) { +- if(var1.id == 1) { ++ /** ++ * Fired when a control is clicked. This is the equivalent of ActionListener.actionPerformed(ActionEvent e). ++ */ ++ protected void actionPerformed(GuiButton par1GuiButton) { ++ if (par1GuiButton.enabled) { ++ if (par1GuiButton.id == 1) { + this.mc.displayGuiScreen(this.field_96222_d); +- } else if(var1.id == 0) { ++ } else if (par1GuiButton.id == 0) { + McoClient var2 = new McoClient(this.mc.getSession()); +- if(this.field_96227_a.getText() == null || this.field_96227_a.getText().isEmpty()) { ++ ++ if (this.field_96227_a.getText() == null || this.field_96227_a.getText().isEmpty()) { + return; + } + + try { + McoServer var3 = var2.func_96387_b(this.field_96223_b.field_96408_a, this.field_96227_a.getText()); +- if(var3 != null) { +- this.field_96223_b.f = var3.f; ++ ++ if (var3 != null) { ++ this.field_96223_b.field_96402_f = var3.field_96402_f; + this.mc.displayGuiScreen(new GuiScreenConfigureWorld(this.field_96224_c, this.field_96223_b)); + } else { +- this.func_101015_a(this.q); ++ this.func_101015_a(this.field_101016_p); + } + } catch (ExceptionMcoService var4) { + this.mc.getLogAgent().logSevere(var4.toString()); +- this.func_101015_a(var4.b); ++ this.func_101015_a(var4.field_96391_b); + } catch (IOException var5) { + this.mc.getLogAgent().logWarning("Realms: could not parse response"); +- this.func_101015_a(this.q); ++ this.func_101015_a(this.field_101016_p); + } + } +- + } + } + +- private void func_101015_a(String var1) { ++ private void func_101015_a(String par1Str) { + this.field_96225_q = true; +- this.r = var1; ++ this.field_96226_p = par1Str; + } + +- protected void keyTyped(char var1, int var2) { +- this.field_96227_a.textboxKeyTyped(var1, var2); +- if(var2 == 15) { +- if(this.field_96227_a.isFocused()) { ++ /** ++ * Fired when a key is typed. This is the equivalent of KeyListener.keyTyped(KeyEvent e). ++ */ ++ protected void keyTyped(char par1, int par2) { ++ this.field_96227_a.textboxKeyTyped(par1, par2); ++ ++ if (par2 == 15) { ++ if (this.field_96227_a.isFocused()) { + this.field_96227_a.setFocused(false); + } else { + this.field_96227_a.setFocused(true); + } + } + +- if(var2 == 28 || var2 == 156) { +- this.actionPerformed((GuiButton)this.i.get(0)); ++ if (par2 == 28 || par2 == 156) { ++ this.actionPerformed((GuiButton)this.buttonList.get(0)); + } +- +- } +- +- protected void mouseClicked(int var1, int var2, int var3) { +- super.mouseClicked(var1, var2, var3); +- this.field_96227_a.mouseClicked(var1, var2, var3); +- } +- +- public void drawScreen(int var1, int var2, float var3) { ++ } ++ ++ /** ++ * Called when the mouse is clicked. ++ */ ++ protected void mouseClicked(int par1, int par2, int par3) { ++ super.mouseClicked(par1, par2, par3); ++ this.field_96227_a.mouseClicked(par1, par2, par3); ++ } ++ ++ /** ++ * Draws the screen and all the components in it. ++ */ ++ public void drawScreen(int par1, int par2, float par3) { + this.drawDefaultBackground(); + this.drawString(this.fontRenderer, I18n.getString("mco.configure.world.invite.profile.name"), this.width / 2 - 100, 53, 10526880); +- if(this.field_96225_q) { +- this.drawCenteredString(this.fontRenderer, this.r, this.width / 2, 100, 16711680); ++ ++ if (this.field_96225_q) { ++ this.drawCenteredString(this.fontRenderer, this.field_96226_p, this.width / 2, 100, 16711680); + } + + this.field_96227_a.drawTextBox(); +- super.drawScreen(var1, var2, var3); ++ super.drawScreen(par1, par2, par3); + } + } diff --git a/patches/net/minecraft/src/GuiScreenLongRunningTask.java.patch b/patches/net/minecraft/src/GuiScreenLongRunningTask.java.patch new file mode 100644 index 0000000..f41b782 --- /dev/null +++ b/patches/net/minecraft/src/GuiScreenLongRunningTask.java.patch @@ -0,0 +1,143 @@ +--- net/minecraft/src/GuiScreenLongRunningTask.java ++++ net/minecraft/src/GuiScreenLongRunningTask.java +@@ -6,80 +6,106 @@ + public class GuiScreenLongRunningTask extends GuiScreen { + private final int field_96213_b = 666; + private final GuiScreen previousScreen; +- private final Thread d; +- private volatile String e = ""; ++ private final Thread taskThread; ++ private volatile String message = ""; + private volatile boolean taskFailed; +- private volatile String q; ++ private volatile String failedMessage; ++ ++ /** ++ * Set to true when back button is clicked, or any other button with ID 666 ++ */ + private volatile boolean screenWasClosed; ++ ++ /** Incremented every tick, used to display progress indicator. */ + private int progressCounter; ++ ++ /** The long running task this GUI is showing the progress of. */ + private TaskLongRunning task; +- public static final String[] a = new String[]{"\u00e2\u2013\u0192 \u00e2\u2013\u201e \u00e2\u2013\u2026 \u00e2\u2013\u2020 \u00e2\u2013\u2021 \u00e2\u2013\u02c6 \u00e2\u2013\u2021 \u00e2\u2013\u2020 \u00e2\u2013\u2026 \u00e2\u2013\u201e \u00e2\u2013\u0192", "_ \u00e2\u2013\u0192 \u00e2\u2013\u201e \u00e2\u2013\u2026 \u00e2\u2013\u2020 \u00e2\u2013\u2021 \u00e2\u2013\u02c6 \u00e2\u2013\u2021 \u00e2\u2013\u2020 \u00e2\u2013\u2026 \u00e2\u2013\u201e", "_ _ \u00e2\u2013\u0192 \u00e2\u2013\u201e \u00e2\u2013\u2026 \u00e2\u2013\u2020 \u00e2\u2013\u2021 \u00e2\u2013\u02c6 \u00e2\u2013\u2021 \u00e2\u2013\u2020 \u00e2\u2013\u2026", "_ _ _ \u00e2\u2013\u0192 \u00e2\u2013\u201e \u00e2\u2013\u2026 \u00e2\u2013\u2020 \u00e2\u2013\u2021 \u00e2\u2013\u02c6 \u00e2\u2013\u2021 \u00e2\u2013\u2020", "_ _ _ _ \u00e2\u2013\u0192 \u00e2\u2013\u201e \u00e2\u2013\u2026 \u00e2\u2013\u2020 \u00e2\u2013\u2021 \u00e2\u2013\u02c6 \u00e2\u2013\u2021", "_ _ _ _ _ \u00e2\u2013\u0192 \u00e2\u2013\u201e \u00e2\u2013\u2026 \u00e2\u2013\u2020 \u00e2\u2013\u2021 \u00e2\u2013\u02c6", "_ _ _ _ \u00e2\u2013\u0192 \u00e2\u2013\u201e \u00e2\u2013\u2026 \u00e2\u2013\u2020 \u00e2\u2013\u2021 \u00e2\u2013\u02c6 \u00e2\u2013\u2021", "_ _ _ \u00e2\u2013\u0192 \u00e2\u2013\u201e \u00e2\u2013\u2026 \u00e2\u2013\u2020 \u00e2\u2013\u2021 \u00e2\u2013\u02c6 \u00e2\u2013\u2021 \u00e2\u2013\u2020", "_ _ \u00e2\u2013\u0192 \u00e2\u2013\u201e \u00e2\u2013\u2026 \u00e2\u2013\u2020 \u00e2\u2013\u2021 \u00e2\u2013\u02c6 \u00e2\u2013\u2021 \u00e2\u2013\u2020 \u00e2\u2013\u2026", "_ \u00e2\u2013\u0192 \u00e2\u2013\u201e \u00e2\u2013\u2026 \u00e2\u2013\u2020 \u00e2\u2013\u2021 \u00e2\u2013\u02c6 \u00e2\u2013\u2021 \u00e2\u2013\u2020 \u00e2\u2013\u2026 \u00e2\u2013\u201e", "\u00e2\u2013\u0192 \u00e2\u2013\u201e \u00e2\u2013\u2026 \u00e2\u2013\u2020 \u00e2\u2013\u2021 \u00e2\u2013\u02c6 \u00e2\u2013\u2021 \u00e2\u2013\u2020 \u00e2\u2013\u2026 \u00e2\u2013\u201e \u00e2\u2013\u0192", "\u00e2\u2013\u201e \u00e2\u2013\u2026 \u00e2\u2013\u2020 \u00e2\u2013\u2021 \u00e2\u2013\u02c6 \u00e2\u2013\u2021 \u00e2\u2013\u2020 \u00e2\u2013\u2026 \u00e2\u2013\u201e \u00e2\u2013\u0192 _", "\u00e2\u2013\u2026 \u00e2\u2013\u2020 \u00e2\u2013\u2021 \u00e2\u2013\u02c6 \u00e2\u2013\u2021 \u00e2\u2013\u2020 \u00e2\u2013\u2026 \u00e2\u2013\u201e \u00e2\u2013\u0192 _ _", "\u00e2\u2013\u2020 \u00e2\u2013\u2021 \u00e2\u2013\u02c6 \u00e2\u2013\u2021 \u00e2\u2013\u2020 \u00e2\u2013\u2026 \u00e2\u2013\u201e \u00e2\u2013\u0192 _ _ _", "\u00e2\u2013\u2021 \u00e2\u2013\u02c6 \u00e2\u2013\u2021 \u00e2\u2013\u2020 \u00e2\u2013\u2026 \u00e2\u2013\u201e \u00e2\u2013\u0192 _ _ _ _", "\u00e2\u2013\u02c6 \u00e2\u2013\u2021 \u00e2\u2013\u2020 \u00e2\u2013\u2026 \u00e2\u2013\u201e \u00e2\u2013\u0192 _ _ _ _ _", "\u00e2\u2013\u2021 \u00e2\u2013\u02c6 \u00e2\u2013\u2021 \u00e2\u2013\u2020 \u00e2\u2013\u2026 \u00e2\u2013\u201e \u00e2\u2013\u0192 _ _ _ _", "\u00e2\u2013\u2020 \u00e2\u2013\u2021 \u00e2\u2013\u02c6 \u00e2\u2013\u2021 \u00e2\u2013\u2020 \u00e2\u2013\u2026 \u00e2\u2013\u201e \u00e2\u2013\u0192 _ _ _", "\u00e2\u2013\u2026 \u00e2\u2013\u2020 \u00e2\u2013\u2021 \u00e2\u2013\u02c6 \u00e2\u2013\u2021 \u00e2\u2013\u2020 \u00e2\u2013\u2026 \u00e2\u2013\u201e \u00e2\u2013\u0192 _ _", "\u00e2\u2013\u201e \u00e2\u2013\u2026 \u00e2\u2013\u2020 \u00e2\u2013\u2021 \u00e2\u2013\u02c6 \u00e2\u2013\u2021 \u00e2\u2013\u2020 \u00e2\u2013\u2026 \u00e2\u2013\u201e \u00e2\u2013\u0192 _"}; ++ public static final String[] PROGRESS_TEXT = new String[] {"\u00e2\u2013\u0192 \u00e2\u2013\u201e \u00e2\u2013\u2026 \u00e2\u2013\u2020 \u00e2\u2013\u2021 \u00e2\u2013\u02c6 \u00e2\u2013\u2021 \u00e2\u2013\u2020 \u00e2\u2013\u2026 \u00e2\u2013\u201e \u00e2\u2013\u0192", "_ \u00e2\u2013\u0192 \u00e2\u2013\u201e \u00e2\u2013\u2026 \u00e2\u2013\u2020 \u00e2\u2013\u2021 \u00e2\u2013\u02c6 \u00e2\u2013\u2021 \u00e2\u2013\u2020 \u00e2\u2013\u2026 \u00e2\u2013\u201e", "_ _ \u00e2\u2013\u0192 \u00e2\u2013\u201e \u00e2\u2013\u2026 \u00e2\u2013\u2020 \u00e2\u2013\u2021 \u00e2\u2013\u02c6 \u00e2\u2013\u2021 \u00e2\u2013\u2020 \u00e2\u2013\u2026", "_ _ _ \u00e2\u2013\u0192 \u00e2\u2013\u201e \u00e2\u2013\u2026 \u00e2\u2013\u2020 \u00e2\u2013\u2021 \u00e2\u2013\u02c6 \u00e2\u2013\u2021 \u00e2\u2013\u2020", "_ _ _ _ \u00e2\u2013\u0192 \u00e2\u2013\u201e \u00e2\u2013\u2026 \u00e2\u2013\u2020 \u00e2\u2013\u2021 \u00e2\u2013\u02c6 \u00e2\u2013\u2021", "_ _ _ _ _ \u00e2\u2013\u0192 \u00e2\u2013\u201e \u00e2\u2013\u2026 \u00e2\u2013\u2020 \u00e2\u2013\u2021 \u00e2\u2013\u02c6", "_ _ _ _ \u00e2\u2013\u0192 \u00e2\u2013\u201e \u00e2\u2013\u2026 \u00e2\u2013\u2020 \u00e2\u2013\u2021 \u00e2\u2013\u02c6 \u00e2\u2013\u2021", "_ _ _ \u00e2\u2013\u0192 \u00e2\u2013\u201e \u00e2\u2013\u2026 \u00e2\u2013\u2020 \u00e2\u2013\u2021 \u00e2\u2013\u02c6 \u00e2\u2013\u2021 \u00e2\u2013\u2020", "_ _ \u00e2\u2013\u0192 \u00e2\u2013\u201e \u00e2\u2013\u2026 \u00e2\u2013\u2020 \u00e2\u2013\u2021 \u00e2\u2013\u02c6 \u00e2\u2013\u2021 \u00e2\u2013\u2020 \u00e2\u2013\u2026", "_ \u00e2\u2013\u0192 \u00e2\u2013\u201e \u00e2\u2013\u2026 \u00e2\u2013\u2020 \u00e2\u2013\u2021 \u00e2\u2013\u02c6 \u00e2\u2013\u2021 \u00e2\u2013\u2020 \u00e2\u2013\u2026 \u00e2\u2013\u201e", "\u00e2\u2013\u0192 \u00e2\u2013\u201e \u00e2\u2013\u2026 \u00e2\u2013\u2020 \u00e2\u2013\u2021 \u00e2\u2013\u02c6 \u00e2\u2013\u2021 \u00e2\u2013\u2020 \u00e2\u2013\u2026 \u00e2\u2013\u201e \u00e2\u2013\u0192", "\u00e2\u2013\u201e \u00e2\u2013\u2026 \u00e2\u2013\u2020 \u00e2\u2013\u2021 \u00e2\u2013\u02c6 \u00e2\u2013\u2021 \u00e2\u2013\u2020 \u00e2\u2013\u2026 \u00e2\u2013\u201e \u00e2\u2013\u0192 _", "\u00e2\u2013\u2026 \u00e2\u2013\u2020 \u00e2\u2013\u2021 \u00e2\u2013\u02c6 \u00e2\u2013\u2021 \u00e2\u2013\u2020 \u00e2\u2013\u2026 \u00e2\u2013\u201e \u00e2\u2013\u0192 _ _", "\u00e2\u2013\u2020 \u00e2\u2013\u2021 \u00e2\u2013\u02c6 \u00e2\u2013\u2021 \u00e2\u2013\u2020 \u00e2\u2013\u2026 \u00e2\u2013\u201e \u00e2\u2013\u0192 _ _ _", "\u00e2\u2013\u2021 \u00e2\u2013\u02c6 \u00e2\u2013\u2021 \u00e2\u2013\u2020 \u00e2\u2013\u2026 \u00e2\u2013\u201e \u00e2\u2013\u0192 _ _ _ _", "\u00e2\u2013\u02c6 \u00e2\u2013\u2021 \u00e2\u2013\u2020 \u00e2\u2013\u2026 \u00e2\u2013\u201e \u00e2\u2013\u0192 _ _ _ _ _", "\u00e2\u2013\u2021 \u00e2\u2013\u02c6 \u00e2\u2013\u2021 \u00e2\u2013\u2020 \u00e2\u2013\u2026 \u00e2\u2013\u201e \u00e2\u2013\u0192 _ _ _ _", "\u00e2\u2013\u2020 \u00e2\u2013\u2021 \u00e2\u2013\u02c6 \u00e2\u2013\u2021 \u00e2\u2013\u2020 \u00e2\u2013\u2026 \u00e2\u2013\u201e \u00e2\u2013\u0192 _ _ _", "\u00e2\u2013\u2026 \u00e2\u2013\u2020 \u00e2\u2013\u2021 \u00e2\u2013\u02c6 \u00e2\u2013\u2021 \u00e2\u2013\u2020 \u00e2\u2013\u2026 \u00e2\u2013\u201e \u00e2\u2013\u0192 _ _", "\u00e2\u2013\u201e \u00e2\u2013\u2026 \u00e2\u2013\u2020 \u00e2\u2013\u2021 \u00e2\u2013\u02c6 \u00e2\u2013\u2021 \u00e2\u2013\u2020 \u00e2\u2013\u2026 \u00e2\u2013\u201e \u00e2\u2013\u0192 _"}; + +- public GuiScreenLongRunningTask(Minecraft var1, GuiScreen var2, TaskLongRunning var3) { +- super.i = Collections.synchronizedList(new ArrayList()); +- this.mc = var1; +- this.previousScreen = var2; +- this.task = var3; +- var3.setGUI(this); +- this.d = new Thread(var3); ++ public GuiScreenLongRunningTask(Minecraft par1Minecraft, GuiScreen par2GuiScreen, TaskLongRunning par3TaskLongRunning) { ++ super.buttonList = Collections.synchronizedList(new ArrayList()); ++ this.mc = par1Minecraft; ++ this.previousScreen = par2GuiScreen; ++ this.task = par3TaskLongRunning; ++ par3TaskLongRunning.setGUI(this); ++ this.taskThread = new Thread(par3TaskLongRunning); + } + + public void func_98117_g() { +- this.d.start(); ++ this.taskThread.start(); + } + ++ /** ++ * Called from the main game loop to update the screen. ++ */ + public void updateScreen() { + super.updateScreen(); + ++this.progressCounter; + this.task.updateScreen(); + } + +- protected void keyTyped(char var1, int var2) { +- } ++ /** ++ * Fired when a key is typed. This is the equivalent of KeyListener.keyTyped(KeyEvent e). ++ */ ++ protected void keyTyped(char par1, int par2) {} + ++ /** ++ * Adds the buttons (and other controls) to the screen in question. ++ */ + public void initGui() { + this.task.initGUI(); + } + +- protected void actionPerformed(GuiButton var1) { +- if(var1.id == 666) { ++ /** ++ * Fired when a control is clicked. This is the equivalent of ActionListener.actionPerformed(ActionEvent e). ++ */ ++ protected void actionPerformed(GuiButton par1GuiButton) { ++ if (par1GuiButton.id == 666) { + this.screenWasClosed = true; + this.mc.displayGuiScreen(this.previousScreen); + } + +- this.task.buttonClicked(var1); ++ this.task.buttonClicked(par1GuiButton); + } + +- public void drawScreen(int var1, int var2, float var3) { ++ /** ++ * Draws the screen and all the components in it. ++ */ ++ public void drawScreen(int par1, int par2, float par3) { + this.drawDefaultBackground(); +- this.drawCenteredString(this.fontRenderer, this.e, this.width / 2, this.height / 2 - 50, 16777215); ++ this.drawCenteredString(this.fontRenderer, this.message, this.width / 2, this.height / 2 - 50, 16777215); + this.drawCenteredString(this.fontRenderer, "", this.width / 2, this.height / 2 - 10, 16777215); +- if(!this.taskFailed) { +- this.drawCenteredString(this.fontRenderer, a[this.progressCounter % a.length], this.width / 2, this.height / 2 + 15, 8421504); +- } +- +- if(this.taskFailed) { +- this.drawCenteredString(this.fontRenderer, this.q, this.width / 2, this.height / 2 + 15, 16711680); +- } +- +- super.drawScreen(var1, var2, var3); ++ ++ if (!this.taskFailed) { ++ this.drawCenteredString(this.fontRenderer, PROGRESS_TEXT[this.progressCounter % PROGRESS_TEXT.length], this.width / 2, this.height / 2 + 15, 8421504); ++ } ++ ++ if (this.taskFailed) { ++ this.drawCenteredString(this.fontRenderer, this.failedMessage, this.width / 2, this.height / 2 + 15, 16711680); ++ } ++ ++ super.drawScreen(par1, par2, par3); + } + +- public void setFailedMessage(String var1) { ++ public void setFailedMessage(String par1Str) { + this.taskFailed = true; +- this.q = var1; +- this.i.clear(); +- this.i.add(new GuiButton(666, this.width / 2 - 100, this.height / 4 + 120 + 12, "Back")); ++ this.failedMessage = par1Str; ++ this.buttonList.clear(); ++ this.buttonList.add(new GuiButton(666, this.width / 2 - 100, this.height / 4 + 120 + 12, "Back")); + } + + public Minecraft func_96208_g() { + return this.mc; + } + +- public void setMessage(String var1) { +- this.e = var1; ++ public void setMessage(String par1Str) { ++ this.message = par1Str; + } + ++ /** ++ * Returns the value of screenWasClosed ++ */ + public boolean wasScreenClosed() { + return this.screenWasClosed; + } diff --git a/patches/net/minecraft/src/GuiScreenMcoWorldTemplate.java.patch b/patches/net/minecraft/src/GuiScreenMcoWorldTemplate.java.patch new file mode 100644 index 0000000..036e87a --- /dev/null +++ b/patches/net/minecraft/src/GuiScreenMcoWorldTemplate.java.patch @@ -0,0 +1,195 @@ +--- net/minecraft/src/GuiScreenMcoWorldTemplate.java ++++ net/minecraft/src/GuiScreenMcoWorldTemplate.java +@@ -7,111 +7,121 @@ + public class GuiScreenMcoWorldTemplate extends GuiScreen { + private final ScreenWithCallback field_110401_a; + private WorldTemplate field_110398_b; +- private List c = Collections.emptyList(); ++ private List field_110399_c = Collections.emptyList(); + private GuiScreenMcoWorldTemplateSelectionList field_110396_d; + private int field_110397_e = -1; + private GuiButton field_110400_p; + +- public GuiScreenMcoWorldTemplate(ScreenWithCallback var1, WorldTemplate var2) { +- this.field_110401_a = var1; +- this.field_110398_b = var2; ++ public GuiScreenMcoWorldTemplate(ScreenWithCallback par1ScreenWithCallback, WorldTemplate par2WorldTemplate) { ++ this.field_110401_a = par1ScreenWithCallback; ++ this.field_110398_b = par2WorldTemplate; + } + ++ /** ++ * Adds the buttons (and other controls) to the screen in question. ++ */ + public void initGui() { + Keyboard.enableRepeatEvents(true); +- this.i.clear(); ++ this.buttonList.clear(); + this.field_110396_d = new GuiScreenMcoWorldTemplateSelectionList(this); + (new GuiScreenMcoWorldTemplateDownloadThread(this)).start(); + this.func_110385_g(); + } + + private void func_110385_g() { +- this.i.add(new GuiButton(0, this.width / 2 + 6, this.height - 52, 153, 20, I18n.getString("gui.cancel"))); +- this.i.add(this.field_110400_p = new GuiButton(1, this.width / 2 - 154, this.height - 52, 153, 20, I18n.getString("mco.template.button.select"))); ++ this.buttonList.add(new GuiButton(0, this.width / 2 + 6, this.height - 52, 153, 20, I18n.getString("gui.cancel"))); ++ this.buttonList.add(this.field_110400_p = new GuiButton(1, this.width / 2 - 154, this.height - 52, 153, 20, I18n.getString("mco.template.button.select"))); + } + ++ /** ++ * Called from the main game loop to update the screen. ++ */ + public void updateScreen() { + super.updateScreen(); + } + +- protected void actionPerformed(GuiButton var1) { +- if(var1.enabled) { +- if(var1.id == 1) { ++ /** ++ * Fired when a control is clicked. This is the equivalent of ActionListener.actionPerformed(ActionEvent e). ++ */ ++ protected void actionPerformed(GuiButton par1GuiButton) { ++ if (par1GuiButton.enabled) { ++ if (par1GuiButton.id == 1) { + this.func_110394_h(); +- } else if(var1.id == 0) { ++ } else if (par1GuiButton.id == 0) { + this.field_110401_a.func_110354_a((Object)null); + this.mc.displayGuiScreen(this.field_110401_a); + } else { +- this.field_110396_d.actionPerformed(var1); ++ this.field_110396_d.actionPerformed(par1GuiButton); + } +- + } + } + + private void func_110394_h() { +- if(this.field_110397_e >= 0 && this.field_110397_e < this.c.size()) { +- this.field_110401_a.func_110354_a(this.c.get(this.field_110397_e)); ++ if (this.field_110397_e >= 0 && this.field_110397_e < this.field_110399_c.size()) { ++ this.field_110401_a.func_110354_a(this.field_110399_c.get(this.field_110397_e)); + this.mc.displayGuiScreen(this.field_110401_a); + } +- + } + +- public void drawScreen(int var1, int var2, float var3) { ++ /** ++ * Draws the screen and all the components in it. ++ */ ++ public void drawScreen(int par1, int par2, float par3) { + this.drawDefaultBackground(); +- this.field_110396_d.drawScreen(var1, var2, var3); ++ this.field_110396_d.drawScreen(par1, par2, par3); + this.drawCenteredString(this.fontRenderer, I18n.getString("mco.template.title"), this.width / 2, 20, 16777215); +- super.drawScreen(var1, var2, var3); +- } +- +- static Minecraft func_110382_a(GuiScreenMcoWorldTemplate var0) { +- return var0.mc; +- } +- +- static List func_110388_a(GuiScreenMcoWorldTemplate var0, List var1) { +- return var0.c = var1; +- } +- +- static Minecraft func_110392_b(GuiScreenMcoWorldTemplate var0) { +- return var0.mc; +- } +- +- static Minecraft func_130066_c(GuiScreenMcoWorldTemplate var0) { +- return var0.mc; +- } +- +- static List func_110395_c(GuiScreenMcoWorldTemplate var0) { +- return var0.c; +- } +- +- static int func_130064_a(GuiScreenMcoWorldTemplate var0, int var1) { +- return var0.field_110397_e = var1; +- } +- +- static WorldTemplate func_130065_a(GuiScreenMcoWorldTemplate var0, WorldTemplate var1) { +- return var0.field_110398_b = var1; +- } +- +- static WorldTemplate func_130067_e(GuiScreenMcoWorldTemplate var0) { +- return var0.field_110398_b; +- } +- +- static int func_130062_f(GuiScreenMcoWorldTemplate var0) { +- return var0.field_110397_e; +- } +- +- static FontRenderer func_110389_g(GuiScreenMcoWorldTemplate var0) { +- return var0.fontRenderer; +- } +- +- static FontRenderer func_110387_h(GuiScreenMcoWorldTemplate var0) { +- return var0.fontRenderer; +- } +- +- static FontRenderer func_110384_i(GuiScreenMcoWorldTemplate var0) { +- return var0.fontRenderer; +- } +- +- static FontRenderer func_130063_j(GuiScreenMcoWorldTemplate var0) { +- return var0.fontRenderer; ++ super.drawScreen(par1, par2, par3); ++ } ++ ++ static Minecraft func_110382_a(GuiScreenMcoWorldTemplate par0GuiScreenMcoWorldTemplate) { ++ return par0GuiScreenMcoWorldTemplate.mc; ++ } ++ ++ static List func_110388_a(GuiScreenMcoWorldTemplate par0GuiScreenMcoWorldTemplate, List par1List) { ++ return par0GuiScreenMcoWorldTemplate.field_110399_c = par1List; ++ } ++ ++ static Minecraft func_110392_b(GuiScreenMcoWorldTemplate par0GuiScreenMcoWorldTemplate) { ++ return par0GuiScreenMcoWorldTemplate.mc; ++ } ++ ++ static Minecraft func_130066_c(GuiScreenMcoWorldTemplate par0GuiScreenMcoWorldTemplate) { ++ return par0GuiScreenMcoWorldTemplate.mc; ++ } ++ ++ static List func_110395_c(GuiScreenMcoWorldTemplate par0GuiScreenMcoWorldTemplate) { ++ return par0GuiScreenMcoWorldTemplate.field_110399_c; ++ } ++ ++ static int func_130064_a(GuiScreenMcoWorldTemplate par0GuiScreenMcoWorldTemplate, int par1) { ++ return par0GuiScreenMcoWorldTemplate.field_110397_e = par1; ++ } ++ ++ static WorldTemplate func_130065_a(GuiScreenMcoWorldTemplate par0GuiScreenMcoWorldTemplate, WorldTemplate par1WorldTemplate) { ++ return par0GuiScreenMcoWorldTemplate.field_110398_b = par1WorldTemplate; ++ } ++ ++ static WorldTemplate func_130067_e(GuiScreenMcoWorldTemplate par0GuiScreenMcoWorldTemplate) { ++ return par0GuiScreenMcoWorldTemplate.field_110398_b; ++ } ++ ++ static int func_130062_f(GuiScreenMcoWorldTemplate par0GuiScreenMcoWorldTemplate) { ++ return par0GuiScreenMcoWorldTemplate.field_110397_e; ++ } ++ ++ static FontRenderer func_110389_g(GuiScreenMcoWorldTemplate par0GuiScreenMcoWorldTemplate) { ++ return par0GuiScreenMcoWorldTemplate.fontRenderer; ++ } ++ ++ static FontRenderer func_110387_h(GuiScreenMcoWorldTemplate par0GuiScreenMcoWorldTemplate) { ++ return par0GuiScreenMcoWorldTemplate.fontRenderer; ++ } ++ ++ static FontRenderer func_110384_i(GuiScreenMcoWorldTemplate par0GuiScreenMcoWorldTemplate) { ++ return par0GuiScreenMcoWorldTemplate.fontRenderer; ++ } ++ ++ static FontRenderer func_130063_j(GuiScreenMcoWorldTemplate par0GuiScreenMcoWorldTemplate) { ++ return par0GuiScreenMcoWorldTemplate.fontRenderer; + } + } diff --git a/patches/net/minecraft/src/GuiScreenMcoWorldTemplateDownloadThread.java.patch b/patches/net/minecraft/src/GuiScreenMcoWorldTemplateDownloadThread.java.patch new file mode 100644 index 0000000..eed28ec --- /dev/null +++ b/patches/net/minecraft/src/GuiScreenMcoWorldTemplateDownloadThread.java.patch @@ -0,0 +1,24 @@ +--- net/minecraft/src/GuiScreenMcoWorldTemplateDownloadThread.java ++++ net/minecraft/src/GuiScreenMcoWorldTemplateDownloadThread.java +@@ -3,18 +3,17 @@ + class GuiScreenMcoWorldTemplateDownloadThread extends Thread { + final GuiScreenMcoWorldTemplate field_111256_a; + +- GuiScreenMcoWorldTemplateDownloadThread(GuiScreenMcoWorldTemplate var1) { +- this.field_111256_a = var1; ++ GuiScreenMcoWorldTemplateDownloadThread(GuiScreenMcoWorldTemplate par1GuiScreenMcoWorldTemplate) { ++ this.field_111256_a = par1GuiScreenMcoWorldTemplate; + } + + public void run() { + McoClient var1 = new McoClient(GuiScreenMcoWorldTemplate.func_110382_a(this.field_111256_a).getSession()); + + try { +- GuiScreenMcoWorldTemplate.func_110388_a(this.field_111256_a, var1.func_111231_d().a); ++ GuiScreenMcoWorldTemplate.func_110388_a(this.field_111256_a, var1.func_111231_d().field_110736_a); + } catch (ExceptionMcoService var3) { + GuiScreenMcoWorldTemplate.func_110392_b(this.field_111256_a).getLogAgent().logSevere(var3.toString()); + } +- + } + } diff --git a/patches/net/minecraft/src/GuiScreenMcoWorldTemplateSelectionList.java.patch b/patches/net/minecraft/src/GuiScreenMcoWorldTemplateSelectionList.java.patch new file mode 100644 index 0000000..d9205ef --- /dev/null +++ b/patches/net/minecraft/src/GuiScreenMcoWorldTemplateSelectionList.java.patch @@ -0,0 +1,74 @@ +--- net/minecraft/src/GuiScreenMcoWorldTemplateSelectionList.java ++++ net/minecraft/src/GuiScreenMcoWorldTemplateSelectionList.java +@@ -3,27 +3,36 @@ + class GuiScreenMcoWorldTemplateSelectionList extends GuiScreenSelectLocation { + final GuiScreenMcoWorldTemplate field_111245_a; + +- public GuiScreenMcoWorldTemplateSelectionList(GuiScreenMcoWorldTemplate var1) { +- super(GuiScreenMcoWorldTemplate.func_130066_c(var1), var1.width, var1.height, 32, var1.height - 64, 36); +- this.field_111245_a = var1; ++ public GuiScreenMcoWorldTemplateSelectionList(GuiScreenMcoWorldTemplate par1GuiScreenMcoWorldTemplate) { ++ super(GuiScreenMcoWorldTemplate.func_130066_c(par1GuiScreenMcoWorldTemplate), par1GuiScreenMcoWorldTemplate.width, par1GuiScreenMcoWorldTemplate.height, 32, par1GuiScreenMcoWorldTemplate.height - 64, 36); ++ this.field_111245_a = par1GuiScreenMcoWorldTemplate; + } + ++ /** ++ * Gets the size of the current slot list. ++ */ + protected int getSize() { + return GuiScreenMcoWorldTemplate.func_110395_c(this.field_111245_a).size() + 1; + } + +- protected void elementClicked(int var1, boolean var2) { +- if(var1 < GuiScreenMcoWorldTemplate.func_110395_c(this.field_111245_a).size()) { +- GuiScreenMcoWorldTemplate.func_130064_a(this.field_111245_a, var1); ++ /** ++ * the element in the slot that was clicked, boolean for wether it was double clicked or not ++ */ ++ protected void elementClicked(int par1, boolean par2) { ++ if (par1 < GuiScreenMcoWorldTemplate.func_110395_c(this.field_111245_a).size()) { ++ GuiScreenMcoWorldTemplate.func_130064_a(this.field_111245_a, par1); + GuiScreenMcoWorldTemplate.func_130065_a(this.field_111245_a, (WorldTemplate)null); + } + } + +- protected boolean isSelected(int var1) { +- return GuiScreenMcoWorldTemplate.func_110395_c(this.field_111245_a).size() == 0 ? false : (var1 >= GuiScreenMcoWorldTemplate.func_110395_c(this.field_111245_a).size() ? false : (GuiScreenMcoWorldTemplate.func_130067_e(this.field_111245_a) != null ? GuiScreenMcoWorldTemplate.func_130067_e(this.field_111245_a).b.equals(((WorldTemplate)GuiScreenMcoWorldTemplate.func_110395_c(this.field_111245_a).get(var1)).b) : var1 == GuiScreenMcoWorldTemplate.func_130062_f(this.field_111245_a))); ++ /** ++ * returns true if the element passed in is currently selected ++ */ ++ protected boolean isSelected(int par1) { ++ return GuiScreenMcoWorldTemplate.func_110395_c(this.field_111245_a).size() == 0 ? false : (par1 >= GuiScreenMcoWorldTemplate.func_110395_c(this.field_111245_a).size() ? false : (GuiScreenMcoWorldTemplate.func_130067_e(this.field_111245_a) != null ? GuiScreenMcoWorldTemplate.func_130067_e(this.field_111245_a).field_110732_b.equals(((WorldTemplate)GuiScreenMcoWorldTemplate.func_110395_c(this.field_111245_a).get(par1)).field_110732_b) : par1 == GuiScreenMcoWorldTemplate.func_130062_f(this.field_111245_a))); + } + +- protected boolean func_104086_b(int var1) { ++ protected boolean func_104086_b(int par1) { + return false; + } + +@@ -35,17 +44,16 @@ + this.field_111245_a.drawDefaultBackground(); + } + +- protected void drawSlot(int var1, int var2, int var3, int var4, Tessellator var5) { +- if(var1 < GuiScreenMcoWorldTemplate.func_110395_c(this.field_111245_a).size()) { +- this.func_111244_b(var1, var2, var3, var4, var5); ++ protected void drawSlot(int par1, int par2, int par3, int par4, Tessellator par5Tessellator) { ++ if (par1 < GuiScreenMcoWorldTemplate.func_110395_c(this.field_111245_a).size()) { ++ this.func_111244_b(par1, par2, par3, par4, par5Tessellator); + } +- + } + +- private void func_111244_b(int var1, int var2, int var3, int var4, Tessellator var5) { +- WorldTemplate var6 = (WorldTemplate)GuiScreenMcoWorldTemplate.func_110395_c(this.field_111245_a).get(var1); +- this.field_111245_a.drawString(GuiScreenMcoWorldTemplate.func_110389_g(this.field_111245_a), var6.b, var2 + 2, var3 + 1, 16777215); +- this.field_111245_a.drawString(GuiScreenMcoWorldTemplate.func_110387_h(this.field_111245_a), var6.d, var2 + 2, var3 + 12, 7105644); +- this.field_111245_a.drawString(GuiScreenMcoWorldTemplate.func_110384_i(this.field_111245_a), var6.c, var2 + 2 + 207 - GuiScreenMcoWorldTemplate.func_130063_j(this.field_111245_a).getStringWidth(var6.c), var3 + 1, 5000268); ++ private void func_111244_b(int par1, int par2, int par3, int par4, Tessellator par5Tessellator) { ++ WorldTemplate var6 = (WorldTemplate)GuiScreenMcoWorldTemplate.func_110395_c(this.field_111245_a).get(par1); ++ this.field_111245_a.drawString(GuiScreenMcoWorldTemplate.func_110389_g(this.field_111245_a), var6.field_110732_b, par2 + 2, par3 + 1, 16777215); ++ this.field_111245_a.drawString(GuiScreenMcoWorldTemplate.func_110387_h(this.field_111245_a), var6.field_110731_d, par2 + 2, par3 + 12, 7105644); ++ this.field_111245_a.drawString(GuiScreenMcoWorldTemplate.func_110384_i(this.field_111245_a), var6.field_110733_c, par2 + 2 + 207 - GuiScreenMcoWorldTemplate.func_130063_j(this.field_111245_a).getStringWidth(var6.field_110733_c), par3 + 1, 5000268); + } + } diff --git a/patches/net/minecraft/src/GuiScreenOnlineServers.java.patch b/patches/net/minecraft/src/GuiScreenOnlineServers.java.patch new file mode 100644 index 0000000..58ac351 --- /dev/null +++ b/patches/net/minecraft/src/GuiScreenOnlineServers.java.patch @@ -0,0 +1,857 @@ +--- net/minecraft/src/GuiScreenOnlineServers.java ++++ net/minecraft/src/GuiScreenOnlineServers.java +@@ -16,29 +16,33 @@ + private GuiScreen field_96188_a; + private GuiSlotOnlineServerList field_96186_b; + private static int field_96187_c; +- private static final Object e = new Object(); ++ private static final Object field_96185_d = new Object(); + private long field_96189_n = -1L; + private GuiButton field_96190_o; + private GuiButton field_96198_p; + private GuiButtonLink field_96197_q; + private GuiButton field_96196_r; +- private String u; ++ private String field_96195_s; + private static McoServerList field_96194_t = new McoServerList(); + private boolean field_96193_u; +- private List x = Lists.newArrayList(); ++ private List field_96192_v = Lists.newArrayList(); + private volatile int field_96199_x = 0; +- private Long z; ++ private Long field_102019_y; + private int field_104044_y; + +- public GuiScreenOnlineServers(GuiScreen var1) { +- this.field_96188_a = var1; ++ public GuiScreenOnlineServers(GuiScreen par1GuiScreen) { ++ this.field_96188_a = par1GuiScreen; + } + ++ /** ++ * Adds the buttons (and other controls) to the screen in question. ++ */ + public void initGui() { + Keyboard.enableRepeatEvents(true); +- this.i.clear(); ++ this.buttonList.clear(); + field_96194_t.func_130129_a(this.mc.getSession()); +- if(!this.field_96193_u) { ++ ++ if (!this.field_96193_u) { + this.field_96193_u = true; + this.field_96186_b = new GuiSlotOnlineServerList(this); + } else { +@@ -49,86 +53,97 @@ + } + + public void func_96178_g() { +- this.i.add(this.field_96196_r = new GuiButton(1, this.width / 2 - 154, this.height - 52, 100, 20, I18n.getString("mco.selectServer.play"))); +- this.i.add(this.field_96198_p = new GuiButton(2, this.width / 2 - 48, this.height - 52, 100, 20, I18n.getString("mco.selectServer.create"))); +- this.i.add(this.field_96190_o = new GuiButton(3, this.width / 2 + 58, this.height - 52, 100, 20, I18n.getString("mco.selectServer.configure"))); +- this.i.add(this.field_96197_q = new GuiButtonLink(4, this.width / 2 - 154, this.height - 28, 154, 20, I18n.getString("mco.selectServer.moreinfo"))); +- this.i.add(new GuiButton(0, this.width / 2 + 6, this.height - 28, 153, 20, I18n.getString("gui.cancel"))); ++ this.buttonList.add(this.field_96196_r = new GuiButton(1, this.width / 2 - 154, this.height - 52, 100, 20, I18n.getString("mco.selectServer.play"))); ++ this.buttonList.add(this.field_96198_p = new GuiButton(2, this.width / 2 - 48, this.height - 52, 100, 20, I18n.getString("mco.selectServer.create"))); ++ this.buttonList.add(this.field_96190_o = new GuiButton(3, this.width / 2 + 58, this.height - 52, 100, 20, I18n.getString("mco.selectServer.configure"))); ++ this.buttonList.add(this.field_96197_q = new GuiButtonLink(4, this.width / 2 - 154, this.height - 28, 154, 20, I18n.getString("mco.selectServer.moreinfo"))); ++ this.buttonList.add(new GuiButton(0, this.width / 2 + 6, this.height - 28, 153, 20, I18n.getString("gui.cancel"))); + McoServer var1 = this.func_140030_b(this.field_96189_n); +- this.field_96196_r.enabled = var1 != null && var1.d.equals("OPEN") && !var1.field_98166_h; ++ this.field_96196_r.enabled = var1 != null && var1.field_96404_d.equals("OPEN") && !var1.field_98166_h; + this.field_96198_p.enabled = this.field_96199_x > 0; +- if(var1 != null && !var1.e.equals(this.mc.getSession().getUsername())) { +- this.field_96190_o.f = I18n.getString("mco.selectServer.leave"); ++ ++ if (var1 != null && !var1.field_96405_e.equals(this.mc.getSession().getUsername())) { ++ this.field_96190_o.displayString = I18n.getString("mco.selectServer.leave"); + } +- + } + ++ /** ++ * Called from the main game loop to update the screen. ++ */ + public void updateScreen() { + super.updateScreen(); + ++this.field_104044_y; +- if(field_96194_t.func_130127_a()) { ++ ++ if (field_96194_t.func_130127_a()) { + List var1 = field_96194_t.func_98252_c(); + Iterator var2 = var1.iterator(); + +- while(true) { +- while(var2.hasNext()) { +- McoServer var3 = (McoServer)var2.next(); +- Iterator var4 = this.x.iterator(); +- +- while(var4.hasNext()) { +- McoServer var5 = (McoServer)var4.next(); +- if(var3.field_96408_a == var5.field_96408_a) { +- var3.func_96401_a(var5); +- if(this.z != null && this.z.longValue() == var3.field_96408_a) { +- this.z = null; +- var3.field_96411_l = false; +- } +- break; ++ while (var2.hasNext()) { ++ McoServer var3 = (McoServer)var2.next(); ++ Iterator var4 = this.field_96192_v.iterator(); ++ ++ while (var4.hasNext()) { ++ McoServer var5 = (McoServer)var4.next(); ++ ++ if (var3.field_96408_a == var5.field_96408_a) { ++ var3.func_96401_a(var5); ++ ++ if (this.field_102019_y != null && this.field_102019_y.longValue() == var3.field_96408_a) { ++ this.field_102019_y = null; ++ var3.field_96411_l = false; + } ++ ++ break; + } + } +- +- this.field_96199_x = field_96194_t.func_140056_e(); +- this.x = var1; +- field_96194_t.func_98250_b(); +- break; + } ++ ++ this.field_96199_x = field_96194_t.func_140056_e(); ++ this.field_96192_v = var1; ++ field_96194_t.func_98250_b(); + } + + this.field_96198_p.enabled = this.field_96199_x > 0; + } + ++ /** ++ * Called when the screen is unloaded. Used to disable keyboard repeat events ++ */ + public void onGuiClosed() { + Keyboard.enableRepeatEvents(false); + } + +- protected void actionPerformed(GuiButton var1) { +- if(var1.enabled) { +- if(var1.id == 1) { ++ /** ++ * Fired when a control is clicked. This is the equivalent of ActionListener.actionPerformed(ActionEvent e). ++ */ ++ protected void actionPerformed(GuiButton par1GuiButton) { ++ if (par1GuiButton.enabled) { ++ if (par1GuiButton.id == 1) { + this.func_140032_e(this.field_96189_n); +- } else if(var1.id == 3) { ++ } else if (par1GuiButton.id == 3) { + this.func_140019_s(); +- } else if(var1.id == 0) { ++ } else if (par1GuiButton.id == 0) { + field_96194_t.func_98248_d(); + this.mc.displayGuiScreen(this.field_96188_a); +- } else if(var1.id == 2) { ++ } else if (par1GuiButton.id == 2) { + field_96194_t.func_98248_d(); + this.mc.displayGuiScreen(new GuiScreenCreateOnlineWorld(this)); +- } else if(var1.id == 4) { ++ } else if (par1GuiButton.id == 4) { + this.field_96197_q.func_96135_a("http://realms.minecraft.net/"); + } else { +- this.field_96186_b.actionPerformed(var1); ++ this.field_96186_b.actionPerformed(par1GuiButton); + } +- + } + } + + private void func_140019_s() { + McoServer var1 = this.func_140030_b(this.field_96189_n); +- if(var1 != null) { +- if(this.mc.getSession().getUsername().equals(var1.e)) { ++ ++ if (var1 != null) { ++ if (this.mc.getSession().getUsername().equals(var1.field_96405_e)) { + McoServer var2 = this.func_98086_a(var1.field_96408_a); +- if(var2 != null) { ++ ++ if (var2 != null) { + field_96194_t.func_98248_d(); + this.mc.displayGuiScreen(new GuiScreenConfigureWorld(this, var2)); + } +@@ -138,27 +153,26 @@ + this.mc.displayGuiScreen(new GuiScreenConfirmation(this, GuiScreenConfirmationType.Info, var4, var3, 3)); + } + } +- + } + +- private McoServer func_140030_b(long var1) { +- Iterator var3 = this.x.iterator(); +- ++ private McoServer func_140030_b(long par1) { ++ Iterator var3 = this.field_96192_v.iterator(); + McoServer var4; ++ + do { +- if(!var3.hasNext()) { ++ if (!var3.hasNext()) { + return null; + } + + var4 = (McoServer)var3.next(); +- } while(var4.field_96408_a != var1); ++ } while (var4.field_96408_a != par1); + + return var4; + } + +- private int func_140009_c(long var1) { +- for(int var3 = 0; var3 < this.x.size(); ++var3) { +- if(((McoServer)this.x.get(var3)).field_96408_a == var1) { ++ private int func_140009_c(long par1) { ++ for (int var3 = 0; var3 < this.field_96192_v.size(); ++var3) { ++ if (((McoServer)this.field_96192_v.get(var3)).field_96408_a == par1) { + return var3; + } + } +@@ -166,8 +180,8 @@ + return -1; + } + +- public void confirmClicked(boolean var1, int var2) { +- if(var2 == 3 && var1) { ++ public void confirmClicked(boolean par1, int par2) { ++ if (par2 == 3 && par1) { + (new ThreadOnlineScreen(this)).start(); + } + +@@ -176,30 +190,30 @@ + + private void func_140012_t() { + int var1 = this.func_140009_c(this.field_96189_n); +- if(this.x.size() - 1 == var1) { ++ ++ if (this.field_96192_v.size() - 1 == var1) { + --var1; + } + +- if(this.x.size() == 0) { ++ if (this.field_96192_v.size() == 0) { + var1 = -1; + } + +- if(var1 >= 0 && var1 < this.x.size()) { +- this.field_96189_n = ((McoServer)this.x.get(var1)).field_96408_a; ++ if (var1 >= 0 && var1 < this.field_96192_v.size()) { ++ this.field_96189_n = ((McoServer)this.field_96192_v.get(var1)).field_96408_a; + } +- + } + +- public void func_102018_a(long var1) { ++ public void func_102018_a(long par1) { + this.field_96189_n = -1L; +- this.z = Long.valueOf(var1); ++ this.field_102019_y = Long.valueOf(par1); + } + +- private McoServer func_98086_a(long var1) { ++ private McoServer func_98086_a(long par1) { + McoClient var3 = new McoClient(this.mc.getSession()); + + try { +- return var3.func_98176_a(var1); ++ return var3.func_98176_a(par1); + } catch (ExceptionMcoService var5) { + this.mc.getLogAgent().logSevere(var5.toString()); + } catch (IOException var6) { +@@ -209,45 +223,54 @@ + return null; + } + +- protected void keyTyped(char var1, int var2) { +- if(var2 == 59) { ++ /** ++ * Fired when a key is typed. This is the equivalent of KeyListener.keyTyped(KeyEvent e). ++ */ ++ protected void keyTyped(char par1, int par2) { ++ if (par2 == 59) { + this.mc.gameSettings.hideServerAddress = !this.mc.gameSettings.hideServerAddress; + this.mc.gameSettings.saveOptions(); + } else { +- if(var2 != 28 && var2 != 156) { +- super.keyTyped(var1, var2); ++ if (par2 != 28 && par2 != 156) { ++ super.keyTyped(par1, par2); + } else { +- this.actionPerformed((GuiButton)this.i.get(0)); ++ this.actionPerformed((GuiButton)this.buttonList.get(0)); + } +- + } + } + +- public void drawScreen(int var1, int var2, float var3) { +- this.u = null; ++ /** ++ * Draws the screen and all the components in it. ++ */ ++ public void drawScreen(int par1, int par2, float par3) { ++ this.field_96195_s = null; + this.drawDefaultBackground(); +- this.field_96186_b.drawScreen(var1, var2, var3); ++ this.field_96186_b.drawScreen(par1, par2, par3); + this.drawCenteredString(this.fontRenderer, I18n.getString("mco.title"), this.width / 2, 20, 16777215); +- super.drawScreen(var1, var2, var3); +- if(this.u != null) { +- this.func_96165_a(this.u, var1, var2); ++ super.drawScreen(par1, par2, par3); ++ ++ if (this.field_96195_s != null) { ++ this.func_96165_a(this.field_96195_s, par1, par2); + } + +- this.func_130038_b(var1, var2); ++ this.func_130038_b(par1, par2); + } + +- protected void mouseClicked(int var1, int var2, int var3) { +- super.mouseClicked(var1, var2, var3); +- if(this.func_130037_c(var1, var2) && field_96194_t.func_130124_d() != 0) { ++ /** ++ * Called when the mouse is clicked. ++ */ ++ protected void mouseClicked(int par1, int par2, int par3) { ++ super.mouseClicked(par1, par2, par3); ++ ++ if (this.func_130037_c(par1, par2) && field_96194_t.func_130124_d() != 0) { + GuiScreenPendingInvitation var4 = new GuiScreenPendingInvitation(this); + this.mc.displayGuiScreen(var4); + } +- + } + +- private void func_130038_b(int var1, int var2) { ++ private void func_130038_b(int par1, int par2) { + int var3 = field_96194_t.func_130124_d(); +- boolean var4 = this.func_130037_c(var1, var2); ++ boolean var4 = this.func_130037_c(par1, par2); + this.mc.getTextureManager().bindTexture(field_130039_a); + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + GL11.glPushMatrix(); +@@ -255,7 +278,8 @@ + GL11.glPopMatrix(); + int var5; + int var6; +- if(var3 != 0) { ++ ++ if (var3 != 0) { + var5 = 198 + (Math.min(var3, 6) - 1) * 8; + var6 = (int)(Math.max(0.0F, Math.max(MathHelper.sin((float)(10 + this.field_104044_y) * 0.57F), MathHelper.cos((float)this.field_104044_y * 0.35F))) * -6.0F); + this.mc.getTextureManager().bindTexture(field_130039_a); +@@ -265,114 +289,112 @@ + GL11.glPopMatrix(); + } + +- if(var4 && var3 != 0) { +- var5 = var1 + 12; +- var6 = var2 - 12; ++ if (var4 && var3 != 0) { ++ var5 = par1 + 12; ++ var6 = par2 - 12; + String var7 = I18n.getString("mco.invites.pending"); + int var8 = this.fontRenderer.getStringWidth(var7); + this.drawGradientRect(var5 - 3, var6 - 3, var5 + var8 + 3, var6 + 8 + 3, -1073741824, -1073741824); + this.fontRenderer.drawStringWithShadow(var7, var5, var6, -1); + } +- + } + +- private boolean func_130037_c(int var1, int var2) { ++ private boolean func_130037_c(int par1, int par2) { + int var3 = this.width / 2 + 56; + int var4 = this.width / 2 + 78; + byte var5 = 13; + byte var6 = 27; +- return var3 <= var1 && var1 <= var4 && var5 <= var2 && var2 <= var6; ++ return var3 <= par1 && par1 <= var4 && var5 <= par2 && par2 <= var6; + } + +- private void func_140032_e(long var1) { +- McoServer var3 = this.func_140030_b(var1); +- if(var3 != null) { ++ private void func_140032_e(long par1) { ++ McoServer var3 = this.func_140030_b(par1); ++ ++ if (var3 != null) { + field_96194_t.func_98248_d(); + GuiScreenLongRunningTask var4 = new GuiScreenLongRunningTask(this.mc, this, new TaskOnlineConnect(this, var3)); + var4.func_98117_g(); + this.mc.displayGuiScreen(var4); + } +- + } + +- private void func_101008_c(int var1, int var2, int var3, int var4) { ++ private void func_101008_c(int par1, int par2, int par3, int par4) { + this.mc.getTextureManager().bindTexture(field_130039_a); + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + GL11.glPushMatrix(); + GL11.glScalef(0.5F, 0.5F, 0.5F); +- this.drawTexturedModalRect(var1 * 2, var2 * 2, 191, 0, 16, 15); ++ this.drawTexturedModalRect(par1 * 2, par2 * 2, 191, 0, 16, 15); + GL11.glPopMatrix(); +- if(var3 >= var1 && var3 <= var1 + 9 && var4 >= var2 && var4 <= var2 + 9) { +- this.u = I18n.getString("mco.selectServer.expired"); ++ ++ if (par3 >= par1 && par3 <= par1 + 9 && par4 >= par2 && par4 <= par2 + 9) { ++ this.field_96195_s = I18n.getString("mco.selectServer.expired"); + } +- + } + +- private void func_104039_b(int var1, int var2, int var3, int var4, int var5) { +- if(this.field_104044_y % 20 < 10) { ++ private void func_104039_b(int par1, int par2, int par3, int par4, int par5) { ++ if (this.field_104044_y % 20 < 10) { + this.mc.getTextureManager().bindTexture(field_130039_a); + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + GL11.glPushMatrix(); + GL11.glScalef(0.5F, 0.5F, 0.5F); +- this.drawTexturedModalRect(var1 * 2, var2 * 2, 207, 0, 16, 15); ++ this.drawTexturedModalRect(par1 * 2, par2 * 2, 207, 0, 16, 15); + GL11.glPopMatrix(); + } + +- if(var3 >= var1 && var3 <= var1 + 9 && var4 >= var2 && var4 <= var2 + 9) { +- if(var5 == 0) { +- this.u = I18n.getString("mco.selectServer.expires.soon"); +- } else if(var5 == 1) { +- this.u = I18n.getString("mco.selectServer.expires.day"); ++ if (par3 >= par1 && par3 <= par1 + 9 && par4 >= par2 && par4 <= par2 + 9) { ++ if (par5 == 0) { ++ this.field_96195_s = I18n.getString("mco.selectServer.expires.soon"); ++ } else if (par5 == 1) { ++ this.field_96195_s = I18n.getString("mco.selectServer.expires.day"); + } else { +- this.u = I18n.getStringParams("mco.selectServer.expires.days", new Object[]{Integer.valueOf(var5)}); ++ this.field_96195_s = I18n.getStringParams("mco.selectServer.expires.days", new Object[] {Integer.valueOf(par5)}); + } + } +- +- } +- +- private void func_101006_d(int var1, int var2, int var3, int var4) { +- this.mc.getTextureManager().bindTexture(field_130039_a); +- GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); +- GL11.glPushMatrix(); +- GL11.glScalef(0.5F, 0.5F, 0.5F); +- this.drawTexturedModalRect(var1 * 2, var2 * 2, 207, 0, 16, 15); +- GL11.glPopMatrix(); +- if(var3 >= var1 && var3 <= var1 + 9 && var4 >= var2 && var4 <= var2 + 9) { +- this.u = I18n.getString("mco.selectServer.open"); +- } +- +- } +- +- private void func_101001_e(int var1, int var2, int var3, int var4) { +- this.mc.getTextureManager().bindTexture(field_130039_a); +- GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); +- GL11.glPushMatrix(); +- GL11.glScalef(0.5F, 0.5F, 0.5F); +- this.drawTexturedModalRect(var1 * 2, var2 * 2, 223, 0, 16, 15); +- GL11.glPopMatrix(); +- if(var3 >= var1 && var3 <= var1 + 9 && var4 >= var2 && var4 <= var2 + 9) { +- this.u = I18n.getString("mco.selectServer.closed"); +- } +- +- } +- +- protected void func_96165_a(String var1, int var2, int var3) { +- if(var1 != null) { +- int var4 = var2 + 12; +- int var5 = var3 - 12; +- int var6 = this.fontRenderer.getStringWidth(var1); ++ } ++ ++ private void func_101006_d(int par1, int par2, int par3, int par4) { ++ this.mc.getTextureManager().bindTexture(field_130039_a); ++ GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); ++ GL11.glPushMatrix(); ++ GL11.glScalef(0.5F, 0.5F, 0.5F); ++ this.drawTexturedModalRect(par1 * 2, par2 * 2, 207, 0, 16, 15); ++ GL11.glPopMatrix(); ++ ++ if (par3 >= par1 && par3 <= par1 + 9 && par4 >= par2 && par4 <= par2 + 9) { ++ this.field_96195_s = I18n.getString("mco.selectServer.open"); ++ } ++ } ++ ++ private void func_101001_e(int par1, int par2, int par3, int par4) { ++ this.mc.getTextureManager().bindTexture(field_130039_a); ++ GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); ++ GL11.glPushMatrix(); ++ GL11.glScalef(0.5F, 0.5F, 0.5F); ++ this.drawTexturedModalRect(par1 * 2, par2 * 2, 223, 0, 16, 15); ++ GL11.glPopMatrix(); ++ ++ if (par3 >= par1 && par3 <= par1 + 9 && par4 >= par2 && par4 <= par2 + 9) { ++ this.field_96195_s = I18n.getString("mco.selectServer.closed"); ++ } ++ } ++ ++ protected void func_96165_a(String par1Str, int par2, int par3) { ++ if (par1Str != null) { ++ int var4 = par2 + 12; ++ int var5 = par3 - 12; ++ int var6 = this.fontRenderer.getStringWidth(par1Str); + this.drawGradientRect(var4 - 3, var5 - 3, var4 + var6 + 3, var5 + 8 + 3, -1073741824, -1073741824); +- this.fontRenderer.drawStringWithShadow(var1, var4, var5, -1); ++ this.fontRenderer.drawStringWithShadow(par1Str, var4, var5, -1); + } + } + +- private void func_96174_a(McoServer var1) throws IOException { +- if(var1.m.equals("")) { +- var1.m = EnumChatFormatting.GRAY + "" + 0; ++ private void func_96174_a(McoServer par1McoServer) throws IOException { ++ if (par1McoServer.field_96414_k.equals("")) { ++ par1McoServer.field_96414_k = EnumChatFormatting.GRAY + "" + 0; + } + +- var1.field_96415_h = 78; +- ServerAddress var2 = ServerAddress.func_78860_a(var1.g); ++ par1McoServer.field_96415_h = 78; ++ ServerAddress var2 = ServerAddress.func_78860_a(par1McoServer.field_96403_g); + Socket var3 = null; + DataInputStream var4 = null; + DataOutputStream var5 = null; +@@ -387,15 +409,16 @@ + var5 = new DataOutputStream(var3.getOutputStream()); + var5.write(254); + var5.write(1); +- if(var4.read() != 255) { ++ ++ if (var4.read() != 255) { + throw new IOException("Bad message"); + } + + String var6 = Packet.readString(var4, 256); + char[] var7 = var6.toCharArray(); + +- for(int var8 = 0; var8 < var7.length; ++var8) { +- if(var7[var8] != 167 && var7[var8] != 0 && ChatAllowedCharacters.a.indexOf(var7[var8]) < 0) { ++ for (int var8 = 0; var8 < var7.length; ++var8) { ++ if (var7[var8] != 167 && var7[var8] != 0 && ChatAllowedCharacters.allowedCharacters.indexOf(var7[var8]) < 0) { + var7[var8] = 63; + } + } +@@ -404,20 +427,23 @@ + int var9; + int var10; + String[] var27; +- if(var6.startsWith("\u00a7") && var6.length() > 1) { ++ ++ if (var6.startsWith("\u00a7") && var6.length() > 1) { + var27 = var6.substring(1).split("\u0000"); +- if(MathHelper.parseIntWithDefault(var27[0], 0) == 1) { +- var1.field_96415_h = MathHelper.parseIntWithDefault(var27[1], var1.field_96415_h); ++ ++ if (MathHelper.parseIntWithDefault(var27[0], 0) == 1) { ++ par1McoServer.field_96415_h = MathHelper.parseIntWithDefault(var27[1], par1McoServer.field_96415_h); + var9 = MathHelper.parseIntWithDefault(var27[4], 0); + var10 = MathHelper.parseIntWithDefault(var27[5], 0); +- if(var9 >= 0 && var10 >= 0) { +- var1.m = EnumChatFormatting.GRAY + "" + var9; ++ ++ if (var9 >= 0 && var10 >= 0) { ++ par1McoServer.field_96414_k = EnumChatFormatting.GRAY + "" + var9; + } else { +- var1.m = "" + EnumChatFormatting.DARK_GRAY + "???"; ++ par1McoServer.field_96414_k = "" + EnumChatFormatting.DARK_GRAY + "???"; + } + } else { +- var1.field_96415_h = 79; +- var1.m = "" + EnumChatFormatting.DARK_GRAY + "???"; ++ par1McoServer.field_96415_h = 79; ++ par1McoServer.field_96414_k = "" + EnumChatFormatting.DARK_GRAY + "???"; + } + } else { + var27 = var6.split("\u00a7"); +@@ -429,137 +455,140 @@ + var9 = Integer.parseInt(var27[1]); + var10 = Integer.parseInt(var27[2]); + } catch (Exception var25) { ++ ; + } + +- var1.c = EnumChatFormatting.GRAY + var6; +- if(var9 >= 0 && var10 > 0) { +- var1.m = EnumChatFormatting.GRAY + "" + var9; ++ par1McoServer.field_96407_c = EnumChatFormatting.GRAY + var6; ++ ++ if (var9 >= 0 && var10 > 0) { ++ par1McoServer.field_96414_k = EnumChatFormatting.GRAY + "" + var9; + } else { +- var1.m = "" + EnumChatFormatting.DARK_GRAY + "???"; ++ par1McoServer.field_96414_k = "" + EnumChatFormatting.DARK_GRAY + "???"; + } + +- var1.field_96415_h = 77; ++ par1McoServer.field_96415_h = 77; + } + } finally { + try { +- if(var4 != null) { ++ if (var4 != null) { + var4.close(); + } + } catch (Throwable var24) { ++ ; + } + + try { +- if(var5 != null) { ++ if (var5 != null) { + var5.close(); + } + } catch (Throwable var23) { ++ ; + } + + try { +- if(var3 != null) { ++ if (var3 != null) { + var3.close(); + } + } catch (Throwable var22) { ++ ; + } +- + } +- +- } +- +- static long func_140041_a(GuiScreenOnlineServers var0) { +- return var0.field_96189_n; +- } +- +- static McoServer func_140011_a(GuiScreenOnlineServers var0, long var1) { +- return var0.func_140030_b(var1); +- } +- +- static Minecraft func_98075_b(GuiScreenOnlineServers var0) { +- return var0.mc; ++ } ++ ++ static long func_140041_a(GuiScreenOnlineServers par0GuiScreenOnlineServers) { ++ return par0GuiScreenOnlineServers.field_96189_n; ++ } ++ ++ static McoServer func_140011_a(GuiScreenOnlineServers par0GuiScreenOnlineServers, long par1) { ++ return par0GuiScreenOnlineServers.func_140030_b(par1); ++ } ++ ++ static Minecraft func_98075_b(GuiScreenOnlineServers par0GuiScreenOnlineServers) { ++ return par0GuiScreenOnlineServers.mc; + } + + static McoServerList func_140040_h() { + return field_96194_t; + } + +- static List func_140013_c(GuiScreenOnlineServers var0) { +- return var0.x; +- } +- +- static void func_140017_d(GuiScreenOnlineServers var0) { +- var0.func_140012_t(); +- } +- +- static Minecraft func_98076_f(GuiScreenOnlineServers var0) { +- return var0.mc; +- } +- +- static Minecraft func_140037_f(GuiScreenOnlineServers var0) { +- return var0.mc; +- } +- +- static long func_140036_b(GuiScreenOnlineServers var0, long var1) { +- return var0.field_96189_n = var1; +- } +- +- static Minecraft func_140015_g(GuiScreenOnlineServers var0) { +- return var0.mc; +- } +- +- static GuiButton func_140038_h(GuiScreenOnlineServers var0) { +- return var0.field_96190_o; +- } +- +- static GuiButton func_140033_i(GuiScreenOnlineServers var0) { +- return var0.field_96196_r; +- } +- +- static void func_140008_c(GuiScreenOnlineServers var0, long var1) { +- var0.func_140032_e(var1); +- } +- +- static int func_140027_d(GuiScreenOnlineServers var0, long var1) { +- return var0.func_140009_c(var1); +- } +- +- static Minecraft func_104032_j(GuiScreenOnlineServers var0) { +- return var0.mc; +- } +- +- static FontRenderer func_140023_k(GuiScreenOnlineServers var0) { +- return var0.fontRenderer; +- } +- +- static void func_104031_c(GuiScreenOnlineServers var0, int var1, int var2, int var3, int var4) { +- var0.func_101008_c(var1, var2, var3, var4); +- } +- +- static void func_140035_b(GuiScreenOnlineServers var0, int var1, int var2, int var3, int var4) { +- var0.func_101001_e(var1, var2, var3, var4); +- } +- +- static Minecraft func_140014_l(GuiScreenOnlineServers var0) { +- return var0.mc; +- } +- +- static void func_140031_a(GuiScreenOnlineServers var0, int var1, int var2, int var3, int var4, int var5) { +- var0.func_104039_b(var1, var2, var3, var4, var5); +- } +- +- static void func_140020_c(GuiScreenOnlineServers var0, int var1, int var2, int var3, int var4) { +- var0.func_101006_d(var1, var2, var3, var4); +- } +- +- static FontRenderer func_140039_m(GuiScreenOnlineServers var0) { +- return var0.fontRenderer; +- } +- +- static FontRenderer func_98079_k(GuiScreenOnlineServers var0) { +- return var0.fontRenderer; ++ static List func_140013_c(GuiScreenOnlineServers par0GuiScreenOnlineServers) { ++ return par0GuiScreenOnlineServers.field_96192_v; ++ } ++ ++ static void func_140017_d(GuiScreenOnlineServers par0GuiScreenOnlineServers) { ++ par0GuiScreenOnlineServers.func_140012_t(); ++ } ++ ++ static Minecraft func_98076_f(GuiScreenOnlineServers par0GuiScreenOnlineServers) { ++ return par0GuiScreenOnlineServers.mc; ++ } ++ ++ static Minecraft func_140037_f(GuiScreenOnlineServers par0GuiScreenOnlineServers) { ++ return par0GuiScreenOnlineServers.mc; ++ } ++ ++ static long func_140036_b(GuiScreenOnlineServers par0GuiScreenOnlineServers, long par1) { ++ return par0GuiScreenOnlineServers.field_96189_n = par1; ++ } ++ ++ static Minecraft func_140015_g(GuiScreenOnlineServers par0GuiScreenOnlineServers) { ++ return par0GuiScreenOnlineServers.mc; ++ } ++ ++ static GuiButton func_140038_h(GuiScreenOnlineServers par0GuiScreenOnlineServers) { ++ return par0GuiScreenOnlineServers.field_96190_o; ++ } ++ ++ static GuiButton func_140033_i(GuiScreenOnlineServers par0GuiScreenOnlineServers) { ++ return par0GuiScreenOnlineServers.field_96196_r; ++ } ++ ++ static void func_140008_c(GuiScreenOnlineServers par0GuiScreenOnlineServers, long par1) { ++ par0GuiScreenOnlineServers.func_140032_e(par1); ++ } ++ ++ static int func_140027_d(GuiScreenOnlineServers par0GuiScreenOnlineServers, long par1) { ++ return par0GuiScreenOnlineServers.func_140009_c(par1); ++ } ++ ++ static Minecraft func_104032_j(GuiScreenOnlineServers par0GuiScreenOnlineServers) { ++ return par0GuiScreenOnlineServers.mc; ++ } ++ ++ static FontRenderer func_140023_k(GuiScreenOnlineServers par0GuiScreenOnlineServers) { ++ return par0GuiScreenOnlineServers.fontRenderer; ++ } ++ ++ static void func_104031_c(GuiScreenOnlineServers par0GuiScreenOnlineServers, int par1, int par2, int par3, int par4) { ++ par0GuiScreenOnlineServers.func_101008_c(par1, par2, par3, par4); ++ } ++ ++ static void func_140035_b(GuiScreenOnlineServers par0GuiScreenOnlineServers, int par1, int par2, int par3, int par4) { ++ par0GuiScreenOnlineServers.func_101001_e(par1, par2, par3, par4); ++ } ++ ++ static Minecraft func_140014_l(GuiScreenOnlineServers par0GuiScreenOnlineServers) { ++ return par0GuiScreenOnlineServers.mc; ++ } ++ ++ static void func_140031_a(GuiScreenOnlineServers par0GuiScreenOnlineServers, int par1, int par2, int par3, int par4, int par5) { ++ par0GuiScreenOnlineServers.func_104039_b(par1, par2, par3, par4, par5); ++ } ++ ++ static void func_140020_c(GuiScreenOnlineServers par0GuiScreenOnlineServers, int par1, int par2, int par3, int par4) { ++ par0GuiScreenOnlineServers.func_101006_d(par1, par2, par3, par4); ++ } ++ ++ static FontRenderer func_140039_m(GuiScreenOnlineServers par0GuiScreenOnlineServers) { ++ return par0GuiScreenOnlineServers.fontRenderer; ++ } ++ ++ static FontRenderer func_98079_k(GuiScreenOnlineServers par0GuiScreenOnlineServers) { ++ return par0GuiScreenOnlineServers.fontRenderer; + } + + static Object func_140029_i() { +- return e; ++ return field_96185_d; + } + + static int func_140018_j() { +@@ -570,23 +599,23 @@ + return field_96187_c++; + } + +- static void func_140024_a(GuiScreenOnlineServers var0, McoServer var1) throws IOException { +- var0.func_96174_a(var1); ++ static void func_140024_a(GuiScreenOnlineServers par0GuiScreenOnlineServers, McoServer par1McoServer) throws IOException { ++ par0GuiScreenOnlineServers.func_96174_a(par1McoServer); + } + + static int func_140021_r() { + return field_96187_c--; + } + +- static FontRenderer func_110402_q(GuiScreenOnlineServers var0) { +- return var0.fontRenderer; +- } +- +- static FontRenderer func_140010_p(GuiScreenOnlineServers var0) { +- return var0.fontRenderer; +- } +- +- static Minecraft func_142023_q(GuiScreenOnlineServers var0) { +- return var0.mc; ++ static FontRenderer func_110402_q(GuiScreenOnlineServers par0GuiScreenOnlineServers) { ++ return par0GuiScreenOnlineServers.fontRenderer; ++ } ++ ++ static FontRenderer func_140010_p(GuiScreenOnlineServers par0GuiScreenOnlineServers) { ++ return par0GuiScreenOnlineServers.fontRenderer; ++ } ++ ++ static Minecraft func_142023_q(GuiScreenOnlineServers par0GuiScreenOnlineServers) { ++ return par0GuiScreenOnlineServers.mc; + } + } diff --git a/patches/net/minecraft/src/GuiScreenOnlineServersSubscreen.java.patch b/patches/net/minecraft/src/GuiScreenOnlineServersSubscreen.java.patch new file mode 100644 index 0000000..aba5560 --- /dev/null +++ b/patches/net/minecraft/src/GuiScreenOnlineServersSubscreen.java.patch @@ -0,0 +1,92 @@ +--- net/minecraft/src/GuiScreenOnlineServersSubscreen.java ++++ net/minecraft/src/GuiScreenOnlineServersSubscreen.java +@@ -8,60 +8,59 @@ + private final int field_104081_h; + private final int field_104082_i; + private final int field_104080_j; +- List a = new ArrayList(); +- String[] b; +- String[] c; +- String[][] d; ++ List field_104079_a = new ArrayList(); ++ String[] field_104077_b; ++ String[] field_104078_c; ++ String[][] field_104075_d; + int field_104076_e; + int field_104073_f; + +- public GuiScreenOnlineServersSubscreen(int var1, int var2, int var3, int var4, int var5, int var6) { +- this.field_104074_g = var1; +- this.field_104081_h = var2; +- this.field_104082_i = var3; +- this.field_104080_j = var4; +- this.field_104076_e = var5; +- this.field_104073_f = var6; ++ public GuiScreenOnlineServersSubscreen(int par1, int par2, int par3, int par4, int par5, int par6) { ++ this.field_104074_g = par1; ++ this.field_104081_h = par2; ++ this.field_104082_i = par3; ++ this.field_104080_j = par4; ++ this.field_104076_e = par5; ++ this.field_104073_f = par6; + this.func_104068_a(); + } + + private void func_104068_a() { + this.func_104070_b(); +- this.a.add(new GuiButton(5005, this.field_104082_i, this.field_104080_j + 1, 212, 20, this.func_104072_c())); +- this.a.add(new GuiButton(5006, this.field_104082_i, this.field_104080_j + 25, 212, 20, this.func_104067_d())); ++ this.field_104079_a.add(new GuiButton(5005, this.field_104082_i, this.field_104080_j + 1, 212, 20, this.func_104072_c())); ++ this.field_104079_a.add(new GuiButton(5006, this.field_104082_i, this.field_104080_j + 25, 212, 20, this.func_104067_d())); + } + + private void func_104070_b() { +- this.b = new String[]{I18n.getString("options.difficulty.peaceful"), I18n.getString("options.difficulty.easy"), I18n.getString("options.difficulty.normal"), I18n.getString("options.difficulty.hard")}; +- this.c = new String[]{I18n.getString("selectWorld.gameMode.survival"), I18n.getString("selectWorld.gameMode.creative"), I18n.getString("selectWorld.gameMode.adventure")}; +- this.d = new String[][]{{I18n.getString("selectWorld.gameMode.survival.line1"), I18n.getString("selectWorld.gameMode.survival.line2")}, {I18n.getString("selectWorld.gameMode.creative.line1"), I18n.getString("selectWorld.gameMode.creative.line2")}, {I18n.getString("selectWorld.gameMode.adventure.line1"), I18n.getString("selectWorld.gameMode.adventure.line2")}}; ++ this.field_104077_b = new String[] {I18n.getString("options.difficulty.peaceful"), I18n.getString("options.difficulty.easy"), I18n.getString("options.difficulty.normal"), I18n.getString("options.difficulty.hard")}; ++ this.field_104078_c = new String[] {I18n.getString("selectWorld.gameMode.survival"), I18n.getString("selectWorld.gameMode.creative"), I18n.getString("selectWorld.gameMode.adventure")}; ++ this.field_104075_d = new String[][] {{I18n.getString("selectWorld.gameMode.survival.line1"), I18n.getString("selectWorld.gameMode.survival.line2")}, {I18n.getString("selectWorld.gameMode.creative.line1"), I18n.getString("selectWorld.gameMode.creative.line2")}, {I18n.getString("selectWorld.gameMode.adventure.line1"), I18n.getString("selectWorld.gameMode.adventure.line2")}}; + } + + private String func_104072_c() { + String var1 = I18n.getString("options.difficulty"); +- return var1 + ": " + this.b[this.field_104076_e]; ++ return var1 + ": " + this.field_104077_b[this.field_104076_e]; + } + + private String func_104067_d() { + String var1 = I18n.getString("selectWorld.gameMode"); +- return var1 + ": " + this.c[this.field_104073_f]; ++ return var1 + ": " + this.field_104078_c[this.field_104073_f]; + } + +- void func_104069_a(GuiButton var1) { +- if(var1.enabled) { +- if(var1.id == 5005) { +- this.field_104076_e = (this.field_104076_e + 1) % this.b.length; +- var1.f = this.func_104072_c(); +- } else if(var1.id == 5006) { +- this.field_104073_f = (this.field_104073_f + 1) % this.c.length; +- var1.f = this.func_104067_d(); ++ void func_104069_a(GuiButton par1GuiButton) { ++ if (par1GuiButton.enabled) { ++ if (par1GuiButton.id == 5005) { ++ this.field_104076_e = (this.field_104076_e + 1) % this.field_104077_b.length; ++ par1GuiButton.displayString = this.func_104072_c(); ++ } else if (par1GuiButton.id == 5006) { ++ this.field_104073_f = (this.field_104073_f + 1) % this.field_104078_c.length; ++ par1GuiButton.displayString = this.func_104067_d(); + } +- + } + } + +- public void func_104071_a(GuiScreen var1, FontRenderer var2) { +- var1.drawString(var2, this.d[this.field_104073_f][0], this.field_104082_i, this.field_104080_j + 50, 10526880); +- var1.drawString(var2, this.d[this.field_104073_f][1], this.field_104082_i, this.field_104080_j + 60, 10526880); ++ public void func_104071_a(GuiScreen par1GuiScreen, FontRenderer par2FontRenderer) { ++ par1GuiScreen.drawString(par2FontRenderer, this.field_104075_d[this.field_104073_f][0], this.field_104082_i, this.field_104080_j + 50, 10526880); ++ par1GuiScreen.drawString(par2FontRenderer, this.field_104075_d[this.field_104073_f][1], this.field_104082_i, this.field_104080_j + 60, 10526880); + } + } diff --git a/patches/net/minecraft/src/GuiScreenPendingInvitation.java.patch b/patches/net/minecraft/src/GuiScreenPendingInvitation.java.patch new file mode 100644 index 0000000..ede1cab --- /dev/null +++ b/patches/net/minecraft/src/GuiScreenPendingInvitation.java.patch @@ -0,0 +1,227 @@ +--- net/minecraft/src/GuiScreenPendingInvitation.java ++++ net/minecraft/src/GuiScreenPendingInvitation.java +@@ -7,133 +7,143 @@ + public class GuiScreenPendingInvitation extends GuiScreen { + private final GuiScreen field_130061_a; + private GuiScreenPendingInvitationList field_130059_b; +- private List c = Lists.newArrayList(); ++ private List field_130060_c = Lists.newArrayList(); + private int field_130058_d = -1; + +- public GuiScreenPendingInvitation(GuiScreen var1) { +- this.field_130061_a = var1; ++ public GuiScreenPendingInvitation(GuiScreen par1GuiScreen) { ++ this.field_130061_a = par1GuiScreen; + } + ++ /** ++ * Adds the buttons (and other controls) to the screen in question. ++ */ + public void initGui() { + Keyboard.enableRepeatEvents(true); +- this.i.clear(); ++ this.buttonList.clear(); + this.field_130059_b = new GuiScreenPendingInvitationList(this); + (new GuiScreenPendingInvitationINNER1(this)).start(); + this.func_130050_g(); + } + + private void func_130050_g() { +- this.i.add(new GuiButton(1, this.width / 2 - 154, this.height - 52, 153, 20, I18n.getString("mco.invites.button.accept"))); +- this.i.add(new GuiButton(2, this.width / 2 + 6, this.height - 52, 153, 20, I18n.getString("mco.invites.button.reject"))); +- this.i.add(new GuiButton(0, this.width / 2 - 75, this.height - 28, 153, 20, I18n.getString("gui.back"))); ++ this.buttonList.add(new GuiButton(1, this.width / 2 - 154, this.height - 52, 153, 20, I18n.getString("mco.invites.button.accept"))); ++ this.buttonList.add(new GuiButton(2, this.width / 2 + 6, this.height - 52, 153, 20, I18n.getString("mco.invites.button.reject"))); ++ this.buttonList.add(new GuiButton(0, this.width / 2 - 75, this.height - 28, 153, 20, I18n.getString("gui.back"))); + } + ++ /** ++ * Called from the main game loop to update the screen. ++ */ + public void updateScreen() { + super.updateScreen(); + } + +- protected void actionPerformed(GuiButton var1) { +- if(var1.enabled) { +- if(var1.id == 1) { ++ /** ++ * Fired when a control is clicked. This is the equivalent of ActionListener.actionPerformed(ActionEvent e). ++ */ ++ protected void actionPerformed(GuiButton par1GuiButton) { ++ if (par1GuiButton.enabled) { ++ if (par1GuiButton.id == 1) { + this.func_130051_i(); +- } else if(var1.id == 0) { ++ } else if (par1GuiButton.id == 0) { + this.mc.displayGuiScreen(this.field_130061_a); +- } else if(var1.id == 2) { ++ } else if (par1GuiButton.id == 2) { + this.func_130057_h(); + } else { +- this.field_130059_b.actionPerformed(var1); ++ this.field_130059_b.actionPerformed(par1GuiButton); + } +- + } + } + + private void func_130057_h() { +- if(this.field_130058_d >= 0 && this.field_130058_d < this.c.size()) { ++ if (this.field_130058_d >= 0 && this.field_130058_d < this.field_130060_c.size()) { + (new GuiScreenPendingInvitationINNER2(this)).start(); + } +- + } + + private void func_130051_i() { +- if(this.field_130058_d >= 0 && this.field_130058_d < this.c.size()) { ++ if (this.field_130058_d >= 0 && this.field_130058_d < this.field_130060_c.size()) { + (new GuiScreenPendingInvitationINNER3(this)).start(); + } +- + } + + private void func_130047_j() { + int var1 = this.field_130058_d; +- if(this.c.size() - 1 == this.field_130058_d) { ++ ++ if (this.field_130060_c.size() - 1 == this.field_130058_d) { + --this.field_130058_d; + } + +- this.c.remove(var1); +- if(this.c.size() == 0) { ++ this.field_130060_c.remove(var1); ++ ++ if (this.field_130060_c.size() == 0) { + this.field_130058_d = -1; + } +- + } + +- public void drawScreen(int var1, int var2, float var3) { ++ /** ++ * Draws the screen and all the components in it. ++ */ ++ public void drawScreen(int par1, int par2, float par3) { + this.drawDefaultBackground(); +- this.field_130059_b.drawScreen(var1, var2, var3); ++ this.field_130059_b.drawScreen(par1, par2, par3); + this.drawCenteredString(this.fontRenderer, I18n.getString("mco.invites.title"), this.width / 2, 20, 16777215); +- super.drawScreen(var1, var2, var3); +- } +- +- static Minecraft func_130048_a(GuiScreenPendingInvitation var0) { +- return var0.mc; +- } +- +- static List func_130043_a(GuiScreenPendingInvitation var0, List var1) { +- return var0.c = var1; +- } +- +- static Minecraft func_130044_b(GuiScreenPendingInvitation var0) { +- return var0.mc; +- } +- +- static Minecraft func_130041_c(GuiScreenPendingInvitation var0) { +- return var0.mc; +- } +- +- static int func_130049_d(GuiScreenPendingInvitation var0) { +- return var0.field_130058_d; +- } +- +- static List func_130042_e(GuiScreenPendingInvitation var0) { +- return var0.c; +- } +- +- static void func_130040_f(GuiScreenPendingInvitation var0) { +- var0.func_130047_j(); +- } +- +- static Minecraft func_130056_g(GuiScreenPendingInvitation var0) { +- return var0.mc; +- } +- +- static Minecraft func_130046_h(GuiScreenPendingInvitation var0) { +- return var0.mc; +- } +- +- static Minecraft func_130055_i(GuiScreenPendingInvitation var0) { +- return var0.mc; +- } +- +- static Minecraft func_130054_j(GuiScreenPendingInvitation var0) { +- return var0.mc; +- } +- +- static int func_130053_a(GuiScreenPendingInvitation var0, int var1) { +- return var0.field_130058_d = var1; +- } +- +- static FontRenderer func_130045_k(GuiScreenPendingInvitation var0) { +- return var0.fontRenderer; +- } +- +- static FontRenderer func_130052_l(GuiScreenPendingInvitation var0) { +- return var0.fontRenderer; ++ super.drawScreen(par1, par2, par3); ++ } ++ ++ static Minecraft func_130048_a(GuiScreenPendingInvitation par0GuiScreenPendingInvitation) { ++ return par0GuiScreenPendingInvitation.mc; ++ } ++ ++ static List func_130043_a(GuiScreenPendingInvitation par0GuiScreenPendingInvitation, List par1List) { ++ return par0GuiScreenPendingInvitation.field_130060_c = par1List; ++ } ++ ++ static Minecraft func_130044_b(GuiScreenPendingInvitation par0GuiScreenPendingInvitation) { ++ return par0GuiScreenPendingInvitation.mc; ++ } ++ ++ static Minecraft func_130041_c(GuiScreenPendingInvitation par0GuiScreenPendingInvitation) { ++ return par0GuiScreenPendingInvitation.mc; ++ } ++ ++ static int func_130049_d(GuiScreenPendingInvitation par0GuiScreenPendingInvitation) { ++ return par0GuiScreenPendingInvitation.field_130058_d; ++ } ++ ++ static List func_130042_e(GuiScreenPendingInvitation par0GuiScreenPendingInvitation) { ++ return par0GuiScreenPendingInvitation.field_130060_c; ++ } ++ ++ static void func_130040_f(GuiScreenPendingInvitation par0GuiScreenPendingInvitation) { ++ par0GuiScreenPendingInvitation.func_130047_j(); ++ } ++ ++ static Minecraft func_130056_g(GuiScreenPendingInvitation par0GuiScreenPendingInvitation) { ++ return par0GuiScreenPendingInvitation.mc; ++ } ++ ++ static Minecraft func_130046_h(GuiScreenPendingInvitation par0GuiScreenPendingInvitation) { ++ return par0GuiScreenPendingInvitation.mc; ++ } ++ ++ static Minecraft func_130055_i(GuiScreenPendingInvitation par0GuiScreenPendingInvitation) { ++ return par0GuiScreenPendingInvitation.mc; ++ } ++ ++ static Minecraft func_130054_j(GuiScreenPendingInvitation par0GuiScreenPendingInvitation) { ++ return par0GuiScreenPendingInvitation.mc; ++ } ++ ++ static int func_130053_a(GuiScreenPendingInvitation par0GuiScreenPendingInvitation, int par1) { ++ return par0GuiScreenPendingInvitation.field_130058_d = par1; ++ } ++ ++ static FontRenderer func_130045_k(GuiScreenPendingInvitation par0GuiScreenPendingInvitation) { ++ return par0GuiScreenPendingInvitation.fontRenderer; ++ } ++ ++ static FontRenderer func_130052_l(GuiScreenPendingInvitation par0GuiScreenPendingInvitation) { ++ return par0GuiScreenPendingInvitation.fontRenderer; + } + } diff --git a/patches/net/minecraft/src/GuiScreenPendingInvitationINNER1.java.patch b/patches/net/minecraft/src/GuiScreenPendingInvitationINNER1.java.patch new file mode 100644 index 0000000..c73d97c --- /dev/null +++ b/patches/net/minecraft/src/GuiScreenPendingInvitationINNER1.java.patch @@ -0,0 +1,24 @@ +--- net/minecraft/src/GuiScreenPendingInvitationINNER1.java ++++ net/minecraft/src/GuiScreenPendingInvitationINNER1.java +@@ -3,18 +3,17 @@ + class GuiScreenPendingInvitationINNER1 extends Thread { + final GuiScreenPendingInvitation field_130121_a; + +- GuiScreenPendingInvitationINNER1(GuiScreenPendingInvitation var1) { +- this.field_130121_a = var1; ++ GuiScreenPendingInvitationINNER1(GuiScreenPendingInvitation par1GuiScreenPendingInvitation) { ++ this.field_130121_a = par1GuiScreenPendingInvitation; + } + + public void run() { + McoClient var1 = new McoClient(GuiScreenPendingInvitation.func_130048_a(this.field_130121_a).getSession()); + + try { +- GuiScreenPendingInvitation.func_130043_a(this.field_130121_a, var1.func_130108_f().a); ++ GuiScreenPendingInvitation.func_130043_a(this.field_130121_a, var1.func_130108_f().field_130096_a); + } catch (ExceptionMcoService var3) { + GuiScreenPendingInvitation.func_130044_b(this.field_130121_a).getLogAgent().logSevere(var3.toString()); + } +- + } + } diff --git a/patches/net/minecraft/src/GuiScreenPendingInvitationINNER2.java.patch b/patches/net/minecraft/src/GuiScreenPendingInvitationINNER2.java.patch new file mode 100644 index 0000000..6aa58eb --- /dev/null +++ b/patches/net/minecraft/src/GuiScreenPendingInvitationINNER2.java.patch @@ -0,0 +1,24 @@ +--- net/minecraft/src/GuiScreenPendingInvitationINNER2.java ++++ net/minecraft/src/GuiScreenPendingInvitationINNER2.java +@@ -3,18 +3,17 @@ + class GuiScreenPendingInvitationINNER2 extends Thread { + final GuiScreenPendingInvitation field_130132_a; + +- GuiScreenPendingInvitationINNER2(GuiScreenPendingInvitation var1) { +- this.field_130132_a = var1; ++ GuiScreenPendingInvitationINNER2(GuiScreenPendingInvitation par1GuiScreenPendingInvitation) { ++ this.field_130132_a = par1GuiScreenPendingInvitation; + } + + public void run() { + try { + McoClient var1 = new McoClient(GuiScreenPendingInvitation.func_130041_c(this.field_130132_a).getSession()); +- var1.func_130109_b(((PendingInvite)GuiScreenPendingInvitation.func_130042_e(this.field_130132_a).get(GuiScreenPendingInvitation.func_130049_d(this.field_130132_a))).a); ++ var1.func_130109_b(((PendingInvite)GuiScreenPendingInvitation.func_130042_e(this.field_130132_a).get(GuiScreenPendingInvitation.func_130049_d(this.field_130132_a))).field_130094_a); + GuiScreenPendingInvitation.func_130040_f(this.field_130132_a); + } catch (ExceptionMcoService var2) { + GuiScreenPendingInvitation.func_130056_g(this.field_130132_a).getLogAgent().logSevere(var2.toString()); + } +- + } + } diff --git a/patches/net/minecraft/src/GuiScreenPendingInvitationINNER3.java.patch b/patches/net/minecraft/src/GuiScreenPendingInvitationINNER3.java.patch new file mode 100644 index 0000000..089608f --- /dev/null +++ b/patches/net/minecraft/src/GuiScreenPendingInvitationINNER3.java.patch @@ -0,0 +1,24 @@ +--- net/minecraft/src/GuiScreenPendingInvitationINNER3.java ++++ net/minecraft/src/GuiScreenPendingInvitationINNER3.java +@@ -3,18 +3,17 @@ + class GuiScreenPendingInvitationINNER3 extends Thread { + final GuiScreenPendingInvitation field_130131_a; + +- GuiScreenPendingInvitationINNER3(GuiScreenPendingInvitation var1) { +- this.field_130131_a = var1; ++ GuiScreenPendingInvitationINNER3(GuiScreenPendingInvitation par1GuiScreenPendingInvitation) { ++ this.field_130131_a = par1GuiScreenPendingInvitation; + } + + public void run() { + try { + McoClient var1 = new McoClient(GuiScreenPendingInvitation.func_130046_h(this.field_130131_a).getSession()); +- var1.func_130107_a(((PendingInvite)GuiScreenPendingInvitation.func_130042_e(this.field_130131_a).get(GuiScreenPendingInvitation.func_130049_d(this.field_130131_a))).a); ++ var1.func_130107_a(((PendingInvite)GuiScreenPendingInvitation.func_130042_e(this.field_130131_a).get(GuiScreenPendingInvitation.func_130049_d(this.field_130131_a))).field_130094_a); + GuiScreenPendingInvitation.func_130040_f(this.field_130131_a); + } catch (ExceptionMcoService var2) { + GuiScreenPendingInvitation.func_130055_i(this.field_130131_a).getLogAgent().logSevere(var2.toString()); + } +- + } + } diff --git a/patches/net/minecraft/src/GuiScreenPendingInvitationList.java.patch b/patches/net/minecraft/src/GuiScreenPendingInvitationList.java.patch new file mode 100644 index 0000000..b345c5e --- /dev/null +++ b/patches/net/minecraft/src/GuiScreenPendingInvitationList.java.patch @@ -0,0 +1,71 @@ +--- net/minecraft/src/GuiScreenPendingInvitationList.java ++++ net/minecraft/src/GuiScreenPendingInvitationList.java +@@ -3,26 +3,35 @@ + class GuiScreenPendingInvitationList extends GuiScreenSelectLocation { + final GuiScreenPendingInvitation field_130120_a; + +- public GuiScreenPendingInvitationList(GuiScreenPendingInvitation var1) { +- super(GuiScreenPendingInvitation.func_130054_j(var1), var1.width, var1.height, 32, var1.height - 64, 36); +- this.field_130120_a = var1; ++ public GuiScreenPendingInvitationList(GuiScreenPendingInvitation par1GuiScreenPendingInvitation) { ++ super(GuiScreenPendingInvitation.func_130054_j(par1GuiScreenPendingInvitation), par1GuiScreenPendingInvitation.width, par1GuiScreenPendingInvitation.height, 32, par1GuiScreenPendingInvitation.height - 64, 36); ++ this.field_130120_a = par1GuiScreenPendingInvitation; + } + ++ /** ++ * Gets the size of the current slot list. ++ */ + protected int getSize() { + return GuiScreenPendingInvitation.func_130042_e(this.field_130120_a).size() + 1; + } + +- protected void elementClicked(int var1, boolean var2) { +- if(var1 < GuiScreenPendingInvitation.func_130042_e(this.field_130120_a).size()) { +- GuiScreenPendingInvitation.func_130053_a(this.field_130120_a, var1); ++ /** ++ * the element in the slot that was clicked, boolean for wether it was double clicked or not ++ */ ++ protected void elementClicked(int par1, boolean par2) { ++ if (par1 < GuiScreenPendingInvitation.func_130042_e(this.field_130120_a).size()) { ++ GuiScreenPendingInvitation.func_130053_a(this.field_130120_a, par1); + } + } + +- protected boolean isSelected(int var1) { +- return var1 == GuiScreenPendingInvitation.func_130049_d(this.field_130120_a); ++ /** ++ * returns true if the element passed in is currently selected ++ */ ++ protected boolean isSelected(int par1) { ++ return par1 == GuiScreenPendingInvitation.func_130049_d(this.field_130120_a); + } + +- protected boolean func_104086_b(int var1) { ++ protected boolean func_104086_b(int par1) { + return false; + } + +@@ -34,16 +43,15 @@ + this.field_130120_a.drawDefaultBackground(); + } + +- protected void drawSlot(int var1, int var2, int var3, int var4, Tessellator var5) { +- if(var1 < GuiScreenPendingInvitation.func_130042_e(this.field_130120_a).size()) { +- this.func_130119_b(var1, var2, var3, var4, var5); ++ protected void drawSlot(int par1, int par2, int par3, int par4, Tessellator par5Tessellator) { ++ if (par1 < GuiScreenPendingInvitation.func_130042_e(this.field_130120_a).size()) { ++ this.func_130119_b(par1, par2, par3, par4, par5Tessellator); + } +- + } + +- private void func_130119_b(int var1, int var2, int var3, int var4, Tessellator var5) { +- PendingInvite var6 = (PendingInvite)GuiScreenPendingInvitation.func_130042_e(this.field_130120_a).get(var1); +- this.field_130120_a.drawString(GuiScreenPendingInvitation.func_130045_k(this.field_130120_a), var6.b, var2 + 2, var3 + 1, 16777215); +- this.field_130120_a.drawString(GuiScreenPendingInvitation.func_130052_l(this.field_130120_a), var6.c, var2 + 2, var3 + 12, 7105644); ++ private void func_130119_b(int par1, int par2, int par3, int par4, Tessellator par5Tessellator) { ++ PendingInvite var6 = (PendingInvite)GuiScreenPendingInvitation.func_130042_e(this.field_130120_a).get(par1); ++ this.field_130120_a.drawString(GuiScreenPendingInvitation.func_130045_k(this.field_130120_a), var6.field_130092_b, par2 + 2, par3 + 1, 16777215); ++ this.field_130120_a.drawString(GuiScreenPendingInvitation.func_130052_l(this.field_130120_a), var6.field_130093_c, par2 + 2, par3 + 12, 7105644); + } + } diff --git a/patches/net/minecraft/src/GuiScreenResetWorld.java.patch b/patches/net/minecraft/src/GuiScreenResetWorld.java.patch new file mode 100644 index 0000000..acfeb51 --- /dev/null +++ b/patches/net/minecraft/src/GuiScreenResetWorld.java.patch @@ -0,0 +1,185 @@ +--- net/minecraft/src/GuiScreenResetWorld.java ++++ net/minecraft/src/GuiScreenResetWorld.java +@@ -12,69 +12,82 @@ + private WorldTemplate field_110359_q; + private GuiButton field_96154_o; + +- public GuiScreenResetWorld(GuiScreen var1, McoServer var2) { +- this.field_96152_a = var1; +- this.field_96150_b = var2; ++ public GuiScreenResetWorld(GuiScreen par1GuiScreen, McoServer par2McoServer) { ++ this.field_96152_a = par1GuiScreen; ++ this.field_96150_b = par2McoServer; + } + ++ /** ++ * Called from the main game loop to update the screen. ++ */ + public void updateScreen() { + this.field_96151_c.updateCursorCounter(); + } + ++ /** ++ * Adds the buttons (and other controls) to the screen in question. ++ */ + public void initGui() { + Keyboard.enableRepeatEvents(true); +- this.i.clear(); +- this.i.add(this.field_96154_o = new GuiButton(1, this.width / 2 - 100, this.height / 4 + 120 + 12, 97, 20, I18n.getString("mco.configure.world.buttons.reset"))); +- this.i.add(new GuiButton(2, this.width / 2 + 5, this.height / 4 + 120 + 12, 97, 20, I18n.getString("gui.cancel"))); ++ this.buttonList.clear(); ++ this.buttonList.add(this.field_96154_o = new GuiButton(1, this.width / 2 - 100, this.height / 4 + 120 + 12, 97, 20, I18n.getString("mco.configure.world.buttons.reset"))); ++ this.buttonList.add(new GuiButton(2, this.width / 2 + 5, this.height / 4 + 120 + 12, 97, 20, I18n.getString("gui.cancel"))); + this.field_96151_c = new GuiTextField(this.fontRenderer, this.width / 2 - 100, 99, 200, 20); + this.field_96151_c.setFocused(true); + this.field_96151_c.setMaxStringLength(32); + this.field_96151_c.setText(""); +- if(this.field_110359_q == null) { +- this.i.add(new GuiButton(field_110360_p, this.width / 2 - 100, 125, 200, 20, I18n.getString("mco.template.default.name"))); ++ ++ if (this.field_110359_q == null) { ++ this.buttonList.add(new GuiButton(field_110360_p, this.width / 2 - 100, 125, 200, 20, I18n.getString("mco.template.default.name"))); + } else { + this.field_96151_c.setText(""); + this.field_96151_c.setEnabled(false); + this.field_96151_c.setFocused(false); +- this.i.add(new GuiButton(field_110360_p, this.width / 2 - 100, 125, 200, 20, I18n.getString("mco.template.name") + ": " + this.field_110359_q.b)); ++ this.buttonList.add(new GuiButton(field_110360_p, this.width / 2 - 100, 125, 200, 20, I18n.getString("mco.template.name") + ": " + this.field_110359_q.field_110732_b)); + } +- + } + ++ /** ++ * Called when the screen is unloaded. Used to disable keyboard repeat events ++ */ + public void onGuiClosed() { + Keyboard.enableRepeatEvents(false); + } + +- protected void keyTyped(char var1, int var2) { +- this.field_96151_c.textboxKeyTyped(var1, var2); +- if(var2 == 28 || var2 == 156) { ++ /** ++ * Fired when a key is typed. This is the equivalent of KeyListener.keyTyped(KeyEvent e). ++ */ ++ protected void keyTyped(char par1, int par2) { ++ this.field_96151_c.textboxKeyTyped(par1, par2); ++ ++ if (par2 == 28 || par2 == 156) { + this.actionPerformed(this.field_96154_o); + } +- + } + +- protected void actionPerformed(GuiButton var1) { +- if(var1.enabled) { +- if(var1.id == 2) { ++ /** ++ * Fired when a control is clicked. This is the equivalent of ActionListener.actionPerformed(ActionEvent e). ++ */ ++ protected void actionPerformed(GuiButton par1GuiButton) { ++ if (par1GuiButton.enabled) { ++ if (par1GuiButton.id == 2) { + this.mc.displayGuiScreen(this.field_96152_a); +- } else if(var1.id == 1) { ++ } else if (par1GuiButton.id == 1) { + String var2 = I18n.getString("mco.configure.world.reset.question.line1"); + String var3 = I18n.getString("mco.configure.world.reset.question.line2"); + this.mc.displayGuiScreen(new GuiScreenConfirmation(this, GuiScreenConfirmationType.Warning, var2, var3, 1)); +- } else if(var1.id == field_110360_p) { ++ } else if (par1GuiButton.id == field_110360_p) { + this.mc.displayGuiScreen(new GuiScreenMcoWorldTemplate(this, this.field_110359_q)); + } +- + } + } + +- public void confirmClicked(boolean var1, int var2) { +- if(var1 && var2 == 1) { ++ public void confirmClicked(boolean par1, int par2) { ++ if (par1 && par2 == 1) { + this.func_140006_g(); + } else { + this.mc.displayGuiScreen(this); + } +- + } + + private void func_140006_g() { +@@ -84,41 +97,47 @@ + this.mc.displayGuiScreen(var2); + } + +- protected void mouseClicked(int var1, int var2, int var3) { +- super.mouseClicked(var1, var2, var3); +- this.field_96151_c.mouseClicked(var1, var2, var3); ++ /** ++ * Called when the mouse is clicked. ++ */ ++ protected void mouseClicked(int par1, int par2, int par3) { ++ super.mouseClicked(par1, par2, par3); ++ this.field_96151_c.mouseClicked(par1, par2, par3); + } + +- public void drawScreen(int var1, int var2, float var3) { ++ /** ++ * Draws the screen and all the components in it. ++ */ ++ public void drawScreen(int par1, int par2, float par3) { + this.drawDefaultBackground(); + this.drawCenteredString(this.fontRenderer, I18n.getString("mco.reset.world.title"), this.width / 2, 17, 16777215); + this.drawCenteredString(this.fontRenderer, I18n.getString("mco.reset.world.warning"), this.width / 2, 56, 16711680); + this.drawString(this.fontRenderer, I18n.getString("mco.reset.world.seed"), this.width / 2 - 100, 86, 10526880); + this.field_96151_c.drawTextBox(); +- super.drawScreen(var1, var2, var3); +- } +- +- void func_110358_a(WorldTemplate var1) { +- this.field_110359_q = var1; +- } +- +- void func_110354_a(Object var1) { +- this.func_110358_a((WorldTemplate)var1); +- } +- +- static GuiScreen func_96148_a(GuiScreenResetWorld var0) { +- return var0.field_96152_a; +- } +- +- static Minecraft func_96147_b(GuiScreenResetWorld var0) { +- return var0.mc; +- } +- +- static Minecraft func_130025_c(GuiScreenResetWorld var0) { +- return var0.mc; +- } +- +- static Minecraft func_130024_d(GuiScreenResetWorld var0) { +- return var0.mc; ++ super.drawScreen(par1, par2, par3); ++ } ++ ++ void func_110358_a(WorldTemplate par1WorldTemplate) { ++ this.field_110359_q = par1WorldTemplate; ++ } ++ ++ void func_110354_a(Object par1Obj) { ++ this.func_110358_a((WorldTemplate)par1Obj); ++ } ++ ++ static GuiScreen func_96148_a(GuiScreenResetWorld par0GuiScreenResetWorld) { ++ return par0GuiScreenResetWorld.field_96152_a; ++ } ++ ++ static Minecraft func_96147_b(GuiScreenResetWorld par0GuiScreenResetWorld) { ++ return par0GuiScreenResetWorld.mc; ++ } ++ ++ static Minecraft func_130025_c(GuiScreenResetWorld par0GuiScreenResetWorld) { ++ return par0GuiScreenResetWorld.mc; ++ } ++ ++ static Minecraft func_130024_d(GuiScreenResetWorld par0GuiScreenResetWorld) { ++ return par0GuiScreenResetWorld.mc; + } + } diff --git a/patches/net/minecraft/src/GuiScreenSelectLocation.java.patch b/patches/net/minecraft/src/GuiScreenSelectLocation.java.patch new file mode 100644 index 0000000..adce7af --- /dev/null +++ b/patches/net/minecraft/src/GuiScreenSelectLocation.java.patch @@ -0,0 +1,342 @@ +--- net/minecraft/src/GuiScreenSelectLocation.java ++++ net/minecraft/src/GuiScreenSelectLocation.java +@@ -25,30 +25,39 @@ + private boolean field_104108_s; + private int field_104107_t; + +- public GuiScreenSelectLocation(Minecraft var1, int var2, int var3, int var4, int var5, int var6) { +- this.field_104092_f = var1; +- this.field_104093_g = var2; +- this.field_104105_h = var3; +- this.field_104098_a = var4; +- this.field_104096_b = var5; +- this.field_104097_c = var6; +- this.field_104103_j = 0; +- this.field_104106_i = var2; +- } +- +- public void func_104084_a(int var1, int var2, int var3, int var4) { +- this.field_104093_g = var1; +- this.field_104105_h = var2; +- this.field_104098_a = var3; +- this.field_104096_b = var4; +- this.field_104103_j = 0; +- this.field_104106_i = var1; +- } +- ++ public GuiScreenSelectLocation(Minecraft par1Minecraft, int par2, int par3, int par4, int par5, int par6) { ++ this.field_104092_f = par1Minecraft; ++ this.field_104093_g = par2; ++ this.field_104105_h = par3; ++ this.field_104098_a = par4; ++ this.field_104096_b = par5; ++ this.field_104097_c = par6; ++ this.field_104103_j = 0; ++ this.field_104106_i = par2; ++ } ++ ++ public void func_104084_a(int par1, int par2, int par3, int par4) { ++ this.field_104093_g = par1; ++ this.field_104105_h = par2; ++ this.field_104098_a = par3; ++ this.field_104096_b = par4; ++ this.field_104103_j = 0; ++ this.field_104106_i = par1; ++ } ++ ++ /** ++ * Gets the size of the current slot list. ++ */ + protected abstract int getSize(); + ++ /** ++ * the element in the slot that was clicked, boolean for wether it was double clicked or not ++ */ + protected abstract void elementClicked(int var1, boolean var2); + ++ /** ++ * returns true if the element passed in is currently selected ++ */ + protected abstract boolean isSelected(int var1); + + protected abstract boolean func_104086_b(int var1); +@@ -61,53 +70,55 @@ + + protected abstract void drawSlot(int var1, int var2, int var3, int var4, Tessellator var5); + +- protected void func_104088_a(int var1, int var2, Tessellator var3) { +- } +- +- protected void func_104089_a(int var1, int var2) { +- } +- +- protected void func_104087_b(int var1, int var2) { +- } ++ protected void func_104088_a(int par1, int par2, Tessellator par3Tessellator) {} ++ ++ protected void func_104089_a(int par1, int par2) {} ++ ++ protected void func_104087_b(int par1, int par2) {} + + private void func_104091_h() { + int var1 = this.func_104085_d(); +- if(var1 < 0) { ++ ++ if (var1 < 0) { + var1 /= 2; + } + +- if(this.field_104100_o < 0.0F) { ++ if (this.field_104100_o < 0.0F) { + this.field_104100_o = 0.0F; + } + +- if(this.field_104100_o > (float)var1) { ++ if (this.field_104100_o > (float)var1) { + this.field_104100_o = (float)var1; + } +- + } + + public int func_104085_d() { + return this.func_130003_b() - (this.field_104096_b - this.field_104098_a - 4); + } + +- public void actionPerformed(GuiButton var1) { +- if(var1.enabled) { +- if(var1.id == this.field_104104_k) { ++ /** ++ * Fired when a control is clicked. This is the equivalent of ActionListener.actionPerformed(ActionEvent e). ++ */ ++ public void actionPerformed(GuiButton par1GuiButton) { ++ if (par1GuiButton.enabled) { ++ if (par1GuiButton.id == this.field_104104_k) { + this.field_104100_o -= (float)(this.field_104097_c * 2 / 3); + this.field_104102_m = -2.0F; + this.func_104091_h(); +- } else if(var1.id == this.field_104101_l) { ++ } else if (par1GuiButton.id == this.field_104101_l) { + this.field_104100_o += (float)(this.field_104097_c * 2 / 3); + this.field_104102_m = -2.0F; + this.func_104091_h(); + } +- + } + } + +- public void drawScreen(int var1, int var2, float var3) { +- this.field_104094_d = var1; +- this.field_104095_e = var2; ++ /** ++ * Draws the screen and all the components in it. ++ */ ++ public void drawScreen(int par1, int par2, float par3) { ++ this.field_104094_d = par1; ++ this.field_104095_e = par2; + this.func_130004_c(); + int var4 = this.getSize(); + int var5 = this.func_104090_g(); +@@ -117,37 +128,42 @@ + int var11; + int var13; + int var20; +- if(Mouse.isButtonDown(0)) { +- if(this.field_104102_m == -1.0F) { +- boolean var16 = true; +- if(var2 >= this.field_104098_a && var2 <= this.field_104096_b) { ++ ++ if (Mouse.isButtonDown(0)) { ++ if (this.field_104102_m == -1.0F) { ++ boolean var7 = true; ++ ++ if (par2 >= this.field_104098_a && par2 <= this.field_104096_b) { + int var8 = this.field_104093_g / 2 - 110; + var9 = this.field_104093_g / 2 + 110; +- var10 = var2 - this.field_104098_a - this.field_104107_t + (int)this.field_104100_o - 4; ++ var10 = par2 - this.field_104098_a - this.field_104107_t + (int)this.field_104100_o - 4; + var11 = var10 / this.field_104097_c; +- if(var1 >= var8 && var1 <= var9 && var11 >= 0 && var10 >= 0 && var11 < var4) { ++ ++ if (par1 >= var8 && par1 <= var9 && var11 >= 0 && var10 >= 0 && var11 < var4) { + boolean var12 = var11 == this.field_104111_p && Minecraft.getSystemTime() - this.field_104110_q < 250L; + this.elementClicked(var11, var12); + this.field_104111_p = var11; + this.field_104110_q = Minecraft.getSystemTime(); +- } else if(var1 >= var8 && var1 <= var9 && var10 < 0) { +- this.func_104089_a(var1 - var8, var2 - this.field_104098_a + (int)this.field_104100_o - 4); +- var16 = false; ++ } else if (par1 >= var8 && par1 <= var9 && var10 < 0) { ++ this.func_104089_a(par1 - var8, par2 - this.field_104098_a + (int)this.field_104100_o - 4); ++ var7 = false; + } + +- if(var1 >= var5 && var1 <= var6) { ++ if (par1 >= var5 && par1 <= var6) { + this.field_104099_n = -1.0F; + var20 = this.func_104085_d(); +- if(var20 < 1) { ++ ++ if (var20 < 1) { + var20 = 1; + } + + var13 = (int)((float)((this.field_104096_b - this.field_104098_a) * (this.field_104096_b - this.field_104098_a)) / (float)this.func_130003_b()); +- if(var13 < 32) { ++ ++ if (var13 < 32) { + var13 = 32; + } + +- if(var13 > this.field_104096_b - this.field_104098_a - 8) { ++ if (var13 > this.field_104096_b - this.field_104098_a - 8) { + var13 = this.field_104096_b - this.field_104098_a - 8; + } + +@@ -156,36 +172,34 @@ + this.field_104099_n = 1.0F; + } + +- if(var16) { +- this.field_104102_m = (float)var2; ++ if (var7) { ++ this.field_104102_m = (float)par2; + } else { + this.field_104102_m = -2.0F; + } + } else { + this.field_104102_m = -2.0F; + } +- } else if(this.field_104102_m >= 0.0F) { +- this.field_104100_o -= ((float)var2 - this.field_104102_m) * this.field_104099_n; +- this.field_104102_m = (float)var2; ++ } else if (this.field_104102_m >= 0.0F) { ++ this.field_104100_o -= ((float)par2 - this.field_104102_m) * this.field_104099_n; ++ this.field_104102_m = (float)par2; + } + } else { +- while(true) { +- if(this.field_104092_f.gameSettings.touchscreen || !Mouse.next()) { +- this.field_104102_m = -1.0F; +- break; +- } ++ while (!this.field_104092_f.gameSettings.touchscreen && Mouse.next()) { ++ int var16 = Mouse.getEventDWheel(); + +- int var7 = Mouse.getEventDWheel(); +- if(var7 != 0) { +- if(var7 > 0) { +- var7 = -1; +- } else if(var7 < 0) { +- var7 = 1; ++ if (var16 != 0) { ++ if (var16 > 0) { ++ var16 = -1; ++ } else if (var16 < 0) { ++ var16 = 1; + } + +- this.field_104100_o += (float)(var7 * this.field_104097_c / 2); ++ this.field_104100_o += (float)(var16 * this.field_104097_c / 2); + } + } ++ ++ this.field_104102_m = -1.0F; + } + + this.func_104091_h(); +@@ -204,17 +218,21 @@ + var18.draw(); + var9 = this.field_104093_g / 2 - 92 - 16; + var10 = this.field_104098_a + 4 - (int)this.field_104100_o; +- if(this.field_104108_s) { ++ ++ if (this.field_104108_s) { + this.func_104088_a(var9, var10, var18); + } + + int var14; +- for(var11 = 0; var11 < var4; ++var11) { ++ ++ for (var11 = 0; var11 < var4; ++var11) { + var20 = var10 + var11 * this.field_104097_c + this.field_104107_t; + var13 = this.field_104097_c - 4; +- if(var20 <= this.field_104096_b && var20 + var13 >= this.field_104098_a) { ++ ++ if (var20 <= this.field_104096_b && var20 + var13 >= this.field_104098_a) { + int var15; +- if(this.field_104109_r && this.func_104086_b(var11)) { ++ ++ if (this.field_104109_r && this.func_104086_b(var11)) { + var14 = this.field_104093_g / 2 - 110; + var15 = this.field_104093_g / 2 + 110; + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); +@@ -229,7 +247,7 @@ + GL11.glEnable(GL11.GL_TEXTURE_2D); + } + +- if(this.field_104109_r && this.isSelected(var11)) { ++ if (this.field_104109_r && this.isSelected(var11)) { + var14 = this.field_104093_g / 2 - 110; + var15 = this.field_104093_g / 2 + 110; + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); +@@ -279,18 +297,21 @@ + var18.addVertexWithUV((double)this.field_104103_j, (double)(this.field_104096_b - var19), 0.0D, 0.0D, 0.0D); + var18.draw(); + var20 = this.func_104085_d(); +- if(var20 > 0) { ++ ++ if (var20 > 0) { + var13 = (this.field_104096_b - this.field_104098_a) * (this.field_104096_b - this.field_104098_a) / this.func_130003_b(); +- if(var13 < 32) { ++ ++ if (var13 < 32) { + var13 = 32; + } + +- if(var13 > this.field_104096_b - this.field_104098_a - 8) { ++ if (var13 > this.field_104096_b - this.field_104098_a - 8) { + var13 = this.field_104096_b - this.field_104098_a - 8; + } + + var14 = (int)this.field_104100_o * (this.field_104096_b - this.field_104098_a - var13) / var20 + this.field_104098_a; +- if(var14 < this.field_104098_a) { ++ ++ if (var14 < this.field_104098_a) { + var14 = this.field_104098_a; + } + +@@ -317,7 +338,7 @@ + var18.draw(); + } + +- this.func_104087_b(var1, var2); ++ this.func_104087_b(par1, par2); + GL11.glEnable(GL11.GL_TEXTURE_2D); + GL11.glShadeModel(GL11.GL_FLAT); + GL11.glEnable(GL11.GL_ALPHA_TEST); +@@ -328,18 +349,18 @@ + return this.field_104093_g / 2 + 124; + } + +- private void func_104083_b(int var1, int var2, int var3, int var4) { ++ private void func_104083_b(int par1, int par2, int par3, int par4) { + Tessellator var5 = Tessellator.instance; + this.field_104092_f.getTextureManager().bindTexture(Gui.optionsBackground); + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + float var6 = 32.0F; + var5.startDrawingQuads(); +- var5.setColorRGBA_I(4210752, var4); +- var5.addVertexWithUV(0.0D, (double)var2, 0.0D, 0.0D, (double)((float)var2 / var6)); +- var5.addVertexWithUV((double)this.field_104093_g, (double)var2, 0.0D, (double)((float)this.field_104093_g / var6), (double)((float)var2 / var6)); +- var5.setColorRGBA_I(4210752, var3); +- var5.addVertexWithUV((double)this.field_104093_g, (double)var1, 0.0D, (double)((float)this.field_104093_g / var6), (double)((float)var1 / var6)); +- var5.addVertexWithUV(0.0D, (double)var1, 0.0D, 0.0D, (double)((float)var1 / var6)); ++ var5.setColorRGBA_I(4210752, par4); ++ var5.addVertexWithUV(0.0D, (double)par2, 0.0D, 0.0D, (double)((float)par2 / var6)); ++ var5.addVertexWithUV((double)this.field_104093_g, (double)par2, 0.0D, (double)((float)this.field_104093_g / var6), (double)((float)par2 / var6)); ++ var5.setColorRGBA_I(4210752, par3); ++ var5.addVertexWithUV((double)this.field_104093_g, (double)par1, 0.0D, (double)((float)this.field_104093_g / var6), (double)((float)par1 / var6)); ++ var5.addVertexWithUV(0.0D, (double)par1, 0.0D, 0.0D, (double)((float)par1 / var6)); + var5.draw(); + } + } diff --git a/patches/net/minecraft/src/GuiScreenServerList.java.patch b/patches/net/minecraft/src/GuiScreenServerList.java.patch new file mode 100644 index 0000000..c432def --- /dev/null +++ b/patches/net/minecraft/src/GuiScreenServerList.java.patch @@ -0,0 +1,128 @@ +--- net/minecraft/src/GuiScreenServerList.java ++++ net/minecraft/src/GuiScreenServerList.java +@@ -3,68 +3,91 @@ + import org.lwjgl.input.Keyboard; + + public class GuiScreenServerList extends GuiScreen { ++ ++ /** Needed a change as a local variable was conflicting on construct */ + private final GuiScreen guiScreen; ++ ++ /** Instance of ServerData. */ + private final ServerData theServerData; + private GuiTextField serverTextField; + +- public GuiScreenServerList(GuiScreen var1, ServerData var2) { +- this.guiScreen = var1; +- this.theServerData = var2; ++ public GuiScreenServerList(GuiScreen par1GuiScreen, ServerData par2ServerData) { ++ this.guiScreen = par1GuiScreen; ++ this.theServerData = par2ServerData; + } + ++ /** ++ * Called from the main game loop to update the screen. ++ */ + public void updateScreen() { + this.serverTextField.updateCursorCounter(); + } + ++ /** ++ * Adds the buttons (and other controls) to the screen in question. ++ */ + public void initGui() { + Keyboard.enableRepeatEvents(true); +- this.i.clear(); +- this.i.add(new GuiButton(0, this.width / 2 - 100, this.height / 4 + 96 + 12, I18n.getString("selectServer.select"))); +- this.i.add(new GuiButton(1, this.width / 2 - 100, this.height / 4 + 120 + 12, I18n.getString("gui.cancel"))); ++ this.buttonList.clear(); ++ this.buttonList.add(new GuiButton(0, this.width / 2 - 100, this.height / 4 + 96 + 12, I18n.getString("selectServer.select"))); ++ this.buttonList.add(new GuiButton(1, this.width / 2 - 100, this.height / 4 + 120 + 12, I18n.getString("gui.cancel"))); + this.serverTextField = new GuiTextField(this.fontRenderer, this.width / 2 - 100, 116, 200, 20); + this.serverTextField.setMaxStringLength(128); + this.serverTextField.setFocused(true); +- this.serverTextField.setText(this.mc.gameSettings.ad); +- ((GuiButton)this.i.get(0)).enabled = this.serverTextField.getText().length() > 0 && this.serverTextField.getText().split(":").length > 0; ++ this.serverTextField.setText(this.mc.gameSettings.lastServer); ++ ((GuiButton)this.buttonList.get(0)).enabled = this.serverTextField.getText().length() > 0 && this.serverTextField.getText().split(":").length > 0; + } + ++ /** ++ * Called when the screen is unloaded. Used to disable keyboard repeat events ++ */ + public void onGuiClosed() { + Keyboard.enableRepeatEvents(false); +- this.mc.gameSettings.ad = this.serverTextField.getText(); ++ this.mc.gameSettings.lastServer = this.serverTextField.getText(); + this.mc.gameSettings.saveOptions(); + } + +- protected void actionPerformed(GuiButton var1) { +- if(var1.enabled) { +- if(var1.id == 1) { ++ /** ++ * Fired when a control is clicked. This is the equivalent of ActionListener.actionPerformed(ActionEvent e). ++ */ ++ protected void actionPerformed(GuiButton par1GuiButton) { ++ if (par1GuiButton.enabled) { ++ if (par1GuiButton.id == 1) { + this.guiScreen.confirmClicked(false, 0); +- } else if(var1.id == 0) { +- this.theServerData.b = this.serverTextField.getText(); ++ } else if (par1GuiButton.id == 0) { ++ this.theServerData.serverIP = this.serverTextField.getText(); + this.guiScreen.confirmClicked(true, 0); + } +- +- } +- } +- +- protected void keyTyped(char var1, int var2) { +- if(this.serverTextField.textboxKeyTyped(var1, var2)) { +- ((GuiButton)this.i.get(0)).enabled = this.serverTextField.getText().length() > 0 && this.serverTextField.getText().split(":").length > 0; +- } else if(var2 == 28 || var2 == 156) { +- this.actionPerformed((GuiButton)this.i.get(0)); +- } +- +- } +- +- protected void mouseClicked(int var1, int var2, int var3) { +- super.mouseClicked(var1, var2, var3); +- this.serverTextField.mouseClicked(var1, var2, var3); +- } +- +- public void drawScreen(int var1, int var2, float var3) { ++ } ++ } ++ ++ /** ++ * Fired when a key is typed. This is the equivalent of KeyListener.keyTyped(KeyEvent e). ++ */ ++ protected void keyTyped(char par1, int par2) { ++ if (this.serverTextField.textboxKeyTyped(par1, par2)) { ++ ((GuiButton)this.buttonList.get(0)).enabled = this.serverTextField.getText().length() > 0 && this.serverTextField.getText().split(":").length > 0; ++ } else if (par2 == 28 || par2 == 156) { ++ this.actionPerformed((GuiButton)this.buttonList.get(0)); ++ } ++ } ++ ++ /** ++ * Called when the mouse is clicked. ++ */ ++ protected void mouseClicked(int par1, int par2, int par3) { ++ super.mouseClicked(par1, par2, par3); ++ this.serverTextField.mouseClicked(par1, par2, par3); ++ } ++ ++ /** ++ * Draws the screen and all the components in it. ++ */ ++ public void drawScreen(int par1, int par2, float par3) { + this.drawDefaultBackground(); + this.drawCenteredString(this.fontRenderer, I18n.getString("selectServer.direct"), this.width / 2, 20, 16777215); + this.drawString(this.fontRenderer, I18n.getString("addServer.enterIp"), this.width / 2 - 100, 100, 10526880); + this.serverTextField.drawTextBox(); +- super.drawScreen(var1, var2, var3); ++ super.drawScreen(par1, par2, par3); + } + } diff --git a/patches/net/minecraft/src/GuiScreenSubscription.java.patch b/patches/net/minecraft/src/GuiScreenSubscription.java.patch new file mode 100644 index 0000000..e11db99 --- /dev/null +++ b/patches/net/minecraft/src/GuiScreenSubscription.java.patch @@ -0,0 +1,124 @@ +--- net/minecraft/src/GuiScreenSubscription.java ++++ net/minecraft/src/GuiScreenSubscription.java +@@ -12,71 +12,89 @@ + private final int field_98066_c = 0; + private final int field_98064_d = 1; + private int field_98068_n; +- private String p; +- +- public GuiScreenSubscription(GuiScreen var1, McoServer var2) { +- this.field_98067_a = var1; +- this.field_98065_b = var2; +- } +- +- public void updateScreen() { +- } +- ++ private String field_98069_o; ++ ++ public GuiScreenSubscription(GuiScreen par1GuiScreen, McoServer par2McoServer) { ++ this.field_98067_a = par1GuiScreen; ++ this.field_98065_b = par2McoServer; ++ } ++ ++ /** ++ * Called from the main game loop to update the screen. ++ */ ++ public void updateScreen() {} ++ ++ /** ++ * Adds the buttons (and other controls) to the screen in question. ++ */ + public void initGui() { + this.func_98063_a(this.field_98065_b.field_96408_a); + Keyboard.enableRepeatEvents(true); +- this.i.add(new GuiButton(0, this.width / 2 - 100, this.height / 4 + 120 + 12, I18n.getString("gui.cancel"))); ++ this.buttonList.add(new GuiButton(0, this.width / 2 - 100, this.height / 4 + 120 + 12, I18n.getString("gui.cancel"))); + } + +- private void func_98063_a(long var1) { ++ private void func_98063_a(long par1) { + McoClient var3 = new McoClient(this.mc.getSession()); + + try { +- ValueObjectSubscription var4 = var3.func_98177_f(var1); ++ ValueObjectSubscription var4 = var3.func_98177_f(par1); + this.field_98068_n = var4.field_98170_b; +- this.p = this.func_98062_b(var4.field_98171_a); ++ this.field_98069_o = this.func_98062_b(var4.field_98171_a); + } catch (ExceptionMcoService var5) { + Minecraft.getMinecraft().getLogAgent().logSevere(var5.toString()); + } catch (IOException var6) { + Minecraft.getMinecraft().getLogAgent().logWarning("Realms: could not parse response"); + } +- + } + +- private String func_98062_b(long var1) { ++ private String func_98062_b(long par1) { + GregorianCalendar var3 = new GregorianCalendar(TimeZone.getDefault()); +- var3.setTimeInMillis(var1); ++ var3.setTimeInMillis(par1); + return SimpleDateFormat.getDateTimeInstance().format(var3.getTime()); + } + ++ /** ++ * Called when the screen is unloaded. Used to disable keyboard repeat events ++ */ + public void onGuiClosed() { + Keyboard.enableRepeatEvents(false); + } + +- protected void actionPerformed(GuiButton var1) { +- if(var1.enabled) { +- if(var1.id == 0) { ++ /** ++ * Fired when a control is clicked. This is the equivalent of ActionListener.actionPerformed(ActionEvent e). ++ */ ++ protected void actionPerformed(GuiButton par1GuiButton) { ++ if (par1GuiButton.enabled) { ++ if (par1GuiButton.id == 0) { + this.mc.displayGuiScreen(this.field_98067_a); +- } else if(var1.id == 1) { ++ } else if (par1GuiButton.id == 1) { ++ ; + } +- + } + } + +- protected void keyTyped(char var1, int var2) { +- } +- +- protected void mouseClicked(int var1, int var2, int var3) { +- super.mouseClicked(var1, var2, var3); +- } +- +- public void drawScreen(int var1, int var2, float var3) { ++ /** ++ * Fired when a key is typed. This is the equivalent of KeyListener.keyTyped(KeyEvent e). ++ */ ++ protected void keyTyped(char par1, int par2) {} ++ ++ /** ++ * Called when the mouse is clicked. ++ */ ++ protected void mouseClicked(int par1, int par2, int par3) { ++ super.mouseClicked(par1, par2, par3); ++ } ++ ++ /** ++ * Draws the screen and all the components in it. ++ */ ++ public void drawScreen(int par1, int par2, float par3) { + this.drawDefaultBackground(); + this.drawCenteredString(this.fontRenderer, I18n.getString("mco.configure.world.subscription.title"), this.width / 2, 17, 16777215); + this.drawString(this.fontRenderer, I18n.getString("mco.configure.world.subscription.start"), this.width / 2 - 100, 53, 10526880); +- this.drawString(this.fontRenderer, this.p, this.width / 2 - 100, 66, 16777215); ++ this.drawString(this.fontRenderer, this.field_98069_o, this.width / 2 - 100, 66, 16777215); + this.drawString(this.fontRenderer, I18n.getString("mco.configure.world.subscription.daysleft"), this.width / 2 - 100, 85, 10526880); + this.drawString(this.fontRenderer, String.valueOf(this.field_98068_n), this.width / 2 - 100, 98, 16777215); +- super.drawScreen(var1, var2, var3); ++ super.drawScreen(par1, par2, par3); + } + } diff --git a/patches/net/minecraft/src/GuiScreenTemporaryResourcePackSelect.java.patch b/patches/net/minecraft/src/GuiScreenTemporaryResourcePackSelect.java.patch new file mode 100644 index 0000000..28b2dad --- /dev/null +++ b/patches/net/minecraft/src/GuiScreenTemporaryResourcePackSelect.java.patch @@ -0,0 +1,219 @@ +--- net/minecraft/src/GuiScreenTemporaryResourcePackSelect.java ++++ net/minecraft/src/GuiScreenTemporaryResourcePackSelect.java +@@ -11,33 +11,40 @@ + private GuiScreenTemporaryResourcePackSelectSelectionList field_110346_c; + private GameSettings field_96146_n; + +- public GuiScreenTemporaryResourcePackSelect(GuiScreen var1, GameSettings var2) { +- this.field_110347_a = var1; +- this.field_96146_n = var2; ++ public GuiScreenTemporaryResourcePackSelect(GuiScreen par1GuiScreen, GameSettings par2GameSettings) { ++ this.field_110347_a = par1GuiScreen; ++ this.field_96146_n = par2GameSettings; + } + ++ /** ++ * Adds the buttons (and other controls) to the screen in question. ++ */ + public void initGui() { +- this.i.add(new GuiSmallButton(5, this.width / 2 - 154, this.height - 48, I18n.getString("resourcePack.openFolder"))); +- this.i.add(new GuiSmallButton(6, this.width / 2 + 4, this.height - 48, I18n.getString("gui.done"))); ++ this.buttonList.add(new GuiSmallButton(5, this.width / 2 - 154, this.height - 48, I18n.getString("resourcePack.openFolder"))); ++ this.buttonList.add(new GuiSmallButton(6, this.width / 2 + 4, this.height - 48, I18n.getString("gui.done"))); + this.field_110346_c = new GuiScreenTemporaryResourcePackSelectSelectionList(this, this.mc.getResourcePackRepository()); + this.field_110346_c.registerScrollButtons(7, 8); + } + +- protected void actionPerformed(GuiButton var1) { +- if(var1.enabled) { +- if(var1.id == 5) { ++ /** ++ * Fired when a control is clicked. This is the equivalent of ActionListener.actionPerformed(ActionEvent e). ++ */ ++ protected void actionPerformed(GuiButton par1GuiButton) { ++ if (par1GuiButton.enabled) { ++ if (par1GuiButton.id == 5) { + File var2 = GuiScreenTemporaryResourcePackSelectSelectionList.func_110510_a(this.field_110346_c).getDirResourcepacks(); + String var3 = var2.getAbsolutePath(); +- if(Util.getOSType() == EnumOS.MACOS) { ++ ++ if (Util.getOSType() == EnumOS.MACOS) { + try { + this.mc.getLogAgent().logInfo(var3); +- Runtime.getRuntime().exec(new String[]{"/usr/bin/open", var3}); ++ Runtime.getRuntime().exec(new String[] {"/usr/bin/open", var3}); + return; + } catch (IOException var9) { + var9.printStackTrace(); + } +- } else if(Util.getOSType() == EnumOS.WINDOWS) { +- String var4 = String.format("cmd.exe /C start \"Open file\" \"%s\"", new Object[]{var3}); ++ } else if (Util.getOSType() == EnumOS.WINDOWS) { ++ String var4 = String.format("cmd.exe /C start \"Open file\" \"%s\"", new Object[] {var3}); + + try { + Runtime.getRuntime().exec(var4); +@@ -52,91 +59,104 @@ + try { + Class var5 = Class.forName("java.awt.Desktop"); + Object var6 = var5.getMethod("getDesktop", new Class[0]).invoke((Object)null, new Object[0]); +- var5.getMethod("browse", new Class[]{URI.class}).invoke(var6, new Object[]{var2.toURI()}); ++ var5.getMethod("browse", new Class[] {URI.class}).invoke(var6, new Object[] {var2.toURI()}); + } catch (Throwable var7) { + var7.printStackTrace(); + var10 = true; + } + +- if(var10) { ++ if (var10) { + this.mc.getLogAgent().logInfo("Opening via system class!"); + Sys.openURL("file://" + var3); + } +- } else if(var1.id == 6) { ++ } else if (par1GuiButton.id == 6) { + this.mc.displayGuiScreen(this.field_110347_a); + } else { +- this.field_110346_c.actionPerformed(var1); ++ this.field_110346_c.actionPerformed(par1GuiButton); + } +- + } + } + +- protected void mouseClicked(int var1, int var2, int var3) { +- super.mouseClicked(var1, var2, var3); +- } +- +- protected void mouseMovedOrUp(int var1, int var2, int var3) { +- super.mouseMovedOrUp(var1, var2, var3); +- } +- +- public void drawScreen(int var1, int var2, float var3) { +- this.field_110346_c.drawScreen(var1, var2, var3); +- if(this.refreshTimer <= 0) { ++ /** ++ * Called when the mouse is clicked. ++ */ ++ protected void mouseClicked(int par1, int par2, int par3) { ++ super.mouseClicked(par1, par2, par3); ++ } ++ ++ /** ++ * Called when the mouse is moved or a mouse button is released. Signature: (mouseX, mouseY, which) which==-1 is ++ * mouseMove, which==0 or which==1 is mouseUp ++ */ ++ protected void mouseMovedOrUp(int par1, int par2, int par3) { ++ super.mouseMovedOrUp(par1, par2, par3); ++ } ++ ++ /** ++ * Draws the screen and all the components in it. ++ */ ++ public void drawScreen(int par1, int par2, float par3) { ++ this.field_110346_c.drawScreen(par1, par2, par3); ++ ++ if (this.refreshTimer <= 0) { + GuiScreenTemporaryResourcePackSelectSelectionList.func_110510_a(this.field_110346_c).updateRepositoryEntriesAll(); + this.refreshTimer = 20; + } + + this.drawCenteredString(this.fontRenderer, I18n.getString("resourcePack.title"), this.width / 2, 16, 16777215); + this.drawCenteredString(this.fontRenderer, I18n.getString("resourcePack.folderInfo"), this.width / 2 - 77, this.height - 26, 8421504); +- super.drawScreen(var1, var2, var3); ++ super.drawScreen(par1, par2, par3); + } + ++ /** ++ * Called from the main game loop to update the screen. ++ */ + public void updateScreen() { + super.updateScreen(); + --this.refreshTimer; + } + +- static Minecraft func_110344_a(GuiScreenTemporaryResourcePackSelect var0) { +- return var0.mc; +- } +- +- static Minecraft func_110341_b(GuiScreenTemporaryResourcePackSelect var0) { +- return var0.mc; +- } +- +- static Minecraft func_110339_c(GuiScreenTemporaryResourcePackSelect var0) { +- return var0.mc; +- } +- +- static Minecraft func_110345_d(GuiScreenTemporaryResourcePackSelect var0) { +- return var0.mc; +- } +- +- static Minecraft func_110334_e(GuiScreenTemporaryResourcePackSelect var0) { +- return var0.mc; +- } +- +- static Minecraft func_110340_f(GuiScreenTemporaryResourcePackSelect var0) { +- return var0.mc; +- } +- +- static FontRenderer func_130017_g(GuiScreenTemporaryResourcePackSelect var0) { +- return var0.fontRenderer; +- } +- +- static FontRenderer func_130016_h(GuiScreenTemporaryResourcePackSelect var0) { +- return var0.fontRenderer; +- } +- +- static FontRenderer func_110337_i(GuiScreenTemporaryResourcePackSelect var0) { +- return var0.fontRenderer; +- } +- +- static FontRenderer func_110335_j(GuiScreenTemporaryResourcePackSelect var0) { +- return var0.fontRenderer; +- } +- +- static FontRenderer func_110338_k(GuiScreenTemporaryResourcePackSelect var0) { +- return var0.fontRenderer; ++ static Minecraft func_110344_a(GuiScreenTemporaryResourcePackSelect par0GuiScreenTemporaryResourcePackSelect) { ++ return par0GuiScreenTemporaryResourcePackSelect.mc; ++ } ++ ++ static Minecraft func_110341_b(GuiScreenTemporaryResourcePackSelect par0GuiScreenTemporaryResourcePackSelect) { ++ return par0GuiScreenTemporaryResourcePackSelect.mc; ++ } ++ ++ static Minecraft func_110339_c(GuiScreenTemporaryResourcePackSelect par0GuiScreenTemporaryResourcePackSelect) { ++ return par0GuiScreenTemporaryResourcePackSelect.mc; ++ } ++ ++ static Minecraft func_110345_d(GuiScreenTemporaryResourcePackSelect par0GuiScreenTemporaryResourcePackSelect) { ++ return par0GuiScreenTemporaryResourcePackSelect.mc; ++ } ++ ++ static Minecraft func_110334_e(GuiScreenTemporaryResourcePackSelect par0GuiScreenTemporaryResourcePackSelect) { ++ return par0GuiScreenTemporaryResourcePackSelect.mc; ++ } ++ ++ static Minecraft func_110340_f(GuiScreenTemporaryResourcePackSelect par0GuiScreenTemporaryResourcePackSelect) { ++ return par0GuiScreenTemporaryResourcePackSelect.mc; ++ } ++ ++ static FontRenderer func_130017_g(GuiScreenTemporaryResourcePackSelect par0GuiScreenTemporaryResourcePackSelect) { ++ return par0GuiScreenTemporaryResourcePackSelect.fontRenderer; ++ } ++ ++ static FontRenderer func_130016_h(GuiScreenTemporaryResourcePackSelect par0GuiScreenTemporaryResourcePackSelect) { ++ return par0GuiScreenTemporaryResourcePackSelect.fontRenderer; ++ } ++ ++ static FontRenderer func_110337_i(GuiScreenTemporaryResourcePackSelect par0GuiScreenTemporaryResourcePackSelect) { ++ return par0GuiScreenTemporaryResourcePackSelect.fontRenderer; ++ } ++ ++ static FontRenderer func_110335_j(GuiScreenTemporaryResourcePackSelect par0GuiScreenTemporaryResourcePackSelect) { ++ return par0GuiScreenTemporaryResourcePackSelect.fontRenderer; ++ } ++ ++ static FontRenderer func_110338_k(GuiScreenTemporaryResourcePackSelect par0GuiScreenTemporaryResourcePackSelect) { ++ return par0GuiScreenTemporaryResourcePackSelect.fontRenderer; + } + } diff --git a/patches/net/minecraft/src/GuiScreenTemporaryResourcePackSelectSelectionList.java.patch b/patches/net/minecraft/src/GuiScreenTemporaryResourcePackSelectSelectionList.java.patch new file mode 100644 index 0000000..2ffa0ed --- /dev/null +++ b/patches/net/minecraft/src/GuiScreenTemporaryResourcePackSelectSelectionList.java.patch @@ -0,0 +1,158 @@ +--- net/minecraft/src/GuiScreenTemporaryResourcePackSelectSelectionList.java ++++ net/minecraft/src/GuiScreenTemporaryResourcePackSelectSelectionList.java +@@ -7,43 +7,56 @@ + class GuiScreenTemporaryResourcePackSelectSelectionList extends GuiSlot { + private final ResourcePackRepository field_110511_b; + private ResourceLocation field_110513_h; ++ + final GuiScreenTemporaryResourcePackSelect field_110512_a; + +- public GuiScreenTemporaryResourcePackSelectSelectionList(GuiScreenTemporaryResourcePackSelect var1, ResourcePackRepository var2) { +- super(GuiScreenTemporaryResourcePackSelect.func_110344_a(var1), var1.width, var1.height, 32, var1.height - 55 + 4, 36); +- this.field_110512_a = var1; +- this.field_110511_b = var2; +- var2.updateRepositoryEntriesAll(); ++ public GuiScreenTemporaryResourcePackSelectSelectionList(GuiScreenTemporaryResourcePackSelect par1GuiScreenTemporaryResourcePackSelect, ResourcePackRepository par2ResourcePackRepository) { ++ super(GuiScreenTemporaryResourcePackSelect.func_110344_a(par1GuiScreenTemporaryResourcePackSelect), par1GuiScreenTemporaryResourcePackSelect.width, par1GuiScreenTemporaryResourcePackSelect.height, 32, par1GuiScreenTemporaryResourcePackSelect.height - 55 + 4, 36); ++ this.field_110512_a = par1GuiScreenTemporaryResourcePackSelect; ++ this.field_110511_b = par2ResourcePackRepository; ++ par2ResourcePackRepository.updateRepositoryEntriesAll(); + } + ++ /** ++ * Gets the size of the current slot list. ++ */ + protected int getSize() { + return 1 + this.field_110511_b.getRepositoryEntriesAll().size(); + } + +- protected void elementClicked(int var1, boolean var2) { ++ /** ++ * the element in the slot that was clicked, boolean for wether it was double clicked or not ++ */ ++ protected void elementClicked(int par1, boolean par2) { + List var3 = this.field_110511_b.getRepositoryEntriesAll(); + + try { +- if(var1 == 0) { ++ if (par1 == 0) { + throw new RuntimeException("This is so horrible ;D"); + } + +- this.field_110511_b.setRepositoryEntries(new ResourcePackRepositoryEntry[]{(ResourcePackRepositoryEntry)var3.get(var1 - 1)}); ++ this.field_110511_b.setRepositoryEntries(new ResourcePackRepositoryEntry[] {(ResourcePackRepositoryEntry)var3.get(par1 - 1)}); + GuiScreenTemporaryResourcePackSelect.func_110341_b(this.field_110512_a).refreshResources(); + } catch (Exception var5) { + this.field_110511_b.setRepositoryEntries(new ResourcePackRepositoryEntry[0]); + GuiScreenTemporaryResourcePackSelect.func_110339_c(this.field_110512_a).refreshResources(); + } + +- GuiScreenTemporaryResourcePackSelect.func_110345_d(this.field_110512_a).gameSettings.m = this.field_110511_b.getResourcePackName(); ++ GuiScreenTemporaryResourcePackSelect.func_110345_d(this.field_110512_a).gameSettings.skin = this.field_110511_b.getResourcePackName(); + GuiScreenTemporaryResourcePackSelect.func_110334_e(this.field_110512_a).gameSettings.saveOptions(); + } + +- protected boolean isSelected(int var1) { ++ /** ++ * returns true if the element passed in is currently selected ++ */ ++ protected boolean isSelected(int par1) { + List var2 = this.field_110511_b.getRepositoryEntries(); +- return var1 == 0 ? var2.isEmpty() : var2.contains(this.field_110511_b.getRepositoryEntriesAll().get(var1 - 1)); ++ return par1 == 0 ? var2.isEmpty() : var2.contains(this.field_110511_b.getRepositoryEntriesAll().get(par1 - 1)); + } + ++ /** ++ * return the height of the content being scrolled ++ */ + protected int getContentHeight() { + return this.getSize() * 36; + } +@@ -52,57 +65,59 @@ + this.field_110512_a.drawDefaultBackground(); + } + +- protected void drawSlot(int var1, int var2, int var3, int var4, Tessellator var5) { ++ protected void drawSlot(int par1, int par2, int par3, int par4, Tessellator par5Tessellator) { + TextureManager var6 = GuiScreenTemporaryResourcePackSelect.func_110340_f(this.field_110512_a).getTextureManager(); +- if(var1 == 0) { ++ ++ if (par1 == 0) { + try { + ResourcePack var12 = this.field_110511_b.rprDefaultResourcePack; + PackMetadataSection var13 = (PackMetadataSection)var12.getPackMetadata(this.field_110511_b.rprMetadataSerializer, "pack"); +- if(this.field_110513_h == null) { ++ ++ if (this.field_110513_h == null) { + this.field_110513_h = var6.getDynamicTextureLocation("texturepackicon", new DynamicTexture(var12.getPackImage())); + } + + var6.bindTexture(this.field_110513_h); + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); +- var5.startDrawingQuads(); +- var5.setColorOpaque_I(16777215); +- var5.addVertexWithUV((double)var2, (double)(var3 + var4), 0.0D, 0.0D, 1.0D); +- var5.addVertexWithUV((double)(var2 + 32), (double)(var3 + var4), 0.0D, 1.0D, 1.0D); +- var5.addVertexWithUV((double)(var2 + 32), (double)var3, 0.0D, 1.0D, 0.0D); +- var5.addVertexWithUV((double)var2, (double)var3, 0.0D, 0.0D, 0.0D); +- var5.draw(); +- this.field_110512_a.drawString(GuiScreenTemporaryResourcePackSelect.func_130017_g(this.field_110512_a), "Default", var2 + 32 + 2, var3 + 1, 16777215); +- this.field_110512_a.drawString(GuiScreenTemporaryResourcePackSelect.func_130016_h(this.field_110512_a), var13.getPackDescription(), var2 + 32 + 2, var3 + 12 + 10, 8421504); ++ par5Tessellator.startDrawingQuads(); ++ par5Tessellator.setColorOpaque_I(16777215); ++ par5Tessellator.addVertexWithUV((double)par2, (double)(par3 + par4), 0.0D, 0.0D, 1.0D); ++ par5Tessellator.addVertexWithUV((double)(par2 + 32), (double)(par3 + par4), 0.0D, 1.0D, 1.0D); ++ par5Tessellator.addVertexWithUV((double)(par2 + 32), (double)par3, 0.0D, 1.0D, 0.0D); ++ par5Tessellator.addVertexWithUV((double)par2, (double)par3, 0.0D, 0.0D, 0.0D); ++ par5Tessellator.draw(); ++ this.field_110512_a.drawString(GuiScreenTemporaryResourcePackSelect.func_130017_g(this.field_110512_a), "Default", par2 + 32 + 2, par3 + 1, 16777215); ++ this.field_110512_a.drawString(GuiScreenTemporaryResourcePackSelect.func_130016_h(this.field_110512_a), var13.getPackDescription(), par2 + 32 + 2, par3 + 12 + 10, 8421504); + } catch (IOException var11) { ++ ; + } +- + } else { +- ResourcePackRepositoryEntry var7 = (ResourcePackRepositoryEntry)this.field_110511_b.getRepositoryEntriesAll().get(var1 - 1); ++ ResourcePackRepositoryEntry var7 = (ResourcePackRepositoryEntry)this.field_110511_b.getRepositoryEntriesAll().get(par1 - 1); + var7.bindTexturePackIcon(var6); + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); +- var5.startDrawingQuads(); +- var5.setColorOpaque_I(16777215); +- var5.addVertexWithUV((double)var2, (double)(var3 + var4), 0.0D, 0.0D, 1.0D); +- var5.addVertexWithUV((double)(var2 + 32), (double)(var3 + var4), 0.0D, 1.0D, 1.0D); +- var5.addVertexWithUV((double)(var2 + 32), (double)var3, 0.0D, 1.0D, 0.0D); +- var5.addVertexWithUV((double)var2, (double)var3, 0.0D, 0.0D, 0.0D); +- var5.draw(); ++ par5Tessellator.startDrawingQuads(); ++ par5Tessellator.setColorOpaque_I(16777215); ++ par5Tessellator.addVertexWithUV((double)par2, (double)(par3 + par4), 0.0D, 0.0D, 1.0D); ++ par5Tessellator.addVertexWithUV((double)(par2 + 32), (double)(par3 + par4), 0.0D, 1.0D, 1.0D); ++ par5Tessellator.addVertexWithUV((double)(par2 + 32), (double)par3, 0.0D, 1.0D, 0.0D); ++ par5Tessellator.addVertexWithUV((double)par2, (double)par3, 0.0D, 0.0D, 0.0D); ++ par5Tessellator.draw(); + String var8 = var7.getResourcePackName(); +- if(var8.length() > 32) { ++ ++ if (var8.length() > 32) { + var8 = var8.substring(0, 32).trim() + "..."; + } + +- this.field_110512_a.drawString(GuiScreenTemporaryResourcePackSelect.func_110337_i(this.field_110512_a), var8, var2 + 32 + 2, var3 + 1, 16777215); ++ this.field_110512_a.drawString(GuiScreenTemporaryResourcePackSelect.func_110337_i(this.field_110512_a), var8, par2 + 32 + 2, par3 + 1, 16777215); + List var9 = GuiScreenTemporaryResourcePackSelect.func_110335_j(this.field_110512_a).listFormattedStringToWidth(var7.getTexturePackDescription(), 183); + +- for(int var10 = 0; var10 < 2 && var10 < var9.size(); ++var10) { +- this.field_110512_a.drawString(GuiScreenTemporaryResourcePackSelect.func_110338_k(this.field_110512_a), (String)var9.get(var10), var2 + 32 + 2, var3 + 12 + 10 * var10, 8421504); ++ for (int var10 = 0; var10 < 2 && var10 < var9.size(); ++var10) { ++ this.field_110512_a.drawString(GuiScreenTemporaryResourcePackSelect.func_110338_k(this.field_110512_a), (String)var9.get(var10), par2 + 32 + 2, par3 + 12 + 10 * var10, 8421504); + } +- + } + } + +- static ResourcePackRepository func_110510_a(GuiScreenTemporaryResourcePackSelectSelectionList var0) { +- return var0.field_110511_b; ++ static ResourcePackRepository func_110510_a(GuiScreenTemporaryResourcePackSelectSelectionList par0GuiScreenTemporaryResourcePackSelectSelectionList) { ++ return par0GuiScreenTemporaryResourcePackSelectSelectionList.field_110511_b; + } + } diff --git a/patches/net/minecraft/src/GuiSelectWorld.java.patch b/patches/net/minecraft/src/GuiSelectWorld.java.patch new file mode 100644 index 0000000..67bc277 --- /dev/null +++ b/patches/net/minecraft/src/GuiSelectWorld.java.patch @@ -0,0 +1,392 @@ +--- net/minecraft/src/GuiSelectWorld.java ++++ net/minecraft/src/GuiSelectWorld.java +@@ -6,28 +6,59 @@ + import java.util.List; + + public class GuiSelectWorld extends GuiScreen { +- private final DateFormat c = new SimpleDateFormat(); ++ ++ /** simple date formater */ ++ private final DateFormat dateFormatter = new SimpleDateFormat(); ++ ++ /** ++ * A reference to the screen object that created this. Used for navigating between screens. ++ */ + protected GuiScreen parentScreen; +- protected String b = "Select world"; ++ ++ /** The title string that is displayed in the top-center of the screen. */ ++ protected String screenTitle = "Select world"; ++ ++ /** True if a world has been selected. */ + private boolean selected; ++ ++ /** the currently selected world */ + private int selectedWorld; +- private List p; ++ ++ /** The save list for the world selection screen */ ++ private List saveList; + private GuiWorldSlot worldSlotContainer; +- private String r; +- private String s; +- private String[] t = new String[3]; ++ ++ /** E.g. World, Welt, Monde, Mundo */ ++ private String localizedWorldText; ++ private String localizedMustConvertText; ++ ++ /** ++ * The game mode text that is displayed with each world on the world selection list. ++ */ ++ private String[] localizedGameModeText = new String[3]; ++ ++ /** set to true if you arein the process of deleteing a world/save */ + private boolean deleting; ++ ++ /** The delete button in the world selection GUI */ + private GuiButton buttonDelete; ++ ++ /** the select button in the world selection gui */ + private GuiButton buttonSelect; ++ ++ /** The rename button in the world selection GUI */ + private GuiButton buttonRename; + private GuiButton buttonRecreate; + +- public GuiSelectWorld(GuiScreen var1) { +- this.parentScreen = var1; ++ public GuiSelectWorld(GuiScreen par1GuiScreen) { ++ this.parentScreen = par1GuiScreen; + } + ++ /** ++ * Adds the buttons (and other controls) to the screen in question. ++ */ + public void initGui() { +- this.b = I18n.getString("selectWorld.title"); ++ this.screenTitle = I18n.getString("selectWorld.title"); + + try { + this.loadSaves(); +@@ -37,67 +68,84 @@ + return; + } + +- this.r = I18n.getString("selectWorld.world"); +- this.s = I18n.getString("selectWorld.conversion"); +- this.t[EnumGameType.SURVIVAL.getID()] = I18n.getString("gameMode.survival"); +- this.t[EnumGameType.CREATIVE.getID()] = I18n.getString("gameMode.creative"); +- this.t[EnumGameType.ADVENTURE.getID()] = I18n.getString("gameMode.adventure"); ++ this.localizedWorldText = I18n.getString("selectWorld.world"); ++ this.localizedMustConvertText = I18n.getString("selectWorld.conversion"); ++ this.localizedGameModeText[EnumGameType.SURVIVAL.getID()] = I18n.getString("gameMode.survival"); ++ this.localizedGameModeText[EnumGameType.CREATIVE.getID()] = I18n.getString("gameMode.creative"); ++ this.localizedGameModeText[EnumGameType.ADVENTURE.getID()] = I18n.getString("gameMode.adventure"); + this.worldSlotContainer = new GuiWorldSlot(this); + this.worldSlotContainer.registerScrollButtons(4, 5); + this.initButtons(); + } + ++ /** ++ * loads the saves ++ */ + private void loadSaves() throws AnvilConverterException { + ISaveFormat var1 = this.mc.getSaveLoader(); +- this.p = var1.getSaveList(); +- Collections.sort(this.p); ++ this.saveList = var1.getSaveList(); ++ Collections.sort(this.saveList); + this.selectedWorld = -1; + } + +- protected String getSaveFileName(int var1) { +- return ((SaveFormatComparator)this.p.get(var1)).getFileName(); ++ /** ++ * returns the file name of the specified save number ++ */ ++ protected String getSaveFileName(int par1) { ++ return ((SaveFormatComparator)this.saveList.get(par1)).getFileName(); + } + +- protected String getSaveName(int var1) { +- String var2 = ((SaveFormatComparator)this.p.get(var1)).getDisplayName(); +- if(var2 == null || MathHelper.stringNullOrLengthZero(var2)) { +- var2 = I18n.getString("selectWorld.world") + " " + (var1 + 1); ++ /** ++ * returns the name of the saved game ++ */ ++ protected String getSaveName(int par1) { ++ String var2 = ((SaveFormatComparator)this.saveList.get(par1)).getDisplayName(); ++ ++ if (var2 == null || MathHelper.stringNullOrLengthZero(var2)) { ++ var2 = I18n.getString("selectWorld.world") + " " + (par1 + 1); + } + + return var2; + } + ++ /** ++ * intilize the buttons for this GUI ++ */ + public void initButtons() { +- this.i.add(this.buttonSelect = new GuiButton(1, this.width / 2 - 154, this.height - 52, 150, 20, I18n.getString("selectWorld.select"))); +- this.i.add(new GuiButton(3, this.width / 2 + 4, this.height - 52, 150, 20, I18n.getString("selectWorld.create"))); +- this.i.add(this.buttonRename = new GuiButton(6, this.width / 2 - 154, this.height - 28, 72, 20, I18n.getString("selectWorld.rename"))); +- this.i.add(this.buttonDelete = new GuiButton(2, this.width / 2 - 76, this.height - 28, 72, 20, I18n.getString("selectWorld.delete"))); +- this.i.add(this.buttonRecreate = new GuiButton(7, this.width / 2 + 4, this.height - 28, 72, 20, I18n.getString("selectWorld.recreate"))); +- this.i.add(new GuiButton(0, this.width / 2 + 82, this.height - 28, 72, 20, I18n.getString("gui.cancel"))); ++ this.buttonList.add(this.buttonSelect = new GuiButton(1, this.width / 2 - 154, this.height - 52, 150, 20, I18n.getString("selectWorld.select"))); ++ this.buttonList.add(new GuiButton(3, this.width / 2 + 4, this.height - 52, 150, 20, I18n.getString("selectWorld.create"))); ++ this.buttonList.add(this.buttonRename = new GuiButton(6, this.width / 2 - 154, this.height - 28, 72, 20, I18n.getString("selectWorld.rename"))); ++ this.buttonList.add(this.buttonDelete = new GuiButton(2, this.width / 2 - 76, this.height - 28, 72, 20, I18n.getString("selectWorld.delete"))); ++ this.buttonList.add(this.buttonRecreate = new GuiButton(7, this.width / 2 + 4, this.height - 28, 72, 20, I18n.getString("selectWorld.recreate"))); ++ this.buttonList.add(new GuiButton(0, this.width / 2 + 82, this.height - 28, 72, 20, I18n.getString("gui.cancel"))); + this.buttonSelect.enabled = false; + this.buttonDelete.enabled = false; + this.buttonRename.enabled = false; + this.buttonRecreate.enabled = false; + } + +- protected void actionPerformed(GuiButton var1) { +- if(var1.enabled) { +- if(var1.id == 2) { ++ /** ++ * Fired when a control is clicked. This is the equivalent of ActionListener.actionPerformed(ActionEvent e). ++ */ ++ protected void actionPerformed(GuiButton par1GuiButton) { ++ if (par1GuiButton.enabled) { ++ if (par1GuiButton.id == 2) { + String var2 = this.getSaveName(this.selectedWorld); +- if(var2 != null) { ++ ++ if (var2 != null) { + this.deleting = true; + GuiYesNo var3 = getDeleteWorldScreen(this, var2, this.selectedWorld); + this.mc.displayGuiScreen(var3); + } +- } else if(var1.id == 1) { ++ } else if (par1GuiButton.id == 1) { + this.selectWorld(this.selectedWorld); +- } else if(var1.id == 3) { ++ } else if (par1GuiButton.id == 3) { + this.mc.displayGuiScreen(new GuiCreateWorld(this)); +- } else if(var1.id == 6) { ++ } else if (par1GuiButton.id == 6) { + this.mc.displayGuiScreen(new GuiRenameWorld(this, this.getSaveFileName(this.selectedWorld))); +- } else if(var1.id == 0) { +- this.mc.displayGuiScreen(this.parentScreen); +- } else if(var1.id == 7) { ++ } else if (par1GuiButton.id == 0) { ++ this.mc.displayGuiScreen(new org.spoutcraft.client.gui.mainmenu.MainMenu()); // Spout ++ } else if (par1GuiButton.id == 7) { + GuiCreateWorld var5 = new GuiCreateWorld(this); + ISaveHandler var6 = this.mc.getSaveLoader().getSaveLoader(this.getSaveFileName(this.selectedWorld), false); + WorldInfo var4 = var6.loadWorldInfo(); +@@ -105,41 +153,46 @@ + var5.func_82286_a(var4); + this.mc.displayGuiScreen(var5); + } else { +- this.worldSlotContainer.actionPerformed(var1); ++ this.worldSlotContainer.actionPerformed(par1GuiButton); + } +- + } + } + +- public void selectWorld(int var1) { ++ /** ++ * Gets the selected world. ++ */ ++ public void selectWorld(int par1) { + this.mc.displayGuiScreen((GuiScreen)null); +- if(!this.selected) { ++ ++ if (!this.selected) { + this.selected = true; +- String var2 = this.getSaveFileName(var1); +- if(var2 == null) { +- var2 = "World" + var1; +- } +- +- String var3 = this.getSaveName(var1); +- if(var3 == null) { +- var3 = "World" + var1; +- } +- +- if(this.mc.getSaveLoader().canLoadWorld(var2)) { ++ String var2 = this.getSaveFileName(par1); ++ ++ if (var2 == null) { ++ var2 = "World" + par1; ++ } ++ ++ String var3 = this.getSaveName(par1); ++ ++ if (var3 == null) { ++ var3 = "World" + par1; ++ } ++ ++ if (this.mc.getSaveLoader().canLoadWorld(var2)) { + this.mc.launchIntegratedServer(var2, var3, (WorldSettings)null); + this.mc.statFileWriter.readStat(StatList.loadWorldStat, 1); + } +- + } + } + +- public void confirmClicked(boolean var1, int var2) { +- if(this.deleting) { ++ public void confirmClicked(boolean par1, int par2) { ++ if (this.deleting) { + this.deleting = false; +- if(var1) { ++ ++ if (par1) { + ISaveFormat var3 = this.mc.getSaveLoader(); + var3.flushCache(); +- var3.deleteWorldDirectory(this.getSaveFileName(var2)); ++ var3.deleteWorldDirectory(this.getSaveFileName(par2)); + + try { + this.loadSaves(); +@@ -150,65 +203,85 @@ + + this.mc.displayGuiScreen(this); + } +- +- } +- +- public void drawScreen(int var1, int var2, float var3) { +- this.worldSlotContainer.drawScreen(var1, var2, var3); +- this.drawCenteredString(this.fontRenderer, this.b, this.width / 2, 20, 16777215); +- super.drawScreen(var1, var2, var3); +- } +- +- public static GuiYesNo getDeleteWorldScreen(GuiScreen var0, String var1, int var2) { ++ } ++ ++ /** ++ * Draws the screen and all the components in it. ++ */ ++ public void drawScreen(int par1, int par2, float par3) { ++ this.worldSlotContainer.drawScreen(par1, par2, par3); ++ this.drawCenteredString(this.fontRenderer, this.screenTitle, this.width / 2, 20, 16777215); ++ super.drawScreen(par1, par2, par3); ++ } ++ ++ /** ++ * Gets a GuiYesNo screen with the warning, buttons, etc. ++ */ ++ public static GuiYesNo getDeleteWorldScreen(GuiScreen par0GuiScreen, String par1Str, int par2) { + String var3 = I18n.getString("selectWorld.deleteQuestion"); +- String var4 = "\'" + var1 + "\' " + I18n.getString("selectWorld.deleteWarning"); ++ String var4 = "\'" + par1Str + "\' " + I18n.getString("selectWorld.deleteWarning"); + String var5 = I18n.getString("selectWorld.deleteButton"); + String var6 = I18n.getString("gui.cancel"); +- GuiYesNo var7 = new GuiYesNo(var0, var3, var4, var5, var6, var2); ++ GuiYesNo var7 = new GuiYesNo(par0GuiScreen, var3, var4, var5, var6, par2); + return var7; + } + +- static List getSize(GuiSelectWorld var0) { +- return var0.p; +- } +- +- static int onElementSelected(GuiSelectWorld var0, int var1) { +- return var0.selectedWorld = var1; +- } +- +- static int getSelectedWorld(GuiSelectWorld var0) { +- return var0.selectedWorld; +- } +- +- static GuiButton getSelectButton(GuiSelectWorld var0) { +- return var0.buttonSelect; +- } +- +- static GuiButton getRenameButton(GuiSelectWorld var0) { +- return var0.buttonDelete; +- } +- +- static GuiButton getDeleteButton(GuiSelectWorld var0) { +- return var0.buttonRename; +- } +- +- static GuiButton func_82312_f(GuiSelectWorld var0) { +- return var0.buttonRecreate; +- } +- +- static String func_82313_g(GuiSelectWorld var0) { +- return var0.r; +- } +- +- static DateFormat func_82315_h(GuiSelectWorld var0) { +- return var0.c; +- } +- +- static String func_82311_i(GuiSelectWorld var0) { +- return var0.s; +- } +- +- static String[] func_82314_j(GuiSelectWorld var0) { +- return var0.t; ++ static List getSize(GuiSelectWorld par0GuiSelectWorld) { ++ return par0GuiSelectWorld.saveList; ++ } ++ ++ /** ++ * called whenever an element in this gui is selected ++ */ ++ static int onElementSelected(GuiSelectWorld par0GuiSelectWorld, int par1) { ++ return par0GuiSelectWorld.selectedWorld = par1; ++ } ++ ++ /** ++ * returns the world currently selected ++ */ ++ static int getSelectedWorld(GuiSelectWorld par0GuiSelectWorld) { ++ return par0GuiSelectWorld.selectedWorld; ++ } ++ ++ /** ++ * returns the select button ++ */ ++ static GuiButton getSelectButton(GuiSelectWorld par0GuiSelectWorld) { ++ return par0GuiSelectWorld.buttonSelect; ++ } ++ ++ /** ++ * returns the rename button ++ */ ++ static GuiButton getRenameButton(GuiSelectWorld par0GuiSelectWorld) { ++ return par0GuiSelectWorld.buttonDelete; ++ } ++ ++ /** ++ * returns the delete button ++ */ ++ static GuiButton getDeleteButton(GuiSelectWorld par0GuiSelectWorld) { ++ return par0GuiSelectWorld.buttonRename; ++ } ++ ++ static GuiButton func_82312_f(GuiSelectWorld par0GuiSelectWorld) { ++ return par0GuiSelectWorld.buttonRecreate; ++ } ++ ++ static String func_82313_g(GuiSelectWorld par0GuiSelectWorld) { ++ return par0GuiSelectWorld.localizedWorldText; ++ } ++ ++ static DateFormat func_82315_h(GuiSelectWorld par0GuiSelectWorld) { ++ return par0GuiSelectWorld.dateFormatter; ++ } ++ ++ static String func_82311_i(GuiSelectWorld par0GuiSelectWorld) { ++ return par0GuiSelectWorld.localizedMustConvertText; ++ } ++ ++ static String[] func_82314_j(GuiSelectWorld par0GuiSelectWorld) { ++ return par0GuiSelectWorld.localizedGameModeText; + } + } diff --git a/patches/net/minecraft/src/GuiShareToLan.java.patch b/patches/net/minecraft/src/GuiShareToLan.java.patch new file mode 100644 index 0000000..3942fd4 --- /dev/null +++ b/patches/net/minecraft/src/GuiShareToLan.java.patch @@ -0,0 +1,123 @@ +--- net/minecraft/src/GuiShareToLan.java ++++ net/minecraft/src/GuiShareToLan.java +@@ -1,71 +1,90 @@ + package net.minecraft.src; + + public class GuiShareToLan extends GuiScreen { ++ ++ /** ++ * A reference to the screen object that created this. Used for navigating between screens. ++ */ + private final GuiScreen parentScreen; + private GuiButton buttonAllowCommandsToggle; + private GuiButton buttonGameMode; +- private String d = "survival"; ++ ++ /** ++ * The currently selected game mode. One of 'survival', 'creative', or 'adventure' ++ */ ++ private String gameMode = "survival"; ++ ++ /** True if 'Allow Cheats' is currently enabled */ + private boolean allowCommands; + +- public GuiShareToLan(GuiScreen var1) { +- this.parentScreen = var1; ++ public GuiShareToLan(GuiScreen par1GuiScreen) { ++ this.parentScreen = par1GuiScreen; + } + ++ /** ++ * Adds the buttons (and other controls) to the screen in question. ++ */ + public void initGui() { +- this.i.clear(); +- this.i.add(new GuiButton(101, this.width / 2 - 155, this.height - 28, 150, 20, I18n.getString("lanServer.start"))); +- this.i.add(new GuiButton(102, this.width / 2 + 5, this.height - 28, 150, 20, I18n.getString("gui.cancel"))); +- this.i.add(this.buttonGameMode = new GuiButton(104, this.width / 2 - 155, 100, 150, 20, I18n.getString("selectWorld.gameMode"))); +- this.i.add(this.buttonAllowCommandsToggle = new GuiButton(103, this.width / 2 + 5, 100, 150, 20, I18n.getString("selectWorld.allowCommands"))); ++ this.buttonList.clear(); ++ this.buttonList.add(new GuiButton(101, this.width / 2 - 155, this.height - 28, 150, 20, I18n.getString("lanServer.start"))); ++ this.buttonList.add(new GuiButton(102, this.width / 2 + 5, this.height - 28, 150, 20, I18n.getString("gui.cancel"))); ++ this.buttonList.add(this.buttonGameMode = new GuiButton(104, this.width / 2 - 155, 100, 150, 20, I18n.getString("selectWorld.gameMode"))); ++ this.buttonList.add(this.buttonAllowCommandsToggle = new GuiButton(103, this.width / 2 + 5, 100, 150, 20, I18n.getString("selectWorld.allowCommands"))); + this.func_74088_g(); + } + + private void func_74088_g() { +- this.buttonGameMode.f = I18n.getString("selectWorld.gameMode") + " " + I18n.getString("selectWorld.gameMode." + this.d); +- this.buttonAllowCommandsToggle.f = I18n.getString("selectWorld.allowCommands") + " "; +- if(this.allowCommands) { +- this.buttonAllowCommandsToggle.f = this.buttonAllowCommandsToggle.f + I18n.getString("options.on"); ++ this.buttonGameMode.displayString = I18n.getString("selectWorld.gameMode") + " " + I18n.getString("selectWorld.gameMode." + this.gameMode); ++ this.buttonAllowCommandsToggle.displayString = I18n.getString("selectWorld.allowCommands") + " "; ++ ++ if (this.allowCommands) { ++ this.buttonAllowCommandsToggle.displayString = this.buttonAllowCommandsToggle.displayString + I18n.getString("options.on"); + } else { +- this.buttonAllowCommandsToggle.f = this.buttonAllowCommandsToggle.f + I18n.getString("options.off"); ++ this.buttonAllowCommandsToggle.displayString = this.buttonAllowCommandsToggle.displayString + I18n.getString("options.off"); + } +- + } + +- protected void actionPerformed(GuiButton var1) { +- if(var1.id == 102) { ++ /** ++ * Fired when a control is clicked. This is the equivalent of ActionListener.actionPerformed(ActionEvent e). ++ */ ++ protected void actionPerformed(GuiButton par1GuiButton) { ++ if (par1GuiButton.id == 102) { + this.mc.displayGuiScreen(this.parentScreen); +- } else if(var1.id == 104) { +- if(this.d.equals("survival")) { +- this.d = "creative"; +- } else if(this.d.equals("creative")) { +- this.d = "adventure"; ++ } else if (par1GuiButton.id == 104) { ++ if (this.gameMode.equals("survival")) { ++ this.gameMode = "creative"; ++ } else if (this.gameMode.equals("creative")) { ++ this.gameMode = "adventure"; + } else { +- this.d = "survival"; ++ this.gameMode = "survival"; + } + + this.func_74088_g(); +- } else if(var1.id == 103) { ++ } else if (par1GuiButton.id == 103) { + this.allowCommands = !this.allowCommands; + this.func_74088_g(); +- } else if(var1.id == 101) { ++ } else if (par1GuiButton.id == 101) { + this.mc.displayGuiScreen((GuiScreen)null); +- String var2 = this.mc.getIntegratedServer().shareToLAN(EnumGameType.getByName(this.d), this.allowCommands); ++ String var2 = this.mc.getIntegratedServer().shareToLAN(EnumGameType.getByName(this.gameMode), this.allowCommands); + ChatMessageComponent var3; +- if(var2 != null) { +- var3 = ChatMessageComponent.createFromTranslationWithSubstitutions("commands.publish.started", new Object[]{var2}); ++ ++ if (var2 != null) { ++ var3 = ChatMessageComponent.createFromTranslationWithSubstitutions("commands.publish.started", new Object[] {var2}); + } else { + var3 = ChatMessageComponent.createFromText("commands.publish.failed"); + } + + this.mc.ingameGUI.getChatGUI().printChatMessage(var3.toStringWithFormatting(true)); + } +- + } + +- public void drawScreen(int var1, int var2, float var3) { ++ /** ++ * Draws the screen and all the components in it. ++ */ ++ public void drawScreen(int par1, int par2, float par3) { + this.drawDefaultBackground(); + this.drawCenteredString(this.fontRenderer, I18n.getString("lanServer.title"), this.width / 2, 50, 16777215); + this.drawCenteredString(this.fontRenderer, I18n.getString("lanServer.otherPlayers"), this.width / 2, 82, 16777215); +- super.drawScreen(var1, var2, var3); ++ super.drawScreen(par1, par2, par3); + } + } diff --git a/patches/net/minecraft/src/GuiSleepMP.java.patch b/patches/net/minecraft/src/GuiSleepMP.java.patch new file mode 100644 index 0000000..c3cf97c --- /dev/null +++ b/patches/net/minecraft/src/GuiSleepMP.java.patch @@ -0,0 +1,63 @@ +--- net/minecraft/src/GuiSleepMP.java ++++ net/minecraft/src/GuiSleepMP.java +@@ -1,37 +1,49 @@ + package net.minecraft.src; + + public class GuiSleepMP extends GuiChat { ++ ++ /** ++ * Adds the buttons (and other controls) to the screen in question. ++ */ + public void initGui() { + super.initGui(); +- this.i.add(new GuiButton(1, this.width / 2 - 100, this.height - 40, I18n.getString("multiplayer.stopSleeping"))); ++ this.buttonList.add(new GuiButton(1, this.width / 2 - 100, this.height - 40, I18n.getString("multiplayer.stopSleeping"))); + } + +- protected void keyTyped(char var1, int var2) { +- if(var2 == 1) { ++ /** ++ * Fired when a key is typed. This is the equivalent of KeyListener.keyTyped(KeyEvent e). ++ */ ++ protected void keyTyped(char par1, int par2) { ++ if (par2 == 1) { + this.wakeEntity(); +- } else if(var2 != 28 && var2 != 156) { +- super.keyTyped(var1, var2); ++ } else if (par2 != 28 && par2 != 156) { ++ super.keyTyped(par1, par2); + } else { + String var3 = this.inputField.getText().trim(); +- if(var3.length() > 0) { ++ ++ if (var3.length() > 0) { + this.mc.thePlayer.sendChatMessage(var3); + } + + this.inputField.setText(""); + this.mc.ingameGUI.getChatGUI().resetScroll(); + } +- + } + +- protected void actionPerformed(GuiButton var1) { +- if(var1.id == 1) { ++ /** ++ * Fired when a control is clicked. This is the equivalent of ActionListener.actionPerformed(ActionEvent e). ++ */ ++ protected void actionPerformed(GuiButton par1GuiButton) { ++ if (par1GuiButton.id == 1) { + this.wakeEntity(); + } else { +- super.actionPerformed(var1); ++ super.actionPerformed(par1GuiButton); + } +- + } + ++ /** ++ * Wakes the entity from the bed ++ */ + private void wakeEntity() { + NetClientHandler var1 = this.mc.thePlayer.sendQueue; + var1.addToSendQueue(new Packet19EntityAction(this.mc.thePlayer, 3)); diff --git a/patches/net/minecraft/src/GuiSlider.java.patch b/patches/net/minecraft/src/GuiSlider.java.patch new file mode 100644 index 0000000..300c254 --- /dev/null +++ b/patches/net/minecraft/src/GuiSlider.java.patch @@ -0,0 +1,107 @@ +--- net/minecraft/src/GuiSlider.java ++++ net/minecraft/src/GuiSlider.java +@@ -3,34 +3,48 @@ + import org.lwjgl.opengl.GL11; + + public class GuiSlider extends GuiButton { ++ ++ /** The value of this slider control. */ + public float sliderValue = 1.0F; ++ ++ /** Is this slider control being dragged. */ + public boolean dragging; ++ ++ /** Additional ID for this slider control. */ + private EnumOptions idFloat; + +- public GuiSlider(int var1, int var2, int var3, EnumOptions var4, String var5, float var6) { +- super(var1, var2, var3, 150, 20, var5); +- this.idFloat = var4; +- this.sliderValue = var6; ++ public GuiSlider(int par1, int par2, int par3, EnumOptions par4EnumOptions, String par5Str, float par6) { ++ super(par1, par2, par3, 150, 20, par5Str); ++ this.idFloat = par4EnumOptions; ++ this.sliderValue = par6; + } + +- protected int getHoverState(boolean var1) { ++ /** ++ * Returns 0 if the button is disabled, 1 if the mouse is NOT hovering over this button and 2 if it IS hovering over ++ * this button. ++ */ ++ protected int getHoverState(boolean par1) { + return 0; + } + +- protected void mouseDragged(Minecraft var1, int var2, int var3) { +- if(this.drawButton) { +- if(this.dragging) { +- this.sliderValue = (float)(var2 - (this.xPosition + 4)) / (float)(this.width - 8); +- if(this.sliderValue < 0.0F) { ++ /** ++ * Fired when the mouse button is dragged. Equivalent of MouseListener.mouseDragged(MouseEvent e). ++ */ ++ protected void mouseDragged(Minecraft par1Minecraft, int par2, int par3) { ++ if (this.drawButton) { ++ if (this.dragging) { ++ this.sliderValue = (float)(par2 - (this.xPosition + 4)) / (float)(this.width - 8); ++ ++ if (this.sliderValue < 0.0F) { + this.sliderValue = 0.0F; + } + +- if(this.sliderValue > 1.0F) { ++ if (this.sliderValue > 1.0F) { + this.sliderValue = 1.0F; + } + +- var1.gameSettings.setOptionFloatValue(this.idFloat, this.sliderValue); +- this.f = var1.gameSettings.getKeyBinding(this.idFloat); ++ par1Minecraft.gameSettings.setOptionFloatValue(this.idFloat, this.sliderValue); ++ this.displayString = par1Minecraft.gameSettings.getKeyBinding(this.idFloat); + } + + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); +@@ -39,19 +53,23 @@ + } + } + +- public boolean mousePressed(Minecraft var1, int var2, int var3) { +- if(super.mousePressed(var1, var2, var3)) { +- this.sliderValue = (float)(var2 - (this.xPosition + 4)) / (float)(this.width - 8); +- if(this.sliderValue < 0.0F) { ++ /** ++ * Returns true if the mouse has been pressed on this control. Equivalent of MouseListener.mousePressed(MouseEvent e). ++ */ ++ public boolean mousePressed(Minecraft par1Minecraft, int par2, int par3) { ++ if (super.mousePressed(par1Minecraft, par2, par3)) { ++ this.sliderValue = (float)(par2 - (this.xPosition + 4)) / (float)(this.width - 8); ++ ++ if (this.sliderValue < 0.0F) { + this.sliderValue = 0.0F; + } + +- if(this.sliderValue > 1.0F) { ++ if (this.sliderValue > 1.0F) { + this.sliderValue = 1.0F; + } + +- var1.gameSettings.setOptionFloatValue(this.idFloat, this.sliderValue); +- this.f = var1.gameSettings.getKeyBinding(this.idFloat); ++ par1Minecraft.gameSettings.setOptionFloatValue(this.idFloat, this.sliderValue); ++ this.displayString = par1Minecraft.gameSettings.getKeyBinding(this.idFloat); + this.dragging = true; + return true; + } else { +@@ -59,7 +77,10 @@ + } + } + +- public void mouseReleased(int var1, int var2) { ++ /** ++ * Fired when the mouse button is released. Equivalent of MouseListener.mouseReleased(MouseEvent e). ++ */ ++ public void mouseReleased(int par1, int par2) { + this.dragging = false; + } + } diff --git a/patches/net/minecraft/src/GuiSlot.java.patch b/patches/net/minecraft/src/GuiSlot.java.patch new file mode 100644 index 0000000..4f25d71 --- /dev/null +++ b/patches/net/minecraft/src/GuiSlot.java.patch @@ -0,0 +1,523 @@ +--- net/minecraft/src/GuiSlot.java ++++ net/minecraft/src/GuiSlot.java +@@ -5,65 +5,114 @@ + + public abstract class GuiSlot { + private final Minecraft mc; ++ ++ /** ++ * The width of the GuiScreen. Affects the container rendering, but not the overlays. ++ */ + private int width; ++ ++ /** ++ * The height of the GuiScreen. Affects the container rendering, but not the overlays or the scrolling. ++ */ + private int height; ++ ++ /** The top of the slot container. Affects the overlays and scrolling. */ + protected int top; ++ ++ /** The bottom of the slot container. Affects the overlays and scrolling. */ + protected int bottom; + private int right; + private int left; ++ ++ /** The height of a slot. */ + protected final int slotHeight; ++ ++ /** button id of the button used to scroll up */ + private int scrollUpButtonID; ++ ++ /** the buttonID of the button used to scroll down */ + private int scrollDownButtonID; ++ ++ /** X axis position of the mouse */ + protected int mouseX; ++ ++ /** Y axis position of the mouse */ + protected int mouseY; ++ ++ /** where the mouse was in the window when you first clicked to scroll */ + private float initialClickY = -2.0F; ++ ++ /** ++ * what to multiply the amount you moved your mouse by(used for slowing down scrolling when over the items and no on ++ * scroll bar) ++ */ + private float scrollMultiplier; ++ ++ /** how far down this slot has been scrolled */ + private float amountScrolled; ++ ++ /** the element in the list that was selected */ + private int selectedElement = -1; ++ ++ /** the time when this button was last clicked. */ + private long lastClicked; ++ ++ /** true if a selected element in this gui will show an outline box */ + private boolean showSelectionBox = true; + private boolean field_77243_s; + private int field_77242_t; + +- public GuiSlot(Minecraft var1, int var2, int var3, int var4, int var5, int var6) { +- this.mc = var1; +- this.width = var2; +- this.height = var3; +- this.top = var4; +- this.bottom = var5; +- this.slotHeight = var6; +- this.left = 0; +- this.right = var2; +- } +- +- public void func_77207_a(int var1, int var2, int var3, int var4) { +- this.width = var1; +- this.height = var2; +- this.top = var3; +- this.bottom = var4; +- this.left = 0; +- this.right = var1; +- } +- +- public void setShowSelectionBox(boolean var1) { +- this.showSelectionBox = var1; +- } +- +- protected void func_77223_a(boolean var1, int var2) { +- this.field_77243_s = var1; +- this.field_77242_t = var2; +- if(!var1) { ++ public GuiSlot(Minecraft par1Minecraft, int par2, int par3, int par4, int par5, int par6) { ++ this.mc = par1Minecraft; ++ this.width = par2; ++ this.height = par3; ++ this.top = par4; ++ this.bottom = par5; ++ this.slotHeight = par6; ++ this.left = 0; ++ this.right = par2; ++ } ++ ++ public void func_77207_a(int par1, int par2, int par3, int par4) { ++ this.width = par1; ++ this.height = par2; ++ this.top = par3; ++ this.bottom = par4; ++ this.left = 0; ++ this.right = par1; ++ } ++ ++ public void setShowSelectionBox(boolean par1) { ++ this.showSelectionBox = par1; ++ } ++ ++ protected void func_77223_a(boolean par1, int par2) { ++ this.field_77243_s = par1; ++ this.field_77242_t = par2; ++ ++ if (!par1) { + this.field_77242_t = 0; + } +- + } + ++ /** ++ * Gets the size of the current slot list. ++ */ + protected abstract int getSize(); + ++ /** ++ * the element in the slot that was clicked, boolean for wether it was double clicked or not ++ */ + protected abstract void elementClicked(int var1, boolean var2); + ++ /** ++ * returns true if the element passed in is currently selected ++ */ + protected abstract boolean isSelected(int var1); + ++ /** ++ * return the height of the content being scrolled ++ */ + protected int getContentHeight() { + return this.getSize() * this.slotHeight + this.field_77242_t; + } +@@ -72,72 +121,77 @@ + + protected abstract void drawSlot(int var1, int var2, int var3, int var4, Tessellator var5); + +- protected void func_77222_a(int var1, int var2, Tessellator var3) { +- } +- +- protected void func_77224_a(int var1, int var2) { +- } +- +- protected void func_77215_b(int var1, int var2) { +- } +- +- public int func_77210_c(int var1, int var2) { ++ protected void func_77222_a(int par1, int par2, Tessellator par3Tessellator) {} ++ ++ protected void func_77224_a(int par1, int par2) {} ++ ++ protected void func_77215_b(int par1, int par2) {} ++ ++ public int func_77210_c(int par1, int par2) { + int var3 = this.width / 2 - 110; + int var4 = this.width / 2 + 110; +- int var5 = var2 - this.top - this.field_77242_t + (int)this.amountScrolled - 4; ++ int var5 = par2 - this.top - this.field_77242_t + (int)this.amountScrolled - 4; + int var6 = var5 / this.slotHeight; +- return var1 >= var3 && var1 <= var4 && var6 >= 0 && var5 >= 0 && var6 < this.getSize() ? var6 : -1; +- } +- +- public void registerScrollButtons(int var1, int var2) { +- this.scrollUpButtonID = var1; +- this.scrollDownButtonID = var2; +- } +- ++ return par1 >= var3 && par1 <= var4 && var6 >= 0 && var5 >= 0 && var6 < this.getSize() ? var6 : -1; ++ } ++ ++ /** ++ * Registers the IDs that can be used for the scrollbar's buttons. ++ */ ++ public void registerScrollButtons(int par1, int par2) { ++ this.scrollUpButtonID = par1; ++ this.scrollDownButtonID = par2; ++ } ++ ++ /** ++ * stop the thing from scrolling out of bounds ++ */ + private void bindAmountScrolled() { + int var1 = this.func_77209_d(); +- if(var1 < 0) { ++ ++ if (var1 < 0) { + var1 /= 2; + } + +- if(this.amountScrolled < 0.0F) { ++ if (this.amountScrolled < 0.0F) { + this.amountScrolled = 0.0F; + } + +- if(this.amountScrolled > (float)var1) { ++ if (this.amountScrolled > (float)var1) { + this.amountScrolled = (float)var1; + } +- + } + + public int func_77209_d() { + return this.getContentHeight() - (this.bottom - this.top - 4); + } + +- public void func_77208_b(int var1) { +- this.amountScrolled += (float)var1; ++ public void func_77208_b(int par1) { ++ this.amountScrolled += (float)par1; + this.bindAmountScrolled(); + this.initialClickY = -2.0F; + } + +- public void actionPerformed(GuiButton var1) { +- if(var1.enabled) { +- if(var1.id == this.scrollUpButtonID) { ++ public void actionPerformed(GuiButton par1GuiButton) { ++ if (par1GuiButton.enabled) { ++ if (par1GuiButton.id == this.scrollUpButtonID) { + this.amountScrolled -= (float)(this.slotHeight * 2 / 3); + this.initialClickY = -2.0F; + this.bindAmountScrolled(); +- } else if(var1.id == this.scrollDownButtonID) { ++ } else if (par1GuiButton.id == this.scrollDownButtonID) { + this.amountScrolled += (float)(this.slotHeight * 2 / 3); + this.initialClickY = -2.0F; + this.bindAmountScrolled(); + } +- + } + } + +- public void drawScreen(int var1, int var2, float var3) { +- this.mouseX = var1; +- this.mouseY = var2; ++ /** ++ * draws the slot to the screen, pass in mouse's current x and y and partial ticks ++ */ ++ public void drawScreen(int par1, int par2, float par3) { ++ this.mouseX = par1; ++ this.mouseY = par2; + this.drawBackground(); + int var4 = this.getSize(); + int var5 = this.getScrollBarX(); +@@ -146,76 +200,79 @@ + int var10; + int var11; + int var13; +- int var20; +- if(Mouse.isButtonDown(0)) { +- if(this.initialClickY == -1.0F) { +- boolean var16 = true; +- if(var2 >= this.top && var2 <= this.bottom) { ++ int var19; ++ ++ if (Mouse.isButtonDown(0)) { ++ if (this.initialClickY == -1.0F) { ++ boolean var7 = true; ++ ++ if (par2 >= this.top && par2 <= this.bottom) { + int var8 = this.width / 2 - 110; + var9 = this.width / 2 + 110; +- var10 = var2 - this.top - this.field_77242_t + (int)this.amountScrolled - 4; ++ var10 = par2 - this.top - this.field_77242_t + (int)this.amountScrolled - 4; + var11 = var10 / this.slotHeight; +- if(var1 >= var8 && var1 <= var9 && var11 >= 0 && var10 >= 0 && var11 < var4) { ++ ++ if (par1 >= var8 && par1 <= var9 && var11 >= 0 && var10 >= 0 && var11 < var4) { + boolean var12 = var11 == this.selectedElement && Minecraft.getSystemTime() - this.lastClicked < 250L; + this.elementClicked(var11, var12); + this.selectedElement = var11; + this.lastClicked = Minecraft.getSystemTime(); +- } else if(var1 >= var8 && var1 <= var9 && var10 < 0) { +- this.func_77224_a(var1 - var8, var2 - this.top + (int)this.amountScrolled - 4); +- var16 = false; ++ } else if (par1 >= var8 && par1 <= var9 && var10 < 0) { ++ this.func_77224_a(par1 - var8, par2 - this.top + (int)this.amountScrolled - 4); ++ var7 = false; + } + +- if(var1 >= var5 && var1 <= var6) { ++ if (par1 >= var5 && par1 <= var6) { + this.scrollMultiplier = -1.0F; +- var20 = this.func_77209_d(); +- if(var20 < 1) { +- var20 = 1; ++ var19 = this.func_77209_d(); ++ ++ if (var19 < 1) { ++ var19 = 1; + } + + var13 = (int)((float)((this.bottom - this.top) * (this.bottom - this.top)) / (float)this.getContentHeight()); +- if(var13 < 32) { ++ ++ if (var13 < 32) { + var13 = 32; + } + +- if(var13 > this.bottom - this.top - 8) { ++ if (var13 > this.bottom - this.top - 8) { + var13 = this.bottom - this.top - 8; + } + +- this.scrollMultiplier /= (float)(this.bottom - this.top - var13) / (float)var20; ++ this.scrollMultiplier /= (float)(this.bottom - this.top - var13) / (float)var19; + } else { + this.scrollMultiplier = 1.0F; + } + +- if(var16) { +- this.initialClickY = (float)var2; ++ if (var7) { ++ this.initialClickY = (float)par2; + } else { + this.initialClickY = -2.0F; + } + } else { + this.initialClickY = -2.0F; + } +- } else if(this.initialClickY >= 0.0F) { +- this.amountScrolled -= ((float)var2 - this.initialClickY) * this.scrollMultiplier; +- this.initialClickY = (float)var2; ++ } else if (this.initialClickY >= 0.0F) { ++ this.amountScrolled -= ((float)par2 - this.initialClickY) * this.scrollMultiplier; ++ this.initialClickY = (float)par2; + } + } else { +- while(true) { +- if(this.mc.gameSettings.touchscreen || !Mouse.next()) { +- this.initialClickY = -1.0F; +- break; +- } ++ while (!this.mc.gameSettings.touchscreen && Mouse.next()) { ++ int var16 = Mouse.getEventDWheel(); + +- int var7 = Mouse.getEventDWheel(); +- if(var7 != 0) { +- if(var7 > 0) { +- var7 = -1; +- } else if(var7 < 0) { +- var7 = 1; ++ if (var16 != 0) { ++ if (var16 > 0) { ++ var16 = -1; ++ } else if (var16 < 0) { ++ var16 = 1; + } + +- this.amountScrolled += (float)(var7 * this.slotHeight / 2); ++ this.amountScrolled += (float)(var16 * this.slotHeight / 2); + } + } ++ ++ this.initialClickY = -1.0F; + } + + this.bindAmountScrolled(); +@@ -234,41 +291,44 @@ + var18.draw(); + var9 = this.width / 2 - 92 - 16; + var10 = this.top + 4 - (int)this.amountScrolled; +- if(this.field_77243_s) { ++ ++ if (this.field_77243_s) { + this.func_77222_a(var9, var10, var18); + } + + int var14; +- for(var11 = 0; var11 < var4; ++var11) { +- var20 = var10 + var11 * this.slotHeight + this.field_77242_t; ++ ++ for (var11 = 0; var11 < var4; ++var11) { ++ var19 = var10 + var11 * this.slotHeight + this.field_77242_t; + var13 = this.slotHeight - 4; +- if(var20 <= this.bottom && var20 + var13 >= this.top) { +- if(this.showSelectionBox && this.isSelected(var11)) { ++ ++ if (var19 <= this.bottom && var19 + var13 >= this.top) { ++ if (this.showSelectionBox && this.isSelected(var11)) { + var14 = this.width / 2 - 110; + int var15 = this.width / 2 + 110; + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + GL11.glDisable(GL11.GL_TEXTURE_2D); + var18.startDrawingQuads(); + var18.setColorOpaque_I(8421504); +- var18.addVertexWithUV((double)var14, (double)(var20 + var13 + 2), 0.0D, 0.0D, 1.0D); +- var18.addVertexWithUV((double)var15, (double)(var20 + var13 + 2), 0.0D, 1.0D, 1.0D); +- var18.addVertexWithUV((double)var15, (double)(var20 - 2), 0.0D, 1.0D, 0.0D); +- var18.addVertexWithUV((double)var14, (double)(var20 - 2), 0.0D, 0.0D, 0.0D); ++ var18.addVertexWithUV((double)var14, (double)(var19 + var13 + 2), 0.0D, 0.0D, 1.0D); ++ var18.addVertexWithUV((double)var15, (double)(var19 + var13 + 2), 0.0D, 1.0D, 1.0D); ++ var18.addVertexWithUV((double)var15, (double)(var19 - 2), 0.0D, 1.0D, 0.0D); ++ var18.addVertexWithUV((double)var14, (double)(var19 - 2), 0.0D, 0.0D, 0.0D); + var18.setColorOpaque_I(0); +- var18.addVertexWithUV((double)(var14 + 1), (double)(var20 + var13 + 1), 0.0D, 0.0D, 1.0D); +- var18.addVertexWithUV((double)(var15 - 1), (double)(var20 + var13 + 1), 0.0D, 1.0D, 1.0D); +- var18.addVertexWithUV((double)(var15 - 1), (double)(var20 - 1), 0.0D, 1.0D, 0.0D); +- var18.addVertexWithUV((double)(var14 + 1), (double)(var20 - 1), 0.0D, 0.0D, 0.0D); ++ var18.addVertexWithUV((double)(var14 + 1), (double)(var19 + var13 + 1), 0.0D, 0.0D, 1.0D); ++ var18.addVertexWithUV((double)(var15 - 1), (double)(var19 + var13 + 1), 0.0D, 1.0D, 1.0D); ++ var18.addVertexWithUV((double)(var15 - 1), (double)(var19 - 1), 0.0D, 1.0D, 0.0D); ++ var18.addVertexWithUV((double)(var14 + 1), (double)(var19 - 1), 0.0D, 0.0D, 0.0D); + var18.draw(); + GL11.glEnable(GL11.GL_TEXTURE_2D); + } + +- this.drawSlot(var11, var9, var20, var13, var18); ++ this.drawSlot(var11, var9, var19, var13, var18); + } + } + + GL11.glDisable(GL11.GL_DEPTH_TEST); +- byte var19 = 4; ++ byte var20 = 4; + this.overlayBackground(0, this.top, 255, 255); + this.overlayBackground(this.bottom, this.height, 255, 255); + GL11.glEnable(GL11.GL_BLEND); +@@ -278,8 +338,8 @@ + GL11.glDisable(GL11.GL_TEXTURE_2D); + var18.startDrawingQuads(); + var18.setColorRGBA_I(0, 0); +- var18.addVertexWithUV((double)this.left, (double)(this.top + var19), 0.0D, 0.0D, 1.0D); +- var18.addVertexWithUV((double)this.right, (double)(this.top + var19), 0.0D, 1.0D, 1.0D); ++ var18.addVertexWithUV((double)this.left, (double)(this.top + var20), 0.0D, 0.0D, 1.0D); ++ var18.addVertexWithUV((double)this.right, (double)(this.top + var20), 0.0D, 1.0D, 1.0D); + var18.setColorRGBA_I(0, 255); + var18.addVertexWithUV((double)this.right, (double)this.top, 0.0D, 1.0D, 0.0D); + var18.addVertexWithUV((double)this.left, (double)this.top, 0.0D, 0.0D, 0.0D); +@@ -289,22 +349,25 @@ + var18.addVertexWithUV((double)this.left, (double)this.bottom, 0.0D, 0.0D, 1.0D); + var18.addVertexWithUV((double)this.right, (double)this.bottom, 0.0D, 1.0D, 1.0D); + var18.setColorRGBA_I(0, 0); +- var18.addVertexWithUV((double)this.right, (double)(this.bottom - var19), 0.0D, 1.0D, 0.0D); +- var18.addVertexWithUV((double)this.left, (double)(this.bottom - var19), 0.0D, 0.0D, 0.0D); ++ var18.addVertexWithUV((double)this.right, (double)(this.bottom - var20), 0.0D, 1.0D, 0.0D); ++ var18.addVertexWithUV((double)this.left, (double)(this.bottom - var20), 0.0D, 0.0D, 0.0D); + var18.draw(); +- var20 = this.func_77209_d(); +- if(var20 > 0) { ++ var19 = this.func_77209_d(); ++ ++ if (var19 > 0) { + var13 = (this.bottom - this.top) * (this.bottom - this.top) / this.getContentHeight(); +- if(var13 < 32) { ++ ++ if (var13 < 32) { + var13 = 32; + } + +- if(var13 > this.bottom - this.top - 8) { ++ if (var13 > this.bottom - this.top - 8) { + var13 = this.bottom - this.top - 8; + } + +- var14 = (int)this.amountScrolled * (this.bottom - this.top - var13) / var20 + this.top; +- if(var14 < this.top) { ++ var14 = (int)this.amountScrolled * (this.bottom - this.top - var13) / var19 + this.top; ++ ++ if (var14 < this.top) { + var14 = this.top; + } + +@@ -331,7 +394,7 @@ + var18.draw(); + } + +- this.func_77215_b(var1, var2); ++ this.func_77215_b(par1, par2); + GL11.glEnable(GL11.GL_TEXTURE_2D); + GL11.glShadeModel(GL11.GL_FLAT); + GL11.glEnable(GL11.GL_ALPHA_TEST); +@@ -342,18 +405,30 @@ + return this.width / 2 + 124; + } + +- private void overlayBackground(int var1, int var2, int var3, int var4) { ++ /** ++ * Overlays the background to hide scrolled items ++ */ ++ private void overlayBackground(int par1, int par2, int par3, int par4) { ++ // Spout Start ++ GL11.glPushMatrix(); ++ // Spout End + Tessellator var5 = Tessellator.instance; + this.mc.getTextureManager().bindTexture(Gui.optionsBackground); + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); ++ // Spout Start ++ GL11.glTranslatef(0, 0, -0.1f); ++ // Spout End + float var6 = 32.0F; + var5.startDrawingQuads(); +- var5.setColorRGBA_I(4210752, var4); +- var5.addVertexWithUV(0.0D, (double)var2, 0.0D, 0.0D, (double)((float)var2 / var6)); +- var5.addVertexWithUV((double)this.width, (double)var2, 0.0D, (double)((float)this.width / var6), (double)((float)var2 / var6)); +- var5.setColorRGBA_I(4210752, var3); +- var5.addVertexWithUV((double)this.width, (double)var1, 0.0D, (double)((float)this.width / var6), (double)((float)var1 / var6)); +- var5.addVertexWithUV(0.0D, (double)var1, 0.0D, 0.0D, (double)((float)var1 / var6)); ++ var5.setColorRGBA_I(4210752, par4); ++ var5.addVertexWithUV(0.0D, (double)par2, 0.0D, 0.0D, (double)((float)par2 / var6)); ++ var5.addVertexWithUV((double)this.width, (double)par2, 0.0D, (double)((float)this.width / var6), (double)((float)par2 / var6)); ++ var5.setColorRGBA_I(4210752, par3); ++ var5.addVertexWithUV((double)this.width, (double)par1, 0.0D, (double)((float)this.width / var6), (double)((float)par1 / var6)); ++ var5.addVertexWithUV(0.0D, (double)par1, 0.0D, 0.0D, (double)((float)par1 / var6)); + var5.draw(); ++ // Spout Start ++ GL11.glPopMatrix(); ++ // Spout End + } + } diff --git a/patches/net/minecraft/src/GuiSlotLanguage.java.patch b/patches/net/minecraft/src/GuiSlotLanguage.java.patch new file mode 100644 index 0000000..41973c4 --- /dev/null +++ b/patches/net/minecraft/src/GuiSlotLanguage.java.patch @@ -0,0 +1,90 @@ +--- net/minecraft/src/GuiSlotLanguage.java ++++ net/minecraft/src/GuiSlotLanguage.java +@@ -7,44 +7,56 @@ + import java.util.Map; + + class GuiSlotLanguage extends GuiSlot { +- private final List b; +- private final Map h; ++ private final List field_77251_g; ++ private final Map field_77253_h; ++ + final GuiLanguage languageGui; + +- public GuiSlotLanguage(GuiLanguage var1) { +- super(var1.mc, var1.width, var1.height, 32, var1.height - 65 + 4, 18); +- this.languageGui = var1; +- this.b = Lists.newArrayList(); +- this.h = Maps.newHashMap(); +- Iterator var2 = GuiLanguage.func_135011_a(var1).getLanguages().iterator(); ++ public GuiSlotLanguage(GuiLanguage par1GuiLanguage) { ++ super(par1GuiLanguage.mc, par1GuiLanguage.width, par1GuiLanguage.height, 32, par1GuiLanguage.height - 65 + 4, 18); ++ this.languageGui = par1GuiLanguage; ++ this.field_77251_g = Lists.newArrayList(); ++ this.field_77253_h = Maps.newHashMap(); ++ Iterator var2 = GuiLanguage.func_135011_a(par1GuiLanguage).getLanguages().iterator(); + +- while(var2.hasNext()) { ++ while (var2.hasNext()) { + Language var3 = (Language)var2.next(); +- this.h.put(var3.getLanguageCode(), var3); +- this.b.add(var3.getLanguageCode()); ++ this.field_77253_h.put(var3.getLanguageCode(), var3); ++ this.field_77251_g.add(var3.getLanguageCode()); + } +- + } + ++ /** ++ * Gets the size of the current slot list. ++ */ + protected int getSize() { +- return this.b.size(); ++ return this.field_77251_g.size(); + } + +- protected void elementClicked(int var1, boolean var2) { +- Language var3 = (Language)this.h.get(this.b.get(var1)); ++ /** ++ * the element in the slot that was clicked, boolean for wether it was double clicked or not ++ */ ++ protected void elementClicked(int par1, boolean par2) { ++ Language var3 = (Language)this.field_77253_h.get(this.field_77251_g.get(par1)); + GuiLanguage.func_135011_a(this.languageGui).setCurrentLanguage(var3); +- GuiLanguage.getGameSettings(this.languageGui).an = var3.getLanguageCode(); ++ GuiLanguage.getGameSettings(this.languageGui).language = var3.getLanguageCode(); + this.languageGui.mc.refreshResources(); + this.languageGui.fontRenderer.setUnicodeFlag(GuiLanguage.func_135011_a(this.languageGui).isCurrentLocaleUnicode()); + this.languageGui.fontRenderer.setBidiFlag(GuiLanguage.func_135011_a(this.languageGui).isCurrentLanguageBidirectional()); +- GuiLanguage.getDoneButton(this.languageGui).f = I18n.getString("gui.done"); ++ GuiLanguage.getDoneButton(this.languageGui).displayString = I18n.getString("gui.done"); + GuiLanguage.getGameSettings(this.languageGui).saveOptions(); + } + +- protected boolean isSelected(int var1) { +- return ((String)this.b.get(var1)).equals(GuiLanguage.func_135011_a(this.languageGui).getCurrentLanguage().getLanguageCode()); ++ /** ++ * returns true if the element passed in is currently selected ++ */ ++ protected boolean isSelected(int par1) { ++ return ((String)this.field_77251_g.get(par1)).equals(GuiLanguage.func_135011_a(this.languageGui).getCurrentLanguage().getLanguageCode()); + } + ++ /** ++ * return the height of the content being scrolled ++ */ + protected int getContentHeight() { + return this.getSize() * 18; + } +@@ -53,9 +65,9 @@ + this.languageGui.drawDefaultBackground(); + } + +- protected void drawSlot(int var1, int var2, int var3, int var4, Tessellator var5) { ++ protected void drawSlot(int par1, int par2, int par3, int par4, Tessellator par5Tessellator) { + this.languageGui.fontRenderer.setBidiFlag(true); +- this.languageGui.drawCenteredString(this.languageGui.fontRenderer, ((Language)this.h.get(this.b.get(var1))).toString(), this.languageGui.width / 2, var3 + 1, 16777215); ++ this.languageGui.drawCenteredString(this.languageGui.fontRenderer, ((Language)this.field_77253_h.get(this.field_77251_g.get(par1))).toString(), this.languageGui.width / 2, par3 + 1, 16777215); + this.languageGui.fontRenderer.setBidiFlag(GuiLanguage.func_135011_a(this.languageGui).getCurrentLanguage().isBidirectional()); + } + } diff --git a/patches/net/minecraft/src/GuiSlotOnlineServerList.java.patch b/patches/net/minecraft/src/GuiSlotOnlineServerList.java.patch new file mode 100644 index 0000000..a4570e9 --- /dev/null +++ b/patches/net/minecraft/src/GuiSlotOnlineServerList.java.patch @@ -0,0 +1,141 @@ +--- net/minecraft/src/GuiSlotOnlineServerList.java ++++ net/minecraft/src/GuiSlotOnlineServerList.java +@@ -5,40 +5,50 @@ + class GuiSlotOnlineServerList extends GuiScreenSelectLocation { + final GuiScreenOnlineServers field_96294_a; + +- public GuiSlotOnlineServerList(GuiScreenOnlineServers var1) { +- super(GuiScreenOnlineServers.func_140037_f(var1), var1.width, var1.height, 32, var1.height - 64, 36); +- this.field_96294_a = var1; ++ public GuiSlotOnlineServerList(GuiScreenOnlineServers par1GuiScreenOnlineServers) { ++ super(GuiScreenOnlineServers.func_140037_f(par1GuiScreenOnlineServers), par1GuiScreenOnlineServers.width, par1GuiScreenOnlineServers.height, 32, par1GuiScreenOnlineServers.height - 64, 36); ++ this.field_96294_a = par1GuiScreenOnlineServers; + } + ++ /** ++ * Gets the size of the current slot list. ++ */ + protected int getSize() { + return GuiScreenOnlineServers.func_140013_c(this.field_96294_a).size() + 1; + } + +- protected void elementClicked(int var1, boolean var2) { +- if(var1 < GuiScreenOnlineServers.func_140013_c(this.field_96294_a).size()) { +- McoServer var3 = (McoServer)GuiScreenOnlineServers.func_140013_c(this.field_96294_a).get(var1); ++ /** ++ * the element in the slot that was clicked, boolean for wether it was double clicked or not ++ */ ++ protected void elementClicked(int par1, boolean par2) { ++ if (par1 < GuiScreenOnlineServers.func_140013_c(this.field_96294_a).size()) { ++ McoServer var3 = (McoServer)GuiScreenOnlineServers.func_140013_c(this.field_96294_a).get(par1); + GuiScreenOnlineServers.func_140036_b(this.field_96294_a, var3.field_96408_a); +- if(!GuiScreenOnlineServers.func_140015_g(this.field_96294_a).getSession().getUsername().equals(var3.e)) { +- GuiScreenOnlineServers.func_140038_h(this.field_96294_a).f = I18n.getString("mco.selectServer.leave"); ++ ++ if (!GuiScreenOnlineServers.func_140015_g(this.field_96294_a).getSession().getUsername().equals(var3.field_96405_e)) { ++ GuiScreenOnlineServers.func_140038_h(this.field_96294_a).displayString = I18n.getString("mco.selectServer.leave"); + } else { +- GuiScreenOnlineServers.func_140038_h(this.field_96294_a).f = I18n.getString("mco.selectServer.configure"); ++ GuiScreenOnlineServers.func_140038_h(this.field_96294_a).displayString = I18n.getString("mco.selectServer.configure"); + } + +- GuiScreenOnlineServers.func_140033_i(this.field_96294_a).enabled = var3.d.equals("OPEN") && !var3.field_98166_h; +- if(var2 && GuiScreenOnlineServers.func_140033_i(this.field_96294_a).enabled) { ++ GuiScreenOnlineServers.func_140033_i(this.field_96294_a).enabled = var3.field_96404_d.equals("OPEN") && !var3.field_98166_h; ++ ++ if (par2 && GuiScreenOnlineServers.func_140033_i(this.field_96294_a).enabled) { + GuiScreenOnlineServers.func_140008_c(this.field_96294_a, GuiScreenOnlineServers.func_140041_a(this.field_96294_a)); + } +- + } + } + +- protected boolean isSelected(int var1) { +- return var1 == GuiScreenOnlineServers.func_140027_d(this.field_96294_a, GuiScreenOnlineServers.func_140041_a(this.field_96294_a)); ++ /** ++ * returns true if the element passed in is currently selected ++ */ ++ protected boolean isSelected(int par1) { ++ return par1 == GuiScreenOnlineServers.func_140027_d(this.field_96294_a, GuiScreenOnlineServers.func_140041_a(this.field_96294_a)); + } + +- protected boolean func_104086_b(int var1) { ++ protected boolean func_104086_b(int par1) { + try { +- return var1 >= 0 && var1 < GuiScreenOnlineServers.func_140013_c(this.field_96294_a).size() && ((McoServer)GuiScreenOnlineServers.func_140013_c(this.field_96294_a).get(var1)).e.toLowerCase().equals(GuiScreenOnlineServers.func_104032_j(this.field_96294_a).getSession().getUsername()); ++ return par1 >= 0 && par1 < GuiScreenOnlineServers.func_140013_c(this.field_96294_a).size() && ((McoServer)GuiScreenOnlineServers.func_140013_c(this.field_96294_a).get(par1)).field_96405_e.toLowerCase().equals(GuiScreenOnlineServers.func_104032_j(this.field_96294_a).getSession().getUsername()); + } catch (Exception var3) { + return false; + } +@@ -52,45 +62,44 @@ + this.field_96294_a.drawDefaultBackground(); + } + +- protected void drawSlot(int var1, int var2, int var3, int var4, Tessellator var5) { +- if(var1 < GuiScreenOnlineServers.func_140013_c(this.field_96294_a).size()) { +- this.func_96292_b(var1, var2, var3, var4, var5); ++ protected void drawSlot(int par1, int par2, int par3, int par4, Tessellator par5Tessellator) { ++ if (par1 < GuiScreenOnlineServers.func_140013_c(this.field_96294_a).size()) { ++ this.func_96292_b(par1, par2, par3, par4, par5Tessellator); + } +- + } + +- private void func_96292_b(int var1, int var2, int var3, int var4, Tessellator var5) { +- McoServer var6 = (McoServer)GuiScreenOnlineServers.func_140013_c(this.field_96294_a).get(var1); +- this.field_96294_a.drawString(GuiScreenOnlineServers.func_140023_k(this.field_96294_a), var6.func_96398_b(), var2 + 2, var3 + 1, 16777215); ++ private void func_96292_b(int par1, int par2, int par3, int par4, Tessellator par5Tessellator) { ++ McoServer var6 = (McoServer)GuiScreenOnlineServers.func_140013_c(this.field_96294_a).get(par1); ++ this.field_96294_a.drawString(GuiScreenOnlineServers.func_140023_k(this.field_96294_a), var6.func_96398_b(), par2 + 2, par3 + 1, 16777215); + short var7 = 207; + byte var8 = 1; +- if(var6.field_98166_h) { +- GuiScreenOnlineServers.func_104031_c(this.field_96294_a, var2 + var7, var3 + var8, this.field_104094_d, this.field_104095_e); +- } else if(var6.d.equals("CLOSED")) { +- GuiScreenOnlineServers.func_140035_b(this.field_96294_a, var2 + var7, var3 + var8, this.field_104094_d, this.field_104095_e); +- } else if(var6.e.equals(GuiScreenOnlineServers.func_140014_l(this.field_96294_a).getSession().getUsername()) && var6.field_104063_i < 7) { +- this.func_96293_a(var1, var2 - 14, var3, var6); +- GuiScreenOnlineServers.func_140031_a(this.field_96294_a, var2 + var7, var3 + var8, this.field_104094_d, this.field_104095_e, var6.field_104063_i); +- } else if(var6.d.equals("OPEN")) { +- GuiScreenOnlineServers.func_140020_c(this.field_96294_a, var2 + var7, var3 + var8, this.field_104094_d, this.field_104095_e); +- this.func_96293_a(var1, var2 - 14, var3, var6); ++ ++ if (var6.field_98166_h) { ++ GuiScreenOnlineServers.func_104031_c(this.field_96294_a, par2 + var7, par3 + var8, this.field_104094_d, this.field_104095_e); ++ } else if (var6.field_96404_d.equals("CLOSED")) { ++ GuiScreenOnlineServers.func_140035_b(this.field_96294_a, par2 + var7, par3 + var8, this.field_104094_d, this.field_104095_e); ++ } else if (var6.field_96405_e.equals(GuiScreenOnlineServers.func_140014_l(this.field_96294_a).getSession().getUsername()) && var6.field_104063_i < 7) { ++ this.func_96293_a(par1, par2 - 14, par3, var6); ++ GuiScreenOnlineServers.func_140031_a(this.field_96294_a, par2 + var7, par3 + var8, this.field_104094_d, this.field_104095_e, var6.field_104063_i); ++ } else if (var6.field_96404_d.equals("OPEN")) { ++ GuiScreenOnlineServers.func_140020_c(this.field_96294_a, par2 + var7, par3 + var8, this.field_104094_d, this.field_104095_e); ++ this.func_96293_a(par1, par2 - 14, par3, var6); + } + +- this.field_96294_a.drawString(GuiScreenOnlineServers.func_140039_m(this.field_96294_a), var6.func_96397_a(), var2 + 2, var3 + 12, 7105644); +- this.field_96294_a.drawString(GuiScreenOnlineServers.func_98079_k(this.field_96294_a), var6.e, var2 + 2, var3 + 12 + 11, 5000268); ++ this.field_96294_a.drawString(GuiScreenOnlineServers.func_140039_m(this.field_96294_a), var6.func_96397_a(), par2 + 2, par3 + 12, 7105644); ++ this.field_96294_a.drawString(GuiScreenOnlineServers.func_98079_k(this.field_96294_a), var6.field_96405_e, par2 + 2, par3 + 12 + 11, 5000268); + } + +- private void func_96293_a(int var1, int var2, int var3, McoServer var4) { +- if(var4.g != null) { +- Object var5 = GuiScreenOnlineServers.func_140029_i(); +- synchronized(var5) { +- if(GuiScreenOnlineServers.func_140018_j() < 5 && (!var4.field_96411_l || var4.field_102022_m)) { +- (new ThreadConnectToOnlineServer(this, var4)).start(); ++ private void func_96293_a(int par1, int par2, int par3, McoServer par4McoServer) { ++ if (par4McoServer.field_96403_g != null) { ++ synchronized (GuiScreenOnlineServers.func_140029_i()) { ++ if (GuiScreenOnlineServers.func_140018_j() < 5 && (!par4McoServer.field_96411_l || par4McoServer.field_102022_m)) { ++ (new ThreadConnectToOnlineServer(this, par4McoServer)).start(); + } + } + +- if(var4.m != null) { +- this.field_96294_a.drawString(GuiScreenOnlineServers.func_110402_q(this.field_96294_a), var4.m, var2 + 215 - GuiScreenOnlineServers.func_140010_p(this.field_96294_a).getStringWidth(var4.m), var3 + 1, 8421504); ++ if (par4McoServer.field_96414_k != null) { ++ this.field_96294_a.drawString(GuiScreenOnlineServers.func_110402_q(this.field_96294_a), par4McoServer.field_96414_k, par2 + 215 - GuiScreenOnlineServers.func_140010_p(this.field_96294_a).getStringWidth(par4McoServer.field_96414_k), par3 + 1, 8421504); + } + + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); diff --git a/patches/net/minecraft/src/GuiSlotServer.java.patch b/patches/net/minecraft/src/GuiSlotServer.java.patch new file mode 100644 index 0000000..1ac1fd7 --- /dev/null +++ b/patches/net/minecraft/src/GuiSlotServer.java.patch @@ -0,0 +1,279 @@ +--- net/minecraft/src/GuiSlotServer.java ++++ net/minecraft/src/GuiSlotServer.java +@@ -3,40 +3,54 @@ + import org.lwjgl.opengl.GL11; + + class GuiSlotServer extends GuiSlot { ++ ++ /** Instance to the GUI this list is on. */ + final GuiMultiplayer parentGui; + +- public GuiSlotServer(GuiMultiplayer var1) { +- super(var1.mc, var1.width, var1.height, 32, var1.height - 64, 36); +- this.parentGui = var1; ++ public GuiSlotServer(GuiMultiplayer par1GuiMultiplayer) { ++ super(par1GuiMultiplayer.mc, par1GuiMultiplayer.width, par1GuiMultiplayer.height, 32, par1GuiMultiplayer.height - 64, 36); ++ this.parentGui = par1GuiMultiplayer; + } + ++ /** ++ * Gets the size of the current slot list. ++ */ + protected int getSize() { + return GuiMultiplayer.getInternetServerList(this.parentGui).countServers() + GuiMultiplayer.getListOfLanServers(this.parentGui).size() + 1; + } + +- protected void elementClicked(int var1, boolean var2) { +- if(var1 < GuiMultiplayer.getInternetServerList(this.parentGui).countServers() + GuiMultiplayer.getListOfLanServers(this.parentGui).size()) { ++ /** ++ * the element in the slot that was clicked, boolean for wether it was double clicked or not ++ */ ++ protected void elementClicked(int par1, boolean par2) { ++ if (par1 < GuiMultiplayer.getInternetServerList(this.parentGui).countServers() + GuiMultiplayer.getListOfLanServers(this.parentGui).size()) { + int var3 = GuiMultiplayer.getSelectedServer(this.parentGui); +- GuiMultiplayer.getAndSetSelectedServer(this.parentGui, var1); +- ServerData var4 = GuiMultiplayer.getInternetServerList(this.parentGui).countServers() > var1 ? GuiMultiplayer.getInternetServerList(this.parentGui).getServerData(var1) : null; ++ GuiMultiplayer.getAndSetSelectedServer(this.parentGui, par1); ++ ServerData var4 = GuiMultiplayer.getInternetServerList(this.parentGui).countServers() > par1 ? GuiMultiplayer.getInternetServerList(this.parentGui).getServerData(par1) : null; + boolean var5 = GuiMultiplayer.getSelectedServer(this.parentGui) >= 0 && GuiMultiplayer.getSelectedServer(this.parentGui) < this.getSize() && (var4 == null || var4.field_82821_f == 78); + boolean var6 = GuiMultiplayer.getSelectedServer(this.parentGui) < GuiMultiplayer.getInternetServerList(this.parentGui).countServers(); + GuiMultiplayer.getButtonSelect(this.parentGui).enabled = var5; + GuiMultiplayer.getButtonEdit(this.parentGui).enabled = var6; + GuiMultiplayer.getButtonDelete(this.parentGui).enabled = var6; +- if(var2 && var5) { +- GuiMultiplayer.func_74008_b(this.parentGui, var1); +- } else if(var6 && GuiScreen.isShiftKeyDown() && var3 >= 0 && var3 < GuiMultiplayer.getInternetServerList(this.parentGui).countServers()) { ++ ++ if (par2 && var5) { ++ GuiMultiplayer.func_74008_b(this.parentGui, par1); ++ } else if (var6 && GuiScreen.isShiftKeyDown() && var3 >= 0 && var3 < GuiMultiplayer.getInternetServerList(this.parentGui).countServers()) { + GuiMultiplayer.getInternetServerList(this.parentGui).swapServers(var3, GuiMultiplayer.getSelectedServer(this.parentGui)); + } +- + } + } + +- protected boolean isSelected(int var1) { +- return var1 == GuiMultiplayer.getSelectedServer(this.parentGui); ++ /** ++ * returns true if the element passed in is currently selected ++ */ ++ protected boolean isSelected(int par1) { ++ return par1 == GuiMultiplayer.getSelectedServer(this.parentGui); + } + ++ /** ++ * return the height of the content being scrolled ++ */ + protected int getContentHeight() { + return this.getSize() * 36; + } +@@ -45,123 +59,128 @@ + this.parentGui.drawDefaultBackground(); + } + +- protected void drawSlot(int var1, int var2, int var3, int var4, Tessellator var5) { +- if(var1 < GuiMultiplayer.getInternetServerList(this.parentGui).countServers()) { +- this.func_77247_d(var1, var2, var3, var4, var5); +- } else if(var1 < GuiMultiplayer.getInternetServerList(this.parentGui).countServers() + GuiMultiplayer.getListOfLanServers(this.parentGui).size()) { +- this.func_77248_b(var1, var2, var3, var4, var5); +- } else { +- this.func_77249_c(var1, var2, var3, var4, var5); +- } +- +- } +- +- private void func_77248_b(int var1, int var2, int var3, int var4, Tessellator var5) { +- LanServer var6 = (LanServer)GuiMultiplayer.getListOfLanServers(this.parentGui).get(var1 - GuiMultiplayer.getInternetServerList(this.parentGui).countServers()); +- this.parentGui.drawString(this.parentGui.fontRenderer, I18n.getString("lanServer.title"), var2 + 2, var3 + 1, 16777215); +- this.parentGui.drawString(this.parentGui.fontRenderer, var6.getServerMotd(), var2 + 2, var3 + 12, 8421504); +- if(this.parentGui.mc.gameSettings.hideServerAddress) { +- this.parentGui.drawString(this.parentGui.fontRenderer, I18n.getString("selectServer.hiddenAddress"), var2 + 2, var3 + 12 + 11, 3158064); +- } else { +- this.parentGui.drawString(this.parentGui.fontRenderer, var6.getServerIpPort(), var2 + 2, var3 + 12 + 11, 3158064); +- } +- +- } +- +- private void func_77249_c(int var1, int var2, int var3, int var4, Tessellator var5) { +- this.parentGui.drawCenteredString(this.parentGui.fontRenderer, I18n.getString("lanServer.scanning"), this.parentGui.width / 2, var3 + 1, 16777215); ++ protected void drawSlot(int par1, int par2, int par3, int par4, Tessellator par5Tessellator) { ++ if (par1 < GuiMultiplayer.getInternetServerList(this.parentGui).countServers()) { ++ this.func_77247_d(par1, par2, par3, par4, par5Tessellator); ++ } else if (par1 < GuiMultiplayer.getInternetServerList(this.parentGui).countServers() + GuiMultiplayer.getListOfLanServers(this.parentGui).size()) { ++ this.func_77248_b(par1, par2, par3, par4, par5Tessellator); ++ } else { ++ this.func_77249_c(par1, par2, par3, par4, par5Tessellator); ++ } ++ } ++ ++ private void func_77248_b(int par1, int par2, int par3, int par4, Tessellator par5Tessellator) { ++ LanServer var6 = (LanServer)GuiMultiplayer.getListOfLanServers(this.parentGui).get(par1 - GuiMultiplayer.getInternetServerList(this.parentGui).countServers()); ++ this.parentGui.drawString(this.parentGui.fontRenderer, I18n.getString("lanServer.title"), par2 + 2, par3 + 1, 16777215); ++ this.parentGui.drawString(this.parentGui.fontRenderer, var6.getServerMotd(), par2 + 2, par3 + 12, 8421504); ++ ++ if (this.parentGui.mc.gameSettings.hideServerAddress) { ++ this.parentGui.drawString(this.parentGui.fontRenderer, I18n.getString("selectServer.hiddenAddress"), par2 + 2, par3 + 12 + 11, 3158064); ++ } else { ++ this.parentGui.drawString(this.parentGui.fontRenderer, var6.getServerIpPort(), par2 + 2, par3 + 12 + 11, 3158064); ++ } ++ } ++ ++ private void func_77249_c(int par1, int par2, int par3, int par4, Tessellator par5Tessellator) { ++ this.parentGui.drawCenteredString(this.parentGui.fontRenderer, I18n.getString("lanServer.scanning"), this.parentGui.width / 2, par3 + 1, 16777215); + String var6; +- switch(GuiMultiplayer.getTicksOpened(this.parentGui) / 3 % 4) { +- case 0: +- default: +- var6 = "O o o"; +- break; +- case 1: +- case 3: +- var6 = "o O o"; +- break; +- case 2: +- var6 = "o o O"; ++ ++ switch (GuiMultiplayer.getTicksOpened(this.parentGui) / 3 % 4) { ++ case 0: ++ default: ++ var6 = "O o o"; ++ break; ++ ++ case 1: ++ case 3: ++ var6 = "o O o"; ++ break; ++ ++ case 2: ++ var6 = "o o O"; + } + +- this.parentGui.drawCenteredString(this.parentGui.fontRenderer, var6, this.parentGui.width / 2, var3 + 12, 8421504); ++ this.parentGui.drawCenteredString(this.parentGui.fontRenderer, var6, this.parentGui.width / 2, par3 + 12, 8421504); + } + +- private void func_77247_d(int var1, int var2, int var3, int var4, Tessellator var5) { +- ServerData var6 = GuiMultiplayer.getInternetServerList(this.parentGui).getServerData(var1); +- Object var7 = GuiMultiplayer.getLock(); +- synchronized(var7) { +- if(GuiMultiplayer.getThreadsPending() < 5 && !var6.field_78841_f) { ++ private void func_77247_d(int par1, int par2, int par3, int par4, Tessellator par5Tessellator) { ++ ServerData var6 = GuiMultiplayer.getInternetServerList(this.parentGui).getServerData(par1); ++ ++ synchronized (GuiMultiplayer.getLock()) { ++ if (GuiMultiplayer.getThreadsPending() < 5 && !var6.field_78841_f) { + var6.field_78841_f = true; + var6.pingToServer = -2L; +- var6.d = ""; +- var6.c = ""; ++ var6.serverMOTD = ""; ++ var6.populationInfo = ""; + GuiMultiplayer.increaseThreadsPending(); + (new ThreadPollServers(this, var6)).start(); + } + } + +- boolean var15 = var6.field_82821_f > 78; ++ boolean var7 = var6.field_82821_f > 78; + boolean var8 = var6.field_82821_f < 78; +- boolean var9 = var15 || var8; +- this.parentGui.drawString(this.parentGui.fontRenderer, var6.a, var2 + 2, var3 + 1, 16777215); +- this.parentGui.drawString(this.parentGui.fontRenderer, var6.d, var2 + 2, var3 + 12, 8421504); +- this.parentGui.drawString(this.parentGui.fontRenderer, var6.c, var2 + 215 - this.parentGui.fontRenderer.getStringWidth(var6.c), var3 + 12, 8421504); +- if(var9) { +- String var10 = EnumChatFormatting.DARK_RED + var6.g; +- this.parentGui.drawString(this.parentGui.fontRenderer, var10, var2 + 200 - this.parentGui.fontRenderer.getStringWidth(var10), var3 + 1, 8421504); ++ boolean var9 = var7 || var8; ++ this.parentGui.drawString(this.parentGui.fontRenderer, var6.serverName, par2 + 2, par3 + 1, 16777215); ++ this.parentGui.drawString(this.parentGui.fontRenderer, var6.serverMOTD, par2 + 2, par3 + 12, 8421504); ++ this.parentGui.drawString(this.parentGui.fontRenderer, var6.populationInfo, par2 + 215 - this.parentGui.fontRenderer.getStringWidth(var6.populationInfo), par3 + 12, 8421504); ++ ++ if (var9) { ++ String var10 = EnumChatFormatting.DARK_RED + var6.gameVersion; ++ this.parentGui.drawString(this.parentGui.fontRenderer, var10, par2 + 200 - this.parentGui.fontRenderer.getStringWidth(var10), par3 + 1, 8421504); + } + +- if(!this.parentGui.mc.gameSettings.hideServerAddress && !var6.isHidingAddress()) { +- this.parentGui.drawString(this.parentGui.fontRenderer, var6.b, var2 + 2, var3 + 12 + 11, 3158064); ++ if (!this.parentGui.mc.gameSettings.hideServerAddress && !var6.isHidingAddress()) { ++ this.parentGui.drawString(this.parentGui.fontRenderer, var6.serverIP, par2 + 2, par3 + 12 + 11, 3158064); + } else { +- this.parentGui.drawString(this.parentGui.fontRenderer, I18n.getString("selectServer.hiddenAddress"), var2 + 2, var3 + 12 + 11, 3158064); ++ this.parentGui.drawString(this.parentGui.fontRenderer, I18n.getString("selectServer.hiddenAddress"), par2 + 2, par3 + 12 + 11, 3158064); + } + + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + this.parentGui.mc.getTextureManager().bindTexture(Gui.icons); +- byte var16 = 0; ++ byte var15 = 0; + boolean var11 = false; + String var12 = ""; +- int var17; +- if(var9) { +- var12 = var15 ? "Client out of date!" : "Server out of date!"; +- var17 = 5; +- } else if(var6.field_78841_f && var6.pingToServer != -2L) { +- if(var6.pingToServer < 0L) { +- var17 = 5; +- } else if(var6.pingToServer < 150L) { +- var17 = 0; +- } else if(var6.pingToServer < 300L) { +- var17 = 1; +- } else if(var6.pingToServer < 600L) { +- var17 = 2; +- } else if(var6.pingToServer < 1000L) { +- var17 = 3; ++ int var16; ++ ++ if (var9) { ++ var12 = var7 ? "Client out of date!" : "Server out of date!"; ++ var16 = 5; ++ } else if (var6.field_78841_f && var6.pingToServer != -2L) { ++ if (var6.pingToServer < 0L) { ++ var16 = 5; ++ } else if (var6.pingToServer < 150L) { ++ var16 = 0; ++ } else if (var6.pingToServer < 300L) { ++ var16 = 1; ++ } else if (var6.pingToServer < 600L) { ++ var16 = 2; ++ } else if (var6.pingToServer < 1000L) { ++ var16 = 3; + } else { +- var17 = 4; ++ var16 = 4; + } + +- if(var6.pingToServer < 0L) { ++ if (var6.pingToServer < 0L) { + var12 = "(no connection)"; + } else { + var12 = var6.pingToServer + "ms"; + } + } else { +- var16 = 1; +- var17 = (int)(Minecraft.getSystemTime() / 100L + (long)(var1 * 2) & 7L); +- if(var17 > 4) { +- var17 = 8 - var17; ++ var15 = 1; ++ var16 = (int)(Minecraft.getSystemTime() / 100L + (long)(par1 * 2) & 7L); ++ ++ if (var16 > 4) { ++ var16 = 8 - var16; + } + + var12 = "Polling.."; + } + +- this.parentGui.drawTexturedModalRect(var2 + 205, var3, 0 + var16 * 10, 176 + var17 * 8, 10, 8); ++ this.parentGui.drawTexturedModalRect(par2 + 205, par3, 0 + var15 * 10, 176 + var16 * 8, 10, 8); + byte var13 = 4; +- if(this.mouseX >= var2 + 205 - var13 && this.mouseY >= var3 - var13 && this.mouseX <= var2 + 205 + 10 + var13 && this.mouseY <= var3 + 8 + var13) { ++ ++ if (this.mouseX >= par2 + 205 - var13 && this.mouseY >= par3 - var13 && this.mouseX <= par2 + 205 + 10 + var13 && this.mouseY <= par3 + 8 + var13) { + GuiMultiplayer.getAndSetLagTooltip(this.parentGui, var12); + } +- + } + } diff --git a/patches/net/minecraft/src/GuiSlotStats.java.patch b/patches/net/minecraft/src/GuiSlotStats.java.patch new file mode 100644 index 0000000..ca3aea3 --- /dev/null +++ b/patches/net/minecraft/src/GuiSlotStats.java.patch @@ -0,0 +1,272 @@ +--- net/minecraft/src/GuiSlotStats.java ++++ net/minecraft/src/GuiSlotStats.java +@@ -7,25 +7,31 @@ + + abstract class GuiSlotStats extends GuiSlot { + protected int field_77262_g; +- protected List h; +- protected Comparator i; ++ protected List field_77266_h; ++ protected Comparator field_77267_i; + protected int field_77264_j; + protected int field_77265_k; ++ + final GuiStats statsGui; + +- protected GuiSlotStats(GuiStats var1) { +- super(GuiStats.getMinecraft1(var1), var1.width, var1.height, 32, var1.height - 64, 20); +- this.statsGui = var1; ++ protected GuiSlotStats(GuiStats par1GuiStats) { ++ super(GuiStats.getMinecraft1(par1GuiStats), par1GuiStats.width, par1GuiStats.height, 32, par1GuiStats.height - 64, 20); ++ this.statsGui = par1GuiStats; + this.field_77262_g = -1; + this.field_77264_j = -1; + this.setShowSelectionBox(false); + this.func_77223_a(true, 20); + } + +- protected void elementClicked(int var1, boolean var2) { +- } ++ /** ++ * the element in the slot that was clicked, boolean for wether it was double clicked or not ++ */ ++ protected void elementClicked(int par1, boolean par2) {} + +- protected boolean isSelected(int var1) { ++ /** ++ * returns true if the element passed in is currently selected ++ */ ++ protected boolean isSelected(int par1) { + return false; + } + +@@ -33,150 +39,155 @@ + this.statsGui.drawDefaultBackground(); + } + +- protected void func_77222_a(int var1, int var2, Tessellator var3) { +- if(!Mouse.isButtonDown(0)) { ++ protected void func_77222_a(int par1, int par2, Tessellator par3Tessellator) { ++ if (!Mouse.isButtonDown(0)) { + this.field_77262_g = -1; + } + +- if(this.field_77262_g == 0) { +- GuiStats.drawSprite(this.statsGui, var1 + 115 - 18, var2 + 1, 0, 0); +- } else { +- GuiStats.drawSprite(this.statsGui, var1 + 115 - 18, var2 + 1, 0, 18); +- } +- +- if(this.field_77262_g == 1) { +- GuiStats.drawSprite(this.statsGui, var1 + 165 - 18, var2 + 1, 0, 0); +- } else { +- GuiStats.drawSprite(this.statsGui, var1 + 165 - 18, var2 + 1, 0, 18); +- } +- +- if(this.field_77262_g == 2) { +- GuiStats.drawSprite(this.statsGui, var1 + 215 - 18, var2 + 1, 0, 0); +- } else { +- GuiStats.drawSprite(this.statsGui, var1 + 215 - 18, var2 + 1, 0, 18); +- } +- +- if(this.field_77264_j != -1) { ++ if (this.field_77262_g == 0) { ++ GuiStats.drawSprite(this.statsGui, par1 + 115 - 18, par2 + 1, 0, 0); ++ } else { ++ GuiStats.drawSprite(this.statsGui, par1 + 115 - 18, par2 + 1, 0, 18); ++ } ++ ++ if (this.field_77262_g == 1) { ++ GuiStats.drawSprite(this.statsGui, par1 + 165 - 18, par2 + 1, 0, 0); ++ } else { ++ GuiStats.drawSprite(this.statsGui, par1 + 165 - 18, par2 + 1, 0, 18); ++ } ++ ++ if (this.field_77262_g == 2) { ++ GuiStats.drawSprite(this.statsGui, par1 + 215 - 18, par2 + 1, 0, 0); ++ } else { ++ GuiStats.drawSprite(this.statsGui, par1 + 215 - 18, par2 + 1, 0, 18); ++ } ++ ++ if (this.field_77264_j != -1) { + short var4 = 79; + byte var5 = 18; +- if(this.field_77264_j == 1) { ++ ++ if (this.field_77264_j == 1) { + var4 = 129; +- } else if(this.field_77264_j == 2) { ++ } else if (this.field_77264_j == 2) { + var4 = 179; + } + +- if(this.field_77265_k == 1) { ++ if (this.field_77265_k == 1) { + var5 = 36; + } + +- GuiStats.drawSprite(this.statsGui, var1 + var4, var2 + 1, var5, 0); ++ GuiStats.drawSprite(this.statsGui, par1 + var4, par2 + 1, var5, 0); + } +- + } + +- protected void func_77224_a(int var1, int var2) { ++ protected void func_77224_a(int par1, int par2) { + this.field_77262_g = -1; +- if(var1 >= 79 && var1 < 115) { ++ ++ if (par1 >= 79 && par1 < 115) { + this.field_77262_g = 0; +- } else if(var1 >= 129 && var1 < 165) { ++ } else if (par1 >= 129 && par1 < 165) { + this.field_77262_g = 1; +- } else if(var1 >= 179 && var1 < 215) { ++ } else if (par1 >= 179 && par1 < 215) { + this.field_77262_g = 2; + } + +- if(this.field_77262_g >= 0) { ++ if (this.field_77262_g >= 0) { + this.func_77261_e(this.field_77262_g); + GuiStats.getMinecraft2(this.statsGui).sndManager.playSoundFX("random.click", 1.0F, 1.0F); + } +- + } + ++ /** ++ * Gets the size of the current slot list. ++ */ + protected final int getSize() { +- return this.h.size(); ++ return this.field_77266_h.size(); + } + +- protected final StatCrafting func_77257_d(int var1) { +- return (StatCrafting)this.h.get(var1); ++ protected final StatCrafting func_77257_d(int par1) { ++ return (StatCrafting)this.field_77266_h.get(par1); + } + + protected abstract String func_77258_c(int var1); + +- protected void func_77260_a(StatCrafting var1, int var2, int var3, boolean var4) { ++ protected void func_77260_a(StatCrafting par1StatCrafting, int par2, int par3, boolean par4) { + String var5; +- if(var1 != null) { +- var5 = var1.func_75968_a(GuiStats.getStatsFileWriter(this.statsGui).writeStat(var1)); +- this.statsGui.drawString(GuiStats.getFontRenderer4(this.statsGui), var5, var2 - GuiStats.getFontRenderer5(this.statsGui).getStringWidth(var5), var3 + 5, var4 ? 16777215 : 9474192); ++ ++ if (par1StatCrafting != null) { ++ var5 = par1StatCrafting.func_75968_a(GuiStats.getStatsFileWriter(this.statsGui).writeStat(par1StatCrafting)); ++ this.statsGui.drawString(GuiStats.getFontRenderer4(this.statsGui), var5, par2 - GuiStats.getFontRenderer5(this.statsGui).getStringWidth(var5), par3 + 5, par4 ? 16777215 : 9474192); + } else { + var5 = "-"; +- this.statsGui.drawString(GuiStats.getFontRenderer6(this.statsGui), var5, var2 - GuiStats.getFontRenderer7(this.statsGui).getStringWidth(var5), var3 + 5, var4 ? 16777215 : 9474192); ++ this.statsGui.drawString(GuiStats.getFontRenderer6(this.statsGui), var5, par2 - GuiStats.getFontRenderer7(this.statsGui).getStringWidth(var5), par3 + 5, par4 ? 16777215 : 9474192); + } +- + } + +- protected void func_77215_b(int var1, int var2) { +- if(var2 >= this.top && var2 <= this.bottom) { +- int var3 = this.func_77210_c(var1, var2); ++ protected void func_77215_b(int par1, int par2) { ++ if (par2 >= this.top && par2 <= this.bottom) { ++ int var3 = this.func_77210_c(par1, par2); + int var4 = this.statsGui.width / 2 - 92 - 16; +- if(var3 >= 0) { +- if(var1 < var4 + 40 || var1 > var4 + 40 + 20) { ++ ++ if (var3 >= 0) { ++ if (par1 < var4 + 40 || par1 > var4 + 40 + 20) { + return; + } + +- StatCrafting var9 = this.func_77257_d(var3); +- this.func_77259_a(var9, var1, var2); ++ StatCrafting var5 = this.func_77257_d(var3); ++ this.func_77259_a(var5, par1, par2); + } else { +- String var5 = ""; +- if(var1 >= var4 + 115 - 18 && var1 <= var4 + 115) { +- var5 = this.func_77258_c(0); +- } else if(var1 >= var4 + 165 - 18 && var1 <= var4 + 165) { +- var5 = this.func_77258_c(1); ++ String var9 = ""; ++ ++ if (par1 >= var4 + 115 - 18 && par1 <= var4 + 115) { ++ var9 = this.func_77258_c(0); ++ } else if (par1 >= var4 + 165 - 18 && par1 <= var4 + 165) { ++ var9 = this.func_77258_c(1); + } else { +- if(var1 < var4 + 215 - 18 || var1 > var4 + 215) { ++ if (par1 < var4 + 215 - 18 || par1 > var4 + 215) { + return; + } + +- var5 = this.func_77258_c(2); ++ var9 = this.func_77258_c(2); + } + +- var5 = ("" + I18n.getString(var5)).trim(); +- if(var5.length() > 0) { +- int var6 = var1 + 12; +- int var7 = var2 - 12; +- int var8 = GuiStats.getFontRenderer8(this.statsGui).getStringWidth(var5); ++ var9 = ("" + I18n.getString(var9)).trim(); ++ ++ if (var9.length() > 0) { ++ int var6 = par1 + 12; ++ int var7 = par2 - 12; ++ int var8 = GuiStats.getFontRenderer8(this.statsGui).getStringWidth(var9); + GuiStats.drawGradientRect(this.statsGui, var6 - 3, var7 - 3, var6 + var8 + 3, var7 + 8 + 3, -1073741824, -1073741824); +- GuiStats.getFontRenderer9(this.statsGui).drawStringWithShadow(var5, var6, var7, -1); ++ GuiStats.getFontRenderer9(this.statsGui).drawStringWithShadow(var9, var6, var7, -1); + } + } +- + } + } + +- protected void func_77259_a(StatCrafting var1, int var2, int var3) { +- if(var1 != null) { +- Item var4 = Item.itemsList[var1.getItemID()]; ++ protected void func_77259_a(StatCrafting par1StatCrafting, int par2, int par3) { ++ if (par1StatCrafting != null) { ++ Item var4 = Item.itemsList[par1StatCrafting.getItemID()]; + String var5 = ("" + I18n.getString(var4.getUnlocalizedName() + ".name")).trim(); +- if(var5.length() > 0) { +- int var6 = var2 + 12; +- int var7 = var3 - 12; ++ ++ if (var5.length() > 0) { ++ int var6 = par2 + 12; ++ int var7 = par3 - 12; + int var8 = GuiStats.getFontRenderer10(this.statsGui).getStringWidth(var5); + GuiStats.drawGradientRect1(this.statsGui, var6 - 3, var7 - 3, var6 + var8 + 3, var7 + 8 + 3, -1073741824, -1073741824); + GuiStats.getFontRenderer11(this.statsGui).drawStringWithShadow(var5, var6, var7, -1); + } +- + } + } + +- protected void func_77261_e(int var1) { +- if(var1 != this.field_77264_j) { +- this.field_77264_j = var1; ++ protected void func_77261_e(int par1) { ++ if (par1 != this.field_77264_j) { ++ this.field_77264_j = par1; + this.field_77265_k = -1; +- } else if(this.field_77265_k == -1) { ++ } else if (this.field_77265_k == -1) { + this.field_77265_k = 1; + } else { + this.field_77264_j = -1; + this.field_77265_k = 0; + } + +- Collections.sort(this.h, this.i); ++ Collections.sort(this.field_77266_h, this.field_77267_i); + } + } diff --git a/patches/net/minecraft/src/GuiSlotStatsBlock.java.patch b/patches/net/minecraft/src/GuiSlotStatsBlock.java.patch new file mode 100644 index 0000000..8369769 --- /dev/null +++ b/patches/net/minecraft/src/GuiSlotStatsBlock.java.patch @@ -0,0 +1,124 @@ +--- net/minecraft/src/GuiSlotStatsBlock.java ++++ net/minecraft/src/GuiSlotStatsBlock.java +@@ -4,66 +4,69 @@ + import java.util.Iterator; + + class GuiSlotStatsBlock extends GuiSlotStats { ++ ++ /** Instance of GuiStats. */ + final GuiStats theStats; + +- public GuiSlotStatsBlock(GuiStats var1) { +- super(var1); +- this.theStats = var1; +- this.h = new ArrayList(); +- Iterator var2 = StatList.e.iterator(); ++ public GuiSlotStatsBlock(GuiStats par1GuiStats) { ++ super(par1GuiStats); ++ this.theStats = par1GuiStats; ++ this.field_77266_h = new ArrayList(); ++ Iterator var2 = StatList.objectMineStats.iterator(); + +- while(var2.hasNext()) { ++ while (var2.hasNext()) { + StatCrafting var3 = (StatCrafting)var2.next(); + boolean var4 = false; + int var5 = var3.getItemID(); +- if(GuiStats.getStatsFileWriter(var1).writeStat(var3) > 0) { +- var4 = true; +- } else if(StatList.objectUseStats[var5] != null && GuiStats.getStatsFileWriter(var1).writeStat(StatList.objectUseStats[var5]) > 0) { +- var4 = true; +- } else if(StatList.objectCraftStats[var5] != null && GuiStats.getStatsFileWriter(var1).writeStat(StatList.objectCraftStats[var5]) > 0) { +- var4 = true; +- } +- +- if(var4) { +- this.h.add(var3); +- } +- } +- +- this.i = new SorterStatsBlock(this, var1); +- } +- +- protected void func_77222_a(int var1, int var2, Tessellator var3) { +- super.func_77222_a(var1, var2, var3); +- if(this.field_77262_g == 0) { +- GuiStats.drawSprite(this.theStats, var1 + 115 - 18 + 1, var2 + 1 + 1, 18, 18); +- } else { +- GuiStats.drawSprite(this.theStats, var1 + 115 - 18, var2 + 1, 18, 18); +- } +- +- if(this.field_77262_g == 1) { +- GuiStats.drawSprite(this.theStats, var1 + 165 - 18 + 1, var2 + 1 + 1, 36, 18); +- } else { +- GuiStats.drawSprite(this.theStats, var1 + 165 - 18, var2 + 1, 36, 18); +- } +- +- if(this.field_77262_g == 2) { +- GuiStats.drawSprite(this.theStats, var1 + 215 - 18 + 1, var2 + 1 + 1, 54, 18); +- } else { +- GuiStats.drawSprite(this.theStats, var1 + 215 - 18, var2 + 1, 54, 18); +- } +- +- } +- +- protected void drawSlot(int var1, int var2, int var3, int var4, Tessellator var5) { +- StatCrafting var6 = this.func_77257_d(var1); ++ ++ if (GuiStats.getStatsFileWriter(par1GuiStats).writeStat(var3) > 0) { ++ var4 = true; ++ } else if (StatList.objectUseStats[var5] != null && GuiStats.getStatsFileWriter(par1GuiStats).writeStat(StatList.objectUseStats[var5]) > 0) { ++ var4 = true; ++ } else if (StatList.objectCraftStats[var5] != null && GuiStats.getStatsFileWriter(par1GuiStats).writeStat(StatList.objectCraftStats[var5]) > 0) { ++ var4 = true; ++ } ++ ++ if (var4) { ++ this.field_77266_h.add(var3); ++ } ++ } ++ ++ this.field_77267_i = new SorterStatsBlock(this, par1GuiStats); ++ } ++ ++ protected void func_77222_a(int par1, int par2, Tessellator par3Tessellator) { ++ super.func_77222_a(par1, par2, par3Tessellator); ++ ++ if (this.field_77262_g == 0) { ++ GuiStats.drawSprite(this.theStats, par1 + 115 - 18 + 1, par2 + 1 + 1, 18, 18); ++ } else { ++ GuiStats.drawSprite(this.theStats, par1 + 115 - 18, par2 + 1, 18, 18); ++ } ++ ++ if (this.field_77262_g == 1) { ++ GuiStats.drawSprite(this.theStats, par1 + 165 - 18 + 1, par2 + 1 + 1, 36, 18); ++ } else { ++ GuiStats.drawSprite(this.theStats, par1 + 165 - 18, par2 + 1, 36, 18); ++ } ++ ++ if (this.field_77262_g == 2) { ++ GuiStats.drawSprite(this.theStats, par1 + 215 - 18 + 1, par2 + 1 + 1, 54, 18); ++ } else { ++ GuiStats.drawSprite(this.theStats, par1 + 215 - 18, par2 + 1, 54, 18); ++ } ++ } ++ ++ protected void drawSlot(int par1, int par2, int par3, int par4, Tessellator par5Tessellator) { ++ StatCrafting var6 = this.func_77257_d(par1); + int var7 = var6.getItemID(); +- GuiStats.drawItemSprite(this.theStats, var2 + 40, var3, var7); +- this.func_77260_a((StatCrafting)StatList.objectCraftStats[var7], var2 + 115, var3, var1 % 2 == 0); +- this.func_77260_a((StatCrafting)StatList.objectUseStats[var7], var2 + 165, var3, var1 % 2 == 0); +- this.func_77260_a(var6, var2 + 215, var3, var1 % 2 == 0); ++ GuiStats.drawItemSprite(this.theStats, par2 + 40, par3, var7); ++ this.func_77260_a((StatCrafting)StatList.objectCraftStats[var7], par2 + 115, par3, par1 % 2 == 0); ++ this.func_77260_a((StatCrafting)StatList.objectUseStats[var7], par2 + 165, par3, par1 % 2 == 0); ++ this.func_77260_a(var6, par2 + 215, par3, par1 % 2 == 0); + } + +- protected String func_77258_c(int var1) { +- return var1 == 0 ? "stat.crafted" : (var1 == 1 ? "stat.used" : "stat.mined"); ++ protected String func_77258_c(int par1) { ++ return par1 == 0 ? "stat.crafted" : (par1 == 1 ? "stat.used" : "stat.mined"); + } + } diff --git a/patches/net/minecraft/src/GuiSlotStatsGeneral.java.patch b/patches/net/minecraft/src/GuiSlotStatsGeneral.java.patch new file mode 100644 index 0000000..0074435 --- /dev/null +++ b/patches/net/minecraft/src/GuiSlotStatsGeneral.java.patch @@ -0,0 +1,62 @@ +--- net/minecraft/src/GuiSlotStatsGeneral.java ++++ net/minecraft/src/GuiSlotStatsGeneral.java +@@ -3,23 +3,34 @@ + class GuiSlotStatsGeneral extends GuiSlot { + final GuiStats statsGui; + +- public GuiSlotStatsGeneral(GuiStats var1) { +- super(GuiStats.getMinecraft(var1), var1.width, var1.height, 32, var1.height - 64, 10); +- this.statsGui = var1; ++ public GuiSlotStatsGeneral(GuiStats par1GuiStats) { ++ super(GuiStats.getMinecraft(par1GuiStats), par1GuiStats.width, par1GuiStats.height, 32, par1GuiStats.height - 64, 10); ++ this.statsGui = par1GuiStats; + this.setShowSelectionBox(false); + } + ++ /** ++ * Gets the size of the current slot list. ++ */ + protected int getSize() { +- return StatList.c.size(); +- } +- +- protected void elementClicked(int var1, boolean var2) { +- } +- +- protected boolean isSelected(int var1) { ++ return StatList.generalStats.size(); ++ } ++ ++ /** ++ * the element in the slot that was clicked, boolean for wether it was double clicked or not ++ */ ++ protected void elementClicked(int par1, boolean par2) {} ++ ++ /** ++ * returns true if the element passed in is currently selected ++ */ ++ protected boolean isSelected(int par1) { + return false; + } + ++ /** ++ * return the height of the content being scrolled ++ */ + protected int getContentHeight() { + return this.getSize() * 10; + } +@@ -28,10 +39,10 @@ + this.statsGui.drawDefaultBackground(); + } + +- protected void drawSlot(int var1, int var2, int var3, int var4, Tessellator var5) { +- StatBase var6 = (StatBase)StatList.c.get(var1); +- this.statsGui.drawString(GuiStats.getFontRenderer1(this.statsGui), I18n.getString(var6.getName()), var2 + 2, var3 + 1, var1 % 2 == 0 ? 16777215 : 9474192); ++ protected void drawSlot(int par1, int par2, int par3, int par4, Tessellator par5Tessellator) { ++ StatBase var6 = (StatBase)StatList.generalStats.get(par1); ++ this.statsGui.drawString(GuiStats.getFontRenderer1(this.statsGui), I18n.getString(var6.getName()), par2 + 2, par3 + 1, par1 % 2 == 0 ? 16777215 : 9474192); + String var7 = var6.func_75968_a(GuiStats.getStatsFileWriter(this.statsGui).writeStat(var6)); +- this.statsGui.drawString(GuiStats.getFontRenderer2(this.statsGui), var7, var2 + 2 + 213 - GuiStats.getFontRenderer3(this.statsGui).getStringWidth(var7), var3 + 1, var1 % 2 == 0 ? 16777215 : 9474192); ++ this.statsGui.drawString(GuiStats.getFontRenderer2(this.statsGui), var7, par2 + 2 + 213 - GuiStats.getFontRenderer3(this.statsGui).getStringWidth(var7), par3 + 1, par1 % 2 == 0 ? 16777215 : 9474192); + } + } diff --git a/patches/net/minecraft/src/GuiSlotStatsItem.java.patch b/patches/net/minecraft/src/GuiSlotStatsItem.java.patch new file mode 100644 index 0000000..33499b0 --- /dev/null +++ b/patches/net/minecraft/src/GuiSlotStatsItem.java.patch @@ -0,0 +1,124 @@ +--- net/minecraft/src/GuiSlotStatsItem.java ++++ net/minecraft/src/GuiSlotStatsItem.java +@@ -4,66 +4,69 @@ + import java.util.Iterator; + + class GuiSlotStatsItem extends GuiSlotStats { ++ ++ /** Instance of GuiStats. */ + final GuiStats slotGuiStats; + +- public GuiSlotStatsItem(GuiStats var1) { +- super(var1); +- this.slotGuiStats = var1; +- this.h = new ArrayList(); +- Iterator var2 = StatList.d.iterator(); ++ public GuiSlotStatsItem(GuiStats par1GuiStats) { ++ super(par1GuiStats); ++ this.slotGuiStats = par1GuiStats; ++ this.field_77266_h = new ArrayList(); ++ Iterator var2 = StatList.itemStats.iterator(); + +- while(var2.hasNext()) { ++ while (var2.hasNext()) { + StatCrafting var3 = (StatCrafting)var2.next(); + boolean var4 = false; + int var5 = var3.getItemID(); +- if(GuiStats.getStatsFileWriter(var1).writeStat(var3) > 0) { +- var4 = true; +- } else if(StatList.objectBreakStats[var5] != null && GuiStats.getStatsFileWriter(var1).writeStat(StatList.objectBreakStats[var5]) > 0) { +- var4 = true; +- } else if(StatList.objectCraftStats[var5] != null && GuiStats.getStatsFileWriter(var1).writeStat(StatList.objectCraftStats[var5]) > 0) { +- var4 = true; +- } +- +- if(var4) { +- this.h.add(var3); +- } +- } +- +- this.i = new SorterStatsItem(this, var1); +- } +- +- protected void func_77222_a(int var1, int var2, Tessellator var3) { +- super.func_77222_a(var1, var2, var3); +- if(this.field_77262_g == 0) { +- GuiStats.drawSprite(this.slotGuiStats, var1 + 115 - 18 + 1, var2 + 1 + 1, 72, 18); +- } else { +- GuiStats.drawSprite(this.slotGuiStats, var1 + 115 - 18, var2 + 1, 72, 18); +- } +- +- if(this.field_77262_g == 1) { +- GuiStats.drawSprite(this.slotGuiStats, var1 + 165 - 18 + 1, var2 + 1 + 1, 18, 18); +- } else { +- GuiStats.drawSprite(this.slotGuiStats, var1 + 165 - 18, var2 + 1, 18, 18); +- } +- +- if(this.field_77262_g == 2) { +- GuiStats.drawSprite(this.slotGuiStats, var1 + 215 - 18 + 1, var2 + 1 + 1, 36, 18); +- } else { +- GuiStats.drawSprite(this.slotGuiStats, var1 + 215 - 18, var2 + 1, 36, 18); +- } +- +- } +- +- protected void drawSlot(int var1, int var2, int var3, int var4, Tessellator var5) { +- StatCrafting var6 = this.func_77257_d(var1); ++ ++ if (GuiStats.getStatsFileWriter(par1GuiStats).writeStat(var3) > 0) { ++ var4 = true; ++ } else if (StatList.objectBreakStats[var5] != null && GuiStats.getStatsFileWriter(par1GuiStats).writeStat(StatList.objectBreakStats[var5]) > 0) { ++ var4 = true; ++ } else if (StatList.objectCraftStats[var5] != null && GuiStats.getStatsFileWriter(par1GuiStats).writeStat(StatList.objectCraftStats[var5]) > 0) { ++ var4 = true; ++ } ++ ++ if (var4) { ++ this.field_77266_h.add(var3); ++ } ++ } ++ ++ this.field_77267_i = new SorterStatsItem(this, par1GuiStats); ++ } ++ ++ protected void func_77222_a(int par1, int par2, Tessellator par3Tessellator) { ++ super.func_77222_a(par1, par2, par3Tessellator); ++ ++ if (this.field_77262_g == 0) { ++ GuiStats.drawSprite(this.slotGuiStats, par1 + 115 - 18 + 1, par2 + 1 + 1, 72, 18); ++ } else { ++ GuiStats.drawSprite(this.slotGuiStats, par1 + 115 - 18, par2 + 1, 72, 18); ++ } ++ ++ if (this.field_77262_g == 1) { ++ GuiStats.drawSprite(this.slotGuiStats, par1 + 165 - 18 + 1, par2 + 1 + 1, 18, 18); ++ } else { ++ GuiStats.drawSprite(this.slotGuiStats, par1 + 165 - 18, par2 + 1, 18, 18); ++ } ++ ++ if (this.field_77262_g == 2) { ++ GuiStats.drawSprite(this.slotGuiStats, par1 + 215 - 18 + 1, par2 + 1 + 1, 36, 18); ++ } else { ++ GuiStats.drawSprite(this.slotGuiStats, par1 + 215 - 18, par2 + 1, 36, 18); ++ } ++ } ++ ++ protected void drawSlot(int par1, int par2, int par3, int par4, Tessellator par5Tessellator) { ++ StatCrafting var6 = this.func_77257_d(par1); + int var7 = var6.getItemID(); +- GuiStats.drawItemSprite(this.slotGuiStats, var2 + 40, var3, var7); +- this.func_77260_a((StatCrafting)StatList.objectBreakStats[var7], var2 + 115, var3, var1 % 2 == 0); +- this.func_77260_a((StatCrafting)StatList.objectCraftStats[var7], var2 + 165, var3, var1 % 2 == 0); +- this.func_77260_a(var6, var2 + 215, var3, var1 % 2 == 0); ++ GuiStats.drawItemSprite(this.slotGuiStats, par2 + 40, par3, var7); ++ this.func_77260_a((StatCrafting)StatList.objectBreakStats[var7], par2 + 115, par3, par1 % 2 == 0); ++ this.func_77260_a((StatCrafting)StatList.objectCraftStats[var7], par2 + 165, par3, par1 % 2 == 0); ++ this.func_77260_a(var6, par2 + 215, par3, par1 % 2 == 0); + } + +- protected String func_77258_c(int var1) { +- return var1 == 1 ? "stat.crafted" : (var1 == 2 ? "stat.used" : "stat.depleted"); ++ protected String func_77258_c(int par1) { ++ return par1 == 1 ? "stat.crafted" : (par1 == 2 ? "stat.used" : "stat.depleted"); + } + } diff --git a/patches/net/minecraft/src/GuiSmallButton.java.patch b/patches/net/minecraft/src/GuiSmallButton.java.patch new file mode 100644 index 0000000..41fc48c --- /dev/null +++ b/patches/net/minecraft/src/GuiSmallButton.java.patch @@ -0,0 +1,28 @@ +--- net/minecraft/src/GuiSmallButton.java ++++ net/minecraft/src/GuiSmallButton.java +@@ -3,18 +3,18 @@ + public class GuiSmallButton extends GuiButton { + private final EnumOptions enumOptions; + +- public GuiSmallButton(int var1, int var2, int var3, String var4) { +- this(var1, var2, var3, (EnumOptions)null, var4); ++ public GuiSmallButton(int par1, int par2, int par3, String par4Str) { ++ this(par1, par2, par3, (EnumOptions)null, par4Str); + } + +- public GuiSmallButton(int var1, int var2, int var3, int var4, int var5, String var6) { +- super(var1, var2, var3, var4, var5, var6); ++ public GuiSmallButton(int par1, int par2, int par3, int par4, int par5, String par6Str) { ++ super(par1, par2, par3, par4, par5, par6Str); + this.enumOptions = null; + } + +- public GuiSmallButton(int var1, int var2, int var3, EnumOptions var4, String var5) { +- super(var1, var2, var3, 150, 20, var5); +- this.enumOptions = var4; ++ public GuiSmallButton(int par1, int par2, int par3, EnumOptions par4EnumOptions, String par5Str) { ++ super(par1, par2, par3, 150, 20, par5Str); ++ this.enumOptions = par4EnumOptions; + } + + public EnumOptions returnEnumOptions() { diff --git a/patches/net/minecraft/src/GuiSnooper.java.patch b/patches/net/minecraft/src/GuiSnooper.java.patch new file mode 100644 index 0000000..436fe23 --- /dev/null +++ b/patches/net/minecraft/src/GuiSnooper.java.patch @@ -0,0 +1,156 @@ +--- net/minecraft/src/GuiSnooper.java ++++ net/minecraft/src/GuiSnooper.java +@@ -7,97 +7,111 @@ + import java.util.Map.Entry; + + public class GuiSnooper extends GuiScreen { ++ ++ /** Instance of GuiScreen. */ + private final GuiScreen snooperGuiScreen; ++ ++ /** Instance of GameSettings. */ + private final GameSettings snooperGameSettings; +- private final List c = new ArrayList(); +- private final List d = new ArrayList(); +- private String e; +- private String[] p; ++ private final List field_74098_c = new ArrayList(); ++ private final List field_74096_d = new ArrayList(); ++ ++ /** The Snooper title. */ ++ private String snooperTitle; ++ private String[] field_74101_n; + private GuiSnooperList snooperList; + private GuiButton buttonAllowSnooping; + +- public GuiSnooper(GuiScreen var1, GameSettings var2) { +- this.snooperGuiScreen = var1; +- this.snooperGameSettings = var2; ++ public GuiSnooper(GuiScreen par1GuiScreen, GameSettings par2GameSettings) { ++ this.snooperGuiScreen = par1GuiScreen; ++ this.snooperGameSettings = par2GameSettings; + } + ++ /** ++ * Adds the buttons (and other controls) to the screen in question. ++ */ + public void initGui() { +- this.e = I18n.getString("options.snooper.title"); ++ this.snooperTitle = I18n.getString("options.snooper.title"); + String var1 = I18n.getString("options.snooper.desc"); + ArrayList var2 = new ArrayList(); + Iterator var3 = this.fontRenderer.listFormattedStringToWidth(var1, this.width - 30).iterator(); + +- while(var3.hasNext()) { ++ while (var3.hasNext()) { + String var4 = (String)var3.next(); + var2.add(var4); + } + +- this.p = (String[])var2.toArray(new String[0]); +- this.c.clear(); +- this.d.clear(); +- this.i.add(this.buttonAllowSnooping = new GuiButton(1, this.width / 2 - 152, this.height - 30, 150, 20, this.snooperGameSettings.getKeyBinding(EnumOptions.SNOOPER_ENABLED))); +- this.i.add(new GuiButton(2, this.width / 2 + 2, this.height - 30, 150, 20, I18n.getString("gui.done"))); ++ this.field_74101_n = (String[])var2.toArray(new String[0]); ++ this.field_74098_c.clear(); ++ this.field_74096_d.clear(); ++ this.buttonList.add(this.buttonAllowSnooping = new GuiButton(1, this.width / 2 - 152, this.height - 30, 150, 20, this.snooperGameSettings.getKeyBinding(EnumOptions.SNOOPER_ENABLED))); ++ this.buttonList.add(new GuiButton(2, this.width / 2 + 2, this.height - 30, 150, 20, I18n.getString("gui.done"))); + boolean var6 = this.mc.getIntegratedServer() != null && this.mc.getIntegratedServer().getPlayerUsageSnooper() != null; + Iterator var7 = (new TreeMap(this.mc.getPlayerUsageSnooper().getCurrentStats())).entrySet().iterator(); +- + Entry var5; +- while(var7.hasNext()) { ++ ++ while (var7.hasNext()) { + var5 = (Entry)var7.next(); +- this.c.add((var6 ? "C " : "") + (String)var5.getKey()); +- this.d.add(this.fontRenderer.trimStringToWidth((String)var5.getValue(), this.width - 220)); ++ this.field_74098_c.add((var6 ? "C " : "") + (String)var5.getKey()); ++ this.field_74096_d.add(this.fontRenderer.trimStringToWidth((String)var5.getValue(), this.width - 220)); + } + +- if(var6) { ++ if (var6) { + var7 = (new TreeMap(this.mc.getIntegratedServer().getPlayerUsageSnooper().getCurrentStats())).entrySet().iterator(); + +- while(var7.hasNext()) { ++ while (var7.hasNext()) { + var5 = (Entry)var7.next(); +- this.c.add("S " + (String)var5.getKey()); +- this.d.add(this.fontRenderer.trimStringToWidth((String)var5.getValue(), this.width - 220)); ++ this.field_74098_c.add("S " + (String)var5.getKey()); ++ this.field_74096_d.add(this.fontRenderer.trimStringToWidth((String)var5.getValue(), this.width - 220)); + } + } + + this.snooperList = new GuiSnooperList(this); + } + +- protected void actionPerformed(GuiButton var1) { +- if(var1.enabled) { +- if(var1.id == 2) { ++ /** ++ * Fired when a control is clicked. This is the equivalent of ActionListener.actionPerformed(ActionEvent e). ++ */ ++ protected void actionPerformed(GuiButton par1GuiButton) { ++ if (par1GuiButton.enabled) { ++ if (par1GuiButton.id == 2) { + this.snooperGameSettings.saveOptions(); + this.snooperGameSettings.saveOptions(); + this.mc.displayGuiScreen(this.snooperGuiScreen); + } + +- if(var1.id == 1) { ++ if (par1GuiButton.id == 1) { + this.snooperGameSettings.setOptionValue(EnumOptions.SNOOPER_ENABLED, 1); +- this.buttonAllowSnooping.f = this.snooperGameSettings.getKeyBinding(EnumOptions.SNOOPER_ENABLED); ++ this.buttonAllowSnooping.displayString = this.snooperGameSettings.getKeyBinding(EnumOptions.SNOOPER_ENABLED); + } +- + } + } + +- public void drawScreen(int var1, int var2, float var3) { ++ /** ++ * Draws the screen and all the components in it. ++ */ ++ public void drawScreen(int par1, int par2, float par3) { + this.drawDefaultBackground(); +- this.snooperList.drawScreen(var1, var2, var3); +- this.drawCenteredString(this.fontRenderer, this.e, this.width / 2, 8, 16777215); ++ this.snooperList.drawScreen(par1, par2, par3); ++ this.drawCenteredString(this.fontRenderer, this.snooperTitle, this.width / 2, 8, 16777215); + int var4 = 22; +- String[] var5 = this.p; ++ String[] var5 = this.field_74101_n; + int var6 = var5.length; + +- for(int var7 = 0; var7 < var6; ++var7) { ++ for (int var7 = 0; var7 < var6; ++var7) { + String var8 = var5[var7]; + this.drawCenteredString(this.fontRenderer, var8, this.width / 2, var4, 8421504); + var4 += this.fontRenderer.FONT_HEIGHT; + } + +- super.drawScreen(var1, var2, var3); +- } +- +- static List func_74095_a(GuiSnooper var0) { +- return var0.c; +- } +- +- static List func_74094_b(GuiSnooper var0) { +- return var0.d; ++ super.drawScreen(par1, par2, par3); ++ } ++ ++ static List func_74095_a(GuiSnooper par0GuiSnooper) { ++ return par0GuiSnooper.field_74098_c; ++ } ++ ++ static List func_74094_b(GuiSnooper par0GuiSnooper) { ++ return par0GuiSnooper.field_74096_d; + } + } diff --git a/patches/net/minecraft/src/GuiSnooperList.java.patch b/patches/net/minecraft/src/GuiSnooperList.java.patch new file mode 100644 index 0000000..c003627 --- /dev/null +++ b/patches/net/minecraft/src/GuiSnooperList.java.patch @@ -0,0 +1,49 @@ +--- net/minecraft/src/GuiSnooperList.java ++++ net/minecraft/src/GuiSnooperList.java +@@ -3,28 +3,35 @@ + class GuiSnooperList extends GuiSlot { + final GuiSnooper snooperGui; + +- public GuiSnooperList(GuiSnooper var1) { +- super(var1.mc, var1.width, var1.height, 80, var1.height - 40, var1.fontRenderer.FONT_HEIGHT + 1); +- this.snooperGui = var1; ++ public GuiSnooperList(GuiSnooper par1GuiSnooper) { ++ super(par1GuiSnooper.mc, par1GuiSnooper.width, par1GuiSnooper.height, 80, par1GuiSnooper.height - 40, par1GuiSnooper.fontRenderer.FONT_HEIGHT + 1); ++ this.snooperGui = par1GuiSnooper; + } + ++ /** ++ * Gets the size of the current slot list. ++ */ + protected int getSize() { + return GuiSnooper.func_74095_a(this.snooperGui).size(); + } + +- protected void elementClicked(int var1, boolean var2) { +- } ++ /** ++ * the element in the slot that was clicked, boolean for wether it was double clicked or not ++ */ ++ protected void elementClicked(int par1, boolean par2) {} + +- protected boolean isSelected(int var1) { ++ /** ++ * returns true if the element passed in is currently selected ++ */ ++ protected boolean isSelected(int par1) { + return false; + } + +- protected void drawBackground() { +- } ++ protected void drawBackground() {} + +- protected void drawSlot(int var1, int var2, int var3, int var4, Tessellator var5) { +- this.snooperGui.fontRenderer.drawString((String)GuiSnooper.func_74095_a(this.snooperGui).get(var1), 10, var3, 16777215); +- this.snooperGui.fontRenderer.drawString((String)GuiSnooper.func_74094_b(this.snooperGui).get(var1), 230, var3, 16777215); ++ protected void drawSlot(int par1, int par2, int par3, int par4, Tessellator par5Tessellator) { ++ this.snooperGui.fontRenderer.drawString((String)GuiSnooper.func_74095_a(this.snooperGui).get(par1), 10, par3, 16777215); ++ this.snooperGui.fontRenderer.drawString((String)GuiSnooper.func_74094_b(this.snooperGui).get(par1), 230, par3, 16777215); + } + + protected int getScrollBarX() { diff --git a/patches/net/minecraft/src/GuiStats.java.patch b/patches/net/minecraft/src/GuiStats.java.patch new file mode 100644 index 0000000..c5aaaa4 --- /dev/null +++ b/patches/net/minecraft/src/GuiStats.java.patch @@ -0,0 +1,367 @@ +--- net/minecraft/src/GuiStats.java ++++ net/minecraft/src/GuiStats.java +@@ -1,26 +1,38 @@ + package net.minecraft.src; + +-import java.util.List; + import org.lwjgl.opengl.GL11; + import org.lwjgl.opengl.GL12; + + public class GuiStats extends GuiScreen { + private static RenderItem renderItem = new RenderItem(); + protected GuiScreen parentGui; +- protected String b = "Select world"; ++ ++ /** The title of the stats screen. */ ++ protected String statsTitle = "Select world"; ++ ++ /** The slot for general stats. */ + private GuiSlotStatsGeneral slotGeneral; ++ ++ /** The slot for item stats. */ + private GuiSlotStatsItem slotItem; ++ ++ /** The slot for block stats. */ + private GuiSlotStatsBlock slotBlock; + private StatFileWriter statFileWriter; ++ ++ /** The currently-selected slot. */ + private GuiSlot selectedSlot; + +- public GuiStats(GuiScreen var1, StatFileWriter var2) { +- this.parentGui = var1; +- this.statFileWriter = var2; ++ public GuiStats(GuiScreen par1GuiScreen, StatFileWriter par2StatFileWriter) { ++ this.parentGui = par1GuiScreen; ++ this.statFileWriter = par2StatFileWriter; + } + ++ /** ++ * Adds the buttons (and other controls) to the screen in question. ++ */ + public void initGui() { +- this.b = I18n.getString("gui.stats"); ++ this.statsTitle = I18n.getString("gui.stats"); + this.slotGeneral = new GuiSlotStatsGeneral(this); + this.slotGeneral.registerScrollButtons(1, 1); + this.slotItem = new GuiSlotStatsItem(this); +@@ -31,62 +43,77 @@ + this.addHeaderButtons(); + } + ++ /** ++ * Creates the buttons that appear at the top of the Stats GUI. ++ */ + public void addHeaderButtons() { +- this.i.add(new GuiButton(0, this.width / 2 + 4, this.height - 28, 150, 20, I18n.getString("gui.done"))); +- this.i.add(new GuiButton(1, this.width / 2 - 154, this.height - 52, 100, 20, I18n.getString("stat.generalButton"))); +- List var10000 = this.i; +- GuiButton var1 = new GuiButton(2, this.width / 2 - 46, this.height - 52, 100, 20, I18n.getString("stat.blocksButton")); +- var10000.add(var1); +- var10000 = this.i; +- GuiButton var2 = new GuiButton(3, this.width / 2 + 62, this.height - 52, 100, 20, I18n.getString("stat.itemsButton")); +- var10000.add(var2); +- if(this.slotBlock.getSize() == 0) { ++ this.buttonList.add(new GuiButton(0, this.width / 2 + 4, this.height - 28, 150, 20, I18n.getString("gui.done"))); ++ this.buttonList.add(new GuiButton(1, this.width / 2 - 154, this.height - 52, 100, 20, I18n.getString("stat.generalButton"))); ++ GuiButton var1; ++ this.buttonList.add(var1 = new GuiButton(2, this.width / 2 - 46, this.height - 52, 100, 20, I18n.getString("stat.blocksButton"))); ++ GuiButton var2; ++ this.buttonList.add(var2 = new GuiButton(3, this.width / 2 + 62, this.height - 52, 100, 20, I18n.getString("stat.itemsButton"))); ++ ++ if (this.slotBlock.getSize() == 0) { + var1.enabled = false; + } + +- if(this.slotItem.getSize() == 0) { ++ if (this.slotItem.getSize() == 0) { + var2.enabled = false; + } +- + } + +- protected void actionPerformed(GuiButton var1) { +- if(var1.enabled) { +- if(var1.id == 0) { ++ /** ++ * Fired when a control is clicked. This is the equivalent of ActionListener.actionPerformed(ActionEvent e). ++ */ ++ protected void actionPerformed(GuiButton par1GuiButton) { ++ if (par1GuiButton.enabled) { ++ if (par1GuiButton.id == 0) { + this.mc.displayGuiScreen(this.parentGui); +- } else if(var1.id == 1) { ++ } else if (par1GuiButton.id == 1) { + this.selectedSlot = this.slotGeneral; +- } else if(var1.id == 3) { ++ } else if (par1GuiButton.id == 3) { + this.selectedSlot = this.slotItem; +- } else if(var1.id == 2) { ++ } else if (par1GuiButton.id == 2) { + this.selectedSlot = this.slotBlock; + } else { +- this.selectedSlot.actionPerformed(var1); ++ this.selectedSlot.actionPerformed(par1GuiButton); + } +- + } + } + +- public void drawScreen(int var1, int var2, float var3) { +- this.selectedSlot.drawScreen(var1, var2, var3); +- this.drawCenteredString(this.fontRenderer, this.b, this.width / 2, 20, 16777215); +- super.drawScreen(var1, var2, var3); ++ /** ++ * Draws the screen and all the components in it. ++ */ ++ public void drawScreen(int par1, int par2, float par3) { ++ this.selectedSlot.drawScreen(par1, par2, par3); ++ this.drawCenteredString(this.fontRenderer, this.statsTitle, this.width / 2, 20, 16777215); ++ super.drawScreen(par1, par2, par3); + } + +- private void drawItemSprite(int var1, int var2, int var3) { +- this.drawButtonBackground(var1 + 1, var2 + 1); ++ /** ++ * Draws the item sprite on top of the background sprite. ++ */ ++ private void drawItemSprite(int par1, int par2, int par3) { ++ this.drawButtonBackground(par1 + 1, par2 + 1); + GL11.glEnable(GL12.GL_RESCALE_NORMAL); + RenderHelper.enableGUIStandardItemLighting(); +- renderItem.renderItemIntoGUI(this.fontRenderer, this.mc.getTextureManager(), new ItemStack(var3, 1, 0), var1 + 2, var2 + 2); ++ renderItem.renderItemIntoGUI(this.fontRenderer, this.mc.getTextureManager(), new ItemStack(par3, 1, 0), par1 + 2, par2 + 2); + RenderHelper.disableStandardItemLighting(); + GL11.glDisable(GL12.GL_RESCALE_NORMAL); + } + +- private void drawButtonBackground(int var1, int var2) { +- this.drawSprite(var1, var2, 0, 0); ++ /** ++ * Draws a gray box that serves as a button background. ++ */ ++ private void drawButtonBackground(int par1, int par2) { ++ this.drawSprite(par1, par2, 0, 0); + } + +- private void drawSprite(int var1, int var2, int var3, int var4) { ++ /** ++ * "Draws a sprite from assets/textures/gui/container/stats_icons.png" ++ */ ++ private void drawSprite(int par1, int par2, int par3, int par4) { + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + this.mc.getTextureManager().bindTexture(statIcons); + float var5 = 0.0078125F; +@@ -95,86 +122,134 @@ + boolean var8 = true; + Tessellator var9 = Tessellator.instance; + var9.startDrawingQuads(); +- var9.addVertexWithUV((double)(var1 + 0), (double)(var2 + 18), (double)this.zLevel, (double)((float)(var3 + 0) * 0.0078125F), (double)((float)(var4 + 18) * 0.0078125F)); +- var9.addVertexWithUV((double)(var1 + 18), (double)(var2 + 18), (double)this.zLevel, (double)((float)(var3 + 18) * 0.0078125F), (double)((float)(var4 + 18) * 0.0078125F)); +- var9.addVertexWithUV((double)(var1 + 18), (double)(var2 + 0), (double)this.zLevel, (double)((float)(var3 + 18) * 0.0078125F), (double)((float)(var4 + 0) * 0.0078125F)); +- var9.addVertexWithUV((double)(var1 + 0), (double)(var2 + 0), (double)this.zLevel, (double)((float)(var3 + 0) * 0.0078125F), (double)((float)(var4 + 0) * 0.0078125F)); ++ var9.addVertexWithUV((double)(par1 + 0), (double)(par2 + 18), (double)this.zLevel, (double)((float)(par3 + 0) * 0.0078125F), (double)((float)(par4 + 18) * 0.0078125F)); ++ var9.addVertexWithUV((double)(par1 + 18), (double)(par2 + 18), (double)this.zLevel, (double)((float)(par3 + 18) * 0.0078125F), (double)((float)(par4 + 18) * 0.0078125F)); ++ var9.addVertexWithUV((double)(par1 + 18), (double)(par2 + 0), (double)this.zLevel, (double)((float)(par3 + 18) * 0.0078125F), (double)((float)(par4 + 0) * 0.0078125F)); ++ var9.addVertexWithUV((double)(par1 + 0), (double)(par2 + 0), (double)this.zLevel, (double)((float)(par3 + 0) * 0.0078125F), (double)((float)(par4 + 0) * 0.0078125F)); + var9.draw(); + } + +- static Minecraft getMinecraft(GuiStats var0) { +- return var0.mc; +- } +- +- static FontRenderer getFontRenderer1(GuiStats var0) { +- return var0.fontRenderer; +- } +- +- static StatFileWriter getStatsFileWriter(GuiStats var0) { +- return var0.statFileWriter; +- } +- +- static FontRenderer getFontRenderer2(GuiStats var0) { +- return var0.fontRenderer; +- } +- +- static FontRenderer getFontRenderer3(GuiStats var0) { +- return var0.fontRenderer; +- } +- +- static Minecraft getMinecraft1(GuiStats var0) { +- return var0.mc; +- } +- +- static void drawSprite(GuiStats var0, int var1, int var2, int var3, int var4) { +- var0.drawSprite(var1, var2, var3, var4); +- } +- +- static Minecraft getMinecraft2(GuiStats var0) { +- return var0.mc; +- } +- +- static FontRenderer getFontRenderer4(GuiStats var0) { +- return var0.fontRenderer; +- } +- +- static FontRenderer getFontRenderer5(GuiStats var0) { +- return var0.fontRenderer; +- } +- +- static FontRenderer getFontRenderer6(GuiStats var0) { +- return var0.fontRenderer; +- } +- +- static FontRenderer getFontRenderer7(GuiStats var0) { +- return var0.fontRenderer; +- } +- +- static FontRenderer getFontRenderer8(GuiStats var0) { +- return var0.fontRenderer; +- } +- +- static void drawGradientRect(GuiStats var0, int var1, int var2, int var3, int var4, int var5, int var6) { +- var0.drawGradientRect(var1, var2, var3, var4, var5, var6); +- } +- +- static FontRenderer getFontRenderer9(GuiStats var0) { +- return var0.fontRenderer; +- } +- +- static FontRenderer getFontRenderer10(GuiStats var0) { +- return var0.fontRenderer; +- } +- +- static void drawGradientRect1(GuiStats var0, int var1, int var2, int var3, int var4, int var5, int var6) { +- var0.drawGradientRect(var1, var2, var3, var4, var5, var6); +- } +- +- static FontRenderer getFontRenderer11(GuiStats var0) { +- return var0.fontRenderer; +- } +- +- static void drawItemSprite(GuiStats var0, int var1, int var2, int var3) { +- var0.drawItemSprite(var1, var2, var3); ++ static Minecraft getMinecraft(GuiStats par0GuiStats) { ++ return par0GuiStats.mc; ++ } ++ ++ /** ++ * there are 11 identical methods like this ++ */ ++ static FontRenderer getFontRenderer1(GuiStats par0GuiStats) { ++ return par0GuiStats.fontRenderer; ++ } ++ ++ static StatFileWriter getStatsFileWriter(GuiStats par0GuiStats) { ++ return par0GuiStats.statFileWriter; ++ } ++ ++ /** ++ * there are 11 identical methods like this ++ */ ++ static FontRenderer getFontRenderer2(GuiStats par0GuiStats) { ++ return par0GuiStats.fontRenderer; ++ } ++ ++ /** ++ * there are 11 identical methods like this ++ */ ++ static FontRenderer getFontRenderer3(GuiStats par0GuiStats) { ++ return par0GuiStats.fontRenderer; ++ } ++ ++ /** ++ * exactly the same as 27141 ++ */ ++ static Minecraft getMinecraft1(GuiStats par0GuiStats) { ++ return par0GuiStats.mc; ++ } ++ ++ /** ++ * Draws a sprite from /gui/slot.png. ++ */ ++ static void drawSprite(GuiStats par0GuiStats, int par1, int par2, int par3, int par4) { ++ par0GuiStats.drawSprite(par1, par2, par3, par4); ++ } ++ ++ /** ++ * exactly the same as 27141 and 27143 ++ */ ++ static Minecraft getMinecraft2(GuiStats par0GuiStats) { ++ return par0GuiStats.mc; ++ } ++ ++ /** ++ * there are 11 identical methods like this ++ */ ++ static FontRenderer getFontRenderer4(GuiStats par0GuiStats) { ++ return par0GuiStats.fontRenderer; ++ } ++ ++ /** ++ * there are 11 identical methods like this ++ */ ++ static FontRenderer getFontRenderer5(GuiStats par0GuiStats) { ++ return par0GuiStats.fontRenderer; ++ } ++ ++ /** ++ * there are 11 identical methods like this ++ */ ++ static FontRenderer getFontRenderer6(GuiStats par0GuiStats) { ++ return par0GuiStats.fontRenderer; ++ } ++ ++ /** ++ * there are 11 identical methods like this ++ */ ++ static FontRenderer getFontRenderer7(GuiStats par0GuiStats) { ++ return par0GuiStats.fontRenderer; ++ } ++ ++ /** ++ * there are 11 identical methods like this ++ */ ++ static FontRenderer getFontRenderer8(GuiStats par0GuiStats) { ++ return par0GuiStats.fontRenderer; ++ } ++ ++ static void drawGradientRect(GuiStats par0GuiStats, int par1, int par2, int par3, int par4, int par5, int par6) { ++ par0GuiStats.drawGradientRect(par1, par2, par3, par4, par5, par6); ++ } ++ ++ /** ++ * there are 11 identical methods like this ++ */ ++ static FontRenderer getFontRenderer9(GuiStats par0GuiStats) { ++ return par0GuiStats.fontRenderer; ++ } ++ ++ /** ++ * there are 11 identical methods like this ++ */ ++ static FontRenderer getFontRenderer10(GuiStats par0GuiStats) { ++ return par0GuiStats.fontRenderer; ++ } ++ ++ /** ++ * exactly the same as 27129 ++ */ ++ static void drawGradientRect1(GuiStats par0GuiStats, int par1, int par2, int par3, int par4, int par5, int par6) { ++ par0GuiStats.drawGradientRect(par1, par2, par3, par4, par5, par6); ++ } ++ ++ /** ++ * there are 11 identical methods like this ++ */ ++ static FontRenderer getFontRenderer11(GuiStats par0GuiStats) { ++ return par0GuiStats.fontRenderer; ++ } ++ ++ /** ++ * Draws the item sprite on top of the background sprite. ++ */ ++ static void drawItemSprite(GuiStats par0GuiStats, int par1, int par2, int par3) { ++ par0GuiStats.drawItemSprite(par1, par2, par3); + } + } diff --git a/patches/net/minecraft/src/GuiTextField.java.patch b/patches/net/minecraft/src/GuiTextField.java.patch new file mode 100644 index 0000000..9782566 --- /dev/null +++ b/patches/net/minecraft/src/GuiTextField.java.patch @@ -0,0 +1,881 @@ +--- net/minecraft/src/GuiTextField.java ++++ net/minecraft/src/GuiTextField.java +@@ -3,70 +3,115 @@ + import org.lwjgl.opengl.GL11; + + public class GuiTextField extends Gui { ++ ++ /** ++ * Have the font renderer from GuiScreen to render the textbox text into the screen. ++ */ + private final FontRenderer fontRenderer; + private final int xPos; + private final int yPos; ++ ++ /** The width of this text field. */ + private final int width; + private final int height; +- private String f = ""; ++ ++ /** Have the current text beign edited on the textbox. */ ++ private String text = ""; + private int maxStringLength = 32; + private int cursorCounter; + private boolean enableBackgroundDrawing = true; ++ ++ /** ++ * if true the textbox can lose focus by clicking elsewhere on the screen ++ */ + private boolean canLoseFocus = true; ++ ++ /** ++ * If this value is true along isEnabled, keyTyped will process the keys. ++ */ + private boolean isFocused; ++ ++ /** ++ * If this value is true along isFocused, keyTyped will process the keys. ++ */ + private boolean isEnabled = true; ++ ++ /** ++ * The current character index that should be used as start of the rendered text. ++ */ + private int lineScrollOffset; + private int cursorPosition; ++ ++ /** other selection position, maybe the same as the cursor */ + private int selectionEnd; + private int enabledColor = 14737632; + private int disabledColor = 7368816; ++ ++ /** True if this textbox is visible */ + private boolean visible = true; + +- public GuiTextField(FontRenderer var1, int var2, int var3, int var4, int var5) { +- this.fontRenderer = var1; +- this.xPos = var2; +- this.yPos = var3; +- this.width = var4; +- this.height = var5; ++ public GuiTextField(FontRenderer par1FontRenderer, int par2, int par3, int par4, int par5) { ++ this.fontRenderer = par1FontRenderer; ++ this.xPos = par2; ++ this.yPos = par3; ++ this.width = par4; ++ this.height = par5; + } + ++ /** ++ * Increments the cursor counter ++ */ + public void updateCursorCounter() { + ++this.cursorCounter; + } + +- public void setText(String var1) { +- if(var1.length() > this.maxStringLength) { +- this.f = var1.substring(0, this.maxStringLength); ++ /** ++ * Sets the text of the textbox. ++ */ ++ public void setText(String par1Str) { ++ if (par1Str.length() > this.maxStringLength) { ++ this.text = par1Str.substring(0, this.maxStringLength); + } else { +- this.f = var1; ++ this.text = par1Str; + } + + this.setCursorPositionEnd(); + } + ++ /** ++ * Returns the text beign edited on the textbox. ++ */ + public String getText() { +- return this.f; ++ return this.text; + } + ++ /** ++ * @return returns the text between the cursor and selectionEnd ++ */ + public String getSelectedtext() { + int var1 = this.cursorPosition < this.selectionEnd ? this.cursorPosition : this.selectionEnd; + int var2 = this.cursorPosition < this.selectionEnd ? this.selectionEnd : this.cursorPosition; +- return this.f.substring(var1, var2); ++ return this.text.substring(var1, var2); + } + +- public void writeText(String var1) { ++ /** ++ * replaces selected text, or inserts text at the position on the cursor ++ */ ++ public void writeText(String par1Str) { + String var2 = ""; +- String var3 = ChatAllowedCharacters.filerAllowedCharacters(var1); ++ String var3 = ChatAllowedCharacters.filerAllowedCharacters(par1Str); + int var4 = this.cursorPosition < this.selectionEnd ? this.cursorPosition : this.selectionEnd; + int var5 = this.cursorPosition < this.selectionEnd ? this.selectionEnd : this.cursorPosition; +- int var6 = this.maxStringLength - this.f.length() - (var4 - this.selectionEnd); ++ int var6 = this.maxStringLength - this.text.length() - (var4 - this.selectionEnd); + boolean var7 = false; +- if(this.f.length() > 0) { +- var2 = var2 + this.f.substring(0, var4); ++ ++ if (this.text.length() > 0) { ++ var2 = var2 + this.text.substring(0, var4); + } + + int var8; +- if(var6 < var3.length()) { ++ ++ if (var6 < var3.length()) { + var2 = var2 + var3.substring(0, var6); + var8 = var6; + } else { +@@ -74,228 +119,276 @@ + var8 = var3.length(); + } + +- if(this.f.length() > 0 && var5 < this.f.length()) { +- var2 = var2 + this.f.substring(var5); ++ if (this.text.length() > 0 && var5 < this.text.length()) { ++ var2 = var2 + this.text.substring(var5); + } + +- this.f = var2; ++ this.text = var2; + this.moveCursorBy(var4 - this.selectionEnd + var8); + } + +- public void deleteWords(int var1) { +- if(this.f.length() != 0) { +- if(this.selectionEnd != this.cursorPosition) { ++ /** ++ * Deletes the specified number of words starting at the cursor position. Negative numbers will delete words left of ++ * the cursor. ++ */ ++ public void deleteWords(int par1) { ++ if (this.text.length() != 0) { ++ if (this.selectionEnd != this.cursorPosition) { + this.writeText(""); + } else { +- this.deleteFromCursor(this.getNthWordFromCursor(var1) - this.cursorPosition); ++ this.deleteFromCursor(this.getNthWordFromCursor(par1) - this.cursorPosition); + } + } + } + +- public void deleteFromCursor(int var1) { +- if(this.f.length() != 0) { +- if(this.selectionEnd != this.cursorPosition) { ++ /** ++ * delete the selected text, otherwsie deletes characters from either side of the cursor. params: delete num ++ */ ++ public void deleteFromCursor(int par1) { ++ if (this.text.length() != 0) { ++ if (this.selectionEnd != this.cursorPosition) { + this.writeText(""); + } else { +- boolean var2 = var1 < 0; +- int var3 = var2 ? this.cursorPosition + var1 : this.cursorPosition; +- int var4 = var2 ? this.cursorPosition : this.cursorPosition + var1; ++ boolean var2 = par1 < 0; ++ int var3 = var2 ? this.cursorPosition + par1 : this.cursorPosition; ++ int var4 = var2 ? this.cursorPosition : this.cursorPosition + par1; + String var5 = ""; +- if(var3 >= 0) { +- var5 = this.f.substring(0, var3); +- } +- +- if(var4 < this.f.length()) { +- var5 = var5 + this.f.substring(var4); +- } +- +- this.f = var5; +- if(var2) { +- this.moveCursorBy(var1); +- } +- ++ ++ if (var3 >= 0) { ++ var5 = this.text.substring(0, var3); ++ } ++ ++ if (var4 < this.text.length()) { ++ var5 = var5 + this.text.substring(var4); ++ } ++ ++ this.text = var5; ++ ++ if (var2) { ++ this.moveCursorBy(par1); ++ } + } + } + } + +- public int getNthWordFromCursor(int var1) { +- return this.getNthWordFromPos(var1, this.getCursorPosition()); +- } +- +- public int getNthWordFromPos(int var1, int var2) { +- return this.func_73798_a(var1, this.getCursorPosition(), true); +- } +- +- public int func_73798_a(int var1, int var2, boolean var3) { +- int var4 = var2; +- boolean var5 = var1 < 0; +- int var6 = Math.abs(var1); +- +- for(int var7 = 0; var7 < var6; ++var7) { +- if(!var5) { +- int var8 = this.f.length(); +- var4 = this.f.indexOf(32, var4); +- if(var4 == -1) { ++ /** ++ * see @getNthNextWordFromPos() params: N, position ++ */ ++ public int getNthWordFromCursor(int par1) { ++ return this.getNthWordFromPos(par1, this.getCursorPosition()); ++ } ++ ++ /** ++ * gets the position of the nth word. N may be negative, then it looks backwards. params: N, position ++ */ ++ public int getNthWordFromPos(int par1, int par2) { ++ return this.func_73798_a(par1, this.getCursorPosition(), true); ++ } ++ ++ public int func_73798_a(int par1, int par2, boolean par3) { ++ int var4 = par2; ++ boolean var5 = par1 < 0; ++ int var6 = Math.abs(par1); ++ ++ for (int var7 = 0; var7 < var6; ++var7) { ++ if (var5) { ++ while (par3 && var4 > 0 && this.text.charAt(var4 - 1) == 32) { ++ --var4; ++ } ++ ++ while (var4 > 0 && this.text.charAt(var4 - 1) != 32) { ++ --var4; ++ } ++ } else { ++ int var8 = this.text.length(); ++ var4 = this.text.indexOf(32, var4); ++ ++ if (var4 == -1) { + var4 = var8; + } else { +- while(var3 && var4 < var8 && this.f.charAt(var4) == 32) { ++ while (par3 && var4 < var8 && this.text.charAt(var4) == 32) { + ++var4; + } + } +- } else { +- while(var3 && var4 > 0 && this.f.charAt(var4 - 1) == 32) { +- --var4; +- } +- +- while(var4 > 0 && this.f.charAt(var4 - 1) != 32) { +- --var4; +- } + } + } + + return var4; + } + +- public void moveCursorBy(int var1) { +- this.setCursorPosition(this.selectionEnd + var1); ++ /** ++ * Moves the text cursor by a specified number of characters and clears the selection ++ */ ++ public void moveCursorBy(int par1) { ++ this.setCursorPosition(this.selectionEnd + par1); + } + +- public void setCursorPosition(int var1) { +- this.cursorPosition = var1; +- int var2 = this.f.length(); +- if(this.cursorPosition < 0) { ++ /** ++ * sets the position of the cursor to the provided index ++ */ ++ public void setCursorPosition(int par1) { ++ this.cursorPosition = par1; ++ int var2 = this.text.length(); ++ ++ if (this.cursorPosition < 0) { + this.cursorPosition = 0; + } + +- if(this.cursorPosition > var2) { ++ if (this.cursorPosition > var2) { + this.cursorPosition = var2; + } + + this.setSelectionPos(this.cursorPosition); + } + ++ /** ++ * sets the cursors position to the beginning ++ */ + public void setCursorPositionZero() { + this.setCursorPosition(0); + } + ++ /** ++ * sets the cursors position to after the text ++ */ + public void setCursorPositionEnd() { +- this.setCursorPosition(this.f.length()); ++ this.setCursorPosition(this.text.length()); + } + +- public boolean textboxKeyTyped(char var1, int var2) { +- if(this.isEnabled && this.isFocused) { +- switch(var1) { +- case '\u0001': +- this.setCursorPositionEnd(); +- this.setSelectionPos(0); +- return true; +- case '\u0003': +- GuiScreen.setClipboardString(this.getSelectedtext()); +- return true; +- case '\u0016': +- this.writeText(GuiScreen.getClipboardString()); +- return true; +- case '\u0018': +- GuiScreen.setClipboardString(this.getSelectedtext()); +- this.writeText(""); +- return true; +- default: +- switch(var2) { +- case 14: +- if(GuiScreen.isCtrlKeyDown()) { +- this.deleteWords(-1); +- } else { +- this.deleteFromCursor(-1); +- } +- +- return true; +- case 199: +- if(GuiScreen.isShiftKeyDown()) { +- this.setSelectionPos(0); +- } else { +- this.setCursorPositionZero(); +- } +- +- return true; +- case 203: +- if(GuiScreen.isShiftKeyDown()) { +- if(GuiScreen.isCtrlKeyDown()) { +- this.setSelectionPos(this.getNthWordFromPos(-1, this.getSelectionEnd())); +- } else { +- this.setSelectionPos(this.getSelectionEnd() - 1); +- } +- } else if(GuiScreen.isCtrlKeyDown()) { +- this.setCursorPosition(this.getNthWordFromCursor(-1)); +- } else { +- this.moveCursorBy(-1); +- } +- +- return true; +- case 205: +- if(GuiScreen.isShiftKeyDown()) { +- if(GuiScreen.isCtrlKeyDown()) { +- this.setSelectionPos(this.getNthWordFromPos(1, this.getSelectionEnd())); +- } else { +- this.setSelectionPos(this.getSelectionEnd() + 1); +- } +- } else if(GuiScreen.isCtrlKeyDown()) { +- this.setCursorPosition(this.getNthWordFromCursor(1)); +- } else { +- this.moveCursorBy(1); +- } +- +- return true; +- case 207: +- if(GuiScreen.isShiftKeyDown()) { +- this.setSelectionPos(this.f.length()); +- } else { +- this.setCursorPositionEnd(); +- } +- +- return true; +- case 211: +- if(GuiScreen.isCtrlKeyDown()) { +- this.deleteWords(1); +- } else { +- this.deleteFromCursor(1); +- } +- +- return true; ++ /** ++ * Call this method from you GuiScreen to process the keys into textbox. ++ */ ++ public boolean textboxKeyTyped(char par1, int par2) { ++ if (this.isEnabled && this.isFocused) { ++ switch (par1) { ++ case 1: ++ this.setCursorPositionEnd(); ++ this.setSelectionPos(0); ++ return true; ++ ++ case 3: ++ GuiScreen.setClipboardString(this.getSelectedtext()); ++ return true; ++ ++ case 22: ++ this.writeText(GuiScreen.getClipboardString()); ++ return true; ++ ++ case 24: ++ GuiScreen.setClipboardString(this.getSelectedtext()); ++ this.writeText(""); ++ return true; ++ + default: +- if(ChatAllowedCharacters.isAllowedCharacter(var1)) { +- this.writeText(Character.toString(var1)); +- return true; +- } else { +- return false; ++ switch (par2) { ++ case 14: ++ if (GuiScreen.isCtrlKeyDown()) { ++ this.deleteWords(-1); ++ } else { ++ this.deleteFromCursor(-1); ++ } ++ ++ return true; ++ ++ case 199: ++ if (GuiScreen.isShiftKeyDown()) { ++ this.setSelectionPos(0); ++ } else { ++ this.setCursorPositionZero(); ++ } ++ ++ return true; ++ ++ case 203: ++ if (GuiScreen.isShiftKeyDown()) { ++ if (GuiScreen.isCtrlKeyDown()) { ++ this.setSelectionPos(this.getNthWordFromPos(-1, this.getSelectionEnd())); ++ } else { ++ this.setSelectionPos(this.getSelectionEnd() - 1); ++ } ++ } else if (GuiScreen.isCtrlKeyDown()) { ++ this.setCursorPosition(this.getNthWordFromCursor(-1)); ++ } else { ++ this.moveCursorBy(-1); ++ } ++ ++ return true; ++ ++ case 205: ++ if (GuiScreen.isShiftKeyDown()) { ++ if (GuiScreen.isCtrlKeyDown()) { ++ this.setSelectionPos(this.getNthWordFromPos(1, this.getSelectionEnd())); ++ } else { ++ this.setSelectionPos(this.getSelectionEnd() + 1); ++ } ++ } else if (GuiScreen.isCtrlKeyDown()) { ++ this.setCursorPosition(this.getNthWordFromCursor(1)); ++ } else { ++ this.moveCursorBy(1); ++ } ++ ++ return true; ++ ++ case 207: ++ if (GuiScreen.isShiftKeyDown()) { ++ this.setSelectionPos(this.text.length()); ++ } else { ++ this.setCursorPositionEnd(); ++ } ++ ++ return true; ++ ++ case 211: ++ if (GuiScreen.isCtrlKeyDown()) { ++ this.deleteWords(1); ++ } else { ++ this.deleteFromCursor(1); ++ } ++ ++ return true; ++ ++ default: ++ if (ChatAllowedCharacters.isAllowedCharacter(par1)) { ++ this.writeText(Character.toString(par1)); ++ return true; ++ } else { ++ return false; ++ } + } +- } + } + } else { + return false; + } + } + +- public void mouseClicked(int var1, int var2, int var3) { +- boolean var4 = var1 >= this.xPos && var1 < this.xPos + this.width && var2 >= this.yPos && var2 < this.yPos + this.height; +- if(this.canLoseFocus) { ++ /** ++ * Args: x, y, buttonClicked ++ */ ++ public void mouseClicked(int par1, int par2, int par3) { ++ boolean var4 = par1 >= this.xPos && par1 < this.xPos + this.width && par2 >= this.yPos && par2 < this.yPos + this.height; ++ ++ if (this.canLoseFocus) { + this.setFocused(this.isEnabled && var4); + } + +- if(this.isFocused && var3 == 0) { +- int var5 = var1 - this.xPos; +- if(this.enableBackgroundDrawing) { ++ if (this.isFocused && par3 == 0) { ++ int var5 = par1 - this.xPos; ++ ++ if (this.enableBackgroundDrawing) { + var5 -= 4; + } + +- String var6 = this.fontRenderer.trimStringToWidth(this.f.substring(this.lineScrollOffset), this.getWidth()); ++ String var6 = this.fontRenderer.trimStringToWidth(this.text.substring(this.lineScrollOffset), this.getWidth()); + this.setCursorPosition(this.fontRenderer.trimStringToWidth(var6, var5).length() + this.lineScrollOffset); + } +- + } + ++ /** ++ * Draws the textbox ++ */ + public void drawTextBox() { +- if(this.getVisible()) { +- if(this.getEnableBackgroundDrawing()) { ++ if (this.getVisible()) { ++ if (this.getEnableBackgroundDrawing()) { + drawRect(this.xPos - 1, this.yPos - 1, this.xPos + this.width + 1, this.yPos + this.height + 1, -6250336); + drawRect(this.xPos, this.yPos, this.xPos + this.width, this.yPos + this.height, -16777216); + } +@@ -303,62 +396,67 @@ + int var1 = this.isEnabled ? this.enabledColor : this.disabledColor; + int var2 = this.cursorPosition - this.lineScrollOffset; + int var3 = this.selectionEnd - this.lineScrollOffset; +- String var4 = this.fontRenderer.trimStringToWidth(this.f.substring(this.lineScrollOffset), this.getWidth()); ++ String var4 = this.fontRenderer.trimStringToWidth(this.text.substring(this.lineScrollOffset), this.getWidth()); + boolean var5 = var2 >= 0 && var2 <= var4.length(); + boolean var6 = this.isFocused && this.cursorCounter / 6 % 2 == 0 && var5; + int var7 = this.enableBackgroundDrawing ? this.xPos + 4 : this.xPos; + int var8 = this.enableBackgroundDrawing ? this.yPos + (this.height - 8) / 2 : this.yPos; + int var9 = var7; +- if(var3 > var4.length()) { ++ ++ if (var3 > var4.length()) { + var3 = var4.length(); + } + +- if(var4.length() > 0) { ++ if (var4.length() > 0) { + String var10 = var5 ? var4.substring(0, var2) : var4; + var9 = this.fontRenderer.drawStringWithShadow(var10, var7, var8, var1); + } + +- boolean var13 = this.cursorPosition < this.f.length() || this.f.length() >= this.getMaxStringLength(); ++ boolean var13 = this.cursorPosition < this.text.length() || this.text.length() >= this.getMaxStringLength(); + int var11 = var9; +- if(!var5) { ++ ++ if (!var5) { + var11 = var2 > 0 ? var7 + this.width : var7; +- } else if(var13) { ++ } else if (var13) { + var11 = var9 - 1; + --var9; + } + +- if(var4.length() > 0 && var5 && var2 < var4.length()) { ++ if (var4.length() > 0 && var5 && var2 < var4.length()) { + this.fontRenderer.drawStringWithShadow(var4.substring(var2), var9, var8, var1); + } + +- if(var6) { +- if(var13) { ++ if (var6) { ++ if (var13) { + Gui.drawRect(var11, var8 - 1, var11 + 1, var8 + 1 + this.fontRenderer.FONT_HEIGHT, -3092272); + } else { + this.fontRenderer.drawStringWithShadow("_", var11, var8, var1); + } + } + +- if(var3 != var2) { ++ if (var3 != var2) { + int var12 = var7 + this.fontRenderer.getStringWidth(var4.substring(0, var3)); + this.drawCursorVertical(var11, var8 - 1, var12 - 1, var8 + 1 + this.fontRenderer.FONT_HEIGHT); + } +- + } + } + +- private void drawCursorVertical(int var1, int var2, int var3, int var4) { ++ /** ++ * draws the vertical line cursor in the textbox ++ */ ++ private void drawCursorVertical(int par1, int par2, int par3, int par4) { + int var5; +- if(var1 < var3) { +- var5 = var1; +- var1 = var3; +- var3 = var5; ++ ++ if (par1 < par3) { ++ var5 = par1; ++ par1 = par3; ++ par3 = var5; + } + +- if(var2 < var4) { +- var5 = var2; +- var2 = var4; +- var4 = var5; ++ if (par2 < par4) { ++ var5 = par2; ++ par2 = par4; ++ par4 = var5; + } + + Tessellator var6 = Tessellator.instance; +@@ -367,120 +465,161 @@ + GL11.glEnable(GL11.GL_COLOR_LOGIC_OP); + GL11.glLogicOp(GL11.GL_OR_REVERSE); + var6.startDrawingQuads(); +- var6.addVertex((double)var1, (double)var4, 0.0D); +- var6.addVertex((double)var3, (double)var4, 0.0D); +- var6.addVertex((double)var3, (double)var2, 0.0D); +- var6.addVertex((double)var1, (double)var2, 0.0D); ++ var6.addVertex((double)par1, (double)par4, 0.0D); ++ var6.addVertex((double)par3, (double)par4, 0.0D); ++ var6.addVertex((double)par3, (double)par2, 0.0D); ++ var6.addVertex((double)par1, (double)par2, 0.0D); + var6.draw(); + GL11.glDisable(GL11.GL_COLOR_LOGIC_OP); + GL11.glEnable(GL11.GL_TEXTURE_2D); + } + +- public void setMaxStringLength(int var1) { +- this.maxStringLength = var1; +- if(this.f.length() > var1) { +- this.f = this.f.substring(0, var1); ++ public void setMaxStringLength(int par1) { ++ this.maxStringLength = par1; ++ ++ if (this.text.length() > par1) { ++ this.text = this.text.substring(0, par1); + } +- + } + ++ /** ++ * returns the maximum number of character that can be contained in this textbox ++ */ + public int getMaxStringLength() { + return this.maxStringLength; + } + ++ /** ++ * returns the current position of the cursor ++ */ + public int getCursorPosition() { + return this.cursorPosition; + } + ++ /** ++ * get enable drawing background and outline ++ */ + public boolean getEnableBackgroundDrawing() { + return this.enableBackgroundDrawing; + } + +- public void setEnableBackgroundDrawing(boolean var1) { +- this.enableBackgroundDrawing = var1; +- } +- +- public void setTextColor(int var1) { +- this.enabledColor = var1; +- } +- +- public void setDisabledTextColour(int var1) { +- this.disabledColor = var1; +- } +- +- public void setFocused(boolean var1) { +- if(var1 && !this.isFocused) { ++ /** ++ * enable drawing background and outline ++ */ ++ public void setEnableBackgroundDrawing(boolean par1) { ++ this.enableBackgroundDrawing = par1; ++ } ++ ++ /** ++ * Sets the text colour for this textbox (disabled text will not use this colour) ++ */ ++ public void setTextColor(int par1) { ++ this.enabledColor = par1; ++ } ++ ++ public void setDisabledTextColour(int par1) { ++ this.disabledColor = par1; ++ } ++ ++ /** ++ * setter for the focused field ++ */ ++ public void setFocused(boolean par1) { ++ if (par1 && !this.isFocused) { + this.cursorCounter = 0; + } + +- this.isFocused = var1; ++ this.isFocused = par1; + } + ++ /** ++ * getter for the focused field ++ */ + public boolean isFocused() { + return this.isFocused; + } + +- public void setEnabled(boolean var1) { +- this.isEnabled = var1; ++ public void setEnabled(boolean par1) { ++ this.isEnabled = par1; + } + ++ /** ++ * the side of the selection that is not the cursor, maye be the same as the cursor ++ */ + public int getSelectionEnd() { + return this.selectionEnd; + } + ++ /** ++ * returns the width of the textbox depending on if the the box is enabled ++ */ + public int getWidth() { + return this.getEnableBackgroundDrawing() ? this.width - 8 : this.width; + } + +- public void setSelectionPos(int var1) { +- int var2 = this.f.length(); +- if(var1 > var2) { +- var1 = var2; +- } +- +- if(var1 < 0) { +- var1 = 0; +- } +- +- this.selectionEnd = var1; +- if(this.fontRenderer != null) { +- if(this.lineScrollOffset > var2) { ++ /** ++ * Sets the position of the selection anchor (i.e. position the selection was started at) ++ */ ++ public void setSelectionPos(int par1) { ++ int var2 = this.text.length(); ++ ++ if (par1 > var2) { ++ par1 = var2; ++ } ++ ++ if (par1 < 0) { ++ par1 = 0; ++ } ++ ++ this.selectionEnd = par1; ++ ++ if (this.fontRenderer != null) { ++ if (this.lineScrollOffset > var2) { + this.lineScrollOffset = var2; + } + + int var3 = this.getWidth(); +- String var4 = this.fontRenderer.trimStringToWidth(this.f.substring(this.lineScrollOffset), var3); ++ String var4 = this.fontRenderer.trimStringToWidth(this.text.substring(this.lineScrollOffset), var3); + int var5 = var4.length() + this.lineScrollOffset; +- if(var1 == this.lineScrollOffset) { +- this.lineScrollOffset -= this.fontRenderer.trimStringToWidth(this.f, var3, true).length(); +- } +- +- if(var1 > var5) { +- this.lineScrollOffset += var1 - var5; +- } else if(var1 <= this.lineScrollOffset) { +- this.lineScrollOffset -= this.lineScrollOffset - var1; +- } +- +- if(this.lineScrollOffset < 0) { ++ ++ if (par1 == this.lineScrollOffset) { ++ this.lineScrollOffset -= this.fontRenderer.trimStringToWidth(this.text, var3, true).length(); ++ } ++ ++ if (par1 > var5) { ++ this.lineScrollOffset += par1 - var5; ++ } else if (par1 <= this.lineScrollOffset) { ++ this.lineScrollOffset -= this.lineScrollOffset - par1; ++ } ++ ++ if (this.lineScrollOffset < 0) { + this.lineScrollOffset = 0; + } + +- if(this.lineScrollOffset > var2) { ++ if (this.lineScrollOffset > var2) { + this.lineScrollOffset = var2; + } + } +- +- } +- +- public void setCanLoseFocus(boolean var1) { +- this.canLoseFocus = var1; +- } +- ++ } ++ ++ /** ++ * if true the textbox can lose focus by clicking elsewhere on the screen ++ */ ++ public void setCanLoseFocus(boolean par1) { ++ this.canLoseFocus = par1; ++ } ++ ++ /** ++ * @return {@code true} if this textbox is visible ++ */ + public boolean getVisible() { + return this.visible; + } + +- public void setVisible(boolean var1) { +- this.visible = var1; ++ /** ++ * Sets whether or not this textbox is visible ++ */ ++ public void setVisible(boolean par1) { ++ this.visible = par1; + } + } diff --git a/patches/net/minecraft/src/GuiVideoSettings.java.patch b/patches/net/minecraft/src/GuiVideoSettings.java.patch new file mode 100644 index 0000000..fe01f43 --- /dev/null +++ b/patches/net/minecraft/src/GuiVideoSettings.java.patch @@ -0,0 +1,133 @@ +--- net/minecraft/src/GuiVideoSettings.java ++++ net/minecraft/src/GuiVideoSettings.java +@@ -2,29 +2,43 @@ + + public class GuiVideoSettings extends GuiScreen { + private GuiScreen parentGuiScreen; +- protected String a = "Video Settings"; ++ ++ /** The title string that is displayed in the top-center of the screen. */ ++ protected String screenTitle = "Video Settings"; ++ ++ /** GUI game settings */ + private GameSettings guiGameSettings; ++ ++ /** ++ * True if the system is 64-bit (using a simple indexOf test on a system property) ++ */ + private boolean is64bit; +- private static EnumOptions[] videoOptions = new EnumOptions[]{EnumOptions.GRAPHICS, EnumOptions.RENDER_DISTANCE, EnumOptions.AMBIENT_OCCLUSION, EnumOptions.FRAMERATE_LIMIT, EnumOptions.ANAGLYPH, EnumOptions.VIEW_BOBBING, EnumOptions.GUI_SCALE, EnumOptions.ADVANCED_OPENGL, EnumOptions.GAMMA, EnumOptions.RENDER_CLOUDS, EnumOptions.PARTICLES, EnumOptions.USE_SERVER_TEXTURES, EnumOptions.USE_FULLSCREEN, EnumOptions.ENABLE_VSYNC}; +- +- public GuiVideoSettings(GuiScreen var1, GameSettings var2) { +- this.parentGuiScreen = var1; +- this.guiGameSettings = var2; ++ ++ /** An array of all of EnumOption's video options. */ ++ private static EnumOptions[] videoOptions = new EnumOptions[] {EnumOptions.GRAPHICS, EnumOptions.RENDER_DISTANCE, EnumOptions.AMBIENT_OCCLUSION, EnumOptions.FRAMERATE_LIMIT, EnumOptions.ANAGLYPH, EnumOptions.VIEW_BOBBING, EnumOptions.GUI_SCALE, EnumOptions.ADVANCED_OPENGL, EnumOptions.GAMMA, EnumOptions.RENDER_CLOUDS, EnumOptions.PARTICLES, EnumOptions.USE_SERVER_TEXTURES, EnumOptions.USE_FULLSCREEN, EnumOptions.ENABLE_VSYNC}; ++ ++ public GuiVideoSettings(GuiScreen par1GuiScreen, GameSettings par2GameSettings) { ++ this.parentGuiScreen = par1GuiScreen; ++ this.guiGameSettings = par2GameSettings; + } + ++ /** ++ * Adds the buttons (and other controls) to the screen in question. ++ */ + public void initGui() { +- this.a = I18n.getString("options.videoTitle"); +- this.i.clear(); +- this.i.add(new GuiButton(200, this.width / 2 - 100, this.height / 6 + 168, I18n.getString("gui.done"))); ++ this.screenTitle = I18n.getString("options.videoTitle"); ++ this.buttonList.clear(); ++ this.buttonList.add(new GuiButton(200, this.width / 2 - 100, this.height / 6 + 168, I18n.getString("gui.done"))); + this.is64bit = false; +- String[] var1 = new String[]{"sun.arch.data.model", "com.ibm.vm.bitmode", "os.arch"}; ++ String[] var1 = new String[] {"sun.arch.data.model", "com.ibm.vm.bitmode", "os.arch"}; + String[] var2 = var1; + int var3 = var1.length; + +- for(int var4 = 0; var4 < var3; ++var4) { ++ for (int var4 = 0; var4 < var3; ++var4) { + String var5 = var2[var4]; + String var6 = System.getProperty(var5); +- if(var6 != null && var6.contains("64")) { ++ ++ if (var6 != null && var6.contains("64")) { + this.is64bit = true; + break; + } +@@ -35,50 +49,57 @@ + EnumOptions[] var9 = videoOptions; + int var10 = var9.length; + +- for(int var11 = 0; var11 < var10; ++var11) { ++ for (int var11 = 0; var11 < var10; ++var11) { + EnumOptions var7 = var9[var11]; +- if(var7.getEnumFloat()) { +- this.i.add(new GuiSlider(var7.returnEnumOrdinal(), this.width / 2 - 155 + var8 % 2 * 160, this.height / 7 + var3 + 24 * (var8 >> 1), var7, this.guiGameSettings.getKeyBinding(var7), this.guiGameSettings.getOptionFloatValue(var7))); ++ ++ if (var7.getEnumFloat()) { ++ this.buttonList.add(new GuiSlider(var7.returnEnumOrdinal(), this.width / 2 - 155 + var8 % 2 * 160, this.height / 7 + var3 + 24 * (var8 >> 1), var7, this.guiGameSettings.getKeyBinding(var7), this.guiGameSettings.getOptionFloatValue(var7))); + } else { +- this.i.add(new GuiSmallButton(var7.returnEnumOrdinal(), this.width / 2 - 155 + var8 % 2 * 160, this.height / 7 + var3 + 24 * (var8 >> 1), var7, this.guiGameSettings.getKeyBinding(var7))); ++ this.buttonList.add(new GuiSmallButton(var7.returnEnumOrdinal(), this.width / 2 - 155 + var8 % 2 * 160, this.height / 7 + var3 + 24 * (var8 >> 1), var7, this.guiGameSettings.getKeyBinding(var7))); + } + + ++var8; + } +- + } + +- protected void actionPerformed(GuiButton var1) { +- if(var1.enabled) { ++ /** ++ * Fired when a control is clicked. This is the equivalent of ActionListener.actionPerformed(ActionEvent e). ++ */ ++ protected void actionPerformed(GuiButton par1GuiButton) { ++ if (par1GuiButton.enabled) { + int var2 = this.guiGameSettings.guiScale; +- if(var1.id < 100 && var1 instanceof GuiSmallButton) { +- this.guiGameSettings.setOptionValue(((GuiSmallButton)var1).returnEnumOptions(), 1); +- var1.f = this.guiGameSettings.getKeyBinding(EnumOptions.getEnumOptions(var1.id)); ++ ++ if (par1GuiButton.id < 100 && par1GuiButton instanceof GuiSmallButton) { ++ this.guiGameSettings.setOptionValue(((GuiSmallButton)par1GuiButton).returnEnumOptions(), 1); ++ par1GuiButton.displayString = this.guiGameSettings.getKeyBinding(EnumOptions.getEnumOptions(par1GuiButton.id)); + } + +- if(var1.id == 200) { ++ if (par1GuiButton.id == 200) { + this.mc.gameSettings.saveOptions(); + this.mc.displayGuiScreen(this.parentGuiScreen); + } + +- if(this.guiGameSettings.guiScale != var2) { ++ if (this.guiGameSettings.guiScale != var2) { + ScaledResolution var3 = new ScaledResolution(this.mc.gameSettings, this.mc.displayWidth, this.mc.displayHeight); + int var4 = var3.getScaledWidth(); + int var5 = var3.getScaledHeight(); + this.setWorldAndResolution(this.mc, var4, var5); + } +- + } + } + +- public void drawScreen(int var1, int var2, float var3) { ++ /** ++ * Draws the screen and all the components in it. ++ */ ++ public void drawScreen(int par1, int par2, float par3) { + this.drawDefaultBackground(); +- this.drawCenteredString(this.fontRenderer, this.a, this.width / 2, this.is64bit ? 20 : 5, 16777215); +- if(!this.is64bit && this.guiGameSettings.renderDistance == 0) { ++ this.drawCenteredString(this.fontRenderer, this.screenTitle, this.width / 2, this.is64bit ? 20 : 5, 16777215); ++ ++ if (!this.is64bit && this.guiGameSettings.renderDistance == 0) { + this.drawCenteredString(this.fontRenderer, I18n.getString("options.farWarning1"), this.width / 2, this.height / 6 + 144 + 1, 11468800); + this.drawCenteredString(this.fontRenderer, I18n.getString("options.farWarning2"), this.width / 2, this.height / 6 + 144 + 13, 11468800); + } + +- super.drawScreen(var1, var2, var3); ++ super.drawScreen(par1, par2, par3); + } + } diff --git a/patches/net/minecraft/src/GuiWinGame.java.patch b/patches/net/minecraft/src/GuiWinGame.java.patch new file mode 100644 index 0000000..237774d --- /dev/null +++ b/patches/net/minecraft/src/GuiWinGame.java.patch @@ -0,0 +1,234 @@ +--- net/minecraft/src/GuiWinGame.java ++++ net/minecraft/src/GuiWinGame.java +@@ -11,39 +11,57 @@ + public class GuiWinGame extends GuiScreen { + private static final ResourceLocation minecraftLogoTexture = new ResourceLocation("textures/gui/title/minecraft.png"); + private static final ResourceLocation field_110361_b = new ResourceLocation("textures/misc/vignette.png"); ++ ++ /** Counts the number of screen updates. */ + private int updateCounter; +- private List d; ++ ++ /** List of lines on the ending poem and credits. */ ++ private List lines; + private int field_73989_c; + private float field_73987_d = 0.5F; + ++ /** ++ * Called from the main game loop to update the screen. ++ */ + public void updateScreen() { + ++this.updateCounter; + float var1 = (float)(this.field_73989_c + this.height + this.height + 24) / this.field_73987_d; +- if((float)this.updateCounter > var1) { +- this.respawnPlayer(); +- } +- +- } +- +- protected void keyTyped(char var1, int var2) { +- if(var2 == 1) { +- this.respawnPlayer(); +- } +- +- } +- ++ ++ if ((float)this.updateCounter > var1) { ++ this.respawnPlayer(); ++ } ++ } ++ ++ /** ++ * Fired when a key is typed. This is the equivalent of KeyListener.keyTyped(KeyEvent e). ++ */ ++ protected void keyTyped(char par1, int par2) { ++ if (par2 == 1) { ++ this.respawnPlayer(); ++ } ++ } ++ ++ /** ++ * Respawns the player. ++ */ + private void respawnPlayer() { + this.mc.thePlayer.sendQueue.addToSendQueue(new Packet205ClientCommand(1)); + this.mc.displayGuiScreen((GuiScreen)null); + } + ++ /** ++ * Returns true if this GUI should pause the game when it is displayed in single-player ++ */ + public boolean doesGuiPauseGame() { + return true; + } + ++ /** ++ * Adds the buttons (and other controls) to the screen in question. ++ */ + public void initGui() { +- if(this.d == null) { +- this.d = new ArrayList(); ++ if (this.lines == null) { ++ this.lines = new ArrayList(); + + try { + String var1 = ""; +@@ -51,65 +69,60 @@ + short var3 = 274; + BufferedReader var4 = new BufferedReader(new InputStreamReader(this.mc.getResourceManager().getResource(new ResourceLocation("texts/end.txt")).getInputStream(), Charsets.UTF_8)); + Random var5 = new Random(8124371L); +- +- while(true) { +- var1 = var4.readLine(); +- int var6; +- if(var1 == null) { +- for(var6 = 0; var6 < 8; ++var6) { +- this.d.add(""); +- } +- +- var4 = new BufferedReader(new InputStreamReader(this.mc.getResourceManager().getResource(new ResourceLocation("texts/credits.txt")).getInputStream(), Charsets.UTF_8)); +- +- while(true) { +- var1 = var4.readLine(); +- if(var1 == null) { +- this.field_73989_c = this.d.size() * 12; +- return; +- } +- +- var1 = var1.replaceAll("PLAYERNAME", this.mc.getSession().getUsername()); +- var1 = var1.replaceAll("\t", " "); +- this.d.addAll(this.mc.fontRenderer.listFormattedStringToWidth(var1, var3)); +- this.d.add(""); +- } +- } +- ++ int var6; ++ ++ while ((var1 = var4.readLine()) != null) { + String var7; + String var8; +- for(var1 = var1.replaceAll("PLAYERNAME", this.mc.getSession().getUsername()); var1.contains(var2); var1 = var7 + EnumChatFormatting.WHITE + EnumChatFormatting.OBFUSCATED + "XXXXXXXX".substring(0, var5.nextInt(4) + 3) + var8) { ++ ++ for (var1 = var1.replaceAll("PLAYERNAME", this.mc.getSession().getUsername()); var1.contains(var2); var1 = var7 + EnumChatFormatting.WHITE + EnumChatFormatting.OBFUSCATED + "XXXXXXXX".substring(0, var5.nextInt(4) + 3) + var8) { + var6 = var1.indexOf(var2); + var7 = var1.substring(0, var6); + var8 = var1.substring(var6 + var2.length()); + } + +- this.d.addAll(this.mc.fontRenderer.listFormattedStringToWidth(var1, var3)); +- this.d.add(""); +- } ++ this.lines.addAll(this.mc.fontRenderer.listFormattedStringToWidth(var1, var3)); ++ this.lines.add(""); ++ } ++ ++ for (var6 = 0; var6 < 8; ++var6) { ++ this.lines.add(""); ++ } ++ ++ var4 = new BufferedReader(new InputStreamReader(this.mc.getResourceManager().getResource(new ResourceLocation("texts/credits.txt")).getInputStream(), Charsets.UTF_8)); ++ ++ while ((var1 = var4.readLine()) != null) { ++ var1 = var1.replaceAll("PLAYERNAME", this.mc.getSession().getUsername()); ++ var1 = var1.replaceAll("\t", " "); ++ this.lines.addAll(this.mc.fontRenderer.listFormattedStringToWidth(var1, var3)); ++ this.lines.add(""); ++ } ++ ++ this.field_73989_c = this.lines.size() * 12; + } catch (Exception var9) { + var9.printStackTrace(); + } + } + } + +- private void func_73986_b(int var1, int var2, float var3) { ++ private void func_73986_b(int par1, int par2, float par3) { + Tessellator var4 = Tessellator.instance; + this.mc.getTextureManager().bindTexture(Gui.optionsBackground); + var4.startDrawingQuads(); + var4.setColorRGBA_F(1.0F, 1.0F, 1.0F, 1.0F); + int var5 = this.width; +- float var6 = 0.0F - ((float)this.updateCounter + var3) * 0.5F * this.field_73987_d; +- float var7 = (float)this.height - ((float)this.updateCounter + var3) * 0.5F * this.field_73987_d; ++ float var6 = 0.0F - ((float)this.updateCounter + par3) * 0.5F * this.field_73987_d; ++ float var7 = (float)this.height - ((float)this.updateCounter + par3) * 0.5F * this.field_73987_d; + float var8 = 0.015625F; +- float var9 = ((float)this.updateCounter + var3 - 0.0F) * 0.02F; ++ float var9 = ((float)this.updateCounter + par3 - 0.0F) * 0.02F; + float var10 = (float)(this.field_73989_c + this.height + this.height + 24) / this.field_73987_d; +- float var11 = (var10 - 20.0F - ((float)this.updateCounter + var3)) * 0.005F; +- if(var11 < var9) { ++ float var11 = (var10 - 20.0F - ((float)this.updateCounter + par3)) * 0.005F; ++ ++ if (var11 < var9) { + var9 = var11; + } + +- if(var9 > 1.0F) { ++ if (var9 > 1.0F) { + var9 = 1.0F; + } + +@@ -123,13 +136,16 @@ + var4.draw(); + } + +- public void drawScreen(int var1, int var2, float var3) { +- this.func_73986_b(var1, var2, var3); ++ /** ++ * Draws the screen and all the components in it. ++ */ ++ public void drawScreen(int par1, int par2, float par3) { ++ this.func_73986_b(par1, par2, par3); + Tessellator var4 = Tessellator.instance; + short var5 = 274; + int var6 = this.width / 2 - var5 / 2; + int var7 = this.height + 50; +- float var8 = -((float)this.updateCounter + var3) * this.field_73987_d; ++ float var8 = -((float)this.updateCounter + par3) * this.field_73987_d; + GL11.glPushMatrix(); + GL11.glTranslatef(0.0F, var8, 0.0F); + this.mc.getTextureManager().bindTexture(minecraftLogoTexture); +@@ -138,22 +154,24 @@ + this.drawTexturedModalRect(var6 + 155, var7, 0, 45, 155, 44); + var4.setColorOpaque_I(16777215); + int var9 = var7 + 200; +- + int var10; +- for(var10 = 0; var10 < this.d.size(); ++var10) { +- if(var10 == this.d.size() - 1) { ++ ++ for (var10 = 0; var10 < this.lines.size(); ++var10) { ++ if (var10 == this.lines.size() - 1) { + float var11 = (float)var9 + var8 - (float)(this.height / 2 - 6); +- if(var11 < 0.0F) { ++ ++ if (var11 < 0.0F) { + GL11.glTranslatef(0.0F, -var11, 0.0F); + } + } + +- if((float)var9 + var8 + 12.0F + 8.0F > 0.0F && (float)var9 + var8 < (float)this.height) { +- String var12 = (String)this.d.get(var10); +- if(var12.startsWith("[C]")) { ++ if ((float)var9 + var8 + 12.0F + 8.0F > 0.0F && (float)var9 + var8 < (float)this.height) { ++ String var12 = (String)this.lines.get(var10); ++ ++ if (var12.startsWith("[C]")) { + this.fontRenderer.drawStringWithShadow(var12.substring(3), var6 + (var5 - this.fontRenderer.getStringWidth(var12.substring(3))) / 2, var9, 16777215); + } else { +- this.fontRenderer.b.setSeed((long)var10 * 4238972211L + (long)(this.updateCounter / 4)); ++ this.fontRenderer.fontRandom.setSeed((long)var10 * 4238972211L + (long)(this.updateCounter / 4)); + this.fontRenderer.drawStringWithShadow(var12, var6, var9, 16777215); + } + } +@@ -175,6 +193,6 @@ + var4.addVertexWithUV(0.0D, 0.0D, (double)this.zLevel, 0.0D, 0.0D); + var4.draw(); + GL11.glDisable(GL11.GL_BLEND); +- super.drawScreen(var1, var2, var3); ++ super.drawScreen(par1, par2, par3); + } + } diff --git a/patches/net/minecraft/src/GuiWorldSlot.java.patch b/patches/net/minecraft/src/GuiWorldSlot.java.patch new file mode 100644 index 0000000..cc68663 --- /dev/null +++ b/patches/net/minecraft/src/GuiWorldSlot.java.patch @@ -0,0 +1,107 @@ +--- net/minecraft/src/GuiWorldSlot.java ++++ net/minecraft/src/GuiWorldSlot.java +@@ -5,32 +5,44 @@ + class GuiWorldSlot extends GuiSlot { + final GuiSelectWorld parentWorldGui; + +- public GuiWorldSlot(GuiSelectWorld var1) { +- super(var1.mc, var1.width, var1.height, 32, var1.height - 64, 36); +- this.parentWorldGui = var1; ++ public GuiWorldSlot(GuiSelectWorld par1GuiSelectWorld) { ++ super(par1GuiSelectWorld.mc, par1GuiSelectWorld.width, par1GuiSelectWorld.height, 32, par1GuiSelectWorld.height - 64, 36); ++ this.parentWorldGui = par1GuiSelectWorld; + } + ++ /** ++ * Gets the size of the current slot list. ++ */ + protected int getSize() { + return GuiSelectWorld.getSize(this.parentWorldGui).size(); + } + +- protected void elementClicked(int var1, boolean var2) { +- GuiSelectWorld.onElementSelected(this.parentWorldGui, var1); ++ /** ++ * the element in the slot that was clicked, boolean for wether it was double clicked or not ++ */ ++ protected void elementClicked(int par1, boolean par2) { ++ GuiSelectWorld.onElementSelected(this.parentWorldGui, par1); + boolean var3 = GuiSelectWorld.getSelectedWorld(this.parentWorldGui) >= 0 && GuiSelectWorld.getSelectedWorld(this.parentWorldGui) < this.getSize(); + GuiSelectWorld.getSelectButton(this.parentWorldGui).enabled = var3; + GuiSelectWorld.getRenameButton(this.parentWorldGui).enabled = var3; + GuiSelectWorld.getDeleteButton(this.parentWorldGui).enabled = var3; + GuiSelectWorld.func_82312_f(this.parentWorldGui).enabled = var3; +- if(var2 && var3) { +- this.parentWorldGui.selectWorld(var1); ++ ++ if (par2 && var3) { ++ this.parentWorldGui.selectWorld(par1); + } +- +- } +- +- protected boolean isSelected(int var1) { +- return var1 == GuiSelectWorld.getSelectedWorld(this.parentWorldGui); +- } +- ++ } ++ ++ /** ++ * returns true if the element passed in is currently selected ++ */ ++ protected boolean isSelected(int par1) { ++ return par1 == GuiSelectWorld.getSelectedWorld(this.parentWorldGui); ++ } ++ ++ /** ++ * return the height of the content being scrolled ++ */ + protected int getContentHeight() { + return GuiSelectWorld.getSize(this.parentWorldGui).size() * 36; + } +@@ -39,32 +51,35 @@ + this.parentWorldGui.drawDefaultBackground(); + } + +- protected void drawSlot(int var1, int var2, int var3, int var4, Tessellator var5) { +- SaveFormatComparator var6 = (SaveFormatComparator)GuiSelectWorld.getSize(this.parentWorldGui).get(var1); ++ protected void drawSlot(int par1, int par2, int par3, int par4, Tessellator par5Tessellator) { ++ SaveFormatComparator var6 = (SaveFormatComparator)GuiSelectWorld.getSize(this.parentWorldGui).get(par1); + String var7 = var6.getDisplayName(); +- if(var7 == null || MathHelper.stringNullOrLengthZero(var7)) { +- var7 = GuiSelectWorld.func_82313_g(this.parentWorldGui) + " " + (var1 + 1); ++ ++ if (var7 == null || MathHelper.stringNullOrLengthZero(var7)) { ++ var7 = GuiSelectWorld.func_82313_g(this.parentWorldGui) + " " + (par1 + 1); + } + + String var8 = var6.getFileName(); + var8 = var8 + " (" + GuiSelectWorld.func_82315_h(this.parentWorldGui).format(new Date(var6.getLastTimePlayed())); + var8 = var8 + ")"; + String var9 = ""; +- if(var6.requiresConversion()) { ++ ++ if (var6.requiresConversion()) { + var9 = GuiSelectWorld.func_82311_i(this.parentWorldGui) + " " + var9; + } else { + var9 = GuiSelectWorld.func_82314_j(this.parentWorldGui)[var6.getEnumGameType().getID()]; +- if(var6.isHardcoreModeEnabled()) { ++ ++ if (var6.isHardcoreModeEnabled()) { + var9 = EnumChatFormatting.DARK_RED + I18n.getString("gameMode.hardcore") + EnumChatFormatting.RESET; + } + +- if(var6.getCheatsEnabled()) { ++ if (var6.getCheatsEnabled()) { + var9 = var9 + ", " + I18n.getString("selectWorld.cheats"); + } + } + +- this.parentWorldGui.drawString(this.parentWorldGui.fontRenderer, var7, var2 + 2, var3 + 1, 16777215); +- this.parentWorldGui.drawString(this.parentWorldGui.fontRenderer, var8, var2 + 2, var3 + 12, 8421504); +- this.parentWorldGui.drawString(this.parentWorldGui.fontRenderer, var9, var2 + 2, var3 + 12 + 10, 8421504); ++ this.parentWorldGui.drawString(this.parentWorldGui.fontRenderer, var7, par2 + 2, par3 + 1, 16777215); ++ this.parentWorldGui.drawString(this.parentWorldGui.fontRenderer, var8, par2 + 2, par3 + 12, 8421504); ++ this.parentWorldGui.drawString(this.parentWorldGui.fontRenderer, var9, par2 + 2, par3 + 12 + 10, 8421504); + } + } diff --git a/patches/net/minecraft/src/GuiYesNo.java.patch b/patches/net/minecraft/src/GuiYesNo.java.patch new file mode 100644 index 0000000..42e52ed --- /dev/null +++ b/patches/net/minecraft/src/GuiYesNo.java.patch @@ -0,0 +1,104 @@ +--- net/minecraft/src/GuiYesNo.java ++++ net/minecraft/src/GuiYesNo.java +@@ -1,44 +1,67 @@ + package net.minecraft.src; + + public class GuiYesNo extends GuiScreen { ++ ++ /** ++ * A reference to the screen object that created this. Used for navigating between screens. ++ */ + protected GuiScreen parentScreen; +- protected String b; +- private String p; +- protected String c; +- protected String d; ++ ++ /** First line of text. */ ++ protected String message1; ++ ++ /** Second line of text. */ ++ private String message2; ++ ++ /** The text shown for the first button in GuiYesNo */ ++ protected String buttonText1; ++ ++ /** The text shown for the second button in GuiYesNo */ ++ protected String buttonText2; ++ ++ /** World number to be deleted. */ + protected int worldNumber; + +- public GuiYesNo(GuiScreen var1, String var2, String var3, int var4) { +- this.parentScreen = var1; +- this.b = var2; +- this.p = var3; +- this.worldNumber = var4; +- this.c = I18n.getString("gui.yes"); +- this.d = I18n.getString("gui.no"); +- } +- +- public GuiYesNo(GuiScreen var1, String var2, String var3, String var4, String var5, int var6) { +- this.parentScreen = var1; +- this.b = var2; +- this.p = var3; +- this.c = var4; +- this.d = var5; +- this.worldNumber = var6; +- } +- ++ public GuiYesNo(GuiScreen par1GuiScreen, String par2Str, String par3Str, int par4) { ++ this.parentScreen = par1GuiScreen; ++ this.message1 = par2Str; ++ this.message2 = par3Str; ++ this.worldNumber = par4; ++ this.buttonText1 = I18n.getString("gui.yes"); ++ this.buttonText2 = I18n.getString("gui.no"); ++ } ++ ++ public GuiYesNo(GuiScreen par1GuiScreen, String par2Str, String par3Str, String par4Str, String par5Str, int par6) { ++ this.parentScreen = par1GuiScreen; ++ this.message1 = par2Str; ++ this.message2 = par3Str; ++ this.buttonText1 = par4Str; ++ this.buttonText2 = par5Str; ++ this.worldNumber = par6; ++ } ++ ++ /** ++ * Adds the buttons (and other controls) to the screen in question. ++ */ + public void initGui() { +- this.i.add(new GuiSmallButton(0, this.width / 2 - 155, this.height / 6 + 96, this.c)); +- this.i.add(new GuiSmallButton(1, this.width / 2 - 155 + 160, this.height / 6 + 96, this.d)); +- } +- +- protected void actionPerformed(GuiButton var1) { +- this.parentScreen.confirmClicked(var1.id == 0, this.worldNumber); +- } +- +- public void drawScreen(int var1, int var2, float var3) { ++ this.buttonList.add(new GuiSmallButton(0, this.width / 2 - 155, this.height / 6 + 96, this.buttonText1)); ++ this.buttonList.add(new GuiSmallButton(1, this.width / 2 - 155 + 160, this.height / 6 + 96, this.buttonText2)); ++ } ++ ++ /** ++ * Fired when a control is clicked. This is the equivalent of ActionListener.actionPerformed(ActionEvent e). ++ */ ++ protected void actionPerformed(GuiButton par1GuiButton) { ++ this.parentScreen.confirmClicked(par1GuiButton.id == 0, this.worldNumber); ++ } ++ ++ /** ++ * Draws the screen and all the components in it. ++ */ ++ public void drawScreen(int par1, int par2, float par3) { + this.drawDefaultBackground(); +- this.drawCenteredString(this.fontRenderer, this.b, this.width / 2, 70, 16777215); +- this.drawCenteredString(this.fontRenderer, this.p, this.width / 2, 90, 16777215); +- super.drawScreen(var1, var2, var3); ++ this.drawCenteredString(this.fontRenderer, this.message1, this.width / 2, 70, 16777215); ++ this.drawCenteredString(this.fontRenderer, this.message2, this.width / 2, 90, 16777215); ++ super.drawScreen(par1, par2, par3); + } + } diff --git a/patches/net/minecraft/src/Hopper.java.patch b/patches/net/minecraft/src/Hopper.java.patch new file mode 100644 index 0000000..aa969c8 --- /dev/null +++ b/patches/net/minecraft/src/Hopper.java.patch @@ -0,0 +1,27 @@ +--- net/minecraft/src/Hopper.java ++++ net/minecraft/src/Hopper.java +@@ -1,11 +1,24 @@ + package net.minecraft.src; + + public interface Hopper extends IInventory { ++ ++ /** ++ * Returns the worldObj for this tileEntity. ++ */ + World getWorldObj(); + ++ /** ++ * Gets the world X position for this hopper entity. ++ */ + double getXPos(); + ++ /** ++ * Gets the world Y position for this hopper entity. ++ */ + double getYPos(); + ++ /** ++ * Gets the world Z position for this hopper entity. ++ */ + double getZPos(); + } diff --git a/patches/net/minecraft/src/HttpUtil.java.patch b/patches/net/minecraft/src/HttpUtil.java.patch new file mode 100644 index 0000000..38284e6 --- /dev/null +++ b/patches/net/minecraft/src/HttpUtil.java.patch @@ -0,0 +1,130 @@ +--- net/minecraft/src/HttpUtil.java ++++ net/minecraft/src/HttpUtil.java +@@ -18,13 +18,18 @@ + import net.minecraft.server.MinecraftServer; + + public class HttpUtil { +- public static String buildPostString(Map var0) { ++ ++ /** ++ * Builds an encoded HTTP POST content string from a string map ++ */ ++ public static String buildPostString(Map par0Map) { + StringBuilder var1 = new StringBuilder(); +- Iterator var2 = var0.entrySet().iterator(); ++ Iterator var2 = par0Map.entrySet().iterator(); + +- while(var2.hasNext()) { ++ while (var2.hasNext()) { + Entry var3 = (Entry)var2.next(); +- if(var1.length() > 0) { ++ ++ if (var1.length() > 0) { + var1.append('&'); + } + +@@ -34,7 +39,7 @@ + var6.printStackTrace(); + } + +- if(var3.getValue() != null) { ++ if (var3.getValue() != null) { + var1.append('='); + + try { +@@ -48,48 +53,53 @@ + return var1.toString(); + } + +- public static String sendPost(ILogAgent var0, URL var1, Map var2, boolean var3) { +- return sendPost(var0, var1, buildPostString(var2), var3); ++ /** ++ * Sends a HTTP POST request to the given URL with data from a map ++ */ ++ public static String sendPost(ILogAgent par0ILogAgent, URL par1URL, Map par2Map, boolean par3) { ++ return sendPost(par0ILogAgent, par1URL, buildPostString(par2Map), par3); + } + +- private static String sendPost(ILogAgent var0, URL var1, String var2, boolean var3) { ++ /** ++ * Sends a HTTP POST request to the given URL with data from a string ++ */ ++ private static String sendPost(ILogAgent par0ILogAgent, URL par1URL, String par2Str, boolean par3) { + try { + Proxy var4 = MinecraftServer.getServer() == null ? null : MinecraftServer.getServer().getServerProxy(); +- if(var4 == null) { ++ ++ if (var4 == null) { + var4 = Proxy.NO_PROXY; + } + +- HttpURLConnection var5 = (HttpURLConnection)var1.openConnection(var4); ++ HttpURLConnection var5 = (HttpURLConnection)par1URL.openConnection(var4); + var5.setRequestMethod("POST"); + var5.setRequestProperty("Content-Type", "application/x-www-form-urlencoded"); +- var5.setRequestProperty("Content-Length", "" + var2.getBytes().length); ++ var5.setRequestProperty("Content-Length", "" + par2Str.getBytes().length); + var5.setRequestProperty("Content-Language", "en-US"); + var5.setUseCaches(false); + var5.setDoInput(true); + var5.setDoOutput(true); + DataOutputStream var6 = new DataOutputStream(var5.getOutputStream()); +- var6.writeBytes(var2); ++ var6.writeBytes(par2Str); + var6.flush(); + var6.close(); + BufferedReader var7 = new BufferedReader(new InputStreamReader(var5.getInputStream())); + StringBuffer var9 = new StringBuffer(); +- +- while(true) { +- String var8 = var7.readLine(); +- if(var8 == null) { +- var7.close(); +- return var9.toString(); +- } +- ++ String var8; ++ ++ while ((var8 = var7.readLine()) != null) { + var9.append(var8); + var9.append('\r'); + } ++ ++ var7.close(); ++ return var9.toString(); + } catch (Exception var10) { +- if(!var3) { +- if(var0 != null) { +- var0.logSevereException("Could not post to " + var1, var10); ++ if (!par3) { ++ if (par0ILogAgent != null) { ++ par0ILogAgent.logSevereException("Could not post to " + par1URL, var10); + } else { +- Logger.getAnonymousLogger().log(Level.SEVERE, "Could not post to " + var1, var10); ++ Logger.getAnonymousLogger().log(Level.SEVERE, "Could not post to " + par1URL, var10); + } + } + +@@ -100,19 +110,19 @@ + public static int func_76181_a() throws IOException { + ServerSocket var0 = null; + boolean var1 = true; +- + int var10; ++ + try { + var0 = new ServerSocket(0); + var10 = var0.getLocalPort(); + } finally { + try { +- if(var0 != null) { ++ if (var0 != null) { + var0.close(); + } + } catch (IOException var8) { ++ ; + } +- + } + + return var10; diff --git a/patches/net/minecraft/src/I18n.java.patch b/patches/net/minecraft/src/I18n.java.patch new file mode 100644 index 0000000..0eb3730 --- /dev/null +++ b/patches/net/minecraft/src/I18n.java.patch @@ -0,0 +1,28 @@ +--- net/minecraft/src/I18n.java ++++ net/minecraft/src/I18n.java +@@ -3,15 +3,15 @@ + public class I18n { + private static Locale i18nLocale; + +- static void setLocale(Locale var0) { +- i18nLocale = var0; +- } +- +- public static String getString(String var0) { +- return i18nLocale.translateKey(var0); +- } +- +- public static String getStringParams(String var0, Object... var1) { +- return i18nLocale.formatMessage(var0, var1); ++ static void setLocale(Locale par0Locale) { ++ i18nLocale = par0Locale; ++ } ++ ++ public static String getString(String par0Str) { ++ return i18nLocale.translateKey(par0Str); ++ } ++ ++ public static String getStringParams(String par0Str, Object ... par1ArrayOfObj) { ++ return i18nLocale.formatMessage(par0Str, par1ArrayOfObj); + } + } diff --git a/patches/net/minecraft/src/IAdminCommand.java.patch b/patches/net/minecraft/src/IAdminCommand.java.patch new file mode 100644 index 0000000..1b39331 --- /dev/null +++ b/patches/net/minecraft/src/IAdminCommand.java.patch @@ -0,0 +1,14 @@ +--- net/minecraft/src/IAdminCommand.java ++++ net/minecraft/src/IAdminCommand.java +@@ -1,5 +1,10 @@ + package net.minecraft.src; + + public interface IAdminCommand { +- void notifyAdmins(ICommandSender var1, int var2, String var3, Object... var4); ++ ++ /** ++ * Sends a message to the admins of the server from a given CommandSender with the given resource string and given ++ * extra srings. If the int par2 is even or zero, the original sender is also notified. ++ */ ++ void notifyAdmins(ICommandSender var1, int var2, String var3, Object ... var4); + } diff --git a/patches/net/minecraft/src/IBehaviorDispenseItem.java.patch b/patches/net/minecraft/src/IBehaviorDispenseItem.java.patch new file mode 100644 index 0000000..51fe073 --- /dev/null +++ b/patches/net/minecraft/src/IBehaviorDispenseItem.java.patch @@ -0,0 +1,11 @@ +--- net/minecraft/src/IBehaviorDispenseItem.java ++++ net/minecraft/src/IBehaviorDispenseItem.java +@@ -3,5 +3,8 @@ + public interface IBehaviorDispenseItem { + IBehaviorDispenseItem itemDispenseBehaviorProvider = new BehaviorDispenseItemProvider(); + ++ /** ++ * Dispenses the specified ItemStack from a dispenser. ++ */ + ItemStack dispense(IBlockSource var1, ItemStack var2); + } diff --git a/patches/net/minecraft/src/IBlockAccess.java.patch b/patches/net/minecraft/src/IBlockAccess.java.patch new file mode 100644 index 0000000..007daf4 --- /dev/null +++ b/patches/net/minecraft/src/IBlockAccess.java.patch @@ -0,0 +1,93 @@ +--- net/minecraft/src/IBlockAccess.java ++++ net/minecraft/src/IBlockAccess.java +@@ -1,35 +1,90 @@ + package net.minecraft.src; + + public interface IBlockAccess { ++ ++ /** ++ * Returns the block ID at coords x,y,z ++ */ + int getBlockId(int var1, int var2, int var3); + ++ /** ++ * Returns the TileEntity associated with a given block in X,Y,Z coordinates, or null if no TileEntity exists ++ */ + TileEntity getBlockTileEntity(int var1, int var2, int var3); + ++ /** ++ * Any Light rendered on a 1.8 Block goes through here ++ */ + int getLightBrightnessForSkyBlocks(int var1, int var2, int var3, int var4); + + float getBrightness(int var1, int var2, int var3, int var4); + ++ /** ++ * Returns how bright the block is shown as which is the block's light value looked up in a lookup table (light values ++ * aren't linear for brightness). Args: x, y, z ++ */ + float getLightBrightness(int var1, int var2, int var3); + ++ /** ++ * Returns the block metadata at coords x,y,z ++ */ + int getBlockMetadata(int var1, int var2, int var3); + ++ /** ++ * Returns the block's material. ++ */ + Material getBlockMaterial(int var1, int var2, int var3); + ++ /** ++ * Returns true if the block at the specified coordinates is an opaque cube. Args: x, y, z ++ */ + boolean isBlockOpaqueCube(int var1, int var2, int var3); + ++ /** ++ * Indicate if a material is a normal solid opaque cube. ++ */ + boolean isBlockNormalCube(int var1, int var2, int var3); + ++ /** ++ * Returns true if the block at the specified coordinates is empty ++ */ + boolean isAirBlock(int var1, int var2, int var3); + ++ /** ++ * Gets the biome for a given set of x/z coordinates ++ */ + BiomeGenBase getBiomeGenForCoords(int var1, int var2); + ++ /** ++ * Returns current world height. ++ */ + int getHeight(); + ++ /** ++ * set by !chunk.getAreLevelsEmpty ++ */ + boolean extendedLevelsInChunkCache(); + ++ /** ++ * Returns true if the block at the given coordinate has a solid (buildable) top surface. ++ */ + boolean doesBlockHaveSolidTopSurface(int var1, int var2, int var3); + ++ /** ++ * Return the Vec3Pool object for this world. ++ */ + Vec3Pool getWorldVec3Pool(); + ++ /** ++ * Is this block powering in the specified direction Args: x, y, z, direction ++ */ + int isBlockProvidingPowerTo(int var1, int var2, int var3, int var4); ++ ++ // Spout Start ++ public int getGrassColorCache(int x, int y, int z); ++ public void setGrassColorCache(int x, int y, int z, int color); ++ public int getWaterColorCache(int x, int y, int z); ++ public void setWaterColorCache(int x, int y, int z, int color); ++ public WorldChunkManager getWorldChunkManager(); ++ // Spout End + } diff --git a/patches/net/minecraft/src/IBossDisplayData.java.patch b/patches/net/minecraft/src/IBossDisplayData.java.patch new file mode 100644 index 0000000..17da194 --- /dev/null +++ b/patches/net/minecraft/src/IBossDisplayData.java.patch @@ -0,0 +1,11 @@ +--- net/minecraft/src/IBossDisplayData.java ++++ net/minecraft/src/IBossDisplayData.java +@@ -5,5 +5,8 @@ + + float getHealth(); + ++ /** ++ * Gets the username of the entity. ++ */ + String getEntityName(); + } diff --git a/patches/net/minecraft/src/ICamera.java.patch b/patches/net/minecraft/src/ICamera.java.patch new file mode 100644 index 0000000..1752664 --- /dev/null +++ b/patches/net/minecraft/src/ICamera.java.patch @@ -0,0 +1,13 @@ +--- net/minecraft/src/ICamera.java ++++ net/minecraft/src/ICamera.java +@@ -1,6 +1,10 @@ + package net.minecraft.src; + + public interface ICamera { ++ ++ /** ++ * Returns true if the bounding box is inside all 6 clipping planes, otherwise returns false. ++ */ + boolean isBoundingBoxInFrustum(AxisAlignedBB var1); + + void setPosition(double var1, double var3, double var5); diff --git a/patches/net/minecraft/src/IChunkLoader.java.patch b/patches/net/minecraft/src/IChunkLoader.java.patch new file mode 100644 index 0000000..6a05046 --- /dev/null +++ b/patches/net/minecraft/src/IChunkLoader.java.patch @@ -0,0 +1,32 @@ +--- net/minecraft/src/IChunkLoader.java ++++ net/minecraft/src/IChunkLoader.java +@@ -3,13 +3,28 @@ + import java.io.IOException; + + public interface IChunkLoader { ++ ++ /** ++ * Loads the specified(XZ) chunk into the specified world. ++ */ + Chunk loadChunk(World var1, int var2, int var3) throws IOException; + +- void saveChunk(World var1, Chunk var2) throws IOException, MinecraftException; ++ void saveChunk(World var1, Chunk var2) throws MinecraftException, IOException; + ++ /** ++ * Save extra data associated with this Chunk not normally saved during autosave, only during chunk unload. Currently ++ * unused. ++ */ + void saveExtraChunkData(World var1, Chunk var2); + ++ /** ++ * Called every World.tick() ++ */ + void chunkTick(); + ++ /** ++ * Save extra data not associated with any Chunk. Not saved during autosave, only during world unload. Currently ++ * unused. ++ */ + void saveExtraData(); + } diff --git a/patches/net/minecraft/src/IChunkProvider.java.patch b/patches/net/minecraft/src/IChunkProvider.java.patch new file mode 100644 index 0000000..47493e7 --- /dev/null +++ b/patches/net/minecraft/src/IChunkProvider.java.patch @@ -0,0 +1,69 @@ +--- net/minecraft/src/IChunkProvider.java ++++ net/minecraft/src/IChunkProvider.java +@@ -3,29 +3,66 @@ + import java.util.List; + + public interface IChunkProvider { ++ ++ /** ++ * Checks to see if a chunk exists at x, y ++ */ + boolean chunkExists(int var1, int var2); + ++ /** ++ * Will return back a chunk, if it doesn't exist and its not a MP client it will generates all the blocks for the ++ * specified chunk from the map seed and chunk seed ++ */ + Chunk provideChunk(int var1, int var2); + ++ /** ++ * loads or generates the chunk at the chunk location specified ++ */ + Chunk loadChunk(int var1, int var2); + ++ /** ++ * Populates chunk with ores etc etc ++ */ + void populate(IChunkProvider var1, int var2, int var3); + ++ /** ++ * Two modes of operation: if passed true, save all Chunks in one go. If passed false, save up to two chunks. Return ++ * true if all chunks have been saved. ++ */ + boolean saveChunks(boolean var1, IProgressUpdate var2); + ++ /** ++ * Unloads chunks that are marked to be unloaded. This is not guaranteed to unload every such chunk. ++ */ + boolean unloadQueuedChunks(); + ++ /** ++ * Returns if the IChunkProvider supports saving. ++ */ + boolean canSave(); + ++ /** ++ * Converts the instance data to a readable string. ++ */ + String makeString(); + ++ /** ++ * Returns a list of creatures of the specified type that can spawn at the given location. ++ */ + List getPossibleCreatures(EnumCreatureType var1, int var2, int var3, int var4); + ++ /** ++ * Returns the location of the closest structure of the specified type. If not found returns null. ++ */ + ChunkPosition findClosestStructure(World var1, String var2, int var3, int var4, int var5); + + int getLoadedChunkCount(); + + void recreateStructures(int var1, int var2); + ++ /** ++ * Save extra data not associated with any Chunk. Not saved during autosave, only during world unload. Currently ++ * unimplemented. ++ */ + void saveExtraData(); + } diff --git a/patches/net/minecraft/src/ICommand.java.patch b/patches/net/minecraft/src/ICommand.java.patch new file mode 100644 index 0000000..2eeff0b --- /dev/null +++ b/patches/net/minecraft/src/ICommand.java.patch @@ -0,0 +1,21 @@ +--- net/minecraft/src/ICommand.java ++++ net/minecraft/src/ICommand.java +@@ -11,9 +11,18 @@ + + void processCommand(ICommandSender var1, String[] var2); + ++ /** ++ * Returns true if the given command sender is allowed to use this command. ++ */ + boolean canCommandSenderUseCommand(ICommandSender var1); + ++ /** ++ * Adds the strings available in this command to the given list of tab completion options. ++ */ + List addTabCompletionOptions(ICommandSender var1, String[] var2); + ++ /** ++ * Return whether the specified command parameter index is a username parameter. ++ */ + boolean isUsernameIndex(String[] var1, int var2); + } diff --git a/patches/net/minecraft/src/ICommandManager.java.patch b/patches/net/minecraft/src/ICommandManager.java.patch new file mode 100644 index 0000000..c1b55d6 --- /dev/null +++ b/patches/net/minecraft/src/ICommandManager.java.patch @@ -0,0 +1,21 @@ +--- net/minecraft/src/ICommandManager.java ++++ net/minecraft/src/ICommandManager.java +@@ -6,9 +6,18 @@ + public interface ICommandManager { + int executeCommand(ICommandSender var1, String var2); + ++ /** ++ * Performs a "begins with" string match on each token in par2. Only returns commands that par1 can use. ++ */ + List getPossibleCommands(ICommandSender var1, String var2); + ++ /** ++ * returns all commands that the commandSender can use ++ */ + List getPossibleCommands(ICommandSender var1); + ++ /** ++ * returns a map of string to commads. All commands are returned, not just ones which someone has permission to use. ++ */ + Map getCommands(); + } diff --git a/patches/net/minecraft/src/ICommandSender.java.patch b/patches/net/minecraft/src/ICommandSender.java.patch new file mode 100644 index 0000000..9f43c73 --- /dev/null +++ b/patches/net/minecraft/src/ICommandSender.java.patch @@ -0,0 +1,27 @@ +--- net/minecraft/src/ICommandSender.java ++++ net/minecraft/src/ICommandSender.java +@@ -1,13 +1,23 @@ + package net.minecraft.src; + + public interface ICommandSender { ++ ++ /** ++ * Gets the name of this command sender (usually username, but possibly "Rcon") ++ */ + String getCommandSenderName(); + + void sendChatToPlayer(ChatMessageComponent var1); + ++ /** ++ * Returns true if the command sender is allowed to use the given command. ++ */ + boolean canCommandSenderUseCommand(int var1, String var2); + +- ChunkCoordinates getCommandSenderPosition(); ++ /** ++ * Return the position for this command sender. ++ */ ++ ChunkCoordinates getPlayerCoordinates(); + + World getEntityWorld(); + } diff --git a/patches/net/minecraft/src/ICrafting.java.patch b/patches/net/minecraft/src/ICrafting.java.patch new file mode 100644 index 0000000..5b5917c --- /dev/null +++ b/patches/net/minecraft/src/ICrafting.java.patch @@ -0,0 +1,22 @@ +--- net/minecraft/src/ICrafting.java ++++ net/minecraft/src/ICrafting.java +@@ -3,9 +3,18 @@ + import java.util.List; + + public interface ICrafting { +- void updateCraftingInventory(Container var1, List var2); ++ void sendContainerAndContentsToPlayer(Container var1, List var2); + ++ /** ++ * Sends the contents of an inventory slot to the client-side Container. This doesn't have to match the actual contents ++ * of that slot. Args: Container, slot number, slot contents ++ */ + void sendSlotContents(Container var1, int var2, ItemStack var3); + ++ /** ++ * Sends two ints to the client-side Container. Used for furnace burning time, smelting progress, brewing progress, and ++ * enchanting level. Normally the first int identifies which variable to update, and the second contains the new value. ++ * Both are truncated to shorts in non-local SMP. ++ */ + void sendProgressBarUpdate(Container var1, int var2, int var3); + } diff --git a/patches/net/minecraft/src/IEnchantmentModifier.java.patch b/patches/net/minecraft/src/IEnchantmentModifier.java.patch new file mode 100644 index 0000000..ff34484 --- /dev/null +++ b/patches/net/minecraft/src/IEnchantmentModifier.java.patch @@ -0,0 +1,12 @@ +--- net/minecraft/src/IEnchantmentModifier.java ++++ net/minecraft/src/IEnchantmentModifier.java +@@ -1,5 +1,9 @@ + package net.minecraft.src; + + interface IEnchantmentModifier { ++ ++ /** ++ * Generic method use to calculate modifiers of offensive or defensive enchantment values. ++ */ + void calculateModifier(Enchantment var1, int var2); + } diff --git a/patches/net/minecraft/src/IEntitySelector.java.patch b/patches/net/minecraft/src/IEntitySelector.java.patch new file mode 100644 index 0000000..27b18a0 --- /dev/null +++ b/patches/net/minecraft/src/IEntitySelector.java.patch @@ -0,0 +1,11 @@ +--- net/minecraft/src/IEntitySelector.java ++++ net/minecraft/src/IEntitySelector.java +@@ -4,5 +4,8 @@ + IEntitySelector selectAnything = new EntitySelectorAlive(); + IEntitySelector selectInventories = new EntitySelectorInventory(); + ++ /** ++ * Return whether the specified entity is applicable to this filter. ++ */ + boolean isEntityApplicable(Entity var1); + } diff --git a/patches/net/minecraft/src/IInvBasic.java.patch b/patches/net/minecraft/src/IInvBasic.java.patch new file mode 100644 index 0000000..025b681 --- /dev/null +++ b/patches/net/minecraft/src/IInvBasic.java.patch @@ -0,0 +1,12 @@ +--- net/minecraft/src/IInvBasic.java ++++ net/minecraft/src/IInvBasic.java +@@ -1,5 +1,9 @@ + package net.minecraft.src; + + public interface IInvBasic { ++ ++ /** ++ * Called by InventoryBasic.onInventoryChanged() on a array that is never filled. ++ */ + void onInventoryChanged(InventoryBasic var1); + } diff --git a/patches/net/minecraft/src/IInventory.java.patch b/patches/net/minecraft/src/IInventory.java.patch new file mode 100644 index 0000000..2a611c4 --- /dev/null +++ b/patches/net/minecraft/src/IInventory.java.patch @@ -0,0 +1,70 @@ +--- net/minecraft/src/IInventory.java ++++ net/minecraft/src/IInventory.java +@@ -1,29 +1,67 @@ + package net.minecraft.src; + + public interface IInventory { ++ ++ /** ++ * Returns the number of slots in the inventory. ++ */ + int getSizeInventory(); + ++ /** ++ * Returns the stack in slot i ++ */ + ItemStack getStackInSlot(int var1); + ++ /** ++ * Removes from an inventory slot (first arg) up to a specified number (second arg) of items and returns them in a new ++ * stack. ++ */ + ItemStack decrStackSize(int var1, int var2); + ++ /** ++ * When some containers are closed they call this on each slot, then drop whatever it returns as an EntityItem - like ++ * when you close a workbench GUI. ++ */ + ItemStack getStackInSlotOnClosing(int var1); + ++ /** ++ * Sets the given item stack to the specified slot in the inventory (can be crafting or armor sections). ++ */ + void setInventorySlotContents(int var1, ItemStack var2); + ++ /** ++ * Returns the name of the inventory. ++ */ + String getInvName(); + ++ /** ++ * If this returns false, the inventory name will be used as an unlocalized name, and translated into the player's ++ * language. Otherwise it will be used directly. ++ */ + boolean isInvNameLocalized(); + ++ /** ++ * Returns the maximum stack size for a inventory slot. Seems to always be 64, possibly will be extended. *Isn't this ++ * more of a set than a get?* ++ */ + int getInventoryStackLimit(); + ++ /** ++ * Called when an the contents of an Inventory change, usually ++ */ + void onInventoryChanged(); + ++ /** ++ * Do not make give this method the name canInteractWith because it clashes with Container ++ */ + boolean isUseableByPlayer(EntityPlayer var1); + + void openChest(); + + void closeChest(); + ++ /** ++ * Returns true if automation is allowed to insert the given stack (ignoring stack size) into the given slot. ++ */ + boolean isItemValidForSlot(int var1, ItemStack var2); + } diff --git a/patches/net/minecraft/src/ILogAgent.java.patch b/patches/net/minecraft/src/ILogAgent.java.patch new file mode 100644 index 0000000..db40af5 --- /dev/null +++ b/patches/net/minecraft/src/ILogAgent.java.patch @@ -0,0 +1,11 @@ +--- net/minecraft/src/ILogAgent.java ++++ net/minecraft/src/ILogAgent.java +@@ -5,7 +5,7 @@ + + void logWarning(String var1); + +- void logWarningFormatted(String var1, Object... var2); ++ void logWarningFormatted(String var1, Object ... var2); + + void logWarningException(String var1, Throwable var2); + diff --git a/patches/net/minecraft/src/IMob.java.patch b/patches/net/minecraft/src/IMob.java.patch new file mode 100644 index 0000000..5f9ace0 --- /dev/null +++ b/patches/net/minecraft/src/IMob.java.patch @@ -0,0 +1,10 @@ +--- net/minecraft/src/IMob.java ++++ net/minecraft/src/IMob.java +@@ -1,5 +1,7 @@ + package net.minecraft.src; + + public interface IMob extends IAnimals { ++ ++ /** Entity selector for IMob types. */ + IEntitySelector mobSelector = new FilterIMob(); + } diff --git a/patches/net/minecraft/src/INetworkManager.java.patch b/patches/net/minecraft/src/INetworkManager.java.patch new file mode 100644 index 0000000..6942c2f --- /dev/null +++ b/patches/net/minecraft/src/INetworkManager.java.patch @@ -0,0 +1,53 @@ +--- net/minecraft/src/INetworkManager.java ++++ net/minecraft/src/INetworkManager.java +@@ -3,21 +3,47 @@ + import java.net.SocketAddress; + + public interface INetworkManager { ++ ++ /** ++ * Sets the NetHandler for this NetworkManager. Server-only. ++ */ + void setNetHandler(NetHandler var1); + ++ /** ++ * Adds the packet to the correct send queue (chunk data packets go to a separate queue). ++ */ + void addToSendQueue(Packet var1); + ++ /** ++ * Wakes reader and writer threads ++ */ + void wakeThreads(); + ++ /** ++ * Checks timeouts and processes all pending read packets. ++ */ + void processReadPackets(); + +- SocketAddress getRemoteAddress(); ++ /** ++ * Return the InetSocketAddress of the remote endpoint ++ */ ++ SocketAddress getSocketAddress(); + ++ /** ++ * Shuts down the server. (Only actually used on the server) ++ */ + void serverShutdown(); + +- int getNumChunkDataPackets(); ++ /** ++ * returns 0 for memoryConnections ++ */ ++ int packetSize(); + +- void networkShutdown(String var1, Object... var2); ++ /** ++ * Shuts down the network with the specified reason. Closes all streams and sockets, spawns NetworkMasterThread to stop ++ * reading and writing threads. ++ */ ++ void networkShutdown(String var1, Object ... var2); + + void closeConnections(); + } diff --git a/patches/net/minecraft/src/IPlayerFileData.java.patch b/patches/net/minecraft/src/IPlayerFileData.java.patch new file mode 100644 index 0000000..6e9d04b --- /dev/null +++ b/patches/net/minecraft/src/IPlayerFileData.java.patch @@ -0,0 +1,22 @@ +--- net/minecraft/src/IPlayerFileData.java ++++ net/minecraft/src/IPlayerFileData.java +@@ -1,9 +1,19 @@ + package net.minecraft.src; + + public interface IPlayerFileData { ++ ++ /** ++ * Writes the player data to disk from the specified PlayerEntityMP. ++ */ + void writePlayerData(EntityPlayer var1); + ++ /** ++ * Reads the player data from disk into the specified PlayerEntityMP. ++ */ + NBTTagCompound readPlayerData(EntityPlayer var1); + ++ /** ++ * Returns an array of usernames for which player.dat exists for. ++ */ + String[] getAvailablePlayerDat(); + } diff --git a/patches/net/minecraft/src/IPlayerUsage.java.patch b/patches/net/minecraft/src/IPlayerUsage.java.patch new file mode 100644 index 0000000..0890909 --- /dev/null +++ b/patches/net/minecraft/src/IPlayerUsage.java.patch @@ -0,0 +1,12 @@ +--- net/minecraft/src/IPlayerUsage.java ++++ net/minecraft/src/IPlayerUsage.java +@@ -5,6 +5,9 @@ + + void addServerTypeToSnooper(PlayerUsageSnooper var1); + ++ /** ++ * Returns whether snooping is enabled or not. ++ */ + boolean isSnooperEnabled(); + + ILogAgent getLogAgent(); diff --git a/patches/net/minecraft/src/IProgressUpdate.java.patch b/patches/net/minecraft/src/IProgressUpdate.java.patch new file mode 100644 index 0000000..61da8ad --- /dev/null +++ b/patches/net/minecraft/src/IProgressUpdate.java.patch @@ -0,0 +1,26 @@ +--- net/minecraft/src/IProgressUpdate.java ++++ net/minecraft/src/IProgressUpdate.java +@@ -1,9 +1,19 @@ + package net.minecraft.src; + + public interface IProgressUpdate { +- void displaySavingString(String var1); +- +- void displayLoadingString(String var1); +- ++ ++ /** ++ * "Saving level", or the loading,or downloading equivelent ++ */ ++ void displayProgressMessage(String var1); ++ ++ /** ++ * This is called with "Working..." by resetProgressAndMessage ++ */ ++ void resetProgresAndWorkingMessage(String var1); ++ ++ /** ++ * Updates the progress bar on the loading screen to the specified amount. Args: loadProgress ++ */ + void setLoadingProgress(int var1); + } diff --git a/patches/net/minecraft/src/IProjectile.java.patch b/patches/net/minecraft/src/IProjectile.java.patch new file mode 100644 index 0000000..f93db7f --- /dev/null +++ b/patches/net/minecraft/src/IProjectile.java.patch @@ -0,0 +1,12 @@ +--- net/minecraft/src/IProjectile.java ++++ net/minecraft/src/IProjectile.java +@@ -1,5 +1,9 @@ + package net.minecraft.src; + + public interface IProjectile { ++ ++ /** ++ * Similar to setArrowHeading, it's point the throwable entity to a x, y, z direction. ++ */ + void setThrowableHeading(double var1, double var3, double var5, float var7, float var8); + } diff --git a/patches/net/minecraft/src/IRangedAttackMob.java.patch b/patches/net/minecraft/src/IRangedAttackMob.java.patch new file mode 100644 index 0000000..4b6a28d --- /dev/null +++ b/patches/net/minecraft/src/IRangedAttackMob.java.patch @@ -0,0 +1,12 @@ +--- net/minecraft/src/IRangedAttackMob.java ++++ net/minecraft/src/IRangedAttackMob.java +@@ -1,5 +1,9 @@ + package net.minecraft.src; + + public interface IRangedAttackMob { ++ ++ /** ++ * Attack the specified entity using a ranged attack. ++ */ + void attackEntityWithRangedAttack(EntityLivingBase var1, float var2); + } diff --git a/patches/net/minecraft/src/IRecipe.java.patch b/patches/net/minecraft/src/IRecipe.java.patch new file mode 100644 index 0000000..8dffe60 --- /dev/null +++ b/patches/net/minecraft/src/IRecipe.java.patch @@ -0,0 +1,23 @@ +--- net/minecraft/src/IRecipe.java ++++ net/minecraft/src/IRecipe.java +@@ -1,10 +1,20 @@ + package net.minecraft.src; + + public interface IRecipe { ++ ++ /** ++ * Used to check if a recipe matches current crafting inventory ++ */ + boolean matches(InventoryCrafting var1, World var2); + ++ /** ++ * Returns an Item that is the result of this recipe ++ */ + ItemStack getCraftingResult(InventoryCrafting var1); + ++ /** ++ * Returns the size of the recipe area ++ */ + int getRecipeSize(); + + ItemStack getRecipeOutput(); diff --git a/patches/net/minecraft/src/IRegistry.java.patch b/patches/net/minecraft/src/IRegistry.java.patch new file mode 100644 index 0000000..7e6f979 --- /dev/null +++ b/patches/net/minecraft/src/IRegistry.java.patch @@ -0,0 +1,11 @@ +--- net/minecraft/src/IRegistry.java ++++ net/minecraft/src/IRegistry.java +@@ -3,5 +3,8 @@ + public interface IRegistry { + Object getObject(Object var1); + ++ /** ++ * Register an object on this registry. ++ */ + void putObject(Object var1, Object var2); + } diff --git a/patches/net/minecraft/src/ISaveFormat.java.patch b/patches/net/minecraft/src/ISaveFormat.java.patch new file mode 100644 index 0000000..19c6588 --- /dev/null +++ b/patches/net/minecraft/src/ISaveFormat.java.patch @@ -0,0 +1,49 @@ +--- net/minecraft/src/ISaveFormat.java ++++ net/minecraft/src/ISaveFormat.java +@@ -3,21 +3,46 @@ + import java.util.List; + + public interface ISaveFormat { ++ ++ /** ++ * Returns back a loader for the specified save directory ++ */ + ISaveHandler getSaveLoader(String var1, boolean var2); + + List getSaveList() throws AnvilConverterException; + + void flushCache(); + ++ /** ++ * gets the world info ++ */ + WorldInfo getWorldInfo(String var1); + ++ /** ++ * @args: Takes one argument - the name of the directory of the world to delete. @desc: Delete the world by deleting ++ * the associated directory recursively. ++ */ + boolean deleteWorldDirectory(String var1); + ++ /** ++ * @args: Takes two arguments - first the name of the directory containing the world and second the new name for that ++ * world. @desc: Renames the world by storing the new name in level.dat. It does *not* rename the directory containing ++ * the world data. ++ */ + void renameWorld(String var1, String var2); + ++ /** ++ * Checks if the save directory uses the old map format ++ */ + boolean isOldMapFormat(String var1); + ++ /** ++ * Converts the specified map to the new map format. Args: worldName, loadingScreen ++ */ + boolean convertMapFormat(String var1, IProgressUpdate var2); + ++ /** ++ * Return whether the given world can be loaded. ++ */ + boolean canLoadWorld(String var1); + } diff --git a/patches/net/minecraft/src/ISaveHandler.java.patch b/patches/net/minecraft/src/ISaveHandler.java.patch new file mode 100644 index 0000000..a29cb33 --- /dev/null +++ b/patches/net/minecraft/src/ISaveHandler.java.patch @@ -0,0 +1,53 @@ +--- net/minecraft/src/ISaveHandler.java ++++ net/minecraft/src/ISaveHandler.java +@@ -3,21 +3,49 @@ + import java.io.File; + + public interface ISaveHandler { ++ ++ /** ++ * Loads and returns the world info ++ */ + WorldInfo loadWorldInfo(); + ++ /** ++ * Checks the session lock to prevent save collisions ++ */ + void checkSessionLock() throws MinecraftException; + ++ /** ++ * Returns the chunk loader with the provided world provider ++ */ + IChunkLoader getChunkLoader(WorldProvider var1); + ++ /** ++ * Saves the given World Info with the given NBTTagCompound as the Player. ++ */ + void saveWorldInfoWithPlayer(WorldInfo var1, NBTTagCompound var2); + ++ /** ++ * Saves the passed in world info. ++ */ + void saveWorldInfo(WorldInfo var1); + +- IPlayerFileData getPlayerNBTManager(); ++ /** ++ * returns null if no saveHandler is relevent (eg. SMP) ++ */ ++ IPlayerFileData getSaveHandler(); + ++ /** ++ * Called to flush all changes to disk, waiting for them to complete. ++ */ + void flush(); + ++ /** ++ * Gets the file location of the given map ++ */ + File getMapFileFromName(String var1); + ++ /** ++ * Returns the name of the directory where world information is saved. ++ */ + String getWorldDirectoryName(); + } diff --git a/patches/net/minecraft/src/IServer.java.patch b/patches/net/minecraft/src/IServer.java.patch new file mode 100644 index 0000000..0b2b2f4 --- /dev/null +++ b/patches/net/minecraft/src/IServer.java.patch @@ -0,0 +1,103 @@ +--- net/minecraft/src/IServer.java ++++ net/minecraft/src/IServer.java +@@ -1,43 +1,98 @@ + package net.minecraft.src; + + public interface IServer { ++ ++ /** ++ * Gets an integer property. If it does not exist, set it to the specified value. ++ */ + int getIntProperty(String var1, int var2); + ++ /** ++ * Gets a string property. If it does not exist, set it to the specified value. ++ */ + String getStringProperty(String var1, String var2); + ++ /** ++ * Saves an Object with the given property name. ++ */ + void setProperty(String var1, Object var2); + ++ /** ++ * Saves all of the server properties to the properties file. ++ */ + void saveProperties(); + ++ /** ++ * Returns the filename where server properties are stored ++ */ + String getSettingsFilename(); + ++ /** ++ * Returns the server's hostname. ++ */ + String getHostname(); + ++ /** ++ * Never used, but "getServerPort" is already taken. ++ */ + int getPort(); + +- String getMotd(); ++ /** ++ * Returns the server message of the day ++ */ ++ String getServerMOTD(); + ++ /** ++ * Returns the server's Minecraft version as string. ++ */ + String getMinecraftVersion(); + ++ /** ++ * Returns the number of players currently on the server. ++ */ + int getCurrentPlayerCount(); + ++ /** ++ * Returns the maximum number of players allowed on the server. ++ */ + int getMaxPlayers(); + ++ /** ++ * Returns an array of the usernames of all the connected players. ++ */ + String[] getAllUsernames(); + + String getFolderName(); + ++ /** ++ * Used by RCon's Query in the form of "MajorServerMod 1.2.3: MyPlugin 1.3; AnotherPlugin 2.1; AndSoForth 1.0". ++ */ + String getPlugins(); + +- String handleRConCommand(String var1); ++ String executeCommand(String var1); + ++ /** ++ * Returns true if debugging is enabled, false otherwise. ++ */ + boolean isDebuggingEnabled(); + ++ /** ++ * Logs the message with a level of INFO. ++ */ + void logInfo(String var1); + ++ /** ++ * Logs the message with a level of WARN. ++ */ + void logWarning(String var1); + ++ /** ++ * Logs the error message with a level of SEVERE. ++ */ + void logSevere(String var1); + ++ /** ++ * If isDebuggingEnabled(), logs the message with a level of INFO. ++ */ + void logDebug(String var1); + } diff --git a/patches/net/minecraft/src/ISidedInventory.java.patch b/patches/net/minecraft/src/ISidedInventory.java.patch new file mode 100644 index 0000000..bec8215 --- /dev/null +++ b/patches/net/minecraft/src/ISidedInventory.java.patch @@ -0,0 +1,25 @@ +--- net/minecraft/src/ISidedInventory.java ++++ net/minecraft/src/ISidedInventory.java +@@ -1,9 +1,20 @@ + package net.minecraft.src; + + public interface ISidedInventory extends IInventory { +- int[] getSlotsForFace(int var1); +- ++ ++ /** ++ * Returns an array containing the indices of the slots that can be accessed by automation on the given side of this ++ * block. ++ */ ++ int[] getAccessibleSlotsFromSide(int var1); ++ ++ /** ++ * Returns true if automation can insert the given item in the given slot from the given side. Args: Slot, item, side ++ */ + boolean canInsertItem(int var1, ItemStack var2, int var3); + ++ /** ++ * Returns true if automation can extract the given item in the given slot from the given side. Args: Slot, item, side ++ */ + boolean canExtractItem(int var1, ItemStack var2, int var3); + } diff --git a/patches/net/minecraft/src/IStatStringFormat.java.patch b/patches/net/minecraft/src/IStatStringFormat.java.patch new file mode 100644 index 0000000..1556e80 --- /dev/null +++ b/patches/net/minecraft/src/IStatStringFormat.java.patch @@ -0,0 +1,12 @@ +--- net/minecraft/src/IStatStringFormat.java ++++ net/minecraft/src/IStatStringFormat.java +@@ -1,5 +1,9 @@ + package net.minecraft.src; + + public interface IStatStringFormat { ++ ++ /** ++ * Formats the strings based on 'IStatStringFormat' interface. ++ */ + String formatString(String var1); + } diff --git a/patches/net/minecraft/src/IStatType.java.patch b/patches/net/minecraft/src/IStatType.java.patch new file mode 100644 index 0000000..28197d5 --- /dev/null +++ b/patches/net/minecraft/src/IStatType.java.patch @@ -0,0 +1,12 @@ +--- net/minecraft/src/IStatType.java ++++ net/minecraft/src/IStatType.java +@@ -1,5 +1,9 @@ + package net.minecraft.src; + + public interface IStatType { ++ ++ /** ++ * Formats a given stat for human consumption. ++ */ + String format(int var1); + } diff --git a/patches/net/minecraft/src/IThreadedFileIO.java.patch b/patches/net/minecraft/src/IThreadedFileIO.java.patch new file mode 100644 index 0000000..48800b0 --- /dev/null +++ b/patches/net/minecraft/src/IThreadedFileIO.java.patch @@ -0,0 +1,12 @@ +--- net/minecraft/src/IThreadedFileIO.java ++++ net/minecraft/src/IThreadedFileIO.java +@@ -1,5 +1,9 @@ + package net.minecraft.src; + + public interface IThreadedFileIO { ++ ++ /** ++ * Returns a boolean stating if the write was unsuccessful. ++ */ + boolean writeNextIO(); + } diff --git a/patches/net/minecraft/src/ITileEntityProvider.java.patch b/patches/net/minecraft/src/ITileEntityProvider.java.patch new file mode 100644 index 0000000..757ae57 --- /dev/null +++ b/patches/net/minecraft/src/ITileEntityProvider.java.patch @@ -0,0 +1,12 @@ +--- net/minecraft/src/ITileEntityProvider.java ++++ net/minecraft/src/ITileEntityProvider.java +@@ -1,5 +1,9 @@ + package net.minecraft.src; + + public interface ITileEntityProvider { ++ ++ /** ++ * Returns a new instance of a block's tile entity class. Called on placing the block. ++ */ + TileEntity createNewTileEntity(World var1); + } diff --git a/patches/net/minecraft/src/IUpdatePlayerListBox.java.patch b/patches/net/minecraft/src/IUpdatePlayerListBox.java.patch new file mode 100644 index 0000000..6af521e --- /dev/null +++ b/patches/net/minecraft/src/IUpdatePlayerListBox.java.patch @@ -0,0 +1,12 @@ +--- net/minecraft/src/IUpdatePlayerListBox.java ++++ net/minecraft/src/IUpdatePlayerListBox.java +@@ -1,5 +1,9 @@ + package net.minecraft.src; + + public interface IUpdatePlayerListBox { ++ ++ /** ++ * Updates the JList with a new model. ++ */ + void update(); + } diff --git a/patches/net/minecraft/src/IWorldAccess.java.patch b/patches/net/minecraft/src/IWorldAccess.java.patch new file mode 100644 index 0000000..6b3dde9 --- /dev/null +++ b/patches/net/minecraft/src/IWorldAccess.java.patch @@ -0,0 +1,72 @@ +--- net/minecraft/src/IWorldAccess.java ++++ net/minecraft/src/IWorldAccess.java +@@ -1,27 +1,68 @@ + package net.minecraft.src; + ++import org.newdawn.slick.opengl.Texture; ++ + public interface IWorldAccess { ++ ++ /** ++ * On the client, re-renders the block. On the server, sends the block to the client (which will re-render it), ++ * including the tile entity description packet if applicable. Args: x, y, z ++ */ + void markBlockForUpdate(int var1, int var2, int var3); + ++ /** ++ * On the client, re-renders this block. On the server, does nothing. Used for lighting updates. ++ */ + void markBlockForRenderUpdate(int var1, int var2, int var3); + ++ /** ++ * On the client, re-renders all blocks in this range, inclusive. On the server, does nothing. Args: min x, min y, min ++ * z, max x, max y, max z ++ */ + void markBlockRangeForRenderUpdate(int var1, int var2, int var3, int var4, int var5, int var6); + ++ /** ++ * Plays the specified sound. Arg: soundName, x, y, z, volume, pitch ++ */ + void playSound(String var1, double var2, double var4, double var6, float var8, float var9); + ++ /** ++ * Plays sound to all near players except the player reference given ++ */ + void playSoundToNearExcept(EntityPlayer var1, String var2, double var3, double var5, double var7, float var9, float var10); + +- void spawnParticle(String var1, double var2, double var4, double var6, double var8, double var10, double var12); ++ /** ++ * Spawns a particle. Arg: particleType, x, y, z, velX, velY, velZ ++ */ ++ void spawnParticle(String var1, double var2, double var4, double var6, double var8, double var10, double var12, Texture texture); + ++ /** ++ * Called on all IWorldAccesses when an entity is created or loaded. On client worlds, starts downloading any necessary ++ * textures. On server worlds, adds the entity to the entity tracker. ++ */ + void onEntityCreate(Entity var1); + ++ /** ++ * Called on all IWorldAccesses when an entity is unloaded or destroyed. On client worlds, releases any downloaded ++ * textures. On server worlds, removes the entity from the entity tracker. ++ */ + void onEntityDestroy(Entity var1); + ++ /** ++ * Plays the specified record. Arg: recordName, x, y, z ++ */ + void playRecord(String var1, int var2, int var3, int var4); + + void broadcastSound(int var1, int var2, int var3, int var4, int var5); + ++ /** ++ * Plays a pre-canned sound effect along with potentially auxiliary data-driven one-shot behaviour (particles, etc). ++ */ + void playAuxSFX(EntityPlayer var1, int var2, int var3, int var4, int var5, int var6); + ++ /** ++ * Starts (or continues) destroying a block with given ID at the given coordinates for the given partially destroyed ++ * value ++ */ + void destroyBlockPartially(int var1, int var2, int var3, int var4, int var5); + } diff --git a/patches/net/minecraft/src/Icon.java.patch b/patches/net/minecraft/src/Icon.java.patch new file mode 100644 index 0000000..cfb945c --- /dev/null +++ b/patches/net/minecraft/src/Icon.java.patch @@ -0,0 +1,48 @@ +--- net/minecraft/src/Icon.java ++++ net/minecraft/src/Icon.java +@@ -1,20 +1,45 @@ + package net.minecraft.src; + + public interface Icon { ++ ++ /** ++ * Returns the width of the icon, in pixels. ++ */ + int getIconWidth(); + ++ /** ++ * Returns the height of the icon, in pixels. ++ */ + int getIconHeight(); + ++ /** ++ * Returns the minimum U coordinate to use when rendering with this icon. ++ */ + float getMinU(); + ++ /** ++ * Returns the maximum U coordinate to use when rendering with this icon. ++ */ + float getMaxU(); + ++ /** ++ * Gets a U coordinate on the icon. 0 returns uMin and 16 returns uMax. Other arguments return in-between values. ++ */ + float getInterpolatedU(double var1); + ++ /** ++ * Returns the minimum V coordinate to use when rendering with this icon. ++ */ + float getMinV(); + ++ /** ++ * Returns the maximum V coordinate to use when rendering with this icon. ++ */ + float getMaxV(); + ++ /** ++ * Gets a V coordinate on the icon. 0 returns vMin and 16 returns vMax. Other arguments return in-between values. ++ */ + float getInterpolatedV(double var1); + + String getIconName(); diff --git a/patches/net/minecraft/src/IconFlipped.java.patch b/patches/net/minecraft/src/IconFlipped.java.patch new file mode 100644 index 0000000..b424a40 --- /dev/null +++ b/patches/net/minecraft/src/IconFlipped.java.patch @@ -0,0 +1,79 @@ +--- net/minecraft/src/IconFlipped.java ++++ net/minecraft/src/IconFlipped.java +@@ -5,44 +5,68 @@ + private final boolean flipU; + private final boolean flipV; + +- public IconFlipped(Icon var1, boolean var2, boolean var3) { +- this.baseIcon = var1; +- this.flipU = var2; +- this.flipV = var3; ++ public IconFlipped(Icon par1Icon, boolean par2, boolean par3) { ++ this.baseIcon = par1Icon; ++ this.flipU = par2; ++ this.flipV = par3; + } + ++ /** ++ * Returns the width of the icon, in pixels. ++ */ + public int getIconWidth() { + return this.baseIcon.getIconWidth(); + } + ++ /** ++ * Returns the height of the icon, in pixels. ++ */ + public int getIconHeight() { + return this.baseIcon.getIconHeight(); + } + ++ /** ++ * Returns the minimum U coordinate to use when rendering with this icon. ++ */ + public float getMinU() { + return this.flipU ? this.baseIcon.getMaxU() : this.baseIcon.getMinU(); + } + ++ /** ++ * Returns the maximum U coordinate to use when rendering with this icon. ++ */ + public float getMaxU() { + return this.flipU ? this.baseIcon.getMinU() : this.baseIcon.getMaxU(); + } + +- public float getInterpolatedU(double var1) { ++ /** ++ * Gets a U coordinate on the icon. 0 returns uMin and 16 returns uMax. Other arguments return in-between values. ++ */ ++ public float getInterpolatedU(double par1) { + float var3 = this.getMaxU() - this.getMinU(); +- return this.getMinU() + var3 * ((float)var1 / 16.0F); ++ return this.getMinU() + var3 * ((float)par1 / 16.0F); + } + ++ /** ++ * Returns the minimum V coordinate to use when rendering with this icon. ++ */ + public float getMinV() { + return this.flipV ? this.baseIcon.getMinV() : this.baseIcon.getMinV(); + } + ++ /** ++ * Returns the maximum V coordinate to use when rendering with this icon. ++ */ + public float getMaxV() { + return this.flipV ? this.baseIcon.getMinV() : this.baseIcon.getMaxV(); + } + +- public float getInterpolatedV(double var1) { ++ /** ++ * Gets a V coordinate on the icon. 0 returns vMin and 16 returns vMax. Other arguments return in-between values. ++ */ ++ public float getInterpolatedV(double par1) { + float var3 = this.getMaxV() - this.getMinV(); +- return this.getMinV() + var3 * ((float)var1 / 16.0F); ++ return this.getMinV() + var3 * ((float)par1 / 16.0F); + } + + public String getIconName() { diff --git a/patches/net/minecraft/src/ImageBufferDownload.java.patch b/patches/net/minecraft/src/ImageBufferDownload.java.patch new file mode 100644 index 0000000..9da00f8 --- /dev/null +++ b/patches/net/minecraft/src/ImageBufferDownload.java.patch @@ -0,0 +1,76 @@ +--- net/minecraft/src/ImageBufferDownload.java ++++ net/minecraft/src/ImageBufferDownload.java +@@ -10,15 +10,15 @@ + private int imageWidth; + private int imageHeight; + +- public BufferedImage parseUserSkin(BufferedImage var1) { +- if(var1 == null) { ++ public BufferedImage parseUserSkin(BufferedImage par1BufferedImage) { ++ if (par1BufferedImage == null) { + return null; + } else { + this.imageWidth = 64; + this.imageHeight = 32; + BufferedImage var2 = new BufferedImage(this.imageWidth, this.imageHeight, 2); + Graphics var3 = var2.getGraphics(); +- var3.drawImage(var1, 0, 0, (ImageObserver)null); ++ var3.drawImage(par1BufferedImage, 0, 0, (ImageObserver)null); + var3.dispose(); + this.imageData = ((DataBufferInt)var2.getRaster().getDataBuffer()).getData(); + this.setAreaOpaque(0, 0, 32, 16); +@@ -28,31 +28,41 @@ + } + } + +- private void setAreaTransparent(int var1, int var2, int var3, int var4) { +- if(!this.hasTransparency(var1, var2, var3, var4)) { +- for(int var5 = var1; var5 < var3; ++var5) { +- for(int var6 = var2; var6 < var4; ++var6) { ++ /** ++ * Makes the given area of the image transparent if it was previously completely opaque (used to remove the outer layer ++ * of a skin around the head if it was saved all opaque; this would be redundant so it's assumed that the skin maker is ++ * just using an image editor without an alpha channel) ++ */ ++ private void setAreaTransparent(int par1, int par2, int par3, int par4) { ++ if (!this.hasTransparency(par1, par2, par3, par4)) { ++ for (int var5 = par1; var5 < par3; ++var5) { ++ for (int var6 = par2; var6 < par4; ++var6) { + this.imageData[var5 + var6 * this.imageWidth] &= 16777215; + } + } +- + } + } + +- private void setAreaOpaque(int var1, int var2, int var3, int var4) { +- for(int var5 = var1; var5 < var3; ++var5) { +- for(int var6 = var2; var6 < var4; ++var6) { ++ /** ++ * Makes the given area of the image opaque ++ */ ++ private void setAreaOpaque(int par1, int par2, int par3, int par4) { ++ for (int var5 = par1; var5 < par3; ++var5) { ++ for (int var6 = par2; var6 < par4; ++var6) { + this.imageData[var5 + var6 * this.imageWidth] |= -16777216; + } + } +- + } + +- private boolean hasTransparency(int var1, int var2, int var3, int var4) { +- for(int var5 = var1; var5 < var3; ++var5) { +- for(int var6 = var2; var6 < var4; ++var6) { ++ /** ++ * Returns true if the given area of the image contains transparent pixels ++ */ ++ private boolean hasTransparency(int par1, int par2, int par3, int par4) { ++ for (int var5 = par1; var5 < par3; ++var5) { ++ for (int var6 = par2; var6 < par4; ++var6) { + int var7 = this.imageData[var5 + var6 * this.imageWidth]; +- if((var7 >> 24 & 255) < 128) { ++ ++ if ((var7 >> 24 & 255) < 128) { + return true; + } + } diff --git a/patches/net/minecraft/src/IntCache.java.patch b/patches/net/minecraft/src/IntCache.java.patch new file mode 100644 index 0000000..fb4348d --- /dev/null +++ b/patches/net/minecraft/src/IntCache.java.patch @@ -0,0 +1,115 @@ +--- net/minecraft/src/IntCache.java ++++ net/minecraft/src/IntCache.java +@@ -5,57 +5,79 @@ + + public class IntCache { + private static int intCacheSize = 256; +- private static List b = new ArrayList(); +- private static List c = new ArrayList(); +- private static List d = new ArrayList(); +- private static List e = new ArrayList(); +- +- public static synchronized int[] getIntCache(int var0) { ++ ++ /** ++ * A list of pre-allocated int[256] arrays that are currently unused and can be returned by getIntCache() ++ */ ++ private static List freeSmallArrays = new ArrayList(); ++ ++ /** ++ * A list of pre-allocated int[256] arrays that were previously returned by getIntCache() and which will not be re-used ++ * again until resetIntCache() is called. ++ */ ++ private static List inUseSmallArrays = new ArrayList(); ++ ++ /** ++ * A list of pre-allocated int[cacheSize] arrays that are currently unused and can be returned by getIntCache() ++ */ ++ private static List freeLargeArrays = new ArrayList(); ++ ++ /** ++ * A list of pre-allocated int[cacheSize] arrays that were previously returned by getIntCache() and which will not be ++ * re-used again until resetIntCache() is called. ++ */ ++ private static List inUseLargeArrays = new ArrayList(); ++ ++ public static synchronized int[] getIntCache(int par0) { + int[] var1; +- if(var0 <= 256) { +- if(b.isEmpty()) { ++ ++ if (par0 <= 256) { ++ if (freeSmallArrays.isEmpty()) { + var1 = new int[256]; +- c.add(var1); ++ inUseSmallArrays.add(var1); + return var1; + } else { +- var1 = (int[])b.remove(b.size() - 1); +- c.add(var1); ++ var1 = (int[])freeSmallArrays.remove(freeSmallArrays.size() - 1); ++ inUseSmallArrays.add(var1); + return var1; + } +- } else if(var0 > intCacheSize) { +- intCacheSize = var0; +- d.clear(); +- e.clear(); ++ } else if (par0 > intCacheSize) { ++ intCacheSize = par0; ++ freeLargeArrays.clear(); ++ inUseLargeArrays.clear(); + var1 = new int[intCacheSize]; +- e.add(var1); ++ inUseLargeArrays.add(var1); + return var1; +- } else if(d.isEmpty()) { ++ } else if (freeLargeArrays.isEmpty()) { + var1 = new int[intCacheSize]; +- e.add(var1); ++ inUseLargeArrays.add(var1); + return var1; + } else { +- var1 = (int[])d.remove(d.size() - 1); +- e.add(var1); ++ var1 = (int[])freeLargeArrays.remove(freeLargeArrays.size() - 1); ++ inUseLargeArrays.add(var1); + return var1; + } + } + ++ /** ++ * Mark all pre-allocated arrays as available for re-use by moving them to the appropriate free lists. ++ */ + public static synchronized void resetIntCache() { +- if(!d.isEmpty()) { +- d.remove(d.size() - 1); +- } +- +- if(!b.isEmpty()) { +- b.remove(b.size() - 1); +- } +- +- d.addAll(e); +- b.addAll(c); +- e.clear(); +- c.clear(); ++ if (!freeLargeArrays.isEmpty()) { ++ freeLargeArrays.remove(freeLargeArrays.size() - 1); ++ } ++ ++ if (!freeSmallArrays.isEmpty()) { ++ freeSmallArrays.remove(freeSmallArrays.size() - 1); ++ } ++ ++ freeLargeArrays.addAll(inUseLargeArrays); ++ freeSmallArrays.addAll(inUseSmallArrays); ++ inUseLargeArrays.clear(); ++ inUseSmallArrays.clear(); + } + + public static synchronized String func_85144_b() { +- return "cache: " + d.size() + ", tcache: " + b.size() + ", allocated: " + e.size() + ", tallocated: " + c.size(); ++ return "cache: " + freeLargeArrays.size() + ", tcache: " + freeSmallArrays.size() + ", allocated: " + inUseLargeArrays.size() + ", tallocated: " + inUseSmallArrays.size(); + } + } diff --git a/patches/net/minecraft/src/IntHashMap.java.patch b/patches/net/minecraft/src/IntHashMap.java.patch new file mode 100644 index 0000000..a09a9e0 --- /dev/null +++ b/patches/net/minecraft/src/IntHashMap.java.patch @@ -0,0 +1,271 @@ +--- net/minecraft/src/IntHashMap.java ++++ net/minecraft/src/IntHashMap.java +@@ -4,43 +4,70 @@ + import java.util.Set; + + public class IntHashMap { ++ ++ /** An array of HashEntries representing the heads of hash slot lists */ + private transient IntHashMapEntry[] slots = new IntHashMapEntry[16]; ++ ++ /** The number of items stored in this map */ + private transient int count; ++ ++ /** The grow threshold */ + private int threshold = 12; +- private final float growFactor = 12.0F / 16.0F; ++ ++ /** The scale factor used to determine when to grow the table */ ++ private final float growFactor = 0.75F; ++ ++ /** A serial stamp used to mark changes */ + private transient volatile int versionStamp; +- private Set f = new HashSet(); +- +- private static int computeHash(int var0) { +- var0 ^= var0 >>> 20 ^ var0 >>> 12; +- return var0 ^ var0 >>> 7 ^ var0 >>> 4; +- } +- +- private static int getSlotIndex(int var0, int var1) { +- return var0 & var1 - 1; +- } +- +- public Object lookup(int var1) { +- int var2 = computeHash(var1); +- +- for(IntHashMapEntry var3 = this.slots[getSlotIndex(var2, this.slots.length)]; var3 != null; var3 = var3.nextEntry) { +- if(var3.hashEntry == var1) { +- return var3.b; ++ ++ /** The set of all the keys stored in this MCHash object */ ++ private Set keySet = new HashSet(); ++ ++ /** ++ * Makes the passed in integer suitable for hashing by a number of shifts ++ */ ++ private static int computeHash(int par0) { ++ par0 ^= par0 >>> 20 ^ par0 >>> 12; ++ return par0 ^ par0 >>> 7 ^ par0 >>> 4; ++ } ++ ++ /** ++ * Computes the index of the slot for the hash and slot count passed in. ++ */ ++ private static int getSlotIndex(int par0, int par1) { ++ return par0 & par1 - 1; ++ } ++ ++ /** ++ * Returns the object associated to a key ++ */ ++ public Object lookup(int par1) { ++ int var2 = computeHash(par1); ++ ++ for (IntHashMapEntry var3 = this.slots[getSlotIndex(var2, this.slots.length)]; var3 != null; var3 = var3.nextEntry) { ++ if (var3.hashEntry == par1) { ++ return var3.valueEntry; + } + } + + return null; + } + +- public boolean containsItem(int var1) { +- return this.lookupEntry(var1) != null; ++ /** ++ * Return true if an object is associated with the given key ++ */ ++ public boolean containsItem(int par1) { ++ return this.lookupEntry(par1) != null; + } + +- final IntHashMapEntry lookupEntry(int var1) { +- int var2 = computeHash(var1); ++ /** ++ * Returns the key/object mapping for a given key as a MCHashEntry ++ */ ++ final IntHashMapEntry lookupEntry(int par1) { ++ int var2 = computeHash(par1); + +- for(IntHashMapEntry var3 = this.slots[getSlotIndex(var2, this.slots.length)]; var3 != null; var3 = var3.nextEntry) { +- if(var3.hashEntry == var1) { ++ for (IntHashMapEntry var3 = this.slots[getSlotIndex(var2, this.slots.length)]; var3 != null; var3 = var3.nextEntry) { ++ if (var3.hashEntry == par1) { + return var3; + } + } +@@ -48,76 +75,94 @@ + return null; + } + +- public void addKey(int var1, Object var2) { +- this.f.add(Integer.valueOf(var1)); +- int var3 = computeHash(var1); ++ /** ++ * Adds a key and associated value to this map ++ */ ++ public void addKey(int par1, Object par2Obj) { ++ this.keySet.add(Integer.valueOf(par1)); ++ int var3 = computeHash(par1); + int var4 = getSlotIndex(var3, this.slots.length); + +- for(IntHashMapEntry var5 = this.slots[var4]; var5 != null; var5 = var5.nextEntry) { +- if(var5.hashEntry == var1) { +- var5.b = var2; ++ for (IntHashMapEntry var5 = this.slots[var4]; var5 != null; var5 = var5.nextEntry) { ++ if (var5.hashEntry == par1) { ++ var5.valueEntry = par2Obj; + return; + } + } + + ++this.versionStamp; +- this.insert(var3, var1, var2, var4); ++ this.insert(var3, par1, par2Obj, var4); + } + +- private void grow(int var1) { ++ /** ++ * Increases the number of hash slots ++ */ ++ private void grow(int par1) { + IntHashMapEntry[] var2 = this.slots; + int var3 = var2.length; +- if(var3 == 1073741824) { ++ ++ if (var3 == 1073741824) { + this.threshold = Integer.MAX_VALUE; + } else { +- IntHashMapEntry[] var4 = new IntHashMapEntry[var1]; ++ IntHashMapEntry[] var4 = new IntHashMapEntry[par1]; + this.copyTo(var4); + this.slots = var4; +- this.threshold = (int)((float)var1 * this.growFactor); ++ this.threshold = (int)((float)par1 * this.growFactor); + } + } + +- private void copyTo(IntHashMapEntry[] var1) { ++ /** ++ * Copies the hash slots to a new array ++ */ ++ private void copyTo(IntHashMapEntry[] par1ArrayOfIntHashMapEntry) { + IntHashMapEntry[] var2 = this.slots; +- int var3 = var1.length; ++ int var3 = par1ArrayOfIntHashMapEntry.length; + +- for(int var4 = 0; var4 < var2.length; ++var4) { ++ for (int var4 = 0; var4 < var2.length; ++var4) { + IntHashMapEntry var5 = var2[var4]; +- if(var5 != null) { ++ ++ if (var5 != null) { + var2[var4] = null; +- + IntHashMapEntry var6; ++ + do { + var6 = var5.nextEntry; + int var7 = getSlotIndex(var5.slotHash, var3); +- var5.nextEntry = var1[var7]; +- var1[var7] = var5; ++ var5.nextEntry = par1ArrayOfIntHashMapEntry[var7]; ++ par1ArrayOfIntHashMapEntry[var7] = var5; + var5 = var6; +- } while(var6 != null); ++ } while (var6 != null); + } + } +- +- } +- +- public Object removeObject(int var1) { +- this.f.remove(Integer.valueOf(var1)); +- IntHashMapEntry var2 = this.removeEntry(var1); +- return var2 == null ? null : var2.b; +- } +- +- final IntHashMapEntry removeEntry(int var1) { +- int var2 = computeHash(var1); ++ } ++ ++ /** ++ * Removes the specified object from the map and returns it ++ */ ++ public Object removeObject(int par1) { ++ this.keySet.remove(Integer.valueOf(par1)); ++ IntHashMapEntry var2 = this.removeEntry(par1); ++ return var2 == null ? null : var2.valueEntry; ++ } ++ ++ /** ++ * Removes the specified entry from the map and returns it ++ */ ++ final IntHashMapEntry removeEntry(int par1) { ++ int var2 = computeHash(par1); + int var3 = getSlotIndex(var2, this.slots.length); + IntHashMapEntry var4 = this.slots[var3]; +- + IntHashMapEntry var5; + IntHashMapEntry var6; +- for(var5 = var4; var5 != null; var5 = var6) { ++ ++ for (var5 = var4; var5 != null; var5 = var6) { + var6 = var5.nextEntry; +- if(var5.hashEntry == var1) { ++ ++ if (var5.hashEntry == par1) { + ++this.versionStamp; + --this.count; +- if(var4 == var5) { ++ ++ if (var4 == var5) { + this.slots[var3] = var6; + } else { + var4.nextEntry = var6; +@@ -132,27 +177,36 @@ + return var5; + } + ++ /** ++ * Removes all entries from the map ++ */ + public void clearMap() { + ++this.versionStamp; + IntHashMapEntry[] var1 = this.slots; + +- for(int var2 = 0; var2 < var1.length; ++var2) { ++ for (int var2 = 0; var2 < var1.length; ++var2) { + var1[var2] = null; + } + + this.count = 0; + } + +- private void insert(int var1, int var2, Object var3, int var4) { +- IntHashMapEntry var5 = this.slots[var4]; +- this.slots[var4] = new IntHashMapEntry(var1, var2, var3, var5); +- if(this.count++ >= this.threshold) { ++ /** ++ * Adds an object to a slot ++ */ ++ private void insert(int par1, int par2, Object par3Obj, int par4) { ++ IntHashMapEntry var5 = this.slots[par4]; ++ this.slots[par4] = new IntHashMapEntry(par1, par2, par3Obj, var5); ++ ++ if (this.count++ >= this.threshold) { + this.grow(2 * this.slots.length); + } +- + } + +- static int getHash(int var0) { +- return computeHash(var0); ++ /** ++ * Returns the hash code for a key ++ */ ++ static int getHash(int par0) { ++ return computeHash(par0); + } + } diff --git a/patches/net/minecraft/src/IntHashMapEntry.java.patch b/patches/net/minecraft/src/IntHashMapEntry.java.patch new file mode 100644 index 0000000..a2e63f0 --- /dev/null +++ b/patches/net/minecraft/src/IntHashMapEntry.java.patch @@ -0,0 +1,68 @@ +--- net/minecraft/src/IntHashMapEntry.java ++++ net/minecraft/src/IntHashMapEntry.java +@@ -1,37 +1,53 @@ + package net.minecraft.src; + + class IntHashMapEntry { ++ ++ /** The hash code of this entry */ + final int hashEntry; +- Object b; ++ ++ /** The object stored in this entry */ ++ Object valueEntry; ++ ++ /** The next entry in this slot */ + IntHashMapEntry nextEntry; ++ ++ /** The id of the hash slot computed from the hash */ + final int slotHash; + +- IntHashMapEntry(int var1, int var2, Object var3, IntHashMapEntry var4) { +- this.b = var3; +- this.nextEntry = var4; +- this.hashEntry = var2; +- this.slotHash = var1; ++ IntHashMapEntry(int par1, int par2, Object par3Obj, IntHashMapEntry par4IntHashMapEntry) { ++ this.valueEntry = par3Obj; ++ this.nextEntry = par4IntHashMapEntry; ++ this.hashEntry = par2; ++ this.slotHash = par1; + } + ++ /** ++ * Returns the hash code for this entry ++ */ + public final int getHash() { + return this.hashEntry; + } + ++ /** ++ * Returns the object stored in this entry ++ */ + public final Object getValue() { +- return this.b; ++ return this.valueEntry; + } + +- public final boolean equals(Object var1) { +- if(!(var1 instanceof IntHashMapEntry)) { ++ public final boolean equals(Object par1Obj) { ++ if (!(par1Obj instanceof IntHashMapEntry)) { + return false; + } else { +- IntHashMapEntry var2 = (IntHashMapEntry)var1; ++ IntHashMapEntry var2 = (IntHashMapEntry)par1Obj; + Integer var3 = Integer.valueOf(this.getHash()); + Integer var4 = Integer.valueOf(var2.getHash()); +- if(var3 == var4 || var3 != null && var3.equals(var4)) { ++ ++ if (var3 == var4 || var3 != null && var3.equals(var4)) { + Object var5 = this.getValue(); + Object var6 = var2.getValue(); +- if(var5 == var6 || var5 != null && var5.equals(var6)) { ++ ++ if (var5 == var6 || var5 != null && var5.equals(var6)) { + return true; + } + } diff --git a/patches/net/minecraft/src/IntegratedPlayerList.java.patch b/patches/net/minecraft/src/IntegratedPlayerList.java.patch new file mode 100644 index 0000000..8e61b51 --- /dev/null +++ b/patches/net/minecraft/src/IntegratedPlayerList.java.patch @@ -0,0 +1,61 @@ +--- net/minecraft/src/IntegratedPlayerList.java ++++ net/minecraft/src/IntegratedPlayerList.java +@@ -4,30 +4,46 @@ + import net.minecraft.server.MinecraftServer; + + public class IntegratedPlayerList extends ServerConfigurationManager { ++ ++ /** ++ * Holds the NBT data for the host player's save file, so this can be written to level.dat. ++ */ + private NBTTagCompound hostPlayerData; + +- public IntegratedPlayerList(IntegratedServer var1) { +- super(var1); ++ public IntegratedPlayerList(IntegratedServer par1IntegratedServer) { ++ super(par1IntegratedServer); + this.viewDistance = 10; + } + +- protected void writePlayerData(EntityPlayerMP var1) { +- if(var1.getCommandSenderName().equals(this.getIntegratedServer().getServerOwner())) { ++ /** ++ * also stores the NBTTags if this is an intergratedPlayerList ++ */ ++ protected void writePlayerData(EntityPlayerMP par1EntityPlayerMP) { ++ if (par1EntityPlayerMP.getCommandSenderName().equals(this.getIntegratedServer().getServerOwner())) { + this.hostPlayerData = new NBTTagCompound(); +- var1.writeToNBT(this.hostPlayerData); ++ par1EntityPlayerMP.writeToNBT(this.hostPlayerData); + } + +- super.writePlayerData(var1); +- } +- +- public String allowUserToConnect(SocketAddress var1, String var2) { +- return var2.equalsIgnoreCase(this.getIntegratedServer().getServerOwner()) ? "That name is already taken." : super.allowUserToConnect(var1, var2); +- } +- ++ super.writePlayerData(par1EntityPlayerMP); ++ } ++ ++ /** ++ * checks ban-lists, then white-lists, then space for the server. Returns null on success, or an error message ++ */ ++ public String allowUserToConnect(SocketAddress par1SocketAddress, String par2Str) { ++ return par2Str.equalsIgnoreCase(this.getIntegratedServer().getServerOwner()) ? "That name is already taken." : super.allowUserToConnect(par1SocketAddress, par2Str); ++ } ++ ++ /** ++ * get the associated Integrated Server ++ */ + public IntegratedServer getIntegratedServer() { + return (IntegratedServer)super.getServerInstance(); + } + ++ /** ++ * On integrated servers, returns the host's player data to be written to level.dat. ++ */ + public NBTTagCompound getHostPlayerData() { + return this.hostPlayerData; + } diff --git a/patches/net/minecraft/src/IntegratedServer.java.patch b/patches/net/minecraft/src/IntegratedServer.java.patch new file mode 100644 index 0000000..7133dea --- /dev/null +++ b/patches/net/minecraft/src/IntegratedServer.java.patch @@ -0,0 +1,283 @@ +--- net/minecraft/src/IntegratedServer.java ++++ net/minecraft/src/IntegratedServer.java +@@ -5,27 +5,31 @@ + import net.minecraft.server.MinecraftServer; + + public class IntegratedServer extends MinecraftServer { ++ ++ /** The Minecraft instance. */ + private final Minecraft mc; + private final WorldSettings theWorldSettings; + private final ILogAgent serverLogAgent; ++ ++ /** Instance of IntegratedServerListenThread. */ + private IntegratedServerListenThread theServerListeningThread; + private boolean isGamePaused; + private boolean isPublic; + private ThreadLanServerPing lanServerPing; + +- public IntegratedServer(Minecraft var1, String var2, String var3, WorldSettings var4) { +- super(new File(var1.x, "saves")); +- this.serverLogAgent = new LogAgent("Minecraft-Server", " [SERVER]", (new File(var1.x, "output-server.log")).getAbsolutePath()); +- this.setServerOwner(var1.getSession().getUsername()); +- this.setFolderName(var2); +- this.setWorldName(var3); +- this.setDemo(var1.isDemo()); +- this.canCreateBonusChest(var4.isBonusChestEnabled()); ++ public IntegratedServer(Minecraft par1Minecraft, String par2Str, String par3Str, WorldSettings par4WorldSettings) { ++ super(new File(par1Minecraft.mcDataDir, "saves")); ++ this.serverLogAgent = new LogAgent("Minecraft-Server", " [SERVER]", (new File(par1Minecraft.mcDataDir, "output-server.log")).getAbsolutePath()); ++ this.setServerOwner(par1Minecraft.getSession().getUsername()); ++ this.setFolderName(par2Str); ++ this.setWorldName(par3Str); ++ this.setDemo(par1Minecraft.isDemo()); ++ this.canCreateBonusChest(par4WorldSettings.isBonusChestEnabled()); + this.setBuildLimit(256); + this.setConfigurationManager(new IntegratedPlayerList(this)); +- this.mc = var1; +- this.c = var1.getProxy(); +- this.theWorldSettings = var4; ++ this.mc = par1Minecraft; ++ this.serverProxy = par1Minecraft.getProxy(); ++ this.theWorldSettings = par4WorldSettings; + + try { + this.theServerListeningThread = new IntegratedServerListenThread(this); +@@ -34,30 +38,31 @@ + } + } + +- protected void loadAllWorlds(String var1, String var2, long var3, WorldType var5, String var6) { +- this.convertMapIfNeeded(var1); ++ protected void loadAllWorlds(String par1Str, String par2Str, long par3, WorldType par5WorldType, String par6Str) { ++ this.convertMapIfNeeded(par1Str); + this.worldServers = new WorldServer[3]; + this.timeOfLastDimensionTick = new long[this.worldServers.length][100]; +- ISaveHandler var7 = this.getActiveAnvilConverter().getSaveLoader(var1, true); ++ ISaveHandler var7 = this.getActiveAnvilConverter().getSaveLoader(par1Str, true); + +- for(int var8 = 0; var8 < this.worldServers.length; ++var8) { ++ for (int var8 = 0; var8 < this.worldServers.length; ++var8) { + byte var9 = 0; +- if(var8 == 1) { ++ ++ if (var8 == 1) { + var9 = -1; + } + +- if(var8 == 2) { ++ if (var8 == 2) { + var9 = 1; + } + +- if(var8 == 0) { +- if(this.isDemo()) { +- this.worldServers[var8] = new DemoWorldServer(this, var7, var2, var9, this.theProfiler, this.getLogAgent()); ++ if (var8 == 0) { ++ if (this.isDemo()) { ++ this.worldServers[var8] = new DemoWorldServer(this, var7, par2Str, var9, this.theProfiler, this.getLogAgent()); + } else { +- this.worldServers[var8] = new WorldServer(this, var7, var2, var9, this.theWorldSettings, this.theProfiler, this.getLogAgent()); ++ this.worldServers[var8] = new WorldServer(this, var7, par2Str, var9, this.theWorldSettings, this.theProfiler, this.getLogAgent()); + } + } else { +- this.worldServers[var8] = new WorldServerMulti(this, var7, var2, var9, this.theWorldSettings, this.worldServers[0], this.theProfiler, this.getLogAgent()); ++ this.worldServers[var8] = new WorldServerMulti(this, var7, par2Str, var9, this.theWorldSettings, this.worldServers[0], this.theProfiler, this.getLogAgent()); + } + + this.worldServers[var8].addWorldAccess(new WorldManager(this, this.worldServers[var8])); +@@ -68,6 +73,9 @@ + this.initialWorldChunkLoad(); + } + ++ /** ++ * Initialises the server and starts it. ++ */ + protected boolean startServer() throws IOException { + this.serverLogAgent.logInfo("Starting integrated minecraft server version 1.6.4"); + this.setOnlineMode(false); +@@ -76,25 +84,28 @@ + this.setAllowPvp(true); + this.setAllowFlight(true); + this.serverLogAgent.logInfo("Generating keypair"); +- this.setKeyPair(CryptManager.generateKeyPair()); ++ this.setKeyPair(CryptManager.createNewKeyPair()); + this.loadAllWorlds(this.getFolderName(), this.getWorldName(), this.theWorldSettings.getSeed(), this.theWorldSettings.getTerrainType(), this.theWorldSettings.func_82749_j()); + this.setMOTD(this.getServerOwner() + " - " + this.worldServers[0].getWorldInfo().getWorldName()); + return true; + } + +- protected void tick() { ++ /** ++ * Main function called by run() every loop. ++ */ ++ public void tick() { + boolean var1 = this.isGamePaused; + this.isGamePaused = this.theServerListeningThread.isGamePaused(); +- if(!var1 && this.isGamePaused) { ++ ++ if (!var1 && this.isGamePaused) { + this.serverLogAgent.logInfo("Saving and pausing game..."); + this.getConfigurationManager().saveAllPlayerData(); + this.saveAllWorlds(false); + } + +- if(!this.isGamePaused) { ++ if (!this.isGamePaused) { + super.tick(); + } +- + } + + public boolean canStructuresSpawn() { +@@ -105,55 +116,76 @@ + return this.theWorldSettings.getGameType(); + } + ++ /** ++ * Defaults to "1" (Easy) for the dedicated server, defaults to "2" (Normal) on the client. ++ */ + public int getDifficulty() { + return this.mc.gameSettings.difficulty; + } + ++ /** ++ * Defaults to false. ++ */ + public boolean isHardcore() { + return this.theWorldSettings.getHardcoreEnabled(); + } + + protected File getDataDirectory() { +- return this.mc.x; ++ return this.mc.mcDataDir; + } + + public boolean isDedicatedServer() { + return false; + } + ++ /** ++ * Gets the IntergratedServerListenThread. ++ */ + public IntegratedServerListenThread getServerListeningThread() { + return this.theServerListeningThread; + } + +- protected void finalTick(CrashReport var1) { +- this.mc.crashed(var1); +- } +- +- public CrashReport addServerInfoToCrashReport(CrashReport var1) { +- var1 = super.addServerInfoToCrashReport(var1); +- var1.getCategory().addCrashSectionCallable("Type", new CallableType3(this)); +- var1.getCategory().addCrashSectionCallable("Is Modded", new CallableIsModded(this)); +- return var1; +- } +- +- public void addServerStatsToSnooper(PlayerUsageSnooper var1) { +- super.addServerStatsToSnooper(var1); +- var1.addData("snooper_partner", this.mc.getPlayerUsageSnooper().getUniqueID()); +- } +- ++ /** ++ * Called on exit from the main run() loop. ++ */ ++ protected void finalTick(CrashReport par1CrashReport) { ++ this.mc.crashed(par1CrashReport); ++ } ++ ++ /** ++ * Adds the server info, including from theWorldServer, to the crash report. ++ */ ++ public CrashReport addServerInfoToCrashReport(CrashReport par1CrashReport) { ++ par1CrashReport = super.addServerInfoToCrashReport(par1CrashReport); ++ par1CrashReport.getCategory().addCrashSectionCallable("Type", new CallableType3(this)); ++ par1CrashReport.getCategory().addCrashSectionCallable("Is Modded", new CallableIsModded(this)); ++ return par1CrashReport; ++ } ++ ++ public void addServerStatsToSnooper(PlayerUsageSnooper par1PlayerUsageSnooper) { ++ super.addServerStatsToSnooper(par1PlayerUsageSnooper); ++ par1PlayerUsageSnooper.addData("snooper_partner", this.mc.getPlayerUsageSnooper().getUniqueID()); ++ } ++ ++ /** ++ * Returns whether snooping is enabled or not. ++ */ + public boolean isSnooperEnabled() { + return Minecraft.getMinecraft().isSnooperEnabled(); + } + +- public String shareToLAN(EnumGameType var1, boolean var2) { ++ /** ++ * On dedicated does nothing. On integrated, sets commandsAllowedForAll, gameType and allows external connections. ++ */ ++ public String shareToLAN(EnumGameType par1EnumGameType, boolean par2) { + try { + String var3 = this.theServerListeningThread.func_71755_c(); + this.getLogAgent().logInfo("Started on " + var3); + this.isPublic = true; + this.lanServerPing = new ThreadLanServerPing(this.getMOTD(), var3); + this.lanServerPing.start(); +- this.getConfigurationManager().setGameType(var1); +- this.getConfigurationManager().setCommandsAllowedForAll(var2); ++ this.getConfigurationManager().setGameType(par1EnumGameType); ++ this.getConfigurationManager().setCommandsAllowedForAll(par2); + return var3; + } catch (IOException var4) { + return null; +@@ -164,32 +196,47 @@ + return this.serverLogAgent; + } + ++ /** ++ * Saves all necessary data as preparation for stopping the server. ++ */ + public void stopServer() { + super.stopServer(); +- if(this.lanServerPing != null) { ++ ++ if (this.lanServerPing != null) { + this.lanServerPing.interrupt(); + this.lanServerPing = null; + } +- + } + ++ /** ++ * Sets the serverRunning variable to false, in order to get the server to shut down. ++ */ + public void initiateShutdown() { + super.initiateShutdown(); +- if(this.lanServerPing != null) { ++ ++ if (this.lanServerPing != null) { + this.lanServerPing.interrupt(); + this.lanServerPing = null; + } +- + } + ++ /** ++ * Returns true if this integrated server is open to LAN ++ */ + public boolean getPublic() { + return this.isPublic; + } + +- public void setGameType(EnumGameType var1) { +- this.getConfigurationManager().setGameType(var1); ++ /** ++ * Sets the game type for all worlds. ++ */ ++ public void setGameType(EnumGameType par1EnumGameType) { ++ this.getConfigurationManager().setGameType(par1EnumGameType); + } + ++ /** ++ * Return whether command blocks are enabled. ++ */ + public boolean isCommandBlockEnabled() { + return true; + } diff --git a/patches/net/minecraft/src/IntegratedServerListenThread.java.patch b/patches/net/minecraft/src/IntegratedServerListenThread.java.patch new file mode 100644 index 0000000..90d3563 --- /dev/null +++ b/patches/net/minecraft/src/IntegratedServerListenThread.java.patch @@ -0,0 +1,95 @@ +--- net/minecraft/src/IntegratedServerListenThread.java ++++ net/minecraft/src/IntegratedServerListenThread.java +@@ -7,30 +7,31 @@ + public class IntegratedServerListenThread extends NetworkListenThread { + private final MemoryConnection netMemoryConnection; + private MemoryConnection theMemoryConnection; +- private String d; ++ private String field_71759_e; + private boolean field_71756_f; + private ServerListenThread myServerListenThread; + +- public IntegratedServerListenThread(IntegratedServer var1) { +- super(var1); +- this.netMemoryConnection = new MemoryConnection(var1.getLogAgent(), (NetHandler)null); ++ public IntegratedServerListenThread(IntegratedServer par1IntegratedServer) throws IOException { ++ super(par1IntegratedServer); ++ this.netMemoryConnection = new MemoryConnection(par1IntegratedServer.getLogAgent(), (NetHandler)null); + } + +- public void func_71754_a(MemoryConnection var1, String var2) { +- this.theMemoryConnection = var1; +- this.d = var2; ++ public void func_71754_a(MemoryConnection par1MemoryConnection, String par2Str) { ++ this.theMemoryConnection = par1MemoryConnection; ++ this.field_71759_e = par2Str; + } + + public String func_71755_c() throws IOException { +- if(this.myServerListenThread == null) { ++ if (this.myServerListenThread == null) { + int var1 = -1; + + try { + var1 = HttpUtil.func_76181_a(); + } catch (IOException var4) { ++ ; + } + +- if(var1 <= 0) { ++ if (var1 <= 0) { + var1 = 25564; + } + +@@ -47,35 +48,42 @@ + + public void stopListening() { + super.stopListening(); +- if(this.myServerListenThread != null) { ++ ++ if (this.myServerListenThread != null) { + this.getIntegratedServer().getLogAgent().logInfo("Stopping server connection"); + this.myServerListenThread.func_71768_b(); + this.myServerListenThread.interrupt(); + this.myServerListenThread = null; + } +- + } + +- public void handleNetworkListenThread() { +- if(this.theMemoryConnection != null) { +- EntityPlayerMP var1 = this.getIntegratedServer().getConfigurationManager().createPlayerForUser(this.d); +- if(var1 != null) { ++ /** ++ * processes packets and pending connections ++ */ ++ public void networkTick() { ++ if (this.theMemoryConnection != null) { ++ EntityPlayerMP var1 = this.getIntegratedServer().getConfigurationManager().createPlayerForUser(this.field_71759_e); ++ ++ if (var1 != null) { + this.netMemoryConnection.pairWith(this.theMemoryConnection); + this.field_71756_f = true; + this.getIntegratedServer().getConfigurationManager().initializeConnectionToPlayer(this.netMemoryConnection, var1); + } + + this.theMemoryConnection = null; +- this.d = null; ++ this.field_71759_e = null; + } + +- if(this.myServerListenThread != null) { ++ if (this.myServerListenThread != null) { + this.myServerListenThread.processPendingConnections(); + } + +- super.handleNetworkListenThread(); ++ super.networkTick(); + } + ++ /** ++ * Gets MinecraftServer instance. ++ */ + public IntegratedServer getIntegratedServer() { + return (IntegratedServer)super.getServer(); + } diff --git a/patches/net/minecraft/src/InventoryBasic.java.patch b/patches/net/minecraft/src/InventoryBasic.java.patch new file mode 100644 index 0000000..09eb53c --- /dev/null +++ b/patches/net/minecraft/src/InventoryBasic.java.patch @@ -0,0 +1,206 @@ +--- net/minecraft/src/InventoryBasic.java ++++ net/minecraft/src/InventoryBasic.java +@@ -4,47 +4,56 @@ + import java.util.List; + + public class InventoryBasic implements IInventory { +- private String a; ++ private String inventoryTitle; + private int slotsCount; + private ItemStack[] inventoryContents; +- private List d; ++ private List field_70480_d; + private boolean field_94051_e; + +- public InventoryBasic(String var1, boolean var2, int var3) { +- this.a = var1; +- this.field_94051_e = var2; +- this.slotsCount = var3; +- this.inventoryContents = new ItemStack[var3]; ++ public InventoryBasic(String par1Str, boolean par2, int par3) { ++ this.inventoryTitle = par1Str; ++ this.field_94051_e = par2; ++ this.slotsCount = par3; ++ this.inventoryContents = new ItemStack[par3]; + } + +- public void func_110134_a(IInvBasic var1) { +- if(this.d == null) { +- this.d = new ArrayList(); ++ public void func_110134_a(IInvBasic par1IInvBasic) { ++ if (this.field_70480_d == null) { ++ this.field_70480_d = new ArrayList(); + } + +- this.d.add(var1); +- } +- +- public void func_110132_b(IInvBasic var1) { +- this.d.remove(var1); +- } +- +- public ItemStack getStackInSlot(int var1) { +- return this.inventoryContents[var1]; +- } +- +- public ItemStack decrStackSize(int var1, int var2) { +- if(this.inventoryContents[var1] != null) { ++ this.field_70480_d.add(par1IInvBasic); ++ } ++ ++ public void func_110132_b(IInvBasic par1IInvBasic) { ++ this.field_70480_d.remove(par1IInvBasic); ++ } ++ ++ /** ++ * Returns the stack in slot i ++ */ ++ public ItemStack getStackInSlot(int par1) { ++ return this.inventoryContents[par1]; ++ } ++ ++ /** ++ * Removes from an inventory slot (first arg) up to a specified number (second arg) of items and returns them in a new ++ * stack. ++ */ ++ public ItemStack decrStackSize(int par1, int par2) { ++ if (this.inventoryContents[par1] != null) { + ItemStack var3; +- if(this.inventoryContents[var1].stackSize <= var2) { +- var3 = this.inventoryContents[var1]; +- this.inventoryContents[var1] = null; ++ ++ if (this.inventoryContents[par1].stackSize <= par2) { ++ var3 = this.inventoryContents[par1]; ++ this.inventoryContents[par1] = null; + this.onInventoryChanged(); + return var3; + } else { +- var3 = this.inventoryContents[var1].splitStack(var2); +- if(this.inventoryContents[var1].stackSize == 0) { +- this.inventoryContents[var1] = null; ++ var3 = this.inventoryContents[par1].splitStack(par2); ++ ++ if (this.inventoryContents[par1].stackSize == 0) { ++ this.inventoryContents[par1] = null; + } + + this.onInventoryChanged(); +@@ -55,66 +64,94 @@ + } + } + +- public ItemStack getStackInSlotOnClosing(int var1) { +- if(this.inventoryContents[var1] != null) { +- ItemStack var2 = this.inventoryContents[var1]; +- this.inventoryContents[var1] = null; ++ /** ++ * When some containers are closed they call this on each slot, then drop whatever it returns as an EntityItem - like ++ * when you close a workbench GUI. ++ */ ++ public ItemStack getStackInSlotOnClosing(int par1) { ++ if (this.inventoryContents[par1] != null) { ++ ItemStack var2 = this.inventoryContents[par1]; ++ this.inventoryContents[par1] = null; + return var2; + } else { + return null; + } + } + +- public void setInventorySlotContents(int var1, ItemStack var2) { +- this.inventoryContents[var1] = var2; +- if(var2 != null && var2.stackSize > this.getInventoryStackLimit()) { +- var2.stackSize = this.getInventoryStackLimit(); ++ /** ++ * Sets the given item stack to the specified slot in the inventory (can be crafting or armor sections). ++ */ ++ public void setInventorySlotContents(int par1, ItemStack par2ItemStack) { ++ this.inventoryContents[par1] = par2ItemStack; ++ ++ if (par2ItemStack != null && par2ItemStack.stackSize > this.getInventoryStackLimit()) { ++ par2ItemStack.stackSize = this.getInventoryStackLimit(); + } + + this.onInventoryChanged(); + } + ++ /** ++ * Returns the number of slots in the inventory. ++ */ + public int getSizeInventory() { + return this.slotsCount; + } + ++ /** ++ * Returns the name of the inventory. ++ */ + public String getInvName() { +- return this.a; ++ return this.inventoryTitle; + } + ++ /** ++ * If this returns false, the inventory name will be used as an unlocalized name, and translated into the player's ++ * language. Otherwise it will be used directly. ++ */ + public boolean isInvNameLocalized() { + return this.field_94051_e; + } + +- public void func_110133_a(String var1) { ++ public void func_110133_a(String par1Str) { + this.field_94051_e = true; +- this.a = var1; ++ this.inventoryTitle = par1Str; + } + ++ /** ++ * Returns the maximum stack size for a inventory slot. Seems to always be 64, possibly will be extended. *Isn't this ++ * more of a set than a get?* ++ */ + public int getInventoryStackLimit() { + return 64; + } + ++ /** ++ * Called when an the contents of an Inventory change, usually ++ */ + public void onInventoryChanged() { +- if(this.d != null) { +- for(int var1 = 0; var1 < this.d.size(); ++var1) { +- ((IInvBasic)this.d.get(var1)).onInventoryChanged(this); ++ if (this.field_70480_d != null) { ++ for (int var1 = 0; var1 < this.field_70480_d.size(); ++var1) { ++ ((IInvBasic)this.field_70480_d.get(var1)).onInventoryChanged(this); + } + } +- + } + +- public boolean isUseableByPlayer(EntityPlayer var1) { ++ /** ++ * Do not make give this method the name canInteractWith because it clashes with Container ++ */ ++ public boolean isUseableByPlayer(EntityPlayer par1EntityPlayer) { + return true; + } + +- public void openChest() { +- } +- +- public void closeChest() { +- } +- +- public boolean isItemValidForSlot(int var1, ItemStack var2) { ++ public void openChest() {} ++ ++ public void closeChest() {} ++ ++ /** ++ * Returns true if automation is allowed to insert the given stack (ignoring stack size) into the given slot. ++ */ ++ public boolean isItemValidForSlot(int par1, ItemStack par2ItemStack) { + return true; + } + } diff --git a/patches/net/minecraft/src/InventoryCraftResult.java.patch b/patches/net/minecraft/src/InventoryCraftResult.java.patch new file mode 100644 index 0000000..f87d455 --- /dev/null +++ b/patches/net/minecraft/src/InventoryCraftResult.java.patch @@ -0,0 +1,120 @@ +--- net/minecraft/src/InventoryCraftResult.java ++++ net/minecraft/src/InventoryCraftResult.java +@@ -1,26 +1,45 @@ + package net.minecraft.src; + + public class InventoryCraftResult implements IInventory { ++ ++ /** A list of one item containing the result of the crafting formula */ + private ItemStack[] stackResult = new ItemStack[1]; + ++ /** ++ * Returns the number of slots in the inventory. ++ */ + public int getSizeInventory() { + return 1; + } + +- public ItemStack getStackInSlot(int var1) { ++ /** ++ * Returns the stack in slot i ++ */ ++ public ItemStack getStackInSlot(int par1) { + return this.stackResult[0]; + } + ++ /** ++ * Returns the name of the inventory. ++ */ + public String getInvName() { + return "Result"; + } + ++ /** ++ * If this returns false, the inventory name will be used as an unlocalized name, and translated into the player's ++ * language. Otherwise it will be used directly. ++ */ + public boolean isInvNameLocalized() { + return false; + } + +- public ItemStack decrStackSize(int var1, int var2) { +- if(this.stackResult[0] != null) { ++ /** ++ * Removes from an inventory slot (first arg) up to a specified number (second arg) of items and returns them in a new ++ * stack. ++ */ ++ public ItemStack decrStackSize(int par1, int par2) { ++ if (this.stackResult[0] != null) { + ItemStack var3 = this.stackResult[0]; + this.stackResult[0] = null; + return var3; +@@ -29,8 +48,12 @@ + } + } + +- public ItemStack getStackInSlotOnClosing(int var1) { +- if(this.stackResult[0] != null) { ++ /** ++ * When some containers are closed they call this on each slot, then drop whatever it returns as an EntityItem - like ++ * when you close a workbench GUI. ++ */ ++ public ItemStack getStackInSlotOnClosing(int par1) { ++ if (this.stackResult[0] != null) { + ItemStack var2 = this.stackResult[0]; + this.stackResult[0] = null; + return var2; +@@ -39,28 +62,41 @@ + } + } + +- public void setInventorySlotContents(int var1, ItemStack var2) { +- this.stackResult[0] = var2; ++ /** ++ * Sets the given item stack to the specified slot in the inventory (can be crafting or armor sections). ++ */ ++ public void setInventorySlotContents(int par1, ItemStack par2ItemStack) { ++ this.stackResult[0] = par2ItemStack; + } + ++ /** ++ * Returns the maximum stack size for a inventory slot. Seems to always be 64, possibly will be extended. *Isn't this ++ * more of a set than a get?* ++ */ + public int getInventoryStackLimit() { + return 64; + } + +- public void onInventoryChanged() { +- } ++ /** ++ * Called when an the contents of an Inventory change, usually ++ */ ++ public void onInventoryChanged() {} + +- public boolean isUseableByPlayer(EntityPlayer var1) { ++ /** ++ * Do not make give this method the name canInteractWith because it clashes with Container ++ */ ++ public boolean isUseableByPlayer(EntityPlayer par1EntityPlayer) { + return true; + } + +- public void openChest() { +- } +- +- public void closeChest() { +- } +- +- public boolean isItemValidForSlot(int var1, ItemStack var2) { ++ public void openChest() {} ++ ++ public void closeChest() {} ++ ++ /** ++ * Returns true if automation is allowed to insert the given stack (ignoring stack size) into the given slot. ++ */ ++ public boolean isItemValidForSlot(int par1, ItemStack par2ItemStack) { + return true; + } + } diff --git a/patches/net/minecraft/src/InventoryCrafting.java.patch b/patches/net/minecraft/src/InventoryCrafting.java.patch new file mode 100644 index 0000000..30200a1 --- /dev/null +++ b/patches/net/minecraft/src/InventoryCrafting.java.patch @@ -0,0 +1,177 @@ +--- net/minecraft/src/InventoryCrafting.java ++++ net/minecraft/src/InventoryCrafting.java +@@ -1,64 +1,98 @@ + package net.minecraft.src; + + public class InventoryCrafting implements IInventory { ++ ++ /** List of the stacks in the crafting matrix. */ + private ItemStack[] stackList; ++ ++ /** the width of the crafting inventory */ + private int inventoryWidth; ++ ++ /** ++ * Class containing the callbacks for the events on_GUIClosed and on_CraftMaxtrixChanged. ++ */ + private Container eventHandler; + +- public InventoryCrafting(Container var1, int var2, int var3) { +- int var4 = var2 * var3; ++ public InventoryCrafting(Container par1Container, int par2, int par3) { ++ int var4 = par2 * par3; + this.stackList = new ItemStack[var4]; +- this.eventHandler = var1; +- this.inventoryWidth = var2; ++ this.eventHandler = par1Container; ++ this.inventoryWidth = par2; + } + ++ /** ++ * Returns the number of slots in the inventory. ++ */ + public int getSizeInventory() { + return this.stackList.length; + } + +- public ItemStack getStackInSlot(int var1) { +- return var1 >= this.getSizeInventory() ? null : this.stackList[var1]; ++ /** ++ * Returns the stack in slot i ++ */ ++ public ItemStack getStackInSlot(int par1) { ++ return par1 >= this.getSizeInventory() ? null : this.stackList[par1]; + } + +- public ItemStack getStackInRowAndColumn(int var1, int var2) { +- if(var1 >= 0 && var1 < this.inventoryWidth) { +- int var3 = var1 + var2 * this.inventoryWidth; ++ /** ++ * Returns the itemstack in the slot specified (Top left is 0, 0). Args: row, column ++ */ ++ public ItemStack getStackInRowAndColumn(int par1, int par2) { ++ if (par1 >= 0 && par1 < this.inventoryWidth) { ++ int var3 = par1 + par2 * this.inventoryWidth; + return this.getStackInSlot(var3); + } else { + return null; + } + } + ++ /** ++ * Returns the name of the inventory. ++ */ + public String getInvName() { + return "container.crafting"; + } + ++ /** ++ * If this returns false, the inventory name will be used as an unlocalized name, and translated into the player's ++ * language. Otherwise it will be used directly. ++ */ + public boolean isInvNameLocalized() { + return false; + } + +- public ItemStack getStackInSlotOnClosing(int var1) { +- if(this.stackList[var1] != null) { +- ItemStack var2 = this.stackList[var1]; +- this.stackList[var1] = null; ++ /** ++ * When some containers are closed they call this on each slot, then drop whatever it returns as an EntityItem - like ++ * when you close a workbench GUI. ++ */ ++ public ItemStack getStackInSlotOnClosing(int par1) { ++ if (this.stackList[par1] != null) { ++ ItemStack var2 = this.stackList[par1]; ++ this.stackList[par1] = null; + return var2; + } else { + return null; + } + } + +- public ItemStack decrStackSize(int var1, int var2) { +- if(this.stackList[var1] != null) { ++ /** ++ * Removes from an inventory slot (first arg) up to a specified number (second arg) of items and returns them in a new ++ * stack. ++ */ ++ public ItemStack decrStackSize(int par1, int par2) { ++ if (this.stackList[par1] != null) { + ItemStack var3; +- if(this.stackList[var1].stackSize <= var2) { +- var3 = this.stackList[var1]; +- this.stackList[var1] = null; ++ ++ if (this.stackList[par1].stackSize <= par2) { ++ var3 = this.stackList[par1]; ++ this.stackList[par1] = null; + this.eventHandler.onCraftMatrixChanged(this); + return var3; + } else { +- var3 = this.stackList[var1].splitStack(var2); +- if(this.stackList[var1].stackSize == 0) { +- this.stackList[var1] = null; ++ var3 = this.stackList[par1].splitStack(par2); ++ ++ if (this.stackList[par1].stackSize == 0) { ++ this.stackList[par1] = null; + } + + this.eventHandler.onCraftMatrixChanged(this); +@@ -69,29 +103,42 @@ + } + } + +- public void setInventorySlotContents(int var1, ItemStack var2) { +- this.stackList[var1] = var2; ++ /** ++ * Sets the given item stack to the specified slot in the inventory (can be crafting or armor sections). ++ */ ++ public void setInventorySlotContents(int par1, ItemStack par2ItemStack) { ++ this.stackList[par1] = par2ItemStack; + this.eventHandler.onCraftMatrixChanged(this); + } + ++ /** ++ * Returns the maximum stack size for a inventory slot. Seems to always be 64, possibly will be extended. *Isn't this ++ * more of a set than a get?* ++ */ + public int getInventoryStackLimit() { + return 64; + } + +- public void onInventoryChanged() { +- } ++ /** ++ * Called when an the contents of an Inventory change, usually ++ */ ++ public void onInventoryChanged() {} + +- public boolean isUseableByPlayer(EntityPlayer var1) { ++ /** ++ * Do not make give this method the name canInteractWith because it clashes with Container ++ */ ++ public boolean isUseableByPlayer(EntityPlayer par1EntityPlayer) { + return true; + } + +- public void openChest() { +- } +- +- public void closeChest() { +- } +- +- public boolean isItemValidForSlot(int var1, ItemStack var2) { ++ public void openChest() {} ++ ++ public void closeChest() {} ++ ++ /** ++ * Returns true if automation is allowed to insert the given stack (ignoring stack size) into the given slot. ++ */ ++ public boolean isItemValidForSlot(int par1, ItemStack par2ItemStack) { + return true; + } + } diff --git a/patches/net/minecraft/src/InventoryEffectRenderer.java.patch b/patches/net/minecraft/src/InventoryEffectRenderer.java.patch new file mode 100644 index 0000000..4891756 --- /dev/null +++ b/patches/net/minecraft/src/InventoryEffectRenderer.java.patch @@ -0,0 +1,105 @@ +--- net/minecraft/src/InventoryEffectRenderer.java ++++ net/minecraft/src/InventoryEffectRenderer.java +@@ -2,62 +2,78 @@ + + import java.util.Collection; + import java.util.Iterator; ++ + import org.lwjgl.opengl.GL11; + + public abstract class InventoryEffectRenderer extends GuiContainer { + private boolean field_74222_o; + +- public InventoryEffectRenderer(Container var1) { +- super(var1); ++ public InventoryEffectRenderer(Container par1Container) { ++ super(par1Container); + } + ++ /** ++ * Adds the buttons (and other controls) to the screen in question. ++ */ + public void initGui() { + super.initGui(); +- if(!this.mc.thePlayer.getActivePotionEffects().isEmpty()) { ++ ++ if (!this.mc.thePlayer.getActivePotionEffects().isEmpty()) { + this.guiLeft = 160 + (this.width - this.xSize - 200) / 2; + this.field_74222_o = true; + } +- + } + +- public void drawScreen(int var1, int var2, float var3) { +- super.drawScreen(var1, var2, var3); +- if(this.field_74222_o) { ++ /** ++ * Draws the screen and all the components in it. ++ */ ++ public void drawScreen(int par1, int par2, float par3) { ++ super.drawScreen(par1, par2, par3); ++ ++ if (this.field_74222_o) { + this.displayDebuffEffects(); + } +- + } + ++ /** ++ * Displays debuff/potion effects that are currently being applied to the player ++ */ + private void displayDebuffEffects() { +- int var1 = this.guiLeft - 124; ++ // Spout Start ++ int var1 = this.guiLeft - 142; ++ // Spout End + int var2 = this.guiTop; + boolean var3 = true; + Collection var4 = this.mc.thePlayer.getActivePotionEffects(); +- if(!var4.isEmpty()) { ++ ++ if (!var4.isEmpty()) { + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + GL11.glDisable(GL11.GL_LIGHTING); + int var5 = 33; +- if(var4.size() > 5) { ++ ++ if (var4.size() > 5) { + var5 = 132 / (var4.size() - 1); + } + +- for(Iterator var6 = this.mc.thePlayer.getActivePotionEffects().iterator(); var6.hasNext(); var2 += var5) { ++ for (Iterator var6 = this.mc.thePlayer.getActivePotionEffects().iterator(); var6.hasNext(); var2 += var5) { + PotionEffect var7 = (PotionEffect)var6.next(); + Potion var8 = Potion.potionTypes[var7.getPotionID()]; + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + this.mc.getTextureManager().bindTexture(field_110408_a); + this.drawTexturedModalRect(var1, var2, 0, 166, 140, 32); +- if(var8.hasStatusIcon()) { ++ ++ if (var8.hasStatusIcon()) { + int var9 = var8.getStatusIconIndex(); + this.drawTexturedModalRect(var1 + 6, var2 + 7, 0 + var9 % 8 * 18, 198 + var9 / 8 * 18, 18, 18); + } + + String var11 = I18n.getString(var8.getName()); +- if(var7.getAmplifier() == 1) { ++ ++ if (var7.getAmplifier() == 1) { + var11 = var11 + " II"; +- } else if(var7.getAmplifier() == 2) { ++ } else if (var7.getAmplifier() == 2) { + var11 = var11 + " III"; +- } else if(var7.getAmplifier() == 3) { ++ } else if (var7.getAmplifier() == 3) { + var11 = var11 + " IV"; + } + +@@ -65,7 +81,6 @@ + String var10 = Potion.getDurationString(var7); + this.fontRenderer.drawStringWithShadow(var10, var1 + 10 + 18, var2 + 6 + 10, 8355711); + } +- + } + } + } diff --git a/patches/net/minecraft/src/InventoryEnderChest.java.patch b/patches/net/minecraft/src/InventoryEnderChest.java.patch new file mode 100644 index 0000000..a4e5073 --- /dev/null +++ b/patches/net/minecraft/src/InventoryEnderChest.java.patch @@ -0,0 +1,87 @@ +--- net/minecraft/src/InventoryEnderChest.java ++++ net/minecraft/src/InventoryEnderChest.java +@@ -7,32 +7,34 @@ + super("container.enderchest", false, 27); + } + +- public void setAssociatedChest(TileEntityEnderChest var1) { +- this.associatedChest = var1; ++ public void setAssociatedChest(TileEntityEnderChest par1TileEntityEnderChest) { ++ this.associatedChest = par1TileEntityEnderChest; + } + +- public void loadInventoryFromNBT(NBTTagList var1) { ++ public void loadInventoryFromNBT(NBTTagList par1NBTTagList) { + int var2; +- for(var2 = 0; var2 < this.getSizeInventory(); ++var2) { ++ ++ for (var2 = 0; var2 < this.getSizeInventory(); ++var2) { + this.setInventorySlotContents(var2, (ItemStack)null); + } + +- for(var2 = 0; var2 < var1.tagCount(); ++var2) { +- NBTTagCompound var3 = (NBTTagCompound)var1.tagAt(var2); ++ for (var2 = 0; var2 < par1NBTTagList.tagCount(); ++var2) { ++ NBTTagCompound var3 = (NBTTagCompound)par1NBTTagList.tagAt(var2); + int var4 = var3.getByte("Slot") & 255; +- if(var4 >= 0 && var4 < this.getSizeInventory()) { ++ ++ if (var4 >= 0 && var4 < this.getSizeInventory()) { + this.setInventorySlotContents(var4, ItemStack.loadItemStackFromNBT(var3)); + } + } +- + } + + public NBTTagList saveInventoryToNBT() { + NBTTagList var1 = new NBTTagList("EnderItems"); + +- for(int var2 = 0; var2 < this.getSizeInventory(); ++var2) { ++ for (int var2 = 0; var2 < this.getSizeInventory(); ++var2) { + ItemStack var3 = this.getStackInSlot(var2); +- if(var3 != null) { ++ ++ if (var3 != null) { + NBTTagCompound var4 = new NBTTagCompound(); + var4.setByte("Slot", (byte)var2); + var3.writeToNBT(var4); +@@ -43,12 +45,15 @@ + return var1; + } + +- public boolean isUseableByPlayer(EntityPlayer var1) { +- return this.associatedChest != null && !this.associatedChest.isUseableByPlayer(var1) ? false : super.isUseableByPlayer(var1); ++ /** ++ * Do not make give this method the name canInteractWith because it clashes with Container ++ */ ++ public boolean isUseableByPlayer(EntityPlayer par1EntityPlayer) { ++ return this.associatedChest != null && !this.associatedChest.isUseableByPlayer(par1EntityPlayer) ? false : super.isUseableByPlayer(par1EntityPlayer); + } + + public void openChest() { +- if(this.associatedChest != null) { ++ if (this.associatedChest != null) { + this.associatedChest.openChest(); + } + +@@ -56,7 +61,7 @@ + } + + public void closeChest() { +- if(this.associatedChest != null) { ++ if (this.associatedChest != null) { + this.associatedChest.closeChest(); + } + +@@ -64,7 +69,10 @@ + this.associatedChest = null; + } + +- public boolean isItemValidForSlot(int var1, ItemStack var2) { ++ /** ++ * Returns true if automation is allowed to insert the given stack (ignoring stack size) into the given slot. ++ */ ++ public boolean isItemValidForSlot(int par1, ItemStack par2ItemStack) { + return true; + } + } diff --git a/patches/net/minecraft/src/InventoryLargeChest.java.patch b/patches/net/minecraft/src/InventoryLargeChest.java.patch new file mode 100644 index 0000000..3b4d4e7 --- /dev/null +++ b/patches/net/minecraft/src/InventoryLargeChest.java.patch @@ -0,0 +1,165 @@ +--- net/minecraft/src/InventoryLargeChest.java ++++ net/minecraft/src/InventoryLargeChest.java +@@ -1,72 +1,115 @@ + package net.minecraft.src; + + public class InventoryLargeChest implements IInventory { +- private String a; ++ ++ /** Name of the chest. */ ++ private String name; ++ ++ /** Inventory object corresponding to double chest upper part */ + private IInventory upperChest; ++ ++ /** Inventory object corresponding to double chest lower part */ + private IInventory lowerChest; + +- public InventoryLargeChest(String var1, IInventory var2, IInventory var3) { +- this.a = var1; +- if(var2 == null) { +- var2 = var3; +- } +- +- if(var3 == null) { +- var3 = var2; +- } +- +- this.upperChest = var2; +- this.lowerChest = var3; ++ public InventoryLargeChest(String par1Str, IInventory par2IInventory, IInventory par3IInventory) { ++ this.name = par1Str; ++ ++ if (par2IInventory == null) { ++ par2IInventory = par3IInventory; ++ } ++ ++ if (par3IInventory == null) { ++ par3IInventory = par2IInventory; ++ } ++ ++ this.upperChest = par2IInventory; ++ this.lowerChest = par3IInventory; + } + ++ /** ++ * Returns the number of slots in the inventory. ++ */ + public int getSizeInventory() { + return this.upperChest.getSizeInventory() + this.lowerChest.getSizeInventory(); + } + +- public boolean isPartOfLargeChest(IInventory var1) { +- return this.upperChest == var1 || this.lowerChest == var1; ++ /** ++ * Return whether the given inventory is part of this large chest. ++ */ ++ public boolean isPartOfLargeChest(IInventory par1IInventory) { ++ return this.upperChest == par1IInventory || this.lowerChest == par1IInventory; + } + ++ /** ++ * Returns the name of the inventory. ++ */ + public String getInvName() { +- return this.upperChest.isInvNameLocalized() ? this.upperChest.getInvName() : (this.lowerChest.isInvNameLocalized() ? this.lowerChest.getInvName() : this.a); ++ return this.upperChest.isInvNameLocalized() ? this.upperChest.getInvName() : (this.lowerChest.isInvNameLocalized() ? this.lowerChest.getInvName() : this.name); + } + ++ /** ++ * If this returns false, the inventory name will be used as an unlocalized name, and translated into the player's ++ * language. Otherwise it will be used directly. ++ */ + public boolean isInvNameLocalized() { + return this.upperChest.isInvNameLocalized() || this.lowerChest.isInvNameLocalized(); + } + +- public ItemStack getStackInSlot(int var1) { +- return var1 >= this.upperChest.getSizeInventory() ? this.lowerChest.getStackInSlot(var1 - this.upperChest.getSizeInventory()) : this.upperChest.getStackInSlot(var1); +- } +- +- public ItemStack decrStackSize(int var1, int var2) { +- return var1 >= this.upperChest.getSizeInventory() ? this.lowerChest.decrStackSize(var1 - this.upperChest.getSizeInventory(), var2) : this.upperChest.decrStackSize(var1, var2); +- } +- +- public ItemStack getStackInSlotOnClosing(int var1) { +- return var1 >= this.upperChest.getSizeInventory() ? this.lowerChest.getStackInSlotOnClosing(var1 - this.upperChest.getSizeInventory()) : this.upperChest.getStackInSlotOnClosing(var1); +- } +- +- public void setInventorySlotContents(int var1, ItemStack var2) { +- if(var1 >= this.upperChest.getSizeInventory()) { +- this.lowerChest.setInventorySlotContents(var1 - this.upperChest.getSizeInventory(), var2); ++ /** ++ * Returns the stack in slot i ++ */ ++ public ItemStack getStackInSlot(int par1) { ++ return par1 >= this.upperChest.getSizeInventory() ? this.lowerChest.getStackInSlot(par1 - this.upperChest.getSizeInventory()) : this.upperChest.getStackInSlot(par1); ++ } ++ ++ /** ++ * Removes from an inventory slot (first arg) up to a specified number (second arg) of items and returns them in a new ++ * stack. ++ */ ++ public ItemStack decrStackSize(int par1, int par2) { ++ return par1 >= this.upperChest.getSizeInventory() ? this.lowerChest.decrStackSize(par1 - this.upperChest.getSizeInventory(), par2) : this.upperChest.decrStackSize(par1, par2); ++ } ++ ++ /** ++ * When some containers are closed they call this on each slot, then drop whatever it returns as an EntityItem - like ++ * when you close a workbench GUI. ++ */ ++ public ItemStack getStackInSlotOnClosing(int par1) { ++ return par1 >= this.upperChest.getSizeInventory() ? this.lowerChest.getStackInSlotOnClosing(par1 - this.upperChest.getSizeInventory()) : this.upperChest.getStackInSlotOnClosing(par1); ++ } ++ ++ /** ++ * Sets the given item stack to the specified slot in the inventory (can be crafting or armor sections). ++ */ ++ public void setInventorySlotContents(int par1, ItemStack par2ItemStack) { ++ if (par1 >= this.upperChest.getSizeInventory()) { ++ this.lowerChest.setInventorySlotContents(par1 - this.upperChest.getSizeInventory(), par2ItemStack); + } else { +- this.upperChest.setInventorySlotContents(var1, var2); ++ this.upperChest.setInventorySlotContents(par1, par2ItemStack); + } +- + } + ++ /** ++ * Returns the maximum stack size for a inventory slot. Seems to always be 64, possibly will be extended. *Isn't this ++ * more of a set than a get?* ++ */ + public int getInventoryStackLimit() { + return this.upperChest.getInventoryStackLimit(); + } + ++ /** ++ * Called when an the contents of an Inventory change, usually ++ */ + public void onInventoryChanged() { + this.upperChest.onInventoryChanged(); + this.lowerChest.onInventoryChanged(); + } + +- public boolean isUseableByPlayer(EntityPlayer var1) { +- return this.upperChest.isUseableByPlayer(var1) && this.lowerChest.isUseableByPlayer(var1); ++ /** ++ * Do not make give this method the name canInteractWith because it clashes with Container ++ */ ++ public boolean isUseableByPlayer(EntityPlayer par1EntityPlayer) { ++ return this.upperChest.isUseableByPlayer(par1EntityPlayer) && this.lowerChest.isUseableByPlayer(par1EntityPlayer); + } + + public void openChest() { +@@ -79,7 +122,10 @@ + this.lowerChest.closeChest(); + } + +- public boolean isItemValidForSlot(int var1, ItemStack var2) { ++ /** ++ * Returns true if automation is allowed to insert the given stack (ignoring stack size) into the given slot. ++ */ ++ public boolean isItemValidForSlot(int par1, ItemStack par2ItemStack) { + return true; + } + } diff --git a/patches/net/minecraft/src/InventoryMerchant.java.patch b/patches/net/minecraft/src/InventoryMerchant.java.patch new file mode 100644 index 0000000..2d555e6 --- /dev/null +++ b/patches/net/minecraft/src/InventoryMerchant.java.patch @@ -0,0 +1,230 @@ +--- net/minecraft/src/InventoryMerchant.java ++++ net/minecraft/src/InventoryMerchant.java +@@ -7,41 +7,54 @@ + private MerchantRecipe currentRecipe; + private int currentRecipeIndex; + +- public InventoryMerchant(EntityPlayer var1, IMerchant var2) { +- this.thePlayer = var1; +- this.theMerchant = var2; ++ public InventoryMerchant(EntityPlayer par1EntityPlayer, IMerchant par2IMerchant) { ++ this.thePlayer = par1EntityPlayer; ++ this.theMerchant = par2IMerchant; + } + ++ /** ++ * Returns the number of slots in the inventory. ++ */ + public int getSizeInventory() { + return this.theInventory.length; + } + +- public ItemStack getStackInSlot(int var1) { +- return this.theInventory[var1]; ++ /** ++ * Returns the stack in slot i ++ */ ++ public ItemStack getStackInSlot(int par1) { ++ return this.theInventory[par1]; + } + +- public ItemStack decrStackSize(int var1, int var2) { +- if(this.theInventory[var1] != null) { ++ /** ++ * Removes from an inventory slot (first arg) up to a specified number (second arg) of items and returns them in a new ++ * stack. ++ */ ++ public ItemStack decrStackSize(int par1, int par2) { ++ if (this.theInventory[par1] != null) { + ItemStack var3; +- if(var1 == 2) { +- var3 = this.theInventory[var1]; +- this.theInventory[var1] = null; ++ ++ if (par1 == 2) { ++ var3 = this.theInventory[par1]; ++ this.theInventory[par1] = null; + return var3; +- } else if(this.theInventory[var1].stackSize <= var2) { +- var3 = this.theInventory[var1]; +- this.theInventory[var1] = null; +- if(this.inventoryResetNeededOnSlotChange(var1)) { ++ } else if (this.theInventory[par1].stackSize <= par2) { ++ var3 = this.theInventory[par1]; ++ this.theInventory[par1] = null; ++ ++ if (this.inventoryResetNeededOnSlotChange(par1)) { + this.resetRecipeAndSlots(); + } + + return var3; + } else { +- var3 = this.theInventory[var1].splitStack(var2); +- if(this.theInventory[var1].stackSize == 0) { +- this.theInventory[var1] = null; ++ var3 = this.theInventory[par1].splitStack(par2); ++ ++ if (this.theInventory[par1].stackSize == 0) { ++ this.theInventory[par1] = null; + } + +- if(this.inventoryResetNeededOnSlotChange(var1)) { ++ if (this.inventoryResetNeededOnSlotChange(par1)) { + this.resetRecipeAndSlots(); + } + +@@ -52,58 +65,86 @@ + } + } + +- private boolean inventoryResetNeededOnSlotChange(int var1) { +- return var1 == 0 || var1 == 1; ++ /** ++ * if par1 slot has changed, does resetRecipeAndSlots need to be called? ++ */ ++ private boolean inventoryResetNeededOnSlotChange(int par1) { ++ return par1 == 0 || par1 == 1; + } + +- public ItemStack getStackInSlotOnClosing(int var1) { +- if(this.theInventory[var1] != null) { +- ItemStack var2 = this.theInventory[var1]; +- this.theInventory[var1] = null; ++ /** ++ * When some containers are closed they call this on each slot, then drop whatever it returns as an EntityItem - like ++ * when you close a workbench GUI. ++ */ ++ public ItemStack getStackInSlotOnClosing(int par1) { ++ if (this.theInventory[par1] != null) { ++ ItemStack var2 = this.theInventory[par1]; ++ this.theInventory[par1] = null; + return var2; + } else { + return null; + } + } + +- public void setInventorySlotContents(int var1, ItemStack var2) { +- this.theInventory[var1] = var2; +- if(var2 != null && var2.stackSize > this.getInventoryStackLimit()) { +- var2.stackSize = this.getInventoryStackLimit(); ++ /** ++ * Sets the given item stack to the specified slot in the inventory (can be crafting or armor sections). ++ */ ++ public void setInventorySlotContents(int par1, ItemStack par2ItemStack) { ++ this.theInventory[par1] = par2ItemStack; ++ ++ if (par2ItemStack != null && par2ItemStack.stackSize > this.getInventoryStackLimit()) { ++ par2ItemStack.stackSize = this.getInventoryStackLimit(); + } + +- if(this.inventoryResetNeededOnSlotChange(var1)) { ++ if (this.inventoryResetNeededOnSlotChange(par1)) { + this.resetRecipeAndSlots(); + } +- + } + ++ /** ++ * Returns the name of the inventory. ++ */ + public String getInvName() { + return "mob.villager"; + } + ++ /** ++ * If this returns false, the inventory name will be used as an unlocalized name, and translated into the player's ++ * language. Otherwise it will be used directly. ++ */ + public boolean isInvNameLocalized() { + return false; + } + ++ /** ++ * Returns the maximum stack size for a inventory slot. Seems to always be 64, possibly will be extended. *Isn't this ++ * more of a set than a get?* ++ */ + public int getInventoryStackLimit() { + return 64; + } + +- public boolean isUseableByPlayer(EntityPlayer var1) { +- return this.theMerchant.getCustomer() == var1; +- } +- +- public void openChest() { +- } +- +- public void closeChest() { +- } +- +- public boolean isItemValidForSlot(int var1, ItemStack var2) { ++ /** ++ * Do not make give this method the name canInteractWith because it clashes with Container ++ */ ++ public boolean isUseableByPlayer(EntityPlayer par1EntityPlayer) { ++ return this.theMerchant.getCustomer() == par1EntityPlayer; ++ } ++ ++ public void openChest() {} ++ ++ public void closeChest() {} ++ ++ /** ++ * Returns true if automation is allowed to insert the given stack (ignoring stack size) into the given slot. ++ */ ++ public boolean isItemValidForSlot(int par1, ItemStack par2ItemStack) { + return true; + } + ++ /** ++ * Called when an the contents of an Inventory change, usually ++ */ + public void onInventoryChanged() { + this.resetRecipeAndSlots(); + } +@@ -112,23 +153,27 @@ + this.currentRecipe = null; + ItemStack var1 = this.theInventory[0]; + ItemStack var2 = this.theInventory[1]; +- if(var1 == null) { ++ ++ if (var1 == null) { + var1 = var2; + var2 = null; + } + +- if(var1 == null) { ++ if (var1 == null) { + this.setInventorySlotContents(2, (ItemStack)null); + } else { + MerchantRecipeList var3 = this.theMerchant.getRecipes(this.thePlayer); +- if(var3 != null) { ++ ++ if (var3 != null) { + MerchantRecipe var4 = var3.canRecipeBeUsed(var1, var2, this.currentRecipeIndex); +- if(var4 != null && !var4.func_82784_g()) { ++ ++ if (var4 != null && !var4.func_82784_g()) { + this.currentRecipe = var4; + this.setInventorySlotContents(2, var4.getItemToSell().copy()); +- } else if(var2 != null) { ++ } else if (var2 != null) { + var4 = var3.canRecipeBeUsed(var2, var1, this.currentRecipeIndex); +- if(var4 != null && !var4.func_82784_g()) { ++ ++ if (var4 != null && !var4.func_82784_g()) { + this.currentRecipe = var4; + this.setInventorySlotContents(2, var4.getItemToSell().copy()); + } else { +@@ -147,8 +192,8 @@ + return this.currentRecipe; + } + +- public void setCurrentRecipeIndex(int var1) { +- this.currentRecipeIndex = var1; ++ public void setCurrentRecipeIndex(int par1) { ++ this.currentRecipeIndex = par1; + this.resetRecipeAndSlots(); + } + } diff --git a/patches/net/minecraft/src/InventoryPlayer.java.patch b/patches/net/minecraft/src/InventoryPlayer.java.patch new file mode 100644 index 0000000..b822b13 --- /dev/null +++ b/patches/net/minecraft/src/InventoryPlayer.java.patch @@ -0,0 +1,858 @@ +--- net/minecraft/src/InventoryPlayer.java ++++ net/minecraft/src/InventoryPlayer.java +@@ -1,29 +1,55 @@ + package net.minecraft.src; + + public class InventoryPlayer implements IInventory { ++ ++ /** ++ * An array of 36 item stacks indicating the main player inventory (including the visible bar). ++ */ + public ItemStack[] mainInventory = new ItemStack[36]; ++ ++ /** An array of 4 item stacks containing the currently worn armor pieces. */ + public ItemStack[] armorInventory = new ItemStack[4]; ++ ++ /** The index of the currently held item (0-8). */ + public int currentItem; ++ ++ /** The current ItemStack. */ + private ItemStack currentItemStack; ++ ++ /** The player whose inventory this is. */ + public EntityPlayer player; + private ItemStack itemStack; ++ ++ /** ++ * Set true whenever the inventory changes. Nothing sets it false so you will have to write your own code to check it ++ * and reset the value. ++ */ + public boolean inventoryChanged; + +- public InventoryPlayer(EntityPlayer var1) { +- this.player = var1; ++ public InventoryPlayer(EntityPlayer par1EntityPlayer) { ++ this.player = par1EntityPlayer; + } + ++ /** ++ * Returns the item stack currently held by the player. ++ */ + public ItemStack getCurrentItem() { + return this.currentItem < 9 && this.currentItem >= 0 ? this.mainInventory[this.currentItem] : null; + } + ++ /** ++ * Get the size of the player hotbar inventory ++ */ + public static int getHotbarSize() { + return 9; + } + +- private int getInventorySlotContainItem(int var1) { +- for(int var2 = 0; var2 < this.mainInventory.length; ++var2) { +- if(this.mainInventory[var2] != null && this.mainInventory[var2].itemID == var1) { ++ /** ++ * Returns a slot index in main inventory containing a specific itemID ++ */ ++ private int getInventorySlotContainItem(int par1) { ++ for (int var2 = 0; var2 < this.mainInventory.length; ++var2) { ++ if (this.mainInventory[var2] != null && this.mainInventory[var2].itemID == par1) { + return var2; + } + } +@@ -31,9 +57,9 @@ + return -1; + } + +- private int getInventorySlotContainItemAndDamage(int var1, int var2) { +- for(int var3 = 0; var3 < this.mainInventory.length; ++var3) { +- if(this.mainInventory[var3] != null && this.mainInventory[var3].itemID == var1 && this.mainInventory[var3].getItemDamage() == var2) { ++ private int getInventorySlotContainItemAndDamage(int par1, int par2) { ++ for (int var3 = 0; var3 < this.mainInventory.length; ++var3) { ++ if (this.mainInventory[var3] != null && this.mainInventory[var3].itemID == par1 && this.mainInventory[var3].getItemDamage() == par2) { + return var3; + } + } +@@ -41,9 +67,12 @@ + return -1; + } + +- private int storeItemStack(ItemStack var1) { +- for(int var2 = 0; var2 < this.mainInventory.length; ++var2) { +- if(this.mainInventory[var2] != null && this.mainInventory[var2].itemID == var1.itemID && this.mainInventory[var2].isStackable() && this.mainInventory[var2].stackSize < this.mainInventory[var2].getMaxStackSize() && this.mainInventory[var2].stackSize < this.getInventoryStackLimit() && (!this.mainInventory[var2].getHasSubtypes() || this.mainInventory[var2].getItemDamage() == var1.getItemDamage()) && ItemStack.areItemStackTagsEqual(this.mainInventory[var2], var1)) { ++ /** ++ * stores an itemstack in the users inventory ++ */ ++ private int storeItemStack(ItemStack par1ItemStack) { ++ for (int var2 = 0; var2 < this.mainInventory.length; ++var2) { ++ if (this.mainInventory[var2] != null && this.mainInventory[var2].itemID == par1ItemStack.itemID && this.mainInventory[var2].isStackable() && this.mainInventory[var2].stackSize < this.mainInventory[var2].getMaxStackSize() && this.mainInventory[var2].stackSize < this.getInventoryStackLimit() && (!this.mainInventory[var2].getHasSubtypes() || this.mainInventory[var2].getItemDamage() == par1ItemStack.getItemDamage()) && ItemStack.areItemStackTagsEqual(this.mainInventory[var2], par1ItemStack)) { + return var2; + } + } +@@ -51,9 +80,12 @@ + return -1; + } + ++ /** ++ * Returns the first item stack that is empty. ++ */ + public int getFirstEmptyStack() { +- for(int var1 = 0; var1 < this.mainInventory.length; ++var1) { +- if(this.mainInventory[var1] == null) { ++ for (int var1 = 0; var1 < this.mainInventory.length; ++var1) { ++ if (this.mainInventory[var1] == null) { + return var1; + } + } +@@ -61,76 +93,88 @@ + return -1; + } + +- public void setCurrentItem(int var1, int var2, boolean var3, boolean var4) { ++ /** ++ * Sets a specific itemID as the current item being held (only if it exists on the hotbar) ++ */ ++ public void setCurrentItem(int par1, int par2, boolean par3, boolean par4) { + boolean var5 = true; + this.currentItemStack = this.getCurrentItem(); + int var7; +- if(var3) { +- var7 = this.getInventorySlotContainItemAndDamage(var1, var2); ++ ++ if (par3) { ++ var7 = this.getInventorySlotContainItemAndDamage(par1, par2); + } else { +- var7 = this.getInventorySlotContainItem(var1); ++ var7 = this.getInventorySlotContainItem(par1); + } + +- if(var7 >= 0 && var7 < 9) { ++ if (var7 >= 0 && var7 < 9) { + this.currentItem = var7; + } else { +- if(var4 && var1 > 0) { ++ if (par4 && par1 > 0) { + int var6 = this.getFirstEmptyStack(); +- if(var6 >= 0 && var6 < 9) { ++ ++ if (var6 >= 0 && var6 < 9) { + this.currentItem = var6; + } + +- this.func_70439_a(Item.itemsList[var1], var2); ++ this.func_70439_a(Item.itemsList[par1], par2); + } +- + } + } + +- public void changeCurrentItem(int var1) { +- if(var1 > 0) { +- var1 = 1; +- } +- +- if(var1 < 0) { +- var1 = -1; +- } +- +- for(this.currentItem -= var1; this.currentItem < 0; this.currentItem += 9) { +- } +- +- while(this.currentItem >= 9) { ++ /** ++ * Switch the current item to the next one or the previous one ++ */ ++ public void changeCurrentItem(int par1) { ++ if (par1 > 0) { ++ par1 = 1; ++ } ++ ++ if (par1 < 0) { ++ par1 = -1; ++ } ++ ++ for (this.currentItem -= par1; this.currentItem < 0; this.currentItem += 9) { ++ ; ++ } ++ ++ while (this.currentItem >= 9) { + this.currentItem -= 9; + } +- + } + +- public int clearInventory(int var1, int var2) { ++ /** ++ * Clear this player's inventory, using the specified ID and metadata as filters or -1 for no filter. ++ */ ++ public int clearInventory(int par1, int par2) { + int var3 = 0; +- + int var4; + ItemStack var5; +- for(var4 = 0; var4 < this.mainInventory.length; ++var4) { ++ ++ for (var4 = 0; var4 < this.mainInventory.length; ++var4) { + var5 = this.mainInventory[var4]; +- if(var5 != null && (var1 <= -1 || var5.itemID == var1) && (var2 <= -1 || var5.getItemDamage() == var2)) { ++ ++ if (var5 != null && (par1 <= -1 || var5.itemID == par1) && (par2 <= -1 || var5.getItemDamage() == par2)) { + var3 += var5.stackSize; + this.mainInventory[var4] = null; + } + } + +- for(var4 = 0; var4 < this.armorInventory.length; ++var4) { ++ for (var4 = 0; var4 < this.armorInventory.length; ++var4) { + var5 = this.armorInventory[var4]; +- if(var5 != null && (var1 <= -1 || var5.itemID == var1) && (var2 <= -1 || var5.getItemDamage() == var2)) { ++ ++ if (var5 != null && (par1 <= -1 || var5.itemID == par1) && (par2 <= -1 || var5.getItemDamage() == par2)) { + var3 += var5.stackSize; + this.armorInventory[var4] = null; + } + } + +- if(this.itemStack != null) { +- if(var1 > -1 && this.itemStack.itemID != var1) { ++ if (this.itemStack != null) { ++ if (par1 > -1 && this.itemStack.itemID != par1) { + return var3; + } + +- if(var2 > -1 && this.itemStack.getItemDamage() != var2) { ++ if (par2 > -1 && this.itemStack.getItemDamage() != par2) { + return var3; + } + +@@ -141,65 +185,74 @@ + return var3; + } + +- public void func_70439_a(Item var1, int var2) { +- if(var1 != null) { +- if(this.currentItemStack != null && this.currentItemStack.isItemEnchantable() && this.getInventorySlotContainItemAndDamage(this.currentItemStack.itemID, this.currentItemStack.getItemDamageForDisplay()) == this.currentItem) { ++ public void func_70439_a(Item par1Item, int par2) { ++ if (par1Item != null) { ++ if (this.currentItemStack != null && this.currentItemStack.isItemEnchantable() && this.getInventorySlotContainItemAndDamage(this.currentItemStack.itemID, this.currentItemStack.getItemDamageForDisplay()) == this.currentItem) { + return; + } + +- int var3 = this.getInventorySlotContainItemAndDamage(var1.itemID, var2); +- if(var3 >= 0) { ++ int var3 = this.getInventorySlotContainItemAndDamage(par1Item.itemID, par2); ++ ++ if (var3 >= 0) { + int var4 = this.mainInventory[var3].stackSize; + this.mainInventory[var3] = this.mainInventory[this.currentItem]; +- this.mainInventory[this.currentItem] = new ItemStack(Item.itemsList[var1.itemID], var4, var2); ++ this.mainInventory[this.currentItem] = new ItemStack(Item.itemsList[par1Item.itemID], var4, par2); + } else { +- this.mainInventory[this.currentItem] = new ItemStack(Item.itemsList[var1.itemID], 1, var2); ++ this.mainInventory[this.currentItem] = new ItemStack(Item.itemsList[par1Item.itemID], 1, par2); + } + } +- + } + +- private int storePartialItemStack(ItemStack var1) { +- int var2 = var1.itemID; +- int var3 = var1.stackSize; ++ /** ++ * This function stores as many items of an ItemStack as possible in a matching slot and returns the quantity of left ++ * over items. ++ */ ++ private int storePartialItemStack(ItemStack par1ItemStack) { ++ int var2 = par1ItemStack.itemID; ++ int var3 = par1ItemStack.stackSize; + int var4; +- if(var1.getMaxStackSize() == 1) { ++ ++ if (par1ItemStack.getMaxStackSize() == 1) { + var4 = this.getFirstEmptyStack(); +- if(var4 < 0) { ++ ++ if (var4 < 0) { + return var3; + } else { +- if(this.mainInventory[var4] == null) { +- this.mainInventory[var4] = ItemStack.copyItemStack(var1); ++ if (this.mainInventory[var4] == null) { ++ this.mainInventory[var4] = ItemStack.copyItemStack(par1ItemStack); + } + + return 0; + } + } else { +- var4 = this.storeItemStack(var1); +- if(var4 < 0) { ++ var4 = this.storeItemStack(par1ItemStack); ++ ++ if (var4 < 0) { + var4 = this.getFirstEmptyStack(); + } + +- if(var4 < 0) { ++ if (var4 < 0) { + return var3; + } else { +- if(this.mainInventory[var4] == null) { +- this.mainInventory[var4] = new ItemStack(var2, 0, var1.getItemDamage()); +- if(var1.hasTagCompound()) { +- this.mainInventory[var4].setTagCompound((NBTTagCompound)var1.getTagCompound().copy()); ++ if (this.mainInventory[var4] == null) { ++ this.mainInventory[var4] = new ItemStack(var2, 0, par1ItemStack.getItemDamage()); ++ ++ if (par1ItemStack.hasTagCompound()) { ++ this.mainInventory[var4].setTagCompound((NBTTagCompound)par1ItemStack.getTagCompound().copy()); + } + } + + int var5 = var3; +- if(var3 > this.mainInventory[var4].getMaxStackSize() - this.mainInventory[var4].stackSize) { ++ ++ if (var3 > this.mainInventory[var4].getMaxStackSize() - this.mainInventory[var4].stackSize) { + var5 = this.mainInventory[var4].getMaxStackSize() - this.mainInventory[var4].stackSize; + } + +- if(var5 > this.getInventoryStackLimit() - this.mainInventory[var4].stackSize) { ++ if (var5 > this.getInventoryStackLimit() - this.mainInventory[var4].stackSize) { + var5 = this.getInventoryStackLimit() - this.mainInventory[var4].stackSize; + } + +- if(var5 == 0) { ++ if (var5 == 0) { + return var3; + } else { + var3 -= var5; +@@ -211,21 +264,28 @@ + } + } + ++ /** ++ * Decrement the number of animations remaining. Only called on client side. This is used to handle the animation of ++ * receiving a block. ++ */ + public void decrementAnimations() { +- for(int var1 = 0; var1 < this.mainInventory.length; ++var1) { +- if(this.mainInventory[var1] != null) { ++ for (int var1 = 0; var1 < this.mainInventory.length; ++var1) { ++ if (this.mainInventory[var1] != null) { + this.mainInventory[var1].updateAnimation(this.player.worldObj, this.player, var1, this.currentItem == var1); + } + } +- + } + +- public boolean consumeInventoryItem(int var1) { +- int var2 = this.getInventorySlotContainItem(var1); +- if(var2 < 0) { ++ /** ++ * removed one item of specified itemID from inventory (if it is in a stack, the stack size will reduce with 1) ++ */ ++ public boolean consumeInventoryItem(int par1) { ++ int var2 = this.getInventorySlotContainItem(par1); ++ ++ if (var2 < 0) { + return false; + } else { +- if(--this.mainInventory[var2].stackSize <= 0) { ++ if (--this.mainInventory[var2].stackSize <= 0) { + this.mainInventory[var2] = null; + } + +@@ -233,73 +293,88 @@ + } + } + +- public boolean hasItem(int var1) { +- int var2 = this.getInventorySlotContainItem(var1); ++ /** ++ * Get if a specifiied item id is inside the inventory. ++ */ ++ public boolean hasItem(int par1) { ++ int var2 = this.getInventorySlotContainItem(par1); + return var2 >= 0; + } + +- public boolean addItemStackToInventory(ItemStack var1) { +- if(var1 == null) { ++ /** ++ * Adds the item stack to the inventory, returns false if it is impossible. ++ */ ++ public boolean addItemStackToInventory(ItemStack par1ItemStack) { ++ if (par1ItemStack == null) { + return false; +- } else if(var1.stackSize == 0) { ++ } else if (par1ItemStack.stackSize == 0) { + return false; + } else { + try { + int var2; +- if(var1.isItemDamaged()) { ++ ++ if (par1ItemStack.isItemDamaged()) { + var2 = this.getFirstEmptyStack(); +- if(var2 >= 0) { +- this.mainInventory[var2] = ItemStack.copyItemStack(var1); ++ ++ if (var2 >= 0) { ++ this.mainInventory[var2] = ItemStack.copyItemStack(par1ItemStack); + this.mainInventory[var2].animationsToGo = 5; +- var1.stackSize = 0; ++ par1ItemStack.stackSize = 0; + return true; +- } else if(this.player.capabilities.isCreativeMode) { +- var1.stackSize = 0; ++ } else if (this.player.capabilities.isCreativeMode) { ++ par1ItemStack.stackSize = 0; + return true; + } else { + return false; + } + } else { + do { +- var2 = var1.stackSize; +- var1.stackSize = this.storePartialItemStack(var1); +- } while(var1.stackSize > 0 && var1.stackSize < var2); ++ var2 = par1ItemStack.stackSize; ++ par1ItemStack.stackSize = this.storePartialItemStack(par1ItemStack); ++ } while (par1ItemStack.stackSize > 0 && par1ItemStack.stackSize < var2); + +- if(var1.stackSize == var2 && this.player.capabilities.isCreativeMode) { +- var1.stackSize = 0; ++ if (par1ItemStack.stackSize == var2 && this.player.capabilities.isCreativeMode) { ++ par1ItemStack.stackSize = 0; + return true; + } else { +- return var1.stackSize < var2; ++ return par1ItemStack.stackSize < var2; + } + } + } catch (Throwable var5) { + CrashReport var3 = CrashReport.makeCrashReport(var5, "Adding item to inventory"); + CrashReportCategory var4 = var3.makeCategory("Item being added"); +- var4.addCrashSection("Item ID", Integer.valueOf(var1.itemID)); +- var4.addCrashSection("Item data", Integer.valueOf(var1.getItemDamage())); +- var4.addCrashSectionCallable("Item name", new CallableItemName(this, var1)); ++ var4.addCrashSection("Item ID", Integer.valueOf(par1ItemStack.itemID)); ++ var4.addCrashSection("Item data", Integer.valueOf(par1ItemStack.getItemDamage())); ++ var4.addCrashSectionCallable("Item name", new CallableItemName(this, par1ItemStack)); + throw new ReportedException(var3); + } + } + } + +- public ItemStack decrStackSize(int var1, int var2) { ++ /** ++ * Removes from an inventory slot (first arg) up to a specified number (second arg) of items and returns them in a new ++ * stack. ++ */ ++ public ItemStack decrStackSize(int par1, int par2) { + ItemStack[] var3 = this.mainInventory; +- if(var1 >= this.mainInventory.length) { ++ ++ if (par1 >= this.mainInventory.length) { + var3 = this.armorInventory; +- var1 -= this.mainInventory.length; ++ par1 -= this.mainInventory.length; + } + +- if(var3[var1] != null) { ++ if (var3[par1] != null) { + ItemStack var4; +- if(var3[var1].stackSize <= var2) { +- var4 = var3[var1]; +- var3[var1] = null; ++ ++ if (var3[par1].stackSize <= par2) { ++ var4 = var3[par1]; ++ var3[par1] = null; + return var4; + } else { +- var4 = var3[var1].splitStack(var2); +- if(var3[var1].stackSize == 0) { +- var3[var1] = null; ++ var4 = var3[par1].splitStack(par2); ++ ++ if (var3[par1].stackSize == 0) { ++ var3[par1] = null; + } + + return var4; +@@ -309,130 +384,178 @@ + } + } + +- public ItemStack getStackInSlotOnClosing(int var1) { ++ /** ++ * When some containers are closed they call this on each slot, then drop whatever it returns as an EntityItem - like ++ * when you close a workbench GUI. ++ */ ++ public ItemStack getStackInSlotOnClosing(int par1) { + ItemStack[] var2 = this.mainInventory; +- if(var1 >= this.mainInventory.length) { ++ ++ if (par1 >= this.mainInventory.length) { + var2 = this.armorInventory; +- var1 -= this.mainInventory.length; ++ par1 -= this.mainInventory.length; + } + +- if(var2[var1] != null) { +- ItemStack var3 = var2[var1]; +- var2[var1] = null; ++ if (var2[par1] != null) { ++ ItemStack var3 = var2[par1]; ++ var2[par1] = null; + return var3; + } else { + return null; + } + } + +- public void setInventorySlotContents(int var1, ItemStack var2) { ++ /** ++ * Sets the given item stack to the specified slot in the inventory (can be crafting or armor sections). ++ */ ++ public void setInventorySlotContents(int par1, ItemStack par2ItemStack) { + ItemStack[] var3 = this.mainInventory; +- if(var1 >= var3.length) { +- var1 -= var3.length; ++ ++ if (par1 >= var3.length) { ++ par1 -= var3.length; + var3 = this.armorInventory; + } + +- var3[var1] = var2; ++ var3[par1] = par2ItemStack; + } + +- public float getStrVsBlock(Block var1) { ++ /** ++ * Gets the strength of the current item (tool) against the specified block, 1.0f if not holding anything. ++ */ ++ public float getStrVsBlock(Block par1Block) { + float var2 = 1.0F; +- if(this.mainInventory[this.currentItem] != null) { +- var2 *= this.mainInventory[this.currentItem].getStrVsBlock(var1); ++ ++ if (this.mainInventory[this.currentItem] != null) { ++ var2 *= this.mainInventory[this.currentItem].getStrVsBlock(par1Block); + } + + return var2; + } + +- public NBTTagList writeToNBT(NBTTagList var1) { ++ /** ++ * Writes the inventory out as a list of compound tags. This is where the slot indices are used (+100 for armor, +80 ++ * for crafting). ++ */ ++ public NBTTagList writeToNBT(NBTTagList par1NBTTagList) { + int var2; + NBTTagCompound var3; +- for(var2 = 0; var2 < this.mainInventory.length; ++var2) { +- if(this.mainInventory[var2] != null) { ++ ++ for (var2 = 0; var2 < this.mainInventory.length; ++var2) { ++ if (this.mainInventory[var2] != null) { + var3 = new NBTTagCompound(); + var3.setByte("Slot", (byte)var2); + this.mainInventory[var2].writeToNBT(var3); +- var1.appendTag(var3); ++ par1NBTTagList.appendTag(var3); + } + } + +- for(var2 = 0; var2 < this.armorInventory.length; ++var2) { +- if(this.armorInventory[var2] != null) { ++ for (var2 = 0; var2 < this.armorInventory.length; ++var2) { ++ if (this.armorInventory[var2] != null) { + var3 = new NBTTagCompound(); + var3.setByte("Slot", (byte)(var2 + 100)); + this.armorInventory[var2].writeToNBT(var3); +- var1.appendTag(var3); ++ par1NBTTagList.appendTag(var3); + } + } + +- return var1; ++ return par1NBTTagList; + } + +- public void readFromNBT(NBTTagList var1) { ++ /** ++ * Reads from the given tag list and fills the slots in the inventory with the correct items. ++ */ ++ public void readFromNBT(NBTTagList par1NBTTagList) { + this.mainInventory = new ItemStack[36]; + this.armorInventory = new ItemStack[4]; + +- for(int var2 = 0; var2 < var1.tagCount(); ++var2) { +- NBTTagCompound var3 = (NBTTagCompound)var1.tagAt(var2); ++ for (int var2 = 0; var2 < par1NBTTagList.tagCount(); ++var2) { ++ NBTTagCompound var3 = (NBTTagCompound)par1NBTTagList.tagAt(var2); + int var4 = var3.getByte("Slot") & 255; + ItemStack var5 = ItemStack.loadItemStackFromNBT(var3); +- if(var5 != null) { +- if(var4 >= 0 && var4 < this.mainInventory.length) { ++ ++ if (var5 != null) { ++ if (var4 >= 0 && var4 < this.mainInventory.length) { + this.mainInventory[var4] = var5; + } + +- if(var4 >= 100 && var4 < this.armorInventory.length + 100) { ++ if (var4 >= 100 && var4 < this.armorInventory.length + 100) { + this.armorInventory[var4 - 100] = var5; + } + } + } +- + } + ++ /** ++ * Returns the number of slots in the inventory. ++ */ + public int getSizeInventory() { + return this.mainInventory.length + 4; + } + +- public ItemStack getStackInSlot(int var1) { ++ /** ++ * Returns the stack in slot i ++ */ ++ public ItemStack getStackInSlot(int par1) { + ItemStack[] var2 = this.mainInventory; +- if(var1 >= var2.length) { +- var1 -= var2.length; ++ ++ if (par1 >= var2.length) { ++ par1 -= var2.length; + var2 = this.armorInventory; + } + +- return var2[var1]; ++ return var2[par1]; + } + ++ /** ++ * Returns the name of the inventory. ++ */ + public String getInvName() { + return "container.inventory"; + } + ++ /** ++ * If this returns false, the inventory name will be used as an unlocalized name, and translated into the player's ++ * language. Otherwise it will be used directly. ++ */ + public boolean isInvNameLocalized() { + return false; + } + ++ /** ++ * Returns the maximum stack size for a inventory slot. Seems to always be 64, possibly will be extended. *Isn't this ++ * more of a set than a get?* ++ */ + public int getInventoryStackLimit() { + return 64; + } + +- public boolean canHarvestBlock(Block var1) { +- if(var1.blockMaterial.isToolNotRequired()) { ++ /** ++ * Returns whether the current item (tool) can harvest from the specified block (actually get a result). ++ */ ++ public boolean canHarvestBlock(Block par1Block) { ++ if (par1Block.blockMaterial.isToolNotRequired()) { + return true; + } else { + ItemStack var2 = this.getStackInSlot(this.currentItem); +- return var2 != null ? var2.canHarvestBlock(var1) : false; ++ return var2 != null ? var2.canHarvestBlock(par1Block) : false; + } + } + +- public ItemStack armorItemInSlot(int var1) { +- return this.armorInventory[var1]; ++ /** ++ * returns a player armor item (as itemstack) contained in specified armor slot. ++ */ ++ public ItemStack armorItemInSlot(int par1) { ++ return this.armorInventory[par1]; + } + ++ /** ++ * Based on the damage values and maximum damage values of each armor item, returns the current armor value. ++ */ + public int getTotalArmorValue() { + int var1 = 0; + +- for(int var2 = 0; var2 < this.armorInventory.length; ++var2) { +- if(this.armorInventory[var2] != null && this.armorInventory[var2].getItem() instanceof ItemArmor) { ++ for (int var2 = 0; var2 < this.armorInventory.length; ++var2) { ++ if (this.armorInventory[var2] != null && this.armorInventory[var2].getItem() instanceof ItemArmor) { + int var3 = ((ItemArmor)this.armorInventory[var2].getItem()).damageReduceAmount; + var1 += var3; + } +@@ -441,67 +564,84 @@ + return var1; + } + +- public void damageArmor(float var1) { +- var1 /= 4.0F; +- if(var1 < 1.0F) { +- var1 = 1.0F; ++ /** ++ * Damages armor in each slot by the specified amount. ++ */ ++ public void damageArmor(float par1) { ++ par1 /= 4.0F; ++ ++ if (par1 < 1.0F) { ++ par1 = 1.0F; + } + +- for(int var2 = 0; var2 < this.armorInventory.length; ++var2) { +- if(this.armorInventory[var2] != null && this.armorInventory[var2].getItem() instanceof ItemArmor) { +- this.armorInventory[var2].damageItem((int)var1, this.player); +- if(this.armorInventory[var2].stackSize == 0) { ++ for (int var2 = 0; var2 < this.armorInventory.length; ++var2) { ++ if (this.armorInventory[var2] != null && this.armorInventory[var2].getItem() instanceof ItemArmor) { ++ this.armorInventory[var2].damageItem((int)par1, this.player); ++ ++ if (this.armorInventory[var2].stackSize == 0) { + this.armorInventory[var2] = null; + } + } + } +- + } + ++ /** ++ * Drop all armor and main inventory items. ++ */ + public void dropAllItems() { + int var1; +- for(var1 = 0; var1 < this.mainInventory.length; ++var1) { +- if(this.mainInventory[var1] != null) { ++ ++ for (var1 = 0; var1 < this.mainInventory.length; ++var1) { ++ if (this.mainInventory[var1] != null) { + this.player.dropPlayerItemWithRandomChoice(this.mainInventory[var1], true); + this.mainInventory[var1] = null; + } + } + +- for(var1 = 0; var1 < this.armorInventory.length; ++var1) { +- if(this.armorInventory[var1] != null) { ++ for (var1 = 0; var1 < this.armorInventory.length; ++var1) { ++ if (this.armorInventory[var1] != null) { + this.player.dropPlayerItemWithRandomChoice(this.armorInventory[var1], true); + this.armorInventory[var1] = null; + } + } +- + } + ++ /** ++ * Called when an the contents of an Inventory change, usually ++ */ + public void onInventoryChanged() { + this.inventoryChanged = true; + } + +- public void setItemStack(ItemStack var1) { +- this.itemStack = var1; ++ public void setItemStack(ItemStack par1ItemStack) { ++ this.itemStack = par1ItemStack; + } + + public ItemStack getItemStack() { + return this.itemStack; + } + +- public boolean isUseableByPlayer(EntityPlayer var1) { +- return this.player.isDead ? false : var1.getDistanceSqToEntity(this.player) <= 64.0D; ++ /** ++ * Do not make give this method the name canInteractWith because it clashes with Container ++ */ ++ public boolean isUseableByPlayer(EntityPlayer par1EntityPlayer) { ++ return this.player.isDead ? false : par1EntityPlayer.getDistanceSqToEntity(this.player) <= 64.0D; + } + +- public boolean hasItemStack(ItemStack var1) { ++ /** ++ * Returns true if the specified ItemStack exists in the inventory. ++ */ ++ public boolean hasItemStack(ItemStack par1ItemStack) { + int var2; +- for(var2 = 0; var2 < this.armorInventory.length; ++var2) { +- if(this.armorInventory[var2] != null && this.armorInventory[var2].isItemEqual(var1)) { ++ ++ for (var2 = 0; var2 < this.armorInventory.length; ++var2) { ++ if (this.armorInventory[var2] != null && this.armorInventory[var2].isItemEqual(par1ItemStack)) { + return true; + } + } + +- for(var2 = 0; var2 < this.mainInventory.length; ++var2) { +- if(this.mainInventory[var2] != null && this.mainInventory[var2].isItemEqual(var1)) { ++ for (var2 = 0; var2 < this.mainInventory.length; ++var2) { ++ if (this.mainInventory[var2] != null && this.mainInventory[var2].isItemEqual(par1ItemStack)) { + return true; + } + } +@@ -509,26 +649,31 @@ + return false; + } + +- public void openChest() { +- } +- +- public void closeChest() { +- } +- +- public boolean isItemValidForSlot(int var1, ItemStack var2) { ++ public void openChest() {} ++ ++ public void closeChest() {} ++ ++ /** ++ * Returns true if automation is allowed to insert the given stack (ignoring stack size) into the given slot. ++ */ ++ public boolean isItemValidForSlot(int par1, ItemStack par2ItemStack) { + return true; + } + +- public void copyInventory(InventoryPlayer var1) { ++ /** ++ * Copy the ItemStack contents from another InventoryPlayer instance ++ */ ++ public void copyInventory(InventoryPlayer par1InventoryPlayer) { + int var2; +- for(var2 = 0; var2 < this.mainInventory.length; ++var2) { +- this.mainInventory[var2] = ItemStack.copyItemStack(var1.mainInventory[var2]); +- } +- +- for(var2 = 0; var2 < this.armorInventory.length; ++var2) { +- this.armorInventory[var2] = ItemStack.copyItemStack(var1.armorInventory[var2]); +- } +- +- this.currentItem = var1.currentItem; ++ ++ for (var2 = 0; var2 < this.mainInventory.length; ++var2) { ++ this.mainInventory[var2] = ItemStack.copyItemStack(par1InventoryPlayer.mainInventory[var2]); ++ } ++ ++ for (var2 = 0; var2 < this.armorInventory.length; ++var2) { ++ this.armorInventory[var2] = ItemStack.copyItemStack(par1InventoryPlayer.armorInventory[var2]); ++ } ++ ++ this.currentItem = par1InventoryPlayer.currentItem; + } + } diff --git a/patches/net/minecraft/src/Item.java.patch b/patches/net/minecraft/src/Item.java.patch new file mode 100644 index 0000000..2fa611b --- /dev/null +++ b/patches/net/minecraft/src/Item.java.patch @@ -0,0 +1,703 @@ +--- net/minecraft/src/Item.java ++++ net/minecraft/src/Item.java +@@ -1,15 +1,22 @@ + package net.minecraft.src; + +-import com.google.common.collect.HashMultimap; +-import com.google.common.collect.Multimap; + import java.util.List; + import java.util.Random; + import java.util.UUID; + ++import com.google.common.collect.HashMultimap; ++import com.google.common.collect.Multimap; ++ ++import org.spoutcraft.client.item.SpoutItem; ++ + public class Item { +- protected static final UUID e = UUID.fromString("CB3F55D3-645C-4F38-A497-9C13A33DB5CF"); +- private CreativeTabs tabToDisplayOn; +- protected static Random f = new Random(); ++ protected static final UUID field_111210_e = UUID.fromString("CB3F55D3-645C-4F38-A497-9C13A33DB5CF"); ++ private CreativeTabs tabToDisplayOn; ++ ++ /** The RNG used by the Item subclasses. */ ++ protected static Random itemRand = new Random(); ++ ++ /** A 32000 elements Item array. */ + public static Item[] itemsList = new Item[32000]; + public static Item shovelIron = (new ItemSpade(0, EnumToolMaterial.IRON)).setUnlocalizedName("shovelIron").setTextureName("iron_shovel"); + public static Item pickaxeIron = (new ItemPickaxe(1, EnumToolMaterial.IRON)).setUnlocalizedName("pickaxeIron").setTextureName("iron_pickaxe"); +@@ -44,7 +51,7 @@ + public static Item axeGold = (new ItemAxe(30, EnumToolMaterial.GOLD)).setUnlocalizedName("hatchetGold").setTextureName("gold_axe"); + public static Item silk = (new ItemReed(31, Block.tripWire)).setUnlocalizedName("string").setCreativeTab(CreativeTabs.tabMaterials).setTextureName("string"); + public static Item feather = (new Item(32)).setUnlocalizedName("feather").setCreativeTab(CreativeTabs.tabMaterials).setTextureName("feather"); +- public static Item gunpowder = (new Item(33)).setUnlocalizedName("sulphur").setPotionEffect(PotionHelper.k).setCreativeTab(CreativeTabs.tabMaterials).setTextureName("gunpowder"); ++ public static Item gunpowder = (new Item(33)).setUnlocalizedName("sulphur").setPotionEffect(PotionHelper.gunpowderEffect).setCreativeTab(CreativeTabs.tabMaterials).setTextureName("gunpowder"); + public static Item hoeWood = (new ItemHoe(34, EnumToolMaterial.WOOD)).setUnlocalizedName("hoeWood").setTextureName("wood_hoe"); + public static Item hoeStone = (new ItemHoe(35, EnumToolMaterial.STONE)).setUnlocalizedName("hoeStone").setTextureName("stone_hoe"); + public static Item hoeIron = (new ItemHoe(36, EnumToolMaterial.IRON)).setUnlocalizedName("hoeIron").setTextureName("iron_hoe"); +@@ -73,7 +80,11 @@ + public static ItemArmor plateGold = (ItemArmor)(new ItemArmor(59, EnumArmorMaterial.GOLD, 4, 1)).setUnlocalizedName("chestplateGold").setTextureName("gold_chestplate"); + public static ItemArmor legsGold = (ItemArmor)(new ItemArmor(60, EnumArmorMaterial.GOLD, 4, 2)).setUnlocalizedName("leggingsGold").setTextureName("gold_leggings"); + public static ItemArmor bootsGold = (ItemArmor)(new ItemArmor(61, EnumArmorMaterial.GOLD, 4, 3)).setUnlocalizedName("bootsGold").setTextureName("gold_boots"); +- public static Item flint = (new Item(62)).setUnlocalizedName("flint").setCreativeTab(CreativeTabs.tabMaterials).setTextureName("flint"); ++ ++ // Spout Start - Changed to SpoutItemBlock ++ public static Item flint = (new SpoutItem(62)).setUnlocalizedName("flint").setCreativeTab(CreativeTabs.tabMaterials).setTextureName("flint"); ++ // Spout End ++ + public static Item porkRaw = (new ItemFood(63, 3, 0.3F, true)).setUnlocalizedName("porkchopRaw").setTextureName("porkchop_raw"); + public static Item porkCooked = (new ItemFood(64, 8, 0.8F, true)).setUnlocalizedName("porkchopCooked").setTextureName("porkchop_cooked"); + public static Item painting = (new ItemHangingEntity(65, EntityPainting.class)).setUnlocalizedName("painting").setTextureName("painting"); +@@ -86,7 +97,7 @@ + public static Item minecartEmpty = (new ItemMinecart(72, 0)).setUnlocalizedName("minecart").setTextureName("minecart_normal"); + public static Item saddle = (new ItemSaddle(73)).setUnlocalizedName("saddle").setTextureName("saddle"); + public static Item doorIron = (new ItemDoor(74, Material.iron)).setUnlocalizedName("doorIron").setTextureName("door_iron"); +- public static Item redstone = (new ItemRedstone(75)).setUnlocalizedName("redstone").setPotionEffect(PotionHelper.i).setTextureName("redstone_dust"); ++ public static Item redstone = (new ItemRedstone(75)).setUnlocalizedName("redstone").setPotionEffect(PotionHelper.redstoneEffect).setTextureName("redstone_dust"); + public static Item snowball = (new ItemSnowball(76)).setUnlocalizedName("snowball").setTextureName("snowball"); + public static Item boat = (new ItemBoat(77)).setUnlocalizedName("boat").setTextureName("boat"); + public static Item leather = (new Item(78)).setUnlocalizedName("leather").setCreativeTab(CreativeTabs.tabMaterials).setTextureName("leather"); +@@ -103,17 +114,21 @@ + public static Item compass = (new Item(89)).setUnlocalizedName("compass").setCreativeTab(CreativeTabs.tabTools).setTextureName("compass"); + public static ItemFishingRod fishingRod = (ItemFishingRod)(new ItemFishingRod(90)).setUnlocalizedName("fishingRod").setTextureName("fishing_rod"); + public static Item pocketSundial = (new Item(91)).setUnlocalizedName("clock").setCreativeTab(CreativeTabs.tabTools).setTextureName("clock"); +- public static Item glowstone = (new Item(92)).setUnlocalizedName("yellowDust").setPotionEffect(PotionHelper.j).setCreativeTab(CreativeTabs.tabMaterials).setTextureName("glowstone_dust"); ++ public static Item glowstone = (new Item(92)).setUnlocalizedName("yellowDust").setPotionEffect(PotionHelper.glowstoneEffect).setCreativeTab(CreativeTabs.tabMaterials).setTextureName("glowstone_dust"); + public static Item fishRaw = (new ItemFood(93, 2, 0.3F, false)).setUnlocalizedName("fishRaw").setTextureName("fish_raw"); + public static Item fishCooked = (new ItemFood(94, 5, 0.6F, false)).setUnlocalizedName("fishCooked").setTextureName("fish_cooked"); + public static Item dyePowder = (new ItemDye(95)).setUnlocalizedName("dyePowder").setTextureName("dye_powder"); + public static Item bone = (new Item(96)).setUnlocalizedName("bone").setFull3D().setCreativeTab(CreativeTabs.tabMisc).setTextureName("bone"); +- public static Item sugar = (new Item(97)).setUnlocalizedName("sugar").setPotionEffect(PotionHelper.b).setCreativeTab(CreativeTabs.tabMaterials).setTextureName("sugar"); ++ public static Item sugar = (new Item(97)).setUnlocalizedName("sugar").setPotionEffect(PotionHelper.sugarEffect).setCreativeTab(CreativeTabs.tabMaterials).setTextureName("sugar"); + public static Item cake = (new ItemReed(98, Block.cake)).setMaxStackSize(1).setUnlocalizedName("cake").setCreativeTab(CreativeTabs.tabFood).setTextureName("cake"); + public static Item bed = (new ItemBed(99)).setMaxStackSize(1).setUnlocalizedName("bed").setTextureName("bed"); + public static Item redstoneRepeater = (new ItemReed(100, Block.redstoneRepeaterIdle)).setUnlocalizedName("diode").setCreativeTab(CreativeTabs.tabRedstone).setTextureName("repeater"); + public static Item cookie = (new ItemFood(101, 2, 0.1F, false)).setUnlocalizedName("cookie").setTextureName("cookie"); + public static ItemMap map = (ItemMap)(new ItemMap(102)).setUnlocalizedName("map").setTextureName("map_filled"); ++ ++ /** ++ * Item introduced on 1.7 version, is a shear to cut leaves (you can keep the block) or get wool from sheeps. ++ */ + public static ItemShears shears = (ItemShears)(new ItemShears(103)).setUnlocalizedName("shears").setTextureName("shears"); + public static Item melon = (new ItemFood(104, 2, 0.3F, false)).setUnlocalizedName("melon").setTextureName("melon"); + public static Item pumpkinSeeds = (new ItemSeeds(105, Block.pumpkinStem.blockID, Block.tilledField.blockID)).setUnlocalizedName("seeds_pumpkin").setTextureName("seeds_pumpkin"); +@@ -125,21 +140,29 @@ + public static Item rottenFlesh = (new ItemFood(111, 4, 0.1F, true)).setPotionEffect(Potion.hunger.id, 30, 0, 0.8F).setUnlocalizedName("rottenFlesh").setTextureName("rotten_flesh"); + public static Item enderPearl = (new ItemEnderPearl(112)).setUnlocalizedName("enderPearl").setTextureName("ender_pearl"); + public static Item blazeRod = (new Item(113)).setUnlocalizedName("blazeRod").setCreativeTab(CreativeTabs.tabMaterials).setTextureName("blaze_rod"); +- public static Item ghastTear = (new Item(114)).setUnlocalizedName("ghastTear").setPotionEffect(PotionHelper.c).setCreativeTab(CreativeTabs.tabBrewing).setTextureName("ghast_tear"); ++ public static Item ghastTear = (new Item(114)).setUnlocalizedName("ghastTear").setPotionEffect(PotionHelper.ghastTearEffect).setCreativeTab(CreativeTabs.tabBrewing).setTextureName("ghast_tear"); + public static Item goldNugget = (new Item(115)).setUnlocalizedName("goldNugget").setCreativeTab(CreativeTabs.tabMaterials).setTextureName("gold_nugget"); + public static Item netherStalkSeeds = (new ItemSeeds(116, Block.netherStalk.blockID, Block.slowSand.blockID)).setUnlocalizedName("netherStalkSeeds").setPotionEffect("+4").setTextureName("nether_wart"); + public static ItemPotion potion = (ItemPotion)(new ItemPotion(117)).setUnlocalizedName("potion").setTextureName("potion"); + public static Item glassBottle = (new ItemGlassBottle(118)).setUnlocalizedName("glassBottle").setTextureName("potion_bottle_empty"); +- public static Item spiderEye = (new ItemFood(119, 2, 0.8F, false)).setPotionEffect(Potion.poison.id, 5, 0, 1.0F).setUnlocalizedName("spiderEye").setPotionEffect(PotionHelper.d).setTextureName("spider_eye"); +- public static Item fermentedSpiderEye = (new Item(120)).setUnlocalizedName("fermentedSpiderEye").setPotionEffect(PotionHelper.e).setCreativeTab(CreativeTabs.tabBrewing).setTextureName("spider_eye_fermented"); +- public static Item blazePowder = (new Item(121)).setUnlocalizedName("blazePowder").setPotionEffect(PotionHelper.g).setCreativeTab(CreativeTabs.tabBrewing).setTextureName("blaze_powder"); +- public static Item magmaCream = (new Item(122)).setUnlocalizedName("magmaCream").setPotionEffect(PotionHelper.h).setCreativeTab(CreativeTabs.tabBrewing).setTextureName("magma_cream"); ++ public static Item spiderEye = (new ItemFood(119, 2, 0.8F, false)).setPotionEffect(Potion.poison.id, 5, 0, 1.0F).setUnlocalizedName("spiderEye").setPotionEffect(PotionHelper.spiderEyeEffect).setTextureName("spider_eye"); ++ public static Item fermentedSpiderEye = (new Item(120)).setUnlocalizedName("fermentedSpiderEye").setPotionEffect(PotionHelper.fermentedSpiderEyeEffect).setCreativeTab(CreativeTabs.tabBrewing).setTextureName("spider_eye_fermented"); ++ public static Item blazePowder = (new Item(121)).setUnlocalizedName("blazePowder").setPotionEffect(PotionHelper.blazePowderEffect).setCreativeTab(CreativeTabs.tabBrewing).setTextureName("blaze_powder"); ++ public static Item magmaCream = (new Item(122)).setUnlocalizedName("magmaCream").setPotionEffect(PotionHelper.magmaCreamEffect).setCreativeTab(CreativeTabs.tabBrewing).setTextureName("magma_cream"); + public static Item brewingStand = (new ItemReed(123, Block.brewingStand)).setUnlocalizedName("brewingStand").setCreativeTab(CreativeTabs.tabBrewing).setTextureName("brewing_stand"); + public static Item cauldron = (new ItemReed(124, Block.cauldron)).setUnlocalizedName("cauldron").setCreativeTab(CreativeTabs.tabBrewing).setTextureName("cauldron"); + public static Item eyeOfEnder = (new ItemEnderEye(125)).setUnlocalizedName("eyeOfEnder").setTextureName("ender_eye"); +- public static Item speckledMelon = (new Item(126)).setUnlocalizedName("speckledMelon").setPotionEffect(PotionHelper.f).setCreativeTab(CreativeTabs.tabBrewing).setTextureName("melon_speckled"); ++ public static Item speckledMelon = (new Item(126)).setUnlocalizedName("speckledMelon").setPotionEffect(PotionHelper.speckledMelonEffect).setCreativeTab(CreativeTabs.tabBrewing).setTextureName("melon_speckled"); + public static Item monsterPlacer = (new ItemMonsterPlacer(127)).setUnlocalizedName("monsterPlacer").setTextureName("spawn_egg"); ++ ++ /** ++ * Bottle o' Enchanting. Drops between 1 and 3 experience orbs when thrown. ++ */ + public static Item expBottle = (new ItemExpBottle(128)).setUnlocalizedName("expBottle").setTextureName("experience_bottle"); ++ ++ /** ++ * Fire Charge. When used in a dispenser it fires a fireball similiar to a Ghast's. ++ */ + public static Item fireballCharge = (new ItemFireball(129)).setUnlocalizedName("fireball").setTextureName("fireball"); + public static Item writableBook = (new ItemWritableBook(130)).setUnlocalizedName("writingBook").setCreativeTab(CreativeTabs.tabMisc).setTextureName("book_writable"); + public static Item writtenBook = (new ItemEditableBook(131)).setUnlocalizedName("writtenBook").setTextureName("book_written"); +@@ -151,7 +174,7 @@ + public static Item bakedPotato = (new ItemFood(137, 6, 0.6F, false)).setUnlocalizedName("potatoBaked").setTextureName("potato_baked"); + public static Item poisonousPotato = (new ItemFood(138, 2, 0.3F, false)).setPotionEffect(Potion.poison.id, 5, 0, 0.6F).setUnlocalizedName("potatoPoisonous").setTextureName("potato_poisonous"); + public static ItemEmptyMap emptyMap = (ItemEmptyMap)(new ItemEmptyMap(139)).setUnlocalizedName("emptyMap").setTextureName("map_empty"); +- public static Item goldenCarrot = (new ItemFood(140, 6, 1.2F, false)).setUnlocalizedName("carrotGolden").setPotionEffect(PotionHelper.l).setTextureName("carrot_golden"); ++ public static Item goldenCarrot = (new ItemFood(140, 6, 1.2F, false)).setUnlocalizedName("carrotGolden").setPotionEffect(PotionHelper.goldenCarrotEffect).setTextureName("carrot_golden"); + public static Item skull = (new ItemSkull(141)).setUnlocalizedName("skull").setTextureName("skull"); + public static Item carrotOnAStick = (new ItemCarrotOnAStick(142)).setUnlocalizedName("carrotOnAStick").setTextureName("carrot_on_a_stick"); + public static Item netherStar = (new ItemSimpleFoiled(143)).setUnlocalizedName("netherStar").setCreativeTab(CreativeTabs.tabMaterials).setTextureName("nether_star"); +@@ -162,7 +185,7 @@ + public static Item comparator = (new ItemReed(148, Block.redstoneComparatorIdle)).setUnlocalizedName("comparator").setCreativeTab(CreativeTabs.tabRedstone).setTextureName("comparator"); + public static Item netherrackBrick = (new Item(149)).setUnlocalizedName("netherbrick").setCreativeTab(CreativeTabs.tabMaterials).setTextureName("netherbrick"); + public static Item netherQuartz = (new Item(150)).setUnlocalizedName("netherquartz").setCreativeTab(CreativeTabs.tabMaterials).setTextureName("quartz"); +- public static Item tntMinecart = (new ItemMinecart(151, 3)).setUnlocalizedName("minecartTnt").setTextureName("minecart_tnt"); ++ public static Item minecartTnt = (new ItemMinecart(151, 3)).setUnlocalizedName("minecartTnt").setTextureName("minecart_tnt"); + public static Item minecartHopper = (new ItemMinecart(152, 5)).setUnlocalizedName("minecartHopper").setTextureName("minecart_hopper"); + public static Item horseArmorIron = (new Item(161)).setUnlocalizedName("horsearmormetal").setMaxStackSize(1).setCreativeTab(CreativeTabs.tabMisc).setTextureName("iron_horse_armor"); + public static Item horseArmorGold = (new Item(162)).setUnlocalizedName("horsearmorgold").setMaxStackSize(1).setCreativeTab(CreativeTabs.tabMisc).setTextureName("gold_horse_armor"); +@@ -181,64 +204,109 @@ + public static Item recordWard = (new ItemRecord(2009, "ward")).setUnlocalizedName("record").setTextureName("record_ward"); + public static Item record11 = (new ItemRecord(2010, "11")).setUnlocalizedName("record").setTextureName("record_11"); + public static Item recordWait = (new ItemRecord(2011, "wait")).setUnlocalizedName("record").setTextureName("record_wait"); ++ ++ /** The ID of this item. */ + public final int itemID; ++ ++ /** Maximum size of the stack. */ + protected int maxStackSize = 64; ++ ++ /** Maximum damage an item can handle. */ + private int maxDamage; ++ ++ /** If true, render the object in full 3D, like weapons and tools. */ + protected boolean bFull3D; ++ ++ /** ++ * Some items (like dyes) have multiple subtypes on same item, this is field define this behavior ++ */ + protected boolean hasSubtypes; + private Item containerItem; +- private String d; +- private String cB; ++ private String potionEffect; ++ ++ /** The unlocalized name of this item. */ ++ private String unlocalizedName; ++ ++ /** Icon index in the icons table. */ + protected Icon itemIcon; +- protected String cA; +- +- protected Item(int var1) { +- this.itemID = 256 + var1; +- if(itemsList[256 + var1] != null) { +- System.out.println("CONFLICT @ " + var1); ++ ++ /** The string associated with this Item's Icon. */ ++ protected String iconString; ++ ++ protected Item(int par1) { ++ this.itemID = 256 + par1; ++ ++ if (itemsList[256 + par1] != null) { ++ System.out.println("CONFLICT @ " + par1); + } + +- itemsList[256 + var1] = this; ++ itemsList[256 + par1] = this; + } + +- public Item setMaxStackSize(int var1) { +- this.maxStackSize = var1; ++ public Item setMaxStackSize(int par1) { ++ this.maxStackSize = par1; + return this; + } + ++ /** ++ * Returns 0 for /terrain.png, 1 for /gui/items.png ++ */ + public int getSpriteNumber() { + return 1; + } + +- public Icon getIconFromDamage(int var1) { ++ /** ++ * Gets an icon index based on an item's damage value ++ */ ++ public Icon getIconFromDamage(int par1) { + return this.itemIcon; + } + +- public final Icon getIconIndex(ItemStack var1) { +- return this.getIconFromDamage(var1.getItemDamage()); ++ /** ++ * Returns the icon index of the stack given as argument. ++ */ ++ public final Icon getIconIndex(ItemStack par1ItemStack) { ++ return this.getIconFromDamage(par1ItemStack.getItemDamage()); + } + +- public boolean onItemUse(ItemStack var1, EntityPlayer var2, World var3, int var4, int var5, int var6, int var7, float var8, float var9, float var10) { ++ /** ++ * Callback for item usage. If the item does something special on right clicking, he will have one of those. Return ++ * True if something happen and false if it don't. This is for ITEMS, not BLOCKS ++ */ ++ public boolean onItemUse(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, World par3World, int par4, int par5, int par6, int par7, float par8, float par9, float par10) { + return false; + } + +- public float getStrVsBlock(ItemStack var1, Block var2) { ++ /** ++ * Returns the strength of the stack against a given block. 1.0F base, (Quality+1)*2 if correct blocktype, 1.5F if ++ * sword ++ */ ++ public float getStrVsBlock(ItemStack par1ItemStack, Block par2Block) { + return 1.0F; + } + +- public ItemStack onItemRightClick(ItemStack var1, World var2, EntityPlayer var3) { +- return var1; +- } +- +- public ItemStack onEaten(ItemStack var1, World var2, EntityPlayer var3) { +- return var1; +- } +- ++ /** ++ * Called whenever this item is equipped and the right mouse button is pressed. Args: itemStack, world, entityPlayer ++ */ ++ public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) { ++ return par1ItemStack; ++ } ++ ++ public ItemStack onEaten(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) { ++ return par1ItemStack; ++ } ++ ++ /** ++ * Returns the maximum size of the stack for a specific item. *Isn't this more a Set than a Get?* ++ */ + public int getItemStackLimit() { + return this.maxStackSize; + } + +- public int getMetadata(int var1) { ++ /** ++ * Returns the metadata of the block which this Item (ItemBlock) can place ++ */ ++ public int getMetadata(int par1) { + return 0; + } + +@@ -246,17 +314,23 @@ + return this.hasSubtypes; + } + +- protected Item setHasSubtypes(boolean var1) { +- this.hasSubtypes = var1; ++ protected Item setHasSubtypes(boolean par1) { ++ this.hasSubtypes = par1; + return this; + } + ++ /** ++ * Returns the maximum damage an item can take. ++ */ + public int getMaxDamage() { + return this.maxDamage; + } + +- protected Item setMaxDamage(int var1) { +- this.maxDamage = var1; ++ /** ++ * set max damage of an Item ++ */ ++ protected Item setMaxDamage(int par1) { ++ this.maxDamage = par1; + return this; + } + +@@ -264,62 +338,102 @@ + return this.maxDamage > 0 && !this.hasSubtypes; + } + +- public boolean hitEntity(ItemStack var1, EntityLivingBase var2, EntityLivingBase var3) { +- return false; +- } +- +- public boolean onBlockDestroyed(ItemStack var1, World var2, int var3, int var4, int var5, int var6, EntityLivingBase var7) { +- return false; +- } +- +- public boolean canHarvestBlock(Block var1) { +- return false; +- } +- +- public boolean itemInteractionForEntity(ItemStack var1, EntityPlayer var2, EntityLivingBase var3) { +- return false; +- } +- ++ /** ++ * Current implementations of this method in child classes do not use the entry argument beside ev. They just raise the ++ * damage on the stack. ++ */ ++ public boolean hitEntity(ItemStack par1ItemStack, EntityLivingBase par2EntityLivingBase, EntityLivingBase par3EntityLivingBase) { ++ return false; ++ } ++ ++ public boolean onBlockDestroyed(ItemStack par1ItemStack, World par2World, int par3, int par4, int par5, int par6, EntityLivingBase par7EntityLivingBase) { ++ return false; ++ } ++ ++ /** ++ * Returns if the item (tool) can harvest results from the block type. ++ */ ++ public boolean canHarvestBlock(Block par1Block) { ++ return false; ++ } ++ ++ /** ++ * Returns true if the item can be used on the given entity, e.g. shears on sheep. ++ */ ++ public boolean itemInteractionForEntity(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, EntityLivingBase par3EntityLivingBase) { ++ return false; ++ } ++ ++ /** ++ * Sets bFull3D to True and return the object. ++ */ + public Item setFull3D() { + this.bFull3D = true; + return this; + } + ++ /** ++ * Returns True is the item is renderer in full 3D when hold. ++ */ + public boolean isFull3D() { + return this.bFull3D; + } + ++ /** ++ * Returns true if this item should be rotated by 180 degrees around the Y axis when being held in an entities hands. ++ */ + public boolean shouldRotateAroundWhenRendering() { + return false; + } + +- public Item setUnlocalizedName(String var1) { +- this.cB = var1; ++ /** ++ * Sets the unlocalized name of this item to the string passed as the parameter, prefixed by "item." ++ */ ++ public Item setUnlocalizedName(String par1Str) { ++ this.unlocalizedName = par1Str; + return this; + } + +- public String getUnlocalizedNameInefficiently(ItemStack var1) { +- String var2 = this.getUnlocalizedName(var1); ++ /** ++ * Translates the unlocalized name of this item, but without the .name suffix, so the translation fails and the ++ * unlocalized name itself is returned. ++ */ ++ public String getUnlocalizedNameInefficiently(ItemStack par1ItemStack) { ++ String var2 = this.getUnlocalizedName(par1ItemStack); + return var2 == null ? "" : StatCollector.translateToLocal(var2); + } + ++ /** ++ * Returns the unlocalized name of this item. ++ */ + public String getUnlocalizedName() { +- return "item." + this.cB; +- } +- +- public String getUnlocalizedName(ItemStack var1) { +- return "item." + this.cB; +- } +- +- public Item setContainerItem(Item var1) { +- this.containerItem = var1; ++ return "item." + this.unlocalizedName; ++ } ++ ++ /** ++ * Returns the unlocalized name of this item. This version accepts an ItemStack so different stacks can have different ++ * names based on their damage or NBT. ++ */ ++ public String getUnlocalizedName(ItemStack par1ItemStack) { ++ return "item." + this.unlocalizedName; ++ } ++ ++ public Item setContainerItem(Item par1Item) { ++ this.containerItem = par1Item; + return this; + } + +- public boolean doesContainerItemLeaveCraftingGrid(ItemStack var1) { ++ /** ++ * If this returns true, after a recipe involving this item is crafted the container item will be added to the player's ++ * inventory instead of remaining in the crafting grid. ++ */ ++ public boolean doesContainerItemLeaveCraftingGrid(ItemStack par1ItemStack) { + return true; + } + ++ /** ++ * If this function returns true (or the item is damageable), the ItemStack's NBT tag will be sent to the client. ++ */ + public boolean getShareTag() { + return true; + } +@@ -328,6 +442,9 @@ + return this.containerItem; + } + ++ /** ++ * True if this Item has a container item (a.k.a. crafting result) ++ */ + public boolean hasContainerItem() { + return this.containerItem != null; + } +@@ -336,86 +453,122 @@ + return StatCollector.translateToLocal(this.getUnlocalizedName() + ".name"); + } + +- public String getItemStackDisplayName(ItemStack var1) { +- return StatCollector.translateToLocal(this.getUnlocalizedName(var1) + ".name"); ++ public String getItemStackDisplayName(ItemStack par1ItemStack) { ++ return StatCollector.translateToLocal(this.getUnlocalizedName(par1ItemStack) + ".name"); + } + +- public int getColorFromItemStack(ItemStack var1, int var2) { ++ public int getColorFromItemStack(ItemStack par1ItemStack, int par2) { + return 16777215; + } + +- public void onUpdate(ItemStack var1, World var2, Entity var3, int var4, boolean var5) { +- } +- +- public void onCreated(ItemStack var1, World var2, EntityPlayer var3) { +- } +- ++ /** ++ * Called each tick as long the item is on a player inventory. Uses by maps to check if is on a player hand and update ++ * it's contents. ++ */ ++ public void onUpdate(ItemStack par1ItemStack, World par2World, Entity par3Entity, int par4, boolean par5) {} ++ ++ /** ++ * Called when item is crafted/smelted. Used only by maps so far. ++ */ ++ public void onCreated(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) {} ++ ++ /** ++ * false for all Items except sub-classes of ItemMapBase ++ */ + public boolean isMap() { + return false; + } + +- public EnumAction getItemUseAction(ItemStack var1) { ++ /** ++ * returns the action that specifies what animation to play when the items is being used ++ */ ++ public EnumAction getItemUseAction(ItemStack par1ItemStack) { + return EnumAction.none; + } + +- public int getMaxItemUseDuration(ItemStack var1) { ++ /** ++ * How long it takes to use or consume an item ++ */ ++ public int getMaxItemUseDuration(ItemStack par1ItemStack) { + return 0; + } + +- public void onPlayerStoppedUsing(ItemStack var1, World var2, EntityPlayer var3, int var4) { +- } ++ /** ++ * called when the player releases the use item button. Args: itemstack, world, entityplayer, itemInUseCount ++ */ ++ public void onPlayerStoppedUsing(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer, int par4) {} + +- protected Item setPotionEffect(String var1) { +- this.d = var1; ++ /** ++ * Sets the string representing this item's effect on a potion when used as an ingredient. ++ */ ++ protected Item setPotionEffect(String par1Str) { ++ this.potionEffect = par1Str; + return this; + } + ++ /** ++ * Returns a string representing what this item does to a potion. ++ */ + public String getPotionEffect() { +- return this.d; ++ return this.potionEffect; + } + ++ /** ++ * Returns true if this item serves as a potion ingredient (its ingredient information is not null). ++ */ + public boolean isPotionIngredient() { +- return this.d != null; +- } +- +- public void addInformation(ItemStack var1, EntityPlayer var2, List var3, boolean var4) { +- } +- +- public String getItemDisplayName(ItemStack var1) { +- return ("" + StatCollector.translateToLocal(this.getUnlocalizedNameInefficiently(var1) + ".name")).trim(); +- } +- +- public boolean hasEffect(ItemStack var1) { +- return var1.isItemEnchanted(); +- } +- +- public EnumRarity getRarity(ItemStack var1) { +- return var1.isItemEnchanted() ? EnumRarity.rare : EnumRarity.common; +- } +- +- public boolean isItemTool(ItemStack var1) { ++ return this.potionEffect != null; ++ } ++ ++ /** ++ * allows items to add custom lines of information to the mouseover description ++ */ ++ public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4) {} ++ ++ public String getItemDisplayName(ItemStack par1ItemStack) { ++ return ("" + StatCollector.translateToLocal(this.getUnlocalizedNameInefficiently(par1ItemStack) + ".name")).trim(); ++ } ++ ++ public boolean hasEffect(ItemStack par1ItemStack) { ++ return par1ItemStack.isItemEnchanted(); ++ } ++ ++ /** ++ * Return an item rarity from EnumRarity ++ */ ++ public EnumRarity getRarity(ItemStack par1ItemStack) { ++ return par1ItemStack.isItemEnchanted() ? EnumRarity.rare : EnumRarity.common; ++ } ++ ++ /** ++ * Checks isDamagable and if it cannot be stacked ++ */ ++ public boolean isItemTool(ItemStack par1ItemStack) { + return this.getItemStackLimit() == 1 && this.isDamageable(); + } + +- protected MovingObjectPosition getMovingObjectPositionFromPlayer(World var1, EntityPlayer var2, boolean var3) { ++ protected MovingObjectPosition getMovingObjectPositionFromPlayer(World par1World, EntityPlayer par2EntityPlayer, boolean par3) { + float var4 = 1.0F; +- float var5 = var2.prevRotationPitch + (var2.rotationPitch - var2.prevRotationPitch) * var4; +- float var6 = var2.prevRotationYaw + (var2.rotationYaw - var2.prevRotationYaw) * var4; +- double var7 = var2.prevPosX + (var2.posX - var2.prevPosX) * (double)var4; +- double var9 = var2.prevPosY + (var2.posY - var2.prevPosY) * (double)var4 + 1.62D - (double)var2.yOffset; +- double var11 = var2.prevPosZ + (var2.posZ - var2.prevPosZ) * (double)var4; +- Vec3 var13 = var1.getWorldVec3Pool().getVecFromPool(var7, var9, var11); +- float var14 = MathHelper.cos(-var6 * ((float)Math.PI / 180.0F) - (float)Math.PI); +- float var15 = MathHelper.sin(-var6 * ((float)Math.PI / 180.0F) - (float)Math.PI); +- float var16 = -MathHelper.cos(-var5 * ((float)Math.PI / 180.0F)); +- float var17 = MathHelper.sin(-var5 * ((float)Math.PI / 180.0F)); ++ float var5 = par2EntityPlayer.prevRotationPitch + (par2EntityPlayer.rotationPitch - par2EntityPlayer.prevRotationPitch) * var4; ++ float var6 = par2EntityPlayer.prevRotationYaw + (par2EntityPlayer.rotationYaw - par2EntityPlayer.prevRotationYaw) * var4; ++ double var7 = par2EntityPlayer.prevPosX + (par2EntityPlayer.posX - par2EntityPlayer.prevPosX) * (double)var4; ++ double var9 = par2EntityPlayer.prevPosY + (par2EntityPlayer.posY - par2EntityPlayer.prevPosY) * (double)var4 + 1.62D - (double)par2EntityPlayer.yOffset; ++ double var11 = par2EntityPlayer.prevPosZ + (par2EntityPlayer.posZ - par2EntityPlayer.prevPosZ) * (double)var4; ++ Vec3 var13 = par1World.getWorldVec3Pool().getVecFromPool(var7, var9, var11); ++ float var14 = MathHelper.cos(-var6 * 0.017453292F - (float)Math.PI); ++ float var15 = MathHelper.sin(-var6 * 0.017453292F - (float)Math.PI); ++ float var16 = -MathHelper.cos(-var5 * 0.017453292F); ++ float var17 = MathHelper.sin(-var5 * 0.017453292F); + float var18 = var15 * var16; + float var20 = var14 * var16; + double var21 = 5.0D; + Vec3 var23 = var13.addVector((double)var18 * var21, (double)var17 * var21, (double)var20 * var21); +- return var1.rayTraceBlocks(var13, var23, var3, !var3); ++ return par1World.rayTraceBlocks_do_do(var13, var23, par3, !par3); + } + ++ /** ++ * Return the enchantability factor of the item, most of the time is based on material. ++ */ + public int getItemEnchantability() { + return 0; + } +@@ -424,46 +577,71 @@ + return false; + } + +- public Icon getIconFromDamageForRenderPass(int var1, int var2) { +- return this.getIconFromDamage(var1); +- } +- +- public void getSubItems(int var1, CreativeTabs var2, List var3) { +- var3.add(new ItemStack(var1, 1, 0)); +- } +- ++ /** ++ * Gets an icon index based on an item's damage value and the given render pass ++ */ ++ public Icon getIconFromDamageForRenderPass(int par1, int par2) { ++ return this.getIconFromDamage(par1); ++ } ++ ++ /** ++ * returns a list of items with the same ID, but different meta (eg: dye returns 16 items) ++ */ ++ public void getSubItems(int par1, CreativeTabs par2CreativeTabs, List par3List) { ++ par3List.add(new ItemStack(par1, 1, 0)); ++ } ++ ++ /** ++ * gets the CreativeTab this item is displayed on ++ */ + public CreativeTabs getCreativeTab() { + return this.tabToDisplayOn; + } + +- public Item setCreativeTab(CreativeTabs var1) { +- this.tabToDisplayOn = var1; ++ /** ++ * returns this; ++ */ ++ public Item setCreativeTab(CreativeTabs par1CreativeTabs) { ++ this.tabToDisplayOn = par1CreativeTabs; + return this; + } + ++ /** ++ * Returns true if players can use this item to affect the world (e.g. placing blocks, placing ender eyes in portal) ++ * when not in creative ++ */ + public boolean canItemEditBlocks() { + return true; + } + +- public boolean getIsRepairable(ItemStack var1, ItemStack var2) { ++ /** ++ * Return whether this item is repairable in an anvil. ++ */ ++ public boolean getIsRepairable(ItemStack par1ItemStack, ItemStack par2ItemStack) { + return false; + } + +- public void registerIcons(IconRegister var1) { +- this.itemIcon = var1.registerIcon(this.getIconString()); ++ public void registerIcons(IconRegister par1IconRegister) { ++ this.itemIcon = par1IconRegister.registerIcon(this.getIconString()); + } + ++ /** ++ * Gets a map of item attribute modifiers, used by ItemSword to increase hit damage. ++ */ + public Multimap getItemAttributeModifiers() { + return HashMultimap.create(); + } + +- protected Item setTextureName(String var1) { +- this.cA = var1; ++ protected Item setTextureName(String par1Str) { ++ this.iconString = par1Str; + return this; + } + ++ /** ++ * Returns the string associated with this Item's Icon. ++ */ + protected String getIconString() { +- return this.cA == null ? "MISSING_ICON_ITEM_" + this.itemID + "_" + this.cB : this.cA; ++ return this.iconString == null ? "MISSING_ICON_ITEM_" + this.itemID + "_" + this.unlocalizedName : this.iconString; + } + + static { diff --git a/patches/net/minecraft/src/ItemAnvilBlock.java.patch b/patches/net/minecraft/src/ItemAnvilBlock.java.patch new file mode 100644 index 0000000..61fa14d --- /dev/null +++ b/patches/net/minecraft/src/ItemAnvilBlock.java.patch @@ -0,0 +1,21 @@ +--- net/minecraft/src/ItemAnvilBlock.java ++++ net/minecraft/src/ItemAnvilBlock.java +@@ -1,11 +1,14 @@ + package net.minecraft.src; + + public class ItemAnvilBlock extends ItemMultiTextureTile { +- public ItemAnvilBlock(Block var1) { +- super(var1.blockID - 256, var1, BlockAnvil.a); ++ public ItemAnvilBlock(Block par1Block) { ++ super(par1Block.blockID - 256, par1Block, BlockAnvil.statuses); + } + +- public int getMetadata(int var1) { +- return var1 << 2; ++ /** ++ * Returns the metadata of the block which this Item (ItemBlock) can place ++ */ ++ public int getMetadata(int par1) { ++ return par1 << 2; + } + } diff --git a/patches/net/minecraft/src/ItemAppleGold.java.patch b/patches/net/minecraft/src/ItemAppleGold.java.patch new file mode 100644 index 0000000..83adb2b --- /dev/null +++ b/patches/net/minecraft/src/ItemAppleGold.java.patch @@ -0,0 +1,69 @@ +--- net/minecraft/src/ItemAppleGold.java ++++ net/minecraft/src/ItemAppleGold.java +@@ -3,38 +3,43 @@ + import java.util.List; + + public class ItemAppleGold extends ItemFood { +- public ItemAppleGold(int var1, int var2, float var3, boolean var4) { +- super(var1, var2, var3, var4); ++ public ItemAppleGold(int par1, int par2, float par3, boolean par4) { ++ super(par1, par2, par3, par4); + this.setHasSubtypes(true); + } + +- public boolean hasEffect(ItemStack var1) { +- return var1.getItemDamage() > 0; +- } +- +- public EnumRarity getRarity(ItemStack var1) { +- return var1.getItemDamage() == 0 ? EnumRarity.rare : EnumRarity.epic; +- } +- +- protected void onFoodEaten(ItemStack var1, World var2, EntityPlayer var3) { +- if(!var2.isRemote) { +- var3.addPotionEffect(new PotionEffect(Potion.field_76444_x.id, 2400, 0)); ++ public boolean hasEffect(ItemStack par1ItemStack) { ++ return par1ItemStack.getItemDamage() > 0; ++ } ++ ++ /** ++ * Return an item rarity from EnumRarity ++ */ ++ public EnumRarity getRarity(ItemStack par1ItemStack) { ++ return par1ItemStack.getItemDamage() == 0 ? EnumRarity.rare : EnumRarity.epic; ++ } ++ ++ protected void onFoodEaten(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) { ++ if (!par2World.isRemote) { ++ par3EntityPlayer.addPotionEffect(new PotionEffect(Potion.field_76444_x.id, 2400, 0)); + } + +- if(var1.getItemDamage() > 0) { +- if(!var2.isRemote) { +- var3.addPotionEffect(new PotionEffect(Potion.regeneration.id, 600, 4)); +- var3.addPotionEffect(new PotionEffect(Potion.resistance.id, 6000, 0)); +- var3.addPotionEffect(new PotionEffect(Potion.fireResistance.id, 6000, 0)); ++ if (par1ItemStack.getItemDamage() > 0) { ++ if (!par2World.isRemote) { ++ par3EntityPlayer.addPotionEffect(new PotionEffect(Potion.regeneration.id, 600, 4)); ++ par3EntityPlayer.addPotionEffect(new PotionEffect(Potion.resistance.id, 6000, 0)); ++ par3EntityPlayer.addPotionEffect(new PotionEffect(Potion.fireResistance.id, 6000, 0)); + } + } else { +- super.onFoodEaten(var1, var2, var3); ++ super.onFoodEaten(par1ItemStack, par2World, par3EntityPlayer); + } +- + } + +- public void getSubItems(int var1, CreativeTabs var2, List var3) { +- var3.add(new ItemStack(var1, 1, 0)); +- var3.add(new ItemStack(var1, 1, 1)); ++ /** ++ * returns a list of items with the same ID, but different meta (eg: dye returns 16 items) ++ */ ++ public void getSubItems(int par1, CreativeTabs par2CreativeTabs, List par3List) { ++ par3List.add(new ItemStack(par1, 1, 0)); ++ par3List.add(new ItemStack(par1, 1, 1)); + } + } diff --git a/patches/net/minecraft/src/ItemArmor.java.patch b/patches/net/minecraft/src/ItemArmor.java.patch new file mode 100644 index 0000000..94e0e29 --- /dev/null +++ b/patches/net/minecraft/src/ItemArmor.java.patch @@ -0,0 +1,287 @@ +--- net/minecraft/src/ItemArmor.java ++++ net/minecraft/src/ItemArmor.java +@@ -1,35 +1,55 @@ + package net.minecraft.src; + ++// MCPatcher Start ++import com.prupe.mcpatcher.cc.ColorizeEntity; ++// MCPatcher End ++ + public class ItemArmor extends Item { +- private static final int[] maxDamageArray = new int[]{11, 16, 15, 13}; +- private static final String[] cC = new String[]{"leather_helmet_overlay", "leather_chestplate_overlay", "leather_leggings_overlay", "leather_boots_overlay"}; +- public static final String[] a = new String[]{"empty_armor_slot_helmet", "empty_armor_slot_chestplate", "empty_armor_slot_leggings", "empty_armor_slot_boots"}; ++ ++ /** Holds the 'base' maxDamage that each armorType have. */ ++ private static final int[] maxDamageArray = new int[] {11, 16, 15, 13}; ++ private static final String[] field_94606_cu = new String[] {"leather_helmet_overlay", "leather_chestplate_overlay", "leather_leggings_overlay", "leather_boots_overlay"}; ++ public static final String[] field_94603_a = new String[] {"empty_armor_slot_helmet", "empty_armor_slot_chestplate", "empty_armor_slot_leggings", "empty_armor_slot_boots"}; + private static final IBehaviorDispenseItem field_96605_cw = new BehaviorDispenseArmor(); ++ ++ /** ++ * Stores the armor type: 0 is helmet, 1 is plate, 2 is legs and 3 is boots ++ */ + public final int armorType; ++ ++ /** Holds the amount of damage that the armor reduces at full durability. */ + public final int damageReduceAmount; ++ ++ /** ++ * Used on RenderPlayer to select the correspondent armor to be rendered on the player: 0 is cloth, 1 is chain, 2 is ++ * iron, 3 is diamond and 4 is gold. ++ */ + public final int renderIndex; ++ ++ /** The EnumArmorMaterial used for this ItemArmor */ + private final EnumArmorMaterial material; + private Icon field_94605_cw; + private Icon field_94604_cx; + +- public ItemArmor(int var1, EnumArmorMaterial var2, int var3, int var4) { +- super(var1); +- this.material = var2; +- this.armorType = var4; +- this.renderIndex = var3; +- this.damageReduceAmount = var2.getDamageReductionAmount(var4); +- this.setMaxDamage(var2.getDurability(var4)); ++ public ItemArmor(int par1, EnumArmorMaterial par2EnumArmorMaterial, int par3, int par4) { ++ super(par1); ++ this.material = par2EnumArmorMaterial; ++ this.armorType = par4; ++ this.renderIndex = par3; ++ this.damageReduceAmount = par2EnumArmorMaterial.getDamageReductionAmount(par4); ++ this.setMaxDamage(par2EnumArmorMaterial.getDurability(par4)); + this.maxStackSize = 1; + this.setCreativeTab(CreativeTabs.tabCombat); + BlockDispenser.dispenseBehaviorRegistry.putObject(this, field_96605_cw); + } + +- public int getColorFromItemStack(ItemStack var1, int var2) { +- if(var2 > 0) { ++ public int getColorFromItemStack(ItemStack par1ItemStack, int par2) { ++ if (par2 > 0) { + return 16777215; + } else { +- int var3 = this.getColor(var1); +- if(var3 < 0) { ++ int var3 = this.getColor(par1ItemStack); ++ ++ if (var3 < 0) { + var3 = 16777215; + } + +@@ -41,107 +61,149 @@ + return this.material == EnumArmorMaterial.CLOTH; + } + ++ /** ++ * Return the enchantability factor of the item, most of the time is based on material. ++ */ + public int getItemEnchantability() { + return this.material.getEnchantability(); + } + ++ /** ++ * Return the armor material for this armor item. ++ */ + public EnumArmorMaterial getArmorMaterial() { + return this.material; + } + +- public boolean hasColor(ItemStack var1) { +- return this.material != EnumArmorMaterial.CLOTH ? false : (!var1.hasTagCompound() ? false : (!var1.getTagCompound().hasKey("display") ? false : var1.getTagCompound().getCompoundTag("display").hasKey("color"))); ++ /** ++ * Return whether the specified armor ItemStack has a color. ++ */ ++ public boolean hasColor(ItemStack par1ItemStack) { ++ return this.material != EnumArmorMaterial.CLOTH ? false : (!par1ItemStack.hasTagCompound() ? false : (!par1ItemStack.getTagCompound().hasKey("display") ? false : par1ItemStack.getTagCompound().getCompoundTag("display").hasKey("color"))); + } + +- public int getColor(ItemStack var1) { +- if(this.material != EnumArmorMaterial.CLOTH) { ++ /** ++ * Return the color for the specified armor ItemStack. ++ */ ++ public int getColor(ItemStack par1ItemStack) { ++ if (this.material != EnumArmorMaterial.CLOTH) { + return -1; + } else { +- NBTTagCompound var2 = var1.getTagCompound(); +- if(var2 == null) { +- return 10511680; ++ NBTTagCompound var2 = par1ItemStack.getTagCompound(); ++ ++ if (var2 == null) { ++ // MCPatcher Start ++ return ColorizeEntity.undyedLeatherColor; ++ // MCPatcher End + } else { + NBTTagCompound var3 = var2.getCompoundTag("display"); +- return var3 == null ? 10511680 : (var3.hasKey("color") ? var3.getInteger("color") : 10511680); ++ // MCPatcher Start ++ return var3 == null ? ColorizeEntity.undyedLeatherColor : (var3.hasKey("color") ? var3.getInteger("color") : ColorizeEntity.undyedLeatherColor); ++ // MCPatcher End + } + } + } + +- public Icon getIconFromDamageForRenderPass(int var1, int var2) { +- return var2 == 1 ? this.field_94605_cw : super.getIconFromDamageForRenderPass(var1, var2); ++ /** ++ * Gets an icon index based on an item's damage value and the given render pass ++ */ ++ public Icon getIconFromDamageForRenderPass(int par1, int par2) { ++ return par2 == 1 ? this.field_94605_cw : super.getIconFromDamageForRenderPass(par1, par2); + } + +- public void removeColor(ItemStack var1) { +- if(this.material == EnumArmorMaterial.CLOTH) { +- NBTTagCompound var2 = var1.getTagCompound(); +- if(var2 != null) { ++ /** ++ * Remove the color from the specified armor ItemStack. ++ */ ++ public void removeColor(ItemStack par1ItemStack) { ++ if (this.material == EnumArmorMaterial.CLOTH) { ++ NBTTagCompound var2 = par1ItemStack.getTagCompound(); ++ ++ if (var2 != null) { + NBTTagCompound var3 = var2.getCompoundTag("display"); +- if(var3.hasKey("color")) { ++ ++ if (var3.hasKey("color")) { + var3.removeTag("color"); + } +- + } + } + } + +- public void func_82813_b(ItemStack var1, int var2) { +- if(this.material != EnumArmorMaterial.CLOTH) { ++ public void func_82813_b(ItemStack par1ItemStack, int par2) { ++ if (this.material != EnumArmorMaterial.CLOTH) { + throw new UnsupportedOperationException("Can\'t dye non-leather!"); + } else { +- NBTTagCompound var3 = var1.getTagCompound(); +- if(var3 == null) { ++ NBTTagCompound var3 = par1ItemStack.getTagCompound(); ++ ++ if (var3 == null) { + var3 = new NBTTagCompound(); +- var1.setTagCompound(var3); ++ par1ItemStack.setTagCompound(var3); + } + + NBTTagCompound var4 = var3.getCompoundTag("display"); +- if(!var3.hasKey("display")) { ++ ++ if (!var3.hasKey("display")) { + var3.setCompoundTag("display", var4); + } + +- var4.setInteger("color", var2); +- } +- } +- +- public boolean getIsRepairable(ItemStack var1, ItemStack var2) { +- return this.material.getArmorCraftingMaterial() == var2.itemID ? true : super.getIsRepairable(var1, var2); +- } +- +- public void registerIcons(IconRegister var1) { +- super.registerIcons(var1); +- if(this.material == EnumArmorMaterial.CLOTH) { +- this.field_94605_cw = var1.registerIcon(cC[this.armorType]); +- } +- +- this.field_94604_cx = var1.registerIcon(a[this.armorType]); +- } +- +- public ItemStack onItemRightClick(ItemStack var1, World var2, EntityPlayer var3) { +- int var4 = EntityLiving.getArmorPosition(var1) - 1; +- ItemStack var5 = var3.getCurrentArmor(var4); +- if(var5 == null) { +- var3.setCurrentItemOrArmor(var4, var1.copy()); +- var1.stackSize = 0; +- } +- +- return var1; +- } +- +- public static Icon func_94602_b(int var0) { +- switch(var0) { +- case 0: +- return Item.helmetDiamond.field_94604_cx; +- case 1: +- return Item.plateDiamond.field_94604_cx; +- case 2: +- return Item.legsDiamond.field_94604_cx; +- case 3: +- return Item.bootsDiamond.field_94604_cx; +- default: +- return null; +- } +- } +- ++ var4.setInteger("color", par2); ++ } ++ } ++ ++ /** ++ * Return whether this item is repairable in an anvil. ++ */ ++ public boolean getIsRepairable(ItemStack par1ItemStack, ItemStack par2ItemStack) { ++ return this.material.getArmorCraftingMaterial() == par2ItemStack.itemID ? true : super.getIsRepairable(par1ItemStack, par2ItemStack); ++ } ++ ++ public void registerIcons(IconRegister par1IconRegister) { ++ super.registerIcons(par1IconRegister); ++ ++ if (this.material == EnumArmorMaterial.CLOTH) { ++ this.field_94605_cw = par1IconRegister.registerIcon(field_94606_cu[this.armorType]); ++ } ++ ++ this.field_94604_cx = par1IconRegister.registerIcon(field_94603_a[this.armorType]); ++ } ++ ++ /** ++ * Called whenever this item is equipped and the right mouse button is pressed. Args: itemStack, world, entityPlayer ++ */ ++ public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) { ++ int var4 = EntityLiving.getArmorPosition(par1ItemStack) - 1; ++ ItemStack var5 = par3EntityPlayer.getCurrentArmor(var4); ++ ++ if (var5 == null) { ++ par3EntityPlayer.setCurrentItemOrArmor(var4, par1ItemStack.copy()); ++ par1ItemStack.stackSize = 0; ++ } ++ ++ return par1ItemStack; ++ } ++ ++ public static Icon func_94602_b(int par0) { ++ switch (par0) { ++ case 0: ++ return Item.helmetDiamond.field_94604_cx; ++ ++ case 1: ++ return Item.plateDiamond.field_94604_cx; ++ ++ case 2: ++ return Item.legsDiamond.field_94604_cx; ++ ++ case 3: ++ return Item.bootsDiamond.field_94604_cx; ++ ++ default: ++ return null; ++ } ++ } ++ ++ /** ++ * Returns the 'max damage' factor array for the armor, each piece of armor have a durability factor (that gets ++ * multiplied by armor material factor) ++ */ + static int[] getMaxDamageArray() { + return maxDamageArray; + } diff --git a/patches/net/minecraft/src/ItemAxe.java.patch b/patches/net/minecraft/src/ItemAxe.java.patch new file mode 100644 index 0000000..0fbd35b --- /dev/null +++ b/patches/net/minecraft/src/ItemAxe.java.patch @@ -0,0 +1,28 @@ +--- net/minecraft/src/ItemAxe.java ++++ net/minecraft/src/ItemAxe.java +@@ -1,13 +1,19 @@ + package net.minecraft.src; + + public class ItemAxe extends ItemTool { +- private static Block[] blocksEffectiveAgainst = new Block[]{Block.planks, Block.bookShelf, Block.wood, Block.chest, Block.stoneDoubleSlab, Block.stoneSingleSlab, Block.pumpkin, Block.pumpkinLantern}; +- +- protected ItemAxe(int var1, EnumToolMaterial var2) { +- super(var1, 3.0F, var2, blocksEffectiveAgainst); ++ ++ /** an array of the blocks this axe is effective against */ ++ private static Block[] blocksEffectiveAgainst = new Block[] {Block.planks, Block.bookShelf, Block.wood, Block.chest, Block.stoneDoubleSlab, Block.stoneSingleSlab, Block.pumpkin, Block.pumpkinLantern}; ++ ++ protected ItemAxe(int par1, EnumToolMaterial par2EnumToolMaterial) { ++ super(par1, 3.0F, par2EnumToolMaterial, blocksEffectiveAgainst); + } + +- public float getStrVsBlock(ItemStack var1, Block var2) { +- return var2 == null || var2.blockMaterial != Material.wood && var2.blockMaterial != Material.plants && var2.blockMaterial != Material.vine ? super.getStrVsBlock(var1, var2) : this.efficiencyOnProperMaterial; ++ /** ++ * Returns the strength of the stack against a given block. 1.0F base, (Quality+1)*2 if correct blocktype, 1.5F if ++ * sword ++ */ ++ public float getStrVsBlock(ItemStack par1ItemStack, Block par2Block) { ++ return par2Block != null && (par2Block.blockMaterial == Material.wood || par2Block.blockMaterial == Material.plants || par2Block.blockMaterial == Material.vine) ? this.efficiencyOnProperMaterial : super.getStrVsBlock(par1ItemStack, par2Block); + } + } diff --git a/patches/net/minecraft/src/ItemBed.java.patch b/patches/net/minecraft/src/ItemBed.java.patch new file mode 100644 index 0000000..dd0fcb2 --- /dev/null +++ b/patches/net/minecraft/src/ItemBed.java.patch @@ -0,0 +1,72 @@ +--- net/minecraft/src/ItemBed.java ++++ net/minecraft/src/ItemBed.java +@@ -1,46 +1,52 @@ + package net.minecraft.src; + + public class ItemBed extends Item { +- public ItemBed(int var1) { +- super(var1); ++ public ItemBed(int par1) { ++ super(par1); + this.setCreativeTab(CreativeTabs.tabDecorations); + } + +- public boolean onItemUse(ItemStack var1, EntityPlayer var2, World var3, int var4, int var5, int var6, int var7, float var8, float var9, float var10) { +- if(var3.isRemote) { ++ /** ++ * Callback for item usage. If the item does something special on right clicking, he will have one of those. Return ++ * True if something happen and false if it don't. This is for ITEMS, not BLOCKS ++ */ ++ public boolean onItemUse(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, World par3World, int par4, int par5, int par6, int par7, float par8, float par9, float par10) { ++ if (par3World.isRemote) { + return true; +- } else if(var7 != 1) { ++ } else if (par7 != 1) { + return false; + } else { +- ++var5; ++ ++par5; + BlockBed var11 = (BlockBed)Block.bed; +- int var12 = MathHelper.floor_double((double)(var2.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3; ++ int var12 = MathHelper.floor_double((double)(par2EntityPlayer.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3; + byte var13 = 0; + byte var14 = 0; +- if(var12 == 0) { ++ ++ if (var12 == 0) { + var14 = 1; + } + +- if(var12 == 1) { ++ if (var12 == 1) { + var13 = -1; + } + +- if(var12 == 2) { ++ if (var12 == 2) { + var14 = -1; + } + +- if(var12 == 3) { ++ if (var12 == 3) { + var13 = 1; + } + +- if(var2.canPlayerEdit(var4, var5, var6, var7, var1) && var2.canPlayerEdit(var4 + var13, var5, var6 + var14, var7, var1)) { +- if(var3.isAirBlock(var4, var5, var6) && var3.isAirBlock(var4 + var13, var5, var6 + var14) && var3.doesBlockHaveSolidTopSurface(var4, var5 - 1, var6) && var3.doesBlockHaveSolidTopSurface(var4 + var13, var5 - 1, var6 + var14)) { +- var3.setBlock(var4, var5, var6, var11.blockID, var12, 3); +- if(var3.getBlockId(var4, var5, var6) == var11.blockID) { +- var3.setBlock(var4 + var13, var5, var6 + var14, var11.blockID, var12 + 8, 3); ++ if (par2EntityPlayer.canPlayerEdit(par4, par5, par6, par7, par1ItemStack) && par2EntityPlayer.canPlayerEdit(par4 + var13, par5, par6 + var14, par7, par1ItemStack)) { ++ if (par3World.isAirBlock(par4, par5, par6) && par3World.isAirBlock(par4 + var13, par5, par6 + var14) && par3World.doesBlockHaveSolidTopSurface(par4, par5 - 1, par6) && par3World.doesBlockHaveSolidTopSurface(par4 + var13, par5 - 1, par6 + var14)) { ++ par3World.setBlock(par4, par5, par6, var11.blockID, var12, 3); ++ ++ if (par3World.getBlockId(par4, par5, par6) == var11.blockID) { ++ par3World.setBlock(par4 + var13, par5, par6 + var14, var11.blockID, var12 + 8, 3); + } + +- --var1.stackSize; ++ --par1ItemStack.stackSize; + return true; + } else { + return false; diff --git a/patches/net/minecraft/src/ItemBlock.java.patch b/patches/net/minecraft/src/ItemBlock.java.patch new file mode 100644 index 0000000..0acac44 --- /dev/null +++ b/patches/net/minecraft/src/ItemBlock.java.patch @@ -0,0 +1,269 @@ +--- net/minecraft/src/ItemBlock.java ++++ net/minecraft/src/ItemBlock.java +@@ -1,76 +1,99 @@ + package net.minecraft.src; + ++//Spout Start ++ + import java.util.List; + ++import com.prupe.mcpatcher.cc.ColorizeBlock; ++ ++//Spout end ++ + public class ItemBlock extends Item { ++ /** The block ID of the Block associated with this ItemBlock */ + private int blockID; + private Icon field_94588_b; + +- public ItemBlock(int var1) { +- super(var1); +- this.blockID = var1 + 256; ++ public ItemBlock(int par1) { ++ super(par1); ++ this.blockID = par1 + 256; + } + ++ /** ++ * Returns the blockID for this Item ++ */ + public int getBlockID() { + return this.blockID; + } + ++ /** ++ * Returns 0 for /terrain.png, 1 for /gui/items.png ++ */ + public int getSpriteNumber() { + return Block.blocksList[this.blockID].getItemIconName() != null ? 1 : 0; + } + +- public Icon getIconFromDamage(int var1) { ++ /** ++ * Gets an icon index based on an item's damage value ++ */ ++ public Icon getIconFromDamage(int par1) { + return this.field_94588_b != null ? this.field_94588_b : Block.blocksList[this.blockID].getBlockTextureFromSide(1); + } + +- public boolean onItemUse(ItemStack var1, EntityPlayer var2, World var3, int var4, int var5, int var6, int var7, float var8, float var9, float var10) { +- int var11 = var3.getBlockId(var4, var5, var6); +- if(var11 == Block.snow.blockID && (var3.getBlockMetadata(var4, var5, var6) & 7) < 1) { +- var7 = 1; +- } else if(var11 != Block.vine.blockID && var11 != Block.tallGrass.blockID && var11 != Block.deadBush.blockID) { +- if(var7 == 0) { +- --var5; +- } +- +- if(var7 == 1) { +- ++var5; +- } +- +- if(var7 == 2) { +- --var6; +- } +- +- if(var7 == 3) { +- ++var6; +- } +- +- if(var7 == 4) { +- --var4; +- } +- +- if(var7 == 5) { +- ++var4; ++ /** ++ * Callback for item usage. If the item does something special on right ++ * clicking, he will have one of those. Return True if something happen and ++ * false if it don't. This is for ITEMS, not BLOCKS ++ */ ++ public boolean onItemUse(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, World par3World, int par4, int par5, int par6, int par7, float par8, float par9, float par10) { ++ int var11 = par3World.getBlockId(par4, par5, par6); ++ ++ if (var11 == Block.snow.blockID && (par3World.getBlockMetadata(par4, par5, par6) & 7) < 1) { ++ par7 = 1; ++ } else if (var11 != Block.vine.blockID && var11 != Block.tallGrass.blockID && var11 != Block.deadBush.blockID) { ++ if (par7 == 0) { ++ --par5; ++ } ++ ++ if (par7 == 1) { ++ ++par5; ++ } ++ ++ if (par7 == 2) { ++ --par6; ++ } ++ ++ if (par7 == 3) { ++ ++par6; ++ } ++ ++ if (par7 == 4) { ++ --par4; ++ } ++ ++ if (par7 == 5) { ++ ++par4; + } + } + +- if(var1.stackSize == 0) { +- return false; +- } else if(!var2.canPlayerEdit(var4, var5, var6, var7, var1)) { +- return false; +- } else if(var5 == 255 && Block.blocksList[this.blockID].blockMaterial.isSolid()) { +- return false; +- } else if(var3.canPlaceEntityOnSide(this.blockID, var4, var5, var6, false, var7, var2, var1)) { ++ if (par1ItemStack.stackSize == 0) { ++ return false; ++ } else if (!par2EntityPlayer.canPlayerEdit(par4, par5, par6, par7, par1ItemStack)) { ++ return false; ++ } else if (par5 == 255 && Block.blocksList[this.blockID].blockMaterial.isSolid()) { ++ return false; ++ } else if (par3World.canPlaceEntityOnSide(this.blockID, par4, par5, par6, false, par7, par2EntityPlayer, par1ItemStack)) { + Block var12 = Block.blocksList[this.blockID]; +- int var13 = this.getMetadata(var1.getItemDamage()); +- int var14 = Block.blocksList[this.blockID].onBlockPlaced(var3, var4, var5, var6, var7, var8, var9, var10, var13); +- if(var3.setBlock(var4, var5, var6, this.blockID, var14, 3)) { +- if(var3.getBlockId(var4, var5, var6) == this.blockID) { +- Block.blocksList[this.blockID].onBlockPlacedBy(var3, var4, var5, var6, var2, var1); +- Block.blocksList[this.blockID].onPostBlockPlaced(var3, var4, var5, var6, var14); ++ int var13 = this.getMetadata(par1ItemStack.getItemDamage()); ++ int var14 = Block.blocksList[this.blockID].onBlockPlaced(par3World, par4, par5, par6, par7, par8, par9, par10, var13); ++ ++ if (par3World.setBlock(par4, par5, par6, this.blockID, var14, 3)) { ++ if (par3World.getBlockId(par4, par5, par6) == this.blockID) { ++ Block.blocksList[this.blockID].onBlockPlacedBy(par3World, par4, par5, par6, par2EntityPlayer, par1ItemStack); ++ Block.blocksList[this.blockID].onPostBlockPlaced(par3World, par4, par5, par6, var14); + } + +- var3.playSoundEffect((double)((float)var4 + 0.5F), (double)((float)var5 + 0.5F), (double)((float)var6 + 0.5F), var12.stepSound.getPlaceSound(), (var12.stepSound.getVolume() + 1.0F) / 2.0F, var12.stepSound.getPitch() * 0.8F); +- --var1.stackSize; ++ par3World.playSoundEffect((double) ((float) par4 + 0.5F), (double) ((float) par5 + 0.5F), (double) ((float) par6 + 0.5F), var12.stepSound.getPlaceSound(), (var12.stepSound.getVolume() + 1.0F) / 2.0F, var12.stepSound.getPitch() * 0.8F); ++ --par1ItemStack.stackSize; + } + + return true; +@@ -79,60 +102,86 @@ + } + } + +- public boolean canPlaceItemBlockOnSide(World var1, int var2, int var3, int var4, int var5, EntityPlayer var6, ItemStack var7) { +- int var8 = var1.getBlockId(var2, var3, var4); +- if(var8 == Block.snow.blockID) { +- var5 = 1; +- } else if(var8 != Block.vine.blockID && var8 != Block.tallGrass.blockID && var8 != Block.deadBush.blockID) { +- if(var5 == 0) { +- --var3; +- } +- +- if(var5 == 1) { +- ++var3; +- } +- +- if(var5 == 2) { +- --var4; +- } +- +- if(var5 == 3) { +- ++var4; +- } +- +- if(var5 == 4) { +- --var2; +- } +- +- if(var5 == 5) { +- ++var2; ++ /** ++ * Returns true if the given ItemBlock can be placed on the given side of ++ * the given block position. ++ */ ++ public boolean canPlaceItemBlockOnSide(World par1World, int par2, int par3, int par4, int par5, EntityPlayer par6EntityPlayer, ItemStack par7ItemStack) { ++ int var8 = par1World.getBlockId(par2, par3, par4); ++ ++ if (var8 == Block.snow.blockID) { ++ par5 = 1; ++ } else if (var8 != Block.vine.blockID && var8 != Block.tallGrass.blockID && var8 != Block.deadBush.blockID) { ++ if (par5 == 0) { ++ --par3; ++ } ++ ++ if (par5 == 1) { ++ ++par3; ++ } ++ ++ if (par5 == 2) { ++ --par4; ++ } ++ ++ if (par5 == 3) { ++ ++par4; ++ } ++ ++ if (par5 == 4) { ++ --par2; ++ } ++ ++ if (par5 == 5) { ++ ++par2; + } + } + +- return var1.canPlaceEntityOnSide(this.getBlockID(), var2, var3, var4, false, var5, (Entity)null, var7); ++ return par1World.canPlaceEntityOnSide(this.getBlockID(), par2, par3, par4, false, par5, (Entity) null, par7ItemStack); + } + +- public String getUnlocalizedName(ItemStack var1) { ++ /** ++ * Returns the unlocalized name of this item. This version accepts an ++ * ItemStack so different stacks can have different names based on their ++ * damage or NBT. ++ */ ++ public String getUnlocalizedName(ItemStack par1ItemStack) { + return Block.blocksList[this.blockID].getUnlocalizedName(); + } + ++ /** ++ * Returns the unlocalized name of this item. ++ */ + public String getUnlocalizedName() { + return Block.blocksList[this.blockID].getUnlocalizedName(); + } + ++ /** ++ * gets the CreativeTab this item is displayed on ++ */ + public CreativeTabs getCreativeTab() { + return Block.blocksList[this.blockID].getCreativeTabToDisplayOn(); + } + +- public void getSubItems(int var1, CreativeTabs var2, List var3) { +- Block.blocksList[this.blockID].getSubBlocks(var1, var2, var3); ++ /** ++ * returns a list of items with the same ID, but different meta (eg: dye ++ * returns 16 items) ++ */ ++ public void getSubItems(int par1, CreativeTabs par2CreativeTabs, List par3List) { ++ Block.blocksList[this.blockID].getSubBlocks(par1, par2CreativeTabs, par3List); + } + +- public void registerIcons(IconRegister var1) { ++ public void registerIcons(IconRegister par1IconRegister) { + String var2 = Block.blocksList[this.blockID].getItemIconName(); +- if(var2 != null) { +- this.field_94588_b = var1.registerIcon(var2); ++ ++ if (var2 != null) { ++ this.field_94588_b = par1IconRegister.registerIcon(var2); + } ++ } + ++ //Spout MCPatcher start ++ public int getColorFromItemStack(ItemStack var1, int var2) { ++ return ColorizeBlock.getItemColorFromDamage(super.getColorFromItemStack(var1, var2), this.blockID, var2); + } ++ //Spout MCPatcher end + } diff --git a/patches/net/minecraft/src/ItemBlockWithMetadata.java.patch b/patches/net/minecraft/src/ItemBlockWithMetadata.java.patch new file mode 100644 index 0000000..38ba603 --- /dev/null +++ b/patches/net/minecraft/src/ItemBlockWithMetadata.java.patch @@ -0,0 +1,34 @@ +--- net/minecraft/src/ItemBlockWithMetadata.java ++++ net/minecraft/src/ItemBlockWithMetadata.java +@@ -3,18 +3,24 @@ + public class ItemBlockWithMetadata extends ItemBlock { + private Block theBlock; + +- public ItemBlockWithMetadata(int var1, Block var2) { +- super(var1); +- this.theBlock = var2; ++ public ItemBlockWithMetadata(int par1, Block par2Block) { ++ super(par1); ++ this.theBlock = par2Block; + this.setMaxDamage(0); + this.setHasSubtypes(true); + } + +- public Icon getIconFromDamage(int var1) { +- return this.theBlock.getIcon(2, var1); ++ /** ++ * Gets an icon index based on an item's damage value ++ */ ++ public Icon getIconFromDamage(int par1) { ++ return this.theBlock.getIcon(2, par1); + } + +- public int getMetadata(int var1) { +- return var1; ++ /** ++ * Returns the metadata of the block which this Item (ItemBlock) can place ++ */ ++ public int getMetadata(int par1) { ++ return par1; + } + } diff --git a/patches/net/minecraft/src/ItemBoat.java.patch b/patches/net/minecraft/src/ItemBoat.java.patch new file mode 100644 index 0000000..fc72469 --- /dev/null +++ b/patches/net/minecraft/src/ItemBoat.java.patch @@ -0,0 +1,126 @@ +--- net/minecraft/src/ItemBoat.java ++++ net/minecraft/src/ItemBoat.java +@@ -3,76 +3,84 @@ + import java.util.List; + + public class ItemBoat extends Item { +- public ItemBoat(int var1) { +- super(var1); ++ public ItemBoat(int par1) { ++ super(par1); + this.maxStackSize = 1; + this.setCreativeTab(CreativeTabs.tabTransport); + } + +- public ItemStack onItemRightClick(ItemStack var1, World var2, EntityPlayer var3) { ++ /** ++ * Called whenever this item is equipped and the right mouse button is pressed. Args: itemStack, world, entityPlayer ++ */ ++ public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) { + float var4 = 1.0F; +- float var5 = var3.prevRotationPitch + (var3.rotationPitch - var3.prevRotationPitch) * var4; +- float var6 = var3.prevRotationYaw + (var3.rotationYaw - var3.prevRotationYaw) * var4; +- double var7 = var3.prevPosX + (var3.posX - var3.prevPosX) * (double)var4; +- double var9 = var3.prevPosY + (var3.posY - var3.prevPosY) * (double)var4 + 1.62D - (double)var3.yOffset; +- double var11 = var3.prevPosZ + (var3.posZ - var3.prevPosZ) * (double)var4; +- Vec3 var13 = var2.getWorldVec3Pool().getVecFromPool(var7, var9, var11); +- float var14 = MathHelper.cos(-var6 * ((float)Math.PI / 180.0F) - (float)Math.PI); +- float var15 = MathHelper.sin(-var6 * ((float)Math.PI / 180.0F) - (float)Math.PI); +- float var16 = -MathHelper.cos(-var5 * ((float)Math.PI / 180.0F)); +- float var17 = MathHelper.sin(-var5 * ((float)Math.PI / 180.0F)); ++ float var5 = par3EntityPlayer.prevRotationPitch + (par3EntityPlayer.rotationPitch - par3EntityPlayer.prevRotationPitch) * var4; ++ float var6 = par3EntityPlayer.prevRotationYaw + (par3EntityPlayer.rotationYaw - par3EntityPlayer.prevRotationYaw) * var4; ++ double var7 = par3EntityPlayer.prevPosX + (par3EntityPlayer.posX - par3EntityPlayer.prevPosX) * (double)var4; ++ double var9 = par3EntityPlayer.prevPosY + (par3EntityPlayer.posY - par3EntityPlayer.prevPosY) * (double)var4 + 1.62D - (double)par3EntityPlayer.yOffset; ++ double var11 = par3EntityPlayer.prevPosZ + (par3EntityPlayer.posZ - par3EntityPlayer.prevPosZ) * (double)var4; ++ Vec3 var13 = par2World.getWorldVec3Pool().getVecFromPool(var7, var9, var11); ++ float var14 = MathHelper.cos(-var6 * 0.017453292F - (float)Math.PI); ++ float var15 = MathHelper.sin(-var6 * 0.017453292F - (float)Math.PI); ++ float var16 = -MathHelper.cos(-var5 * 0.017453292F); ++ float var17 = MathHelper.sin(-var5 * 0.017453292F); + float var18 = var15 * var16; + float var20 = var14 * var16; + double var21 = 5.0D; + Vec3 var23 = var13.addVector((double)var18 * var21, (double)var17 * var21, (double)var20 * var21); +- MovingObjectPosition var24 = var2.rayTraceBlocks(var13, var23, true); +- if(var24 == null) { +- return var1; ++ MovingObjectPosition var24 = par2World.clip(var13, var23, true); ++ ++ if (var24 == null) { ++ return par1ItemStack; + } else { +- Vec3 var25 = var3.getLook(var4); ++ Vec3 var25 = par3EntityPlayer.getLook(var4); + boolean var26 = false; + float var27 = 1.0F; +- List var28 = var2.getEntitiesWithinAABBExcludingEntity(var3, var3.boundingBox.addCoord(var25.xCoord * var21, var25.yCoord * var21, var25.zCoord * var21).expand((double)var27, (double)var27, (double)var27)); +- ++ List var28 = par2World.getEntitiesWithinAABBExcludingEntity(par3EntityPlayer, par3EntityPlayer.boundingBox.addCoord(var25.xCoord * var21, var25.yCoord * var21, var25.zCoord * var21).expand((double)var27, (double)var27, (double)var27)); + int var29; +- for(var29 = 0; var29 < var28.size(); ++var29) { ++ ++ for (var29 = 0; var29 < var28.size(); ++var29) { + Entity var30 = (Entity)var28.get(var29); +- if(var30.canBeCollidedWith()) { ++ ++ if (var30.canBeCollidedWith()) { + float var31 = var30.getCollisionBorderSize(); + AxisAlignedBB var32 = var30.boundingBox.expand((double)var31, (double)var31, (double)var31); +- if(var32.isVecInside(var13)) { ++ ++ if (var32.isVecInside(var13)) { + var26 = true; + } + } + } + +- if(var26) { +- return var1; ++ if (var26) { ++ return par1ItemStack; + } else { +- if(var24.typeOfHit == EnumMovingObjectType.TILE) { ++ if (var24.typeOfHit == EnumMovingObjectType.TILE) { + var29 = var24.blockX; + int var33 = var24.blockY; + int var34 = var24.blockZ; +- if(var2.getBlockId(var29, var33, var34) == Block.snow.blockID) { ++ ++ if (par2World.getBlockId(var29, var33, var34) == Block.snow.blockID) { + --var33; + } + +- EntityBoat var35 = new EntityBoat(var2, (double)((float)var29 + 0.5F), (double)((float)var33 + 1.0F), (double)((float)var34 + 0.5F)); +- var35.rotationYaw = (float)(((MathHelper.floor_double((double)(var3.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3) - 1) * 90); +- if(!var2.getCollidingBoundingBoxes(var35, var35.boundingBox.expand(-0.1D, -0.1D, -0.1D)).isEmpty()) { +- return var1; +- } +- +- if(!var2.isRemote) { +- var2.spawnEntityInWorld(var35); +- } +- +- if(!var3.capabilities.isCreativeMode) { +- --var1.stackSize; ++ EntityBoat var35 = new EntityBoat(par2World, (double)((float)var29 + 0.5F), (double)((float)var33 + 1.0F), (double)((float)var34 + 0.5F)); ++ var35.rotationYaw = (float)(((MathHelper.floor_double((double)(par3EntityPlayer.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3) - 1) * 90); ++ ++ if (!par2World.getCollidingBoundingBoxes(var35, var35.boundingBox.expand(-0.1D, -0.1D, -0.1D)).isEmpty()) { ++ return par1ItemStack; ++ } ++ ++ if (!par2World.isRemote) { ++ par2World.spawnEntityInWorld(var35); ++ } ++ ++ if (!par3EntityPlayer.capabilities.isCreativeMode) { ++ --par1ItemStack.stackSize; + } + } + +- return var1; ++ return par1ItemStack; + } + } + } diff --git a/patches/net/minecraft/src/ItemBook.java.patch b/patches/net/minecraft/src/ItemBook.java.patch new file mode 100644 index 0000000..8933a01 --- /dev/null +++ b/patches/net/minecraft/src/ItemBook.java.patch @@ -0,0 +1,31 @@ +--- net/minecraft/src/ItemBook.java ++++ net/minecraft/src/ItemBook.java +@@ -1,14 +1,20 @@ + package net.minecraft.src; + + public class ItemBook extends Item { +- public ItemBook(int var1) { +- super(var1); +- } +- +- public boolean isItemTool(ItemStack var1) { +- return var1.stackSize == 1; +- } +- ++ public ItemBook(int par1) { ++ super(par1); ++ } ++ ++ /** ++ * Checks isDamagable and if it cannot be stacked ++ */ ++ public boolean isItemTool(ItemStack par1ItemStack) { ++ return par1ItemStack.stackSize == 1; ++ } ++ ++ /** ++ * Return the enchantability factor of the item, most of the time is based on material. ++ */ + public int getItemEnchantability() { + return 1; + } diff --git a/patches/net/minecraft/src/ItemBow.java.patch b/patches/net/minecraft/src/ItemBow.java.patch new file mode 100644 index 0000000..906f419 --- /dev/null +++ b/patches/net/minecraft/src/ItemBow.java.patch @@ -0,0 +1,167 @@ +--- net/minecraft/src/ItemBow.java ++++ net/minecraft/src/ItemBow.java +@@ -1,99 +1,121 @@ + package net.minecraft.src; + + public class ItemBow extends Item { +- public static final String[] a = new String[]{"pulling_0", "pulling_1", "pulling_2"}; ++ public static final String[] bowPullIconNameArray = new String[] {"pulling_0", "pulling_1", "pulling_2"}; + private Icon[] iconArray; + +- public ItemBow(int var1) { +- super(var1); ++ public ItemBow(int par1) { ++ super(par1); + this.maxStackSize = 1; + this.setMaxDamage(384); + this.setCreativeTab(CreativeTabs.tabCombat); + } + +- public void onPlayerStoppedUsing(ItemStack var1, World var2, EntityPlayer var3, int var4) { +- boolean var5 = var3.capabilities.isCreativeMode || EnchantmentHelper.getEnchantmentLevel(Enchantment.infinity.effectId, var1) > 0; +- if(var5 || var3.inventory.hasItem(Item.arrow.itemID)) { +- int var6 = this.getMaxItemUseDuration(var1) - var4; ++ /** ++ * called when the player releases the use item button. Args: itemstack, world, entityplayer, itemInUseCount ++ */ ++ public void onPlayerStoppedUsing(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer, int par4) { ++ boolean var5 = par3EntityPlayer.capabilities.isCreativeMode || EnchantmentHelper.getEnchantmentLevel(Enchantment.infinity.effectId, par1ItemStack) > 0; ++ ++ if (var5 || par3EntityPlayer.inventory.hasItem(Item.arrow.itemID)) { ++ int var6 = this.getMaxItemUseDuration(par1ItemStack) - par4; + float var7 = (float)var6 / 20.0F; + var7 = (var7 * var7 + var7 * 2.0F) / 3.0F; +- if((double)var7 < 0.1D) { ++ ++ if ((double)var7 < 0.1D) { + return; + } + +- if(var7 > 1.0F) { ++ if (var7 > 1.0F) { + var7 = 1.0F; + } + +- EntityArrow var8 = new EntityArrow(var2, var3, var7 * 2.0F); +- if(var7 == 1.0F) { ++ EntityArrow var8 = new EntityArrow(par2World, par3EntityPlayer, var7 * 2.0F); ++ ++ if (var7 == 1.0F) { + var8.setIsCritical(true); + } + +- int var9 = EnchantmentHelper.getEnchantmentLevel(Enchantment.power.effectId, var1); +- if(var9 > 0) { ++ int var9 = EnchantmentHelper.getEnchantmentLevel(Enchantment.power.effectId, par1ItemStack); ++ ++ if (var9 > 0) { + var8.setDamage(var8.getDamage() + (double)var9 * 0.5D + 0.5D); + } + +- int var10 = EnchantmentHelper.getEnchantmentLevel(Enchantment.punch.effectId, var1); +- if(var10 > 0) { ++ int var10 = EnchantmentHelper.getEnchantmentLevel(Enchantment.punch.effectId, par1ItemStack); ++ ++ if (var10 > 0) { + var8.setKnockbackStrength(var10); + } + +- if(EnchantmentHelper.getEnchantmentLevel(Enchantment.flame.effectId, var1) > 0) { ++ if (EnchantmentHelper.getEnchantmentLevel(Enchantment.flame.effectId, par1ItemStack) > 0) { + var8.setFire(100); + } + +- var1.damageItem(1, var3); +- var2.playSoundAtEntity(var3, "random.bow", 1.0F, 1.0F / (f.nextFloat() * 0.4F + 1.2F) + var7 * 0.5F); +- if(var5) { ++ par1ItemStack.damageItem(1, par3EntityPlayer); ++ par2World.playSoundAtEntity(par3EntityPlayer, "random.bow", 1.0F, 1.0F / (itemRand.nextFloat() * 0.4F + 1.2F) + var7 * 0.5F); ++ ++ if (var5) { + var8.canBePickedUp = 2; + } else { +- var3.inventory.consumeInventoryItem(Item.arrow.itemID); ++ par3EntityPlayer.inventory.consumeInventoryItem(Item.arrow.itemID); + } + +- if(!var2.isRemote) { +- var2.spawnEntityInWorld(var8); ++ if (!par2World.isRemote) { ++ par2World.spawnEntityInWorld(var8); + } + } +- +- } +- +- public ItemStack onEaten(ItemStack var1, World var2, EntityPlayer var3) { +- return var1; +- } +- +- public int getMaxItemUseDuration(ItemStack var1) { ++ } ++ ++ public ItemStack onEaten(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) { ++ return par1ItemStack; ++ } ++ ++ /** ++ * How long it takes to use or consume an item ++ */ ++ public int getMaxItemUseDuration(ItemStack par1ItemStack) { + return 72000; + } + +- public EnumAction getItemUseAction(ItemStack var1) { ++ /** ++ * returns the action that specifies what animation to play when the items is being used ++ */ ++ public EnumAction getItemUseAction(ItemStack par1ItemStack) { + return EnumAction.bow; + } + +- public ItemStack onItemRightClick(ItemStack var1, World var2, EntityPlayer var3) { +- if(var3.capabilities.isCreativeMode || var3.inventory.hasItem(Item.arrow.itemID)) { +- var3.setItemInUse(var1, this.getMaxItemUseDuration(var1)); ++ /** ++ * Called whenever this item is equipped and the right mouse button is pressed. Args: itemStack, world, entityPlayer ++ */ ++ public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) { ++ if (par3EntityPlayer.capabilities.isCreativeMode || par3EntityPlayer.inventory.hasItem(Item.arrow.itemID)) { ++ par3EntityPlayer.setItemInUse(par1ItemStack, this.getMaxItemUseDuration(par1ItemStack)); + } + +- return var1; ++ return par1ItemStack; + } + ++ /** ++ * Return the enchantability factor of the item, most of the time is based on material. ++ */ + public int getItemEnchantability() { + return 1; + } + +- public void registerIcons(IconRegister var1) { +- this.itemIcon = var1.registerIcon(this.getIconString() + "_standby"); +- this.iconArray = new Icon[a.length]; ++ public void registerIcons(IconRegister par1IconRegister) { ++ this.itemIcon = par1IconRegister.registerIcon(this.getIconString() + "_standby"); ++ this.iconArray = new Icon[bowPullIconNameArray.length]; + +- for(int var2 = 0; var2 < this.iconArray.length; ++var2) { +- this.iconArray[var2] = var1.registerIcon(this.getIconString() + "_" + a[var2]); ++ for (int var2 = 0; var2 < this.iconArray.length; ++var2) { ++ this.iconArray[var2] = par1IconRegister.registerIcon(this.getIconString() + "_" + bowPullIconNameArray[var2]); + } +- + } + +- public Icon getItemIconForUseDuration(int var1) { +- return this.iconArray[var1]; ++ /** ++ * used to cycle through icons based on their used duration, i.e. for the bow ++ */ ++ public Icon getItemIconForUseDuration(int par1) { ++ return this.iconArray[par1]; + } + } diff --git a/patches/net/minecraft/src/ItemBucket.java.patch b/patches/net/minecraft/src/ItemBucket.java.patch new file mode 100644 index 0000000..b8ac2f2 --- /dev/null +++ b/patches/net/minecraft/src/ItemBucket.java.patch @@ -0,0 +1,198 @@ +--- net/minecraft/src/ItemBucket.java ++++ net/minecraft/src/ItemBucket.java +@@ -1,131 +1,144 @@ + package net.minecraft.src; + + public class ItemBucket extends Item { ++ ++ /** field for checking if the bucket has been filled. */ + private int isFull; + +- public ItemBucket(int var1, int var2) { +- super(var1); ++ public ItemBucket(int par1, int par2) { ++ super(par1); + this.maxStackSize = 1; +- this.isFull = var2; ++ this.isFull = par2; + this.setCreativeTab(CreativeTabs.tabMisc); + } + +- public ItemStack onItemRightClick(ItemStack var1, World var2, EntityPlayer var3) { ++ /** ++ * Called whenever this item is equipped and the right mouse button is pressed. Args: itemStack, world, entityPlayer ++ */ ++ public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) { + boolean var4 = this.isFull == 0; +- MovingObjectPosition var5 = this.getMovingObjectPositionFromPlayer(var2, var3, var4); +- if(var5 == null) { +- return var1; ++ MovingObjectPosition var5 = this.getMovingObjectPositionFromPlayer(par2World, par3EntityPlayer, var4); ++ ++ if (var5 == null) { ++ return par1ItemStack; + } else { +- if(var5.typeOfHit == EnumMovingObjectType.TILE) { ++ if (var5.typeOfHit == EnumMovingObjectType.TILE) { + int var6 = var5.blockX; + int var7 = var5.blockY; + int var8 = var5.blockZ; +- if(!var2.canMineBlock(var3, var6, var7, var8)) { +- return var1; ++ ++ if (!par2World.canMineBlock(par3EntityPlayer, var6, var7, var8)) { ++ return par1ItemStack; + } + +- if(this.isFull == 0) { +- if(!var3.canPlayerEdit(var6, var7, var8, var5.sideHit, var1)) { +- return var1; ++ if (this.isFull == 0) { ++ if (!par3EntityPlayer.canPlayerEdit(var6, var7, var8, var5.sideHit, par1ItemStack)) { ++ return par1ItemStack; + } + +- if(var2.getBlockMaterial(var6, var7, var8) == Material.water && var2.getBlockMetadata(var6, var7, var8) == 0) { +- var2.setBlockToAir(var6, var7, var8); +- if(var3.capabilities.isCreativeMode) { +- return var1; ++ if (par2World.getBlockMaterial(var6, var7, var8) == Material.water && par2World.getBlockMetadata(var6, var7, var8) == 0) { ++ par2World.setBlockToAir(var6, var7, var8); ++ ++ if (par3EntityPlayer.capabilities.isCreativeMode) { ++ return par1ItemStack; + } + +- if(--var1.stackSize <= 0) { ++ if (--par1ItemStack.stackSize <= 0) { + return new ItemStack(Item.bucketWater); + } + +- if(!var3.inventory.addItemStackToInventory(new ItemStack(Item.bucketWater))) { +- var3.dropPlayerItem(new ItemStack(Item.bucketWater.itemID, 1, 0)); ++ if (!par3EntityPlayer.inventory.addItemStackToInventory(new ItemStack(Item.bucketWater))) { ++ par3EntityPlayer.dropPlayerItem(new ItemStack(Item.bucketWater.itemID, 1, 0)); + } + +- return var1; ++ return par1ItemStack; + } + +- if(var2.getBlockMaterial(var6, var7, var8) == Material.lava && var2.getBlockMetadata(var6, var7, var8) == 0) { +- var2.setBlockToAir(var6, var7, var8); +- if(var3.capabilities.isCreativeMode) { +- return var1; ++ if (par2World.getBlockMaterial(var6, var7, var8) == Material.lava && par2World.getBlockMetadata(var6, var7, var8) == 0) { ++ par2World.setBlockToAir(var6, var7, var8); ++ ++ if (par3EntityPlayer.capabilities.isCreativeMode) { ++ return par1ItemStack; + } + +- if(--var1.stackSize <= 0) { ++ if (--par1ItemStack.stackSize <= 0) { + return new ItemStack(Item.bucketLava); + } + +- if(!var3.inventory.addItemStackToInventory(new ItemStack(Item.bucketLava))) { +- var3.dropPlayerItem(new ItemStack(Item.bucketLava.itemID, 1, 0)); ++ if (!par3EntityPlayer.inventory.addItemStackToInventory(new ItemStack(Item.bucketLava))) { ++ par3EntityPlayer.dropPlayerItem(new ItemStack(Item.bucketLava.itemID, 1, 0)); + } + +- return var1; ++ return par1ItemStack; + } + } else { +- if(this.isFull < 0) { ++ if (this.isFull < 0) { + return new ItemStack(Item.bucketEmpty); + } + +- if(var5.sideHit == 0) { ++ if (var5.sideHit == 0) { + --var7; + } + +- if(var5.sideHit == 1) { ++ if (var5.sideHit == 1) { + ++var7; + } + +- if(var5.sideHit == 2) { ++ if (var5.sideHit == 2) { + --var8; + } + +- if(var5.sideHit == 3) { ++ if (var5.sideHit == 3) { + ++var8; + } + +- if(var5.sideHit == 4) { ++ if (var5.sideHit == 4) { + --var6; + } + +- if(var5.sideHit == 5) { ++ if (var5.sideHit == 5) { + ++var6; + } + +- if(!var3.canPlayerEdit(var6, var7, var8, var5.sideHit, var1)) { +- return var1; ++ if (!par3EntityPlayer.canPlayerEdit(var6, var7, var8, var5.sideHit, par1ItemStack)) { ++ return par1ItemStack; + } + +- if(this.tryPlaceContainedLiquid(var2, var6, var7, var8) && !var3.capabilities.isCreativeMode) { ++ if (this.tryPlaceContainedLiquid(par2World, var6, var7, var8) && !par3EntityPlayer.capabilities.isCreativeMode) { + return new ItemStack(Item.bucketEmpty); + } + } + } + +- return var1; ++ return par1ItemStack; + } + } + +- public boolean tryPlaceContainedLiquid(World var1, int var2, int var3, int var4) { +- if(this.isFull <= 0) { ++ /** ++ * Attempts to place the liquid contained inside the bucket. ++ */ ++ public boolean tryPlaceContainedLiquid(World par1World, int par2, int par3, int par4) { ++ if (this.isFull <= 0) { + return false; + } else { +- Material var5 = var1.getBlockMaterial(var2, var3, var4); ++ Material var5 = par1World.getBlockMaterial(par2, par3, par4); + boolean var6 = !var5.isSolid(); +- if(!var1.isAirBlock(var2, var3, var4) && !var6) { ++ ++ if (!par1World.isAirBlock(par2, par3, par4) && !var6) { + return false; + } else { +- if(var1.provider.isHellWorld && this.isFull == Block.waterMoving.blockID) { +- var1.playSoundEffect((double)((float)var2 + 0.5F), (double)((float)var3 + 0.5F), (double)((float)var4 + 0.5F), "random.fizz", 0.5F, 2.6F + (var1.s.nextFloat() - var1.s.nextFloat()) * 0.8F); ++ if (par1World.provider.isHellWorld && this.isFull == Block.waterMoving.blockID) { ++ par1World.playSoundEffect((double)((float)par2 + 0.5F), (double)((float)par3 + 0.5F), (double)((float)par4 + 0.5F), "random.fizz", 0.5F, 2.6F + (par1World.rand.nextFloat() - par1World.rand.nextFloat()) * 0.8F); + +- for(int var7 = 0; var7 < 8; ++var7) { +- var1.spawnParticle("largesmoke", (double)var2 + Math.random(), (double)var3 + Math.random(), (double)var4 + Math.random(), 0.0D, 0.0D, 0.0D); ++ for (int var7 = 0; var7 < 8; ++var7) { ++ par1World.spawnParticle("largesmoke", (double)par2 + Math.random(), (double)par3 + Math.random(), (double)par4 + Math.random(), 0.0D, 0.0D, 0.0D); + } + } else { +- if(!var1.isRemote && var6 && !var5.isLiquid()) { +- var1.destroyBlock(var2, var3, var4, true); ++ if (!par1World.isRemote && var6 && !var5.isLiquid()) { ++ par1World.destroyBlock(par2, par3, par4, true); + } + +- var1.setBlock(var2, var3, var4, this.isFull, 0, 3); ++ par1World.setBlock(par2, par3, par4, this.isFull, 0, 3); + } + + return true; diff --git a/patches/net/minecraft/src/ItemBucketMilk.java.patch b/patches/net/minecraft/src/ItemBucketMilk.java.patch new file mode 100644 index 0000000..28e4e42 --- /dev/null +++ b/patches/net/minecraft/src/ItemBucketMilk.java.patch @@ -0,0 +1,63 @@ +--- net/minecraft/src/ItemBucketMilk.java ++++ net/minecraft/src/ItemBucketMilk.java +@@ -1,34 +1,43 @@ + package net.minecraft.src; + + public class ItemBucketMilk extends Item { +- public ItemBucketMilk(int var1) { +- super(var1); ++ public ItemBucketMilk(int par1) { ++ super(par1); + this.setMaxStackSize(1); + this.setCreativeTab(CreativeTabs.tabMisc); + } + +- public ItemStack onEaten(ItemStack var1, World var2, EntityPlayer var3) { +- if(!var3.capabilities.isCreativeMode) { +- --var1.stackSize; +- } +- +- if(!var2.isRemote) { +- var3.clearActivePotions(); +- } +- +- return var1.stackSize <= 0 ? new ItemStack(Item.bucketEmpty) : var1; ++ public ItemStack onEaten(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) { ++ if (!par3EntityPlayer.capabilities.isCreativeMode) { ++ --par1ItemStack.stackSize; ++ } ++ ++ if (!par2World.isRemote) { ++ par3EntityPlayer.clearActivePotions(); ++ } ++ ++ return par1ItemStack.stackSize <= 0 ? new ItemStack(Item.bucketEmpty) : par1ItemStack; + } + +- public int getMaxItemUseDuration(ItemStack var1) { ++ /** ++ * How long it takes to use or consume an item ++ */ ++ public int getMaxItemUseDuration(ItemStack par1ItemStack) { + return 32; + } + +- public EnumAction getItemUseAction(ItemStack var1) { ++ /** ++ * returns the action that specifies what animation to play when the items is being used ++ */ ++ public EnumAction getItemUseAction(ItemStack par1ItemStack) { + return EnumAction.drink; + } + +- public ItemStack onItemRightClick(ItemStack var1, World var2, EntityPlayer var3) { +- var3.setItemInUse(var1, this.getMaxItemUseDuration(var1)); +- return var1; ++ /** ++ * Called whenever this item is equipped and the right mouse button is pressed. Args: itemStack, world, entityPlayer ++ */ ++ public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) { ++ par3EntityPlayer.setItemInUse(par1ItemStack, this.getMaxItemUseDuration(par1ItemStack)); ++ return par1ItemStack; + } + } diff --git a/patches/net/minecraft/src/ItemCarrotOnAStick.java.patch b/patches/net/minecraft/src/ItemCarrotOnAStick.java.patch new file mode 100644 index 0000000..0caa8e4 --- /dev/null +++ b/patches/net/minecraft/src/ItemCarrotOnAStick.java.patch @@ -0,0 +1,59 @@ +--- net/minecraft/src/ItemCarrotOnAStick.java ++++ net/minecraft/src/ItemCarrotOnAStick.java +@@ -1,35 +1,46 @@ + package net.minecraft.src; + + public class ItemCarrotOnAStick extends Item { +- public ItemCarrotOnAStick(int var1) { +- super(var1); ++ public ItemCarrotOnAStick(int par1) { ++ super(par1); + this.setCreativeTab(CreativeTabs.tabTransport); + this.setMaxStackSize(1); + this.setMaxDamage(25); + } + ++ /** ++ * Returns True is the item is renderer in full 3D when hold. ++ */ + public boolean isFull3D() { + return true; + } + ++ /** ++ * Returns true if this item should be rotated by 180 degrees around the Y axis when being held in an entities hands. ++ */ + public boolean shouldRotateAroundWhenRendering() { + return true; + } + +- public ItemStack onItemRightClick(ItemStack var1, World var2, EntityPlayer var3) { +- if(var3.isRiding() && var3.ridingEntity instanceof EntityPig) { +- EntityPig var4 = (EntityPig)var3.ridingEntity; +- if(var4.getAIControlledByPlayer().isControlledByPlayer() && var1.getMaxDamage() - var1.getItemDamage() >= 7) { ++ /** ++ * Called whenever this item is equipped and the right mouse button is pressed. Args: itemStack, world, entityPlayer ++ */ ++ public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) { ++ if (par3EntityPlayer.isRiding() && par3EntityPlayer.ridingEntity instanceof EntityPig) { ++ EntityPig var4 = (EntityPig)par3EntityPlayer.ridingEntity; ++ ++ if (var4.getAIControlledByPlayer().isControlledByPlayer() && par1ItemStack.getMaxDamage() - par1ItemStack.getItemDamage() >= 7) { + var4.getAIControlledByPlayer().boostSpeed(); +- var1.damageItem(7, var3); +- if(var1.stackSize == 0) { ++ par1ItemStack.damageItem(7, par3EntityPlayer); ++ ++ if (par1ItemStack.stackSize == 0) { + ItemStack var5 = new ItemStack(Item.fishingRod); +- var5.setTagCompound(var1.stackTagCompound); ++ var5.setTagCompound(par1ItemStack.stackTagCompound); + return var5; + } + } + } + +- return var1; ++ return par1ItemStack; + } + } diff --git a/patches/net/minecraft/src/ItemCloth.java.patch b/patches/net/minecraft/src/ItemCloth.java.patch new file mode 100644 index 0000000..3ee86e7 --- /dev/null +++ b/patches/net/minecraft/src/ItemCloth.java.patch @@ -0,0 +1,46 @@ +--- net/minecraft/src/ItemCloth.java ++++ net/minecraft/src/ItemCloth.java +@@ -1,21 +1,31 @@ + package net.minecraft.src; + + public class ItemCloth extends ItemBlock { +- public ItemCloth(int var1) { +- super(var1); ++ public ItemCloth(int par1) { ++ super(par1); + this.setMaxDamage(0); + this.setHasSubtypes(true); + } + +- public Icon getIconFromDamage(int var1) { +- return Block.cloth.getIcon(2, BlockColored.getBlockFromDye(var1)); +- } +- +- public int getMetadata(int var1) { +- return var1; +- } +- +- public String getUnlocalizedName(ItemStack var1) { +- return super.getUnlocalizedName() + "." + ItemDye.a[BlockColored.getBlockFromDye(var1.getItemDamage())]; ++ /** ++ * Gets an icon index based on an item's damage value ++ */ ++ public Icon getIconFromDamage(int par1) { ++ return Block.cloth.getIcon(2, BlockColored.getBlockFromDye(par1)); ++ } ++ ++ /** ++ * Returns the metadata of the block which this Item (ItemBlock) can place ++ */ ++ public int getMetadata(int par1) { ++ return par1; ++ } ++ ++ /** ++ * Returns the unlocalized name of this item. This version accepts an ItemStack so different stacks can have different ++ * names based on their damage or NBT. ++ */ ++ public String getUnlocalizedName(ItemStack par1ItemStack) { ++ return super.getUnlocalizedName() + "." + ItemDye.dyeColorNames[BlockColored.getBlockFromDye(par1ItemStack.getItemDamage())]; + } + } diff --git a/patches/net/minecraft/src/ItemCoal.java.patch b/patches/net/minecraft/src/ItemCoal.java.patch new file mode 100644 index 0000000..02f64e2 --- /dev/null +++ b/patches/net/minecraft/src/ItemCoal.java.patch @@ -0,0 +1,59 @@ +--- net/minecraft/src/ItemCoal.java ++++ net/minecraft/src/ItemCoal.java +@@ -5,28 +5,38 @@ + public class ItemCoal extends Item { + private Icon field_111220_a; + +- public ItemCoal(int var1) { +- super(var1); ++ public ItemCoal(int par1) { ++ super(par1); + this.setHasSubtypes(true); + this.setMaxDamage(0); + this.setCreativeTab(CreativeTabs.tabMaterials); + } + +- public String getUnlocalizedName(ItemStack var1) { +- return var1.getItemDamage() == 1 ? "item.charcoal" : "item.coal"; +- } +- +- public void getSubItems(int var1, CreativeTabs var2, List var3) { +- var3.add(new ItemStack(var1, 1, 0)); +- var3.add(new ItemStack(var1, 1, 1)); +- } +- +- public Icon getIconFromDamage(int var1) { +- return var1 == 1 ? this.field_111220_a : super.getIconFromDamage(var1); +- } +- +- public void registerIcons(IconRegister var1) { +- super.registerIcons(var1); +- this.field_111220_a = var1.registerIcon("charcoal"); ++ /** ++ * Returns the unlocalized name of this item. This version accepts an ItemStack so different stacks can have different ++ * names based on their damage or NBT. ++ */ ++ public String getUnlocalizedName(ItemStack par1ItemStack) { ++ return par1ItemStack.getItemDamage() == 1 ? "item.charcoal" : "item.coal"; ++ } ++ ++ /** ++ * returns a list of items with the same ID, but different meta (eg: dye returns 16 items) ++ */ ++ public void getSubItems(int par1, CreativeTabs par2CreativeTabs, List par3List) { ++ par3List.add(new ItemStack(par1, 1, 0)); ++ par3List.add(new ItemStack(par1, 1, 1)); ++ } ++ ++ /** ++ * Gets an icon index based on an item's damage value ++ */ ++ public Icon getIconFromDamage(int par1) { ++ return par1 == 1 ? this.field_111220_a : super.getIconFromDamage(par1); ++ } ++ ++ public void registerIcons(IconRegister par1IconRegister) { ++ super.registerIcons(par1IconRegister); ++ this.field_111220_a = par1IconRegister.registerIcon("charcoal"); + } + } diff --git a/patches/net/minecraft/src/ItemColored.java.patch b/patches/net/minecraft/src/ItemColored.java.patch new file mode 100644 index 0000000..3089c1a --- /dev/null +++ b/patches/net/minecraft/src/ItemColored.java.patch @@ -0,0 +1,86 @@ +--- net/minecraft/src/ItemColored.java ++++ net/minecraft/src/ItemColored.java +@@ -1,41 +1,55 @@ + package net.minecraft.src; + + public class ItemColored extends ItemBlock { +- private final Block blockRef = Block.blocksList[this.getBlockID()]; +- private String[] b; +- +- public ItemColored(int var1, boolean var2) { +- super(var1); +- if(var2) { ++ private final Block blockRef; ++ private String[] blockNames; ++ ++ public ItemColored(int par1, boolean par2) { ++ super(par1); ++ this.blockRef = Block.blocksList[this.getBlockID()]; ++ ++ if (par2) { + this.setMaxDamage(0); + this.setHasSubtypes(true); + } +- +- } +- +- public int getColorFromItemStack(ItemStack var1, int var2) { +- return this.blockRef.getRenderColor(var1.getItemDamage()); +- } +- +- public Icon getIconFromDamage(int var1) { +- return this.blockRef.getIcon(0, var1); +- } +- +- public int getMetadata(int var1) { +- return var1; +- } +- +- public ItemColored setBlockNames(String[] var1) { +- this.b = var1; ++ } ++ ++ public int getColorFromItemStack(ItemStack par1ItemStack, int par2) { ++ return this.blockRef.getRenderColor(par1ItemStack.getItemDamage()); ++ } ++ ++ /** ++ * Gets an icon index based on an item's damage value ++ */ ++ public Icon getIconFromDamage(int par1) { ++ return this.blockRef.getIcon(0, par1); ++ } ++ ++ /** ++ * Returns the metadata of the block which this Item (ItemBlock) can place ++ */ ++ public int getMetadata(int par1) { ++ return par1; ++ } ++ ++ /** ++ * Sets the array of strings to be used for name lookups from item damage to metadata ++ */ ++ public ItemColored setBlockNames(String[] par1ArrayOfStr) { ++ this.blockNames = par1ArrayOfStr; + return this; + } + +- public String getUnlocalizedName(ItemStack var1) { +- if(this.b == null) { +- return super.getUnlocalizedName(var1); ++ /** ++ * Returns the unlocalized name of this item. This version accepts an ItemStack so different stacks can have different ++ * names based on their damage or NBT. ++ */ ++ public String getUnlocalizedName(ItemStack par1ItemStack) { ++ if (this.blockNames == null) { ++ return super.getUnlocalizedName(par1ItemStack); + } else { +- int var2 = var1.getItemDamage(); +- return var2 >= 0 && var2 < this.b.length ? super.getUnlocalizedName(var1) + "." + this.b[var2] : super.getUnlocalizedName(var1); ++ int var2 = par1ItemStack.getItemDamage(); ++ return var2 >= 0 && var2 < this.blockNames.length ? super.getUnlocalizedName(par1ItemStack) + "." + this.blockNames[var2] : super.getUnlocalizedName(par1ItemStack); + } + } + } diff --git a/patches/net/minecraft/src/ItemDoor.java.patch b/patches/net/minecraft/src/ItemDoor.java.patch new file mode 100644 index 0000000..18c7c06 --- /dev/null +++ b/patches/net/minecraft/src/ItemDoor.java.patch @@ -0,0 +1,109 @@ +--- net/minecraft/src/ItemDoor.java ++++ net/minecraft/src/ItemDoor.java +@@ -3,32 +3,37 @@ + public class ItemDoor extends Item { + private Material doorMaterial; + +- public ItemDoor(int var1, Material var2) { +- super(var1); +- this.doorMaterial = var2; ++ public ItemDoor(int par1, Material par2Material) { ++ super(par1); ++ this.doorMaterial = par2Material; + this.maxStackSize = 1; + this.setCreativeTab(CreativeTabs.tabRedstone); + } + +- public boolean onItemUse(ItemStack var1, EntityPlayer var2, World var3, int var4, int var5, int var6, int var7, float var8, float var9, float var10) { +- if(var7 != 1) { ++ /** ++ * Callback for item usage. If the item does something special on right clicking, he will have one of those. Return ++ * True if something happen and false if it don't. This is for ITEMS, not BLOCKS ++ */ ++ public boolean onItemUse(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, World par3World, int par4, int par5, int par6, int par7, float par8, float par9, float par10) { ++ if (par7 != 1) { + return false; + } else { +- ++var5; ++ ++par5; + Block var11; +- if(this.doorMaterial == Material.wood) { ++ ++ if (this.doorMaterial == Material.wood) { + var11 = Block.doorWood; + } else { + var11 = Block.doorIron; + } + +- if(var2.canPlayerEdit(var4, var5, var6, var7, var1) && var2.canPlayerEdit(var4, var5 + 1, var6, var7, var1)) { +- if(!var11.canPlaceBlockAt(var3, var4, var5, var6)) { ++ if (par2EntityPlayer.canPlayerEdit(par4, par5, par6, par7, par1ItemStack) && par2EntityPlayer.canPlayerEdit(par4, par5 + 1, par6, par7, par1ItemStack)) { ++ if (!var11.canPlaceBlockAt(par3World, par4, par5, par6)) { + return false; + } else { +- int var12 = MathHelper.floor_double((double)((var2.rotationYaw + 180.0F) * 4.0F / 360.0F) - 0.5D) & 3; +- placeDoorBlock(var3, var4, var5, var6, var12, var11); +- --var1.stackSize; ++ int var12 = MathHelper.floor_double((double)((par2EntityPlayer.rotationYaw + 180.0F) * 4.0F / 360.0F) - 0.5D) & 3; ++ placeDoorBlock(par3World, par4, par5, par6, var12, var11); ++ --par1ItemStack.stackSize; + return true; + } + } else { +@@ -37,39 +42,41 @@ + } + } + +- public static void placeDoorBlock(World var0, int var1, int var2, int var3, int var4, Block var5) { ++ public static void placeDoorBlock(World par0World, int par1, int par2, int par3, int par4, Block par5Block) { + byte var6 = 0; + byte var7 = 0; +- if(var4 == 0) { ++ ++ if (par4 == 0) { + var7 = 1; + } + +- if(var4 == 1) { ++ if (par4 == 1) { + var6 = -1; + } + +- if(var4 == 2) { ++ if (par4 == 2) { + var7 = -1; + } + +- if(var4 == 3) { ++ if (par4 == 3) { + var6 = 1; + } + +- int var8 = (var0.isBlockNormalCube(var1 - var6, var2, var3 - var7) ? 1 : 0) + (var0.isBlockNormalCube(var1 - var6, var2 + 1, var3 - var7) ? 1 : 0); +- int var9 = (var0.isBlockNormalCube(var1 + var6, var2, var3 + var7) ? 1 : 0) + (var0.isBlockNormalCube(var1 + var6, var2 + 1, var3 + var7) ? 1 : 0); +- boolean var10 = var0.getBlockId(var1 - var6, var2, var3 - var7) == var5.blockID || var0.getBlockId(var1 - var6, var2 + 1, var3 - var7) == var5.blockID; +- boolean var11 = var0.getBlockId(var1 + var6, var2, var3 + var7) == var5.blockID || var0.getBlockId(var1 + var6, var2 + 1, var3 + var7) == var5.blockID; ++ int var8 = (par0World.isBlockNormalCube(par1 - var6, par2, par3 - var7) ? 1 : 0) + (par0World.isBlockNormalCube(par1 - var6, par2 + 1, par3 - var7) ? 1 : 0); ++ int var9 = (par0World.isBlockNormalCube(par1 + var6, par2, par3 + var7) ? 1 : 0) + (par0World.isBlockNormalCube(par1 + var6, par2 + 1, par3 + var7) ? 1 : 0); ++ boolean var10 = par0World.getBlockId(par1 - var6, par2, par3 - var7) == par5Block.blockID || par0World.getBlockId(par1 - var6, par2 + 1, par3 - var7) == par5Block.blockID; ++ boolean var11 = par0World.getBlockId(par1 + var6, par2, par3 + var7) == par5Block.blockID || par0World.getBlockId(par1 + var6, par2 + 1, par3 + var7) == par5Block.blockID; + boolean var12 = false; +- if(var10 && !var11) { ++ ++ if (var10 && !var11) { + var12 = true; +- } else if(var9 > var8) { ++ } else if (var9 > var8) { + var12 = true; + } + +- var0.setBlock(var1, var2, var3, var5.blockID, var4, 2); +- var0.setBlock(var1, var2 + 1, var3, var5.blockID, 8 | (var12 ? 1 : 0), 2); +- var0.notifyBlocksOfNeighborChange(var1, var2, var3, var5.blockID); +- var0.notifyBlocksOfNeighborChange(var1, var2 + 1, var3, var5.blockID); ++ par0World.setBlock(par1, par2, par3, par5Block.blockID, par4, 2); ++ par0World.setBlock(par1, par2 + 1, par3, par5Block.blockID, 8 | (var12 ? 1 : 0), 2); ++ par0World.notifyBlocksOfNeighborChange(par1, par2, par3, par5Block.blockID); ++ par0World.notifyBlocksOfNeighborChange(par1, par2 + 1, par3, par5Block.blockID); + } + } diff --git a/patches/net/minecraft/src/ItemDye.java.patch b/patches/net/minecraft/src/ItemDye.java.patch new file mode 100644 index 0000000..3f8a309 --- /dev/null +++ b/patches/net/minecraft/src/ItemDye.java.patch @@ -0,0 +1,390 @@ +--- net/minecraft/src/ItemDye.java ++++ net/minecraft/src/ItemDye.java +@@ -3,73 +3,88 @@ + import java.util.List; + + public class ItemDye extends Item { +- public static final String[] a = new String[]{"black", "red", "green", "brown", "blue", "purple", "cyan", "silver", "gray", "pink", "lime", "yellow", "lightBlue", "magenta", "orange", "white"}; +- public static final String[] b = new String[]{"black", "red", "green", "brown", "blue", "purple", "cyan", "silver", "gray", "pink", "lime", "yellow", "light_blue", "magenta", "orange", "white"}; +- public static final int[] dyeColors = new int[]{1973019, 11743532, 3887386, 5320730, 2437522, 8073150, 2651799, 11250603, 4408131, 14188952, 4312372, 14602026, 6719955, 12801229, 15435844, 15790320}; ++ ++ /** List of dye color names */ ++ public static final String[] dyeColorNames = new String[] {"black", "red", "green", "brown", "blue", "purple", "cyan", "silver", "gray", "pink", "lime", "yellow", "lightBlue", "magenta", "orange", "white"}; ++ public static final String[] dyeItemNames = new String[] {"black", "red", "green", "brown", "blue", "purple", "cyan", "silver", "gray", "pink", "lime", "yellow", "light_blue", "magenta", "orange", "white"}; ++ public static final int[] dyeColors = new int[] {1973019, 11743532, 3887386, 5320730, 2437522, 8073150, 2651799, 11250603, 4408131, 14188952, 4312372, 14602026, 6719955, 12801229, 15435844, 15790320}; + private Icon[] dyeIcons; + +- public ItemDye(int var1) { +- super(var1); ++ public ItemDye(int par1) { ++ super(par1); + this.setHasSubtypes(true); + this.setMaxDamage(0); + this.setCreativeTab(CreativeTabs.tabMaterials); + } + +- public Icon getIconFromDamage(int var1) { +- int var2 = MathHelper.clamp_int(var1, 0, 15); ++ /** ++ * Gets an icon index based on an item's damage value ++ */ ++ public Icon getIconFromDamage(int par1) { ++ int var2 = MathHelper.clamp_int(par1, 0, 15); + return this.dyeIcons[var2]; + } + +- public String getUnlocalizedName(ItemStack var1) { +- int var2 = MathHelper.clamp_int(var1.getItemDamage(), 0, 15); +- return super.getUnlocalizedName() + "." + a[var2]; ++ /** ++ * Returns the unlocalized name of this item. This version accepts an ItemStack so different stacks can have different ++ * names based on their damage or NBT. ++ */ ++ public String getUnlocalizedName(ItemStack par1ItemStack) { ++ int var2 = MathHelper.clamp_int(par1ItemStack.getItemDamage(), 0, 15); ++ return super.getUnlocalizedName() + "." + dyeColorNames[var2]; + } + +- public boolean onItemUse(ItemStack var1, EntityPlayer var2, World var3, int var4, int var5, int var6, int var7, float var8, float var9, float var10) { +- if(!var2.canPlayerEdit(var4, var5, var6, var7, var1)) { ++ /** ++ * Callback for item usage. If the item does something special on right clicking, he will have one of those. Return ++ * True if something happen and false if it don't. This is for ITEMS, not BLOCKS ++ */ ++ public boolean onItemUse(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, World par3World, int par4, int par5, int par6, int par7, float par8, float par9, float par10) { ++ if (!par2EntityPlayer.canPlayerEdit(par4, par5, par6, par7, par1ItemStack)) { + return false; + } else { +- if(var1.getItemDamage() == 15) { +- if(func_96604_a(var1, var3, var4, var5, var6)) { +- if(!var3.isRemote) { +- var3.playAuxSFX(2005, var4, var5, var6, 0); ++ if (par1ItemStack.getItemDamage() == 15) { ++ if (func_96604_a(par1ItemStack, par3World, par4, par5, par6)) { ++ if (!par3World.isRemote) { ++ par3World.playAuxSFX(2005, par4, par5, par6, 0); + } + + return true; + } +- } else if(var1.getItemDamage() == 3) { +- int var11 = var3.getBlockId(var4, var5, var6); +- int var12 = var3.getBlockMetadata(var4, var5, var6); +- if(var11 == Block.wood.blockID && BlockLog.limitToValidMetadata(var12) == 3) { +- if(var7 == 0) { +- return false; +- } +- +- if(var7 == 1) { +- return false; +- } +- +- if(var7 == 2) { +- --var6; +- } +- +- if(var7 == 3) { +- ++var6; +- } +- +- if(var7 == 4) { +- --var4; +- } +- +- if(var7 == 5) { +- ++var4; +- } +- +- if(var3.isAirBlock(var4, var5, var6)) { +- int var13 = Block.blocksList[Block.cocoaPlant.blockID].onBlockPlaced(var3, var4, var5, var6, var7, var8, var9, var10, 0); +- var3.setBlock(var4, var5, var6, Block.cocoaPlant.blockID, var13, 2); +- if(!var2.capabilities.isCreativeMode) { +- --var1.stackSize; ++ } else if (par1ItemStack.getItemDamage() == 3) { ++ int var11 = par3World.getBlockId(par4, par5, par6); ++ int var12 = par3World.getBlockMetadata(par4, par5, par6); ++ ++ if (var11 == Block.wood.blockID && BlockLog.limitToValidMetadata(var12) == 3) { ++ if (par7 == 0) { ++ return false; ++ } ++ ++ if (par7 == 1) { ++ return false; ++ } ++ ++ if (par7 == 2) { ++ --par6; ++ } ++ ++ if (par7 == 3) { ++ ++par6; ++ } ++ ++ if (par7 == 4) { ++ --par4; ++ } ++ ++ if (par7 == 5) { ++ ++par4; ++ } ++ ++ if (par3World.isAirBlock(par4, par5, par6)) { ++ int var13 = Block.blocksList[Block.cocoaPlant.blockID].onBlockPlaced(par3World, par4, par5, par6, par7, par8, par9, par10, 0); ++ par3World.setBlock(par4, par5, par6, Block.cocoaPlant.blockID, var13, 2); ++ ++ if (!par2EntityPlayer.capabilities.isCreativeMode) { ++ --par1ItemStack.stackSize; + } + } + +@@ -81,27 +96,28 @@ + } + } + +- public static boolean func_96604_a(ItemStack var0, World var1, int var2, int var3, int var4) { +- int var5 = var1.getBlockId(var2, var3, var4); +- if(var5 == Block.sapling.blockID) { +- if(!var1.isRemote) { +- if((double)var1.s.nextFloat() < 0.45D) { +- ((BlockSapling)Block.sapling).markOrGrowMarked(var1, var2, var3, var4, var1.s); ++ public static boolean func_96604_a(ItemStack par0ItemStack, World par1World, int par2, int par3, int par4) { ++ int var5 = par1World.getBlockId(par2, par3, par4); ++ ++ if (var5 == Block.sapling.blockID) { ++ if (!par1World.isRemote) { ++ if ((double)par1World.rand.nextFloat() < 0.45D) { ++ ((BlockSapling)Block.sapling).markOrGrowMarked(par1World, par2, par3, par4, par1World.rand); + } + +- --var0.stackSize; ++ --par0ItemStack.stackSize; + } + + return true; +- } else if(var5 != Block.mushroomBrown.blockID && var5 != Block.mushroomRed.blockID) { +- if(var5 != Block.melonStem.blockID && var5 != Block.pumpkinStem.blockID) { +- if(var5 > 0 && Block.blocksList[var5] instanceof BlockCrops) { +- if(var1.getBlockMetadata(var2, var3, var4) == 7) { ++ } else if (var5 != Block.mushroomBrown.blockID && var5 != Block.mushroomRed.blockID) { ++ if (var5 != Block.melonStem.blockID && var5 != Block.pumpkinStem.blockID) { ++ if (var5 > 0 && Block.blocksList[var5] instanceof BlockCrops) { ++ if (par1World.getBlockMetadata(par2, par3, par4) == 7) { + return false; + } else { +- if(!var1.isRemote) { +- ((BlockCrops)Block.blocksList[var5]).fertilize(var1, var2, var3, var4); +- --var0.stackSize; ++ if (!par1World.isRemote) { ++ ((BlockCrops)Block.blocksList[var5]).fertilize(par1World, par2, par3, par4); ++ --par0ItemStack.stackSize; + } + + return true; +@@ -110,53 +126,56 @@ + int var6; + int var7; + int var8; +- if(var5 == Block.cocoaPlant.blockID) { +- var6 = var1.getBlockMetadata(var2, var3, var4); ++ ++ if (var5 == Block.cocoaPlant.blockID) { ++ var6 = par1World.getBlockMetadata(par2, par3, par4); + var7 = BlockDirectional.getDirection(var6); + var8 = BlockCocoa.func_72219_c(var6); +- if(var8 >= 2) { ++ ++ if (var8 >= 2) { + return false; + } else { +- if(!var1.isRemote) { ++ if (!par1World.isRemote) { + ++var8; +- var1.setBlockMetadata(var2, var3, var4, var8 << 2 | var7, 2); +- --var0.stackSize; ++ par1World.setBlockMetadataWithNotify(par2, par3, par4, var8 << 2 | var7, 2); ++ --par0ItemStack.stackSize; + } + + return true; + } +- } else if(var5 != Block.grass.blockID) { ++ } else if (var5 != Block.grass.blockID) { + return false; + } else { +- if(!var1.isRemote) { +- --var0.stackSize; +- ++ if (!par1World.isRemote) { ++ --par0ItemStack.stackSize; + label102: +- for(var6 = 0; var6 < 128; ++var6) { +- var7 = var2; +- var8 = var3 + 1; +- int var9 = var4; +- +- for(int var10 = 0; var10 < var6 / 16; ++var10) { +- var7 += f.nextInt(3) - 1; +- var8 += (f.nextInt(3) - 1) * f.nextInt(3) / 2; +- var9 += f.nextInt(3) - 1; +- if(var1.getBlockId(var7, var8 - 1, var9) != Block.grass.blockID || var1.isBlockNormalCube(var7, var8, var9)) { ++ ++ for (var6 = 0; var6 < 128; ++var6) { ++ var7 = par2; ++ var8 = par3 + 1; ++ int var9 = par4; ++ ++ for (int var10 = 0; var10 < var6 / 16; ++var10) { ++ var7 += itemRand.nextInt(3) - 1; ++ var8 += (itemRand.nextInt(3) - 1) * itemRand.nextInt(3) / 2; ++ var9 += itemRand.nextInt(3) - 1; ++ ++ if (par1World.getBlockId(var7, var8 - 1, var9) != Block.grass.blockID || par1World.isBlockNormalCube(var7, var8, var9)) { + continue label102; + } + } + +- if(var1.getBlockId(var7, var8, var9) == 0) { +- if(f.nextInt(10) != 0) { +- if(Block.tallGrass.canBlockStay(var1, var7, var8, var9)) { +- var1.setBlock(var7, var8, var9, Block.tallGrass.blockID, 1, 3); +- } +- } else if(f.nextInt(3) != 0) { +- if(Block.plantYellow.canBlockStay(var1, var7, var8, var9)) { +- var1.setBlock(var7, var8, var9, Block.plantYellow.blockID); +- } +- } else if(Block.plantRed.canBlockStay(var1, var7, var8, var9)) { +- var1.setBlock(var7, var8, var9, Block.plantRed.blockID); ++ if (par1World.getBlockId(var7, var8, var9) == 0) { ++ if (itemRand.nextInt(10) != 0) { ++ if (Block.tallGrass.canBlockStay(par1World, var7, var8, var9)) { ++ par1World.setBlock(var7, var8, var9, Block.tallGrass.blockID, 1, 3); ++ } ++ } else if (itemRand.nextInt(3) != 0) { ++ if (Block.plantYellow.canBlockStay(par1World, var7, var8, var9)) { ++ par1World.setBlock(var7, var8, var9, Block.plantYellow.blockID); ++ } ++ } else if (Block.plantRed.canBlockStay(par1World, var7, var8, var9)) { ++ par1World.setBlock(var7, var8, var9, Block.plantRed.blockID); + } + } + } +@@ -165,56 +184,61 @@ + return true; + } + } +- } else if(var1.getBlockMetadata(var2, var3, var4) == 7) { ++ } else if (par1World.getBlockMetadata(par2, par3, par4) == 7) { + return false; + } else { +- if(!var1.isRemote) { +- ((BlockStem)Block.blocksList[var5]).fertilizeStem(var1, var2, var3, var4); +- --var0.stackSize; ++ if (!par1World.isRemote) { ++ ((BlockStem)Block.blocksList[var5]).fertilizeStem(par1World, par2, par3, par4); ++ --par0ItemStack.stackSize; + } + + return true; + } + } else { +- if(!var1.isRemote) { +- if((double)var1.s.nextFloat() < 0.4D) { +- ((BlockMushroom)Block.blocksList[var5]).fertilizeMushroom(var1, var2, var3, var4, var1.s); ++ if (!par1World.isRemote) { ++ if ((double)par1World.rand.nextFloat() < 0.4D) { ++ ((BlockMushroom)Block.blocksList[var5]).fertilizeMushroom(par1World, par2, par3, par4, par1World.rand); + } + +- --var0.stackSize; ++ --par0ItemStack.stackSize; + } + + return true; + } + } + +- public static void func_96603_a(World var0, int var1, int var2, int var3, int var4) { +- int var5 = var0.getBlockId(var1, var2, var3); +- if(var4 == 0) { +- var4 = 15; ++ public static void func_96603_a(World par0World, int par1, int par2, int par3, int par4) { ++ int var5 = par0World.getBlockId(par1, par2, par3); ++ ++ if (par4 == 0) { ++ par4 = 15; + } + + Block var6 = var5 > 0 && var5 < Block.blocksList.length ? Block.blocksList[var5] : null; +- if(var6 != null) { +- var6.setBlockBoundsBasedOnState(var0, var1, var2, var3); +- +- for(int var7 = 0; var7 < var4; ++var7) { +- double var8 = f.nextGaussian() * 0.02D; +- double var10 = f.nextGaussian() * 0.02D; +- double var12 = f.nextGaussian() * 0.02D; +- var0.spawnParticle("happyVillager", (double)((float)var1 + f.nextFloat()), (double)var2 + (double)f.nextFloat() * var6.getBlockBoundsMaxY(), (double)((float)var3 + f.nextFloat()), var8, var10, var12); ++ ++ if (var6 != null) { ++ var6.setBlockBoundsBasedOnState(par0World, par1, par2, par3); ++ ++ for (int var7 = 0; var7 < par4; ++var7) { ++ double var8 = itemRand.nextGaussian() * 0.02D; ++ double var10 = itemRand.nextGaussian() * 0.02D; ++ double var12 = itemRand.nextGaussian() * 0.02D; ++ par0World.spawnParticle("happyVillager", (double)((float)par1 + itemRand.nextFloat()), (double)par2 + (double)itemRand.nextFloat() * var6.getBlockBoundsMaxY(), (double)((float)par3 + itemRand.nextFloat()), var8, var10, var12); + } +- + } + } + +- public boolean itemInteractionForEntity(ItemStack var1, EntityPlayer var2, EntityLivingBase var3) { +- if(var3 instanceof EntitySheep) { +- EntitySheep var4 = (EntitySheep)var3; +- int var5 = BlockColored.getBlockFromDye(var1.getItemDamage()); +- if(!var4.getSheared() && var4.getFleeceColor() != var5) { ++ /** ++ * Returns true if the item can be used on the given entity, e.g. shears on sheep. ++ */ ++ public boolean itemInteractionForEntity(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, EntityLivingBase par3EntityLivingBase) { ++ if (par3EntityLivingBase instanceof EntitySheep) { ++ EntitySheep var4 = (EntitySheep)par3EntityLivingBase; ++ int var5 = BlockColored.getBlockFromDye(par1ItemStack.getItemDamage()); ++ ++ if (!var4.getSheared() && var4.getFleeceColor() != var5) { + var4.setFleeceColor(var5); +- --var1.stackSize; ++ --par1ItemStack.stackSize; + } + + return true; +@@ -223,19 +247,20 @@ + } + } + +- public void getSubItems(int var1, CreativeTabs var2, List var3) { +- for(int var4 = 0; var4 < 16; ++var4) { +- var3.add(new ItemStack(var1, 1, var4)); ++ /** ++ * returns a list of items with the same ID, but different meta (eg: dye returns 16 items) ++ */ ++ public void getSubItems(int par1, CreativeTabs par2CreativeTabs, List par3List) { ++ for (int var4 = 0; var4 < 16; ++var4) { ++ par3List.add(new ItemStack(par1, 1, var4)); + } +- + } + +- public void registerIcons(IconRegister var1) { +- this.dyeIcons = new Icon[b.length]; ++ public void registerIcons(IconRegister par1IconRegister) { ++ this.dyeIcons = new Icon[dyeItemNames.length]; + +- for(int var2 = 0; var2 < b.length; ++var2) { +- this.dyeIcons[var2] = var1.registerIcon(this.getIconString() + "_" + b[var2]); ++ for (int var2 = 0; var2 < dyeItemNames.length; ++var2) { ++ this.dyeIcons[var2] = par1IconRegister.registerIcon(this.getIconString() + "_" + dyeItemNames[var2]); + } +- + } + } diff --git a/patches/net/minecraft/src/ItemEditableBook.java.patch b/patches/net/minecraft/src/ItemEditableBook.java.patch new file mode 100644 index 0000000..9775de1 --- /dev/null +++ b/patches/net/minecraft/src/ItemEditableBook.java.patch @@ -0,0 +1,94 @@ +--- net/minecraft/src/ItemEditableBook.java ++++ net/minecraft/src/ItemEditableBook.java +@@ -3,55 +3,65 @@ + import java.util.List; + + public class ItemEditableBook extends Item { +- public ItemEditableBook(int var1) { +- super(var1); ++ public ItemEditableBook(int par1) { ++ super(par1); + this.setMaxStackSize(1); + } + +- public static boolean validBookTagContents(NBTTagCompound var0) { +- if(!ItemWritableBook.validBookTagPages(var0)) { ++ public static boolean validBookTagContents(NBTTagCompound par0NBTTagCompound) { ++ if (!ItemWritableBook.validBookTagPages(par0NBTTagCompound)) { + return false; +- } else if(!var0.hasKey("title")) { ++ } else if (!par0NBTTagCompound.hasKey("title")) { + return false; + } else { +- String var1 = var0.getString("title"); +- return var1 != null && var1.length() <= 16 ? var0.hasKey("author") : false; ++ String var1 = par0NBTTagCompound.getString("title"); ++ return var1 != null && var1.length() <= 16 ? par0NBTTagCompound.hasKey("author") : false; + } + } + +- public String getItemDisplayName(ItemStack var1) { +- if(var1.hasTagCompound()) { +- NBTTagCompound var2 = var1.getTagCompound(); ++ public String getItemDisplayName(ItemStack par1ItemStack) { ++ if (par1ItemStack.hasTagCompound()) { ++ NBTTagCompound var2 = par1ItemStack.getTagCompound(); + NBTTagString var3 = (NBTTagString)var2.getTag("title"); +- if(var3 != null) { ++ ++ if (var3 != null) { + return var3.toString(); + } + } + +- return super.getItemDisplayName(var1); ++ return super.getItemDisplayName(par1ItemStack); + } + +- public void addInformation(ItemStack var1, EntityPlayer var2, List var3, boolean var4) { +- if(var1.hasTagCompound()) { +- NBTTagCompound var5 = var1.getTagCompound(); ++ /** ++ * allows items to add custom lines of information to the mouseover description ++ */ ++ public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4) { ++ if (par1ItemStack.hasTagCompound()) { ++ NBTTagCompound var5 = par1ItemStack.getTagCompound(); + NBTTagString var6 = (NBTTagString)var5.getTag("author"); +- if(var6 != null) { +- var3.add(EnumChatFormatting.GRAY + String.format(StatCollector.translateToLocalFormatted("book.byAuthor", new Object[]{var6.a}), new Object[0])); ++ ++ if (var6 != null) { ++ par3List.add(EnumChatFormatting.GRAY + String.format(StatCollector.translateToLocalFormatted("book.byAuthor", new Object[] {var6.data}), new Object[0])); + } + } +- +- } +- +- public ItemStack onItemRightClick(ItemStack var1, World var2, EntityPlayer var3) { +- var3.displayGUIBook(var1); +- return var1; +- } +- ++ } ++ ++ /** ++ * Called whenever this item is equipped and the right mouse button is pressed. Args: itemStack, world, entityPlayer ++ */ ++ public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) { ++ par3EntityPlayer.displayGUIBook(par1ItemStack); ++ return par1ItemStack; ++ } ++ ++ /** ++ * If this function returns true (or the item is damageable), the ItemStack's NBT tag will be sent to the client. ++ */ + public boolean getShareTag() { + return true; + } + +- public boolean hasEffect(ItemStack var1) { ++ public boolean hasEffect(ItemStack par1ItemStack) { + return true; + } + } diff --git a/patches/net/minecraft/src/ItemEgg.java.patch b/patches/net/minecraft/src/ItemEgg.java.patch new file mode 100644 index 0000000..ce8e69f --- /dev/null +++ b/patches/net/minecraft/src/ItemEgg.java.patch @@ -0,0 +1,42 @@ +--- net/minecraft/src/ItemEgg.java ++++ net/minecraft/src/ItemEgg.java +@@ -1,22 +1,26 @@ + package net.minecraft.src; + + public class ItemEgg extends Item { +- public ItemEgg(int var1) { +- super(var1); ++ public ItemEgg(int par1) { ++ super(par1); + this.maxStackSize = 16; + this.setCreativeTab(CreativeTabs.tabMaterials); + } + +- public ItemStack onItemRightClick(ItemStack var1, World var2, EntityPlayer var3) { +- if(!var3.capabilities.isCreativeMode) { +- --var1.stackSize; +- } +- +- var2.playSoundAtEntity(var3, "random.bow", 0.5F, 0.4F / (f.nextFloat() * 0.4F + 0.8F)); +- if(!var2.isRemote) { +- var2.spawnEntityInWorld(new EntityEgg(var2, var3)); +- } +- +- return var1; ++ /** ++ * Called whenever this item is equipped and the right mouse button is pressed. Args: itemStack, world, entityPlayer ++ */ ++ public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) { ++ if (!par3EntityPlayer.capabilities.isCreativeMode) { ++ --par1ItemStack.stackSize; ++ } ++ ++ par2World.playSoundAtEntity(par3EntityPlayer, "random.bow", 0.5F, 0.4F / (itemRand.nextFloat() * 0.4F + 0.8F)); ++ ++ if (!par2World.isRemote) { ++ par2World.spawnEntityInWorld(new EntityEgg(par2World, par3EntityPlayer)); ++ } ++ ++ return par1ItemStack; + } + } diff --git a/patches/net/minecraft/src/ItemEmptyMap.java.patch b/patches/net/minecraft/src/ItemEmptyMap.java.patch new file mode 100644 index 0000000..1d0befa --- /dev/null +++ b/patches/net/minecraft/src/ItemEmptyMap.java.patch @@ -0,0 +1,51 @@ +--- net/minecraft/src/ItemEmptyMap.java ++++ net/minecraft/src/ItemEmptyMap.java +@@ -1,31 +1,35 @@ + package net.minecraft.src; + + public class ItemEmptyMap extends ItemMapBase { +- protected ItemEmptyMap(int var1) { +- super(var1); ++ protected ItemEmptyMap(int par1) { ++ super(par1); + this.setCreativeTab(CreativeTabs.tabMisc); + } + +- public ItemStack onItemRightClick(ItemStack var1, World var2, EntityPlayer var3) { +- ItemStack var4 = new ItemStack(Item.map, 1, var2.getUniqueDataId("map")); ++ /** ++ * Called whenever this item is equipped and the right mouse button is pressed. Args: itemStack, world, entityPlayer ++ */ ++ public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) { ++ ItemStack var4 = new ItemStack(Item.map, 1, par2World.getUniqueDataId("map")); + String var5 = "map_" + var4.getItemDamage(); + MapData var6 = new MapData(var5); +- var2.setItemData(var5, var6); ++ par2World.setItemData(var5, var6); + var6.scale = 0; + int var7 = 128 * (1 << var6.scale); +- var6.xCenter = (int)(Math.round(var3.posX / (double)var7) * (long)var7); +- var6.zCenter = (int)(Math.round(var3.posZ / (double)var7) * (long)var7); +- var6.dimension = (byte)var2.provider.dimensionId; ++ var6.xCenter = (int)(Math.round(par3EntityPlayer.posX / (double)var7) * (long)var7); ++ var6.zCenter = (int)(Math.round(par3EntityPlayer.posZ / (double)var7) * (long)var7); ++ var6.dimension = (byte)par2World.provider.dimensionId; + var6.markDirty(); +- --var1.stackSize; +- if(var1.stackSize <= 0) { ++ --par1ItemStack.stackSize; ++ ++ if (par1ItemStack.stackSize <= 0) { + return var4; + } else { +- if(!var3.inventory.addItemStackToInventory(var4.copy())) { +- var3.dropPlayerItem(var4); ++ if (!par3EntityPlayer.inventory.addItemStackToInventory(var4.copy())) { ++ par3EntityPlayer.dropPlayerItem(var4); + } + +- return var1; ++ return par1ItemStack; + } + } + } diff --git a/patches/net/minecraft/src/ItemEnchantedBook.java.patch b/patches/net/minecraft/src/ItemEnchantedBook.java.patch new file mode 100644 index 0000000..5bc4212 --- /dev/null +++ b/patches/net/minecraft/src/ItemEnchantedBook.java.patch @@ -0,0 +1,160 @@ +--- net/minecraft/src/ItemEnchantedBook.java ++++ net/minecraft/src/ItemEnchantedBook.java +@@ -4,50 +4,64 @@ + import java.util.Random; + + public class ItemEnchantedBook extends Item { +- public ItemEnchantedBook(int var1) { +- super(var1); ++ public ItemEnchantedBook(int par1) { ++ super(par1); + } + +- public boolean hasEffect(ItemStack var1) { ++ public boolean hasEffect(ItemStack par1ItemStack) { + return true; + } + +- public boolean isItemTool(ItemStack var1) { ++ /** ++ * Checks isDamagable and if it cannot be stacked ++ */ ++ public boolean isItemTool(ItemStack par1ItemStack) { + return false; + } + +- public EnumRarity getRarity(ItemStack var1) { +- return this.func_92110_g(var1).tagCount() > 0 ? EnumRarity.uncommon : super.getRarity(var1); +- } +- +- public NBTTagList func_92110_g(ItemStack var1) { +- return var1.stackTagCompound != null && var1.stackTagCompound.hasKey("StoredEnchantments") ? (NBTTagList)var1.stackTagCompound.getTag("StoredEnchantments") : new NBTTagList(); +- } +- +- public void addInformation(ItemStack var1, EntityPlayer var2, List var3, boolean var4) { +- super.addInformation(var1, var2, var3, var4); +- NBTTagList var5 = this.func_92110_g(var1); +- if(var5 != null) { +- for(int var6 = 0; var6 < var5.tagCount(); ++var6) { ++ /** ++ * Return an item rarity from EnumRarity ++ */ ++ public EnumRarity getRarity(ItemStack par1ItemStack) { ++ return this.func_92110_g(par1ItemStack).tagCount() > 0 ? EnumRarity.uncommon : super.getRarity(par1ItemStack); ++ } ++ ++ public NBTTagList func_92110_g(ItemStack par1ItemStack) { ++ return par1ItemStack.stackTagCompound != null && par1ItemStack.stackTagCompound.hasKey("StoredEnchantments") ? (NBTTagList)par1ItemStack.stackTagCompound.getTag("StoredEnchantments") : new NBTTagList(); ++ } ++ ++ /** ++ * allows items to add custom lines of information to the mouseover description ++ */ ++ public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4) { ++ super.addInformation(par1ItemStack, par2EntityPlayer, par3List, par4); ++ NBTTagList var5 = this.func_92110_g(par1ItemStack); ++ ++ if (var5 != null) { ++ for (int var6 = 0; var6 < var5.tagCount(); ++var6) { + short var7 = ((NBTTagCompound)var5.tagAt(var6)).getShort("id"); + short var8 = ((NBTTagCompound)var5.tagAt(var6)).getShort("lvl"); +- if(Enchantment.enchantmentsList[var7] != null) { +- var3.add(Enchantment.enchantmentsList[var7].getTranslatedName(var8)); ++ ++ if (Enchantment.enchantmentsList[var7] != null) { ++ par3List.add(Enchantment.enchantmentsList[var7].getTranslatedName(var8)); + } + } + } +- + } + +- public void addEnchantment(ItemStack var1, EnchantmentData var2) { +- NBTTagList var3 = this.func_92110_g(var1); ++ /** ++ * Adds an stored enchantment to an enchanted book ItemStack ++ */ ++ public void addEnchantment(ItemStack par1ItemStack, EnchantmentData par2EnchantmentData) { ++ NBTTagList var3 = this.func_92110_g(par1ItemStack); + boolean var4 = true; + +- for(int var5 = 0; var5 < var3.tagCount(); ++var5) { ++ for (int var5 = 0; var5 < var3.tagCount(); ++var5) { + NBTTagCompound var6 = (NBTTagCompound)var3.tagAt(var5); +- if(var6.getShort("id") == var2.enchantmentobj.effectId) { +- if(var6.getShort("lvl") < var2.enchantmentLevel) { +- var6.setShort("lvl", (short)var2.enchantmentLevel); ++ ++ if (var6.getShort("id") == par2EnchantmentData.enchantmentobj.effectId) { ++ if (var6.getShort("lvl") < par2EnchantmentData.enchantmentLevel) { ++ var6.setShort("lvl", (short)par2EnchantmentData.enchantmentLevel); + } + + var4 = false; +@@ -55,42 +69,44 @@ + } + } + +- if(var4) { ++ if (var4) { + NBTTagCompound var7 = new NBTTagCompound(); +- var7.setShort("id", (short)var2.enchantmentobj.effectId); +- var7.setShort("lvl", (short)var2.enchantmentLevel); ++ var7.setShort("id", (short)par2EnchantmentData.enchantmentobj.effectId); ++ var7.setShort("lvl", (short)par2EnchantmentData.enchantmentLevel); + var3.appendTag(var7); + } + +- if(!var1.hasTagCompound()) { +- var1.setTagCompound(new NBTTagCompound()); ++ if (!par1ItemStack.hasTagCompound()) { ++ par1ItemStack.setTagCompound(new NBTTagCompound()); + } + +- var1.getTagCompound().setTag("StoredEnchantments", var3); ++ par1ItemStack.getTagCompound().setTag("StoredEnchantments", var3); + } + +- public ItemStack getEnchantedItemStack(EnchantmentData var1) { ++ /** ++ * Returns the ItemStack of an enchanted version of this item. ++ */ ++ public ItemStack getEnchantedItemStack(EnchantmentData par1EnchantmentData) { + ItemStack var2 = new ItemStack(this); +- this.addEnchantment(var2, var1); ++ this.addEnchantment(var2, par1EnchantmentData); + return var2; + } + +- public void func_92113_a(Enchantment var1, List var2) { +- for(int var3 = var1.getMinLevel(); var3 <= var1.getMaxLevel(); ++var3) { +- var2.add(this.getEnchantedItemStack(new EnchantmentData(var1, var3))); ++ public void func_92113_a(Enchantment par1Enchantment, List par2List) { ++ for (int var3 = par1Enchantment.getMinLevel(); var3 <= par1Enchantment.getMaxLevel(); ++var3) { ++ par2List.add(this.getEnchantedItemStack(new EnchantmentData(par1Enchantment, var3))); + } +- +- } +- +- public WeightedRandomChestContent func_92114_b(Random var1) { +- return this.func_92112_a(var1, 1, 1, 1); +- } +- +- public WeightedRandomChestContent func_92112_a(Random var1, int var2, int var3, int var4) { +- Enchantment var5 = Enchantment.enchantmentsBookList[var1.nextInt(Enchantment.enchantmentsBookList.length)]; ++ } ++ ++ public WeightedRandomChestContent func_92114_b(Random par1Random) { ++ return this.func_92112_a(par1Random, 1, 1, 1); ++ } ++ ++ public WeightedRandomChestContent func_92112_a(Random par1Random, int par2, int par3, int par4) { ++ Enchantment var5 = Enchantment.enchantmentsBookList[par1Random.nextInt(Enchantment.enchantmentsBookList.length)]; + ItemStack var6 = new ItemStack(this.itemID, 1, 0); +- int var7 = MathHelper.getRandomIntegerInRange(var1, var5.getMinLevel(), var5.getMaxLevel()); ++ int var7 = MathHelper.getRandomIntegerInRange(par1Random, var5.getMinLevel(), var5.getMaxLevel()); + this.addEnchantment(var6, new EnchantmentData(var5, var7)); +- return new WeightedRandomChestContent(var6, var2, var3, var4); ++ return new WeightedRandomChestContent(var6, par2, par3, par4); + } + } diff --git a/patches/net/minecraft/src/ItemEnderEye.java.patch b/patches/net/minecraft/src/ItemEnderEye.java.patch new file mode 100644 index 0000000..c89e895 --- /dev/null +++ b/patches/net/minecraft/src/ItemEnderEye.java.patch @@ -0,0 +1,213 @@ +--- net/minecraft/src/ItemEnderEye.java ++++ net/minecraft/src/ItemEnderEye.java +@@ -1,31 +1,36 @@ + package net.minecraft.src; + + public class ItemEnderEye extends Item { +- public ItemEnderEye(int var1) { +- super(var1); ++ public ItemEnderEye(int par1) { ++ super(par1); + this.setCreativeTab(CreativeTabs.tabMisc); + } + +- public boolean onItemUse(ItemStack var1, EntityPlayer var2, World var3, int var4, int var5, int var6, int var7, float var8, float var9, float var10) { +- int var11 = var3.getBlockId(var4, var5, var6); +- int var12 = var3.getBlockMetadata(var4, var5, var6); +- if(var2.canPlayerEdit(var4, var5, var6, var7, var1) && var11 == Block.endPortalFrame.blockID && !BlockEndPortalFrame.isEnderEyeInserted(var12)) { +- if(var3.isRemote) { ++ /** ++ * Callback for item usage. If the item does something special on right clicking, he will have one of those. Return ++ * True if something happen and false if it don't. This is for ITEMS, not BLOCKS ++ */ ++ public boolean onItemUse(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, World par3World, int par4, int par5, int par6, int par7, float par8, float par9, float par10) { ++ int var11 = par3World.getBlockId(par4, par5, par6); ++ int var12 = par3World.getBlockMetadata(par4, par5, par6); ++ ++ if (par2EntityPlayer.canPlayerEdit(par4, par5, par6, par7, par1ItemStack) && var11 == Block.endPortalFrame.blockID && !BlockEndPortalFrame.isEnderEyeInserted(var12)) { ++ if (par3World.isRemote) { + return true; + } else { +- var3.setBlockMetadata(var4, var5, var6, var12 + 4, 2); +- var3.func_96440_m(var4, var5, var6, Block.endPortalFrame.blockID); +- --var1.stackSize; +- ++ par3World.setBlockMetadataWithNotify(par4, par5, par6, var12 + 4, 2); ++ par3World.func_96440_m(par4, par5, par6, Block.endPortalFrame.blockID); ++ --par1ItemStack.stackSize; + int var13; +- for(var13 = 0; var13 < 16; ++var13) { +- double var14 = (double)((float)var4 + (5.0F + f.nextFloat() * 6.0F) / 16.0F); +- double var16 = (double)((float)var5 + 13.0F / 16.0F); +- double var18 = (double)((float)var6 + (5.0F + f.nextFloat() * 6.0F) / 16.0F); ++ ++ for (var13 = 0; var13 < 16; ++var13) { ++ double var14 = (double)((float)par4 + (5.0F + itemRand.nextFloat() * 6.0F) / 16.0F); ++ double var16 = (double)((float)par5 + 0.8125F); ++ double var18 = (double)((float)par6 + (5.0F + itemRand.nextFloat() * 6.0F) / 16.0F); + double var20 = 0.0D; + double var22 = 0.0D; + double var24 = 0.0D; +- var3.spawnParticle("smoke", var14, var16, var18, var20, var22, var24); ++ par3World.spawnParticle("smoke", var14, var16, var18, var20, var22, var24); + } + + var13 = var12 & 3; +@@ -33,69 +38,74 @@ + int var15 = 0; + boolean var27 = false; + boolean var17 = true; +- int var28 = Direction.enderEyeMetaToDirection[var13]; +- ++ int var28 = Direction.rotateRight[var13]; + int var19; + int var21; + int var23; + int var29; + int var30; +- for(var19 = -2; var19 <= 2; ++var19) { +- var29 = var4 + Direction.offsetX[var28] * var19; +- var21 = var6 + Direction.offsetZ[var28] * var19; +- var30 = var3.getBlockId(var29, var5, var21); +- if(var30 == Block.endPortalFrame.blockID) { +- var23 = var3.getBlockMetadata(var29, var5, var21); +- if(!BlockEndPortalFrame.isEnderEyeInserted(var23)) { ++ ++ for (var19 = -2; var19 <= 2; ++var19) { ++ var29 = par4 + Direction.offsetX[var28] * var19; ++ var21 = par6 + Direction.offsetZ[var28] * var19; ++ var30 = par3World.getBlockId(var29, par5, var21); ++ ++ if (var30 == Block.endPortalFrame.blockID) { ++ var23 = par3World.getBlockMetadata(var29, par5, var21); ++ ++ if (!BlockEndPortalFrame.isEnderEyeInserted(var23)) { + var17 = false; + break; + } + + var15 = var19; +- if(!var27) { ++ ++ if (!var27) { + var26 = var19; + var27 = true; + } + } + } + +- if(var17 && var15 == var26 + 2) { +- for(var19 = var26; var19 <= var15; ++var19) { +- var29 = var4 + Direction.offsetX[var28] * var19; +- var21 = var6 + Direction.offsetZ[var28] * var19; ++ if (var17 && var15 == var26 + 2) { ++ for (var19 = var26; var19 <= var15; ++var19) { ++ var29 = par4 + Direction.offsetX[var28] * var19; ++ var21 = par6 + Direction.offsetZ[var28] * var19; + var29 += Direction.offsetX[var13] * 4; + var21 += Direction.offsetZ[var13] * 4; +- var30 = var3.getBlockId(var29, var5, var21); +- var23 = var3.getBlockMetadata(var29, var5, var21); +- if(var30 != Block.endPortalFrame.blockID || !BlockEndPortalFrame.isEnderEyeInserted(var23)) { ++ var30 = par3World.getBlockId(var29, par5, var21); ++ var23 = par3World.getBlockMetadata(var29, par5, var21); ++ ++ if (var30 != Block.endPortalFrame.blockID || !BlockEndPortalFrame.isEnderEyeInserted(var23)) { + var17 = false; + break; + } + } + +- for(var19 = var26 - 1; var19 <= var15 + 1; var19 += 4) { +- for(var29 = 1; var29 <= 3; ++var29) { +- var21 = var4 + Direction.offsetX[var28] * var19; +- var30 = var6 + Direction.offsetZ[var28] * var19; ++ for (var19 = var26 - 1; var19 <= var15 + 1; var19 += 4) { ++ for (var29 = 1; var29 <= 3; ++var29) { ++ var21 = par4 + Direction.offsetX[var28] * var19; ++ var30 = par6 + Direction.offsetZ[var28] * var19; + var21 += Direction.offsetX[var13] * var29; + var30 += Direction.offsetZ[var13] * var29; +- var23 = var3.getBlockId(var21, var5, var30); +- int var31 = var3.getBlockMetadata(var21, var5, var30); +- if(var23 != Block.endPortalFrame.blockID || !BlockEndPortalFrame.isEnderEyeInserted(var31)) { ++ var23 = par3World.getBlockId(var21, par5, var30); ++ int var31 = par3World.getBlockMetadata(var21, par5, var30); ++ ++ if (var23 != Block.endPortalFrame.blockID || !BlockEndPortalFrame.isEnderEyeInserted(var31)) { + var17 = false; + break; + } + } + } + +- if(var17) { +- for(var19 = var26; var19 <= var15; ++var19) { +- for(var29 = 1; var29 <= 3; ++var29) { +- var21 = var4 + Direction.offsetX[var28] * var19; +- var30 = var6 + Direction.offsetZ[var28] * var19; ++ if (var17) { ++ for (var19 = var26; var19 <= var15; ++var19) { ++ for (var29 = 1; var29 <= 3; ++var29) { ++ var21 = par4 + Direction.offsetX[var28] * var19; ++ var30 = par6 + Direction.offsetZ[var28] * var19; + var21 += Direction.offsetX[var13] * var29; + var30 += Direction.offsetZ[var13] * var29; +- var3.setBlock(var21, var5, var30, Block.endPortal.blockID, 0, 2); ++ par3World.setBlock(var21, par5, var30, Block.endPortal.blockID, 0, 2); + } + } + } +@@ -108,29 +118,36 @@ + } + } + +- public ItemStack onItemRightClick(ItemStack var1, World var2, EntityPlayer var3) { +- MovingObjectPosition var4 = this.getMovingObjectPositionFromPlayer(var2, var3, false); +- if(var4 != null && var4.typeOfHit == EnumMovingObjectType.TILE) { +- int var5 = var2.getBlockId(var4.blockX, var4.blockY, var4.blockZ); +- if(var5 == Block.endPortalFrame.blockID) { +- return var1; ++ /** ++ * Called whenever this item is equipped and the right mouse button is pressed. Args: itemStack, world, entityPlayer ++ */ ++ public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) { ++ MovingObjectPosition var4 = this.getMovingObjectPositionFromPlayer(par2World, par3EntityPlayer, false); ++ ++ if (var4 != null && var4.typeOfHit == EnumMovingObjectType.TILE) { ++ int var5 = par2World.getBlockId(var4.blockX, var4.blockY, var4.blockZ); ++ ++ if (var5 == Block.endPortalFrame.blockID) { ++ return par1ItemStack; + } + } + +- if(!var2.isRemote) { +- ChunkPosition var7 = var2.findClosestStructure("Stronghold", (int)var3.posX, (int)var3.posY, (int)var3.posZ); +- if(var7 != null) { +- EntityEnderEye var6 = new EntityEnderEye(var2, var3.posX, var3.posY + 1.62D - (double)var3.yOffset, var3.posZ); ++ if (!par2World.isRemote) { ++ ChunkPosition var7 = par2World.findClosestStructure("Stronghold", (int)par3EntityPlayer.posX, (int)par3EntityPlayer.posY, (int)par3EntityPlayer.posZ); ++ ++ if (var7 != null) { ++ EntityEnderEye var6 = new EntityEnderEye(par2World, par3EntityPlayer.posX, par3EntityPlayer.posY + 1.62D - (double)par3EntityPlayer.yOffset, par3EntityPlayer.posZ); + var6.moveTowards((double)var7.x, var7.y, (double)var7.z); +- var2.spawnEntityInWorld(var6); +- var2.playSoundAtEntity(var3, "random.bow", 0.5F, 0.4F / (f.nextFloat() * 0.4F + 0.8F)); +- var2.playAuxSFXAtEntity((EntityPlayer)null, 1002, (int)var3.posX, (int)var3.posY, (int)var3.posZ, 0); +- if(!var3.capabilities.isCreativeMode) { +- --var1.stackSize; ++ par2World.spawnEntityInWorld(var6); ++ par2World.playSoundAtEntity(par3EntityPlayer, "random.bow", 0.5F, 0.4F / (itemRand.nextFloat() * 0.4F + 0.8F)); ++ par2World.playAuxSFXAtEntity((EntityPlayer)null, 1002, (int)par3EntityPlayer.posX, (int)par3EntityPlayer.posY, (int)par3EntityPlayer.posZ, 0); ++ ++ if (!par3EntityPlayer.capabilities.isCreativeMode) { ++ --par1ItemStack.stackSize; + } + } + } + +- return var1; ++ return par1ItemStack; + } + } diff --git a/patches/net/minecraft/src/ItemEnderPearl.java.patch b/patches/net/minecraft/src/ItemEnderPearl.java.patch new file mode 100644 index 0000000..76cba7f --- /dev/null +++ b/patches/net/minecraft/src/ItemEnderPearl.java.patch @@ -0,0 +1,40 @@ +--- net/minecraft/src/ItemEnderPearl.java ++++ net/minecraft/src/ItemEnderPearl.java +@@ -1,23 +1,27 @@ + package net.minecraft.src; + + public class ItemEnderPearl extends Item { +- public ItemEnderPearl(int var1) { +- super(var1); ++ public ItemEnderPearl(int par1) { ++ super(par1); + this.maxStackSize = 16; + this.setCreativeTab(CreativeTabs.tabMisc); + } + +- public ItemStack onItemRightClick(ItemStack var1, World var2, EntityPlayer var3) { +- if(var3.capabilities.isCreativeMode) { +- return var1; ++ /** ++ * Called whenever this item is equipped and the right mouse button is pressed. Args: itemStack, world, entityPlayer ++ */ ++ public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) { ++ if (par3EntityPlayer.capabilities.isCreativeMode) { ++ return par1ItemStack; + } else { +- --var1.stackSize; +- var2.playSoundAtEntity(var3, "random.bow", 0.5F, 0.4F / (f.nextFloat() * 0.4F + 0.8F)); +- if(!var2.isRemote) { +- var2.spawnEntityInWorld(new EntityEnderPearl(var2, var3)); ++ --par1ItemStack.stackSize; ++ par2World.playSoundAtEntity(par3EntityPlayer, "random.bow", 0.5F, 0.4F / (itemRand.nextFloat() * 0.4F + 0.8F)); ++ ++ if (!par2World.isRemote) { ++ par2World.spawnEntityInWorld(new EntityEnderPearl(par2World, par3EntityPlayer)); + } + +- return var1; ++ return par1ItemStack; + } + } + } diff --git a/patches/net/minecraft/src/ItemExpBottle.java.patch b/patches/net/minecraft/src/ItemExpBottle.java.patch new file mode 100644 index 0000000..e15751c --- /dev/null +++ b/patches/net/minecraft/src/ItemExpBottle.java.patch @@ -0,0 +1,46 @@ +--- net/minecraft/src/ItemExpBottle.java ++++ net/minecraft/src/ItemExpBottle.java +@@ -1,25 +1,29 @@ + package net.minecraft.src; + + public class ItemExpBottle extends Item { +- public ItemExpBottle(int var1) { +- super(var1); ++ public ItemExpBottle(int par1) { ++ super(par1); + this.setCreativeTab(CreativeTabs.tabMisc); + } + +- public boolean hasEffect(ItemStack var1) { ++ public boolean hasEffect(ItemStack par1ItemStack) { + return true; + } + +- public ItemStack onItemRightClick(ItemStack var1, World var2, EntityPlayer var3) { +- if(!var3.capabilities.isCreativeMode) { +- --var1.stackSize; +- } +- +- var2.playSoundAtEntity(var3, "random.bow", 0.5F, 0.4F / (f.nextFloat() * 0.4F + 0.8F)); +- if(!var2.isRemote) { +- var2.spawnEntityInWorld(new EntityExpBottle(var2, var3)); +- } +- +- return var1; ++ /** ++ * Called whenever this item is equipped and the right mouse button is pressed. Args: itemStack, world, entityPlayer ++ */ ++ public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) { ++ if (!par3EntityPlayer.capabilities.isCreativeMode) { ++ --par1ItemStack.stackSize; ++ } ++ ++ par2World.playSoundAtEntity(par3EntityPlayer, "random.bow", 0.5F, 0.4F / (itemRand.nextFloat() * 0.4F + 0.8F)); ++ ++ if (!par2World.isRemote) { ++ par2World.spawnEntityInWorld(new EntityExpBottle(par2World, par3EntityPlayer)); ++ } ++ ++ return par1ItemStack; + } + } diff --git a/patches/net/minecraft/src/ItemFireball.java.patch b/patches/net/minecraft/src/ItemFireball.java.patch new file mode 100644 index 0000000..8799b9d --- /dev/null +++ b/patches/net/minecraft/src/ItemFireball.java.patch @@ -0,0 +1,93 @@ +--- net/minecraft/src/ItemFireball.java ++++ net/minecraft/src/ItemFireball.java +@@ -1,50 +1,55 @@ + package net.minecraft.src; + + public class ItemFireball extends Item { +- public ItemFireball(int var1) { +- super(var1); ++ public ItemFireball(int par1) { ++ super(par1); + this.setCreativeTab(CreativeTabs.tabMisc); + } + +- public boolean onItemUse(ItemStack var1, EntityPlayer var2, World var3, int var4, int var5, int var6, int var7, float var8, float var9, float var10) { +- if(var3.isRemote) { ++ /** ++ * Callback for item usage. If the item does something special on right clicking, he will have one of those. Return ++ * True if something happen and false if it don't. This is for ITEMS, not BLOCKS ++ */ ++ public boolean onItemUse(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, World par3World, int par4, int par5, int par6, int par7, float par8, float par9, float par10) { ++ if (par3World.isRemote) { + return true; + } else { +- if(var7 == 0) { +- --var5; +- } +- +- if(var7 == 1) { +- ++var5; +- } +- +- if(var7 == 2) { +- --var6; +- } +- +- if(var7 == 3) { +- ++var6; +- } +- +- if(var7 == 4) { +- --var4; +- } +- +- if(var7 == 5) { +- ++var4; +- } +- +- if(!var2.canPlayerEdit(var4, var5, var6, var7, var1)) { ++ if (par7 == 0) { ++ --par5; ++ } ++ ++ if (par7 == 1) { ++ ++par5; ++ } ++ ++ if (par7 == 2) { ++ --par6; ++ } ++ ++ if (par7 == 3) { ++ ++par6; ++ } ++ ++ if (par7 == 4) { ++ --par4; ++ } ++ ++ if (par7 == 5) { ++ ++par4; ++ } ++ ++ if (!par2EntityPlayer.canPlayerEdit(par4, par5, par6, par7, par1ItemStack)) { + return false; + } else { +- int var11 = var3.getBlockId(var4, var5, var6); +- if(var11 == 0) { +- var3.playSoundEffect((double)var4 + 0.5D, (double)var5 + 0.5D, (double)var6 + 0.5D, "fire.ignite", 1.0F, f.nextFloat() * 0.4F + 0.8F); +- var3.setBlock(var4, var5, var6, Block.fire.blockID); ++ int var11 = par3World.getBlockId(par4, par5, par6); ++ ++ if (var11 == 0) { ++ par3World.playSoundEffect((double)par4 + 0.5D, (double)par5 + 0.5D, (double)par6 + 0.5D, "fire.ignite", 1.0F, itemRand.nextFloat() * 0.4F + 0.8F); ++ par3World.setBlock(par4, par5, par6, Block.fire.blockID); + } + +- if(!var2.capabilities.isCreativeMode) { +- --var1.stackSize; ++ if (!par2EntityPlayer.capabilities.isCreativeMode) { ++ --par1ItemStack.stackSize; + } + + return true; diff --git a/patches/net/minecraft/src/ItemFirework.java.patch b/patches/net/minecraft/src/ItemFirework.java.patch new file mode 100644 index 0000000..10251c0 --- /dev/null +++ b/patches/net/minecraft/src/ItemFirework.java.patch @@ -0,0 +1,80 @@ +--- net/minecraft/src/ItemFirework.java ++++ net/minecraft/src/ItemFirework.java +@@ -4,16 +4,21 @@ + import java.util.List; + + public class ItemFirework extends Item { +- public ItemFirework(int var1) { +- super(var1); ++ public ItemFirework(int par1) { ++ super(par1); + } + +- public boolean onItemUse(ItemStack var1, EntityPlayer var2, World var3, int var4, int var5, int var6, int var7, float var8, float var9, float var10) { +- if(!var3.isRemote) { +- EntityFireworkRocket var11 = new EntityFireworkRocket(var3, (double)((float)var4 + var8), (double)((float)var5 + var9), (double)((float)var6 + var10), var1); +- var3.spawnEntityInWorld(var11); +- if(!var2.capabilities.isCreativeMode) { +- --var1.stackSize; ++ /** ++ * Callback for item usage. If the item does something special on right clicking, he will have one of those. Return ++ * True if something happen and false if it don't. This is for ITEMS, not BLOCKS ++ */ ++ public boolean onItemUse(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, World par3World, int par4, int par5, int par6, int par7, float par8, float par9, float par10) { ++ if (!par3World.isRemote) { ++ EntityFireworkRocket var11 = new EntityFireworkRocket(par3World, (double)((float)par4 + par8), (double)((float)par5 + par9), (double)((float)par6 + par10), par1ItemStack); ++ par3World.spawnEntityInWorld(var11); ++ ++ if (!par2EntityPlayer.capabilities.isCreativeMode) { ++ --par1ItemStack.stackSize; + } + + return true; +@@ -22,30 +27,35 @@ + } + } + +- public void addInformation(ItemStack var1, EntityPlayer var2, List var3, boolean var4) { +- if(var1.hasTagCompound()) { +- NBTTagCompound var5 = var1.getTagCompound().getCompoundTag("Fireworks"); +- if(var5 != null) { +- if(var5.hasKey("Flight")) { +- var3.add(StatCollector.translateToLocal("item.fireworks.flight") + " " + var5.getByte("Flight")); ++ /** ++ * allows items to add custom lines of information to the mouseover description ++ */ ++ public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4) { ++ if (par1ItemStack.hasTagCompound()) { ++ NBTTagCompound var5 = par1ItemStack.getTagCompound().getCompoundTag("Fireworks"); ++ ++ if (var5 != null) { ++ if (var5.hasKey("Flight")) { ++ par3List.add(StatCollector.translateToLocal("item.fireworks.flight") + " " + var5.getByte("Flight")); + } + + NBTTagList var6 = var5.getTagList("Explosions"); +- if(var6 != null && var6.tagCount() > 0) { +- for(int var7 = 0; var7 < var6.tagCount(); ++var7) { ++ ++ if (var6 != null && var6.tagCount() > 0) { ++ for (int var7 = 0; var7 < var6.tagCount(); ++var7) { + NBTTagCompound var8 = (NBTTagCompound)var6.tagAt(var7); + ArrayList var9 = new ArrayList(); + ItemFireworkCharge.func_92107_a(var8, var9); +- if(var9.size() > 0) { +- for(int var10 = 1; var10 < var9.size(); ++var10) { ++ ++ if (var9.size() > 0) { ++ for (int var10 = 1; var10 < var9.size(); ++var10) { + var9.set(var10, " " + (String)var9.get(var10)); + } + +- var3.addAll(var9); ++ par3List.addAll(var9); + } + } + } +- + } + } + } diff --git a/patches/net/minecraft/src/ItemFireworkCharge.java.patch b/patches/net/minecraft/src/ItemFireworkCharge.java.patch new file mode 100644 index 0000000..d2999b7 --- /dev/null +++ b/patches/net/minecraft/src/ItemFireworkCharge.java.patch @@ -0,0 +1,235 @@ +--- net/minecraft/src/ItemFireworkCharge.java ++++ net/minecraft/src/ItemFireworkCharge.java +@@ -5,24 +5,29 @@ + public class ItemFireworkCharge extends Item { + private Icon theIcon; + +- public ItemFireworkCharge(int var1) { +- super(var1); +- } +- +- public Icon getIconFromDamageForRenderPass(int var1, int var2) { +- return var2 > 0 ? this.theIcon : super.getIconFromDamageForRenderPass(var1, var2); +- } +- +- public int getColorFromItemStack(ItemStack var1, int var2) { +- if(var2 != 1) { +- return super.getColorFromItemStack(var1, var2); ++ public ItemFireworkCharge(int par1) { ++ super(par1); ++ } ++ ++ /** ++ * Gets an icon index based on an item's damage value and the given render pass ++ */ ++ public Icon getIconFromDamageForRenderPass(int par1, int par2) { ++ return par2 > 0 ? this.theIcon : super.getIconFromDamageForRenderPass(par1, par2); ++ } ++ ++ public int getColorFromItemStack(ItemStack par1ItemStack, int par2) { ++ if (par2 != 1) { ++ return super.getColorFromItemStack(par1ItemStack, par2); + } else { +- NBTBase var3 = func_92108_a(var1, "Colors"); +- if(var3 == null) { ++ NBTBase var3 = func_92108_a(par1ItemStack, "Colors"); ++ ++ if (var3 == null) { + return 9079434; + } else { + NBTTagIntArray var4 = (NBTTagIntArray)var3; +- if(var4.intArray.length == 1) { ++ ++ if (var4.intArray.length == 1) { + return var4.intArray[0]; + } else { + int var5 = 0; +@@ -31,10 +36,10 @@ + int[] var8 = var4.intArray; + int var9 = var8.length; + +- for(int var10 = 0; var10 < var9; ++var10) { ++ for (int var10 = 0; var10 < var9; ++var10) { + int var11 = var8[var10]; + var5 += (var11 & 16711680) >> 16; +- var6 += (var11 & '\uff00') >> 8; ++ var6 += (var11 & 65280) >> 8; + var7 += (var11 & 255) >> 0; + } + +@@ -51,116 +56,126 @@ + return true; + } + +- public static NBTBase func_92108_a(ItemStack var0, String var1) { +- if(var0.hasTagCompound()) { +- NBTTagCompound var2 = var0.getTagCompound().getCompoundTag("Explosion"); +- if(var2 != null) { +- return var2.getTag(var1); ++ public static NBTBase func_92108_a(ItemStack par0ItemStack, String par1Str) { ++ if (par0ItemStack.hasTagCompound()) { ++ NBTTagCompound var2 = par0ItemStack.getTagCompound().getCompoundTag("Explosion"); ++ ++ if (var2 != null) { ++ return var2.getTag(par1Str); + } + } + + return null; + } + +- public void addInformation(ItemStack var1, EntityPlayer var2, List var3, boolean var4) { +- if(var1.hasTagCompound()) { +- NBTTagCompound var5 = var1.getTagCompound().getCompoundTag("Explosion"); +- if(var5 != null) { +- func_92107_a(var5, var3); ++ /** ++ * allows items to add custom lines of information to the mouseover description ++ */ ++ public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4) { ++ if (par1ItemStack.hasTagCompound()) { ++ NBTTagCompound var5 = par1ItemStack.getTagCompound().getCompoundTag("Explosion"); ++ ++ if (var5 != null) { ++ func_92107_a(var5, par3List); + } + } +- + } + +- public static void func_92107_a(NBTTagCompound var0, List var1) { +- byte var2 = var0.getByte("Type"); +- if(var2 >= 0 && var2 <= 4) { +- var1.add(StatCollector.translateToLocal("item.fireworksCharge.type." + var2).trim()); ++ public static void func_92107_a(NBTTagCompound par0NBTTagCompound, List par1List) { ++ byte var2 = par0NBTTagCompound.getByte("Type"); ++ ++ if (var2 >= 0 && var2 <= 4) { ++ par1List.add(StatCollector.translateToLocal("item.fireworksCharge.type." + var2).trim()); + } else { +- var1.add(StatCollector.translateToLocal("item.fireworksCharge.type").trim()); ++ par1List.add(StatCollector.translateToLocal("item.fireworksCharge.type").trim()); + } + +- int[] var3 = var0.getIntArray("Colors"); ++ int[] var3 = par0NBTTagCompound.getIntArray("Colors"); + int var8; + int var9; +- if(var3.length > 0) { ++ ++ if (var3.length > 0) { + boolean var4 = true; + String var5 = ""; + int[] var6 = var3; + int var7 = var3.length; + +- for(var8 = 0; var8 < var7; ++var8) { ++ for (var8 = 0; var8 < var7; ++var8) { + var9 = var6[var8]; +- if(!var4) { ++ ++ if (!var4) { + var5 = var5 + ", "; + } + + var4 = false; + boolean var10 = false; + +- for(int var11 = 0; var11 < 16; ++var11) { +- if(var9 == ItemDye.dyeColors[var11]) { ++ for (int var11 = 0; var11 < 16; ++var11) { ++ if (var9 == ItemDye.dyeColors[var11]) { + var10 = true; +- var5 = var5 + StatCollector.translateToLocal("item.fireworksCharge." + ItemDye.a[var11]); ++ var5 = var5 + StatCollector.translateToLocal("item.fireworksCharge." + ItemDye.dyeColorNames[var11]); + break; + } + } + +- if(!var10) { ++ if (!var10) { + var5 = var5 + StatCollector.translateToLocal("item.fireworksCharge.customColor"); + } + } + +- var1.add(var5); ++ par1List.add(var5); + } + +- int[] var13 = var0.getIntArray("FadeColors"); ++ int[] var13 = par0NBTTagCompound.getIntArray("FadeColors"); + boolean var15; +- if(var13.length > 0) { ++ ++ if (var13.length > 0) { + var15 = true; + String var14 = StatCollector.translateToLocal("item.fireworksCharge.fadeTo") + " "; + int[] var16 = var13; + var8 = var13.length; + +- for(var9 = 0; var9 < var8; ++var9) { ++ for (var9 = 0; var9 < var8; ++var9) { + int var18 = var16[var9]; +- if(!var15) { ++ ++ if (!var15) { + var14 = var14 + ", "; + } + + var15 = false; + boolean var19 = false; + +- for(int var12 = 0; var12 < 16; ++var12) { +- if(var18 == ItemDye.dyeColors[var12]) { ++ for (int var12 = 0; var12 < 16; ++var12) { ++ if (var18 == ItemDye.dyeColors[var12]) { + var19 = true; +- var14 = var14 + StatCollector.translateToLocal("item.fireworksCharge." + ItemDye.a[var12]); ++ var14 = var14 + StatCollector.translateToLocal("item.fireworksCharge." + ItemDye.dyeColorNames[var12]); + break; + } + } + +- if(!var19) { ++ if (!var19) { + var14 = var14 + StatCollector.translateToLocal("item.fireworksCharge.customColor"); + } + } + +- var1.add(var14); +- } +- +- var15 = var0.getBoolean("Trail"); +- if(var15) { +- var1.add(StatCollector.translateToLocal("item.fireworksCharge.trail")); +- } +- +- boolean var17 = var0.getBoolean("Flicker"); +- if(var17) { +- var1.add(StatCollector.translateToLocal("item.fireworksCharge.flicker")); +- } +- ++ par1List.add(var14); ++ } ++ ++ var15 = par0NBTTagCompound.getBoolean("Trail"); ++ ++ if (var15) { ++ par1List.add(StatCollector.translateToLocal("item.fireworksCharge.trail")); ++ } ++ ++ boolean var17 = par0NBTTagCompound.getBoolean("Flicker"); ++ ++ if (var17) { ++ par1List.add(StatCollector.translateToLocal("item.fireworksCharge.flicker")); ++ } + } + +- public void registerIcons(IconRegister var1) { +- super.registerIcons(var1); +- this.theIcon = var1.registerIcon(this.getIconString() + "_overlay"); ++ public void registerIcons(IconRegister par1IconRegister) { ++ super.registerIcons(par1IconRegister); ++ this.theIcon = par1IconRegister.registerIcon(this.getIconString() + "_overlay"); + } + } diff --git a/patches/net/minecraft/src/ItemFishingRod.java.patch b/patches/net/minecraft/src/ItemFishingRod.java.patch new file mode 100644 index 0000000..5cc2b74 --- /dev/null +++ b/patches/net/minecraft/src/ItemFishingRod.java.patch @@ -0,0 +1,69 @@ +--- net/minecraft/src/ItemFishingRod.java ++++ net/minecraft/src/ItemFishingRod.java +@@ -3,41 +3,51 @@ + public class ItemFishingRod extends Item { + private Icon theIcon; + +- public ItemFishingRod(int var1) { +- super(var1); ++ public ItemFishingRod(int par1) { ++ super(par1); + this.setMaxDamage(64); + this.setMaxStackSize(1); + this.setCreativeTab(CreativeTabs.tabTools); + } + ++ /** ++ * Returns True is the item is renderer in full 3D when hold. ++ */ + public boolean isFull3D() { + return true; + } + ++ /** ++ * Returns true if this item should be rotated by 180 degrees around the Y axis when being held in an entities hands. ++ */ + public boolean shouldRotateAroundWhenRendering() { + return true; + } + +- public ItemStack onItemRightClick(ItemStack var1, World var2, EntityPlayer var3) { +- if(var3.fishEntity != null) { +- int var4 = var3.fishEntity.catchFish(); +- var1.damageItem(var4, var3); +- var3.swingItem(); ++ /** ++ * Called whenever this item is equipped and the right mouse button is pressed. Args: itemStack, world, entityPlayer ++ */ ++ public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) { ++ if (par3EntityPlayer.fishEntity != null) { ++ int var4 = par3EntityPlayer.fishEntity.catchFish(); ++ par1ItemStack.damageItem(var4, par3EntityPlayer); ++ par3EntityPlayer.swingItem(); + } else { +- var2.playSoundAtEntity(var3, "random.bow", 0.5F, 0.4F / (f.nextFloat() * 0.4F + 0.8F)); +- if(!var2.isRemote) { +- var2.spawnEntityInWorld(new EntityFishHook(var2, var3)); ++ par2World.playSoundAtEntity(par3EntityPlayer, "random.bow", 0.5F, 0.4F / (itemRand.nextFloat() * 0.4F + 0.8F)); ++ ++ if (!par2World.isRemote) { ++ par2World.spawnEntityInWorld(new EntityFishHook(par2World, par3EntityPlayer)); + } + +- var3.swingItem(); ++ par3EntityPlayer.swingItem(); + } + +- return var1; ++ return par1ItemStack; + } + +- public void registerIcons(IconRegister var1) { +- this.itemIcon = var1.registerIcon(this.getIconString() + "_uncast"); +- this.theIcon = var1.registerIcon(this.getIconString() + "_cast"); ++ public void registerIcons(IconRegister par1IconRegister) { ++ this.itemIcon = par1IconRegister.registerIcon(this.getIconString() + "_uncast"); ++ this.theIcon = par1IconRegister.registerIcon(this.getIconString() + "_cast"); + } + + public Icon func_94597_g() { diff --git a/patches/net/minecraft/src/ItemFlintAndSteel.java.patch b/patches/net/minecraft/src/ItemFlintAndSteel.java.patch new file mode 100644 index 0000000..cbe5302 --- /dev/null +++ b/patches/net/minecraft/src/ItemFlintAndSteel.java.patch @@ -0,0 +1,89 @@ +--- net/minecraft/src/ItemFlintAndSteel.java ++++ net/minecraft/src/ItemFlintAndSteel.java +@@ -1,48 +1,53 @@ + package net.minecraft.src; + + public class ItemFlintAndSteel extends Item { +- public ItemFlintAndSteel(int var1) { +- super(var1); ++ public ItemFlintAndSteel(int par1) { ++ super(par1); + this.maxStackSize = 1; + this.setMaxDamage(64); + this.setCreativeTab(CreativeTabs.tabTools); + } + +- public boolean onItemUse(ItemStack var1, EntityPlayer var2, World var3, int var4, int var5, int var6, int var7, float var8, float var9, float var10) { +- if(var7 == 0) { +- --var5; +- } +- +- if(var7 == 1) { +- ++var5; +- } +- +- if(var7 == 2) { +- --var6; +- } +- +- if(var7 == 3) { +- ++var6; +- } +- +- if(var7 == 4) { +- --var4; +- } +- +- if(var7 == 5) { +- ++var4; +- } +- +- if(!var2.canPlayerEdit(var4, var5, var6, var7, var1)) { ++ /** ++ * Callback for item usage. If the item does something special on right clicking, he will have one of those. Return ++ * True if something happen and false if it don't. This is for ITEMS, not BLOCKS ++ */ ++ public boolean onItemUse(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, World par3World, int par4, int par5, int par6, int par7, float par8, float par9, float par10) { ++ if (par7 == 0) { ++ --par5; ++ } ++ ++ if (par7 == 1) { ++ ++par5; ++ } ++ ++ if (par7 == 2) { ++ --par6; ++ } ++ ++ if (par7 == 3) { ++ ++par6; ++ } ++ ++ if (par7 == 4) { ++ --par4; ++ } ++ ++ if (par7 == 5) { ++ ++par4; ++ } ++ ++ if (!par2EntityPlayer.canPlayerEdit(par4, par5, par6, par7, par1ItemStack)) { + return false; + } else { +- int var11 = var3.getBlockId(var4, var5, var6); +- if(var11 == 0) { +- var3.playSoundEffect((double)var4 + 0.5D, (double)var5 + 0.5D, (double)var6 + 0.5D, "fire.ignite", 1.0F, f.nextFloat() * 0.4F + 0.8F); +- var3.setBlock(var4, var5, var6, Block.fire.blockID); ++ int var11 = par3World.getBlockId(par4, par5, par6); ++ ++ if (var11 == 0) { ++ par3World.playSoundEffect((double)par4 + 0.5D, (double)par5 + 0.5D, (double)par6 + 0.5D, "fire.ignite", 1.0F, itemRand.nextFloat() * 0.4F + 0.8F); ++ par3World.setBlock(par4, par5, par6, Block.fire.blockID); + } + +- var1.damageItem(1, var2); ++ par1ItemStack.damageItem(1, par2EntityPlayer); + return true; + } + } diff --git a/patches/net/minecraft/src/ItemFood.java.patch b/patches/net/minecraft/src/ItemFood.java.patch new file mode 100644 index 0000000..a7bed79 --- /dev/null +++ b/patches/net/minecraft/src/ItemFood.java.patch @@ -0,0 +1,156 @@ +--- net/minecraft/src/ItemFood.java ++++ net/minecraft/src/ItemFood.java +@@ -1,80 +1,121 @@ + package net.minecraft.src; + + public class ItemFood extends Item { ++ ++ /** Number of ticks to run while 'EnumAction'ing until result. */ + public final int itemUseDuration; ++ ++ /** The amount this food item heals the player. */ + private final int healAmount; + private final float saturationModifier; ++ ++ /** Whether wolves like this food (true for raw and cooked porkchop). */ + private final boolean isWolfsFavoriteMeat; ++ ++ /** ++ * If this field is true, the food can be consumed even if the player don't need to eat. ++ */ + private boolean alwaysEdible; ++ ++ /** ++ * represents the potion effect that will occurr upon eating this food. Set by setPotionEffect ++ */ + private int potionId; ++ ++ /** set by setPotionEffect */ + private int potionDuration; ++ ++ /** set by setPotionEffect */ + private int potionAmplifier; ++ ++ /** probably of the set potion effect occurring */ + private float potionEffectProbability; + +- public ItemFood(int var1, int var2, float var3, boolean var4) { +- super(var1); ++ public ItemFood(int par1, int par2, float par3, boolean par4) { ++ super(par1); + this.itemUseDuration = 32; +- this.healAmount = var2; +- this.isWolfsFavoriteMeat = var4; +- this.saturationModifier = var3; ++ this.healAmount = par2; ++ this.isWolfsFavoriteMeat = par4; ++ this.saturationModifier = par3; + this.setCreativeTab(CreativeTabs.tabFood); + } + +- public ItemFood(int var1, int var2, boolean var3) { +- this(var1, var2, 0.6F, var3); +- } +- +- public ItemStack onEaten(ItemStack var1, World var2, EntityPlayer var3) { +- --var1.stackSize; +- var3.getFoodStats().addStats(this); +- var2.playSoundAtEntity(var3, "random.burp", 0.5F, var2.s.nextFloat() * 0.1F + 0.9F); +- this.onFoodEaten(var1, var2, var3); +- return var1; +- } +- +- protected void onFoodEaten(ItemStack var1, World var2, EntityPlayer var3) { +- if(!var2.isRemote && this.potionId > 0 && var2.s.nextFloat() < this.potionEffectProbability) { +- var3.addPotionEffect(new PotionEffect(this.potionId, this.potionDuration * 20, this.potionAmplifier)); ++ public ItemFood(int par1, int par2, boolean par3) { ++ this(par1, par2, 0.6F, par3); ++ } ++ ++ public ItemStack onEaten(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) { ++ --par1ItemStack.stackSize; ++ par3EntityPlayer.getFoodStats().addStats(this); ++ par2World.playSoundAtEntity(par3EntityPlayer, "random.burp", 0.5F, par2World.rand.nextFloat() * 0.1F + 0.9F); ++ this.onFoodEaten(par1ItemStack, par2World, par3EntityPlayer); ++ return par1ItemStack; ++ } ++ ++ protected void onFoodEaten(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) { ++ if (!par2World.isRemote && this.potionId > 0 && par2World.rand.nextFloat() < this.potionEffectProbability) { ++ par3EntityPlayer.addPotionEffect(new PotionEffect(this.potionId, this.potionDuration * 20, this.potionAmplifier)); + } +- + } + +- public int getMaxItemUseDuration(ItemStack var1) { ++ /** ++ * How long it takes to use or consume an item ++ */ ++ public int getMaxItemUseDuration(ItemStack par1ItemStack) { + return 32; + } + +- public EnumAction getItemUseAction(ItemStack var1) { ++ /** ++ * returns the action that specifies what animation to play when the items is being used ++ */ ++ public EnumAction getItemUseAction(ItemStack par1ItemStack) { + return EnumAction.eat; + } + +- public ItemStack onItemRightClick(ItemStack var1, World var2, EntityPlayer var3) { +- if(var3.canEat(this.alwaysEdible)) { +- var3.setItemInUse(var1, this.getMaxItemUseDuration(var1)); ++ /** ++ * Called whenever this item is equipped and the right mouse button is pressed. Args: itemStack, world, entityPlayer ++ */ ++ public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) { ++ if (par3EntityPlayer.canEat(this.alwaysEdible)) { ++ par3EntityPlayer.setItemInUse(par1ItemStack, this.getMaxItemUseDuration(par1ItemStack)); + } + +- return var1; ++ return par1ItemStack; + } + + public int getHealAmount() { + return this.healAmount; + } + ++ /** ++ * gets the saturationModifier of the ItemFood ++ */ + public float getSaturationModifier() { + return this.saturationModifier; + } + ++ /** ++ * Whether wolves like this food (true for raw and cooked porkchop). ++ */ + public boolean isWolfsFavoriteMeat() { + return this.isWolfsFavoriteMeat; + } + +- public ItemFood setPotionEffect(int var1, int var2, int var3, float var4) { +- this.potionId = var1; +- this.potionDuration = var2; +- this.potionAmplifier = var3; +- this.potionEffectProbability = var4; ++ /** ++ * sets a potion effect on the item. Args: int potionId, int duration (will be multiplied by 20), int amplifier, float ++ * probability of effect happening ++ */ ++ public ItemFood setPotionEffect(int par1, int par2, int par3, float par4) { ++ this.potionId = par1; ++ this.potionDuration = par2; ++ this.potionAmplifier = par3; ++ this.potionEffectProbability = par4; + return this; + } + ++ /** ++ * Set the field 'alwaysEdible' to true, and make the food edible even if the player don't need to eat. ++ */ + public ItemFood setAlwaysEdible() { + this.alwaysEdible = true; + return this; diff --git a/patches/net/minecraft/src/ItemGlassBottle.java.patch b/patches/net/minecraft/src/ItemGlassBottle.java.patch new file mode 100644 index 0000000..59ee6bf --- /dev/null +++ b/patches/net/minecraft/src/ItemGlassBottle.java.patch @@ -0,0 +1,83 @@ +--- net/minecraft/src/ItemGlassBottle.java ++++ net/minecraft/src/ItemGlassBottle.java +@@ -1,48 +1,56 @@ + package net.minecraft.src; + + public class ItemGlassBottle extends Item { +- public ItemGlassBottle(int var1) { +- super(var1); ++ public ItemGlassBottle(int par1) { ++ super(par1); + this.setCreativeTab(CreativeTabs.tabBrewing); + } + +- public Icon getIconFromDamage(int var1) { ++ /** ++ * Gets an icon index based on an item's damage value ++ */ ++ public Icon getIconFromDamage(int par1) { + return Item.potion.getIconFromDamage(0); + } + +- public ItemStack onItemRightClick(ItemStack var1, World var2, EntityPlayer var3) { +- MovingObjectPosition var4 = this.getMovingObjectPositionFromPlayer(var2, var3, true); +- if(var4 == null) { +- return var1; ++ /** ++ * Called whenever this item is equipped and the right mouse button is pressed. Args: itemStack, world, entityPlayer ++ */ ++ public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) { ++ MovingObjectPosition var4 = this.getMovingObjectPositionFromPlayer(par2World, par3EntityPlayer, true); ++ ++ if (var4 == null) { ++ return par1ItemStack; + } else { +- if(var4.typeOfHit == EnumMovingObjectType.TILE) { ++ if (var4.typeOfHit == EnumMovingObjectType.TILE) { + int var5 = var4.blockX; + int var6 = var4.blockY; + int var7 = var4.blockZ; +- if(!var2.canMineBlock(var3, var5, var6, var7)) { +- return var1; +- } +- +- if(!var3.canPlayerEdit(var5, var6, var7, var4.sideHit, var1)) { +- return var1; +- } +- +- if(var2.getBlockMaterial(var5, var6, var7) == Material.water) { +- --var1.stackSize; +- if(var1.stackSize <= 0) { ++ ++ if (!par2World.canMineBlock(par3EntityPlayer, var5, var6, var7)) { ++ return par1ItemStack; ++ } ++ ++ if (!par3EntityPlayer.canPlayerEdit(var5, var6, var7, var4.sideHit, par1ItemStack)) { ++ return par1ItemStack; ++ } ++ ++ if (par2World.getBlockMaterial(var5, var6, var7) == Material.water) { ++ --par1ItemStack.stackSize; ++ ++ if (par1ItemStack.stackSize <= 0) { + return new ItemStack(Item.potion); + } + +- if(!var3.inventory.addItemStackToInventory(new ItemStack(Item.potion))) { +- var3.dropPlayerItem(new ItemStack(Item.potion.itemID, 1, 0)); ++ if (!par3EntityPlayer.inventory.addItemStackToInventory(new ItemStack(Item.potion))) { ++ par3EntityPlayer.dropPlayerItem(new ItemStack(Item.potion.itemID, 1, 0)); + } + } + } + +- return var1; ++ return par1ItemStack; + } + } + +- public void registerIcons(IconRegister var1) { +- } ++ public void registerIcons(IconRegister par1IconRegister) {} + } diff --git a/patches/net/minecraft/src/ItemHangingEntity.java.patch b/patches/net/minecraft/src/ItemHangingEntity.java.patch new file mode 100644 index 0000000..f9b97eb --- /dev/null +++ b/patches/net/minecraft/src/ItemHangingEntity.java.patch @@ -0,0 +1,66 @@ +--- net/minecraft/src/ItemHangingEntity.java ++++ net/minecraft/src/ItemHangingEntity.java +@@ -1,31 +1,36 @@ + package net.minecraft.src; + + public class ItemHangingEntity extends Item { +- private final Class a; ++ private final Class hangingEntityClass; + +- public ItemHangingEntity(int var1, Class var2) { +- super(var1); +- this.a = var2; ++ public ItemHangingEntity(int par1, Class par2Class) { ++ super(par1); ++ this.hangingEntityClass = par2Class; + this.setCreativeTab(CreativeTabs.tabDecorations); + } + +- public boolean onItemUse(ItemStack var1, EntityPlayer var2, World var3, int var4, int var5, int var6, int var7, float var8, float var9, float var10) { +- if(var7 == 0) { ++ /** ++ * Callback for item usage. If the item does something special on right clicking, he will have one of those. Return ++ * True if something happen and false if it don't. This is for ITEMS, not BLOCKS ++ */ ++ public boolean onItemUse(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, World par3World, int par4, int par5, int par6, int par7, float par8, float par9, float par10) { ++ if (par7 == 0) { + return false; +- } else if(var7 == 1) { ++ } else if (par7 == 1) { + return false; + } else { +- int var11 = Direction.facingToDirection[var7]; +- EntityHanging var12 = this.createHangingEntity(var3, var4, var5, var6, var11); +- if(!var2.canPlayerEdit(var4, var5, var6, var7, var1)) { ++ int var11 = Direction.facingToDirection[par7]; ++ EntityHanging var12 = this.createHangingEntity(par3World, par4, par5, par6, var11); ++ ++ if (!par2EntityPlayer.canPlayerEdit(par4, par5, par6, par7, par1ItemStack)) { + return false; + } else { +- if(var12 != null && var12.onValidSurface()) { +- if(!var3.isRemote) { +- var3.spawnEntityInWorld(var12); ++ if (var12 != null && var12.onValidSurface()) { ++ if (!par3World.isRemote) { ++ par3World.spawnEntityInWorld(var12); + } + +- --var1.stackSize; ++ --par1ItemStack.stackSize; + } + + return true; +@@ -33,7 +38,10 @@ + } + } + +- private EntityHanging createHangingEntity(World var1, int var2, int var3, int var4, int var5) { +- return (EntityHanging)(this.a == EntityPainting.class ? new EntityPainting(var1, var2, var3, var4, var5) : (this.a == EntityItemFrame.class ? new EntityItemFrame(var1, var2, var3, var4, var5) : null)); ++ /** ++ * Create the hanging entity associated to this item. ++ */ ++ private EntityHanging createHangingEntity(World par1World, int par2, int par3, int par4, int par5) { ++ return (EntityHanging)(this.hangingEntityClass == EntityPainting.class ? new EntityPainting(par1World, par2, par3, par4, par5) : (this.hangingEntityClass == EntityItemFrame.class ? new EntityItemFrame(par1World, par2, par3, par4, par5) : null)); + } + } diff --git a/patches/net/minecraft/src/ItemHoe.java.patch b/patches/net/minecraft/src/ItemHoe.java.patch new file mode 100644 index 0000000..be4389a --- /dev/null +++ b/patches/net/minecraft/src/ItemHoe.java.patch @@ -0,0 +1,68 @@ +--- net/minecraft/src/ItemHoe.java ++++ net/minecraft/src/ItemHoe.java +@@ -3,28 +3,34 @@ + public class ItemHoe extends Item { + protected EnumToolMaterial theToolMaterial; + +- public ItemHoe(int var1, EnumToolMaterial var2) { +- super(var1); +- this.theToolMaterial = var2; ++ public ItemHoe(int par1, EnumToolMaterial par2EnumToolMaterial) { ++ super(par1); ++ this.theToolMaterial = par2EnumToolMaterial; + this.maxStackSize = 1; +- this.setMaxDamage(var2.getMaxUses()); ++ this.setMaxDamage(par2EnumToolMaterial.getMaxUses()); + this.setCreativeTab(CreativeTabs.tabTools); + } + +- public boolean onItemUse(ItemStack var1, EntityPlayer var2, World var3, int var4, int var5, int var6, int var7, float var8, float var9, float var10) { +- if(!var2.canPlayerEdit(var4, var5, var6, var7, var1)) { ++ /** ++ * Callback for item usage. If the item does something special on right clicking, he will have one of those. Return ++ * True if something happen and false if it don't. This is for ITEMS, not BLOCKS ++ */ ++ public boolean onItemUse(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, World par3World, int par4, int par5, int par6, int par7, float par8, float par9, float par10) { ++ if (!par2EntityPlayer.canPlayerEdit(par4, par5, par6, par7, par1ItemStack)) { + return false; + } else { +- int var11 = var3.getBlockId(var4, var5, var6); +- int var12 = var3.getBlockId(var4, var5 + 1, var6); +- if(var7 != 0 && var12 == 0 && (var11 == Block.grass.blockID || var11 == Block.dirt.blockID)) { ++ int var11 = par3World.getBlockId(par4, par5, par6); ++ int var12 = par3World.getBlockId(par4, par5 + 1, par6); ++ ++ if (par7 != 0 && var12 == 0 && (var11 == Block.grass.blockID || var11 == Block.dirt.blockID)) { + Block var13 = Block.tilledField; +- var3.playSoundEffect((double)((float)var4 + 0.5F), (double)((float)var5 + 0.5F), (double)((float)var6 + 0.5F), var13.stepSound.getStepSound(), (var13.stepSound.getVolume() + 1.0F) / 2.0F, var13.stepSound.getPitch() * 0.8F); +- if(var3.isRemote) { ++ par3World.playSoundEffect((double)((float)par4 + 0.5F), (double)((float)par5 + 0.5F), (double)((float)par6 + 0.5F), var13.stepSound.getStepSound(), (var13.stepSound.getVolume() + 1.0F) / 2.0F, var13.stepSound.getPitch() * 0.8F); ++ ++ if (par3World.isRemote) { + return true; + } else { +- var3.setBlock(var4, var5, var6, var13.blockID); +- var1.damageItem(1, var2); ++ par3World.setBlock(par4, par5, par6, var13.blockID); ++ par1ItemStack.damageItem(1, par2EntityPlayer); + return true; + } + } else { +@@ -33,10 +39,17 @@ + } + } + ++ /** ++ * Returns True is the item is renderer in full 3D when hold. ++ */ + public boolean isFull3D() { + return true; + } + ++ /** ++ * Returns the name of the material this tool is made from as it is declared in EnumToolMaterial (meaning diamond would ++ * return "EMERALD") ++ */ + public String getMaterialName() { + return this.theToolMaterial.toString(); + } diff --git a/patches/net/minecraft/src/ItemInWorldManager.java.patch b/patches/net/minecraft/src/ItemInWorldManager.java.patch new file mode 100644 index 0000000..7880444 --- /dev/null +++ b/patches/net/minecraft/src/ItemInWorldManager.java.patch @@ -0,0 +1,432 @@ +--- net/minecraft/src/ItemInWorldManager.java ++++ net/minecraft/src/ItemInWorldManager.java +@@ -1,29 +1,42 @@ + package net.minecraft.src; + + public class ItemInWorldManager { ++ ++ /** The world object that this object is connected to. */ + public World theWorld; ++ ++ /** The EntityPlayerMP object that this object is connected to. */ + public EntityPlayerMP thisPlayerMP; +- private EnumGameType gameType = EnumGameType.NOT_SET; ++ private EnumGameType gameType; ++ ++ /** True if the player is destroying a block */ + private boolean isDestroyingBlock; + private int initialDamage; +- private int curBlockX; +- private int curBlockY; +- private int curBlockZ; ++ private int partiallyDestroyedBlockX; ++ private int partiallyDestroyedBlockY; ++ private int partiallyDestroyedBlockZ; + private int curblockDamage; ++ ++ /** ++ * Set to true when the "finished destroying block" packet is received but the block wasn't fully damaged yet. The ++ * block will not be destroyed while this is false. ++ */ + private boolean receivedFinishDiggingPacket; + private int posX; + private int posY; + private int posZ; + private int field_73093_n; +- private int durabilityRemainingOnBlock = -1; ++ private int durabilityRemainingOnBlock; + +- public ItemInWorldManager(World var1) { +- this.theWorld = var1; ++ public ItemInWorldManager(World par1World) { ++ this.gameType = EnumGameType.NOT_SET; ++ this.durabilityRemainingOnBlock = -1; ++ this.theWorld = par1World; + } + +- public void setGameType(EnumGameType var1) { +- this.gameType = var1; +- var1.configurePlayerCapabilities(this.thisPlayerMP.capabilities); ++ public void setGameType(EnumGameType par1EnumGameType) { ++ this.gameType = par1EnumGameType; ++ par1EnumGameType.configurePlayerCapabilities(this.thisPlayerMP.capabilities); + this.thisPlayerMP.sendPlayerAbilities(); + } + +@@ -31,13 +44,19 @@ + return this.gameType; + } + ++ /** ++ * Get if we are in creative game mode. ++ */ + public boolean isCreative() { + return this.gameType.isCreative(); + } + +- public void initializeGameType(EnumGameType var1) { +- if(this.gameType == EnumGameType.NOT_SET) { +- this.gameType = var1; ++ /** ++ * if the gameType is currently NOT_SET then change it to par1 ++ */ ++ public void initializeGameType(EnumGameType par1EnumGameType) { ++ if (this.gameType == EnumGameType.NOT_SET) { ++ this.gameType = par1EnumGameType; + } + + this.setGameType(this.gameType); +@@ -48,146 +67,182 @@ + int var1; + float var4; + int var5; +- if(this.receivedFinishDiggingPacket) { ++ ++ if (this.receivedFinishDiggingPacket) { + var1 = this.curblockDamage - this.field_73093_n; + int var2 = this.theWorld.getBlockId(this.posX, this.posY, this.posZ); +- if(var2 == 0) { ++ ++ if (var2 == 0) { + this.receivedFinishDiggingPacket = false; + } else { + Block var3 = Block.blocksList[var2]; +- var4 = var3.getPlayerRelativeBlockHardness(this.thisPlayerMP, this.thisPlayerMP.worldObj, this.posX, this.posY, this.posZ) * (float)(var1 + 1); ++ // Spout Start ++ var4 = var3.getPlayerRelativeBlockHardness(this.thisPlayerMP) * (float)(var1 + 1); ++ // Spout End + var5 = (int)(var4 * 10.0F); +- if(var5 != this.durabilityRemainingOnBlock) { ++ ++ if (var5 != this.durabilityRemainingOnBlock) { + this.theWorld.destroyBlockInWorldPartially(this.thisPlayerMP.entityId, this.posX, this.posY, this.posZ, var5); + this.durabilityRemainingOnBlock = var5; + } + +- if(var4 >= 1.0F) { ++ if (var4 >= 1.0F) { + this.receivedFinishDiggingPacket = false; + this.tryHarvestBlock(this.posX, this.posY, this.posZ); + } + } +- } else if(this.isDestroyingBlock) { +- var1 = this.theWorld.getBlockId(this.curBlockX, this.curBlockY, this.curBlockZ); ++ } else if (this.isDestroyingBlock) { ++ var1 = this.theWorld.getBlockId(this.partiallyDestroyedBlockX, this.partiallyDestroyedBlockY, this.partiallyDestroyedBlockZ); + Block var6 = Block.blocksList[var1]; +- if(var6 == null) { +- this.theWorld.destroyBlockInWorldPartially(this.thisPlayerMP.entityId, this.curBlockX, this.curBlockY, this.curBlockZ, -1); ++ ++ if (var6 == null) { ++ this.theWorld.destroyBlockInWorldPartially(this.thisPlayerMP.entityId, this.partiallyDestroyedBlockX, this.partiallyDestroyedBlockY, this.partiallyDestroyedBlockZ, -1); + this.durabilityRemainingOnBlock = -1; + this.isDestroyingBlock = false; + } else { + int var7 = this.curblockDamage - this.initialDamage; +- var4 = var6.getPlayerRelativeBlockHardness(this.thisPlayerMP, this.thisPlayerMP.worldObj, this.curBlockX, this.curBlockY, this.curBlockZ) * (float)(var7 + 1); ++ // Spout Start ++ var4 = var6.getPlayerRelativeBlockHardness(this.thisPlayerMP) * (float)(var7 + 1); ++ // Spout End + var5 = (int)(var4 * 10.0F); +- if(var5 != this.durabilityRemainingOnBlock) { +- this.theWorld.destroyBlockInWorldPartially(this.thisPlayerMP.entityId, this.curBlockX, this.curBlockY, this.curBlockZ, var5); ++ ++ if (var5 != this.durabilityRemainingOnBlock) { ++ this.theWorld.destroyBlockInWorldPartially(this.thisPlayerMP.entityId, this.partiallyDestroyedBlockX, this.partiallyDestroyedBlockY, this.partiallyDestroyedBlockZ, var5); + this.durabilityRemainingOnBlock = var5; + } + } + } +- + } + +- public void onBlockClicked(int var1, int var2, int var3, int var4) { +- if(!this.gameType.isAdventure() || this.thisPlayerMP.isCurrentToolAdventureModeExempt(var1, var2, var3)) { +- if(this.isCreative()) { +- if(!this.theWorld.extinguishFire((EntityPlayer)null, var1, var2, var3, var4)) { +- this.tryHarvestBlock(var1, var2, var3); ++ /** ++ * if not creative, it calls destroyBlockInWorldPartially untill the block is broken first. par4 is the specific side. ++ * tryHarvestBlock can also be the result of this call ++ */ ++ public void onBlockClicked(int par1, int par2, int par3, int par4) { ++ if (!this.gameType.isAdventure() || this.thisPlayerMP.isCurrentToolAdventureModeExempt(par1, par2, par3)) { ++ if (this.isCreative()) { ++ if (!this.theWorld.extinguishFire((EntityPlayer)null, par1, par2, par3, par4)) { ++ this.tryHarvestBlock(par1, par2, par3); + } +- + } else { +- this.theWorld.extinguishFire((EntityPlayer)null, var1, var2, var3, var4); ++ this.theWorld.extinguishFire((EntityPlayer)null, par1, par2, par3, par4); + this.initialDamage = this.curblockDamage; + float var5 = 1.0F; +- int var6 = this.theWorld.getBlockId(var1, var2, var3); +- if(var6 > 0) { +- Block.blocksList[var6].onBlockClicked(this.theWorld, var1, var2, var3, this.thisPlayerMP); +- var5 = Block.blocksList[var6].getPlayerRelativeBlockHardness(this.thisPlayerMP, this.thisPlayerMP.worldObj, var1, var2, var3); ++ int var6 = this.theWorld.getBlockId(par1, par2, par3); ++ ++ if (var6 > 0) { ++ Block.blocksList[var6].onBlockClicked(this.theWorld, par1, par2, par3, this.thisPlayerMP); ++ // Spout Start ++ var5 = Block.blocksList[var6].getPlayerRelativeBlockHardness(this.thisPlayerMP); ++ // Spout End + } + +- if(var6 > 0 && var5 >= 1.0F) { +- this.tryHarvestBlock(var1, var2, var3); ++ if (var6 > 0 && var5 >= 1.0F) { ++ this.tryHarvestBlock(par1, par2, par3); + } else { + this.isDestroyingBlock = true; +- this.curBlockX = var1; +- this.curBlockY = var2; +- this.curBlockZ = var3; ++ this.partiallyDestroyedBlockX = par1; ++ this.partiallyDestroyedBlockY = par2; ++ this.partiallyDestroyedBlockZ = par3; + int var7 = (int)(var5 * 10.0F); +- this.theWorld.destroyBlockInWorldPartially(this.thisPlayerMP.entityId, var1, var2, var3, var7); ++ this.theWorld.destroyBlockInWorldPartially(this.thisPlayerMP.entityId, par1, par2, par3, var7); + this.durabilityRemainingOnBlock = var7; + } +- + } + } + } + +- public void blockRemoving(int var1, int var2, int var3) { +- if(var1 == this.curBlockX && var2 == this.curBlockY && var3 == this.curBlockZ) { ++ public void uncheckedTryHarvestBlock(int par1, int par2, int par3) { ++ if (par1 == this.partiallyDestroyedBlockX && par2 == this.partiallyDestroyedBlockY && par3 == this.partiallyDestroyedBlockZ) { + int var4 = this.curblockDamage - this.initialDamage; +- int var5 = this.theWorld.getBlockId(var1, var2, var3); +- if(var5 != 0) { ++ int var5 = this.theWorld.getBlockId(par1, par2, par3); ++ ++ if (var5 != 0) { + Block var6 = Block.blocksList[var5]; +- float var7 = var6.getPlayerRelativeBlockHardness(this.thisPlayerMP, this.thisPlayerMP.worldObj, var1, var2, var3) * (float)(var4 + 1); +- if(var7 >= 0.7F) { ++ // Spout Start ++ float var7 = var6.getPlayerRelativeBlockHardness(this.thisPlayerMP) * (float)(var4 + 1); ++ // Spout End ++ ++ if (var7 >= 0.7F) { + this.isDestroyingBlock = false; +- this.theWorld.destroyBlockInWorldPartially(this.thisPlayerMP.entityId, var1, var2, var3, -1); +- this.tryHarvestBlock(var1, var2, var3); +- } else if(!this.receivedFinishDiggingPacket) { ++ this.theWorld.destroyBlockInWorldPartially(this.thisPlayerMP.entityId, par1, par2, par3, -1); ++ this.tryHarvestBlock(par1, par2, par3); ++ } else if (!this.receivedFinishDiggingPacket) { + this.isDestroyingBlock = false; + this.receivedFinishDiggingPacket = true; +- this.posX = var1; +- this.posY = var2; +- this.posZ = var3; ++ this.posX = par1; ++ this.posY = par2; ++ this.posZ = par3; + this.field_73093_n = this.initialDamage; + } + } + } +- +- } +- +- public void cancelDestroyingBlock(int var1, int var2, int var3) { ++ } ++ ++ // Spout Start - Hack for MCP field mapping changes ++ public void destroyBlockInWorldPartially(int var1, int var2, int var3) { ++ cancelDestroyingBlock(var1, var2, var3); ++ } ++ // Spout End ++ ++ /** ++ * note: this ignores the pars passed in and continues to destroy the onClickedBlock ++ */ ++ public void cancelDestroyingBlock(int par1, int par2, int par3) { + this.isDestroyingBlock = false; +- this.theWorld.destroyBlockInWorldPartially(this.thisPlayerMP.entityId, this.curBlockX, this.curBlockY, this.curBlockZ, -1); ++ this.theWorld.destroyBlockInWorldPartially(this.thisPlayerMP.entityId, this.partiallyDestroyedBlockX, this.partiallyDestroyedBlockY, this.partiallyDestroyedBlockZ, -1); + } + +- private boolean removeBlock(int var1, int var2, int var3) { +- Block var4 = Block.blocksList[this.theWorld.getBlockId(var1, var2, var3)]; +- int var5 = this.theWorld.getBlockMetadata(var1, var2, var3); +- if(var4 != null) { +- var4.onBlockHarvested(this.theWorld, var1, var2, var3, var5, this.thisPlayerMP); ++ /** ++ * Removes a block and triggers the appropriate events ++ */ ++ private boolean removeBlock(int par1, int par2, int par3) { ++ Block var4 = Block.blocksList[this.theWorld.getBlockId(par1, par2, par3)]; ++ int var5 = this.theWorld.getBlockMetadata(par1, par2, par3); ++ ++ if (var4 != null) { ++ var4.onBlockHarvested(this.theWorld, par1, par2, par3, var5, this.thisPlayerMP); + } + +- boolean var6 = this.theWorld.setBlockToAir(var1, var2, var3); +- if(var4 != null && var6) { +- var4.onBlockDestroyedByPlayer(this.theWorld, var1, var2, var3, var5); ++ boolean var6 = this.theWorld.setBlockToAir(par1, par2, par3); ++ ++ if (var4 != null && var6) { ++ var4.onBlockDestroyedByPlayer(this.theWorld, par1, par2, par3, var5); + } + + return var6; + } + +- public boolean tryHarvestBlock(int var1, int var2, int var3) { +- if(this.gameType.isAdventure() && !this.thisPlayerMP.isCurrentToolAdventureModeExempt(var1, var2, var3)) { ++ /** ++ * Attempts to harvest a block at the given coordinate ++ */ ++ public boolean tryHarvestBlock(int par1, int par2, int par3) { ++ if (this.gameType.isAdventure() && !this.thisPlayerMP.isCurrentToolAdventureModeExempt(par1, par2, par3)) { + return false; +- } else if(this.gameType.isCreative() && this.thisPlayerMP.getHeldItem() != null && this.thisPlayerMP.getHeldItem().getItem() instanceof ItemSword) { ++ } else if (this.gameType.isCreative() && this.thisPlayerMP.getHeldItem() != null && this.thisPlayerMP.getHeldItem().getItem() instanceof ItemSword) { + return false; + } else { +- int var4 = this.theWorld.getBlockId(var1, var2, var3); +- int var5 = this.theWorld.getBlockMetadata(var1, var2, var3); +- this.theWorld.playAuxSFXAtEntity(this.thisPlayerMP, 2001, var1, var2, var3, var4 + (this.theWorld.getBlockMetadata(var1, var2, var3) << 12)); +- boolean var6 = this.removeBlock(var1, var2, var3); +- if(this.isCreative()) { +- this.thisPlayerMP.playerNetServerHandler.sendPacket(new Packet53BlockChange(var1, var2, var3, this.theWorld)); ++ int var4 = this.theWorld.getBlockId(par1, par2, par3); ++ int var5 = this.theWorld.getBlockMetadata(par1, par2, par3); ++ this.theWorld.playAuxSFXAtEntity(this.thisPlayerMP, 2001, par1, par2, par3, var4 + (this.theWorld.getBlockMetadata(par1, par2, par3) << 12)); ++ boolean var6 = this.removeBlock(par1, par2, par3); ++ ++ if (this.isCreative()) { ++ this.thisPlayerMP.playerNetServerHandler.sendPacketToPlayer(new Packet53BlockChange(par1, par2, par3, this.theWorld)); + } else { + ItemStack var7 = this.thisPlayerMP.getCurrentEquippedItem(); + boolean var8 = this.thisPlayerMP.canHarvestBlock(Block.blocksList[var4]); +- if(var7 != null) { +- var7.onBlockDestroyed(this.theWorld, var4, var1, var2, var3, this.thisPlayerMP); +- if(var7.stackSize == 0) { ++ ++ if (var7 != null) { ++ var7.onBlockDestroyed(this.theWorld, var4, par1, par2, par3, this.thisPlayerMP); ++ ++ if (var7.stackSize == 0) { + this.thisPlayerMP.destroyCurrentEquippedItem(); + } + } + +- if(var6 && var8) { +- Block.blocksList[var4].harvestBlock(this.theWorld, this.thisPlayerMP, var1, var2, var3, var5); ++ if (var6 && var8) { ++ Block.blocksList[var4].harvestBlock(this.theWorld, this.thisPlayerMP, par1, par2, par3, var5); + } + } + +@@ -195,57 +250,72 @@ + } + } + +- public boolean tryUseItem(EntityPlayer var1, World var2, ItemStack var3) { +- int var4 = var3.stackSize; +- int var5 = var3.getItemDamage(); +- ItemStack var6 = var3.useItemRightClick(var2, var1); +- if(var6 != var3 || var6 != null && (var6.stackSize != var4 || var6.getMaxItemUseDuration() > 0 || var6.getItemDamage() != var5)) { +- var1.inventory.mainInventory[var1.inventory.currentItem] = var6; +- if(this.isCreative()) { ++ /** ++ * Attempts to right-click use an item by the given EntityPlayer in the given World ++ */ ++ public boolean tryUseItem(EntityPlayer par1EntityPlayer, World par2World, ItemStack par3ItemStack) { ++ int var4 = par3ItemStack.stackSize; ++ int var5 = par3ItemStack.getItemDamage(); ++ ItemStack var6 = par3ItemStack.useItemRightClick(par2World, par1EntityPlayer); ++ ++ if (var6 == par3ItemStack && (var6 == null || var6.stackSize == var4 && var6.getMaxItemUseDuration() <= 0 && var6.getItemDamage() == var5)) { ++ return false; ++ } else { ++ par1EntityPlayer.inventory.mainInventory[par1EntityPlayer.inventory.currentItem] = var6; ++ ++ if (this.isCreative()) { + var6.stackSize = var4; +- if(var6.isItemStackDamageable()) { ++ ++ if (var6.isItemStackDamageable()) { + var6.setItemDamage(var5); + } + } + +- if(var6.stackSize == 0) { +- var1.inventory.mainInventory[var1.inventory.currentItem] = null; ++ if (var6.stackSize == 0) { ++ par1EntityPlayer.inventory.mainInventory[par1EntityPlayer.inventory.currentItem] = null; + } + +- if(!var1.isUsingItem()) { +- ((EntityPlayerMP)var1).sendContainerToPlayer(var1.inventoryContainer); ++ if (!par1EntityPlayer.isUsingItem()) { ++ ((EntityPlayerMP)par1EntityPlayer).sendContainerToPlayer(par1EntityPlayer.inventoryContainer); + } + + return true; +- } else { +- return false; + } + } + +- public boolean activateBlockOrUseItem(EntityPlayer var1, World var2, ItemStack var3, int var4, int var5, int var6, int var7, float var8, float var9, float var10) { ++ /** ++ * Activate the clicked on block, otherwise use the held item. Args: player, world, itemStack, x, y, z, side, xOffset, ++ * yOffset, zOffset ++ */ ++ public boolean activateBlockOrUseItem(EntityPlayer par1EntityPlayer, World par2World, ItemStack par3ItemStack, int par4, int par5, int par6, int par7, float par8, float par9, float par10) { + int var11; +- if(!var1.isSneaking() || var1.getHeldItem() == null) { +- var11 = var2.getBlockId(var4, var5, var6); +- if(var11 > 0 && Block.blocksList[var11].onBlockActivated(var2, var4, var5, var6, var1, var7, var8, var9, var10)) { ++ ++ if (!par1EntityPlayer.isSneaking() || par1EntityPlayer.getHeldItem() == null) { ++ var11 = par2World.getBlockId(par4, par5, par6); ++ ++ if (var11 > 0 && Block.blocksList[var11].onBlockActivated(par2World, par4, par5, par6, par1EntityPlayer, par7, par8, par9, par10)) { + return true; + } + } + +- if(var3 == null) { ++ if (par3ItemStack == null) { + return false; +- } else if(this.isCreative()) { +- var11 = var3.getItemDamage(); +- int var12 = var3.stackSize; +- boolean var13 = var3.tryPlaceItemIntoWorld(var1, var2, var4, var5, var6, var7, var8, var9, var10); +- var3.setItemDamage(var11); +- var3.stackSize = var12; ++ } else if (this.isCreative()) { ++ var11 = par3ItemStack.getItemDamage(); ++ int var12 = par3ItemStack.stackSize; ++ boolean var13 = par3ItemStack.tryPlaceItemIntoWorld(par1EntityPlayer, par2World, par4, par5, par6, par7, par8, par9, par10); ++ par3ItemStack.setItemDamage(var11); ++ par3ItemStack.stackSize = var12; + return var13; + } else { +- return var3.tryPlaceItemIntoWorld(var1, var2, var4, var5, var6, var7, var8, var9, var10); ++ return par3ItemStack.tryPlaceItemIntoWorld(par1EntityPlayer, par2World, par4, par5, par6, par7, par8, par9, par10); + } + } + +- public void setWorld(WorldServer var1) { +- this.theWorld = var1; ++ /** ++ * Sets the world instance. ++ */ ++ public void setWorld(WorldServer par1WorldServer) { ++ this.theWorld = par1WorldServer; + } + } diff --git a/patches/net/minecraft/src/ItemLeash.java.patch b/patches/net/minecraft/src/ItemLeash.java.patch new file mode 100644 index 0000000..f6d9ece --- /dev/null +++ b/patches/net/minecraft/src/ItemLeash.java.patch @@ -0,0 +1,63 @@ +--- net/minecraft/src/ItemLeash.java ++++ net/minecraft/src/ItemLeash.java +@@ -4,18 +4,23 @@ + import java.util.List; + + public class ItemLeash extends Item { +- public ItemLeash(int var1) { +- super(var1); ++ public ItemLeash(int par1) { ++ super(par1); + this.setCreativeTab(CreativeTabs.tabTools); + } + +- public boolean onItemUse(ItemStack var1, EntityPlayer var2, World var3, int var4, int var5, int var6, int var7, float var8, float var9, float var10) { +- int var11 = var3.getBlockId(var4, var5, var6); +- if(Block.blocksList[var11] != null && Block.blocksList[var11].getRenderType() == 11) { +- if(var3.isRemote) { ++ /** ++ * Callback for item usage. If the item does something special on right clicking, he will have one of those. Return ++ * True if something happen and false if it don't. This is for ITEMS, not BLOCKS ++ */ ++ public boolean onItemUse(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, World par3World, int par4, int par5, int par6, int par7, float par8, float par9, float par10) { ++ int var11 = par3World.getBlockId(par4, par5, par6); ++ ++ if (Block.blocksList[var11] != null && Block.blocksList[var11].getRenderType() == 11) { ++ if (par3World.isRemote) { + return true; + } else { +- func_135066_a(var2, var3, var4, var5, var6); ++ func_135066_a(par2EntityPlayer, par3World, par4, par5, par6); + return true; + } + } else { +@@ -23,19 +28,21 @@ + } + } + +- public static boolean func_135066_a(EntityPlayer var0, World var1, int var2, int var3, int var4) { +- EntityLeashKnot var5 = EntityLeashKnot.getKnotForBlock(var1, var2, var3, var4); ++ public static boolean func_135066_a(EntityPlayer par0EntityPlayer, World par1World, int par2, int par3, int par4) { ++ EntityLeashKnot var5 = EntityLeashKnot.getKnotForBlock(par1World, par2, par3, par4); + boolean var6 = false; + double var7 = 7.0D; +- List var9 = var1.getEntitiesWithinAABB(EntityLiving.class, AxisAlignedBB.getAABBPool().getAABB((double)var2 - var7, (double)var3 - var7, (double)var4 - var7, (double)var2 + var7, (double)var3 + var7, (double)var4 + var7)); +- if(var9 != null) { ++ List var9 = par1World.getEntitiesWithinAABB(EntityLiving.class, AxisAlignedBB.getAABBPool().getAABB((double)par2 - var7, (double)par3 - var7, (double)par4 - var7, (double)par2 + var7, (double)par3 + var7, (double)par4 + var7)); ++ ++ if (var9 != null) { + Iterator var10 = var9.iterator(); + +- while(var10.hasNext()) { ++ while (var10.hasNext()) { + EntityLiving var11 = (EntityLiving)var10.next(); +- if(var11.getLeashed() && var11.getLeashedToEntity() == var0) { +- if(var5 == null) { +- var5 = EntityLeashKnot.func_110129_a(var1, var2, var3, var4); ++ ++ if (var11.getLeashed() && var11.getLeashedToEntity() == par0EntityPlayer) { ++ if (var5 == null) { ++ var5 = EntityLeashKnot.func_110129_a(par1World, par2, par3, par4); + } + + var11.setLeashedToEntity(var5, true); diff --git a/patches/net/minecraft/src/ItemLeaves.java.patch b/patches/net/minecraft/src/ItemLeaves.java.patch new file mode 100644 index 0000000..dc88268 --- /dev/null +++ b/patches/net/minecraft/src/ItemLeaves.java.patch @@ -0,0 +1,61 @@ +--- net/minecraft/src/ItemLeaves.java ++++ net/minecraft/src/ItemLeaves.java +@@ -1,31 +1,42 @@ + package net.minecraft.src; + + public class ItemLeaves extends ItemBlock { +- public ItemLeaves(int var1) { +- super(var1); ++ public ItemLeaves(int par1) { ++ super(par1); + this.setMaxDamage(0); + this.setHasSubtypes(true); + } + +- public int getMetadata(int var1) { +- return var1 | 4; +- } +- +- public Icon getIconFromDamage(int var1) { +- return Block.leaves.getIcon(0, var1); +- } +- +- public int getColorFromItemStack(ItemStack var1, int var2) { +- int var3 = var1.getItemDamage(); ++ /** ++ * Returns the metadata of the block which this Item (ItemBlock) can place ++ */ ++ public int getMetadata(int par1) { ++ return par1 | 4; ++ } ++ ++ /** ++ * Gets an icon index based on an item's damage value ++ */ ++ public Icon getIconFromDamage(int par1) { ++ return Block.leaves.getIcon(0, par1); ++ } ++ ++ public int getColorFromItemStack(ItemStack par1ItemStack, int par2) { ++ int var3 = par1ItemStack.getItemDamage(); + return (var3 & 1) == 1 ? ColorizerFoliage.getFoliageColorPine() : ((var3 & 2) == 2 ? ColorizerFoliage.getFoliageColorBirch() : ColorizerFoliage.getFoliageColorBasic()); + } + +- public String getUnlocalizedName(ItemStack var1) { +- int var2 = var1.getItemDamage(); +- if(var2 < 0 || var2 >= BlockLeaves.a.length) { ++ /** ++ * Returns the unlocalized name of this item. This version accepts an ItemStack so different stacks can have different ++ * names based on their damage or NBT. ++ */ ++ public String getUnlocalizedName(ItemStack par1ItemStack) { ++ int var2 = par1ItemStack.getItemDamage(); ++ ++ if (var2 < 0 || var2 >= BlockLeaves.LEAF_TYPES.length) { + var2 = 0; + } + +- return super.getUnlocalizedName() + "." + BlockLeaves.a[var2]; ++ return super.getUnlocalizedName() + "." + BlockLeaves.LEAF_TYPES[var2]; + } + } diff --git a/patches/net/minecraft/src/ItemLilyPad.java.patch b/patches/net/minecraft/src/ItemLilyPad.java.patch new file mode 100644 index 0000000..ef34325 --- /dev/null +++ b/patches/net/minecraft/src/ItemLilyPad.java.patch @@ -0,0 +1,71 @@ +--- net/minecraft/src/ItemLilyPad.java ++++ net/minecraft/src/ItemLilyPad.java +@@ -1,40 +1,46 @@ + package net.minecraft.src; + + public class ItemLilyPad extends ItemColored { +- public ItemLilyPad(int var1) { +- super(var1, false); ++ public ItemLilyPad(int par1) { ++ super(par1, false); + } + +- public ItemStack onItemRightClick(ItemStack var1, World var2, EntityPlayer var3) { +- MovingObjectPosition var4 = this.getMovingObjectPositionFromPlayer(var2, var3, true); +- if(var4 == null) { +- return var1; ++ /** ++ * Called whenever this item is equipped and the right mouse button is pressed. Args: itemStack, world, entityPlayer ++ */ ++ public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) { ++ MovingObjectPosition var4 = this.getMovingObjectPositionFromPlayer(par2World, par3EntityPlayer, true); ++ ++ if (var4 == null) { ++ return par1ItemStack; + } else { +- if(var4.typeOfHit == EnumMovingObjectType.TILE) { ++ if (var4.typeOfHit == EnumMovingObjectType.TILE) { + int var5 = var4.blockX; + int var6 = var4.blockY; + int var7 = var4.blockZ; +- if(!var2.canMineBlock(var3, var5, var6, var7)) { +- return var1; +- } +- +- if(!var3.canPlayerEdit(var5, var6, var7, var4.sideHit, var1)) { +- return var1; +- } +- +- if(var2.getBlockMaterial(var5, var6, var7) == Material.water && var2.getBlockMetadata(var5, var6, var7) == 0 && var2.isAirBlock(var5, var6 + 1, var7)) { +- var2.setBlock(var5, var6 + 1, var7, Block.waterlily.blockID); +- if(!var3.capabilities.isCreativeMode) { +- --var1.stackSize; ++ ++ if (!par2World.canMineBlock(par3EntityPlayer, var5, var6, var7)) { ++ return par1ItemStack; ++ } ++ ++ if (!par3EntityPlayer.canPlayerEdit(var5, var6, var7, var4.sideHit, par1ItemStack)) { ++ return par1ItemStack; ++ } ++ ++ if (par2World.getBlockMaterial(var5, var6, var7) == Material.water && par2World.getBlockMetadata(var5, var6, var7) == 0 && par2World.isAirBlock(var5, var6 + 1, var7)) { ++ par2World.setBlock(var5, var6 + 1, var7, Block.waterlily.blockID); ++ ++ if (!par3EntityPlayer.capabilities.isCreativeMode) { ++ --par1ItemStack.stackSize; + } + } + } + +- return var1; ++ return par1ItemStack; + } + } + +- public int getColorFromItemStack(ItemStack var1, int var2) { +- return Block.waterlily.getRenderColor(var1.getItemDamage()); ++ public int getColorFromItemStack(ItemStack par1ItemStack, int par2) { ++ return Block.waterlily.getRenderColor(par1ItemStack.getItemDamage()); + } + } diff --git a/patches/net/minecraft/src/ItemMap.java.patch b/patches/net/minecraft/src/ItemMap.java.patch new file mode 100644 index 0000000..36fcbd7 --- /dev/null +++ b/patches/net/minecraft/src/ItemMap.java.patch @@ -0,0 +1,377 @@ +--- net/minecraft/src/ItemMap.java ++++ net/minecraft/src/ItemMap.java +@@ -3,74 +3,78 @@ + import java.util.List; + + public class ItemMap extends ItemMapBase { +- protected ItemMap(int var1) { +- super(var1); ++ protected ItemMap(int par1) { ++ super(par1); + this.setHasSubtypes(true); + } + +- public static MapData getMPMapData(short var0, World var1) { +- String var2 = "map_" + var0; +- MapData var3 = (MapData)var1.loadItemData(MapData.class, var2); +- if(var3 == null) { ++ public static MapData getMPMapData(short par0, World par1World) { ++ String var2 = "map_" + par0; ++ MapData var3 = (MapData)par1World.loadItemData(MapData.class, var2); ++ ++ if (var3 == null) { + var3 = new MapData(var2); +- var1.setItemData(var2, var3); ++ par1World.setItemData(var2, var3); + } + + return var3; + } + +- public MapData getMapData(ItemStack var1, World var2) { +- String var3 = "map_" + var1.getItemDamage(); +- MapData var4 = (MapData)var2.loadItemData(MapData.class, var3); +- if(var4 == null && !var2.isRemote) { +- var1.setItemDamage(var2.getUniqueDataId("map")); +- var3 = "map_" + var1.getItemDamage(); ++ public MapData getMapData(ItemStack par1ItemStack, World par2World) { ++ String var3 = "map_" + par1ItemStack.getItemDamage(); ++ MapData var4 = (MapData)par2World.loadItemData(MapData.class, var3); ++ ++ if (var4 == null && !par2World.isRemote) { ++ par1ItemStack.setItemDamage(par2World.getUniqueDataId("map")); ++ var3 = "map_" + par1ItemStack.getItemDamage(); + var4 = new MapData(var3); + var4.scale = 3; + int var5 = 128 * (1 << var4.scale); +- var4.xCenter = Math.round((float)var2.getWorldInfo().getSpawnX() / (float)var5) * var5; +- var4.zCenter = Math.round((float)(var2.getWorldInfo().getSpawnZ() / var5)) * var5; +- var4.dimension = (byte)var2.provider.dimensionId; ++ var4.xCenter = Math.round((float)par2World.getWorldInfo().getSpawnX() / (float)var5) * var5; ++ var4.zCenter = Math.round((float)(par2World.getWorldInfo().getSpawnZ() / var5)) * var5; ++ var4.dimension = (byte)par2World.provider.dimensionId; + var4.markDirty(); +- var2.setItemData(var3, var4); ++ par2World.setItemData(var3, var4); + } + + return var4; + } + +- public void updateMapData(World var1, Entity var2, MapData var3) { +- if(var1.provider.dimensionId == var3.dimension && var2 instanceof EntityPlayer) { ++ public void updateMapData(World par1World, Entity par2Entity, MapData par3MapData) { ++ if (par1World.provider.dimensionId == par3MapData.dimension && par2Entity instanceof EntityPlayer) { + short var4 = 128; + short var5 = 128; +- int var6 = 1 << var3.scale; +- int var7 = var3.xCenter; +- int var8 = var3.zCenter; +- int var9 = MathHelper.floor_double(var2.posX - (double)var7) / var6 + var4 / 2; +- int var10 = MathHelper.floor_double(var2.posZ - (double)var8) / var6 + var5 / 2; ++ int var6 = 1 << par3MapData.scale; ++ int var7 = par3MapData.xCenter; ++ int var8 = par3MapData.zCenter; ++ int var9 = MathHelper.floor_double(par2Entity.posX - (double)var7) / var6 + var4 / 2; ++ int var10 = MathHelper.floor_double(par2Entity.posZ - (double)var8) / var6 + var5 / 2; + int var11 = 128 / var6; +- if(var1.provider.hasNoSky) { ++ ++ if (par1World.provider.hasNoSky) { + var11 /= 2; + } + +- MapInfo var12 = var3.func_82568_a((EntityPlayer)var2); ++ MapInfo var12 = par3MapData.func_82568_a((EntityPlayer)par2Entity); + ++var12.field_82569_d; + +- for(int var13 = var9 - var11 + 1; var13 < var9 + var11; ++var13) { +- if((var13 & 15) == (var12.field_82569_d & 15)) { ++ for (int var13 = var9 - var11 + 1; var13 < var9 + var11; ++var13) { ++ if ((var13 & 15) == (var12.field_82569_d & 15)) { + int var14 = 255; + int var15 = 0; + double var16 = 0.0D; + +- for(int var18 = var10 - var11 - 1; var18 < var10 + var11; ++var18) { +- if(var13 >= 0 && var18 >= -1 && var13 < var4 && var18 < var5) { ++ for (int var18 = var10 - var11 - 1; var18 < var10 + var11; ++var18) { ++ if (var13 >= 0 && var18 >= -1 && var13 < var4 && var18 < var5) { + int var19 = var13 - var9; + int var20 = var18 - var10; + boolean var21 = var19 * var19 + var20 * var20 > (var11 - 2) * (var11 - 2); + int var22 = (var7 / var6 + var13 - var4 / 2) * var6; + int var23 = (var8 / var6 + var18 - var5 / 2) * var6; + int[] var24 = new int[256]; +- Chunk var25 = var1.getChunkFromBlockCoords(var22, var23); +- if(!var25.isEmpty()) { ++ Chunk var25 = par1World.getChunkFromBlockCoords(var22, var23); ++ ++ if (!var25.isEmpty()) { + int var26 = var22 & 15; + int var27 = var23 & 15; + int var28 = 0; +@@ -79,10 +83,12 @@ + int var32; + int var33; + int var36; +- if(var1.provider.hasNoSky) { ++ ++ if (par1World.provider.hasNoSky) { + var31 = var22 + var23 * 231871; + var31 = var31 * var31 * 31287121 + var31 * 11; +- if((var31 >> 20 & 1) == 0) { ++ ++ if ((var31 >> 20 & 1) == 0) { + var24[Block.dirt.blockID] += 10; + } else { + var24[Block.stone.blockID] += 10; +@@ -90,40 +96,44 @@ + + var29 = 100.0D; + } else { +- for(var31 = 0; var31 < var6; ++var31) { +- for(var32 = 0; var32 < var6; ++var32) { ++ for (var31 = 0; var31 < var6; ++var31) { ++ for (var32 = 0; var32 < var6; ++var32) { + var33 = var25.getHeightValue(var31 + var26, var32 + var27) + 1; + int var34 = 0; +- if(var33 > 1) { ++ ++ if (var33 > 1) { + boolean var35; ++ + do { + var35 = true; + var34 = var25.getBlockID(var31 + var26, var33 - 1, var32 + var27); +- if(var34 == 0) { ++ ++ if (var34 == 0) { + var35 = false; +- } else if(var33 > 0 && var34 > 0 && Block.blocksList[var34].blockMaterial.materialMapColor == MapColor.airColor) { ++ } else if (var33 > 0 && var34 > 0 && Block.blocksList[var34].blockMaterial.materialMapColor == MapColor.airColor) { + var35 = false; + } + +- if(!var35) { ++ if (!var35) { + --var33; +- if(var33 <= 0) { ++ ++ if (var33 <= 0) { + break; + } + + var34 = var25.getBlockID(var31 + var26, var33 - 1, var32 + var27); + } +- } while(var33 > 0 && !var35); ++ } while (var33 > 0 && !var35); + +- if(var33 > 0 && var34 != 0 && Block.blocksList[var34].blockMaterial.isLiquid()) { ++ if (var33 > 0 && var34 != 0 && Block.blocksList[var34].blockMaterial.isLiquid()) { + var36 = var33 - 1; + boolean var37 = false; +- + int var41; ++ + do { + var41 = var25.getBlockID(var31 + var26, var36--, var32 + var27); + ++var28; +- } while(var36 > 0 && var41 != 0 && Block.blocksList[var41].blockMaterial.isLiquid()); ++ } while (var36 > 0 && var41 != 0 && Block.blocksList[var41].blockMaterial.isLiquid()); + } + } + +@@ -137,8 +147,8 @@ + var31 = 0; + var32 = 0; + +- for(var33 = 0; var33 < 256; ++var33) { +- if(var24[var33] > var31) { ++ for (var33 = 0; var33 < 256; ++var33) { ++ if (var24[var33] > var31) { + var32 = var33; + var31 = var24[var33]; + } +@@ -146,25 +156,29 @@ + + double var39 = (var29 - var16) * 4.0D / (double)(var6 + 4) + ((double)(var13 + var18 & 1) - 0.5D) * 0.4D; + byte var40 = 1; +- if(var39 > 0.6D) { ++ ++ if (var39 > 0.6D) { + var40 = 2; + } + +- if(var39 < -0.6D) { ++ if (var39 < -0.6D) { + var40 = 0; + } + + var36 = 0; +- if(var32 > 0) { ++ ++ if (var32 > 0) { + MapColor var42 = Block.blocksList[var32].blockMaterial.materialMapColor; +- if(var42 == MapColor.waterColor) { ++ ++ if (var42 == MapColor.waterColor) { + var39 = (double)var28 * 0.1D + (double)(var13 + var18 & 1) * 0.2D; + var40 = 1; +- if(var39 < 0.5D) { ++ ++ if (var39 < 0.5D) { + var40 = 2; + } + +- if(var39 > 0.9D) { ++ if (var39 > 0.9D) { + var40 = 0; + } + } +@@ -173,61 +187,73 @@ + } + + var16 = var29; +- if(var18 >= 0 && var19 * var19 + var20 * var20 < var11 * var11 && (!var21 || (var13 + var18 & 1) != 0)) { +- byte var43 = var3.colors[var13 + var18 * var4]; ++ ++ if (var18 >= 0 && var19 * var19 + var20 * var20 < var11 * var11 && (!var21 || (var13 + var18 & 1) != 0)) { ++ byte var43 = par3MapData.colors[var13 + var18 * var4]; + byte var38 = (byte)(var36 * 4 + var40); +- if(var43 != var38) { +- if(var14 > var18) { ++ ++ if (var43 != var38) { ++ if (var14 > var18) { + var14 = var18; + } + +- if(var15 < var18) { ++ if (var15 < var18) { + var15 = var18; + } + +- var3.colors[var13 + var18 * var4] = var38; ++ par3MapData.colors[var13 + var18 * var4] = var38; + } + } + } + } + } + +- if(var14 <= var15) { +- var3.setColumnDirty(var13, var14, var15); ++ if (var14 <= var15) { ++ par3MapData.setColumnDirty(var13, var14, var15); + } + } + } +- +- } +- } +- +- public void onUpdate(ItemStack var1, World var2, Entity var3, int var4, boolean var5) { +- if(!var2.isRemote) { +- MapData var6 = this.getMapData(var1, var2); +- if(var3 instanceof EntityPlayer) { +- EntityPlayer var7 = (EntityPlayer)var3; +- var6.updateVisiblePlayers(var7, var1); +- } +- +- if(var5) { +- this.updateMapData(var2, var3, var6); +- } +- +- } +- } +- +- public Packet getUpdatePacket(ItemStack var1, World var2, EntityPlayer var3) { +- byte[] var4 = this.getMapData(var1, var2).getUpdatePacketData(var1, var2, var3); +- return var4 == null ? null : new Packet131MapData((short)Item.map.itemID, (short)var1.getItemDamage(), var4); +- } +- +- public void onCreated(ItemStack var1, World var2, EntityPlayer var3) { +- if(var1.hasTagCompound() && var1.getTagCompound().getBoolean("map_is_scaling")) { +- MapData var4 = Item.map.getMapData(var1, var2); +- var1.setItemDamage(var2.getUniqueDataId("map")); +- MapData var5 = new MapData("map_" + var1.getItemDamage()); ++ } ++ } ++ ++ /** ++ * Called each tick as long the item is on a player inventory. Uses by maps to check if is on a player hand and update ++ * it's contents. ++ */ ++ public void onUpdate(ItemStack par1ItemStack, World par2World, Entity par3Entity, int par4, boolean par5) { ++ if (!par2World.isRemote) { ++ MapData var6 = this.getMapData(par1ItemStack, par2World); ++ ++ if (par3Entity instanceof EntityPlayer) { ++ EntityPlayer var7 = (EntityPlayer)par3Entity; ++ var6.updateVisiblePlayers(var7, par1ItemStack); ++ } ++ ++ if (par5) { ++ this.updateMapData(par2World, par3Entity, var6); ++ } ++ } ++ } ++ ++ /** ++ * returns null if no update is to be sent ++ */ ++ public Packet createMapDataPacket(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) { ++ byte[] var4 = this.getMapData(par1ItemStack, par2World).getUpdatePacketData(par1ItemStack, par2World, par3EntityPlayer); ++ return var4 == null ? null : new Packet131MapData((short)Item.map.itemID, (short)par1ItemStack.getItemDamage(), var4); ++ } ++ ++ /** ++ * Called when item is crafted/smelted. Used only by maps so far. ++ */ ++ public void onCreated(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) { ++ if (par1ItemStack.hasTagCompound() && par1ItemStack.getTagCompound().getBoolean("map_is_scaling")) { ++ MapData var4 = Item.map.getMapData(par1ItemStack, par2World); ++ par1ItemStack.setItemDamage(par2World.getUniqueDataId("map")); ++ MapData var5 = new MapData("map_" + par1ItemStack.getItemDamage()); + var5.scale = (byte)(var4.scale + 1); +- if(var5.scale > 4) { ++ ++ if (var5.scale > 4) { + var5.scale = 4; + } + +@@ -235,21 +261,23 @@ + var5.zCenter = var4.zCenter; + var5.dimension = var4.dimension; + var5.markDirty(); +- var2.setItemData("map_" + var1.getItemDamage(), var5); ++ par2World.setItemData("map_" + par1ItemStack.getItemDamage(), var5); + } +- + } + +- public void addInformation(ItemStack var1, EntityPlayer var2, List var3, boolean var4) { +- MapData var5 = this.getMapData(var1, var2.worldObj); +- if(var4) { +- if(var5 == null) { +- var3.add("Unknown map"); ++ /** ++ * allows items to add custom lines of information to the mouseover description ++ */ ++ public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4) { ++ MapData var5 = this.getMapData(par1ItemStack, par2EntityPlayer.worldObj); ++ ++ if (par4) { ++ if (var5 == null) { ++ par3List.add("Unknown map"); + } else { +- var3.add("Scaling at 1:" + (1 << var5.scale)); +- var3.add("(Level " + var5.scale + "/" + 4 + ")"); ++ par3List.add("Scaling at 1:" + (1 << var5.scale)); ++ par3List.add("(Level " + var5.scale + "/" + 4 + ")"); + } + } +- + } + } diff --git a/patches/net/minecraft/src/ItemMapBase.java.patch b/patches/net/minecraft/src/ItemMapBase.java.patch new file mode 100644 index 0000000..7fe52b1 --- /dev/null +++ b/patches/net/minecraft/src/ItemMapBase.java.patch @@ -0,0 +1,27 @@ +--- net/minecraft/src/ItemMapBase.java ++++ net/minecraft/src/ItemMapBase.java +@@ -1,15 +1,21 @@ + package net.minecraft.src; + + public class ItemMapBase extends Item { +- protected ItemMapBase(int var1) { +- super(var1); ++ protected ItemMapBase(int par1) { ++ super(par1); + } + ++ /** ++ * false for all Items except sub-classes of ItemMapBase ++ */ + public boolean isMap() { + return true; + } + +- public Packet getUpdatePacket(ItemStack var1, World var2, EntityPlayer var3) { ++ /** ++ * returns null if no update is to be sent ++ */ ++ public Packet createMapDataPacket(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) { + return null; + } + } diff --git a/patches/net/minecraft/src/ItemMinecart.java.patch b/patches/net/minecraft/src/ItemMinecart.java.patch new file mode 100644 index 0000000..135c1b6 --- /dev/null +++ b/patches/net/minecraft/src/ItemMinecart.java.patch @@ -0,0 +1,48 @@ +--- net/minecraft/src/ItemMinecart.java ++++ net/minecraft/src/ItemMinecart.java +@@ -4,27 +4,33 @@ + private static final IBehaviorDispenseItem dispenserMinecartBehavior = new BehaviorDispenseMinecart(); + public int minecartType; + +- public ItemMinecart(int var1, int var2) { +- super(var1); ++ public ItemMinecart(int par1, int par2) { ++ super(par1); + this.maxStackSize = 1; +- this.minecartType = var2; ++ this.minecartType = par2; + this.setCreativeTab(CreativeTabs.tabTransport); + BlockDispenser.dispenseBehaviorRegistry.putObject(this, dispenserMinecartBehavior); + } + +- public boolean onItemUse(ItemStack var1, EntityPlayer var2, World var3, int var4, int var5, int var6, int var7, float var8, float var9, float var10) { +- int var11 = var3.getBlockId(var4, var5, var6); +- if(BlockRailBase.isRailBlock(var11)) { +- if(!var3.isRemote) { +- EntityMinecart var12 = EntityMinecart.createMinecart(var3, (double)((float)var4 + 0.5F), (double)((float)var5 + 0.5F), (double)((float)var6 + 0.5F), this.minecartType); +- if(var1.hasDisplayName()) { +- var12.setMinecartName(var1.getDisplayName()); ++ /** ++ * Callback for item usage. If the item does something special on right clicking, he will have one of those. Return ++ * True if something happen and false if it don't. This is for ITEMS, not BLOCKS ++ */ ++ public boolean onItemUse(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, World par3World, int par4, int par5, int par6, int par7, float par8, float par9, float par10) { ++ int var11 = par3World.getBlockId(par4, par5, par6); ++ ++ if (BlockRailBase.isRailBlock(var11)) { ++ if (!par3World.isRemote) { ++ EntityMinecart var12 = EntityMinecart.createMinecart(par3World, (double)((float)par4 + 0.5F), (double)((float)par5 + 0.5F), (double)((float)par6 + 0.5F), this.minecartType); ++ ++ if (par1ItemStack.hasDisplayName()) { ++ var12.setMinecartName(par1ItemStack.getDisplayName()); + } + +- var3.spawnEntityInWorld(var12); ++ par3World.spawnEntityInWorld(var12); + } + +- --var1.stackSize; ++ --par1ItemStack.stackSize; + return true; + } else { + return false; diff --git a/patches/net/minecraft/src/ItemMonsterPlacer.java.patch b/patches/net/minecraft/src/ItemMonsterPlacer.java.patch new file mode 100644 index 0000000..d194842 --- /dev/null +++ b/patches/net/minecraft/src/ItemMonsterPlacer.java.patch @@ -0,0 +1,231 @@ +--- net/minecraft/src/ItemMonsterPlacer.java ++++ net/minecraft/src/ItemMonsterPlacer.java +@@ -3,59 +3,73 @@ + import java.util.Iterator; + import java.util.List; + ++import com.prupe.mcpatcher.cc.ColorizeItem; ++ + public class ItemMonsterPlacer extends Item { + private Icon theIcon; + +- public ItemMonsterPlacer(int var1) { +- super(var1); ++ public ItemMonsterPlacer(int par1) { ++ super(par1); + this.setHasSubtypes(true); + this.setCreativeTab(CreativeTabs.tabMisc); + } + +- public String getItemDisplayName(ItemStack var1) { ++ public String getItemDisplayName(ItemStack par1ItemStack) { + String var2 = ("" + StatCollector.translateToLocal(this.getUnlocalizedName() + ".name")).trim(); +- String var3 = EntityList.getStringFromID(var1.getItemDamage()); +- if(var3 != null) { ++ String var3 = EntityList.getStringFromID(par1ItemStack.getItemDamage()); ++ ++ if (var3 != null) { + var2 = var2 + " " + StatCollector.translateToLocal("entity." + var3 + ".name"); + } + + return var2; + } + +- public int getColorFromItemStack(ItemStack var1, int var2) { +- EntityEggInfo var3 = (EntityEggInfo)EntityList.a.get(Integer.valueOf(var1.getItemDamage())); +- return var3 != null ? (var2 == 0 ? var3.primaryColor : var3.secondaryColor) : 16777215; ++ public int getColorFromItemStack(ItemStack par1ItemStack, int par2) { ++ EntityEggInfo var3 = (EntityEggInfo)EntityList.entityEggs.get(Integer.valueOf(par1ItemStack.getItemDamage())); ++ // MCPatcher Start ++ return var3 != null ? (par2 == 0 ? ColorizeItem.colorizeSpawnerEgg(var3.primaryColor, par1ItemStack.getItemDamage(), par2) : ColorizeItem.colorizeSpawnerEgg(var3.secondaryColor, par1ItemStack.getItemDamage(), par2)) : ColorizeItem.colorizeSpawnerEgg(16777215, par1ItemStack.getItemDamage(), par2); ++ // MCPatcher End + } + + public boolean requiresMultipleRenderPasses() { + return true; + } + +- public Icon getIconFromDamageForRenderPass(int var1, int var2) { +- return var2 > 0 ? this.theIcon : super.getIconFromDamageForRenderPass(var1, var2); ++ /** ++ * Gets an icon index based on an item's damage value and the given render pass ++ */ ++ public Icon getIconFromDamageForRenderPass(int par1, int par2) { ++ return par2 > 0 ? this.theIcon : super.getIconFromDamageForRenderPass(par1, par2); + } + +- public boolean onItemUse(ItemStack var1, EntityPlayer var2, World var3, int var4, int var5, int var6, int var7, float var8, float var9, float var10) { +- if(var3.isRemote) { ++ /** ++ * Callback for item usage. If the item does something special on right clicking, he will have one of those. Return ++ * True if something happen and false if it don't. This is for ITEMS, not BLOCKS ++ */ ++ public boolean onItemUse(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, World par3World, int par4, int par5, int par6, int par7, float par8, float par9, float par10) { ++ if (par3World.isRemote) { + return true; + } else { +- int var11 = var3.getBlockId(var4, var5, var6); +- var4 += Facing.offsetsXForSide[var7]; +- var5 += Facing.offsetsYForSide[var7]; +- var6 += Facing.offsetsZForSide[var7]; ++ int var11 = par3World.getBlockId(par4, par5, par6); ++ par4 += Facing.offsetsXForSide[par7]; ++ par5 += Facing.offsetsYForSide[par7]; ++ par6 += Facing.offsetsZForSide[par7]; + double var12 = 0.0D; +- if(var7 == 1 && Block.blocksList[var11] != null && Block.blocksList[var11].getRenderType() == 11) { ++ ++ if (par7 == 1 && Block.blocksList[var11] != null && Block.blocksList[var11].getRenderType() == 11) { + var12 = 0.5D; + } + +- Entity var14 = spawnCreature(var3, var1.getItemDamage(), (double)var4 + 0.5D, (double)var5 + var12, (double)var6 + 0.5D); +- if(var14 != null) { +- if(var14 instanceof EntityLivingBase && var1.hasDisplayName()) { +- ((EntityLiving)var14).setCustomNameTag(var1.getDisplayName()); ++ Entity var14 = spawnCreature(par3World, par1ItemStack.getItemDamage(), (double)par4 + 0.5D, (double)par5 + var12, (double)par6 + 0.5D); ++ ++ if (var14 != null) { ++ if (var14 instanceof EntityLivingBase && par1ItemStack.hasDisplayName()) { ++ ((EntityLiving)var14).setCustomNameTag(par1ItemStack.getDisplayName()); + } + +- if(!var2.capabilities.isCreativeMode) { +- --var1.stackSize; ++ if (!par2EntityPlayer.capabilities.isCreativeMode) { ++ --par1ItemStack.stackSize; + } + } + +@@ -63,60 +77,71 @@ + } + } + +- public ItemStack onItemRightClick(ItemStack var1, World var2, EntityPlayer var3) { +- if(var2.isRemote) { +- return var1; ++ /** ++ * Called whenever this item is equipped and the right mouse button is pressed. Args: itemStack, world, entityPlayer ++ */ ++ public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) { ++ if (par2World.isRemote) { ++ return par1ItemStack; + } else { +- MovingObjectPosition var4 = this.getMovingObjectPositionFromPlayer(var2, var3, true); +- if(var4 == null) { +- return var1; ++ MovingObjectPosition var4 = this.getMovingObjectPositionFromPlayer(par2World, par3EntityPlayer, true); ++ ++ if (var4 == null) { ++ return par1ItemStack; + } else { +- if(var4.typeOfHit == EnumMovingObjectType.TILE) { ++ if (var4.typeOfHit == EnumMovingObjectType.TILE) { + int var5 = var4.blockX; + int var6 = var4.blockY; + int var7 = var4.blockZ; +- if(!var2.canMineBlock(var3, var5, var6, var7)) { +- return var1; +- } +- +- if(!var3.canPlayerEdit(var5, var6, var7, var4.sideHit, var1)) { +- return var1; +- } +- +- if(var2.getBlockMaterial(var5, var6, var7) == Material.water) { +- Entity var8 = spawnCreature(var2, var1.getItemDamage(), (double)var5, (double)var6, (double)var7); +- if(var8 != null) { +- if(var8 instanceof EntityLivingBase && var1.hasDisplayName()) { +- ((EntityLiving)var8).setCustomNameTag(var1.getDisplayName()); ++ ++ if (!par2World.canMineBlock(par3EntityPlayer, var5, var6, var7)) { ++ return par1ItemStack; ++ } ++ ++ if (!par3EntityPlayer.canPlayerEdit(var5, var6, var7, var4.sideHit, par1ItemStack)) { ++ return par1ItemStack; ++ } ++ ++ if (par2World.getBlockMaterial(var5, var6, var7) == Material.water) { ++ Entity var8 = spawnCreature(par2World, par1ItemStack.getItemDamage(), (double)var5, (double)var6, (double)var7); ++ ++ if (var8 != null) { ++ if (var8 instanceof EntityLivingBase && par1ItemStack.hasDisplayName()) { ++ ((EntityLiving)var8).setCustomNameTag(par1ItemStack.getDisplayName()); + } + +- if(!var3.capabilities.isCreativeMode) { +- --var1.stackSize; ++ if (!par3EntityPlayer.capabilities.isCreativeMode) { ++ --par1ItemStack.stackSize; + } + } + } + } + +- return var1; ++ return par1ItemStack; + } + } + } +- +- public static Entity spawnCreature(World var0, int var1, double var2, double var4, double var6) { +- if(!EntityList.a.containsKey(Integer.valueOf(var1))) { ++ ++ /** ++ * Spawns the creature specified by the egg's type in the location specified by the last three parameters. Parameters: ++ * world, entityID, x, y, z. ++ */ ++ public static Entity spawnCreature(World par0World, int par1, double par2, double par4, double par6) { ++ if (!EntityList.entityEggs.containsKey(Integer.valueOf(par1))) { + return null; + } else { + Entity var8 = null; + +- for(int var9 = 0; var9 < 1; ++var9) { +- var8 = EntityList.createEntityByID(var1, var0); +- if(var8 != null && var8 instanceof EntityLivingBase) { ++ for (int var9 = 0; var9 < 1; ++var9) { ++ var8 = EntityList.createEntityByID(par1, par0World); ++ ++ if (var8 != null && var8 instanceof EntityLivingBase) { + EntityLiving var10 = (EntityLiving)var8; +- var8.setLocationAndAngles(var2, var4, var6, MathHelper.wrapAngleTo180_float(var0.s.nextFloat() * 360.0F), 0.0F); ++ var8.setLocationAndAngles(par2, par4, par6, MathHelper.wrapAngleTo180_float(par0World.rand.nextFloat() * 360.0F), 0.0F); + var10.rotationYawHead = var10.rotationYaw; + var10.renderYawOffset = var10.rotationYaw; + var10.onSpawnWithEgg((EntityLivingData)null); +- var0.spawnEntityInWorld(var8); ++ par0World.spawnEntityInWorld(var8); + var10.playLivingSound(); + } + } +@@ -125,18 +150,20 @@ + } + } + +- public void getSubItems(int var1, CreativeTabs var2, List var3) { +- Iterator var4 = EntityList.a.values().iterator(); ++ /** ++ * returns a list of items with the same ID, but different meta (eg: dye returns 16 items) ++ */ ++ public void getSubItems(int par1, CreativeTabs par2CreativeTabs, List par3List) { ++ Iterator var4 = EntityList.entityEggs.values().iterator(); + +- while(var4.hasNext()) { ++ while (var4.hasNext()) { + EntityEggInfo var5 = (EntityEggInfo)var4.next(); +- var3.add(new ItemStack(var1, 1, var5.spawnedID)); ++ par3List.add(new ItemStack(par1, 1, var5.spawnedID)); + } +- + } + +- public void registerIcons(IconRegister var1) { +- super.registerIcons(var1); +- this.theIcon = var1.registerIcon(this.getIconString() + "_overlay"); ++ public void registerIcons(IconRegister par1IconRegister) { ++ super.registerIcons(par1IconRegister); ++ this.theIcon = par1IconRegister.registerIcon(this.getIconString() + "_overlay"); + } + } diff --git a/patches/net/minecraft/src/ItemMultiTextureTile.java.patch b/patches/net/minecraft/src/ItemMultiTextureTile.java.patch new file mode 100644 index 0000000..5b925f6 --- /dev/null +++ b/patches/net/minecraft/src/ItemMultiTextureTile.java.patch @@ -0,0 +1,61 @@ +--- net/minecraft/src/ItemMultiTextureTile.java ++++ net/minecraft/src/ItemMultiTextureTile.java +@@ -2,30 +2,41 @@ + + public class ItemMultiTextureTile extends ItemBlock { + private final Block theBlock; +- private final String[] b; ++ private final String[] field_82804_b; + +- public ItemMultiTextureTile(int var1, Block var2, String[] var3) { +- super(var1); +- this.theBlock = var2; +- this.b = var3; ++ public ItemMultiTextureTile(int par1, Block par2Block, String[] par3ArrayOfStr) { ++ super(par1); ++ this.theBlock = par2Block; ++ this.field_82804_b = par3ArrayOfStr; + this.setMaxDamage(0); + this.setHasSubtypes(true); + } + +- public Icon getIconFromDamage(int var1) { +- return this.theBlock.getIcon(2, var1); +- } +- +- public int getMetadata(int var1) { +- return var1; +- } +- +- public String getUnlocalizedName(ItemStack var1) { +- int var2 = var1.getItemDamage(); +- if(var2 < 0 || var2 >= this.b.length) { ++ /** ++ * Gets an icon index based on an item's damage value ++ */ ++ public Icon getIconFromDamage(int par1) { ++ return this.theBlock.getIcon(2, par1); ++ } ++ ++ /** ++ * Returns the metadata of the block which this Item (ItemBlock) can place ++ */ ++ public int getMetadata(int par1) { ++ return par1; ++ } ++ ++ /** ++ * Returns the unlocalized name of this item. This version accepts an ItemStack so different stacks can have different ++ * names based on their damage or NBT. ++ */ ++ public String getUnlocalizedName(ItemStack par1ItemStack) { ++ int var2 = par1ItemStack.getItemDamage(); ++ ++ if (var2 < 0 || var2 >= this.field_82804_b.length) { + var2 = 0; + } + +- return super.getUnlocalizedName() + "." + this.b[var2]; ++ return super.getUnlocalizedName() + "." + this.field_82804_b[var2]; + } + } diff --git a/patches/net/minecraft/src/ItemNameTag.java.patch b/patches/net/minecraft/src/ItemNameTag.java.patch new file mode 100644 index 0000000..5953c3a --- /dev/null +++ b/patches/net/minecraft/src/ItemNameTag.java.patch @@ -0,0 +1,37 @@ +--- net/minecraft/src/ItemNameTag.java ++++ net/minecraft/src/ItemNameTag.java +@@ -1,22 +1,25 @@ + package net.minecraft.src; + + public class ItemNameTag extends Item { +- public ItemNameTag(int var1) { +- super(var1); ++ public ItemNameTag(int par1) { ++ super(par1); + this.setCreativeTab(CreativeTabs.tabTools); + } + +- public boolean itemInteractionForEntity(ItemStack var1, EntityPlayer var2, EntityLivingBase var3) { +- if(!var1.hasDisplayName()) { ++ /** ++ * Returns true if the item can be used on the given entity, e.g. shears on sheep. ++ */ ++ public boolean itemInteractionForEntity(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, EntityLivingBase par3EntityLivingBase) { ++ if (!par1ItemStack.hasDisplayName()) { + return false; +- } else if(var3 instanceof EntityLiving) { +- EntityLiving var4 = (EntityLiving)var3; +- var4.setCustomNameTag(var1.getDisplayName()); ++ } else if (par3EntityLivingBase instanceof EntityLiving) { ++ EntityLiving var4 = (EntityLiving)par3EntityLivingBase; ++ var4.setCustomNameTag(par1ItemStack.getDisplayName()); + var4.func_110163_bv(); +- --var1.stackSize; ++ --par1ItemStack.stackSize; + return true; + } else { +- return super.itemInteractionForEntity(var1, var2, var3); ++ return super.itemInteractionForEntity(par1ItemStack, par2EntityPlayer, par3EntityLivingBase); + } + } + } diff --git a/patches/net/minecraft/src/ItemPickaxe.java.patch b/patches/net/minecraft/src/ItemPickaxe.java.patch new file mode 100644 index 0000000..52ad7ef --- /dev/null +++ b/patches/net/minecraft/src/ItemPickaxe.java.patch @@ -0,0 +1,41 @@ +--- net/minecraft/src/ItemPickaxe.java ++++ net/minecraft/src/ItemPickaxe.java +@@ -1,17 +1,26 @@ + package net.minecraft.src; + + public class ItemPickaxe extends ItemTool { +- private static Block[] blocksEffectiveAgainst = new Block[]{Block.cobblestone, Block.stoneDoubleSlab, Block.stoneSingleSlab, Block.stone, Block.sandStone, Block.cobblestoneMossy, Block.oreIron, Block.blockIron, Block.oreCoal, Block.blockGold, Block.oreGold, Block.oreDiamond, Block.blockDiamond, Block.ice, Block.netherrack, Block.oreLapis, Block.blockLapis, Block.oreRedstone, Block.oreRedstoneGlowing, Block.rail, Block.railDetector, Block.railPowered, Block.railActivator}; +- +- protected ItemPickaxe(int var1, EnumToolMaterial var2) { +- super(var1, 2.0F, var2, blocksEffectiveAgainst); +- } +- +- public boolean canHarvestBlock(Block var1) { +- return var1 == Block.obsidian ? this.toolMaterial.getHarvestLevel() == 3 : (var1 != Block.blockDiamond && var1 != Block.oreDiamond ? (var1 != Block.oreEmerald && var1 != Block.blockEmerald ? (var1 != Block.blockGold && var1 != Block.oreGold ? (var1 != Block.blockIron && var1 != Block.oreIron ? (var1 != Block.blockLapis && var1 != Block.oreLapis ? (var1 != Block.oreRedstone && var1 != Block.oreRedstoneGlowing ? (var1.blockMaterial == Material.rock ? true : (var1.blockMaterial == Material.iron ? true : var1.blockMaterial == Material.anvil)) : this.toolMaterial.getHarvestLevel() >= 2) : this.toolMaterial.getHarvestLevel() >= 1) : this.toolMaterial.getHarvestLevel() >= 1) : this.toolMaterial.getHarvestLevel() >= 2) : this.toolMaterial.getHarvestLevel() >= 2) : this.toolMaterial.getHarvestLevel() >= 2); +- } +- +- public float getStrVsBlock(ItemStack var1, Block var2) { +- return var2 == null || var2.blockMaterial != Material.iron && var2.blockMaterial != Material.anvil && var2.blockMaterial != Material.rock ? super.getStrVsBlock(var1, var2) : this.efficiencyOnProperMaterial; ++ ++ /** an array of the blocks this pickaxe is effective against */ ++ private static Block[] blocksEffectiveAgainst = new Block[] {Block.cobblestone, Block.stoneDoubleSlab, Block.stoneSingleSlab, Block.stone, Block.sandStone, Block.cobblestoneMossy, Block.oreIron, Block.blockIron, Block.oreCoal, Block.blockGold, Block.oreGold, Block.oreDiamond, Block.blockDiamond, Block.ice, Block.netherrack, Block.oreLapis, Block.blockLapis, Block.oreRedstone, Block.oreRedstoneGlowing, Block.rail, Block.railDetector, Block.railPowered, Block.railActivator}; ++ ++ protected ItemPickaxe(int par1, EnumToolMaterial par2EnumToolMaterial) { ++ super(par1, 2.0F, par2EnumToolMaterial, blocksEffectiveAgainst); ++ } ++ ++ /** ++ * Returns if the item (tool) can harvest results from the block type. ++ */ ++ public boolean canHarvestBlock(Block par1Block) { ++ return par1Block == Block.obsidian ? this.toolMaterial.getHarvestLevel() == 3 : (par1Block != Block.blockDiamond && par1Block != Block.oreDiamond ? (par1Block != Block.oreEmerald && par1Block != Block.blockEmerald ? (par1Block != Block.blockGold && par1Block != Block.oreGold ? (par1Block != Block.blockIron && par1Block != Block.oreIron ? (par1Block != Block.blockLapis && par1Block != Block.oreLapis ? (par1Block != Block.oreRedstone && par1Block != Block.oreRedstoneGlowing ? (par1Block.blockMaterial == Material.rock ? true : (par1Block.blockMaterial == Material.iron ? true : par1Block.blockMaterial == Material.anvil)) : this.toolMaterial.getHarvestLevel() >= 2) : this.toolMaterial.getHarvestLevel() >= 1) : this.toolMaterial.getHarvestLevel() >= 1) : this.toolMaterial.getHarvestLevel() >= 2) : this.toolMaterial.getHarvestLevel() >= 2) : this.toolMaterial.getHarvestLevel() >= 2); ++ } ++ ++ /** ++ * Returns the strength of the stack against a given block. 1.0F base, (Quality+1)*2 if correct blocktype, 1.5F if ++ * sword ++ */ ++ public float getStrVsBlock(ItemStack par1ItemStack, Block par2Block) { ++ return par2Block != null && (par2Block.blockMaterial == Material.iron || par2Block.blockMaterial == Material.anvil || par2Block.blockMaterial == Material.rock) ? this.efficiencyOnProperMaterial : super.getStrVsBlock(par1ItemStack, par2Block); + } + } diff --git a/patches/net/minecraft/src/ItemPiston.java.patch b/patches/net/minecraft/src/ItemPiston.java.patch new file mode 100644 index 0000000..27bfb6d --- /dev/null +++ b/patches/net/minecraft/src/ItemPiston.java.patch @@ -0,0 +1,20 @@ +--- net/minecraft/src/ItemPiston.java ++++ net/minecraft/src/ItemPiston.java +@@ -1,11 +1,14 @@ + package net.minecraft.src; + + public class ItemPiston extends ItemBlock { +- public ItemPiston(int var1) { +- super(var1); ++ public ItemPiston(int par1) { ++ super(par1); + } + +- public int getMetadata(int var1) { ++ /** ++ * Returns the metadata of the block which this Item (ItemBlock) can place ++ */ ++ public int getMetadata(int par1) { + return 7; + } + } diff --git a/patches/net/minecraft/src/ItemPotion.java.patch b/patches/net/minecraft/src/ItemPotion.java.patch new file mode 100644 index 0000000..290daf6 --- /dev/null +++ b/patches/net/minecraft/src/ItemPotion.java.patch @@ -0,0 +1,479 @@ +--- net/minecraft/src/ItemPotion.java ++++ net/minecraft/src/ItemPotion.java +@@ -10,147 +10,182 @@ + import java.util.Map.Entry; + + public class ItemPotion extends Item { +- private HashMap a = new HashMap(); +- private static final Map b = new LinkedHashMap(); ++ ++ /** maps potion damage values to lists of effect names */ ++ private HashMap effectCache = new HashMap(); ++ private static final Map field_77835_b = new LinkedHashMap(); + private Icon field_94591_c; + private Icon field_94590_d; + private Icon field_94592_ct; + +- public ItemPotion(int var1) { +- super(var1); ++ public ItemPotion(int par1) { ++ super(par1); + this.setMaxStackSize(1); + this.setHasSubtypes(true); + this.setMaxDamage(0); + this.setCreativeTab(CreativeTabs.tabBrewing); + } + +- public List getEffects(ItemStack var1) { +- if(var1.hasTagCompound() && var1.getTagCompound().hasKey("CustomPotionEffects")) { ++ /** ++ * Returns a list of potion effects for the specified itemstack. ++ */ ++ public List getEffects(ItemStack par1ItemStack) { ++ if (par1ItemStack.hasTagCompound() && par1ItemStack.getTagCompound().hasKey("CustomPotionEffects")) { + ArrayList var6 = new ArrayList(); +- NBTTagList var3 = var1.getTagCompound().getTagList("CustomPotionEffects"); ++ NBTTagList var3 = par1ItemStack.getTagCompound().getTagList("CustomPotionEffects"); + +- for(int var4 = 0; var4 < var3.tagCount(); ++var4) { ++ for (int var4 = 0; var4 < var3.tagCount(); ++var4) { + NBTTagCompound var5 = (NBTTagCompound)var3.tagAt(var4); + var6.add(PotionEffect.readCustomPotionEffectFromNBT(var5)); + } + + return var6; + } else { +- List var2 = (List)this.a.get(Integer.valueOf(var1.getItemDamage())); +- if(var2 == null) { +- var2 = PotionHelper.getPotionEffects(var1.getItemDamage(), false); +- this.a.put(Integer.valueOf(var1.getItemDamage()), var2); ++ List var2 = (List)this.effectCache.get(Integer.valueOf(par1ItemStack.getItemDamage())); ++ ++ if (var2 == null) { ++ var2 = PotionHelper.getPotionEffects(par1ItemStack.getItemDamage(), false); ++ this.effectCache.put(Integer.valueOf(par1ItemStack.getItemDamage()), var2); + } + + return var2; + } + } + +- public List getEffects(int var1) { +- List var2 = (List)this.a.get(Integer.valueOf(var1)); +- if(var2 == null) { +- var2 = PotionHelper.getPotionEffects(var1, false); +- this.a.put(Integer.valueOf(var1), var2); ++ /** ++ * Returns a list of effects for the specified potion damage value. ++ */ ++ public List getEffects(int par1) { ++ List var2 = (List)this.effectCache.get(Integer.valueOf(par1)); ++ ++ if (var2 == null) { ++ var2 = PotionHelper.getPotionEffects(par1, false); ++ this.effectCache.put(Integer.valueOf(par1), var2); + } + + return var2; + } + +- public ItemStack onEaten(ItemStack var1, World var2, EntityPlayer var3) { +- if(!var3.capabilities.isCreativeMode) { +- --var1.stackSize; ++ public ItemStack onEaten(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) { ++ if (!par3EntityPlayer.capabilities.isCreativeMode) { ++ --par1ItemStack.stackSize; + } + +- if(!var2.isRemote) { +- List var4 = this.getEffects(var1); +- if(var4 != null) { ++ if (!par2World.isRemote) { ++ List var4 = this.getEffects(par1ItemStack); ++ ++ if (var4 != null) { + Iterator var5 = var4.iterator(); + +- while(var5.hasNext()) { ++ while (var5.hasNext()) { + PotionEffect var6 = (PotionEffect)var5.next(); +- var3.addPotionEffect(new PotionEffect(var6)); ++ par3EntityPlayer.addPotionEffect(new PotionEffect(var6)); + } + } + } + +- if(!var3.capabilities.isCreativeMode) { +- if(var1.stackSize <= 0) { ++ if (!par3EntityPlayer.capabilities.isCreativeMode) { ++ if (par1ItemStack.stackSize <= 0) { + return new ItemStack(Item.glassBottle); + } + +- var3.inventory.addItemStackToInventory(new ItemStack(Item.glassBottle)); ++ par3EntityPlayer.inventory.addItemStackToInventory(new ItemStack(Item.glassBottle)); + } + +- return var1; ++ return par1ItemStack; + } + +- public int getMaxItemUseDuration(ItemStack var1) { ++ /** ++ * How long it takes to use or consume an item ++ */ ++ public int getMaxItemUseDuration(ItemStack par1ItemStack) { + return 32; + } + +- public EnumAction getItemUseAction(ItemStack var1) { ++ /** ++ * returns the action that specifies what animation to play when the items is being used ++ */ ++ public EnumAction getItemUseAction(ItemStack par1ItemStack) { + return EnumAction.drink; + } + +- public ItemStack onItemRightClick(ItemStack var1, World var2, EntityPlayer var3) { +- if(isSplash(var1.getItemDamage())) { +- if(!var3.capabilities.isCreativeMode) { +- --var1.stackSize; +- } +- +- var2.playSoundAtEntity(var3, "random.bow", 0.5F, 0.4F / (f.nextFloat() * 0.4F + 0.8F)); +- if(!var2.isRemote) { +- var2.spawnEntityInWorld(new EntityPotion(var2, var3, var1)); +- } +- +- return var1; ++ /** ++ * Called whenever this item is equipped and the right mouse button is pressed. Args: itemStack, world, entityPlayer ++ */ ++ public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) { ++ if (isSplash(par1ItemStack.getItemDamage())) { ++ if (!par3EntityPlayer.capabilities.isCreativeMode) { ++ --par1ItemStack.stackSize; ++ } ++ ++ par2World.playSoundAtEntity(par3EntityPlayer, "random.bow", 0.5F, 0.4F / (itemRand.nextFloat() * 0.4F + 0.8F)); ++ ++ if (!par2World.isRemote) { ++ par2World.spawnEntityInWorld(new EntityPotion(par2World, par3EntityPlayer, par1ItemStack)); ++ } ++ ++ return par1ItemStack; + } else { +- var3.setItemInUse(var1, this.getMaxItemUseDuration(var1)); +- return var1; ++ par3EntityPlayer.setItemInUse(par1ItemStack, this.getMaxItemUseDuration(par1ItemStack)); ++ return par1ItemStack; + } + } + +- public boolean onItemUse(ItemStack var1, EntityPlayer var2, World var3, int var4, int var5, int var6, int var7, float var8, float var9, float var10) { ++ /** ++ * Callback for item usage. If the item does something special on right clicking, he will have one of those. Return ++ * True if something happen and false if it don't. This is for ITEMS, not BLOCKS ++ */ ++ public boolean onItemUse(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, World par3World, int par4, int par5, int par6, int par7, float par8, float par9, float par10) { + return false; + } + +- public Icon getIconFromDamage(int var1) { +- return isSplash(var1) ? this.field_94591_c : this.field_94590_d; +- } +- +- public Icon getIconFromDamageForRenderPass(int var1, int var2) { +- return var2 == 0 ? this.field_94592_ct : super.getIconFromDamageForRenderPass(var1, var2); +- } +- +- public static boolean isSplash(int var0) { +- return (var0 & 16384) != 0; +- } +- +- public int getColorFromDamage(int var1) { +- return PotionHelper.func_77915_a(var1, false); +- } +- +- public int getColorFromItemStack(ItemStack var1, int var2) { +- return var2 > 0 ? 16777215 : this.getColorFromDamage(var1.getItemDamage()); ++ /** ++ * Gets an icon index based on an item's damage value ++ */ ++ public Icon getIconFromDamage(int par1) { ++ return isSplash(par1) ? this.field_94591_c : this.field_94590_d; ++ } ++ ++ /** ++ * Gets an icon index based on an item's damage value and the given render pass ++ */ ++ public Icon getIconFromDamageForRenderPass(int par1, int par2) { ++ return par2 == 0 ? this.field_94592_ct : super.getIconFromDamageForRenderPass(par1, par2); ++ } ++ ++ /** ++ * returns wether or not a potion is a throwable splash potion based on damage value ++ */ ++ public static boolean isSplash(int par0) { ++ return (par0 & 16384) != 0; ++ } ++ ++ public int getColorFromDamage(int par1) { ++ return PotionHelper.func_77915_a(par1, false); ++ } ++ ++ public int getColorFromItemStack(ItemStack par1ItemStack, int par2) { ++ return par2 > 0 ? 16777215 : this.getColorFromDamage(par1ItemStack.getItemDamage()); + } + + public boolean requiresMultipleRenderPasses() { + return true; + } + +- public boolean isEffectInstant(int var1) { +- List var2 = this.getEffects(var1); +- if(var2 != null && !var2.isEmpty()) { ++ public boolean isEffectInstant(int par1) { ++ List var2 = this.getEffects(par1); ++ ++ if (var2 != null && !var2.isEmpty()) { + Iterator var3 = var2.iterator(); +- + PotionEffect var4; ++ + do { +- if(!var3.hasNext()) { ++ if (!var3.hasNext()) { + return false; + } + + var4 = (PotionEffect)var3.next(); +- } while(!Potion.potionTypes[var4.getPotionID()].isInstant()); ++ } while (!Potion.potionTypes[var4.getPotionID()].isInstant()); + + return true; + } else { +@@ -158,45 +193,52 @@ + } + } + +- public String getItemDisplayName(ItemStack var1) { +- if(var1.getItemDamage() == 0) { ++ public String getItemDisplayName(ItemStack par1ItemStack) { ++ if (par1ItemStack.getItemDamage() == 0) { + return StatCollector.translateToLocal("item.emptyPotion.name").trim(); + } else { + String var2 = ""; +- if(isSplash(var1.getItemDamage())) { ++ ++ if (isSplash(par1ItemStack.getItemDamage())) { + var2 = StatCollector.translateToLocal("potion.prefix.grenade").trim() + " "; + } + +- List var3 = Item.potion.getEffects(var1); ++ List var3 = Item.potion.getEffects(par1ItemStack); + String var4; +- if(var3 != null && !var3.isEmpty()) { ++ ++ if (var3 != null && !var3.isEmpty()) { + var4 = ((PotionEffect)var3.get(0)).getEffectName(); + var4 = var4 + ".postfix"; + return var2 + StatCollector.translateToLocal(var4).trim(); + } else { +- var4 = PotionHelper.func_77905_c(var1.getItemDamage()); +- return StatCollector.translateToLocal(var4).trim() + " " + super.getItemDisplayName(var1); ++ var4 = PotionHelper.func_77905_c(par1ItemStack.getItemDamage()); ++ return StatCollector.translateToLocal(var4).trim() + " " + super.getItemDisplayName(par1ItemStack); + } + } + } + +- public void addInformation(ItemStack var1, EntityPlayer var2, List var3, boolean var4) { +- if(var1.getItemDamage() != 0) { +- List var5 = Item.potion.getEffects(var1); ++ /** ++ * allows items to add custom lines of information to the mouseover description ++ */ ++ public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4) { ++ if (par1ItemStack.getItemDamage() != 0) { ++ List var5 = Item.potion.getEffects(par1ItemStack); + HashMultimap var6 = HashMultimap.create(); + Iterator var16; +- if(var5 != null && !var5.isEmpty()) { ++ ++ if (var5 != null && !var5.isEmpty()) { + var16 = var5.iterator(); + +- while(var16.hasNext()) { ++ while (var16.hasNext()) { + PotionEffect var8 = (PotionEffect)var16.next(); + String var9 = StatCollector.translateToLocal(var8.getEffectName()).trim(); + Potion var10 = Potion.potionTypes[var8.getPotionID()]; + Map var11 = var10.func_111186_k(); +- if(var11 != null && var11.size() > 0) { ++ ++ if (var11 != null && var11.size() > 0) { + Iterator var12 = var11.entrySet().iterator(); + +- while(var12.hasNext()) { ++ while (var12.hasNext()) { + Entry var13 = (Entry)var12.next(); + AttributeModifier var14 = (AttributeModifier)var13.getValue(); + AttributeModifier var15 = new AttributeModifier(var14.getName(), var10.func_111183_a(var8.getAmplifier(), var14), var14.getOperation()); +@@ -204,106 +246,112 @@ + } + } + +- if(var8.getAmplifier() > 0) { ++ if (var8.getAmplifier() > 0) { + var9 = var9 + " " + StatCollector.translateToLocal("potion.potency." + var8.getAmplifier()).trim(); + } + +- if(var8.getDuration() > 20) { ++ if (var8.getDuration() > 20) { + var9 = var9 + " (" + Potion.getDurationString(var8) + ")"; + } + +- if(var10.isBadEffect()) { +- var3.add(EnumChatFormatting.RED + var9); ++ if (var10.isBadEffect()) { ++ par3List.add(EnumChatFormatting.RED + var9); + } else { +- var3.add(EnumChatFormatting.GRAY + var9); ++ par3List.add(EnumChatFormatting.GRAY + var9); + } + } + } else { + String var7 = StatCollector.translateToLocal("potion.empty").trim(); +- var3.add(EnumChatFormatting.GRAY + var7); ++ par3List.add(EnumChatFormatting.GRAY + var7); + } + +- if(!var6.isEmpty()) { +- var3.add(""); +- var3.add(EnumChatFormatting.DARK_PURPLE + StatCollector.translateToLocal("potion.effects.whenDrank")); ++ if (!var6.isEmpty()) { ++ par3List.add(""); ++ par3List.add(EnumChatFormatting.DARK_PURPLE + StatCollector.translateToLocal("potion.effects.whenDrank")); + var16 = var6.entries().iterator(); + +- while(var16.hasNext()) { ++ while (var16.hasNext()) { + Entry var17 = (Entry)var16.next(); + AttributeModifier var19 = (AttributeModifier)var17.getValue(); + double var18 = var19.getAmount(); + double var20; +- if(var19.getOperation() != 1 && var19.getOperation() != 2) { ++ ++ if (var19.getOperation() != 1 && var19.getOperation() != 2) { + var20 = var19.getAmount(); + } else { + var20 = var19.getAmount() * 100.0D; + } + +- if(var18 > 0.0D) { +- var3.add(EnumChatFormatting.BLUE + StatCollector.translateToLocalFormatted("attribute.modifier.plus." + var19.getOperation(), new Object[]{ItemStack.a.format(var20), StatCollector.translateToLocal("attribute.name." + (String)var17.getKey())})); +- } else if(var18 < 0.0D) { ++ if (var18 > 0.0D) { ++ par3List.add(EnumChatFormatting.BLUE + StatCollector.translateToLocalFormatted("attribute.modifier.plus." + var19.getOperation(), new Object[] {ItemStack.field_111284_a.format(var20), StatCollector.translateToLocal("attribute.name." + (String)var17.getKey())})); ++ } else if (var18 < 0.0D) { + var20 *= -1.0D; +- var3.add(EnumChatFormatting.RED + StatCollector.translateToLocalFormatted("attribute.modifier.take." + var19.getOperation(), new Object[]{ItemStack.a.format(var20), StatCollector.translateToLocal("attribute.name." + (String)var17.getKey())})); ++ par3List.add(EnumChatFormatting.RED + StatCollector.translateToLocalFormatted("attribute.modifier.take." + var19.getOperation(), new Object[] {ItemStack.field_111284_a.format(var20), StatCollector.translateToLocal("attribute.name." + (String)var17.getKey())})); + } + } + } +- + } + } + +- public boolean hasEffect(ItemStack var1) { +- List var2 = this.getEffects(var1); ++ public boolean hasEffect(ItemStack par1ItemStack) { ++ List var2 = this.getEffects(par1ItemStack); + return var2 != null && !var2.isEmpty(); + } + +- public void getSubItems(int var1, CreativeTabs var2, List var3) { +- super.getSubItems(var1, var2, var3); ++ /** ++ * returns a list of items with the same ID, but different meta (eg: dye returns 16 items) ++ */ ++ public void getSubItems(int par1, CreativeTabs par2CreativeTabs, List par3List) { ++ super.getSubItems(par1, par2CreativeTabs, par3List); + int var5; +- if(b.isEmpty()) { +- for(int var4 = 0; var4 <= 15; ++var4) { +- for(var5 = 0; var5 <= 1; ++var5) { ++ ++ if (field_77835_b.isEmpty()) { ++ for (int var4 = 0; var4 <= 15; ++var4) { ++ for (var5 = 0; var5 <= 1; ++var5) { + int var6; +- if(var5 == 0) { ++ ++ if (var5 == 0) { + var6 = var4 | 8192; + } else { + var6 = var4 | 16384; + } + +- for(int var7 = 0; var7 <= 2; ++var7) { ++ for (int var7 = 0; var7 <= 2; ++var7) { + int var8 = var6; +- if(var7 != 0) { +- if(var7 == 1) { ++ ++ if (var7 != 0) { ++ if (var7 == 1) { + var8 = var6 | 32; +- } else if(var7 == 2) { ++ } else if (var7 == 2) { + var8 = var6 | 64; + } + } + + List var9 = PotionHelper.getPotionEffects(var8, false); +- if(var9 != null && !var9.isEmpty()) { +- b.put(var9, Integer.valueOf(var8)); ++ ++ if (var9 != null && !var9.isEmpty()) { ++ field_77835_b.put(var9, Integer.valueOf(var8)); + } + } + } + } + } + +- Iterator var10 = b.values().iterator(); ++ Iterator var10 = field_77835_b.values().iterator(); + +- while(var10.hasNext()) { ++ while (var10.hasNext()) { + var5 = ((Integer)var10.next()).intValue(); +- var3.add(new ItemStack(var1, 1, var5)); ++ par3List.add(new ItemStack(par1, 1, var5)); + } +- +- } +- +- public void registerIcons(IconRegister var1) { +- this.field_94590_d = var1.registerIcon(this.getIconString() + "_" + "bottle_drinkable"); +- this.field_94591_c = var1.registerIcon(this.getIconString() + "_" + "bottle_splash"); +- this.field_94592_ct = var1.registerIcon(this.getIconString() + "_" + "overlay"); +- } +- +- public static Icon func_94589_d(String var0) { +- return var0.equals("bottle_drinkable") ? Item.potion.field_94590_d : (var0.equals("bottle_splash") ? Item.potion.field_94591_c : (var0.equals("overlay") ? Item.potion.field_94592_ct : null)); ++ } ++ ++ public void registerIcons(IconRegister par1IconRegister) { ++ this.field_94590_d = par1IconRegister.registerIcon(this.getIconString() + "_" + "bottle_drinkable"); ++ this.field_94591_c = par1IconRegister.registerIcon(this.getIconString() + "_" + "bottle_splash"); ++ this.field_94592_ct = par1IconRegister.registerIcon(this.getIconString() + "_" + "overlay"); ++ } ++ ++ public static Icon func_94589_d(String par0Str) { ++ return par0Str.equals("bottle_drinkable") ? Item.potion.field_94590_d : (par0Str.equals("bottle_splash") ? Item.potion.field_94591_c : (par0Str.equals("overlay") ? Item.potion.field_94592_ct : null)); + } + } diff --git a/patches/net/minecraft/src/ItemRecord.java.patch b/patches/net/minecraft/src/ItemRecord.java.patch new file mode 100644 index 0000000..3f2eb50 --- /dev/null +++ b/patches/net/minecraft/src/ItemRecord.java.patch @@ -0,0 +1,95 @@ +--- net/minecraft/src/ItemRecord.java ++++ net/minecraft/src/ItemRecord.java +@@ -5,29 +5,40 @@ + import java.util.Map; + + public class ItemRecord extends Item { +- private static final Map b = new HashMap(); +- public final String a; +- +- protected ItemRecord(int var1, String var2) { +- super(var1); +- this.a = var2; ++ ++ /** List of all record items and their names. */ ++ private static final Map records = new HashMap(); ++ ++ /** The name of the record. */ ++ public final String recordName; ++ ++ protected ItemRecord(int par1, String par2Str) { ++ super(par1); ++ this.recordName = par2Str; + this.maxStackSize = 1; + this.setCreativeTab(CreativeTabs.tabMisc); +- b.put(var2, this); ++ records.put(par2Str, this); + } + +- public Icon getIconFromDamage(int var1) { ++ /** ++ * Gets an icon index based on an item's damage value ++ */ ++ public Icon getIconFromDamage(int par1) { + return this.itemIcon; + } + +- public boolean onItemUse(ItemStack var1, EntityPlayer var2, World var3, int var4, int var5, int var6, int var7, float var8, float var9, float var10) { +- if(var3.getBlockId(var4, var5, var6) == Block.jukebox.blockID && var3.getBlockMetadata(var4, var5, var6) == 0) { +- if(var3.isRemote) { ++ /** ++ * Callback for item usage. If the item does something special on right clicking, he will have one of those. Return ++ * True if something happen and false if it don't. This is for ITEMS, not BLOCKS ++ */ ++ public boolean onItemUse(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, World par3World, int par4, int par5, int par6, int par7, float par8, float par9, float par10) { ++ if (par3World.getBlockId(par4, par5, par6) == Block.jukebox.blockID && par3World.getBlockMetadata(par4, par5, par6) == 0) { ++ if (par3World.isRemote) { + return true; + } else { +- ((BlockJukeBox)Block.jukebox).insertRecord(var3, var4, var5, var6, var1); +- var3.playAuxSFXAtEntity((EntityPlayer)null, 1005, var4, var5, var6, this.itemID); +- --var1.stackSize; ++ ((BlockJukeBox)Block.jukebox).insertRecord(par3World, par4, par5, par6, par1ItemStack); ++ par3World.playAuxSFXAtEntity((EntityPlayer)null, 1005, par4, par5, par6, this.itemID); ++ --par1ItemStack.stackSize; + return true; + } + } else { +@@ -35,19 +46,31 @@ + } + } + +- public void addInformation(ItemStack var1, EntityPlayer var2, List var3, boolean var4) { +- var3.add(this.getRecordTitle()); ++ /** ++ * allows items to add custom lines of information to the mouseover description ++ */ ++ public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4) { ++ par3List.add(this.getRecordTitle()); + } + ++ /** ++ * Return the title for this record. ++ */ + public String getRecordTitle() { +- return "C418 - " + this.a; ++ return "C418 - " + this.recordName; + } + +- public EnumRarity getRarity(ItemStack var1) { ++ /** ++ * Return an item rarity from EnumRarity ++ */ ++ public EnumRarity getRarity(ItemStack par1ItemStack) { + return EnumRarity.rare; + } + +- public static ItemRecord getRecord(String var0) { +- return (ItemRecord)b.get(var0); ++ /** ++ * Return the record item corresponding to the given name. ++ */ ++ public static ItemRecord getRecord(String par0Str) { ++ return (ItemRecord)records.get(par0Str); + } + } diff --git a/patches/net/minecraft/src/ItemRedstone.java.patch b/patches/net/minecraft/src/ItemRedstone.java.patch new file mode 100644 index 0000000..3866faa --- /dev/null +++ b/patches/net/minecraft/src/ItemRedstone.java.patch @@ -0,0 +1,88 @@ +--- net/minecraft/src/ItemRedstone.java ++++ net/minecraft/src/ItemRedstone.java +@@ -1,48 +1,52 @@ + package net.minecraft.src; + + public class ItemRedstone extends Item { +- public ItemRedstone(int var1) { +- super(var1); ++ public ItemRedstone(int par1) { ++ super(par1); + this.setCreativeTab(CreativeTabs.tabRedstone); + } + +- public boolean onItemUse(ItemStack var1, EntityPlayer var2, World var3, int var4, int var5, int var6, int var7, float var8, float var9, float var10) { +- if(var3.getBlockId(var4, var5, var6) != Block.snow.blockID) { +- if(var7 == 0) { +- --var5; +- } +- +- if(var7 == 1) { +- ++var5; +- } +- +- if(var7 == 2) { +- --var6; +- } +- +- if(var7 == 3) { +- ++var6; +- } +- +- if(var7 == 4) { +- --var4; +- } +- +- if(var7 == 5) { +- ++var4; +- } +- +- if(!var3.isAirBlock(var4, var5, var6)) { ++ /** ++ * Callback for item usage. If the item does something special on right clicking, he will have one of those. Return ++ * True if something happen and false if it don't. This is for ITEMS, not BLOCKS ++ */ ++ public boolean onItemUse(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, World par3World, int par4, int par5, int par6, int par7, float par8, float par9, float par10) { ++ if (par3World.getBlockId(par4, par5, par6) != Block.snow.blockID) { ++ if (par7 == 0) { ++ --par5; ++ } ++ ++ if (par7 == 1) { ++ ++par5; ++ } ++ ++ if (par7 == 2) { ++ --par6; ++ } ++ ++ if (par7 == 3) { ++ ++par6; ++ } ++ ++ if (par7 == 4) { ++ --par4; ++ } ++ ++ if (par7 == 5) { ++ ++par4; ++ } ++ ++ if (!par3World.isAirBlock(par4, par5, par6)) { + return false; + } + } + +- if(!var2.canPlayerEdit(var4, var5, var6, var7, var1)) { ++ if (!par2EntityPlayer.canPlayerEdit(par4, par5, par6, par7, par1ItemStack)) { + return false; + } else { +- if(Block.redstoneWire.canPlaceBlockAt(var3, var4, var5, var6)) { +- --var1.stackSize; +- var3.setBlock(var4, var5, var6, Block.redstoneWire.blockID); ++ if (Block.redstoneWire.canPlaceBlockAt(par3World, par4, par5, par6)) { ++ --par1ItemStack.stackSize; ++ par3World.setBlock(par4, par5, par6, Block.redstoneWire.blockID); + } + + return true; diff --git a/patches/net/minecraft/src/ItemReed.java.patch b/patches/net/minecraft/src/ItemReed.java.patch new file mode 100644 index 0000000..ec99f8e --- /dev/null +++ b/patches/net/minecraft/src/ItemReed.java.patch @@ -0,0 +1,110 @@ +--- net/minecraft/src/ItemReed.java ++++ net/minecraft/src/ItemReed.java +@@ -1,59 +1,67 @@ + package net.minecraft.src; + + public class ItemReed extends Item { ++ ++ /** The ID of the block the reed will spawn when used from inventory bar. */ + private int spawnID; + +- public ItemReed(int var1, Block var2) { +- super(var1); +- this.spawnID = var2.blockID; ++ public ItemReed(int par1, Block par2Block) { ++ super(par1); ++ this.spawnID = par2Block.blockID; + } + +- public boolean onItemUse(ItemStack var1, EntityPlayer var2, World var3, int var4, int var5, int var6, int var7, float var8, float var9, float var10) { +- int var11 = var3.getBlockId(var4, var5, var6); +- if(var11 == Block.snow.blockID && (var3.getBlockMetadata(var4, var5, var6) & 7) < 1) { +- var7 = 1; +- } else if(var11 != Block.vine.blockID && var11 != Block.tallGrass.blockID && var11 != Block.deadBush.blockID) { +- if(var7 == 0) { +- --var5; +- } +- +- if(var7 == 1) { +- ++var5; +- } +- +- if(var7 == 2) { +- --var6; +- } +- +- if(var7 == 3) { +- ++var6; +- } +- +- if(var7 == 4) { +- --var4; +- } +- +- if(var7 == 5) { +- ++var4; ++ /** ++ * Callback for item usage. If the item does something special on right clicking, he will have one of those. Return ++ * True if something happen and false if it don't. This is for ITEMS, not BLOCKS ++ */ ++ public boolean onItemUse(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, World par3World, int par4, int par5, int par6, int par7, float par8, float par9, float par10) { ++ int var11 = par3World.getBlockId(par4, par5, par6); ++ ++ if (var11 == Block.snow.blockID && (par3World.getBlockMetadata(par4, par5, par6) & 7) < 1) { ++ par7 = 1; ++ } else if (var11 != Block.vine.blockID && var11 != Block.tallGrass.blockID && var11 != Block.deadBush.blockID) { ++ if (par7 == 0) { ++ --par5; ++ } ++ ++ if (par7 == 1) { ++ ++par5; ++ } ++ ++ if (par7 == 2) { ++ --par6; ++ } ++ ++ if (par7 == 3) { ++ ++par6; ++ } ++ ++ if (par7 == 4) { ++ --par4; ++ } ++ ++ if (par7 == 5) { ++ ++par4; + } + } + +- if(!var2.canPlayerEdit(var4, var5, var6, var7, var1)) { ++ if (!par2EntityPlayer.canPlayerEdit(par4, par5, par6, par7, par1ItemStack)) { + return false; +- } else if(var1.stackSize == 0) { ++ } else if (par1ItemStack.stackSize == 0) { + return false; + } else { +- if(var3.canPlaceEntityOnSide(this.spawnID, var4, var5, var6, false, var7, (Entity)null, var1)) { ++ if (par3World.canPlaceEntityOnSide(this.spawnID, par4, par5, par6, false, par7, (Entity)null, par1ItemStack)) { + Block var12 = Block.blocksList[this.spawnID]; +- int var13 = var12.onBlockPlaced(var3, var4, var5, var6, var7, var8, var9, var10, 0); +- if(var3.setBlock(var4, var5, var6, this.spawnID, var13, 3)) { +- if(var3.getBlockId(var4, var5, var6) == this.spawnID) { +- Block.blocksList[this.spawnID].onBlockPlacedBy(var3, var4, var5, var6, var2, var1); +- Block.blocksList[this.spawnID].onPostBlockPlaced(var3, var4, var5, var6, var13); ++ int var13 = var12.onBlockPlaced(par3World, par4, par5, par6, par7, par8, par9, par10, 0); ++ ++ if (par3World.setBlock(par4, par5, par6, this.spawnID, var13, 3)) { ++ if (par3World.getBlockId(par4, par5, par6) == this.spawnID) { ++ Block.blocksList[this.spawnID].onBlockPlacedBy(par3World, par4, par5, par6, par2EntityPlayer, par1ItemStack); ++ Block.blocksList[this.spawnID].onPostBlockPlaced(par3World, par4, par5, par6, var13); + } + +- var3.playSoundEffect((double)((float)var4 + 0.5F), (double)((float)var5 + 0.5F), (double)((float)var6 + 0.5F), var12.stepSound.getPlaceSound(), (var12.stepSound.getVolume() + 1.0F) / 2.0F, var12.stepSound.getPitch() * 0.8F); +- --var1.stackSize; ++ par3World.playSoundEffect((double)((float)par4 + 0.5F), (double)((float)par5 + 0.5F), (double)((float)par6 + 0.5F), var12.stepSound.getPlaceSound(), (var12.stepSound.getVolume() + 1.0F) / 2.0F, var12.stepSound.getPitch() * 0.8F); ++ --par1ItemStack.stackSize; + } + } + diff --git a/patches/net/minecraft/src/ItemRenderer.java.patch b/patches/net/minecraft/src/ItemRenderer.java.patch new file mode 100644 index 0000000..0e6e50a --- /dev/null +++ b/patches/net/minecraft/src/ItemRenderer.java.patch @@ -0,0 +1,848 @@ +--- net/minecraft/src/ItemRenderer.java ++++ net/minecraft/src/ItemRenderer.java +@@ -1,179 +1,264 @@ + package net.minecraft.src; + ++import java.util.Random; ++ + import org.lwjgl.opengl.GL11; + import org.lwjgl.opengl.GL12; ++import org.newdawn.slick.opengl.Texture; ++ ++import com.prupe.mcpatcher.cc.ColorizeBlock; ++ ++import org.spoutcraft.api.block.design.BlockDesign; ++import org.spoutcraft.api.material.MaterialData; ++import org.spoutcraft.client.SpoutClient; ++import org.spoutcraft.client.io.CustomTextureManager; ++ ++// Spout Start ++//Spout End + + public class ItemRenderer { + private static final ResourceLocation RES_ITEM_GLINT = new ResourceLocation("textures/misc/enchanted_item_glint.png"); + private static final ResourceLocation RES_MAP_BACKGROUND = new ResourceLocation("textures/map/map_background.png"); + private static final ResourceLocation RES_UNDERWATER_OVERLAY = new ResourceLocation("textures/misc/underwater.png"); ++ ++ /** A reference to the Minecraft object. */ + private Minecraft mc; + private ItemStack itemToRender; ++ ++ /** ++ * How far the current item has been equipped (0 disequipped and 1 fully up) ++ */ + private float equippedProgress; + private float prevEquippedProgress; ++ ++ /** Instance of RenderBlocks. */ + private RenderBlocks renderBlocksInstance = new RenderBlocks(); + public final MapItemRenderer mapItemRenderer; ++ ++ /** The index of the currently held item (0-8, or -1 if not yet updated) */ + private int equippedItemSlot = -1; ++ // Spout Start ++ private Random rand = new Random(); ++ // Spout End + +- public ItemRenderer(Minecraft var1) { +- this.mc = var1; +- this.mapItemRenderer = new MapItemRenderer(var1.gameSettings, var1.getTextureManager()); ++ public ItemRenderer(Minecraft par1Minecraft) { ++ this.mc = par1Minecraft; ++ this.mapItemRenderer = new MapItemRenderer(par1Minecraft.gameSettings, par1Minecraft.getTextureManager()); + } + +- public void renderItem(EntityLivingBase var1, ItemStack var2, int var3) { ++ /** ++ * Renders the item stack for being in an entity's hand Args: itemStack ++ */ ++ public void renderItem(EntityLivingBase par1EntityLivingBase, ItemStack par2ItemStack, int par3) { + GL11.glPushMatrix(); +- TextureManager var4 = this.mc.getTextureManager(); +- if(var2.getItemSpriteNumber() == 0 && var2.itemID < Block.blocksList.length && Block.blocksList[var2.itemID] != null && RenderBlocks.renderItemIn3d(Block.blocksList[var2.itemID].getRenderType())) { +- var4.bindTexture(var4.getResourceLocation(0)); +- this.renderBlocksInstance.renderBlockAsItem(Block.blocksList[var2.itemID], var2.getItemDamage(), 1.0F); ++ TextureManager var99 = this.mc.getTextureManager(); ++ // Spout Start ++ Block var4block = Block.blocksList[par2ItemStack.itemID]; ++ boolean custom = false; ++ BlockDesign design = null; ++ if (par2ItemStack.itemID == 318) { ++ org.spoutcraft.api.material.CustomItem item = MaterialData.getCustomItem(par2ItemStack.getItemDamage()); ++ if (item != null) { ++ String textureURI = item.getTexture(); ++ if (textureURI == null) { ++ org.spoutcraft.api.material.CustomBlock block = MaterialData.getCustomBlock(par2ItemStack.getItemDamage()); ++ design = block != null ? block.getBlockDesign() : null; ++ textureURI = design != null ? design.getTextureURL() : null; ++ } ++ if (textureURI != null) { ++ Texture texture = CustomTextureManager.getTextureFromUrl(item.getAddon(), textureURI); ++ if (texture != null) { ++ SpoutClient.getHandle().renderEngine.bindTexture(texture.getTextureID()); ++ custom = true; ++ } ++ } ++ } ++ } ++ ++ if (!custom) { ++ if (par2ItemStack.itemID < 256) { ++ this.mc.getTextureManager().bindTexture(TextureMap.locationBlocksTexture); ++ } else { ++ this.mc.getTextureManager().bindTexture(TextureMap.locationItemsTexture); ++ } ++ } ++ ++ if (design != null) { ++ GL11.glDisable(GL11.GL_LIGHTING); ++ design.renderItemstack(null, -0.5F, -0.5F, -0.5F, 0, 1F, rand); ++ GL11.glEnable(GL11.GL_LIGHTING); ++ } ++ else if(var4block != null && RenderBlocks.renderItemIn3d(var4block.getRenderType())) { ++ this.renderBlocksInstance.renderBlockAsItem(Block.blocksList[par2ItemStack.itemID], par2ItemStack.getItemDamage(), 1.0F); + } else { +- Icon var5 = var1.getItemIcon(var2, var3); +- if(var5 == null) { ++ Tessellator var5 = Tessellator.instance; ++ ++ Icon var4 = par1EntityLivingBase.getItemIcon(par2ItemStack, par3); ++ if (var4 == null) { + GL11.glPopMatrix(); + return; + } + +- var4.bindTexture(var4.getResourceLocation(var2.getItemSpriteNumber())); +- Tessellator var6 = Tessellator.instance; +- float var7 = var5.getMinU(); +- float var8 = var5.getMaxU(); +- float var9 = var5.getMinV(); +- float var10 = var5.getMaxV(); +- float var11 = 0.0F; +- float var12 = 0.3F; ++ float var6 = var4.getMinU(); ++ float var7 = var4.getMaxU(); ++ float var8 = var4.getMinV(); ++ float var9 = var4.getMaxV(); ++ float var10 = 0.0F; ++ float var11 = 0.3F; ++ if (custom){ ++ var6 = 0; ++ var7 = 1; ++ var8 = 1; ++ var9 = 0; ++ } ++ // Spout end ++ //ToDo: may need this ++ //var99.bindTexture(var4.getResourceLocation(par2ItemStack.getItemSpriteNumber())); + GL11.glEnable(GL12.GL_RESCALE_NORMAL); +- GL11.glTranslatef(-var11, -var12, 0.0F); +- float var13 = 1.5F; +- GL11.glScalef(var13, var13, var13); ++ GL11.glTranslatef(-var10, -var11, 0.0F); ++ float var12 = 1.5F; ++ GL11.glScalef(var12, var12, var12); + GL11.glRotatef(50.0F, 0.0F, 1.0F, 0.0F); + GL11.glRotatef(335.0F, 0.0F, 0.0F, 1.0F); +- GL11.glTranslatef(-(15.0F / 16.0F), -(1.0F / 16.0F), 0.0F); +- renderItemIn2D(var6, var8, var9, var7, var10, var5.getIconWidth(), var5.getIconHeight(), 1.0F / 16.0F); +- if(var2.hasEffect() && var3 == 0) { ++ GL11.glTranslatef(-0.9375F, -0.0625F, 0.0F); ++ ++ if (par2ItemStack != null) { ++ ColorizeBlock.colorizeWaterBlockGL(par2ItemStack.itemID); ++ } ++ ++ renderItemIn2D(var5, var7, var8, var6, var9, var4.getIconWidth(), var4.getIconHeight(), 0.0625F); ++ ++ if (par2ItemStack != null && par2ItemStack.hasEffect() && par3 == 0) { + GL11.glDepthFunc(GL11.GL_EQUAL); + GL11.glDisable(GL11.GL_LIGHTING); +- var4.bindTexture(RES_ITEM_GLINT); ++ var99.bindTexture(RES_ITEM_GLINT); + GL11.glEnable(GL11.GL_BLEND); + GL11.glBlendFunc(GL11.GL_SRC_COLOR, GL11.GL_ONE); +- float var14 = 0.76F; +- GL11.glColor4f(0.5F * var14, 0.25F * var14, 0.8F * var14, 1.0F); ++ float var13 = 0.76F; ++ GL11.glColor4f(0.5F * var13, 0.25F * var13, 0.8F * var13, 1.0F); + GL11.glMatrixMode(GL11.GL_TEXTURE); + GL11.glPushMatrix(); +- float var15 = 2.0F / 16.0F; +- GL11.glScalef(var15, var15, var15); +- float var16 = (float)(Minecraft.getSystemTime() % 3000L) / 3000.0F * 8.0F; +- GL11.glTranslatef(var16, 0.0F, 0.0F); ++ float var14 = 0.125F; ++ GL11.glScalef(var14, var14, var14); ++ float var15 = (float)(Minecraft.getSystemTime() % 3000L) / 3000.0F * 8.0F; ++ GL11.glTranslatef(var15, 0.0F, 0.0F); + GL11.glRotatef(-50.0F, 0.0F, 0.0F, 1.0F); +- renderItemIn2D(var6, 0.0F, 0.0F, 1.0F, 1.0F, 256, 256, 1.0F / 16.0F); ++ renderItemIn2D(var5, 0.0F, 0.0F, 1.0F, 1.0F, 256, 256, 0.0625F); + GL11.glPopMatrix(); + GL11.glPushMatrix(); +- GL11.glScalef(var15, var15, var15); +- var16 = (float)(Minecraft.getSystemTime() % 4873L) / 4873.0F * 8.0F; +- GL11.glTranslatef(-var16, 0.0F, 0.0F); ++ GL11.glScalef(var14, var14, var14); ++ var15 = (float)(Minecraft.getSystemTime() % 4873L) / 4873.0F * 8.0F; ++ GL11.glTranslatef(-var15, 0.0F, 0.0F); + GL11.glRotatef(10.0F, 0.0F, 0.0F, 1.0F); +- renderItemIn2D(var6, 0.0F, 0.0F, 1.0F, 1.0F, 256, 256, 1.0F / 16.0F); ++ renderItemIn2D(var5, 0.0F, 0.0F, 1.0F, 1.0F, 256, 256, 0.0625F); + GL11.glPopMatrix(); + GL11.glMatrixMode(GL11.GL_MODELVIEW); + GL11.glDisable(GL11.GL_BLEND); + GL11.glEnable(GL11.GL_LIGHTING); + GL11.glDepthFunc(GL11.GL_LEQUAL); + } +- + GL11.glDisable(GL12.GL_RESCALE_NORMAL); + } + + GL11.glPopMatrix(); + } + +- public static void renderItemIn2D(Tessellator var0, float var1, float var2, float var3, float var4, int var5, int var6, float var7) { +- var0.startDrawingQuads(); +- var0.setNormal(0.0F, 0.0F, 1.0F); +- var0.addVertexWithUV(0.0D, 0.0D, 0.0D, (double)var1, (double)var4); +- var0.addVertexWithUV(1.0D, 0.0D, 0.0D, (double)var3, (double)var4); +- var0.addVertexWithUV(1.0D, 1.0D, 0.0D, (double)var3, (double)var2); +- var0.addVertexWithUV(0.0D, 1.0D, 0.0D, (double)var1, (double)var2); +- var0.draw(); +- var0.startDrawingQuads(); +- var0.setNormal(0.0F, 0.0F, -1.0F); +- var0.addVertexWithUV(0.0D, 1.0D, (double)(0.0F - var7), (double)var1, (double)var2); +- var0.addVertexWithUV(1.0D, 1.0D, (double)(0.0F - var7), (double)var3, (double)var2); +- var0.addVertexWithUV(1.0D, 0.0D, (double)(0.0F - var7), (double)var3, (double)var4); +- var0.addVertexWithUV(0.0D, 0.0D, (double)(0.0F - var7), (double)var1, (double)var4); +- var0.draw(); +- float var8 = 0.5F * (var1 - var3) / (float)var5; +- float var9 = 0.5F * (var4 - var2) / (float)var6; +- var0.startDrawingQuads(); +- var0.setNormal(-1.0F, 0.0F, 0.0F); +- ++ // MCPatcher Start ++ /** ++ * Renders an item held in hand as a 2D texture with thickness ++ */ ++ public static void renderItemIn2D(Tessellator par0Tessellator, float par1, float par2, float par3, float par4, int par5, int par6, float par7) { ++ par0Tessellator.startDrawingQuads(); ++ par0Tessellator.setNormal(0.0F, 0.0F, 1.0F); ++ par0Tessellator.addVertexWithUV(0.0D, 0.0D, 0.0D, (double)par1, (double)par4); ++ par0Tessellator.addVertexWithUV(1.0D, 0.0D, 0.0D, (double)par3, (double)par4); ++ par0Tessellator.addVertexWithUV(1.0D, 1.0D, 0.0D, (double)par3, (double)par2); ++ par0Tessellator.addVertexWithUV(0.0D, 1.0D, 0.0D, (double)par1, (double)par2); ++ par0Tessellator.draw(); ++ par0Tessellator.startDrawingQuads(); ++ par0Tessellator.setNormal(0.0F, 0.0F, -1.0F); ++ par0Tessellator.addVertexWithUV(0.0D, 1.0D, (double)(0.0F - par7), (double)par1, (double)par2); ++ par0Tessellator.addVertexWithUV(1.0D, 1.0D, (double)(0.0F - par7), (double)par3, (double)par2); ++ par0Tessellator.addVertexWithUV(1.0D, 0.0D, (double)(0.0F - par7), (double)par3, (double)par4); ++ par0Tessellator.addVertexWithUV(0.0D, 0.0D, (double)(0.0F - par7), (double)par1, (double)par4); ++ par0Tessellator.draw(); ++ float var8 = 0.5F * (par1 - par3) / (float)par5; ++ float var9 = 0.5F * (par4 - par2) / (float)par6; ++ par0Tessellator.startDrawingQuads(); ++ par0Tessellator.setNormal(-1.0F, 0.0F, 0.0F); + int var10; + float var11; + float var12; +- for(var10 = 0; var10 < var5; ++var10) { +- var11 = (float)var10 / (float)var5; +- var12 = var1 + (var3 - var1) * var11 - var8; +- var0.addVertexWithUV((double)var11, 0.0D, (double)(0.0F - var7), (double)var12, (double)var4); +- var0.addVertexWithUV((double)var11, 0.0D, 0.0D, (double)var12, (double)var4); +- var0.addVertexWithUV((double)var11, 1.0D, 0.0D, (double)var12, (double)var2); +- var0.addVertexWithUV((double)var11, 1.0D, (double)(0.0F - var7), (double)var12, (double)var2); ++ ++ for (var10 = 0; var10 < par5; ++var10) { ++ var11 = (float)var10 / (float)par5; ++ var12 = par1 + (par3 - par1) * var11 - var8; ++ par0Tessellator.addVertexWithUV((double)var11, 0.0D, (double)(0.0F - par7), (double)var12, (double)par4); ++ par0Tessellator.addVertexWithUV((double)var11, 0.0D, 0.0D, (double)var12, (double)par4); ++ par0Tessellator.addVertexWithUV((double)var11, 1.0D, 0.0D, (double)var12, (double)par2); ++ par0Tessellator.addVertexWithUV((double)var11, 1.0D, (double)(0.0F - par7), (double)var12, (double)par2); + } + +- var0.draw(); +- var0.startDrawingQuads(); +- var0.setNormal(1.0F, 0.0F, 0.0F); +- ++ par0Tessellator.draw(); ++ par0Tessellator.startDrawingQuads(); ++ par0Tessellator.setNormal(1.0F, 0.0F, 0.0F); + float var13; +- for(var10 = 0; var10 < var5; ++var10) { +- var11 = (float)var10 / (float)var5; +- var12 = var1 + (var3 - var1) * var11 - var8; +- var13 = var11 + 1.0F / (float)var5; +- var0.addVertexWithUV((double)var13, 1.0D, (double)(0.0F - var7), (double)var12, (double)var2); +- var0.addVertexWithUV((double)var13, 1.0D, 0.0D, (double)var12, (double)var2); +- var0.addVertexWithUV((double)var13, 0.0D, 0.0D, (double)var12, (double)var4); +- var0.addVertexWithUV((double)var13, 0.0D, (double)(0.0F - var7), (double)var12, (double)var4); +- } +- +- var0.draw(); +- var0.startDrawingQuads(); +- var0.setNormal(0.0F, 1.0F, 0.0F); +- +- for(var10 = 0; var10 < var6; ++var10) { +- var11 = (float)var10 / (float)var6; +- var12 = var4 + (var2 - var4) * var11 - var9; +- var13 = var11 + 1.0F / (float)var6; +- var0.addVertexWithUV(0.0D, (double)var13, 0.0D, (double)var1, (double)var12); +- var0.addVertexWithUV(1.0D, (double)var13, 0.0D, (double)var3, (double)var12); +- var0.addVertexWithUV(1.0D, (double)var13, (double)(0.0F - var7), (double)var3, (double)var12); +- var0.addVertexWithUV(0.0D, (double)var13, (double)(0.0F - var7), (double)var1, (double)var12); +- } +- +- var0.draw(); +- var0.startDrawingQuads(); +- var0.setNormal(0.0F, -1.0F, 0.0F); +- +- for(var10 = 0; var10 < var6; ++var10) { +- var11 = (float)var10 / (float)var6; +- var12 = var4 + (var2 - var4) * var11 - var9; +- var0.addVertexWithUV(1.0D, (double)var11, 0.0D, (double)var3, (double)var12); +- var0.addVertexWithUV(0.0D, (double)var11, 0.0D, (double)var1, (double)var12); +- var0.addVertexWithUV(0.0D, (double)var11, (double)(0.0F - var7), (double)var1, (double)var12); +- var0.addVertexWithUV(1.0D, (double)var11, (double)(0.0F - var7), (double)var3, (double)var12); +- } +- +- var0.draw(); ++ ++ for (var10 = 0; var10 < par5; ++var10) { ++ var11 = (float)var10 / (float)par5; ++ var12 = par1 + (par3 - par1) * var11 - var8; ++ var13 = var11 + 1.0F / (float)par5; ++ par0Tessellator.addVertexWithUV((double)var13, 1.0D, (double)(0.0F - par7), (double)var12, (double)par2); ++ par0Tessellator.addVertexWithUV((double)var13, 1.0D, 0.0D, (double)var12, (double)par2); ++ par0Tessellator.addVertexWithUV((double)var13, 0.0D, 0.0D, (double)var12, (double)par4); ++ par0Tessellator.addVertexWithUV((double)var13, 0.0D, (double)(0.0F - par7), (double)var12, (double)par4); ++ } ++ ++ par0Tessellator.draw(); ++ par0Tessellator.startDrawingQuads(); ++ par0Tessellator.setNormal(0.0F, 1.0F, 0.0F); ++ ++ for (var10 = 0; var10 < par6; ++var10) { ++ var11 = (float)var10 / (float)par6; ++ var12 = par4 + (par2 - par4) * var11 - var9; ++ var13 = var11 + 1.0F / (float)par6; ++ par0Tessellator.addVertexWithUV(0.0D, (double)var13, 0.0D, (double)par1, (double)var12); ++ par0Tessellator.addVertexWithUV(1.0D, (double)var13, 0.0D, (double)par3, (double)var12); ++ par0Tessellator.addVertexWithUV(1.0D, (double)var13, (double)(0.0F - par7), (double)par3, (double)var12); ++ par0Tessellator.addVertexWithUV(0.0D, (double)var13, (double)(0.0F - par7), (double)par1, (double)var12); ++ } ++ ++ par0Tessellator.draw(); ++ par0Tessellator.startDrawingQuads(); ++ par0Tessellator.setNormal(0.0F, -1.0F, 0.0F); ++ ++ for (var10 = 0; var10 < par6; ++var10) { ++ var11 = (float)var10 / (float)par6; ++ var12 = par4 + (par2 - par4) * var11 - var9; ++ par0Tessellator.addVertexWithUV(1.0D, (double)var11, 0.0D, (double)par3, (double)var12); ++ par0Tessellator.addVertexWithUV(0.0D, (double)var11, 0.0D, (double)par1, (double)var12); ++ par0Tessellator.addVertexWithUV(0.0D, (double)var11, (double)(0.0F - par7), (double)par1, (double)var12); ++ par0Tessellator.addVertexWithUV(1.0D, (double)var11, (double)(0.0F - par7), (double)par3, (double)var12); ++ } ++ ++ par0Tessellator.draw(); + } + +- public void renderItemInFirstPerson(float var1) { +- float var2 = this.prevEquippedProgress + (this.equippedProgress - this.prevEquippedProgress) * var1; ++ /** ++ * Renders the active item in the player's hand when in first person mode. Args: partialTickTime ++ */ ++ public void renderItemInFirstPerson(float par1) { ++ float var2 = this.prevEquippedProgress + (this.equippedProgress - this.prevEquippedProgress) * par1; + EntityClientPlayerMP var3 = this.mc.thePlayer; +- float var4 = var3.prevRotationPitch + (var3.rotationPitch - var3.prevRotationPitch) * var1; ++ float var4 = var3.prevRotationPitch + (var3.rotationPitch - var3.prevRotationPitch) * par1; + GL11.glPushMatrix(); + GL11.glRotatef(var4, 1.0F, 0.0F, 0.0F); +- GL11.glRotatef(var3.prevRotationYaw + (var3.rotationYaw - var3.prevRotationYaw) * var1, 0.0F, 1.0F, 0.0F); ++ GL11.glRotatef(var3.prevRotationYaw + (var3.rotationYaw - var3.prevRotationYaw) * par1, 0.0F, 1.0F, 0.0F); + RenderHelper.enableStandardItemLighting(); + GL11.glPopMatrix(); + EntityPlayerSP var5 = (EntityPlayerSP)var3; +- float var6 = var5.prevRenderArmPitch + (var5.renderArmPitch - var5.prevRenderArmPitch) * var1; +- float var7 = var5.prevRenderArmYaw + (var5.renderArmYaw - var5.prevRenderArmYaw) * var1; ++ float var6 = var5.prevRenderArmPitch + (var5.renderArmPitch - var5.prevRenderArmPitch) * par1; ++ float var7 = var5.prevRenderArmYaw + (var5.renderArmYaw - var5.prevRenderArmYaw) * par1; + GL11.glRotatef((var3.rotationPitch - var6) * 0.1F, 1.0F, 0.0F, 0.0F); + GL11.glRotatef((var3.rotationYaw - var7) * 0.1F, 0.0F, 1.0F, 0.0F); + ItemStack var8 = this.itemToRender; +@@ -185,14 +270,15 @@ + OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, (float)var11 / 1.0F, (float)var12 / 1.0F); + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + float var13; +- float var21; +- float var23; +- if(var8 != null) { ++ float var20; ++ float var22; ++ ++ if (var8 != null) { + var10 = Item.itemsList[var8.itemID].getColorFromItemStack(var8, 0); +- var21 = (float)(var10 >> 16 & 255) / 255.0F; +- var23 = (float)(var10 >> 8 & 255) / 255.0F; ++ var20 = (float)(var10 >> 16 & 255) / 255.0F; ++ var22 = (float)(var10 >> 8 & 255) / 255.0F; + var13 = (float)(var10 & 255) / 255.0F; +- GL11.glColor4f(var9 * var21, var9 * var23, var9 * var13, 1.0F); ++ GL11.glColor4f(var9 * var20, var9 * var22, var9 * var13, 1.0F); + } else { + GL11.glColor4f(var9, var9, var9, 1.0F); + } +@@ -200,33 +286,35 @@ + float var14; + float var15; + float var16; +- float var20; +- Render var26; +- RenderPlayer var28; +- if(var8 != null && var8.itemID == Item.map.itemID) { ++ float var21; ++ Render var27; ++ RenderPlayer var26; ++ ++ if (var8 != null && var8.itemID == Item.map.itemID) { + GL11.glPushMatrix(); +- var20 = 0.8F; +- var21 = var3.getSwingProgress(var1); +- var23 = MathHelper.sin(var21 * (float)Math.PI); +- var13 = MathHelper.sin(MathHelper.sqrt_float(var21) * (float)Math.PI); +- GL11.glTranslatef(-var13 * 0.4F, MathHelper.sin(MathHelper.sqrt_float(var21) * (float)Math.PI * 2.0F) * 0.2F, -var23 * 0.2F); +- var21 = 1.0F - var4 / 45.0F + 0.1F; +- if(var21 < 0.0F) { +- var21 = 0.0F; +- } +- +- if(var21 > 1.0F) { +- var21 = 1.0F; +- } +- +- var21 = -MathHelper.cos(var21 * (float)Math.PI) * 0.5F + 0.5F; +- GL11.glTranslatef(0.0F, 0.0F * var20 - (1.0F - var2) * 1.2F - var21 * 0.5F + 0.04F, -0.9F * var20); ++ var21 = 0.8F; ++ var20 = var3.getSwingProgress(par1); ++ var22 = MathHelper.sin(var20 * (float)Math.PI); ++ var13 = MathHelper.sin(MathHelper.sqrt_float(var20) * (float)Math.PI); ++ GL11.glTranslatef(-var13 * 0.4F, MathHelper.sin(MathHelper.sqrt_float(var20) * (float)Math.PI * 2.0F) * 0.2F, -var22 * 0.2F); ++ var20 = 1.0F - var4 / 45.0F + 0.1F; ++ ++ if (var20 < 0.0F) { ++ var20 = 0.0F; ++ } ++ ++ if (var20 > 1.0F) { ++ var20 = 1.0F; ++ } ++ ++ var20 = -MathHelper.cos(var20 * (float)Math.PI) * 0.5F + 0.5F; ++ GL11.glTranslatef(0.0F, 0.0F * var21 - (1.0F - var2) * 1.2F - var20 * 0.5F + 0.04F, -0.9F * var21); + GL11.glRotatef(90.0F, 0.0F, 1.0F, 0.0F); +- GL11.glRotatef(var21 * -85.0F, 0.0F, 0.0F, 1.0F); ++ GL11.glRotatef(var20 * -85.0F, 0.0F, 0.0F, 1.0F); + GL11.glEnable(GL12.GL_RESCALE_NORMAL); + this.mc.getTextureManager().bindTexture(var3.getLocationSkin()); + +- for(var12 = 0; var12 < 2; ++var12) { ++ for (var12 = 0; var12 < 2; ++var12) { + int var24 = var12 * 2 - 1; + GL11.glPushMatrix(); + GL11.glTranslatef(-0.0F, -0.6F, 1.1F * (float)var24); +@@ -234,17 +322,17 @@ + GL11.glRotatef(-90.0F, 0.0F, 0.0F, 1.0F); + GL11.glRotatef(59.0F, 0.0F, 0.0F, 1.0F); + GL11.glRotatef((float)(-65 * var24), 0.0F, 1.0F, 0.0F); +- var26 = RenderManager.instance.getEntityRenderObject(this.mc.thePlayer); +- var28 = (RenderPlayer)var26; ++ var27 = RenderManager.instance.getEntityRenderObject(this.mc.thePlayer); ++ var26 = (RenderPlayer)var27; + var16 = 1.0F; + GL11.glScalef(var16, var16, var16); +- var28.renderFirstPersonArm(this.mc.thePlayer); ++ var26.renderFirstPersonArm(this.mc.thePlayer); + GL11.glPopMatrix(); + } + +- var23 = var3.getSwingProgress(var1); +- var13 = MathHelper.sin(var23 * var23 * (float)Math.PI); +- var14 = MathHelper.sin(MathHelper.sqrt_float(var23) * (float)Math.PI); ++ var22 = var3.getSwingProgress(par1); ++ var13 = MathHelper.sin(var22 * var22 * (float)Math.PI); ++ var14 = MathHelper.sin(MathHelper.sqrt_float(var22) * (float)Math.PI); + GL11.glRotatef(-var13 * 20.0F, 0.0F, 1.0F, 0.0F); + GL11.glRotatef(-var14 * 20.0F, 0.0F, 0.0F, 1.0F); + GL11.glRotatef(-var14 * 80.0F, 1.0F, 0.0F, 0.0F); +@@ -256,80 +344,86 @@ + var16 = 0.015625F; + GL11.glScalef(var16, var16, var16); + this.mc.getTextureManager().bindTexture(RES_MAP_BACKGROUND); +- Tessellator var29 = Tessellator.instance; ++ Tessellator var30 = Tessellator.instance; + GL11.glNormal3f(0.0F, 0.0F, -1.0F); +- var29.startDrawingQuads(); +- byte var30 = 7; +- var29.addVertexWithUV((double)(0 - var30), (double)(128 + var30), 0.0D, 0.0D, 1.0D); +- var29.addVertexWithUV((double)(128 + var30), (double)(128 + var30), 0.0D, 1.0D, 1.0D); +- var29.addVertexWithUV((double)(128 + var30), (double)(0 - var30), 0.0D, 1.0D, 0.0D); +- var29.addVertexWithUV((double)(0 - var30), (double)(0 - var30), 0.0D, 0.0D, 0.0D); +- var29.draw(); ++ var30.startDrawingQuads(); ++ byte var29 = 7; ++ var30.addVertexWithUV((double)(0 - var29), (double)(128 + var29), 0.0D, 0.0D, 1.0D); ++ var30.addVertexWithUV((double)(128 + var29), (double)(128 + var29), 0.0D, 1.0D, 1.0D); ++ var30.addVertexWithUV((double)(128 + var29), (double)(0 - var29), 0.0D, 1.0D, 0.0D); ++ var30.addVertexWithUV((double)(0 - var29), (double)(0 - var29), 0.0D, 0.0D, 0.0D); ++ var30.draw(); + MapData var19 = Item.map.getMapData(var8, this.mc.theWorld); +- if(var19 != null) { ++ ++ if (var19 != null) { + this.mapItemRenderer.renderMap(this.mc.thePlayer, this.mc.getTextureManager(), var19); + } + + GL11.glPopMatrix(); +- } else if(var8 != null) { ++ } else if (var8 != null) { + GL11.glPushMatrix(); +- var20 = 0.8F; +- if(var3.getItemInUseCount() > 0) { +- EnumAction var22 = var8.getItemUseAction(); +- if(var22 == EnumAction.eat || var22 == EnumAction.drink) { +- var23 = (float)var3.getItemInUseCount() - var1 + 1.0F; +- var13 = 1.0F - var23 / (float)var8.getMaxItemUseDuration(); ++ var21 = 0.8F; ++ ++ if (var3.getItemInUseCount() > 0) { ++ EnumAction var23 = var8.getItemUseAction(); ++ ++ if (var23 == EnumAction.eat || var23 == EnumAction.drink) { ++ var22 = (float)var3.getItemInUseCount() - par1 + 1.0F; ++ var13 = 1.0F - var22 / (float)var8.getMaxItemUseDuration(); + var14 = 1.0F - var13; + var14 = var14 * var14 * var14; + var14 = var14 * var14 * var14; + var14 = var14 * var14 * var14; + var15 = 1.0F - var14; +- GL11.glTranslatef(0.0F, MathHelper.abs(MathHelper.cos(var23 / 4.0F * (float)Math.PI) * 0.1F) * (float)((double)var13 > 0.2D ? 1 : 0), 0.0F); ++ GL11.glTranslatef(0.0F, MathHelper.abs(MathHelper.cos(var22 / 4.0F * (float)Math.PI) * 0.1F) * (float)((double)var13 > 0.2D ? 1 : 0), 0.0F); + GL11.glTranslatef(var15 * 0.6F, -var15 * 0.5F, 0.0F); + GL11.glRotatef(var15 * 90.0F, 0.0F, 1.0F, 0.0F); + GL11.glRotatef(var15 * 10.0F, 1.0F, 0.0F, 0.0F); + GL11.glRotatef(var15 * 30.0F, 0.0F, 0.0F, 1.0F); + } + } else { +- var21 = var3.getSwingProgress(var1); +- var23 = MathHelper.sin(var21 * (float)Math.PI); +- var13 = MathHelper.sin(MathHelper.sqrt_float(var21) * (float)Math.PI); +- GL11.glTranslatef(-var13 * 0.4F, MathHelper.sin(MathHelper.sqrt_float(var21) * (float)Math.PI * 2.0F) * 0.2F, -var23 * 0.2F); ++ var20 = var3.getSwingProgress(par1); ++ var22 = MathHelper.sin(var20 * (float)Math.PI); ++ var13 = MathHelper.sin(MathHelper.sqrt_float(var20) * (float)Math.PI); ++ GL11.glTranslatef(-var13 * 0.4F, MathHelper.sin(MathHelper.sqrt_float(var20) * (float)Math.PI * 2.0F) * 0.2F, -var22 * 0.2F); + } + +- GL11.glTranslatef(0.7F * var20, -0.65F * var20 - (1.0F - var2) * 0.6F, -0.9F * var20); ++ GL11.glTranslatef(0.7F * var21, -0.65F * var21 - (1.0F - var2) * 0.6F, -0.9F * var21); + GL11.glRotatef(45.0F, 0.0F, 1.0F, 0.0F); + GL11.glEnable(GL12.GL_RESCALE_NORMAL); +- var21 = var3.getSwingProgress(var1); +- var23 = MathHelper.sin(var21 * var21 * (float)Math.PI); +- var13 = MathHelper.sin(MathHelper.sqrt_float(var21) * (float)Math.PI); +- GL11.glRotatef(-var23 * 20.0F, 0.0F, 1.0F, 0.0F); ++ var20 = var3.getSwingProgress(par1); ++ var22 = MathHelper.sin(var20 * var20 * (float)Math.PI); ++ var13 = MathHelper.sin(MathHelper.sqrt_float(var20) * (float)Math.PI); ++ GL11.glRotatef(-var22 * 20.0F, 0.0F, 1.0F, 0.0F); + GL11.glRotatef(-var13 * 20.0F, 0.0F, 0.0F, 1.0F); + GL11.glRotatef(-var13 * 80.0F, 1.0F, 0.0F, 0.0F); + var14 = 0.4F; + GL11.glScalef(var14, var14, var14); + float var17; + float var18; +- if(var3.getItemInUseCount() > 0) { ++ ++ if (var3.getItemInUseCount() > 0) { + EnumAction var25 = var8.getItemUseAction(); +- if(var25 == EnumAction.block) { ++ ++ if (var25 == EnumAction.block) { + GL11.glTranslatef(-0.5F, 0.2F, 0.0F); + GL11.glRotatef(30.0F, 0.0F, 1.0F, 0.0F); + GL11.glRotatef(-80.0F, 1.0F, 0.0F, 0.0F); + GL11.glRotatef(60.0F, 0.0F, 1.0F, 0.0F); +- } else if(var25 == EnumAction.bow) { ++ } else if (var25 == EnumAction.bow) { + GL11.glRotatef(-18.0F, 0.0F, 0.0F, 1.0F); + GL11.glRotatef(-12.0F, 0.0F, 1.0F, 0.0F); + GL11.glRotatef(-8.0F, 1.0F, 0.0F, 0.0F); + GL11.glTranslatef(-0.9F, 0.2F, 0.0F); +- var16 = (float)var8.getMaxItemUseDuration() - ((float)var3.getItemInUseCount() - var1 + 1.0F); ++ var16 = (float)var8.getMaxItemUseDuration() - ((float)var3.getItemInUseCount() - par1 + 1.0F); + var17 = var16 / 20.0F; + var17 = (var17 * var17 + var17 * 2.0F) / 3.0F; +- if(var17 > 1.0F) { ++ ++ if (var17 > 1.0F) { + var17 = 1.0F; + } + +- if(var17 > 0.1F) { ++ if (var17 > 0.1F) { + GL11.glTranslatef(0.0F, MathHelper.sin((var16 - 0.1F) * 1.3F) * 0.01F * (var17 - 0.1F), 0.0F); + } + +@@ -345,16 +439,16 @@ + } + } + +- if(var8.getItem().shouldRotateAroundWhenRendering()) { ++ if (var8.getItem().shouldRotateAroundWhenRendering()) { + GL11.glRotatef(180.0F, 0.0F, 1.0F, 0.0F); + } + +- if(var8.getItem().requiresMultipleRenderPasses()) { ++ if (var8.getItem().requiresMultipleRenderPasses()) { + this.renderItem(var3, var8, 0); +- int var27 = Item.itemsList[var8.itemID].getColorFromItemStack(var8, 1); +- var16 = (float)(var27 >> 16 & 255) / 255.0F; +- var17 = (float)(var27 >> 8 & 255) / 255.0F; +- var18 = (float)(var27 & 255) / 255.0F; ++ int var28 = Item.itemsList[var8.itemID].getColorFromItemStack(var8, 1); ++ var16 = (float)(var28 >> 16 & 255) / 255.0F; ++ var17 = (float)(var28 >> 8 & 255) / 255.0F; ++ var18 = (float)(var28 & 255) / 255.0F; + GL11.glColor4f(var9 * var16, var9 * var17, var9 * var18, 1.0F); + this.renderItem(var3, var8, 1); + } else { +@@ -362,21 +456,21 @@ + } + + GL11.glPopMatrix(); +- } else if(!var3.isInvisible()) { ++ } else if (!var3.isInvisible()) { + GL11.glPushMatrix(); +- var20 = 0.8F; +- var21 = var3.getSwingProgress(var1); +- var23 = MathHelper.sin(var21 * (float)Math.PI); +- var13 = MathHelper.sin(MathHelper.sqrt_float(var21) * (float)Math.PI); +- GL11.glTranslatef(-var13 * 0.3F, MathHelper.sin(MathHelper.sqrt_float(var21) * (float)Math.PI * 2.0F) * 0.4F, -var23 * 0.4F); +- GL11.glTranslatef(0.8F * var20, -(12.0F / 16.0F) * var20 - (1.0F - var2) * 0.6F, -0.9F * var20); ++ var21 = 0.8F; ++ var20 = var3.getSwingProgress(par1); ++ var22 = MathHelper.sin(var20 * (float)Math.PI); ++ var13 = MathHelper.sin(MathHelper.sqrt_float(var20) * (float)Math.PI); ++ GL11.glTranslatef(-var13 * 0.3F, MathHelper.sin(MathHelper.sqrt_float(var20) * (float)Math.PI * 2.0F) * 0.4F, -var22 * 0.4F); ++ GL11.glTranslatef(0.8F * var21, -0.75F * var21 - (1.0F - var2) * 0.6F, -0.9F * var21); + GL11.glRotatef(45.0F, 0.0F, 1.0F, 0.0F); + GL11.glEnable(GL12.GL_RESCALE_NORMAL); +- var21 = var3.getSwingProgress(var1); +- var23 = MathHelper.sin(var21 * var21 * (float)Math.PI); +- var13 = MathHelper.sin(MathHelper.sqrt_float(var21) * (float)Math.PI); ++ var20 = var3.getSwingProgress(par1); ++ var22 = MathHelper.sin(var20 * var20 * (float)Math.PI); ++ var13 = MathHelper.sin(MathHelper.sqrt_float(var20) * (float)Math.PI); + GL11.glRotatef(var13 * 70.0F, 0.0F, 1.0F, 0.0F); +- GL11.glRotatef(-var23 * 20.0F, 0.0F, 0.0F, 1.0F); ++ GL11.glRotatef(-var22 * 20.0F, 0.0F, 0.0F, 1.0F); + this.mc.getTextureManager().bindTexture(var3.getLocationSkin()); + GL11.glTranslatef(-1.0F, 3.6F, 3.5F); + GL11.glRotatef(120.0F, 0.0F, 0.0F, 1.0F); +@@ -384,11 +478,11 @@ + GL11.glRotatef(-135.0F, 0.0F, 1.0F, 0.0F); + GL11.glScalef(1.0F, 1.0F, 1.0F); + GL11.glTranslatef(5.6F, 0.0F, 0.0F); +- var26 = RenderManager.instance.getEntityRenderObject(this.mc.thePlayer); +- var28 = (RenderPlayer)var26; ++ var27 = RenderManager.instance.getEntityRenderObject(this.mc.thePlayer); ++ var26 = (RenderPlayer)var27; + var16 = 1.0F; + GL11.glScalef(var16, var16, var16); +- var28.renderFirstPersonArm(this.mc.thePlayer); ++ var26.renderFirstPersonArm(this.mc.thePlayer); + GL11.glPopMatrix(); + } + +@@ -396,46 +490,55 @@ + RenderHelper.disableStandardItemLighting(); + } + +- public void renderOverlays(float var1) { ++ /** ++ * Renders all the overlays that are in first person mode. Args: partialTickTime ++ */ ++ public void renderOverlays(float par1) { + GL11.glDisable(GL11.GL_ALPHA_TEST); +- if(this.mc.thePlayer.isBurning()) { +- this.renderFireInFirstPerson(var1); ++ ++ if (this.mc.thePlayer.isBurning()) { ++ this.renderFireInFirstPerson(par1); + } + +- if(this.mc.thePlayer.isEntityInsideOpaqueBlock()) { ++ if (this.mc.thePlayer.isEntityInsideOpaqueBlock()) { + int var2 = MathHelper.floor_double(this.mc.thePlayer.posX); + int var3 = MathHelper.floor_double(this.mc.thePlayer.posY); +- int var4 = MathHelper.floor_double(this.mc.thePlayer.posZ); ++ int var4 = MathHelper.floor_double(this.mc.thePlayer.posZ); + int var5 = this.mc.theWorld.getBlockId(var2, var3, var4); +- if(this.mc.theWorld.isBlockNormalCube(var2, var3, var4)) { +- this.renderInsideOfBlock(var1, Block.blocksList[var5].getBlockTextureFromSide(2)); ++ ++ if (this.mc.theWorld.isBlockNormalCube(var2, var3, var4)) { ++ this.renderInsideOfBlock(par1, Block.blocksList[var5].getBlockTextureFromSide(2)); + } else { +- for(int var6 = 0; var6 < 8; ++var6) { ++ for (int var6 = 0; var6 < 8; ++var6) { + float var7 = ((float)((var6 >> 0) % 2) - 0.5F) * this.mc.thePlayer.width * 0.9F; + float var8 = ((float)((var6 >> 1) % 2) - 0.5F) * this.mc.thePlayer.height * 0.2F; + float var9 = ((float)((var6 >> 2) % 2) - 0.5F) * this.mc.thePlayer.width * 0.9F; + int var10 = MathHelper.floor_float((float)var2 + var7); + int var11 = MathHelper.floor_float((float)var3 + var8); + int var12 = MathHelper.floor_float((float)var4 + var9); +- if(this.mc.theWorld.isBlockNormalCube(var10, var11, var12)) { ++ ++ if (this.mc.theWorld.isBlockNormalCube(var10, var11, var12)) { + var5 = this.mc.theWorld.getBlockId(var10, var11, var12); + } + } + } + +- if(Block.blocksList[var5] != null) { +- this.renderInsideOfBlock(var1, Block.blocksList[var5].getBlockTextureFromSide(2)); ++ if (Block.blocksList[var5] != null) { ++ this.renderInsideOfBlock(par1, Block.blocksList[var5].getBlockTextureFromSide(2)); + } + } + +- if(this.mc.thePlayer.isInsideOfMaterial(Material.water)) { +- this.renderWarpedTextureOverlay(var1); ++ if (this.mc.thePlayer.isInsideOfMaterial(Material.water)) { ++ this.renderWarpedTextureOverlay(par1); + } + + GL11.glEnable(GL11.GL_ALPHA_TEST); + } + +- private void renderInsideOfBlock(float var1, Icon var2) { ++ /** ++ * Renders the texture of the block the player is inside as an overlay. Args: partialTickTime, blockTextureIndex ++ */ ++ private void renderInsideOfBlock(float par1, Icon par2Icon) { + this.mc.getTextureManager().bindTexture(TextureMap.locationBlocksTexture); + Tessellator var3 = Tessellator.instance; + float var4 = 0.1F; +@@ -446,10 +549,10 @@ + float var7 = -1.0F; + float var8 = 1.0F; + float var9 = -0.5F; +- float var10 = var2.getMinU(); +- float var11 = var2.getMaxU(); +- float var12 = var2.getMinV(); +- float var13 = var2.getMaxV(); ++ float var10 = par2Icon.getMinU(); ++ float var11 = par2Icon.getMaxU(); ++ float var12 = par2Icon.getMinV(); ++ float var13 = par2Icon.getMaxV(); + var3.startDrawingQuads(); + var3.addVertexWithUV((double)var5, (double)var7, (double)var9, (double)var11, (double)var13); + var3.addVertexWithUV((double)var6, (double)var7, (double)var9, (double)var10, (double)var13); +@@ -460,10 +563,14 @@ + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + } + +- private void renderWarpedTextureOverlay(float var1) { ++ /** ++ * Renders a texture that warps around based on the direction the player is looking. Texture needs to be bound before ++ * being called. Used for the water overlay. Args: parialTickTime ++ */ ++ private void renderWarpedTextureOverlay(float par1) { + this.mc.getTextureManager().bindTexture(RES_UNDERWATER_OVERLAY); + Tessellator var2 = Tessellator.instance; +- float var3 = this.mc.thePlayer.getBrightness(var1); ++ float var3 = this.mc.thePlayer.getBrightness(par1); + GL11.glColor4f(var3, var3, var3, 0.5F); + GL11.glEnable(GL11.GL_BLEND); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); +@@ -487,14 +594,17 @@ + GL11.glDisable(GL11.GL_BLEND); + } + +- private void renderFireInFirstPerson(float var1) { ++ /** ++ * Renders the fire on the screen for first person mode. Arg: partialTickTime ++ */ ++ private void renderFireInFirstPerson(float par1) { + Tessellator var2 = Tessellator.instance; + GL11.glColor4f(1.0F, 1.0F, 1.0F, 0.9F); + GL11.glEnable(GL11.GL_BLEND); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + float var3 = 1.0F; + +- for(int var4 = 0; var4 < 2; ++var4) { ++ for (int var4 = 0; var4 < 2; ++var4) { + GL11.glPushMatrix(); + Icon var5 = Block.fire.getFireIcon(1); + this.mc.getTextureManager().bindTexture(TextureMap.locationBlocksTexture); +@@ -527,11 +637,12 @@ + EntityClientPlayerMP var1 = this.mc.thePlayer; + ItemStack var2 = var1.inventory.getCurrentItem(); + boolean var3 = this.equippedItemSlot == var1.inventory.currentItem && var2 == this.itemToRender; +- if(this.itemToRender == null && var2 == null) { ++ ++ if (this.itemToRender == null && var2 == null) { + var3 = true; + } + +- if(var2 != null && this.itemToRender != null && var2 != this.itemToRender && var2.itemID == this.itemToRender.itemID && var2.getItemDamage() == this.itemToRender.getItemDamage()) { ++ if (var2 != null && this.itemToRender != null && var2 != this.itemToRender && var2.itemID == this.itemToRender.itemID && var2.getItemDamage() == this.itemToRender.getItemDamage()) { + this.itemToRender = var2; + var3 = true; + } +@@ -539,26 +650,33 @@ + float var4 = 0.4F; + float var5 = var3 ? 1.0F : 0.0F; + float var6 = var5 - this.equippedProgress; +- if(var6 < -var4) { ++ ++ if (var6 < -var4) { + var6 = -var4; + } + +- if(var6 > var4) { ++ if (var6 > var4) { + var6 = var4; + } + + this.equippedProgress += var6; +- if(this.equippedProgress < 0.1F) { ++ ++ if (this.equippedProgress < 0.1F) { + this.itemToRender = var2; + this.equippedItemSlot = var1.inventory.currentItem; + } +- + } + ++ /** ++ * Resets equippedProgress ++ */ + public void resetEquippedProgress() { + this.equippedProgress = 0.0F; + } + ++ /** ++ * Resets equippedProgress ++ */ + public void resetEquippedProgress2() { + this.equippedProgress = 0.0F; + } diff --git a/patches/net/minecraft/src/ItemSaddle.java.patch b/patches/net/minecraft/src/ItemSaddle.java.patch new file mode 100644 index 0000000..7b0bc60 --- /dev/null +++ b/patches/net/minecraft/src/ItemSaddle.java.patch @@ -0,0 +1,47 @@ +--- net/minecraft/src/ItemSaddle.java ++++ net/minecraft/src/ItemSaddle.java +@@ -1,18 +1,22 @@ + package net.minecraft.src; + + public class ItemSaddle extends Item { +- public ItemSaddle(int var1) { +- super(var1); ++ public ItemSaddle(int par1) { ++ super(par1); + this.maxStackSize = 1; + this.setCreativeTab(CreativeTabs.tabTransport); + } + +- public boolean itemInteractionForEntity(ItemStack var1, EntityPlayer var2, EntityLivingBase var3) { +- if(var3 instanceof EntityPig) { +- EntityPig var4 = (EntityPig)var3; +- if(!var4.getSaddled() && !var4.isChild()) { ++ /** ++ * Returns true if the item can be used on the given entity, e.g. shears on sheep. ++ */ ++ public boolean itemInteractionForEntity(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, EntityLivingBase par3EntityLivingBase) { ++ if (par3EntityLivingBase instanceof EntityPig) { ++ EntityPig var4 = (EntityPig)par3EntityLivingBase; ++ ++ if (!var4.getSaddled() && !var4.isChild()) { + var4.setSaddled(true); +- --var1.stackSize; ++ --par1ItemStack.stackSize; + } + + return true; +@@ -21,8 +25,12 @@ + } + } + +- public boolean hitEntity(ItemStack var1, EntityLivingBase var2, EntityLivingBase var3) { +- this.itemInteractionForEntity(var1, (EntityPlayer)null, var2); ++ /** ++ * Current implementations of this method in child classes do not use the entry argument beside ev. They just raise the ++ * damage on the stack. ++ */ ++ public boolean hitEntity(ItemStack par1ItemStack, EntityLivingBase par2EntityLivingBase, EntityLivingBase par3EntityLivingBase) { ++ this.itemInteractionForEntity(par1ItemStack, (EntityPlayer)null, par2EntityLivingBase); + return true; + } + } diff --git a/patches/net/minecraft/src/ItemSeedFood.java.patch b/patches/net/minecraft/src/ItemSeedFood.java.patch new file mode 100644 index 0000000..7d13c3a --- /dev/null +++ b/patches/net/minecraft/src/ItemSeedFood.java.patch @@ -0,0 +1,46 @@ +--- net/minecraft/src/ItemSeedFood.java ++++ net/minecraft/src/ItemSeedFood.java +@@ -1,23 +1,32 @@ + package net.minecraft.src; + + public class ItemSeedFood extends ItemFood { ++ ++ /** Block ID of the crop this seed food should place. */ + private int cropId; ++ ++ /** Block ID of the soil this seed food should be planted on. */ + private int soilId; + +- public ItemSeedFood(int var1, int var2, float var3, int var4, int var5) { +- super(var1, var2, var3, false); +- this.cropId = var4; +- this.soilId = var5; ++ public ItemSeedFood(int par1, int par2, float par3, int par4, int par5) { ++ super(par1, par2, par3, false); ++ this.cropId = par4; ++ this.soilId = par5; + } + +- public boolean onItemUse(ItemStack var1, EntityPlayer var2, World var3, int var4, int var5, int var6, int var7, float var8, float var9, float var10) { +- if(var7 != 1) { ++ /** ++ * Callback for item usage. If the item does something special on right clicking, he will have one of those. Return ++ * True if something happen and false if it don't. This is for ITEMS, not BLOCKS ++ */ ++ public boolean onItemUse(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, World par3World, int par4, int par5, int par6, int par7, float par8, float par9, float par10) { ++ if (par7 != 1) { + return false; +- } else if(var2.canPlayerEdit(var4, var5, var6, var7, var1) && var2.canPlayerEdit(var4, var5 + 1, var6, var7, var1)) { +- int var11 = var3.getBlockId(var4, var5, var6); +- if(var11 == this.soilId && var3.isAirBlock(var4, var5 + 1, var6)) { +- var3.setBlock(var4, var5 + 1, var6, this.cropId); +- --var1.stackSize; ++ } else if (par2EntityPlayer.canPlayerEdit(par4, par5, par6, par7, par1ItemStack) && par2EntityPlayer.canPlayerEdit(par4, par5 + 1, par6, par7, par1ItemStack)) { ++ int var11 = par3World.getBlockId(par4, par5, par6); ++ ++ if (var11 == this.soilId && par3World.isAirBlock(par4, par5 + 1, par6)) { ++ par3World.setBlock(par4, par5 + 1, par6, this.cropId); ++ --par1ItemStack.stackSize; + return true; + } else { + return false; diff --git a/patches/net/minecraft/src/ItemSeeds.java.patch b/patches/net/minecraft/src/ItemSeeds.java.patch new file mode 100644 index 0000000..57023ce --- /dev/null +++ b/patches/net/minecraft/src/ItemSeeds.java.patch @@ -0,0 +1,49 @@ +--- net/minecraft/src/ItemSeeds.java ++++ net/minecraft/src/ItemSeeds.java +@@ -1,24 +1,35 @@ + package net.minecraft.src; + + public class ItemSeeds extends Item { ++ ++ /** ++ * The type of block this seed turns into (wheat or pumpkin stems for instance) ++ */ + private int blockType; ++ ++ /** BlockID of the block the seeds can be planted on. */ + private int soilBlockID; + +- public ItemSeeds(int var1, int var2, int var3) { +- super(var1); +- this.blockType = var2; +- this.soilBlockID = var3; ++ public ItemSeeds(int par1, int par2, int par3) { ++ super(par1); ++ this.blockType = par2; ++ this.soilBlockID = par3; + this.setCreativeTab(CreativeTabs.tabMaterials); + } + +- public boolean onItemUse(ItemStack var1, EntityPlayer var2, World var3, int var4, int var5, int var6, int var7, float var8, float var9, float var10) { +- if(var7 != 1) { ++ /** ++ * Callback for item usage. If the item does something special on right clicking, he will have one of those. Return ++ * True if something happen and false if it don't. This is for ITEMS, not BLOCKS ++ */ ++ public boolean onItemUse(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, World par3World, int par4, int par5, int par6, int par7, float par8, float par9, float par10) { ++ if (par7 != 1) { + return false; +- } else if(var2.canPlayerEdit(var4, var5, var6, var7, var1) && var2.canPlayerEdit(var4, var5 + 1, var6, var7, var1)) { +- int var11 = var3.getBlockId(var4, var5, var6); +- if(var11 == this.soilBlockID && var3.isAirBlock(var4, var5 + 1, var6)) { +- var3.setBlock(var4, var5 + 1, var6, this.blockType); +- --var1.stackSize; ++ } else if (par2EntityPlayer.canPlayerEdit(par4, par5, par6, par7, par1ItemStack) && par2EntityPlayer.canPlayerEdit(par4, par5 + 1, par6, par7, par1ItemStack)) { ++ int var11 = par3World.getBlockId(par4, par5, par6); ++ ++ if (var11 == this.soilBlockID && par3World.isAirBlock(par4, par5 + 1, par6)) { ++ par3World.setBlock(par4, par5 + 1, par6, this.blockType); ++ --par1ItemStack.stackSize; + return true; + } else { + return false; diff --git a/patches/net/minecraft/src/ItemShears.java.patch b/patches/net/minecraft/src/ItemShears.java.patch new file mode 100644 index 0000000..bb6eebd --- /dev/null +++ b/patches/net/minecraft/src/ItemShears.java.patch @@ -0,0 +1,47 @@ +--- net/minecraft/src/ItemShears.java ++++ net/minecraft/src/ItemShears.java +@@ -1,27 +1,34 @@ + package net.minecraft.src; + + public class ItemShears extends Item { +- public ItemShears(int var1) { +- super(var1); ++ public ItemShears(int par1) { ++ super(par1); + this.setMaxStackSize(1); + this.setMaxDamage(238); + this.setCreativeTab(CreativeTabs.tabTools); + } + +- public boolean onBlockDestroyed(ItemStack var1, World var2, int var3, int var4, int var5, int var6, EntityLivingBase var7) { +- if(var3 != Block.leaves.blockID && var3 != Block.web.blockID && var3 != Block.tallGrass.blockID && var3 != Block.vine.blockID && var3 != Block.tripWire.blockID) { +- return super.onBlockDestroyed(var1, var2, var3, var4, var5, var6, var7); ++ public boolean onBlockDestroyed(ItemStack par1ItemStack, World par2World, int par3, int par4, int par5, int par6, EntityLivingBase par7EntityLivingBase) { ++ if (par3 != Block.leaves.blockID && par3 != Block.web.blockID && par3 != Block.tallGrass.blockID && par3 != Block.vine.blockID && par3 != Block.tripWire.blockID) { ++ return super.onBlockDestroyed(par1ItemStack, par2World, par3, par4, par5, par6, par7EntityLivingBase); + } else { +- var1.damageItem(1, var7); ++ par1ItemStack.damageItem(1, par7EntityLivingBase); + return true; + } + } + +- public boolean canHarvestBlock(Block var1) { +- return var1.blockID == Block.web.blockID || var1.blockID == Block.redstoneWire.blockID || var1.blockID == Block.tripWire.blockID; ++ /** ++ * Returns if the item (tool) can harvest results from the block type. ++ */ ++ public boolean canHarvestBlock(Block par1Block) { ++ return par1Block.blockID == Block.web.blockID || par1Block.blockID == Block.redstoneWire.blockID || par1Block.blockID == Block.tripWire.blockID; + } + +- public float getStrVsBlock(ItemStack var1, Block var2) { +- return var2.blockID != Block.web.blockID && var2.blockID != Block.leaves.blockID ? (var2.blockID == Block.cloth.blockID ? 5.0F : super.getStrVsBlock(var1, var2)) : 15.0F; ++ /** ++ * Returns the strength of the stack against a given block. 1.0F base, (Quality+1)*2 if correct blocktype, 1.5F if ++ * sword ++ */ ++ public float getStrVsBlock(ItemStack par1ItemStack, Block par2Block) { ++ return par2Block.blockID != Block.web.blockID && par2Block.blockID != Block.leaves.blockID ? (par2Block.blockID == Block.cloth.blockID ? 5.0F : super.getStrVsBlock(par1ItemStack, par2Block)) : 15.0F; + } + } diff --git a/patches/net/minecraft/src/ItemSign.java.patch b/patches/net/minecraft/src/ItemSign.java.patch new file mode 100644 index 0000000..ac763c6 --- /dev/null +++ b/patches/net/minecraft/src/ItemSign.java.patch @@ -0,0 +1,102 @@ +--- net/minecraft/src/ItemSign.java ++++ net/minecraft/src/ItemSign.java +@@ -1,56 +1,61 @@ + package net.minecraft.src; + + public class ItemSign extends Item { +- public ItemSign(int var1) { +- super(var1); ++ public ItemSign(int par1) { ++ super(par1); + this.maxStackSize = 16; + this.setCreativeTab(CreativeTabs.tabDecorations); + } + +- public boolean onItemUse(ItemStack var1, EntityPlayer var2, World var3, int var4, int var5, int var6, int var7, float var8, float var9, float var10) { +- if(var7 == 0) { ++ /** ++ * Callback for item usage. If the item does something special on right clicking, he will have one of those. Return ++ * True if something happen and false if it don't. This is for ITEMS, not BLOCKS ++ */ ++ public boolean onItemUse(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, World par3World, int par4, int par5, int par6, int par7, float par8, float par9, float par10) { ++ if (par7 == 0) { + return false; +- } else if(!var3.getBlockMaterial(var4, var5, var6).isSolid()) { ++ } else if (!par3World.getBlockMaterial(par4, par5, par6).isSolid()) { + return false; + } else { +- if(var7 == 1) { +- ++var5; +- } +- +- if(var7 == 2) { +- --var6; +- } +- +- if(var7 == 3) { +- ++var6; +- } +- +- if(var7 == 4) { +- --var4; +- } +- +- if(var7 == 5) { +- ++var4; +- } +- +- if(!var2.canPlayerEdit(var4, var5, var6, var7, var1)) { +- return false; +- } else if(!Block.signPost.canPlaceBlockAt(var3, var4, var5, var6)) { +- return false; +- } else if(var3.isRemote) { ++ if (par7 == 1) { ++ ++par5; ++ } ++ ++ if (par7 == 2) { ++ --par6; ++ } ++ ++ if (par7 == 3) { ++ ++par6; ++ } ++ ++ if (par7 == 4) { ++ --par4; ++ } ++ ++ if (par7 == 5) { ++ ++par4; ++ } ++ ++ if (!par2EntityPlayer.canPlayerEdit(par4, par5, par6, par7, par1ItemStack)) { ++ return false; ++ } else if (!Block.signPost.canPlaceBlockAt(par3World, par4, par5, par6)) { ++ return false; ++ } else if (par3World.isRemote) { + return true; + } else { +- if(var7 == 1) { +- int var11 = MathHelper.floor_double((double)((var2.rotationYaw + 180.0F) * 16.0F / 360.0F) + 0.5D) & 15; +- var3.setBlock(var4, var5, var6, Block.signPost.blockID, var11, 3); ++ if (par7 == 1) { ++ int var11 = MathHelper.floor_double((double)((par2EntityPlayer.rotationYaw + 180.0F) * 16.0F / 360.0F) + 0.5D) & 15; ++ par3World.setBlock(par4, par5, par6, Block.signPost.blockID, var11, 3); + } else { +- var3.setBlock(var4, var5, var6, Block.signWall.blockID, var7, 3); ++ par3World.setBlock(par4, par5, par6, Block.signWall.blockID, par7, 3); + } + +- --var1.stackSize; +- TileEntitySign var12 = (TileEntitySign)var3.getBlockTileEntity(var4, var5, var6); +- if(var12 != null) { +- var2.displayGUIEditSign(var12); ++ --par1ItemStack.stackSize; ++ TileEntitySign var12 = (TileEntitySign)par3World.getBlockTileEntity(par4, par5, par6); ++ ++ if (var12 != null) { ++ par2EntityPlayer.displayGUIEditSign(var12); + } + + return true; diff --git a/patches/net/minecraft/src/ItemSimpleFoiled.java.patch b/patches/net/minecraft/src/ItemSimpleFoiled.java.patch new file mode 100644 index 0000000..a7fa187 --- /dev/null +++ b/patches/net/minecraft/src/ItemSimpleFoiled.java.patch @@ -0,0 +1,17 @@ +--- net/minecraft/src/ItemSimpleFoiled.java ++++ net/minecraft/src/ItemSimpleFoiled.java +@@ -1,11 +1,11 @@ + package net.minecraft.src; + + public class ItemSimpleFoiled extends Item { +- public ItemSimpleFoiled(int var1) { +- super(var1); ++ public ItemSimpleFoiled(int par1) { ++ super(par1); + } + +- public boolean hasEffect(ItemStack var1) { ++ public boolean hasEffect(ItemStack par1ItemStack) { + return true; + } + } diff --git a/patches/net/minecraft/src/ItemSkull.java.patch b/patches/net/minecraft/src/ItemSkull.java.patch new file mode 100644 index 0000000..a1d4c5d --- /dev/null +++ b/patches/net/minecraft/src/ItemSkull.java.patch @@ -0,0 +1,206 @@ +--- net/minecraft/src/ItemSkull.java ++++ net/minecraft/src/ItemSkull.java +@@ -3,110 +3,129 @@ + import java.util.List; + + public class ItemSkull extends Item { +- private static final String[] b = new String[]{"skeleton", "wither", "zombie", "char", "creeper"}; +- public static final String[] a = new String[]{"skeleton", "wither", "zombie", "steve", "creeper"}; ++ private static final String[] skullTypes = new String[] {"skeleton", "wither", "zombie", "char", "creeper"}; ++ public static final String[] field_94587_a = new String[] {"skeleton", "wither", "zombie", "steve", "creeper"}; + private Icon[] field_94586_c; + +- public ItemSkull(int var1) { +- super(var1); ++ public ItemSkull(int par1) { ++ super(par1); + this.setCreativeTab(CreativeTabs.tabDecorations); + this.setMaxDamage(0); + this.setHasSubtypes(true); + } + +- public boolean onItemUse(ItemStack var1, EntityPlayer var2, World var3, int var4, int var5, int var6, int var7, float var8, float var9, float var10) { +- if(var7 == 0) { ++ /** ++ * Callback for item usage. If the item does something special on right clicking, he will have one of those. Return ++ * True if something happen and false if it don't. This is for ITEMS, not BLOCKS ++ */ ++ public boolean onItemUse(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, World par3World, int par4, int par5, int par6, int par7, float par8, float par9, float par10) { ++ if (par7 == 0) { + return false; +- } else if(!var3.getBlockMaterial(var4, var5, var6).isSolid()) { ++ } else if (!par3World.getBlockMaterial(par4, par5, par6).isSolid()) { + return false; + } else { +- if(var7 == 1) { +- ++var5; +- } +- +- if(var7 == 2) { +- --var6; +- } +- +- if(var7 == 3) { +- ++var6; +- } +- +- if(var7 == 4) { +- --var4; +- } +- +- if(var7 == 5) { +- ++var4; +- } +- +- if(!var2.canPlayerEdit(var4, var5, var6, var7, var1)) { ++ if (par7 == 1) { ++ ++par5; ++ } ++ ++ if (par7 == 2) { ++ --par6; ++ } ++ ++ if (par7 == 3) { ++ ++par6; ++ } ++ ++ if (par7 == 4) { ++ --par4; ++ } ++ ++ if (par7 == 5) { ++ ++par4; ++ } ++ ++ if (!par2EntityPlayer.canPlayerEdit(par4, par5, par6, par7, par1ItemStack)) { + return false; +- } else if(!Block.skull.canPlaceBlockAt(var3, var4, var5, var6)) { ++ } else if (!Block.skull.canPlaceBlockAt(par3World, par4, par5, par6)) { + return false; + } else { +- var3.setBlock(var4, var5, var6, Block.skull.blockID, var7, 2); ++ par3World.setBlock(par4, par5, par6, Block.skull.blockID, par7, 2); + int var11 = 0; +- if(var7 == 1) { +- var11 = MathHelper.floor_double((double)(var2.rotationYaw * 16.0F / 360.0F) + 0.5D) & 15; ++ ++ if (par7 == 1) { ++ var11 = MathHelper.floor_double((double)(par2EntityPlayer.rotationYaw * 16.0F / 360.0F) + 0.5D) & 15; + } + +- TileEntity var12 = var3.getBlockTileEntity(var4, var5, var6); +- if(var12 != null && var12 instanceof TileEntitySkull) { ++ TileEntity var12 = par3World.getBlockTileEntity(par4, par5, par6); ++ ++ if (var12 != null && var12 instanceof TileEntitySkull) { + String var13 = ""; +- if(var1.hasTagCompound() && var1.getTagCompound().hasKey("SkullOwner")) { +- var13 = var1.getTagCompound().getString("SkullOwner"); ++ ++ if (par1ItemStack.hasTagCompound() && par1ItemStack.getTagCompound().hasKey("SkullOwner")) { ++ var13 = par1ItemStack.getTagCompound().getString("SkullOwner"); + } + +- ((TileEntitySkull)var12).setSkullType(var1.getItemDamage(), var13); ++ ((TileEntitySkull)var12).setSkullType(par1ItemStack.getItemDamage(), var13); + ((TileEntitySkull)var12).setSkullRotation(var11); +- ((BlockSkull)Block.skull).makeWither(var3, var4, var5, var6, (TileEntitySkull)var12); ++ ((BlockSkull)Block.skull).makeWither(par3World, par4, par5, par6, (TileEntitySkull)var12); + } + +- --var1.stackSize; ++ --par1ItemStack.stackSize; + return true; + } + } + } + +- public void getSubItems(int var1, CreativeTabs var2, List var3) { +- for(int var4 = 0; var4 < b.length; ++var4) { +- var3.add(new ItemStack(var1, 1, var4)); +- } +- +- } +- +- public Icon getIconFromDamage(int var1) { +- if(var1 < 0 || var1 >= b.length) { +- var1 = 0; +- } +- +- return this.field_94586_c[var1]; +- } +- +- public int getMetadata(int var1) { +- return var1; +- } +- +- public String getUnlocalizedName(ItemStack var1) { +- int var2 = var1.getItemDamage(); +- if(var2 < 0 || var2 >= b.length) { ++ /** ++ * returns a list of items with the same ID, but different meta (eg: dye returns 16 items) ++ */ ++ public void getSubItems(int par1, CreativeTabs par2CreativeTabs, List par3List) { ++ for (int var4 = 0; var4 < skullTypes.length; ++var4) { ++ par3List.add(new ItemStack(par1, 1, var4)); ++ } ++ } ++ ++ /** ++ * Gets an icon index based on an item's damage value ++ */ ++ public Icon getIconFromDamage(int par1) { ++ if (par1 < 0 || par1 >= skullTypes.length) { ++ par1 = 0; ++ } ++ ++ return this.field_94586_c[par1]; ++ } ++ ++ /** ++ * Returns the metadata of the block which this Item (ItemBlock) can place ++ */ ++ public int getMetadata(int par1) { ++ return par1; ++ } ++ ++ /** ++ * Returns the unlocalized name of this item. This version accepts an ItemStack so different stacks can have different ++ * names based on their damage or NBT. ++ */ ++ public String getUnlocalizedName(ItemStack par1ItemStack) { ++ int var2 = par1ItemStack.getItemDamage(); ++ ++ if (var2 < 0 || var2 >= skullTypes.length) { + var2 = 0; + } + +- return super.getUnlocalizedName() + "." + b[var2]; +- } +- +- public String getItemDisplayName(ItemStack var1) { +- return var1.getItemDamage() == 3 && var1.hasTagCompound() && var1.getTagCompound().hasKey("SkullOwner") ? StatCollector.translateToLocalFormatted("item.skull.player.name", new Object[]{var1.getTagCompound().getString("SkullOwner")}) : super.getItemDisplayName(var1); +- } +- +- public void registerIcons(IconRegister var1) { +- this.field_94586_c = new Icon[a.length]; +- +- for(int var2 = 0; var2 < a.length; ++var2) { +- this.field_94586_c[var2] = var1.registerIcon(this.getIconString() + "_" + a[var2]); ++ return super.getUnlocalizedName() + "." + skullTypes[var2]; ++ } ++ ++ public String getItemDisplayName(ItemStack par1ItemStack) { ++ return par1ItemStack.getItemDamage() == 3 && par1ItemStack.hasTagCompound() && par1ItemStack.getTagCompound().hasKey("SkullOwner") ? StatCollector.translateToLocalFormatted("item.skull.player.name", new Object[] {par1ItemStack.getTagCompound().getString("SkullOwner")}): super.getItemDisplayName(par1ItemStack); ++ } ++ ++ public void registerIcons(IconRegister par1IconRegister) { ++ this.field_94586_c = new Icon[field_94587_a.length]; ++ ++ for (int var2 = 0; var2 < field_94587_a.length; ++var2) { ++ this.field_94586_c[var2] = par1IconRegister.registerIcon(this.getIconString() + "_" + field_94587_a[var2]); + } +- + } + } diff --git a/patches/net/minecraft/src/ItemSlab.java.patch b/patches/net/minecraft/src/ItemSlab.java.patch new file mode 100644 index 0000000..4107933 --- /dev/null +++ b/patches/net/minecraft/src/ItemSlab.java.patch @@ -0,0 +1,251 @@ +--- net/minecraft/src/ItemSlab.java ++++ net/minecraft/src/ItemSlab.java +@@ -2,130 +2,154 @@ + + public class ItemSlab extends ItemBlock { + private final boolean isFullBlock; ++ ++ /** Instance of BlockHalfSlab. */ + private final BlockHalfSlab theHalfSlab; ++ ++ /** The double-slab block corresponding to this item. */ + private final BlockHalfSlab doubleSlab; + +- public ItemSlab(int var1, BlockHalfSlab var2, BlockHalfSlab var3, boolean var4) { +- super(var1); +- this.theHalfSlab = var2; +- this.doubleSlab = var3; +- this.isFullBlock = var4; ++ public ItemSlab(int par1, BlockHalfSlab par2BlockHalfSlab, BlockHalfSlab par3BlockHalfSlab, boolean par4) { ++ super(par1); ++ this.theHalfSlab = par2BlockHalfSlab; ++ this.doubleSlab = par3BlockHalfSlab; ++ this.isFullBlock = par4; + this.setMaxDamage(0); + this.setHasSubtypes(true); + } + +- public Icon getIconFromDamage(int var1) { +- return Block.blocksList[this.itemID].getIcon(2, var1); +- } +- +- public int getMetadata(int var1) { +- return var1; +- } +- +- public String getUnlocalizedName(ItemStack var1) { +- return this.theHalfSlab.getFullSlabName(var1.getItemDamage()); +- } +- +- public boolean onItemUse(ItemStack var1, EntityPlayer var2, World var3, int var4, int var5, int var6, int var7, float var8, float var9, float var10) { +- if(this.isFullBlock) { +- return super.onItemUse(var1, var2, var3, var4, var5, var6, var7, var8, var9, var10); +- } else if(var1.stackSize == 0) { ++ /** ++ * Gets an icon index based on an item's damage value ++ */ ++ public Icon getIconFromDamage(int par1) { ++ return Block.blocksList[this.itemID].getIcon(2, par1); ++ } ++ ++ /** ++ * Returns the metadata of the block which this Item (ItemBlock) can place ++ */ ++ public int getMetadata(int par1) { ++ return par1; ++ } ++ ++ /** ++ * Returns the unlocalized name of this item. This version accepts an ItemStack so different stacks can have different ++ * names based on their damage or NBT. ++ */ ++ public String getUnlocalizedName(ItemStack par1ItemStack) { ++ return this.theHalfSlab.getFullSlabName(par1ItemStack.getItemDamage()); ++ } ++ ++ /** ++ * Callback for item usage. If the item does something special on right clicking, he will have one of those. Return ++ * True if something happen and false if it don't. This is for ITEMS, not BLOCKS ++ */ ++ public boolean onItemUse(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, World par3World, int par4, int par5, int par6, int par7, float par8, float par9, float par10) { ++ if (this.isFullBlock) { ++ return super.onItemUse(par1ItemStack, par2EntityPlayer, par3World, par4, par5, par6, par7, par8, par9, par10); ++ } else if (par1ItemStack.stackSize == 0) { + return false; +- } else if(!var2.canPlayerEdit(var4, var5, var6, var7, var1)) { ++ } else if (!par2EntityPlayer.canPlayerEdit(par4, par5, par6, par7, par1ItemStack)) { + return false; + } else { +- int var11 = var3.getBlockId(var4, var5, var6); +- int var12 = var3.getBlockMetadata(var4, var5, var6); ++ int var11 = par3World.getBlockId(par4, par5, par6); ++ int var12 = par3World.getBlockMetadata(par4, par5, par6); + int var13 = var12 & 7; + boolean var14 = (var12 & 8) != 0; +- if((var7 == 1 && !var14 || var7 == 0 && var14) && var11 == this.theHalfSlab.blockID && var13 == var1.getItemDamage()) { +- if(var3.checkNoEntityCollision(this.doubleSlab.getCollisionBoundingBoxFromPool(var3, var4, var5, var6)) && var3.setBlock(var4, var5, var6, this.doubleSlab.blockID, var13, 3)) { +- var3.playSoundEffect((double)((float)var4 + 0.5F), (double)((float)var5 + 0.5F), (double)((float)var6 + 0.5F), this.doubleSlab.stepSound.getPlaceSound(), (this.doubleSlab.stepSound.getVolume() + 1.0F) / 2.0F, this.doubleSlab.stepSound.getPitch() * 0.8F); +- --var1.stackSize; ++ ++ if ((par7 == 1 && !var14 || par7 == 0 && var14) && var11 == this.theHalfSlab.blockID && var13 == par1ItemStack.getItemDamage()) { ++ if (par3World.checkNoEntityCollision(this.doubleSlab.getCollisionBoundingBoxFromPool(par3World, par4, par5, par6)) && par3World.setBlock(par4, par5, par6, this.doubleSlab.blockID, var13, 3)) { ++ par3World.playSoundEffect((double)((float)par4 + 0.5F), (double)((float)par5 + 0.5F), (double)((float)par6 + 0.5F), this.doubleSlab.stepSound.getPlaceSound(), (this.doubleSlab.stepSound.getVolume() + 1.0F) / 2.0F, this.doubleSlab.stepSound.getPitch() * 0.8F); ++ --par1ItemStack.stackSize; + } + + return true; + } else { +- return this.func_77888_a(var1, var2, var3, var4, var5, var6, var7) ? true : super.onItemUse(var1, var2, var3, var4, var5, var6, var7, var8, var9, var10); ++ return this.func_77888_a(par1ItemStack, par2EntityPlayer, par3World, par4, par5, par6, par7) ? true : super.onItemUse(par1ItemStack, par2EntityPlayer, par3World, par4, par5, par6, par7, par8, par9, par10); + } + } + } + +- public boolean canPlaceItemBlockOnSide(World var1, int var2, int var3, int var4, int var5, EntityPlayer var6, ItemStack var7) { +- int var8 = var2; +- int var9 = var3; +- int var10 = var4; +- int var11 = var1.getBlockId(var2, var3, var4); +- int var12 = var1.getBlockMetadata(var2, var3, var4); ++ /** ++ * Returns true if the given ItemBlock can be placed on the given side of the given block position. ++ */ ++ public boolean canPlaceItemBlockOnSide(World par1World, int par2, int par3, int par4, int par5, EntityPlayer par6EntityPlayer, ItemStack par7ItemStack) { ++ int var8 = par2; ++ int var9 = par3; ++ int var10 = par4; ++ int var11 = par1World.getBlockId(par2, par3, par4); ++ int var12 = par1World.getBlockMetadata(par2, par3, par4); + int var13 = var12 & 7; + boolean var14 = (var12 & 8) != 0; +- if((var5 == 1 && !var14 || var5 == 0 && var14) && var11 == this.theHalfSlab.blockID && var13 == var7.getItemDamage()) { ++ ++ if ((par5 == 1 && !var14 || par5 == 0 && var14) && var11 == this.theHalfSlab.blockID && var13 == par7ItemStack.getItemDamage()) { + return true; + } else { +- if(var5 == 0) { +- --var3; +- } +- +- if(var5 == 1) { +- ++var3; +- } +- +- if(var5 == 2) { +- --var4; +- } +- +- if(var5 == 3) { +- ++var4; +- } +- +- if(var5 == 4) { +- --var2; +- } +- +- if(var5 == 5) { +- ++var2; +- } +- +- var11 = var1.getBlockId(var2, var3, var4); +- var12 = var1.getBlockMetadata(var2, var3, var4); ++ if (par5 == 0) { ++ --par3; ++ } ++ ++ if (par5 == 1) { ++ ++par3; ++ } ++ ++ if (par5 == 2) { ++ --par4; ++ } ++ ++ if (par5 == 3) { ++ ++par4; ++ } ++ ++ if (par5 == 4) { ++ --par2; ++ } ++ ++ if (par5 == 5) { ++ ++par2; ++ } ++ ++ var11 = par1World.getBlockId(par2, par3, par4); ++ var12 = par1World.getBlockMetadata(par2, par3, par4); + var13 = var12 & 7; + var14 = (var12 & 8) != 0; +- return var11 == this.theHalfSlab.blockID && var13 == var7.getItemDamage() ? true : super.canPlaceItemBlockOnSide(var1, var8, var9, var10, var5, var6, var7); ++ return var11 == this.theHalfSlab.blockID && var13 == par7ItemStack.getItemDamage() ? true : super.canPlaceItemBlockOnSide(par1World, var8, var9, var10, par5, par6EntityPlayer, par7ItemStack); + } + } + +- private boolean func_77888_a(ItemStack var1, EntityPlayer var2, World var3, int var4, int var5, int var6, int var7) { +- if(var7 == 0) { +- --var5; +- } +- +- if(var7 == 1) { +- ++var5; +- } +- +- if(var7 == 2) { +- --var6; +- } +- +- if(var7 == 3) { +- ++var6; +- } +- +- if(var7 == 4) { +- --var4; +- } +- +- if(var7 == 5) { +- ++var4; +- } +- +- int var8 = var3.getBlockId(var4, var5, var6); +- int var9 = var3.getBlockMetadata(var4, var5, var6); ++ private boolean func_77888_a(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, World par3World, int par4, int par5, int par6, int par7) { ++ if (par7 == 0) { ++ --par5; ++ } ++ ++ if (par7 == 1) { ++ ++par5; ++ } ++ ++ if (par7 == 2) { ++ --par6; ++ } ++ ++ if (par7 == 3) { ++ ++par6; ++ } ++ ++ if (par7 == 4) { ++ --par4; ++ } ++ ++ if (par7 == 5) { ++ ++par4; ++ } ++ ++ int var8 = par3World.getBlockId(par4, par5, par6); ++ int var9 = par3World.getBlockMetadata(par4, par5, par6); + int var10 = var9 & 7; +- if(var8 == this.theHalfSlab.blockID && var10 == var1.getItemDamage()) { +- if(var3.checkNoEntityCollision(this.doubleSlab.getCollisionBoundingBoxFromPool(var3, var4, var5, var6)) && var3.setBlock(var4, var5, var6, this.doubleSlab.blockID, var10, 3)) { +- var3.playSoundEffect((double)((float)var4 + 0.5F), (double)((float)var5 + 0.5F), (double)((float)var6 + 0.5F), this.doubleSlab.stepSound.getPlaceSound(), (this.doubleSlab.stepSound.getVolume() + 1.0F) / 2.0F, this.doubleSlab.stepSound.getPitch() * 0.8F); +- --var1.stackSize; ++ ++ if (var8 == this.theHalfSlab.blockID && var10 == par1ItemStack.getItemDamage()) { ++ if (par3World.checkNoEntityCollision(this.doubleSlab.getCollisionBoundingBoxFromPool(par3World, par4, par5, par6)) && par3World.setBlock(par4, par5, par6, this.doubleSlab.blockID, var10, 3)) { ++ par3World.playSoundEffect((double)((float)par4 + 0.5F), (double)((float)par5 + 0.5F), (double)((float)par6 + 0.5F), this.doubleSlab.stepSound.getPlaceSound(), (this.doubleSlab.stepSound.getVolume() + 1.0F) / 2.0F, this.doubleSlab.stepSound.getPitch() * 0.8F); ++ --par1ItemStack.stackSize; + } + + return true; diff --git a/patches/net/minecraft/src/ItemSnow.java.patch b/patches/net/minecraft/src/ItemSnow.java.patch new file mode 100644 index 0000000..071ba3c --- /dev/null +++ b/patches/net/minecraft/src/ItemSnow.java.patch @@ -0,0 +1,50 @@ +--- net/minecraft/src/ItemSnow.java ++++ net/minecraft/src/ItemSnow.java +@@ -1,29 +1,35 @@ + package net.minecraft.src; + + public class ItemSnow extends ItemBlockWithMetadata { +- public ItemSnow(int var1, Block var2) { +- super(var1, var2); ++ public ItemSnow(int par1, Block par2Block) { ++ super(par1, par2Block); + } + +- public boolean onItemUse(ItemStack var1, EntityPlayer var2, World var3, int var4, int var5, int var6, int var7, float var8, float var9, float var10) { +- if(var1.stackSize == 0) { ++ /** ++ * Callback for item usage. If the item does something special on right clicking, he will have one of those. Return ++ * True if something happen and false if it don't. This is for ITEMS, not BLOCKS ++ */ ++ public boolean onItemUse(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, World par3World, int par4, int par5, int par6, int par7, float par8, float par9, float par10) { ++ if (par1ItemStack.stackSize == 0) { + return false; +- } else if(!var2.canPlayerEdit(var4, var5, var6, var7, var1)) { ++ } else if (!par2EntityPlayer.canPlayerEdit(par4, par5, par6, par7, par1ItemStack)) { + return false; + } else { +- int var11 = var3.getBlockId(var4, var5, var6); +- if(var11 == Block.snow.blockID) { ++ int var11 = par3World.getBlockId(par4, par5, par6); ++ ++ if (var11 == Block.snow.blockID) { + Block var12 = Block.blocksList[this.getBlockID()]; +- int var13 = var3.getBlockMetadata(var4, var5, var6); ++ int var13 = par3World.getBlockMetadata(par4, par5, par6); + int var14 = var13 & 7; +- if(var14 <= 6 && var3.checkNoEntityCollision(var12.getCollisionBoundingBoxFromPool(var3, var4, var5, var6)) && var3.setBlockMetadata(var4, var5, var6, var14 + 1 | var13 & -8, 2)) { +- var3.playSoundEffect((double)((float)var4 + 0.5F), (double)((float)var5 + 0.5F), (double)((float)var6 + 0.5F), var12.stepSound.getPlaceSound(), (var12.stepSound.getVolume() + 1.0F) / 2.0F, var12.stepSound.getPitch() * 0.8F); +- --var1.stackSize; ++ ++ if (var14 <= 6 && par3World.checkNoEntityCollision(var12.getCollisionBoundingBoxFromPool(par3World, par4, par5, par6)) && par3World.setBlockMetadataWithNotify(par4, par5, par6, var14 + 1 | var13 & -8, 2)) { ++ par3World.playSoundEffect((double)((float)par4 + 0.5F), (double)((float)par5 + 0.5F), (double)((float)par6 + 0.5F), var12.stepSound.getPlaceSound(), (var12.stepSound.getVolume() + 1.0F) / 2.0F, var12.stepSound.getPitch() * 0.8F); ++ --par1ItemStack.stackSize; + return true; + } + } + +- return super.onItemUse(var1, var2, var3, var4, var5, var6, var7, var8, var9, var10); ++ return super.onItemUse(par1ItemStack, par2EntityPlayer, par3World, par4, par5, par6, par7, par8, par9, par10); + } + } + } diff --git a/patches/net/minecraft/src/ItemSnowball.java.patch b/patches/net/minecraft/src/ItemSnowball.java.patch new file mode 100644 index 0000000..0edf20f --- /dev/null +++ b/patches/net/minecraft/src/ItemSnowball.java.patch @@ -0,0 +1,42 @@ +--- net/minecraft/src/ItemSnowball.java ++++ net/minecraft/src/ItemSnowball.java +@@ -1,22 +1,26 @@ + package net.minecraft.src; + + public class ItemSnowball extends Item { +- public ItemSnowball(int var1) { +- super(var1); ++ public ItemSnowball(int par1) { ++ super(par1); + this.maxStackSize = 16; + this.setCreativeTab(CreativeTabs.tabMisc); + } + +- public ItemStack onItemRightClick(ItemStack var1, World var2, EntityPlayer var3) { +- if(!var3.capabilities.isCreativeMode) { +- --var1.stackSize; +- } +- +- var2.playSoundAtEntity(var3, "random.bow", 0.5F, 0.4F / (f.nextFloat() * 0.4F + 0.8F)); +- if(!var2.isRemote) { +- var2.spawnEntityInWorld(new EntitySnowball(var2, var3)); +- } +- +- return var1; ++ /** ++ * Called whenever this item is equipped and the right mouse button is pressed. Args: itemStack, world, entityPlayer ++ */ ++ public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) { ++ if (!par3EntityPlayer.capabilities.isCreativeMode) { ++ --par1ItemStack.stackSize; ++ } ++ ++ par2World.playSoundAtEntity(par3EntityPlayer, "random.bow", 0.5F, 0.4F / (itemRand.nextFloat() * 0.4F + 0.8F)); ++ ++ if (!par2World.isRemote) { ++ par2World.spawnEntityInWorld(new EntitySnowball(par2World, par3EntityPlayer)); ++ } ++ ++ return par1ItemStack; + } + } diff --git a/patches/net/minecraft/src/ItemSoup.java.patch b/patches/net/minecraft/src/ItemSoup.java.patch new file mode 100644 index 0000000..d37200a --- /dev/null +++ b/patches/net/minecraft/src/ItemSoup.java.patch @@ -0,0 +1,20 @@ +--- net/minecraft/src/ItemSoup.java ++++ net/minecraft/src/ItemSoup.java +@@ -1,13 +1,13 @@ + package net.minecraft.src; + + public class ItemSoup extends ItemFood { +- public ItemSoup(int var1, int var2) { +- super(var1, var2, false); ++ public ItemSoup(int par1, int par2) { ++ super(par1, par2, false); + this.setMaxStackSize(1); + } + +- public ItemStack onEaten(ItemStack var1, World var2, EntityPlayer var3) { +- super.onEaten(var1, var2, var3); ++ public ItemStack onEaten(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) { ++ super.onEaten(par1ItemStack, par2World, par3EntityPlayer); + return new ItemStack(Item.bowlEmpty); + } + } diff --git a/patches/net/minecraft/src/ItemSpade.java.patch b/patches/net/minecraft/src/ItemSpade.java.patch new file mode 100644 index 0000000..2b72062 --- /dev/null +++ b/patches/net/minecraft/src/ItemSpade.java.patch @@ -0,0 +1,27 @@ +--- net/minecraft/src/ItemSpade.java ++++ net/minecraft/src/ItemSpade.java +@@ -1,13 +1,18 @@ + package net.minecraft.src; + + public class ItemSpade extends ItemTool { +- private static Block[] blocksEffectiveAgainst = new Block[]{Block.grass, Block.dirt, Block.sand, Block.gravel, Block.snow, Block.blockSnow, Block.blockClay, Block.tilledField, Block.slowSand, Block.mycelium}; +- +- public ItemSpade(int var1, EnumToolMaterial var2) { +- super(var1, 1.0F, var2, blocksEffectiveAgainst); ++ ++ /** an array of the blocks this spade is effective against */ ++ private static Block[] blocksEffectiveAgainst = new Block[] {Block.grass, Block.dirt, Block.sand, Block.gravel, Block.snow, Block.blockSnow, Block.blockClay, Block.tilledField, Block.slowSand, Block.mycelium}; ++ ++ public ItemSpade(int par1, EnumToolMaterial par2EnumToolMaterial) { ++ super(par1, 1.0F, par2EnumToolMaterial, blocksEffectiveAgainst); + } + +- public boolean canHarvestBlock(Block var1) { +- return var1 == Block.snow ? true : var1 == Block.blockSnow; ++ /** ++ * Returns if the item (tool) can harvest results from the block type. ++ */ ++ public boolean canHarvestBlock(Block par1Block) { ++ return par1Block == Block.snow ? true : par1Block == Block.blockSnow; + } + } diff --git a/patches/net/minecraft/src/ItemStack.java.patch b/patches/net/minecraft/src/ItemStack.java.patch new file mode 100644 index 0000000..c0a1898 --- /dev/null +++ b/patches/net/minecraft/src/ItemStack.java.patch @@ -0,0 +1,955 @@ +--- net/minecraft/src/ItemStack.java ++++ net/minecraft/src/ItemStack.java +@@ -1,80 +1,111 @@ + package net.minecraft.src; + +-import com.google.common.collect.HashMultimap; +-import com.google.common.collect.Multimap; + import java.text.DecimalFormat; + import java.util.ArrayList; + import java.util.Iterator; + import java.util.List; +-import java.util.Random; + import java.util.Map.Entry; +- +-public final class ItemStack { +- public static final DecimalFormat a = new DecimalFormat("#.###"); ++import java.util.Random; ++ ++import com.google.common.collect.HashMultimap; ++import com.google.common.collect.Multimap; ++ ++import org.spoutcraft.client.config.Configuration; ++import org.spoutcraft.client.inventory.InventoryUtil; ++ ++// Spout Start - Removed final ++public class ItemStack { ++// Spout End ++ ++ public static final DecimalFormat field_111284_a = new DecimalFormat("#.###"); ++ /** Size of the stack. */ + public int stackSize; ++ ++ /** ++ * Number of animation frames to go when receiving an item (by walking into it, for example). ++ */ + public int animationsToGo; ++ ++ /** ID of the item. */ + public int itemID; ++ ++ /** ++ * A NBTTagMap containing data about an ItemStack. Can only be used for non stackable items ++ */ + public NBTTagCompound stackTagCompound; ++ ++ /** Damage dealt to the item or number of use. Raise when using items. */ + private int itemDamage; ++ ++ /** Item frame this stack is on, or null if not on an item frame. */ + private EntityItemFrame itemFrame; + +- public ItemStack(Block var1) { +- this((Block)var1, 1); +- } +- +- public ItemStack(Block var1, int var2) { +- this(var1.blockID, var2, 0); +- } +- +- public ItemStack(Block var1, int var2, int var3) { +- this(var1.blockID, var2, var3); +- } +- +- public ItemStack(Item var1) { +- this(var1.itemID, 1, 0); +- } +- +- public ItemStack(Item var1, int var2) { +- this(var1.itemID, var2, 0); +- } +- +- public ItemStack(Item var1, int var2, int var3) { +- this(var1.itemID, var2, var3); +- } +- +- public ItemStack(int var1, int var2, int var3) { +- this.itemID = var1; +- this.stackSize = var2; +- this.itemDamage = var3; +- if(this.itemDamage < 0) { ++ public ItemStack(Block par1Block) { ++ this(par1Block, 1); ++ } ++ ++ public ItemStack(Block par1Block, int par2) { ++ this(par1Block.blockID, par2, 0); ++ } ++ ++ public ItemStack(Block par1Block, int par2, int par3) { ++ this(par1Block.blockID, par2, par3); ++ } ++ ++ public ItemStack(Item par1Item) { ++ this(par1Item.itemID, 1, 0); ++ } ++ ++ public ItemStack(Item par1Item, int par2) { ++ this(par1Item.itemID, par2, 0); ++ } ++ ++ public ItemStack(Item par1Item, int par2, int par3) { ++ this(par1Item.itemID, par2, par3); ++ } ++ ++ public ItemStack(int par1, int par2, int par3) { ++ this.itemID = par1; ++ this.stackSize = par2; ++ this.itemDamage = par3; ++ ++ if (this.itemDamage < 0) { + this.itemDamage = 0; + } +- + } + +- public static ItemStack loadItemStackFromNBT(NBTTagCompound var0) { ++ public static ItemStack loadItemStackFromNBT(NBTTagCompound par0NBTTagCompound) { + ItemStack var1 = new ItemStack(); +- var1.readFromNBT(var0); ++ var1.readFromNBT(par0NBTTagCompound); + return var1.getItem() != null ? var1 : null; + } + +- private ItemStack() { +- } +- +- public ItemStack splitStack(int var1) { +- ItemStack var2 = new ItemStack(this.itemID, var1, this.itemDamage); +- if(this.stackTagCompound != null) { ++ private ItemStack() {} ++ ++ /** ++ * Remove the argument from the stack size. Return a new stack object with argument size. ++ */ ++ public ItemStack splitStack(int par1) { ++ ItemStack var2 = new ItemStack(this.itemID, par1, this.itemDamage); ++ ++ if (this.stackTagCompound != null) { + var2.stackTagCompound = (NBTTagCompound)this.stackTagCompound.copy(); + } + +- this.stackSize -= var1; ++ this.stackSize -= par1; + return var2; + } + ++ /** ++ * Returns the object corresponding to the stack. ++ */ + public Item getItem() { + return Item.itemsList[this.itemID]; + } + ++ /** ++ * Returns the icon index of the current stack. ++ */ + public Icon getIconIndex() { + return this.getItem().getIconIndex(this); + } +@@ -83,60 +114,90 @@ + return this.getItem().getSpriteNumber(); + } + +- public boolean tryPlaceItemIntoWorld(EntityPlayer var1, World var2, int var3, int var4, int var5, int var6, float var7, float var8, float var9) { +- boolean var10 = this.getItem().onItemUse(this, var1, var2, var3, var4, var5, var6, var7, var8, var9); +- if(var10) { +- var1.addStat(StatList.objectUseStats[this.itemID], 1); +- } ++ public boolean tryPlaceItemIntoWorld(EntityPlayer par1EntityPlayer, World par2World, int par3, int par4, int par5, int par6, float par7, float par8, float par9) { ++ boolean var10 = this.getItem().onItemUse(this, par1EntityPlayer, par2World, par3, par4, par5, par6, par7, par8, par9); ++ ++ if (var10) { ++ par1EntityPlayer.addStat(StatList.objectUseStats[this.itemID], 1); ++ } ++ ++ // Spout Start ++ if (var10 && stackSize == 0 && getItem() instanceof ItemBlock && Configuration.isReplaceBlocks()) { ++ InventoryUtil.replaceItem(this.itemID, getItem().getMetadata(this.getItemDamage())); ++ } ++ // Spout End + + return var10; + } + +- public float getStrVsBlock(Block var1) { +- return this.getItem().getStrVsBlock(this, var1); +- } +- +- public ItemStack useItemRightClick(World var1, EntityPlayer var2) { +- return this.getItem().onItemRightClick(this, var1, var2); +- } +- +- public ItemStack onFoodEaten(World var1, EntityPlayer var2) { +- return this.getItem().onEaten(this, var1, var2); +- } +- +- public NBTTagCompound writeToNBT(NBTTagCompound var1) { +- var1.setShort("id", (short)this.itemID); +- var1.setByte("Count", (byte)this.stackSize); +- var1.setShort("Damage", (short)this.itemDamage); +- if(this.stackTagCompound != null) { +- var1.setTag("tag", this.stackTagCompound); ++ /** ++ * Returns the strength of the stack against a given block. ++ */ ++ public float getStrVsBlock(Block par1Block) { ++ return this.getItem().getStrVsBlock(this, par1Block); ++ } ++ ++ /** ++ * Called whenever this item stack is equipped and right clicked. Returns the new item stack to put in the position ++ * where this item is. Args: world, player ++ */ ++ public ItemStack useItemRightClick(World par1World, EntityPlayer par2EntityPlayer) { ++ return this.getItem().onItemRightClick(this, par1World, par2EntityPlayer); ++ } ++ ++ public ItemStack onFoodEaten(World par1World, EntityPlayer par2EntityPlayer) { ++ return this.getItem().onEaten(this, par1World, par2EntityPlayer); ++ } ++ ++ /** ++ * Write the stack fields to a NBT object. Return the new NBT object. ++ */ ++ public NBTTagCompound writeToNBT(NBTTagCompound par1NBTTagCompound) { ++ par1NBTTagCompound.setShort("id", (short)this.itemID); ++ par1NBTTagCompound.setByte("Count", (byte)this.stackSize); ++ par1NBTTagCompound.setShort("Damage", (short)this.itemDamage); ++ ++ if (this.stackTagCompound != null) { ++ par1NBTTagCompound.setTag("tag", this.stackTagCompound); + } + +- return var1; ++ return par1NBTTagCompound; + } + +- public void readFromNBT(NBTTagCompound var1) { +- this.itemID = var1.getShort("id"); +- this.stackSize = var1.getByte("Count"); +- this.itemDamage = var1.getShort("Damage"); +- if(this.itemDamage < 0) { ++ /** ++ * Read the stack fields from a NBT object. ++ */ ++ public void readFromNBT(NBTTagCompound par1NBTTagCompound) { ++ this.itemID = par1NBTTagCompound.getShort("id"); ++ this.stackSize = par1NBTTagCompound.getByte("Count"); ++ this.itemDamage = par1NBTTagCompound.getShort("Damage"); ++ ++ if (this.itemDamage < 0) { + this.itemDamage = 0; + } + +- if(var1.hasKey("tag")) { +- this.stackTagCompound = var1.getCompoundTag("tag"); ++ if (par1NBTTagCompound.hasKey("tag")) { ++ this.stackTagCompound = par1NBTTagCompound.getCompoundTag("tag"); + } +- + } + ++ /** ++ * Returns maximum size of the stack. ++ */ + public int getMaxStackSize() { + return this.getItem().getItemStackLimit(); + } + ++ /** ++ * Returns true if the ItemStack can hold 2 or more units of the item. ++ */ + public boolean isStackable() { + return this.getMaxStackSize() > 1 && (!this.isItemStackDamageable() || !this.isItemDamaged()); + } + ++ /** ++ * true if this itemStack is damageable ++ */ + public boolean isItemStackDamageable() { + return Item.itemsList[this.itemID].getMaxDamage() > 0; + } +@@ -145,152 +206,210 @@ + return Item.itemsList[this.itemID].getHasSubtypes(); + } + ++ /** ++ * returns true when a damageable item is damaged ++ */ + public boolean isItemDamaged() { + return this.isItemStackDamageable() && this.itemDamage > 0; + } + ++ /** ++ * gets the damage of an itemstack, for displaying purposes ++ */ + public int getItemDamageForDisplay() { + return this.itemDamage; + } + ++ /** ++ * gets the damage of an itemstack ++ */ + public int getItemDamage() { + return this.itemDamage; + } + +- public void setItemDamage(int var1) { +- this.itemDamage = var1; +- if(this.itemDamage < 0) { ++ /** ++ * Sets the item damage of the ItemStack. ++ */ ++ public void setItemDamage(int par1) { ++ this.itemDamage = par1; ++ ++ if (this.itemDamage < 0) { + this.itemDamage = 0; + } +- + } + ++ /** ++ * Returns the max damage an item in the stack can take. ++ */ + public int getMaxDamage() { + return Item.itemsList[this.itemID].getMaxDamage(); + } + +- public boolean attemptDamageItem(int var1, Random var2) { +- if(!this.isItemStackDamageable()) { ++ /** ++ * Attempts to damage the ItemStack with par1 amount of damage, If the ItemStack has the Unbreaking enchantment there ++ * is a chance for each point of damage to be negated. Returns true if it takes more damage than getMaxDamage(). ++ * Returns false otherwise or if the ItemStack can't be damaged or if all points of damage are negated. ++ */ ++ public boolean attemptDamageItem(int par1, Random par2Random) { ++ if (!this.isItemStackDamageable()) { + return false; + } else { +- if(var1 > 0) { ++ if (par1 > 0) { + int var3 = EnchantmentHelper.getEnchantmentLevel(Enchantment.unbreaking.effectId, this); + int var4 = 0; + +- for(int var5 = 0; var3 > 0 && var5 < var1; ++var5) { +- if(EnchantmentDurability.negateDamage(this, var3, var2)) { ++ for (int var5 = 0; var3 > 0 && var5 < par1; ++var5) { ++ if (EnchantmentDurability.negateDamage(this, var3, par2Random)) { + ++var4; + } + } + +- var1 -= var4; +- if(var1 <= 0) { ++ par1 -= var4; ++ ++ if (par1 <= 0) { + return false; + } + } + +- this.itemDamage += var1; ++ this.itemDamage += par1; + return this.itemDamage > this.getMaxDamage(); + } + } + +- public void damageItem(int var1, EntityLivingBase var2) { +- if(!(var2 instanceof EntityPlayer) || !((EntityPlayer)var2).capabilities.isCreativeMode) { +- if(this.isItemStackDamageable()) { +- if(this.attemptDamageItem(var1, var2.getRNG())) { +- var2.renderBrokenItemStack(this); ++ /** ++ * Damages the item in the ItemStack ++ */ ++ public void damageItem(int par1, EntityLivingBase par2EntityLivingBase) { ++ if (!(par2EntityLivingBase instanceof EntityPlayer) || !((EntityPlayer)par2EntityLivingBase).capabilities.isCreativeMode) { ++ if (this.isItemStackDamageable()) { ++ if (this.attemptDamageItem(par1, par2EntityLivingBase.getRNG())) { ++ par2EntityLivingBase.renderBrokenItemStack(this); + --this.stackSize; +- if(var2 instanceof EntityPlayer) { +- EntityPlayer var3 = (EntityPlayer)var2; ++ ++ if (par2EntityLivingBase instanceof EntityPlayer) { ++ EntityPlayer var3 = (EntityPlayer)par2EntityLivingBase; + var3.addStat(StatList.objectBreakStats[this.itemID], 1); +- if(this.stackSize == 0 && this.getItem() instanceof ItemBow) { ++ ++ if (this.stackSize == 0 && this.getItem() instanceof ItemBow) { + var3.destroyCurrentEquippedItem(); + } + } + +- if(this.stackSize < 0) { ++ if (this.stackSize < 0) { + this.stackSize = 0; + } + + this.itemDamage = 0; ++ ++ // Spout Start ++ if (stackSize == 0 && Configuration.isReplaceTools()) { ++ InventoryUtil.replaceItem(this.itemID, -1); ++ } ++ // Spout End + } +- + } + } + } + +- public void hitEntity(EntityLivingBase var1, EntityPlayer var2) { +- boolean var3 = Item.itemsList[this.itemID].hitEntity(this, var1, var2); +- if(var3) { +- var2.addStat(StatList.objectUseStats[this.itemID], 1); +- } +- +- } +- +- public void onBlockDestroyed(World var1, int var2, int var3, int var4, int var5, EntityPlayer var6) { +- boolean var7 = Item.itemsList[this.itemID].onBlockDestroyed(this, var1, var2, var3, var4, var5, var6); +- if(var7) { +- var6.addStat(StatList.objectUseStats[this.itemID], 1); +- } +- +- } +- +- public boolean canHarvestBlock(Block var1) { +- return Item.itemsList[this.itemID].canHarvestBlock(var1); +- } +- +- public boolean func_111282_a(EntityPlayer var1, EntityLivingBase var2) { +- return Item.itemsList[this.itemID].itemInteractionForEntity(this, var1, var2); +- } +- ++ /** ++ * Calls the corresponding fct in di ++ */ ++ public void hitEntity(EntityLivingBase par1EntityLivingBase, EntityPlayer par2EntityPlayer) { ++ boolean var3 = Item.itemsList[this.itemID].hitEntity(this, par1EntityLivingBase, par2EntityPlayer); ++ ++ if (var3) { ++ par2EntityPlayer.addStat(StatList.objectUseStats[this.itemID], 1); ++ } ++ } ++ ++ public void onBlockDestroyed(World par1World, int par2, int par3, int par4, int par5, EntityPlayer par6EntityPlayer) { ++ boolean var7 = Item.itemsList[this.itemID].onBlockDestroyed(this, par1World, par2, par3, par4, par5, par6EntityPlayer); ++ ++ if (var7) { ++ par6EntityPlayer.addStat(StatList.objectUseStats[this.itemID], 1); ++ } ++ } ++ ++ /** ++ * Checks if the itemStack object can harvest a specified block ++ */ ++ public boolean canHarvestBlock(Block par1Block) { ++ return Item.itemsList[this.itemID].canHarvestBlock(par1Block); ++ } ++ ++ public boolean func_111282_a(EntityPlayer par1EntityPlayer, EntityLivingBase par2EntityLivingBase) { ++ return Item.itemsList[this.itemID].itemInteractionForEntity(this, par1EntityPlayer, par2EntityLivingBase); ++ } ++ ++ /** ++ * Returns a new stack with the same properties. ++ */ + public ItemStack copy() { + ItemStack var1 = new ItemStack(this.itemID, this.stackSize, this.itemDamage); +- if(this.stackTagCompound != null) { ++ ++ if (this.stackTagCompound != null) { + var1.stackTagCompound = (NBTTagCompound)this.stackTagCompound.copy(); + } + + return var1; + } + +- public static boolean areItemStackTagsEqual(ItemStack var0, ItemStack var1) { +- return var0 == null && var1 == null ? true : (var0 != null && var1 != null ? (var0.stackTagCompound == null && var1.stackTagCompound != null ? false : var0.stackTagCompound == null || var0.stackTagCompound.equals(var1.stackTagCompound)) : false); +- } +- +- public static boolean areItemStacksEqual(ItemStack var0, ItemStack var1) { +- return var0 == null && var1 == null ? true : (var0 != null && var1 != null ? var0.isItemStackEqual(var1) : false); +- } +- +- private boolean isItemStackEqual(ItemStack var1) { +- return this.stackSize != var1.stackSize ? false : (this.itemID != var1.itemID ? false : (this.itemDamage != var1.itemDamage ? false : (this.stackTagCompound == null && var1.stackTagCompound != null ? false : this.stackTagCompound == null || this.stackTagCompound.equals(var1.stackTagCompound)))); +- } +- +- public boolean isItemEqual(ItemStack var1) { +- return this.itemID == var1.itemID && this.itemDamage == var1.itemDamage; ++ public static boolean areItemStackTagsEqual(ItemStack par0ItemStack, ItemStack par1ItemStack) { ++ return par0ItemStack == null && par1ItemStack == null ? true : (par0ItemStack != null && par1ItemStack != null ? (par0ItemStack.stackTagCompound == null && par1ItemStack.stackTagCompound != null ? false : par0ItemStack.stackTagCompound == null || par0ItemStack.stackTagCompound.equals(par1ItemStack.stackTagCompound)) : false); ++ } ++ ++ /** ++ * compares ItemStack argument1 with ItemStack argument2; returns true if both ItemStacks are equal ++ */ ++ public static boolean areItemStacksEqual(ItemStack par0ItemStack, ItemStack par1ItemStack) { ++ return par0ItemStack == null && par1ItemStack == null ? true : (par0ItemStack != null && par1ItemStack != null ? par0ItemStack.isItemStackEqual(par1ItemStack) : false); ++ } ++ ++ /** ++ * compares ItemStack argument to the instance ItemStack; returns true if both ItemStacks are equal ++ */ ++ private boolean isItemStackEqual(ItemStack par1ItemStack) { ++ return this.stackSize != par1ItemStack.stackSize ? false : (this.itemID != par1ItemStack.itemID ? false : (this.itemDamage != par1ItemStack.itemDamage ? false : (this.stackTagCompound == null && par1ItemStack.stackTagCompound != null ? false : this.stackTagCompound == null || this.stackTagCompound.equals(par1ItemStack.stackTagCompound)))); ++ } ++ ++ /** ++ * compares ItemStack argument to the instance ItemStack; returns true if the Items contained in both ItemStacks are ++ * equal ++ */ ++ public boolean isItemEqual(ItemStack par1ItemStack) { ++ return this.itemID == par1ItemStack.itemID && this.itemDamage == par1ItemStack.itemDamage; + } + + public String getUnlocalizedName() { + return Item.itemsList[this.itemID].getUnlocalizedName(this); + } + +- public static ItemStack copyItemStack(ItemStack var0) { +- return var0 == null ? null : var0.copy(); ++ /** ++ * Creates a copy of a ItemStack, a null parameters will return a null. ++ */ ++ public static ItemStack copyItemStack(ItemStack par0ItemStack) { ++ return par0ItemStack == null ? null : par0ItemStack.copy(); + } + + public String toString() { + return this.stackSize + "x" + Item.itemsList[this.itemID].getUnlocalizedName() + "@" + this.itemDamage; + } + +- public void updateAnimation(World var1, Entity var2, int var3, boolean var4) { +- if(this.animationsToGo > 0) { ++ /** ++ * Called each tick as long the ItemStack in on player inventory. Used to progress the pickup animation and update ++ * maps. ++ */ ++ public void updateAnimation(World par1World, Entity par2Entity, int par3, boolean par4) { ++ if (this.animationsToGo > 0) { + --this.animationsToGo; + } + +- Item.itemsList[this.itemID].onUpdate(this, var1, var2, var3, var4); ++ Item.itemsList[this.itemID].onUpdate(this, par1World, par2Entity, par3, par4); + } + +- public void onCrafting(World var1, EntityPlayer var2, int var3) { +- var2.addStat(StatList.objectCraftStats[this.itemID], var3); +- Item.itemsList[this.itemID].onCreated(this, var1, var2); ++ public void onCrafting(World par1World, EntityPlayer par2EntityPlayer, int par3) { ++ par2EntityPlayer.addStat(StatList.objectCraftStats[this.itemID], par3); ++ Item.itemsList[this.itemID].onCreated(this, par1World, par2EntityPlayer); + } + + public int getMaxItemUseDuration() { +@@ -301,31 +420,69 @@ + return this.getItem().getItemUseAction(this); + } + +- public void onPlayerStoppedUsing(World var1, EntityPlayer var2, int var3) { +- this.getItem().onPlayerStoppedUsing(this, var1, var2, var3); ++ /** ++ * Called when the player releases the use item button. Args: world, entityplayer, itemInUseCount ++ */ ++ public void onPlayerStoppedUsing(World par1World, EntityPlayer par2EntityPlayer, int par3) { ++ this.getItem().onPlayerStoppedUsing(this, par1World, par2EntityPlayer, par3); + } + ++ /** ++ * Returns true if the ItemStack has an NBTTagCompound. Currently used to store enchantments. ++ */ + public boolean hasTagCompound() { + return this.stackTagCompound != null; + } + ++ /** ++ * Returns the NBTTagCompound of the ItemStack. ++ */ + public NBTTagCompound getTagCompound() { + return this.stackTagCompound; + } + + public NBTTagList getEnchantmentTagList() { ++ // Spout Start ++ NBTTagList list = getAllEnchantmentTagList(); ++ if (list == null) { ++ return null; ++ } ++ list = (NBTTagList) list.copy(); ++ for (int i = 0; i < list.tagCount(); i++) { ++ NBTBase tag = list.tagAt(i); ++ if (tag instanceof NBTTagCompound) { ++ NBTTagCompound ench = (NBTTagCompound) tag; ++ short id = ench.getShort("id"); ++ if (id > 200) { ++ list.tagList.remove(ench); ++ } ++ } ++ } ++ return list; ++ } ++ ++ public NBTTagList getAllEnchantmentTagList() { ++ // Spout End + return this.stackTagCompound == null ? null : (NBTTagList)this.stackTagCompound.getTag("ench"); + } + +- public void setTagCompound(NBTTagCompound var1) { +- this.stackTagCompound = var1; ++ /** ++ * Assigns a NBTTagCompound to the ItemStack, minecraft validates that only non-stackable items can have it. ++ */ ++ public void setTagCompound(NBTTagCompound par1NBTTagCompound) { ++ this.stackTagCompound = par1NBTTagCompound; + } + ++ /** ++ * returns the display name of the itemstack ++ */ + public String getDisplayName() { + String var1 = this.getItem().getItemDisplayName(this); +- if(this.stackTagCompound != null && this.stackTagCompound.hasKey("display")) { ++ ++ if (this.stackTagCompound != null && this.stackTagCompound.hasKey("display")) { + NBTTagCompound var2 = this.stackTagCompound.getCompoundTag("display"); +- if(var2.hasKey("Name")) { ++ ++ if (var2.hasKey("Name")) { + var1 = var2.getString("Name"); + } + } +@@ -333,129 +490,147 @@ + return var1; + } + +- public void setItemName(String var1) { +- if(this.stackTagCompound == null) { ++ /** ++ * Sets the item's name (used by anvil to rename the items). ++ */ ++ public void setItemName(String par1Str) { ++ if (this.stackTagCompound == null) { + this.stackTagCompound = new NBTTagCompound("tag"); + } + +- if(!this.stackTagCompound.hasKey("display")) { ++ if (!this.stackTagCompound.hasKey("display")) { + this.stackTagCompound.setCompoundTag("display", new NBTTagCompound()); + } + +- this.stackTagCompound.getCompoundTag("display").setString("Name", var1); ++ this.stackTagCompound.getCompoundTag("display").setString("Name", par1Str); + } +- ++ + public void func_135074_t() { +- if(this.stackTagCompound != null) { +- if(this.stackTagCompound.hasKey("display")) { ++ if (this.stackTagCompound != null) { ++ if (this.stackTagCompound.hasKey("display")) { + NBTTagCompound var1 = this.stackTagCompound.getCompoundTag("display"); + var1.removeTag("Name"); +- if(var1.hasNoTags()) { ++ ++ if (var1.hasNoTags()) { + this.stackTagCompound.removeTag("display"); +- if(this.stackTagCompound.hasNoTags()) { ++ ++ if (this.stackTagCompound.hasNoTags()) { + this.setTagCompound((NBTTagCompound)null); + } + } +- + } + } + } + ++ /** ++ * Returns true if the itemstack has a display name ++ */ + public boolean hasDisplayName() { + return this.stackTagCompound == null ? false : (!this.stackTagCompound.hasKey("display") ? false : this.stackTagCompound.getCompoundTag("display").hasKey("Name")); + } + +- public List getTooltip(EntityPlayer var1, boolean var2) { ++ /** ++ * Return a list of strings containing information about the item ++ */ ++ public List getTooltip(EntityPlayer par1EntityPlayer, boolean par2) { + ArrayList var3 = new ArrayList(); + Item var4 = Item.itemsList[this.itemID]; + String var5 = this.getDisplayName(); +- if(this.hasDisplayName()) { ++ ++ if (this.hasDisplayName()) { + var5 = EnumChatFormatting.ITALIC + var5 + EnumChatFormatting.RESET; + } + +- if(var2) { ++ if (par2) { + String var6 = ""; +- if(var5.length() > 0) { ++ ++ if (var5.length() > 0) { + var5 = var5 + " ("; + var6 = ")"; + } + +- if(this.getHasSubtypes()) { +- var5 = var5 + String.format("#%04d/%d%s", new Object[]{Integer.valueOf(this.itemID), Integer.valueOf(this.itemDamage), var6}); ++ if (this.getHasSubtypes()) { ++ var5 = var5 + String.format("#%04d/%d%s", new Object[] {Integer.valueOf(this.itemID), Integer.valueOf(this.itemDamage), var6}); + } else { +- var5 = var5 + String.format("#%04d%s", new Object[]{Integer.valueOf(this.itemID), var6}); ++ var5 = var5 + String.format("#%04d%s", new Object[] {Integer.valueOf(this.itemID), var6}); + } +- } else if(!this.hasDisplayName() && this.itemID == Item.map.itemID) { ++ } else if (!this.hasDisplayName() && this.itemID == Item.map.itemID) { + var5 = var5 + " #" + this.itemDamage; + } + + var3.add(var5); +- var4.addInformation(this, var1, var3, var2); +- if(this.hasTagCompound()) { ++ var4.addInformation(this, par1EntityPlayer, var3, par2); ++ ++ if (this.hasTagCompound()) { + NBTTagList var14 = this.getEnchantmentTagList(); +- if(var14 != null) { +- for(int var7 = 0; var7 < var14.tagCount(); ++var7) { ++ ++ if (var14 != null) { ++ for (int var7 = 0; var7 < var14.tagCount(); ++var7) { + short var8 = ((NBTTagCompound)var14.tagAt(var7)).getShort("id"); + short var9 = ((NBTTagCompound)var14.tagAt(var7)).getShort("lvl"); +- if(Enchantment.enchantmentsList[var8] != null) { ++ ++ if (Enchantment.enchantmentsList[var8] != null) { + var3.add(Enchantment.enchantmentsList[var8].getTranslatedName(var9)); + } + } + } + +- if(this.stackTagCompound.hasKey("display")) { +- NBTTagCompound var16 = this.stackTagCompound.getCompoundTag("display"); +- if(var16.hasKey("color")) { +- if(var2) { +- var3.add("Color: #" + Integer.toHexString(var16.getInteger("color")).toUpperCase()); ++ if (this.stackTagCompound.hasKey("display")) { ++ NBTTagCompound var17 = this.stackTagCompound.getCompoundTag("display"); ++ ++ if (var17.hasKey("color")) { ++ if (par2) { ++ var3.add("Color: #" + Integer.toHexString(var17.getInteger("color")).toUpperCase()); + } else { + var3.add(EnumChatFormatting.ITALIC + StatCollector.translateToLocal("item.dyed")); + } + } + +- if(var16.hasKey("Lore")) { +- NBTTagList var18 = var16.getTagList("Lore"); +- if(var18.tagCount() > 0) { +- for(int var20 = 0; var20 < var18.tagCount(); ++var20) { +- var3.add(EnumChatFormatting.DARK_PURPLE + "" + EnumChatFormatting.ITALIC + ((NBTTagString)var18.tagAt(var20)).a); ++ if (var17.hasKey("Lore")) { ++ NBTTagList var19 = var17.getTagList("Lore"); ++ ++ if (var19.tagCount() > 0) { ++ for (int var20 = 0; var20 < var19.tagCount(); ++var20) { ++ var3.add(EnumChatFormatting.DARK_PURPLE + "" + EnumChatFormatting.ITALIC + ((NBTTagString)var19.tagAt(var20)).data); + } + } + } + } + } + +- Multimap var15 = this.getAttributeModifiers(); +- if(!var15.isEmpty()) { ++ Multimap var16 = this.getAttributeModifiers(); ++ ++ if (!var16.isEmpty()) { + var3.add(""); +- Iterator var17 = var15.entries().iterator(); ++ Iterator var15 = var16.entries().iterator(); + +- while(var17.hasNext()) { +- Entry var19 = (Entry)var17.next(); +- AttributeModifier var21 = (AttributeModifier)var19.getValue(); ++ while (var15.hasNext()) { ++ Entry var18 = (Entry)var15.next(); ++ AttributeModifier var21 = (AttributeModifier)var18.getValue(); + double var10 = var21.getAmount(); + double var12; +- if(var21.getOperation() != 1 && var21.getOperation() != 2) { ++ ++ if (var21.getOperation() != 1 && var21.getOperation() != 2) { + var12 = var21.getAmount(); + } else { + var12 = var21.getAmount() * 100.0D; + } + +- if(var10 > 0.0D) { +- var3.add(EnumChatFormatting.BLUE + StatCollector.translateToLocalFormatted("attribute.modifier.plus." + var21.getOperation(), new Object[]{a.format(var12), StatCollector.translateToLocal("attribute.name." + (String)var19.getKey())})); +- } else if(var10 < 0.0D) { ++ if (var10 > 0.0D) { ++ var3.add(EnumChatFormatting.BLUE + StatCollector.translateToLocalFormatted("attribute.modifier.plus." + var21.getOperation(), new Object[] {field_111284_a.format(var12), StatCollector.translateToLocal("attribute.name." + (String)var18.getKey())})); ++ } else if (var10 < 0.0D) { + var12 *= -1.0D; +- var3.add(EnumChatFormatting.RED + StatCollector.translateToLocalFormatted("attribute.modifier.take." + var21.getOperation(), new Object[]{a.format(var12), StatCollector.translateToLocal("attribute.name." + (String)var19.getKey())})); ++ var3.add(EnumChatFormatting.RED + StatCollector.translateToLocalFormatted("attribute.modifier.take." + var21.getOperation(), new Object[] {field_111284_a.format(var12), StatCollector.translateToLocal("attribute.name." + (String)var18.getKey())})); + } + } + } + +- if(var2 && this.isItemDamaged()) { ++ if (par2 && this.isItemDamaged()) { + var3.add("Durability: " + (this.getMaxDamage() - this.getItemDamageForDisplay()) + " / " + this.getMaxDamage()); + } + + return var3; + } +- + public boolean hasEffect() { + return this.getItem().hasEffect(this); + } +@@ -464,76 +639,105 @@ + return this.getItem().getRarity(this); + } + ++ /** ++ * True if it is a tool and has no enchantments to begin with ++ */ + public boolean isItemEnchantable() { + return !this.getItem().isItemTool(this) ? false : !this.isItemEnchanted(); + } + +- public void addEnchantment(Enchantment var1, int var2) { +- if(this.stackTagCompound == null) { ++ /** ++ * Adds an enchantment with a desired level on the ItemStack. ++ */ ++ public void addEnchantment(Enchantment par1Enchantment, int par2) { ++ if (this.stackTagCompound == null) { + this.setTagCompound(new NBTTagCompound()); + } + +- if(!this.stackTagCompound.hasKey("ench")) { ++ if (!this.stackTagCompound.hasKey("ench")) { + this.stackTagCompound.setTag("ench", new NBTTagList("ench")); + } + + NBTTagList var3 = (NBTTagList)this.stackTagCompound.getTag("ench"); + NBTTagCompound var4 = new NBTTagCompound(); +- var4.setShort("id", (short)var1.effectId); +- var4.setShort("lvl", (short)((byte)var2)); ++ var4.setShort("id", (short)par1Enchantment.effectId); ++ var4.setShort("lvl", (short)((byte)par2)); + var3.appendTag(var4); + } + ++ /** ++ * True if the item has enchantment data ++ */ + public boolean isItemEnchanted() { + return this.stackTagCompound != null && this.stackTagCompound.hasKey("ench"); + } + +- public void setTagInfo(String var1, NBTBase var2) { +- if(this.stackTagCompound == null) { ++ public void setTagInfo(String par1Str, NBTBase par2NBTBase) { ++ if (this.stackTagCompound == null) { + this.setTagCompound(new NBTTagCompound()); + } + +- this.stackTagCompound.setTag(var1, var2); ++ this.stackTagCompound.setTag(par1Str, par2NBTBase); + } + + public boolean canEditBlocks() { + return this.getItem().canItemEditBlocks(); + } + ++ /** ++ * Return whether this stack is on an item frame. ++ */ + public boolean isOnItemFrame() { + return this.itemFrame != null; + } + +- public void setItemFrame(EntityItemFrame var1) { +- this.itemFrame = var1; ++ /** ++ * Set the item frame this stack is on. ++ */ ++ public void setItemFrame(EntityItemFrame par1EntityItemFrame) { ++ this.itemFrame = par1EntityItemFrame; + } + ++ /** ++ * Return the item frame this stack is on. Returns null if not on an item frame. ++ */ + public EntityItemFrame getItemFrame() { + return this.itemFrame; + } + ++ /** ++ * Get this stack's repair cost, or 0 if no repair cost is defined. ++ */ + public int getRepairCost() { + return this.hasTagCompound() && this.stackTagCompound.hasKey("RepairCost") ? this.stackTagCompound.getInteger("RepairCost") : 0; + } + +- public void setRepairCost(int var1) { +- if(!this.hasTagCompound()) { ++ /** ++ * Set this stack's repair cost. ++ */ ++ public void setRepairCost(int par1) { ++ if (!this.hasTagCompound()) { + this.stackTagCompound = new NBTTagCompound("tag"); + } + +- this.stackTagCompound.setInteger("RepairCost", var1); ++ this.stackTagCompound.setInteger("RepairCost", par1); + } +- ++ ++ /** ++ * Gets the attribute modifiers for this ItemStack.\nWill check for an NBT tag list containing modifiers for the stack. ++ */ + public Multimap getAttributeModifiers() { + Object var1; +- if(this.hasTagCompound() && this.stackTagCompound.hasKey("AttributeModifiers")) { ++ ++ if (this.hasTagCompound() && this.stackTagCompound.hasKey("AttributeModifiers")) { + var1 = HashMultimap.create(); + NBTTagList var2 = this.stackTagCompound.getTagList("AttributeModifiers"); + +- for(int var3 = 0; var3 < var2.tagCount(); ++var3) { ++ for (int var3 = 0; var3 < var2.tagCount(); ++var3) { + NBTTagCompound var4 = (NBTTagCompound)var2.tagAt(var3); + AttributeModifier var5 = SharedMonsterAttributes.func_111259_a(var4); +- if(var5.getID().getLeastSignificantBits() != 0L && var5.getID().getMostSignificantBits() != 0L) { ++ ++ if (var5.getID().getLeastSignificantBits() != 0L && var5.getID().getMostSignificantBits() != 0L) { + ((Multimap)var1).put(var4.getString("AttributeName"), var5); + } + } diff --git a/patches/net/minecraft/src/ItemSword.java.patch b/patches/net/minecraft/src/ItemSword.java.patch new file mode 100644 index 0000000..88f01df --- /dev/null +++ b/patches/net/minecraft/src/ItemSword.java.patch @@ -0,0 +1,142 @@ +--- net/minecraft/src/ItemSword.java ++++ net/minecraft/src/ItemSword.java +@@ -6,77 +6,112 @@ + private float weaponDamage; + private final EnumToolMaterial toolMaterial; + +- public ItemSword(int var1, EnumToolMaterial var2) { +- super(var1); +- this.toolMaterial = var2; ++ public ItemSword(int par1, EnumToolMaterial par2EnumToolMaterial) { ++ super(par1); ++ this.toolMaterial = par2EnumToolMaterial; + this.maxStackSize = 1; +- this.setMaxDamage(var2.getMaxUses()); ++ this.setMaxDamage(par2EnumToolMaterial.getMaxUses()); + this.setCreativeTab(CreativeTabs.tabCombat); +- this.weaponDamage = 4.0F + var2.getDamageVsEntity(); ++ this.weaponDamage = 4.0F + par2EnumToolMaterial.getDamageVsEntity(); + } + + public float func_82803_g() { + return this.toolMaterial.getDamageVsEntity(); + } + +- public float getStrVsBlock(ItemStack var1, Block var2) { +- if(var2.blockID == Block.web.blockID) { ++ /** ++ * Returns the strength of the stack against a given block. 1.0F base, (Quality+1)*2 if correct blocktype, 1.5F if ++ * sword ++ */ ++ public float getStrVsBlock(ItemStack par1ItemStack, Block par2Block) { ++ if (par2Block.blockID == Block.web.blockID) { + return 15.0F; + } else { +- Material var3 = var2.blockMaterial; ++ Material var3 = par2Block.blockMaterial; + return var3 != Material.plants && var3 != Material.vine && var3 != Material.coral && var3 != Material.leaves && var3 != Material.pumpkin ? 1.0F : 1.5F; + } + } + +- public boolean hitEntity(ItemStack var1, EntityLivingBase var2, EntityLivingBase var3) { +- var1.damageItem(1, var3); ++ /** ++ * Current implementations of this method in child classes do not use the entry argument beside ev. They just raise the ++ * damage on the stack. ++ */ ++ public boolean hitEntity(ItemStack par1ItemStack, EntityLivingBase par2EntityLivingBase, EntityLivingBase par3EntityLivingBase) { ++ par1ItemStack.damageItem(1, par3EntityLivingBase); + return true; + } + +- public boolean onBlockDestroyed(ItemStack var1, World var2, int var3, int var4, int var5, int var6, EntityLivingBase var7) { +- if((double)Block.blocksList[var3].getBlockHardness(var2, var4, var5, var6) != 0.0D) { +- var1.damageItem(2, var7); ++ public boolean onBlockDestroyed(ItemStack par1ItemStack, World par2World, int par3, int par4, int par5, int par6, EntityLivingBase par7EntityLivingBase) { ++ if ((double)Block.blocksList[par3].getBlockHardness(par2World, par4, par5, par6) != 0.0D) { ++ par1ItemStack.damageItem(2, par7EntityLivingBase); + } + + return true; + } + ++ /** ++ * Returns True is the item is renderer in full 3D when hold. ++ */ + public boolean isFull3D() { + return true; + } + +- public EnumAction getItemUseAction(ItemStack var1) { ++ /** ++ * returns the action that specifies what animation to play when the items is being used ++ */ ++ public EnumAction getItemUseAction(ItemStack par1ItemStack) { + return EnumAction.block; + } + +- public int getMaxItemUseDuration(ItemStack var1) { ++ /** ++ * How long it takes to use or consume an item ++ */ ++ public int getMaxItemUseDuration(ItemStack par1ItemStack) { + return 72000; + } + +- public ItemStack onItemRightClick(ItemStack var1, World var2, EntityPlayer var3) { +- var3.setItemInUse(var1, this.getMaxItemUseDuration(var1)); +- return var1; +- } +- +- public boolean canHarvestBlock(Block var1) { +- return var1.blockID == Block.web.blockID; +- } +- ++ /** ++ * Called whenever this item is equipped and the right mouse button is pressed. Args: itemStack, world, entityPlayer ++ */ ++ public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) { ++ par3EntityPlayer.setItemInUse(par1ItemStack, this.getMaxItemUseDuration(par1ItemStack)); ++ return par1ItemStack; ++ } ++ ++ /** ++ * Returns if the item (tool) can harvest results from the block type. ++ */ ++ public boolean canHarvestBlock(Block par1Block) { ++ return par1Block.blockID == Block.web.blockID; ++ } ++ ++ /** ++ * Return the enchantability factor of the item, most of the time is based on material. ++ */ + public int getItemEnchantability() { + return this.toolMaterial.getEnchantability(); + } + ++ /** ++ * Return the name for this tool's material. ++ */ + public String getToolMaterialName() { + return this.toolMaterial.toString(); + } + +- public boolean getIsRepairable(ItemStack var1, ItemStack var2) { +- return this.toolMaterial.getToolCraftingMaterial() == var2.itemID ? true : super.getIsRepairable(var1, var2); ++ /** ++ * Return whether this item is repairable in an anvil. ++ */ ++ public boolean getIsRepairable(ItemStack par1ItemStack, ItemStack par2ItemStack) { ++ return this.toolMaterial.getToolCraftingMaterial() == par2ItemStack.itemID ? true : super.getIsRepairable(par1ItemStack, par2ItemStack); + } + ++ /** ++ * Gets a map of item attribute modifiers, used by ItemSword to increase hit damage. ++ */ + public Multimap getItemAttributeModifiers() { + Multimap var1 = super.getItemAttributeModifiers(); +- var1.put(SharedMonsterAttributes.attackDamage.getAttributeUnlocalizedName(), new AttributeModifier(e, "Weapon modifier", (double)this.weaponDamage, 0)); ++ var1.put(SharedMonsterAttributes.attackDamage.getAttributeUnlocalizedName(), new AttributeModifier(field_111210_e, "Weapon modifier", (double)this.weaponDamage, 0)); + return var1; + } + } diff --git a/patches/net/minecraft/src/ItemTool.java.patch b/patches/net/minecraft/src/ItemTool.java.patch new file mode 100644 index 0000000..6c098f8 --- /dev/null +++ b/patches/net/minecraft/src/ItemTool.java.patch @@ -0,0 +1,114 @@ +--- net/minecraft/src/ItemTool.java ++++ net/minecraft/src/ItemTool.java +@@ -3,25 +3,35 @@ + import com.google.common.collect.Multimap; + + public class ItemTool extends Item { ++ ++ /** Array of blocks the tool has extra effect against. */ + private Block[] blocksEffectiveAgainst; + protected float efficiencyOnProperMaterial = 4.0F; ++ ++ /** Damage versus entities. */ + private float damageVsEntity; ++ ++ /** The material this tool is made from. */ + protected EnumToolMaterial toolMaterial; + +- protected ItemTool(int var1, float var2, EnumToolMaterial var3, Block[] var4) { +- super(var1); +- this.toolMaterial = var3; +- this.blocksEffectiveAgainst = var4; ++ protected ItemTool(int par1, float par2, EnumToolMaterial par3EnumToolMaterial, Block[] par4ArrayOfBlock) { ++ super(par1); ++ this.toolMaterial = par3EnumToolMaterial; ++ this.blocksEffectiveAgainst = par4ArrayOfBlock; + this.maxStackSize = 1; +- this.setMaxDamage(var3.getMaxUses()); +- this.efficiencyOnProperMaterial = var3.getEfficiencyOnProperMaterial(); +- this.damageVsEntity = var2 + var3.getDamageVsEntity(); ++ this.setMaxDamage(par3EnumToolMaterial.getMaxUses()); ++ this.efficiencyOnProperMaterial = par3EnumToolMaterial.getEfficiencyOnProperMaterial(); ++ this.damageVsEntity = par2 + par3EnumToolMaterial.getDamageVsEntity(); + this.setCreativeTab(CreativeTabs.tabTools); + } + +- public float getStrVsBlock(ItemStack var1, Block var2) { +- for(int var3 = 0; var3 < this.blocksEffectiveAgainst.length; ++var3) { +- if(this.blocksEffectiveAgainst[var3] == var2) { ++ /** ++ * Returns the strength of the stack against a given block. 1.0F base, (Quality+1)*2 if correct blocktype, 1.5F if ++ * sword ++ */ ++ public float getStrVsBlock(ItemStack par1ItemStack, Block par2Block) { ++ for (int var3 = 0; var3 < this.blocksEffectiveAgainst.length; ++var3) { ++ if (this.blocksEffectiveAgainst[var3] == par2Block) { + return this.efficiencyOnProperMaterial; + } + } +@@ -29,38 +39,57 @@ + return 1.0F; + } + +- public boolean hitEntity(ItemStack var1, EntityLivingBase var2, EntityLivingBase var3) { +- var1.damageItem(2, var3); ++ /** ++ * Current implementations of this method in child classes do not use the entry argument beside ev. They just raise the ++ * damage on the stack. ++ */ ++ public boolean hitEntity(ItemStack par1ItemStack, EntityLivingBase par2EntityLivingBase, EntityLivingBase par3EntityLivingBase) { ++ par1ItemStack.damageItem(2, par3EntityLivingBase); + return true; + } + +- public boolean onBlockDestroyed(ItemStack var1, World var2, int var3, int var4, int var5, int var6, EntityLivingBase var7) { +- if((double)Block.blocksList[var3].getBlockHardness(var2, var4, var5, var6) != 0.0D) { +- var1.damageItem(1, var7); ++ public boolean onBlockDestroyed(ItemStack par1ItemStack, World par2World, int par3, int par4, int par5, int par6, EntityLivingBase par7EntityLivingBase) { ++ if ((double)Block.blocksList[par3].getBlockHardness(par2World, par4, par5, par6) != 0.0D) { ++ par1ItemStack.damageItem(1, par7EntityLivingBase); + } + + return true; + } + ++ /** ++ * Returns True is the item is renderer in full 3D when hold. ++ */ + public boolean isFull3D() { + return true; + } + ++ /** ++ * Return the enchantability factor of the item, most of the time is based on material. ++ */ + public int getItemEnchantability() { + return this.toolMaterial.getEnchantability(); + } + ++ /** ++ * Return the name for this tool's material. ++ */ + public String getToolMaterialName() { + return this.toolMaterial.toString(); + } + +- public boolean getIsRepairable(ItemStack var1, ItemStack var2) { +- return this.toolMaterial.getToolCraftingMaterial() == var2.itemID ? true : super.getIsRepairable(var1, var2); ++ /** ++ * Return whether this item is repairable in an anvil. ++ */ ++ public boolean getIsRepairable(ItemStack par1ItemStack, ItemStack par2ItemStack) { ++ return this.toolMaterial.getToolCraftingMaterial() == par2ItemStack.itemID ? true : super.getIsRepairable(par1ItemStack, par2ItemStack); + } + ++ /** ++ * Gets a map of item attribute modifiers, used by ItemSword to increase hit damage. ++ */ + public Multimap getItemAttributeModifiers() { + Multimap var1 = super.getItemAttributeModifiers(); +- var1.put(SharedMonsterAttributes.attackDamage.getAttributeUnlocalizedName(), new AttributeModifier(e, "Tool modifier", (double)this.damageVsEntity, 0)); ++ var1.put(SharedMonsterAttributes.attackDamage.getAttributeUnlocalizedName(), new AttributeModifier(field_111210_e, "Tool modifier", (double)this.damageVsEntity, 0)); + return var1; + } + } diff --git a/patches/net/minecraft/src/ItemWritableBook.java.patch b/patches/net/minecraft/src/ItemWritableBook.java.patch new file mode 100644 index 0000000..86a9b6a --- /dev/null +++ b/patches/net/minecraft/src/ItemWritableBook.java.patch @@ -0,0 +1,57 @@ +--- net/minecraft/src/ItemWritableBook.java ++++ net/minecraft/src/ItemWritableBook.java +@@ -1,35 +1,42 @@ + package net.minecraft.src; + + public class ItemWritableBook extends Item { +- public ItemWritableBook(int var1) { +- super(var1); ++ public ItemWritableBook(int par1) { ++ super(par1); + this.setMaxStackSize(1); + } + +- public ItemStack onItemRightClick(ItemStack var1, World var2, EntityPlayer var3) { +- var3.displayGUIBook(var1); +- return var1; ++ /** ++ * Called whenever this item is equipped and the right mouse button is pressed. Args: itemStack, world, entityPlayer ++ */ ++ public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) { ++ par3EntityPlayer.displayGUIBook(par1ItemStack); ++ return par1ItemStack; + } + ++ /** ++ * If this function returns true (or the item is damageable), the ItemStack's NBT tag will be sent to the client. ++ */ + public boolean getShareTag() { + return true; + } + +- public static boolean validBookTagPages(NBTTagCompound var0) { +- if(var0 == null) { ++ public static boolean validBookTagPages(NBTTagCompound par0NBTTagCompound) { ++ if (par0NBTTagCompound == null) { + return false; +- } else if(!var0.hasKey("pages")) { ++ } else if (!par0NBTTagCompound.hasKey("pages")) { + return false; + } else { +- NBTTagList var1 = (NBTTagList)var0.getTag("pages"); ++ NBTTagList var1 = (NBTTagList)par0NBTTagCompound.getTag("pages"); + +- for(int var2 = 0; var2 < var1.tagCount(); ++var2) { ++ for (int var2 = 0; var2 < var1.tagCount(); ++var2) { + NBTTagString var3 = (NBTTagString)var1.tagAt(var2); +- if(var3.a == null) { ++ ++ if (var3.data == null) { + return false; + } + +- if(var3.a.length() > 256) { ++ if (var3.data.length() > 256) { + return false; + } + } diff --git a/patches/net/minecraft/src/KeyBinding.java.patch b/patches/net/minecraft/src/KeyBinding.java.patch new file mode 100644 index 0000000..72dd3fa --- /dev/null +++ b/patches/net/minecraft/src/KeyBinding.java.patch @@ -0,0 +1,109 @@ +--- net/minecraft/src/KeyBinding.java ++++ net/minecraft/src/KeyBinding.java +@@ -5,59 +5,83 @@ + import java.util.List; + + public class KeyBinding { +- public static List a = new ArrayList(); ++ public static List keybindArray = new ArrayList(); + public static IntHashMap hash = new IntHashMap(); +- public String c; ++ public String keyDescription; + public int keyCode; ++ ++ /** because _303 wanted me to call it that(Caironater) */ + public boolean pressed; + public int pressTime; + +- public static void onTick(int var0) { +- KeyBinding var1 = (KeyBinding)hash.lookup(var0); +- if(var1 != null) { ++ public static void onTick(int par0) { ++ // Spout Start ++ /* ++ KeyBinding var1 = (KeyBinding)hash.lookup(par0); ++ ++ if (var1 != null) { + ++var1.pressTime; + } ++ */ ++ Iterator i = keybindArray.iterator(); + ++ while (i.hasNext()) { ++ KeyBinding key = (KeyBinding)i.next(); ++ if (key.keyCode == par0) { ++ key.pressTime++; ++ } ++ } ++ // Spout End + } + +- public static void setKeyBindState(int var0, boolean var1) { +- KeyBinding var2 = (KeyBinding)hash.lookup(var0); +- if(var2 != null) { +- var2.pressed = var1; +- } +- ++ public static void setKeyBindState(int par0, boolean par1) { ++ // Spout Start ++ /* ++ KeyBinding var2 = (KeyBinding)hash.lookup(par0); ++ ++ if (var2 != null) { ++ var2.pressed = par1; ++ } ++ */ ++ Iterator i = keybindArray.iterator(); ++ ++ while (i.hasNext()) { ++ KeyBinding key = (KeyBinding)i.next(); ++ if (key.keyCode == par0) { ++ key.pressed = par1; ++ } ++ } ++ // Spout End + } + + public static void unPressAllKeys() { +- Iterator var0 = a.iterator(); ++ Iterator var0 = keybindArray.iterator(); + +- while(var0.hasNext()) { ++ while (var0.hasNext()) { + KeyBinding var1 = (KeyBinding)var0.next(); + var1.unpressKey(); + } +- + } + + public static void resetKeyBindingArrayAndHash() { + hash.clearMap(); +- Iterator var0 = a.iterator(); ++ Iterator var0 = keybindArray.iterator(); + +- while(var0.hasNext()) { ++ while (var0.hasNext()) { + KeyBinding var1 = (KeyBinding)var0.next(); + hash.addKey(var1.keyCode, var1); + } +- + } + +- public KeyBinding(String var1, int var2) { +- this.c = var1; +- this.keyCode = var2; +- a.add(this); +- hash.addKey(var2, this); ++ public KeyBinding(String par1Str, int par2) { ++ this.keyDescription = par1Str; ++ this.keyCode = par2; ++ keybindArray.add(this); ++ hash.addKey(par2, this); + } + + public boolean isPressed() { +- if(this.pressTime == 0) { ++ if (this.pressTime == 0) { + return false; + } else { + --this.pressTime; diff --git a/patches/net/minecraft/src/LanServer.java.patch b/patches/net/minecraft/src/LanServer.java.patch new file mode 100644 index 0000000..ac9a9e4 --- /dev/null +++ b/patches/net/minecraft/src/LanServer.java.patch @@ -0,0 +1,39 @@ +--- net/minecraft/src/LanServer.java ++++ net/minecraft/src/LanServer.java +@@ -1,24 +1,29 @@ + package net.minecraft.src; + + public class LanServer { +- private String a; +- private String b; ++ private String lanServerMotd; ++ private String lanServerIpPort; ++ ++ /** Last time this LanServer was seen. */ + private long timeLastSeen; + +- public LanServer(String var1, String var2) { +- this.a = var1; +- this.b = var2; ++ public LanServer(String par1Str, String par2Str) { ++ this.lanServerMotd = par1Str; ++ this.lanServerIpPort = par2Str; + this.timeLastSeen = Minecraft.getSystemTime(); + } + + public String getServerMotd() { +- return this.a; ++ return this.lanServerMotd; + } + + public String getServerIpPort() { +- return this.b; ++ return this.lanServerIpPort; + } + ++ /** ++ * Updates the time this LanServer was last seen. ++ */ + public void updateLastSeen() { + this.timeLastSeen = Minecraft.getSystemTime(); + } diff --git a/patches/net/minecraft/src/LanServerList.java.patch b/patches/net/minecraft/src/LanServerList.java.patch new file mode 100644 index 0000000..ddeea53 --- /dev/null +++ b/patches/net/minecraft/src/LanServerList.java.patch @@ -0,0 +1,56 @@ +--- net/minecraft/src/LanServerList.java ++++ net/minecraft/src/LanServerList.java +@@ -7,7 +7,7 @@ + import java.util.List; + + public class LanServerList { +- private ArrayList b = new ArrayList(); ++ private ArrayList listOfLanServers = new ArrayList(); + boolean wasUpdated; + + public synchronized boolean getWasUpdated() { +@@ -19,31 +19,32 @@ + } + + public synchronized List getLanServers() { +- return Collections.unmodifiableList(this.b); ++ return Collections.unmodifiableList(this.listOfLanServers); + } + +- public synchronized void func_77551_a(String var1, InetAddress var2) { +- String var3 = ThreadLanServerPing.getMotdFromPingResponse(var1); +- String var4 = ThreadLanServerPing.getAdFromPingResponse(var1); +- if(var4 != null) { +- var4 = var2.getHostAddress() + ":" + var4; ++ public synchronized void func_77551_a(String par1Str, InetAddress par2InetAddress) { ++ String var3 = ThreadLanServerPing.getMotdFromPingResponse(par1Str); ++ String var4 = ThreadLanServerPing.getAdFromPingResponse(par1Str); ++ ++ if (var4 != null) { ++ var4 = par2InetAddress.getHostAddress() + ":" + var4; + boolean var5 = false; +- Iterator var6 = this.b.iterator(); ++ Iterator var6 = this.listOfLanServers.iterator(); + +- while(var6.hasNext()) { ++ while (var6.hasNext()) { + LanServer var7 = (LanServer)var6.next(); +- if(var7.getServerIpPort().equals(var4)) { ++ ++ if (var7.getServerIpPort().equals(var4)) { + var7.updateLastSeen(); + var5 = true; + break; + } + } + +- if(!var5) { +- this.b.add(new LanServer(var3, var4)); ++ if (!var5) { ++ this.listOfLanServers.add(new LanServer(var3, var4)); + this.wasUpdated = true; + } +- + } + } + } diff --git a/patches/net/minecraft/src/Language.java.patch b/patches/net/minecraft/src/Language.java.patch new file mode 100644 index 0000000..c6fe19f --- /dev/null +++ b/patches/net/minecraft/src/Language.java.patch @@ -0,0 +1,67 @@ +--- net/minecraft/src/Language.java ++++ net/minecraft/src/Language.java +@@ -1,20 +1,20 @@ + package net.minecraft.src; + + public class Language implements Comparable { +- private final String a; +- private final String b; +- private final String c; ++ private final String languageCode; ++ private final String region; ++ private final String name; + private final boolean bidirectional; + +- public Language(String var1, String var2, String var3, boolean var4) { +- this.a = var1; +- this.b = var2; +- this.c = var3; +- this.bidirectional = var4; ++ public Language(String par1Str, String par2Str, String par3Str, boolean par4) { ++ this.languageCode = par1Str; ++ this.region = par2Str; ++ this.name = par3Str; ++ this.bidirectional = par4; + } + + public String getLanguageCode() { +- return this.a; ++ return this.languageCode; + } + + public boolean isBidirectional() { +@@ -22,22 +22,22 @@ + } + + public String toString() { +- return String.format("%s (%s)", new Object[]{this.c, this.b}); ++ return String.format("%s (%s)", new Object[] {this.name, this.region}); + } + +- public boolean equals(Object var1) { +- return this == var1 ? true : (!(var1 instanceof Language) ? false : this.a.equals(((Language)var1).a)); ++ public boolean equals(Object par1Obj) { ++ return this == par1Obj ? true : (!(par1Obj instanceof Language) ? false : this.languageCode.equals(((Language)par1Obj).languageCode)); + } + + public int hashCode() { +- return this.a.hashCode(); +- } +- +- public int func_135033_a(Language var1) { +- return this.a.compareTo(var1.a); +- } +- +- public int compareTo(Object var1) { +- return this.func_135033_a((Language)var1); ++ return this.languageCode.hashCode(); ++ } ++ ++ public int func_135033_a(Language par1Language) { ++ return this.languageCode.compareTo(par1Language.languageCode); ++ } ++ ++ public int compareTo(Object par1Obj) { ++ return this.func_135033_a((Language)par1Obj); + } + } diff --git a/patches/net/minecraft/src/LanguageManager.java.patch b/patches/net/minecraft/src/LanguageManager.java.patch new file mode 100644 index 0000000..8f6b3b8 --- /dev/null +++ b/patches/net/minecraft/src/LanguageManager.java.patch @@ -0,0 +1,95 @@ +--- net/minecraft/src/LanguageManager.java ++++ net/minecraft/src/LanguageManager.java +@@ -12,32 +12,34 @@ + + public class LanguageManager implements ResourceManagerReloadListener { + private final MetadataSerializer field_135047_b; +- private String c; ++ private String currentLanguage; + protected static final Locale currentLocale = new Locale(); +- private Map d = Maps.newHashMap(); ++ private Map languageMap = Maps.newHashMap(); + +- public LanguageManager(MetadataSerializer var1, String var2) { +- this.field_135047_b = var1; +- this.c = var2; ++ public LanguageManager(MetadataSerializer par1MetadataSerializer, String par2Str) { ++ this.field_135047_b = par1MetadataSerializer; ++ this.currentLanguage = par2Str; + I18n.setLocale(currentLocale); + } + +- public void parseLanguageMetadata(List var1) { +- this.d.clear(); +- Iterator var2 = var1.iterator(); ++ public void parseLanguageMetadata(List par1List) { ++ this.languageMap.clear(); ++ Iterator var2 = par1List.iterator(); + +- while(var2.hasNext()) { ++ while (var2.hasNext()) { + ResourcePack var3 = (ResourcePack)var2.next(); + + try { + LanguageMetadataSection var4 = (LanguageMetadataSection)var3.getPackMetadata(this.field_135047_b, "language"); +- if(var4 != null) { ++ ++ if (var4 != null) { + Iterator var5 = var4.getLanguages().iterator(); + +- while(var5.hasNext()) { ++ while (var5.hasNext()) { + Language var6 = (Language)var5.next(); +- if(!this.d.containsKey(var6.getLanguageCode())) { +- this.d.put(var6.getLanguageCode(), var6); ++ ++ if (!this.languageMap.containsKey(var6.getLanguageCode())) { ++ this.languageMap.put(var6.getLanguageCode(), var6); + } + } + } +@@ -47,17 +49,17 @@ + Minecraft.getMinecraft().getLogAgent().logWarningException("Unable to parse metadata section of resourcepack: " + var3.getPackName(), var8); + } + } +- + } + +- public void onResourceManagerReload(ResourceManager var1) { +- ArrayList var2 = Lists.newArrayList((Object[])(new String[]{"en_US"})); +- if(!"en_US".equals(this.c)) { +- var2.add(this.c); ++ public void onResourceManagerReload(ResourceManager par1ResourceManager) { ++ ArrayList var2 = Lists.newArrayList(new String[] {"en_US"}); ++ ++ if (!"en_US".equals(this.currentLanguage)) { ++ var2.add(this.currentLanguage); + } + +- currentLocale.loadLocaleDataFiles(var1, var2); +- StringTranslate.func_135063_a(currentLocale.a); ++ currentLocale.loadLocaleDataFiles(par1ResourceManager, var2); ++ StringTranslate.func_135063_a(currentLocale.field_135032_a); + } + + public boolean isCurrentLocaleUnicode() { +@@ -68,15 +70,15 @@ + return this.getCurrentLanguage().isBidirectional(); + } + +- public void setCurrentLanguage(Language var1) { +- this.c = var1.getLanguageCode(); ++ public void setCurrentLanguage(Language par1Language) { ++ this.currentLanguage = par1Language.getLanguageCode(); + } + + public Language getCurrentLanguage() { +- return this.d.containsKey(this.c) ? (Language)this.d.get(this.c) : (Language)this.d.get("en_US"); ++ return this.languageMap.containsKey(this.currentLanguage) ? (Language)this.languageMap.get(this.currentLanguage) : (Language)this.languageMap.get("en_US"); + } + + public SortedSet getLanguages() { +- return Sets.newTreeSet((Iterable)this.d.values()); ++ return Sets.newTreeSet(this.languageMap.values()); + } + } diff --git a/patches/net/minecraft/src/LanguageMetadataSection.java.patch b/patches/net/minecraft/src/LanguageMetadataSection.java.patch new file mode 100644 index 0000000..163a997 --- /dev/null +++ b/patches/net/minecraft/src/LanguageMetadataSection.java.patch @@ -0,0 +1,20 @@ +--- net/minecraft/src/LanguageMetadataSection.java ++++ net/minecraft/src/LanguageMetadataSection.java +@@ -3,13 +3,13 @@ + import java.util.Collection; + + public class LanguageMetadataSection implements MetadataSection { +- private final Collection a; ++ private final Collection languages; + +- public LanguageMetadataSection(Collection var1) { +- this.a = var1; ++ public LanguageMetadataSection(Collection par1Collection) { ++ this.languages = par1Collection; + } + + public Collection getLanguages() { +- return this.a; ++ return this.languages; + } + } diff --git a/patches/net/minecraft/src/LanguageMetadataSectionSerializer.java.patch b/patches/net/minecraft/src/LanguageMetadataSectionSerializer.java.patch new file mode 100644 index 0000000..a69300e --- /dev/null +++ b/patches/net/minecraft/src/LanguageMetadataSectionSerializer.java.patch @@ -0,0 +1,66 @@ +--- net/minecraft/src/LanguageMetadataSectionSerializer.java ++++ net/minecraft/src/LanguageMetadataSectionSerializer.java +@@ -11,24 +11,25 @@ + import java.util.Map.Entry; + + public class LanguageMetadataSectionSerializer extends BaseMetadataSectionSerializer { +- public LanguageMetadataSection func_135020_a(JsonElement var1, Type var2, JsonDeserializationContext var3) { +- JsonObject var4 = var1.getAsJsonObject(); ++ public LanguageMetadataSection func_135020_a(JsonElement par1JsonElement, Type par2Type, JsonDeserializationContext par3JsonDeserializationContext) { ++ JsonObject var4 = par1JsonElement.getAsJsonObject(); + HashSet var5 = Sets.newHashSet(); + Iterator var6 = var4.entrySet().iterator(); +- + String var8; + String var11; + String var12; + boolean var13; ++ + do { +- if(!var6.hasNext()) { ++ if (!var6.hasNext()) { + return new LanguageMetadataSection(var5); + } + + Entry var7 = (Entry)var6.next(); + var8 = (String)var7.getKey(); + JsonElement var9 = (JsonElement)var7.getValue(); +- if(!var9.isJsonObject()) { ++ ++ if (!var9.isJsonObject()) { + throw new JsonParseException("Invalid language->\'" + var8 + "\': expected object, was " + var9); + } + +@@ -36,23 +37,27 @@ + var11 = this.func_110486_a(var10.get("region"), "region", "", 0, Integer.MAX_VALUE); + var12 = this.func_110486_a(var10.get("name"), "name", "", 0, Integer.MAX_VALUE); + var13 = this.func_110484_a(var10.get("bidirectional"), "bidirectional", Boolean.valueOf(false)); +- if(var11.isEmpty()) { ++ ++ if (var11.isEmpty()) { + throw new JsonParseException("Invalid language->\'" + var8 + "\'->region: empty value"); + } + +- if(var12.isEmpty()) { ++ if (var12.isEmpty()) { + throw new JsonParseException("Invalid language->\'" + var8 + "\'->name: empty value"); + } +- } while(var5.add(new Language(var8, var11, var12, var13))); ++ } while (var5.add(new Language(var8, var11, var12, var13))); + + throw new JsonParseException("Duplicate language->\'" + var8 + "\' defined"); + } + ++ /** ++ * The name of this section type as it appears in JSON. ++ */ + public String getSectionName() { + return "language"; + } + +- public Object deserialize(JsonElement var1, Type var2, JsonDeserializationContext var3) { +- return this.func_135020_a(var1, var2, var3); ++ public Object deserialize(JsonElement par1JsonElement, Type par2Type, JsonDeserializationContext par3JsonDeserializationContext) { ++ return this.func_135020_a(par1JsonElement, par2Type, par3JsonDeserializationContext); + } + } diff --git a/patches/net/minecraft/src/LayeredTexture.java.patch b/patches/net/minecraft/src/LayeredTexture.java.patch new file mode 100644 index 0000000..4f616d2 --- /dev/null +++ b/patches/net/minecraft/src/LayeredTexture.java.patch @@ -0,0 +1,38 @@ +--- net/minecraft/src/LayeredTexture.java ++++ net/minecraft/src/LayeredTexture.java +@@ -10,24 +10,26 @@ + import javax.imageio.ImageIO; + + public class LayeredTexture extends AbstractTexture { +- public final List b; ++ public final List layeredTextureNames; + +- public LayeredTexture(String... var1) { +- this.b = Lists.newArrayList((Object[])var1); ++ public LayeredTexture(String ... par1ArrayOfStr) { ++ this.layeredTextureNames = Lists.newArrayList(par1ArrayOfStr); + } + +- public void loadTexture(ResourceManager var1) throws IOException { ++ public void loadTexture(ResourceManager par1ResourceManager) throws IOException { + BufferedImage var2 = null; + + try { +- Iterator var3 = this.b.iterator(); ++ Iterator var3 = this.layeredTextureNames.iterator(); + +- while(var3.hasNext()) { ++ while (var3.hasNext()) { + String var4 = (String)var3.next(); +- if(var4 != null) { +- InputStream var5 = var1.getResource(new ResourceLocation(var4)).getInputStream(); ++ ++ if (var4 != null) { ++ InputStream var5 = par1ResourceManager.getResource(new ResourceLocation(var4)).getInputStream(); + BufferedImage var6 = ImageIO.read(var5); +- if(var2 == null) { ++ ++ if (var2 == null) { + var2 = new BufferedImage(var6.getWidth(), var6.getHeight(), 2); + } + diff --git a/patches/net/minecraft/src/LoadingScreenRenderer.java.patch b/patches/net/minecraft/src/LoadingScreenRenderer.java.patch new file mode 100644 index 0000000..d3dbcc0 --- /dev/null +++ b/patches/net/minecraft/src/LoadingScreenRenderer.java.patch @@ -0,0 +1,154 @@ +--- net/minecraft/src/LoadingScreenRenderer.java ++++ net/minecraft/src/LoadingScreenRenderer.java +@@ -4,30 +4,44 @@ + import org.lwjgl.opengl.GL11; + + public class LoadingScreenRenderer implements IProgressUpdate { +- private String a = ""; ++ private String field_73727_a = ""; ++ ++ /** A reference to the Minecraft object. */ + private Minecraft mc; +- private String c = ""; ++ ++ /** ++ * The text currently displayed (i.e. the argument to the last call to printText or func_73722_d) ++ */ ++ private String currentlyDisplayedText = ""; + private long field_73723_d = Minecraft.getSystemTime(); + private boolean field_73724_e; + +- public LoadingScreenRenderer(Minecraft var1) { +- this.mc = var1; ++ public LoadingScreenRenderer(Minecraft par1Minecraft) { ++ this.mc = par1Minecraft; + } + +- public void resetProgressAndMessage(String var1) { ++ /** ++ * this string, followed by "working..." and then the "% complete" are the 3 lines shown. This resets progress to 0, ++ * and the WorkingString to "working...". ++ */ ++ public void resetProgressAndMessage(String par1Str) { + this.field_73724_e = false; +- this.func_73722_d(var1); ++ this.func_73722_d(par1Str); + } + +- public void displaySavingString(String var1) { ++ /** ++ * "Saving level", or the loading,or downloading equivelent ++ */ ++ public void displayProgressMessage(String par1Str) { + this.field_73724_e = true; +- this.func_73722_d(var1); ++ this.func_73722_d(par1Str); + } + +- public void func_73722_d(String var1) { +- this.c = var1; +- if(!this.mc.running) { +- if(!this.field_73724_e) { ++ public void func_73722_d(String par1Str) { ++ this.currentlyDisplayedText = par1Str; ++ ++ if (!this.mc.running) { ++ if (!this.field_73724_e) { + throw new MinecraftError(); + } + } else { +@@ -42,27 +56,34 @@ + } + } + +- public void displayLoadingString(String var1) { +- if(!this.mc.running) { +- if(!this.field_73724_e) { ++ /** ++ * This is called with "Working..." by resetProgressAndMessage ++ */ ++ public void resetProgresAndWorkingMessage(String par1Str) { ++ if (!this.mc.running) { ++ if (!this.field_73724_e) { + throw new MinecraftError(); + } + } else { + this.field_73723_d = 0L; +- this.a = var1; ++ this.field_73727_a = par1Str; + this.setLoadingProgress(-1); + this.field_73723_d = 0L; + } + } + +- public void setLoadingProgress(int var1) { +- if(!this.mc.running) { +- if(!this.field_73724_e) { ++ /** ++ * Updates the progress bar on the loading screen to the specified amount. Args: loadProgress ++ */ ++ public void setLoadingProgress(int par1) { ++ if (!this.mc.running) { ++ if (!this.field_73724_e) { + throw new MinecraftError(); + } + } else { + long var2 = Minecraft.getSystemTime(); +- if(var2 - this.field_73723_d >= 100L) { ++ ++ if (var2 - this.field_73723_d >= 100L) { + this.field_73723_d = var2; + ScaledResolution var4 = new ScaledResolution(this.mc.gameSettings, this.mc.displayWidth, this.mc.displayHeight); + int var5 = var4.getScaledWidth(); +@@ -74,7 +95,7 @@ + GL11.glMatrixMode(GL11.GL_MODELVIEW); + GL11.glLoadIdentity(); + GL11.glTranslatef(0.0F, 0.0F, -200.0F); +- GL11.glClear(GL11.GL_DEPTH_BUFFER_BIT | GL11.GL_COLOR_BUFFER_BIT); ++ GL11.glClear(GL11.GL_COLOR_BUFFER_BIT | GL11.GL_DEPTH_BUFFER_BIT); + Tessellator var7 = Tessellator.instance; + this.mc.getTextureManager().bindTexture(Gui.optionsBackground); + float var8 = 32.0F; +@@ -85,7 +106,8 @@ + var7.addVertexWithUV((double)var5, 0.0D, 0.0D, (double)((float)var5 / var8), 0.0D); + var7.addVertexWithUV(0.0D, 0.0D, 0.0D, 0.0D, 0.0D); + var7.draw(); +- if(var1 >= 0) { ++ ++ if (par1 >= 0) { + byte var9 = 100; + byte var10 = 2; + int var11 = var5 / 2 - var9 / 2; +@@ -100,22 +122,26 @@ + var7.setColorOpaque_I(8454016); + var7.addVertex((double)var11, (double)var12, 0.0D); + var7.addVertex((double)var11, (double)(var12 + var10), 0.0D); +- var7.addVertex((double)(var11 + var1), (double)(var12 + var10), 0.0D); +- var7.addVertex((double)(var11 + var1), (double)var12, 0.0D); ++ var7.addVertex((double)(var11 + par1), (double)(var12 + var10), 0.0D); ++ var7.addVertex((double)(var11 + par1), (double)var12, 0.0D); + var7.draw(); + GL11.glEnable(GL11.GL_TEXTURE_2D); ++ // Spout Start ++ } else { ++ GL11.glEnable(GL11.GL_TEXTURE_2D); ++ // Spout End + } + +- this.mc.fontRenderer.drawStringWithShadow(this.c, (var5 - this.mc.fontRenderer.getStringWidth(this.c)) / 2, var6 / 2 - 4 - 16, 16777215); +- this.mc.fontRenderer.drawStringWithShadow(this.a, (var5 - this.mc.fontRenderer.getStringWidth(this.a)) / 2, var6 / 2 - 4 + 8, 16777215); ++ this.mc.fontRenderer.drawStringWithShadow(this.currentlyDisplayedText, (var5 - this.mc.fontRenderer.getStringWidth(this.currentlyDisplayedText)) / 2, var6 / 2 - 4 - 16, 16777215); ++ this.mc.fontRenderer.drawStringWithShadow(this.field_73727_a, (var5 - this.mc.fontRenderer.getStringWidth(this.field_73727_a)) / 2, var6 / 2 - 4 + 8, 16777215); + Display.update(); + + try { + Thread.yield(); + } catch (Exception var13) { ++ ; + } +- + } + } +- } ++ } + } diff --git a/patches/net/minecraft/src/Locale.java.patch b/patches/net/minecraft/src/Locale.java.patch new file mode 100644 index 0000000..1927ea9 --- /dev/null +++ b/patches/net/minecraft/src/Locale.java.patch @@ -0,0 +1,160 @@ +--- net/minecraft/src/Locale.java ++++ net/minecraft/src/Locale.java +@@ -14,26 +14,32 @@ + import org.apache.commons.io.IOUtils; + + public class Locale { +- private static final Splitter b = Splitter.on('=').limit(2); +- private static final Pattern c = Pattern.compile("%(\\d+\\$)?[\\d\\.]*[df]"); +- Map a = Maps.newHashMap(); ++ ++ /** Splits on "=" */ ++ private static final Splitter splitter = Splitter.on('=').limit(2); ++ private static final Pattern field_135031_c = Pattern.compile("%(\\d+\\$)?[\\d\\.]*[df]"); ++ Map field_135032_a = Maps.newHashMap(); + private boolean field_135029_d; + +- public synchronized void loadLocaleDataFiles(ResourceManager var1, List var2) { +- this.a.clear(); +- Iterator var3 = var2.iterator(); ++ /** ++ * par2 is a list of languages. For each language $L and domain $D, attempts to load the resource $D:lang/$L.lang ++ */ ++ public synchronized void loadLocaleDataFiles(ResourceManager par1ResourceManager, List par2List) { ++ this.field_135032_a.clear(); ++ Iterator var3 = par2List.iterator(); + +- while(var3.hasNext()) { ++ while (var3.hasNext()) { + String var4 = (String)var3.next(); +- String var5 = String.format("lang/%s.lang", new Object[]{var4}); +- Iterator var6 = var1.getResourceDomains().iterator(); ++ String var5 = String.format("lang/%s.lang", new Object[] {var4}); ++ Iterator var6 = par1ResourceManager.getResourceDomains().iterator(); + +- while(var6.hasNext()) { ++ while (var6.hasNext()) { + String var7 = (String)var6.next(); + + try { +- this.loadLocaleData(var1.getAllResources(new ResourceLocation(var7, var5))); ++ this.loadLocaleData(par1ResourceManager.getAllResources(new ResourceLocation(var7, var5))); + } catch (IOException var9) { ++ ; + } + } + } +@@ -47,65 +53,73 @@ + + private void checkUnicode() { + this.field_135029_d = false; +- Iterator var1 = this.a.values().iterator(); +- +- while(true) { +- while(var1.hasNext()) { +- String var2 = (String)var1.next(); +- +- for(int var3 = 0; var3 < var2.length(); ++var3) { +- if(var2.charAt(var3) >= 256) { +- this.field_135029_d = true; +- break; +- } ++ Iterator var1 = this.field_135032_a.values().iterator(); ++ ++ while (var1.hasNext()) { ++ String var2 = (String)var1.next(); ++ ++ for (int var3 = 0; var3 < var2.length(); ++var3) { ++ if (var2.charAt(var3) >= 256) { ++ this.field_135029_d = true; ++ break; + } + } +- +- return; + } + } + +- private void loadLocaleData(List var1) throws IOException { +- Iterator var2 = var1.iterator(); ++ /** ++ * par1 is a list of Resources ++ */ ++ private void loadLocaleData(List par1List) throws IOException { ++ Iterator var2 = par1List.iterator(); + +- while(var2.hasNext()) { ++ while (var2.hasNext()) { + Resource var3 = (Resource)var2.next(); + this.loadLocaleData(var3.getInputStream()); + } +- + } + +- private void loadLocaleData(InputStream var1) throws IOException { +- Iterator var2 = IOUtils.readLines(var1, Charsets.UTF_8).iterator(); ++ private void loadLocaleData(InputStream par1InputStream) throws IOException { ++ Iterator var2 = IOUtils.readLines(par1InputStream, Charsets.UTF_8).iterator(); + +- while(var2.hasNext()) { ++ while (var2.hasNext()) { + String var3 = (String)var2.next(); +- if(!var3.isEmpty() && var3.charAt(0) != 35) { +- String[] var4 = (String[])Iterables.toArray(b.split(var3), String.class); +- if(var4 != null && var4.length == 2) { ++ ++ if (!var3.isEmpty() && var3.charAt(0) != 35) { ++ String[] var4 = (String[])Iterables.toArray(splitter.split(var3), String.class); ++ ++ if (var4 != null && var4.length == 2) { + String var5 = var4[0]; +- String var6 = c.matcher(var4[1]).replaceAll("%$1s"); +- this.a.put(var5, var6); ++ String var6 = field_135031_c.matcher(var4[1]).replaceAll("%$1s"); ++ this.field_135032_a.put(var5, var6); + } + } + } +- +- } +- +- private String translateKeyPrivate(String var1) { +- String var2 = (String)this.a.get(var1); +- return var2 == null ? var1 : var2; +- } +- +- public String translateKey(String var1) { +- return this.translateKeyPrivate(var1); +- } +- +- public String formatMessage(String var1, Object[] var2) { +- String var3 = this.translateKeyPrivate(var1); ++ } ++ ++ /** ++ * Returns the translation, or the key itself if the key could not be translated. ++ */ ++ private String translateKeyPrivate(String par1Str) { ++ String var2 = (String)this.field_135032_a.get(par1Str); ++ return var2 == null ? par1Str : var2; ++ } ++ ++ /** ++ * Returns the translation, or the key itself if the key could not be translated. ++ */ ++ public String translateKey(String par1Str) { ++ return this.translateKeyPrivate(par1Str); ++ } ++ ++ /** ++ * Calls String.format(translateKey(key), params) ++ */ ++ public String formatMessage(String par1Str, Object[] par2ArrayOfObj) { ++ String var3 = this.translateKeyPrivate(par1Str); + + try { +- return String.format(var3, var2); ++ return String.format(var3, par2ArrayOfObj); + } catch (IllegalFormatException var5) { + return "Format error: " + var3; + } diff --git a/patches/net/minecraft/src/LogAgent.java.patch b/patches/net/minecraft/src/LogAgent.java.patch new file mode 100644 index 0000000..ccd842e --- /dev/null +++ b/patches/net/minecraft/src/LogAgent.java.patch @@ -0,0 +1,128 @@ +--- net/minecraft/src/LogAgent.java ++++ net/minecraft/src/LogAgent.java +@@ -7,73 +7,75 @@ + import java.util.logging.Logger; + + public class LogAgent implements ILogAgent { +- private final Logger a; +- private final String b; +- private final String c; +- private final String d; ++ private final Logger serverLogger; ++ private final String logFile; ++ private final String loggerName; ++ private final String loggerPrefix; + +- public LogAgent(String var1, String var2, String var3) { +- this.a = Logger.getLogger(var1); +- this.c = var1; +- this.d = var2; +- this.b = var3; ++ public LogAgent(String par1Str, String par2Str, String par3Str) { ++ this.serverLogger = Logger.getLogger(par1Str); ++ this.loggerName = par1Str; ++ this.loggerPrefix = par2Str; ++ this.logFile = par3Str; + this.setupLogger(); + } + ++ /** ++ * Sets up the logger for usage. ++ */ + private void setupLogger() { +- this.a.setUseParentHandlers(false); +- Handler[] var1 = this.a.getHandlers(); ++ this.serverLogger.setUseParentHandlers(false); ++ Handler[] var1 = this.serverLogger.getHandlers(); + int var2 = var1.length; + +- for(int var3 = 0; var3 < var2; ++var3) { ++ for (int var3 = 0; var3 < var2; ++var3) { + Handler var4 = var1[var3]; +- this.a.removeHandler(var4); ++ this.serverLogger.removeHandler(var4); + } + + LogFormatter var6 = new LogFormatter(this, (LogAgentEmptyAnon)null); + ConsoleHandler var7 = new ConsoleHandler(); + var7.setFormatter(var6); +- this.a.addHandler(var7); ++ this.serverLogger.addHandler(var7); + + try { +- FileHandler var8 = new FileHandler(this.b, true); ++ FileHandler var8 = new FileHandler(this.logFile, true); + var8.setFormatter(var6); +- this.a.addHandler(var8); ++ this.serverLogger.addHandler(var8); + } catch (Exception var5) { +- this.a.log(Level.WARNING, "Failed to log " + this.c + " to " + this.b, var5); ++ this.serverLogger.log(Level.WARNING, "Failed to log " + this.loggerName + " to " + this.logFile, var5); + } +- +- } +- +- public void logInfo(String var1) { +- this.a.log(Level.INFO, var1); +- } +- +- public void logWarning(String var1) { +- this.a.log(Level.WARNING, var1); +- } +- +- public void logWarningFormatted(String var1, Object... var2) { +- this.a.log(Level.WARNING, var1, var2); +- } +- +- public void logWarningException(String var1, Throwable var2) { +- this.a.log(Level.WARNING, var1, var2); +- } +- +- public void logSevere(String var1) { +- this.a.log(Level.SEVERE, var1); +- } +- +- public void logSevereException(String var1, Throwable var2) { +- this.a.log(Level.SEVERE, var1, var2); +- } +- +- public void logFine(String var1) { +- this.a.log(Level.FINE, var1); +- } +- +- static String func_98237_a(LogAgent var0) { +- return var0.d; ++ } ++ ++ public void logInfo(String par1Str) { ++ this.serverLogger.log(Level.INFO, par1Str); ++ } ++ ++ public void logWarning(String par1Str) { ++ this.serverLogger.log(Level.WARNING, par1Str); ++ } ++ ++ public void logWarningFormatted(String par1Str, Object ... par2ArrayOfObj) { ++ this.serverLogger.log(Level.WARNING, par1Str, par2ArrayOfObj); ++ } ++ ++ public void logWarningException(String par1Str, Throwable par2Throwable) { ++ this.serverLogger.log(Level.WARNING, par1Str, par2Throwable); ++ } ++ ++ public void logSevere(String par1Str) { ++ this.serverLogger.log(Level.SEVERE, par1Str); ++ } ++ ++ public void logSevereException(String par1Str, Throwable par2Throwable) { ++ this.serverLogger.log(Level.SEVERE, par1Str, par2Throwable); ++ } ++ ++ public void logFine(String par1Str) { ++ this.serverLogger.log(Level.FINE, par1Str); ++ } ++ ++ static String func_98237_a(LogAgent par0LogAgent) { ++ return par0LogAgent.loggerPrefix; + } + } diff --git a/patches/net/minecraft/src/LogFormatter.java.patch b/patches/net/minecraft/src/LogFormatter.java.patch new file mode 100644 index 0000000..e6a0695 --- /dev/null +++ b/patches/net/minecraft/src/LogFormatter.java.patch @@ -0,0 +1,53 @@ +--- net/minecraft/src/LogFormatter.java ++++ net/minecraft/src/LogFormatter.java +@@ -7,26 +7,29 @@ + import java.util.logging.LogRecord; + + class LogFormatter extends Formatter { +- private SimpleDateFormat b; ++ private SimpleDateFormat field_98228_b; ++ + final LogAgent field_98229_a; + +- private LogFormatter(LogAgent var1) { +- this.field_98229_a = var1; +- this.b = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); ++ private LogFormatter(LogAgent par1LogAgent) { ++ this.field_98229_a = par1LogAgent; ++ this.field_98228_b = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + } + +- public String format(LogRecord var1) { ++ public String format(LogRecord par1LogRecord) { + StringBuilder var2 = new StringBuilder(); +- var2.append(this.b.format(Long.valueOf(var1.getMillis()))); +- if(LogAgent.func_98237_a(this.field_98229_a) != null) { ++ var2.append(this.field_98228_b.format(Long.valueOf(par1LogRecord.getMillis()))); ++ ++ if (LogAgent.func_98237_a(this.field_98229_a) != null) { + var2.append(LogAgent.func_98237_a(this.field_98229_a)); + } + +- var2.append(" [").append(var1.getLevel().getName()).append("] "); +- var2.append(this.formatMessage(var1)); ++ var2.append(" [").append(par1LogRecord.getLevel().getName()).append("] "); ++ var2.append(this.formatMessage(par1LogRecord)); + var2.append('\n'); +- Throwable var3 = var1.getThrown(); +- if(var3 != null) { ++ Throwable var3 = par1LogRecord.getThrown(); ++ ++ if (var3 != null) { + StringWriter var4 = new StringWriter(); + var3.printStackTrace(new PrintWriter(var4)); + var2.append(var4.toString()); +@@ -35,7 +38,7 @@ + return var2.toString(); + } + +- LogFormatter(LogAgent var1, LogAgentEmptyAnon var2) { +- this(var1); ++ LogFormatter(LogAgent par1LogAgent, LogAgentEmptyAnon par2LogAgentEmptyAnon) { ++ this(par1LogAgent); + } + } diff --git a/patches/net/minecraft/src/LongHashMap.java.patch b/patches/net/minecraft/src/LongHashMap.java.patch new file mode 100644 index 0000000..05d3eb6 --- /dev/null +++ b/patches/net/minecraft/src/LongHashMap.java.patch @@ -0,0 +1,257 @@ +--- net/minecraft/src/LongHashMap.java ++++ net/minecraft/src/LongHashMap.java +@@ -1,50 +1,76 @@ + package net.minecraft.src; + + public class LongHashMap { ++ ++ /** the array of all elements in the hash */ + private transient LongHashMapEntry[] hashArray = new LongHashMapEntry[16]; ++ ++ /** the number of elements in the hash array */ + private transient int numHashElements; ++ ++ /** ++ * the maximum amount of elements in the hash (probably 3/4 the size due to meh hashing function) ++ */ + private int capacity = 12; +- private final float percentUseable = 12.0F / 16.0F; ++ ++ /** ++ * percent of the hasharray that can be used without hash colliding probably ++ */ ++ private final float percentUseable = 0.75F; ++ ++ /** count of times elements have been added/removed */ + private transient volatile int modCount; + +- private static int getHashedKey(long var0) { +- return hash((int)(var0 ^ var0 >>> 32)); +- } +- +- private static int hash(int var0) { +- var0 ^= var0 >>> 20 ^ var0 >>> 12; +- return var0 ^ var0 >>> 7 ^ var0 >>> 4; +- } +- +- private static int getHashIndex(int var0, int var1) { +- return var0 & var1 - 1; ++ /** ++ * returns the hashed key given the original key ++ */ ++ private static int getHashedKey(long par0) { ++ return hash((int)(par0 ^ par0 >>> 32)); ++ } ++ ++ /** ++ * the hash function ++ */ ++ private static int hash(int par0) { ++ par0 ^= par0 >>> 20 ^ par0 >>> 12; ++ return par0 ^ par0 >>> 7 ^ par0 >>> 4; ++ } ++ ++ /** ++ * gets the index in the hash given the array length and the hashed key ++ */ ++ private static int getHashIndex(int par0, int par1) { ++ return par0 & par1 - 1; + } + + public int getNumHashElements() { + return this.numHashElements; + } + +- public Object getValueByKey(long var1) { +- int var3 = getHashedKey(var1); ++ /** ++ * get the value from the map given the key ++ */ ++ public Object getValueByKey(long par1) { ++ int var3 = getHashedKey(par1); + +- for(LongHashMapEntry var4 = this.hashArray[getHashIndex(var3, this.hashArray.length)]; var4 != null; var4 = var4.nextEntry) { +- if(var4.key == var1) { +- return var4.b; ++ for (LongHashMapEntry var4 = this.hashArray[getHashIndex(var3, this.hashArray.length)]; var4 != null; var4 = var4.nextEntry) { ++ if (var4.key == par1) { ++ return var4.value; + } + } + + return null; + } + +- public boolean containsItem(long var1) { +- return this.getEntry(var1) != null; ++ public boolean containsItem(long par1) { ++ return this.getEntry(par1) != null; + } + +- final LongHashMapEntry getEntry(long var1) { +- int var3 = getHashedKey(var1); ++ final LongHashMapEntry getEntry(long par1) { ++ int var3 = getHashedKey(par1); + +- for(LongHashMapEntry var4 = this.hashArray[getHashIndex(var3, this.hashArray.length)]; var4 != null; var4 = var4.nextEntry) { +- if(var4.key == var1) { ++ for (LongHashMapEntry var4 = this.hashArray[getHashIndex(var3, this.hashArray.length)]; var4 != null; var4 = var4.nextEntry) { ++ if (var4.key == par1) { + return var4; + } + } +@@ -52,74 +78,92 @@ + return null; + } + +- public void add(long var1, Object var3) { +- int var4 = getHashedKey(var1); ++ /** ++ * Add a key-value pair. ++ */ ++ public void add(long par1, Object par3Obj) { ++ int var4 = getHashedKey(par1); + int var5 = getHashIndex(var4, this.hashArray.length); + +- for(LongHashMapEntry var6 = this.hashArray[var5]; var6 != null; var6 = var6.nextEntry) { +- if(var6.key == var1) { +- var6.b = var3; ++ for (LongHashMapEntry var6 = this.hashArray[var5]; var6 != null; var6 = var6.nextEntry) { ++ if (var6.key == par1) { ++ var6.value = par3Obj; + return; + } + } + + ++this.modCount; +- this.createKey(var4, var1, var3, var5); ++ this.createKey(var4, par1, par3Obj, var5); + } + +- private void resizeTable(int var1) { ++ /** ++ * resizes the table ++ */ ++ private void resizeTable(int par1) { + LongHashMapEntry[] var2 = this.hashArray; + int var3 = var2.length; +- if(var3 == 1073741824) { ++ ++ if (var3 == 1073741824) { + this.capacity = Integer.MAX_VALUE; + } else { +- LongHashMapEntry[] var4 = new LongHashMapEntry[var1]; ++ LongHashMapEntry[] var4 = new LongHashMapEntry[par1]; + this.copyHashTableTo(var4); + this.hashArray = var4; +- this.capacity = (int)((float)var1 * this.percentUseable); ++ this.capacity = (int)((float)par1 * this.percentUseable); + } + } + +- private void copyHashTableTo(LongHashMapEntry[] var1) { ++ /** ++ * copies the hash table to the specified array ++ */ ++ private void copyHashTableTo(LongHashMapEntry[] par1ArrayOfLongHashMapEntry) { + LongHashMapEntry[] var2 = this.hashArray; +- int var3 = var1.length; ++ int var3 = par1ArrayOfLongHashMapEntry.length; + +- for(int var4 = 0; var4 < var2.length; ++var4) { ++ for (int var4 = 0; var4 < var2.length; ++var4) { + LongHashMapEntry var5 = var2[var4]; +- if(var5 != null) { ++ ++ if (var5 != null) { + var2[var4] = null; +- + LongHashMapEntry var6; ++ + do { + var6 = var5.nextEntry; + int var7 = getHashIndex(var5.hash, var3); +- var5.nextEntry = var1[var7]; +- var1[var7] = var5; ++ var5.nextEntry = par1ArrayOfLongHashMapEntry[var7]; ++ par1ArrayOfLongHashMapEntry[var7] = var5; + var5 = var6; +- } while(var6 != null); ++ } while (var6 != null); + } + } +- +- } +- +- public Object remove(long var1) { +- LongHashMapEntry var3 = this.removeKey(var1); +- return var3 == null ? null : var3.b; +- } +- +- final LongHashMapEntry removeKey(long var1) { +- int var3 = getHashedKey(var1); ++ } ++ ++ /** ++ * calls the removeKey method and returns removed object ++ */ ++ public Object remove(long par1) { ++ LongHashMapEntry var3 = this.removeKey(par1); ++ return var3 == null ? null : var3.value; ++ } ++ ++ /** ++ * removes the key from the hash linked list ++ */ ++ final LongHashMapEntry removeKey(long par1) { ++ int var3 = getHashedKey(par1); + int var4 = getHashIndex(var3, this.hashArray.length); + LongHashMapEntry var5 = this.hashArray[var4]; +- + LongHashMapEntry var6; + LongHashMapEntry var7; +- for(var6 = var5; var6 != null; var6 = var7) { ++ ++ for (var6 = var5; var6 != null; var6 = var7) { + var7 = var6.nextEntry; +- if(var6.key == var1) { ++ ++ if (var6.key == par1) { + ++this.modCount; + --this.numHashElements; +- if(var5 == var6) { ++ ++ if (var5 == var6) { + this.hashArray[var4] = var7; + } else { + var5.nextEntry = var7; +@@ -134,16 +178,22 @@ + return var6; + } + +- private void createKey(int var1, long var2, Object var4, int var5) { +- LongHashMapEntry var6 = this.hashArray[var5]; +- this.hashArray[var5] = new LongHashMapEntry(var1, var2, var4, var6); +- if(this.numHashElements++ >= this.capacity) { ++ /** ++ * creates the key in the hash table ++ */ ++ private void createKey(int par1, long par2, Object par4Obj, int par5) { ++ LongHashMapEntry var6 = this.hashArray[par5]; ++ this.hashArray[par5] = new LongHashMapEntry(par1, par2, par4Obj, var6); ++ ++ if (this.numHashElements++ >= this.capacity) { + this.resizeTable(2 * this.hashArray.length); + } +- + } + +- static int getHashCode(long var0) { +- return getHashedKey(var0); ++ /** ++ * public method to get the hashed key(hashCode) ++ */ ++ static int getHashCode(long par0) { ++ return getHashedKey(par0); + } + } diff --git a/patches/net/minecraft/src/LongHashMapEntry.java.patch b/patches/net/minecraft/src/LongHashMapEntry.java.patch new file mode 100644 index 0000000..6f80a1e --- /dev/null +++ b/patches/net/minecraft/src/LongHashMapEntry.java.patch @@ -0,0 +1,62 @@ +--- net/minecraft/src/LongHashMapEntry.java ++++ net/minecraft/src/LongHashMapEntry.java +@@ -1,16 +1,24 @@ + package net.minecraft.src; + + class LongHashMapEntry { ++ ++ /** ++ * the key as a long (for playerInstances it is the x in the most significant 32 bits and then y) ++ */ + final long key; +- Object b; ++ ++ /** the value held by the hash at the specified key */ ++ Object value; ++ ++ /** the next hashentry in the table */ + LongHashMapEntry nextEntry; + final int hash; + +- LongHashMapEntry(int var1, long var2, Object var4, LongHashMapEntry var5) { +- this.b = var4; +- this.nextEntry = var5; +- this.key = var2; +- this.hash = var1; ++ LongHashMapEntry(int par1, long par2, Object par4Obj, LongHashMapEntry par5LongHashMapEntry) { ++ this.value = par4Obj; ++ this.nextEntry = par5LongHashMapEntry; ++ this.key = par2; ++ this.hash = par1; + } + + public final long getKey() { +@@ -18,20 +26,22 @@ + } + + public final Object getValue() { +- return this.b; ++ return this.value; + } + +- public final boolean equals(Object var1) { +- if(!(var1 instanceof LongHashMapEntry)) { ++ public final boolean equals(Object par1Obj) { ++ if (!(par1Obj instanceof LongHashMapEntry)) { + return false; + } else { +- LongHashMapEntry var2 = (LongHashMapEntry)var1; ++ LongHashMapEntry var2 = (LongHashMapEntry)par1Obj; + Long var3 = Long.valueOf(this.getKey()); + Long var4 = Long.valueOf(var2.getKey()); +- if(var3 == var4 || var3 != null && var3.equals(var4)) { ++ ++ if (var3 == var4 || var3 != null && var3.equals(var4)) { + Object var5 = this.getValue(); + Object var6 = var2.getValue(); +- if(var5 == var6 || var5 != null && var5.equals(var6)) { ++ ++ if (var5 == var6 || var5 != null && var5.equals(var6)) { + return true; + } + } diff --git a/patches/net/minecraft/src/LowerStringMap.java.patch b/patches/net/minecraft/src/LowerStringMap.java.patch new file mode 100644 index 0000000..b0e1f81 --- /dev/null +++ b/patches/net/minecraft/src/LowerStringMap.java.patch @@ -0,0 +1,104 @@ +--- net/minecraft/src/LowerStringMap.java ++++ net/minecraft/src/LowerStringMap.java +@@ -8,63 +8,65 @@ + import java.util.Map.Entry; + + public class LowerStringMap implements Map { +- private final Map a = new LinkedHashMap(); ++ private final Map internalMap = new LinkedHashMap(); + + public int size() { +- return this.a.size(); ++ return this.internalMap.size(); + } + + public boolean isEmpty() { +- return this.a.isEmpty(); +- } +- +- public boolean containsKey(Object var1) { +- return this.a.containsKey(var1.toString().toLowerCase()); +- } +- +- public boolean containsValue(Object var1) { +- return this.a.containsKey(var1); +- } +- +- public Object get(Object var1) { +- return this.a.get(var1.toString().toLowerCase()); +- } +- +- public Object putLower(String var1, Object var2) { +- return this.a.put(var1.toLowerCase(), var2); +- } +- +- public Object remove(Object var1) { +- return this.a.remove(var1.toString().toLowerCase()); +- } +- +- public void putAll(Map var1) { +- Iterator var2 = var1.entrySet().iterator(); +- +- while(var2.hasNext()) { ++ return this.internalMap.isEmpty(); ++ } ++ ++ public boolean containsKey(Object par1Obj) { ++ return this.internalMap.containsKey(par1Obj.toString().toLowerCase()); ++ } ++ ++ public boolean containsValue(Object par1Obj) { ++ return this.internalMap.containsKey(par1Obj); ++ } ++ ++ public Object get(Object par1Obj) { ++ return this.internalMap.get(par1Obj.toString().toLowerCase()); ++ } ++ ++ /** ++ * a map already defines a general put ++ */ ++ public Object putLower(String par1Str, Object par2Obj) { ++ return this.internalMap.put(par1Str.toLowerCase(), par2Obj); ++ } ++ ++ public Object remove(Object par1Obj) { ++ return this.internalMap.remove(par1Obj.toString().toLowerCase()); ++ } ++ ++ public void putAll(Map par1Map) { ++ Iterator var2 = par1Map.entrySet().iterator(); ++ ++ while (var2.hasNext()) { + Entry var3 = (Entry)var2.next(); + this.putLower((String)var3.getKey(), var3.getValue()); + } +- + } + + public void clear() { +- this.a.clear(); ++ this.internalMap.clear(); + } + + public Set keySet() { +- return this.a.keySet(); ++ return this.internalMap.keySet(); + } + + public Collection values() { +- return this.a.values(); ++ return this.internalMap.values(); + } + + public Set entrySet() { +- return this.a.entrySet(); ++ return this.internalMap.entrySet(); + } + +- public Object put(Object var1, Object var2) { +- return this.putLower((String)var1, var2); ++ public Object put(Object par1Obj, Object par2Obj) { ++ return this.putLower((String)par1Obj, par2Obj); + } + } diff --git a/patches/net/minecraft/src/MD5String.java.patch b/patches/net/minecraft/src/MD5String.java.patch new file mode 100644 index 0000000..2c35bdd --- /dev/null +++ b/patches/net/minecraft/src/MD5String.java.patch @@ -0,0 +1,29 @@ +--- net/minecraft/src/MD5String.java ++++ net/minecraft/src/MD5String.java +@@ -5,15 +5,20 @@ + import java.security.NoSuchAlgorithmException; + + public class MD5String { +- private String a; +- +- public MD5String(String var1) { +- this.a = var1; ++ ++ /** The salt prepended to the string to be hashed */ ++ private String salt; ++ ++ public MD5String(String par1Str) { ++ this.salt = par1Str; + } + +- public String getMD5String(String var1) { ++ /** ++ * Gets the MD5 string ++ */ ++ public String getMD5String(String par1Str) { + try { +- String var2 = this.a + var1; ++ String var2 = this.salt + par1Str; + MessageDigest var3 = MessageDigest.getInstance("MD5"); + var3.update(var2.getBytes(), 0, var2.length()); + return (new BigInteger(1, var3.digest())).toString(16); diff --git a/patches/net/minecraft/src/MainProxyAuthenticator.java.patch b/patches/net/minecraft/src/MainProxyAuthenticator.java.patch new file mode 100644 index 0000000..918ada6 --- /dev/null +++ b/patches/net/minecraft/src/MainProxyAuthenticator.java.patch @@ -0,0 +1,26 @@ +--- net/minecraft/src/MainProxyAuthenticator.java ++++ net/minecraft/src/MainProxyAuthenticator.java +@@ -4,15 +4,16 @@ + import java.net.PasswordAuthentication; + + public final class MainProxyAuthenticator extends Authenticator { +- final String a; +- final String b; +- +- public MainProxyAuthenticator(String var1, String var2) { +- this.a = var1; +- this.b = var2; ++ final String field_111237_a; ++ ++ final String field_111236_b; ++ ++ public MainProxyAuthenticator(String par1Str, String par2Str) { ++ this.field_111237_a = par1Str; ++ this.field_111236_b = par2Str; + } + + protected PasswordAuthentication getPasswordAuthentication() { +- return new PasswordAuthentication(this.a, this.b.toCharArray()); ++ return new PasswordAuthentication(this.field_111237_a, this.field_111236_b.toCharArray()); + } + } diff --git a/patches/net/minecraft/src/MapColor.java.patch b/patches/net/minecraft/src/MapColor.java.patch new file mode 100644 index 0000000..11f7ede --- /dev/null +++ b/patches/net/minecraft/src/MapColor.java.patch @@ -0,0 +1,79 @@ +--- net/minecraft/src/MapColor.java ++++ net/minecraft/src/MapColor.java +@@ -1,27 +1,71 @@ + package net.minecraft.src; + + public class MapColor { ++ ++ /** ++ * Holds all the 16 colors used on maps, very similar of a pallete system. ++ */ + public static final MapColor[] mapColorArray = new MapColor[16]; ++ ++ /** The map color for Air blocks */ + public static final MapColor airColor = new MapColor(0, 0); ++ ++ /** this is the grass color in html format */ + public static final MapColor grassColor = new MapColor(1, 8368696); ++ ++ /** This is the color of the sand */ + public static final MapColor sandColor = new MapColor(2, 16247203); ++ ++ /** The map color for Cloth and Sponge blocks */ + public static final MapColor clothColor = new MapColor(3, 10987431); ++ ++ /** The map color for TNT blocks */ + public static final MapColor tntColor = new MapColor(4, 16711680); ++ ++ /** The map color for Ice blocks */ + public static final MapColor iceColor = new MapColor(5, 10526975); ++ ++ /** The map color for Iron blocks */ + public static final MapColor ironColor = new MapColor(6, 10987431); ++ ++ /** The map color for Leaf, Plant, Cactus, and Pumpkin blocks. */ + public static final MapColor foliageColor = new MapColor(7, 31744); ++ ++ /** The map color for Snow Cover and Snow blocks */ + public static final MapColor snowColor = new MapColor(8, 16777215); ++ ++ /** The map color for Clay blocks */ + public static final MapColor clayColor = new MapColor(9, 10791096); ++ ++ /** The map color for Dirt blocks */ + public static final MapColor dirtColor = new MapColor(10, 12020271); ++ ++ /** The map color for Stone blocks */ + public static final MapColor stoneColor = new MapColor(11, 7368816); ++ ++ /** The map color for Water blocks */ + public static final MapColor waterColor = new MapColor(12, 4210943); ++ ++ /** The map color for Wood blocks */ + public static final MapColor woodColor = new MapColor(13, 6837042); +- public final int colorValue; ++ ++ /** Holds the color in RGB value that will be rendered on maps. */ ++ // MCPatcher Start - Removed final ++ public int colorValue; ++ // MCPatcher End ++ ++ /** Holds the index of the color used on map. */ + public final int colorIndex; ++ // MCPatcher Start - Removed final ++ public int origColorValue; ++ // MCPatcher End + +- private MapColor(int var1, int var2) { +- this.colorIndex = var1; +- this.colorValue = var2; +- mapColorArray[var1] = this; ++ private MapColor(int par1, int par2) { ++ this.colorIndex = par1; ++ this.colorValue = par2; ++ // MCPatcher Start ++ this.origColorValue = par2; ++ // MCPatcher End ++ mapColorArray[par1] = this; + } + } diff --git a/patches/net/minecraft/src/MapCoord.java.patch b/patches/net/minecraft/src/MapCoord.java.patch new file mode 100644 index 0000000..b2cc6bf --- /dev/null +++ b/patches/net/minecraft/src/MapCoord.java.patch @@ -0,0 +1,23 @@ +--- net/minecraft/src/MapCoord.java ++++ net/minecraft/src/MapCoord.java +@@ -5,13 +5,14 @@ + public byte centerX; + public byte centerZ; + public byte iconRotation; ++ + final MapData data; + +- public MapCoord(MapData var1, byte var2, byte var3, byte var4, byte var5) { +- this.data = var1; +- this.iconSize = var2; +- this.centerX = var3; +- this.centerZ = var4; +- this.iconRotation = var5; ++ public MapCoord(MapData par1MapData, byte par2, byte par3, byte par4, byte par5) { ++ this.data = par1MapData; ++ this.iconSize = par2; ++ this.centerX = par3; ++ this.centerZ = par4; ++ this.iconRotation = par5; + } + } diff --git a/patches/net/minecraft/src/MapData.java.patch b/patches/net/minecraft/src/MapData.java.patch new file mode 100644 index 0000000..aef176b --- /dev/null +++ b/patches/net/minecraft/src/MapData.java.patch @@ -0,0 +1,338 @@ +--- net/minecraft/src/MapData.java ++++ net/minecraft/src/MapData.java +@@ -11,189 +11,225 @@ + public int zCenter; + public byte dimension; + public byte scale; ++ ++ /** colours */ + public byte[] colors = new byte[16384]; +- public List f = new ArrayList(); +- private Map i = new HashMap(); +- public Map g = new LinkedHashMap(); +- +- public MapData(String var1) { +- super(var1); ++ ++ /** ++ * Holds a reference to the MapInfo of the players who own a copy of the map ++ */ ++ public List playersArrayList = new ArrayList(); ++ ++ /** ++ * Holds a reference to the players who own a copy of the map and a reference to their MapInfo ++ */ ++ private Map playersHashMap = new HashMap(); ++ public Map playersVisibleOnMap = new LinkedHashMap(); ++ ++ public MapData(String par1Str) { ++ super(par1Str); + } + +- public void readFromNBT(NBTTagCompound var1) { +- this.dimension = var1.getByte("dimension"); +- this.xCenter = var1.getInteger("xCenter"); +- this.zCenter = var1.getInteger("zCenter"); +- this.scale = var1.getByte("scale"); +- if(this.scale < 0) { ++ /** ++ * reads in data from the NBTTagCompound into this MapDataBase ++ */ ++ public void readFromNBT(NBTTagCompound par1NBTTagCompound) { ++ this.dimension = par1NBTTagCompound.getByte("dimension"); ++ this.xCenter = par1NBTTagCompound.getInteger("xCenter"); ++ this.zCenter = par1NBTTagCompound.getInteger("zCenter"); ++ this.scale = par1NBTTagCompound.getByte("scale"); ++ ++ if (this.scale < 0) { + this.scale = 0; + } + +- if(this.scale > 4) { ++ if (this.scale > 4) { + this.scale = 4; + } + +- short var2 = var1.getShort("width"); +- short var3 = var1.getShort("height"); +- if(var2 == 128 && var3 == 128) { +- this.colors = var1.getByteArray("colors"); ++ short var2 = par1NBTTagCompound.getShort("width"); ++ short var3 = par1NBTTagCompound.getShort("height"); ++ ++ if (var2 == 128 && var3 == 128) { ++ this.colors = par1NBTTagCompound.getByteArray("colors"); + } else { +- byte[] var4 = var1.getByteArray("colors"); ++ byte[] var4 = par1NBTTagCompound.getByteArray("colors"); + this.colors = new byte[16384]; + int var5 = (128 - var2) / 2; + int var6 = (128 - var3) / 2; + +- for(int var7 = 0; var7 < var3; ++var7) { ++ for (int var7 = 0; var7 < var3; ++var7) { + int var8 = var7 + var6; +- if(var8 >= 0 || var8 < 128) { +- for(int var9 = 0; var9 < var2; ++var9) { ++ ++ if (var8 >= 0 || var8 < 128) { ++ for (int var9 = 0; var9 < var2; ++var9) { + int var10 = var9 + var5; +- if(var10 >= 0 || var10 < 128) { ++ ++ if (var10 >= 0 || var10 < 128) { + this.colors[var10 + var8 * 128] = var4[var9 + var7 * var2]; + } + } + } + } + } +- +- } +- +- public void writeToNBT(NBTTagCompound var1) { +- var1.setByte("dimension", this.dimension); +- var1.setInteger("xCenter", this.xCenter); +- var1.setInteger("zCenter", this.zCenter); +- var1.setByte("scale", this.scale); +- var1.setShort("width", (short)128); +- var1.setShort("height", (short)128); +- var1.setByteArray("colors", this.colors); +- } +- +- public void updateVisiblePlayers(EntityPlayer var1, ItemStack var2) { +- if(!this.i.containsKey(var1)) { +- MapInfo var3 = new MapInfo(this, var1); +- this.i.put(var1, var3); +- this.f.add(var3); +- } +- +- if(!var1.inventory.hasItemStack(var2)) { +- this.g.remove(var1.getCommandSenderName()); +- } +- +- for(int var5 = 0; var5 < this.f.size(); ++var5) { +- MapInfo var4 = (MapInfo)this.f.get(var5); +- if(!var4.entityplayerObj.isDead && (var4.entityplayerObj.inventory.hasItemStack(var2) || var2.isOnItemFrame())) { +- if(!var2.isOnItemFrame() && var4.entityplayerObj.dimension == this.dimension) { ++ } ++ ++ /** ++ * write data to NBTTagCompound from this MapDataBase, similar to Entities and TileEntities ++ */ ++ public void writeToNBT(NBTTagCompound par1NBTTagCompound) { ++ par1NBTTagCompound.setByte("dimension", this.dimension); ++ par1NBTTagCompound.setInteger("xCenter", this.xCenter); ++ par1NBTTagCompound.setInteger("zCenter", this.zCenter); ++ par1NBTTagCompound.setByte("scale", this.scale); ++ par1NBTTagCompound.setShort("width", (short)128); ++ par1NBTTagCompound.setShort("height", (short)128); ++ par1NBTTagCompound.setByteArray("colors", this.colors); ++ } ++ ++ /** ++ * Adds the player passed to the list of visible players and checks to see which players are visible ++ */ ++ public void updateVisiblePlayers(EntityPlayer par1EntityPlayer, ItemStack par2ItemStack) { ++ if (!this.playersHashMap.containsKey(par1EntityPlayer)) { ++ MapInfo var3 = new MapInfo(this, par1EntityPlayer); ++ this.playersHashMap.put(par1EntityPlayer, var3); ++ this.playersArrayList.add(var3); ++ } ++ ++ if (!par1EntityPlayer.inventory.hasItemStack(par2ItemStack)) { ++ this.playersVisibleOnMap.remove(par1EntityPlayer.getCommandSenderName()); ++ } ++ ++ for (int var5 = 0; var5 < this.playersArrayList.size(); ++var5) { ++ MapInfo var4 = (MapInfo)this.playersArrayList.get(var5); ++ ++ if (!var4.entityplayerObj.isDead && (var4.entityplayerObj.inventory.hasItemStack(par2ItemStack) || par2ItemStack.isOnItemFrame())) { ++ if (!par2ItemStack.isOnItemFrame() && var4.entityplayerObj.dimension == this.dimension) { + this.func_82567_a(0, var4.entityplayerObj.worldObj, var4.entityplayerObj.getCommandSenderName(), var4.entityplayerObj.posX, var4.entityplayerObj.posZ, (double)var4.entityplayerObj.rotationYaw); + } + } else { +- this.i.remove(var4.entityplayerObj); +- this.f.remove(var4); ++ this.playersHashMap.remove(var4.entityplayerObj); ++ this.playersArrayList.remove(var4); + } + } + +- if(var2.isOnItemFrame()) { +- this.func_82567_a(1, var1.worldObj, "frame-" + var2.getItemFrame().entityId, (double)var2.getItemFrame().xPosition, (double)var2.getItemFrame().zPosition, (double)(var2.getItemFrame().hangingDirection * 90)); ++ if (par2ItemStack.isOnItemFrame()) { ++ this.func_82567_a(1, par1EntityPlayer.worldObj, "frame-" + par2ItemStack.getItemFrame().entityId, (double)par2ItemStack.getItemFrame().xPosition, (double)par2ItemStack.getItemFrame().zPosition, (double)(par2ItemStack.getItemFrame().hangingDirection * 90)); + } +- + } + +- private void func_82567_a(int var1, World var2, String var3, double var4, double var6, double var8) { ++ private void func_82567_a(int par1, World par2World, String par3Str, double par4, double par6, double par8) { + int var10 = 1 << this.scale; +- float var11 = (float)(var4 - (double)this.xCenter) / (float)var10; +- float var12 = (float)(var6 - (double)this.zCenter) / (float)var10; ++ float var11 = (float)(par4 - (double)this.xCenter) / (float)var10; ++ float var12 = (float)(par6 - (double)this.zCenter) / (float)var10; + byte var13 = (byte)((int)((double)(var11 * 2.0F) + 0.5D)); + byte var14 = (byte)((int)((double)(var12 * 2.0F) + 0.5D)); + byte var16 = 63; + byte var15; +- if(var11 >= (float)(-var16) && var12 >= (float)(-var16) && var11 <= (float)var16 && var12 <= (float)var16) { +- var8 += var8 < 0.0D ? -8.0D : 8.0D; +- var15 = (byte)((int)(var8 * 16.0D / 360.0D)); +- if(this.dimension < 0) { +- int var17 = (int)(var2.getWorldInfo().getWorldTime() / 10L); ++ ++ if (var11 >= (float)(-var16) && var12 >= (float)(-var16) && var11 <= (float)var16 && var12 <= (float)var16) { ++ par8 += par8 < 0.0D ? -8.0D : 8.0D; ++ var15 = (byte)((int)(par8 * 16.0D / 360.0D)); ++ ++ if (this.dimension < 0) { ++ int var17 = (int)(par2World.getWorldInfo().getWorldTime() / 10L); + var15 = (byte)(var17 * var17 * 34187121 + var17 * 121 >> 15 & 15); + } + } else { +- if(Math.abs(var11) >= 320.0F || Math.abs(var12) >= 320.0F) { +- this.g.remove(var3); ++ if (Math.abs(var11) >= 320.0F || Math.abs(var12) >= 320.0F) { ++ this.playersVisibleOnMap.remove(par3Str); + return; + } + +- var1 = 6; ++ par1 = 6; + var15 = 0; +- if(var11 <= (float)(-var16)) { ++ ++ if (var11 <= (float)(-var16)) { + var13 = (byte)((int)((double)(var16 * 2) + 2.5D)); + } + +- if(var12 <= (float)(-var16)) { ++ if (var12 <= (float)(-var16)) { + var14 = (byte)((int)((double)(var16 * 2) + 2.5D)); + } + +- if(var11 >= (float)var16) { ++ if (var11 >= (float)var16) { + var13 = (byte)(var16 * 2 + 1); + } + +- if(var12 >= (float)var16) { ++ if (var12 >= (float)var16) { + var14 = (byte)(var16 * 2 + 1); + } + } + +- this.g.put(var3, new MapCoord(this, (byte)var1, var13, var14, var15)); +- } +- +- public byte[] getUpdatePacketData(ItemStack var1, World var2, EntityPlayer var3) { +- MapInfo var4 = (MapInfo)this.i.get(var3); +- return var4 == null ? null : var4.getPlayersOnMap(var1); +- } +- +- public void setColumnDirty(int var1, int var2, int var3) { ++ this.playersVisibleOnMap.put(par3Str, new MapCoord(this, (byte)par1, var13, var14, var15)); ++ } ++ ++ /** ++ * Get byte array of packet data to send to players on map for updating map data ++ */ ++ public byte[] getUpdatePacketData(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) { ++ MapInfo var4 = (MapInfo)this.playersHashMap.get(par3EntityPlayer); ++ return var4 == null ? null : var4.getPlayersOnMap(par1ItemStack); ++ } ++ ++ /** ++ * Marks a vertical range of pixels as being modified so they will be resent to clients. Parameters: X, lowest Y, ++ * highest Y ++ */ ++ public void setColumnDirty(int par1, int par2, int par3) { + super.markDirty(); + +- for(int var4 = 0; var4 < this.f.size(); ++var4) { +- MapInfo var5 = (MapInfo)this.f.get(var4); +- if(var5.field_76209_b[var1] < 0 || var5.field_76209_b[var1] > var2) { +- var5.field_76209_b[var1] = var2; ++ for (int var4 = 0; var4 < this.playersArrayList.size(); ++var4) { ++ MapInfo var5 = (MapInfo)this.playersArrayList.get(var4); ++ ++ if (var5.field_76209_b[par1] < 0 || var5.field_76209_b[par1] > par2) { ++ var5.field_76209_b[par1] = par2; + } + +- if(var5.field_76210_c[var1] < 0 || var5.field_76210_c[var1] < var3) { +- var5.field_76210_c[var1] = var3; ++ if (var5.field_76210_c[par1] < 0 || var5.field_76210_c[par1] < par3) { ++ var5.field_76210_c[par1] = par3; + } + } +- + } + +- public void updateMPMapData(byte[] var1) { ++ /** ++ * Updates the client's map with information from other players in MP ++ */ ++ public void updateMPMapData(byte[] par1ArrayOfByte) { + int var2; +- if(var1[0] == 0) { +- var2 = var1[1] & 255; +- int var3 = var1[2] & 255; +- +- for(int var4 = 0; var4 < var1.length - 3; ++var4) { +- this.colors[(var4 + var3) * 128 + var2] = var1[var4 + 3]; ++ ++ if (par1ArrayOfByte[0] == 0) { ++ var2 = par1ArrayOfByte[1] & 255; ++ int var3 = par1ArrayOfByte[2] & 255; ++ ++ for (int var4 = 0; var4 < par1ArrayOfByte.length - 3; ++var4) { ++ this.colors[(var4 + var3) * 128 + var2] = par1ArrayOfByte[var4 + 3]; + } + + this.markDirty(); +- } else if(var1[0] == 1) { +- this.g.clear(); ++ } else if (par1ArrayOfByte[0] == 1) { ++ this.playersVisibleOnMap.clear(); + +- for(var2 = 0; var2 < (var1.length - 1) / 3; ++var2) { +- byte var7 = (byte)(var1[var2 * 3 + 1] >> 4); +- byte var8 = var1[var2 * 3 + 2]; +- byte var5 = var1[var2 * 3 + 3]; +- byte var6 = (byte)(var1[var2 * 3 + 1] & 15); +- this.g.put("icon-" + var2, new MapCoord(this, var7, var8, var5, var6)); ++ for (var2 = 0; var2 < (par1ArrayOfByte.length - 1) / 3; ++var2) { ++ byte var7 = (byte)(par1ArrayOfByte[var2 * 3 + 1] >> 4); ++ byte var8 = par1ArrayOfByte[var2 * 3 + 2]; ++ byte var5 = par1ArrayOfByte[var2 * 3 + 3]; ++ byte var6 = (byte)(par1ArrayOfByte[var2 * 3 + 1] & 15); ++ this.playersVisibleOnMap.put("icon-" + var2, new MapCoord(this, var7, var8, var5, var6)); + } +- } else if(var1[0] == 2) { +- this.scale = var1[1]; ++ } else if (par1ArrayOfByte[0] == 2) { ++ this.scale = par1ArrayOfByte[1]; + } +- + } + +- public MapInfo func_82568_a(EntityPlayer var1) { +- MapInfo var2 = (MapInfo)this.i.get(var1); +- if(var2 == null) { +- var2 = new MapInfo(this, var1); +- this.i.put(var1, var2); +- this.f.add(var2); ++ public MapInfo func_82568_a(EntityPlayer par1EntityPlayer) { ++ MapInfo var2 = (MapInfo)this.playersHashMap.get(par1EntityPlayer); ++ ++ if (var2 == null) { ++ var2 = new MapInfo(this, par1EntityPlayer); ++ this.playersHashMap.put(par1EntityPlayer, var2); ++ this.playersArrayList.add(var2); + } + + return var2; diff --git a/patches/net/minecraft/src/MapGenBase.java.patch b/patches/net/minecraft/src/MapGenBase.java.patch new file mode 100644 index 0000000..a712142 --- /dev/null +++ b/patches/net/minecraft/src/MapGenBase.java.patch @@ -0,0 +1,53 @@ +--- net/minecraft/src/MapGenBase.java ++++ net/minecraft/src/MapGenBase.java +@@ -3,28 +3,35 @@ + import java.util.Random; + + public class MapGenBase { ++ ++ /** The number of Chunks to gen-check in any given direction. */ + protected int range = 8; +- protected Random b = new Random(); ++ ++ /** The RNG used by the MapGen classes. */ ++ protected Random rand = new Random(); ++ ++ /** This world object. */ + protected World worldObj; + +- public void generate(IChunkProvider var1, World var2, int var3, int var4, byte[] var5) { ++ public void generate(IChunkProvider par1IChunkProvider, World par2World, int par3, int par4, byte[] par5ArrayOfByte) { + int var6 = this.range; +- this.worldObj = var2; +- this.b.setSeed(var2.getSeed()); +- long var7 = this.b.nextLong(); +- long var9 = this.b.nextLong(); ++ this.worldObj = par2World; ++ this.rand.setSeed(par2World.getSeed()); ++ long var7 = this.rand.nextLong(); ++ long var9 = this.rand.nextLong(); + +- for(int var11 = var3 - var6; var11 <= var3 + var6; ++var11) { +- for(int var12 = var4 - var6; var12 <= var4 + var6; ++var12) { ++ for (int var11 = par3 - var6; var11 <= par3 + var6; ++var11) { ++ for (int var12 = par4 - var6; var12 <= par4 + var6; ++var12) { + long var13 = (long)var11 * var7; + long var15 = (long)var12 * var9; +- this.b.setSeed(var13 ^ var15 ^ var2.getSeed()); +- this.recursiveGenerate(var2, var11, var12, var3, var4, var5); ++ this.rand.setSeed(var13 ^ var15 ^ par2World.getSeed()); ++ this.recursiveGenerate(par2World, var11, var12, par3, par4, par5ArrayOfByte); + } + } +- +- } +- +- protected void recursiveGenerate(World var1, int var2, int var3, int var4, int var5, byte[] var6) { +- } ++ } ++ ++ /** ++ * Recursively called by generate() (generate) and optionally by itself. ++ */ ++ protected void recursiveGenerate(World par1World, int par2, int par3, int par4, int par5, byte[] par6ArrayOfByte) {} + } diff --git a/patches/net/minecraft/src/MapGenCaves.java.patch b/patches/net/minecraft/src/MapGenCaves.java.patch new file mode 100644 index 0000000..e5b3281 --- /dev/null +++ b/patches/net/minecraft/src/MapGenCaves.java.patch @@ -0,0 +1,301 @@ +--- net/minecraft/src/MapGenCaves.java ++++ net/minecraft/src/MapGenCaves.java +@@ -3,109 +3,123 @@ + import java.util.Random; + + public class MapGenCaves extends MapGenBase { +- protected void generateLargeCaveNode(long var1, int var3, int var4, byte[] var5, double var6, double var8, double var10) { +- this.generateCaveNode(var1, var3, var4, var5, var6, var8, var10, 1.0F + this.b.nextFloat() * 6.0F, 0.0F, 0.0F, -1, -1, 0.5D); ++ ++ /** ++ * Generates a larger initial cave node than usual. Called 25% of the time. ++ */ ++ protected void generateLargeCaveNode(long par1, int par3, int par4, byte[] par5ArrayOfByte, double par6, double par8, double par10) { ++ this.generateCaveNode(par1, par3, par4, par5ArrayOfByte, par6, par8, par10, 1.0F + this.rand.nextFloat() * 6.0F, 0.0F, 0.0F, -1, -1, 0.5D); + } + +- protected void generateCaveNode(long var1, int var3, int var4, byte[] var5, double var6, double var8, double var10, float var12, float var13, float var14, int var15, int var16, double var17) { +- double var19 = (double)(var3 * 16 + 8); +- double var21 = (double)(var4 * 16 + 8); ++ /** ++ * Generates a node in the current cave system recursion tree. ++ */ ++ protected void generateCaveNode(long par1, int par3, int par4, byte[] par5ArrayOfByte, double par6, double par8, double par10, float par12, float par13, float par14, int par15, int par16, double par17) { ++ double var19 = (double)(par3 * 16 + 8); ++ double var21 = (double)(par4 * 16 + 8); + float var23 = 0.0F; + float var24 = 0.0F; +- Random var25 = new Random(var1); +- if(var16 <= 0) { ++ Random var25 = new Random(par1); ++ ++ if (par16 <= 0) { + int var26 = this.range * 16 - 16; +- var16 = var26 - var25.nextInt(var26 / 4); ++ par16 = var26 - var25.nextInt(var26 / 4); + } + + boolean var54 = false; +- if(var15 == -1) { +- var15 = var16 / 2; ++ ++ if (par15 == -1) { ++ par15 = par16 / 2; + var54 = true; + } + +- int var27 = var25.nextInt(var16 / 2) + var16 / 4; +- +- for(boolean var28 = var25.nextInt(6) == 0; var15 < var16; ++var15) { +- double var29 = 1.5D + (double)(MathHelper.sin((float)var15 * (float)Math.PI / (float)var16) * var12 * 1.0F); +- double var31 = var29 * var17; +- float var33 = MathHelper.cos(var14); +- float var34 = MathHelper.sin(var14); +- var6 += (double)(MathHelper.cos(var13) * var33); +- var8 += (double)var34; +- var10 += (double)(MathHelper.sin(var13) * var33); +- if(var28) { +- var14 *= 0.92F; ++ int var27 = var25.nextInt(par16 / 2) + par16 / 4; ++ ++ for (boolean var28 = var25.nextInt(6) == 0; par15 < par16; ++par15) { ++ double var29 = 1.5D + (double)(MathHelper.sin((float)par15 * (float)Math.PI / (float)par16) * par12 * 1.0F); ++ double var31 = var29 * par17; ++ float var33 = MathHelper.cos(par14); ++ float var34 = MathHelper.sin(par14); ++ par6 += (double)(MathHelper.cos(par13) * var33); ++ par8 += (double)var34; ++ par10 += (double)(MathHelper.sin(par13) * var33); ++ ++ if (var28) { ++ par14 *= 0.92F; + } else { +- var14 *= 0.7F; ++ par14 *= 0.7F; + } + +- var14 += var24 * 0.1F; +- var13 += var23 * 0.1F; ++ par14 += var24 * 0.1F; ++ par13 += var23 * 0.1F; + var24 *= 0.9F; +- var23 *= 12.0F / 16.0F; ++ var23 *= 0.75F; + var24 += (var25.nextFloat() - var25.nextFloat()) * var25.nextFloat() * 2.0F; + var23 += (var25.nextFloat() - var25.nextFloat()) * var25.nextFloat() * 4.0F; +- if(!var54 && var15 == var27 && var12 > 1.0F && var16 > 0) { +- this.generateCaveNode(var25.nextLong(), var3, var4, var5, var6, var8, var10, var25.nextFloat() * 0.5F + 0.5F, var13 - (float)Math.PI * 0.5F, var14 / 3.0F, var15, var16, 1.0D); +- this.generateCaveNode(var25.nextLong(), var3, var4, var5, var6, var8, var10, var25.nextFloat() * 0.5F + 0.5F, var13 + (float)Math.PI * 0.5F, var14 / 3.0F, var15, var16, 1.0D); ++ ++ if (!var54 && par15 == var27 && par12 > 1.0F && par16 > 0) { ++ this.generateCaveNode(var25.nextLong(), par3, par4, par5ArrayOfByte, par6, par8, par10, var25.nextFloat() * 0.5F + 0.5F, par13 - ((float)Math.PI / 2F), par14 / 3.0F, par15, par16, 1.0D); ++ this.generateCaveNode(var25.nextLong(), par3, par4, par5ArrayOfByte, par6, par8, par10, var25.nextFloat() * 0.5F + 0.5F, par13 + ((float)Math.PI / 2F), par14 / 3.0F, par15, par16, 1.0D); + return; + } + +- if(var54 || var25.nextInt(4) != 0) { +- double var35 = var6 - var19; +- double var37 = var10 - var21; +- double var39 = (double)(var16 - var15); +- double var41 = (double)(var12 + 2.0F + 16.0F); +- if(var35 * var35 + var37 * var37 - var39 * var39 > var41 * var41) { ++ if (var54 || var25.nextInt(4) != 0) { ++ double var35 = par6 - var19; ++ double var37 = par10 - var21; ++ double var39 = (double)(par16 - par15); ++ double var41 = (double)(par12 + 2.0F + 16.0F); ++ ++ if (var35 * var35 + var37 * var37 - var39 * var39 > var41 * var41) { + return; + } + +- if(var6 >= var19 - 16.0D - var29 * 2.0D && var10 >= var21 - 16.0D - var29 * 2.0D && var6 <= var19 + 16.0D + var29 * 2.0D && var10 <= var21 + 16.0D + var29 * 2.0D) { +- int var55 = MathHelper.floor_double(var6 - var29) - var3 * 16 - 1; +- int var36 = MathHelper.floor_double(var6 + var29) - var3 * 16 + 1; +- int var56 = MathHelper.floor_double(var8 - var31) - 1; +- int var38 = MathHelper.floor_double(var8 + var31) + 1; +- int var57 = MathHelper.floor_double(var10 - var29) - var4 * 16 - 1; +- int var40 = MathHelper.floor_double(var10 + var29) - var4 * 16 + 1; +- if(var55 < 0) { ++ if (par6 >= var19 - 16.0D - var29 * 2.0D && par10 >= var21 - 16.0D - var29 * 2.0D && par6 <= var19 + 16.0D + var29 * 2.0D && par10 <= var21 + 16.0D + var29 * 2.0D) { ++ int var55 = MathHelper.floor_double(par6 - var29) - par3 * 16 - 1; ++ int var36 = MathHelper.floor_double(par6 + var29) - par3 * 16 + 1; ++ int var56 = MathHelper.floor_double(par8 - var31) - 1; ++ int var38 = MathHelper.floor_double(par8 + var31) + 1; ++ int var57 = MathHelper.floor_double(par10 - var29) - par4 * 16 - 1; ++ int var40 = MathHelper.floor_double(par10 + var29) - par4 * 16 + 1; ++ ++ if (var55 < 0) { + var55 = 0; + } + +- if(var36 > 16) { ++ if (var36 > 16) { + var36 = 16; + } + +- if(var56 < 1) { ++ if (var56 < 1) { + var56 = 1; + } + +- if(var38 > 120) { ++ if (var38 > 120) { + var38 = 120; + } + +- if(var57 < 0) { ++ if (var57 < 0) { + var57 = 0; + } + +- if(var40 > 16) { ++ if (var40 > 16) { + var40 = 16; + } + + boolean var58 = false; +- + int var42; + int var45; +- for(var42 = var55; !var58 && var42 < var36; ++var42) { +- for(int var43 = var57; !var58 && var43 < var40; ++var43) { +- for(int var44 = var38 + 1; !var58 && var44 >= var56 - 1; --var44) { ++ ++ for (var42 = var55; !var58 && var42 < var36; ++var42) { ++ for (int var43 = var57; !var58 && var43 < var40; ++var43) { ++ for (int var44 = var38 + 1; !var58 && var44 >= var56 - 1; --var44) { + var45 = (var42 * 16 + var43) * 128 + var44; +- if(var44 >= 0 && var44 < 128) { +- if(var5[var45] == Block.waterMoving.blockID || var5[var45] == Block.waterStill.blockID) { ++ ++ if (var44 >= 0 && var44 < 128) { ++ if (par5ArrayOfByte[var45] == Block.waterMoving.blockID || par5ArrayOfByte[var45] == Block.waterStill.blockID) { + var58 = true; + } + +- if(var44 != var56 - 1 && var42 != var55 && var42 != var36 - 1 && var43 != var57 && var43 != var40 - 1) { ++ if (var44 != var56 - 1 && var42 != var55 && var42 != var36 - 1 && var43 != var57 && var43 != var40 - 1) { + var44 = var56; + } + } +@@ -113,30 +127,34 @@ + } + } + +- if(!var58) { +- for(var42 = var55; var42 < var36; ++var42) { +- double var59 = ((double)(var42 + var3 * 16) + 0.5D - var6) / var29; ++ if (!var58) { ++ for (var42 = var55; var42 < var36; ++var42) { ++ double var59 = ((double)(var42 + par3 * 16) + 0.5D - par6) / var29; + +- for(var45 = var57; var45 < var40; ++var45) { +- double var46 = ((double)(var45 + var4 * 16) + 0.5D - var10) / var29; ++ for (var45 = var57; var45 < var40; ++var45) { ++ double var46 = ((double)(var45 + par4 * 16) + 0.5D - par10) / var29; + int var48 = (var42 * 16 + var45) * 128 + var38; + boolean var49 = false; +- if(var59 * var59 + var46 * var46 < 1.0D) { +- for(int var50 = var38 - 1; var50 >= var56; --var50) { +- double var51 = ((double)var50 + 0.5D - var8) / var31; +- if(var51 > -0.7D && var59 * var59 + var51 * var51 + var46 * var46 < 1.0D) { +- byte var53 = var5[var48]; +- if(var53 == Block.grass.blockID) { ++ ++ if (var59 * var59 + var46 * var46 < 1.0D) { ++ for (int var50 = var38 - 1; var50 >= var56; --var50) { ++ double var51 = ((double)var50 + 0.5D - par8) / var31; ++ ++ if (var51 > -0.7D && var59 * var59 + var51 * var51 + var46 * var46 < 1.0D) { ++ byte var53 = par5ArrayOfByte[var48]; ++ ++ if (var53 == Block.grass.blockID) { + var49 = true; + } + +- if(var53 == Block.stone.blockID || var53 == Block.dirt.blockID || var53 == Block.grass.blockID) { +- if(var50 < 10) { +- var5[var48] = (byte)Block.lavaMoving.blockID; ++ if (var53 == Block.stone.blockID || var53 == Block.dirt.blockID || var53 == Block.grass.blockID) { ++ if (var50 < 10) { ++ par5ArrayOfByte[var48] = (byte)Block.lavaMoving.blockID; + } else { +- var5[var48] = 0; +- if(var49 && var5[var48 - 1] == Block.dirt.blockID) { +- var5[var48 - 1] = this.worldObj.getBiomeGenForCoords(var42 + var3 * 16, var45 + var4 * 16).topBlock; ++ par5ArrayOfByte[var48] = 0; ++ ++ if (var49 && par5ArrayOfByte[var48 - 1] == Block.dirt.blockID) { ++ par5ArrayOfByte[var48 - 1] = this.worldObj.getBiomeGenForCoords(var42 + par3 * 16, var45 + par4 * 16).topBlock; + } + } + } +@@ -148,43 +166,47 @@ + } + } + +- if(var54) { ++ if (var54) { + break; + } + } + } + } + } +- + } + +- protected void recursiveGenerate(World var1, int var2, int var3, int var4, int var5, byte[] var6) { +- int var7 = this.b.nextInt(this.b.nextInt(this.b.nextInt(40) + 1) + 1); +- if(this.b.nextInt(15) != 0) { ++ /** ++ * Recursively called by generate() (generate) and optionally by itself. ++ */ ++ protected void recursiveGenerate(World par1World, int par2, int par3, int par4, int par5, byte[] par6ArrayOfByte) { ++ int var7 = this.rand.nextInt(this.rand.nextInt(this.rand.nextInt(40) + 1) + 1); ++ ++ if (this.rand.nextInt(15) != 0) { + var7 = 0; + } + +- for(int var8 = 0; var8 < var7; ++var8) { +- double var9 = (double)(var2 * 16 + this.b.nextInt(16)); +- double var11 = (double)this.b.nextInt(this.b.nextInt(120) + 8); +- double var13 = (double)(var3 * 16 + this.b.nextInt(16)); ++ for (int var8 = 0; var8 < var7; ++var8) { ++ double var9 = (double)(par2 * 16 + this.rand.nextInt(16)); ++ double var11 = (double)this.rand.nextInt(this.rand.nextInt(120) + 8); ++ double var13 = (double)(par3 * 16 + this.rand.nextInt(16)); + int var15 = 1; +- if(this.b.nextInt(4) == 0) { +- this.generateLargeCaveNode(this.b.nextLong(), var4, var5, var6, var9, var11, var13); +- var15 += this.b.nextInt(4); ++ ++ if (this.rand.nextInt(4) == 0) { ++ this.generateLargeCaveNode(this.rand.nextLong(), par4, par5, par6ArrayOfByte, var9, var11, var13); ++ var15 += this.rand.nextInt(4); + } + +- for(int var16 = 0; var16 < var15; ++var16) { +- float var17 = this.b.nextFloat() * (float)Math.PI * 2.0F; +- float var18 = (this.b.nextFloat() - 0.5F) * 2.0F / 8.0F; +- float var19 = this.b.nextFloat() * 2.0F + this.b.nextFloat(); +- if(this.b.nextInt(10) == 0) { +- var19 *= this.b.nextFloat() * this.b.nextFloat() * 3.0F + 1.0F; ++ for (int var16 = 0; var16 < var15; ++var16) { ++ float var17 = this.rand.nextFloat() * (float)Math.PI * 2.0F; ++ float var18 = (this.rand.nextFloat() - 0.5F) * 2.0F / 8.0F; ++ float var19 = this.rand.nextFloat() * 2.0F + this.rand.nextFloat(); ++ ++ if (this.rand.nextInt(10) == 0) { ++ var19 *= this.rand.nextFloat() * this.rand.nextFloat() * 3.0F + 1.0F; + } + +- this.generateCaveNode(this.b.nextLong(), var4, var5, var6, var9, var11, var13, var19, var17, var18, 0, 0, 1.0D); ++ this.generateCaveNode(this.rand.nextLong(), par4, par5, par6ArrayOfByte, var9, var11, var13, var19, var17, var18, 0, 0, 1.0D); + } + } +- + } + } diff --git a/patches/net/minecraft/src/MapGenCavesHell.java.patch b/patches/net/minecraft/src/MapGenCavesHell.java.patch new file mode 100644 index 0000000..d0fdc68 --- /dev/null +++ b/patches/net/minecraft/src/MapGenCavesHell.java.patch @@ -0,0 +1,276 @@ +--- net/minecraft/src/MapGenCavesHell.java ++++ net/minecraft/src/MapGenCavesHell.java +@@ -3,109 +3,123 @@ + import java.util.Random; + + public class MapGenCavesHell extends MapGenBase { +- protected void generateLargeCaveNode(long var1, int var3, int var4, byte[] var5, double var6, double var8, double var10) { +- this.generateCaveNode(var1, var3, var4, var5, var6, var8, var10, 1.0F + this.b.nextFloat() * 6.0F, 0.0F, 0.0F, -1, -1, 0.5D); ++ ++ /** ++ * Generates a larger initial cave node than usual. Called 25% of the time. ++ */ ++ protected void generateLargeCaveNode(long par1, int par3, int par4, byte[] par5ArrayOfByte, double par6, double par8, double par10) { ++ this.generateCaveNode(par1, par3, par4, par5ArrayOfByte, par6, par8, par10, 1.0F + this.rand.nextFloat() * 6.0F, 0.0F, 0.0F, -1, -1, 0.5D); + } + +- protected void generateCaveNode(long var1, int var3, int var4, byte[] var5, double var6, double var8, double var10, float var12, float var13, float var14, int var15, int var16, double var17) { +- double var19 = (double)(var3 * 16 + 8); +- double var21 = (double)(var4 * 16 + 8); ++ /** ++ * Generates a node in the current cave system recursion tree. ++ */ ++ protected void generateCaveNode(long par1, int par3, int par4, byte[] par5ArrayOfByte, double par6, double par8, double par10, float par12, float par13, float par14, int par15, int par16, double par17) { ++ double var19 = (double)(par3 * 16 + 8); ++ double var21 = (double)(par4 * 16 + 8); + float var23 = 0.0F; + float var24 = 0.0F; +- Random var25 = new Random(var1); +- if(var16 <= 0) { ++ Random var25 = new Random(par1); ++ ++ if (par16 <= 0) { + int var26 = this.range * 16 - 16; +- var16 = var26 - var25.nextInt(var26 / 4); ++ par16 = var26 - var25.nextInt(var26 / 4); + } + + boolean var53 = false; +- if(var15 == -1) { +- var15 = var16 / 2; ++ ++ if (par15 == -1) { ++ par15 = par16 / 2; + var53 = true; + } + +- int var27 = var25.nextInt(var16 / 2) + var16 / 4; +- +- for(boolean var28 = var25.nextInt(6) == 0; var15 < var16; ++var15) { +- double var29 = 1.5D + (double)(MathHelper.sin((float)var15 * (float)Math.PI / (float)var16) * var12 * 1.0F); +- double var31 = var29 * var17; +- float var33 = MathHelper.cos(var14); +- float var34 = MathHelper.sin(var14); +- var6 += (double)(MathHelper.cos(var13) * var33); +- var8 += (double)var34; +- var10 += (double)(MathHelper.sin(var13) * var33); +- if(var28) { +- var14 *= 0.92F; ++ int var27 = var25.nextInt(par16 / 2) + par16 / 4; ++ ++ for (boolean var28 = var25.nextInt(6) == 0; par15 < par16; ++par15) { ++ double var29 = 1.5D + (double)(MathHelper.sin((float)par15 * (float)Math.PI / (float)par16) * par12 * 1.0F); ++ double var31 = var29 * par17; ++ float var33 = MathHelper.cos(par14); ++ float var34 = MathHelper.sin(par14); ++ par6 += (double)(MathHelper.cos(par13) * var33); ++ par8 += (double)var34; ++ par10 += (double)(MathHelper.sin(par13) * var33); ++ ++ if (var28) { ++ par14 *= 0.92F; + } else { +- var14 *= 0.7F; ++ par14 *= 0.7F; + } + +- var14 += var24 * 0.1F; +- var13 += var23 * 0.1F; ++ par14 += var24 * 0.1F; ++ par13 += var23 * 0.1F; + var24 *= 0.9F; +- var23 *= 12.0F / 16.0F; ++ var23 *= 0.75F; + var24 += (var25.nextFloat() - var25.nextFloat()) * var25.nextFloat() * 2.0F; + var23 += (var25.nextFloat() - var25.nextFloat()) * var25.nextFloat() * 4.0F; +- if(!var53 && var15 == var27 && var12 > 1.0F) { +- this.generateCaveNode(var25.nextLong(), var3, var4, var5, var6, var8, var10, var25.nextFloat() * 0.5F + 0.5F, var13 - (float)Math.PI * 0.5F, var14 / 3.0F, var15, var16, 1.0D); +- this.generateCaveNode(var25.nextLong(), var3, var4, var5, var6, var8, var10, var25.nextFloat() * 0.5F + 0.5F, var13 + (float)Math.PI * 0.5F, var14 / 3.0F, var15, var16, 1.0D); ++ ++ if (!var53 && par15 == var27 && par12 > 1.0F) { ++ this.generateCaveNode(var25.nextLong(), par3, par4, par5ArrayOfByte, par6, par8, par10, var25.nextFloat() * 0.5F + 0.5F, par13 - ((float)Math.PI / 2F), par14 / 3.0F, par15, par16, 1.0D); ++ this.generateCaveNode(var25.nextLong(), par3, par4, par5ArrayOfByte, par6, par8, par10, var25.nextFloat() * 0.5F + 0.5F, par13 + ((float)Math.PI / 2F), par14 / 3.0F, par15, par16, 1.0D); + return; + } + +- if(var53 || var25.nextInt(4) != 0) { +- double var35 = var6 - var19; +- double var37 = var10 - var21; +- double var39 = (double)(var16 - var15); +- double var41 = (double)(var12 + 2.0F + 16.0F); +- if(var35 * var35 + var37 * var37 - var39 * var39 > var41 * var41) { ++ if (var53 || var25.nextInt(4) != 0) { ++ double var35 = par6 - var19; ++ double var37 = par10 - var21; ++ double var39 = (double)(par16 - par15); ++ double var41 = (double)(par12 + 2.0F + 16.0F); ++ ++ if (var35 * var35 + var37 * var37 - var39 * var39 > var41 * var41) { + return; + } + +- if(var6 >= var19 - 16.0D - var29 * 2.0D && var10 >= var21 - 16.0D - var29 * 2.0D && var6 <= var19 + 16.0D + var29 * 2.0D && var10 <= var21 + 16.0D + var29 * 2.0D) { +- int var54 = MathHelper.floor_double(var6 - var29) - var3 * 16 - 1; +- int var36 = MathHelper.floor_double(var6 + var29) - var3 * 16 + 1; +- int var55 = MathHelper.floor_double(var8 - var31) - 1; +- int var38 = MathHelper.floor_double(var8 + var31) + 1; +- int var56 = MathHelper.floor_double(var10 - var29) - var4 * 16 - 1; +- int var40 = MathHelper.floor_double(var10 + var29) - var4 * 16 + 1; +- if(var54 < 0) { ++ if (par6 >= var19 - 16.0D - var29 * 2.0D && par10 >= var21 - 16.0D - var29 * 2.0D && par6 <= var19 + 16.0D + var29 * 2.0D && par10 <= var21 + 16.0D + var29 * 2.0D) { ++ int var54 = MathHelper.floor_double(par6 - var29) - par3 * 16 - 1; ++ int var36 = MathHelper.floor_double(par6 + var29) - par3 * 16 + 1; ++ int var55 = MathHelper.floor_double(par8 - var31) - 1; ++ int var38 = MathHelper.floor_double(par8 + var31) + 1; ++ int var56 = MathHelper.floor_double(par10 - var29) - par4 * 16 - 1; ++ int var40 = MathHelper.floor_double(par10 + var29) - par4 * 16 + 1; ++ ++ if (var54 < 0) { + var54 = 0; + } + +- if(var36 > 16) { ++ if (var36 > 16) { + var36 = 16; + } + +- if(var55 < 1) { ++ if (var55 < 1) { + var55 = 1; + } + +- if(var38 > 120) { ++ if (var38 > 120) { + var38 = 120; + } + +- if(var56 < 0) { ++ if (var56 < 0) { + var56 = 0; + } + +- if(var40 > 16) { ++ if (var40 > 16) { + var40 = 16; + } + + boolean var57 = false; +- + int var42; + int var45; +- for(var42 = var54; !var57 && var42 < var36; ++var42) { +- for(int var43 = var56; !var57 && var43 < var40; ++var43) { +- for(int var44 = var38 + 1; !var57 && var44 >= var55 - 1; --var44) { ++ ++ for (var42 = var54; !var57 && var42 < var36; ++var42) { ++ for (int var43 = var56; !var57 && var43 < var40; ++var43) { ++ for (int var44 = var38 + 1; !var57 && var44 >= var55 - 1; --var44) { + var45 = (var42 * 16 + var43) * 128 + var44; +- if(var44 >= 0 && var44 < 128) { +- if(var5[var45] == Block.lavaMoving.blockID || var5[var45] == Block.lavaStill.blockID) { ++ ++ if (var44 >= 0 && var44 < 128) { ++ if (par5ArrayOfByte[var45] == Block.lavaMoving.blockID || par5ArrayOfByte[var45] == Block.lavaStill.blockID) { + var57 = true; + } + +- if(var44 != var55 - 1 && var42 != var54 && var42 != var36 - 1 && var43 != var56 && var43 != var40 - 1) { ++ if (var44 != var55 - 1 && var42 != var54 && var42 != var36 - 1 && var43 != var56 && var43 != var40 - 1) { + var44 = var55; + } + } +@@ -113,20 +127,22 @@ + } + } + +- if(!var57) { +- for(var42 = var54; var42 < var36; ++var42) { +- double var58 = ((double)(var42 + var3 * 16) + 0.5D - var6) / var29; ++ if (!var57) { ++ for (var42 = var54; var42 < var36; ++var42) { ++ double var58 = ((double)(var42 + par3 * 16) + 0.5D - par6) / var29; + +- for(var45 = var56; var45 < var40; ++var45) { +- double var46 = ((double)(var45 + var4 * 16) + 0.5D - var10) / var29; ++ for (var45 = var56; var45 < var40; ++var45) { ++ double var46 = ((double)(var45 + par4 * 16) + 0.5D - par10) / var29; + int var48 = (var42 * 16 + var45) * 128 + var38; + +- for(int var49 = var38 - 1; var49 >= var55; --var49) { +- double var50 = ((double)var49 + 0.5D - var8) / var31; +- if(var50 > -0.7D && var58 * var58 + var50 * var50 + var46 * var46 < 1.0D) { +- byte var52 = var5[var48]; +- if(var52 == Block.netherrack.blockID || var52 == Block.dirt.blockID || var52 == Block.grass.blockID) { +- var5[var48] = 0; ++ for (int var49 = var38 - 1; var49 >= var55; --var49) { ++ double var50 = ((double)var49 + 0.5D - par8) / var31; ++ ++ if (var50 > -0.7D && var58 * var58 + var50 * var50 + var46 * var46 < 1.0D) { ++ byte var52 = par5ArrayOfByte[var48]; ++ ++ if (var52 == Block.netherrack.blockID || var52 == Block.dirt.blockID || var52 == Block.grass.blockID) { ++ par5ArrayOfByte[var48] = 0; + } + } + +@@ -135,39 +151,42 @@ + } + } + +- if(var53) { ++ if (var53) { + break; + } + } + } + } + } +- + } + +- protected void recursiveGenerate(World var1, int var2, int var3, int var4, int var5, byte[] var6) { +- int var7 = this.b.nextInt(this.b.nextInt(this.b.nextInt(10) + 1) + 1); +- if(this.b.nextInt(5) != 0) { ++ /** ++ * Recursively called by generate() (generate) and optionally by itself. ++ */ ++ protected void recursiveGenerate(World par1World, int par2, int par3, int par4, int par5, byte[] par6ArrayOfByte) { ++ int var7 = this.rand.nextInt(this.rand.nextInt(this.rand.nextInt(10) + 1) + 1); ++ ++ if (this.rand.nextInt(5) != 0) { + var7 = 0; + } + +- for(int var8 = 0; var8 < var7; ++var8) { +- double var9 = (double)(var2 * 16 + this.b.nextInt(16)); +- double var11 = (double)this.b.nextInt(128); +- double var13 = (double)(var3 * 16 + this.b.nextInt(16)); ++ for (int var8 = 0; var8 < var7; ++var8) { ++ double var9 = (double)(par2 * 16 + this.rand.nextInt(16)); ++ double var11 = (double)this.rand.nextInt(128); ++ double var13 = (double)(par3 * 16 + this.rand.nextInt(16)); + int var15 = 1; +- if(this.b.nextInt(4) == 0) { +- this.generateLargeCaveNode(this.b.nextLong(), var4, var5, var6, var9, var11, var13); +- var15 += this.b.nextInt(4); ++ ++ if (this.rand.nextInt(4) == 0) { ++ this.generateLargeCaveNode(this.rand.nextLong(), par4, par5, par6ArrayOfByte, var9, var11, var13); ++ var15 += this.rand.nextInt(4); + } + +- for(int var16 = 0; var16 < var15; ++var16) { +- float var17 = this.b.nextFloat() * (float)Math.PI * 2.0F; +- float var18 = (this.b.nextFloat() - 0.5F) * 2.0F / 8.0F; +- float var19 = this.b.nextFloat() * 2.0F + this.b.nextFloat(); +- this.generateCaveNode(this.b.nextLong(), var4, var5, var6, var9, var11, var13, var19 * 2.0F, var17, var18, 0, 0, 0.5D); ++ for (int var16 = 0; var16 < var15; ++var16) { ++ float var17 = this.rand.nextFloat() * (float)Math.PI * 2.0F; ++ float var18 = (this.rand.nextFloat() - 0.5F) * 2.0F / 8.0F; ++ float var19 = this.rand.nextFloat() * 2.0F + this.rand.nextFloat(); ++ this.generateCaveNode(this.rand.nextLong(), par4, par5, par6ArrayOfByte, var9, var11, var13, var19 * 2.0F, var17, var18, 0, 0, 0.5D); + } + } +- + } + } diff --git a/patches/net/minecraft/src/MapGenMineshaft.java.patch b/patches/net/minecraft/src/MapGenMineshaft.java.patch new file mode 100644 index 0000000..0b11b74 --- /dev/null +++ b/patches/net/minecraft/src/MapGenMineshaft.java.patch @@ -0,0 +1,47 @@ +--- net/minecraft/src/MapGenMineshaft.java ++++ net/minecraft/src/MapGenMineshaft.java +@@ -7,30 +7,29 @@ + public class MapGenMineshaft extends MapGenStructure { + private double field_82673_e = 0.01D; + +- public MapGenMineshaft() { +- } ++ public MapGenMineshaft() {} + + public String func_143025_a() { + return "Mineshaft"; + } + +- public MapGenMineshaft(Map var1) { +- Iterator var2 = var1.entrySet().iterator(); ++ public MapGenMineshaft(Map par1Map) { ++ Iterator var2 = par1Map.entrySet().iterator(); + +- while(var2.hasNext()) { ++ while (var2.hasNext()) { + Entry var3 = (Entry)var2.next(); +- if(((String)var3.getKey()).equals("chance")) { ++ ++ if (((String)var3.getKey()).equals("chance")) { + this.field_82673_e = MathHelper.parseDoubleWithDefault((String)var3.getValue(), this.field_82673_e); + } + } +- +- } +- +- protected boolean canSpawnStructureAtCoords(int var1, int var2) { +- return this.b.nextDouble() < this.field_82673_e && this.b.nextInt(80) < Math.max(Math.abs(var1), Math.abs(var2)); +- } +- +- protected StructureStart getStructureStart(int var1, int var2) { +- return new StructureMineshaftStart(this.worldObj, this.b, var1, var2); ++ } ++ ++ protected boolean canSpawnStructureAtCoords(int par1, int par2) { ++ return this.rand.nextDouble() < this.field_82673_e && this.rand.nextInt(80) < Math.max(Math.abs(par1), Math.abs(par2)); ++ } ++ ++ protected StructureStart getStructureStart(int par1, int par2) { ++ return new StructureMineshaftStart(this.worldObj, this.rand, par1, par2); + } + } diff --git a/patches/net/minecraft/src/MapGenNetherBridge.java.patch b/patches/net/minecraft/src/MapGenNetherBridge.java.patch new file mode 100644 index 0000000..98a9451 --- /dev/null +++ b/patches/net/minecraft/src/MapGenNetherBridge.java.patch @@ -0,0 +1,53 @@ +--- net/minecraft/src/MapGenNetherBridge.java ++++ net/minecraft/src/MapGenNetherBridge.java +@@ -4,13 +4,13 @@ + import java.util.List; + + public class MapGenNetherBridge extends MapGenStructure { +- private List e = new ArrayList(); ++ private List spawnList = new ArrayList(); + + public MapGenNetherBridge() { +- this.e.add(new SpawnListEntry(EntityBlaze.class, 10, 2, 3)); +- this.e.add(new SpawnListEntry(EntityPigZombie.class, 5, 4, 4)); +- this.e.add(new SpawnListEntry(EntitySkeleton.class, 10, 4, 4)); +- this.e.add(new SpawnListEntry(EntityMagmaCube.class, 3, 4, 4)); ++ this.spawnList.add(new SpawnListEntry(EntityBlaze.class, 10, 2, 3)); ++ this.spawnList.add(new SpawnListEntry(EntityPigZombie.class, 5, 4, 4)); ++ this.spawnList.add(new SpawnListEntry(EntitySkeleton.class, 10, 4, 4)); ++ this.spawnList.add(new SpawnListEntry(EntityMagmaCube.class, 3, 4, 4)); + } + + public String func_143025_a() { +@@ -18,18 +18,18 @@ + } + + public List getSpawnList() { +- return this.e; +- } +- +- protected boolean canSpawnStructureAtCoords(int var1, int var2) { +- int var3 = var1 >> 4; +- int var4 = var2 >> 4; +- this.b.setSeed((long)(var3 ^ var4 << 4) ^ this.worldObj.getSeed()); +- this.b.nextInt(); +- return this.b.nextInt(3) != 0 ? false : (var1 != (var3 << 4) + 4 + this.b.nextInt(8) ? false : var2 == (var4 << 4) + 4 + this.b.nextInt(8)); +- } +- +- protected StructureStart getStructureStart(int var1, int var2) { +- return new StructureNetherBridgeStart(this.worldObj, this.b, var1, var2); ++ return this.spawnList; ++ } ++ ++ protected boolean canSpawnStructureAtCoords(int par1, int par2) { ++ int var3 = par1 >> 4; ++ int var4 = par2 >> 4; ++ this.rand.setSeed((long)(var3 ^ var4 << 4) ^ this.worldObj.getSeed()); ++ this.rand.nextInt(); ++ return this.rand.nextInt(3) != 0 ? false : (par1 != (var3 << 4) + 4 + this.rand.nextInt(8) ? false : par2 == (var4 << 4) + 4 + this.rand.nextInt(8)); ++ } ++ ++ protected StructureStart getStructureStart(int par1, int par2) { ++ return new StructureNetherBridgeStart(this.worldObj, this.rand, par1, par2); + } + } diff --git a/patches/net/minecraft/src/MapGenRavine.java.patch b/patches/net/minecraft/src/MapGenRavine.java.patch new file mode 100644 index 0000000..9096323 --- /dev/null +++ b/patches/net/minecraft/src/MapGenRavine.java.patch @@ -0,0 +1,257 @@ +--- net/minecraft/src/MapGenRavine.java ++++ net/minecraft/src/MapGenRavine.java +@@ -5,104 +5,110 @@ + public class MapGenRavine extends MapGenBase { + private float[] field_75046_d = new float[1024]; + +- protected void generateRavine(long var1, int var3, int var4, byte[] var5, double var6, double var8, double var10, float var12, float var13, float var14, int var15, int var16, double var17) { +- Random var19 = new Random(var1); +- double var20 = (double)(var3 * 16 + 8); +- double var22 = (double)(var4 * 16 + 8); ++ protected void generateRavine(long par1, int par3, int par4, byte[] par5ArrayOfByte, double par6, double par8, double par10, float par12, float par13, float par14, int par15, int par16, double par17) { ++ Random var19 = new Random(par1); ++ double var20 = (double)(par3 * 16 + 8); ++ double var22 = (double)(par4 * 16 + 8); + float var24 = 0.0F; + float var25 = 0.0F; +- if(var16 <= 0) { ++ ++ if (par16 <= 0) { + int var26 = this.range * 16 - 16; +- var16 = var26 - var19.nextInt(var26 / 4); ++ par16 = var26 - var19.nextInt(var26 / 4); + } + + boolean var53 = false; +- if(var15 == -1) { +- var15 = var16 / 2; ++ ++ if (par15 == -1) { ++ par15 = par16 / 2; + var53 = true; + } + + float var27 = 1.0F; + +- for(int var28 = 0; var28 < 128; ++var28) { +- if(var28 == 0 || var19.nextInt(3) == 0) { ++ for (int var28 = 0; var28 < 128; ++var28) { ++ if (var28 == 0 || var19.nextInt(3) == 0) { + var27 = 1.0F + var19.nextFloat() * var19.nextFloat() * 1.0F; + } + + this.field_75046_d[var28] = var27 * var27; + } + +- for(; var15 < var16; ++var15) { +- double var54 = 1.5D + (double)(MathHelper.sin((float)var15 * (float)Math.PI / (float)var16) * var12 * 1.0F); +- double var30 = var54 * var17; ++ for (; par15 < par16; ++par15) { ++ double var54 = 1.5D + (double)(MathHelper.sin((float)par15 * (float)Math.PI / (float)par16) * par12 * 1.0F); ++ double var30 = var54 * par17; + var54 *= (double)var19.nextFloat() * 0.25D + 0.75D; + var30 *= (double)var19.nextFloat() * 0.25D + 0.75D; +- float var32 = MathHelper.cos(var14); +- float var33 = MathHelper.sin(var14); +- var6 += (double)(MathHelper.cos(var13) * var32); +- var8 += (double)var33; +- var10 += (double)(MathHelper.sin(var13) * var32); +- var14 *= 0.7F; +- var14 += var25 * 0.05F; +- var13 += var24 * 0.05F; ++ float var32 = MathHelper.cos(par14); ++ float var33 = MathHelper.sin(par14); ++ par6 += (double)(MathHelper.cos(par13) * var32); ++ par8 += (double)var33; ++ par10 += (double)(MathHelper.sin(par13) * var32); ++ par14 *= 0.7F; ++ par14 += var25 * 0.05F; ++ par13 += var24 * 0.05F; + var25 *= 0.8F; + var24 *= 0.5F; + var25 += (var19.nextFloat() - var19.nextFloat()) * var19.nextFloat() * 2.0F; + var24 += (var19.nextFloat() - var19.nextFloat()) * var19.nextFloat() * 4.0F; +- if(var53 || var19.nextInt(4) != 0) { +- double var34 = var6 - var20; +- double var36 = var10 - var22; +- double var38 = (double)(var16 - var15); +- double var40 = (double)(var12 + 2.0F + 16.0F); +- if(var34 * var34 + var36 * var36 - var38 * var38 > var40 * var40) { ++ ++ if (var53 || var19.nextInt(4) != 0) { ++ double var34 = par6 - var20; ++ double var36 = par10 - var22; ++ double var38 = (double)(par16 - par15); ++ double var40 = (double)(par12 + 2.0F + 16.0F); ++ ++ if (var34 * var34 + var36 * var36 - var38 * var38 > var40 * var40) { + return; + } + +- if(var6 >= var20 - 16.0D - var54 * 2.0D && var10 >= var22 - 16.0D - var54 * 2.0D && var6 <= var20 + 16.0D + var54 * 2.0D && var10 <= var22 + 16.0D + var54 * 2.0D) { +- int var55 = MathHelper.floor_double(var6 - var54) - var3 * 16 - 1; +- int var35 = MathHelper.floor_double(var6 + var54) - var3 * 16 + 1; +- int var56 = MathHelper.floor_double(var8 - var30) - 1; +- int var37 = MathHelper.floor_double(var8 + var30) + 1; +- int var57 = MathHelper.floor_double(var10 - var54) - var4 * 16 - 1; +- int var39 = MathHelper.floor_double(var10 + var54) - var4 * 16 + 1; +- if(var55 < 0) { ++ if (par6 >= var20 - 16.0D - var54 * 2.0D && par10 >= var22 - 16.0D - var54 * 2.0D && par6 <= var20 + 16.0D + var54 * 2.0D && par10 <= var22 + 16.0D + var54 * 2.0D) { ++ int var55 = MathHelper.floor_double(par6 - var54) - par3 * 16 - 1; ++ int var35 = MathHelper.floor_double(par6 + var54) - par3 * 16 + 1; ++ int var56 = MathHelper.floor_double(par8 - var30) - 1; ++ int var37 = MathHelper.floor_double(par8 + var30) + 1; ++ int var57 = MathHelper.floor_double(par10 - var54) - par4 * 16 - 1; ++ int var39 = MathHelper.floor_double(par10 + var54) - par4 * 16 + 1; ++ ++ if (var55 < 0) { + var55 = 0; + } + +- if(var35 > 16) { ++ if (var35 > 16) { + var35 = 16; + } + +- if(var56 < 1) { ++ if (var56 < 1) { + var56 = 1; + } + +- if(var37 > 120) { ++ if (var37 > 120) { + var37 = 120; + } + +- if(var57 < 0) { ++ if (var57 < 0) { + var57 = 0; + } + +- if(var39 > 16) { ++ if (var39 > 16) { + var39 = 16; + } + + boolean var58 = false; +- + int var41; + int var44; +- for(var41 = var55; !var58 && var41 < var35; ++var41) { +- for(int var42 = var57; !var58 && var42 < var39; ++var42) { +- for(int var43 = var37 + 1; !var58 && var43 >= var56 - 1; --var43) { ++ ++ for (var41 = var55; !var58 && var41 < var35; ++var41) { ++ for (int var42 = var57; !var58 && var42 < var39; ++var42) { ++ for (int var43 = var37 + 1; !var58 && var43 >= var56 - 1; --var43) { + var44 = (var41 * 16 + var42) * 128 + var43; +- if(var43 >= 0 && var43 < 128) { +- if(var5[var44] == Block.waterMoving.blockID || var5[var44] == Block.waterStill.blockID) { ++ ++ if (var43 >= 0 && var43 < 128) { ++ if (par5ArrayOfByte[var44] == Block.waterMoving.blockID || par5ArrayOfByte[var44] == Block.waterStill.blockID) { + var58 = true; + } + +- if(var43 != var56 - 1 && var41 != var55 && var41 != var35 - 1 && var42 != var57 && var42 != var39 - 1) { ++ if (var43 != var56 - 1 && var41 != var55 && var41 != var35 - 1 && var42 != var57 && var42 != var39 - 1) { + var43 = var56; + } + } +@@ -110,30 +116,34 @@ + } + } + +- if(!var58) { +- for(var41 = var55; var41 < var35; ++var41) { +- double var59 = ((double)(var41 + var3 * 16) + 0.5D - var6) / var54; ++ if (!var58) { ++ for (var41 = var55; var41 < var35; ++var41) { ++ double var59 = ((double)(var41 + par3 * 16) + 0.5D - par6) / var54; + +- for(var44 = var57; var44 < var39; ++var44) { +- double var45 = ((double)(var44 + var4 * 16) + 0.5D - var10) / var54; ++ for (var44 = var57; var44 < var39; ++var44) { ++ double var45 = ((double)(var44 + par4 * 16) + 0.5D - par10) / var54; + int var47 = (var41 * 16 + var44) * 128 + var37; + boolean var48 = false; +- if(var59 * var59 + var45 * var45 < 1.0D) { +- for(int var49 = var37 - 1; var49 >= var56; --var49) { +- double var50 = ((double)var49 + 0.5D - var8) / var30; +- if((var59 * var59 + var45 * var45) * (double)this.field_75046_d[var49] + var50 * var50 / 6.0D < 1.0D) { +- byte var52 = var5[var47]; +- if(var52 == Block.grass.blockID) { ++ ++ if (var59 * var59 + var45 * var45 < 1.0D) { ++ for (int var49 = var37 - 1; var49 >= var56; --var49) { ++ double var50 = ((double)var49 + 0.5D - par8) / var30; ++ ++ if ((var59 * var59 + var45 * var45) * (double)this.field_75046_d[var49] + var50 * var50 / 6.0D < 1.0D) { ++ byte var52 = par5ArrayOfByte[var47]; ++ ++ if (var52 == Block.grass.blockID) { + var48 = true; + } + +- if(var52 == Block.stone.blockID || var52 == Block.dirt.blockID || var52 == Block.grass.blockID) { +- if(var49 < 10) { +- var5[var47] = (byte)Block.lavaMoving.blockID; ++ if (var52 == Block.stone.blockID || var52 == Block.dirt.blockID || var52 == Block.grass.blockID) { ++ if (var49 < 10) { ++ par5ArrayOfByte[var47] = (byte)Block.lavaMoving.blockID; + } else { +- var5[var47] = 0; +- if(var48 && var5[var47 - 1] == Block.dirt.blockID) { +- var5[var47 - 1] = this.worldObj.getBiomeGenForCoords(var41 + var3 * 16, var44 + var4 * 16).topBlock; ++ par5ArrayOfByte[var47] = 0; ++ ++ if (var48 && par5ArrayOfByte[var47 - 1] == Block.dirt.blockID) { ++ par5ArrayOfByte[var47 - 1] = this.worldObj.getBiomeGenForCoords(var41 + par3 * 16, var44 + par4 * 16).topBlock; + } + } + } +@@ -145,30 +155,31 @@ + } + } + +- if(var53) { ++ if (var53) { + break; + } + } + } + } + } +- + } + +- protected void recursiveGenerate(World var1, int var2, int var3, int var4, int var5, byte[] var6) { +- if(this.b.nextInt(50) == 0) { +- double var7 = (double)(var2 * 16 + this.b.nextInt(16)); +- double var9 = (double)(this.b.nextInt(this.b.nextInt(40) + 8) + 20); +- double var11 = (double)(var3 * 16 + this.b.nextInt(16)); ++ /** ++ * Recursively called by generate() (generate) and optionally by itself. ++ */ ++ protected void recursiveGenerate(World par1World, int par2, int par3, int par4, int par5, byte[] par6ArrayOfByte) { ++ if (this.rand.nextInt(50) == 0) { ++ double var7 = (double)(par2 * 16 + this.rand.nextInt(16)); ++ double var9 = (double)(this.rand.nextInt(this.rand.nextInt(40) + 8) + 20); ++ double var11 = (double)(par3 * 16 + this.rand.nextInt(16)); + byte var13 = 1; + +- for(int var14 = 0; var14 < var13; ++var14) { +- float var15 = this.b.nextFloat() * (float)Math.PI * 2.0F; +- float var16 = (this.b.nextFloat() - 0.5F) * 2.0F / 8.0F; +- float var17 = (this.b.nextFloat() * 2.0F + this.b.nextFloat()) * 2.0F; +- this.generateRavine(this.b.nextLong(), var4, var5, var6, var7, var9, var11, var17, var15, var16, 0, 0, 3.0D); ++ for (int var14 = 0; var14 < var13; ++var14) { ++ float var15 = this.rand.nextFloat() * (float)Math.PI * 2.0F; ++ float var16 = (this.rand.nextFloat() - 0.5F) * 2.0F / 8.0F; ++ float var17 = (this.rand.nextFloat() * 2.0F + this.rand.nextFloat()) * 2.0F; ++ this.generateRavine(this.rand.nextLong(), par4, par5, par6ArrayOfByte, var7, var9, var11, var17, var15, var16, 0, 0, 3.0D); + } +- + } + } + } diff --git a/patches/net/minecraft/src/MapGenScatteredFeature.java.patch b/patches/net/minecraft/src/MapGenScatteredFeature.java.patch new file mode 100644 index 0000000..d4d6e31 --- /dev/null +++ b/patches/net/minecraft/src/MapGenScatteredFeature.java.patch @@ -0,0 +1,131 @@ +--- net/minecraft/src/MapGenScatteredFeature.java ++++ net/minecraft/src/MapGenScatteredFeature.java +@@ -9,60 +9,69 @@ + import java.util.Map.Entry; + + public class MapGenScatteredFeature extends MapGenStructure { +- private static List e = Arrays.asList(new BiomeGenBase[]{BiomeGenBase.desert, BiomeGenBase.desertHills, BiomeGenBase.jungle, BiomeGenBase.jungleHills, BiomeGenBase.swampland}); +- private List f; ++ private static List biomelist = Arrays.asList(new BiomeGenBase[] {BiomeGenBase.desert, BiomeGenBase.desertHills, BiomeGenBase.jungle, BiomeGenBase.jungleHills, BiomeGenBase.swampland}); ++ ++ /** contains possible spawns for scattered features */ ++ private List scatteredFeatureSpawnList; ++ ++ /** the maximum distance between scattered features */ + private int maxDistanceBetweenScatteredFeatures; ++ ++ /** the minimum distance between scattered features */ + private int minDistanceBetweenScatteredFeatures; + + public MapGenScatteredFeature() { +- this.f = new ArrayList(); ++ this.scatteredFeatureSpawnList = new ArrayList(); + this.maxDistanceBetweenScatteredFeatures = 32; + this.minDistanceBetweenScatteredFeatures = 8; +- this.f.add(new SpawnListEntry(EntityWitch.class, 1, 1, 1)); ++ this.scatteredFeatureSpawnList.add(new SpawnListEntry(EntityWitch.class, 1, 1, 1)); + } + +- public MapGenScatteredFeature(Map var1) { ++ public MapGenScatteredFeature(Map par1Map) { + this(); +- Iterator var2 = var1.entrySet().iterator(); ++ Iterator var2 = par1Map.entrySet().iterator(); + +- while(var2.hasNext()) { ++ while (var2.hasNext()) { + Entry var3 = (Entry)var2.next(); +- if(((String)var3.getKey()).equals("distance")) { ++ ++ if (((String)var3.getKey()).equals("distance")) { + this.maxDistanceBetweenScatteredFeatures = MathHelper.parseIntWithDefaultAndMax((String)var3.getValue(), this.maxDistanceBetweenScatteredFeatures, this.minDistanceBetweenScatteredFeatures + 1); + } + } +- + } + + public String func_143025_a() { + return "Temple"; + } + +- protected boolean canSpawnStructureAtCoords(int var1, int var2) { +- int var3 = var1; +- int var4 = var2; +- if(var1 < 0) { +- var1 -= this.maxDistanceBetweenScatteredFeatures - 1; +- } +- +- if(var2 < 0) { +- var2 -= this.maxDistanceBetweenScatteredFeatures - 1; +- } +- +- int var5 = var1 / this.maxDistanceBetweenScatteredFeatures; +- int var6 = var2 / this.maxDistanceBetweenScatteredFeatures; ++ protected boolean canSpawnStructureAtCoords(int par1, int par2) { ++ int var3 = par1; ++ int var4 = par2; ++ ++ if (par1 < 0) { ++ par1 -= this.maxDistanceBetweenScatteredFeatures - 1; ++ } ++ ++ if (par2 < 0) { ++ par2 -= this.maxDistanceBetweenScatteredFeatures - 1; ++ } ++ ++ int var5 = par1 / this.maxDistanceBetweenScatteredFeatures; ++ int var6 = par2 / this.maxDistanceBetweenScatteredFeatures; + Random var7 = this.worldObj.setRandomSeed(var5, var6, 14357617); + var5 *= this.maxDistanceBetweenScatteredFeatures; + var6 *= this.maxDistanceBetweenScatteredFeatures; + var5 += var7.nextInt(this.maxDistanceBetweenScatteredFeatures - this.minDistanceBetweenScatteredFeatures); + var6 += var7.nextInt(this.maxDistanceBetweenScatteredFeatures - this.minDistanceBetweenScatteredFeatures); +- if(var3 == var5 && var4 == var6) { ++ ++ if (var3 == var5 && var4 == var6) { + BiomeGenBase var8 = this.worldObj.getWorldChunkManager().getBiomeGenAt(var3 * 16 + 8, var4 * 16 + 8); +- Iterator var9 = e.iterator(); ++ Iterator var9 = biomelist.iterator(); + +- while(var9.hasNext()) { ++ while (var9.hasNext()) { + BiomeGenBase var10 = (BiomeGenBase)var9.next(); +- if(var8 == var10) { ++ ++ if (var8 == var10) { + return true; + } + } +@@ -71,21 +80,25 @@ + return false; + } + +- protected StructureStart getStructureStart(int var1, int var2) { +- return new StructureScatteredFeatureStart(this.worldObj, this.b, var1, var2); ++ protected StructureStart getStructureStart(int par1, int par2) { ++ return new StructureScatteredFeatureStart(this.worldObj, this.rand, par1, par2); + } + +- public boolean func_143030_a(int var1, int var2, int var3) { +- StructureStart var4 = this.func_143028_c(var1, var2, var3); +- if(var4 != null && var4 instanceof StructureScatteredFeatureStart && !var4.a.isEmpty()) { +- StructureComponent var5 = (StructureComponent)var4.a.getFirst(); ++ public boolean func_143030_a(int par1, int par2, int par3) { ++ StructureStart var4 = this.func_143028_c(par1, par2, par3); ++ ++ if (var4 != null && var4 instanceof StructureScatteredFeatureStart && !var4.components.isEmpty()) { ++ StructureComponent var5 = (StructureComponent)var4.components.getFirst(); + return var5 instanceof ComponentScatteredFeatureSwampHut; + } else { + return false; + } + } + ++ /** ++ * returns possible spawns for scattered features ++ */ + public List getScatteredFeatureSpawnList() { +- return this.f; ++ return this.scatteredFeatureSpawnList; + } + } diff --git a/patches/net/minecraft/src/MapGenStronghold.java.patch b/patches/net/minecraft/src/MapGenStronghold.java.patch new file mode 100644 index 0000000..6e5860e --- /dev/null +++ b/patches/net/minecraft/src/MapGenStronghold.java.patch @@ -0,0 +1,140 @@ +--- net/minecraft/src/MapGenStronghold.java ++++ net/minecraft/src/MapGenStronghold.java +@@ -9,57 +9,71 @@ + import java.util.Map.Entry; + + public class MapGenStronghold extends MapGenStructure { +- private BiomeGenBase[] allowedBiomeGenBases = new BiomeGenBase[]{BiomeGenBase.desert, BiomeGenBase.forest, BiomeGenBase.extremeHills, BiomeGenBase.swampland, BiomeGenBase.taiga, BiomeGenBase.icePlains, BiomeGenBase.iceMountains, BiomeGenBase.desertHills, BiomeGenBase.forestHills, BiomeGenBase.extremeHillsEdge, BiomeGenBase.jungle, BiomeGenBase.jungleHills}; ++ private BiomeGenBase[] allowedBiomeGenBases; ++ ++ /** ++ * is spawned false and set true once the defined BiomeGenBases were compared with the present ones ++ */ + private boolean ranBiomeCheck; +- private ChunkCoordIntPair[] structureCoords = new ChunkCoordIntPair[3]; +- private double field_82671_h = 32.0D; +- private int field_82672_i = 3; ++ private ChunkCoordIntPair[] structureCoords; ++ private double field_82671_h; ++ private int field_82672_i; + + public MapGenStronghold() { ++ this.allowedBiomeGenBases = new BiomeGenBase[] {BiomeGenBase.desert, BiomeGenBase.forest, BiomeGenBase.extremeHills, BiomeGenBase.swampland, BiomeGenBase.taiga, BiomeGenBase.icePlains, BiomeGenBase.iceMountains, BiomeGenBase.desertHills, BiomeGenBase.forestHills, BiomeGenBase.extremeHillsEdge, BiomeGenBase.jungle, BiomeGenBase.jungleHills}; ++ this.structureCoords = new ChunkCoordIntPair[3]; ++ this.field_82671_h = 32.0D; ++ this.field_82672_i = 3; + } + +- public MapGenStronghold(Map var1) { +- Iterator var2 = var1.entrySet().iterator(); ++ public MapGenStronghold(Map par1Map) { ++ this.allowedBiomeGenBases = new BiomeGenBase[] {BiomeGenBase.desert, BiomeGenBase.forest, BiomeGenBase.extremeHills, BiomeGenBase.swampland, BiomeGenBase.taiga, BiomeGenBase.icePlains, BiomeGenBase.iceMountains, BiomeGenBase.desertHills, BiomeGenBase.forestHills, BiomeGenBase.extremeHillsEdge, BiomeGenBase.jungle, BiomeGenBase.jungleHills}; ++ this.structureCoords = new ChunkCoordIntPair[3]; ++ this.field_82671_h = 32.0D; ++ this.field_82672_i = 3; ++ Iterator var2 = par1Map.entrySet().iterator(); + +- while(var2.hasNext()) { ++ while (var2.hasNext()) { + Entry var3 = (Entry)var2.next(); +- if(((String)var3.getKey()).equals("distance")) { ++ ++ if (((String)var3.getKey()).equals("distance")) { + this.field_82671_h = MathHelper.func_82713_a((String)var3.getValue(), this.field_82671_h, 1.0D); +- } else if(((String)var3.getKey()).equals("count")) { ++ } else if (((String)var3.getKey()).equals("count")) { + this.structureCoords = new ChunkCoordIntPair[MathHelper.parseIntWithDefaultAndMax((String)var3.getValue(), this.structureCoords.length, 1)]; +- } else if(((String)var3.getKey()).equals("spread")) { ++ } else if (((String)var3.getKey()).equals("spread")) { + this.field_82672_i = MathHelper.parseIntWithDefaultAndMax((String)var3.getValue(), this.field_82672_i, 1); + } + } +- + } + + public String func_143025_a() { + return "Stronghold"; + } + +- protected boolean canSpawnStructureAtCoords(int var1, int var2) { +- if(!this.ranBiomeCheck) { ++ protected boolean canSpawnStructureAtCoords(int par1, int par2) { ++ if (!this.ranBiomeCheck) { + Random var3 = new Random(); + var3.setSeed(this.worldObj.getSeed()); + double var4 = var3.nextDouble() * Math.PI * 2.0D; + int var6 = 1; + +- for(int var7 = 0; var7 < this.structureCoords.length; ++var7) { ++ for (int var7 = 0; var7 < this.structureCoords.length; ++var7) { + double var8 = (1.25D * (double)var6 + var3.nextDouble()) * this.field_82671_h * (double)var6; + int var10 = (int)Math.round(Math.cos(var4) * var8); + int var11 = (int)Math.round(Math.sin(var4) * var8); + ArrayList var12 = new ArrayList(); + Collections.addAll(var12, this.allowedBiomeGenBases); + ChunkPosition var13 = this.worldObj.getWorldChunkManager().findBiomePosition((var10 << 4) + 8, (var11 << 4) + 8, 112, var12, var3); +- if(var13 != null) { ++ ++ if (var13 != null) { + var10 = var13.x >> 4; + var11 = var13.z >> 4; + } + + this.structureCoords[var7] = new ChunkCoordIntPair(var10, var11); +- var4 += Math.PI * 2.0D * (double)var6 / (double)this.field_82672_i; +- if(var7 == this.field_82672_i) { ++ var4 += (Math.PI * 2D) * (double)var6 / (double)this.field_82672_i; ++ ++ if (var7 == this.field_82672_i) { + var6 += 2 + var3.nextInt(5); + this.field_82672_i += 1 + var3.nextInt(2); + } +@@ -71,9 +85,10 @@ + ChunkCoordIntPair[] var14 = this.structureCoords; + int var15 = var14.length; + +- for(int var5 = 0; var5 < var15; ++var5) { ++ for (int var5 = 0; var5 < var15; ++var5) { + ChunkCoordIntPair var16 = var14[var5]; +- if(var1 == var16.chunkXPos && var2 == var16.chunkZPos) { ++ ++ if (par1 == var16.chunkXPos && par2 == var16.chunkZPos) { + return true; + } + } +@@ -81,14 +96,19 @@ + return false; + } + ++ /** ++ * Returns a list of other locations at which the structure generation has been run, or null if not relevant to this ++ * structure generator. ++ */ + protected List getCoordList() { + ArrayList var1 = new ArrayList(); + ChunkCoordIntPair[] var2 = this.structureCoords; + int var3 = var2.length; + +- for(int var4 = 0; var4 < var3; ++var4) { ++ for (int var4 = 0; var4 < var3; ++var4) { + ChunkCoordIntPair var5 = var2[var4]; +- if(var5 != null) { ++ ++ if (var5 != null) { + var1.add(var5.getChunkPosition(64)); + } + } +@@ -96,9 +116,11 @@ + return var1; + } + +- protected StructureStart getStructureStart(int var1, int var2) { ++ protected StructureStart getStructureStart(int par1, int par2) { + StructureStrongholdStart var3; +- for(var3 = new StructureStrongholdStart(this.worldObj, this.b, var1, var2); var3.getComponents().isEmpty() || ((ComponentStrongholdStairs2)var3.getComponents().get(0)).strongholdPortalRoom == null; var3 = new StructureStrongholdStart(this.worldObj, this.b, var1, var2)) { ++ ++ for (var3 = new StructureStrongholdStart(this.worldObj, this.rand, par1, par2); var3.getComponents().isEmpty() || ((ComponentStrongholdStairs2)var3.getComponents().get(0)).strongholdPortalRoom == null; var3 = new StructureStrongholdStart(this.worldObj, this.rand, par1, par2)) { ++ ; + } + + return var3; diff --git a/patches/net/minecraft/src/MapGenStructure.java.patch b/patches/net/minecraft/src/MapGenStructure.java.patch new file mode 100644 index 0000000..127f1a2 --- /dev/null +++ b/patches/net/minecraft/src/MapGenStructure.java.patch @@ -0,0 +1,301 @@ +--- net/minecraft/src/MapGenStructure.java ++++ net/minecraft/src/MapGenStructure.java +@@ -8,45 +8,58 @@ + + public abstract class MapGenStructure extends MapGenBase { + private MapGenStructureData field_143029_e; +- protected Map d = new HashMap(); ++ ++ /** ++ * Used to store a list of all structures that have been recursively generated. Used so that during recursive ++ * generation, the structure generator can avoid generating structures that intersect ones that have already been ++ * placed. ++ */ ++ protected Map structureMap = new HashMap(); + + public abstract String func_143025_a(); + +- protected final void recursiveGenerate(World var1, int var2, int var3, int var4, int var5, byte[] var6) { +- this.func_143027_a(var1); +- if(!this.d.containsKey(Long.valueOf(ChunkCoordIntPair.chunkXZ2Int(var2, var3)))) { +- this.b.nextInt(); ++ /** ++ * Recursively called by generate() (generate) and optionally by itself. ++ */ ++ protected final void recursiveGenerate(World par1World, int par2, int par3, int par4, int par5, byte[] par6ArrayOfByte) { ++ this.func_143027_a(par1World); ++ ++ if (!this.structureMap.containsKey(Long.valueOf(ChunkCoordIntPair.chunkXZ2Int(par2, par3)))) { ++ this.rand.nextInt(); + + try { +- if(this.canSpawnStructureAtCoords(var2, var3)) { +- StructureStart var7 = this.getStructureStart(var2, var3); +- this.d.put(Long.valueOf(ChunkCoordIntPair.chunkXZ2Int(var2, var3)), var7); +- this.func_143026_a(var2, var3, var7); ++ if (this.canSpawnStructureAtCoords(par2, par3)) { ++ StructureStart var7 = this.getStructureStart(par2, par3); ++ this.structureMap.put(Long.valueOf(ChunkCoordIntPair.chunkXZ2Int(par2, par3)), var7); ++ this.func_143026_a(par2, par3, var7); + } +- + } catch (Throwable var10) { + CrashReport var8 = CrashReport.makeCrashReport(var10, "Exception preparing structure feature"); + CrashReportCategory var9 = var8.makeCategory("Feature being prepared"); +- var9.addCrashSectionCallable("Is feature chunk", new CallableIsFeatureChunk(this, var2, var3)); +- var9.addCrashSection("Chunk location", String.format("%d,%d", new Object[]{Integer.valueOf(var2), Integer.valueOf(var3)})); +- var9.addCrashSectionCallable("Chunk pos hash", new CallableChunkPosHash(this, var2, var3)); ++ var9.addCrashSectionCallable("Is feature chunk", new CallableIsFeatureChunk(this, par2, par3)); ++ var9.addCrashSection("Chunk location", String.format("%d,%d", new Object[] {Integer.valueOf(par2), Integer.valueOf(par3)})); ++ var9.addCrashSectionCallable("Chunk pos hash", new CallableChunkPosHash(this, par2, par3)); + var9.addCrashSectionCallable("Structure type", new CallableStructureType(this)); + throw new ReportedException(var8); + } + } + } + +- public boolean generateStructuresInChunk(World var1, Random var2, int var3, int var4) { +- this.func_143027_a(var1); +- int var5 = (var3 << 4) + 8; +- int var6 = (var4 << 4) + 8; ++ /** ++ * Generates structures in specified chunk next to existing structures. Does *not* generate StructureStarts. ++ */ ++ public boolean generateStructuresInChunk(World par1World, Random par2Random, int par3, int par4) { ++ this.func_143027_a(par1World); ++ int var5 = (par3 << 4) + 8; ++ int var6 = (par4 << 4) + 8; + boolean var7 = false; +- Iterator var8 = this.d.values().iterator(); ++ Iterator var8 = this.structureMap.values().iterator(); + +- while(var8.hasNext()) { ++ while (var8.hasNext()) { + StructureStart var9 = (StructureStart)var8.next(); +- if(var9.isSizeableStructure() && var9.getBoundingBox().intersectsWith(var5, var6, var5 + 15, var6 + 15)) { +- var9.generateStructure(var1, var2, new StructureBoundingBox(var5, var6, var5 + 15, var6 + 15)); ++ ++ if (var9.isSizeableStructure() && var9.getBoundingBox().intersectsWith(var5, var6, var5 + 15, var6 + 15)) { ++ var9.generateStructure(par1World, par2Random, new StructureBoundingBox(var5, var6, var5 + 15, var6 + 15)); + var7 = true; + this.func_143026_a(var9.func_143019_e(), var9.func_143018_f(), var9); + } +@@ -55,103 +68,106 @@ + return var7; + } + +- public boolean hasStructureAt(int var1, int var2, int var3) { ++ /** ++ * Returns true if the structure generator has generated a structure located at the given position tuple. ++ */ ++ public boolean hasStructureAt(int par1, int par2, int par3) { + this.func_143027_a(this.worldObj); +- return this.func_143028_c(var1, var2, var3) != null; ++ return this.func_143028_c(par1, par2, par3) != null; + } + +- protected StructureStart func_143028_c(int var1, int var2, int var3) { +- Iterator var4 = this.d.values().iterator(); +- +- while(true) { +- StructureStart var5; +- do { +- do { +- if(!var4.hasNext()) { +- return null; ++ protected StructureStart func_143028_c(int par1, int par2, int par3) { ++ Iterator var4 = this.structureMap.values().iterator(); ++ ++ while (var4.hasNext()) { ++ StructureStart var5 = (StructureStart)var4.next(); ++ ++ if (var5.isSizeableStructure() && var5.getBoundingBox().intersectsWith(par1, par3, par1, par3)) { ++ Iterator var6 = var5.getComponents().iterator(); ++ ++ while (var6.hasNext()) { ++ StructureComponent var7 = (StructureComponent)var6.next(); ++ ++ if (var7.getBoundingBox().isVecInside(par1, par2, par3)) { ++ return var5; + } +- +- var5 = (StructureStart)var4.next(); +- } while(!var5.isSizeableStructure()); +- } while(!var5.getBoundingBox().intersectsWith(var1, var3, var1, var3)); +- +- Iterator var6 = var5.getComponents().iterator(); +- +- while(var6.hasNext()) { +- StructureComponent var7 = (StructureComponent)var6.next(); +- if(var7.getBoundingBox().isVecInside(var1, var2, var3)) { +- return var5; + } + } + } ++ ++ return null; + } + +- public boolean func_142038_b(int var1, int var2, int var3) { ++ public boolean func_142038_b(int par1, int par2, int par3) { + this.func_143027_a(this.worldObj); +- Iterator var4 = this.d.values().iterator(); +- ++ Iterator var4 = this.structureMap.values().iterator(); + StructureStart var5; ++ + do { +- if(!var4.hasNext()) { ++ if (!var4.hasNext()) { + return false; + } + + var5 = (StructureStart)var4.next(); +- } while(!var5.isSizeableStructure()); ++ } while (!var5.isSizeableStructure()); + +- return var5.getBoundingBox().intersectsWith(var1, var3, var1, var3); ++ return var5.getBoundingBox().intersectsWith(par1, par3, par1, par3); + } + +- public ChunkPosition getNearestInstance(World var1, int var2, int var3, int var4) { +- this.worldObj = var1; +- this.func_143027_a(var1); +- this.b.setSeed(var1.getSeed()); +- long var5 = this.b.nextLong(); +- long var7 = this.b.nextLong(); +- long var9 = (long)(var2 >> 4) * var5; +- long var11 = (long)(var4 >> 4) * var7; +- this.b.setSeed(var9 ^ var11 ^ var1.getSeed()); +- this.recursiveGenerate(var1, var2 >> 4, var4 >> 4, 0, 0, (byte[])null); ++ public ChunkPosition getNearestInstance(World par1World, int par2, int par3, int par4) { ++ this.worldObj = par1World; ++ this.func_143027_a(par1World); ++ this.rand.setSeed(par1World.getSeed()); ++ long var5 = this.rand.nextLong(); ++ long var7 = this.rand.nextLong(); ++ long var9 = (long)(par2 >> 4) * var5; ++ long var11 = (long)(par4 >> 4) * var7; ++ this.rand.setSeed(var9 ^ var11 ^ par1World.getSeed()); ++ this.recursiveGenerate(par1World, par2 >> 4, par4 >> 4, 0, 0, (byte[])null); + double var13 = Double.MAX_VALUE; + ChunkPosition var15 = null; +- Iterator var16 = this.d.values().iterator(); +- ++ Iterator var16 = this.structureMap.values().iterator(); + ChunkPosition var19; + int var20; + int var21; + int var22; + double var23; +- while(var16.hasNext()) { ++ ++ while (var16.hasNext()) { + StructureStart var17 = (StructureStart)var16.next(); +- if(var17.isSizeableStructure()) { ++ ++ if (var17.isSizeableStructure()) { + StructureComponent var18 = (StructureComponent)var17.getComponents().get(0); + var19 = var18.getCenter(); +- var20 = var19.x - var2; +- var21 = var19.y - var3; +- var22 = var19.z - var4; ++ var20 = var19.x - par2; ++ var21 = var19.y - par3; ++ var22 = var19.z - par4; + var23 = (double)(var20 * var20 + var21 * var21 + var22 * var22); +- if(var23 < var13) { ++ ++ if (var23 < var13) { + var13 = var23; + var15 = var19; + } + } + } + +- if(var15 != null) { ++ if (var15 != null) { + return var15; + } else { + List var25 = this.getCoordList(); +- if(var25 != null) { ++ ++ if (var25 != null) { + ChunkPosition var26 = null; + Iterator var27 = var25.iterator(); + +- while(var27.hasNext()) { ++ while (var27.hasNext()) { + var19 = (ChunkPosition)var27.next(); +- var20 = var19.x - var2; +- var21 = var19.y - var3; +- var22 = var19.z - var4; ++ var20 = var19.x - par2; ++ var21 = var19.y - par3; ++ var22 = var19.z - par4; + var23 = (double)(var20 * var20 + var21 * var21 + var22 * var22); +- if(var23 < var13) { ++ ++ if (var23 < var13) { + var13 = var23; + var26 = var19; + } +@@ -164,39 +180,45 @@ + } + } + ++ /** ++ * Returns a list of other locations at which the structure generation has been run, or null if not relevant to this ++ * structure generator. ++ */ + protected List getCoordList() { + return null; + } + +- private void func_143027_a(World var1) { +- if(this.field_143029_e == null) { +- this.field_143029_e = (MapGenStructureData)var1.loadItemData(MapGenStructureData.class, this.func_143025_a()); +- if(this.field_143029_e == null) { ++ private void func_143027_a(World par1World) { ++ if (this.field_143029_e == null) { ++ this.field_143029_e = (MapGenStructureData)par1World.loadItemData(MapGenStructureData.class, this.func_143025_a()); ++ ++ if (this.field_143029_e == null) { + this.field_143029_e = new MapGenStructureData(this.func_143025_a()); +- var1.setItemData(this.func_143025_a(), this.field_143029_e); ++ par1World.setItemData(this.func_143025_a(), this.field_143029_e); + } else { + NBTTagCompound var2 = this.field_143029_e.func_143041_a(); + Iterator var3 = var2.getTags().iterator(); + +- while(var3.hasNext()) { ++ while (var3.hasNext()) { + NBTBase var4 = (NBTBase)var3.next(); +- if(var4.getId() == 10) { ++ ++ if (var4.getId() == 10) { + NBTTagCompound var5 = (NBTTagCompound)var4; +- if(var5.hasKey("ChunkX") && var5.hasKey("ChunkZ")) { ++ ++ if (var5.hasKey("ChunkX") && var5.hasKey("ChunkZ")) { + int var6 = var5.getInteger("ChunkX"); + int var7 = var5.getInteger("ChunkZ"); +- StructureStart var8 = MapGenStructureIO.func_143035_a(var5, var1); +- this.d.put(Long.valueOf(ChunkCoordIntPair.chunkXZ2Int(var6, var7)), var8); ++ StructureStart var8 = MapGenStructureIO.func_143035_a(var5, par1World); ++ this.structureMap.put(Long.valueOf(ChunkCoordIntPair.chunkXZ2Int(var6, var7)), var8); + } + } + } + } + } +- + } + +- private void func_143026_a(int var1, int var2, StructureStart var3) { +- this.field_143029_e.func_143043_a(var3.func_143021_a(var1, var2), var1, var2); ++ private void func_143026_a(int par1, int par2, StructureStart par3StructureStart) { ++ this.field_143029_e.func_143043_a(par3StructureStart.func_143021_a(par1, par2), par1, par2); + this.field_143029_e.markDirty(); + } + diff --git a/patches/net/minecraft/src/MapGenStructureData.java.patch b/patches/net/minecraft/src/MapGenStructureData.java.patch new file mode 100644 index 0000000..e7de6a4 --- /dev/null +++ b/patches/net/minecraft/src/MapGenStructureData.java.patch @@ -0,0 +1,55 @@ +--- net/minecraft/src/MapGenStructureData.java ++++ net/minecraft/src/MapGenStructureData.java +@@ -3,26 +3,32 @@ + public class MapGenStructureData extends WorldSavedData { + private NBTTagCompound field_143044_a = new NBTTagCompound("Features"); + +- public MapGenStructureData(String var1) { +- super(var1); +- } +- +- public void readFromNBT(NBTTagCompound var1) { +- this.field_143044_a = var1.getCompoundTag("Features"); +- } +- +- public void writeToNBT(NBTTagCompound var1) { +- var1.setTag("Features", this.field_143044_a); +- } +- +- public void func_143043_a(NBTTagCompound var1, int var2, int var3) { +- String var4 = this.func_143042_b(var2, var3); +- var1.setName(var4); +- this.field_143044_a.setTag(var4, var1); +- } +- +- public String func_143042_b(int var1, int var2) { +- return "[" + var1 + "," + var2 + "]"; ++ public MapGenStructureData(String par1Str) { ++ super(par1Str); ++ } ++ ++ /** ++ * reads in data from the NBTTagCompound into this MapDataBase ++ */ ++ public void readFromNBT(NBTTagCompound par1NBTTagCompound) { ++ this.field_143044_a = par1NBTTagCompound.getCompoundTag("Features"); ++ } ++ ++ /** ++ * write data to NBTTagCompound from this MapDataBase, similar to Entities and TileEntities ++ */ ++ public void writeToNBT(NBTTagCompound par1NBTTagCompound) { ++ par1NBTTagCompound.setTag("Features", this.field_143044_a); ++ } ++ ++ public void func_143043_a(NBTTagCompound par1NBTTagCompound, int par2, int par3) { ++ String var4 = this.func_143042_b(par2, par3); ++ par1NBTTagCompound.setName(var4); ++ this.field_143044_a.setTag(var4, par1NBTTagCompound); ++ } ++ ++ public String func_143042_b(int par1, int par2) { ++ return "[" + par1 + "," + par2 + "]"; + } + + public NBTTagCompound func_143041_a() { diff --git a/patches/net/minecraft/src/MapGenStructureIO.java.patch b/patches/net/minecraft/src/MapGenStructureIO.java.patch new file mode 100644 index 0000000..dbbe1b6 --- /dev/null +++ b/patches/net/minecraft/src/MapGenStructureIO.java.patch @@ -0,0 +1,110 @@ +--- net/minecraft/src/MapGenStructureIO.java ++++ net/minecraft/src/MapGenStructureIO.java +@@ -4,68 +4,70 @@ + import java.util.Map; + + public class MapGenStructureIO { +- private static Map a = new HashMap(); +- private static Map b = new HashMap(); +- private static Map c = new HashMap(); +- private static Map d = new HashMap(); +- +- private static void func_143034_b(Class var0, String var1) { +- a.put(var1, var0); +- b.put(var0, var1); +- } +- +- static void func_143031_a(Class var0, String var1) { +- c.put(var1, var0); +- d.put(var0, var1); +- } +- +- public static String func_143033_a(StructureStart var0) { +- return (String)b.get(var0.getClass()); +- } +- +- public static String func_143036_a(StructureComponent var0) { +- return (String)d.get(var0.getClass()); +- } +- +- public static StructureStart func_143035_a(NBTTagCompound var0, World var1) { ++ private static Map field_143040_a = new HashMap(); ++ private static Map field_143038_b = new HashMap(); ++ private static Map field_143039_c = new HashMap(); ++ private static Map field_143037_d = new HashMap(); ++ ++ private static void func_143034_b(Class par0Class, String par1Str) { ++ field_143040_a.put(par1Str, par0Class); ++ field_143038_b.put(par0Class, par1Str); ++ } ++ ++ static void func_143031_a(Class par0Class, String par1Str) { ++ field_143039_c.put(par1Str, par0Class); ++ field_143037_d.put(par0Class, par1Str); ++ } ++ ++ public static String func_143033_a(StructureStart par0StructureStart) { ++ return (String)field_143038_b.get(par0StructureStart.getClass()); ++ } ++ ++ public static String func_143036_a(StructureComponent par0StructureComponent) { ++ return (String)field_143037_d.get(par0StructureComponent.getClass()); ++ } ++ ++ public static StructureStart func_143035_a(NBTTagCompound par0NBTTagCompound, World par1World) { + StructureStart var2 = null; + + try { +- Class var3 = (Class)a.get(var0.getString("id")); +- if(var3 != null) { ++ Class var3 = (Class)field_143040_a.get(par0NBTTagCompound.getString("id")); ++ ++ if (var3 != null) { + var2 = (StructureStart)var3.newInstance(); + } + } catch (Exception var4) { +- var1.getWorldLogAgent().logWarning("Failed Start with id " + var0.getString("id")); ++ par1World.getWorldLogAgent().logWarning("Failed Start with id " + par0NBTTagCompound.getString("id")); + var4.printStackTrace(); + } + +- if(var2 != null) { +- var2.func_143020_a(var1, var0); ++ if (var2 != null) { ++ var2.func_143020_a(par1World, par0NBTTagCompound); + } else { +- var1.getWorldLogAgent().logWarning("Skipping Structure with id " + var0.getString("id")); ++ par1World.getWorldLogAgent().logWarning("Skipping Structure with id " + par0NBTTagCompound.getString("id")); + } + + return var2; + } + +- public static StructureComponent func_143032_b(NBTTagCompound var0, World var1) { ++ public static StructureComponent func_143032_b(NBTTagCompound par0NBTTagCompound, World par1World) { + StructureComponent var2 = null; + + try { +- Class var3 = (Class)c.get(var0.getString("id")); +- if(var3 != null) { ++ Class var3 = (Class)field_143039_c.get(par0NBTTagCompound.getString("id")); ++ ++ if (var3 != null) { + var2 = (StructureComponent)var3.newInstance(); + } + } catch (Exception var4) { +- var1.getWorldLogAgent().logWarning("Failed Piece with id " + var0.getString("id")); ++ par1World.getWorldLogAgent().logWarning("Failed Piece with id " + par0NBTTagCompound.getString("id")); + var4.printStackTrace(); + } + +- if(var2 != null) { +- var2.func_143009_a(var1, var0); ++ if (var2 != null) { ++ var2.func_143009_a(par1World, par0NBTTagCompound); + } else { +- var1.getWorldLogAgent().logWarning("Skipping Piece with id " + var0.getString("id")); ++ par1World.getWorldLogAgent().logWarning("Skipping Piece with id " + par0NBTTagCompound.getString("id")); + } + + return var2; diff --git a/patches/net/minecraft/src/MapGenVillage.java.patch b/patches/net/minecraft/src/MapGenVillage.java.patch new file mode 100644 index 0000000..066b13c --- /dev/null +++ b/patches/net/minecraft/src/MapGenVillage.java.patch @@ -0,0 +1,97 @@ +--- net/minecraft/src/MapGenVillage.java ++++ net/minecraft/src/MapGenVillage.java +@@ -8,7 +8,11 @@ + import java.util.Map.Entry; + + public class MapGenVillage extends MapGenStructure { +- public static final List e = Arrays.asList(new BiomeGenBase[]{BiomeGenBase.plains, BiomeGenBase.desert}); ++ ++ /** A list of all the biomes villages can spawn in. */ ++ public static final List villageSpawnBiomes = Arrays.asList(new BiomeGenBase[] {BiomeGenBase.plains, BiomeGenBase.desert}); ++ ++ /** World terrain type, 0 for normal, 1 for flat map */ + private int terrainType; + private int field_82665_g; + private int field_82666_h; +@@ -18,46 +22,49 @@ + this.field_82666_h = 8; + } + +- public MapGenVillage(Map var1) { ++ public MapGenVillage(Map par1Map) { + this(); +- Iterator var2 = var1.entrySet().iterator(); ++ Iterator var2 = par1Map.entrySet().iterator(); + +- while(var2.hasNext()) { ++ while (var2.hasNext()) { + Entry var3 = (Entry)var2.next(); +- if(((String)var3.getKey()).equals("size")) { ++ ++ if (((String)var3.getKey()).equals("size")) { + this.terrainType = MathHelper.parseIntWithDefaultAndMax((String)var3.getValue(), this.terrainType, 0); +- } else if(((String)var3.getKey()).equals("distance")) { ++ } else if (((String)var3.getKey()).equals("distance")) { + this.field_82665_g = MathHelper.parseIntWithDefaultAndMax((String)var3.getValue(), this.field_82665_g, this.field_82666_h + 1); + } + } +- + } + + public String func_143025_a() { + return "Village"; + } + +- protected boolean canSpawnStructureAtCoords(int var1, int var2) { +- int var3 = var1; +- int var4 = var2; +- if(var1 < 0) { +- var1 -= this.field_82665_g - 1; +- } +- +- if(var2 < 0) { +- var2 -= this.field_82665_g - 1; +- } +- +- int var5 = var1 / this.field_82665_g; +- int var6 = var2 / this.field_82665_g; ++ protected boolean canSpawnStructureAtCoords(int par1, int par2) { ++ int var3 = par1; ++ int var4 = par2; ++ ++ if (par1 < 0) { ++ par1 -= this.field_82665_g - 1; ++ } ++ ++ if (par2 < 0) { ++ par2 -= this.field_82665_g - 1; ++ } ++ ++ int var5 = par1 / this.field_82665_g; ++ int var6 = par2 / this.field_82665_g; + Random var7 = this.worldObj.setRandomSeed(var5, var6, 10387312); + var5 *= this.field_82665_g; + var6 *= this.field_82665_g; + var5 += var7.nextInt(this.field_82665_g - this.field_82666_h); + var6 += var7.nextInt(this.field_82665_g - this.field_82666_h); +- if(var3 == var5 && var4 == var6) { +- boolean var8 = this.worldObj.getWorldChunkManager().areBiomesViable(var3 * 16 + 8, var4 * 16 + 8, 0, e); +- if(var8) { ++ ++ if (var3 == var5 && var4 == var6) { ++ boolean var8 = this.worldObj.getWorldChunkManager().areBiomesViable(var3 * 16 + 8, var4 * 16 + 8, 0, villageSpawnBiomes); ++ ++ if (var8) { + return true; + } + } +@@ -65,7 +72,7 @@ + return false; + } + +- protected StructureStart getStructureStart(int var1, int var2) { +- return new StructureVillageStart(this.worldObj, this.b, var1, var2, this.terrainType); ++ protected StructureStart getStructureStart(int par1, int par2) { ++ return new StructureVillageStart(this.worldObj, this.rand, par1, par2, this.terrainType); + } + } diff --git a/patches/net/minecraft/src/MapInfo.java.patch b/patches/net/minecraft/src/MapInfo.java.patch new file mode 100644 index 0000000..55e5552 --- /dev/null +++ b/patches/net/minecraft/src/MapInfo.java.patch @@ -0,0 +1,120 @@ +--- net/minecraft/src/MapInfo.java ++++ net/minecraft/src/MapInfo.java +@@ -3,55 +3,73 @@ + import java.util.Iterator; + + public class MapInfo { ++ ++ /** Reference for EntityPlayer object in MapInfo */ + public final EntityPlayer entityplayerObj; + public int[] field_76209_b; + public int[] field_76210_c; ++ ++ /** ++ * updated by x = mod(x*11,128) +1 x-1 is used to index field_76209_b and field_76210_c ++ */ + private int currentRandomNumber; + private int ticksUntilPlayerLocationMapUpdate; ++ ++ /** ++ * a cache of the result from getPlayersOnMap so that it is not resent when nothing changes ++ */ + private byte[] lastPlayerLocationOnMap; + public int field_82569_d; + private boolean field_82570_i; ++ ++ /** reference in MapInfo to MapData object */ + final MapData mapDataObj; + +- public MapInfo(MapData var1, EntityPlayer var2) { +- this.mapDataObj = var1; ++ public MapInfo(MapData par1MapData, EntityPlayer par2EntityPlayer) { ++ this.mapDataObj = par1MapData; + this.field_76209_b = new int[128]; + this.field_76210_c = new int[128]; +- this.entityplayerObj = var2; ++ this.entityplayerObj = par2EntityPlayer; + +- for(int var3 = 0; var3 < this.field_76209_b.length; ++var3) { ++ for (int var3 = 0; var3 < this.field_76209_b.length; ++var3) { + this.field_76209_b[var3] = 0; + this.field_76210_c[var3] = 127; + } +- + } + +- public byte[] getPlayersOnMap(ItemStack var1) { ++ /** ++ * returns a 1+players*3 array, of x,y, and color . the name of this function may be partially wrong, as there is a ++ * second branch to the code here ++ */ ++ public byte[] getPlayersOnMap(ItemStack par1ItemStack) { + byte[] var2; +- if(!this.field_82570_i) { +- var2 = new byte[]{(byte)2, this.mapDataObj.scale}; ++ ++ if (!this.field_82570_i) { ++ var2 = new byte[] {(byte)2, this.mapDataObj.scale}; + this.field_82570_i = true; + return var2; + } else { + int var3; + int var10; +- if(--this.ticksUntilPlayerLocationMapUpdate < 0) { ++ ++ if (--this.ticksUntilPlayerLocationMapUpdate < 0) { + this.ticksUntilPlayerLocationMapUpdate = 4; +- var2 = new byte[this.mapDataObj.g.size() * 3 + 1]; ++ var2 = new byte[this.mapDataObj.playersVisibleOnMap.size() * 3 + 1]; + var2[0] = 1; + var3 = 0; + +- for(Iterator var4 = this.mapDataObj.g.values().iterator(); var4.hasNext(); ++var3) { ++ for (Iterator var4 = this.mapDataObj.playersVisibleOnMap.values().iterator(); var4.hasNext(); ++var3) { + MapCoord var5 = (MapCoord)var4.next(); + var2[var3 * 3 + 1] = (byte)(var5.iconSize << 4 | var5.iconRotation & 15); + var2[var3 * 3 + 2] = var5.centerX; + var2[var3 * 3 + 3] = var5.centerZ; + } + +- boolean var9 = !var1.isOnItemFrame(); +- if(this.lastPlayerLocationOnMap != null && this.lastPlayerLocationOnMap.length == var2.length) { +- for(var10 = 0; var10 < var2.length; ++var10) { +- if(var2[var10] != this.lastPlayerLocationOnMap[var10]) { ++ boolean var9 = !par1ItemStack.isOnItemFrame(); ++ ++ if (this.lastPlayerLocationOnMap != null && this.lastPlayerLocationOnMap.length == var2.length) { ++ for (var10 = 0; var10 < var2.length; ++var10) { ++ if (var2[var10] != this.lastPlayerLocationOnMap[var10]) { + var9 = false; + break; + } +@@ -60,15 +78,16 @@ + var9 = false; + } + +- if(!var9) { ++ if (!var9) { + this.lastPlayerLocationOnMap = var2; + return var2; + } + } + +- for(int var8 = 0; var8 < 1; ++var8) { ++ for (int var8 = 0; var8 < 1; ++var8) { + var3 = this.currentRandomNumber++ * 11 % 128; +- if(this.field_76209_b[var3] >= 0) { ++ ++ if (this.field_76209_b[var3] >= 0) { + int var11 = this.field_76210_c[var3] - this.field_76209_b[var3] + 1; + var10 = this.field_76209_b[var3]; + byte[] var6 = new byte[var11 + 3]; +@@ -76,7 +95,7 @@ + var6[1] = (byte)var3; + var6[2] = (byte)var10; + +- for(int var7 = 0; var7 < var6.length - 3; ++var7) { ++ for (int var7 = 0; var7 < var6.length - 3; ++var7) { + var6[var7 + 3] = this.mapDataObj.colors[(var7 + var10) * 128 + var3]; + } + diff --git a/patches/net/minecraft/src/MapItemRenderer.java.patch b/patches/net/minecraft/src/MapItemRenderer.java.patch new file mode 100644 index 0000000..dfb2d76 --- /dev/null +++ b/patches/net/minecraft/src/MapItemRenderer.java.patch @@ -0,0 +1,84 @@ +--- net/minecraft/src/MapItemRenderer.java ++++ net/minecraft/src/MapItemRenderer.java +@@ -10,32 +10,33 @@ + private GameSettings gameSettings; + private final ResourceLocation field_111276_e; + +- public MapItemRenderer(GameSettings var1, TextureManager var2) { +- this.gameSettings = var1; ++ public MapItemRenderer(GameSettings par1GameSettings, TextureManager par2TextureManager) { ++ this.gameSettings = par1GameSettings; + this.bufferedImage = new DynamicTexture(128, 128); +- this.field_111276_e = var2.getDynamicTextureLocation("map", this.bufferedImage); ++ this.field_111276_e = par2TextureManager.getDynamicTextureLocation("map", this.bufferedImage); + this.intArray = this.bufferedImage.getTextureData(); + +- for(int var4 = 0; var4 < this.intArray.length; ++var4) { ++ for (int var4 = 0; var4 < this.intArray.length; ++var4) { + this.intArray[var4] = 0; + } +- + } + +- public void renderMap(EntityPlayer var1, TextureManager var2, MapData var3) { +- for(int var4 = 0; var4 < 16384; ++var4) { +- byte var5 = var3.colors[var4]; +- if(var5 / 4 == 0) { ++ public void renderMap(EntityPlayer par1EntityPlayer, TextureManager par2TextureManager, MapData par3MapData) { ++ for (int var4 = 0; var4 < 16384; ++var4) { ++ byte var5 = par3MapData.colors[var4]; ++ ++ if (var5 / 4 == 0) { + this.intArray[var4] = (var4 + var4 / 128 & 1) * 8 + 16 << 24; + } else { + int var6 = MapColor.mapColorArray[var5 / 4].colorValue; + int var7 = var5 & 3; + short var8 = 220; +- if(var7 == 2) { ++ ++ if (var7 == 2) { + var8 = 255; + } + +- if(var7 == 0) { ++ if (var7 == 0) { + var8 = 180; + } + +@@ -51,28 +52,28 @@ + byte var16 = 0; + Tessellator var17 = Tessellator.instance; + float var18 = 0.0F; +- var2.bindTexture(this.field_111276_e); ++ par2TextureManager.bindTexture(this.field_111276_e); + GL11.glEnable(GL11.GL_BLEND); + GL11.glBlendFunc(GL11.GL_ONE, GL11.GL_ONE_MINUS_SRC_ALPHA); + GL11.glDisable(GL11.GL_ALPHA_TEST); + var17.startDrawingQuads(); +- var17.addVertexWithUV((double)((float)(var15 + 0) + var18), (double)((float)(var16 + 128) - var18), (double)-0.01F, 0.0D, 1.0D); +- var17.addVertexWithUV((double)((float)(var15 + 128) - var18), (double)((float)(var16 + 128) - var18), (double)-0.01F, 1.0D, 1.0D); +- var17.addVertexWithUV((double)((float)(var15 + 128) - var18), (double)((float)(var16 + 0) + var18), (double)-0.01F, 1.0D, 0.0D); +- var17.addVertexWithUV((double)((float)(var15 + 0) + var18), (double)((float)(var16 + 0) + var18), (double)-0.01F, 0.0D, 0.0D); ++ var17.addVertexWithUV((double)((float)(var15 + 0) + var18), (double)((float)(var16 + 128) - var18), -0.009999999776482582D, 0.0D, 1.0D); ++ var17.addVertexWithUV((double)((float)(var15 + 128) - var18), (double)((float)(var16 + 128) - var18), -0.009999999776482582D, 1.0D, 1.0D); ++ var17.addVertexWithUV((double)((float)(var15 + 128) - var18), (double)((float)(var16 + 0) + var18), -0.009999999776482582D, 1.0D, 0.0D); ++ var17.addVertexWithUV((double)((float)(var15 + 0) + var18), (double)((float)(var16 + 0) + var18), -0.009999999776482582D, 0.0D, 0.0D); + var17.draw(); + GL11.glEnable(GL11.GL_ALPHA_TEST); + GL11.glDisable(GL11.GL_BLEND); +- var2.bindTexture(field_111277_a); ++ par2TextureManager.bindTexture(field_111277_a); + int var19 = 0; + +- for(Iterator var20 = var3.g.values().iterator(); var20.hasNext(); ++var19) { ++ for (Iterator var20 = par3MapData.playersVisibleOnMap.values().iterator(); var20.hasNext(); ++var19) { + MapCoord var21 = (MapCoord)var20.next(); + GL11.glPushMatrix(); + GL11.glTranslatef((float)var15 + (float)var21.centerX / 2.0F + 64.0F, (float)var16 + (float)var21.centerZ / 2.0F + 64.0F, -0.02F); + GL11.glRotatef((float)(var21.iconRotation * 360) / 16.0F, 0.0F, 0.0F, 1.0F); + GL11.glScalef(4.0F, 4.0F, 3.0F); +- GL11.glTranslatef(-(2.0F / 16.0F), 2.0F / 16.0F, 0.0F); ++ GL11.glTranslatef(-0.125F, 0.125F, 0.0F); + float var22 = (float)(var21.iconSize % 4 + 0) / 4.0F; + float var12 = (float)(var21.iconSize / 4 + 0) / 4.0F; + float var13 = (float)(var21.iconSize % 4 + 1) / 4.0F; diff --git a/patches/net/minecraft/src/MapStorage.java.patch b/patches/net/minecraft/src/MapStorage.java.patch new file mode 100644 index 0000000..c065919 --- /dev/null +++ b/patches/net/minecraft/src/MapStorage.java.patch @@ -0,0 +1,239 @@ +--- net/minecraft/src/MapStorage.java ++++ net/minecraft/src/MapStorage.java +@@ -1,8 +1,6 @@ + package net.minecraft.src; + +-import java.io.DataInput; + import java.io.DataInputStream; +-import java.io.DataOutput; + import java.io.DataOutputStream; + import java.io.File; + import java.io.FileInputStream; +@@ -15,28 +13,42 @@ + + public class MapStorage { + private ISaveHandler saveHandler; +- private Map b = new HashMap(); +- private List c = new ArrayList(); +- private Map d = new HashMap(); +- +- public MapStorage(ISaveHandler var1) { +- this.saveHandler = var1; ++ ++ /** Map of item data String id to loaded MapDataBases */ ++ private Map loadedDataMap = new HashMap(); ++ ++ /** List of loaded MapDataBases. */ ++ private List loadedDataList = new ArrayList(); ++ ++ /** ++ * Map of MapDataBase id String prefixes ('map' etc) to max known unique Short id (the 0 part etc) for that prefix ++ */ ++ private Map idCounts = new HashMap(); ++ ++ public MapStorage(ISaveHandler par1ISaveHandler) { ++ this.saveHandler = par1ISaveHandler; + this.loadIdCounts(); + } + +- public WorldSavedData loadData(Class var1, String var2) { +- WorldSavedData var3 = (WorldSavedData)this.b.get(var2); +- if(var3 != null) { ++ /** ++ * Loads an existing MapDataBase corresponding to the given String id from disk, instantiating the given Class, or ++ * returns null if none such file exists. args: Class to instantiate, String dataid ++ */ ++ public WorldSavedData loadData(Class par1Class, String par2Str) { ++ WorldSavedData var3 = (WorldSavedData)this.loadedDataMap.get(par2Str); ++ ++ if (var3 != null) { + return var3; + } else { +- if(this.saveHandler != null) { ++ if (this.saveHandler != null) { + try { +- File var4 = this.saveHandler.getMapFileFromName(var2); +- if(var4 != null && var4.exists()) { ++ File var4 = this.saveHandler.getMapFileFromName(par2Str); ++ ++ if (var4 != null && var4.exists()) { + try { +- var3 = (WorldSavedData)var1.getConstructor(new Class[]{String.class}).newInstance(new Object[]{var2}); ++ var3 = (WorldSavedData)par1Class.getConstructor(new Class[] {String.class}).newInstance(new Object[] {par2Str}); + } catch (Exception var7) { +- throw new RuntimeException("Failed to instantiate " + var1.toString(), var7); ++ throw new RuntimeException("Failed to instantiate " + par1Class.toString(), var7); + } + + FileInputStream var5 = new FileInputStream(var4); +@@ -49,46 +61,56 @@ + } + } + +- if(var3 != null) { +- this.b.put(var2, var3); +- this.c.add(var3); ++ if (var3 != null) { ++ this.loadedDataMap.put(par2Str, var3); ++ this.loadedDataList.add(var3); + } + + return var3; + } + } + +- public void setData(String var1, WorldSavedData var2) { +- if(var2 == null) { ++ /** ++ * Assigns the given String id to the given MapDataBase, removing any existing ones of the same id. ++ */ ++ public void setData(String par1Str, WorldSavedData par2WorldSavedData) { ++ if (par2WorldSavedData == null) { + throw new RuntimeException("Can\'t set null data"); + } else { +- if(this.b.containsKey(var1)) { +- this.c.remove(this.b.remove(var1)); ++ if (this.loadedDataMap.containsKey(par1Str)) { ++ this.loadedDataList.remove(this.loadedDataMap.remove(par1Str)); + } + +- this.b.put(var1, var2); +- this.c.add(var2); ++ this.loadedDataMap.put(par1Str, par2WorldSavedData); ++ this.loadedDataList.add(par2WorldSavedData); + } + } + ++ /** ++ * Saves all dirty loaded MapDataBases to disk. ++ */ + public void saveAllData() { +- for(int var1 = 0; var1 < this.c.size(); ++var1) { +- WorldSavedData var2 = (WorldSavedData)this.c.get(var1); +- if(var2.isDirty()) { ++ for (int var1 = 0; var1 < this.loadedDataList.size(); ++var1) { ++ WorldSavedData var2 = (WorldSavedData)this.loadedDataList.get(var1); ++ ++ if (var2.isDirty()) { + this.saveData(var2); + var2.setDirty(false); + } + } +- + } + +- private void saveData(WorldSavedData var1) { +- if(this.saveHandler != null) { ++ /** ++ * Saves the given MapDataBase to disk. ++ */ ++ private void saveData(WorldSavedData par1WorldSavedData) { ++ if (this.saveHandler != null) { + try { +- File var2 = this.saveHandler.getMapFileFromName(var1.h); +- if(var2 != null) { ++ File var2 = this.saveHandler.getMapFileFromName(par1WorldSavedData.mapName); ++ ++ if (var2 != null) { + NBTTagCompound var3 = new NBTTagCompound(); +- var1.writeToNBT(var3); ++ par1WorldSavedData.writeToNBT(var3); + NBTTagCompound var4 = new NBTTagCompound(); + var4.setCompoundTag("data", var3); + FileOutputStream var5 = new FileOutputStream(var2); +@@ -98,66 +120,76 @@ + } catch (Exception var6) { + var6.printStackTrace(); + } +- + } + } + ++ /** ++ * Loads the idCounts Map from the 'idcounts' file. ++ */ + private void loadIdCounts() { + try { +- this.d.clear(); +- if(this.saveHandler == null) { ++ this.idCounts.clear(); ++ ++ if (this.saveHandler == null) { + return; + } + + File var1 = this.saveHandler.getMapFileFromName("idcounts"); +- if(var1 != null && var1.exists()) { ++ ++ if (var1 != null && var1.exists()) { + DataInputStream var2 = new DataInputStream(new FileInputStream(var1)); +- NBTTagCompound var3 = CompressedStreamTools.read((DataInput)var2); ++ NBTTagCompound var3 = CompressedStreamTools.read(var2); + var2.close(); + Iterator var4 = var3.getTags().iterator(); + +- while(var4.hasNext()) { ++ while (var4.hasNext()) { + NBTBase var5 = (NBTBase)var4.next(); +- if(var5 instanceof NBTTagShort) { ++ ++ if (var5 instanceof NBTTagShort) { + NBTTagShort var6 = (NBTTagShort)var5; + String var7 = var6.getName(); + short var8 = var6.data; +- this.d.put(var7, Short.valueOf(var8)); ++ this.idCounts.put(var7, Short.valueOf(var8)); + } + } + } + } catch (Exception var9) { + var9.printStackTrace(); + } +- + } + +- public int getUniqueDataId(String var1) { +- Short var2 = (Short)this.d.get(var1); +- if(var2 == null) { ++ /** ++ * Returns an unique new data id for the given prefix and saves the idCounts map to the 'idcounts' file. ++ */ ++ public int getUniqueDataId(String par1Str) { ++ Short var2 = (Short)this.idCounts.get(par1Str); ++ ++ if (var2 == null) { + var2 = Short.valueOf((short)0); + } else { + var2 = Short.valueOf((short)(var2.shortValue() + 1)); + } + +- this.d.put(var1, var2); +- if(this.saveHandler == null) { ++ this.idCounts.put(par1Str, var2); ++ ++ if (this.saveHandler == null) { + return var2.shortValue(); + } else { + try { + File var3 = this.saveHandler.getMapFileFromName("idcounts"); +- if(var3 != null) { ++ ++ if (var3 != null) { + NBTTagCompound var4 = new NBTTagCompound(); +- Iterator var5 = this.d.keySet().iterator(); ++ Iterator var5 = this.idCounts.keySet().iterator(); + +- while(var5.hasNext()) { ++ while (var5.hasNext()) { + String var6 = (String)var5.next(); +- short var7 = ((Short)this.d.get(var6)).shortValue(); ++ short var7 = ((Short)this.idCounts.get(var6)).shortValue(); + var4.setShort(var6, var7); + } + + DataOutputStream var9 = new DataOutputStream(new FileOutputStream(var3)); +- CompressedStreamTools.write(var4, (DataOutput)var9); ++ CompressedStreamTools.write(var4, var9); + var9.close(); + } + } catch (Exception var8) { diff --git a/patches/net/minecraft/src/Material.java.patch b/patches/net/minecraft/src/Material.java.patch new file mode 100644 index 0000000..1c2fcd1 --- /dev/null +++ b/patches/net/minecraft/src/Material.java.patch @@ -0,0 +1,192 @@ +--- net/minecraft/src/Material.java ++++ net/minecraft/src/Material.java +@@ -2,6 +2,8 @@ + + public class Material { + public static final Material air = new MaterialTransparent(MapColor.airColor); ++ ++ /** The material used by BlockGrass. */ + public static final Material grass = new Material(MapColor.grassColor); + public static final Material ground = new Material(MapColor.dirtColor); + public static final Material wood = (new Material(MapColor.woodColor)).setBurning(); +@@ -25,27 +27,62 @@ + public static final Material coral = (new Material(MapColor.foliageColor)).setNoPushMobility(); + public static final Material ice = (new Material(MapColor.iceColor)).setTranslucent().setAdventureModeExempt(); + public static final Material snow = (new MaterialLogic(MapColor.snowColor)).setReplaceable().setTranslucent().setRequiresTool().setNoPushMobility(); ++ ++ /** The material for crafted snow. */ + public static final Material craftedSnow = (new Material(MapColor.snowColor)).setRequiresTool(); + public static final Material cactus = (new Material(MapColor.foliageColor)).setTranslucent().setNoPushMobility(); + public static final Material clay = new Material(MapColor.clayColor); ++ ++ /** pumpkin */ + public static final Material pumpkin = (new Material(MapColor.foliageColor)).setNoPushMobility(); + public static final Material dragonEgg = (new Material(MapColor.foliageColor)).setNoPushMobility(); ++ ++ /** Material used for portals */ + public static final Material portal = (new MaterialPortal(MapColor.airColor)).setImmovableMobility(); ++ ++ /** Cake's material, see BlockCake */ + public static final Material cake = (new Material(MapColor.airColor)).setNoPushMobility(); ++ ++ /** Web's material. */ + public static final Material web = (new MaterialWeb(MapColor.clothColor)).setRequiresTool().setNoPushMobility(); ++ ++ /** Pistons' material. */ + public static final Material piston = (new Material(MapColor.stoneColor)).setImmovableMobility(); ++ ++ /** Bool defining if the block can burn or not. */ + private boolean canBurn; ++ ++ /** ++ * Determines whether blocks with this material can be "overwritten" by other blocks when placed - eg snow, vines and ++ * tall grass. ++ */ + private boolean replaceable; ++ ++ /** Indicates if the material is translucent */ + private boolean isTranslucent; ++ ++ /** The color index used to draw the blocks of this material on maps. */ + public final MapColor materialMapColor; ++ ++ /** ++ * Determines if the material can be harvested without a tool (or with the wrong tool) ++ */ + private boolean requiresNoTool = true; ++ ++ /** ++ * Mobility information flag. 0 indicates that this block is normal, 1 indicates that it can't push other blocks, 2 ++ * indicates that it can't be pushed. ++ */ + private int mobilityFlag; + private boolean isAdventureModeExempt; + +- public Material(MapColor var1) { +- this.materialMapColor = var1; ++ public Material(MapColor par1MapColor) { ++ this.materialMapColor = par1MapColor; + } + ++ /** ++ * Returns if blocks of these materials are liquids. ++ */ + public boolean isLiquid() { + return false; + } +@@ -54,69 +91,115 @@ + return true; + } + ++ /** ++ * Will prevent grass from growing on dirt underneath and kill any grass below it if it returns true ++ */ + public boolean getCanBlockGrass() { + return true; + } + ++ /** ++ * Returns if this material is considered solid or not ++ */ + public boolean blocksMovement() { + return true; + } + ++ /** ++ * Marks the material as translucent ++ */ + private Material setTranslucent() { + this.isTranslucent = true; + return this; + } + ++ /** ++ * Makes blocks with this material require the correct tool to be harvested. ++ */ + protected Material setRequiresTool() { + this.requiresNoTool = false; + return this; + } + ++ /** ++ * Set the canBurn bool to True and return the current object. ++ */ + protected Material setBurning() { + this.canBurn = true; + return this; + } + ++ /** ++ * Returns if the block can burn or not. ++ */ + public boolean getCanBurn() { + return this.canBurn; + } + ++ /** ++ * Sets {@link #replaceable} to true. ++ */ + public Material setReplaceable() { + this.replaceable = true; + return this; + } + ++ /** ++ * Returns whether the material can be replaced by other blocks when placed - eg snow, vines and tall grass. ++ */ + public boolean isReplaceable() { + return this.replaceable; + } + ++ /** ++ * Indicate if the material is opaque ++ */ + public boolean isOpaque() { + return this.isTranslucent ? false : this.blocksMovement(); + } + ++ /** ++ * Returns true if the material can be harvested without a tool (or with the wrong tool) ++ */ + public boolean isToolNotRequired() { + return this.requiresNoTool; + } + ++ /** ++ * Returns the mobility information of the material, 0 = free, 1 = can't push but can move over, 2 = total immobility ++ * and stop pistons. ++ */ + public int getMaterialMobility() { + return this.mobilityFlag; + } + ++ /** ++ * This type of material can't be pushed, but pistons can move over it. ++ */ + protected Material setNoPushMobility() { + this.mobilityFlag = 1; + return this; + } + ++ /** ++ * This type of material can't be pushed, and pistons are blocked to move. ++ */ + protected Material setImmovableMobility() { + this.mobilityFlag = 2; + return this; + } + ++ /** ++ * @see #isAdventureModeExempt() ++ */ + protected Material setAdventureModeExempt() { + this.isAdventureModeExempt = true; + return this; + } + ++ /** ++ * Returns true if blocks with this material can always be mined in adventure mode. ++ */ + public boolean isAdventureModeExempt() { + return this.isAdventureModeExempt; + } diff --git a/patches/net/minecraft/src/MaterialLiquid.java.patch b/patches/net/minecraft/src/MaterialLiquid.java.patch new file mode 100644 index 0000000..e26630c --- /dev/null +++ b/patches/net/minecraft/src/MaterialLiquid.java.patch @@ -0,0 +1,27 @@ +--- net/minecraft/src/MaterialLiquid.java ++++ net/minecraft/src/MaterialLiquid.java +@@ -1,16 +1,22 @@ + package net.minecraft.src; + + public class MaterialLiquid extends Material { +- public MaterialLiquid(MapColor var1) { +- super(var1); ++ public MaterialLiquid(MapColor par1MapColor) { ++ super(par1MapColor); + this.setReplaceable(); + this.setNoPushMobility(); + } + ++ /** ++ * Returns if blocks of these materials are liquids. ++ */ + public boolean isLiquid() { + return true; + } + ++ /** ++ * Returns if this material is considered solid or not ++ */ + public boolean blocksMovement() { + return false; + } diff --git a/patches/net/minecraft/src/MaterialLogic.java.patch b/patches/net/minecraft/src/MaterialLogic.java.patch new file mode 100644 index 0000000..538a618 --- /dev/null +++ b/patches/net/minecraft/src/MaterialLogic.java.patch @@ -0,0 +1,30 @@ +--- net/minecraft/src/MaterialLogic.java ++++ net/minecraft/src/MaterialLogic.java +@@ -1,8 +1,8 @@ + package net.minecraft.src; + + public class MaterialLogic extends Material { +- public MaterialLogic(MapColor var1) { +- super(var1); ++ public MaterialLogic(MapColor par1MapColor) { ++ super(par1MapColor); + this.setAdventureModeExempt(); + } + +@@ -10,10 +10,16 @@ + return false; + } + ++ /** ++ * Will prevent grass from growing on dirt underneath and kill any grass below it if it returns true ++ */ + public boolean getCanBlockGrass() { + return false; + } + ++ /** ++ * Returns if this material is considered solid or not ++ */ + public boolean blocksMovement() { + return false; + } diff --git a/patches/net/minecraft/src/MaterialPortal.java.patch b/patches/net/minecraft/src/MaterialPortal.java.patch new file mode 100644 index 0000000..55d2a01 --- /dev/null +++ b/patches/net/minecraft/src/MaterialPortal.java.patch @@ -0,0 +1,29 @@ +--- net/minecraft/src/MaterialPortal.java ++++ net/minecraft/src/MaterialPortal.java +@@ -1,18 +1,24 @@ + package net.minecraft.src; + + public class MaterialPortal extends Material { +- public MaterialPortal(MapColor var1) { +- super(var1); ++ public MaterialPortal(MapColor par1MapColor) { ++ super(par1MapColor); + } + + public boolean isSolid() { + return false; + } + ++ /** ++ * Will prevent grass from growing on dirt underneath and kill any grass below it if it returns true ++ */ + public boolean getCanBlockGrass() { + return false; + } + ++ /** ++ * Returns if this material is considered solid or not ++ */ + public boolean blocksMovement() { + return false; + } diff --git a/patches/net/minecraft/src/MaterialTransparent.java.patch b/patches/net/minecraft/src/MaterialTransparent.java.patch new file mode 100644 index 0000000..f7d0f93 --- /dev/null +++ b/patches/net/minecraft/src/MaterialTransparent.java.patch @@ -0,0 +1,30 @@ +--- net/minecraft/src/MaterialTransparent.java ++++ net/minecraft/src/MaterialTransparent.java +@@ -1,8 +1,8 @@ + package net.minecraft.src; + + public class MaterialTransparent extends Material { +- public MaterialTransparent(MapColor var1) { +- super(var1); ++ public MaterialTransparent(MapColor par1MapColor) { ++ super(par1MapColor); + this.setReplaceable(); + } + +@@ -10,10 +10,16 @@ + return false; + } + ++ /** ++ * Will prevent grass from growing on dirt underneath and kill any grass below it if it returns true ++ */ + public boolean getCanBlockGrass() { + return false; + } + ++ /** ++ * Returns if this material is considered solid or not ++ */ + public boolean blocksMovement() { + return false; + } diff --git a/patches/net/minecraft/src/MaterialWeb.java.patch b/patches/net/minecraft/src/MaterialWeb.java.patch new file mode 100644 index 0000000..a2a7f45 --- /dev/null +++ b/patches/net/minecraft/src/MaterialWeb.java.patch @@ -0,0 +1,18 @@ +--- net/minecraft/src/MaterialWeb.java ++++ net/minecraft/src/MaterialWeb.java +@@ -1,10 +1,13 @@ + package net.minecraft.src; + + final class MaterialWeb extends Material { +- MaterialWeb(MapColor var1) { +- super(var1); ++ MaterialWeb(MapColor par1MapColor) { ++ super(par1MapColor); + } + ++ /** ++ * Returns if this material is considered solid or not ++ */ + public boolean blocksMovement() { + return false; + } diff --git a/patches/net/minecraft/src/MathHelper.java.patch b/patches/net/minecraft/src/MathHelper.java.patch new file mode 100644 index 0000000..b40ce0a --- /dev/null +++ b/patches/net/minecraft/src/MathHelper.java.patch @@ -0,0 +1,397 @@ +--- net/minecraft/src/MathHelper.java ++++ net/minecraft/src/MathHelper.java +@@ -3,192 +3,254 @@ + import java.util.Random; + + public class MathHelper { ++ ++ /** ++ * A table of sin values computed from 0 (inclusive) to 2*pi (exclusive), with steps of 2*PI / 65536. ++ */ + private static float[] SIN_TABLE = new float[65536]; + +- public static final float sin(float var0) { +- return SIN_TABLE[(int)(var0 * 10430.378F) & '\uffff']; +- } +- +- public static final float cos(float var0) { +- return SIN_TABLE[(int)(var0 * 10430.378F + 16384.0F) & '\uffff']; +- } +- +- public static final float sqrt_float(float var0) { +- return (float)Math.sqrt((double)var0); +- } +- +- public static final float sqrt_double(double var0) { +- return (float)Math.sqrt(var0); +- } +- +- public static int floor_float(float var0) { +- int var1 = (int)var0; +- return var0 < (float)var1 ? var1 - 1 : var1; +- } +- +- public static int truncateDoubleToInt(double var0) { +- return (int)(var0 + 1024.0D) - 1024; +- } +- +- public static int floor_double(double var0) { +- int var2 = (int)var0; +- return var0 < (double)var2 ? var2 - 1 : var2; +- } +- +- public static long floor_double_long(double var0) { +- long var2 = (long)var0; +- return var0 < (double)var2 ? var2 - 1L : var2; +- } +- +- public static float abs(float var0) { +- return var0 >= 0.0F ? var0 : -var0; +- } +- +- public static int abs_int(int var0) { +- return var0 >= 0 ? var0 : -var0; +- } +- +- public static int ceiling_float_int(float var0) { +- int var1 = (int)var0; +- return var0 > (float)var1 ? var1 + 1 : var1; +- } +- +- public static int ceiling_double_int(double var0) { +- int var2 = (int)var0; +- return var0 > (double)var2 ? var2 + 1 : var2; +- } +- +- public static int clamp_int(int var0, int var1, int var2) { +- return var0 < var1 ? var1 : (var0 > var2 ? var2 : var0); +- } +- +- public static float clamp_float(float var0, float var1, float var2) { +- return var0 < var1 ? var1 : (var0 > var2 ? var2 : var0); +- } +- +- public static double abs_max(double var0, double var2) { +- if(var0 < 0.0D) { +- var0 = -var0; +- } +- +- if(var2 < 0.0D) { +- var2 = -var2; +- } +- +- return var0 > var2 ? var0 : var2; +- } +- +- public static int bucketInt(int var0, int var1) { +- return var0 < 0 ? -((-var0 - 1) / var1) - 1 : var0 / var1; +- } +- +- public static boolean stringNullOrLengthZero(String var0) { +- return var0 == null || var0.length() == 0; +- } +- +- public static int getRandomIntegerInRange(Random var0, int var1, int var2) { +- return var1 >= var2 ? var1 : var0.nextInt(var2 - var1 + 1) + var1; +- } +- +- public static double getRandomDoubleInRange(Random var0, double var1, double var3) { +- return var1 >= var3 ? var1 : var0.nextDouble() * (var3 - var1) + var1; +- } +- +- public static double average(long[] var0) { ++ /** ++ * sin looked up in a table ++ */ ++ public static final float sin(float par0) { ++ return SIN_TABLE[(int)(par0 * 10430.378F) & 65535]; ++ } ++ ++ /** ++ * cos looked up in the sin table with the appropriate offset ++ */ ++ public static final float cos(float par0) { ++ return SIN_TABLE[(int)(par0 * 10430.378F + 16384.0F) & 65535]; ++ } ++ ++ public static final float sqrt_float(float par0) { ++ return (float)Math.sqrt((double)par0); ++ } ++ ++ public static final float sqrt_double(double par0) { ++ return (float)Math.sqrt(par0); ++ } ++ ++ /** ++ * Returns the greatest integer less than or equal to the float argument ++ */ ++ public static int floor_float(float par0) { ++ int var1 = (int)par0; ++ return par0 < (float)var1 ? var1 - 1 : var1; ++ } ++ ++ /** ++ * returns par0 cast as an int, and no greater than Integer.MAX_VALUE-1024 ++ */ ++ public static int truncateDoubleToInt(double par0) { ++ return (int)(par0 + 1024.0D) - 1024; ++ } ++ ++ /** ++ * Returns the greatest integer less than or equal to the double argument ++ */ ++ public static int floor_double(double par0) { ++ int var2 = (int)par0; ++ return par0 < (double)var2 ? var2 - 1 : var2; ++ } ++ ++ /** ++ * Long version of floor_double ++ */ ++ public static long floor_double_long(double par0) { ++ long var2 = (long)par0; ++ return par0 < (double)var2 ? var2 - 1L : var2; ++ } ++ ++ public static float abs(float par0) { ++ return par0 >= 0.0F ? par0 : -par0; ++ } ++ ++ /** ++ * Returns the unsigned value of an int. ++ */ ++ public static int abs_int(int par0) { ++ return par0 >= 0 ? par0 : -par0; ++ } ++ ++ public static int ceiling_float_int(float par0) { ++ int var1 = (int)par0; ++ return par0 > (float)var1 ? var1 + 1 : var1; ++ } ++ ++ public static int ceiling_double_int(double par0) { ++ int var2 = (int)par0; ++ return par0 > (double)var2 ? var2 + 1 : var2; ++ } ++ ++ /** ++ * Returns the value of the first parameter, clamped to be within the lower and upper limits given by the second and ++ * third parameters. ++ */ ++ public static int clamp_int(int par0, int par1, int par2) { ++ return par0 < par1 ? par1 : (par0 > par2 ? par2 : par0); ++ } ++ ++ /** ++ * Returns the value of the first parameter, clamped to be within the lower and upper limits given by the second and ++ * third parameters ++ */ ++ public static float clamp_float(float par0, float par1, float par2) { ++ return par0 < par1 ? par1 : (par0 > par2 ? par2 : par0); ++ } ++ ++ /** ++ * Maximum of the absolute value of two numbers. ++ */ ++ public static double abs_max(double par0, double par2) { ++ if (par0 < 0.0D) { ++ par0 = -par0; ++ } ++ ++ if (par2 < 0.0D) { ++ par2 = -par2; ++ } ++ ++ return par0 > par2 ? par0 : par2; ++ } ++ ++ /** ++ * Buckets an integer with specifed bucket sizes. Args: i, bucketSize ++ */ ++ public static int bucketInt(int par0, int par1) { ++ return par0 < 0 ? -((-par0 - 1) / par1) - 1 : par0 / par1; ++ } ++ ++ /** ++ * Tests if a string is null or of length zero ++ */ ++ public static boolean stringNullOrLengthZero(String par0Str) { ++ return par0Str == null || par0Str.length() == 0; ++ } ++ ++ public static int getRandomIntegerInRange(Random par0Random, int par1, int par2) { ++ return par1 >= par2 ? par1 : par0Random.nextInt(par2 - par1 + 1) + par1; ++ } ++ ++ public static double getRandomDoubleInRange(Random par0Random, double par1, double par3) { ++ return par1 >= par3 ? par1 : par0Random.nextDouble() * (par3 - par1) + par1; ++ } ++ ++ public static double average(long[] par0ArrayOfLong) { + long var1 = 0L; +- long[] var3 = var0; +- int var4 = var0.length; ++ long[] var3 = par0ArrayOfLong; ++ int var4 = par0ArrayOfLong.length; + +- for(int var5 = 0; var5 < var4; ++var5) { ++ for (int var5 = 0; var5 < var4; ++var5) { + long var6 = var3[var5]; + var1 += var6; + } + +- return (double)var1 / (double)var0.length; +- } +- +- public static float wrapAngleTo180_float(float var0) { +- var0 %= 360.0F; +- if(var0 >= 180.0F) { +- var0 -= 360.0F; +- } +- +- if(var0 < -180.0F) { +- var0 += 360.0F; +- } +- +- return var0; +- } +- +- public static double wrapAngleTo180_double(double var0) { +- var0 %= 360.0D; +- if(var0 >= 180.0D) { +- var0 -= 360.0D; +- } +- +- if(var0 < -180.0D) { +- var0 += 360.0D; +- } +- +- return var0; +- } +- +- public static int parseIntWithDefault(String var0, int var1) { +- int var2 = var1; ++ return (double)var1 / (double)par0ArrayOfLong.length; ++ } ++ ++ /** ++ * the angle is reduced to an angle between -180 and +180 by mod, and a 360 check ++ */ ++ public static float wrapAngleTo180_float(float par0) { ++ par0 %= 360.0F; ++ ++ if (par0 >= 180.0F) { ++ par0 -= 360.0F; ++ } ++ ++ if (par0 < -180.0F) { ++ par0 += 360.0F; ++ } ++ ++ return par0; ++ } ++ ++ /** ++ * the angle is reduced to an angle between -180 and +180 by mod, and a 360 check ++ */ ++ public static double wrapAngleTo180_double(double par0) { ++ par0 %= 360.0D; ++ ++ if (par0 >= 180.0D) { ++ par0 -= 360.0D; ++ } ++ ++ if (par0 < -180.0D) { ++ par0 += 360.0D; ++ } ++ ++ return par0; ++ } ++ ++ /** ++ * parses the string as integer or returns the second parameter if it fails ++ */ ++ public static int parseIntWithDefault(String par0Str, int par1) { ++ int var2 = par1; + + try { +- var2 = Integer.parseInt(var0); ++ var2 = Integer.parseInt(par0Str); + } catch (Throwable var4) { ++ ; + } + + return var2; + } + +- public static int parseIntWithDefaultAndMax(String var0, int var1, int var2) { +- int var3 = var1; ++ /** ++ * parses the string as integer or returns the second parameter if it fails. this value is capped to par2 ++ */ ++ public static int parseIntWithDefaultAndMax(String par0Str, int par1, int par2) { ++ int var3 = par1; + + try { +- var3 = Integer.parseInt(var0); ++ var3 = Integer.parseInt(par0Str); + } catch (Throwable var5) { ++ ; + } + +- if(var3 < var2) { +- var3 = var2; ++ if (var3 < par2) { ++ var3 = par2; + } + + return var3; + } + +- public static double parseDoubleWithDefault(String var0, double var1) { +- double var3 = var1; ++ /** ++ * parses the string as double or returns the second parameter if it fails. ++ */ ++ public static double parseDoubleWithDefault(String par0Str, double par1) { ++ double var3 = par1; + + try { +- var3 = Double.parseDouble(var0); ++ var3 = Double.parseDouble(par0Str); + } catch (Throwable var6) { ++ ; + } + + return var3; + } + +- public static double func_82713_a(String var0, double var1, double var3) { +- double var5 = var1; ++ public static double func_82713_a(String par0Str, double par1, double par3) { ++ double var5 = par1; + + try { +- var5 = Double.parseDouble(var0); ++ var5 = Double.parseDouble(par0Str); + } catch (Throwable var8) { ++ ; + } + +- if(var5 < var3) { +- var5 = var3; ++ if (var5 < par3) { ++ var5 = par3; + } + + return var5; + } + + static { +- for(int var0 = 0; var0 < 65536; ++var0) { ++ for (int var0 = 0; var0 < 65536; ++var0) { + SIN_TABLE[var0] = (float)Math.sin((double)var0 * Math.PI * 2.0D / 65536.0D); + } +- + } + } diff --git a/patches/net/minecraft/src/McoClient.java.patch b/patches/net/minecraft/src/McoClient.java.patch new file mode 100644 index 0000000..b165548 --- /dev/null +++ b/patches/net/minecraft/src/McoClient.java.patch @@ -0,0 +1,315 @@ +--- net/minecraft/src/McoClient.java ++++ net/minecraft/src/McoClient.java +@@ -8,51 +8,54 @@ + import java.util.Map.Entry; + + public class McoClient { +- private final String a; +- private final String b; +- private static String c = "https://mcoapi.minecraft.net/"; ++ private final String field_96390_a; ++ private final String field_100007_c; ++ private static String field_96388_b = "https://mcoapi.minecraft.net/"; + +- public McoClient(Session var1) { +- this.a = var1.getSessionID(); +- this.b = var1.getUsername(); ++ public McoClient(Session par1Session) { ++ this.field_96390_a = par1Session.getSessionID(); ++ this.field_100007_c = par1Session.getUsername(); + } + +- public ValueObjectList func_96382_a() throws IOException, ExceptionMcoService { +- String var1 = this.func_96377_a(Request.func_96358_a(c + "worlds")); ++ public ValueObjectList func_96382_a() throws ExceptionMcoService, IOException { ++ String var1 = this.func_96377_a(Request.func_96358_a(field_96388_b + "worlds")); + return ValueObjectList.func_98161_a(var1); + } + +- public McoServer func_98176_a(long var1) throws IOException, ExceptionMcoService { +- String var3 = this.func_96377_a(Request.func_96358_a(c + "worlds" + "/$ID".replace("$ID", String.valueOf(var1)))); ++ public McoServer func_98176_a(long par1) throws ExceptionMcoService, IOException { ++ String var3 = this.func_96377_a(Request.func_96358_a(field_96388_b + "worlds" + "/$ID".replace("$ID", String.valueOf(par1)))); + return McoServer.func_98165_c(var3); + } + +- public McoServerAddress func_96374_a(long var1) throws IOException, ExceptionMcoService { +- String var3 = c + "worlds" + "/$ID/join".replace("$ID", "" + var1); ++ public McoServerAddress func_96374_a(long par1) throws ExceptionMcoService, IOException { ++ String var3 = field_96388_b + "worlds" + "/$ID/join".replace("$ID", "" + par1); + String var4 = this.func_96377_a(Request.func_96358_a(var3)); + return McoServerAddress.func_98162_a(var4); + } + +- public void func_96386_a(String var1, String var2, String var3, String var4) throws UnsupportedEncodingException, ExceptionMcoService { ++ public void func_96386_a(String par1Str, String par2Str, String par3Str, String par4Str) throws ExceptionMcoService, UnsupportedEncodingException { + StringBuilder var5 = new StringBuilder(); +- var5.append(c).append("worlds").append("/$NAME/$LOCATION_ID".replace("$NAME", this.func_96380_a(var1))); ++ var5.append(field_96388_b).append("worlds").append("/$NAME/$LOCATION_ID".replace("$NAME", this.func_96380_a(par1Str))); + HashMap var6 = new HashMap(); +- if(var2 != null && !var2.trim().equals("")) { +- var6.put("motd", var2); +- } +- +- if(var3 != null && !var3.equals("")) { +- var6.put("seed", var3); +- } +- +- var6.put("template", var4); +- if(!var6.isEmpty()) { ++ ++ if (par2Str != null && !par2Str.trim().equals("")) { ++ var6.put("motd", par2Str); ++ } ++ ++ if (par3Str != null && !par3Str.equals("")) { ++ var6.put("seed", par3Str); ++ } ++ ++ var6.put("template", par4Str); ++ ++ if (!var6.isEmpty()) { + boolean var7 = true; +- + Entry var9; +- for(Iterator var8 = var6.entrySet().iterator(); var8.hasNext(); var5.append((String)var9.getKey()).append("=").append(this.func_96380_a((String)var9.getValue()))) { ++ ++ for (Iterator var8 = var6.entrySet().iterator(); var8.hasNext(); var5.append((String)var9.getKey()).append("=").append(this.func_96380_a((String)var9.getValue()))) { + var9 = (Entry)var8.next(); +- if(var7) { ++ ++ if (var7) { + var5.append("?"); + var7 = false; + } else { +@@ -64,145 +67,149 @@ + this.func_96377_a(Request.func_104064_a(var5.toString(), "", 5000, 30000)); + } + +- public Boolean func_96375_b() throws IOException, ExceptionMcoService { +- String var1 = c + "mco" + "/available"; ++ public Boolean func_96375_b() throws ExceptionMcoService, IOException { ++ String var1 = field_96388_b + "mco" + "/available"; + String var2 = this.func_96377_a(Request.func_96358_a(var1)); + return Boolean.valueOf(var2); + } + +- public Boolean func_140054_c() throws IOException, ExceptionMcoService { +- String var1 = c + "mco" + "/client/outdated"; ++ public Boolean func_140054_c() throws ExceptionMcoService, IOException { ++ String var1 = field_96388_b + "mco" + "/client/outdated"; + String var2 = this.func_96377_a(Request.func_96358_a(var1)); + return Boolean.valueOf(var2); + } + + public int func_96379_c() throws ExceptionMcoService { +- String var1 = c + "payments" + "/unused"; ++ String var1 = field_96388_b + "payments" + "/unused"; + String var2 = this.func_96377_a(Request.func_96358_a(var1)); + return Integer.valueOf(var2).intValue(); + } + +- public void func_96381_a(long var1, String var3) throws ExceptionMcoService { +- String var4 = c + "invites" + "/$WORLD_ID/invite/$USER_NAME".replace("$WORLD_ID", String.valueOf(var1)).replace("$USER_NAME", var3); ++ public void func_96381_a(long par1, String par3Str) throws ExceptionMcoService { ++ String var4 = field_96388_b + "invites" + "/$WORLD_ID/invite/$USER_NAME".replace("$WORLD_ID", String.valueOf(par1)).replace("$USER_NAME", par3Str); + this.func_96377_a(Request.func_96355_b(var4)); + } + +- public void func_140055_c(long var1) throws ExceptionMcoService { +- String var3 = c + "invites" + "/$WORLD_ID".replace("$WORLD_ID", String.valueOf(var1)); ++ public void func_140055_c(long par1) throws ExceptionMcoService { ++ String var3 = field_96388_b + "invites" + "/$WORLD_ID".replace("$WORLD_ID", String.valueOf(par1)); + this.func_96377_a(Request.func_96355_b(var3)); + } + +- public McoServer func_96387_b(long var1, String var3) throws IOException, ExceptionMcoService { +- String var4 = c + "invites" + "/$WORLD_ID/invite/$USER_NAME".replace("$WORLD_ID", String.valueOf(var1)).replace("$USER_NAME", var3); ++ public McoServer func_96387_b(long par1, String par3Str) throws ExceptionMcoService, IOException { ++ String var4 = field_96388_b + "invites" + "/$WORLD_ID/invite/$USER_NAME".replace("$WORLD_ID", String.valueOf(par1)).replace("$USER_NAME", par3Str); + String var5 = this.func_96377_a(Request.func_96361_b(var4, "")); + return McoServer.func_98165_c(var5); + } + +- public BackupList func_111232_c(long var1) throws ExceptionMcoService { +- String var3 = c + "worlds" + "/$WORLD_ID/backups".replace("$WORLD_ID", String.valueOf(var1)); ++ public BackupList func_111232_c(long par1) throws ExceptionMcoService { ++ String var3 = field_96388_b + "worlds" + "/$WORLD_ID/backups".replace("$WORLD_ID", String.valueOf(par1)); + String var4 = this.func_96377_a(Request.func_96358_a(var3)); + return BackupList.func_111222_a(var4); + } + +- public void func_96384_a(long var1, String var3, String var4, int var5, int var6) throws UnsupportedEncodingException, ExceptionMcoService { ++ public void func_96384_a(long par1, String par3Str, String par4Str, int par5, int par6) throws ExceptionMcoService, UnsupportedEncodingException { + StringBuilder var7 = new StringBuilder(); +- var7.append(c).append("worlds").append("/$WORLD_ID/$NAME".replace("$WORLD_ID", String.valueOf(var1)).replace("$NAME", this.func_96380_a(var3))); +- if(var4 != null && !var4.trim().equals("")) { +- var7.append("?motd=").append(this.func_96380_a(var4)); ++ var7.append(field_96388_b).append("worlds").append("/$WORLD_ID/$NAME".replace("$WORLD_ID", String.valueOf(par1)).replace("$NAME", this.func_96380_a(par3Str))); ++ ++ if (par4Str != null && !par4Str.trim().equals("")) { ++ var7.append("?motd=").append(this.func_96380_a(par4Str)); + } else { + var7.append("?motd="); + } + +- var7.append("&difficulty=").append(var5).append("&gameMode=").append(var6); ++ var7.append("&difficulty=").append(par5).append("&gameMode=").append(par6); + this.func_96377_a(Request.func_96363_c(var7.toString(), "")); + } + +- public void func_111235_c(long var1, String var3) throws ExceptionMcoService { +- String var4 = c + "worlds" + "/$WORLD_ID/backups".replace("$WORLD_ID", String.valueOf(var1)) + "?backupId=" + var3; ++ public void func_111235_c(long par1, String par3Str) throws ExceptionMcoService { ++ String var4 = field_96388_b + "worlds" + "/$WORLD_ID/backups".replace("$WORLD_ID", String.valueOf(par1)) + "?backupId=" + par3Str; + this.func_96377_a(Request.func_96363_c(var4, "")); + } + + public WorldTemplateList func_111231_d() throws ExceptionMcoService { +- String var1 = c + "worlds" + "/templates"; ++ String var1 = field_96388_b + "worlds" + "/templates"; + String var2 = this.func_96377_a(Request.func_96358_a(var1)); + return WorldTemplateList.func_110735_a(var2); + } + +- public Boolean func_96383_b(long var1) throws IOException, ExceptionMcoService { +- String var3 = c + "worlds" + "/$WORLD_ID/open".replace("$WORLD_ID", String.valueOf(var1)); +- String var4 = this.func_96377_a(Request.func_96363_c(var3, "")); +- return Boolean.valueOf(var4); +- } +- +- public Boolean func_96378_c(long var1) throws IOException, ExceptionMcoService { +- String var3 = c + "worlds" + "/$WORLD_ID/close".replace("$WORLD_ID", String.valueOf(var1)); +- String var4 = this.func_96377_a(Request.func_96363_c(var3, "")); +- return Boolean.valueOf(var4); +- } +- +- public Boolean func_96376_d(long var1, String var3) throws UnsupportedEncodingException, ExceptionMcoService { +- StringBuilder var4 = new StringBuilder(); +- var4.append(c).append("worlds").append("/$WORLD_ID/reset".replace("$WORLD_ID", String.valueOf(var1))); +- if(var3 != null && var3.length() > 0) { +- var4.append("?seed=").append(this.func_96380_a(var3)); +- } +- +- String var5 = this.func_96377_a(Request.func_96353_a(var4.toString(), "", 30000, 80000)); +- return Boolean.valueOf(var5); +- } +- +- public Boolean func_111233_e(long var1, String var3) throws ExceptionMcoService { +- StringBuilder var4 = new StringBuilder(); +- var4.append(c).append("worlds").append("/$WORLD_ID/reset".replace("$WORLD_ID", String.valueOf(var1))); +- if(var3 != null) { +- var4.append("?template=").append(var3); +- } +- +- String var5 = this.func_96377_a(Request.func_96353_a(var4.toString(), "", 30000, 80000)); +- return Boolean.valueOf(var5); +- } +- +- public ValueObjectSubscription func_98177_f(long var1) throws IOException, ExceptionMcoService { +- String var3 = this.func_96377_a(Request.func_96358_a(c + "subscriptions" + "/$WORLD_ID".replace("$WORLD_ID", String.valueOf(var1)))); ++ public Boolean func_96383_b(long par1) throws ExceptionMcoService, IOException { ++ String var3 = field_96388_b + "worlds" + "/$WORLD_ID/open".replace("$WORLD_ID", String.valueOf(par1)); ++ String var4 = this.func_96377_a(Request.func_96363_c(var3, "")); ++ return Boolean.valueOf(var4); ++ } ++ ++ public Boolean func_96378_c(long par1) throws ExceptionMcoService, IOException { ++ String var3 = field_96388_b + "worlds" + "/$WORLD_ID/close".replace("$WORLD_ID", String.valueOf(par1)); ++ String var4 = this.func_96377_a(Request.func_96363_c(var3, "")); ++ return Boolean.valueOf(var4); ++ } ++ ++ public Boolean func_96376_d(long par1, String par3Str) throws ExceptionMcoService, UnsupportedEncodingException { ++ StringBuilder var4 = new StringBuilder(); ++ var4.append(field_96388_b).append("worlds").append("/$WORLD_ID/reset".replace("$WORLD_ID", String.valueOf(par1))); ++ ++ if (par3Str != null && par3Str.length() > 0) { ++ var4.append("?seed=").append(this.func_96380_a(par3Str)); ++ } ++ ++ String var5 = this.func_96377_a(Request.func_96353_a(var4.toString(), "", 30000, 80000)); ++ return Boolean.valueOf(var5); ++ } ++ ++ public Boolean func_111233_e(long par1, String par3Str) throws ExceptionMcoService { ++ StringBuilder var4 = new StringBuilder(); ++ var4.append(field_96388_b).append("worlds").append("/$WORLD_ID/reset".replace("$WORLD_ID", String.valueOf(par1))); ++ ++ if (par3Str != null) { ++ var4.append("?template=").append(par3Str); ++ } ++ ++ String var5 = this.func_96377_a(Request.func_96353_a(var4.toString(), "", 30000, 80000)); ++ return Boolean.valueOf(var5); ++ } ++ ++ public ValueObjectSubscription func_98177_f(long par1) throws ExceptionMcoService, IOException { ++ String var3 = this.func_96377_a(Request.func_96358_a(field_96388_b + "subscriptions" + "/$WORLD_ID".replace("$WORLD_ID", String.valueOf(par1)))); + return ValueObjectSubscription.func_98169_a(var3); + } + + public int func_130106_e() throws ExceptionMcoService { +- String var1 = this.func_96377_a(Request.func_96358_a(c + "invites" + "/count/pending")); ++ String var1 = this.func_96377_a(Request.func_96358_a(field_96388_b + "invites" + "/count/pending")); + return Integer.parseInt(var1); + } + + public PendingInvitesList func_130108_f() throws ExceptionMcoService { +- String var1 = this.func_96377_a(Request.func_96358_a(c + "invites" + "/pending")); ++ String var1 = this.func_96377_a(Request.func_96358_a(field_96388_b + "invites" + "/pending")); + return PendingInvitesList.func_130095_a(var1); + } + +- public void func_130107_a(String var1) throws ExceptionMcoService { +- this.func_96377_a(Request.func_96363_c(c + "invites" + "/accept/$INVITATION_ID".replace("$INVITATION_ID", var1), "")); +- } +- +- public void func_130109_b(String var1) throws ExceptionMcoService { +- this.func_96377_a(Request.func_96363_c(c + "invites" + "/reject/$INVITATION_ID".replace("$INVITATION_ID", var1), "")); +- } +- +- private String func_96380_a(String var1) throws UnsupportedEncodingException { +- return URLEncoder.encode(var1, "UTF-8"); +- } +- +- private String func_96377_a(Request var1) throws ExceptionMcoService { +- var1.func_100006_a("sid", this.a); +- var1.func_100006_a("user", this.b); +- var1.func_100006_a("version", "1.6.4"); ++ public void func_130107_a(String par1Str) throws ExceptionMcoService { ++ this.func_96377_a(Request.func_96363_c(field_96388_b + "invites" + "/accept/$INVITATION_ID".replace("$INVITATION_ID", par1Str), "")); ++ } ++ ++ public void func_130109_b(String par1Str) throws ExceptionMcoService { ++ this.func_96377_a(Request.func_96363_c(field_96388_b + "invites" + "/reject/$INVITATION_ID".replace("$INVITATION_ID", par1Str), "")); ++ } ++ ++ private String func_96380_a(String par1Str) throws UnsupportedEncodingException { ++ return URLEncoder.encode(par1Str, "UTF-8"); ++ } ++ ++ private String func_96377_a(Request par1Request) throws ExceptionMcoService { ++ par1Request.func_100006_a("sid", this.field_96390_a); ++ par1Request.func_100006_a("user", this.field_100007_c); ++ par1Request.func_100006_a("version", "1.6.4"); + + try { +- int var2 = var1.func_96362_a(); +- if(var2 == 503) { +- int var3 = var1.func_111221_b(); ++ int var2 = par1Request.func_96362_a(); ++ ++ if (var2 == 503) { ++ int var3 = par1Request.func_111221_b(); + throw new ExceptionRetryCall(var3); +- } else if(var2 >= 200 && var2 < 300) { +- return var1.func_96364_c(); ++ } else if (var2 >= 200 && var2 < 300) { ++ return par1Request.func_96364_c(); + } else { +- throw new ExceptionMcoService(var1.func_96362_a(), var1.func_96364_c(), var1.func_130110_g()); ++ throw new ExceptionMcoService(par1Request.func_96362_a(), par1Request.func_96364_c(), par1Request.func_130110_g()); + } + } catch (ExceptionMcoHttp var4) { + throw new ExceptionMcoService(500, "Server not available!", -1); diff --git a/patches/net/minecraft/src/McoServer.java.patch b/patches/net/minecraft/src/McoServer.java.patch new file mode 100644 index 0000000..dff5d21 --- /dev/null +++ b/patches/net/minecraft/src/McoServer.java.patch @@ -0,0 +1,199 @@ +--- net/minecraft/src/McoServer.java ++++ net/minecraft/src/McoServer.java +@@ -13,97 +13,100 @@ + + public class McoServer { + public long field_96408_a; +- public String b; +- public String c; +- public String d; +- public String e; +- public List f; +- public String g; ++ public String field_96406_b; ++ public String field_96407_c; ++ public String field_96404_d; ++ public String field_96405_e; ++ public List field_96402_f; ++ public String field_96403_g; + public boolean field_98166_h; + public int field_110729_i; + public int field_110728_j; + public int field_104063_i; + public int field_96415_h; +- public String m = ""; ++ public String field_96414_k = ""; + public boolean field_96411_l; + public boolean field_102022_m; + public long field_96412_m; +- private String q; +- private String r; ++ private String field_96409_n; ++ private String field_96410_o; + + public String func_96397_a() { +- if(this.q == null) { ++ if (this.field_96409_n == null) { + try { +- this.q = URLDecoder.decode(this.c, "UTF-8"); ++ this.field_96409_n = URLDecoder.decode(this.field_96407_c, "UTF-8"); + } catch (UnsupportedEncodingException var2) { +- this.q = this.c; ++ this.field_96409_n = this.field_96407_c; + } + } + +- return this.q; ++ return this.field_96409_n; + } + + public String func_96398_b() { +- if(this.r == null) { ++ if (this.field_96410_o == null) { + try { +- this.r = URLDecoder.decode(this.b, "UTF-8"); ++ this.field_96410_o = URLDecoder.decode(this.field_96406_b, "UTF-8"); + } catch (UnsupportedEncodingException var2) { +- this.r = this.b; ++ this.field_96410_o = this.field_96406_b; + } + } + +- return this.r; +- } +- +- public void func_96399_a(String var1) { +- this.b = var1; +- this.r = null; +- } +- +- public void func_96400_b(String var1) { +- this.c = var1; +- this.q = null; +- } +- +- public void func_96401_a(McoServer var1) { +- this.m = var1.m; +- this.field_96412_m = var1.field_96412_m; +- this.field_96411_l = var1.field_96411_l; +- this.field_96415_h = var1.field_96415_h; ++ return this.field_96410_o; ++ } ++ ++ public void func_96399_a(String par1Str) { ++ this.field_96406_b = par1Str; ++ this.field_96410_o = null; ++ } ++ ++ public void func_96400_b(String par1Str) { ++ this.field_96407_c = par1Str; ++ this.field_96409_n = null; ++ } ++ ++ public void func_96401_a(McoServer par1McoServer) { ++ this.field_96414_k = par1McoServer.field_96414_k; ++ this.field_96412_m = par1McoServer.field_96412_m; ++ this.field_96411_l = par1McoServer.field_96411_l; ++ this.field_96415_h = par1McoServer.field_96415_h; + this.field_102022_m = true; + } + +- public static McoServer func_98163_a(JsonNode var0) { ++ public static McoServer func_98163_a(JsonNode par0JsonNode) { + McoServer var1 = new McoServer(); + + try { +- var1.field_96408_a = Long.parseLong(var0.getNumberValue(new Object[]{"id"})); +- var1.b = var0.getStringValue(new Object[]{"name"}); +- var1.c = var0.getStringValue(new Object[]{"motd"}); +- var1.d = var0.getStringValue(new Object[]{"state"}); +- var1.e = var0.getStringValue(new Object[]{"owner"}); +- if(var0.isArrayNode(new Object[]{"invited"})) { +- var1.f = func_98164_a(var0.getArrayNode(new Object[]{"invited"})); +- } else { +- var1.f = new ArrayList(); +- } +- +- var1.field_104063_i = Integer.parseInt(var0.getNumberValue(new Object[]{"daysLeft"})); +- var1.g = var0.getStringValue(new Object[]{"ip"}); +- var1.field_98166_h = var0.getBooleanValue(new Object[]{"expired"}).booleanValue(); +- var1.field_110729_i = Integer.parseInt(var0.getNumberValue(new Object[]{"difficulty"})); +- var1.field_110728_j = Integer.parseInt(var0.getNumberValue(new Object[]{"gameMode"})); ++ var1.field_96408_a = Long.parseLong(par0JsonNode.getNumberValue(new Object[] {"id"})); ++ var1.field_96406_b = par0JsonNode.getStringValue(new Object[] {"name"}); ++ var1.field_96407_c = par0JsonNode.getStringValue(new Object[] {"motd"}); ++ var1.field_96404_d = par0JsonNode.getStringValue(new Object[] {"state"}); ++ var1.field_96405_e = par0JsonNode.getStringValue(new Object[] {"owner"}); ++ ++ if (par0JsonNode.isArrayNode(new Object[] {"invited"})) { ++ var1.field_96402_f = func_98164_a(par0JsonNode.getArrayNode(new Object[] {"invited"})); ++ } ++ else { ++ var1.field_96402_f = new ArrayList(); ++ } ++ ++ var1.field_104063_i = Integer.parseInt(par0JsonNode.getNumberValue(new Object[] {"daysLeft"})); ++ var1.field_96403_g = par0JsonNode.getStringValue(new Object[] {"ip"}); ++ var1.field_98166_h = par0JsonNode.getBooleanValue(new Object[] {"expired"}).booleanValue(); ++ var1.field_110729_i = Integer.parseInt(par0JsonNode.getNumberValue(new Object[] {"difficulty"})); ++ var1.field_110728_j = Integer.parseInt(par0JsonNode.getNumberValue(new Object[] {"gameMode"})); + } catch (IllegalArgumentException var3) { ++ ; + } + + return var1; + } + +- private static List func_98164_a(List var0) { ++ private static List func_98164_a(List par0List) { + ArrayList var1 = new ArrayList(); +- Iterator var2 = var0.iterator(); ++ Iterator var2 = par0List.iterator(); + +- while(var2.hasNext()) { ++ while (var2.hasNext()) { + JsonNode var3 = (JsonNode)var2.next(); + var1.add(var3.getStringValue(new Object[0])); + } +@@ -111,31 +114,32 @@ + return var1; + } + +- public static McoServer func_98165_c(String var0) { ++ public static McoServer func_98165_c(String par0Str) { + McoServer var1 = new McoServer(); + + try { +- var1 = func_98163_a((new JdomParser()).parse(var0)); ++ var1 = func_98163_a((new JdomParser()).parse(par0Str)); + } catch (InvalidSyntaxException var3) { ++ ; + } + + return var1; + } + + public int hashCode() { +- return (new HashCodeBuilder(17, 37)).append(this.field_96408_a).append((Object)this.b).append((Object)this.c).append((Object)this.d).append((Object)this.e).append(this.field_98166_h).toHashCode(); ++ return (new HashCodeBuilder(17, 37)).append(this.field_96408_a).append(this.field_96406_b).append(this.field_96407_c).append(this.field_96404_d).append(this.field_96405_e).append(this.field_98166_h).toHashCode(); + } + +- public boolean equals(Object var1) { +- if(var1 == null) { ++ public boolean equals(Object par1Obj) { ++ if (par1Obj == null) { + return false; +- } else if(var1 == this) { ++ } else if (par1Obj == this) { + return true; +- } else if(var1.getClass() != this.getClass()) { ++ } else if (par1Obj.getClass() != this.getClass()) { + return false; + } else { +- McoServer var2 = (McoServer)var1; +- return (new EqualsBuilder()).append(this.field_96408_a, var2.field_96408_a).append((Object)this.b, (Object)var2.b).append((Object)this.c, (Object)var2.c).append((Object)this.d, (Object)var2.d).append((Object)this.e, (Object)var2.e).append(this.field_98166_h, var2.field_98166_h).isEquals(); ++ McoServer var2 = (McoServer)par1Obj; ++ return (new EqualsBuilder()).append(this.field_96408_a, var2.field_96408_a).append(this.field_96406_b, var2.field_96406_b).append(this.field_96407_c, var2.field_96407_c).append(this.field_96404_d, var2.field_96404_d).append(this.field_96405_e, var2.field_96405_e).append(this.field_98166_h, var2.field_98166_h).isEquals(); + } + } + } diff --git a/patches/net/minecraft/src/McoServerAddress.java.patch b/patches/net/minecraft/src/McoServerAddress.java.patch new file mode 100644 index 0000000..9c01ca4 --- /dev/null +++ b/patches/net/minecraft/src/McoServerAddress.java.patch @@ -0,0 +1,25 @@ +--- net/minecraft/src/McoServerAddress.java ++++ net/minecraft/src/McoServerAddress.java +@@ -5,16 +5,18 @@ + import argo.saj.InvalidSyntaxException; + + public class McoServerAddress extends ValueObject { +- public String a; ++ public String field_96417_a; + +- public static McoServerAddress func_98162_a(String var0) { ++ public static McoServerAddress func_98162_a(String par0Str) { + McoServerAddress var1 = new McoServerAddress(); + + try { +- JsonRootNode var2 = (new JdomParser()).parse(var0); +- var1.a = var2.getStringValue(new Object[]{"address"}); ++ JsonRootNode var2 = (new JdomParser()).parse(par0Str); ++ var1.field_96417_a = var2.getStringValue(new Object[] {"address"}); + } catch (InvalidSyntaxException var3) { ++ ; + } catch (IllegalArgumentException var4) { ++ ; + } + + return var1; diff --git a/patches/net/minecraft/src/McoServerList.java.patch b/patches/net/minecraft/src/McoServerList.java.patch new file mode 100644 index 0000000..97e4ad0 --- /dev/null +++ b/patches/net/minecraft/src/McoServerList.java.patch @@ -0,0 +1,141 @@ +--- net/minecraft/src/McoServerList.java ++++ net/minecraft/src/McoServerList.java +@@ -9,28 +9,28 @@ + public class McoServerList { + private volatile boolean field_98259_a; + private McoServerListUpdateTask field_98257_b = new McoServerListUpdateTask(this, (McoServerListEmptyAnon)null); +- private java.util.Timer c = new java.util.Timer(); +- private Set d = Sets.newHashSet(); +- private List e = Lists.newArrayList(); ++ private java.util.Timer field_98258_c = new java.util.Timer(); ++ private Set field_140060_d = Sets.newHashSet(); ++ private List field_98255_d = Lists.newArrayList(); + private int field_130130_e; + private boolean field_140059_g; + private Session field_98254_f; + private int field_140061_i; + + public McoServerList() { +- this.c.schedule(this.field_98257_b, 0L, 10000L); ++ this.field_98258_c.schedule(this.field_98257_b, 0L, 10000L); + this.field_98254_f = Minecraft.getMinecraft().getSession(); + } + +- public synchronized void func_130129_a(Session var1) { +- this.field_98254_f = var1; +- if(this.field_98259_a) { ++ public synchronized void func_130129_a(Session par1Session) { ++ this.field_98254_f = par1Session; ++ ++ if (this.field_98259_a) { + this.field_98259_a = false; + this.field_98257_b = new McoServerListUpdateTask(this, (McoServerListEmptyAnon)null); +- this.c = new java.util.Timer(); +- this.c.schedule(this.field_98257_b, 0L, 10000L); ++ this.field_98258_c = new java.util.Timer(); ++ this.field_98258_c.schedule(this.field_98257_b, 0L, 10000L); + } +- + } + + public synchronized boolean func_130127_a() { +@@ -42,7 +42,7 @@ + } + + public synchronized List func_98252_c() { +- return Lists.newArrayList((Iterable)this.e); ++ return Lists.newArrayList(this.field_98255_d); + } + + public int func_130124_d() { +@@ -56,54 +56,55 @@ + public synchronized void func_98248_d() { + this.field_98259_a = true; + this.field_98257_b.cancel(); +- this.c.cancel(); ++ this.field_98258_c.cancel(); + } + +- private synchronized void func_96426_a(List var1) { ++ private synchronized void func_96426_a(List par1List) { + int var2 = 0; +- Iterator var3 = this.d.iterator(); ++ Iterator var3 = this.field_140060_d.iterator(); + +- while(var3.hasNext()) { ++ while (var3.hasNext()) { + McoServer var4 = (McoServer)var3.next(); +- if(var1.remove(var4)) { ++ ++ if (par1List.remove(var4)) { + ++var2; + } + } + +- if(var2 == 0) { +- this.d.clear(); ++ if (var2 == 0) { ++ this.field_140060_d.clear(); + } + +- this.e = var1; ++ this.field_98255_d = par1List; + this.field_140059_g = true; + } + +- public synchronized void func_140058_a(McoServer var1) { +- this.e.remove(var1); +- this.d.add(var1); +- } +- +- private void func_130123_a(int var1) { +- this.field_130130_e = var1; +- } +- +- static boolean func_98249_b(McoServerList var0) { +- return var0.field_98259_a; +- } +- +- static Session func_100014_a(McoServerList var0) { +- return var0.field_98254_f; +- } +- +- static void func_98247_a(McoServerList var0, List var1) { +- var0.func_96426_a(var1); +- } +- +- static void func_130122_a(McoServerList var0, int var1) { +- var0.func_130123_a(var1); +- } +- +- static int func_140057_b(McoServerList var0, int var1) { +- return var0.field_140061_i = var1; ++ public synchronized void func_140058_a(McoServer par1McoServer) { ++ this.field_98255_d.remove(par1McoServer); ++ this.field_140060_d.add(par1McoServer); ++ } ++ ++ private void func_130123_a(int par1) { ++ this.field_130130_e = par1; ++ } ++ ++ static boolean func_98249_b(McoServerList par0McoServerList) { ++ return par0McoServerList.field_98259_a; ++ } ++ ++ static Session func_100014_a(McoServerList par0McoServerList) { ++ return par0McoServerList.field_98254_f; ++ } ++ ++ static void func_98247_a(McoServerList par0McoServerList, List par1List) { ++ par0McoServerList.func_96426_a(par1List); ++ } ++ ++ static void func_130122_a(McoServerList par0McoServerList, int par1) { ++ par0McoServerList.func_130123_a(par1); ++ } ++ ++ static int func_140057_b(McoServerList par0McoServerList, int par1) { ++ return par0McoServerList.field_140061_i = par1; + } + } diff --git a/patches/net/minecraft/src/McoServerListUpdateTask.java.patch b/patches/net/minecraft/src/McoServerListUpdateTask.java.patch new file mode 100644 index 0000000..6ca74d8 --- /dev/null +++ b/patches/net/minecraft/src/McoServerListUpdateTask.java.patch @@ -0,0 +1,88 @@ +--- net/minecraft/src/McoServerListUpdateTask.java ++++ net/minecraft/src/McoServerListUpdateTask.java +@@ -7,27 +7,28 @@ + + class McoServerListUpdateTask extends TimerTask { + private McoClient field_140066_b; ++ + final McoServerList field_140067_a; + +- private McoServerListUpdateTask(McoServerList var1) { +- this.field_140067_a = var1; ++ private McoServerListUpdateTask(McoServerList par1McoServerList) { ++ this.field_140067_a = par1McoServerList; + } + + public void run() { +- if(!McoServerList.func_98249_b(this.field_140067_a)) { ++ if (!McoServerList.func_98249_b(this.field_140067_a)) { + this.func_140064_c(); + this.func_140062_a(); + this.func_140063_b(); + } +- + } + + private void func_140062_a() { + try { +- if(McoServerList.func_100014_a(this.field_140067_a) != null) { ++ if (McoServerList.func_100014_a(this.field_140067_a) != null) { + this.field_140066_b = new McoClient(McoServerList.func_100014_a(this.field_140067_a)); +- List var1 = this.field_140066_b.func_96382_a().a; +- if(var1 != null) { ++ List var1 = this.field_140066_b.func_96382_a().field_96430_d; ++ ++ if (var1 != null) { + this.func_140065_a(var1); + McoServerList.func_98247_a(this.field_140067_a, var1); + } +@@ -37,24 +38,22 @@ + } catch (IOException var3) { + Minecraft.getMinecraft().getLogAgent().logWarning("Realms: could not parse response from server"); + } +- + } + + private void func_140063_b() { + try { +- if(McoServerList.func_100014_a(this.field_140067_a) != null) { ++ if (McoServerList.func_100014_a(this.field_140067_a) != null) { + int var1 = this.field_140066_b.func_130106_e(); + McoServerList.func_130122_a(this.field_140067_a, var1); + } + } catch (ExceptionMcoService var2) { + Minecraft.getMinecraft().getLogAgent().logSevere(var2.toString()); + } +- + } + + private void func_140064_c() { + try { +- if(McoServerList.func_100014_a(this.field_140067_a) != null) { ++ if (McoServerList.func_100014_a(this.field_140067_a) != null) { + McoClient var1 = new McoClient(McoServerList.func_100014_a(this.field_140067_a)); + McoServerList.func_140057_b(this.field_140067_a, var1.func_96379_c()); + } +@@ -62,14 +61,13 @@ + Minecraft.getMinecraft().getLogAgent().logSevere(var2.toString()); + McoServerList.func_140057_b(this.field_140067_a, 0); + } +- +- } +- +- private void func_140065_a(List var1) { +- Collections.sort(var1, new McoServerListUpdateTaskComparator(this, McoServerList.func_100014_a(this.field_140067_a).getUsername(), (McoServerListEmptyAnon)null)); +- } +- +- McoServerListUpdateTask(McoServerList var1, McoServerListEmptyAnon var2) { +- this(var1); ++ } ++ ++ private void func_140065_a(List par1List) { ++ Collections.sort(par1List, new McoServerListUpdateTaskComparator(this, McoServerList.func_100014_a(this.field_140067_a).getUsername(), (McoServerListEmptyAnon)null)); ++ } ++ ++ McoServerListUpdateTask(McoServerList par1McoServerList, McoServerListEmptyAnon par2McoServerListEmptyAnon) { ++ this(par1McoServerList); + } + } diff --git a/patches/net/minecraft/src/McoServerListUpdateTaskComparator.java.patch b/patches/net/minecraft/src/McoServerListUpdateTaskComparator.java.patch new file mode 100644 index 0000000..46b81df --- /dev/null +++ b/patches/net/minecraft/src/McoServerListUpdateTaskComparator.java.patch @@ -0,0 +1,62 @@ +--- net/minecraft/src/McoServerListUpdateTaskComparator.java ++++ net/minecraft/src/McoServerListUpdateTaskComparator.java +@@ -3,41 +3,42 @@ + import java.util.Comparator; + + class McoServerListUpdateTaskComparator implements Comparator { +- private final String b; ++ private final String field_140069_b; ++ + final McoServerListUpdateTask field_140070_a; + +- private McoServerListUpdateTaskComparator(McoServerListUpdateTask var1, String var2) { +- this.field_140070_a = var1; +- this.b = var2; ++ private McoServerListUpdateTaskComparator(McoServerListUpdateTask par1McoServerListUpdateTask, String par2Str) { ++ this.field_140070_a = par1McoServerListUpdateTask; ++ this.field_140069_b = par2Str; + } + +- public int func_140068_a(McoServer var1, McoServer var2) { +- if(var1.e.equals(var2.e)) { +- return var1.field_96408_a < var2.field_96408_a ? 1 : (var1.field_96408_a > var2.field_96408_a ? -1 : 0); +- } else if(var1.e.equals(this.b)) { ++ public int func_140068_a(McoServer par1McoServer, McoServer par2McoServer) { ++ if (par1McoServer.field_96405_e.equals(par2McoServer.field_96405_e)) { ++ return par1McoServer.field_96408_a < par2McoServer.field_96408_a ? 1 : (par1McoServer.field_96408_a > par2McoServer.field_96408_a ? -1 : 0); ++ } else if (par1McoServer.field_96405_e.equals(this.field_140069_b)) { + return -1; +- } else if(var2.e.equals(this.b)) { ++ } else if (par2McoServer.field_96405_e.equals(this.field_140069_b)) { + return 1; + } else { +- if(var1.d.equals("CLOSED") || var2.d.equals("CLOSED")) { +- if(var1.d.equals("CLOSED")) { ++ if (par1McoServer.field_96404_d.equals("CLOSED") || par2McoServer.field_96404_d.equals("CLOSED")) { ++ if (par1McoServer.field_96404_d.equals("CLOSED")) { + return 1; + } + +- if(var2.d.equals("CLOSED")) { ++ if (par2McoServer.field_96404_d.equals("CLOSED")) { + return 0; + } + } + +- return var1.field_96408_a < var2.field_96408_a ? 1 : (var1.field_96408_a > var2.field_96408_a ? -1 : 0); ++ return par1McoServer.field_96408_a < par2McoServer.field_96408_a ? 1 : (par1McoServer.field_96408_a > par2McoServer.field_96408_a ? -1 : 0); + } + } + +- public int compare(Object var1, Object var2) { +- return this.func_140068_a((McoServer)var1, (McoServer)var2); ++ public int compare(Object par1Obj, Object par2Obj) { ++ return this.func_140068_a((McoServer)par1Obj, (McoServer)par2Obj); + } + +- McoServerListUpdateTaskComparator(McoServerListUpdateTask var1, String var2, McoServerListEmptyAnon var3) { +- this(var1, var2); ++ McoServerListUpdateTaskComparator(McoServerListUpdateTask par1McoServerListUpdateTask, String par2Str, McoServerListEmptyAnon par3McoServerListEmptyAnon) { ++ this(par1McoServerListUpdateTask, par2Str); + } + } diff --git a/patches/net/minecraft/src/MemoryConnection.java.patch b/patches/net/minecraft/src/MemoryConnection.java.patch new file mode 100644 index 0000000..02cbce5 --- /dev/null +++ b/patches/net/minecraft/src/MemoryConnection.java.patch @@ -0,0 +1,175 @@ +--- net/minecraft/src/MemoryConnection.java ++++ net/minecraft/src/MemoryConnection.java +@@ -7,28 +7,36 @@ + import java.util.List; + + public class MemoryConnection implements INetworkManager { +- private static final SocketAddress a = new InetSocketAddress("127.0.0.1", 0); +- private final List b = Collections.synchronizedList(new ArrayList()); ++ private static final SocketAddress mySocketAddress = new InetSocketAddress("127.0.0.1", 0); ++ private final List readPacketCache = Collections.synchronizedList(new ArrayList()); + private final ILogAgent field_98214_c; + private MemoryConnection pairedConnection; + private NetHandler myNetHandler; ++ ++ /** set to true by {server,network}Shutdown */ + private boolean shuttingDown; +- private String g = ""; +- private Object[] h; ++ private String shutdownReason = ""; ++ private Object[] field_74439_g; + private boolean gamePaused; + +- public MemoryConnection(ILogAgent var1, NetHandler var2) { +- this.myNetHandler = var2; +- this.field_98214_c = var1; +- } +- +- public void setNetHandler(NetHandler var1) { +- this.myNetHandler = var1; +- } +- +- public void addToSendQueue(Packet var1) { +- if(!this.shuttingDown) { +- this.pairedConnection.processOrCachePacket(var1); ++ public MemoryConnection(ILogAgent par1ILogAgent, NetHandler par2NetHandler) { ++ this.myNetHandler = par2NetHandler; ++ this.field_98214_c = par1ILogAgent; ++ } ++ ++ /** ++ * Sets the NetHandler for this NetworkManager. Server-only. ++ */ ++ public void setNetHandler(NetHandler par1NetHandler) { ++ this.myNetHandler = par1NetHandler; ++ } ++ ++ /** ++ * Adds the packet to the correct send queue (chunk data packets go to a separate queue). ++ */ ++ public void addToSendQueue(Packet par1Packet) { ++ if (!this.shuttingDown) { ++ this.pairedConnection.processOrCachePacket(par1Packet); + } + } + +@@ -41,68 +49,87 @@ + return !this.shuttingDown && this.pairedConnection != null; + } + +- public void wakeThreads() { +- } ++ /** ++ * Wakes reader and writer threads ++ */ ++ public void wakeThreads() {} + ++ /** ++ * Checks timeouts and processes all pending read packets. ++ */ + public void processReadPackets() { + int var1 = 2500; + +- while(var1-- >= 0 && !this.b.isEmpty()) { +- Packet var2 = (Packet)this.b.remove(0); ++ while (var1-- >= 0 && !this.readPacketCache.isEmpty()) { ++ Packet var2 = (Packet)this.readPacketCache.remove(0); + var2.processPacket(this.myNetHandler); + } + +- if(this.b.size() > var1) { +- this.field_98214_c.logWarning("Memory connection overburdened; after processing 2500 packets, we still have " + this.b.size() + " to go!"); +- } +- +- if(this.shuttingDown && this.b.isEmpty()) { +- this.myNetHandler.handleErrorMessage(this.g, this.h); +- } +- +- } +- +- public SocketAddress getRemoteAddress() { +- return a; +- } +- ++ if (this.readPacketCache.size() > var1) { ++ this.field_98214_c.logWarning("Memory connection overburdened; after processing 2500 packets, we still have " + this.readPacketCache.size() + " to go!"); ++ } ++ ++ if (this.shuttingDown && this.readPacketCache.isEmpty()) { ++ this.myNetHandler.handleErrorMessage(this.shutdownReason, this.field_74439_g); ++ } ++ } ++ ++ /** ++ * Return the InetSocketAddress of the remote endpoint ++ */ ++ public SocketAddress getSocketAddress() { ++ return mySocketAddress; ++ } ++ ++ /** ++ * Shuts down the server. (Only actually used on the server) ++ */ + public void serverShutdown() { + this.shuttingDown = true; + } + +- public void networkShutdown(String var1, Object... var2) { ++ /** ++ * Shuts down the network with the specified reason. Closes all streams and sockets, spawns NetworkMasterThread to stop ++ * reading and writing threads. ++ */ ++ public void networkShutdown(String par1Str, Object ... par2ArrayOfObj) { + this.shuttingDown = true; +- this.g = var1; +- this.h = var2; ++ this.shutdownReason = par1Str; ++ this.field_74439_g = par2ArrayOfObj; + } + +- public int getNumChunkDataPackets() { ++ /** ++ * returns 0 for memoryConnections ++ */ ++ public int packetSize() { + return 0; + } + +- public void pairWith(MemoryConnection var1) { +- this.pairedConnection = var1; +- var1.pairedConnection = this; ++ public void pairWith(MemoryConnection par1MemoryConnection) { ++ this.pairedConnection = par1MemoryConnection; ++ par1MemoryConnection.pairedConnection = this; + } + + public boolean isGamePaused() { + return this.gamePaused; + } + +- public void setGamePaused(boolean var1) { +- this.gamePaused = var1; ++ public void setGamePaused(boolean par1) { ++ this.gamePaused = par1; + } + + public MemoryConnection getPairedConnection() { + return this.pairedConnection; + } + +- public void processOrCachePacket(Packet var1) { +- if(var1.canProcessAsync() && this.myNetHandler.canProcessPacketsAsync()) { +- var1.processPacket(this.myNetHandler); ++ /** ++ * acts immiditally if isWritePacket, otherwise adds it to the readCache to be processed next tick ++ */ ++ public void processOrCachePacket(Packet par1Packet) { ++ if (par1Packet.canProcessAsync() && this.myNetHandler.canProcessPacketsAsync()) { ++ par1Packet.processPacket(this.myNetHandler); + } else { +- this.b.add(var1); ++ this.readPacketCache.add(par1Packet); + } +- + } + } diff --git a/patches/net/minecraft/src/MerchantRecipe.java.patch b/patches/net/minecraft/src/MerchantRecipe.java.patch new file mode 100644 index 0000000..245f2dc --- /dev/null +++ b/patches/net/minecraft/src/MerchantRecipe.java.patch @@ -0,0 +1,163 @@ +--- net/minecraft/src/MerchantRecipe.java ++++ net/minecraft/src/MerchantRecipe.java +@@ -1,61 +1,91 @@ + package net.minecraft.src; + + public class MerchantRecipe { ++ ++ /** Item the Villager buys. */ + private ItemStack itemToBuy; ++ ++ /** Second Item the Villager buys. */ + private ItemStack secondItemToBuy; ++ ++ /** Item the Villager sells. */ + private ItemStack itemToSell; ++ ++ /** ++ * Saves how much has been tool used when put into to slot to be enchanted. ++ */ + private int toolUses; ++ ++ /** Maximum times this trade can be used. */ + private int maxTradeUses; + +- public MerchantRecipe(NBTTagCompound var1) { +- this.readFromTags(var1); ++ public MerchantRecipe(NBTTagCompound par1NBTTagCompound) { ++ this.readFromTags(par1NBTTagCompound); + } + +- public MerchantRecipe(ItemStack var1, ItemStack var2, ItemStack var3) { +- this.itemToBuy = var1; +- this.secondItemToBuy = var2; +- this.itemToSell = var3; ++ public MerchantRecipe(ItemStack par1ItemStack, ItemStack par2ItemStack, ItemStack par3ItemStack) { ++ this.itemToBuy = par1ItemStack; ++ this.secondItemToBuy = par2ItemStack; ++ this.itemToSell = par3ItemStack; + this.maxTradeUses = 7; + } + +- public MerchantRecipe(ItemStack var1, ItemStack var2) { +- this(var1, (ItemStack)null, var2); +- } +- +- public MerchantRecipe(ItemStack var1, Item var2) { +- this(var1, new ItemStack(var2)); +- } +- ++ public MerchantRecipe(ItemStack par1ItemStack, ItemStack par2ItemStack) { ++ this(par1ItemStack, (ItemStack)null, par2ItemStack); ++ } ++ ++ public MerchantRecipe(ItemStack par1ItemStack, Item par2Item) { ++ this(par1ItemStack, new ItemStack(par2Item)); ++ } ++ ++ /** ++ * Gets the itemToBuy. ++ */ + public ItemStack getItemToBuy() { + return this.itemToBuy; + } + ++ /** ++ * Gets secondItemToBuy. ++ */ + public ItemStack getSecondItemToBuy() { + return this.secondItemToBuy; + } + ++ /** ++ * Gets if Villager has secondItemToBuy. ++ */ + public boolean hasSecondItemToBuy() { + return this.secondItemToBuy != null; + } + ++ /** ++ * Gets itemToSell. ++ */ + public ItemStack getItemToSell() { + return this.itemToSell; + } + +- public boolean hasSameIDsAs(MerchantRecipe var1) { +- return this.itemToBuy.itemID == var1.itemToBuy.itemID && this.itemToSell.itemID == var1.itemToSell.itemID ? this.secondItemToBuy == null && var1.secondItemToBuy == null || this.secondItemToBuy != null && var1.secondItemToBuy != null && this.secondItemToBuy.itemID == var1.secondItemToBuy.itemID : false; ++ /** ++ * checks if both the first and second ItemToBuy IDs are the same ++ */ ++ public boolean hasSameIDsAs(MerchantRecipe par1MerchantRecipe) { ++ return this.itemToBuy.itemID == par1MerchantRecipe.itemToBuy.itemID && this.itemToSell.itemID == par1MerchantRecipe.itemToSell.itemID ? this.secondItemToBuy == null && par1MerchantRecipe.secondItemToBuy == null || this.secondItemToBuy != null && par1MerchantRecipe.secondItemToBuy != null && this.secondItemToBuy.itemID == par1MerchantRecipe.secondItemToBuy.itemID : false; + } + +- public boolean hasSameItemsAs(MerchantRecipe var1) { +- return this.hasSameIDsAs(var1) && (this.itemToBuy.stackSize < var1.itemToBuy.stackSize || this.secondItemToBuy != null && this.secondItemToBuy.stackSize < var1.secondItemToBuy.stackSize); ++ /** ++ * checks first and second ItemToBuy ID's and count. Calls hasSameIDs ++ */ ++ public boolean hasSameItemsAs(MerchantRecipe par1MerchantRecipe) { ++ return this.hasSameIDsAs(par1MerchantRecipe) && (this.itemToBuy.stackSize < par1MerchantRecipe.itemToBuy.stackSize || this.secondItemToBuy != null && this.secondItemToBuy.stackSize < par1MerchantRecipe.secondItemToBuy.stackSize); + } + + public void incrementToolUses() { + ++this.toolUses; + } + +- public void func_82783_a(int var1) { +- this.maxTradeUses += var1; ++ public void func_82783_a(int par1) { ++ this.maxTradeUses += par1; + } + + public boolean func_82784_g() { +@@ -66,32 +96,33 @@ + this.toolUses = this.maxTradeUses; + } + +- public void readFromTags(NBTTagCompound var1) { +- NBTTagCompound var2 = var1.getCompoundTag("buy"); ++ public void readFromTags(NBTTagCompound par1NBTTagCompound) { ++ NBTTagCompound var2 = par1NBTTagCompound.getCompoundTag("buy"); + this.itemToBuy = ItemStack.loadItemStackFromNBT(var2); +- NBTTagCompound var3 = var1.getCompoundTag("sell"); ++ NBTTagCompound var3 = par1NBTTagCompound.getCompoundTag("sell"); + this.itemToSell = ItemStack.loadItemStackFromNBT(var3); +- if(var1.hasKey("buyB")) { +- this.secondItemToBuy = ItemStack.loadItemStackFromNBT(var1.getCompoundTag("buyB")); +- } +- +- if(var1.hasKey("uses")) { +- this.toolUses = var1.getInteger("uses"); +- } +- +- if(var1.hasKey("maxUses")) { +- this.maxTradeUses = var1.getInteger("maxUses"); ++ ++ if (par1NBTTagCompound.hasKey("buyB")) { ++ this.secondItemToBuy = ItemStack.loadItemStackFromNBT(par1NBTTagCompound.getCompoundTag("buyB")); ++ } ++ ++ if (par1NBTTagCompound.hasKey("uses")) { ++ this.toolUses = par1NBTTagCompound.getInteger("uses"); ++ } ++ ++ if (par1NBTTagCompound.hasKey("maxUses")) { ++ this.maxTradeUses = par1NBTTagCompound.getInteger("maxUses"); + } else { + this.maxTradeUses = 7; + } +- + } + + public NBTTagCompound writeToTags() { + NBTTagCompound var1 = new NBTTagCompound(); + var1.setCompoundTag("buy", this.itemToBuy.writeToNBT(new NBTTagCompound("buy"))); + var1.setCompoundTag("sell", this.itemToSell.writeToNBT(new NBTTagCompound("sell"))); +- if(this.secondItemToBuy != null) { ++ ++ if (this.secondItemToBuy != null) { + var1.setCompoundTag("buyB", this.secondItemToBuy.writeToNBT(new NBTTagCompound("buyB"))); + } + diff --git a/patches/net/minecraft/src/MerchantRecipeList.java.patch b/patches/net/minecraft/src/MerchantRecipeList.java.patch new file mode 100644 index 0000000..3eededc --- /dev/null +++ b/patches/net/minecraft/src/MerchantRecipeList.java.patch @@ -0,0 +1,152 @@ +--- net/minecraft/src/MerchantRecipeList.java ++++ net/minecraft/src/MerchantRecipeList.java +@@ -6,21 +6,24 @@ + import java.util.ArrayList; + + public class MerchantRecipeList extends ArrayList { +- public MerchantRecipeList() { +- } +- +- public MerchantRecipeList(NBTTagCompound var1) { +- this.readRecipiesFromTags(var1); +- } +- +- public MerchantRecipe canRecipeBeUsed(ItemStack var1, ItemStack var2, int var3) { +- if(var3 > 0 && var3 < this.size()) { +- MerchantRecipe var6 = (MerchantRecipe)this.get(var3); +- return var1.itemID != var6.getItemToBuy().itemID || (var2 != null || var6.hasSecondItemToBuy()) && (!var6.hasSecondItemToBuy() || var2 == null || var6.getSecondItemToBuy().itemID != var2.itemID) || var1.stackSize < var6.getItemToBuy().stackSize || var6.hasSecondItemToBuy() && var2.stackSize < var6.getSecondItemToBuy().stackSize ? null : var6; ++ public MerchantRecipeList() {} ++ ++ public MerchantRecipeList(NBTTagCompound par1NBTTagCompound) { ++ this.readRecipiesFromTags(par1NBTTagCompound); ++ } ++ ++ /** ++ * can par1,par2 be used to in crafting recipe par3 ++ */ ++ public MerchantRecipe canRecipeBeUsed(ItemStack par1ItemStack, ItemStack par2ItemStack, int par3) { ++ if (par3 > 0 && par3 < this.size()) { ++ MerchantRecipe var6 = (MerchantRecipe)this.get(par3); ++ return par1ItemStack.itemID == var6.getItemToBuy().itemID && (par2ItemStack == null && !var6.hasSecondItemToBuy() || var6.hasSecondItemToBuy() && par2ItemStack != null && var6.getSecondItemToBuy().itemID == par2ItemStack.itemID) && par1ItemStack.stackSize >= var6.getItemToBuy().stackSize && (!var6.hasSecondItemToBuy() || par2ItemStack.stackSize >= var6.getSecondItemToBuy().stackSize) ? var6 : null; + } else { +- for(int var4 = 0; var4 < this.size(); ++var4) { ++ for (int var4 = 0; var4 < this.size(); ++var4) { + MerchantRecipe var5 = (MerchantRecipe)this.get(var4); +- if(var1.itemID == var5.getItemToBuy().itemID && var1.stackSize >= var5.getItemToBuy().stackSize && (!var5.hasSecondItemToBuy() && var2 == null || var5.hasSecondItemToBuy() && var2 != null && var5.getSecondItemToBuy().itemID == var2.itemID && var2.stackSize >= var5.getSecondItemToBuy().stackSize)) { ++ ++ if (par1ItemStack.itemID == var5.getItemToBuy().itemID && par1ItemStack.stackSize >= var5.getItemToBuy().stackSize && (!var5.hasSecondItemToBuy() && par2ItemStack == null || var5.hasSecondItemToBuy() && par2ItemStack != null && var5.getSecondItemToBuy().itemID == par2ItemStack.itemID && par2ItemStack.stackSize >= var5.getSecondItemToBuy().stackSize)) { + return var5; + } + } +@@ -29,54 +32,60 @@ + } + } + +- public void addToListWithCheck(MerchantRecipe var1) { +- for(int var2 = 0; var2 < this.size(); ++var2) { ++ /** ++ * checks if there is a recipie for the same ingredients already on the list, and replaces it. otherwise, adds it ++ */ ++ public void addToListWithCheck(MerchantRecipe par1MerchantRecipe) { ++ for (int var2 = 0; var2 < this.size(); ++var2) { + MerchantRecipe var3 = (MerchantRecipe)this.get(var2); +- if(var1.hasSameIDsAs(var3)) { +- if(var1.hasSameItemsAs(var3)) { +- this.set(var2, var1); ++ ++ if (par1MerchantRecipe.hasSameIDsAs(var3)) { ++ if (par1MerchantRecipe.hasSameItemsAs(var3)) { ++ this.set(var2, par1MerchantRecipe); + } + + return; + } + } + +- this.add(var1); ++ this.add(par1MerchantRecipe); + } + +- public void writeRecipiesToStream(DataOutputStream var1) throws IOException { +- var1.writeByte((byte)(this.size() & 255)); ++ public void writeRecipiesToStream(DataOutputStream par1DataOutputStream) throws IOException { ++ par1DataOutputStream.writeByte((byte)(this.size() & 255)); + +- for(int var2 = 0; var2 < this.size(); ++var2) { ++ for (int var2 = 0; var2 < this.size(); ++var2) { + MerchantRecipe var3 = (MerchantRecipe)this.get(var2); +- Packet.writeItemStack(var3.getItemToBuy(), var1); +- Packet.writeItemStack(var3.getItemToSell(), var1); ++ Packet.writeItemStack(var3.getItemToBuy(), par1DataOutputStream); ++ Packet.writeItemStack(var3.getItemToSell(), par1DataOutputStream); + ItemStack var4 = var3.getSecondItemToBuy(); +- var1.writeBoolean(var4 != null); +- if(var4 != null) { +- Packet.writeItemStack(var4, var1); ++ par1DataOutputStream.writeBoolean(var4 != null); ++ ++ if (var4 != null) { ++ Packet.writeItemStack(var4, par1DataOutputStream); + } + +- var1.writeBoolean(var3.func_82784_g()); ++ par1DataOutputStream.writeBoolean(var3.func_82784_g()); + } +- + } + +- public static MerchantRecipeList readRecipiesFromStream(DataInputStream var0) throws IOException { ++ public static MerchantRecipeList readRecipiesFromStream(DataInputStream par0DataInputStream) throws IOException { + MerchantRecipeList var1 = new MerchantRecipeList(); +- int var2 = var0.readByte() & 255; ++ int var2 = par0DataInputStream.readByte() & 255; + +- for(int var3 = 0; var3 < var2; ++var3) { +- ItemStack var4 = Packet.readItemStack(var0); +- ItemStack var5 = Packet.readItemStack(var0); ++ for (int var3 = 0; var3 < var2; ++var3) { ++ ItemStack var4 = Packet.readItemStack(par0DataInputStream); ++ ItemStack var5 = Packet.readItemStack(par0DataInputStream); + ItemStack var6 = null; +- if(var0.readBoolean()) { +- var6 = Packet.readItemStack(var0); ++ ++ if (par0DataInputStream.readBoolean()) { ++ var6 = Packet.readItemStack(par0DataInputStream); + } + +- boolean var7 = var0.readBoolean(); ++ boolean var7 = par0DataInputStream.readBoolean(); + MerchantRecipe var8 = new MerchantRecipe(var4, var6, var5); +- if(var7) { ++ ++ if (var7) { + var8.func_82785_h(); + } + +@@ -86,21 +95,20 @@ + return var1; + } + +- public void readRecipiesFromTags(NBTTagCompound var1) { +- NBTTagList var2 = var1.getTagList("Recipes"); ++ public void readRecipiesFromTags(NBTTagCompound par1NBTTagCompound) { ++ NBTTagList var2 = par1NBTTagCompound.getTagList("Recipes"); + +- for(int var3 = 0; var3 < var2.tagCount(); ++var3) { ++ for (int var3 = 0; var3 < var2.tagCount(); ++var3) { + NBTTagCompound var4 = (NBTTagCompound)var2.tagAt(var3); + this.add(new MerchantRecipe(var4)); + } +- + } + + public NBTTagCompound getRecipiesAsTags() { + NBTTagCompound var1 = new NBTTagCompound(); + NBTTagList var2 = new NBTTagList("Recipes"); + +- for(int var3 = 0; var3 < this.size(); ++var3) { ++ for (int var3 = 0; var3 < this.size(); ++var3) { + MerchantRecipe var4 = (MerchantRecipe)this.get(var3); + var2.appendTag(var4.writeToTags()); + } diff --git a/patches/net/minecraft/src/MessageComponentSerializer.java.patch b/patches/net/minecraft/src/MessageComponentSerializer.java.patch new file mode 100644 index 0000000..917d065 --- /dev/null +++ b/patches/net/minecraft/src/MessageComponentSerializer.java.patch @@ -0,0 +1,213 @@ +--- net/minecraft/src/MessageComponentSerializer.java ++++ net/minecraft/src/MessageComponentSerializer.java +@@ -15,9 +15,9 @@ + import java.util.Iterator; + + public class MessageComponentSerializer implements JsonDeserializer, JsonSerializer { +- public ChatMessageComponent deserializeComponent(JsonElement var1, Type var2, JsonDeserializationContext var3) { ++ public ChatMessageComponent deserializeComponent(JsonElement par1JsonElement, Type par2Type, JsonDeserializationContext par3JsonDeserializationContext) { + ChatMessageComponent var4 = new ChatMessageComponent(); +- JsonObject var5 = (JsonObject)var1; ++ JsonObject var5 = (JsonObject)par1JsonElement; + JsonElement var6 = var5.get("text"); + JsonElement var7 = var5.get("translate"); + JsonElement var8 = var5.get("color"); +@@ -25,66 +25,71 @@ + JsonElement var10 = var5.get("italic"); + JsonElement var11 = var5.get("underlined"); + JsonElement var12 = var5.get("obfuscated"); +- if(var8 != null && var8.isJsonPrimitive()) { ++ ++ if (var8 != null && var8.isJsonPrimitive()) { + EnumChatFormatting var13 = EnumChatFormatting.func_96300_b(var8.getAsString()); +- if(var13 == null || !var13.Checks()) { ++ ++ if (var13 == null || !var13.isColor()) { + throw new JsonParseException("Given color (" + var8.getAsString() + ") is not a valid selection"); + } + + var4.setColor(var13); + } + +- if(var9 != null && var9.isJsonPrimitive()) { ++ if (var9 != null && var9.isJsonPrimitive()) { + var4.setBold(Boolean.valueOf(var9.getAsBoolean())); + } + +- if(var10 != null && var10.isJsonPrimitive()) { ++ if (var10 != null && var10.isJsonPrimitive()) { + var4.setItalic(Boolean.valueOf(var10.getAsBoolean())); + } + +- if(var11 != null && var11.isJsonPrimitive()) { ++ if (var11 != null && var11.isJsonPrimitive()) { + var4.setUnderline(Boolean.valueOf(var11.getAsBoolean())); + } + +- if(var12 != null && var12.isJsonPrimitive()) { ++ if (var12 != null && var12.isJsonPrimitive()) { + var4.setObfuscated(Boolean.valueOf(var12.getAsBoolean())); + } + +- if(var6 != null) { +- if(var6.isJsonArray()) { ++ if (var6 != null) { ++ if (var6.isJsonArray()) { + JsonArray var17 = var6.getAsJsonArray(); + Iterator var14 = var17.iterator(); + +- while(var14.hasNext()) { ++ while (var14.hasNext()) { + JsonElement var15 = (JsonElement)var14.next(); +- if(var15.isJsonPrimitive()) { ++ ++ if (var15.isJsonPrimitive()) { + var4.addText(var15.getAsString()); +- } else if(var15.isJsonObject()) { +- var4.appendComponent(this.deserializeComponent(var15, var2, var3)); ++ } else if (var15.isJsonObject()) { ++ var4.appendComponent(this.deserializeComponent(var15, par2Type, par3JsonDeserializationContext)); + } + } +- } else if(var6.isJsonPrimitive()) { ++ } else if (var6.isJsonPrimitive()) { + var4.addText(var6.getAsString()); + } +- } else if(var7 != null && var7.isJsonPrimitive()) { ++ } else if (var7 != null && var7.isJsonPrimitive()) { + JsonElement var18 = var5.get("using"); +- if(var18 != null) { +- if(var18.isJsonArray()) { ++ ++ if (var18 != null) { ++ if (var18.isJsonArray()) { + ArrayList var19 = Lists.newArrayList(); + Iterator var20 = var18.getAsJsonArray().iterator(); + +- while(var20.hasNext()) { ++ while (var20.hasNext()) { + JsonElement var16 = (JsonElement)var20.next(); +- if(var16.isJsonPrimitive()) { ++ ++ if (var16.isJsonPrimitive()) { + var19.add(var16.getAsString()); +- } else if(var16.isJsonObject()) { +- var19.add(this.deserializeComponent(var16, var2, var3)); ++ } else if (var16.isJsonObject()) { ++ var19.add(this.deserializeComponent(var16, par2Type, par3JsonDeserializationContext)); + } + } + + var4.addFormatted(var7.getAsString(), var19.toArray()); +- } else if(var18.isJsonPrimitive()) { +- var4.addFormatted(var7.getAsString(), new Object[]{var18.getAsString()}); ++ } else if (var18.isJsonPrimitive()) { ++ var4.addFormatted(var7.getAsString(), new Object[] {var18.getAsString()}); + } + } else { + var4.addKey(var7.getAsString()); +@@ -94,63 +99,66 @@ + return var4; + } + +- public JsonElement serializeComponent(ChatMessageComponent var1, Type var2, JsonSerializationContext var3) { ++ public JsonElement serializeComponent(ChatMessageComponent par1ChatMessageComponent, Type par2Type, JsonSerializationContext par3JsonSerializationContext) { + JsonObject var4 = new JsonObject(); +- if(var1.getColor() != null) { +- var4.addProperty("color", var1.getColor().func_96297_d()); +- } +- +- if(var1.isBold() != null) { +- var4.addProperty("bold", var1.isBold()); +- } +- +- if(var1.isItalic() != null) { +- var4.addProperty("italic", var1.isItalic()); +- } +- +- if(var1.isUnderline() != null) { +- var4.addProperty("underlined", var1.isUnderline()); +- } +- +- if(var1.isObfuscated() != null) { +- var4.addProperty("obfuscated", var1.isObfuscated()); +- } +- +- if(var1.getText() != null) { +- var4.addProperty("text", var1.getText()); +- } else if(var1.getTranslationKey() != null) { +- var4.addProperty("translate", var1.getTranslationKey()); +- if(var1.getSubComponents() != null && !var1.getSubComponents().isEmpty()) { +- var4.add("using", this.serializeComponentChildren(var1, var2, var3)); ++ ++ if (par1ChatMessageComponent.getColor() != null) { ++ var4.addProperty("color", par1ChatMessageComponent.getColor().func_96297_d()); ++ } ++ ++ if (par1ChatMessageComponent.isBold() != null) { ++ var4.addProperty("bold", par1ChatMessageComponent.isBold()); ++ } ++ ++ if (par1ChatMessageComponent.isItalic() != null) { ++ var4.addProperty("italic", par1ChatMessageComponent.isItalic()); ++ } ++ ++ if (par1ChatMessageComponent.isUnderline() != null) { ++ var4.addProperty("underlined", par1ChatMessageComponent.isUnderline()); ++ } ++ ++ if (par1ChatMessageComponent.isObfuscated() != null) { ++ var4.addProperty("obfuscated", par1ChatMessageComponent.isObfuscated()); ++ } ++ ++ if (par1ChatMessageComponent.getText() != null) { ++ var4.addProperty("text", par1ChatMessageComponent.getText()); ++ } else if (par1ChatMessageComponent.getTranslationKey() != null) { ++ var4.addProperty("translate", par1ChatMessageComponent.getTranslationKey()); ++ ++ if (par1ChatMessageComponent.getSubComponents() != null && !par1ChatMessageComponent.getSubComponents().isEmpty()) { ++ var4.add("using", this.serializeComponentChildren(par1ChatMessageComponent, par2Type, par3JsonSerializationContext)); + } +- } else if(var1.getSubComponents() != null && !var1.getSubComponents().isEmpty()) { +- var4.add("text", this.serializeComponentChildren(var1, var2, var3)); ++ } else if (par1ChatMessageComponent.getSubComponents() != null && !par1ChatMessageComponent.getSubComponents().isEmpty()) { ++ var4.add("text", this.serializeComponentChildren(par1ChatMessageComponent, par2Type, par3JsonSerializationContext)); + } + + return var4; + } + +- private JsonArray serializeComponentChildren(ChatMessageComponent var1, Type var2, JsonSerializationContext var3) { ++ private JsonArray serializeComponentChildren(ChatMessageComponent par1ChatMessageComponent, Type par2Type, JsonSerializationContext par3JsonSerializationContext) { + JsonArray var4 = new JsonArray(); +- Iterator var5 = var1.getSubComponents().iterator(); ++ Iterator var5 = par1ChatMessageComponent.getSubComponents().iterator(); + +- while(var5.hasNext()) { ++ while (var5.hasNext()) { + ChatMessageComponent var6 = (ChatMessageComponent)var5.next(); +- if(var6.getText() != null) { ++ ++ if (var6.getText() != null) { + var4.add(new JsonPrimitive(var6.getText())); + } else { +- var4.add(this.serializeComponent(var6, var2, var3)); ++ var4.add(this.serializeComponent(var6, par2Type, par3JsonSerializationContext)); + } + } + + return var4; + } + +- public Object deserialize(JsonElement var1, Type var2, JsonDeserializationContext var3) { +- return this.deserializeComponent(var1, var2, var3); ++ public Object deserialize(JsonElement par1JsonElement, Type par2Type, JsonDeserializationContext par3JsonDeserializationContext) { ++ return this.deserializeComponent(par1JsonElement, par2Type, par3JsonDeserializationContext); + } + +- public JsonElement serialize(Object var1, Type var2, JsonSerializationContext var3) { +- return this.serializeComponent((ChatMessageComponent)var1, var2, var3); ++ public JsonElement serialize(Object par1Obj, Type par2Type, JsonSerializationContext par3JsonSerializationContext) { ++ return this.serializeComponent((ChatMessageComponent)par1Obj, par2Type, par3JsonSerializationContext); + } + } diff --git a/patches/net/minecraft/src/MetadataSectionSerializer.java.patch b/patches/net/minecraft/src/MetadataSectionSerializer.java.patch new file mode 100644 index 0000000..01a50e0 --- /dev/null +++ b/patches/net/minecraft/src/MetadataSectionSerializer.java.patch @@ -0,0 +1,12 @@ +--- net/minecraft/src/MetadataSectionSerializer.java ++++ net/minecraft/src/MetadataSectionSerializer.java +@@ -3,5 +3,9 @@ + import com.google.gson.JsonDeserializer; + + public interface MetadataSectionSerializer extends JsonDeserializer { ++ ++ /** ++ * The name of this section type as it appears in JSON. ++ */ + String getSectionName(); + } diff --git a/patches/net/minecraft/src/MetadataSerializer.java.patch b/patches/net/minecraft/src/MetadataSerializer.java.patch new file mode 100644 index 0000000..f780ef7 --- /dev/null +++ b/patches/net/minecraft/src/MetadataSerializer.java.patch @@ -0,0 +1,73 @@ +--- net/minecraft/src/MetadataSerializer.java ++++ net/minecraft/src/MetadataSerializer.java +@@ -2,43 +2,49 @@ + + import com.google.gson.Gson; + import com.google.gson.GsonBuilder; +-import com.google.gson.JsonElement; + import com.google.gson.JsonObject; +-import java.lang.reflect.Type; + + public class MetadataSerializer { + private final IRegistry metadataSectionSerializerRegistry = new RegistrySimple(); +- private final GsonBuilder b = new GsonBuilder(); +- private Gson c; +- +- public void registerMetadataSectionType(MetadataSectionSerializer var1, Class var2) { +- this.metadataSectionSerializerRegistry.putObject(var1.getSectionName(), new MetadataSerializerRegistration(this, var1, var2, (MetadataSerializerEmptyAnon)null)); +- this.b.registerTypeAdapter(var2, var1); +- this.c = null; ++ private final GsonBuilder gsonBuilder = new GsonBuilder(); ++ ++ /** ++ * Cached Gson instance. Set to null when more sections are registered, and then re-created from the builder. ++ */ ++ private Gson gson; ++ ++ public void registerMetadataSectionType(MetadataSectionSerializer par1MetadataSectionSerializer, Class par2Class) { ++ this.metadataSectionSerializerRegistry.putObject(par1MetadataSectionSerializer.getSectionName(), new MetadataSerializerRegistration(this, par1MetadataSectionSerializer, par2Class, (MetadataSerializerEmptyAnon)null)); ++ this.gsonBuilder.registerTypeAdapter(par2Class, par1MetadataSectionSerializer); ++ this.gson = null; + } + +- public MetadataSection parseMetadataSection(String var1, JsonObject var2) { +- if(var1 == null) { ++ public MetadataSection parseMetadataSection(String par1Str, JsonObject par2JsonObject) { ++ if (par1Str == null) { + throw new IllegalArgumentException("Metadata section name cannot be null"); +- } else if(!var2.has(var1)) { ++ } else if (!par2JsonObject.has(par1Str)) { + return null; +- } else if(!var2.get(var1).isJsonObject()) { +- throw new IllegalArgumentException("Invalid metadata for \'" + var1 + "\' - expected object, found " + var2.get(var1)); ++ } else if (!par2JsonObject.get(par1Str).isJsonObject()) { ++ throw new IllegalArgumentException("Invalid metadata for \'" + par1Str + "\' - expected object, found " + par2JsonObject.get(par1Str)); + } else { +- MetadataSerializerRegistration var3 = (MetadataSerializerRegistration)this.metadataSectionSerializerRegistry.getObject(var1); +- if(var3 == null) { +- throw new IllegalArgumentException("Don\'t know how to handle metadata section \'" + var1 + "\'"); ++ MetadataSerializerRegistration var3 = (MetadataSerializerRegistration)this.metadataSectionSerializerRegistry.getObject(par1Str); ++ ++ if (var3 == null) { ++ throw new IllegalArgumentException("Don\'t know how to handle metadata section \'" + par1Str + "\'"); + } else { +- return (MetadataSection)this.getGson().fromJson((JsonElement)var2.getAsJsonObject(var1), (Type)var3.b); ++ return (MetadataSection)this.getGson().fromJson(par2JsonObject.getAsJsonObject(par1Str), var3.field_110500_b); + } + } + } + ++ /** ++ * Returns a Gson instance with type adapters registered for metadata sections. ++ */ + private Gson getGson() { +- if(this.c == null) { +- this.c = this.b.create(); ++ if (this.gson == null) { ++ this.gson = this.gsonBuilder.create(); + } + +- return this.c; ++ return this.gson; + } + } diff --git a/patches/net/minecraft/src/MetadataSerializerRegistration.java.patch b/patches/net/minecraft/src/MetadataSerializerRegistration.java.patch new file mode 100644 index 0000000..5c6ac49 --- /dev/null +++ b/patches/net/minecraft/src/MetadataSerializerRegistration.java.patch @@ -0,0 +1,27 @@ +--- net/minecraft/src/MetadataSerializerRegistration.java ++++ net/minecraft/src/MetadataSerializerRegistration.java +@@ -2,16 +2,17 @@ + + class MetadataSerializerRegistration { + final MetadataSectionSerializer field_110502_a; +- final Class b; ++ final Class field_110500_b; ++ + final MetadataSerializer field_110501_c; + +- private MetadataSerializerRegistration(MetadataSerializer var1, MetadataSectionSerializer var2, Class var3) { +- this.field_110501_c = var1; +- this.field_110502_a = var2; +- this.b = var3; ++ private MetadataSerializerRegistration(MetadataSerializer par1MetadataSerializer, MetadataSectionSerializer par2MetadataSectionSerializer, Class par3Class) { ++ this.field_110501_c = par1MetadataSerializer; ++ this.field_110502_a = par2MetadataSectionSerializer; ++ this.field_110500_b = par3Class; + } + +- MetadataSerializerRegistration(MetadataSerializer var1, MetadataSectionSerializer var2, Class var3, MetadataSerializerEmptyAnon var4) { +- this(var1, var2, var3); ++ MetadataSerializerRegistration(MetadataSerializer par1MetadataSerializer, MetadataSectionSerializer par2MetadataSectionSerializer, Class par3Class, MetadataSerializerEmptyAnon par4MetadataSerializerEmptyAnon) { ++ this(par1MetadataSerializer, par2MetadataSectionSerializer, par3Class); + } + } diff --git a/patches/net/minecraft/src/Minecraft.java.patch b/patches/net/minecraft/src/Minecraft.java.patch new file mode 100644 index 0000000..96c59f4 --- /dev/null +++ b/patches/net/minecraft/src/Minecraft.java.patch @@ -0,0 +1,2764 @@ +--- net/minecraft/src/Minecraft.java ++++ net/minecraft/src/Minecraft.java +@@ -1,6 +1,5 @@ + package net.minecraft.src; + +-import com.google.common.collect.Lists; + import java.awt.image.BufferedImage; + import java.io.File; + import java.io.IOException; +@@ -14,9 +13,11 @@ + import java.util.HashSet; + import java.util.Iterator; + import java.util.List; ++ + import javax.imageio.ImageIO; +-import net.minecraft.client.ClientBrandRetriever; +-import net.minecraft.server.MinecraftServer; ++ ++import com.google.common.collect.Lists; ++ + import org.lwjgl.LWJGLException; + import org.lwjgl.Sys; + import org.lwjgl.input.Keyboard; +@@ -28,105 +29,242 @@ + import org.lwjgl.opengl.GL20; + import org.lwjgl.opengl.GLContext; + import org.lwjgl.opengl.PixelFormat; +-import org.lwjgl.util.glu.GLU; ++ ++import com.prupe.mcpatcher.MCPatcherUtils; ++import com.prupe.mcpatcher.TexturePackChangeHandler; ++import com.prupe.mcpatcher.hd.AAHelper; ++ ++import net.minecraft.client.ClientBrandRetriever; ++import net.minecraft.server.MinecraftServer; ++import net.minecraft.src.Session; ++ ++import org.bukkit.ChatColor; ++import org.spoutcraft.api.gui.PopupScreen; ++import org.spoutcraft.api.gui.Screen; ++import org.spoutcraft.api.gui.ScreenType; ++import org.spoutcraft.client.SpoutClient; ++import org.spoutcraft.client.chunkcache.HeightMap; ++import org.spoutcraft.client.config.Configuration; ++import org.spoutcraft.client.controls.SimpleKeyBindingManager; ++import org.spoutcraft.client.gui.ScreenUtil; ++import org.spoutcraft.client.gui.minimap.MinimapConfig; ++import org.spoutcraft.client.gui.minimap.MinimapUtils; ++import org.spoutcraft.client.gui.minimap.Waypoint; ++import org.spoutcraft.client.io.FileUtil; ++import org.spoutcraft.client.packet.PacketScreenAction; ++import org.spoutcraft.client.packet.ScreenAction; ++import org.spoutcraft.client.packet.SpoutPacket; ++import org.spoutcraft.client.spoutworth.SpoutWorth; + + public class Minecraft implements IPlayerUsage { + private static final ResourceLocation locationMojangPng = new ResourceLocation("textures/gui/title/mojang.png"); + public static final boolean isRunningOnMac = Util.getOSType() == EnumOS.MACOS; ++ ++ /** A 10MiB preallocation to ensure the heap is reasonably sized. */ + public static byte[] memoryReserve = new byte[10485760]; +- private static final List J = Lists.newArrayList((Object[])(new DisplayMode[]{new DisplayMode(2560, 1600), new DisplayMode(2880, 1800)})); ++ private static final List macDisplayModes = Lists.newArrayList(new DisplayMode[] {new DisplayMode(2560, 1600), new DisplayMode(2880, 1800)}); + private final ILogAgent mcLogAgent; +- private final File L; ++ private final File fileResourcepacks; + private ServerData currentServerData; +- private TextureManager renderEngine; +- private static Minecraft theMinecraft; ++ ++ /** The RenderEngine instance used by Minecraft */ ++ // Spout Start ++ public TextureManager renderEngine; ++ // Spout End ++ ++ /** ++ * Set to 'this' in Minecraft constructor; used by some settings get methods ++ */ ++ // Spout Start - private to public ++ public static Minecraft theMinecraft; ++ // Spout End + public PlayerControllerMP playerController; + private boolean fullscreen; + private boolean hasCrashed; ++ ++ /** Instance of CrashReport. */ + private CrashReport crashReporter; + public int displayWidth; + public int displayHeight; +- private Timer timer = new Timer(20.0F); +- private PlayerUsageSnooper usageSnooper = new PlayerUsageSnooper("client", this, MinecraftServer.getCurrentTimeMillis()); ++ private Timer timer; ++ ++ /** Instance of PlayerUsageSnooper. */ ++ private PlayerUsageSnooper usageSnooper; + public WorldClient theWorld; + public RenderGlobal renderGlobal; + public EntityClientPlayerMP thePlayer; ++ ++ /** ++ * The Entity from which the renderer determines the render viewpoint. Currently is always the parent Minecraft class's ++ * 'thePlayer' instance. Modification of its location, rotation, or other settings at render time will modify the ++ * camera likewise, with the caveat of triggering chunk rebuilds as it moves, making it unsuitable for changing the ++ * viewpoint mid-render. ++ */ + public EntityLivingBase renderViewEntity; + public EntityLivingBase pointedEntityLiving; + public EffectRenderer effectRenderer; +- private final Session session; +- private boolean isGamePaused; ++ public Session session; ++ public boolean isGamePaused; ++ ++ /** The font renderer used for displaying and measuring text. */ + public FontRenderer fontRenderer; + public FontRenderer standardGalacticFontRenderer; ++ ++ /** The GuiScreen that's being displayed at the moment. */ + public GuiScreen currentScreen; + public LoadingScreenRenderer loadingScreen; + public EntityRenderer entityRenderer; ++ ++ /** Mouse left click counter */ + private int leftClickCounter; ++ ++ /** Display width */ + private int tempDisplayWidth; ++ ++ /** Display height */ + private int tempDisplayHeight; ++ ++ /** Instance of IntegratedServer. */ + private IntegratedServer theIntegratedServer; ++ ++ /** Gui achievement */ + public GuiAchievement guiAchievement; + public GuiIngame ingameGUI; ++ ++ /** Skip render world */ + public boolean skipRenderWorld; ++ ++ /** The ray trace hit that the mouse is over. */ + public MovingObjectPosition objectMouseOver; +- public GameSettings gameSettings; ++ ++ /** The game settings that currently hold effect. */ ++ public GameSettings gameSettings; + public SoundManager sndManager; ++ ++ /** Mouse helper instance. */ + public MouseHelper mouseHelper; +- public final File x; +- private final File aa; +- private final String ab; +- private final Proxy ac; ++ public final File mcDataDir; ++ private final File fileAssets; ++ private final String launchedVersion; ++ private final Proxy proxy; + private ISaveFormat saveLoader; ++ ++ /** ++ * This is set to fpsCounter every debug screen update, and is shown on the debug screen. It's also sent as part of the ++ * usage snooping. ++ */ + private static int debugFPS; ++ ++ /** ++ * When you place a block, it's set to 6, decremented once per tick, when it's 0, you can place another block. ++ */ + private int rightClickDelayTimer; ++ ++ /** ++ * Checked in Minecraft's while(running) loop, if true it's set to false and the textures refreshed. ++ */ + private boolean refreshTexturePacksScheduled; ++ ++ /** Stat file writer */ + public StatFileWriter statFileWriter; +- private String ah; ++ private String serverName; + private int serverPort; ++ ++ /** ++ * Makes sure it doesn't keep taking screenshots when both buttons are down. ++ */ + boolean isTakingScreenshot; ++ ++ /** ++ * Does the actual gameplay have focus. If so then mouse and keys will effect the player instead of menus. ++ */ + public boolean inGameHasFocus; +- long systemTime = getSystemTime(); ++ long systemTime; ++ ++ /** Join player counter */ + private int joinPlayerCounter; + private final boolean isDemo; + private INetworkManager myNetworkManager; + private boolean integratedServerIsRunning; +- public final Profiler mcProfiler = new Profiler(); +- private long field_83002_am = -1L; ++ ++ /** The profiler instance */ ++ public final Profiler mcProfiler; ++ private long field_83002_am; + private ReloadableResourceManager mcResourceManager; +- private final MetadataSerializer metadataSerializer_ = new MetadataSerializer(); +- private List aq = Lists.newArrayList(); ++ private final MetadataSerializer metadataSerializer_; ++ private List defaultResourcePacks; + private DefaultResourcePack mcDefaultResourcePack; + private ResourcePackRepository mcResourcePackRepository; + private LanguageManager mcLanguageManager; +- volatile boolean running = true; +- public String E = ""; +- long debugUpdateTime = getSystemTime(); ++ ++ /** ++ * Set to true to keep the game loop running. Set to false by shutdown() to allow the game loop to exit cleanly. ++ */ ++ volatile boolean running; ++ ++ /** String that shows the debug information */ ++ public String debug; ++ ++ /** Approximate time (in ms) of last update to debug string */ ++ long debugUpdateTime; ++ ++ /** holds the current fps */ + int fpsCounter; +- long prevFrameTime = -1L; +- private String au = "root"; +- +- public Minecraft(Session var1, int var2, int var3, boolean var4, boolean var5, File var6, File var7, File var8, Proxy var9, String var10) { ++ long prevFrameTime; ++ ++ /** Profiler currently displayed in the debug screen pie chart */ ++ private String debugProfilerName; ++ // Spout Start ++ public static Thread mainThread; ++ private boolean shutdown = false; ++ public static boolean spoutcraftLauncher = true; ++ public static boolean portable = false; ++ public static int framesPerSecond = 0; ++ // Spout End ++ ++ public Minecraft(Session par1Session, int par2, int par3, boolean par4, boolean par5, File par6File, File par7File, File par8File, Proxy par9Proxy, String par10Str) { ++ MCPatcherUtils.setMinecraft(par6File, par7File, "1.6.4", "4.2.2"); ++ this.timer = new Timer(20.0F); ++ this.usageSnooper = new PlayerUsageSnooper("client", this, MinecraftServer.getSystemTimeMillis()); ++ this.systemTime = getSystemTime(); ++ this.mcProfiler = new Profiler(); ++ this.field_83002_am = -1L; ++ this.metadataSerializer_ = new MetadataSerializer(); ++ this.defaultResourcePacks = Lists.newArrayList(); ++ this.running = true; ++ this.debug = ""; ++ this.debugUpdateTime = getSystemTime(); ++ this.prevFrameTime = -1L; ++ this.debugProfilerName = "root"; + theMinecraft = this; +- this.mcLogAgent = new LogAgent("Minecraft-Client", " [CLIENT]", (new File(var6, "output-client.log")).getAbsolutePath()); +- this.x = var6; +- this.aa = var7; +- this.L = var8; +- this.ab = var10; +- this.mcDefaultResourcePack = new DefaultResourcePack(this.aa); ++ this.mcLogAgent = new LogAgent("Minecraft-Client", " [CLIENT]", (new File(par6File, "output-client.log")).getAbsolutePath()); ++ this.mcDataDir = par6File; ++ this.fileAssets = par7File; ++ this.fileResourcepacks = par8File; ++ this.launchedVersion = par10Str; ++ this.mcDefaultResourcePack = new DefaultResourcePack(this.fileAssets); + this.addDefaultResourcePack(); +- this.ac = var9; ++ this.proxy = par9Proxy; + this.startTimerHackThread(); +- this.session = var1; +- this.mcLogAgent.logInfo("Setting user: " + var1.getUsername()); +- this.mcLogAgent.logInfo("(Session ID is " + var1.getSessionID() + ")"); +- this.isDemo = var5; +- this.displayWidth = var2; +- this.displayHeight = var3; +- this.tempDisplayWidth = var2; +- this.tempDisplayHeight = var3; +- this.fullscreen = var4; ++ this.session = par1Session; ++ //this.mcLogAgent.logInfo("Setting user: " + par1Session.getUsername()); ++ //this.mcLogAgent.logInfo("(Session ID is " + par1Session.getSessionID() + ")"); ++ this.isDemo = par5; ++ this.displayWidth = par2; ++ this.displayHeight = par3; ++ this.tempDisplayWidth = par2; ++ this.tempDisplayHeight = par3; ++ this.fullscreen = par4; + ImageIO.setUseCache(false); + StatList.nopInit(); ++ ++ // Spout Start ++ Runtime.getRuntime().addShutdownHook(new Thread(new Runnable() { ++ public void run() { ++ shutdownMinecraftApplet(); ++ } ++ })); ++ // Spout End + } + + private void startTimerHackThread() { +@@ -135,83 +273,103 @@ + var1.start(); + } + +- public void crashed(CrashReport var1) { ++ public void crashed(CrashReport par1CrashReport) { + this.hasCrashed = true; +- this.crashReporter = var1; ++ this.crashReporter = par1CrashReport; + } + +- public void displayCrashReport(CrashReport var1) { +- File var2 = new File(getMinecraft().x, "crash-reports"); ++ /** ++ * Wrapper around displayCrashReportInternal ++ */ ++ public void displayCrashReport(CrashReport par1CrashReport) { ++ File var2 = new File(getMinecraft().mcDataDir, "crash-reports"); + File var3 = new File(var2, "crash-" + (new SimpleDateFormat("yyyy-MM-dd_HH.mm.ss")).format(new Date()) + "-client.txt"); +- System.out.println(var1.getCompleteReport()); +- if(var1.getFile() != null) { +- System.out.println("#@!@# Game crashed! Crash report saved to: #@!@# " + var1.getFile()); ++ System.out.println(par1CrashReport.getCompleteReport()); ++ ++ if (par1CrashReport.getFile() != null) { ++ System.out.println("#@!@# Game crashed! Crash report saved to: #@!@# " + par1CrashReport.getFile()); + System.exit(-1); +- } else if(var1.saveToFile(var3, this.getLogAgent())) { ++ } else if (par1CrashReport.saveToFile(var3, this.getLogAgent())) { + System.out.println("#@!@# Game crashed! Crash report saved to: #@!@# " + var3.getAbsolutePath()); + System.exit(-1); + } else { + System.out.println("#@?@# Game crashed! Crash report could not be saved. #@?@#"); + System.exit(-2); + } +- +- } +- +- public void setServer(String var1, int var2) { +- this.ah = var1; +- this.serverPort = var2; +- } +- +- private void startGame() throws LWJGLException { +- this.gameSettings = new GameSettings(this, this.x); +- if(this.gameSettings.overrideHeight > 0 && this.gameSettings.overrideWidth > 0) { ++ } ++ ++ public void setServer(String par1Str, int par2) { ++ this.serverName = par1Str; ++ this.serverPort = par2; ++ } ++ ++ /** ++ * Starts the game: initializes the canvas, the title, the settings, etcetera. ++ */ ++ public void startGame() throws LWJGLException { ++ this.gameSettings = new GameSettings(this, this.mcDataDir); ++ if (this.gameSettings.overrideHeight > 0 && this.gameSettings.overrideWidth > 0) { + this.displayWidth = this.gameSettings.overrideWidth; + this.displayHeight = this.gameSettings.overrideHeight; + } + +- if(this.fullscreen) { ++ if (this.fullscreen) { + Display.setFullscreen(true); + this.displayWidth = Display.getDisplayMode().getWidth(); + this.displayHeight = Display.getDisplayMode().getHeight(); +- if(this.displayWidth <= 0) { ++ ++ if (this.displayWidth <= 0) { + this.displayWidth = 1; + } + +- if(this.displayHeight <= 0) { ++ if (this.displayHeight <= 0) { + this.displayHeight = 1; + } ++ // Spout Start ++ Display.setDisplayMode(new DisplayMode(this.displayWidth, this.displayHeight)); ++ Display.setFullscreen(this.fullscreen); ++ Display.setVSyncEnabled(this.gameSettings.enableVsync); ++ Display.update(); ++ // Spout End + } else { + Display.setDisplayMode(new DisplayMode(this.displayWidth, this.displayHeight)); + } +- ++ + Display.setResizable(true); +- Display.setTitle("Minecraft 1.6.4"); +- this.getLogAgent().logInfo("LWJGL Version: " + Sys.getVersion()); +- if(Util.getOSType() != EnumOS.MACOS) { ++ Display.setTitle("Spoutcraft 1.6.4"); ++ //this.getLogAgent().logInfo("LWJGL Version: " + Sys.getVersion()); ++ ++ if (Util.getOSType() != EnumOS.MACOS) { + try { +- Display.setIcon(new ByteBuffer[]{this.readImage(new File(this.aa, "/icons/icon_16x16.png")), this.readImage(new File(this.aa, "/icons/icon_32x32.png"))}); ++ Display.setIcon(new ByteBuffer[] {this.readImage(new File(FileUtil.getAssetsDir(), "/icon/icon_16x16.png")), this.readImage(new File(FileUtil.getAssetsDir(), "/icon/icon_32x32.png"))}); + } catch (IOException var5) { + var5.printStackTrace(); + } + } + + try { +- Display.create((new PixelFormat()).withDepthBits(24)); ++ Display.create(AAHelper.setupPixelFormat((new PixelFormat()).withDepthBits(24))); + } catch (LWJGLException var4) { + var4.printStackTrace(); + + try { + Thread.sleep(1000L); + } catch (InterruptedException var3) { ++ ; + } + +- if(this.fullscreen) { ++ if (this.fullscreen) { + this.updateDisplayMode(); + } + + Display.create(); + } + ++ // Spout Start ++ System.out.println("\nSpoutcraft Version: " + SpoutClient.getSpoutcraftVersion() + SpoutClient.getSpoutcraftBuild()); ++ System.out.println("\nStarting texture pack initialization..."); ++ // Spout End ++ + OpenGlHelper.initializeTextures(); + this.guiAchievement = new GuiAchievement(this); + this.metadataSerializer_.registerMetadataSectionType(new TextureMetadataSectionSerializer(), TextureMetadataSection.class); +@@ -219,19 +377,27 @@ + this.metadataSerializer_.registerMetadataSectionType(new AnimationMetadataSectionSerializer(), AnimationMetadataSection.class); + this.metadataSerializer_.registerMetadataSectionType(new PackMetadataSectionSerializer(), PackMetadataSection.class); + this.metadataSerializer_.registerMetadataSectionType(new LanguageMetadataSectionSerializer(), LanguageMetadataSection.class); +- this.saveLoader = new AnvilSaveConverter(new File(this.x, "saves")); +- this.mcResourcePackRepository = new ResourcePackRepository(this.L, this.mcDefaultResourcePack, this.metadataSerializer_, this.gameSettings); ++ this.saveLoader = new AnvilSaveConverter(new File(this.mcDataDir, "saves")); ++ this.mcResourcePackRepository = new ResourcePackRepository(this.fileResourcepacks, this.mcDefaultResourcePack, this.metadataSerializer_, this.gameSettings); ++ TexturePackChangeHandler.earlyInitialize("com.prupe.mcpatcher.TileLoader", "init"); ++ TexturePackChangeHandler.earlyInitialize("com.prupe.mcpatcher.ctm.CTMUtils", "reset"); ++ TexturePackChangeHandler.earlyInitialize("com.prupe.mcpatcher.cit.CITUtils", "init"); ++ TexturePackChangeHandler.earlyInitialize("com.prupe.mcpatcher.hd.FontUtils", "init"); ++ TexturePackChangeHandler.earlyInitialize("com.prupe.mcpatcher.mob.MobRandomizer", "init"); ++ TexturePackChangeHandler.earlyInitialize("com.prupe.mcpatcher.cc.Colorizer", "init"); ++ TexturePackChangeHandler.beforeChange1(true); + this.mcResourceManager = new SimpleReloadableResourceManager(this.metadataSerializer_); +- this.mcLanguageManager = new LanguageManager(this.metadataSerializer_, this.gameSettings.an); ++ this.mcLanguageManager = new LanguageManager(this.metadataSerializer_, this.gameSettings.language); + this.mcResourceManager.registerReloadListener(this.mcLanguageManager); + this.refreshResources(); + this.renderEngine = new TextureManager(this.mcResourceManager); + this.mcResourceManager.registerReloadListener(this.renderEngine); +- this.sndManager = new SoundManager(this.mcResourceManager, this.gameSettings, this.aa); +- this.mcResourceManager.registerReloadListener(this.sndManager); ++ this.sndManager = new SoundManager(this.mcResourceManager, this.gameSettings, this.fileAssets); ++ this.mcResourceManager.registerReloadListener(this.sndManager); + this.loadScreen(); + this.fontRenderer = new FontRenderer(this.gameSettings, new ResourceLocation("textures/font/ascii.png"), this.renderEngine, false); +- if(this.gameSettings.an != null) { ++ ++ if (this.gameSettings.language != null) { + this.fontRenderer.setUnicodeFlag(this.mcLanguageManager.isCurrentLocaleUnicode()); + this.fontRenderer.setBidiFlag(this.mcLanguageManager.isCurrentLanguageBidirectional()); + } +@@ -243,9 +409,14 @@ + this.mcResourceManager.registerReloadListener(new FoliageColorReloadListener()); + RenderManager.instance.itemRenderer = new ItemRenderer(this); + this.entityRenderer = new EntityRenderer(this); +- this.statFileWriter = new StatFileWriter(this.session, this.x); ++ this.statFileWriter = new StatFileWriter(this.session, this.mcDataDir); + AchievementList.openInventory.setStatStringFormatter(new StatStringFormatKeyInv(this)); + this.mouseHelper = new MouseHelper(); ++ ++ // Spout Start ++ Keyboard.create(); ++ // Spout End ++ + this.checkGLError("Pre startup"); + GL11.glEnable(GL11.GL_TEXTURE_2D); + GL11.glShadeModel(GL11.GL_SMOOTH); +@@ -258,56 +429,59 @@ + GL11.glMatrixMode(GL11.GL_PROJECTION); + GL11.glLoadIdentity(); + GL11.glMatrixMode(GL11.GL_MODELVIEW); +- this.checkGLError("Startup"); + this.renderGlobal = new RenderGlobal(this); + this.renderEngine.loadTextureMap(TextureMap.locationBlocksTexture, new TextureMap(0, "textures/blocks")); + this.renderEngine.loadTextureMap(TextureMap.locationItemsTexture, new TextureMap(1, "textures/items")); + GL11.glViewport(0, 0, this.displayWidth, this.displayHeight); ++ TexturePackChangeHandler.afterChange1(true); + this.effectRenderer = new EffectRenderer(this.theWorld, this.renderEngine); + this.checkGLError("Post startup"); + this.ingameGUI = new GuiIngame(this); +- if(this.ah != null) { +- this.displayGuiScreen(new GuiConnecting(new GuiMainMenu(), this, this.ah, this.serverPort)); ++ ++ if (this.serverName != null) { ++ this.displayGuiScreen(new GuiConnecting(new GuiMainMenu(), this, this.serverName, this.serverPort)); + } else { +- this.displayGuiScreen(new GuiMainMenu()); ++ // Spout Start ++ this.displayGuiScreen(new org.spoutcraft.client.gui.mainmenu.MainMenu()); ++ // Spout End + } + + this.loadingScreen = new LoadingScreenRenderer(this); +- if(this.gameSettings.fullScreen && !this.fullscreen) { ++ ++ if (this.gameSettings.fullScreen && !this.fullscreen) { + this.toggleFullscreen(); + } +- + } + + public void refreshResources() { +- ArrayList var1 = Lists.newArrayList((Iterable)this.aq); ++ ArrayList var1 = Lists.newArrayList(this.defaultResourcePacks); + Iterator var2 = this.mcResourcePackRepository.getRepositoryEntries().iterator(); + +- while(var2.hasNext()) { ++ while (var2.hasNext()) { + ResourcePackRepositoryEntry var3 = (ResourcePackRepositoryEntry)var2.next(); + var1.add(var3.getResourcePack()); + } + + this.mcLanguageManager.parseLanguageMetadata(var1); + this.mcResourceManager.reloadResources(var1); +- if(this.renderGlobal != null) { ++ ++ if (this.renderGlobal != null) { + this.renderGlobal.loadRenderers(); + } +- + } + + private void addDefaultResourcePack() { +- this.aq.add(this.mcDefaultResourcePack); ++ this.defaultResourcePacks.add(this.mcDefaultResourcePack); + } + +- private ByteBuffer readImage(File var1) throws IOException { +- BufferedImage var2 = ImageIO.read(var1); ++ private ByteBuffer readImage(File par1File) throws IOException { ++ BufferedImage var2 = ImageIO.read(par1File); + int[] var3 = var2.getRGB(0, 0, var2.getWidth(), var2.getHeight(), (int[])null, 0, var2.getWidth()); + ByteBuffer var4 = ByteBuffer.allocate(4 * var3.length); + int[] var5 = var3; + int var6 = var3.length; + +- for(int var7 = 0; var7 < var6; ++var7) { ++ for (int var7 = 0; var7 < var6; ++var7) { + int var8 = var5[var7]; + var4.putInt(var8 << 8 | var8 >> 24 & 255); + } +@@ -320,39 +494,32 @@ + HashSet var1 = new HashSet(); + Collections.addAll(var1, Display.getAvailableDisplayModes()); + DisplayMode var2 = Display.getDesktopDisplayMode(); +- if(!var1.contains(var2) && Util.getOSType() == EnumOS.MACOS) { +- Iterator var3 = J.iterator(); +- +- label52: +- while(true) { +- while(true) { +- DisplayMode var4; +- boolean var5; +- Iterator var6; +- DisplayMode var7; +- do { +- if(!var3.hasNext()) { +- break label52; +- } +- +- var4 = (DisplayMode)var3.next(); +- var5 = true; +- var6 = var1.iterator(); +- +- while(var6.hasNext()) { +- var7 = (DisplayMode)var6.next(); +- if(var7.getBitsPerPixel() == 32 && var7.getWidth() == var4.getWidth() && var7.getHeight() == var4.getHeight()) { +- var5 = false; +- break; +- } +- } +- } while(var5); +- ++ ++ if (!var1.contains(var2) && Util.getOSType() == EnumOS.MACOS) { ++ Iterator var3 = macDisplayModes.iterator(); ++ ++ while (var3.hasNext()) { ++ DisplayMode var4 = (DisplayMode)var3.next(); ++ boolean var5 = true; ++ Iterator var6 = var1.iterator(); ++ DisplayMode var7; ++ ++ while (var6.hasNext()) { ++ var7 = (DisplayMode)var6.next(); ++ ++ if (var7.getBitsPerPixel() == 32 && var7.getWidth() == var4.getWidth() && var7.getHeight() == var4.getHeight()) { ++ var5 = false; ++ break; ++ } ++ } ++ ++ if (!var5) { + var6 = var1.iterator(); + +- while(var6.hasNext()) { ++ while (var6.hasNext()) { + var7 = (DisplayMode)var6.next(); +- if(var7.getBitsPerPixel() == 32 && var7.getWidth() == var4.getWidth() / 2 && var7.getHeight() == var4.getHeight() / 2) { ++ ++ if (var7.getBitsPerPixel() == 32 && var7.getWidth() == var4.getWidth() / 2 && var7.getHeight() == var4.getHeight() / 2) { + var2 = var7; + break; + } +@@ -366,9 +533,12 @@ + this.displayHeight = var2.getHeight(); + } + ++ /** ++ * Displays a new screen. ++ */ + private void loadScreen() throws LWJGLException { + ScaledResolution var1 = new ScaledResolution(this.gameSettings, this.displayWidth, this.displayHeight); +- GL11.glClear(GL11.GL_DEPTH_BUFFER_BIT | GL11.GL_COLOR_BUFFER_BIT); ++ GL11.glClear(GL11.GL_COLOR_BUFFER_BIT | GL11.GL_DEPTH_BUFFER_BIT); + GL11.glMatrixMode(GL11.GL_PROJECTION); + GL11.glLoadIdentity(); + GL11.glOrtho(0.0D, var1.getScaledWidth_double(), var1.getScaledHeight_double(), 0.0D, 1000.0D, 3000.0D); +@@ -380,8 +550,8 @@ + GL11.glDisable(GL11.GL_LIGHTING); + GL11.glEnable(GL11.GL_TEXTURE_2D); + GL11.glDisable(GL11.GL_FOG); +- this.renderEngine.bindTexture(locationMojangPng); + Tessellator var2 = Tessellator.instance; ++ this.renderEngine.bindTexture(locationMojangPng); + var2.startDrawingQuads(); + var2.setColorOpaque_I(16777215); + var2.addVertexWithUV(0.0D, (double)this.displayHeight, 0.0D, 0.0D, 0.0D); +@@ -401,86 +571,174 @@ + Display.update(); + } + +- public void scaledTessellator(int var1, int var2, int var3, int var4, int var5, int var6) { ++ /** ++ * Loads Tessellator with a scaled resolution ++ */ ++ public void scaledTessellator(int par1, int par2, int par3, int par4, int par5, int par6) { + float var7 = 0.00390625F; + float var8 = 0.00390625F; + Tessellator var9 = Tessellator.instance; + var9.startDrawingQuads(); +- var9.addVertexWithUV((double)(var1 + 0), (double)(var2 + var6), 0.0D, (double)((float)(var3 + 0) * var7), (double)((float)(var4 + var6) * var8)); +- var9.addVertexWithUV((double)(var1 + var5), (double)(var2 + var6), 0.0D, (double)((float)(var3 + var5) * var7), (double)((float)(var4 + var6) * var8)); +- var9.addVertexWithUV((double)(var1 + var5), (double)(var2 + 0), 0.0D, (double)((float)(var3 + var5) * var7), (double)((float)(var4 + 0) * var8)); +- var9.addVertexWithUV((double)(var1 + 0), (double)(var2 + 0), 0.0D, (double)((float)(var3 + 0) * var7), (double)((float)(var4 + 0) * var8)); ++ var9.addVertexWithUV((double)(par1 + 0), (double)(par2 + par6), 0.0D, (double)((float)(par3 + 0) * var7), (double)((float)(par4 + par6) * var8)); ++ var9.addVertexWithUV((double)(par1 + par5), (double)(par2 + par6), 0.0D, (double)((float)(par3 + par5) * var7), (double)((float)(par4 + par6) * var8)); ++ var9.addVertexWithUV((double)(par1 + par5), (double)(par2 + 0), 0.0D, (double)((float)(par3 + par5) * var7), (double)((float)(par4 + 0) * var8)); ++ var9.addVertexWithUV((double)(par1 + 0), (double)(par2 + 0), 0.0D, (double)((float)(par3 + 0) * var7), (double)((float)(par4 + 0) * var8)); + var9.draw(); + } + ++ /** ++ * Returns the save loader that is currently being used ++ */ + public ISaveFormat getSaveLoader() { + return this.saveLoader; + } + +- public void displayGuiScreen(GuiScreen var1) { +- if(this.currentScreen != null) { ++ // Spout Start ++ private GuiScreen previousScreen = null; ++ // Spout End ++ ++ /** ++ * Sets the argument GuiScreen as the main (topmost visible) screen. ++ */ ++ // Spout Start ++ public void displayGuiScreen(GuiScreen screen) { ++ displayGuiScreen(screen, true); ++ } ++ ++ public void displayGuiScreen(GuiScreen screen, boolean notify) { ++ // Part of original function ++ if (screen == null && this.theWorld == null) { ++ screen = new org.spoutcraft.client.gui.mainmenu.MainMenu(); ++ } else if (screen == null && this.thePlayer.getHealth() <= 0.0F) { ++ screen = new GuiGameOver(); ++ } ++ ++ ScreenType display = ScreenUtil.getType(screen); ++ ++ if (notify && thePlayer != null && theWorld != null) { ++ // Screen closed ++ SpoutPacket packet = null; ++ Screen widget = null; ++ if (this.currentScreen != null && screen == null) { ++ packet = new PacketScreenAction(ScreenAction.Close, ScreenUtil.getType(this.currentScreen)); ++ widget = currentScreen.getScreen(); ++ } ++ // Screen opened ++ if (screen != null && this.currentScreen == null) { ++ packet = new PacketScreenAction(ScreenAction.Open, display); ++ widget = screen.getScreen(); ++ } ++ // Screen swapped ++ if (screen != null && this.currentScreen != null) { // Hopefully just a submenu ++ packet = new PacketScreenAction(ScreenAction.Open, display); ++ widget = screen.getScreen(); ++ } ++ boolean cancel = false; ++ if (!cancel && packet != null) { ++ SpoutClient.getInstance().getPacketManager().sendSpoutPacket(packet); ++ if (widget instanceof PopupScreen) { ++ ((PopupScreen) widget).close(); ++ } ++ } ++ if (cancel) { ++ return; ++ } ++ } ++ // Spout End ++ if (this.currentScreen != null) { + this.currentScreen.onGuiClosed(); + } + + this.statFileWriter.syncStats(); +- if(var1 == null && this.theWorld == null) { +- var1 = new GuiMainMenu(); +- } else if(var1 == null && this.thePlayer.getHealth() <= 0.0F) { +- var1 = new GuiGameOver(); +- } + +- if(var1 instanceof GuiMainMenu) { +- this.gameSettings.showDebugInfo = false; ++ // Spout Start ++ if (theWorld == null && thePlayer == null && this.ingameGUI != null) { ++ // Spout End + this.ingameGUI.getChatGUI().clearChatMessages(); + } + +- this.currentScreen = (GuiScreen)var1; +- if(var1 != null) { ++ // Spout Start ++ if (previousScreen != null || screen != null) { ++ previousScreen = this.currentScreen; ++ } ++ ++ this.currentScreen = screen; ++ ++ if (screen != null) { ++ // Spout End + this.setIngameNotInFocus(); + ScaledResolution var2 = new ScaledResolution(this.gameSettings, this.displayWidth, this.displayHeight); + int var3 = var2.getScaledWidth(); + int var4 = var2.getScaledHeight(); +- ((GuiScreen)var1).setWorldAndResolution(this, var3, var4); ++ // Spout Start ++ screen.setWorldAndResolution(this, var3, var4); ++ // Spout End + this.skipRenderWorld = false; + } else { + this.setIngameFocus(); + } +- +- } +- +- private void checkGLError(String var1) { ++ } ++ ++ // Spout Start ++ public void displayPreviousScreen() { ++ displayGuiScreen(previousScreen, false); ++ previousScreen = null; ++ } ++ ++ public void clearPreviousScreen() { ++ previousScreen = null; ++ } ++ // Spout End ++ ++ /** ++ * Checks for an OpenGL error. If there is one, prints the error ID and error string. ++ */ ++ private void checkGLError(String par1Str) { + int var2 = GL11.glGetError(); +- if(var2 != 0) { +- String var3 = GLU.gluErrorString(var2); +- this.getLogAgent().logSevere("########## GL ERROR ##########"); +- this.getLogAgent().logSevere("@ " + var1); +- this.getLogAgent().logSevere(var2 + ": " + var3); ++ ++ if (var2 != 0) { ++ // Spout Start ++ if (!org.spoutcraft.client.gui.mainmenu.MainMenu.hasLoaded) { ++ return; ++ } + } +- + } + ++ /** ++ * Shuts down the minecraft applet by stopping the resource downloads, and clearing up GL stuff; called when the ++ * application (or web page) is exited. ++ */ + public void shutdownMinecraftApplet() { ++ // Spout Start ++ if (shutdown) { ++ return; ++ } ++ shutdown = true; ++ // Spout End + try { + this.statFileWriter.syncStats(); +- this.getLogAgent().logInfo("Stopping!"); ++ ++ this.getLogAgent().logInfo("Stopping!"); + + try { + this.loadWorld((WorldClient)null); + } catch (Throwable var7) { ++ ; + } + + try { + GLAllocation.deleteTexturesAndDisplayLists(); + } catch (Throwable var6) { ++ ; + } + +- this.sndManager.cleanup(); ++ this.sndManager.cleanup(); + } finally { + Display.destroy(); +- if(!this.hasCrashed) { ++ ++ if (!this.hasCrashed) { + System.exit(0); + } +- + } + + System.gc(); +@@ -488,8 +746,8 @@ + + public void run() { + this.running = true; +- + CrashReport var2; ++ + try { + this.startGame(); + } catch (Throwable var11) { +@@ -500,14 +758,14 @@ + } + + try { +- try { +- while(this.running) { +- if(this.hasCrashed && this.crashReporter != null) { ++ while (this.running) { ++ if (this.running) { ++ if (this.hasCrashed && this.crashReporter != null) { + this.displayCrashReport(this.crashReporter); + return; + } + +- if(this.refreshTexturePacksScheduled) { ++ if (this.refreshTexturePacksScheduled) { + this.refreshTexturePacksScheduled = false; + this.refreshResources(); + } +@@ -519,39 +777,82 @@ + this.displayGuiScreen(new GuiMemoryErrorScreen()); + System.gc(); + } ++ // Spout Start ++ catch (Throwable t) { ++ // Try to handle errors gracefuly ++ try { ++ t.printStackTrace(); ++ this.theWorld = null; ++ this.loadWorld((WorldClient) null); ++ this.displayGuiScreen(new org.spoutcraft.client.gui.error.GuiUnexpectedError(t)); ++ } catch (Throwable failed) { ++ failed.printStackTrace(); ++ throw new RuntimeException(t); ++ } ++ } ++ // Spout End ++ continue; + } +- +- return; +- } catch (MinecraftError var12) { +- } catch (ReportedException var13) { +- this.addGraphicsAndWorldToCrashReport(var13.getCrashReport()); +- this.freeMemory(); +- var13.printStackTrace(); +- this.displayCrashReport(var13.getCrashReport()); +- } catch (Throwable var14) { +- var2 = this.addGraphicsAndWorldToCrashReport(new CrashReport("Unexpected error", var14)); +- this.freeMemory(); +- var14.printStackTrace(); +- this.displayCrashReport(var2); + } +- ++ } catch (MinecraftError var12) { ++ } catch (ReportedException var13) { ++ this.addGraphicsAndWorldToCrashReport(var13.getCrashReport()); ++ this.freeMemory(); ++ var13.printStackTrace(); ++ this.displayCrashReport(var13.getCrashReport()); ++ } catch (Throwable var14) { ++ var2 = this.addGraphicsAndWorldToCrashReport(new CrashReport("Unexpected error", var14)); ++ this.freeMemory(); ++ var14.printStackTrace(); ++ this.displayCrashReport(var2); + } finally { ++ // Spout Start ++ if (theWorld != null) { ++ HeightMap map = HeightMap.getHeightMap(MinimapUtils.getWorldName()); ++ if (map.isDirty()) { ++ map.saveThreaded(); ++ } ++ } ++ HeightMap.joinSaveThread(); ++ // Spout End + this.shutdownMinecraftApplet(); + } + } + ++ /** ++ * Called repeatedly from run() ++ */ + private void runGameLoop() { ++ TexturePackChangeHandler.checkForTexturePackChange(); ++ ++ // Spout Start ++ this.checkGLError("First render check"); ++ // Spout End ++ + AxisAlignedBB.getAABBPool().cleanPool(); +- if(this.theWorld != null) { ++ ++ // Spout Start ++ mainThread = Thread.currentThread(); ++ if (sndManager != null) { ++ sndManager.tick(); ++ } ++ // Spout End ++ ++ if (this.theWorld != null) { + this.theWorld.getWorldVec3Pool().clear(); + } + + this.mcProfiler.startSection("root"); +- if(Display.isCloseRequested()) { ++ ++ if (Display.isCloseRequested()) { + this.shutdown(); + } + +- if(this.isGamePaused && this.theWorld != null) { ++ // Spout Start ++ this.checkGLError("Pre*3 render"); ++ // Spout End ++ ++ if (this.isGamePaused && this.theWorld != null) { + float var1 = this.timer.renderPartialTicks; + this.timer.updateTimer(); + this.timer.renderPartialTicks = var1; +@@ -559,10 +860,14 @@ + this.timer.updateTimer(); + } + ++ // Spout Start ++ this.checkGLError("Pre pre render"); ++ // Spout End ++ + long var6 = System.nanoTime(); + this.mcProfiler.startSection("tick"); + +- for(int var3 = 0; var3 < this.timer.elapsedTicks; ++var3) { ++ for (int var3 = 0; var3 < this.timer.elapsedTicks; ++var3) { + this.runTick(); + } + +@@ -572,24 +877,35 @@ + RenderBlocks.fancyGrass = this.gameSettings.fancyGraphics; + this.mcProfiler.endStartSection("sound"); + this.sndManager.setListener(this.thePlayer, this.timer.renderPartialTicks); +- if(!this.isGamePaused) { ++ ++ if (!this.isGamePaused) { + this.sndManager.func_92071_g(); + } + + this.mcProfiler.endSection(); ++ // Spout Start ++ if (this.thePlayer != null) { ++ this.mcProfiler.startSection("spoutclient"); ++ SpoutClient.getInstance().onTick(); // Spout - tick ++ this.mcProfiler.endSection(); ++ // Spout End ++ } ++ + this.mcProfiler.startSection("render"); + this.mcProfiler.startSection("display"); + GL11.glEnable(GL11.GL_TEXTURE_2D); +- if(!Keyboard.isKeyDown(Keyboard.KEY_F7)) { ++ ++ if (!Keyboard.isKeyDown(65)) { + Display.update(); + } + +- if(this.thePlayer != null && this.thePlayer.isEntityInsideOpaqueBlock()) { ++ if (this.thePlayer != null && this.thePlayer.isEntityInsideOpaqueBlock()) { + this.gameSettings.thirdPersonView = 0; + } + + this.mcProfiler.endSection(); +- if(!this.skipRenderWorld) { ++ ++ if (!this.skipRenderWorld) { + this.mcProfiler.endStartSection("gameRenderer"); + this.entityRenderer.updateCameraAndRender(this.timer.renderPartialTicks); + this.mcProfiler.endSection(); +@@ -597,12 +913,13 @@ + + GL11.glFlush(); + this.mcProfiler.endSection(); +- if(!Display.isActive() && this.fullscreen) { ++ ++ if (!Display.isActive() && this.fullscreen) { + this.toggleFullscreen(); + } + +- if(this.gameSettings.showDebugInfo && this.gameSettings.showDebugProfilerChart) { +- if(!this.mcProfiler.profilingEnabled) { ++ if (this.gameSettings.showDebugInfo && this.gameSettings.showDebugProfilerChart) { ++ if (!this.mcProfiler.profilingEnabled) { + this.mcProfiler.clearProfiling(); + } + +@@ -616,19 +933,22 @@ + this.guiAchievement.updateAchievementWindow(); + this.mcProfiler.startSection("root"); + Thread.yield(); +- if(Keyboard.isKeyDown(Keyboard.KEY_F7)) { ++ ++ if (Keyboard.isKeyDown(65)) { + Display.update(); + } + + this.screenshotListener(); +- if(!this.fullscreen && Display.wasResized()) { ++ ++ if (!this.fullscreen && Display.wasResized()) { + this.displayWidth = Display.getWidth(); + this.displayHeight = Display.getHeight(); +- if(this.displayWidth <= 0) { ++ ++ if (this.displayWidth <= 0) { + this.displayWidth = 1; + } + +- if(this.displayHeight <= 0) { ++ if (this.displayHeight <= 0) { + this.displayHeight = 1; + } + +@@ -639,27 +959,44 @@ + ++this.fpsCounter; + boolean var5 = this.isGamePaused; + this.isGamePaused = this.isSingleplayer() && this.currentScreen != null && this.currentScreen.doesGuiPauseGame() && !this.theIntegratedServer.getPublic(); +- if(this.isIntegratedServerRunning() && this.thePlayer != null && this.thePlayer.sendQueue != null && this.isGamePaused != var5) { ++ ++ if (this.isIntegratedServerRunning() && this.thePlayer != null && this.thePlayer.sendQueue != null && this.isGamePaused != var5) { + ((MemoryConnection)this.thePlayer.sendQueue.getNetManager()).setGamePaused(this.isGamePaused); + } + +- while(getSystemTime() >= this.debugUpdateTime + 1000L) { ++ // Spout Start ++ this.checkGLError("Late render"); ++ // Spout End ++ ++ while (getSystemTime() >= this.debugUpdateTime + 1000L) { + debugFPS = this.fpsCounter; +- this.E = debugFPS + " fps, " + WorldRenderer.chunksUpdated + " chunk updates"; ++ this.debug = debugFPS + " fps, " + WorldRenderer.chunksUpdated + " chunk updates"; + WorldRenderer.chunksUpdated = 0; + this.debugUpdateTime += 1000L; ++ ++ // Spout Start ++ framesPerSecond = fpsCounter; ++ checkGLError("Late render before fps"); ++ SpoutWorth.getInstance().updateFPS(framesPerSecond); ++ checkGLError("Late render after fps"); ++ // Spout End ++ + this.fpsCounter = 0; + this.usageSnooper.addMemoryStatsToSnooper(); +- if(!this.usageSnooper.isSnooperRunning()) { ++ ++ if (!this.usageSnooper.isSnooperRunning()) { + this.usageSnooper.startSnooper(); + } + } + + this.mcProfiler.endSection(); +- if(this.getLimitFramerate() > 0) { ++ ++ if (this.getLimitFramerate() > 0) { + Display.sync(EntityRenderer.performanceToFps(this.getLimitFramerate())); + } +- ++ // Spout Start ++ this.checkGLError("After sync"); ++ // Spout End + } + + private int getLimitFramerate() { +@@ -667,10 +1004,11 @@ + } + + public void freeMemory() { +- try { +- memoryReserve = new byte[0]; ++ try { ++ memoryReserve = new byte[0]; + this.renderGlobal.deleteAllDisplayLists(); + } catch (Throwable var4) { ++ ; + } + + try { +@@ -678,57 +1016,74 @@ + AxisAlignedBB.getAABBPool().clearPool(); + this.theWorld.getWorldVec3Pool().clearAndFreeCache(); + } catch (Throwable var3) { ++ ; + } + + try { + System.gc(); + this.loadWorld((WorldClient)null); + } catch (Throwable var2) { ++ ; + } + + System.gc(); + } + ++ /** ++ * checks if keys are down ++ */ + private void screenshotListener() { +- if(Keyboard.isKeyDown(Keyboard.KEY_F2)) { +- if(!this.isTakingScreenshot) { ++ if (Keyboard.isKeyDown(60)) { ++ if (!this.isTakingScreenshot) { + this.isTakingScreenshot = true; +- this.ingameGUI.getChatGUI().printChatMessage(ScreenShotHelper.saveScreenshot(this.x, this.displayWidth, this.displayHeight)); ++ if (theWorld != null) { ++ this.ingameGUI.getChatGUI().printChatMessage(ScreenShotHelper.saveScreenshot(this.mcDataDir, this.displayWidth, this.displayHeight)); ++ } + } + } else { + this.isTakingScreenshot = false; + } +- + } + +- private void updateDebugProfilerName(int var1) { +- List var2 = this.mcProfiler.getProfilingData(this.au); +- if(var2 != null && !var2.isEmpty()) { ++ /** ++ * Update debugProfilerName in response to number keys in debug screen ++ */ ++ private void updateDebugProfilerName(int par1) { ++ List var2 = this.mcProfiler.getProfilingData(this.debugProfilerName); ++ ++ if (var2 != null && !var2.isEmpty()) { + ProfilerResult var3 = (ProfilerResult)var2.remove(0); +- if(var1 == 0) { +- if(var3.c.length() > 0) { +- int var4 = this.au.lastIndexOf("."); +- if(var4 >= 0) { +- this.au = this.au.substring(0, var4); ++ ++ if (par1 == 0) { ++ if (var3.field_76331_c.length() > 0) { ++ int var4 = this.debugProfilerName.lastIndexOf("."); ++ ++ if (var4 >= 0) { ++ this.debugProfilerName = this.debugProfilerName.substring(0, var4); + } + } + } else { +- --var1; +- if(var1 < var2.size() && !((ProfilerResult)var2.get(var1)).c.equals("unspecified")) { +- if(this.au.length() > 0) { +- this.au = this.au + "."; ++ --par1; ++ ++ if (par1 < var2.size() && !((ProfilerResult)var2.get(par1)).field_76331_c.equals("unspecified")) { ++ if (this.debugProfilerName.length() > 0) { ++ this.debugProfilerName = this.debugProfilerName + "."; + } + +- this.au = this.au + ((ProfilerResult)var2.get(var1)).c; ++ this.debugProfilerName = this.debugProfilerName + ((ProfilerResult)var2.get(par1)).field_76331_c; + } + } +- + } + } + +- private void displayDebugInfo(long var1) { +- if(this.mcProfiler.profilingEnabled) { +- List var3 = this.mcProfiler.getProfilingData(this.au); ++ private void displayDebugInfo(long par1) { ++ // Spout Start - Only show if no other screens are up ++ if (currentScreen != null) { ++ return; ++ } ++ // Spout End ++ if (this.mcProfiler.profilingEnabled) { ++ List var3 = this.mcProfiler.getProfilingData(this.debugProfilerName); + ProfilerResult var4 = (ProfilerResult)var3.remove(0); + GL11.glClear(GL11.GL_DEPTH_BUFFER_BIT); + GL11.glMatrixMode(GL11.GL_PROJECTION); +@@ -754,21 +1109,21 @@ + var5.draw(); + GL11.glDisable(GL11.GL_BLEND); + double var9 = 0.0D; +- + int var13; +- for(int var11 = 0; var11 < var3.size(); ++var11) { ++ ++ for (int var11 = 0; var11 < var3.size(); ++var11) { + ProfilerResult var12 = (ProfilerResult)var3.get(var11); + var13 = MathHelper.floor_double(var12.field_76332_a / 4.0D) + 1; + var5.startDrawing(6); + var5.setColorOpaque_I(var12.func_76329_a()); + var5.addVertex((double)var7, (double)var8, 0.0D); +- + int var14; + float var15; +- float var16; + float var17; +- for(var14 = var13; var14 >= 0; --var14) { +- var15 = (float)((var9 + var12.field_76332_a * (double)var14 / (double)var13) * (double)((float)Math.PI) * 2.0D / 100.0D); ++ float var16; ++ ++ for (var14 = var13; var14 >= 0; --var14) { ++ var15 = (float)((var9 + var12.field_76332_a * (double)var14 / (double)var13) * Math.PI * 2.0D / 100.0D); + var16 = MathHelper.sin(var15) * (float)var6; + var17 = MathHelper.cos(var15) * (float)var6 * 0.5F; + var5.addVertex((double)((float)var7 + var16), (double)((float)var8 - var17), 0.0D); +@@ -778,8 +1133,8 @@ + var5.startDrawing(5); + var5.setColorOpaque_I((var12.func_76329_a() & 16711422) >> 1); + +- for(var14 = var13; var14 >= 0; --var14) { +- var15 = (float)((var9 + var12.field_76332_a * (double)var14 / (double)var13) * (double)((float)Math.PI) * 2.0D / 100.0D); ++ for (var14 = var13; var14 >= 0; --var14) { ++ var15 = (float)((var9 + var12.field_76332_a * (double)var14 / (double)var13) * Math.PI * 2.0D / 100.0D); + var16 = MathHelper.sin(var15) * (float)var6; + var17 = MathHelper.cos(var15) * (float)var6 * 0.5F; + var5.addVertex((double)((float)var7 + var16), (double)((float)var8 - var17), 0.0D); +@@ -790,190 +1145,221 @@ + var9 += var12.field_76332_a; + } + +- DecimalFormat var18 = new DecimalFormat("##0.00"); ++ DecimalFormat var19 = new DecimalFormat("##0.00"); + GL11.glEnable(GL11.GL_TEXTURE_2D); +- String var19 = ""; +- if(!var4.c.equals("unspecified")) { +- var19 = var19 + "[0] "; ++ String var18 = ""; ++ ++ if (!var4.field_76331_c.equals("unspecified")) { ++ var18 = var18 + "[0] "; + } + +- if(var4.c.length() == 0) { +- var19 = var19 + "ROOT "; ++ if (var4.field_76331_c.length() == 0) { ++ var18 = var18 + "ROOT "; + } else { +- var19 = var19 + var4.c + " "; ++ var18 = var18 + var4.field_76331_c + " "; + } + + var13 = 16777215; +- this.fontRenderer.drawStringWithShadow(var19, var7 - var6, var8 - var6 / 2 - 16, var13); +- FontRenderer var10000 = this.fontRenderer; +- var19 = var18.format(var4.field_76330_b) + "%"; +- var10000.drawStringWithShadow(var19, var7 + var6 - this.fontRenderer.getStringWidth(var19), var8 - var6 / 2 - 16, var13); ++ this.fontRenderer.drawStringWithShadow(var18, var7 - var6, var8 - var6 / 2 - 16, var13); ++ this.fontRenderer.drawStringWithShadow(var18 = var19.format(var4.field_76330_b) + "%", var7 + var6 - this.fontRenderer.getStringWidth(var18), var8 - var6 / 2 - 16, var13); + +- for(int var21 = 0; var21 < var3.size(); ++var21) { ++ for (int var21 = 0; var21 < var3.size(); ++var21) { + ProfilerResult var20 = (ProfilerResult)var3.get(var21); + String var22 = ""; +- if(var20.c.equals("unspecified")) { ++ ++ if (var20.field_76331_c.equals("unspecified")) { + var22 = var22 + "[?] "; + } else { + var22 = var22 + "[" + (var21 + 1) + "] "; + } + +- var22 = var22 + var20.c; ++ var22 = var22 + var20.field_76331_c; + this.fontRenderer.drawStringWithShadow(var22, var7 - var6, var8 + var6 / 2 + var21 * 8 + 20, var20.func_76329_a()); +- var10000 = this.fontRenderer; +- var22 = var18.format(var20.field_76332_a) + "%"; +- var10000.drawStringWithShadow(var22, var7 + var6 - 50 - this.fontRenderer.getStringWidth(var22), var8 + var6 / 2 + var21 * 8 + 20, var20.func_76329_a()); +- var10000 = this.fontRenderer; +- var22 = var18.format(var20.field_76330_b) + "%"; +- var10000.drawStringWithShadow(var22, var7 + var6 - this.fontRenderer.getStringWidth(var22), var8 + var6 / 2 + var21 * 8 + 20, var20.func_76329_a()); ++ this.fontRenderer.drawStringWithShadow(var22 = var19.format(var20.field_76332_a) + "%", var7 + var6 - 50 - this.fontRenderer.getStringWidth(var22), var8 + var6 / 2 + var21 * 8 + 20, var20.func_76329_a()); ++ this.fontRenderer.drawStringWithShadow(var22 = var19.format(var20.field_76330_b) + "%", var7 + var6 - this.fontRenderer.getStringWidth(var22), var8 + var6 / 2 + var21 * 8 + 20, var20.func_76329_a()); + } +- + } + } + ++ /** ++ * Called when the window is closing. Sets 'running' to false which allows the game loop to exit cleanly. ++ */ + public void shutdown() { + this.running = false; + } + ++ /** ++ * Will set the focus to ingame if the Minecraft window is the active with focus. Also clears any GUI screen currently ++ * displayed ++ */ + public void setIngameFocus() { +- if(Display.isActive()) { +- if(!this.inGameHasFocus) { ++ // Spout Start ++ setIngameFocus(true); ++ } ++ ++ public void setIngameFocus(boolean close) { ++ // Spout End ++ if (Display.isActive()) { ++ if (!this.inGameHasFocus) { + this.inGameHasFocus = true; + this.mouseHelper.grabMouseCursor(); +- this.displayGuiScreen((GuiScreen)null); ++ // Spout Start ++ if (close) { ++ this.displayGuiScreen((GuiScreen)null); ++ } ++ // Spout End + this.leftClickCounter = 10000; + } + } + } + ++ /** ++ * Resets the player keystate, disables the ingame focus, and ungrabs the mouse cursor. ++ */ + public void setIngameNotInFocus() { +- if(this.inGameHasFocus) { ++ if (this.inGameHasFocus) { + KeyBinding.unPressAllKeys(); + this.inGameHasFocus = false; + this.mouseHelper.ungrabMouseCursor(); + } + } + ++ /** ++ * Displays the ingame menu ++ */ + public void displayInGameMenu() { +- if(this.currentScreen == null) { ++ if (this.currentScreen == null) { + this.displayGuiScreen(new GuiIngameMenu()); +- if(this.isSingleplayer() && !this.theIntegratedServer.getPublic()) { ++ ++ if (this.isSingleplayer() && !this.theIntegratedServer.getPublic()) { + this.sndManager.pauseAllSounds(); + } +- + } + } + +- private void sendClickBlockToController(int var1, boolean var2) { +- if(!var2) { ++ private void sendClickBlockToController(int par1, boolean par2) { ++ if (!par2) { + this.leftClickCounter = 0; + } + +- if(var1 != 0 || this.leftClickCounter <= 0) { +- if(var2 && this.objectMouseOver != null && this.objectMouseOver.typeOfHit == EnumMovingObjectType.TILE && var1 == 0) { ++ if (par1 != 0 || this.leftClickCounter <= 0) { ++ if (par2 && this.objectMouseOver != null && this.objectMouseOver.typeOfHit == EnumMovingObjectType.TILE && par1 == 0) { + int var3 = this.objectMouseOver.blockX; + int var4 = this.objectMouseOver.blockY; + int var5 = this.objectMouseOver.blockZ; + this.playerController.onPlayerDamageBlock(var3, var4, var5, this.objectMouseOver.sideHit); +- if(this.thePlayer.isCurrentToolAdventureModeExempt(var3, var4, var5)) { ++ ++ if (this.thePlayer.isCurrentToolAdventureModeExempt(var3, var4, var5)) { + this.effectRenderer.addBlockHitEffects(var3, var4, var5, this.objectMouseOver.sideHit); + this.thePlayer.swingItem(); + } + } else { + this.playerController.resetBlockRemoving(); + } +- + } + } + +- private void clickMouse(int var1) { +- if(var1 != 0 || this.leftClickCounter <= 0) { +- if(var1 == 0) { ++ /** ++ * Called whenever the mouse is clicked. Button clicked is 0 for left clicking and 1 for right clicking. Args: ++ * buttonClicked ++ */ ++ private void clickMouse(int par1) { ++ if (par1 != 0 || this.leftClickCounter <= 0) { ++ if (par1 == 0) { + this.thePlayer.swingItem(); + } + +- if(var1 == 1) { ++ if (par1 == 1) { + this.rightClickDelayTimer = 4; + } + + boolean var2 = true; + ItemStack var3 = this.thePlayer.inventory.getCurrentItem(); +- if(this.objectMouseOver == null) { +- if(var1 == 0 && this.playerController.isNotCreative()) { ++ ++ if (this.objectMouseOver == null) { ++ if (par1 == 0 && this.playerController.isNotCreative()) { + this.leftClickCounter = 10; + } +- } else if(this.objectMouseOver.typeOfHit == EnumMovingObjectType.ENTITY) { +- if(var1 == 0) { ++ } else if (this.objectMouseOver.typeOfHit == EnumMovingObjectType.ENTITY) { ++ if (par1 == 0) { + this.playerController.attackEntity(this.thePlayer, this.objectMouseOver.entityHit); + } + +- if(var1 == 1 && this.playerController.func_78768_b(this.thePlayer, this.objectMouseOver.entityHit)) { ++ if (par1 == 1 && this.playerController.func_78768_b(this.thePlayer, this.objectMouseOver.entityHit)) { + var2 = false; + } +- } else if(this.objectMouseOver.typeOfHit == EnumMovingObjectType.TILE) { ++ } else if (this.objectMouseOver.typeOfHit == EnumMovingObjectType.TILE) { + int var4 = this.objectMouseOver.blockX; + int var5 = this.objectMouseOver.blockY; + int var6 = this.objectMouseOver.blockZ; + int var7 = this.objectMouseOver.sideHit; +- if(var1 == 0) { ++ ++ if (par1 == 0) { + this.playerController.clickBlock(var4, var5, var6, this.objectMouseOver.sideHit); + } else { + int var8 = var3 != null ? var3.stackSize : 0; +- if(this.playerController.onPlayerRightClick(this.thePlayer, this.theWorld, var3, var4, var5, var6, var7, this.objectMouseOver.hitVec)) { ++ ++ if (this.playerController.onPlayerRightClick(this.thePlayer, this.theWorld, var3, var4, var5, var6, var7, this.objectMouseOver.hitVec)) { + var2 = false; + this.thePlayer.swingItem(); + } + +- if(var3 == null) { ++ if (var3 == null) { + return; + } + +- if(var3.stackSize == 0) { ++ if (var3.stackSize == 0) { + this.thePlayer.inventory.mainInventory[this.thePlayer.inventory.currentItem] = null; +- } else if(var3.stackSize != var8 || this.playerController.isInCreativeMode()) { ++ } else if (var3.stackSize != var8 || this.playerController.isInCreativeMode()) { + this.entityRenderer.itemRenderer.resetEquippedProgress(); + } + } + } + +- if(var2 && var1 == 1) { ++ if (var2 && par1 == 1) { + ItemStack var9 = this.thePlayer.inventory.getCurrentItem(); +- if(var9 != null && this.playerController.sendUseItem(this.thePlayer, this.theWorld, var9)) { ++ ++ if (var9 != null && this.playerController.sendUseItem(this.thePlayer, this.theWorld, var9)) { + this.entityRenderer.itemRenderer.resetEquippedProgress2(); + } + } +- + } + } + ++ /** ++ * Toggles fullscreen mode. ++ */ + public void toggleFullscreen() { + try { + this.fullscreen = !this.fullscreen; +- if(this.fullscreen) { ++ ++ if (this.fullscreen) { + this.updateDisplayMode(); + this.displayWidth = Display.getDisplayMode().getWidth(); + this.displayHeight = Display.getDisplayMode().getHeight(); +- if(this.displayWidth <= 0) { ++ ++ if (this.displayWidth <= 0) { + this.displayWidth = 1; + } + +- if(this.displayHeight <= 0) { ++ if (this.displayHeight <= 0) { + this.displayHeight = 1; + } + } else { + Display.setDisplayMode(new DisplayMode(this.tempDisplayWidth, this.tempDisplayHeight)); + this.displayWidth = this.tempDisplayWidth; + this.displayHeight = this.tempDisplayHeight; +- if(this.displayWidth <= 0) { ++ ++ if (this.displayWidth <= 0) { + this.displayWidth = 1; + } + +- if(this.displayHeight <= 0) { ++ if (this.displayHeight <= 0) { + this.displayHeight = 1; + } + } + +- if(this.currentScreen != null) { ++ if (this.currentScreen != null) { + this.resize(this.displayWidth, this.displayHeight); + } + +@@ -983,62 +1369,73 @@ + } catch (Exception var2) { + var2.printStackTrace(); + } +- + } + +- private void resize(int var1, int var2) { +- this.displayWidth = var1 <= 0 ? 1 : var1; +- this.displayHeight = var2 <= 0 ? 1 : var2; +- if(this.currentScreen != null) { +- ScaledResolution var3 = new ScaledResolution(this.gameSettings, var1, var2); ++ /** ++ * Called to resize the current screen. ++ */ ++ // Spout Start - private to public ++ public void resize(int par1, int par2) { ++ // Spout End ++ this.displayWidth = par1 <= 0 ? 1 : par1; ++ this.displayHeight = par2 <= 0 ? 1 : par2; ++ ++ if (this.currentScreen != null) { ++ ScaledResolution var3 = new ScaledResolution(this.gameSettings, par1, par2); + int var4 = var3.getScaledWidth(); + int var5 = var3.getScaledHeight(); + this.currentScreen.setWorldAndResolution(this, var4, var5); + } +- + } + ++ /** ++ * Runs the current tick. ++ */ + public void runTick() { +- if(this.rightClickDelayTimer > 0) { ++ if (this.rightClickDelayTimer > 0) { + --this.rightClickDelayTimer; + } + + this.mcProfiler.startSection("stats"); + this.statFileWriter.func_77449_e(); + this.mcProfiler.endStartSection("gui"); +- if(!this.isGamePaused) { ++ ++ if (!this.isGamePaused) { + this.ingameGUI.updateTick(); + } + + this.mcProfiler.endStartSection("pick"); + this.entityRenderer.getMouseOver(1.0F); + this.mcProfiler.endStartSection("gameMode"); +- if(!this.isGamePaused && this.theWorld != null) { ++ ++ if (!this.isGamePaused && this.theWorld != null) { + this.playerController.updateController(); + } +- ++ + this.mcProfiler.endStartSection("textures"); +- if(!this.isGamePaused) { ++ ++ if (!this.isGamePaused) { + this.renderEngine.tick(); + } + +- if(this.currentScreen == null && this.thePlayer != null) { +- if(this.thePlayer.getHealth() <= 0.0F) { ++ if (this.currentScreen == null && this.thePlayer != null) { ++ if (this.thePlayer.getHealth() <= 0.0F) { + this.displayGuiScreen((GuiScreen)null); +- } else if(this.thePlayer.isPlayerSleeping() && this.theWorld != null) { ++ } else if (this.thePlayer.isPlayerSleeping() && this.theWorld != null) { + this.displayGuiScreen(new GuiSleepMP()); + } +- } else if(this.currentScreen != null && this.currentScreen instanceof GuiSleepMP && !this.thePlayer.isPlayerSleeping()) { ++ } else if (this.currentScreen != null && this.currentScreen instanceof GuiSleepMP && !this.thePlayer.isPlayerSleeping()) { + this.displayGuiScreen((GuiScreen)null); + } + +- if(this.currentScreen != null) { ++ if (this.currentScreen != null) { + this.leftClickCounter = 10000; + } + + CrashReport var2; + CrashReportCategory var3; +- if(this.currentScreen != null) { ++ ++ if (this.currentScreen != null) { + try { + this.currentScreen.handleInput(); + } catch (Throwable var6) { +@@ -1048,7 +1445,7 @@ + throw new ReportedException(var2); + } + +- if(this.currentScreen != null) { ++ if (this.currentScreen != null) { + try { + this.currentScreen.updateScreen(); + } catch (Throwable var5) { +@@ -1060,32 +1457,43 @@ + } + } + +- if(this.currentScreen == null || this.currentScreen.allowUserInput) { ++ if (this.currentScreen == null || this.currentScreen.allowUserInput) { + this.mcProfiler.endStartSection("mouse"); +- + int var1; +- while(Mouse.next()) { ++ ++ while (Mouse.next()) { + var1 = Mouse.getEventButton(); +- if(isRunningOnMac && var1 == 0 && (Keyboard.isKeyDown(Keyboard.KEY_LCONTROL) || Keyboard.isKeyDown(Keyboard.KEY_RCONTROL))) { ++ ++ if (isRunningOnMac && var1 == 0 && (Keyboard.isKeyDown(29) || Keyboard.isKeyDown(157))) { + var1 = 1; + } ++ // Spout Start ++ if (var1 >= 0) { ++ ((SimpleKeyBindingManager) SpoutClient.getInstance().getKeyBindingManager()).pressKey(Mouse.getEventButton() - 100, Mouse.getEventButtonState(), ScreenUtil.getType(currentScreen).getCode()); ++ this.thePlayer.handleKeyPress(Mouse.getEventButton() - 100, Mouse.getEventButtonState()); // Spout handle key press ++ } ++ // Spout End + + KeyBinding.setKeyBindState(var1 - 100, Mouse.getEventButtonState()); +- if(Mouse.getEventButtonState()) { ++ ++ if (Mouse.getEventButtonState()) { + KeyBinding.onTick(var1 - 100); + } + + long var9 = getSystemTime() - this.systemTime; +- if(var9 <= 200L) { ++ ++ if (var9 <= 200L) { + int var4 = Mouse.getEventDWheel(); +- if(var4 != 0) { ++ ++ if (var4 != 0) { + this.thePlayer.inventory.changeCurrentItem(var4); +- if(this.gameSettings.noclip) { +- if(var4 > 0) { ++ ++ if (this.gameSettings.noclip) { ++ if (var4 > 0) { + var4 = 1; + } + +- if(var4 < 0) { ++ if (var4 < 0) { + var4 = -1; + } + +@@ -1093,225 +1501,250 @@ + } + } + +- if(this.currentScreen == null) { +- if(!this.inGameHasFocus && Mouse.getEventButtonState()) { ++ if (this.currentScreen == null) { ++ if (!this.inGameHasFocus && Mouse.getEventButtonState()) { + this.setIngameFocus(); + } +- } else if(this.currentScreen != null) { ++ } else if (this.currentScreen != null) { + this.currentScreen.handleMouseInput(); + } + } + } + +- if(this.leftClickCounter > 0) { ++ if (this.leftClickCounter > 0) { + --this.leftClickCounter; + } + + this.mcProfiler.endStartSection("keyboard"); +- +- label440: +- while(true) { +- while(true) { +- boolean var8; +- do { +- if(!Keyboard.next()) { +- var8 = this.gameSettings.chatVisibility != 2; +- +- while(this.gameSettings.keyBindInventory.isPressed()) { +- if(this.playerController.func_110738_j()) { +- this.thePlayer.func_110322_i(); +- } else { +- this.displayGuiScreen(new GuiInventory(this.thePlayer)); +- } +- } +- +- while(this.gameSettings.keyBindDrop.isPressed()) { +- this.thePlayer.dropOneItem(GuiScreen.isCtrlKeyDown()); +- } +- +- while(this.gameSettings.keyBindChat.isPressed() && var8) { +- this.displayGuiScreen(new GuiChat()); +- } +- +- if(this.currentScreen == null && this.gameSettings.keyBindCommand.isPressed() && var8) { +- this.displayGuiScreen(new GuiChat("/")); +- } +- +- if(this.thePlayer.isUsingItem()) { +- if(!this.gameSettings.keyBindUseItem.pressed) { +- this.playerController.onStoppedUsingItem(this.thePlayer); +- } +- +- while(true) { +- if(!this.gameSettings.keyBindAttack.isPressed()) { +- while(this.gameSettings.keyBindUseItem.isPressed()) { +- } +- +- while(this.gameSettings.keyBindPickBlock.isPressed()) { +- } +- break; +- } +- } +- } else { +- while(this.gameSettings.keyBindAttack.isPressed()) { +- this.clickMouse(0); +- } +- +- while(this.gameSettings.keyBindUseItem.isPressed()) { +- this.clickMouse(1); +- } +- +- while(this.gameSettings.keyBindPickBlock.isPressed()) { +- this.clickMiddleMouseButton(); +- } +- } +- +- if(this.gameSettings.keyBindUseItem.pressed && this.rightClickDelayTimer == 0 && !this.thePlayer.isUsingItem()) { +- this.clickMouse(1); +- } +- +- this.sendClickBlockToController(0, this.currentScreen == null && this.gameSettings.keyBindAttack.pressed && this.inGameHasFocus); +- break label440; +- } +- +- KeyBinding.setKeyBindState(Keyboard.getEventKey(), Keyboard.getEventKeyState()); +- if(Keyboard.getEventKeyState()) { +- KeyBinding.onTick(Keyboard.getEventKey()); +- } +- +- if(this.field_83002_am > 0L) { +- if(getSystemTime() - this.field_83002_am >= 6000L) { +- throw new ReportedException(new CrashReport("Manually triggered debug crash", new Throwable())); +- } +- +- if(!Keyboard.isKeyDown(Keyboard.KEY_C) || !Keyboard.isKeyDown(Keyboard.KEY_F3)) { +- this.field_83002_am = -1L; +- } +- } else if(Keyboard.isKeyDown(Keyboard.KEY_C) && Keyboard.isKeyDown(Keyboard.KEY_F3)) { +- this.field_83002_am = getSystemTime(); +- } +- } while(!Keyboard.getEventKeyState()); +- +- if(Keyboard.getEventKey() == Keyboard.KEY_F11) { ++ boolean var8; ++ ++ while (Keyboard.next()) { ++ // Spout Start ++ ((SimpleKeyBindingManager) SpoutClient.getInstance().getKeyBindingManager()).pressKey(Keyboard.getEventKey(), Keyboard.getEventKeyState(), ScreenUtil.getType(currentScreen).getCode()); ++ this.thePlayer.handleKeyPress(Keyboard.getEventKey(), Keyboard.getEventKeyState()); // Spout handle key press ++ // Spout End ++ ++ KeyBinding.setKeyBindState(Keyboard.getEventKey(), Keyboard.getEventKeyState()); ++ ++ if (Keyboard.getEventKeyState()) { ++ KeyBinding.onTick(Keyboard.getEventKey()); ++ } ++ ++ if (this.field_83002_am > 0L) { ++ if (getSystemTime() - this.field_83002_am >= 6000L) { ++ throw new ReportedException(new CrashReport("Manually triggered debug crash", new Throwable())); ++ } ++ ++ if (!Keyboard.isKeyDown(46) || !Keyboard.isKeyDown(61)) { ++ this.field_83002_am = -1L; ++ } ++ } else if (Keyboard.isKeyDown(46) && Keyboard.isKeyDown(61)) { ++ this.field_83002_am = getSystemTime(); ++ } ++ ++ if (Keyboard.getEventKeyState()) { ++ if (Keyboard.getEventKey() == 87) { + this.toggleFullscreen(); + } else { +- if(this.currentScreen != null) { ++ if (this.currentScreen != null) { + this.currentScreen.handleKeyboardInput(); + } else { +- if(Keyboard.getEventKey() == Keyboard.KEY_ESCAPE) { ++ if (Keyboard.getEventKey() == 1) { + this.displayInGameMenu(); + } + +- if(Keyboard.getEventKey() == Keyboard.KEY_S && Keyboard.isKeyDown(Keyboard.KEY_F3)) { +- this.refreshResources(); +- } +- +- if(Keyboard.getEventKey() == Keyboard.KEY_T && Keyboard.isKeyDown(Keyboard.KEY_F3)) { +- this.refreshResources(); +- } +- +- if(Keyboard.getEventKey() == Keyboard.KEY_F && Keyboard.isKeyDown(Keyboard.KEY_F3)) { +- var8 = Keyboard.isKeyDown(Keyboard.KEY_LSHIFT) | Keyboard.isKeyDown(Keyboard.KEY_RSHIFT); ++ if (Keyboard.getEventKey() == 31 && Keyboard.isKeyDown(61)) { ++ this.refreshResources(); ++ } ++ ++ if (Keyboard.getEventKey() == 20 && Keyboard.isKeyDown(61)) { ++ this.refreshResources(); ++ } ++ ++ if (Keyboard.getEventKey() == 33 && Keyboard.isKeyDown(61)) { ++ var8 = Keyboard.isKeyDown(42) | Keyboard.isKeyDown(54); + this.gameSettings.setOptionValue(EnumOptions.RENDER_DISTANCE, var8 ? -1 : 1); + } + +- if(Keyboard.getEventKey() == Keyboard.KEY_A && Keyboard.isKeyDown(Keyboard.KEY_F3)) { ++ if (Keyboard.getEventKey() == 30 && Keyboard.isKeyDown(61)) { + this.renderGlobal.loadRenderers(); + } + +- if(Keyboard.getEventKey() == Keyboard.KEY_H && Keyboard.isKeyDown(Keyboard.KEY_F3)) { ++ if (Keyboard.getEventKey() == 35 && Keyboard.isKeyDown(61)) { + this.gameSettings.advancedItemTooltips = !this.gameSettings.advancedItemTooltips; + this.gameSettings.saveOptions(); + } + +- if(Keyboard.getEventKey() == Keyboard.KEY_B && Keyboard.isKeyDown(Keyboard.KEY_F3)) { ++ if (Keyboard.getEventKey() == 48 && Keyboard.isKeyDown(61)) { + RenderManager.field_85095_o = !RenderManager.field_85095_o; + } + +- if(Keyboard.getEventKey() == Keyboard.KEY_P && Keyboard.isKeyDown(Keyboard.KEY_F3)) { ++ if (Keyboard.getEventKey() == 25 && Keyboard.isKeyDown(61)) { + this.gameSettings.pauseOnLostFocus = !this.gameSettings.pauseOnLostFocus; + this.gameSettings.saveOptions(); + } + +- if(Keyboard.getEventKey() == Keyboard.KEY_F1) { ++ if (Keyboard.getEventKey() == 59) { + this.gameSettings.hideGUI = !this.gameSettings.hideGUI; + } + +- if(Keyboard.getEventKey() == Keyboard.KEY_F3) { ++ if (Keyboard.getEventKey() == 61) { + this.gameSettings.showDebugInfo = !this.gameSettings.showDebugInfo; + this.gameSettings.showDebugProfilerChart = GuiScreen.isShiftKeyDown(); + } + +- if(Keyboard.getEventKey() == Keyboard.KEY_F5) { ++ if (Keyboard.getEventKey() == 63) { + ++this.gameSettings.thirdPersonView; +- if(this.gameSettings.thirdPersonView > 2) { ++ ++ if (this.gameSettings.thirdPersonView > 2) { + this.gameSettings.thirdPersonView = 0; + } + } + +- if(Keyboard.getEventKey() == Keyboard.KEY_F8) { ++ if (Keyboard.getEventKey() == 66) { + this.gameSettings.smoothCamera = !this.gameSettings.smoothCamera; + } + } + +- for(var1 = 0; var1 < 9; ++var1) { +- if(Keyboard.getEventKey() == Keyboard.KEY_1 + var1) { +- this.thePlayer.inventory.currentItem = var1; ++ int var9; ++ // Spout Start ++ if (Configuration.isHotbarQuickKeysEnabled()) { ++ for (var9 = 0; var9 < 9; ++var9) { ++ if (Keyboard.getEventKey() == 2 + var9) { ++ this.thePlayer.inventory.currentItem = var9; ++ } + } + } ++ // Spout End + +- if(this.gameSettings.showDebugInfo && this.gameSettings.showDebugProfilerChart) { +- if(Keyboard.getEventKey() == Keyboard.KEY_0) { ++ if (this.gameSettings.showDebugInfo && this.gameSettings.showDebugProfilerChart) { ++ if (Keyboard.getEventKey() == 11) { + this.updateDebugProfilerName(0); + } + +- for(var1 = 0; var1 < 9; ++var1) { +- if(Keyboard.getEventKey() == Keyboard.KEY_1 + var1) { +- this.updateDebugProfilerName(var1 + 1); +- } +- } +- } +- } +- } +- } ++ for (var9 = 0; var9 < 9; ++var9) { ++ if (Keyboard.getEventKey() == 2 + var9) { ++ this.updateDebugProfilerName(var9 + 1); ++ } ++ } ++ } ++ } ++ } ++ } ++ ++ var8 = this.gameSettings.chatVisibility != 2; ++ ++ while (this.gameSettings.keyBindInventory.isPressed()) { ++ if (this.playerController.func_110738_j()) { ++ this.thePlayer.func_110322_i(); ++ } else { ++ this.displayGuiScreen(new GuiInventory(this.thePlayer)); ++ } ++ } ++ ++ while (this.gameSettings.keyBindDrop.isPressed()) { ++ this.thePlayer.dropOneItem(GuiScreen.isCtrlKeyDown()); ++ } ++ ++ while (this.gameSettings.keyBindChat.isPressed() && var8) { ++ this.displayGuiScreen(new GuiChat()); ++ } ++ ++ // Spout Start - Open chat in SP with debug key ++ if (this.currentScreen == null && this.gameSettings.keyBindCommand.isPressed() && var8 && Keyboard.getEventKey() != Keyboard.KEY_SLASH && isIntegratedServerRunning()) { ++ this.displayGuiScreen(new GuiChat()); ++ thePlayer.sendChatMessage(ChatColor.RED + "Debug Console Opened"); ++ } ++ ++ if (currentScreen == null && Keyboard.getEventKey() == Keyboard.KEY_SLASH) { ++ // Spout End ++ this.displayGuiScreen(new GuiChat("/")); ++ } ++ ++ if (this.thePlayer.isUsingItem()) { ++ if (!this.gameSettings.keyBindUseItem.pressed) { ++ this.playerController.onStoppedUsingItem(this.thePlayer); ++ } ++ ++ label381: ++ ++ while (true) { ++ if (!this.gameSettings.keyBindAttack.isPressed()) { ++ while (this.gameSettings.keyBindUseItem.isPressed()) { ++ ; ++ } ++ ++ while (true) { ++ if (this.gameSettings.keyBindPickBlock.isPressed()) { ++ continue; ++ } ++ ++ break label381; ++ } ++ } ++ } ++ } else { ++ while (this.gameSettings.keyBindAttack.isPressed()) { ++ this.clickMouse(0); ++ } ++ ++ while (this.gameSettings.keyBindUseItem.isPressed()) { ++ this.clickMouse(1); ++ } ++ ++ while (this.gameSettings.keyBindPickBlock.isPressed()) { ++ this.clickMiddleMouseButton(); ++ } ++ } ++ ++ if (this.gameSettings.keyBindUseItem.pressed && this.rightClickDelayTimer == 0 && !this.thePlayer.isUsingItem()) { ++ this.clickMouse(1); ++ } ++ ++ this.sendClickBlockToController(0, this.currentScreen == null && this.gameSettings.keyBindAttack.pressed && this.inGameHasFocus); + } + +- if(this.theWorld != null) { +- if(this.thePlayer != null) { ++ if (this.theWorld != null) { ++ if (this.thePlayer != null) { + ++this.joinPlayerCounter; +- if(this.joinPlayerCounter == 30) { ++ ++ if (this.joinPlayerCounter == 30) { + this.joinPlayerCounter = 0; + this.theWorld.joinEntityInSurroundings(this.thePlayer); + } + } + + this.mcProfiler.endStartSection("gameRenderer"); +- if(!this.isGamePaused) { ++ ++ if (!this.isGamePaused) { + this.entityRenderer.updateRenderer(); + } + + this.mcProfiler.endStartSection("levelRenderer"); +- if(!this.isGamePaused) { ++ ++ if (!this.isGamePaused) { + this.renderGlobal.updateClouds(); + } + + this.mcProfiler.endStartSection("level"); +- if(!this.isGamePaused) { +- if(this.theWorld.lastLightningBolt > 0) { ++ ++ if (!this.isGamePaused) { ++ if (this.theWorld.lastLightningBolt > 0) { + --this.theWorld.lastLightningBolt; + } + + this.theWorld.updateEntities(); + } + +- if(!this.isGamePaused) { ++ if (!this.isGamePaused) { + this.theWorld.setAllowedSpawnTypes(this.theWorld.difficultySetting > 0, true); + + try { + this.theWorld.tick(); + } catch (Throwable var7) { + var2 = CrashReport.makeCrashReport(var7, "Exception in world tick"); +- if(this.theWorld == null) { ++ ++ if (this.theWorld == null) { + var3 = var2.makeCategory("Affected level"); + var3.addCrashSection("Problem", "Level is null!"); + } else { +@@ -1323,15 +1756,17 @@ + } + + this.mcProfiler.endStartSection("animateTick"); +- if(!this.isGamePaused && this.theWorld != null) { ++ ++ if (!this.isGamePaused && this.theWorld != null) { + this.theWorld.doVoidFogParticles(MathHelper.floor_double(this.thePlayer.posX), MathHelper.floor_double(this.thePlayer.posY), MathHelper.floor_double(this.thePlayer.posZ)); + } + + this.mcProfiler.endStartSection("particles"); +- if(!this.isGamePaused) { ++ ++ if (!this.isGamePaused) { + this.effectRenderer.updateEffects(); + } +- } else if(this.myNetworkManager != null) { ++ } else if (this.myNetworkManager != null) { + this.mcProfiler.endStartSection("pendingConnection"); + this.myNetworkManager.processReadPackets(); + } +@@ -1340,37 +1775,43 @@ + this.systemTime = getSystemTime(); + } + +- public void launchIntegratedServer(String var1, String var2, WorldSettings var3) { ++ /** ++ * Arguments: World foldername, World ingame name, WorldSettings ++ */ ++ public void launchIntegratedServer(String par1Str, String par2Str, WorldSettings par3WorldSettings) { + this.loadWorld((WorldClient)null); + System.gc(); +- ISaveHandler var4 = this.saveLoader.getSaveLoader(var1, false); ++ ISaveHandler var4 = this.saveLoader.getSaveLoader(par1Str, false); + WorldInfo var5 = var4.loadWorldInfo(); +- if(var5 == null && var3 != null) { +- var5 = new WorldInfo(var3, var1); ++ ++ if (var5 == null && par3WorldSettings != null) { ++ var5 = new WorldInfo(par3WorldSettings, par1Str); + var4.saveWorldInfo(var5); + } + +- if(var3 == null) { +- var3 = new WorldSettings(var5); ++ if (par3WorldSettings == null) { ++ par3WorldSettings = new WorldSettings(var5); + } + + this.statFileWriter.readStat(StatList.startGameStat, 1); +- this.theIntegratedServer = new IntegratedServer(this, var1, var2, var3); ++ this.theIntegratedServer = new IntegratedServer(this, par1Str, par2Str, par3WorldSettings); + this.theIntegratedServer.startServerThread(); + this.integratedServerIsRunning = true; +- this.loadingScreen.displaySavingString(I18n.getString("menu.loadingLevel")); ++ this.loadingScreen.displayProgressMessage(I18n.getString("menu.loadingLevel")); + +- while(!this.theIntegratedServer.serverIsInRunLoop()) { ++ while (!this.theIntegratedServer.serverIsInRunLoop()) { + String var6 = this.theIntegratedServer.getUserMessage(); +- if(var6 != null) { +- this.loadingScreen.displayLoadingString(I18n.getString(var6)); ++ ++ if (var6 != null) { ++ this.loadingScreen.resetProgresAndWorkingMessage(I18n.getString(var6)); + } else { +- this.loadingScreen.displayLoadingString(""); ++ this.loadingScreen.resetProgresAndWorkingMessage(""); + } + + try { + Thread.sleep(200L); + } catch (InterruptedException var9) { ++ ; + } + } + +@@ -1382,26 +1823,33 @@ + } catch (IOException var8) { + this.displayCrashReport(this.addGraphicsAndWorldToCrashReport(new CrashReport("Connecting to integrated server", var8))); + } +- +- } +- +- public void loadWorld(WorldClient var1) { +- this.loadWorld(var1, ""); +- } +- +- public void loadWorld(WorldClient var1, String var2) { ++ } ++ ++ /** ++ * unloads the current world first ++ */ ++ public void loadWorld(WorldClient par1WorldClient) { ++ this.loadWorld(par1WorldClient, ""); ++ } ++ ++ /** ++ * par2Str is displayed on the loading screen to the user unloads the current world first ++ */ ++ public void loadWorld(WorldClient par1WorldClient, String par2Str) { + this.statFileWriter.syncStats(); +- if(var1 == null) { ++ ++ if (par1WorldClient == null) { + NetClientHandler var3 = this.getNetHandler(); +- if(var3 != null) { ++ ++ if (var3 != null) { + var3.cleanup(); + } + +- if(this.myNetworkManager != null) { ++ if (this.myNetworkManager != null) { + this.myNetworkManager.closeConnections(); + } + +- if(this.theIntegratedServer != null) { ++ if (this.theIntegratedServer != null) { + this.theIntegratedServer.initiateShutdown(); + } + +@@ -1410,69 +1858,90 @@ + + this.renderViewEntity = null; + this.myNetworkManager = null; +- if(this.loadingScreen != null) { +- this.loadingScreen.resetProgressAndMessage(var2); +- this.loadingScreen.displayLoadingString(""); ++ ++ if (this.loadingScreen != null) { ++ this.loadingScreen.resetProgressAndMessage(par2Str); ++ this.loadingScreen.resetProgresAndWorkingMessage(""); + } + +- if(var1 == null && this.theWorld != null) { ++ if (par1WorldClient == null && this.theWorld != null) { + this.setServerData((ServerData)null); + this.integratedServerIsRunning = false; + } + + this.sndManager.playStreaming((String)null, 0.0F, 0.0F, 0.0F); + this.sndManager.stopAllSounds(); +- this.theWorld = var1; +- if(var1 != null) { +- if(this.renderGlobal != null) { +- this.renderGlobal.setWorldAndLoadRenderers(var1); +- } +- +- if(this.effectRenderer != null) { +- this.effectRenderer.clearEffects(var1); +- } +- +- if(this.thePlayer == null) { +- this.thePlayer = this.playerController.func_78754_a(var1); ++ this.theWorld = par1WorldClient; ++ ++ if (par1WorldClient != null) { ++ if (this.renderGlobal != null) { ++ this.renderGlobal.setWorldAndLoadRenderers(par1WorldClient); ++ } ++ ++ if (this.effectRenderer != null) { ++ this.effectRenderer.clearEffects(par1WorldClient); ++ } ++ ++ if (this.thePlayer == null) { ++ this.thePlayer = this.playerController.func_78754_a(par1WorldClient); + this.playerController.flipPlayer(this.thePlayer); + } + + this.thePlayer.preparePlayerToSpawn(); +- var1.spawnEntityInWorld(this.thePlayer); ++ par1WorldClient.spawnEntityInWorld(this.thePlayer); + this.thePlayer.movementInput = new MovementInputFromOptions(this.gameSettings); + this.playerController.setPlayerCapabilities(this.thePlayer); + this.renderViewEntity = this.thePlayer; ++ // Spout Start ++ SpoutClient.getInstance().onWorldEnter(); ++ // Spout End + } else { + this.saveLoader.flushCache(); +- this.thePlayer = null; ++ this.thePlayer = null; ++ SpoutClient.getInstance().onWorldExit(); ++ SpoutClient.getInstance().clearPermissions(); ++ // Spout End + } + + System.gc(); + this.systemTime = 0L; + } + ++ /** ++ * A String of renderGlobal.getDebugInfoRenders ++ */ + public String debugInfoRenders() { + return this.renderGlobal.getDebugInfoRenders(); + } + ++ /** ++ * Gets the information in the F3 menu about how many entities are infront/around you ++ */ + public String getEntityDebug() { + return this.renderGlobal.getDebugInfoEntities(); + } + ++ /** ++ * Gets the name of the world's current chunk provider ++ */ + public String getWorldProviderName() { + return this.theWorld.getProviderName(); + } + ++ /** ++ * A String of how many entities are in the world ++ */ + public String debugInfoEntities() { + return "P: " + this.effectRenderer.getStatistics() + ". T: " + this.theWorld.getDebugLoadedEntities(); + } + +- public void setDimensionAndSpawnPlayer(int var1) { ++ public void setDimensionAndSpawnPlayer(int par1) { + this.theWorld.setSpawnLocation(); + this.theWorld.removeAllEntities(); + int var2 = 0; + String var3 = null; +- if(this.thePlayer != null) { ++ ++ if (this.thePlayer != null) { + var2 = this.thePlayer.entityId; + this.theWorld.removeEntity(this.thePlayer); + var3 = this.thePlayer.func_142021_k(); +@@ -1480,7 +1949,7 @@ + + this.renderViewEntity = null; + this.thePlayer = this.playerController.func_78754_a(this.theWorld); +- this.thePlayer.dimension = var1; ++ this.thePlayer.dimension = par1; + this.renderViewEntity = this.thePlayer; + this.thePlayer.preparePlayerToSpawn(); + this.thePlayer.func_142020_c(var3); +@@ -1489,16 +1958,37 @@ + this.thePlayer.movementInput = new MovementInputFromOptions(this.gameSettings); + this.thePlayer.entityId = var2; + this.playerController.setPlayerCapabilities(this.thePlayer); +- if(this.currentScreen instanceof GuiGameOver) { ++ ++ //ToDo: Needs var9.func_110138_aP update. ++ // Spout Start ++ /* ++ EntityPlayer var9 = this.thePlayer; ++ if (var9 != null) { ++ this.thePlayer.setData(var9.getData()); // Even in MP still need to copy Spout data across ++ if (var9.health <= 0) { ++ String name = "Death " + new SimpleDateFormat("dd-MM-yyyy").format(new Date()); ++ Waypoint death = new Waypoint(name, (int)var9.posX, (int)var9.posY, (int)var9.posZ, true); ++ death.deathpoint = true; ++ MinimapConfig.getInstance().addWaypoint(death); ++ } ++ }*/ ++ // Spout End ++ ++ if (this.currentScreen instanceof GuiGameOver) { + this.displayGuiScreen((GuiScreen)null); + } +- + } + ++ /** ++ * Gets whether this is a demo or not. ++ */ + public final boolean isDemo() { + return this.isDemo; + } + ++ /** ++ * Returns the NetClientHandler. ++ */ + public NetClientHandler getNetHandler() { + return this.thePlayer != null ? this.thePlayer.sendQueue : null; + } +@@ -1511,32 +2001,51 @@ + return theMinecraft != null && theMinecraft.gameSettings.fancyGraphics; + } + ++ /** ++ * Returns if ambient occlusion is enabled ++ */ + public static boolean isAmbientOcclusionEnabled() { +- return theMinecraft != null && theMinecraft.gameSettings.ambientOcclusion != 0; +- } +- +- public boolean handleClientCommand(String var1) { ++ // Spout Start ++ return theMinecraft != null && Configuration.ambientOcclusion; ++ // Spout End ++ } ++ ++ public static boolean isDebugInfoEnabled() { ++ return theMinecraft != null && theMinecraft.gameSettings.showDebugInfo; ++ } ++ ++ /** ++ * Returns true if the message is a client command and should not be sent to the server. However there are no such ++ * commands at this point in time. ++ */ ++ public boolean handleClientCommand(String par1Str) { + return false; + } + ++ /** ++ * Called when the middle mouse button gets clicked ++ */ + private void clickMiddleMouseButton() { +- if(this.objectMouseOver != null) { ++ if (this.objectMouseOver != null) { + boolean var1 = this.thePlayer.capabilities.isCreativeMode; + int var3 = 0; + boolean var4 = false; + int var2; + int var5; +- if(this.objectMouseOver.typeOfHit == EnumMovingObjectType.TILE) { ++ ++ if (this.objectMouseOver.typeOfHit == EnumMovingObjectType.TILE) { + var5 = this.objectMouseOver.blockX; + int var6 = this.objectMouseOver.blockY; + int var7 = this.objectMouseOver.blockZ; + Block var8 = Block.blocksList[this.theWorld.getBlockId(var5, var6, var7)]; +- if(var8 == null) { ++ ++ if (var8 == null) { + return; + } + + var2 = var8.idPicked(this.theWorld, var5, var6, var7); +- if(var2 == 0) { ++ ++ if (var2 == 0) { + return; + } + +@@ -1544,122 +2053,136 @@ + int var9 = var2 < 256 && !Block.blocksList[var8.blockID].isFlowerPot() ? var2 : var8.blockID; + var3 = Block.blocksList[var9].getDamageValue(this.theWorld, var5, var6, var7); + } else { +- if(this.objectMouseOver.typeOfHit != EnumMovingObjectType.ENTITY || this.objectMouseOver.entityHit == null || !var1) { ++ if (this.objectMouseOver.typeOfHit != EnumMovingObjectType.ENTITY || this.objectMouseOver.entityHit == null || !var1) { + return; + } + +- if(this.objectMouseOver.entityHit instanceof EntityPainting) { ++ if (this.objectMouseOver.entityHit instanceof EntityPainting) { + var2 = Item.painting.itemID; +- } else if(this.objectMouseOver.entityHit instanceof EntityLeashKnot) { ++ } else if (this.objectMouseOver.entityHit instanceof EntityLeashKnot) { + var2 = Item.leash.itemID; +- } else if(this.objectMouseOver.entityHit instanceof EntityItemFrame) { ++ } else if (this.objectMouseOver.entityHit instanceof EntityItemFrame) { + EntityItemFrame var10 = (EntityItemFrame)this.objectMouseOver.entityHit; +- if(var10.getDisplayedItem() == null) { ++ ++ if (var10.getDisplayedItem() == null) { + var2 = Item.itemFrame.itemID; + } else { + var2 = var10.getDisplayedItem().itemID; + var3 = var10.getDisplayedItem().getItemDamage(); + var4 = true; + } +- } else if(this.objectMouseOver.entityHit instanceof EntityMinecart) { ++ } else if (this.objectMouseOver.entityHit instanceof EntityMinecart) { + EntityMinecart var11 = (EntityMinecart)this.objectMouseOver.entityHit; +- if(var11.getMinecartType() == 2) { ++ ++ if (var11.getMinecartType() == 2) { + var2 = Item.minecartPowered.itemID; +- } else if(var11.getMinecartType() == 1) { ++ } else if (var11.getMinecartType() == 1) { + var2 = Item.minecartCrate.itemID; +- } else if(var11.getMinecartType() == 3) { +- var2 = Item.tntMinecart.itemID; +- } else if(var11.getMinecartType() == 5) { ++ } else if (var11.getMinecartType() == 3) { ++ var2 = Item.minecartTnt.itemID; ++ } else if (var11.getMinecartType() == 5) { + var2 = Item.minecartHopper.itemID; + } else { + var2 = Item.minecartEmpty.itemID; + } +- } else if(this.objectMouseOver.entityHit instanceof EntityBoat) { ++ } else if (this.objectMouseOver.entityHit instanceof EntityBoat) { + var2 = Item.boat.itemID; + } else { + var2 = Item.monsterPlacer.itemID; + var3 = EntityList.getEntityID(this.objectMouseOver.entityHit); + var4 = true; +- if(var3 <= 0 || !EntityList.a.containsKey(Integer.valueOf(var3))) { ++ ++ if (var3 <= 0 || !EntityList.entityEggs.containsKey(Integer.valueOf(var3))) { + return; + } + } + } + + this.thePlayer.inventory.setCurrentItem(var2, var3, var4, var1); +- if(var1) { +- var5 = this.thePlayer.inventoryContainer.c.size() - 9 + this.thePlayer.inventory.currentItem; ++ ++ if (var1) { ++ var5 = this.thePlayer.inventoryContainer.inventorySlots.size() - 9 + this.thePlayer.inventory.currentItem; + this.playerController.sendSlotPacket(this.thePlayer.inventory.getStackInSlot(this.thePlayer.inventory.currentItem), var5); + } +- +- } +- } +- +- public CrashReport addGraphicsAndWorldToCrashReport(CrashReport var1) { +- var1.getCategory().addCrashSectionCallable("Launched Version", new CallableLaunchedVersion(this)); +- var1.getCategory().addCrashSectionCallable("LWJGL", new CallableLWJGLVersion(this)); +- var1.getCategory().addCrashSectionCallable("OpenGL", new CallableGLInfo(this)); +- var1.getCategory().addCrashSectionCallable("Is Modded", new CallableModded(this)); +- var1.getCategory().addCrashSectionCallable("Type", new CallableType2(this)); +- var1.getCategory().addCrashSectionCallable("Resource Pack", new CallableTexturePack(this)); +- var1.getCategory().addCrashSectionCallable("Current Language", new CallableClientProfiler(this)); +- var1.getCategory().addCrashSectionCallable("Profiler Position", new CallableClientMemoryStats(this)); +- var1.getCategory().addCrashSectionCallable("Vec3 Pool Size", new MinecraftINNER13(this)); +- if(this.theWorld != null) { +- this.theWorld.addWorldInfoToCrashReport(var1); +- } +- +- return var1; +- } +- ++ } ++ } ++ ++ /** ++ * adds core server Info (GL version , Texture pack, isModded, type), and the worldInfo to the crash report ++ */ ++ public CrashReport addGraphicsAndWorldToCrashReport(CrashReport par1CrashReport) { ++ par1CrashReport.getCategory().addCrashSectionCallable("Launched Version", new CallableLaunchedVersion(this)); ++ par1CrashReport.getCategory().addCrashSectionCallable("LWJGL", new CallableLWJGLVersion(this)); ++ par1CrashReport.getCategory().addCrashSectionCallable("OpenGL", new CallableGLInfo(this)); ++ par1CrashReport.getCategory().addCrashSectionCallable("Is Modded", new CallableModded(this)); ++ par1CrashReport.getCategory().addCrashSectionCallable("Type", new CallableType2(this)); ++ par1CrashReport.getCategory().addCrashSectionCallable("Resource Pack", new CallableTexturePack(this)); ++ par1CrashReport.getCategory().addCrashSectionCallable("Current Language", new CallableClientProfiler(this)); ++ par1CrashReport.getCategory().addCrashSectionCallable("Profiler Position", new CallableClientMemoryStats(this)); ++ par1CrashReport.getCategory().addCrashSectionCallable("Vec3 Pool Size", new MinecraftINNER13(this)); ++ ++ if (this.theWorld != null) { ++ this.theWorld.addWorldInfoToCrashReport(par1CrashReport); ++ } ++ ++ return par1CrashReport; ++ } ++ ++ /** ++ * Return the singleton Minecraft instance for the game ++ */ + public static Minecraft getMinecraft() { + return theMinecraft; + } + +- public void addServerStatsToSnooper(PlayerUsageSnooper var1) { +- var1.addData("fps", Integer.valueOf(debugFPS)); +- var1.addData("texpack_name", this.mcResourcePackRepository.getResourcePackName()); +- var1.addData("vsync_enabled", Boolean.valueOf(this.gameSettings.enableVsync)); +- var1.addData("display_frequency", Integer.valueOf(Display.getDisplayMode().getFrequency())); +- var1.addData("display_type", this.fullscreen ? "fullscreen" : "windowed"); +- var1.addData("run_time", Long.valueOf((MinecraftServer.getCurrentTimeMillis() - var1.func_130105_g()) / 60L * 1000L)); +- if(this.theIntegratedServer != null && this.theIntegratedServer.getPlayerUsageSnooper() != null) { +- var1.addData("snooper_partner", this.theIntegratedServer.getPlayerUsageSnooper().getUniqueID()); ++ public void addServerStatsToSnooper(PlayerUsageSnooper par1PlayerUsageSnooper) { ++ par1PlayerUsageSnooper.addData("fps", Integer.valueOf(debugFPS)); ++ par1PlayerUsageSnooper.addData("texpack_name", this.mcResourcePackRepository.getResourcePackName()); ++ par1PlayerUsageSnooper.addData("vsync_enabled", Boolean.valueOf(this.gameSettings.enableVsync)); ++ par1PlayerUsageSnooper.addData("display_frequency", Integer.valueOf(Display.getDisplayMode().getFrequency())); ++ par1PlayerUsageSnooper.addData("display_type", this.fullscreen ? "fullscreen" : "windowed"); ++ par1PlayerUsageSnooper.addData("run_time", Long.valueOf((MinecraftServer.getSystemTimeMillis() - par1PlayerUsageSnooper.func_130105_g()) / 60L * 1000L)); ++ ++ if (this.theIntegratedServer != null && this.theIntegratedServer.getPlayerUsageSnooper() != null) { ++ par1PlayerUsageSnooper.addData("snooper_partner", this.theIntegratedServer.getPlayerUsageSnooper().getUniqueID()); + } +- + } + +- public void addServerTypeToSnooper(PlayerUsageSnooper var1) { +- var1.addData("opengl_version", GL11.glGetString(GL11.GL_VERSION)); +- var1.addData("opengl_vendor", GL11.glGetString(GL11.GL_VENDOR)); +- var1.addData("client_brand", ClientBrandRetriever.getClientModName()); +- var1.addData("launched_version", this.ab); ++ public void addServerTypeToSnooper(PlayerUsageSnooper par1PlayerUsageSnooper) { ++ par1PlayerUsageSnooper.addData("opengl_version", GL11.glGetString(GL11.GL_VERSION)); ++ par1PlayerUsageSnooper.addData("opengl_vendor", GL11.glGetString(GL11.GL_VENDOR)); ++ par1PlayerUsageSnooper.addData("client_brand", ClientBrandRetriever.getClientModName()); ++ par1PlayerUsageSnooper.addData("launched_version", this.launchedVersion); + ContextCapabilities var2 = GLContext.getCapabilities(); +- var1.addData("gl_caps[ARB_multitexture]", Boolean.valueOf(var2.GL_ARB_multitexture)); +- var1.addData("gl_caps[ARB_multisample]", Boolean.valueOf(var2.GL_ARB_multisample)); +- var1.addData("gl_caps[ARB_texture_cube_map]", Boolean.valueOf(var2.GL_ARB_texture_cube_map)); +- var1.addData("gl_caps[ARB_vertex_blend]", Boolean.valueOf(var2.GL_ARB_vertex_blend)); +- var1.addData("gl_caps[ARB_matrix_palette]", Boolean.valueOf(var2.GL_ARB_matrix_palette)); +- var1.addData("gl_caps[ARB_vertex_program]", Boolean.valueOf(var2.GL_ARB_vertex_program)); +- var1.addData("gl_caps[ARB_vertex_shader]", Boolean.valueOf(var2.GL_ARB_vertex_shader)); +- var1.addData("gl_caps[ARB_fragment_program]", Boolean.valueOf(var2.GL_ARB_fragment_program)); +- var1.addData("gl_caps[ARB_fragment_shader]", Boolean.valueOf(var2.GL_ARB_fragment_shader)); +- var1.addData("gl_caps[ARB_shader_objects]", Boolean.valueOf(var2.GL_ARB_shader_objects)); +- var1.addData("gl_caps[ARB_vertex_buffer_object]", Boolean.valueOf(var2.GL_ARB_vertex_buffer_object)); +- var1.addData("gl_caps[ARB_framebuffer_object]", Boolean.valueOf(var2.GL_ARB_framebuffer_object)); +- var1.addData("gl_caps[ARB_pixel_buffer_object]", Boolean.valueOf(var2.GL_ARB_pixel_buffer_object)); +- var1.addData("gl_caps[ARB_uniform_buffer_object]", Boolean.valueOf(var2.GL_ARB_uniform_buffer_object)); +- var1.addData("gl_caps[ARB_texture_non_power_of_two]", Boolean.valueOf(var2.GL_ARB_texture_non_power_of_two)); +- var1.addData("gl_caps[gl_max_vertex_uniforms]", Integer.valueOf(GL11.glGetInteger(GL20.GL_MAX_VERTEX_UNIFORM_COMPONENTS))); +- var1.addData("gl_caps[gl_max_fragment_uniforms]", Integer.valueOf(GL11.glGetInteger(GL20.GL_MAX_FRAGMENT_UNIFORM_COMPONENTS))); +- var1.addData("gl_max_texture_size", Integer.valueOf(getGLMaximumTextureSize())); ++ par1PlayerUsageSnooper.addData("gl_caps[ARB_multitexture]", Boolean.valueOf(var2.GL_ARB_multitexture)); ++ par1PlayerUsageSnooper.addData("gl_caps[ARB_multisample]", Boolean.valueOf(var2.GL_ARB_multisample)); ++ par1PlayerUsageSnooper.addData("gl_caps[ARB_texture_cube_map]", Boolean.valueOf(var2.GL_ARB_texture_cube_map)); ++ par1PlayerUsageSnooper.addData("gl_caps[ARB_vertex_blend]", Boolean.valueOf(var2.GL_ARB_vertex_blend)); ++ par1PlayerUsageSnooper.addData("gl_caps[ARB_matrix_palette]", Boolean.valueOf(var2.GL_ARB_matrix_palette)); ++ par1PlayerUsageSnooper.addData("gl_caps[ARB_vertex_program]", Boolean.valueOf(var2.GL_ARB_vertex_program)); ++ par1PlayerUsageSnooper.addData("gl_caps[ARB_vertex_shader]", Boolean.valueOf(var2.GL_ARB_vertex_shader)); ++ par1PlayerUsageSnooper.addData("gl_caps[ARB_fragment_program]", Boolean.valueOf(var2.GL_ARB_fragment_program)); ++ par1PlayerUsageSnooper.addData("gl_caps[ARB_fragment_shader]", Boolean.valueOf(var2.GL_ARB_fragment_shader)); ++ par1PlayerUsageSnooper.addData("gl_caps[ARB_shader_objects]", Boolean.valueOf(var2.GL_ARB_shader_objects)); ++ par1PlayerUsageSnooper.addData("gl_caps[ARB_vertex_buffer_object]", Boolean.valueOf(var2.GL_ARB_vertex_buffer_object)); ++ par1PlayerUsageSnooper.addData("gl_caps[ARB_framebuffer_object]", Boolean.valueOf(var2.GL_ARB_framebuffer_object)); ++ par1PlayerUsageSnooper.addData("gl_caps[ARB_pixel_buffer_object]", Boolean.valueOf(var2.GL_ARB_pixel_buffer_object)); ++ par1PlayerUsageSnooper.addData("gl_caps[ARB_uniform_buffer_object]", Boolean.valueOf(var2.GL_ARB_uniform_buffer_object)); ++ par1PlayerUsageSnooper.addData("gl_caps[ARB_texture_non_power_of_two]", Boolean.valueOf(var2.GL_ARB_texture_non_power_of_two)); ++ par1PlayerUsageSnooper.addData("gl_caps[gl_max_vertex_uniforms]", Integer.valueOf(GL11.glGetInteger(GL20.GL_MAX_VERTEX_UNIFORM_COMPONENTS))); ++ par1PlayerUsageSnooper.addData("gl_caps[gl_max_fragment_uniforms]", Integer.valueOf(GL11.glGetInteger(GL20.GL_MAX_FRAGMENT_UNIFORM_COMPONENTS))); ++ par1PlayerUsageSnooper.addData("gl_max_texture_size", Integer.valueOf(getGLMaximumTextureSize())); + } + ++ /** ++ * Used in the usage snooper. ++ */ + public static int getGLMaximumTextureSize() { +- for(int var0 = 16384; var0 > 0; var0 >>= 1) { +- GL11.glTexImage2D(GL11.GL_PROXY_TEXTURE_2D, 0, GL11.GL_RGBA, var0, var0, 0, GL11.GL_RGBA, GL11.GL_UNSIGNED_BYTE, (ByteBuffer)((ByteBuffer)null)); ++ for (int var0 = 16384; var0 > 0; var0 >>= 1) { ++ GL11.glTexImage2D(GL11.GL_PROXY_TEXTURE_2D, 0, GL11.GL_RGBA, var0, var0, 0, GL11.GL_RGBA, GL11.GL_UNSIGNED_BYTE, (ByteBuffer)null); + int var1 = GL11.glGetTexLevelParameteri(GL11.GL_PROXY_TEXTURE_2D, 0, GL11.GL_TEXTURE_WIDTH); +- if(var1 != 0) { ++ ++ if (var1 != 0) { + return var0; + } + } +@@ -1667,44 +2190,65 @@ + return -1; + } + ++ /** ++ * Returns whether snooping is enabled or not. ++ */ + public boolean isSnooperEnabled() { + return this.gameSettings.snooperEnabled; + } + +- public void setServerData(ServerData var1) { +- this.currentServerData = var1; ++ /** ++ * Set the current ServerData instance. ++ */ ++ public void setServerData(ServerData par1ServerData) { ++ this.currentServerData = par1ServerData; + } + + public boolean isIntegratedServerRunning() { + return this.integratedServerIsRunning; + } + ++ /** ++ * Returns true if there is only one player playing, and the current server is the integrated one. ++ */ + public boolean isSingleplayer() { + return this.integratedServerIsRunning && this.theIntegratedServer != null; + } + ++ /** ++ * Returns the currently running integrated server ++ */ + public IntegratedServer getIntegratedServer() { + return this.theIntegratedServer; + } + + public static void stopIntegratedServer() { +- if(theMinecraft != null) { ++ if (theMinecraft != null) { + IntegratedServer var0 = theMinecraft.getIntegratedServer(); +- if(var0 != null) { ++ ++ if (var0 != null) { + var0.stopServer(); + } +- + } + } + ++ /** ++ * Returns the PlayerUsageSnooper instance. ++ */ + public PlayerUsageSnooper getPlayerUsageSnooper() { + return this.usageSnooper; + } + ++ /** ++ * Gets the system time in milliseconds. ++ */ + public static long getSystemTime() { + return Sys.getTime() * 1000L / Sys.getTimerResolution(); + } + ++ /** ++ * Returns whether we're in full screen or not. ++ */ + public boolean isFullScreen() { + return this.fullscreen; + } +@@ -1718,7 +2262,7 @@ + } + + public Proxy getProxy() { +- return this.ac; ++ return this.proxy; + } + + public TextureManager getTextureManager() { +@@ -1737,11 +2281,17 @@ + return this.mcLanguageManager; + } + +- static String getLaunchedVersion(Minecraft var0) { +- return var0.ab; +- } +- +- static LanguageManager func_142024_b(Minecraft var0) { +- return var0.mcLanguageManager; +- } ++ static String getLaunchedVersion(Minecraft par0Minecraft) { ++ return par0Minecraft.launchedVersion; ++ } ++ ++ static LanguageManager func_142024_b(Minecraft par0Minecraft) { ++ return par0Minecraft.mcLanguageManager; ++ } ++ ++ // Spout Start ++ public boolean isMultiplayerWorld() { ++ return theWorld != null && theWorld.isRemote; ++ } ++ // Spout End + } diff --git a/patches/net/minecraft/src/MinecraftException.java.patch b/patches/net/minecraft/src/MinecraftException.java.patch new file mode 100644 index 0000000..c4ac937 --- /dev/null +++ b/patches/net/minecraft/src/MinecraftException.java.patch @@ -0,0 +1,12 @@ +--- net/minecraft/src/MinecraftException.java ++++ net/minecraft/src/MinecraftException.java +@@ -1,7 +1,7 @@ + package net.minecraft.src; + + public class MinecraftException extends Exception { +- public MinecraftException(String var1) { +- super(var1); ++ public MinecraftException(String par1Str) { ++ super(par1Str); + } + } diff --git a/patches/net/minecraft/src/MinecraftINNER13.java.patch b/patches/net/minecraft/src/MinecraftINNER13.java.patch new file mode 100644 index 0000000..4273a2d --- /dev/null +++ b/patches/net/minecraft/src/MinecraftINNER13.java.patch @@ -0,0 +1,13 @@ +--- net/minecraft/src/MinecraftINNER13.java ++++ net/minecraft/src/MinecraftINNER13.java +@@ -5,8 +5,8 @@ + class MinecraftINNER13 implements Callable { + final Minecraft field_142056_a; + +- MinecraftINNER13(Minecraft var1) { +- this.field_142056_a = var1; ++ MinecraftINNER13(Minecraft par1Minecraft) { ++ this.field_142056_a = par1Minecraft; + } + + public String func_142055_a() { diff --git a/patches/net/minecraft/src/MobSpawnerBaseLogic.java.patch b/patches/net/minecraft/src/MobSpawnerBaseLogic.java.patch new file mode 100644 index 0000000..2461970 --- /dev/null +++ b/patches/net/minecraft/src/MobSpawnerBaseLogic.java.patch @@ -0,0 +1,414 @@ +--- net/minecraft/src/MobSpawnerBaseLogic.java ++++ net/minecraft/src/MobSpawnerBaseLogic.java +@@ -1,148 +1,166 @@ + package net.minecraft.src; + + import java.util.ArrayList; +-import java.util.Collection; + import java.util.Iterator; + import java.util.List; + + public abstract class MobSpawnerBaseLogic { ++ ++ /** The delay to spawn. */ + public int spawnDelay = 20; +- private String a = "Pig"; +- private List e; ++ private String mobID = "Pig"; ++ ++ /** List of minecart to spawn. */ ++ private List minecartToSpawn; + private WeightedRandomMinecart randomMinecart; + public double field_98287_c; + public double field_98284_d; + private int minSpawnDelay = 200; + private int maxSpawnDelay = 800; ++ ++ /** A counter for spawn tries. */ + private int spawnCount = 4; + private Entity field_98291_j; + private int maxNearbyEntities = 6; ++ ++ /** The distance from which a player activates the spawner. */ + private int activatingRangeFromPlayer = 16; ++ ++ /** The range coefficient for spawning entities around. */ + private int spawnRange = 4; + ++ /** ++ * Gets the entity name that should be spawned. ++ */ + public String getEntityNameToSpawn() { +- if(this.getRandomMinecart() == null) { +- if(this.a.equals("Minecart")) { +- this.a = "MinecartRideable"; ++ if (this.getRandomMinecart() == null) { ++ if (this.mobID.equals("Minecart")) { ++ this.mobID = "MinecartRideable"; + } + +- return this.a; ++ return this.mobID; + } else { +- return this.getRandomMinecart().c; ++ return this.getRandomMinecart().minecartName; + } + } + +- public void setMobID(String var1) { +- this.a = var1; ++ public void setMobID(String par1Str) { ++ this.mobID = par1Str; + } + ++ /** ++ * Returns true if there's a player close enough to this mob spawner to activate it. ++ */ + public boolean canRun() { + return this.getSpawnerWorld().getClosestPlayer((double)this.getSpawnerX() + 0.5D, (double)this.getSpawnerY() + 0.5D, (double)this.getSpawnerZ() + 0.5D, (double)this.activatingRangeFromPlayer) != null; + } + + public void updateSpawner() { +- if(this.canRun()) { ++ if (this.canRun()) { + double var5; +- if(this.getSpawnerWorld().isRemote) { +- double var12 = (double)((float)this.getSpawnerX() + this.getSpawnerWorld().s.nextFloat()); +- double var13 = (double)((float)this.getSpawnerY() + this.getSpawnerWorld().s.nextFloat()); +- var5 = (double)((float)this.getSpawnerZ() + this.getSpawnerWorld().s.nextFloat()); +- this.getSpawnerWorld().spawnParticle("smoke", var12, var13, var5, 0.0D, 0.0D, 0.0D); +- this.getSpawnerWorld().spawnParticle("flame", var12, var13, var5, 0.0D, 0.0D, 0.0D); +- if(this.spawnDelay > 0) { ++ ++ if (this.getSpawnerWorld().isRemote) { ++ double var1 = (double)((float)this.getSpawnerX() + this.getSpawnerWorld().rand.nextFloat()); ++ double var3 = (double)((float)this.getSpawnerY() + this.getSpawnerWorld().rand.nextFloat()); ++ var5 = (double)((float)this.getSpawnerZ() + this.getSpawnerWorld().rand.nextFloat()); ++ this.getSpawnerWorld().spawnParticle("smoke", var1, var3, var5, 0.0D, 0.0D, 0.0D); ++ this.getSpawnerWorld().spawnParticle("flame", var1, var3, var5, 0.0D, 0.0D, 0.0D); ++ ++ if (this.spawnDelay > 0) { + --this.spawnDelay; + } + + this.field_98284_d = this.field_98287_c; + this.field_98287_c = (this.field_98287_c + (double)(1000.0F / ((float)this.spawnDelay + 200.0F))) % 360.0D; + } else { +- if(this.spawnDelay == -1) { ++ if (this.spawnDelay == -1) { + this.func_98273_j(); + } + +- if(this.spawnDelay > 0) { ++ if (this.spawnDelay > 0) { + --this.spawnDelay; + return; + } + +- boolean var1 = false; +- int var2 = 0; +- +- while(true) { +- if(var2 >= this.spawnCount) { +- if(var1) { +- this.func_98273_j(); +- } +- break; +- } +- +- Entity var3 = EntityList.createEntityByName(this.getEntityNameToSpawn(), this.getSpawnerWorld()); +- if(var3 == null) { ++ boolean var12 = false; ++ ++ for (int var2 = 0; var2 < this.spawnCount; ++var2) { ++ Entity var13 = EntityList.createEntityByName(this.getEntityNameToSpawn(), this.getSpawnerWorld()); ++ ++ if (var13 == null) { + return; + } + +- int var4 = this.getSpawnerWorld().getEntitiesWithinAABB(var3.getClass(), AxisAlignedBB.getAABBPool().getAABB((double)this.getSpawnerX(), (double)this.getSpawnerY(), (double)this.getSpawnerZ(), (double)(this.getSpawnerX() + 1), (double)(this.getSpawnerY() + 1), (double)(this.getSpawnerZ() + 1)).expand((double)(this.spawnRange * 2), 4.0D, (double)(this.spawnRange * 2))).size(); +- if(var4 >= this.maxNearbyEntities) { ++ int var4 = this.getSpawnerWorld().getEntitiesWithinAABB(var13.getClass(), AxisAlignedBB.getAABBPool().getAABB((double)this.getSpawnerX(), (double)this.getSpawnerY(), (double)this.getSpawnerZ(), (double)(this.getSpawnerX() + 1), (double)(this.getSpawnerY() + 1), (double)(this.getSpawnerZ() + 1)).expand((double)(this.spawnRange * 2), 4.0D, (double)(this.spawnRange * 2))).size(); ++ ++ if (var4 >= this.maxNearbyEntities) { + this.func_98273_j(); + return; + } + +- var5 = (double)this.getSpawnerX() + (this.getSpawnerWorld().s.nextDouble() - this.getSpawnerWorld().s.nextDouble()) * (double)this.spawnRange; +- double var7 = (double)(this.getSpawnerY() + this.getSpawnerWorld().s.nextInt(3) - 1); +- double var9 = (double)this.getSpawnerZ() + (this.getSpawnerWorld().s.nextDouble() - this.getSpawnerWorld().s.nextDouble()) * (double)this.spawnRange; +- EntityLiving var11 = var3 instanceof EntityLiving ? (EntityLiving)var3 : null; +- var3.setLocationAndAngles(var5, var7, var9, this.getSpawnerWorld().s.nextFloat() * 360.0F, 0.0F); +- if(var11 == null || var11.getCanSpawnHere()) { +- this.func_98265_a(var3); ++ var5 = (double)this.getSpawnerX() + (this.getSpawnerWorld().rand.nextDouble() - this.getSpawnerWorld().rand.nextDouble()) * (double)this.spawnRange; ++ double var7 = (double)(this.getSpawnerY() + this.getSpawnerWorld().rand.nextInt(3) - 1); ++ double var9 = (double)this.getSpawnerZ() + (this.getSpawnerWorld().rand.nextDouble() - this.getSpawnerWorld().rand.nextDouble()) * (double)this.spawnRange; ++ EntityLiving var11 = var13 instanceof EntityLiving ? (EntityLiving)var13 : null; ++ var13.setLocationAndAngles(var5, var7, var9, this.getSpawnerWorld().rand.nextFloat() * 360.0F, 0.0F); ++ ++ if (var11 == null || var11.getCanSpawnHere()) { ++ this.func_98265_a(var13); + this.getSpawnerWorld().playAuxSFX(2004, this.getSpawnerX(), this.getSpawnerY(), this.getSpawnerZ(), 0); +- if(var11 != null) { ++ ++ if (var11 != null) { + var11.spawnExplosionParticle(); + } + +- var1 = true; ++ var12 = true; + } ++ } + +- ++var2; ++ if (var12) { ++ this.func_98273_j(); + } + } +- + } + } + +- public Entity func_98265_a(Entity var1) { +- if(this.getRandomMinecart() != null) { ++ public Entity func_98265_a(Entity par1Entity) { ++ if (this.getRandomMinecart() != null) { + NBTTagCompound var2 = new NBTTagCompound(); +- var1.writeToNBTOptional(var2); ++ par1Entity.writeToNBTOptional(var2); + Iterator var3 = this.getRandomMinecart().field_98222_b.getTags().iterator(); + +- while(var3.hasNext()) { ++ while (var3.hasNext()) { + NBTBase var4 = (NBTBase)var3.next(); + var2.setTag(var4.getName(), var4.copy()); + } + +- var1.readFromNBT(var2); +- if(var1.worldObj != null) { +- var1.worldObj.spawnEntityInWorld(var1); ++ par1Entity.readFromNBT(var2); ++ ++ if (par1Entity.worldObj != null) { ++ par1Entity.worldObj.spawnEntityInWorld(par1Entity); + } + + NBTTagCompound var10; +- for(Entity var9 = var1; var2.hasKey("Riding"); var2 = var10) { ++ ++ for (Entity var9 = par1Entity; var2.hasKey("Riding"); var2 = var10) { + var10 = var2.getCompoundTag("Riding"); +- Entity var5 = EntityList.createEntityByName(var10.getString("id"), var1.worldObj); +- if(var5 != null) { ++ Entity var5 = EntityList.createEntityByName(var10.getString("id"), par1Entity.worldObj); ++ ++ if (var5 != null) { + NBTTagCompound var6 = new NBTTagCompound(); + var5.writeToNBTOptional(var6); + Iterator var7 = var10.getTags().iterator(); + +- while(var7.hasNext()) { ++ while (var7.hasNext()) { + NBTBase var8 = (NBTBase)var7.next(); + var6.setTag(var8.getName(), var8.copy()); + } + + var5.readFromNBT(var6); + var5.setLocationAndAngles(var9.posX, var9.posY, var9.posZ, var9.rotationYaw, var9.rotationPitch); +- if(var1.worldObj != null) { +- var1.worldObj.spawnEntityInWorld(var5); ++ ++ if (par1Entity.worldObj != null) { ++ par1Entity.worldObj.spawnEntityInWorld(var5); + } + + var9.mountEntity(var5); +@@ -150,89 +168,91 @@ + + var9 = var5; + } +- } else if(var1 instanceof EntityLivingBase && var1.worldObj != null) { +- ((EntityLiving)var1).onSpawnWithEgg((EntityLivingData)null); +- this.getSpawnerWorld().spawnEntityInWorld(var1); ++ } else if (par1Entity instanceof EntityLivingBase && par1Entity.worldObj != null) { ++ ((EntityLiving)par1Entity).onSpawnWithEgg((EntityLivingData)null); ++ this.getSpawnerWorld().spawnEntityInWorld(par1Entity); + } + +- return var1; ++ return par1Entity; + } + + private void func_98273_j() { +- if(this.maxSpawnDelay <= this.minSpawnDelay) { ++ if (this.maxSpawnDelay <= this.minSpawnDelay) { + this.spawnDelay = this.minSpawnDelay; + } else { + int var10003 = this.maxSpawnDelay - this.minSpawnDelay; +- this.spawnDelay = this.minSpawnDelay + this.getSpawnerWorld().s.nextInt(var10003); ++ this.spawnDelay = this.minSpawnDelay + this.getSpawnerWorld().rand.nextInt(var10003); + } + +- if(this.e != null && this.e.size() > 0) { +- this.setRandomMinecart((WeightedRandomMinecart)WeightedRandom.getRandomItem(this.getSpawnerWorld().s, (Collection)this.e)); ++ if (this.minecartToSpawn != null && this.minecartToSpawn.size() > 0) { ++ this.setRandomMinecart((WeightedRandomMinecart)WeightedRandom.getRandomItem(this.getSpawnerWorld().rand, this.minecartToSpawn)); + } + + this.func_98267_a(1); + } + +- public void readFromNBT(NBTTagCompound var1) { +- this.a = var1.getString("EntityId"); +- this.spawnDelay = var1.getShort("Delay"); +- if(var1.hasKey("SpawnPotentials")) { +- this.e = new ArrayList(); +- NBTTagList var2 = var1.getTagList("SpawnPotentials"); +- +- for(int var3 = 0; var3 < var2.tagCount(); ++var3) { +- this.e.add(new WeightedRandomMinecart(this, (NBTTagCompound)var2.tagAt(var3))); ++ public void readFromNBT(NBTTagCompound par1NBTTagCompound) { ++ this.mobID = par1NBTTagCompound.getString("EntityId"); ++ this.spawnDelay = par1NBTTagCompound.getShort("Delay"); ++ ++ if (par1NBTTagCompound.hasKey("SpawnPotentials")) { ++ this.minecartToSpawn = new ArrayList(); ++ NBTTagList var2 = par1NBTTagCompound.getTagList("SpawnPotentials"); ++ ++ for (int var3 = 0; var3 < var2.tagCount(); ++var3) { ++ this.minecartToSpawn.add(new WeightedRandomMinecart(this, (NBTTagCompound)var2.tagAt(var3))); + } + } else { +- this.e = null; ++ this.minecartToSpawn = null; + } + +- if(var1.hasKey("SpawnData")) { +- this.setRandomMinecart(new WeightedRandomMinecart(this, var1.getCompoundTag("SpawnData"), this.a)); ++ if (par1NBTTagCompound.hasKey("SpawnData")) { ++ this.setRandomMinecart(new WeightedRandomMinecart(this, par1NBTTagCompound.getCompoundTag("SpawnData"), this.mobID)); + } else { + this.setRandomMinecart((WeightedRandomMinecart)null); + } + +- if(var1.hasKey("MinSpawnDelay")) { +- this.minSpawnDelay = var1.getShort("MinSpawnDelay"); +- this.maxSpawnDelay = var1.getShort("MaxSpawnDelay"); +- this.spawnCount = var1.getShort("SpawnCount"); +- } +- +- if(var1.hasKey("MaxNearbyEntities")) { +- this.maxNearbyEntities = var1.getShort("MaxNearbyEntities"); +- this.activatingRangeFromPlayer = var1.getShort("RequiredPlayerRange"); +- } +- +- if(var1.hasKey("SpawnRange")) { +- this.spawnRange = var1.getShort("SpawnRange"); +- } +- +- if(this.getSpawnerWorld() != null && this.getSpawnerWorld().isRemote) { ++ if (par1NBTTagCompound.hasKey("MinSpawnDelay")) { ++ this.minSpawnDelay = par1NBTTagCompound.getShort("MinSpawnDelay"); ++ this.maxSpawnDelay = par1NBTTagCompound.getShort("MaxSpawnDelay"); ++ this.spawnCount = par1NBTTagCompound.getShort("SpawnCount"); ++ } ++ ++ if (par1NBTTagCompound.hasKey("MaxNearbyEntities")) { ++ this.maxNearbyEntities = par1NBTTagCompound.getShort("MaxNearbyEntities"); ++ this.activatingRangeFromPlayer = par1NBTTagCompound.getShort("RequiredPlayerRange"); ++ } ++ ++ if (par1NBTTagCompound.hasKey("SpawnRange")) { ++ this.spawnRange = par1NBTTagCompound.getShort("SpawnRange"); ++ } ++ ++ if (this.getSpawnerWorld() != null && this.getSpawnerWorld().isRemote) { + this.field_98291_j = null; + } +- + } + +- public void writeToNBT(NBTTagCompound var1) { +- var1.setString("EntityId", this.getEntityNameToSpawn()); +- var1.setShort("Delay", (short)this.spawnDelay); +- var1.setShort("MinSpawnDelay", (short)this.minSpawnDelay); +- var1.setShort("MaxSpawnDelay", (short)this.maxSpawnDelay); +- var1.setShort("SpawnCount", (short)this.spawnCount); +- var1.setShort("MaxNearbyEntities", (short)this.maxNearbyEntities); +- var1.setShort("RequiredPlayerRange", (short)this.activatingRangeFromPlayer); +- var1.setShort("SpawnRange", (short)this.spawnRange); +- if(this.getRandomMinecart() != null) { +- var1.setCompoundTag("SpawnData", (NBTTagCompound)this.getRandomMinecart().field_98222_b.copy()); ++ public void writeToNBT(NBTTagCompound par1NBTTagCompound) { ++ par1NBTTagCompound.setString("EntityId", this.getEntityNameToSpawn()); ++ par1NBTTagCompound.setShort("Delay", (short)this.spawnDelay); ++ par1NBTTagCompound.setShort("MinSpawnDelay", (short)this.minSpawnDelay); ++ par1NBTTagCompound.setShort("MaxSpawnDelay", (short)this.maxSpawnDelay); ++ par1NBTTagCompound.setShort("SpawnCount", (short)this.spawnCount); ++ par1NBTTagCompound.setShort("MaxNearbyEntities", (short)this.maxNearbyEntities); ++ par1NBTTagCompound.setShort("RequiredPlayerRange", (short)this.activatingRangeFromPlayer); ++ par1NBTTagCompound.setShort("SpawnRange", (short)this.spawnRange); ++ ++ if (this.getRandomMinecart() != null) { ++ par1NBTTagCompound.setCompoundTag("SpawnData", (NBTTagCompound)this.getRandomMinecart().field_98222_b.copy()); + } + +- if(this.getRandomMinecart() != null || this.e != null && this.e.size() > 0) { ++ if (this.getRandomMinecart() != null || this.minecartToSpawn != null && this.minecartToSpawn.size() > 0) { + NBTTagList var2 = new NBTTagList(); +- if(this.e != null && this.e.size() > 0) { +- Iterator var3 = this.e.iterator(); +- +- while(var3.hasNext()) { ++ ++ if (this.minecartToSpawn != null && this.minecartToSpawn.size() > 0) { ++ Iterator var3 = this.minecartToSpawn.iterator(); ++ ++ while (var3.hasNext()) { + WeightedRandomMinecart var4 = (WeightedRandomMinecart)var3.next(); + var2.appendTag(var4.func_98220_a()); + } +@@ -240,13 +260,12 @@ + var2.appendTag(this.getRandomMinecart().func_98220_a()); + } + +- var1.setTag("SpawnPotentials", var2); ++ par1NBTTagCompound.setTag("SpawnPotentials", var2); + } +- + } + + public Entity func_98281_h() { +- if(this.field_98291_j == null) { ++ if (this.field_98291_j == null) { + Entity var1 = EntityList.createEntityByName(this.getEntityNameToSpawn(), (World)null); + var1 = this.func_98265_a(var1); + this.field_98291_j = var1; +@@ -255,8 +274,11 @@ + return this.field_98291_j; + } + +- public boolean setDelayToMin(int var1) { +- if(var1 == 1 && this.getSpawnerWorld().isRemote) { ++ /** ++ * Sets the delay to minDelay if parameter given is 1, else return false. ++ */ ++ public boolean setDelayToMin(int par1) { ++ if (par1 == 1 && this.getSpawnerWorld().isRemote) { + this.spawnDelay = this.minSpawnDelay; + return true; + } else { +@@ -268,8 +290,8 @@ + return this.randomMinecart; + } + +- public void setRandomMinecart(WeightedRandomMinecart var1) { +- this.randomMinecart = var1; ++ public void setRandomMinecart(WeightedRandomMinecart par1WeightedRandomMinecart) { ++ this.randomMinecart = par1WeightedRandomMinecart; + } + + public abstract void func_98267_a(int var1); diff --git a/patches/net/minecraft/src/ModelBase.java.patch b/patches/net/minecraft/src/ModelBase.java.patch new file mode 100644 index 0000000..5a54b2d --- /dev/null +++ b/patches/net/minecraft/src/ModelBase.java.patch @@ -0,0 +1,69 @@ +--- net/minecraft/src/ModelBase.java ++++ net/minecraft/src/ModelBase.java +@@ -9,30 +9,45 @@ + public abstract class ModelBase { + public float onGround; + public boolean isRiding; +- public List r = new ArrayList(); ++ ++ /** ++ * This is a list of all the boxes (ModelRenderer.class) in the current model. ++ */ ++ public List boxList = new ArrayList(); + public boolean isChild = true; +- private Map a = new HashMap(); ++ ++ /** A mapping for all texture offsets */ ++ private Map modelTextureMap = new HashMap(); + public int textureWidth = 64; + public int textureHeight = 32; + +- public void render(Entity var1, float var2, float var3, float var4, float var5, float var6, float var7) { +- } +- +- public void setRotationAngles(float var1, float var2, float var3, float var4, float var5, float var6, Entity var7) { +- } +- +- public void setLivingAnimations(EntityLivingBase var1, float var2, float var3, float var4) { +- } +- +- public ModelRenderer getRandomModelBox(Random var1) { +- return (ModelRenderer)this.r.get(var1.nextInt(this.r.size())); +- } +- +- protected void setTextureOffset(String var1, int var2, int var3) { +- this.a.put(var1, new TextureOffset(var2, var3)); +- } +- +- public TextureOffset getTextureOffset(String var1) { +- return (TextureOffset)this.a.get(var1); ++ /** ++ * Sets the models various rotation angles then renders the model. ++ */ ++ public void render(Entity par1Entity, float par2, float par3, float par4, float par5, float par6, float par7) {} ++ ++ /** ++ * Sets the model's various rotation angles. For bipeds, par1 and par2 are used for animating the movement of arms and ++ * legs, where par1 represents the time(so that arms and legs swing back and forth) and par2 represents how "far" arms ++ * and legs can swing at most. ++ */ ++ public void setRotationAngles(float par1, float par2, float par3, float par4, float par5, float par6, Entity par7Entity) {} ++ ++ /** ++ * Used for easily adding entity-dependent animations. The second and third float params here are the same second and ++ * third as in the setRotationAngles method. ++ */ ++ public void setLivingAnimations(EntityLivingBase par1EntityLivingBase, float par2, float par3, float par4) {} ++ ++ public ModelRenderer getRandomModelBox(Random par1Random) { ++ return (ModelRenderer)this.boxList.get(par1Random.nextInt(this.boxList.size())); ++ } ++ ++ protected void setTextureOffset(String par1Str, int par2, int par3) { ++ this.modelTextureMap.put(par1Str, new TextureOffset(par2, par3)); ++ } ++ ++ public TextureOffset getTextureOffset(String par1Str) { ++ return (TextureOffset)this.modelTextureMap.get(par1Str); + } + } diff --git a/patches/net/minecraft/src/ModelBat.java.patch b/patches/net/minecraft/src/ModelBat.java.patch new file mode 100644 index 0000000..2a994f7 --- /dev/null +++ b/patches/net/minecraft/src/ModelBat.java.patch @@ -0,0 +1,93 @@ +--- net/minecraft/src/ModelBat.java ++++ net/minecraft/src/ModelBat.java +@@ -2,10 +2,20 @@ + + public class ModelBat extends ModelBase { + private ModelRenderer batHead; ++ ++ /** The body box of the bat model. */ + private ModelRenderer batBody; ++ ++ /** The inner right wing box of the bat model. */ + private ModelRenderer batRightWing; ++ ++ /** The inner left wing box of the bat model. */ + private ModelRenderer batLeftWing; ++ ++ /** The outer right wing box of the bat model. */ + private ModelRenderer batOuterRightWing; ++ ++ /** The outer left wing box of the bat model. */ + private ModelRenderer batOuterLeftWing; + + public ModelBat() { +@@ -41,45 +51,53 @@ + this.batLeftWing.addChild(this.batOuterLeftWing); + } + ++ /** ++ * not actually sure this is size, is not used as of now, but the model would be recreated if the value changed and it ++ * seems a good match for a bats size ++ */ + public int getBatSize() { + return 36; + } + +- public void render(Entity var1, float var2, float var3, float var4, float var5, float var6, float var7) { +- EntityBat var8 = (EntityBat)var1; ++ /** ++ * Sets the models various rotation angles then renders the model. ++ */ ++ public void render(Entity par1Entity, float par2, float par3, float par4, float par5, float par6, float par7) { ++ EntityBat var8 = (EntityBat)par1Entity; + float var9; +- if(var8.getIsBatHanging()) { +- var9 = 180.0F / (float)Math.PI; +- this.batHead.rotateAngleX = var6 / (180.0F / (float)Math.PI); +- this.batHead.rotateAngleY = (float)Math.PI - var5 / (180.0F / (float)Math.PI); ++ ++ if (var8.getIsBatHanging()) { ++ var9 = (180F / (float)Math.PI); ++ this.batHead.rotateAngleX = par6 / (180F / (float)Math.PI); ++ this.batHead.rotateAngleY = (float)Math.PI - par5 / (180F / (float)Math.PI); + this.batHead.rotateAngleZ = (float)Math.PI; + this.batHead.setRotationPoint(0.0F, -2.0F, 0.0F); + this.batRightWing.setRotationPoint(-3.0F, 0.0F, 3.0F); + this.batLeftWing.setRotationPoint(3.0F, 0.0F, 3.0F); + this.batBody.rotateAngleX = (float)Math.PI; +- this.batRightWing.rotateAngleX = (float)Math.PI * -0.05F; +- this.batRightWing.rotateAngleY = (float)Math.PI * -0.4F; +- this.batOuterRightWing.rotateAngleY = (float)Math.PI * -0.55F; ++ this.batRightWing.rotateAngleX = -0.15707964F; ++ this.batRightWing.rotateAngleY = -((float)Math.PI * 2F / 5F); ++ this.batOuterRightWing.rotateAngleY = -1.7278761F; + this.batLeftWing.rotateAngleX = this.batRightWing.rotateAngleX; + this.batLeftWing.rotateAngleY = -this.batRightWing.rotateAngleY; + this.batOuterLeftWing.rotateAngleY = -this.batOuterRightWing.rotateAngleY; + } else { +- var9 = 180.0F / (float)Math.PI; +- this.batHead.rotateAngleX = var6 / (180.0F / (float)Math.PI); +- this.batHead.rotateAngleY = var5 / (180.0F / (float)Math.PI); ++ var9 = (180F / (float)Math.PI); ++ this.batHead.rotateAngleX = par6 / (180F / (float)Math.PI); ++ this.batHead.rotateAngleY = par5 / (180F / (float)Math.PI); + this.batHead.rotateAngleZ = 0.0F; + this.batHead.setRotationPoint(0.0F, 0.0F, 0.0F); + this.batRightWing.setRotationPoint(0.0F, 0.0F, 0.0F); + this.batLeftWing.setRotationPoint(0.0F, 0.0F, 0.0F); +- this.batBody.rotateAngleX = (float)Math.PI * 0.25F + MathHelper.cos(var4 * 0.1F) * 0.15F; ++ this.batBody.rotateAngleX = ((float)Math.PI / 4F) + MathHelper.cos(par4 * 0.1F) * 0.15F; + this.batBody.rotateAngleY = 0.0F; +- this.batRightWing.rotateAngleY = MathHelper.cos(var4 * 1.3F) * (float)Math.PI * 0.25F; ++ this.batRightWing.rotateAngleY = MathHelper.cos(par4 * 1.3F) * (float)Math.PI * 0.25F; + this.batLeftWing.rotateAngleY = -this.batRightWing.rotateAngleY; + this.batOuterRightWing.rotateAngleY = this.batRightWing.rotateAngleY * 0.5F; + this.batOuterLeftWing.rotateAngleY = -this.batRightWing.rotateAngleY * 0.5F; + } + +- this.batHead.render(var7); +- this.batBody.render(var7); ++ this.batHead.render(par7); ++ this.batBody.render(par7); + } + } diff --git a/patches/net/minecraft/src/ModelBiped.java.patch b/patches/net/minecraft/src/ModelBiped.java.patch new file mode 100644 index 0000000..2671487 --- /dev/null +++ b/patches/net/minecraft/src/ModelBiped.java.patch @@ -0,0 +1,281 @@ +--- net/minecraft/src/ModelBiped.java ++++ net/minecraft/src/ModelBiped.java +@@ -12,117 +12,137 @@ + public ModelRenderer bipedLeftLeg; + public ModelRenderer bipedEars; + public ModelRenderer bipedCloak; ++ ++ /** ++ * Records whether the model should be rendered holding an item in the left hand, and if that item is a block. ++ */ + public int heldItemLeft; ++ ++ /** ++ * Records whether the model should be rendered holding an item in the right hand, and if that item is a block. ++ */ + public int heldItemRight; + public boolean isSneak; ++ ++ /** Records whether the model should be rendered aiming a bow. */ + public boolean aimedBow; + + public ModelBiped() { + this(0.0F); + } + +- public ModelBiped(float var1) { +- this(var1, 0.0F, 64, 32); ++ public ModelBiped(float par1) { ++ this(par1, 0.0F, 64, 32); + } + +- public ModelBiped(float var1, float var2, int var3, int var4) { +- this.textureWidth = var3; +- this.textureHeight = var4; ++ public ModelBiped(float par1, float par2, int par3, int par4) { ++ this.textureWidth = par3; ++ this.textureHeight = par4; + this.bipedCloak = new ModelRenderer(this, 0, 0); +- this.bipedCloak.addBox(-5.0F, 0.0F, -1.0F, 10, 16, 1, var1); ++ this.bipedCloak.addBox(-5.0F, 0.0F, -1.0F, 10, 16, 1, par1); + this.bipedEars = new ModelRenderer(this, 24, 0); +- this.bipedEars.addBox(-3.0F, -6.0F, -1.0F, 6, 6, 1, var1); ++ this.bipedEars.addBox(-3.0F, -6.0F, -1.0F, 6, 6, 1, par1); + this.bipedHead = new ModelRenderer(this, 0, 0); +- this.bipedHead.addBox(-4.0F, -8.0F, -4.0F, 8, 8, 8, var1); +- this.bipedHead.setRotationPoint(0.0F, 0.0F + var2, 0.0F); ++ this.bipedHead.addBox(-4.0F, -8.0F, -4.0F, 8, 8, 8, par1); ++ this.bipedHead.setRotationPoint(0.0F, 0.0F + par2, 0.0F); + this.bipedHeadwear = new ModelRenderer(this, 32, 0); +- this.bipedHeadwear.addBox(-4.0F, -8.0F, -4.0F, 8, 8, 8, var1 + 0.5F); +- this.bipedHeadwear.setRotationPoint(0.0F, 0.0F + var2, 0.0F); ++ this.bipedHeadwear.addBox(-4.0F, -8.0F, -4.0F, 8, 8, 8, par1 + 0.5F); ++ this.bipedHeadwear.setRotationPoint(0.0F, 0.0F + par2, 0.0F); + this.bipedBody = new ModelRenderer(this, 16, 16); +- this.bipedBody.addBox(-4.0F, 0.0F, -2.0F, 8, 12, 4, var1); +- this.bipedBody.setRotationPoint(0.0F, 0.0F + var2, 0.0F); ++ this.bipedBody.addBox(-4.0F, 0.0F, -2.0F, 8, 12, 4, par1); ++ this.bipedBody.setRotationPoint(0.0F, 0.0F + par2, 0.0F); + this.bipedRightArm = new ModelRenderer(this, 40, 16); +- this.bipedRightArm.addBox(-3.0F, -2.0F, -2.0F, 4, 12, 4, var1); +- this.bipedRightArm.setRotationPoint(-5.0F, 2.0F + var2, 0.0F); ++ this.bipedRightArm.addBox(-3.0F, -2.0F, -2.0F, 4, 12, 4, par1); ++ this.bipedRightArm.setRotationPoint(-5.0F, 2.0F + par2, 0.0F); + this.bipedLeftArm = new ModelRenderer(this, 40, 16); + this.bipedLeftArm.mirror = true; +- this.bipedLeftArm.addBox(-1.0F, -2.0F, -2.0F, 4, 12, 4, var1); +- this.bipedLeftArm.setRotationPoint(5.0F, 2.0F + var2, 0.0F); ++ this.bipedLeftArm.addBox(-1.0F, -2.0F, -2.0F, 4, 12, 4, par1); ++ this.bipedLeftArm.setRotationPoint(5.0F, 2.0F + par2, 0.0F); + this.bipedRightLeg = new ModelRenderer(this, 0, 16); +- this.bipedRightLeg.addBox(-2.0F, 0.0F, -2.0F, 4, 12, 4, var1); +- this.bipedRightLeg.setRotationPoint(-1.9F, 12.0F + var2, 0.0F); ++ this.bipedRightLeg.addBox(-2.0F, 0.0F, -2.0F, 4, 12, 4, par1); ++ this.bipedRightLeg.setRotationPoint(-1.9F, 12.0F + par2, 0.0F); + this.bipedLeftLeg = new ModelRenderer(this, 0, 16); + this.bipedLeftLeg.mirror = true; +- this.bipedLeftLeg.addBox(-2.0F, 0.0F, -2.0F, 4, 12, 4, var1); +- this.bipedLeftLeg.setRotationPoint(1.9F, 12.0F + var2, 0.0F); ++ this.bipedLeftLeg.addBox(-2.0F, 0.0F, -2.0F, 4, 12, 4, par1); ++ this.bipedLeftLeg.setRotationPoint(1.9F, 12.0F + par2, 0.0F); + } + +- public void render(Entity var1, float var2, float var3, float var4, float var5, float var6, float var7) { +- this.setRotationAngles(var2, var3, var4, var5, var6, var7, var1); +- if(this.isChild) { ++ /** ++ * Sets the models various rotation angles then renders the model. ++ */ ++ public void render(Entity par1Entity, float par2, float par3, float par4, float par5, float par6, float par7) { ++ this.setRotationAngles(par2, par3, par4, par5, par6, par7, par1Entity); ++ ++ if (this.isChild) { + float var8 = 2.0F; + GL11.glPushMatrix(); + GL11.glScalef(1.5F / var8, 1.5F / var8, 1.5F / var8); +- GL11.glTranslatef(0.0F, 16.0F * var7, 0.0F); +- this.bipedHead.render(var7); ++ GL11.glTranslatef(0.0F, 16.0F * par7, 0.0F); ++ this.bipedHead.render(par7); + GL11.glPopMatrix(); + GL11.glPushMatrix(); + GL11.glScalef(1.0F / var8, 1.0F / var8, 1.0F / var8); +- GL11.glTranslatef(0.0F, 24.0F * var7, 0.0F); +- this.bipedBody.render(var7); +- this.bipedRightArm.render(var7); +- this.bipedLeftArm.render(var7); +- this.bipedRightLeg.render(var7); +- this.bipedLeftLeg.render(var7); +- this.bipedHeadwear.render(var7); ++ GL11.glTranslatef(0.0F, 24.0F * par7, 0.0F); ++ this.bipedBody.render(par7); ++ this.bipedRightArm.render(par7); ++ this.bipedLeftArm.render(par7); ++ this.bipedRightLeg.render(par7); ++ this.bipedLeftLeg.render(par7); ++ this.bipedHeadwear.render(par7); + GL11.glPopMatrix(); + } else { +- this.bipedHead.render(var7); +- this.bipedBody.render(var7); +- this.bipedRightArm.render(var7); +- this.bipedLeftArm.render(var7); +- this.bipedRightLeg.render(var7); +- this.bipedLeftLeg.render(var7); +- this.bipedHeadwear.render(var7); ++ this.bipedHead.render(par7); ++ this.bipedBody.render(par7); ++ this.bipedRightArm.render(par7); ++ this.bipedLeftArm.render(par7); ++ this.bipedRightLeg.render(par7); ++ this.bipedLeftLeg.render(par7); ++ this.bipedHeadwear.render(par7); + } +- + } + +- public void setRotationAngles(float var1, float var2, float var3, float var4, float var5, float var6, Entity var7) { +- this.bipedHead.rotateAngleY = var4 / (180.0F / (float)Math.PI); +- this.bipedHead.rotateAngleX = var5 / (180.0F / (float)Math.PI); ++ /** ++ * Sets the model's various rotation angles. For bipeds, par1 and par2 are used for animating the movement of arms and ++ * legs, where par1 represents the time(so that arms and legs swing back and forth) and par2 represents how "far" arms ++ * and legs can swing at most. ++ */ ++ public void setRotationAngles(float par1, float par2, float par3, float par4, float par5, float par6, Entity par7Entity) { ++ this.bipedHead.rotateAngleY = par4 / (180F / (float)Math.PI); ++ this.bipedHead.rotateAngleX = par5 / (180F / (float)Math.PI); + this.bipedHeadwear.rotateAngleY = this.bipedHead.rotateAngleY; + this.bipedHeadwear.rotateAngleX = this.bipedHead.rotateAngleX; +- this.bipedRightArm.rotateAngleX = MathHelper.cos(var1 * 0.6662F + (float)Math.PI) * 2.0F * var2 * 0.5F; +- this.bipedLeftArm.rotateAngleX = MathHelper.cos(var1 * 0.6662F) * 2.0F * var2 * 0.5F; ++ this.bipedRightArm.rotateAngleX = MathHelper.cos(par1 * 0.6662F + (float)Math.PI) * 2.0F * par2 * 0.5F; ++ this.bipedLeftArm.rotateAngleX = MathHelper.cos(par1 * 0.6662F) * 2.0F * par2 * 0.5F; + this.bipedRightArm.rotateAngleZ = 0.0F; + this.bipedLeftArm.rotateAngleZ = 0.0F; +- this.bipedRightLeg.rotateAngleX = MathHelper.cos(var1 * 0.6662F) * 1.4F * var2; +- this.bipedLeftLeg.rotateAngleX = MathHelper.cos(var1 * 0.6662F + (float)Math.PI) * 1.4F * var2; ++ this.bipedRightLeg.rotateAngleX = MathHelper.cos(par1 * 0.6662F) * 1.4F * par2; ++ this.bipedLeftLeg.rotateAngleX = MathHelper.cos(par1 * 0.6662F + (float)Math.PI) * 1.4F * par2; + this.bipedRightLeg.rotateAngleY = 0.0F; + this.bipedLeftLeg.rotateAngleY = 0.0F; +- if(this.isRiding) { +- this.bipedRightArm.rotateAngleX += (float)Math.PI * -0.2F; +- this.bipedLeftArm.rotateAngleX += (float)Math.PI * -0.2F; +- this.bipedRightLeg.rotateAngleX = (float)Math.PI * -0.4F; +- this.bipedLeftLeg.rotateAngleX = (float)Math.PI * -0.4F; +- this.bipedRightLeg.rotateAngleY = (float)Math.PI * 0.1F; +- this.bipedLeftLeg.rotateAngleY = (float)Math.PI * -0.1F; +- } +- +- if(this.heldItemLeft != 0) { +- this.bipedLeftArm.rotateAngleX = this.bipedLeftArm.rotateAngleX * 0.5F - (float)Math.PI * 0.1F * (float)this.heldItemLeft; +- } +- +- if(this.heldItemRight != 0) { +- this.bipedRightArm.rotateAngleX = this.bipedRightArm.rotateAngleX * 0.5F - (float)Math.PI * 0.1F * (float)this.heldItemRight; ++ ++ if (this.isRiding) { ++ this.bipedRightArm.rotateAngleX += -((float)Math.PI / 5F); ++ this.bipedLeftArm.rotateAngleX += -((float)Math.PI / 5F); ++ this.bipedRightLeg.rotateAngleX = -((float)Math.PI * 2F / 5F); ++ this.bipedLeftLeg.rotateAngleX = -((float)Math.PI * 2F / 5F); ++ this.bipedRightLeg.rotateAngleY = ((float)Math.PI / 10F); ++ this.bipedLeftLeg.rotateAngleY = -((float)Math.PI / 10F); ++ } ++ ++ if (this.heldItemLeft != 0) { ++ this.bipedLeftArm.rotateAngleX = this.bipedLeftArm.rotateAngleX * 0.5F - ((float)Math.PI / 10F) * (float)this.heldItemLeft; ++ } ++ ++ if (this.heldItemRight != 0) { ++ this.bipedRightArm.rotateAngleX = this.bipedRightArm.rotateAngleX * 0.5F - ((float)Math.PI / 10F) * (float)this.heldItemRight; + } + + this.bipedRightArm.rotateAngleY = 0.0F; + this.bipedLeftArm.rotateAngleY = 0.0F; + float var8; + float var9; +- if(this.onGround > -9990.0F) { ++ ++ if (this.onGround > -9990.0F) { + var8 = this.onGround; + this.bipedBody.rotateAngleY = MathHelper.sin(MathHelper.sqrt_float(var8) * (float)Math.PI * 2.0F) * 0.2F; + this.bipedRightArm.rotationPointZ = MathHelper.sin(this.bipedBody.rotateAngleY) * 5.0F; +@@ -137,13 +157,13 @@ + var8 *= var8; + var8 = 1.0F - var8; + var9 = MathHelper.sin(var8 * (float)Math.PI); +- float var10 = MathHelper.sin(this.onGround * (float)Math.PI) * -(this.bipedHead.rotateAngleX - 0.7F) * (12.0F / 16.0F); ++ float var10 = MathHelper.sin(this.onGround * (float)Math.PI) * -(this.bipedHead.rotateAngleX - 0.7F) * 0.75F; + this.bipedRightArm.rotateAngleX = (float)((double)this.bipedRightArm.rotateAngleX - ((double)var9 * 1.2D + (double)var10)); + this.bipedRightArm.rotateAngleY += this.bipedBody.rotateAngleY * 2.0F; + this.bipedRightArm.rotateAngleZ = MathHelper.sin(this.onGround * (float)Math.PI) * -0.4F; + } + +- if(this.isSneak) { ++ if (this.isSneak) { + this.bipedBody.rotateAngleX = 0.5F; + this.bipedRightArm.rotateAngleX += 0.4F; + this.bipedLeftArm.rotateAngleX += 0.4F; +@@ -163,38 +183,44 @@ + this.bipedHeadwear.rotationPointY = 0.0F; + } + +- this.bipedRightArm.rotateAngleZ += MathHelper.cos(var3 * 0.09F) * 0.05F + 0.05F; +- this.bipedLeftArm.rotateAngleZ -= MathHelper.cos(var3 * 0.09F) * 0.05F + 0.05F; +- this.bipedRightArm.rotateAngleX += MathHelper.sin(var3 * 0.067F) * 0.05F; +- this.bipedLeftArm.rotateAngleX -= MathHelper.sin(var3 * 0.067F) * 0.05F; +- if(this.aimedBow) { ++ this.bipedRightArm.rotateAngleZ += MathHelper.cos(par3 * 0.09F) * 0.05F + 0.05F; ++ this.bipedLeftArm.rotateAngleZ -= MathHelper.cos(par3 * 0.09F) * 0.05F + 0.05F; ++ this.bipedRightArm.rotateAngleX += MathHelper.sin(par3 * 0.067F) * 0.05F; ++ this.bipedLeftArm.rotateAngleX -= MathHelper.sin(par3 * 0.067F) * 0.05F; ++ ++ if (this.aimedBow) { + var8 = 0.0F; + var9 = 0.0F; + this.bipedRightArm.rotateAngleZ = 0.0F; + this.bipedLeftArm.rotateAngleZ = 0.0F; + this.bipedRightArm.rotateAngleY = -(0.1F - var8 * 0.6F) + this.bipedHead.rotateAngleY; + this.bipedLeftArm.rotateAngleY = 0.1F - var8 * 0.6F + this.bipedHead.rotateAngleY + 0.4F; +- this.bipedRightArm.rotateAngleX = (float)Math.PI * -0.5F + this.bipedHead.rotateAngleX; +- this.bipedLeftArm.rotateAngleX = (float)Math.PI * -0.5F + this.bipedHead.rotateAngleX; ++ this.bipedRightArm.rotateAngleX = -((float)Math.PI / 2F) + this.bipedHead.rotateAngleX; ++ this.bipedLeftArm.rotateAngleX = -((float)Math.PI / 2F) + this.bipedHead.rotateAngleX; + this.bipedRightArm.rotateAngleX -= var8 * 1.2F - var9 * 0.4F; + this.bipedLeftArm.rotateAngleX -= var8 * 1.2F - var9 * 0.4F; +- this.bipedRightArm.rotateAngleZ += MathHelper.cos(var3 * 0.09F) * 0.05F + 0.05F; +- this.bipedLeftArm.rotateAngleZ -= MathHelper.cos(var3 * 0.09F) * 0.05F + 0.05F; +- this.bipedRightArm.rotateAngleX += MathHelper.sin(var3 * 0.067F) * 0.05F; +- this.bipedLeftArm.rotateAngleX -= MathHelper.sin(var3 * 0.067F) * 0.05F; ++ this.bipedRightArm.rotateAngleZ += MathHelper.cos(par3 * 0.09F) * 0.05F + 0.05F; ++ this.bipedLeftArm.rotateAngleZ -= MathHelper.cos(par3 * 0.09F) * 0.05F + 0.05F; ++ this.bipedRightArm.rotateAngleX += MathHelper.sin(par3 * 0.067F) * 0.05F; ++ this.bipedLeftArm.rotateAngleX -= MathHelper.sin(par3 * 0.067F) * 0.05F; + } +- + } + +- public void renderEars(float var1) { ++ /** ++ * renders the ears (specifically, deadmau5's) ++ */ ++ public void renderEars(float par1) { + this.bipedEars.rotateAngleY = this.bipedHead.rotateAngleY; + this.bipedEars.rotateAngleX = this.bipedHead.rotateAngleX; + this.bipedEars.rotationPointX = 0.0F; + this.bipedEars.rotationPointY = 0.0F; +- this.bipedEars.render(var1); ++ this.bipedEars.render(par1); + } + +- public void renderCloak(float var1) { +- this.bipedCloak.render(var1); ++ /** ++ * Renders the cloak of the current biped (in most cases, it's a player) ++ */ ++ public void renderCloak(float par1) { ++ this.bipedCloak.render(par1); + } + } diff --git a/patches/net/minecraft/src/ModelBlaze.java.patch b/patches/net/minecraft/src/ModelBlaze.java.patch new file mode 100644 index 0000000..f9e219a --- /dev/null +++ b/patches/net/minecraft/src/ModelBlaze.java.patch @@ -0,0 +1,93 @@ +--- net/minecraft/src/ModelBlaze.java ++++ net/minecraft/src/ModelBlaze.java +@@ -1,11 +1,13 @@ + package net.minecraft.src; + + public class ModelBlaze extends ModelBase { ++ ++ /** The sticks that fly around the Blaze. */ + private ModelRenderer[] blazeSticks = new ModelRenderer[12]; + private ModelRenderer blazeHead; + + public ModelBlaze() { +- for(int var1 = 0; var1 < this.blazeSticks.length; ++var1) { ++ for (int var1 = 0; var1 < this.blazeSticks.length; ++var1) { + this.blazeSticks[var1] = new ModelRenderer(this, 0, 16); + this.blazeSticks[var1].addBox(0.0F, 0.0F, 0.0F, 2, 8, 2); + } +@@ -18,46 +20,53 @@ + return 8; + } + +- public void render(Entity var1, float var2, float var3, float var4, float var5, float var6, float var7) { +- this.setRotationAngles(var2, var3, var4, var5, var6, var7, var1); +- this.blazeHead.render(var7); ++ /** ++ * Sets the models various rotation angles then renders the model. ++ */ ++ public void render(Entity par1Entity, float par2, float par3, float par4, float par5, float par6, float par7) { ++ this.setRotationAngles(par2, par3, par4, par5, par6, par7, par1Entity); ++ this.blazeHead.render(par7); + +- for(int var8 = 0; var8 < this.blazeSticks.length; ++var8) { +- this.blazeSticks[var8].render(var7); ++ for (int var8 = 0; var8 < this.blazeSticks.length; ++var8) { ++ this.blazeSticks[var8].render(par7); + } +- + } + +- public void setRotationAngles(float var1, float var2, float var3, float var4, float var5, float var6, Entity var7) { +- float var8 = var3 * (float)Math.PI * -0.1F; +- ++ /** ++ * Sets the model's various rotation angles. For bipeds, par1 and par2 are used for animating the movement of arms and ++ * legs, where par1 represents the time(so that arms and legs swing back and forth) and par2 represents how "far" arms ++ * and legs can swing at most. ++ */ ++ public void setRotationAngles(float par1, float par2, float par3, float par4, float par5, float par6, Entity par7Entity) { ++ float var8 = par3 * (float)Math.PI * -0.1F; + int var9; +- for(var9 = 0; var9 < 4; ++var9) { +- this.blazeSticks[var9].rotationPointY = -2.0F + MathHelper.cos(((float)(var9 * 2) + var3) * 0.25F); ++ ++ for (var9 = 0; var9 < 4; ++var9) { ++ this.blazeSticks[var9].rotationPointY = -2.0F + MathHelper.cos(((float)(var9 * 2) + par3) * 0.25F); + this.blazeSticks[var9].rotationPointX = MathHelper.cos(var8) * 9.0F; + this.blazeSticks[var9].rotationPointZ = MathHelper.sin(var8) * 9.0F; +- var8 += (float)Math.PI * 0.5F; ++ ++var8; + } + +- var8 = (float)Math.PI * 0.25F + var3 * (float)Math.PI * 0.03F; ++ var8 = ((float)Math.PI / 4F) + par3 * (float)Math.PI * 0.03F; + +- for(var9 = 4; var9 < 8; ++var9) { +- this.blazeSticks[var9].rotationPointY = 2.0F + MathHelper.cos(((float)(var9 * 2) + var3) * 0.25F); ++ for (var9 = 4; var9 < 8; ++var9) { ++ this.blazeSticks[var9].rotationPointY = 2.0F + MathHelper.cos(((float)(var9 * 2) + par3) * 0.25F); + this.blazeSticks[var9].rotationPointX = MathHelper.cos(var8) * 7.0F; + this.blazeSticks[var9].rotationPointZ = MathHelper.sin(var8) * 7.0F; +- var8 += (float)Math.PI * 0.5F; ++ ++var8; + } + +- var8 = (float)Math.PI * 0.15F + var3 * (float)Math.PI * -0.05F; ++ var8 = 0.47123894F + par3 * (float)Math.PI * -0.05F; + +- for(var9 = 8; var9 < 12; ++var9) { +- this.blazeSticks[var9].rotationPointY = 11.0F + MathHelper.cos(((float)var9 * 1.5F + var3) * 0.5F); ++ for (var9 = 8; var9 < 12; ++var9) { ++ this.blazeSticks[var9].rotationPointY = 11.0F + MathHelper.cos(((float)var9 * 1.5F + par3) * 0.5F); + this.blazeSticks[var9].rotationPointX = MathHelper.cos(var8) * 5.0F; + this.blazeSticks[var9].rotationPointZ = MathHelper.sin(var8) * 5.0F; +- var8 += (float)Math.PI * 0.5F; ++ ++var8; + } + +- this.blazeHead.rotateAngleY = var4 / (180.0F / (float)Math.PI); +- this.blazeHead.rotateAngleX = var5 / (180.0F / (float)Math.PI); ++ this.blazeHead.rotateAngleY = par4 / (180F / (float)Math.PI); ++ this.blazeHead.rotateAngleX = par5 / (180F / (float)Math.PI); + } + } diff --git a/patches/net/minecraft/src/ModelBoat.java.patch b/patches/net/minecraft/src/ModelBoat.java.patch new file mode 100644 index 0000000..f92bbf0 --- /dev/null +++ b/patches/net/minecraft/src/ModelBoat.java.patch @@ -0,0 +1,28 @@ +--- net/minecraft/src/ModelBoat.java ++++ net/minecraft/src/ModelBoat.java +@@ -23,16 +23,18 @@ + this.boatSides[3].setRotationPoint(0.0F, (float)var4, (float)(-var3 / 2 + 1)); + this.boatSides[4].addBox((float)(-var1 / 2 + 2), (float)(-var2 - 1), -1.0F, var1 - 4, var2, 2, 0.0F); + this.boatSides[4].setRotationPoint(0.0F, (float)var4, (float)(var3 / 2 - 1)); +- this.boatSides[0].rotateAngleX = (float)Math.PI * 0.5F; +- this.boatSides[1].rotateAngleY = (float)Math.PI * 3.0F / 2.0F; +- this.boatSides[2].rotateAngleY = (float)Math.PI * 0.5F; ++ this.boatSides[0].rotateAngleX = ((float)Math.PI / 2F); ++ this.boatSides[1].rotateAngleY = ((float)Math.PI * 3F / 2F); ++ this.boatSides[2].rotateAngleY = ((float)Math.PI / 2F); + this.boatSides[3].rotateAngleY = (float)Math.PI; + } + +- public void render(Entity var1, float var2, float var3, float var4, float var5, float var6, float var7) { +- for(int var8 = 0; var8 < 5; ++var8) { +- this.boatSides[var8].render(var7); ++ /** ++ * Sets the models various rotation angles then renders the model. ++ */ ++ public void render(Entity par1Entity, float par2, float par3, float par4, float par5, float par6, float par7) { ++ for (int var8 = 0; var8 < 5; ++var8) { ++ this.boatSides[var8].render(par7); + } +- + } + } diff --git a/patches/net/minecraft/src/ModelBook.java.patch b/patches/net/minecraft/src/ModelBook.java.patch new file mode 100644 index 0000000..6e26a32 --- /dev/null +++ b/patches/net/minecraft/src/ModelBook.java.patch @@ -0,0 +1,82 @@ +--- net/minecraft/src/ModelBook.java ++++ net/minecraft/src/ModelBook.java +@@ -1,39 +1,61 @@ + package net.minecraft.src; + + public class ModelBook extends ModelBase { ++ ++ /** Right cover renderer (when facing the book) */ + public ModelRenderer coverRight = (new ModelRenderer(this)).setTextureOffset(0, 0).addBox(-6.0F, -5.0F, 0.0F, 6, 10, 0); ++ ++ /** Left cover renderer (when facing the book) */ + public ModelRenderer coverLeft = (new ModelRenderer(this)).setTextureOffset(16, 0).addBox(0.0F, -5.0F, 0.0F, 6, 10, 0); ++ ++ /** The right pages renderer (when facing the book) */ + public ModelRenderer pagesRight = (new ModelRenderer(this)).setTextureOffset(0, 10).addBox(0.0F, -4.0F, -0.99F, 5, 8, 1); ++ ++ /** The left pages renderer (when facing the book) */ + public ModelRenderer pagesLeft = (new ModelRenderer(this)).setTextureOffset(12, 10).addBox(0.0F, -4.0F, -0.01F, 5, 8, 1); ++ ++ /** Right cover renderer (when facing the book) */ + public ModelRenderer flippingPageRight = (new ModelRenderer(this)).setTextureOffset(24, 10).addBox(0.0F, -4.0F, 0.0F, 5, 8, 0); ++ ++ /** Right cover renderer (when facing the book) */ + public ModelRenderer flippingPageLeft = (new ModelRenderer(this)).setTextureOffset(24, 10).addBox(0.0F, -4.0F, 0.0F, 5, 8, 0); ++ ++ /** The renderer of spine of the book */ + public ModelRenderer bookSpine = (new ModelRenderer(this)).setTextureOffset(12, 0).addBox(-1.0F, -5.0F, 0.0F, 2, 10, 0); + + public ModelBook() { + this.coverRight.setRotationPoint(0.0F, 0.0F, -1.0F); + this.coverLeft.setRotationPoint(0.0F, 0.0F, 1.0F); +- this.bookSpine.rotateAngleY = (float)Math.PI * 0.5F; +- } +- +- public void render(Entity var1, float var2, float var3, float var4, float var5, float var6, float var7) { +- this.setRotationAngles(var2, var3, var4, var5, var6, var7, var1); +- this.coverRight.render(var7); +- this.coverLeft.render(var7); +- this.bookSpine.render(var7); +- this.pagesRight.render(var7); +- this.pagesLeft.render(var7); +- this.flippingPageRight.render(var7); +- this.flippingPageLeft.render(var7); +- } +- +- public void setRotationAngles(float var1, float var2, float var3, float var4, float var5, float var6, Entity var7) { +- float var8 = (MathHelper.sin(var1 * 0.02F) * 0.1F + 1.25F) * var4; ++ this.bookSpine.rotateAngleY = ((float)Math.PI / 2F); ++ } ++ ++ /** ++ * Sets the models various rotation angles then renders the model. ++ */ ++ public void render(Entity par1Entity, float par2, float par3, float par4, float par5, float par6, float par7) { ++ this.setRotationAngles(par2, par3, par4, par5, par6, par7, par1Entity); ++ this.coverRight.render(par7); ++ this.coverLeft.render(par7); ++ this.bookSpine.render(par7); ++ this.pagesRight.render(par7); ++ this.pagesLeft.render(par7); ++ this.flippingPageRight.render(par7); ++ this.flippingPageLeft.render(par7); ++ } ++ ++ /** ++ * Sets the model's various rotation angles. For bipeds, par1 and par2 are used for animating the movement of arms and ++ * legs, where par1 represents the time(so that arms and legs swing back and forth) and par2 represents how "far" arms ++ * and legs can swing at most. ++ */ ++ public void setRotationAngles(float par1, float par2, float par3, float par4, float par5, float par6, Entity par7Entity) { ++ float var8 = (MathHelper.sin(par1 * 0.02F) * 0.1F + 1.25F) * par4; + this.coverRight.rotateAngleY = (float)Math.PI + var8; + this.coverLeft.rotateAngleY = -var8; + this.pagesRight.rotateAngleY = var8; + this.pagesLeft.rotateAngleY = -var8; +- this.flippingPageRight.rotateAngleY = var8 - var8 * 2.0F * var2; +- this.flippingPageLeft.rotateAngleY = var8 - var8 * 2.0F * var3; ++ this.flippingPageRight.rotateAngleY = var8 - var8 * 2.0F * par2; ++ this.flippingPageLeft.rotateAngleY = var8 - var8 * 2.0F * par3; + this.pagesRight.rotationPointX = MathHelper.sin(var8); + this.pagesLeft.rotationPointX = MathHelper.sin(var8); + this.flippingPageRight.rotationPointX = MathHelper.sin(var8); diff --git a/patches/net/minecraft/src/ModelBox.java.patch b/patches/net/minecraft/src/ModelBox.java.patch new file mode 100644 index 0000000..0fbf9c6 --- /dev/null +++ b/patches/net/minecraft/src/ModelBox.java.patch @@ -0,0 +1,144 @@ +--- net/minecraft/src/ModelBox.java ++++ net/minecraft/src/ModelBox.java +@@ -1,48 +1,67 @@ + package net.minecraft.src; + + public class ModelBox { ++ ++ /** ++ * The (x,y,z) vertex positions and (u,v) texture coordinates for each of the 8 points on a cube ++ */ + private PositionTextureVertex[] vertexPositions; ++ ++ /** An array of 6 TexturedQuads, one for each face of a cube */ + private TexturedQuad[] quadList; ++ ++ /** X vertex coordinate of lower box corner */ + public final float posX1; ++ ++ /** Y vertex coordinate of lower box corner */ + public final float posY1; ++ ++ /** Z vertex coordinate of lower box corner */ + public final float posZ1; ++ ++ /** X vertex coordinate of upper box corner */ + public final float posX2; ++ ++ /** Y vertex coordinate of upper box corner */ + public final float posY2; ++ ++ /** Z vertex coordinate of upper box corner */ + public final float posZ2; +- public String g; ++ public String field_78247_g; + +- public ModelBox(ModelRenderer var1, int var2, int var3, float var4, float var5, float var6, int var7, int var8, int var9, float var10) { +- this.posX1 = var4; +- this.posY1 = var5; +- this.posZ1 = var6; +- this.posX2 = var4 + (float)var7; +- this.posY2 = var5 + (float)var8; +- this.posZ2 = var6 + (float)var9; ++ public ModelBox(ModelRenderer par1ModelRenderer, int par2, int par3, float par4, float par5, float par6, int par7, int par8, int par9, float par10) { ++ this.posX1 = par4; ++ this.posY1 = par5; ++ this.posZ1 = par6; ++ this.posX2 = par4 + (float)par7; ++ this.posY2 = par5 + (float)par8; ++ this.posZ2 = par6 + (float)par9; + this.vertexPositions = new PositionTextureVertex[8]; + this.quadList = new TexturedQuad[6]; +- float var11 = var4 + (float)var7; +- float var12 = var5 + (float)var8; +- float var13 = var6 + (float)var9; +- var4 -= var10; +- var5 -= var10; +- var6 -= var10; +- var11 += var10; +- var12 += var10; +- var13 += var10; +- if(var1.mirror) { ++ float var11 = par4 + (float)par7; ++ float var12 = par5 + (float)par8; ++ float var13 = par6 + (float)par9; ++ par4 -= par10; ++ par5 -= par10; ++ par6 -= par10; ++ var11 += par10; ++ var12 += par10; ++ var13 += par10; ++ ++ if (par1ModelRenderer.mirror) { + float var14 = var11; +- var11 = var4; +- var4 = var14; ++ var11 = par4; ++ par4 = var14; + } + +- PositionTextureVertex var23 = new PositionTextureVertex(var4, var5, var6, 0.0F, 0.0F); +- PositionTextureVertex var15 = new PositionTextureVertex(var11, var5, var6, 0.0F, 8.0F); +- PositionTextureVertex var16 = new PositionTextureVertex(var11, var12, var6, 8.0F, 8.0F); +- PositionTextureVertex var17 = new PositionTextureVertex(var4, var12, var6, 8.0F, 0.0F); +- PositionTextureVertex var18 = new PositionTextureVertex(var4, var5, var13, 0.0F, 0.0F); +- PositionTextureVertex var19 = new PositionTextureVertex(var11, var5, var13, 0.0F, 8.0F); ++ PositionTextureVertex var23 = new PositionTextureVertex(par4, par5, par6, 0.0F, 0.0F); ++ PositionTextureVertex var15 = new PositionTextureVertex(var11, par5, par6, 0.0F, 8.0F); ++ PositionTextureVertex var16 = new PositionTextureVertex(var11, var12, par6, 8.0F, 8.0F); ++ PositionTextureVertex var17 = new PositionTextureVertex(par4, var12, par6, 8.0F, 0.0F); ++ PositionTextureVertex var18 = new PositionTextureVertex(par4, par5, var13, 0.0F, 0.0F); ++ PositionTextureVertex var19 = new PositionTextureVertex(var11, par5, var13, 0.0F, 8.0F); + PositionTextureVertex var20 = new PositionTextureVertex(var11, var12, var13, 8.0F, 8.0F); +- PositionTextureVertex var21 = new PositionTextureVertex(var4, var12, var13, 8.0F, 0.0F); ++ PositionTextureVertex var21 = new PositionTextureVertex(par4, var12, var13, 8.0F, 0.0F); + this.vertexPositions[0] = var23; + this.vertexPositions[1] = var15; + this.vertexPositions[2] = var16; +@@ -51,29 +70,31 @@ + this.vertexPositions[5] = var19; + this.vertexPositions[6] = var20; + this.vertexPositions[7] = var21; +- this.quadList[0] = new TexturedQuad(new PositionTextureVertex[]{var19, var15, var16, var20}, var2 + var9 + var7, var3 + var9, var2 + var9 + var7 + var9, var3 + var9 + var8, var1.textureWidth, var1.textureHeight); +- this.quadList[1] = new TexturedQuad(new PositionTextureVertex[]{var23, var18, var21, var17}, var2, var3 + var9, var2 + var9, var3 + var9 + var8, var1.textureWidth, var1.textureHeight); +- this.quadList[2] = new TexturedQuad(new PositionTextureVertex[]{var19, var18, var23, var15}, var2 + var9, var3, var2 + var9 + var7, var3 + var9, var1.textureWidth, var1.textureHeight); +- this.quadList[3] = new TexturedQuad(new PositionTextureVertex[]{var16, var17, var21, var20}, var2 + var9 + var7, var3 + var9, var2 + var9 + var7 + var7, var3, var1.textureWidth, var1.textureHeight); +- this.quadList[4] = new TexturedQuad(new PositionTextureVertex[]{var15, var23, var17, var16}, var2 + var9, var3 + var9, var2 + var9 + var7, var3 + var9 + var8, var1.textureWidth, var1.textureHeight); +- this.quadList[5] = new TexturedQuad(new PositionTextureVertex[]{var18, var19, var20, var21}, var2 + var9 + var7 + var9, var3 + var9, var2 + var9 + var7 + var9 + var7, var3 + var9 + var8, var1.textureWidth, var1.textureHeight); +- if(var1.mirror) { +- for(int var22 = 0; var22 < this.quadList.length; ++var22) { ++ this.quadList[0] = new TexturedQuad(new PositionTextureVertex[] {var19, var15, var16, var20}, par2 + par9 + par7, par3 + par9, par2 + par9 + par7 + par9, par3 + par9 + par8, par1ModelRenderer.textureWidth, par1ModelRenderer.textureHeight); ++ this.quadList[1] = new TexturedQuad(new PositionTextureVertex[] {var23, var18, var21, var17}, par2, par3 + par9, par2 + par9, par3 + par9 + par8, par1ModelRenderer.textureWidth, par1ModelRenderer.textureHeight); ++ this.quadList[2] = new TexturedQuad(new PositionTextureVertex[] {var19, var18, var23, var15}, par2 + par9, par3, par2 + par9 + par7, par3 + par9, par1ModelRenderer.textureWidth, par1ModelRenderer.textureHeight); ++ this.quadList[3] = new TexturedQuad(new PositionTextureVertex[] {var16, var17, var21, var20}, par2 + par9 + par7, par3 + par9, par2 + par9 + par7 + par7, par3, par1ModelRenderer.textureWidth, par1ModelRenderer.textureHeight); ++ this.quadList[4] = new TexturedQuad(new PositionTextureVertex[] {var15, var23, var17, var16}, par2 + par9, par3 + par9, par2 + par9 + par7, par3 + par9 + par8, par1ModelRenderer.textureWidth, par1ModelRenderer.textureHeight); ++ this.quadList[5] = new TexturedQuad(new PositionTextureVertex[] {var18, var19, var20, var21}, par2 + par9 + par7 + par9, par3 + par9, par2 + par9 + par7 + par9 + par7, par3 + par9 + par8, par1ModelRenderer.textureWidth, par1ModelRenderer.textureHeight); ++ ++ if (par1ModelRenderer.mirror) { ++ for (int var22 = 0; var22 < this.quadList.length; ++var22) { + this.quadList[var22].flipFace(); + } + } +- + } + +- public void render(Tessellator var1, float var2) { +- for(int var3 = 0; var3 < this.quadList.length; ++var3) { +- this.quadList[var3].draw(var1, var2); ++ /** ++ * Draw the six sided box defined by this ModelBox ++ */ ++ public void render(Tessellator par1Tessellator, float par2) { ++ for (int var3 = 0; var3 < this.quadList.length; ++var3) { ++ this.quadList[var3].draw(par1Tessellator, par2); + } +- + } + +- public ModelBox func_78244_a(String var1) { +- this.g = var1; ++ public ModelBox func_78244_a(String par1Str) { ++ this.field_78247_g = par1Str; + return this; + } + } diff --git a/patches/net/minecraft/src/ModelChest.java.patch b/patches/net/minecraft/src/ModelChest.java.patch new file mode 100644 index 0000000..8fd34e7 --- /dev/null +++ b/patches/net/minecraft/src/ModelChest.java.patch @@ -0,0 +1,34 @@ +--- net/minecraft/src/ModelChest.java ++++ net/minecraft/src/ModelChest.java +@@ -1,8 +1,14 @@ + package net.minecraft.src; + + public class ModelChest extends ModelBase { ++ ++ /** The chest lid in the chest's model. */ + public ModelRenderer chestLid = (new ModelRenderer(this, 0, 0)).setTextureSize(64, 64); ++ ++ /** The model of the bottom of the chest. */ + public ModelRenderer chestBelow; ++ ++ /** The chest's knob in the chest model. */ + public ModelRenderer chestKnob; + + public ModelChest() { +@@ -22,10 +28,13 @@ + this.chestBelow.rotationPointZ = 1.0F; + } + ++ /** ++ * This method renders out all parts of the chest model. ++ */ + public void renderAll() { + this.chestKnob.rotateAngleX = this.chestLid.rotateAngleX; +- this.chestLid.render(1.0F / 16.0F); +- this.chestKnob.render(1.0F / 16.0F); +- this.chestBelow.render(1.0F / 16.0F); ++ this.chestLid.render(0.0625F); ++ this.chestKnob.render(0.0625F); ++ this.chestBelow.render(0.0625F); + } + } diff --git a/patches/net/minecraft/src/ModelChicken.java.patch b/patches/net/minecraft/src/ModelChicken.java.patch new file mode 100644 index 0000000..a15ca4c --- /dev/null +++ b/patches/net/minecraft/src/ModelChicken.java.patch @@ -0,0 +1,90 @@ +--- net/minecraft/src/ModelChicken.java ++++ net/minecraft/src/ModelChicken.java +@@ -40,49 +40,57 @@ + this.leftWing.setRotationPoint(4.0F, (float)(-3 + var1), 0.0F); + } + +- public void render(Entity var1, float var2, float var3, float var4, float var5, float var6, float var7) { +- this.setRotationAngles(var2, var3, var4, var5, var6, var7, var1); +- if(this.isChild) { ++ /** ++ * Sets the models various rotation angles then renders the model. ++ */ ++ public void render(Entity par1Entity, float par2, float par3, float par4, float par5, float par6, float par7) { ++ this.setRotationAngles(par2, par3, par4, par5, par6, par7, par1Entity); ++ ++ if (this.isChild) { + float var8 = 2.0F; + GL11.glPushMatrix(); +- GL11.glTranslatef(0.0F, 5.0F * var7, 2.0F * var7); +- this.head.render(var7); +- this.bill.render(var7); +- this.chin.render(var7); ++ GL11.glTranslatef(0.0F, 5.0F * par7, 2.0F * par7); ++ this.head.render(par7); ++ this.bill.render(par7); ++ this.chin.render(par7); + GL11.glPopMatrix(); + GL11.glPushMatrix(); + GL11.glScalef(1.0F / var8, 1.0F / var8, 1.0F / var8); +- GL11.glTranslatef(0.0F, 24.0F * var7, 0.0F); +- this.body.render(var7); +- this.rightLeg.render(var7); +- this.leftLeg.render(var7); +- this.rightWing.render(var7); +- this.leftWing.render(var7); ++ GL11.glTranslatef(0.0F, 24.0F * par7, 0.0F); ++ this.body.render(par7); ++ this.rightLeg.render(par7); ++ this.leftLeg.render(par7); ++ this.rightWing.render(par7); ++ this.leftWing.render(par7); + GL11.glPopMatrix(); + } else { +- this.head.render(var7); +- this.bill.render(var7); +- this.chin.render(var7); +- this.body.render(var7); +- this.rightLeg.render(var7); +- this.leftLeg.render(var7); +- this.rightWing.render(var7); +- this.leftWing.render(var7); ++ this.head.render(par7); ++ this.bill.render(par7); ++ this.chin.render(par7); ++ this.body.render(par7); ++ this.rightLeg.render(par7); ++ this.leftLeg.render(par7); ++ this.rightWing.render(par7); ++ this.leftWing.render(par7); + } +- + } + +- public void setRotationAngles(float var1, float var2, float var3, float var4, float var5, float var6, Entity var7) { +- this.head.rotateAngleX = var5 / (180.0F / (float)Math.PI); +- this.head.rotateAngleY = var4 / (180.0F / (float)Math.PI); ++ /** ++ * Sets the model's various rotation angles. For bipeds, par1 and par2 are used for animating the movement of arms and ++ * legs, where par1 represents the time(so that arms and legs swing back and forth) and par2 represents how "far" arms ++ * and legs can swing at most. ++ */ ++ public void setRotationAngles(float par1, float par2, float par3, float par4, float par5, float par6, Entity par7Entity) { ++ this.head.rotateAngleX = par5 / (180F / (float)Math.PI); ++ this.head.rotateAngleY = par4 / (180F / (float)Math.PI); + this.bill.rotateAngleX = this.head.rotateAngleX; + this.bill.rotateAngleY = this.head.rotateAngleY; + this.chin.rotateAngleX = this.head.rotateAngleX; + this.chin.rotateAngleY = this.head.rotateAngleY; +- this.body.rotateAngleX = (float)Math.PI * 0.5F; +- this.rightLeg.rotateAngleX = MathHelper.cos(var1 * 0.6662F) * 1.4F * var2; +- this.leftLeg.rotateAngleX = MathHelper.cos(var1 * 0.6662F + (float)Math.PI) * 1.4F * var2; +- this.rightWing.rotateAngleZ = var3; +- this.leftWing.rotateAngleZ = -var3; ++ this.body.rotateAngleX = ((float)Math.PI / 2F); ++ this.rightLeg.rotateAngleX = MathHelper.cos(par1 * 0.6662F) * 1.4F * par2; ++ this.leftLeg.rotateAngleX = MathHelper.cos(par1 * 0.6662F + (float)Math.PI) * 1.4F * par2; ++ this.rightWing.rotateAngleZ = par3; ++ this.leftWing.rotateAngleZ = -par3; + } + } diff --git a/patches/net/minecraft/src/ModelCreeper.java.patch b/patches/net/minecraft/src/ModelCreeper.java.patch new file mode 100644 index 0000000..26bd755 --- /dev/null +++ b/patches/net/minecraft/src/ModelCreeper.java.patch @@ -0,0 +1,81 @@ +--- net/minecraft/src/ModelCreeper.java ++++ net/minecraft/src/ModelCreeper.java +@@ -13,47 +13,55 @@ + this(0.0F); + } + +- public ModelCreeper(float var1) { ++ public ModelCreeper(float par1) { + byte var2 = 4; + this.head = new ModelRenderer(this, 0, 0); +- this.head.addBox(-4.0F, -8.0F, -4.0F, 8, 8, 8, var1); ++ this.head.addBox(-4.0F, -8.0F, -4.0F, 8, 8, 8, par1); + this.head.setRotationPoint(0.0F, (float)var2, 0.0F); + this.field_78133_b = new ModelRenderer(this, 32, 0); +- this.field_78133_b.addBox(-4.0F, -8.0F, -4.0F, 8, 8, 8, var1 + 0.5F); ++ this.field_78133_b.addBox(-4.0F, -8.0F, -4.0F, 8, 8, 8, par1 + 0.5F); + this.field_78133_b.setRotationPoint(0.0F, (float)var2, 0.0F); + this.body = new ModelRenderer(this, 16, 16); +- this.body.addBox(-4.0F, 0.0F, -2.0F, 8, 12, 4, var1); ++ this.body.addBox(-4.0F, 0.0F, -2.0F, 8, 12, 4, par1); + this.body.setRotationPoint(0.0F, (float)var2, 0.0F); + this.leg1 = new ModelRenderer(this, 0, 16); +- this.leg1.addBox(-2.0F, 0.0F, -2.0F, 4, 6, 4, var1); ++ this.leg1.addBox(-2.0F, 0.0F, -2.0F, 4, 6, 4, par1); + this.leg1.setRotationPoint(-2.0F, (float)(12 + var2), 4.0F); + this.leg2 = new ModelRenderer(this, 0, 16); +- this.leg2.addBox(-2.0F, 0.0F, -2.0F, 4, 6, 4, var1); ++ this.leg2.addBox(-2.0F, 0.0F, -2.0F, 4, 6, 4, par1); + this.leg2.setRotationPoint(2.0F, (float)(12 + var2), 4.0F); + this.leg3 = new ModelRenderer(this, 0, 16); +- this.leg3.addBox(-2.0F, 0.0F, -2.0F, 4, 6, 4, var1); ++ this.leg3.addBox(-2.0F, 0.0F, -2.0F, 4, 6, 4, par1); + this.leg3.setRotationPoint(-2.0F, (float)(12 + var2), -4.0F); + this.leg4 = new ModelRenderer(this, 0, 16); +- this.leg4.addBox(-2.0F, 0.0F, -2.0F, 4, 6, 4, var1); ++ this.leg4.addBox(-2.0F, 0.0F, -2.0F, 4, 6, 4, par1); + this.leg4.setRotationPoint(2.0F, (float)(12 + var2), -4.0F); + } + +- public void render(Entity var1, float var2, float var3, float var4, float var5, float var6, float var7) { +- this.setRotationAngles(var2, var3, var4, var5, var6, var7, var1); +- this.head.render(var7); +- this.body.render(var7); +- this.leg1.render(var7); +- this.leg2.render(var7); +- this.leg3.render(var7); +- this.leg4.render(var7); ++ /** ++ * Sets the models various rotation angles then renders the model. ++ */ ++ public void render(Entity par1Entity, float par2, float par3, float par4, float par5, float par6, float par7) { ++ this.setRotationAngles(par2, par3, par4, par5, par6, par7, par1Entity); ++ this.head.render(par7); ++ this.body.render(par7); ++ this.leg1.render(par7); ++ this.leg2.render(par7); ++ this.leg3.render(par7); ++ this.leg4.render(par7); + } + +- public void setRotationAngles(float var1, float var2, float var3, float var4, float var5, float var6, Entity var7) { +- this.head.rotateAngleY = var4 / (180.0F / (float)Math.PI); +- this.head.rotateAngleX = var5 / (180.0F / (float)Math.PI); +- this.leg1.rotateAngleX = MathHelper.cos(var1 * 0.6662F) * 1.4F * var2; +- this.leg2.rotateAngleX = MathHelper.cos(var1 * 0.6662F + (float)Math.PI) * 1.4F * var2; +- this.leg3.rotateAngleX = MathHelper.cos(var1 * 0.6662F + (float)Math.PI) * 1.4F * var2; +- this.leg4.rotateAngleX = MathHelper.cos(var1 * 0.6662F) * 1.4F * var2; ++ /** ++ * Sets the model's various rotation angles. For bipeds, par1 and par2 are used for animating the movement of arms and ++ * legs, where par1 represents the time(so that arms and legs swing back and forth) and par2 represents how "far" arms ++ * and legs can swing at most. ++ */ ++ public void setRotationAngles(float par1, float par2, float par3, float par4, float par5, float par6, Entity par7Entity) { ++ this.head.rotateAngleY = par4 / (180F / (float)Math.PI); ++ this.head.rotateAngleX = par5 / (180F / (float)Math.PI); ++ this.leg1.rotateAngleX = MathHelper.cos(par1 * 0.6662F) * 1.4F * par2; ++ this.leg2.rotateAngleX = MathHelper.cos(par1 * 0.6662F + (float)Math.PI) * 1.4F * par2; ++ this.leg3.rotateAngleX = MathHelper.cos(par1 * 0.6662F + (float)Math.PI) * 1.4F * par2; ++ this.leg4.rotateAngleX = MathHelper.cos(par1 * 0.6662F) * 1.4F * par2; + } + } diff --git a/patches/net/minecraft/src/ModelDragon.java.patch b/patches/net/minecraft/src/ModelDragon.java.patch new file mode 100644 index 0000000..39d1236 --- /dev/null +++ b/patches/net/minecraft/src/ModelDragon.java.patch @@ -0,0 +1,190 @@ +--- net/minecraft/src/ModelDragon.java ++++ net/minecraft/src/ModelDragon.java +@@ -3,21 +3,45 @@ + import org.lwjgl.opengl.GL11; + + public class ModelDragon extends ModelBase { ++ ++ /** The head Model renderer of the dragon */ + private ModelRenderer head; ++ ++ /** The spine Model renderer of the dragon */ + private ModelRenderer spine; ++ ++ /** The jaw Model renderer of the dragon */ + private ModelRenderer jaw; ++ ++ /** The body Model renderer of the dragon */ + private ModelRenderer body; ++ ++ /** The rear leg Model renderer of the dragon */ + private ModelRenderer rearLeg; ++ ++ /** The front leg Model renderer of the dragon */ + private ModelRenderer frontLeg; ++ ++ /** The rear leg tip Model renderer of the dragon */ + private ModelRenderer rearLegTip; ++ ++ /** The front leg tip Model renderer of the dragon */ + private ModelRenderer frontLegTip; ++ ++ /** The rear foot Model renderer of the dragon */ + private ModelRenderer rearFoot; ++ ++ /** The front foot Model renderer of the dragon */ + private ModelRenderer frontFoot; ++ ++ /** The wing Model renderer of the dragon */ + private ModelRenderer wing; ++ ++ /** The wing tip Model renderer of the dragon */ + private ModelRenderer wingTip; + private float partialTicks; + +- public ModelDragon(float var1) { ++ public ModelDragon(float par1) { + this.textureWidth = 256; + this.textureHeight = 256; + this.setTextureOffset("body.body", 0, 0); +@@ -95,13 +119,20 @@ + this.rearLegTip.addChild(this.rearFoot); + } + +- public void setLivingAnimations(EntityLivingBase var1, float var2, float var3, float var4) { +- this.partialTicks = var4; ++ /** ++ * Used for easily adding entity-dependent animations. The second and third float params here are the same second and ++ * third as in the setRotationAngles method. ++ */ ++ public void setLivingAnimations(EntityLivingBase par1EntityLivingBase, float par2, float par3, float par4) { ++ this.partialTicks = par4; + } + +- public void render(Entity var1, float var2, float var3, float var4, float var5, float var6, float var7) { ++ /** ++ * Sets the models various rotation angles then renders the model. ++ */ ++ public void render(Entity par1Entity, float par2, float par3, float par4, float par5, float par6, float par7) { + GL11.glPushMatrix(); +- EntityDragon var8 = (EntityDragon)var1; ++ EntityDragon var8 = (EntityDragon)par1Entity; + float var9 = var8.prevAnimTime + (var8.animTime - var8.prevAnimTime) * this.partialTicks; + this.jaw.rotateAngleX = (float)(Math.sin((double)(var9 * (float)Math.PI * 2.0F)) + 1.0D) * 0.2F; + float var10 = (float)(Math.sin((double)(var9 * (float)Math.PI * 2.0F - 1.0F)) + 1.0D); +@@ -118,9 +149,9 @@ + float var18 = var9 * (float)Math.PI * 2.0F; + var11 = 20.0F; + float var12 = -12.0F; +- + float var21; +- for(int var19 = 0; var19 < 5; ++var19) { ++ ++ for (int var19 = 0; var19 < 5; ++var19) { + double[] var20 = var8.getMovementOffsets(5 - var19, this.partialTicks); + var21 = (float)Math.cos((double)((float)var19 * 0.45F + var18)) * 0.15F; + this.spine.rotateAngleY = this.updateRotations(var20[0] - var15[0]) * (float)Math.PI / 180.0F * var14; +@@ -132,7 +163,7 @@ + var11 = (float)((double)var11 + Math.sin((double)this.spine.rotateAngleX) * 10.0D); + var12 = (float)((double)var12 - Math.cos((double)this.spine.rotateAngleY) * Math.cos((double)this.spine.rotateAngleX) * 10.0D); + var13 = (float)((double)var13 - Math.sin((double)this.spine.rotateAngleY) * Math.cos((double)this.spine.rotateAngleX) * 10.0D); +- this.spine.render(var7); ++ this.spine.render(par7); + } + + this.head.rotationPointY = var11; +@@ -141,32 +172,33 @@ + double[] var22 = var8.getMovementOffsets(0, this.partialTicks); + this.head.rotateAngleY = this.updateRotations(var22[0] - var15[0]) * (float)Math.PI / 180.0F * 1.0F; + this.head.rotateAngleZ = -this.updateRotations(var22[0] - (double)var17) * (float)Math.PI / 180.0F * 1.0F; +- this.head.render(var7); ++ this.head.render(par7); + GL11.glPushMatrix(); + GL11.glTranslatef(0.0F, 1.0F, 0.0F); + GL11.glRotatef(-var16 * var14 * 1.0F, 0.0F, 0.0F, 1.0F); + GL11.glTranslatef(0.0F, -1.0F, 0.0F); + this.body.rotateAngleZ = 0.0F; +- this.body.render(var7); ++ this.body.render(par7); + +- for(int var23 = 0; var23 < 2; ++var23) { ++ for (int var23 = 0; var23 < 2; ++var23) { + GL11.glEnable(GL11.GL_CULL_FACE); + var21 = var9 * (float)Math.PI * 2.0F; +- this.wing.rotateAngleX = 2.0F / 16.0F - (float)Math.cos((double)var21) * 0.2F; ++ this.wing.rotateAngleX = 0.125F - (float)Math.cos((double)var21) * 0.2F; + this.wing.rotateAngleY = 0.25F; + this.wing.rotateAngleZ = (float)(Math.sin((double)var21) + 0.125D) * 0.8F; +- this.wingTip.rotateAngleZ = -((float)(Math.sin((double)(var21 + 2.0F)) + 0.5D)) * (12.0F / 16.0F); ++ this.wingTip.rotateAngleZ = -((float)(Math.sin((double)(var21 + 2.0F)) + 0.5D)) * 0.75F; + this.rearLeg.rotateAngleX = 1.0F + var10 * 0.1F; + this.rearLegTip.rotateAngleX = 0.5F + var10 * 0.1F; +- this.rearFoot.rotateAngleX = 12.0F / 16.0F + var10 * 0.1F; ++ this.rearFoot.rotateAngleX = 0.75F + var10 * 0.1F; + this.frontLeg.rotateAngleX = 1.3F + var10 * 0.1F; + this.frontLegTip.rotateAngleX = -0.5F - var10 * 0.1F; +- this.frontFoot.rotateAngleX = 12.0F / 16.0F + var10 * 0.1F; +- this.wing.render(var7); +- this.frontLeg.render(var7); +- this.rearLeg.render(var7); ++ this.frontFoot.rotateAngleX = 0.75F + var10 * 0.1F; ++ this.wing.render(par7); ++ this.frontLeg.render(par7); ++ this.rearLeg.render(par7); + GL11.glScalef(-1.0F, 1.0F, 1.0F); +- if(var23 == 0) { ++ ++ if (var23 == 0) { + GL11.glCullFace(GL11.GL_FRONT); + } + } +@@ -181,9 +213,9 @@ + var13 = 0.0F; + var15 = var8.getMovementOffsets(11, this.partialTicks); + +- for(int var25 = 0; var25 < 12; ++var25) { ++ for (int var25 = 0; var25 < 12; ++var25) { + var22 = var8.getMovementOffsets(12 + var25, this.partialTicks); +- var24 = (float)((double)var24 + Math.sin((double)((float)var25 * 0.45F + var18)) * (double)0.05F); ++ var24 = (float)((double)var24 + Math.sin((double)((float)var25 * 0.45F + var18)) * 0.05000000074505806D); + this.spine.rotateAngleY = (this.updateRotations(var22[0] - var15[0]) * var14 + 180.0F) * (float)Math.PI / 180.0F; + this.spine.rotateAngleX = var24 + (float)(var22[1] - var15[1]) * (float)Math.PI / 180.0F * var14 * 5.0F; + this.spine.rotateAngleZ = this.updateRotations(var22[0] - (double)var17) * (float)Math.PI / 180.0F * var14; +@@ -193,21 +225,26 @@ + var11 = (float)((double)var11 + Math.sin((double)this.spine.rotateAngleX) * 10.0D); + var12 = (float)((double)var12 - Math.cos((double)this.spine.rotateAngleY) * Math.cos((double)this.spine.rotateAngleX) * 10.0D); + var13 = (float)((double)var13 - Math.sin((double)this.spine.rotateAngleY) * Math.cos((double)this.spine.rotateAngleX) * 10.0D); +- this.spine.render(var7); ++ this.spine.render(par7); + } + + GL11.glPopMatrix(); + } + +- private float updateRotations(double var1) { +- while(var1 >= 180.0D) { +- var1 -= 360.0D; +- } +- +- while(var1 < -180.0D) { +- var1 += 360.0D; +- } +- +- return (float)var1; ++ /** ++ * Updates the rotations in the parameters for rotations greater than 180 degrees or less than -180 degrees. It adds or ++ * subtracts 360 degrees, so that the appearance is the same, although the numbers are then simplified to range -180 to ++ * 180 ++ */ ++ private float updateRotations(double par1) { ++ while (par1 >= 180.0D) { ++ par1 -= 360.0D; ++ } ++ ++ while (par1 < -180.0D) { ++ par1 += 360.0D; ++ } ++ ++ return (float)par1; + } + } diff --git a/patches/net/minecraft/src/ModelEnderCrystal.java.patch b/patches/net/minecraft/src/ModelEnderCrystal.java.patch new file mode 100644 index 0000000..2ca94f3 --- /dev/null +++ b/patches/net/minecraft/src/ModelEnderCrystal.java.patch @@ -0,0 +1,74 @@ +--- net/minecraft/src/ModelEnderCrystal.java ++++ net/minecraft/src/ModelEnderCrystal.java +@@ -3,42 +3,52 @@ + import org.lwjgl.opengl.GL11; + + public class ModelEnderCrystal extends ModelBase { ++ ++ /** The cube model for the Ender Crystal. */ + private ModelRenderer cube; ++ ++ /** The glass model for the Ender Crystal. */ + private ModelRenderer glass = new ModelRenderer(this, "glass"); ++ ++ /** The base model for the Ender Crystal. */ + private ModelRenderer base; + +- public ModelEnderCrystal(float var1, boolean var2) { ++ public ModelEnderCrystal(float par1, boolean par2) { + this.glass.setTextureOffset(0, 0).addBox(-4.0F, -4.0F, -4.0F, 8, 8, 8); + this.cube = new ModelRenderer(this, "cube"); + this.cube.setTextureOffset(32, 0).addBox(-4.0F, -4.0F, -4.0F, 8, 8, 8); +- if(var2) { ++ ++ if (par2) { + this.base = new ModelRenderer(this, "base"); + this.base.setTextureOffset(0, 16).addBox(-6.0F, 0.0F, -6.0F, 12, 4, 12); + } +- + } + +- public void render(Entity var1, float var2, float var3, float var4, float var5, float var6, float var7) { ++ /** ++ * Sets the models various rotation angles then renders the model. ++ */ ++ public void render(Entity par1Entity, float par2, float par3, float par4, float par5, float par6, float par7) { + GL11.glPushMatrix(); + GL11.glScalef(2.0F, 2.0F, 2.0F); + GL11.glTranslatef(0.0F, -0.5F, 0.0F); +- if(this.base != null) { +- this.base.render(var7); ++ ++ if (this.base != null) { ++ this.base.render(par7); + } + +- GL11.glRotatef(var3, 0.0F, 1.0F, 0.0F); +- GL11.glTranslatef(0.0F, 0.8F + var4, 0.0F); +- GL11.glRotatef(60.0F, 0.7071F, 0.0F, 0.7071F); +- this.glass.render(var7); +- float var8 = 14.0F / 16.0F; +- GL11.glScalef(var8, var8, var8); +- GL11.glRotatef(60.0F, 0.7071F, 0.0F, 0.7071F); +- GL11.glRotatef(var3, 0.0F, 1.0F, 0.0F); +- this.glass.render(var7); +- GL11.glScalef(var8, var8, var8); +- GL11.glRotatef(60.0F, 0.7071F, 0.0F, 0.7071F); +- GL11.glRotatef(var3, 0.0F, 1.0F, 0.0F); +- this.cube.render(var7); ++ GL11.glRotatef(par3, 0.0F, 1.0F, 0.0F); ++ GL11.glTranslatef(0.0F, 0.8F + par4, 0.0F); ++ GL11.glRotatef(60.0F, 0.7071F, 0.0F, 0.7071F); ++ this.glass.render(par7); ++ float var8 = 0.875F; ++ GL11.glScalef(var8, var8, var8); ++ GL11.glRotatef(60.0F, 0.7071F, 0.0F, 0.7071F); ++ GL11.glRotatef(par3, 0.0F, 1.0F, 0.0F); ++ this.glass.render(par7); ++ GL11.glScalef(var8, var8, var8); ++ GL11.glRotatef(60.0F, 0.7071F, 0.0F, 0.7071F); ++ GL11.glRotatef(par3, 0.0F, 1.0F, 0.0F); ++ this.cube.render(par7); + GL11.glPopMatrix(); + } + } diff --git a/patches/net/minecraft/src/ModelEnderman.java.patch b/patches/net/minecraft/src/ModelEnderman.java.patch new file mode 100644 index 0000000..ba3f875 --- /dev/null +++ b/patches/net/minecraft/src/ModelEnderman.java.patch @@ -0,0 +1,93 @@ +--- net/minecraft/src/ModelEnderman.java ++++ net/minecraft/src/ModelEnderman.java +@@ -1,7 +1,11 @@ + package net.minecraft.src; + + public class ModelEnderman extends ModelBiped { ++ ++ /** Is the enderman carrying a block? */ + public boolean isCarrying; ++ ++ /** Is the enderman attacking an entity? */ + public boolean isAttacking; + + public ModelEnderman() { +@@ -30,8 +34,13 @@ + this.bipedLeftLeg.setRotationPoint(2.0F, 12.0F + var1, 0.0F); + } + +- public void setRotationAngles(float var1, float var2, float var3, float var4, float var5, float var6, Entity var7) { +- super.setRotationAngles(var1, var2, var3, var4, var5, var6, var7); ++ /** ++ * Sets the model's various rotation angles. For bipeds, par1 and par2 are used for animating the movement of arms and ++ * legs, where par1 represents the time(so that arms and legs swing back and forth) and par2 represents how "far" arms ++ * and legs can swing at most. ++ */ ++ public void setRotationAngles(float par1, float par2, float par3, float par4, float par5, float par6, Entity par7Entity) { ++ super.setRotationAngles(par1, par2, par3, par4, par5, par6, par7Entity); + this.bipedHead.showModel = true; + float var8 = -14.0F; + this.bipedBody.rotateAngleX = 0.0F; +@@ -44,39 +53,40 @@ + this.bipedRightLeg.rotateAngleX = (float)((double)this.bipedRightLeg.rotateAngleX * 0.5D); + this.bipedLeftLeg.rotateAngleX = (float)((double)this.bipedLeftLeg.rotateAngleX * 0.5D); + float var9 = 0.4F; +- if(this.bipedRightArm.rotateAngleX > var9) { ++ ++ if (this.bipedRightArm.rotateAngleX > var9) { + this.bipedRightArm.rotateAngleX = var9; + } + +- if(this.bipedLeftArm.rotateAngleX > var9) { ++ if (this.bipedLeftArm.rotateAngleX > var9) { + this.bipedLeftArm.rotateAngleX = var9; + } + +- if(this.bipedRightArm.rotateAngleX < -var9) { ++ if (this.bipedRightArm.rotateAngleX < -var9) { + this.bipedRightArm.rotateAngleX = -var9; + } + +- if(this.bipedLeftArm.rotateAngleX < -var9) { ++ if (this.bipedLeftArm.rotateAngleX < -var9) { + this.bipedLeftArm.rotateAngleX = -var9; + } + +- if(this.bipedRightLeg.rotateAngleX > var9) { ++ if (this.bipedRightLeg.rotateAngleX > var9) { + this.bipedRightLeg.rotateAngleX = var9; + } + +- if(this.bipedLeftLeg.rotateAngleX > var9) { ++ if (this.bipedLeftLeg.rotateAngleX > var9) { + this.bipedLeftLeg.rotateAngleX = var9; + } + +- if(this.bipedRightLeg.rotateAngleX < -var9) { ++ if (this.bipedRightLeg.rotateAngleX < -var9) { + this.bipedRightLeg.rotateAngleX = -var9; + } + +- if(this.bipedLeftLeg.rotateAngleX < -var9) { ++ if (this.bipedLeftLeg.rotateAngleX < -var9) { + this.bipedLeftLeg.rotateAngleX = -var9; + } + +- if(this.isCarrying) { ++ if (this.isCarrying) { + this.bipedRightArm.rotateAngleX = -0.5F; + this.bipedLeftArm.rotateAngleX = -0.5F; + this.bipedRightArm.rotateAngleZ = 0.05F; +@@ -97,10 +107,10 @@ + this.bipedHeadwear.rotateAngleX = this.bipedHead.rotateAngleX; + this.bipedHeadwear.rotateAngleY = this.bipedHead.rotateAngleY; + this.bipedHeadwear.rotateAngleZ = this.bipedHead.rotateAngleZ; +- if(this.isAttacking) { ++ ++ if (this.isAttacking) { + float var10 = 1.0F; + this.bipedHead.rotationPointY -= var10 * 5.0F; + } +- + } + } diff --git a/patches/net/minecraft/src/ModelGhast.java.patch b/patches/net/minecraft/src/ModelGhast.java.patch new file mode 100644 index 0000000..4e90bc4 --- /dev/null +++ b/patches/net/minecraft/src/ModelGhast.java.patch @@ -0,0 +1,55 @@ +--- net/minecraft/src/ModelGhast.java ++++ net/minecraft/src/ModelGhast.java +@@ -14,7 +14,7 @@ + this.body.rotationPointY += (float)(24 + var1); + Random var2 = new Random(1660L); + +- for(int var3 = 0; var3 < this.tentacles.length; ++var3) { ++ for (int var3 = 0; var3 < this.tentacles.length; ++var3) { + this.tentacles[var3] = new ModelRenderer(this, 0, 0); + float var4 = (((float)(var3 % 3) - (float)(var3 / 3 % 2) * 0.5F + 0.25F) / 2.0F * 2.0F - 1.0F) * 5.0F; + float var5 = ((float)(var3 / 3) / 2.0F * 2.0F - 1.0F) * 5.0F; +@@ -24,27 +24,33 @@ + this.tentacles[var3].rotationPointZ = var5; + this.tentacles[var3].rotationPointY = (float)(31 + var1); + } +- + } + +- public void setRotationAngles(float var1, float var2, float var3, float var4, float var5, float var6, Entity var7) { +- for(int var8 = 0; var8 < this.tentacles.length; ++var8) { +- this.tentacles[var8].rotateAngleX = 0.2F * MathHelper.sin(var3 * 0.3F + (float)var8) + 0.4F; ++ /** ++ * Sets the model's various rotation angles. For bipeds, par1 and par2 are used for animating the movement of arms and ++ * legs, where par1 represents the time(so that arms and legs swing back and forth) and par2 represents how "far" arms ++ * and legs can swing at most. ++ */ ++ public void setRotationAngles(float par1, float par2, float par3, float par4, float par5, float par6, Entity par7Entity) { ++ for (int var8 = 0; var8 < this.tentacles.length; ++var8) { ++ this.tentacles[var8].rotateAngleX = 0.2F * MathHelper.sin(par3 * 0.3F + (float)var8) + 0.4F; + } +- + } + +- public void render(Entity var1, float var2, float var3, float var4, float var5, float var6, float var7) { +- this.setRotationAngles(var2, var3, var4, var5, var6, var7, var1); ++ /** ++ * Sets the models various rotation angles then renders the model. ++ */ ++ public void render(Entity par1Entity, float par2, float par3, float par4, float par5, float par6, float par7) { ++ this.setRotationAngles(par2, par3, par4, par5, par6, par7, par1Entity); + GL11.glPushMatrix(); + GL11.glTranslatef(0.0F, 0.6F, 0.0F); +- this.body.render(var7); ++ this.body.render(par7); + ModelRenderer[] var8 = this.tentacles; + int var9 = var8.length; + +- for(int var10 = 0; var10 < var9; ++var10) { ++ for (int var10 = 0; var10 < var9; ++var10) { + ModelRenderer var11 = var8[var10]; +- var11.render(var7); ++ var11.render(par7); + } + + GL11.glPopMatrix(); diff --git a/patches/net/minecraft/src/ModelHorse.java.patch b/patches/net/minecraft/src/ModelHorse.java.patch new file mode 100644 index 0000000..9b4d087 --- /dev/null +++ b/patches/net/minecraft/src/ModelHorse.java.patch @@ -0,0 +1,375 @@ +--- net/minecraft/src/ModelHorse.java ++++ net/minecraft/src/ModelHorse.java +@@ -134,11 +134,11 @@ + this.field_110687_G = new ModelRenderer(this, 0, 34); + this.field_110687_G.addBox(-3.0F, 0.0F, 0.0F, 8, 8, 3); + this.field_110687_G.setRotationPoint(-7.5F, 3.0F, 10.0F); +- this.func_110682_a(this.field_110687_G, 0.0F, 1.570796F, 0.0F); ++ this.func_110682_a(this.field_110687_G, 0.0F, ((float)Math.PI / 2F), 0.0F); + this.field_110695_H = new ModelRenderer(this, 0, 47); + this.field_110695_H.addBox(-3.0F, 0.0F, 0.0F, 8, 8, 3); + this.field_110695_H.setRotationPoint(4.5F, 3.0F, 10.0F); +- this.func_110682_a(this.field_110695_H, 0.0F, 1.570796F, 0.0F); ++ this.func_110682_a(this.field_110695_H, 0.0F, ((float)Math.PI / 2F), 0.0F); + this.field_110696_I = new ModelRenderer(this, 80, 0); + this.field_110696_I.addBox(-5.0F, 0.0F, -3.0F, 10, 1, 8); + this.field_110696_I.setRotationPoint(0.0F, 2.0F, 2.0F); +@@ -184,8 +184,11 @@ + this.func_110682_a(this.field_110717_i, 0.5235988F, 0.0F, 0.0F); + } + +- public void render(Entity var1, float var2, float var3, float var4, float var5, float var6, float var7) { +- EntityHorse var8 = (EntityHorse)var1; ++ /** ++ * Sets the models various rotation angles then renders the model. ++ */ ++ public void render(Entity par1Entity, float par2, float par3, float par4, float par5, float par6, float par7) { ++ EntityHorse var8 = (EntityHorse)par1Entity; + int var9 = var8.getHorseType(); + float var10 = var8.getGrassEatingAmount(0.0F); + boolean var11 = var8.isAdultHorse(); +@@ -194,134 +197,146 @@ + boolean var14 = var9 == 1 || var9 == 2; + float var15 = var8.getHorseSize(); + boolean var16 = var8.riddenByEntity != null; +- if(var12) { +- this.field_110717_i.render(var7); +- this.field_110696_I.render(var7); +- this.field_110697_J.render(var7); +- this.field_110698_K.render(var7); +- this.field_110691_L.render(var7); +- this.field_110692_M.render(var7); +- this.field_110693_N.render(var7); +- this.field_110694_O.render(var7); +- this.field_110700_P.render(var7); +- this.field_110699_Q.render(var7); +- if(var16) { +- this.field_110702_R.render(var7); +- this.field_110701_S.render(var7); ++ ++ if (var12) { ++ this.field_110717_i.render(par7); ++ this.field_110696_I.render(par7); ++ this.field_110697_J.render(par7); ++ this.field_110698_K.render(par7); ++ this.field_110691_L.render(par7); ++ this.field_110692_M.render(par7); ++ this.field_110693_N.render(par7); ++ this.field_110694_O.render(par7); ++ this.field_110700_P.render(par7); ++ this.field_110699_Q.render(par7); ++ ++ if (var16) { ++ this.field_110702_R.render(par7); ++ this.field_110701_S.render(par7); + } + } + +- if(!var11) { ++ if (!var11) { + GL11.glPushMatrix(); + GL11.glScalef(var15, 0.5F + var15 * 0.5F, var15); + GL11.glTranslatef(0.0F, 0.95F * (1.0F - var15), 0.0F); + } + +- this.backLeftLeg.render(var7); +- this.backLeftShin.render(var7); +- this.backLeftHoof.render(var7); +- this.backRightLeg.render(var7); +- this.backRightShin.render(var7); +- this.backRightHoof.render(var7); +- this.frontRightLeg.render(var7); +- this.frontLeftShin.render(var7); +- this.frontLeftHoof.render(var7); +- this.field_110684_D.render(var7); +- this.frontRightShin.render(var7); +- this.frontRightHoof.render(var7); +- if(!var11) { ++ this.backLeftLeg.render(par7); ++ this.backLeftShin.render(par7); ++ this.backLeftHoof.render(par7); ++ this.backRightLeg.render(par7); ++ this.backRightShin.render(par7); ++ this.backRightHoof.render(par7); ++ this.frontRightLeg.render(par7); ++ this.frontLeftShin.render(par7); ++ this.frontLeftHoof.render(par7); ++ this.field_110684_D.render(par7); ++ this.frontRightShin.render(par7); ++ this.frontRightHoof.render(par7); ++ ++ if (!var11) { + GL11.glPopMatrix(); + GL11.glPushMatrix(); + GL11.glScalef(var15, var15, var15); + GL11.glTranslatef(0.0F, 1.35F * (1.0F - var15), 0.0F); + } + +- this.body.render(var7); +- this.tailBase.render(var7); +- this.tailMiddle.render(var7); +- this.tailTip.render(var7); +- this.neck.render(var7); +- this.mane.render(var7); +- if(!var11) { ++ this.body.render(par7); ++ this.tailBase.render(par7); ++ this.tailMiddle.render(par7); ++ this.tailTip.render(par7); ++ this.neck.render(par7); ++ this.mane.render(par7); ++ ++ if (!var11) { + GL11.glPopMatrix(); + GL11.glPushMatrix(); + float var17 = 0.5F + var15 * var15 * 0.5F; + GL11.glScalef(var17, var17, var17); +- if(var10 <= 0.0F) { ++ ++ if (var10 <= 0.0F) { + GL11.glTranslatef(0.0F, 1.35F * (1.0F - var15), 0.0F); + } else { + GL11.glTranslatef(0.0F, 0.9F * (1.0F - var15) * var10 + 1.35F * (1.0F - var15) * (1.0F - var10), 0.15F * (1.0F - var15) * var10); + } + } + +- if(var14) { +- this.field_110703_f.render(var7); +- this.field_110704_g.render(var7); ++ if (var14) { ++ this.field_110703_f.render(par7); ++ this.field_110704_g.render(par7); + } else { +- this.horseLeftEar.render(var7); +- this.horseRightEar.render(var7); ++ this.horseLeftEar.render(par7); ++ this.horseRightEar.render(par7); + } + +- this.head.render(var7); +- if(!var11) { ++ this.head.render(par7); ++ ++ if (!var11) { + GL11.glPopMatrix(); + } + +- if(var13) { +- this.field_110687_G.render(var7); +- this.field_110695_H.render(var7); ++ if (var13) { ++ this.field_110687_G.render(par7); ++ this.field_110695_H.render(par7); + } +- +- } +- +- private void func_110682_a(ModelRenderer var1, float var2, float var3, float var4) { +- var1.rotateAngleX = var2; +- var1.rotateAngleY = var3; +- var1.rotateAngleZ = var4; +- } +- +- private float func_110683_a(float var1, float var2, float var3) { ++ } ++ ++ private void func_110682_a(ModelRenderer par1ModelRenderer, float par2, float par3, float par4) { ++ par1ModelRenderer.rotateAngleX = par2; ++ par1ModelRenderer.rotateAngleY = par3; ++ par1ModelRenderer.rotateAngleZ = par4; ++ } ++ ++ private float func_110683_a(float par1, float par2, float par3) { + float var4; +- for(var4 = var2 - var1; var4 < -180.0F; var4 += 360.0F) { ++ ++ for (var4 = par2 - par1; var4 < -180.0F; var4 += 360.0F) { ++ ; + } + +- while(var4 >= 180.0F) { ++ while (var4 >= 180.0F) { + var4 -= 360.0F; + } + +- return var1 + var3 * var4; ++ return par1 + par3 * var4; + } + +- public void setLivingAnimations(EntityLivingBase var1, float var2, float var3, float var4) { +- super.setLivingAnimations(var1, var2, var3, var4); +- float var5 = this.func_110683_a(var1.prevRenderYawOffset, var1.renderYawOffset, var4); +- float var6 = this.func_110683_a(var1.prevRotationYawHead, var1.rotationYawHead, var4); +- float var7 = var1.prevRotationPitch + (var1.rotationPitch - var1.prevRotationPitch) * var4; ++ /** ++ * Used for easily adding entity-dependent animations. The second and third float params here are the same second and ++ * third as in the setRotationAngles method. ++ */ ++ public void setLivingAnimations(EntityLivingBase par1EntityLivingBase, float par2, float par3, float par4) { ++ super.setLivingAnimations(par1EntityLivingBase, par2, par3, par4); ++ float var5 = this.func_110683_a(par1EntityLivingBase.prevRenderYawOffset, par1EntityLivingBase.renderYawOffset, par4); ++ float var6 = this.func_110683_a(par1EntityLivingBase.prevRotationYawHead, par1EntityLivingBase.rotationYawHead, par4); ++ float var7 = par1EntityLivingBase.prevRotationPitch + (par1EntityLivingBase.rotationPitch - par1EntityLivingBase.prevRotationPitch) * par4; + float var8 = var6 - var5; +- float var9 = var7 / 57.29578F; +- if(var8 > 20.0F) { ++ float var9 = var7 / (180F / (float)Math.PI); ++ ++ if (var8 > 20.0F) { + var8 = 20.0F; + } + +- if(var8 < -20.0F) { ++ if (var8 < -20.0F) { + var8 = -20.0F; + } + +- if(var3 > 0.2F) { +- var9 += MathHelper.cos(var2 * 0.4F) * 0.15F * var3; ++ if (par3 > 0.2F) { ++ var9 += MathHelper.cos(par2 * 0.4F) * 0.15F * par3; + } + +- EntityHorse var10 = (EntityHorse)var1; +- float var11 = var10.getGrassEatingAmount(var4); +- float var12 = var10.getRearingAmount(var4); ++ EntityHorse var10 = (EntityHorse)par1EntityLivingBase; ++ float var11 = var10.getGrassEatingAmount(par4); ++ float var12 = var10.getRearingAmount(par4); + float var13 = 1.0F - var12; +- float var14 = var10.func_110201_q(var4); ++ float var14 = var10.func_110201_q(par4); + boolean var15 = var10.field_110278_bp != 0; + boolean var16 = var10.isHorseSaddled(); + boolean var17 = var10.riddenByEntity != null; +- float var18 = (float)var1.ticksExisted + var4; +- float var19 = MathHelper.cos(var2 * 0.6662F + 3.141593F); +- float var20 = var19 * 0.8F * var3; ++ float var18 = (float)par1EntityLivingBase.ticksExisted + par4; ++ float var19 = MathHelper.cos(par2 * 0.6662F + (float)Math.PI); ++ float var20 = var19 * 0.8F * par3; + this.head.rotationPointY = 4.0F; + this.head.rotationPointZ = -10.0F; + this.tailBase.rotationPointY = 3.0F; +@@ -330,16 +345,16 @@ + this.field_110695_H.rotationPointZ = 10.0F; + this.body.rotateAngleX = 0.0F; + this.head.rotateAngleX = 0.5235988F + var9; +- this.head.rotateAngleY = var8 / 57.29578F; ++ this.head.rotateAngleY = var8 / (180F / (float)Math.PI); + this.head.rotateAngleX = var12 * (0.2617994F + var9) + var11 * 2.18166F + (1.0F - Math.max(var12, var11)) * this.head.rotateAngleX; +- this.head.rotateAngleY = var12 * (var8 / 57.29578F) + (1.0F - Math.max(var12, var11)) * this.head.rotateAngleY; ++ this.head.rotateAngleY = var12 * (var8 / (180F / (float)Math.PI)) + (1.0F - Math.max(var12, var11)) * this.head.rotateAngleY; + this.head.rotationPointY = var12 * -6.0F + var11 * 11.0F + (1.0F - Math.max(var12, var11)) * this.head.rotationPointY; + this.head.rotationPointZ = var12 * -1.0F + var11 * -10.0F + (1.0F - Math.max(var12, var11)) * this.head.rotationPointZ; + this.tailBase.rotationPointY = var12 * 9.0F + var13 * this.tailBase.rotationPointY; + this.tailMiddle.rotationPointZ = var12 * 18.0F + var13 * this.tailMiddle.rotationPointZ; + this.field_110695_H.rotationPointY = var12 * 5.5F + var13 * this.field_110695_H.rotationPointY; + this.field_110695_H.rotationPointZ = var12 * 15.0F + var13 * this.field_110695_H.rotationPointZ; +- this.body.rotateAngleX = var12 * -0.7853981F + var13 * this.body.rotateAngleX; ++ this.body.rotateAngleX = var12 * -((float)Math.PI / 4F) + var13 * this.body.rotateAngleX; + this.horseLeftEar.rotationPointY = this.head.rotationPointY; + this.horseRightEar.rotationPointY = this.head.rotationPointY; + this.field_110703_f.rotationPointY = this.head.rotationPointY; +@@ -361,8 +376,8 @@ + this.field_110703_f.rotateAngleX = this.head.rotateAngleX; + this.field_110704_g.rotateAngleX = this.head.rotateAngleX; + this.neck.rotateAngleX = this.head.rotateAngleX; +- this.mouthTop.rotateAngleX = 0.0F - (float)Math.PI * 0.03F * var14; +- this.mouthBottom.rotateAngleX = 0.0F + (float)Math.PI * 0.05F * var14; ++ this.mouthTop.rotateAngleX = 0.0F - 0.09424778F * var14; ++ this.mouthBottom.rotateAngleX = 0.0F + 0.15707964F * var14; + this.mane.rotateAngleX = this.head.rotateAngleX; + this.horseLeftEar.rotateAngleY = this.head.rotateAngleY; + this.horseRightEar.rotateAngleY = this.head.rotateAngleY; +@@ -374,36 +389,36 @@ + this.mane.rotateAngleY = this.head.rotateAngleY; + this.field_110687_G.rotateAngleX = var20 / 5.0F; + this.field_110695_H.rotateAngleX = -var20 / 5.0F; +- float var21 = (float)Math.PI * 0.5F; +- float var22 = (float)Math.PI * 3.0F / 2.0F; ++ float var21 = ((float)Math.PI / 2F); ++ float var22 = ((float)Math.PI * 3F / 2F); + float var23 = -1.0471976F; + float var24 = 0.2617994F * var12; +- float var25 = MathHelper.cos(var18 * 0.6F + 3.141593F); ++ float var25 = MathHelper.cos(var18 * 0.6F + (float)Math.PI); + this.frontRightLeg.rotationPointY = -2.0F * var12 + 9.0F * var13; + this.frontRightLeg.rotationPointZ = -2.0F * var12 + -8.0F * var13; + this.field_110684_D.rotationPointY = this.frontRightLeg.rotationPointY; + this.field_110684_D.rotationPointZ = this.frontRightLeg.rotationPointZ; +- this.backLeftShin.rotationPointY = this.backLeftLeg.rotationPointY + MathHelper.sin((float)Math.PI * 0.5F + var24 + var13 * -var19 * 0.5F * var3) * 7.0F; +- this.backLeftShin.rotationPointZ = this.backLeftLeg.rotationPointZ + MathHelper.cos((float)Math.PI * 3.0F / 2.0F + var24 + var13 * -var19 * 0.5F * var3) * 7.0F; +- this.backRightShin.rotationPointY = this.backRightLeg.rotationPointY + MathHelper.sin((float)Math.PI * 0.5F + var24 + var13 * var19 * 0.5F * var3) * 7.0F; +- this.backRightShin.rotationPointZ = this.backRightLeg.rotationPointZ + MathHelper.cos((float)Math.PI * 3.0F / 2.0F + var24 + var13 * var19 * 0.5F * var3) * 7.0F; ++ this.backLeftShin.rotationPointY = this.backLeftLeg.rotationPointY + MathHelper.sin(((float)Math.PI / 2F) + var24 + var13 * -var19 * 0.5F * par3) * 7.0F; ++ this.backLeftShin.rotationPointZ = this.backLeftLeg.rotationPointZ + MathHelper.cos(((float)Math.PI * 3F / 2F) + var24 + var13 * -var19 * 0.5F * par3) * 7.0F; ++ this.backRightShin.rotationPointY = this.backRightLeg.rotationPointY + MathHelper.sin(((float)Math.PI / 2F) + var24 + var13 * var19 * 0.5F * par3) * 7.0F; ++ this.backRightShin.rotationPointZ = this.backRightLeg.rotationPointZ + MathHelper.cos(((float)Math.PI * 3F / 2F) + var24 + var13 * var19 * 0.5F * par3) * 7.0F; + float var26 = (-1.0471976F + var25) * var12 + var20 * var13; + float var27 = (-1.0471976F + -var25) * var12 + -var20 * var13; +- this.frontLeftShin.rotationPointY = this.frontRightLeg.rotationPointY + MathHelper.sin((float)Math.PI * 0.5F + var26) * 7.0F; +- this.frontLeftShin.rotationPointZ = this.frontRightLeg.rotationPointZ + MathHelper.cos((float)Math.PI * 3.0F / 2.0F + var26) * 7.0F; +- this.frontRightShin.rotationPointY = this.field_110684_D.rotationPointY + MathHelper.sin((float)Math.PI * 0.5F + var27) * 7.0F; +- this.frontRightShin.rotationPointZ = this.field_110684_D.rotationPointZ + MathHelper.cos((float)Math.PI * 3.0F / 2.0F + var27) * 7.0F; +- this.backLeftLeg.rotateAngleX = var24 + -var19 * 0.5F * var3 * var13; +- this.backLeftShin.rotateAngleX = -0.08726646F * var12 + (-var19 * 0.5F * var3 - Math.max(0.0F, var19 * 0.5F * var3)) * var13; ++ this.frontLeftShin.rotationPointY = this.frontRightLeg.rotationPointY + MathHelper.sin(((float)Math.PI / 2F) + var26) * 7.0F; ++ this.frontLeftShin.rotationPointZ = this.frontRightLeg.rotationPointZ + MathHelper.cos(((float)Math.PI * 3F / 2F) + var26) * 7.0F; ++ this.frontRightShin.rotationPointY = this.field_110684_D.rotationPointY + MathHelper.sin(((float)Math.PI / 2F) + var27) * 7.0F; ++ this.frontRightShin.rotationPointZ = this.field_110684_D.rotationPointZ + MathHelper.cos(((float)Math.PI * 3F / 2F) + var27) * 7.0F; ++ this.backLeftLeg.rotateAngleX = var24 + -var19 * 0.5F * par3 * var13; ++ this.backLeftShin.rotateAngleX = -0.08726646F * var12 + (-var19 * 0.5F * par3 - Math.max(0.0F, var19 * 0.5F * par3)) * var13; + this.backLeftHoof.rotateAngleX = this.backLeftShin.rotateAngleX; +- this.backRightLeg.rotateAngleX = var24 + var19 * 0.5F * var3 * var13; +- this.backRightShin.rotateAngleX = -0.08726646F * var12 + (var19 * 0.5F * var3 - Math.max(0.0F, -var19 * 0.5F * var3)) * var13; ++ this.backRightLeg.rotateAngleX = var24 + var19 * 0.5F * par3 * var13; ++ this.backRightShin.rotateAngleX = -0.08726646F * var12 + (var19 * 0.5F * par3 - Math.max(0.0F, -var19 * 0.5F * par3)) * var13; + this.backRightHoof.rotateAngleX = this.backRightShin.rotateAngleX; + this.frontRightLeg.rotateAngleX = var26; +- this.frontLeftShin.rotateAngleX = (this.frontRightLeg.rotateAngleX + (float)Math.PI * Math.max(0.0F, 0.2F + var25 * 0.2F)) * var12 + (var20 + Math.max(0.0F, var19 * 0.5F * var3)) * var13; ++ this.frontLeftShin.rotateAngleX = (this.frontRightLeg.rotateAngleX + (float)Math.PI * Math.max(0.0F, 0.2F + var25 * 0.2F)) * var12 + (var20 + Math.max(0.0F, var19 * 0.5F * par3)) * var13; + this.frontLeftHoof.rotateAngleX = this.frontLeftShin.rotateAngleX; + this.field_110684_D.rotateAngleX = var27; +- this.frontRightShin.rotateAngleX = (this.field_110684_D.rotateAngleX + (float)Math.PI * Math.max(0.0F, 0.2F - var25 * 0.2F)) * var12 + (-var20 + Math.max(0.0F, -var19 * 0.5F * var3)) * var13; ++ this.frontRightShin.rotateAngleX = (this.field_110684_D.rotateAngleX + (float)Math.PI * Math.max(0.0F, 0.2F - var25 * 0.2F)) * var12 + (-var20 + Math.max(0.0F, -var19 * 0.5F * par3)) * var13; + this.frontRightHoof.rotateAngleX = this.frontRightShin.rotateAngleX; + this.backLeftHoof.rotationPointY = this.backLeftShin.rotationPointY; + this.backLeftHoof.rotationPointZ = this.backLeftShin.rotationPointZ; +@@ -413,7 +428,8 @@ + this.frontLeftHoof.rotationPointZ = this.frontLeftShin.rotationPointZ; + this.frontRightHoof.rotationPointY = this.frontRightShin.rotationPointY; + this.frontRightHoof.rotationPointZ = this.frontRightShin.rotationPointZ; +- if(var16) { ++ ++ if (var16) { + this.field_110696_I.rotationPointY = var12 * 0.5F + var13 * 2.0F; + this.field_110696_I.rotationPointZ = var12 * 11.0F + var13 * 2.0F; + this.field_110697_J.rotationPointY = this.field_110696_I.rotationPointY; +@@ -453,7 +469,8 @@ + this.field_110702_R.rotateAngleY = this.head.rotateAngleY; + this.field_110699_Q.rotateAngleY = this.head.rotateAngleY; + this.field_110701_S.rotateAngleY = this.head.rotateAngleY; +- if(var17) { ++ ++ if (var17) { + this.field_110691_L.rotateAngleX = -1.0471976F; + this.field_110692_M.rotateAngleX = -1.0471976F; + this.field_110693_N.rotateAngleX = -1.0471976F; +@@ -474,12 +491,13 @@ + } + } + +- var21 = -1.3089F + var3 * 1.5F; +- if(var21 > 0.0F) { ++ var21 = -1.3089F + par3 * 1.5F; ++ ++ if (var21 > 0.0F) { + var21 = 0.0F; + } + +- if(var15) { ++ if (var15) { + this.tailBase.rotateAngleY = MathHelper.cos(var18 * 0.7F); + var21 = 0.0F; + } else { diff --git a/patches/net/minecraft/src/ModelIronGolem.java.patch b/patches/net/minecraft/src/ModelIronGolem.java.patch new file mode 100644 index 0000000..c1eab94 --- /dev/null +++ b/patches/net/minecraft/src/ModelIronGolem.java.patch @@ -0,0 +1,157 @@ +--- net/minecraft/src/ModelIronGolem.java ++++ net/minecraft/src/ModelIronGolem.java +@@ -1,86 +1,111 @@ + package net.minecraft.src; + + public class ModelIronGolem extends ModelBase { ++ ++ /** The head model for the iron golem. */ + public ModelRenderer ironGolemHead; ++ ++ /** The body model for the iron golem. */ + public ModelRenderer ironGolemBody; ++ ++ /** The right arm model for the iron golem. */ + public ModelRenderer ironGolemRightArm; ++ ++ /** The left arm model for the iron golem. */ + public ModelRenderer ironGolemLeftArm; ++ ++ /** The left leg model for the Iron Golem. */ + public ModelRenderer ironGolemLeftLeg; ++ ++ /** The right leg model for the Iron Golem. */ + public ModelRenderer ironGolemRightLeg; + + public ModelIronGolem() { + this(0.0F); + } + +- public ModelIronGolem(float var1) { +- this(var1, -7.0F); ++ public ModelIronGolem(float par1) { ++ this(par1, -7.0F); + } + +- public ModelIronGolem(float var1, float var2) { ++ public ModelIronGolem(float par1, float par2) { + short var3 = 128; + short var4 = 128; + this.ironGolemHead = (new ModelRenderer(this)).setTextureSize(var3, var4); +- this.ironGolemHead.setRotationPoint(0.0F, 0.0F + var2, -2.0F); +- this.ironGolemHead.setTextureOffset(0, 0).addBox(-4.0F, -12.0F, -5.5F, 8, 10, 8, var1); +- this.ironGolemHead.setTextureOffset(24, 0).addBox(-1.0F, -5.0F, -7.5F, 2, 4, 2, var1); ++ this.ironGolemHead.setRotationPoint(0.0F, 0.0F + par2, -2.0F); ++ this.ironGolemHead.setTextureOffset(0, 0).addBox(-4.0F, -12.0F, -5.5F, 8, 10, 8, par1); ++ this.ironGolemHead.setTextureOffset(24, 0).addBox(-1.0F, -5.0F, -7.5F, 2, 4, 2, par1); + this.ironGolemBody = (new ModelRenderer(this)).setTextureSize(var3, var4); +- this.ironGolemBody.setRotationPoint(0.0F, 0.0F + var2, 0.0F); +- this.ironGolemBody.setTextureOffset(0, 40).addBox(-9.0F, -2.0F, -6.0F, 18, 12, 11, var1); +- this.ironGolemBody.setTextureOffset(0, 70).addBox(-4.5F, 10.0F, -3.0F, 9, 5, 6, var1 + 0.5F); ++ this.ironGolemBody.setRotationPoint(0.0F, 0.0F + par2, 0.0F); ++ this.ironGolemBody.setTextureOffset(0, 40).addBox(-9.0F, -2.0F, -6.0F, 18, 12, 11, par1); ++ this.ironGolemBody.setTextureOffset(0, 70).addBox(-4.5F, 10.0F, -3.0F, 9, 5, 6, par1 + 0.5F); + this.ironGolemRightArm = (new ModelRenderer(this)).setTextureSize(var3, var4); + this.ironGolemRightArm.setRotationPoint(0.0F, -7.0F, 0.0F); +- this.ironGolemRightArm.setTextureOffset(60, 21).addBox(-13.0F, -2.5F, -3.0F, 4, 30, 6, var1); ++ this.ironGolemRightArm.setTextureOffset(60, 21).addBox(-13.0F, -2.5F, -3.0F, 4, 30, 6, par1); + this.ironGolemLeftArm = (new ModelRenderer(this)).setTextureSize(var3, var4); + this.ironGolemLeftArm.setRotationPoint(0.0F, -7.0F, 0.0F); +- this.ironGolemLeftArm.setTextureOffset(60, 58).addBox(9.0F, -2.5F, -3.0F, 4, 30, 6, var1); ++ this.ironGolemLeftArm.setTextureOffset(60, 58).addBox(9.0F, -2.5F, -3.0F, 4, 30, 6, par1); + this.ironGolemLeftLeg = (new ModelRenderer(this, 0, 22)).setTextureSize(var3, var4); +- this.ironGolemLeftLeg.setRotationPoint(-4.0F, 18.0F + var2, 0.0F); +- this.ironGolemLeftLeg.setTextureOffset(37, 0).addBox(-3.5F, -3.0F, -3.0F, 6, 16, 5, var1); ++ this.ironGolemLeftLeg.setRotationPoint(-4.0F, 18.0F + par2, 0.0F); ++ this.ironGolemLeftLeg.setTextureOffset(37, 0).addBox(-3.5F, -3.0F, -3.0F, 6, 16, 5, par1); + this.ironGolemRightLeg = (new ModelRenderer(this, 0, 22)).setTextureSize(var3, var4); + this.ironGolemRightLeg.mirror = true; +- this.ironGolemRightLeg.setTextureOffset(60, 0).setRotationPoint(5.0F, 18.0F + var2, 0.0F); +- this.ironGolemRightLeg.addBox(-3.5F, -3.0F, -3.0F, 6, 16, 5, var1); +- } +- +- public void render(Entity var1, float var2, float var3, float var4, float var5, float var6, float var7) { +- this.setRotationAngles(var2, var3, var4, var5, var6, var7, var1); +- this.ironGolemHead.render(var7); +- this.ironGolemBody.render(var7); +- this.ironGolemLeftLeg.render(var7); +- this.ironGolemRightLeg.render(var7); +- this.ironGolemRightArm.render(var7); +- this.ironGolemLeftArm.render(var7); +- } +- +- public void setRotationAngles(float var1, float var2, float var3, float var4, float var5, float var6, Entity var7) { +- this.ironGolemHead.rotateAngleY = var4 / (180.0F / (float)Math.PI); +- this.ironGolemHead.rotateAngleX = var5 / (180.0F / (float)Math.PI); +- this.ironGolemLeftLeg.rotateAngleX = -1.5F * this.func_78172_a(var1, 13.0F) * var2; +- this.ironGolemRightLeg.rotateAngleX = 1.5F * this.func_78172_a(var1, 13.0F) * var2; ++ this.ironGolemRightLeg.setTextureOffset(60, 0).setRotationPoint(5.0F, 18.0F + par2, 0.0F); ++ this.ironGolemRightLeg.addBox(-3.5F, -3.0F, -3.0F, 6, 16, 5, par1); ++ } ++ ++ /** ++ * Sets the models various rotation angles then renders the model. ++ */ ++ public void render(Entity par1Entity, float par2, float par3, float par4, float par5, float par6, float par7) { ++ this.setRotationAngles(par2, par3, par4, par5, par6, par7, par1Entity); ++ this.ironGolemHead.render(par7); ++ this.ironGolemBody.render(par7); ++ this.ironGolemLeftLeg.render(par7); ++ this.ironGolemRightLeg.render(par7); ++ this.ironGolemRightArm.render(par7); ++ this.ironGolemLeftArm.render(par7); ++ } ++ ++ /** ++ * Sets the model's various rotation angles. For bipeds, par1 and par2 are used for animating the movement of arms and ++ * legs, where par1 represents the time(so that arms and legs swing back and forth) and par2 represents how "far" arms ++ * and legs can swing at most. ++ */ ++ public void setRotationAngles(float par1, float par2, float par3, float par4, float par5, float par6, Entity par7Entity) { ++ this.ironGolemHead.rotateAngleY = par4 / (180F / (float)Math.PI); ++ this.ironGolemHead.rotateAngleX = par5 / (180F / (float)Math.PI); ++ this.ironGolemLeftLeg.rotateAngleX = -1.5F * this.func_78172_a(par1, 13.0F) * par2; ++ this.ironGolemRightLeg.rotateAngleX = 1.5F * this.func_78172_a(par1, 13.0F) * par2; + this.ironGolemLeftLeg.rotateAngleY = 0.0F; + this.ironGolemRightLeg.rotateAngleY = 0.0F; + } + +- public void setLivingAnimations(EntityLivingBase var1, float var2, float var3, float var4) { +- EntityIronGolem var5 = (EntityIronGolem)var1; ++ /** ++ * Used for easily adding entity-dependent animations. The second and third float params here are the same second and ++ * third as in the setRotationAngles method. ++ */ ++ public void setLivingAnimations(EntityLivingBase par1EntityLivingBase, float par2, float par3, float par4) { ++ EntityIronGolem var5 = (EntityIronGolem)par1EntityLivingBase; + int var6 = var5.getAttackTimer(); +- if(var6 > 0) { +- this.ironGolemRightArm.rotateAngleX = -2.0F + 1.5F * this.func_78172_a((float)var6 - var4, 10.0F); +- this.ironGolemLeftArm.rotateAngleX = -2.0F + 1.5F * this.func_78172_a((float)var6 - var4, 10.0F); ++ ++ if (var6 > 0) { ++ this.ironGolemRightArm.rotateAngleX = -2.0F + 1.5F * this.func_78172_a((float)var6 - par4, 10.0F); ++ this.ironGolemLeftArm.rotateAngleX = -2.0F + 1.5F * this.func_78172_a((float)var6 - par4, 10.0F); + } else { + int var7 = var5.getHoldRoseTick(); +- if(var7 > 0) { ++ ++ if (var7 > 0) { + this.ironGolemRightArm.rotateAngleX = -0.8F + 0.025F * this.func_78172_a((float)var7, 70.0F); + this.ironGolemLeftArm.rotateAngleX = 0.0F; + } else { +- this.ironGolemRightArm.rotateAngleX = (-0.2F + 1.5F * this.func_78172_a(var2, 13.0F)) * var3; +- this.ironGolemLeftArm.rotateAngleX = (-0.2F - 1.5F * this.func_78172_a(var2, 13.0F)) * var3; ++ this.ironGolemRightArm.rotateAngleX = (-0.2F + 1.5F * this.func_78172_a(par2, 13.0F)) * par3; ++ this.ironGolemLeftArm.rotateAngleX = (-0.2F - 1.5F * this.func_78172_a(par2, 13.0F)) * par3; + } + } +- + } + +- private float func_78172_a(float var1, float var2) { +- return (Math.abs(var1 % var2 - var2 * 0.5F) - var2 * 0.25F) / (var2 * 0.25F); ++ private float func_78172_a(float par1, float par2) { ++ return (Math.abs(par1 % par2 - par2 * 0.5F) - par2 * 0.25F) / (par2 * 0.25F); + } + } diff --git a/patches/net/minecraft/src/ModelLeashKnot.java.patch b/patches/net/minecraft/src/ModelLeashKnot.java.patch new file mode 100644 index 0000000..67bc7e9 --- /dev/null +++ b/patches/net/minecraft/src/ModelLeashKnot.java.patch @@ -0,0 +1,44 @@ +--- net/minecraft/src/ModelLeashKnot.java ++++ net/minecraft/src/ModelLeashKnot.java +@@ -7,22 +7,30 @@ + this(0, 0, 32, 32); + } + +- public ModelLeashKnot(int var1, int var2, int var3, int var4) { +- this.textureWidth = var3; +- this.textureHeight = var4; +- this.field_110723_a = new ModelRenderer(this, var1, var2); ++ public ModelLeashKnot(int par1, int par2, int par3, int par4) { ++ this.textureWidth = par3; ++ this.textureHeight = par4; ++ this.field_110723_a = new ModelRenderer(this, par1, par2); + this.field_110723_a.addBox(-3.0F, -6.0F, -3.0F, 6, 8, 6, 0.0F); + this.field_110723_a.setRotationPoint(0.0F, 0.0F, 0.0F); + } + +- public void render(Entity var1, float var2, float var3, float var4, float var5, float var6, float var7) { +- this.setRotationAngles(var2, var3, var4, var5, var6, var7, var1); +- this.field_110723_a.render(var7); ++ /** ++ * Sets the models various rotation angles then renders the model. ++ */ ++ public void render(Entity par1Entity, float par2, float par3, float par4, float par5, float par6, float par7) { ++ this.setRotationAngles(par2, par3, par4, par5, par6, par7, par1Entity); ++ this.field_110723_a.render(par7); + } + +- public void setRotationAngles(float var1, float var2, float var3, float var4, float var5, float var6, Entity var7) { +- super.setRotationAngles(var1, var2, var3, var4, var5, var6, var7); +- this.field_110723_a.rotateAngleY = var4 / (180.0F / (float)Math.PI); +- this.field_110723_a.rotateAngleX = var5 / (180.0F / (float)Math.PI); ++ /** ++ * Sets the model's various rotation angles. For bipeds, par1 and par2 are used for animating the movement of arms and ++ * legs, where par1 represents the time(so that arms and legs swing back and forth) and par2 represents how "far" arms ++ * and legs can swing at most. ++ */ ++ public void setRotationAngles(float par1, float par2, float par3, float par4, float par5, float par6, Entity par7Entity) { ++ super.setRotationAngles(par1, par2, par3, par4, par5, par6, par7Entity); ++ this.field_110723_a.rotateAngleY = par4 / (180F / (float)Math.PI); ++ this.field_110723_a.rotateAngleX = par5 / (180F / (float)Math.PI); + } + } diff --git a/patches/net/minecraft/src/ModelMagmaCube.java.patch b/patches/net/minecraft/src/ModelMagmaCube.java.patch new file mode 100644 index 0000000..6031147 --- /dev/null +++ b/patches/net/minecraft/src/ModelMagmaCube.java.patch @@ -0,0 +1,65 @@ +--- net/minecraft/src/ModelMagmaCube.java ++++ net/minecraft/src/ModelMagmaCube.java +@@ -5,13 +5,14 @@ + ModelRenderer field_78108_b; + + public ModelMagmaCube() { +- for(int var1 = 0; var1 < this.field_78109_a.length; ++var1) { ++ for (int var1 = 0; var1 < this.field_78109_a.length; ++var1) { + byte var2 = 0; + int var3 = var1; +- if(var1 == 2) { ++ ++ if (var1 == 2) { + var2 = 24; + var3 = 10; +- } else if(var1 == 3) { ++ } else if (var1 == 3) { + var2 = 24; + var3 = 19; + } +@@ -24,26 +25,32 @@ + this.field_78108_b.addBox(-2.0F, 18.0F, -2.0F, 4, 4, 4); + } + +- public void setLivingAnimations(EntityLivingBase var1, float var2, float var3, float var4) { +- EntityMagmaCube var5 = (EntityMagmaCube)var1; +- float var6 = var5.prevSquishFactor + (var5.squishFactor - var5.prevSquishFactor) * var4; +- if(var6 < 0.0F) { ++ /** ++ * Used for easily adding entity-dependent animations. The second and third float params here are the same second and ++ * third as in the setRotationAngles method. ++ */ ++ public void setLivingAnimations(EntityLivingBase par1EntityLivingBase, float par2, float par3, float par4) { ++ EntityMagmaCube var5 = (EntityMagmaCube)par1EntityLivingBase; ++ float var6 = var5.prevSquishFactor + (var5.squishFactor - var5.prevSquishFactor) * par4; ++ ++ if (var6 < 0.0F) { + var6 = 0.0F; + } + +- for(int var7 = 0; var7 < this.field_78109_a.length; ++var7) { ++ for (int var7 = 0; var7 < this.field_78109_a.length; ++var7) { + this.field_78109_a[var7].rotationPointY = (float)(-(4 - var7)) * var6 * 1.7F; + } +- + } + +- public void render(Entity var1, float var2, float var3, float var4, float var5, float var6, float var7) { +- this.setRotationAngles(var2, var3, var4, var5, var6, var7, var1); +- this.field_78108_b.render(var7); ++ /** ++ * Sets the models various rotation angles then renders the model. ++ */ ++ public void render(Entity par1Entity, float par2, float par3, float par4, float par5, float par6, float par7) { ++ this.setRotationAngles(par2, par3, par4, par5, par6, par7, par1Entity); ++ this.field_78108_b.render(par7); + +- for(int var8 = 0; var8 < this.field_78109_a.length; ++var8) { +- this.field_78109_a[var8].render(var7); ++ for (int var8 = 0; var8 < this.field_78109_a.length; ++var8) { ++ this.field_78109_a[var8].render(par7); + } +- + } + } diff --git a/patches/net/minecraft/src/ModelMinecart.java.patch b/patches/net/minecraft/src/ModelMinecart.java.patch new file mode 100644 index 0000000..311a9cb --- /dev/null +++ b/patches/net/minecraft/src/ModelMinecart.java.patch @@ -0,0 +1,33 @@ +--- net/minecraft/src/ModelMinecart.java ++++ net/minecraft/src/ModelMinecart.java +@@ -26,19 +26,21 @@ + this.sideModels[3].setRotationPoint(0.0F, (float)var4, (float)(-var3 / 2 + 1)); + this.sideModels[4].addBox((float)(-var1 / 2 + 2), (float)(-var2 - 1), -1.0F, var1 - 4, var2, 2, 0.0F); + this.sideModels[4].setRotationPoint(0.0F, (float)var4, (float)(var3 / 2 - 1)); +- this.sideModels[0].rotateAngleX = (float)Math.PI * 0.5F; +- this.sideModels[1].rotateAngleY = (float)Math.PI * 3.0F / 2.0F; +- this.sideModels[2].rotateAngleY = (float)Math.PI * 0.5F; ++ this.sideModels[0].rotateAngleX = ((float)Math.PI / 2F); ++ this.sideModels[1].rotateAngleY = ((float)Math.PI * 3F / 2F); ++ this.sideModels[2].rotateAngleY = ((float)Math.PI / 2F); + this.sideModels[3].rotateAngleY = (float)Math.PI; +- this.sideModels[5].rotateAngleX = (float)Math.PI * -0.5F; ++ this.sideModels[5].rotateAngleX = -((float)Math.PI / 2F); + } + +- public void render(Entity var1, float var2, float var3, float var4, float var5, float var6, float var7) { +- this.sideModels[5].rotationPointY = 4.0F - var4; ++ /** ++ * Sets the models various rotation angles then renders the model. ++ */ ++ public void render(Entity par1Entity, float par2, float par3, float par4, float par5, float par6, float par7) { ++ this.sideModels[5].rotationPointY = 4.0F - par4; + +- for(int var8 = 0; var8 < 6; ++var8) { +- this.sideModels[var8].render(var7); ++ for (int var8 = 0; var8 < 6; ++var8) { ++ this.sideModels[var8].render(par7); + } +- + } + } diff --git a/patches/net/minecraft/src/ModelOcelot.java.patch b/patches/net/minecraft/src/ModelOcelot.java.patch new file mode 100644 index 0000000..d3f2d47 --- /dev/null +++ b/patches/net/minecraft/src/ModelOcelot.java.patch @@ -0,0 +1,213 @@ +--- net/minecraft/src/ModelOcelot.java ++++ net/minecraft/src/ModelOcelot.java +@@ -3,13 +3,29 @@ + import org.lwjgl.opengl.GL11; + + public class ModelOcelot extends ModelBase { ++ ++ /** The back left leg model for the Ocelot. */ + ModelRenderer ocelotBackLeftLeg; ++ ++ /** The back right leg model for the Ocelot. */ + ModelRenderer ocelotBackRightLeg; ++ ++ /** The front left leg model for the Ocelot. */ + ModelRenderer ocelotFrontLeftLeg; ++ ++ /** The front right leg model for the Ocelot. */ + ModelRenderer ocelotFrontRightLeg; ++ ++ /** The tail model for the Ocelot. */ + ModelRenderer ocelotTail; ++ ++ /** The second part of tail model for the Ocelot. */ + ModelRenderer ocelotTail2; ++ ++ /** The head model for the Ocelot. */ + ModelRenderer ocelotHead; ++ ++ /** The body model for the Ocelot. */ + ModelRenderer ocelotBody; + int field_78163_i = 1; + +@@ -48,67 +64,81 @@ + this.ocelotFrontRightLeg.setRotationPoint(-1.2F, 13.8F, -5.0F); + } + +- public void render(Entity var1, float var2, float var3, float var4, float var5, float var6, float var7) { +- this.setRotationAngles(var2, var3, var4, var5, var6, var7, var1); +- if(this.isChild) { ++ /** ++ * Sets the models various rotation angles then renders the model. ++ */ ++ public void render(Entity par1Entity, float par2, float par3, float par4, float par5, float par6, float par7) { ++ this.setRotationAngles(par2, par3, par4, par5, par6, par7, par1Entity); ++ ++ if (this.isChild) { + float var8 = 2.0F; + GL11.glPushMatrix(); + GL11.glScalef(1.5F / var8, 1.5F / var8, 1.5F / var8); +- GL11.glTranslatef(0.0F, 10.0F * var7, 4.0F * var7); +- this.ocelotHead.render(var7); ++ GL11.glTranslatef(0.0F, 10.0F * par7, 4.0F * par7); ++ this.ocelotHead.render(par7); + GL11.glPopMatrix(); + GL11.glPushMatrix(); + GL11.glScalef(1.0F / var8, 1.0F / var8, 1.0F / var8); +- GL11.glTranslatef(0.0F, 24.0F * var7, 0.0F); +- this.ocelotBody.render(var7); +- this.ocelotBackLeftLeg.render(var7); +- this.ocelotBackRightLeg.render(var7); +- this.ocelotFrontLeftLeg.render(var7); +- this.ocelotFrontRightLeg.render(var7); +- this.ocelotTail.render(var7); +- this.ocelotTail2.render(var7); ++ GL11.glTranslatef(0.0F, 24.0F * par7, 0.0F); ++ this.ocelotBody.render(par7); ++ this.ocelotBackLeftLeg.render(par7); ++ this.ocelotBackRightLeg.render(par7); ++ this.ocelotFrontLeftLeg.render(par7); ++ this.ocelotFrontRightLeg.render(par7); ++ this.ocelotTail.render(par7); ++ this.ocelotTail2.render(par7); + GL11.glPopMatrix(); + } else { +- this.ocelotHead.render(var7); +- this.ocelotBody.render(var7); +- this.ocelotTail.render(var7); +- this.ocelotTail2.render(var7); +- this.ocelotBackLeftLeg.render(var7); +- this.ocelotBackRightLeg.render(var7); +- this.ocelotFrontLeftLeg.render(var7); +- this.ocelotFrontRightLeg.render(var7); ++ this.ocelotHead.render(par7); ++ this.ocelotBody.render(par7); ++ this.ocelotTail.render(par7); ++ this.ocelotTail2.render(par7); ++ this.ocelotBackLeftLeg.render(par7); ++ this.ocelotBackRightLeg.render(par7); ++ this.ocelotFrontLeftLeg.render(par7); ++ this.ocelotFrontRightLeg.render(par7); + } +- + } + +- public void setRotationAngles(float var1, float var2, float var3, float var4, float var5, float var6, Entity var7) { +- this.ocelotHead.rotateAngleX = var5 / (180.0F / (float)Math.PI); +- this.ocelotHead.rotateAngleY = var4 / (180.0F / (float)Math.PI); +- if(this.field_78163_i != 3) { +- this.ocelotBody.rotateAngleX = (float)Math.PI * 0.5F; +- if(this.field_78163_i == 2) { +- this.ocelotBackLeftLeg.rotateAngleX = MathHelper.cos(var1 * 0.6662F) * 1.0F * var2; +- this.ocelotBackRightLeg.rotateAngleX = MathHelper.cos(var1 * 0.6662F + 0.3F) * 1.0F * var2; +- this.ocelotFrontLeftLeg.rotateAngleX = MathHelper.cos(var1 * 0.6662F + (float)Math.PI + 0.3F) * 1.0F * var2; +- this.ocelotFrontRightLeg.rotateAngleX = MathHelper.cos(var1 * 0.6662F + (float)Math.PI) * 1.0F * var2; +- this.ocelotTail2.rotateAngleX = (float)Math.PI * 0.55F + (float)Math.PI * 0.1F * MathHelper.cos(var1) * var2; ++ /** ++ * Sets the model's various rotation angles. For bipeds, par1 and par2 are used for animating the movement of arms and ++ * legs, where par1 represents the time(so that arms and legs swing back and forth) and par2 represents how "far" arms ++ * and legs can swing at most. ++ */ ++ public void setRotationAngles(float par1, float par2, float par3, float par4, float par5, float par6, Entity par7Entity) { ++ this.ocelotHead.rotateAngleX = par5 / (180F / (float)Math.PI); ++ this.ocelotHead.rotateAngleY = par4 / (180F / (float)Math.PI); ++ ++ if (this.field_78163_i != 3) { ++ this.ocelotBody.rotateAngleX = ((float)Math.PI / 2F); ++ ++ if (this.field_78163_i == 2) { ++ this.ocelotBackLeftLeg.rotateAngleX = MathHelper.cos(par1 * 0.6662F) * 1.0F * par2; ++ this.ocelotBackRightLeg.rotateAngleX = MathHelper.cos(par1 * 0.6662F + 0.3F) * 1.0F * par2; ++ this.ocelotFrontLeftLeg.rotateAngleX = MathHelper.cos(par1 * 0.6662F + (float)Math.PI + 0.3F) * 1.0F * par2; ++ this.ocelotFrontRightLeg.rotateAngleX = MathHelper.cos(par1 * 0.6662F + (float)Math.PI) * 1.0F * par2; ++ this.ocelotTail2.rotateAngleX = 1.7278761F + ((float)Math.PI / 10F) * MathHelper.cos(par1) * par2; + } else { +- this.ocelotBackLeftLeg.rotateAngleX = MathHelper.cos(var1 * 0.6662F) * 1.0F * var2; +- this.ocelotBackRightLeg.rotateAngleX = MathHelper.cos(var1 * 0.6662F + (float)Math.PI) * 1.0F * var2; +- this.ocelotFrontLeftLeg.rotateAngleX = MathHelper.cos(var1 * 0.6662F + (float)Math.PI) * 1.0F * var2; +- this.ocelotFrontRightLeg.rotateAngleX = MathHelper.cos(var1 * 0.6662F) * 1.0F * var2; +- if(this.field_78163_i == 1) { +- this.ocelotTail2.rotateAngleX = (float)Math.PI * 0.55F + (float)Math.PI * 0.25F * MathHelper.cos(var1) * var2; ++ this.ocelotBackLeftLeg.rotateAngleX = MathHelper.cos(par1 * 0.6662F) * 1.0F * par2; ++ this.ocelotBackRightLeg.rotateAngleX = MathHelper.cos(par1 * 0.6662F + (float)Math.PI) * 1.0F * par2; ++ this.ocelotFrontLeftLeg.rotateAngleX = MathHelper.cos(par1 * 0.6662F + (float)Math.PI) * 1.0F * par2; ++ this.ocelotFrontRightLeg.rotateAngleX = MathHelper.cos(par1 * 0.6662F) * 1.0F * par2; ++ ++ if (this.field_78163_i == 1) { ++ this.ocelotTail2.rotateAngleX = 1.7278761F + ((float)Math.PI / 4F) * MathHelper.cos(par1) * par2; + } else { +- this.ocelotTail2.rotateAngleX = (float)Math.PI * 0.55F + (float)Math.PI * 0.15F * MathHelper.cos(var1) * var2; ++ this.ocelotTail2.rotateAngleX = 1.7278761F + 0.47123894F * MathHelper.cos(par1) * par2; + } + } + } +- + } + +- public void setLivingAnimations(EntityLivingBase var1, float var2, float var3, float var4) { +- EntityOcelot var5 = (EntityOcelot)var1; ++ /** ++ * Used for easily adding entity-dependent animations. The second and third float params here are the same second and ++ * third as in the setRotationAngles method. ++ */ ++ public void setLivingAnimations(EntityLivingBase par1EntityLivingBase, float par2, float par3, float par4) { ++ EntityOcelot var5 = (EntityOcelot)par1EntityLivingBase; + this.ocelotBody.rotationPointY = 12.0F; + this.ocelotBody.rotationPointZ = -10.0F; + this.ocelotHead.rotationPointY = 15.0F; +@@ -122,23 +152,24 @@ + this.ocelotBackLeftLeg.rotationPointY = this.ocelotBackRightLeg.rotationPointY = 18.0F; + this.ocelotBackLeftLeg.rotationPointZ = this.ocelotBackRightLeg.rotationPointZ = 5.0F; + this.ocelotTail.rotateAngleX = 0.9F; +- if(var5.isSneaking()) { ++ ++ if (var5.isSneaking()) { + ++this.ocelotBody.rotationPointY; + this.ocelotHead.rotationPointY += 2.0F; + ++this.ocelotTail.rotationPointY; + this.ocelotTail2.rotationPointY += -4.0F; + this.ocelotTail2.rotationPointZ += 2.0F; +- this.ocelotTail.rotateAngleX = (float)Math.PI * 0.5F; +- this.ocelotTail2.rotateAngleX = (float)Math.PI * 0.5F; ++ this.ocelotTail.rotateAngleX = ((float)Math.PI / 2F); ++ this.ocelotTail2.rotateAngleX = ((float)Math.PI / 2F); + this.field_78163_i = 0; +- } else if(var5.isSprinting()) { ++ } else if (var5.isSprinting()) { + this.ocelotTail2.rotationPointY = this.ocelotTail.rotationPointY; + this.ocelotTail2.rotationPointZ += 2.0F; +- this.ocelotTail.rotateAngleX = (float)Math.PI * 0.5F; +- this.ocelotTail2.rotateAngleX = (float)Math.PI * 0.5F; ++ this.ocelotTail.rotateAngleX = ((float)Math.PI / 2F); ++ this.ocelotTail2.rotateAngleX = ((float)Math.PI / 2F); + this.field_78163_i = 2; +- } else if(var5.isSitting()) { +- this.ocelotBody.rotateAngleX = (float)Math.PI * 0.25F; ++ } else if (var5.isSitting()) { ++ this.ocelotBody.rotateAngleX = ((float)Math.PI / 4F); + this.ocelotBody.rotationPointY += -4.0F; + this.ocelotBody.rotationPointZ += 5.0F; + this.ocelotHead.rotationPointY += -3.3F; +@@ -147,18 +178,17 @@ + this.ocelotTail.rotationPointZ += -2.0F; + this.ocelotTail2.rotationPointY += 2.0F; + this.ocelotTail2.rotationPointZ += -0.8F; +- this.ocelotTail.rotateAngleX = (float)Math.PI * 0.55F; +- this.ocelotTail2.rotateAngleX = (float)Math.PI * 0.85F; +- this.ocelotFrontLeftLeg.rotateAngleX = this.ocelotFrontRightLeg.rotateAngleX = (float)Math.PI * -0.05F; ++ this.ocelotTail.rotateAngleX = 1.7278761F; ++ this.ocelotTail2.rotateAngleX = 2.670354F; ++ this.ocelotFrontLeftLeg.rotateAngleX = this.ocelotFrontRightLeg.rotateAngleX = -0.15707964F; + this.ocelotFrontLeftLeg.rotationPointY = this.ocelotFrontRightLeg.rotationPointY = 15.8F; + this.ocelotFrontLeftLeg.rotationPointZ = this.ocelotFrontRightLeg.rotationPointZ = -7.0F; +- this.ocelotBackLeftLeg.rotateAngleX = this.ocelotBackRightLeg.rotateAngleX = (float)Math.PI * -0.5F; ++ this.ocelotBackLeftLeg.rotateAngleX = this.ocelotBackRightLeg.rotateAngleX = -((float)Math.PI / 2F); + this.ocelotBackLeftLeg.rotationPointY = this.ocelotBackRightLeg.rotationPointY = 21.0F; + this.ocelotBackLeftLeg.rotationPointZ = this.ocelotBackRightLeg.rotationPointZ = 1.0F; + this.field_78163_i = 3; + } else { + this.field_78163_i = 1; + } +- + } + } diff --git a/patches/net/minecraft/src/ModelPig.java.patch b/patches/net/minecraft/src/ModelPig.java.patch new file mode 100644 index 0000000..1260c85 --- /dev/null +++ b/patches/net/minecraft/src/ModelPig.java.patch @@ -0,0 +1,15 @@ +--- net/minecraft/src/ModelPig.java ++++ net/minecraft/src/ModelPig.java +@@ -5,9 +5,9 @@ + this(0.0F); + } + +- public ModelPig(float var1) { +- super(6, var1); +- this.head.setTextureOffset(16, 16).addBox(-2.0F, 0.0F, -9.0F, 4, 3, 1, var1); ++ public ModelPig(float par1) { ++ super(6, par1); ++ this.head.setTextureOffset(16, 16).addBox(-2.0F, 0.0F, -9.0F, 4, 3, 1, par1); + this.field_78145_g = 4.0F; + } + } diff --git a/patches/net/minecraft/src/ModelQuadruped.java.patch b/patches/net/minecraft/src/ModelQuadruped.java.patch new file mode 100644 index 0000000..6c0bfef --- /dev/null +++ b/patches/net/minecraft/src/ModelQuadruped.java.patch @@ -0,0 +1,113 @@ +--- net/minecraft/src/ModelQuadruped.java ++++ net/minecraft/src/ModelQuadruped.java +@@ -12,62 +12,70 @@ + protected float field_78145_g = 8.0F; + protected float field_78151_h = 4.0F; + +- public ModelQuadruped(int var1, float var2) { +- this.head.addBox(-4.0F, -4.0F, -8.0F, 8, 8, 8, var2); +- this.head.setRotationPoint(0.0F, (float)(18 - var1), -6.0F); ++ public ModelQuadruped(int par1, float par2) { ++ this.head.addBox(-4.0F, -4.0F, -8.0F, 8, 8, 8, par2); ++ this.head.setRotationPoint(0.0F, (float)(18 - par1), -6.0F); + this.body = new ModelRenderer(this, 28, 8); +- this.body.addBox(-5.0F, -10.0F, -7.0F, 10, 16, 8, var2); +- this.body.setRotationPoint(0.0F, (float)(17 - var1), 2.0F); ++ this.body.addBox(-5.0F, -10.0F, -7.0F, 10, 16, 8, par2); ++ this.body.setRotationPoint(0.0F, (float)(17 - par1), 2.0F); + this.leg1 = new ModelRenderer(this, 0, 16); +- this.leg1.addBox(-2.0F, 0.0F, -2.0F, 4, var1, 4, var2); +- this.leg1.setRotationPoint(-3.0F, (float)(24 - var1), 7.0F); ++ this.leg1.addBox(-2.0F, 0.0F, -2.0F, 4, par1, 4, par2); ++ this.leg1.setRotationPoint(-3.0F, (float)(24 - par1), 7.0F); + this.leg2 = new ModelRenderer(this, 0, 16); +- this.leg2.addBox(-2.0F, 0.0F, -2.0F, 4, var1, 4, var2); +- this.leg2.setRotationPoint(3.0F, (float)(24 - var1), 7.0F); ++ this.leg2.addBox(-2.0F, 0.0F, -2.0F, 4, par1, 4, par2); ++ this.leg2.setRotationPoint(3.0F, (float)(24 - par1), 7.0F); + this.leg3 = new ModelRenderer(this, 0, 16); +- this.leg3.addBox(-2.0F, 0.0F, -2.0F, 4, var1, 4, var2); +- this.leg3.setRotationPoint(-3.0F, (float)(24 - var1), -5.0F); ++ this.leg3.addBox(-2.0F, 0.0F, -2.0F, 4, par1, 4, par2); ++ this.leg3.setRotationPoint(-3.0F, (float)(24 - par1), -5.0F); + this.leg4 = new ModelRenderer(this, 0, 16); +- this.leg4.addBox(-2.0F, 0.0F, -2.0F, 4, var1, 4, var2); +- this.leg4.setRotationPoint(3.0F, (float)(24 - var1), -5.0F); ++ this.leg4.addBox(-2.0F, 0.0F, -2.0F, 4, par1, 4, par2); ++ this.leg4.setRotationPoint(3.0F, (float)(24 - par1), -5.0F); + } + +- public void render(Entity var1, float var2, float var3, float var4, float var5, float var6, float var7) { +- this.setRotationAngles(var2, var3, var4, var5, var6, var7, var1); +- if(this.isChild) { ++ /** ++ * Sets the models various rotation angles then renders the model. ++ */ ++ public void render(Entity par1Entity, float par2, float par3, float par4, float par5, float par6, float par7) { ++ this.setRotationAngles(par2, par3, par4, par5, par6, par7, par1Entity); ++ ++ if (this.isChild) { + float var8 = 2.0F; + GL11.glPushMatrix(); +- GL11.glTranslatef(0.0F, this.field_78145_g * var7, this.field_78151_h * var7); +- this.head.render(var7); ++ GL11.glTranslatef(0.0F, this.field_78145_g * par7, this.field_78151_h * par7); ++ this.head.render(par7); + GL11.glPopMatrix(); + GL11.glPushMatrix(); + GL11.glScalef(1.0F / var8, 1.0F / var8, 1.0F / var8); +- GL11.glTranslatef(0.0F, 24.0F * var7, 0.0F); +- this.body.render(var7); +- this.leg1.render(var7); +- this.leg2.render(var7); +- this.leg3.render(var7); +- this.leg4.render(var7); ++ GL11.glTranslatef(0.0F, 24.0F * par7, 0.0F); ++ this.body.render(par7); ++ this.leg1.render(par7); ++ this.leg2.render(par7); ++ this.leg3.render(par7); ++ this.leg4.render(par7); + GL11.glPopMatrix(); + } else { +- this.head.render(var7); +- this.body.render(var7); +- this.leg1.render(var7); +- this.leg2.render(var7); +- this.leg3.render(var7); +- this.leg4.render(var7); ++ this.head.render(par7); ++ this.body.render(par7); ++ this.leg1.render(par7); ++ this.leg2.render(par7); ++ this.leg3.render(par7); ++ this.leg4.render(par7); + } +- + } + +- public void setRotationAngles(float var1, float var2, float var3, float var4, float var5, float var6, Entity var7) { +- float var8 = 180.0F / (float)Math.PI; +- this.head.rotateAngleX = var5 / (180.0F / (float)Math.PI); +- this.head.rotateAngleY = var4 / (180.0F / (float)Math.PI); +- this.body.rotateAngleX = (float)Math.PI * 0.5F; +- this.leg1.rotateAngleX = MathHelper.cos(var1 * 0.6662F) * 1.4F * var2; +- this.leg2.rotateAngleX = MathHelper.cos(var1 * 0.6662F + (float)Math.PI) * 1.4F * var2; +- this.leg3.rotateAngleX = MathHelper.cos(var1 * 0.6662F + (float)Math.PI) * 1.4F * var2; +- this.leg4.rotateAngleX = MathHelper.cos(var1 * 0.6662F) * 1.4F * var2; ++ /** ++ * Sets the model's various rotation angles. For bipeds, par1 and par2 are used for animating the movement of arms and ++ * legs, where par1 represents the time(so that arms and legs swing back and forth) and par2 represents how "far" arms ++ * and legs can swing at most. ++ */ ++ public void setRotationAngles(float par1, float par2, float par3, float par4, float par5, float par6, Entity par7Entity) { ++ float var8 = (180F / (float)Math.PI); ++ this.head.rotateAngleX = par5 / (180F / (float)Math.PI); ++ this.head.rotateAngleY = par4 / (180F / (float)Math.PI); ++ this.body.rotateAngleX = ((float)Math.PI / 2F); ++ this.leg1.rotateAngleX = MathHelper.cos(par1 * 0.6662F) * 1.4F * par2; ++ this.leg2.rotateAngleX = MathHelper.cos(par1 * 0.6662F + (float)Math.PI) * 1.4F * par2; ++ this.leg3.rotateAngleX = MathHelper.cos(par1 * 0.6662F + (float)Math.PI) * 1.4F * par2; ++ this.leg4.rotateAngleX = MathHelper.cos(par1 * 0.6662F) * 1.4F * par2; + } + } diff --git a/patches/net/minecraft/src/ModelRenderer.java.patch b/patches/net/minecraft/src/ModelRenderer.java.patch new file mode 100644 index 0000000..2d01cd4 --- /dev/null +++ b/patches/net/minecraft/src/ModelRenderer.java.patch @@ -0,0 +1,367 @@ +--- net/minecraft/src/ModelRenderer.java ++++ net/minecraft/src/ModelRenderer.java +@@ -5,9 +5,17 @@ + import org.lwjgl.opengl.GL11; + + public class ModelRenderer { ++ ++ /** The size of the texture file's width in pixels. */ + public float textureWidth; ++ ++ /** The size of the texture file's height in pixels. */ + public float textureHeight; ++ ++ /** The X offset into the texture used for displaying this model */ + private int textureOffsetX; ++ ++ /** The Y offset into the texture used for displaying this model */ + private int textureOffsetY; + public float rotationPointX; + public float rotationPointY; +@@ -16,122 +24,137 @@ + public float rotateAngleY; + public float rotateAngleZ; + private boolean compiled; ++ ++ /** The GL display list rendered by the Tessellator for this model */ + private int displayList; + public boolean mirror; + public boolean showModel; ++ ++ /** Hides the model. */ + public boolean isHidden; +- public List l; +- public List m; +- public final String n; ++ public List cubeList; ++ public List childModels; ++ public final String boxName; + private ModelBase baseModel; + public float offsetX; + public float offsetY; + public float offsetZ; + +- public ModelRenderer(ModelBase var1, String var2) { ++ public ModelRenderer(ModelBase par1ModelBase, String par2Str) { + this.textureWidth = 64.0F; + this.textureHeight = 32.0F; + this.showModel = true; +- this.l = new ArrayList(); +- this.baseModel = var1; +- var1.r.add(this); +- this.n = var2; +- this.setTextureSize(var1.textureWidth, var1.textureHeight); +- } +- +- public ModelRenderer(ModelBase var1) { +- this(var1, (String)null); +- } +- +- public ModelRenderer(ModelBase var1, int var2, int var3) { +- this(var1); +- this.setTextureOffset(var2, var3); +- } +- +- public void addChild(ModelRenderer var1) { +- if(this.m == null) { +- this.m = new ArrayList(); ++ this.cubeList = new ArrayList(); ++ this.baseModel = par1ModelBase; ++ par1ModelBase.boxList.add(this); ++ this.boxName = par2Str; ++ this.setTextureSize(par1ModelBase.textureWidth, par1ModelBase.textureHeight); ++ } ++ ++ public ModelRenderer(ModelBase par1ModelBase) { ++ this(par1ModelBase, (String)null); ++ } ++ ++ public ModelRenderer(ModelBase par1ModelBase, int par2, int par3) { ++ this(par1ModelBase); ++ this.setTextureOffset(par2, par3); ++ } ++ ++ /** ++ * Sets the current box's rotation points and rotation angles to another box. ++ */ ++ public void addChild(ModelRenderer par1ModelRenderer) { ++ if (this.childModels == null) { ++ this.childModels = new ArrayList(); + } + +- this.m.add(var1); ++ this.childModels.add(par1ModelRenderer); + } + +- public ModelRenderer setTextureOffset(int var1, int var2) { +- this.textureOffsetX = var1; +- this.textureOffsetY = var2; ++ public ModelRenderer setTextureOffset(int par1, int par2) { ++ this.textureOffsetX = par1; ++ this.textureOffsetY = par2; + return this; + } + +- public ModelRenderer addBox(String var1, float var2, float var3, float var4, int var5, int var6, int var7) { +- var1 = this.n + "." + var1; +- TextureOffset var8 = this.baseModel.getTextureOffset(var1); ++ public ModelRenderer addBox(String par1Str, float par2, float par3, float par4, int par5, int par6, int par7) { ++ par1Str = this.boxName + "." + par1Str; ++ TextureOffset var8 = this.baseModel.getTextureOffset(par1Str); + this.setTextureOffset(var8.textureOffsetX, var8.textureOffsetY); +- this.l.add((new ModelBox(this, this.textureOffsetX, this.textureOffsetY, var2, var3, var4, var5, var6, var7, 0.0F)).func_78244_a(var1)); +- return this; +- } +- +- public ModelRenderer addBox(float var1, float var2, float var3, int var4, int var5, int var6) { +- this.l.add(new ModelBox(this, this.textureOffsetX, this.textureOffsetY, var1, var2, var3, var4, var5, var6, 0.0F)); +- return this; +- } +- +- public void addBox(float var1, float var2, float var3, int var4, int var5, int var6, float var7) { +- this.l.add(new ModelBox(this, this.textureOffsetX, this.textureOffsetY, var1, var2, var3, var4, var5, var6, var7)); +- } +- +- public void setRotationPoint(float var1, float var2, float var3) { +- this.rotationPointX = var1; +- this.rotationPointY = var2; +- this.rotationPointZ = var3; +- } +- +- public void render(float var1) { +- if(!this.isHidden) { +- if(this.showModel) { +- if(!this.compiled) { +- this.compileDisplayList(var1); ++ this.cubeList.add((new ModelBox(this, this.textureOffsetX, this.textureOffsetY, par2, par3, par4, par5, par6, par7, 0.0F)).func_78244_a(par1Str)); ++ return this; ++ } ++ ++ public ModelRenderer addBox(float par1, float par2, float par3, int par4, int par5, int par6) { ++ this.cubeList.add(new ModelBox(this, this.textureOffsetX, this.textureOffsetY, par1, par2, par3, par4, par5, par6, 0.0F)); ++ return this; ++ } ++ ++ /** ++ * Creates a textured box. Args: originX, originY, originZ, width, height, depth, scaleFactor. ++ */ ++ public void addBox(float par1, float par2, float par3, int par4, int par5, int par6, float par7) { ++ this.cubeList.add(new ModelBox(this, this.textureOffsetX, this.textureOffsetY, par1, par2, par3, par4, par5, par6, par7)); ++ } ++ ++ public void setRotationPoint(float par1, float par2, float par3) { ++ this.rotationPointX = par1; ++ this.rotationPointY = par2; ++ this.rotationPointZ = par3; ++ } ++ ++ public void render(float par1) { ++ if (!this.isHidden) { ++ if (this.showModel) { ++ if (!this.compiled) { ++ this.compileDisplayList(par1); + } + + GL11.glTranslatef(this.offsetX, this.offsetY, this.offsetZ); + int var2; +- if(this.rotateAngleX == 0.0F && this.rotateAngleY == 0.0F && this.rotateAngleZ == 0.0F) { +- if(this.rotationPointX == 0.0F && this.rotationPointY == 0.0F && this.rotationPointZ == 0.0F) { ++ ++ if (this.rotateAngleX == 0.0F && this.rotateAngleY == 0.0F && this.rotateAngleZ == 0.0F) { ++ if (this.rotationPointX == 0.0F && this.rotationPointY == 0.0F && this.rotationPointZ == 0.0F) { + GL11.glCallList(this.displayList); +- if(this.m != null) { +- for(var2 = 0; var2 < this.m.size(); ++var2) { +- ((ModelRenderer)this.m.get(var2)).render(var1); ++ ++ if (this.childModels != null) { ++ for (var2 = 0; var2 < this.childModels.size(); ++var2) { ++ ((ModelRenderer)this.childModels.get(var2)).render(par1); + } + } + } else { +- GL11.glTranslatef(this.rotationPointX * var1, this.rotationPointY * var1, this.rotationPointZ * var1); ++ GL11.glTranslatef(this.rotationPointX * par1, this.rotationPointY * par1, this.rotationPointZ * par1); + GL11.glCallList(this.displayList); +- if(this.m != null) { +- for(var2 = 0; var2 < this.m.size(); ++var2) { +- ((ModelRenderer)this.m.get(var2)).render(var1); ++ ++ if (this.childModels != null) { ++ for (var2 = 0; var2 < this.childModels.size(); ++var2) { ++ ((ModelRenderer)this.childModels.get(var2)).render(par1); + } + } + +- GL11.glTranslatef(-this.rotationPointX * var1, -this.rotationPointY * var1, -this.rotationPointZ * var1); ++ GL11.glTranslatef(-this.rotationPointX * par1, -this.rotationPointY * par1, -this.rotationPointZ * par1); + } + } else { + GL11.glPushMatrix(); +- GL11.glTranslatef(this.rotationPointX * var1, this.rotationPointY * var1, this.rotationPointZ * var1); +- if(this.rotateAngleZ != 0.0F) { +- GL11.glRotatef(this.rotateAngleZ * (180.0F / (float)Math.PI), 0.0F, 0.0F, 1.0F); +- } +- +- if(this.rotateAngleY != 0.0F) { +- GL11.glRotatef(this.rotateAngleY * (180.0F / (float)Math.PI), 0.0F, 1.0F, 0.0F); +- } +- +- if(this.rotateAngleX != 0.0F) { +- GL11.glRotatef(this.rotateAngleX * (180.0F / (float)Math.PI), 1.0F, 0.0F, 0.0F); ++ GL11.glTranslatef(this.rotationPointX * par1, this.rotationPointY * par1, this.rotationPointZ * par1); ++ ++ if (this.rotateAngleZ != 0.0F) { ++ GL11.glRotatef(this.rotateAngleZ * (180F / (float)Math.PI), 0.0F, 0.0F, 1.0F); ++ } ++ ++ if (this.rotateAngleY != 0.0F) { ++ GL11.glRotatef(this.rotateAngleY * (180F / (float)Math.PI), 0.0F, 1.0F, 0.0F); ++ } ++ ++ if (this.rotateAngleX != 0.0F) { ++ GL11.glRotatef(this.rotateAngleX * (180F / (float)Math.PI), 1.0F, 0.0F, 0.0F); + } + + GL11.glCallList(this.displayList); +- if(this.m != null) { +- for(var2 = 0; var2 < this.m.size(); ++var2) { +- ((ModelRenderer)this.m.get(var2)).render(var1); ++ ++ if (this.childModels != null) { ++ for (var2 = 0; var2 < this.childModels.size(); ++var2) { ++ ((ModelRenderer)this.childModels.get(var2)).render(par1); + } + } + +@@ -143,25 +166,26 @@ + } + } + +- public void renderWithRotation(float var1) { +- if(!this.isHidden) { +- if(this.showModel) { +- if(!this.compiled) { +- this.compileDisplayList(var1); ++ public void renderWithRotation(float par1) { ++ if (!this.isHidden) { ++ if (this.showModel) { ++ if (!this.compiled) { ++ this.compileDisplayList(par1); + } + + GL11.glPushMatrix(); +- GL11.glTranslatef(this.rotationPointX * var1, this.rotationPointY * var1, this.rotationPointZ * var1); +- if(this.rotateAngleY != 0.0F) { +- GL11.glRotatef(this.rotateAngleY * (180.0F / (float)Math.PI), 0.0F, 1.0F, 0.0F); +- } +- +- if(this.rotateAngleX != 0.0F) { +- GL11.glRotatef(this.rotateAngleX * (180.0F / (float)Math.PI), 1.0F, 0.0F, 0.0F); +- } +- +- if(this.rotateAngleZ != 0.0F) { +- GL11.glRotatef(this.rotateAngleZ * (180.0F / (float)Math.PI), 0.0F, 0.0F, 1.0F); ++ GL11.glTranslatef(this.rotationPointX * par1, this.rotationPointY * par1, this.rotationPointZ * par1); ++ ++ if (this.rotateAngleY != 0.0F) { ++ GL11.glRotatef(this.rotateAngleY * (180F / (float)Math.PI), 0.0F, 1.0F, 0.0F); ++ } ++ ++ if (this.rotateAngleX != 0.0F) { ++ GL11.glRotatef(this.rotateAngleX * (180F / (float)Math.PI), 1.0F, 0.0F, 0.0F); ++ } ++ ++ if (this.rotateAngleZ != 0.0F) { ++ GL11.glRotatef(this.rotateAngleZ * (180F / (float)Math.PI), 0.0F, 0.0F, 1.0F); + } + + GL11.glCallList(this.displayList); +@@ -170,52 +194,61 @@ + } + } + +- public void postRender(float var1) { +- if(!this.isHidden) { +- if(this.showModel) { +- if(!this.compiled) { +- this.compileDisplayList(var1); ++ /** ++ * Allows the changing of Angles after a box has been rendered ++ */ ++ public void postRender(float par1) { ++ if (!this.isHidden) { ++ if (this.showModel) { ++ if (!this.compiled) { ++ this.compileDisplayList(par1); + } + +- if(this.rotateAngleX == 0.0F && this.rotateAngleY == 0.0F && this.rotateAngleZ == 0.0F) { +- if(this.rotationPointX != 0.0F || this.rotationPointY != 0.0F || this.rotationPointZ != 0.0F) { +- GL11.glTranslatef(this.rotationPointX * var1, this.rotationPointY * var1, this.rotationPointZ * var1); ++ if (this.rotateAngleX == 0.0F && this.rotateAngleY == 0.0F && this.rotateAngleZ == 0.0F) { ++ if (this.rotationPointX != 0.0F || this.rotationPointY != 0.0F || this.rotationPointZ != 0.0F) { ++ GL11.glTranslatef(this.rotationPointX * par1, this.rotationPointY * par1, this.rotationPointZ * par1); + } + } else { +- GL11.glTranslatef(this.rotationPointX * var1, this.rotationPointY * var1, this.rotationPointZ * var1); +- if(this.rotateAngleZ != 0.0F) { +- GL11.glRotatef(this.rotateAngleZ * (180.0F / (float)Math.PI), 0.0F, 0.0F, 1.0F); +- } +- +- if(this.rotateAngleY != 0.0F) { +- GL11.glRotatef(this.rotateAngleY * (180.0F / (float)Math.PI), 0.0F, 1.0F, 0.0F); +- } +- +- if(this.rotateAngleX != 0.0F) { +- GL11.glRotatef(this.rotateAngleX * (180.0F / (float)Math.PI), 1.0F, 0.0F, 0.0F); ++ GL11.glTranslatef(this.rotationPointX * par1, this.rotationPointY * par1, this.rotationPointZ * par1); ++ ++ if (this.rotateAngleZ != 0.0F) { ++ GL11.glRotatef(this.rotateAngleZ * (180F / (float)Math.PI), 0.0F, 0.0F, 1.0F); ++ } ++ ++ if (this.rotateAngleY != 0.0F) { ++ GL11.glRotatef(this.rotateAngleY * (180F / (float)Math.PI), 0.0F, 1.0F, 0.0F); ++ } ++ ++ if (this.rotateAngleX != 0.0F) { ++ GL11.glRotatef(this.rotateAngleX * (180F / (float)Math.PI), 1.0F, 0.0F, 0.0F); + } + } +- + } + } + } + +- private void compileDisplayList(float var1) { ++ /** ++ * Compiles a GL display list for this model ++ */ ++ private void compileDisplayList(float par1) { + this.displayList = GLAllocation.generateDisplayLists(1); + GL11.glNewList(this.displayList, GL11.GL_COMPILE); + Tessellator var2 = Tessellator.instance; + +- for(int var3 = 0; var3 < this.l.size(); ++var3) { +- ((ModelBox)this.l.get(var3)).render(var2, var1); ++ for (int var3 = 0; var3 < this.cubeList.size(); ++var3) { ++ ((ModelBox)this.cubeList.get(var3)).render(var2, par1); + } + + GL11.glEndList(); + this.compiled = true; + } + +- public ModelRenderer setTextureSize(int var1, int var2) { +- this.textureWidth = (float)var1; +- this.textureHeight = (float)var2; ++ /** ++ * Returns the model renderer with the new texture parameters. ++ */ ++ public ModelRenderer setTextureSize(int par1, int par2) { ++ this.textureWidth = (float)par1; ++ this.textureHeight = (float)par2; + return this; + } + } diff --git a/patches/net/minecraft/src/ModelSheep1.java.patch b/patches/net/minecraft/src/ModelSheep1.java.patch new file mode 100644 index 0000000..4acb93f --- /dev/null +++ b/patches/net/minecraft/src/ModelSheep1.java.patch @@ -0,0 +1,32 @@ +--- net/minecraft/src/ModelSheep1.java ++++ net/minecraft/src/ModelSheep1.java +@@ -26,14 +26,23 @@ + this.leg4.setRotationPoint(3.0F, 12.0F, -5.0F); + } + +- public void setLivingAnimations(EntityLivingBase var1, float var2, float var3, float var4) { +- super.setLivingAnimations(var1, var2, var3, var4); +- this.head.rotationPointY = 6.0F + ((EntitySheep)var1).func_70894_j(var4) * 9.0F; +- this.field_78152_i = ((EntitySheep)var1).func_70890_k(var4); ++ /** ++ * Used for easily adding entity-dependent animations. The second and third float params here are the same second and ++ * third as in the setRotationAngles method. ++ */ ++ public void setLivingAnimations(EntityLivingBase par1EntityLivingBase, float par2, float par3, float par4) { ++ super.setLivingAnimations(par1EntityLivingBase, par2, par3, par4); ++ this.head.rotationPointY = 6.0F + ((EntitySheep)par1EntityLivingBase).func_70894_j(par4) * 9.0F; ++ this.field_78152_i = ((EntitySheep)par1EntityLivingBase).func_70890_k(par4); + } + +- public void setRotationAngles(float var1, float var2, float var3, float var4, float var5, float var6, Entity var7) { +- super.setRotationAngles(var1, var2, var3, var4, var5, var6, var7); ++ /** ++ * Sets the model's various rotation angles. For bipeds, par1 and par2 are used for animating the movement of arms and ++ * legs, where par1 represents the time(so that arms and legs swing back and forth) and par2 represents how "far" arms ++ * and legs can swing at most. ++ */ ++ public void setRotationAngles(float par1, float par2, float par3, float par4, float par5, float par6, Entity par7Entity) { ++ super.setRotationAngles(par1, par2, par3, par4, par5, par6, par7Entity); + this.head.rotateAngleX = this.field_78152_i; + } + } diff --git a/patches/net/minecraft/src/ModelSheep2.java.patch b/patches/net/minecraft/src/ModelSheep2.java.patch new file mode 100644 index 0000000..4cbeeef --- /dev/null +++ b/patches/net/minecraft/src/ModelSheep2.java.patch @@ -0,0 +1,32 @@ +--- net/minecraft/src/ModelSheep2.java ++++ net/minecraft/src/ModelSheep2.java +@@ -13,14 +13,23 @@ + this.body.setRotationPoint(0.0F, 5.0F, 2.0F); + } + +- public void setLivingAnimations(EntityLivingBase var1, float var2, float var3, float var4) { +- super.setLivingAnimations(var1, var2, var3, var4); +- this.head.rotationPointY = 6.0F + ((EntitySheep)var1).func_70894_j(var4) * 9.0F; +- this.field_78153_i = ((EntitySheep)var1).func_70890_k(var4); ++ /** ++ * Used for easily adding entity-dependent animations. The second and third float params here are the same second and ++ * third as in the setRotationAngles method. ++ */ ++ public void setLivingAnimations(EntityLivingBase par1EntityLivingBase, float par2, float par3, float par4) { ++ super.setLivingAnimations(par1EntityLivingBase, par2, par3, par4); ++ this.head.rotationPointY = 6.0F + ((EntitySheep)par1EntityLivingBase).func_70894_j(par4) * 9.0F; ++ this.field_78153_i = ((EntitySheep)par1EntityLivingBase).func_70890_k(par4); + } + +- public void setRotationAngles(float var1, float var2, float var3, float var4, float var5, float var6, Entity var7) { +- super.setRotationAngles(var1, var2, var3, var4, var5, var6, var7); ++ /** ++ * Sets the model's various rotation angles. For bipeds, par1 and par2 are used for animating the movement of arms and ++ * legs, where par1 represents the time(so that arms and legs swing back and forth) and par2 represents how "far" arms ++ * and legs can swing at most. ++ */ ++ public void setRotationAngles(float par1, float par2, float par3, float par4, float par5, float par6, Entity par7Entity) { ++ super.setRotationAngles(par1, par2, par3, par4, par5, par6, par7Entity); + this.head.rotateAngleX = this.field_78153_i; + } + } diff --git a/patches/net/minecraft/src/ModelSign.java.patch b/patches/net/minecraft/src/ModelSign.java.patch new file mode 100644 index 0000000..8fa394f --- /dev/null +++ b/patches/net/minecraft/src/ModelSign.java.patch @@ -0,0 +1,28 @@ +--- net/minecraft/src/ModelSign.java ++++ net/minecraft/src/ModelSign.java +@@ -1,7 +1,11 @@ + package net.minecraft.src; + + public class ModelSign extends ModelBase { ++ ++ /** The board on a sign that has the writing on it. */ + public ModelRenderer signBoard = new ModelRenderer(this, 0, 0); ++ ++ /** The stick a sign stands on. */ + public ModelRenderer signStick; + + public ModelSign() { +@@ -10,8 +14,11 @@ + this.signStick.addBox(-1.0F, -2.0F, -1.0F, 2, 14, 2, 0.0F); + } + ++ /** ++ * Renders the sign model through TileEntitySignRenderer ++ */ + public void renderSign() { +- this.signBoard.render(1.0F / 16.0F); +- this.signStick.render(1.0F / 16.0F); ++ this.signBoard.render(0.0625F); ++ this.signStick.render(0.0625F); + } + } diff --git a/patches/net/minecraft/src/ModelSilverfish.java.patch b/patches/net/minecraft/src/ModelSilverfish.java.patch new file mode 100644 index 0000000..4aac910 --- /dev/null +++ b/patches/net/minecraft/src/ModelSilverfish.java.patch @@ -0,0 +1,84 @@ +--- net/minecraft/src/ModelSilverfish.java ++++ net/minecraft/src/ModelSilverfish.java +@@ -1,21 +1,30 @@ + package net.minecraft.src; + + public class ModelSilverfish extends ModelBase { ++ ++ /** The body parts of the silverfish's model. */ + private ModelRenderer[] silverfishBodyParts = new ModelRenderer[7]; ++ ++ /** The wings (dust-looking sprites) on the silverfish's model. */ + private ModelRenderer[] silverfishWings; + private float[] field_78170_c = new float[7]; +- private static final int[][] silverfishBoxLength = new int[][]{{3, 2, 2}, {4, 3, 2}, {6, 4, 3}, {3, 3, 3}, {2, 2, 3}, {2, 1, 2}, {1, 1, 2}}; +- private static final int[][] silverfishTexturePositions = new int[][]{{0, 0}, {0, 4}, {0, 9}, {0, 16}, {0, 22}, {11, 0}, {13, 4}}; ++ ++ /** The widths, heights, and lengths for the silverfish model boxes. */ ++ private static final int[][] silverfishBoxLength = new int[][] {{3, 2, 2}, {4, 3, 2}, {6, 4, 3}, {3, 3, 3}, {2, 2, 3}, {2, 1, 2}, {1, 1, 2}}; ++ ++ /** The texture positions for the silverfish's model's boxes. */ ++ private static final int[][] silverfishTexturePositions = new int[][] {{0, 0}, {0, 4}, {0, 9}, {0, 16}, {0, 22}, {11, 0}, {13, 4}}; + + public ModelSilverfish() { + float var1 = -3.5F; + +- for(int var2 = 0; var2 < this.silverfishBodyParts.length; ++var2) { ++ for (int var2 = 0; var2 < this.silverfishBodyParts.length; ++var2) { + this.silverfishBodyParts[var2] = new ModelRenderer(this, silverfishTexturePositions[var2][0], silverfishTexturePositions[var2][1]); + this.silverfishBodyParts[var2].addBox((float)silverfishBoxLength[var2][0] * -0.5F, 0.0F, (float)silverfishBoxLength[var2][2] * -0.5F, silverfishBoxLength[var2][0], silverfishBoxLength[var2][1], silverfishBoxLength[var2][2]); + this.silverfishBodyParts[var2].setRotationPoint(0.0F, (float)(24 - silverfishBoxLength[var2][1]), var1); + this.field_78170_c[var2] = var1; +- if(var2 < this.silverfishBodyParts.length - 1) { ++ ++ if (var2 < this.silverfishBodyParts.length - 1) { + var1 += (float)(silverfishBoxLength[var2][2] + silverfishBoxLength[var2 + 1][2]) * 0.5F; + } + } +@@ -32,24 +41,31 @@ + this.silverfishWings[2].setRotationPoint(0.0F, 19.0F, this.field_78170_c[1]); + } + +- public void render(Entity var1, float var2, float var3, float var4, float var5, float var6, float var7) { +- this.setRotationAngles(var2, var3, var4, var5, var6, var7, var1); +- ++ /** ++ * Sets the models various rotation angles then renders the model. ++ */ ++ public void render(Entity par1Entity, float par2, float par3, float par4, float par5, float par6, float par7) { ++ this.setRotationAngles(par2, par3, par4, par5, par6, par7, par1Entity); + int var8; +- for(var8 = 0; var8 < this.silverfishBodyParts.length; ++var8) { +- this.silverfishBodyParts[var8].render(var7); +- } +- +- for(var8 = 0; var8 < this.silverfishWings.length; ++var8) { +- this.silverfishWings[var8].render(var7); +- } +- ++ ++ for (var8 = 0; var8 < this.silverfishBodyParts.length; ++var8) { ++ this.silverfishBodyParts[var8].render(par7); ++ } ++ ++ for (var8 = 0; var8 < this.silverfishWings.length; ++var8) { ++ this.silverfishWings[var8].render(par7); ++ } + } + +- public void setRotationAngles(float var1, float var2, float var3, float var4, float var5, float var6, Entity var7) { +- for(int var8 = 0; var8 < this.silverfishBodyParts.length; ++var8) { +- this.silverfishBodyParts[var8].rotateAngleY = MathHelper.cos(var3 * 0.9F + (float)var8 * 0.15F * (float)Math.PI) * (float)Math.PI * 0.05F * (float)(1 + Math.abs(var8 - 2)); +- this.silverfishBodyParts[var8].rotationPointX = MathHelper.sin(var3 * 0.9F + (float)var8 * 0.15F * (float)Math.PI) * (float)Math.PI * 0.2F * (float)Math.abs(var8 - 2); ++ /** ++ * Sets the model's various rotation angles. For bipeds, par1 and par2 are used for animating the movement of arms and ++ * legs, where par1 represents the time(so that arms and legs swing back and forth) and par2 represents how "far" arms ++ * and legs can swing at most. ++ */ ++ public void setRotationAngles(float par1, float par2, float par3, float par4, float par5, float par6, Entity par7Entity) { ++ for (int var8 = 0; var8 < this.silverfishBodyParts.length; ++var8) { ++ this.silverfishBodyParts[var8].rotateAngleY = MathHelper.cos(par3 * 0.9F + (float)var8 * 0.15F * (float)Math.PI) * (float)Math.PI * 0.05F * (float)(1 + Math.abs(var8 - 2)); ++ this.silverfishBodyParts[var8].rotationPointX = MathHelper.sin(par3 * 0.9F + (float)var8 * 0.15F * (float)Math.PI) * (float)Math.PI * 0.2F * (float)Math.abs(var8 - 2); + } + + this.silverfishWings[0].rotateAngleY = this.silverfishBodyParts[2].rotateAngleY; diff --git a/patches/net/minecraft/src/ModelSkeleton.java.patch b/patches/net/minecraft/src/ModelSkeleton.java.patch new file mode 100644 index 0000000..1795a5b --- /dev/null +++ b/patches/net/minecraft/src/ModelSkeleton.java.patch @@ -0,0 +1,53 @@ +--- net/minecraft/src/ModelSkeleton.java ++++ net/minecraft/src/ModelSkeleton.java +@@ -5,30 +5,39 @@ + this(0.0F); + } + +- public ModelSkeleton(float var1) { +- super(var1, 0.0F, 64, 32); ++ public ModelSkeleton(float par1) { ++ super(par1, 0.0F, 64, 32); + this.bipedRightArm = new ModelRenderer(this, 40, 16); +- this.bipedRightArm.addBox(-1.0F, -2.0F, -1.0F, 2, 12, 2, var1); ++ this.bipedRightArm.addBox(-1.0F, -2.0F, -1.0F, 2, 12, 2, par1); + this.bipedRightArm.setRotationPoint(-5.0F, 2.0F, 0.0F); + this.bipedLeftArm = new ModelRenderer(this, 40, 16); + this.bipedLeftArm.mirror = true; +- this.bipedLeftArm.addBox(-1.0F, -2.0F, -1.0F, 2, 12, 2, var1); ++ this.bipedLeftArm.addBox(-1.0F, -2.0F, -1.0F, 2, 12, 2, par1); + this.bipedLeftArm.setRotationPoint(5.0F, 2.0F, 0.0F); + this.bipedRightLeg = new ModelRenderer(this, 0, 16); +- this.bipedRightLeg.addBox(-1.0F, 0.0F, -1.0F, 2, 12, 2, var1); ++ this.bipedRightLeg.addBox(-1.0F, 0.0F, -1.0F, 2, 12, 2, par1); + this.bipedRightLeg.setRotationPoint(-2.0F, 12.0F, 0.0F); + this.bipedLeftLeg = new ModelRenderer(this, 0, 16); + this.bipedLeftLeg.mirror = true; +- this.bipedLeftLeg.addBox(-1.0F, 0.0F, -1.0F, 2, 12, 2, var1); ++ this.bipedLeftLeg.addBox(-1.0F, 0.0F, -1.0F, 2, 12, 2, par1); + this.bipedLeftLeg.setRotationPoint(2.0F, 12.0F, 0.0F); + } + +- public void setLivingAnimations(EntityLivingBase var1, float var2, float var3, float var4) { +- this.aimedBow = ((EntitySkeleton)var1).getSkeletonType() == 1; +- super.setLivingAnimations(var1, var2, var3, var4); ++ /** ++ * Used for easily adding entity-dependent animations. The second and third float params here are the same second and ++ * third as in the setRotationAngles method. ++ */ ++ public void setLivingAnimations(EntityLivingBase par1EntityLivingBase, float par2, float par3, float par4) { ++ this.aimedBow = ((EntitySkeleton)par1EntityLivingBase).getSkeletonType() == 1; ++ super.setLivingAnimations(par1EntityLivingBase, par2, par3, par4); + } + +- public void setRotationAngles(float var1, float var2, float var3, float var4, float var5, float var6, Entity var7) { +- super.setRotationAngles(var1, var2, var3, var4, var5, var6, var7); ++ /** ++ * Sets the model's various rotation angles. For bipeds, par1 and par2 are used for animating the movement of arms and ++ * legs, where par1 represents the time(so that arms and legs swing back and forth) and par2 represents how "far" arms ++ * and legs can swing at most. ++ */ ++ public void setRotationAngles(float par1, float par2, float par3, float par4, float par5, float par6, Entity par7Entity) { ++ super.setRotationAngles(par1, par2, par3, par4, par5, par6, par7Entity); + } + } diff --git a/patches/net/minecraft/src/ModelSkeletonHead.java.patch b/patches/net/minecraft/src/ModelSkeletonHead.java.patch new file mode 100644 index 0000000..20e93b2 --- /dev/null +++ b/patches/net/minecraft/src/ModelSkeletonHead.java.patch @@ -0,0 +1,44 @@ +--- net/minecraft/src/ModelSkeletonHead.java ++++ net/minecraft/src/ModelSkeletonHead.java +@@ -7,22 +7,30 @@ + this(0, 35, 64, 64); + } + +- public ModelSkeletonHead(int var1, int var2, int var3, int var4) { +- this.textureWidth = var3; +- this.textureHeight = var4; +- this.skeletonHead = new ModelRenderer(this, var1, var2); ++ public ModelSkeletonHead(int par1, int par2, int par3, int par4) { ++ this.textureWidth = par3; ++ this.textureHeight = par4; ++ this.skeletonHead = new ModelRenderer(this, par1, par2); + this.skeletonHead.addBox(-4.0F, -8.0F, -4.0F, 8, 8, 8, 0.0F); + this.skeletonHead.setRotationPoint(0.0F, 0.0F, 0.0F); + } + +- public void render(Entity var1, float var2, float var3, float var4, float var5, float var6, float var7) { +- this.setRotationAngles(var2, var3, var4, var5, var6, var7, var1); +- this.skeletonHead.render(var7); ++ /** ++ * Sets the models various rotation angles then renders the model. ++ */ ++ public void render(Entity par1Entity, float par2, float par3, float par4, float par5, float par6, float par7) { ++ this.setRotationAngles(par2, par3, par4, par5, par6, par7, par1Entity); ++ this.skeletonHead.render(par7); + } + +- public void setRotationAngles(float var1, float var2, float var3, float var4, float var5, float var6, Entity var7) { +- super.setRotationAngles(var1, var2, var3, var4, var5, var6, var7); +- this.skeletonHead.rotateAngleY = var4 / (180.0F / (float)Math.PI); +- this.skeletonHead.rotateAngleX = var5 / (180.0F / (float)Math.PI); ++ /** ++ * Sets the model's various rotation angles. For bipeds, par1 and par2 are used for animating the movement of arms and ++ * legs, where par1 represents the time(so that arms and legs swing back and forth) and par2 represents how "far" arms ++ * and legs can swing at most. ++ */ ++ public void setRotationAngles(float par1, float par2, float par3, float par4, float par5, float par6, Entity par7Entity) { ++ super.setRotationAngles(par1, par2, par3, par4, par5, par6, par7Entity); ++ this.skeletonHead.rotateAngleY = par4 / (180F / (float)Math.PI); ++ this.skeletonHead.rotateAngleX = par5 / (180F / (float)Math.PI); + } + } diff --git a/patches/net/minecraft/src/ModelSlime.java.patch b/patches/net/minecraft/src/ModelSlime.java.patch new file mode 100644 index 0000000..8b6fd9b --- /dev/null +++ b/patches/net/minecraft/src/ModelSlime.java.patch @@ -0,0 +1,61 @@ +--- net/minecraft/src/ModelSlime.java ++++ net/minecraft/src/ModelSlime.java +@@ -1,16 +1,25 @@ + package net.minecraft.src; + + public class ModelSlime extends ModelBase { ++ ++ /** The slime's bodies, both the inside box and the outside box */ + ModelRenderer slimeBodies; ++ ++ /** The slime's right eye */ + ModelRenderer slimeRightEye; ++ ++ /** The slime's left eye */ + ModelRenderer slimeLeftEye; ++ ++ /** The slime's mouth */ + ModelRenderer slimeMouth; + +- public ModelSlime(int var1) { +- this.slimeBodies = new ModelRenderer(this, 0, var1); ++ public ModelSlime(int par1) { ++ this.slimeBodies = new ModelRenderer(this, 0, par1); + this.slimeBodies.addBox(-4.0F, 16.0F, -4.0F, 8, 8, 8); +- if(var1 > 0) { +- this.slimeBodies = new ModelRenderer(this, 0, var1); ++ ++ if (par1 > 0) { ++ this.slimeBodies = new ModelRenderer(this, 0, par1); + this.slimeBodies.addBox(-3.0F, 17.0F, -3.0F, 6, 6, 6); + this.slimeRightEye = new ModelRenderer(this, 32, 0); + this.slimeRightEye.addBox(-3.25F, 18.0F, -3.5F, 2, 2, 2); +@@ -19,17 +28,19 @@ + this.slimeMouth = new ModelRenderer(this, 32, 8); + this.slimeMouth.addBox(0.0F, 21.0F, -3.5F, 1, 1, 1); + } +- + } + +- public void render(Entity var1, float var2, float var3, float var4, float var5, float var6, float var7) { +- this.setRotationAngles(var2, var3, var4, var5, var6, var7, var1); +- this.slimeBodies.render(var7); +- if(this.slimeRightEye != null) { +- this.slimeRightEye.render(var7); +- this.slimeLeftEye.render(var7); +- this.slimeMouth.render(var7); +- } ++ /** ++ * Sets the models various rotation angles then renders the model. ++ */ ++ public void render(Entity par1Entity, float par2, float par3, float par4, float par5, float par6, float par7) { ++ this.setRotationAngles(par2, par3, par4, par5, par6, par7, par1Entity); ++ this.slimeBodies.render(par7); + ++ if (this.slimeRightEye != null) { ++ this.slimeRightEye.render(par7); ++ this.slimeLeftEye.render(par7); ++ this.slimeMouth.render(par7); ++ } + } + } diff --git a/patches/net/minecraft/src/ModelSnowMan.java.patch b/patches/net/minecraft/src/ModelSnowMan.java.patch new file mode 100644 index 0000000..ebe66b7 --- /dev/null +++ b/patches/net/minecraft/src/ModelSnowMan.java.patch @@ -0,0 +1,47 @@ +--- net/minecraft/src/ModelSnowMan.java ++++ net/minecraft/src/ModelSnowMan.java +@@ -27,11 +27,16 @@ + this.bottomBody.setRotationPoint(0.0F, 0.0F + var1 + 20.0F, 0.0F); + } + +- public void setRotationAngles(float var1, float var2, float var3, float var4, float var5, float var6, Entity var7) { +- super.setRotationAngles(var1, var2, var3, var4, var5, var6, var7); +- this.head.rotateAngleY = var4 / (180.0F / (float)Math.PI); +- this.head.rotateAngleX = var5 / (180.0F / (float)Math.PI); +- this.body.rotateAngleY = var4 / (180.0F / (float)Math.PI) * 0.25F; ++ /** ++ * Sets the model's various rotation angles. For bipeds, par1 and par2 are used for animating the movement of arms and ++ * legs, where par1 represents the time(so that arms and legs swing back and forth) and par2 represents how "far" arms ++ * and legs can swing at most. ++ */ ++ public void setRotationAngles(float par1, float par2, float par3, float par4, float par5, float par6, Entity par7Entity) { ++ super.setRotationAngles(par1, par2, par3, par4, par5, par6, par7Entity); ++ this.head.rotateAngleY = par4 / (180F / (float)Math.PI); ++ this.head.rotateAngleX = par5 / (180F / (float)Math.PI); ++ this.body.rotateAngleY = par4 / (180F / (float)Math.PI) * 0.25F; + float var8 = MathHelper.sin(this.body.rotateAngleY); + float var9 = MathHelper.cos(this.body.rotateAngleY); + this.rightHand.rotateAngleZ = 1.0F; +@@ -44,12 +49,15 @@ + this.leftHand.rotationPointZ = var8 * 5.0F; + } + +- public void render(Entity var1, float var2, float var3, float var4, float var5, float var6, float var7) { +- this.setRotationAngles(var2, var3, var4, var5, var6, var7, var1); +- this.body.render(var7); +- this.bottomBody.render(var7); +- this.head.render(var7); +- this.rightHand.render(var7); +- this.leftHand.render(var7); ++ /** ++ * Sets the models various rotation angles then renders the model. ++ */ ++ public void render(Entity par1Entity, float par2, float par3, float par4, float par5, float par6, float par7) { ++ this.setRotationAngles(par2, par3, par4, par5, par6, par7, par1Entity); ++ this.body.render(par7); ++ this.bottomBody.render(par7); ++ this.head.render(par7); ++ this.rightHand.render(par7); ++ this.leftHand.render(par7); + } + } diff --git a/patches/net/minecraft/src/ModelSpider.java.patch b/patches/net/minecraft/src/ModelSpider.java.patch new file mode 100644 index 0000000..69dc292 --- /dev/null +++ b/patches/net/minecraft/src/ModelSpider.java.patch @@ -0,0 +1,124 @@ +--- net/minecraft/src/ModelSpider.java ++++ net/minecraft/src/ModelSpider.java +@@ -1,16 +1,38 @@ + package net.minecraft.src; + + public class ModelSpider extends ModelBase { ++ ++ /** The spider's head box */ + public ModelRenderer spiderHead; ++ ++ /** The spider's neck box */ + public ModelRenderer spiderNeck; ++ ++ /** The spider's body box */ + public ModelRenderer spiderBody; ++ ++ /** Spider's first leg */ + public ModelRenderer spiderLeg1; ++ ++ /** Spider's second leg */ + public ModelRenderer spiderLeg2; ++ ++ /** Spider's third leg */ + public ModelRenderer spiderLeg3; ++ ++ /** Spider's fourth leg */ + public ModelRenderer spiderLeg4; ++ ++ /** Spider's fifth leg */ + public ModelRenderer spiderLeg5; ++ ++ /** Spider's sixth leg */ + public ModelRenderer spiderLeg6; ++ ++ /** Spider's seventh leg */ + public ModelRenderer spiderLeg7; ++ ++ /** Spider's eight leg */ + public ModelRenderer spiderLeg8; + + public ModelSpider() { +@@ -51,25 +73,33 @@ + this.spiderLeg8.setRotationPoint(4.0F, (float)var2, -1.0F); + } + +- public void render(Entity var1, float var2, float var3, float var4, float var5, float var6, float var7) { +- this.setRotationAngles(var2, var3, var4, var5, var6, var7, var1); +- this.spiderHead.render(var7); +- this.spiderNeck.render(var7); +- this.spiderBody.render(var7); +- this.spiderLeg1.render(var7); +- this.spiderLeg2.render(var7); +- this.spiderLeg3.render(var7); +- this.spiderLeg4.render(var7); +- this.spiderLeg5.render(var7); +- this.spiderLeg6.render(var7); +- this.spiderLeg7.render(var7); +- this.spiderLeg8.render(var7); ++ /** ++ * Sets the models various rotation angles then renders the model. ++ */ ++ public void render(Entity par1Entity, float par2, float par3, float par4, float par5, float par6, float par7) { ++ this.setRotationAngles(par2, par3, par4, par5, par6, par7, par1Entity); ++ this.spiderHead.render(par7); ++ this.spiderNeck.render(par7); ++ this.spiderBody.render(par7); ++ this.spiderLeg1.render(par7); ++ this.spiderLeg2.render(par7); ++ this.spiderLeg3.render(par7); ++ this.spiderLeg4.render(par7); ++ this.spiderLeg5.render(par7); ++ this.spiderLeg6.render(par7); ++ this.spiderLeg7.render(par7); ++ this.spiderLeg8.render(par7); + } + +- public void setRotationAngles(float var1, float var2, float var3, float var4, float var5, float var6, Entity var7) { +- this.spiderHead.rotateAngleY = var4 / (180.0F / (float)Math.PI); +- this.spiderHead.rotateAngleX = var5 / (180.0F / (float)Math.PI); +- float var8 = (float)Math.PI * 0.25F; ++ /** ++ * Sets the model's various rotation angles. For bipeds, par1 and par2 are used for animating the movement of arms and ++ * legs, where par1 represents the time(so that arms and legs swing back and forth) and par2 represents how "far" arms ++ * and legs can swing at most. ++ */ ++ public void setRotationAngles(float par1, float par2, float par3, float par4, float par5, float par6, Entity par7Entity) { ++ this.spiderHead.rotateAngleY = par4 / (180F / (float)Math.PI); ++ this.spiderHead.rotateAngleX = par5 / (180F / (float)Math.PI); ++ float var8 = ((float)Math.PI / 4F); + this.spiderLeg1.rotateAngleZ = -var8; + this.spiderLeg2.rotateAngleZ = var8; + this.spiderLeg3.rotateAngleZ = -var8 * 0.74F; +@@ -79,7 +109,7 @@ + this.spiderLeg7.rotateAngleZ = -var8; + this.spiderLeg8.rotateAngleZ = var8; + float var9 = -0.0F; +- float var10 = (float)Math.PI * 0.125F; ++ float var10 = 0.3926991F; + this.spiderLeg1.rotateAngleY = var10 * 2.0F + var9; + this.spiderLeg2.rotateAngleY = -var10 * 2.0F - var9; + this.spiderLeg3.rotateAngleY = var10 * 1.0F + var9; +@@ -88,14 +118,14 @@ + this.spiderLeg6.rotateAngleY = var10 * 1.0F - var9; + this.spiderLeg7.rotateAngleY = -var10 * 2.0F + var9; + this.spiderLeg8.rotateAngleY = var10 * 2.0F - var9; +- float var11 = -(MathHelper.cos(var1 * 0.6662F * 2.0F + 0.0F) * 0.4F) * var2; +- float var12 = -(MathHelper.cos(var1 * 0.6662F * 2.0F + (float)Math.PI) * 0.4F) * var2; +- float var13 = -(MathHelper.cos(var1 * 0.6662F * 2.0F + (float)Math.PI * 0.5F) * 0.4F) * var2; +- float var14 = -(MathHelper.cos(var1 * 0.6662F * 2.0F + (float)Math.PI * 3.0F / 2.0F) * 0.4F) * var2; +- float var15 = Math.abs(MathHelper.sin(var1 * 0.6662F + 0.0F) * 0.4F) * var2; +- float var16 = Math.abs(MathHelper.sin(var1 * 0.6662F + (float)Math.PI) * 0.4F) * var2; +- float var17 = Math.abs(MathHelper.sin(var1 * 0.6662F + (float)Math.PI * 0.5F) * 0.4F) * var2; +- float var18 = Math.abs(MathHelper.sin(var1 * 0.6662F + (float)Math.PI * 3.0F / 2.0F) * 0.4F) * var2; ++ float var11 = -(MathHelper.cos(par1 * 0.6662F * 2.0F + 0.0F) * 0.4F) * par2; ++ float var12 = -(MathHelper.cos(par1 * 0.6662F * 2.0F + (float)Math.PI) * 0.4F) * par2; ++ float var13 = -(MathHelper.cos(par1 * 0.6662F * 2.0F + ((float)Math.PI / 2F)) * 0.4F) * par2; ++ float var14 = -(MathHelper.cos(par1 * 0.6662F * 2.0F + ((float)Math.PI * 3F / 2F)) * 0.4F) * par2; ++ float var15 = Math.abs(MathHelper.sin(par1 * 0.6662F + 0.0F) * 0.4F) * par2; ++ float var16 = Math.abs(MathHelper.sin(par1 * 0.6662F + (float)Math.PI) * 0.4F) * par2; ++ float var17 = Math.abs(MathHelper.sin(par1 * 0.6662F + ((float)Math.PI / 2F)) * 0.4F) * par2; ++ float var18 = Math.abs(MathHelper.sin(par1 * 0.6662F + ((float)Math.PI * 3F / 2F)) * 0.4F) * par2; + this.spiderLeg1.rotateAngleY += var11; + this.spiderLeg2.rotateAngleY += -var11; + this.spiderLeg3.rotateAngleY += var12; diff --git a/patches/net/minecraft/src/ModelSquid.java.patch b/patches/net/minecraft/src/ModelSquid.java.patch new file mode 100644 index 0000000..6c18bcf --- /dev/null +++ b/patches/net/minecraft/src/ModelSquid.java.patch @@ -0,0 +1,71 @@ +--- net/minecraft/src/ModelSquid.java ++++ net/minecraft/src/ModelSquid.java +@@ -1,7 +1,11 @@ + package net.minecraft.src; + + public class ModelSquid extends ModelBase { ++ ++ /** The squid's body */ + ModelRenderer squidBody; ++ ++ /** The squid's tentacles */ + ModelRenderer[] squidTentacles = new ModelRenderer[8]; + + public ModelSquid() { +@@ -10,7 +14,7 @@ + this.squidBody.addBox(-6.0F, -8.0F, -6.0F, 12, 16, 12); + this.squidBody.rotationPointY += (float)(24 + var1); + +- for(int var2 = 0; var2 < this.squidTentacles.length; ++var2) { ++ for (int var2 = 0; var2 < this.squidTentacles.length; ++var2) { + this.squidTentacles[var2] = new ModelRenderer(this, 48, 0); + double var3 = (double)var2 * Math.PI * 2.0D / (double)this.squidTentacles.length; + float var5 = (float)Math.cos(var3) * 5.0F; +@@ -19,30 +23,35 @@ + this.squidTentacles[var2].rotationPointX = var5; + this.squidTentacles[var2].rotationPointZ = var6; + this.squidTentacles[var2].rotationPointY = (float)(31 + var1); +- var3 = (double)var2 * Math.PI * -2.0D / (double)this.squidTentacles.length + Math.PI * 0.5D; ++ var3 = (double)var2 * Math.PI * -2.0D / (double)this.squidTentacles.length + (Math.PI / 2D); + this.squidTentacles[var2].rotateAngleY = (float)var3; + } +- + } + +- public void setRotationAngles(float var1, float var2, float var3, float var4, float var5, float var6, Entity var7) { ++ /** ++ * Sets the model's various rotation angles. For bipeds, par1 and par2 are used for animating the movement of arms and ++ * legs, where par1 represents the time(so that arms and legs swing back and forth) and par2 represents how "far" arms ++ * and legs can swing at most. ++ */ ++ public void setRotationAngles(float par1, float par2, float par3, float par4, float par5, float par6, Entity par7Entity) { + ModelRenderer[] var8 = this.squidTentacles; + int var9 = var8.length; + +- for(int var10 = 0; var10 < var9; ++var10) { ++ for (int var10 = 0; var10 < var9; ++var10) { + ModelRenderer var11 = var8[var10]; +- var11.rotateAngleX = var3; ++ var11.rotateAngleX = par3; + } +- + } + +- public void render(Entity var1, float var2, float var3, float var4, float var5, float var6, float var7) { +- this.setRotationAngles(var2, var3, var4, var5, var6, var7, var1); +- this.squidBody.render(var7); ++ /** ++ * Sets the models various rotation angles then renders the model. ++ */ ++ public void render(Entity par1Entity, float par2, float par3, float par4, float par5, float par6, float par7) { ++ this.setRotationAngles(par2, par3, par4, par5, par6, par7, par1Entity); ++ this.squidBody.render(par7); + +- for(int var8 = 0; var8 < this.squidTentacles.length; ++var8) { +- this.squidTentacles[var8].render(var7); ++ for (int var8 = 0; var8 < this.squidTentacles.length; ++var8) { ++ this.squidTentacles[var8].render(par7); + } +- + } + } diff --git a/patches/net/minecraft/src/ModelVillager.java.patch b/patches/net/minecraft/src/ModelVillager.java.patch new file mode 100644 index 0000000..e9509fd --- /dev/null +++ b/patches/net/minecraft/src/ModelVillager.java.patch @@ -0,0 +1,122 @@ +--- net/minecraft/src/ModelVillager.java ++++ net/minecraft/src/ModelVillager.java +@@ -1,60 +1,78 @@ + package net.minecraft.src; + + public class ModelVillager extends ModelBase { ++ ++ /** The head box of the VillagerModel */ + public ModelRenderer villagerHead; ++ ++ /** The body of the VillagerModel */ + public ModelRenderer villagerBody; ++ ++ /** The arms of the VillagerModel */ + public ModelRenderer villagerArms; ++ ++ /** The right leg of the VillagerModel */ + public ModelRenderer rightVillagerLeg; ++ ++ /** The left leg of the VillagerModel */ + public ModelRenderer leftVillagerLeg; + public ModelRenderer villagerNose; + +- public ModelVillager(float var1) { +- this(var1, 0.0F, 64, 64); ++ public ModelVillager(float par1) { ++ this(par1, 0.0F, 64, 64); + } + +- public ModelVillager(float var1, float var2, int var3, int var4) { +- this.villagerHead = (new ModelRenderer(this)).setTextureSize(var3, var4); +- this.villagerHead.setRotationPoint(0.0F, 0.0F + var2, 0.0F); +- this.villagerHead.setTextureOffset(0, 0).addBox(-4.0F, -10.0F, -4.0F, 8, 10, 8, var1); +- this.villagerNose = (new ModelRenderer(this)).setTextureSize(var3, var4); +- this.villagerNose.setRotationPoint(0.0F, var2 - 2.0F, 0.0F); +- this.villagerNose.setTextureOffset(24, 0).addBox(-1.0F, -1.0F, -6.0F, 2, 4, 2, var1); ++ public ModelVillager(float par1, float par2, int par3, int par4) { ++ this.villagerHead = (new ModelRenderer(this)).setTextureSize(par3, par4); ++ this.villagerHead.setRotationPoint(0.0F, 0.0F + par2, 0.0F); ++ this.villagerHead.setTextureOffset(0, 0).addBox(-4.0F, -10.0F, -4.0F, 8, 10, 8, par1); ++ this.villagerNose = (new ModelRenderer(this)).setTextureSize(par3, par4); ++ this.villagerNose.setRotationPoint(0.0F, par2 - 2.0F, 0.0F); ++ this.villagerNose.setTextureOffset(24, 0).addBox(-1.0F, -1.0F, -6.0F, 2, 4, 2, par1); + this.villagerHead.addChild(this.villagerNose); +- this.villagerBody = (new ModelRenderer(this)).setTextureSize(var3, var4); +- this.villagerBody.setRotationPoint(0.0F, 0.0F + var2, 0.0F); +- this.villagerBody.setTextureOffset(16, 20).addBox(-4.0F, 0.0F, -3.0F, 8, 12, 6, var1); +- this.villagerBody.setTextureOffset(0, 38).addBox(-4.0F, 0.0F, -3.0F, 8, 18, 6, var1 + 0.5F); +- this.villagerArms = (new ModelRenderer(this)).setTextureSize(var3, var4); +- this.villagerArms.setRotationPoint(0.0F, 0.0F + var2 + 2.0F, 0.0F); +- this.villagerArms.setTextureOffset(44, 22).addBox(-8.0F, -2.0F, -2.0F, 4, 8, 4, var1); +- this.villagerArms.setTextureOffset(44, 22).addBox(4.0F, -2.0F, -2.0F, 4, 8, 4, var1); +- this.villagerArms.setTextureOffset(40, 38).addBox(-4.0F, 2.0F, -2.0F, 8, 4, 4, var1); +- this.rightVillagerLeg = (new ModelRenderer(this, 0, 22)).setTextureSize(var3, var4); +- this.rightVillagerLeg.setRotationPoint(-2.0F, 12.0F + var2, 0.0F); +- this.rightVillagerLeg.addBox(-2.0F, 0.0F, -2.0F, 4, 12, 4, var1); +- this.leftVillagerLeg = (new ModelRenderer(this, 0, 22)).setTextureSize(var3, var4); ++ this.villagerBody = (new ModelRenderer(this)).setTextureSize(par3, par4); ++ this.villagerBody.setRotationPoint(0.0F, 0.0F + par2, 0.0F); ++ this.villagerBody.setTextureOffset(16, 20).addBox(-4.0F, 0.0F, -3.0F, 8, 12, 6, par1); ++ this.villagerBody.setTextureOffset(0, 38).addBox(-4.0F, 0.0F, -3.0F, 8, 18, 6, par1 + 0.5F); ++ this.villagerArms = (new ModelRenderer(this)).setTextureSize(par3, par4); ++ this.villagerArms.setRotationPoint(0.0F, 0.0F + par2 + 2.0F, 0.0F); ++ this.villagerArms.setTextureOffset(44, 22).addBox(-8.0F, -2.0F, -2.0F, 4, 8, 4, par1); ++ this.villagerArms.setTextureOffset(44, 22).addBox(4.0F, -2.0F, -2.0F, 4, 8, 4, par1); ++ this.villagerArms.setTextureOffset(40, 38).addBox(-4.0F, 2.0F, -2.0F, 8, 4, 4, par1); ++ this.rightVillagerLeg = (new ModelRenderer(this, 0, 22)).setTextureSize(par3, par4); ++ this.rightVillagerLeg.setRotationPoint(-2.0F, 12.0F + par2, 0.0F); ++ this.rightVillagerLeg.addBox(-2.0F, 0.0F, -2.0F, 4, 12, 4, par1); ++ this.leftVillagerLeg = (new ModelRenderer(this, 0, 22)).setTextureSize(par3, par4); + this.leftVillagerLeg.mirror = true; +- this.leftVillagerLeg.setRotationPoint(2.0F, 12.0F + var2, 0.0F); +- this.leftVillagerLeg.addBox(-2.0F, 0.0F, -2.0F, 4, 12, 4, var1); +- } +- +- public void render(Entity var1, float var2, float var3, float var4, float var5, float var6, float var7) { +- this.setRotationAngles(var2, var3, var4, var5, var6, var7, var1); +- this.villagerHead.render(var7); +- this.villagerBody.render(var7); +- this.rightVillagerLeg.render(var7); +- this.leftVillagerLeg.render(var7); +- this.villagerArms.render(var7); +- } +- +- public void setRotationAngles(float var1, float var2, float var3, float var4, float var5, float var6, Entity var7) { +- this.villagerHead.rotateAngleY = var4 / (180.0F / (float)Math.PI); +- this.villagerHead.rotateAngleX = var5 / (180.0F / (float)Math.PI); ++ this.leftVillagerLeg.setRotationPoint(2.0F, 12.0F + par2, 0.0F); ++ this.leftVillagerLeg.addBox(-2.0F, 0.0F, -2.0F, 4, 12, 4, par1); ++ } ++ ++ /** ++ * Sets the models various rotation angles then renders the model. ++ */ ++ public void render(Entity par1Entity, float par2, float par3, float par4, float par5, float par6, float par7) { ++ this.setRotationAngles(par2, par3, par4, par5, par6, par7, par1Entity); ++ this.villagerHead.render(par7); ++ this.villagerBody.render(par7); ++ this.rightVillagerLeg.render(par7); ++ this.leftVillagerLeg.render(par7); ++ this.villagerArms.render(par7); ++ } ++ ++ /** ++ * Sets the model's various rotation angles. For bipeds, par1 and par2 are used for animating the movement of arms and ++ * legs, where par1 represents the time(so that arms and legs swing back and forth) and par2 represents how "far" arms ++ * and legs can swing at most. ++ */ ++ public void setRotationAngles(float par1, float par2, float par3, float par4, float par5, float par6, Entity par7Entity) { ++ this.villagerHead.rotateAngleY = par4 / (180F / (float)Math.PI); ++ this.villagerHead.rotateAngleX = par5 / (180F / (float)Math.PI); + this.villagerArms.rotationPointY = 3.0F; + this.villagerArms.rotationPointZ = -1.0F; +- this.villagerArms.rotateAngleX = -(12.0F / 16.0F); +- this.rightVillagerLeg.rotateAngleX = MathHelper.cos(var1 * 0.6662F) * 1.4F * var2 * 0.5F; +- this.leftVillagerLeg.rotateAngleX = MathHelper.cos(var1 * 0.6662F + (float)Math.PI) * 1.4F * var2 * 0.5F; ++ this.villagerArms.rotateAngleX = -0.75F; ++ this.rightVillagerLeg.rotateAngleX = MathHelper.cos(par1 * 0.6662F) * 1.4F * par2 * 0.5F; ++ this.leftVillagerLeg.rotateAngleX = MathHelper.cos(par1 * 0.6662F + (float)Math.PI) * 1.4F * par2 * 0.5F; + this.rightVillagerLeg.rotateAngleY = 0.0F; + this.leftVillagerLeg.rotateAngleY = 0.0F; + } diff --git a/patches/net/minecraft/src/ModelWitch.java.patch b/patches/net/minecraft/src/ModelWitch.java.patch new file mode 100644 index 0000000..9d7d526 --- /dev/null +++ b/patches/net/minecraft/src/ModelWitch.java.patch @@ -0,0 +1,45 @@ +--- net/minecraft/src/ModelWitch.java ++++ net/minecraft/src/ModelWitch.java +@@ -5,8 +5,8 @@ + private ModelRenderer field_82901_h = (new ModelRenderer(this)).setTextureSize(64, 128); + private ModelRenderer witchHat; + +- public ModelWitch(float var1) { +- super(var1, 0.0F, 64, 128); ++ public ModelWitch(float par1) { ++ super(par1, 0.0F, 64, 128); + this.field_82901_h.setRotationPoint(0.0F, -2.0F, 0.0F); + this.field_82901_h.setTextureOffset(0, 0).addBox(0.0F, 3.0F, -6.75F, 1, 1, 1, -0.25F); + this.villagerNose.addChild(this.field_82901_h); +@@ -34,18 +34,23 @@ + var3.addChild(var4); + } + +- public void setRotationAngles(float var1, float var2, float var3, float var4, float var5, float var6, Entity var7) { +- super.setRotationAngles(var1, var2, var3, var4, var5, var6, var7); ++ /** ++ * Sets the model's various rotation angles. For bipeds, par1 and par2 are used for animating the movement of arms and ++ * legs, where par1 represents the time(so that arms and legs swing back and forth) and par2 represents how "far" arms ++ * and legs can swing at most. ++ */ ++ public void setRotationAngles(float par1, float par2, float par3, float par4, float par5, float par6, Entity par7Entity) { ++ super.setRotationAngles(par1, par2, par3, par4, par5, par6, par7Entity); + this.villagerNose.offsetX = this.villagerNose.offsetY = this.villagerNose.offsetZ = 0.0F; +- float var8 = 0.01F * (float)(var7.entityId % 10); +- this.villagerNose.rotateAngleX = MathHelper.sin((float)var7.ticksExisted * var8) * 4.5F * (float)Math.PI / 180.0F; ++ float var8 = 0.01F * (float)(par7Entity.entityId % 10); ++ this.villagerNose.rotateAngleX = MathHelper.sin((float)par7Entity.ticksExisted * var8) * 4.5F * (float)Math.PI / 180.0F; + this.villagerNose.rotateAngleY = 0.0F; +- this.villagerNose.rotateAngleZ = MathHelper.cos((float)var7.ticksExisted * var8) * 2.5F * (float)Math.PI / 180.0F; +- if(this.field_82900_g) { ++ this.villagerNose.rotateAngleZ = MathHelper.cos((float)par7Entity.ticksExisted * var8) * 2.5F * (float)Math.PI / 180.0F; ++ ++ if (this.field_82900_g) { + this.villagerNose.rotateAngleX = -0.9F; + this.villagerNose.offsetZ = -0.09375F; +- this.villagerNose.offsetY = 3.0F / 16.0F; ++ this.villagerNose.offsetY = 0.1875F; + } +- + } + } diff --git a/patches/net/minecraft/src/ModelWither.java.patch b/patches/net/minecraft/src/ModelWither.java.patch new file mode 100644 index 0000000..ab1eb24 --- /dev/null +++ b/patches/net/minecraft/src/ModelWither.java.patch @@ -0,0 +1,75 @@ +--- net/minecraft/src/ModelWither.java ++++ net/minecraft/src/ModelWither.java +@@ -35,44 +35,54 @@ + return 32; + } + +- public void render(Entity var1, float var2, float var3, float var4, float var5, float var6, float var7) { +- this.setRotationAngles(var2, var3, var4, var5, var6, var7, var1); ++ /** ++ * Sets the models various rotation angles then renders the model. ++ */ ++ public void render(Entity par1Entity, float par2, float par3, float par4, float par5, float par6, float par7) { ++ this.setRotationAngles(par2, par3, par4, par5, par6, par7, par1Entity); + ModelRenderer[] var8 = this.field_82904_b; + int var9 = var8.length; +- + int var10; + ModelRenderer var11; +- for(var10 = 0; var10 < var9; ++var10) { ++ ++ for (var10 = 0; var10 < var9; ++var10) { + var11 = var8[var10]; +- var11.render(var7); ++ var11.render(par7); + } + + var8 = this.field_82905_a; + var9 = var8.length; + +- for(var10 = 0; var10 < var9; ++var10) { ++ for (var10 = 0; var10 < var9; ++var10) { + var11 = var8[var10]; +- var11.render(var7); ++ var11.render(par7); + } +- + } + +- public void setRotationAngles(float var1, float var2, float var3, float var4, float var5, float var6, Entity var7) { +- float var8 = MathHelper.cos(var3 * 0.1F); ++ /** ++ * Sets the model's various rotation angles. For bipeds, par1 and par2 are used for animating the movement of arms and ++ * legs, where par1 represents the time(so that arms and legs swing back and forth) and par2 represents how "far" arms ++ * and legs can swing at most. ++ */ ++ public void setRotationAngles(float par1, float par2, float par3, float par4, float par5, float par6, Entity par7Entity) { ++ float var8 = MathHelper.cos(par3 * 0.1F); + this.field_82905_a[1].rotateAngleX = (0.065F + 0.05F * var8) * (float)Math.PI; + this.field_82905_a[2].setRotationPoint(-2.0F, 6.9F + MathHelper.cos(this.field_82905_a[1].rotateAngleX) * 10.0F, -0.5F + MathHelper.sin(this.field_82905_a[1].rotateAngleX) * 10.0F); + this.field_82905_a[2].rotateAngleX = (0.265F + 0.1F * var8) * (float)Math.PI; +- this.field_82904_b[0].rotateAngleY = var4 / (180.0F / (float)Math.PI); +- this.field_82904_b[0].rotateAngleX = var5 / (180.0F / (float)Math.PI); ++ this.field_82904_b[0].rotateAngleY = par4 / (180F / (float)Math.PI); ++ this.field_82904_b[0].rotateAngleX = par5 / (180F / (float)Math.PI); + } + +- public void setLivingAnimations(EntityLivingBase var1, float var2, float var3, float var4) { +- EntityWither var5 = (EntityWither)var1; ++ /** ++ * Used for easily adding entity-dependent animations. The second and third float params here are the same second and ++ * third as in the setRotationAngles method. ++ */ ++ public void setLivingAnimations(EntityLivingBase par1EntityLivingBase, float par2, float par3, float par4) { ++ EntityWither var5 = (EntityWither)par1EntityLivingBase; + +- for(int var6 = 1; var6 < 3; ++var6) { +- this.field_82904_b[var6].rotateAngleY = (var5.func_82207_a(var6 - 1) - var1.renderYawOffset) / (180.0F / (float)Math.PI); +- this.field_82904_b[var6].rotateAngleX = var5.func_82210_r(var6 - 1) / (180.0F / (float)Math.PI); ++ for (int var6 = 1; var6 < 3; ++var6) { ++ this.field_82904_b[var6].rotateAngleY = (var5.func_82207_a(var6 - 1) - par1EntityLivingBase.renderYawOffset) / (180F / (float)Math.PI); ++ this.field_82904_b[var6].rotateAngleX = var5.func_82210_r(var6 - 1) / (180F / (float)Math.PI); + } +- + } + } diff --git a/patches/net/minecraft/src/ModelWolf.java.patch b/patches/net/minecraft/src/ModelWolf.java.patch new file mode 100644 index 0000000..a22fa60 --- /dev/null +++ b/patches/net/minecraft/src/ModelWolf.java.patch @@ -0,0 +1,182 @@ +--- net/minecraft/src/ModelWolf.java ++++ net/minecraft/src/ModelWolf.java +@@ -3,13 +3,29 @@ + import org.lwjgl.opengl.GL11; + + public class ModelWolf extends ModelBase { ++ ++ /** main box for the wolf head */ + public ModelRenderer wolfHeadMain; ++ ++ /** The wolf's body */ + public ModelRenderer wolfBody; ++ ++ /** Wolf'se first leg */ + public ModelRenderer wolfLeg1; ++ ++ /** Wolf's second leg */ + public ModelRenderer wolfLeg2; ++ ++ /** Wolf's third leg */ + public ModelRenderer wolfLeg3; ++ ++ /** Wolf's fourth leg */ + public ModelRenderer wolfLeg4; ++ ++ /** The wolf's tail */ + ModelRenderer wolfTail; ++ ++ /** The wolf's mane */ + ModelRenderer wolfMane; + + public ModelWolf() { +@@ -44,65 +60,73 @@ + this.wolfHeadMain.setTextureOffset(0, 10).addBox(-1.5F, 0.0F, -5.0F, 3, 3, 4, var1); + } + +- public void render(Entity var1, float var2, float var3, float var4, float var5, float var6, float var7) { +- super.render(var1, var2, var3, var4, var5, var6, var7); +- this.setRotationAngles(var2, var3, var4, var5, var6, var7, var1); +- if(this.isChild) { ++ /** ++ * Sets the models various rotation angles then renders the model. ++ */ ++ public void render(Entity par1Entity, float par2, float par3, float par4, float par5, float par6, float par7) { ++ super.render(par1Entity, par2, par3, par4, par5, par6, par7); ++ this.setRotationAngles(par2, par3, par4, par5, par6, par7, par1Entity); ++ ++ if (this.isChild) { + float var8 = 2.0F; + GL11.glPushMatrix(); +- GL11.glTranslatef(0.0F, 5.0F * var7, 2.0F * var7); +- this.wolfHeadMain.renderWithRotation(var7); ++ GL11.glTranslatef(0.0F, 5.0F * par7, 2.0F * par7); ++ this.wolfHeadMain.renderWithRotation(par7); + GL11.glPopMatrix(); + GL11.glPushMatrix(); + GL11.glScalef(1.0F / var8, 1.0F / var8, 1.0F / var8); +- GL11.glTranslatef(0.0F, 24.0F * var7, 0.0F); +- this.wolfBody.render(var7); +- this.wolfLeg1.render(var7); +- this.wolfLeg2.render(var7); +- this.wolfLeg3.render(var7); +- this.wolfLeg4.render(var7); +- this.wolfTail.renderWithRotation(var7); +- this.wolfMane.render(var7); ++ GL11.glTranslatef(0.0F, 24.0F * par7, 0.0F); ++ this.wolfBody.render(par7); ++ this.wolfLeg1.render(par7); ++ this.wolfLeg2.render(par7); ++ this.wolfLeg3.render(par7); ++ this.wolfLeg4.render(par7); ++ this.wolfTail.renderWithRotation(par7); ++ this.wolfMane.render(par7); + GL11.glPopMatrix(); + } else { +- this.wolfHeadMain.renderWithRotation(var7); +- this.wolfBody.render(var7); +- this.wolfLeg1.render(var7); +- this.wolfLeg2.render(var7); +- this.wolfLeg3.render(var7); +- this.wolfLeg4.render(var7); +- this.wolfTail.renderWithRotation(var7); +- this.wolfMane.render(var7); ++ this.wolfHeadMain.renderWithRotation(par7); ++ this.wolfBody.render(par7); ++ this.wolfLeg1.render(par7); ++ this.wolfLeg2.render(par7); ++ this.wolfLeg3.render(par7); ++ this.wolfLeg4.render(par7); ++ this.wolfTail.renderWithRotation(par7); ++ this.wolfMane.render(par7); + } +- + } + +- public void setLivingAnimations(EntityLivingBase var1, float var2, float var3, float var4) { +- EntityWolf var5 = (EntityWolf)var1; +- if(var5.isAngry()) { ++ /** ++ * Used for easily adding entity-dependent animations. The second and third float params here are the same second and ++ * third as in the setRotationAngles method. ++ */ ++ public void setLivingAnimations(EntityLivingBase par1EntityLivingBase, float par2, float par3, float par4) { ++ EntityWolf var5 = (EntityWolf)par1EntityLivingBase; ++ ++ if (var5.isAngry()) { + this.wolfTail.rotateAngleY = 0.0F; + } else { +- this.wolfTail.rotateAngleY = MathHelper.cos(var2 * 0.6662F) * 1.4F * var3; ++ this.wolfTail.rotateAngleY = MathHelper.cos(par2 * 0.6662F) * 1.4F * par3; + } + +- if(var5.isSitting()) { ++ if (var5.isSitting()) { + this.wolfMane.setRotationPoint(-1.0F, 16.0F, -3.0F); +- this.wolfMane.rotateAngleX = (float)Math.PI * 0.4F; ++ this.wolfMane.rotateAngleX = ((float)Math.PI * 2F / 5F); + this.wolfMane.rotateAngleY = 0.0F; + this.wolfBody.setRotationPoint(0.0F, 18.0F, 0.0F); +- this.wolfBody.rotateAngleX = (float)Math.PI * 0.25F; ++ this.wolfBody.rotateAngleX = ((float)Math.PI / 4F); + this.wolfTail.setRotationPoint(-1.0F, 21.0F, 6.0F); + this.wolfLeg1.setRotationPoint(-2.5F, 22.0F, 2.0F); +- this.wolfLeg1.rotateAngleX = (float)Math.PI * 3.0F / 2.0F; ++ this.wolfLeg1.rotateAngleX = ((float)Math.PI * 3F / 2F); + this.wolfLeg2.setRotationPoint(0.5F, 22.0F, 2.0F); +- this.wolfLeg2.rotateAngleX = (float)Math.PI * 3.0F / 2.0F; +- this.wolfLeg3.rotateAngleX = (float)Math.PI * 1.85F; ++ this.wolfLeg2.rotateAngleX = ((float)Math.PI * 3F / 2F); ++ this.wolfLeg3.rotateAngleX = 5.811947F; + this.wolfLeg3.setRotationPoint(-2.49F, 17.0F, -4.0F); +- this.wolfLeg4.rotateAngleX = (float)Math.PI * 1.85F; ++ this.wolfLeg4.rotateAngleX = 5.811947F; + this.wolfLeg4.setRotationPoint(0.51F, 17.0F, -4.0F); + } else { + this.wolfBody.setRotationPoint(0.0F, 14.0F, 2.0F); +- this.wolfBody.rotateAngleX = (float)Math.PI * 0.5F; ++ this.wolfBody.rotateAngleX = ((float)Math.PI / 2F); + this.wolfMane.setRotationPoint(-1.0F, 14.0F, -3.0F); + this.wolfMane.rotateAngleX = this.wolfBody.rotateAngleX; + this.wolfTail.setRotationPoint(-1.0F, 12.0F, 8.0F); +@@ -110,22 +134,27 @@ + this.wolfLeg2.setRotationPoint(0.5F, 16.0F, 7.0F); + this.wolfLeg3.setRotationPoint(-2.5F, 16.0F, -4.0F); + this.wolfLeg4.setRotationPoint(0.5F, 16.0F, -4.0F); +- this.wolfLeg1.rotateAngleX = MathHelper.cos(var2 * 0.6662F) * 1.4F * var3; +- this.wolfLeg2.rotateAngleX = MathHelper.cos(var2 * 0.6662F + (float)Math.PI) * 1.4F * var3; +- this.wolfLeg3.rotateAngleX = MathHelper.cos(var2 * 0.6662F + (float)Math.PI) * 1.4F * var3; +- this.wolfLeg4.rotateAngleX = MathHelper.cos(var2 * 0.6662F) * 1.4F * var3; ++ this.wolfLeg1.rotateAngleX = MathHelper.cos(par2 * 0.6662F) * 1.4F * par3; ++ this.wolfLeg2.rotateAngleX = MathHelper.cos(par2 * 0.6662F + (float)Math.PI) * 1.4F * par3; ++ this.wolfLeg3.rotateAngleX = MathHelper.cos(par2 * 0.6662F + (float)Math.PI) * 1.4F * par3; ++ this.wolfLeg4.rotateAngleX = MathHelper.cos(par2 * 0.6662F) * 1.4F * par3; + } + +- this.wolfHeadMain.rotateAngleZ = var5.getInterestedAngle(var4) + var5.getShakeAngle(var4, 0.0F); +- this.wolfMane.rotateAngleZ = var5.getShakeAngle(var4, -0.08F); +- this.wolfBody.rotateAngleZ = var5.getShakeAngle(var4, -0.16F); +- this.wolfTail.rotateAngleZ = var5.getShakeAngle(var4, -0.2F); ++ this.wolfHeadMain.rotateAngleZ = var5.getInterestedAngle(par4) + var5.getShakeAngle(par4, 0.0F); ++ this.wolfMane.rotateAngleZ = var5.getShakeAngle(par4, -0.08F); ++ this.wolfBody.rotateAngleZ = var5.getShakeAngle(par4, -0.16F); ++ this.wolfTail.rotateAngleZ = var5.getShakeAngle(par4, -0.2F); + } + +- public void setRotationAngles(float var1, float var2, float var3, float var4, float var5, float var6, Entity var7) { +- super.setRotationAngles(var1, var2, var3, var4, var5, var6, var7); +- this.wolfHeadMain.rotateAngleX = var5 / (180.0F / (float)Math.PI); +- this.wolfHeadMain.rotateAngleY = var4 / (180.0F / (float)Math.PI); +- this.wolfTail.rotateAngleX = var3; ++ /** ++ * Sets the model's various rotation angles. For bipeds, par1 and par2 are used for animating the movement of arms and ++ * legs, where par1 represents the time(so that arms and legs swing back and forth) and par2 represents how "far" arms ++ * and legs can swing at most. ++ */ ++ public void setRotationAngles(float par1, float par2, float par3, float par4, float par5, float par6, Entity par7Entity) { ++ super.setRotationAngles(par1, par2, par3, par4, par5, par6, par7Entity); ++ this.wolfHeadMain.rotateAngleX = par5 / (180F / (float)Math.PI); ++ this.wolfHeadMain.rotateAngleY = par4 / (180F / (float)Math.PI); ++ this.wolfTail.rotateAngleX = par3; + } + } diff --git a/patches/net/minecraft/src/ModelZombie.java.patch b/patches/net/minecraft/src/ModelZombie.java.patch new file mode 100644 index 0000000..87417bf --- /dev/null +++ b/patches/net/minecraft/src/ModelZombie.java.patch @@ -0,0 +1,53 @@ +--- net/minecraft/src/ModelZombie.java ++++ net/minecraft/src/ModelZombie.java +@@ -5,29 +5,34 @@ + this(0.0F, false); + } + +- protected ModelZombie(float var1, float var2, int var3, int var4) { +- super(var1, var2, var3, var4); +- } +- +- public ModelZombie(float var1, boolean var2) { +- super(var1, 0.0F, 64, var2 ? 32 : 64); +- } +- +- public void setRotationAngles(float var1, float var2, float var3, float var4, float var5, float var6, Entity var7) { +- super.setRotationAngles(var1, var2, var3, var4, var5, var6, var7); ++ protected ModelZombie(float par1, float par2, int par3, int par4) { ++ super(par1, par2, par3, par4); ++ } ++ ++ public ModelZombie(float par1, boolean par2) { ++ super(par1, 0.0F, 64, par2 ? 32 : 64); ++ } ++ ++ /** ++ * Sets the model's various rotation angles. For bipeds, par1 and par2 are used for animating the movement of arms and ++ * legs, where par1 represents the time(so that arms and legs swing back and forth) and par2 represents how "far" arms ++ * and legs can swing at most. ++ */ ++ public void setRotationAngles(float par1, float par2, float par3, float par4, float par5, float par6, Entity par7Entity) { ++ super.setRotationAngles(par1, par2, par3, par4, par5, par6, par7Entity); + float var8 = MathHelper.sin(this.onGround * (float)Math.PI); + float var9 = MathHelper.sin((1.0F - (1.0F - this.onGround) * (1.0F - this.onGround)) * (float)Math.PI); + this.bipedRightArm.rotateAngleZ = 0.0F; + this.bipedLeftArm.rotateAngleZ = 0.0F; + this.bipedRightArm.rotateAngleY = -(0.1F - var8 * 0.6F); + this.bipedLeftArm.rotateAngleY = 0.1F - var8 * 0.6F; +- this.bipedRightArm.rotateAngleX = (float)Math.PI * -0.5F; +- this.bipedLeftArm.rotateAngleX = (float)Math.PI * -0.5F; ++ this.bipedRightArm.rotateAngleX = -((float)Math.PI / 2F); ++ this.bipedLeftArm.rotateAngleX = -((float)Math.PI / 2F); + this.bipedRightArm.rotateAngleX -= var8 * 1.2F - var9 * 0.4F; + this.bipedLeftArm.rotateAngleX -= var8 * 1.2F - var9 * 0.4F; +- this.bipedRightArm.rotateAngleZ += MathHelper.cos(var3 * 0.09F) * 0.05F + 0.05F; +- this.bipedLeftArm.rotateAngleZ -= MathHelper.cos(var3 * 0.09F) * 0.05F + 0.05F; +- this.bipedRightArm.rotateAngleX += MathHelper.sin(var3 * 0.067F) * 0.05F; +- this.bipedLeftArm.rotateAngleX -= MathHelper.sin(var3 * 0.067F) * 0.05F; ++ this.bipedRightArm.rotateAngleZ += MathHelper.cos(par3 * 0.09F) * 0.05F + 0.05F; ++ this.bipedLeftArm.rotateAngleZ -= MathHelper.cos(par3 * 0.09F) * 0.05F + 0.05F; ++ this.bipedRightArm.rotateAngleX += MathHelper.sin(par3 * 0.067F) * 0.05F; ++ this.bipedLeftArm.rotateAngleX -= MathHelper.sin(par3 * 0.067F) * 0.05F; + } + } diff --git a/patches/net/minecraft/src/ModelZombieVillager.java.patch b/patches/net/minecraft/src/ModelZombieVillager.java.patch new file mode 100644 index 0000000..4846d18 --- /dev/null +++ b/patches/net/minecraft/src/ModelZombieVillager.java.patch @@ -0,0 +1,65 @@ +--- net/minecraft/src/ModelZombieVillager.java ++++ net/minecraft/src/ModelZombieVillager.java +@@ -5,40 +5,45 @@ + this(0.0F, 0.0F, false); + } + +- public ModelZombieVillager(float var1, float var2, boolean var3) { +- super(var1, 0.0F, 64, var3 ? 32 : 64); +- if(var3) { ++ public ModelZombieVillager(float par1, float par2, boolean par3) { ++ super(par1, 0.0F, 64, par3 ? 32 : 64); ++ ++ if (par3) { + this.bipedHead = new ModelRenderer(this, 0, 0); +- this.bipedHead.addBox(-4.0F, -10.0F, -4.0F, 8, 6, 8, var1); +- this.bipedHead.setRotationPoint(0.0F, 0.0F + var2, 0.0F); ++ this.bipedHead.addBox(-4.0F, -10.0F, -4.0F, 8, 6, 8, par1); ++ this.bipedHead.setRotationPoint(0.0F, 0.0F + par2, 0.0F); + } else { + this.bipedHead = new ModelRenderer(this); +- this.bipedHead.setRotationPoint(0.0F, 0.0F + var2, 0.0F); +- this.bipedHead.setTextureOffset(0, 32).addBox(-4.0F, -10.0F, -4.0F, 8, 10, 8, var1); +- this.bipedHead.setTextureOffset(24, 32).addBox(-1.0F, -3.0F, -6.0F, 2, 4, 2, var1); ++ this.bipedHead.setRotationPoint(0.0F, 0.0F + par2, 0.0F); ++ this.bipedHead.setTextureOffset(0, 32).addBox(-4.0F, -10.0F, -4.0F, 8, 10, 8, par1); ++ this.bipedHead.setTextureOffset(24, 32).addBox(-1.0F, -3.0F, -6.0F, 2, 4, 2, par1); + } +- + } + + public int func_82897_a() { + return 10; + } + +- public void setRotationAngles(float var1, float var2, float var3, float var4, float var5, float var6, Entity var7) { +- super.setRotationAngles(var1, var2, var3, var4, var5, var6, var7); ++ /** ++ * Sets the model's various rotation angles. For bipeds, par1 and par2 are used for animating the movement of arms and ++ * legs, where par1 represents the time(so that arms and legs swing back and forth) and par2 represents how "far" arms ++ * and legs can swing at most. ++ */ ++ public void setRotationAngles(float par1, float par2, float par3, float par4, float par5, float par6, Entity par7Entity) { ++ super.setRotationAngles(par1, par2, par3, par4, par5, par6, par7Entity); + float var8 = MathHelper.sin(this.onGround * (float)Math.PI); + float var9 = MathHelper.sin((1.0F - (1.0F - this.onGround) * (1.0F - this.onGround)) * (float)Math.PI); + this.bipedRightArm.rotateAngleZ = 0.0F; + this.bipedLeftArm.rotateAngleZ = 0.0F; + this.bipedRightArm.rotateAngleY = -(0.1F - var8 * 0.6F); + this.bipedLeftArm.rotateAngleY = 0.1F - var8 * 0.6F; +- this.bipedRightArm.rotateAngleX = (float)Math.PI * -0.5F; +- this.bipedLeftArm.rotateAngleX = (float)Math.PI * -0.5F; ++ this.bipedRightArm.rotateAngleX = -((float)Math.PI / 2F); ++ this.bipedLeftArm.rotateAngleX = -((float)Math.PI / 2F); + this.bipedRightArm.rotateAngleX -= var8 * 1.2F - var9 * 0.4F; + this.bipedLeftArm.rotateAngleX -= var8 * 1.2F - var9 * 0.4F; +- this.bipedRightArm.rotateAngleZ += MathHelper.cos(var3 * 0.09F) * 0.05F + 0.05F; +- this.bipedLeftArm.rotateAngleZ -= MathHelper.cos(var3 * 0.09F) * 0.05F + 0.05F; +- this.bipedRightArm.rotateAngleX += MathHelper.sin(var3 * 0.067F) * 0.05F; +- this.bipedLeftArm.rotateAngleX -= MathHelper.sin(var3 * 0.067F) * 0.05F; ++ this.bipedRightArm.rotateAngleZ += MathHelper.cos(par3 * 0.09F) * 0.05F + 0.05F; ++ this.bipedLeftArm.rotateAngleZ -= MathHelper.cos(par3 * 0.09F) * 0.05F + 0.05F; ++ this.bipedRightArm.rotateAngleX += MathHelper.sin(par3 * 0.067F) * 0.05F; ++ this.bipedLeftArm.rotateAngleX -= MathHelper.sin(par3 * 0.067F) * 0.05F; + } + } diff --git a/patches/net/minecraft/src/ModifiableAttributeInstance.java.patch b/patches/net/minecraft/src/ModifiableAttributeInstance.java.patch new file mode 100644 index 0000000..ea10c38 --- /dev/null +++ b/patches/net/minecraft/src/ModifiableAttributeInstance.java.patch @@ -0,0 +1,183 @@ +--- net/minecraft/src/ModifiableAttributeInstance.java ++++ net/minecraft/src/ModifiableAttributeInstance.java +@@ -12,22 +12,21 @@ + public class ModifiableAttributeInstance implements AttributeInstance { + private final BaseAttributeMap field_111138_a; + private final Attribute field_111136_b; +- private final Map c = Maps.newHashMap(); +- private final Map d = Maps.newHashMap(); +- private final Map e = Maps.newHashMap(); ++ private final Map field_111137_c = Maps.newHashMap(); ++ private final Map field_111134_d = Maps.newHashMap(); ++ private final Map field_111135_e = Maps.newHashMap(); + private double baseValue; + private boolean field_111133_g = true; + private double field_111139_h; + +- public ModifiableAttributeInstance(BaseAttributeMap var1, Attribute var2) { +- this.field_111138_a = var1; +- this.field_111136_b = var2; +- this.baseValue = var2.getDefaultValue(); ++ public ModifiableAttributeInstance(BaseAttributeMap par1BaseAttributeMap, Attribute par2Attribute) { ++ this.field_111138_a = par1BaseAttributeMap; ++ this.field_111136_b = par2Attribute; ++ this.baseValue = par2Attribute.getDefaultValue(); + +- for(int var3 = 0; var3 < 3; ++var3) { +- this.c.put(Integer.valueOf(var3), new HashSet()); ++ for (int var3 = 0; var3 < 3; ++var3) { ++ this.field_111137_c.put(Integer.valueOf(var3), new HashSet()); + } +- + } + + public Attribute func_111123_a() { +@@ -38,44 +37,48 @@ + return this.baseValue; + } + +- public void setAttribute(double var1) { +- if(var1 != this.getBaseValue()) { +- this.baseValue = var1; ++ public void setAttribute(double par1) { ++ if (par1 != this.getBaseValue()) { ++ this.baseValue = par1; + this.func_111131_f(); + } + } + +- public Collection func_111130_a(int var1) { +- return (Collection)this.c.get(Integer.valueOf(var1)); ++ public Collection func_111130_a(int par1) { ++ return (Collection)this.field_111137_c.get(Integer.valueOf(par1)); + } + + public Collection func_111122_c() { + HashSet var1 = new HashSet(); + +- for(int var2 = 0; var2 < 3; ++var2) { ++ for (int var2 = 0; var2 < 3; ++var2) { + var1.addAll(this.func_111130_a(var2)); + } + + return var1; + } + +- public AttributeModifier getModifier(UUID var1) { +- return (AttributeModifier)this.e.get(var1); ++ /** ++ * Returns attribute modifier, if any, by the given UUID ++ */ ++ public AttributeModifier getModifier(UUID par1UUID) { ++ return (AttributeModifier)this.field_111135_e.get(par1UUID); + } + +- public void applyModifier(AttributeModifier var1) { +- if(this.getModifier(var1.getID()) != null) { ++ public void applyModifier(AttributeModifier par1AttributeModifier) { ++ if (this.getModifier(par1AttributeModifier.getID()) != null) { + throw new IllegalArgumentException("Modifier is already applied on this attribute!"); + } else { +- Object var2 = (Set)this.d.get(var1.getName()); +- if(var2 == null) { ++ Object var2 = (Set)this.field_111134_d.get(par1AttributeModifier.getName()); ++ ++ if (var2 == null) { + var2 = new HashSet(); +- this.d.put(var1.getName(), var2); ++ this.field_111134_d.put(par1AttributeModifier.getName(), var2); + } + +- ((Set)this.c.get(Integer.valueOf(var1.getOperation()))).add(var1); +- ((Set)var2).add(var1); +- this.e.put(var1.getID(), var1); ++ ((Set)this.field_111137_c.get(Integer.valueOf(par1AttributeModifier.getOperation()))).add(par1AttributeModifier); ++ ((Set)var2).add(par1AttributeModifier); ++ this.field_111135_e.put(par1AttributeModifier.getID(), par1AttributeModifier); + this.func_111131_f(); + } + } +@@ -85,40 +88,42 @@ + this.field_111138_a.func_111149_a(this); + } + +- public void removeModifier(AttributeModifier var1) { +- for(int var2 = 0; var2 < 3; ++var2) { +- Set var3 = (Set)this.c.get(Integer.valueOf(var2)); +- var3.remove(var1); ++ public void removeModifier(AttributeModifier par1AttributeModifier) { ++ for (int var2 = 0; var2 < 3; ++var2) { ++ Set var3 = (Set)this.field_111137_c.get(Integer.valueOf(var2)); ++ var3.remove(par1AttributeModifier); + } + +- Set var4 = (Set)this.d.get(var1.getName()); +- if(var4 != null) { +- var4.remove(var1); +- if(var4.isEmpty()) { +- this.d.remove(var1.getName()); ++ Set var4 = (Set)this.field_111134_d.get(par1AttributeModifier.getName()); ++ ++ if (var4 != null) { ++ var4.remove(par1AttributeModifier); ++ ++ if (var4.isEmpty()) { ++ this.field_111134_d.remove(par1AttributeModifier.getName()); + } + } + +- this.e.remove(var1.getID()); ++ this.field_111135_e.remove(par1AttributeModifier.getID()); + this.func_111131_f(); + } + + public void func_142049_d() { + Collection var1 = this.func_111122_c(); +- if(var1 != null) { ++ ++ if (var1 != null) { + ArrayList var4 = new ArrayList(var1); + Iterator var2 = var4.iterator(); + +- while(var2.hasNext()) { ++ while (var2.hasNext()) { + AttributeModifier var3 = (AttributeModifier)var2.next(); + this.removeModifier(var3); + } +- + } + } + + public double getAttributeValue() { +- if(this.field_111133_g) { ++ if (this.field_111133_g) { + this.field_111139_h = this.func_111129_g(); + this.field_111133_g = false; + } +@@ -128,21 +133,21 @@ + + private double func_111129_g() { + double var1 = this.getBaseValue(); +- + AttributeModifier var4; +- for(Iterator var3 = this.func_111130_a(0).iterator(); var3.hasNext(); var1 += var4.getAmount()) { ++ ++ for (Iterator var3 = this.func_111130_a(0).iterator(); var3.hasNext(); var1 += var4.getAmount()) { + var4 = (AttributeModifier)var3.next(); + } + + double var7 = var1; +- + Iterator var5; + AttributeModifier var6; +- for(var5 = this.func_111130_a(1).iterator(); var5.hasNext(); var7 += var1 * var6.getAmount()) { ++ ++ for (var5 = this.func_111130_a(1).iterator(); var5.hasNext(); var7 += var1 * var6.getAmount()) { + var6 = (AttributeModifier)var5.next(); + } + +- for(var5 = this.func_111130_a(2).iterator(); var5.hasNext(); var7 *= 1.0D + var6.getAmount()) { ++ for (var5 = this.func_111130_a(2).iterator(); var5.hasNext(); var7 *= 1.0D + var6.getAmount()) { + var6 = (AttributeModifier)var5.next(); + } + diff --git a/patches/net/minecraft/src/MouseFilter.java.patch b/patches/net/minecraft/src/MouseFilter.java.patch new file mode 100644 index 0000000..affac51 --- /dev/null +++ b/patches/net/minecraft/src/MouseFilter.java.patch @@ -0,0 +1,30 @@ +--- net/minecraft/src/MouseFilter.java ++++ net/minecraft/src/MouseFilter.java +@@ -5,15 +5,19 @@ + private float field_76334_b; + private float field_76335_c; + +- public float smooth(float var1, float var2) { +- this.field_76336_a += var1; +- var1 = (this.field_76336_a - this.field_76334_b) * var2; +- this.field_76335_c += (var1 - this.field_76335_c) * 0.5F; +- if(var1 > 0.0F && var1 > this.field_76335_c || var1 < 0.0F && var1 < this.field_76335_c) { +- var1 = this.field_76335_c; ++ /** ++ * Smooths mouse input ++ */ ++ public float smooth(float par1, float par2) { ++ this.field_76336_a += par1; ++ par1 = (this.field_76336_a - this.field_76334_b) * par2; ++ this.field_76335_c += (par1 - this.field_76335_c) * 0.5F; ++ ++ if (par1 > 0.0F && par1 > this.field_76335_c || par1 < 0.0F && par1 < this.field_76335_c) { ++ par1 = this.field_76335_c; + } + +- this.field_76334_b += var1; +- return var1; ++ this.field_76334_b += par1; ++ return par1; + } + } diff --git a/patches/net/minecraft/src/MouseHelper.java.patch b/patches/net/minecraft/src/MouseHelper.java.patch new file mode 100644 index 0000000..cfb02f4 --- /dev/null +++ b/patches/net/minecraft/src/MouseHelper.java.patch @@ -0,0 +1,28 @@ +--- net/minecraft/src/MouseHelper.java ++++ net/minecraft/src/MouseHelper.java +@@ -4,15 +4,25 @@ + import org.lwjgl.opengl.Display; + + public class MouseHelper { ++ ++ /** Mouse delta X this frame */ + public int deltaX; ++ ++ /** Mouse delta Y this frame */ + public int deltaY; + ++ /** ++ * Grabs the mouse cursor it doesn't move and isn't seen. ++ */ + public void grabMouseCursor() { + Mouse.setGrabbed(true); + this.deltaX = 0; + this.deltaY = 0; + } + ++ /** ++ * Ungrabs the mouse cursor so it can be moved and set it to the center of the screen ++ */ + public void ungrabMouseCursor() { + Mouse.setCursorPosition(Display.getWidth() / 2, Display.getHeight() / 2); + Mouse.setGrabbed(false); diff --git a/patches/net/minecraft/src/MovementInput.java.patch b/patches/net/minecraft/src/MovementInput.java.patch new file mode 100644 index 0000000..6c4fd6a --- /dev/null +++ b/patches/net/minecraft/src/MovementInput.java.patch @@ -0,0 +1,29 @@ +--- net/minecraft/src/MovementInput.java ++++ net/minecraft/src/MovementInput.java +@@ -1,11 +1,24 @@ + package net.minecraft.src; + + public class MovementInput { ++ ++ /** ++ * The speed at which the player is strafing. Postive numbers to the left and negative to the right. ++ */ + public float moveStrafe; ++ ++ /** ++ * The speed at which the player is moving forward. Negative numbers will move backwards. ++ */ + public float moveForward; + public boolean jump; + public boolean sneak; ++ // Spout Start ++ public boolean flyingUp; ++ public boolean flyingDown; ++ // Spout End + +- public void updatePlayerMoveState() { +- } ++ // Spout Start - Keep parameter. TODO: Add a reason why. ++ public void updatePlayerMoveState(EntityPlayer par1EntityPlayer) {} ++ // Spout End + } diff --git a/patches/net/minecraft/src/MovementInputFromOptions.java.patch b/patches/net/minecraft/src/MovementInputFromOptions.java.patch new file mode 100644 index 0000000..9efec64 --- /dev/null +++ b/patches/net/minecraft/src/MovementInputFromOptions.java.patch @@ -0,0 +1,86 @@ +--- net/minecraft/src/MovementInputFromOptions.java ++++ net/minecraft/src/MovementInputFromOptions.java +@@ -1,37 +1,72 @@ + package net.minecraft.src; + + public class MovementInputFromOptions extends MovementInput { +- private GameSettings gameSettings; ++ // Spout Start - private to public ++ public GameSettings gameSettings; ++ // Spout End + +- public MovementInputFromOptions(GameSettings var1) { +- this.gameSettings = var1; ++ public MovementInputFromOptions(GameSettings par1GameSettings) { ++ this.gameSettings = par1GameSettings; + } + +- public void updatePlayerMoveState() { ++ // Spout Start - Keep parameter ++ public void updatePlayerMoveState(EntityPlayer par1EntityPlayer) { ++ // Spout End + this.moveStrafe = 0.0F; + this.moveForward = 0.0F; +- if(this.gameSettings.keyBindForward.pressed) { ++ ++ // Spout Start - Forward toggle ++ if (this.gameSettings.keyBindForward.pressed || par1EntityPlayer.autoforwardToggle) { ++ // Spout End + ++this.moveForward; + } + +- if(this.gameSettings.keyBindBack.pressed) { ++ // Spout Start - Forward toggle ++ if (this.gameSettings.keyBindBack.pressed || par1EntityPlayer.autoBackwardToggle) { ++ // Spout End + --this.moveForward; + } + +- if(this.gameSettings.keyBindLeft.pressed) { ++ if (this.gameSettings.keyBindLeft.pressed) { + ++this.moveStrafe; + } + +- if(this.gameSettings.keyBindRight.pressed) { ++ if (this.gameSettings.keyBindRight.pressed) { + --this.moveStrafe; + } ++ // Spout Start ++ this.flyingDown = this.gameSettings.keyFlyDown.pressed; ++ this.flyingUp = this.gameSettings.keyFlyUp.pressed; ++ if (par1EntityPlayer.capabilities.isFlying) { ++ this.moveStrafe = 0.0F; ++ this.moveForward = 0.0F; ++ ++ if (this.gameSettings.keyFlyForward.pressed || par1EntityPlayer.autoforwardToggle) { ++ ++this.moveForward; ++ } ++ ++ if (this.gameSettings.keyFlyBack.pressed) { ++ --this.moveForward; ++ } ++ ++ if (this.gameSettings.keyFlyLeft.pressed) { ++ ++this.moveStrafe; ++ } ++ ++ if (this.gameSettings.keyFlyRight.pressed) { ++ --this.moveStrafe; ++ } ++ } ++ // Spout End + + this.jump = this.gameSettings.keyBindJump.pressed; +- this.sneak = this.gameSettings.keyBindSneak.pressed; +- if(this.sneak) { ++ // Spout Start - Sneak toggle ++ this.sneak = this.gameSettings.keyBindSneak.pressed || par1EntityPlayer.sneakToggle; ++ // Spout End ++ ++ if (this.sneak) { + this.moveStrafe = (float)((double)this.moveStrafe * 0.3D); + this.moveForward = (float)((double)this.moveForward * 0.3D); + } +- + } + } diff --git a/patches/net/minecraft/src/MovingObjectPosition.java.patch b/patches/net/minecraft/src/MovingObjectPosition.java.patch new file mode 100644 index 0000000..3b76a17 --- /dev/null +++ b/patches/net/minecraft/src/MovingObjectPosition.java.patch @@ -0,0 +1,55 @@ +--- net/minecraft/src/MovingObjectPosition.java ++++ net/minecraft/src/MovingObjectPosition.java +@@ -1,26 +1,43 @@ + package net.minecraft.src; + + public class MovingObjectPosition { ++ ++ /** What type of ray trace hit was this? 0 = block, 1 = entity */ + public EnumMovingObjectType typeOfHit; ++ ++ /** x coordinate of the block ray traced against */ + public int blockX; ++ ++ /** y coordinate of the block ray traced against */ + public int blockY; ++ ++ /** z coordinate of the block ray traced against */ + public int blockZ; ++ ++ /** ++ * Which side was hit. If its -1 then it went the full length of the ray trace. Bottom = 0, Top = 1, East = 2, West = ++ * 3, North = 4, South = 5. ++ */ + public int sideHit; ++ ++ /** The vector position of the hit */ + public Vec3 hitVec; ++ ++ /** The hit entity */ + public Entity entityHit; + +- public MovingObjectPosition(int var1, int var2, int var3, int var4, Vec3 var5) { ++ public MovingObjectPosition(int par1, int par2, int par3, int par4, Vec3 par5Vec3) { + this.typeOfHit = EnumMovingObjectType.TILE; +- this.blockX = var1; +- this.blockY = var2; +- this.blockZ = var3; +- this.sideHit = var4; +- this.hitVec = var5.myVec3LocalPool.getVecFromPool(var5.xCoord, var5.yCoord, var5.zCoord); ++ this.blockX = par1; ++ this.blockY = par2; ++ this.blockZ = par3; ++ this.sideHit = par4; ++ this.hitVec = par5Vec3.myVec3LocalPool.getVecFromPool(par5Vec3.xCoord, par5Vec3.yCoord, par5Vec3.zCoord); + } + +- public MovingObjectPosition(Entity var1) { ++ public MovingObjectPosition(Entity par1Entity) { + this.typeOfHit = EnumMovingObjectType.ENTITY; +- this.entityHit = var1; +- this.hitVec = var1.worldObj.getWorldVec3Pool().getVecFromPool(var1.posX, var1.posY, var1.posZ); ++ this.entityHit = par1Entity; ++ this.hitVec = par1Entity.worldObj.getWorldVec3Pool().getVecFromPool(par1Entity.posX, par1Entity.posY, par1Entity.posZ); + } + } diff --git a/patches/net/minecraft/src/NBTBase.java.patch b/patches/net/minecraft/src/NBTBase.java.patch new file mode 100644 index 0000000..f2322c4 --- /dev/null +++ b/patches/net/minecraft/src/NBTBase.java.patch @@ -0,0 +1,301 @@ +--- net/minecraft/src/NBTBase.java ++++ net/minecraft/src/NBTBase.java +@@ -5,52 +5,72 @@ + import java.io.IOException; + + public abstract class NBTBase { +- public static final String[] b = new String[]{"END", "BYTE", "SHORT", "INT", "LONG", "FLOAT", "DOUBLE", "BYTE[]", "STRING", "LIST", "COMPOUND", "INT[]"}; +- private String a; +- ++ public static final String[] NBTTypes = new String[] {"END", "BYTE", "SHORT", "INT", "LONG", "FLOAT", "DOUBLE", "BYTE[]", "STRING", "LIST", "COMPOUND", "INT[]"}; ++ ++ /** The UTF string key used to lookup values. */ ++ private String name; ++ ++ /** ++ * Write the actual data contents of the tag, implemented in NBT extension classes ++ */ + abstract void write(DataOutput var1) throws IOException; + ++ /** ++ * Read the actual data contents of the tag, implemented in NBT extension classes ++ */ + abstract void load(DataInput var1, int var2) throws IOException; + ++ /** ++ * Gets the type byte for the tag. ++ */ + public abstract byte getId(); + +- protected NBTBase(String var1) { +- if(var1 == null) { +- this.a = ""; ++ protected NBTBase(String par1Str) { ++ if (par1Str == null) { ++ this.name = ""; + } else { +- this.a = var1; ++ this.name = par1Str; + } +- + } + +- public NBTBase setName(String var1) { +- if(var1 == null) { +- this.a = ""; ++ /** ++ * Sets the name for this tag and returns this for convenience. ++ */ ++ public NBTBase setName(String par1Str) { ++ if (par1Str == null) { ++ this.name = ""; + } else { +- this.a = var1; ++ this.name = par1Str; + } + + return this; + } + ++ /** ++ * Gets the name corresponding to the tag, or an empty string if none set. ++ */ + public String getName() { +- return this.a == null ? "" : this.a; +- } +- +- public static NBTBase readNamedTag(DataInput var0) throws IOException { +- return func_130104_b(var0, 0); +- } +- +- public static NBTBase func_130104_b(DataInput var0, int var1) throws IOException { +- byte var2 = var0.readByte(); +- if(var2 == 0) { ++ return this.name == null ? "" : this.name; ++ } ++ ++ /** ++ * Reads and returns a tag from the given DataInput, or the End tag if no tag could be read. ++ */ ++ public static NBTBase readNamedTag(DataInput par0DataInput) throws IOException { ++ return func_130104_b(par0DataInput, 0); ++ } ++ ++ public static NBTBase func_130104_b(DataInput par0DataInput, int par1) throws IOException { ++ byte var2 = par0DataInput.readByte(); ++ ++ if (var2 == 0) { + return new NBTTagEnd(); + } else { +- String var3 = var0.readUTF(); ++ String var3 = par0DataInput.readUTF(); + NBTBase var4 = newTag(var2, var3); + + try { +- var4.load(var0, var1); ++ var4.load(par0DataInput, par1); + return var4; + } catch (IOException var8) { + CrashReport var6 = CrashReport.makeCrashReport(var8, "Loading NBT data"); +@@ -62,88 +82,126 @@ + } + } + +- public static void writeNamedTag(NBTBase var0, DataOutput var1) throws IOException { +- var1.writeByte(var0.getId()); +- if(var0.getId() != 0) { +- var1.writeUTF(var0.getName()); +- var0.write(var1); +- } +- } +- +- public static NBTBase newTag(byte var0, String var1) { +- switch(var0) { +- case 0: +- return new NBTTagEnd(); +- case 1: +- return new NBTTagByte(var1); +- case 2: +- return new NBTTagShort(var1); +- case 3: +- return new NBTTagInt(var1); +- case 4: +- return new NBTTagLong(var1); +- case 5: +- return new NBTTagFloat(var1); +- case 6: +- return new NBTTagDouble(var1); +- case 7: +- return new NBTTagByteArray(var1); +- case 8: +- return new NBTTagString(var1); +- case 9: +- return new NBTTagList(var1); +- case 10: +- return new NBTTagCompound(var1); +- case 11: +- return new NBTTagIntArray(var1); +- default: +- return null; +- } +- } +- +- public static String getTagName(byte var0) { +- switch(var0) { +- case 0: +- return "TAG_End"; +- case 1: +- return "TAG_Byte"; +- case 2: +- return "TAG_Short"; +- case 3: +- return "TAG_Int"; +- case 4: +- return "TAG_Long"; +- case 5: +- return "TAG_Float"; +- case 6: +- return "TAG_Double"; +- case 7: +- return "TAG_Byte_Array"; +- case 8: +- return "TAG_String"; +- case 9: +- return "TAG_List"; +- case 10: +- return "TAG_Compound"; +- case 11: +- return "TAG_Int_Array"; +- default: +- return "UNKNOWN"; +- } +- } +- ++ /** ++ * Writes the specified tag to the given DataOutput, writing the type byte, the UTF string key and then calling the tag ++ * to write its data. ++ */ ++ public static void writeNamedTag(NBTBase par0NBTBase, DataOutput par1DataOutput) throws IOException { ++ par1DataOutput.writeByte(par0NBTBase.getId()); ++ ++ if (par0NBTBase.getId() != 0) { ++ par1DataOutput.writeUTF(par0NBTBase.getName()); ++ par0NBTBase.write(par1DataOutput); ++ } ++ } ++ ++ /** ++ * Creates and returns a new tag of the specified type, or null if invalid. ++ */ ++ public static NBTBase newTag(byte par0, String par1Str) { ++ switch (par0) { ++ case 0: ++ return new NBTTagEnd(); ++ ++ case 1: ++ return new NBTTagByte(par1Str); ++ ++ case 2: ++ return new NBTTagShort(par1Str); ++ ++ case 3: ++ return new NBTTagInt(par1Str); ++ ++ case 4: ++ return new NBTTagLong(par1Str); ++ ++ case 5: ++ return new NBTTagFloat(par1Str); ++ ++ case 6: ++ return new NBTTagDouble(par1Str); ++ ++ case 7: ++ return new NBTTagByteArray(par1Str); ++ ++ case 8: ++ return new NBTTagString(par1Str); ++ ++ case 9: ++ return new NBTTagList(par1Str); ++ ++ case 10: ++ return new NBTTagCompound(par1Str); ++ ++ case 11: ++ return new NBTTagIntArray(par1Str); ++ ++ default: ++ return null; ++ } ++ } ++ ++ /** ++ * Returns the string name of a tag with the specified type, or 'UNKNOWN' if invalid. ++ */ ++ public static String getTagName(byte par0) { ++ switch (par0) { ++ case 0: ++ return "TAG_End"; ++ ++ case 1: ++ return "TAG_Byte"; ++ ++ case 2: ++ return "TAG_Short"; ++ ++ case 3: ++ return "TAG_Int"; ++ ++ case 4: ++ return "TAG_Long"; ++ ++ case 5: ++ return "TAG_Float"; ++ ++ case 6: ++ return "TAG_Double"; ++ ++ case 7: ++ return "TAG_Byte_Array"; ++ ++ case 8: ++ return "TAG_String"; ++ ++ case 9: ++ return "TAG_List"; ++ ++ case 10: ++ return "TAG_Compound"; ++ ++ case 11: ++ return "TAG_Int_Array"; ++ ++ default: ++ return "UNKNOWN"; ++ } ++ } ++ ++ /** ++ * Creates a clone of the tag. ++ */ + public abstract NBTBase copy(); + +- public boolean equals(Object var1) { +- if(!(var1 instanceof NBTBase)) { ++ public boolean equals(Object par1Obj) { ++ if (!(par1Obj instanceof NBTBase)) { + return false; + } else { +- NBTBase var2 = (NBTBase)var1; +- return this.getId() != var2.getId() ? false : ((this.a != null || var2.a == null) && (this.a == null || var2.a != null) ? this.a == null || this.a.equals(var2.a) : false); ++ NBTBase var2 = (NBTBase)par1Obj; ++ return this.getId() != var2.getId() ? false : ((this.name != null || var2.name == null) && (this.name == null || var2.name != null) ? this.name == null || this.name.equals(var2.name) : false); + } + } + + public int hashCode() { +- return this.a.hashCode() ^ this.getId(); ++ return this.name.hashCode() ^ this.getId(); + } + } diff --git a/patches/net/minecraft/src/NBTTagByte.java.patch b/patches/net/minecraft/src/NBTTagByte.java.patch new file mode 100644 index 0000000..f4c5eae --- /dev/null +++ b/patches/net/minecraft/src/NBTTagByte.java.patch @@ -0,0 +1,76 @@ +--- net/minecraft/src/NBTTagByte.java ++++ net/minecraft/src/NBTTagByte.java +@@ -5,25 +5,36 @@ + import java.io.IOException; + + public class NBTTagByte extends NBTBase { ++ ++ /** The byte value for the tag. */ + public byte data; + +- public NBTTagByte(String var1) { +- super(var1); +- } +- +- public NBTTagByte(String var1, byte var2) { +- super(var1); +- this.data = var2; +- } +- +- void write(DataOutput var1) throws IOException { +- var1.writeByte(this.data); +- } +- +- void load(DataInput var1, int var2) throws IOException { +- this.data = var1.readByte(); +- } +- ++ public NBTTagByte(String par1Str) { ++ super(par1Str); ++ } ++ ++ public NBTTagByte(String par1Str, byte par2) { ++ super(par1Str); ++ this.data = par2; ++ } ++ ++ /** ++ * Write the actual data contents of the tag, implemented in NBT extension classes ++ */ ++ void write(DataOutput par1DataOutput) throws IOException { ++ par1DataOutput.writeByte(this.data); ++ } ++ ++ /** ++ * Read the actual data contents of the tag, implemented in NBT extension classes ++ */ ++ void load(DataInput par1DataInput, int par2) throws IOException { ++ this.data = par1DataInput.readByte(); ++ } ++ ++ /** ++ * Gets the type byte for the tag. ++ */ + public byte getId() { + return (byte)1; + } +@@ -32,13 +43,16 @@ + return "" + this.data; + } + ++ /** ++ * Creates a clone of the tag. ++ */ + public NBTBase copy() { + return new NBTTagByte(this.getName(), this.data); + } + +- public boolean equals(Object var1) { +- if(super.equals(var1)) { +- NBTTagByte var2 = (NBTTagByte)var1; ++ public boolean equals(Object par1Obj) { ++ if (super.equals(par1Obj)) { ++ NBTTagByte var2 = (NBTTagByte)par1Obj; + return this.data == var2.data; + } else { + return false; diff --git a/patches/net/minecraft/src/NBTTagByteArray.java.patch b/patches/net/minecraft/src/NBTTagByteArray.java.patch new file mode 100644 index 0000000..da3050e --- /dev/null +++ b/patches/net/minecraft/src/NBTTagByteArray.java.patch @@ -0,0 +1,79 @@ +--- net/minecraft/src/NBTTagByteArray.java ++++ net/minecraft/src/NBTTagByteArray.java +@@ -6,28 +6,39 @@ + import java.util.Arrays; + + public class NBTTagByteArray extends NBTBase { ++ ++ /** The byte array stored in the tag. */ + public byte[] byteArray; + +- public NBTTagByteArray(String var1) { +- super(var1); +- } +- +- public NBTTagByteArray(String var1, byte[] var2) { +- super(var1); +- this.byteArray = var2; +- } +- +- void write(DataOutput var1) throws IOException { +- var1.writeInt(this.byteArray.length); +- var1.write(this.byteArray); +- } +- +- void load(DataInput var1, int var2) throws IOException { +- int var3 = var1.readInt(); ++ public NBTTagByteArray(String par1Str) { ++ super(par1Str); ++ } ++ ++ public NBTTagByteArray(String par1Str, byte[] par2ArrayOfByte) { ++ super(par1Str); ++ this.byteArray = par2ArrayOfByte; ++ } ++ ++ /** ++ * Write the actual data contents of the tag, implemented in NBT extension classes ++ */ ++ void write(DataOutput par1DataOutput) throws IOException { ++ par1DataOutput.writeInt(this.byteArray.length); ++ par1DataOutput.write(this.byteArray); ++ } ++ ++ /** ++ * Read the actual data contents of the tag, implemented in NBT extension classes ++ */ ++ void load(DataInput par1DataInput, int par2) throws IOException { ++ int var3 = par1DataInput.readInt(); + this.byteArray = new byte[var3]; +- var1.readFully(this.byteArray); ++ par1DataInput.readFully(this.byteArray); + } + ++ /** ++ * Gets the type byte for the tag. ++ */ + public byte getId() { + return (byte)7; + } +@@ -36,14 +47,17 @@ + return "[" + this.byteArray.length + " bytes]"; + } + ++ /** ++ * Creates a clone of the tag. ++ */ + public NBTBase copy() { + byte[] var1 = new byte[this.byteArray.length]; + System.arraycopy(this.byteArray, 0, var1, 0, this.byteArray.length); + return new NBTTagByteArray(this.getName(), var1); + } + +- public boolean equals(Object var1) { +- return super.equals(var1) ? Arrays.equals(this.byteArray, ((NBTTagByteArray)var1).byteArray) : false; ++ public boolean equals(Object par1Obj) { ++ return super.equals(par1Obj) ? Arrays.equals(this.byteArray, ((NBTTagByteArray)par1Obj).byteArray) : false; + } + + public int hashCode() { diff --git a/patches/net/minecraft/src/NBTTagCompound.java.patch b/patches/net/minecraft/src/NBTTagCompound.java.patch new file mode 100644 index 0000000..362b032 --- /dev/null +++ b/patches/net/minecraft/src/NBTTagCompound.java.patch @@ -0,0 +1,557 @@ +--- net/minecraft/src/NBTTagCompound.java ++++ net/minecraft/src/NBTTagCompound.java +@@ -9,258 +9,365 @@ + import java.util.Map; + + public class NBTTagCompound extends NBTBase { +- private Map a = new HashMap(); ++ ++ /** ++ * The key-value pairs for the tag. Each key is a UTF string, each value is a tag. ++ */ ++ private Map tagMap = new HashMap(); + + public NBTTagCompound() { + super(""); + } + +- public NBTTagCompound(String var1) { +- super(var1); ++ public NBTTagCompound(String par1Str) { ++ super(par1Str); + } + +- void write(DataOutput var1) throws IOException { +- Iterator var2 = this.a.values().iterator(); ++ /** ++ * Write the actual data contents of the tag, implemented in NBT extension classes ++ */ ++ void write(DataOutput par1DataOutput) throws IOException { ++ Iterator var2 = this.tagMap.values().iterator(); + +- while(var2.hasNext()) { ++ while (var2.hasNext()) { + NBTBase var3 = (NBTBase)var2.next(); +- NBTBase.writeNamedTag(var3, var1); ++ NBTBase.writeNamedTag(var3, par1DataOutput); + } + +- var1.writeByte(0); ++ par1DataOutput.writeByte(0); + } + +- void load(DataInput var1, int var2) throws IOException { +- if(var2 > 512) { ++ /** ++ * Read the actual data contents of the tag, implemented in NBT extension classes ++ */ ++ void load(DataInput par1DataInput, int par2) throws IOException { ++ if (par2 > 512) { + throw new RuntimeException("Tried to read NBT tag with too high complexity, depth > 512"); + } else { +- this.a.clear(); +- +- while(true) { +- NBTBase var3 = NBTBase.func_130104_b(var1, var2 + 1); +- if(var3.getId() == 0) { +- return; +- } +- +- this.a.put(var3.getName(), var3); ++ this.tagMap.clear(); ++ NBTBase var3; ++ ++ while ((var3 = NBTBase.func_130104_b(par1DataInput, par2 + 1)).getId() != 0) { ++ this.tagMap.put(var3.getName(), var3); + } + } + } + ++ /** ++ * Returns all the values in the tagMap HashMap. ++ */ + public Collection getTags() { +- return this.a.values(); ++ return this.tagMap.values(); + } + ++ /** ++ * Gets the type byte for the tag. ++ */ + public byte getId() { + return (byte)10; + } + +- public void setTag(String var1, NBTBase var2) { +- this.a.put(var1, var2.setName(var1)); +- } +- +- public void setByte(String var1, byte var2) { +- this.a.put(var1, new NBTTagByte(var1, var2)); +- } +- +- public void setShort(String var1, short var2) { +- this.a.put(var1, new NBTTagShort(var1, var2)); +- } +- +- public void setInteger(String var1, int var2) { +- this.a.put(var1, new NBTTagInt(var1, var2)); +- } +- +- public void setLong(String var1, long var2) { +- this.a.put(var1, new NBTTagLong(var1, var2)); +- } +- +- public void setFloat(String var1, float var2) { +- this.a.put(var1, new NBTTagFloat(var1, var2)); +- } +- +- public void setDouble(String var1, double var2) { +- this.a.put(var1, new NBTTagDouble(var1, var2)); +- } +- +- public void setString(String var1, String var2) { +- this.a.put(var1, new NBTTagString(var1, var2)); +- } +- +- public void setByteArray(String var1, byte[] var2) { +- this.a.put(var1, new NBTTagByteArray(var1, var2)); +- } +- +- public void setIntArray(String var1, int[] var2) { +- this.a.put(var1, new NBTTagIntArray(var1, var2)); +- } +- +- public void setCompoundTag(String var1, NBTTagCompound var2) { +- this.a.put(var1, var2.setName(var1)); +- } +- +- public void setBoolean(String var1, boolean var2) { +- this.setByte(var1, (byte)(var2 ? 1 : 0)); +- } +- +- public NBTBase getTag(String var1) { +- return (NBTBase)this.a.get(var1); +- } +- +- public boolean hasKey(String var1) { +- return this.a.containsKey(var1); +- } +- +- public byte getByte(String var1) { +- try { +- return !this.a.containsKey(var1) ? 0 : ((NBTTagByte)this.a.get(var1)).data; +- } catch (ClassCastException var3) { +- throw new ReportedException(this.createCrashReport(var1, 1, var3)); +- } +- } +- +- public short getShort(String var1) { +- try { +- return !this.a.containsKey(var1) ? 0 : ((NBTTagShort)this.a.get(var1)).data; +- } catch (ClassCastException var3) { +- throw new ReportedException(this.createCrashReport(var1, 2, var3)); +- } +- } +- +- public int getInteger(String var1) { +- try { +- return !this.a.containsKey(var1) ? 0 : ((NBTTagInt)this.a.get(var1)).data; +- } catch (ClassCastException var3) { +- throw new ReportedException(this.createCrashReport(var1, 3, var3)); +- } +- } +- +- public long getLong(String var1) { +- try { +- return !this.a.containsKey(var1) ? 0L : ((NBTTagLong)this.a.get(var1)).data; +- } catch (ClassCastException var3) { +- throw new ReportedException(this.createCrashReport(var1, 4, var3)); +- } +- } +- +- public float getFloat(String var1) { +- try { +- return !this.a.containsKey(var1) ? 0.0F : ((NBTTagFloat)this.a.get(var1)).data; +- } catch (ClassCastException var3) { +- throw new ReportedException(this.createCrashReport(var1, 5, var3)); +- } +- } +- +- public double getDouble(String var1) { +- try { +- return !this.a.containsKey(var1) ? 0.0D : ((NBTTagDouble)this.a.get(var1)).data; +- } catch (ClassCastException var3) { +- throw new ReportedException(this.createCrashReport(var1, 6, var3)); +- } +- } +- +- public String getString(String var1) { +- try { +- return !this.a.containsKey(var1) ? "" : ((NBTTagString)this.a.get(var1)).a; +- } catch (ClassCastException var3) { +- throw new ReportedException(this.createCrashReport(var1, 8, var3)); +- } +- } +- +- public byte[] getByteArray(String var1) { +- try { +- return !this.a.containsKey(var1) ? new byte[0] : ((NBTTagByteArray)this.a.get(var1)).byteArray; +- } catch (ClassCastException var3) { +- throw new ReportedException(this.createCrashReport(var1, 7, var3)); +- } +- } +- +- public int[] getIntArray(String var1) { +- try { +- return !this.a.containsKey(var1) ? new int[0] : ((NBTTagIntArray)this.a.get(var1)).intArray; +- } catch (ClassCastException var3) { +- throw new ReportedException(this.createCrashReport(var1, 11, var3)); +- } +- } +- +- public NBTTagCompound getCompoundTag(String var1) { +- try { +- return !this.a.containsKey(var1) ? new NBTTagCompound(var1) : (NBTTagCompound)this.a.get(var1); +- } catch (ClassCastException var3) { +- throw new ReportedException(this.createCrashReport(var1, 10, var3)); +- } +- } +- +- public NBTTagList getTagList(String var1) { +- try { +- return !this.a.containsKey(var1) ? new NBTTagList(var1) : (NBTTagList)this.a.get(var1); +- } catch (ClassCastException var3) { +- throw new ReportedException(this.createCrashReport(var1, 9, var3)); +- } +- } +- +- public boolean getBoolean(String var1) { +- return this.getByte(var1) != 0; +- } +- +- public void removeTag(String var1) { +- this.a.remove(var1); ++ /** ++ * Stores the given tag into the map with the given string key. This is mostly used to store tag lists. ++ */ ++ public void setTag(String par1Str, NBTBase par2NBTBase) { ++ this.tagMap.put(par1Str, par2NBTBase.setName(par1Str)); ++ } ++ ++ /** ++ * Stores a new NBTTagByte with the given byte value into the map with the given string key. ++ */ ++ public void setByte(String par1Str, byte par2) { ++ this.tagMap.put(par1Str, new NBTTagByte(par1Str, par2)); ++ } ++ ++ /** ++ * Stores a new NBTTagShort with the given short value into the map with the given string key. ++ */ ++ public void setShort(String par1Str, short par2) { ++ this.tagMap.put(par1Str, new NBTTagShort(par1Str, par2)); ++ } ++ ++ /** ++ * Stores a new NBTTagInt with the given integer value into the map with the given string key. ++ */ ++ public void setInteger(String par1Str, int par2) { ++ this.tagMap.put(par1Str, new NBTTagInt(par1Str, par2)); ++ } ++ ++ /** ++ * Stores a new NBTTagLong with the given long value into the map with the given string key. ++ */ ++ public void setLong(String par1Str, long par2) { ++ this.tagMap.put(par1Str, new NBTTagLong(par1Str, par2)); ++ } ++ ++ /** ++ * Stores a new NBTTagFloat with the given float value into the map with the given string key. ++ */ ++ public void setFloat(String par1Str, float par2) { ++ this.tagMap.put(par1Str, new NBTTagFloat(par1Str, par2)); ++ } ++ ++ /** ++ * Stores a new NBTTagDouble with the given double value into the map with the given string key. ++ */ ++ public void setDouble(String par1Str, double par2) { ++ this.tagMap.put(par1Str, new NBTTagDouble(par1Str, par2)); ++ } ++ ++ /** ++ * Stores a new NBTTagString with the given string value into the map with the given string key. ++ */ ++ public void setString(String par1Str, String par2Str) { ++ this.tagMap.put(par1Str, new NBTTagString(par1Str, par2Str)); ++ } ++ ++ /** ++ * Stores a new NBTTagByteArray with the given array as data into the map with the given string key. ++ */ ++ public void setByteArray(String par1Str, byte[] par2ArrayOfByte) { ++ this.tagMap.put(par1Str, new NBTTagByteArray(par1Str, par2ArrayOfByte)); ++ } ++ ++ /** ++ * Stores a new NBTTagIntArray with the given array as data into the map with the given string key. ++ */ ++ public void setIntArray(String par1Str, int[] par2ArrayOfInteger) { ++ this.tagMap.put(par1Str, new NBTTagIntArray(par1Str, par2ArrayOfInteger)); ++ } ++ ++ /** ++ * Stores the given NBTTagCompound into the map with the given string key. ++ */ ++ public void setCompoundTag(String par1Str, NBTTagCompound par2NBTTagCompound) { ++ this.tagMap.put(par1Str, par2NBTTagCompound.setName(par1Str)); ++ } ++ ++ /** ++ * Stores the given boolean value as a NBTTagByte, storing 1 for true and 0 for false, using the given string key. ++ */ ++ public void setBoolean(String par1Str, boolean par2) { ++ this.setByte(par1Str, (byte)(par2 ? 1 : 0)); ++ } ++ ++ /** ++ * gets a generic tag with the specified name ++ */ ++ public NBTBase getTag(String par1Str) { ++ return (NBTBase)this.tagMap.get(par1Str); ++ } ++ ++ /** ++ * Returns whether the given string has been previously stored as a key in the map. ++ */ ++ public boolean hasKey(String par1Str) { ++ return this.tagMap.containsKey(par1Str); ++ } ++ ++ /** ++ * Retrieves a byte value using the specified key, or 0 if no such key was stored. ++ */ ++ public byte getByte(String par1Str) { ++ try { ++ return !this.tagMap.containsKey(par1Str) ? 0 : ((NBTTagByte)this.tagMap.get(par1Str)).data; ++ } catch (ClassCastException var3) { ++ throw new ReportedException(this.createCrashReport(par1Str, 1, var3)); ++ } ++ } ++ ++ /** ++ * Retrieves a short value using the specified key, or 0 if no such key was stored. ++ */ ++ public short getShort(String par1Str) { ++ try { ++ return !this.tagMap.containsKey(par1Str) ? 0 : ((NBTTagShort)this.tagMap.get(par1Str)).data; ++ } catch (ClassCastException var3) { ++ throw new ReportedException(this.createCrashReport(par1Str, 2, var3)); ++ } ++ } ++ ++ /** ++ * Retrieves an integer value using the specified key, or 0 if no such key was stored. ++ */ ++ public int getInteger(String par1Str) { ++ try { ++ return !this.tagMap.containsKey(par1Str) ? 0 : ((NBTTagInt)this.tagMap.get(par1Str)).data; ++ } catch (ClassCastException var3) { ++ throw new ReportedException(this.createCrashReport(par1Str, 3, var3)); ++ } ++ } ++ ++ /** ++ * Retrieves a long value using the specified key, or 0 if no such key was stored. ++ */ ++ public long getLong(String par1Str) { ++ try { ++ return !this.tagMap.containsKey(par1Str) ? 0L : ((NBTTagLong)this.tagMap.get(par1Str)).data; ++ } catch (ClassCastException var3) { ++ throw new ReportedException(this.createCrashReport(par1Str, 4, var3)); ++ } ++ } ++ ++ /** ++ * Retrieves a float value using the specified key, or 0 if no such key was stored. ++ */ ++ public float getFloat(String par1Str) { ++ try { ++ return !this.tagMap.containsKey(par1Str) ? 0.0F : ((NBTTagFloat)this.tagMap.get(par1Str)).data; ++ } catch (ClassCastException var3) { ++ throw new ReportedException(this.createCrashReport(par1Str, 5, var3)); ++ } ++ } ++ ++ /** ++ * Retrieves a double value using the specified key, or 0 if no such key was stored. ++ */ ++ public double getDouble(String par1Str) { ++ try { ++ return !this.tagMap.containsKey(par1Str) ? 0.0D : ((NBTTagDouble)this.tagMap.get(par1Str)).data; ++ } catch (ClassCastException var3) { ++ throw new ReportedException(this.createCrashReport(par1Str, 6, var3)); ++ } ++ } ++ ++ /** ++ * Retrieves a string value using the specified key, or an empty string if no such key was stored. ++ */ ++ public String getString(String par1Str) { ++ try { ++ return !this.tagMap.containsKey(par1Str) ? "" : ((NBTTagString)this.tagMap.get(par1Str)).data; ++ } catch (ClassCastException var3) { ++ throw new ReportedException(this.createCrashReport(par1Str, 8, var3)); ++ } ++ } ++ ++ /** ++ * Retrieves a byte array using the specified key, or a zero-length array if no such key was stored. ++ */ ++ public byte[] getByteArray(String par1Str) { ++ try { ++ return !this.tagMap.containsKey(par1Str) ? new byte[0] : ((NBTTagByteArray)this.tagMap.get(par1Str)).byteArray; ++ } catch (ClassCastException var3) { ++ throw new ReportedException(this.createCrashReport(par1Str, 7, var3)); ++ } ++ } ++ ++ /** ++ * Retrieves an int array using the specified key, or a zero-length array if no such key was stored. ++ */ ++ public int[] getIntArray(String par1Str) { ++ try { ++ return !this.tagMap.containsKey(par1Str) ? new int[0] : ((NBTTagIntArray)this.tagMap.get(par1Str)).intArray; ++ } catch (ClassCastException var3) { ++ throw new ReportedException(this.createCrashReport(par1Str, 11, var3)); ++ } ++ } ++ ++ /** ++ * Retrieves a NBTTagCompound subtag matching the specified key, or a new empty NBTTagCompound if no such key was ++ * stored. ++ */ ++ public NBTTagCompound getCompoundTag(String par1Str) { ++ try { ++ return !this.tagMap.containsKey(par1Str) ? new NBTTagCompound(par1Str) : (NBTTagCompound)this.tagMap.get(par1Str); ++ } catch (ClassCastException var3) { ++ throw new ReportedException(this.createCrashReport(par1Str, 10, var3)); ++ } ++ } ++ ++ /** ++ * Retrieves a NBTTagList subtag matching the specified key, or a new empty NBTTagList if no such key was stored. ++ */ ++ public NBTTagList getTagList(String par1Str) { ++ try { ++ return !this.tagMap.containsKey(par1Str) ? new NBTTagList(par1Str) : (NBTTagList)this.tagMap.get(par1Str); ++ } catch (ClassCastException var3) { ++ throw new ReportedException(this.createCrashReport(par1Str, 9, var3)); ++ } ++ } ++ ++ /** ++ * Retrieves a boolean value using the specified key, or false if no such key was stored. This uses the getByte method. ++ */ ++ public boolean getBoolean(String par1Str) { ++ return this.getByte(par1Str) != 0; ++ } ++ ++ /** ++ * Remove the specified tag. ++ */ ++ public void removeTag(String par1Str) { ++ this.tagMap.remove(par1Str); + } + + public String toString() { + String var1 = this.getName() + ":["; +- + String var3; +- for(Iterator var2 = this.a.keySet().iterator(); var2.hasNext(); var1 = var1 + var3 + ":" + this.a.get(var3) + ",") { ++ ++ for (Iterator var2 = this.tagMap.keySet().iterator(); var2.hasNext(); var1 = var1 + var3 + ":" + this.tagMap.get(var3) + ",") { + var3 = (String)var2.next(); + } + + return var1 + "]"; + } + ++ /** ++ * Return whether this compound has no tags. ++ */ + public boolean hasNoTags() { +- return this.a.isEmpty(); ++ return this.tagMap.isEmpty(); + } + +- private CrashReport createCrashReport(String var1, int var2, ClassCastException var3) { +- CrashReport var4 = CrashReport.makeCrashReport(var3, "Reading NBT data"); ++ /** ++ * Create a crash report which indicates a NBT read error. ++ */ ++ private CrashReport createCrashReport(String par1Str, int par2, ClassCastException par3ClassCastException) { ++ CrashReport var4 = CrashReport.makeCrashReport(par3ClassCastException, "Reading NBT data"); + CrashReportCategory var5 = var4.makeCategoryDepth("Corrupt NBT tag", 1); +- var5.addCrashSectionCallable("Tag type found", new CallableTagCompound1(this, var1)); +- var5.addCrashSectionCallable("Tag type expected", new CallableTagCompound2(this, var2)); +- var5.addCrashSection("Tag name", var1); +- if(this.getName() != null && this.getName().length() > 0) { ++ var5.addCrashSectionCallable("Tag type found", new CallableTagCompound1(this, par1Str)); ++ var5.addCrashSectionCallable("Tag type expected", new CallableTagCompound2(this, par2)); ++ var5.addCrashSection("Tag name", par1Str); ++ ++ if (this.getName() != null && this.getName().length() > 0) { + var5.addCrashSection("Tag parent", this.getName()); + } + + return var4; + } + ++ /** ++ * Creates a clone of the tag. ++ */ + public NBTBase copy() { + NBTTagCompound var1 = new NBTTagCompound(this.getName()); +- Iterator var2 = this.a.keySet().iterator(); ++ Iterator var2 = this.tagMap.keySet().iterator(); + +- while(var2.hasNext()) { ++ while (var2.hasNext()) { + String var3 = (String)var2.next(); +- var1.setTag(var3, ((NBTBase)this.a.get(var3)).copy()); ++ var1.setTag(var3, ((NBTBase)this.tagMap.get(var3)).copy()); + } + + return var1; + } + +- public boolean equals(Object var1) { +- if(super.equals(var1)) { +- NBTTagCompound var2 = (NBTTagCompound)var1; +- return this.a.entrySet().equals(var2.a.entrySet()); ++ public boolean equals(Object par1Obj) { ++ if (super.equals(par1Obj)) { ++ NBTTagCompound var2 = (NBTTagCompound)par1Obj; ++ return this.tagMap.entrySet().equals(var2.tagMap.entrySet()); + } else { + return false; + } + } + + public int hashCode() { +- return super.hashCode() ^ this.a.hashCode(); ++ return super.hashCode() ^ this.tagMap.hashCode(); + } + +- static Map getTagMap(NBTTagCompound var0) { +- return var0.a; ++ /** ++ * Return the tag map for this compound. ++ */ ++ static Map getTagMap(NBTTagCompound par0NBTTagCompound) { ++ return par0NBTTagCompound.tagMap; + } + } diff --git a/patches/net/minecraft/src/NBTTagDouble.java.patch b/patches/net/minecraft/src/NBTTagDouble.java.patch new file mode 100644 index 0000000..105c853 --- /dev/null +++ b/patches/net/minecraft/src/NBTTagDouble.java.patch @@ -0,0 +1,76 @@ +--- net/minecraft/src/NBTTagDouble.java ++++ net/minecraft/src/NBTTagDouble.java +@@ -5,25 +5,36 @@ + import java.io.IOException; + + public class NBTTagDouble extends NBTBase { ++ ++ /** The double value for the tag. */ + public double data; + +- public NBTTagDouble(String var1) { +- super(var1); +- } +- +- public NBTTagDouble(String var1, double var2) { +- super(var1); +- this.data = var2; +- } +- +- void write(DataOutput var1) throws IOException { +- var1.writeDouble(this.data); +- } +- +- void load(DataInput var1, int var2) throws IOException { +- this.data = var1.readDouble(); +- } +- ++ public NBTTagDouble(String par1Str) { ++ super(par1Str); ++ } ++ ++ public NBTTagDouble(String par1Str, double par2) { ++ super(par1Str); ++ this.data = par2; ++ } ++ ++ /** ++ * Write the actual data contents of the tag, implemented in NBT extension classes ++ */ ++ void write(DataOutput par1DataOutput) throws IOException { ++ par1DataOutput.writeDouble(this.data); ++ } ++ ++ /** ++ * Read the actual data contents of the tag, implemented in NBT extension classes ++ */ ++ void load(DataInput par1DataInput, int par2) throws IOException { ++ this.data = par1DataInput.readDouble(); ++ } ++ ++ /** ++ * Gets the type byte for the tag. ++ */ + public byte getId() { + return (byte)6; + } +@@ -32,13 +43,16 @@ + return "" + this.data; + } + ++ /** ++ * Creates a clone of the tag. ++ */ + public NBTBase copy() { + return new NBTTagDouble(this.getName(), this.data); + } + +- public boolean equals(Object var1) { +- if(super.equals(var1)) { +- NBTTagDouble var2 = (NBTTagDouble)var1; ++ public boolean equals(Object par1Obj) { ++ if (super.equals(par1Obj)) { ++ NBTTagDouble var2 = (NBTTagDouble)par1Obj; + return this.data == var2.data; + } else { + return false; diff --git a/patches/net/minecraft/src/NBTTagEnd.java.patch b/patches/net/minecraft/src/NBTTagEnd.java.patch new file mode 100644 index 0000000..2a103d0 --- /dev/null +++ b/patches/net/minecraft/src/NBTTagEnd.java.patch @@ -0,0 +1,38 @@ +--- net/minecraft/src/NBTTagEnd.java ++++ net/minecraft/src/NBTTagEnd.java +@@ -9,12 +9,19 @@ + super((String)null); + } + +- void load(DataInput var1, int var2) throws IOException { +- } +- +- void write(DataOutput var1) throws IOException { +- } +- ++ /** ++ * Read the actual data contents of the tag, implemented in NBT extension classes ++ */ ++ void load(DataInput par1DataInput, int par2) throws IOException {} ++ ++ /** ++ * Write the actual data contents of the tag, implemented in NBT extension classes ++ */ ++ void write(DataOutput par1DataOutput) throws IOException {} ++ ++ /** ++ * Gets the type byte for the tag. ++ */ + public byte getId() { + return (byte)0; + } +@@ -23,6 +30,9 @@ + return "END"; + } + ++ /** ++ * Creates a clone of the tag. ++ */ + public NBTBase copy() { + return new NBTTagEnd(); + } diff --git a/patches/net/minecraft/src/NBTTagFloat.java.patch b/patches/net/minecraft/src/NBTTagFloat.java.patch new file mode 100644 index 0000000..6db41aa --- /dev/null +++ b/patches/net/minecraft/src/NBTTagFloat.java.patch @@ -0,0 +1,76 @@ +--- net/minecraft/src/NBTTagFloat.java ++++ net/minecraft/src/NBTTagFloat.java +@@ -5,25 +5,36 @@ + import java.io.IOException; + + public class NBTTagFloat extends NBTBase { ++ ++ /** The float value for the tag. */ + public float data; + +- public NBTTagFloat(String var1) { +- super(var1); +- } +- +- public NBTTagFloat(String var1, float var2) { +- super(var1); +- this.data = var2; +- } +- +- void write(DataOutput var1) throws IOException { +- var1.writeFloat(this.data); +- } +- +- void load(DataInput var1, int var2) throws IOException { +- this.data = var1.readFloat(); +- } +- ++ public NBTTagFloat(String par1Str) { ++ super(par1Str); ++ } ++ ++ public NBTTagFloat(String par1Str, float par2) { ++ super(par1Str); ++ this.data = par2; ++ } ++ ++ /** ++ * Write the actual data contents of the tag, implemented in NBT extension classes ++ */ ++ void write(DataOutput par1DataOutput) throws IOException { ++ par1DataOutput.writeFloat(this.data); ++ } ++ ++ /** ++ * Read the actual data contents of the tag, implemented in NBT extension classes ++ */ ++ void load(DataInput par1DataInput, int par2) throws IOException { ++ this.data = par1DataInput.readFloat(); ++ } ++ ++ /** ++ * Gets the type byte for the tag. ++ */ + public byte getId() { + return (byte)5; + } +@@ -32,13 +43,16 @@ + return "" + this.data; + } + ++ /** ++ * Creates a clone of the tag. ++ */ + public NBTBase copy() { + return new NBTTagFloat(this.getName(), this.data); + } + +- public boolean equals(Object var1) { +- if(super.equals(var1)) { +- NBTTagFloat var2 = (NBTTagFloat)var1; ++ public boolean equals(Object par1Obj) { ++ if (super.equals(par1Obj)) { ++ NBTTagFloat var2 = (NBTTagFloat)par1Obj; + return this.data == var2.data; + } else { + return false; diff --git a/patches/net/minecraft/src/NBTTagInt.java.patch b/patches/net/minecraft/src/NBTTagInt.java.patch new file mode 100644 index 0000000..283b404 --- /dev/null +++ b/patches/net/minecraft/src/NBTTagInt.java.patch @@ -0,0 +1,76 @@ +--- net/minecraft/src/NBTTagInt.java ++++ net/minecraft/src/NBTTagInt.java +@@ -5,25 +5,36 @@ + import java.io.IOException; + + public class NBTTagInt extends NBTBase { ++ ++ /** The integer value for the tag. */ + public int data; + +- public NBTTagInt(String var1) { +- super(var1); +- } +- +- public NBTTagInt(String var1, int var2) { +- super(var1); +- this.data = var2; +- } +- +- void write(DataOutput var1) throws IOException { +- var1.writeInt(this.data); +- } +- +- void load(DataInput var1, int var2) throws IOException { +- this.data = var1.readInt(); +- } +- ++ public NBTTagInt(String par1Str) { ++ super(par1Str); ++ } ++ ++ public NBTTagInt(String par1Str, int par2) { ++ super(par1Str); ++ this.data = par2; ++ } ++ ++ /** ++ * Write the actual data contents of the tag, implemented in NBT extension classes ++ */ ++ void write(DataOutput par1DataOutput) throws IOException { ++ par1DataOutput.writeInt(this.data); ++ } ++ ++ /** ++ * Read the actual data contents of the tag, implemented in NBT extension classes ++ */ ++ void load(DataInput par1DataInput, int par2) throws IOException { ++ this.data = par1DataInput.readInt(); ++ } ++ ++ /** ++ * Gets the type byte for the tag. ++ */ + public byte getId() { + return (byte)3; + } +@@ -32,13 +43,16 @@ + return "" + this.data; + } + ++ /** ++ * Creates a clone of the tag. ++ */ + public NBTBase copy() { + return new NBTTagInt(this.getName(), this.data); + } + +- public boolean equals(Object var1) { +- if(super.equals(var1)) { +- NBTTagInt var2 = (NBTTagInt)var1; ++ public boolean equals(Object par1Obj) { ++ if (super.equals(par1Obj)) { ++ NBTTagInt var2 = (NBTTagInt)par1Obj; + return this.data == var2.data; + } else { + return false; diff --git a/patches/net/minecraft/src/NBTTagIntArray.java.patch b/patches/net/minecraft/src/NBTTagIntArray.java.patch new file mode 100644 index 0000000..c738cd6 --- /dev/null +++ b/patches/net/minecraft/src/NBTTagIntArray.java.patch @@ -0,0 +1,92 @@ +--- net/minecraft/src/NBTTagIntArray.java ++++ net/minecraft/src/NBTTagIntArray.java +@@ -6,36 +6,45 @@ + import java.util.Arrays; + + public class NBTTagIntArray extends NBTBase { ++ ++ /** The array of saved integers */ + public int[] intArray; + +- public NBTTagIntArray(String var1) { +- super(var1); +- } +- +- public NBTTagIntArray(String var1, int[] var2) { +- super(var1); +- this.intArray = var2; +- } +- +- void write(DataOutput var1) throws IOException { +- var1.writeInt(this.intArray.length); +- +- for(int var2 = 0; var2 < this.intArray.length; ++var2) { +- var1.writeInt(this.intArray[var2]); ++ public NBTTagIntArray(String par1Str) { ++ super(par1Str); ++ } ++ ++ public NBTTagIntArray(String par1Str, int[] par2ArrayOfInteger) { ++ super(par1Str); ++ this.intArray = par2ArrayOfInteger; ++ } ++ ++ /** ++ * Write the actual data contents of the tag, implemented in NBT extension classes ++ */ ++ void write(DataOutput par1DataOutput) throws IOException { ++ par1DataOutput.writeInt(this.intArray.length); ++ ++ for (int var2 = 0; var2 < this.intArray.length; ++var2) { ++ par1DataOutput.writeInt(this.intArray[var2]); + } +- + } + +- void load(DataInput var1, int var2) throws IOException { +- int var3 = var1.readInt(); ++ /** ++ * Read the actual data contents of the tag, implemented in NBT extension classes ++ */ ++ void load(DataInput par1DataInput, int par2) throws IOException { ++ int var3 = par1DataInput.readInt(); + this.intArray = new int[var3]; + +- for(int var4 = 0; var4 < var3; ++var4) { +- this.intArray[var4] = var1.readInt(); ++ for (int var4 = 0; var4 < var3; ++var4) { ++ this.intArray[var4] = par1DataInput.readInt(); + } +- + } + ++ /** ++ * Gets the type byte for the tag. ++ */ + public byte getId() { + return (byte)11; + } +@@ -44,17 +53,20 @@ + return "[" + this.intArray.length + " bytes]"; + } + ++ /** ++ * Creates a clone of the tag. ++ */ + public NBTBase copy() { + int[] var1 = new int[this.intArray.length]; + System.arraycopy(this.intArray, 0, var1, 0, this.intArray.length); + return new NBTTagIntArray(this.getName(), var1); + } + +- public boolean equals(Object var1) { +- if(!super.equals(var1)) { ++ public boolean equals(Object par1Obj) { ++ if (!super.equals(par1Obj)) { + return false; + } else { +- NBTTagIntArray var2 = (NBTTagIntArray)var1; ++ NBTTagIntArray var2 = (NBTTagIntArray)par1Obj; + return this.intArray == null && var2.intArray == null || this.intArray != null && Arrays.equals(this.intArray, var2.intArray); + } + } diff --git a/patches/net/minecraft/src/NBTTagList.java.patch b/patches/net/minecraft/src/NBTTagList.java.patch new file mode 100644 index 0000000..b187384 --- /dev/null +++ b/patches/net/minecraft/src/NBTTagList.java.patch @@ -0,0 +1,182 @@ +--- net/minecraft/src/NBTTagList.java ++++ net/minecraft/src/NBTTagList.java +@@ -8,94 +8,126 @@ + import java.util.List; + + public class NBTTagList extends NBTBase { +- private List a = new ArrayList(); ++ ++ /** The array list containing the tags encapsulated in this list. */ ++ // Spout Start - private to public ++ public List tagList = new ArrayList(); ++ // Spout End ++ ++ /** ++ * The type byte for the tags in the list - they must all be of the same type. ++ */ + private byte tagType; + + public NBTTagList() { + super(""); + } + +- public NBTTagList(String var1) { +- super(var1); ++ public NBTTagList(String par1Str) { ++ super(par1Str); + } + +- void write(DataOutput var1) throws IOException { +- if(!this.a.isEmpty()) { +- this.tagType = ((NBTBase)this.a.get(0)).getId(); ++ /** ++ * Write the actual data contents of the tag, implemented in NBT extension classes ++ */ ++ void write(DataOutput par1DataOutput) throws IOException { ++ if (!this.tagList.isEmpty()) { ++ this.tagType = ((NBTBase)this.tagList.get(0)).getId(); + } else { + this.tagType = 1; + } + +- var1.writeByte(this.tagType); +- var1.writeInt(this.a.size()); ++ par1DataOutput.writeByte(this.tagType); ++ par1DataOutput.writeInt(this.tagList.size()); + +- for(int var2 = 0; var2 < this.a.size(); ++var2) { +- ((NBTBase)this.a.get(var2)).write(var1); ++ for (int var2 = 0; var2 < this.tagList.size(); ++var2) { ++ ((NBTBase)this.tagList.get(var2)).write(par1DataOutput); + } +- + } + +- void load(DataInput var1, int var2) throws IOException { +- if(var2 > 512) { ++ /** ++ * Read the actual data contents of the tag, implemented in NBT extension classes ++ */ ++ void load(DataInput par1DataInput, int par2) throws IOException { ++ if (par2 > 512) { + throw new RuntimeException("Tried to read NBT tag with too high complexity, depth > 512"); + } else { +- this.tagType = var1.readByte(); +- int var3 = var1.readInt(); +- this.a = new ArrayList(); ++ this.tagType = par1DataInput.readByte(); ++ int var3 = par1DataInput.readInt(); ++ this.tagList = new ArrayList(); + +- for(int var4 = 0; var4 < var3; ++var4) { ++ for (int var4 = 0; var4 < var3; ++var4) { + NBTBase var5 = NBTBase.newTag(this.tagType, (String)null); +- var5.load(var1, var2 + 1); +- this.a.add(var5); ++ var5.load(par1DataInput, par2 + 1); ++ this.tagList.add(var5); + } +- + } + } + ++ /** ++ * Gets the type byte for the tag. ++ */ + public byte getId() { + return (byte)9; + } + + public String toString() { +- return "" + this.a.size() + " entries of type " + NBTBase.getTagName(this.tagType); +- } +- +- public void appendTag(NBTBase var1) { +- this.tagType = var1.getId(); +- this.a.add(var1); +- } +- +- public NBTBase removeTag(int var1) { +- return (NBTBase)this.a.remove(var1); +- } +- +- public NBTBase tagAt(int var1) { +- return (NBTBase)this.a.get(var1); +- } +- ++ return "" + this.tagList.size() + " entries of type " + NBTBase.getTagName(this.tagType); ++ } ++ ++ /** ++ * Adds the provided tag to the end of the list. There is no check to verify this tag is of the same type as any ++ * previous tag. ++ */ ++ public void appendTag(NBTBase par1NBTBase) { ++ this.tagType = par1NBTBase.getId(); ++ this.tagList.add(par1NBTBase); ++ } ++ ++ /** ++ * Removes a tag at the given index. ++ */ ++ public NBTBase removeTag(int par1) { ++ return (NBTBase)this.tagList.remove(par1); ++ } ++ ++ /** ++ * Retrieves the tag at the specified index from the list. ++ */ ++ public NBTBase tagAt(int par1) { ++ return (NBTBase)this.tagList.get(par1); ++ } ++ ++ /** ++ * Returns the number of tags in the list. ++ */ + public int tagCount() { +- return this.a.size(); ++ return this.tagList.size(); + } + ++ /** ++ * Creates a clone of the tag. ++ */ + public NBTBase copy() { + NBTTagList var1 = new NBTTagList(this.getName()); + var1.tagType = this.tagType; +- Iterator var2 = this.a.iterator(); ++ Iterator var2 = this.tagList.iterator(); + +- while(var2.hasNext()) { ++ while (var2.hasNext()) { + NBTBase var3 = (NBTBase)var2.next(); + NBTBase var4 = var3.copy(); +- var1.a.add(var4); ++ var1.tagList.add(var4); + } + + return var1; + } + +- public boolean equals(Object var1) { +- if(super.equals(var1)) { +- NBTTagList var2 = (NBTTagList)var1; +- if(this.tagType == var2.tagType) { +- return this.a.equals(var2.a); ++ public boolean equals(Object par1Obj) { ++ if (super.equals(par1Obj)) { ++ NBTTagList var2 = (NBTTagList)par1Obj; ++ ++ if (this.tagType == var2.tagType) { ++ return this.tagList.equals(var2.tagList); + } + } + +@@ -103,6 +135,6 @@ + } + + public int hashCode() { +- return super.hashCode() ^ this.a.hashCode(); ++ return super.hashCode() ^ this.tagList.hashCode(); + } + } diff --git a/patches/net/minecraft/src/NBTTagLong.java.patch b/patches/net/minecraft/src/NBTTagLong.java.patch new file mode 100644 index 0000000..b60ace4 --- /dev/null +++ b/patches/net/minecraft/src/NBTTagLong.java.patch @@ -0,0 +1,76 @@ +--- net/minecraft/src/NBTTagLong.java ++++ net/minecraft/src/NBTTagLong.java +@@ -5,25 +5,36 @@ + import java.io.IOException; + + public class NBTTagLong extends NBTBase { ++ ++ /** The long value for the tag. */ + public long data; + +- public NBTTagLong(String var1) { +- super(var1); +- } +- +- public NBTTagLong(String var1, long var2) { +- super(var1); +- this.data = var2; +- } +- +- void write(DataOutput var1) throws IOException { +- var1.writeLong(this.data); +- } +- +- void load(DataInput var1, int var2) throws IOException { +- this.data = var1.readLong(); +- } +- ++ public NBTTagLong(String par1Str) { ++ super(par1Str); ++ } ++ ++ public NBTTagLong(String par1Str, long par2) { ++ super(par1Str); ++ this.data = par2; ++ } ++ ++ /** ++ * Write the actual data contents of the tag, implemented in NBT extension classes ++ */ ++ void write(DataOutput par1DataOutput) throws IOException { ++ par1DataOutput.writeLong(this.data); ++ } ++ ++ /** ++ * Read the actual data contents of the tag, implemented in NBT extension classes ++ */ ++ void load(DataInput par1DataInput, int par2) throws IOException { ++ this.data = par1DataInput.readLong(); ++ } ++ ++ /** ++ * Gets the type byte for the tag. ++ */ + public byte getId() { + return (byte)4; + } +@@ -32,13 +43,16 @@ + return "" + this.data; + } + ++ /** ++ * Creates a clone of the tag. ++ */ + public NBTBase copy() { + return new NBTTagLong(this.getName(), this.data); + } + +- public boolean equals(Object var1) { +- if(super.equals(var1)) { +- NBTTagLong var2 = (NBTTagLong)var1; ++ public boolean equals(Object par1Obj) { ++ if (super.equals(par1Obj)) { ++ NBTTagLong var2 = (NBTTagLong)par1Obj; + return this.data == var2.data; + } else { + return false; diff --git a/patches/net/minecraft/src/NBTTagShort.java.patch b/patches/net/minecraft/src/NBTTagShort.java.patch new file mode 100644 index 0000000..14b3756 --- /dev/null +++ b/patches/net/minecraft/src/NBTTagShort.java.patch @@ -0,0 +1,76 @@ +--- net/minecraft/src/NBTTagShort.java ++++ net/minecraft/src/NBTTagShort.java +@@ -5,25 +5,36 @@ + import java.io.IOException; + + public class NBTTagShort extends NBTBase { ++ ++ /** The short value for the tag. */ + public short data; + +- public NBTTagShort(String var1) { +- super(var1); +- } +- +- public NBTTagShort(String var1, short var2) { +- super(var1); +- this.data = var2; +- } +- +- void write(DataOutput var1) throws IOException { +- var1.writeShort(this.data); +- } +- +- void load(DataInput var1, int var2) throws IOException { +- this.data = var1.readShort(); +- } +- ++ public NBTTagShort(String par1Str) { ++ super(par1Str); ++ } ++ ++ public NBTTagShort(String par1Str, short par2) { ++ super(par1Str); ++ this.data = par2; ++ } ++ ++ /** ++ * Write the actual data contents of the tag, implemented in NBT extension classes ++ */ ++ void write(DataOutput par1DataOutput) throws IOException { ++ par1DataOutput.writeShort(this.data); ++ } ++ ++ /** ++ * Read the actual data contents of the tag, implemented in NBT extension classes ++ */ ++ void load(DataInput par1DataInput, int par2) throws IOException { ++ this.data = par1DataInput.readShort(); ++ } ++ ++ /** ++ * Gets the type byte for the tag. ++ */ + public byte getId() { + return (byte)2; + } +@@ -32,13 +43,16 @@ + return "" + this.data; + } + ++ /** ++ * Creates a clone of the tag. ++ */ + public NBTBase copy() { + return new NBTTagShort(this.getName(), this.data); + } + +- public boolean equals(Object var1) { +- if(super.equals(var1)) { +- NBTTagShort var2 = (NBTTagShort)var1; ++ public boolean equals(Object par1Obj) { ++ if (super.equals(par1Obj)) { ++ NBTTagShort var2 = (NBTTagShort)par1Obj; + return this.data == var2.data; + } else { + return false; diff --git a/patches/net/minecraft/src/NBTTagString.java.patch b/patches/net/minecraft/src/NBTTagString.java.patch new file mode 100644 index 0000000..e77a49b --- /dev/null +++ b/patches/net/minecraft/src/NBTTagString.java.patch @@ -0,0 +1,91 @@ +--- net/minecraft/src/NBTTagString.java ++++ net/minecraft/src/NBTTagString.java +@@ -5,50 +5,65 @@ + import java.io.IOException; + + public class NBTTagString extends NBTBase { +- public String a; +- +- public NBTTagString(String var1) { +- super(var1); ++ ++ /** The string value for the tag (cannot be empty). */ ++ public String data; ++ ++ public NBTTagString(String par1Str) { ++ super(par1Str); + } + +- public NBTTagString(String var1, String var2) { +- super(var1); +- this.a = var2; +- if(var2 == null) { ++ public NBTTagString(String par1Str, String par2Str) { ++ super(par1Str); ++ this.data = par2Str; ++ ++ if (par2Str == null) { + throw new IllegalArgumentException("Empty string not allowed"); + } + } + +- void write(DataOutput var1) throws IOException { +- var1.writeUTF(this.a); +- } +- +- void load(DataInput var1, int var2) throws IOException { +- this.a = var1.readUTF(); +- } +- ++ /** ++ * Write the actual data contents of the tag, implemented in NBT extension classes ++ */ ++ void write(DataOutput par1DataOutput) throws IOException { ++ par1DataOutput.writeUTF(this.data); ++ } ++ ++ /** ++ * Read the actual data contents of the tag, implemented in NBT extension classes ++ */ ++ void load(DataInput par1DataInput, int par2) throws IOException { ++ this.data = par1DataInput.readUTF(); ++ } ++ ++ /** ++ * Gets the type byte for the tag. ++ */ + public byte getId() { + return (byte)8; + } + + public String toString() { +- return "" + this.a; ++ return "" + this.data; + } + ++ /** ++ * Creates a clone of the tag. ++ */ + public NBTBase copy() { +- return new NBTTagString(this.getName(), this.a); ++ return new NBTTagString(this.getName(), this.data); + } + +- public boolean equals(Object var1) { +- if(!super.equals(var1)) { ++ public boolean equals(Object par1Obj) { ++ if (!super.equals(par1Obj)) { + return false; + } else { +- NBTTagString var2 = (NBTTagString)var1; +- return this.a == null && var2.a == null || this.a != null && this.a.equals(var2.a); ++ NBTTagString var2 = (NBTTagString)par1Obj; ++ return this.data == null && var2.data == null || this.data != null && this.data.equals(var2.data); + } + } + + public int hashCode() { +- return super.hashCode() ^ this.a.hashCode(); ++ return super.hashCode() ^ this.data.hashCode(); + } + } diff --git a/patches/net/minecraft/src/NetClientHandler.java.patch b/patches/net/minecraft/src/NetClientHandler.java.patch new file mode 100644 index 0000000..1383abd --- /dev/null +++ b/patches/net/minecraft/src/NetClientHandler.java.patch @@ -0,0 +1,2163 @@ +--- net/minecraft/src/NetClientHandler.java ++++ net/minecraft/src/NetClientHandler.java +@@ -1,6 +1,5 @@ + package net.minecraft.src; + +-import com.google.common.base.Charsets; + import java.io.BufferedReader; + import java.io.ByteArrayInputStream; + import java.io.DataInputStream; +@@ -8,93 +7,159 @@ + import java.io.InputStream; + import java.io.InputStreamReader; + import java.math.BigInteger; +-import java.net.InetAddress; ++import java.net.InetSocketAddress; + import java.net.Socket; + import java.net.URL; + import java.net.URLEncoder; ++import java.net.UnknownHostException; + import java.security.PublicKey; + import java.util.ArrayList; + import java.util.HashMap; + import java.util.Iterator; ++import java.util.LinkedList; + import java.util.List; + import java.util.Map; + import java.util.Random; ++ + import javax.crypto.SecretKey; +-import net.minecraft.client.ClientBrandRetriever; ++ ++import com.google.common.base.Charsets; ++ + import org.lwjgl.input.Keyboard; + ++import net.minecraft.client.ClientBrandRetriever; ++ ++import org.spoutcraft.client.SpoutClient; ++import org.spoutcraft.client.config.Configuration; ++import org.spoutcraft.client.gui.precache.GuiPrecache; ++import org.spoutcraft.client.io.FileDownloadThread; ++import org.spoutcraft.client.player.ClientPlayer; ++import org.spoutcraft.client.util.NetworkUtils; ++ ++// Spout Start - Unused import ++//import java.net.InetAddress; ++// Spout End + public class NetClientHandler extends NetHandler { ++ ++ /** True if kicked or disconnected from the server. */ + private boolean disconnected; ++ ++ /** Reference to the NetworkManager object. */ + private INetworkManager netManager; +- public String a; ++ public String field_72560_a; ++ ++ /** Reference to the Minecraft object. */ + private Minecraft mc; + private WorldClient worldClient; ++ ++ /** ++ * True if the client has finished downloading terrain and may spawn. Set upon receipt of a player position packet, ++ * reset upon respawning. ++ */ + private boolean doneLoadingTerrain; + public MapStorage mapStorage = new MapStorage((ISaveHandler)null); +- private Map k = new HashMap(); +- public List c = new ArrayList(); ++ ++ /** A HashMap of all player names and their player information objects */ ++ private Map playerInfoMap = new HashMap(); ++ ++ /** ++ * An ArrayList of GuiPlayerInfo (includes all the players' GuiPlayerInfo on the current server) ++ */ ++ public List playerInfoList = new ArrayList(); + public int currentServerMaxPlayers = 20; + private GuiScreen field_98183_l; +- Random e = new Random(); +- +- public NetClientHandler(Minecraft var1, String var2, int var3) { +- this.mc = var1; +- Socket var4 = new Socket(InetAddress.getByName(var2), var3); +- this.netManager = new TcpConnection(var1.getLogAgent(), var4, "Client", this); +- } +- +- public NetClientHandler(Minecraft var1, String var2, int var3, GuiScreen var4) { +- this.mc = var1; +- this.field_98183_l = var4; +- Socket var5 = new Socket(InetAddress.getByName(var2), var3); +- this.netManager = new TcpConnection(var1.getLogAgent(), var5, "Client", this); +- } +- +- public NetClientHandler(Minecraft var1, IntegratedServer var2) { +- this.mc = var1; +- this.netManager = new MemoryConnection(var1.getLogAgent(), this); +- var2.getServerListeningThread().func_71754_a((MemoryConnection)this.netManager, var1.getSession().getUsername()); +- } +- ++ ++ /** RNG. */ ++ Random rand = new Random(); ++ // Spout Start ++ long timeout = System.currentTimeMillis() + 5000; ++ public LinkedList queue = new LinkedList(); ++ public long packetQueueTime = 0L; ++ public boolean queued = false; ++ // Spout End ++ ++ public NetClientHandler(Minecraft par1Minecraft, String par2Str, int par3) throws IOException { ++ this(par1Minecraft, par2Str, par3, null); //Spout ++ } ++ ++ public NetClientHandler(Minecraft par1Minecraft, String par2Str, int par3, GuiScreen par4GuiScreen) throws IOException { ++ this.mc = par1Minecraft; ++ this.field_98183_l = par4GuiScreen; ++ // Spout Start ++ InetSocketAddress address = NetworkUtils.resolve(par2Str, par3); ++ if (address.isUnresolved()) { ++ throw new UnknownHostException(address.getHostName()); ++ } ++ this.netManager = new TcpConnection(par1Minecraft.getLogAgent(), new Socket(address.getAddress(), address.getPort()), "Client", this); ++ ++ org.spoutcraft.client.gui.error.GuiConnectionLost.lastServerIp = par2Str; ++ org.spoutcraft.client.gui.error.GuiConnectionLost.lastServerPort = par3; ++ ++ ClientPlayer.getInstance().resetMainScreen(); ++ SpoutClient.getInstance().setSpoutActive(false); ++ // Spout End ++ } ++ ++ public NetClientHandler(Minecraft par1Minecraft, IntegratedServer par2IntegratedServer) throws IOException { ++ this.mc = par1Minecraft; ++ this.netManager = new MemoryConnection(par1Minecraft.getLogAgent(), this); ++ par2IntegratedServer.getServerListeningThread().func_71754_a((MemoryConnection)this.netManager, par1Minecraft.getSession().getUsername()); ++ } ++ ++ /** ++ * sets netManager and worldClient to null ++ */ + public void cleanup() { +- if(this.netManager != null) { ++ if (this.netManager != null) { + this.netManager.wakeThreads(); + } + + this.netManager = null; + this.worldClient = null; ++ ++ // Spout Start ++ ClientPlayer.getInstance().resetMainScreen(); ++ SpoutClient.getInstance().setSpoutActive(false); ++ // Spout End + } + ++ /** ++ * Processes the packets that have been read since the last call to this function. ++ */ + public void processReadPackets() { +- if(!this.disconnected && this.netManager != null) { ++ if (!this.disconnected && this.netManager != null) { + this.netManager.processReadPackets(); + } + +- if(this.netManager != null) { ++ if (this.netManager != null) { + this.netManager.wakeThreads(); + } +- + } + +- public void handleServerAuthData(Packet253ServerAuthData var1) { +- String var2 = var1.getServerId().trim(); +- PublicKey var3 = var1.getPublicKey(); ++ public void handleServerAuthData(Packet253ServerAuthData par1Packet253ServerAuthData) { ++ String var2 = par1Packet253ServerAuthData.getServerId().trim(); ++ PublicKey var3 = par1Packet253ServerAuthData.getPublicKey(); + SecretKey var4 = CryptManager.createNewSharedKey(); +- if(!"-".equals(var2)) { ++ ++ if (!"-".equals(var2)) { + String var5 = (new BigInteger(CryptManager.getServerIdHash(var2, var3, var4))).toString(16); + String var6 = this.sendSessionRequest(this.mc.getSession().getUsername(), this.mc.getSession().getSessionID(), var5); +- if(!"ok".equalsIgnoreCase(var6)) { +- this.netManager.networkShutdown("disconnect.loginFailedInfo", new Object[]{var6}); ++ ++ if (!"ok".equalsIgnoreCase(var6)) { ++ this.netManager.networkShutdown("disconnect.loginFailedInfo", new Object[] {var6}); + return; + } + } + +- this.addToSendQueue(new Packet252SharedKey(var4, var3, var1.getVerifyToken())); ++ this.addToSendQueue(new Packet252SharedKey(var4, var3, par1Packet253ServerAuthData.getVerifyToken())); + } + +- private String sendSessionRequest(String var1, String var2, String var3) { ++ /** ++ * Send request to http://session.minecraft.net with user's sessionId and serverId hash ++ */ ++ private String sendSessionRequest(String par1Str, String par2Str, String par3Str) { + try { +- URL var4 = new URL("http://session.minecraft.net/game/joinserver.jsp?user=" + urlEncode(var1) + "&sessionId=" + urlEncode(var2) + "&serverId=" + urlEncode(var3)); ++ URL var4 = new URL("http://session.minecraft.net/game/joinserver.jsp?user=" + urlEncode(par1Str) + "&sessionId=" + urlEncode(par2Str) + "&serverId=" + urlEncode(par3Str)); + InputStream var5 = var4.openConnection(this.mc.getProxy()).getInputStream(); + BufferedReader var6 = new BufferedReader(new InputStreamReader(var5)); + String var7 = var6.readLine(); +@@ -105,295 +170,336 @@ + } + } + +- private static String urlEncode(String var0) throws IOException { +- return URLEncoder.encode(var0, "UTF-8"); ++ /** ++ * Encode the given string for insertion into a URL ++ */ ++ private static String urlEncode(String par0Str) throws IOException { ++ return URLEncoder.encode(par0Str, "UTF-8"); + } + +- public void handleSharedKey(Packet252SharedKey var1) { ++ public void handleSharedKey(Packet252SharedKey par1Packet252SharedKey) { + this.addToSendQueue(new Packet205ClientCommand(0)); + } + +- public void handleLogin(Packet1Login var1) { ++ public void handleLogin(Packet1Login par1Packet1Login) { + this.mc.playerController = new PlayerControllerMP(this.mc, this); + this.mc.statFileWriter.readStat(StatList.joinMultiplayerStat, 1); +- this.worldClient = new WorldClient(this, new WorldSettings(0L, var1.gameType, false, var1.hardcoreMode, var1.terrainType), var1.dimension, var1.difficultySetting, this.mc.mcProfiler, this.mc.getLogAgent()); ++ this.worldClient = new WorldClient(this, new WorldSettings(0L, par1Packet1Login.gameType, false, par1Packet1Login.hardcoreMode, par1Packet1Login.terrainType), par1Packet1Login.dimension, par1Packet1Login.difficultySetting, this.mc.mcProfiler, this.mc.getLogAgent()); + this.worldClient.isRemote = true; + this.mc.loadWorld(this.worldClient); +- this.mc.thePlayer.dimension = var1.dimension; +- this.mc.displayGuiScreen(new GuiDownloadTerrain(this)); +- this.mc.thePlayer.entityId = var1.clientEntityId; +- this.currentServerMaxPlayers = var1.maxPlayers; +- this.mc.playerController.setGameType(var1.gameType); ++ this.mc.thePlayer.dimension = par1Packet1Login.dimension; ++ // Spout Start ++ if (!(this.mc.currentScreen instanceof GuiPrecache)) { ++ this.mc.displayGuiScreen(new GuiDownloadTerrain(this)); ++ } ++ //this.mc.displayGuiScreen(new org.spoutcraft.client.gui.precache.GuiPrecache()); ++ System.out.println("Starting cache manager... " + System.currentTimeMillis()); ++ // Spout End ++ this.mc.thePlayer.entityId = par1Packet1Login.clientEntityId; ++ this.currentServerMaxPlayers = par1Packet1Login.maxPlayers; ++ this.mc.playerController.setGameType(par1Packet1Login.gameType); + this.mc.gameSettings.sendSettingsToServer(); + this.netManager.addToSendQueue(new Packet250CustomPayload("MC|Brand", ClientBrandRetriever.getClientModName().getBytes(Charsets.UTF_8))); + } + +- public void handleVehicleSpawn(Packet23VehicleSpawn var1) { +- double var2 = (double)var1.xPosition / 32.0D; +- double var4 = (double)var1.yPosition / 32.0D; +- double var6 = (double)var1.zPosition / 32.0D; ++ public void handleVehicleSpawn(Packet23VehicleSpawn par1Packet23VehicleSpawn) { ++ double var2 = (double)par1Packet23VehicleSpawn.xPosition / 32.0D; ++ double var4 = (double)par1Packet23VehicleSpawn.yPosition / 32.0D; ++ double var6 = (double)par1Packet23VehicleSpawn.zPosition / 32.0D; + Object var8 = null; +- if(var1.type == 10) { +- var8 = EntityMinecart.createMinecart(this.worldClient, var2, var4, var6, var1.throwerEntityId); +- } else if(var1.type == 90) { +- Entity var9 = this.getEntityByID(var1.throwerEntityId); +- if(var9 instanceof EntityPlayer) { ++ ++ if (par1Packet23VehicleSpawn.type == 10) { ++ var8 = EntityMinecart.createMinecart(this.worldClient, var2, var4, var6, par1Packet23VehicleSpawn.throwerEntityId); ++ } else if (par1Packet23VehicleSpawn.type == 90) { ++ Entity var9 = this.getEntityByID(par1Packet23VehicleSpawn.throwerEntityId); ++ ++ if (var9 instanceof EntityPlayer) { + var8 = new EntityFishHook(this.worldClient, var2, var4, var6, (EntityPlayer)var9); + } + +- var1.throwerEntityId = 0; +- } else if(var1.type == 60) { ++ par1Packet23VehicleSpawn.throwerEntityId = 0; ++ } else if (par1Packet23VehicleSpawn.type == 60) { + var8 = new EntityArrow(this.worldClient, var2, var4, var6); +- } else if(var1.type == 61) { ++ } else if (par1Packet23VehicleSpawn.type == 61) { + var8 = new EntitySnowball(this.worldClient, var2, var4, var6); +- } else if(var1.type == 71) { +- var8 = new EntityItemFrame(this.worldClient, (int)var2, (int)var4, (int)var6, var1.throwerEntityId); +- var1.throwerEntityId = 0; +- } else if(var1.type == 77) { ++ } else if (par1Packet23VehicleSpawn.type == 71) { ++ var8 = new EntityItemFrame(this.worldClient, (int)var2, (int)var4, (int)var6, par1Packet23VehicleSpawn.throwerEntityId); ++ par1Packet23VehicleSpawn.throwerEntityId = 0; ++ } else if (par1Packet23VehicleSpawn.type == 77) { + var8 = new EntityLeashKnot(this.worldClient, (int)var2, (int)var4, (int)var6); +- var1.throwerEntityId = 0; +- } else if(var1.type == 65) { ++ par1Packet23VehicleSpawn.throwerEntityId = 0; ++ } else if (par1Packet23VehicleSpawn.type == 65) { + var8 = new EntityEnderPearl(this.worldClient, var2, var4, var6); +- } else if(var1.type == 72) { ++ } else if (par1Packet23VehicleSpawn.type == 72) { + var8 = new EntityEnderEye(this.worldClient, var2, var4, var6); +- } else if(var1.type == 76) { ++ } else if (par1Packet23VehicleSpawn.type == 76) { + var8 = new EntityFireworkRocket(this.worldClient, var2, var4, var6, (ItemStack)null); +- } else if(var1.type == 63) { +- var8 = new EntityLargeFireball(this.worldClient, var2, var4, var6, (double)var1.speedX / 8000.0D, (double)var1.speedY / 8000.0D, (double)var1.speedZ / 8000.0D); +- var1.throwerEntityId = 0; +- } else if(var1.type == 64) { +- var8 = new EntitySmallFireball(this.worldClient, var2, var4, var6, (double)var1.speedX / 8000.0D, (double)var1.speedY / 8000.0D, (double)var1.speedZ / 8000.0D); +- var1.throwerEntityId = 0; +- } else if(var1.type == 66) { +- var8 = new EntityWitherSkull(this.worldClient, var2, var4, var6, (double)var1.speedX / 8000.0D, (double)var1.speedY / 8000.0D, (double)var1.speedZ / 8000.0D); +- var1.throwerEntityId = 0; +- } else if(var1.type == 62) { ++ } else if (par1Packet23VehicleSpawn.type == 63) { ++ var8 = new EntityLargeFireball(this.worldClient, var2, var4, var6, (double)par1Packet23VehicleSpawn.speedX / 8000.0D, (double)par1Packet23VehicleSpawn.speedY / 8000.0D, (double)par1Packet23VehicleSpawn.speedZ / 8000.0D); ++ par1Packet23VehicleSpawn.throwerEntityId = 0; ++ } else if (par1Packet23VehicleSpawn.type == 64) { ++ var8 = new EntitySmallFireball(this.worldClient, var2, var4, var6, (double)par1Packet23VehicleSpawn.speedX / 8000.0D, (double)par1Packet23VehicleSpawn.speedY / 8000.0D, (double)par1Packet23VehicleSpawn.speedZ / 8000.0D); ++ par1Packet23VehicleSpawn.throwerEntityId = 0; ++ } else if (par1Packet23VehicleSpawn.type == 66) { ++ var8 = new EntityWitherSkull(this.worldClient, var2, var4, var6, (double)par1Packet23VehicleSpawn.speedX / 8000.0D, (double)par1Packet23VehicleSpawn.speedY / 8000.0D, (double)par1Packet23VehicleSpawn.speedZ / 8000.0D); ++ par1Packet23VehicleSpawn.throwerEntityId = 0; ++ } else if (par1Packet23VehicleSpawn.type == 62) { + var8 = new EntityEgg(this.worldClient, var2, var4, var6); +- } else if(var1.type == 73) { +- var8 = new EntityPotion(this.worldClient, var2, var4, var6, var1.throwerEntityId); +- var1.throwerEntityId = 0; +- } else if(var1.type == 75) { ++ } else if (par1Packet23VehicleSpawn.type == 73) { ++ var8 = new EntityPotion(this.worldClient, var2, var4, var6, par1Packet23VehicleSpawn.throwerEntityId); ++ par1Packet23VehicleSpawn.throwerEntityId = 0; ++ } else if (par1Packet23VehicleSpawn.type == 75) { + var8 = new EntityExpBottle(this.worldClient, var2, var4, var6); +- var1.throwerEntityId = 0; +- } else if(var1.type == 1) { ++ par1Packet23VehicleSpawn.throwerEntityId = 0; ++ } else if (par1Packet23VehicleSpawn.type == 1) { + var8 = new EntityBoat(this.worldClient, var2, var4, var6); +- } else if(var1.type == 50) { ++ } else if (par1Packet23VehicleSpawn.type == 50) { + var8 = new EntityTNTPrimed(this.worldClient, var2, var4, var6, (EntityLivingBase)null); +- } else if(var1.type == 51) { ++ } else if (par1Packet23VehicleSpawn.type == 51) { + var8 = new EntityEnderCrystal(this.worldClient, var2, var4, var6); +- } else if(var1.type == 2) { ++ } else if (par1Packet23VehicleSpawn.type == 2) { + var8 = new EntityItem(this.worldClient, var2, var4, var6); +- } else if(var1.type == 70) { +- var8 = new EntityFallingSand(this.worldClient, var2, var4, var6, var1.throwerEntityId & '\uffff', var1.throwerEntityId >> 16); +- var1.throwerEntityId = 0; ++ } else if (par1Packet23VehicleSpawn.type == 70) { ++ var8 = new EntityFallingSand(this.worldClient, var2, var4, var6, par1Packet23VehicleSpawn.throwerEntityId & 65535, par1Packet23VehicleSpawn.throwerEntityId >> 16); ++ par1Packet23VehicleSpawn.throwerEntityId = 0; + } + +- if(var8 != null) { +- ((Entity)var8).serverPosX = var1.xPosition; +- ((Entity)var8).serverPosY = var1.yPosition; +- ((Entity)var8).serverPosZ = var1.zPosition; +- ((Entity)var8).rotationPitch = (float)(var1.pitch * 360) / 256.0F; +- ((Entity)var8).rotationYaw = (float)(var1.yaw * 360) / 256.0F; ++ if (var8 != null) { ++ ((Entity)var8).serverPosX = par1Packet23VehicleSpawn.xPosition; ++ ((Entity)var8).serverPosY = par1Packet23VehicleSpawn.yPosition; ++ ((Entity)var8).serverPosZ = par1Packet23VehicleSpawn.zPosition; ++ ((Entity)var8).rotationPitch = (float)(par1Packet23VehicleSpawn.pitch * 360) / 256.0F; ++ ((Entity)var8).rotationYaw = (float)(par1Packet23VehicleSpawn.yaw * 360) / 256.0F; + Entity[] var12 = ((Entity)var8).getParts(); +- if(var12 != null) { +- int var10 = var1.entityId - ((Entity)var8).entityId; +- +- for(int var11 = 0; var11 < var12.length; ++var11) { ++ ++ if (var12 != null) { ++ int var10 = par1Packet23VehicleSpawn.entityId - ((Entity)var8).entityId; ++ ++ for (int var11 = 0; var11 < var12.length; ++var11) { + var12[var11].entityId += var10; + } + } + +- ((Entity)var8).entityId = var1.entityId; +- this.worldClient.addEntityToWorld(var1.entityId, (Entity)var8); +- if(var1.throwerEntityId > 0) { +- if(var1.type == 60) { +- Entity var13 = this.getEntityByID(var1.throwerEntityId); +- if(var13 instanceof EntityLivingBase) { ++ ((Entity)var8).entityId = par1Packet23VehicleSpawn.entityId; ++ this.worldClient.addEntityToWorld(par1Packet23VehicleSpawn.entityId, (Entity)var8); ++ ++ if (par1Packet23VehicleSpawn.throwerEntityId > 0) { ++ if (par1Packet23VehicleSpawn.type == 60) { ++ Entity var13 = this.getEntityByID(par1Packet23VehicleSpawn.throwerEntityId); ++ ++ if (var13 instanceof EntityLivingBase) { + EntityArrow var14 = (EntityArrow)var8; + var14.shootingEntity = var13; + } + } + +- ((Entity)var8).setVelocity((double)var1.speedX / 8000.0D, (double)var1.speedY / 8000.0D, (double)var1.speedZ / 8000.0D); ++ ((Entity)var8).setVelocity((double)par1Packet23VehicleSpawn.speedX / 8000.0D, (double)par1Packet23VehicleSpawn.speedY / 8000.0D, (double)par1Packet23VehicleSpawn.speedZ / 8000.0D); + } + } +- + } + +- public void handleEntityExpOrb(Packet26EntityExpOrb var1) { +- EntityXPOrb var2 = new EntityXPOrb(this.worldClient, (double)var1.posX, (double)var1.posY, (double)var1.posZ, var1.xpValue); +- var2.serverPosX = var1.posX; +- var2.serverPosY = var1.posY; +- var2.serverPosZ = var1.posZ; ++ /** ++ * Handle a entity experience orb packet. ++ */ ++ public void handleEntityExpOrb(Packet26EntityExpOrb par1Packet26EntityExpOrb) { ++ EntityXPOrb var2 = new EntityXPOrb(this.worldClient, (double)par1Packet26EntityExpOrb.posX, (double)par1Packet26EntityExpOrb.posY, (double)par1Packet26EntityExpOrb.posZ, par1Packet26EntityExpOrb.xpValue); ++ var2.serverPosX = par1Packet26EntityExpOrb.posX; ++ var2.serverPosY = par1Packet26EntityExpOrb.posY; ++ var2.serverPosZ = par1Packet26EntityExpOrb.posZ; + var2.rotationYaw = 0.0F; + var2.rotationPitch = 0.0F; +- var2.entityId = var1.entityId; +- this.worldClient.addEntityToWorld(var1.entityId, var2); ++ var2.entityId = par1Packet26EntityExpOrb.entityId; ++ this.worldClient.addEntityToWorld(par1Packet26EntityExpOrb.entityId, var2); + } + +- public void handleWeather(Packet71Weather var1) { +- double var2 = (double)var1.posX / 32.0D; +- double var4 = (double)var1.posY / 32.0D; +- double var6 = (double)var1.posZ / 32.0D; ++ /** ++ * Handles weather packet ++ */ ++ public void handleWeather(Packet71Weather par1Packet71Weather) { ++ double var2 = (double)par1Packet71Weather.posX / 32.0D; ++ double var4 = (double)par1Packet71Weather.posY / 32.0D; ++ double var6 = (double)par1Packet71Weather.posZ / 32.0D; + EntityLightningBolt var8 = null; +- if(var1.isLightningBolt == 1) { ++ ++ if (par1Packet71Weather.isLightningBolt == 1) { + var8 = new EntityLightningBolt(this.worldClient, var2, var4, var6); + } + +- if(var8 != null) { +- var8.serverPosX = var1.posX; +- var8.serverPosY = var1.posY; +- var8.serverPosZ = var1.posZ; ++ if (var8 != null) { ++ var8.serverPosX = par1Packet71Weather.posX; ++ var8.serverPosY = par1Packet71Weather.posY; ++ var8.serverPosZ = par1Packet71Weather.posZ; + var8.rotationYaw = 0.0F; + var8.rotationPitch = 0.0F; +- var8.entityId = var1.entityID; ++ var8.entityId = par1Packet71Weather.entityID; + this.worldClient.addWeatherEffect(var8); + } +- +- } +- +- public void handleEntityPainting(Packet25EntityPainting var1) { +- EntityPainting var2 = new EntityPainting(this.worldClient, var1.xPosition, var1.yPosition, var1.zPosition, var1.direction, var1.f); +- this.worldClient.addEntityToWorld(var1.entityId, var2); +- } +- +- public void handleEntityVelocity(Packet28EntityVelocity var1) { +- Entity var2 = this.getEntityByID(var1.entityId); +- if(var2 != null) { +- var2.setVelocity((double)var1.motionX / 8000.0D, (double)var1.motionY / 8000.0D, (double)var1.motionZ / 8000.0D); +- } +- } +- +- public void handleEntityMetadata(Packet40EntityMetadata var1) { +- Entity var2 = this.getEntityByID(var1.entityId); +- if(var2 != null && var1.getMetadata() != null) { +- var2.getDataWatcher().updateWatchedObjectsFromList(var1.getMetadata()); +- } +- +- } +- +- public void handleNamedEntitySpawn(Packet20NamedEntitySpawn var1) { +- double var2 = (double)var1.xPosition / 32.0D; +- double var4 = (double)var1.yPosition / 32.0D; +- double var6 = (double)var1.zPosition / 32.0D; +- float var8 = (float)(var1.rotation * 360) / 256.0F; +- float var9 = (float)(var1.pitch * 360) / 256.0F; +- EntityOtherPlayerMP var10 = new EntityOtherPlayerMP(this.mc.theWorld, var1.b); +- var10.prevPosX = var10.lastTickPosX = (double)(var10.serverPosX = var1.xPosition); +- var10.prevPosY = var10.lastTickPosY = (double)(var10.serverPosY = var1.yPosition); +- var10.prevPosZ = var10.lastTickPosZ = (double)(var10.serverPosZ = var1.zPosition); +- int var11 = var1.currentItem; +- if(var11 == 0) { ++ } ++ ++ /** ++ * Packet handler ++ */ ++ public void handleEntityPainting(Packet25EntityPainting par1Packet25EntityPainting) { ++ EntityPainting var2 = new EntityPainting(this.worldClient, par1Packet25EntityPainting.xPosition, par1Packet25EntityPainting.yPosition, par1Packet25EntityPainting.zPosition, par1Packet25EntityPainting.direction, par1Packet25EntityPainting.title); ++ this.worldClient.addEntityToWorld(par1Packet25EntityPainting.entityId, var2); ++ } ++ ++ /** ++ * Packet handler ++ */ ++ public void handleEntityVelocity(Packet28EntityVelocity par1Packet28EntityVelocity) { ++ Entity var2 = this.getEntityByID(par1Packet28EntityVelocity.entityId); ++ ++ if (var2 != null) { ++ var2.setVelocity((double)par1Packet28EntityVelocity.motionX / 8000.0D, (double)par1Packet28EntityVelocity.motionY / 8000.0D, (double)par1Packet28EntityVelocity.motionZ / 8000.0D); ++ } ++ } ++ ++ /** ++ * Packet handler ++ */ ++ public void handleEntityMetadata(Packet40EntityMetadata par1Packet40EntityMetadata) { ++ Entity var2 = this.getEntityByID(par1Packet40EntityMetadata.entityId); ++ ++ if (var2 != null && par1Packet40EntityMetadata.getMetadata() != null) { ++ var2.getDataWatcher().updateWatchedObjectsFromList(par1Packet40EntityMetadata.getMetadata()); ++ } ++ } ++ ++ public void handleNamedEntitySpawn(Packet20NamedEntitySpawn par1Packet20NamedEntitySpawn) { ++ double var2 = (double)par1Packet20NamedEntitySpawn.xPosition / 32.0D; ++ double var4 = (double)par1Packet20NamedEntitySpawn.yPosition / 32.0D; ++ double var6 = (double)par1Packet20NamedEntitySpawn.zPosition / 32.0D; ++ float var8 = (float)(par1Packet20NamedEntitySpawn.rotation * 360) / 256.0F; ++ float var9 = (float)(par1Packet20NamedEntitySpawn.pitch * 360) / 256.0F; ++ EntityOtherPlayerMP var10 = new EntityOtherPlayerMP(this.mc.theWorld, par1Packet20NamedEntitySpawn.name); ++ var10.prevPosX = var10.lastTickPosX = (double)(var10.serverPosX = par1Packet20NamedEntitySpawn.xPosition); ++ var10.prevPosY = var10.lastTickPosY = (double)(var10.serverPosY = par1Packet20NamedEntitySpawn.yPosition); ++ var10.prevPosZ = var10.lastTickPosZ = (double)(var10.serverPosZ = par1Packet20NamedEntitySpawn.zPosition); ++ int var11 = par1Packet20NamedEntitySpawn.currentItem; ++ ++ if (var11 == 0) { + var10.inventory.mainInventory[var10.inventory.currentItem] = null; + } else { + var10.inventory.mainInventory[var10.inventory.currentItem] = new ItemStack(var11, 1, 0); + } + + var10.setPositionAndRotation(var2, var4, var6, var8, var9); +- this.worldClient.addEntityToWorld(var1.entityId, var10); +- List var12 = var1.getWatchedMetadata(); +- if(var12 != null) { ++ this.worldClient.addEntityToWorld(par1Packet20NamedEntitySpawn.entityId, var10); ++ List var12 = par1Packet20NamedEntitySpawn.getWatchedMetadata(); ++ ++ if (var12 != null) { + var10.getDataWatcher().updateWatchedObjectsFromList(var12); + } +- ++ // Spout Start - Set the entity's title ++ if (var10.worldObj.customTitles.containsKey(var10.entityId)) { ++ ((org.spoutcraft.client.entity.CraftLivingEntity)SpoutClient.getInstance().getEntityFromId(var10.entityId).spoutEnty).setTitle(var10.worldObj.customTitles.get(var10.entityId)); ++ } ++ // Spout End + } + +- public void handleEntityTeleport(Packet34EntityTeleport var1) { +- Entity var2 = this.getEntityByID(var1.entityId); +- if(var2 != null) { +- var2.serverPosX = var1.xPosition; +- var2.serverPosY = var1.yPosition; +- var2.serverPosZ = var1.zPosition; ++ public void handleEntityTeleport(Packet34EntityTeleport par1Packet34EntityTeleport) { ++ Entity var2 = this.getEntityByID(par1Packet34EntityTeleport.entityId); ++ ++ if (var2 != null) { ++ var2.serverPosX = par1Packet34EntityTeleport.xPosition; ++ var2.serverPosY = par1Packet34EntityTeleport.yPosition; ++ var2.serverPosZ = par1Packet34EntityTeleport.zPosition; + double var3 = (double)var2.serverPosX / 32.0D; +- double var5 = (double)var2.serverPosY / 32.0D + 1.0D / 64.0D; ++ double var5 = (double)var2.serverPosY / 32.0D + 0.015625D; + double var7 = (double)var2.serverPosZ / 32.0D; +- float var9 = (float)(var1.yaw * 360) / 256.0F; +- float var10 = (float)(var1.pitch * 360) / 256.0F; ++ float var9 = (float)(par1Packet34EntityTeleport.yaw * 360) / 256.0F; ++ float var10 = (float)(par1Packet34EntityTeleport.pitch * 360) / 256.0F; + var2.setPositionAndRotation2(var3, var5, var7, var9, var10, 3); + } + } + +- public void handleBlockItemSwitch(Packet16BlockItemSwitch var1) { +- if(var1.id >= 0 && var1.id < InventoryPlayer.getHotbarSize()) { +- this.mc.thePlayer.inventory.currentItem = var1.id; ++ public void handleBlockItemSwitch(Packet16BlockItemSwitch par1Packet16BlockItemSwitch) { ++ if (par1Packet16BlockItemSwitch.id >= 0 && par1Packet16BlockItemSwitch.id < InventoryPlayer.getHotbarSize()) { ++ this.mc.thePlayer.inventory.currentItem = par1Packet16BlockItemSwitch.id; + } +- + } + +- public void handleEntity(Packet30Entity var1) { +- Entity var2 = this.getEntityByID(var1.entityId); +- if(var2 != null) { +- var2.serverPosX += var1.xPosition; +- var2.serverPosY += var1.yPosition; +- var2.serverPosZ += var1.zPosition; ++ public void handleEntity(Packet30Entity par1Packet30Entity) { ++ Entity var2 = this.getEntityByID(par1Packet30Entity.entityId); ++ ++ if (var2 != null) { ++ var2.serverPosX += par1Packet30Entity.xPosition; ++ var2.serverPosY += par1Packet30Entity.yPosition; ++ var2.serverPosZ += par1Packet30Entity.zPosition; + double var3 = (double)var2.serverPosX / 32.0D; + double var5 = (double)var2.serverPosY / 32.0D; + double var7 = (double)var2.serverPosZ / 32.0D; +- float var9 = var1.rotating ? (float)(var1.yaw * 360) / 256.0F : var2.rotationYaw; +- float var10 = var1.rotating ? (float)(var1.pitch * 360) / 256.0F : var2.rotationPitch; ++ float var9 = par1Packet30Entity.rotating ? (float)(par1Packet30Entity.yaw * 360) / 256.0F : var2.rotationYaw; ++ float var10 = par1Packet30Entity.rotating ? (float)(par1Packet30Entity.pitch * 360) / 256.0F : var2.rotationPitch; + var2.setPositionAndRotation2(var3, var5, var7, var9, var10, 3); + } + } + +- public void handleEntityHeadRotation(Packet35EntityHeadRotation var1) { +- Entity var2 = this.getEntityByID(var1.entityId); +- if(var2 != null) { +- float var3 = (float)(var1.headRotationYaw * 360) / 256.0F; ++ public void handleEntityHeadRotation(Packet35EntityHeadRotation par1Packet35EntityHeadRotation) { ++ Entity var2 = this.getEntityByID(par1Packet35EntityHeadRotation.entityId); ++ ++ if (var2 != null) { ++ float var3 = (float)(par1Packet35EntityHeadRotation.headRotationYaw * 360) / 256.0F; + var2.setRotationYawHead(var3); + } + } + +- public void handleDestroyEntity(Packet29DestroyEntity var1) { +- for(int var2 = 0; var2 < var1.entityId.length; ++var2) { +- this.worldClient.removeEntityFromWorld(var1.entityId[var2]); ++ public void handleDestroyEntity(Packet29DestroyEntity par1Packet29DestroyEntity) { ++ for (int var2 = 0; var2 < par1Packet29DestroyEntity.entityId.length; ++var2) { ++ this.worldClient.removeEntityFromWorld(par1Packet29DestroyEntity.entityId[var2]); + } +- + } + +- public void handleFlying(Packet10Flying var1) { ++ public void handleFlying(Packet10Flying par1Packet10Flying) { + EntityClientPlayerMP var2 = this.mc.thePlayer; + double var3 = var2.posX; + double var5 = var2.posY; + double var7 = var2.posZ; + float var9 = var2.rotationYaw; + float var10 = var2.rotationPitch; +- if(var1.moving) { +- var3 = var1.xPosition; +- var5 = var1.yPosition; +- var7 = var1.zPosition; ++ ++ if (par1Packet10Flying.moving) { ++ var3 = par1Packet10Flying.xPosition; ++ var5 = par1Packet10Flying.yPosition; ++ var7 = par1Packet10Flying.zPosition; + } + +- if(var1.rotating) { +- var9 = var1.yaw; +- var10 = var1.pitch; ++ if (par1Packet10Flying.rotating) { ++ var9 = par1Packet10Flying.yaw; ++ var10 = par1Packet10Flying.pitch; + } + + var2.ySize = 0.0F; + var2.motionX = var2.motionY = var2.motionZ = 0.0D; + var2.setPositionAndRotation(var3, var5, var7, var9, var10); +- var1.xPosition = var2.posX; +- var1.yPosition = var2.boundingBox.minY; +- var1.zPosition = var2.posZ; +- var1.stance = var2.posY; +- this.netManager.addToSendQueue(var1); +- if(!this.doneLoadingTerrain) { ++ par1Packet10Flying.xPosition = var2.posX; ++ par1Packet10Flying.yPosition = var2.boundingBox.minY; ++ par1Packet10Flying.zPosition = var2.posZ; ++ par1Packet10Flying.stance = var2.posY; ++ this.netManager.addToSendQueue(par1Packet10Flying); ++ ++ if (!this.doneLoadingTerrain) { + this.mc.thePlayer.prevPosX = this.mc.thePlayer.posX; + this.mc.thePlayer.prevPosY = this.mc.thePlayer.posY; + this.mc.thePlayer.prevPosZ = this.mc.thePlayer.posZ; + this.doneLoadingTerrain = true; +- this.mc.displayGuiScreen((GuiScreen)null); ++ ++ if (!(this.mc.currentScreen instanceof GuiPrecache)) { ++ this.mc.displayGuiScreen((GuiScreen)null); ++ } + } +- + } + +- public void handleMultiBlockChange(Packet52MultiBlockChange var1) { +- int var2 = var1.xPosition * 16; +- int var3 = var1.zPosition * 16; +- if(var1.metadataArray != null) { +- DataInputStream var4 = new DataInputStream(new ByteArrayInputStream(var1.metadataArray)); ++ public void handleMultiBlockChange(Packet52MultiBlockChange par1Packet52MultiBlockChange) { ++ int var2 = par1Packet52MultiBlockChange.xPosition * 16; ++ int var3 = par1Packet52MultiBlockChange.zPosition * 16; ++ ++ if (par1Packet52MultiBlockChange.metadataArray != null) { ++ DataInputStream var4 = new DataInputStream(new ByteArrayInputStream(par1Packet52MultiBlockChange.metadataArray)); + + try { +- for(int var5 = 0; var5 < var1.size; ++var5) { ++ for (int var5 = 0; var5 < par1Packet52MultiBlockChange.size; ++var5) { + short var6 = var4.readShort(); + short var7 = var4.readShort(); + int var8 = var7 >> 4 & 4095; +@@ -404,772 +510,918 @@ + this.worldClient.setBlockAndMetadataAndInvalidate(var10 + var2, var12, var11 + var3, var8, var9); + } + } catch (IOException var13) { ++ ; + } +- + } + } + +- public void handleMapChunk(Packet51MapChunk var1) { +- if(var1.includeInitialize) { +- if(var1.yChMin == 0) { +- this.worldClient.doPreChunk(var1.xCh, var1.zCh, false); ++ /** ++ * Handle Packet51MapChunk (full chunk update of blocks, metadata, light levels, and optionally biome data) ++ */ ++ public void handleMapChunk(Packet51MapChunk par1Packet51MapChunk) { ++ // Spout Start ++ if (par1Packet51MapChunk.yChMax == -1 && par1Packet51MapChunk.yChMin == -1) { ++ getNetManager().networkShutdown("Spout Cache Error - Corrupt File Deleted", new Object[0]); ++ kick("Cache Error - Corrupt File Deleted"); ++ return; ++ } ++ if (worldClient == null) { ++ return; ++ } ++ // Spout End ++ if (par1Packet51MapChunk.includeInitialize) { ++ if (par1Packet51MapChunk.yChMin == 0) { ++ this.worldClient.doPreChunk(par1Packet51MapChunk.xCh, par1Packet51MapChunk.zCh, false); + return; + } + +- this.worldClient.doPreChunk(var1.xCh, var1.zCh, true); +- } +- +- this.worldClient.invalidateBlockReceiveRegion(var1.xCh << 4, 0, var1.zCh << 4, (var1.xCh << 4) + 15, 256, (var1.zCh << 4) + 15); +- Chunk var2 = this.worldClient.getChunkFromChunkCoords(var1.xCh, var1.zCh); +- if(var1.includeInitialize && var2 == null) { +- this.worldClient.doPreChunk(var1.xCh, var1.zCh, true); +- var2 = this.worldClient.getChunkFromChunkCoords(var1.xCh, var1.zCh); +- } +- +- if(var2 != null) { +- var2.fillChunk(var1.getCompressedChunkData(), var1.yChMin, var1.yChMax, var1.includeInitialize); +- this.worldClient.markBlockRangeForRenderUpdate(var1.xCh << 4, 0, var1.zCh << 4, (var1.xCh << 4) + 15, 256, (var1.zCh << 4) + 15); +- if(!var1.includeInitialize || !(this.worldClient.provider instanceof WorldProviderSurface)) { ++ this.worldClient.doPreChunk(par1Packet51MapChunk.xCh, par1Packet51MapChunk.zCh, true); ++ } ++ ++ this.worldClient.invalidateBlockReceiveRegion(par1Packet51MapChunk.xCh << 4, 0, par1Packet51MapChunk.zCh << 4, (par1Packet51MapChunk.xCh << 4) + 15, 256, (par1Packet51MapChunk.zCh << 4) + 15); ++ Chunk var2 = this.worldClient.getChunkFromChunkCoords(par1Packet51MapChunk.xCh, par1Packet51MapChunk.zCh); ++ ++ if (par1Packet51MapChunk.includeInitialize && var2 == null) { ++ this.worldClient.doPreChunk(par1Packet51MapChunk.xCh, par1Packet51MapChunk.zCh, true); ++ var2 = this.worldClient.getChunkFromChunkCoords(par1Packet51MapChunk.xCh, par1Packet51MapChunk.zCh); ++ } ++ ++ if (var2 != null) { ++ var2.fillChunk(par1Packet51MapChunk.getCompressedChunkData(), par1Packet51MapChunk.yChMin, par1Packet51MapChunk.yChMax, par1Packet51MapChunk.includeInitialize); ++ this.worldClient.markBlockRangeForRenderUpdate(par1Packet51MapChunk.xCh << 4, 0, par1Packet51MapChunk.zCh << 4, (par1Packet51MapChunk.xCh << 4) + 15, 256, (par1Packet51MapChunk.zCh << 4) + 15); ++ ++ if (!par1Packet51MapChunk.includeInitialize || !(this.worldClient.provider instanceof WorldProviderSurface)) { ++ // Spout Start ++ if (Configuration.isClientLight()) { + var2.resetRelightChecks(); ++ } ++ // Spout End + } + } +- +- } +- +- public void handleBlockChange(Packet53BlockChange var1) { +- this.worldClient.setBlockAndMetadataAndInvalidate(var1.xPosition, var1.yPosition, var1.zPosition, var1.type, var1.metadata); +- } +- +- public void handleKickDisconnect(Packet255KickDisconnect var1) { ++ } ++ ++ public void handleBlockChange(Packet53BlockChange par1Packet53BlockChange) { ++ this.worldClient.setBlockAndMetadataAndInvalidate(par1Packet53BlockChange.xPosition, par1Packet53BlockChange.yPosition, par1Packet53BlockChange.zPosition, par1Packet53BlockChange.type, par1Packet53BlockChange.metadata); ++ } ++ ++ // Spout Start ++ public void kick(String reason) { ++ if (this.mc.thePlayer != null) { ++ this.mc.thePlayer.closeScreen(); // Close the active screen first! ++ } + this.netManager.networkShutdown("disconnect.kicked", new Object[0]); + this.disconnected = true; + this.mc.loadWorld((WorldClient)null); +- if(this.field_98183_l != null) { +- this.mc.displayGuiScreen(new GuiScreenDisconnectedOnline(this.field_98183_l, "disconnect.disconnected", "disconnect.genericReason", new Object[]{var1.a})); +- } else { +- this.mc.displayGuiScreen(new GuiDisconnected(new GuiMultiplayer(new GuiMainMenu()), "disconnect.disconnected", "disconnect.genericReason", new Object[]{var1.a})); +- } +- +- } +- +- public void handleErrorMessage(String var1, Object[] var2) { +- if(!this.disconnected) { ++ this.mc.displayGuiScreen(new GuiDisconnected(null, "disconnect.disconnected", "disconnect.genericReason", new Object[] {reason})); ++ } ++ ++ public void handleKickDisconnect(Packet255KickDisconnect par1Packet255KickDisconnect) { ++ kick(par1Packet255KickDisconnect.reason); ++ } ++ // Spout End ++ ++ public void handleErrorMessage(String par1Str, Object[] par2ArrayOfObj) { ++ if (!this.disconnected) { + this.disconnected = true; + this.mc.loadWorld((WorldClient)null); +- if(this.field_98183_l != null) { +- this.mc.displayGuiScreen(new GuiScreenDisconnectedOnline(this.field_98183_l, "disconnect.lost", var1, var2)); ++ // Spout Start ++ System.out.println(par1Str); ++ if (par1Str != null && par1Str.toLowerCase().contains("endofstream")) { ++ this.mc.displayGuiScreen(new org.spoutcraft.client.gui.error.GuiConnectionLost()); ++ } else if (par2ArrayOfObj == null || par2ArrayOfObj.length == 0 || !(par2ArrayOfObj[0] instanceof String)) { ++ this.mc.displayGuiScreen(new GuiDisconnected(null, "disconnect.lost", par1Str, par2ArrayOfObj)); ++ } else if (((String)par2ArrayOfObj[0]).toLowerCase().contains("connection reset")) { ++ this.mc.displayGuiScreen(new org.spoutcraft.client.gui.error.GuiConnectionLost()); ++ } else if (((String)par2ArrayOfObj[0]).toLowerCase().contains("connection refused")) { ++ this.mc.displayGuiScreen(new org.spoutcraft.client.gui.error.GuiConnectionLost("The server is not currently online!")); ++ } else if (((String)par2ArrayOfObj[0]).toLowerCase().contains("overflow")) { ++ this.mc.displayGuiScreen(new org.spoutcraft.client.gui.error.GuiConnectionLost("The server is currently experiencing heavy traffic. Try again later.")); + } else { +- this.mc.displayGuiScreen(new GuiDisconnected(new GuiMultiplayer(new GuiMainMenu()), "disconnect.lost", var1, var2)); ++ this.mc.displayGuiScreen(new GuiDisconnected(null, "disconnect.lost", par1Str, par2ArrayOfObj)); + } +- ++ // Spout End + } + } + +- public void quitWithPacket(Packet var1) { +- if(!this.disconnected) { +- this.netManager.addToSendQueue(var1); ++ public void quitWithPacket(Packet par1Packet) { ++ if (!this.disconnected) { ++ this.netManager.addToSendQueue(par1Packet); + this.netManager.serverShutdown(); + } + } + +- public void addToSendQueue(Packet var1) { +- if(!this.disconnected) { +- this.netManager.addToSendQueue(var1); ++ /** ++ * Adds the packet to the send queue ++ */ ++ public void addToSendQueue(Packet par1Packet) { ++ if (!this.disconnected) { ++ this.netManager.addToSendQueue(par1Packet); + } + } + +- public void handleCollect(Packet22Collect var1) { +- Entity var2 = this.getEntityByID(var1.collectedEntityId); +- Object var3 = (EntityLivingBase)this.getEntityByID(var1.collectorEntityId); +- if(var3 == null) { ++ public void handleCollect(Packet22Collect par1Packet22Collect) { ++ Entity var2 = this.getEntityByID(par1Packet22Collect.collectedEntityId); ++ Object var3 = (EntityLivingBase)this.getEntityByID(par1Packet22Collect.collectorEntityId); ++ ++ if (var3 == null) { + var3 = this.mc.thePlayer; + } + +- if(var2 != null) { +- if(var2 instanceof EntityXPOrb) { +- this.worldClient.playSoundAtEntity(var2, "random.orb", 0.2F, ((this.e.nextFloat() - this.e.nextFloat()) * 0.7F + 1.0F) * 2.0F); ++ if (var2 != null) { ++ if (var2 instanceof EntityXPOrb) { ++ this.worldClient.playSoundAtEntity(var2, "random.orb", 0.2F, ((this.rand.nextFloat() - this.rand.nextFloat()) * 0.7F + 1.0F) * 2.0F); + } else { +- this.worldClient.playSoundAtEntity(var2, "random.pop", 0.2F, ((this.e.nextFloat() - this.e.nextFloat()) * 0.7F + 1.0F) * 2.0F); ++ this.worldClient.playSoundAtEntity(var2, "random.pop", 0.2F, ((this.rand.nextFloat() - this.rand.nextFloat()) * 0.7F + 1.0F) * 2.0F); + } + + this.mc.effectRenderer.addEffect(new EntityPickupFX(this.mc.theWorld, var2, (Entity)var3, -0.5F)); +- this.worldClient.removeEntityFromWorld(var1.collectedEntityId); ++ this.worldClient.removeEntityFromWorld(par1Packet22Collect.collectedEntityId); + } +- +- } +- +- public void handleChat(Packet3Chat var1) { +- this.mc.ingameGUI.getChatGUI().printChatMessage(ChatMessageComponent.createFromJson(var1.a).toStringWithFormatting(true)); +- } +- +- public void handleAnimation(Packet18Animation var1) { +- Entity var2 = this.getEntityByID(var1.entityId); +- if(var2 != null) { +- if(var1.animate == 1) { ++ } ++ ++ public void handleChat(Packet3Chat par1Packet3Chat) { ++ this.mc.ingameGUI.getChatGUI().printChatMessage(ChatMessageComponent.createFromJson(par1Packet3Chat.message).toStringWithFormatting(true)); ++ } ++ ++ public void handleAnimation(Packet18Animation par1Packet18Animation) { ++ Entity var2 = this.getEntityByID(par1Packet18Animation.entityId); ++ ++ if (var2 != null) { ++ if (par1Packet18Animation.animate == 1) { + EntityLivingBase var3 = (EntityLivingBase)var2; + var3.swingItem(); +- } else if(var1.animate == 2) { ++ } else if (par1Packet18Animation.animate == 2) { + var2.performHurtAnimation(); +- } else if(var1.animate == 3) { ++ } else if (par1Packet18Animation.animate == 3) { + EntityPlayer var4 = (EntityPlayer)var2; + var4.wakeUpPlayer(false, false, false); +- } else if(var1.animate != 4) { +- if(var1.animate == 6) { ++ } else if (par1Packet18Animation.animate != 4) { ++ if (par1Packet18Animation.animate == 6) { + this.mc.effectRenderer.addEffect(new EntityCrit2FX(this.mc.theWorld, var2)); +- } else if(var1.animate == 7) { ++ } else if (par1Packet18Animation.animate == 7) { + EntityCrit2FX var5 = new EntityCrit2FX(this.mc.theWorld, var2, "magicCrit"); + this.mc.effectRenderer.addEffect(var5); +- } else if(var1.animate == 5 && var2 instanceof EntityOtherPlayerMP) { ++ } else if (par1Packet18Animation.animate == 5 && var2 instanceof EntityOtherPlayerMP) { ++ ; + } + } +- + } + } + +- public void handleSleep(Packet17Sleep var1) { +- Entity var2 = this.getEntityByID(var1.entityID); +- if(var2 != null) { +- if(var1.field_73622_e == 0) { ++ public void handleSleep(Packet17Sleep par1Packet17Sleep) { ++ Entity var2 = this.getEntityByID(par1Packet17Sleep.entityID); ++ ++ if (var2 != null) { ++ if (par1Packet17Sleep.field_73622_e == 0) { + EntityPlayer var3 = (EntityPlayer)var2; +- var3.sleepInBedAt(var1.bedX, var1.bedY, var1.bedZ); ++ var3.sleepInBedAt(par1Packet17Sleep.bedX, par1Packet17Sleep.bedY, par1Packet17Sleep.bedZ); + } +- + } + } + ++ /** ++ * Disconnects the network connection. ++ */ + public void disconnect() { + this.disconnected = true; + this.netManager.wakeThreads(); + this.netManager.networkShutdown("disconnect.closed", new Object[0]); + } + +- public void handleMobSpawn(Packet24MobSpawn var1) { +- double var2 = (double)var1.xPosition / 32.0D; +- double var4 = (double)var1.yPosition / 32.0D; +- double var6 = (double)var1.zPosition / 32.0D; +- float var8 = (float)(var1.yaw * 360) / 256.0F; +- float var9 = (float)(var1.pitch * 360) / 256.0F; +- EntityLivingBase var10 = (EntityLivingBase)EntityList.createEntityByID(var1.type, this.mc.theWorld); +- var10.serverPosX = var1.xPosition; +- var10.serverPosY = var1.yPosition; +- var10.serverPosZ = var1.zPosition; +- var10.rotationYawHead = (float)(var1.headYaw * 360) / 256.0F; ++ public void handleMobSpawn(Packet24MobSpawn par1Packet24MobSpawn) { ++ double var2 = (double)par1Packet24MobSpawn.xPosition / 32.0D; ++ double var4 = (double)par1Packet24MobSpawn.yPosition / 32.0D; ++ double var6 = (double)par1Packet24MobSpawn.zPosition / 32.0D; ++ float var8 = (float)(par1Packet24MobSpawn.yaw * 360) / 256.0F; ++ float var9 = (float)(par1Packet24MobSpawn.pitch * 360) / 256.0F; ++ EntityLivingBase var10 = (EntityLivingBase)EntityList.createEntityByID(par1Packet24MobSpawn.type, this.mc.theWorld); ++ var10.serverPosX = par1Packet24MobSpawn.xPosition; ++ var10.serverPosY = par1Packet24MobSpawn.yPosition; ++ var10.serverPosZ = par1Packet24MobSpawn.zPosition; ++ var10.rotationYawHead = (float)(par1Packet24MobSpawn.headYaw * 360) / 256.0F; + Entity[] var11 = var10.getParts(); +- if(var11 != null) { +- int var12 = var1.entityId - var10.entityId; +- +- for(int var13 = 0; var13 < var11.length; ++var13) { ++ ++ if (var11 != null) { ++ int var12 = par1Packet24MobSpawn.entityId - var10.entityId; ++ ++ for (int var13 = 0; var13 < var11.length; ++var13) { + var11[var13].entityId += var12; + } + } + +- var10.entityId = var1.entityId; ++ var10.entityId = par1Packet24MobSpawn.entityId; + var10.setPositionAndRotation(var2, var4, var6, var8, var9); +- var10.motionX = (double)((float)var1.velocityX / 8000.0F); +- var10.motionY = (double)((float)var1.velocityY / 8000.0F); +- var10.motionZ = (double)((float)var1.velocityZ / 8000.0F); +- this.worldClient.addEntityToWorld(var1.entityId, var10); +- List var14 = var1.getMetadata(); +- if(var14 != null) { ++ var10.motionX = (double)((float)par1Packet24MobSpawn.velocityX / 8000.0F); ++ var10.motionY = (double)((float)par1Packet24MobSpawn.velocityY / 8000.0F); ++ var10.motionZ = (double)((float)par1Packet24MobSpawn.velocityZ / 8000.0F); ++ this.worldClient.addEntityToWorld(par1Packet24MobSpawn.entityId, var10); ++ List var14 = par1Packet24MobSpawn.getMetadata(); ++ ++ if (var14 != null) { + var10.getDataWatcher().updateWatchedObjectsFromList(var14); + } +- +- } +- +- public void handleUpdateTime(Packet4UpdateTime var1) { +- this.mc.theWorld.func_82738_a(var1.worldAge); +- this.mc.theWorld.setWorldTime(var1.time); +- } +- +- public void handleSpawnPosition(Packet6SpawnPosition var1) { +- this.mc.thePlayer.setSpawnChunk(new ChunkCoordinates(var1.xPosition, var1.yPosition, var1.zPosition), true); +- this.mc.theWorld.getWorldInfo().setSpawnPosition(var1.xPosition, var1.yPosition, var1.zPosition); +- } +- +- public void handleAttachEntity(Packet39AttachEntity var1) { +- Object var2 = this.getEntityByID(var1.ridingEntityId); +- Entity var3 = this.getEntityByID(var1.vehicleEntityId); +- if(var1.attachState == 0) { ++ // Spout Start - Set the entity's title ++ if (var10.worldObj.customTitles.containsKey(var10.entityId)) { ++ ((org.spoutcraft.client.entity.CraftLivingEntity)SpoutClient.getInstance().getEntityFromId(var10.entityId).spoutEnty).setTitle(var10.worldObj.customTitles.get(var10.entityId)); ++ } ++ // Spout End ++ } ++ ++ public void handleUpdateTime(Packet4UpdateTime par1Packet4UpdateTime) { ++ this.mc.theWorld.func_82738_a(par1Packet4UpdateTime.worldAge); ++ this.mc.theWorld.setWorldTime(par1Packet4UpdateTime.time); ++ } ++ ++ public void handleSpawnPosition(Packet6SpawnPosition par1Packet6SpawnPosition) { ++ this.mc.thePlayer.setSpawnChunk(new ChunkCoordinates(par1Packet6SpawnPosition.xPosition, par1Packet6SpawnPosition.yPosition, par1Packet6SpawnPosition.zPosition), true); ++ this.mc.theWorld.getWorldInfo().setSpawnPosition(par1Packet6SpawnPosition.xPosition, par1Packet6SpawnPosition.yPosition, par1Packet6SpawnPosition.zPosition); ++ } ++ ++ /** ++ * Packet handler ++ */ ++ public void handleAttachEntity(Packet39AttachEntity par1Packet39AttachEntity) { ++ Object var2 = this.getEntityByID(par1Packet39AttachEntity.ridingEntityId); ++ Entity var3 = this.getEntityByID(par1Packet39AttachEntity.vehicleEntityId); ++ ++ if (par1Packet39AttachEntity.attachState == 0) { + boolean var4 = false; +- if(var1.ridingEntityId == this.mc.thePlayer.entityId) { ++ ++ if (par1Packet39AttachEntity.ridingEntityId == this.mc.thePlayer.entityId) { + var2 = this.mc.thePlayer; +- if(var3 instanceof EntityBoat) { ++ ++ if (var3 instanceof EntityBoat) { + ((EntityBoat)var3).func_70270_d(false); + } + + var4 = ((Entity)var2).ridingEntity == null && var3 != null; +- } else if(var3 instanceof EntityBoat) { ++ } else if (var3 instanceof EntityBoat) { + ((EntityBoat)var3).func_70270_d(true); + } + +- if(var2 == null) { ++ if (var2 == null) { + return; + } + + ((Entity)var2).mountEntity(var3); +- if(var4) { ++ ++ if (var4) { + GameSettings var5 = this.mc.gameSettings; +- this.mc.ingameGUI.func_110326_a(I18n.getStringParams("mount.onboard", new Object[]{GameSettings.getKeyDisplayString(var5.keyBindSneak.keyCode)}), false); ++ this.mc.ingameGUI.func_110326_a(I18n.getStringParams("mount.onboard", new Object[] {GameSettings.getKeyDisplayString(var5.keyBindSneak.keyCode)}), false); + } +- } else if(var1.attachState == 1 && var2 != null && var2 instanceof EntityLiving) { +- if(var3 != null) { ++ } else if (par1Packet39AttachEntity.attachState == 1 && var2 != null && var2 instanceof EntityLiving) { ++ if (var3 != null) { + ((EntityLiving)var2).setLeashedToEntity(var3, false); + } else { + ((EntityLiving)var2).clearLeashed(false, false); + } + } +- + } + +- public void handleEntityStatus(Packet38EntityStatus var1) { +- Entity var2 = this.getEntityByID(var1.entityId); +- if(var2 != null) { +- var2.handleHealthUpdate(var1.entityStatus); ++ /** ++ * Packet handler ++ */ ++ public void handleEntityStatus(Packet38EntityStatus par1Packet38EntityStatus) { ++ Entity var2 = this.getEntityByID(par1Packet38EntityStatus.entityId); ++ ++ if (var2 != null) { ++ var2.handleHealthUpdate(par1Packet38EntityStatus.entityStatus); + } +- +- } +- +- private Entity getEntityByID(int var1) { +- return (Entity)(var1 == this.mc.thePlayer.entityId ? this.mc.thePlayer : this.worldClient.getEntityByID(var1)); +- } +- +- public void handleUpdateHealth(Packet8UpdateHealth var1) { +- this.mc.thePlayer.setPlayerSPHealth(var1.healthMP); +- this.mc.thePlayer.getFoodStats().setFoodLevel(var1.food); +- this.mc.thePlayer.getFoodStats().setFoodSaturationLevel(var1.foodSaturation); +- } +- +- public void handleExperience(Packet43Experience var1) { +- this.mc.thePlayer.setXPStats(var1.experience, var1.experienceTotal, var1.experienceLevel); +- } +- +- public void handleRespawn(Packet9Respawn var1) { +- if(var1.respawnDimension != this.mc.thePlayer.dimension) { ++ } ++ ++ private Entity getEntityByID(int par1) { ++ return (Entity)(par1 == this.mc.thePlayer.entityId ? this.mc.thePlayer : this.worldClient.getEntityByID(par1)); ++ } ++ ++ /** ++ * Recieves player health from the server and then proceeds to set it locally on the client. ++ */ ++ public void handleUpdateHealth(Packet8UpdateHealth par1Packet8UpdateHealth) { ++ this.mc.thePlayer.setPlayerSPHealth(par1Packet8UpdateHealth.healthMP); ++ this.mc.thePlayer.getFoodStats().setFoodLevel(par1Packet8UpdateHealth.food); ++ this.mc.thePlayer.getFoodStats().setFoodSaturationLevel(par1Packet8UpdateHealth.foodSaturation); ++ } ++ ++ /** ++ * Handle an experience packet. ++ */ ++ public void handleExperience(Packet43Experience par1Packet43Experience) { ++ this.mc.thePlayer.setXPStats(par1Packet43Experience.experience, par1Packet43Experience.experienceTotal, par1Packet43Experience.experienceLevel); ++ } ++ ++ /** ++ * respawns the player ++ */ ++ public void handleRespawn(Packet9Respawn par1Packet9Respawn) { ++ if (par1Packet9Respawn.respawnDimension != this.mc.thePlayer.dimension) { + this.doneLoadingTerrain = false; + Scoreboard var2 = this.worldClient.getScoreboard(); +- this.worldClient = new WorldClient(this, new WorldSettings(0L, var1.gameType, false, this.mc.theWorld.getWorldInfo().isHardcoreModeEnabled(), var1.terrainType), var1.respawnDimension, var1.difficulty, this.mc.mcProfiler, this.mc.getLogAgent()); ++ this.worldClient = new WorldClient(this, new WorldSettings(0L, par1Packet9Respawn.gameType, false, this.mc.theWorld.getWorldInfo().isHardcoreModeEnabled(), par1Packet9Respawn.terrainType), par1Packet9Respawn.respawnDimension, par1Packet9Respawn.difficulty, this.mc.mcProfiler, this.mc.getLogAgent()); + this.worldClient.func_96443_a(var2); + this.worldClient.isRemote = true; + this.mc.loadWorld(this.worldClient); +- this.mc.thePlayer.dimension = var1.respawnDimension; ++ this.mc.thePlayer.dimension = par1Packet9Respawn.respawnDimension; + this.mc.displayGuiScreen(new GuiDownloadTerrain(this)); + } + +- this.mc.setDimensionAndSpawnPlayer(var1.respawnDimension); +- this.mc.playerController.setGameType(var1.gameType); ++ this.mc.setDimensionAndSpawnPlayer(par1Packet9Respawn.respawnDimension); ++ this.mc.playerController.setGameType(par1Packet9Respawn.gameType); + } + +- public void handleExplosion(Packet60Explosion var1) { +- Explosion var2 = new Explosion(this.mc.theWorld, (Entity)null, var1.explosionX, var1.explosionY, var1.explosionZ, var1.explosionSize); +- var2.h = var1.e; ++ public void handleExplosion(Packet60Explosion par1Packet60Explosion) { ++ Explosion var2 = new Explosion(this.mc.theWorld, (Entity)null, par1Packet60Explosion.explosionX, par1Packet60Explosion.explosionY, par1Packet60Explosion.explosionZ, par1Packet60Explosion.explosionSize); ++ var2.affectedBlockPositions = par1Packet60Explosion.chunkPositionRecords; + var2.doExplosionB(true); +- this.mc.thePlayer.motionX += (double)var1.getPlayerVelocityX(); +- this.mc.thePlayer.motionY += (double)var1.getPlayerVelocityY(); +- this.mc.thePlayer.motionZ += (double)var1.getPlayerVelocityZ(); ++ this.mc.thePlayer.motionX += (double)par1Packet60Explosion.getPlayerVelocityX(); ++ this.mc.thePlayer.motionY += (double)par1Packet60Explosion.getPlayerVelocityY(); ++ this.mc.thePlayer.motionZ += (double)par1Packet60Explosion.getPlayerVelocityZ(); + } + +- public void handleOpenWindow(Packet100OpenWindow var1) { ++ public void handleOpenWindow(Packet100OpenWindow par1Packet100OpenWindow) { + EntityClientPlayerMP var2 = this.mc.thePlayer; +- switch(var1.inventoryType) { +- case 0: +- var2.displayGUIChest(new InventoryBasic(var1.c, var1.useProvidedWindowTitle, var1.slotsCount)); +- var2.openContainer.windowId = var1.windowId; +- break; +- case 1: +- var2.displayGUIWorkbench(MathHelper.floor_double(var2.posX), MathHelper.floor_double(var2.posY), MathHelper.floor_double(var2.posZ)); +- var2.openContainer.windowId = var1.windowId; +- break; +- case 2: +- TileEntityFurnace var4 = new TileEntityFurnace(); +- if(var1.useProvidedWindowTitle) { +- var4.setGuiDisplayName(var1.c); +- } +- +- var2.displayGUIFurnace(var4); +- var2.openContainer.windowId = var1.windowId; +- break; +- case 3: +- TileEntityDispenser var7 = new TileEntityDispenser(); +- if(var1.useProvidedWindowTitle) { +- var7.setCustomName(var1.c); +- } +- +- var2.displayGUIDispenser(var7); +- var2.openContainer.windowId = var1.windowId; +- break; +- case 4: +- var2.displayGUIEnchantment(MathHelper.floor_double(var2.posX), MathHelper.floor_double(var2.posY), MathHelper.floor_double(var2.posZ), var1.useProvidedWindowTitle ? var1.c : null); +- var2.openContainer.windowId = var1.windowId; +- break; +- case 5: +- TileEntityBrewingStand var5 = new TileEntityBrewingStand(); +- if(var1.useProvidedWindowTitle) { +- var5.func_94131_a(var1.c); +- } +- +- var2.displayGUIBrewingStand(var5); +- var2.openContainer.windowId = var1.windowId; +- break; +- case 6: +- var2.displayGUIMerchant(new NpcMerchant(var2), var1.useProvidedWindowTitle ? var1.c : null); +- var2.openContainer.windowId = var1.windowId; +- break; +- case 7: +- TileEntityBeacon var8 = new TileEntityBeacon(); +- var2.displayGUIBeacon(var8); +- if(var1.useProvidedWindowTitle) { +- var8.func_94047_a(var1.c); +- } +- +- var2.openContainer.windowId = var1.windowId; +- break; +- case 8: +- var2.displayGUIAnvil(MathHelper.floor_double(var2.posX), MathHelper.floor_double(var2.posY), MathHelper.floor_double(var2.posZ)); +- var2.openContainer.windowId = var1.windowId; +- break; +- case 9: +- TileEntityHopper var3 = new TileEntityHopper(); +- if(var1.useProvidedWindowTitle) { +- var3.setInventoryName(var1.c); +- } +- +- var2.displayGUIHopper(var3); +- var2.openContainer.windowId = var1.windowId; +- break; +- case 10: +- TileEntityDropper var6 = new TileEntityDropper(); +- if(var1.useProvidedWindowTitle) { +- var6.setCustomName(var1.c); +- } +- +- var2.displayGUIDispenser(var6); +- var2.openContainer.windowId = var1.windowId; +- break; +- case 11: +- Entity var9 = this.getEntityByID(var1.field_111008_f); +- if(var9 != null && var9 instanceof EntityHorse) { +- var2.displayGUIHorse((EntityHorse)var9, new AnimalChest(var1.c, var1.useProvidedWindowTitle, var1.slotsCount)); +- var2.openContainer.windowId = var1.windowId; +- } ++ ++ switch (par1Packet100OpenWindow.inventoryType) { ++ case 0: ++ var2.displayGUIChest(new InventoryBasic(par1Packet100OpenWindow.windowTitle, par1Packet100OpenWindow.useProvidedWindowTitle, par1Packet100OpenWindow.slotsCount)); ++ var2.openContainer.windowId = par1Packet100OpenWindow.windowId; ++ break; ++ ++ case 1: ++ var2.displayGUIWorkbench(MathHelper.floor_double(var2.posX), MathHelper.floor_double(var2.posY), MathHelper.floor_double(var2.posZ)); ++ var2.openContainer.windowId = par1Packet100OpenWindow.windowId; ++ break; ++ ++ case 2: ++ TileEntityFurnace var4 = new TileEntityFurnace(); ++ ++ if (par1Packet100OpenWindow.useProvidedWindowTitle) { ++ var4.setGuiDisplayName(par1Packet100OpenWindow.windowTitle); ++ } ++ ++ var2.displayGUIFurnace(var4); ++ var2.openContainer.windowId = par1Packet100OpenWindow.windowId; ++ break; ++ ++ case 3: ++ TileEntityDispenser var7 = new TileEntityDispenser(); ++ ++ if (par1Packet100OpenWindow.useProvidedWindowTitle) { ++ var7.setCustomName(par1Packet100OpenWindow.windowTitle); ++ } ++ ++ var2.displayGUIDispenser(var7); ++ var2.openContainer.windowId = par1Packet100OpenWindow.windowId; ++ break; ++ ++ case 4: ++ var2.displayGUIEnchantment(MathHelper.floor_double(var2.posX), MathHelper.floor_double(var2.posY), MathHelper.floor_double(var2.posZ), par1Packet100OpenWindow.useProvidedWindowTitle ? par1Packet100OpenWindow.windowTitle : null); ++ var2.openContainer.windowId = par1Packet100OpenWindow.windowId; ++ break; ++ ++ case 5: ++ TileEntityBrewingStand var5 = new TileEntityBrewingStand(); ++ ++ if (par1Packet100OpenWindow.useProvidedWindowTitle) { ++ var5.func_94131_a(par1Packet100OpenWindow.windowTitle); ++ } ++ ++ var2.displayGUIBrewingStand(var5); ++ var2.openContainer.windowId = par1Packet100OpenWindow.windowId; ++ break; ++ ++ case 6: ++ var2.displayGUIMerchant(new NpcMerchant(var2), par1Packet100OpenWindow.useProvidedWindowTitle ? par1Packet100OpenWindow.windowTitle : null); ++ var2.openContainer.windowId = par1Packet100OpenWindow.windowId; ++ break; ++ ++ case 7: ++ TileEntityBeacon var8 = new TileEntityBeacon(); ++ var2.displayGUIBeacon(var8); ++ ++ if (par1Packet100OpenWindow.useProvidedWindowTitle) { ++ var8.func_94047_a(par1Packet100OpenWindow.windowTitle); ++ } ++ ++ var2.openContainer.windowId = par1Packet100OpenWindow.windowId; ++ break; ++ ++ case 8: ++ var2.displayGUIAnvil(MathHelper.floor_double(var2.posX), MathHelper.floor_double(var2.posY), MathHelper.floor_double(var2.posZ)); ++ var2.openContainer.windowId = par1Packet100OpenWindow.windowId; ++ break; ++ ++ case 9: ++ TileEntityHopper var3 = new TileEntityHopper(); ++ ++ if (par1Packet100OpenWindow.useProvidedWindowTitle) { ++ var3.setInventoryName(par1Packet100OpenWindow.windowTitle); ++ } ++ ++ var2.displayGUIHopper(var3); ++ var2.openContainer.windowId = par1Packet100OpenWindow.windowId; ++ break; ++ ++ case 10: ++ TileEntityDropper var6 = new TileEntityDropper(); ++ ++ if (par1Packet100OpenWindow.useProvidedWindowTitle) { ++ var6.setCustomName(par1Packet100OpenWindow.windowTitle); ++ } ++ ++ var2.displayGUIDispenser(var6); ++ var2.openContainer.windowId = par1Packet100OpenWindow.windowId; ++ break; ++ ++ case 11: ++ Entity var9 = this.getEntityByID(par1Packet100OpenWindow.field_111008_f); ++ ++ if (var9 != null && var9 instanceof EntityHorse) { ++ var2.displayGUIHorse((EntityHorse)var9, new AnimalChest(par1Packet100OpenWindow.windowTitle, par1Packet100OpenWindow.useProvidedWindowTitle, par1Packet100OpenWindow.slotsCount)); ++ var2.openContainer.windowId = par1Packet100OpenWindow.windowId; ++ } + } +- + } + +- public void handleSetSlot(Packet103SetSlot var1) { ++ public void handleSetSlot(Packet103SetSlot par1Packet103SetSlot) { + EntityClientPlayerMP var2 = this.mc.thePlayer; +- if(var1.windowId == -1) { +- var2.inventory.setItemStack(var1.myItemStack); ++ ++ if (par1Packet103SetSlot.windowId == -1) { ++ var2.inventory.setItemStack(par1Packet103SetSlot.myItemStack); + } else { + boolean var3 = false; +- if(this.mc.currentScreen instanceof GuiContainerCreative) { ++ ++ if (this.mc.currentScreen instanceof GuiContainerCreative) { + GuiContainerCreative var4 = (GuiContainerCreative)this.mc.currentScreen; + var3 = var4.getCurrentTabIndex() != CreativeTabs.tabInventory.getTabIndex(); + } + +- if(var1.windowId == 0 && var1.itemSlot >= 36 && var1.itemSlot < 45) { +- ItemStack var5 = var2.inventoryContainer.getSlot(var1.itemSlot).getStack(); +- if(var1.myItemStack != null && (var5 == null || var5.stackSize < var1.myItemStack.stackSize)) { +- var1.myItemStack.animationsToGo = 5; ++ if (par1Packet103SetSlot.windowId == 0 && par1Packet103SetSlot.itemSlot >= 36 && par1Packet103SetSlot.itemSlot < 45) { ++ ItemStack var5 = var2.inventoryContainer.getSlot(par1Packet103SetSlot.itemSlot).getStack(); ++ ++ if (par1Packet103SetSlot.myItemStack != null && (var5 == null || var5.stackSize < par1Packet103SetSlot.myItemStack.stackSize)) { ++ par1Packet103SetSlot.myItemStack.animationsToGo = 5; + } + +- var2.inventoryContainer.putStackInSlot(var1.itemSlot, var1.myItemStack); +- } else if(var1.windowId == var2.openContainer.windowId && (var1.windowId != 0 || !var3)) { +- var2.openContainer.putStackInSlot(var1.itemSlot, var1.myItemStack); ++ var2.inventoryContainer.putStackInSlot(par1Packet103SetSlot.itemSlot, par1Packet103SetSlot.myItemStack); ++ } else if (par1Packet103SetSlot.windowId == var2.openContainer.windowId && (par1Packet103SetSlot.windowId != 0 || !var3)) { ++ var2.openContainer.putStackInSlot(par1Packet103SetSlot.itemSlot, par1Packet103SetSlot.myItemStack); + } + } +- + } + +- public void handleTransaction(Packet106Transaction var1) { ++ public void handleTransaction(Packet106Transaction par1Packet106Transaction) { + Container var2 = null; + EntityClientPlayerMP var3 = this.mc.thePlayer; +- if(var1.windowId == 0) { ++ ++ if (par1Packet106Transaction.windowId == 0) { + var2 = var3.inventoryContainer; +- } else if(var1.windowId == var3.openContainer.windowId) { ++ } else if (par1Packet106Transaction.windowId == var3.openContainer.windowId) { + var2 = var3.openContainer; + } + +- if(var2 != null && !var1.accepted) { +- this.addToSendQueue(new Packet106Transaction(var1.windowId, var1.shortWindowId, true)); ++ if (var2 != null && !par1Packet106Transaction.accepted) { ++ this.addToSendQueue(new Packet106Transaction(par1Packet106Transaction.windowId, par1Packet106Transaction.shortWindowId, true)); + } +- + } + +- public void handleWindowItems(Packet104WindowItems var1) { ++ public void handleWindowItems(Packet104WindowItems par1Packet104WindowItems) { + EntityClientPlayerMP var2 = this.mc.thePlayer; +- if(var1.windowId == 0) { +- var2.inventoryContainer.putStacksInSlots(var1.itemStack); +- } else if(var1.windowId == var2.openContainer.windowId) { +- var2.openContainer.putStacksInSlots(var1.itemStack); ++ ++ if (par1Packet104WindowItems.windowId == 0) { ++ var2.inventoryContainer.putStacksInSlots(par1Packet104WindowItems.itemStack); ++ } else if (par1Packet104WindowItems.windowId == var2.openContainer.windowId) { ++ var2.openContainer.putStacksInSlots(par1Packet104WindowItems.itemStack); + } +- + } ++ ++ public void func_142031_a(Packet133TileEditorOpen par1Packet133TileEditorOpen) { ++ TileEntity var2 = this.worldClient.getBlockTileEntity(par1Packet133TileEditorOpen.field_142035_b, par1Packet133TileEditorOpen.field_142036_c, par1Packet133TileEditorOpen.field_142034_d); + +- public void func_142031_a(Packet133TileEditorOpen var1) { +- TileEntity var2 = this.worldClient.getBlockTileEntity(var1.field_142035_b, var1.field_142036_c, var1.field_142034_d); +- if(var2 != null) { ++ if (var2 != null) { + this.mc.thePlayer.displayGUIEditSign(var2); +- } else if(var1.field_142037_a == 0) { ++ } else if (par1Packet133TileEditorOpen.field_142037_a == 0) { + TileEntitySign var3 = new TileEntitySign(); + var3.setWorldObj(this.worldClient); +- var3.xCoord = var1.field_142035_b; +- var3.yCoord = var1.field_142036_c; +- var3.zCoord = var1.field_142034_d; ++ var3.xCoord = par1Packet133TileEditorOpen.field_142035_b; ++ var3.yCoord = par1Packet133TileEditorOpen.field_142036_c; ++ var3.zCoord = par1Packet133TileEditorOpen.field_142034_d; + this.mc.thePlayer.displayGUIEditSign(var3); + } +- + } + +- public void handleUpdateSign(Packet130UpdateSign var1) { ++ /** ++ * Updates Client side signs ++ */ ++ public void handleUpdateSign(Packet130UpdateSign par1Packet130UpdateSign) { + boolean var2 = false; +- if(this.mc.theWorld.blockExists(var1.xPosition, var1.yPosition, var1.zPosition)) { +- TileEntity var3 = this.mc.theWorld.getBlockTileEntity(var1.xPosition, var1.yPosition, var1.zPosition); +- if(var3 instanceof TileEntitySign) { ++ ++ if (this.mc.theWorld.blockExists(par1Packet130UpdateSign.xPosition, par1Packet130UpdateSign.yPosition, par1Packet130UpdateSign.zPosition)) { ++ TileEntity var3 = this.mc.theWorld.getBlockTileEntity(par1Packet130UpdateSign.xPosition, par1Packet130UpdateSign.yPosition, par1Packet130UpdateSign.zPosition); ++ ++ if (var3 instanceof TileEntitySign) { + TileEntitySign var4 = (TileEntitySign)var3; +- if(var4.isEditable()) { +- for(int var5 = 0; var5 < 4; ++var5) { +- var4.a[var5] = var1.d[var5]; ++ ++ if (var4.isEditable()) { ++ for (int var5 = 0; var5 < 4; ++var5) { ++ var4.signText[var5] = par1Packet130UpdateSign.signLines[var5]; + } + + var4.onInventoryChanged(); ++ // Spout Start ++ var4.recalculateText(); ++ // Spout End + } + + var2 = true; + } + } + +- if(!var2 && this.mc.thePlayer != null) { +- this.mc.thePlayer.sendChatToPlayer(ChatMessageComponent.createFromText("Unable to locate sign at " + var1.xPosition + ", " + var1.yPosition + ", " + var1.zPosition)); ++ if (!var2 && this.mc.thePlayer != null) { ++ // Disable this notification until I can find cause. ++ //this.mc.thePlayer.sendChatToPlayer(ChatMessageComponent.createFromText("Unable to locate sign at " + par1Packet130UpdateSign.xPosition + ", " + par1Packet130UpdateSign.yPosition + ", " + par1Packet130UpdateSign.zPosition)); + } +- + } + +- public void handleTileEntityData(Packet132TileEntityData var1) { +- if(this.mc.theWorld.blockExists(var1.xPosition, var1.yPosition, var1.zPosition)) { +- TileEntity var2 = this.mc.theWorld.getBlockTileEntity(var1.xPosition, var1.yPosition, var1.zPosition); +- if(var2 != null) { +- if(var1.actionType == 1 && var2 instanceof TileEntityMobSpawner) { +- var2.readFromNBT(var1.data); +- } else if(var1.actionType == 2 && var2 instanceof TileEntityCommandBlock) { +- var2.readFromNBT(var1.data); +- } else if(var1.actionType == 3 && var2 instanceof TileEntityBeacon) { +- var2.readFromNBT(var1.data); +- } else if(var1.actionType == 4 && var2 instanceof TileEntitySkull) { +- var2.readFromNBT(var1.data); ++ public void handleTileEntityData(Packet132TileEntityData par1Packet132TileEntityData) { ++ if (this.mc.theWorld.blockExists(par1Packet132TileEntityData.xPosition, par1Packet132TileEntityData.yPosition, par1Packet132TileEntityData.zPosition)) { ++ TileEntity var2 = this.mc.theWorld.getBlockTileEntity(par1Packet132TileEntityData.xPosition, par1Packet132TileEntityData.yPosition, par1Packet132TileEntityData.zPosition); ++ ++ if (var2 != null) { ++ if (par1Packet132TileEntityData.actionType == 1 && var2 instanceof TileEntityMobSpawner) { ++ var2.readFromNBT(par1Packet132TileEntityData.data); ++ } else if (par1Packet132TileEntityData.actionType == 2 && var2 instanceof TileEntityCommandBlock) { ++ var2.readFromNBT(par1Packet132TileEntityData.data); ++ } else if (par1Packet132TileEntityData.actionType == 3 && var2 instanceof TileEntityBeacon) { ++ var2.readFromNBT(par1Packet132TileEntityData.data); ++ } else if (par1Packet132TileEntityData.actionType == 4 && var2 instanceof TileEntitySkull) { ++ var2.readFromNBT(par1Packet132TileEntityData.data); + } + } + } +- + } + +- public void handleUpdateProgressbar(Packet105UpdateProgressbar var1) { ++ public void handleUpdateProgressbar(Packet105UpdateProgressbar par1Packet105UpdateProgressbar) { + EntityClientPlayerMP var2 = this.mc.thePlayer; +- this.unexpectedPacket(var1); +- if(var2.openContainer != null && var2.openContainer.windowId == var1.windowId) { +- var2.openContainer.updateProgressBar(var1.progressBar, var1.progressBarValue); +- } +- +- } +- +- public void handlePlayerInventory(Packet5PlayerInventory var1) { +- Entity var2 = this.getEntityByID(var1.entityID); +- if(var2 != null) { +- var2.setCurrentItemOrArmor(var1.slot, var1.getItemSlot()); +- } +- +- } +- +- public void handleCloseWindow(Packet101CloseWindow var1) { ++ this.unexpectedPacket(par1Packet105UpdateProgressbar); ++ ++ if (var2.openContainer != null && var2.openContainer.windowId == par1Packet105UpdateProgressbar.windowId) { ++ var2.openContainer.updateProgressBar(par1Packet105UpdateProgressbar.progressBar, par1Packet105UpdateProgressbar.progressBarValue); ++ } ++ } ++ ++ public void handlePlayerInventory(Packet5PlayerInventory par1Packet5PlayerInventory) { ++ Entity var2 = this.getEntityByID(par1Packet5PlayerInventory.entityID); ++ ++ if (var2 != null) { ++ var2.setCurrentItemOrArmor(par1Packet5PlayerInventory.slot, par1Packet5PlayerInventory.getItemSlot()); ++ } ++ } ++ ++ public void handleCloseWindow(Packet101CloseWindow par1Packet101CloseWindow) { + this.mc.thePlayer.func_92015_f(); + } + +- public void handleBlockEvent(Packet54PlayNoteBlock var1) { +- this.mc.theWorld.addBlockEvent(var1.xLocation, var1.yLocation, var1.zLocation, var1.blockId, var1.instrumentType, var1.pitch); +- } +- +- public void handleBlockDestroy(Packet55BlockDestroy var1) { +- this.mc.theWorld.destroyBlockInWorldPartially(var1.getEntityId(), var1.getPosX(), var1.getPosY(), var1.getPosZ(), var1.getDestroyedStage()); +- } +- +- public void handleMapChunks(Packet56MapChunks var1) { +- for(int var2 = 0; var2 < var1.getNumberOfChunkInPacket(); ++var2) { +- int var3 = var1.getChunkPosX(var2); +- int var4 = var1.getChunkPosZ(var2); ++ public void handleBlockEvent(Packet54PlayNoteBlock par1Packet54PlayNoteBlock) { ++ this.mc.theWorld.addBlockEvent(par1Packet54PlayNoteBlock.xLocation, par1Packet54PlayNoteBlock.yLocation, par1Packet54PlayNoteBlock.zLocation, par1Packet54PlayNoteBlock.blockId, par1Packet54PlayNoteBlock.instrumentType, par1Packet54PlayNoteBlock.pitch); ++ } ++ ++ public void handleBlockDestroy(Packet55BlockDestroy par1Packet55BlockDestroy) { ++ this.mc.theWorld.destroyBlockInWorldPartially(par1Packet55BlockDestroy.getEntityId(), par1Packet55BlockDestroy.getPosX(), par1Packet55BlockDestroy.getPosY(), par1Packet55BlockDestroy.getPosZ(), par1Packet55BlockDestroy.getDestroyedStage()); ++ } ++ ++ public void handleMapChunks(Packet56MapChunks par1Packet56MapChunks) { ++ for (int var2 = 0; var2 < par1Packet56MapChunks.getNumberOfChunkInPacket(); ++var2) { ++ int var3 = par1Packet56MapChunks.getChunkPosX(var2); ++ int var4 = par1Packet56MapChunks.getChunkPosZ(var2); + this.worldClient.doPreChunk(var3, var4, true); + this.worldClient.invalidateBlockReceiveRegion(var3 << 4, 0, var4 << 4, (var3 << 4) + 15, 256, (var4 << 4) + 15); + Chunk var5 = this.worldClient.getChunkFromChunkCoords(var3, var4); +- if(var5 == null) { ++ ++ if (var5 == null) { + this.worldClient.doPreChunk(var3, var4, true); + var5 = this.worldClient.getChunkFromChunkCoords(var3, var4); + } + +- if(var5 != null) { +- var5.fillChunk(var1.getChunkCompressedData(var2), var1.field_73590_a[var2], var1.field_73588_b[var2], true); ++ if (var5 != null) { ++ var5.fillChunk(par1Packet56MapChunks.getChunkCompressedData(var2), par1Packet56MapChunks.field_73590_a[var2], par1Packet56MapChunks.field_73588_b[var2], true); + this.worldClient.markBlockRangeForRenderUpdate(var3 << 4, 0, var4 << 4, (var3 << 4) + 15, 256, (var4 << 4) + 15); +- if(!(this.worldClient.provider instanceof WorldProviderSurface)) { ++ ++ if (!(this.worldClient.provider instanceof WorldProviderSurface)) { + var5.resetRelightChecks(); + } + } + } +- + } + ++ /** ++ * If this returns false, all packets will be queued for the main thread to handle, even if they would otherwise be ++ * processed asynchronously. Used to avoid processing packets on the client before the world has been downloaded (which ++ * happens on the main thread) ++ */ + public boolean canProcessPacketsAsync() { + return this.mc != null && this.mc.theWorld != null && this.mc.thePlayer != null && this.worldClient != null; + } + +- public void handleGameEvent(Packet70GameEvent var1) { ++ public void handleGameEvent(Packet70GameEvent par1Packet70GameEvent) { + EntityClientPlayerMP var2 = this.mc.thePlayer; +- int var3 = var1.eventType; +- int var4 = var1.gameMode; +- if(var3 >= 0 && var3 < Packet70GameEvent.a.length && Packet70GameEvent.a[var3] != null) { +- var2.addChatMessage(Packet70GameEvent.a[var3]); ++ int var3 = par1Packet70GameEvent.eventType; ++ int var4 = par1Packet70GameEvent.gameMode; ++ ++ if (var3 >= 0 && var3 < Packet70GameEvent.clientMessage.length && Packet70GameEvent.clientMessage[var3] != null) { ++ var2.addChatMessage(Packet70GameEvent.clientMessage[var3]); + } + +- if(var3 == 1) { ++ if (var3 == 1) { + this.worldClient.getWorldInfo().setRaining(true); + this.worldClient.setRainStrength(0.0F); +- } else if(var3 == 2) { ++ } else if (var3 == 2) { + this.worldClient.getWorldInfo().setRaining(false); + this.worldClient.setRainStrength(1.0F); +- } else if(var3 == 3) { ++ } else if (var3 == 3) { + this.mc.playerController.setGameType(EnumGameType.getByID(var4)); +- } else if(var3 == 4) { ++ // Spout Start - Trigger survival HUD update ++ GuiIngame.dirtySurvival(); ++ // Spout End ++ } else if (var3 == 4) { + this.mc.displayGuiScreen(new GuiWinGame()); +- } else if(var3 == 5) { ++ } else if (var3 == 5) { + GameSettings var5 = this.mc.gameSettings; +- if(var4 == 0) { ++ ++ if (var4 == 0) { + this.mc.displayGuiScreen(new GuiScreenDemo()); +- } else if(var4 == 101) { +- this.mc.ingameGUI.getChatGUI().addTranslatedMessage("demo.help.movement", new Object[]{Keyboard.getKeyName(var5.keyBindForward.keyCode), Keyboard.getKeyName(var5.keyBindLeft.keyCode), Keyboard.getKeyName(var5.keyBindBack.keyCode), Keyboard.getKeyName(var5.keyBindRight.keyCode)}); +- } else if(var4 == 102) { +- this.mc.ingameGUI.getChatGUI().addTranslatedMessage("demo.help.jump", new Object[]{Keyboard.getKeyName(var5.keyBindJump.keyCode)}); +- } else if(var4 == 103) { +- this.mc.ingameGUI.getChatGUI().addTranslatedMessage("demo.help.inventory", new Object[]{Keyboard.getKeyName(var5.keyBindInventory.keyCode)}); ++ } else if (var4 == 101) { ++ this.mc.ingameGUI.getChatGUI().addTranslatedMessage("demo.help.movement", new Object[] {Keyboard.getKeyName(var5.keyBindForward.keyCode), Keyboard.getKeyName(var5.keyBindLeft.keyCode), Keyboard.getKeyName(var5.keyBindBack.keyCode), Keyboard.getKeyName(var5.keyBindRight.keyCode)}); ++ } else if (var4 == 102) { ++ this.mc.ingameGUI.getChatGUI().addTranslatedMessage("demo.help.jump", new Object[] {Keyboard.getKeyName(var5.keyBindJump.keyCode)}); ++ } else if (var4 == 103) { ++ this.mc.ingameGUI.getChatGUI().addTranslatedMessage("demo.help.inventory", new Object[] {Keyboard.getKeyName(var5.keyBindInventory.keyCode)}); + } +- } else if(var3 == 6) { ++ } else if (var3 == 6) { + this.worldClient.playSound(var2.posX, var2.posY + (double)var2.getEyeHeight(), var2.posZ, "random.successful_hit", 0.18F, 0.45F, false); + } +- +- } +- +- public void handleMapData(Packet131MapData var1) { +- if(var1.itemID == Item.map.itemID) { +- ItemMap.getMPMapData(var1.uniqueID, this.mc.theWorld).updateMPMapData(var1.itemData); +- } else { +- this.mc.getLogAgent().logWarning("Unknown itemid: " + var1.uniqueID); +- } +- +- } +- +- public void handleDoorChange(Packet61DoorChange var1) { +- if(var1.getRelativeVolumeDisabled()) { +- this.mc.theWorld.func_82739_e(var1.sfxID, var1.posX, var1.posY, var1.posZ, var1.auxData); +- } else { +- this.mc.theWorld.playAuxSFX(var1.sfxID, var1.posX, var1.posY, var1.posZ, var1.auxData); +- } +- +- } +- +- public void handleStatistic(Packet200Statistic var1) { +- this.mc.thePlayer.incrementStat(StatList.getOneShotStat(var1.statisticId), var1.amount); +- } +- +- public void handleEntityEffect(Packet41EntityEffect var1) { +- Entity var2 = this.getEntityByID(var1.entityId); +- if(var2 instanceof EntityLivingBase) { +- PotionEffect var3 = new PotionEffect(var1.effectId, var1.duration, var1.effectAmplifier); +- var3.setPotionDurationMax(var1.isDurationMax()); ++ } ++ ++ /** ++ * Contains logic for handling packets containing arbitrary unique item data. Currently this is only for maps. ++ */ ++ public void handleMapData(Packet131MapData par1Packet131MapData) { ++ if (par1Packet131MapData.itemID == Item.map.itemID) { ++ ItemMap.getMPMapData(par1Packet131MapData.uniqueID, this.mc.theWorld).updateMPMapData(par1Packet131MapData.itemData); ++ } else { ++ this.mc.getLogAgent().logWarning("Unknown itemid: " + par1Packet131MapData.uniqueID); ++ } ++ } ++ ++ public void handleDoorChange(Packet61DoorChange par1Packet61DoorChange) { ++ if (par1Packet61DoorChange.getRelativeVolumeDisabled()) { ++ this.mc.theWorld.func_82739_e(par1Packet61DoorChange.sfxID, par1Packet61DoorChange.posX, par1Packet61DoorChange.posY, par1Packet61DoorChange.posZ, par1Packet61DoorChange.auxData); ++ } else { ++ this.mc.theWorld.playAuxSFX(par1Packet61DoorChange.sfxID, par1Packet61DoorChange.posX, par1Packet61DoorChange.posY, par1Packet61DoorChange.posZ, par1Packet61DoorChange.auxData); ++ } ++ } ++ ++ /** ++ * Increment player statistics ++ */ ++ public void handleStatistic(Packet200Statistic par1Packet200Statistic) { ++ this.mc.thePlayer.incrementStat(StatList.getOneShotStat(par1Packet200Statistic.statisticId), par1Packet200Statistic.amount); ++ } ++ ++ /** ++ * Handle an entity effect packet. ++ */ ++ public void handleEntityEffect(Packet41EntityEffect par1Packet41EntityEffect) { ++ Entity var2 = this.getEntityByID(par1Packet41EntityEffect.entityId); ++ ++ if (var2 instanceof EntityLivingBase) { ++ PotionEffect var3 = new PotionEffect(par1Packet41EntityEffect.effectId, par1Packet41EntityEffect.duration, par1Packet41EntityEffect.effectAmplifier); ++ var3.setPotionDurationMax(par1Packet41EntityEffect.isDurationMax()); + ((EntityLivingBase)var2).addPotionEffect(var3); + } + } + +- public void handleRemoveEntityEffect(Packet42RemoveEntityEffect var1) { +- Entity var2 = this.getEntityByID(var1.entityId); +- if(var2 instanceof EntityLivingBase) { +- ((EntityLivingBase)var2).removePotionEffectClient(var1.effectId); ++ /** ++ * Handle a remove entity effect packet. ++ */ ++ public void handleRemoveEntityEffect(Packet42RemoveEntityEffect par1Packet42RemoveEntityEffect) { ++ Entity var2 = this.getEntityByID(par1Packet42RemoveEntityEffect.entityId); ++ ++ if (var2 instanceof EntityLivingBase) { ++ ((EntityLivingBase)var2).removePotionEffectClient(par1Packet42RemoveEntityEffect.effectId); + } + } + ++ /** ++ * determine if it is a server handler ++ */ + public boolean isServerHandler() { + return false; + } + +- public void handlePlayerInfo(Packet201PlayerInfo var1) { +- GuiPlayerInfo var2 = (GuiPlayerInfo)this.k.get(var1.a); +- if(var2 == null && var1.isConnected) { +- var2 = new GuiPlayerInfo(var1.a); +- this.k.put(var1.a, var2); +- this.c.add(var2); +- } +- +- if(var2 != null && !var1.isConnected) { +- this.k.remove(var1.a); +- this.c.remove(var2); +- } +- +- if(var1.isConnected && var2 != null) { +- var2.responseTime = var1.ping; +- } +- +- } +- +- public void handleKeepAlive(Packet0KeepAlive var1) { +- this.addToSendQueue(new Packet0KeepAlive(var1.randomId)); +- } +- +- public void handlePlayerAbilities(Packet202PlayerAbilities var1) { ++ /** ++ * Handle a player information packet. ++ */ ++ public void handlePlayerInfo(Packet201PlayerInfo par1Packet201PlayerInfo) { ++ GuiPlayerInfo var2 = (GuiPlayerInfo)this.playerInfoMap.get(par1Packet201PlayerInfo.playerName); ++ ++ if (var2 == null && par1Packet201PlayerInfo.isConnected) { ++ var2 = new GuiPlayerInfo(par1Packet201PlayerInfo.playerName); ++ this.playerInfoMap.put(par1Packet201PlayerInfo.playerName, var2); ++ this.playerInfoList.add(var2); ++ } ++ ++ if (var2 != null && !par1Packet201PlayerInfo.isConnected) { ++ this.playerInfoMap.remove(par1Packet201PlayerInfo.playerName); ++ this.playerInfoList.remove(var2); ++ } ++ ++ if (par1Packet201PlayerInfo.isConnected && var2 != null) { ++ var2.responseTime = par1Packet201PlayerInfo.ping; ++ } ++ } ++ ++ /** ++ * Handle a keep alive packet. ++ */ ++ public void handleKeepAlive(Packet0KeepAlive par1Packet0KeepAlive) { ++ this.addToSendQueue(new Packet0KeepAlive(par1Packet0KeepAlive.randomId)); ++ } ++ ++ /** ++ * Handle a player abilities packet. ++ */ ++ public void handlePlayerAbilities(Packet202PlayerAbilities par1Packet202PlayerAbilities) { + EntityClientPlayerMP var2 = this.mc.thePlayer; +- var2.capabilities.isFlying = var1.getFlying(); +- var2.capabilities.isCreativeMode = var1.isCreativeMode(); +- var2.capabilities.disableDamage = var1.getDisableDamage(); +- var2.capabilities.allowFlying = var1.getAllowFlying(); +- var2.capabilities.setFlySpeed(var1.getFlySpeed()); +- var2.capabilities.setPlayerWalkSpeed(var1.getWalkSpeed()); ++ var2.capabilities.isFlying = par1Packet202PlayerAbilities.getFlying(); ++ var2.capabilities.isCreativeMode = par1Packet202PlayerAbilities.isCreativeMode(); ++ var2.capabilities.disableDamage = par1Packet202PlayerAbilities.getDisableDamage(); ++ var2.capabilities.allowFlying = par1Packet202PlayerAbilities.getAllowFlying(); ++ var2.capabilities.setFlySpeed(par1Packet202PlayerAbilities.getFlySpeed()); ++ var2.capabilities.setPlayerWalkSpeed(par1Packet202PlayerAbilities.getWalkSpeed()); + } + +- public void handleAutoComplete(Packet203AutoComplete var1) { +- String[] var2 = var1.getText().split("\u0000"); +- if(this.mc.currentScreen instanceof GuiChat) { ++ public void handleAutoComplete(Packet203AutoComplete par1Packet203AutoComplete) { ++ String[] var2 = par1Packet203AutoComplete.getText().split("\u0000"); ++ ++ if (this.mc.currentScreen instanceof GuiChat) { + GuiChat var3 = (GuiChat)this.mc.currentScreen; + var3.func_73894_a(var2); + } +- +- } +- +- public void handleLevelSound(Packet62LevelSound var1) { +- this.mc.theWorld.playSound(var1.getEffectX(), var1.getEffectY(), var1.getEffectZ(), var1.getSoundName(), var1.getVolume(), var1.getPitch(), false); +- } +- +- public void handleCustomPayload(Packet250CustomPayload var1) { +- if("MC|TrList".equals(var1.a)) { +- DataInputStream var2 = new DataInputStream(new ByteArrayInputStream(var1.data)); +- +- try { +- int var3 = var2.readInt(); +- GuiScreen var4 = this.mc.currentScreen; +- if(var4 != null && var4 instanceof GuiMerchant && var3 == this.mc.thePlayer.openContainer.windowId) { +- IMerchant var5 = ((GuiMerchant)var4).getIMerchant(); +- MerchantRecipeList var6 = MerchantRecipeList.readRecipiesFromStream(var2); +- var5.setRecipes(var6); ++ } ++ ++ public void handleLevelSound(Packet62LevelSound par1Packet62LevelSound) { ++ this.mc.theWorld.playSound(par1Packet62LevelSound.getEffectX(), par1Packet62LevelSound.getEffectY(), par1Packet62LevelSound.getEffectZ(), par1Packet62LevelSound.getSoundName(), par1Packet62LevelSound.getVolume(), par1Packet62LevelSound.getPitch(), false); ++ } ++ ++ public void handleCustomPayload(Packet250CustomPayload par1Packet250CustomPayload) { ++ if ("MC|TrList".equals(par1Packet250CustomPayload.channel)) { ++ if (Configuration.isServerTexturePromptsEnabled()) { ++ DataInputStream var2 = new DataInputStream(new ByteArrayInputStream(par1Packet250CustomPayload.data)); ++ ++ try { ++ int var3 = var2.readInt(); ++ GuiScreen var4 = this.mc.currentScreen; ++ ++ if (var4 != null && var4 instanceof GuiMerchant && var3 == this.mc.thePlayer.openContainer.windowId) { ++ IMerchant var5 = ((GuiMerchant)var4).getIMerchant(); ++ MerchantRecipeList var6 = MerchantRecipeList.readRecipiesFromStream(var2); ++ var5.setRecipes(var6); ++ } ++ } catch (IOException var7) { ++ var7.printStackTrace(); + } +- } catch (IOException var7) { +- var7.printStackTrace(); + } +- } else if("MC|Brand".equals(var1.a)) { +- this.mc.thePlayer.func_142020_c(new String(var1.data, Charsets.UTF_8)); ++ } else if ("MC|Brand".equals(par1Packet250CustomPayload.channel)) { ++ this.mc.thePlayer.func_142020_c(new String(par1Packet250CustomPayload.data, Charsets.UTF_8)); + } +- + } + +- public void handleSetObjective(Packet206SetObjective var1) { ++ /** ++ * Handle a set objective packet. ++ */ ++ public void handleSetObjective(Packet206SetObjective par1Packet206SetObjective) { + Scoreboard var2 = this.worldClient.getScoreboard(); + ScoreObjective var3; +- if(var1.change == 0) { +- var3 = var2.func_96535_a(var1.a, ScoreObjectiveCriteria.field_96641_b); +- var3.setDisplayName(var1.b); ++ ++ if (par1Packet206SetObjective.change == 0) { ++ var3 = var2.func_96535_a(par1Packet206SetObjective.objectiveName, ScoreObjectiveCriteria.field_96641_b); ++ var3.setDisplayName(par1Packet206SetObjective.objectiveDisplayName); + } else { +- var3 = var2.getObjective(var1.a); +- if(var1.change == 1) { ++ var3 = var2.getObjective(par1Packet206SetObjective.objectiveName); ++ ++ if (par1Packet206SetObjective.change == 1) { + var2.func_96519_k(var3); +- } else if(var1.change == 2) { +- var3.setDisplayName(var1.b); ++ } else if (par1Packet206SetObjective.change == 2) { ++ var3.setDisplayName(par1Packet206SetObjective.objectiveDisplayName); + } + } +- + } + +- public void handleSetScore(Packet207SetScore var1) { ++ /** ++ * Handle a set score packet. ++ */ ++ public void handleSetScore(Packet207SetScore par1Packet207SetScore) { + Scoreboard var2 = this.worldClient.getScoreboard(); +- ScoreObjective var3 = var2.getObjective(var1.b); +- if(var1.updateOrRemove == 0) { +- Score var4 = var2.func_96529_a(var1.a, var3); +- var4.func_96647_c(var1.value); +- } else if(var1.updateOrRemove == 1) { +- var2.func_96515_c(var1.a); ++ ScoreObjective var3 = var2.getObjective(par1Packet207SetScore.scoreName); ++ ++ if (par1Packet207SetScore.updateOrRemove == 0) { ++ Score var4 = var2.func_96529_a(par1Packet207SetScore.itemName, var3); ++ var4.func_96647_c(par1Packet207SetScore.value); ++ } else if (par1Packet207SetScore.updateOrRemove == 1) { ++ var2.func_96515_c(par1Packet207SetScore.itemName); + } +- + } + +- public void handleSetDisplayObjective(Packet208SetDisplayObjective var1) { ++ /** ++ * Handle a set display objective packet. ++ */ ++ public void handleSetDisplayObjective(Packet208SetDisplayObjective par1Packet208SetDisplayObjective) { + Scoreboard var2 = this.worldClient.getScoreboard(); +- if(var1.b.length() == 0) { +- var2.func_96530_a(var1.scoreboardPosition, (ScoreObjective)null); ++ ++ if (par1Packet208SetDisplayObjective.scoreName.length() == 0) { ++ var2.func_96530_a(par1Packet208SetDisplayObjective.scoreboardPosition, (ScoreObjective)null); + } else { +- ScoreObjective var3 = var2.getObjective(var1.b); +- var2.func_96530_a(var1.scoreboardPosition, var3); ++ ScoreObjective var3 = var2.getObjective(par1Packet208SetDisplayObjective.scoreName); ++ var2.func_96530_a(par1Packet208SetDisplayObjective.scoreboardPosition, var3); + } +- + } + +- public void handleSetPlayerTeam(Packet209SetPlayerTeam var1) { ++ /** ++ * Handle a set player team packet. ++ */ ++ public void handleSetPlayerTeam(Packet209SetPlayerTeam par1Packet209SetPlayerTeam) { + Scoreboard var2 = this.worldClient.getScoreboard(); + ScorePlayerTeam var3; +- if(var1.mode == 0) { +- var3 = var2.createTeam(var1.a); ++ ++ if (par1Packet209SetPlayerTeam.mode == 0) { ++ var3 = var2.func_96527_f(par1Packet209SetPlayerTeam.teamName); + } else { +- var3 = var2.func_96508_e(var1.a); ++ var3 = var2.func_96508_e(par1Packet209SetPlayerTeam.teamName); + } + +- if(var1.mode == 0 || var1.mode == 2) { +- var3.setTeamName(var1.b); +- var3.setNamePrefix(var1.c); +- var3.setNameSuffix(var1.d); +- var3.func_98298_a(var1.friendlyFire); ++ if (par1Packet209SetPlayerTeam.mode == 0 || par1Packet209SetPlayerTeam.mode == 2) { ++ var3.func_96664_a(par1Packet209SetPlayerTeam.teamDisplayName); ++ var3.func_96666_b(par1Packet209SetPlayerTeam.teamPrefix); ++ var3.func_96662_c(par1Packet209SetPlayerTeam.teamSuffix); ++ var3.func_98298_a(par1Packet209SetPlayerTeam.friendlyFire); + } + + Iterator var4; + String var5; +- if(var1.mode == 0 || var1.mode == 3) { +- var4 = var1.e.iterator(); +- +- while(var4.hasNext()) { ++ ++ if (par1Packet209SetPlayerTeam.mode == 0 || par1Packet209SetPlayerTeam.mode == 3) { ++ var4 = par1Packet209SetPlayerTeam.playerNames.iterator(); ++ ++ while (var4.hasNext()) { + var5 = (String)var4.next(); +- var2.addPlayerToTeam(var5, var3); ++ var2.func_96521_a(var5, var3); + } + } + +- if(var1.mode == 4) { +- var4 = var1.e.iterator(); ++ if (par1Packet209SetPlayerTeam.mode == 4) { ++ var4 = par1Packet209SetPlayerTeam.playerNames.iterator(); + +- while(var4.hasNext()) { ++ while (var4.hasNext()) { + var5 = (String)var4.next(); + var2.removePlayerFromTeam(var5, var3); + } + } + +- if(var1.mode == 1) { ++ if (par1Packet209SetPlayerTeam.mode == 1) { + var2.func_96511_d(var3); + } +- + } + +- public void handleWorldParticles(Packet63WorldParticles var1) { +- for(int var2 = 0; var2 < var1.getQuantity(); ++var2) { +- double var3 = this.e.nextGaussian() * (double)var1.getOffsetX(); +- double var5 = this.e.nextGaussian() * (double)var1.getOffsetY(); +- double var7 = this.e.nextGaussian() * (double)var1.getOffsetZ(); +- double var9 = this.e.nextGaussian() * (double)var1.getSpeed(); +- double var11 = this.e.nextGaussian() * (double)var1.getSpeed(); +- double var13 = this.e.nextGaussian() * (double)var1.getSpeed(); +- this.worldClient.spawnParticle(var1.getParticleName(), var1.getPositionX() + var3, var1.getPositionY() + var5, var1.getPositionZ() + var7, var9, var11, var13); ++ /** ++ * Handle a world particles packet. ++ */ ++ public void handleWorldParticles(Packet63WorldParticles par1Packet63WorldParticles) { ++ for (int var2 = 0; var2 < par1Packet63WorldParticles.getQuantity(); ++var2) { ++ double var3 = this.rand.nextGaussian() * (double)par1Packet63WorldParticles.getOffsetX(); ++ double var5 = this.rand.nextGaussian() * (double)par1Packet63WorldParticles.getOffsetY(); ++ double var7 = this.rand.nextGaussian() * (double)par1Packet63WorldParticles.getOffsetZ(); ++ double var9 = this.rand.nextGaussian() * (double)par1Packet63WorldParticles.getSpeed(); ++ double var11 = this.rand.nextGaussian() * (double)par1Packet63WorldParticles.getSpeed(); ++ double var13 = this.rand.nextGaussian() * (double)par1Packet63WorldParticles.getSpeed(); ++ this.worldClient.spawnParticle(par1Packet63WorldParticles.getParticleName(), par1Packet63WorldParticles.getPositionX() + var3, par1Packet63WorldParticles.getPositionY() + var5, par1Packet63WorldParticles.getPositionZ() + var7, var9, var11, var13); + } +- + } ++ ++ public void func_110773_a(Packet44UpdateAttributes par1Packet44UpdateAttributes) { ++ Entity var2 = this.getEntityByID(par1Packet44UpdateAttributes.func_111002_d()); + +- public void func_110773_a(Packet44UpdateAttributes var1) { +- Entity var2 = this.getEntityByID(var1.func_111002_d()); +- if(var2 != null) { +- if(!(var2 instanceof EntityLivingBase)) { ++ if (var2 != null) { ++ if (!(var2 instanceof EntityLivingBase)) { + throw new IllegalStateException("Server tried to update attributes of a non-living entity (actually: " + var2 + ")"); + } else { + BaseAttributeMap var3 = ((EntityLivingBase)var2).getAttributeMap(); +- Iterator var4 = var1.func_111003_f().iterator(); ++ Iterator var4 = par1Packet44UpdateAttributes.func_111003_f().iterator(); + +- while(var4.hasNext()) { ++ while (var4.hasNext()) { + Packet44UpdateAttributesSnapshot var5 = (Packet44UpdateAttributesSnapshot)var4.next(); + AttributeInstance var6 = var3.getAttributeInstanceByName(var5.func_142040_a()); +- if(var6 == null) { ++ ++ if (var6 == null) { + var6 = var3.func_111150_b(new RangedAttribute(var5.func_142040_a(), 0.0D, 2.2250738585072014E-308D, Double.MAX_VALUE)); + } + +@@ -1177,16 +1429,19 @@ + var6.func_142049_d(); + Iterator var7 = var5.func_142039_c().iterator(); + +- while(var7.hasNext()) { ++ while (var7.hasNext()) { + AttributeModifier var8 = (AttributeModifier)var7.next(); + var6.applyModifier(var8); + } + } +- + } + } + } + ++ ++ /** ++ * Return the NetworkManager instance used by this NetClientHandler ++ */ + public INetworkManager getNetManager() { + return this.netManager; + } diff --git a/patches/net/minecraft/src/NetHandler.java.patch b/patches/net/minecraft/src/NetHandler.java.patch new file mode 100644 index 0000000..bfab4f2 --- /dev/null +++ b/patches/net/minecraft/src/NetHandler.java.patch @@ -0,0 +1,709 @@ +--- net/minecraft/src/NetHandler.java ++++ net/minecraft/src/NetHandler.java +@@ -1,316 +1,402 @@ + package net.minecraft.src; + + public abstract class NetHandler { ++ ++ /** ++ * determine if it is a server handler ++ */ + public abstract boolean isServerHandler(); + +- public void handleMapChunk(Packet51MapChunk var1) { +- } +- +- public void unexpectedPacket(Packet var1) { +- } +- +- public void handleErrorMessage(String var1, Object[] var2) { +- } +- +- public void handleKickDisconnect(Packet255KickDisconnect var1) { +- this.unexpectedPacket(var1); +- } +- +- public void handleLogin(Packet1Login var1) { +- this.unexpectedPacket(var1); +- } +- +- public void handleFlying(Packet10Flying var1) { +- this.unexpectedPacket(var1); +- } +- +- public void handleMultiBlockChange(Packet52MultiBlockChange var1) { +- this.unexpectedPacket(var1); +- } +- +- public void handleBlockDig(Packet14BlockDig var1) { +- this.unexpectedPacket(var1); +- } +- +- public void handleBlockChange(Packet53BlockChange var1) { +- this.unexpectedPacket(var1); +- } +- +- public void handleNamedEntitySpawn(Packet20NamedEntitySpawn var1) { +- this.unexpectedPacket(var1); +- } +- +- public void handleEntity(Packet30Entity var1) { +- this.unexpectedPacket(var1); +- } +- +- public void handleEntityTeleport(Packet34EntityTeleport var1) { +- this.unexpectedPacket(var1); +- } +- +- public void handlePlace(Packet15Place var1) { +- this.unexpectedPacket(var1); +- } +- +- public void handleBlockItemSwitch(Packet16BlockItemSwitch var1) { +- this.unexpectedPacket(var1); +- } +- +- public void handleDestroyEntity(Packet29DestroyEntity var1) { +- this.unexpectedPacket(var1); +- } +- +- public void handleCollect(Packet22Collect var1) { +- this.unexpectedPacket(var1); +- } +- +- public void handleChat(Packet3Chat var1) { +- this.unexpectedPacket(var1); +- } +- +- public void handleVehicleSpawn(Packet23VehicleSpawn var1) { +- this.unexpectedPacket(var1); +- } +- +- public void handleAnimation(Packet18Animation var1) { +- this.unexpectedPacket(var1); +- } +- +- public void handleEntityAction(Packet19EntityAction var1) { +- this.unexpectedPacket(var1); +- } +- +- public void handleClientProtocol(Packet2ClientProtocol var1) { +- this.unexpectedPacket(var1); +- } +- +- public void handleServerAuthData(Packet253ServerAuthData var1) { +- this.unexpectedPacket(var1); +- } +- +- public void handleSharedKey(Packet252SharedKey var1) { +- this.unexpectedPacket(var1); +- } +- +- public void handleMobSpawn(Packet24MobSpawn var1) { +- this.unexpectedPacket(var1); +- } +- +- public void handleUpdateTime(Packet4UpdateTime var1) { +- this.unexpectedPacket(var1); +- } +- +- public void handleSpawnPosition(Packet6SpawnPosition var1) { +- this.unexpectedPacket(var1); +- } +- +- public void handleEntityVelocity(Packet28EntityVelocity var1) { +- this.unexpectedPacket(var1); +- } +- +- public void handleEntityMetadata(Packet40EntityMetadata var1) { +- this.unexpectedPacket(var1); +- } +- +- public void handleAttachEntity(Packet39AttachEntity var1) { +- this.unexpectedPacket(var1); +- } +- +- public void handleUseEntity(Packet7UseEntity var1) { +- this.unexpectedPacket(var1); +- } +- +- public void handleEntityStatus(Packet38EntityStatus var1) { +- this.unexpectedPacket(var1); +- } +- +- public void handleUpdateHealth(Packet8UpdateHealth var1) { +- this.unexpectedPacket(var1); +- } +- +- public void handleRespawn(Packet9Respawn var1) { +- this.unexpectedPacket(var1); +- } +- +- public void handleExplosion(Packet60Explosion var1) { +- this.unexpectedPacket(var1); +- } +- +- public void handleOpenWindow(Packet100OpenWindow var1) { +- this.unexpectedPacket(var1); +- } +- +- public void handleCloseWindow(Packet101CloseWindow var1) { +- this.unexpectedPacket(var1); +- } +- +- public void handleWindowClick(Packet102WindowClick var1) { +- this.unexpectedPacket(var1); +- } +- +- public void handleSetSlot(Packet103SetSlot var1) { +- this.unexpectedPacket(var1); +- } +- +- public void handleWindowItems(Packet104WindowItems var1) { +- this.unexpectedPacket(var1); +- } +- +- public void handleUpdateSign(Packet130UpdateSign var1) { +- this.unexpectedPacket(var1); +- } +- +- public void handleUpdateProgressbar(Packet105UpdateProgressbar var1) { +- this.unexpectedPacket(var1); +- } +- +- public void handlePlayerInventory(Packet5PlayerInventory var1) { +- this.unexpectedPacket(var1); +- } +- +- public void handleTransaction(Packet106Transaction var1) { +- this.unexpectedPacket(var1); +- } +- +- public void handleEntityPainting(Packet25EntityPainting var1) { +- this.unexpectedPacket(var1); +- } +- +- public void handleBlockEvent(Packet54PlayNoteBlock var1) { +- this.unexpectedPacket(var1); +- } +- +- public void handleStatistic(Packet200Statistic var1) { +- this.unexpectedPacket(var1); +- } +- +- public void handleSleep(Packet17Sleep var1) { +- this.unexpectedPacket(var1); +- } +- +- public void func_110774_a(Packet27PlayerInput var1) { +- this.unexpectedPacket(var1); +- } +- +- public void handleGameEvent(Packet70GameEvent var1) { +- this.unexpectedPacket(var1); +- } +- +- public void handleWeather(Packet71Weather var1) { +- this.unexpectedPacket(var1); +- } +- +- public void handleMapData(Packet131MapData var1) { +- this.unexpectedPacket(var1); +- } +- +- public void handleDoorChange(Packet61DoorChange var1) { +- this.unexpectedPacket(var1); +- } +- +- public void handleServerPing(Packet254ServerPing var1) { +- this.unexpectedPacket(var1); +- } +- +- public void handleEntityEffect(Packet41EntityEffect var1) { +- this.unexpectedPacket(var1); +- } +- +- public void handleRemoveEntityEffect(Packet42RemoveEntityEffect var1) { +- this.unexpectedPacket(var1); +- } +- +- public void handlePlayerInfo(Packet201PlayerInfo var1) { +- this.unexpectedPacket(var1); +- } +- +- public void handleKeepAlive(Packet0KeepAlive var1) { +- this.unexpectedPacket(var1); +- } +- +- public void handleExperience(Packet43Experience var1) { +- this.unexpectedPacket(var1); +- } +- +- public void handleCreativeSetSlot(Packet107CreativeSetSlot var1) { +- this.unexpectedPacket(var1); +- } +- +- public void handleEntityExpOrb(Packet26EntityExpOrb var1) { +- this.unexpectedPacket(var1); +- } +- +- public void handleEnchantItem(Packet108EnchantItem var1) { +- } +- +- public void handleCustomPayload(Packet250CustomPayload var1) { +- } +- +- public void handleEntityHeadRotation(Packet35EntityHeadRotation var1) { +- this.unexpectedPacket(var1); +- } +- +- public void handleTileEntityData(Packet132TileEntityData var1) { +- this.unexpectedPacket(var1); +- } +- +- public void handlePlayerAbilities(Packet202PlayerAbilities var1) { +- this.unexpectedPacket(var1); +- } +- +- public void handleAutoComplete(Packet203AutoComplete var1) { +- this.unexpectedPacket(var1); +- } +- +- public void handleClientInfo(Packet204ClientInfo var1) { +- this.unexpectedPacket(var1); +- } +- +- public void handleLevelSound(Packet62LevelSound var1) { +- this.unexpectedPacket(var1); +- } +- +- public void handleBlockDestroy(Packet55BlockDestroy var1) { +- this.unexpectedPacket(var1); +- } +- +- public void handleClientCommand(Packet205ClientCommand var1) { +- } +- +- public void handleMapChunks(Packet56MapChunks var1) { +- this.unexpectedPacket(var1); +- } +- ++ /** ++ * Handle Packet51MapChunk (full chunk update of blocks, metadata, light levels, and optionally biome data) ++ */ ++ public void handleMapChunk(Packet51MapChunk par1Packet51MapChunk) {} ++ ++ /** ++ * Default handler called for packets that don't have their own handlers in NetClientHandler; currentlly does nothing. ++ */ ++ public void unexpectedPacket(Packet par1Packet) {} ++ ++ public void handleErrorMessage(String par1Str, Object[] par2ArrayOfObj) {} ++ ++ public void handleKickDisconnect(Packet255KickDisconnect par1Packet255KickDisconnect) { ++ this.unexpectedPacket(par1Packet255KickDisconnect); ++ } ++ ++ public void handleLogin(Packet1Login par1Packet1Login) { ++ this.unexpectedPacket(par1Packet1Login); ++ } ++ ++ public void handleFlying(Packet10Flying par1Packet10Flying) { ++ this.unexpectedPacket(par1Packet10Flying); ++ } ++ ++ public void handleMultiBlockChange(Packet52MultiBlockChange par1Packet52MultiBlockChange) { ++ this.unexpectedPacket(par1Packet52MultiBlockChange); ++ } ++ ++ public void handleBlockDig(Packet14BlockDig par1Packet14BlockDig) { ++ this.unexpectedPacket(par1Packet14BlockDig); ++ } ++ ++ public void handleBlockChange(Packet53BlockChange par1Packet53BlockChange) { ++ this.unexpectedPacket(par1Packet53BlockChange); ++ } ++ ++ public void handleNamedEntitySpawn(Packet20NamedEntitySpawn par1Packet20NamedEntitySpawn) { ++ this.unexpectedPacket(par1Packet20NamedEntitySpawn); ++ } ++ ++ public void handleEntity(Packet30Entity par1Packet30Entity) { ++ this.unexpectedPacket(par1Packet30Entity); ++ } ++ ++ public void handleEntityTeleport(Packet34EntityTeleport par1Packet34EntityTeleport) { ++ this.unexpectedPacket(par1Packet34EntityTeleport); ++ } ++ ++ public void handlePlace(Packet15Place par1Packet15Place) { ++ this.unexpectedPacket(par1Packet15Place); ++ } ++ ++ public void handleBlockItemSwitch(Packet16BlockItemSwitch par1Packet16BlockItemSwitch) { ++ this.unexpectedPacket(par1Packet16BlockItemSwitch); ++ } ++ ++ public void handleDestroyEntity(Packet29DestroyEntity par1Packet29DestroyEntity) { ++ this.unexpectedPacket(par1Packet29DestroyEntity); ++ } ++ ++ public void handleCollect(Packet22Collect par1Packet22Collect) { ++ this.unexpectedPacket(par1Packet22Collect); ++ } ++ ++ public void handleChat(Packet3Chat par1Packet3Chat) { ++ this.unexpectedPacket(par1Packet3Chat); ++ } ++ ++ public void handleVehicleSpawn(Packet23VehicleSpawn par1Packet23VehicleSpawn) { ++ this.unexpectedPacket(par1Packet23VehicleSpawn); ++ } ++ ++ public void handleAnimation(Packet18Animation par1Packet18Animation) { ++ this.unexpectedPacket(par1Packet18Animation); ++ } ++ ++ /** ++ * runs registerPacket on the given Packet19EntityAction ++ */ ++ public void handleEntityAction(Packet19EntityAction par1Packet19EntityAction) { ++ this.unexpectedPacket(par1Packet19EntityAction); ++ } ++ ++ public void handleClientProtocol(Packet2ClientProtocol par1Packet2ClientProtocol) { ++ this.unexpectedPacket(par1Packet2ClientProtocol); ++ } ++ ++ public void handleServerAuthData(Packet253ServerAuthData par1Packet253ServerAuthData) { ++ this.unexpectedPacket(par1Packet253ServerAuthData); ++ } ++ ++ public void handleSharedKey(Packet252SharedKey par1Packet252SharedKey) { ++ this.unexpectedPacket(par1Packet252SharedKey); ++ } ++ ++ public void handleMobSpawn(Packet24MobSpawn par1Packet24MobSpawn) { ++ this.unexpectedPacket(par1Packet24MobSpawn); ++ } ++ ++ public void handleUpdateTime(Packet4UpdateTime par1Packet4UpdateTime) { ++ this.unexpectedPacket(par1Packet4UpdateTime); ++ } ++ ++ public void handleSpawnPosition(Packet6SpawnPosition par1Packet6SpawnPosition) { ++ this.unexpectedPacket(par1Packet6SpawnPosition); ++ } ++ ++ /** ++ * Packet handler ++ */ ++ public void handleEntityVelocity(Packet28EntityVelocity par1Packet28EntityVelocity) { ++ this.unexpectedPacket(par1Packet28EntityVelocity); ++ } ++ ++ /** ++ * Packet handler ++ */ ++ public void handleEntityMetadata(Packet40EntityMetadata par1Packet40EntityMetadata) { ++ this.unexpectedPacket(par1Packet40EntityMetadata); ++ } ++ ++ /** ++ * Packet handler ++ */ ++ public void handleAttachEntity(Packet39AttachEntity par1Packet39AttachEntity) { ++ this.unexpectedPacket(par1Packet39AttachEntity); ++ } ++ ++ public void handleUseEntity(Packet7UseEntity par1Packet7UseEntity) { ++ this.unexpectedPacket(par1Packet7UseEntity); ++ } ++ ++ /** ++ * Packet handler ++ */ ++ public void handleEntityStatus(Packet38EntityStatus par1Packet38EntityStatus) { ++ this.unexpectedPacket(par1Packet38EntityStatus); ++ } ++ ++ /** ++ * Recieves player health from the server and then proceeds to set it locally on the client. ++ */ ++ public void handleUpdateHealth(Packet8UpdateHealth par1Packet8UpdateHealth) { ++ this.unexpectedPacket(par1Packet8UpdateHealth); ++ } ++ ++ /** ++ * respawns the player ++ */ ++ public void handleRespawn(Packet9Respawn par1Packet9Respawn) { ++ this.unexpectedPacket(par1Packet9Respawn); ++ } ++ ++ public void handleExplosion(Packet60Explosion par1Packet60Explosion) { ++ this.unexpectedPacket(par1Packet60Explosion); ++ } ++ ++ public void handleOpenWindow(Packet100OpenWindow par1Packet100OpenWindow) { ++ this.unexpectedPacket(par1Packet100OpenWindow); ++ } ++ ++ public void handleCloseWindow(Packet101CloseWindow par1Packet101CloseWindow) { ++ this.unexpectedPacket(par1Packet101CloseWindow); ++ } ++ ++ public void handleWindowClick(Packet102WindowClick par1Packet102WindowClick) { ++ this.unexpectedPacket(par1Packet102WindowClick); ++ } ++ ++ public void handleSetSlot(Packet103SetSlot par1Packet103SetSlot) { ++ this.unexpectedPacket(par1Packet103SetSlot); ++ } ++ ++ public void handleWindowItems(Packet104WindowItems par1Packet104WindowItems) { ++ this.unexpectedPacket(par1Packet104WindowItems); ++ } ++ ++ /** ++ * Updates Client side signs ++ */ ++ public void handleUpdateSign(Packet130UpdateSign par1Packet130UpdateSign) { ++ this.unexpectedPacket(par1Packet130UpdateSign); ++ } ++ ++ public void handleUpdateProgressbar(Packet105UpdateProgressbar par1Packet105UpdateProgressbar) { ++ this.unexpectedPacket(par1Packet105UpdateProgressbar); ++ } ++ ++ public void handlePlayerInventory(Packet5PlayerInventory par1Packet5PlayerInventory) { ++ this.unexpectedPacket(par1Packet5PlayerInventory); ++ } ++ ++ public void handleTransaction(Packet106Transaction par1Packet106Transaction) { ++ this.unexpectedPacket(par1Packet106Transaction); ++ } ++ ++ /** ++ * Packet handler ++ */ ++ public void handleEntityPainting(Packet25EntityPainting par1Packet25EntityPainting) { ++ this.unexpectedPacket(par1Packet25EntityPainting); ++ } ++ ++ public void handleBlockEvent(Packet54PlayNoteBlock par1Packet54PlayNoteBlock) { ++ this.unexpectedPacket(par1Packet54PlayNoteBlock); ++ } ++ ++ /** ++ * Increment player statistics ++ */ ++ public void handleStatistic(Packet200Statistic par1Packet200Statistic) { ++ this.unexpectedPacket(par1Packet200Statistic); ++ } ++ ++ public void handleSleep(Packet17Sleep par1Packet17Sleep) { ++ this.unexpectedPacket(par1Packet17Sleep); ++ } ++ ++ public void func_110774_a(Packet27PlayerInput par1Packet27PlayerInput) { ++ this.unexpectedPacket(par1Packet27PlayerInput); ++ } ++ ++ public void handleGameEvent(Packet70GameEvent par1Packet70GameEvent) { ++ this.unexpectedPacket(par1Packet70GameEvent); ++ } ++ ++ /** ++ * Handles weather packet ++ */ ++ public void handleWeather(Packet71Weather par1Packet71Weather) { ++ this.unexpectedPacket(par1Packet71Weather); ++ } ++ ++ /** ++ * Contains logic for handling packets containing arbitrary unique item data. Currently this is only for maps. ++ */ ++ public void handleMapData(Packet131MapData par1Packet131MapData) { ++ this.unexpectedPacket(par1Packet131MapData); ++ } ++ ++ public void handleDoorChange(Packet61DoorChange par1Packet61DoorChange) { ++ this.unexpectedPacket(par1Packet61DoorChange); ++ } ++ ++ /** ++ * Handle a server ping packet. ++ */ ++ public void handleServerPing(Packet254ServerPing par1Packet254ServerPing) { ++ this.unexpectedPacket(par1Packet254ServerPing); ++ } ++ ++ /** ++ * Handle an entity effect packet. ++ */ ++ public void handleEntityEffect(Packet41EntityEffect par1Packet41EntityEffect) { ++ this.unexpectedPacket(par1Packet41EntityEffect); ++ } ++ ++ /** ++ * Handle a remove entity effect packet. ++ */ ++ public void handleRemoveEntityEffect(Packet42RemoveEntityEffect par1Packet42RemoveEntityEffect) { ++ this.unexpectedPacket(par1Packet42RemoveEntityEffect); ++ } ++ ++ /** ++ * Handle a player information packet. ++ */ ++ public void handlePlayerInfo(Packet201PlayerInfo par1Packet201PlayerInfo) { ++ this.unexpectedPacket(par1Packet201PlayerInfo); ++ } ++ ++ /** ++ * Handle a keep alive packet. ++ */ ++ public void handleKeepAlive(Packet0KeepAlive par1Packet0KeepAlive) { ++ this.unexpectedPacket(par1Packet0KeepAlive); ++ } ++ ++ /** ++ * Handle an experience packet. ++ */ ++ public void handleExperience(Packet43Experience par1Packet43Experience) { ++ this.unexpectedPacket(par1Packet43Experience); ++ } ++ ++ /** ++ * Handle a creative slot packet. ++ */ ++ public void handleCreativeSetSlot(Packet107CreativeSetSlot par1Packet107CreativeSetSlot) { ++ this.unexpectedPacket(par1Packet107CreativeSetSlot); ++ } ++ ++ /** ++ * Handle a entity experience orb packet. ++ */ ++ public void handleEntityExpOrb(Packet26EntityExpOrb par1Packet26EntityExpOrb) { ++ this.unexpectedPacket(par1Packet26EntityExpOrb); ++ } ++ ++ public void handleEnchantItem(Packet108EnchantItem par1Packet108EnchantItem) {} ++ ++ public void handleCustomPayload(Packet250CustomPayload par1Packet250CustomPayload) {} ++ ++ public void handleEntityHeadRotation(Packet35EntityHeadRotation par1Packet35EntityHeadRotation) { ++ this.unexpectedPacket(par1Packet35EntityHeadRotation); ++ } ++ ++ public void handleTileEntityData(Packet132TileEntityData par1Packet132TileEntityData) { ++ this.unexpectedPacket(par1Packet132TileEntityData); ++ } ++ ++ /** ++ * Handle a player abilities packet. ++ */ ++ public void handlePlayerAbilities(Packet202PlayerAbilities par1Packet202PlayerAbilities) { ++ this.unexpectedPacket(par1Packet202PlayerAbilities); ++ } ++ ++ public void handleAutoComplete(Packet203AutoComplete par1Packet203AutoComplete) { ++ this.unexpectedPacket(par1Packet203AutoComplete); ++ } ++ ++ public void handleClientInfo(Packet204ClientInfo par1Packet204ClientInfo) { ++ this.unexpectedPacket(par1Packet204ClientInfo); ++ } ++ ++ public void handleLevelSound(Packet62LevelSound par1Packet62LevelSound) { ++ this.unexpectedPacket(par1Packet62LevelSound); ++ } ++ ++ public void handleBlockDestroy(Packet55BlockDestroy par1Packet55BlockDestroy) { ++ this.unexpectedPacket(par1Packet55BlockDestroy); ++ } ++ ++ public void handleClientCommand(Packet205ClientCommand par1Packet205ClientCommand) {} ++ ++ public void handleMapChunks(Packet56MapChunks par1Packet56MapChunks) { ++ this.unexpectedPacket(par1Packet56MapChunks); ++ } ++ ++ /** ++ * If this returns false, all packets will be queued for the main thread to handle, even if they would otherwise be ++ * processed asynchronously. Used to avoid processing packets on the client before the world has been downloaded (which ++ * happens on the main thread) ++ */ + public boolean canProcessPacketsAsync() { + return false; + } + +- public void handleSetObjective(Packet206SetObjective var1) { +- this.unexpectedPacket(var1); +- } +- +- public void handleSetScore(Packet207SetScore var1) { +- this.unexpectedPacket(var1); +- } +- +- public void handleSetDisplayObjective(Packet208SetDisplayObjective var1) { +- this.unexpectedPacket(var1); +- } +- +- public void handleSetPlayerTeam(Packet209SetPlayerTeam var1) { +- this.unexpectedPacket(var1); +- } +- +- public void handleWorldParticles(Packet63WorldParticles var1) { +- this.unexpectedPacket(var1); +- } +- +- public void func_110773_a(Packet44UpdateAttributes var1) { +- this.unexpectedPacket(var1); +- } +- +- public void func_142031_a(Packet133TileEditorOpen var1) { +- } ++ /** ++ * Handle a set objective packet. ++ */ ++ public void handleSetObjective(Packet206SetObjective par1Packet206SetObjective) { ++ this.unexpectedPacket(par1Packet206SetObjective); ++ } ++ ++ /** ++ * Handle a set score packet. ++ */ ++ public void handleSetScore(Packet207SetScore par1Packet207SetScore) { ++ this.unexpectedPacket(par1Packet207SetScore); ++ } ++ ++ /** ++ * Handle a set display objective packet. ++ */ ++ public void handleSetDisplayObjective(Packet208SetDisplayObjective par1Packet208SetDisplayObjective) { ++ this.unexpectedPacket(par1Packet208SetDisplayObjective); ++ } ++ ++ /** ++ * Handle a set player team packet. ++ */ ++ public void handleSetPlayerTeam(Packet209SetPlayerTeam par1Packet209SetPlayerTeam) { ++ this.unexpectedPacket(par1Packet209SetPlayerTeam); ++ } ++ ++ /** ++ * Handle a world particles packet. ++ */ ++ public void handleWorldParticles(Packet63WorldParticles par1Packet63WorldParticles) { ++ this.unexpectedPacket(par1Packet63WorldParticles); ++ } ++ ++ public void func_110773_a(Packet44UpdateAttributes par1Packet44UpdateAttributes) { ++ this.unexpectedPacket(par1Packet44UpdateAttributes); ++ } ++ ++ public void func_142031_a(Packet133TileEditorOpen par1Packet133TileEditorOpen) {} + + public boolean isConnectionClosed() { + return false; diff --git a/patches/net/minecraft/src/NetLoginHandler.java.patch b/patches/net/minecraft/src/NetLoginHandler.java.patch new file mode 100644 index 0000000..495209e --- /dev/null +++ b/patches/net/minecraft/src/NetLoginHandler.java.patch @@ -0,0 +1,348 @@ +--- net/minecraft/src/NetLoginHandler.java ++++ net/minecraft/src/NetLoginHandler.java +@@ -1,5 +1,6 @@ + package net.minecraft.src; + ++import java.io.IOException; + import java.io.Serializable; + import java.net.InetAddress; + import java.net.Socket; +@@ -13,137 +14,160 @@ + import net.minecraft.server.MinecraftServer; + + public class NetLoginHandler extends NetHandler { +- private static Random c = new Random(); ++ ++ /** The Random object used to generate serverId hex strings. */ ++ private static Random rand = new Random(); ++ ++ /** The 4 byte verify token read from a Packet252SharedKey */ + private byte[] verifyToken; +- private final MinecraftServer e; ++ ++ /** Reference to the MinecraftServer object. */ ++ private final MinecraftServer mcServer; + public final TcpConnection myTCPConnection; +- public boolean finishedProcessing; +- private int loginTimer; +- private String g; ++ public boolean connectionComplete; ++ private int connectionTimer; ++ private String clientUsername; + private volatile boolean field_72544_i; +- private String i = ""; ++ ++ /** server ID that is randomly generated by this login handler. */ ++ private String loginServerId = ""; + private boolean field_92079_k; +- private SecretKey k; +- +- public NetLoginHandler(MinecraftServer var1, Socket var2, String var3) { +- this.e = var1; +- this.myTCPConnection = new TcpConnection(var1.getLogAgent(), var2, var3, this, var1.getKeyPair().getPrivate()); ++ ++ /** Secret AES key obtained from the client's Packet252SharedKey */ ++ private SecretKey sharedKey; ++ ++ public NetLoginHandler(MinecraftServer par1MinecraftServer, Socket par2Socket, String par3Str) throws IOException { ++ this.mcServer = par1MinecraftServer; ++ this.myTCPConnection = new TcpConnection(par1MinecraftServer.getLogAgent(), par2Socket, par3Str, this, par1MinecraftServer.getKeyPair().getPrivate()); + this.myTCPConnection.field_74468_e = 0; + } + ++ /** ++ * Logs the user in if a login packet is found, otherwise keeps processing network packets unless the timeout has ++ * occurred. ++ */ + public void tryLogin() { +- if(this.field_72544_i) { ++ if (this.field_72544_i) { + this.initializePlayerConnection(); + } + +- if(this.loginTimer++ == 600) { +- this.kickUser("Took too long to log in"); ++ if (this.connectionTimer++ == 600) { ++ this.raiseErrorAndDisconnect("Took too long to log in"); + } else { + this.myTCPConnection.processReadPackets(); + } +- + } + +- public void kickUser(String var1) { ++ public void raiseErrorAndDisconnect(String par1Str) { + try { +- this.e.getLogAgent().logInfo("Disconnecting " + this.getUsernameAndAddress() + ": " + var1); +- this.myTCPConnection.addToSendQueue(new Packet255KickDisconnect(var1)); ++ this.mcServer.getLogAgent().logInfo("Disconnecting " + this.getUsernameAndAddress() + ": " + par1Str); ++ this.myTCPConnection.addToSendQueue(new Packet255KickDisconnect(par1Str)); + this.myTCPConnection.serverShutdown(); +- this.finishedProcessing = true; ++ this.connectionComplete = true; + } catch (Exception var3) { + var3.printStackTrace(); + } +- + } + +- public void handleClientProtocol(Packet2ClientProtocol var1) { +- if(this.g != null) { +- this.kickUser("Quit repeating yourself!"); ++ public void handleClientProtocol(Packet2ClientProtocol par1Packet2ClientProtocol) { ++ if (this.clientUsername != null) { ++ this.raiseErrorAndDisconnect("Quit repeating yourself!"); + } else { +- this.g = var1.getUsername(); +- if(!this.g.equals(StringUtils.stripControlCodes(this.g))) { +- this.kickUser("Invalid username!"); ++ this.clientUsername = par1Packet2ClientProtocol.getUsername(); ++ ++ if (!this.clientUsername.equals(StringUtils.stripControlCodes(this.clientUsername))) { ++ this.raiseErrorAndDisconnect("Invalid username!"); + } else { +- PublicKey var2 = this.e.getKeyPair().getPublic(); +- if(var1.getProtocolVersion() != 78) { +- if(var1.getProtocolVersion() > 78) { +- this.kickUser("Outdated server!"); ++ PublicKey var2 = this.mcServer.getKeyPair().getPublic(); ++ ++ if (par1Packet2ClientProtocol.getProtocolVersion() != 78) { ++ if (par1Packet2ClientProtocol.getProtocolVersion() > 78) { ++ this.raiseErrorAndDisconnect("Outdated server!"); + } else { +- this.kickUser("Outdated client!"); ++ this.raiseErrorAndDisconnect("Outdated client!"); + } +- + } else { +- this.i = this.e.isServerInOnlineMode() ? Long.toString(c.nextLong(), 16) : "-"; ++ this.loginServerId = this.mcServer.isServerInOnlineMode() ? Long.toString(rand.nextLong(), 16) : "-"; + this.verifyToken = new byte[4]; +- c.nextBytes(this.verifyToken); +- this.myTCPConnection.addToSendQueue(new Packet253ServerAuthData(this.i, var2, this.verifyToken)); ++ rand.nextBytes(this.verifyToken); ++ this.myTCPConnection.addToSendQueue(new Packet253ServerAuthData(this.loginServerId, var2, this.verifyToken)); + } + } + } + } + +- public void handleSharedKey(Packet252SharedKey var1) { +- PrivateKey var2 = this.e.getKeyPair().getPrivate(); +- this.k = var1.getSharedKey(var2); +- if(!Arrays.equals(this.verifyToken, var1.getVerifyToken(var2))) { +- this.kickUser("Invalid client reply"); ++ public void handleSharedKey(Packet252SharedKey par1Packet252SharedKey) { ++ PrivateKey var2 = this.mcServer.getKeyPair().getPrivate(); ++ this.sharedKey = par1Packet252SharedKey.getSharedKey(var2); ++ ++ if (!Arrays.equals(this.verifyToken, par1Packet252SharedKey.getVerifyToken(var2))) { ++ this.raiseErrorAndDisconnect("Invalid client reply"); + } + + this.myTCPConnection.addToSendQueue(new Packet252SharedKey()); + } + +- public void handleClientCommand(Packet205ClientCommand var1) { +- if(var1.forceRespawn == 0) { +- if(this.field_92079_k) { +- this.kickUser("Duplicate login"); ++ public void handleClientCommand(Packet205ClientCommand par1Packet205ClientCommand) { ++ if (par1Packet205ClientCommand.forceRespawn == 0) { ++ if (this.field_92079_k) { ++ this.raiseErrorAndDisconnect("Duplicate login"); + return; + } + + this.field_92079_k = true; +- if(this.e.isServerInOnlineMode()) { ++ ++ if (this.mcServer.isServerInOnlineMode()) { + (new ThreadLoginVerifier(this)).start(); + } else { + this.field_72544_i = true; + } + } +- +- } +- +- public void handleLogin(Packet1Login var1) { +- } +- ++ } ++ ++ public void handleLogin(Packet1Login par1Packet1Login) {} ++ ++ /** ++ * on success the specified username is connected to the minecraftInstance, otherwise they are packet255'd ++ */ + public void initializePlayerConnection() { +- String var1 = this.e.getConfigurationManager().allowUserToConnect(this.myTCPConnection.getRemoteAddress(), this.g); +- if(var1 != null) { +- this.kickUser(var1); ++ String var1 = this.mcServer.getConfigurationManager().allowUserToConnect(this.myTCPConnection.getSocketAddress(), this.clientUsername); ++ ++ if (var1 != null) { ++ this.raiseErrorAndDisconnect(var1); + } else { +- EntityPlayerMP var2 = this.e.getConfigurationManager().createPlayerForUser(this.g); +- if(var2 != null) { +- this.e.getConfigurationManager().initializeConnectionToPlayer(this.myTCPConnection, var2); ++ EntityPlayerMP var2 = this.mcServer.getConfigurationManager().createPlayerForUser(this.clientUsername); ++ ++ if (var2 != null) { ++ this.mcServer.getConfigurationManager().initializeConnectionToPlayer(this.myTCPConnection, var2); + } + } + +- this.finishedProcessing = true; +- } +- +- public void handleErrorMessage(String var1, Object[] var2) { +- this.e.getLogAgent().logInfo(this.getUsernameAndAddress() + " lost connection"); +- this.finishedProcessing = true; +- } +- +- public void handleServerPing(Packet254ServerPing var1) { ++ this.connectionComplete = true; ++ } ++ ++ public void handleErrorMessage(String par1Str, Object[] par2ArrayOfObj) { ++ this.mcServer.getLogAgent().logInfo(this.getUsernameAndAddress() + " lost connection"); ++ this.connectionComplete = true; ++ } ++ ++ /** ++ * Handle a server ping packet. ++ */ ++ public void handleServerPing(Packet254ServerPing par1Packet254ServerPing) { + try { +- ServerConfigurationManager var2 = this.e.getConfigurationManager(); ++ ServerConfigurationManager var2 = this.mcServer.getConfigurationManager(); + String var3 = null; +- if(var1.func_140050_d()) { +- var3 = this.e.getMOTD() + "\u00a7" + var2.getCurrentPlayerCount() + "\u00a7" + var2.getMaxPlayers(); +- } else { +- List var4 = Arrays.asList(new Serializable[]{Integer.valueOf(1), Integer.valueOf(78), this.e.getMinecraftVersion(), this.e.getMOTD(), Integer.valueOf(var2.getCurrentPlayerCount()), Integer.valueOf(var2.getMaxPlayers())}); + ++ if (par1Packet254ServerPing.func_140050_d()) { ++ var3 = this.mcServer.getMOTD() + "\u00a7" + var2.getCurrentPlayerCount() + "\u00a7" + var2.getMaxPlayers(); ++ } else { ++ List var4 = Arrays.asList(new Serializable[] {Integer.valueOf(1), Integer.valueOf(78), this.mcServer.getMinecraftVersion(), this.mcServer.getMOTD(), Integer.valueOf(var2.getCurrentPlayerCount()), Integer.valueOf(var2.getMaxPlayers())}); + Object var6; +- for(Iterator var5 = var4.iterator(); var5.hasNext(); var3 = var3 + var6.toString().replaceAll("\u0000", "")) { ++ ++ for (Iterator var5 = var4.iterator(); var5.hasNext(); var3 = var3 + var6.toString().replaceAll("\u0000", "")) { + var6 = var5.next(); +- if(var3 == null) { ++ ++ if (var3 == null) { + var3 = "\u00a7"; + } else { + var3 = var3 + "\u0000"; +@@ -152,56 +176,75 @@ + } + + InetAddress var8 = null; +- if(this.myTCPConnection.getSocket() != null) { ++ ++ if (this.myTCPConnection.getSocket() != null) { + var8 = this.myTCPConnection.getSocket().getInetAddress(); + } + + this.myTCPConnection.addToSendQueue(new Packet255KickDisconnect(var3)); + this.myTCPConnection.serverShutdown(); +- if(var8 != null && this.e.getNetworkThread() instanceof DedicatedServerListenThread) { +- ((DedicatedServerListenThread)this.e.getNetworkThread()).func_71761_a(var8); ++ ++ if (var8 != null && this.mcServer.getNetworkThread() instanceof DedicatedServerListenThread) { ++ ((DedicatedServerListenThread)this.mcServer.getNetworkThread()).func_71761_a(var8); + } + +- this.finishedProcessing = true; ++ this.connectionComplete = true; + } catch (Exception var7) { + var7.printStackTrace(); + } +- + } + +- public void unexpectedPacket(Packet var1) { +- this.kickUser("Protocol error"); ++ /** ++ * Default handler called for packets that don't have their own handlers in NetClientHandler; currentlly does nothing. ++ */ ++ public void unexpectedPacket(Packet par1Packet) { ++ this.raiseErrorAndDisconnect("Protocol error"); + } + + public String getUsernameAndAddress() { +- return this.g != null ? this.g + " [" + this.myTCPConnection.getRemoteAddress().toString() + "]" : this.myTCPConnection.getRemoteAddress().toString(); ++ return this.clientUsername != null ? this.clientUsername + " [" + this.myTCPConnection.getSocketAddress().toString() + "]" : this.myTCPConnection.getSocketAddress().toString(); + } + ++ /** ++ * determine if it is a server handler ++ */ + public boolean isServerHandler() { + return true; + } + + public boolean isConnectionClosed() { +- return this.finishedProcessing; +- } +- +- static String getServerId(NetLoginHandler var0) { +- return var0.i; +- } +- +- static MinecraftServer getLoginMinecraftServer(NetLoginHandler var0) { +- return var0.e; +- } +- +- static SecretKey getSharedKey(NetLoginHandler var0) { +- return var0.k; +- } +- +- static String getClientUsername(NetLoginHandler var0) { +- return var0.g; +- } +- +- static boolean func_72531_a(NetLoginHandler var0, boolean var1) { +- return var0.field_72544_i = var1; ++ return this.connectionComplete; ++ } ++ ++ /** ++ * Returns the server Id randomly generated by this login handler. ++ */ ++ static String getServerId(NetLoginHandler par0NetLoginHandler) { ++ return par0NetLoginHandler.loginServerId; ++ } ++ ++ /** ++ * Returns the reference to Minecraft Server. ++ */ ++ static MinecraftServer getLoginMinecraftServer(NetLoginHandler par0NetLoginHandler) { ++ return par0NetLoginHandler.mcServer; ++ } ++ ++ /** ++ * Return the secret AES sharedKey ++ */ ++ static SecretKey getSharedKey(NetLoginHandler par0NetLoginHandler) { ++ return par0NetLoginHandler.sharedKey; ++ } ++ ++ /** ++ * Returns the connecting client username. ++ */ ++ static String getClientUsername(NetLoginHandler par0NetLoginHandler) { ++ return par0NetLoginHandler.clientUsername; ++ } ++ ++ static boolean func_72531_a(NetLoginHandler par0NetLoginHandler, boolean par1) { ++ return par0NetLoginHandler.field_72544_i = par1; + } + } diff --git a/patches/net/minecraft/src/NetServerHandler.java.patch b/patches/net/minecraft/src/NetServerHandler.java.patch new file mode 100644 index 0000000..60bcdf2 --- /dev/null +++ b/patches/net/minecraft/src/NetServerHandler.java.patch @@ -0,0 +1,1268 @@ +--- net/minecraft/src/NetServerHandler.java ++++ net/minecraft/src/NetServerHandler.java +@@ -9,111 +9,144 @@ + import net.minecraft.server.MinecraftServer; + + public class NetServerHandler extends NetHandler { ++ ++ /** The underlying network manager for this server handler. */ + public final INetworkManager netManager; +- private final MinecraftServer d; ++ ++ /** Reference to the MinecraftServer object. */ ++ private final MinecraftServer mcServer; ++ ++ /** This is set to true whenever a player disconnects from the server. */ + public boolean connectionClosed; ++ ++ /** Reference to the EntityPlayerMP object. */ + public EntityPlayerMP playerEntity; ++ ++ /** incremented each tick */ + private int currentTicks; +- private int playerInAirTime; ++ ++ /** ++ * player is kicked if they float for over 80 ticks without flying enabled ++ */ ++ private int ticksForFloatKick; + private boolean field_72584_h; + private int keepAliveRandomID; + private long keepAliveTimeSent; +- private static Random j = new Random(); ++ private static Random randomGenerator = new Random(); + private long ticksOfLastKeepAlive; + private int chatSpamThresholdCount; + private int creativeItemCreationSpamThresholdTally; ++ ++ /** The last known x position for this connection. */ + private double lastPosX; ++ ++ /** The last known y position for this connection. */ + private double lastPosY; ++ ++ /** The last known z position for this connection. */ + private double lastPosZ; ++ ++ /** is true when the player has moved since his last movement packet */ + private boolean hasMoved = true; + private IntHashMap field_72586_s = new IntHashMap(); + +- public NetServerHandler(MinecraftServer var1, INetworkManager var2, EntityPlayerMP var3) { +- this.d = var1; +- this.netManager = var2; +- var2.setNetHandler(this); +- this.playerEntity = var3; +- var3.playerNetServerHandler = this; ++ public NetServerHandler(MinecraftServer par1MinecraftServer, INetworkManager par2INetworkManager, EntityPlayerMP par3EntityPlayerMP) { ++ this.mcServer = par1MinecraftServer; ++ this.netManager = par2INetworkManager; ++ par2INetworkManager.setNetHandler(this); ++ this.playerEntity = par3EntityPlayerMP; ++ par3EntityPlayerMP.playerNetServerHandler = this; + } + +- public void handlePackets() { ++ /** ++ * run once each game tick ++ */ ++ public void networkTick() { + this.field_72584_h = false; + ++this.currentTicks; +- this.d.theProfiler.startSection("packetflow"); ++ this.mcServer.theProfiler.startSection("packetflow"); + this.netManager.processReadPackets(); +- this.d.theProfiler.endStartSection("keepAlive"); +- if((long)this.currentTicks - this.ticksOfLastKeepAlive > 20L) { ++ this.mcServer.theProfiler.endStartSection("keepAlive"); ++ ++ if ((long)this.currentTicks - this.ticksOfLastKeepAlive > 20L) { + this.ticksOfLastKeepAlive = (long)this.currentTicks; + this.keepAliveTimeSent = System.nanoTime() / 1000000L; +- this.keepAliveRandomID = j.nextInt(); +- this.sendPacket(new Packet0KeepAlive(this.keepAliveRandomID)); ++ this.keepAliveRandomID = randomGenerator.nextInt(); ++ this.sendPacketToPlayer(new Packet0KeepAlive(this.keepAliveRandomID)); + } + +- if(this.chatSpamThresholdCount > 0) { ++ if (this.chatSpamThresholdCount > 0) { + --this.chatSpamThresholdCount; + } + +- if(this.creativeItemCreationSpamThresholdTally > 0) { ++ if (this.creativeItemCreationSpamThresholdTally > 0) { + --this.creativeItemCreationSpamThresholdTally; + } + +- this.d.theProfiler.endStartSection("playerTick"); +- this.d.theProfiler.endSection(); ++ this.mcServer.theProfiler.endStartSection("playerTick"); ++ this.mcServer.theProfiler.endSection(); + } + +- public void kickPlayer(String var1) { +- if(!this.connectionClosed) { ++ public void kickPlayerFromServer(String par1Str) { ++ if (!this.connectionClosed) { + this.playerEntity.mountEntityAndWakeUp(); +- this.sendPacket(new Packet255KickDisconnect(var1)); ++ this.sendPacketToPlayer(new Packet255KickDisconnect(par1Str)); + this.netManager.serverShutdown(); +- this.d.getConfigurationManager().sendChatMsg(ChatMessageComponent.createFromTranslationWithSubstitutions("multiplayer.player.left", new Object[]{this.playerEntity.getTranslatedEntityName()}).setColor(EnumChatFormatting.YELLOW)); +- this.d.getConfigurationManager().playerLoggedOut(this.playerEntity); ++ this.mcServer.getConfigurationManager().sendChatMsg(ChatMessageComponent.createFromTranslationWithSubstitutions("multiplayer.player.left", new Object[] {this.playerEntity.getTranslatedEntityName()}).setColor(EnumChatFormatting.YELLOW)); ++ this.mcServer.getConfigurationManager().playerLoggedOut(this.playerEntity); + this.connectionClosed = true; + } + } + +- public void func_110774_a(Packet27PlayerInput var1) { +- this.playerEntity.setEntityActionState(var1.func_111010_d(), var1.func_111012_f(), var1.func_111013_g(), var1.func_111011_h()); ++ public void func_110774_a(Packet27PlayerInput par1Packet27PlayerInput) { ++ this.playerEntity.setEntityActionState(par1Packet27PlayerInput.func_111010_d(), par1Packet27PlayerInput.func_111012_f(), par1Packet27PlayerInput.func_111013_g(), par1Packet27PlayerInput.func_111011_h()); + } + +- public void handleFlying(Packet10Flying var1) { +- WorldServer var2 = this.d.worldServerForDimension(this.playerEntity.dimension); ++ public void handleFlying(Packet10Flying par1Packet10Flying) { ++ WorldServer var2 = this.mcServer.worldServerForDimension(this.playerEntity.dimension); + this.field_72584_h = true; +- if(!this.playerEntity.playerConqueredTheEnd) { ++ ++ if (!this.playerEntity.playerConqueredTheEnd) { + double var3; +- if(!this.hasMoved) { +- var3 = var1.yPosition - this.lastPosY; +- if(var1.xPosition == this.lastPosX && var3 * var3 < 0.01D && var1.zPosition == this.lastPosZ) { ++ ++ if (!this.hasMoved) { ++ var3 = par1Packet10Flying.yPosition - this.lastPosY; ++ ++ if (par1Packet10Flying.xPosition == this.lastPosX && var3 * var3 < 0.01D && par1Packet10Flying.zPosition == this.lastPosZ) { + this.hasMoved = true; + } + } + +- if(this.hasMoved) { ++ if (this.hasMoved) { + double var5; + double var7; + double var9; +- if(this.playerEntity.ridingEntity != null) { ++ ++ if (this.playerEntity.ridingEntity != null) { + float var34 = this.playerEntity.rotationYaw; + float var4 = this.playerEntity.rotationPitch; + this.playerEntity.ridingEntity.updateRiderPosition(); + var5 = this.playerEntity.posX; + var7 = this.playerEntity.posY; + var9 = this.playerEntity.posZ; +- if(var1.rotating) { +- var34 = var1.yaw; +- var4 = var1.pitch; ++ ++ if (par1Packet10Flying.rotating) { ++ var34 = par1Packet10Flying.yaw; ++ var4 = par1Packet10Flying.pitch; + } + +- this.playerEntity.onGround = var1.onGround; ++ this.playerEntity.onGround = par1Packet10Flying.onGround; + this.playerEntity.onUpdateEntity(); + this.playerEntity.ySize = 0.0F; + this.playerEntity.setPositionAndRotation(var5, var7, var9, var34, var4); +- if(this.playerEntity.ridingEntity != null) { ++ ++ if (this.playerEntity.ridingEntity != null) { + this.playerEntity.ridingEntity.updateRiderPosition(); + } + +- this.d.getConfigurationManager().serverUpdateMountedMovingPlayer(this.playerEntity); +- if(this.hasMoved) { ++ this.mcServer.getConfigurationManager().serverUpdateMountedMovingPlayer(this.playerEntity); ++ ++ if (this.hasMoved) { + this.lastPosX = this.playerEntity.posX; + this.lastPosY = this.playerEntity.posY; + this.lastPosZ = this.playerEntity.posZ; +@@ -123,7 +156,7 @@ + return; + } + +- if(this.playerEntity.isPlayerSleeping()) { ++ if (this.playerEntity.isPlayerSleeping()) { + this.playerEntity.onUpdateEntity(); + this.playerEntity.setPositionAndRotation(this.lastPosX, this.lastPosY, this.lastPosZ, this.playerEntity.rotationYaw, this.playerEntity.rotationPitch); + var2.updateEntity(this.playerEntity); +@@ -139,37 +172,41 @@ + var9 = this.playerEntity.posZ; + float var11 = this.playerEntity.rotationYaw; + float var12 = this.playerEntity.rotationPitch; +- if(var1.moving && var1.yPosition == -999.0D && var1.stance == -999.0D) { +- var1.moving = false; ++ ++ if (par1Packet10Flying.moving && par1Packet10Flying.yPosition == -999.0D && par1Packet10Flying.stance == -999.0D) { ++ par1Packet10Flying.moving = false; + } + + double var13; +- if(var1.moving) { +- var5 = var1.xPosition; +- var7 = var1.yPosition; +- var9 = var1.zPosition; +- var13 = var1.stance - var1.yPosition; +- if(!this.playerEntity.isPlayerSleeping() && (var13 > 1.65D || var13 < 0.1D)) { +- this.kickPlayer("Illegal stance"); +- this.d.getLogAgent().logWarning(this.playerEntity.getCommandSenderName() + " had an illegal stance: " + var13); ++ ++ if (par1Packet10Flying.moving) { ++ var5 = par1Packet10Flying.xPosition; ++ var7 = par1Packet10Flying.yPosition; ++ var9 = par1Packet10Flying.zPosition; ++ var13 = par1Packet10Flying.stance - par1Packet10Flying.yPosition; ++ ++ if (!this.playerEntity.isPlayerSleeping() && (var13 > 1.65D || var13 < 0.1D)) { ++ this.kickPlayerFromServer("Illegal stance"); ++ this.mcServer.getLogAgent().logWarning(this.playerEntity.getCommandSenderName() + " had an illegal stance: " + var13); + return; + } + +- if(Math.abs(var1.xPosition) > 3.2E7D || Math.abs(var1.zPosition) > 3.2E7D) { +- this.kickPlayer("Illegal position"); ++ if (Math.abs(par1Packet10Flying.xPosition) > 3.2E7D || Math.abs(par1Packet10Flying.zPosition) > 3.2E7D) { ++ this.kickPlayerFromServer("Illegal position"); + return; + } + } + +- if(var1.rotating) { +- var11 = var1.yaw; +- var12 = var1.pitch; ++ if (par1Packet10Flying.rotating) { ++ var11 = par1Packet10Flying.yaw; ++ var12 = par1Packet10Flying.pitch; + } + + this.playerEntity.onUpdateEntity(); + this.playerEntity.ySize = 0.0F; + this.playerEntity.setPositionAndRotation(this.lastPosX, this.lastPosY, this.lastPosZ, var11, var12); +- if(!this.hasMoved) { ++ ++ if (!this.hasMoved) { + return; + } + +@@ -180,361 +217,397 @@ + double var21 = Math.min(Math.abs(var15), Math.abs(this.playerEntity.motionY)); + double var23 = Math.min(Math.abs(var17), Math.abs(this.playerEntity.motionZ)); + double var25 = var19 * var19 + var21 * var21 + var23 * var23; +- if(var25 > 100.0D && (!this.d.isSinglePlayer() || !this.d.getServerOwner().equals(this.playerEntity.getCommandSenderName()))) { +- this.d.getLogAgent().logWarning(this.playerEntity.getCommandSenderName() + " moved too quickly! " + var13 + "," + var15 + "," + var17 + " (" + var19 + ", " + var21 + ", " + var23 + ")"); ++ ++ if (var25 > 100.0D && (!this.mcServer.isSinglePlayer() || !this.mcServer.getServerOwner().equals(this.playerEntity.getCommandSenderName()))) { ++ this.mcServer.getLogAgent().logWarning(this.playerEntity.getCommandSenderName() + " moved too quickly! " + var13 + "," + var15 + "," + var17 + " (" + var19 + ", " + var21 + ", " + var23 + ")"); + this.setPlayerLocation(this.lastPosX, this.lastPosY, this.lastPosZ, this.playerEntity.rotationYaw, this.playerEntity.rotationPitch); + return; + } + +- float var27 = 1.0F / 16.0F; ++ float var27 = 0.0625F; + boolean var28 = var2.getCollidingBoundingBoxes(this.playerEntity, this.playerEntity.boundingBox.copy().contract((double)var27, (double)var27, (double)var27)).isEmpty(); +- if(this.playerEntity.onGround && !var1.onGround && var15 > 0.0D) { ++ ++ if (this.playerEntity.onGround && !par1Packet10Flying.onGround && var15 > 0.0D) { + this.playerEntity.addExhaustion(0.2F); + } + + this.playerEntity.moveEntity(var13, var15, var17); +- this.playerEntity.onGround = var1.onGround; ++ this.playerEntity.onGround = par1Packet10Flying.onGround; + this.playerEntity.addMovementStat(var13, var15, var17); + double var29 = var15; + var13 = var5 - this.playerEntity.posX; + var15 = var7 - this.playerEntity.posY; +- if(var15 > -0.5D || var15 < 0.5D) { ++ ++ if (var15 > -0.5D || var15 < 0.5D) { + var15 = 0.0D; + } + + var17 = var9 - this.playerEntity.posZ; + var25 = var13 * var13 + var15 * var15 + var17 * var17; + boolean var31 = false; +- if(var25 > 1.0D / 16.0D && !this.playerEntity.isPlayerSleeping() && !this.playerEntity.theItemInWorldManager.isCreative()) { ++ ++ if (var25 > 0.0625D && !this.playerEntity.isPlayerSleeping() && !this.playerEntity.theItemInWorldManager.isCreative()) { + var31 = true; +- this.d.getLogAgent().logWarning(this.playerEntity.getCommandSenderName() + " moved wrongly!"); ++ this.mcServer.getLogAgent().logWarning(this.playerEntity.getCommandSenderName() + " moved wrongly!"); + } + + this.playerEntity.setPositionAndRotation(var5, var7, var9, var11, var12); + boolean var32 = var2.getCollidingBoundingBoxes(this.playerEntity, this.playerEntity.boundingBox.copy().contract((double)var27, (double)var27, (double)var27)).isEmpty(); +- if(var28 && (var31 || !var32) && !this.playerEntity.isPlayerSleeping()) { ++ ++ if (var28 && (var31 || !var32) && !this.playerEntity.isPlayerSleeping()) { + this.setPlayerLocation(this.lastPosX, this.lastPosY, this.lastPosZ, var11, var12); + return; + } + + AxisAlignedBB var33 = this.playerEntity.boundingBox.copy().expand((double)var27, (double)var27, (double)var27).addCoord(0.0D, -0.55D, 0.0D); +- if(!this.d.isFlightAllowed() && !this.playerEntity.theItemInWorldManager.isCreative() && !var2.checkBlockCollision(var33)) { +- if(var29 >= -0.03125D) { +- ++this.playerInAirTime; +- if(this.playerInAirTime > 80) { +- this.d.getLogAgent().logWarning(this.playerEntity.getCommandSenderName() + " was kicked for floating too long!"); +- this.kickPlayer("Flying is not enabled on this server"); ++ ++ if (!this.mcServer.isFlightAllowed() && !this.playerEntity.theItemInWorldManager.isCreative() && !var2.checkBlockCollision(var33)) { ++ if (var29 >= -0.03125D) { ++ ++this.ticksForFloatKick; ++ ++ if (this.ticksForFloatKick > 80) { ++ this.mcServer.getLogAgent().logWarning(this.playerEntity.getCommandSenderName() + " was kicked for floating too long!"); ++ this.kickPlayerFromServer("Flying is not enabled on this server"); + return; + } + } + } else { +- this.playerInAirTime = 0; ++ this.ticksForFloatKick = 0; + } + +- this.playerEntity.onGround = var1.onGround; +- this.d.getConfigurationManager().serverUpdateMountedMovingPlayer(this.playerEntity); +- this.playerEntity.handleFalling(this.playerEntity.posY - var3, var1.onGround); +- } else if(this.currentTicks % 20 == 0) { ++ this.playerEntity.onGround = par1Packet10Flying.onGround; ++ this.mcServer.getConfigurationManager().serverUpdateMountedMovingPlayer(this.playerEntity); ++ this.playerEntity.updateFlyingState(this.playerEntity.posY - var3, par1Packet10Flying.onGround); ++ } else if (this.currentTicks % 20 == 0) { + this.setPlayerLocation(this.lastPosX, this.lastPosY, this.lastPosZ, this.playerEntity.rotationYaw, this.playerEntity.rotationPitch); + } +- + } + } + +- public void setPlayerLocation(double var1, double var3, double var5, float var7, float var8) { ++ /** ++ * Moves the player to the specified destination and rotation ++ */ ++ public void setPlayerLocation(double par1, double par3, double par5, float par7, float par8) { + this.hasMoved = false; +- this.lastPosX = var1; +- this.lastPosY = var3; +- this.lastPosZ = var5; +- this.playerEntity.setPositionAndRotation(var1, var3, var5, var7, var8); +- this.playerEntity.playerNetServerHandler.sendPacket(new Packet13PlayerLookMove(var1, var3 + (double)1.62F, var3, var5, var7, var8, false)); ++ this.lastPosX = par1; ++ this.lastPosY = par3; ++ this.lastPosZ = par5; ++ this.playerEntity.setPositionAndRotation(par1, par3, par5, par7, par8); ++ this.playerEntity.playerNetServerHandler.sendPacketToPlayer(new Packet13PlayerLookMove(par1, par3 + 1.6200000047683716D, par3, par5, par7, par8, false)); + } + +- public void handleBlockDig(Packet14BlockDig var1) { +- WorldServer var2 = this.d.worldServerForDimension(this.playerEntity.dimension); ++ public void handleBlockDig(Packet14BlockDig par1Packet14BlockDig) { ++ WorldServer var2 = this.mcServer.worldServerForDimension(this.playerEntity.dimension); + this.playerEntity.func_143004_u(); +- if(var1.status == 4) { ++ ++ if (par1Packet14BlockDig.status == 4) { + this.playerEntity.dropOneItem(false); +- } else if(var1.status == 3) { ++ } else if (par1Packet14BlockDig.status == 3) { + this.playerEntity.dropOneItem(true); +- } else if(var1.status == 5) { ++ } else if (par1Packet14BlockDig.status == 5) { + this.playerEntity.stopUsingItem(); + } else { + boolean var3 = false; +- if(var1.status == 0) { +- var3 = true; +- } +- +- if(var1.status == 1) { +- var3 = true; +- } +- +- if(var1.status == 2) { +- var3 = true; +- } +- +- int var4 = var1.xPosition; +- int var5 = var1.yPosition; +- int var6 = var1.zPosition; +- if(var3) { ++ ++ if (par1Packet14BlockDig.status == 0) { ++ var3 = true; ++ } ++ ++ if (par1Packet14BlockDig.status == 1) { ++ var3 = true; ++ } ++ ++ if (par1Packet14BlockDig.status == 2) { ++ var3 = true; ++ } ++ ++ int var4 = par1Packet14BlockDig.xPosition; ++ int var5 = par1Packet14BlockDig.yPosition; ++ int var6 = par1Packet14BlockDig.zPosition; ++ ++ if (var3) { + double var7 = this.playerEntity.posX - ((double)var4 + 0.5D); + double var9 = this.playerEntity.posY - ((double)var5 + 0.5D) + 1.5D; + double var11 = this.playerEntity.posZ - ((double)var6 + 0.5D); + double var13 = var7 * var7 + var9 * var9 + var11 * var11; +- if(var13 > 36.0D) { ++ ++ if (var13 > 36.0D) { + return; + } + +- if(var5 >= this.d.getBuildLimit()) { ++ if (var5 >= this.mcServer.getBuildLimit()) { + return; + } + } + +- if(var1.status == 0) { +- if(!this.d.isBlockProtected(var2, var4, var5, var6, this.playerEntity)) { +- this.playerEntity.theItemInWorldManager.onBlockClicked(var4, var5, var6, var1.face); ++ if (par1Packet14BlockDig.status == 0) { ++ if (!this.mcServer.isBlockProtected(var2, var4, var5, var6, this.playerEntity)) { ++ this.playerEntity.theItemInWorldManager.onBlockClicked(var4, var5, var6, par1Packet14BlockDig.face); + } else { +- this.playerEntity.playerNetServerHandler.sendPacket(new Packet53BlockChange(var4, var5, var6, var2)); +- } +- } else if(var1.status == 2) { +- this.playerEntity.theItemInWorldManager.blockRemoving(var4, var5, var6); +- if(var2.getBlockId(var4, var5, var6) != 0) { +- this.playerEntity.playerNetServerHandler.sendPacket(new Packet53BlockChange(var4, var5, var6, var2)); +- } +- } else if(var1.status == 1) { ++ this.playerEntity.playerNetServerHandler.sendPacketToPlayer(new Packet53BlockChange(var4, var5, var6, var2)); ++ } ++ } else if (par1Packet14BlockDig.status == 2) { ++ this.playerEntity.theItemInWorldManager.uncheckedTryHarvestBlock(var4, var5, var6); ++ ++ if (var2.getBlockId(var4, var5, var6) != 0) { ++ this.playerEntity.playerNetServerHandler.sendPacketToPlayer(new Packet53BlockChange(var4, var5, var6, var2)); ++ } ++ } else if (par1Packet14BlockDig.status == 1) { + this.playerEntity.theItemInWorldManager.cancelDestroyingBlock(var4, var5, var6); +- if(var2.getBlockId(var4, var5, var6) != 0) { +- this.playerEntity.playerNetServerHandler.sendPacket(new Packet53BlockChange(var4, var5, var6, var2)); ++ ++ if (var2.getBlockId(var4, var5, var6) != 0) { ++ this.playerEntity.playerNetServerHandler.sendPacketToPlayer(new Packet53BlockChange(var4, var5, var6, var2)); + } + } +- + } + } + +- public void handlePlace(Packet15Place var1) { +- WorldServer var2 = this.d.worldServerForDimension(this.playerEntity.dimension); ++ public void handlePlace(Packet15Place par1Packet15Place) { ++ WorldServer var2 = this.mcServer.worldServerForDimension(this.playerEntity.dimension); + ItemStack var3 = this.playerEntity.inventory.getCurrentItem(); + boolean var4 = false; +- int var5 = var1.getXPosition(); +- int var6 = var1.getYPosition(); +- int var7 = var1.getZPosition(); +- int var8 = var1.getDirection(); ++ int var5 = par1Packet15Place.getXPosition(); ++ int var6 = par1Packet15Place.getYPosition(); ++ int var7 = par1Packet15Place.getZPosition(); ++ int var8 = par1Packet15Place.getDirection(); + this.playerEntity.func_143004_u(); +- if(var1.getDirection() == 255) { +- if(var3 == null) { ++ ++ if (par1Packet15Place.getDirection() == 255) { ++ if (var3 == null) { + return; + } + + this.playerEntity.theItemInWorldManager.tryUseItem(this.playerEntity, var2, var3); +- } else if(var1.getYPosition() < this.d.getBuildLimit() - 1 || var1.getDirection() != 1 && var1.getYPosition() < this.d.getBuildLimit()) { +- if(this.hasMoved && this.playerEntity.getDistanceSq((double)var5 + 0.5D, (double)var6 + 0.5D, (double)var7 + 0.5D) < 64.0D && !this.d.isBlockProtected(var2, var5, var6, var7, this.playerEntity)) { +- this.playerEntity.theItemInWorldManager.activateBlockOrUseItem(this.playerEntity, var2, var3, var5, var6, var7, var8, var1.getXOffset(), var1.getYOffset(), var1.getZOffset()); +- } +- ++ } else if (par1Packet15Place.getYPosition() >= this.mcServer.getBuildLimit() - 1 && (par1Packet15Place.getDirection() == 1 || par1Packet15Place.getYPosition() >= this.mcServer.getBuildLimit())) { ++ this.playerEntity.playerNetServerHandler.sendPacketToPlayer(new Packet3Chat(ChatMessageComponent.createFromTranslationWithSubstitutions("build.tooHigh", new Object[] {Integer.valueOf(this.mcServer.getBuildLimit())}).setColor(EnumChatFormatting.RED))); + var4 = true; + } else { +- this.playerEntity.playerNetServerHandler.sendPacket(new Packet3Chat(ChatMessageComponent.createFromTranslationWithSubstitutions("build.tooHigh", new Object[]{Integer.valueOf(this.d.getBuildLimit())}).setColor(EnumChatFormatting.RED))); ++ if (this.hasMoved && this.playerEntity.getDistanceSq((double)var5 + 0.5D, (double)var6 + 0.5D, (double)var7 + 0.5D) < 64.0D && !this.mcServer.isBlockProtected(var2, var5, var6, var7, this.playerEntity)) { ++ this.playerEntity.theItemInWorldManager.activateBlockOrUseItem(this.playerEntity, var2, var3, var5, var6, var7, var8, par1Packet15Place.getXOffset(), par1Packet15Place.getYOffset(), par1Packet15Place.getZOffset()); ++ } ++ + var4 = true; + } + +- if(var4) { +- this.playerEntity.playerNetServerHandler.sendPacket(new Packet53BlockChange(var5, var6, var7, var2)); +- if(var8 == 0) { ++ if (var4) { ++ this.playerEntity.playerNetServerHandler.sendPacketToPlayer(new Packet53BlockChange(var5, var6, var7, var2)); ++ ++ if (var8 == 0) { + --var6; + } + +- if(var8 == 1) { ++ if (var8 == 1) { + ++var6; + } + +- if(var8 == 2) { ++ if (var8 == 2) { + --var7; + } + +- if(var8 == 3) { ++ if (var8 == 3) { + ++var7; + } + +- if(var8 == 4) { ++ if (var8 == 4) { + --var5; + } + +- if(var8 == 5) { ++ if (var8 == 5) { + ++var5; + } + +- this.playerEntity.playerNetServerHandler.sendPacket(new Packet53BlockChange(var5, var6, var7, var2)); ++ this.playerEntity.playerNetServerHandler.sendPacketToPlayer(new Packet53BlockChange(var5, var6, var7, var2)); + } + + var3 = this.playerEntity.inventory.getCurrentItem(); +- if(var3 != null && var3.stackSize == 0) { ++ ++ if (var3 != null && var3.stackSize == 0) { + this.playerEntity.inventory.mainInventory[this.playerEntity.inventory.currentItem] = null; + var3 = null; + } + +- if(var3 == null || var3.getMaxItemUseDuration() == 0) { +- this.playerEntity.isChangingQuantityOnly = true; ++ if (var3 == null || var3.getMaxItemUseDuration() == 0) { ++ this.playerEntity.playerInventoryBeingManipulated = true; + this.playerEntity.inventory.mainInventory[this.playerEntity.inventory.currentItem] = ItemStack.copyItemStack(this.playerEntity.inventory.mainInventory[this.playerEntity.inventory.currentItem]); + Slot var9 = this.playerEntity.openContainer.getSlotFromInventory(this.playerEntity.inventory, this.playerEntity.inventory.currentItem); + this.playerEntity.openContainer.detectAndSendChanges(); +- this.playerEntity.isChangingQuantityOnly = false; +- if(!ItemStack.areItemStacksEqual(this.playerEntity.inventory.getCurrentItem(), var1.getItemStack())) { +- this.sendPacket(new Packet103SetSlot(this.playerEntity.openContainer.windowId, var9.slotNumber, this.playerEntity.inventory.getCurrentItem())); ++ this.playerEntity.playerInventoryBeingManipulated = false; ++ ++ if (!ItemStack.areItemStacksEqual(this.playerEntity.inventory.getCurrentItem(), par1Packet15Place.getItemStack())) { ++ this.sendPacketToPlayer(new Packet103SetSlot(this.playerEntity.openContainer.windowId, var9.slotNumber, this.playerEntity.inventory.getCurrentItem())); + } + } +- + } + +- public void handleErrorMessage(String var1, Object[] var2) { +- this.d.getLogAgent().logInfo(this.playerEntity.getCommandSenderName() + " lost connection: " + var1); +- this.d.getConfigurationManager().sendChatMsg(ChatMessageComponent.createFromTranslationWithSubstitutions("multiplayer.player.left", new Object[]{this.playerEntity.getTranslatedEntityName()}).setColor(EnumChatFormatting.YELLOW)); +- this.d.getConfigurationManager().playerLoggedOut(this.playerEntity); ++ public void handleErrorMessage(String par1Str, Object[] par2ArrayOfObj) { ++ this.mcServer.getLogAgent().logInfo(this.playerEntity.getCommandSenderName() + " lost connection: " + par1Str); ++ this.mcServer.getConfigurationManager().sendChatMsg(ChatMessageComponent.createFromTranslationWithSubstitutions("multiplayer.player.left", new Object[] {this.playerEntity.getTranslatedEntityName()}).setColor(EnumChatFormatting.YELLOW)); ++ this.mcServer.getConfigurationManager().playerLoggedOut(this.playerEntity); + this.connectionClosed = true; +- if(this.d.isSinglePlayer() && this.playerEntity.getCommandSenderName().equals(this.d.getServerOwner())) { +- this.d.getLogAgent().logInfo("Stopping singleplayer server as player logged out"); +- this.d.initiateShutdown(); ++ ++ if (this.mcServer.isSinglePlayer() && this.playerEntity.getCommandSenderName().equals(this.mcServer.getServerOwner())) { ++ this.mcServer.getLogAgent().logInfo("Stopping singleplayer server as player logged out"); ++ this.mcServer.initiateShutdown(); + } +- +- } +- +- public void unexpectedPacket(Packet var1) { +- this.d.getLogAgent().logWarning(this.getClass() + " wasn\'t prepared to deal with a " + var1.getClass()); +- this.kickPlayer("Protocol error, unexpected packet"); +- } +- +- public void sendPacket(Packet var1) { +- if(var1 instanceof Packet3Chat) { +- Packet3Chat var2 = (Packet3Chat)var1; ++ } ++ ++ /** ++ * Default handler called for packets that don't have their own handlers in NetClientHandler; currentlly does nothing. ++ */ ++ public void unexpectedPacket(Packet par1Packet) { ++ this.mcServer.getLogAgent().logWarning(this.getClass() + " wasn\'t prepared to deal with a " + par1Packet.getClass()); ++ this.kickPlayerFromServer("Protocol error, unexpected packet"); ++ } ++ ++ /** ++ * addToSendQueue. if it is a chat packet, check before sending it ++ */ ++ public void sendPacketToPlayer(Packet par1Packet) { ++ if (par1Packet instanceof Packet3Chat) { ++ Packet3Chat var2 = (Packet3Chat)par1Packet; + int var3 = this.playerEntity.getChatVisibility(); +- if(var3 == 2) { ++ ++ if (var3 == 2) { + return; + } + +- if(var3 == 1 && !var2.getIsServer()) { ++ if (var3 == 1 && !var2.getIsServer()) { + return; + } + } + + try { +- this.netManager.addToSendQueue(var1); ++ this.netManager.addToSendQueue(par1Packet); + } catch (Throwable var5) { + CrashReport var6 = CrashReport.makeCrashReport(var5, "Sending packet"); + CrashReportCategory var4 = var6.makeCategory("Packet being sent"); +- var4.addCrashSectionCallable("Packet ID", new CallablePacketID(this, var1)); +- var4.addCrashSectionCallable("Packet class", new CallablePacketClass(this, var1)); ++ var4.addCrashSectionCallable("Packet ID", new CallablePacketID(this, par1Packet)); ++ var4.addCrashSectionCallable("Packet class", new CallablePacketClass(this, par1Packet)); + throw new ReportedException(var6); + } + } + +- public void handleBlockItemSwitch(Packet16BlockItemSwitch var1) { +- if(var1.id >= 0 && var1.id < InventoryPlayer.getHotbarSize()) { +- this.playerEntity.inventory.currentItem = var1.id; ++ public void handleBlockItemSwitch(Packet16BlockItemSwitch par1Packet16BlockItemSwitch) { ++ if (par1Packet16BlockItemSwitch.id >= 0 && par1Packet16BlockItemSwitch.id < InventoryPlayer.getHotbarSize()) { ++ this.playerEntity.inventory.currentItem = par1Packet16BlockItemSwitch.id; + this.playerEntity.func_143004_u(); + } else { +- this.d.getLogAgent().logWarning(this.playerEntity.getCommandSenderName() + " tried to set an invalid carried item"); ++ this.mcServer.getLogAgent().logWarning(this.playerEntity.getCommandSenderName() + " tried to set an invalid carried item"); + } + } + +- public void handleChat(Packet3Chat var1) { +- if(this.playerEntity.getChatVisibility() == 2) { +- this.sendPacket(new Packet3Chat(ChatMessageComponent.createFromTranslationKey("chat.cannotSend").setColor(EnumChatFormatting.RED))); ++ public void handleChat(Packet3Chat par1Packet3Chat) { ++ if (this.playerEntity.getChatVisibility() == 2) { ++ this.sendPacketToPlayer(new Packet3Chat(ChatMessageComponent.createFromTranslationKey("chat.cannotSend").setColor(EnumChatFormatting.RED))); + } else { + this.playerEntity.func_143004_u(); +- String var2 = var1.a; +- if(var2.length() > 100) { +- this.kickPlayer("Chat message too long"); ++ String var2 = par1Packet3Chat.message; ++ ++ if (var2.length() > 100) { ++ this.kickPlayerFromServer("Chat message too long"); + } else { + var2 = org.apache.commons.lang3.StringUtils.normalizeSpace(var2); + +- for(int var3 = 0; var3 < var2.length(); ++var3) { +- if(!ChatAllowedCharacters.isAllowedCharacter(var2.charAt(var3))) { +- this.kickPlayer("Illegal characters in chat"); ++ for (int var3 = 0; var3 < var2.length(); ++var3) { ++ if (!ChatAllowedCharacters.isAllowedCharacter(var2.charAt(var3))) { ++ this.kickPlayerFromServer("Illegal characters in chat"); + return; + } + } + +- if(var2.startsWith("/")) { ++ if (var2.startsWith("/")) { + this.handleSlashCommand(var2); + } else { +- if(this.playerEntity.getChatVisibility() == 1) { +- this.sendPacket(new Packet3Chat(ChatMessageComponent.createFromTranslationKey("chat.cannotSend").setColor(EnumChatFormatting.RED))); ++ if (this.playerEntity.getChatVisibility() == 1) { ++ this.sendPacketToPlayer(new Packet3Chat(ChatMessageComponent.createFromTranslationKey("chat.cannotSend").setColor(EnumChatFormatting.RED))); + return; + } + +- ChatMessageComponent var4 = ChatMessageComponent.createFromTranslationWithSubstitutions("chat.type.text", new Object[]{this.playerEntity.getTranslatedEntityName(), var2}); +- this.d.getConfigurationManager().func_110459_a(var4, false); ++ ChatMessageComponent var4 = ChatMessageComponent.createFromTranslationWithSubstitutions("chat.type.text", new Object[] {this.playerEntity.getTranslatedEntityName(), var2}); ++ this.mcServer.getConfigurationManager().func_110459_a(var4, false); + } + + this.chatSpamThresholdCount += 20; +- if(this.chatSpamThresholdCount > 200 && !this.d.getConfigurationManager().isPlayerOpped(this.playerEntity.getCommandSenderName())) { +- this.kickPlayer("disconnect.spam"); ++ ++ if (this.chatSpamThresholdCount > 200 && !this.mcServer.getConfigurationManager().isPlayerOpped(this.playerEntity.getCommandSenderName())) { ++ this.kickPlayerFromServer("disconnect.spam"); + } +- + } + } + } + +- private void handleSlashCommand(String var1) { +- this.d.getCommandManager().executeCommand(this.playerEntity, var1); ++ /** ++ * Processes a / command ++ */ ++ private void handleSlashCommand(String par1Str) { ++ this.mcServer.getCommandManager().executeCommand(this.playerEntity, par1Str); + } + +- public void handleAnimation(Packet18Animation var1) { ++ public void handleAnimation(Packet18Animation par1Packet18Animation) { + this.playerEntity.func_143004_u(); +- if(var1.animate == 1) { ++ ++ if (par1Packet18Animation.animate == 1) { + this.playerEntity.swingItem(); + } +- + } + +- public void handleEntityAction(Packet19EntityAction var1) { ++ /** ++ * runs registerPacket on the given Packet19EntityAction ++ */ ++ public void handleEntityAction(Packet19EntityAction par1Packet19EntityAction) { + this.playerEntity.func_143004_u(); +- if(var1.action == 1) { ++ ++ if (par1Packet19EntityAction.action == 1) { + this.playerEntity.setSneaking(true); +- } else if(var1.action == 2) { ++ } else if (par1Packet19EntityAction.action == 2) { + this.playerEntity.setSneaking(false); +- } else if(var1.action == 4) { ++ } else if (par1Packet19EntityAction.action == 4) { + this.playerEntity.setSprinting(true); +- } else if(var1.action == 5) { ++ } else if (par1Packet19EntityAction.action == 5) { + this.playerEntity.setSprinting(false); +- } else if(var1.action == 3) { ++ } else if (par1Packet19EntityAction.action == 3) { + this.playerEntity.wakeUpPlayer(false, true, true); + this.hasMoved = false; +- } else if(var1.action == 6) { +- if(this.playerEntity.ridingEntity != null && this.playerEntity.ridingEntity instanceof EntityHorse) { +- ((EntityHorse)this.playerEntity.ridingEntity).setJumpPower(var1.auxData); ++ } else if (par1Packet19EntityAction.action == 6) { ++ if (this.playerEntity.ridingEntity != null && this.playerEntity.ridingEntity instanceof EntityHorse) { ++ ((EntityHorse)this.playerEntity.ridingEntity).setJumpPower(par1Packet19EntityAction.auxData); + } +- } else if(var1.action == 7 && this.playerEntity.ridingEntity != null && this.playerEntity.ridingEntity instanceof EntityHorse) { ++ } else if (par1Packet19EntityAction.action == 7 && this.playerEntity.ridingEntity != null && this.playerEntity.ridingEntity instanceof EntityHorse) { + ((EntityHorse)this.playerEntity.ridingEntity).openGUI(this.playerEntity); + } +- + } + +- public void handleKickDisconnect(Packet255KickDisconnect var1) { ++ public void handleKickDisconnect(Packet255KickDisconnect par1Packet255KickDisconnect) { + this.netManager.networkShutdown("disconnect.quitting", new Object[0]); + } + +- public int getNumChunkDataPackets() { +- return this.netManager.getNumChunkDataPackets(); ++ /** ++ * returns 0 for memoryMapped connections ++ */ ++ public int packetSize() { ++ return this.netManager.packetSize(); + } + +- public void handleUseEntity(Packet7UseEntity var1) { +- WorldServer var2 = this.d.worldServerForDimension(this.playerEntity.dimension); +- Entity var3 = var2.getEntityByID(var1.targetEntity); ++ public void handleUseEntity(Packet7UseEntity par1Packet7UseEntity) { ++ WorldServer var2 = this.mcServer.worldServerForDimension(this.playerEntity.dimension); ++ Entity var3 = var2.getEntityByID(par1Packet7UseEntity.targetEntity); + this.playerEntity.func_143004_u(); +- if(var3 != null) { ++ ++ if (var3 != null) { + boolean var4 = this.playerEntity.canEntityBeSeen(var3); + double var5 = 36.0D; +- if(!var4) { ++ ++ if (!var4) { + var5 = 9.0D; + } + +- if(this.playerEntity.getDistanceSqToEntity(var3) < var5) { +- if(var1.isLeftClick == 0) { ++ if (this.playerEntity.getDistanceSqToEntity(var3) < var5) { ++ if (par1Packet7UseEntity.isLeftClick == 0) { + this.playerEntity.interactWith(var3); +- } else if(var1.isLeftClick == 1) { +- if(var3 instanceof EntityItem || var3 instanceof EntityXPOrb || var3 instanceof EntityArrow || var3 == this.playerEntity) { +- this.kickPlayer("Attempting to attack an invalid entity"); +- this.d.logWarning("Player " + this.playerEntity.getCommandSenderName() + " tried to attack an invalid entity"); ++ } else if (par1Packet7UseEntity.isLeftClick == 1) { ++ if (var3 instanceof EntityItem || var3 instanceof EntityXPOrb || var3 instanceof EntityArrow || var3 == this.playerEntity) { ++ this.kickPlayerFromServer("Attempting to attack an invalid entity"); ++ this.mcServer.logWarning("Player " + this.playerEntity.getCommandSenderName() + " tried to attack an invalid entity"); + return; + } + +@@ -542,223 +615,255 @@ + } + } + } +- + } + +- public void handleClientCommand(Packet205ClientCommand var1) { ++ public void handleClientCommand(Packet205ClientCommand par1Packet205ClientCommand) { + this.playerEntity.func_143004_u(); +- if(var1.forceRespawn == 1) { +- if(this.playerEntity.playerConqueredTheEnd) { +- this.playerEntity = this.d.getConfigurationManager().recreatePlayerEntity(this.playerEntity, 0, true); +- } else if(this.playerEntity.getServerForPlayer().getWorldInfo().isHardcoreModeEnabled()) { +- if(this.d.isSinglePlayer() && this.playerEntity.getCommandSenderName().equals(this.d.getServerOwner())) { +- this.playerEntity.playerNetServerHandler.kickPlayer("You have died. Game over, man, it\'s game over!"); +- this.d.deleteWorldAndStopServer(); ++ ++ if (par1Packet205ClientCommand.forceRespawn == 1) { ++ if (this.playerEntity.playerConqueredTheEnd) { ++ this.playerEntity = this.mcServer.getConfigurationManager().respawnPlayer(this.playerEntity, 0, true); ++ } else if (this.playerEntity.getServerForPlayer().getWorldInfo().isHardcoreModeEnabled()) { ++ if (this.mcServer.isSinglePlayer() && this.playerEntity.getCommandSenderName().equals(this.mcServer.getServerOwner())) { ++ this.playerEntity.playerNetServerHandler.kickPlayerFromServer("You have died. Game over, man, it\'s game over!"); ++ this.mcServer.deleteWorldAndStopServer(); + } else { + BanEntry var2 = new BanEntry(this.playerEntity.getCommandSenderName()); + var2.setBanReason("Death in Hardcore"); +- this.d.getConfigurationManager().getBannedPlayers().put(var2); +- this.playerEntity.playerNetServerHandler.kickPlayer("You have died. Game over, man, it\'s game over!"); ++ this.mcServer.getConfigurationManager().getBannedPlayers().put(var2); ++ this.playerEntity.playerNetServerHandler.kickPlayerFromServer("You have died. Game over, man, it\'s game over!"); + } + } else { +- if(this.playerEntity.getHealth() > 0.0F) { ++ if (this.playerEntity.getHealth() > 0.0F) { + return; + } + +- this.playerEntity = this.d.getConfigurationManager().recreatePlayerEntity(this.playerEntity, 0, false); ++ this.playerEntity = this.mcServer.getConfigurationManager().respawnPlayer(this.playerEntity, 0, false); + } + } +- + } + ++ /** ++ * If this returns false, all packets will be queued for the main thread to handle, even if they would otherwise be ++ * processed asynchronously. Used to avoid processing packets on the client before the world has been downloaded (which ++ * happens on the main thread) ++ */ + public boolean canProcessPacketsAsync() { + return true; + } + +- public void handleRespawn(Packet9Respawn var1) { +- } ++ /** ++ * respawns the player ++ */ ++ public void handleRespawn(Packet9Respawn par1Packet9Respawn) {} + +- public void handleCloseWindow(Packet101CloseWindow var1) { ++ public void handleCloseWindow(Packet101CloseWindow par1Packet101CloseWindow) { + this.playerEntity.closeContainer(); + } + +- public void handleWindowClick(Packet102WindowClick var1) { ++ public void handleWindowClick(Packet102WindowClick par1Packet102WindowClick) { + this.playerEntity.func_143004_u(); +- if(this.playerEntity.openContainer.windowId == var1.window_Id && this.playerEntity.openContainer.getCanCraft(this.playerEntity)) { +- ItemStack var2 = this.playerEntity.openContainer.slotClick(var1.inventorySlot, var1.mouseClick, var1.holdingShift, this.playerEntity); +- if(ItemStack.areItemStacksEqual(var1.itemStack, var2)) { +- this.playerEntity.playerNetServerHandler.sendPacket(new Packet106Transaction(var1.window_Id, var1.action, true)); +- this.playerEntity.isChangingQuantityOnly = true; ++ ++ if (this.playerEntity.openContainer.windowId == par1Packet102WindowClick.window_Id && this.playerEntity.openContainer.isPlayerNotUsingContainer(this.playerEntity)) { ++ ItemStack var2 = this.playerEntity.openContainer.slotClick(par1Packet102WindowClick.inventorySlot, par1Packet102WindowClick.mouseClick, par1Packet102WindowClick.holdingShift, this.playerEntity); ++ ++ if (ItemStack.areItemStacksEqual(par1Packet102WindowClick.itemStack, var2)) { ++ this.playerEntity.playerNetServerHandler.sendPacketToPlayer(new Packet106Transaction(par1Packet102WindowClick.window_Id, par1Packet102WindowClick.action, true)); ++ this.playerEntity.playerInventoryBeingManipulated = true; + this.playerEntity.openContainer.detectAndSendChanges(); + this.playerEntity.updateHeldItem(); +- this.playerEntity.isChangingQuantityOnly = false; ++ this.playerEntity.playerInventoryBeingManipulated = false; + } else { +- this.field_72586_s.addKey(this.playerEntity.openContainer.windowId, Short.valueOf(var1.action)); +- this.playerEntity.playerNetServerHandler.sendPacket(new Packet106Transaction(var1.window_Id, var1.action, false)); +- this.playerEntity.openContainer.setCanCraft(this.playerEntity, false); ++ this.field_72586_s.addKey(this.playerEntity.openContainer.windowId, Short.valueOf(par1Packet102WindowClick.action)); ++ this.playerEntity.playerNetServerHandler.sendPacketToPlayer(new Packet106Transaction(par1Packet102WindowClick.window_Id, par1Packet102WindowClick.action, false)); ++ this.playerEntity.openContainer.setPlayerIsPresent(this.playerEntity, false); + ArrayList var3 = new ArrayList(); + +- for(int var4 = 0; var4 < this.playerEntity.openContainer.c.size(); ++var4) { +- var3.add(((Slot)this.playerEntity.openContainer.c.get(var4)).getStack()); ++ for (int var4 = 0; var4 < this.playerEntity.openContainer.inventorySlots.size(); ++var4) { ++ var3.add(((Slot)this.playerEntity.openContainer.inventorySlots.get(var4)).getStack()); + } + +- this.playerEntity.updateCraftingInventory(this.playerEntity.openContainer, var3); ++ this.playerEntity.sendContainerAndContentsToPlayer(this.playerEntity.openContainer, var3); + } + } +- + } + +- public void handleEnchantItem(Packet108EnchantItem var1) { ++ public void handleEnchantItem(Packet108EnchantItem par1Packet108EnchantItem) { + this.playerEntity.func_143004_u(); +- if(this.playerEntity.openContainer.windowId == var1.windowId && this.playerEntity.openContainer.getCanCraft(this.playerEntity)) { +- this.playerEntity.openContainer.enchantItem(this.playerEntity, var1.enchantment); ++ ++ if (this.playerEntity.openContainer.windowId == par1Packet108EnchantItem.windowId && this.playerEntity.openContainer.isPlayerNotUsingContainer(this.playerEntity)) { ++ this.playerEntity.openContainer.enchantItem(this.playerEntity, par1Packet108EnchantItem.enchantment); + this.playerEntity.openContainer.detectAndSendChanges(); + } +- + } + +- public void handleCreativeSetSlot(Packet107CreativeSetSlot var1) { +- if(this.playerEntity.theItemInWorldManager.isCreative()) { +- boolean var2 = var1.slot < 0; +- ItemStack var3 = var1.itemStack; +- boolean var4 = var1.slot >= 1 && var1.slot < 36 + InventoryPlayer.getHotbarSize(); ++ /** ++ * Handle a creative slot packet. ++ */ ++ public void handleCreativeSetSlot(Packet107CreativeSetSlot par1Packet107CreativeSetSlot) { ++ if (this.playerEntity.theItemInWorldManager.isCreative()) { ++ boolean var2 = par1Packet107CreativeSetSlot.slot < 0; ++ ItemStack var3 = par1Packet107CreativeSetSlot.itemStack; ++ boolean var4 = par1Packet107CreativeSetSlot.slot >= 1 && par1Packet107CreativeSetSlot.slot < 36 + InventoryPlayer.getHotbarSize(); + boolean var5 = var3 == null || var3.itemID < Item.itemsList.length && var3.itemID >= 0 && Item.itemsList[var3.itemID] != null; + boolean var6 = var3 == null || var3.getItemDamage() >= 0 && var3.getItemDamage() >= 0 && var3.stackSize <= 64 && var3.stackSize > 0; +- if(var4 && var5 && var6) { +- if(var3 == null) { +- this.playerEntity.inventoryContainer.putStackInSlot(var1.slot, (ItemStack)null); ++ ++ if (var4 && var5 && var6) { ++ if (var3 == null) { ++ this.playerEntity.inventoryContainer.putStackInSlot(par1Packet107CreativeSetSlot.slot, (ItemStack)null); + } else { +- this.playerEntity.inventoryContainer.putStackInSlot(var1.slot, var3); ++ this.playerEntity.inventoryContainer.putStackInSlot(par1Packet107CreativeSetSlot.slot, var3); + } + +- this.playerEntity.inventoryContainer.setCanCraft(this.playerEntity, true); +- } else if(var2 && var5 && var6 && this.creativeItemCreationSpamThresholdTally < 200) { ++ this.playerEntity.inventoryContainer.setPlayerIsPresent(this.playerEntity, true); ++ } else if (var2 && var5 && var6 && this.creativeItemCreationSpamThresholdTally < 200) { + this.creativeItemCreationSpamThresholdTally += 20; + EntityItem var7 = this.playerEntity.dropPlayerItem(var3); +- if(var7 != null) { ++ ++ if (var7 != null) { + var7.setAgeToCreativeDespawnTime(); + } + } + } +- + } + +- public void handleTransaction(Packet106Transaction var1) { ++ public void handleTransaction(Packet106Transaction par1Packet106Transaction) { + Short var2 = (Short)this.field_72586_s.lookup(this.playerEntity.openContainer.windowId); +- if(var2 != null && var1.shortWindowId == var2.shortValue() && this.playerEntity.openContainer.windowId == var1.windowId && !this.playerEntity.openContainer.getCanCraft(this.playerEntity)) { +- this.playerEntity.openContainer.setCanCraft(this.playerEntity, true); ++ ++ if (var2 != null && par1Packet106Transaction.shortWindowId == var2.shortValue() && this.playerEntity.openContainer.windowId == par1Packet106Transaction.windowId && !this.playerEntity.openContainer.isPlayerNotUsingContainer(this.playerEntity)) { ++ this.playerEntity.openContainer.setPlayerIsPresent(this.playerEntity, true); + } +- + } + +- public void handleUpdateSign(Packet130UpdateSign var1) { ++ /** ++ * Updates Client side signs ++ */ ++ public void handleUpdateSign(Packet130UpdateSign par1Packet130UpdateSign) { + this.playerEntity.func_143004_u(); +- WorldServer var2 = this.d.worldServerForDimension(this.playerEntity.dimension); +- if(var2.blockExists(var1.xPosition, var1.yPosition, var1.zPosition)) { +- TileEntity var3 = var2.getBlockTileEntity(var1.xPosition, var1.yPosition, var1.zPosition); +- if(var3 instanceof TileEntitySign) { ++ WorldServer var2 = this.mcServer.worldServerForDimension(this.playerEntity.dimension); ++ ++ if (var2.blockExists(par1Packet130UpdateSign.xPosition, par1Packet130UpdateSign.yPosition, par1Packet130UpdateSign.zPosition)) { ++ TileEntity var3 = var2.getBlockTileEntity(par1Packet130UpdateSign.xPosition, par1Packet130UpdateSign.yPosition, par1Packet130UpdateSign.zPosition); ++ ++ if (var3 instanceof TileEntitySign) { + TileEntitySign var4 = (TileEntitySign)var3; +- if(!var4.isEditable() || var4.func_142009_b() != this.playerEntity) { +- this.d.logWarning("Player " + this.playerEntity.getCommandSenderName() + " just tried to change non-editable sign"); ++ ++ if (!var4.isEditable() || var4.func_142009_b() != this.playerEntity) { ++ this.mcServer.logWarning("Player " + this.playerEntity.getCommandSenderName() + " just tried to change non-editable sign"); + return; + } + } + + int var6; + int var8; +- for(var8 = 0; var8 < 4; ++var8) { ++ ++ for (var8 = 0; var8 < 4; ++var8) { + boolean var5 = true; +- if(var1.d[var8].length() > 15) { ++ ++ if (par1Packet130UpdateSign.signLines[var8].length() > 15) { + var5 = false; + } else { +- for(var6 = 0; var6 < var1.d[var8].length(); ++var6) { +- if(ChatAllowedCharacters.a.indexOf(var1.d[var8].charAt(var6)) < 0) { ++ for (var6 = 0; var6 < par1Packet130UpdateSign.signLines[var8].length(); ++var6) { ++ if (ChatAllowedCharacters.allowedCharacters.indexOf(par1Packet130UpdateSign.signLines[var8].charAt(var6)) < 0) { + var5 = false; + } + } + } + +- if(!var5) { +- var1.d[var8] = "!?"; ++ if (!var5) { ++ par1Packet130UpdateSign.signLines[var8] = "!?"; + } + } + +- if(var3 instanceof TileEntitySign) { +- var8 = var1.xPosition; +- int var9 = var1.yPosition; +- var6 = var1.zPosition; ++ if (var3 instanceof TileEntitySign) { ++ var8 = par1Packet130UpdateSign.xPosition; ++ int var9 = par1Packet130UpdateSign.yPosition; ++ var6 = par1Packet130UpdateSign.zPosition; + TileEntitySign var7 = (TileEntitySign)var3; +- System.arraycopy(var1.d, 0, var7.a, 0, 4); ++ System.arraycopy(par1Packet130UpdateSign.signLines, 0, var7.signText, 0, 4); + var7.onInventoryChanged(); + var2.markBlockForUpdate(var8, var9, var6); + } + } +- + } + +- public void handleKeepAlive(Packet0KeepAlive var1) { +- if(var1.randomId == this.keepAliveRandomID) { ++ /** ++ * Handle a keep alive packet. ++ */ ++ public void handleKeepAlive(Packet0KeepAlive par1Packet0KeepAlive) { ++ if (par1Packet0KeepAlive.randomId == this.keepAliveRandomID) { + int var2 = (int)(System.nanoTime() / 1000000L - this.keepAliveTimeSent); + this.playerEntity.ping = (this.playerEntity.ping * 3 + var2) / 4; + } +- + } + ++ /** ++ * determine if it is a server handler ++ */ + public boolean isServerHandler() { + return true; + } + +- public void handlePlayerAbilities(Packet202PlayerAbilities var1) { +- this.playerEntity.capabilities.isFlying = var1.getFlying() && this.playerEntity.capabilities.allowFlying; ++ /** ++ * Handle a player abilities packet. ++ */ ++ public void handlePlayerAbilities(Packet202PlayerAbilities par1Packet202PlayerAbilities) { ++ this.playerEntity.capabilities.isFlying = par1Packet202PlayerAbilities.getFlying() && this.playerEntity.capabilities.allowFlying; + } + +- public void handleAutoComplete(Packet203AutoComplete var1) { ++ public void handleAutoComplete(Packet203AutoComplete par1Packet203AutoComplete) { + StringBuilder var2 = new StringBuilder(); +- + String var4; +- for(Iterator var3 = this.d.getPossibleCompletions(this.playerEntity, var1.getText()).iterator(); var3.hasNext(); var2.append(var4)) { ++ ++ for (Iterator var3 = this.mcServer.getPossibleCompletions(this.playerEntity, par1Packet203AutoComplete.getText()).iterator(); var3.hasNext(); var2.append(var4)) { + var4 = (String)var3.next(); +- if(var2.length() > 0) { ++ ++ if (var2.length() > 0) { + var2.append("\u0000"); + } + } + +- this.playerEntity.playerNetServerHandler.sendPacket(new Packet203AutoComplete(var2.toString())); +- } +- +- public void handleClientInfo(Packet204ClientInfo var1) { +- this.playerEntity.updateClientInfo(var1); +- } +- +- public void handleCustomPayload(Packet250CustomPayload var1) { ++ this.playerEntity.playerNetServerHandler.sendPacketToPlayer(new Packet203AutoComplete(var2.toString())); ++ } ++ ++ public void handleClientInfo(Packet204ClientInfo par1Packet204ClientInfo) { ++ this.playerEntity.updateClientInfo(par1Packet204ClientInfo); ++ } ++ ++ public void handleCustomPayload(Packet250CustomPayload par1Packet250CustomPayload) { + DataInputStream var2; + ItemStack var3; + ItemStack var4; +- if("MC|BEdit".equals(var1.a)) { ++ ++ if ("MC|BEdit".equals(par1Packet250CustomPayload.channel)) { + try { +- var2 = new DataInputStream(new ByteArrayInputStream(var1.data)); ++ var2 = new DataInputStream(new ByteArrayInputStream(par1Packet250CustomPayload.data)); + var3 = Packet.readItemStack(var2); +- if(!ItemWritableBook.validBookTagPages(var3.getTagCompound())) { ++ ++ if (!ItemWritableBook.validBookTagPages(var3.getTagCompound())) { + throw new IOException("Invalid book tag!"); + } + + var4 = this.playerEntity.inventory.getCurrentItem(); +- if(var3 != null && var3.itemID == Item.writableBook.itemID && var3.itemID == var4.itemID) { ++ ++ if (var3 != null && var3.itemID == Item.writableBook.itemID && var3.itemID == var4.itemID) { + var4.setTagInfo("pages", var3.getTagCompound().getTagList("pages")); + } + } catch (Exception var12) { + var12.printStackTrace(); + } +- } else if("MC|BSign".equals(var1.a)) { ++ } else if ("MC|BSign".equals(par1Packet250CustomPayload.channel)) { + try { +- var2 = new DataInputStream(new ByteArrayInputStream(var1.data)); ++ var2 = new DataInputStream(new ByteArrayInputStream(par1Packet250CustomPayload.data)); + var3 = Packet.readItemStack(var2); +- if(!ItemEditableBook.validBookTagContents(var3.getTagCompound())) { ++ ++ if (!ItemEditableBook.validBookTagContents(var3.getTagCompound())) { + throw new IOException("Invalid book tag!"); + } + + var4 = this.playerEntity.inventory.getCurrentItem(); +- if(var3 != null && var3.itemID == Item.writtenBook.itemID && var4.itemID == Item.writableBook.itemID) { ++ ++ if (var3 != null && var3.itemID == Item.writtenBook.itemID && var4.itemID == Item.writableBook.itemID) { + var4.setTagInfo("author", new NBTTagString("author", this.playerEntity.getCommandSenderName())); + var4.setTagInfo("title", new NBTTagString("title", var3.getTagCompound().getString("title"))); + var4.setTagInfo("pages", var3.getTagCompound().getTagList("pages")); +@@ -769,12 +874,14 @@ + } + } else { + int var13; +- if("MC|TrSel".equals(var1.a)) { ++ ++ if ("MC|TrSel".equals(par1Packet250CustomPayload.channel)) { + try { +- var2 = new DataInputStream(new ByteArrayInputStream(var1.data)); ++ var2 = new DataInputStream(new ByteArrayInputStream(par1Packet250CustomPayload.data)); + var13 = var2.readInt(); + Container var15 = this.playerEntity.openContainer; +- if(var15 instanceof ContainerMerchant) { ++ ++ if (var15 instanceof ContainerMerchant) { + ((ContainerMerchant)var15).setCurrentRecipeIndex(var13); + } + } catch (Exception var10) { +@@ -782,21 +889,23 @@ + } + } else { + int var17; +- if("MC|AdvCdm".equals(var1.a)) { +- if(!this.d.isCommandBlockEnabled()) { ++ ++ if ("MC|AdvCdm".equals(par1Packet250CustomPayload.channel)) { ++ if (!this.mcServer.isCommandBlockEnabled()) { + this.playerEntity.sendChatToPlayer(ChatMessageComponent.createFromTranslationKey("advMode.notEnabled")); +- } else if(this.playerEntity.canCommandSenderUseCommand(2, "") && this.playerEntity.capabilities.isCreativeMode) { ++ } else if (this.playerEntity.canCommandSenderUseCommand(2, "") && this.playerEntity.capabilities.isCreativeMode) { + try { +- var2 = new DataInputStream(new ByteArrayInputStream(var1.data)); ++ var2 = new DataInputStream(new ByteArrayInputStream(par1Packet250CustomPayload.data)); + var13 = var2.readInt(); + var17 = var2.readInt(); + int var5 = var2.readInt(); + String var6 = Packet.readString(var2, 256); + TileEntity var7 = this.playerEntity.worldObj.getBlockTileEntity(var13, var17, var5); +- if(var7 != null && var7 instanceof TileEntityCommandBlock) { ++ ++ if (var7 != null && var7 instanceof TileEntityCommandBlock) { + ((TileEntityCommandBlock)var7).setCommand(var6); + this.playerEntity.worldObj.markBlockForUpdate(var13, var17, var5); +- this.playerEntity.sendChatToPlayer(ChatMessageComponent.createFromTranslationWithSubstitutions("advMode.setCommand.success", new Object[]{var6})); ++ this.playerEntity.sendChatToPlayer(ChatMessageComponent.createFromTranslationWithSubstitutions("advMode.setCommand.success", new Object[] {var6})); + } + } catch (Exception var9) { + var9.printStackTrace(); +@@ -804,15 +913,16 @@ + } else { + this.playerEntity.sendChatToPlayer(ChatMessageComponent.createFromTranslationKey("advMode.notAllowed")); + } +- } else if("MC|Beacon".equals(var1.a)) { +- if(this.playerEntity.openContainer instanceof ContainerBeacon) { ++ } else if ("MC|Beacon".equals(par1Packet250CustomPayload.channel)) { ++ if (this.playerEntity.openContainer instanceof ContainerBeacon) { + try { +- var2 = new DataInputStream(new ByteArrayInputStream(var1.data)); ++ var2 = new DataInputStream(new ByteArrayInputStream(par1Packet250CustomPayload.data)); + var13 = var2.readInt(); + var17 = var2.readInt(); + ContainerBeacon var18 = (ContainerBeacon)this.playerEntity.openContainer; + Slot var19 = var18.getSlot(0); +- if(var19.getHasStack()) { ++ ++ if (var19.getHasStack()) { + var19.decrStackSize(1); + TileEntityBeacon var20 = var18.getBeacon(); + var20.setPrimaryEffect(var13); +@@ -823,11 +933,13 @@ + var8.printStackTrace(); + } + } +- } else if("MC|ItemName".equals(var1.a) && this.playerEntity.openContainer instanceof ContainerRepair) { ++ } else if ("MC|ItemName".equals(par1Packet250CustomPayload.channel) && this.playerEntity.openContainer instanceof ContainerRepair) { + ContainerRepair var14 = (ContainerRepair)this.playerEntity.openContainer; +- if(var1.data != null && var1.data.length >= 1) { +- String var16 = ChatAllowedCharacters.filerAllowedCharacters(new String(var1.data)); +- if(var16.length() <= 30) { ++ ++ if (par1Packet250CustomPayload.data != null && par1Packet250CustomPayload.data.length >= 1) { ++ String var16 = ChatAllowedCharacters.filerAllowedCharacters(new String(par1Packet250CustomPayload.data)); ++ ++ if (var16.length() <= 30) { + var14.updateItemName(var16); + } + } else { +@@ -836,7 +948,6 @@ + } + } + } +- + } + + public boolean isConnectionClosed() { diff --git a/patches/net/minecraft/src/NetworkListenThread.java.patch b/patches/net/minecraft/src/NetworkListenThread.java.patch new file mode 100644 index 0000000..68d9fb4 --- /dev/null +++ b/patches/net/minecraft/src/NetworkListenThread.java.patch @@ -0,0 +1,86 @@ +--- net/minecraft/src/NetworkListenThread.java ++++ net/minecraft/src/NetworkListenThread.java +@@ -1,56 +1,66 @@ + package net.minecraft.src; + ++import java.io.IOException; + import java.util.ArrayList; + import java.util.Collections; + import java.util.List; + import net.minecraft.server.MinecraftServer; + + public abstract class NetworkListenThread { +- private final MinecraftServer b; +- private final List c = Collections.synchronizedList(new ArrayList()); ++ ++ /** Reference to the MinecraftServer object. */ ++ private final MinecraftServer mcServer; ++ private final List connections = Collections.synchronizedList(new ArrayList()); ++ ++ /** Whether the network listener object is listening. */ + public volatile boolean isListening; + +- public NetworkListenThread(MinecraftServer var1) { +- this.b = var1; ++ public NetworkListenThread(MinecraftServer par1MinecraftServer) throws IOException { ++ this.mcServer = par1MinecraftServer; + this.isListening = true; + } + +- public void addPlayer(NetServerHandler var1) { +- this.c.add(var1); ++ /** ++ * adds this connection to the list of currently connected players ++ */ ++ public void addPlayer(NetServerHandler par1NetServerHandler) { ++ this.connections.add(par1NetServerHandler); + } + + public void stopListening() { + this.isListening = false; + } + +- public void handleNetworkListenThread() { +- for(int var1 = 0; var1 < this.c.size(); ++var1) { +- NetServerHandler var2 = (NetServerHandler)this.c.get(var1); ++ /** ++ * processes packets and pending connections ++ */ ++ public void networkTick() { ++ for (int var1 = 0; var1 < this.connections.size(); ++var1) { ++ NetServerHandler var2 = (NetServerHandler)this.connections.get(var1); + + try { +- var2.handlePackets(); ++ var2.networkTick(); + } catch (Exception var6) { +- if(var2.netManager instanceof MemoryConnection) { ++ if (var2.netManager instanceof MemoryConnection) { + CrashReport var4 = CrashReport.makeCrashReport(var6, "Ticking memory connection"); + CrashReportCategory var5 = var4.makeCategory("Ticking connection"); + var5.addCrashSectionCallable("Connection", new CallableConnectionName(this, var2)); + throw new ReportedException(var4); + } + +- this.b.getLogAgent().logWarningException("Failed to handle packet for " + var2.playerEntity.getEntityName() + "/" + var2.playerEntity.getPlayerIP() + ": " + var6, var6); +- var2.kickPlayer("Internal server error"); ++ this.mcServer.getLogAgent().logWarningException("Failed to handle packet for " + var2.playerEntity.getEntityName() + "/" + var2.playerEntity.getPlayerIP() + ": " + var6, var6); ++ var2.kickPlayerFromServer("Internal server error"); + } + +- if(var2.connectionClosed) { +- this.c.remove(var1--); ++ if (var2.connectionClosed) { ++ this.connections.remove(var1--); + } + + var2.netManager.wakeThreads(); + } +- + } + + public MinecraftServer getServer() { +- return this.b; ++ return this.mcServer; + } + } diff --git a/patches/net/minecraft/src/NextTickListEntry.java.patch b/patches/net/minecraft/src/NextTickListEntry.java.patch new file mode 100644 index 0000000..4ded4f8 --- /dev/null +++ b/patches/net/minecraft/src/NextTickListEntry.java.patch @@ -0,0 +1,97 @@ +--- net/minecraft/src/NextTickListEntry.java ++++ net/minecraft/src/NextTickListEntry.java +@@ -1,27 +1,44 @@ + package net.minecraft.src; + + public class NextTickListEntry implements Comparable { ++ ++ /** The id number for the next tick entry */ + private static long nextTickEntryID; ++ ++ /** X position this tick is occuring at */ + public int xCoord; ++ ++ /** Y position this tick is occuring at */ + public int yCoord; ++ ++ /** Z position this tick is occuring at */ + public int zCoord; ++ ++ /** ++ * blockID of the scheduled tick (ensures when the tick occurs its still for this block) ++ */ + public int blockID; ++ ++ /** Time this tick is scheduled to occur at */ + public long scheduledTime; + public int priority; +- private long tickEntryID = nextTickEntryID++; +- +- public NextTickListEntry(int var1, int var2, int var3, int var4) { +- this.xCoord = var1; +- this.yCoord = var2; +- this.zCoord = var3; +- this.blockID = var4; ++ ++ /** The id of the tick entry */ ++ private long tickEntryID; ++ ++ public NextTickListEntry(int par1, int par2, int par3, int par4) { ++ this.tickEntryID = (long)(nextTickEntryID++); ++ this.xCoord = par1; ++ this.yCoord = par2; ++ this.zCoord = par3; ++ this.blockID = par4; + } + +- public boolean equals(Object var1) { +- if(!(var1 instanceof NextTickListEntry)) { ++ public boolean equals(Object par1Obj) { ++ if (!(par1Obj instanceof NextTickListEntry)) { + return false; + } else { +- NextTickListEntry var2 = (NextTickListEntry)var1; ++ NextTickListEntry var2 = (NextTickListEntry)par1Obj; + return this.xCoord == var2.xCoord && this.yCoord == var2.yCoord && this.zCoord == var2.zCoord && Block.isAssociatedBlockID(this.blockID, var2.blockID); + } + } +@@ -30,24 +47,31 @@ + return (this.xCoord * 1024 * 1024 + this.zCoord * 1024 + this.yCoord) * 256; + } + +- public NextTickListEntry setScheduledTime(long var1) { +- this.scheduledTime = var1; ++ /** ++ * Sets the scheduled time for this tick entry ++ */ ++ public NextTickListEntry setScheduledTime(long par1) { ++ this.scheduledTime = par1; + return this; + } + +- public void setPriority(int var1) { +- this.priority = var1; ++ public void setPriority(int par1) { ++ this.priority = par1; + } + +- public int comparer(NextTickListEntry var1) { +- return this.scheduledTime < var1.scheduledTime ? -1 : (this.scheduledTime > var1.scheduledTime ? 1 : (this.priority != var1.priority ? this.priority - var1.priority : (this.tickEntryID < var1.tickEntryID ? -1 : (this.tickEntryID > var1.tickEntryID ? 1 : 0)))); ++ /** ++ * Compares this tick entry to another tick entry for sorting purposes. Compared first based on the scheduled time and ++ * second based on tickEntryID. ++ */ ++ public int comparer(NextTickListEntry par1NextTickListEntry) { ++ return this.scheduledTime < par1NextTickListEntry.scheduledTime ? -1 : (this.scheduledTime > par1NextTickListEntry.scheduledTime ? 1 : (this.priority != par1NextTickListEntry.priority ? this.priority - par1NextTickListEntry.priority : (this.tickEntryID < par1NextTickListEntry.tickEntryID ? -1 : (this.tickEntryID > par1NextTickListEntry.tickEntryID ? 1 : 0)))); + } + + public String toString() { + return this.blockID + ": (" + this.xCoord + ", " + this.yCoord + ", " + this.zCoord + "), " + this.scheduledTime + ", " + this.priority + ", " + this.tickEntryID; + } + +- public int compareTo(Object var1) { +- return this.comparer((NextTickListEntry)var1); ++ public int compareTo(Object par1Obj) { ++ return this.comparer((NextTickListEntry)par1Obj); + } + } diff --git a/patches/net/minecraft/src/NibbleArray.java.patch b/patches/net/minecraft/src/NibbleArray.java.patch new file mode 100644 index 0000000..70d86dc --- /dev/null +++ b/patches/net/minecraft/src/NibbleArray.java.patch @@ -0,0 +1,79 @@ +--- net/minecraft/src/NibbleArray.java ++++ net/minecraft/src/NibbleArray.java +@@ -1,38 +1,56 @@ + package net.minecraft.src; + + public class NibbleArray { ++ ++ /** ++ * Byte array of data stored in this holder. Possibly a light map or some chunk data. Data is accessed in 4-bit pieces. ++ */ + public final byte[] data; ++ ++ /** ++ * Log base 2 of the chunk height (128); applied as a shift on Z coordinate ++ */ + private final int depthBits; ++ ++ /** ++ * Log base 2 of the chunk height (128) * width (16); applied as a shift on X coordinate ++ */ + private final int depthBitsPlusFour; + +- public NibbleArray(int var1, int var2) { +- this.data = new byte[var1 >> 1]; +- this.depthBits = var2; +- this.depthBitsPlusFour = var2 + 4; +- } +- +- public NibbleArray(byte[] var1, int var2) { +- this.data = var1; +- this.depthBits = var2; +- this.depthBitsPlusFour = var2 + 4; +- } +- +- public int get(int var1, int var2, int var3) { +- int var4 = var2 << this.depthBitsPlusFour | var3 << this.depthBits | var1; ++ public NibbleArray(int par1, int par2) { ++ this.data = new byte[par1 >> 1]; ++ this.depthBits = par2; ++ this.depthBitsPlusFour = par2 + 4; ++ } ++ ++ public NibbleArray(byte[] par1ArrayOfByte, int par2) { ++ this.data = par1ArrayOfByte; ++ this.depthBits = par2; ++ this.depthBitsPlusFour = par2 + 4; ++ } ++ ++ /** ++ * Returns the nibble of data corresponding to the passed in x, y, z. y is at most 6 bits, z is at most 4. ++ */ ++ public int get(int par1, int par2, int par3) { ++ int var4 = par2 << this.depthBitsPlusFour | par3 << this.depthBits | par1; + int var5 = var4 >> 1; + int var6 = var4 & 1; + return var6 == 0 ? this.data[var5] & 15 : this.data[var5] >> 4 & 15; + } + +- public void set(int var1, int var2, int var3, int var4) { +- int var5 = var2 << this.depthBitsPlusFour | var3 << this.depthBits | var1; ++ /** ++ * Arguments are x, y, z, val. Sets the nibble of data at x << 11 | z << 7 | y to val. ++ */ ++ public void set(int par1, int par2, int par3, int par4) { ++ int var5 = par2 << this.depthBitsPlusFour | par3 << this.depthBits | par1; + int var6 = var5 >> 1; + int var7 = var5 & 1; +- if(var7 == 0) { +- this.data[var6] = (byte)(this.data[var6] & 240 | var4 & 15); ++ ++ if (var7 == 0) { ++ this.data[var6] = (byte)(this.data[var6] & 240 | par4 & 15); + } else { +- this.data[var6] = (byte)(this.data[var6] & 15 | (var4 & 15) << 4); ++ this.data[var6] = (byte)(this.data[var6] & 15 | (par4 & 15) << 4); + } +- + } + } diff --git a/patches/net/minecraft/src/NibbleArrayReader.java.patch b/patches/net/minecraft/src/NibbleArrayReader.java.patch new file mode 100644 index 0000000..936ac71 --- /dev/null +++ b/patches/net/minecraft/src/NibbleArrayReader.java.patch @@ -0,0 +1,23 @@ +--- net/minecraft/src/NibbleArrayReader.java ++++ net/minecraft/src/NibbleArrayReader.java +@@ -5,14 +5,14 @@ + private final int depthBits; + private final int depthBitsPlusFour; + +- public NibbleArrayReader(byte[] var1, int var2) { +- this.data = var1; +- this.depthBits = var2; +- this.depthBitsPlusFour = var2 + 4; ++ public NibbleArrayReader(byte[] par1ArrayOfByte, int par2) { ++ this.data = par1ArrayOfByte; ++ this.depthBits = par2; ++ this.depthBitsPlusFour = par2 + 4; + } + +- public int get(int var1, int var2, int var3) { +- int var4 = var1 << this.depthBitsPlusFour | var3 << this.depthBits | var2; ++ public int get(int par1, int par2, int par3) { ++ int var4 = par1 << this.depthBitsPlusFour | par3 << this.depthBits | par2; + int var5 = var4 >> 1; + int var6 = var4 & 1; + return var6 == 0 ? this.data[var5] & 15 : this.data[var5] >> 4 & 15; diff --git a/patches/net/minecraft/src/NoiseGeneratorOctaves.java.patch b/patches/net/minecraft/src/NoiseGeneratorOctaves.java.patch new file mode 100644 index 0000000..a0c14a2 --- /dev/null +++ b/patches/net/minecraft/src/NoiseGeneratorOctaves.java.patch @@ -0,0 +1,81 @@ +--- net/minecraft/src/NoiseGeneratorOctaves.java ++++ net/minecraft/src/NoiseGeneratorOctaves.java +@@ -3,34 +3,41 @@ + import java.util.Random; + + public class NoiseGeneratorOctaves extends NoiseGenerator { ++ ++ /** ++ * Collection of noise generation functions. Output is combined to produce different octaves of noise. ++ */ + private NoiseGeneratorPerlin[] generatorCollection; + private int octaves; + +- public NoiseGeneratorOctaves(Random var1, int var2) { +- this.octaves = var2; +- this.generatorCollection = new NoiseGeneratorPerlin[var2]; ++ public NoiseGeneratorOctaves(Random par1Random, int par2) { ++ this.octaves = par2; ++ this.generatorCollection = new NoiseGeneratorPerlin[par2]; + +- for(int var3 = 0; var3 < var2; ++var3) { +- this.generatorCollection[var3] = new NoiseGeneratorPerlin(var1); ++ for (int var3 = 0; var3 < par2; ++var3) { ++ this.generatorCollection[var3] = new NoiseGeneratorPerlin(par1Random); + } +- + } + +- public double[] generateNoiseOctaves(double[] var1, int var2, int var3, int var4, int var5, int var6, int var7, double var8, double var10, double var12) { +- if(var1 == null) { +- var1 = new double[var5 * var6 * var7]; ++ /** ++ * pars:(par2,3,4=noiseOffset ; so that adjacent noise segments connect) (pars5,6,7=x,y,zArraySize),(pars8,10,12 = ++ * x,y,z noiseScale) ++ */ ++ public double[] generateNoiseOctaves(double[] par1ArrayOfDouble, int par2, int par3, int par4, int par5, int par6, int par7, double par8, double par10, double par12) { ++ if (par1ArrayOfDouble == null) { ++ par1ArrayOfDouble = new double[par5 * par6 * par7]; + } else { +- for(int var14 = 0; var14 < var1.length; ++var14) { +- var1[var14] = 0.0D; ++ for (int var14 = 0; var14 < par1ArrayOfDouble.length; ++var14) { ++ par1ArrayOfDouble[var14] = 0.0D; + } + } + + double var27 = 1.0D; + +- for(int var16 = 0; var16 < this.octaves; ++var16) { +- double var17 = (double)var2 * var27 * var8; +- double var19 = (double)var3 * var27 * var10; +- double var21 = (double)var4 * var27 * var12; ++ for (int var16 = 0; var16 < this.octaves; ++var16) { ++ double var17 = (double)par2 * var27 * par8; ++ double var19 = (double)par3 * var27 * par10; ++ double var21 = (double)par4 * var27 * par12; + long var23 = MathHelper.floor_double_long(var17); + long var25 = MathHelper.floor_double_long(var21); + var17 -= (double)var23; +@@ -39,14 +46,17 @@ + var25 %= 16777216L; + var17 += (double)var23; + var21 += (double)var25; +- this.generatorCollection[var16].populateNoiseArray(var1, var17, var19, var21, var5, var6, var7, var8 * var27, var10 * var27, var12 * var27, var27); ++ this.generatorCollection[var16].populateNoiseArray(par1ArrayOfDouble, var17, var19, var21, par5, par6, par7, par8 * var27, par10 * var27, par12 * var27, var27); + var27 /= 2.0D; + } + +- return var1; ++ return par1ArrayOfDouble; + } + +- public double[] generateNoiseOctaves(double[] var1, int var2, int var3, int var4, int var5, double var6, double var8, double var10) { +- return this.generateNoiseOctaves(var1, var2, 10, var3, var4, 1, var5, var6, 1.0D, var8); ++ /** ++ * Bouncer function to the main one with some default arguments. ++ */ ++ public double[] generateNoiseOctaves(double[] par1ArrayOfDouble, int par2, int par3, int par4, int par5, double par6, double par8, double par10) { ++ return this.generateNoiseOctaves(par1ArrayOfDouble, par2, 10, par3, par4, 1, par5, par6, 1.0D, par8); + } + } diff --git a/patches/net/minecraft/src/NoiseGeneratorPerlin.java.patch b/patches/net/minecraft/src/NoiseGeneratorPerlin.java.patch new file mode 100644 index 0000000..17a83a8 --- /dev/null +++ b/patches/net/minecraft/src/NoiseGeneratorPerlin.java.patch @@ -0,0 +1,202 @@ +--- net/minecraft/src/NoiseGeneratorPerlin.java ++++ net/minecraft/src/NoiseGeneratorPerlin.java +@@ -12,45 +12,49 @@ + this(new Random()); + } + +- public NoiseGeneratorPerlin(Random var1) { ++ public NoiseGeneratorPerlin(Random par1Random) { + this.permutations = new int[512]; +- this.xCoord = var1.nextDouble() * 256.0D; +- this.yCoord = var1.nextDouble() * 256.0D; +- this.zCoord = var1.nextDouble() * 256.0D; +- ++ this.xCoord = par1Random.nextDouble() * 256.0D; ++ this.yCoord = par1Random.nextDouble() * 256.0D; ++ this.zCoord = par1Random.nextDouble() * 256.0D; + int var2; +- for(var2 = 0; var2 < 256; this.permutations[var2] = var2++) { ++ ++ for (var2 = 0; var2 < 256; this.permutations[var2] = var2++) { ++ ; + } + +- for(var2 = 0; var2 < 256; ++var2) { +- int var3 = var1.nextInt(256 - var2) + var2; ++ for (var2 = 0; var2 < 256; ++var2) { ++ int var3 = par1Random.nextInt(256 - var2) + var2; + int var4 = this.permutations[var2]; + this.permutations[var2] = this.permutations[var3]; + this.permutations[var3] = var4; + this.permutations[var2 + 256] = this.permutations[var2]; + } +- +- } +- +- public final double lerp(double var1, double var3, double var5) { +- return var3 + var1 * (var5 - var3); +- } +- +- public final double func_76309_a(int var1, double var2, double var4) { +- int var6 = var1 & 15; +- double var7 = (double)(1 - ((var6 & 8) >> 3)) * var2; +- double var9 = var6 < 4 ? 0.0D : (var6 != 12 && var6 != 14 ? var4 : var2); ++ } ++ ++ public final double lerp(double par1, double par3, double par5) { ++ return par3 + par1 * (par5 - par3); ++ } ++ ++ public final double func_76309_a(int par1, double par2, double par4) { ++ int var6 = par1 & 15; ++ double var7 = (double)(1 - ((var6 & 8) >> 3)) * par2; ++ double var9 = var6 < 4 ? 0.0D : (var6 != 12 && var6 != 14 ? par4 : par2); + return ((var6 & 1) == 0 ? var7 : -var7) + ((var6 & 2) == 0 ? var9 : -var9); + } + +- public final double grad(int var1, double var2, double var4, double var6) { +- int var8 = var1 & 15; +- double var9 = var8 < 8 ? var2 : var4; +- double var11 = var8 < 4 ? var4 : (var8 != 12 && var8 != 14 ? var6 : var2); ++ public final double grad(int par1, double par2, double par4, double par6) { ++ int var8 = par1 & 15; ++ double var9 = var8 < 8 ? par2 : par4; ++ double var11 = var8 < 4 ? par4 : (var8 != 12 && var8 != 14 ? par6 : par2); + return ((var8 & 1) == 0 ? var9 : -var9) + ((var8 & 2) == 0 ? var11 : -var11); + } + +- public void populateNoiseArray(double[] var1, double var2, double var4, double var6, int var8, int var9, int var10, double var11, double var13, double var15, double var17) { ++ /** ++ * pars: noiseArray , xOffset , yOffset , zOffset , xSize , ySize , zSize , xScale, yScale , zScale , noiseScale. ++ * noiseArray should be xSize*ySize*zSize in size ++ */ ++ public void populateNoiseArray(double[] par1ArrayOfDouble, double par2, double par4, double par6, int par8, int par9, int par10, double par11, double par13, double par15, double par17) { + int var10001; + int var19; + int var22; +@@ -62,7 +66,8 @@ + int var41; + double var42; + int var75; +- if(var9 == 1) { ++ ++ if (par9 == 1) { + boolean var64 = false; + boolean var65 = false; + boolean var21 = false; +@@ -70,12 +75,13 @@ + double var70 = 0.0D; + double var73 = 0.0D; + var75 = 0; +- double var77 = 1.0D / var17; ++ double var77 = 1.0D / par17; + +- for(int var30 = 0; var30 < var8; ++var30) { +- var31 = var2 + (double)var30 * var11 + this.xCoord; ++ for (int var30 = 0; var30 < par8; ++var30) { ++ var31 = par2 + (double)var30 * par11 + this.xCoord; + int var78 = (int)var31; +- if(var31 < (double)var78) { ++ ++ if (var31 < (double)var78) { + --var78; + } + +@@ -83,10 +89,11 @@ + var31 -= (double)var78; + var35 = var31 * var31 * var31 * (var31 * (var31 * 6.0D - 15.0D) + 10.0D); + +- for(var37 = 0; var37 < var10; ++var37) { +- var38 = var6 + (double)var37 * var15 + this.zCoord; ++ for (var37 = 0; var37 < par10; ++var37) { ++ var38 = par6 + (double)var37 * par15 + this.zCoord; + var40 = (int)var38; +- if(var38 < (double)var40) { ++ ++ if (var38 < (double)var40) { + --var40; + } + +@@ -101,13 +108,12 @@ + var73 = this.lerp(var35, this.grad(this.permutations[var66 + 1], var31, 0.0D, var38 - 1.0D), this.grad(this.permutations[var22 + 1], var31 - 1.0D, 0.0D, var38 - 1.0D)); + double var79 = this.lerp(var42, var70, var73); + var10001 = var75++; +- var1[var10001] += var79 * var77; ++ par1ArrayOfDouble[var10001] += var79 * var77; + } + } +- + } else { + var19 = 0; +- double var20 = 1.0D / var17; ++ double var20 = 1.0D / par17; + var22 = -1; + boolean var23 = false; + boolean var24 = false; +@@ -120,10 +126,11 @@ + double var33 = 0.0D; + var35 = 0.0D; + +- for(var37 = 0; var37 < var8; ++var37) { +- var38 = var2 + (double)var37 * var11 + this.xCoord; ++ for (var37 = 0; var37 < par8; ++var37) { ++ var38 = par2 + (double)var37 * par11 + this.xCoord; + var40 = (int)var38; +- if(var38 < (double)var40) { ++ ++ if (var38 < (double)var40) { + --var40; + } + +@@ -131,10 +138,11 @@ + var38 -= (double)var40; + var42 = var38 * var38 * var38 * (var38 * (var38 * 6.0D - 15.0D) + 10.0D); + +- for(int var44 = 0; var44 < var10; ++var44) { +- double var45 = var6 + (double)var44 * var15 + this.zCoord; ++ for (int var44 = 0; var44 < par10; ++var44) { ++ double var45 = par6 + (double)var44 * par15 + this.zCoord; + int var47 = (int)var45; +- if(var45 < (double)var47) { ++ ++ if (var45 < (double)var47) { + --var47; + } + +@@ -142,17 +150,19 @@ + var45 -= (double)var47; + double var49 = var45 * var45 * var45 * (var45 * (var45 * 6.0D - 15.0D) + 10.0D); + +- for(int var51 = 0; var51 < var9; ++var51) { +- double var52 = var4 + (double)var51 * var13 + this.yCoord; ++ for (int var51 = 0; var51 < par9; ++var51) { ++ double var52 = par4 + (double)var51 * par13 + this.yCoord; + int var54 = (int)var52; +- if(var52 < (double)var54) { ++ ++ if (var52 < (double)var54) { + --var54; + } + + int var55 = var54 & 255; + var52 -= (double)var54; + double var56 = var52 * var52 * var52 * (var52 * (var52 * 6.0D - 15.0D) + 10.0D); +- if(var51 == 0 || var55 != var22) { ++ ++ if (var51 == 0 || var55 != var22) { + var22 = var55; + int var69 = this.permutations[var41] + var55; + int var71 = this.permutations[var69] + var48; +@@ -170,11 +180,10 @@ + double var60 = this.lerp(var56, var33, var35); + double var62 = this.lerp(var49, var58, var60); + var10001 = var19++; +- var1[var10001] += var62 * var20; ++ par1ArrayOfDouble[var10001] += var62 * var20; + } + } + } +- + } + } + } diff --git a/patches/net/minecraft/src/NpcMerchant.java.patch b/patches/net/minecraft/src/NpcMerchant.java.patch new file mode 100644 index 0000000..d08ce01 --- /dev/null +++ b/patches/net/minecraft/src/NpcMerchant.java.patch @@ -0,0 +1,54 @@ +--- net/minecraft/src/NpcMerchant.java ++++ net/minecraft/src/NpcMerchant.java +@@ -1,33 +1,36 @@ + package net.minecraft.src; + + public class NpcMerchant implements IMerchant { ++ ++ /** Instance of Merchants Inventory. */ + private InventoryMerchant theMerchantInventory; ++ ++ /** This merchant's current player customer. */ + private EntityPlayer customer; ++ ++ /** The MerchantRecipeList instance. */ + private MerchantRecipeList recipeList; + +- public NpcMerchant(EntityPlayer var1) { +- this.customer = var1; +- this.theMerchantInventory = new InventoryMerchant(var1, this); ++ public NpcMerchant(EntityPlayer par1EntityPlayer) { ++ this.customer = par1EntityPlayer; ++ this.theMerchantInventory = new InventoryMerchant(par1EntityPlayer, this); + } + + public EntityPlayer getCustomer() { + return this.customer; + } + +- public void setCustomer(EntityPlayer var1) { +- } ++ public void setCustomer(EntityPlayer par1EntityPlayer) {} + +- public MerchantRecipeList getRecipes(EntityPlayer var1) { ++ public MerchantRecipeList getRecipes(EntityPlayer par1EntityPlayer) { + return this.recipeList; + } + +- public void setRecipes(MerchantRecipeList var1) { +- this.recipeList = var1; +- } +- +- public void useRecipe(MerchantRecipe var1) { +- } +- +- public void func_110297_a_(ItemStack var1) { +- } ++ public void setRecipes(MerchantRecipeList par1MerchantRecipeList) { ++ this.recipeList = par1MerchantRecipeList; ++ } ++ ++ public void useRecipe(MerchantRecipe par1MerchantRecipe) {} ++ ++ public void func_110297_a_(ItemStack par1ItemStack) {} + } diff --git a/patches/net/minecraft/src/NumberInvalidException.java.patch b/patches/net/minecraft/src/NumberInvalidException.java.patch new file mode 100644 index 0000000..025f050 --- /dev/null +++ b/patches/net/minecraft/src/NumberInvalidException.java.patch @@ -0,0 +1,12 @@ +--- net/minecraft/src/NumberInvalidException.java ++++ net/minecraft/src/NumberInvalidException.java +@@ -5,7 +5,7 @@ + this("commands.generic.num.invalid", new Object[0]); + } + +- public NumberInvalidException(String var1, Object... var2) { +- super(var1, var2); ++ public NumberInvalidException(String par1Str, Object ... par2ArrayOfObj) { ++ super(par1Str, par2ArrayOfObj); + } + } diff --git a/patches/net/minecraft/src/OpenGlCapsChecker.java.patch b/patches/net/minecraft/src/OpenGlCapsChecker.java.patch new file mode 100644 index 0000000..0e761a2 --- /dev/null +++ b/patches/net/minecraft/src/OpenGlCapsChecker.java.patch @@ -0,0 +1,13 @@ +--- net/minecraft/src/OpenGlCapsChecker.java ++++ net/minecraft/src/OpenGlCapsChecker.java +@@ -3,6 +3,10 @@ + import org.lwjgl.opengl.GLContext; + + public class OpenGlCapsChecker { ++ ++ /** ++ * Checks if we support OpenGL occlusion. ++ */ + public static boolean checkARBOcclusion() { + return GLContext.getCapabilities().GL_ARB_occlusion_query; + } diff --git a/patches/net/minecraft/src/OpenGlHelper.java.patch b/patches/net/minecraft/src/OpenGlHelper.java.patch new file mode 100644 index 0000000..93d6449 --- /dev/null +++ b/patches/net/minecraft/src/OpenGlHelper.java.patch @@ -0,0 +1,107 @@ +--- net/minecraft/src/OpenGlHelper.java ++++ net/minecraft/src/OpenGlHelper.java +@@ -5,46 +5,69 @@ + import org.lwjgl.opengl.GLContext; + + public class OpenGlHelper { ++ ++ /** ++ * An OpenGL constant corresponding to GL_TEXTURE0, used when setting data pertaining to auxiliary OpenGL texture ++ * units. ++ */ + public static int defaultTexUnit; ++ ++ /** ++ * An OpenGL constant corresponding to GL_TEXTURE1, used when setting data pertaining to auxiliary OpenGL texture ++ * units. ++ */ + public static int lightmapTexUnit; ++ ++ /** ++ * True if the renderer supports multitextures and the OpenGL version != 1.3 ++ */ + private static boolean useMultitextureARB; + ++ /** ++ * Initializes the texture constants to be used when rendering lightmap values ++ */ + public static void initializeTextures() { + useMultitextureARB = GLContext.getCapabilities().GL_ARB_multitexture && !GLContext.getCapabilities().OpenGL13; +- if(useMultitextureARB) { +- defaultTexUnit = '\u84c0'; +- lightmapTexUnit = '\u84c1'; +- } else { +- defaultTexUnit = '\u84c0'; +- lightmapTexUnit = '\u84c1'; +- } +- +- } +- +- public static void setActiveTexture(int var0) { +- if(useMultitextureARB) { +- ARBMultitexture.glActiveTextureARB(var0); +- } else { +- GL13.glActiveTexture(var0); +- } +- +- } +- +- public static void setClientActiveTexture(int var0) { +- if(useMultitextureARB) { +- ARBMultitexture.glClientActiveTextureARB(var0); +- } else { +- GL13.glClientActiveTexture(var0); +- } +- +- } +- +- public static void setLightmapTextureCoords(int var0, float var1, float var2) { +- if(useMultitextureARB) { +- ARBMultitexture.glMultiTexCoord2fARB(var0, var1, var2); +- } else { +- GL13.glMultiTexCoord2f(var0, var1, var2); +- } +- ++ ++ if (useMultitextureARB) { ++ defaultTexUnit = 33984; ++ lightmapTexUnit = 33985; ++ } else { ++ defaultTexUnit = 33984; ++ lightmapTexUnit = 33985; ++ } ++ } ++ ++ /** ++ * Sets the current lightmap texture to the specified OpenGL constant ++ */ ++ public static void setActiveTexture(int par0) { ++ if (useMultitextureARB) { ++ ARBMultitexture.glActiveTextureARB(par0); ++ } else { ++ GL13.glActiveTexture(par0); ++ } ++ } ++ ++ /** ++ * Sets the current lightmap texture to the specified OpenGL constant ++ */ ++ public static void setClientActiveTexture(int par0) { ++ if (useMultitextureARB) { ++ ARBMultitexture.glClientActiveTextureARB(par0); ++ } else { ++ GL13.glClientActiveTexture(par0); ++ } ++ } ++ ++ /** ++ * Sets the current coordinates of the given lightmap texture ++ */ ++ public static void setLightmapTextureCoords(int par0, float par1, float par2) { ++ if (useMultitextureARB) { ++ ARBMultitexture.glMultiTexCoord2fARB(par0, par1, par2); ++ } else { ++ GL13.glMultiTexCoord2f(par0, par1, par2); ++ } + } + } diff --git a/patches/net/minecraft/src/PackMetadataSection.java.patch b/patches/net/minecraft/src/PackMetadataSection.java.patch new file mode 100644 index 0000000..3c8b8b8 --- /dev/null +++ b/patches/net/minecraft/src/PackMetadataSection.java.patch @@ -0,0 +1,24 @@ +--- net/minecraft/src/PackMetadataSection.java ++++ net/minecraft/src/PackMetadataSection.java +@@ -1,16 +1,16 @@ + package net.minecraft.src; + + public class PackMetadataSection implements MetadataSection { +- private final String a; ++ private final String packDescription; + private final int packFormat; + +- public PackMetadataSection(String var1, int var2) { +- this.a = var1; +- this.packFormat = var2; ++ public PackMetadataSection(String par1Str, int par2) { ++ this.packDescription = par1Str; ++ this.packFormat = par2; + } + + public String getPackDescription() { +- return this.a; ++ return this.packDescription; + } + + public int getPackFormat() { diff --git a/patches/net/minecraft/src/PackMetadataSectionSerializer.java.patch b/patches/net/minecraft/src/PackMetadataSectionSerializer.java.patch new file mode 100644 index 0000000..68a7a98 --- /dev/null +++ b/patches/net/minecraft/src/PackMetadataSectionSerializer.java.patch @@ -0,0 +1,44 @@ +--- net/minecraft/src/PackMetadataSectionSerializer.java ++++ net/minecraft/src/PackMetadataSectionSerializer.java +@@ -8,29 +8,32 @@ + import java.lang.reflect.Type; + + public class PackMetadataSectionSerializer extends BaseMetadataSectionSerializer implements JsonSerializer { +- public PackMetadataSection func_110489_a(JsonElement var1, Type var2, JsonDeserializationContext var3) { +- JsonObject var4 = var1.getAsJsonObject(); ++ public PackMetadataSection func_110489_a(JsonElement par1JsonElement, Type par2Type, JsonDeserializationContext par3JsonDeserializationContext) { ++ JsonObject var4 = par1JsonElement.getAsJsonObject(); + String var5 = this.func_110486_a(var4.get("description"), "description", (String)null, 1, Integer.MAX_VALUE); + int var6 = this.func_110485_a(var4.get("pack_format"), "pack_format", (Integer)null, 1, Integer.MAX_VALUE); + return new PackMetadataSection(var5, var6); + } + +- public JsonElement func_110488_a(PackMetadataSection var1, Type var2, JsonSerializationContext var3) { ++ public JsonElement func_110488_a(PackMetadataSection par1PackMetadataSection, Type par2Type, JsonSerializationContext par3JsonSerializationContext) { + JsonObject var4 = new JsonObject(); +- var4.addProperty("pack_format", (Number)Integer.valueOf(var1.getPackFormat())); +- var4.addProperty("description", var1.getPackDescription()); ++ var4.addProperty("pack_format", Integer.valueOf(par1PackMetadataSection.getPackFormat())); ++ var4.addProperty("description", par1PackMetadataSection.getPackDescription()); + return var4; + } + ++ /** ++ * The name of this section type as it appears in JSON. ++ */ + public String getSectionName() { + return "pack"; + } + +- public Object deserialize(JsonElement var1, Type var2, JsonDeserializationContext var3) { +- return this.func_110489_a(var1, var2, var3); ++ public Object deserialize(JsonElement par1JsonElement, Type par2Type, JsonDeserializationContext par3JsonDeserializationContext) { ++ return this.func_110489_a(par1JsonElement, par2Type, par3JsonDeserializationContext); + } + +- public JsonElement serialize(Object var1, Type var2, JsonSerializationContext var3) { +- return this.func_110488_a((PackMetadataSection)var1, var2, var3); ++ public JsonElement serialize(Object par1Obj, Type par2Type, JsonSerializationContext par3JsonSerializationContext) { ++ return this.func_110488_a((PackMetadataSection)par1Obj, par2Type, par3JsonSerializationContext); + } + } diff --git a/patches/net/minecraft/src/Packet.java.patch b/patches/net/minecraft/src/Packet.java.patch new file mode 100644 index 0000000..ae0f534 --- /dev/null +++ b/patches/net/minecraft/src/Packet.java.patch @@ -0,0 +1,399 @@ +--- net/minecraft/src/Packet.java ++++ net/minecraft/src/Packet.java +@@ -9,157 +9,232 @@ + import java.util.HashSet; + import java.util.Map; + import java.util.Set; ++ + import net.minecraft.server.MinecraftServer; + + public abstract class Packet { ++ ++ /** Maps packet id to packet class */ + public static IntHashMap packetIdToClassMap = new IntHashMap(); +- private static Map a = new HashMap(); +- private static Set b = new HashSet(); +- private static Set c = new HashSet(); ++ ++ /** Maps packet class to packet id */ ++ private static Map packetClassToIdMap = new HashMap(); ++ ++ /** List of the client's packet IDs. */ ++ private static Set clientPacketIdList = new HashSet(); ++ ++ /** List of the server's packet IDs. */ ++ private static Set serverPacketIdList = new HashSet(); + protected ILogAgent field_98193_m; +- public final long creationTimeMillis = MinecraftServer.getCurrentTimeMillis(); ++ ++ /** the system time in milliseconds when this packet was created. */ ++ public final long creationTimeMillis = MinecraftServer.getSystemTimeMillis(); + public static long receivedID; + public static long receivedSize; ++ ++ /** Assumed to be sequential by the profiler. */ + public static long sentID; + public static long sentSize; ++ ++ /** ++ * Only true for Packet51MapChunk, Packet52MultiBlockChange, Packet53BlockChange and Packet59ComplexEntity. Used to ++ * separate them into a different send queue. ++ */ + public boolean isChunkDataPacket; + +- static void addIdClassMapping(int var0, boolean var1, boolean var2, Class var3) { +- if(packetIdToClassMap.containsItem(var0)) { +- throw new IllegalArgumentException("Duplicate packet id:" + var0); +- } else if(a.containsKey(var3)) { +- throw new IllegalArgumentException("Duplicate packet class:" + var3); ++ /** ++ * Adds a two way mapping between the packet ID and packet class. ++ */ ++ // Spout Start - static to public static ++ public static void addIdClassMapping(int par0, boolean par1, boolean par2, Class par3Class) { ++ // Spout End ++ if (packetIdToClassMap.containsItem(par0)) { ++ throw new IllegalArgumentException("Duplicate packet id:" + par0); ++ } else if (packetClassToIdMap.containsKey(par3Class)) { ++ throw new IllegalArgumentException("Duplicate packet class:" + par3Class); + } else { +- packetIdToClassMap.addKey(var0, var3); +- a.put(var3, Integer.valueOf(var0)); +- if(var1) { +- b.add(Integer.valueOf(var0)); +- } +- +- if(var2) { +- c.add(Integer.valueOf(var0)); +- } +- ++ packetIdToClassMap.addKey(par0, par3Class); ++ packetClassToIdMap.put(par3Class, Integer.valueOf(par0)); ++ ++ if (par1) { ++ clientPacketIdList.add(Integer.valueOf(par0)); ++ } ++ ++ if (par2) { ++ serverPacketIdList.add(Integer.valueOf(par0)); ++ } + } + } + +- public static Packet getNewPacket(ILogAgent var0, int var1) { ++ /** ++ * Returns a new instance of the specified Packet class. ++ */ ++ public static Packet getNewPacket(ILogAgent par0ILogAgent, int par1) { + try { +- Class var2 = (Class)packetIdToClassMap.lookup(var1); ++ Class var2 = (Class)packetIdToClassMap.lookup(par1); + return var2 == null ? null : (Packet)var2.newInstance(); + } catch (Exception var3) { + var3.printStackTrace(); +- var0.logSevere("Skipping packet with id " + var1); ++ par0ILogAgent.logSevere("Skipping packet with id " + par1); + return null; + } + } + +- public static void writeByteArray(DataOutput var0, byte[] var1) throws IOException { +- var0.writeShort(var1.length); +- var0.write(var1); ++ /** ++ * Writes a byte array to the DataOutputStream ++ */ ++ public static void writeByteArray(DataOutput par0DataOutput, byte[] par1ArrayOfByte) throws IOException { ++ par0DataOutput.writeShort(par1ArrayOfByte.length); ++ par0DataOutput.write(par1ArrayOfByte); + } + +- public static byte[] readBytesFromStream(DataInput var0) throws IOException { +- short var1 = var0.readShort(); +- if(var1 < 0) { ++ /** ++ * the first short in the stream indicates the number of bytes to read ++ */ ++ public static byte[] readBytesFromStream(DataInput par0DataInput) throws IOException { ++ short var1 = par0DataInput.readShort(); ++ ++ if (var1 < 0) { + throw new IOException("Key was smaller than nothing! Weird key!"); + } else { + byte[] var2 = new byte[var1]; +- var0.readFully(var2); ++ par0DataInput.readFully(var2); + return var2; + } + } + ++ /** ++ * Returns the ID of this packet. ++ */ + public final int getPacketId() { +- return ((Integer)a.get(this.getClass())).intValue(); ++ return ((Integer)packetClassToIdMap.get(this.getClass())).intValue(); + } + +- public static Packet readPacket(ILogAgent var0, DataInput var1, boolean var2, Socket var3) throws IOException { ++ /** ++ * Read a packet, prefixed by its ID, from the data stream. ++ */ ++ public static Packet readPacket(ILogAgent par0ILogAgent, DataInput par1DataInput, boolean par2, Socket par3Socket) throws IOException { + boolean var4 = false; + Packet var5 = null; +- int var6 = var3.getSoTimeout(); +- ++ int var6 = par3Socket.getSoTimeout(); + int var9; ++ + try { +- var9 = var1.readUnsignedByte(); +- if(var2 && !c.contains(Integer.valueOf(var9)) || !var2 && !b.contains(Integer.valueOf(var9))) { +- throw new IOException("Bad packet id " + var9); +- } +- +- var5 = getNewPacket(var0, var9); +- if(var5 == null) { +- throw new IOException("Bad packet id " + var9); +- } +- +- var5.field_98193_m = var0; +- if(var5 instanceof Packet254ServerPing) { +- var3.setSoTimeout(1500); +- } +- +- var5.readPacketData(var1); ++ var9 = par1DataInput.readUnsignedByte(); ++ ++ if (par2 && !serverPacketIdList.contains(Integer.valueOf(var9)) || !par2 && !clientPacketIdList.contains(Integer.valueOf(var9))) { ++ throw new IOException("Bad packet id " + var9); ++ } ++ ++ var5 = getNewPacket(par0ILogAgent, var9); ++ ++ if (var5 == null) { ++ throw new IOException("Bad packet id " + var9); ++ } ++ ++ var5.field_98193_m = par0ILogAgent; ++ ++ if (var5 instanceof Packet254ServerPing) { ++ par3Socket.setSoTimeout(1500); ++ } ++ ++ var5.readPacketData(par1DataInput); + ++receivedID; + receivedSize += (long)var5.getPacketSize(); + } catch (EOFException var8) { +- var0.logSevere("Reached end of stream for " + var3.getInetAddress()); ++ par0ILogAgent.logSevere("Reached end of stream for " + par3Socket.getInetAddress()); + return null; + } + + PacketCount.countPacket(var9, (long)var5.getPacketSize()); + ++receivedID; + receivedSize += (long)var5.getPacketSize(); +- var3.setSoTimeout(var6); ++ par3Socket.setSoTimeout(var6); + return var5; + } + +- public static void writePacket(Packet var0, DataOutput var1) throws IOException { +- var1.write(var0.getPacketId()); +- var0.writePacketData(var1); ++ /** ++ * Writes a packet, prefixed by its ID, to the data stream. ++ */ ++ public static void writePacket(Packet par0Packet, DataOutput par1DataOutput) throws IOException { ++ par1DataOutput.write(par0Packet.getPacketId()); ++ par0Packet.writePacketData(par1DataOutput); + ++sentID; +- sentSize += (long)var0.getPacketSize(); ++ sentSize += (long)par0Packet.getPacketSize(); + } + +- public static void writeString(String var0, DataOutput var1) throws IOException { +- if(var0.length() > Short.MAX_VALUE) { ++ /** ++ * Writes a String to the DataOutputStream ++ */ ++ public static void writeString(String par0Str, DataOutput par1DataOutput) throws IOException { ++ if (par0Str.length() > 32767) { + throw new IOException("String too big"); + } else { +- var1.writeShort(var0.length()); +- var1.writeChars(var0); ++ par1DataOutput.writeShort(par0Str.length()); ++ par1DataOutput.writeChars(par0Str); + } + } + +- public static String readString(DataInput var0, int var1) throws IOException { +- short var2 = var0.readShort(); +- if(var2 > var1) { +- throw new IOException("Received string length longer than maximum allowed (" + var2 + " > " + var1 + ")"); +- } else if(var2 < 0) { ++ /** ++ * Reads a string from a packet ++ */ ++ public static String readString(DataInput par0DataInput, int par1) throws IOException { ++ short var2 = par0DataInput.readShort(); ++ ++ if (var2 > par1) { ++ throw new IOException("Received string length longer than maximum allowed (" + var2 + " > " + par1 + ")"); ++ } else if (var2 < 0) { + throw new IOException("Received string length is less than zero! Weird string!"); + } else { + StringBuilder var3 = new StringBuilder(); + +- for(int var4 = 0; var4 < var2; ++var4) { +- var3.append(var0.readChar()); ++ for (int var4 = 0; var4 < var2; ++var4) { ++ var3.append(par0DataInput.readChar()); + } + + return var3.toString(); + } + } + ++ /** ++ * Abstract. Reads the raw packet data from the data stream. ++ */ + public abstract void readPacketData(DataInput var1) throws IOException; + ++ /** ++ * Abstract. Writes the raw packet data to the data stream. ++ */ + public abstract void writePacketData(DataOutput var1) throws IOException; + ++ /** ++ * Passes this Packet on to the NetHandler for processing. ++ */ + public abstract void processPacket(NetHandler var1); + ++ /** ++ * Abstract. Return the size of the packet (not counting the header). ++ */ + public abstract int getPacketSize(); + ++ /** ++ * only false for the abstract Packet class, all real packets return true ++ */ + public boolean isRealPacket() { + return false; + } + +- public boolean containsSameEntityIDAs(Packet var1) { ++ /** ++ * eg return packet30entity.entityId == entityId; WARNING : will throw if you compare a packet to a different packet ++ * class ++ */ ++ public boolean containsSameEntityIDAs(Packet par1Packet) { + return false; + } + ++ /** ++ * If this returns true, the packet may be processed on any thread; otherwise it is queued for the main thread to ++ * handle. ++ */ + public boolean canProcessAsync() { + return false; + } +@@ -169,56 +244,69 @@ + return var1; + } + +- public static ItemStack readItemStack(DataInput var0) throws IOException { ++ /** ++ * Reads a ItemStack from the InputStream ++ */ ++ public static ItemStack readItemStack(DataInput par0DataInput) throws IOException { + ItemStack var1 = null; +- short var2 = var0.readShort(); +- if(var2 >= 0) { +- byte var3 = var0.readByte(); +- short var4 = var0.readShort(); ++ short var2 = par0DataInput.readShort(); ++ ++ if (var2 >= 0) { ++ byte var3 = par0DataInput.readByte(); ++ short var4 = par0DataInput.readShort(); + var1 = new ItemStack(var2, var3, var4); +- var1.stackTagCompound = readNBTTagCompound(var0); ++ var1.stackTagCompound = readNBTTagCompound(par0DataInput); + } + + return var1; + } + +- public static void writeItemStack(ItemStack var0, DataOutput var1) throws IOException { +- if(var0 == null) { +- var1.writeShort(-1); ++ /** ++ * Writes the ItemStack's ID (short), then size (byte), then damage. (short) ++ */ ++ public static void writeItemStack(ItemStack par0ItemStack, DataOutput par1DataOutput) throws IOException { ++ if (par0ItemStack == null) { ++ par1DataOutput.writeShort(-1); + } else { +- var1.writeShort(var0.itemID); +- var1.writeByte(var0.stackSize); +- var1.writeShort(var0.getItemDamage()); ++ par1DataOutput.writeShort(par0ItemStack.itemID); ++ par1DataOutput.writeByte(par0ItemStack.stackSize); ++ par1DataOutput.writeShort(par0ItemStack.getItemDamage()); + NBTTagCompound var2 = null; +- if(var0.getItem().isDamageable() || var0.getItem().getShareTag()) { +- var2 = var0.stackTagCompound; ++ ++ if (par0ItemStack.getItem().isDamageable() || par0ItemStack.getItem().getShareTag()) { ++ var2 = par0ItemStack.stackTagCompound; + } + +- writeNBTTagCompound(var2, var1); ++ writeNBTTagCompound(var2, par1DataOutput); + } +- + } + +- public static NBTTagCompound readNBTTagCompound(DataInput var0) throws IOException { +- short var1 = var0.readShort(); +- if(var1 < 0) { ++ /** ++ * Reads a compressed NBTTagCompound from the InputStream ++ */ ++ public static NBTTagCompound readNBTTagCompound(DataInput par0DataInput) throws IOException { ++ short var1 = par0DataInput.readShort(); ++ ++ if (var1 < 0) { + return null; + } else { + byte[] var2 = new byte[var1]; +- var0.readFully(var2); ++ par0DataInput.readFully(var2); + return CompressedStreamTools.decompress(var2); + } + } + +- protected static void writeNBTTagCompound(NBTTagCompound var0, DataOutput var1) throws IOException { +- if(var0 == null) { +- var1.writeShort(-1); ++ /** ++ * Writes a compressed NBTTagCompound to the OutputStream ++ */ ++ protected static void writeNBTTagCompound(NBTTagCompound par0NBTTagCompound, DataOutput par1DataOutput) throws IOException { ++ if (par0NBTTagCompound == null) { ++ par1DataOutput.writeShort(-1); + } else { +- byte[] var2 = CompressedStreamTools.compress(var0); +- var1.writeShort((short)var2.length); +- var1.write(var2); ++ byte[] var2 = CompressedStreamTools.compress(par0NBTTagCompound); ++ par1DataOutput.writeShort((short)var2.length); ++ par1DataOutput.write(var2); + } +- + } + + static { diff --git a/patches/net/minecraft/src/Packet0KeepAlive.java.patch b/patches/net/minecraft/src/Packet0KeepAlive.java.patch new file mode 100644 index 0000000..c94e0e9 --- /dev/null +++ b/patches/net/minecraft/src/Packet0KeepAlive.java.patch @@ -0,0 +1,82 @@ +--- net/minecraft/src/Packet0KeepAlive.java ++++ net/minecraft/src/Packet0KeepAlive.java +@@ -7,37 +7,59 @@ + public class Packet0KeepAlive extends Packet { + public int randomId; + +- public Packet0KeepAlive() { +- } +- +- public Packet0KeepAlive(int var1) { +- this.randomId = var1; +- } +- +- public void processPacket(NetHandler var1) { +- var1.handleKeepAlive(this); +- } +- +- public void readPacketData(DataInput var1) throws IOException { +- this.randomId = var1.readInt(); +- } +- +- public void writePacketData(DataOutput var1) throws IOException { +- var1.writeInt(this.randomId); +- } +- ++ public Packet0KeepAlive() {} ++ ++ public Packet0KeepAlive(int par1) { ++ this.randomId = par1; ++ } ++ ++ /** ++ * Passes this Packet on to the NetHandler for processing. ++ */ ++ public void processPacket(NetHandler par1NetHandler) { ++ par1NetHandler.handleKeepAlive(this); ++ } ++ ++ /** ++ * Abstract. Reads the raw packet data from the data stream. ++ */ ++ public void readPacketData(DataInput par1DataInput) throws IOException { ++ this.randomId = par1DataInput.readInt(); ++ } ++ ++ /** ++ * Abstract. Writes the raw packet data to the data stream. ++ */ ++ public void writePacketData(DataOutput par1DataOutput) throws IOException { ++ par1DataOutput.writeInt(this.randomId); ++ } ++ ++ /** ++ * Abstract. Return the size of the packet (not counting the header). ++ */ + public int getPacketSize() { + return 4; + } + ++ /** ++ * only false for the abstract Packet class, all real packets return true ++ */ + public boolean isRealPacket() { + return true; + } + +- public boolean containsSameEntityIDAs(Packet var1) { ++ /** ++ * eg return packet30entity.entityId == entityId; WARNING : will throw if you compare a packet to a different packet ++ * class ++ */ ++ public boolean containsSameEntityIDAs(Packet par1Packet) { + return true; + } + ++ /** ++ * If this returns true, the packet may be processed on any thread; otherwise it is queued for the main thread to ++ * handle. ++ */ + public boolean canProcessAsync() { + return true; + } diff --git a/patches/net/minecraft/src/Packet100OpenWindow.java.patch b/patches/net/minecraft/src/Packet100OpenWindow.java.patch new file mode 100644 index 0000000..af00d8d --- /dev/null +++ b/patches/net/minecraft/src/Packet100OpenWindow.java.patch @@ -0,0 +1,121 @@ +--- net/minecraft/src/Packet100OpenWindow.java ++++ net/minecraft/src/Packet100OpenWindow.java +@@ -7,56 +7,72 @@ + public class Packet100OpenWindow extends Packet { + public int windowId; + public int inventoryType; +- public String c; ++ public String windowTitle; + public int slotsCount; ++ ++ /** ++ * If false, the client will look up a string like "window.minecart". If true, the client uses what the server ++ * provides. ++ */ + public boolean useProvidedWindowTitle; + public int field_111008_f; + +- public Packet100OpenWindow() { +- } +- +- public Packet100OpenWindow(int var1, int var2, String var3, int var4, boolean var5) { +- this.windowId = var1; +- this.inventoryType = var2; +- this.c = var3; +- this.slotsCount = var4; +- this.useProvidedWindowTitle = var5; +- } +- +- public Packet100OpenWindow(int var1, int var2, String var3, int var4, boolean var5, int var6) { +- this(var1, var2, var3, var4, var5); +- this.field_111008_f = var6; +- } +- +- public void processPacket(NetHandler var1) { +- var1.handleOpenWindow(this); +- } +- +- public void readPacketData(DataInput var1) throws IOException { +- this.windowId = var1.readByte() & 255; +- this.inventoryType = var1.readByte() & 255; +- this.c = readString(var1, 32); +- this.slotsCount = var1.readByte() & 255; +- this.useProvidedWindowTitle = var1.readBoolean(); +- if(this.inventoryType == 11) { +- this.field_111008_f = var1.readInt(); +- } +- +- } +- +- public void writePacketData(DataOutput var1) throws IOException { +- var1.writeByte(this.windowId & 255); +- var1.writeByte(this.inventoryType & 255); +- writeString(this.c, var1); +- var1.writeByte(this.slotsCount & 255); +- var1.writeBoolean(this.useProvidedWindowTitle); +- if(this.inventoryType == 11) { +- var1.writeInt(this.field_111008_f); +- } +- +- } +- ++ public Packet100OpenWindow() {} ++ ++ public Packet100OpenWindow(int par1, int par2, String par3Str, int par4, boolean par5) { ++ this.windowId = par1; ++ this.inventoryType = par2; ++ this.windowTitle = par3Str; ++ this.slotsCount = par4; ++ this.useProvidedWindowTitle = par5; ++ } ++ ++ public Packet100OpenWindow(int par1, int par2, String par3Str, int par4, boolean par5, int par6) { ++ this(par1, par2, par3Str, par4, par5); ++ this.field_111008_f = par6; ++ } ++ ++ /** ++ * Passes this Packet on to the NetHandler for processing. ++ */ ++ public void processPacket(NetHandler par1NetHandler) { ++ par1NetHandler.handleOpenWindow(this); ++ } ++ ++ /** ++ * Abstract. Reads the raw packet data from the data stream. ++ */ ++ public void readPacketData(DataInput par1DataInput) throws IOException { ++ this.windowId = par1DataInput.readByte() & 255; ++ this.inventoryType = par1DataInput.readByte() & 255; ++ this.windowTitle = readString(par1DataInput, 32); ++ this.slotsCount = par1DataInput.readByte() & 255; ++ this.useProvidedWindowTitle = par1DataInput.readBoolean(); ++ ++ if (this.inventoryType == 11) { ++ this.field_111008_f = par1DataInput.readInt(); ++ } ++ } ++ ++ /** ++ * Abstract. Writes the raw packet data to the data stream. ++ */ ++ public void writePacketData(DataOutput par1DataOutput) throws IOException { ++ par1DataOutput.writeByte(this.windowId & 255); ++ par1DataOutput.writeByte(this.inventoryType & 255); ++ writeString(this.windowTitle, par1DataOutput); ++ par1DataOutput.writeByte(this.slotsCount & 255); ++ par1DataOutput.writeBoolean(this.useProvidedWindowTitle); ++ ++ if (this.inventoryType == 11) { ++ par1DataOutput.writeInt(this.field_111008_f); ++ } ++ } ++ ++ /** ++ * Abstract. Return the size of the packet (not counting the header). ++ */ + public int getPacketSize() { +- return this.inventoryType == 11 ? 8 + this.c.length() : 4 + this.c.length(); ++ return this.inventoryType == 11 ? 8 + this.windowTitle.length() : 4 + this.windowTitle.length(); + } + } diff --git a/patches/net/minecraft/src/Packet101CloseWindow.java.patch b/patches/net/minecraft/src/Packet101CloseWindow.java.patch new file mode 100644 index 0000000..41e8586 --- /dev/null +++ b/patches/net/minecraft/src/Packet101CloseWindow.java.patch @@ -0,0 +1,58 @@ +--- net/minecraft/src/Packet101CloseWindow.java ++++ net/minecraft/src/Packet101CloseWindow.java +@@ -7,25 +7,36 @@ + public class Packet101CloseWindow extends Packet { + public int windowId; + +- public Packet101CloseWindow() { +- } +- +- public Packet101CloseWindow(int var1) { +- this.windowId = var1; +- } +- +- public void processPacket(NetHandler var1) { +- var1.handleCloseWindow(this); +- } +- +- public void readPacketData(DataInput var1) throws IOException { +- this.windowId = var1.readByte(); +- } +- +- public void writePacketData(DataOutput var1) throws IOException { +- var1.writeByte(this.windowId); +- } +- ++ public Packet101CloseWindow() {} ++ ++ public Packet101CloseWindow(int par1) { ++ this.windowId = par1; ++ } ++ ++ /** ++ * Passes this Packet on to the NetHandler for processing. ++ */ ++ public void processPacket(NetHandler par1NetHandler) { ++ par1NetHandler.handleCloseWindow(this); ++ } ++ ++ /** ++ * Abstract. Reads the raw packet data from the data stream. ++ */ ++ public void readPacketData(DataInput par1DataInput) throws IOException { ++ this.windowId = par1DataInput.readByte(); ++ } ++ ++ /** ++ * Abstract. Writes the raw packet data to the data stream. ++ */ ++ public void writePacketData(DataOutput par1DataOutput) throws IOException { ++ par1DataOutput.writeByte(this.windowId); ++ } ++ ++ /** ++ * Abstract. Return the size of the packet (not counting the header). ++ */ + public int getPacketSize() { + return 1; + } diff --git a/patches/net/minecraft/src/Packet102WindowClick.java.patch b/patches/net/minecraft/src/Packet102WindowClick.java.patch new file mode 100644 index 0000000..71181c3 --- /dev/null +++ b/patches/net/minecraft/src/Packet102WindowClick.java.patch @@ -0,0 +1,105 @@ +--- net/minecraft/src/Packet102WindowClick.java ++++ net/minecraft/src/Packet102WindowClick.java +@@ -5,47 +5,68 @@ + import java.io.IOException; + + public class Packet102WindowClick extends Packet { ++ ++ /** The id of the window which was clicked. 0 for player inventory. */ + public int window_Id; ++ ++ /** The clicked slot (-999 is outside of inventory) */ + public int inventorySlot; ++ ++ /** 1 when right-clicking and otherwise 0 */ + public int mouseClick; ++ ++ /** A unique number for the action, used for transaction handling */ + public short action; ++ ++ /** Item stack for inventory */ + public ItemStack itemStack; + public int holdingShift; + +- public Packet102WindowClick() { +- } +- +- public Packet102WindowClick(int var1, int var2, int var3, int var4, ItemStack var5, short var6) { +- this.window_Id = var1; +- this.inventorySlot = var2; +- this.mouseClick = var3; +- this.itemStack = var5 != null ? var5.copy() : null; +- this.action = var6; +- this.holdingShift = var4; +- } +- +- public void processPacket(NetHandler var1) { +- var1.handleWindowClick(this); +- } +- +- public void readPacketData(DataInput var1) throws IOException { +- this.window_Id = var1.readByte(); +- this.inventorySlot = var1.readShort(); +- this.mouseClick = var1.readByte(); +- this.action = var1.readShort(); +- this.holdingShift = var1.readByte(); +- this.itemStack = readItemStack(var1); +- } +- +- public void writePacketData(DataOutput var1) throws IOException { +- var1.writeByte(this.window_Id); +- var1.writeShort(this.inventorySlot); +- var1.writeByte(this.mouseClick); +- var1.writeShort(this.action); +- var1.writeByte(this.holdingShift); +- writeItemStack(this.itemStack, var1); +- } +- ++ public Packet102WindowClick() {} ++ ++ public Packet102WindowClick(int par1, int par2, int par3, int par4, ItemStack par5ItemStack, short par6) { ++ this.window_Id = par1; ++ this.inventorySlot = par2; ++ this.mouseClick = par3; ++ this.itemStack = par5ItemStack != null ? par5ItemStack.copy() : null; ++ this.action = par6; ++ this.holdingShift = par4; ++ } ++ ++ /** ++ * Passes this Packet on to the NetHandler for processing. ++ */ ++ public void processPacket(NetHandler par1NetHandler) { ++ par1NetHandler.handleWindowClick(this); ++ } ++ ++ /** ++ * Abstract. Reads the raw packet data from the data stream. ++ */ ++ public void readPacketData(DataInput par1DataInput) throws IOException { ++ this.window_Id = par1DataInput.readByte(); ++ this.inventorySlot = par1DataInput.readShort(); ++ this.mouseClick = par1DataInput.readByte(); ++ this.action = par1DataInput.readShort(); ++ this.holdingShift = par1DataInput.readByte(); ++ this.itemStack = readItemStack(par1DataInput); ++ } ++ ++ /** ++ * Abstract. Writes the raw packet data to the data stream. ++ */ ++ public void writePacketData(DataOutput par1DataOutput) throws IOException { ++ par1DataOutput.writeByte(this.window_Id); ++ par1DataOutput.writeShort(this.inventorySlot); ++ par1DataOutput.writeByte(this.mouseClick); ++ par1DataOutput.writeShort(this.action); ++ par1DataOutput.writeByte(this.holdingShift); ++ writeItemStack(this.itemStack, par1DataOutput); ++ } ++ ++ /** ++ * Abstract. Return the size of the packet (not counting the header). ++ */ + public int getPacketSize() { + return 11; + } diff --git a/patches/net/minecraft/src/Packet103SetSlot.java.patch b/patches/net/minecraft/src/Packet103SetSlot.java.patch new file mode 100644 index 0000000..f8355e7 --- /dev/null +++ b/patches/net/minecraft/src/Packet103SetSlot.java.patch @@ -0,0 +1,80 @@ +--- net/minecraft/src/Packet103SetSlot.java ++++ net/minecraft/src/Packet103SetSlot.java +@@ -5,35 +5,52 @@ + import java.io.IOException; + + public class Packet103SetSlot extends Packet { ++ ++ /** The window which is being updated. 0 for player inventory */ + public int windowId; ++ ++ /** Slot that should be updated */ + public int itemSlot; ++ ++ /** Item stack */ + public ItemStack myItemStack; + +- public Packet103SetSlot() { +- } +- +- public Packet103SetSlot(int var1, int var2, ItemStack var3) { +- this.windowId = var1; +- this.itemSlot = var2; +- this.myItemStack = var3 == null ? var3 : var3.copy(); +- } +- +- public void processPacket(NetHandler var1) { +- var1.handleSetSlot(this); +- } +- +- public void readPacketData(DataInput var1) throws IOException { +- this.windowId = var1.readByte(); +- this.itemSlot = var1.readShort(); +- this.myItemStack = readItemStack(var1); +- } +- +- public void writePacketData(DataOutput var1) throws IOException { +- var1.writeByte(this.windowId); +- var1.writeShort(this.itemSlot); +- writeItemStack(this.myItemStack, var1); +- } +- ++ public Packet103SetSlot() {} ++ ++ public Packet103SetSlot(int par1, int par2, ItemStack par3ItemStack) { ++ this.windowId = par1; ++ this.itemSlot = par2; ++ this.myItemStack = par3ItemStack == null ? par3ItemStack : par3ItemStack.copy(); ++ } ++ ++ /** ++ * Passes this Packet on to the NetHandler for processing. ++ */ ++ public void processPacket(NetHandler par1NetHandler) { ++ par1NetHandler.handleSetSlot(this); ++ } ++ ++ /** ++ * Abstract. Reads the raw packet data from the data stream. ++ */ ++ public void readPacketData(DataInput par1DataInput) throws IOException { ++ this.windowId = par1DataInput.readByte(); ++ this.itemSlot = par1DataInput.readShort(); ++ this.myItemStack = readItemStack(par1DataInput); ++ } ++ ++ /** ++ * Abstract. Writes the raw packet data to the data stream. ++ */ ++ public void writePacketData(DataOutput par1DataOutput) throws IOException { ++ par1DataOutput.writeByte(this.windowId); ++ par1DataOutput.writeShort(this.itemSlot); ++ writeItemStack(this.myItemStack, par1DataOutput); ++ } ++ ++ /** ++ * Abstract. Return the size of the packet (not counting the header). ++ */ + public int getPacketSize() { + return 8; + } diff --git a/patches/net/minecraft/src/Packet104WindowItems.java.patch b/patches/net/minecraft/src/Packet104WindowItems.java.patch new file mode 100644 index 0000000..c97249d --- /dev/null +++ b/patches/net/minecraft/src/Packet104WindowItems.java.patch @@ -0,0 +1,98 @@ +--- net/minecraft/src/Packet104WindowItems.java ++++ net/minecraft/src/Packet104WindowItems.java +@@ -6,48 +6,62 @@ + import java.util.List; + + public class Packet104WindowItems extends Packet { ++ ++ /** ++ * The id of window which items are being sent for. 0 for player inventory. ++ */ + public int windowId; ++ ++ /** Stack of items */ + public ItemStack[] itemStack; + +- public Packet104WindowItems() { +- } +- +- public Packet104WindowItems(int var1, List var2) { +- this.windowId = var1; +- this.itemStack = new ItemStack[var2.size()]; +- +- for(int var3 = 0; var3 < this.itemStack.length; ++var3) { +- ItemStack var4 = (ItemStack)var2.get(var3); ++ public Packet104WindowItems() {} ++ ++ public Packet104WindowItems(int par1, List par2List) { ++ this.windowId = par1; ++ this.itemStack = new ItemStack[par2List.size()]; ++ ++ for (int var3 = 0; var3 < this.itemStack.length; ++var3) { ++ ItemStack var4 = (ItemStack)par2List.get(var3); + this.itemStack[var3] = var4 == null ? null : var4.copy(); + } +- + } + +- public void readPacketData(DataInput var1) throws IOException { +- this.windowId = var1.readByte(); +- short var2 = var1.readShort(); ++ /** ++ * Abstract. Reads the raw packet data from the data stream. ++ */ ++ public void readPacketData(DataInput par1DataInput) throws IOException { ++ this.windowId = par1DataInput.readByte(); ++ short var2 = par1DataInput.readShort(); + this.itemStack = new ItemStack[var2]; + +- for(int var3 = 0; var3 < var2; ++var3) { +- this.itemStack[var3] = readItemStack(var1); +- } +- +- } +- +- public void writePacketData(DataOutput var1) throws IOException { +- var1.writeByte(this.windowId); +- var1.writeShort(this.itemStack.length); +- +- for(int var2 = 0; var2 < this.itemStack.length; ++var2) { +- writeItemStack(this.itemStack[var2], var1); +- } +- +- } +- +- public void processPacket(NetHandler var1) { +- var1.handleWindowItems(this); +- } +- ++ for (int var3 = 0; var3 < var2; ++var3) { ++ this.itemStack[var3] = readItemStack(par1DataInput); ++ } ++ } ++ ++ /** ++ * Abstract. Writes the raw packet data to the data stream. ++ */ ++ public void writePacketData(DataOutput par1DataOutput) throws IOException { ++ par1DataOutput.writeByte(this.windowId); ++ par1DataOutput.writeShort(this.itemStack.length); ++ ++ for (int var2 = 0; var2 < this.itemStack.length; ++var2) { ++ writeItemStack(this.itemStack[var2], par1DataOutput); ++ } ++ } ++ ++ /** ++ * Passes this Packet on to the NetHandler for processing. ++ */ ++ public void processPacket(NetHandler par1NetHandler) { ++ par1NetHandler.handleWindowItems(this); ++ } ++ ++ /** ++ * Abstract. Return the size of the packet (not counting the header). ++ */ + public int getPacketSize() { + return 3 + this.itemStack.length * 5; + } diff --git a/patches/net/minecraft/src/Packet105UpdateProgressbar.java.patch b/patches/net/minecraft/src/Packet105UpdateProgressbar.java.patch new file mode 100644 index 0000000..704d1b1 --- /dev/null +++ b/patches/net/minecraft/src/Packet105UpdateProgressbar.java.patch @@ -0,0 +1,86 @@ +--- net/minecraft/src/Packet105UpdateProgressbar.java ++++ net/minecraft/src/Packet105UpdateProgressbar.java +@@ -5,35 +5,58 @@ + import java.io.IOException; + + public class Packet105UpdateProgressbar extends Packet { ++ ++ /** The id of the window that the progress bar is in. */ + public int windowId; ++ ++ /** ++ * Which of the progress bars that should be updated. (For furnaces, 0 = progress arrow, 1 = fire icon) ++ */ + public int progressBar; ++ ++ /** ++ * The value of the progress bar. The maximum values vary depending on the progress bar. Presumably the values are ++ * specified as in-game ticks. Some progress bar values increase, while others decrease. For furnaces, 0 is empty, full ++ * progress arrow = about 180, full fire icon = about 250) ++ */ + public int progressBarValue; + +- public Packet105UpdateProgressbar() { +- } +- +- public Packet105UpdateProgressbar(int var1, int var2, int var3) { +- this.windowId = var1; +- this.progressBar = var2; +- this.progressBarValue = var3; +- } +- +- public void processPacket(NetHandler var1) { +- var1.handleUpdateProgressbar(this); +- } +- +- public void readPacketData(DataInput var1) throws IOException { +- this.windowId = var1.readByte(); +- this.progressBar = var1.readShort(); +- this.progressBarValue = var1.readShort(); +- } +- +- public void writePacketData(DataOutput var1) throws IOException { +- var1.writeByte(this.windowId); +- var1.writeShort(this.progressBar); +- var1.writeShort(this.progressBarValue); +- } +- ++ public Packet105UpdateProgressbar() {} ++ ++ public Packet105UpdateProgressbar(int par1, int par2, int par3) { ++ this.windowId = par1; ++ this.progressBar = par2; ++ this.progressBarValue = par3; ++ } ++ ++ /** ++ * Passes this Packet on to the NetHandler for processing. ++ */ ++ public void processPacket(NetHandler par1NetHandler) { ++ par1NetHandler.handleUpdateProgressbar(this); ++ } ++ ++ /** ++ * Abstract. Reads the raw packet data from the data stream. ++ */ ++ public void readPacketData(DataInput par1DataInput) throws IOException { ++ this.windowId = par1DataInput.readByte(); ++ this.progressBar = par1DataInput.readShort(); ++ this.progressBarValue = par1DataInput.readShort(); ++ } ++ ++ /** ++ * Abstract. Writes the raw packet data to the data stream. ++ */ ++ public void writePacketData(DataOutput par1DataOutput) throws IOException { ++ par1DataOutput.writeByte(this.windowId); ++ par1DataOutput.writeShort(this.progressBar); ++ par1DataOutput.writeShort(this.progressBarValue); ++ } ++ ++ /** ++ * Abstract. Return the size of the packet (not counting the header). ++ */ + public int getPacketSize() { + return 5; + } diff --git a/patches/net/minecraft/src/Packet106Transaction.java.patch b/patches/net/minecraft/src/Packet106Transaction.java.patch new file mode 100644 index 0000000..08cf9f9 --- /dev/null +++ b/patches/net/minecraft/src/Packet106Transaction.java.patch @@ -0,0 +1,76 @@ +--- net/minecraft/src/Packet106Transaction.java ++++ net/minecraft/src/Packet106Transaction.java +@@ -5,35 +5,48 @@ + import java.io.IOException; + + public class Packet106Transaction extends Packet { ++ ++ /** The id of the window that the action occurred in. */ + public int windowId; + public short shortWindowId; + public boolean accepted; + +- public Packet106Transaction() { +- } +- +- public Packet106Transaction(int var1, short var2, boolean var3) { +- this.windowId = var1; +- this.shortWindowId = var2; +- this.accepted = var3; +- } +- +- public void processPacket(NetHandler var1) { +- var1.handleTransaction(this); +- } +- +- public void readPacketData(DataInput var1) throws IOException { +- this.windowId = var1.readByte(); +- this.shortWindowId = var1.readShort(); +- this.accepted = var1.readByte() != 0; +- } +- +- public void writePacketData(DataOutput var1) throws IOException { +- var1.writeByte(this.windowId); +- var1.writeShort(this.shortWindowId); +- var1.writeByte(this.accepted ? 1 : 0); +- } +- ++ public Packet106Transaction() {} ++ ++ public Packet106Transaction(int par1, short par2, boolean par3) { ++ this.windowId = par1; ++ this.shortWindowId = par2; ++ this.accepted = par3; ++ } ++ ++ /** ++ * Passes this Packet on to the NetHandler for processing. ++ */ ++ public void processPacket(NetHandler par1NetHandler) { ++ par1NetHandler.handleTransaction(this); ++ } ++ ++ /** ++ * Abstract. Reads the raw packet data from the data stream. ++ */ ++ public void readPacketData(DataInput par1DataInput) throws IOException { ++ this.windowId = par1DataInput.readByte(); ++ this.shortWindowId = par1DataInput.readShort(); ++ this.accepted = par1DataInput.readByte() != 0; ++ } ++ ++ /** ++ * Abstract. Writes the raw packet data to the data stream. ++ */ ++ public void writePacketData(DataOutput par1DataOutput) throws IOException { ++ par1DataOutput.writeByte(this.windowId); ++ par1DataOutput.writeShort(this.shortWindowId); ++ par1DataOutput.writeByte(this.accepted ? 1 : 0); ++ } ++ ++ /** ++ * Abstract. Return the size of the packet (not counting the header). ++ */ + public int getPacketSize() { + return 4; + } diff --git a/patches/net/minecraft/src/Packet107CreativeSetSlot.java.patch b/patches/net/minecraft/src/Packet107CreativeSetSlot.java.patch new file mode 100644 index 0000000..8999ce2 --- /dev/null +++ b/patches/net/minecraft/src/Packet107CreativeSetSlot.java.patch @@ -0,0 +1,64 @@ +--- net/minecraft/src/Packet107CreativeSetSlot.java ++++ net/minecraft/src/Packet107CreativeSetSlot.java +@@ -8,28 +8,39 @@ + public int slot; + public ItemStack itemStack; + +- public Packet107CreativeSetSlot() { +- } +- +- public Packet107CreativeSetSlot(int var1, ItemStack var2) { +- this.slot = var1; +- this.itemStack = var2 != null ? var2.copy() : null; +- } +- +- public void processPacket(NetHandler var1) { +- var1.handleCreativeSetSlot(this); +- } +- +- public void readPacketData(DataInput var1) throws IOException { +- this.slot = var1.readShort(); +- this.itemStack = readItemStack(var1); +- } +- +- public void writePacketData(DataOutput var1) throws IOException { +- var1.writeShort(this.slot); +- writeItemStack(this.itemStack, var1); +- } +- ++ public Packet107CreativeSetSlot() {} ++ ++ public Packet107CreativeSetSlot(int par1, ItemStack par2ItemStack) { ++ this.slot = par1; ++ this.itemStack = par2ItemStack != null ? par2ItemStack.copy() : null; ++ } ++ ++ /** ++ * Passes this Packet on to the NetHandler for processing. ++ */ ++ public void processPacket(NetHandler par1NetHandler) { ++ par1NetHandler.handleCreativeSetSlot(this); ++ } ++ ++ /** ++ * Abstract. Reads the raw packet data from the data stream. ++ */ ++ public void readPacketData(DataInput par1DataInput) throws IOException { ++ this.slot = par1DataInput.readShort(); ++ this.itemStack = readItemStack(par1DataInput); ++ } ++ ++ /** ++ * Abstract. Writes the raw packet data to the data stream. ++ */ ++ public void writePacketData(DataOutput par1DataOutput) throws IOException { ++ par1DataOutput.writeShort(this.slot); ++ writeItemStack(this.itemStack, par1DataOutput); ++ } ++ ++ /** ++ * Abstract. Return the size of the packet (not counting the header). ++ */ + public int getPacketSize() { + return 8; + } diff --git a/patches/net/minecraft/src/Packet108EnchantItem.java.patch b/patches/net/minecraft/src/Packet108EnchantItem.java.patch new file mode 100644 index 0000000..bb65c73 --- /dev/null +++ b/patches/net/minecraft/src/Packet108EnchantItem.java.patch @@ -0,0 +1,70 @@ +--- net/minecraft/src/Packet108EnchantItem.java ++++ net/minecraft/src/Packet108EnchantItem.java +@@ -6,30 +6,45 @@ + + public class Packet108EnchantItem extends Packet { + public int windowId; ++ ++ /** ++ * The position of the enchantment on the enchantment table window, starting with 0 as the topmost one. ++ */ + public int enchantment; + +- public Packet108EnchantItem() { +- } +- +- public Packet108EnchantItem(int var1, int var2) { +- this.windowId = var1; +- this.enchantment = var2; +- } +- +- public void processPacket(NetHandler var1) { +- var1.handleEnchantItem(this); +- } +- +- public void readPacketData(DataInput var1) throws IOException { +- this.windowId = var1.readByte(); +- this.enchantment = var1.readByte(); +- } +- +- public void writePacketData(DataOutput var1) throws IOException { +- var1.writeByte(this.windowId); +- var1.writeByte(this.enchantment); +- } +- ++ public Packet108EnchantItem() {} ++ ++ public Packet108EnchantItem(int par1, int par2) { ++ this.windowId = par1; ++ this.enchantment = par2; ++ } ++ ++ /** ++ * Passes this Packet on to the NetHandler for processing. ++ */ ++ public void processPacket(NetHandler par1NetHandler) { ++ par1NetHandler.handleEnchantItem(this); ++ } ++ ++ /** ++ * Abstract. Reads the raw packet data from the data stream. ++ */ ++ public void readPacketData(DataInput par1DataInput) throws IOException { ++ this.windowId = par1DataInput.readByte(); ++ this.enchantment = par1DataInput.readByte(); ++ } ++ ++ /** ++ * Abstract. Writes the raw packet data to the data stream. ++ */ ++ public void writePacketData(DataOutput par1DataOutput) throws IOException { ++ par1DataOutput.writeByte(this.windowId); ++ par1DataOutput.writeByte(this.enchantment); ++ } ++ ++ /** ++ * Abstract. Return the size of the packet (not counting the header). ++ */ + public int getPacketSize() { + return 2; + } diff --git a/patches/net/minecraft/src/Packet10Flying.java.patch b/patches/net/minecraft/src/Packet10Flying.java.patch new file mode 100644 index 0000000..f6a8049 --- /dev/null +++ b/patches/net/minecraft/src/Packet10Flying.java.patch @@ -0,0 +1,103 @@ +--- net/minecraft/src/Packet10Flying.java ++++ net/minecraft/src/Packet10Flying.java +@@ -5,44 +5,80 @@ + import java.io.IOException; + + public class Packet10Flying extends Packet { ++ ++ /** The player's X position. */ + public double xPosition; ++ ++ /** The player's Y position. */ + public double yPosition; ++ ++ /** The player's Z position. */ + public double zPosition; ++ ++ /** The player's stance. (boundingBox.minY) */ + public double stance; ++ ++ /** The player's yaw rotation. */ + public float yaw; ++ ++ /** The player's pitch rotation. */ + public float pitch; ++ ++ /** True if the client is on the ground. */ + public boolean onGround; ++ ++ /** Boolean set to true if the player is moving. */ + public boolean moving; ++ ++ /** Boolean set to true if the player is rotating. */ + public boolean rotating; + +- public Packet10Flying() { +- } +- +- public Packet10Flying(boolean var1) { +- this.onGround = var1; +- } +- +- public void processPacket(NetHandler var1) { +- var1.handleFlying(this); +- } +- +- public void readPacketData(DataInput var1) throws IOException { +- this.onGround = var1.readUnsignedByte() != 0; +- } +- +- public void writePacketData(DataOutput var1) throws IOException { +- var1.write(this.onGround ? 1 : 0); +- } +- ++ public Packet10Flying() {} ++ ++ public Packet10Flying(boolean par1) { ++ this.onGround = par1; ++ } ++ ++ /** ++ * Passes this Packet on to the NetHandler for processing. ++ */ ++ public void processPacket(NetHandler par1NetHandler) { ++ par1NetHandler.handleFlying(this); ++ } ++ ++ /** ++ * Abstract. Reads the raw packet data from the data stream. ++ */ ++ public void readPacketData(DataInput par1DataInput) throws IOException { ++ this.onGround = par1DataInput.readUnsignedByte() != 0; ++ } ++ ++ /** ++ * Abstract. Writes the raw packet data to the data stream. ++ */ ++ public void writePacketData(DataOutput par1DataOutput) throws IOException { ++ par1DataOutput.write(this.onGround ? 1 : 0); ++ } ++ ++ /** ++ * Abstract. Return the size of the packet (not counting the header). ++ */ + public int getPacketSize() { + return 1; + } + ++ /** ++ * only false for the abstract Packet class, all real packets return true ++ */ + public boolean isRealPacket() { + return true; + } + +- public boolean containsSameEntityIDAs(Packet var1) { ++ /** ++ * eg return packet30entity.entityId == entityId; WARNING : will throw if you compare a packet to a different packet ++ * class ++ */ ++ public boolean containsSameEntityIDAs(Packet par1Packet) { + return true; + } + } diff --git a/patches/net/minecraft/src/Packet11PlayerPosition.java.patch b/patches/net/minecraft/src/Packet11PlayerPosition.java.patch new file mode 100644 index 0000000..b129ced --- /dev/null +++ b/patches/net/minecraft/src/Packet11PlayerPosition.java.patch @@ -0,0 +1,65 @@ +--- net/minecraft/src/Packet11PlayerPosition.java ++++ net/minecraft/src/Packet11PlayerPosition.java +@@ -9,31 +9,40 @@ + this.moving = true; + } + +- public Packet11PlayerPosition(double var1, double var3, double var5, double var7, boolean var9) { +- this.xPosition = var1; +- this.yPosition = var3; +- this.stance = var5; +- this.zPosition = var7; +- this.onGround = var9; ++ public Packet11PlayerPosition(double par1, double par3, double par5, double par7, boolean par9) { ++ this.xPosition = par1; ++ this.yPosition = par3; ++ this.stance = par5; ++ this.zPosition = par7; ++ this.onGround = par9; + this.moving = true; + } + +- public void readPacketData(DataInput var1) throws IOException { +- this.xPosition = var1.readDouble(); +- this.yPosition = var1.readDouble(); +- this.stance = var1.readDouble(); +- this.zPosition = var1.readDouble(); +- super.readPacketData(var1); +- } +- +- public void writePacketData(DataOutput var1) throws IOException { +- var1.writeDouble(this.xPosition); +- var1.writeDouble(this.yPosition); +- var1.writeDouble(this.stance); +- var1.writeDouble(this.zPosition); +- super.writePacketData(var1); +- } +- ++ /** ++ * Abstract. Reads the raw packet data from the data stream. ++ */ ++ public void readPacketData(DataInput par1DataInput) throws IOException { ++ this.xPosition = par1DataInput.readDouble(); ++ this.yPosition = par1DataInput.readDouble(); ++ this.stance = par1DataInput.readDouble(); ++ this.zPosition = par1DataInput.readDouble(); ++ super.readPacketData(par1DataInput); ++ } ++ ++ /** ++ * Abstract. Writes the raw packet data to the data stream. ++ */ ++ public void writePacketData(DataOutput par1DataOutput) throws IOException { ++ par1DataOutput.writeDouble(this.xPosition); ++ par1DataOutput.writeDouble(this.yPosition); ++ par1DataOutput.writeDouble(this.stance); ++ par1DataOutput.writeDouble(this.zPosition); ++ super.writePacketData(par1DataOutput); ++ } ++ ++ /** ++ * Abstract. Return the size of the packet (not counting the header). ++ */ + public int getPacketSize() { + return 33; + } diff --git a/patches/net/minecraft/src/Packet12PlayerLook.java.patch b/patches/net/minecraft/src/Packet12PlayerLook.java.patch new file mode 100644 index 0000000..4791410 --- /dev/null +++ b/patches/net/minecraft/src/Packet12PlayerLook.java.patch @@ -0,0 +1,53 @@ +--- net/minecraft/src/Packet12PlayerLook.java ++++ net/minecraft/src/Packet12PlayerLook.java +@@ -9,25 +9,34 @@ + this.rotating = true; + } + +- public Packet12PlayerLook(float var1, float var2, boolean var3) { +- this.yaw = var1; +- this.pitch = var2; +- this.onGround = var3; ++ public Packet12PlayerLook(float par1, float par2, boolean par3) { ++ this.yaw = par1; ++ this.pitch = par2; ++ this.onGround = par3; + this.rotating = true; + } + +- public void readPacketData(DataInput var1) throws IOException { +- this.yaw = var1.readFloat(); +- this.pitch = var1.readFloat(); +- super.readPacketData(var1); +- } +- +- public void writePacketData(DataOutput var1) throws IOException { +- var1.writeFloat(this.yaw); +- var1.writeFloat(this.pitch); +- super.writePacketData(var1); +- } +- ++ /** ++ * Abstract. Reads the raw packet data from the data stream. ++ */ ++ public void readPacketData(DataInput par1DataInput) throws IOException { ++ this.yaw = par1DataInput.readFloat(); ++ this.pitch = par1DataInput.readFloat(); ++ super.readPacketData(par1DataInput); ++ } ++ ++ /** ++ * Abstract. Writes the raw packet data to the data stream. ++ */ ++ public void writePacketData(DataOutput par1DataOutput) throws IOException { ++ par1DataOutput.writeFloat(this.yaw); ++ par1DataOutput.writeFloat(this.pitch); ++ super.writePacketData(par1DataOutput); ++ } ++ ++ /** ++ * Abstract. Return the size of the packet (not counting the header). ++ */ + public int getPacketSize() { + return 9; + } diff --git a/patches/net/minecraft/src/Packet130UpdateSign.java.patch b/patches/net/minecraft/src/Packet130UpdateSign.java.patch new file mode 100644 index 0000000..789d380 --- /dev/null +++ b/patches/net/minecraft/src/Packet130UpdateSign.java.patch @@ -0,0 +1,102 @@ +--- net/minecraft/src/Packet130UpdateSign.java ++++ net/minecraft/src/Packet130UpdateSign.java +@@ -8,52 +8,62 @@ + public int xPosition; + public int yPosition; + public int zPosition; +- public String[] d; ++ public String[] signLines; + + public Packet130UpdateSign() { + this.isChunkDataPacket = true; + } + +- public Packet130UpdateSign(int var1, int var2, int var3, String[] var4) { ++ public Packet130UpdateSign(int par1, int par2, int par3, String[] par4ArrayOfStr) { + this.isChunkDataPacket = true; +- this.xPosition = var1; +- this.yPosition = var2; +- this.zPosition = var3; +- this.d = new String[]{var4[0], var4[1], var4[2], var4[3]}; +- } +- +- public void readPacketData(DataInput var1) throws IOException { +- this.xPosition = var1.readInt(); +- this.yPosition = var1.readShort(); +- this.zPosition = var1.readInt(); +- this.d = new String[4]; +- +- for(int var2 = 0; var2 < 4; ++var2) { +- this.d[var2] = readString(var1, 15); +- } +- +- } +- +- public void writePacketData(DataOutput var1) throws IOException { +- var1.writeInt(this.xPosition); +- var1.writeShort(this.yPosition); +- var1.writeInt(this.zPosition); +- +- for(int var2 = 0; var2 < 4; ++var2) { +- writeString(this.d[var2], var1); +- } +- +- } +- +- public void processPacket(NetHandler var1) { +- var1.handleUpdateSign(this); +- } +- ++ this.xPosition = par1; ++ this.yPosition = par2; ++ this.zPosition = par3; ++ this.signLines = new String[] {par4ArrayOfStr[0], par4ArrayOfStr[1], par4ArrayOfStr[2], par4ArrayOfStr[3]}; ++ } ++ ++ /** ++ * Abstract. Reads the raw packet data from the data stream. ++ */ ++ public void readPacketData(DataInput par1DataInput) throws IOException { ++ this.xPosition = par1DataInput.readInt(); ++ this.yPosition = par1DataInput.readShort(); ++ this.zPosition = par1DataInput.readInt(); ++ this.signLines = new String[4]; ++ ++ for (int var2 = 0; var2 < 4; ++var2) { ++ this.signLines[var2] = readString(par1DataInput, 15); ++ } ++ } ++ ++ /** ++ * Abstract. Writes the raw packet data to the data stream. ++ */ ++ public void writePacketData(DataOutput par1DataOutput) throws IOException { ++ par1DataOutput.writeInt(this.xPosition); ++ par1DataOutput.writeShort(this.yPosition); ++ par1DataOutput.writeInt(this.zPosition); ++ ++ for (int var2 = 0; var2 < 4; ++var2) { ++ writeString(this.signLines[var2], par1DataOutput); ++ } ++ } ++ ++ /** ++ * Passes this Packet on to the NetHandler for processing. ++ */ ++ public void processPacket(NetHandler par1NetHandler) { ++ par1NetHandler.handleUpdateSign(this); ++ } ++ ++ /** ++ * Abstract. Return the size of the packet (not counting the header). ++ */ + public int getPacketSize() { + int var1 = 0; + +- for(int var2 = 0; var2 < 4; ++var2) { +- var1 += this.d[var2].length(); ++ for (int var2 = 0; var2 < 4; ++var2) { ++ var1 += this.signLines[var2].length(); + } + + return var1; diff --git a/patches/net/minecraft/src/Packet131MapData.java.patch b/patches/net/minecraft/src/Packet131MapData.java.patch new file mode 100644 index 0000000..56c614b --- /dev/null +++ b/patches/net/minecraft/src/Packet131MapData.java.patch @@ -0,0 +1,85 @@ +--- net/minecraft/src/Packet131MapData.java ++++ net/minecraft/src/Packet131MapData.java +@@ -6,38 +6,58 @@ + + public class Packet131MapData extends Packet { + public short itemID; ++ ++ /** ++ * Contains a unique ID for the item that this packet will be populating. ++ */ + public short uniqueID; ++ ++ /** ++ * Contains a buffer of arbitrary data with which to populate an individual item in the world. ++ */ + public byte[] itemData; + + public Packet131MapData() { + this.isChunkDataPacket = true; + } + +- public Packet131MapData(short var1, short var2, byte[] var3) { ++ public Packet131MapData(short par1, short par2, byte[] par3ArrayOfByte) { + this.isChunkDataPacket = true; +- this.itemID = var1; +- this.uniqueID = var2; +- this.itemData = var3; +- } +- +- public void readPacketData(DataInput var1) throws IOException { +- this.itemID = var1.readShort(); +- this.uniqueID = var1.readShort(); +- this.itemData = new byte[var1.readUnsignedShort()]; +- var1.readFully(this.itemData); +- } +- +- public void writePacketData(DataOutput var1) throws IOException { +- var1.writeShort(this.itemID); +- var1.writeShort(this.uniqueID); +- var1.writeShort(this.itemData.length); +- var1.write(this.itemData); +- } +- +- public void processPacket(NetHandler var1) { +- var1.handleMapData(this); +- } +- ++ this.itemID = par1; ++ this.uniqueID = par2; ++ this.itemData = par3ArrayOfByte; ++ } ++ ++ /** ++ * Abstract. Reads the raw packet data from the data stream. ++ */ ++ public void readPacketData(DataInput par1DataInput) throws IOException { ++ this.itemID = par1DataInput.readShort(); ++ this.uniqueID = par1DataInput.readShort(); ++ this.itemData = new byte[par1DataInput.readUnsignedShort()]; ++ par1DataInput.readFully(this.itemData); ++ } ++ ++ /** ++ * Abstract. Writes the raw packet data to the data stream. ++ */ ++ public void writePacketData(DataOutput par1DataOutput) throws IOException { ++ par1DataOutput.writeShort(this.itemID); ++ par1DataOutput.writeShort(this.uniqueID); ++ par1DataOutput.writeShort(this.itemData.length); ++ par1DataOutput.write(this.itemData); ++ } ++ ++ /** ++ * Passes this Packet on to the NetHandler for processing. ++ */ ++ public void processPacket(NetHandler par1NetHandler) { ++ par1NetHandler.handleMapData(this); ++ } ++ ++ /** ++ * Abstract. Return the size of the packet (not counting the header). ++ */ + public int getPacketSize() { + return 4 + this.itemData.length; + } diff --git a/patches/net/minecraft/src/Packet132TileEntityData.java.patch b/patches/net/minecraft/src/Packet132TileEntityData.java.patch new file mode 100644 index 0000000..856207a --- /dev/null +++ b/patches/net/minecraft/src/Packet132TileEntityData.java.patch @@ -0,0 +1,100 @@ +--- net/minecraft/src/Packet132TileEntityData.java ++++ net/minecraft/src/Packet132TileEntityData.java +@@ -5,45 +5,69 @@ + import java.io.IOException; + + public class Packet132TileEntityData extends Packet { ++ ++ /** The X position of the tile entity to update. */ + public int xPosition; ++ ++ /** The Y position of the tile entity to update. */ + public int yPosition; ++ ++ /** The Z position of the tile entity to update. */ + public int zPosition; ++ ++ /** The type of update to perform on the tile entity. */ + public int actionType; ++ ++ /** ++ * NBT tile entity data. This is NOT related to writeToNBT or readFromNBT. ++ */ + public NBTTagCompound data; + + public Packet132TileEntityData() { + this.isChunkDataPacket = true; + } + +- public Packet132TileEntityData(int var1, int var2, int var3, int var4, NBTTagCompound var5) { ++ public Packet132TileEntityData(int par1, int par2, int par3, int par4, NBTTagCompound par5NBTTagCompound) { + this.isChunkDataPacket = true; +- this.xPosition = var1; +- this.yPosition = var2; +- this.zPosition = var3; +- this.actionType = var4; +- this.data = var5; +- } +- +- public void readPacketData(DataInput var1) throws IOException { +- this.xPosition = var1.readInt(); +- this.yPosition = var1.readShort(); +- this.zPosition = var1.readInt(); +- this.actionType = var1.readByte(); +- this.data = readNBTTagCompound(var1); +- } +- +- public void writePacketData(DataOutput var1) throws IOException { +- var1.writeInt(this.xPosition); +- var1.writeShort(this.yPosition); +- var1.writeInt(this.zPosition); +- var1.writeByte((byte)this.actionType); +- writeNBTTagCompound(this.data, var1); +- } +- +- public void processPacket(NetHandler var1) { +- var1.handleTileEntityData(this); +- } +- ++ this.xPosition = par1; ++ this.yPosition = par2; ++ this.zPosition = par3; ++ this.actionType = par4; ++ this.data = par5NBTTagCompound; ++ } ++ ++ /** ++ * Abstract. Reads the raw packet data from the data stream. ++ */ ++ public void readPacketData(DataInput par1DataInput) throws IOException { ++ this.xPosition = par1DataInput.readInt(); ++ this.yPosition = par1DataInput.readShort(); ++ this.zPosition = par1DataInput.readInt(); ++ this.actionType = par1DataInput.readByte(); ++ this.data = readNBTTagCompound(par1DataInput); ++ } ++ ++ /** ++ * Abstract. Writes the raw packet data to the data stream. ++ */ ++ public void writePacketData(DataOutput par1DataOutput) throws IOException { ++ par1DataOutput.writeInt(this.xPosition); ++ par1DataOutput.writeShort(this.yPosition); ++ par1DataOutput.writeInt(this.zPosition); ++ par1DataOutput.writeByte((byte)this.actionType); ++ writeNBTTagCompound(this.data, par1DataOutput); ++ } ++ ++ /** ++ * Passes this Packet on to the NetHandler for processing. ++ */ ++ public void processPacket(NetHandler par1NetHandler) { ++ par1NetHandler.handleTileEntityData(this); ++ } ++ ++ /** ++ * Abstract. Return the size of the packet (not counting the header). ++ */ + public int getPacketSize() { + return 25; + } diff --git a/patches/net/minecraft/src/Packet133TileEditorOpen.java.patch b/patches/net/minecraft/src/Packet133TileEditorOpen.java.patch new file mode 100644 index 0000000..93705bd --- /dev/null +++ b/patches/net/minecraft/src/Packet133TileEditorOpen.java.patch @@ -0,0 +1,76 @@ +--- net/minecraft/src/Packet133TileEditorOpen.java ++++ net/minecraft/src/Packet133TileEditorOpen.java +@@ -10,34 +10,45 @@ + public int field_142036_c; + public int field_142034_d; + +- public Packet133TileEditorOpen() { +- } +- +- public Packet133TileEditorOpen(int var1, int var2, int var3, int var4) { +- this.field_142037_a = var1; +- this.field_142035_b = var2; +- this.field_142036_c = var3; +- this.field_142034_d = var4; +- } +- +- public void processPacket(NetHandler var1) { +- var1.func_142031_a(this); +- } +- +- public void readPacketData(DataInput var1) throws IOException { +- this.field_142037_a = var1.readByte(); +- this.field_142035_b = var1.readInt(); +- this.field_142036_c = var1.readInt(); +- this.field_142034_d = var1.readInt(); +- } +- +- public void writePacketData(DataOutput var1) throws IOException { +- var1.writeByte(this.field_142037_a); +- var1.writeInt(this.field_142035_b); +- var1.writeInt(this.field_142036_c); +- var1.writeInt(this.field_142034_d); +- } +- ++ public Packet133TileEditorOpen() {} ++ ++ public Packet133TileEditorOpen(int par1, int par2, int par3, int par4) { ++ this.field_142037_a = par1; ++ this.field_142035_b = par2; ++ this.field_142036_c = par3; ++ this.field_142034_d = par4; ++ } ++ ++ /** ++ * Passes this Packet on to the NetHandler for processing. ++ */ ++ public void processPacket(NetHandler par1NetHandler) { ++ par1NetHandler.func_142031_a(this); ++ } ++ ++ /** ++ * Abstract. Reads the raw packet data from the data stream. ++ */ ++ public void readPacketData(DataInput par1DataInput) throws IOException { ++ this.field_142037_a = par1DataInput.readByte(); ++ this.field_142035_b = par1DataInput.readInt(); ++ this.field_142036_c = par1DataInput.readInt(); ++ this.field_142034_d = par1DataInput.readInt(); ++ } ++ ++ /** ++ * Abstract. Writes the raw packet data to the data stream. ++ */ ++ public void writePacketData(DataOutput par1DataOutput) throws IOException { ++ par1DataOutput.writeByte(this.field_142037_a); ++ par1DataOutput.writeInt(this.field_142035_b); ++ par1DataOutput.writeInt(this.field_142036_c); ++ par1DataOutput.writeInt(this.field_142034_d); ++ } ++ ++ /** ++ * Abstract. Return the size of the packet (not counting the header). ++ */ + public int getPacketSize() { + return 13; + } diff --git a/patches/net/minecraft/src/Packet13PlayerLookMove.java.patch b/patches/net/minecraft/src/Packet13PlayerLookMove.java.patch new file mode 100644 index 0000000..d3b02b1 --- /dev/null +++ b/patches/net/minecraft/src/Packet13PlayerLookMove.java.patch @@ -0,0 +1,78 @@ +--- net/minecraft/src/Packet13PlayerLookMove.java ++++ net/minecraft/src/Packet13PlayerLookMove.java +@@ -10,38 +10,47 @@ + this.moving = true; + } + +- public Packet13PlayerLookMove(double var1, double var3, double var5, double var7, float var9, float var10, boolean var11) { +- this.xPosition = var1; +- this.yPosition = var3; +- this.stance = var5; +- this.zPosition = var7; +- this.yaw = var9; +- this.pitch = var10; +- this.onGround = var11; ++ public Packet13PlayerLookMove(double par1, double par3, double par5, double par7, float par9, float par10, boolean par11) { ++ this.xPosition = par1; ++ this.yPosition = par3; ++ this.stance = par5; ++ this.zPosition = par7; ++ this.yaw = par9; ++ this.pitch = par10; ++ this.onGround = par11; + this.rotating = true; + this.moving = true; + } + +- public void readPacketData(DataInput var1) throws IOException { +- this.xPosition = var1.readDouble(); +- this.yPosition = var1.readDouble(); +- this.stance = var1.readDouble(); +- this.zPosition = var1.readDouble(); +- this.yaw = var1.readFloat(); +- this.pitch = var1.readFloat(); +- super.readPacketData(var1); +- } +- +- public void writePacketData(DataOutput var1) throws IOException { +- var1.writeDouble(this.xPosition); +- var1.writeDouble(this.yPosition); +- var1.writeDouble(this.stance); +- var1.writeDouble(this.zPosition); +- var1.writeFloat(this.yaw); +- var1.writeFloat(this.pitch); +- super.writePacketData(var1); +- } +- ++ /** ++ * Abstract. Reads the raw packet data from the data stream. ++ */ ++ public void readPacketData(DataInput par1DataInput) throws IOException { ++ this.xPosition = par1DataInput.readDouble(); ++ this.yPosition = par1DataInput.readDouble(); ++ this.stance = par1DataInput.readDouble(); ++ this.zPosition = par1DataInput.readDouble(); ++ this.yaw = par1DataInput.readFloat(); ++ this.pitch = par1DataInput.readFloat(); ++ super.readPacketData(par1DataInput); ++ } ++ ++ /** ++ * Abstract. Writes the raw packet data to the data stream. ++ */ ++ public void writePacketData(DataOutput par1DataOutput) throws IOException { ++ par1DataOutput.writeDouble(this.xPosition); ++ par1DataOutput.writeDouble(this.yPosition); ++ par1DataOutput.writeDouble(this.stance); ++ par1DataOutput.writeDouble(this.zPosition); ++ par1DataOutput.writeFloat(this.yaw); ++ par1DataOutput.writeFloat(this.pitch); ++ super.writePacketData(par1DataOutput); ++ } ++ ++ /** ++ * Abstract. Return the size of the packet (not counting the header). ++ */ + public int getPacketSize() { + return 41; + } diff --git a/patches/net/minecraft/src/Packet14BlockDig.java.patch b/patches/net/minecraft/src/Packet14BlockDig.java.patch new file mode 100644 index 0000000..126c870 --- /dev/null +++ b/patches/net/minecraft/src/Packet14BlockDig.java.patch @@ -0,0 +1,98 @@ +--- net/minecraft/src/Packet14BlockDig.java ++++ net/minecraft/src/Packet14BlockDig.java +@@ -5,43 +5,64 @@ + import java.io.IOException; + + public class Packet14BlockDig extends Packet { ++ ++ /** Block X position. */ + public int xPosition; ++ ++ /** Block Y position. */ + public int yPosition; ++ ++ /** Block Z position. */ + public int zPosition; ++ ++ /** Punched face of the block. */ + public int face; ++ ++ /** Status of the digging (started, ongoing, broken). */ + public int status; + +- public Packet14BlockDig() { +- } +- +- public Packet14BlockDig(int var1, int var2, int var3, int var4, int var5) { +- this.status = var1; +- this.xPosition = var2; +- this.yPosition = var3; +- this.zPosition = var4; +- this.face = var5; +- } +- +- public void readPacketData(DataInput var1) throws IOException { +- this.status = var1.readUnsignedByte(); +- this.xPosition = var1.readInt(); +- this.yPosition = var1.readUnsignedByte(); +- this.zPosition = var1.readInt(); +- this.face = var1.readUnsignedByte(); +- } +- +- public void writePacketData(DataOutput var1) throws IOException { +- var1.write(this.status); +- var1.writeInt(this.xPosition); +- var1.write(this.yPosition); +- var1.writeInt(this.zPosition); +- var1.write(this.face); +- } +- +- public void processPacket(NetHandler var1) { +- var1.handleBlockDig(this); +- } +- ++ public Packet14BlockDig() {} ++ ++ public Packet14BlockDig(int par1, int par2, int par3, int par4, int par5) { ++ this.status = par1; ++ this.xPosition = par2; ++ this.yPosition = par3; ++ this.zPosition = par4; ++ this.face = par5; ++ } ++ ++ /** ++ * Abstract. Reads the raw packet data from the data stream. ++ */ ++ public void readPacketData(DataInput par1DataInput) throws IOException { ++ this.status = par1DataInput.readUnsignedByte(); ++ this.xPosition = par1DataInput.readInt(); ++ this.yPosition = par1DataInput.readUnsignedByte(); ++ this.zPosition = par1DataInput.readInt(); ++ this.face = par1DataInput.readUnsignedByte(); ++ } ++ ++ /** ++ * Abstract. Writes the raw packet data to the data stream. ++ */ ++ public void writePacketData(DataOutput par1DataOutput) throws IOException { ++ par1DataOutput.write(this.status); ++ par1DataOutput.writeInt(this.xPosition); ++ par1DataOutput.write(this.yPosition); ++ par1DataOutput.writeInt(this.zPosition); ++ par1DataOutput.write(this.face); ++ } ++ ++ /** ++ * Passes this Packet on to the NetHandler for processing. ++ */ ++ public void processPacket(NetHandler par1NetHandler) { ++ par1NetHandler.handleBlockDig(this); ++ } ++ ++ /** ++ * Abstract. Return the size of the packet (not counting the header). ++ */ + public int getPacketSize() { + return 11; + } diff --git a/patches/net/minecraft/src/Packet15Place.java.patch b/patches/net/minecraft/src/Packet15Place.java.patch new file mode 100644 index 0000000..de84802 --- /dev/null +++ b/patches/net/minecraft/src/Packet15Place.java.patch @@ -0,0 +1,138 @@ +--- net/minecraft/src/Packet15Place.java ++++ net/minecraft/src/Packet15Place.java +@@ -8,52 +8,71 @@ + private int xPosition; + private int yPosition; + private int zPosition; ++ ++ /** The offset to use for block/item placement. */ + private int direction; + private ItemStack itemStack; ++ ++ /** The offset from xPosition where the actual click took place */ + private float xOffset; ++ ++ /** The offset from yPosition where the actual click took place */ + private float yOffset; ++ ++ /** The offset from zPosition where the actual click took place */ + private float zOffset; + +- public Packet15Place() { +- } +- +- public Packet15Place(int var1, int var2, int var3, int var4, ItemStack var5, float var6, float var7, float var8) { +- this.xPosition = var1; +- this.yPosition = var2; +- this.zPosition = var3; +- this.direction = var4; +- this.itemStack = var5 != null ? var5.copy() : null; +- this.xOffset = var6; +- this.yOffset = var7; +- this.zOffset = var8; +- } +- +- public void readPacketData(DataInput var1) throws IOException { +- this.xPosition = var1.readInt(); +- this.yPosition = var1.readUnsignedByte(); +- this.zPosition = var1.readInt(); +- this.direction = var1.readUnsignedByte(); +- this.itemStack = readItemStack(var1); +- this.xOffset = (float)var1.readUnsignedByte() / 16.0F; +- this.yOffset = (float)var1.readUnsignedByte() / 16.0F; +- this.zOffset = (float)var1.readUnsignedByte() / 16.0F; +- } +- +- public void writePacketData(DataOutput var1) throws IOException { +- var1.writeInt(this.xPosition); +- var1.write(this.yPosition); +- var1.writeInt(this.zPosition); +- var1.write(this.direction); +- writeItemStack(this.itemStack, var1); +- var1.write((int)(this.xOffset * 16.0F)); +- var1.write((int)(this.yOffset * 16.0F)); +- var1.write((int)(this.zOffset * 16.0F)); +- } +- +- public void processPacket(NetHandler var1) { +- var1.handlePlace(this); +- } +- ++ public Packet15Place() {} ++ ++ public Packet15Place(int par1, int par2, int par3, int par4, ItemStack par5ItemStack, float par6, float par7, float par8) { ++ this.xPosition = par1; ++ this.yPosition = par2; ++ this.zPosition = par3; ++ this.direction = par4; ++ this.itemStack = par5ItemStack != null ? par5ItemStack.copy() : null; ++ this.xOffset = par6; ++ this.yOffset = par7; ++ this.zOffset = par8; ++ } ++ ++ /** ++ * Abstract. Reads the raw packet data from the data stream. ++ */ ++ public void readPacketData(DataInput par1DataInput) throws IOException { ++ this.xPosition = par1DataInput.readInt(); ++ this.yPosition = par1DataInput.readUnsignedByte(); ++ this.zPosition = par1DataInput.readInt(); ++ this.direction = par1DataInput.readUnsignedByte(); ++ this.itemStack = readItemStack(par1DataInput); ++ this.xOffset = (float)par1DataInput.readUnsignedByte() / 16.0F; ++ this.yOffset = (float)par1DataInput.readUnsignedByte() / 16.0F; ++ this.zOffset = (float)par1DataInput.readUnsignedByte() / 16.0F; ++ } ++ ++ /** ++ * Abstract. Writes the raw packet data to the data stream. ++ */ ++ public void writePacketData(DataOutput par1DataOutput) throws IOException { ++ par1DataOutput.writeInt(this.xPosition); ++ par1DataOutput.write(this.yPosition); ++ par1DataOutput.writeInt(this.zPosition); ++ par1DataOutput.write(this.direction); ++ writeItemStack(this.itemStack, par1DataOutput); ++ par1DataOutput.write((int)(this.xOffset * 16.0F)); ++ par1DataOutput.write((int)(this.yOffset * 16.0F)); ++ par1DataOutput.write((int)(this.zOffset * 16.0F)); ++ } ++ ++ /** ++ * Passes this Packet on to the NetHandler for processing. ++ */ ++ public void processPacket(NetHandler par1NetHandler) { ++ par1NetHandler.handlePlace(this); ++ } ++ ++ /** ++ * Abstract. Return the size of the packet (not counting the header). ++ */ + public int getPacketSize() { + return 19; + } +@@ -78,14 +97,23 @@ + return this.itemStack; + } + ++ /** ++ * Returns the offset from xPosition where the actual click took place ++ */ + public float getXOffset() { + return this.xOffset; + } + ++ /** ++ * Returns the offset from yPosition where the actual click took place ++ */ + public float getYOffset() { + return this.yOffset; + } + ++ /** ++ * Returns the offset from zPosition where the actual click took place ++ */ + public float getZOffset() { + return this.zOffset; + } diff --git a/patches/net/minecraft/src/Packet16BlockItemSwitch.java.patch b/patches/net/minecraft/src/Packet16BlockItemSwitch.java.patch new file mode 100644 index 0000000..791fda3 --- /dev/null +++ b/patches/net/minecraft/src/Packet16BlockItemSwitch.java.patch @@ -0,0 +1,79 @@ +--- net/minecraft/src/Packet16BlockItemSwitch.java ++++ net/minecraft/src/Packet16BlockItemSwitch.java +@@ -5,36 +5,56 @@ + import java.io.IOException; + + public class Packet16BlockItemSwitch extends Packet { ++ ++ /** The block/item id to be equipped. */ + public int id; + +- public Packet16BlockItemSwitch() { +- } +- +- public Packet16BlockItemSwitch(int var1) { +- this.id = var1; +- } +- +- public void readPacketData(DataInput var1) throws IOException { +- this.id = var1.readShort(); +- } +- +- public void writePacketData(DataOutput var1) throws IOException { +- var1.writeShort(this.id); +- } +- +- public void processPacket(NetHandler var1) { +- var1.handleBlockItemSwitch(this); +- } +- ++ public Packet16BlockItemSwitch() {} ++ ++ public Packet16BlockItemSwitch(int par1) { ++ this.id = par1; ++ } ++ ++ /** ++ * Abstract. Reads the raw packet data from the data stream. ++ */ ++ public void readPacketData(DataInput par1DataInput) throws IOException { ++ this.id = par1DataInput.readShort(); ++ } ++ ++ /** ++ * Abstract. Writes the raw packet data to the data stream. ++ */ ++ public void writePacketData(DataOutput par1DataOutput) throws IOException { ++ par1DataOutput.writeShort(this.id); ++ } ++ ++ /** ++ * Passes this Packet on to the NetHandler for processing. ++ */ ++ public void processPacket(NetHandler par1NetHandler) { ++ par1NetHandler.handleBlockItemSwitch(this); ++ } ++ ++ /** ++ * Abstract. Return the size of the packet (not counting the header). ++ */ + public int getPacketSize() { + return 2; + } + ++ /** ++ * only false for the abstract Packet class, all real packets return true ++ */ + public boolean isRealPacket() { + return true; + } + +- public boolean containsSameEntityIDAs(Packet var1) { ++ /** ++ * eg return packet30entity.entityId == entityId; WARNING : will throw if you compare a packet to a different packet ++ * class ++ */ ++ public boolean containsSameEntityIDAs(Packet par1Packet) { + return true; + } + } diff --git a/patches/net/minecraft/src/Packet17Sleep.java.patch b/patches/net/minecraft/src/Packet17Sleep.java.patch new file mode 100644 index 0000000..f3f52dd --- /dev/null +++ b/patches/net/minecraft/src/Packet17Sleep.java.patch @@ -0,0 +1,82 @@ +--- net/minecraft/src/Packet17Sleep.java ++++ net/minecraft/src/Packet17Sleep.java +@@ -11,37 +11,48 @@ + public int bedZ; + public int field_73622_e; + +- public Packet17Sleep() { +- } +- +- public Packet17Sleep(Entity var1, int var2, int var3, int var4, int var5) { +- this.field_73622_e = var2; +- this.bedX = var3; +- this.bedY = var4; +- this.bedZ = var5; +- this.entityID = var1.entityId; +- } +- +- public void readPacketData(DataInput var1) throws IOException { +- this.entityID = var1.readInt(); +- this.field_73622_e = var1.readByte(); +- this.bedX = var1.readInt(); +- this.bedY = var1.readByte(); +- this.bedZ = var1.readInt(); +- } +- +- public void writePacketData(DataOutput var1) throws IOException { +- var1.writeInt(this.entityID); +- var1.writeByte(this.field_73622_e); +- var1.writeInt(this.bedX); +- var1.writeByte(this.bedY); +- var1.writeInt(this.bedZ); +- } +- +- public void processPacket(NetHandler var1) { +- var1.handleSleep(this); +- } +- ++ public Packet17Sleep() {} ++ ++ public Packet17Sleep(Entity par1Entity, int par2, int par3, int par4, int par5) { ++ this.field_73622_e = par2; ++ this.bedX = par3; ++ this.bedY = par4; ++ this.bedZ = par5; ++ this.entityID = par1Entity.entityId; ++ } ++ ++ /** ++ * Abstract. Reads the raw packet data from the data stream. ++ */ ++ public void readPacketData(DataInput par1DataInput) throws IOException { ++ this.entityID = par1DataInput.readInt(); ++ this.field_73622_e = par1DataInput.readByte(); ++ this.bedX = par1DataInput.readInt(); ++ this.bedY = par1DataInput.readByte(); ++ this.bedZ = par1DataInput.readInt(); ++ } ++ ++ /** ++ * Abstract. Writes the raw packet data to the data stream. ++ */ ++ public void writePacketData(DataOutput par1DataOutput) throws IOException { ++ par1DataOutput.writeInt(this.entityID); ++ par1DataOutput.writeByte(this.field_73622_e); ++ par1DataOutput.writeInt(this.bedX); ++ par1DataOutput.writeByte(this.bedY); ++ par1DataOutput.writeInt(this.bedZ); ++ } ++ ++ /** ++ * Passes this Packet on to the NetHandler for processing. ++ */ ++ public void processPacket(NetHandler par1NetHandler) { ++ par1NetHandler.handleSleep(this); ++ } ++ ++ /** ++ * Abstract. Return the size of the packet (not counting the header). ++ */ + public int getPacketSize() { + return 14; + } diff --git a/patches/net/minecraft/src/Packet18Animation.java.patch b/patches/net/minecraft/src/Packet18Animation.java.patch new file mode 100644 index 0000000..46ac1f0 --- /dev/null +++ b/patches/net/minecraft/src/Packet18Animation.java.patch @@ -0,0 +1,92 @@ +--- net/minecraft/src/Packet18Animation.java ++++ net/minecraft/src/Packet18Animation.java +@@ -4,32 +4,66 @@ + import java.io.DataOutput; + import java.io.IOException; + ++import org.spoutcraft.client.SpoutClient; ++import org.spoutcraft.client.packet.PacketFullVersion; ++import org.spoutcraft.client.packet.PacketRenderDistance; ++ + public class Packet18Animation extends Packet { ++ ++ /** The entity ID, in this case it's the player ID. */ + public int entityId; + public int animate; +- +- public Packet18Animation() { +- } +- +- public Packet18Animation(Entity var1, int var2) { +- this.entityId = var1.entityId; +- this.animate = var2; +- } +- +- public void readPacketData(DataInput var1) throws IOException { +- this.entityId = var1.readInt(); +- this.animate = var1.readByte(); +- } +- +- public void writePacketData(DataOutput var1) throws IOException { +- var1.writeInt(this.entityId); +- var1.writeByte(this.animate); +- } +- +- public void processPacket(NetHandler var1) { +- var1.handleAnimation(this); +- } +- ++ // Spout Start ++ Minecraft mc = SpoutClient.getHandle(); ++ // Spout End ++ ++ public Packet18Animation() {} ++ ++ public Packet18Animation(Entity par1Entity, int par2) { ++ this.entityId = par1Entity.entityId; ++ this.animate = par2; ++ } ++ ++ /** ++ * Abstract. Reads the raw packet data from the data stream. ++ */ ++ public void readPacketData(DataInput par1DataInput) throws IOException { ++ this.entityId = par1DataInput.readInt(); ++ this.animate = par1DataInput.readByte(); ++ } ++ ++ /** ++ * Abstract. Writes the raw packet data to the data stream. ++ */ ++ public void writePacketData(DataOutput par1DataOutput) throws IOException { ++ par1DataOutput.writeInt(this.entityId); ++ par1DataOutput.writeByte(this.animate); ++ } ++ ++ /** ++ * Passes this Packet on to the NetHandler for processing. ++ */ ++ public void processPacket(NetHandler par1NetHandler) { ++ // Spout Start ++ if (entityId == -42) { ++ SpoutClient.getInstance().setSpoutVersion(1); ++ ((NetClientHandler) par1NetHandler).addToSendQueue(this); ++ SpoutClient.getInstance().getPacketManager().sendSpoutPacket(new PacketRenderDistance((byte)Minecraft.getMinecraft().gameSettings.renderDistance)); ++ SpoutClient.getInstance().getPacketManager().sendSpoutPacket(new PacketFullVersion(SpoutClient.getClientVersion())); ++ System.out.println("Detected SpoutPlugin enabled server."); ++ if (this.mc.currentScreen instanceof GuiDownloadTerrain) { ++ this.mc.displayGuiScreen(null, true); ++ this.mc.displayGuiScreen(new org.spoutcraft.client.gui.precache.GuiPrecache()); ++ } ++ } else { ++ par1NetHandler.handleAnimation(this); ++ } ++ // Spout End ++ } ++ ++ /** ++ * Abstract. Return the size of the packet (not counting the header). ++ */ + public int getPacketSize() { + return 5; + } diff --git a/patches/net/minecraft/src/Packet19EntityAction.java.patch b/patches/net/minecraft/src/Packet19EntityAction.java.patch new file mode 100644 index 0000000..646b0bf --- /dev/null +++ b/patches/net/minecraft/src/Packet19EntityAction.java.patch @@ -0,0 +1,89 @@ +--- net/minecraft/src/Packet19EntityAction.java ++++ net/minecraft/src/Packet19EntityAction.java +@@ -5,39 +5,57 @@ + import java.io.IOException; + + public class Packet19EntityAction extends Packet { ++ ++ /** Player ID. */ + public int entityId; ++ ++ /** ++ * 1=start sneaking, 2=stop sneaking, 3=wake up, 4=start sprinting, 5=stop sprinting, 6 = horse jump?, 7 = open horse ++ * GUI ++ */ + public int action; + public int auxData; + +- public Packet19EntityAction() { +- } +- +- public Packet19EntityAction(Entity var1, int var2) { +- this(var1, var2, 0); +- } +- +- public Packet19EntityAction(Entity var1, int var2, int var3) { +- this.entityId = var1.entityId; +- this.action = var2; +- this.auxData = var3; +- } +- +- public void readPacketData(DataInput var1) throws IOException { +- this.entityId = var1.readInt(); +- this.action = var1.readByte(); +- this.auxData = var1.readInt(); +- } +- +- public void writePacketData(DataOutput var1) throws IOException { +- var1.writeInt(this.entityId); +- var1.writeByte(this.action); +- var1.writeInt(this.auxData); +- } +- +- public void processPacket(NetHandler var1) { +- var1.handleEntityAction(this); +- } +- ++ public Packet19EntityAction() {} ++ ++ public Packet19EntityAction(Entity par1Entity, int par2) { ++ this(par1Entity, par2, 0); ++ } ++ ++ public Packet19EntityAction(Entity par1Entity, int par2, int par3) { ++ this.entityId = par1Entity.entityId; ++ this.action = par2; ++ this.auxData = par3; ++ } ++ ++ /** ++ * Abstract. Reads the raw packet data from the data stream. ++ */ ++ public void readPacketData(DataInput par1DataInput) throws IOException { ++ this.entityId = par1DataInput.readInt(); ++ this.action = par1DataInput.readByte(); ++ this.auxData = par1DataInput.readInt(); ++ } ++ ++ /** ++ * Abstract. Writes the raw packet data to the data stream. ++ */ ++ public void writePacketData(DataOutput par1DataOutput) throws IOException { ++ par1DataOutput.writeInt(this.entityId); ++ par1DataOutput.writeByte(this.action); ++ par1DataOutput.writeInt(this.auxData); ++ } ++ ++ /** ++ * Passes this Packet on to the NetHandler for processing. ++ */ ++ public void processPacket(NetHandler par1NetHandler) { ++ par1NetHandler.handleEntityAction(this); ++ } ++ ++ /** ++ * Abstract. Return the size of the packet (not counting the header). ++ */ + public int getPacketSize() { + return 9; + } diff --git a/patches/net/minecraft/src/Packet1Login.java.patch b/patches/net/minecraft/src/Packet1Login.java.patch new file mode 100644 index 0000000..646995b --- /dev/null +++ b/patches/net/minecraft/src/Packet1Login.java.patch @@ -0,0 +1,141 @@ +--- net/minecraft/src/Packet1Login.java ++++ net/minecraft/src/Packet1Login.java +@@ -4,70 +4,99 @@ + import java.io.DataOutput; + import java.io.IOException; + ++import org.spoutcraft.client.DataMiningThread; ++ + public class Packet1Login extends Packet { ++ ++ /** The player's entity ID */ + public int clientEntityId; + public WorldType terrainType; + public boolean hardcoreMode; + public EnumGameType gameType; ++ ++ /** -1: The Nether, 0: The Overworld, 1: The End */ + public int dimension; ++ ++ /** The difficulty setting byte. */ + public byte difficultySetting; ++ ++ /** Defaults to 128 */ + public byte worldHeight; ++ ++ /** The maximum players. */ + public byte maxPlayers; + +- public Packet1Login() { +- } +- +- public Packet1Login(int var1, WorldType var2, EnumGameType var3, boolean var4, int var5, int var6, int var7, int var8) { +- this.clientEntityId = var1; +- this.terrainType = var2; +- this.dimension = var5; +- this.difficultySetting = (byte)var6; +- this.gameType = var3; +- this.worldHeight = (byte)var7; +- this.maxPlayers = (byte)var8; +- this.hardcoreMode = var4; +- } +- +- public void readPacketData(DataInput var1) throws IOException { +- this.clientEntityId = var1.readInt(); +- String var2 = readString(var1, 16); ++ public Packet1Login() {} ++ ++ public Packet1Login(int par1, WorldType par2WorldType, EnumGameType par3EnumGameType, boolean par4, int par5, int par6, int par7, int par8) { ++ this.clientEntityId = par1; ++ this.terrainType = par2WorldType; ++ this.dimension = par5; ++ this.difficultySetting = (byte)par6; ++ this.gameType = par3EnumGameType; ++ this.worldHeight = (byte)par7; ++ this.maxPlayers = (byte)par8; ++ this.hardcoreMode = par4; ++ } ++ ++ /** ++ * Abstract. Reads the raw packet data from the data stream. ++ */ ++ public void readPacketData(DataInput par1DataInput) throws IOException { ++ this.clientEntityId = par1DataInput.readInt(); ++ String var2 = readString(par1DataInput, 16); + this.terrainType = WorldType.parseWorldType(var2); +- if(this.terrainType == null) { ++ ++ if (this.terrainType == null) { + this.terrainType = WorldType.DEFAULT; + } + +- byte var3 = var1.readByte(); ++ byte var3 = par1DataInput.readByte(); + this.hardcoreMode = (var3 & 8) == 8; + int var4 = var3 & -9; + this.gameType = EnumGameType.getByID(var4); +- this.dimension = var1.readByte(); +- this.difficultySetting = var1.readByte(); +- this.worldHeight = var1.readByte(); +- this.maxPlayers = var1.readByte(); ++ this.dimension = par1DataInput.readByte(); ++ this.difficultySetting = par1DataInput.readByte(); ++ this.worldHeight = par1DataInput.readByte(); ++ this.maxPlayers = par1DataInput.readByte(); + } + +- public void writePacketData(DataOutput var1) throws IOException { +- var1.writeInt(this.clientEntityId); +- writeString(this.terrainType == null ? "" : this.terrainType.getWorldTypeName(), var1); ++ /** ++ * Abstract. Writes the raw packet data to the data stream. ++ */ ++ public void writePacketData(DataOutput par1DataOutput) throws IOException { ++ par1DataOutput.writeInt(this.clientEntityId); ++ writeString(this.terrainType == null ? "" : this.terrainType.getWorldTypeName(), par1DataOutput); + int var2 = this.gameType.getID(); +- if(this.hardcoreMode) { ++ ++ if (this.hardcoreMode) { + var2 |= 8; + } + +- var1.writeByte(var2); +- var1.writeByte(this.dimension); +- var1.writeByte(this.difficultySetting); +- var1.writeByte(this.worldHeight); +- var1.writeByte(this.maxPlayers); +- } +- +- public void processPacket(NetHandler var1) { +- var1.handleLogin(this); +- } +- ++ par1DataOutput.writeByte(var2); ++ par1DataOutput.writeByte(this.dimension); ++ par1DataOutput.writeByte(this.difficultySetting); ++ par1DataOutput.writeByte(this.worldHeight); ++ par1DataOutput.writeByte(this.maxPlayers); ++ } ++ ++ /** ++ * Passes this Packet on to the NetHandler for processing. ++ */ ++ public void processPacket(NetHandler par1NetHandler) { ++ // Spout Start ++ DataMiningThread.getInstance().onLogin(); ++ // Spout End ++ par1NetHandler.handleLogin(this); ++ } ++ ++ /** ++ * Abstract. Return the size of the packet (not counting the header). ++ */ + public int getPacketSize() { + int var1 = 0; +- if(this.terrainType != null) { ++ ++ if (this.terrainType != null) { + var1 = this.terrainType.getWorldTypeName().length(); + } + diff --git a/patches/net/minecraft/src/Packet200Statistic.java.patch b/patches/net/minecraft/src/Packet200Statistic.java.patch new file mode 100644 index 0000000..479607f --- /dev/null +++ b/patches/net/minecraft/src/Packet200Statistic.java.patch @@ -0,0 +1,72 @@ +--- net/minecraft/src/Packet200Statistic.java ++++ net/minecraft/src/Packet200Statistic.java +@@ -8,32 +8,47 @@ + public int statisticId; + public int amount; + +- public Packet200Statistic() { +- } +- +- public Packet200Statistic(int var1, int var2) { +- this.statisticId = var1; +- this.amount = var2; +- } +- +- public void processPacket(NetHandler var1) { +- var1.handleStatistic(this); +- } +- +- public void readPacketData(DataInput var1) throws IOException { +- this.statisticId = var1.readInt(); +- this.amount = var1.readInt(); +- } +- +- public void writePacketData(DataOutput var1) throws IOException { +- var1.writeInt(this.statisticId); +- var1.writeInt(this.amount); +- } +- ++ public Packet200Statistic() {} ++ ++ public Packet200Statistic(int par1, int par2) { ++ this.statisticId = par1; ++ this.amount = par2; ++ } ++ ++ /** ++ * Passes this Packet on to the NetHandler for processing. ++ */ ++ public void processPacket(NetHandler par1NetHandler) { ++ par1NetHandler.handleStatistic(this); ++ } ++ ++ /** ++ * Abstract. Reads the raw packet data from the data stream. ++ */ ++ public void readPacketData(DataInput par1DataInput) throws IOException { ++ this.statisticId = par1DataInput.readInt(); ++ this.amount = par1DataInput.readInt(); ++ } ++ ++ /** ++ * Abstract. Writes the raw packet data to the data stream. ++ */ ++ public void writePacketData(DataOutput par1DataOutput) throws IOException { ++ par1DataOutput.writeInt(this.statisticId); ++ par1DataOutput.writeInt(this.amount); ++ } ++ ++ /** ++ * Abstract. Return the size of the packet (not counting the header). ++ */ + public int getPacketSize() { + return 6; + } + ++ /** ++ * If this returns true, the packet may be processed on any thread; otherwise it is queued for the main thread to ++ * handle. ++ */ + public boolean canProcessAsync() { + return true; + } diff --git a/patches/net/minecraft/src/Packet201PlayerInfo.java.patch b/patches/net/minecraft/src/Packet201PlayerInfo.java.patch new file mode 100644 index 0000000..341f5b6 --- /dev/null +++ b/patches/net/minecraft/src/Packet201PlayerInfo.java.patch @@ -0,0 +1,81 @@ +--- net/minecraft/src/Packet201PlayerInfo.java ++++ net/minecraft/src/Packet201PlayerInfo.java +@@ -5,36 +5,51 @@ + import java.io.IOException; + + public class Packet201PlayerInfo extends Packet { +- public String a; ++ ++ /** The player's name. */ ++ public String playerName; ++ ++ /** Byte that tells whether the player is connected. */ + public boolean isConnected; + public int ping; + +- public Packet201PlayerInfo() { +- } +- +- public Packet201PlayerInfo(String var1, boolean var2, int var3) { +- this.a = var1; +- this.isConnected = var2; +- this.ping = var3; +- } +- +- public void readPacketData(DataInput var1) throws IOException { +- this.a = readString(var1, 16); +- this.isConnected = var1.readByte() != 0; +- this.ping = var1.readShort(); +- } +- +- public void writePacketData(DataOutput var1) throws IOException { +- writeString(this.a, var1); +- var1.writeByte(this.isConnected ? 1 : 0); +- var1.writeShort(this.ping); +- } +- +- public void processPacket(NetHandler var1) { +- var1.handlePlayerInfo(this); +- } +- ++ public Packet201PlayerInfo() {} ++ ++ public Packet201PlayerInfo(String par1Str, boolean par2, int par3) { ++ this.playerName = par1Str; ++ this.isConnected = par2; ++ this.ping = par3; ++ } ++ ++ /** ++ * Abstract. Reads the raw packet data from the data stream. ++ */ ++ public void readPacketData(DataInput par1DataInput) throws IOException { ++ this.playerName = readString(par1DataInput, 16); ++ this.isConnected = par1DataInput.readByte() != 0; ++ this.ping = par1DataInput.readShort(); ++ } ++ ++ /** ++ * Abstract. Writes the raw packet data to the data stream. ++ */ ++ public void writePacketData(DataOutput par1DataOutput) throws IOException { ++ writeString(this.playerName, par1DataOutput); ++ par1DataOutput.writeByte(this.isConnected ? 1 : 0); ++ par1DataOutput.writeShort(this.ping); ++ } ++ ++ /** ++ * Passes this Packet on to the NetHandler for processing. ++ */ ++ public void processPacket(NetHandler par1NetHandler) { ++ par1NetHandler.handlePlayerInfo(this); ++ } ++ ++ /** ++ * Abstract. Return the size of the packet (not counting the header). ++ */ + public int getPacketSize() { +- return this.a.length() + 2 + 1 + 2; ++ return this.playerName.length() + 2 + 1 + 2; + } + } diff --git a/patches/net/minecraft/src/Packet202PlayerAbilities.java.patch b/patches/net/minecraft/src/Packet202PlayerAbilities.java.patch new file mode 100644 index 0000000..8d11e90 --- /dev/null +++ b/patches/net/minecraft/src/Packet202PlayerAbilities.java.patch @@ -0,0 +1,205 @@ +--- net/minecraft/src/Packet202PlayerAbilities.java ++++ net/minecraft/src/Packet202PlayerAbilities.java +@@ -5,62 +5,84 @@ + import java.io.IOException; + + public class Packet202PlayerAbilities extends Packet { ++ ++ /** Disables player damage. */ + private boolean disableDamage; ++ ++ /** Indicates whether the player is flying or not. */ + private boolean isFlying; ++ ++ /** Whether or not to allow the player to fly when they double jump. */ + private boolean allowFlying; ++ ++ /** ++ * Used to determine if creative mode is enabled, and therefore if items should be depleted on usage ++ */ + private boolean isCreativeMode; + private float flySpeed; + private float walkSpeed; + +- public Packet202PlayerAbilities() { +- } +- +- public Packet202PlayerAbilities(PlayerCapabilities var1) { +- this.setDisableDamage(var1.disableDamage); +- this.setFlying(var1.isFlying); +- this.setAllowFlying(var1.allowFlying); +- this.setCreativeMode(var1.isCreativeMode); +- this.setFlySpeed(var1.getFlySpeed()); +- this.setWalkSpeed(var1.getWalkSpeed()); +- } +- +- public void readPacketData(DataInput var1) throws IOException { +- byte var2 = var1.readByte(); ++ public Packet202PlayerAbilities() {} ++ ++ public Packet202PlayerAbilities(PlayerCapabilities par1PlayerCapabilities) { ++ this.setDisableDamage(par1PlayerCapabilities.disableDamage); ++ this.setFlying(par1PlayerCapabilities.isFlying); ++ this.setAllowFlying(par1PlayerCapabilities.allowFlying); ++ this.setCreativeMode(par1PlayerCapabilities.isCreativeMode); ++ this.setFlySpeed(par1PlayerCapabilities.getFlySpeed()); ++ this.setWalkSpeed(par1PlayerCapabilities.getWalkSpeed()); ++ } ++ ++ /** ++ * Abstract. Reads the raw packet data from the data stream. ++ */ ++ public void readPacketData(DataInput par1DataInput) throws IOException { ++ byte var2 = par1DataInput.readByte(); + this.setDisableDamage((var2 & 1) > 0); + this.setFlying((var2 & 2) > 0); + this.setAllowFlying((var2 & 4) > 0); + this.setCreativeMode((var2 & 8) > 0); +- this.setFlySpeed(var1.readFloat()); +- this.setWalkSpeed(var1.readFloat()); ++ this.setFlySpeed(par1DataInput.readFloat()); ++ this.setWalkSpeed(par1DataInput.readFloat()); + } + +- public void writePacketData(DataOutput var1) throws IOException { ++ /** ++ * Abstract. Writes the raw packet data to the data stream. ++ */ ++ public void writePacketData(DataOutput par1DataOutput) throws IOException { + byte var2 = 0; +- if(this.getDisableDamage()) { ++ ++ if (this.getDisableDamage()) { + var2 = (byte)(var2 | 1); + } + +- if(this.getFlying()) { ++ if (this.getFlying()) { + var2 = (byte)(var2 | 2); + } + +- if(this.getAllowFlying()) { ++ if (this.getAllowFlying()) { + var2 = (byte)(var2 | 4); + } + +- if(this.isCreativeMode()) { ++ if (this.isCreativeMode()) { + var2 = (byte)(var2 | 8); + } + +- var1.writeByte(var2); +- var1.writeFloat(this.flySpeed); +- var1.writeFloat(this.walkSpeed); +- } +- +- public void processPacket(NetHandler var1) { +- var1.handlePlayerAbilities(this); +- } +- ++ par1DataOutput.writeByte(var2); ++ par1DataOutput.writeFloat(this.flySpeed); ++ par1DataOutput.writeFloat(this.walkSpeed); ++ } ++ ++ /** ++ * Passes this Packet on to the NetHandler for processing. ++ */ ++ public void processPacket(NetHandler par1NetHandler) { ++ par1NetHandler.handlePlayerAbilities(this); ++ } ++ ++ /** ++ * Abstract. Return the size of the packet (not counting the header). ++ */ + public int getPacketSize() { + return 2; + } +@@ -69,55 +91,74 @@ + return this.disableDamage; + } + +- public void setDisableDamage(boolean var1) { +- this.disableDamage = var1; ++ /** ++ * Sets whether damage is disabled or not. ++ */ ++ public void setDisableDamage(boolean par1) { ++ this.disableDamage = par1; + } + + public boolean getFlying() { + return this.isFlying; + } + +- public void setFlying(boolean var1) { +- this.isFlying = var1; ++ /** ++ * Sets whether we're currently flying or not. ++ */ ++ public void setFlying(boolean par1) { ++ this.isFlying = par1; + } + + public boolean getAllowFlying() { + return this.allowFlying; + } + +- public void setAllowFlying(boolean var1) { +- this.allowFlying = var1; ++ public void setAllowFlying(boolean par1) { ++ this.allowFlying = par1; + } + + public boolean isCreativeMode() { + return this.isCreativeMode; + } + +- public void setCreativeMode(boolean var1) { +- this.isCreativeMode = var1; ++ public void setCreativeMode(boolean par1) { ++ this.isCreativeMode = par1; + } + + public float getFlySpeed() { + return this.flySpeed; + } + +- public void setFlySpeed(float var1) { +- this.flySpeed = var1; ++ /** ++ * Sets the flying speed. ++ */ ++ public void setFlySpeed(float par1) { ++ this.flySpeed = par1; + } + + public float getWalkSpeed() { + return this.walkSpeed; + } + +- public void setWalkSpeed(float var1) { +- this.walkSpeed = var1; ++ /** ++ * Sets the walking speed. ++ */ ++ public void setWalkSpeed(float par1) { ++ this.walkSpeed = par1; + } + ++ /** ++ * only false for the abstract Packet class, all real packets return true ++ */ + public boolean isRealPacket() { + return true; + } + +- public boolean containsSameEntityIDAs(Packet var1) { ++ /** ++ * eg return packet30entity.entityId == entityId; WARNING : will throw if you compare a packet to a different packet ++ * class ++ */ ++ public boolean containsSameEntityIDAs(Packet par1Packet) { + return true; + } + } diff --git a/patches/net/minecraft/src/Packet203AutoComplete.java.patch b/patches/net/minecraft/src/Packet203AutoComplete.java.patch new file mode 100644 index 0000000..8646289 --- /dev/null +++ b/patches/net/minecraft/src/Packet203AutoComplete.java.patch @@ -0,0 +1,90 @@ +--- net/minecraft/src/Packet203AutoComplete.java ++++ net/minecraft/src/Packet203AutoComplete.java +@@ -5,40 +5,63 @@ + import java.io.IOException; + + public class Packet203AutoComplete extends Packet { +- private String a; +- +- public Packet203AutoComplete() { +- } +- +- public Packet203AutoComplete(String var1) { +- this.a = var1; +- } +- +- public void readPacketData(DataInput var1) throws IOException { +- this.a = readString(var1, Short.MAX_VALUE); +- } +- +- public void writePacketData(DataOutput var1) throws IOException { +- writeString(org.apache.commons.lang3.StringUtils.substring(this.a, 0, Short.MAX_VALUE), var1); +- } +- +- public void processPacket(NetHandler var1) { +- var1.handleAutoComplete(this); +- } +- ++ ++ /** ++ * Sent by the client containing the text to be autocompleted. Sent by the server with possible completions separated ++ * by null (two bytes in UTF-16) ++ */ ++ private String text; ++ ++ public Packet203AutoComplete() {} ++ ++ public Packet203AutoComplete(String par1Str) { ++ this.text = par1Str; ++ } ++ ++ /** ++ * Abstract. Reads the raw packet data from the data stream. ++ */ ++ public void readPacketData(DataInput par1DataInput) throws IOException { ++ this.text = readString(par1DataInput, 32767); ++ } ++ ++ /** ++ * Abstract. Writes the raw packet data to the data stream. ++ */ ++ public void writePacketData(DataOutput par1DataOutput) throws IOException { ++ writeString(org.apache.commons.lang3.StringUtils.substring(this.text, 0, 32767), par1DataOutput); ++ } ++ ++ /** ++ * Passes this Packet on to the NetHandler for processing. ++ */ ++ public void processPacket(NetHandler par1NetHandler) { ++ par1NetHandler.handleAutoComplete(this); ++ } ++ ++ /** ++ * Abstract. Return the size of the packet (not counting the header). ++ */ + public int getPacketSize() { +- return 2 + this.a.length() * 2; ++ return 2 + this.text.length() * 2; + } + + public String getText() { +- return this.a; ++ return this.text; + } + ++ /** ++ * only false for the abstract Packet class, all real packets return true ++ */ + public boolean isRealPacket() { + return true; + } + +- public boolean containsSameEntityIDAs(Packet var1) { ++ /** ++ * eg return packet30entity.entityId == entityId; WARNING : will throw if you compare a packet to a different packet ++ * class ++ */ ++ public boolean containsSameEntityIDAs(Packet par1Packet) { + return true; + } + } diff --git a/patches/net/minecraft/src/Packet204ClientInfo.java.patch b/patches/net/minecraft/src/Packet204ClientInfo.java.patch new file mode 100644 index 0000000..e467057 --- /dev/null +++ b/patches/net/minecraft/src/Packet204ClientInfo.java.patch @@ -0,0 +1,121 @@ +--- net/minecraft/src/Packet204ClientInfo.java ++++ net/minecraft/src/Packet204ClientInfo.java +@@ -5,53 +5,64 @@ + import java.io.IOException; + + public class Packet204ClientInfo extends Packet { +- private String a; ++ private String language; + private int renderDistance; + private int chatVisisble; + private boolean chatColours; + private int gameDifficulty; + private boolean showCape; + +- public Packet204ClientInfo() { +- } +- +- public Packet204ClientInfo(String var1, int var2, int var3, boolean var4, int var5, boolean var6) { +- this.a = var1; +- this.renderDistance = var2; +- this.chatVisisble = var3; +- this.chatColours = var4; +- this.gameDifficulty = var5; +- this.showCape = var6; +- } +- +- public void readPacketData(DataInput var1) throws IOException { +- this.a = readString(var1, 7); +- this.renderDistance = var1.readByte(); +- byte var2 = var1.readByte(); ++ public Packet204ClientInfo() {} ++ ++ public Packet204ClientInfo(String par1Str, int par2, int par3, boolean par4, int par5, boolean par6) { ++ this.language = par1Str; ++ this.renderDistance = par2; ++ this.chatVisisble = par3; ++ this.chatColours = par4; ++ this.gameDifficulty = par5; ++ this.showCape = par6; ++ } ++ ++ /** ++ * Abstract. Reads the raw packet data from the data stream. ++ */ ++ public void readPacketData(DataInput par1DataInput) throws IOException { ++ this.language = readString(par1DataInput, 7); ++ this.renderDistance = par1DataInput.readByte(); ++ byte var2 = par1DataInput.readByte(); + this.chatVisisble = var2 & 7; + this.chatColours = (var2 & 8) == 8; +- this.gameDifficulty = var1.readByte(); +- this.showCape = var1.readBoolean(); +- } +- +- public void writePacketData(DataOutput var1) throws IOException { +- writeString(this.a, var1); +- var1.writeByte(this.renderDistance); +- var1.writeByte(this.chatVisisble | (this.chatColours ? 1 : 0) << 3); +- var1.writeByte(this.gameDifficulty); +- var1.writeBoolean(this.showCape); +- } +- +- public void processPacket(NetHandler var1) { +- var1.handleClientInfo(this); +- } +- ++ this.gameDifficulty = par1DataInput.readByte(); ++ this.showCape = par1DataInput.readBoolean(); ++ } ++ ++ /** ++ * Abstract. Writes the raw packet data to the data stream. ++ */ ++ public void writePacketData(DataOutput par1DataOutput) throws IOException { ++ writeString(this.language, par1DataOutput); ++ par1DataOutput.writeByte(this.renderDistance); ++ par1DataOutput.writeByte(this.chatVisisble | (this.chatColours ? 1 : 0) << 3); ++ par1DataOutput.writeByte(this.gameDifficulty); ++ par1DataOutput.writeBoolean(this.showCape); ++ } ++ ++ /** ++ * Passes this Packet on to the NetHandler for processing. ++ */ ++ public void processPacket(NetHandler par1NetHandler) { ++ par1NetHandler.handleClientInfo(this); ++ } ++ ++ /** ++ * Abstract. Return the size of the packet (not counting the header). ++ */ + public int getPacketSize() { + return 7; + } + + public String getLanguage() { +- return this.a; ++ return this.language; + } + + public int getRenderDistance() { +@@ -74,11 +85,18 @@ + return this.showCape; + } + ++ /** ++ * only false for the abstract Packet class, all real packets return true ++ */ + public boolean isRealPacket() { + return true; + } + +- public boolean containsSameEntityIDAs(Packet var1) { ++ /** ++ * eg return packet30entity.entityId == entityId; WARNING : will throw if you compare a packet to a different packet ++ * class ++ */ ++ public boolean containsSameEntityIDAs(Packet par1Packet) { + return true; + } + } diff --git a/patches/net/minecraft/src/Packet205ClientCommand.java.patch b/patches/net/minecraft/src/Packet205ClientCommand.java.patch new file mode 100644 index 0000000..7110431 --- /dev/null +++ b/patches/net/minecraft/src/Packet205ClientCommand.java.patch @@ -0,0 +1,64 @@ +--- net/minecraft/src/Packet205ClientCommand.java ++++ net/minecraft/src/Packet205ClientCommand.java +@@ -5,27 +5,42 @@ + import java.io.IOException; + + public class Packet205ClientCommand extends Packet { ++ ++ /** ++ * 0 sent to a netLoginHandler starts the server, 1 sent to NetServerHandler forces a respawn ++ */ + public int forceRespawn; + +- public Packet205ClientCommand() { +- } +- +- public Packet205ClientCommand(int var1) { +- this.forceRespawn = var1; +- } +- +- public void readPacketData(DataInput var1) throws IOException { +- this.forceRespawn = var1.readByte(); +- } +- +- public void writePacketData(DataOutput var1) throws IOException { +- var1.writeByte(this.forceRespawn & 255); +- } +- +- public void processPacket(NetHandler var1) { +- var1.handleClientCommand(this); +- } +- ++ public Packet205ClientCommand() {} ++ ++ public Packet205ClientCommand(int par1) { ++ this.forceRespawn = par1; ++ } ++ ++ /** ++ * Abstract. Reads the raw packet data from the data stream. ++ */ ++ public void readPacketData(DataInput par1DataInput) throws IOException { ++ this.forceRespawn = par1DataInput.readByte(); ++ } ++ ++ /** ++ * Abstract. Writes the raw packet data to the data stream. ++ */ ++ public void writePacketData(DataOutput par1DataOutput) throws IOException { ++ par1DataOutput.writeByte(this.forceRespawn & 255); ++ } ++ ++ /** ++ * Passes this Packet on to the NetHandler for processing. ++ */ ++ public void processPacket(NetHandler par1NetHandler) { ++ par1NetHandler.handleClientCommand(this); ++ } ++ ++ /** ++ * Abstract. Return the size of the packet (not counting the header). ++ */ + public int getPacketSize() { + return 1; + } diff --git a/patches/net/minecraft/src/Packet206SetObjective.java.patch b/patches/net/minecraft/src/Packet206SetObjective.java.patch new file mode 100644 index 0000000..cbba3a1 --- /dev/null +++ b/patches/net/minecraft/src/Packet206SetObjective.java.patch @@ -0,0 +1,82 @@ +--- net/minecraft/src/Packet206SetObjective.java ++++ net/minecraft/src/Packet206SetObjective.java +@@ -5,36 +5,51 @@ + import java.io.IOException; + + public class Packet206SetObjective extends Packet { +- public String a; +- public String b; ++ public String objectiveName; ++ public String objectiveDisplayName; ++ ++ /** ++ * 0 to create scoreboard, 1 to remove scoreboard, 2 to update display text. ++ */ + public int change; + +- public Packet206SetObjective() { +- } +- +- public Packet206SetObjective(ScoreObjective var1, int var2) { +- this.a = var1.getName(); +- this.b = var1.getDisplayName(); +- this.change = var2; +- } +- +- public void readPacketData(DataInput var1) throws IOException { +- this.a = readString(var1, 16); +- this.b = readString(var1, 32); +- this.change = var1.readByte(); +- } +- +- public void writePacketData(DataOutput var1) throws IOException { +- writeString(this.a, var1); +- writeString(this.b, var1); +- var1.writeByte(this.change); +- } +- +- public void processPacket(NetHandler var1) { +- var1.handleSetObjective(this); +- } +- ++ public Packet206SetObjective() {} ++ ++ public Packet206SetObjective(ScoreObjective par1ScoreObjective, int par2) { ++ this.objectiveName = par1ScoreObjective.getName(); ++ this.objectiveDisplayName = par1ScoreObjective.getDisplayName(); ++ this.change = par2; ++ } ++ ++ /** ++ * Abstract. Reads the raw packet data from the data stream. ++ */ ++ public void readPacketData(DataInput par1DataInput) throws IOException { ++ this.objectiveName = readString(par1DataInput, 16); ++ this.objectiveDisplayName = readString(par1DataInput, 32); ++ this.change = par1DataInput.readByte(); ++ } ++ ++ /** ++ * Abstract. Writes the raw packet data to the data stream. ++ */ ++ public void writePacketData(DataOutput par1DataOutput) throws IOException { ++ writeString(this.objectiveName, par1DataOutput); ++ writeString(this.objectiveDisplayName, par1DataOutput); ++ par1DataOutput.writeByte(this.change); ++ } ++ ++ /** ++ * Passes this Packet on to the NetHandler for processing. ++ */ ++ public void processPacket(NetHandler par1NetHandler) { ++ par1NetHandler.handleSetObjective(this); ++ } ++ ++ /** ++ * Abstract. Return the size of the packet (not counting the header). ++ */ + public int getPacketSize() { +- return 2 + this.a.length() + 2 + this.b.length() + 1; ++ return 2 + this.objectiveName.length() + 2 + this.objectiveDisplayName.length() + 1; + } + } diff --git a/patches/net/minecraft/src/Packet207SetScore.java.patch b/patches/net/minecraft/src/Packet207SetScore.java.patch new file mode 100644 index 0000000..76ab998 --- /dev/null +++ b/patches/net/minecraft/src/Packet207SetScore.java.patch @@ -0,0 +1,119 @@ +--- net/minecraft/src/Packet207SetScore.java ++++ net/minecraft/src/Packet207SetScore.java +@@ -5,53 +5,76 @@ + import java.io.IOException; + + public class Packet207SetScore extends Packet { +- public String a = ""; +- public String b = ""; ++ ++ /** An unique name to be displayed in the list. */ ++ public String itemName = ""; ++ ++ /** ++ * The unique name for the scoreboard to be updated. Only sent when updateOrRemove does not equal 1. ++ */ ++ public String scoreName = ""; ++ ++ /** ++ * The score to be displayed next to the entry. Only sent when Update/Remove does not equal 1. ++ */ + public int value; ++ ++ /** 0 to create/update an item. 1 to remove an item. */ + public int updateOrRemove; + +- public Packet207SetScore() { +- } +- +- public Packet207SetScore(Score var1, int var2) { +- this.a = var1.getPlayerName(); +- this.b = var1.func_96645_d().getName(); +- this.value = var1.getScorePoints(); +- this.updateOrRemove = var2; +- } +- +- public Packet207SetScore(String var1) { +- this.a = var1; +- this.b = ""; ++ public Packet207SetScore() {} ++ ++ public Packet207SetScore(Score par1Score, int par2) { ++ this.itemName = par1Score.getPlayerName(); ++ this.scoreName = par1Score.func_96645_d().getName(); ++ this.value = par1Score.getScorePoints(); ++ this.updateOrRemove = par2; ++ } ++ ++ public Packet207SetScore(String par1Str) { ++ this.itemName = par1Str; ++ this.scoreName = ""; + this.value = 0; + this.updateOrRemove = 1; + } + +- public void readPacketData(DataInput var1) throws IOException { +- this.a = readString(var1, 16); +- this.updateOrRemove = var1.readByte(); +- if(this.updateOrRemove != 1) { +- this.b = readString(var1, 16); +- this.value = var1.readInt(); +- } +- +- } +- +- public void writePacketData(DataOutput var1) throws IOException { +- writeString(this.a, var1); +- var1.writeByte(this.updateOrRemove); +- if(this.updateOrRemove != 1) { +- writeString(this.b, var1); +- var1.writeInt(this.value); +- } +- +- } +- +- public void processPacket(NetHandler var1) { +- var1.handleSetScore(this); +- } +- ++ /** ++ * Abstract. Reads the raw packet data from the data stream. ++ */ ++ public void readPacketData(DataInput par1DataInput) throws IOException { ++ this.itemName = readString(par1DataInput, 16); ++ this.updateOrRemove = par1DataInput.readByte(); ++ ++ if (this.updateOrRemove != 1) { ++ this.scoreName = readString(par1DataInput, 16); ++ this.value = par1DataInput.readInt(); ++ } ++ } ++ ++ /** ++ * Abstract. Writes the raw packet data to the data stream. ++ */ ++ public void writePacketData(DataOutput par1DataOutput) throws IOException { ++ writeString(this.itemName, par1DataOutput); ++ par1DataOutput.writeByte(this.updateOrRemove); ++ ++ if (this.updateOrRemove != 1) { ++ writeString(this.scoreName, par1DataOutput); ++ par1DataOutput.writeInt(this.value); ++ } ++ } ++ ++ /** ++ * Passes this Packet on to the NetHandler for processing. ++ */ ++ public void processPacket(NetHandler par1NetHandler) { ++ par1NetHandler.handleSetScore(this); ++ } ++ ++ /** ++ * Abstract. Return the size of the packet (not counting the header). ++ */ + public int getPacketSize() { +- return 2 + (this.a == null ? 0 : this.a.length()) + 2 + (this.b == null ? 0 : this.b.length()) + 4 + 1; ++ return 2 + (this.itemName == null ? 0 : this.itemName.length()) + 2 + (this.scoreName == null ? 0 : this.scoreName.length()) + 4 + 1; + } + } diff --git a/patches/net/minecraft/src/Packet208SetDisplayObjective.java.patch b/patches/net/minecraft/src/Packet208SetDisplayObjective.java.patch new file mode 100644 index 0000000..ab03189 --- /dev/null +++ b/patches/net/minecraft/src/Packet208SetDisplayObjective.java.patch @@ -0,0 +1,83 @@ +--- net/minecraft/src/Packet208SetDisplayObjective.java ++++ net/minecraft/src/Packet208SetDisplayObjective.java +@@ -5,37 +5,52 @@ + import java.io.IOException; + + public class Packet208SetDisplayObjective extends Packet { ++ ++ /** The position of the scoreboard. 0 = list, 1 = sidebar, 2 = belowName. */ + public int scoreboardPosition; +- public String b; +- +- public Packet208SetDisplayObjective() { +- } +- +- public Packet208SetDisplayObjective(int var1, ScoreObjective var2) { +- this.scoreboardPosition = var1; +- if(var2 == null) { +- this.b = ""; ++ ++ /** The unique name for the scoreboard to be displayed. */ ++ public String scoreName; ++ ++ public Packet208SetDisplayObjective() {} ++ ++ public Packet208SetDisplayObjective(int par1, ScoreObjective par2ScoreObjective) { ++ this.scoreboardPosition = par1; ++ ++ if (par2ScoreObjective == null) { ++ this.scoreName = ""; + } else { +- this.b = var2.getName(); ++ this.scoreName = par2ScoreObjective.getName(); + } +- +- } +- +- public void readPacketData(DataInput var1) throws IOException { +- this.scoreboardPosition = var1.readByte(); +- this.b = readString(var1, 16); +- } +- +- public void writePacketData(DataOutput var1) throws IOException { +- var1.writeByte(this.scoreboardPosition); +- writeString(this.b, var1); +- } +- +- public void processPacket(NetHandler var1) { +- var1.handleSetDisplayObjective(this); +- } +- ++ } ++ ++ /** ++ * Abstract. Reads the raw packet data from the data stream. ++ */ ++ public void readPacketData(DataInput par1DataInput) throws IOException { ++ this.scoreboardPosition = par1DataInput.readByte(); ++ this.scoreName = readString(par1DataInput, 16); ++ } ++ ++ /** ++ * Abstract. Writes the raw packet data to the data stream. ++ */ ++ public void writePacketData(DataOutput par1DataOutput) throws IOException { ++ par1DataOutput.writeByte(this.scoreboardPosition); ++ writeString(this.scoreName, par1DataOutput); ++ } ++ ++ /** ++ * Passes this Packet on to the NetHandler for processing. ++ */ ++ public void processPacket(NetHandler par1NetHandler) { ++ par1NetHandler.handleSetDisplayObjective(this); ++ } ++ ++ /** ++ * Abstract. Return the size of the packet (not counting the header). ++ */ + public int getPacketSize() { +- return 3 + this.b.length(); ++ return 3 + this.scoreName.length(); + } + } diff --git a/patches/net/minecraft/src/Packet209SetPlayerTeam.java.patch b/patches/net/minecraft/src/Packet209SetPlayerTeam.java.patch new file mode 100644 index 0000000..fc69fab --- /dev/null +++ b/patches/net/minecraft/src/Packet209SetPlayerTeam.java.patch @@ -0,0 +1,191 @@ +--- net/minecraft/src/Packet209SetPlayerTeam.java ++++ net/minecraft/src/Packet209SetPlayerTeam.java +@@ -8,92 +8,124 @@ + import java.util.Iterator; + + public class Packet209SetPlayerTeam extends Packet { +- public String a = ""; +- public String b = ""; +- public String c = ""; +- public String d = ""; +- public Collection e = new ArrayList(); ++ ++ /** A unique name for the team. */ ++ public String teamName = ""; ++ ++ /** Only if mode = 0 or 2. */ ++ public String teamDisplayName = ""; ++ ++ /** ++ * Only if mode = 0 or 2. Displayed before the players' name that are part of this team. ++ */ ++ public String teamPrefix = ""; ++ ++ /** ++ * Only if mode = 0 or 2. Displayed after the players' name that are part of this team. ++ */ ++ public String teamSuffix = ""; ++ ++ /** Only if mode = 0 or 3 or 4. Players to be added/remove from the team. */ ++ public Collection playerNames = new ArrayList(); ++ ++ /** ++ * If 0 then the team is created. If 1 then the team is removed. If 2 the team team information is updated. If 3 then ++ * new players are added to the team. If 4 then players are removed from the team. ++ */ + public int mode; ++ ++ /** Only if mode = 0 or 2. */ + public int friendlyFire; + +- public Packet209SetPlayerTeam() { +- } +- +- public Packet209SetPlayerTeam(ScorePlayerTeam var1, int var2) { +- this.a = var1.func_96661_b(); +- this.mode = var2; +- if(var2 == 0 || var2 == 2) { +- this.b = var1.func_96669_c(); +- this.c = var1.getColorPrefix(); +- this.d = var1.getColorSuffix(); +- this.friendlyFire = var1.func_98299_i(); +- } +- +- if(var2 == 0) { +- this.e.addAll(var1.getMembershipCollection()); +- } +- +- } +- +- public Packet209SetPlayerTeam(ScorePlayerTeam var1, Collection var2, int var3) { +- if(var3 != 3 && var3 != 4) { ++ public Packet209SetPlayerTeam() {} ++ ++ public Packet209SetPlayerTeam(ScorePlayerTeam par1ScorePlayerTeam, int par2) { ++ this.teamName = par1ScorePlayerTeam.func_96661_b(); ++ this.mode = par2; ++ ++ if (par2 == 0 || par2 == 2) { ++ this.teamDisplayName = par1ScorePlayerTeam.func_96669_c(); ++ this.teamPrefix = par1ScorePlayerTeam.getColorPrefix(); ++ this.teamSuffix = par1ScorePlayerTeam.getColorSuffix(); ++ this.friendlyFire = par1ScorePlayerTeam.func_98299_i(); ++ } ++ ++ if (par2 == 0) { ++ this.playerNames.addAll(par1ScorePlayerTeam.getMembershipCollection()); ++ } ++ } ++ ++ public Packet209SetPlayerTeam(ScorePlayerTeam par1ScorePlayerTeam, Collection par2Collection, int par3) { ++ if (par3 != 3 && par3 != 4) { + throw new IllegalArgumentException("Method must be join or leave for player constructor"); +- } else if(var2 != null && !var2.isEmpty()) { +- this.mode = var3; +- this.a = var1.func_96661_b(); +- this.e.addAll(var2); ++ } else if (par2Collection != null && !par2Collection.isEmpty()) { ++ this.mode = par3; ++ this.teamName = par1ScorePlayerTeam.func_96661_b(); ++ this.playerNames.addAll(par2Collection); + } else { + throw new IllegalArgumentException("Players cannot be null/empty"); + } + } + +- public void readPacketData(DataInput var1) throws IOException { +- this.a = readString(var1, 16); +- this.mode = var1.readByte(); +- if(this.mode == 0 || this.mode == 2) { +- this.b = readString(var1, 32); +- this.c = readString(var1, 16); +- this.d = readString(var1, 16); +- this.friendlyFire = var1.readByte(); ++ /** ++ * Abstract. Reads the raw packet data from the data stream. ++ */ ++ public void readPacketData(DataInput par1DataInput) throws IOException { ++ this.teamName = readString(par1DataInput, 16); ++ this.mode = par1DataInput.readByte(); ++ ++ if (this.mode == 0 || this.mode == 2) { ++ this.teamDisplayName = readString(par1DataInput, 32); ++ this.teamPrefix = readString(par1DataInput, 16); ++ this.teamSuffix = readString(par1DataInput, 16); ++ this.friendlyFire = par1DataInput.readByte(); + } + +- if(this.mode == 0 || this.mode == 3 || this.mode == 4) { +- short var2 = var1.readShort(); ++ if (this.mode == 0 || this.mode == 3 || this.mode == 4) { ++ short var2 = par1DataInput.readShort(); + +- for(int var3 = 0; var3 < var2; ++var3) { +- this.e.add(readString(var1, 16)); ++ for (int var3 = 0; var3 < var2; ++var3) { ++ this.playerNames.add(readString(par1DataInput, 16)); + } + } +- + } + +- public void writePacketData(DataOutput var1) throws IOException { +- writeString(this.a, var1); +- var1.writeByte(this.mode); +- if(this.mode == 0 || this.mode == 2) { +- writeString(this.b, var1); +- writeString(this.c, var1); +- writeString(this.d, var1); +- var1.writeByte(this.friendlyFire); ++ /** ++ * Abstract. Writes the raw packet data to the data stream. ++ */ ++ public void writePacketData(DataOutput par1DataOutput) throws IOException { ++ writeString(this.teamName, par1DataOutput); ++ par1DataOutput.writeByte(this.mode); ++ ++ if (this.mode == 0 || this.mode == 2) { ++ writeString(this.teamDisplayName, par1DataOutput); ++ writeString(this.teamPrefix, par1DataOutput); ++ writeString(this.teamSuffix, par1DataOutput); ++ par1DataOutput.writeByte(this.friendlyFire); + } + +- if(this.mode == 0 || this.mode == 3 || this.mode == 4) { +- var1.writeShort(this.e.size()); +- Iterator var2 = this.e.iterator(); ++ if (this.mode == 0 || this.mode == 3 || this.mode == 4) { ++ par1DataOutput.writeShort(this.playerNames.size()); ++ Iterator var2 = this.playerNames.iterator(); + +- while(var2.hasNext()) { ++ while (var2.hasNext()) { + String var3 = (String)var2.next(); +- writeString(var3, var1); ++ writeString(var3, par1DataOutput); + } + } +- +- } +- +- public void processPacket(NetHandler var1) { +- var1.handleSetPlayerTeam(this); +- } +- ++ } ++ ++ /** ++ * Passes this Packet on to the NetHandler for processing. ++ */ ++ public void processPacket(NetHandler par1NetHandler) { ++ par1NetHandler.handleSetPlayerTeam(this); ++ } ++ ++ /** ++ * Abstract. Return the size of the packet (not counting the header). ++ */ + public int getPacketSize() { +- return 3 + this.a.length(); ++ return 3 + this.teamName.length(); + } + } diff --git a/patches/net/minecraft/src/Packet20NamedEntitySpawn.java.patch b/patches/net/minecraft/src/Packet20NamedEntitySpawn.java.patch new file mode 100644 index 0000000..28792ed --- /dev/null +++ b/patches/net/minecraft/src/Packet20NamedEntitySpawn.java.patch @@ -0,0 +1,149 @@ +--- net/minecraft/src/Packet20NamedEntitySpawn.java ++++ net/minecraft/src/Packet20NamedEntitySpawn.java +@@ -6,70 +6,97 @@ + import java.util.List; + + public class Packet20NamedEntitySpawn extends Packet { ++ ++ /** The entity ID, in this case it's the player ID. */ + public int entityId; +- public String b; ++ ++ /** The player's name. */ ++ public String name; ++ ++ /** The player's X position. */ + public int xPosition; ++ ++ /** The player's Y position. */ + public int yPosition; ++ ++ /** The player's Z position. */ + public int zPosition; ++ ++ /** The player's rotation. */ + public byte rotation; ++ ++ /** The player's pitch. */ + public byte pitch; ++ ++ /** The current item the player is holding. */ + public int currentItem; + private DataWatcher metadata; +- private List j; +- +- public Packet20NamedEntitySpawn() { +- } +- +- public Packet20NamedEntitySpawn(EntityPlayer var1) { +- this.entityId = var1.entityId; +- this.b = var1.getCommandSenderName(); +- this.xPosition = MathHelper.floor_double(var1.posX * 32.0D); +- this.yPosition = MathHelper.floor_double(var1.posY * 32.0D); +- this.zPosition = MathHelper.floor_double(var1.posZ * 32.0D); +- this.rotation = (byte)((int)(var1.rotationYaw * 256.0F / 360.0F)); +- this.pitch = (byte)((int)(var1.rotationPitch * 256.0F / 360.0F)); +- ItemStack var2 = var1.inventory.getCurrentItem(); ++ private List metadataWatchableObjects; ++ ++ public Packet20NamedEntitySpawn() {} ++ ++ public Packet20NamedEntitySpawn(EntityPlayer par1EntityPlayer) { ++ this.entityId = par1EntityPlayer.entityId; ++ this.name = par1EntityPlayer.getCommandSenderName(); ++ this.xPosition = MathHelper.floor_double(par1EntityPlayer.posX * 32.0D); ++ this.yPosition = MathHelper.floor_double(par1EntityPlayer.posY * 32.0D); ++ this.zPosition = MathHelper.floor_double(par1EntityPlayer.posZ * 32.0D); ++ this.rotation = (byte)((int)(par1EntityPlayer.rotationYaw * 256.0F / 360.0F)); ++ this.pitch = (byte)((int)(par1EntityPlayer.rotationPitch * 256.0F / 360.0F)); ++ ItemStack var2 = par1EntityPlayer.inventory.getCurrentItem(); + this.currentItem = var2 == null ? 0 : var2.itemID; +- this.metadata = var1.getDataWatcher(); +- } +- +- public void readPacketData(DataInput var1) throws IOException { +- this.entityId = var1.readInt(); +- this.b = readString(var1, 16); +- this.xPosition = var1.readInt(); +- this.yPosition = var1.readInt(); +- this.zPosition = var1.readInt(); +- this.rotation = var1.readByte(); +- this.pitch = var1.readByte(); +- this.currentItem = var1.readShort(); +- this.j = DataWatcher.readWatchableObjects(var1); +- } +- +- public void writePacketData(DataOutput var1) throws IOException { +- var1.writeInt(this.entityId); +- writeString(this.b, var1); +- var1.writeInt(this.xPosition); +- var1.writeInt(this.yPosition); +- var1.writeInt(this.zPosition); +- var1.writeByte(this.rotation); +- var1.writeByte(this.pitch); +- var1.writeShort(this.currentItem); +- this.metadata.writeWatchableObjects(var1); +- } +- +- public void processPacket(NetHandler var1) { +- var1.handleNamedEntitySpawn(this); +- } +- ++ this.metadata = par1EntityPlayer.getDataWatcher(); ++ } ++ ++ /** ++ * Abstract. Reads the raw packet data from the data stream. ++ */ ++ public void readPacketData(DataInput par1DataInput) throws IOException { ++ this.entityId = par1DataInput.readInt(); ++ this.name = readString(par1DataInput, 16); ++ this.xPosition = par1DataInput.readInt(); ++ this.yPosition = par1DataInput.readInt(); ++ this.zPosition = par1DataInput.readInt(); ++ this.rotation = par1DataInput.readByte(); ++ this.pitch = par1DataInput.readByte(); ++ this.currentItem = par1DataInput.readShort(); ++ this.metadataWatchableObjects = DataWatcher.readWatchableObjects(par1DataInput); ++ } ++ ++ /** ++ * Abstract. Writes the raw packet data to the data stream. ++ */ ++ public void writePacketData(DataOutput par1DataOutput) throws IOException { ++ par1DataOutput.writeInt(this.entityId); ++ writeString(this.name, par1DataOutput); ++ par1DataOutput.writeInt(this.xPosition); ++ par1DataOutput.writeInt(this.yPosition); ++ par1DataOutput.writeInt(this.zPosition); ++ par1DataOutput.writeByte(this.rotation); ++ par1DataOutput.writeByte(this.pitch); ++ par1DataOutput.writeShort(this.currentItem); ++ this.metadata.writeWatchableObjects(par1DataOutput); ++ } ++ ++ /** ++ * Passes this Packet on to the NetHandler for processing. ++ */ ++ public void processPacket(NetHandler par1NetHandler) { ++ par1NetHandler.handleNamedEntitySpawn(this); ++ } ++ ++ /** ++ * Abstract. Return the size of the packet (not counting the header). ++ */ + public int getPacketSize() { + return 28; + } + + public List getWatchedMetadata() { +- if(this.j == null) { +- this.j = this.metadata.getAllWatched(); ++ if (this.metadataWatchableObjects == null) { ++ this.metadataWatchableObjects = this.metadata.getAllWatched(); + } + +- return this.j; ++ return this.metadataWatchableObjects; + } + } diff --git a/patches/net/minecraft/src/Packet22Collect.java.patch b/patches/net/minecraft/src/Packet22Collect.java.patch new file mode 100644 index 0000000..ce7a4e2 --- /dev/null +++ b/patches/net/minecraft/src/Packet22Collect.java.patch @@ -0,0 +1,71 @@ +--- net/minecraft/src/Packet22Collect.java ++++ net/minecraft/src/Packet22Collect.java +@@ -5,31 +5,46 @@ + import java.io.IOException; + + public class Packet22Collect extends Packet { ++ ++ /** The entity on the ground that was picked up. */ + public int collectedEntityId; ++ ++ /** The entity that picked up the one from the ground. */ + public int collectorEntityId; + +- public Packet22Collect() { +- } +- +- public Packet22Collect(int var1, int var2) { +- this.collectedEntityId = var1; +- this.collectorEntityId = var2; +- } +- +- public void readPacketData(DataInput var1) throws IOException { +- this.collectedEntityId = var1.readInt(); +- this.collectorEntityId = var1.readInt(); +- } +- +- public void writePacketData(DataOutput var1) throws IOException { +- var1.writeInt(this.collectedEntityId); +- var1.writeInt(this.collectorEntityId); +- } +- +- public void processPacket(NetHandler var1) { +- var1.handleCollect(this); +- } +- ++ public Packet22Collect() {} ++ ++ public Packet22Collect(int par1, int par2) { ++ this.collectedEntityId = par1; ++ this.collectorEntityId = par2; ++ } ++ ++ /** ++ * Abstract. Reads the raw packet data from the data stream. ++ */ ++ public void readPacketData(DataInput par1DataInput) throws IOException { ++ this.collectedEntityId = par1DataInput.readInt(); ++ this.collectorEntityId = par1DataInput.readInt(); ++ } ++ ++ /** ++ * Abstract. Writes the raw packet data to the data stream. ++ */ ++ public void writePacketData(DataOutput par1DataOutput) throws IOException { ++ par1DataOutput.writeInt(this.collectedEntityId); ++ par1DataOutput.writeInt(this.collectorEntityId); ++ } ++ ++ /** ++ * Passes this Packet on to the NetHandler for processing. ++ */ ++ public void processPacket(NetHandler par1NetHandler) { ++ par1NetHandler.handleCollect(this); ++ } ++ ++ /** ++ * Abstract. Return the size of the packet (not counting the header). ++ */ + public int getPacketSize() { + return 8; + } diff --git a/patches/net/minecraft/src/Packet23VehicleSpawn.java.patch b/patches/net/minecraft/src/Packet23VehicleSpawn.java.patch new file mode 100644 index 0000000..f53045f --- /dev/null +++ b/patches/net/minecraft/src/Packet23VehicleSpawn.java.patch @@ -0,0 +1,218 @@ +--- net/minecraft/src/Packet23VehicleSpawn.java ++++ net/minecraft/src/Packet23VehicleSpawn.java +@@ -5,60 +5,89 @@ + import java.io.IOException; + + public class Packet23VehicleSpawn extends Packet { ++ ++ /** Entity ID of the object. */ + public int entityId; ++ ++ /** The X position of the object. */ + public int xPosition; ++ ++ /** The Y position of the object. */ + public int yPosition; ++ ++ /** The Z position of the object. */ + public int zPosition; ++ ++ /** ++ * Not sent if the thrower entity ID is 0. The speed of this fireball along the X axis. ++ */ + public int speedX; ++ ++ /** ++ * Not sent if the thrower entity ID is 0. The speed of this fireball along the Y axis. ++ */ + public int speedY; ++ ++ /** ++ * Not sent if the thrower entity ID is 0. The speed of this fireball along the Z axis. ++ */ + public int speedZ; ++ ++ /** The pitch in steps of 2p/256 */ + public int pitch; ++ ++ /** The yaw in steps of 2p/256 */ + public int yaw; ++ ++ /** The type of object. */ + public int type; ++ ++ /** 0 if not a fireball. Otherwise, this is the Entity ID of the thrower. */ + public int throwerEntityId; + +- public Packet23VehicleSpawn() { +- } +- +- public Packet23VehicleSpawn(Entity var1, int var2) { +- this(var1, var2, 0); +- } +- +- public Packet23VehicleSpawn(Entity var1, int var2, int var3) { +- this.entityId = var1.entityId; +- this.xPosition = MathHelper.floor_double(var1.posX * 32.0D); +- this.yPosition = MathHelper.floor_double(var1.posY * 32.0D); +- this.zPosition = MathHelper.floor_double(var1.posZ * 32.0D); +- this.pitch = MathHelper.floor_float(var1.rotationPitch * 256.0F / 360.0F); +- this.yaw = MathHelper.floor_float(var1.rotationYaw * 256.0F / 360.0F); +- this.type = var2; +- this.throwerEntityId = var3; +- if(var3 > 0) { +- double var4 = var1.motionX; +- double var6 = var1.motionY; +- double var8 = var1.motionZ; ++ public Packet23VehicleSpawn() {} ++ ++ public Packet23VehicleSpawn(Entity par1Entity, int par2) { ++ this(par1Entity, par2, 0); ++ } ++ ++ public Packet23VehicleSpawn(Entity par1Entity, int par2, int par3) { ++ this.entityId = par1Entity.entityId; ++ this.xPosition = MathHelper.floor_double(par1Entity.posX * 32.0D); ++ this.yPosition = MathHelper.floor_double(par1Entity.posY * 32.0D); ++ this.zPosition = MathHelper.floor_double(par1Entity.posZ * 32.0D); ++ this.pitch = MathHelper.floor_float(par1Entity.rotationPitch * 256.0F / 360.0F); ++ this.yaw = MathHelper.floor_float(par1Entity.rotationYaw * 256.0F / 360.0F); ++ this.type = par2; ++ this.throwerEntityId = par3; ++ ++ if (par3 > 0) { ++ double var4 = par1Entity.motionX; ++ double var6 = par1Entity.motionY; ++ double var8 = par1Entity.motionZ; + double var10 = 3.9D; +- if(var4 < -var10) { ++ ++ if (var4 < -var10) { + var4 = -var10; + } + +- if(var6 < -var10) { ++ if (var6 < -var10) { + var6 = -var10; + } + +- if(var8 < -var10) { ++ if (var8 < -var10) { + var8 = -var10; + } + +- if(var4 > var10) { ++ if (var4 > var10) { + var4 = var10; + } + +- if(var6 > var10) { ++ if (var6 > var10) { + var6 = var10; + } + +- if(var8 > var10) { ++ if (var8 > var10) { + var8 = var10; + } + +@@ -66,47 +95,58 @@ + this.speedY = (int)(var6 * 8000.0D); + this.speedZ = (int)(var8 * 8000.0D); + } +- +- } +- +- public void readPacketData(DataInput var1) throws IOException { +- this.entityId = var1.readInt(); +- this.type = var1.readByte(); +- this.xPosition = var1.readInt(); +- this.yPosition = var1.readInt(); +- this.zPosition = var1.readInt(); +- this.pitch = var1.readByte(); +- this.yaw = var1.readByte(); +- this.throwerEntityId = var1.readInt(); +- if(this.throwerEntityId > 0) { +- this.speedX = var1.readShort(); +- this.speedY = var1.readShort(); +- this.speedZ = var1.readShort(); +- } +- +- } +- +- public void writePacketData(DataOutput var1) throws IOException { +- var1.writeInt(this.entityId); +- var1.writeByte(this.type); +- var1.writeInt(this.xPosition); +- var1.writeInt(this.yPosition); +- var1.writeInt(this.zPosition); +- var1.writeByte(this.pitch); +- var1.writeByte(this.yaw); +- var1.writeInt(this.throwerEntityId); +- if(this.throwerEntityId > 0) { +- var1.writeShort(this.speedX); +- var1.writeShort(this.speedY); +- var1.writeShort(this.speedZ); +- } +- +- } +- +- public void processPacket(NetHandler var1) { +- var1.handleVehicleSpawn(this); +- } +- ++ } ++ ++ /** ++ * Abstract. Reads the raw packet data from the data stream. ++ */ ++ public void readPacketData(DataInput par1DataInput) throws IOException { ++ this.entityId = par1DataInput.readInt(); ++ this.type = par1DataInput.readByte(); ++ this.xPosition = par1DataInput.readInt(); ++ this.yPosition = par1DataInput.readInt(); ++ this.zPosition = par1DataInput.readInt(); ++ this.pitch = par1DataInput.readByte(); ++ this.yaw = par1DataInput.readByte(); ++ this.throwerEntityId = par1DataInput.readInt(); ++ ++ if (this.throwerEntityId > 0) { ++ this.speedX = par1DataInput.readShort(); ++ this.speedY = par1DataInput.readShort(); ++ this.speedZ = par1DataInput.readShort(); ++ } ++ } ++ ++ /** ++ * Abstract. Writes the raw packet data to the data stream. ++ */ ++ public void writePacketData(DataOutput par1DataOutput) throws IOException { ++ par1DataOutput.writeInt(this.entityId); ++ par1DataOutput.writeByte(this.type); ++ par1DataOutput.writeInt(this.xPosition); ++ par1DataOutput.writeInt(this.yPosition); ++ par1DataOutput.writeInt(this.zPosition); ++ par1DataOutput.writeByte(this.pitch); ++ par1DataOutput.writeByte(this.yaw); ++ par1DataOutput.writeInt(this.throwerEntityId); ++ ++ if (this.throwerEntityId > 0) { ++ par1DataOutput.writeShort(this.speedX); ++ par1DataOutput.writeShort(this.speedY); ++ par1DataOutput.writeShort(this.speedZ); ++ } ++ } ++ ++ /** ++ * Passes this Packet on to the NetHandler for processing. ++ */ ++ public void processPacket(NetHandler par1NetHandler) { ++ par1NetHandler.handleVehicleSpawn(this); ++ } ++ ++ /** ++ * Abstract. Return the size of the packet (not counting the header). ++ */ + public int getPacketSize() { + return 21 + this.throwerEntityId > 0 ? 6 : 0; + } diff --git a/patches/net/minecraft/src/Packet24MobSpawn.java.patch b/patches/net/minecraft/src/Packet24MobSpawn.java.patch new file mode 100644 index 0000000..94e5c04 --- /dev/null +++ b/patches/net/minecraft/src/Packet24MobSpawn.java.patch @@ -0,0 +1,205 @@ +--- net/minecraft/src/Packet24MobSpawn.java ++++ net/minecraft/src/Packet24MobSpawn.java +@@ -6,109 +6,139 @@ + import java.util.List; + + public class Packet24MobSpawn extends Packet { ++ ++ /** The entity ID. */ + public int entityId; ++ ++ /** The type of mob. */ + public int type; ++ ++ /** The X position of the entity. */ + public int xPosition; ++ ++ /** The Y position of the entity. */ + public int yPosition; ++ ++ /** The Z position of the entity. */ + public int zPosition; + public int velocityX; + public int velocityY; + public int velocityZ; ++ ++ /** The yaw of the entity. */ + public byte yaw; ++ ++ /** The pitch of the entity. */ + public byte pitch; ++ ++ /** The yaw of the entity's head. */ + public byte headYaw; ++ ++ /** Indexed metadata for Mob, terminated by 0x7F */ + private DataWatcher metaData; +- private List u; +- +- public Packet24MobSpawn() { +- } +- +- public Packet24MobSpawn(EntityLivingBase var1) { +- this.entityId = var1.entityId; +- this.type = (byte)EntityList.getEntityID(var1); +- this.xPosition = var1.myEntitySize.multiplyBy32AndRound(var1.posX); +- this.yPosition = MathHelper.floor_double(var1.posY * 32.0D); +- this.zPosition = var1.myEntitySize.multiplyBy32AndRound(var1.posZ); +- this.yaw = (byte)((int)(var1.rotationYaw * 256.0F / 360.0F)); +- this.pitch = (byte)((int)(var1.rotationPitch * 256.0F / 360.0F)); +- this.headYaw = (byte)((int)(var1.rotationYawHead * 256.0F / 360.0F)); ++ private List metadata; ++ ++ public Packet24MobSpawn() {} ++ ++ public Packet24MobSpawn(EntityLivingBase par1EntityLivingBase) { ++ this.entityId = par1EntityLivingBase.entityId; ++ this.type = (byte)EntityList.getEntityID(par1EntityLivingBase); ++ this.xPosition = par1EntityLivingBase.myEntitySize.multiplyBy32AndRound(par1EntityLivingBase.posX); ++ this.yPosition = MathHelper.floor_double(par1EntityLivingBase.posY * 32.0D); ++ this.zPosition = par1EntityLivingBase.myEntitySize.multiplyBy32AndRound(par1EntityLivingBase.posZ); ++ this.yaw = (byte)((int)(par1EntityLivingBase.rotationYaw * 256.0F / 360.0F)); ++ this.pitch = (byte)((int)(par1EntityLivingBase.rotationPitch * 256.0F / 360.0F)); ++ this.headYaw = (byte)((int)(par1EntityLivingBase.rotationYawHead * 256.0F / 360.0F)); + double var2 = 3.9D; +- double var4 = var1.motionX; +- double var6 = var1.motionY; +- double var8 = var1.motionZ; +- if(var4 < -var2) { ++ double var4 = par1EntityLivingBase.motionX; ++ double var6 = par1EntityLivingBase.motionY; ++ double var8 = par1EntityLivingBase.motionZ; ++ ++ if (var4 < -var2) { + var4 = -var2; + } + +- if(var6 < -var2) { ++ if (var6 < -var2) { + var6 = -var2; + } + +- if(var8 < -var2) { ++ if (var8 < -var2) { + var8 = -var2; + } + +- if(var4 > var2) { ++ if (var4 > var2) { + var4 = var2; + } + +- if(var6 > var2) { ++ if (var6 > var2) { + var6 = var2; + } + +- if(var8 > var2) { ++ if (var8 > var2) { + var8 = var2; + } + + this.velocityX = (int)(var4 * 8000.0D); + this.velocityY = (int)(var6 * 8000.0D); + this.velocityZ = (int)(var8 * 8000.0D); +- this.metaData = var1.getDataWatcher(); +- } +- +- public void readPacketData(DataInput var1) throws IOException { +- this.entityId = var1.readInt(); +- this.type = var1.readByte() & 255; +- this.xPosition = var1.readInt(); +- this.yPosition = var1.readInt(); +- this.zPosition = var1.readInt(); +- this.yaw = var1.readByte(); +- this.pitch = var1.readByte(); +- this.headYaw = var1.readByte(); +- this.velocityX = var1.readShort(); +- this.velocityY = var1.readShort(); +- this.velocityZ = var1.readShort(); +- this.u = DataWatcher.readWatchableObjects(var1); +- } +- +- public void writePacketData(DataOutput var1) throws IOException { +- var1.writeInt(this.entityId); +- var1.writeByte(this.type & 255); +- var1.writeInt(this.xPosition); +- var1.writeInt(this.yPosition); +- var1.writeInt(this.zPosition); +- var1.writeByte(this.yaw); +- var1.writeByte(this.pitch); +- var1.writeByte(this.headYaw); +- var1.writeShort(this.velocityX); +- var1.writeShort(this.velocityY); +- var1.writeShort(this.velocityZ); +- this.metaData.writeWatchableObjects(var1); +- } +- +- public void processPacket(NetHandler var1) { +- var1.handleMobSpawn(this); +- } +- ++ this.metaData = par1EntityLivingBase.getDataWatcher(); ++ } ++ ++ /** ++ * Abstract. Reads the raw packet data from the data stream. ++ */ ++ public void readPacketData(DataInput par1DataInput) throws IOException { ++ this.entityId = par1DataInput.readInt(); ++ this.type = par1DataInput.readByte() & 255; ++ this.xPosition = par1DataInput.readInt(); ++ this.yPosition = par1DataInput.readInt(); ++ this.zPosition = par1DataInput.readInt(); ++ this.yaw = par1DataInput.readByte(); ++ this.pitch = par1DataInput.readByte(); ++ this.headYaw = par1DataInput.readByte(); ++ this.velocityX = par1DataInput.readShort(); ++ this.velocityY = par1DataInput.readShort(); ++ this.velocityZ = par1DataInput.readShort(); ++ this.metadata = DataWatcher.readWatchableObjects(par1DataInput); ++ } ++ ++ /** ++ * Abstract. Writes the raw packet data to the data stream. ++ */ ++ public void writePacketData(DataOutput par1DataOutput) throws IOException { ++ par1DataOutput.writeInt(this.entityId); ++ par1DataOutput.writeByte(this.type & 255); ++ par1DataOutput.writeInt(this.xPosition); ++ par1DataOutput.writeInt(this.yPosition); ++ par1DataOutput.writeInt(this.zPosition); ++ par1DataOutput.writeByte(this.yaw); ++ par1DataOutput.writeByte(this.pitch); ++ par1DataOutput.writeByte(this.headYaw); ++ par1DataOutput.writeShort(this.velocityX); ++ par1DataOutput.writeShort(this.velocityY); ++ par1DataOutput.writeShort(this.velocityZ); ++ this.metaData.writeWatchableObjects(par1DataOutput); ++ } ++ ++ /** ++ * Passes this Packet on to the NetHandler for processing. ++ */ ++ public void processPacket(NetHandler par1NetHandler) { ++ par1NetHandler.handleMobSpawn(this); ++ } ++ ++ /** ++ * Abstract. Return the size of the packet (not counting the header). ++ */ + public int getPacketSize() { + return 26; + } + + public List getMetadata() { +- if(this.u == null) { +- this.u = this.metaData.getAllWatched(); ++ if (this.metadata == null) { ++ this.metadata = this.metaData.getAllWatched(); + } + +- return this.u; ++ return this.metadata; + } + } diff --git a/patches/net/minecraft/src/Packet250CustomPayload.java.patch b/patches/net/minecraft/src/Packet250CustomPayload.java.patch new file mode 100644 index 0000000..bb962c8 --- /dev/null +++ b/patches/net/minecraft/src/Packet250CustomPayload.java.patch @@ -0,0 +1,104 @@ +--- net/minecraft/src/Packet250CustomPayload.java ++++ net/minecraft/src/Packet250CustomPayload.java +@@ -5,49 +5,67 @@ + import java.io.IOException; + + public class Packet250CustomPayload extends Packet { +- public String a; ++ ++ /** Name of the 'channel' used to send data */ ++ public String channel; ++ ++ /** Length of the data to be read */ + public int length; ++ ++ /** Any data */ + public byte[] data; + +- public Packet250CustomPayload() { +- } +- +- public Packet250CustomPayload(String var1, byte[] var2) { +- this.a = var1; +- this.data = var2; +- if(var2 != null) { +- this.length = var2.length; +- if(this.length > Short.MAX_VALUE) { ++ public Packet250CustomPayload() {} ++ ++ public Packet250CustomPayload(String par1Str, byte[] par2ArrayOfByte) { ++ this.channel = par1Str; ++ this.data = par2ArrayOfByte; ++ ++ if (par2ArrayOfByte != null) { ++ this.length = par2ArrayOfByte.length; ++ ++ if (this.length > 32767) { + throw new IllegalArgumentException("Payload may not be larger than 32k"); + } + } +- + } + +- public void readPacketData(DataInput var1) throws IOException { +- this.a = readString(var1, 20); +- this.length = var1.readShort(); +- if(this.length > 0 && this.length < Short.MAX_VALUE) { ++ /** ++ * Abstract. Reads the raw packet data from the data stream. ++ */ ++ public void readPacketData(DataInput par1DataInput) throws IOException { ++ this.channel = readString(par1DataInput, 20); ++ this.length = par1DataInput.readShort(); ++ ++ if (this.length > 0 && this.length < 32767) { + this.data = new byte[this.length]; +- var1.readFully(this.data); +- } +- +- } +- +- public void writePacketData(DataOutput var1) throws IOException { +- writeString(this.a, var1); +- var1.writeShort((short)this.length); +- if(this.data != null) { +- var1.write(this.data); +- } +- +- } +- +- public void processPacket(NetHandler var1) { +- var1.handleCustomPayload(this); +- } +- ++ par1DataInput.readFully(this.data); ++ } ++ } ++ ++ /** ++ * Abstract. Writes the raw packet data to the data stream. ++ */ ++ public void writePacketData(DataOutput par1DataOutput) throws IOException { ++ writeString(this.channel, par1DataOutput); ++ par1DataOutput.writeShort((short)this.length); ++ ++ if (this.data != null) { ++ par1DataOutput.write(this.data); ++ } ++ } ++ ++ /** ++ * Passes this Packet on to the NetHandler for processing. ++ */ ++ public void processPacket(NetHandler par1NetHandler) { ++ par1NetHandler.handleCustomPayload(this); ++ } ++ ++ /** ++ * Abstract. Return the size of the packet (not counting the header). ++ */ + public int getPacketSize() { +- return 2 + this.a.length() * 2 + 2 + this.length; ++ return 2 + this.channel.length() * 2 + 2 + this.length; + } + } diff --git a/patches/net/minecraft/src/Packet252SharedKey.java.patch b/patches/net/minecraft/src/Packet252SharedKey.java.patch new file mode 100644 index 0000000..fa788f0 --- /dev/null +++ b/patches/net/minecraft/src/Packet252SharedKey.java.patch @@ -0,0 +1,100 @@ +--- net/minecraft/src/Packet252SharedKey.java ++++ net/minecraft/src/Packet252SharedKey.java +@@ -10,44 +10,68 @@ + public class Packet252SharedKey extends Packet { + private byte[] sharedSecret = new byte[0]; + private byte[] verifyToken = new byte[0]; +- private SecretKey c; +- +- public Packet252SharedKey() { +- } +- +- public Packet252SharedKey(SecretKey var1, PublicKey var2, byte[] var3) { +- this.c = var1; +- this.sharedSecret = CryptManager.encryptData(var2, var1.getEncoded()); +- this.verifyToken = CryptManager.encryptData(var2, var3); +- } +- +- public void readPacketData(DataInput var1) throws IOException { +- this.sharedSecret = readBytesFromStream(var1); +- this.verifyToken = readBytesFromStream(var1); +- } +- +- public void writePacketData(DataOutput var1) throws IOException { +- writeByteArray(var1, this.sharedSecret); +- writeByteArray(var1, this.verifyToken); +- } +- +- public void processPacket(NetHandler var1) { +- var1.handleSharedKey(this); +- } +- ++ ++ /** ++ * Secret AES key decrypted from sharedSecret via the server's private RSA key ++ */ ++ private SecretKey sharedKey; ++ ++ public Packet252SharedKey() {} ++ ++ public Packet252SharedKey(SecretKey par1SecretKey, PublicKey par2PublicKey, byte[] par3ArrayOfByte) { ++ this.sharedKey = par1SecretKey; ++ this.sharedSecret = CryptManager.encryptData(par2PublicKey, par1SecretKey.getEncoded()); ++ this.verifyToken = CryptManager.encryptData(par2PublicKey, par3ArrayOfByte); ++ } ++ ++ /** ++ * Abstract. Reads the raw packet data from the data stream. ++ */ ++ public void readPacketData(DataInput par1DataInput) throws IOException { ++ this.sharedSecret = readBytesFromStream(par1DataInput); ++ this.verifyToken = readBytesFromStream(par1DataInput); ++ } ++ ++ /** ++ * Abstract. Writes the raw packet data to the data stream. ++ */ ++ public void writePacketData(DataOutput par1DataOutput) throws IOException { ++ writeByteArray(par1DataOutput, this.sharedSecret); ++ writeByteArray(par1DataOutput, this.verifyToken); ++ } ++ ++ /** ++ * Passes this Packet on to the NetHandler for processing. ++ */ ++ public void processPacket(NetHandler par1NetHandler) { ++ par1NetHandler.handleSharedKey(this); ++ } ++ ++ /** ++ * Abstract. Return the size of the packet (not counting the header). ++ */ + public int getPacketSize() { + return 2 + this.sharedSecret.length + 2 + this.verifyToken.length; + } + +- public SecretKey getSharedKey(PrivateKey var1) { +- return var1 == null ? this.c : (this.c = CryptManager.decryptSharedKey(var1, this.sharedSecret)); ++ /** ++ * Return secretKey, decrypting it from the sharedSecret byte array if needed ++ */ ++ public SecretKey getSharedKey(PrivateKey par1PrivateKey) { ++ return par1PrivateKey == null ? this.sharedKey : (this.sharedKey = CryptManager.decryptSharedKey(par1PrivateKey, this.sharedSecret)); + } + ++ /** ++ * Return the secret AES sharedKey (used by client only) ++ */ + public SecretKey getSharedKey() { + return this.getSharedKey((PrivateKey)null); + } + +- public byte[] getVerifyToken(PrivateKey var1) { +- return var1 == null ? this.verifyToken : CryptManager.decryptData(var1, this.verifyToken); ++ /** ++ * Return verifyToken ++ */ ++ public byte[] getVerifyToken(PrivateKey par1PrivateKey) { ++ return par1PrivateKey == null ? this.verifyToken : CryptManager.decryptData(par1PrivateKey, this.verifyToken); + } + } diff --git a/patches/net/minecraft/src/Packet253ServerAuthData.java.patch b/patches/net/minecraft/src/Packet253ServerAuthData.java.patch new file mode 100644 index 0000000..af28a46 --- /dev/null +++ b/patches/net/minecraft/src/Packet253ServerAuthData.java.patch @@ -0,0 +1,89 @@ +--- net/minecraft/src/Packet253ServerAuthData.java ++++ net/minecraft/src/Packet253ServerAuthData.java +@@ -6,45 +6,56 @@ + import java.security.PublicKey; + + public class Packet253ServerAuthData extends Packet { +- private String a; +- private PublicKey b; ++ private String serverId; ++ private PublicKey publicKey; + private byte[] verifyToken = new byte[0]; + +- public Packet253ServerAuthData() { +- } +- +- public Packet253ServerAuthData(String var1, PublicKey var2, byte[] var3) { +- this.a = var1; +- this.b = var2; +- this.verifyToken = var3; +- } +- +- public void readPacketData(DataInput var1) throws IOException { +- this.a = readString(var1, 20); +- this.b = CryptManager.decodePublicKey(readBytesFromStream(var1)); +- this.verifyToken = readBytesFromStream(var1); +- } +- +- public void writePacketData(DataOutput var1) throws IOException { +- writeString(this.a, var1); +- writeByteArray(var1, this.b.getEncoded()); +- writeByteArray(var1, this.verifyToken); +- } +- +- public void processPacket(NetHandler var1) { +- var1.handleServerAuthData(this); +- } +- ++ public Packet253ServerAuthData() {} ++ ++ public Packet253ServerAuthData(String par1Str, PublicKey par2PublicKey, byte[] par3ArrayOfByte) { ++ this.serverId = par1Str; ++ this.publicKey = par2PublicKey; ++ this.verifyToken = par3ArrayOfByte; ++ } ++ ++ /** ++ * Abstract. Reads the raw packet data from the data stream. ++ */ ++ public void readPacketData(DataInput par1DataInput) throws IOException { ++ this.serverId = readString(par1DataInput, 20); ++ this.publicKey = CryptManager.decodePublicKey(readBytesFromStream(par1DataInput)); ++ this.verifyToken = readBytesFromStream(par1DataInput); ++ } ++ ++ /** ++ * Abstract. Writes the raw packet data to the data stream. ++ */ ++ public void writePacketData(DataOutput par1DataOutput) throws IOException { ++ writeString(this.serverId, par1DataOutput); ++ writeByteArray(par1DataOutput, this.publicKey.getEncoded()); ++ writeByteArray(par1DataOutput, this.verifyToken); ++ } ++ ++ /** ++ * Passes this Packet on to the NetHandler for processing. ++ */ ++ public void processPacket(NetHandler par1NetHandler) { ++ par1NetHandler.handleServerAuthData(this); ++ } ++ ++ /** ++ * Abstract. Return the size of the packet (not counting the header). ++ */ + public int getPacketSize() { +- return 2 + this.a.length() * 2 + 2 + this.b.getEncoded().length + 2 + this.verifyToken.length; ++ return 2 + this.serverId.length() * 2 + 2 + this.publicKey.getEncoded().length + 2 + this.verifyToken.length; + } + + public String getServerId() { +- return this.a; ++ return this.serverId; + } + + public PublicKey getPublicKey() { +- return this.b; ++ return this.publicKey; + } + + public byte[] getVerifyToken() { diff --git a/patches/net/minecraft/src/Packet254ServerPing.java.patch b/patches/net/minecraft/src/Packet254ServerPing.java.patch new file mode 100644 index 0000000..c8c3246 --- /dev/null +++ b/patches/net/minecraft/src/Packet254ServerPing.java.patch @@ -0,0 +1,113 @@ +--- net/minecraft/src/Packet254ServerPing.java ++++ net/minecraft/src/Packet254ServerPing.java +@@ -6,58 +6,71 @@ + + public class Packet254ServerPing extends Packet { + private static final int field_140051_d = (new Packet250CustomPayload()).getPacketId(); ++ ++ /** Always 1, unless readByte threw an exception. */ + public int readSuccessfully; +- public String b; ++ public String field_140052_b; + public int field_140053_c; + +- public Packet254ServerPing() { +- } +- +- public Packet254ServerPing(int var1, String var2, int var3) { +- this.readSuccessfully = var1; +- this.b = var2; +- this.field_140053_c = var3; +- } +- +- public void readPacketData(DataInput var1) throws IOException { ++ public Packet254ServerPing() {} ++ ++ public Packet254ServerPing(int par1, String par2Str, int par3) { ++ this.readSuccessfully = par1; ++ this.field_140052_b = par2Str; ++ this.field_140053_c = par3; ++ } ++ ++ /** ++ * Abstract. Reads the raw packet data from the data stream. ++ */ ++ public void readPacketData(DataInput par1DataInput) throws IOException { + try { +- this.readSuccessfully = var1.readByte(); ++ this.readSuccessfully = par1DataInput.readByte(); + + try { +- var1.readByte(); +- readString(var1, 255); +- var1.readShort(); +- this.readSuccessfully = var1.readByte(); +- if(this.readSuccessfully >= 73) { +- this.b = readString(var1, 255); +- this.field_140053_c = var1.readInt(); ++ par1DataInput.readByte(); ++ readString(par1DataInput, 255); ++ par1DataInput.readShort(); ++ this.readSuccessfully = par1DataInput.readByte(); ++ ++ if (this.readSuccessfully >= 73) { ++ this.field_140052_b = readString(par1DataInput, 255); ++ this.field_140053_c = par1DataInput.readInt(); + } + } catch (Throwable var3) { +- this.b = ""; ++ this.field_140052_b = ""; + } + } catch (Throwable var4) { + this.readSuccessfully = 0; +- this.b = ""; ++ this.field_140052_b = ""; + } +- +- } +- +- public void writePacketData(DataOutput var1) throws IOException { +- var1.writeByte(1); +- var1.writeByte(field_140051_d); +- Packet.writeString("MC|PingHost", var1); +- var1.writeShort(3 + 2 * this.b.length() + 4); +- var1.writeByte(this.readSuccessfully); +- Packet.writeString(this.b, var1); +- var1.writeInt(this.field_140053_c); +- } +- +- public void processPacket(NetHandler var1) { +- var1.handleServerPing(this); +- } +- ++ } ++ ++ /** ++ * Abstract. Writes the raw packet data to the data stream. ++ */ ++ public void writePacketData(DataOutput par1DataOutput) throws IOException { ++ par1DataOutput.writeByte(1); ++ par1DataOutput.writeByte(field_140051_d); ++ Packet.writeString("MC|PingHost", par1DataOutput); ++ par1DataOutput.writeShort(3 + 2 * this.field_140052_b.length() + 4); ++ par1DataOutput.writeByte(this.readSuccessfully); ++ Packet.writeString(this.field_140052_b, par1DataOutput); ++ par1DataOutput.writeInt(this.field_140053_c); ++ } ++ ++ /** ++ * Passes this Packet on to the NetHandler for processing. ++ */ ++ public void processPacket(NetHandler par1NetHandler) { ++ par1NetHandler.handleServerPing(this); ++ } ++ ++ /** ++ * Abstract. Return the size of the packet (not counting the header). ++ */ + public int getPacketSize() { +- return 3 + this.b.length() * 2 + 4; ++ return 3 + this.field_140052_b.length() * 2 + 4; + } + + public boolean func_140050_d() { diff --git a/patches/net/minecraft/src/Packet255KickDisconnect.java.patch b/patches/net/minecraft/src/Packet255KickDisconnect.java.patch new file mode 100644 index 0000000..3171362 --- /dev/null +++ b/patches/net/minecraft/src/Packet255KickDisconnect.java.patch @@ -0,0 +1,82 @@ +--- net/minecraft/src/Packet255KickDisconnect.java ++++ net/minecraft/src/Packet255KickDisconnect.java +@@ -5,36 +5,56 @@ + import java.io.IOException; + + public class Packet255KickDisconnect extends Packet { +- public String a; +- +- public Packet255KickDisconnect() { +- } +- +- public Packet255KickDisconnect(String var1) { +- this.a = var1; +- } +- +- public void readPacketData(DataInput var1) throws IOException { +- this.a = readString(var1, 256); +- } +- +- public void writePacketData(DataOutput var1) throws IOException { +- writeString(this.a, var1); +- } +- +- public void processPacket(NetHandler var1) { +- var1.handleKickDisconnect(this); +- } +- ++ ++ /** Displayed to the client when the connection terminates. */ ++ public String reason; ++ ++ public Packet255KickDisconnect() {} ++ ++ public Packet255KickDisconnect(String par1Str) { ++ this.reason = par1Str; ++ } ++ ++ /** ++ * Abstract. Reads the raw packet data from the data stream. ++ */ ++ public void readPacketData(DataInput par1DataInput) throws IOException { ++ this.reason = readString(par1DataInput, 256); ++ } ++ ++ /** ++ * Abstract. Writes the raw packet data to the data stream. ++ */ ++ public void writePacketData(DataOutput par1DataOutput) throws IOException { ++ writeString(this.reason, par1DataOutput); ++ } ++ ++ /** ++ * Passes this Packet on to the NetHandler for processing. ++ */ ++ public void processPacket(NetHandler par1NetHandler) { ++ par1NetHandler.handleKickDisconnect(this); ++ } ++ ++ /** ++ * Abstract. Return the size of the packet (not counting the header). ++ */ + public int getPacketSize() { +- return this.a.length(); ++ return this.reason.length(); + } + ++ /** ++ * only false for the abstract Packet class, all real packets return true ++ */ + public boolean isRealPacket() { + return true; + } + +- public boolean containsSameEntityIDAs(Packet var1) { ++ /** ++ * eg return packet30entity.entityId == entityId; WARNING : will throw if you compare a packet to a different packet ++ * class ++ */ ++ public boolean containsSameEntityIDAs(Packet par1Packet) { + return true; + } + } diff --git a/patches/net/minecraft/src/Packet25EntityPainting.java.patch b/patches/net/minecraft/src/Packet25EntityPainting.java.patch new file mode 100644 index 0000000..77c8c0e --- /dev/null +++ b/patches/net/minecraft/src/Packet25EntityPainting.java.patch @@ -0,0 +1,92 @@ +--- net/minecraft/src/Packet25EntityPainting.java ++++ net/minecraft/src/Packet25EntityPainting.java +@@ -10,42 +10,53 @@ + public int yPosition; + public int zPosition; + public int direction; +- public String f; +- +- public Packet25EntityPainting() { +- } +- +- public Packet25EntityPainting(EntityPainting var1) { +- this.entityId = var1.entityId; +- this.xPosition = var1.xPosition; +- this.yPosition = var1.yPosition; +- this.zPosition = var1.zPosition; +- this.direction = var1.hangingDirection; +- this.f = var1.art.B; +- } +- +- public void readPacketData(DataInput var1) throws IOException { +- this.entityId = var1.readInt(); +- this.f = readString(var1, EnumArt.maxArtTitleLength); +- this.xPosition = var1.readInt(); +- this.yPosition = var1.readInt(); +- this.zPosition = var1.readInt(); +- this.direction = var1.readInt(); +- } +- +- public void writePacketData(DataOutput var1) throws IOException { +- var1.writeInt(this.entityId); +- writeString(this.f, var1); +- var1.writeInt(this.xPosition); +- var1.writeInt(this.yPosition); +- var1.writeInt(this.zPosition); +- var1.writeInt(this.direction); +- } +- +- public void processPacket(NetHandler var1) { +- var1.handleEntityPainting(this); +- } +- ++ public String title; ++ ++ public Packet25EntityPainting() {} ++ ++ public Packet25EntityPainting(EntityPainting par1EntityPainting) { ++ this.entityId = par1EntityPainting.entityId; ++ this.xPosition = par1EntityPainting.xPosition; ++ this.yPosition = par1EntityPainting.yPosition; ++ this.zPosition = par1EntityPainting.zPosition; ++ this.direction = par1EntityPainting.hangingDirection; ++ this.title = par1EntityPainting.art.title; ++ } ++ ++ /** ++ * Abstract. Reads the raw packet data from the data stream. ++ */ ++ public void readPacketData(DataInput par1DataInput) throws IOException { ++ this.entityId = par1DataInput.readInt(); ++ this.title = readString(par1DataInput, EnumArt.maxArtTitleLength); ++ this.xPosition = par1DataInput.readInt(); ++ this.yPosition = par1DataInput.readInt(); ++ this.zPosition = par1DataInput.readInt(); ++ this.direction = par1DataInput.readInt(); ++ } ++ ++ /** ++ * Abstract. Writes the raw packet data to the data stream. ++ */ ++ public void writePacketData(DataOutput par1DataOutput) throws IOException { ++ par1DataOutput.writeInt(this.entityId); ++ writeString(this.title, par1DataOutput); ++ par1DataOutput.writeInt(this.xPosition); ++ par1DataOutput.writeInt(this.yPosition); ++ par1DataOutput.writeInt(this.zPosition); ++ par1DataOutput.writeInt(this.direction); ++ } ++ ++ /** ++ * Passes this Packet on to the NetHandler for processing. ++ */ ++ public void processPacket(NetHandler par1NetHandler) { ++ par1NetHandler.handleEntityPainting(this); ++ } ++ ++ /** ++ * Abstract. Return the size of the packet (not counting the header). ++ */ + public int getPacketSize() { + return 24; + } diff --git a/patches/net/minecraft/src/Packet26EntityExpOrb.java.patch b/patches/net/minecraft/src/Packet26EntityExpOrb.java.patch new file mode 100644 index 0000000..6d766c6 --- /dev/null +++ b/patches/net/minecraft/src/Packet26EntityExpOrb.java.patch @@ -0,0 +1,92 @@ +--- net/minecraft/src/Packet26EntityExpOrb.java ++++ net/minecraft/src/Packet26EntityExpOrb.java +@@ -5,43 +5,58 @@ + import java.io.IOException; + + public class Packet26EntityExpOrb extends Packet { ++ ++ /** Entity ID for the XP Orb */ + public int entityId; + public int posX; + public int posY; + public int posZ; ++ ++ /** The Orbs Experience points value. */ + public int xpValue; + +- public Packet26EntityExpOrb() { +- } +- +- public Packet26EntityExpOrb(EntityXPOrb var1) { +- this.entityId = var1.entityId; +- this.posX = MathHelper.floor_double(var1.posX * 32.0D); +- this.posY = MathHelper.floor_double(var1.posY * 32.0D); +- this.posZ = MathHelper.floor_double(var1.posZ * 32.0D); +- this.xpValue = var1.getXpValue(); +- } +- +- public void readPacketData(DataInput var1) throws IOException { +- this.entityId = var1.readInt(); +- this.posX = var1.readInt(); +- this.posY = var1.readInt(); +- this.posZ = var1.readInt(); +- this.xpValue = var1.readShort(); +- } +- +- public void writePacketData(DataOutput var1) throws IOException { +- var1.writeInt(this.entityId); +- var1.writeInt(this.posX); +- var1.writeInt(this.posY); +- var1.writeInt(this.posZ); +- var1.writeShort(this.xpValue); +- } +- +- public void processPacket(NetHandler var1) { +- var1.handleEntityExpOrb(this); +- } +- ++ public Packet26EntityExpOrb() {} ++ ++ public Packet26EntityExpOrb(EntityXPOrb par1EntityXPOrb) { ++ this.entityId = par1EntityXPOrb.entityId; ++ this.posX = MathHelper.floor_double(par1EntityXPOrb.posX * 32.0D); ++ this.posY = MathHelper.floor_double(par1EntityXPOrb.posY * 32.0D); ++ this.posZ = MathHelper.floor_double(par1EntityXPOrb.posZ * 32.0D); ++ this.xpValue = par1EntityXPOrb.getXpValue(); ++ } ++ ++ /** ++ * Abstract. Reads the raw packet data from the data stream. ++ */ ++ public void readPacketData(DataInput par1DataInput) throws IOException { ++ this.entityId = par1DataInput.readInt(); ++ this.posX = par1DataInput.readInt(); ++ this.posY = par1DataInput.readInt(); ++ this.posZ = par1DataInput.readInt(); ++ this.xpValue = par1DataInput.readShort(); ++ } ++ ++ /** ++ * Abstract. Writes the raw packet data to the data stream. ++ */ ++ public void writePacketData(DataOutput par1DataOutput) throws IOException { ++ par1DataOutput.writeInt(this.entityId); ++ par1DataOutput.writeInt(this.posX); ++ par1DataOutput.writeInt(this.posY); ++ par1DataOutput.writeInt(this.posZ); ++ par1DataOutput.writeShort(this.xpValue); ++ } ++ ++ /** ++ * Passes this Packet on to the NetHandler for processing. ++ */ ++ public void processPacket(NetHandler par1NetHandler) { ++ par1NetHandler.handleEntityExpOrb(this); ++ } ++ ++ /** ++ * Abstract. Return the size of the packet (not counting the header). ++ */ + public int getPacketSize() { + return 18; + } diff --git a/patches/net/minecraft/src/Packet27PlayerInput.java.patch b/patches/net/minecraft/src/Packet27PlayerInput.java.patch new file mode 100644 index 0000000..173ce88 --- /dev/null +++ b/patches/net/minecraft/src/Packet27PlayerInput.java.patch @@ -0,0 +1,76 @@ +--- net/minecraft/src/Packet27PlayerInput.java ++++ net/minecraft/src/Packet27PlayerInput.java +@@ -10,34 +10,45 @@ + private boolean field_111016_c; + private boolean field_111014_d; + +- public Packet27PlayerInput() { +- } +- +- public Packet27PlayerInput(float var1, float var2, boolean var3, boolean var4) { +- this.field_111017_a = var1; +- this.field_111015_b = var2; +- this.field_111016_c = var3; +- this.field_111014_d = var4; +- } +- +- public void readPacketData(DataInput var1) throws IOException { +- this.field_111017_a = var1.readFloat(); +- this.field_111015_b = var1.readFloat(); +- this.field_111016_c = var1.readBoolean(); +- this.field_111014_d = var1.readBoolean(); +- } +- +- public void writePacketData(DataOutput var1) throws IOException { +- var1.writeFloat(this.field_111017_a); +- var1.writeFloat(this.field_111015_b); +- var1.writeBoolean(this.field_111016_c); +- var1.writeBoolean(this.field_111014_d); +- } +- +- public void processPacket(NetHandler var1) { +- var1.func_110774_a(this); +- } +- ++ public Packet27PlayerInput() {} ++ ++ public Packet27PlayerInput(float par1, float par2, boolean par3, boolean par4) { ++ this.field_111017_a = par1; ++ this.field_111015_b = par2; ++ this.field_111016_c = par3; ++ this.field_111014_d = par4; ++ } ++ ++ /** ++ * Abstract. Reads the raw packet data from the data stream. ++ */ ++ public void readPacketData(DataInput par1DataInput) throws IOException { ++ this.field_111017_a = par1DataInput.readFloat(); ++ this.field_111015_b = par1DataInput.readFloat(); ++ this.field_111016_c = par1DataInput.readBoolean(); ++ this.field_111014_d = par1DataInput.readBoolean(); ++ } ++ ++ /** ++ * Abstract. Writes the raw packet data to the data stream. ++ */ ++ public void writePacketData(DataOutput par1DataOutput) throws IOException { ++ par1DataOutput.writeFloat(this.field_111017_a); ++ par1DataOutput.writeFloat(this.field_111015_b); ++ par1DataOutput.writeBoolean(this.field_111016_c); ++ par1DataOutput.writeBoolean(this.field_111014_d); ++ } ++ ++ /** ++ * Passes this Packet on to the NetHandler for processing. ++ */ ++ public void processPacket(NetHandler par1NetHandler) { ++ par1NetHandler.func_110774_a(this); ++ } ++ ++ /** ++ * Abstract. Return the size of the packet (not counting the header). ++ */ + public int getPacketSize() { + return 10; + } diff --git a/patches/net/minecraft/src/Packet28EntityVelocity.java.patch b/patches/net/minecraft/src/Packet28EntityVelocity.java.patch new file mode 100644 index 0000000..030eee1 --- /dev/null +++ b/patches/net/minecraft/src/Packet28EntityVelocity.java.patch @@ -0,0 +1,153 @@ +--- net/minecraft/src/Packet28EntityVelocity.java ++++ net/minecraft/src/Packet28EntityVelocity.java +@@ -10,73 +10,92 @@ + public int motionY; + public int motionZ; + +- public Packet28EntityVelocity() { +- } +- +- public Packet28EntityVelocity(Entity var1) { +- this(var1.entityId, var1.motionX, var1.motionY, var1.motionZ); +- } +- +- public Packet28EntityVelocity(int var1, double var2, double var4, double var6) { +- this.entityId = var1; ++ public Packet28EntityVelocity() {} ++ ++ public Packet28EntityVelocity(Entity par1Entity) { ++ this(par1Entity.entityId, par1Entity.motionX, par1Entity.motionY, par1Entity.motionZ); ++ } ++ ++ public Packet28EntityVelocity(int par1, double par2, double par4, double par6) { ++ this.entityId = par1; + double var8 = 3.9D; +- if(var2 < -var8) { +- var2 = -var8; +- } +- +- if(var4 < -var8) { +- var4 = -var8; +- } +- +- if(var6 < -var8) { +- var6 = -var8; +- } +- +- if(var2 > var8) { +- var2 = var8; +- } +- +- if(var4 > var8) { +- var4 = var8; +- } +- +- if(var6 > var8) { +- var6 = var8; +- } +- +- this.motionX = (int)(var2 * 8000.0D); +- this.motionY = (int)(var4 * 8000.0D); +- this.motionZ = (int)(var6 * 8000.0D); +- } +- +- public void readPacketData(DataInput var1) throws IOException { +- this.entityId = var1.readInt(); +- this.motionX = var1.readShort(); +- this.motionY = var1.readShort(); +- this.motionZ = var1.readShort(); +- } +- +- public void writePacketData(DataOutput var1) throws IOException { +- var1.writeInt(this.entityId); +- var1.writeShort(this.motionX); +- var1.writeShort(this.motionY); +- var1.writeShort(this.motionZ); +- } +- +- public void processPacket(NetHandler var1) { +- var1.handleEntityVelocity(this); +- } +- ++ ++ if (par2 < -var8) { ++ par2 = -var8; ++ } ++ ++ if (par4 < -var8) { ++ par4 = -var8; ++ } ++ ++ if (par6 < -var8) { ++ par6 = -var8; ++ } ++ ++ if (par2 > var8) { ++ par2 = var8; ++ } ++ ++ if (par4 > var8) { ++ par4 = var8; ++ } ++ ++ if (par6 > var8) { ++ par6 = var8; ++ } ++ ++ this.motionX = (int)(par2 * 8000.0D); ++ this.motionY = (int)(par4 * 8000.0D); ++ this.motionZ = (int)(par6 * 8000.0D); ++ } ++ ++ /** ++ * Abstract. Reads the raw packet data from the data stream. ++ */ ++ public void readPacketData(DataInput par1DataInput) throws IOException { ++ this.entityId = par1DataInput.readInt(); ++ this.motionX = par1DataInput.readShort(); ++ this.motionY = par1DataInput.readShort(); ++ this.motionZ = par1DataInput.readShort(); ++ } ++ ++ /** ++ * Abstract. Writes the raw packet data to the data stream. ++ */ ++ public void writePacketData(DataOutput par1DataOutput) throws IOException { ++ par1DataOutput.writeInt(this.entityId); ++ par1DataOutput.writeShort(this.motionX); ++ par1DataOutput.writeShort(this.motionY); ++ par1DataOutput.writeShort(this.motionZ); ++ } ++ ++ /** ++ * Passes this Packet on to the NetHandler for processing. ++ */ ++ public void processPacket(NetHandler par1NetHandler) { ++ par1NetHandler.handleEntityVelocity(this); ++ } ++ ++ /** ++ * Abstract. Return the size of the packet (not counting the header). ++ */ + public int getPacketSize() { + return 10; + } + ++ /** ++ * only false for the abstract Packet class, all real packets return true ++ */ + public boolean isRealPacket() { + return true; + } + +- public boolean containsSameEntityIDAs(Packet var1) { +- Packet28EntityVelocity var2 = (Packet28EntityVelocity)var1; ++ /** ++ * eg return packet30entity.entityId == entityId; WARNING : will throw if you compare a packet to a different packet ++ * class ++ */ ++ public boolean containsSameEntityIDAs(Packet par1Packet) { ++ Packet28EntityVelocity var2 = (Packet28EntityVelocity)par1Packet; + return var2.entityId == this.entityId; + } + } diff --git a/patches/net/minecraft/src/Packet29DestroyEntity.java.patch b/patches/net/minecraft/src/Packet29DestroyEntity.java.patch new file mode 100644 index 0000000..527ac53 --- /dev/null +++ b/patches/net/minecraft/src/Packet29DestroyEntity.java.patch @@ -0,0 +1,80 @@ +--- net/minecraft/src/Packet29DestroyEntity.java ++++ net/minecraft/src/Packet29DestroyEntity.java +@@ -5,37 +5,48 @@ + import java.io.IOException; + + public class Packet29DestroyEntity extends Packet { ++ ++ /** ID of the entity to be destroyed on the client. */ + public int[] entityId; + +- public Packet29DestroyEntity() { +- } +- +- public Packet29DestroyEntity(int... var1) { +- this.entityId = var1; +- } +- +- public void readPacketData(DataInput var1) throws IOException { +- this.entityId = new int[var1.readByte()]; +- +- for(int var2 = 0; var2 < this.entityId.length; ++var2) { +- this.entityId[var2] = var1.readInt(); +- } +- +- } +- +- public void writePacketData(DataOutput var1) throws IOException { +- var1.writeByte(this.entityId.length); +- +- for(int var2 = 0; var2 < this.entityId.length; ++var2) { +- var1.writeInt(this.entityId[var2]); +- } +- +- } +- +- public void processPacket(NetHandler var1) { +- var1.handleDestroyEntity(this); +- } +- ++ public Packet29DestroyEntity() {} ++ ++ public Packet29DestroyEntity(int ... par1ArrayOfInteger) { ++ this.entityId = par1ArrayOfInteger; ++ } ++ ++ /** ++ * Abstract. Reads the raw packet data from the data stream. ++ */ ++ public void readPacketData(DataInput par1DataInput) throws IOException { ++ this.entityId = new int[par1DataInput.readByte()]; ++ ++ for (int var2 = 0; var2 < this.entityId.length; ++var2) { ++ this.entityId[var2] = par1DataInput.readInt(); ++ } ++ } ++ ++ /** ++ * Abstract. Writes the raw packet data to the data stream. ++ */ ++ public void writePacketData(DataOutput par1DataOutput) throws IOException { ++ par1DataOutput.writeByte(this.entityId.length); ++ ++ for (int var2 = 0; var2 < this.entityId.length; ++var2) { ++ par1DataOutput.writeInt(this.entityId[var2]); ++ } ++ } ++ ++ /** ++ * Passes this Packet on to the NetHandler for processing. ++ */ ++ public void processPacket(NetHandler par1NetHandler) { ++ par1NetHandler.handleDestroyEntity(this); ++ } ++ ++ /** ++ * Abstract. Return the size of the packet (not counting the header). ++ */ + public int getPacketSize() { + return 1 + this.entityId.length * 4; + } diff --git a/patches/net/minecraft/src/Packet2ClientProtocol.java.patch b/patches/net/minecraft/src/Packet2ClientProtocol.java.patch new file mode 100644 index 0000000..ce906da --- /dev/null +++ b/patches/net/minecraft/src/Packet2ClientProtocol.java.patch @@ -0,0 +1,99 @@ +--- net/minecraft/src/Packet2ClientProtocol.java ++++ net/minecraft/src/Packet2ClientProtocol.java +@@ -6,47 +6,64 @@ + + public class Packet2ClientProtocol extends Packet { + private int protocolVersion; +- private String b; +- private String c; ++ private String username; ++ private String serverHost; + private int serverPort; + +- public Packet2ClientProtocol() { +- } +- +- public Packet2ClientProtocol(int var1, String var2, String var3, int var4) { +- this.protocolVersion = var1; +- this.b = var2; +- this.c = var3; +- this.serverPort = var4; +- } +- +- public void readPacketData(DataInput var1) throws IOException { +- this.protocolVersion = var1.readByte(); +- this.b = readString(var1, 16); +- this.c = readString(var1, 255); +- this.serverPort = var1.readInt(); +- } +- +- public void writePacketData(DataOutput var1) throws IOException { +- var1.writeByte(this.protocolVersion); +- writeString(this.b, var1); +- writeString(this.c, var1); +- var1.writeInt(this.serverPort); +- } +- +- public void processPacket(NetHandler var1) { +- var1.handleClientProtocol(this); +- } +- ++ public Packet2ClientProtocol() {} ++ ++ public Packet2ClientProtocol(int par1, String par2Str, String par3Str, int par4) { ++ this.protocolVersion = par1; ++ this.username = par2Str; ++ this.serverHost = par3Str; ++ this.serverPort = par4; ++ } ++ ++ /** ++ * Abstract. Reads the raw packet data from the data stream. ++ */ ++ public void readPacketData(DataInput par1DataInput) throws IOException { ++ this.protocolVersion = par1DataInput.readByte(); ++ this.username = readString(par1DataInput, 16); ++ this.serverHost = readString(par1DataInput, 255); ++ this.serverPort = par1DataInput.readInt(); ++ } ++ ++ /** ++ * Abstract. Writes the raw packet data to the data stream. ++ */ ++ public void writePacketData(DataOutput par1DataOutput) throws IOException { ++ par1DataOutput.writeByte(this.protocolVersion); ++ writeString(this.username, par1DataOutput); ++ writeString(this.serverHost, par1DataOutput); ++ par1DataOutput.writeInt(this.serverPort); ++ } ++ ++ /** ++ * Passes this Packet on to the NetHandler for processing. ++ */ ++ public void processPacket(NetHandler par1NetHandler) { ++ par1NetHandler.handleClientProtocol(this); ++ } ++ ++ /** ++ * Abstract. Return the size of the packet (not counting the header). ++ */ + public int getPacketSize() { +- return 3 + 2 * this.b.length(); ++ return 3 + 2 * this.username.length(); + } + ++ /** ++ * Returns the protocol version. ++ */ + public int getProtocolVersion() { + return this.protocolVersion; + } + ++ /** ++ * Returns the username. ++ */ + public String getUsername() { +- return this.b; ++ return this.username; + } + } diff --git a/patches/net/minecraft/src/Packet30Entity.java.patch b/patches/net/minecraft/src/Packet30Entity.java.patch new file mode 100644 index 0000000..6e9b3cc --- /dev/null +++ b/patches/net/minecraft/src/Packet30Entity.java.patch @@ -0,0 +1,102 @@ +--- net/minecraft/src/Packet30Entity.java ++++ net/minecraft/src/Packet30Entity.java +@@ -5,33 +5,58 @@ + import java.io.IOException; + + public class Packet30Entity extends Packet { ++ ++ /** The ID of this entity. */ + public int entityId; ++ ++ /** The X axis relative movement. */ + public byte xPosition; ++ ++ /** The Y axis relative movement. */ + public byte yPosition; ++ ++ /** The Z axis relative movement. */ + public byte zPosition; ++ ++ /** The X axis rotation. */ + public byte yaw; ++ ++ /** The Y axis rotation. */ + public byte pitch; ++ ++ /** Boolean set to true if the entity is rotating. */ + public boolean rotating; + +- public Packet30Entity() { +- } +- +- public Packet30Entity(int var1) { +- this.entityId = var1; +- } +- +- public void readPacketData(DataInput var1) throws IOException { +- this.entityId = var1.readInt(); +- } +- +- public void writePacketData(DataOutput var1) throws IOException { +- var1.writeInt(this.entityId); +- } +- +- public void processPacket(NetHandler var1) { +- var1.handleEntity(this); +- } +- ++ public Packet30Entity() {} ++ ++ public Packet30Entity(int par1) { ++ this.entityId = par1; ++ } ++ ++ /** ++ * Abstract. Reads the raw packet data from the data stream. ++ */ ++ public void readPacketData(DataInput par1DataInput) throws IOException { ++ this.entityId = par1DataInput.readInt(); ++ } ++ ++ /** ++ * Abstract. Writes the raw packet data to the data stream. ++ */ ++ public void writePacketData(DataOutput par1DataOutput) throws IOException { ++ par1DataOutput.writeInt(this.entityId); ++ } ++ ++ /** ++ * Passes this Packet on to the NetHandler for processing. ++ */ ++ public void processPacket(NetHandler par1NetHandler) { ++ par1NetHandler.handleEntity(this); ++ } ++ ++ /** ++ * Abstract. Return the size of the packet (not counting the header). ++ */ + public int getPacketSize() { + return 4; + } +@@ -40,12 +65,19 @@ + return "Entity_" + super.toString(); + } + ++ /** ++ * only false for the abstract Packet class, all real packets return true ++ */ + public boolean isRealPacket() { + return true; + } + +- public boolean containsSameEntityIDAs(Packet var1) { +- Packet30Entity var2 = (Packet30Entity)var1; ++ /** ++ * eg return packet30entity.entityId == entityId; WARNING : will throw if you compare a packet to a different packet ++ * class ++ */ ++ public boolean containsSameEntityIDAs(Packet par1Packet) { ++ Packet30Entity var2 = (Packet30Entity)par1Packet; + return var2.entityId == this.entityId; + } + } diff --git a/patches/net/minecraft/src/Packet31RelEntityMove.java.patch b/patches/net/minecraft/src/Packet31RelEntityMove.java.patch new file mode 100644 index 0000000..41c4302 --- /dev/null +++ b/patches/net/minecraft/src/Packet31RelEntityMove.java.patch @@ -0,0 +1,65 @@ +--- net/minecraft/src/Packet31RelEntityMove.java ++++ net/minecraft/src/Packet31RelEntityMove.java +@@ -5,30 +5,38 @@ + import java.io.IOException; + + public class Packet31RelEntityMove extends Packet30Entity { +- public Packet31RelEntityMove() { +- } +- +- public Packet31RelEntityMove(int var1, byte var2, byte var3, byte var4) { +- super(var1); +- this.xPosition = var2; +- this.yPosition = var3; +- this.zPosition = var4; +- } +- +- public void readPacketData(DataInput var1) throws IOException { +- super.readPacketData(var1); +- this.xPosition = var1.readByte(); +- this.yPosition = var1.readByte(); +- this.zPosition = var1.readByte(); +- } +- +- public void writePacketData(DataOutput var1) throws IOException { +- super.writePacketData(var1); +- var1.writeByte(this.xPosition); +- var1.writeByte(this.yPosition); +- var1.writeByte(this.zPosition); +- } +- ++ public Packet31RelEntityMove() {} ++ ++ public Packet31RelEntityMove(int par1, byte par2, byte par3, byte par4) { ++ super(par1); ++ this.xPosition = par2; ++ this.yPosition = par3; ++ this.zPosition = par4; ++ } ++ ++ /** ++ * Abstract. Reads the raw packet data from the data stream. ++ */ ++ public void readPacketData(DataInput par1DataInput) throws IOException { ++ super.readPacketData(par1DataInput); ++ this.xPosition = par1DataInput.readByte(); ++ this.yPosition = par1DataInput.readByte(); ++ this.zPosition = par1DataInput.readByte(); ++ } ++ ++ /** ++ * Abstract. Writes the raw packet data to the data stream. ++ */ ++ public void writePacketData(DataOutput par1DataOutput) throws IOException { ++ super.writePacketData(par1DataOutput); ++ par1DataOutput.writeByte(this.xPosition); ++ par1DataOutput.writeByte(this.yPosition); ++ par1DataOutput.writeByte(this.zPosition); ++ } ++ ++ /** ++ * Abstract. Return the size of the packet (not counting the header). ++ */ + public int getPacketSize() { + return 7; + } diff --git a/patches/net/minecraft/src/Packet32EntityLook.java.patch b/patches/net/minecraft/src/Packet32EntityLook.java.patch new file mode 100644 index 0000000..9bb1025 --- /dev/null +++ b/patches/net/minecraft/src/Packet32EntityLook.java.patch @@ -0,0 +1,53 @@ +--- net/minecraft/src/Packet32EntityLook.java ++++ net/minecraft/src/Packet32EntityLook.java +@@ -9,25 +9,34 @@ + this.rotating = true; + } + +- public Packet32EntityLook(int var1, byte var2, byte var3) { +- super(var1); +- this.yaw = var2; +- this.pitch = var3; ++ public Packet32EntityLook(int par1, byte par2, byte par3) { ++ super(par1); ++ this.yaw = par2; ++ this.pitch = par3; + this.rotating = true; + } + +- public void readPacketData(DataInput var1) throws IOException { +- super.readPacketData(var1); +- this.yaw = var1.readByte(); +- this.pitch = var1.readByte(); +- } +- +- public void writePacketData(DataOutput var1) throws IOException { +- super.writePacketData(var1); +- var1.writeByte(this.yaw); +- var1.writeByte(this.pitch); +- } +- ++ /** ++ * Abstract. Reads the raw packet data from the data stream. ++ */ ++ public void readPacketData(DataInput par1DataInput) throws IOException { ++ super.readPacketData(par1DataInput); ++ this.yaw = par1DataInput.readByte(); ++ this.pitch = par1DataInput.readByte(); ++ } ++ ++ /** ++ * Abstract. Writes the raw packet data to the data stream. ++ */ ++ public void writePacketData(DataOutput par1DataOutput) throws IOException { ++ super.writePacketData(par1DataOutput); ++ par1DataOutput.writeByte(this.yaw); ++ par1DataOutput.writeByte(this.pitch); ++ } ++ ++ /** ++ * Abstract. Return the size of the packet (not counting the header). ++ */ + public int getPacketSize() { + return 6; + } diff --git a/patches/net/minecraft/src/Packet33RelEntityMoveLook.java.patch b/patches/net/minecraft/src/Packet33RelEntityMoveLook.java.patch new file mode 100644 index 0000000..353aef6 --- /dev/null +++ b/patches/net/minecraft/src/Packet33RelEntityMoveLook.java.patch @@ -0,0 +1,71 @@ +--- net/minecraft/src/Packet33RelEntityMoveLook.java ++++ net/minecraft/src/Packet33RelEntityMoveLook.java +@@ -9,34 +9,43 @@ + this.rotating = true; + } + +- public Packet33RelEntityMoveLook(int var1, byte var2, byte var3, byte var4, byte var5, byte var6) { +- super(var1); +- this.xPosition = var2; +- this.yPosition = var3; +- this.zPosition = var4; +- this.yaw = var5; +- this.pitch = var6; ++ public Packet33RelEntityMoveLook(int par1, byte par2, byte par3, byte par4, byte par5, byte par6) { ++ super(par1); ++ this.xPosition = par2; ++ this.yPosition = par3; ++ this.zPosition = par4; ++ this.yaw = par5; ++ this.pitch = par6; + this.rotating = true; + } + +- public void readPacketData(DataInput var1) throws IOException { +- super.readPacketData(var1); +- this.xPosition = var1.readByte(); +- this.yPosition = var1.readByte(); +- this.zPosition = var1.readByte(); +- this.yaw = var1.readByte(); +- this.pitch = var1.readByte(); +- } +- +- public void writePacketData(DataOutput var1) throws IOException { +- super.writePacketData(var1); +- var1.writeByte(this.xPosition); +- var1.writeByte(this.yPosition); +- var1.writeByte(this.zPosition); +- var1.writeByte(this.yaw); +- var1.writeByte(this.pitch); +- } +- ++ /** ++ * Abstract. Reads the raw packet data from the data stream. ++ */ ++ public void readPacketData(DataInput par1DataInput) throws IOException { ++ super.readPacketData(par1DataInput); ++ this.xPosition = par1DataInput.readByte(); ++ this.yPosition = par1DataInput.readByte(); ++ this.zPosition = par1DataInput.readByte(); ++ this.yaw = par1DataInput.readByte(); ++ this.pitch = par1DataInput.readByte(); ++ } ++ ++ /** ++ * Abstract. Writes the raw packet data to the data stream. ++ */ ++ public void writePacketData(DataOutput par1DataOutput) throws IOException { ++ super.writePacketData(par1DataOutput); ++ par1DataOutput.writeByte(this.xPosition); ++ par1DataOutput.writeByte(this.yPosition); ++ par1DataOutput.writeByte(this.zPosition); ++ par1DataOutput.writeByte(this.yaw); ++ par1DataOutput.writeByte(this.pitch); ++ } ++ ++ /** ++ * Abstract. Return the size of the packet (not counting the header). ++ */ + public int getPacketSize() { + return 9; + } diff --git a/patches/net/minecraft/src/Packet34EntityTeleport.java.patch b/patches/net/minecraft/src/Packet34EntityTeleport.java.patch new file mode 100644 index 0000000..165412e --- /dev/null +++ b/patches/net/minecraft/src/Packet34EntityTeleport.java.patch @@ -0,0 +1,144 @@ +--- net/minecraft/src/Packet34EntityTeleport.java ++++ net/minecraft/src/Packet34EntityTeleport.java +@@ -5,66 +5,96 @@ + import java.io.IOException; + + public class Packet34EntityTeleport extends Packet { ++ ++ /** ID of the entity. */ + public int entityId; ++ ++ /** X position of the entity. */ + public int xPosition; ++ ++ /** Y position of the entity. */ + public int yPosition; ++ ++ /** Z position of the entity. */ + public int zPosition; ++ ++ /** Yaw of the entity. */ + public byte yaw; ++ ++ /** Pitch of the entity. */ + public byte pitch; + +- public Packet34EntityTeleport() { +- } +- +- public Packet34EntityTeleport(Entity var1) { +- this.entityId = var1.entityId; +- this.xPosition = MathHelper.floor_double(var1.posX * 32.0D); +- this.yPosition = MathHelper.floor_double(var1.posY * 32.0D); +- this.zPosition = MathHelper.floor_double(var1.posZ * 32.0D); +- this.yaw = (byte)((int)(var1.rotationYaw * 256.0F / 360.0F)); +- this.pitch = (byte)((int)(var1.rotationPitch * 256.0F / 360.0F)); +- } +- +- public Packet34EntityTeleport(int var1, int var2, int var3, int var4, byte var5, byte var6) { +- this.entityId = var1; +- this.xPosition = var2; +- this.yPosition = var3; +- this.zPosition = var4; +- this.yaw = var5; +- this.pitch = var6; +- } +- +- public void readPacketData(DataInput var1) throws IOException { +- this.entityId = var1.readInt(); +- this.xPosition = var1.readInt(); +- this.yPosition = var1.readInt(); +- this.zPosition = var1.readInt(); +- this.yaw = var1.readByte(); +- this.pitch = var1.readByte(); +- } +- +- public void writePacketData(DataOutput var1) throws IOException { +- var1.writeInt(this.entityId); +- var1.writeInt(this.xPosition); +- var1.writeInt(this.yPosition); +- var1.writeInt(this.zPosition); +- var1.write(this.yaw); +- var1.write(this.pitch); +- } +- +- public void processPacket(NetHandler var1) { +- var1.handleEntityTeleport(this); +- } +- ++ public Packet34EntityTeleport() {} ++ ++ public Packet34EntityTeleport(Entity par1Entity) { ++ this.entityId = par1Entity.entityId; ++ this.xPosition = MathHelper.floor_double(par1Entity.posX * 32.0D); ++ this.yPosition = MathHelper.floor_double(par1Entity.posY * 32.0D); ++ this.zPosition = MathHelper.floor_double(par1Entity.posZ * 32.0D); ++ this.yaw = (byte)((int)(par1Entity.rotationYaw * 256.0F / 360.0F)); ++ this.pitch = (byte)((int)(par1Entity.rotationPitch * 256.0F / 360.0F)); ++ } ++ ++ public Packet34EntityTeleport(int par1, int par2, int par3, int par4, byte par5, byte par6) { ++ this.entityId = par1; ++ this.xPosition = par2; ++ this.yPosition = par3; ++ this.zPosition = par4; ++ this.yaw = par5; ++ this.pitch = par6; ++ } ++ ++ /** ++ * Abstract. Reads the raw packet data from the data stream. ++ */ ++ public void readPacketData(DataInput par1DataInput) throws IOException { ++ this.entityId = par1DataInput.readInt(); ++ this.xPosition = par1DataInput.readInt(); ++ this.yPosition = par1DataInput.readInt(); ++ this.zPosition = par1DataInput.readInt(); ++ this.yaw = par1DataInput.readByte(); ++ this.pitch = par1DataInput.readByte(); ++ } ++ ++ /** ++ * Abstract. Writes the raw packet data to the data stream. ++ */ ++ public void writePacketData(DataOutput par1DataOutput) throws IOException { ++ par1DataOutput.writeInt(this.entityId); ++ par1DataOutput.writeInt(this.xPosition); ++ par1DataOutput.writeInt(this.yPosition); ++ par1DataOutput.writeInt(this.zPosition); ++ par1DataOutput.write(this.yaw); ++ par1DataOutput.write(this.pitch); ++ } ++ ++ /** ++ * Passes this Packet on to the NetHandler for processing. ++ */ ++ public void processPacket(NetHandler par1NetHandler) { ++ par1NetHandler.handleEntityTeleport(this); ++ } ++ ++ /** ++ * Abstract. Return the size of the packet (not counting the header). ++ */ + public int getPacketSize() { + return 34; + } + ++ /** ++ * only false for the abstract Packet class, all real packets return true ++ */ + public boolean isRealPacket() { + return true; + } + +- public boolean containsSameEntityIDAs(Packet var1) { +- Packet34EntityTeleport var2 = (Packet34EntityTeleport)var1; ++ /** ++ * eg return packet30entity.entityId == entityId; WARNING : will throw if you compare a packet to a different packet ++ * class ++ */ ++ public boolean containsSameEntityIDAs(Packet par1Packet) { ++ Packet34EntityTeleport var2 = (Packet34EntityTeleport)par1Packet; + return var2.entityId == this.entityId; + } + } diff --git a/patches/net/minecraft/src/Packet35EntityHeadRotation.java.patch b/patches/net/minecraft/src/Packet35EntityHeadRotation.java.patch new file mode 100644 index 0000000..219cb39 --- /dev/null +++ b/patches/net/minecraft/src/Packet35EntityHeadRotation.java.patch @@ -0,0 +1,90 @@ +--- net/minecraft/src/Packet35EntityHeadRotation.java ++++ net/minecraft/src/Packet35EntityHeadRotation.java +@@ -8,41 +8,63 @@ + public int entityId; + public byte headRotationYaw; + +- public Packet35EntityHeadRotation() { +- } +- +- public Packet35EntityHeadRotation(int var1, byte var2) { +- this.entityId = var1; +- this.headRotationYaw = var2; +- } +- +- public void readPacketData(DataInput var1) throws IOException { +- this.entityId = var1.readInt(); +- this.headRotationYaw = var1.readByte(); +- } +- +- public void writePacketData(DataOutput var1) throws IOException { +- var1.writeInt(this.entityId); +- var1.writeByte(this.headRotationYaw); +- } +- +- public void processPacket(NetHandler var1) { +- var1.handleEntityHeadRotation(this); +- } +- ++ public Packet35EntityHeadRotation() {} ++ ++ public Packet35EntityHeadRotation(int par1, byte par2) { ++ this.entityId = par1; ++ this.headRotationYaw = par2; ++ } ++ ++ /** ++ * Abstract. Reads the raw packet data from the data stream. ++ */ ++ public void readPacketData(DataInput par1DataInput) throws IOException { ++ this.entityId = par1DataInput.readInt(); ++ this.headRotationYaw = par1DataInput.readByte(); ++ } ++ ++ /** ++ * Abstract. Writes the raw packet data to the data stream. ++ */ ++ public void writePacketData(DataOutput par1DataOutput) throws IOException { ++ par1DataOutput.writeInt(this.entityId); ++ par1DataOutput.writeByte(this.headRotationYaw); ++ } ++ ++ /** ++ * Passes this Packet on to the NetHandler for processing. ++ */ ++ public void processPacket(NetHandler par1NetHandler) { ++ par1NetHandler.handleEntityHeadRotation(this); ++ } ++ ++ /** ++ * Abstract. Return the size of the packet (not counting the header). ++ */ + public int getPacketSize() { + return 5; + } + ++ /** ++ * only false for the abstract Packet class, all real packets return true ++ */ + public boolean isRealPacket() { + return true; + } + +- public boolean containsSameEntityIDAs(Packet var1) { +- Packet35EntityHeadRotation var2 = (Packet35EntityHeadRotation)var1; ++ /** ++ * eg return packet30entity.entityId == entityId; WARNING : will throw if you compare a packet to a different packet ++ * class ++ */ ++ public boolean containsSameEntityIDAs(Packet par1Packet) { ++ Packet35EntityHeadRotation var2 = (Packet35EntityHeadRotation)par1Packet; + return var2.entityId == this.entityId; + } + ++ /** ++ * If this returns true, the packet may be processed on any thread; otherwise it is queued for the main thread to ++ * handle. ++ */ + public boolean canProcessAsync() { + return true; + } diff --git a/patches/net/minecraft/src/Packet38EntityStatus.java.patch b/patches/net/minecraft/src/Packet38EntityStatus.java.patch new file mode 100644 index 0000000..744fabc --- /dev/null +++ b/patches/net/minecraft/src/Packet38EntityStatus.java.patch @@ -0,0 +1,68 @@ +--- net/minecraft/src/Packet38EntityStatus.java ++++ net/minecraft/src/Packet38EntityStatus.java +@@ -6,30 +6,43 @@ + + public class Packet38EntityStatus extends Packet { + public int entityId; ++ ++ /** 2 for hurt, 3 for dead */ + public byte entityStatus; + +- public Packet38EntityStatus() { +- } +- +- public Packet38EntityStatus(int var1, byte var2) { +- this.entityId = var1; +- this.entityStatus = var2; +- } +- +- public void readPacketData(DataInput var1) throws IOException { +- this.entityId = var1.readInt(); +- this.entityStatus = var1.readByte(); +- } +- +- public void writePacketData(DataOutput var1) throws IOException { +- var1.writeInt(this.entityId); +- var1.writeByte(this.entityStatus); +- } +- +- public void processPacket(NetHandler var1) { +- var1.handleEntityStatus(this); +- } +- ++ public Packet38EntityStatus() {} ++ ++ public Packet38EntityStatus(int par1, byte par2) { ++ this.entityId = par1; ++ this.entityStatus = par2; ++ } ++ ++ /** ++ * Abstract. Reads the raw packet data from the data stream. ++ */ ++ public void readPacketData(DataInput par1DataInput) throws IOException { ++ this.entityId = par1DataInput.readInt(); ++ this.entityStatus = par1DataInput.readByte(); ++ } ++ ++ /** ++ * Abstract. Writes the raw packet data to the data stream. ++ */ ++ public void writePacketData(DataOutput par1DataOutput) throws IOException { ++ par1DataOutput.writeInt(this.entityId); ++ par1DataOutput.writeByte(this.entityStatus); ++ } ++ ++ /** ++ * Passes this Packet on to the NetHandler for processing. ++ */ ++ public void processPacket(NetHandler par1NetHandler) { ++ par1NetHandler.handleEntityStatus(this); ++ } ++ ++ /** ++ * Abstract. Return the size of the packet (not counting the header). ++ */ + public int getPacketSize() { + return 5; + } diff --git a/patches/net/minecraft/src/Packet39AttachEntity.java.patch b/patches/net/minecraft/src/Packet39AttachEntity.java.patch new file mode 100644 index 0000000..5a1e8d2 --- /dev/null +++ b/patches/net/minecraft/src/Packet39AttachEntity.java.patch @@ -0,0 +1,95 @@ +--- net/minecraft/src/Packet39AttachEntity.java ++++ net/minecraft/src/Packet39AttachEntity.java +@@ -5,45 +5,65 @@ + import java.io.IOException; + + public class Packet39AttachEntity extends Packet { ++ ++ /** 0 for riding, 1 for leashed. */ + public int attachState; + public int ridingEntityId; + public int vehicleEntityId; + +- public Packet39AttachEntity() { +- } +- +- public Packet39AttachEntity(int var1, Entity var2, Entity var3) { +- this.attachState = var1; +- this.ridingEntityId = var2.entityId; +- this.vehicleEntityId = var3 != null ? var3.entityId : -1; +- } +- ++ public Packet39AttachEntity() {} ++ ++ public Packet39AttachEntity(int par1, Entity par2Entity, Entity par3Entity) { ++ this.attachState = par1; ++ this.ridingEntityId = par2Entity.entityId; ++ this.vehicleEntityId = par3Entity != null ? par3Entity.entityId : -1; ++ } ++ ++ /** ++ * Abstract. Return the size of the packet (not counting the header). ++ */ + public int getPacketSize() { + return 8; + } + +- public void readPacketData(DataInput var1) throws IOException { +- this.ridingEntityId = var1.readInt(); +- this.vehicleEntityId = var1.readInt(); +- this.attachState = var1.readUnsignedByte(); +- } +- +- public void writePacketData(DataOutput var1) throws IOException { +- var1.writeInt(this.ridingEntityId); +- var1.writeInt(this.vehicleEntityId); +- var1.writeByte(this.attachState); +- } +- +- public void processPacket(NetHandler var1) { +- var1.handleAttachEntity(this); +- } +- ++ /** ++ * Abstract. Reads the raw packet data from the data stream. ++ */ ++ public void readPacketData(DataInput par1DataInput) throws IOException { ++ this.ridingEntityId = par1DataInput.readInt(); ++ this.vehicleEntityId = par1DataInput.readInt(); ++ this.attachState = par1DataInput.readUnsignedByte(); ++ } ++ ++ /** ++ * Abstract. Writes the raw packet data to the data stream. ++ */ ++ public void writePacketData(DataOutput par1DataOutput) throws IOException { ++ par1DataOutput.writeInt(this.ridingEntityId); ++ par1DataOutput.writeInt(this.vehicleEntityId); ++ par1DataOutput.writeByte(this.attachState); ++ } ++ ++ /** ++ * Passes this Packet on to the NetHandler for processing. ++ */ ++ public void processPacket(NetHandler par1NetHandler) { ++ par1NetHandler.handleAttachEntity(this); ++ } ++ ++ /** ++ * only false for the abstract Packet class, all real packets return true ++ */ + public boolean isRealPacket() { + return true; + } + +- public boolean containsSameEntityIDAs(Packet var1) { +- Packet39AttachEntity var2 = (Packet39AttachEntity)var1; ++ /** ++ * eg return packet30entity.entityId == entityId; WARNING : will throw if you compare a packet to a different packet ++ * class ++ */ ++ public boolean containsSameEntityIDAs(Packet par1Packet) { ++ Packet39AttachEntity var2 = (Packet39AttachEntity)par1Packet; + return var2.ridingEntityId == this.ridingEntityId; + } + } diff --git a/patches/net/minecraft/src/Packet3Chat.java.patch b/patches/net/minecraft/src/Packet3Chat.java.patch new file mode 100644 index 0000000..434fdd4 --- /dev/null +++ b/patches/net/minecraft/src/Packet3Chat.java.patch @@ -0,0 +1,105 @@ +--- net/minecraft/src/Packet3Chat.java ++++ net/minecraft/src/Packet3Chat.java +@@ -5,51 +5,69 @@ + import java.io.IOException; + + public class Packet3Chat extends Packet { +- public String a; ++ ++ /** The message being sent. */ ++ public String message; + private boolean isServer; + + public Packet3Chat() { + this.isServer = true; + } + +- public Packet3Chat(ChatMessageComponent var1) { +- this(var1.toJson()); +- } +- +- public Packet3Chat(ChatMessageComponent var1, boolean var2) { +- this(var1.toJson(), var2); +- } +- +- public Packet3Chat(String var1) { +- this(var1, true); +- } +- +- public Packet3Chat(String var1, boolean var2) { ++ public Packet3Chat(ChatMessageComponent par1ChatMessageComponent) { ++ this(par1ChatMessageComponent.toJson()); ++ } ++ ++ public Packet3Chat(ChatMessageComponent par1ChatMessageComponent, boolean par2) { ++ this(par1ChatMessageComponent.toJson(), par2); ++ } ++ ++ public Packet3Chat(String par1Str) { ++ this(par1Str, true); ++ } ++ ++ public Packet3Chat(String par1Str, boolean par2) { + this.isServer = true; +- if(var1.length() > Short.MAX_VALUE) { +- var1 = var1.substring(0, Short.MAX_VALUE); ++ ++ if (par1Str.length() > 32767) { ++ par1Str = par1Str.substring(0, 32767); + } + +- this.a = var1; +- this.isServer = var2; +- } +- +- public void readPacketData(DataInput var1) throws IOException { +- this.a = readString(var1, Short.MAX_VALUE); +- } +- +- public void writePacketData(DataOutput var1) throws IOException { +- writeString(this.a, var1); +- } +- +- public void processPacket(NetHandler var1) { +- var1.handleChat(this); +- } +- ++ this.message = par1Str; ++ this.isServer = par2; ++ } ++ ++ /** ++ * Abstract. Reads the raw packet data from the data stream. ++ */ ++ public void readPacketData(DataInput par1DataInput) throws IOException { ++ this.message = readString(par1DataInput, 32767); ++ } ++ ++ /** ++ * Abstract. Writes the raw packet data to the data stream. ++ */ ++ public void writePacketData(DataOutput par1DataOutput) throws IOException { ++ writeString(this.message, par1DataOutput); ++ } ++ ++ /** ++ * Passes this Packet on to the NetHandler for processing. ++ */ ++ public void processPacket(NetHandler par1NetHandler) { ++ par1NetHandler.handleChat(this); ++ } ++ ++ /** ++ * Abstract. Return the size of the packet (not counting the header). ++ */ + public int getPacketSize() { +- return 2 + this.a.length() * 2; ++ return 2 + this.message.length() * 2; + } + ++ /** ++ * Get whether this is a server ++ */ + public boolean getIsServer() { + return this.isServer; + } diff --git a/patches/net/minecraft/src/Packet40EntityMetadata.java.patch b/patches/net/minecraft/src/Packet40EntityMetadata.java.patch new file mode 100644 index 0000000..70b3c58 --- /dev/null +++ b/patches/net/minecraft/src/Packet40EntityMetadata.java.patch @@ -0,0 +1,82 @@ +--- net/minecraft/src/Packet40EntityMetadata.java ++++ net/minecraft/src/Packet40EntityMetadata.java +@@ -7,40 +7,51 @@ + + public class Packet40EntityMetadata extends Packet { + public int entityId; +- private List b; +- +- public Packet40EntityMetadata() { +- } +- +- public Packet40EntityMetadata(int var1, DataWatcher var2, boolean var3) { +- this.entityId = var1; +- if(var3) { +- this.b = var2.getAllWatched(); ++ private List metadata; ++ ++ public Packet40EntityMetadata() {} ++ ++ public Packet40EntityMetadata(int par1, DataWatcher par2DataWatcher, boolean par3) { ++ this.entityId = par1; ++ ++ if (par3) { ++ this.metadata = par2DataWatcher.getAllWatched(); + } else { +- this.b = var2.unwatchAndReturnAllWatched(); ++ this.metadata = par2DataWatcher.unwatchAndReturnAllWatched(); + } +- +- } +- +- public void readPacketData(DataInput var1) throws IOException { +- this.entityId = var1.readInt(); +- this.b = DataWatcher.readWatchableObjects(var1); +- } +- +- public void writePacketData(DataOutput var1) throws IOException { +- var1.writeInt(this.entityId); +- DataWatcher.writeObjectsInListToStream(this.b, var1); +- } +- +- public void processPacket(NetHandler var1) { +- var1.handleEntityMetadata(this); +- } +- ++ } ++ ++ /** ++ * Abstract. Reads the raw packet data from the data stream. ++ */ ++ public void readPacketData(DataInput par1DataInput) throws IOException { ++ this.entityId = par1DataInput.readInt(); ++ this.metadata = DataWatcher.readWatchableObjects(par1DataInput); ++ } ++ ++ /** ++ * Abstract. Writes the raw packet data to the data stream. ++ */ ++ public void writePacketData(DataOutput par1DataOutput) throws IOException { ++ par1DataOutput.writeInt(this.entityId); ++ DataWatcher.writeObjectsInListToStream(this.metadata, par1DataOutput); ++ } ++ ++ /** ++ * Passes this Packet on to the NetHandler for processing. ++ */ ++ public void processPacket(NetHandler par1NetHandler) { ++ par1NetHandler.handleEntityMetadata(this); ++ } ++ ++ /** ++ * Abstract. Return the size of the packet (not counting the header). ++ */ + public int getPacketSize() { + return 5; + } + + public List getMetadata() { +- return this.b; ++ return this.metadata; + } + } diff --git a/patches/net/minecraft/src/Packet41EntityEffect.java.patch b/patches/net/minecraft/src/Packet41EntityEffect.java.patch new file mode 100644 index 0000000..ad05875 --- /dev/null +++ b/patches/net/minecraft/src/Packet41EntityEffect.java.patch @@ -0,0 +1,118 @@ +--- net/minecraft/src/Packet41EntityEffect.java ++++ net/minecraft/src/Packet41EntityEffect.java +@@ -7,56 +7,79 @@ + public class Packet41EntityEffect extends Packet { + public int entityId; + public byte effectId; ++ ++ /** The effect's amplifier. */ + public byte effectAmplifier; + public short duration; + +- public Packet41EntityEffect() { +- } +- +- public Packet41EntityEffect(int var1, PotionEffect var2) { +- this.entityId = var1; +- this.effectId = (byte)(var2.getPotionID() & 255); +- this.effectAmplifier = (byte)(var2.getAmplifier() & 255); +- if(var2.getDuration() > Short.MAX_VALUE) { +- this.duration = Short.MAX_VALUE; ++ public Packet41EntityEffect() {} ++ ++ public Packet41EntityEffect(int par1, PotionEffect par2PotionEffect) { ++ this.entityId = par1; ++ this.effectId = (byte)(par2PotionEffect.getPotionID() & 255); ++ this.effectAmplifier = (byte)(par2PotionEffect.getAmplifier() & 255); ++ ++ if (par2PotionEffect.getDuration() > 32767) { ++ this.duration = 32767; + } else { +- this.duration = (short)var2.getDuration(); ++ this.duration = (short)par2PotionEffect.getDuration(); + } +- +- } +- +- public void readPacketData(DataInput var1) throws IOException { +- this.entityId = var1.readInt(); +- this.effectId = var1.readByte(); +- this.effectAmplifier = var1.readByte(); +- this.duration = var1.readShort(); +- } +- +- public void writePacketData(DataOutput var1) throws IOException { +- var1.writeInt(this.entityId); +- var1.writeByte(this.effectId); +- var1.writeByte(this.effectAmplifier); +- var1.writeShort(this.duration); +- } +- ++ } ++ ++ /** ++ * Abstract. Reads the raw packet data from the data stream. ++ */ ++ public void readPacketData(DataInput par1DataInput) throws IOException { ++ this.entityId = par1DataInput.readInt(); ++ this.effectId = par1DataInput.readByte(); ++ this.effectAmplifier = par1DataInput.readByte(); ++ this.duration = par1DataInput.readShort(); ++ } ++ ++ /** ++ * Abstract. Writes the raw packet data to the data stream. ++ */ ++ public void writePacketData(DataOutput par1DataOutput) throws IOException { ++ par1DataOutput.writeInt(this.entityId); ++ par1DataOutput.writeByte(this.effectId); ++ par1DataOutput.writeByte(this.effectAmplifier); ++ par1DataOutput.writeShort(this.duration); ++ } ++ ++ /** ++ * Returns true if duration is at maximum, false otherwise. ++ */ + public boolean isDurationMax() { +- return this.duration == Short.MAX_VALUE; +- } +- +- public void processPacket(NetHandler var1) { +- var1.handleEntityEffect(this); +- } +- ++ return this.duration == 32767; ++ } ++ ++ /** ++ * Passes this Packet on to the NetHandler for processing. ++ */ ++ public void processPacket(NetHandler par1NetHandler) { ++ par1NetHandler.handleEntityEffect(this); ++ } ++ ++ /** ++ * Abstract. Return the size of the packet (not counting the header). ++ */ + public int getPacketSize() { + return 8; + } + ++ /** ++ * only false for the abstract Packet class, all real packets return true ++ */ + public boolean isRealPacket() { + return true; + } + +- public boolean containsSameEntityIDAs(Packet var1) { +- Packet41EntityEffect var2 = (Packet41EntityEffect)var1; ++ /** ++ * eg return packet30entity.entityId == entityId; WARNING : will throw if you compare a packet to a different packet ++ * class ++ */ ++ public boolean containsSameEntityIDAs(Packet par1Packet) { ++ Packet41EntityEffect var2 = (Packet41EntityEffect)par1Packet; + return var2.entityId == this.entityId && var2.effectId == this.effectId; + } + } diff --git a/patches/net/minecraft/src/Packet42RemoveEntityEffect.java.patch b/patches/net/minecraft/src/Packet42RemoveEntityEffect.java.patch new file mode 100644 index 0000000..8186abb --- /dev/null +++ b/patches/net/minecraft/src/Packet42RemoveEntityEffect.java.patch @@ -0,0 +1,71 @@ +--- net/minecraft/src/Packet42RemoveEntityEffect.java ++++ net/minecraft/src/Packet42RemoveEntityEffect.java +@@ -5,31 +5,46 @@ + import java.io.IOException; + + public class Packet42RemoveEntityEffect extends Packet { ++ ++ /** The ID of the entity which an effect is being removed from. */ + public int entityId; ++ ++ /** The ID of the effect which is being removed from an entity. */ + public byte effectId; + +- public Packet42RemoveEntityEffect() { +- } +- +- public Packet42RemoveEntityEffect(int var1, PotionEffect var2) { +- this.entityId = var1; +- this.effectId = (byte)(var2.getPotionID() & 255); +- } +- +- public void readPacketData(DataInput var1) throws IOException { +- this.entityId = var1.readInt(); +- this.effectId = var1.readByte(); +- } +- +- public void writePacketData(DataOutput var1) throws IOException { +- var1.writeInt(this.entityId); +- var1.writeByte(this.effectId); +- } +- +- public void processPacket(NetHandler var1) { +- var1.handleRemoveEntityEffect(this); +- } +- ++ public Packet42RemoveEntityEffect() {} ++ ++ public Packet42RemoveEntityEffect(int par1, PotionEffect par2PotionEffect) { ++ this.entityId = par1; ++ this.effectId = (byte)(par2PotionEffect.getPotionID() & 255); ++ } ++ ++ /** ++ * Abstract. Reads the raw packet data from the data stream. ++ */ ++ public void readPacketData(DataInput par1DataInput) throws IOException { ++ this.entityId = par1DataInput.readInt(); ++ this.effectId = par1DataInput.readByte(); ++ } ++ ++ /** ++ * Abstract. Writes the raw packet data to the data stream. ++ */ ++ public void writePacketData(DataOutput par1DataOutput) throws IOException { ++ par1DataOutput.writeInt(this.entityId); ++ par1DataOutput.writeByte(this.effectId); ++ } ++ ++ /** ++ * Passes this Packet on to the NetHandler for processing. ++ */ ++ public void processPacket(NetHandler par1NetHandler) { ++ par1NetHandler.handleRemoveEntityEffect(this); ++ } ++ ++ /** ++ * Abstract. Return the size of the packet (not counting the header). ++ */ + public int getPacketSize() { + return 5; + } diff --git a/patches/net/minecraft/src/Packet43Experience.java.patch b/patches/net/minecraft/src/Packet43Experience.java.patch new file mode 100644 index 0000000..a4d6ac7 --- /dev/null +++ b/patches/net/minecraft/src/Packet43Experience.java.patch @@ -0,0 +1,97 @@ +--- net/minecraft/src/Packet43Experience.java ++++ net/minecraft/src/Packet43Experience.java +@@ -5,44 +5,68 @@ + import java.io.IOException; + + public class Packet43Experience extends Packet { ++ ++ /** The current experience bar points. */ + public float experience; ++ ++ /** The total experience points. */ + public int experienceTotal; ++ ++ /** The experience level. */ + public int experienceLevel; + +- public Packet43Experience() { +- } +- +- public Packet43Experience(float var1, int var2, int var3) { +- this.experience = var1; +- this.experienceTotal = var2; +- this.experienceLevel = var3; +- } +- +- public void readPacketData(DataInput var1) throws IOException { +- this.experience = var1.readFloat(); +- this.experienceLevel = var1.readShort(); +- this.experienceTotal = var1.readShort(); +- } +- +- public void writePacketData(DataOutput var1) throws IOException { +- var1.writeFloat(this.experience); +- var1.writeShort(this.experienceLevel); +- var1.writeShort(this.experienceTotal); +- } +- +- public void processPacket(NetHandler var1) { +- var1.handleExperience(this); +- } +- ++ public Packet43Experience() {} ++ ++ public Packet43Experience(float par1, int par2, int par3) { ++ this.experience = par1; ++ this.experienceTotal = par2; ++ this.experienceLevel = par3; ++ } ++ ++ /** ++ * Abstract. Reads the raw packet data from the data stream. ++ */ ++ public void readPacketData(DataInput par1DataInput) throws IOException { ++ this.experience = par1DataInput.readFloat(); ++ this.experienceLevel = par1DataInput.readShort(); ++ this.experienceTotal = par1DataInput.readShort(); ++ } ++ ++ /** ++ * Abstract. Writes the raw packet data to the data stream. ++ */ ++ public void writePacketData(DataOutput par1DataOutput) throws IOException { ++ par1DataOutput.writeFloat(this.experience); ++ par1DataOutput.writeShort(this.experienceLevel); ++ par1DataOutput.writeShort(this.experienceTotal); ++ } ++ ++ /** ++ * Passes this Packet on to the NetHandler for processing. ++ */ ++ public void processPacket(NetHandler par1NetHandler) { ++ par1NetHandler.handleExperience(this); ++ } ++ ++ /** ++ * Abstract. Return the size of the packet (not counting the header). ++ */ + public int getPacketSize() { + return 4; + } + ++ /** ++ * only false for the abstract Packet class, all real packets return true ++ */ + public boolean isRealPacket() { + return true; + } + +- public boolean containsSameEntityIDAs(Packet var1) { ++ /** ++ * eg return packet30entity.entityId == entityId; WARNING : will throw if you compare a packet to a different packet ++ * class ++ */ ++ public boolean containsSameEntityIDAs(Packet par1Packet) { + return true; + } + } diff --git a/patches/net/minecraft/src/Packet44UpdateAttributes.java.patch b/patches/net/minecraft/src/Packet44UpdateAttributes.java.patch new file mode 100644 index 0000000..f3ef3d3 --- /dev/null +++ b/patches/net/minecraft/src/Packet44UpdateAttributes.java.patch @@ -0,0 +1,135 @@ +--- net/minecraft/src/Packet44UpdateAttributes.java ++++ net/minecraft/src/Packet44UpdateAttributes.java +@@ -11,71 +11,79 @@ + + public class Packet44UpdateAttributes extends Packet { + private int field_111005_a; +- private final List b = new ArrayList(); +- +- public Packet44UpdateAttributes() { +- } +- +- public Packet44UpdateAttributes(int var1, Collection var2) { +- this.field_111005_a = var1; +- Iterator var3 = var2.iterator(); +- +- while(var3.hasNext()) { ++ private final List field_111004_b = new ArrayList(); ++ ++ public Packet44UpdateAttributes() {} ++ ++ public Packet44UpdateAttributes(int par1, Collection par2Collection) { ++ this.field_111005_a = par1; ++ Iterator var3 = par2Collection.iterator(); ++ ++ while (var3.hasNext()) { + AttributeInstance var4 = (AttributeInstance)var3.next(); +- this.b.add(new Packet44UpdateAttributesSnapshot(this, var4.func_111123_a().getAttributeUnlocalizedName(), var4.getBaseValue(), var4.func_111122_c())); ++ this.field_111004_b.add(new Packet44UpdateAttributesSnapshot(this, var4.func_111123_a().getAttributeUnlocalizedName(), var4.getBaseValue(), var4.func_111122_c())); + } +- + } + +- public void readPacketData(DataInput var1) throws IOException { +- this.field_111005_a = var1.readInt(); +- int var2 = var1.readInt(); ++ /** ++ * Abstract. Reads the raw packet data from the data stream. ++ */ ++ public void readPacketData(DataInput par1DataInput) throws IOException { ++ this.field_111005_a = par1DataInput.readInt(); ++ int var2 = par1DataInput.readInt(); + +- for(int var3 = 0; var3 < var2; ++var3) { +- String var4 = readString(var1, 64); +- double var5 = var1.readDouble(); ++ for (int var3 = 0; var3 < var2; ++var3) { ++ String var4 = readString(par1DataInput, 64); ++ double var5 = par1DataInput.readDouble(); + ArrayList var7 = new ArrayList(); +- short var8 = var1.readShort(); ++ short var8 = par1DataInput.readShort(); + +- for(int var9 = 0; var9 < var8; ++var9) { +- UUID var10 = new UUID(var1.readLong(), var1.readLong()); +- var7.add(new AttributeModifier(var10, "Unknown synced attribute modifier", var1.readDouble(), var1.readByte())); ++ for (int var9 = 0; var9 < var8; ++var9) { ++ UUID var10 = new UUID(par1DataInput.readLong(), par1DataInput.readLong()); ++ var7.add(new AttributeModifier(var10, "Unknown synced attribute modifier", par1DataInput.readDouble(), par1DataInput.readByte())); + } + +- this.b.add(new Packet44UpdateAttributesSnapshot(this, var4, var5, var7)); ++ this.field_111004_b.add(new Packet44UpdateAttributesSnapshot(this, var4, var5, var7)); + } +- + } + +- public void writePacketData(DataOutput var1) throws IOException { +- var1.writeInt(this.field_111005_a); +- var1.writeInt(this.b.size()); +- Iterator var2 = this.b.iterator(); ++ /** ++ * Abstract. Writes the raw packet data to the data stream. ++ */ ++ public void writePacketData(DataOutput par1DataOutput) throws IOException { ++ par1DataOutput.writeInt(this.field_111005_a); ++ par1DataOutput.writeInt(this.field_111004_b.size()); ++ Iterator var2 = this.field_111004_b.iterator(); + +- while(var2.hasNext()) { ++ while (var2.hasNext()) { + Packet44UpdateAttributesSnapshot var3 = (Packet44UpdateAttributesSnapshot)var2.next(); +- writeString(var3.func_142040_a(), var1); +- var1.writeDouble(var3.func_142041_b()); +- var1.writeShort(var3.func_142039_c().size()); ++ writeString(var3.func_142040_a(), par1DataOutput); ++ par1DataOutput.writeDouble(var3.func_142041_b()); ++ par1DataOutput.writeShort(var3.func_142039_c().size()); + Iterator var4 = var3.func_142039_c().iterator(); + +- while(var4.hasNext()) { ++ while (var4.hasNext()) { + AttributeModifier var5 = (AttributeModifier)var4.next(); +- var1.writeLong(var5.getID().getMostSignificantBits()); +- var1.writeLong(var5.getID().getLeastSignificantBits()); +- var1.writeDouble(var5.getAmount()); +- var1.writeByte(var5.getOperation()); ++ par1DataOutput.writeLong(var5.getID().getMostSignificantBits()); ++ par1DataOutput.writeLong(var5.getID().getLeastSignificantBits()); ++ par1DataOutput.writeDouble(var5.getAmount()); ++ par1DataOutput.writeByte(var5.getOperation()); + } + } +- +- } +- +- public void processPacket(NetHandler var1) { +- var1.func_110773_a(this); +- } +- ++ } ++ ++ /** ++ * Passes this Packet on to the NetHandler for processing. ++ */ ++ public void processPacket(NetHandler par1NetHandler) { ++ par1NetHandler.func_110773_a(this); ++ } ++ ++ /** ++ * Abstract. Return the size of the packet (not counting the header). ++ */ + public int getPacketSize() { +- return 8 + this.b.size() * 24; ++ return 8 + this.field_111004_b.size() * 24; + } + + public int func_111002_d() { +@@ -83,6 +91,6 @@ + } + + public List func_111003_f() { +- return this.b; ++ return this.field_111004_b; + } + } diff --git a/patches/net/minecraft/src/Packet44UpdateAttributesSnapshot.java.patch b/patches/net/minecraft/src/Packet44UpdateAttributesSnapshot.java.patch new file mode 100644 index 0000000..ed1fb29 --- /dev/null +++ b/patches/net/minecraft/src/Packet44UpdateAttributesSnapshot.java.patch @@ -0,0 +1,40 @@ +--- net/minecraft/src/Packet44UpdateAttributesSnapshot.java ++++ net/minecraft/src/Packet44UpdateAttributesSnapshot.java +@@ -3,20 +3,21 @@ + import java.util.Collection; + + public class Packet44UpdateAttributesSnapshot { +- private final String b; ++ private final String field_142043_b; + private final double field_142044_c; +- private final Collection d; ++ private final Collection field_142042_d; ++ + final Packet44UpdateAttributes field_142045_a; + +- public Packet44UpdateAttributesSnapshot(Packet44UpdateAttributes var1, String var2, double var3, Collection var5) { +- this.field_142045_a = var1; +- this.b = var2; +- this.field_142044_c = var3; +- this.d = var5; ++ public Packet44UpdateAttributesSnapshot(Packet44UpdateAttributes par1Packet44UpdateAttributes, String par2Str, double par3, Collection par5Collection) { ++ this.field_142045_a = par1Packet44UpdateAttributes; ++ this.field_142043_b = par2Str; ++ this.field_142044_c = par3; ++ this.field_142042_d = par5Collection; + } + + public String func_142040_a() { +- return this.b; ++ return this.field_142043_b; + } + + public double func_142041_b() { +@@ -24,6 +25,6 @@ + } + + public Collection func_142039_c() { +- return this.d; ++ return this.field_142042_d; + } + } diff --git a/patches/net/minecraft/src/Packet4UpdateTime.java.patch b/patches/net/minecraft/src/Packet4UpdateTime.java.patch new file mode 100644 index 0000000..8813b12 --- /dev/null +++ b/patches/net/minecraft/src/Packet4UpdateTime.java.patch @@ -0,0 +1,106 @@ +--- net/minecraft/src/Packet4UpdateTime.java ++++ net/minecraft/src/Packet4UpdateTime.java +@@ -5,50 +5,77 @@ + import java.io.IOException; + + public class Packet4UpdateTime extends Packet { ++ ++ /** World age in ticks. */ + public long worldAge; ++ ++ /** The world time in minutes. */ + public long time; + +- public Packet4UpdateTime() { +- } +- +- public Packet4UpdateTime(long var1, long var3, boolean var5) { +- this.worldAge = var1; +- this.time = var3; +- if(!var5) { ++ public Packet4UpdateTime() {} ++ ++ public Packet4UpdateTime(long par1, long par3, boolean par5) { ++ this.worldAge = par1; ++ this.time = par3; ++ ++ if (!par5) { + this.time = -this.time; +- if(this.time == 0L) { ++ ++ if (this.time == 0L) { + this.time = -1L; + } + } +- +- } +- +- public void readPacketData(DataInput var1) throws IOException { +- this.worldAge = var1.readLong(); +- this.time = var1.readLong(); +- } +- +- public void writePacketData(DataOutput var1) throws IOException { +- var1.writeLong(this.worldAge); +- var1.writeLong(this.time); +- } +- +- public void processPacket(NetHandler var1) { +- var1.handleUpdateTime(this); +- } +- ++ } ++ ++ /** ++ * Abstract. Reads the raw packet data from the data stream. ++ */ ++ public void readPacketData(DataInput par1DataInput) throws IOException { ++ this.worldAge = par1DataInput.readLong(); ++ this.time = par1DataInput.readLong(); ++ } ++ ++ /** ++ * Abstract. Writes the raw packet data to the data stream. ++ */ ++ public void writePacketData(DataOutput par1DataOutput) throws IOException { ++ par1DataOutput.writeLong(this.worldAge); ++ par1DataOutput.writeLong(this.time); ++ } ++ ++ /** ++ * Passes this Packet on to the NetHandler for processing. ++ */ ++ public void processPacket(NetHandler par1NetHandler) { ++ par1NetHandler.handleUpdateTime(this); ++ } ++ ++ /** ++ * Abstract. Return the size of the packet (not counting the header). ++ */ + public int getPacketSize() { + return 16; + } + ++ /** ++ * only false for the abstract Packet class, all real packets return true ++ */ + public boolean isRealPacket() { + return true; + } + +- public boolean containsSameEntityIDAs(Packet var1) { ++ /** ++ * eg return packet30entity.entityId == entityId; WARNING : will throw if you compare a packet to a different packet ++ * class ++ */ ++ public boolean containsSameEntityIDAs(Packet par1Packet) { + return true; + } + ++ /** ++ * If this returns true, the packet may be processed on any thread; otherwise it is queued for the main thread to ++ * handle. ++ */ + public boolean canProcessAsync() { + return true; + } diff --git a/patches/net/minecraft/src/Packet51MapChunk.java.patch b/patches/net/minecraft/src/Packet51MapChunk.java.patch new file mode 100644 index 0000000..4e3cb68 --- /dev/null +++ b/patches/net/minecraft/src/Packet51MapChunk.java.patch @@ -0,0 +1,262 @@ +--- net/minecraft/src/Packet51MapChunk.java ++++ net/minecraft/src/Packet51MapChunk.java +@@ -7,27 +7,54 @@ + import java.util.zip.Deflater; + import java.util.zip.Inflater; + ++import org.spoutcraft.client.SpoutClient; ++import org.spoutcraft.client.packet.PacketCustomBlockChunkOverride; ++ + public class Packet51MapChunk extends Packet { ++ ++ /** The x-position of the transmitted chunk, in chunk coordinates. */ + public int xCh; ++ ++ /** The z-position of the transmitted chunk, in chunk coordinates. */ + public int zCh; ++ ++ /** ++ * The y-position of the lowest chunk Section in the transmitted chunk, in chunk coordinates. ++ */ + public int yChMin; ++ ++ /** ++ * The y-position of the highest chunk Section in the transmitted chunk, in chunk coordinates. ++ */ + public int yChMax; ++ ++ /** The transmitted chunk data, decompressed. */ + private byte[] chunkData; ++ ++ /** The compressed chunk data */ + private byte[] compressedChunkData; ++ ++ /** ++ * Whether to initialize the Chunk before applying the effect of the Packet51MapChunk. ++ */ + public boolean includeInitialize; ++ ++ /** The length of the compressed chunk data byte array. */ + private int tempLength; ++ ++ /** A temporary storage for the compressed chunk data byte array. */ + private static byte[] temp = new byte[196864]; + + public Packet51MapChunk() { + this.isChunkDataPacket = true; + } + +- public Packet51MapChunk(Chunk var1, boolean var2, int var3) { ++ public Packet51MapChunk(Chunk par1Chunk, boolean par2, int par3) { + this.isChunkDataPacket = true; +- this.xCh = var1.xPosition; +- this.zCh = var1.zPosition; +- this.includeInitialize = var2; +- Packet51MapChunkData var4 = getMapChunkData(var1, var2, var3); ++ this.xCh = par1Chunk.xPosition; ++ this.zCh = par1Chunk.zPosition; ++ this.includeInitialize = par2; ++ Packet51MapChunkData var4 = getMapChunkData(par1Chunk, par2, par3); + Deflater var5 = new Deflater(-1); + this.yChMax = var4.chunkHasAddSectionFlag; + this.yChMin = var4.chunkExistFlag; +@@ -41,30 +68,36 @@ + } finally { + var5.end(); + } +- + } ++ // Spout Start ++ private static final byte[] inflateBuffer = new byte[196864]; ++ // Spout End ++ /** ++ * Abstract. Reads the raw packet data from the data stream. ++ */ ++ public void readPacketData(DataInput par1DataInput) throws IOException { ++ this.xCh = par1DataInput.readInt(); ++ this.zCh = par1DataInput.readInt(); ++ this.includeInitialize = par1DataInput.readBoolean(); ++ this.yChMin = par1DataInput.readShort(); ++ this.yChMax = par1DataInput.readShort(); ++ this.tempLength = par1DataInput.readInt(); + +- public void readPacketData(DataInput var1) throws IOException { +- this.xCh = var1.readInt(); +- this.zCh = var1.readInt(); +- this.includeInitialize = var1.readBoolean(); +- this.yChMin = var1.readShort(); +- this.yChMax = var1.readShort(); +- this.tempLength = var1.readInt(); +- if(temp.length < this.tempLength) { ++ if (temp.length < this.tempLength) { + temp = new byte[this.tempLength]; + } + +- var1.readFully(temp, 0, this.tempLength); ++ par1DataInput.readFully(temp, 0, this.tempLength); + int var2 = 0; +- + int var3; +- for(var3 = 0; var3 < 16; ++var3) { ++ ++ for (var3 = 0; var3 < 16; ++var3) { + var2 += this.yChMin >> var3 & 1; + } + + var3 = 12288 * var2; +- if(this.includeInitialize) { ++ ++ if (this.includeInitialize) { + var3 += 256; + } + +@@ -80,22 +113,33 @@ + var4.end(); + } + +- } +- +- public void writePacketData(DataOutput var1) throws IOException { +- var1.writeInt(this.xCh); +- var1.writeInt(this.zCh); +- var1.writeBoolean(this.includeInitialize); +- var1.writeShort((short)(this.yChMin & '\uffff')); +- var1.writeShort((short)(this.yChMax & '\uffff')); +- var1.writeInt(this.tempLength); +- var1.write(this.chunkData, 0, this.tempLength); +- } +- +- public void processPacket(NetHandler var1) { +- var1.handleMapChunk(this); +- } +- ++ SpoutClient.getInstance().getPacketManager().sendSpoutPacket(new PacketCustomBlockChunkOverride(xCh, zCh)); ++ // Spout End ++ } ++ ++ /** ++ * Abstract. Writes the raw packet data to the data stream. ++ */ ++ public void writePacketData(DataOutput par1DataOutput) throws IOException { ++ par1DataOutput.writeInt(this.xCh); ++ par1DataOutput.writeInt(this.zCh); ++ par1DataOutput.writeBoolean(this.includeInitialize); ++ par1DataOutput.writeShort((short)(this.yChMin & 65535)); ++ par1DataOutput.writeShort((short)(this.yChMax & 65535)); ++ par1DataOutput.writeInt(this.tempLength); ++ par1DataOutput.write(this.chunkData, 0, this.tempLength); ++ } ++ ++ /** ++ * Passes this Packet on to the NetHandler for processing. ++ */ ++ public void processPacket(NetHandler par1NetHandler) { ++ par1NetHandler.handleMapChunk(this); ++ } ++ ++ /** ++ * Abstract. Return the size of the packet (not counting the header). ++ */ + public int getPacketSize() { + return 17 + this.tempLength; + } +@@ -104,29 +148,32 @@ + return this.compressedChunkData; + } + +- public static Packet51MapChunkData getMapChunkData(Chunk var0, boolean var1, int var2) { ++ public static Packet51MapChunkData getMapChunkData(Chunk par0Chunk, boolean par1, int par2) { + int var3 = 0; +- ExtendedBlockStorage[] var4 = var0.getBlockStorageArray(); ++ ExtendedBlockStorage[] var4 = par0Chunk.getBlockStorageArray(); + int var5 = 0; + Packet51MapChunkData var6 = new Packet51MapChunkData(); + byte[] var7 = temp; +- if(var1) { +- var0.sendUpdates = true; ++ ++ if (par1) { ++ par0Chunk.sendUpdates = true; + } + + int var8; +- for(var8 = 0; var8 < var4.length; ++var8) { +- if(var4[var8] != null && (!var1 || !var4[var8].isEmpty()) && (var2 & 1 << var8) != 0) { ++ ++ for (var8 = 0; var8 < var4.length; ++var8) { ++ if (var4[var8] != null && (!par1 || !var4[var8].isEmpty()) && (par2 & 1 << var8) != 0) { + var6.chunkExistFlag |= 1 << var8; +- if(var4[var8].getBlockMSBArray() != null) { ++ ++ if (var4[var8].getBlockMSBArray() != null) { + var6.chunkHasAddSectionFlag |= 1 << var8; + ++var5; + } + } + } + +- for(var8 = 0; var8 < var4.length; ++var8) { +- if(var4[var8] != null && (!var1 || !var4[var8].isEmpty()) && (var2 & 1 << var8) != 0) { ++ for (var8 = 0; var8 < var4.length; ++var8) { ++ if (var4[var8] != null && (!par1 || !var4[var8].isEmpty()) && (par2 & 1 << var8) != 0) { + byte[] var9 = var4[var8].getBlockLSBArray(); + System.arraycopy(var9, 0, var7, var3, var9.length); + var3 += var9.length; +@@ -134,25 +181,26 @@ + } + + NibbleArray var10; +- for(var8 = 0; var8 < var4.length; ++var8) { +- if(var4[var8] != null && (!var1 || !var4[var8].isEmpty()) && (var2 & 1 << var8) != 0) { ++ ++ for (var8 = 0; var8 < var4.length; ++var8) { ++ if (var4[var8] != null && (!par1 || !var4[var8].isEmpty()) && (par2 & 1 << var8) != 0) { + var10 = var4[var8].getMetadataArray(); + System.arraycopy(var10.data, 0, var7, var3, var10.data.length); + var3 += var10.data.length; + } + } + +- for(var8 = 0; var8 < var4.length; ++var8) { +- if(var4[var8] != null && (!var1 || !var4[var8].isEmpty()) && (var2 & 1 << var8) != 0) { ++ for (var8 = 0; var8 < var4.length; ++var8) { ++ if (var4[var8] != null && (!par1 || !var4[var8].isEmpty()) && (par2 & 1 << var8) != 0) { + var10 = var4[var8].getBlocklightArray(); + System.arraycopy(var10.data, 0, var7, var3, var10.data.length); + var3 += var10.data.length; + } + } + +- if(!var0.worldObj.provider.hasNoSky) { +- for(var8 = 0; var8 < var4.length; ++var8) { +- if(var4[var8] != null && (!var1 || !var4[var8].isEmpty()) && (var2 & 1 << var8) != 0) { ++ if (!par0Chunk.worldObj.provider.hasNoSky) { ++ for (var8 = 0; var8 < var4.length; ++var8) { ++ if (var4[var8] != null && (!par1 || !var4[var8].isEmpty()) && (par2 & 1 << var8) != 0) { + var10 = var4[var8].getSkylightArray(); + System.arraycopy(var10.data, 0, var7, var3, var10.data.length); + var3 += var10.data.length; +@@ -160,9 +208,9 @@ + } + } + +- if(var5 > 0) { +- for(var8 = 0; var8 < var4.length; ++var8) { +- if(var4[var8] != null && (!var1 || !var4[var8].isEmpty()) && var4[var8].getBlockMSBArray() != null && (var2 & 1 << var8) != 0) { ++ if (var5 > 0) { ++ for (var8 = 0; var8 < var4.length; ++var8) { ++ if (var4[var8] != null && (!par1 || !var4[var8].isEmpty()) && var4[var8].getBlockMSBArray() != null && (par2 & 1 << var8) != 0) { + var10 = var4[var8].getBlockMSBArray(); + System.arraycopy(var10.data, 0, var7, var3, var10.data.length); + var3 += var10.data.length; +@@ -170,8 +218,8 @@ + } + } + +- if(var1) { +- byte[] var11 = var0.getBiomeArray(); ++ if (par1) { ++ byte[] var11 = par0Chunk.getBiomeArray(); + System.arraycopy(var11, 0, var7, var3, var11.length); + var3 += var11.length; + } diff --git a/patches/net/minecraft/src/Packet52MultiBlockChange.java.patch b/patches/net/minecraft/src/Packet52MultiBlockChange.java.patch new file mode 100644 index 0000000..a133ebf --- /dev/null +++ b/patches/net/minecraft/src/Packet52MultiBlockChange.java.patch @@ -0,0 +1,146 @@ +--- net/minecraft/src/Packet52MultiBlockChange.java ++++ net/minecraft/src/Packet52MultiBlockChange.java +@@ -7,9 +7,17 @@ + import java.io.IOException; + + public class Packet52MultiBlockChange extends Packet { ++ ++ /** Chunk X position. */ + public int xPosition; ++ ++ /** Chunk Z position. */ + public int zPosition; ++ ++ /** The metadata for each block changed. */ + public byte[] metadataArray; ++ ++ /** The size of the arrays. */ + public int size; + private static byte[] field_73449_e = new byte[0]; + +@@ -17,34 +25,36 @@ + this.isChunkDataPacket = true; + } + +- public Packet52MultiBlockChange(int var1, int var2, short[] var3, int var4, World var5) { ++ public Packet52MultiBlockChange(int par1, int par2, short[] par3ArrayOfShort, int par4, World par5World) { + this.isChunkDataPacket = true; +- this.xPosition = var1; +- this.zPosition = var2; +- this.size = var4; +- int var6 = 4 * var4; +- Chunk var7 = var5.getChunkFromChunkCoords(var1, var2); ++ this.xPosition = par1; ++ this.zPosition = par2; ++ this.size = par4; ++ int var6 = 4 * par4; ++ Chunk var7 = par5World.getChunkFromChunkCoords(par1, par2); + + try { +- if(var4 >= 64) { +- this.field_98193_m.logInfo("ChunkTilesUpdatePacket compress " + var4); +- if(field_73449_e.length < var6) { ++ if (par4 >= 64) { ++ this.field_98193_m.logInfo("ChunkTilesUpdatePacket compress " + par4); ++ ++ if (field_73449_e.length < var6) { + field_73449_e = new byte[var6]; + } + } else { + ByteArrayOutputStream var8 = new ByteArrayOutputStream(var6); + DataOutputStream var9 = new DataOutputStream(var8); + +- for(int var10 = 0; var10 < var4; ++var10) { +- int var11 = var3[var10] >> 12 & 15; +- int var12 = var3[var10] >> 8 & 15; +- int var13 = var3[var10] & 255; +- var9.writeShort(var3[var10]); ++ for (int var10 = 0; var10 < par4; ++var10) { ++ int var11 = par3ArrayOfShort[var10] >> 12 & 15; ++ int var12 = par3ArrayOfShort[var10] >> 8 & 15; ++ int var13 = par3ArrayOfShort[var10] & 255; ++ var9.writeShort(par3ArrayOfShort[var10]); + var9.writeShort((short)((var7.getBlockID(var11, var13, var12) & 4095) << 4 | var7.getBlockMetadata(var11, var13, var12) & 15)); + } + + this.metadataArray = var8.toByteArray(); +- if(this.metadataArray.length != var6) { ++ ++ if (this.metadataArray.length != var6) { + throw new RuntimeException("Expected length " + var6 + " doesn\'t match received length " + this.metadataArray.length); + } + } +@@ -52,38 +62,49 @@ + this.field_98193_m.logSevereException("Couldn\'t create chunk packet", var14); + this.metadataArray = null; + } +- + } + +- public void readPacketData(DataInput var1) throws IOException { +- this.xPosition = var1.readInt(); +- this.zPosition = var1.readInt(); +- this.size = var1.readShort() & '\uffff'; +- int var2 = var1.readInt(); +- if(var2 > 0) { ++ /** ++ * Abstract. Reads the raw packet data from the data stream. ++ */ ++ public void readPacketData(DataInput par1DataInput) throws IOException { ++ this.xPosition = par1DataInput.readInt(); ++ this.zPosition = par1DataInput.readInt(); ++ this.size = par1DataInput.readShort() & 65535; ++ int var2 = par1DataInput.readInt(); ++ ++ if (var2 > 0) { + this.metadataArray = new byte[var2]; +- var1.readFully(this.metadataArray); ++ par1DataInput.readFully(this.metadataArray); + } +- + } + +- public void writePacketData(DataOutput var1) throws IOException { +- var1.writeInt(this.xPosition); +- var1.writeInt(this.zPosition); +- var1.writeShort((short)this.size); +- if(this.metadataArray != null) { +- var1.writeInt(this.metadataArray.length); +- var1.write(this.metadataArray); ++ /** ++ * Abstract. Writes the raw packet data to the data stream. ++ */ ++ public void writePacketData(DataOutput par1DataOutput) throws IOException { ++ par1DataOutput.writeInt(this.xPosition); ++ par1DataOutput.writeInt(this.zPosition); ++ par1DataOutput.writeShort((short)this.size); ++ ++ if (this.metadataArray != null) { ++ par1DataOutput.writeInt(this.metadataArray.length); ++ par1DataOutput.write(this.metadataArray); + } else { +- var1.writeInt(0); ++ par1DataOutput.writeInt(0); + } +- +- } +- +- public void processPacket(NetHandler var1) { +- var1.handleMultiBlockChange(this); +- } +- ++ } ++ ++ /** ++ * Passes this Packet on to the NetHandler for processing. ++ */ ++ public void processPacket(NetHandler par1NetHandler) { ++ par1NetHandler.handleMultiBlockChange(this); ++ } ++ ++ /** ++ * Abstract. Return the size of the packet (not counting the header). ++ */ + public int getPacketSize() { + return 10 + this.size * 4; + } diff --git a/patches/net/minecraft/src/Packet53BlockChange.java.patch b/patches/net/minecraft/src/Packet53BlockChange.java.patch new file mode 100644 index 0000000..90b50ce --- /dev/null +++ b/patches/net/minecraft/src/Packet53BlockChange.java.patch @@ -0,0 +1,98 @@ +--- net/minecraft/src/Packet53BlockChange.java ++++ net/minecraft/src/Packet53BlockChange.java +@@ -5,45 +5,67 @@ + import java.io.IOException; + + public class Packet53BlockChange extends Packet { ++ ++ /** Block X position. */ + public int xPosition; ++ ++ /** Block Y position. */ + public int yPosition; ++ ++ /** Block Z position. */ + public int zPosition; ++ ++ /** The new block type for the block. */ + public int type; ++ ++ /** Metadata of the block. */ + public int metadata; + + public Packet53BlockChange() { + this.isChunkDataPacket = true; + } + +- public Packet53BlockChange(int var1, int var2, int var3, World var4) { ++ public Packet53BlockChange(int par1, int par2, int par3, World par4World) { + this.isChunkDataPacket = true; +- this.xPosition = var1; +- this.yPosition = var2; +- this.zPosition = var3; +- this.type = var4.getBlockId(var1, var2, var3); +- this.metadata = var4.getBlockMetadata(var1, var2, var3); +- } +- +- public void readPacketData(DataInput var1) throws IOException { +- this.xPosition = var1.readInt(); +- this.yPosition = var1.readUnsignedByte(); +- this.zPosition = var1.readInt(); +- this.type = var1.readShort(); +- this.metadata = var1.readUnsignedByte(); +- } +- +- public void writePacketData(DataOutput var1) throws IOException { +- var1.writeInt(this.xPosition); +- var1.write(this.yPosition); +- var1.writeInt(this.zPosition); +- var1.writeShort(this.type); +- var1.write(this.metadata); +- } +- +- public void processPacket(NetHandler var1) { +- var1.handleBlockChange(this); +- } +- ++ this.xPosition = par1; ++ this.yPosition = par2; ++ this.zPosition = par3; ++ this.type = par4World.getBlockId(par1, par2, par3); ++ this.metadata = par4World.getBlockMetadata(par1, par2, par3); ++ } ++ ++ /** ++ * Abstract. Reads the raw packet data from the data stream. ++ */ ++ public void readPacketData(DataInput par1DataInput) throws IOException { ++ this.xPosition = par1DataInput.readInt(); ++ this.yPosition = par1DataInput.readUnsignedByte(); ++ this.zPosition = par1DataInput.readInt(); ++ this.type = par1DataInput.readShort(); ++ this.metadata = par1DataInput.readUnsignedByte(); ++ } ++ ++ /** ++ * Abstract. Writes the raw packet data to the data stream. ++ */ ++ public void writePacketData(DataOutput par1DataOutput) throws IOException { ++ par1DataOutput.writeInt(this.xPosition); ++ par1DataOutput.write(this.yPosition); ++ par1DataOutput.writeInt(this.zPosition); ++ par1DataOutput.writeShort(this.type); ++ par1DataOutput.write(this.metadata); ++ } ++ ++ /** ++ * Passes this Packet on to the NetHandler for processing. ++ */ ++ public void processPacket(NetHandler par1NetHandler) { ++ par1NetHandler.handleBlockChange(this); ++ } ++ ++ /** ++ * Abstract. Return the size of the packet (not counting the header). ++ */ + public int getPacketSize() { + return 11; + } diff --git a/patches/net/minecraft/src/Packet54PlayNoteBlock.java.patch b/patches/net/minecraft/src/Packet54PlayNoteBlock.java.patch new file mode 100644 index 0000000..34180e3 --- /dev/null +++ b/patches/net/minecraft/src/Packet54PlayNoteBlock.java.patch @@ -0,0 +1,100 @@ +--- net/minecraft/src/Packet54PlayNoteBlock.java ++++ net/minecraft/src/Packet54PlayNoteBlock.java +@@ -8,44 +8,63 @@ + public int xLocation; + public int yLocation; + public int zLocation; ++ ++ /** 1=Double Bass, 2=Snare Drum, 3=Clicks / Sticks, 4=Bass Drum, 5=Harp */ + public int instrumentType; ++ ++ /** ++ * The pitch of the note (between 0-24 inclusive where 0 is the lowest and 24 is the highest). ++ */ + public int pitch; ++ ++ /** The block ID this action is set for. */ + public int blockId; + +- public Packet54PlayNoteBlock() { +- } +- +- public Packet54PlayNoteBlock(int var1, int var2, int var3, int var4, int var5, int var6) { +- this.xLocation = var1; +- this.yLocation = var2; +- this.zLocation = var3; +- this.instrumentType = var5; +- this.pitch = var6; +- this.blockId = var4; +- } +- +- public void readPacketData(DataInput var1) throws IOException { +- this.xLocation = var1.readInt(); +- this.yLocation = var1.readShort(); +- this.zLocation = var1.readInt(); +- this.instrumentType = var1.readUnsignedByte(); +- this.pitch = var1.readUnsignedByte(); +- this.blockId = var1.readShort() & 4095; +- } +- +- public void writePacketData(DataOutput var1) throws IOException { +- var1.writeInt(this.xLocation); +- var1.writeShort(this.yLocation); +- var1.writeInt(this.zLocation); +- var1.write(this.instrumentType); +- var1.write(this.pitch); +- var1.writeShort(this.blockId & 4095); +- } +- +- public void processPacket(NetHandler var1) { +- var1.handleBlockEvent(this); +- } +- ++ public Packet54PlayNoteBlock() {} ++ ++ public Packet54PlayNoteBlock(int par1, int par2, int par3, int par4, int par5, int par6) { ++ this.xLocation = par1; ++ this.yLocation = par2; ++ this.zLocation = par3; ++ this.instrumentType = par5; ++ this.pitch = par6; ++ this.blockId = par4; ++ } ++ ++ /** ++ * Abstract. Reads the raw packet data from the data stream. ++ */ ++ public void readPacketData(DataInput par1DataInput) throws IOException { ++ this.xLocation = par1DataInput.readInt(); ++ this.yLocation = par1DataInput.readShort(); ++ this.zLocation = par1DataInput.readInt(); ++ this.instrumentType = par1DataInput.readUnsignedByte(); ++ this.pitch = par1DataInput.readUnsignedByte(); ++ this.blockId = par1DataInput.readShort() & 4095; ++ } ++ ++ /** ++ * Abstract. Writes the raw packet data to the data stream. ++ */ ++ public void writePacketData(DataOutput par1DataOutput) throws IOException { ++ par1DataOutput.writeInt(this.xLocation); ++ par1DataOutput.writeShort(this.yLocation); ++ par1DataOutput.writeInt(this.zLocation); ++ par1DataOutput.write(this.instrumentType); ++ par1DataOutput.write(this.pitch); ++ par1DataOutput.writeShort(this.blockId & 4095); ++ } ++ ++ /** ++ * Passes this Packet on to the NetHandler for processing. ++ */ ++ public void processPacket(NetHandler par1NetHandler) { ++ par1NetHandler.handleBlockEvent(this); ++ } ++ ++ /** ++ * Abstract. Return the size of the packet (not counting the header). ++ */ + public int getPacketSize() { + return 14; + } diff --git a/patches/net/minecraft/src/Packet55BlockDestroy.java.patch b/patches/net/minecraft/src/Packet55BlockDestroy.java.patch new file mode 100644 index 0000000..f650838 --- /dev/null +++ b/patches/net/minecraft/src/Packet55BlockDestroy.java.patch @@ -0,0 +1,152 @@ +--- net/minecraft/src/Packet55BlockDestroy.java ++++ net/minecraft/src/Packet55BlockDestroy.java +@@ -5,73 +5,116 @@ + import java.io.IOException; + + public class Packet55BlockDestroy extends Packet { ++ ++ /** Entity breaking the block */ + private int entityId; ++ ++ /** X posiiton of the block */ + private int posX; ++ ++ /** Y position of the block */ + private int posY; ++ ++ /** Z position of the block */ + private int posZ; ++ ++ /** How far destroyed this block is */ + private int destroyedStage; + +- public Packet55BlockDestroy() { +- } +- +- public Packet55BlockDestroy(int var1, int var2, int var3, int var4, int var5) { +- this.entityId = var1; +- this.posX = var2; +- this.posY = var3; +- this.posZ = var4; +- this.destroyedStage = var5; +- } +- +- public void readPacketData(DataInput var1) throws IOException { +- this.entityId = var1.readInt(); +- this.posX = var1.readInt(); +- this.posY = var1.readInt(); +- this.posZ = var1.readInt(); +- this.destroyedStage = var1.readUnsignedByte(); +- } +- +- public void writePacketData(DataOutput var1) throws IOException { +- var1.writeInt(this.entityId); +- var1.writeInt(this.posX); +- var1.writeInt(this.posY); +- var1.writeInt(this.posZ); +- var1.write(this.destroyedStage); +- } +- +- public void processPacket(NetHandler var1) { +- var1.handleBlockDestroy(this); +- } +- ++ public Packet55BlockDestroy() {} ++ ++ public Packet55BlockDestroy(int par1, int par2, int par3, int par4, int par5) { ++ this.entityId = par1; ++ this.posX = par2; ++ this.posY = par3; ++ this.posZ = par4; ++ this.destroyedStage = par5; ++ } ++ ++ /** ++ * Abstract. Reads the raw packet data from the data stream. ++ */ ++ public void readPacketData(DataInput par1DataInput) throws IOException { ++ this.entityId = par1DataInput.readInt(); ++ this.posX = par1DataInput.readInt(); ++ this.posY = par1DataInput.readInt(); ++ this.posZ = par1DataInput.readInt(); ++ this.destroyedStage = par1DataInput.readUnsignedByte(); ++ } ++ ++ /** ++ * Abstract. Writes the raw packet data to the data stream. ++ */ ++ public void writePacketData(DataOutput par1DataOutput) throws IOException { ++ par1DataOutput.writeInt(this.entityId); ++ par1DataOutput.writeInt(this.posX); ++ par1DataOutput.writeInt(this.posY); ++ par1DataOutput.writeInt(this.posZ); ++ par1DataOutput.write(this.destroyedStage); ++ } ++ ++ /** ++ * Passes this Packet on to the NetHandler for processing. ++ */ ++ public void processPacket(NetHandler par1NetHandler) { ++ par1NetHandler.handleBlockDestroy(this); ++ } ++ ++ /** ++ * Abstract. Return the size of the packet (not counting the header). ++ */ + public int getPacketSize() { + return 13; + } + ++ /** ++ * Gets the ID of the entity breaking the block ++ */ + public int getEntityId() { + return this.entityId; + } + ++ /** ++ * Gets the X position of the block ++ */ + public int getPosX() { + return this.posX; + } + ++ /** ++ * Gets the Y position of the block ++ */ + public int getPosY() { + return this.posY; + } + ++ /** ++ * Gets the Z position of the block ++ */ + public int getPosZ() { + return this.posZ; + } + ++ /** ++ * Gets how far destroyed this block is ++ */ + public int getDestroyedStage() { + return this.destroyedStage; + } + ++ /** ++ * only false for the abstract Packet class, all real packets return true ++ */ + public boolean isRealPacket() { + return true; + } + +- public boolean containsSameEntityIDAs(Packet var1) { +- Packet55BlockDestroy var2 = (Packet55BlockDestroy)var1; ++ /** ++ * eg return packet30entity.entityId == entityId; WARNING : will throw if you compare a packet to a different packet ++ * class ++ */ ++ public boolean containsSameEntityIDAs(Packet par1Packet) { ++ Packet55BlockDestroy var2 = (Packet55BlockDestroy)par1Packet; + return var2.entityId == this.entityId; + } + } diff --git a/patches/net/minecraft/src/Packet56MapChunks.java.patch b/patches/net/minecraft/src/Packet56MapChunks.java.patch new file mode 100644 index 0000000..47d3709 --- /dev/null +++ b/patches/net/minecraft/src/Packet56MapChunks.java.patch @@ -0,0 +1,194 @@ +--- net/minecraft/src/Packet56MapChunks.java ++++ net/minecraft/src/Packet56MapChunks.java +@@ -13,29 +13,38 @@ + private int[] chunkPosZ; + public int[] field_73590_a; + public int[] field_73588_b; ++ ++ /** The compressed chunk data buffer */ + private byte[] chunkDataBuffer; + private byte[][] field_73584_f; ++ ++ /** total size of the compressed data */ + private int dataLength; ++ ++ /** ++ * Whether or not the chunk data contains a light nibble array. This is true in the main world, false in the end + ++ * nether. ++ */ + private boolean skyLightSent; + private static byte[] chunkDataNotCompressed = new byte[0]; + +- public Packet56MapChunks() { +- } ++ public Packet56MapChunks() {} + +- public Packet56MapChunks(List var1) { +- int var2 = var1.size(); ++ public Packet56MapChunks(List par1List) { ++ int var2 = par1List.size(); + this.chunkPostX = new int[var2]; + this.chunkPosZ = new int[var2]; + this.field_73590_a = new int[var2]; + this.field_73588_b = new int[var2]; + this.field_73584_f = new byte[var2][]; +- this.skyLightSent = !var1.isEmpty() && !((Chunk)var1.get(0)).worldObj.provider.hasNoSky; ++ this.skyLightSent = !par1List.isEmpty() && !((Chunk)par1List.get(0)).worldObj.provider.hasNoSky; + int var3 = 0; + +- for(int var4 = 0; var4 < var2; ++var4) { +- Chunk var5 = (Chunk)var1.get(var4); +- Packet51MapChunkData var6 = Packet51MapChunk.getMapChunkData(var5, true, '\uffff'); +- if(chunkDataNotCompressed.length < var3 + var6.compressedData.length) { ++ for (int var4 = 0; var4 < var2; ++var4) { ++ Chunk var5 = (Chunk)par1List.get(var4); ++ Packet51MapChunkData var6 = Packet51MapChunk.getMapChunkData(var5, true, 65535); ++ ++ if (chunkDataNotCompressed.length < var3 + var6.compressedData.length) { + byte[] var7 = new byte[var3 + var6.compressedData.length]; + System.arraycopy(chunkDataNotCompressed, 0, var7, 0, chunkDataNotCompressed.length); + chunkDataNotCompressed = var7; +@@ -60,23 +69,26 @@ + } finally { + var11.end(); + } +- + } + +- public void readPacketData(DataInput var1) throws IOException { +- short var2 = var1.readShort(); +- this.dataLength = var1.readInt(); +- this.skyLightSent = var1.readBoolean(); ++ /** ++ * Abstract. Reads the raw packet data from the data stream. ++ */ ++ public void readPacketData(DataInput par1DataInput) throws IOException { ++ short var2 = par1DataInput.readShort(); ++ this.dataLength = par1DataInput.readInt(); ++ this.skyLightSent = par1DataInput.readBoolean(); + this.chunkPostX = new int[var2]; + this.chunkPosZ = new int[var2]; + this.field_73590_a = new int[var2]; + this.field_73588_b = new int[var2]; + this.field_73584_f = new byte[var2][]; +- if(chunkDataNotCompressed.length < this.dataLength) { ++ ++ if (chunkDataNotCompressed.length < this.dataLength) { + chunkDataNotCompressed = new byte[this.dataLength]; + } + +- var1.readFully(chunkDataNotCompressed, 0, this.dataLength); ++ par1DataInput.readFully(chunkDataNotCompressed, 0, this.dataLength); + byte[] var3 = new byte[196864 * var2]; + Inflater var4 = new Inflater(); + var4.setInput(chunkDataNotCompressed, 0, this.dataLength); +@@ -91,23 +103,24 @@ + + int var5 = 0; + +- for(int var6 = 0; var6 < var2; ++var6) { +- this.chunkPostX[var6] = var1.readInt(); +- this.chunkPosZ[var6] = var1.readInt(); +- this.field_73590_a[var6] = var1.readShort(); +- this.field_73588_b[var6] = var1.readShort(); ++ for (int var6 = 0; var6 < var2; ++var6) { ++ this.chunkPostX[var6] = par1DataInput.readInt(); ++ this.chunkPosZ[var6] = par1DataInput.readInt(); ++ this.field_73590_a[var6] = par1DataInput.readShort(); ++ this.field_73588_b[var6] = par1DataInput.readShort(); + int var7 = 0; + int var8 = 0; +- + int var9; +- for(var9 = 0; var9 < 16; ++var9) { ++ ++ for (var9 = 0; var9 < 16; ++var9) { + var7 += this.field_73590_a[var6] >> var9 & 1; + var8 += this.field_73588_b[var6] >> var9 & 1; + } + + var9 = 2048 * 4 * var7 + 256; + var9 += 2048 * var8; +- if(this.skyLightSent) { ++ ++ if (this.skyLightSent) { + var9 += 2048 * var7; + } + +@@ -115,45 +128,52 @@ + System.arraycopy(var3, var5, this.field_73584_f[var6], 0, var9); + var5 += var9; + } +- + } + +- public void writePacketData(DataOutput var1) throws IOException { +- var1.writeShort(this.chunkPostX.length); +- var1.writeInt(this.dataLength); +- var1.writeBoolean(this.skyLightSent); +- var1.write(this.chunkDataBuffer, 0, this.dataLength); ++ /** ++ * Abstract. Writes the raw packet data to the data stream. ++ */ ++ public void writePacketData(DataOutput par1DataOutput) throws IOException { ++ par1DataOutput.writeShort(this.chunkPostX.length); ++ par1DataOutput.writeInt(this.dataLength); ++ par1DataOutput.writeBoolean(this.skyLightSent); ++ par1DataOutput.write(this.chunkDataBuffer, 0, this.dataLength); + +- for(int var2 = 0; var2 < this.chunkPostX.length; ++var2) { +- var1.writeInt(this.chunkPostX[var2]); +- var1.writeInt(this.chunkPosZ[var2]); +- var1.writeShort((short)(this.field_73590_a[var2] & '\uffff')); +- var1.writeShort((short)(this.field_73588_b[var2] & '\uffff')); ++ for (int var2 = 0; var2 < this.chunkPostX.length; ++var2) { ++ par1DataOutput.writeInt(this.chunkPostX[var2]); ++ par1DataOutput.writeInt(this.chunkPosZ[var2]); ++ par1DataOutput.writeShort((short)(this.field_73590_a[var2] & 65535)); ++ par1DataOutput.writeShort((short)(this.field_73588_b[var2] & 65535)); + } +- +- } +- +- public void processPacket(NetHandler var1) { +- var1.handleMapChunks(this); +- } +- ++ } ++ ++ /** ++ * Passes this Packet on to the NetHandler for processing. ++ */ ++ public void processPacket(NetHandler par1NetHandler) { ++ par1NetHandler.handleMapChunks(this); ++ } ++ ++ /** ++ * Abstract. Return the size of the packet (not counting the header). ++ */ + public int getPacketSize() { + return 6 + this.dataLength + 12 * this.getNumberOfChunkInPacket(); + } + +- public int getChunkPosX(int var1) { +- return this.chunkPostX[var1]; ++ public int getChunkPosX(int par1) { ++ return this.chunkPostX[par1]; + } + +- public int getChunkPosZ(int var1) { +- return this.chunkPosZ[var1]; ++ public int getChunkPosZ(int par1) { ++ return this.chunkPosZ[par1]; + } + + public int getNumberOfChunkInPacket() { + return this.chunkPostX.length; + } + +- public byte[] getChunkCompressedData(int var1) { +- return this.field_73584_f[var1]; ++ public byte[] getChunkCompressedData(int par1) { ++ return this.field_73584_f[par1]; + } + } diff --git a/patches/net/minecraft/src/Packet5PlayerInventory.java.patch b/patches/net/minecraft/src/Packet5PlayerInventory.java.patch new file mode 100644 index 0000000..bcad6c2 --- /dev/null +++ b/patches/net/minecraft/src/Packet5PlayerInventory.java.patch @@ -0,0 +1,106 @@ +--- net/minecraft/src/Packet5PlayerInventory.java ++++ net/minecraft/src/Packet5PlayerInventory.java +@@ -5,49 +5,76 @@ + import java.io.IOException; + + public class Packet5PlayerInventory extends Packet { ++ ++ /** Entity ID of the object. */ + public int entityID; ++ ++ /** Equipment slot: 0=held, 1-4=armor slot */ + public int slot; ++ ++ /** The item in the slot format (an ItemStack) */ + private ItemStack itemSlot; + +- public Packet5PlayerInventory() { +- } +- +- public Packet5PlayerInventory(int var1, int var2, ItemStack var3) { +- this.entityID = var1; +- this.slot = var2; +- this.itemSlot = var3 == null ? null : var3.copy(); +- } +- +- public void readPacketData(DataInput var1) throws IOException { +- this.entityID = var1.readInt(); +- this.slot = var1.readShort(); +- this.itemSlot = readItemStack(var1); +- } +- +- public void writePacketData(DataOutput var1) throws IOException { +- var1.writeInt(this.entityID); +- var1.writeShort(this.slot); +- writeItemStack(this.itemSlot, var1); +- } +- +- public void processPacket(NetHandler var1) { +- var1.handlePlayerInventory(this); +- } +- ++ public Packet5PlayerInventory() {} ++ ++ public Packet5PlayerInventory(int par1, int par2, ItemStack par3ItemStack) { ++ this.entityID = par1; ++ this.slot = par2; ++ this.itemSlot = par3ItemStack == null ? null : par3ItemStack.copy(); ++ } ++ ++ /** ++ * Abstract. Reads the raw packet data from the data stream. ++ */ ++ public void readPacketData(DataInput par1DataInput) throws IOException { ++ this.entityID = par1DataInput.readInt(); ++ this.slot = par1DataInput.readShort(); ++ this.itemSlot = readItemStack(par1DataInput); ++ } ++ ++ /** ++ * Abstract. Writes the raw packet data to the data stream. ++ */ ++ public void writePacketData(DataOutput par1DataOutput) throws IOException { ++ par1DataOutput.writeInt(this.entityID); ++ par1DataOutput.writeShort(this.slot); ++ writeItemStack(this.itemSlot, par1DataOutput); ++ } ++ ++ /** ++ * Passes this Packet on to the NetHandler for processing. ++ */ ++ public void processPacket(NetHandler par1NetHandler) { ++ par1NetHandler.handlePlayerInventory(this); ++ } ++ ++ /** ++ * Abstract. Return the size of the packet (not counting the header). ++ */ + public int getPacketSize() { + return 8; + } + ++ /** ++ * Gets the item in the slot format (an ItemStack) ++ */ + public ItemStack getItemSlot() { + return this.itemSlot; + } + ++ /** ++ * only false for the abstract Packet class, all real packets return true ++ */ + public boolean isRealPacket() { + return true; + } + +- public boolean containsSameEntityIDAs(Packet var1) { +- Packet5PlayerInventory var2 = (Packet5PlayerInventory)var1; ++ /** ++ * eg return packet30entity.entityId == entityId; WARNING : will throw if you compare a packet to a different packet ++ * class ++ */ ++ public boolean containsSameEntityIDAs(Packet par1Packet) { ++ Packet5PlayerInventory var2 = (Packet5PlayerInventory)par1Packet; + return var2.entityID == this.entityID && var2.slot == this.slot; + } + } diff --git a/patches/net/minecraft/src/Packet60Explosion.java.patch b/patches/net/minecraft/src/Packet60Explosion.java.patch new file mode 100644 index 0000000..84457ad --- /dev/null +++ b/patches/net/minecraft/src/Packet60Explosion.java.patch @@ -0,0 +1,173 @@ +--- net/minecraft/src/Packet60Explosion.java ++++ net/minecraft/src/Packet60Explosion.java +@@ -12,93 +12,119 @@ + public double explosionY; + public double explosionZ; + public float explosionSize; +- public List e; ++ public List chunkPositionRecords; ++ ++ /** X velocity of the player being pushed by the explosion */ + private float playerVelocityX; ++ ++ /** Y velocity of the player being pushed by the explosion */ + private float playerVelocityY; ++ ++ /** Z velocity of the player being pushed by the explosion */ + private float playerVelocityZ; + +- public Packet60Explosion() { +- } +- +- public Packet60Explosion(double var1, double var3, double var5, float var7, List var8, Vec3 var9) { +- this.explosionX = var1; +- this.explosionY = var3; +- this.explosionZ = var5; +- this.explosionSize = var7; +- this.e = new ArrayList(var8); +- if(var9 != null) { +- this.playerVelocityX = (float)var9.xCoord; +- this.playerVelocityY = (float)var9.yCoord; +- this.playerVelocityZ = (float)var9.zCoord; ++ public Packet60Explosion() {} ++ ++ public Packet60Explosion(double par1, double par3, double par5, float par7, List par8List, Vec3 par9Vec3) { ++ this.explosionX = par1; ++ this.explosionY = par3; ++ this.explosionZ = par5; ++ this.explosionSize = par7; ++ this.chunkPositionRecords = new ArrayList(par8List); ++ ++ if (par9Vec3 != null) { ++ this.playerVelocityX = (float)par9Vec3.xCoord; ++ this.playerVelocityY = (float)par9Vec3.yCoord; ++ this.playerVelocityZ = (float)par9Vec3.zCoord; + } +- + } + +- public void readPacketData(DataInput var1) throws IOException { +- this.explosionX = var1.readDouble(); +- this.explosionY = var1.readDouble(); +- this.explosionZ = var1.readDouble(); +- this.explosionSize = var1.readFloat(); +- int var2 = var1.readInt(); +- this.e = new ArrayList(var2); ++ /** ++ * Abstract. Reads the raw packet data from the data stream. ++ */ ++ public void readPacketData(DataInput par1DataInput) throws IOException { ++ this.explosionX = par1DataInput.readDouble(); ++ this.explosionY = par1DataInput.readDouble(); ++ this.explosionZ = par1DataInput.readDouble(); ++ this.explosionSize = par1DataInput.readFloat(); ++ int var2 = par1DataInput.readInt(); ++ this.chunkPositionRecords = new ArrayList(var2); + int var3 = (int)this.explosionX; + int var4 = (int)this.explosionY; + int var5 = (int)this.explosionZ; + +- for(int var6 = 0; var6 < var2; ++var6) { +- int var7 = var1.readByte() + var3; +- int var8 = var1.readByte() + var4; +- int var9 = var1.readByte() + var5; +- this.e.add(new ChunkPosition(var7, var8, var9)); ++ for (int var6 = 0; var6 < var2; ++var6) { ++ int var7 = par1DataInput.readByte() + var3; ++ int var8 = par1DataInput.readByte() + var4; ++ int var9 = par1DataInput.readByte() + var5; ++ this.chunkPositionRecords.add(new ChunkPosition(var7, var8, var9)); + } + +- this.playerVelocityX = var1.readFloat(); +- this.playerVelocityY = var1.readFloat(); +- this.playerVelocityZ = var1.readFloat(); ++ this.playerVelocityX = par1DataInput.readFloat(); ++ this.playerVelocityY = par1DataInput.readFloat(); ++ this.playerVelocityZ = par1DataInput.readFloat(); + } + +- public void writePacketData(DataOutput var1) throws IOException { +- var1.writeDouble(this.explosionX); +- var1.writeDouble(this.explosionY); +- var1.writeDouble(this.explosionZ); +- var1.writeFloat(this.explosionSize); +- var1.writeInt(this.e.size()); ++ /** ++ * Abstract. Writes the raw packet data to the data stream. ++ */ ++ public void writePacketData(DataOutput par1DataOutput) throws IOException { ++ par1DataOutput.writeDouble(this.explosionX); ++ par1DataOutput.writeDouble(this.explosionY); ++ par1DataOutput.writeDouble(this.explosionZ); ++ par1DataOutput.writeFloat(this.explosionSize); ++ par1DataOutput.writeInt(this.chunkPositionRecords.size()); + int var2 = (int)this.explosionX; + int var3 = (int)this.explosionY; + int var4 = (int)this.explosionZ; +- Iterator var5 = this.e.iterator(); ++ Iterator var5 = this.chunkPositionRecords.iterator(); + +- while(var5.hasNext()) { ++ while (var5.hasNext()) { + ChunkPosition var6 = (ChunkPosition)var5.next(); + int var7 = var6.x - var2; + int var8 = var6.y - var3; + int var9 = var6.z - var4; +- var1.writeByte(var7); +- var1.writeByte(var8); +- var1.writeByte(var9); ++ par1DataOutput.writeByte(var7); ++ par1DataOutput.writeByte(var8); ++ par1DataOutput.writeByte(var9); + } + +- var1.writeFloat(this.playerVelocityX); +- var1.writeFloat(this.playerVelocityY); +- var1.writeFloat(this.playerVelocityZ); +- } +- +- public void processPacket(NetHandler var1) { +- var1.handleExplosion(this); +- } +- ++ par1DataOutput.writeFloat(this.playerVelocityX); ++ par1DataOutput.writeFloat(this.playerVelocityY); ++ par1DataOutput.writeFloat(this.playerVelocityZ); ++ } ++ ++ /** ++ * Passes this Packet on to the NetHandler for processing. ++ */ ++ public void processPacket(NetHandler par1NetHandler) { ++ par1NetHandler.handleExplosion(this); ++ } ++ ++ /** ++ * Abstract. Return the size of the packet (not counting the header). ++ */ + public int getPacketSize() { +- return 32 + this.e.size() * 3 + 3; ++ return 32 + this.chunkPositionRecords.size() * 3 + 3; + } + ++ /** ++ * Gets the X velocity of the player being pushed by the explosion. ++ */ + public float getPlayerVelocityX() { + return this.playerVelocityX; + } + ++ /** ++ * Gets the Y velocity of the player being pushed by the explosion. ++ */ + public float getPlayerVelocityY() { + return this.playerVelocityY; + } + ++ /** ++ * Gets the Z velocity of the player being pushed by the explosion. ++ */ + public float getPlayerVelocityZ() { + return this.playerVelocityZ; + } diff --git a/patches/net/minecraft/src/Packet61DoorChange.java.patch b/patches/net/minecraft/src/Packet61DoorChange.java.patch new file mode 100644 index 0000000..36ce9d0 --- /dev/null +++ b/patches/net/minecraft/src/Packet61DoorChange.java.patch @@ -0,0 +1,88 @@ +--- net/minecraft/src/Packet61DoorChange.java ++++ net/minecraft/src/Packet61DoorChange.java +@@ -12,40 +12,51 @@ + public int posZ; + private boolean disableRelativeVolume; + +- public Packet61DoorChange() { +- } +- +- public Packet61DoorChange(int var1, int var2, int var3, int var4, int var5, boolean var6) { +- this.sfxID = var1; +- this.posX = var2; +- this.posY = var3; +- this.posZ = var4; +- this.auxData = var5; +- this.disableRelativeVolume = var6; +- } +- +- public void readPacketData(DataInput var1) throws IOException { +- this.sfxID = var1.readInt(); +- this.posX = var1.readInt(); +- this.posY = var1.readByte() & 255; +- this.posZ = var1.readInt(); +- this.auxData = var1.readInt(); +- this.disableRelativeVolume = var1.readBoolean(); +- } +- +- public void writePacketData(DataOutput var1) throws IOException { +- var1.writeInt(this.sfxID); +- var1.writeInt(this.posX); +- var1.writeByte(this.posY & 255); +- var1.writeInt(this.posZ); +- var1.writeInt(this.auxData); +- var1.writeBoolean(this.disableRelativeVolume); +- } +- +- public void processPacket(NetHandler var1) { +- var1.handleDoorChange(this); +- } +- ++ public Packet61DoorChange() {} ++ ++ public Packet61DoorChange(int par1, int par2, int par3, int par4, int par5, boolean par6) { ++ this.sfxID = par1; ++ this.posX = par2; ++ this.posY = par3; ++ this.posZ = par4; ++ this.auxData = par5; ++ this.disableRelativeVolume = par6; ++ } ++ ++ /** ++ * Abstract. Reads the raw packet data from the data stream. ++ */ ++ public void readPacketData(DataInput par1DataInput) throws IOException { ++ this.sfxID = par1DataInput.readInt(); ++ this.posX = par1DataInput.readInt(); ++ this.posY = par1DataInput.readByte() & 255; ++ this.posZ = par1DataInput.readInt(); ++ this.auxData = par1DataInput.readInt(); ++ this.disableRelativeVolume = par1DataInput.readBoolean(); ++ } ++ ++ /** ++ * Abstract. Writes the raw packet data to the data stream. ++ */ ++ public void writePacketData(DataOutput par1DataOutput) throws IOException { ++ par1DataOutput.writeInt(this.sfxID); ++ par1DataOutput.writeInt(this.posX); ++ par1DataOutput.writeByte(this.posY & 255); ++ par1DataOutput.writeInt(this.posZ); ++ par1DataOutput.writeInt(this.auxData); ++ par1DataOutput.writeBoolean(this.disableRelativeVolume); ++ } ++ ++ /** ++ * Passes this Packet on to the NetHandler for processing. ++ */ ++ public void processPacket(NetHandler par1NetHandler) { ++ par1NetHandler.handleDoorChange(this); ++ } ++ ++ /** ++ * Abstract. Return the size of the packet (not counting the header). ++ */ + public int getPacketSize() { + return 21; + } diff --git a/patches/net/minecraft/src/Packet62LevelSound.java.patch b/patches/net/minecraft/src/Packet62LevelSound.java.patch new file mode 100644 index 0000000..ed9c488 --- /dev/null +++ b/patches/net/minecraft/src/Packet62LevelSound.java.patch @@ -0,0 +1,132 @@ +--- net/minecraft/src/Packet62LevelSound.java ++++ net/minecraft/src/Packet62LevelSound.java +@@ -5,53 +5,70 @@ + import java.io.IOException; + + public class Packet62LevelSound extends Packet { +- private String a; ++ ++ /** e.g. step.grass */ ++ private String soundName; ++ ++ /** Effect X multiplied by 8 */ + private int effectX; ++ ++ /** Effect Y multiplied by 8 */ + private int effectY = Integer.MAX_VALUE; ++ ++ /** Effect Z multiplied by 8 */ + private int effectZ; ++ ++ /** 1 is 100%. Can be more. */ + private float volume; ++ ++ /** 63 is 100%. Can be more. */ + private int pitch; + +- public Packet62LevelSound() { +- } +- +- public Packet62LevelSound(String var1, double var2, double var4, double var6, float var8, float var9) { +- this.a = var1; +- this.effectX = (int)(var2 * 8.0D); +- this.effectY = (int)(var4 * 8.0D); +- this.effectZ = (int)(var6 * 8.0D); +- this.volume = var8; +- this.pitch = (int)(var9 * 63.0F); +- if(this.pitch < 0) { ++ public Packet62LevelSound() {} ++ ++ public Packet62LevelSound(String par1Str, double par2, double par4, double par6, float par8, float par9) { ++ this.soundName = par1Str; ++ this.effectX = (int)(par2 * 8.0D); ++ this.effectY = (int)(par4 * 8.0D); ++ this.effectZ = (int)(par6 * 8.0D); ++ this.volume = par8; ++ this.pitch = (int)(par9 * 63.0F); ++ ++ if (this.pitch < 0) { + this.pitch = 0; + } + +- if(this.pitch > 255) { ++ if (this.pitch > 255) { + this.pitch = 255; + } +- +- } +- +- public void readPacketData(DataInput var1) throws IOException { +- this.a = readString(var1, 256); +- this.effectX = var1.readInt(); +- this.effectY = var1.readInt(); +- this.effectZ = var1.readInt(); +- this.volume = var1.readFloat(); +- this.pitch = var1.readUnsignedByte(); +- } +- +- public void writePacketData(DataOutput var1) throws IOException { +- writeString(this.a, var1); +- var1.writeInt(this.effectX); +- var1.writeInt(this.effectY); +- var1.writeInt(this.effectZ); +- var1.writeFloat(this.volume); +- var1.writeByte(this.pitch); ++ } ++ ++ /** ++ * Abstract. Reads the raw packet data from the data stream. ++ */ ++ public void readPacketData(DataInput par1DataInput) throws IOException { ++ this.soundName = readString(par1DataInput, 256); ++ this.effectX = par1DataInput.readInt(); ++ this.effectY = par1DataInput.readInt(); ++ this.effectZ = par1DataInput.readInt(); ++ this.volume = par1DataInput.readFloat(); ++ this.pitch = par1DataInput.readUnsignedByte(); ++ } ++ ++ /** ++ * Abstract. Writes the raw packet data to the data stream. ++ */ ++ public void writePacketData(DataOutput par1DataOutput) throws IOException { ++ writeString(this.soundName, par1DataOutput); ++ par1DataOutput.writeInt(this.effectX); ++ par1DataOutput.writeInt(this.effectY); ++ par1DataOutput.writeInt(this.effectZ); ++ par1DataOutput.writeFloat(this.volume); ++ par1DataOutput.writeByte(this.pitch); + } + + public String getSoundName() { +- return this.a; ++ return this.soundName; + } + + public double getEffectX() { +@@ -70,14 +87,23 @@ + return this.volume; + } + ++ /** ++ * Gets the pitch divided by 63 (63 is 100%) ++ */ + public float getPitch() { + return (float)this.pitch / 63.0F; + } + +- public void processPacket(NetHandler var1) { +- var1.handleLevelSound(this); ++ /** ++ * Passes this Packet on to the NetHandler for processing. ++ */ ++ public void processPacket(NetHandler par1NetHandler) { ++ par1NetHandler.handleLevelSound(this); + } + ++ /** ++ * Abstract. Return the size of the packet (not counting the header). ++ */ + public int getPacketSize() { + return 24; + } diff --git a/patches/net/minecraft/src/Packet63WorldParticles.java.patch b/patches/net/minecraft/src/Packet63WorldParticles.java.patch new file mode 100644 index 0000000..fae2d6b --- /dev/null +++ b/patches/net/minecraft/src/Packet63WorldParticles.java.patch @@ -0,0 +1,169 @@ +--- net/minecraft/src/Packet63WorldParticles.java ++++ net/minecraft/src/Packet63WorldParticles.java +@@ -5,80 +5,142 @@ + import java.io.IOException; + + public class Packet63WorldParticles extends Packet { +- private String a; ++ ++ /** ++ * The name of the particle to create. A list can be found at https://gist.github.com/thinkofdeath/5110835 ++ */ ++ private String particleName; ++ ++ /** X position of the particle. */ + private float posX; ++ ++ /** Y position of the particle. */ + private float posY; ++ ++ /** Z position of the particle. */ + private float posZ; ++ ++ /** ++ * This is added to the X position after being multiplied by random.nextGaussian() ++ */ + private float offsetX; ++ ++ /** ++ * This is added to the Y position after being multiplied by random.nextGaussian() ++ */ + private float offsetY; ++ ++ /** ++ * This is added to the Z position after being multiplied by random.nextGaussian() ++ */ + private float offsetZ; ++ ++ /** The speed of each particle. */ + private float speed; ++ ++ /** The number of particles to create. */ + private int quantity; + +- public void readPacketData(DataInput var1) throws IOException { +- this.a = readString(var1, 64); +- this.posX = var1.readFloat(); +- this.posY = var1.readFloat(); +- this.posZ = var1.readFloat(); +- this.offsetX = var1.readFloat(); +- this.offsetY = var1.readFloat(); +- this.offsetZ = var1.readFloat(); +- this.speed = var1.readFloat(); +- this.quantity = var1.readInt(); ++ /** ++ * Abstract. Reads the raw packet data from the data stream. ++ */ ++ public void readPacketData(DataInput par1DataInput) throws IOException { ++ this.particleName = readString(par1DataInput, 64); ++ this.posX = par1DataInput.readFloat(); ++ this.posY = par1DataInput.readFloat(); ++ this.posZ = par1DataInput.readFloat(); ++ this.offsetX = par1DataInput.readFloat(); ++ this.offsetY = par1DataInput.readFloat(); ++ this.offsetZ = par1DataInput.readFloat(); ++ this.speed = par1DataInput.readFloat(); ++ this.quantity = par1DataInput.readInt(); + } + +- public void writePacketData(DataOutput var1) throws IOException { +- writeString(this.a, var1); +- var1.writeFloat(this.posX); +- var1.writeFloat(this.posY); +- var1.writeFloat(this.posZ); +- var1.writeFloat(this.offsetX); +- var1.writeFloat(this.offsetY); +- var1.writeFloat(this.offsetZ); +- var1.writeFloat(this.speed); +- var1.writeInt(this.quantity); ++ /** ++ * Abstract. Writes the raw packet data to the data stream. ++ */ ++ public void writePacketData(DataOutput par1DataOutput) throws IOException { ++ writeString(this.particleName, par1DataOutput); ++ par1DataOutput.writeFloat(this.posX); ++ par1DataOutput.writeFloat(this.posY); ++ par1DataOutput.writeFloat(this.posZ); ++ par1DataOutput.writeFloat(this.offsetX); ++ par1DataOutput.writeFloat(this.offsetY); ++ par1DataOutput.writeFloat(this.offsetZ); ++ par1DataOutput.writeFloat(this.speed); ++ par1DataOutput.writeInt(this.quantity); + } + + public String getParticleName() { +- return this.a; ++ return this.particleName; + } + ++ /** ++ * Gets the X position of the particle. ++ */ + public double getPositionX() { + return (double)this.posX; + } + ++ /** ++ * Gets the Y position of the particle. ++ */ + public double getPositionY() { + return (double)this.posY; + } + ++ /** ++ * Gets the Z position of the particle. ++ */ + public double getPositionZ() { + return (double)this.posZ; + } + ++ /** ++ * This is added to the X position after being multiplied by random.nextGaussian() ++ */ + public float getOffsetX() { + return this.offsetX; + } + ++ /** ++ * This is added to the Y position after being multiplied by random.nextGaussian() ++ */ + public float getOffsetY() { + return this.offsetY; + } + ++ /** ++ * This is added to the Z position after being multiplied by random.nextGaussian() ++ */ + public float getOffsetZ() { + return this.offsetZ; + } + ++ /** ++ * Gets the speed of the particles. ++ */ + public float getSpeed() { + return this.speed; + } + ++ /** ++ * Gets the number of particles to create. ++ */ + public int getQuantity() { + return this.quantity; + } + +- public void processPacket(NetHandler var1) { +- var1.handleWorldParticles(this); ++ /** ++ * Passes this Packet on to the NetHandler for processing. ++ */ ++ public void processPacket(NetHandler par1NetHandler) { ++ par1NetHandler.handleWorldParticles(this); + } + ++ /** ++ * Abstract. Return the size of the packet (not counting the header). ++ */ + public int getPacketSize() { + return 64; + } diff --git a/patches/net/minecraft/src/Packet6SpawnPosition.java.patch b/patches/net/minecraft/src/Packet6SpawnPosition.java.patch new file mode 100644 index 0000000..ff2b403 --- /dev/null +++ b/patches/net/minecraft/src/Packet6SpawnPosition.java.patch @@ -0,0 +1,104 @@ +--- net/minecraft/src/Packet6SpawnPosition.java ++++ net/minecraft/src/Packet6SpawnPosition.java +@@ -5,47 +5,75 @@ + import java.io.IOException; + + public class Packet6SpawnPosition extends Packet { ++ ++ /** X coordinate of spawn. */ + public int xPosition; ++ ++ /** Y coordinate of spawn. */ + public int yPosition; ++ ++ /** Z coordinate of spawn. */ + public int zPosition; + +- public Packet6SpawnPosition() { +- } +- +- public Packet6SpawnPosition(int var1, int var2, int var3) { +- this.xPosition = var1; +- this.yPosition = var2; +- this.zPosition = var3; +- } +- +- public void readPacketData(DataInput var1) throws IOException { +- this.xPosition = var1.readInt(); +- this.yPosition = var1.readInt(); +- this.zPosition = var1.readInt(); +- } +- +- public void writePacketData(DataOutput var1) throws IOException { +- var1.writeInt(this.xPosition); +- var1.writeInt(this.yPosition); +- var1.writeInt(this.zPosition); +- } +- +- public void processPacket(NetHandler var1) { +- var1.handleSpawnPosition(this); +- } +- ++ public Packet6SpawnPosition() {} ++ ++ public Packet6SpawnPosition(int par1, int par2, int par3) { ++ this.xPosition = par1; ++ this.yPosition = par2; ++ this.zPosition = par3; ++ } ++ ++ /** ++ * Abstract. Reads the raw packet data from the data stream. ++ */ ++ public void readPacketData(DataInput par1DataInput) throws IOException { ++ this.xPosition = par1DataInput.readInt(); ++ this.yPosition = par1DataInput.readInt(); ++ this.zPosition = par1DataInput.readInt(); ++ } ++ ++ /** ++ * Abstract. Writes the raw packet data to the data stream. ++ */ ++ public void writePacketData(DataOutput par1DataOutput) throws IOException { ++ par1DataOutput.writeInt(this.xPosition); ++ par1DataOutput.writeInt(this.yPosition); ++ par1DataOutput.writeInt(this.zPosition); ++ } ++ ++ /** ++ * Passes this Packet on to the NetHandler for processing. ++ */ ++ public void processPacket(NetHandler par1NetHandler) { ++ par1NetHandler.handleSpawnPosition(this); ++ } ++ ++ /** ++ * Abstract. Return the size of the packet (not counting the header). ++ */ + public int getPacketSize() { + return 12; + } + ++ /** ++ * only false for the abstract Packet class, all real packets return true ++ */ + public boolean isRealPacket() { + return true; + } + +- public boolean containsSameEntityIDAs(Packet var1) { ++ /** ++ * eg return packet30entity.entityId == entityId; WARNING : will throw if you compare a packet to a different packet ++ * class ++ */ ++ public boolean containsSameEntityIDAs(Packet par1Packet) { + return true; + } + ++ /** ++ * If this returns true, the packet may be processed on any thread; otherwise it is queued for the main thread to ++ * handle. ++ */ + public boolean canProcessAsync() { + return false; + } diff --git a/patches/net/minecraft/src/Packet70GameEvent.java.patch b/patches/net/minecraft/src/Packet70GameEvent.java.patch new file mode 100644 index 0000000..6ea8f78 --- /dev/null +++ b/patches/net/minecraft/src/Packet70GameEvent.java.patch @@ -0,0 +1,79 @@ +--- net/minecraft/src/Packet70GameEvent.java ++++ net/minecraft/src/Packet70GameEvent.java +@@ -5,32 +5,53 @@ + import java.io.IOException; + + public class Packet70GameEvent extends Packet { +- public static final String[] a = new String[]{"tile.bed.notValid", null, null, "gameMode.changed"}; ++ ++ /** ++ * The client prints clientMessage[eventType] to chat when this packet is received. ++ */ ++ public static final String[] clientMessage = new String[] {"tile.bed.notValid", null, null, "gameMode.changed"}; ++ ++ /** 0: Invalid bed, 1: Rain starts, 2: Rain stops, 3: Game mode changed. */ + public int eventType; ++ ++ /** ++ * When reason==3, the game mode to set. See EnumGameType for a list of values. ++ */ + public int gameMode; + +- public Packet70GameEvent() { +- } +- +- public Packet70GameEvent(int var1, int var2) { +- this.eventType = var1; +- this.gameMode = var2; +- } +- +- public void readPacketData(DataInput var1) throws IOException { +- this.eventType = var1.readByte(); +- this.gameMode = var1.readByte(); +- } +- +- public void writePacketData(DataOutput var1) throws IOException { +- var1.writeByte(this.eventType); +- var1.writeByte(this.gameMode); +- } +- +- public void processPacket(NetHandler var1) { +- var1.handleGameEvent(this); +- } +- ++ public Packet70GameEvent() {} ++ ++ public Packet70GameEvent(int par1, int par2) { ++ this.eventType = par1; ++ this.gameMode = par2; ++ } ++ ++ /** ++ * Abstract. Reads the raw packet data from the data stream. ++ */ ++ public void readPacketData(DataInput par1DataInput) throws IOException { ++ this.eventType = par1DataInput.readByte(); ++ this.gameMode = par1DataInput.readByte(); ++ } ++ ++ /** ++ * Abstract. Writes the raw packet data to the data stream. ++ */ ++ public void writePacketData(DataOutput par1DataOutput) throws IOException { ++ par1DataOutput.writeByte(this.eventType); ++ par1DataOutput.writeByte(this.gameMode); ++ } ++ ++ /** ++ * Passes this Packet on to the NetHandler for processing. ++ */ ++ public void processPacket(NetHandler par1NetHandler) { ++ par1NetHandler.handleGameEvent(this); ++ } ++ ++ /** ++ * Abstract. Return the size of the packet (not counting the header). ++ */ + public int getPacketSize() { + return 2; + } diff --git a/patches/net/minecraft/src/Packet71Weather.java.patch b/patches/net/minecraft/src/Packet71Weather.java.patch new file mode 100644 index 0000000..8204e42 --- /dev/null +++ b/patches/net/minecraft/src/Packet71Weather.java.patch @@ -0,0 +1,86 @@ +--- net/minecraft/src/Packet71Weather.java ++++ net/minecraft/src/Packet71Weather.java +@@ -11,40 +11,51 @@ + public int posZ; + public int isLightningBolt; + +- public Packet71Weather() { +- } +- +- public Packet71Weather(Entity var1) { +- this.entityID = var1.entityId; +- this.posX = MathHelper.floor_double(var1.posX * 32.0D); +- this.posY = MathHelper.floor_double(var1.posY * 32.0D); +- this.posZ = MathHelper.floor_double(var1.posZ * 32.0D); +- if(var1 instanceof EntityLightningBolt) { ++ public Packet71Weather() {} ++ ++ public Packet71Weather(Entity par1Entity) { ++ this.entityID = par1Entity.entityId; ++ this.posX = MathHelper.floor_double(par1Entity.posX * 32.0D); ++ this.posY = MathHelper.floor_double(par1Entity.posY * 32.0D); ++ this.posZ = MathHelper.floor_double(par1Entity.posZ * 32.0D); ++ ++ if (par1Entity instanceof EntityLightningBolt) { + this.isLightningBolt = 1; + } +- +- } +- +- public void readPacketData(DataInput var1) throws IOException { +- this.entityID = var1.readInt(); +- this.isLightningBolt = var1.readByte(); +- this.posX = var1.readInt(); +- this.posY = var1.readInt(); +- this.posZ = var1.readInt(); +- } +- +- public void writePacketData(DataOutput var1) throws IOException { +- var1.writeInt(this.entityID); +- var1.writeByte(this.isLightningBolt); +- var1.writeInt(this.posX); +- var1.writeInt(this.posY); +- var1.writeInt(this.posZ); +- } +- +- public void processPacket(NetHandler var1) { +- var1.handleWeather(this); +- } +- ++ } ++ ++ /** ++ * Abstract. Reads the raw packet data from the data stream. ++ */ ++ public void readPacketData(DataInput par1DataInput) throws IOException { ++ this.entityID = par1DataInput.readInt(); ++ this.isLightningBolt = par1DataInput.readByte(); ++ this.posX = par1DataInput.readInt(); ++ this.posY = par1DataInput.readInt(); ++ this.posZ = par1DataInput.readInt(); ++ } ++ ++ /** ++ * Abstract. Writes the raw packet data to the data stream. ++ */ ++ public void writePacketData(DataOutput par1DataOutput) throws IOException { ++ par1DataOutput.writeInt(this.entityID); ++ par1DataOutput.writeByte(this.isLightningBolt); ++ par1DataOutput.writeInt(this.posX); ++ par1DataOutput.writeInt(this.posY); ++ par1DataOutput.writeInt(this.posZ); ++ } ++ ++ /** ++ * Passes this Packet on to the NetHandler for processing. ++ */ ++ public void processPacket(NetHandler par1NetHandler) { ++ par1NetHandler.handleWeather(this); ++ } ++ ++ /** ++ * Abstract. Return the size of the packet (not counting the header). ++ */ + public int getPacketSize() { + return 17; + } diff --git a/patches/net/minecraft/src/Packet7UseEntity.java.patch b/patches/net/minecraft/src/Packet7UseEntity.java.patch new file mode 100644 index 0000000..bcdc71a --- /dev/null +++ b/patches/net/minecraft/src/Packet7UseEntity.java.patch @@ -0,0 +1,82 @@ +--- net/minecraft/src/Packet7UseEntity.java ++++ net/minecraft/src/Packet7UseEntity.java +@@ -5,35 +5,54 @@ + import java.io.IOException; + + public class Packet7UseEntity extends Packet { ++ ++ /** The entity of the player (ignored by the server) */ + public int playerEntityId; ++ ++ /** The entity the player is interacting with */ + public int targetEntity; ++ ++ /** ++ * Seems to be true when the player is pointing at an entity and left-clicking and false when right-clicking. ++ */ + public int isLeftClick; + +- public Packet7UseEntity() { +- } +- +- public Packet7UseEntity(int var1, int var2, int var3) { +- this.playerEntityId = var1; +- this.targetEntity = var2; +- this.isLeftClick = var3; +- } +- +- public void readPacketData(DataInput var1) throws IOException { +- this.playerEntityId = var1.readInt(); +- this.targetEntity = var1.readInt(); +- this.isLeftClick = var1.readByte(); +- } +- +- public void writePacketData(DataOutput var1) throws IOException { +- var1.writeInt(this.playerEntityId); +- var1.writeInt(this.targetEntity); +- var1.writeByte(this.isLeftClick); +- } +- +- public void processPacket(NetHandler var1) { +- var1.handleUseEntity(this); +- } +- ++ public Packet7UseEntity() {} ++ ++ public Packet7UseEntity(int par1, int par2, int par3) { ++ this.playerEntityId = par1; ++ this.targetEntity = par2; ++ this.isLeftClick = par3; ++ } ++ ++ /** ++ * Abstract. Reads the raw packet data from the data stream. ++ */ ++ public void readPacketData(DataInput par1DataInput) throws IOException { ++ this.playerEntityId = par1DataInput.readInt(); ++ this.targetEntity = par1DataInput.readInt(); ++ this.isLeftClick = par1DataInput.readByte(); ++ } ++ ++ /** ++ * Abstract. Writes the raw packet data to the data stream. ++ */ ++ public void writePacketData(DataOutput par1DataOutput) throws IOException { ++ par1DataOutput.writeInt(this.playerEntityId); ++ par1DataOutput.writeInt(this.targetEntity); ++ par1DataOutput.writeByte(this.isLeftClick); ++ } ++ ++ /** ++ * Passes this Packet on to the NetHandler for processing. ++ */ ++ public void processPacket(NetHandler par1NetHandler) { ++ par1NetHandler.handleUseEntity(this); ++ } ++ ++ /** ++ * Abstract. Return the size of the packet (not counting the header). ++ */ + public int getPacketSize() { + return 9; + } diff --git a/patches/net/minecraft/src/Packet8UpdateHealth.java.patch b/patches/net/minecraft/src/Packet8UpdateHealth.java.patch new file mode 100644 index 0000000..92fab76 --- /dev/null +++ b/patches/net/minecraft/src/Packet8UpdateHealth.java.patch @@ -0,0 +1,97 @@ +--- net/minecraft/src/Packet8UpdateHealth.java ++++ net/minecraft/src/Packet8UpdateHealth.java +@@ -5,44 +5,68 @@ + import java.io.IOException; + + public class Packet8UpdateHealth extends Packet { ++ ++ /** Variable used for incoming health packets */ + public float healthMP; + public int food; ++ ++ /** ++ * Players logging on get a saturation of 5.0. Eating food increases the saturation as well as the food bar. ++ */ + public float foodSaturation; + +- public Packet8UpdateHealth() { +- } +- +- public Packet8UpdateHealth(float var1, int var2, float var3) { +- this.healthMP = var1; +- this.food = var2; +- this.foodSaturation = var3; +- } +- +- public void readPacketData(DataInput var1) throws IOException { +- this.healthMP = var1.readFloat(); +- this.food = var1.readShort(); +- this.foodSaturation = var1.readFloat(); +- } +- +- public void writePacketData(DataOutput var1) throws IOException { +- var1.writeFloat(this.healthMP); +- var1.writeShort(this.food); +- var1.writeFloat(this.foodSaturation); +- } +- +- public void processPacket(NetHandler var1) { +- var1.handleUpdateHealth(this); +- } +- ++ public Packet8UpdateHealth() {} ++ ++ public Packet8UpdateHealth(float par1, int par2, float par3) { ++ this.healthMP = par1; ++ this.food = par2; ++ this.foodSaturation = par3; ++ } ++ ++ /** ++ * Abstract. Reads the raw packet data from the data stream. ++ */ ++ public void readPacketData(DataInput par1DataInput) throws IOException { ++ this.healthMP = par1DataInput.readFloat(); ++ this.food = par1DataInput.readShort(); ++ this.foodSaturation = par1DataInput.readFloat(); ++ } ++ ++ /** ++ * Abstract. Writes the raw packet data to the data stream. ++ */ ++ public void writePacketData(DataOutput par1DataOutput) throws IOException { ++ par1DataOutput.writeFloat(this.healthMP); ++ par1DataOutput.writeShort(this.food); ++ par1DataOutput.writeFloat(this.foodSaturation); ++ } ++ ++ /** ++ * Passes this Packet on to the NetHandler for processing. ++ */ ++ public void processPacket(NetHandler par1NetHandler) { ++ par1NetHandler.handleUpdateHealth(this); ++ } ++ ++ /** ++ * Abstract. Return the size of the packet (not counting the header). ++ */ + public int getPacketSize() { + return 8; + } + ++ /** ++ * only false for the abstract Packet class, all real packets return true ++ */ + public boolean isRealPacket() { + return true; + } + +- public boolean containsSameEntityIDAs(Packet var1) { ++ /** ++ * eg return packet30entity.entityId == entityId; WARNING : will throw if you compare a packet to a different packet ++ * class ++ */ ++ public boolean containsSameEntityIDAs(Packet par1Packet) { + return true; + } + } diff --git a/patches/net/minecraft/src/Packet9Respawn.java.patch b/patches/net/minecraft/src/Packet9Respawn.java.patch new file mode 100644 index 0000000..61e873b --- /dev/null +++ b/patches/net/minecraft/src/Packet9Respawn.java.patch @@ -0,0 +1,100 @@ +--- net/minecraft/src/Packet9Respawn.java ++++ net/minecraft/src/Packet9Respawn.java +@@ -6,47 +6,64 @@ + + public class Packet9Respawn extends Packet { + public int respawnDimension; ++ ++ /** ++ * The difficulty setting. 0 through 3 for peaceful, easy, normal, hard. The client always sends 1. ++ */ + public int difficulty; ++ ++ /** Defaults to 128 */ + public int worldHeight; + public EnumGameType gameType; + public WorldType terrainType; + +- public Packet9Respawn() { +- } +- +- public Packet9Respawn(int var1, byte var2, WorldType var3, int var4, EnumGameType var5) { +- this.respawnDimension = var1; +- this.difficulty = var2; +- this.worldHeight = var4; +- this.gameType = var5; +- this.terrainType = var3; +- } +- +- public void processPacket(NetHandler var1) { +- var1.handleRespawn(this); +- } +- +- public void readPacketData(DataInput var1) throws IOException { +- this.respawnDimension = var1.readInt(); +- this.difficulty = var1.readByte(); +- this.gameType = EnumGameType.getByID(var1.readByte()); +- this.worldHeight = var1.readShort(); +- String var2 = readString(var1, 16); ++ public Packet9Respawn() {} ++ ++ public Packet9Respawn(int par1, byte par2, WorldType par3WorldType, int par4, EnumGameType par5EnumGameType) { ++ this.respawnDimension = par1; ++ this.difficulty = par2; ++ this.worldHeight = par4; ++ this.gameType = par5EnumGameType; ++ this.terrainType = par3WorldType; ++ } ++ ++ /** ++ * Passes this Packet on to the NetHandler for processing. ++ */ ++ public void processPacket(NetHandler par1NetHandler) { ++ par1NetHandler.handleRespawn(this); ++ } ++ ++ /** ++ * Abstract. Reads the raw packet data from the data stream. ++ */ ++ public void readPacketData(DataInput par1DataInput) throws IOException { ++ this.respawnDimension = par1DataInput.readInt(); ++ this.difficulty = par1DataInput.readByte(); ++ this.gameType = EnumGameType.getByID(par1DataInput.readByte()); ++ this.worldHeight = par1DataInput.readShort(); ++ String var2 = readString(par1DataInput, 16); + this.terrainType = WorldType.parseWorldType(var2); +- if(this.terrainType == null) { ++ ++ if (this.terrainType == null) { + this.terrainType = WorldType.DEFAULT; + } +- +- } +- +- public void writePacketData(DataOutput var1) throws IOException { +- var1.writeInt(this.respawnDimension); +- var1.writeByte(this.difficulty); +- var1.writeByte(this.gameType.getID()); +- var1.writeShort(this.worldHeight); +- writeString(this.terrainType.getWorldTypeName(), var1); +- } +- ++ } ++ ++ /** ++ * Abstract. Writes the raw packet data to the data stream. ++ */ ++ public void writePacketData(DataOutput par1DataOutput) throws IOException { ++ par1DataOutput.writeInt(this.respawnDimension); ++ par1DataOutput.writeByte(this.difficulty); ++ par1DataOutput.writeByte(this.gameType.getID()); ++ par1DataOutput.writeShort(this.worldHeight); ++ writeString(this.terrainType.getWorldTypeName(), par1DataOutput); ++ } ++ ++ /** ++ * Abstract. Return the size of the packet (not counting the header). ++ */ + public int getPacketSize() { + return 8 + (this.terrainType == null ? 0 : this.terrainType.getWorldTypeName().length()); + } diff --git a/patches/net/minecraft/src/PacketCount.java.patch b/patches/net/minecraft/src/PacketCount.java.patch new file mode 100644 index 0000000..26430a3 --- /dev/null +++ b/patches/net/minecraft/src/PacketCount.java.patch @@ -0,0 +1,48 @@ +--- net/minecraft/src/PacketCount.java ++++ net/minecraft/src/PacketCount.java +@@ -4,23 +4,31 @@ + import java.util.Map; + + public class PacketCount { ++ ++ /** If false, countPacket does nothing */ + public static boolean allowCounting = true; +- private static final Map b = new HashMap(); +- private static final Map c = new HashMap(); +- private static final Object d = new Object(); +- +- public static void countPacket(int var0, long var1) { +- if(allowCounting) { +- Object var3 = d; +- synchronized(var3) { +- if(b.containsKey(Integer.valueOf(var0))) { +- b.put(Integer.valueOf(var0), Long.valueOf(((Long)b.get(Integer.valueOf(var0))).longValue() + 1L)); +- c.put(Integer.valueOf(var0), Long.valueOf(((Long)c.get(Integer.valueOf(var0))).longValue() + var1)); ++ ++ /** A count of the total number of each packet sent grouped by IDs. */ ++ private static final Map packetCountForID = new HashMap(); ++ ++ /** A count of the total size of each packet sent grouped by IDs. */ ++ private static final Map sizeCountForID = new HashMap(); ++ ++ /** Used to make threads queue to add packets */ ++ private static final Object lock = new Object(); ++ ++ public static void countPacket(int par0, long par1) { ++ if (allowCounting) { ++ Object var3 = lock; ++ ++ synchronized (lock) { ++ if (packetCountForID.containsKey(Integer.valueOf(par0))) { ++ packetCountForID.put(Integer.valueOf(par0), Long.valueOf(((Long)packetCountForID.get(Integer.valueOf(par0))).longValue() + 1L)); ++ sizeCountForID.put(Integer.valueOf(par0), Long.valueOf(((Long)sizeCountForID.get(Integer.valueOf(par0))).longValue() + par1)); + } else { +- b.put(Integer.valueOf(var0), Long.valueOf(1L)); +- c.put(Integer.valueOf(var0), Long.valueOf(var1)); ++ packetCountForID.put(Integer.valueOf(par0), Long.valueOf(1L)); ++ sizeCountForID.put(Integer.valueOf(par0), Long.valueOf(par1)); + } +- + } + } + } diff --git a/patches/net/minecraft/src/Particle.java.patch b/patches/net/minecraft/src/Particle.java.patch new file mode 100644 index 0000000..97aa65a --- /dev/null +++ b/patches/net/minecraft/src/Particle.java.patch @@ -0,0 +1,62 @@ +--- /dev/null ++++ net/minecraft/src/Particle.java +@@ -1,0 +1,59 @@ ++package net.minecraft.src; ++ ++import java.util.Random; ++ ++public class Particle { ++ private static Random rand = new Random(); ++ public double posX; ++ public double posY; ++ public double prevPosX; ++ public double prevPosY; ++ public double velocityX; ++ public double velocityY; ++ public double accelScale; ++ public boolean isDead; ++ public int timeTick; ++ public int timeLimit; ++ public double tintRed; ++ public double tintGreen; ++ public double tintBlue; ++ public double tintAlpha; ++ public double prevTintRed; ++ public double prevTintGreen; ++ public double prevTintBlue; ++ public double prevTintAlpha; ++ ++ public void update(GuiParticle par1GuiParticle) { ++ this.posX += this.velocityX; ++ this.posY += this.velocityY; ++ this.velocityX *= this.accelScale; ++ this.velocityY *= this.accelScale; ++ this.velocityY += 0.1D; ++ ++ if (++this.timeTick > this.timeLimit) { ++ this.setDead(); ++ } ++ ++ this.tintAlpha = 2.0D - (double)this.timeTick / (double)this.timeLimit * 2.0D; ++ ++ if (this.tintAlpha > 1.0D) { ++ this.tintAlpha = 1.0D; ++ } ++ ++ this.tintAlpha *= this.tintAlpha; ++ this.tintAlpha *= 0.5D; ++ } ++ ++ public void preUpdate() { ++ this.prevTintRed = this.tintRed; ++ this.prevTintGreen = this.tintGreen; ++ this.prevTintBlue = this.tintBlue; ++ this.prevTintAlpha = this.tintAlpha; ++ this.prevPosX = this.posX; ++ this.prevPosY = this.posY; ++ } ++ ++ public void setDead() { ++ this.isDead = true; ++ } ++} diff --git a/patches/net/minecraft/src/Path.java.patch b/patches/net/minecraft/src/Path.java.patch new file mode 100644 index 0000000..49e4163 --- /dev/null +++ b/patches/net/minecraft/src/Path.java.patch @@ -0,0 +1,191 @@ +--- net/minecraft/src/Path.java ++++ net/minecraft/src/Path.java +@@ -1,35 +1,49 @@ + package net.minecraft.src; + + public class Path { ++ ++ /** Contains the points in this path */ + private PathPoint[] pathPoints = new PathPoint[1024]; ++ ++ /** The number of points in this path */ + private int count; + +- public PathPoint addPoint(PathPoint var1) { +- if(var1.index >= 0) { ++ /** ++ * Adds a point to the path ++ */ ++ public PathPoint addPoint(PathPoint par1PathPoint) { ++ if (par1PathPoint.index >= 0) { + throw new IllegalStateException("OW KNOWS!"); + } else { +- if(this.count == this.pathPoints.length) { ++ if (this.count == this.pathPoints.length) { + PathPoint[] var2 = new PathPoint[this.count << 1]; + System.arraycopy(this.pathPoints, 0, var2, 0, this.count); + this.pathPoints = var2; + } + +- this.pathPoints[this.count] = var1; +- var1.index = this.count; ++ this.pathPoints[this.count] = par1PathPoint; ++ par1PathPoint.index = this.count; + this.sortBack(this.count++); +- return var1; ++ return par1PathPoint; + } + } + ++ /** ++ * Clears the path ++ */ + public void clearPath() { + this.count = 0; + } + ++ /** ++ * Returns and removes the first point in the path ++ */ + public PathPoint dequeue() { + PathPoint var1 = this.pathPoints[0]; + this.pathPoints[0] = this.pathPoints[--this.count]; + this.pathPoints[this.count] = null; +- if(this.count > 0) { ++ ++ if (this.count > 0) { + this.sortForward(0); + } + +@@ -37,44 +51,55 @@ + return var1; + } + +- public void changeDistance(PathPoint var1, float var2) { +- float var3 = var1.distanceToTarget; +- var1.distanceToTarget = var2; +- if(var2 < var3) { +- this.sortBack(var1.index); ++ /** ++ * Changes the provided point's distance to target ++ */ ++ public void changeDistance(PathPoint par1PathPoint, float par2) { ++ float var3 = par1PathPoint.distanceToTarget; ++ par1PathPoint.distanceToTarget = par2; ++ ++ if (par2 < var3) { ++ this.sortBack(par1PathPoint.index); + } else { +- this.sortForward(var1.index); ++ this.sortForward(par1PathPoint.index); + } +- + } + +- private void sortBack(int var1) { +- PathPoint var2 = this.pathPoints[var1]; +- ++ /** ++ * Sorts a point to the left ++ */ ++ private void sortBack(int par1) { ++ PathPoint var2 = this.pathPoints[par1]; + int var4; +- for(float var3 = var2.distanceToTarget; var1 > 0; var1 = var4) { +- var4 = var1 - 1 >> 1; ++ ++ for (float var3 = var2.distanceToTarget; par1 > 0; par1 = var4) { ++ var4 = par1 - 1 >> 1; + PathPoint var5 = this.pathPoints[var4]; +- if(var3 >= var5.distanceToTarget) { ++ ++ if (var3 >= var5.distanceToTarget) { + break; + } + +- this.pathPoints[var1] = var5; +- var5.index = var1; ++ this.pathPoints[par1] = var5; ++ var5.index = par1; + } + +- this.pathPoints[var1] = var2; +- var2.index = var1; ++ this.pathPoints[par1] = var2; ++ var2.index = par1; + } + +- private void sortForward(int var1) { +- PathPoint var2 = this.pathPoints[var1]; ++ /** ++ * Sorts a point to the right ++ */ ++ private void sortForward(int par1) { ++ PathPoint var2 = this.pathPoints[par1]; + float var3 = var2.distanceToTarget; + +- while(true) { +- int var4 = 1 + (var1 << 1); ++ while (true) { ++ int var4 = 1 + (par1 << 1); + int var5 = var4 + 1; +- if(var4 >= this.count) { ++ ++ if (var4 >= this.count) { + break; + } + +@@ -82,7 +107,8 @@ + float var7 = var6.distanceToTarget; + PathPoint var8; + float var9; +- if(var5 >= this.count) { ++ ++ if (var5 >= this.count) { + var8 = null; + var9 = Float.POSITIVE_INFINITY; + } else { +@@ -90,29 +116,32 @@ + var9 = var8.distanceToTarget; + } + +- if(var7 < var9) { +- if(var7 >= var3) { ++ if (var7 < var9) { ++ if (var7 >= var3) { + break; + } + +- this.pathPoints[var1] = var6; +- var6.index = var1; +- var1 = var4; ++ this.pathPoints[par1] = var6; ++ var6.index = par1; ++ par1 = var4; + } else { +- if(var9 >= var3) { ++ if (var9 >= var3) { + break; + } + +- this.pathPoints[var1] = var8; +- var8.index = var1; +- var1 = var5; ++ this.pathPoints[par1] = var8; ++ var8.index = par1; ++ par1 = var5; + } + } + +- this.pathPoints[var1] = var2; +- var2.index = var1; ++ this.pathPoints[par1] = var2; ++ var2.index = par1; + } + ++ /** ++ * Returns true if this path contains no points ++ */ + public boolean isPathEmpty() { + return this.count == 0; + } diff --git a/patches/net/minecraft/src/PathEntity.java.patch b/patches/net/minecraft/src/PathEntity.java.patch new file mode 100644 index 0000000..bfb036a --- /dev/null +++ b/patches/net/minecraft/src/PathEntity.java.patch @@ -0,0 +1,137 @@ +--- net/minecraft/src/PathEntity.java ++++ net/minecraft/src/PathEntity.java +@@ -1,66 +1,93 @@ + package net.minecraft.src; + + public class PathEntity { ++ ++ /** The actual points in the path */ + private final PathPoint[] points; ++ ++ /** PathEntity Array Index the Entity is currently targeting */ + private int currentPathIndex; ++ ++ /** The total length of the path */ + private int pathLength; + +- public PathEntity(PathPoint[] var1) { +- this.points = var1; +- this.pathLength = var1.length; ++ public PathEntity(PathPoint[] par1ArrayOfPathPoint) { ++ this.points = par1ArrayOfPathPoint; ++ this.pathLength = par1ArrayOfPathPoint.length; + } + ++ /** ++ * Directs this path to the next point in its array ++ */ + public void incrementPathIndex() { + ++this.currentPathIndex; + } + ++ /** ++ * Returns true if this path has reached the end ++ */ + public boolean isFinished() { + return this.currentPathIndex >= this.pathLength; + } + ++ /** ++ * returns the last PathPoint of the Array ++ */ + public PathPoint getFinalPathPoint() { + return this.pathLength > 0 ? this.points[this.pathLength - 1] : null; + } + +- public PathPoint getPathPointFromIndex(int var1) { +- return this.points[var1]; ++ /** ++ * return the PathPoint located at the specified PathIndex, usually the current one ++ */ ++ public PathPoint getPathPointFromIndex(int par1) { ++ return this.points[par1]; + } + + public int getCurrentPathLength() { + return this.pathLength; + } + +- public void setCurrentPathLength(int var1) { +- this.pathLength = var1; ++ public void setCurrentPathLength(int par1) { ++ this.pathLength = par1; + } + + public int getCurrentPathIndex() { + return this.currentPathIndex; + } + +- public void setCurrentPathIndex(int var1) { +- this.currentPathIndex = var1; +- } +- +- public Vec3 getVectorFromIndex(Entity var1, int var2) { +- double var3 = (double)this.points[var2].xCoord + (double)((int)(var1.width + 1.0F)) * 0.5D; +- double var5 = (double)this.points[var2].yCoord; +- double var7 = (double)this.points[var2].zCoord + (double)((int)(var1.width + 1.0F)) * 0.5D; +- return var1.worldObj.getWorldVec3Pool().getVecFromPool(var3, var5, var7); +- } +- +- public Vec3 getPosition(Entity var1) { +- return this.getVectorFromIndex(var1, this.currentPathIndex); +- } +- +- public boolean isSamePath(PathEntity var1) { +- if(var1 == null) { ++ public void setCurrentPathIndex(int par1) { ++ this.currentPathIndex = par1; ++ } ++ ++ /** ++ * Gets the vector of the PathPoint associated with the given index. ++ */ ++ public Vec3 getVectorFromIndex(Entity par1Entity, int par2) { ++ double var3 = (double)this.points[par2].xCoord + (double)((int)(par1Entity.width + 1.0F)) * 0.5D; ++ double var5 = (double)this.points[par2].yCoord; ++ double var7 = (double)this.points[par2].zCoord + (double)((int)(par1Entity.width + 1.0F)) * 0.5D; ++ return par1Entity.worldObj.getWorldVec3Pool().getVecFromPool(var3, var5, var7); ++ } ++ ++ /** ++ * returns the current PathEntity target node as Vec3D ++ */ ++ public Vec3 getPosition(Entity par1Entity) { ++ return this.getVectorFromIndex(par1Entity, this.currentPathIndex); ++ } ++ ++ /** ++ * Returns true if the EntityPath are the same. Non instance related equals. ++ */ ++ public boolean isSamePath(PathEntity par1PathEntity) { ++ if (par1PathEntity == null) { + return false; +- } else if(var1.points.length != this.points.length) { ++ } else if (par1PathEntity.points.length != this.points.length) { + return false; + } else { +- for(int var2 = 0; var2 < this.points.length; ++var2) { +- if(this.points[var2].xCoord != var1.points[var2].xCoord || this.points[var2].yCoord != var1.points[var2].yCoord || this.points[var2].zCoord != var1.points[var2].zCoord) { ++ for (int var2 = 0; var2 < this.points.length; ++var2) { ++ if (this.points[var2].xCoord != par1PathEntity.points[var2].xCoord || this.points[var2].yCoord != par1PathEntity.points[var2].yCoord || this.points[var2].zCoord != par1PathEntity.points[var2].zCoord) { + return false; + } + } +@@ -69,8 +96,11 @@ + } + } + +- public boolean isDestinationSame(Vec3 var1) { ++ /** ++ * Returns true if the final PathPoint in the PathEntity is equal to Vec3D coords. ++ */ ++ public boolean isDestinationSame(Vec3 par1Vec3) { + PathPoint var2 = this.getFinalPathPoint(); +- return var2 == null ? false : var2.xCoord == (int)var1.xCoord && var2.zCoord == (int)var1.zCoord; ++ return var2 == null ? false : var2.xCoord == (int)par1Vec3.xCoord && var2.zCoord == (int)par1Vec3.zCoord; + } + } diff --git a/patches/net/minecraft/src/PathFinder.java.patch b/patches/net/minecraft/src/PathFinder.java.patch new file mode 100644 index 0000000..477a655 --- /dev/null +++ b/patches/net/minecraft/src/PathFinder.java.patch @@ -0,0 +1,433 @@ +--- net/minecraft/src/PathFinder.java ++++ net/minecraft/src/PathFinder.java +@@ -1,86 +1,118 @@ + package net.minecraft.src; + + public class PathFinder { ++ ++ /** Used to find obstacles */ + private IBlockAccess worldMap; ++ ++ /** The path being generated */ + private Path path = new Path(); ++ ++ /** The points in the path */ + private IntHashMap pointMap = new IntHashMap(); ++ ++ /** Selection of path points to add to the path */ + private PathPoint[] pathOptions = new PathPoint[32]; ++ ++ /** should the PathFinder go through wodden door blocks */ + private boolean isWoddenDoorAllowed; ++ ++ /** ++ * should the PathFinder disregard BlockMovement type materials in its path ++ */ + private boolean isMovementBlockAllowed; + private boolean isPathingInWater; ++ ++ /** tells the FathFinder to not stop pathing underwater */ + private boolean canEntityDrown; + +- public PathFinder(IBlockAccess var1, boolean var2, boolean var3, boolean var4, boolean var5) { +- this.worldMap = var1; +- this.isWoddenDoorAllowed = var2; +- this.isMovementBlockAllowed = var3; +- this.isPathingInWater = var4; +- this.canEntityDrown = var5; +- } +- +- public PathEntity createEntityPathTo(Entity var1, Entity var2, float var3) { +- return this.createEntityPathTo(var1, var2.posX, var2.boundingBox.minY, var2.posZ, var3); +- } +- +- public PathEntity createEntityPathTo(Entity var1, int var2, int var3, int var4, float var5) { +- return this.createEntityPathTo(var1, (double)((float)var2 + 0.5F), (double)((float)var3 + 0.5F), (double)((float)var4 + 0.5F), var5); +- } +- +- private PathEntity createEntityPathTo(Entity var1, double var2, double var4, double var6, float var8) { ++ public PathFinder(IBlockAccess par1IBlockAccess, boolean par2, boolean par3, boolean par4, boolean par5) { ++ this.worldMap = par1IBlockAccess; ++ this.isWoddenDoorAllowed = par2; ++ this.isMovementBlockAllowed = par3; ++ this.isPathingInWater = par4; ++ this.canEntityDrown = par5; ++ } ++ ++ /** ++ * Creates a path from one entity to another within a minimum distance ++ */ ++ public PathEntity createEntityPathTo(Entity par1Entity, Entity par2Entity, float par3) { ++ return this.createEntityPathTo(par1Entity, par2Entity.posX, par2Entity.boundingBox.minY, par2Entity.posZ, par3); ++ } ++ ++ /** ++ * Creates a path from an entity to a specified location within a minimum distance ++ */ ++ public PathEntity createEntityPathTo(Entity par1Entity, int par2, int par3, int par4, float par5) { ++ return this.createEntityPathTo(par1Entity, (double)((float)par2 + 0.5F), (double)((float)par3 + 0.5F), (double)((float)par4 + 0.5F), par5); ++ } ++ ++ /** ++ * Internal implementation of creating a path from an entity to a point ++ */ ++ private PathEntity createEntityPathTo(Entity par1Entity, double par2, double par4, double par6, float par8) { + this.path.clearPath(); + this.pointMap.clearMap(); + boolean var9 = this.isPathingInWater; +- int var10 = MathHelper.floor_double(var1.boundingBox.minY + 0.5D); +- if(this.canEntityDrown && var1.isInWater()) { +- var10 = (int)var1.boundingBox.minY; +- +- for(int var11 = this.worldMap.getBlockId(MathHelper.floor_double(var1.posX), var10, MathHelper.floor_double(var1.posZ)); var11 == Block.waterMoving.blockID || var11 == Block.waterStill.blockID; var11 = this.worldMap.getBlockId(MathHelper.floor_double(var1.posX), var10, MathHelper.floor_double(var1.posZ))) { ++ int var10 = MathHelper.floor_double(par1Entity.boundingBox.minY + 0.5D); ++ ++ if (this.canEntityDrown && par1Entity.isInWater()) { ++ var10 = (int)par1Entity.boundingBox.minY; ++ ++ for (int var11 = this.worldMap.getBlockId(MathHelper.floor_double(par1Entity.posX), var10, MathHelper.floor_double(par1Entity.posZ)); var11 == Block.waterMoving.blockID || var11 == Block.waterStill.blockID; var11 = this.worldMap.getBlockId(MathHelper.floor_double(par1Entity.posX), var10, MathHelper.floor_double(par1Entity.posZ))) { + ++var10; + } + + var9 = this.isPathingInWater; + this.isPathingInWater = false; + } else { +- var10 = MathHelper.floor_double(var1.boundingBox.minY + 0.5D); ++ var10 = MathHelper.floor_double(par1Entity.boundingBox.minY + 0.5D); + } + +- PathPoint var15 = this.openPoint(MathHelper.floor_double(var1.boundingBox.minX), var10, MathHelper.floor_double(var1.boundingBox.minZ)); +- PathPoint var12 = this.openPoint(MathHelper.floor_double(var2 - (double)(var1.width / 2.0F)), MathHelper.floor_double(var4), MathHelper.floor_double(var6 - (double)(var1.width / 2.0F))); +- PathPoint var13 = new PathPoint(MathHelper.floor_float(var1.width + 1.0F), MathHelper.floor_float(var1.height + 1.0F), MathHelper.floor_float(var1.width + 1.0F)); +- PathEntity var14 = this.addToPath(var1, var15, var12, var13, var8); ++ PathPoint var15 = this.openPoint(MathHelper.floor_double(par1Entity.boundingBox.minX), var10, MathHelper.floor_double(par1Entity.boundingBox.minZ)); ++ PathPoint var12 = this.openPoint(MathHelper.floor_double(par2 - (double)(par1Entity.width / 2.0F)), MathHelper.floor_double(par4), MathHelper.floor_double(par6 - (double)(par1Entity.width / 2.0F))); ++ PathPoint var13 = new PathPoint(MathHelper.floor_float(par1Entity.width + 1.0F), MathHelper.floor_float(par1Entity.height + 1.0F), MathHelper.floor_float(par1Entity.width + 1.0F)); ++ PathEntity var14 = this.addToPath(par1Entity, var15, var12, var13, par8); + this.isPathingInWater = var9; + return var14; + } + +- private PathEntity addToPath(Entity var1, PathPoint var2, PathPoint var3, PathPoint var4, float var5) { +- var2.totalPathDistance = 0.0F; +- var2.distanceToNext = var2.func_75832_b(var3); +- var2.distanceToTarget = var2.distanceToNext; ++ /** ++ * Adds a path from start to end and returns the whole path (args: unused, start, end, unused, maxDistance) ++ */ ++ private PathEntity addToPath(Entity par1Entity, PathPoint par2PathPoint, PathPoint par3PathPoint, PathPoint par4PathPoint, float par5) { ++ par2PathPoint.totalPathDistance = 0.0F; ++ par2PathPoint.distanceToNext = par2PathPoint.func_75832_b(par3PathPoint); ++ par2PathPoint.distanceToTarget = par2PathPoint.distanceToNext; + this.path.clearPath(); +- this.path.addPoint(var2); +- PathPoint var6 = var2; ++ this.path.addPoint(par2PathPoint); ++ PathPoint var6 = par2PathPoint; + +- while(!this.path.isPathEmpty()) { ++ while (!this.path.isPathEmpty()) { + PathPoint var7 = this.path.dequeue(); +- if(var7.equals(var3)) { +- return this.createEntityPath(var2, var3); ++ ++ if (var7.equals(par3PathPoint)) { ++ return this.createEntityPath(par2PathPoint, par3PathPoint); + } + +- if(var7.func_75832_b(var3) < var6.func_75832_b(var3)) { ++ if (var7.func_75832_b(par3PathPoint) < var6.func_75832_b(par3PathPoint)) { + var6 = var7; + } + + var7.isFirst = true; +- int var8 = this.findPathOptions(var1, var7, var4, var3, var5); ++ int var8 = this.findPathOptions(par1Entity, var7, par4PathPoint, par3PathPoint, par5); + +- for(int var9 = 0; var9 < var8; ++var9) { ++ for (int var9 = 0; var9 < var8; ++var9) { + PathPoint var10 = this.pathOptions[var9]; + float var11 = var7.totalPathDistance + var7.func_75832_b(var10); +- if(!var10.isAssigned() || var11 < var10.totalPathDistance) { ++ ++ if (!var10.isAssigned() || var11 < var10.totalPathDistance) { + var10.previous = var7; + var10.totalPathDistance = var11; +- var10.distanceToNext = var10.func_75832_b(var3); +- if(var10.isAssigned()) { ++ var10.distanceToNext = var10.func_75832_b(par3PathPoint); ++ ++ if (var10.isAssigned()) { + this.path.changeDistance(var10, var10.totalPathDistance + var10.distanceToNext); + } else { + var10.distanceToTarget = var10.totalPathDistance + var10.distanceToNext; +@@ -90,83 +122,95 @@ + } + } + +- if(var6 == var2) { ++ if (var6 == par2PathPoint) { + return null; + } else { +- return this.createEntityPath(var2, var6); ++ return this.createEntityPath(par2PathPoint, var6); + } + } + +- private int findPathOptions(Entity var1, PathPoint var2, PathPoint var3, PathPoint var4, float var5) { ++ /** ++ * populates pathOptions with available points and returns the number of options found (args: unused1, currentPoint, ++ * unused2, targetPoint, maxDistance) ++ */ ++ private int findPathOptions(Entity par1Entity, PathPoint par2PathPoint, PathPoint par3PathPoint, PathPoint par4PathPoint, float par5) { + int var6 = 0; + byte var7 = 0; +- if(this.getVerticalOffset(var1, var2.xCoord, var2.yCoord + 1, var2.zCoord, var3) == 1) { ++ ++ if (this.getVerticalOffset(par1Entity, par2PathPoint.xCoord, par2PathPoint.yCoord + 1, par2PathPoint.zCoord, par3PathPoint) == 1) { + var7 = 1; + } + +- PathPoint var8 = this.getSafePoint(var1, var2.xCoord, var2.yCoord, var2.zCoord + 1, var3, var7); +- PathPoint var9 = this.getSafePoint(var1, var2.xCoord - 1, var2.yCoord, var2.zCoord, var3, var7); +- PathPoint var10 = this.getSafePoint(var1, var2.xCoord + 1, var2.yCoord, var2.zCoord, var3, var7); +- PathPoint var11 = this.getSafePoint(var1, var2.xCoord, var2.yCoord, var2.zCoord - 1, var3, var7); +- if(var8 != null && !var8.isFirst && var8.distanceTo(var4) < var5) { ++ PathPoint var8 = this.getSafePoint(par1Entity, par2PathPoint.xCoord, par2PathPoint.yCoord, par2PathPoint.zCoord + 1, par3PathPoint, var7); ++ PathPoint var9 = this.getSafePoint(par1Entity, par2PathPoint.xCoord - 1, par2PathPoint.yCoord, par2PathPoint.zCoord, par3PathPoint, var7); ++ PathPoint var10 = this.getSafePoint(par1Entity, par2PathPoint.xCoord + 1, par2PathPoint.yCoord, par2PathPoint.zCoord, par3PathPoint, var7); ++ PathPoint var11 = this.getSafePoint(par1Entity, par2PathPoint.xCoord, par2PathPoint.yCoord, par2PathPoint.zCoord - 1, par3PathPoint, var7); ++ ++ if (var8 != null && !var8.isFirst && var8.distanceTo(par4PathPoint) < par5) { + this.pathOptions[var6++] = var8; + } + +- if(var9 != null && !var9.isFirst && var9.distanceTo(var4) < var5) { ++ if (var9 != null && !var9.isFirst && var9.distanceTo(par4PathPoint) < par5) { + this.pathOptions[var6++] = var9; + } + +- if(var10 != null && !var10.isFirst && var10.distanceTo(var4) < var5) { ++ if (var10 != null && !var10.isFirst && var10.distanceTo(par4PathPoint) < par5) { + this.pathOptions[var6++] = var10; + } + +- if(var11 != null && !var11.isFirst && var11.distanceTo(var4) < var5) { ++ if (var11 != null && !var11.isFirst && var11.distanceTo(par4PathPoint) < par5) { + this.pathOptions[var6++] = var11; + } + + return var6; + } + +- private PathPoint getSafePoint(Entity var1, int var2, int var3, int var4, PathPoint var5, int var6) { ++ /** ++ * Returns a point that the entity can safely move to ++ */ ++ private PathPoint getSafePoint(Entity par1Entity, int par2, int par3, int par4, PathPoint par5PathPoint, int par6) { + PathPoint var7 = null; +- int var8 = this.getVerticalOffset(var1, var2, var3, var4, var5); +- if(var8 == 2) { +- return this.openPoint(var2, var3, var4); ++ int var8 = this.getVerticalOffset(par1Entity, par2, par3, par4, par5PathPoint); ++ ++ if (var8 == 2) { ++ return this.openPoint(par2, par3, par4); + } else { +- if(var8 == 1) { +- var7 = this.openPoint(var2, var3, var4); +- } +- +- if(var7 == null && var6 > 0 && var8 != -3 && var8 != -4 && this.getVerticalOffset(var1, var2, var3 + var6, var4, var5) == 1) { +- var7 = this.openPoint(var2, var3 + var6, var4); +- var3 += var6; +- } +- +- if(var7 != null) { ++ if (var8 == 1) { ++ var7 = this.openPoint(par2, par3, par4); ++ } ++ ++ if (var7 == null && par6 > 0 && var8 != -3 && var8 != -4 && this.getVerticalOffset(par1Entity, par2, par3 + par6, par4, par5PathPoint) == 1) { ++ var7 = this.openPoint(par2, par3 + par6, par4); ++ par3 += par6; ++ } ++ ++ if (var7 != null) { + int var9 = 0; + int var10 = 0; + +- while(var3 > 0) { +- var10 = this.getVerticalOffset(var1, var2, var3 - 1, var4, var5); +- if(this.isPathingInWater && var10 == -1) { ++ while (par3 > 0) { ++ var10 = this.getVerticalOffset(par1Entity, par2, par3 - 1, par4, par5PathPoint); ++ ++ if (this.isPathingInWater && var10 == -1) { + return null; + } + +- if(var10 != 1) { ++ if (var10 != 1) { + break; + } + +- if(var9++ >= var1.getMaxSafePointTries()) { ++ if (var9++ >= par1Entity.getMaxSafePointTries()) { + return null; + } + +- --var3; +- if(var3 > 0) { +- var7 = this.openPoint(var2, var3, var4); ++ --par3; ++ ++ if (par3 > 0) { ++ var7 = this.openPoint(par2, par3, par4); + } + } + +- if(var10 == -2) { ++ if (var10 == -2) { + return null; + } + } +@@ -175,37 +219,47 @@ + } + } + +- private final PathPoint openPoint(int var1, int var2, int var3) { +- int var4 = PathPoint.makeHash(var1, var2, var3); ++ /** ++ * Returns a mapped point or creates and adds one ++ */ ++ private final PathPoint openPoint(int par1, int par2, int par3) { ++ int var4 = PathPoint.makeHash(par1, par2, par3); + PathPoint var5 = (PathPoint)this.pointMap.lookup(var4); +- if(var5 == null) { +- var5 = new PathPoint(var1, var2, var3); ++ ++ if (var5 == null) { ++ var5 = new PathPoint(par1, par2, par3); + this.pointMap.addKey(var4, var5); + } + + return var5; + } + +- public int getVerticalOffset(Entity var1, int var2, int var3, int var4, PathPoint var5) { +- return func_82565_a(var1, var2, var3, var4, var5, this.isPathingInWater, this.isMovementBlockAllowed, this.isWoddenDoorAllowed); ++ /** ++ * Checks if an entity collides with blocks at a position. Returns 1 if clear, 0 for colliding with any solid block, -1 ++ * for water(if avoiding water) but otherwise clear, -2 for lava, -3 for fence, -4 for closed trapdoor, 2 if otherwise ++ * clear except for open trapdoor or water(if not avoiding) ++ */ ++ public int getVerticalOffset(Entity par1Entity, int par2, int par3, int par4, PathPoint par5PathPoint) { ++ return func_82565_a(par1Entity, par2, par3, par4, par5PathPoint, this.isPathingInWater, this.isMovementBlockAllowed, this.isWoddenDoorAllowed); + } + +- public static int func_82565_a(Entity var0, int var1, int var2, int var3, PathPoint var4, boolean var5, boolean var6, boolean var7) { ++ public static int func_82565_a(Entity par0Entity, int par1, int par2, int par3, PathPoint par4PathPoint, boolean par5, boolean par6, boolean par7) { + boolean var8 = false; + +- for(int var9 = var1; var9 < var1 + var4.xCoord; ++var9) { +- for(int var10 = var2; var10 < var2 + var4.yCoord; ++var10) { +- for(int var11 = var3; var11 < var3 + var4.zCoord; ++var11) { +- int var12 = var0.worldObj.getBlockId(var9, var10, var11); +- if(var12 > 0) { +- if(var12 == Block.trapdoor.blockID) { ++ for (int var9 = par1; var9 < par1 + par4PathPoint.xCoord; ++var9) { ++ for (int var10 = par2; var10 < par2 + par4PathPoint.yCoord; ++var10) { ++ for (int var11 = par3; var11 < par3 + par4PathPoint.zCoord; ++var11) { ++ int var12 = par0Entity.worldObj.getBlockId(var9, var10, var11); ++ ++ if (var12 > 0) { ++ if (var12 == Block.trapdoor.blockID) { + var8 = true; +- } else if(var12 != Block.waterMoving.blockID && var12 != Block.waterStill.blockID) { +- if(!var7 && var12 == Block.doorWood.blockID) { ++ } else if (var12 != Block.waterMoving.blockID && var12 != Block.waterStill.blockID) { ++ if (!par7 && var12 == Block.doorWood.blockID) { + return 0; + } + } else { +- if(var5) { ++ if (par5) { + return -1; + } + +@@ -214,28 +268,31 @@ + + Block var13 = Block.blocksList[var12]; + int var14 = var13.getRenderType(); +- if(var0.worldObj.blockGetRenderType(var9, var10, var11) == 9) { +- int var18 = MathHelper.floor_double(var0.posX); +- int var16 = MathHelper.floor_double(var0.posY); +- int var17 = MathHelper.floor_double(var0.posZ); +- if(var0.worldObj.blockGetRenderType(var18, var16, var17) != 9 && var0.worldObj.blockGetRenderType(var18, var16 - 1, var17) != 9) { +- return -3; +- } +- } else if(!var13.getBlocksMovement(var0.worldObj, var9, var10, var11) && (!var6 || var12 != Block.doorWood.blockID)) { +- if(var14 == 11 || var12 == Block.fenceGate.blockID || var14 == 32) { +- return -3; +- } +- +- if(var12 == Block.trapdoor.blockID) { ++ ++ if (par0Entity.worldObj.blockGetRenderType(var9, var10, var11) == 9) { ++ int var18 = MathHelper.floor_double(par0Entity.posX); ++ int var16 = MathHelper.floor_double(par0Entity.posY); ++ int var17 = MathHelper.floor_double(par0Entity.posZ); ++ ++ if (par0Entity.worldObj.blockGetRenderType(var18, var16, var17) != 9 && par0Entity.worldObj.blockGetRenderType(var18, var16 - 1, var17) != 9) { ++ return -3; ++ } ++ } else if (!var13.getBlocksMovement(par0Entity.worldObj, var9, var10, var11) && (!par6 || var12 != Block.doorWood.blockID)) { ++ if (var14 == 11 || var12 == Block.fenceGate.blockID || var14 == 32) { ++ return -3; ++ } ++ ++ if (var12 == Block.trapdoor.blockID) { + return -4; + } + + Material var15 = var13.blockMaterial; +- if(var15 != Material.lava) { ++ ++ if (var15 != Material.lava) { + return 0; + } + +- if(!var0.handleLavaMovement()) { ++ if (!par0Entity.handleLavaMovement()) { + return -2; + } + } +@@ -247,19 +304,22 @@ + return var8 ? 2 : 1; + } + +- private PathEntity createEntityPath(PathPoint var1, PathPoint var2) { ++ /** ++ * Returns a new PathEntity for a given start and end point ++ */ ++ private PathEntity createEntityPath(PathPoint par1PathPoint, PathPoint par2PathPoint) { + int var3 = 1; +- + PathPoint var4; +- for(var4 = var2; var4.previous != null; var4 = var4.previous) { ++ ++ for (var4 = par2PathPoint; var4.previous != null; var4 = var4.previous) { + ++var3; + } + + PathPoint[] var5 = new PathPoint[var3]; +- var4 = var2; ++ var4 = par2PathPoint; + --var3; + +- for(var5[var3] = var2; var4.previous != null; var5[var3] = var4) { ++ for (var5[var3] = par2PathPoint; var4.previous != null; var5[var3] = var4) { + var4 = var4.previous; + --var3; + } diff --git a/patches/net/minecraft/src/PathNavigate.java.patch b/patches/net/minecraft/src/PathNavigate.java.patch new file mode 100644 index 0000000..68586d5 --- /dev/null +++ b/patches/net/minecraft/src/PathNavigate.java.patch @@ -0,0 +1,533 @@ +--- net/minecraft/src/PathNavigate.java ++++ net/minecraft/src/PathNavigate.java +@@ -3,95 +3,155 @@ + public class PathNavigate { + private EntityLiving theEntity; + private World worldObj; ++ ++ /** The PathEntity being followed. */ + private PathEntity currentPath; + private double speed; ++ ++ /** ++ * The number of blocks (extra) +/- in each axis that get pulled out as cache for the pathfinder's search space ++ */ + private AttributeInstance pathSearchRange; + private boolean noSunPathfind; ++ ++ /** Time, in number of ticks, following the current path */ + private int totalTicks; ++ ++ /** ++ * The time when the last position check was done (to detect successful movement) ++ */ + private int ticksAtLastPos; ++ ++ /** ++ * Coordinates of the entity's position last time a check was done (part of monitoring getting 'stuck') ++ */ + private Vec3 lastPosCheck = Vec3.createVectorHelper(0.0D, 0.0D, 0.0D); ++ ++ /** ++ * Specifically, if a wooden door block is even considered to be passable by the pathfinder ++ */ + private boolean canPassOpenWoodenDoors = true; ++ ++ /** If door blocks are considered passable even when closed */ + private boolean canPassClosedWoodenDoors; ++ ++ /** If water blocks are avoided (at least by the pathfinder) */ + private boolean avoidsWater; ++ ++ /** ++ * If the entity can swim. Swimming AI enables this and the pathfinder will also cause the entity to swim straight ++ * upwards when underwater ++ */ + private boolean canSwim; + +- public PathNavigate(EntityLiving var1, World var2) { +- this.theEntity = var1; +- this.worldObj = var2; +- this.pathSearchRange = var1.getEntityAttribute(SharedMonsterAttributes.followRange); ++ public PathNavigate(EntityLiving par1EntityLiving, World par2World) { ++ this.theEntity = par1EntityLiving; ++ this.worldObj = par2World; ++ this.pathSearchRange = par1EntityLiving.getEntityAttribute(SharedMonsterAttributes.followRange); + } + +- public void setAvoidsWater(boolean var1) { +- this.avoidsWater = var1; ++ public void setAvoidsWater(boolean par1) { ++ this.avoidsWater = par1; + } + + public boolean getAvoidsWater() { + return this.avoidsWater; + } + +- public void setBreakDoors(boolean var1) { +- this.canPassClosedWoodenDoors = var1; +- } +- +- public void setEnterDoors(boolean var1) { +- this.canPassOpenWoodenDoors = var1; +- } +- ++ public void setBreakDoors(boolean par1) { ++ this.canPassClosedWoodenDoors = par1; ++ } ++ ++ /** ++ * Sets if the entity can enter open doors ++ */ ++ public void setEnterDoors(boolean par1) { ++ this.canPassOpenWoodenDoors = par1; ++ } ++ ++ /** ++ * Returns true if the entity can break doors, false otherwise ++ */ + public boolean getCanBreakDoors() { + return this.canPassClosedWoodenDoors; + } + +- public void setAvoidSun(boolean var1) { +- this.noSunPathfind = var1; +- } +- +- public void setSpeed(double var1) { +- this.speed = var1; +- } +- +- public void setCanSwim(boolean var1) { +- this.canSwim = var1; +- } +- +- public float getPathSearchRange() { ++ /** ++ * Sets if the path should avoid sunlight ++ */ ++ public void setAvoidSun(boolean par1) { ++ this.noSunPathfind = par1; ++ } ++ ++ /** ++ * Sets the speed ++ */ ++ public void setSpeed(double par1) { ++ this.speed = par1; ++ } ++ ++ /** ++ * Sets if the entity can swim ++ */ ++ public void setCanSwim(boolean par1) { ++ this.canSwim = par1; ++ } ++ ++ public float func_111269_d() { + return (float)this.pathSearchRange.getAttributeValue(); + } + +- public PathEntity getPathToXYZ(double var1, double var3, double var5) { +- return !this.canNavigate() ? null : this.worldObj.getEntityPathToXYZ(this.theEntity, MathHelper.floor_double(var1), (int)var3, MathHelper.floor_double(var5), this.getPathSearchRange(), this.canPassOpenWoodenDoors, this.canPassClosedWoodenDoors, this.avoidsWater, this.canSwim); +- } +- +- public boolean tryMoveToXYZ(double var1, double var3, double var5, double var7) { +- PathEntity var9 = this.getPathToXYZ((double)MathHelper.floor_double(var1), (double)((int)var3), (double)MathHelper.floor_double(var5)); +- return this.setPath(var9, var7); +- } +- +- public PathEntity getPathToEntityLiving(Entity var1) { +- return !this.canNavigate() ? null : this.worldObj.getPathEntityToEntity(this.theEntity, var1, this.getPathSearchRange(), this.canPassOpenWoodenDoors, this.canPassClosedWoodenDoors, this.avoidsWater, this.canSwim); +- } +- +- public boolean tryMoveToEntityLiving(Entity var1, double var2) { +- PathEntity var4 = this.getPathToEntityLiving(var1); +- return var4 != null ? this.setPath(var4, var2) : false; +- } +- +- public boolean setPath(PathEntity var1, double var2) { +- if(var1 == null) { ++ /** ++ * Returns the path to the given coordinates ++ */ ++ public PathEntity getPathToXYZ(double par1, double par3, double par5) { ++ return !this.canNavigate() ? null : this.worldObj.getEntityPathToXYZ(this.theEntity, MathHelper.floor_double(par1), (int)par3, MathHelper.floor_double(par5), this.func_111269_d(), this.canPassOpenWoodenDoors, this.canPassClosedWoodenDoors, this.avoidsWater, this.canSwim); ++ } ++ ++ /** ++ * Try to find and set a path to XYZ. Returns true if successful. ++ */ ++ public boolean tryMoveToXYZ(double par1, double par3, double par5, double par7) { ++ PathEntity var9 = this.getPathToXYZ((double)MathHelper.floor_double(par1), (double)((int)par3), (double)MathHelper.floor_double(par5)); ++ return this.setPath(var9, par7); ++ } ++ ++ /** ++ * Returns the path to the given EntityLiving ++ */ ++ public PathEntity getPathToEntityLiving(Entity par1Entity) { ++ return !this.canNavigate() ? null : this.worldObj.getPathEntityToEntity(this.theEntity, par1Entity, this.func_111269_d(), this.canPassOpenWoodenDoors, this.canPassClosedWoodenDoors, this.avoidsWater, this.canSwim); ++ } ++ ++ /** ++ * Try to find and set a path to EntityLiving. Returns true if successful. ++ */ ++ public boolean tryMoveToEntityLiving(Entity par1Entity, double par2) { ++ PathEntity var4 = this.getPathToEntityLiving(par1Entity); ++ return var4 != null ? this.setPath(var4, par2) : false; ++ } ++ ++ /** ++ * sets the active path data if path is 100% unique compared to old path, checks to adjust path for sun avoiding ents ++ * and stores end coords ++ */ ++ public boolean setPath(PathEntity par1PathEntity, double par2) { ++ if (par1PathEntity == null) { + this.currentPath = null; + return false; + } else { +- if(!var1.isSamePath(this.currentPath)) { +- this.currentPath = var1; ++ if (!par1PathEntity.isSamePath(this.currentPath)) { ++ this.currentPath = par1PathEntity; + } + +- if(this.noSunPathfind) { ++ if (this.noSunPathfind) { + this.removeSunnyPath(); + } + +- if(this.currentPath.getCurrentPathLength() == 0) { ++ if (this.currentPath.getCurrentPathLength() == 0) { + return false; + } else { +- this.speed = var2; ++ this.speed = par2; + Vec3 var4 = this.getEntityPosition(); + this.ticksAtLastPos = this.totalTicks; + this.lastPosCheck.xCoord = var4.xCoord; +@@ -102,20 +162,25 @@ + } + } + ++ /** ++ * gets the actively used PathEntity ++ */ + public PathEntity getPath() { + return this.currentPath; + } + + public void onUpdateNavigation() { + ++this.totalTicks; +- if(!this.noPath()) { +- if(this.canNavigate()) { ++ ++ if (!this.noPath()) { ++ if (this.canNavigate()) { + this.pathFollow(); + } + +- if(!this.noPath()) { ++ if (!this.noPath()) { + Vec3 var1 = this.currentPath.getPosition(this.theEntity); +- if(var1 != null) { ++ ++ if (var1 != null) { + this.theEntity.getMoveHelper().setMoveTo(var1.xCoord, var1.yCoord, var1.zCoord, this.speed); + } + } +@@ -126,18 +191,18 @@ + Vec3 var1 = this.getEntityPosition(); + int var2 = this.currentPath.getCurrentPathLength(); + +- for(int var3 = this.currentPath.getCurrentPathIndex(); var3 < this.currentPath.getCurrentPathLength(); ++var3) { +- if(this.currentPath.getPathPointFromIndex(var3).yCoord != (int)var1.yCoord) { ++ for (int var3 = this.currentPath.getCurrentPathIndex(); var3 < this.currentPath.getCurrentPathLength(); ++var3) { ++ if (this.currentPath.getPathPointFromIndex(var3).yCoord != (int)var1.yCoord) { + var2 = var3; + break; + } + } + + float var8 = this.theEntity.width * this.theEntity.width; +- + int var4; +- for(var4 = this.currentPath.getCurrentPathIndex(); var4 < var2; ++var4) { +- if(var1.squareDistanceTo(this.currentPath.getVectorFromIndex(this.theEntity, var4)) < (double)var8) { ++ ++ for (var4 = this.currentPath.getCurrentPathIndex(); var4 < var2; ++var4) { ++ if (var1.squareDistanceTo(this.currentPath.getVectorFromIndex(this.theEntity, var4)) < (double)var8) { + this.currentPath.setCurrentPathIndex(var4 + 1); + } + } +@@ -146,15 +211,15 @@ + int var5 = (int)this.theEntity.height + 1; + int var6 = var4; + +- for(int var7 = var2 - 1; var7 >= this.currentPath.getCurrentPathIndex(); --var7) { +- if(this.isDirectPathBetweenPoints(var1, this.currentPath.getVectorFromIndex(this.theEntity, var7), var4, var5, var6)) { ++ for (int var7 = var2 - 1; var7 >= this.currentPath.getCurrentPathIndex(); --var7) { ++ if (this.isDirectPathBetweenPoints(var1, this.currentPath.getVectorFromIndex(this.theEntity, var7), var4, var5, var6)) { + this.currentPath.setCurrentPathIndex(var7); + break; + } + } + +- if(this.totalTicks - this.ticksAtLastPos > 100) { +- if(var1.squareDistanceTo(this.lastPosCheck) < 2.25D) { ++ if (this.totalTicks - this.ticksAtLastPos > 100) { ++ if (var1.squareDistanceTo(this.lastPosCheck) < 2.25D) { + this.clearPathEntity(); + } + +@@ -163,13 +228,18 @@ + this.lastPosCheck.yCoord = var1.yCoord; + this.lastPosCheck.zCoord = var1.zCoord; + } +- + } + ++ /** ++ * If null path or reached the end ++ */ + public boolean noPath() { + return this.currentPath == null || this.currentPath.isFinished(); + } + ++ /** ++ * sets active PathEntity to null ++ */ + public void clearPathEntity() { + this.currentPath = null; + } +@@ -178,21 +248,24 @@ + return this.worldObj.getWorldVec3Pool().getVecFromPool(this.theEntity.posX, (double)this.getPathableYPos(), this.theEntity.posZ); + } + ++ /** ++ * Gets the safe pathing Y position for the entity depending on if it can path swim or not ++ */ + private int getPathableYPos() { +- if(this.theEntity.isInWater() && this.canSwim) { ++ if (this.theEntity.isInWater() && this.canSwim) { + int var1 = (int)this.theEntity.boundingBox.minY; + int var2 = this.worldObj.getBlockId(MathHelper.floor_double(this.theEntity.posX), var1, MathHelper.floor_double(this.theEntity.posZ)); + int var3 = 0; + + do { +- if(var2 != Block.waterMoving.blockID && var2 != Block.waterStill.blockID) { ++ if (var2 != Block.waterMoving.blockID && var2 != Block.waterStill.blockID) { + return var1; + } + + ++var1; + var2 = this.worldObj.getBlockId(MathHelper.floor_double(this.theEntity.posX), var1, MathHelper.floor_double(this.theEntity.posZ)); + ++var3; +- } while(var3 <= 16); ++ } while (var3 <= 16); + + return (int)this.theEntity.boundingBox.minY; + } else { +@@ -200,55 +273,71 @@ + } + } + ++ /** ++ * If on ground or swimming and can swim ++ */ + private boolean canNavigate() { + return this.theEntity.onGround || this.canSwim && this.isInFluid(); + } + ++ /** ++ * Returns true if the entity is in water or lava, false otherwise ++ */ + private boolean isInFluid() { + return this.theEntity.isInWater() || this.theEntity.handleLavaMovement(); + } + ++ /** ++ * Trims path data from the end to the first sun covered block ++ */ + private void removeSunnyPath() { +- if(!this.worldObj.canBlockSeeTheSky(MathHelper.floor_double(this.theEntity.posX), (int)(this.theEntity.boundingBox.minY + 0.5D), MathHelper.floor_double(this.theEntity.posZ))) { +- for(int var1 = 0; var1 < this.currentPath.getCurrentPathLength(); ++var1) { ++ if (!this.worldObj.canBlockSeeTheSky(MathHelper.floor_double(this.theEntity.posX), (int)(this.theEntity.boundingBox.minY + 0.5D), MathHelper.floor_double(this.theEntity.posZ))) { ++ for (int var1 = 0; var1 < this.currentPath.getCurrentPathLength(); ++var1) { + PathPoint var2 = this.currentPath.getPathPointFromIndex(var1); +- if(this.worldObj.canBlockSeeTheSky(var2.xCoord, var2.yCoord, var2.zCoord)) { ++ ++ if (this.worldObj.canBlockSeeTheSky(var2.xCoord, var2.yCoord, var2.zCoord)) { + this.currentPath.setCurrentPathLength(var1 - 1); + return; + } + } +- + } + } + +- private boolean isDirectPathBetweenPoints(Vec3 var1, Vec3 var2, int var3, int var4, int var5) { +- int var6 = MathHelper.floor_double(var1.xCoord); +- int var7 = MathHelper.floor_double(var1.zCoord); +- double var8 = var2.xCoord - var1.xCoord; +- double var10 = var2.zCoord - var1.zCoord; ++ /** ++ * Returns true when an entity of specified size could safely walk in a straight line between the two points. Args: ++ * pos1, pos2, entityXSize, entityYSize, entityZSize ++ */ ++ private boolean isDirectPathBetweenPoints(Vec3 par1Vec3, Vec3 par2Vec3, int par3, int par4, int par5) { ++ int var6 = MathHelper.floor_double(par1Vec3.xCoord); ++ int var7 = MathHelper.floor_double(par1Vec3.zCoord); ++ double var8 = par2Vec3.xCoord - par1Vec3.xCoord; ++ double var10 = par2Vec3.zCoord - par1Vec3.zCoord; + double var12 = var8 * var8 + var10 * var10; +- if(var12 < 1.0E-8D) { ++ ++ if (var12 < 1.0E-8D) { + return false; + } else { + double var14 = 1.0D / Math.sqrt(var12); + var8 *= var14; + var10 *= var14; +- var3 += 2; +- var5 += 2; +- if(!this.isSafeToStandAt(var6, (int)var1.yCoord, var7, var3, var4, var5, var1, var8, var10)) { ++ par3 += 2; ++ par5 += 2; ++ ++ if (!this.isSafeToStandAt(var6, (int)par1Vec3.yCoord, var7, par3, par4, par5, par1Vec3, var8, var10)) { + return false; + } else { +- var3 -= 2; +- var5 -= 2; ++ par3 -= 2; ++ par5 -= 2; + double var16 = 1.0D / Math.abs(var8); + double var18 = 1.0D / Math.abs(var10); +- double var20 = (double)(var6 * 1) - var1.xCoord; +- double var22 = (double)(var7 * 1) - var1.zCoord; +- if(var8 >= 0.0D) { ++ double var20 = (double)(var6 * 1) - par1Vec3.xCoord; ++ double var22 = (double)(var7 * 1) - par1Vec3.zCoord; ++ ++ if (var8 >= 0.0D) { + ++var20; + } + +- if(var10 >= 0.0D) { ++ if (var10 >= 0.0D) { + ++var22; + } + +@@ -256,17 +345,17 @@ + var22 /= var10; + int var24 = var8 < 0.0D ? -1 : 1; + int var25 = var10 < 0.0D ? -1 : 1; +- int var26 = MathHelper.floor_double(var2.xCoord); +- int var27 = MathHelper.floor_double(var2.zCoord); ++ int var26 = MathHelper.floor_double(par2Vec3.xCoord); ++ int var27 = MathHelper.floor_double(par2Vec3.zCoord); + int var28 = var26 - var6; + int var29 = var27 - var7; + + do { +- if(var28 * var24 <= 0 && var29 * var25 <= 0) { ++ if (var28 * var24 <= 0 && var29 * var25 <= 0) { + return true; + } + +- if(var20 < var22) { ++ if (var20 < var22) { + var20 += var16; + var6 += var24; + var28 = var26 - var6; +@@ -275,35 +364,43 @@ + var7 += var25; + var29 = var27 - var7; + } +- } while(this.isSafeToStandAt(var6, (int)var1.yCoord, var7, var3, var4, var5, var1, var8, var10)); ++ } while (this.isSafeToStandAt(var6, (int)par1Vec3.yCoord, var7, par3, par4, par5, par1Vec3, var8, var10)); + + return false; + } + } + } + +- private boolean isSafeToStandAt(int var1, int var2, int var3, int var4, int var5, int var6, Vec3 var7, double var8, double var10) { +- int var12 = var1 - var4 / 2; +- int var13 = var3 - var6 / 2; +- if(!this.isPositionClear(var12, var2, var13, var4, var5, var6, var7, var8, var10)) { ++ /** ++ * Returns true when an entity could stand at a position, including solid blocks under the entire entity. Args: ++ * xOffset, yOffset, zOffset, entityXSize, entityYSize, entityZSize, originPosition, vecX, vecZ ++ */ ++ private boolean isSafeToStandAt(int par1, int par2, int par3, int par4, int par5, int par6, Vec3 par7Vec3, double par8, double par10) { ++ int var12 = par1 - par4 / 2; ++ int var13 = par3 - par6 / 2; ++ ++ if (!this.isPositionClear(var12, par2, var13, par4, par5, par6, par7Vec3, par8, par10)) { + return false; + } else { +- for(int var14 = var12; var14 < var12 + var4; ++var14) { +- for(int var15 = var13; var15 < var13 + var6; ++var15) { +- double var16 = (double)var14 + 0.5D - var7.xCoord; +- double var18 = (double)var15 + 0.5D - var7.zCoord; +- if(var16 * var8 + var18 * var10 >= 0.0D) { +- int var20 = this.worldObj.getBlockId(var14, var2 - 1, var15); +- if(var20 <= 0) { ++ for (int var14 = var12; var14 < var12 + par4; ++var14) { ++ for (int var15 = var13; var15 < var13 + par6; ++var15) { ++ double var16 = (double)var14 + 0.5D - par7Vec3.xCoord; ++ double var18 = (double)var15 + 0.5D - par7Vec3.zCoord; ++ ++ if (var16 * par8 + var18 * par10 >= 0.0D) { ++ int var20 = this.worldObj.getBlockId(var14, par2 - 1, var15); ++ ++ if (var20 <= 0) { + return false; + } + + Material var21 = Block.blocksList[var20].blockMaterial; +- if(var21 == Material.water && !this.theEntity.isInWater()) { ++ ++ if (var21 == Material.water && !this.theEntity.isInWater()) { + return false; + } + +- if(var21 == Material.lava) { ++ if (var21 == Material.lava) { + return false; + } + } +@@ -314,15 +411,21 @@ + } + } + +- private boolean isPositionClear(int var1, int var2, int var3, int var4, int var5, int var6, Vec3 var7, double var8, double var10) { +- for(int var12 = var1; var12 < var1 + var4; ++var12) { +- for(int var13 = var2; var13 < var2 + var5; ++var13) { +- for(int var14 = var3; var14 < var3 + var6; ++var14) { +- double var15 = (double)var12 + 0.5D - var7.xCoord; +- double var17 = (double)var14 + 0.5D - var7.zCoord; +- if(var15 * var8 + var17 * var10 >= 0.0D) { ++ /** ++ * Returns true if an entity does not collide with any solid blocks at the position. Args: xOffset, yOffset, zOffset, ++ * entityXSize, entityYSize, entityZSize, originPosition, vecX, vecZ ++ */ ++ private boolean isPositionClear(int par1, int par2, int par3, int par4, int par5, int par6, Vec3 par7Vec3, double par8, double par10) { ++ for (int var12 = par1; var12 < par1 + par4; ++var12) { ++ for (int var13 = par2; var13 < par2 + par5; ++var13) { ++ for (int var14 = par3; var14 < par3 + par6; ++var14) { ++ double var15 = (double)var12 + 0.5D - par7Vec3.xCoord; ++ double var17 = (double)var14 + 0.5D - par7Vec3.zCoord; ++ ++ if (var15 * par8 + var17 * par10 >= 0.0D) { + int var19 = this.worldObj.getBlockId(var12, var13, var14); +- if(var19 > 0 && !Block.blocksList[var19].getBlocksMovement(this.worldObj, var12, var13, var14)) { ++ ++ if (var19 > 0 && !Block.blocksList[var19].getBlocksMovement(this.worldObj, var12, var13, var14)) { + return false; + } + } diff --git a/patches/net/minecraft/src/PathPoint.java.patch b/patches/net/minecraft/src/PathPoint.java.patch new file mode 100644 index 0000000..833edf2 --- /dev/null +++ b/patches/net/minecraft/src/PathPoint.java.patch @@ -0,0 +1,105 @@ +--- net/minecraft/src/PathPoint.java ++++ net/minecraft/src/PathPoint.java +@@ -1,47 +1,70 @@ + package net.minecraft.src; + + public class PathPoint { ++ ++ /** The x coordinate of this point */ + public final int xCoord; ++ ++ /** The y coordinate of this point */ + public final int yCoord; ++ ++ /** The z coordinate of this point */ + public final int zCoord; ++ ++ /** A hash of the coordinates used to identify this point */ + private final int hash; ++ ++ /** The index of this point in its assigned path */ + int index = -1; ++ ++ /** The distance along the path to this point */ + float totalPathDistance; ++ ++ /** The linear distance to the next point */ + float distanceToNext; ++ ++ /** The distance to the target */ + float distanceToTarget; ++ ++ /** The point preceding this in its assigned path */ + PathPoint previous; ++ ++ /** Indicates this is the origin */ + public boolean isFirst; + +- public PathPoint(int var1, int var2, int var3) { +- this.xCoord = var1; +- this.yCoord = var2; +- this.zCoord = var3; +- this.hash = makeHash(var1, var2, var3); +- } +- +- public static int makeHash(int var0, int var1, int var2) { +- return var1 & 255 | (var0 & Short.MAX_VALUE) << 8 | (var2 & Short.MAX_VALUE) << 24 | (var0 < 0 ? Integer.MIN_VALUE : 0) | (var2 < 0 ? -Short.MIN_VALUE : 0); +- } +- +- public float distanceTo(PathPoint var1) { +- float var2 = (float)(var1.xCoord - this.xCoord); +- float var3 = (float)(var1.yCoord - this.yCoord); +- float var4 = (float)(var1.zCoord - this.zCoord); ++ public PathPoint(int par1, int par2, int par3) { ++ this.xCoord = par1; ++ this.yCoord = par2; ++ this.zCoord = par3; ++ this.hash = makeHash(par1, par2, par3); ++ } ++ ++ public static int makeHash(int par0, int par1, int par2) { ++ return par1 & 255 | (par0 & 32767) << 8 | (par2 & 32767) << 24 | (par0 < 0 ? Integer.MIN_VALUE : 0) | (par2 < 0 ? 32768 : 0); ++ } ++ ++ /** ++ * Returns the linear distance to another path point ++ */ ++ public float distanceTo(PathPoint par1PathPoint) { ++ float var2 = (float)(par1PathPoint.xCoord - this.xCoord); ++ float var3 = (float)(par1PathPoint.yCoord - this.yCoord); ++ float var4 = (float)(par1PathPoint.zCoord - this.zCoord); + return MathHelper.sqrt_float(var2 * var2 + var3 * var3 + var4 * var4); + } + +- public float func_75832_b(PathPoint var1) { +- float var2 = (float)(var1.xCoord - this.xCoord); +- float var3 = (float)(var1.yCoord - this.yCoord); +- float var4 = (float)(var1.zCoord - this.zCoord); ++ public float func_75832_b(PathPoint par1PathPoint) { ++ float var2 = (float)(par1PathPoint.xCoord - this.xCoord); ++ float var3 = (float)(par1PathPoint.yCoord - this.yCoord); ++ float var4 = (float)(par1PathPoint.zCoord - this.zCoord); + return var2 * var2 + var3 * var3 + var4 * var4; + } + +- public boolean equals(Object var1) { +- if(!(var1 instanceof PathPoint)) { ++ public boolean equals(Object par1Obj) { ++ if (!(par1Obj instanceof PathPoint)) { + return false; + } else { +- PathPoint var2 = (PathPoint)var1; ++ PathPoint var2 = (PathPoint)par1Obj; + return this.hash == var2.hash && this.xCoord == var2.xCoord && this.yCoord == var2.yCoord && this.zCoord == var2.zCoord; + } + } +@@ -50,6 +73,9 @@ + return this.hash; + } + ++ /** ++ * Returns true if this point has already been assigned to a path ++ */ + public boolean isAssigned() { + return this.index >= 0; + } diff --git a/patches/net/minecraft/src/PendingInvite.java.patch b/patches/net/minecraft/src/PendingInvite.java.patch new file mode 100644 index 0000000..7e14e84 --- /dev/null +++ b/patches/net/minecraft/src/PendingInvite.java.patch @@ -0,0 +1,29 @@ +--- net/minecraft/src/PendingInvite.java ++++ net/minecraft/src/PendingInvite.java +@@ -3,18 +3,19 @@ + import argo.jdom.JsonNode; + + public class PendingInvite extends ValueObject { +- public String a; +- public String b; +- public String c; ++ public String field_130094_a; ++ public String field_130092_b; ++ public String field_130093_c; + +- public static PendingInvite func_130091_a(JsonNode var0) { ++ public static PendingInvite func_130091_a(JsonNode par0JsonNode) { + PendingInvite var1 = new PendingInvite(); + + try { +- var1.a = var0.getStringValue(new Object[]{"invitationId"}); +- var1.b = var0.getStringValue(new Object[]{"worldName"}); +- var1.c = var0.getStringValue(new Object[]{"worldOwnerName"}); ++ var1.field_130094_a = par0JsonNode.getStringValue(new Object[] {"invitationId"}); ++ var1.field_130092_b = par0JsonNode.getStringValue(new Object[] {"worldName"}); ++ var1.field_130093_c = par0JsonNode.getStringValue(new Object[] {"worldOwnerName"}); + } catch (Exception var3) { ++ ; + } + + return var1; diff --git a/patches/net/minecraft/src/PendingInvitesList.java.patch b/patches/net/minecraft/src/PendingInvitesList.java.patch new file mode 100644 index 0000000..3bb82b6 --- /dev/null +++ b/patches/net/minecraft/src/PendingInvitesList.java.patch @@ -0,0 +1,35 @@ +--- net/minecraft/src/PendingInvitesList.java ++++ net/minecraft/src/PendingInvitesList.java +@@ -9,22 +9,24 @@ + import java.util.List; + + public class PendingInvitesList extends ValueObject { +- public List a = Lists.newArrayList(); ++ public List field_130096_a = Lists.newArrayList(); + +- public static PendingInvitesList func_130095_a(String var0) { ++ public static PendingInvitesList func_130095_a(String par0Str) { + PendingInvitesList var1 = new PendingInvitesList(); + + try { +- JsonRootNode var2 = (new JdomParser()).parse(var0); +- if(var2.isArrayNode(new Object[]{"invites"})) { +- Iterator var3 = var2.getArrayNode(new Object[]{"invites"}).iterator(); +- +- while(var3.hasNext()) { ++ JsonRootNode var2 = (new JdomParser()).parse(par0Str); ++ ++ if (var2.isArrayNode(new Object[] {"invites"})) { ++ Iterator var3 = var2.getArrayNode(new Object[] {"invites"}).iterator(); ++ ++ while (var3.hasNext()) { + JsonNode var4 = (JsonNode)var3.next(); +- var1.a.add(PendingInvite.func_130091_a(var4)); ++ var1.field_130096_a.add(PendingInvite.func_130091_a(var4)); + } + } + } catch (InvalidSyntaxException var5) { ++ ; + } + + return var1; diff --git a/patches/net/minecraft/src/PlayerCapabilities.java.patch b/patches/net/minecraft/src/PlayerCapabilities.java.patch new file mode 100644 index 0000000..654756b --- /dev/null +++ b/patches/net/minecraft/src/PlayerCapabilities.java.patch @@ -0,0 +1,84 @@ +--- net/minecraft/src/PlayerCapabilities.java ++++ net/minecraft/src/PlayerCapabilities.java +@@ -1,15 +1,27 @@ + package net.minecraft.src; + + public class PlayerCapabilities { ++ ++ /** Disables player damage. */ + public boolean disableDamage; ++ ++ /** Sets/indicates whether the player is flying. */ + public boolean isFlying; ++ ++ /** whether or not to allow the player to fly when they double jump. */ + public boolean allowFlying; ++ ++ /** ++ * Used to determine if creative mode is enabled, and therefore if items should be depleted on usage ++ */ + public boolean isCreativeMode; ++ ++ /** Indicates whether the player is allowed to modify the surroundings */ + public boolean allowEdit = true; + private float flySpeed = 0.05F; + private float walkSpeed = 0.1F; + +- public void writeCapabilitiesToNBT(NBTTagCompound var1) { ++ public void writeCapabilitiesToNBT(NBTTagCompound par1NBTTagCompound) { + NBTTagCompound var2 = new NBTTagCompound(); + var2.setBoolean("invulnerable", this.disableDamage); + var2.setBoolean("flying", this.isFlying); +@@ -18,41 +30,41 @@ + var2.setBoolean("mayBuild", this.allowEdit); + var2.setFloat("flySpeed", this.flySpeed); + var2.setFloat("walkSpeed", this.walkSpeed); +- var1.setTag("abilities", var2); ++ par1NBTTagCompound.setTag("abilities", var2); + } + +- public void readCapabilitiesFromNBT(NBTTagCompound var1) { +- if(var1.hasKey("abilities")) { +- NBTTagCompound var2 = var1.getCompoundTag("abilities"); ++ public void readCapabilitiesFromNBT(NBTTagCompound par1NBTTagCompound) { ++ if (par1NBTTagCompound.hasKey("abilities")) { ++ NBTTagCompound var2 = par1NBTTagCompound.getCompoundTag("abilities"); + this.disableDamage = var2.getBoolean("invulnerable"); + this.isFlying = var2.getBoolean("flying"); + this.allowFlying = var2.getBoolean("mayfly"); + this.isCreativeMode = var2.getBoolean("instabuild"); +- if(var2.hasKey("flySpeed")) { ++ ++ if (var2.hasKey("flySpeed")) { + this.flySpeed = var2.getFloat("flySpeed"); + this.walkSpeed = var2.getFloat("walkSpeed"); + } + +- if(var2.hasKey("mayBuild")) { ++ if (var2.hasKey("mayBuild")) { + this.allowEdit = var2.getBoolean("mayBuild"); + } + } +- + } + + public float getFlySpeed() { + return this.flySpeed; + } + +- public void setFlySpeed(float var1) { +- this.flySpeed = var1; ++ public void setFlySpeed(float par1) { ++ this.flySpeed = par1; + } + + public float getWalkSpeed() { + return this.walkSpeed; + } + +- public void setPlayerWalkSpeed(float var1) { +- this.walkSpeed = var1; ++ public void setPlayerWalkSpeed(float par1) { ++ this.walkSpeed = par1; + } + } diff --git a/patches/net/minecraft/src/PlayerControllerMP.java.patch b/patches/net/minecraft/src/PlayerControllerMP.java.patch new file mode 100644 index 0000000..a9470e5 --- /dev/null +++ b/patches/net/minecraft/src/PlayerControllerMP.java.patch @@ -0,0 +1,562 @@ +--- net/minecraft/src/PlayerControllerMP.java ++++ net/minecraft/src/PlayerControllerMP.java +@@ -1,76 +1,126 @@ + package net.minecraft.src; + + public class PlayerControllerMP { ++ ++ /** The Minecraft instance. */ + private final Minecraft mc; + private final NetClientHandler netClientHandler; ++ ++ /** PosX of the current block being destroyed */ + private int currentBlockX = -1; ++ ++ /** PosY of the current block being destroyed */ + private int currentBlockY = -1; ++ ++ /** PosZ of the current block being destroyed */ + private int currentblockZ = -1; + private ItemStack field_85183_f; ++ ++ /** Current block damage (MP) */ + private float curBlockDamageMP; ++ ++ /** ++ * Tick counter, when it hits 4 it resets back to 0 and plays the step sound ++ */ + private float stepSoundTickCounter; ++ ++ /** ++ * Delays the first damage on the block after the first click on the block ++ */ + private int blockHitDelay; ++ ++ /** Tells if the player is hitting a block */ + private boolean isHittingBlock; +- private EnumGameType currentGameType = EnumGameType.SURVIVAL; ++ ++ /** Current game type for the player */ ++ private EnumGameType currentGameType; ++ ++ /** Index of the current item held by the player in the inventory hotbar */ + private int currentPlayerItem; + +- public PlayerControllerMP(Minecraft var1, NetClientHandler var2) { +- this.mc = var1; +- this.netClientHandler = var2; ++ public PlayerControllerMP(Minecraft par1Minecraft, NetClientHandler par2NetClientHandler) { ++ this.currentGameType = EnumGameType.SURVIVAL; ++ this.mc = par1Minecraft; ++ this.netClientHandler = par2NetClientHandler; + } + +- public static void clickBlockCreative(Minecraft var0, PlayerControllerMP var1, int var2, int var3, int var4, int var5) { +- if(!var0.theWorld.extinguishFire(var0.thePlayer, var2, var3, var4, var5)) { +- var1.onPlayerDestroyBlock(var2, var3, var4, var5); ++ /** ++ * Block dig operation in creative mode (instantly digs the block). ++ */ ++ public static void clickBlockCreative(Minecraft par0Minecraft, PlayerControllerMP par1PlayerControllerMP, int par2, int par3, int par4, int par5) { ++ if (!par0Minecraft.theWorld.extinguishFire(par0Minecraft.thePlayer, par2, par3, par4, par5)) { ++ par1PlayerControllerMP.onPlayerDestroyBlock(par2, par3, par4, par5); + } +- +- } +- +- public void setPlayerCapabilities(EntityPlayer var1) { +- this.currentGameType.configurePlayerCapabilities(var1.capabilities); +- } +- ++ } ++ ++ /** ++ * Sets player capabilities depending on current gametype. params: player ++ */ ++ public void setPlayerCapabilities(EntityPlayer par1EntityPlayer) { ++ this.currentGameType.configurePlayerCapabilities(par1EntityPlayer.capabilities); ++ } ++ ++ /** ++ * If modified to return true, the player spins around slowly around (0, 68.5, 0). The GUI is disabled, the view is set ++ * to first person, and both chat and menu are disabled. Unless the server is modified to ignore illegal stances, ++ * attempting to enter a world at all will result in an immediate kick due to an illegal stance. Appears to be left- ++ * over debug, or demo code. ++ */ + public boolean enableEverythingIsScrewedUpMode() { + return false; + } + +- public void setGameType(EnumGameType var1) { +- this.currentGameType = var1; ++ /** ++ * Sets the game type for the player. ++ */ ++ public void setGameType(EnumGameType par1EnumGameType) { ++ this.currentGameType = par1EnumGameType; + this.currentGameType.configurePlayerCapabilities(this.mc.thePlayer.capabilities); + } + +- public void flipPlayer(EntityPlayer var1) { +- var1.rotationYaw = -180.0F; ++ /** ++ * Flips the player around. Args: player ++ */ ++ public void flipPlayer(EntityPlayer par1EntityPlayer) { ++ par1EntityPlayer.rotationYaw = -180.0F; + } + + public boolean shouldDrawHUD() { + return this.currentGameType.isSurvivalOrAdventure(); + } + +- public boolean onPlayerDestroyBlock(int var1, int var2, int var3, int var4) { +- if(this.currentGameType.isAdventure() && !this.mc.thePlayer.isCurrentToolAdventureModeExempt(var1, var2, var3)) { ++ /** ++ * Called when a player completes the destruction of a block ++ */ ++ public boolean onPlayerDestroyBlock(int par1, int par2, int par3, int par4) { ++ if (this.currentGameType.isAdventure() && !this.mc.thePlayer.isCurrentToolAdventureModeExempt(par1, par2, par3)) { + return false; +- } else if(this.currentGameType.isCreative() && this.mc.thePlayer.getHeldItem() != null && this.mc.thePlayer.getHeldItem().getItem() instanceof ItemSword) { ++ } else if (this.currentGameType.isCreative() && this.mc.thePlayer.getHeldItem() != null && this.mc.thePlayer.getHeldItem().getItem() instanceof ItemSword) { + return false; + } else { + WorldClient var5 = this.mc.theWorld; +- Block var6 = Block.blocksList[var5.getBlockId(var1, var2, var3)]; +- if(var6 == null) { ++ Block var6 = Block.blocksList[var5.getBlockId(par1, par2, par3)]; ++ ++ if (var6 == null) { + return false; + } else { +- var5.playAuxSFX(2001, var1, var2, var3, var6.blockID + (var5.getBlockMetadata(var1, var2, var3) << 12)); +- int var7 = var5.getBlockMetadata(var1, var2, var3); +- boolean var8 = var5.setBlockToAir(var1, var2, var3); +- if(var8) { +- var6.onBlockDestroyedByPlayer(var5, var1, var2, var3, var7); ++ var5.playAuxSFX(2001, par1, par2, par3, var6.blockID + (var5.getBlockMetadata(par1, par2, par3) << 12)); ++ int var7 = var5.getBlockMetadata(par1, par2, par3); ++ boolean var8 = var5.setBlockToAir(par1, par2, par3); ++ ++ if (var8) { ++ var6.onBlockDestroyedByPlayer(var5, par1, par2, par3, var7); + } + + this.currentBlockY = -1; +- if(!this.currentGameType.isCreative()) { ++ ++ if (!this.currentGameType.isCreative()) { + ItemStack var9 = this.mc.thePlayer.getCurrentEquippedItem(); +- if(var9 != null) { +- var9.onBlockDestroyed(var5, var6.blockID, var1, var2, var3, this.mc.thePlayer); +- if(var9.stackSize == 0) { ++ ++ if (var9 != null) { ++ var9.onBlockDestroyed(var5, var6.blockID, par1, par2, par3, this.mc.thePlayer); ++ ++ if (var9.stackSize == 0) { + this.mc.thePlayer.destroyCurrentEquippedItem(); + } + } +@@ -81,42 +131,50 @@ + } + } + +- public void clickBlock(int var1, int var2, int var3, int var4) { +- if(!this.currentGameType.isAdventure() || this.mc.thePlayer.isCurrentToolAdventureModeExempt(var1, var2, var3)) { +- if(this.currentGameType.isCreative()) { +- this.netClientHandler.addToSendQueue(new Packet14BlockDig(0, var1, var2, var3, var4)); +- clickBlockCreative(this.mc, this, var1, var2, var3, var4); ++ /** ++ * Called by Minecraft class when the player is hitting a block with an item. Args: x, y, z, side ++ */ ++ public void clickBlock(int par1, int par2, int par3, int par4) { ++ if (!this.currentGameType.isAdventure() || this.mc.thePlayer.isCurrentToolAdventureModeExempt(par1, par2, par3)) { ++ if (this.currentGameType.isCreative()) { ++ this.netClientHandler.addToSendQueue(new Packet14BlockDig(0, par1, par2, par3, par4)); ++ clickBlockCreative(this.mc, this, par1, par2, par3, par4); + this.blockHitDelay = 5; +- } else if(!this.isHittingBlock || !this.sameToolAndBlock(var1, var2, var3)) { +- if(this.isHittingBlock) { +- this.netClientHandler.addToSendQueue(new Packet14BlockDig(1, this.currentBlockX, this.currentBlockY, this.currentblockZ, var4)); +- } +- +- this.netClientHandler.addToSendQueue(new Packet14BlockDig(0, var1, var2, var3, var4)); +- int var5 = this.mc.theWorld.getBlockId(var1, var2, var3); +- if(var5 > 0 && this.curBlockDamageMP == 0.0F) { +- Block.blocksList[var5].onBlockClicked(this.mc.theWorld, var1, var2, var3, this.mc.thePlayer); +- } +- +- if(var5 > 0 && Block.blocksList[var5].getPlayerRelativeBlockHardness(this.mc.thePlayer, this.mc.thePlayer.worldObj, var1, var2, var3) >= 1.0F) { +- this.onPlayerDestroyBlock(var1, var2, var3, var4); ++ } else if (!this.isHittingBlock || !this.sameToolAndBlock(par1, par2, par3)) { ++ if (this.isHittingBlock) { ++ this.netClientHandler.addToSendQueue(new Packet14BlockDig(1, this.currentBlockX, this.currentBlockY, this.currentblockZ, par4)); ++ } ++ ++ this.netClientHandler.addToSendQueue(new Packet14BlockDig(0, par1, par2, par3, par4)); ++ int var5 = this.mc.theWorld.getBlockId(par1, par2, par3); ++ ++ if (var5 > 0 && this.curBlockDamageMP == 0.0F) { ++ Block.blocksList[var5].onBlockClicked(this.mc.theWorld, par1, par2, par3, this.mc.thePlayer); ++ } ++ ++ // Spout Start ++ if (var5 > 0 && Block.blocksList[var5].getPlayerRelativeBlockHardness(this.mc.thePlayer) >= 1.0F) { ++ // Spout End ++ this.onPlayerDestroyBlock(par1, par2, par3, par4); + } else { + this.isHittingBlock = true; +- this.currentBlockX = var1; +- this.currentBlockY = var2; +- this.currentblockZ = var3; ++ this.currentBlockX = par1; ++ this.currentBlockY = par2; ++ this.currentblockZ = par3; + this.field_85183_f = this.mc.thePlayer.getHeldItem(); + this.curBlockDamageMP = 0.0F; + this.stepSoundTickCounter = 0.0F; + this.mc.theWorld.destroyBlockInWorldPartially(this.mc.thePlayer.entityId, this.currentBlockX, this.currentBlockY, this.currentblockZ, (int)(this.curBlockDamageMP * 10.0F) - 1); + } + } +- + } + } + ++ /** ++ * Resets current block damage and isHittingBlock ++ */ + public void resetBlockRemoving() { +- if(this.isHittingBlock) { ++ if (this.isHittingBlock) { + this.netClientHandler.addToSendQueue(new Packet14BlockDig(1, this.currentBlockX, this.currentBlockY, this.currentblockZ, -1)); + } + +@@ -125,33 +183,42 @@ + this.mc.theWorld.destroyBlockInWorldPartially(this.mc.thePlayer.entityId, this.currentBlockX, this.currentBlockY, this.currentblockZ, -1); + } + +- public void onPlayerDamageBlock(int var1, int var2, int var3, int var4) { ++ /** ++ * Called when a player damages a block and updates damage counters ++ */ ++ public void onPlayerDamageBlock(int par1, int par2, int par3, int par4) { + this.syncCurrentPlayItem(); +- if(this.blockHitDelay > 0) { ++ ++ if (this.blockHitDelay > 0) { + --this.blockHitDelay; +- } else if(this.currentGameType.isCreative()) { ++ } else if (this.currentGameType.isCreative()) { + this.blockHitDelay = 5; +- this.netClientHandler.addToSendQueue(new Packet14BlockDig(0, var1, var2, var3, var4)); +- clickBlockCreative(this.mc, this, var1, var2, var3, var4); ++ this.netClientHandler.addToSendQueue(new Packet14BlockDig(0, par1, par2, par3, par4)); ++ clickBlockCreative(this.mc, this, par1, par2, par3, par4); + } else { +- if(this.sameToolAndBlock(var1, var2, var3)) { +- int var5 = this.mc.theWorld.getBlockId(var1, var2, var3); +- if(var5 == 0) { ++ if (this.sameToolAndBlock(par1, par2, par3)) { ++ int var5 = this.mc.theWorld.getBlockId(par1, par2, par3); ++ ++ if (var5 == 0) { + this.isHittingBlock = false; + return; + } + + Block var6 = Block.blocksList[var5]; +- this.curBlockDamageMP += var6.getPlayerRelativeBlockHardness(this.mc.thePlayer, this.mc.thePlayer.worldObj, var1, var2, var3); +- if(this.stepSoundTickCounter % 4.0F == 0.0F && var6 != null) { +- this.mc.sndManager.playSound(var6.stepSound.getStepSound(), (float)var1 + 0.5F, (float)var2 + 0.5F, (float)var3 + 0.5F, (var6.stepSound.getVolume() + 1.0F) / 8.0F, var6.stepSound.getPitch() * 0.5F); ++ // Spout Start ++ this.curBlockDamageMP += var6.getPlayerRelativeBlockHardness(this.mc.thePlayer); ++ // Spout End ++ ++ if (this.stepSoundTickCounter % 4.0F == 0.0F && var6 != null) { ++ this.mc.sndManager.playSound(var6.stepSound.getStepSound(), (float)par1 + 0.5F, (float)par2 + 0.5F, (float)par3 + 0.5F, (var6.stepSound.getVolume() + 1.0F) / 8.0F, var6.stepSound.getPitch() * 0.5F); + } + + ++this.stepSoundTickCounter; +- if(this.curBlockDamageMP >= 1.0F) { ++ ++ if (this.curBlockDamageMP >= 1.0F) { + this.isHittingBlock = false; +- this.netClientHandler.addToSendQueue(new Packet14BlockDig(2, var1, var2, var3, var4)); +- this.onPlayerDestroyBlock(var1, var2, var3, var4); ++ this.netClientHandler.addToSendQueue(new Packet14BlockDig(2, par1, par2, par3, par4)); ++ this.onPlayerDestroyBlock(par1, par2, par3, par4); + this.curBlockDamageMP = 0.0F; + this.stepSoundTickCounter = 0.0F; + this.blockHitDelay = 5; +@@ -159,12 +226,14 @@ + + this.mc.theWorld.destroyBlockInWorldPartially(this.mc.thePlayer.entityId, this.currentBlockX, this.currentBlockY, this.currentblockZ, (int)(this.curBlockDamageMP * 10.0F) - 1); + } else { +- this.clickBlock(var1, var2, var3, var4); ++ this.clickBlock(par1, par2, par3, par4); + } +- + } + } + ++ /** ++ * player reach distance = 4F ++ */ + public float getBlockReachDistance() { + return this.currentGameType.isCreative() ? 5.0F : 4.5F; + } +@@ -174,143 +243,176 @@ + this.mc.sndManager.playRandomMusicIfReady(); + } + +- private boolean sameToolAndBlock(int var1, int var2, int var3) { ++ private boolean sameToolAndBlock(int par1, int par2, int par3) { + ItemStack var4 = this.mc.thePlayer.getHeldItem(); + boolean var5 = this.field_85183_f == null && var4 == null; +- if(this.field_85183_f != null && var4 != null) { ++ ++ if (this.field_85183_f != null && var4 != null) { + var5 = var4.itemID == this.field_85183_f.itemID && ItemStack.areItemStackTagsEqual(var4, this.field_85183_f) && (var4.isItemStackDamageable() || var4.getItemDamage() == this.field_85183_f.getItemDamage()); + } + +- return var1 == this.currentBlockX && var2 == this.currentBlockY && var3 == this.currentblockZ && var5; ++ return par1 == this.currentBlockX && par2 == this.currentBlockY && par3 == this.currentblockZ && var5; + } + ++ /** ++ * Syncs the current player item with the server ++ */ + private void syncCurrentPlayItem() { + int var1 = this.mc.thePlayer.inventory.currentItem; +- if(var1 != this.currentPlayerItem) { ++ ++ if (var1 != this.currentPlayerItem) { + this.currentPlayerItem = var1; + this.netClientHandler.addToSendQueue(new Packet16BlockItemSwitch(this.currentPlayerItem)); + } +- + } + +- public boolean onPlayerRightClick(EntityPlayer var1, World var2, ItemStack var3, int var4, int var5, int var6, int var7, Vec3 var8) { ++ /** ++ * Handles a players right click. Args: player, world, x, y, z, side, hitVec ++ */ ++ public boolean onPlayerRightClick(EntityPlayer par1EntityPlayer, World par2World, ItemStack par3ItemStack, int par4, int par5, int par6, int par7, Vec3 par8Vec3) { + this.syncCurrentPlayItem(); +- float var9 = (float)var8.xCoord - (float)var4; +- float var10 = (float)var8.yCoord - (float)var5; +- float var11 = (float)var8.zCoord - (float)var6; ++ float var9 = (float)par8Vec3.xCoord - (float)par4; ++ float var10 = (float)par8Vec3.yCoord - (float)par5; ++ float var11 = (float)par8Vec3.zCoord - (float)par6; + boolean var12 = false; + int var13; +- if(!var1.isSneaking() || var1.getHeldItem() == null) { +- var13 = var2.getBlockId(var4, var5, var6); +- if(var13 > 0 && Block.blocksList[var13].onBlockActivated(var2, var4, var5, var6, var1, var7, var9, var10, var11)) { ++ ++ if (!par1EntityPlayer.isSneaking() || par1EntityPlayer.getHeldItem() == null) { ++ var13 = par2World.getBlockId(par4, par5, par6); ++ ++ if (var13 > 0 && Block.blocksList[var13].onBlockActivated(par2World, par4, par5, par6, par1EntityPlayer, par7, var9, var10, var11)) { + var12 = true; + } + } + +- if(!var12 && var3 != null && var3.getItem() instanceof ItemBlock) { +- ItemBlock var16 = (ItemBlock)var3.getItem(); +- if(!var16.canPlaceItemBlockOnSide(var2, var4, var5, var6, var7, var1, var3)) { ++ if (!var12 && par3ItemStack != null && par3ItemStack.getItem() instanceof ItemBlock) { ++ ItemBlock var16 = (ItemBlock)par3ItemStack.getItem(); ++ ++ if (!var16.canPlaceItemBlockOnSide(par2World, par4, par5, par6, par7, par1EntityPlayer, par3ItemStack)) { + return false; + } + } + +- this.netClientHandler.addToSendQueue(new Packet15Place(var4, var5, var6, var7, var1.inventory.getCurrentItem(), var9, var10, var11)); +- if(var12) { ++ this.netClientHandler.addToSendQueue(new Packet15Place(par4, par5, par6, par7, par1EntityPlayer.inventory.getCurrentItem(), var9, var10, var11)); ++ ++ if (var12) { + return true; +- } else if(var3 == null) { ++ } else if (par3ItemStack == null) { + return false; +- } else if(this.currentGameType.isCreative()) { +- var13 = var3.getItemDamage(); +- int var14 = var3.stackSize; +- boolean var15 = var3.tryPlaceItemIntoWorld(var1, var2, var4, var5, var6, var7, var9, var10, var11); +- var3.setItemDamage(var13); +- var3.stackSize = var14; ++ } else if (this.currentGameType.isCreative()) { ++ var13 = par3ItemStack.getItemDamage(); ++ int var14 = par3ItemStack.stackSize; ++ boolean var15 = par3ItemStack.tryPlaceItemIntoWorld(par1EntityPlayer, par2World, par4, par5, par6, par7, var9, var10, var11); ++ par3ItemStack.setItemDamage(var13); ++ par3ItemStack.stackSize = var14; + return var15; + } else { +- return var3.tryPlaceItemIntoWorld(var1, var2, var4, var5, var6, var7, var9, var10, var11); ++ return par3ItemStack.tryPlaceItemIntoWorld(par1EntityPlayer, par2World, par4, par5, par6, par7, var9, var10, var11); + } + } + +- public boolean sendUseItem(EntityPlayer var1, World var2, ItemStack var3) { ++ /** ++ * Notifies the server of things like consuming food, etc... ++ */ ++ public boolean sendUseItem(EntityPlayer par1EntityPlayer, World par2World, ItemStack par3ItemStack) { + this.syncCurrentPlayItem(); +- this.netClientHandler.addToSendQueue(new Packet15Place(-1, -1, -1, 255, var1.inventory.getCurrentItem(), 0.0F, 0.0F, 0.0F)); +- int var4 = var3.stackSize; +- ItemStack var5 = var3.useItemRightClick(var2, var1); +- if(var5 != var3 || var5 != null && var5.stackSize != var4) { +- var1.inventory.mainInventory[var1.inventory.currentItem] = var5; +- if(var5.stackSize == 0) { +- var1.inventory.mainInventory[var1.inventory.currentItem] = null; ++ this.netClientHandler.addToSendQueue(new Packet15Place(-1, -1, -1, 255, par1EntityPlayer.inventory.getCurrentItem(), 0.0F, 0.0F, 0.0F)); ++ int var4 = par3ItemStack.stackSize; ++ ItemStack var5 = par3ItemStack.useItemRightClick(par2World, par1EntityPlayer); ++ ++ if (var5 == par3ItemStack && (var5 == null || var5.stackSize == var4)) { ++ return false; ++ } else { ++ par1EntityPlayer.inventory.mainInventory[par1EntityPlayer.inventory.currentItem] = var5; ++ ++ if (var5.stackSize == 0) { ++ par1EntityPlayer.inventory.mainInventory[par1EntityPlayer.inventory.currentItem] = null; + } + + return true; +- } else { +- return false; + } + } + +- public EntityClientPlayerMP func_78754_a(World var1) { +- return new EntityClientPlayerMP(this.mc, var1, this.mc.getSession(), this.netClientHandler); +- } +- +- public void attackEntity(EntityPlayer var1, Entity var2) { +- this.syncCurrentPlayItem(); +- this.netClientHandler.addToSendQueue(new Packet7UseEntity(var1.entityId, var2.entityId, 1)); +- var1.attackTargetEntityWithCurrentItem(var2); +- } +- +- public boolean func_78768_b(EntityPlayer var1, Entity var2) { +- this.syncCurrentPlayItem(); +- this.netClientHandler.addToSendQueue(new Packet7UseEntity(var1.entityId, var2.entityId, 0)); +- return var1.interactWith(var2); +- } +- +- public ItemStack windowClick(int var1, int var2, int var3, int var4, EntityPlayer var5) { +- short var6 = var5.openContainer.getNextTransactionID(var5.inventory); +- ItemStack var7 = var5.openContainer.slotClick(var2, var3, var4, var5); +- this.netClientHandler.addToSendQueue(new Packet102WindowClick(var1, var2, var3, var4, var7, var6)); ++ public EntityClientPlayerMP func_78754_a(World par1World) { ++ return new EntityClientPlayerMP(this.mc, par1World, this.mc.getSession(), this.netClientHandler); ++ } ++ ++ /** ++ * Attacks an entity ++ */ ++ public void attackEntity(EntityPlayer par1EntityPlayer, Entity par2Entity) { ++ this.syncCurrentPlayItem(); ++ this.netClientHandler.addToSendQueue(new Packet7UseEntity(par1EntityPlayer.entityId, par2Entity.entityId, 1)); ++ par1EntityPlayer.attackTargetEntityWithCurrentItem(par2Entity); ++ } ++ ++ public boolean func_78768_b(EntityPlayer par1EntityPlayer, Entity par2Entity) { ++ this.syncCurrentPlayItem(); ++ this.netClientHandler.addToSendQueue(new Packet7UseEntity(par1EntityPlayer.entityId, par2Entity.entityId, 0)); ++ return par1EntityPlayer.interactWith(par2Entity); ++ } ++ ++ public ItemStack windowClick(int par1, int par2, int par3, int par4, EntityPlayer par5EntityPlayer) { ++ short var6 = par5EntityPlayer.openContainer.getNextTransactionID(par5EntityPlayer.inventory); ++ ItemStack var7 = par5EntityPlayer.openContainer.slotClick(par2, par3, par4, par5EntityPlayer); ++ this.netClientHandler.addToSendQueue(new Packet102WindowClick(par1, par2, par3, par4, var7, var6)); + return var7; + } + +- public void sendEnchantPacket(int var1, int var2) { +- this.netClientHandler.addToSendQueue(new Packet108EnchantItem(var1, var2)); +- } +- +- public void sendSlotPacket(ItemStack var1, int var2) { +- if(this.currentGameType.isCreative()) { +- this.netClientHandler.addToSendQueue(new Packet107CreativeSetSlot(var2, var1)); +- } +- +- } +- +- public void func_78752_a(ItemStack var1) { +- if(this.currentGameType.isCreative() && var1 != null) { +- this.netClientHandler.addToSendQueue(new Packet107CreativeSetSlot(-1, var1)); +- } +- +- } +- +- public void onStoppedUsingItem(EntityPlayer var1) { ++ /** ++ * GuiEnchantment uses this during multiplayer to tell PlayerControllerMP to send a packet indicating the enchantment ++ * action the player has taken. ++ */ ++ public void sendEnchantPacket(int par1, int par2) { ++ this.netClientHandler.addToSendQueue(new Packet108EnchantItem(par1, par2)); ++ } ++ ++ /** ++ * Used in PlayerControllerMP to update the server with an ItemStack in a slot. ++ */ ++ public void sendSlotPacket(ItemStack par1ItemStack, int par2) { ++ if (this.currentGameType.isCreative()) { ++ this.netClientHandler.addToSendQueue(new Packet107CreativeSetSlot(par2, par1ItemStack)); ++ } ++ } ++ ++ public void func_78752_a(ItemStack par1ItemStack) { ++ if (this.currentGameType.isCreative() && par1ItemStack != null) { ++ this.netClientHandler.addToSendQueue(new Packet107CreativeSetSlot(-1, par1ItemStack)); ++ } ++ } ++ ++ public void onStoppedUsingItem(EntityPlayer par1EntityPlayer) { + this.syncCurrentPlayItem(); + this.netClientHandler.addToSendQueue(new Packet14BlockDig(5, 0, 0, 0, 255)); +- var1.stopUsingItem(); ++ par1EntityPlayer.stopUsingItem(); + } + + public boolean func_78763_f() { + return this.currentGameType.isSurvivalOrAdventure(); + } + ++ /** ++ * Checks if the player is not creative, used for checking if it should break a block instantly ++ */ + public boolean isNotCreative() { + return !this.currentGameType.isCreative(); + } + ++ /** ++ * returns true if player is in creative mode ++ */ + public boolean isInCreativeMode() { + return this.currentGameType.isCreative(); + } + ++ /** ++ * true for hitting entities far away. ++ */ + public boolean extendedReach() { + return this.currentGameType.isCreative(); + } +- ++ + public boolean func_110738_j() { + return this.mc.thePlayer.isRiding() && this.mc.thePlayer.ridingEntity instanceof EntityHorse; + } diff --git a/patches/net/minecraft/src/PlayerInstance.java.patch b/patches/net/minecraft/src/PlayerInstance.java.patch new file mode 100644 index 0000000..b91a5dd --- /dev/null +++ b/patches/net/minecraft/src/PlayerInstance.java.patch @@ -0,0 +1,270 @@ +--- net/minecraft/src/PlayerInstance.java ++++ net/minecraft/src/PlayerInstance.java +@@ -4,159 +4,179 @@ + import java.util.List; + + class PlayerInstance { +- private final List b; +- private final ChunkCoordIntPair currentChunk; +- private short[] blocksToUpdate; +- private int numBlocksToUpdate; ++ private final List playersInChunk; ++ ++ /** note: this is final */ ++ private final ChunkCoordIntPair chunkLocation; ++ private short[] locationOfBlockChange; ++ private int numberOfTilesToUpdate; ++ ++ /** ++ * Integer field where each bit means to make update 16x16x16 division of chunk (from bottom). ++ */ + private int flagsYAreasToUpdate; ++ ++ /** time what is using when chunk InhabitedTime is being calculated */ + private long previousWorldTime; ++ + final PlayerManager thePlayerManager; + +- public PlayerInstance(PlayerManager var1, int var2, int var3) { +- this.thePlayerManager = var1; +- this.b = new ArrayList(); +- this.blocksToUpdate = new short[64]; +- this.currentChunk = new ChunkCoordIntPair(var2, var3); +- var1.getMinecraftServer().theChunkProviderServer.loadChunk(var2, var3); ++ public PlayerInstance(PlayerManager par1PlayerManager, int par2, int par3) { ++ this.thePlayerManager = par1PlayerManager; ++ this.playersInChunk = new ArrayList(); ++ this.locationOfBlockChange = new short[64]; ++ this.chunkLocation = new ChunkCoordIntPair(par2, par3); ++ par1PlayerManager.getWorldServer().theChunkProviderServer.loadChunk(par2, par3); + } + +- public void addPlayer(EntityPlayerMP var1) { +- if(this.b.contains(var1)) { +- throw new IllegalStateException("Failed to add player. " + var1 + " already is in chunk " + this.currentChunk.chunkXPos + ", " + this.currentChunk.chunkZPos); ++ public void addPlayer(EntityPlayerMP par1EntityPlayerMP) { ++ if (this.playersInChunk.contains(par1EntityPlayerMP)) { ++ throw new IllegalStateException("Failed to add player. " + par1EntityPlayerMP + " already is in chunk " + this.chunkLocation.chunkXPos + ", " + this.chunkLocation.chunkZPos); + } else { +- if(this.b.isEmpty()) { ++ if (this.playersInChunk.isEmpty()) { + this.previousWorldTime = PlayerManager.getWorldServer(this.thePlayerManager).getTotalWorldTime(); + } + +- this.b.add(var1); +- var1.f.add(this.currentChunk); ++ this.playersInChunk.add(par1EntityPlayerMP); ++ par1EntityPlayerMP.loadedChunks.add(this.chunkLocation); + } + } + +- public void removePlayer(EntityPlayerMP var1) { +- if(this.b.contains(var1)) { +- Chunk var2 = PlayerManager.getWorldServer(this.thePlayerManager).getChunkFromChunkCoords(this.currentChunk.chunkXPos, this.currentChunk.chunkZPos); +- var1.playerNetServerHandler.sendPacket(new Packet51MapChunk(var2, true, 0)); +- this.b.remove(var1); +- var1.f.remove(this.currentChunk); +- if(this.b.isEmpty()) { +- long var3 = (long)this.currentChunk.chunkXPos + 2147483647L | (long)this.currentChunk.chunkZPos + 2147483647L << 32; ++ public void removePlayer(EntityPlayerMP par1EntityPlayerMP) { ++ if (this.playersInChunk.contains(par1EntityPlayerMP)) { ++ Chunk var2 = PlayerManager.getWorldServer(this.thePlayerManager).getChunkFromChunkCoords(this.chunkLocation.chunkXPos, this.chunkLocation.chunkZPos); ++ par1EntityPlayerMP.playerNetServerHandler.sendPacketToPlayer(new Packet51MapChunk(var2, true, 0)); ++ this.playersInChunk.remove(par1EntityPlayerMP); ++ par1EntityPlayerMP.loadedChunks.remove(this.chunkLocation); ++ ++ if (this.playersInChunk.isEmpty()) { ++ long var3 = (long)this.chunkLocation.chunkXPos + 2147483647L | (long)this.chunkLocation.chunkZPos + 2147483647L << 32; + this.increaseInhabitedTime(var2); + PlayerManager.getChunkWatchers(this.thePlayerManager).remove(var3); + PlayerManager.getChunkWatcherList(this.thePlayerManager).remove(this); +- if(this.numBlocksToUpdate > 0) { ++ ++ if (this.numberOfTilesToUpdate > 0) { + PlayerManager.getChunkWatchersWithPlayers(this.thePlayerManager).remove(this); + } + +- this.thePlayerManager.getMinecraftServer().theChunkProviderServer.dropChunk(this.currentChunk.chunkXPos, this.currentChunk.chunkZPos); ++ this.thePlayerManager.getWorldServer().theChunkProviderServer.unloadChunksIfNotNearSpawn(this.chunkLocation.chunkXPos, this.chunkLocation.chunkZPos); + } +- + } + } + ++ /** ++ * This method currently only increases chunk inhabited time. Extension is possible in next versions ++ */ + public void processChunk() { +- this.increaseInhabitedTime(PlayerManager.getWorldServer(this.thePlayerManager).getChunkFromChunkCoords(this.currentChunk.chunkXPos, this.currentChunk.chunkZPos)); ++ this.increaseInhabitedTime(PlayerManager.getWorldServer(this.thePlayerManager).getChunkFromChunkCoords(this.chunkLocation.chunkXPos, this.chunkLocation.chunkZPos)); + } + +- private void increaseInhabitedTime(Chunk var1) { +- var1.inhabitedTime += PlayerManager.getWorldServer(this.thePlayerManager).getTotalWorldTime() - this.previousWorldTime; ++ /** ++ * Increases chunk inhabited time every 8000 ticks ++ */ ++ private void increaseInhabitedTime(Chunk par1Chunk) { ++ par1Chunk.inhabitedTime += PlayerManager.getWorldServer(this.thePlayerManager).getTotalWorldTime() - this.previousWorldTime; + this.previousWorldTime = PlayerManager.getWorldServer(this.thePlayerManager).getTotalWorldTime(); + } + +- public void markBlockNeedsUpdate(int var1, int var2, int var3) { +- if(this.numBlocksToUpdate == 0) { ++ public void flagChunkForUpdate(int par1, int par2, int par3) { ++ if (this.numberOfTilesToUpdate == 0) { + PlayerManager.getChunkWatchersWithPlayers(this.thePlayerManager).add(this); + } + +- this.flagsYAreasToUpdate |= 1 << (var2 >> 4); +- if(this.numBlocksToUpdate < 64) { +- short var4 = (short)(var1 << 12 | var3 << 8 | var2); +- +- for(int var5 = 0; var5 < this.numBlocksToUpdate; ++var5) { +- if(this.blocksToUpdate[var5] == var4) { ++ this.flagsYAreasToUpdate |= 1 << (par2 >> 4); ++ ++ if (this.numberOfTilesToUpdate < 64) { ++ short var4 = (short)(par1 << 12 | par3 << 8 | par2); ++ ++ for (int var5 = 0; var5 < this.numberOfTilesToUpdate; ++var5) { ++ if (this.locationOfBlockChange[var5] == var4) { + return; + } + } + +- this.blocksToUpdate[this.numBlocksToUpdate++] = var4; ++ this.locationOfBlockChange[this.numberOfTilesToUpdate++] = var4; + } +- + } + +- public void sendPacketToPlayersInInstance(Packet var1) { +- for(int var2 = 0; var2 < this.b.size(); ++var2) { +- EntityPlayerMP var3 = (EntityPlayerMP)this.b.get(var2); +- if(!var3.f.contains(this.currentChunk)) { +- var3.playerNetServerHandler.sendPacket(var1); ++ public void sendToAllPlayersWatchingChunk(Packet par1Packet) { ++ for (int var2 = 0; var2 < this.playersInChunk.size(); ++var2) { ++ EntityPlayerMP var3 = (EntityPlayerMP)this.playersInChunk.get(var2); ++ ++ if (!var3.loadedChunks.contains(this.chunkLocation)) { ++ var3.playerNetServerHandler.sendPacketToPlayer(par1Packet); + } + } +- + } + +- public void onUpdate() { +- if(this.numBlocksToUpdate != 0) { ++ public void sendChunkUpdate() { ++ if (this.numberOfTilesToUpdate != 0) { + int var1; + int var2; + int var3; +- if(this.numBlocksToUpdate == 1) { +- var1 = this.currentChunk.chunkXPos * 16 + (this.blocksToUpdate[0] >> 12 & 15); +- var2 = this.blocksToUpdate[0] & 255; +- var3 = this.currentChunk.chunkZPos * 16 + (this.blocksToUpdate[0] >> 8 & 15); +- this.sendPacketToPlayersInInstance(new Packet53BlockChange(var1, var2, var3, PlayerManager.getWorldServer(this.thePlayerManager))); +- if(PlayerManager.getWorldServer(this.thePlayerManager).blockHasTileEntity(var1, var2, var3)) { +- this.updateTileEntity(PlayerManager.getWorldServer(this.thePlayerManager).getBlockTileEntity(var1, var2, var3)); ++ ++ if (this.numberOfTilesToUpdate == 1) { ++ var1 = this.chunkLocation.chunkXPos * 16 + (this.locationOfBlockChange[0] >> 12 & 15); ++ var2 = this.locationOfBlockChange[0] & 255; ++ var3 = this.chunkLocation.chunkZPos * 16 + (this.locationOfBlockChange[0] >> 8 & 15); ++ this.sendToAllPlayersWatchingChunk(new Packet53BlockChange(var1, var2, var3, PlayerManager.getWorldServer(this.thePlayerManager))); ++ ++ if (PlayerManager.getWorldServer(this.thePlayerManager).blockHasTileEntity(var1, var2, var3)) { ++ this.sendTileToAllPlayersWatchingChunk(PlayerManager.getWorldServer(this.thePlayerManager).getBlockTileEntity(var1, var2, var3)); + } + } else { + int var4; +- if(this.numBlocksToUpdate == 64) { +- var1 = this.currentChunk.chunkXPos * 16; +- var2 = this.currentChunk.chunkZPos * 16; +- this.sendPacketToPlayersInInstance(new Packet51MapChunk(PlayerManager.getWorldServer(this.thePlayerManager).getChunkFromChunkCoords(this.currentChunk.chunkXPos, this.currentChunk.chunkZPos), false, this.flagsYAreasToUpdate)); +- +- for(var3 = 0; var3 < 16; ++var3) { +- if((this.flagsYAreasToUpdate & 1 << var3) != 0) { ++ ++ if (this.numberOfTilesToUpdate == 64) { ++ var1 = this.chunkLocation.chunkXPos * 16; ++ var2 = this.chunkLocation.chunkZPos * 16; ++ this.sendToAllPlayersWatchingChunk(new Packet51MapChunk(PlayerManager.getWorldServer(this.thePlayerManager).getChunkFromChunkCoords(this.chunkLocation.chunkXPos, this.chunkLocation.chunkZPos), false, this.flagsYAreasToUpdate)); ++ ++ for (var3 = 0; var3 < 16; ++var3) { ++ if ((this.flagsYAreasToUpdate & 1 << var3) != 0) { + var4 = var3 << 4; +- List var5 = PlayerManager.getWorldServer(this.thePlayerManager).getTileEntityList(var1, var4, var2, var1 + 16, var4 + 16, var2 + 16); ++ List var5 = PlayerManager.getWorldServer(this.thePlayerManager).getAllTileEntityInBox(var1, var4, var2, var1 + 16, var4 + 16, var2 + 16); + +- for(int var6 = 0; var6 < var5.size(); ++var6) { +- this.updateTileEntity((TileEntity)var5.get(var6)); ++ for (int var6 = 0; var6 < var5.size(); ++var6) { ++ this.sendTileToAllPlayersWatchingChunk((TileEntity)var5.get(var6)); + } + } + } + } else { +- this.sendPacketToPlayersInInstance(new Packet52MultiBlockChange(this.currentChunk.chunkXPos, this.currentChunk.chunkZPos, this.blocksToUpdate, this.numBlocksToUpdate, PlayerManager.getWorldServer(this.thePlayerManager))); +- +- for(var1 = 0; var1 < this.numBlocksToUpdate; ++var1) { +- var2 = this.currentChunk.chunkXPos * 16 + (this.blocksToUpdate[var1] >> 12 & 15); +- var3 = this.blocksToUpdate[var1] & 255; +- var4 = this.currentChunk.chunkZPos * 16 + (this.blocksToUpdate[var1] >> 8 & 15); +- if(PlayerManager.getWorldServer(this.thePlayerManager).blockHasTileEntity(var2, var3, var4)) { +- this.updateTileEntity(PlayerManager.getWorldServer(this.thePlayerManager).getBlockTileEntity(var2, var3, var4)); ++ this.sendToAllPlayersWatchingChunk(new Packet52MultiBlockChange(this.chunkLocation.chunkXPos, this.chunkLocation.chunkZPos, this.locationOfBlockChange, this.numberOfTilesToUpdate, PlayerManager.getWorldServer(this.thePlayerManager))); ++ ++ for (var1 = 0; var1 < this.numberOfTilesToUpdate; ++var1) { ++ var2 = this.chunkLocation.chunkXPos * 16 + (this.locationOfBlockChange[var1] >> 12 & 15); ++ var3 = this.locationOfBlockChange[var1] & 255; ++ var4 = this.chunkLocation.chunkZPos * 16 + (this.locationOfBlockChange[var1] >> 8 & 15); ++ ++ if (PlayerManager.getWorldServer(this.thePlayerManager).blockHasTileEntity(var2, var3, var4)) { ++ this.sendTileToAllPlayersWatchingChunk(PlayerManager.getWorldServer(this.thePlayerManager).getBlockTileEntity(var2, var3, var4)); + } + } + } + } + +- this.numBlocksToUpdate = 0; ++ this.numberOfTilesToUpdate = 0; + this.flagsYAreasToUpdate = 0; + } + } + +- private void updateTileEntity(TileEntity var1) { +- if(var1 != null) { +- Packet var2 = var1.getDescriptionPacket(); +- if(var2 != null) { +- this.sendPacketToPlayersInInstance(var2); ++ private void sendTileToAllPlayersWatchingChunk(TileEntity par1TileEntity) { ++ if (par1TileEntity != null) { ++ Packet var2 = par1TileEntity.getDescriptionPacket(); ++ ++ if (var2 != null) { ++ this.sendToAllPlayersWatchingChunk(var2); + } + } +- +- } +- +- static ChunkCoordIntPair getChunkLocation(PlayerInstance var0) { +- return var0.currentChunk; +- } +- +- static List getPlayersInChunk(PlayerInstance var0) { +- return var0.b; ++ } ++ ++ static ChunkCoordIntPair getChunkLocation(PlayerInstance par0PlayerInstance) { ++ return par0PlayerInstance.chunkLocation; ++ } ++ ++ static List getPlayersInChunk(PlayerInstance par0PlayerInstance) { ++ return par0PlayerInstance.playersInChunk; + } + } diff --git a/patches/net/minecraft/src/PlayerManager.java.patch b/patches/net/minecraft/src/PlayerManager.java.patch new file mode 100644 index 0000000..8e4b3fe --- /dev/null +++ b/patches/net/minecraft/src/PlayerManager.java.patch @@ -0,0 +1,404 @@ +--- net/minecraft/src/PlayerManager.java ++++ net/minecraft/src/PlayerManager.java +@@ -5,121 +5,160 @@ + + public class PlayerManager { + private final WorldServer theWorldServer; +- private final List b = new ArrayList(); ++ ++ /** players in the current instance */ ++ private final List players = new ArrayList(); ++ ++ /** ++ * A map of chunk position (two ints concatenated into a long) to PlayerInstance ++ */ + private final LongHashMap playerInstances = new LongHashMap(); +- private final List d = new ArrayList(); +- private final List e = new ArrayList(); ++ ++ /** ++ * contains a PlayerInstance for every chunk they can see. the "player instance" cotains a list of all players who can ++ * also that chunk ++ */ ++ private final List chunkWatcherWithPlayers = new ArrayList(); ++ ++ /** This field is using when chunk should be processed (every 8000 ticks) */ ++ private final List playerInstanceList = new ArrayList(); ++ ++ /** ++ * Number of chunks the server sends to the client. Valid 3<=x<=15. In server.properties. ++ */ + private final int playerViewRadius; ++ ++ /** time what is using to check if InhabitedTime should be calculated */ + private long previousTotalWorldTime; +- private final int[][] xzDirectionsConst = new int[][]{{1, 0}, {0, 1}, {-1, 0}, {0, -1}}; +- +- public PlayerManager(WorldServer var1, int var2) { +- if(var2 > 15) { ++ ++ /** x, z direction vectors: east, south, west, north */ ++ private final int[][] xzDirectionsConst = new int[][] {{1, 0}, {0, 1}, { -1, 0}, {0, -1}}; ++ ++ public PlayerManager(WorldServer par1WorldServer, int par2) { ++ if (par2 > 15) { + throw new IllegalArgumentException("Too big view radius!"); +- } else if(var2 < 3) { ++ } else if (par2 < 3) { + throw new IllegalArgumentException("Too small view radius!"); + } else { +- this.playerViewRadius = var2; +- this.theWorldServer = var1; ++ this.playerViewRadius = par2; ++ this.theWorldServer = par1WorldServer; + } + } + +- public WorldServer getMinecraftServer() { ++ public WorldServer getWorldServer() { + return this.theWorldServer; + } + ++ /** ++ * updates all the player instances that need to be updated ++ */ + public void updatePlayerInstances() { + long var1 = this.theWorldServer.getTotalWorldTime(); + int var3; + PlayerInstance var4; +- if(var1 - this.previousTotalWorldTime > 8000L) { ++ ++ if (var1 - this.previousTotalWorldTime > 8000L) { + this.previousTotalWorldTime = var1; + +- for(var3 = 0; var3 < this.e.size(); ++var3) { +- var4 = (PlayerInstance)this.e.get(var3); +- var4.onUpdate(); ++ for (var3 = 0; var3 < this.playerInstanceList.size(); ++var3) { ++ var4 = (PlayerInstance)this.playerInstanceList.get(var3); ++ var4.sendChunkUpdate(); + var4.processChunk(); + } + } else { +- for(var3 = 0; var3 < this.d.size(); ++var3) { +- var4 = (PlayerInstance)this.d.get(var3); +- var4.onUpdate(); ++ for (var3 = 0; var3 < this.chunkWatcherWithPlayers.size(); ++var3) { ++ var4 = (PlayerInstance)this.chunkWatcherWithPlayers.get(var3); ++ var4.sendChunkUpdate(); + } + } + +- this.d.clear(); +- if(this.b.isEmpty()) { ++ this.chunkWatcherWithPlayers.clear(); ++ ++ if (this.players.isEmpty()) { + WorldProvider var5 = this.theWorldServer.provider; +- if(!var5.canRespawnHere()) { ++ ++ if (!var5.canRespawnHere()) { + this.theWorldServer.theChunkProviderServer.unloadAllChunks(); + } + } +- + } + +- private PlayerInstance getPlayerInstance(int var1, int var2, boolean var3) { +- long var4 = (long)var1 + 2147483647L | (long)var2 + 2147483647L << 32; ++ private PlayerInstance getOrCreateChunkWatcher(int par1, int par2, boolean par3) { ++ long var4 = (long)par1 + 2147483647L | (long)par2 + 2147483647L << 32; + PlayerInstance var6 = (PlayerInstance)this.playerInstances.getValueByKey(var4); +- if(var6 == null && var3) { +- var6 = new PlayerInstance(this, var1, var2); ++ ++ if (var6 == null && par3) { ++ var6 = new PlayerInstance(this, par1, par2); + this.playerInstances.add(var4, var6); +- this.e.add(var6); ++ this.playerInstanceList.add(var6); + } + + return var6; + } + +- public void markBlockForUpdate(int var1, int var2, int var3) { +- int var4 = var1 >> 4; +- int var5 = var3 >> 4; +- PlayerInstance var6 = this.getPlayerInstance(var4, var5, false); +- if(var6 != null) { +- var6.markBlockNeedsUpdate(var1 & 15, var2, var3 & 15); ++ /** ++ * Called by WorldManager.markBlockForUpdate; marks a block to be resent to clients. ++ */ ++ public void markBlockForUpdate(int par1, int par2, int par3) { ++ int var4 = par1 >> 4; ++ int var5 = par3 >> 4; ++ PlayerInstance var6 = this.getOrCreateChunkWatcher(var4, var5, false); ++ ++ if (var6 != null) { ++ var6.flagChunkForUpdate(par1 & 15, par2, par3 & 15); + } +- + } + +- public void addPlayer(EntityPlayerMP var1) { +- int var2 = (int)var1.posX >> 4; +- int var3 = (int)var1.posZ >> 4; +- var1.managedPosX = var1.posX; +- var1.managedPosZ = var1.posZ; ++ /** ++ * Adds an EntityPlayerMP to the PlayerManager. ++ */ ++ public void addPlayer(EntityPlayerMP par1EntityPlayerMP) { ++ int var2 = (int)par1EntityPlayerMP.posX >> 4; ++ int var3 = (int)par1EntityPlayerMP.posZ >> 4; ++ par1EntityPlayerMP.managedPosX = par1EntityPlayerMP.posX; ++ par1EntityPlayerMP.managedPosZ = par1EntityPlayerMP.posZ; + +- for(int var4 = var2 - this.playerViewRadius; var4 <= var2 + this.playerViewRadius; ++var4) { +- for(int var5 = var3 - this.playerViewRadius; var5 <= var3 + this.playerViewRadius; ++var5) { +- this.getPlayerInstance(var4, var5, true).addPlayer(var1); ++ for (int var4 = var2 - this.playerViewRadius; var4 <= var2 + this.playerViewRadius; ++var4) { ++ for (int var5 = var3 - this.playerViewRadius; var5 <= var3 + this.playerViewRadius; ++var5) { ++ this.getOrCreateChunkWatcher(var4, var5, true).addPlayer(par1EntityPlayerMP); + } + } + +- this.b.add(var1); +- this.filterChunkLoadQueue(var1); ++ this.players.add(par1EntityPlayerMP); ++ this.filterChunkLoadQueue(par1EntityPlayerMP); + } + +- public void filterChunkLoadQueue(EntityPlayerMP var1) { +- ArrayList var2 = new ArrayList(var1.f); ++ /** ++ * Removes all chunks from the given player's chunk load queue that are not in viewing range of the player. ++ */ ++ public void filterChunkLoadQueue(EntityPlayerMP par1EntityPlayerMP) { ++ ArrayList var2 = new ArrayList(par1EntityPlayerMP.loadedChunks); + int var3 = 0; + int var4 = this.playerViewRadius; +- int var5 = (int)var1.posX >> 4; +- int var6 = (int)var1.posZ >> 4; ++ int var5 = (int)par1EntityPlayerMP.posX >> 4; ++ int var6 = (int)par1EntityPlayerMP.posZ >> 4; + int var7 = 0; + int var8 = 0; +- ChunkCoordIntPair var9 = PlayerInstance.getChunkLocation(this.getPlayerInstance(var5, var6, true)); +- var1.f.clear(); +- if(var2.contains(var9)) { +- var1.f.add(var9); ++ ChunkCoordIntPair var9 = PlayerInstance.getChunkLocation(this.getOrCreateChunkWatcher(var5, var6, true)); ++ par1EntityPlayerMP.loadedChunks.clear(); ++ ++ if (var2.contains(var9)) { ++ par1EntityPlayerMP.loadedChunks.add(var9); + } + + int var10; +- for(var10 = 1; var10 <= var4 * 2; ++var10) { +- for(int var11 = 0; var11 < 2; ++var11) { ++ ++ for (var10 = 1; var10 <= var4 * 2; ++var10) { ++ for (int var11 = 0; var11 < 2; ++var11) { + int[] var12 = this.xzDirectionsConst[var3++ % 4]; + +- for(int var13 = 0; var13 < var10; ++var13) { ++ for (int var13 = 0; var13 < var10; ++var13) { + var7 += var12[0]; + var8 += var12[1]; +- var9 = PlayerInstance.getChunkLocation(this.getPlayerInstance(var5 + var7, var6 + var8, true)); +- if(var2.contains(var9)) { +- var1.f.add(var9); ++ var9 = PlayerInstance.getChunkLocation(this.getOrCreateChunkWatcher(var5 + var7, var6 + var8, true)); ++ ++ if (var2.contains(var9)) { ++ par1EntityPlayerMP.loadedChunks.add(var9); + } + } + } +@@ -127,96 +166,116 @@ + + var3 %= 4; + +- for(var10 = 0; var10 < var4 * 2; ++var10) { ++ for (var10 = 0; var10 < var4 * 2; ++var10) { + var7 += this.xzDirectionsConst[var3][0]; + var8 += this.xzDirectionsConst[var3][1]; +- var9 = PlayerInstance.getChunkLocation(this.getPlayerInstance(var5 + var7, var6 + var8, true)); +- if(var2.contains(var9)) { +- var1.f.add(var9); ++ var9 = PlayerInstance.getChunkLocation(this.getOrCreateChunkWatcher(var5 + var7, var6 + var8, true)); ++ ++ if (var2.contains(var9)) { ++ par1EntityPlayerMP.loadedChunks.add(var9); + } + } +- + } + +- public void removePlayer(EntityPlayerMP var1) { +- int var2 = (int)var1.managedPosX >> 4; +- int var3 = (int)var1.managedPosZ >> 4; +- +- for(int var4 = var2 - this.playerViewRadius; var4 <= var2 + this.playerViewRadius; ++var4) { +- for(int var5 = var3 - this.playerViewRadius; var5 <= var3 + this.playerViewRadius; ++var5) { +- PlayerInstance var6 = this.getPlayerInstance(var4, var5, false); +- if(var6 != null) { +- var6.removePlayer(var1); ++ /** ++ * Removes an EntityPlayerMP from the PlayerManager. ++ */ ++ public void removePlayer(EntityPlayerMP par1EntityPlayerMP) { ++ int var2 = (int)par1EntityPlayerMP.managedPosX >> 4; ++ int var3 = (int)par1EntityPlayerMP.managedPosZ >> 4; ++ ++ for (int var4 = var2 - this.playerViewRadius; var4 <= var2 + this.playerViewRadius; ++var4) { ++ for (int var5 = var3 - this.playerViewRadius; var5 <= var3 + this.playerViewRadius; ++var5) { ++ PlayerInstance var6 = this.getOrCreateChunkWatcher(var4, var5, false); ++ ++ if (var6 != null) { ++ var6.removePlayer(par1EntityPlayerMP); + } + } + } + +- this.b.remove(var1); +- } +- +- private boolean overlaps(int var1, int var2, int var3, int var4, int var5) { +- int var6 = var1 - var3; +- int var7 = var2 - var4; +- return var6 >= -var5 && var6 <= var5 ? var7 >= -var5 && var7 <= var5 : false; +- } +- +- public void updateMountedMovingPlayer(EntityPlayerMP var1) { +- int var2 = (int)var1.posX >> 4; +- int var3 = (int)var1.posZ >> 4; +- double var4 = var1.managedPosX - var1.posX; +- double var6 = var1.managedPosZ - var1.posZ; ++ this.players.remove(par1EntityPlayerMP); ++ } ++ ++ /** ++ * Determine if two rectangles centered at the given points overlap for the provided radius. Arguments: x1, z1, x2, z2, ++ * radius. ++ */ ++ private boolean overlaps(int par1, int par2, int par3, int par4, int par5) { ++ int var6 = par1 - par3; ++ int var7 = par2 - par4; ++ return var6 >= -par5 && var6 <= par5 ? var7 >= -par5 && var7 <= par5 : false; ++ } ++ ++ /** ++ * update chunks around a player being moved by server logic (e.g. cart, boat) ++ */ ++ public void updateMountedMovingPlayer(EntityPlayerMP par1EntityPlayerMP) { ++ int var2 = (int)par1EntityPlayerMP.posX >> 4; ++ int var3 = (int)par1EntityPlayerMP.posZ >> 4; ++ double var4 = par1EntityPlayerMP.managedPosX - par1EntityPlayerMP.posX; ++ double var6 = par1EntityPlayerMP.managedPosZ - par1EntityPlayerMP.posZ; + double var8 = var4 * var4 + var6 * var6; +- if(var8 >= 64.0D) { +- int var10 = (int)var1.managedPosX >> 4; +- int var11 = (int)var1.managedPosZ >> 4; ++ ++ if (var8 >= 64.0D) { ++ int var10 = (int)par1EntityPlayerMP.managedPosX >> 4; ++ int var11 = (int)par1EntityPlayerMP.managedPosZ >> 4; + int var12 = this.playerViewRadius; + int var13 = var2 - var10; + int var14 = var3 - var11; +- if(var13 != 0 || var14 != 0) { +- for(int var15 = var2 - var12; var15 <= var2 + var12; ++var15) { +- for(int var16 = var3 - var12; var16 <= var3 + var12; ++var16) { +- if(!this.overlaps(var15, var16, var10, var11, var12)) { +- this.getPlayerInstance(var15, var16, true).addPlayer(var1); ++ ++ if (var13 != 0 || var14 != 0) { ++ for (int var15 = var2 - var12; var15 <= var2 + var12; ++var15) { ++ for (int var16 = var3 - var12; var16 <= var3 + var12; ++var16) { ++ if (!this.overlaps(var15, var16, var10, var11, var12)) { ++ this.getOrCreateChunkWatcher(var15, var16, true).addPlayer(par1EntityPlayerMP); + } + +- if(!this.overlaps(var15 - var13, var16 - var14, var2, var3, var12)) { +- PlayerInstance var17 = this.getPlayerInstance(var15 - var13, var16 - var14, false); +- if(var17 != null) { +- var17.removePlayer(var1); ++ if (!this.overlaps(var15 - var13, var16 - var14, var2, var3, var12)) { ++ PlayerInstance var17 = this.getOrCreateChunkWatcher(var15 - var13, var16 - var14, false); ++ ++ if (var17 != null) { ++ var17.removePlayer(par1EntityPlayerMP); + } + } + } + } + +- this.filterChunkLoadQueue(var1); +- var1.managedPosX = var1.posX; +- var1.managedPosZ = var1.posZ; ++ this.filterChunkLoadQueue(par1EntityPlayerMP); ++ par1EntityPlayerMP.managedPosX = par1EntityPlayerMP.posX; ++ par1EntityPlayerMP.managedPosZ = par1EntityPlayerMP.posZ; + } + } + } + +- public boolean isPlayerWatchingChunk(EntityPlayerMP var1, int var2, int var3) { +- PlayerInstance var4 = this.getPlayerInstance(var2, var3, false); +- return var4 == null ? false : PlayerInstance.getPlayersInChunk(var4).contains(var1) && !var1.f.contains(PlayerInstance.getChunkLocation(var4)); +- } +- +- public static int getFurthestViewableBlock(int var0) { +- return var0 * 16 - 16; +- } +- +- static WorldServer getWorldServer(PlayerManager var0) { +- return var0.theWorldServer; +- } +- +- static LongHashMap getChunkWatchers(PlayerManager var0) { +- return var0.playerInstances; +- } +- +- static List getChunkWatcherList(PlayerManager var0) { +- return var0.e; +- } +- +- static List getChunkWatchersWithPlayers(PlayerManager var0) { +- return var0.d; ++ public boolean isPlayerWatchingChunk(EntityPlayerMP par1EntityPlayerMP, int par2, int par3) { ++ PlayerInstance var4 = this.getOrCreateChunkWatcher(par2, par3, false); ++ return var4 == null ? false : PlayerInstance.getPlayersInChunk(var4).contains(par1EntityPlayerMP) && !par1EntityPlayerMP.loadedChunks.contains(PlayerInstance.getChunkLocation(var4)); ++ } ++ ++ /** ++ * Get the furthest viewable block given player's view distance ++ */ ++ public static int getFurthestViewableBlock(int par0) { ++ return par0 * 16 - 16; ++ } ++ ++ static WorldServer getWorldServer(PlayerManager par0PlayerManager) { ++ return par0PlayerManager.theWorldServer; ++ } ++ ++ static LongHashMap getChunkWatchers(PlayerManager par0PlayerManager) { ++ return par0PlayerManager.playerInstances; ++ } ++ ++ /** ++ * Returns player instances as list ++ */ ++ static List getChunkWatcherList(PlayerManager par0PlayerManager) { ++ return par0PlayerManager.playerInstanceList; ++ } ++ ++ static List getChunkWatchersWithPlayers(PlayerManager par0PlayerManager) { ++ return par0PlayerManager.chunkWatcherWithPlayers; + } + } diff --git a/patches/net/minecraft/src/PlayerNotFoundException.java.patch b/patches/net/minecraft/src/PlayerNotFoundException.java.patch new file mode 100644 index 0000000..eb7849b --- /dev/null +++ b/patches/net/minecraft/src/PlayerNotFoundException.java.patch @@ -0,0 +1,12 @@ +--- net/minecraft/src/PlayerNotFoundException.java ++++ net/minecraft/src/PlayerNotFoundException.java +@@ -5,7 +5,7 @@ + this("commands.generic.player.notFound", new Object[0]); + } + +- public PlayerNotFoundException(String var1, Object... var2) { +- super(var1, var2); ++ public PlayerNotFoundException(String par1Str, Object ... par2ArrayOfObj) { ++ super(par1Str, par2ArrayOfObj); + } + } diff --git a/patches/net/minecraft/src/PlayerPositionComparator.java.patch b/patches/net/minecraft/src/PlayerPositionComparator.java.patch new file mode 100644 index 0000000..dcbe127 --- /dev/null +++ b/patches/net/minecraft/src/PlayerPositionComparator.java.patch @@ -0,0 +1,30 @@ +--- net/minecraft/src/PlayerPositionComparator.java ++++ net/minecraft/src/PlayerPositionComparator.java +@@ -5,17 +5,20 @@ + public class PlayerPositionComparator implements Comparator { + private final ChunkCoordinates theChunkCoordinates; + +- public PlayerPositionComparator(ChunkCoordinates var1) { +- this.theChunkCoordinates = var1; ++ public PlayerPositionComparator(ChunkCoordinates par1ChunkCoordinates) { ++ this.theChunkCoordinates = par1ChunkCoordinates; + } + +- public int comparePlayers(EntityPlayerMP var1, EntityPlayerMP var2) { +- double var3 = var1.getDistanceSq((double)this.theChunkCoordinates.posX, (double)this.theChunkCoordinates.posY, (double)this.theChunkCoordinates.posZ); +- double var5 = var2.getDistanceSq((double)this.theChunkCoordinates.posX, (double)this.theChunkCoordinates.posY, (double)this.theChunkCoordinates.posZ); ++ /** ++ * Compare the position of two players. ++ */ ++ public int comparePlayers(EntityPlayerMP par1EntityPlayerMP, EntityPlayerMP par2EntityPlayerMP) { ++ double var3 = par1EntityPlayerMP.getDistanceSq((double)this.theChunkCoordinates.posX, (double)this.theChunkCoordinates.posY, (double)this.theChunkCoordinates.posZ); ++ double var5 = par2EntityPlayerMP.getDistanceSq((double)this.theChunkCoordinates.posX, (double)this.theChunkCoordinates.posY, (double)this.theChunkCoordinates.posZ); + return var3 < var5 ? -1 : (var3 > var5 ? 1 : 0); + } + +- public int compare(Object var1, Object var2) { +- return this.comparePlayers((EntityPlayerMP)var1, (EntityPlayerMP)var2); ++ public int compare(Object par1Obj, Object par2Obj) { ++ return this.comparePlayers((EntityPlayerMP)par1Obj, (EntityPlayerMP)par2Obj); + } + } diff --git a/patches/net/minecraft/src/PlayerSelector.java.patch b/patches/net/minecraft/src/PlayerSelector.java.patch new file mode 100644 index 0000000..d37f521 --- /dev/null +++ b/patches/net/minecraft/src/PlayerSelector.java.patch @@ -0,0 +1,342 @@ +--- net/minecraft/src/PlayerSelector.java ++++ net/minecraft/src/PlayerSelector.java +@@ -10,21 +10,40 @@ + import net.minecraft.server.MinecraftServer; + + public class PlayerSelector { +- private static final Pattern a = Pattern.compile("^@([parf])(?:\\[([\\w=,!-]*)\\])?$"); +- private static final Pattern b = Pattern.compile("\\G([-!]?[\\w-]*)(?:$|,)"); +- private static final Pattern c = Pattern.compile("\\G(\\w+)=([-!]?[\\w-]*)(?:$|,)"); +- +- public static EntityPlayerMP matchOnePlayer(ICommandSender var0, String var1) { +- EntityPlayerMP[] var2 = matchPlayers(var0, var1); ++ ++ /** ++ * This matches the at-tokens introduced for command blocks, including their arguments, if any. ++ */ ++ private static final Pattern tokenPattern = Pattern.compile("^@([parf])(?:\\[([\\w=,!-]*)\\])?$"); ++ ++ /** ++ * This matches things like "-1,,4", and is used for getting x,y,z,range from the token's argument list. ++ */ ++ private static final Pattern intListPattern = Pattern.compile("\\G([-!]?[\\w-]*)(?:$|,)"); ++ ++ /** ++ * This matches things like "rm=4,c=2" and is used for handling named token arguments. ++ */ ++ private static final Pattern keyValueListPattern = Pattern.compile("\\G(\\w+)=([-!]?[\\w-]*)(?:$|,)"); ++ ++ /** ++ * Returns the one player that matches the given at-token. Returns null if more than one player matches. ++ */ ++ public static EntityPlayerMP matchOnePlayer(ICommandSender par0ICommandSender, String par1Str) { ++ EntityPlayerMP[] var2 = matchPlayers(par0ICommandSender, par1Str); + return var2 != null && var2.length == 1 ? var2[0] : null; + } + +- public static String matchPlayersAsString(ICommandSender var0, String var1) { +- EntityPlayerMP[] var2 = matchPlayers(var0, var1); +- if(var2 != null && var2.length != 0) { ++ /** ++ * Returns a nicely-formatted string listing the matching players. ++ */ ++ public static String matchPlayersAsString(ICommandSender par0ICommandSender, String par1Str) { ++ EntityPlayerMP[] var2 = matchPlayers(par0ICommandSender, par1Str); ++ ++ if (var2 != null && var2.length != 0) { + String[] var3 = new String[var2.length]; + +- for(int var4 = 0; var4 < var3.length; ++var4) { ++ for (int var4 = 0; var4 < var3.length; ++var4) { + var3[var4] = var2[var4].getTranslatedEntityName(); + } + +@@ -34,9 +53,13 @@ + } + } + +- public static EntityPlayerMP[] matchPlayers(ICommandSender var0, String var1) { +- Matcher var2 = a.matcher(var1); +- if(!var2.matches()) { ++ /** ++ * Returns an array of all players matched by the given at-token. ++ */ ++ public static EntityPlayerMP[] matchPlayers(ICommandSender par0ICommandSender, String par1Str) { ++ Matcher var2 = tokenPattern.matcher(par1Str); ++ ++ if (!var2.matches()) { + return null; + } else { + Map var3 = getArgumentMap(var2.group(2)); +@@ -47,64 +70,66 @@ + int var8 = getDefaultMaximumLevel(var4); + int var9 = getDefaultCount(var4); + int var10 = EnumGameType.NOT_SET.getID(); +- ChunkCoordinates var11 = var0.getCommandSenderPosition(); ++ ChunkCoordinates var11 = par0ICommandSender.getPlayerCoordinates(); + Map var12 = func_96560_a(var3); + String var13 = null; + String var14 = null; + boolean var15 = false; +- if(var3.containsKey("rm")) { ++ ++ if (var3.containsKey("rm")) { + var5 = MathHelper.parseIntWithDefault((String)var3.get("rm"), var5); + var15 = true; + } + +- if(var3.containsKey("r")) { ++ if (var3.containsKey("r")) { + var6 = MathHelper.parseIntWithDefault((String)var3.get("r"), var6); + var15 = true; + } + +- if(var3.containsKey("lm")) { ++ if (var3.containsKey("lm")) { + var7 = MathHelper.parseIntWithDefault((String)var3.get("lm"), var7); + } + +- if(var3.containsKey("l")) { ++ if (var3.containsKey("l")) { + var8 = MathHelper.parseIntWithDefault((String)var3.get("l"), var8); + } + +- if(var3.containsKey("x")) { ++ if (var3.containsKey("x")) { + var11.posX = MathHelper.parseIntWithDefault((String)var3.get("x"), var11.posX); + var15 = true; + } + +- if(var3.containsKey("y")) { ++ if (var3.containsKey("y")) { + var11.posY = MathHelper.parseIntWithDefault((String)var3.get("y"), var11.posY); + var15 = true; + } + +- if(var3.containsKey("z")) { ++ if (var3.containsKey("z")) { + var11.posZ = MathHelper.parseIntWithDefault((String)var3.get("z"), var11.posZ); + var15 = true; + } + +- if(var3.containsKey("m")) { ++ if (var3.containsKey("m")) { + var10 = MathHelper.parseIntWithDefault((String)var3.get("m"), var10); + } + +- if(var3.containsKey("c")) { ++ if (var3.containsKey("c")) { + var9 = MathHelper.parseIntWithDefault((String)var3.get("c"), var9); + } + +- if(var3.containsKey("team")) { ++ if (var3.containsKey("team")) { + var14 = (String)var3.get("team"); + } + +- if(var3.containsKey("name")) { ++ if (var3.containsKey("name")) { + var13 = (String)var3.get("name"); + } + +- World var16 = var15 ? var0.getEntityWorld() : null; ++ World var16 = var15 ? par0ICommandSender.getEntityWorld() : null; + List var17; +- if(!var4.equals("p") && !var4.equals("a")) { +- if(!var4.equals("r")) { ++ ++ if (!var4.equals("p") && !var4.equals("a")) { ++ if (!var4.equals("r")) { + return null; + } else { + var17 = MinecraftServer.getServer().getConfigurationManager().findPlayers(var11, var5, var6, 0, var10, var7, var8, var12, var13, var14, var16); +@@ -119,28 +144,34 @@ + } + } + +- public static Map func_96560_a(Map var0) { ++ public static Map func_96560_a(Map par0Map) { + HashMap var1 = new HashMap(); +- Iterator var2 = var0.keySet().iterator(); ++ Iterator var2 = par0Map.keySet().iterator(); + +- while(var2.hasNext()) { ++ while (var2.hasNext()) { + String var3 = (String)var2.next(); +- if(var3.startsWith("score_") && var3.length() > "score_".length()) { ++ ++ if (var3.startsWith("score_") && var3.length() > "score_".length()) { + String var4 = var3.substring("score_".length()); +- var1.put(var4, Integer.valueOf(MathHelper.parseIntWithDefault((String)var0.get(var3), 1))); ++ var1.put(var4, Integer.valueOf(MathHelper.parseIntWithDefault((String)par0Map.get(var3), 1))); + } + } + + return var1; + } + +- public static boolean matchesMultiplePlayers(String var0) { +- Matcher var1 = a.matcher(var0); +- if(var1.matches()) { ++ /** ++ * Returns whether the given pattern can match more than one player. ++ */ ++ public static boolean matchesMultiplePlayers(String par0Str) { ++ Matcher var1 = tokenPattern.matcher(par0Str); ++ ++ if (var1.matches()) { + Map var2 = getArgumentMap(var1.group(2)); + String var3 = var1.group(1); + int var4 = getDefaultCount(var3); +- if(var2.containsKey("c")) { ++ ++ if (var2.containsKey("c")) { + var4 = MathHelper.parseIntWithDefault((String)var2.get("c"), var4); + } + +@@ -150,74 +181,104 @@ + } + } + +- public static boolean hasTheseArguments(String var0, String var1) { +- Matcher var2 = a.matcher(var0); +- if(var2.matches()) { ++ /** ++ * Returns whether the given token (parameter 1) has exactly the given arguments (parameter 2). ++ */ ++ public static boolean hasTheseArguments(String par0Str, String par1Str) { ++ Matcher var2 = tokenPattern.matcher(par0Str); ++ ++ if (var2.matches()) { + String var3 = var2.group(1); +- return var1 == null || var1.equals(var3); ++ return par1Str == null || par1Str.equals(var3); + } else { + return false; + } + } + +- public static boolean hasArguments(String var0) { +- return hasTheseArguments(var0, (String)null); +- } +- +- private static final int getDefaultMinimumRange(String var0) { +- return 0; +- } +- +- private static final int getDefaultMaximumRange(String var0) { +- return 0; +- } +- +- private static final int getDefaultMaximumLevel(String var0) { ++ /** ++ * Returns whether the given token has any arguments set. ++ */ ++ public static boolean hasArguments(String par0Str) { ++ return hasTheseArguments(par0Str, (String)null); ++ } ++ ++ /** ++ * Gets the default minimum range (argument rm). ++ */ ++ private static final int getDefaultMinimumRange(String par0Str) { ++ return 0; ++ } ++ ++ /** ++ * Gets the default maximum range (argument r). ++ */ ++ private static final int getDefaultMaximumRange(String par0Str) { ++ return 0; ++ } ++ ++ /** ++ * Gets the default maximum experience level (argument l) ++ */ ++ private static final int getDefaultMaximumLevel(String par0Str) { + return Integer.MAX_VALUE; + } + +- private static final int getDefaultMinimumLevel(String var0) { ++ /** ++ * Gets the default minimum experience level (argument lm) ++ */ ++ private static final int getDefaultMinimumLevel(String par0Str) { + return 0; + } + +- private static final int getDefaultCount(String var0) { +- return var0.equals("a") ? 0 : 1; ++ /** ++ * Gets the default number of players to return (argument c, 0 for infinite) ++ */ ++ private static final int getDefaultCount(String par0Str) { ++ return par0Str.equals("a") ? 0 : 1; + } + +- private static Map getArgumentMap(String var0) { ++ /** ++ * Parses the given argument string, turning it into a HashMap<String, String> of name->value. ++ */ ++ private static Map getArgumentMap(String par0Str) { + HashMap var1 = new HashMap(); +- if(var0 == null) { ++ ++ if (par0Str == null) { + return var1; + } else { +- Matcher var2 = b.matcher(var0); ++ Matcher var2 = intListPattern.matcher(par0Str); + int var3 = 0; +- + int var4; +- for(var4 = -1; var2.find(); var4 = var2.end()) { ++ ++ for (var4 = -1; var2.find(); var4 = var2.end()) { + String var5 = null; +- switch(var3++) { +- case 0: +- var5 = "x"; +- break; +- case 1: +- var5 = "y"; +- break; +- case 2: +- var5 = "z"; +- break; +- case 3: +- var5 = "r"; ++ ++ switch (var3++) { ++ case 0: ++ var5 = "x"; ++ break; ++ ++ case 1: ++ var5 = "y"; ++ break; ++ ++ case 2: ++ var5 = "z"; ++ break; ++ ++ case 3: ++ var5 = "r"; + } + +- if(var5 != null && var2.group(1).length() > 0) { ++ if (var5 != null && var2.group(1).length() > 0) { + var1.put(var5, var2.group(1)); + } + } + +- if(var4 < var0.length()) { +- var2 = c.matcher(var4 == -1 ? var0 : var0.substring(var4)); ++ if (var4 < par0Str.length()) { ++ var2 = keyValueListPattern.matcher(var4 == -1 ? par0Str : par0Str.substring(var4)); + +- while(var2.find()) { ++ while (var2.find()) { + var1.put(var2.group(1), var2.group(2)); + } + } diff --git a/patches/net/minecraft/src/PlayerUsageSnooper.java.patch b/patches/net/minecraft/src/PlayerUsageSnooper.java.patch new file mode 100644 index 0000000..d90d287 --- /dev/null +++ b/patches/net/minecraft/src/PlayerUsageSnooper.java.patch @@ -0,0 +1,170 @@ +--- net/minecraft/src/PlayerUsageSnooper.java ++++ net/minecraft/src/PlayerUsageSnooper.java +@@ -13,38 +13,49 @@ + import java.util.Map.Entry; + + public class PlayerUsageSnooper { +- private Map a = new HashMap(); +- private final String b = UUID.randomUUID().toString(); +- private final URL c; ++ ++ /** String map for report data */ ++ private Map dataMap = new HashMap(); ++ private final String uniqueID = UUID.randomUUID().toString(); ++ ++ /** URL of the server to send the report to */ ++ private final URL serverUrl; + private final IPlayerUsage playerStatsCollector; +- private final java.util.Timer e = new java.util.Timer("Snooper Timer", true); +- private final Object f = new Object(); ++ ++ /** set to fire the snooperThread every 15 mins */ ++ private final java.util.Timer threadTrigger = new java.util.Timer("Snooper Timer", true); ++ private final Object syncLock = new Object(); + private final long field_98224_g; + private boolean isRunning; ++ ++ /** incremented on every getSelfCounterFor */ + private int selfCounter; + +- public PlayerUsageSnooper(String var1, IPlayerUsage var2, long var3) { ++ public PlayerUsageSnooper(String par1Str, IPlayerUsage par2IPlayerUsage, long par3) { + try { +- this.c = new URL("http://snoop.minecraft.net/" + var1 + "?version=" + 1); ++ this.serverUrl = new URL("http://snoop.minecraft.net/" + par1Str + "?version=" + 1); + } catch (MalformedURLException var6) { + throw new IllegalArgumentException(); + } + +- this.playerStatsCollector = var2; +- this.field_98224_g = var3; ++ this.playerStatsCollector = par2IPlayerUsage; ++ this.field_98224_g = par3; + } + ++ /** ++ * Note issuing start multiple times is not an error. ++ */ + public void startSnooper() { +- if(!this.isRunning) { ++ if (!this.isRunning) { + this.isRunning = true; + this.addBaseDataToSnooper(); +- this.e.schedule(new PlayerUsageSnooperThread(this), 0L, 900000L); ++ this.threadTrigger.schedule(new PlayerUsageSnooperThread(this), 0L, 900000L); + } + } + + private void addBaseDataToSnooper() { + this.addJvmArgsToSnooper(); +- this.addData("snooper_token", this.b); ++ this.addData("snooper_token", this.uniqueID); + this.addData("os_name", System.getProperty("os.name")); + this.addData("os_version", System.getProperty("os.version")); + this.addData("os_architecture", System.getProperty("os.arch")); +@@ -59,9 +70,10 @@ + int var3 = 0; + Iterator var4 = var2.iterator(); + +- while(var4.hasNext()) { ++ while (var4.hasNext()) { + String var5 = (String)var4.next(); +- if(var5.startsWith("-X")) { ++ ++ if (var5.startsWith("-X")) { + this.addData("jvm_arg[" + var3++ + "]", var5); + } + } +@@ -77,21 +89,26 @@ + this.playerStatsCollector.addServerStatsToSnooper(this); + } + +- public void addData(String var1, Object var2) { +- Object var3 = this.f; +- synchronized(var3) { +- this.a.put(var1, var2); ++ /** ++ * Adds information to the report ++ */ ++ public void addData(String par1Str, Object par2Obj) { ++ Object var3 = this.syncLock; ++ ++ synchronized (this.syncLock) { ++ this.dataMap.put(par1Str, par2Obj); + } + } + + public Map getCurrentStats() { + LinkedHashMap var1 = new LinkedHashMap(); +- Object var2 = this.f; +- synchronized(var2) { ++ Object var2 = this.syncLock; ++ ++ synchronized (this.syncLock) { + this.addMemoryStatsToSnooper(); +- Iterator var3 = this.a.entrySet().iterator(); ++ Iterator var3 = this.dataMap.entrySet().iterator(); + +- while(var3.hasNext()) { ++ while (var3.hasNext()) { + Entry var4 = (Entry)var3.next(); + var1.put(var4.getKey(), var4.getValue().toString()); + } +@@ -105,34 +122,37 @@ + } + + public void stopSnooper() { +- this.e.cancel(); ++ this.threadTrigger.cancel(); + } + + public String getUniqueID() { +- return this.b; ++ return this.uniqueID; + } + + public long func_130105_g() { + return this.field_98224_g; + } + +- static IPlayerUsage getStatsCollectorFor(PlayerUsageSnooper var0) { +- return var0.playerStatsCollector; +- } +- +- static Object getSyncLockFor(PlayerUsageSnooper var0) { +- return var0.f; +- } +- +- static Map getDataMapFor(PlayerUsageSnooper var0) { +- return var0.a; +- } +- +- static int getSelfCounterFor(PlayerUsageSnooper var0) { +- return var0.selfCounter++; +- } +- +- static URL getServerUrlFor(PlayerUsageSnooper var0) { +- return var0.c; ++ static IPlayerUsage getStatsCollectorFor(PlayerUsageSnooper par0PlayerUsageSnooper) { ++ return par0PlayerUsageSnooper.playerStatsCollector; ++ } ++ ++ static Object getSyncLockFor(PlayerUsageSnooper par0PlayerUsageSnooper) { ++ return par0PlayerUsageSnooper.syncLock; ++ } ++ ++ static Map getDataMapFor(PlayerUsageSnooper par0PlayerUsageSnooper) { ++ return par0PlayerUsageSnooper.dataMap; ++ } ++ ++ /** ++ * returns a value indicating how many times this function has been run on the snooper ++ */ ++ static int getSelfCounterFor(PlayerUsageSnooper par0PlayerUsageSnooper) { ++ return par0PlayerUsageSnooper.selfCounter++; ++ } ++ ++ static URL getServerUrlFor(PlayerUsageSnooper par0PlayerUsageSnooper) { ++ return par0PlayerUsageSnooper.serverUrl; + } + } diff --git a/patches/net/minecraft/src/PlayerUsageSnooperThread.java.patch b/patches/net/minecraft/src/PlayerUsageSnooperThread.java.patch new file mode 100644 index 0000000..7c9233b --- /dev/null +++ b/patches/net/minecraft/src/PlayerUsageSnooperThread.java.patch @@ -0,0 +1,37 @@ +--- net/minecraft/src/PlayerUsageSnooperThread.java ++++ net/minecraft/src/PlayerUsageSnooperThread.java +@@ -1,26 +1,27 @@ + package net.minecraft.src; + + import java.util.HashMap; +-import java.util.Map; + import java.util.TimerTask; + + class PlayerUsageSnooperThread extends TimerTask { ++ ++ /** The PlayerUsageSnooper object. */ + final PlayerUsageSnooper snooper; + +- PlayerUsageSnooperThread(PlayerUsageSnooper var1) { +- this.snooper = var1; ++ PlayerUsageSnooperThread(PlayerUsageSnooper par1PlayerUsageSnooper) { ++ this.snooper = par1PlayerUsageSnooper; + } + + public void run() { +- if(PlayerUsageSnooper.getStatsCollectorFor(this.snooper).isSnooperEnabled()) { +- Object var2 = PlayerUsageSnooper.getSyncLockFor(this.snooper); ++ if (PlayerUsageSnooper.getStatsCollectorFor(this.snooper).isSnooperEnabled()) { + HashMap var1; +- synchronized(var2) { ++ ++ synchronized (PlayerUsageSnooper.getSyncLockFor(this.snooper)) { + var1 = new HashMap(PlayerUsageSnooper.getDataMapFor(this.snooper)); + var1.put("snooper_count", Integer.valueOf(PlayerUsageSnooper.getSelfCounterFor(this.snooper))); + } + +- HttpUtil.sendPost(PlayerUsageSnooper.getStatsCollectorFor(this.snooper).getLogAgent(), PlayerUsageSnooper.getServerUrlFor(this.snooper), (Map)var1, true); ++ HttpUtil.sendPost(PlayerUsageSnooper.getStatsCollectorFor(this.snooper).getLogAgent(), PlayerUsageSnooper.getServerUrlFor(this.snooper), var1, true); + } + } + } diff --git a/patches/net/minecraft/src/PortalPosition.java.patch b/patches/net/minecraft/src/PortalPosition.java.patch new file mode 100644 index 0000000..3d6370e --- /dev/null +++ b/patches/net/minecraft/src/PortalPosition.java.patch @@ -0,0 +1,23 @@ +--- net/minecraft/src/PortalPosition.java ++++ net/minecraft/src/PortalPosition.java +@@ -1,12 +1,16 @@ + package net.minecraft.src; + + public class PortalPosition extends ChunkCoordinates { ++ ++ /** The worldtime at which this PortalPosition was last verified */ + public long lastUpdateTime; ++ ++ /** The teleporter to which this PortalPosition applies */ + final Teleporter teleporterInstance; + +- public PortalPosition(Teleporter var1, int var2, int var3, int var4, long var5) { +- super(var2, var3, var4); +- this.teleporterInstance = var1; +- this.lastUpdateTime = var5; ++ public PortalPosition(Teleporter par1Teleporter, int par2, int par3, int par4, long par5) { ++ super(par2, par3, par4); ++ this.teleporterInstance = par1Teleporter; ++ this.lastUpdateTime = par5; + } + } diff --git a/patches/net/minecraft/src/PositionImpl.java.patch b/patches/net/minecraft/src/PositionImpl.java.patch new file mode 100644 index 0000000..d73fede --- /dev/null +++ b/patches/net/minecraft/src/PositionImpl.java.patch @@ -0,0 +1,17 @@ +--- net/minecraft/src/PositionImpl.java ++++ net/minecraft/src/PositionImpl.java +@@ -5,10 +5,10 @@ + protected final double y; + protected final double z; + +- public PositionImpl(double var1, double var3, double var5) { +- this.x = var1; +- this.y = var3; +- this.z = var5; ++ public PositionImpl(double par1, double par3, double par5) { ++ this.x = par1; ++ this.y = par3; ++ this.z = par5; + } + + public double getX() { diff --git a/patches/net/minecraft/src/PositionTextureVertex.java.patch b/patches/net/minecraft/src/PositionTextureVertex.java.patch new file mode 100644 index 0000000..7a84d6b --- /dev/null +++ b/patches/net/minecraft/src/PositionTextureVertex.java.patch @@ -0,0 +1,44 @@ +--- net/minecraft/src/PositionTextureVertex.java ++++ net/minecraft/src/PositionTextureVertex.java +@@ -5,23 +5,23 @@ + public float texturePositionX; + public float texturePositionY; + +- public PositionTextureVertex(float var1, float var2, float var3, float var4, float var5) { +- this(Vec3.createVectorHelper((double)var1, (double)var2, (double)var3), var4, var5); +- } +- +- public PositionTextureVertex setTexturePosition(float var1, float var2) { +- return new PositionTextureVertex(this, var1, var2); +- } +- +- public PositionTextureVertex(PositionTextureVertex var1, float var2, float var3) { +- this.vector3D = var1.vector3D; +- this.texturePositionX = var2; +- this.texturePositionY = var3; +- } +- +- public PositionTextureVertex(Vec3 var1, float var2, float var3) { +- this.vector3D = var1; +- this.texturePositionX = var2; +- this.texturePositionY = var3; ++ public PositionTextureVertex(float par1, float par2, float par3, float par4, float par5) { ++ this(Vec3.createVectorHelper((double)par1, (double)par2, (double)par3), par4, par5); ++ } ++ ++ public PositionTextureVertex setTexturePosition(float par1, float par2) { ++ return new PositionTextureVertex(this, par1, par2); ++ } ++ ++ public PositionTextureVertex(PositionTextureVertex par1PositionTextureVertex, float par2, float par3) { ++ this.vector3D = par1PositionTextureVertex.vector3D; ++ this.texturePositionX = par2; ++ this.texturePositionY = par3; ++ } ++ ++ public PositionTextureVertex(Vec3 par1Vec3, float par2, float par3) { ++ this.vector3D = par1Vec3; ++ this.texturePositionX = par2; ++ this.texturePositionY = par3; + } + } diff --git a/patches/net/minecraft/src/Potion.java.patch b/patches/net/minecraft/src/Potion.java.patch new file mode 100644 index 0000000..ff7bb0e --- /dev/null +++ b/patches/net/minecraft/src/Potion.java.patch @@ -0,0 +1,380 @@ +--- net/minecraft/src/Potion.java ++++ net/minecraft/src/Potion.java +@@ -1,16 +1,21 @@ + package net.minecraft.src; + +-import com.google.common.collect.Maps; + import java.util.Iterator; + import java.util.Map; +-import java.util.UUID; + import java.util.Map.Entry; ++import java.util.UUID; ++ ++import com.google.common.collect.Maps; ++ ++import com.prupe.mcpatcher.cc.ColorizeItem; + + public class Potion { ++ ++ /** The array of potion types. */ + public static final Potion[] potionTypes = new Potion[32]; + public static final Potion field_76423_b = null; +- public static final Potion moveSpeed = (new Potion(1, false, 8171462)).setPotionName("potion.moveSpeed").setIconIndex(0, 0).func_111184_a(SharedMonsterAttributes.movementSpeed, "91AEAA56-376B-4498-935B-2F7F68070635", (double)0.2F, 2); +- public static final Potion moveSlowdown = (new Potion(2, true, 5926017)).setPotionName("potion.moveSlowdown").setIconIndex(1, 0).func_111184_a(SharedMonsterAttributes.movementSpeed, "7107DE5E-7CE8-4030-940E-514C1F160890", (double)-0.15F, 2); ++ public static final Potion moveSpeed = (new Potion(1, false, 8171462)).setPotionName("potion.moveSpeed").setIconIndex(0, 0).func_111184_a(SharedMonsterAttributes.movementSpeed, "91AEAA56-376B-4498-935B-2F7F68070635", 0.20000000298023224D, 2); ++ public static final Potion moveSlowdown = (new Potion(2, true, 5926017)).setPotionName("potion.moveSlowdown").setIconIndex(1, 0).func_111184_a(SharedMonsterAttributes.movementSpeed, "7107DE5E-7CE8-4030-940E-514C1F160890", -0.15000000596046448D, 2); + public static final Potion digSpeed = (new Potion(3, false, 14270531)).setPotionName("potion.digSpeed").setIconIndex(2, 0).setEffectiveness(1.5D); + public static final Potion digSlowdown = (new Potion(4, true, 4866583)).setPotionName("potion.digSlowDown").setIconIndex(3, 0); + public static final Potion damageBoost = (new PotionAttackDamage(5, false, 9643043)).setPotionName("potion.damageBoost").setIconIndex(4, 0).func_111184_a(SharedMonsterAttributes.attackDamage, "648D7064-6A60-4F59-8ABE-C2C23A6DD7A9", 3.0D, 2); +@@ -18,16 +23,36 @@ + public static final Potion harm = (new PotionHealth(7, true, 4393481)).setPotionName("potion.harm"); + public static final Potion jump = (new Potion(8, false, 7889559)).setPotionName("potion.jump").setIconIndex(2, 1); + public static final Potion confusion = (new Potion(9, true, 5578058)).setPotionName("potion.confusion").setIconIndex(3, 1).setEffectiveness(0.25D); ++ ++ /** The regeneration Potion object. */ + public static final Potion regeneration = (new Potion(10, false, 13458603)).setPotionName("potion.regeneration").setIconIndex(7, 0).setEffectiveness(0.25D); + public static final Potion resistance = (new Potion(11, false, 10044730)).setPotionName("potion.resistance").setIconIndex(6, 1); ++ ++ /** The fire resistance Potion object. */ + public static final Potion fireResistance = (new Potion(12, false, 14981690)).setPotionName("potion.fireResistance").setIconIndex(7, 1); ++ ++ /** The water breathing Potion object. */ + public static final Potion waterBreathing = (new Potion(13, false, 3035801)).setPotionName("potion.waterBreathing").setIconIndex(0, 2); ++ ++ /** The invisibility Potion object. */ + public static final Potion invisibility = (new Potion(14, false, 8356754)).setPotionName("potion.invisibility").setIconIndex(0, 1); ++ ++ /** The blindness Potion object. */ + public static final Potion blindness = (new Potion(15, true, 2039587)).setPotionName("potion.blindness").setIconIndex(5, 1).setEffectiveness(0.25D); ++ ++ /** The night vision Potion object. */ + public static final Potion nightVision = (new Potion(16, false, 2039713)).setPotionName("potion.nightVision").setIconIndex(4, 1); ++ ++ /** The hunger Potion object. */ + public static final Potion hunger = (new Potion(17, true, 5797459)).setPotionName("potion.hunger").setIconIndex(1, 1); ++ ++ /** The weakness Potion object. */ + public static final Potion weakness = (new PotionAttackDamage(18, true, 4738376)).setPotionName("potion.weakness").setIconIndex(5, 0).func_111184_a(SharedMonsterAttributes.attackDamage, "22653B89-116E-49DC-9B6B-9971489B5BE5", 2.0D, 0); ++ ++ /** The poison Potion object. */ + public static final Potion poison = (new Potion(19, true, 5149489)).setPotionName("potion.poison").setIconIndex(6, 0).setEffectiveness(0.25D); ++ ++ /** The wither Potion object. */ + public static final Potion wither = (new Potion(20, true, 3484199)).setPotionName("potion.wither").setIconIndex(1, 2).setEffectiveness(0.25D); + public static final Potion field_76434_w = (new PotionHealthBoost(21, false, 16284963)).setPotionName("potion.healthBoost").setIconIndex(2, 2).func_111184_a(SharedMonsterAttributes.maxHealth, "5D6F0BA2-1186-46AC-B896-C61C5CEE99CC", 4.0D, 0); + public static final Potion field_76444_x = (new PotionAbsoption(22, false, 2445989)).setPotionName("potion.absorption").setIconIndex(2, 2); +@@ -40,134 +65,180 @@ + public static final Potion field_76406_E = null; + public static final Potion field_76407_F = null; + public static final Potion field_76408_G = null; ++ ++ /** The Id of a Potion object. */ + public final int id; +- private final Map I = Maps.newHashMap(); ++ private final Map field_111188_I = Maps.newHashMap(); ++ ++ /** ++ * This field indicated if the effect is 'bad' - negative - for the entity. ++ */ + private final boolean isBadEffect; +- private final int liquidColor; +- private String L = ""; ++ ++ /** Is the color of the liquid for this potion. */ ++ public int liquidColor; ++ ++ /** The name of the Potion. */ ++ public String name = ""; ++ ++ /** The index for the icon displayed when the potion effect is active. */ + private int statusIconIndex = -1; + private double effectiveness; + private boolean usable; +- +- protected Potion(int var1, boolean var2, int var3) { +- this.id = var1; +- potionTypes[var1] = this; +- this.isBadEffect = var2; +- if(var2) { ++ public int origColor; ++ ++ protected Potion(int par1, boolean par2, int par3) { ++ this.id = par1; ++ potionTypes[par1] = this; ++ this.isBadEffect = par2; ++ ++ if (par2) { + this.effectiveness = 0.5D; + } else { + this.effectiveness = 1.0D; + } + +- this.liquidColor = var3; ++ this.liquidColor = par3; + } + +- protected Potion setIconIndex(int var1, int var2) { +- this.statusIconIndex = var1 + var2 * 8; ++ /** ++ * Sets the index for the icon displayed in the player's inventory when the status is active. ++ */ ++ protected Potion setIconIndex(int par1, int par2) { ++ this.statusIconIndex = par1 + par2 * 8; + return this; + } + ++ /** ++ * returns the ID of the potion ++ */ + public int getId() { + return this.id; + } + +- public void performEffect(EntityLivingBase var1, int var2) { +- if(this.id == regeneration.id) { +- if(var1.getHealth() < var1.getMaxHealth()) { +- var1.heal(1.0F); +- } +- } else if(this.id == poison.id) { +- if(var1.getHealth() > 1.0F) { +- var1.attackEntityFrom(DamageSource.magic, 1.0F); +- } +- } else if(this.id == wither.id) { +- var1.attackEntityFrom(DamageSource.wither, 1.0F); +- } else if(this.id == hunger.id && var1 instanceof EntityPlayer) { +- ((EntityPlayer)var1).addExhaustion(0.025F * (float)(var2 + 1)); +- } else if(this.id == field_76443_y.id && var1 instanceof EntityPlayer) { +- if(!var1.worldObj.isRemote) { +- ((EntityPlayer)var1).getFoodStats().addStats(var2 + 1, 1.0F); +- } +- } else if((this.id != heal.id || var1.isEntityUndead()) && (this.id != harm.id || !var1.isEntityUndead())) { +- if(this.id == harm.id && !var1.isEntityUndead() || this.id == heal.id && var1.isEntityUndead()) { +- var1.attackEntityFrom(DamageSource.magic, (float)(6 << var2)); ++ public void performEffect(EntityLivingBase par1EntityLivingBase, int par2) { ++ if (this.id == regeneration.id) { ++ if (par1EntityLivingBase.getHealth() < par1EntityLivingBase.getMaxHealth()) { ++ par1EntityLivingBase.heal(1.0F); ++ } ++ } else if (this.id == poison.id) { ++ if (par1EntityLivingBase.getHealth() > 1.0F) { ++ par1EntityLivingBase.attackEntityFrom(DamageSource.magic, 1.0F); ++ } ++ } else if (this.id == wither.id) { ++ par1EntityLivingBase.attackEntityFrom(DamageSource.wither, 1.0F); ++ } else if (this.id == hunger.id && par1EntityLivingBase instanceof EntityPlayer) { ++ ((EntityPlayer)par1EntityLivingBase).addExhaustion(0.025F * (float)(par2 + 1)); ++ } else if (this.id == field_76443_y.id && par1EntityLivingBase instanceof EntityPlayer) { ++ if (!par1EntityLivingBase.worldObj.isRemote) { ++ ((EntityPlayer)par1EntityLivingBase).getFoodStats().addStats(par2 + 1, 1.0F); ++ } ++ } else if ((this.id != heal.id || par1EntityLivingBase.isEntityUndead()) && (this.id != harm.id || !par1EntityLivingBase.isEntityUndead())) { ++ if (this.id == harm.id && !par1EntityLivingBase.isEntityUndead() || this.id == heal.id && par1EntityLivingBase.isEntityUndead()) { ++ par1EntityLivingBase.attackEntityFrom(DamageSource.magic, (float)(6 << par2)); + } + } else { +- var1.heal((float)Math.max(4 << var2, 0)); ++ par1EntityLivingBase.heal((float)Math.max(4 << par2, 0)); + } +- + } + +- public void affectEntity(EntityLivingBase var1, EntityLivingBase var2, int var3, double var4) { ++ /** ++ * Hits the provided entity with this potion's instant effect. ++ */ ++ public void affectEntity(EntityLivingBase par1EntityLivingBase, EntityLivingBase par2EntityLivingBase, int par3, double par4) { + int var6; +- if((this.id != heal.id || var2.isEntityUndead()) && (this.id != harm.id || !var2.isEntityUndead())) { +- if(this.id == harm.id && !var2.isEntityUndead() || this.id == heal.id && var2.isEntityUndead()) { +- var6 = (int)(var4 * (double)(6 << var3) + 0.5D); +- if(var1 == null) { +- var2.attackEntityFrom(DamageSource.magic, (float)var6); ++ ++ if ((this.id != heal.id || par2EntityLivingBase.isEntityUndead()) && (this.id != harm.id || !par2EntityLivingBase.isEntityUndead())) { ++ if (this.id == harm.id && !par2EntityLivingBase.isEntityUndead() || this.id == heal.id && par2EntityLivingBase.isEntityUndead()) { ++ var6 = (int)(par4 * (double)(6 << par3) + 0.5D); ++ ++ if (par1EntityLivingBase == null) { ++ par2EntityLivingBase.attackEntityFrom(DamageSource.magic, (float)var6); + } else { +- var2.attackEntityFrom(DamageSource.causeIndirectMagicDamage(var2, var1), (float)var6); ++ par2EntityLivingBase.attackEntityFrom(DamageSource.causeIndirectMagicDamage(par2EntityLivingBase, par1EntityLivingBase), (float)var6); + } + } + } else { +- var6 = (int)(var4 * (double)(4 << var3) + 0.5D); +- var2.heal((float)var6); ++ var6 = (int)(par4 * (double)(4 << par3) + 0.5D); ++ par2EntityLivingBase.heal((float)var6); + } +- + } + ++ /** ++ * Returns true if the potion has an instant effect instead of a continuous one (eg Harming) ++ */ + public boolean isInstant() { + return false; + } + +- public boolean isReady(int var1, int var2) { ++ /** ++ * checks if Potion effect is ready to be applied this tick. ++ */ ++ public boolean isReady(int par1, int par2) { + int var3; +- if(this.id == regeneration.id) { +- var3 = 50 >> var2; +- return var3 > 0 ? var1 % var3 == 0 : true; +- } else if(this.id == poison.id) { +- var3 = 25 >> var2; +- return var3 > 0 ? var1 % var3 == 0 : true; +- } else if(this.id == wither.id) { +- var3 = 40 >> var2; +- return var3 > 0 ? var1 % var3 == 0 : true; ++ ++ if (this.id == regeneration.id) { ++ var3 = 50 >> par2; ++ return var3 > 0 ? par1 % var3 == 0 : true; ++ } else if (this.id == poison.id) { ++ var3 = 25 >> par2; ++ return var3 > 0 ? par1 % var3 == 0 : true; ++ } else if (this.id == wither.id) { ++ var3 = 40 >> par2; ++ return var3 > 0 ? par1 % var3 == 0 : true; + } else { + return this.id == hunger.id; + } + } + +- public Potion setPotionName(String var1) { +- this.L = var1; ++ /** ++ * Set the potion name. ++ */ ++ public Potion setPotionName(String par1Str) { ++ this.name = par1Str; ++ ColorizeItem.setupPotion(this); + return this; + } + ++ /** ++ * returns the name of the potion ++ */ + public String getName() { +- return this.L; ++ return this.name; + } + ++ /** ++ * Returns true if the potion has a associated status icon to display in then inventory when active. ++ */ + public boolean hasStatusIcon() { + return this.statusIconIndex >= 0; + } + ++ /** ++ * Returns the index for the icon to display when the potion is active. ++ */ + public int getStatusIconIndex() { + return this.statusIconIndex; + } + ++ /** ++ * This method returns true if the potion effect is bad - negative - for the entity. ++ */ + public boolean isBadEffect() { + return this.isBadEffect; + } + +- public static String getDurationString(PotionEffect var0) { +- if(var0.getIsPotionDurationMax()) { ++ public static String getDurationString(PotionEffect par0PotionEffect) { ++ if (par0PotionEffect.getIsPotionDurationMax()) { + return "**:**"; + } else { +- int var1 = var0.getDuration(); ++ int var1 = par0PotionEffect.getDuration(); + return StringUtils.ticksToElapsedTime(var1); + } + } + +- protected Potion setEffectiveness(double var1) { +- this.effectiveness = var1; ++ protected Potion setEffectiveness(double par1) { ++ this.effectiveness = par1; + return this; + } + +@@ -179,49 +250,52 @@ + return this.usable; + } + ++ /** ++ * Returns the color of the potion liquid. ++ */ + public int getLiquidColor() { + return this.liquidColor; + } + +- public Potion func_111184_a(Attribute var1, String var2, double var3, int var5) { +- AttributeModifier var6 = new AttributeModifier(UUID.fromString(var2), this.getName(), var3, var5); +- this.I.put(var1, var6); ++ public Potion func_111184_a(Attribute par1Attribute, String par2Str, double par3, int par5) { ++ AttributeModifier var6 = new AttributeModifier(UUID.fromString(par2Str), this.getName(), par3, par5); ++ this.field_111188_I.put(par1Attribute, var6); + return this; + } + + public Map func_111186_k() { +- return this.I; ++ return this.field_111188_I; + } + +- public void removeAttributesModifiersFromEntity(EntityLivingBase var1, BaseAttributeMap var2, int var3) { +- Iterator var4 = this.I.entrySet().iterator(); ++ public void removeAttributesModifiersFromEntity(EntityLivingBase par1EntityLivingBase, BaseAttributeMap par2BaseAttributeMap, int par3) { ++ Iterator var4 = this.field_111188_I.entrySet().iterator(); + +- while(var4.hasNext()) { ++ while (var4.hasNext()) { + Entry var5 = (Entry)var4.next(); +- AttributeInstance var6 = var2.getAttributeInstance((Attribute)var5.getKey()); +- if(var6 != null) { ++ AttributeInstance var6 = par2BaseAttributeMap.getAttributeInstance((Attribute)var5.getKey()); ++ ++ if (var6 != null) { + var6.removeModifier((AttributeModifier)var5.getValue()); + } + } +- + } + +- public void applyAttributesModifiersToEntity(EntityLivingBase var1, BaseAttributeMap var2, int var3) { +- Iterator var4 = this.I.entrySet().iterator(); ++ public void applyAttributesModifiersToEntity(EntityLivingBase par1EntityLivingBase, BaseAttributeMap par2BaseAttributeMap, int par3) { ++ Iterator var4 = this.field_111188_I.entrySet().iterator(); + +- while(var4.hasNext()) { ++ while (var4.hasNext()) { + Entry var5 = (Entry)var4.next(); +- AttributeInstance var6 = var2.getAttributeInstance((Attribute)var5.getKey()); +- if(var6 != null) { ++ AttributeInstance var6 = par2BaseAttributeMap.getAttributeInstance((Attribute)var5.getKey()); ++ ++ if (var6 != null) { + AttributeModifier var7 = (AttributeModifier)var5.getValue(); + var6.removeModifier(var7); +- var6.applyModifier(new AttributeModifier(var7.getID(), this.getName() + " " + var3, this.func_111183_a(var3, var7), var7.getOperation())); ++ var6.applyModifier(new AttributeModifier(var7.getID(), this.getName() + " " + par3, this.func_111183_a(par3, var7), var7.getOperation())); + } + } +- + } + +- public double func_111183_a(int var1, AttributeModifier var2) { +- return var2.getAmount() * (double)(var1 + 1); ++ public double func_111183_a(int par1, AttributeModifier par2AttributeModifier) { ++ return par2AttributeModifier.getAmount() * (double)(par1 + 1); + } + } diff --git a/patches/net/minecraft/src/PotionAbsoption.java.patch b/patches/net/minecraft/src/PotionAbsoption.java.patch new file mode 100644 index 0000000..8b82e68 --- /dev/null +++ b/patches/net/minecraft/src/PotionAbsoption.java.patch @@ -0,0 +1,32 @@ +--- net/minecraft/src/PotionAbsoption.java ++++ net/minecraft/src/PotionAbsoption.java +@@ -1,17 +1,17 @@ + package net.minecraft.src; + + public class PotionAbsoption extends Potion { +- protected PotionAbsoption(int var1, boolean var2, int var3) { +- super(var1, var2, var3); +- } +- +- public void removeAttributesModifiersFromEntity(EntityLivingBase var1, BaseAttributeMap var2, int var3) { +- var1.setAbsorptionAmount(var1.getAbsorptionAmount() - (float)(4 * (var3 + 1))); +- super.removeAttributesModifiersFromEntity(var1, var2, var3); +- } +- +- public void applyAttributesModifiersToEntity(EntityLivingBase var1, BaseAttributeMap var2, int var3) { +- var1.setAbsorptionAmount(var1.getAbsorptionAmount() + (float)(4 * (var3 + 1))); +- super.applyAttributesModifiersToEntity(var1, var2, var3); ++ protected PotionAbsoption(int par1, boolean par2, int par3) { ++ super(par1, par2, par3); ++ } ++ ++ public void removeAttributesModifiersFromEntity(EntityLivingBase par1EntityLivingBase, BaseAttributeMap par2BaseAttributeMap, int par3) { ++ par1EntityLivingBase.setAbsorptionAmount(par1EntityLivingBase.getAbsorptionAmount() - (float)(4 * (par3 + 1))); ++ super.removeAttributesModifiersFromEntity(par1EntityLivingBase, par2BaseAttributeMap, par3); ++ } ++ ++ public void applyAttributesModifiersToEntity(EntityLivingBase par1EntityLivingBase, BaseAttributeMap par2BaseAttributeMap, int par3) { ++ par1EntityLivingBase.setAbsorptionAmount(par1EntityLivingBase.getAbsorptionAmount() + (float)(4 * (par3 + 1))); ++ super.applyAttributesModifiersToEntity(par1EntityLivingBase, par2BaseAttributeMap, par3); + } + } diff --git a/patches/net/minecraft/src/PotionAttackDamage.java.patch b/patches/net/minecraft/src/PotionAttackDamage.java.patch new file mode 100644 index 0000000..5d56e3a --- /dev/null +++ b/patches/net/minecraft/src/PotionAttackDamage.java.patch @@ -0,0 +1,18 @@ +--- net/minecraft/src/PotionAttackDamage.java ++++ net/minecraft/src/PotionAttackDamage.java +@@ -1,11 +1,11 @@ + package net.minecraft.src; + + public class PotionAttackDamage extends Potion { +- protected PotionAttackDamage(int var1, boolean var2, int var3) { +- super(var1, var2, var3); ++ protected PotionAttackDamage(int par1, boolean par2, int par3) { ++ super(par1, par2, par3); + } + +- public double func_111183_a(int var1, AttributeModifier var2) { +- return this.id == Potion.weakness.id ? (double)(-0.5F * (float)(var1 + 1)) : 1.3D * (double)(var1 + 1); ++ public double func_111183_a(int par1, AttributeModifier par2AttributeModifier) { ++ return this.id == Potion.weakness.id ? (double)(-0.5F * (float)(par1 + 1)) : 1.3D * (double)(par1 + 1); + } + } diff --git a/patches/net/minecraft/src/PotionEffect.java.patch b/patches/net/minecraft/src/PotionEffect.java.patch new file mode 100644 index 0000000..c4e7e77 --- /dev/null +++ b/patches/net/minecraft/src/PotionEffect.java.patch @@ -0,0 +1,223 @@ +--- net/minecraft/src/PotionEffect.java ++++ net/minecraft/src/PotionEffect.java +@@ -1,50 +1,68 @@ + package net.minecraft.src; + + public class PotionEffect { ++ ++ /** ID value of the potion this effect matches. */ + private int potionID; ++ ++ /** The duration of the potion effect */ + private int duration; ++ ++ /** The amplifier of the potion effect */ + private int amplifier; ++ ++ /** Whether the potion is a splash potion */ + private boolean isSplashPotion; ++ ++ /** Whether the potion effect came from a beacon */ + private boolean isAmbient; ++ ++ /** True if potion effect duration is at maximum, false otherwise. */ + private boolean isPotionDurationMax; + +- public PotionEffect(int var1, int var2) { +- this(var1, var2, 0); +- } +- +- public PotionEffect(int var1, int var2, int var3) { +- this(var1, var2, var3, false); +- } +- +- public PotionEffect(int var1, int var2, int var3, boolean var4) { +- this.potionID = var1; +- this.duration = var2; +- this.amplifier = var3; +- this.isAmbient = var4; +- } +- +- public PotionEffect(PotionEffect var1) { +- this.potionID = var1.potionID; +- this.duration = var1.duration; +- this.amplifier = var1.amplifier; +- } +- +- public void combine(PotionEffect var1) { +- if(this.potionID != var1.potionID) { ++ public PotionEffect(int par1, int par2) { ++ this(par1, par2, 0); ++ } ++ ++ public PotionEffect(int par1, int par2, int par3) { ++ this(par1, par2, par3, false); ++ } ++ ++ public PotionEffect(int par1, int par2, int par3, boolean par4) { ++ this.potionID = par1; ++ this.duration = par2; ++ this.amplifier = par3; ++ this.isAmbient = par4; ++ } ++ ++ public PotionEffect(PotionEffect par1PotionEffect) { ++ this.potionID = par1PotionEffect.potionID; ++ this.duration = par1PotionEffect.duration; ++ this.amplifier = par1PotionEffect.amplifier; ++ } ++ ++ /** ++ * merges the input PotionEffect into this one if this.amplifier <= tomerge.amplifier. The duration in the supplied ++ * potion effect is assumed to be greater. ++ */ ++ public void combine(PotionEffect par1PotionEffect) { ++ if (this.potionID != par1PotionEffect.potionID) { + System.err.println("This method should only be called for matching effects!"); + } + +- if(var1.amplifier > this.amplifier) { +- this.amplifier = var1.amplifier; +- this.duration = var1.duration; +- } else if(var1.amplifier == this.amplifier && this.duration < var1.duration) { +- this.duration = var1.duration; +- } else if(!var1.isAmbient && this.isAmbient) { +- this.isAmbient = var1.isAmbient; ++ if (par1PotionEffect.amplifier > this.amplifier) { ++ this.amplifier = par1PotionEffect.amplifier; ++ this.duration = par1PotionEffect.duration; ++ } else if (par1PotionEffect.amplifier == this.amplifier && this.duration < par1PotionEffect.duration) { ++ this.duration = par1PotionEffect.duration; ++ } else if (!par1PotionEffect.isAmbient && this.isAmbient) { ++ this.isAmbient = par1PotionEffect.isAmbient; + } +- + } + ++ /** ++ * Retrieve the ID of the potion this effect matches. ++ */ + public int getPotionID() { + return this.potionID; + } +@@ -57,18 +75,24 @@ + return this.amplifier; + } + +- public void setSplashPotion(boolean var1) { +- this.isSplashPotion = var1; ++ /** ++ * Set whether this potion is a splash potion. ++ */ ++ public void setSplashPotion(boolean par1) { ++ this.isSplashPotion = par1; + } + ++ /** ++ * Gets whether this potion effect originated from a beacon ++ */ + public boolean getIsAmbient() { + return this.isAmbient; + } + +- public boolean onUpdate(EntityLivingBase var1) { +- if(this.duration > 0) { +- if(Potion.potionTypes[this.potionID].isReady(this.duration, this.amplifier)) { +- this.performEffect(var1); ++ public boolean onUpdate(EntityLivingBase par1EntityLivingBase) { ++ if (this.duration > 0) { ++ if (Potion.potionTypes[this.potionID].isReady(this.duration, this.amplifier)) { ++ this.performEffect(par1EntityLivingBase); + } + + this.deincrementDuration(); +@@ -81,11 +105,10 @@ + return --this.duration; + } + +- public void performEffect(EntityLivingBase var1) { +- if(this.duration > 0) { +- Potion.potionTypes[this.potionID].performEffect(var1, this.amplifier); ++ public void performEffect(EntityLivingBase par1EntityLivingBase) { ++ if (this.duration > 0) { ++ Potion.potionTypes[this.potionID].performEffect(par1EntityLivingBase, this.amplifier); + } +- + } + + public String getEffectName() { +@@ -98,46 +121,56 @@ + + public String toString() { + String var1 = ""; +- if(this.getAmplifier() > 0) { ++ ++ if (this.getAmplifier() > 0) { + var1 = this.getEffectName() + " x " + (this.getAmplifier() + 1) + ", Duration: " + this.getDuration(); + } else { + var1 = this.getEffectName() + ", Duration: " + this.getDuration(); + } + +- if(this.isSplashPotion) { ++ if (this.isSplashPotion) { + var1 = var1 + ", Splash: true"; + } + + return Potion.potionTypes[this.potionID].isUsable() ? "(" + var1 + ")" : var1; + } + +- public boolean equals(Object var1) { +- if(!(var1 instanceof PotionEffect)) { ++ public boolean equals(Object par1Obj) { ++ if (!(par1Obj instanceof PotionEffect)) { + return false; + } else { +- PotionEffect var2 = (PotionEffect)var1; ++ PotionEffect var2 = (PotionEffect)par1Obj; + return this.potionID == var2.potionID && this.amplifier == var2.amplifier && this.duration == var2.duration && this.isSplashPotion == var2.isSplashPotion && this.isAmbient == var2.isAmbient; + } + } + +- public NBTTagCompound writeCustomPotionEffectToNBT(NBTTagCompound var1) { +- var1.setByte("Id", (byte)this.getPotionID()); +- var1.setByte("Amplifier", (byte)this.getAmplifier()); +- var1.setInteger("Duration", this.getDuration()); +- var1.setBoolean("Ambient", this.getIsAmbient()); +- return var1; ++ /** ++ * Write a custom potion effect to a potion item's NBT data. ++ */ ++ public NBTTagCompound writeCustomPotionEffectToNBT(NBTTagCompound par1NBTTagCompound) { ++ par1NBTTagCompound.setByte("Id", (byte)this.getPotionID()); ++ par1NBTTagCompound.setByte("Amplifier", (byte)this.getAmplifier()); ++ par1NBTTagCompound.setInteger("Duration", this.getDuration()); ++ par1NBTTagCompound.setBoolean("Ambient", this.getIsAmbient()); ++ return par1NBTTagCompound; + } + +- public static PotionEffect readCustomPotionEffectFromNBT(NBTTagCompound var0) { +- byte var1 = var0.getByte("Id"); +- byte var2 = var0.getByte("Amplifier"); +- int var3 = var0.getInteger("Duration"); +- boolean var4 = var0.getBoolean("Ambient"); ++ /** ++ * Read a custom potion effect from a potion item's NBT data. ++ */ ++ public static PotionEffect readCustomPotionEffectFromNBT(NBTTagCompound par0NBTTagCompound) { ++ byte var1 = par0NBTTagCompound.getByte("Id"); ++ byte var2 = par0NBTTagCompound.getByte("Amplifier"); ++ int var3 = par0NBTTagCompound.getInteger("Duration"); ++ boolean var4 = par0NBTTagCompound.getBoolean("Ambient"); + return new PotionEffect(var1, var3, var2, var4); + } + +- public void setPotionDurationMax(boolean var1) { +- this.isPotionDurationMax = var1; ++ /** ++ * Toggle the isPotionDurationMax field. ++ */ ++ public void setPotionDurationMax(boolean par1) { ++ this.isPotionDurationMax = par1; + } + + public boolean getIsPotionDurationMax() { diff --git a/patches/net/minecraft/src/PotionHealth.java.patch b/patches/net/minecraft/src/PotionHealth.java.patch new file mode 100644 index 0000000..79b15ef --- /dev/null +++ b/patches/net/minecraft/src/PotionHealth.java.patch @@ -0,0 +1,28 @@ +--- net/minecraft/src/PotionHealth.java ++++ net/minecraft/src/PotionHealth.java +@@ -1,15 +1,21 @@ + package net.minecraft.src; + + public class PotionHealth extends Potion { +- public PotionHealth(int var1, boolean var2, int var3) { +- super(var1, var2, var3); ++ public PotionHealth(int par1, boolean par2, int par3) { ++ super(par1, par2, par3); + } + ++ /** ++ * Returns true if the potion has an instant effect instead of a continuous one (eg Harming) ++ */ + public boolean isInstant() { + return true; + } + +- public boolean isReady(int var1, int var2) { +- return var1 >= 1; ++ /** ++ * checks if Potion effect is ready to be applied this tick. ++ */ ++ public boolean isReady(int par1, int par2) { ++ return par1 >= 1; + } + } diff --git a/patches/net/minecraft/src/PotionHealthBoost.java.patch b/patches/net/minecraft/src/PotionHealthBoost.java.patch new file mode 100644 index 0000000..8b93f50 --- /dev/null +++ b/patches/net/minecraft/src/PotionHealthBoost.java.patch @@ -0,0 +1,25 @@ +--- net/minecraft/src/PotionHealthBoost.java ++++ net/minecraft/src/PotionHealthBoost.java +@@ -1,15 +1,15 @@ + package net.minecraft.src; + + public class PotionHealthBoost extends Potion { +- public PotionHealthBoost(int var1, boolean var2, int var3) { +- super(var1, var2, var3); ++ public PotionHealthBoost(int par1, boolean par2, int par3) { ++ super(par1, par2, par3); + } + +- public void removeAttributesModifiersFromEntity(EntityLivingBase var1, BaseAttributeMap var2, int var3) { +- super.removeAttributesModifiersFromEntity(var1, var2, var3); +- if(var1.getHealth() > var1.getMaxHealth()) { +- var1.setHealth(var1.getMaxHealth()); ++ public void removeAttributesModifiersFromEntity(EntityLivingBase par1EntityLivingBase, BaseAttributeMap par2BaseAttributeMap, int par3) { ++ super.removeAttributesModifiersFromEntity(par1EntityLivingBase, par2BaseAttributeMap, par3); ++ ++ if (par1EntityLivingBase.getHealth() > par1EntityLivingBase.getMaxHealth()) { ++ par1EntityLivingBase.setHealth(par1EntityLivingBase.getMaxHealth()); + } +- + } + } diff --git a/patches/net/minecraft/src/PotionHelper.java.patch b/patches/net/minecraft/src/PotionHelper.java.patch new file mode 100644 index 0000000..189e43c --- /dev/null +++ b/patches/net/minecraft/src/PotionHelper.java.patch @@ -0,0 +1,680 @@ +--- net/minecraft/src/PotionHelper.java ++++ net/minecraft/src/PotionHelper.java +@@ -6,54 +6,75 @@ + import java.util.Iterator; + import java.util.List; + ++import com.prupe.mcpatcher.cc.ColorizeItem; ++ + public class PotionHelper { +- public static final String a = null; +- public static final String b; +- public static final String c = "+0-1-2-3&4-4+13"; +- public static final String d; +- public static final String e; +- public static final String f; +- public static final String g; +- public static final String h; +- public static final String i; +- public static final String j; +- public static final String k; +- public static final String l; +- private static final HashMap m = new HashMap(); +- private static final HashMap n = new HashMap(); +- private static final HashMap o; +- private static final String[] p; +- +- public static boolean checkFlag(int var0, int var1) { +- return (var0 & 1 << var1) != 0; +- } +- +- private static int isFlagSet(int var0, int var1) { +- return checkFlag(var0, var1) ? 1 : 0; +- } +- +- private static int isFlagUnset(int var0, int var1) { +- return checkFlag(var0, var1) ? 0 : 1; +- } +- +- public static int func_77909_a(int var0) { +- return func_77908_a(var0, 5, 4, 3, 2, 1); +- } +- +- public static int calcPotionLiquidColor(Collection var0) { +- int var1 = 3694022; +- if(var0 != null && !var0.isEmpty()) { ++ public static final String field_77924_a = null; ++ public static final String sugarEffect; ++ public static final String ghastTearEffect = "+0-1-2-3&4-4+13"; ++ public static final String spiderEyeEffect; ++ public static final String fermentedSpiderEyeEffect; ++ public static final String speckledMelonEffect; ++ public static final String blazePowderEffect; ++ public static final String magmaCreamEffect; ++ public static final String redstoneEffect; ++ public static final String glowstoneEffect; ++ public static final String gunpowderEffect; ++ public static final String goldenCarrotEffect; ++ private static final HashMap potionRequirements = new HashMap(); ++ ++ /** Potion effect amplifier map */ ++ private static final HashMap potionAmplifiers = new HashMap(); ++ public static final HashMap field_77925_n; ++ ++ /** An array of possible potion prefix names, as translation IDs. */ ++ private static final String[] potionPrefixes; ++ ++ /** ++ * Is the bit given set to 1? ++ */ ++ public static boolean checkFlag(int par0, int par1) { ++ return (par0 & 1 << par1) != 0; ++ } ++ ++ /** ++ * Returns 1 if the flag is set, 0 if it is not set. ++ */ ++ private static int isFlagSet(int par0, int par1) { ++ return checkFlag(par0, par1) ? 1 : 0; ++ } ++ ++ /** ++ * Returns 0 if the flag is set, 1 if it is not set. ++ */ ++ private static int isFlagUnset(int par0, int par1) { ++ return checkFlag(par0, par1) ? 0 : 1; ++ } ++ ++ public static int func_77909_a(int par0) { ++ return func_77908_a(par0, 5, 4, 3, 2, 1); ++ } ++ ++ /** ++ * Given a {@link Collection}<{@link PotionEffect}> will return an Integer color. ++ */ ++ public static int calcPotionLiquidColor(Collection par0Collection) { ++ // MCPatcher Start ++ int var1 = ColorizeItem.getWaterBottleColor(); ++ // MCPatcher End ++ ++ if (par0Collection != null && !par0Collection.isEmpty()) { + float var2 = 0.0F; + float var3 = 0.0F; + float var4 = 0.0F; + float var5 = 0.0F; +- Iterator var6 = var0.iterator(); ++ Iterator var6 = par0Collection.iterator(); + +- while(var6.hasNext()) { ++ while (var6.hasNext()) { + PotionEffect var7 = (PotionEffect)var6.next(); + int var8 = Potion.potionTypes[var7.getPotionID()].getLiquidColor(); + +- for(int var9 = 0; var9 <= var7.getAmplifier(); ++var9) { ++ for (int var9 = 0; var9 <= var7.getAmplifier(); ++var9) { + var2 += (float)(var8 >> 16 & 255) / 255.0F; + var3 += (float)(var8 >> 8 & 255) / 255.0F; + var4 += (float)(var8 >> 0 & 255) / 255.0F; +@@ -70,97 +91,106 @@ + } + } + +- public static boolean func_82817_b(Collection var0) { +- Iterator var1 = var0.iterator(); +- ++ public static boolean func_82817_b(Collection par0Collection) { ++ Iterator var1 = par0Collection.iterator(); + PotionEffect var2; ++ + do { +- if(!var1.hasNext()) { ++ if (!var1.hasNext()) { + return true; + } + + var2 = (PotionEffect)var1.next(); +- } while(var2.getIsAmbient()); ++ } while (var2.getIsAmbient()); + + return false; + } + +- public static int func_77915_a(int var0, boolean var1) { +- if(!var1) { +- if(o.containsKey(Integer.valueOf(var0))) { +- return ((Integer)o.get(Integer.valueOf(var0))).intValue(); ++ public static int func_77915_a(int par0, boolean par1) { ++ if (!par1) { ++ if (field_77925_n.containsKey(Integer.valueOf(par0))) { ++ return ((Integer)field_77925_n.get(Integer.valueOf(par0))).intValue(); + } else { +- int var2 = calcPotionLiquidColor(getPotionEffects(var0, false)); +- o.put(Integer.valueOf(var0), Integer.valueOf(var2)); ++ int var2 = calcPotionLiquidColor(getPotionEffects(par0, false)); ++ field_77925_n.put(Integer.valueOf(par0), Integer.valueOf(var2)); + return var2; + } + } else { +- return calcPotionLiquidColor(getPotionEffects(var0, var1)); ++ return calcPotionLiquidColor(getPotionEffects(par0, par1)); + } + } + +- public static String func_77905_c(int var0) { +- int var1 = func_77909_a(var0); +- return p[var1]; ++ public static String func_77905_c(int par0) { ++ int var1 = func_77909_a(par0); ++ return potionPrefixes[var1]; + } + +- private static int func_77904_a(boolean var0, boolean var1, boolean var2, int var3, int var4, int var5, int var6) { ++ private static int func_77904_a(boolean par0, boolean par1, boolean par2, int par3, int par4, int par5, int par6) { + int var7 = 0; +- if(var0) { +- var7 = isFlagUnset(var6, var4); +- } else if(var3 != -1) { +- if(var3 == 0 && countSetFlags(var6) == var4) { +- var7 = 1; +- } else if(var3 == 1 && countSetFlags(var6) > var4) { +- var7 = 1; +- } else if(var3 == 2 && countSetFlags(var6) < var4) { ++ ++ if (par0) { ++ var7 = isFlagUnset(par6, par4); ++ } else if (par3 != -1) { ++ if (par3 == 0 && countSetFlags(par6) == par4) { ++ var7 = 1; ++ } else if (par3 == 1 && countSetFlags(par6) > par4) { ++ var7 = 1; ++ } else if (par3 == 2 && countSetFlags(par6) < par4) { + var7 = 1; + } + } else { +- var7 = isFlagSet(var6, var4); +- } +- +- if(var1) { +- var7 *= var5; +- } +- +- if(var2) { ++ var7 = isFlagSet(par6, par4); ++ } ++ ++ if (par1) { ++ var7 *= par5; ++ } ++ ++ if (par2) { + var7 *= -1; + } + + return var7; + } + +- private static int countSetFlags(int var0) { ++ /** ++ * Count the number of bits in an integer set to ON. ++ */ ++ private static int countSetFlags(int par0) { + int var1; +- for(var1 = 0; var0 > 0; ++var1) { +- var0 &= var0 - 1; ++ ++ for (var1 = 0; par0 > 0; ++var1) { ++ par0 &= par0 - 1; + } + + return var1; + } + +- private static int parsePotionEffects(String var0, int var1, int var2, int var3) { +- if(var1 < var0.length() && var2 >= 0 && var1 < var2) { +- int var4 = var0.indexOf(124, var1); ++ private static int parsePotionEffects(String par0Str, int par1, int par2, int par3) { ++ if (par1 < par0Str.length() && par2 >= 0 && par1 < par2) { ++ int var4 = par0Str.indexOf(124, par1); + int var5; + int var17; +- if(var4 >= 0 && var4 < var2) { +- var5 = parsePotionEffects(var0, var1, var4 - 1, var3); +- if(var5 > 0) { ++ ++ if (var4 >= 0 && var4 < par2) { ++ var5 = parsePotionEffects(par0Str, par1, var4 - 1, par3); ++ ++ if (var5 > 0) { + return var5; + } else { +- var17 = parsePotionEffects(var0, var4 + 1, var2, var3); ++ var17 = parsePotionEffects(par0Str, var4 + 1, par2, par3); + return var17 > 0 ? var17 : 0; + } + } else { +- var5 = var0.indexOf(38, var1); +- if(var5 >= 0 && var5 < var2) { +- var17 = parsePotionEffects(var0, var1, var5 - 1, var3); +- if(var17 <= 0) { ++ var5 = par0Str.indexOf(38, par1); ++ ++ if (var5 >= 0 && var5 < par2) { ++ var17 = parsePotionEffects(par0Str, par1, var5 - 1, par3); ++ ++ if (var17 <= 0) { + return 0; + } else { +- int var18 = parsePotionEffects(var0, var5 + 1, var2, var3); ++ int var18 = parsePotionEffects(par0Str, var5 + 1, par2, par3); + return var18 <= 0 ? 0 : (var17 > var18 ? var17 : var18); + } + } else { +@@ -174,10 +204,11 @@ + int var13 = 0; + int var14 = 0; + +- for(int var15 = var1; var15 < var2; ++var15) { +- char var16 = var0.charAt(var15); +- if(var16 >= 48 && var16 <= 57) { +- if(var6) { ++ for (int var15 = par1; var15 < par2; ++var15) { ++ char var16 = par0Str.charAt(var15); ++ ++ if (var16 >= 48 && var16 <= 57) { ++ if (var6) { + var13 = var16 - 48; + var7 = true; + } else { +@@ -185,72 +216,73 @@ + var12 += var16 - 48; + var8 = true; + } +- } else if(var16 == 42) { ++ } else if (var16 == 42) { + var6 = true; +- } else if(var16 == 33) { +- if(var8) { +- var14 += func_77904_a(var9, var7, var10, var11, var12, var13, var3); ++ } else if (var16 == 33) { ++ if (var8) { ++ var14 += func_77904_a(var9, var7, var10, var11, var12, var13, par3); + var9 = false; +- var10 = var9; +- var6 = var9; +- var7 = var9; +- var8 = var9; ++ var10 = false; ++ var6 = false; ++ var7 = false; ++ var8 = false; + var13 = 0; +- var12 = var13; ++ var12 = 0; + var11 = -1; + } + + var9 = true; +- } else if(var16 == 45) { +- if(var8) { +- var14 += func_77904_a(var9, var7, var10, var11, var12, var13, var3); ++ } else if (var16 == 45) { ++ if (var8) { ++ var14 += func_77904_a(var9, var7, var10, var11, var12, var13, par3); + var9 = false; +- var6 = var9; +- var7 = var9; +- var8 = var9; ++ var10 = false; ++ var6 = false; ++ var7 = false; ++ var8 = false; + var13 = 0; +- var12 = var13; ++ var12 = 0; + var11 = -1; + } + + var10 = true; +- } else if(var16 != 61 && var16 != 60 && var16 != 62) { +- if(var16 == 43 && var8) { +- var14 += func_77904_a(var9, var7, var10, var11, var12, var13, var3); ++ } else if (var16 != 61 && var16 != 60 && var16 != 62) { ++ if (var16 == 43 && var8) { ++ var14 += func_77904_a(var9, var7, var10, var11, var12, var13, par3); + var9 = false; +- var10 = var9; +- var6 = var9; +- var7 = var9; +- var8 = var9; ++ var10 = false; ++ var6 = false; ++ var7 = false; ++ var8 = false; + var13 = 0; +- var12 = var13; ++ var12 = 0; + var11 = -1; + } + } else { +- if(var8) { +- var14 += func_77904_a(var9, var7, var10, var11, var12, var13, var3); ++ if (var8) { ++ var14 += func_77904_a(var9, var7, var10, var11, var12, var13, par3); + var9 = false; +- var10 = var9; +- var6 = var9; +- var7 = var9; +- var8 = var9; ++ var10 = false; ++ var6 = false; ++ var7 = false; ++ var8 = false; + var13 = 0; +- var12 = var13; ++ var12 = 0; + var11 = -1; + } + +- if(var16 == 61) { ++ if (var16 == 61) { + var11 = 0; +- } else if(var16 == 60) { ++ } else if (var16 == 60) { + var11 = 2; +- } else if(var16 == 62) { ++ } else if (var16 == 62) { + var11 = 1; + } + } + } + +- if(var8) { +- var14 += func_77904_a(var9, var7, var10, var11, var12, var13, var3); ++ if (var8) { ++ var14 += func_77904_a(var9, var7, var10, var11, var12, var13, par3); + } + + return var14; +@@ -261,44 +293,54 @@ + } + } + +- public static List getPotionEffects(int var0, boolean var1) { ++ /** ++ * Returns a list of effects for the specified potion damage value. ++ */ ++ public static List getPotionEffects(int par0, boolean par1) { + ArrayList var2 = null; + Potion[] var3 = Potion.potionTypes; + int var4 = var3.length; + +- for(int var5 = 0; var5 < var4; ++var5) { ++ for (int var5 = 0; var5 < var4; ++var5) { + Potion var6 = var3[var5]; +- if(var6 != null && (!var6.isUsable() || var1)) { +- String var7 = (String)m.get(Integer.valueOf(var6.getId())); +- if(var7 != null) { +- int var8 = parsePotionEffects(var7, 0, var7.length(), var0); +- if(var8 > 0) { ++ ++ if (var6 != null && (!var6.isUsable() || par1)) { ++ String var7 = (String)potionRequirements.get(Integer.valueOf(var6.getId())); ++ ++ if (var7 != null) { ++ int var8 = parsePotionEffects(var7, 0, var7.length(), par0); ++ ++ if (var8 > 0) { + int var9 = 0; +- String var10 = (String)n.get(Integer.valueOf(var6.getId())); +- if(var10 != null) { +- var9 = parsePotionEffects(var10, 0, var10.length(), var0); +- if(var9 < 0) { ++ String var10 = (String)potionAmplifiers.get(Integer.valueOf(var6.getId())); ++ ++ if (var10 != null) { ++ var9 = parsePotionEffects(var10, 0, var10.length(), par0); ++ ++ if (var9 < 0) { + var9 = 0; + } + } + +- if(var6.isInstant()) { ++ if (var6.isInstant()) { + var8 = 1; + } else { + var8 = 1200 * (var8 * 3 + (var8 - 1) * 2); + var8 >>= var9; + var8 = (int)Math.round((double)var8 * var6.getEffectiveness()); +- if((var0 & 16384) != 0) { ++ ++ if ((par0 & 16384) != 0) { + var8 = (int)Math.round((double)var8 * 0.75D + 0.5D); + } + } + +- if(var2 == null) { ++ if (var2 == null) { + var2 = new ArrayList(); + } + + PotionEffect var11 = new PotionEffect(var6.getId(), var8, var9); +- if((var0 & 16384) != 0) { ++ ++ if ((par0 & 16384) != 0) { + var11.setSplashPotion(true); + } + +@@ -311,77 +353,89 @@ + return var2; + } + +- private static int brewBitOperations(int var0, int var1, boolean var2, boolean var3, boolean var4) { +- if(var4) { +- if(!checkFlag(var0, var1)) { ++ /** ++ * Does bit operations for brewPotionData, given data, the index of the bit being operated upon, whether the bit will ++ * be removed, whether the bit will be toggled (NOT), or whether the data field will be set to 0 if the bit is not ++ * present. ++ */ ++ private static int brewBitOperations(int par0, int par1, boolean par2, boolean par3, boolean par4) { ++ if (par4) { ++ if (!checkFlag(par0, par1)) { + return 0; + } +- } else if(var2) { +- var0 &= ~(1 << var1); +- } else if(var3) { +- if((var0 & 1 << var1) == 0) { +- var0 |= 1 << var1; ++ } else if (par2) { ++ par0 &= ~(1 << par1); ++ } else if (par3) { ++ if ((par0 & 1 << par1) == 0) { ++ par0 |= 1 << par1; + } else { +- var0 &= ~(1 << var1); ++ par0 &= ~(1 << par1); + } + } else { +- var0 |= 1 << var1; ++ par0 |= 1 << par1; + } + +- return var0; ++ return par0; + } + +- public static int applyIngredient(int var0, String var1) { ++ /** ++ * Generate a data value for a potion, given its previous data value and the encoded string of new effects it will ++ * receive ++ */ ++ public static int applyIngredient(int par0, String par1Str) { + byte var2 = 0; +- int var3 = var1.length(); ++ int var3 = par1Str.length(); + boolean var4 = false; + boolean var5 = false; + boolean var6 = false; + boolean var7 = false; + int var8 = 0; + +- for(int var9 = var2; var9 < var3; ++var9) { +- char var10 = var1.charAt(var9); +- if(var10 >= 48 && var10 <= 57) { ++ for (int var9 = var2; var9 < var3; ++var9) { ++ char var10 = par1Str.charAt(var9); ++ ++ if (var10 >= 48 && var10 <= 57) { + var8 *= 10; + var8 += var10 - 48; + var4 = true; +- } else if(var10 == 33) { +- if(var4) { +- var0 = brewBitOperations(var0, var8, var6, var5, var7); ++ } else if (var10 == 33) { ++ if (var4) { ++ par0 = brewBitOperations(par0, var8, var6, var5, var7); + var7 = false; +- var6 = var7; +- var4 = var7; ++ var5 = false; ++ var6 = false; ++ var4 = false; + var8 = 0; + } + + var5 = true; +- } else if(var10 == 45) { +- if(var4) { +- var0 = brewBitOperations(var0, var8, var6, var5, var7); ++ } else if (var10 == 45) { ++ if (var4) { ++ par0 = brewBitOperations(par0, var8, var6, var5, var7); + var7 = false; +- var5 = var7; +- var4 = var7; ++ var5 = false; ++ var6 = false; ++ var4 = false; + var8 = 0; + } + + var6 = true; +- } else if(var10 == 43) { +- if(var4) { +- var0 = brewBitOperations(var0, var8, var6, var5, var7); ++ } else if (var10 == 43) { ++ if (var4) { ++ par0 = brewBitOperations(par0, var8, var6, var5, var7); + var7 = false; +- var5 = var7; +- var6 = var7; +- var4 = var7; ++ var5 = false; ++ var6 = false; ++ var4 = false; + var8 = 0; + } +- } else if(var10 == 38) { +- if(var4) { +- var0 = brewBitOperations(var0, var8, var6, var5, var7); ++ } else if (var10 == 38) { ++ if (var4) { ++ par0 = brewBitOperations(par0, var8, var6, var5, var7); + var7 = false; +- var5 = var7; +- var6 = var7; +- var4 = var7; ++ var5 = false; ++ var6 = false; ++ var4 = false; + var8 = 0; + } + +@@ -389,48 +443,48 @@ + } + } + +- if(var4) { +- var0 = brewBitOperations(var0, var8, var6, var5, var7); ++ if (var4) { ++ par0 = brewBitOperations(par0, var8, var6, var5, var7); + } + +- return var0 & Short.MAX_VALUE; ++ return par0 & 32767; + } + +- public static int func_77908_a(int var0, int var1, int var2, int var3, int var4, int var5) { +- return (checkFlag(var0, var1) ? 16 : 0) | (checkFlag(var0, var2) ? 8 : 0) | (checkFlag(var0, var3) ? 4 : 0) | (checkFlag(var0, var4) ? 2 : 0) | (checkFlag(var0, var5) ? 1 : 0); ++ public static int func_77908_a(int par0, int par1, int par2, int par3, int par4, int par5) { ++ return (checkFlag(par0, par1) ? 16 : 0) | (checkFlag(par0, par2) ? 8 : 0) | (checkFlag(par0, par3) ? 4 : 0) | (checkFlag(par0, par4) ? 2 : 0) | (checkFlag(par0, par5) ? 1 : 0); + } + + static { +- m.put(Integer.valueOf(Potion.regeneration.getId()), "0 & !1 & !2 & !3 & 0+6"); +- b = "-0+1-2-3&4-4+13"; +- m.put(Integer.valueOf(Potion.moveSpeed.getId()), "!0 & 1 & !2 & !3 & 1+6"); +- h = "+0+1-2-3&4-4+13"; +- m.put(Integer.valueOf(Potion.fireResistance.getId()), "0 & 1 & !2 & !3 & 0+6"); +- f = "+0-1+2-3&4-4+13"; +- m.put(Integer.valueOf(Potion.heal.getId()), "0 & !1 & 2 & !3"); +- d = "-0-1+2-3&4-4+13"; +- m.put(Integer.valueOf(Potion.poison.getId()), "!0 & !1 & 2 & !3 & 2+6"); +- e = "-0+3-4+13"; +- m.put(Integer.valueOf(Potion.weakness.getId()), "!0 & !1 & !2 & 3 & 3+6"); +- m.put(Integer.valueOf(Potion.harm.getId()), "!0 & !1 & 2 & 3"); +- m.put(Integer.valueOf(Potion.moveSlowdown.getId()), "!0 & 1 & !2 & 3 & 3+6"); +- g = "+0-1-2+3&4-4+13"; +- m.put(Integer.valueOf(Potion.damageBoost.getId()), "0 & !1 & !2 & 3 & 3+6"); +- l = "-0+1+2-3+13&4-4"; +- m.put(Integer.valueOf(Potion.nightVision.getId()), "!0 & 1 & 2 & !3 & 2+6"); +- m.put(Integer.valueOf(Potion.invisibility.getId()), "!0 & 1 & 2 & 3 & 2+6"); +- j = "+5-6-7"; +- n.put(Integer.valueOf(Potion.moveSpeed.getId()), "5"); +- n.put(Integer.valueOf(Potion.digSpeed.getId()), "5"); +- n.put(Integer.valueOf(Potion.damageBoost.getId()), "5"); +- n.put(Integer.valueOf(Potion.regeneration.getId()), "5"); +- n.put(Integer.valueOf(Potion.harm.getId()), "5"); +- n.put(Integer.valueOf(Potion.heal.getId()), "5"); +- n.put(Integer.valueOf(Potion.resistance.getId()), "5"); +- n.put(Integer.valueOf(Potion.poison.getId()), "5"); +- i = "-5+6-7"; +- k = "+14&13-13"; +- o = new HashMap(); +- p = new String[]{"potion.prefix.mundane", "potion.prefix.uninteresting", "potion.prefix.bland", "potion.prefix.clear", "potion.prefix.milky", "potion.prefix.diffuse", "potion.prefix.artless", "potion.prefix.thin", "potion.prefix.awkward", "potion.prefix.flat", "potion.prefix.bulky", "potion.prefix.bungling", "potion.prefix.buttered", "potion.prefix.smooth", "potion.prefix.suave", "potion.prefix.debonair", "potion.prefix.thick", "potion.prefix.elegant", "potion.prefix.fancy", "potion.prefix.charming", "potion.prefix.dashing", "potion.prefix.refined", "potion.prefix.cordial", "potion.prefix.sparkling", "potion.prefix.potent", "potion.prefix.foul", "potion.prefix.odorless", "potion.prefix.rank", "potion.prefix.harsh", "potion.prefix.acrid", "potion.prefix.gross", "potion.prefix.stinky"}; ++ potionRequirements.put(Integer.valueOf(Potion.regeneration.getId()), "0 & !1 & !2 & !3 & 0+6"); ++ sugarEffect = "-0+1-2-3&4-4+13"; ++ potionRequirements.put(Integer.valueOf(Potion.moveSpeed.getId()), "!0 & 1 & !2 & !3 & 1+6"); ++ magmaCreamEffect = "+0+1-2-3&4-4+13"; ++ potionRequirements.put(Integer.valueOf(Potion.fireResistance.getId()), "0 & 1 & !2 & !3 & 0+6"); ++ speckledMelonEffect = "+0-1+2-3&4-4+13"; ++ potionRequirements.put(Integer.valueOf(Potion.heal.getId()), "0 & !1 & 2 & !3"); ++ spiderEyeEffect = "-0-1+2-3&4-4+13"; ++ potionRequirements.put(Integer.valueOf(Potion.poison.getId()), "!0 & !1 & 2 & !3 & 2+6"); ++ fermentedSpiderEyeEffect = "-0+3-4+13"; ++ potionRequirements.put(Integer.valueOf(Potion.weakness.getId()), "!0 & !1 & !2 & 3 & 3+6"); ++ potionRequirements.put(Integer.valueOf(Potion.harm.getId()), "!0 & !1 & 2 & 3"); ++ potionRequirements.put(Integer.valueOf(Potion.moveSlowdown.getId()), "!0 & 1 & !2 & 3 & 3+6"); ++ blazePowderEffect = "+0-1-2+3&4-4+13"; ++ potionRequirements.put(Integer.valueOf(Potion.damageBoost.getId()), "0 & !1 & !2 & 3 & 3+6"); ++ goldenCarrotEffect = "-0+1+2-3+13&4-4"; ++ potionRequirements.put(Integer.valueOf(Potion.nightVision.getId()), "!0 & 1 & 2 & !3 & 2+6"); ++ potionRequirements.put(Integer.valueOf(Potion.invisibility.getId()), "!0 & 1 & 2 & 3 & 2+6"); ++ glowstoneEffect = "+5-6-7"; ++ potionAmplifiers.put(Integer.valueOf(Potion.moveSpeed.getId()), "5"); ++ potionAmplifiers.put(Integer.valueOf(Potion.digSpeed.getId()), "5"); ++ potionAmplifiers.put(Integer.valueOf(Potion.damageBoost.getId()), "5"); ++ potionAmplifiers.put(Integer.valueOf(Potion.regeneration.getId()), "5"); ++ potionAmplifiers.put(Integer.valueOf(Potion.harm.getId()), "5"); ++ potionAmplifiers.put(Integer.valueOf(Potion.heal.getId()), "5"); ++ potionAmplifiers.put(Integer.valueOf(Potion.resistance.getId()), "5"); ++ potionAmplifiers.put(Integer.valueOf(Potion.poison.getId()), "5"); ++ redstoneEffect = "-5+6-7"; ++ gunpowderEffect = "+14&13-13"; ++ field_77925_n = new HashMap(); ++ potionPrefixes = new String[] {"potion.prefix.mundane", "potion.prefix.uninteresting", "potion.prefix.bland", "potion.prefix.clear", "potion.prefix.milky", "potion.prefix.diffuse", "potion.prefix.artless", "potion.prefix.thin", "potion.prefix.awkward", "potion.prefix.flat", "potion.prefix.bulky", "potion.prefix.bungling", "potion.prefix.buttered", "potion.prefix.smooth", "potion.prefix.suave", "potion.prefix.debonair", "potion.prefix.thick", "potion.prefix.elegant", "potion.prefix.fancy", "potion.prefix.charming", "potion.prefix.dashing", "potion.prefix.refined", "potion.prefix.cordial", "potion.prefix.sparkling", "potion.prefix.potent", "potion.prefix.foul", "potion.prefix.odorless", "potion.prefix.rank", "potion.prefix.harsh", "potion.prefix.acrid", "potion.prefix.gross", "potion.prefix.stinky"}; + } + } diff --git a/patches/net/minecraft/src/Profiler.java.patch b/patches/net/minecraft/src/Profiler.java.patch new file mode 100644 index 0000000..dca2197 --- /dev/null +++ b/patches/net/minecraft/src/Profiler.java.patch @@ -0,0 +1,212 @@ +--- net/minecraft/src/Profiler.java ++++ net/minecraft/src/Profiler.java +@@ -8,117 +8,151 @@ + import java.util.Map; + + public class Profiler { +- private final List b = new ArrayList(); +- private final List c = new ArrayList(); ++ ++ /** List of parent sections */ ++ private final List sectionList = new ArrayList(); ++ ++ /** List of timestamps (System.nanoTime) */ ++ private final List timestampList = new ArrayList(); ++ ++ /** Flag profiling enabled */ + public boolean profilingEnabled; +- private String d = ""; +- private final Map e = new HashMap(); +- ++ ++ /** Current profiling section */ ++ private String profilingSection = ""; ++ ++ /** Profiling map */ ++ private final Map profilingMap = new HashMap(); ++ ++ /** ++ * Clear profiling. ++ */ + public void clearProfiling() { +- this.e.clear(); +- this.d = ""; +- this.b.clear(); ++ this.profilingMap.clear(); ++ this.profilingSection = ""; ++ this.sectionList.clear(); + } + +- public void startSection(String var1) { +- if(this.profilingEnabled) { +- if(this.d.length() > 0) { +- this.d = this.d + "."; ++ /** ++ * Start section ++ */ ++ public void startSection(String par1Str) { ++ // Spout Start ++ if (this.profilingEnabled && Thread.currentThread() == Minecraft.mainThread) { ++ // Spout End ++ if (this.profilingSection.length() > 0) { ++ this.profilingSection = this.profilingSection + "."; + } + +- this.d = this.d + var1; +- this.b.add(this.d); +- this.c.add(Long.valueOf(System.nanoTime())); ++ this.profilingSection = this.profilingSection + par1Str; ++ this.sectionList.add(this.profilingSection); ++ this.timestampList.add(Long.valueOf(System.nanoTime())); + } + } + ++ /** ++ * End section ++ */ + public void endSection() { +- if(this.profilingEnabled) { ++ // Spout Start ++ if (this.profilingEnabled && Thread.currentThread() == Minecraft.mainThread) { ++ // Spout End + long var1 = System.nanoTime(); +- long var3 = ((Long)this.c.remove(this.c.size() - 1)).longValue(); +- this.b.remove(this.b.size() - 1); ++ long var3 = ((Long)this.timestampList.remove(this.timestampList.size() - 1)).longValue(); ++ this.sectionList.remove(this.sectionList.size() - 1); + long var5 = var1 - var3; +- if(this.e.containsKey(this.d)) { +- this.e.put(this.d, Long.valueOf(((Long)this.e.get(this.d)).longValue() + var5)); ++ ++ if (this.profilingMap.containsKey(this.profilingSection)) { ++ this.profilingMap.put(this.profilingSection, Long.valueOf(((Long)this.profilingMap.get(this.profilingSection)).longValue() + var5)); + } else { +- this.e.put(this.d, Long.valueOf(var5)); +- } +- +- if(var5 > 100000000L) { +- System.out.println("Something\'s taking too long! \'" + this.d + "\' took aprox " + (double)var5 / 1000000.0D + " ms"); +- } +- +- this.d = !this.b.isEmpty() ? (String)this.b.get(this.b.size() - 1) : ""; ++ this.profilingMap.put(this.profilingSection, Long.valueOf(var5)); ++ } ++ ++ if (var5 > 100000000L) { ++ System.out.println("Something\'s taking too long! \'" + this.profilingSection + "\' took aprox " + (double)var5 / 1000000.0D + " ms"); ++ } ++ ++ this.profilingSection = !this.sectionList.isEmpty() ? (String)this.sectionList.get(this.sectionList.size() - 1) : ""; + } + } + +- public List getProfilingData(String var1) { +- if(!this.profilingEnabled) { ++ /** ++ * Get profiling data ++ */ ++ public List getProfilingData(String par1Str) { ++ if (!this.profilingEnabled) { + return null; + } else { +- long var3 = this.e.containsKey("root") ? ((Long)this.e.get("root")).longValue() : 0L; +- long var5 = this.e.containsKey(var1) ? ((Long)this.e.get(var1)).longValue() : -1L; ++ long var3 = this.profilingMap.containsKey("root") ? ((Long)this.profilingMap.get("root")).longValue() : 0L; ++ long var5 = this.profilingMap.containsKey(par1Str) ? ((Long)this.profilingMap.get(par1Str)).longValue() : -1L; + ArrayList var7 = new ArrayList(); +- if(var1.length() > 0) { +- var1 = var1 + "."; ++ ++ if (par1Str.length() > 0) { ++ par1Str = par1Str + "."; + } + + long var8 = 0L; +- Iterator var10 = this.e.keySet().iterator(); ++ Iterator var10 = this.profilingMap.keySet().iterator(); + +- while(var10.hasNext()) { ++ while (var10.hasNext()) { + String var11 = (String)var10.next(); +- if(var11.length() > var1.length() && var11.startsWith(var1) && var11.indexOf(".", var1.length() + 1) < 0) { +- var8 += ((Long)this.e.get(var11)).longValue(); ++ ++ if (var11.length() > par1Str.length() && var11.startsWith(par1Str) && var11.indexOf(".", par1Str.length() + 1) < 0) { ++ var8 += ((Long)this.profilingMap.get(var11)).longValue(); + } + } + +- float var20 = (float)var8; +- if(var8 < var5) { ++ float var21 = (float)var8; ++ ++ if (var8 < var5) { + var8 = var5; + } + +- if(var3 < var8) { ++ if (var3 < var8) { + var3 = var8; + } + +- Iterator var21 = this.e.keySet().iterator(); +- ++ Iterator var20 = this.profilingMap.keySet().iterator(); + String var12; +- while(var21.hasNext()) { +- var12 = (String)var21.next(); +- if(var12.length() > var1.length() && var12.startsWith(var1) && var12.indexOf(".", var1.length() + 1) < 0) { +- long var13 = ((Long)this.e.get(var12)).longValue(); ++ ++ while (var20.hasNext()) { ++ var12 = (String)var20.next(); ++ ++ if (var12.length() > par1Str.length() && var12.startsWith(par1Str) && var12.indexOf(".", par1Str.length() + 1) < 0) { ++ long var13 = ((Long)this.profilingMap.get(var12)).longValue(); + double var15 = (double)var13 * 100.0D / (double)var8; + double var17 = (double)var13 * 100.0D / (double)var3; +- String var19 = var12.substring(var1.length()); ++ String var19 = var12.substring(par1Str.length()); + var7.add(new ProfilerResult(var19, var15, var17)); + } + } + +- var21 = this.e.keySet().iterator(); ++ var20 = this.profilingMap.keySet().iterator(); + +- while(var21.hasNext()) { +- var12 = (String)var21.next(); +- this.e.put(var12, Long.valueOf(((Long)this.e.get(var12)).longValue() * 999L / 1000L)); ++ while (var20.hasNext()) { ++ var12 = (String)var20.next(); ++ this.profilingMap.put(var12, Long.valueOf(((Long)this.profilingMap.get(var12)).longValue() * 999L / 1000L)); + } + +- if((float)var8 > var20) { +- var7.add(new ProfilerResult("unspecified", (double)((float)var8 - var20) * 100.0D / (double)var8, (double)((float)var8 - var20) * 100.0D / (double)var3)); ++ if ((float)var8 > var21) { ++ var7.add(new ProfilerResult("unspecified", (double)((float)var8 - var21) * 100.0D / (double)var8, (double)((float)var8 - var21) * 100.0D / (double)var3)); + } + + Collections.sort(var7); +- var7.add(0, new ProfilerResult(var1, 100.0D, (double)var8 * 100.0D / (double)var3)); ++ var7.add(0, new ProfilerResult(par1Str, 100.0D, (double)var8 * 100.0D / (double)var3)); + return var7; + } + } + +- public void endStartSection(String var1) { ++ /** ++ * End current section and start a new section ++ */ ++ public void endStartSection(String par1Str) { + this.endSection(); +- this.startSection(var1); ++ this.startSection(par1Str); + } + + public String getNameOfLastSection() { +- return this.b.size() == 0 ? "[UNKNOWN]" : (String)this.b.get(this.b.size() - 1); ++ return this.sectionList.size() == 0 ? "[UNKNOWN]" : (String)this.sectionList.get(this.sectionList.size() - 1); + } + } diff --git a/patches/net/minecraft/src/ProfilerResult.java.patch b/patches/net/minecraft/src/ProfilerResult.java.patch new file mode 100644 index 0000000..a9eb998 --- /dev/null +++ b/patches/net/minecraft/src/ProfilerResult.java.patch @@ -0,0 +1,36 @@ +--- net/minecraft/src/ProfilerResult.java ++++ net/minecraft/src/ProfilerResult.java +@@ -3,23 +3,23 @@ + public final class ProfilerResult implements Comparable { + public double field_76332_a; + public double field_76330_b; +- public String c; ++ public String field_76331_c; + +- public ProfilerResult(String var1, double var2, double var4) { +- this.c = var1; +- this.field_76332_a = var2; +- this.field_76330_b = var4; ++ public ProfilerResult(String par1Str, double par2, double par4) { ++ this.field_76331_c = par1Str; ++ this.field_76332_a = par2; ++ this.field_76330_b = par4; + } + +- public int func_76328_a(ProfilerResult var1) { +- return var1.field_76332_a < this.field_76332_a ? -1 : (var1.field_76332_a > this.field_76332_a ? 1 : var1.c.compareTo(this.c)); ++ public int func_76328_a(ProfilerResult par1ProfilerResult) { ++ return par1ProfilerResult.field_76332_a < this.field_76332_a ? -1 : (par1ProfilerResult.field_76332_a > this.field_76332_a ? 1 : par1ProfilerResult.field_76331_c.compareTo(this.field_76331_c)); + } + + public int func_76329_a() { +- return (this.c.hashCode() & 11184810) + 4473924; ++ return (this.field_76331_c.hashCode() & 11184810) + 4473924; + } + +- public int compareTo(Object var1) { +- return this.func_76328_a((ProfilerResult)var1); ++ public int compareTo(Object par1Obj) { ++ return this.func_76328_a((ProfilerResult)par1Obj); + } + } diff --git a/patches/net/minecraft/src/PropertyManager.java.patch b/patches/net/minecraft/src/PropertyManager.java.patch new file mode 100644 index 0000000..103f719 --- /dev/null +++ b/patches/net/minecraft/src/PropertyManager.java.patch @@ -0,0 +1,173 @@ +--- net/minecraft/src/PropertyManager.java ++++ net/minecraft/src/PropertyManager.java +@@ -7,96 +7,119 @@ + import java.util.Properties; + + public class PropertyManager { +- private final Properties a = new Properties(); ++ private final Properties properties = new Properties(); ++ ++ /** Reference to the logger. */ + private final ILogAgent logger; +- private final File c; +- +- public PropertyManager(File var1, ILogAgent var2) { +- this.c = var1; +- this.logger = var2; +- if(var1.exists()) { ++ private final File associatedFile; ++ ++ public PropertyManager(File par1File, ILogAgent par2ILogAgent) { ++ this.associatedFile = par1File; ++ this.logger = par2ILogAgent; ++ ++ if (par1File.exists()) { + FileInputStream var3 = null; + + try { +- var3 = new FileInputStream(var1); +- this.a.load(var3); ++ var3 = new FileInputStream(par1File); ++ this.properties.load(var3); + } catch (Exception var13) { +- var2.logWarningException("Failed to load " + var1, var13); +- this.generateNewProperties(); ++ par2ILogAgent.logWarningException("Failed to load " + par1File, var13); ++ this.logMessageAndSave(); + } finally { +- if(var3 != null) { ++ if (var3 != null) { + try { + var3.close(); + } catch (IOException var12) { ++ ; + } + } +- + } + } else { +- var2.logWarning(var1 + " does not exist"); +- this.generateNewProperties(); ++ par2ILogAgent.logWarning(par1File + " does not exist"); ++ this.logMessageAndSave(); + } +- + } + +- public void generateNewProperties() { ++ /** ++ * logs an info message then calls saveSettingsToFile Yes this appears to be a potential stack overflow - these 2 ++ * functions call each other repeatdly if an exception occurs. ++ */ ++ public void logMessageAndSave() { + this.logger.logInfo("Generating new properties file"); + this.saveProperties(); + } + ++ /** ++ * Writes the properties to the properties file. ++ */ + public void saveProperties() { + FileOutputStream var1 = null; + + try { +- var1 = new FileOutputStream(this.c); +- this.a.store(var1, "Minecraft server properties"); ++ var1 = new FileOutputStream(this.associatedFile); ++ this.properties.store(var1, "Minecraft server properties"); + } catch (Exception var11) { +- this.logger.logWarningException("Failed to save " + this.c, var11); +- this.generateNewProperties(); ++ this.logger.logWarningException("Failed to save " + this.associatedFile, var11); ++ this.logMessageAndSave(); + } finally { +- if(var1 != null) { ++ if (var1 != null) { + try { + var1.close(); + } catch (IOException var10) { ++ ; + } + } +- + } +- + } + ++ /** ++ * Returns this PropertyManager's file object used for property saving. ++ */ + public File getPropertiesFile() { +- return this.c; ++ return this.associatedFile; + } + +- public String getStringProperty(String var1, String var2) { +- if(!this.a.containsKey(var1)) { +- this.a.setProperty(var1, var2); ++ /** ++ * Gets a property. If it does not exist, set it to the specified value. ++ */ ++ public String getProperty(String par1Str, String par2Str) { ++ if (!this.properties.containsKey(par1Str)) { ++ this.properties.setProperty(par1Str, par2Str); + this.saveProperties(); + } + +- return this.a.getProperty(var1, var2); +- } +- +- public int getIntProperty(String var1, int var2) { +- try { +- return Integer.parseInt(this.getStringProperty(var1, "" + var2)); +- } catch (Exception var4) { +- this.a.setProperty(var1, "" + var2); +- return var2; +- } +- } +- +- public boolean getBooleanProperty(String var1, boolean var2) { +- try { +- return Boolean.parseBoolean(this.getStringProperty(var1, "" + var2)); +- } catch (Exception var4) { +- this.a.setProperty(var1, "" + var2); +- return var2; +- } +- } +- +- public void setProperty(String var1, Object var2) { +- this.a.setProperty(var1, "" + var2); ++ return this.properties.getProperty(par1Str, par2Str); ++ } ++ ++ /** ++ * Gets an integer property. If it does not exist, set it to the specified value. ++ */ ++ public int getIntProperty(String par1Str, int par2) { ++ try { ++ return Integer.parseInt(this.getProperty(par1Str, "" + par2)); ++ } catch (Exception var4) { ++ this.properties.setProperty(par1Str, "" + par2); ++ return par2; ++ } ++ } ++ ++ /** ++ * Gets a boolean property. If it does not exist, set it to the specified value. ++ */ ++ public boolean getBooleanProperty(String par1Str, boolean par2) { ++ try { ++ return Boolean.parseBoolean(this.getProperty(par1Str, "" + par2)); ++ } catch (Exception var4) { ++ this.properties.setProperty(par1Str, "" + par2); ++ return par2; ++ } ++ } ++ ++ /** ++ * Saves an Object with the given property name. ++ */ ++ public void setProperty(String par1Str, Object par2Obj) { ++ this.properties.setProperty(par1Str, "" + par2Obj); + } + } diff --git a/patches/net/minecraft/src/RConConsoleSource.java.patch b/patches/net/minecraft/src/RConConsoleSource.java.patch new file mode 100644 index 0000000..f34b34d --- /dev/null +++ b/patches/net/minecraft/src/RConConsoleSource.java.patch @@ -0,0 +1,63 @@ +--- net/minecraft/src/RConConsoleSource.java ++++ net/minecraft/src/RConConsoleSource.java +@@ -3,30 +3,46 @@ + import net.minecraft.server.MinecraftServer; + + public class RConConsoleSource implements ICommandSender { +- public static final RConConsoleSource instance = new RConConsoleSource(); +- private StringBuffer b = new StringBuffer(); +- ++ ++ /** only ever used by MinecraftServer.executeCommand */ ++ public static final RConConsoleSource consoleBuffer = new RConConsoleSource(); ++ ++ /** RCon string buffer for log. */ ++ private StringBuffer buffer = new StringBuffer(); ++ ++ /** ++ * Clears the RCon log ++ */ + public void resetLog() { +- this.b.setLength(0); +- } +- +- public String getLogContents() { +- return this.b.toString(); +- } +- ++ this.buffer.setLength(0); ++ } ++ ++ public String getChatBuffer() { ++ return this.buffer.toString(); ++ } ++ ++ /** ++ * Gets the name of this command sender (usually username, but possibly "Rcon") ++ */ + public String getCommandSenderName() { + return "Rcon"; + } + +- public void sendChatToPlayer(ChatMessageComponent var1) { +- this.b.append(var1.toString()); ++ public void sendChatToPlayer(ChatMessageComponent par1ChatMessageComponent) { ++ this.buffer.append(par1ChatMessageComponent.toString()); + } + +- public boolean canCommandSenderUseCommand(int var1, String var2) { ++ /** ++ * Returns true if the command sender is allowed to use the given command. ++ */ ++ public boolean canCommandSenderUseCommand(int par1, String par2Str) { + return true; + } + +- public ChunkCoordinates getCommandSenderPosition() { ++ /** ++ * Return the position for this command sender. ++ */ ++ public ChunkCoordinates getPlayerCoordinates() { + return new ChunkCoordinates(0, 0, 0); + } + diff --git a/patches/net/minecraft/src/RConOutputStream.java.patch b/patches/net/minecraft/src/RConOutputStream.java.patch new file mode 100644 index 0000000..563ed75 --- /dev/null +++ b/patches/net/minecraft/src/RConOutputStream.java.patch @@ -0,0 +1,88 @@ +--- net/minecraft/src/RConOutputStream.java ++++ net/minecraft/src/RConOutputStream.java +@@ -5,36 +5,58 @@ + import java.io.IOException; + + public class RConOutputStream { +- private ByteArrayOutputStream a; +- private DataOutputStream b; +- +- public RConOutputStream(int var1) { +- this.a = new ByteArrayOutputStream(var1); +- this.b = new DataOutputStream(this.a); +- } +- +- public void writeByteArray(byte[] var1) throws IOException { +- this.b.write(var1, 0, var1.length); +- } +- +- public void writeString(String var1) throws IOException { +- this.b.writeBytes(var1); +- this.b.write(0); +- } +- +- public void writeInt(int var1) throws IOException { +- this.b.write(var1); +- } +- +- public void writeShort(short var1) throws IOException { +- this.b.writeShort(Short.reverseBytes(var1)); +- } +- ++ ++ /** Output stream */ ++ private ByteArrayOutputStream byteArrayOutput; ++ ++ /** ByteArrayOutputStream wrapper */ ++ private DataOutputStream output; ++ ++ public RConOutputStream(int par1) { ++ this.byteArrayOutput = new ByteArrayOutputStream(par1); ++ this.output = new DataOutputStream(this.byteArrayOutput); ++ } ++ ++ /** ++ * Writes the given byte array to the output stream ++ */ ++ public void writeByteArray(byte[] par1ArrayOfByte) throws IOException { ++ this.output.write(par1ArrayOfByte, 0, par1ArrayOfByte.length); ++ } ++ ++ /** ++ * Writes the given String to the output stream ++ */ ++ public void writeString(String par1Str) throws IOException { ++ this.output.writeBytes(par1Str); ++ this.output.write(0); ++ } ++ ++ /** ++ * Writes the given int to the output stream ++ */ ++ public void writeInt(int par1) throws IOException { ++ this.output.write(par1); ++ } ++ ++ /** ++ * Writes the given short to the output stream ++ */ ++ public void writeShort(short par1) throws IOException { ++ this.output.writeShort(Short.reverseBytes(par1)); ++ } ++ ++ /** ++ * Returns the contents of the output stream as a byte array ++ */ + public byte[] toByteArray() { +- return this.a.toByteArray(); ++ return this.byteArrayOutput.toByteArray(); + } + ++ /** ++ * Resets the byte array output. ++ */ + public void reset() { +- this.a.reset(); ++ this.byteArrayOutput.reset(); + } + } diff --git a/patches/net/minecraft/src/RConThreadBase.java.patch b/patches/net/minecraft/src/RConThreadBase.java.patch new file mode 100644 index 0000000..2196b74 --- /dev/null +++ b/patches/net/minecraft/src/RConThreadBase.java.patch @@ -0,0 +1,245 @@ +--- net/minecraft/src/RConThreadBase.java ++++ net/minecraft/src/RConThreadBase.java +@@ -8,132 +8,186 @@ + import java.util.List; + + public abstract class RConThreadBase implements Runnable { ++ ++ /** True if the Thread is running, false otherwise */ + protected boolean running; ++ ++ /** Reference to the IServer object. */ + protected IServer server; +- protected Thread c; ++ ++ /** Thread for this runnable class */ ++ protected Thread rconThread; + protected int field_72615_d = 5; +- protected List e = new ArrayList(); +- protected List f = new ArrayList(); +- +- RConThreadBase(IServer var1) { +- this.server = var1; +- if(this.server.isDebuggingEnabled()) { ++ ++ /** A list of registered DatagramSockets */ ++ protected List socketList = new ArrayList(); ++ ++ /** A list of registered ServerSockets */ ++ protected List serverSocketList = new ArrayList(); ++ ++ RConThreadBase(IServer par1IServer) { ++ this.server = par1IServer; ++ ++ if (this.server.isDebuggingEnabled()) { + this.logWarning("Debugging is enabled, performance maybe reduced!"); + } +- + } + ++ /** ++ * Creates a new Thread object from this class and starts running ++ */ + public synchronized void startThread() { +- this.c = new Thread(this); +- this.c.start(); ++ this.rconThread = new Thread(this); ++ this.rconThread.start(); + this.running = true; + } + ++ /** ++ * Returns true if the Thread is running, false otherwise ++ */ + public boolean isRunning() { + return this.running; + } + +- protected void logDebug(String var1) { +- this.server.logDebug(var1); +- } +- +- protected void logInfo(String var1) { +- this.server.logInfo(var1); +- } +- +- protected void logWarning(String var1) { +- this.server.logWarning(var1); +- } +- +- protected void logSevere(String var1) { +- this.server.logSevere(var1); +- } +- ++ /** ++ * Log debug message ++ */ ++ protected void logDebug(String par1Str) { ++ this.server.logDebug(par1Str); ++ } ++ ++ /** ++ * Log information message ++ */ ++ protected void logInfo(String par1Str) { ++ this.server.logInfo(par1Str); ++ } ++ ++ /** ++ * Log warning message ++ */ ++ protected void logWarning(String par1Str) { ++ this.server.logWarning(par1Str); ++ } ++ ++ /** ++ * Log severe error message ++ */ ++ protected void logSevere(String par1Str) { ++ this.server.logSevere(par1Str); ++ } ++ ++ /** ++ * Returns the number of players on the server ++ */ + protected int getNumberOfPlayers() { + return this.server.getCurrentPlayerCount(); + } + +- protected void registerSocket(DatagramSocket var1) { +- this.logDebug("registerSocket: " + var1); +- this.e.add(var1); ++ /** ++ * Registers a DatagramSocket with this thread ++ */ ++ protected void registerSocket(DatagramSocket par1DatagramSocket) { ++ this.logDebug("registerSocket: " + par1DatagramSocket); ++ this.socketList.add(par1DatagramSocket); + } + +- protected boolean closeSocket(DatagramSocket var1, boolean var2) { +- this.logDebug("closeSocket: " + var1); +- if(null == var1) { ++ /** ++ * Closes the specified DatagramSocket ++ */ ++ protected boolean closeSocket(DatagramSocket par1DatagramSocket, boolean par2) { ++ this.logDebug("closeSocket: " + par1DatagramSocket); ++ ++ if (null == par1DatagramSocket) { + return false; + } else { + boolean var3 = false; +- if(!var1.isClosed()) { +- var1.close(); ++ ++ if (!par1DatagramSocket.isClosed()) { ++ par1DatagramSocket.close(); + var3 = true; + } + +- if(var2) { +- this.e.remove(var1); ++ if (par2) { ++ this.socketList.remove(par1DatagramSocket); + } + + return var3; + } + } + +- protected boolean closeServerSocket(ServerSocket var1) { +- return this.closeServerSocket_do(var1, true); ++ /** ++ * Closes the specified ServerSocket ++ */ ++ protected boolean closeServerSocket(ServerSocket par1ServerSocket) { ++ return this.closeServerSocket_do(par1ServerSocket, true); + } + +- protected boolean closeServerSocket_do(ServerSocket var1, boolean var2) { +- this.logDebug("closeSocket: " + var1); +- if(null == var1) { ++ /** ++ * Closes the specified ServerSocket ++ */ ++ protected boolean closeServerSocket_do(ServerSocket par1ServerSocket, boolean par2) { ++ this.logDebug("closeSocket: " + par1ServerSocket); ++ ++ if (null == par1ServerSocket) { + return false; + } else { + boolean var3 = false; + + try { +- if(!var1.isClosed()) { +- var1.close(); ++ if (!par1ServerSocket.isClosed()) { ++ par1ServerSocket.close(); + var3 = true; + } + } catch (IOException var5) { + this.logWarning("IO: " + var5.getMessage()); + } + +- if(var2) { +- this.f.remove(var1); ++ if (par2) { ++ this.serverSocketList.remove(par1ServerSocket); + } + + return var3; + } + } + ++ /** ++ * Closes all of the opened sockets ++ */ + protected void closeAllSockets() { + this.closeAllSockets_do(false); + } + +- protected void closeAllSockets_do(boolean var1) { ++ /** ++ * Closes all of the opened sockets ++ */ ++ protected void closeAllSockets_do(boolean par1) { + int var2 = 0; +- Iterator var3 = this.e.iterator(); ++ Iterator var3 = this.socketList.iterator(); + +- while(var3.hasNext()) { ++ while (var3.hasNext()) { + DatagramSocket var4 = (DatagramSocket)var3.next(); +- if(this.closeSocket(var4, false)) { ++ ++ if (this.closeSocket(var4, false)) { + ++var2; + } + } + +- this.e.clear(); +- var3 = this.f.iterator(); ++ this.socketList.clear(); ++ var3 = this.serverSocketList.iterator(); + +- while(var3.hasNext()) { ++ while (var3.hasNext()) { + ServerSocket var5 = (ServerSocket)var3.next(); +- if(this.closeServerSocket_do(var5, false)) { ++ ++ if (this.closeServerSocket_do(var5, false)) { + ++var2; + } + } + +- this.f.clear(); +- if(var1 && 0 < var2) { ++ this.serverSocketList.clear(); ++ ++ if (par1 && 0 < var2) { + this.logWarning("Force closed " + var2 + " sockets"); + } +- + } + } diff --git a/patches/net/minecraft/src/RConThreadClient.java.patch b/patches/net/minecraft/src/RConThreadClient.java.patch new file mode 100644 index 0000000..85fb8d9 --- /dev/null +++ b/patches/net/minecraft/src/RConThreadClient.java.patch @@ -0,0 +1,234 @@ +--- net/minecraft/src/RConThreadClient.java ++++ net/minecraft/src/RConThreadClient.java +@@ -8,131 +8,154 @@ + import java.net.SocketTimeoutException; + + public class RConThreadClient extends RConThreadBase { ++ ++ /** ++ * True if the client has succefssfully logged into the RCon, otherwise false ++ */ + private boolean loggedIn; +- private Socket h; ++ ++ /** The client's Socket connection */ ++ private Socket clientSocket; ++ ++ /** A buffer for incoming Socket data */ + private byte[] buffer = new byte[1460]; +- private String j; +- +- RConThreadClient(IServer var1, Socket var2) { +- super(var1); +- this.h = var2; ++ ++ /** The RCon password */ ++ private String rconPassword; ++ ++ RConThreadClient(IServer par1IServer, Socket par2Socket) { ++ super(par1IServer); ++ this.clientSocket = par2Socket; + + try { +- this.h.setSoTimeout(0); ++ this.clientSocket.setSoTimeout(0); + } catch (Exception var4) { + this.running = false; + } + +- this.j = var1.getStringProperty("rcon.password", ""); +- this.logInfo("Rcon connection from: " + var2.getInetAddress()); ++ this.rconPassword = par1IServer.getStringProperty("rcon.password", ""); ++ this.logInfo("Rcon connection from: " + par2Socket.getInetAddress()); + } + + public void run() { +- while(true) { +- try { +- if(!this.running) { +- return; ++ try { ++ while (true) { ++ if (!this.running) { ++ break; + } + +- BufferedInputStream var1 = new BufferedInputStream(this.h.getInputStream()); ++ BufferedInputStream var1 = new BufferedInputStream(this.clientSocket.getInputStream()); + int var2 = var1.read(this.buffer, 0, 1460); +- if(10 > var2) { +- return; +- } +- +- byte var3 = 0; +- int var4 = RConUtils.getBytesAsLEInt(this.buffer, 0, var2); +- if(var4 == var2 - 4) { ++ ++ if (10 <= var2) { ++ byte var3 = 0; ++ int var4 = RConUtils.getBytesAsLEInt(this.buffer, 0, var2); ++ ++ if (var4 != var2 - 4) { ++ return; ++ } ++ + int var21 = var3 + 4; + int var5 = RConUtils.getBytesAsLEInt(this.buffer, var21, var2); + var21 += 4; + int var6 = RConUtils.getRemainingBytesAsLEInt(this.buffer, var21); + var21 += 4; +- switch(var6) { +- case 2: +- if(this.loggedIn) { +- String var8 = RConUtils.getBytesAsString(this.buffer, var21, var2); +- +- try { +- this.sendMultipacketResponse(var5, this.server.handleRConCommand(var8)); +- } catch (Exception var16) { +- this.sendMultipacketResponse(var5, "Error executing: " + var8 + " (" + var16.getMessage() + ")"); +- } +- continue; +- } +- +- this.sendLoginFailedResponse(); +- continue; +- case 3: +- String var7 = RConUtils.getBytesAsString(this.buffer, var21, var2); +- int var10000 = var21 + var7.length(); +- if(0 != var7.length() && var7.equals(this.j)) { +- this.loggedIn = true; +- this.sendResponse(var5, 2, ""); +- continue; +- } +- +- this.loggedIn = false; +- this.sendLoginFailedResponse(); +- continue; +- default: +- this.sendMultipacketResponse(var5, String.format("Unknown request %s", new Object[]{Integer.toHexString(var6)})); +- continue; ++ ++ switch (var6) { ++ case 2: ++ if (this.loggedIn) { ++ String var8 = RConUtils.getBytesAsString(this.buffer, var21, var2); ++ ++ try { ++ this.sendMultipacketResponse(var5, this.server.executeCommand(var8)); ++ } catch (Exception var16) { ++ this.sendMultipacketResponse(var5, "Error executing: " + var8 + " (" + var16.getMessage() + ")"); ++ } ++ ++ continue; ++ } ++ ++ this.sendLoginFailedResponse(); ++ continue; ++ ++ case 3: ++ String var7 = RConUtils.getBytesAsString(this.buffer, var21, var2); ++ int var10000 = var21 + var7.length(); ++ ++ if (0 != var7.length() && var7.equals(this.rconPassword)) { ++ this.loggedIn = true; ++ this.sendResponse(var5, 2, ""); ++ continue; ++ } ++ ++ this.loggedIn = false; ++ this.sendLoginFailedResponse(); ++ continue; ++ ++ default: ++ this.sendMultipacketResponse(var5, String.format("Unknown request %s", new Object[] {Integer.toHexString(var6)})); ++ continue; + } + } +- } catch (SocketTimeoutException var17) { +- return; +- } catch (IOException var18) { +- return; +- } catch (Exception var19) { +- System.out.println(var19); +- return; +- } finally { +- this.closeSocket(); + } +- +- return; ++ } catch (SocketTimeoutException var17) { ++ } catch (IOException var18) { ++ } catch (Exception var19) { ++ System.out.println(var19); ++ } finally { ++ this.closeSocket(); + } + } + +- private void sendResponse(int var1, int var2, String var3) throws IOException { ++ /** ++ * Sends the given response message to the client ++ */ ++ private void sendResponse(int par1, int par2, String par3Str) throws IOException { + ByteArrayOutputStream var4 = new ByteArrayOutputStream(1248); + DataOutputStream var5 = new DataOutputStream(var4); +- byte[] var6 = var3.getBytes("UTF-8"); ++ byte[] var6 = par3Str.getBytes("UTF-8"); + var5.writeInt(Integer.reverseBytes(var6.length + 10)); +- var5.writeInt(Integer.reverseBytes(var1)); +- var5.writeInt(Integer.reverseBytes(var2)); ++ var5.writeInt(Integer.reverseBytes(par1)); ++ var5.writeInt(Integer.reverseBytes(par2)); + var5.write(var6); + var5.write(0); + var5.write(0); +- this.h.getOutputStream().write(var4.toByteArray()); ++ this.clientSocket.getOutputStream().write(var4.toByteArray()); + } + ++ /** ++ * Sends the standard RCon 'authorization failed' response packet ++ */ + private void sendLoginFailedResponse() throws IOException { + this.sendResponse(-1, 2, ""); + } + +- private void sendMultipacketResponse(int var1, String var2) throws IOException { +- int var3 = var2.length(); ++ /** ++ * Splits the response message into individual packets and sends each one ++ */ ++ private void sendMultipacketResponse(int par1, String par2Str) throws IOException { ++ int var3 = par2Str.length(); + + do { + int var4 = 4096 <= var3 ? 4096 : var3; +- this.sendResponse(var1, 0, var2.substring(0, var4)); +- var2 = var2.substring(var4); +- var3 = var2.length(); +- } while(0 != var3); +- ++ this.sendResponse(par1, 0, par2Str.substring(0, var4)); ++ par2Str = par2Str.substring(var4); ++ var3 = par2Str.length(); ++ } while (0 != var3); + } + ++ /** ++ * Closes the client socket ++ */ + private void closeSocket() { +- if(null != this.h) { ++ if (null != this.clientSocket) { + try { +- this.h.close(); ++ this.clientSocket.close(); + } catch (IOException var2) { + this.logWarning("IO: " + var2.getMessage()); + } + +- this.h = null; ++ this.clientSocket = null; + } + } + } diff --git a/patches/net/minecraft/src/RConThreadMain.java.patch b/patches/net/minecraft/src/RConThreadMain.java.patch new file mode 100644 index 0000000..cc30c28 --- /dev/null +++ b/patches/net/minecraft/src/RConThreadMain.java.patch @@ -0,0 +1,152 @@ +--- net/minecraft/src/RConThreadMain.java ++++ net/minecraft/src/RConThreadMain.java +@@ -11,93 +11,111 @@ + import java.util.Map.Entry; + + public class RConThreadMain extends RConThreadBase { ++ ++ /** Port RCon is running on */ + private int rconPort; ++ ++ /** Port the server is running on */ + private int serverPort; +- private String i; +- private ServerSocket j; +- private String k; +- private Map l; +- +- public RConThreadMain(IServer var1) { +- super(var1); +- this.rconPort = var1.getIntProperty("rcon.port", 0); +- this.k = var1.getStringProperty("rcon.password", ""); +- this.i = var1.getHostname(); +- this.serverPort = var1.getPort(); +- if(0 == this.rconPort) { ++ ++ /** Hostname RCon is running on */ ++ private String hostname; ++ ++ /** The RCon ServerSocket. */ ++ private ServerSocket serverSocket; ++ ++ /** The RCon password */ ++ private String rconPassword; ++ ++ /** A map of client addresses to their running Threads */ ++ private Map clientThreads; ++ ++ public RConThreadMain(IServer par1IServer) { ++ super(par1IServer); ++ this.rconPort = par1IServer.getIntProperty("rcon.port", 0); ++ this.rconPassword = par1IServer.getStringProperty("rcon.password", ""); ++ this.hostname = par1IServer.getHostname(); ++ this.serverPort = par1IServer.getPort(); ++ ++ if (0 == this.rconPort) { + this.rconPort = this.serverPort + 10; + this.logInfo("Setting default rcon port to " + this.rconPort); +- var1.setProperty("rcon.port", Integer.valueOf(this.rconPort)); +- if(0 == this.k.length()) { +- var1.setProperty("rcon.password", ""); ++ par1IServer.setProperty("rcon.port", Integer.valueOf(this.rconPort)); ++ ++ if (0 == this.rconPassword.length()) { ++ par1IServer.setProperty("rcon.password", ""); + } + +- var1.saveProperties(); ++ par1IServer.saveProperties(); + } + +- if(0 == this.i.length()) { +- this.i = "0.0.0.0"; ++ if (0 == this.hostname.length()) { ++ this.hostname = "0.0.0.0"; + } + + this.initClientThreadList(); +- this.j = null; ++ this.serverSocket = null; + } + + private void initClientThreadList() { +- this.l = new HashMap(); ++ this.clientThreads = new HashMap(); + } + ++ /** ++ * Cleans up the clientThreads map by removing client Threads that are not running ++ */ + private void cleanClientThreadsMap() { +- Iterator var1 = this.l.entrySet().iterator(); ++ Iterator var1 = this.clientThreads.entrySet().iterator(); + +- while(var1.hasNext()) { ++ while (var1.hasNext()) { + Entry var2 = (Entry)var1.next(); +- if(!((RConThreadClient)var2.getValue()).isRunning()) { ++ ++ if (!((RConThreadClient)var2.getValue()).isRunning()) { + var1.remove(); + } + } +- + } + + public void run() { +- this.logInfo("RCON running on " + this.i + ":" + this.rconPort); ++ this.logInfo("RCON running on " + this.hostname + ":" + this.rconPort); + + try { +- while(this.running) { ++ while (this.running) { + try { +- Socket var1 = this.j.accept(); ++ Socket var1 = this.serverSocket.accept(); + var1.setSoTimeout(500); + RConThreadClient var2 = new RConThreadClient(this.server, var1); + var2.startThread(); +- this.l.put(var1.getRemoteSocketAddress(), var2); ++ this.clientThreads.put(var1.getRemoteSocketAddress(), var2); + this.cleanClientThreadsMap(); + } catch (SocketTimeoutException var7) { + this.cleanClientThreadsMap(); + } catch (IOException var8) { +- if(this.running) { ++ if (this.running) { + this.logInfo("IO: " + var8.getMessage()); + } + } + } + } finally { +- this.closeServerSocket(this.j); ++ this.closeServerSocket(this.serverSocket); + } +- + } + ++ /** ++ * Creates a new Thread object from this class and starts running ++ */ + public void startThread() { +- if(0 == this.k.length()) { ++ if (0 == this.rconPassword.length()) { + this.logWarning("No rcon password set in \'" + this.server.getSettingsFilename() + "\', rcon disabled!"); +- } else if(0 < this.rconPort && '\uffff' >= this.rconPort) { +- if(!this.running) { ++ } else if (0 < this.rconPort && 65535 >= this.rconPort) { ++ if (!this.running) { + try { +- this.j = new ServerSocket(this.rconPort, 0, InetAddress.getByName(this.i)); +- this.j.setSoTimeout(500); ++ this.serverSocket = new ServerSocket(this.rconPort, 0, InetAddress.getByName(this.hostname)); ++ this.serverSocket.setSoTimeout(500); + super.startThread(); + } catch (IOException var2) { +- this.logWarning("Unable to initialise rcon on " + this.i + ":" + this.rconPort + " : " + var2.getMessage()); ++ this.logWarning("Unable to initialise rcon on " + this.hostname + ":" + this.rconPort + " : " + var2.getMessage()); + } +- + } + } else { + this.logWarning("Invalid rcon port " + this.rconPort + " found in \'" + this.server.getSettingsFilename() + "\', rcon disabled!"); diff --git a/patches/net/minecraft/src/RConThreadQuery.java.patch b/patches/net/minecraft/src/RConThreadQuery.java.patch new file mode 100644 index 0000000..42a488e --- /dev/null +++ b/patches/net/minecraft/src/RConThreadQuery.java.patch @@ -0,0 +1,437 @@ +--- net/minecraft/src/RConThreadQuery.java ++++ net/minecraft/src/RConThreadQuery.java +@@ -17,99 +17,142 @@ + import net.minecraft.server.MinecraftServer; + + public class RConThreadQuery extends RConThreadBase { ++ ++ /** The time of the last client auth check */ + private long lastAuthCheckTime; ++ ++ /** The RCon query port */ + private int queryPort; ++ ++ /** Port the server is running on */ + private int serverPort; ++ ++ /** The maximum number of players allowed on the server */ + private int maxPlayers; +- private String k; +- private String l; +- private DatagramSocket m; ++ ++ /** The current server message of the day */ ++ private String serverMotd; ++ ++ /** The name of the currently loaded world */ ++ private String worldName; ++ ++ /** The remote socket querying the server */ ++ private DatagramSocket querySocket; ++ ++ /** A buffer for incoming DatagramPackets */ + private byte[] buffer = new byte[1460]; +- private DatagramPacket o; +- private Map p; +- private String q; +- private String r; +- private Map s; ++ ++ /** Storage for incoming DatagramPackets */ ++ private DatagramPacket incomingPacket; ++ private Map field_72644_p; ++ ++ /** The hostname of this query server */ ++ private String queryHostname; ++ ++ /** The hostname of the running server */ ++ private String serverHostname; ++ ++ /** A map of SocketAddress objects to RConThreadQueryAuth objects */ ++ private Map queryClients; ++ ++ /** ++ * The time that this RConThreadQuery was constructed, from (new Date()).getTime() ++ */ + private long time; ++ ++ /** The RConQuery output stream */ + private RConOutputStream output; ++ ++ /** The time of the last query response sent */ + private long lastQueryResponseTime; + +- public RConThreadQuery(IServer var1) { +- super(var1); +- this.queryPort = var1.getIntProperty("query.port", 0); +- this.r = var1.getHostname(); +- this.serverPort = var1.getPort(); +- this.k = var1.getMotd(); +- this.maxPlayers = var1.getMaxPlayers(); +- this.l = var1.getFolderName(); ++ public RConThreadQuery(IServer par1IServer) { ++ super(par1IServer); ++ this.queryPort = par1IServer.getIntProperty("query.port", 0); ++ this.serverHostname = par1IServer.getHostname(); ++ this.serverPort = par1IServer.getPort(); ++ this.serverMotd = par1IServer.getServerMOTD(); ++ this.maxPlayers = par1IServer.getMaxPlayers(); ++ this.worldName = par1IServer.getFolderName(); + this.lastQueryResponseTime = 0L; +- this.q = "0.0.0.0"; +- if(0 != this.r.length() && !this.q.equals(this.r)) { +- this.q = this.r; ++ this.queryHostname = "0.0.0.0"; ++ ++ if (0 != this.serverHostname.length() && !this.queryHostname.equals(this.serverHostname)) { ++ this.queryHostname = this.serverHostname; + } else { +- this.r = "0.0.0.0"; ++ this.serverHostname = "0.0.0.0"; + + try { + InetAddress var2 = InetAddress.getLocalHost(); +- this.q = var2.getHostAddress(); ++ this.queryHostname = var2.getHostAddress(); + } catch (UnknownHostException var3) { +- this.logWarning("Unable to determine local host IP, please set server-ip in \'" + var1.getSettingsFilename() + "\' : " + var3.getMessage()); ++ this.logWarning("Unable to determine local host IP, please set server-ip in \'" + par1IServer.getSettingsFilename() + "\' : " + var3.getMessage()); + } + } + +- if(0 == this.queryPort) { ++ if (0 == this.queryPort) { + this.queryPort = this.serverPort; + this.logInfo("Setting default query port to " + this.queryPort); +- var1.setProperty("query.port", Integer.valueOf(this.queryPort)); +- var1.setProperty("debug", Boolean.valueOf(false)); +- var1.saveProperties(); ++ par1IServer.setProperty("query.port", Integer.valueOf(this.queryPort)); ++ par1IServer.setProperty("debug", Boolean.valueOf(false)); ++ par1IServer.saveProperties(); + } + +- this.p = new HashMap(); ++ this.field_72644_p = new HashMap(); + this.output = new RConOutputStream(1460); +- this.s = new HashMap(); ++ this.queryClients = new HashMap(); + this.time = (new Date()).getTime(); + } + +- private void sendResponsePacket(byte[] var1, DatagramPacket var2) throws IOException { +- this.m.send(new DatagramPacket(var1, var1.length, var2.getSocketAddress())); ++ /** ++ * Sends a byte array as a DatagramPacket response to the client who sent the given DatagramPacket ++ */ ++ private void sendResponsePacket(byte[] par1ArrayOfByte, DatagramPacket par2DatagramPacket) throws IOException { ++ this.querySocket.send(new DatagramPacket(par1ArrayOfByte, par1ArrayOfByte.length, par2DatagramPacket.getSocketAddress())); + } + +- private boolean parseIncomingPacket(DatagramPacket var1) throws IOException { +- byte[] var2 = var1.getData(); +- int var3 = var1.getLength(); +- SocketAddress var4 = var1.getSocketAddress(); ++ /** ++ * Parses an incoming DatagramPacket, returning true if the packet was valid ++ */ ++ private boolean parseIncomingPacket(DatagramPacket par1DatagramPacket) throws IOException { ++ byte[] var2 = par1DatagramPacket.getData(); ++ int var3 = par1DatagramPacket.getLength(); ++ SocketAddress var4 = par1DatagramPacket.getSocketAddress(); + this.logDebug("Packet len " + var3 + " [" + var4 + "]"); +- if(3 <= var3 && -2 == var2[0] && -3 == var2[1]) { ++ ++ if (3 <= var3 && -2 == var2[0] && -3 == var2[1]) { + this.logDebug("Packet \'" + RConUtils.getByteAsHexString(var2[2]) + "\' [" + var4 + "]"); +- switch(var2[2]) { +- case 0: +- if(!this.verifyClientAuth(var1).booleanValue()) { +- this.logDebug("Invalid challenge [" + var4 + "]"); +- return false; +- } else if(15 == var3) { +- this.sendResponsePacket(this.createQueryResponse(var1), var1); +- this.logDebug("Rules [" + var4 + "]"); +- } else { +- RConOutputStream var5 = new RConOutputStream(1460); +- var5.writeInt(0); +- var5.writeByteArray(this.getRequestID(var1.getSocketAddress())); +- var5.writeString(this.k); +- var5.writeString("SMP"); +- var5.writeString(this.l); +- var5.writeString(Integer.toString(this.getNumberOfPlayers())); +- var5.writeString(Integer.toString(this.maxPlayers)); +- var5.writeShort((short)this.serverPort); +- var5.writeString(this.q); +- this.sendResponsePacket(var5.toByteArray(), var1); +- this.logDebug("Status [" + var4 + "]"); +- } +- default: +- return true; +- case 9: +- this.sendAuthChallenge(var1); +- this.logDebug("Challenge [" + var4 + "]"); +- return true; ++ ++ switch (var2[2]) { ++ case 0: ++ if (!this.verifyClientAuth(par1DatagramPacket).booleanValue()) { ++ this.logDebug("Invalid challenge [" + var4 + "]"); ++ return false; ++ } else if (15 == var3) { ++ this.sendResponsePacket(this.createQueryResponse(par1DatagramPacket), par1DatagramPacket); ++ this.logDebug("Rules [" + var4 + "]"); ++ } else { ++ RConOutputStream var5 = new RConOutputStream(1460); ++ var5.writeInt(0); ++ var5.writeByteArray(this.getRequestID(par1DatagramPacket.getSocketAddress())); ++ var5.writeString(this.serverMotd); ++ var5.writeString("SMP"); ++ var5.writeString(this.worldName); ++ var5.writeString(Integer.toString(this.getNumberOfPlayers())); ++ var5.writeString(Integer.toString(this.maxPlayers)); ++ var5.writeShort((short)this.serverPort); ++ var5.writeString(this.queryHostname); ++ this.sendResponsePacket(var5.toByteArray(), par1DatagramPacket); ++ this.logDebug("Status [" + var4 + "]"); ++ } ++ ++ case 9: ++ this.sendAuthChallenge(par1DatagramPacket); ++ this.logDebug("Challenge [" + var4 + "]"); ++ return true; ++ ++ default: ++ return true; + } + } else { + this.logDebug("Invalid packet [" + var4 + "]"); +@@ -117,11 +160,15 @@ + } + } + +- private byte[] createQueryResponse(DatagramPacket var1) throws IOException { +- long var2 = MinecraftServer.getCurrentTimeMillis(); +- if(var2 < this.lastQueryResponseTime + 5000L) { ++ /** ++ * Creates a query response as a byte array for the specified query DatagramPacket ++ */ ++ private byte[] createQueryResponse(DatagramPacket par1DatagramPacket) throws IOException { ++ long var2 = MinecraftServer.getSystemTimeMillis(); ++ ++ if (var2 < this.lastQueryResponseTime + 5000L) { + byte[] var7 = this.output.toByteArray(); +- byte[] var8 = this.getRequestID(var1.getSocketAddress()); ++ byte[] var8 = this.getRequestID(par1DatagramPacket.getSocketAddress()); + var7[1] = var8[0]; + var7[2] = var8[1]; + var7[3] = var8[2]; +@@ -131,12 +178,12 @@ + this.lastQueryResponseTime = var2; + this.output.reset(); + this.output.writeInt(0); +- this.output.writeByteArray(this.getRequestID(var1.getSocketAddress())); ++ this.output.writeByteArray(this.getRequestID(par1DatagramPacket.getSocketAddress())); + this.output.writeString("splitnum"); + this.output.writeInt(128); + this.output.writeInt(0); + this.output.writeString("hostname"); +- this.output.writeString(this.k); ++ this.output.writeString(this.serverMotd); + this.output.writeString("gametype"); + this.output.writeString("SMP"); + this.output.writeString("game_id"); +@@ -146,7 +193,7 @@ + this.output.writeString("plugins"); + this.output.writeString(this.server.getPlugins()); + this.output.writeString("map"); +- this.output.writeString(this.l); ++ this.output.writeString(this.worldName); + this.output.writeString("numplayers"); + this.output.writeString("" + this.getNumberOfPlayers()); + this.output.writeString("maxplayers"); +@@ -154,7 +201,7 @@ + this.output.writeString("hostport"); + this.output.writeString("" + this.serverPort); + this.output.writeString("hostip"); +- this.output.writeString(this.q); ++ this.output.writeString(this.queryHostname); + this.output.writeInt(0); + this.output.writeInt(1); + this.output.writeString("player_"); +@@ -162,7 +209,7 @@ + String[] var4 = this.server.getAllUsernames(); + byte var5 = (byte)var4.length; + +- for(byte var6 = (byte)(var5 - 1); var6 >= 0; --var6) { ++ for (byte var6 = (byte)(var5 - 1); var6 >= 0; --var6) { + this.output.writeString(var4[var6]); + } + +@@ -171,58 +218,73 @@ + } + } + +- private byte[] getRequestID(SocketAddress var1) { +- return ((RConThreadQueryAuth)this.s.get(var1)).getRequestId(); ++ /** ++ * Returns the request ID provided by the authorized client ++ */ ++ private byte[] getRequestID(SocketAddress par1SocketAddress) { ++ return ((RConThreadQueryAuth)this.queryClients.get(par1SocketAddress)).getRequestId(); + } + +- private Boolean verifyClientAuth(DatagramPacket var1) { +- SocketAddress var2 = var1.getSocketAddress(); +- if(!this.s.containsKey(var2)) { ++ /** ++ * Returns true if the client has a valid auth, otherwise false ++ */ ++ private Boolean verifyClientAuth(DatagramPacket par1DatagramPacket) { ++ SocketAddress var2 = par1DatagramPacket.getSocketAddress(); ++ ++ if (!this.queryClients.containsKey(var2)) { + return Boolean.valueOf(false); + } else { +- byte[] var3 = var1.getData(); +- return ((RConThreadQueryAuth)this.s.get(var2)).getRandomChallenge() != RConUtils.getBytesAsBEint(var3, 7, var1.getLength()) ? Boolean.valueOf(false) : Boolean.valueOf(true); ++ byte[] var3 = par1DatagramPacket.getData(); ++ return ((RConThreadQueryAuth)this.queryClients.get(var2)).getRandomChallenge() != RConUtils.getBytesAsBEint(var3, 7, par1DatagramPacket.getLength()) ? Boolean.valueOf(false) : Boolean.valueOf(true); + } + } + +- private void sendAuthChallenge(DatagramPacket var1) throws IOException { +- RConThreadQueryAuth var2 = new RConThreadQueryAuth(this, var1); +- this.s.put(var1.getSocketAddress(), var2); +- this.sendResponsePacket(var2.getChallengeValue(), var1); ++ /** ++ * Sends an auth challenge DatagramPacket to the client and adds the client to the queryClients map ++ */ ++ private void sendAuthChallenge(DatagramPacket par1DatagramPacket) throws IOException { ++ RConThreadQueryAuth var2 = new RConThreadQueryAuth(this, par1DatagramPacket); ++ this.queryClients.put(par1DatagramPacket.getSocketAddress(), var2); ++ this.sendResponsePacket(var2.getChallengeValue(), par1DatagramPacket); + } + ++ /** ++ * Removes all clients whose auth is no longer valid ++ */ + private void cleanQueryClientsMap() { +- if(this.running) { +- long var1 = MinecraftServer.getCurrentTimeMillis(); +- if(var1 >= this.lastAuthCheckTime + 30000L) { ++ if (this.running) { ++ long var1 = MinecraftServer.getSystemTimeMillis(); ++ ++ if (var1 >= this.lastAuthCheckTime + 30000L) { + this.lastAuthCheckTime = var1; +- Iterator var3 = this.s.entrySet().iterator(); ++ Iterator var3 = this.queryClients.entrySet().iterator(); + +- while(var3.hasNext()) { ++ while (var3.hasNext()) { + Entry var4 = (Entry)var3.next(); +- if(((RConThreadQueryAuth)var4.getValue()).hasExpired(var1).booleanValue()) { ++ ++ if (((RConThreadQueryAuth)var4.getValue()).hasExpired(var1).booleanValue()) { + var3.remove(); + } + } +- + } + } + } + + public void run() { +- this.logInfo("Query running on " + this.r + ":" + this.queryPort); +- this.lastAuthCheckTime = MinecraftServer.getCurrentTimeMillis(); +- this.o = new DatagramPacket(this.buffer, this.buffer.length); ++ this.logInfo("Query running on " + this.serverHostname + ":" + this.queryPort); ++ this.lastAuthCheckTime = MinecraftServer.getSystemTimeMillis(); ++ this.incomingPacket = new DatagramPacket(this.buffer, this.buffer.length); + + try { +- while(this.running) { ++ while (this.running) { + try { +- this.m.receive(this.o); ++ this.querySocket.receive(this.incomingPacket); + this.cleanQueryClientsMap(); +- this.parseIncomingPacket(this.o); ++ this.parseIncomingPacket(this.incomingPacket); + } catch (SocketTimeoutException var7) { + this.cleanQueryClientsMap(); + } catch (PortUnreachableException var8) { ++ ; + } catch (IOException var9) { + this.stopWithException(var9); + } +@@ -230,45 +292,52 @@ + } finally { + this.closeAllSockets(); + } +- + } + ++ /** ++ * Creates a new Thread object from this class and starts running ++ */ + public void startThread() { +- if(!this.running) { +- if(0 < this.queryPort && '\uffff' >= this.queryPort) { +- if(this.initQuerySystem()) { ++ if (!this.running) { ++ if (0 < this.queryPort && 65535 >= this.queryPort) { ++ if (this.initQuerySystem()) { + super.startThread(); + } +- + } else { + this.logWarning("Invalid query port " + this.queryPort + " found in \'" + this.server.getSettingsFilename() + "\' (queries disabled)"); + } + } + } + +- private void stopWithException(Exception var1) { +- if(this.running) { +- this.logWarning("Unexpected exception, buggy JRE? (" + var1.toString() + ")"); +- if(!this.initQuerySystem()) { ++ /** ++ * Stops the query server and reports the given Exception ++ */ ++ private void stopWithException(Exception par1Exception) { ++ if (this.running) { ++ this.logWarning("Unexpected exception, buggy JRE? (" + par1Exception.toString() + ")"); ++ ++ if (!this.initQuerySystem()) { + this.logSevere("Failed to recover from buggy JRE, shutting down!"); + this.running = false; + } +- + } + } + ++ /** ++ * Initializes the query system by binding it to a port ++ */ + private boolean initQuerySystem() { + try { +- this.m = new DatagramSocket(this.queryPort, InetAddress.getByName(this.r)); +- this.registerSocket(this.m); +- this.m.setSoTimeout(500); ++ this.querySocket = new DatagramSocket(this.queryPort, InetAddress.getByName(this.serverHostname)); ++ this.registerSocket(this.querySocket); ++ this.querySocket.setSoTimeout(500); + return true; + } catch (SocketException var2) { +- this.logWarning("Unable to initialise query system on " + this.r + ":" + this.queryPort + " (Socket): " + var2.getMessage()); ++ this.logWarning("Unable to initialise query system on " + this.serverHostname + ":" + this.queryPort + " (Socket): " + var2.getMessage()); + } catch (UnknownHostException var3) { +- this.logWarning("Unable to initialise query system on " + this.r + ":" + this.queryPort + " (Unknown Host): " + var3.getMessage()); ++ this.logWarning("Unable to initialise query system on " + this.serverHostname + ":" + this.queryPort + " (Unknown Host): " + var3.getMessage()); + } catch (Exception var4) { +- this.logWarning("Unable to initialise query system on " + this.r + ":" + this.queryPort + " (E): " + var4.getMessage()); ++ this.logWarning("Unable to initialise query system on " + this.serverHostname + ":" + this.queryPort + " (E): " + var4.getMessage()); + } + + return false; diff --git a/patches/net/minecraft/src/RConThreadQueryAuth.java.patch b/patches/net/minecraft/src/RConThreadQueryAuth.java.patch new file mode 100644 index 0000000..f49e0b6 --- /dev/null +++ b/patches/net/minecraft/src/RConThreadQueryAuth.java.patch @@ -0,0 +1,78 @@ +--- net/minecraft/src/RConThreadQueryAuth.java ++++ net/minecraft/src/RConThreadQueryAuth.java +@@ -5,39 +5,63 @@ + import java.util.Random; + + class RConThreadQueryAuth { ++ ++ /** The creation timestamp for this auth */ + private long timestamp; ++ ++ /** A random challenge */ + private int randomChallenge; ++ ++ /** A client-provided request ID associated with this query. */ + private byte[] requestId; ++ ++ /** A unique string of bytes used to verify client auth */ + private byte[] challengeValue; +- private String f; ++ ++ /** The request ID stored as a String */ ++ private String requestIdAsString; ++ ++ /** The RConThreadQuery that this is probably an inner class of */ + final RConThreadQuery queryThread; + +- public RConThreadQueryAuth(RConThreadQuery var1, DatagramPacket var2) { +- this.queryThread = var1; ++ public RConThreadQueryAuth(RConThreadQuery par1RConThreadQuery, DatagramPacket par2DatagramPacket) { ++ this.queryThread = par1RConThreadQuery; + this.timestamp = (new Date()).getTime(); +- byte[] var3 = var2.getData(); ++ byte[] var3 = par2DatagramPacket.getData(); + this.requestId = new byte[4]; + this.requestId[0] = var3[3]; + this.requestId[1] = var3[4]; + this.requestId[2] = var3[5]; + this.requestId[3] = var3[6]; +- this.f = new String(this.requestId); ++ this.requestIdAsString = new String(this.requestId); + this.randomChallenge = (new Random()).nextInt(16777216); +- this.challengeValue = String.format("\t%s%d\u0000", new Object[]{this.f, Integer.valueOf(this.randomChallenge)}).getBytes(); +- } +- +- public Boolean hasExpired(long var1) { +- return Boolean.valueOf(this.timestamp < var1); +- } +- ++ this.challengeValue = String.format("\t%s%d\u0000", new Object[] {this.requestIdAsString, Integer.valueOf(this.randomChallenge)}).getBytes(); ++ } ++ ++ /** ++ * Returns true if the auth's creation timestamp is less than the given time, otherwise false ++ */ ++ public Boolean hasExpired(long par1) { ++ return Boolean.valueOf(this.timestamp < par1); ++ } ++ ++ /** ++ * Returns the random challenge number assigned to this auth ++ */ + public int getRandomChallenge() { + return this.randomChallenge; + } + ++ /** ++ * Returns the auth challenge value ++ */ + public byte[] getChallengeValue() { + return this.challengeValue; + } + ++ /** ++ * Returns the request ID provided by the client. ++ */ + public byte[] getRequestId() { + return this.requestId; + } diff --git a/patches/net/minecraft/src/RConUtils.java.patch b/patches/net/minecraft/src/RConUtils.java.patch new file mode 100644 index 0000000..95ff3ed --- /dev/null +++ b/patches/net/minecraft/src/RConUtils.java.patch @@ -0,0 +1,78 @@ +--- net/minecraft/src/RConUtils.java ++++ net/minecraft/src/RConUtils.java +@@ -3,36 +3,54 @@ + import java.io.UnsupportedEncodingException; + + public class RConUtils { +- public static char[] hexDigits = new char[]{'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f'}; +- +- public static String getBytesAsString(byte[] var0, int var1, int var2) { +- int var3 = var2 - 1; +- ++ ++ /** Translation array of decimal to hex digits */ ++ public static char[] hexDigits = new char[] {'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f'}; ++ ++ /** ++ * Read a null-terminated string from the given byte array ++ */ ++ public static String getBytesAsString(byte[] par0ArrayOfByte, int par1, int par2) { ++ int var3 = par2 - 1; + int var4; +- for(var4 = var1 > var3 ? var3 : var1; 0 != var0[var4] && var4 < var3; ++var4) { ++ ++ for (var4 = par1 > var3 ? var3 : par1; 0 != par0ArrayOfByte[var4] && var4 < var3; ++var4) { ++ ; + } + + try { +- return new String(var0, var1, var4 - var1, "UTF-8"); ++ return new String(par0ArrayOfByte, par1, var4 - par1, "UTF-8"); + } catch (UnsupportedEncodingException var6) { + var6.printStackTrace(); + return null; + } + } + +- public static int getRemainingBytesAsLEInt(byte[] var0, int var1) { +- return getBytesAsLEInt(var0, var1, var0.length); +- } +- +- public static int getBytesAsLEInt(byte[] var0, int var1, int var2) { +- return 0 > var2 - var1 - 4 ? 0 : var0[var1 + 3] << 24 | (var0[var1 + 2] & 255) << 16 | (var0[var1 + 1] & 255) << 8 | var0[var1] & 255; +- } +- +- public static int getBytesAsBEint(byte[] var0, int var1, int var2) { +- return 0 > var2 - var1 - 4 ? 0 : var0[var1] << 24 | (var0[var1 + 1] & 255) << 16 | (var0[var1 + 2] & 255) << 8 | var0[var1 + 3] & 255; +- } +- +- public static String getByteAsHexString(byte var0) { +- return "" + hexDigits[(var0 & 240) >>> 4] + hexDigits[var0 & 15]; ++ /** ++ * Read 4 bytes from the ++ */ ++ public static int getRemainingBytesAsLEInt(byte[] par0ArrayOfByte, int par1) { ++ return getBytesAsLEInt(par0ArrayOfByte, par1, par0ArrayOfByte.length); ++ } ++ ++ /** ++ * Read 4 bytes from the given array in little-endian format and return them as an int ++ */ ++ public static int getBytesAsLEInt(byte[] par0ArrayOfByte, int par1, int par2) { ++ return 0 > par2 - par1 - 4 ? 0 : par0ArrayOfByte[par1 + 3] << 24 | (par0ArrayOfByte[par1 + 2] & 255) << 16 | (par0ArrayOfByte[par1 + 1] & 255) << 8 | par0ArrayOfByte[par1] & 255; ++ } ++ ++ /** ++ * Read 4 bytes from the given array in big-endian format and return them as an int ++ */ ++ public static int getBytesAsBEint(byte[] par0ArrayOfByte, int par1, int par2) { ++ return 0 > par2 - par1 - 4 ? 0 : par0ArrayOfByte[par1] << 24 | (par0ArrayOfByte[par1 + 1] & 255) << 16 | (par0ArrayOfByte[par1 + 2] & 255) << 8 | par0ArrayOfByte[par1 + 3] & 255; ++ } ++ ++ /** ++ * Returns a String representation of the byte in hexadecimal format ++ */ ++ public static String getByteAsHexString(byte par0) { ++ return "" + hexDigits[(par0 & 240) >>> 4] + hexDigits[par0 & 15]; + } + } diff --git a/patches/net/minecraft/src/RandomPositionGenerator.java.patch b/patches/net/minecraft/src/RandomPositionGenerator.java.patch new file mode 100644 index 0000000..42eace3 --- /dev/null +++ b/patches/net/minecraft/src/RandomPositionGenerator.java.patch @@ -0,0 +1,123 @@ +--- net/minecraft/src/RandomPositionGenerator.java ++++ net/minecraft/src/RandomPositionGenerator.java +@@ -3,53 +3,75 @@ + import java.util.Random; + + public class RandomPositionGenerator { ++ ++ /** ++ * used to store a driection when the user passes a point to move towards or away from. WARNING: NEVER THREAD SAFE. ++ * MULTIPLE findTowards and findAway calls, will share this var ++ */ + private static Vec3 staticVector = Vec3.createVectorHelper(0.0D, 0.0D, 0.0D); + +- public static Vec3 findRandomTarget(EntityCreature var0, int var1, int var2) { +- return findRandomTargetBlock(var0, var1, var2, (Vec3)null); +- } +- +- public static Vec3 findRandomTargetBlockTowards(EntityCreature var0, int var1, int var2, Vec3 var3) { +- staticVector.xCoord = var3.xCoord - var0.posX; +- staticVector.yCoord = var3.yCoord - var0.posY; +- staticVector.zCoord = var3.zCoord - var0.posZ; +- return findRandomTargetBlock(var0, var1, var2, staticVector); +- } +- +- public static Vec3 findRandomTargetBlockAwayFrom(EntityCreature var0, int var1, int var2, Vec3 var3) { +- staticVector.xCoord = var0.posX - var3.xCoord; +- staticVector.yCoord = var0.posY - var3.yCoord; +- staticVector.zCoord = var0.posZ - var3.zCoord; +- return findRandomTargetBlock(var0, var1, var2, staticVector); +- } +- +- private static Vec3 findRandomTargetBlock(EntityCreature var0, int var1, int var2, Vec3 var3) { +- Random var4 = var0.getRNG(); ++ /** ++ * finds a random target within par1(x,z) and par2 (y) blocks ++ */ ++ public static Vec3 findRandomTarget(EntityCreature par0EntityCreature, int par1, int par2) { ++ return findRandomTargetBlock(par0EntityCreature, par1, par2, (Vec3)null); ++ } ++ ++ /** ++ * finds a random target within par1(x,z) and par2 (y) blocks in the direction of the point par3 ++ */ ++ public static Vec3 findRandomTargetBlockTowards(EntityCreature par0EntityCreature, int par1, int par2, Vec3 par3Vec3) { ++ staticVector.xCoord = par3Vec3.xCoord - par0EntityCreature.posX; ++ staticVector.yCoord = par3Vec3.yCoord - par0EntityCreature.posY; ++ staticVector.zCoord = par3Vec3.zCoord - par0EntityCreature.posZ; ++ return findRandomTargetBlock(par0EntityCreature, par1, par2, staticVector); ++ } ++ ++ /** ++ * finds a random target within par1(x,z) and par2 (y) blocks in the reverse direction of the point par3 ++ */ ++ public static Vec3 findRandomTargetBlockAwayFrom(EntityCreature par0EntityCreature, int par1, int par2, Vec3 par3Vec3) { ++ staticVector.xCoord = par0EntityCreature.posX - par3Vec3.xCoord; ++ staticVector.yCoord = par0EntityCreature.posY - par3Vec3.yCoord; ++ staticVector.zCoord = par0EntityCreature.posZ - par3Vec3.zCoord; ++ return findRandomTargetBlock(par0EntityCreature, par1, par2, staticVector); ++ } ++ ++ /** ++ * searches 10 blocks at random in a within par1(x,z) and par2 (y) distance, ignores those not in the direction of ++ * par3Vec3, then points to the tile for which creature.getBlockPathWeight returns the highest number ++ */ ++ private static Vec3 findRandomTargetBlock(EntityCreature par0EntityCreature, int par1, int par2, Vec3 par3Vec3) { ++ Random var4 = par0EntityCreature.getRNG(); + boolean var5 = false; + int var6 = 0; + int var7 = 0; + int var8 = 0; + float var9 = -99999.0F; + boolean var10; +- if(var0.hasHome()) { +- double var11 = (double)(var0.getHomePosition().getDistanceSquared(MathHelper.floor_double(var0.posX), MathHelper.floor_double(var0.posY), MathHelper.floor_double(var0.posZ)) + 4.0F); +- double var13 = (double)(var0.func_110174_bM() + (float)var1); ++ ++ if (par0EntityCreature.hasHome()) { ++ double var11 = (double)(par0EntityCreature.getHomePosition().getDistanceSquared(MathHelper.floor_double(par0EntityCreature.posX), MathHelper.floor_double(par0EntityCreature.posY), MathHelper.floor_double(par0EntityCreature.posZ)) + 4.0F); ++ double var13 = (double)(par0EntityCreature.func_110174_bM() + (float)par1); + var10 = var11 < var13 * var13; + } else { + var10 = false; + } + +- for(int var16 = 0; var16 < 10; ++var16) { +- int var12 = var4.nextInt(2 * var1) - var1; +- int var17 = var4.nextInt(2 * var2) - var2; +- int var14 = var4.nextInt(2 * var1) - var1; +- if(var3 == null || (double)var12 * var3.xCoord + (double)var14 * var3.zCoord >= 0.0D) { +- var12 += MathHelper.floor_double(var0.posX); +- var17 += MathHelper.floor_double(var0.posY); +- var14 += MathHelper.floor_double(var0.posZ); +- if(!var10 || var0.func_110176_b(var12, var17, var14)) { +- float var15 = var0.getBlockPathWeight(var12, var17, var14); +- if(var15 > var9) { ++ for (int var16 = 0; var16 < 10; ++var16) { ++ int var12 = var4.nextInt(2 * par1) - par1; ++ int var17 = var4.nextInt(2 * par2) - par2; ++ int var14 = var4.nextInt(2 * par1) - par1; ++ ++ if (par3Vec3 == null || (double)var12 * par3Vec3.xCoord + (double)var14 * par3Vec3.zCoord >= 0.0D) { ++ var12 += MathHelper.floor_double(par0EntityCreature.posX); ++ var17 += MathHelper.floor_double(par0EntityCreature.posY); ++ var14 += MathHelper.floor_double(par0EntityCreature.posZ); ++ ++ if (!var10 || par0EntityCreature.func_110176_b(var12, var17, var14)) { ++ float var15 = par0EntityCreature.getBlockPathWeight(var12, var17, var14); ++ ++ if (var15 > var9) { + var9 = var15; + var6 = var12; + var7 = var17; +@@ -60,8 +82,8 @@ + } + } + +- if(var5) { +- return var0.worldObj.getWorldVec3Pool().getVecFromPool((double)var6, (double)var7, (double)var8); ++ if (var5) { ++ return par0EntityCreature.worldObj.getWorldVec3Pool().getVecFromPool((double)var6, (double)var7, (double)var8); + } else { + return null; + } diff --git a/patches/net/minecraft/src/RangedAttribute.java.patch b/patches/net/minecraft/src/RangedAttribute.java.patch new file mode 100644 index 0000000..7a98162 --- /dev/null +++ b/patches/net/minecraft/src/RangedAttribute.java.patch @@ -0,0 +1,65 @@ +--- net/minecraft/src/RangedAttribute.java ++++ net/minecraft/src/RangedAttribute.java +@@ -3,39 +3,40 @@ + public class RangedAttribute extends BaseAttribute { + private final double minimumValue; + private final double maximumValue; +- private String c; +- +- public RangedAttribute(String var1, double var2, double var4, double var6) { +- super(var1, var2); +- this.minimumValue = var4; +- this.maximumValue = var6; +- if(var4 > var6) { ++ private String field_111119_c; ++ ++ public RangedAttribute(String par1Str, double par2, double par4, double par6) { ++ super(par1Str, par2); ++ this.minimumValue = par4; ++ this.maximumValue = par6; ++ ++ if (par4 > par6) { + throw new IllegalArgumentException("Minimum value cannot be bigger than maximum value!"); +- } else if(var2 < var4) { ++ } else if (par2 < par4) { + throw new IllegalArgumentException("Default value cannot be lower than minimum value!"); +- } else if(var2 > var6) { ++ } else if (par2 > par6) { + throw new IllegalArgumentException("Default value cannot be bigger than maximum value!"); + } + } + +- public RangedAttribute func_111117_a(String var1) { +- this.c = var1; ++ public RangedAttribute func_111117_a(String par1Str) { ++ this.field_111119_c = par1Str; + return this; + } + + public String func_111116_f() { +- return this.c; ++ return this.field_111119_c; + } + +- public double clampValue(double var1) { +- if(var1 < this.minimumValue) { +- var1 = this.minimumValue; +- } +- +- if(var1 > this.maximumValue) { +- var1 = this.maximumValue; +- } +- +- return var1; ++ public double clampValue(double par1) { ++ if (par1 < this.minimumValue) { ++ par1 = this.minimumValue; ++ } ++ ++ if (par1 > this.maximumValue) { ++ par1 = this.maximumValue; ++ } ++ ++ return par1; + } + } diff --git a/patches/net/minecraft/src/RecipeFireworks.java.patch b/patches/net/minecraft/src/RecipeFireworks.java.patch new file mode 100644 index 0000000..fa082db --- /dev/null +++ b/patches/net/minecraft/src/RecipeFireworks.java.patch @@ -0,0 +1,202 @@ +--- net/minecraft/src/RecipeFireworks.java ++++ net/minecraft/src/RecipeFireworks.java +@@ -5,7 +5,10 @@ + public class RecipeFireworks implements IRecipe { + private ItemStack field_92102_a; + +- public boolean matches(InventoryCrafting var1, World var2) { ++ /** ++ * Used to check if a recipe matches current crafting inventory ++ */ ++ public boolean matches(InventoryCrafting par1InventoryCrafting, World par2World) { + this.field_92102_a = null; + int var3 = 0; + int var4 = 0; +@@ -14,29 +17,30 @@ + int var7 = 0; + int var8 = 0; + +- for(int var9 = 0; var9 < var1.getSizeInventory(); ++var9) { +- ItemStack var10 = var1.getStackInSlot(var9); +- if(var10 != null) { +- if(var10.itemID == Item.gunpowder.itemID) { ++ for (int var9 = 0; var9 < par1InventoryCrafting.getSizeInventory(); ++var9) { ++ ItemStack var10 = par1InventoryCrafting.getStackInSlot(var9); ++ ++ if (var10 != null) { ++ if (var10.itemID == Item.gunpowder.itemID) { + ++var4; +- } else if(var10.itemID == Item.fireworkCharge.itemID) { ++ } else if (var10.itemID == Item.fireworkCharge.itemID) { + ++var6; +- } else if(var10.itemID == Item.dyePowder.itemID) { ++ } else if (var10.itemID == Item.dyePowder.itemID) { + ++var5; +- } else if(var10.itemID == Item.paper.itemID) { ++ } else if (var10.itemID == Item.paper.itemID) { + ++var3; +- } else if(var10.itemID == Item.glowstone.itemID) { +- ++var7; +- } else if(var10.itemID == Item.diamond.itemID) { +- ++var7; +- } else if(var10.itemID == Item.fireballCharge.itemID) { +- ++var8; +- } else if(var10.itemID == Item.feather.itemID) { +- ++var8; +- } else if(var10.itemID == Item.goldNugget.itemID) { ++ } else if (var10.itemID == Item.glowstone.itemID) { ++ ++var7; ++ } else if (var10.itemID == Item.diamond.itemID) { ++ ++var7; ++ } else if (var10.itemID == Item.fireballCharge.itemID) { ++ ++var8; ++ } else if (var10.itemID == Item.feather.itemID) { ++ ++var8; ++ } else if (var10.itemID == Item.goldNugget.itemID) { + ++var8; + } else { +- if(var10.itemID != Item.skull.itemID) { ++ if (var10.itemID != Item.skull.itemID) { + return false; + } + +@@ -46,19 +50,23 @@ + } + + var7 += var5 + var8; +- if(var4 <= 3 && var3 <= 1) { ++ ++ if (var4 <= 3 && var3 <= 1) { + NBTTagCompound var16; + NBTTagCompound var19; +- if(var4 >= 1 && var3 == 1 && var7 == 0) { ++ ++ if (var4 >= 1 && var3 == 1 && var7 == 0) { + this.field_92102_a = new ItemStack(Item.firework); +- if(var6 > 0) { ++ ++ if (var6 > 0) { + var16 = new NBTTagCompound(); + var19 = new NBTTagCompound("Fireworks"); + NBTTagList var25 = new NBTTagList("Explosions"); + +- for(int var22 = 0; var22 < var1.getSizeInventory(); ++var22) { +- ItemStack var26 = var1.getStackInSlot(var22); +- if(var26 != null && var26.itemID == Item.fireworkCharge.itemID && var26.hasTagCompound() && var26.getTagCompound().hasKey("Explosion")) { ++ for (int var22 = 0; var22 < par1InventoryCrafting.getSizeInventory(); ++var22) { ++ ItemStack var26 = par1InventoryCrafting.getStackInSlot(var22); ++ ++ if (var26 != null && var26.itemID == Item.fireworkCharge.itemID && var26.hasTagCompound() && var26.getTagCompound().hasKey("Explosion")) { + var25.appendTag(var26.getTagCompound().getCompoundTag("Explosion")); + } + } +@@ -70,29 +78,30 @@ + } + + return true; +- } else if(var4 == 1 && var3 == 0 && var6 == 0 && var5 > 0 && var8 <= 1) { ++ } else if (var4 == 1 && var3 == 0 && var6 == 0 && var5 > 0 && var8 <= 1) { + this.field_92102_a = new ItemStack(Item.fireworkCharge); + var16 = new NBTTagCompound(); + var19 = new NBTTagCompound("Explosion"); + byte var23 = 0; + ArrayList var12 = new ArrayList(); + +- for(int var13 = 0; var13 < var1.getSizeInventory(); ++var13) { +- ItemStack var14 = var1.getStackInSlot(var13); +- if(var14 != null) { +- if(var14.itemID == Item.dyePowder.itemID) { ++ for (int var13 = 0; var13 < par1InventoryCrafting.getSizeInventory(); ++var13) { ++ ItemStack var14 = par1InventoryCrafting.getStackInSlot(var13); ++ ++ if (var14 != null) { ++ if (var14.itemID == Item.dyePowder.itemID) { + var12.add(Integer.valueOf(ItemDye.dyeColors[var14.getItemDamage()])); +- } else if(var14.itemID == Item.glowstone.itemID) { ++ } else if (var14.itemID == Item.glowstone.itemID) { + var19.setBoolean("Flicker", true); +- } else if(var14.itemID == Item.diamond.itemID) { ++ } else if (var14.itemID == Item.diamond.itemID) { + var19.setBoolean("Trail", true); +- } else if(var14.itemID == Item.fireballCharge.itemID) { ++ } else if (var14.itemID == Item.fireballCharge.itemID) { + var23 = 1; +- } else if(var14.itemID == Item.feather.itemID) { ++ } else if (var14.itemID == Item.feather.itemID) { + var23 = 4; +- } else if(var14.itemID == Item.goldNugget.itemID) { ++ } else if (var14.itemID == Item.goldNugget.itemID) { + var23 = 2; +- } else if(var14.itemID == Item.skull.itemID) { ++ } else if (var14.itemID == Item.skull.itemID) { + var23 = 3; + } + } +@@ -100,7 +109,7 @@ + + int[] var24 = new int[var12.size()]; + +- for(int var27 = 0; var27 < var24.length; ++var27) { ++ for (int var27 = 0; var27 < var24.length; ++var27) { + var24[var27] = ((Integer)var12.get(var27)).intValue(); + } + +@@ -109,15 +118,16 @@ + var16.setTag("Explosion", var19); + this.field_92102_a.setTagCompound(var16); + return true; +- } else if(var4 == 0 && var3 == 0 && var6 == 1 && var5 > 0 && var5 == var7) { ++ } else if (var4 == 0 && var3 == 0 && var6 == 1 && var5 > 0 && var5 == var7) { + ArrayList var15 = new ArrayList(); + +- for(int var17 = 0; var17 < var1.getSizeInventory(); ++var17) { +- ItemStack var11 = var1.getStackInSlot(var17); +- if(var11 != null) { +- if(var11.itemID == Item.dyePowder.itemID) { ++ for (int var17 = 0; var17 < par1InventoryCrafting.getSizeInventory(); ++var17) { ++ ItemStack var11 = par1InventoryCrafting.getStackInSlot(var17); ++ ++ if (var11 != null) { ++ if (var11.itemID == Item.dyePowder.itemID) { + var15.add(Integer.valueOf(ItemDye.dyeColors[var11.getItemDamage()])); +- } else if(var11.itemID == Item.fireworkCharge.itemID) { ++ } else if (var11.itemID == Item.fireworkCharge.itemID) { + this.field_92102_a = var11.copy(); + this.field_92102_a.stackSize = 1; + } +@@ -126,13 +136,14 @@ + + int[] var18 = new int[var15.size()]; + +- for(int var20 = 0; var20 < var18.length; ++var20) { ++ for (int var20 = 0; var20 < var18.length; ++var20) { + var18[var20] = ((Integer)var15.get(var20)).intValue(); + } + +- if(this.field_92102_a != null && this.field_92102_a.hasTagCompound()) { ++ if (this.field_92102_a != null && this.field_92102_a.hasTagCompound()) { + NBTTagCompound var21 = this.field_92102_a.getTagCompound().getCompoundTag("Explosion"); +- if(var21 == null) { ++ ++ if (var21 == null) { + return false; + } else { + var21.setIntArray("FadeColors", var18); +@@ -149,10 +160,16 @@ + } + } + +- public ItemStack getCraftingResult(InventoryCrafting var1) { ++ /** ++ * Returns an Item that is the result of this recipe ++ */ ++ public ItemStack getCraftingResult(InventoryCrafting par1InventoryCrafting) { + return this.field_92102_a.copy(); + } + ++ /** ++ * Returns the size of the recipe area ++ */ + public int getRecipeSize() { + return 10; + } diff --git a/patches/net/minecraft/src/RecipeSorter.java.patch b/patches/net/minecraft/src/RecipeSorter.java.patch new file mode 100644 index 0000000..024d172 --- /dev/null +++ b/patches/net/minecraft/src/RecipeSorter.java.patch @@ -0,0 +1,28 @@ +--- net/minecraft/src/RecipeSorter.java ++++ net/minecraft/src/RecipeSorter.java +@@ -5,15 +5,15 @@ + class RecipeSorter implements Comparator { + final CraftingManager craftingManager; + +- RecipeSorter(CraftingManager var1) { +- this.craftingManager = var1; +- } +- +- public int compareRecipes(IRecipe var1, IRecipe var2) { +- return var1 instanceof ShapelessRecipes && var2 instanceof ShapedRecipes ? 1 : (var2 instanceof ShapelessRecipes && var1 instanceof ShapedRecipes ? -1 : (var2.getRecipeSize() < var1.getRecipeSize() ? -1 : (var2.getRecipeSize() > var1.getRecipeSize() ? 1 : 0))); +- } +- +- public int compare(Object var1, Object var2) { +- return this.compareRecipes((IRecipe)var1, (IRecipe)var2); ++ RecipeSorter(CraftingManager par1CraftingManager) { ++ this.craftingManager = par1CraftingManager; ++ } ++ ++ public int compareRecipes(IRecipe par1IRecipe, IRecipe par2IRecipe) { ++ return par1IRecipe instanceof ShapelessRecipes && par2IRecipe instanceof ShapedRecipes ? 1 : (par2IRecipe instanceof ShapelessRecipes && par1IRecipe instanceof ShapedRecipes ? -1 : (par2IRecipe.getRecipeSize() < par1IRecipe.getRecipeSize() ? -1 : (par2IRecipe.getRecipeSize() > par1IRecipe.getRecipeSize() ? 1 : 0))); ++ } ++ ++ public int compare(Object par1Obj, Object par2Obj) { ++ return this.compareRecipes((IRecipe)par1Obj, (IRecipe)par2Obj); + } + } diff --git a/patches/net/minecraft/src/RecipesArmor.java.patch b/patches/net/minecraft/src/RecipesArmor.java.patch new file mode 100644 index 0000000..60337f4 --- /dev/null +++ b/patches/net/minecraft/src/RecipesArmor.java.patch @@ -0,0 +1,38 @@ +--- net/minecraft/src/RecipesArmor.java ++++ net/minecraft/src/RecipesArmor.java +@@ -1,18 +1,24 @@ + package net.minecraft.src; + + public class RecipesArmor { +- private String[][] a = new String[][]{{"XXX", "X X"}, {"X X", "XXX", "XXX"}, {"XXX", "X X", "X X"}, {"X X", "X X"}}; +- private Object[][] b = new Object[][]{{Item.leather, Block.fire, Item.ingotIron, Item.diamond, Item.ingotGold}, {Item.helmetLeather, Item.helmetChain, Item.helmetIron, Item.helmetDiamond, Item.helmetGold}, {Item.plateLeather, Item.plateChain, Item.plateIron, Item.plateDiamond, Item.plateGold}, {Item.legsLeather, Item.legsChain, Item.legsIron, Item.legsDiamond, Item.legsGold}, {Item.bootsLeather, Item.bootsChain, Item.bootsIron, Item.bootsDiamond, Item.bootsGold}}; +- +- public void addRecipes(CraftingManager var1) { +- for(int var2 = 0; var2 < this.b[0].length; ++var2) { +- Object var3 = this.b[0][var2]; +- +- for(int var4 = 0; var4 < this.b.length - 1; ++var4) { +- Item var5 = (Item)this.b[var4 + 1][var2]; +- var1.addRecipe(new ItemStack(var5), new Object[]{this.a[var4], Character.valueOf('X'), var3}); ++ private String[][] recipePatterns = new String[][] {{"XXX", "X X"}, {"X X", "XXX", "XXX"}, {"XXX", "X X", "X X"}, {"X X", "X X"}}; ++ private Object[][] recipeItems; ++ ++ public RecipesArmor() { ++ this.recipeItems = new Object[][] {{Item.leather, Block.fire, Item.ingotIron, Item.diamond, Item.ingotGold}, {Item.helmetLeather, Item.helmetChain, Item.helmetIron, Item.helmetDiamond, Item.helmetGold}, {Item.plateLeather, Item.plateChain, Item.plateIron, Item.plateDiamond, Item.plateGold}, {Item.legsLeather, Item.legsChain, Item.legsIron, Item.legsDiamond, Item.legsGold}, {Item.bootsLeather, Item.bootsChain, Item.bootsIron, Item.bootsDiamond, Item.bootsGold}}; ++ } ++ ++ /** ++ * Adds the armor recipes to the CraftingManager. ++ */ ++ public void addRecipes(CraftingManager par1CraftingManager) { ++ for (int var2 = 0; var2 < this.recipeItems[0].length; ++var2) { ++ Object var3 = this.recipeItems[0][var2]; ++ ++ for (int var4 = 0; var4 < this.recipeItems.length - 1; ++var4) { ++ Item var5 = (Item)this.recipeItems[var4 + 1][var2]; ++ par1CraftingManager.addRecipe(new ItemStack(var5), new Object[] {this.recipePatterns[var4], 'X', var3}); + } + } +- + } + } diff --git a/patches/net/minecraft/src/RecipesArmorDyes.java.patch b/patches/net/minecraft/src/RecipesArmorDyes.java.patch new file mode 100644 index 0000000..af0ea17 --- /dev/null +++ b/patches/net/minecraft/src/RecipesArmorDyes.java.patch @@ -0,0 +1,131 @@ +--- net/minecraft/src/RecipesArmorDyes.java ++++ net/minecraft/src/RecipesArmorDyes.java +@@ -2,23 +2,31 @@ + + import java.util.ArrayList; + ++import com.prupe.mcpatcher.cc.ColorizeEntity; ++ + public class RecipesArmorDyes implements IRecipe { +- public boolean matches(InventoryCrafting var1, World var2) { ++ ++ /** ++ * Used to check if a recipe matches current crafting inventory ++ */ ++ public boolean matches(InventoryCrafting par1InventoryCrafting, World par2World) { + ItemStack var3 = null; + ArrayList var4 = new ArrayList(); + +- for(int var5 = 0; var5 < var1.getSizeInventory(); ++var5) { +- ItemStack var6 = var1.getStackInSlot(var5); +- if(var6 != null) { +- if(var6.getItem() instanceof ItemArmor) { ++ for (int var5 = 0; var5 < par1InventoryCrafting.getSizeInventory(); ++var5) { ++ ItemStack var6 = par1InventoryCrafting.getStackInSlot(var5); ++ ++ if (var6 != null) { ++ if (var6.getItem() instanceof ItemArmor) { + ItemArmor var7 = (ItemArmor)var6.getItem(); +- if(var7.getArmorMaterial() != EnumArmorMaterial.CLOTH || var3 != null) { ++ ++ if (var7.getArmorMaterial() != EnumArmorMaterial.CLOTH || var3 != null) { + return false; + } + + var3 = var6; + } else { +- if(var6.itemID != Item.dyePowder.itemID) { ++ if (var6.itemID != Item.dyePowder.itemID) { + return false; + } + +@@ -30,30 +38,36 @@ + return var3 != null && !var4.isEmpty(); + } + +- public ItemStack getCraftingResult(InventoryCrafting var1) { ++ /** ++ * Returns an Item that is the result of this recipe ++ */ ++ public ItemStack getCraftingResult(InventoryCrafting par1InventoryCrafting) { + ItemStack var2 = null; + int[] var3 = new int[3]; + int var4 = 0; + int var5 = 0; + ItemArmor var6 = null; +- + int var7; + int var9; + float var10; + float var11; + int var17; +- for(var7 = 0; var7 < var1.getSizeInventory(); ++var7) { +- ItemStack var8 = var1.getStackInSlot(var7); +- if(var8 != null) { +- if(var8.getItem() instanceof ItemArmor) { ++ ++ for (var7 = 0; var7 < par1InventoryCrafting.getSizeInventory(); ++var7) { ++ ItemStack var8 = par1InventoryCrafting.getStackInSlot(var7); ++ ++ if (var8 != null) { ++ if (var8.getItem() instanceof ItemArmor) { + var6 = (ItemArmor)var8.getItem(); +- if(var6.getArmorMaterial() != EnumArmorMaterial.CLOTH || var2 != null) { ++ ++ if (var6.getArmorMaterial() != EnumArmorMaterial.CLOTH || var2 != null) { + return null; + } + + var2 = var8.copy(); + var2.stackSize = 1; +- if(var6.hasColor(var8)) { ++ ++ if (var6.hasColor(var8)) { + var9 = var6.getColor(var2); + var10 = (float)(var9 >> 16 & 255) / 255.0F; + var11 = (float)(var9 >> 8 & 255) / 255.0F; +@@ -65,24 +79,26 @@ + ++var5; + } + } else { +- if(var8.itemID != Item.dyePowder.itemID) { ++ if (var8.itemID != Item.dyePowder.itemID) { + return null; + } + +- float[] var14 = EntitySheep.fleeceColorTable[BlockColored.getBlockFromDye(var8.getItemDamage())]; +- int var15 = (int)(var14[0] * 255.0F); +- int var16 = (int)(var14[1] * 255.0F); ++ // MCPatcher Start ++ float[] var14 = ColorizeEntity.armorColors[BlockColored.getBlockFromDye(var8.getItemDamage())]; ++ // MCPatcher End ++ int var16 = (int)(var14[0] * 255.0F); ++ int var15 = (int)(var14[1] * 255.0F); + var17 = (int)(var14[2] * 255.0F); +- var4 += Math.max(var15, Math.max(var16, var17)); +- var3[0] += var15; +- var3[1] += var16; ++ var4 += Math.max(var16, Math.max(var15, var17)); ++ var3[0] += var16; ++ var3[1] += var15; + var3[2] += var17; + ++var5; + } + } + } + +- if(var6 == null) { ++ if (var6 == null) { + return null; + } else { + var7 = var3[0] / var5; +@@ -100,6 +116,9 @@ + } + } + ++ /** ++ * Returns the size of the recipe area ++ */ + public int getRecipeSize() { + return 10; + } diff --git a/patches/net/minecraft/src/RecipesCrafting.java.patch b/patches/net/minecraft/src/RecipesCrafting.java.patch new file mode 100644 index 0000000..1420168 --- /dev/null +++ b/patches/net/minecraft/src/RecipesCrafting.java.patch @@ -0,0 +1,46 @@ +--- net/minecraft/src/RecipesCrafting.java ++++ net/minecraft/src/RecipesCrafting.java +@@ -1,22 +1,26 @@ + package net.minecraft.src; + + public class RecipesCrafting { +- public void addRecipes(CraftingManager var1) { +- var1.addRecipe(new ItemStack(Block.chest), new Object[]{"###", "# #", "###", Character.valueOf('#'), Block.planks}); +- var1.addRecipe(new ItemStack(Block.chestTrapped), new Object[]{"#-", Character.valueOf('#'), Block.chest, Character.valueOf('-'), Block.tripWireSource}); +- var1.addRecipe(new ItemStack(Block.enderChest), new Object[]{"###", "#E#", "###", Character.valueOf('#'), Block.obsidian, Character.valueOf('E'), Item.eyeOfEnder}); +- var1.addRecipe(new ItemStack(Block.furnaceIdle), new Object[]{"###", "# #", "###", Character.valueOf('#'), Block.cobblestone}); +- var1.addRecipe(new ItemStack(Block.workbench), new Object[]{"##", "##", Character.valueOf('#'), Block.planks}); +- var1.addRecipe(new ItemStack(Block.sandStone), new Object[]{"##", "##", Character.valueOf('#'), Block.sand}); +- var1.addRecipe(new ItemStack(Block.sandStone, 4, 2), new Object[]{"##", "##", Character.valueOf('#'), Block.sandStone}); +- var1.addRecipe(new ItemStack(Block.sandStone, 1, 1), new Object[]{"#", "#", Character.valueOf('#'), new ItemStack(Block.stoneSingleSlab, 1, 1)}); +- var1.addRecipe(new ItemStack(Block.blockNetherQuartz, 1, 1), new Object[]{"#", "#", Character.valueOf('#'), new ItemStack(Block.stoneSingleSlab, 1, 7)}); +- var1.addRecipe(new ItemStack(Block.blockNetherQuartz, 2, 2), new Object[]{"#", "#", Character.valueOf('#'), new ItemStack(Block.blockNetherQuartz, 1, 0)}); +- var1.addRecipe(new ItemStack(Block.stoneBrick, 4), new Object[]{"##", "##", Character.valueOf('#'), Block.stone}); +- var1.addRecipe(new ItemStack(Block.fenceIron, 16), new Object[]{"###", "###", Character.valueOf('#'), Item.ingotIron}); +- var1.addRecipe(new ItemStack(Block.thinGlass, 16), new Object[]{"###", "###", Character.valueOf('#'), Block.glass}); +- var1.addRecipe(new ItemStack(Block.redstoneLampIdle, 1), new Object[]{" R ", "RGR", " R ", Character.valueOf('R'), Item.redstone, Character.valueOf('G'), Block.glowStone}); +- var1.addRecipe(new ItemStack(Block.beacon, 1), new Object[]{"GGG", "GSG", "OOO", Character.valueOf('G'), Block.glass, Character.valueOf('S'), Item.netherStar, Character.valueOf('O'), Block.obsidian}); +- var1.addRecipe(new ItemStack(Block.netherBrick, 1), new Object[]{"NN", "NN", Character.valueOf('N'), Item.netherrackBrick}); ++ ++ /** ++ * Adds the crafting recipes to the CraftingManager. ++ */ ++ public void addRecipes(CraftingManager par1CraftingManager) { ++ par1CraftingManager.addRecipe(new ItemStack(Block.chest), new Object[] {"###", "# #", "###", '#', Block.planks}); ++ par1CraftingManager.addRecipe(new ItemStack(Block.chestTrapped), new Object[] {"#-", '#', Block.chest, '-', Block.tripWireSource}); ++ par1CraftingManager.addRecipe(new ItemStack(Block.enderChest), new Object[] {"###", "#E#", "###", '#', Block.obsidian, 'E', Item.eyeOfEnder}); ++ par1CraftingManager.addRecipe(new ItemStack(Block.furnaceIdle), new Object[] {"###", "# #", "###", '#', Block.cobblestone}); ++ par1CraftingManager.addRecipe(new ItemStack(Block.workbench), new Object[] {"##", "##", '#', Block.planks}); ++ par1CraftingManager.addRecipe(new ItemStack(Block.sandStone), new Object[] {"##", "##", '#', Block.sand}); ++ par1CraftingManager.addRecipe(new ItemStack(Block.sandStone, 4, 2), new Object[] {"##", "##", '#', Block.sandStone}); ++ par1CraftingManager.addRecipe(new ItemStack(Block.sandStone, 1, 1), new Object[] {"#", "#", '#', new ItemStack(Block.stoneSingleSlab, 1, 1)}); ++ par1CraftingManager.addRecipe(new ItemStack(Block.blockNetherQuartz, 1, 1), new Object[] {"#", "#", '#', new ItemStack(Block.stoneSingleSlab, 1, 7)}); ++ par1CraftingManager.addRecipe(new ItemStack(Block.blockNetherQuartz, 2, 2), new Object[] {"#", "#", '#', new ItemStack(Block.blockNetherQuartz, 1, 0)}); ++ par1CraftingManager.addRecipe(new ItemStack(Block.stoneBrick, 4), new Object[] {"##", "##", '#', Block.stone}); ++ par1CraftingManager.addRecipe(new ItemStack(Block.fenceIron, 16), new Object[] {"###", "###", '#', Item.ingotIron}); ++ par1CraftingManager.addRecipe(new ItemStack(Block.thinGlass, 16), new Object[] {"###", "###", '#', Block.glass}); ++ par1CraftingManager.addRecipe(new ItemStack(Block.redstoneLampIdle, 1), new Object[] {" R ", "RGR", " R ", 'R', Item.redstone, 'G', Block.glowStone}); ++ par1CraftingManager.addRecipe(new ItemStack(Block.beacon, 1), new Object[] {"GGG", "GSG", "OOO", 'G', Block.glass, 'S', Item.netherStar, 'O', Block.obsidian}); ++ par1CraftingManager.addRecipe(new ItemStack(Block.netherBrick, 1), new Object[] {"NN", "NN", 'N', Item.netherrackBrick}); + } + } diff --git a/patches/net/minecraft/src/RecipesDyes.java.patch b/patches/net/minecraft/src/RecipesDyes.java.patch new file mode 100644 index 0000000..c572961 --- /dev/null +++ b/patches/net/minecraft/src/RecipesDyes.java.patch @@ -0,0 +1,65 @@ +--- net/minecraft/src/RecipesDyes.java ++++ net/minecraft/src/RecipesDyes.java +@@ -1,32 +1,36 @@ + package net.minecraft.src; + + public class RecipesDyes { +- public void addRecipes(CraftingManager var1) { ++ ++ /** ++ * Adds the dye recipes to the CraftingManager. ++ */ ++ public void addRecipes(CraftingManager par1CraftingManager) { + int var2; +- for(var2 = 0; var2 < 16; ++var2) { +- var1.addShapelessRecipe(new ItemStack(Block.cloth, 1, BlockColored.getDyeFromBlock(var2)), new Object[]{new ItemStack(Item.dyePowder, 1, var2), new ItemStack(Item.itemsList[Block.cloth.blockID], 1, 0)}); +- var1.addRecipe(new ItemStack(Block.stainedClay, 8, BlockColored.getDyeFromBlock(var2)), new Object[]{"###", "#X#", "###", Character.valueOf('#'), new ItemStack(Block.hardenedClay), Character.valueOf('X'), new ItemStack(Item.dyePowder, 1, var2)}); +- } +- +- var1.addShapelessRecipe(new ItemStack(Item.dyePowder, 2, 11), new Object[]{Block.plantYellow}); +- var1.addShapelessRecipe(new ItemStack(Item.dyePowder, 2, 1), new Object[]{Block.plantRed}); +- var1.addShapelessRecipe(new ItemStack(Item.dyePowder, 3, 15), new Object[]{Item.bone}); +- var1.addShapelessRecipe(new ItemStack(Item.dyePowder, 2, 9), new Object[]{new ItemStack(Item.dyePowder, 1, 1), new ItemStack(Item.dyePowder, 1, 15)}); +- var1.addShapelessRecipe(new ItemStack(Item.dyePowder, 2, 14), new Object[]{new ItemStack(Item.dyePowder, 1, 1), new ItemStack(Item.dyePowder, 1, 11)}); +- var1.addShapelessRecipe(new ItemStack(Item.dyePowder, 2, 10), new Object[]{new ItemStack(Item.dyePowder, 1, 2), new ItemStack(Item.dyePowder, 1, 15)}); +- var1.addShapelessRecipe(new ItemStack(Item.dyePowder, 2, 8), new Object[]{new ItemStack(Item.dyePowder, 1, 0), new ItemStack(Item.dyePowder, 1, 15)}); +- var1.addShapelessRecipe(new ItemStack(Item.dyePowder, 2, 7), new Object[]{new ItemStack(Item.dyePowder, 1, 8), new ItemStack(Item.dyePowder, 1, 15)}); +- var1.addShapelessRecipe(new ItemStack(Item.dyePowder, 3, 7), new Object[]{new ItemStack(Item.dyePowder, 1, 0), new ItemStack(Item.dyePowder, 1, 15), new ItemStack(Item.dyePowder, 1, 15)}); +- var1.addShapelessRecipe(new ItemStack(Item.dyePowder, 2, 12), new Object[]{new ItemStack(Item.dyePowder, 1, 4), new ItemStack(Item.dyePowder, 1, 15)}); +- var1.addShapelessRecipe(new ItemStack(Item.dyePowder, 2, 6), new Object[]{new ItemStack(Item.dyePowder, 1, 4), new ItemStack(Item.dyePowder, 1, 2)}); +- var1.addShapelessRecipe(new ItemStack(Item.dyePowder, 2, 5), new Object[]{new ItemStack(Item.dyePowder, 1, 4), new ItemStack(Item.dyePowder, 1, 1)}); +- var1.addShapelessRecipe(new ItemStack(Item.dyePowder, 2, 13), new Object[]{new ItemStack(Item.dyePowder, 1, 5), new ItemStack(Item.dyePowder, 1, 9)}); +- var1.addShapelessRecipe(new ItemStack(Item.dyePowder, 3, 13), new Object[]{new ItemStack(Item.dyePowder, 1, 4), new ItemStack(Item.dyePowder, 1, 1), new ItemStack(Item.dyePowder, 1, 9)}); +- var1.addShapelessRecipe(new ItemStack(Item.dyePowder, 4, 13), new Object[]{new ItemStack(Item.dyePowder, 1, 4), new ItemStack(Item.dyePowder, 1, 1), new ItemStack(Item.dyePowder, 1, 1), new ItemStack(Item.dyePowder, 1, 15)}); +- +- for(var2 = 0; var2 < 16; ++var2) { +- var1.addRecipe(new ItemStack(Block.carpet, 3, var2), new Object[]{"##", Character.valueOf('#'), new ItemStack(Block.cloth, 1, var2)}); +- } +- ++ ++ for (var2 = 0; var2 < 16; ++var2) { ++ par1CraftingManager.addShapelessRecipe(new ItemStack(Block.cloth, 1, BlockColored.getDyeFromBlock(var2)), new Object[] {new ItemStack(Item.dyePowder, 1, var2), new ItemStack(Item.itemsList[Block.cloth.blockID], 1, 0)}); ++ par1CraftingManager.addRecipe(new ItemStack(Block.stainedClay, 8, BlockColored.getDyeFromBlock(var2)), new Object[] {"###", "#X#", "###", '#', new ItemStack(Block.hardenedClay), 'X', new ItemStack(Item.dyePowder, 1, var2)}); ++ } ++ ++ par1CraftingManager.addShapelessRecipe(new ItemStack(Item.dyePowder, 2, 11), new Object[] {Block.plantYellow}); ++ par1CraftingManager.addShapelessRecipe(new ItemStack(Item.dyePowder, 2, 1), new Object[] {Block.plantRed}); ++ par1CraftingManager.addShapelessRecipe(new ItemStack(Item.dyePowder, 3, 15), new Object[] {Item.bone}); ++ par1CraftingManager.addShapelessRecipe(new ItemStack(Item.dyePowder, 2, 9), new Object[] {new ItemStack(Item.dyePowder, 1, 1), new ItemStack(Item.dyePowder, 1, 15)}); ++ par1CraftingManager.addShapelessRecipe(new ItemStack(Item.dyePowder, 2, 14), new Object[] {new ItemStack(Item.dyePowder, 1, 1), new ItemStack(Item.dyePowder, 1, 11)}); ++ par1CraftingManager.addShapelessRecipe(new ItemStack(Item.dyePowder, 2, 10), new Object[] {new ItemStack(Item.dyePowder, 1, 2), new ItemStack(Item.dyePowder, 1, 15)}); ++ par1CraftingManager.addShapelessRecipe(new ItemStack(Item.dyePowder, 2, 8), new Object[] {new ItemStack(Item.dyePowder, 1, 0), new ItemStack(Item.dyePowder, 1, 15)}); ++ par1CraftingManager.addShapelessRecipe(new ItemStack(Item.dyePowder, 2, 7), new Object[] {new ItemStack(Item.dyePowder, 1, 8), new ItemStack(Item.dyePowder, 1, 15)}); ++ par1CraftingManager.addShapelessRecipe(new ItemStack(Item.dyePowder, 3, 7), new Object[] {new ItemStack(Item.dyePowder, 1, 0), new ItemStack(Item.dyePowder, 1, 15), new ItemStack(Item.dyePowder, 1, 15)}); ++ par1CraftingManager.addShapelessRecipe(new ItemStack(Item.dyePowder, 2, 12), new Object[] {new ItemStack(Item.dyePowder, 1, 4), new ItemStack(Item.dyePowder, 1, 15)}); ++ par1CraftingManager.addShapelessRecipe(new ItemStack(Item.dyePowder, 2, 6), new Object[] {new ItemStack(Item.dyePowder, 1, 4), new ItemStack(Item.dyePowder, 1, 2)}); ++ par1CraftingManager.addShapelessRecipe(new ItemStack(Item.dyePowder, 2, 5), new Object[] {new ItemStack(Item.dyePowder, 1, 4), new ItemStack(Item.dyePowder, 1, 1)}); ++ par1CraftingManager.addShapelessRecipe(new ItemStack(Item.dyePowder, 2, 13), new Object[] {new ItemStack(Item.dyePowder, 1, 5), new ItemStack(Item.dyePowder, 1, 9)}); ++ par1CraftingManager.addShapelessRecipe(new ItemStack(Item.dyePowder, 3, 13), new Object[] {new ItemStack(Item.dyePowder, 1, 4), new ItemStack(Item.dyePowder, 1, 1), new ItemStack(Item.dyePowder, 1, 9)}); ++ par1CraftingManager.addShapelessRecipe(new ItemStack(Item.dyePowder, 4, 13), new Object[] {new ItemStack(Item.dyePowder, 1, 4), new ItemStack(Item.dyePowder, 1, 1), new ItemStack(Item.dyePowder, 1, 1), new ItemStack(Item.dyePowder, 1, 15)}); ++ ++ for (var2 = 0; var2 < 16; ++var2) { ++ par1CraftingManager.addRecipe(new ItemStack(Block.carpet, 3, var2), new Object[] {"##", '#', new ItemStack(Block.cloth, 1, var2)}); ++ } + } + } diff --git a/patches/net/minecraft/src/RecipesFood.java.patch b/patches/net/minecraft/src/RecipesFood.java.patch new file mode 100644 index 0000000..59f9def --- /dev/null +++ b/patches/net/minecraft/src/RecipesFood.java.patch @@ -0,0 +1,32 @@ +--- net/minecraft/src/RecipesFood.java ++++ net/minecraft/src/RecipesFood.java +@@ -1,15 +1,19 @@ + package net.minecraft.src; + + public class RecipesFood { +- public void addRecipes(CraftingManager var1) { +- var1.addShapelessRecipe(new ItemStack(Item.bowlSoup), new Object[]{Block.mushroomBrown, Block.mushroomRed, Item.bowlEmpty}); +- var1.addRecipe(new ItemStack(Item.cookie, 8), new Object[]{"#X#", Character.valueOf('X'), new ItemStack(Item.dyePowder, 1, 3), Character.valueOf('#'), Item.wheat}); +- var1.addRecipe(new ItemStack(Block.melon), new Object[]{"MMM", "MMM", "MMM", Character.valueOf('M'), Item.melon}); +- var1.addRecipe(new ItemStack(Item.melonSeeds), new Object[]{"M", Character.valueOf('M'), Item.melon}); +- var1.addRecipe(new ItemStack(Item.pumpkinSeeds, 4), new Object[]{"M", Character.valueOf('M'), Block.pumpkin}); +- var1.addShapelessRecipe(new ItemStack(Item.pumpkinPie), new Object[]{Block.pumpkin, Item.sugar, Item.egg}); +- var1.addShapelessRecipe(new ItemStack(Item.fermentedSpiderEye), new Object[]{Item.spiderEye, Block.mushroomBrown, Item.sugar}); +- var1.addShapelessRecipe(new ItemStack(Item.blazePowder, 2), new Object[]{Item.blazeRod}); +- var1.addShapelessRecipe(new ItemStack(Item.magmaCream), new Object[]{Item.blazePowder, Item.slimeBall}); ++ ++ /** ++ * Adds the food recipes to the CraftingManager. ++ */ ++ public void addRecipes(CraftingManager par1CraftingManager) { ++ par1CraftingManager.addShapelessRecipe(new ItemStack(Item.bowlSoup), new Object[] {Block.mushroomBrown, Block.mushroomRed, Item.bowlEmpty}); ++ par1CraftingManager.addRecipe(new ItemStack(Item.cookie, 8), new Object[] {"#X#", 'X', new ItemStack(Item.dyePowder, 1, 3), '#', Item.wheat}); ++ par1CraftingManager.addRecipe(new ItemStack(Block.melon), new Object[] {"MMM", "MMM", "MMM", 'M', Item.melon}); ++ par1CraftingManager.addRecipe(new ItemStack(Item.melonSeeds), new Object[] {"M", 'M', Item.melon}); ++ par1CraftingManager.addRecipe(new ItemStack(Item.pumpkinSeeds, 4), new Object[] {"M", 'M', Block.pumpkin}); ++ par1CraftingManager.addShapelessRecipe(new ItemStack(Item.pumpkinPie), new Object[] {Block.pumpkin, Item.sugar, Item.egg}); ++ par1CraftingManager.addShapelessRecipe(new ItemStack(Item.fermentedSpiderEye), new Object[] {Item.spiderEye, Block.mushroomBrown, Item.sugar}); ++ par1CraftingManager.addShapelessRecipe(new ItemStack(Item.blazePowder, 2), new Object[] {Item.blazeRod}); ++ par1CraftingManager.addShapelessRecipe(new ItemStack(Item.magmaCream), new Object[] {Item.blazePowder, Item.slimeBall}); + } + } diff --git a/patches/net/minecraft/src/RecipesIngots.java.patch b/patches/net/minecraft/src/RecipesIngots.java.patch new file mode 100644 index 0000000..881d49c --- /dev/null +++ b/patches/net/minecraft/src/RecipesIngots.java.patch @@ -0,0 +1,37 @@ +--- net/minecraft/src/RecipesIngots.java ++++ net/minecraft/src/RecipesIngots.java +@@ -1,17 +1,24 @@ + package net.minecraft.src; + + public class RecipesIngots { +- private Object[][] a = new Object[][]{{Block.blockGold, new ItemStack(Item.ingotGold, 9)}, {Block.blockIron, new ItemStack(Item.ingotIron, 9)}, {Block.blockDiamond, new ItemStack(Item.diamond, 9)}, {Block.blockEmerald, new ItemStack(Item.emerald, 9)}, {Block.blockLapis, new ItemStack(Item.dyePowder, 9, 4)}, {Block.blockRedstone, new ItemStack(Item.redstone, 9)}, {Block.coalBlock, new ItemStack(Item.coal, 9, 0)}, {Block.hay, new ItemStack(Item.wheat, 9)}}; +- +- public void addRecipes(CraftingManager var1) { +- for(int var2 = 0; var2 < this.a.length; ++var2) { +- Block var3 = (Block)this.a[var2][0]; +- ItemStack var4 = (ItemStack)this.a[var2][1]; +- var1.addRecipe(new ItemStack(var3), new Object[]{"###", "###", "###", Character.valueOf('#'), var4}); +- var1.addRecipe(var4, new Object[]{"#", Character.valueOf('#'), var3}); ++ private Object[][] recipeItems; ++ ++ public RecipesIngots() { ++ this.recipeItems = new Object[][] {{Block.blockGold, new ItemStack(Item.ingotGold, 9)}, {Block.blockIron, new ItemStack(Item.ingotIron, 9)}, {Block.blockDiamond, new ItemStack(Item.diamond, 9)}, {Block.blockEmerald, new ItemStack(Item.emerald, 9)}, {Block.blockLapis, new ItemStack(Item.dyePowder, 9, 4)}, {Block.blockRedstone, new ItemStack(Item.redstone, 9)}, {Block.coalBlock, new ItemStack(Item.coal, 9, 0)}, {Block.hay, new ItemStack(Item.wheat, 9)}}; ++ } ++ ++ /** ++ * Adds the ingot recipes to the CraftingManager. ++ */ ++ public void addRecipes(CraftingManager par1CraftingManager) { ++ for (int var2 = 0; var2 < this.recipeItems.length; ++var2) { ++ Block var3 = (Block)this.recipeItems[var2][0]; ++ ItemStack var4 = (ItemStack)this.recipeItems[var2][1]; ++ par1CraftingManager.addRecipe(new ItemStack(var3), new Object[] {"###", "###", "###", '#', var4}); ++ par1CraftingManager.addRecipe(var4, new Object[] {"#", '#', var3}); + } + +- var1.addRecipe(new ItemStack(Item.ingotGold), new Object[]{"###", "###", "###", Character.valueOf('#'), Item.goldNugget}); +- var1.addRecipe(new ItemStack(Item.goldNugget, 9), new Object[]{"#", Character.valueOf('#'), Item.ingotGold}); ++ par1CraftingManager.addRecipe(new ItemStack(Item.ingotGold), new Object[] {"###", "###", "###", '#', Item.goldNugget}); ++ par1CraftingManager.addRecipe(new ItemStack(Item.goldNugget, 9), new Object[] {"#", '#', Item.ingotGold}); + } + } diff --git a/patches/net/minecraft/src/RecipesMapCloning.java.patch b/patches/net/minecraft/src/RecipesMapCloning.java.patch new file mode 100644 index 0000000..65b6d6e --- /dev/null +++ b/patches/net/minecraft/src/RecipesMapCloning.java.patch @@ -0,0 +1,92 @@ +--- net/minecraft/src/RecipesMapCloning.java ++++ net/minecraft/src/RecipesMapCloning.java +@@ -1,21 +1,26 @@ + package net.minecraft.src; + + public class RecipesMapCloning implements IRecipe { +- public boolean matches(InventoryCrafting var1, World var2) { ++ ++ /** ++ * Used to check if a recipe matches current crafting inventory ++ */ ++ public boolean matches(InventoryCrafting par1InventoryCrafting, World par2World) { + int var3 = 0; + ItemStack var4 = null; + +- for(int var5 = 0; var5 < var1.getSizeInventory(); ++var5) { +- ItemStack var6 = var1.getStackInSlot(var5); +- if(var6 != null) { +- if(var6.itemID == Item.map.itemID) { +- if(var4 != null) { ++ for (int var5 = 0; var5 < par1InventoryCrafting.getSizeInventory(); ++var5) { ++ ItemStack var6 = par1InventoryCrafting.getStackInSlot(var5); ++ ++ if (var6 != null) { ++ if (var6.itemID == Item.map.itemID) { ++ if (var4 != null) { + return false; + } + + var4 = var6; + } else { +- if(var6.itemID != Item.emptyMap.itemID) { ++ if (var6.itemID != Item.emptyMap.itemID) { + return false; + } + +@@ -27,21 +32,25 @@ + return var4 != null && var3 > 0; + } + +- public ItemStack getCraftingResult(InventoryCrafting var1) { ++ /** ++ * Returns an Item that is the result of this recipe ++ */ ++ public ItemStack getCraftingResult(InventoryCrafting par1InventoryCrafting) { + int var2 = 0; + ItemStack var3 = null; + +- for(int var4 = 0; var4 < var1.getSizeInventory(); ++var4) { +- ItemStack var5 = var1.getStackInSlot(var4); +- if(var5 != null) { +- if(var5.itemID == Item.map.itemID) { +- if(var3 != null) { ++ for (int var4 = 0; var4 < par1InventoryCrafting.getSizeInventory(); ++var4) { ++ ItemStack var5 = par1InventoryCrafting.getStackInSlot(var4); ++ ++ if (var5 != null) { ++ if (var5.itemID == Item.map.itemID) { ++ if (var3 != null) { + return null; + } + + var3 = var5; + } else { +- if(var5.itemID != Item.emptyMap.itemID) { ++ if (var5.itemID != Item.emptyMap.itemID) { + return null; + } + +@@ -50,9 +59,10 @@ + } + } + +- if(var3 != null && var2 >= 1) { ++ if (var3 != null && var2 >= 1) { + ItemStack var6 = new ItemStack(Item.map, var2 + 1, var3.getItemDamage()); +- if(var3.hasDisplayName()) { ++ ++ if (var3.hasDisplayName()) { + var6.setItemName(var3.getDisplayName()); + } + +@@ -62,6 +72,9 @@ + } + } + ++ /** ++ * Returns the size of the recipe area ++ */ + public int getRecipeSize() { + return 9; + } diff --git a/patches/net/minecraft/src/RecipesMapExtending.java.patch b/patches/net/minecraft/src/RecipesMapExtending.java.patch new file mode 100644 index 0000000..fcab583 --- /dev/null +++ b/patches/net/minecraft/src/RecipesMapExtending.java.patch @@ -0,0 +1,69 @@ +--- net/minecraft/src/RecipesMapExtending.java ++++ net/minecraft/src/RecipesMapExtending.java +@@ -2,44 +2,53 @@ + + public class RecipesMapExtending extends ShapedRecipes { + public RecipesMapExtending() { +- super(3, 3, new ItemStack[]{new ItemStack(Item.paper), new ItemStack(Item.paper), new ItemStack(Item.paper), new ItemStack(Item.paper), new ItemStack(Item.map, 0, Short.MAX_VALUE), new ItemStack(Item.paper), new ItemStack(Item.paper), new ItemStack(Item.paper), new ItemStack(Item.paper)}, new ItemStack(Item.emptyMap, 0, 0)); ++ super(3, 3, new ItemStack[] {new ItemStack(Item.paper), new ItemStack(Item.paper), new ItemStack(Item.paper), new ItemStack(Item.paper), new ItemStack(Item.map, 0, 32767), new ItemStack(Item.paper), new ItemStack(Item.paper), new ItemStack(Item.paper), new ItemStack(Item.paper)}, new ItemStack(Item.emptyMap, 0, 0)); + } + +- public boolean matches(InventoryCrafting var1, World var2) { +- if(!super.matches(var1, var2)) { ++ /** ++ * Used to check if a recipe matches current crafting inventory ++ */ ++ public boolean matches(InventoryCrafting par1InventoryCrafting, World par2World) { ++ if (!super.matches(par1InventoryCrafting, par2World)) { + return false; + } else { + ItemStack var3 = null; + +- for(int var4 = 0; var4 < var1.getSizeInventory() && var3 == null; ++var4) { +- ItemStack var5 = var1.getStackInSlot(var4); +- if(var5 != null && var5.itemID == Item.map.itemID) { ++ for (int var4 = 0; var4 < par1InventoryCrafting.getSizeInventory() && var3 == null; ++var4) { ++ ItemStack var5 = par1InventoryCrafting.getStackInSlot(var4); ++ ++ if (var5 != null && var5.itemID == Item.map.itemID) { + var3 = var5; + } + } + +- if(var3 == null) { ++ if (var3 == null) { + return false; + } else { +- MapData var6 = Item.map.getMapData(var3, var2); ++ MapData var6 = Item.map.getMapData(var3, par2World); + return var6 == null ? false : var6.scale < 4; + } + } + } + +- public ItemStack getCraftingResult(InventoryCrafting var1) { ++ /** ++ * Returns an Item that is the result of this recipe ++ */ ++ public ItemStack getCraftingResult(InventoryCrafting par1InventoryCrafting) { + ItemStack var2 = null; + +- for(int var3 = 0; var3 < var1.getSizeInventory() && var2 == null; ++var3) { +- ItemStack var4 = var1.getStackInSlot(var3); +- if(var4 != null && var4.itemID == Item.map.itemID) { ++ for (int var3 = 0; var3 < par1InventoryCrafting.getSizeInventory() && var2 == null; ++var3) { ++ ItemStack var4 = par1InventoryCrafting.getStackInSlot(var3); ++ ++ if (var4 != null && var4.itemID == Item.map.itemID) { + var2 = var4; + } + } + + var2 = var2.copy(); + var2.stackSize = 1; +- if(var2.getTagCompound() == null) { ++ ++ if (var2.getTagCompound() == null) { + var2.setTagCompound(new NBTTagCompound()); + } + diff --git a/patches/net/minecraft/src/RecipesTools.java.patch b/patches/net/minecraft/src/RecipesTools.java.patch new file mode 100644 index 0000000..c523d54 --- /dev/null +++ b/patches/net/minecraft/src/RecipesTools.java.patch @@ -0,0 +1,40 @@ +--- net/minecraft/src/RecipesTools.java ++++ net/minecraft/src/RecipesTools.java +@@ -1,19 +1,26 @@ + package net.minecraft.src; + + public class RecipesTools { +- private String[][] a = new String[][]{{"XXX", " # ", " # "}, {"X", "#", "#"}, {"XX", "X#", " #"}, {"XX", " #", " #"}}; +- private Object[][] b = new Object[][]{{Block.planks, Block.cobblestone, Item.ingotIron, Item.diamond, Item.ingotGold}, {Item.pickaxeWood, Item.pickaxeStone, Item.pickaxeIron, Item.pickaxeDiamond, Item.pickaxeGold}, {Item.shovelWood, Item.shovelStone, Item.shovelIron, Item.shovelDiamond, Item.shovelGold}, {Item.axeWood, Item.axeStone, Item.axeIron, Item.axeDiamond, Item.axeGold}, {Item.hoeWood, Item.hoeStone, Item.hoeIron, Item.hoeDiamond, Item.hoeGold}}; +- +- public void addRecipes(CraftingManager var1) { +- for(int var2 = 0; var2 < this.b[0].length; ++var2) { +- Object var3 = this.b[0][var2]; +- +- for(int var4 = 0; var4 < this.b.length - 1; ++var4) { +- Item var5 = (Item)this.b[var4 + 1][var2]; +- var1.addRecipe(new ItemStack(var5), new Object[]{this.a[var4], Character.valueOf('#'), Item.stick, Character.valueOf('X'), var3}); ++ private String[][] recipePatterns = new String[][] {{"XXX", " # ", " # "}, {"X", "#", "#"}, {"XX", "X#", " #"}, {"XX", " #", " #"}}; ++ private Object[][] recipeItems; ++ ++ public RecipesTools() { ++ this.recipeItems = new Object[][] {{Block.planks, Block.cobblestone, Item.ingotIron, Item.diamond, Item.ingotGold}, {Item.pickaxeWood, Item.pickaxeStone, Item.pickaxeIron, Item.pickaxeDiamond, Item.pickaxeGold}, {Item.shovelWood, Item.shovelStone, Item.shovelIron, Item.shovelDiamond, Item.shovelGold}, {Item.axeWood, Item.axeStone, Item.axeIron, Item.axeDiamond, Item.axeGold}, {Item.hoeWood, Item.hoeStone, Item.hoeIron, Item.hoeDiamond, Item.hoeGold}}; ++ } ++ ++ /** ++ * Adds the tool recipes to the CraftingManager. ++ */ ++ public void addRecipes(CraftingManager par1CraftingManager) { ++ for (int var2 = 0; var2 < this.recipeItems[0].length; ++var2) { ++ Object var3 = this.recipeItems[0][var2]; ++ ++ for (int var4 = 0; var4 < this.recipeItems.length - 1; ++var4) { ++ Item var5 = (Item)this.recipeItems[var4 + 1][var2]; ++ par1CraftingManager.addRecipe(new ItemStack(var5), new Object[] {this.recipePatterns[var4], '#', Item.stick, 'X', var3}); + } + } + +- var1.addRecipe(new ItemStack(Item.shears), new Object[]{" #", "# ", Character.valueOf('#'), Item.ingotIron}); ++ par1CraftingManager.addRecipe(new ItemStack(Item.shears), new Object[] {" #", "# ", '#', Item.ingotIron}); + } + } diff --git a/patches/net/minecraft/src/RecipesWeapons.java.patch b/patches/net/minecraft/src/RecipesWeapons.java.patch new file mode 100644 index 0000000..0c21682 --- /dev/null +++ b/patches/net/minecraft/src/RecipesWeapons.java.patch @@ -0,0 +1,42 @@ +--- net/minecraft/src/RecipesWeapons.java ++++ net/minecraft/src/RecipesWeapons.java +@@ -1,20 +1,27 @@ + package net.minecraft.src; + + public class RecipesWeapons { +- private String[][] a = new String[][]{{"X", "X", "#"}}; +- private Object[][] b = new Object[][]{{Block.planks, Block.cobblestone, Item.ingotIron, Item.diamond, Item.ingotGold}, {Item.swordWood, Item.swordStone, Item.swordIron, Item.swordDiamond, Item.swordGold}}; +- +- public void addRecipes(CraftingManager var1) { +- for(int var2 = 0; var2 < this.b[0].length; ++var2) { +- Object var3 = this.b[0][var2]; +- +- for(int var4 = 0; var4 < this.b.length - 1; ++var4) { +- Item var5 = (Item)this.b[var4 + 1][var2]; +- var1.addRecipe(new ItemStack(var5), new Object[]{this.a[var4], Character.valueOf('#'), Item.stick, Character.valueOf('X'), var3}); ++ private String[][] recipePatterns = new String[][] {{"X", "X", "#"}}; ++ private Object[][] recipeItems; ++ ++ public RecipesWeapons() { ++ this.recipeItems = new Object[][] {{Block.planks, Block.cobblestone, Item.ingotIron, Item.diamond, Item.ingotGold}, {Item.swordWood, Item.swordStone, Item.swordIron, Item.swordDiamond, Item.swordGold}}; ++ } ++ ++ /** ++ * Adds the weapon recipes to the CraftingManager. ++ */ ++ public void addRecipes(CraftingManager par1CraftingManager) { ++ for (int var2 = 0; var2 < this.recipeItems[0].length; ++var2) { ++ Object var3 = this.recipeItems[0][var2]; ++ ++ for (int var4 = 0; var4 < this.recipeItems.length - 1; ++var4) { ++ Item var5 = (Item)this.recipeItems[var4 + 1][var2]; ++ par1CraftingManager.addRecipe(new ItemStack(var5), new Object[] {this.recipePatterns[var4], '#', Item.stick, 'X', var3}); + } + } + +- var1.addRecipe(new ItemStack(Item.bow, 1), new Object[]{" #X", "# X", " #X", Character.valueOf('X'), Item.silk, Character.valueOf('#'), Item.stick}); +- var1.addRecipe(new ItemStack(Item.arrow, 4), new Object[]{"X", "#", "Y", Character.valueOf('Y'), Item.feather, Character.valueOf('X'), Item.flint, Character.valueOf('#'), Item.stick}); ++ par1CraftingManager.addRecipe(new ItemStack(Item.bow, 1), new Object[] {" #X", "# X", " #X", 'X', Item.silk, '#', Item.stick}); ++ par1CraftingManager.addRecipe(new ItemStack(Item.arrow, 4), new Object[] {"X", "#", "Y", 'Y', Item.feather, 'X', Item.flint, '#', Item.stick}); + } + } diff --git a/patches/net/minecraft/src/RedstoneUpdateInfo.java.patch b/patches/net/minecraft/src/RedstoneUpdateInfo.java.patch new file mode 100644 index 0000000..8da0a2e --- /dev/null +++ b/patches/net/minecraft/src/RedstoneUpdateInfo.java.patch @@ -0,0 +1,18 @@ +--- net/minecraft/src/RedstoneUpdateInfo.java ++++ net/minecraft/src/RedstoneUpdateInfo.java +@@ -6,10 +6,10 @@ + int z; + long updateTime; + +- public RedstoneUpdateInfo(int var1, int var2, int var3, long var4) { +- this.x = var1; +- this.y = var2; +- this.z = var3; +- this.updateTime = var4; ++ public RedstoneUpdateInfo(int par1, int par2, int par3, long par4) { ++ this.x = par1; ++ this.y = par2; ++ this.z = par3; ++ this.updateTime = par4; + } + } diff --git a/patches/net/minecraft/src/RegionFile.java.patch b/patches/net/minecraft/src/RegionFile.java.patch new file mode 100644 index 0000000..abb3e1e --- /dev/null +++ b/patches/net/minecraft/src/RegionFile.java.patch @@ -0,0 +1,378 @@ +--- net/minecraft/src/RegionFile.java ++++ net/minecraft/src/RegionFile.java +@@ -15,106 +15,116 @@ + + public class RegionFile { + private static final byte[] emptySector = new byte[4096]; +- private final File b; +- private RandomAccessFile c; ++ private final File fileName; ++ private RandomAccessFile dataFile; + private final int[] offsets = new int[1024]; + private final int[] chunkTimestamps = new int[1024]; +- private ArrayList f; ++ private ArrayList sectorFree; ++ ++ /** McRegion sizeDelta */ + private int sizeDelta; + private long lastModified; + +- public RegionFile(File var1) { +- this.b = var1; ++ public RegionFile(File par1File) { ++ this.fileName = par1File; + this.sizeDelta = 0; + + try { +- if(var1.exists()) { +- this.lastModified = var1.lastModified(); ++ if (par1File.exists()) { ++ this.lastModified = par1File.lastModified(); + } + +- this.c = new RandomAccessFile(var1, "rw"); ++ this.dataFile = new RandomAccessFile(par1File, "rw"); + int var2; +- if(this.c.length() < 4096L) { +- for(var2 = 0; var2 < 1024; ++var2) { +- this.c.writeInt(0); ++ ++ if (this.dataFile.length() < 4096L) { ++ for (var2 = 0; var2 < 1024; ++var2) { ++ this.dataFile.writeInt(0); + } + +- for(var2 = 0; var2 < 1024; ++var2) { +- this.c.writeInt(0); ++ for (var2 = 0; var2 < 1024; ++var2) { ++ this.dataFile.writeInt(0); + } + + this.sizeDelta += 8192; + } + +- if((this.c.length() & 4095L) != 0L) { +- for(var2 = 0; (long)var2 < (this.c.length() & 4095L); ++var2) { +- this.c.write(0); ++ if ((this.dataFile.length() & 4095L) != 0L) { ++ for (var2 = 0; (long)var2 < (this.dataFile.length() & 4095L); ++var2) { ++ this.dataFile.write(0); + } + } + +- var2 = (int)this.c.length() / 4096; +- this.f = new ArrayList(var2); +- ++ var2 = (int)this.dataFile.length() / 4096; ++ this.sectorFree = new ArrayList(var2); + int var3; +- for(var3 = 0; var3 < var2; ++var3) { +- this.f.add(Boolean.valueOf(true)); ++ ++ for (var3 = 0; var3 < var2; ++var3) { ++ this.sectorFree.add(Boolean.valueOf(true)); + } + +- this.f.set(0, Boolean.valueOf(false)); +- this.f.set(1, Boolean.valueOf(false)); +- this.c.seek(0L); +- ++ this.sectorFree.set(0, Boolean.valueOf(false)); ++ this.sectorFree.set(1, Boolean.valueOf(false)); ++ this.dataFile.seek(0L); + int var4; +- for(var3 = 0; var3 < 1024; ++var3) { +- var4 = this.c.readInt(); ++ ++ for (var3 = 0; var3 < 1024; ++var3) { ++ var4 = this.dataFile.readInt(); + this.offsets[var3] = var4; +- if(var4 != 0 && (var4 >> 8) + (var4 & 255) <= this.f.size()) { +- for(int var5 = 0; var5 < (var4 & 255); ++var5) { +- this.f.set((var4 >> 8) + var5, Boolean.valueOf(false)); ++ ++ if (var4 != 0 && (var4 >> 8) + (var4 & 255) <= this.sectorFree.size()) { ++ for (int var5 = 0; var5 < (var4 & 255); ++var5) { ++ this.sectorFree.set((var4 >> 8) + var5, Boolean.valueOf(false)); + } + } + } + +- for(var3 = 0; var3 < 1024; ++var3) { +- var4 = this.c.readInt(); ++ for (var3 = 0; var3 < 1024; ++var3) { ++ var4 = this.dataFile.readInt(); + this.chunkTimestamps[var3] = var4; + } + } catch (IOException var6) { + var6.printStackTrace(); + } +- + } + +- public synchronized DataInputStream getChunkDataInputStream(int var1, int var2) { +- if(this.outOfBounds(var1, var2)) { ++ /** ++ * args: x, y - get uncompressed chunk stream from the region file ++ */ ++ public synchronized DataInputStream getChunkDataInputStream(int par1, int par2) { ++ if (this.outOfBounds(par1, par2)) { + return null; + } else { + try { +- int var3 = this.getOffset(var1, var2); +- if(var3 == 0) { ++ int var3 = this.getOffset(par1, par2); ++ ++ if (var3 == 0) { + return null; + } else { + int var4 = var3 >> 8; + int var5 = var3 & 255; +- if(var4 + var5 > this.f.size()) { ++ ++ if (var4 + var5 > this.sectorFree.size()) { + return null; + } else { +- this.c.seek((long)(var4 * 4096)); +- int var6 = this.c.readInt(); +- if(var6 > 4096 * var5) { ++ this.dataFile.seek((long)(var4 * 4096)); ++ int var6 = this.dataFile.readInt(); ++ ++ if (var6 > 4096 * var5) { + return null; +- } else if(var6 <= 0) { ++ } else if (var6 <= 0) { + return null; + } else { +- byte var7 = this.c.readByte(); ++ byte var7 = this.dataFile.readByte(); + byte[] var8; +- if(var7 == 1) { ++ ++ if (var7 == 1) { + var8 = new byte[var6 - 1]; +- this.c.read(var8); ++ this.dataFile.read(var8); + return new DataInputStream(new BufferedInputStream(new GZIPInputStream(new ByteArrayInputStream(var8)))); +- } else if(var7 == 2) { ++ } else if (var7 == 2) { + var8 = new byte[var6 - 1]; +- this.c.read(var8); ++ this.dataFile.read(var8); + return new DataInputStream(new BufferedInputStream(new InflaterInputStream(new ByteArrayInputStream(var8)))); + } else { + return null; +@@ -128,116 +138,144 @@ + } + } + +- public DataOutputStream getChunkDataOutputStream(int var1, int var2) { +- return this.outOfBounds(var1, var2) ? null : new DataOutputStream(new DeflaterOutputStream(new RegionFileChunkBuffer(this, var1, var2))); ++ /** ++ * args: x, z - get an output stream used to write chunk data, data is on disk when the returned stream is closed ++ */ ++ public DataOutputStream getChunkDataOutputStream(int par1, int par2) { ++ return this.outOfBounds(par1, par2) ? null : new DataOutputStream(new DeflaterOutputStream(new RegionFileChunkBuffer(this, par1, par2))); + } + +- protected synchronized void write(int var1, int var2, byte[] var3, int var4) { ++ /** ++ * args: x, z, data, length - write chunk data at (x, z) to disk ++ */ ++ protected synchronized void write(int par1, int par2, byte[] par3ArrayOfByte, int par4) { + try { +- int var5 = this.getOffset(var1, var2); ++ int var5 = this.getOffset(par1, par2); + int var6 = var5 >> 8; + int var7 = var5 & 255; +- int var8 = (var4 + 5) / 4096 + 1; +- if(var8 >= 256) { ++ int var8 = (par4 + 5) / 4096 + 1; ++ ++ if (var8 >= 256) { + return; + } + +- if(var6 != 0 && var7 == var8) { +- this.write(var6, var3, var4); ++ if (var6 != 0 && var7 == var8) { ++ this.write(var6, par3ArrayOfByte, par4); + } else { + int var9; +- for(var9 = 0; var9 < var7; ++var9) { +- this.f.set(var6 + var9, Boolean.valueOf(true)); ++ ++ for (var9 = 0; var9 < var7; ++var9) { ++ this.sectorFree.set(var6 + var9, Boolean.valueOf(true)); + } + +- var9 = this.f.indexOf(Boolean.valueOf(true)); ++ var9 = this.sectorFree.indexOf(Boolean.valueOf(true)); + int var10 = 0; + int var11; +- if(var9 != -1) { +- for(var11 = var9; var11 < this.f.size(); ++var11) { +- if(var10 != 0) { +- if(((Boolean)this.f.get(var11)).booleanValue()) { ++ ++ if (var9 != -1) { ++ for (var11 = var9; var11 < this.sectorFree.size(); ++var11) { ++ if (var10 != 0) { ++ if (((Boolean)this.sectorFree.get(var11)).booleanValue()) { + ++var10; + } else { + var10 = 0; + } +- } else if(((Boolean)this.f.get(var11)).booleanValue()) { ++ } else if (((Boolean)this.sectorFree.get(var11)).booleanValue()) { + var9 = var11; + var10 = 1; + } + +- if(var10 >= var8) { ++ if (var10 >= var8) { + break; + } + } + } + +- if(var10 >= var8) { ++ if (var10 >= var8) { + var6 = var9; +- this.setOffset(var1, var2, var9 << 8 | var8); ++ this.setOffset(par1, par2, var9 << 8 | var8); + +- for(var11 = 0; var11 < var8; ++var11) { +- this.f.set(var6 + var11, Boolean.valueOf(false)); ++ for (var11 = 0; var11 < var8; ++var11) { ++ this.sectorFree.set(var6 + var11, Boolean.valueOf(false)); + } + +- this.write(var6, var3, var4); ++ this.write(var6, par3ArrayOfByte, par4); + } else { +- this.c.seek(this.c.length()); +- var6 = this.f.size(); ++ this.dataFile.seek(this.dataFile.length()); ++ var6 = this.sectorFree.size(); + +- for(var11 = 0; var11 < var8; ++var11) { +- this.c.write(emptySector); +- this.f.add(Boolean.valueOf(false)); ++ for (var11 = 0; var11 < var8; ++var11) { ++ this.dataFile.write(emptySector); ++ this.sectorFree.add(Boolean.valueOf(false)); + } + + this.sizeDelta += 4096 * var8; +- this.write(var6, var3, var4); +- this.setOffset(var1, var2, var6 << 8 | var8); ++ this.write(var6, par3ArrayOfByte, par4); ++ this.setOffset(par1, par2, var6 << 8 | var8); + } + } + +- this.setChunkTimestamp(var1, var2, (int)(MinecraftServer.getCurrentTimeMillis() / 1000L)); ++ this.setChunkTimestamp(par1, par2, (int)(MinecraftServer.getSystemTimeMillis() / 1000L)); + } catch (IOException var12) { + var12.printStackTrace(); + } +- +- } +- +- private void write(int var1, byte[] var2, int var3) throws IOException { +- this.c.seek((long)(var1 * 4096)); +- this.c.writeInt(var3 + 1); +- this.c.writeByte(2); +- this.c.write(var2, 0, var3); +- } +- +- private boolean outOfBounds(int var1, int var2) { +- return var1 < 0 || var1 >= 32 || var2 < 0 || var2 >= 32; +- } +- +- private int getOffset(int var1, int var2) { +- return this.offsets[var1 + var2 * 32]; +- } +- +- public boolean isChunkSaved(int var1, int var2) { +- return this.getOffset(var1, var2) != 0; +- } +- +- private void setOffset(int var1, int var2, int var3) throws IOException { +- this.offsets[var1 + var2 * 32] = var3; +- this.c.seek((long)((var1 + var2 * 32) * 4)); +- this.c.writeInt(var3); +- } +- +- private void setChunkTimestamp(int var1, int var2, int var3) throws IOException { +- this.chunkTimestamps[var1 + var2 * 32] = var3; +- this.c.seek((long)(4096 + (var1 + var2 * 32) * 4)); +- this.c.writeInt(var3); +- } +- ++ } ++ ++ /** ++ * args: sectorNumber, data, length - write the chunk data to this RegionFile ++ */ ++ private void write(int par1, byte[] par2ArrayOfByte, int par3) throws IOException { ++ this.dataFile.seek((long)(par1 * 4096)); ++ this.dataFile.writeInt(par3 + 1); ++ this.dataFile.writeByte(2); ++ this.dataFile.write(par2ArrayOfByte, 0, par3); ++ } ++ ++ /** ++ * args: x, z - check region bounds ++ */ ++ private boolean outOfBounds(int par1, int par2) { ++ return par1 < 0 || par1 >= 32 || par2 < 0 || par2 >= 32; ++ } ++ ++ /** ++ * args: x, y - get chunk's offset in region file ++ */ ++ private int getOffset(int par1, int par2) { ++ return this.offsets[par1 + par2 * 32]; ++ } ++ ++ /** ++ * args: x, z, - true if chunk has been saved / converted ++ */ ++ public boolean isChunkSaved(int par1, int par2) { ++ return this.getOffset(par1, par2) != 0; ++ } ++ ++ /** ++ * args: x, z, offset - sets the chunk's offset in the region file ++ */ ++ private void setOffset(int par1, int par2, int par3) throws IOException { ++ this.offsets[par1 + par2 * 32] = par3; ++ this.dataFile.seek((long)((par1 + par2 * 32) * 4)); ++ this.dataFile.writeInt(par3); ++ } ++ ++ /** ++ * args: x, z, timestamp - sets the chunk's write timestamp ++ */ ++ private void setChunkTimestamp(int par1, int par2, int par3) throws IOException { ++ this.chunkTimestamps[par1 + par2 * 32] = par3; ++ this.dataFile.seek((long)(4096 + (par1 + par2 * 32) * 4)); ++ this.dataFile.writeInt(par3); ++ } ++ ++ /** ++ * close this RegionFile and prevent further writes ++ */ + public void close() throws IOException { +- if(this.c != null) { +- this.c.close(); ++ if (this.dataFile != null) { ++ this.dataFile.close(); + } +- + } + } diff --git a/patches/net/minecraft/src/RegionFileCache.java.patch b/patches/net/minecraft/src/RegionFileCache.java.patch new file mode 100644 index 0000000..f19e24e --- /dev/null +++ b/patches/net/minecraft/src/RegionFileCache.java.patch @@ -0,0 +1,93 @@ +--- net/minecraft/src/RegionFileCache.java ++++ net/minecraft/src/RegionFileCache.java +@@ -9,37 +9,43 @@ + import java.util.Map; + + public class RegionFileCache { +- private static final Map a = new HashMap(); +- +- public static synchronized RegionFile createOrLoadRegionFile(File var0, int var1, int var2) { +- File var3 = new File(var0, "region"); +- File var4 = new File(var3, "r." + (var1 >> 5) + "." + (var2 >> 5) + ".mca"); +- RegionFile var5 = (RegionFile)a.get(var4); +- if(var5 != null) { ++ ++ /** A map containing Files as keys and RegionFiles as values */ ++ private static final Map regionsByFilename = new HashMap(); ++ ++ public static synchronized RegionFile createOrLoadRegionFile(File par0File, int par1, int par2) { ++ File var3 = new File(par0File, "region"); ++ File var4 = new File(var3, "r." + (par1 >> 5) + "." + (par2 >> 5) + ".mca"); ++ RegionFile var5 = (RegionFile)regionsByFilename.get(var4); ++ ++ if (var5 != null) { + return var5; + } else { +- if(!var3.exists()) { ++ if (!var3.exists()) { + var3.mkdirs(); + } + +- if(a.size() >= 256) { ++ if (regionsByFilename.size() >= 256) { + clearRegionFileReferences(); + } + + RegionFile var6 = new RegionFile(var4); +- a.put(var4, var6); ++ regionsByFilename.put(var4, var6); + return var6; + } + } + ++ /** ++ * Saves the current Chunk Map Cache ++ */ + public static synchronized void clearRegionFileReferences() { +- Iterator var0 = a.values().iterator(); ++ Iterator var0 = regionsByFilename.values().iterator(); + +- while(var0.hasNext()) { ++ while (var0.hasNext()) { + RegionFile var1 = (RegionFile)var0.next(); + + try { +- if(var1 != null) { ++ if (var1 != null) { + var1.close(); + } + } catch (IOException var3) { +@@ -47,16 +53,22 @@ + } + } + +- a.clear(); +- } +- +- public static DataInputStream getChunkInputStream(File var0, int var1, int var2) { +- RegionFile var3 = createOrLoadRegionFile(var0, var1, var2); +- return var3.getChunkDataInputStream(var1 & 31, var2 & 31); +- } +- +- public static DataOutputStream getChunkOutputStream(File var0, int var1, int var2) { +- RegionFile var3 = createOrLoadRegionFile(var0, var1, var2); +- return var3.getChunkDataOutputStream(var1 & 31, var2 & 31); ++ regionsByFilename.clear(); ++ } ++ ++ /** ++ * Returns an input stream for the specified chunk. Args: worldDir, chunkX, chunkZ ++ */ ++ public static DataInputStream getChunkInputStream(File par0File, int par1, int par2) { ++ RegionFile var3 = createOrLoadRegionFile(par0File, par1, par2); ++ return var3.getChunkDataInputStream(par1 & 31, par2 & 31); ++ } ++ ++ /** ++ * Returns an output stream for the specified chunk. Args: worldDir, chunkX, chunkZ ++ */ ++ public static DataOutputStream getChunkOutputStream(File par0File, int par1, int par2) { ++ RegionFile var3 = createOrLoadRegionFile(par0File, par1, par2); ++ return var3.getChunkDataOutputStream(par1 & 31, par2 & 31); + } + } diff --git a/patches/net/minecraft/src/RegionFileChunkBuffer.java.patch b/patches/net/minecraft/src/RegionFileChunkBuffer.java.patch new file mode 100644 index 0000000..628dea4 --- /dev/null +++ b/patches/net/minecraft/src/RegionFileChunkBuffer.java.patch @@ -0,0 +1,21 @@ +--- net/minecraft/src/RegionFileChunkBuffer.java ++++ net/minecraft/src/RegionFileChunkBuffer.java +@@ -6,13 +6,14 @@ + class RegionFileChunkBuffer extends ByteArrayOutputStream { + private int chunkX; + private int chunkZ; ++ + final RegionFile regionFile; + +- public RegionFileChunkBuffer(RegionFile var1, int var2, int var3) { ++ public RegionFileChunkBuffer(RegionFile par1RegionFile, int par2, int par3) { + super(8096); +- this.regionFile = var1; +- this.chunkX = var2; +- this.chunkZ = var3; ++ this.regionFile = par1RegionFile; ++ this.chunkX = par2; ++ this.chunkZ = par3; + } + + public void close() throws IOException { diff --git a/patches/net/minecraft/src/RegistryDefaulted.java.patch b/patches/net/minecraft/src/RegistryDefaulted.java.patch new file mode 100644 index 0000000..135e771 --- /dev/null +++ b/patches/net/minecraft/src/RegistryDefaulted.java.patch @@ -0,0 +1,28 @@ +--- net/minecraft/src/RegistryDefaulted.java ++++ net/minecraft/src/RegistryDefaulted.java +@@ -1,14 +1,18 @@ + package net.minecraft.src; + + public class RegistryDefaulted extends RegistrySimple { +- private final Object b; +- +- public RegistryDefaulted(Object var1) { +- this.b = var1; ++ ++ /** ++ * Default object for this registry, returned when an object is not found. ++ */ ++ private final Object defaultObject; ++ ++ public RegistryDefaulted(Object par1Obj) { ++ this.defaultObject = par1Obj; + } + +- public Object getObject(Object var1) { +- Object var2 = super.getObject(var1); +- return var2 == null ? this.b : var2; ++ public Object getObject(Object par1Obj) { ++ Object var2 = super.getObject(par1Obj); ++ return var2 == null ? this.defaultObject : var2; + } + } diff --git a/patches/net/minecraft/src/RegistrySimple.java.patch b/patches/net/minecraft/src/RegistrySimple.java.patch new file mode 100644 index 0000000..2bbfc55 --- /dev/null +++ b/patches/net/minecraft/src/RegistrySimple.java.patch @@ -0,0 +1,30 @@ +--- net/minecraft/src/RegistrySimple.java ++++ net/minecraft/src/RegistrySimple.java +@@ -5,17 +5,22 @@ + import java.util.Map; + + public class RegistrySimple implements IRegistry { +- protected final Map a = this.func_111054_a(); ++ ++ /** Objects registered on this registry. */ ++ protected final Map registryObjects = this.func_111054_a(); + + protected HashMap func_111054_a() { + return Maps.newHashMap(); + } + +- public Object getObject(Object var1) { +- return this.a.get(var1); ++ public Object getObject(Object par1Obj) { ++ return this.registryObjects.get(par1Obj); + } + +- public void putObject(Object var1, Object var2) { +- this.a.put(var1, var2); ++ /** ++ * Register an object on this registry. ++ */ ++ public void putObject(Object par1Obj, Object par2Obj) { ++ this.registryObjects.put(par1Obj, par2Obj); + } + } diff --git a/patches/net/minecraft/src/Render.java.patch b/patches/net/minecraft/src/Render.java.patch new file mode 100644 index 0000000..637fe6a --- /dev/null +++ b/patches/net/minecraft/src/Render.java.patch @@ -0,0 +1,390 @@ +--- net/minecraft/src/Render.java ++++ net/minecraft/src/Render.java +@@ -2,38 +2,58 @@ + + import org.lwjgl.opengl.GL11; + ++import com.prupe.mcpatcher.mob.MobRandomizer; ++ + public abstract class Render { + private static final ResourceLocation shadowTextures = new ResourceLocation("textures/misc/shadow.png"); + protected RenderManager renderManager; + protected RenderBlocks renderBlocks = new RenderBlocks(); + protected float shadowSize; ++ ++ /** ++ * Determines the darkness of the object's shadow. Higher value makes a darker shadow. ++ */ + protected float shadowOpaque = 1.0F; + ++ /** ++ * Actually renders the given argument. This is a synthetic bridge method, always casting down its argument and then ++ * handing it off to a worker function which does the actual work. In all probabilty, the class Render is generic ++ * (Render Public ++ public void bindTexture(ResourceLocation par1ResourceLocation) { ++ this.renderManager.renderEngine.bindTexture(par1ResourceLocation); ++ } ++ // Spout End ++ ++ /** ++ * Renders fire on top of the entity. Args: entity, x, y, z, partialTickTime ++ */ ++ private void renderEntityOnFire(Entity par1Entity, double par2, double par4, double par6, float par8) { + GL11.glDisable(GL11.GL_LIGHTING); + Icon var9 = Block.fire.getFireIcon(0); + Icon var10 = Block.fire.getFireIcon(1); + GL11.glPushMatrix(); +- GL11.glTranslatef((float)var2, (float)var4, (float)var6); +- float var11 = var1.width * 1.4F; +- GL11.glScalef(var11, var11, var11); ++ GL11.glTranslatef((float)par2, (float)par4, (float)par6); ++ float var11 = par1Entity.width * 1.4F; ++ GL11.glScalef(var11, var11, var11); + Tessellator var12 = Tessellator.instance; + float var13 = 0.5F; + float var14 = 0.0F; +- float var15 = var1.height / var11; +- float var16 = (float)(var1.posY - var1.boundingBox.minY); ++ float var15 = par1Entity.height / var11; ++ float var16 = (float)(par1Entity.posY - par1Entity.boundingBox.minY); + GL11.glRotatef(-this.renderManager.playerViewY, 0.0F, 1.0F, 0.0F); + GL11.glTranslatef(0.0F, 0.0F, -0.3F + (float)((int)var15) * 0.02F); + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); +@@ -41,14 +61,15 @@ + int var18 = 0; + var12.startDrawingQuads(); + +- while(var15 > 0.0F) { ++ while (var15 > 0.0F) { + Icon var19 = var18 % 2 == 0 ? var9 : var10; + this.bindTexture(TextureMap.locationBlocksTexture); + float var20 = var19.getMinU(); + float var21 = var19.getMinV(); + float var22 = var19.getMaxU(); + float var23 = var19.getMaxV(); +- if(var18 / 2 % 2 == 0) { ++ ++ if (var18 / 2 % 2 == 0) { + float var24 = var22; + var22 = var20; + var20 = var24; +@@ -70,42 +91,49 @@ + GL11.glEnable(GL11.GL_LIGHTING); + } + +- private void renderShadow(Entity var1, double var2, double var4, double var6, float var8, float var9) { ++ /** ++ * Renders the entity shadows at the position, shadow alpha and partialTickTime. Args: entity, x, y, z, shadowAlpha, ++ * partialTickTime ++ */ ++ private void renderShadow(Entity par1Entity, double par2, double par4, double par6, float par8, float par9) { + GL11.glEnable(GL11.GL_BLEND); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + this.renderManager.renderEngine.bindTexture(shadowTextures); + World var10 = this.getWorldFromRenderManager(); + GL11.glDepthMask(false); + float var11 = this.shadowSize; +- if(var1 instanceof EntityLiving) { +- EntityLiving var12 = (EntityLiving)var1; ++ ++ if (par1Entity instanceof EntityLiving) { ++ EntityLiving var12 = (EntityLiving)par1Entity; + var11 *= var12.getRenderSizeModifier(); +- if(var12.isChild()) { ++ ++ if (var12.isChild()) { + var11 *= 0.5F; + } + } + +- double var35 = var1.lastTickPosX + (var1.posX - var1.lastTickPosX) * (double)var9; +- double var14 = var1.lastTickPosY + (var1.posY - var1.lastTickPosY) * (double)var9 + (double)var1.getShadowSize(); +- double var16 = var1.lastTickPosZ + (var1.posZ - var1.lastTickPosZ) * (double)var9; ++ double var35 = par1Entity.lastTickPosX + (par1Entity.posX - par1Entity.lastTickPosX) * (double)par9; ++ double var14 = par1Entity.lastTickPosY + (par1Entity.posY - par1Entity.lastTickPosY) * (double)par9 + (double)par1Entity.getShadowSize(); ++ double var16 = par1Entity.lastTickPosZ + (par1Entity.posZ - par1Entity.lastTickPosZ) * (double)par9; + int var18 = MathHelper.floor_double(var35 - (double)var11); + int var19 = MathHelper.floor_double(var35 + (double)var11); + int var20 = MathHelper.floor_double(var14 - (double)var11); + int var21 = MathHelper.floor_double(var14); + int var22 = MathHelper.floor_double(var16 - (double)var11); + int var23 = MathHelper.floor_double(var16 + (double)var11); +- double var24 = var2 - var35; +- double var26 = var4 - var14; +- double var28 = var6 - var16; ++ double var24 = par2 - var35; ++ double var26 = par4 - var14; ++ double var28 = par6 - var16; + Tessellator var30 = Tessellator.instance; + var30.startDrawingQuads(); + +- for(int var31 = var18; var31 <= var19; ++var31) { +- for(int var32 = var20; var32 <= var21; ++var32) { +- for(int var33 = var22; var33 <= var23; ++var33) { ++ for (int var31 = var18; var31 <= var19; ++var31) { ++ for (int var32 = var20; var32 <= var21; ++var32) { ++ for (int var33 = var22; var33 <= var23; ++var33) { + int var34 = var10.getBlockId(var31, var32 - 1, var33); +- if(var34 > 0 && var10.getBlockLightValue(var31, var32, var33) > 3) { +- this.renderShadowOnBlock(Block.blocksList[var34], var2, var4 + (double)var1.getShadowSize(), var6, var31, var32, var33, var8, var11, var24, var26 + (double)var1.getShadowSize(), var28); ++ ++ if (var34 > 0 && var10.getBlockLightValue(var31, var32, var33) > 3) { ++ this.renderShadowOnBlock(Block.blocksList[var34], par2, par4 + (double)par1Entity.getShadowSize(), par6, var31, var32, var33, par8, var11, var24, var26 + (double)par1Entity.getShadowSize(), var28); + } + } + } +@@ -117,29 +145,39 @@ + GL11.glDepthMask(true); + } + ++ /** ++ * Returns the render manager's world object ++ */ + private World getWorldFromRenderManager() { + return this.renderManager.worldObj; + } + +- private void renderShadowOnBlock(Block var1, double var2, double var4, double var6, int var8, int var9, int var10, float var11, float var12, double var13, double var15, double var17) { ++ /** ++ * Renders a shadow projected down onto the specified block. Brightness of the block plus how far away on the Y axis ++ * determines the alpha of the shadow. Args: block, centerX, centerY, centerZ, blockX, blockY, blockZ, baseAlpha, ++ * shadowSize, xOffset, yOffset, zOffset ++ */ ++ private void renderShadowOnBlock(Block par1Block, double par2, double par4, double par6, int par8, int par9, int par10, float par11, float par12, double par13, double par15, double par17) { + Tessellator var19 = Tessellator.instance; +- if(var1.renderAsNormalBlock()) { +- double var20 = ((double)var11 - (var4 - ((double)var9 + var15)) / 2.0D) * 0.5D * (double)this.getWorldFromRenderManager().getLightBrightness(var8, var9, var10); +- if(var20 >= 0.0D) { +- if(var20 > 1.0D) { ++ ++ if (par1Block.renderAsNormalBlock()) { ++ double var20 = ((double)par11 - (par4 - ((double)par9 + par15)) / 2.0D) * 0.5D * (double)this.getWorldFromRenderManager().getLightBrightness(par8, par9, par10); ++ ++ if (var20 >= 0.0D) { ++ if (var20 > 1.0D) { + var20 = 1.0D; + } + + var19.setColorRGBA_F(1.0F, 1.0F, 1.0F, (float)var20); +- double var22 = (double)var8 + var1.getMinX() + var13; +- double var24 = (double)var8 + var1.getBlockBoundsMaxX() + var13; +- double var26 = (double)var9 + var1.getBlockBoundsMinY() + var15 + 1.0D / 64.0D; +- double var28 = (double)var10 + var1.getBlockBoundsMinZ() + var17; +- double var30 = (double)var10 + var1.getBlockBoundsMaxZ() + var17; +- float var32 = (float)((var2 - var22) / 2.0D / (double)var12 + 0.5D); +- float var33 = (float)((var2 - var24) / 2.0D / (double)var12 + 0.5D); +- float var34 = (float)((var6 - var28) / 2.0D / (double)var12 + 0.5D); +- float var35 = (float)((var6 - var30) / 2.0D / (double)var12 + 0.5D); ++ double var22 = (double)par8 + par1Block.getBlockBoundsMinX() + par13; ++ double var24 = (double)par8 + par1Block.getBlockBoundsMaxX() + par13; ++ double var26 = (double)par9 + par1Block.getBlockBoundsMinY() + par15 + 0.015625D; ++ double var28 = (double)par10 + par1Block.getBlockBoundsMinZ() + par17; ++ double var30 = (double)par10 + par1Block.getBlockBoundsMaxZ() + par17; ++ float var32 = (float)((par2 - var22) / 2.0D / (double)par12 + 0.5D); ++ float var33 = (float)((par2 - var24) / 2.0D / (double)par12 + 0.5D); ++ float var34 = (float)((par6 - var28) / 2.0D / (double)par12 + 0.5D); ++ float var35 = (float)((par6 - var30) / 2.0D / (double)par12 + 0.5D); + var19.addVertexWithUV(var22, var26, var28, (double)var32, (double)var34); + var19.addVertexWithUV(var22, var26, var30, (double)var32, (double)var35); + var19.addVertexWithUV(var24, var26, var30, (double)var33, (double)var35); +@@ -148,100 +186,114 @@ + } + } + +- public static void renderOffsetAABB(AxisAlignedBB var0, double var1, double var3, double var5) { ++ /** ++ * Renders a white box with the bounds of the AABB translated by the offset. Args: aabb, x, y, z ++ */ ++ public static void renderOffsetAABB(AxisAlignedBB par0AxisAlignedBB, double par1, double par3, double par5) { + GL11.glDisable(GL11.GL_TEXTURE_2D); + Tessellator var7 = Tessellator.instance; + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + var7.startDrawingQuads(); +- var7.setTranslation(var1, var3, var5); ++ var7.setTranslation(par1, par3, par5); + var7.setNormal(0.0F, 0.0F, -1.0F); +- var7.addVertex(var0.minX, var0.maxY, var0.minZ); +- var7.addVertex(var0.maxX, var0.maxY, var0.minZ); +- var7.addVertex(var0.maxX, var0.minY, var0.minZ); +- var7.addVertex(var0.minX, var0.minY, var0.minZ); ++ var7.addVertex(par0AxisAlignedBB.minX, par0AxisAlignedBB.maxY, par0AxisAlignedBB.minZ); ++ var7.addVertex(par0AxisAlignedBB.maxX, par0AxisAlignedBB.maxY, par0AxisAlignedBB.minZ); ++ var7.addVertex(par0AxisAlignedBB.maxX, par0AxisAlignedBB.minY, par0AxisAlignedBB.minZ); ++ var7.addVertex(par0AxisAlignedBB.minX, par0AxisAlignedBB.minY, par0AxisAlignedBB.minZ); + var7.setNormal(0.0F, 0.0F, 1.0F); +- var7.addVertex(var0.minX, var0.minY, var0.maxZ); +- var7.addVertex(var0.maxX, var0.minY, var0.maxZ); +- var7.addVertex(var0.maxX, var0.maxY, var0.maxZ); +- var7.addVertex(var0.minX, var0.maxY, var0.maxZ); ++ var7.addVertex(par0AxisAlignedBB.minX, par0AxisAlignedBB.minY, par0AxisAlignedBB.maxZ); ++ var7.addVertex(par0AxisAlignedBB.maxX, par0AxisAlignedBB.minY, par0AxisAlignedBB.maxZ); ++ var7.addVertex(par0AxisAlignedBB.maxX, par0AxisAlignedBB.maxY, par0AxisAlignedBB.maxZ); ++ var7.addVertex(par0AxisAlignedBB.minX, par0AxisAlignedBB.maxY, par0AxisAlignedBB.maxZ); + var7.setNormal(0.0F, -1.0F, 0.0F); +- var7.addVertex(var0.minX, var0.minY, var0.minZ); +- var7.addVertex(var0.maxX, var0.minY, var0.minZ); +- var7.addVertex(var0.maxX, var0.minY, var0.maxZ); +- var7.addVertex(var0.minX, var0.minY, var0.maxZ); ++ var7.addVertex(par0AxisAlignedBB.minX, par0AxisAlignedBB.minY, par0AxisAlignedBB.minZ); ++ var7.addVertex(par0AxisAlignedBB.maxX, par0AxisAlignedBB.minY, par0AxisAlignedBB.minZ); ++ var7.addVertex(par0AxisAlignedBB.maxX, par0AxisAlignedBB.minY, par0AxisAlignedBB.maxZ); ++ var7.addVertex(par0AxisAlignedBB.minX, par0AxisAlignedBB.minY, par0AxisAlignedBB.maxZ); + var7.setNormal(0.0F, 1.0F, 0.0F); +- var7.addVertex(var0.minX, var0.maxY, var0.maxZ); +- var7.addVertex(var0.maxX, var0.maxY, var0.maxZ); +- var7.addVertex(var0.maxX, var0.maxY, var0.minZ); +- var7.addVertex(var0.minX, var0.maxY, var0.minZ); ++ var7.addVertex(par0AxisAlignedBB.minX, par0AxisAlignedBB.maxY, par0AxisAlignedBB.maxZ); ++ var7.addVertex(par0AxisAlignedBB.maxX, par0AxisAlignedBB.maxY, par0AxisAlignedBB.maxZ); ++ var7.addVertex(par0AxisAlignedBB.maxX, par0AxisAlignedBB.maxY, par0AxisAlignedBB.minZ); ++ var7.addVertex(par0AxisAlignedBB.minX, par0AxisAlignedBB.maxY, par0AxisAlignedBB.minZ); + var7.setNormal(-1.0F, 0.0F, 0.0F); +- var7.addVertex(var0.minX, var0.minY, var0.maxZ); +- var7.addVertex(var0.minX, var0.maxY, var0.maxZ); +- var7.addVertex(var0.minX, var0.maxY, var0.minZ); +- var7.addVertex(var0.minX, var0.minY, var0.minZ); ++ var7.addVertex(par0AxisAlignedBB.minX, par0AxisAlignedBB.minY, par0AxisAlignedBB.maxZ); ++ var7.addVertex(par0AxisAlignedBB.minX, par0AxisAlignedBB.maxY, par0AxisAlignedBB.maxZ); ++ var7.addVertex(par0AxisAlignedBB.minX, par0AxisAlignedBB.maxY, par0AxisAlignedBB.minZ); ++ var7.addVertex(par0AxisAlignedBB.minX, par0AxisAlignedBB.minY, par0AxisAlignedBB.minZ); + var7.setNormal(1.0F, 0.0F, 0.0F); +- var7.addVertex(var0.maxX, var0.minY, var0.minZ); +- var7.addVertex(var0.maxX, var0.maxY, var0.minZ); +- var7.addVertex(var0.maxX, var0.maxY, var0.maxZ); +- var7.addVertex(var0.maxX, var0.minY, var0.maxZ); ++ var7.addVertex(par0AxisAlignedBB.maxX, par0AxisAlignedBB.minY, par0AxisAlignedBB.minZ); ++ var7.addVertex(par0AxisAlignedBB.maxX, par0AxisAlignedBB.maxY, par0AxisAlignedBB.minZ); ++ var7.addVertex(par0AxisAlignedBB.maxX, par0AxisAlignedBB.maxY, par0AxisAlignedBB.maxZ); ++ var7.addVertex(par0AxisAlignedBB.maxX, par0AxisAlignedBB.minY, par0AxisAlignedBB.maxZ); + var7.setTranslation(0.0D, 0.0D, 0.0D); + var7.draw(); + GL11.glEnable(GL11.GL_TEXTURE_2D); + } + +- public static void renderAABB(AxisAlignedBB var0) { ++ /** ++ * Adds to the tesselator a box using the aabb for the bounds. Args: aabb ++ */ ++ public static void renderAABB(AxisAlignedBB par0AxisAlignedBB) { + Tessellator var1 = Tessellator.instance; + var1.startDrawingQuads(); +- var1.addVertex(var0.minX, var0.maxY, var0.minZ); +- var1.addVertex(var0.maxX, var0.maxY, var0.minZ); +- var1.addVertex(var0.maxX, var0.minY, var0.minZ); +- var1.addVertex(var0.minX, var0.minY, var0.minZ); +- var1.addVertex(var0.minX, var0.minY, var0.maxZ); +- var1.addVertex(var0.maxX, var0.minY, var0.maxZ); +- var1.addVertex(var0.maxX, var0.maxY, var0.maxZ); +- var1.addVertex(var0.minX, var0.maxY, var0.maxZ); +- var1.addVertex(var0.minX, var0.minY, var0.minZ); +- var1.addVertex(var0.maxX, var0.minY, var0.minZ); +- var1.addVertex(var0.maxX, var0.minY, var0.maxZ); +- var1.addVertex(var0.minX, var0.minY, var0.maxZ); +- var1.addVertex(var0.minX, var0.maxY, var0.maxZ); +- var1.addVertex(var0.maxX, var0.maxY, var0.maxZ); +- var1.addVertex(var0.maxX, var0.maxY, var0.minZ); +- var1.addVertex(var0.minX, var0.maxY, var0.minZ); +- var1.addVertex(var0.minX, var0.minY, var0.maxZ); +- var1.addVertex(var0.minX, var0.maxY, var0.maxZ); +- var1.addVertex(var0.minX, var0.maxY, var0.minZ); +- var1.addVertex(var0.minX, var0.minY, var0.minZ); +- var1.addVertex(var0.maxX, var0.minY, var0.minZ); +- var1.addVertex(var0.maxX, var0.maxY, var0.minZ); +- var1.addVertex(var0.maxX, var0.maxY, var0.maxZ); +- var1.addVertex(var0.maxX, var0.minY, var0.maxZ); ++ var1.addVertex(par0AxisAlignedBB.minX, par0AxisAlignedBB.maxY, par0AxisAlignedBB.minZ); ++ var1.addVertex(par0AxisAlignedBB.maxX, par0AxisAlignedBB.maxY, par0AxisAlignedBB.minZ); ++ var1.addVertex(par0AxisAlignedBB.maxX, par0AxisAlignedBB.minY, par0AxisAlignedBB.minZ); ++ var1.addVertex(par0AxisAlignedBB.minX, par0AxisAlignedBB.minY, par0AxisAlignedBB.minZ); ++ var1.addVertex(par0AxisAlignedBB.minX, par0AxisAlignedBB.minY, par0AxisAlignedBB.maxZ); ++ var1.addVertex(par0AxisAlignedBB.maxX, par0AxisAlignedBB.minY, par0AxisAlignedBB.maxZ); ++ var1.addVertex(par0AxisAlignedBB.maxX, par0AxisAlignedBB.maxY, par0AxisAlignedBB.maxZ); ++ var1.addVertex(par0AxisAlignedBB.minX, par0AxisAlignedBB.maxY, par0AxisAlignedBB.maxZ); ++ var1.addVertex(par0AxisAlignedBB.minX, par0AxisAlignedBB.minY, par0AxisAlignedBB.minZ); ++ var1.addVertex(par0AxisAlignedBB.maxX, par0AxisAlignedBB.minY, par0AxisAlignedBB.minZ); ++ var1.addVertex(par0AxisAlignedBB.maxX, par0AxisAlignedBB.minY, par0AxisAlignedBB.maxZ); ++ var1.addVertex(par0AxisAlignedBB.minX, par0AxisAlignedBB.minY, par0AxisAlignedBB.maxZ); ++ var1.addVertex(par0AxisAlignedBB.minX, par0AxisAlignedBB.maxY, par0AxisAlignedBB.maxZ); ++ var1.addVertex(par0AxisAlignedBB.maxX, par0AxisAlignedBB.maxY, par0AxisAlignedBB.maxZ); ++ var1.addVertex(par0AxisAlignedBB.maxX, par0AxisAlignedBB.maxY, par0AxisAlignedBB.minZ); ++ var1.addVertex(par0AxisAlignedBB.minX, par0AxisAlignedBB.maxY, par0AxisAlignedBB.minZ); ++ var1.addVertex(par0AxisAlignedBB.minX, par0AxisAlignedBB.minY, par0AxisAlignedBB.maxZ); ++ var1.addVertex(par0AxisAlignedBB.minX, par0AxisAlignedBB.maxY, par0AxisAlignedBB.maxZ); ++ var1.addVertex(par0AxisAlignedBB.minX, par0AxisAlignedBB.maxY, par0AxisAlignedBB.minZ); ++ var1.addVertex(par0AxisAlignedBB.minX, par0AxisAlignedBB.minY, par0AxisAlignedBB.minZ); ++ var1.addVertex(par0AxisAlignedBB.maxX, par0AxisAlignedBB.minY, par0AxisAlignedBB.minZ); ++ var1.addVertex(par0AxisAlignedBB.maxX, par0AxisAlignedBB.maxY, par0AxisAlignedBB.minZ); ++ var1.addVertex(par0AxisAlignedBB.maxX, par0AxisAlignedBB.maxY, par0AxisAlignedBB.maxZ); ++ var1.addVertex(par0AxisAlignedBB.maxX, par0AxisAlignedBB.minY, par0AxisAlignedBB.maxZ); + var1.draw(); + } + +- public void setRenderManager(RenderManager var1) { +- this.renderManager = var1; ++ /** ++ * Sets the RenderManager. ++ */ ++ public void setRenderManager(RenderManager par1RenderManager) { ++ this.renderManager = par1RenderManager; + } + +- public void doRenderShadowAndFire(Entity var1, double var2, double var4, double var6, float var8, float var9) { +- if(this.renderManager.options.fancyGraphics && this.shadowSize > 0.0F && !var1.isInvisible()) { +- double var10 = this.renderManager.getDistanceToCamera(var1.posX, var1.posY, var1.posZ); ++ /** ++ * Renders the entity's shadow and fire (if its on fire). Args: entity, x, y, z, yaw, partialTickTime ++ */ ++ public void doRenderShadowAndFire(Entity par1Entity, double par2, double par4, double par6, float par8, float par9) { ++ if (this.renderManager.options.fancyGraphics && this.shadowSize > 0.0F && !par1Entity.isInvisible()) { ++ double var10 = this.renderManager.getDistanceToCamera(par1Entity.posX, par1Entity.posY, par1Entity.posZ); + float var12 = (float)((1.0D - var10 / 256.0D) * (double)this.shadowOpaque); +- if(var12 > 0.0F) { +- this.renderShadow(var1, var2, var4, var6, var12, var9); ++ ++ if (var12 > 0.0F) { ++ this.renderShadow(par1Entity, par2, par4, par6, var12, par9); + } + } + +- if(var1.canRenderOnFire()) { +- this.renderEntityOnFire(var1, var2, var4, var6, var9); ++ if (par1Entity.canRenderOnFire()) { ++ this.renderEntityOnFire(par1Entity, par2, par4, par6, par9); + } +- + } + ++ /** ++ * Returns the font renderer from the set render manager ++ */ + public FontRenderer getFontRendererFromRenderManager() { + return this.renderManager.getFontRenderer(); + } + +- public void updateIcons(IconRegister var1) { +- } ++ public void updateIcons(IconRegister par1IconRegister) {} + } diff --git a/patches/net/minecraft/src/RenderArrow.java.patch b/patches/net/minecraft/src/RenderArrow.java.patch new file mode 100644 index 0000000..fd94f40 --- /dev/null +++ b/patches/net/minecraft/src/RenderArrow.java.patch @@ -0,0 +1,71 @@ +--- net/minecraft/src/RenderArrow.java ++++ net/minecraft/src/RenderArrow.java +@@ -6,12 +6,12 @@ + public class RenderArrow extends Render { + private static final ResourceLocation arrowTextures = new ResourceLocation("textures/entity/arrow.png"); + +- public void renderArrow(EntityArrow var1, double var2, double var4, double var6, float var8, float var9) { +- this.bindEntityTexture(var1); ++ public void renderArrow(EntityArrow par1EntityArrow, double par2, double par4, double par6, float par8, float par9) { ++ this.bindEntityTexture(par1EntityArrow); + GL11.glPushMatrix(); +- GL11.glTranslatef((float)var2, (float)var4, (float)var6); +- GL11.glRotatef(var1.prevRotationYaw + (var1.rotationYaw - var1.prevRotationYaw) * var9 - 90.0F, 0.0F, 1.0F, 0.0F); +- GL11.glRotatef(var1.prevRotationPitch + (var1.rotationPitch - var1.prevRotationPitch) * var9, 0.0F, 0.0F, 1.0F); ++ GL11.glTranslatef((float)par2, (float)par4, (float)par6); ++ GL11.glRotatef(par1EntityArrow.prevRotationYaw + (par1EntityArrow.rotationYaw - par1EntityArrow.prevRotationYaw) * par9 - 90.0F, 0.0F, 1.0F, 0.0F); ++ GL11.glRotatef(par1EntityArrow.prevRotationPitch + (par1EntityArrow.rotationPitch - par1EntityArrow.prevRotationPitch) * par9, 0.0F, 0.0F, 1.0F); + Tessellator var10 = Tessellator.instance; + byte var11 = 0; + float var12 = 0.0F; +@@ -24,8 +24,9 @@ + float var19 = (float)(10 + var11 * 10) / 32.0F; + float var20 = 0.05625F; + GL11.glEnable(GL12.GL_RESCALE_NORMAL); +- float var21 = (float)var1.arrowShake - var9; +- if(var21 > 0.0F) { ++ float var21 = (float)par1EntityArrow.arrowShake - par9; ++ ++ if (var21 > 0.0F) { + float var22 = -MathHelper.sin(var21 * 3.0F) * var21; + GL11.glRotatef(var22, 0.0F, 0.0F, 1.0F); + } +@@ -48,7 +49,7 @@ + var10.addVertexWithUV(-7.0D, -2.0D, -2.0D, (double)var16, (double)var19); + var10.draw(); + +- for(int var23 = 0; var23 < 4; ++var23) { ++ for (int var23 = 0; var23 < 4; ++var23) { + GL11.glRotatef(90.0F, 1.0F, 0.0F, 0.0F); + GL11.glNormal3f(0.0F, 0.0F, var20); + var10.startDrawingQuads(); +@@ -63,15 +64,24 @@ + GL11.glPopMatrix(); + } + +- protected ResourceLocation getArrowTextures(EntityArrow var1) { ++ protected ResourceLocation getArrowTextures(EntityArrow par1EntityArrow) { + return arrowTextures; + } + +- protected ResourceLocation getEntityTexture(Entity var1) { +- return this.getArrowTextures((EntityArrow)var1); ++ /** ++ * Returns the location of an entity's texture. Doesn't seem to be called unless you call Render.bindEntityTexture. ++ */ ++ protected ResourceLocation getEntityTexture(Entity par1Entity) { ++ return this.getArrowTextures((EntityArrow)par1Entity); + } + +- public void doRender(Entity var1, double var2, double var4, double var6, float var8, float var9) { +- this.renderArrow((EntityArrow)var1, var2, var4, var6, var8, var9); ++ /** ++ * Actually renders the given argument. This is a synthetic bridge method, always casting down its argument and then ++ * handing it off to a worker function which does the actual work. In all probabilty, the class Render is generic ++ * (Render> 16 & 255) / 255.0F; + float var11 = (float)(var9 >> 8 & 255) / 255.0F; + float var12 = (float)(var9 & 255) / 255.0F; + GL11.glColor3f(var8 * var10, var8 * var11, var8 * var12); +- if(var4.isItemEnchanted()) { ++ ++ if (var4.isItemEnchanted()) { + return 31; + } + +@@ -77,7 +86,8 @@ + } + + GL11.glColor3f(var8, var8, var8); +- if(var4.isItemEnchanted()) { ++ ++ if (var4.isItemEnchanted()) { + return 15; + } + +@@ -88,68 +98,73 @@ + return -1; + } + +- protected void func_130013_c(EntityLiving var1, int var2, float var3) { +- ItemStack var4 = var1.func_130225_q(3 - var2); +- if(var4 != null) { ++ protected void func_130013_c(EntityLiving par1EntityLiving, int par2, float par3) { ++ ItemStack var4 = par1EntityLiving.func_130225_q(3 - par2); ++ ++ if (var4 != null) { + Item var5 = var4.getItem(); +- if(var5 instanceof ItemArmor) { +- this.bindTexture(func_110858_a((ItemArmor)var5, var2, "overlay")); ++ ++ if (var5 instanceof ItemArmor) { ++ this.bindTexture(func_110858_a((ItemArmor)var5, par2, "overlay")); + float var6 = 1.0F; + GL11.glColor3f(var6, var6, var6); + } + } +- + } + +- public void doRenderLiving(EntityLiving var1, double var2, double var4, double var6, float var8, float var9) { ++ public void doRenderLiving(EntityLiving par1EntityLiving, double par2, double par4, double par6, float par8, float par9) { + float var10 = 1.0F; + GL11.glColor3f(var10, var10, var10); +- ItemStack var11 = var1.getHeldItem(); +- this.func_82420_a(var1, var11); +- double var12 = var4 - (double)var1.yOffset; +- if(var1.isSneaking()) { ++ ItemStack var11 = par1EntityLiving.getHeldItem(); ++ this.func_82420_a(par1EntityLiving, var11); ++ double var12 = par4 - (double)par1EntityLiving.yOffset; ++ ++ if (par1EntityLiving.isSneaking()) { + var12 -= 0.125D; + } + +- super.doRenderLiving(var1, var2, var12, var6, var8, var9); ++ super.doRenderLiving(par1EntityLiving, par2, var12, par6, par8, par9); + this.field_82423_g.aimedBow = this.field_82425_h.aimedBow = this.modelBipedMain.aimedBow = false; + this.field_82423_g.isSneak = this.field_82425_h.isSneak = this.modelBipedMain.isSneak = false; + this.field_82423_g.heldItemRight = this.field_82425_h.heldItemRight = this.modelBipedMain.heldItemRight = 0; + } + +- protected ResourceLocation func_110856_a(EntityLiving var1) { ++ protected ResourceLocation func_110856_a(EntityLiving par1EntityLiving) { + return null; + } + +- protected void func_82420_a(EntityLiving var1, ItemStack var2) { +- this.field_82423_g.heldItemRight = this.field_82425_h.heldItemRight = this.modelBipedMain.heldItemRight = var2 != null ? 1 : 0; +- this.field_82423_g.isSneak = this.field_82425_h.isSneak = this.modelBipedMain.isSneak = var1.isSneaking(); ++ protected void func_82420_a(EntityLiving par1EntityLiving, ItemStack par2ItemStack) { ++ this.field_82423_g.heldItemRight = this.field_82425_h.heldItemRight = this.modelBipedMain.heldItemRight = par2ItemStack != null ? 1 : 0; ++ this.field_82423_g.isSneak = this.field_82425_h.isSneak = this.modelBipedMain.isSneak = par1EntityLiving.isSneaking(); + } + +- protected void func_130005_c(EntityLiving var1, float var2) { ++ protected void func_130005_c(EntityLiving par1EntityLiving, float par2) { + float var3 = 1.0F; + GL11.glColor3f(var3, var3, var3); +- super.renderEquippedItems(var1, var2); +- ItemStack var4 = var1.getHeldItem(); +- ItemStack var5 = var1.func_130225_q(3); ++ super.renderEquippedItems(par1EntityLiving, par2); ++ ItemStack var4 = par1EntityLiving.getHeldItem(); ++ ItemStack var5 = par1EntityLiving.func_130225_q(3); + float var6; +- if(var5 != null) { ++ ++ if (var5 != null) { + GL11.glPushMatrix(); +- this.modelBipedMain.bipedHead.postRender(1.0F / 16.0F); +- if(var5.getItem().itemID < 256) { +- if(RenderBlocks.renderItemIn3d(Block.blocksList[var5.itemID].getRenderType())) { +- var6 = 10.0F / 16.0F; ++ this.modelBipedMain.bipedHead.postRender(0.0625F); ++ ++ if (var5.getItem().itemID < 256) { ++ if (RenderBlocks.renderItemIn3d(Block.blocksList[var5.itemID].getRenderType())) { ++ var6 = 0.625F; + GL11.glTranslatef(0.0F, -0.25F, 0.0F); + GL11.glRotatef(90.0F, 0.0F, 1.0F, 0.0F); + GL11.glScalef(var6, -var6, -var6); + } + +- this.renderManager.itemRenderer.renderItem(var1, var5, 0); +- } else if(var5.getItem().itemID == Item.skull.itemID) { ++ this.renderManager.itemRenderer.renderItem(par1EntityLiving, var5, 0); ++ } else if (var5.getItem().itemID == Item.skull.itemID) { + var6 = 1.0625F; + GL11.glScalef(var6, -var6, -var6); + String var7 = ""; +- if(var5.hasTagCompound() && var5.getTagCompound().hasKey("SkullOwner")) { ++ ++ if (var5.hasTagCompound() && var5.getTagCompound().hasKey("SkullOwner")) { + var7 = var5.getTagCompound().getString("SkullOwner"); + } + +@@ -159,36 +174,39 @@ + GL11.glPopMatrix(); + } + +- if(var4 != null) { ++ if (var4 != null) { + GL11.glPushMatrix(); +- if(this.mainModel.isChild) { ++ ++ if (this.mainModel.isChild) { + var6 = 0.5F; +- GL11.glTranslatef(0.0F, 10.0F / 16.0F, 0.0F); ++ GL11.glTranslatef(0.0F, 0.625F, 0.0F); + GL11.glRotatef(-20.0F, -1.0F, 0.0F, 0.0F); + GL11.glScalef(var6, var6, var6); + } + +- this.modelBipedMain.bipedRightArm.postRender(1.0F / 16.0F); +- GL11.glTranslatef(-(1.0F / 16.0F), 7.0F / 16.0F, 1.0F / 16.0F); +- if(var4.itemID < 256 && RenderBlocks.renderItemIn3d(Block.blocksList[var4.itemID].getRenderType())) { ++ this.modelBipedMain.bipedRightArm.postRender(0.0625F); ++ GL11.glTranslatef(-0.0625F, 0.4375F, 0.0625F); ++ ++ if (var4.itemID < 256 && RenderBlocks.renderItemIn3d(Block.blocksList[var4.itemID].getRenderType())) { + var6 = 0.5F; +- GL11.glTranslatef(0.0F, 3.0F / 16.0F, -(5.0F / 16.0F)); +- var6 *= 12.0F / 16.0F; ++ GL11.glTranslatef(0.0F, 0.1875F, -0.3125F); ++ var6 *= 0.75F; + GL11.glRotatef(20.0F, 1.0F, 0.0F, 0.0F); + GL11.glRotatef(45.0F, 0.0F, 1.0F, 0.0F); + GL11.glScalef(-var6, -var6, var6); +- } else if(var4.itemID == Item.bow.itemID) { +- var6 = 10.0F / 16.0F; +- GL11.glTranslatef(0.0F, 2.0F / 16.0F, 5.0F / 16.0F); ++ } else if (var4.itemID == Item.bow.itemID) { ++ var6 = 0.625F; ++ GL11.glTranslatef(0.0F, 0.125F, 0.3125F); + GL11.glRotatef(-20.0F, 0.0F, 1.0F, 0.0F); + GL11.glScalef(var6, -var6, var6); + GL11.glRotatef(-100.0F, 1.0F, 0.0F, 0.0F); + GL11.glRotatef(45.0F, 0.0F, 1.0F, 0.0F); +- } else if(Item.itemsList[var4.itemID].isFull3D()) { +- var6 = 10.0F / 16.0F; +- if(Item.itemsList[var4.itemID].shouldRotateAroundWhenRendering()) { ++ } else if (Item.itemsList[var4.itemID].isFull3D() || var4.itemID == Item.flint.itemID && org.spoutcraft.api.material.MaterialData.getCustomItem(var4.getItemDamage()) instanceof org.spoutcraft.api.material.Tool) { ++ var6 = 0.625F; ++ ++ if (Item.itemsList[var4.itemID].shouldRotateAroundWhenRendering()) { + GL11.glRotatef(180.0F, 0.0F, 0.0F, 1.0F); +- GL11.glTranslatef(0.0F, -(2.0F / 16.0F), 0.0F); ++ GL11.glTranslatef(0.0F, -0.125F, 0.0F); + } + + this.func_82422_c(); +@@ -196,49 +214,61 @@ + GL11.glRotatef(-100.0F, 1.0F, 0.0F, 0.0F); + GL11.glRotatef(45.0F, 0.0F, 1.0F, 0.0F); + } else { +- var6 = 6.0F / 16.0F; +- GL11.glTranslatef(0.25F, 3.0F / 16.0F, -(3.0F / 16.0F)); ++ var6 = 0.375F; ++ GL11.glTranslatef(0.25F, 0.1875F, -0.1875F); + GL11.glScalef(var6, var6, var6); + GL11.glRotatef(60.0F, 0.0F, 0.0F, 1.0F); + GL11.glRotatef(-90.0F, 1.0F, 0.0F, 0.0F); + GL11.glRotatef(20.0F, 0.0F, 0.0F, 1.0F); + } + +- this.renderManager.itemRenderer.renderItem(var1, var4, 0); +- if(var4.getItem().requiresMultipleRenderPasses()) { +- this.renderManager.itemRenderer.renderItem(var1, var4, 1); ++ this.renderManager.itemRenderer.renderItem(par1EntityLiving, var4, 0); ++ ++ if (var4.getItem().requiresMultipleRenderPasses()) { ++ this.renderManager.itemRenderer.renderItem(par1EntityLiving, var4, 1); + } + + GL11.glPopMatrix(); + } +- + } + + protected void func_82422_c() { +- GL11.glTranslatef(0.0F, 3.0F / 16.0F, 0.0F); +- } +- +- protected void func_82439_b(EntityLivingBase var1, int var2, float var3) { +- this.func_130013_c((EntityLiving)var1, var2, var3); +- } +- +- protected int shouldRenderPass(EntityLivingBase var1, int var2, float var3) { +- return this.func_130006_a((EntityLiving)var1, var2, var3); +- } +- +- protected void renderEquippedItems(EntityLivingBase var1, float var2) { +- this.func_130005_c((EntityLiving)var1, var2); +- } +- +- public void renderPlayer(EntityLivingBase var1, double var2, double var4, double var6, float var8, float var9) { +- this.doRenderLiving((EntityLiving)var1, var2, var4, var6, var8, var9); +- } +- +- protected ResourceLocation getEntityTexture(Entity var1) { +- return this.func_110856_a((EntityLiving)var1); +- } +- +- public void doRender(Entity var1, double var2, double var4, double var6, float var8, float var9) { +- this.doRenderLiving((EntityLiving)var1, var2, var4, var6, var8, var9); ++ GL11.glTranslatef(0.0F, 0.1875F, 0.0F); ++ } ++ ++ protected void func_82439_b(EntityLivingBase par1EntityLivingBase, int par2, float par3) { ++ this.func_130013_c((EntityLiving)par1EntityLivingBase, par2, par3); ++ } ++ ++ /** ++ * Queries whether should render the specified pass or not. ++ */ ++ protected int shouldRenderPass(EntityLivingBase par1EntityLivingBase, int par2, float par3) { ++ return this.func_130006_a((EntityLiving)par1EntityLivingBase, par2, par3); ++ } ++ ++ protected void renderEquippedItems(EntityLivingBase par1EntityLivingBase, float par2) { ++ this.func_130005_c((EntityLiving)par1EntityLivingBase, par2); ++ } ++ ++ public void renderPlayer(EntityLivingBase par1EntityLivingBase, double par2, double par4, double par6, float par8, float par9) { ++ this.doRenderLiving((EntityLiving)par1EntityLivingBase, par2, par4, par6, par8, par9); ++ } ++ ++ /** ++ * Returns the location of an entity's texture. Doesn't seem to be called unless you call Render.bindEntityTexture. ++ */ ++ protected ResourceLocation getEntityTexture(Entity par1Entity) { ++ return this.func_110856_a((EntityLiving)par1Entity); ++ } ++ ++ /** ++ * Actually renders the given argument. This is a synthetic bridge method, always casting down its argument and then ++ * handing it off to a worker function which does the actual work. In all probabilty, the class Render is generic ++ * (Render=0, all block faces will be rendered using this texture index ++ */ + private Icon overrideBlockTexture; ++ ++ /** ++ * Set to true if the texture should be flipped horizontally during render*Face ++ */ + private boolean flipTexture; ++ ++ /** ++ * If true, renders all faces on all blocks rather than using the logic in Block.shouldSideBeRendered. Unused. ++ */ + private boolean renderAllFaces; ++ ++ /** Fancy grass side matching biome */ + public static boolean fancyGrass = true; + public boolean useInventoryTint = true; ++ ++ /** The minimum X value for rendering (default 0.0). */ + private double renderMinX; ++ ++ /** The maximum X value for rendering (default 1.0). */ + private double renderMaxX; ++ ++ /** The minimum Y value for rendering (default 0.0). */ + private double renderMinY; ++ ++ /** The maximum Y value for rendering (default 1.0). */ + private double renderMaxY; ++ ++ /** The minimum Z value for rendering (default 0.0). */ + private double renderMinZ; ++ ++ /** The maximum Z value for rendering (default 1.0). */ + private double renderMaxZ; ++ ++ /** ++ * Set by overrideBlockBounds, to keep this class from changing the visual bounding box. ++ */ + private boolean lockBlockBounds; + private boolean partialRenderBounds; + private final Minecraft minecraftRB; +@@ -25,66 +69,224 @@ + private int uvRotateNorth; + private int uvRotateTop; + private int uvRotateBottom; ++ ++ /** Whether ambient occlusion is enabled or not */ + private boolean enableAO; ++ ++ /** ++ * Used as a scratch variable for ambient occlusion on the north/bottom/east corner. ++ */ + private float aoLightValueScratchXYZNNN; ++ ++ /** ++ * Used as a scratch variable for ambient occlusion between the bottom face and the north face. ++ */ + private float aoLightValueScratchXYNN; ++ ++ /** ++ * Used as a scratch variable for ambient occlusion on the north/bottom/west corner. ++ */ + private float aoLightValueScratchXYZNNP; ++ ++ /** ++ * Used as a scratch variable for ambient occlusion between the bottom face and the east face. ++ */ + private float aoLightValueScratchYZNN; ++ ++ /** ++ * Used as a scratch variable for ambient occlusion between the bottom face and the west face. ++ */ + private float aoLightValueScratchYZNP; ++ ++ /** ++ * Used as a scratch variable for ambient occlusion on the south/bottom/east corner. ++ */ + private float aoLightValueScratchXYZPNN; ++ ++ /** ++ * Used as a scratch variable for ambient occlusion between the bottom face and the south face. ++ */ + private float aoLightValueScratchXYPN; ++ ++ /** ++ * Used as a scratch variable for ambient occlusion on the south/bottom/west corner. ++ */ + private float aoLightValueScratchXYZPNP; ++ ++ /** ++ * Used as a scratch variable for ambient occlusion on the north/top/east corner. ++ */ + private float aoLightValueScratchXYZNPN; ++ ++ /** ++ * Used as a scratch variable for ambient occlusion between the top face and the north face. ++ */ + private float aoLightValueScratchXYNP; ++ ++ /** ++ * Used as a scratch variable for ambient occlusion on the north/top/west corner. ++ */ + private float aoLightValueScratchXYZNPP; ++ ++ /** ++ * Used as a scratch variable for ambient occlusion between the top face and the east face. ++ */ + private float aoLightValueScratchYZPN; ++ ++ /** ++ * Used as a scratch variable for ambient occlusion on the south/top/east corner. ++ */ + private float aoLightValueScratchXYZPPN; ++ ++ /** ++ * Used as a scratch variable for ambient occlusion between the top face and the south face. ++ */ + private float aoLightValueScratchXYPP; ++ ++ /** ++ * Used as a scratch variable for ambient occlusion between the top face and the west face. ++ */ + private float aoLightValueScratchYZPP; ++ ++ /** ++ * Used as a scratch variable for ambient occlusion on the south/top/west corner. ++ */ + private float aoLightValueScratchXYZPPP; ++ ++ /** ++ * Used as a scratch variable for ambient occlusion between the north face and the east face. ++ */ + private float aoLightValueScratchXZNN; ++ ++ /** ++ * Used as a scratch variable for ambient occlusion between the south face and the east face. ++ */ + private float aoLightValueScratchXZPN; ++ ++ /** ++ * Used as a scratch variable for ambient occlusion between the north face and the west face. ++ */ + private float aoLightValueScratchXZNP; ++ ++ /** ++ * Used as a scratch variable for ambient occlusion between the south face and the west face. ++ */ + private float aoLightValueScratchXZPP; ++ ++ /** Ambient occlusion brightness XYZNNN */ + private int aoBrightnessXYZNNN; ++ ++ /** Ambient occlusion brightness XYNN */ + private int aoBrightnessXYNN; ++ ++ /** Ambient occlusion brightness XYZNNP */ + private int aoBrightnessXYZNNP; ++ ++ /** Ambient occlusion brightness YZNN */ + private int aoBrightnessYZNN; ++ ++ /** Ambient occlusion brightness YZNP */ + private int aoBrightnessYZNP; ++ ++ /** Ambient occlusion brightness XYZPNN */ + private int aoBrightnessXYZPNN; ++ ++ /** Ambient occlusion brightness XYPN */ + private int aoBrightnessXYPN; ++ ++ /** Ambient occlusion brightness XYZPNP */ + private int aoBrightnessXYZPNP; ++ ++ /** Ambient occlusion brightness XYZNPN */ + private int aoBrightnessXYZNPN; ++ ++ /** Ambient occlusion brightness XYNP */ + private int aoBrightnessXYNP; ++ ++ /** Ambient occlusion brightness XYZNPP */ + private int aoBrightnessXYZNPP; ++ ++ /** Ambient occlusion brightness YZPN */ + private int aoBrightnessYZPN; ++ ++ /** Ambient occlusion brightness XYZPPN */ + private int aoBrightnessXYZPPN; ++ ++ /** Ambient occlusion brightness XYPP */ + private int aoBrightnessXYPP; ++ ++ /** Ambient occlusion brightness YZPP */ + private int aoBrightnessYZPP; ++ ++ /** Ambient occlusion brightness XYZPPP */ + private int aoBrightnessXYZPPP; ++ ++ /** Ambient occlusion brightness XZNN */ + private int aoBrightnessXZNN; ++ ++ /** Ambient occlusion brightness XZPN */ + private int aoBrightnessXZPN; ++ ++ /** Ambient occlusion brightness XZNP */ + private int aoBrightnessXZNP; ++ ++ /** Ambient occlusion brightness XZPP */ + private int aoBrightnessXZPP; ++ ++ /** Brightness top left */ + private int brightnessTopLeft; ++ ++ /** Brightness bottom left */ + private int brightnessBottomLeft; ++ ++ /** Brightness bottom right */ + private int brightnessBottomRight; ++ ++ /** Brightness top right */ + private int brightnessTopRight; ++ ++ /** Red color value for the top left corner */ + private float colorRedTopLeft; ++ ++ /** Red color value for the bottom left corner */ + private float colorRedBottomLeft; ++ ++ /** Red color value for the bottom right corner */ + private float colorRedBottomRight; ++ ++ /** Red color value for the top right corner */ + private float colorRedTopRight; ++ ++ /** Green color value for the top left corner */ + private float colorGreenTopLeft; ++ ++ /** Green color value for the bottom left corner */ + private float colorGreenBottomLeft; ++ ++ /** Green color value for the bottom right corner */ + private float colorGreenBottomRight; ++ ++ /** Green color value for the top right corner */ + private float colorGreenTopRight; ++ ++ /** Blue color value for the top left corner */ + private float colorBlueTopLeft; ++ ++ /** Blue color value for the bottom left corner */ + private float colorBlueBottomLeft; ++ ++ /** Blue color value for the bottom right corner */ + private float colorBlueBottomRight; ++ ++ /** Blue color value for the top right corner */ + private float colorBlueTopRight; + +- public RenderBlocks(IBlockAccess var1) { +- this.blockAccess = var1; ++ // Spout Start ++ public short[] customIds = null; ++ // Spout End ++ ++ public RenderBlocks(IBlockAccess par1IBlockAccess) { ++ this.blockAccess = par1IBlockAccess; + this.minecraftRB = Minecraft.getMinecraft(); + } + +@@ -92,10 +294,16 @@ + this.minecraftRB = Minecraft.getMinecraft(); + } + +- public void setOverrideBlockTexture(Icon var1) { +- this.overrideBlockTexture = var1; ++ /** ++ * Sets overrideBlockTexture ++ */ ++ public void setOverrideBlockTexture(Icon par1Icon) { ++ this.overrideBlockTexture = par1Icon; + } + ++ /** ++ * Clear override block texture ++ */ + public void clearOverrideBlockTexture() { + this.overrideBlockTexture = null; + } +@@ -104,93 +312,118 @@ + return this.overrideBlockTexture != null; + } + +- public void setRenderBounds(double var1, double var3, double var5, double var7, double var9, double var11) { +- if(!this.lockBlockBounds) { +- this.renderMinX = var1; +- this.renderMaxX = var7; +- this.renderMinY = var3; +- this.renderMaxY = var9; +- this.renderMinZ = var5; +- this.renderMaxZ = var11; +- this.partialRenderBounds = this.minecraftRB.gameSettings.ambientOcclusion >= 2 && (this.renderMinX > 0.0D || this.renderMaxX < 1.0D || this.renderMinY > 0.0D || this.renderMaxY < 1.0D || this.renderMinZ > 0.0D || this.renderMaxZ < 1.0D); +- } +- +- } +- +- public void setRenderBoundsFromBlock(Block var1) { +- if(!this.lockBlockBounds) { +- this.renderMinX = var1.getMinX(); +- this.renderMaxX = var1.getBlockBoundsMaxX(); +- this.renderMinY = var1.getBlockBoundsMinY(); +- this.renderMaxY = var1.getBlockBoundsMaxY(); +- this.renderMinZ = var1.getBlockBoundsMinZ(); +- this.renderMaxZ = var1.getBlockBoundsMaxZ(); +- this.partialRenderBounds = this.minecraftRB.gameSettings.ambientOcclusion >= 2 && (this.renderMinX > 0.0D || this.renderMaxX < 1.0D || this.renderMinY > 0.0D || this.renderMaxY < 1.0D || this.renderMinZ > 0.0D || this.renderMaxZ < 1.0D); +- } +- +- } +- +- public void overrideBlockBounds(double var1, double var3, double var5, double var7, double var9, double var11) { +- this.renderMinX = var1; +- this.renderMaxX = var7; +- this.renderMinY = var3; +- this.renderMaxY = var9; +- this.renderMinZ = var5; +- this.renderMaxZ = var11; ++ /** ++ * Sets the bounding box for the block to draw in, e.g. 0.25-0.75 on all axes for a half-size, centered block. ++ */ ++ public void setRenderBounds(double par1, double par3, double par5, double par7, double par9, double par11) { ++ if (!this.lockBlockBounds) { ++ this.renderMinX = par1; ++ this.renderMaxX = par7; ++ this.renderMinY = par3; ++ this.renderMaxY = par9; ++ this.renderMinZ = par5; ++ this.renderMaxZ = par11; ++ this.partialRenderBounds = this.minecraftRB.gameSettings.ambientOcclusion >= 2 && (this.renderMinX > 0.0D || this.renderMaxX < 1.0D || this.renderMinY > 0.0D || this.renderMaxY < 1.0D || this.renderMinZ > 0.0D || this.renderMaxZ < 1.0D); ++ } ++ } ++ ++ /** ++ * Like setRenderBounds, but automatically pulling the bounds from the given Block. ++ */ ++ public void setRenderBoundsFromBlock(Block par1Block) { ++ if (!this.lockBlockBounds) { ++ this.renderMinX = par1Block.getBlockBoundsMinX(); ++ this.renderMaxX = par1Block.getBlockBoundsMaxX(); ++ this.renderMinY = par1Block.getBlockBoundsMinY(); ++ this.renderMaxY = par1Block.getBlockBoundsMaxY(); ++ this.renderMinZ = par1Block.getBlockBoundsMinZ(); ++ this.renderMaxZ = par1Block.getBlockBoundsMaxZ(); ++ this.partialRenderBounds = this.minecraftRB.gameSettings.ambientOcclusion >= 2 && (this.renderMinX > 0.0D || this.renderMaxX < 1.0D || this.renderMinY > 0.0D || this.renderMaxY < 1.0D || this.renderMinZ > 0.0D || this.renderMaxZ < 1.0D); ++ } ++ } ++ ++ /** ++ * Like setRenderBounds, but locks the values so that RenderBlocks won't change them. If you use this, you must call ++ * unlockBlockBounds after you finish rendering! ++ */ ++ public void overrideBlockBounds(double par1, double par3, double par5, double par7, double par9, double par11) { ++ this.renderMinX = par1; ++ this.renderMaxX = par7; ++ this.renderMinY = par3; ++ this.renderMaxY = par9; ++ this.renderMinZ = par5; ++ this.renderMaxZ = par11; + this.lockBlockBounds = true; + this.partialRenderBounds = this.minecraftRB.gameSettings.ambientOcclusion >= 2 && (this.renderMinX > 0.0D || this.renderMaxX < 1.0D || this.renderMinY > 0.0D || this.renderMaxY < 1.0D || this.renderMinZ > 0.0D || this.renderMaxZ < 1.0D); + } + ++ /** ++ * Unlocks the visual bounding box so that RenderBlocks can change it again. ++ */ + public void unlockBlockBounds() { + this.lockBlockBounds = false; + } + +- public void renderBlockUsingTexture(Block var1, int var2, int var3, int var4, Icon var5) { +- this.setOverrideBlockTexture(var5); +- this.renderBlockByRenderType(var1, var2, var3, var4); ++ /** ++ * Renders a block using the given texture instead of the block's own default texture ++ */ ++ public void renderBlockUsingTexture(Block par1Block, int par2, int par3, int par4, Icon par5Icon) { ++ this.setOverrideBlockTexture(par5Icon); ++ this.renderBlockByRenderType(par1Block, par2, par3, par4); + this.clearOverrideBlockTexture(); + } + +- public void renderBlockAllFaces(Block var1, int var2, int var3, int var4) { ++ /** ++ * Render all faces of a block ++ */ ++ public void renderBlockAllFaces(Block par1Block, int par2, int par3, int par4) { + this.renderAllFaces = true; +- this.renderBlockByRenderType(var1, var2, var3, var4); ++ this.renderBlockByRenderType(par1Block, par2, par3, par4); + this.renderAllFaces = false; + } + +- public boolean renderBlockByRenderType(Block var1, int var2, int var3, int var4) { +- int var5 = var1.getRenderType(); +- if(var5 == -1) { ++ /** ++ * Renders the block at the given coordinates using the block's rendering type ++ */ ++ public boolean renderBlockByRenderType(Block par1Block, int par2, int par3, int par4) { ++ int var5 = par1Block.getRenderType(); ++ ++ if (var5 == -1) { + return false; + } else { +- var1.setBlockBoundsBasedOnState(this.blockAccess, var2, var3, var4); +- this.setRenderBoundsFromBlock(var1); +- return var5 == 0 ? this.renderStandardBlock(var1, var2, var3, var4) : (var5 == 4 ? this.renderBlockFluids(var1, var2, var3, var4) : (var5 == 31 ? this.renderBlockLog(var1, var2, var3, var4) : (var5 == 1 ? this.renderCrossedSquares(var1, var2, var3, var4) : (var5 == 2 ? this.renderBlockTorch(var1, var2, var3, var4) : (var5 == 20 ? this.renderBlockVine(var1, var2, var3, var4) : (var5 == 11 ? this.renderBlockFence((BlockFence)var1, var2, var3, var4) : (var5 == 39 ? this.renderBlockQuartz(var1, var2, var3, var4) : (var5 == 5 ? this.renderBlockRedstoneWire(var1, var2, var3, var4) : (var5 == 13 ? this.renderBlockCactus(var1, var2, var3, var4) : (var5 == 9 ? this.renderBlockMinecartTrack((BlockRailBase)var1, var2, var3, var4) : (var5 == 19 ? this.renderBlockStem(var1, var2, var3, var4) : (var5 == 23 ? this.renderBlockLilyPad(var1, var2, var3, var4) : (var5 == 6 ? this.renderBlockCrops(var1, var2, var3, var4) : (var5 == 3 ? this.renderBlockFire((BlockFire)var1, var2, var3, var4) : (var5 == 8 ? this.renderBlockLadder(var1, var2, var3, var4) : (var5 == 7 ? this.renderBlockDoor(var1, var2, var3, var4) : (var5 == 10 ? this.renderBlockStairs((BlockStairs)var1, var2, var3, var4) : (var5 == 27 ? this.renderBlockDragonEgg((BlockDragonEgg)var1, var2, var3, var4) : (var5 == 32 ? this.renderBlockWall((BlockWall)var1, var2, var3, var4) : (var5 == 12 ? this.renderBlockLever(var1, var2, var3, var4) : (var5 == 29 ? this.renderBlockTripWireSource(var1, var2, var3, var4) : (var5 == 30 ? this.renderBlockTripWire(var1, var2, var3, var4) : (var5 == 14 ? this.renderBlockBed(var1, var2, var3, var4) : (var5 == 15 ? this.renderBlockRepeater((BlockRedstoneRepeater)var1, var2, var3, var4) : (var5 == 36 ? this.renderBlockRedstoneLogic((BlockRedstoneLogic)var1, var2, var3, var4) : (var5 == 37 ? this.renderBlockComparator((BlockComparator)var1, var2, var3, var4) : (var5 == 16 ? this.renderPistonBase(var1, var2, var3, var4, false) : (var5 == 17 ? this.renderPistonExtension(var1, var2, var3, var4, true) : (var5 == 18 ? this.renderBlockPane((BlockPane)var1, var2, var3, var4) : (var5 == 21 ? this.renderBlockFenceGate((BlockFenceGate)var1, var2, var3, var4) : (var5 == 24 ? this.renderBlockCauldron((BlockCauldron)var1, var2, var3, var4) : (var5 == 33 ? this.renderBlockFlowerpot((BlockFlowerPot)var1, var2, var3, var4) : (var5 == 35 ? this.renderBlockAnvil((BlockAnvil)var1, var2, var3, var4) : (var5 == 25 ? this.renderBlockBrewingStand((BlockBrewingStand)var1, var2, var3, var4) : (var5 == 26 ? this.renderBlockEndPortalFrame((BlockEndPortalFrame)var1, var2, var3, var4) : (var5 == 28 ? this.renderBlockCocoa((BlockCocoa)var1, var2, var3, var4) : (var5 == 34 ? this.renderBlockBeacon((BlockBeacon)var1, var2, var3, var4) : (var5 == 38 ? this.renderBlockHopper((BlockHopper)var1, var2, var3, var4) : false)))))))))))))))))))))))))))))))))))))); ++ par1Block.setBlockBoundsBasedOnState(this.blockAccess, par2, par3, par4); ++ this.setRenderBoundsFromBlock(par1Block); ++ return var5 == 0 ? this.renderStandardBlock(par1Block, par2, par3, par4) : (var5 == 4 ? this.renderBlockFluids(par1Block, par2, par3, par4) : (var5 == 31 ? this.renderBlockLog(par1Block, par2, par3, par4) : (var5 == 1 ? this.renderCrossedSquares(par1Block, par2, par3, par4) : (var5 == 2 ? this.renderBlockTorch(par1Block, par2, par3, par4) : (var5 == 20 ? this.renderBlockVine(par1Block, par2, par3, par4) : (var5 == 11 ? this.renderBlockFence((BlockFence)par1Block, par2, par3, par4) : (var5 == 39 ? this.renderBlockQuartz(par1Block, par2, par3, par4) : (var5 == 5 ? this.renderBlockRedstoneWire(par1Block, par2, par3, par4) : (var5 == 13 ? this.renderBlockCactus(par1Block, par2, par3, par4) : (var5 == 9 ? this.renderBlockMinecartTrack((BlockRailBase)par1Block, par2, par3, par4) : (var5 == 19 ? this.renderBlockStem(par1Block, par2, par3, par4) : (var5 == 23 ? this.renderBlockLilyPad(par1Block, par2, par3, par4) : (var5 == 6 ? this.renderBlockCrops(par1Block, par2, par3, par4) : (var5 == 3 ? this.renderBlockFire((BlockFire)par1Block, par2, par3, par4) : (var5 == 8 ? this.renderBlockLadder(par1Block, par2, par3, par4) : (var5 == 7 ? this.renderBlockDoor(par1Block, par2, par3, par4) : (var5 == 10 ? this.renderBlockStairs((BlockStairs)par1Block, par2, par3, par4) : (var5 == 27 ? this.renderBlockDragonEgg((BlockDragonEgg)par1Block, par2, par3, par4) : (var5 == 32 ? this.renderBlockWall((BlockWall)par1Block, par2, par3, par4) : (var5 == 12 ? this.renderBlockLever(par1Block, par2, par3, par4) : (var5 == 29 ? this.renderBlockTripWireSource(par1Block, par2, par3, par4) : (var5 == 30 ? this.renderBlockTripWire(par1Block, par2, par3, par4) : (var5 == 14 ? this.renderBlockBed(par1Block, par2, par3, par4) : (var5 == 15 ? this.renderBlockRepeater((BlockRedstoneRepeater)par1Block, par2, par3, par4) : (var5 == 36 ? this.renderBlockRedstoneLogic((BlockRedstoneLogic)par1Block, par2, par3, par4) : (var5 == 37 ? this.renderBlockComparator((BlockComparator)par1Block, par2, par3, par4) : (var5 == 16 ? this.renderPistonBase(par1Block, par2, par3, par4, false) : (var5 == 17 ? this.renderPistonExtension(par1Block, par2, par3, par4, true) : (var5 == 18 ? this.renderBlockPane((BlockPane)par1Block, par2, par3, par4) : (var5 == 21 ? this.renderBlockFenceGate((BlockFenceGate)par1Block, par2, par3, par4) : (var5 == 24 ? this.renderBlockCauldron((BlockCauldron)par1Block, par2, par3, par4) : (var5 == 33 ? this.renderBlockFlowerpot((BlockFlowerPot)par1Block, par2, par3, par4) : (var5 == 35 ? this.renderBlockAnvil((BlockAnvil)par1Block, par2, par3, par4) : (var5 == 25 ? this.renderBlockBrewingStand((BlockBrewingStand)par1Block, par2, par3, par4) : (var5 == 26 ? this.renderBlockEndPortalFrame((BlockEndPortalFrame)par1Block, par2, par3, par4) : (var5 == 28 ? this.renderBlockCocoa((BlockCocoa)par1Block, par2, par3, par4) : (var5 == 34 ? this.renderBlockBeacon((BlockBeacon)par1Block, par2, par3, par4) : (var5 == 38 ? this.renderBlockHopper((BlockHopper)par1Block, par2, par3, par4) : false)))))))))))))))))))))))))))))))))))))); + } + } + +- private boolean renderBlockEndPortalFrame(BlockEndPortalFrame var1, int var2, int var3, int var4) { +- int var5 = this.blockAccess.getBlockMetadata(var2, var3, var4); ++ /** ++ * Render BlockEndPortalFrame ++ */ ++ private boolean renderBlockEndPortalFrame(BlockEndPortalFrame par1BlockEndPortalFrame, int par2, int par3, int par4) { ++ int var5 = this.blockAccess.getBlockMetadata(par2, par3, par4); + int var6 = var5 & 3; +- if(var6 == 0) { ++ ++ if (var6 == 0) { + this.uvRotateTop = 3; +- } else if(var6 == 3) { ++ } else if (var6 == 3) { + this.uvRotateTop = 1; +- } else if(var6 == 1) { ++ } else if (var6 == 1) { + this.uvRotateTop = 2; + } + +- if(!BlockEndPortalFrame.isEnderEyeInserted(var5)) { ++ if (!BlockEndPortalFrame.isEnderEyeInserted(var5)) { + this.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 0.8125D, 1.0D); +- this.renderStandardBlock(var1, var2, var3, var4); ++ this.renderStandardBlock(par1BlockEndPortalFrame, par2, par3, par4); + this.uvRotateTop = 0; + return true; + } else { + this.renderAllFaces = true; + this.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 0.8125D, 1.0D); +- this.renderStandardBlock(var1, var2, var3, var4); +- this.setOverrideBlockTexture(var1.func_94398_p()); ++ this.renderStandardBlock(par1BlockEndPortalFrame, par2, par3, par4); ++ this.setOverrideBlockTexture(par1BlockEndPortalFrame.func_94398_p()); + this.setRenderBounds(0.25D, 0.8125D, 0.25D, 0.75D, 1.0D, 0.75D); +- this.renderStandardBlock(var1, var2, var3, var4); ++ this.renderStandardBlock(par1BlockEndPortalFrame, par2, par3, par4); + this.renderAllFaces = false; + this.clearOverrideBlockTexture(); + this.uvRotateTop = 0; +@@ -198,149 +431,176 @@ + } + } + +- private boolean renderBlockBed(Block var1, int var2, int var3, int var4) { ++ /** ++ * render a bed at the given coordinates ++ */ ++ private boolean renderBlockBed(Block par1Block, int par2, int par3, int par4) { + Tessellator var5 = Tessellator.instance; +- int var6 = this.blockAccess.getBlockMetadata(var2, var3, var4); ++ int var6 = this.blockAccess.getBlockMetadata(par2, par3, par4); + int var7 = BlockBed.getDirection(var6); + boolean var8 = BlockBed.isBlockHeadOfBed(var6); + float var9 = 0.5F; + float var10 = 1.0F; + float var11 = 0.8F; + float var12 = 0.6F; +- int var25 = var1.getMixedBrightnessForBlock(this.blockAccess, var2, var3, var4); ++ int var25 = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2, par3, par4); + var5.setBrightness(var25); + var5.setColorOpaque_F(var9, var9, var9); +- Icon var27 = this.getBlockIcon(var1, this.blockAccess, var2, var3, var4, 0); +- double var28 = (double)var27.getMinU(); +- double var30 = (double)var27.getMaxU(); +- double var32 = (double)var27.getMinV(); +- double var34 = (double)var27.getMaxV(); +- double var36 = (double)var2 + this.renderMinX; +- double var38 = (double)var2 + this.renderMaxX; +- double var40 = (double)var3 + this.renderMinY + 0.1875D; +- double var42 = (double)var4 + this.renderMinZ; +- double var44 = (double)var4 + this.renderMaxZ; +- var5.addVertexWithUV(var36, var40, var44, var28, var34); +- var5.addVertexWithUV(var36, var40, var42, var28, var32); +- var5.addVertexWithUV(var38, var40, var42, var30, var32); +- var5.addVertexWithUV(var38, var40, var44, var30, var34); +- var5.setBrightness(var1.getMixedBrightnessForBlock(this.blockAccess, var2, var3 + 1, var4)); +- var5.setColorOpaque_F(var10, var10, var10); +- var27 = this.getBlockIcon(var1, this.blockAccess, var2, var3, var4, 1); +- var28 = (double)var27.getMinU(); +- var30 = (double)var27.getMaxU(); +- var32 = (double)var27.getMinV(); +- var34 = (double)var27.getMaxV(); +- var36 = var28; +- var38 = var30; +- var40 = var32; +- var42 = var32; +- var44 = var28; +- double var46 = var30; +- double var48 = var34; +- double var50 = var34; +- if(var7 == 0) { +- var38 = var28; +- var40 = var34; +- var44 = var30; +- var50 = var32; +- } else if(var7 == 2) { +- var36 = var30; +- var42 = var34; +- var46 = var28; +- var48 = var32; +- } else if(var7 == 3) { +- var36 = var30; +- var42 = var34; +- var46 = var28; +- var48 = var32; +- var38 = var28; +- var40 = var34; +- var44 = var30; +- var50 = var32; +- } +- +- double var52 = (double)var2 + this.renderMinX; +- double var54 = (double)var2 + this.renderMaxX; +- double var56 = (double)var3 + this.renderMaxY; +- double var58 = (double)var4 + this.renderMinZ; +- double var60 = (double)var4 + this.renderMaxZ; +- var5.addVertexWithUV(var54, var56, var60, var44, var48); +- var5.addVertexWithUV(var54, var56, var58, var36, var40); +- var5.addVertexWithUV(var52, var56, var58, var38, var42); +- var5.addVertexWithUV(var52, var56, var60, var46, var50); +- int var62 = Direction.directionToFacing[var7]; +- if(var8) { +- var62 = Direction.directionToFacing[Direction.rotateOpposite[var7]]; +- } +- +- byte var63 = 4; +- switch(var7) { +- case 0: +- var63 = 5; +- break; +- case 1: +- var63 = 3; +- case 2: +- default: +- break; +- case 3: +- var63 = 2; +- } +- +- if(var62 != 2 && (this.renderAllFaces || var1.shouldSideBeRendered(this.blockAccess, var2, var3, var4 - 1, 2))) { +- var5.setBrightness(this.renderMinZ > 0.0D ? var25 : var1.getMixedBrightnessForBlock(this.blockAccess, var2, var3, var4 - 1)); +- var5.setColorOpaque_F(var11, var11, var11); +- this.flipTexture = var63 == 2; +- this.renderFaceZNeg(var1, (double)var2, (double)var3, (double)var4, this.getBlockIcon(var1, this.blockAccess, var2, var3, var4, 2)); +- } +- +- if(var62 != 3 && (this.renderAllFaces || var1.shouldSideBeRendered(this.blockAccess, var2, var3, var4 + 1, 3))) { +- var5.setBrightness(this.renderMaxZ < 1.0D ? var25 : var1.getMixedBrightnessForBlock(this.blockAccess, var2, var3, var4 + 1)); +- var5.setColorOpaque_F(var11, var11, var11); +- this.flipTexture = var63 == 3; +- this.renderFaceZPos(var1, (double)var2, (double)var3, (double)var4, this.getBlockIcon(var1, this.blockAccess, var2, var3, var4, 3)); +- } +- +- if(var62 != 4 && (this.renderAllFaces || var1.shouldSideBeRendered(this.blockAccess, var2 - 1, var3, var4, 4))) { +- var5.setBrightness(this.renderMinZ > 0.0D ? var25 : var1.getMixedBrightnessForBlock(this.blockAccess, var2 - 1, var3, var4)); +- var5.setColorOpaque_F(var12, var12, var12); +- this.flipTexture = var63 == 4; +- this.renderFaceXNeg(var1, (double)var2, (double)var3, (double)var4, this.getBlockIcon(var1, this.blockAccess, var2, var3, var4, 4)); +- } +- +- if(var62 != 5 && (this.renderAllFaces || var1.shouldSideBeRendered(this.blockAccess, var2 + 1, var3, var4, 5))) { +- var5.setBrightness(this.renderMaxZ < 1.0D ? var25 : var1.getMixedBrightnessForBlock(this.blockAccess, var2 + 1, var3, var4)); +- var5.setColorOpaque_F(var12, var12, var12); +- this.flipTexture = var63 == 5; +- this.renderFaceXPos(var1, (double)var2, (double)var3, (double)var4, this.getBlockIcon(var1, this.blockAccess, var2, var3, var4, 5)); +- } +- +- this.flipTexture = false; +- return true; ++ Icon var27 = this.getBlockIcon(par1Block, this.blockAccess, par2, par3, par4, 0); ++ var27 = CTMUtils.getTile(this, par1Block, par2, par3, par4, var27, var5); ++ ++ if (var27 == null) { ++ return false; ++ } else { ++ var5 = TessellatorUtils.getTessellator(var5, var27); ++ double var28 = (double)var27.getMinU(); ++ double var30 = (double)var27.getMaxU(); ++ double var32 = (double)var27.getMinV(); ++ double var34 = (double)var27.getMaxV(); ++ double var36 = (double)par2 + this.renderMinX; ++ double var38 = (double)par2 + this.renderMaxX; ++ double var40 = (double)par3 + this.renderMinY + 0.1875D; ++ double var42 = (double)par4 + this.renderMinZ; ++ double var44 = (double)par4 + this.renderMaxZ; ++ var5.addVertexWithUV(var36, var40, var44, var28, var34); ++ var5.addVertexWithUV(var36, var40, var42, var28, var32); ++ var5.addVertexWithUV(var38, var40, var42, var30, var32); ++ var5.addVertexWithUV(var38, var40, var44, var30, var34); ++ var5.setBrightness(par1Block.getMixedBrightnessForBlock(this.blockAccess, par2, par3 + 1, par4)); ++ var5.setColorOpaque_F(var10, var10, var10); ++ var27 = this.getBlockIcon(par1Block, this.blockAccess, par2, par3, par4, 1); ++ var27 = CTMUtils.getTile(this, par1Block, par2, par3, par4, var27, var5); ++ ++ if (var27 == null) { ++ return false; ++ } else { ++ var5 = TessellatorUtils.getTessellator(var5, var27); ++ var28 = (double)var27.getMinU(); ++ var30 = (double)var27.getMaxU(); ++ var32 = (double)var27.getMinV(); ++ var34 = (double)var27.getMaxV(); ++ var36 = var28; ++ var38 = var30; ++ var40 = var32; ++ var42 = var32; ++ var44 = var28; ++ double var46 = var30; ++ double var48 = var34; ++ double var50 = var34; ++ ++ if (var7 == 0) { ++ var38 = var28; ++ var40 = var34; ++ var44 = var30; ++ var50 = var32; ++ } else if (var7 == 2) { ++ var36 = var30; ++ var42 = var34; ++ var46 = var28; ++ var48 = var32; ++ } else if (var7 == 3) { ++ var36 = var30; ++ var42 = var34; ++ var46 = var28; ++ var48 = var32; ++ var38 = var28; ++ var40 = var34; ++ var44 = var30; ++ var50 = var32; ++ } ++ ++ double var52 = (double)par2 + this.renderMinX; ++ double var54 = (double)par2 + this.renderMaxX; ++ double var56 = (double)par3 + this.renderMaxY; ++ double var58 = (double)par4 + this.renderMinZ; ++ double var60 = (double)par4 + this.renderMaxZ; ++ var5.addVertexWithUV(var54, var56, var60, var44, var48); ++ var5.addVertexWithUV(var54, var56, var58, var36, var40); ++ var5.addVertexWithUV(var52, var56, var58, var38, var42); ++ var5.addVertexWithUV(var52, var56, var60, var46, var50); ++ int var62 = Direction.directionToFacing[var7]; ++ ++ if (var8) { ++ var62 = Direction.directionToFacing[Direction.rotateOpposite[var7]]; ++ } ++ ++ byte var63 = 4; ++ ++ switch (var7) { ++ case 0: ++ var63 = 5; ++ break; ++ ++ case 1: ++ var63 = 3; ++ ++ case 2: ++ default: ++ break; ++ ++ case 3: ++ var63 = 2; ++ } ++ ++ if (var62 != 2 && (this.renderAllFaces || RenderPass.shouldSideBeRendered(par1Block, this.blockAccess, par2, par3, par4 - 1, 2))) { ++ var5.setBrightness(this.renderMinZ > 0.0D ? var25 : par1Block.getMixedBrightnessForBlock(this.blockAccess, par2, par3, par4 - 1)); ++ var5.setColorOpaque_F(var11, var11, var11); ++ this.flipTexture = var63 == 2; ++ this.renderFaceZNeg(par1Block, (double)par2, (double)par3, (double)par4, this.getBlockIcon(par1Block, this.blockAccess, par2, par3, par4, 2)); ++ } ++ ++ if (var62 != 3 && (this.renderAllFaces || RenderPass.shouldSideBeRendered(par1Block, this.blockAccess, par2, par3, par4 + 1, 3))) { ++ var5.setBrightness(this.renderMaxZ < 1.0D ? var25 : par1Block.getMixedBrightnessForBlock(this.blockAccess, par2, par3, par4 + 1)); ++ var5.setColorOpaque_F(var11, var11, var11); ++ this.flipTexture = var63 == 3; ++ this.renderFaceZPos(par1Block, (double)par2, (double)par3, (double)par4, this.getBlockIcon(par1Block, this.blockAccess, par2, par3, par4, 3)); ++ } ++ ++ if (var62 != 4 && (this.renderAllFaces || RenderPass.shouldSideBeRendered(par1Block, this.blockAccess, par2 - 1, par3, par4, 4))) { ++ var5.setBrightness(this.renderMinZ > 0.0D ? var25 : par1Block.getMixedBrightnessForBlock(this.blockAccess, par2 - 1, par3, par4)); ++ var5.setColorOpaque_F(var12, var12, var12); ++ this.flipTexture = var63 == 4; ++ this.renderFaceXNeg(par1Block, (double)par2, (double)par3, (double)par4, this.getBlockIcon(par1Block, this.blockAccess, par2, par3, par4, 4)); ++ } ++ ++ if (var62 != 5 && (this.renderAllFaces || RenderPass.shouldSideBeRendered(par1Block, this.blockAccess, par2 + 1, par3, par4, 5))) { ++ var5.setBrightness(this.renderMaxZ < 1.0D ? var25 : par1Block.getMixedBrightnessForBlock(this.blockAccess, par2 + 1, par3, par4)); ++ var5.setColorOpaque_F(var12, var12, var12); ++ this.flipTexture = var63 == 5; ++ this.renderFaceXPos(par1Block, (double)par2, (double)par3, (double)par4, this.getBlockIcon(par1Block, this.blockAccess, par2, par3, par4, 5)); ++ } ++ ++ this.flipTexture = false; ++ return true; ++ } ++ } + } + +- private boolean renderBlockBrewingStand(BlockBrewingStand var1, int var2, int var3, int var4) { ++ /** ++ * Render BlockBrewingStand ++ */ ++ private boolean renderBlockBrewingStand(BlockBrewingStand par1BlockBrewingStand, int par2, int par3, int par4) { + this.setRenderBounds(0.4375D, 0.0D, 0.4375D, 0.5625D, 0.875D, 0.5625D); +- this.renderStandardBlock(var1, var2, var3, var4); +- this.setOverrideBlockTexture(var1.getBrewingStandIcon()); ++ this.renderStandardBlock(par1BlockBrewingStand, par2, par3, par4); ++ this.setOverrideBlockTexture(par1BlockBrewingStand.getBrewingStandIcon()); + this.renderAllFaces = true; + this.setRenderBounds(0.5625D, 0.0D, 0.3125D, 0.9375D, 0.125D, 0.6875D); +- this.renderStandardBlock(var1, var2, var3, var4); +- this.setRenderBounds(0.125D, 0.0D, 1.0D / 16.0D, 0.5D, 0.125D, 0.4375D); +- this.renderStandardBlock(var1, var2, var3, var4); ++ this.renderStandardBlock(par1BlockBrewingStand, par2, par3, par4); ++ this.setRenderBounds(0.125D, 0.0D, 0.0625D, 0.5D, 0.125D, 0.4375D); ++ this.renderStandardBlock(par1BlockBrewingStand, par2, par3, par4); + this.setRenderBounds(0.125D, 0.0D, 0.5625D, 0.5D, 0.125D, 0.9375D); +- this.renderStandardBlock(var1, var2, var3, var4); ++ this.renderStandardBlock(par1BlockBrewingStand, par2, par3, par4); + this.renderAllFaces = false; + this.clearOverrideBlockTexture(); + Tessellator var5 = Tessellator.instance; +- var5.setBrightness(var1.getMixedBrightnessForBlock(this.blockAccess, var2, var3, var4)); ++ var5.setBrightness(par1BlockBrewingStand.getMixedBrightnessForBlock(this.blockAccess, par2, par3, par4)); + float var6 = 1.0F; +- int var7 = var1.colorMultiplier(this.blockAccess, var2, var3, var4); ++ int var7 = par1BlockBrewingStand.colorMultiplier(this.blockAccess, par2, par3, par4); + float var8 = (float)(var7 >> 16 & 255) / 255.0F; + float var9 = (float)(var7 >> 8 & 255) / 255.0F; + float var10 = (float)(var7 & 255) / 255.0F; +- if(EntityRenderer.anaglyphEnable) { ++ ++ if (EntityRenderer.anaglyphEnable) { + float var11 = (var8 * 30.0F + var9 * 59.0F + var10 * 11.0F) / 100.0F; + float var12 = (var8 * 30.0F + var9 * 70.0F) / 100.0F; + float var13 = (var8 * 30.0F + var10 * 70.0F) / 100.0F; +@@ -350,52 +610,65 @@ + } + + var5.setColorOpaque_F(var6 * var8, var6 * var9, var6 * var10); +- Icon var32 = this.getBlockIconFromSideAndMetadata(var1, 0, 0); +- if(this.hasOverrideBlockTexture()) { ++ Icon var32 = this.getBlockIconFromSideAndMetadata(par1BlockBrewingStand, 0, 0); ++ ++ if (this.hasOverrideBlockTexture()) { + var32 = this.overrideBlockTexture; + } + +- double var33 = (double)var32.getMinV(); +- double var14 = (double)var32.getMaxV(); +- int var16 = this.blockAccess.getBlockMetadata(var2, var3, var4); +- +- for(int var17 = 0; var17 < 3; ++var17) { +- double var18 = (double)var17 * Math.PI * 2.0D / 3.0D + Math.PI * 0.5D; +- double var20 = (double)var32.getInterpolatedU(8.0D); +- double var22 = (double)var32.getMaxU(); +- if((var16 & 1 << var17) != 0) { +- var22 = (double)var32.getMinU(); ++ var32 = CTMUtils.getTile(this, par1BlockBrewingStand, par2, par3, par4, var32, var5); ++ ++ if (var32 == null) { ++ return false; ++ } else { ++ var5 = TessellatorUtils.getTessellator(var5, var32); ++ double var33 = (double)var32.getMinV(); ++ double var14 = (double)var32.getMaxV(); ++ int var16 = this.blockAccess.getBlockMetadata(par2, par3, par4); ++ ++ for (int var17 = 0; var17 < 3; ++var17) { ++ double var18 = (double)var17 * Math.PI * 2.0D / 3.0D + (Math.PI / 2D); ++ double var20 = (double)var32.getInterpolatedU(8.0D); ++ double var22 = (double)var32.getMaxU(); ++ ++ if ((var16 & 1 << var17) != 0) { ++ var22 = (double)var32.getMinU(); ++ } ++ ++ double var24 = (double)par2 + 0.5D; ++ double var26 = (double)par2 + 0.5D + Math.sin(var18) * 8.0D / 16.0D; ++ double var28 = (double)par4 + 0.5D; ++ double var30 = (double)par4 + 0.5D + Math.cos(var18) * 8.0D / 16.0D; ++ var5.addVertexWithUV(var24, (double)(par3 + 1), var28, var20, var33); ++ var5.addVertexWithUV(var24, (double)(par3 + 0), var28, var20, var14); ++ var5.addVertexWithUV(var26, (double)(par3 + 0), var30, var22, var14); ++ var5.addVertexWithUV(var26, (double)(par3 + 1), var30, var22, var33); ++ var5.addVertexWithUV(var26, (double)(par3 + 1), var30, var22, var33); ++ var5.addVertexWithUV(var26, (double)(par3 + 0), var30, var22, var14); ++ var5.addVertexWithUV(var24, (double)(par3 + 0), var28, var20, var14); ++ var5.addVertexWithUV(var24, (double)(par3 + 1), var28, var20, var33); + } + +- double var24 = (double)var2 + 0.5D; +- double var26 = (double)var2 + 0.5D + Math.sin(var18) * 8.0D / 16.0D; +- double var28 = (double)var4 + 0.5D; +- double var30 = (double)var4 + 0.5D + Math.cos(var18) * 8.0D / 16.0D; +- var5.addVertexWithUV(var24, (double)(var3 + 1), var28, var20, var33); +- var5.addVertexWithUV(var24, (double)(var3 + 0), var28, var20, var14); +- var5.addVertexWithUV(var26, (double)(var3 + 0), var30, var22, var14); +- var5.addVertexWithUV(var26, (double)(var3 + 1), var30, var22, var33); +- var5.addVertexWithUV(var26, (double)(var3 + 1), var30, var22, var33); +- var5.addVertexWithUV(var26, (double)(var3 + 0), var30, var22, var14); +- var5.addVertexWithUV(var24, (double)(var3 + 0), var28, var20, var14); +- var5.addVertexWithUV(var24, (double)(var3 + 1), var28, var20, var33); ++ par1BlockBrewingStand.setBlockBoundsForItemRender(); ++ return true; + } +- +- var1.setBlockBoundsForItemRender(); +- return true; + } + +- private boolean renderBlockCauldron(BlockCauldron var1, int var2, int var3, int var4) { +- this.renderStandardBlock(var1, var2, var3, var4); ++ /** ++ * Render block cauldron ++ */ ++ private boolean renderBlockCauldron(BlockCauldron par1BlockCauldron, int par2, int par3, int par4) { ++ this.renderStandardBlock(par1BlockCauldron, par2, par3, par4); + Tessellator var5 = Tessellator.instance; +- var5.setBrightness(var1.getMixedBrightnessForBlock(this.blockAccess, var2, var3, var4)); ++ var5.setBrightness(par1BlockCauldron.getMixedBrightnessForBlock(this.blockAccess, par2, par3, par4)); + float var6 = 1.0F; +- int var7 = var1.colorMultiplier(this.blockAccess, var2, var3, var4); ++ int var7 = par1BlockCauldron.colorMultiplier(this.blockAccess, par2, par3, par4); + float var8 = (float)(var7 >> 16 & 255) / 255.0F; + float var9 = (float)(var7 >> 8 & 255) / 255.0F; + float var10 = (float)(var7 & 255) / 255.0F; + float var12; +- if(EntityRenderer.anaglyphEnable) { ++ ++ if (EntityRenderer.anaglyphEnable) { + float var11 = (var8 * 30.0F + var9 * 59.0F + var10 * 11.0F) / 100.0F; + var12 = (var8 * 30.0F + var9 * 70.0F) / 100.0F; + float var13 = (var8 * 30.0F + var10 * 70.0F) / 100.0F; +@@ -405,41 +678,49 @@ + } + + var5.setColorOpaque_F(var6 * var8, var6 * var9, var6 * var10); +- Icon var16 = var1.getBlockTextureFromSide(2); +- var12 = 2.0F / 16.0F; +- this.renderFaceXPos(var1, (double)((float)var2 - 1.0F + var12), (double)var3, (double)var4, var16); +- this.renderFaceXNeg(var1, (double)((float)var2 + 1.0F - var12), (double)var3, (double)var4, var16); +- this.renderFaceZPos(var1, (double)var2, (double)var3, (double)((float)var4 - 1.0F + var12), var16); +- this.renderFaceZNeg(var1, (double)var2, (double)var3, (double)((float)var4 + 1.0F - var12), var16); ++ Icon var16 = par1BlockCauldron.getBlockTextureFromSide(2); ++ var12 = 0.125F; ++ this.renderFaceXPos(par1BlockCauldron, (double)((float)par2 - 1.0F + var12), (double)par3, (double)par4, var16); ++ this.renderFaceXNeg(par1BlockCauldron, (double)((float)par2 + 1.0F - var12), (double)par3, (double)par4, var16); ++ this.renderFaceZPos(par1BlockCauldron, (double)par2, (double)par3, (double)((float)par4 - 1.0F + var12), var16); ++ this.renderFaceZNeg(par1BlockCauldron, (double)par2, (double)par3, (double)((float)par4 + 1.0F - var12), var16); + Icon var17 = BlockCauldron.getCauldronIcon("inner"); +- this.renderFaceYPos(var1, (double)var2, (double)((float)var3 - 1.0F + 0.25F), (double)var4, var17); +- this.renderFaceYNeg(var1, (double)var2, (double)((float)var3 + 1.0F - 12.0F / 16.0F), (double)var4, var17); +- int var14 = this.blockAccess.getBlockMetadata(var2, var3, var4); +- if(var14 > 0) { ++ this.renderFaceYPos(par1BlockCauldron, (double)par2, (double)((float)par3 - 1.0F + 0.25F), (double)par4, var17); ++ this.renderFaceYNeg(par1BlockCauldron, (double)par2, (double)((float)par3 + 1.0F - 0.75F), (double)par4, var17); ++ int var14 = this.blockAccess.getBlockMetadata(par2, par3, par4); ++ ++ if (var14 > 0) { + Icon var15 = BlockFluid.getFluidIcon("water_still"); +- if(var14 > 3) { ++ ColorizeBlock.computeWaterColor(); ++ var5.setColorOpaque_F(ColorizeBlock.waterColor[0], ColorizeBlock.waterColor[1], ColorizeBlock.waterColor[2]); ++ ++ if (var14 > 3) { + var14 = 3; + } + +- this.renderFaceYPos(var1, (double)var2, (double)((float)var3 - 1.0F + (6.0F + (float)var14 * 3.0F) / 16.0F), (double)var4, var15); ++ this.renderFaceYPos(par1BlockCauldron, (double)par2, (double)((float)par3 - 1.0F + (6.0F + (float)var14 * 3.0F) / 16.0F), (double)par4, var15); + } + + return true; + } + +- private boolean renderBlockFlowerpot(BlockFlowerPot var1, int var2, int var3, int var4) { +- this.renderStandardBlock(var1, var2, var3, var4); ++ /** ++ * Renders flower pot ++ */ ++ private boolean renderBlockFlowerpot(BlockFlowerPot par1BlockFlowerPot, int par2, int par3, int par4) { ++ this.renderStandardBlock(par1BlockFlowerPot, par2, par3, par4); + Tessellator var5 = Tessellator.instance; +- var5.setBrightness(var1.getMixedBrightnessForBlock(this.blockAccess, var2, var3, var4)); ++ var5.setBrightness(par1BlockFlowerPot.getMixedBrightnessForBlock(this.blockAccess, par2, par3, par4)); + float var6 = 1.0F; +- int var7 = var1.colorMultiplier(this.blockAccess, var2, var3, var4); +- Icon var8 = this.getBlockIconFromSide(var1, 0); ++ int var7 = par1BlockFlowerPot.colorMultiplier(this.blockAccess, par2, par3, par4); ++ Icon var8 = this.getBlockIconFromSide(par1BlockFlowerPot, 0); + float var9 = (float)(var7 >> 16 & 255) / 255.0F; + float var10 = (float)(var7 >> 8 & 255) / 255.0F; + float var11 = (float)(var7 & 255) / 255.0F; + float var12; + float var14; +- if(EntityRenderer.anaglyphEnable) { ++ ++ if (EntityRenderer.anaglyphEnable) { + var12 = (var9 * 30.0F + var10 * 59.0F + var11 * 11.0F) / 100.0F; + float var13 = (var9 * 30.0F + var10 * 70.0F) / 100.0F; + var14 = (var9 * 30.0F + var11 * 70.0F) / 100.0F; +@@ -450,67 +731,74 @@ + + var5.setColorOpaque_F(var6 * var9, var6 * var10, var6 * var11); + var12 = 0.1865F; +- this.renderFaceXPos(var1, (double)((float)var2 - 0.5F + var12), (double)var3, (double)var4, var8); +- this.renderFaceXNeg(var1, (double)((float)var2 + 0.5F - var12), (double)var3, (double)var4, var8); +- this.renderFaceZPos(var1, (double)var2, (double)var3, (double)((float)var4 - 0.5F + var12), var8); +- this.renderFaceZNeg(var1, (double)var2, (double)var3, (double)((float)var4 + 0.5F - var12), var8); +- this.renderFaceYPos(var1, (double)var2, (double)((float)var3 - 0.5F + var12 + 3.0F / 16.0F), (double)var4, this.getBlockIcon(Block.dirt)); +- int var19 = this.blockAccess.getBlockMetadata(var2, var3, var4); +- if(var19 != 0) { ++ this.renderFaceXPos(par1BlockFlowerPot, (double)((float)par2 - 0.5F + var12), (double)par3, (double)par4, var8); ++ this.renderFaceXNeg(par1BlockFlowerPot, (double)((float)par2 + 0.5F - var12), (double)par3, (double)par4, var8); ++ this.renderFaceZPos(par1BlockFlowerPot, (double)par2, (double)par3, (double)((float)par4 - 0.5F + var12), var8); ++ this.renderFaceZNeg(par1BlockFlowerPot, (double)par2, (double)par3, (double)((float)par4 + 0.5F - var12), var8); ++ this.renderFaceYPos(par1BlockFlowerPot, (double)par2, (double)((float)par3 - 0.5F + var12 + 0.1875F), (double)par4, this.getBlockIcon(Block.dirt)); ++ int var19 = this.blockAccess.getBlockMetadata(par2, par3, par4); ++ ++ if (var19 != 0) { + var14 = 0.0F; + float var15 = 4.0F; + float var16 = 0.0F; + BlockFlower var17 = null; +- switch(var19) { +- case 1: +- var17 = Block.plantRed; +- break; +- case 2: +- var17 = Block.plantYellow; +- case 3: +- case 4: +- case 5: +- case 6: +- default: +- break; +- case 7: +- var17 = Block.mushroomRed; +- break; +- case 8: +- var17 = Block.mushroomBrown; ++ ++ switch (var19) { ++ case 1: ++ var17 = Block.plantRed; ++ break; ++ ++ case 2: ++ var17 = Block.plantYellow; ++ ++ case 3: ++ case 4: ++ case 5: ++ case 6: ++ default: ++ break; ++ ++ case 7: ++ var17 = Block.mushroomRed; ++ break; ++ ++ case 8: ++ var17 = Block.mushroomBrown; + } + + var5.addTranslation(var14 / 16.0F, var15 / 16.0F, var16 / 16.0F); +- if(var17 != null) { +- this.renderBlockByRenderType(var17, var2, var3, var4); +- } else if(var19 == 9) { ++ ++ if (var17 != null) { ++ this.renderBlockByRenderType(var17, par2, par3, par4); ++ } else if (var19 == 9) { + this.renderAllFaces = true; +- float var18 = 2.0F / 16.0F; ++ float var18 = 0.125F; + this.setRenderBounds((double)(0.5F - var18), 0.0D, (double)(0.5F - var18), (double)(0.5F + var18), 0.25D, (double)(0.5F + var18)); +- this.renderStandardBlock(Block.cactus, var2, var3, var4); ++ this.renderStandardBlock(Block.cactus, par2, par3, par4); + this.setRenderBounds((double)(0.5F - var18), 0.25D, (double)(0.5F - var18), (double)(0.5F + var18), 0.5D, (double)(0.5F + var18)); +- this.renderStandardBlock(Block.cactus, var2, var3, var4); ++ this.renderStandardBlock(Block.cactus, par2, par3, par4); + this.setRenderBounds((double)(0.5F - var18), 0.5D, (double)(0.5F - var18), (double)(0.5F + var18), 0.75D, (double)(0.5F + var18)); +- this.renderStandardBlock(Block.cactus, var2, var3, var4); ++ this.renderStandardBlock(Block.cactus, par2, par3, par4); + this.renderAllFaces = false; + this.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 1.0D); +- } else if(var19 == 3) { +- this.drawCrossedSquares(Block.sapling, 0, (double)var2, (double)var3, (double)var4, 12.0F / 16.0F); +- } else if(var19 == 5) { +- this.drawCrossedSquares(Block.sapling, 2, (double)var2, (double)var3, (double)var4, 12.0F / 16.0F); +- } else if(var19 == 4) { +- this.drawCrossedSquares(Block.sapling, 1, (double)var2, (double)var3, (double)var4, 12.0F / 16.0F); +- } else if(var19 == 6) { +- this.drawCrossedSquares(Block.sapling, 3, (double)var2, (double)var3, (double)var4, 12.0F / 16.0F); +- } else if(var19 == 11) { +- var7 = Block.tallGrass.colorMultiplier(this.blockAccess, var2, var3, var4); ++ } else if (var19 == 3) { ++ this.drawCrossedSquares(Block.sapling, 0, (double)par2, (double)par3, (double)par4, 0.75F); ++ } else if (var19 == 5) { ++ this.drawCrossedSquares(Block.sapling, 2, (double)par2, (double)par3, (double)par4, 0.75F); ++ } else if (var19 == 4) { ++ this.drawCrossedSquares(Block.sapling, 1, (double)par2, (double)par3, (double)par4, 0.75F); ++ } else if (var19 == 6) { ++ this.drawCrossedSquares(Block.sapling, 3, (double)par2, (double)par3, (double)par4, 0.75F); ++ } else if (var19 == 11) { ++ var7 = Block.tallGrass.colorMultiplier(this.blockAccess, par2, par3, par4); + var9 = (float)(var7 >> 16 & 255) / 255.0F; + var10 = (float)(var7 >> 8 & 255) / 255.0F; + var11 = (float)(var7 & 255) / 255.0F; + var5.setColorOpaque_F(var6 * var9, var6 * var10, var6 * var11); +- this.drawCrossedSquares(Block.tallGrass, 2, (double)var2, (double)var3, (double)var4, 12.0F / 16.0F); +- } else if(var19 == 10) { +- this.drawCrossedSquares(Block.deadBush, 2, (double)var2, (double)var3, (double)var4, 12.0F / 16.0F); ++ this.drawCrossedSquares(Block.tallGrass, 2, (double)par2, (double)par3, (double)par4, 0.75F); ++ } else if (var19 == 10) { ++ this.drawCrossedSquares(Block.deadBush, 2, (double)par2, (double)par3, (double)par4, 0.75F); + } + + var5.addTranslation(-var14 / 16.0F, -var15 / 16.0F, -var16 / 16.0F); +@@ -519,19 +807,26 @@ + return true; + } + +- private boolean renderBlockAnvil(BlockAnvil var1, int var2, int var3, int var4) { +- return this.renderBlockAnvilMetadata(var1, var2, var3, var4, this.blockAccess.getBlockMetadata(var2, var3, var4)); ++ /** ++ * Renders anvil ++ */ ++ private boolean renderBlockAnvil(BlockAnvil par1BlockAnvil, int par2, int par3, int par4) { ++ return this.renderBlockAnvilMetadata(par1BlockAnvil, par2, par3, par4, this.blockAccess.getBlockMetadata(par2, par3, par4)); + } + +- public boolean renderBlockAnvilMetadata(BlockAnvil var1, int var2, int var3, int var4, int var5) { ++ /** ++ * Renders anvil block with metadata ++ */ ++ public boolean renderBlockAnvilMetadata(BlockAnvil par1BlockAnvil, int par2, int par3, int par4, int par5) { + Tessellator var6 = Tessellator.instance; +- var6.setBrightness(var1.getMixedBrightnessForBlock(this.blockAccess, var2, var3, var4)); ++ var6.setBrightness(par1BlockAnvil.getMixedBrightnessForBlock(this.blockAccess, par2, par3, par4)); + float var7 = 1.0F; +- int var8 = var1.colorMultiplier(this.blockAccess, var2, var3, var4); ++ int var8 = par1BlockAnvil.colorMultiplier(this.blockAccess, par2, par3, par4); + float var9 = (float)(var8 >> 16 & 255) / 255.0F; + float var10 = (float)(var8 >> 8 & 255) / 255.0F; + float var11 = (float)(var8 & 255) / 255.0F; +- if(EntityRenderer.anaglyphEnable) { ++ ++ if (EntityRenderer.anaglyphEnable) { + float var12 = (var9 * 30.0F + var10 * 59.0F + var11 * 11.0F) / 100.0F; + float var13 = (var9 * 30.0F + var10 * 70.0F) / 100.0F; + float var14 = (var9 * 30.0F + var11 * 70.0F) / 100.0F; +@@ -541,43 +836,50 @@ + } + + var6.setColorOpaque_F(var7 * var9, var7 * var10, var7 * var11); +- return this.renderBlockAnvilOrient(var1, var2, var3, var4, var5, false); ++ return this.renderBlockAnvilOrient(par1BlockAnvil, par2, par3, par4, par5, false); + } + +- private boolean renderBlockAnvilOrient(BlockAnvil var1, int var2, int var3, int var4, int var5, boolean var6) { +- int var7 = var6 ? 0 : var5 & 3; ++ /** ++ * Renders anvil block with orientation ++ */ ++ private boolean renderBlockAnvilOrient(BlockAnvil par1BlockAnvil, int par2, int par3, int par4, int par5, boolean par6) { ++ int var7 = par6 ? 0 : par5 & 3; + boolean var8 = false; + float var9 = 0.0F; +- switch(var7) { +- case 0: +- this.uvRotateSouth = 2; +- this.uvRotateNorth = 1; +- this.uvRotateTop = 3; +- this.uvRotateBottom = 3; +- break; +- case 1: +- this.uvRotateEast = 1; +- this.uvRotateWest = 2; +- this.uvRotateTop = 2; +- this.uvRotateBottom = 1; +- var8 = true; +- break; +- case 2: +- this.uvRotateSouth = 1; +- this.uvRotateNorth = 2; +- break; +- case 3: +- this.uvRotateEast = 2; +- this.uvRotateWest = 1; +- this.uvRotateTop = 1; +- this.uvRotateBottom = 2; +- var8 = true; ++ ++ switch (var7) { ++ case 0: ++ this.uvRotateSouth = 2; ++ this.uvRotateNorth = 1; ++ this.uvRotateTop = 3; ++ this.uvRotateBottom = 3; ++ break; ++ ++ case 1: ++ this.uvRotateEast = 1; ++ this.uvRotateWest = 2; ++ this.uvRotateTop = 2; ++ this.uvRotateBottom = 1; ++ var8 = true; ++ break; ++ ++ case 2: ++ this.uvRotateSouth = 1; ++ this.uvRotateNorth = 2; ++ break; ++ ++ case 3: ++ this.uvRotateEast = 2; ++ this.uvRotateWest = 1; ++ this.uvRotateTop = 1; ++ this.uvRotateBottom = 2; ++ var8 = true; + } + +- var9 = this.renderBlockAnvilRotate(var1, var2, var3, var4, 0, var9, 12.0F / 16.0F, 0.25F, 12.0F / 16.0F, var8, var6, var5); +- var9 = this.renderBlockAnvilRotate(var1, var2, var3, var4, 1, var9, 0.5F, 1.0F / 16.0F, 10.0F / 16.0F, var8, var6, var5); +- var9 = this.renderBlockAnvilRotate(var1, var2, var3, var4, 2, var9, 0.25F, 5.0F / 16.0F, 0.5F, var8, var6, var5); +- this.renderBlockAnvilRotate(var1, var2, var3, var4, 3, var9, 10.0F / 16.0F, 6.0F / 16.0F, 1.0F, var8, var6, var5); ++ var9 = this.renderBlockAnvilRotate(par1BlockAnvil, par2, par3, par4, 0, var9, 0.75F, 0.25F, 0.75F, var8, par6, par5); ++ var9 = this.renderBlockAnvilRotate(par1BlockAnvil, par2, par3, par4, 1, var9, 0.5F, 0.0625F, 0.625F, var8, par6, par5); ++ var9 = this.renderBlockAnvilRotate(par1BlockAnvil, par2, par3, par4, 2, var9, 0.25F, 0.3125F, 0.5F, var8, par6, par5); ++ this.renderBlockAnvilRotate(par1BlockAnvil, par2, par3, par4, 3, var9, 0.625F, 0.375F, 1.0F, var8, par6, par5); + this.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 1.0D); + this.uvRotateEast = 0; + this.uvRotateWest = 0; +@@ -588,106 +890,121 @@ + return true; + } + +- private float renderBlockAnvilRotate(BlockAnvil var1, int var2, int var3, int var4, int var5, float var6, float var7, float var8, float var9, boolean var10, boolean var11, int var12) { +- if(var10) { +- float var13 = var7; +- var7 = var9; +- var9 = var13; ++ /** ++ * Renders anvil block with rotation ++ */ ++ private float renderBlockAnvilRotate(BlockAnvil par1BlockAnvil, int par2, int par3, int par4, int par5, float par6, float par7, float par8, float par9, boolean par10, boolean par11, int par12) { ++ if (par10) { ++ float var13 = par7; ++ par7 = par9; ++ par9 = var13; + } + +- var7 /= 2.0F; +- var9 /= 2.0F; +- var1.field_82521_b = var5; +- this.setRenderBounds((double)(0.5F - var7), (double)var6, (double)(0.5F - var9), (double)(0.5F + var7), (double)(var6 + var8), (double)(0.5F + var9)); +- if(var11) { ++ par7 /= 2.0F; ++ par9 /= 2.0F; ++ par1BlockAnvil.field_82521_b = par5; ++ this.setRenderBounds((double)(0.5F - par7), (double)par6, (double)(0.5F - par9), (double)(0.5F + par7), (double)(par6 + par8), (double)(0.5F + par9)); ++ ++ if (par11) { + Tessellator var14 = Tessellator.instance; + var14.startDrawingQuads(); + var14.setNormal(0.0F, -1.0F, 0.0F); +- this.renderFaceYNeg(var1, 0.0D, 0.0D, 0.0D, this.getBlockIconFromSideAndMetadata(var1, 0, var12)); ++ this.renderFaceYNeg(par1BlockAnvil, 0.0D, 0.0D, 0.0D, this.getBlockIconFromSideAndMetadata(par1BlockAnvil, 0, par12)); + var14.draw(); + var14.startDrawingQuads(); + var14.setNormal(0.0F, 1.0F, 0.0F); +- this.renderFaceYPos(var1, 0.0D, 0.0D, 0.0D, this.getBlockIconFromSideAndMetadata(var1, 1, var12)); ++ this.renderFaceYPos(par1BlockAnvil, 0.0D, 0.0D, 0.0D, this.getBlockIconFromSideAndMetadata(par1BlockAnvil, 1, par12)); + var14.draw(); + var14.startDrawingQuads(); + var14.setNormal(0.0F, 0.0F, -1.0F); +- this.renderFaceZNeg(var1, 0.0D, 0.0D, 0.0D, this.getBlockIconFromSideAndMetadata(var1, 2, var12)); ++ this.renderFaceZNeg(par1BlockAnvil, 0.0D, 0.0D, 0.0D, this.getBlockIconFromSideAndMetadata(par1BlockAnvil, 2, par12)); + var14.draw(); + var14.startDrawingQuads(); + var14.setNormal(0.0F, 0.0F, 1.0F); +- this.renderFaceZPos(var1, 0.0D, 0.0D, 0.0D, this.getBlockIconFromSideAndMetadata(var1, 3, var12)); ++ this.renderFaceZPos(par1BlockAnvil, 0.0D, 0.0D, 0.0D, this.getBlockIconFromSideAndMetadata(par1BlockAnvil, 3, par12)); + var14.draw(); + var14.startDrawingQuads(); + var14.setNormal(-1.0F, 0.0F, 0.0F); +- this.renderFaceXNeg(var1, 0.0D, 0.0D, 0.0D, this.getBlockIconFromSideAndMetadata(var1, 4, var12)); ++ this.renderFaceXNeg(par1BlockAnvil, 0.0D, 0.0D, 0.0D, this.getBlockIconFromSideAndMetadata(par1BlockAnvil, 4, par12)); + var14.draw(); + var14.startDrawingQuads(); + var14.setNormal(1.0F, 0.0F, 0.0F); +- this.renderFaceXPos(var1, 0.0D, 0.0D, 0.0D, this.getBlockIconFromSideAndMetadata(var1, 5, var12)); ++ this.renderFaceXPos(par1BlockAnvil, 0.0D, 0.0D, 0.0D, this.getBlockIconFromSideAndMetadata(par1BlockAnvil, 5, par12)); + var14.draw(); + } else { +- this.renderStandardBlock(var1, var2, var3, var4); ++ this.renderStandardBlock(par1BlockAnvil, par2, par3, par4); + } + +- return var6 + var8; ++ return par6 + par8; + } + +- public boolean renderBlockTorch(Block var1, int var2, int var3, int var4) { +- int var5 = this.blockAccess.getBlockMetadata(var2, var3, var4); ++ /** ++ * Renders a torch block at the given coordinates ++ */ ++ public boolean renderBlockTorch(Block par1Block, int par2, int par3, int par4) { ++ int var5 = this.blockAccess.getBlockMetadata(par2, par3, par4); + Tessellator var6 = Tessellator.instance; +- var6.setBrightness(var1.getMixedBrightnessForBlock(this.blockAccess, var2, var3, var4)); ++ var6.setBrightness(par1Block.getMixedBrightnessForBlock(this.blockAccess, par2, par3, par4)); + var6.setColorOpaque_F(1.0F, 1.0F, 1.0F); +- double var7 = (double)0.4F; ++ double var7 = 0.4000000059604645D; + double var9 = 0.5D - var7; +- double var11 = (double)0.2F; +- if(var5 == 1) { +- this.renderTorchAtAngle(var1, (double)var2 - var9, (double)var3 + var11, (double)var4, -var7, 0.0D, 0); +- } else if(var5 == 2) { +- this.renderTorchAtAngle(var1, (double)var2 + var9, (double)var3 + var11, (double)var4, var7, 0.0D, 0); +- } else if(var5 == 3) { +- this.renderTorchAtAngle(var1, (double)var2, (double)var3 + var11, (double)var4 - var9, 0.0D, -var7, 0); +- } else if(var5 == 4) { +- this.renderTorchAtAngle(var1, (double)var2, (double)var3 + var11, (double)var4 + var9, 0.0D, var7, 0); ++ double var11 = 0.20000000298023224D; ++ ++ if (var5 == 1) { ++ this.renderTorchAtAngle(par1Block, (double)par2 - var9, (double)par3 + var11, (double)par4, -var7, 0.0D, 0); ++ } else if (var5 == 2) { ++ this.renderTorchAtAngle(par1Block, (double)par2 + var9, (double)par3 + var11, (double)par4, var7, 0.0D, 0); ++ } else if (var5 == 3) { ++ this.renderTorchAtAngle(par1Block, (double)par2, (double)par3 + var11, (double)par4 - var9, 0.0D, -var7, 0); ++ } else if (var5 == 4) { ++ this.renderTorchAtAngle(par1Block, (double)par2, (double)par3 + var11, (double)par4 + var9, 0.0D, var7, 0); + } else { +- this.renderTorchAtAngle(var1, (double)var2, (double)var3, (double)var4, 0.0D, 0.0D, 0); ++ this.renderTorchAtAngle(par1Block, (double)par2, (double)par3, (double)par4, 0.0D, 0.0D, 0); + } + + return true; + } + +- private boolean renderBlockRepeater(BlockRedstoneRepeater var1, int var2, int var3, int var4) { +- int var5 = this.blockAccess.getBlockMetadata(var2, var3, var4); ++ /** ++ * render a redstone repeater at the given coordinates ++ */ ++ private boolean renderBlockRepeater(BlockRedstoneRepeater par1BlockRedstoneRepeater, int par2, int par3, int par4) { ++ int var5 = this.blockAccess.getBlockMetadata(par2, par3, par4); + int var6 = var5 & 3; + int var7 = (var5 & 12) >> 2; + Tessellator var8 = Tessellator.instance; +- var8.setBrightness(var1.getMixedBrightnessForBlock(this.blockAccess, var2, var3, var4)); ++ var8.setBrightness(par1BlockRedstoneRepeater.getMixedBrightnessForBlock(this.blockAccess, par2, par3, par4)); + var8.setColorOpaque_F(1.0F, 1.0F, 1.0F); + double var9 = -0.1875D; +- boolean var11 = var1.func_94476_e(this.blockAccess, var2, var3, var4, var5); ++ boolean var11 = par1BlockRedstoneRepeater.func_94476_e(this.blockAccess, par2, par3, par4, var5); + double var12 = 0.0D; + double var14 = 0.0D; + double var16 = 0.0D; + double var18 = 0.0D; +- switch(var6) { +- case 0: +- var18 = -0.3125D; +- var14 = BlockRedstoneRepeater.repeaterTorchOffset[var7]; +- break; +- case 1: +- var16 = 0.3125D; +- var12 = -BlockRedstoneRepeater.repeaterTorchOffset[var7]; +- break; +- case 2: +- var18 = 0.3125D; +- var14 = -BlockRedstoneRepeater.repeaterTorchOffset[var7]; +- break; +- case 3: +- var16 = -0.3125D; +- var12 = BlockRedstoneRepeater.repeaterTorchOffset[var7]; ++ ++ switch (var6) { ++ case 0: ++ var18 = -0.3125D; ++ var14 = BlockRedstoneRepeater.repeaterTorchOffset[var7]; ++ break; ++ ++ case 1: ++ var16 = 0.3125D; ++ var12 = -BlockRedstoneRepeater.repeaterTorchOffset[var7]; ++ break; ++ ++ case 2: ++ var18 = 0.3125D; ++ var14 = -BlockRedstoneRepeater.repeaterTorchOffset[var7]; ++ break; ++ ++ case 3: ++ var16 = -0.3125D; ++ var12 = BlockRedstoneRepeater.repeaterTorchOffset[var7]; + } + +- if(!var11) { +- this.renderTorchAtAngle(var1, (double)var2 + var12, (double)var3 + var9, (double)var4 + var14, 0.0D, 0.0D, 0); ++ if (!var11) { ++ this.renderTorchAtAngle(par1BlockRedstoneRepeater, (double)par2 + var12, (double)par3 + var9, (double)par4 + var14, 0.0D, 0.0D, 0); + } else { + Icon var20 = this.getBlockIcon(Block.bedrock); + this.setOverrideBlockTexture(var20); +@@ -695,43 +1012,45 @@ + float var22 = 14.0F; + float var23 = 7.0F; + float var24 = 9.0F; +- switch(var6) { +- case 1: +- case 3: +- var21 = 7.0F; +- var22 = 9.0F; +- var23 = 2.0F; +- var24 = 14.0F; +- case 0: +- case 2: +- default: +- this.setRenderBounds((double)(var21 / 16.0F + (float)var12), 0.125D, (double)(var23 / 16.0F + (float)var14), (double)(var22 / 16.0F + (float)var12), 0.25D, (double)(var24 / 16.0F + (float)var14)); +- double var25 = (double)var20.getInterpolatedU((double)var21); +- double var27 = (double)var20.getInterpolatedV((double)var23); +- double var29 = (double)var20.getInterpolatedU((double)var22); +- double var31 = (double)var20.getInterpolatedV((double)var24); +- var8.addVertexWithUV((double)((float)var2 + var21 / 16.0F) + var12, (double)((float)var3 + 0.25F), (double)((float)var4 + var23 / 16.0F) + var14, var25, var27); +- var8.addVertexWithUV((double)((float)var2 + var21 / 16.0F) + var12, (double)((float)var3 + 0.25F), (double)((float)var4 + var24 / 16.0F) + var14, var25, var31); +- var8.addVertexWithUV((double)((float)var2 + var22 / 16.0F) + var12, (double)((float)var3 + 0.25F), (double)((float)var4 + var24 / 16.0F) + var14, var29, var31); +- var8.addVertexWithUV((double)((float)var2 + var22 / 16.0F) + var12, (double)((float)var3 + 0.25F), (double)((float)var4 + var23 / 16.0F) + var14, var29, var27); +- this.renderStandardBlock(var1, var2, var3, var4); +- this.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 0.125D, 1.0D); +- this.clearOverrideBlockTexture(); ++ ++ switch (var6) { ++ case 1: ++ case 3: ++ var21 = 7.0F; ++ var22 = 9.0F; ++ var23 = 2.0F; ++ var24 = 14.0F; ++ ++ case 0: ++ case 2: ++ default: ++ this.setRenderBounds((double)(var21 / 16.0F + (float)var12), 0.125D, (double)(var23 / 16.0F + (float)var14), (double)(var22 / 16.0F + (float)var12), 0.25D, (double)(var24 / 16.0F + (float)var14)); ++ double var25 = (double)var20.getInterpolatedU((double)var21); ++ double var27 = (double)var20.getInterpolatedV((double)var23); ++ double var29 = (double)var20.getInterpolatedU((double)var22); ++ double var31 = (double)var20.getInterpolatedV((double)var24); ++ var8.addVertexWithUV((double)((float)par2 + var21 / 16.0F) + var12, (double)((float)par3 + 0.25F), (double)((float)par4 + var23 / 16.0F) + var14, var25, var27); ++ var8.addVertexWithUV((double)((float)par2 + var21 / 16.0F) + var12, (double)((float)par3 + 0.25F), (double)((float)par4 + var24 / 16.0F) + var14, var25, var31); ++ var8.addVertexWithUV((double)((float)par2 + var22 / 16.0F) + var12, (double)((float)par3 + 0.25F), (double)((float)par4 + var24 / 16.0F) + var14, var29, var31); ++ var8.addVertexWithUV((double)((float)par2 + var22 / 16.0F) + var12, (double)((float)par3 + 0.25F), (double)((float)par4 + var23 / 16.0F) + var14, var29, var27); ++ this.renderStandardBlock(par1BlockRedstoneRepeater, par2, par3, par4); ++ this.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 0.125D, 1.0D); ++ this.clearOverrideBlockTexture(); + } + } + +- var8.setBrightness(var1.getMixedBrightnessForBlock(this.blockAccess, var2, var3, var4)); ++ var8.setBrightness(par1BlockRedstoneRepeater.getMixedBrightnessForBlock(this.blockAccess, par2, par3, par4)); + var8.setColorOpaque_F(1.0F, 1.0F, 1.0F); +- this.renderTorchAtAngle(var1, (double)var2 + var16, (double)var3 + var9, (double)var4 + var18, 0.0D, 0.0D, 0); +- this.renderBlockRedstoneLogic(var1, var2, var3, var4); ++ this.renderTorchAtAngle(par1BlockRedstoneRepeater, (double)par2 + var16, (double)par3 + var9, (double)par4 + var18, 0.0D, 0.0D, 0); ++ this.renderBlockRedstoneLogic(par1BlockRedstoneRepeater, par2, par3, par4); + return true; + } + +- private boolean renderBlockComparator(BlockComparator var1, int var2, int var3, int var4) { ++ private boolean renderBlockComparator(BlockComparator par1BlockComparator, int par2, int par3, int par4) { + Tessellator var5 = Tessellator.instance; +- var5.setBrightness(var1.getMixedBrightnessForBlock(this.blockAccess, var2, var3, var4)); ++ var5.setBrightness(par1BlockComparator.getMixedBrightnessForBlock(this.blockAccess, par2, par3, par4)); + var5.setColorOpaque_F(1.0F, 1.0F, 1.0F); +- int var6 = this.blockAccess.getBlockMetadata(var2, var3, var4); ++ int var6 = this.blockAccess.getBlockMetadata(par2, par3, par4); + int var7 = var6 & 3; + double var8 = 0.0D; + double var10 = -0.1875D; +@@ -739,154 +1058,164 @@ + double var14 = 0.0D; + double var16 = 0.0D; + Icon var18; +- if(var1.func_94490_c(var6)) { ++ ++ if (par1BlockComparator.func_94490_c(var6)) { + var18 = Block.torchRedstoneActive.getBlockTextureFromSide(0); + } else { + var10 -= 0.1875D; + var18 = Block.torchRedstoneIdle.getBlockTextureFromSide(0); + } + +- switch(var7) { +- case 0: +- var12 = -0.3125D; +- var16 = 1.0D; +- break; +- case 1: +- var8 = 0.3125D; +- var14 = -1.0D; +- break; +- case 2: +- var12 = 0.3125D; +- var16 = -1.0D; +- break; +- case 3: +- var8 = -0.3125D; +- var14 = 1.0D; ++ switch (var7) { ++ case 0: ++ var12 = -0.3125D; ++ var16 = 1.0D; ++ break; ++ ++ case 1: ++ var8 = 0.3125D; ++ var14 = -1.0D; ++ break; ++ ++ case 2: ++ var12 = 0.3125D; ++ var16 = -1.0D; ++ break; ++ ++ case 3: ++ var8 = -0.3125D; ++ var14 = 1.0D; + } + +- this.renderTorchAtAngle(var1, (double)var2 + 0.25D * var14 + 0.1875D * var16, (double)((float)var3 - 3.0F / 16.0F), (double)var4 + 0.25D * var16 + 0.1875D * var14, 0.0D, 0.0D, var6); +- this.renderTorchAtAngle(var1, (double)var2 + 0.25D * var14 + -0.1875D * var16, (double)((float)var3 - 3.0F / 16.0F), (double)var4 + 0.25D * var16 + -0.1875D * var14, 0.0D, 0.0D, var6); ++ this.renderTorchAtAngle(par1BlockComparator, (double)par2 + 0.25D * var14 + 0.1875D * var16, (double)((float)par3 - 0.1875F), (double)par4 + 0.25D * var16 + 0.1875D * var14, 0.0D, 0.0D, var6); ++ this.renderTorchAtAngle(par1BlockComparator, (double)par2 + 0.25D * var14 + -0.1875D * var16, (double)((float)par3 - 0.1875F), (double)par4 + 0.25D * var16 + -0.1875D * var14, 0.0D, 0.0D, var6); + this.setOverrideBlockTexture(var18); +- this.renderTorchAtAngle(var1, (double)var2 + var8, (double)var3 + var10, (double)var4 + var12, 0.0D, 0.0D, var6); ++ this.renderTorchAtAngle(par1BlockComparator, (double)par2 + var8, (double)par3 + var10, (double)par4 + var12, 0.0D, 0.0D, var6); + this.clearOverrideBlockTexture(); +- this.renderBlockRedstoneLogicMetadata(var1, var2, var3, var4, var7); ++ this.renderBlockRedstoneLogicMetadata(par1BlockComparator, par2, par3, par4, var7); + return true; + } + +- private boolean renderBlockRedstoneLogic(BlockRedstoneLogic var1, int var2, int var3, int var4) { ++ private boolean renderBlockRedstoneLogic(BlockRedstoneLogic par1BlockRedstoneLogic, int par2, int par3, int par4) { + Tessellator var5 = Tessellator.instance; +- this.renderBlockRedstoneLogicMetadata(var1, var2, var3, var4, this.blockAccess.getBlockMetadata(var2, var3, var4) & 3); ++ this.renderBlockRedstoneLogicMetadata(par1BlockRedstoneLogic, par2, par3, par4, this.blockAccess.getBlockMetadata(par2, par3, par4) & 3); + return true; + } + +- private void renderBlockRedstoneLogicMetadata(BlockRedstoneLogic var1, int var2, int var3, int var4, int var5) { +- this.renderStandardBlock(var1, var2, var3, var4); ++ private void renderBlockRedstoneLogicMetadata(BlockRedstoneLogic par1BlockRedstoneLogic, int par2, int par3, int par4, int par5) { ++ this.renderStandardBlock(par1BlockRedstoneLogic, par2, par3, par4); + Tessellator var6 = Tessellator.instance; +- var6.setBrightness(var1.getMixedBrightnessForBlock(this.blockAccess, var2, var3, var4)); ++ var6.setBrightness(par1BlockRedstoneLogic.getMixedBrightnessForBlock(this.blockAccess, par2, par3, par4)); + var6.setColorOpaque_F(1.0F, 1.0F, 1.0F); +- int var7 = this.blockAccess.getBlockMetadata(var2, var3, var4); +- Icon var8 = this.getBlockIconFromSideAndMetadata(var1, 1, var7); +- double var9 = (double)var8.getMinU(); +- double var11 = (double)var8.getMaxU(); +- double var13 = (double)var8.getMinV(); +- double var15 = (double)var8.getMaxV(); +- double var17 = 0.125D; +- double var19 = (double)(var2 + 1); +- double var21 = (double)(var2 + 1); +- double var23 = (double)(var2 + 0); +- double var25 = (double)(var2 + 0); +- double var27 = (double)(var4 + 0); +- double var29 = (double)(var4 + 1); +- double var31 = (double)(var4 + 1); +- double var33 = (double)(var4 + 0); +- double var35 = (double)var3 + var17; +- if(var5 == 2) { +- var21 = (double)(var2 + 0); +- var19 = var21; +- var25 = (double)(var2 + 1); +- var23 = var25; +- var33 = (double)(var4 + 1); +- var27 = var33; +- var31 = (double)(var4 + 0); +- var29 = var31; +- } else if(var5 == 3) { +- var25 = (double)(var2 + 0); +- var19 = var25; +- var23 = (double)(var2 + 1); +- var21 = var23; +- var29 = (double)(var4 + 0); +- var27 = var29; +- var33 = (double)(var4 + 1); +- var31 = var33; +- } else if(var5 == 1) { +- var25 = (double)(var2 + 1); +- var19 = var25; +- var23 = (double)(var2 + 0); +- var21 = var23; +- var29 = (double)(var4 + 1); +- var27 = var29; +- var33 = (double)(var4 + 0); +- var31 = var33; ++ int var7 = this.blockAccess.getBlockMetadata(par2, par3, par4); ++ Icon var8 = this.getBlockIconFromSideAndMetadata(par1BlockRedstoneLogic, 1, var7); ++ var8 = CTMUtils.getTile(this, par1BlockRedstoneLogic, par2, par3, par4, var8, var6); ++ ++ if (var8 != null) { ++ var6 = TessellatorUtils.getTessellator(var6, var8); ++ double var9 = (double)var8.getMinU(); ++ double var11 = (double)var8.getMaxU(); ++ double var13 = (double)var8.getMinV(); ++ double var15 = (double)var8.getMaxV(); ++ double var17 = 0.125D; ++ double var19 = (double)(par2 + 1); ++ double var21 = (double)(par2 + 1); ++ double var23 = (double)(par2 + 0); ++ double var25 = (double)(par2 + 0); ++ double var27 = (double)(par4 + 0); ++ double var29 = (double)(par4 + 1); ++ double var31 = (double)(par4 + 1); ++ double var33 = (double)(par4 + 0); ++ double var35 = (double)par3 + var17; ++ ++ if (par5 == 2) { ++ var19 = var21 = (double)(par2 + 0); ++ var23 = var25 = (double)(par2 + 1); ++ var27 = var33 = (double)(par4 + 1); ++ var29 = var31 = (double)(par4 + 0); ++ } else if (par5 == 3) { ++ var19 = var25 = (double)(par2 + 0); ++ var21 = var23 = (double)(par2 + 1); ++ var27 = var29 = (double)(par4 + 0); ++ var31 = var33 = (double)(par4 + 1); ++ } else if (par5 == 1) { ++ var19 = var25 = (double)(par2 + 1); ++ var21 = var23 = (double)(par2 + 0); ++ var27 = var29 = (double)(par4 + 1); ++ var31 = var33 = (double)(par4 + 0); ++ } ++ ++ var6.addVertexWithUV(var25, var35, var33, var9, var13); ++ var6.addVertexWithUV(var23, var35, var31, var9, var15); ++ var6.addVertexWithUV(var21, var35, var29, var11, var15); ++ var6.addVertexWithUV(var19, var35, var27, var11, var13); + } +- +- var6.addVertexWithUV(var25, var35, var33, var9, var13); +- var6.addVertexWithUV(var23, var35, var31, var9, var15); +- var6.addVertexWithUV(var21, var35, var29, var11, var15); +- var6.addVertexWithUV(var19, var35, var27, var11, var13); + } + +- public void renderPistonBaseAllFaces(Block var1, int var2, int var3, int var4) { ++ /** ++ * Render all faces of the piston base ++ */ ++ public void renderPistonBaseAllFaces(Block par1Block, int par2, int par3, int par4) { + this.renderAllFaces = true; +- this.renderPistonBase(var1, var2, var3, var4, true); ++ this.renderPistonBase(par1Block, par2, par3, par4, true); + this.renderAllFaces = false; + } + +- private boolean renderPistonBase(Block var1, int var2, int var3, int var4, boolean var5) { +- int var6 = this.blockAccess.getBlockMetadata(var2, var3, var4); +- boolean var7 = var5 || (var6 & 8) != 0; ++ /** ++ * renders a block as a piston base ++ */ ++ private boolean renderPistonBase(Block par1Block, int par2, int par3, int par4, boolean par5) { ++ int var6 = this.blockAccess.getBlockMetadata(par2, par3, par4); ++ boolean var7 = par5 || (var6 & 8) != 0; + int var8 = BlockPistonBase.getOrientation(var6); + float var9 = 0.25F; +- if(var7) { +- switch(var8) { +- case 0: +- this.uvRotateEast = 3; +- this.uvRotateWest = 3; +- this.uvRotateSouth = 3; +- this.uvRotateNorth = 3; +- this.setRenderBounds(0.0D, 0.25D, 0.0D, 1.0D, 1.0D, 1.0D); +- break; +- case 1: +- this.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 0.75D, 1.0D); +- break; +- case 2: +- this.uvRotateSouth = 1; +- this.uvRotateNorth = 2; +- this.setRenderBounds(0.0D, 0.0D, 0.25D, 1.0D, 1.0D, 1.0D); +- break; +- case 3: +- this.uvRotateSouth = 2; +- this.uvRotateNorth = 1; +- this.uvRotateTop = 3; +- this.uvRotateBottom = 3; +- this.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 0.75D); +- break; +- case 4: +- this.uvRotateEast = 1; +- this.uvRotateWest = 2; +- this.uvRotateTop = 2; +- this.uvRotateBottom = 1; +- this.setRenderBounds(0.25D, 0.0D, 0.0D, 1.0D, 1.0D, 1.0D); +- break; +- case 5: +- this.uvRotateEast = 2; +- this.uvRotateWest = 1; +- this.uvRotateTop = 1; +- this.uvRotateBottom = 2; +- this.setRenderBounds(0.0D, 0.0D, 0.0D, 0.75D, 1.0D, 1.0D); ++ ++ if (var7) { ++ switch (var8) { ++ case 0: ++ this.uvRotateEast = 3; ++ this.uvRotateWest = 3; ++ this.uvRotateSouth = 3; ++ this.uvRotateNorth = 3; ++ this.setRenderBounds(0.0D, 0.25D, 0.0D, 1.0D, 1.0D, 1.0D); ++ break; ++ ++ case 1: ++ this.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 0.75D, 1.0D); ++ break; ++ ++ case 2: ++ this.uvRotateSouth = 1; ++ this.uvRotateNorth = 2; ++ this.setRenderBounds(0.0D, 0.0D, 0.25D, 1.0D, 1.0D, 1.0D); ++ break; ++ ++ case 3: ++ this.uvRotateSouth = 2; ++ this.uvRotateNorth = 1; ++ this.uvRotateTop = 3; ++ this.uvRotateBottom = 3; ++ this.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 0.75D); ++ break; ++ ++ case 4: ++ this.uvRotateEast = 1; ++ this.uvRotateWest = 2; ++ this.uvRotateTop = 2; ++ this.uvRotateBottom = 1; ++ this.setRenderBounds(0.25D, 0.0D, 0.0D, 1.0D, 1.0D, 1.0D); ++ break; ++ ++ case 5: ++ this.uvRotateEast = 2; ++ this.uvRotateWest = 1; ++ this.uvRotateTop = 1; ++ this.uvRotateBottom = 2; ++ this.setRenderBounds(0.0D, 0.0D, 0.0D, 0.75D, 1.0D, 1.0D); + } + +- ((BlockPistonBase)var1).func_96479_b((float)this.renderMinX, (float)this.renderMinY, (float)this.renderMinZ, (float)this.renderMaxX, (float)this.renderMaxY, (float)this.renderMaxZ); +- this.renderStandardBlock(var1, var2, var3, var4); ++ ((BlockPistonBase)par1Block).func_96479_b((float)this.renderMinX, (float)this.renderMinY, (float)this.renderMinZ, (float)this.renderMaxX, (float)this.renderMaxY, (float)this.renderMaxZ); ++ this.renderStandardBlock(par1Block, par2, par3, par4); + this.uvRotateEast = 0; + this.uvRotateWest = 0; + this.uvRotateSouth = 0; +@@ -894,41 +1223,46 @@ + this.uvRotateTop = 0; + this.uvRotateBottom = 0; + this.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 1.0D); +- ((BlockPistonBase)var1).func_96479_b((float)this.renderMinX, (float)this.renderMinY, (float)this.renderMinZ, (float)this.renderMaxX, (float)this.renderMaxY, (float)this.renderMaxZ); ++ ((BlockPistonBase)par1Block).func_96479_b((float)this.renderMinX, (float)this.renderMinY, (float)this.renderMinZ, (float)this.renderMaxX, (float)this.renderMaxY, (float)this.renderMaxZ); + } else { +- switch(var8) { +- case 0: +- this.uvRotateEast = 3; +- this.uvRotateWest = 3; +- this.uvRotateSouth = 3; +- this.uvRotateNorth = 3; +- case 1: +- default: +- break; +- case 2: +- this.uvRotateSouth = 1; +- this.uvRotateNorth = 2; +- break; +- case 3: +- this.uvRotateSouth = 2; +- this.uvRotateNorth = 1; +- this.uvRotateTop = 3; +- this.uvRotateBottom = 3; +- break; +- case 4: +- this.uvRotateEast = 1; +- this.uvRotateWest = 2; +- this.uvRotateTop = 2; +- this.uvRotateBottom = 1; +- break; +- case 5: +- this.uvRotateEast = 2; +- this.uvRotateWest = 1; +- this.uvRotateTop = 1; +- this.uvRotateBottom = 2; ++ switch (var8) { ++ case 0: ++ this.uvRotateEast = 3; ++ this.uvRotateWest = 3; ++ this.uvRotateSouth = 3; ++ this.uvRotateNorth = 3; ++ ++ case 1: ++ default: ++ break; ++ ++ case 2: ++ this.uvRotateSouth = 1; ++ this.uvRotateNorth = 2; ++ break; ++ ++ case 3: ++ this.uvRotateSouth = 2; ++ this.uvRotateNorth = 1; ++ this.uvRotateTop = 3; ++ this.uvRotateBottom = 3; ++ break; ++ ++ case 4: ++ this.uvRotateEast = 1; ++ this.uvRotateWest = 2; ++ this.uvRotateTop = 2; ++ this.uvRotateBottom = 1; ++ break; ++ ++ case 5: ++ this.uvRotateEast = 2; ++ this.uvRotateWest = 1; ++ this.uvRotateTop = 1; ++ this.uvRotateBottom = 2; + } + +- this.renderStandardBlock(var1, var2, var3, var4); ++ this.renderStandardBlock(par1Block, par2, par3, par4); + this.uvRotateEast = 0; + this.uvRotateWest = 0; + this.uvRotateSouth = 0; +@@ -940,141 +1274,165 @@ + return true; + } + +- private void renderPistonRodUD(double var1, double var3, double var5, double var7, double var9, double var11, float var13, double var14) { +- Icon var16 = BlockPistonBase.getPistonBaseIcon("piston_side"); +- if(this.hasOverrideBlockTexture()) { +- var16 = this.overrideBlockTexture; +- } +- +- Tessellator var17 = Tessellator.instance; +- double var18 = (double)var16.getMinU(); +- double var20 = (double)var16.getMinV(); +- double var22 = (double)var16.getInterpolatedU(var14); +- double var24 = (double)var16.getInterpolatedV(4.0D); +- var17.setColorOpaque_F(var13, var13, var13); +- var17.addVertexWithUV(var1, var7, var9, var22, var20); +- var17.addVertexWithUV(var1, var5, var9, var18, var20); +- var17.addVertexWithUV(var3, var5, var11, var18, var24); +- var17.addVertexWithUV(var3, var7, var11, var22, var24); +- } +- +- private void renderPistonRodSN(double var1, double var3, double var5, double var7, double var9, double var11, float var13, double var14) { +- Icon var16 = BlockPistonBase.getPistonBaseIcon("piston_side"); +- if(this.hasOverrideBlockTexture()) { +- var16 = this.overrideBlockTexture; +- } +- +- Tessellator var17 = Tessellator.instance; +- double var18 = (double)var16.getMinU(); +- double var20 = (double)var16.getMinV(); +- double var22 = (double)var16.getInterpolatedU(var14); +- double var24 = (double)var16.getInterpolatedV(4.0D); +- var17.setColorOpaque_F(var13, var13, var13); +- var17.addVertexWithUV(var1, var5, var11, var22, var20); +- var17.addVertexWithUV(var1, var5, var9, var18, var20); +- var17.addVertexWithUV(var3, var7, var9, var18, var24); +- var17.addVertexWithUV(var3, var7, var11, var22, var24); +- } +- +- private void renderPistonRodEW(double var1, double var3, double var5, double var7, double var9, double var11, float var13, double var14) { +- Icon var16 = BlockPistonBase.getPistonBaseIcon("piston_side"); +- if(this.hasOverrideBlockTexture()) { +- var16 = this.overrideBlockTexture; +- } +- +- Tessellator var17 = Tessellator.instance; +- double var18 = (double)var16.getMinU(); +- double var20 = (double)var16.getMinV(); +- double var22 = (double)var16.getInterpolatedU(var14); +- double var24 = (double)var16.getInterpolatedV(4.0D); +- var17.setColorOpaque_F(var13, var13, var13); +- var17.addVertexWithUV(var3, var5, var9, var22, var20); +- var17.addVertexWithUV(var1, var5, var9, var18, var20); +- var17.addVertexWithUV(var1, var7, var11, var18, var24); +- var17.addVertexWithUV(var3, var7, var11, var22, var24); +- } +- +- public void renderPistonExtensionAllFaces(Block var1, int var2, int var3, int var4, boolean var5) { ++ /** ++ * Render piston rod up/down ++ */ ++ private void renderPistonRodUD(double par1, double par3, double par5, double par7, double par9, double par11, float par13, double par14) { ++ Icon var16 = BlockPistonBase.getPistonBaseIcon("piston_side"); ++ ++ if (this.hasOverrideBlockTexture()) { ++ var16 = this.overrideBlockTexture; ++ } ++ ++ Tessellator var17 = Tessellator.instance; ++ double var18 = (double)var16.getMinU(); ++ double var20 = (double)var16.getMinV(); ++ double var22 = (double)var16.getInterpolatedU(par14); ++ double var24 = (double)var16.getInterpolatedV(4.0D); ++ var17.setColorOpaque_F(par13, par13, par13); ++ var17.addVertexWithUV(par1, par7, par9, var22, var20); ++ var17.addVertexWithUV(par1, par5, par9, var18, var20); ++ var17.addVertexWithUV(par3, par5, par11, var18, var24); ++ var17.addVertexWithUV(par3, par7, par11, var22, var24); ++ } ++ ++ /** ++ * Render piston rod south/north ++ */ ++ private void renderPistonRodSN(double par1, double par3, double par5, double par7, double par9, double par11, float par13, double par14) { ++ Icon var16 = BlockPistonBase.getPistonBaseIcon("piston_side"); ++ ++ if (this.hasOverrideBlockTexture()) { ++ var16 = this.overrideBlockTexture; ++ } ++ ++ Tessellator var17 = Tessellator.instance; ++ double var18 = (double)var16.getMinU(); ++ double var20 = (double)var16.getMinV(); ++ double var22 = (double)var16.getInterpolatedU(par14); ++ double var24 = (double)var16.getInterpolatedV(4.0D); ++ var17.setColorOpaque_F(par13, par13, par13); ++ var17.addVertexWithUV(par1, par5, par11, var22, var20); ++ var17.addVertexWithUV(par1, par5, par9, var18, var20); ++ var17.addVertexWithUV(par3, par7, par9, var18, var24); ++ var17.addVertexWithUV(par3, par7, par11, var22, var24); ++ } ++ ++ /** ++ * Render piston rod east/west ++ */ ++ private void renderPistonRodEW(double par1, double par3, double par5, double par7, double par9, double par11, float par13, double par14) { ++ Icon var16 = BlockPistonBase.getPistonBaseIcon("piston_side"); ++ ++ if (this.hasOverrideBlockTexture()) { ++ var16 = this.overrideBlockTexture; ++ } ++ ++ Tessellator var17 = Tessellator.instance; ++ double var18 = (double)var16.getMinU(); ++ double var20 = (double)var16.getMinV(); ++ double var22 = (double)var16.getInterpolatedU(par14); ++ double var24 = (double)var16.getInterpolatedV(4.0D); ++ var17.setColorOpaque_F(par13, par13, par13); ++ var17.addVertexWithUV(par3, par5, par9, var22, var20); ++ var17.addVertexWithUV(par1, par5, par9, var18, var20); ++ var17.addVertexWithUV(par1, par7, par11, var18, var24); ++ var17.addVertexWithUV(par3, par7, par11, var22, var24); ++ } ++ ++ /** ++ * Render all faces of the piston extension ++ */ ++ public void renderPistonExtensionAllFaces(Block par1Block, int par2, int par3, int par4, boolean par5) { + this.renderAllFaces = true; +- this.renderPistonExtension(var1, var2, var3, var4, var5); ++ this.renderPistonExtension(par1Block, par2, par3, par4, par5); + this.renderAllFaces = false; + } + +- private boolean renderPistonExtension(Block var1, int var2, int var3, int var4, boolean var5) { +- int var6 = this.blockAccess.getBlockMetadata(var2, var3, var4); ++ /** ++ * renders the pushing part of a piston ++ */ ++ private boolean renderPistonExtension(Block par1Block, int par2, int par3, int par4, boolean par5) { ++ int var6 = this.blockAccess.getBlockMetadata(par2, par3, par4); + int var7 = BlockPistonExtension.getDirectionMeta(var6); + float var8 = 0.25F; +- float var9 = 6.0F / 16.0F; +- float var10 = 10.0F / 16.0F; +- float var11 = var1.getBlockBrightness(this.blockAccess, var2, var3, var4); +- float var12 = var5 ? 1.0F : 0.5F; +- double var13 = var5 ? 16.0D : 8.0D; +- switch(var7) { +- case 0: +- this.uvRotateEast = 3; +- this.uvRotateWest = 3; +- this.uvRotateSouth = 3; +- this.uvRotateNorth = 3; +- this.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 0.25D, 1.0D); +- this.renderStandardBlock(var1, var2, var3, var4); +- this.renderPistonRodUD((double)((float)var2 + 6.0F / 16.0F), (double)((float)var2 + 10.0F / 16.0F), (double)((float)var3 + 0.25F), (double)((float)var3 + 0.25F + var12), (double)((float)var4 + 10.0F / 16.0F), (double)((float)var4 + 10.0F / 16.0F), var11 * 0.8F, var13); +- this.renderPistonRodUD((double)((float)var2 + 10.0F / 16.0F), (double)((float)var2 + 6.0F / 16.0F), (double)((float)var3 + 0.25F), (double)((float)var3 + 0.25F + var12), (double)((float)var4 + 6.0F / 16.0F), (double)((float)var4 + 6.0F / 16.0F), var11 * 0.8F, var13); +- this.renderPistonRodUD((double)((float)var2 + 6.0F / 16.0F), (double)((float)var2 + 6.0F / 16.0F), (double)((float)var3 + 0.25F), (double)((float)var3 + 0.25F + var12), (double)((float)var4 + 6.0F / 16.0F), (double)((float)var4 + 10.0F / 16.0F), var11 * 0.6F, var13); +- this.renderPistonRodUD((double)((float)var2 + 10.0F / 16.0F), (double)((float)var2 + 10.0F / 16.0F), (double)((float)var3 + 0.25F), (double)((float)var3 + 0.25F + var12), (double)((float)var4 + 10.0F / 16.0F), (double)((float)var4 + 6.0F / 16.0F), var11 * 0.6F, var13); +- break; +- case 1: +- this.setRenderBounds(0.0D, 0.75D, 0.0D, 1.0D, 1.0D, 1.0D); +- this.renderStandardBlock(var1, var2, var3, var4); +- this.renderPistonRodUD((double)((float)var2 + 6.0F / 16.0F), (double)((float)var2 + 10.0F / 16.0F), (double)((float)var3 - 0.25F + 1.0F - var12), (double)((float)var3 - 0.25F + 1.0F), (double)((float)var4 + 10.0F / 16.0F), (double)((float)var4 + 10.0F / 16.0F), var11 * 0.8F, var13); +- this.renderPistonRodUD((double)((float)var2 + 10.0F / 16.0F), (double)((float)var2 + 6.0F / 16.0F), (double)((float)var3 - 0.25F + 1.0F - var12), (double)((float)var3 - 0.25F + 1.0F), (double)((float)var4 + 6.0F / 16.0F), (double)((float)var4 + 6.0F / 16.0F), var11 * 0.8F, var13); +- this.renderPistonRodUD((double)((float)var2 + 6.0F / 16.0F), (double)((float)var2 + 6.0F / 16.0F), (double)((float)var3 - 0.25F + 1.0F - var12), (double)((float)var3 - 0.25F + 1.0F), (double)((float)var4 + 6.0F / 16.0F), (double)((float)var4 + 10.0F / 16.0F), var11 * 0.6F, var13); +- this.renderPistonRodUD((double)((float)var2 + 10.0F / 16.0F), (double)((float)var2 + 10.0F / 16.0F), (double)((float)var3 - 0.25F + 1.0F - var12), (double)((float)var3 - 0.25F + 1.0F), (double)((float)var4 + 10.0F / 16.0F), (double)((float)var4 + 6.0F / 16.0F), var11 * 0.6F, var13); +- break; +- case 2: +- this.uvRotateSouth = 1; +- this.uvRotateNorth = 2; +- this.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 0.25D); +- this.renderStandardBlock(var1, var2, var3, var4); +- this.renderPistonRodSN((double)((float)var2 + 6.0F / 16.0F), (double)((float)var2 + 6.0F / 16.0F), (double)((float)var3 + 10.0F / 16.0F), (double)((float)var3 + 6.0F / 16.0F), (double)((float)var4 + 0.25F), (double)((float)var4 + 0.25F + var12), var11 * 0.6F, var13); +- this.renderPistonRodSN((double)((float)var2 + 10.0F / 16.0F), (double)((float)var2 + 10.0F / 16.0F), (double)((float)var3 + 6.0F / 16.0F), (double)((float)var3 + 10.0F / 16.0F), (double)((float)var4 + 0.25F), (double)((float)var4 + 0.25F + var12), var11 * 0.6F, var13); +- this.renderPistonRodSN((double)((float)var2 + 6.0F / 16.0F), (double)((float)var2 + 10.0F / 16.0F), (double)((float)var3 + 6.0F / 16.0F), (double)((float)var3 + 6.0F / 16.0F), (double)((float)var4 + 0.25F), (double)((float)var4 + 0.25F + var12), var11 * 0.5F, var13); +- this.renderPistonRodSN((double)((float)var2 + 10.0F / 16.0F), (double)((float)var2 + 6.0F / 16.0F), (double)((float)var3 + 10.0F / 16.0F), (double)((float)var3 + 10.0F / 16.0F), (double)((float)var4 + 0.25F), (double)((float)var4 + 0.25F + var12), var11, var13); +- break; +- case 3: +- this.uvRotateSouth = 2; +- this.uvRotateNorth = 1; +- this.uvRotateTop = 3; +- this.uvRotateBottom = 3; +- this.setRenderBounds(0.0D, 0.0D, 0.75D, 1.0D, 1.0D, 1.0D); +- this.renderStandardBlock(var1, var2, var3, var4); +- this.renderPistonRodSN((double)((float)var2 + 6.0F / 16.0F), (double)((float)var2 + 6.0F / 16.0F), (double)((float)var3 + 10.0F / 16.0F), (double)((float)var3 + 6.0F / 16.0F), (double)((float)var4 - 0.25F + 1.0F - var12), (double)((float)var4 - 0.25F + 1.0F), var11 * 0.6F, var13); +- this.renderPistonRodSN((double)((float)var2 + 10.0F / 16.0F), (double)((float)var2 + 10.0F / 16.0F), (double)((float)var3 + 6.0F / 16.0F), (double)((float)var3 + 10.0F / 16.0F), (double)((float)var4 - 0.25F + 1.0F - var12), (double)((float)var4 - 0.25F + 1.0F), var11 * 0.6F, var13); +- this.renderPistonRodSN((double)((float)var2 + 6.0F / 16.0F), (double)((float)var2 + 10.0F / 16.0F), (double)((float)var3 + 6.0F / 16.0F), (double)((float)var3 + 6.0F / 16.0F), (double)((float)var4 - 0.25F + 1.0F - var12), (double)((float)var4 - 0.25F + 1.0F), var11 * 0.5F, var13); +- this.renderPistonRodSN((double)((float)var2 + 10.0F / 16.0F), (double)((float)var2 + 6.0F / 16.0F), (double)((float)var3 + 10.0F / 16.0F), (double)((float)var3 + 10.0F / 16.0F), (double)((float)var4 - 0.25F + 1.0F - var12), (double)((float)var4 - 0.25F + 1.0F), var11, var13); +- break; +- case 4: +- this.uvRotateEast = 1; +- this.uvRotateWest = 2; +- this.uvRotateTop = 2; +- this.uvRotateBottom = 1; +- this.setRenderBounds(0.0D, 0.0D, 0.0D, 0.25D, 1.0D, 1.0D); +- this.renderStandardBlock(var1, var2, var3, var4); +- this.renderPistonRodEW((double)((float)var2 + 0.25F), (double)((float)var2 + 0.25F + var12), (double)((float)var3 + 6.0F / 16.0F), (double)((float)var3 + 6.0F / 16.0F), (double)((float)var4 + 10.0F / 16.0F), (double)((float)var4 + 6.0F / 16.0F), var11 * 0.5F, var13); +- this.renderPistonRodEW((double)((float)var2 + 0.25F), (double)((float)var2 + 0.25F + var12), (double)((float)var3 + 10.0F / 16.0F), (double)((float)var3 + 10.0F / 16.0F), (double)((float)var4 + 6.0F / 16.0F), (double)((float)var4 + 10.0F / 16.0F), var11, var13); +- this.renderPistonRodEW((double)((float)var2 + 0.25F), (double)((float)var2 + 0.25F + var12), (double)((float)var3 + 6.0F / 16.0F), (double)((float)var3 + 10.0F / 16.0F), (double)((float)var4 + 6.0F / 16.0F), (double)((float)var4 + 6.0F / 16.0F), var11 * 0.6F, var13); +- this.renderPistonRodEW((double)((float)var2 + 0.25F), (double)((float)var2 + 0.25F + var12), (double)((float)var3 + 10.0F / 16.0F), (double)((float)var3 + 6.0F / 16.0F), (double)((float)var4 + 10.0F / 16.0F), (double)((float)var4 + 10.0F / 16.0F), var11 * 0.6F, var13); +- break; +- case 5: +- this.uvRotateEast = 2; +- this.uvRotateWest = 1; +- this.uvRotateTop = 1; +- this.uvRotateBottom = 2; +- this.setRenderBounds(0.75D, 0.0D, 0.0D, 1.0D, 1.0D, 1.0D); +- this.renderStandardBlock(var1, var2, var3, var4); +- this.renderPistonRodEW((double)((float)var2 - 0.25F + 1.0F - var12), (double)((float)var2 - 0.25F + 1.0F), (double)((float)var3 + 6.0F / 16.0F), (double)((float)var3 + 6.0F / 16.0F), (double)((float)var4 + 10.0F / 16.0F), (double)((float)var4 + 6.0F / 16.0F), var11 * 0.5F, var13); +- this.renderPistonRodEW((double)((float)var2 - 0.25F + 1.0F - var12), (double)((float)var2 - 0.25F + 1.0F), (double)((float)var3 + 10.0F / 16.0F), (double)((float)var3 + 10.0F / 16.0F), (double)((float)var4 + 6.0F / 16.0F), (double)((float)var4 + 10.0F / 16.0F), var11, var13); +- this.renderPistonRodEW((double)((float)var2 - 0.25F + 1.0F - var12), (double)((float)var2 - 0.25F + 1.0F), (double)((float)var3 + 6.0F / 16.0F), (double)((float)var3 + 10.0F / 16.0F), (double)((float)var4 + 6.0F / 16.0F), (double)((float)var4 + 6.0F / 16.0F), var11 * 0.6F, var13); +- this.renderPistonRodEW((double)((float)var2 - 0.25F + 1.0F - var12), (double)((float)var2 - 0.25F + 1.0F), (double)((float)var3 + 10.0F / 16.0F), (double)((float)var3 + 6.0F / 16.0F), (double)((float)var4 + 10.0F / 16.0F), (double)((float)var4 + 10.0F / 16.0F), var11 * 0.6F, var13); ++ float var9 = 0.375F; ++ float var10 = 0.625F; ++ float var11 = par1Block.getBlockBrightness(this.blockAccess, par2, par3, par4); ++ float var12 = par5 ? 1.0F : 0.5F; ++ double var13 = par5 ? 16.0D : 8.0D; ++ ++ switch (var7) { ++ case 0: ++ this.uvRotateEast = 3; ++ this.uvRotateWest = 3; ++ this.uvRotateSouth = 3; ++ this.uvRotateNorth = 3; ++ this.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 0.25D, 1.0D); ++ this.renderStandardBlock(par1Block, par2, par3, par4); ++ this.renderPistonRodUD((double)((float)par2 + 0.375F), (double)((float)par2 + 0.625F), (double)((float)par3 + 0.25F), (double)((float)par3 + 0.25F + var12), (double)((float)par4 + 0.625F), (double)((float)par4 + 0.625F), var11 * 0.8F, var13); ++ this.renderPistonRodUD((double)((float)par2 + 0.625F), (double)((float)par2 + 0.375F), (double)((float)par3 + 0.25F), (double)((float)par3 + 0.25F + var12), (double)((float)par4 + 0.375F), (double)((float)par4 + 0.375F), var11 * 0.8F, var13); ++ this.renderPistonRodUD((double)((float)par2 + 0.375F), (double)((float)par2 + 0.375F), (double)((float)par3 + 0.25F), (double)((float)par3 + 0.25F + var12), (double)((float)par4 + 0.375F), (double)((float)par4 + 0.625F), var11 * 0.6F, var13); ++ this.renderPistonRodUD((double)((float)par2 + 0.625F), (double)((float)par2 + 0.625F), (double)((float)par3 + 0.25F), (double)((float)par3 + 0.25F + var12), (double)((float)par4 + 0.625F), (double)((float)par4 + 0.375F), var11 * 0.6F, var13); ++ break; ++ ++ case 1: ++ this.setRenderBounds(0.0D, 0.75D, 0.0D, 1.0D, 1.0D, 1.0D); ++ this.renderStandardBlock(par1Block, par2, par3, par4); ++ this.renderPistonRodUD((double)((float)par2 + 0.375F), (double)((float)par2 + 0.625F), (double)((float)par3 - 0.25F + 1.0F - var12), (double)((float)par3 - 0.25F + 1.0F), (double)((float)par4 + 0.625F), (double)((float)par4 + 0.625F), var11 * 0.8F, var13); ++ this.renderPistonRodUD((double)((float)par2 + 0.625F), (double)((float)par2 + 0.375F), (double)((float)par3 - 0.25F + 1.0F - var12), (double)((float)par3 - 0.25F + 1.0F), (double)((float)par4 + 0.375F), (double)((float)par4 + 0.375F), var11 * 0.8F, var13); ++ this.renderPistonRodUD((double)((float)par2 + 0.375F), (double)((float)par2 + 0.375F), (double)((float)par3 - 0.25F + 1.0F - var12), (double)((float)par3 - 0.25F + 1.0F), (double)((float)par4 + 0.375F), (double)((float)par4 + 0.625F), var11 * 0.6F, var13); ++ this.renderPistonRodUD((double)((float)par2 + 0.625F), (double)((float)par2 + 0.625F), (double)((float)par3 - 0.25F + 1.0F - var12), (double)((float)par3 - 0.25F + 1.0F), (double)((float)par4 + 0.625F), (double)((float)par4 + 0.375F), var11 * 0.6F, var13); ++ break; ++ ++ case 2: ++ this.uvRotateSouth = 1; ++ this.uvRotateNorth = 2; ++ this.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 0.25D); ++ this.renderStandardBlock(par1Block, par2, par3, par4); ++ this.renderPistonRodSN((double)((float)par2 + 0.375F), (double)((float)par2 + 0.375F), (double)((float)par3 + 0.625F), (double)((float)par3 + 0.375F), (double)((float)par4 + 0.25F), (double)((float)par4 + 0.25F + var12), var11 * 0.6F, var13); ++ this.renderPistonRodSN((double)((float)par2 + 0.625F), (double)((float)par2 + 0.625F), (double)((float)par3 + 0.375F), (double)((float)par3 + 0.625F), (double)((float)par4 + 0.25F), (double)((float)par4 + 0.25F + var12), var11 * 0.6F, var13); ++ this.renderPistonRodSN((double)((float)par2 + 0.375F), (double)((float)par2 + 0.625F), (double)((float)par3 + 0.375F), (double)((float)par3 + 0.375F), (double)((float)par4 + 0.25F), (double)((float)par4 + 0.25F + var12), var11 * 0.5F, var13); ++ this.renderPistonRodSN((double)((float)par2 + 0.625F), (double)((float)par2 + 0.375F), (double)((float)par3 + 0.625F), (double)((float)par3 + 0.625F), (double)((float)par4 + 0.25F), (double)((float)par4 + 0.25F + var12), var11, var13); ++ break; ++ ++ case 3: ++ this.uvRotateSouth = 2; ++ this.uvRotateNorth = 1; ++ this.uvRotateTop = 3; ++ this.uvRotateBottom = 3; ++ this.setRenderBounds(0.0D, 0.0D, 0.75D, 1.0D, 1.0D, 1.0D); ++ this.renderStandardBlock(par1Block, par2, par3, par4); ++ this.renderPistonRodSN((double)((float)par2 + 0.375F), (double)((float)par2 + 0.375F), (double)((float)par3 + 0.625F), (double)((float)par3 + 0.375F), (double)((float)par4 - 0.25F + 1.0F - var12), (double)((float)par4 - 0.25F + 1.0F), var11 * 0.6F, var13); ++ this.renderPistonRodSN((double)((float)par2 + 0.625F), (double)((float)par2 + 0.625F), (double)((float)par3 + 0.375F), (double)((float)par3 + 0.625F), (double)((float)par4 - 0.25F + 1.0F - var12), (double)((float)par4 - 0.25F + 1.0F), var11 * 0.6F, var13); ++ this.renderPistonRodSN((double)((float)par2 + 0.375F), (double)((float)par2 + 0.625F), (double)((float)par3 + 0.375F), (double)((float)par3 + 0.375F), (double)((float)par4 - 0.25F + 1.0F - var12), (double)((float)par4 - 0.25F + 1.0F), var11 * 0.5F, var13); ++ this.renderPistonRodSN((double)((float)par2 + 0.625F), (double)((float)par2 + 0.375F), (double)((float)par3 + 0.625F), (double)((float)par3 + 0.625F), (double)((float)par4 - 0.25F + 1.0F - var12), (double)((float)par4 - 0.25F + 1.0F), var11, var13); ++ break; ++ ++ case 4: ++ this.uvRotateEast = 1; ++ this.uvRotateWest = 2; ++ this.uvRotateTop = 2; ++ this.uvRotateBottom = 1; ++ this.setRenderBounds(0.0D, 0.0D, 0.0D, 0.25D, 1.0D, 1.0D); ++ this.renderStandardBlock(par1Block, par2, par3, par4); ++ this.renderPistonRodEW((double)((float)par2 + 0.25F), (double)((float)par2 + 0.25F + var12), (double)((float)par3 + 0.375F), (double)((float)par3 + 0.375F), (double)((float)par4 + 0.625F), (double)((float)par4 + 0.375F), var11 * 0.5F, var13); ++ this.renderPistonRodEW((double)((float)par2 + 0.25F), (double)((float)par2 + 0.25F + var12), (double)((float)par3 + 0.625F), (double)((float)par3 + 0.625F), (double)((float)par4 + 0.375F), (double)((float)par4 + 0.625F), var11, var13); ++ this.renderPistonRodEW((double)((float)par2 + 0.25F), (double)((float)par2 + 0.25F + var12), (double)((float)par3 + 0.375F), (double)((float)par3 + 0.625F), (double)((float)par4 + 0.375F), (double)((float)par4 + 0.375F), var11 * 0.6F, var13); ++ this.renderPistonRodEW((double)((float)par2 + 0.25F), (double)((float)par2 + 0.25F + var12), (double)((float)par3 + 0.625F), (double)((float)par3 + 0.375F), (double)((float)par4 + 0.625F), (double)((float)par4 + 0.625F), var11 * 0.6F, var13); ++ break; ++ ++ case 5: ++ this.uvRotateEast = 2; ++ this.uvRotateWest = 1; ++ this.uvRotateTop = 1; ++ this.uvRotateBottom = 2; ++ this.setRenderBounds(0.75D, 0.0D, 0.0D, 1.0D, 1.0D, 1.0D); ++ this.renderStandardBlock(par1Block, par2, par3, par4); ++ this.renderPistonRodEW((double)((float)par2 - 0.25F + 1.0F - var12), (double)((float)par2 - 0.25F + 1.0F), (double)((float)par3 + 0.375F), (double)((float)par3 + 0.375F), (double)((float)par4 + 0.625F), (double)((float)par4 + 0.375F), var11 * 0.5F, var13); ++ this.renderPistonRodEW((double)((float)par2 - 0.25F + 1.0F - var12), (double)((float)par2 - 0.25F + 1.0F), (double)((float)par3 + 0.625F), (double)((float)par3 + 0.625F), (double)((float)par4 + 0.375F), (double)((float)par4 + 0.625F), var11, var13); ++ this.renderPistonRodEW((double)((float)par2 - 0.25F + 1.0F - var12), (double)((float)par2 - 0.25F + 1.0F), (double)((float)par3 + 0.375F), (double)((float)par3 + 0.625F), (double)((float)par4 + 0.375F), (double)((float)par4 + 0.375F), var11 * 0.6F, var13); ++ this.renderPistonRodEW((double)((float)par2 - 0.25F + 1.0F - var12), (double)((float)par2 - 0.25F + 1.0F), (double)((float)par3 + 0.625F), (double)((float)par3 + 0.375F), (double)((float)par4 + 0.625F), (double)((float)par4 + 0.625F), var11 * 0.6F, var13); + } + + this.uvRotateEast = 0; +@@ -1087,1200 +1445,1354 @@ + return true; + } + +- public boolean renderBlockLever(Block var1, int var2, int var3, int var4) { +- int var5 = this.blockAccess.getBlockMetadata(var2, var3, var4); ++ /** ++ * Renders a lever block at the given coordinates ++ */ ++ public boolean renderBlockLever(Block par1Block, int par2, int par3, int par4) { ++ int var5 = this.blockAccess.getBlockMetadata(par2, par3, par4); + int var6 = var5 & 7; + boolean var7 = (var5 & 8) > 0; + Tessellator var8 = Tessellator.instance; + boolean var9 = this.hasOverrideBlockTexture(); +- if(!var9) { ++ ++ if (!var9) { + this.setOverrideBlockTexture(this.getBlockIcon(Block.cobblestone)); + } + + float var10 = 0.25F; +- float var11 = 3.0F / 16.0F; +- float var12 = 3.0F / 16.0F; +- if(var6 == 5) { ++ float var11 = 0.1875F; ++ float var12 = 0.1875F; ++ ++ if (var6 == 5) { + this.setRenderBounds((double)(0.5F - var11), 0.0D, (double)(0.5F - var10), (double)(0.5F + var11), (double)var12, (double)(0.5F + var10)); +- } else if(var6 == 6) { ++ } else if (var6 == 6) { + this.setRenderBounds((double)(0.5F - var10), 0.0D, (double)(0.5F - var11), (double)(0.5F + var10), (double)var12, (double)(0.5F + var11)); +- } else if(var6 == 4) { ++ } else if (var6 == 4) { + this.setRenderBounds((double)(0.5F - var11), (double)(0.5F - var10), (double)(1.0F - var12), (double)(0.5F + var11), (double)(0.5F + var10), 1.0D); +- } else if(var6 == 3) { ++ } else if (var6 == 3) { + this.setRenderBounds((double)(0.5F - var11), (double)(0.5F - var10), 0.0D, (double)(0.5F + var11), (double)(0.5F + var10), (double)var12); +- } else if(var6 == 2) { ++ } else if (var6 == 2) { + this.setRenderBounds((double)(1.0F - var12), (double)(0.5F - var10), (double)(0.5F - var11), 1.0D, (double)(0.5F + var10), (double)(0.5F + var11)); +- } else if(var6 == 1) { ++ } else if (var6 == 1) { + this.setRenderBounds(0.0D, (double)(0.5F - var10), (double)(0.5F - var11), (double)var12, (double)(0.5F + var10), (double)(0.5F + var11)); +- } else if(var6 == 0) { ++ } else if (var6 == 0) { + this.setRenderBounds((double)(0.5F - var10), (double)(1.0F - var12), (double)(0.5F - var11), (double)(0.5F + var10), 1.0D, (double)(0.5F + var11)); +- } else if(var6 == 7) { ++ } else if (var6 == 7) { + this.setRenderBounds((double)(0.5F - var11), (double)(1.0F - var12), (double)(0.5F - var10), (double)(0.5F + var11), 1.0D, (double)(0.5F + var10)); + } + +- this.renderStandardBlock(var1, var2, var3, var4); +- if(!var9) { ++ this.renderStandardBlock(par1Block, par2, par3, par4); ++ ++ if (!var9) { + this.clearOverrideBlockTexture(); + } + +- var8.setBrightness(var1.getMixedBrightnessForBlock(this.blockAccess, var2, var3, var4)); ++ var8.setBrightness(par1Block.getMixedBrightnessForBlock(this.blockAccess, par2, par3, par4)); + float var13 = 1.0F; +- if(Block.lightValue[var1.blockID] > 0) { ++ ++ if (Block.lightValue[par1Block.blockID] > 0) { + var13 = 1.0F; + } + + var8.setColorOpaque_F(var13, var13, var13); +- Icon var14 = this.getBlockIconFromSide(var1, 0); +- if(this.hasOverrideBlockTexture()) { ++ Icon var14 = this.getBlockIconFromSide(par1Block, 0); ++ ++ if (this.hasOverrideBlockTexture()) { + var14 = this.overrideBlockTexture; + } + +- double var15 = (double)var14.getMinU(); +- double var17 = (double)var14.getMinV(); +- double var19 = (double)var14.getMaxU(); +- double var21 = (double)var14.getMaxV(); +- Vec3[] var23 = new Vec3[8]; +- float var24 = 1.0F / 16.0F; +- float var25 = 1.0F / 16.0F; +- float var26 = 10.0F / 16.0F; +- var23[0] = this.blockAccess.getWorldVec3Pool().getVecFromPool((double)(-var24), 0.0D, (double)(-var25)); +- var23[1] = this.blockAccess.getWorldVec3Pool().getVecFromPool((double)var24, 0.0D, (double)(-var25)); +- var23[2] = this.blockAccess.getWorldVec3Pool().getVecFromPool((double)var24, 0.0D, (double)var25); +- var23[3] = this.blockAccess.getWorldVec3Pool().getVecFromPool((double)(-var24), 0.0D, (double)var25); +- var23[4] = this.blockAccess.getWorldVec3Pool().getVecFromPool((double)(-var24), (double)var26, (double)(-var25)); +- var23[5] = this.blockAccess.getWorldVec3Pool().getVecFromPool((double)var24, (double)var26, (double)(-var25)); +- var23[6] = this.blockAccess.getWorldVec3Pool().getVecFromPool((double)var24, (double)var26, (double)var25); +- var23[7] = this.blockAccess.getWorldVec3Pool().getVecFromPool((double)(-var24), (double)var26, (double)var25); +- +- for(int var27 = 0; var27 < 8; ++var27) { +- if(var7) { +- var23[var27].zCoord -= 1.0D / 16.0D; +- var23[var27].rotateAroundX((float)Math.PI * 2.0F / 9.0F); +- } else { +- var23[var27].zCoord += 1.0D / 16.0D; +- var23[var27].rotateAroundX(-((float)Math.PI * 2.0F / 9.0F)); +- } +- +- if(var6 == 0 || var6 == 7) { +- var23[var27].rotateAroundZ((float)Math.PI); +- } +- +- if(var6 == 6 || var6 == 0) { +- var23[var27].rotateAroundY((float)Math.PI * 0.5F); +- } +- +- if(var6 > 0 && var6 < 5) { +- var23[var27].yCoord -= 0.375D; +- var23[var27].rotateAroundX((float)Math.PI * 0.5F); +- if(var6 == 4) { +- var23[var27].rotateAroundY(0.0F); +- } +- +- if(var6 == 3) { +- var23[var27].rotateAroundY((float)Math.PI); +- } +- +- if(var6 == 2) { +- var23[var27].rotateAroundY((float)Math.PI * 0.5F); +- } +- +- if(var6 == 1) { +- var23[var27].rotateAroundY((float)Math.PI * -0.5F); +- } +- +- var23[var27].xCoord += (double)var2 + 0.5D; +- var23[var27].yCoord += (double)((float)var3 + 0.5F); +- var23[var27].zCoord += (double)var4 + 0.5D; +- } else if(var6 != 0 && var6 != 7) { +- var23[var27].xCoord += (double)var2 + 0.5D; +- var23[var27].yCoord += (double)((float)var3 + 2.0F / 16.0F); +- var23[var27].zCoord += (double)var4 + 0.5D; +- } else { +- var23[var27].xCoord += (double)var2 + 0.5D; +- var23[var27].yCoord += (double)((float)var3 + 14.0F / 16.0F); +- var23[var27].zCoord += (double)var4 + 0.5D; +- } +- } +- +- Vec3 var32 = null; +- Vec3 var28 = null; +- Vec3 var29 = null; +- Vec3 var30 = null; +- +- for(int var31 = 0; var31 < 6; ++var31) { +- if(var31 == 0) { +- var15 = (double)var14.getInterpolatedU(7.0D); +- var17 = (double)var14.getInterpolatedV(6.0D); +- var19 = (double)var14.getInterpolatedU(9.0D); +- var21 = (double)var14.getInterpolatedV(8.0D); +- } else if(var31 == 2) { +- var15 = (double)var14.getInterpolatedU(7.0D); +- var17 = (double)var14.getInterpolatedV(6.0D); +- var19 = (double)var14.getInterpolatedU(9.0D); +- var21 = (double)var14.getMaxV(); +- } +- +- if(var31 == 0) { +- var32 = var23[0]; +- var28 = var23[1]; +- var29 = var23[2]; +- var30 = var23[3]; +- } else if(var31 == 1) { +- var32 = var23[7]; +- var28 = var23[6]; +- var29 = var23[5]; +- var30 = var23[4]; +- } else if(var31 == 2) { +- var32 = var23[1]; +- var28 = var23[0]; +- var29 = var23[4]; +- var30 = var23[5]; +- } else if(var31 == 3) { +- var32 = var23[2]; +- var28 = var23[1]; +- var29 = var23[5]; +- var30 = var23[6]; +- } else if(var31 == 4) { +- var32 = var23[3]; +- var28 = var23[2]; +- var29 = var23[6]; +- var30 = var23[7]; +- } else if(var31 == 5) { +- var32 = var23[0]; +- var28 = var23[3]; +- var29 = var23[7]; +- var30 = var23[4]; +- } +- +- var8.addVertexWithUV(var32.xCoord, var32.yCoord, var32.zCoord, var15, var21); +- var8.addVertexWithUV(var28.xCoord, var28.yCoord, var28.zCoord, var19, var21); +- var8.addVertexWithUV(var29.xCoord, var29.yCoord, var29.zCoord, var19, var17); +- var8.addVertexWithUV(var30.xCoord, var30.yCoord, var30.zCoord, var15, var17); +- } +- +- return true; ++ var14 = CTMUtils.getTile(this, par1Block, par2, par3, par4, var14, var8); ++ ++ if (var14 == null) { ++ return false; ++ } else { ++ var8 = TessellatorUtils.getTessellator(var8, var14); ++ double var15 = (double)var14.getMinU(); ++ double var17 = (double)var14.getMinV(); ++ double var19 = (double)var14.getMaxU(); ++ double var21 = (double)var14.getMaxV(); ++ Vec3[] var23 = new Vec3[8]; ++ float var24 = 0.0625F; ++ float var25 = 0.0625F; ++ float var26 = 0.625F; ++ var23[0] = this.blockAccess.getWorldVec3Pool().getVecFromPool((double)(-var24), 0.0D, (double)(-var25)); ++ var23[1] = this.blockAccess.getWorldVec3Pool().getVecFromPool((double)var24, 0.0D, (double)(-var25)); ++ var23[2] = this.blockAccess.getWorldVec3Pool().getVecFromPool((double)var24, 0.0D, (double)var25); ++ var23[3] = this.blockAccess.getWorldVec3Pool().getVecFromPool((double)(-var24), 0.0D, (double)var25); ++ var23[4] = this.blockAccess.getWorldVec3Pool().getVecFromPool((double)(-var24), (double)var26, (double)(-var25)); ++ var23[5] = this.blockAccess.getWorldVec3Pool().getVecFromPool((double)var24, (double)var26, (double)(-var25)); ++ var23[6] = this.blockAccess.getWorldVec3Pool().getVecFromPool((double)var24, (double)var26, (double)var25); ++ var23[7] = this.blockAccess.getWorldVec3Pool().getVecFromPool((double)(-var24), (double)var26, (double)var25); ++ ++ for (int var27 = 0; var27 < 8; ++var27) { ++ if (var7) { ++ var23[var27].zCoord -= 0.0625D; ++ var23[var27].rotateAroundX(((float)Math.PI * 2F / 9F)); ++ } else { ++ var23[var27].zCoord += 0.0625D; ++ var23[var27].rotateAroundX(-((float)Math.PI * 2F / 9F)); ++ } ++ ++ if (var6 == 0 || var6 == 7) { ++ var23[var27].rotateAroundZ((float)Math.PI); ++ } ++ ++ if (var6 == 6 || var6 == 0) { ++ var23[var27].rotateAroundY(((float)Math.PI / 2F)); ++ } ++ ++ if (var6 > 0 && var6 < 5) { ++ var23[var27].yCoord -= 0.375D; ++ var23[var27].rotateAroundX(((float)Math.PI / 2F)); ++ ++ if (var6 == 4) { ++ var23[var27].rotateAroundY(0.0F); ++ } ++ ++ if (var6 == 3) { ++ var23[var27].rotateAroundY((float)Math.PI); ++ } ++ ++ if (var6 == 2) { ++ var23[var27].rotateAroundY(((float)Math.PI / 2F)); ++ } ++ ++ if (var6 == 1) { ++ var23[var27].rotateAroundY(-((float)Math.PI / 2F)); ++ } ++ ++ var23[var27].xCoord += (double)par2 + 0.5D; ++ var23[var27].yCoord += (double)((float)par3 + 0.5F); ++ var23[var27].zCoord += (double)par4 + 0.5D; ++ } else if (var6 != 0 && var6 != 7) { ++ var23[var27].xCoord += (double)par2 + 0.5D; ++ var23[var27].yCoord += (double)((float)par3 + 0.125F); ++ var23[var27].zCoord += (double)par4 + 0.5D; ++ } else { ++ var23[var27].xCoord += (double)par2 + 0.5D; ++ var23[var27].yCoord += (double)((float)par3 + 0.875F); ++ var23[var27].zCoord += (double)par4 + 0.5D; ++ } ++ } ++ ++ Vec3 var32 = null; ++ Vec3 var28 = null; ++ Vec3 var29 = null; ++ Vec3 var30 = null; ++ ++ for (int var31 = 0; var31 < 6; ++var31) { ++ if (var31 == 0) { ++ var15 = (double)var14.getInterpolatedU(7.0D); ++ var17 = (double)var14.getInterpolatedV(6.0D); ++ var19 = (double)var14.getInterpolatedU(9.0D); ++ var21 = (double)var14.getInterpolatedV(8.0D); ++ } else if (var31 == 2) { ++ var15 = (double)var14.getInterpolatedU(7.0D); ++ var17 = (double)var14.getInterpolatedV(6.0D); ++ var19 = (double)var14.getInterpolatedU(9.0D); ++ var21 = (double)var14.getMaxV(); ++ } ++ ++ if (var31 == 0) { ++ var32 = var23[0]; ++ var28 = var23[1]; ++ var29 = var23[2]; ++ var30 = var23[3]; ++ } else if (var31 == 1) { ++ var32 = var23[7]; ++ var28 = var23[6]; ++ var29 = var23[5]; ++ var30 = var23[4]; ++ } else if (var31 == 2) { ++ var32 = var23[1]; ++ var28 = var23[0]; ++ var29 = var23[4]; ++ var30 = var23[5]; ++ } else if (var31 == 3) { ++ var32 = var23[2]; ++ var28 = var23[1]; ++ var29 = var23[5]; ++ var30 = var23[6]; ++ } else if (var31 == 4) { ++ var32 = var23[3]; ++ var28 = var23[2]; ++ var29 = var23[6]; ++ var30 = var23[7]; ++ } else if (var31 == 5) { ++ var32 = var23[0]; ++ var28 = var23[3]; ++ var29 = var23[7]; ++ var30 = var23[4]; ++ } ++ ++ var8.addVertexWithUV(var32.xCoord, var32.yCoord, var32.zCoord, var15, var21); ++ var8.addVertexWithUV(var28.xCoord, var28.yCoord, var28.zCoord, var19, var21); ++ var8.addVertexWithUV(var29.xCoord, var29.yCoord, var29.zCoord, var19, var17); ++ var8.addVertexWithUV(var30.xCoord, var30.yCoord, var30.zCoord, var15, var17); ++ } ++ ++ return true; ++ } + } + +- public boolean renderBlockTripWireSource(Block var1, int var2, int var3, int var4) { ++ /** ++ * Renders a trip wire source block at the given coordinates ++ */ ++ public boolean renderBlockTripWireSource(Block par1Block, int par2, int par3, int par4) { + Tessellator var5 = Tessellator.instance; +- int var6 = this.blockAccess.getBlockMetadata(var2, var3, var4); ++ int var6 = this.blockAccess.getBlockMetadata(par2, par3, par4); + int var7 = var6 & 3; + boolean var8 = (var6 & 4) == 4; + boolean var9 = (var6 & 8) == 8; +- boolean var10 = !this.blockAccess.doesBlockHaveSolidTopSurface(var2, var3 - 1, var4); ++ boolean var10 = !this.blockAccess.doesBlockHaveSolidTopSurface(par2, par3 - 1, par4); + boolean var11 = this.hasOverrideBlockTexture(); +- if(!var11) { ++ ++ if (!var11) { + this.setOverrideBlockTexture(this.getBlockIcon(Block.planks)); + } + + float var12 = 0.25F; +- float var13 = 2.0F / 16.0F; +- float var14 = 2.0F / 16.0F; ++ float var13 = 0.125F; ++ float var14 = 0.125F; + float var15 = 0.3F - var12; + float var16 = 0.3F + var12; +- if(var7 == 2) { ++ ++ if (var7 == 2) { + this.setRenderBounds((double)(0.5F - var13), (double)var15, (double)(1.0F - var14), (double)(0.5F + var13), (double)var16, 1.0D); +- } else if(var7 == 0) { ++ } else if (var7 == 0) { + this.setRenderBounds((double)(0.5F - var13), (double)var15, 0.0D, (double)(0.5F + var13), (double)var16, (double)var14); +- } else if(var7 == 1) { ++ } else if (var7 == 1) { + this.setRenderBounds((double)(1.0F - var14), (double)var15, (double)(0.5F - var13), 1.0D, (double)var16, (double)(0.5F + var13)); +- } else if(var7 == 3) { ++ } else if (var7 == 3) { + this.setRenderBounds(0.0D, (double)var15, (double)(0.5F - var13), (double)var14, (double)var16, (double)(0.5F + var13)); + } + +- this.renderStandardBlock(var1, var2, var3, var4); +- if(!var11) { ++ this.renderStandardBlock(par1Block, par2, par3, par4); ++ ++ if (!var11) { + this.clearOverrideBlockTexture(); + } + +- var5.setBrightness(var1.getMixedBrightnessForBlock(this.blockAccess, var2, var3, var4)); ++ var5.setBrightness(par1Block.getMixedBrightnessForBlock(this.blockAccess, par2, par3, par4)); + float var17 = 1.0F; +- if(Block.lightValue[var1.blockID] > 0) { ++ ++ if (Block.lightValue[par1Block.blockID] > 0) { + var17 = 1.0F; + } + + var5.setColorOpaque_F(var17, var17, var17); +- Icon var18 = this.getBlockIconFromSide(var1, 0); +- if(this.hasOverrideBlockTexture()) { ++ Icon var18 = this.getBlockIconFromSide(par1Block, 0); ++ ++ if (this.hasOverrideBlockTexture()) { + var18 = this.overrideBlockTexture; + } + +- double var19 = (double)var18.getMinU(); +- double var21 = (double)var18.getMinV(); +- double var23 = (double)var18.getMaxU(); +- double var25 = (double)var18.getMaxV(); +- Vec3[] var27 = new Vec3[8]; +- float var28 = 0.046875F; +- float var29 = 0.046875F; +- float var30 = 5.0F / 16.0F; +- var27[0] = this.blockAccess.getWorldVec3Pool().getVecFromPool((double)(-var28), 0.0D, (double)(-var29)); +- var27[1] = this.blockAccess.getWorldVec3Pool().getVecFromPool((double)var28, 0.0D, (double)(-var29)); +- var27[2] = this.blockAccess.getWorldVec3Pool().getVecFromPool((double)var28, 0.0D, (double)var29); +- var27[3] = this.blockAccess.getWorldVec3Pool().getVecFromPool((double)(-var28), 0.0D, (double)var29); +- var27[4] = this.blockAccess.getWorldVec3Pool().getVecFromPool((double)(-var28), (double)var30, (double)(-var29)); +- var27[5] = this.blockAccess.getWorldVec3Pool().getVecFromPool((double)var28, (double)var30, (double)(-var29)); +- var27[6] = this.blockAccess.getWorldVec3Pool().getVecFromPool((double)var28, (double)var30, (double)var29); +- var27[7] = this.blockAccess.getWorldVec3Pool().getVecFromPool((double)(-var28), (double)var30, (double)var29); +- +- for(int var31 = 0; var31 < 8; ++var31) { +- var27[var31].zCoord += 1.0D / 16.0D; +- if(var9) { +- var27[var31].rotateAroundX(0.5235988F); +- var27[var31].yCoord -= 0.4375D; +- } else if(var8) { +- var27[var31].rotateAroundX(0.08726647F); +- var27[var31].yCoord -= 0.4375D; +- } else { +- var27[var31].rotateAroundX(-((float)Math.PI * 2.0F / 9.0F)); +- var27[var31].yCoord -= 0.375D; +- } +- +- var27[var31].rotateAroundX((float)Math.PI * 0.5F); +- if(var7 == 2) { +- var27[var31].rotateAroundY(0.0F); +- } +- +- if(var7 == 0) { +- var27[var31].rotateAroundY((float)Math.PI); +- } +- +- if(var7 == 1) { +- var27[var31].rotateAroundY((float)Math.PI * 0.5F); +- } +- +- if(var7 == 3) { +- var27[var31].rotateAroundY((float)Math.PI * -0.5F); +- } +- +- var27[var31].xCoord += (double)var2 + 0.5D; +- var27[var31].yCoord += (double)((float)var3 + 5.0F / 16.0F); +- var27[var31].zCoord += (double)var4 + 0.5D; +- } +- +- Vec3 var62 = null; +- Vec3 var32 = null; +- Vec3 var33 = null; +- Vec3 var34 = null; +- byte var35 = 7; +- byte var36 = 9; +- byte var37 = 9; +- byte var38 = 16; +- +- for(int var39 = 0; var39 < 6; ++var39) { +- if(var39 == 0) { +- var62 = var27[0]; +- var32 = var27[1]; +- var33 = var27[2]; +- var34 = var27[3]; +- var19 = (double)var18.getInterpolatedU((double)var35); +- var21 = (double)var18.getInterpolatedV((double)var37); +- var23 = (double)var18.getInterpolatedU((double)var36); +- var25 = (double)var18.getInterpolatedV((double)(var37 + 2)); +- } else if(var39 == 1) { +- var62 = var27[7]; +- var32 = var27[6]; +- var33 = var27[5]; +- var34 = var27[4]; +- } else if(var39 == 2) { +- var62 = var27[1]; +- var32 = var27[0]; +- var33 = var27[4]; +- var34 = var27[5]; +- var19 = (double)var18.getInterpolatedU((double)var35); +- var21 = (double)var18.getInterpolatedV((double)var37); +- var23 = (double)var18.getInterpolatedU((double)var36); +- var25 = (double)var18.getInterpolatedV((double)var38); +- } else if(var39 == 3) { +- var62 = var27[2]; +- var32 = var27[1]; +- var33 = var27[5]; +- var34 = var27[6]; +- } else if(var39 == 4) { +- var62 = var27[3]; +- var32 = var27[2]; +- var33 = var27[6]; +- var34 = var27[7]; +- } else if(var39 == 5) { +- var62 = var27[0]; +- var32 = var27[3]; +- var33 = var27[7]; +- var34 = var27[4]; +- } +- +- var5.addVertexWithUV(var62.xCoord, var62.yCoord, var62.zCoord, var19, var25); +- var5.addVertexWithUV(var32.xCoord, var32.yCoord, var32.zCoord, var23, var25); +- var5.addVertexWithUV(var33.xCoord, var33.yCoord, var33.zCoord, var23, var21); +- var5.addVertexWithUV(var34.xCoord, var34.yCoord, var34.zCoord, var19, var21); +- } +- +- float var63 = 0.09375F; +- float var40 = 0.09375F; +- float var41 = 0.03125F; +- var27[0] = this.blockAccess.getWorldVec3Pool().getVecFromPool((double)(-var63), 0.0D, (double)(-var40)); +- var27[1] = this.blockAccess.getWorldVec3Pool().getVecFromPool((double)var63, 0.0D, (double)(-var40)); +- var27[2] = this.blockAccess.getWorldVec3Pool().getVecFromPool((double)var63, 0.0D, (double)var40); +- var27[3] = this.blockAccess.getWorldVec3Pool().getVecFromPool((double)(-var63), 0.0D, (double)var40); +- var27[4] = this.blockAccess.getWorldVec3Pool().getVecFromPool((double)(-var63), (double)var41, (double)(-var40)); +- var27[5] = this.blockAccess.getWorldVec3Pool().getVecFromPool((double)var63, (double)var41, (double)(-var40)); +- var27[6] = this.blockAccess.getWorldVec3Pool().getVecFromPool((double)var63, (double)var41, (double)var40); +- var27[7] = this.blockAccess.getWorldVec3Pool().getVecFromPool((double)(-var63), (double)var41, (double)var40); +- +- for(int var42 = 0; var42 < 8; ++var42) { +- var27[var42].zCoord += 0.21875D; +- if(var9) { +- var27[var42].yCoord -= 0.09375D; +- var27[var42].zCoord -= 0.1625D; +- var27[var42].rotateAroundX(0.0F); +- } else if(var8) { +- var27[var42].yCoord += 1.0D / 64.0D; +- var27[var42].zCoord -= 0.171875D; +- var27[var42].rotateAroundX(0.17453294F); +- } else { +- var27[var42].rotateAroundX(0.87266463F); +- } +- +- if(var7 == 2) { +- var27[var42].rotateAroundY(0.0F); +- } +- +- if(var7 == 0) { +- var27[var42].rotateAroundY((float)Math.PI); +- } +- +- if(var7 == 1) { +- var27[var42].rotateAroundY((float)Math.PI * 0.5F); +- } +- +- if(var7 == 3) { +- var27[var42].rotateAroundY((float)Math.PI * -0.5F); +- } +- +- var27[var42].xCoord += (double)var2 + 0.5D; +- var27[var42].yCoord += (double)((float)var3 + 5.0F / 16.0F); +- var27[var42].zCoord += (double)var4 + 0.5D; +- } +- +- byte var64 = 5; +- byte var43 = 11; +- byte var44 = 3; +- byte var45 = 9; +- +- for(int var46 = 0; var46 < 6; ++var46) { +- if(var46 == 0) { +- var62 = var27[0]; +- var32 = var27[1]; +- var33 = var27[2]; +- var34 = var27[3]; +- var19 = (double)var18.getInterpolatedU((double)var64); +- var21 = (double)var18.getInterpolatedV((double)var44); +- var23 = (double)var18.getInterpolatedU((double)var43); +- var25 = (double)var18.getInterpolatedV((double)var45); +- } else if(var46 == 1) { +- var62 = var27[7]; +- var32 = var27[6]; +- var33 = var27[5]; +- var34 = var27[4]; +- } else if(var46 == 2) { +- var62 = var27[1]; +- var32 = var27[0]; +- var33 = var27[4]; +- var34 = var27[5]; +- var19 = (double)var18.getInterpolatedU((double)var64); +- var21 = (double)var18.getInterpolatedV((double)var44); +- var23 = (double)var18.getInterpolatedU((double)var43); +- var25 = (double)var18.getInterpolatedV((double)(var44 + 2)); +- } else if(var46 == 3) { +- var62 = var27[2]; +- var32 = var27[1]; +- var33 = var27[5]; +- var34 = var27[6]; +- } else if(var46 == 4) { +- var62 = var27[3]; +- var32 = var27[2]; +- var33 = var27[6]; +- var34 = var27[7]; +- } else if(var46 == 5) { +- var62 = var27[0]; +- var32 = var27[3]; +- var33 = var27[7]; +- var34 = var27[4]; +- } +- +- var5.addVertexWithUV(var62.xCoord, var62.yCoord, var62.zCoord, var19, var25); +- var5.addVertexWithUV(var32.xCoord, var32.yCoord, var32.zCoord, var23, var25); +- var5.addVertexWithUV(var33.xCoord, var33.yCoord, var33.zCoord, var23, var21); +- var5.addVertexWithUV(var34.xCoord, var34.yCoord, var34.zCoord, var19, var21); +- } +- +- if(var8) { +- double var65 = var27[0].yCoord; +- float var48 = 0.03125F; +- float var49 = 0.5F - var48 / 2.0F; +- float var50 = var49 + var48; +- Icon var51 = this.getBlockIcon(Block.tripWire); +- double var52 = (double)var18.getMinU(); +- double var54 = (double)var18.getInterpolatedV(var8 ? 2.0D : 0.0D); +- double var56 = (double)var18.getMaxU(); +- double var58 = (double)var18.getInterpolatedV(var8 ? 4.0D : 2.0D); +- double var60 = (double)(var10 ? 3.5F : 1.5F) / 16.0D; +- var17 = var1.getBlockBrightness(this.blockAccess, var2, var3, var4) * (12.0F / 16.0F); +- var5.setColorOpaque_F(var17, var17, var17); +- if(var7 == 2) { +- var5.addVertexWithUV((double)((float)var2 + var49), (double)var3 + var60, (double)var4 + 0.25D, var52, var54); +- var5.addVertexWithUV((double)((float)var2 + var50), (double)var3 + var60, (double)var4 + 0.25D, var52, var58); +- var5.addVertexWithUV((double)((float)var2 + var50), (double)var3 + var60, (double)var4, var56, var58); +- var5.addVertexWithUV((double)((float)var2 + var49), (double)var3 + var60, (double)var4, var56, var54); +- var5.addVertexWithUV((double)((float)var2 + var49), var65, (double)var4 + 0.5D, var52, var54); +- var5.addVertexWithUV((double)((float)var2 + var50), var65, (double)var4 + 0.5D, var52, var58); +- var5.addVertexWithUV((double)((float)var2 + var50), (double)var3 + var60, (double)var4 + 0.25D, var56, var58); +- var5.addVertexWithUV((double)((float)var2 + var49), (double)var3 + var60, (double)var4 + 0.25D, var56, var54); +- } else if(var7 == 0) { +- var5.addVertexWithUV((double)((float)var2 + var49), (double)var3 + var60, (double)var4 + 0.75D, var52, var54); +- var5.addVertexWithUV((double)((float)var2 + var50), (double)var3 + var60, (double)var4 + 0.75D, var52, var58); +- var5.addVertexWithUV((double)((float)var2 + var50), var65, (double)var4 + 0.5D, var56, var58); +- var5.addVertexWithUV((double)((float)var2 + var49), var65, (double)var4 + 0.5D, var56, var54); +- var5.addVertexWithUV((double)((float)var2 + var49), (double)var3 + var60, (double)(var4 + 1), var52, var54); +- var5.addVertexWithUV((double)((float)var2 + var50), (double)var3 + var60, (double)(var4 + 1), var52, var58); +- var5.addVertexWithUV((double)((float)var2 + var50), (double)var3 + var60, (double)var4 + 0.75D, var56, var58); +- var5.addVertexWithUV((double)((float)var2 + var49), (double)var3 + var60, (double)var4 + 0.75D, var56, var54); +- } else if(var7 == 1) { +- var5.addVertexWithUV((double)var2, (double)var3 + var60, (double)((float)var4 + var50), var52, var58); +- var5.addVertexWithUV((double)var2 + 0.25D, (double)var3 + var60, (double)((float)var4 + var50), var56, var58); +- var5.addVertexWithUV((double)var2 + 0.25D, (double)var3 + var60, (double)((float)var4 + var49), var56, var54); +- var5.addVertexWithUV((double)var2, (double)var3 + var60, (double)((float)var4 + var49), var52, var54); +- var5.addVertexWithUV((double)var2 + 0.25D, (double)var3 + var60, (double)((float)var4 + var50), var52, var58); +- var5.addVertexWithUV((double)var2 + 0.5D, var65, (double)((float)var4 + var50), var56, var58); +- var5.addVertexWithUV((double)var2 + 0.5D, var65, (double)((float)var4 + var49), var56, var54); +- var5.addVertexWithUV((double)var2 + 0.25D, (double)var3 + var60, (double)((float)var4 + var49), var52, var54); +- } else { +- var5.addVertexWithUV((double)var2 + 0.5D, var65, (double)((float)var4 + var50), var52, var58); +- var5.addVertexWithUV((double)var2 + 0.75D, (double)var3 + var60, (double)((float)var4 + var50), var56, var58); +- var5.addVertexWithUV((double)var2 + 0.75D, (double)var3 + var60, (double)((float)var4 + var49), var56, var54); +- var5.addVertexWithUV((double)var2 + 0.5D, var65, (double)((float)var4 + var49), var52, var54); +- var5.addVertexWithUV((double)var2 + 0.75D, (double)var3 + var60, (double)((float)var4 + var50), var52, var58); +- var5.addVertexWithUV((double)(var2 + 1), (double)var3 + var60, (double)((float)var4 + var50), var56, var58); +- var5.addVertexWithUV((double)(var2 + 1), (double)var3 + var60, (double)((float)var4 + var49), var56, var54); +- var5.addVertexWithUV((double)var2 + 0.75D, (double)var3 + var60, (double)((float)var4 + var49), var52, var54); +- } +- } +- +- return true; ++ var18 = CTMUtils.getTile(this, par1Block, par2, par3, par4, var18, var5); ++ ++ if (var18 == null) { ++ return false; ++ } else { ++ var5 = TessellatorUtils.getTessellator(var5, var18); ++ double var19 = (double)var18.getMinU(); ++ double var21 = (double)var18.getMinV(); ++ double var23 = (double)var18.getMaxU(); ++ double var25 = (double)var18.getMaxV(); ++ Vec3[] var27 = new Vec3[8]; ++ float var28 = 0.046875F; ++ float var29 = 0.046875F; ++ float var30 = 0.3125F; ++ var27[0] = this.blockAccess.getWorldVec3Pool().getVecFromPool((double)(-var28), 0.0D, (double)(-var29)); ++ var27[1] = this.blockAccess.getWorldVec3Pool().getVecFromPool((double)var28, 0.0D, (double)(-var29)); ++ var27[2] = this.blockAccess.getWorldVec3Pool().getVecFromPool((double)var28, 0.0D, (double)var29); ++ var27[3] = this.blockAccess.getWorldVec3Pool().getVecFromPool((double)(-var28), 0.0D, (double)var29); ++ var27[4] = this.blockAccess.getWorldVec3Pool().getVecFromPool((double)(-var28), (double)var30, (double)(-var29)); ++ var27[5] = this.blockAccess.getWorldVec3Pool().getVecFromPool((double)var28, (double)var30, (double)(-var29)); ++ var27[6] = this.blockAccess.getWorldVec3Pool().getVecFromPool((double)var28, (double)var30, (double)var29); ++ var27[7] = this.blockAccess.getWorldVec3Pool().getVecFromPool((double)(-var28), (double)var30, (double)var29); ++ ++ for (int var31 = 0; var31 < 8; ++var31) { ++ var27[var31].zCoord += 0.0625D; ++ ++ if (var9) { ++ var27[var31].rotateAroundX(0.5235988F); ++ var27[var31].yCoord -= 0.4375D; ++ } else if (var8) { ++ var27[var31].rotateAroundX(0.08726647F); ++ var27[var31].yCoord -= 0.4375D; ++ } else { ++ var27[var31].rotateAroundX(-((float)Math.PI * 2F / 9F)); ++ var27[var31].yCoord -= 0.375D; ++ } ++ ++ var27[var31].rotateAroundX(((float)Math.PI / 2F)); ++ ++ if (var7 == 2) { ++ var27[var31].rotateAroundY(0.0F); ++ } ++ ++ if (var7 == 0) { ++ var27[var31].rotateAroundY((float)Math.PI); ++ } ++ ++ if (var7 == 1) { ++ var27[var31].rotateAroundY(((float)Math.PI / 2F)); ++ } ++ ++ if (var7 == 3) { ++ var27[var31].rotateAroundY(-((float)Math.PI / 2F)); ++ } ++ ++ var27[var31].xCoord += (double)par2 + 0.5D; ++ var27[var31].yCoord += (double)((float)par3 + 0.3125F); ++ var27[var31].zCoord += (double)par4 + 0.5D; ++ } ++ ++ Vec3 var62 = null; ++ Vec3 var32 = null; ++ Vec3 var33 = null; ++ Vec3 var34 = null; ++ byte var35 = 7; ++ byte var36 = 9; ++ byte var37 = 9; ++ byte var38 = 16; ++ ++ for (int var39 = 0; var39 < 6; ++var39) { ++ if (var39 == 0) { ++ var62 = var27[0]; ++ var32 = var27[1]; ++ var33 = var27[2]; ++ var34 = var27[3]; ++ var19 = (double)var18.getInterpolatedU((double)var35); ++ var21 = (double)var18.getInterpolatedV((double)var37); ++ var23 = (double)var18.getInterpolatedU((double)var36); ++ var25 = (double)var18.getInterpolatedV((double)(var37 + 2)); ++ } else if (var39 == 1) { ++ var62 = var27[7]; ++ var32 = var27[6]; ++ var33 = var27[5]; ++ var34 = var27[4]; ++ } else if (var39 == 2) { ++ var62 = var27[1]; ++ var32 = var27[0]; ++ var33 = var27[4]; ++ var34 = var27[5]; ++ var19 = (double)var18.getInterpolatedU((double)var35); ++ var21 = (double)var18.getInterpolatedV((double)var37); ++ var23 = (double)var18.getInterpolatedU((double)var36); ++ var25 = (double)var18.getInterpolatedV((double)var38); ++ } else if (var39 == 3) { ++ var62 = var27[2]; ++ var32 = var27[1]; ++ var33 = var27[5]; ++ var34 = var27[6]; ++ } else if (var39 == 4) { ++ var62 = var27[3]; ++ var32 = var27[2]; ++ var33 = var27[6]; ++ var34 = var27[7]; ++ } else if (var39 == 5) { ++ var62 = var27[0]; ++ var32 = var27[3]; ++ var33 = var27[7]; ++ var34 = var27[4]; ++ } ++ ++ var5.addVertexWithUV(var62.xCoord, var62.yCoord, var62.zCoord, var19, var25); ++ var5.addVertexWithUV(var32.xCoord, var32.yCoord, var32.zCoord, var23, var25); ++ var5.addVertexWithUV(var33.xCoord, var33.yCoord, var33.zCoord, var23, var21); ++ var5.addVertexWithUV(var34.xCoord, var34.yCoord, var34.zCoord, var19, var21); ++ } ++ ++ float var63 = 0.09375F; ++ float var40 = 0.09375F; ++ float var41 = 0.03125F; ++ var27[0] = this.blockAccess.getWorldVec3Pool().getVecFromPool((double)(-var63), 0.0D, (double)(-var40)); ++ var27[1] = this.blockAccess.getWorldVec3Pool().getVecFromPool((double)var63, 0.0D, (double)(-var40)); ++ var27[2] = this.blockAccess.getWorldVec3Pool().getVecFromPool((double)var63, 0.0D, (double)var40); ++ var27[3] = this.blockAccess.getWorldVec3Pool().getVecFromPool((double)(-var63), 0.0D, (double)var40); ++ var27[4] = this.blockAccess.getWorldVec3Pool().getVecFromPool((double)(-var63), (double)var41, (double)(-var40)); ++ var27[5] = this.blockAccess.getWorldVec3Pool().getVecFromPool((double)var63, (double)var41, (double)(-var40)); ++ var27[6] = this.blockAccess.getWorldVec3Pool().getVecFromPool((double)var63, (double)var41, (double)var40); ++ var27[7] = this.blockAccess.getWorldVec3Pool().getVecFromPool((double)(-var63), (double)var41, (double)var40); ++ ++ for (int var42 = 0; var42 < 8; ++var42) { ++ var27[var42].zCoord += 0.21875D; ++ ++ if (var9) { ++ var27[var42].yCoord -= 0.09375D; ++ var27[var42].zCoord -= 0.1625D; ++ var27[var42].rotateAroundX(0.0F); ++ } else if (var8) { ++ var27[var42].yCoord += 0.015625D; ++ var27[var42].zCoord -= 0.171875D; ++ var27[var42].rotateAroundX(0.17453294F); ++ } else { ++ var27[var42].rotateAroundX(0.87266463F); ++ } ++ ++ if (var7 == 2) { ++ var27[var42].rotateAroundY(0.0F); ++ } ++ ++ if (var7 == 0) { ++ var27[var42].rotateAroundY((float)Math.PI); ++ } ++ ++ if (var7 == 1) { ++ var27[var42].rotateAroundY(((float)Math.PI / 2F)); ++ } ++ ++ if (var7 == 3) { ++ var27[var42].rotateAroundY(-((float)Math.PI / 2F)); ++ } ++ ++ var27[var42].xCoord += (double)par2 + 0.5D; ++ var27[var42].yCoord += (double)((float)par3 + 0.3125F); ++ var27[var42].zCoord += (double)par4 + 0.5D; ++ } ++ ++ byte var65 = 5; ++ byte var43 = 11; ++ byte var44 = 3; ++ byte var45 = 9; ++ ++ for (int var46 = 0; var46 < 6; ++var46) { ++ if (var46 == 0) { ++ var62 = var27[0]; ++ var32 = var27[1]; ++ var33 = var27[2]; ++ var34 = var27[3]; ++ var19 = (double)var18.getInterpolatedU((double)var65); ++ var21 = (double)var18.getInterpolatedV((double)var44); ++ var23 = (double)var18.getInterpolatedU((double)var43); ++ var25 = (double)var18.getInterpolatedV((double)var45); ++ } else if (var46 == 1) { ++ var62 = var27[7]; ++ var32 = var27[6]; ++ var33 = var27[5]; ++ var34 = var27[4]; ++ } else if (var46 == 2) { ++ var62 = var27[1]; ++ var32 = var27[0]; ++ var33 = var27[4]; ++ var34 = var27[5]; ++ var19 = (double)var18.getInterpolatedU((double)var65); ++ var21 = (double)var18.getInterpolatedV((double)var44); ++ var23 = (double)var18.getInterpolatedU((double)var43); ++ var25 = (double)var18.getInterpolatedV((double)(var44 + 2)); ++ } else if (var46 == 3) { ++ var62 = var27[2]; ++ var32 = var27[1]; ++ var33 = var27[5]; ++ var34 = var27[6]; ++ } else if (var46 == 4) { ++ var62 = var27[3]; ++ var32 = var27[2]; ++ var33 = var27[6]; ++ var34 = var27[7]; ++ } else if (var46 == 5) { ++ var62 = var27[0]; ++ var32 = var27[3]; ++ var33 = var27[7]; ++ var34 = var27[4]; ++ } ++ ++ var5.addVertexWithUV(var62.xCoord, var62.yCoord, var62.zCoord, var19, var25); ++ var5.addVertexWithUV(var32.xCoord, var32.yCoord, var32.zCoord, var23, var25); ++ var5.addVertexWithUV(var33.xCoord, var33.yCoord, var33.zCoord, var23, var21); ++ var5.addVertexWithUV(var34.xCoord, var34.yCoord, var34.zCoord, var19, var21); ++ } ++ ++ if (var8) { ++ double var64 = var27[0].yCoord; ++ float var48 = 0.03125F; ++ float var49 = 0.5F - var48 / 2.0F; ++ float var50 = var49 + var48; ++ Icon var51 = this.getBlockIcon(Block.tripWire); ++ var18 = CTMUtils.getTile(this, par1Block, par2, par3, par4, var18, var5); ++ ++ if (var18 == null) { ++ return false; ++ } ++ ++ var5 = TessellatorUtils.getTessellator(var5, var18); ++ double var52 = (double)var18.getMinU(); ++ double var54 = (double)var18.getInterpolatedV(var8 ? 2.0D : 0.0D); ++ double var56 = (double)var18.getMaxU(); ++ double var58 = (double)var18.getInterpolatedV(var8 ? 4.0D : 2.0D); ++ double var60 = (double)(var10 ? 3.5F : 1.5F) / 16.0D; ++ var17 = par1Block.getBlockBrightness(this.blockAccess, par2, par3, par4) * 0.75F; ++ var5.setColorOpaque_F(var17, var17, var17); ++ ++ if (var7 == 2) { ++ var5.addVertexWithUV((double)((float)par2 + var49), (double)par3 + var60, (double)par4 + 0.25D, var52, var54); ++ var5.addVertexWithUV((double)((float)par2 + var50), (double)par3 + var60, (double)par4 + 0.25D, var52, var58); ++ var5.addVertexWithUV((double)((float)par2 + var50), (double)par3 + var60, (double)par4, var56, var58); ++ var5.addVertexWithUV((double)((float)par2 + var49), (double)par3 + var60, (double)par4, var56, var54); ++ var5.addVertexWithUV((double)((float)par2 + var49), var64, (double)par4 + 0.5D, var52, var54); ++ var5.addVertexWithUV((double)((float)par2 + var50), var64, (double)par4 + 0.5D, var52, var58); ++ var5.addVertexWithUV((double)((float)par2 + var50), (double)par3 + var60, (double)par4 + 0.25D, var56, var58); ++ var5.addVertexWithUV((double)((float)par2 + var49), (double)par3 + var60, (double)par4 + 0.25D, var56, var54); ++ } else if (var7 == 0) { ++ var5.addVertexWithUV((double)((float)par2 + var49), (double)par3 + var60, (double)par4 + 0.75D, var52, var54); ++ var5.addVertexWithUV((double)((float)par2 + var50), (double)par3 + var60, (double)par4 + 0.75D, var52, var58); ++ var5.addVertexWithUV((double)((float)par2 + var50), var64, (double)par4 + 0.5D, var56, var58); ++ var5.addVertexWithUV((double)((float)par2 + var49), var64, (double)par4 + 0.5D, var56, var54); ++ var5.addVertexWithUV((double)((float)par2 + var49), (double)par3 + var60, (double)(par4 + 1), var52, var54); ++ var5.addVertexWithUV((double)((float)par2 + var50), (double)par3 + var60, (double)(par4 + 1), var52, var58); ++ var5.addVertexWithUV((double)((float)par2 + var50), (double)par3 + var60, (double)par4 + 0.75D, var56, var58); ++ var5.addVertexWithUV((double)((float)par2 + var49), (double)par3 + var60, (double)par4 + 0.75D, var56, var54); ++ } else if (var7 == 1) { ++ var5.addVertexWithUV((double)par2, (double)par3 + var60, (double)((float)par4 + var50), var52, var58); ++ var5.addVertexWithUV((double)par2 + 0.25D, (double)par3 + var60, (double)((float)par4 + var50), var56, var58); ++ var5.addVertexWithUV((double)par2 + 0.25D, (double)par3 + var60, (double)((float)par4 + var49), var56, var54); ++ var5.addVertexWithUV((double)par2, (double)par3 + var60, (double)((float)par4 + var49), var52, var54); ++ var5.addVertexWithUV((double)par2 + 0.25D, (double)par3 + var60, (double)((float)par4 + var50), var52, var58); ++ var5.addVertexWithUV((double)par2 + 0.5D, var64, (double)((float)par4 + var50), var56, var58); ++ var5.addVertexWithUV((double)par2 + 0.5D, var64, (double)((float)par4 + var49), var56, var54); ++ var5.addVertexWithUV((double)par2 + 0.25D, (double)par3 + var60, (double)((float)par4 + var49), var52, var54); ++ } else { ++ var5.addVertexWithUV((double)par2 + 0.5D, var64, (double)((float)par4 + var50), var52, var58); ++ var5.addVertexWithUV((double)par2 + 0.75D, (double)par3 + var60, (double)((float)par4 + var50), var56, var58); ++ var5.addVertexWithUV((double)par2 + 0.75D, (double)par3 + var60, (double)((float)par4 + var49), var56, var54); ++ var5.addVertexWithUV((double)par2 + 0.5D, var64, (double)((float)par4 + var49), var52, var54); ++ var5.addVertexWithUV((double)par2 + 0.75D, (double)par3 + var60, (double)((float)par4 + var50), var52, var58); ++ var5.addVertexWithUV((double)(par2 + 1), (double)par3 + var60, (double)((float)par4 + var50), var56, var58); ++ var5.addVertexWithUV((double)(par2 + 1), (double)par3 + var60, (double)((float)par4 + var49), var56, var54); ++ var5.addVertexWithUV((double)par2 + 0.75D, (double)par3 + var60, (double)((float)par4 + var49), var52, var54); ++ } ++ } ++ ++ return true; ++ } + } + +- public boolean renderBlockTripWire(Block var1, int var2, int var3, int var4) { ++ /** ++ * Renders a trip wire block at the given coordinates ++ */ ++ public boolean renderBlockTripWire(Block par1Block, int par2, int par3, int par4) { + Tessellator var5 = Tessellator.instance; +- Icon var6 = this.getBlockIconFromSide(var1, 0); +- int var7 = this.blockAccess.getBlockMetadata(var2, var3, var4); ++ Icon var6 = this.getBlockIconFromSide(par1Block, 0); ++ int var7 = this.blockAccess.getBlockMetadata(par2, par3, par4); + boolean var8 = (var7 & 4) == 4; + boolean var9 = (var7 & 2) == 2; +- if(this.hasOverrideBlockTexture()) { ++ ++ if (this.hasOverrideBlockTexture()) { + var6 = this.overrideBlockTexture; + } + +- var5.setBrightness(var1.getMixedBrightnessForBlock(this.blockAccess, var2, var3, var4)); +- float var10 = var1.getBlockBrightness(this.blockAccess, var2, var3, var4) * (12.0F / 16.0F); ++ var5.setBrightness(par1Block.getMixedBrightnessForBlock(this.blockAccess, par2, par3, par4)); ++ float var10 = par1Block.getBlockBrightness(this.blockAccess, par2, par3, par4) * 0.75F; + var5.setColorOpaque_F(var10, var10, var10); +- double var11 = (double)var6.getMinU(); +- double var13 = (double)var6.getInterpolatedV(var8 ? 2.0D : 0.0D); +- double var15 = (double)var6.getMaxU(); +- double var17 = (double)var6.getInterpolatedV(var8 ? 4.0D : 2.0D); +- double var19 = (double)(var9 ? 3.5F : 1.5F) / 16.0D; +- boolean var21 = BlockTripWire.func_72148_a(this.blockAccess, var2, var3, var4, var7, 1); +- boolean var22 = BlockTripWire.func_72148_a(this.blockAccess, var2, var3, var4, var7, 3); +- boolean var23 = BlockTripWire.func_72148_a(this.blockAccess, var2, var3, var4, var7, 2); +- boolean var24 = BlockTripWire.func_72148_a(this.blockAccess, var2, var3, var4, var7, 0); +- float var25 = 0.03125F; +- float var26 = 0.5F - var25 / 2.0F; +- float var27 = var26 + var25; +- if(!var23 && !var22 && !var24 && !var21) { +- var23 = true; +- var24 = true; +- } +- +- if(var23) { +- var5.addVertexWithUV((double)((float)var2 + var26), (double)var3 + var19, (double)var4 + 0.25D, var11, var13); +- var5.addVertexWithUV((double)((float)var2 + var27), (double)var3 + var19, (double)var4 + 0.25D, var11, var17); +- var5.addVertexWithUV((double)((float)var2 + var27), (double)var3 + var19, (double)var4, var15, var17); +- var5.addVertexWithUV((double)((float)var2 + var26), (double)var3 + var19, (double)var4, var15, var13); +- var5.addVertexWithUV((double)((float)var2 + var26), (double)var3 + var19, (double)var4, var15, var13); +- var5.addVertexWithUV((double)((float)var2 + var27), (double)var3 + var19, (double)var4, var15, var17); +- var5.addVertexWithUV((double)((float)var2 + var27), (double)var3 + var19, (double)var4 + 0.25D, var11, var17); +- var5.addVertexWithUV((double)((float)var2 + var26), (double)var3 + var19, (double)var4 + 0.25D, var11, var13); +- } +- +- if(var23 || var24 && !var22 && !var21) { +- var5.addVertexWithUV((double)((float)var2 + var26), (double)var3 + var19, (double)var4 + 0.5D, var11, var13); +- var5.addVertexWithUV((double)((float)var2 + var27), (double)var3 + var19, (double)var4 + 0.5D, var11, var17); +- var5.addVertexWithUV((double)((float)var2 + var27), (double)var3 + var19, (double)var4 + 0.25D, var15, var17); +- var5.addVertexWithUV((double)((float)var2 + var26), (double)var3 + var19, (double)var4 + 0.25D, var15, var13); +- var5.addVertexWithUV((double)((float)var2 + var26), (double)var3 + var19, (double)var4 + 0.25D, var15, var13); +- var5.addVertexWithUV((double)((float)var2 + var27), (double)var3 + var19, (double)var4 + 0.25D, var15, var17); +- var5.addVertexWithUV((double)((float)var2 + var27), (double)var3 + var19, (double)var4 + 0.5D, var11, var17); +- var5.addVertexWithUV((double)((float)var2 + var26), (double)var3 + var19, (double)var4 + 0.5D, var11, var13); +- } +- +- if(var24 || var23 && !var22 && !var21) { +- var5.addVertexWithUV((double)((float)var2 + var26), (double)var3 + var19, (double)var4 + 0.75D, var11, var13); +- var5.addVertexWithUV((double)((float)var2 + var27), (double)var3 + var19, (double)var4 + 0.75D, var11, var17); +- var5.addVertexWithUV((double)((float)var2 + var27), (double)var3 + var19, (double)var4 + 0.5D, var15, var17); +- var5.addVertexWithUV((double)((float)var2 + var26), (double)var3 + var19, (double)var4 + 0.5D, var15, var13); +- var5.addVertexWithUV((double)((float)var2 + var26), (double)var3 + var19, (double)var4 + 0.5D, var15, var13); +- var5.addVertexWithUV((double)((float)var2 + var27), (double)var3 + var19, (double)var4 + 0.5D, var15, var17); +- var5.addVertexWithUV((double)((float)var2 + var27), (double)var3 + var19, (double)var4 + 0.75D, var11, var17); +- var5.addVertexWithUV((double)((float)var2 + var26), (double)var3 + var19, (double)var4 + 0.75D, var11, var13); +- } +- +- if(var24) { +- var5.addVertexWithUV((double)((float)var2 + var26), (double)var3 + var19, (double)(var4 + 1), var11, var13); +- var5.addVertexWithUV((double)((float)var2 + var27), (double)var3 + var19, (double)(var4 + 1), var11, var17); +- var5.addVertexWithUV((double)((float)var2 + var27), (double)var3 + var19, (double)var4 + 0.75D, var15, var17); +- var5.addVertexWithUV((double)((float)var2 + var26), (double)var3 + var19, (double)var4 + 0.75D, var15, var13); +- var5.addVertexWithUV((double)((float)var2 + var26), (double)var3 + var19, (double)var4 + 0.75D, var15, var13); +- var5.addVertexWithUV((double)((float)var2 + var27), (double)var3 + var19, (double)var4 + 0.75D, var15, var17); +- var5.addVertexWithUV((double)((float)var2 + var27), (double)var3 + var19, (double)(var4 + 1), var11, var17); +- var5.addVertexWithUV((double)((float)var2 + var26), (double)var3 + var19, (double)(var4 + 1), var11, var13); +- } +- +- if(var21) { +- var5.addVertexWithUV((double)var2, (double)var3 + var19, (double)((float)var4 + var27), var11, var17); +- var5.addVertexWithUV((double)var2 + 0.25D, (double)var3 + var19, (double)((float)var4 + var27), var15, var17); +- var5.addVertexWithUV((double)var2 + 0.25D, (double)var3 + var19, (double)((float)var4 + var26), var15, var13); +- var5.addVertexWithUV((double)var2, (double)var3 + var19, (double)((float)var4 + var26), var11, var13); +- var5.addVertexWithUV((double)var2, (double)var3 + var19, (double)((float)var4 + var26), var11, var13); +- var5.addVertexWithUV((double)var2 + 0.25D, (double)var3 + var19, (double)((float)var4 + var26), var15, var13); +- var5.addVertexWithUV((double)var2 + 0.25D, (double)var3 + var19, (double)((float)var4 + var27), var15, var17); +- var5.addVertexWithUV((double)var2, (double)var3 + var19, (double)((float)var4 + var27), var11, var17); +- } +- +- if(var21 || var22 && !var23 && !var24) { +- var5.addVertexWithUV((double)var2 + 0.25D, (double)var3 + var19, (double)((float)var4 + var27), var11, var17); +- var5.addVertexWithUV((double)var2 + 0.5D, (double)var3 + var19, (double)((float)var4 + var27), var15, var17); +- var5.addVertexWithUV((double)var2 + 0.5D, (double)var3 + var19, (double)((float)var4 + var26), var15, var13); +- var5.addVertexWithUV((double)var2 + 0.25D, (double)var3 + var19, (double)((float)var4 + var26), var11, var13); +- var5.addVertexWithUV((double)var2 + 0.25D, (double)var3 + var19, (double)((float)var4 + var26), var11, var13); +- var5.addVertexWithUV((double)var2 + 0.5D, (double)var3 + var19, (double)((float)var4 + var26), var15, var13); +- var5.addVertexWithUV((double)var2 + 0.5D, (double)var3 + var19, (double)((float)var4 + var27), var15, var17); +- var5.addVertexWithUV((double)var2 + 0.25D, (double)var3 + var19, (double)((float)var4 + var27), var11, var17); +- } +- +- if(var22 || var21 && !var23 && !var24) { +- var5.addVertexWithUV((double)var2 + 0.5D, (double)var3 + var19, (double)((float)var4 + var27), var11, var17); +- var5.addVertexWithUV((double)var2 + 0.75D, (double)var3 + var19, (double)((float)var4 + var27), var15, var17); +- var5.addVertexWithUV((double)var2 + 0.75D, (double)var3 + var19, (double)((float)var4 + var26), var15, var13); +- var5.addVertexWithUV((double)var2 + 0.5D, (double)var3 + var19, (double)((float)var4 + var26), var11, var13); +- var5.addVertexWithUV((double)var2 + 0.5D, (double)var3 + var19, (double)((float)var4 + var26), var11, var13); +- var5.addVertexWithUV((double)var2 + 0.75D, (double)var3 + var19, (double)((float)var4 + var26), var15, var13); +- var5.addVertexWithUV((double)var2 + 0.75D, (double)var3 + var19, (double)((float)var4 + var27), var15, var17); +- var5.addVertexWithUV((double)var2 + 0.5D, (double)var3 + var19, (double)((float)var4 + var27), var11, var17); +- } +- +- if(var22) { +- var5.addVertexWithUV((double)var2 + 0.75D, (double)var3 + var19, (double)((float)var4 + var27), var11, var17); +- var5.addVertexWithUV((double)(var2 + 1), (double)var3 + var19, (double)((float)var4 + var27), var15, var17); +- var5.addVertexWithUV((double)(var2 + 1), (double)var3 + var19, (double)((float)var4 + var26), var15, var13); +- var5.addVertexWithUV((double)var2 + 0.75D, (double)var3 + var19, (double)((float)var4 + var26), var11, var13); +- var5.addVertexWithUV((double)var2 + 0.75D, (double)var3 + var19, (double)((float)var4 + var26), var11, var13); +- var5.addVertexWithUV((double)(var2 + 1), (double)var3 + var19, (double)((float)var4 + var26), var15, var13); +- var5.addVertexWithUV((double)(var2 + 1), (double)var3 + var19, (double)((float)var4 + var27), var15, var17); +- var5.addVertexWithUV((double)var2 + 0.75D, (double)var3 + var19, (double)((float)var4 + var27), var11, var17); +- } +- +- return true; ++ var6 = CTMUtils.getTile(this, par1Block, par2, par3, par4, var6, var5); ++ ++ if (var6 == null) { ++ return false; ++ } else { ++ var5 = TessellatorUtils.getTessellator(var5, var6); ++ double var11 = (double)var6.getMinU(); ++ double var13 = (double)var6.getInterpolatedV(var8 ? 2.0D : 0.0D); ++ double var15 = (double)var6.getMaxU(); ++ double var17 = (double)var6.getInterpolatedV(var8 ? 4.0D : 2.0D); ++ double var19 = (double)(var9 ? 3.5F : 1.5F) / 16.0D; ++ boolean var21 = BlockTripWire.func_72148_a(this.blockAccess, par2, par3, par4, var7, 1); ++ boolean var22 = BlockTripWire.func_72148_a(this.blockAccess, par2, par3, par4, var7, 3); ++ boolean var23 = BlockTripWire.func_72148_a(this.blockAccess, par2, par3, par4, var7, 2); ++ boolean var24 = BlockTripWire.func_72148_a(this.blockAccess, par2, par3, par4, var7, 0); ++ float var25 = 0.03125F; ++ float var26 = 0.5F - var25 / 2.0F; ++ float var27 = var26 + var25; ++ ++ if (!var23 && !var22 && !var24 && !var21) { ++ var23 = true; ++ var24 = true; ++ } ++ ++ if (var23) { ++ var5.addVertexWithUV((double)((float)par2 + var26), (double)par3 + var19, (double)par4 + 0.25D, var11, var13); ++ var5.addVertexWithUV((double)((float)par2 + var27), (double)par3 + var19, (double)par4 + 0.25D, var11, var17); ++ var5.addVertexWithUV((double)((float)par2 + var27), (double)par3 + var19, (double)par4, var15, var17); ++ var5.addVertexWithUV((double)((float)par2 + var26), (double)par3 + var19, (double)par4, var15, var13); ++ var5.addVertexWithUV((double)((float)par2 + var26), (double)par3 + var19, (double)par4, var15, var13); ++ var5.addVertexWithUV((double)((float)par2 + var27), (double)par3 + var19, (double)par4, var15, var17); ++ var5.addVertexWithUV((double)((float)par2 + var27), (double)par3 + var19, (double)par4 + 0.25D, var11, var17); ++ var5.addVertexWithUV((double)((float)par2 + var26), (double)par3 + var19, (double)par4 + 0.25D, var11, var13); ++ } ++ ++ if (var23 || var24 && !var22 && !var21) { ++ var5.addVertexWithUV((double)((float)par2 + var26), (double)par3 + var19, (double)par4 + 0.5D, var11, var13); ++ var5.addVertexWithUV((double)((float)par2 + var27), (double)par3 + var19, (double)par4 + 0.5D, var11, var17); ++ var5.addVertexWithUV((double)((float)par2 + var27), (double)par3 + var19, (double)par4 + 0.25D, var15, var17); ++ var5.addVertexWithUV((double)((float)par2 + var26), (double)par3 + var19, (double)par4 + 0.25D, var15, var13); ++ var5.addVertexWithUV((double)((float)par2 + var26), (double)par3 + var19, (double)par4 + 0.25D, var15, var13); ++ var5.addVertexWithUV((double)((float)par2 + var27), (double)par3 + var19, (double)par4 + 0.25D, var15, var17); ++ var5.addVertexWithUV((double)((float)par2 + var27), (double)par3 + var19, (double)par4 + 0.5D, var11, var17); ++ var5.addVertexWithUV((double)((float)par2 + var26), (double)par3 + var19, (double)par4 + 0.5D, var11, var13); ++ } ++ ++ if (var24 || var23 && !var22 && !var21) { ++ var5.addVertexWithUV((double)((float)par2 + var26), (double)par3 + var19, (double)par4 + 0.75D, var11, var13); ++ var5.addVertexWithUV((double)((float)par2 + var27), (double)par3 + var19, (double)par4 + 0.75D, var11, var17); ++ var5.addVertexWithUV((double)((float)par2 + var27), (double)par3 + var19, (double)par4 + 0.5D, var15, var17); ++ var5.addVertexWithUV((double)((float)par2 + var26), (double)par3 + var19, (double)par4 + 0.5D, var15, var13); ++ var5.addVertexWithUV((double)((float)par2 + var26), (double)par3 + var19, (double)par4 + 0.5D, var15, var13); ++ var5.addVertexWithUV((double)((float)par2 + var27), (double)par3 + var19, (double)par4 + 0.5D, var15, var17); ++ var5.addVertexWithUV((double)((float)par2 + var27), (double)par3 + var19, (double)par4 + 0.75D, var11, var17); ++ var5.addVertexWithUV((double)((float)par2 + var26), (double)par3 + var19, (double)par4 + 0.75D, var11, var13); ++ } ++ ++ if (var24) { ++ var5.addVertexWithUV((double)((float)par2 + var26), (double)par3 + var19, (double)(par4 + 1), var11, var13); ++ var5.addVertexWithUV((double)((float)par2 + var27), (double)par3 + var19, (double)(par4 + 1), var11, var17); ++ var5.addVertexWithUV((double)((float)par2 + var27), (double)par3 + var19, (double)par4 + 0.75D, var15, var17); ++ var5.addVertexWithUV((double)((float)par2 + var26), (double)par3 + var19, (double)par4 + 0.75D, var15, var13); ++ var5.addVertexWithUV((double)((float)par2 + var26), (double)par3 + var19, (double)par4 + 0.75D, var15, var13); ++ var5.addVertexWithUV((double)((float)par2 + var27), (double)par3 + var19, (double)par4 + 0.75D, var15, var17); ++ var5.addVertexWithUV((double)((float)par2 + var27), (double)par3 + var19, (double)(par4 + 1), var11, var17); ++ var5.addVertexWithUV((double)((float)par2 + var26), (double)par3 + var19, (double)(par4 + 1), var11, var13); ++ } ++ ++ if (var21) { ++ var5.addVertexWithUV((double)par2, (double)par3 + var19, (double)((float)par4 + var27), var11, var17); ++ var5.addVertexWithUV((double)par2 + 0.25D, (double)par3 + var19, (double)((float)par4 + var27), var15, var17); ++ var5.addVertexWithUV((double)par2 + 0.25D, (double)par3 + var19, (double)((float)par4 + var26), var15, var13); ++ var5.addVertexWithUV((double)par2, (double)par3 + var19, (double)((float)par4 + var26), var11, var13); ++ var5.addVertexWithUV((double)par2, (double)par3 + var19, (double)((float)par4 + var26), var11, var13); ++ var5.addVertexWithUV((double)par2 + 0.25D, (double)par3 + var19, (double)((float)par4 + var26), var15, var13); ++ var5.addVertexWithUV((double)par2 + 0.25D, (double)par3 + var19, (double)((float)par4 + var27), var15, var17); ++ var5.addVertexWithUV((double)par2, (double)par3 + var19, (double)((float)par4 + var27), var11, var17); ++ } ++ ++ if (var21 || var22 && !var23 && !var24) { ++ var5.addVertexWithUV((double)par2 + 0.25D, (double)par3 + var19, (double)((float)par4 + var27), var11, var17); ++ var5.addVertexWithUV((double)par2 + 0.5D, (double)par3 + var19, (double)((float)par4 + var27), var15, var17); ++ var5.addVertexWithUV((double)par2 + 0.5D, (double)par3 + var19, (double)((float)par4 + var26), var15, var13); ++ var5.addVertexWithUV((double)par2 + 0.25D, (double)par3 + var19, (double)((float)par4 + var26), var11, var13); ++ var5.addVertexWithUV((double)par2 + 0.25D, (double)par3 + var19, (double)((float)par4 + var26), var11, var13); ++ var5.addVertexWithUV((double)par2 + 0.5D, (double)par3 + var19, (double)((float)par4 + var26), var15, var13); ++ var5.addVertexWithUV((double)par2 + 0.5D, (double)par3 + var19, (double)((float)par4 + var27), var15, var17); ++ var5.addVertexWithUV((double)par2 + 0.25D, (double)par3 + var19, (double)((float)par4 + var27), var11, var17); ++ } ++ ++ if (var22 || var21 && !var23 && !var24) { ++ var5.addVertexWithUV((double)par2 + 0.5D, (double)par3 + var19, (double)((float)par4 + var27), var11, var17); ++ var5.addVertexWithUV((double)par2 + 0.75D, (double)par3 + var19, (double)((float)par4 + var27), var15, var17); ++ var5.addVertexWithUV((double)par2 + 0.75D, (double)par3 + var19, (double)((float)par4 + var26), var15, var13); ++ var5.addVertexWithUV((double)par2 + 0.5D, (double)par3 + var19, (double)((float)par4 + var26), var11, var13); ++ var5.addVertexWithUV((double)par2 + 0.5D, (double)par3 + var19, (double)((float)par4 + var26), var11, var13); ++ var5.addVertexWithUV((double)par2 + 0.75D, (double)par3 + var19, (double)((float)par4 + var26), var15, var13); ++ var5.addVertexWithUV((double)par2 + 0.75D, (double)par3 + var19, (double)((float)par4 + var27), var15, var17); ++ var5.addVertexWithUV((double)par2 + 0.5D, (double)par3 + var19, (double)((float)par4 + var27), var11, var17); ++ } ++ ++ if (var22) { ++ var5.addVertexWithUV((double)par2 + 0.75D, (double)par3 + var19, (double)((float)par4 + var27), var11, var17); ++ var5.addVertexWithUV((double)(par2 + 1), (double)par3 + var19, (double)((float)par4 + var27), var15, var17); ++ var5.addVertexWithUV((double)(par2 + 1), (double)par3 + var19, (double)((float)par4 + var26), var15, var13); ++ var5.addVertexWithUV((double)par2 + 0.75D, (double)par3 + var19, (double)((float)par4 + var26), var11, var13); ++ var5.addVertexWithUV((double)par2 + 0.75D, (double)par3 + var19, (double)((float)par4 + var26), var11, var13); ++ var5.addVertexWithUV((double)(par2 + 1), (double)par3 + var19, (double)((float)par4 + var26), var15, var13); ++ var5.addVertexWithUV((double)(par2 + 1), (double)par3 + var19, (double)((float)par4 + var27), var15, var17); ++ var5.addVertexWithUV((double)par2 + 0.75D, (double)par3 + var19, (double)((float)par4 + var27), var11, var17); ++ } ++ ++ return true; ++ } + } + +- public boolean renderBlockFire(BlockFire var1, int var2, int var3, int var4) { ++ /** ++ * Renders a fire block at the given coordinates ++ */ ++ public boolean renderBlockFire(BlockFire par1BlockFire, int par2, int par3, int par4) { + Tessellator var5 = Tessellator.instance; +- Icon var6 = var1.getFireIcon(0); +- Icon var7 = var1.getFireIcon(1); ++ Icon var6 = par1BlockFire.getFireIcon(0); ++ Icon var7 = par1BlockFire.getFireIcon(1); + Icon var8 = var6; +- if(this.hasOverrideBlockTexture()) { ++ ++ if (this.hasOverrideBlockTexture()) { + var8 = this.overrideBlockTexture; + } + + var5.setColorOpaque_F(1.0F, 1.0F, 1.0F); +- var5.setBrightness(var1.getMixedBrightnessForBlock(this.blockAccess, var2, var3, var4)); +- double var9 = (double)var8.getMinU(); +- double var11 = (double)var8.getMinV(); +- double var13 = (double)var8.getMaxU(); +- double var15 = (double)var8.getMaxV(); +- float var17 = 1.4F; +- double var20; +- double var22; +- double var24; +- double var26; +- double var28; +- double var30; +- double var32; +- if(!this.blockAccess.doesBlockHaveSolidTopSurface(var2, var3 - 1, var4) && !Block.fire.canBlockCatchFire(this.blockAccess, var2, var3 - 1, var4)) { +- float var36 = 0.2F; +- float var19 = 1.0F / 16.0F; +- if((var2 + var3 + var4 & 1) == 1) { +- var9 = (double)var7.getMinU(); +- var11 = (double)var7.getMinV(); +- var13 = (double)var7.getMaxU(); +- var15 = (double)var7.getMaxV(); +- } +- +- if((var2 / 2 + var3 / 2 + var4 / 2 & 1) == 1) { +- var20 = var13; +- var13 = var9; +- var9 = var20; +- } +- +- if(Block.fire.canBlockCatchFire(this.blockAccess, var2 - 1, var3, var4)) { +- var5.addVertexWithUV((double)((float)var2 + var36), (double)((float)var3 + var17 + var19), (double)(var4 + 1), var13, var11); +- var5.addVertexWithUV((double)(var2 + 0), (double)((float)(var3 + 0) + var19), (double)(var4 + 1), var13, var15); +- var5.addVertexWithUV((double)(var2 + 0), (double)((float)(var3 + 0) + var19), (double)(var4 + 0), var9, var15); +- var5.addVertexWithUV((double)((float)var2 + var36), (double)((float)var3 + var17 + var19), (double)(var4 + 0), var9, var11); +- var5.addVertexWithUV((double)((float)var2 + var36), (double)((float)var3 + var17 + var19), (double)(var4 + 0), var9, var11); +- var5.addVertexWithUV((double)(var2 + 0), (double)((float)(var3 + 0) + var19), (double)(var4 + 0), var9, var15); +- var5.addVertexWithUV((double)(var2 + 0), (double)((float)(var3 + 0) + var19), (double)(var4 + 1), var13, var15); +- var5.addVertexWithUV((double)((float)var2 + var36), (double)((float)var3 + var17 + var19), (double)(var4 + 1), var13, var11); +- } +- +- if(Block.fire.canBlockCatchFire(this.blockAccess, var2 + 1, var3, var4)) { +- var5.addVertexWithUV((double)((float)(var2 + 1) - var36), (double)((float)var3 + var17 + var19), (double)(var4 + 0), var9, var11); +- var5.addVertexWithUV((double)(var2 + 1 - 0), (double)((float)(var3 + 0) + var19), (double)(var4 + 0), var9, var15); +- var5.addVertexWithUV((double)(var2 + 1 - 0), (double)((float)(var3 + 0) + var19), (double)(var4 + 1), var13, var15); +- var5.addVertexWithUV((double)((float)(var2 + 1) - var36), (double)((float)var3 + var17 + var19), (double)(var4 + 1), var13, var11); +- var5.addVertexWithUV((double)((float)(var2 + 1) - var36), (double)((float)var3 + var17 + var19), (double)(var4 + 1), var13, var11); +- var5.addVertexWithUV((double)(var2 + 1 - 0), (double)((float)(var3 + 0) + var19), (double)(var4 + 1), var13, var15); +- var5.addVertexWithUV((double)(var2 + 1 - 0), (double)((float)(var3 + 0) + var19), (double)(var4 + 0), var9, var15); +- var5.addVertexWithUV((double)((float)(var2 + 1) - var36), (double)((float)var3 + var17 + var19), (double)(var4 + 0), var9, var11); +- } +- +- if(Block.fire.canBlockCatchFire(this.blockAccess, var2, var3, var4 - 1)) { +- var5.addVertexWithUV((double)(var2 + 0), (double)((float)var3 + var17 + var19), (double)((float)var4 + var36), var13, var11); +- var5.addVertexWithUV((double)(var2 + 0), (double)((float)(var3 + 0) + var19), (double)(var4 + 0), var13, var15); +- var5.addVertexWithUV((double)(var2 + 1), (double)((float)(var3 + 0) + var19), (double)(var4 + 0), var9, var15); +- var5.addVertexWithUV((double)(var2 + 1), (double)((float)var3 + var17 + var19), (double)((float)var4 + var36), var9, var11); +- var5.addVertexWithUV((double)(var2 + 1), (double)((float)var3 + var17 + var19), (double)((float)var4 + var36), var9, var11); +- var5.addVertexWithUV((double)(var2 + 1), (double)((float)(var3 + 0) + var19), (double)(var4 + 0), var9, var15); +- var5.addVertexWithUV((double)(var2 + 0), (double)((float)(var3 + 0) + var19), (double)(var4 + 0), var13, var15); +- var5.addVertexWithUV((double)(var2 + 0), (double)((float)var3 + var17 + var19), (double)((float)var4 + var36), var13, var11); +- } +- +- if(Block.fire.canBlockCatchFire(this.blockAccess, var2, var3, var4 + 1)) { +- var5.addVertexWithUV((double)(var2 + 1), (double)((float)var3 + var17 + var19), (double)((float)(var4 + 1) - var36), var9, var11); +- var5.addVertexWithUV((double)(var2 + 1), (double)((float)(var3 + 0) + var19), (double)(var4 + 1 - 0), var9, var15); +- var5.addVertexWithUV((double)(var2 + 0), (double)((float)(var3 + 0) + var19), (double)(var4 + 1 - 0), var13, var15); +- var5.addVertexWithUV((double)(var2 + 0), (double)((float)var3 + var17 + var19), (double)((float)(var4 + 1) - var36), var13, var11); +- var5.addVertexWithUV((double)(var2 + 0), (double)((float)var3 + var17 + var19), (double)((float)(var4 + 1) - var36), var13, var11); +- var5.addVertexWithUV((double)(var2 + 0), (double)((float)(var3 + 0) + var19), (double)(var4 + 1 - 0), var13, var15); +- var5.addVertexWithUV((double)(var2 + 1), (double)((float)(var3 + 0) + var19), (double)(var4 + 1 - 0), var9, var15); +- var5.addVertexWithUV((double)(var2 + 1), (double)((float)var3 + var17 + var19), (double)((float)(var4 + 1) - var36), var9, var11); +- } +- +- if(Block.fire.canBlockCatchFire(this.blockAccess, var2, var3 + 1, var4)) { +- var20 = (double)var2 + 0.5D + 0.5D; +- var22 = (double)var2 + 0.5D - 0.5D; +- var24 = (double)var4 + 0.5D + 0.5D; +- var26 = (double)var4 + 0.5D - 0.5D; +- var28 = (double)var2 + 0.5D - 0.5D; +- var30 = (double)var2 + 0.5D + 0.5D; +- var32 = (double)var4 + 0.5D - 0.5D; +- double var34 = (double)var4 + 0.5D + 0.5D; +- var9 = (double)var6.getMinU(); +- var11 = (double)var6.getMinV(); +- var13 = (double)var6.getMaxU(); +- var15 = (double)var6.getMaxV(); +- ++var3; +- var17 = -0.2F; +- if((var2 + var3 + var4 & 1) == 0) { +- var5.addVertexWithUV(var28, (double)((float)var3 + var17), (double)(var4 + 0), var13, var11); +- var5.addVertexWithUV(var20, (double)(var3 + 0), (double)(var4 + 0), var13, var15); +- var5.addVertexWithUV(var20, (double)(var3 + 0), (double)(var4 + 1), var9, var15); +- var5.addVertexWithUV(var28, (double)((float)var3 + var17), (double)(var4 + 1), var9, var11); +- var9 = (double)var7.getMinU(); +- var11 = (double)var7.getMinV(); +- var13 = (double)var7.getMaxU(); +- var15 = (double)var7.getMaxV(); +- var5.addVertexWithUV(var30, (double)((float)var3 + var17), (double)(var4 + 1), var13, var11); +- var5.addVertexWithUV(var22, (double)(var3 + 0), (double)(var4 + 1), var13, var15); +- var5.addVertexWithUV(var22, (double)(var3 + 0), (double)(var4 + 0), var9, var15); +- var5.addVertexWithUV(var30, (double)((float)var3 + var17), (double)(var4 + 0), var9, var11); +- } else { +- var5.addVertexWithUV((double)(var2 + 0), (double)((float)var3 + var17), var34, var13, var11); +- var5.addVertexWithUV((double)(var2 + 0), (double)(var3 + 0), var26, var13, var15); +- var5.addVertexWithUV((double)(var2 + 1), (double)(var3 + 0), var26, var9, var15); +- var5.addVertexWithUV((double)(var2 + 1), (double)((float)var3 + var17), var34, var9, var11); +- var9 = (double)var7.getMinU(); +- var11 = (double)var7.getMinV(); +- var13 = (double)var7.getMaxU(); +- var15 = (double)var7.getMaxV(); +- var5.addVertexWithUV((double)(var2 + 1), (double)((float)var3 + var17), var32, var13, var11); +- var5.addVertexWithUV((double)(var2 + 1), (double)(var3 + 0), var24, var13, var15); +- var5.addVertexWithUV((double)(var2 + 0), (double)(var3 + 0), var24, var9, var15); +- var5.addVertexWithUV((double)(var2 + 0), (double)((float)var3 + var17), var32, var9, var11); +- } +- } ++ var5.setBrightness(par1BlockFire.getMixedBrightnessForBlock(this.blockAccess, par2, par3, par4)); ++ var8 = CTMUtils.getTile(this, par1BlockFire, par2, par3, par4, var8, var5); ++ ++ if (var8 == null) { ++ return false; + } else { +- double var18 = (double)var2 + 0.5D + 0.2D; +- var20 = (double)var2 + 0.5D - 0.2D; +- var22 = (double)var4 + 0.5D + 0.2D; +- var24 = (double)var4 + 0.5D - 0.2D; +- var26 = (double)var2 + 0.5D - 0.3D; +- var28 = (double)var2 + 0.5D + 0.3D; +- var30 = (double)var4 + 0.5D - 0.3D; +- var32 = (double)var4 + 0.5D + 0.3D; +- var5.addVertexWithUV(var26, (double)((float)var3 + var17), (double)(var4 + 1), var13, var11); +- var5.addVertexWithUV(var18, (double)(var3 + 0), (double)(var4 + 1), var13, var15); +- var5.addVertexWithUV(var18, (double)(var3 + 0), (double)(var4 + 0), var9, var15); +- var5.addVertexWithUV(var26, (double)((float)var3 + var17), (double)(var4 + 0), var9, var11); +- var5.addVertexWithUV(var28, (double)((float)var3 + var17), (double)(var4 + 0), var13, var11); +- var5.addVertexWithUV(var20, (double)(var3 + 0), (double)(var4 + 0), var13, var15); +- var5.addVertexWithUV(var20, (double)(var3 + 0), (double)(var4 + 1), var9, var15); +- var5.addVertexWithUV(var28, (double)((float)var3 + var17), (double)(var4 + 1), var9, var11); +- var9 = (double)var7.getMinU(); +- var11 = (double)var7.getMinV(); +- var13 = (double)var7.getMaxU(); +- var15 = (double)var7.getMaxV(); +- var5.addVertexWithUV((double)(var2 + 1), (double)((float)var3 + var17), var32, var13, var11); +- var5.addVertexWithUV((double)(var2 + 1), (double)(var3 + 0), var24, var13, var15); +- var5.addVertexWithUV((double)(var2 + 0), (double)(var3 + 0), var24, var9, var15); +- var5.addVertexWithUV((double)(var2 + 0), (double)((float)var3 + var17), var32, var9, var11); +- var5.addVertexWithUV((double)(var2 + 0), (double)((float)var3 + var17), var30, var13, var11); +- var5.addVertexWithUV((double)(var2 + 0), (double)(var3 + 0), var22, var13, var15); +- var5.addVertexWithUV((double)(var2 + 1), (double)(var3 + 0), var22, var9, var15); +- var5.addVertexWithUV((double)(var2 + 1), (double)((float)var3 + var17), var30, var9, var11); +- var18 = (double)var2 + 0.5D - 0.5D; +- var20 = (double)var2 + 0.5D + 0.5D; +- var22 = (double)var4 + 0.5D - 0.5D; +- var24 = (double)var4 + 0.5D + 0.5D; +- var26 = (double)var2 + 0.5D - 0.4D; +- var28 = (double)var2 + 0.5D + 0.4D; +- var30 = (double)var4 + 0.5D - 0.4D; +- var32 = (double)var4 + 0.5D + 0.4D; +- var5.addVertexWithUV(var26, (double)((float)var3 + var17), (double)(var4 + 0), var9, var11); +- var5.addVertexWithUV(var18, (double)(var3 + 0), (double)(var4 + 0), var9, var15); +- var5.addVertexWithUV(var18, (double)(var3 + 0), (double)(var4 + 1), var13, var15); +- var5.addVertexWithUV(var26, (double)((float)var3 + var17), (double)(var4 + 1), var13, var11); +- var5.addVertexWithUV(var28, (double)((float)var3 + var17), (double)(var4 + 1), var9, var11); +- var5.addVertexWithUV(var20, (double)(var3 + 0), (double)(var4 + 1), var9, var15); +- var5.addVertexWithUV(var20, (double)(var3 + 0), (double)(var4 + 0), var13, var15); +- var5.addVertexWithUV(var28, (double)((float)var3 + var17), (double)(var4 + 0), var13, var11); +- var9 = (double)var6.getMinU(); +- var11 = (double)var6.getMinV(); +- var13 = (double)var6.getMaxU(); +- var15 = (double)var6.getMaxV(); +- var5.addVertexWithUV((double)(var2 + 0), (double)((float)var3 + var17), var32, var9, var11); +- var5.addVertexWithUV((double)(var2 + 0), (double)(var3 + 0), var24, var9, var15); +- var5.addVertexWithUV((double)(var2 + 1), (double)(var3 + 0), var24, var13, var15); +- var5.addVertexWithUV((double)(var2 + 1), (double)((float)var3 + var17), var32, var13, var11); +- var5.addVertexWithUV((double)(var2 + 1), (double)((float)var3 + var17), var30, var9, var11); +- var5.addVertexWithUV((double)(var2 + 1), (double)(var3 + 0), var22, var9, var15); +- var5.addVertexWithUV((double)(var2 + 0), (double)(var3 + 0), var22, var13, var15); +- var5.addVertexWithUV((double)(var2 + 0), (double)((float)var3 + var17), var30, var13, var11); ++ var5 = TessellatorUtils.getTessellator(var5, var8); ++ double var9 = (double)var8.getMinU(); ++ double var11 = (double)var8.getMinV(); ++ double var13 = (double)var8.getMaxU(); ++ double var15 = (double)var8.getMaxV(); ++ float var17 = 1.4F; ++ double var32; ++ double var20; ++ double var22; ++ double var24; ++ double var26; ++ double var28; ++ double var30; ++ ++ if (!this.blockAccess.doesBlockHaveSolidTopSurface(par2, par3 - 1, par4) && !Block.fire.canBlockCatchFire(this.blockAccess, par2, par3 - 1, par4)) { ++ float var36 = 0.2F; ++ float var19 = 0.0625F; ++ ++ if ((par2 + par3 + par4 & 1) == 1) { ++ var8 = CTMUtils.getTile(this, par1BlockFire, par2, par3, par4, var7, var5); ++ ++ if (var8 == null) { ++ return false; ++ } ++ ++ var5 = TessellatorUtils.getTessellator(var5, var8); ++ var9 = (double)var8.getMinU(); ++ var11 = (double)var8.getMinV(); ++ var13 = (double)var8.getMaxU(); ++ var15 = (double)var8.getMaxV(); ++ } ++ ++ if ((par2 / 2 + par3 / 2 + par4 / 2 & 1) == 1) { ++ var20 = var13; ++ var13 = var9; ++ var9 = var20; ++ } ++ ++ if (Block.fire.canBlockCatchFire(this.blockAccess, par2 - 1, par3, par4)) { ++ var5.addVertexWithUV((double)((float)par2 + var36), (double)((float)par3 + var17 + var19), (double)(par4 + 1), var13, var11); ++ var5.addVertexWithUV((double)(par2 + 0), (double)((float)(par3 + 0) + var19), (double)(par4 + 1), var13, var15); ++ var5.addVertexWithUV((double)(par2 + 0), (double)((float)(par3 + 0) + var19), (double)(par4 + 0), var9, var15); ++ var5.addVertexWithUV((double)((float)par2 + var36), (double)((float)par3 + var17 + var19), (double)(par4 + 0), var9, var11); ++ var5.addVertexWithUV((double)((float)par2 + var36), (double)((float)par3 + var17 + var19), (double)(par4 + 0), var9, var11); ++ var5.addVertexWithUV((double)(par2 + 0), (double)((float)(par3 + 0) + var19), (double)(par4 + 0), var9, var15); ++ var5.addVertexWithUV((double)(par2 + 0), (double)((float)(par3 + 0) + var19), (double)(par4 + 1), var13, var15); ++ var5.addVertexWithUV((double)((float)par2 + var36), (double)((float)par3 + var17 + var19), (double)(par4 + 1), var13, var11); ++ } ++ ++ if (Block.fire.canBlockCatchFire(this.blockAccess, par2 + 1, par3, par4)) { ++ var5.addVertexWithUV((double)((float)(par2 + 1) - var36), (double)((float)par3 + var17 + var19), (double)(par4 + 0), var9, var11); ++ var5.addVertexWithUV((double)(par2 + 1 - 0), (double)((float)(par3 + 0) + var19), (double)(par4 + 0), var9, var15); ++ var5.addVertexWithUV((double)(par2 + 1 - 0), (double)((float)(par3 + 0) + var19), (double)(par4 + 1), var13, var15); ++ var5.addVertexWithUV((double)((float)(par2 + 1) - var36), (double)((float)par3 + var17 + var19), (double)(par4 + 1), var13, var11); ++ var5.addVertexWithUV((double)((float)(par2 + 1) - var36), (double)((float)par3 + var17 + var19), (double)(par4 + 1), var13, var11); ++ var5.addVertexWithUV((double)(par2 + 1 - 0), (double)((float)(par3 + 0) + var19), (double)(par4 + 1), var13, var15); ++ var5.addVertexWithUV((double)(par2 + 1 - 0), (double)((float)(par3 + 0) + var19), (double)(par4 + 0), var9, var15); ++ var5.addVertexWithUV((double)((float)(par2 + 1) - var36), (double)((float)par3 + var17 + var19), (double)(par4 + 0), var9, var11); ++ } ++ ++ if (Block.fire.canBlockCatchFire(this.blockAccess, par2, par3, par4 - 1)) { ++ var5.addVertexWithUV((double)(par2 + 0), (double)((float)par3 + var17 + var19), (double)((float)par4 + var36), var13, var11); ++ var5.addVertexWithUV((double)(par2 + 0), (double)((float)(par3 + 0) + var19), (double)(par4 + 0), var13, var15); ++ var5.addVertexWithUV((double)(par2 + 1), (double)((float)(par3 + 0) + var19), (double)(par4 + 0), var9, var15); ++ var5.addVertexWithUV((double)(par2 + 1), (double)((float)par3 + var17 + var19), (double)((float)par4 + var36), var9, var11); ++ var5.addVertexWithUV((double)(par2 + 1), (double)((float)par3 + var17 + var19), (double)((float)par4 + var36), var9, var11); ++ var5.addVertexWithUV((double)(par2 + 1), (double)((float)(par3 + 0) + var19), (double)(par4 + 0), var9, var15); ++ var5.addVertexWithUV((double)(par2 + 0), (double)((float)(par3 + 0) + var19), (double)(par4 + 0), var13, var15); ++ var5.addVertexWithUV((double)(par2 + 0), (double)((float)par3 + var17 + var19), (double)((float)par4 + var36), var13, var11); ++ } ++ ++ if (Block.fire.canBlockCatchFire(this.blockAccess, par2, par3, par4 + 1)) { ++ var5.addVertexWithUV((double)(par2 + 1), (double)((float)par3 + var17 + var19), (double)((float)(par4 + 1) - var36), var9, var11); ++ var5.addVertexWithUV((double)(par2 + 1), (double)((float)(par3 + 0) + var19), (double)(par4 + 1 - 0), var9, var15); ++ var5.addVertexWithUV((double)(par2 + 0), (double)((float)(par3 + 0) + var19), (double)(par4 + 1 - 0), var13, var15); ++ var5.addVertexWithUV((double)(par2 + 0), (double)((float)par3 + var17 + var19), (double)((float)(par4 + 1) - var36), var13, var11); ++ var5.addVertexWithUV((double)(par2 + 0), (double)((float)par3 + var17 + var19), (double)((float)(par4 + 1) - var36), var13, var11); ++ var5.addVertexWithUV((double)(par2 + 0), (double)((float)(par3 + 0) + var19), (double)(par4 + 1 - 0), var13, var15); ++ var5.addVertexWithUV((double)(par2 + 1), (double)((float)(par3 + 0) + var19), (double)(par4 + 1 - 0), var9, var15); ++ var5.addVertexWithUV((double)(par2 + 1), (double)((float)par3 + var17 + var19), (double)((float)(par4 + 1) - var36), var9, var11); ++ } ++ ++ if (Block.fire.canBlockCatchFire(this.blockAccess, par2, par3 + 1, par4)) { ++ var20 = (double)par2 + 0.5D + 0.5D; ++ var22 = (double)par2 + 0.5D - 0.5D; ++ var24 = (double)par4 + 0.5D + 0.5D; ++ var26 = (double)par4 + 0.5D - 0.5D; ++ var28 = (double)par2 + 0.5D - 0.5D; ++ var30 = (double)par2 + 0.5D + 0.5D; ++ var32 = (double)par4 + 0.5D - 0.5D; ++ double var34 = (double)par4 + 0.5D + 0.5D; ++ var8 = CTMUtils.getTile(this, par1BlockFire, par2, par3, par4, var6, var5); ++ ++ if (var8 == null) { ++ return false; ++ } ++ ++ var5 = TessellatorUtils.getTessellator(var5, var8); ++ var9 = (double)var8.getMinU(); ++ var11 = (double)var8.getMinV(); ++ var13 = (double)var8.getMaxU(); ++ var15 = (double)var8.getMaxV(); ++ ++par3; ++ var17 = -0.2F; ++ ++ if ((par2 + par3 + par4 & 1) == 0) { ++ var5.addVertexWithUV(var28, (double)((float)par3 + var17), (double)(par4 + 0), var13, var11); ++ var5.addVertexWithUV(var20, (double)(par3 + 0), (double)(par4 + 0), var13, var15); ++ var5.addVertexWithUV(var20, (double)(par3 + 0), (double)(par4 + 1), var9, var15); ++ var5.addVertexWithUV(var28, (double)((float)par3 + var17), (double)(par4 + 1), var9, var11); ++ var8 = CTMUtils.getTile(this, par1BlockFire, par2, par3, par4, var7, var5); ++ ++ if (var8 == null) { ++ return false; ++ } ++ ++ var5 = TessellatorUtils.getTessellator(var5, var8); ++ var9 = (double)var8.getMinU(); ++ var11 = (double)var8.getMinV(); ++ var13 = (double)var8.getMaxU(); ++ var15 = (double)var8.getMaxV(); ++ var5.addVertexWithUV(var30, (double)((float)par3 + var17), (double)(par4 + 1), var13, var11); ++ var5.addVertexWithUV(var22, (double)(par3 + 0), (double)(par4 + 1), var13, var15); ++ var5.addVertexWithUV(var22, (double)(par3 + 0), (double)(par4 + 0), var9, var15); ++ var5.addVertexWithUV(var30, (double)((float)par3 + var17), (double)(par4 + 0), var9, var11); ++ } else { ++ var5.addVertexWithUV((double)(par2 + 0), (double)((float)par3 + var17), var34, var13, var11); ++ var5.addVertexWithUV((double)(par2 + 0), (double)(par3 + 0), var26, var13, var15); ++ var5.addVertexWithUV((double)(par2 + 1), (double)(par3 + 0), var26, var9, var15); ++ var5.addVertexWithUV((double)(par2 + 1), (double)((float)par3 + var17), var34, var9, var11); ++ var8 = CTMUtils.getTile(this, par1BlockFire, par2, par3, par4, var7, var5); ++ ++ if (var8 == null) { ++ return false; ++ } ++ ++ var5 = TessellatorUtils.getTessellator(var5, var8); ++ var9 = (double)var8.getMinU(); ++ var11 = (double)var8.getMinV(); ++ var13 = (double)var8.getMaxU(); ++ var15 = (double)var8.getMaxV(); ++ var5.addVertexWithUV((double)(par2 + 1), (double)((float)par3 + var17), var32, var13, var11); ++ var5.addVertexWithUV((double)(par2 + 1), (double)(par3 + 0), var24, var13, var15); ++ var5.addVertexWithUV((double)(par2 + 0), (double)(par3 + 0), var24, var9, var15); ++ var5.addVertexWithUV((double)(par2 + 0), (double)((float)par3 + var17), var32, var9, var11); ++ } ++ } ++ } else { ++ double var18 = (double)par2 + 0.5D + 0.2D; ++ var20 = (double)par2 + 0.5D - 0.2D; ++ var22 = (double)par4 + 0.5D + 0.2D; ++ var24 = (double)par4 + 0.5D - 0.2D; ++ var26 = (double)par2 + 0.5D - 0.3D; ++ var28 = (double)par2 + 0.5D + 0.3D; ++ var30 = (double)par4 + 0.5D - 0.3D; ++ var32 = (double)par4 + 0.5D + 0.3D; ++ var5.addVertexWithUV(var26, (double)((float)par3 + var17), (double)(par4 + 1), var13, var11); ++ var5.addVertexWithUV(var18, (double)(par3 + 0), (double)(par4 + 1), var13, var15); ++ var5.addVertexWithUV(var18, (double)(par3 + 0), (double)(par4 + 0), var9, var15); ++ var5.addVertexWithUV(var26, (double)((float)par3 + var17), (double)(par4 + 0), var9, var11); ++ var5.addVertexWithUV(var28, (double)((float)par3 + var17), (double)(par4 + 0), var13, var11); ++ var5.addVertexWithUV(var20, (double)(par3 + 0), (double)(par4 + 0), var13, var15); ++ var5.addVertexWithUV(var20, (double)(par3 + 0), (double)(par4 + 1), var9, var15); ++ var5.addVertexWithUV(var28, (double)((float)par3 + var17), (double)(par4 + 1), var9, var11); ++ var8 = CTMUtils.getTile(this, par1BlockFire, par2, par3, par4, var7, var5); ++ ++ if (var8 == null) { ++ return false; ++ } ++ ++ var5 = TessellatorUtils.getTessellator(var5, var8); ++ var9 = (double)var8.getMinU(); ++ var11 = (double)var8.getMinV(); ++ var13 = (double)var8.getMaxU(); ++ var15 = (double)var8.getMaxV(); ++ var5.addVertexWithUV((double)(par2 + 1), (double)((float)par3 + var17), var32, var13, var11); ++ var5.addVertexWithUV((double)(par2 + 1), (double)(par3 + 0), var24, var13, var15); ++ var5.addVertexWithUV((double)(par2 + 0), (double)(par3 + 0), var24, var9, var15); ++ var5.addVertexWithUV((double)(par2 + 0), (double)((float)par3 + var17), var32, var9, var11); ++ var5.addVertexWithUV((double)(par2 + 0), (double)((float)par3 + var17), var30, var13, var11); ++ var5.addVertexWithUV((double)(par2 + 0), (double)(par3 + 0), var22, var13, var15); ++ var5.addVertexWithUV((double)(par2 + 1), (double)(par3 + 0), var22, var9, var15); ++ var5.addVertexWithUV((double)(par2 + 1), (double)((float)par3 + var17), var30, var9, var11); ++ var18 = (double)par2 + 0.5D - 0.5D; ++ var20 = (double)par2 + 0.5D + 0.5D; ++ var22 = (double)par4 + 0.5D - 0.5D; ++ var24 = (double)par4 + 0.5D + 0.5D; ++ var26 = (double)par2 + 0.5D - 0.4D; ++ var28 = (double)par2 + 0.5D + 0.4D; ++ var30 = (double)par4 + 0.5D - 0.4D; ++ var32 = (double)par4 + 0.5D + 0.4D; ++ var5.addVertexWithUV(var26, (double)((float)par3 + var17), (double)(par4 + 0), var9, var11); ++ var5.addVertexWithUV(var18, (double)(par3 + 0), (double)(par4 + 0), var9, var15); ++ var5.addVertexWithUV(var18, (double)(par3 + 0), (double)(par4 + 1), var13, var15); ++ var5.addVertexWithUV(var26, (double)((float)par3 + var17), (double)(par4 + 1), var13, var11); ++ var5.addVertexWithUV(var28, (double)((float)par3 + var17), (double)(par4 + 1), var9, var11); ++ var5.addVertexWithUV(var20, (double)(par3 + 0), (double)(par4 + 1), var9, var15); ++ var5.addVertexWithUV(var20, (double)(par3 + 0), (double)(par4 + 0), var13, var15); ++ var5.addVertexWithUV(var28, (double)((float)par3 + var17), (double)(par4 + 0), var13, var11); ++ var8 = CTMUtils.getTile(this, par1BlockFire, par2, par3, par4, var6, var5); ++ ++ if (var8 == null) { ++ return false; ++ } ++ ++ var5 = TessellatorUtils.getTessellator(var5, var8); ++ var9 = (double)var8.getMinU(); ++ var11 = (double)var8.getMinV(); ++ var13 = (double)var8.getMaxU(); ++ var15 = (double)var8.getMaxV(); ++ var5.addVertexWithUV((double)(par2 + 0), (double)((float)par3 + var17), var32, var9, var11); ++ var5.addVertexWithUV((double)(par2 + 0), (double)(par3 + 0), var24, var9, var15); ++ var5.addVertexWithUV((double)(par2 + 1), (double)(par3 + 0), var24, var13, var15); ++ var5.addVertexWithUV((double)(par2 + 1), (double)((float)par3 + var17), var32, var13, var11); ++ var5.addVertexWithUV((double)(par2 + 1), (double)((float)par3 + var17), var30, var9, var11); ++ var5.addVertexWithUV((double)(par2 + 1), (double)(par3 + 0), var22, var9, var15); ++ var5.addVertexWithUV((double)(par2 + 0), (double)(par3 + 0), var22, var13, var15); ++ var5.addVertexWithUV((double)(par2 + 0), (double)((float)par3 + var17), var30, var13, var11); ++ } ++ ++ return true; + } +- +- return true; + } + +- public boolean renderBlockRedstoneWire(Block var1, int var2, int var3, int var4) { ++ /** ++ * Renders a redstone wire block at the given coordinates ++ */ ++ public boolean renderBlockRedstoneWire(Block par1Block, int par2, int par3, int par4) { + Tessellator var5 = Tessellator.instance; +- int var6 = this.blockAccess.getBlockMetadata(var2, var3, var4); ++ int var6 = this.blockAccess.getBlockMetadata(par2, par3, par4); + Icon var7 = BlockRedstoneWire.getRedstoneWireIcon("cross"); + Icon var8 = BlockRedstoneWire.getRedstoneWireIcon("line"); + Icon var9 = BlockRedstoneWire.getRedstoneWireIcon("cross_overlay"); + Icon var10 = BlockRedstoneWire.getRedstoneWireIcon("line_overlay"); +- var5.setBrightness(var1.getMixedBrightnessForBlock(this.blockAccess, var2, var3, var4)); ++ var5.setBrightness(par1Block.getMixedBrightnessForBlock(this.blockAccess, par2, par3, par4)); + float var11 = 1.0F; +- float var12 = (float)var6 / 15.0F; +- float var13 = var12 * 0.6F + 0.4F; +- if(var6 == 0) { +- var13 = 0.3F; ++ float var13; ++ float var14; ++ float var15; ++ ++ if (ColorizeBlock.computeRedstoneWireColor(var6)) { ++ var13 = Colorizer.setColor[0]; ++ var14 = Colorizer.setColor[1]; ++ var15 = Colorizer.setColor[2]; ++ } else { ++ float var12 = (float)var6 / 15.0F; ++ var13 = var12 * 0.6F + 0.4F; ++ ++ if (var6 == 0) { ++ var13 = 0.3F; ++ } ++ ++ var14 = var12 * var12 * 0.7F - 0.5F; ++ var15 = var12 * var12 * 0.6F - 0.7F; + } + +- float var14 = var12 * var12 * 0.7F - 0.5F; +- float var15 = var12 * var12 * 0.6F - 0.7F; +- if(var14 < 0.0F) { ++ if (var14 < 0.0F) { + var14 = 0.0F; + } + +- if(var15 < 0.0F) { ++ if (var15 < 0.0F) { + var15 = 0.0F; + } + + var5.setColorOpaque_F(var13, var14, var15); +- double var16 = 1.0D / 64.0D; +- double var18 = 1.0D / 64.0D; +- boolean var20 = BlockRedstoneWire.isPowerProviderOrWire(this.blockAccess, var2 - 1, var3, var4, 1) || !this.blockAccess.isBlockNormalCube(var2 - 1, var3, var4) && BlockRedstoneWire.isPowerProviderOrWire(this.blockAccess, var2 - 1, var3 - 1, var4, -1); +- boolean var21 = BlockRedstoneWire.isPowerProviderOrWire(this.blockAccess, var2 + 1, var3, var4, 3) || !this.blockAccess.isBlockNormalCube(var2 + 1, var3, var4) && BlockRedstoneWire.isPowerProviderOrWire(this.blockAccess, var2 + 1, var3 - 1, var4, -1); +- boolean var22 = BlockRedstoneWire.isPowerProviderOrWire(this.blockAccess, var2, var3, var4 - 1, 2) || !this.blockAccess.isBlockNormalCube(var2, var3, var4 - 1) && BlockRedstoneWire.isPowerProviderOrWire(this.blockAccess, var2, var3 - 1, var4 - 1, -1); +- boolean var23 = BlockRedstoneWire.isPowerProviderOrWire(this.blockAccess, var2, var3, var4 + 1, 0) || !this.blockAccess.isBlockNormalCube(var2, var3, var4 + 1) && BlockRedstoneWire.isPowerProviderOrWire(this.blockAccess, var2, var3 - 1, var4 + 1, -1); +- if(!this.blockAccess.isBlockNormalCube(var2, var3 + 1, var4)) { +- if(this.blockAccess.isBlockNormalCube(var2 - 1, var3, var4) && BlockRedstoneWire.isPowerProviderOrWire(this.blockAccess, var2 - 1, var3 + 1, var4, -1)) { ++ double var16 = 0.015625D; ++ double var18 = 0.015625D; ++ boolean var20 = BlockRedstoneWire.isPowerProviderOrWire(this.blockAccess, par2 - 1, par3, par4, 1) || !this.blockAccess.isBlockNormalCube(par2 - 1, par3, par4) && BlockRedstoneWire.isPowerProviderOrWire(this.blockAccess, par2 - 1, par3 - 1, par4, -1); ++ boolean var21 = BlockRedstoneWire.isPowerProviderOrWire(this.blockAccess, par2 + 1, par3, par4, 3) || !this.blockAccess.isBlockNormalCube(par2 + 1, par3, par4) && BlockRedstoneWire.isPowerProviderOrWire(this.blockAccess, par2 + 1, par3 - 1, par4, -1); ++ boolean var22 = BlockRedstoneWire.isPowerProviderOrWire(this.blockAccess, par2, par3, par4 - 1, 2) || !this.blockAccess.isBlockNormalCube(par2, par3, par4 - 1) && BlockRedstoneWire.isPowerProviderOrWire(this.blockAccess, par2, par3 - 1, par4 - 1, -1); ++ boolean var23 = BlockRedstoneWire.isPowerProviderOrWire(this.blockAccess, par2, par3, par4 + 1, 0) || !this.blockAccess.isBlockNormalCube(par2, par3, par4 + 1) && BlockRedstoneWire.isPowerProviderOrWire(this.blockAccess, par2, par3 - 1, par4 + 1, -1); ++ ++ if (!this.blockAccess.isBlockNormalCube(par2, par3 + 1, par4)) { ++ if (this.blockAccess.isBlockNormalCube(par2 - 1, par3, par4) && BlockRedstoneWire.isPowerProviderOrWire(this.blockAccess, par2 - 1, par3 + 1, par4, -1)) { + var20 = true; + } + +- if(this.blockAccess.isBlockNormalCube(var2 + 1, var3, var4) && BlockRedstoneWire.isPowerProviderOrWire(this.blockAccess, var2 + 1, var3 + 1, var4, -1)) { ++ if (this.blockAccess.isBlockNormalCube(par2 + 1, par3, par4) && BlockRedstoneWire.isPowerProviderOrWire(this.blockAccess, par2 + 1, par3 + 1, par4, -1)) { + var21 = true; + } + +- if(this.blockAccess.isBlockNormalCube(var2, var3, var4 - 1) && BlockRedstoneWire.isPowerProviderOrWire(this.blockAccess, var2, var3 + 1, var4 - 1, -1)) { ++ if (this.blockAccess.isBlockNormalCube(par2, par3, par4 - 1) && BlockRedstoneWire.isPowerProviderOrWire(this.blockAccess, par2, par3 + 1, par4 - 1, -1)) { + var22 = true; + } + +- if(this.blockAccess.isBlockNormalCube(var2, var3, var4 + 1) && BlockRedstoneWire.isPowerProviderOrWire(this.blockAccess, var2, var3 + 1, var4 + 1, -1)) { ++ if (this.blockAccess.isBlockNormalCube(par2, par3, par4 + 1) && BlockRedstoneWire.isPowerProviderOrWire(this.blockAccess, par2, par3 + 1, par4 + 1, -1)) { + var23 = true; + } + } + +- float var24 = (float)(var2 + 0); +- float var25 = (float)(var2 + 1); +- float var26 = (float)(var4 + 0); +- float var27 = (float)(var4 + 1); +- byte var28 = 0; +- if((var20 || var21) && !var22 && !var23) { ++ float var24 = (float)(par2 + 0); ++ float var25 = (float)(par2 + 1); ++ float var26 = (float)(par4 + 0); ++ float var27 = (float)(par4 + 1); ++ int var28 = 0; ++ ++ if ((var20 || var21) && !var22 && !var23) { + var28 = 1; + } + +- if((var22 || var23) && !var21 && !var20) { ++ if ((var22 || var23) && !var21 && !var20) { + var28 = 2; + } + +- if(var28 == 0) { ++ if (var28 == 0) { + int var29 = 0; + int var30 = 0; + int var31 = 16; + int var32 = 16; + boolean var33 = true; +- if(!var20) { +- var24 += 5.0F / 16.0F; ++ ++ if (!var20) { ++ var24 += 0.3125F; + } + +- if(!var20) { ++ if (!var20) { + var29 += 5; + } + +- if(!var21) { +- var25 -= 5.0F / 16.0F; ++ if (!var21) { ++ var25 -= 0.3125F; + } + +- if(!var21) { ++ if (!var21) { + var31 -= 5; + } + +- if(!var22) { +- var26 += 5.0F / 16.0F; ++ if (!var22) { ++ var26 += 0.3125F; + } + +- if(!var22) { ++ if (!var22) { + var30 += 5; + } + +- if(!var23) { +- var27 -= 5.0F / 16.0F; ++ if (!var23) { ++ var27 -= 0.3125F; + } + +- if(!var23) { ++ if (!var23) { + var32 -= 5; + } + +- var5.addVertexWithUV((double)var25, (double)var3 + 1.0D / 64.0D, (double)var27, (double)var7.getInterpolatedU((double)var31), (double)var7.getInterpolatedV((double)var32)); +- var5.addVertexWithUV((double)var25, (double)var3 + 1.0D / 64.0D, (double)var26, (double)var7.getInterpolatedU((double)var31), (double)var7.getInterpolatedV((double)var30)); +- var5.addVertexWithUV((double)var24, (double)var3 + 1.0D / 64.0D, (double)var26, (double)var7.getInterpolatedU((double)var29), (double)var7.getInterpolatedV((double)var30)); +- var5.addVertexWithUV((double)var24, (double)var3 + 1.0D / 64.0D, (double)var27, (double)var7.getInterpolatedU((double)var29), (double)var7.getInterpolatedV((double)var32)); +- var5.setColorOpaque_F(var11, var11, var11); +- var5.addVertexWithUV((double)var25, (double)var3 + 1.0D / 64.0D, (double)var27, (double)var9.getInterpolatedU((double)var31), (double)var9.getInterpolatedV((double)var32)); +- var5.addVertexWithUV((double)var25, (double)var3 + 1.0D / 64.0D, (double)var26, (double)var9.getInterpolatedU((double)var31), (double)var9.getInterpolatedV((double)var30)); +- var5.addVertexWithUV((double)var24, (double)var3 + 1.0D / 64.0D, (double)var26, (double)var9.getInterpolatedU((double)var29), (double)var9.getInterpolatedV((double)var30)); +- var5.addVertexWithUV((double)var24, (double)var3 + 1.0D / 64.0D, (double)var27, (double)var9.getInterpolatedU((double)var29), (double)var9.getInterpolatedV((double)var32)); +- } else if(var28 == 1) { +- var5.addVertexWithUV((double)var25, (double)var3 + 1.0D / 64.0D, (double)var27, (double)var8.getMaxU(), (double)var8.getMaxV()); +- var5.addVertexWithUV((double)var25, (double)var3 + 1.0D / 64.0D, (double)var26, (double)var8.getMaxU(), (double)var8.getMinV()); +- var5.addVertexWithUV((double)var24, (double)var3 + 1.0D / 64.0D, (double)var26, (double)var8.getMinU(), (double)var8.getMinV()); +- var5.addVertexWithUV((double)var24, (double)var3 + 1.0D / 64.0D, (double)var27, (double)var8.getMinU(), (double)var8.getMaxV()); +- var5.setColorOpaque_F(var11, var11, var11); +- var5.addVertexWithUV((double)var25, (double)var3 + 1.0D / 64.0D, (double)var27, (double)var10.getMaxU(), (double)var10.getMaxV()); +- var5.addVertexWithUV((double)var25, (double)var3 + 1.0D / 64.0D, (double)var26, (double)var10.getMaxU(), (double)var10.getMinV()); +- var5.addVertexWithUV((double)var24, (double)var3 + 1.0D / 64.0D, (double)var26, (double)var10.getMinU(), (double)var10.getMinV()); +- var5.addVertexWithUV((double)var24, (double)var3 + 1.0D / 64.0D, (double)var27, (double)var10.getMinU(), (double)var10.getMaxV()); ++ var5.addVertexWithUV((double)var25, (double)par3 + 0.015625D, (double)var27, (double)var7.getInterpolatedU((double)var31), (double)var7.getInterpolatedV((double)var32)); ++ var5.addVertexWithUV((double)var25, (double)par3 + 0.015625D, (double)var26, (double)var7.getInterpolatedU((double)var31), (double)var7.getInterpolatedV((double)var30)); ++ var5.addVertexWithUV((double)var24, (double)par3 + 0.015625D, (double)var26, (double)var7.getInterpolatedU((double)var29), (double)var7.getInterpolatedV((double)var30)); ++ var5.addVertexWithUV((double)var24, (double)par3 + 0.015625D, (double)var27, (double)var7.getInterpolatedU((double)var29), (double)var7.getInterpolatedV((double)var32)); ++ var5.setColorOpaque_F(var11, var11, var11); ++ var5.addVertexWithUV((double)var25, (double)par3 + 0.015625D, (double)var27, (double)var9.getInterpolatedU((double)var31), (double)var9.getInterpolatedV((double)var32)); ++ var5.addVertexWithUV((double)var25, (double)par3 + 0.015625D, (double)var26, (double)var9.getInterpolatedU((double)var31), (double)var9.getInterpolatedV((double)var30)); ++ var5.addVertexWithUV((double)var24, (double)par3 + 0.015625D, (double)var26, (double)var9.getInterpolatedU((double)var29), (double)var9.getInterpolatedV((double)var30)); ++ var5.addVertexWithUV((double)var24, (double)par3 + 0.015625D, (double)var27, (double)var9.getInterpolatedU((double)var29), (double)var9.getInterpolatedV((double)var32)); ++ } else if (var28 == 1) { ++ var5.addVertexWithUV((double)var25, (double)par3 + 0.015625D, (double)var27, (double)var8.getMaxU(), (double)var8.getMaxV()); ++ var5.addVertexWithUV((double)var25, (double)par3 + 0.015625D, (double)var26, (double)var8.getMaxU(), (double)var8.getMinV()); ++ var5.addVertexWithUV((double)var24, (double)par3 + 0.015625D, (double)var26, (double)var8.getMinU(), (double)var8.getMinV()); ++ var5.addVertexWithUV((double)var24, (double)par3 + 0.015625D, (double)var27, (double)var8.getMinU(), (double)var8.getMaxV()); ++ var5.setColorOpaque_F(var11, var11, var11); ++ var5.addVertexWithUV((double)var25, (double)par3 + 0.015625D, (double)var27, (double)var10.getMaxU(), (double)var10.getMaxV()); ++ var5.addVertexWithUV((double)var25, (double)par3 + 0.015625D, (double)var26, (double)var10.getMaxU(), (double)var10.getMinV()); ++ var5.addVertexWithUV((double)var24, (double)par3 + 0.015625D, (double)var26, (double)var10.getMinU(), (double)var10.getMinV()); ++ var5.addVertexWithUV((double)var24, (double)par3 + 0.015625D, (double)var27, (double)var10.getMinU(), (double)var10.getMaxV()); + } else { +- var5.addVertexWithUV((double)var25, (double)var3 + 1.0D / 64.0D, (double)var27, (double)var8.getMaxU(), (double)var8.getMaxV()); +- var5.addVertexWithUV((double)var25, (double)var3 + 1.0D / 64.0D, (double)var26, (double)var8.getMinU(), (double)var8.getMaxV()); +- var5.addVertexWithUV((double)var24, (double)var3 + 1.0D / 64.0D, (double)var26, (double)var8.getMinU(), (double)var8.getMinV()); +- var5.addVertexWithUV((double)var24, (double)var3 + 1.0D / 64.0D, (double)var27, (double)var8.getMaxU(), (double)var8.getMinV()); ++ var5.addVertexWithUV((double)var25, (double)par3 + 0.015625D, (double)var27, (double)var8.getMaxU(), (double)var8.getMaxV()); ++ var5.addVertexWithUV((double)var25, (double)par3 + 0.015625D, (double)var26, (double)var8.getMinU(), (double)var8.getMaxV()); ++ var5.addVertexWithUV((double)var24, (double)par3 + 0.015625D, (double)var26, (double)var8.getMinU(), (double)var8.getMinV()); ++ var5.addVertexWithUV((double)var24, (double)par3 + 0.015625D, (double)var27, (double)var8.getMaxU(), (double)var8.getMinV()); + var5.setColorOpaque_F(var11, var11, var11); +- var5.addVertexWithUV((double)var25, (double)var3 + 1.0D / 64.0D, (double)var27, (double)var10.getMaxU(), (double)var10.getMaxV()); +- var5.addVertexWithUV((double)var25, (double)var3 + 1.0D / 64.0D, (double)var26, (double)var10.getMinU(), (double)var10.getMaxV()); +- var5.addVertexWithUV((double)var24, (double)var3 + 1.0D / 64.0D, (double)var26, (double)var10.getMinU(), (double)var10.getMinV()); +- var5.addVertexWithUV((double)var24, (double)var3 + 1.0D / 64.0D, (double)var27, (double)var10.getMaxU(), (double)var10.getMinV()); ++ var5.addVertexWithUV((double)var25, (double)par3 + 0.015625D, (double)var27, (double)var10.getMaxU(), (double)var10.getMaxV()); ++ var5.addVertexWithUV((double)var25, (double)par3 + 0.015625D, (double)var26, (double)var10.getMinU(), (double)var10.getMaxV()); ++ var5.addVertexWithUV((double)var24, (double)par3 + 0.015625D, (double)var26, (double)var10.getMinU(), (double)var10.getMinV()); ++ var5.addVertexWithUV((double)var24, (double)par3 + 0.015625D, (double)var27, (double)var10.getMaxU(), (double)var10.getMinV()); + } + +- if(!this.blockAccess.isBlockNormalCube(var2, var3 + 1, var4)) { +- float var34 = 7.0F / 320.0F; +- if(this.blockAccess.isBlockNormalCube(var2 - 1, var3, var4) && this.blockAccess.getBlockId(var2 - 1, var3 + 1, var4) == Block.redstoneWire.blockID) { +- var5.setColorOpaque_F(var11 * var13, var11 * var14, var11 * var15); +- var5.addVertexWithUV((double)var2 + 1.0D / 64.0D, (double)((float)(var3 + 1) + 7.0F / 320.0F), (double)(var4 + 1), (double)var8.getMaxU(), (double)var8.getMinV()); +- var5.addVertexWithUV((double)var2 + 1.0D / 64.0D, (double)(var3 + 0), (double)(var4 + 1), (double)var8.getMinU(), (double)var8.getMinV()); +- var5.addVertexWithUV((double)var2 + 1.0D / 64.0D, (double)(var3 + 0), (double)(var4 + 0), (double)var8.getMinU(), (double)var8.getMaxV()); +- var5.addVertexWithUV((double)var2 + 1.0D / 64.0D, (double)((float)(var3 + 1) + 7.0F / 320.0F), (double)(var4 + 0), (double)var8.getMaxU(), (double)var8.getMaxV()); +- var5.setColorOpaque_F(var11, var11, var11); +- var5.addVertexWithUV((double)var2 + 1.0D / 64.0D, (double)((float)(var3 + 1) + 7.0F / 320.0F), (double)(var4 + 1), (double)var10.getMaxU(), (double)var10.getMinV()); +- var5.addVertexWithUV((double)var2 + 1.0D / 64.0D, (double)(var3 + 0), (double)(var4 + 1), (double)var10.getMinU(), (double)var10.getMinV()); +- var5.addVertexWithUV((double)var2 + 1.0D / 64.0D, (double)(var3 + 0), (double)(var4 + 0), (double)var10.getMinU(), (double)var10.getMaxV()); +- var5.addVertexWithUV((double)var2 + 1.0D / 64.0D, (double)((float)(var3 + 1) + 7.0F / 320.0F), (double)(var4 + 0), (double)var10.getMaxU(), (double)var10.getMaxV()); +- } +- +- if(this.blockAccess.isBlockNormalCube(var2 + 1, var3, var4) && this.blockAccess.getBlockId(var2 + 1, var3 + 1, var4) == Block.redstoneWire.blockID) { +- var5.setColorOpaque_F(var11 * var13, var11 * var14, var11 * var15); +- var5.addVertexWithUV((double)(var2 + 1) - 1.0D / 64.0D, (double)(var3 + 0), (double)(var4 + 1), (double)var8.getMinU(), (double)var8.getMaxV()); +- var5.addVertexWithUV((double)(var2 + 1) - 1.0D / 64.0D, (double)((float)(var3 + 1) + 7.0F / 320.0F), (double)(var4 + 1), (double)var8.getMaxU(), (double)var8.getMaxV()); +- var5.addVertexWithUV((double)(var2 + 1) - 1.0D / 64.0D, (double)((float)(var3 + 1) + 7.0F / 320.0F), (double)(var4 + 0), (double)var8.getMaxU(), (double)var8.getMinV()); +- var5.addVertexWithUV((double)(var2 + 1) - 1.0D / 64.0D, (double)(var3 + 0), (double)(var4 + 0), (double)var8.getMinU(), (double)var8.getMinV()); +- var5.setColorOpaque_F(var11, var11, var11); +- var5.addVertexWithUV((double)(var2 + 1) - 1.0D / 64.0D, (double)(var3 + 0), (double)(var4 + 1), (double)var10.getMinU(), (double)var10.getMaxV()); +- var5.addVertexWithUV((double)(var2 + 1) - 1.0D / 64.0D, (double)((float)(var3 + 1) + 7.0F / 320.0F), (double)(var4 + 1), (double)var10.getMaxU(), (double)var10.getMaxV()); +- var5.addVertexWithUV((double)(var2 + 1) - 1.0D / 64.0D, (double)((float)(var3 + 1) + 7.0F / 320.0F), (double)(var4 + 0), (double)var10.getMaxU(), (double)var10.getMinV()); +- var5.addVertexWithUV((double)(var2 + 1) - 1.0D / 64.0D, (double)(var3 + 0), (double)(var4 + 0), (double)var10.getMinU(), (double)var10.getMinV()); +- } +- +- if(this.blockAccess.isBlockNormalCube(var2, var3, var4 - 1) && this.blockAccess.getBlockId(var2, var3 + 1, var4 - 1) == Block.redstoneWire.blockID) { +- var5.setColorOpaque_F(var11 * var13, var11 * var14, var11 * var15); +- var5.addVertexWithUV((double)(var2 + 1), (double)(var3 + 0), (double)var4 + 1.0D / 64.0D, (double)var8.getMinU(), (double)var8.getMaxV()); +- var5.addVertexWithUV((double)(var2 + 1), (double)((float)(var3 + 1) + 7.0F / 320.0F), (double)var4 + 1.0D / 64.0D, (double)var8.getMaxU(), (double)var8.getMaxV()); +- var5.addVertexWithUV((double)(var2 + 0), (double)((float)(var3 + 1) + 7.0F / 320.0F), (double)var4 + 1.0D / 64.0D, (double)var8.getMaxU(), (double)var8.getMinV()); +- var5.addVertexWithUV((double)(var2 + 0), (double)(var3 + 0), (double)var4 + 1.0D / 64.0D, (double)var8.getMinU(), (double)var8.getMinV()); +- var5.setColorOpaque_F(var11, var11, var11); +- var5.addVertexWithUV((double)(var2 + 1), (double)(var3 + 0), (double)var4 + 1.0D / 64.0D, (double)var10.getMinU(), (double)var10.getMaxV()); +- var5.addVertexWithUV((double)(var2 + 1), (double)((float)(var3 + 1) + 7.0F / 320.0F), (double)var4 + 1.0D / 64.0D, (double)var10.getMaxU(), (double)var10.getMaxV()); +- var5.addVertexWithUV((double)(var2 + 0), (double)((float)(var3 + 1) + 7.0F / 320.0F), (double)var4 + 1.0D / 64.0D, (double)var10.getMaxU(), (double)var10.getMinV()); +- var5.addVertexWithUV((double)(var2 + 0), (double)(var3 + 0), (double)var4 + 1.0D / 64.0D, (double)var10.getMinU(), (double)var10.getMinV()); +- } +- +- if(this.blockAccess.isBlockNormalCube(var2, var3, var4 + 1) && this.blockAccess.getBlockId(var2, var3 + 1, var4 + 1) == Block.redstoneWire.blockID) { +- var5.setColorOpaque_F(var11 * var13, var11 * var14, var11 * var15); +- var5.addVertexWithUV((double)(var2 + 1), (double)((float)(var3 + 1) + 7.0F / 320.0F), (double)(var4 + 1) - 1.0D / 64.0D, (double)var8.getMaxU(), (double)var8.getMinV()); +- var5.addVertexWithUV((double)(var2 + 1), (double)(var3 + 0), (double)(var4 + 1) - 1.0D / 64.0D, (double)var8.getMinU(), (double)var8.getMinV()); +- var5.addVertexWithUV((double)(var2 + 0), (double)(var3 + 0), (double)(var4 + 1) - 1.0D / 64.0D, (double)var8.getMinU(), (double)var8.getMaxV()); +- var5.addVertexWithUV((double)(var2 + 0), (double)((float)(var3 + 1) + 7.0F / 320.0F), (double)(var4 + 1) - 1.0D / 64.0D, (double)var8.getMaxU(), (double)var8.getMaxV()); +- var5.setColorOpaque_F(var11, var11, var11); +- var5.addVertexWithUV((double)(var2 + 1), (double)((float)(var3 + 1) + 7.0F / 320.0F), (double)(var4 + 1) - 1.0D / 64.0D, (double)var10.getMaxU(), (double)var10.getMinV()); +- var5.addVertexWithUV((double)(var2 + 1), (double)(var3 + 0), (double)(var4 + 1) - 1.0D / 64.0D, (double)var10.getMinU(), (double)var10.getMinV()); +- var5.addVertexWithUV((double)(var2 + 0), (double)(var3 + 0), (double)(var4 + 1) - 1.0D / 64.0D, (double)var10.getMinU(), (double)var10.getMaxV()); +- var5.addVertexWithUV((double)(var2 + 0), (double)((float)(var3 + 1) + 7.0F / 320.0F), (double)(var4 + 1) - 1.0D / 64.0D, (double)var10.getMaxU(), (double)var10.getMaxV()); ++ if (!this.blockAccess.isBlockNormalCube(par2, par3 + 1, par4)) { ++ float var34 = 0.021875F; ++ ++ if (this.blockAccess.isBlockNormalCube(par2 - 1, par3, par4) && this.blockAccess.getBlockId(par2 - 1, par3 + 1, par4) == Block.redstoneWire.blockID) { ++ var5.setColorOpaque_F(var11 * var13, var11 * var14, var11 * var15); ++ var5.addVertexWithUV((double)par2 + 0.015625D, (double)((float)(par3 + 1) + 0.021875F), (double)(par4 + 1), (double)var8.getMaxU(), (double)var8.getMinV()); ++ var5.addVertexWithUV((double)par2 + 0.015625D, (double)(par3 + 0), (double)(par4 + 1), (double)var8.getMinU(), (double)var8.getMinV()); ++ var5.addVertexWithUV((double)par2 + 0.015625D, (double)(par3 + 0), (double)(par4 + 0), (double)var8.getMinU(), (double)var8.getMaxV()); ++ var5.addVertexWithUV((double)par2 + 0.015625D, (double)((float)(par3 + 1) + 0.021875F), (double)(par4 + 0), (double)var8.getMaxU(), (double)var8.getMaxV()); ++ var5.setColorOpaque_F(var11, var11, var11); ++ var5.addVertexWithUV((double)par2 + 0.015625D, (double)((float)(par3 + 1) + 0.021875F), (double)(par4 + 1), (double)var10.getMaxU(), (double)var10.getMinV()); ++ var5.addVertexWithUV((double)par2 + 0.015625D, (double)(par3 + 0), (double)(par4 + 1), (double)var10.getMinU(), (double)var10.getMinV()); ++ var5.addVertexWithUV((double)par2 + 0.015625D, (double)(par3 + 0), (double)(par4 + 0), (double)var10.getMinU(), (double)var10.getMaxV()); ++ var5.addVertexWithUV((double)par2 + 0.015625D, (double)((float)(par3 + 1) + 0.021875F), (double)(par4 + 0), (double)var10.getMaxU(), (double)var10.getMaxV()); ++ } ++ ++ if (this.blockAccess.isBlockNormalCube(par2 + 1, par3, par4) && this.blockAccess.getBlockId(par2 + 1, par3 + 1, par4) == Block.redstoneWire.blockID) { ++ var5.setColorOpaque_F(var11 * var13, var11 * var14, var11 * var15); ++ var5.addVertexWithUV((double)(par2 + 1) - 0.015625D, (double)(par3 + 0), (double)(par4 + 1), (double)var8.getMinU(), (double)var8.getMaxV()); ++ var5.addVertexWithUV((double)(par2 + 1) - 0.015625D, (double)((float)(par3 + 1) + 0.021875F), (double)(par4 + 1), (double)var8.getMaxU(), (double)var8.getMaxV()); ++ var5.addVertexWithUV((double)(par2 + 1) - 0.015625D, (double)((float)(par3 + 1) + 0.021875F), (double)(par4 + 0), (double)var8.getMaxU(), (double)var8.getMinV()); ++ var5.addVertexWithUV((double)(par2 + 1) - 0.015625D, (double)(par3 + 0), (double)(par4 + 0), (double)var8.getMinU(), (double)var8.getMinV()); ++ var5.setColorOpaque_F(var11, var11, var11); ++ var5.addVertexWithUV((double)(par2 + 1) - 0.015625D, (double)(par3 + 0), (double)(par4 + 1), (double)var10.getMinU(), (double)var10.getMaxV()); ++ var5.addVertexWithUV((double)(par2 + 1) - 0.015625D, (double)((float)(par3 + 1) + 0.021875F), (double)(par4 + 1), (double)var10.getMaxU(), (double)var10.getMaxV()); ++ var5.addVertexWithUV((double)(par2 + 1) - 0.015625D, (double)((float)(par3 + 1) + 0.021875F), (double)(par4 + 0), (double)var10.getMaxU(), (double)var10.getMinV()); ++ var5.addVertexWithUV((double)(par2 + 1) - 0.015625D, (double)(par3 + 0), (double)(par4 + 0), (double)var10.getMinU(), (double)var10.getMinV()); ++ } ++ ++ if (this.blockAccess.isBlockNormalCube(par2, par3, par4 - 1) && this.blockAccess.getBlockId(par2, par3 + 1, par4 - 1) == Block.redstoneWire.blockID) { ++ var5.setColorOpaque_F(var11 * var13, var11 * var14, var11 * var15); ++ var5.addVertexWithUV((double)(par2 + 1), (double)(par3 + 0), (double)par4 + 0.015625D, (double)var8.getMinU(), (double)var8.getMaxV()); ++ var5.addVertexWithUV((double)(par2 + 1), (double)((float)(par3 + 1) + 0.021875F), (double)par4 + 0.015625D, (double)var8.getMaxU(), (double)var8.getMaxV()); ++ var5.addVertexWithUV((double)(par2 + 0), (double)((float)(par3 + 1) + 0.021875F), (double)par4 + 0.015625D, (double)var8.getMaxU(), (double)var8.getMinV()); ++ var5.addVertexWithUV((double)(par2 + 0), (double)(par3 + 0), (double)par4 + 0.015625D, (double)var8.getMinU(), (double)var8.getMinV()); ++ var5.setColorOpaque_F(var11, var11, var11); ++ var5.addVertexWithUV((double)(par2 + 1), (double)(par3 + 0), (double)par4 + 0.015625D, (double)var10.getMinU(), (double)var10.getMaxV()); ++ var5.addVertexWithUV((double)(par2 + 1), (double)((float)(par3 + 1) + 0.021875F), (double)par4 + 0.015625D, (double)var10.getMaxU(), (double)var10.getMaxV()); ++ var5.addVertexWithUV((double)(par2 + 0), (double)((float)(par3 + 1) + 0.021875F), (double)par4 + 0.015625D, (double)var10.getMaxU(), (double)var10.getMinV()); ++ var5.addVertexWithUV((double)(par2 + 0), (double)(par3 + 0), (double)par4 + 0.015625D, (double)var10.getMinU(), (double)var10.getMinV()); ++ } ++ ++ if (this.blockAccess.isBlockNormalCube(par2, par3, par4 + 1) && this.blockAccess.getBlockId(par2, par3 + 1, par4 + 1) == Block.redstoneWire.blockID) { ++ var5.setColorOpaque_F(var11 * var13, var11 * var14, var11 * var15); ++ var5.addVertexWithUV((double)(par2 + 1), (double)((float)(par3 + 1) + 0.021875F), (double)(par4 + 1) - 0.015625D, (double)var8.getMaxU(), (double)var8.getMinV()); ++ var5.addVertexWithUV((double)(par2 + 1), (double)(par3 + 0), (double)(par4 + 1) - 0.015625D, (double)var8.getMinU(), (double)var8.getMinV()); ++ var5.addVertexWithUV((double)(par2 + 0), (double)(par3 + 0), (double)(par4 + 1) - 0.015625D, (double)var8.getMinU(), (double)var8.getMaxV()); ++ var5.addVertexWithUV((double)(par2 + 0), (double)((float)(par3 + 1) + 0.021875F), (double)(par4 + 1) - 0.015625D, (double)var8.getMaxU(), (double)var8.getMaxV()); ++ var5.setColorOpaque_F(var11, var11, var11); ++ var5.addVertexWithUV((double)(par2 + 1), (double)((float)(par3 + 1) + 0.021875F), (double)(par4 + 1) - 0.015625D, (double)var10.getMaxU(), (double)var10.getMinV()); ++ var5.addVertexWithUV((double)(par2 + 1), (double)(par3 + 0), (double)(par4 + 1) - 0.015625D, (double)var10.getMinU(), (double)var10.getMinV()); ++ var5.addVertexWithUV((double)(par2 + 0), (double)(par3 + 0), (double)(par4 + 1) - 0.015625D, (double)var10.getMinU(), (double)var10.getMaxV()); ++ var5.addVertexWithUV((double)(par2 + 0), (double)((float)(par3 + 1) + 0.021875F), (double)(par4 + 1) - 0.015625D, (double)var10.getMaxU(), (double)var10.getMaxV()); + } + } + + return true; + } + +- public boolean renderBlockMinecartTrack(BlockRailBase var1, int var2, int var3, int var4) { ++ /** ++ * Renders a minecart track block at the given coordinates ++ */ ++ public boolean renderBlockMinecartTrack(BlockRailBase par1BlockRailBase, int par2, int par3, int par4) { + Tessellator var5 = Tessellator.instance; +- int var6 = this.blockAccess.getBlockMetadata(var2, var3, var4); +- Icon var7 = this.getBlockIconFromSideAndMetadata(var1, 0, var6); +- if(this.hasOverrideBlockTexture()) { ++ int var6 = this.blockAccess.getBlockMetadata(par2, par3, par4); ++ Icon var7 = this.getBlockIconFromSideAndMetadata(par1BlockRailBase, 0, var6); ++ ++ if (this.hasOverrideBlockTexture()) { + var7 = this.overrideBlockTexture; + } + +- if(var1.isPowered()) { ++ if (par1BlockRailBase.isPowered()) { + var6 &= 7; + } + +- var5.setBrightness(var1.getMixedBrightnessForBlock(this.blockAccess, var2, var3, var4)); ++ var5.setBrightness(par1BlockRailBase.getMixedBrightnessForBlock(this.blockAccess, par2, par3, par4)); + var5.setColorOpaque_F(1.0F, 1.0F, 1.0F); +- double var8 = (double)var7.getMinU(); +- double var10 = (double)var7.getMinV(); +- double var12 = (double)var7.getMaxU(); +- double var14 = (double)var7.getMaxV(); +- double var16 = 1.0D / 16.0D; +- double var18 = (double)(var2 + 1); +- double var20 = (double)(var2 + 1); +- double var22 = (double)(var2 + 0); +- double var24 = (double)(var2 + 0); +- double var26 = (double)(var4 + 0); +- double var28 = (double)(var4 + 1); +- double var30 = (double)(var4 + 1); +- double var32 = (double)(var4 + 0); +- double var34 = (double)var3 + var16; +- double var36 = (double)var3 + var16; +- double var38 = (double)var3 + var16; +- double var40 = (double)var3 + var16; +- if(var6 != 1 && var6 != 2 && var6 != 3 && var6 != 7) { +- if(var6 == 8) { +- var20 = (double)(var2 + 0); +- var18 = var20; +- var24 = (double)(var2 + 1); +- var22 = var24; +- var32 = (double)(var4 + 1); +- var26 = var32; +- var30 = (double)(var4 + 0); +- var28 = var30; +- } else if(var6 == 9) { +- var24 = (double)(var2 + 0); +- var18 = var24; +- var22 = (double)(var2 + 1); +- var20 = var22; +- var28 = (double)(var4 + 0); +- var26 = var28; +- var32 = (double)(var4 + 1); +- var30 = var32; +- } +- } else { +- var24 = (double)(var2 + 1); +- var18 = var24; +- var22 = (double)(var2 + 0); +- var20 = var22; +- var28 = (double)(var4 + 1); +- var26 = var28; +- var32 = (double)(var4 + 0); +- var30 = var32; +- } +- +- if(var6 != 2 && var6 != 4) { +- if(var6 == 3 || var6 == 5) { +- ++var36; +- ++var38; +- } +- } else { +- ++var34; +- ++var40; +- } +- +- var5.addVertexWithUV(var18, var34, var26, var12, var10); +- var5.addVertexWithUV(var20, var36, var28, var12, var14); +- var5.addVertexWithUV(var22, var38, var30, var8, var14); +- var5.addVertexWithUV(var24, var40, var32, var8, var10); +- var5.addVertexWithUV(var24, var40, var32, var8, var10); +- var5.addVertexWithUV(var22, var38, var30, var8, var14); +- var5.addVertexWithUV(var20, var36, var28, var12, var14); +- var5.addVertexWithUV(var18, var34, var26, var12, var10); +- return true; ++ var7 = CTMUtils.getTile(this, par1BlockRailBase, par2, par3, par4, var7, var5); ++ ++ if (var7 == null) { ++ return false; ++ } else { ++ var5 = TessellatorUtils.getTessellator(var5, var7); ++ double var8 = (double)var7.getMinU(); ++ double var10 = (double)var7.getMinV(); ++ double var12 = (double)var7.getMaxU(); ++ double var14 = (double)var7.getMaxV(); ++ double var16 = 0.0625D; ++ double var18 = (double)(par2 + 1); ++ double var20 = (double)(par2 + 1); ++ double var22 = (double)(par2 + 0); ++ double var24 = (double)(par2 + 0); ++ double var26 = (double)(par4 + 0); ++ double var28 = (double)(par4 + 1); ++ double var30 = (double)(par4 + 1); ++ double var32 = (double)(par4 + 0); ++ double var34 = (double)par3 + var16; ++ double var36 = (double)par3 + var16; ++ double var38 = (double)par3 + var16; ++ double var40 = (double)par3 + var16; ++ ++ if (var6 != 1 && var6 != 2 && var6 != 3 && var6 != 7) { ++ if (var6 == 8) { ++ var18 = var20 = (double)(par2 + 0); ++ var22 = var24 = (double)(par2 + 1); ++ var26 = var32 = (double)(par4 + 1); ++ var28 = var30 = (double)(par4 + 0); ++ } else if (var6 == 9) { ++ var18 = var24 = (double)(par2 + 0); ++ var20 = var22 = (double)(par2 + 1); ++ var26 = var28 = (double)(par4 + 0); ++ var30 = var32 = (double)(par4 + 1); ++ } ++ } else { ++ var18 = var24 = (double)(par2 + 1); ++ var20 = var22 = (double)(par2 + 0); ++ var26 = var28 = (double)(par4 + 1); ++ var30 = var32 = (double)(par4 + 0); ++ } ++ ++ if (var6 != 2 && var6 != 4) { ++ if (var6 == 3 || var6 == 5) { ++ ++var36; ++ ++var38; ++ } ++ } else { ++ ++var34; ++ ++var40; ++ } ++ ++ var5.addVertexWithUV(var18, var34, var26, var12, var10); ++ var5.addVertexWithUV(var20, var36, var28, var12, var14); ++ var5.addVertexWithUV(var22, var38, var30, var8, var14); ++ var5.addVertexWithUV(var24, var40, var32, var8, var10); ++ var5.addVertexWithUV(var24, var40, var32, var8, var10); ++ var5.addVertexWithUV(var22, var38, var30, var8, var14); ++ var5.addVertexWithUV(var20, var36, var28, var12, var14); ++ var5.addVertexWithUV(var18, var34, var26, var12, var10); ++ return true; ++ } + } + +- public boolean renderBlockLadder(Block var1, int var2, int var3, int var4) { ++ /** ++ * Renders a ladder block at the given coordinates ++ */ ++ public boolean renderBlockLadder(Block par1Block, int par2, int par3, int par4) { + Tessellator var5 = Tessellator.instance; +- Icon var6 = this.getBlockIconFromSide(var1, 0); +- if(this.hasOverrideBlockTexture()) { ++ Icon var6 = this.getBlockIconFromSide(par1Block, 0); ++ ++ if (this.hasOverrideBlockTexture()) { + var6 = this.overrideBlockTexture; + } + +- var5.setBrightness(var1.getMixedBrightnessForBlock(this.blockAccess, var2, var3, var4)); ++ var5.setBrightness(par1Block.getMixedBrightnessForBlock(this.blockAccess, par2, par3, par4)); + float var7 = 1.0F; + var5.setColorOpaque_F(var7, var7, var7); +- double var20 = (double)var6.getMinU(); +- double var9 = (double)var6.getMinV(); +- double var11 = (double)var6.getMaxU(); +- double var13 = (double)var6.getMaxV(); +- int var15 = this.blockAccess.getBlockMetadata(var2, var3, var4); +- double var16 = 0.0D; +- double var18 = (double)0.05F; +- if(var15 == 5) { +- var5.addVertexWithUV((double)var2 + var18, (double)(var3 + 1) + var16, (double)(var4 + 1) + var16, var20, var9); +- var5.addVertexWithUV((double)var2 + var18, (double)(var3 + 0) - var16, (double)(var4 + 1) + var16, var20, var13); +- var5.addVertexWithUV((double)var2 + var18, (double)(var3 + 0) - var16, (double)(var4 + 0) - var16, var11, var13); +- var5.addVertexWithUV((double)var2 + var18, (double)(var3 + 1) + var16, (double)(var4 + 0) - var16, var11, var9); +- } +- +- if(var15 == 4) { +- var5.addVertexWithUV((double)(var2 + 1) - var18, (double)(var3 + 0) - var16, (double)(var4 + 1) + var16, var11, var13); +- var5.addVertexWithUV((double)(var2 + 1) - var18, (double)(var3 + 1) + var16, (double)(var4 + 1) + var16, var11, var9); +- var5.addVertexWithUV((double)(var2 + 1) - var18, (double)(var3 + 1) + var16, (double)(var4 + 0) - var16, var20, var9); +- var5.addVertexWithUV((double)(var2 + 1) - var18, (double)(var3 + 0) - var16, (double)(var4 + 0) - var16, var20, var13); +- } +- +- if(var15 == 3) { +- var5.addVertexWithUV((double)(var2 + 1) + var16, (double)(var3 + 0) - var16, (double)var4 + var18, var11, var13); +- var5.addVertexWithUV((double)(var2 + 1) + var16, (double)(var3 + 1) + var16, (double)var4 + var18, var11, var9); +- var5.addVertexWithUV((double)(var2 + 0) - var16, (double)(var3 + 1) + var16, (double)var4 + var18, var20, var9); +- var5.addVertexWithUV((double)(var2 + 0) - var16, (double)(var3 + 0) - var16, (double)var4 + var18, var20, var13); +- } +- +- if(var15 == 2) { +- var5.addVertexWithUV((double)(var2 + 1) + var16, (double)(var3 + 1) + var16, (double)(var4 + 1) - var18, var20, var9); +- var5.addVertexWithUV((double)(var2 + 1) + var16, (double)(var3 + 0) - var16, (double)(var4 + 1) - var18, var20, var13); +- var5.addVertexWithUV((double)(var2 + 0) - var16, (double)(var3 + 0) - var16, (double)(var4 + 1) - var18, var11, var13); +- var5.addVertexWithUV((double)(var2 + 0) - var16, (double)(var3 + 1) + var16, (double)(var4 + 1) - var18, var11, var9); +- } +- +- return true; ++ var6 = CTMUtils.getTile(this, par1Block, par2, par3, par4, var6, var5); ++ ++ if (var6 == null) { ++ return false; ++ } else { ++ var5 = TessellatorUtils.getTessellator(var5, var6); ++ double var20 = (double)var6.getMinU(); ++ double var9 = (double)var6.getMinV(); ++ double var11 = (double)var6.getMaxU(); ++ double var13 = (double)var6.getMaxV(); ++ int var15 = this.blockAccess.getBlockMetadata(par2, par3, par4); ++ double var16 = 0.0D; ++ double var18 = 0.05000000074505806D; ++ ++ if (var15 == 5) { ++ var5.addVertexWithUV((double)par2 + var18, (double)(par3 + 1) + var16, (double)(par4 + 1) + var16, var20, var9); ++ var5.addVertexWithUV((double)par2 + var18, (double)(par3 + 0) - var16, (double)(par4 + 1) + var16, var20, var13); ++ var5.addVertexWithUV((double)par2 + var18, (double)(par3 + 0) - var16, (double)(par4 + 0) - var16, var11, var13); ++ var5.addVertexWithUV((double)par2 + var18, (double)(par3 + 1) + var16, (double)(par4 + 0) - var16, var11, var9); ++ } ++ ++ if (var15 == 4) { ++ var5.addVertexWithUV((double)(par2 + 1) - var18, (double)(par3 + 0) - var16, (double)(par4 + 1) + var16, var11, var13); ++ var5.addVertexWithUV((double)(par2 + 1) - var18, (double)(par3 + 1) + var16, (double)(par4 + 1) + var16, var11, var9); ++ var5.addVertexWithUV((double)(par2 + 1) - var18, (double)(par3 + 1) + var16, (double)(par4 + 0) - var16, var20, var9); ++ var5.addVertexWithUV((double)(par2 + 1) - var18, (double)(par3 + 0) - var16, (double)(par4 + 0) - var16, var20, var13); ++ } ++ ++ if (var15 == 3) { ++ var5.addVertexWithUV((double)(par2 + 1) + var16, (double)(par3 + 0) - var16, (double)par4 + var18, var11, var13); ++ var5.addVertexWithUV((double)(par2 + 1) + var16, (double)(par3 + 1) + var16, (double)par4 + var18, var11, var9); ++ var5.addVertexWithUV((double)(par2 + 0) - var16, (double)(par3 + 1) + var16, (double)par4 + var18, var20, var9); ++ var5.addVertexWithUV((double)(par2 + 0) - var16, (double)(par3 + 0) - var16, (double)par4 + var18, var20, var13); ++ } ++ ++ if (var15 == 2) { ++ var5.addVertexWithUV((double)(par2 + 1) + var16, (double)(par3 + 1) + var16, (double)(par4 + 1) - var18, var20, var9); ++ var5.addVertexWithUV((double)(par2 + 1) + var16, (double)(par3 + 0) - var16, (double)(par4 + 1) - var18, var20, var13); ++ var5.addVertexWithUV((double)(par2 + 0) - var16, (double)(par3 + 0) - var16, (double)(par4 + 1) - var18, var11, var13); ++ var5.addVertexWithUV((double)(par2 + 0) - var16, (double)(par3 + 1) + var16, (double)(par4 + 1) - var18, var11, var9); ++ } ++ ++ return true; ++ } + } + +- public boolean renderBlockVine(Block var1, int var2, int var3, int var4) { ++ /** ++ * Render block vine ++ */ ++ public boolean renderBlockVine(Block par1Block, int par2, int par3, int par4) { + Tessellator var5 = Tessellator.instance; +- Icon var6 = this.getBlockIconFromSide(var1, 0); +- if(this.hasOverrideBlockTexture()) { ++ Icon var6 = this.getBlockIconFromSide(par1Block, 0); ++ ++ if (this.hasOverrideBlockTexture()) { + var6 = this.overrideBlockTexture; + } + + float var7 = 1.0F; +- var5.setBrightness(var1.getMixedBrightnessForBlock(this.blockAccess, var2, var3, var4)); +- int var8 = var1.colorMultiplier(this.blockAccess, var2, var3, var4); ++ var5.setBrightness(par1Block.getMixedBrightnessForBlock(this.blockAccess, par2, par3, par4)); ++ int var8 = par1Block.colorMultiplier(this.blockAccess, par2, par3, par4); + float var9 = (float)(var8 >> 16 & 255) / 255.0F; + float var10 = (float)(var8 >> 8 & 255) / 255.0F; + float var11 = (float)(var8 & 255) / 255.0F; + var5.setColorOpaque_F(var7 * var9, var7 * var10, var7 * var11); +- double var19 = (double)var6.getMinU(); +- double var20 = (double)var6.getMinV(); +- double var12 = (double)var6.getMaxU(); +- double var14 = (double)var6.getMaxV(); +- double var16 = (double)0.05F; +- int var18 = this.blockAccess.getBlockMetadata(var2, var3, var4); +- if((var18 & 2) != 0) { +- var5.addVertexWithUV((double)var2 + var16, (double)(var3 + 1), (double)(var4 + 1), var19, var20); +- var5.addVertexWithUV((double)var2 + var16, (double)(var3 + 0), (double)(var4 + 1), var19, var14); +- var5.addVertexWithUV((double)var2 + var16, (double)(var3 + 0), (double)(var4 + 0), var12, var14); +- var5.addVertexWithUV((double)var2 + var16, (double)(var3 + 1), (double)(var4 + 0), var12, var20); +- var5.addVertexWithUV((double)var2 + var16, (double)(var3 + 1), (double)(var4 + 0), var12, var20); +- var5.addVertexWithUV((double)var2 + var16, (double)(var3 + 0), (double)(var4 + 0), var12, var14); +- var5.addVertexWithUV((double)var2 + var16, (double)(var3 + 0), (double)(var4 + 1), var19, var14); +- var5.addVertexWithUV((double)var2 + var16, (double)(var3 + 1), (double)(var4 + 1), var19, var20); +- } +- +- if((var18 & 8) != 0) { +- var5.addVertexWithUV((double)(var2 + 1) - var16, (double)(var3 + 0), (double)(var4 + 1), var12, var14); +- var5.addVertexWithUV((double)(var2 + 1) - var16, (double)(var3 + 1), (double)(var4 + 1), var12, var20); +- var5.addVertexWithUV((double)(var2 + 1) - var16, (double)(var3 + 1), (double)(var4 + 0), var19, var20); +- var5.addVertexWithUV((double)(var2 + 1) - var16, (double)(var3 + 0), (double)(var4 + 0), var19, var14); +- var5.addVertexWithUV((double)(var2 + 1) - var16, (double)(var3 + 0), (double)(var4 + 0), var19, var14); +- var5.addVertexWithUV((double)(var2 + 1) - var16, (double)(var3 + 1), (double)(var4 + 0), var19, var20); +- var5.addVertexWithUV((double)(var2 + 1) - var16, (double)(var3 + 1), (double)(var4 + 1), var12, var20); +- var5.addVertexWithUV((double)(var2 + 1) - var16, (double)(var3 + 0), (double)(var4 + 1), var12, var14); +- } +- +- if((var18 & 4) != 0) { +- var5.addVertexWithUV((double)(var2 + 1), (double)(var3 + 0), (double)var4 + var16, var12, var14); +- var5.addVertexWithUV((double)(var2 + 1), (double)(var3 + 1), (double)var4 + var16, var12, var20); +- var5.addVertexWithUV((double)(var2 + 0), (double)(var3 + 1), (double)var4 + var16, var19, var20); +- var5.addVertexWithUV((double)(var2 + 0), (double)(var3 + 0), (double)var4 + var16, var19, var14); +- var5.addVertexWithUV((double)(var2 + 0), (double)(var3 + 0), (double)var4 + var16, var19, var14); +- var5.addVertexWithUV((double)(var2 + 0), (double)(var3 + 1), (double)var4 + var16, var19, var20); +- var5.addVertexWithUV((double)(var2 + 1), (double)(var3 + 1), (double)var4 + var16, var12, var20); +- var5.addVertexWithUV((double)(var2 + 1), (double)(var3 + 0), (double)var4 + var16, var12, var14); +- } +- +- if((var18 & 1) != 0) { +- var5.addVertexWithUV((double)(var2 + 1), (double)(var3 + 1), (double)(var4 + 1) - var16, var19, var20); +- var5.addVertexWithUV((double)(var2 + 1), (double)(var3 + 0), (double)(var4 + 1) - var16, var19, var14); +- var5.addVertexWithUV((double)(var2 + 0), (double)(var3 + 0), (double)(var4 + 1) - var16, var12, var14); +- var5.addVertexWithUV((double)(var2 + 0), (double)(var3 + 1), (double)(var4 + 1) - var16, var12, var20); +- var5.addVertexWithUV((double)(var2 + 0), (double)(var3 + 1), (double)(var4 + 1) - var16, var12, var20); +- var5.addVertexWithUV((double)(var2 + 0), (double)(var3 + 0), (double)(var4 + 1) - var16, var12, var14); +- var5.addVertexWithUV((double)(var2 + 1), (double)(var3 + 0), (double)(var4 + 1) - var16, var19, var14); +- var5.addVertexWithUV((double)(var2 + 1), (double)(var3 + 1), (double)(var4 + 1) - var16, var19, var20); +- } +- +- if(this.blockAccess.isBlockNormalCube(var2, var3 + 1, var4)) { +- var5.addVertexWithUV((double)(var2 + 1), (double)(var3 + 1) - var16, (double)(var4 + 0), var19, var20); +- var5.addVertexWithUV((double)(var2 + 1), (double)(var3 + 1) - var16, (double)(var4 + 1), var19, var14); +- var5.addVertexWithUV((double)(var2 + 0), (double)(var3 + 1) - var16, (double)(var4 + 1), var12, var14); +- var5.addVertexWithUV((double)(var2 + 0), (double)(var3 + 1) - var16, (double)(var4 + 0), var12, var20); +- } +- +- return true; ++ var6 = CTMUtils.getTile(this, par1Block, par2, par3, par4, var6, var5); ++ ++ if (var6 == null) { ++ return false; ++ } else { ++ var5 = TessellatorUtils.getTessellator(var5, var6); ++ double var19 = (double)var6.getMinU(); ++ double var20 = (double)var6.getMinV(); ++ double var12 = (double)var6.getMaxU(); ++ double var14 = (double)var6.getMaxV(); ++ double var16 = 0.05000000074505806D; ++ int var18 = this.blockAccess.getBlockMetadata(par2, par3, par4); ++ ++ if ((var18 & 2) != 0) { ++ var5.addVertexWithUV((double)par2 + var16, (double)(par3 + 1), (double)(par4 + 1), var19, var20); ++ var5.addVertexWithUV((double)par2 + var16, (double)(par3 + 0), (double)(par4 + 1), var19, var14); ++ var5.addVertexWithUV((double)par2 + var16, (double)(par3 + 0), (double)(par4 + 0), var12, var14); ++ var5.addVertexWithUV((double)par2 + var16, (double)(par3 + 1), (double)(par4 + 0), var12, var20); ++ var5.addVertexWithUV((double)par2 + var16, (double)(par3 + 1), (double)(par4 + 0), var12, var20); ++ var5.addVertexWithUV((double)par2 + var16, (double)(par3 + 0), (double)(par4 + 0), var12, var14); ++ var5.addVertexWithUV((double)par2 + var16, (double)(par3 + 0), (double)(par4 + 1), var19, var14); ++ var5.addVertexWithUV((double)par2 + var16, (double)(par3 + 1), (double)(par4 + 1), var19, var20); ++ } ++ ++ if ((var18 & 8) != 0) { ++ var5.addVertexWithUV((double)(par2 + 1) - var16, (double)(par3 + 0), (double)(par4 + 1), var12, var14); ++ var5.addVertexWithUV((double)(par2 + 1) - var16, (double)(par3 + 1), (double)(par4 + 1), var12, var20); ++ var5.addVertexWithUV((double)(par2 + 1) - var16, (double)(par3 + 1), (double)(par4 + 0), var19, var20); ++ var5.addVertexWithUV((double)(par2 + 1) - var16, (double)(par3 + 0), (double)(par4 + 0), var19, var14); ++ var5.addVertexWithUV((double)(par2 + 1) - var16, (double)(par3 + 0), (double)(par4 + 0), var19, var14); ++ var5.addVertexWithUV((double)(par2 + 1) - var16, (double)(par3 + 1), (double)(par4 + 0), var19, var20); ++ var5.addVertexWithUV((double)(par2 + 1) - var16, (double)(par3 + 1), (double)(par4 + 1), var12, var20); ++ var5.addVertexWithUV((double)(par2 + 1) - var16, (double)(par3 + 0), (double)(par4 + 1), var12, var14); ++ } ++ ++ if ((var18 & 4) != 0) { ++ var5.addVertexWithUV((double)(par2 + 1), (double)(par3 + 0), (double)par4 + var16, var12, var14); ++ var5.addVertexWithUV((double)(par2 + 1), (double)(par3 + 1), (double)par4 + var16, var12, var20); ++ var5.addVertexWithUV((double)(par2 + 0), (double)(par3 + 1), (double)par4 + var16, var19, var20); ++ var5.addVertexWithUV((double)(par2 + 0), (double)(par3 + 0), (double)par4 + var16, var19, var14); ++ var5.addVertexWithUV((double)(par2 + 0), (double)(par3 + 0), (double)par4 + var16, var19, var14); ++ var5.addVertexWithUV((double)(par2 + 0), (double)(par3 + 1), (double)par4 + var16, var19, var20); ++ var5.addVertexWithUV((double)(par2 + 1), (double)(par3 + 1), (double)par4 + var16, var12, var20); ++ var5.addVertexWithUV((double)(par2 + 1), (double)(par3 + 0), (double)par4 + var16, var12, var14); ++ } ++ ++ if ((var18 & 1) != 0) { ++ var5.addVertexWithUV((double)(par2 + 1), (double)(par3 + 1), (double)(par4 + 1) - var16, var19, var20); ++ var5.addVertexWithUV((double)(par2 + 1), (double)(par3 + 0), (double)(par4 + 1) - var16, var19, var14); ++ var5.addVertexWithUV((double)(par2 + 0), (double)(par3 + 0), (double)(par4 + 1) - var16, var12, var14); ++ var5.addVertexWithUV((double)(par2 + 0), (double)(par3 + 1), (double)(par4 + 1) - var16, var12, var20); ++ var5.addVertexWithUV((double)(par2 + 0), (double)(par3 + 1), (double)(par4 + 1) - var16, var12, var20); ++ var5.addVertexWithUV((double)(par2 + 0), (double)(par3 + 0), (double)(par4 + 1) - var16, var12, var14); ++ var5.addVertexWithUV((double)(par2 + 1), (double)(par3 + 0), (double)(par4 + 1) - var16, var19, var14); ++ var5.addVertexWithUV((double)(par2 + 1), (double)(par3 + 1), (double)(par4 + 1) - var16, var19, var20); ++ } ++ ++ if (this.blockAccess.isBlockNormalCube(par2, par3 + 1, par4)) { ++ var5.addVertexWithUV((double)(par2 + 1), (double)(par3 + 1) - var16, (double)(par4 + 0), var19, var20); ++ var5.addVertexWithUV((double)(par2 + 1), (double)(par3 + 1) - var16, (double)(par4 + 1), var19, var14); ++ var5.addVertexWithUV((double)(par2 + 0), (double)(par3 + 1) - var16, (double)(par4 + 1), var12, var14); ++ var5.addVertexWithUV((double)(par2 + 0), (double)(par3 + 1) - var16, (double)(par4 + 0), var12, var20); ++ } ++ ++ return true; ++ } + } + +- public boolean renderBlockPane(BlockPane var1, int var2, int var3, int var4) { ++ public boolean renderBlockPane(BlockPane par1BlockPane, int par2, int par3, int par4) { + int var5 = this.blockAccess.getHeight(); + Tessellator var6 = Tessellator.instance; +- var6.setBrightness(var1.getMixedBrightnessForBlock(this.blockAccess, var2, var3, var4)); ++ var6.setBrightness(par1BlockPane.getMixedBrightnessForBlock(this.blockAccess, par2, par3, par4)); + float var7 = 1.0F; +- int var8 = var1.colorMultiplier(this.blockAccess, var2, var3, var4); ++ int var8 = par1BlockPane.colorMultiplier(this.blockAccess, par2, par3, par4); + float var9 = (float)(var8 >> 16 & 255) / 255.0F; + float var10 = (float)(var8 >> 8 & 255) / 255.0F; + float var11 = (float)(var8 & 255) / 255.0F; +- if(EntityRenderer.anaglyphEnable) { ++ ++ if (EntityRenderer.anaglyphEnable) { + float var12 = (var9 * 30.0F + var10 * 59.0F + var11 * 11.0F) / 100.0F; + float var13 = (var9 * 30.0F + var10 * 70.0F) / 100.0F; + float var14 = (var9 * 30.0F + var11 * 70.0F) / 100.0F; +@@ -2292,13 +2804,14 @@ + var6.setColorOpaque_F(var7 * var9, var7 * var10, var7 * var11); + Icon var64; + Icon var65; +- if(this.hasOverrideBlockTexture()) { ++ ++ if (this.hasOverrideBlockTexture()) { + var64 = this.overrideBlockTexture; + var65 = this.overrideBlockTexture; + } else { +- int var66 = this.blockAccess.getBlockMetadata(var2, var3, var4); +- var64 = this.getBlockIconFromSideAndMetadata(var1, 0, var66); +- var65 = var1.getSideTextureIndex(); ++ int var66 = this.blockAccess.getBlockMetadata(par2, par3, par4); ++ var64 = this.getBlockIconFromSideAndMetadata(par1BlockPane, 0, var66); ++ var65 = par1BlockPane.getSideTextureIndex(); + } + + double var67 = (double)var64.getMinU(); +@@ -2311,356 +2824,379 @@ + double var28 = (double)var65.getMinV(); + double var30 = (double)var65.getInterpolatedV(8.0D); + double var32 = (double)var65.getMaxV(); +- double var34 = (double)var2; +- double var36 = (double)var2 + 0.5D; +- double var38 = (double)(var2 + 1); +- double var40 = (double)var4; +- double var42 = (double)var4 + 0.5D; +- double var44 = (double)(var4 + 1); +- double var46 = (double)var2 + 0.5D - 1.0D / 16.0D; +- double var48 = (double)var2 + 0.5D + 1.0D / 16.0D; +- double var50 = (double)var4 + 0.5D - 1.0D / 16.0D; +- double var52 = (double)var4 + 0.5D + 1.0D / 16.0D; +- boolean var54 = var1.canThisPaneConnectToThisBlockID(this.blockAccess.getBlockId(var2, var3, var4 - 1)); +- boolean var55 = var1.canThisPaneConnectToThisBlockID(this.blockAccess.getBlockId(var2, var3, var4 + 1)); +- boolean var56 = var1.canThisPaneConnectToThisBlockID(this.blockAccess.getBlockId(var2 - 1, var3, var4)); +- boolean var57 = var1.canThisPaneConnectToThisBlockID(this.blockAccess.getBlockId(var2 + 1, var3, var4)); +- boolean var58 = var1.shouldSideBeRendered(this.blockAccess, var2, var3 + 1, var4, 1); +- boolean var59 = var1.shouldSideBeRendered(this.blockAccess, var2, var3 - 1, var4, 0); ++ double var34 = (double)par2; ++ double var36 = (double)par2 + 0.5D; ++ double var38 = (double)(par2 + 1); ++ double var40 = (double)par4; ++ double var42 = (double)par4 + 0.5D; ++ double var44 = (double)(par4 + 1); ++ double var46 = (double)par2 + 0.5D - 0.0625D; ++ double var48 = (double)par2 + 0.5D + 0.0625D; ++ double var50 = (double)par4 + 0.5D - 0.0625D; ++ double var52 = (double)par4 + 0.5D + 0.0625D; ++ boolean var54 = par1BlockPane.canThisPaneConnectToThisBlockID(this.blockAccess.getBlockId(par2, par3, par4 - 1)); ++ boolean var55 = par1BlockPane.canThisPaneConnectToThisBlockID(this.blockAccess.getBlockId(par2, par3, par4 + 1)); ++ boolean var56 = par1BlockPane.canThisPaneConnectToThisBlockID(this.blockAccess.getBlockId(par2 - 1, par3, par4)); ++ boolean var57 = par1BlockPane.canThisPaneConnectToThisBlockID(this.blockAccess.getBlockId(par2 + 1, par3, par4)); ++ GlassPaneRenderer.render(this, par1BlockPane, var64, par2, par3, par4, var54, var55, var56, var57); ++ boolean var58 = par1BlockPane.shouldSideBeRendered(this.blockAccess, par2, par3 + 1, par4, 1); ++ boolean var59 = par1BlockPane.shouldSideBeRendered(this.blockAccess, par2, par3 - 1, par4, 0); + double var60 = 0.01D; + double var62 = 0.005D; +- if((!var56 || !var57) && (var56 || var57 || var54 || var55)) { +- if(var56 && !var57) { +- var6.addVertexWithUV(var34, (double)(var3 + 1), var42, var67, var20); +- var6.addVertexWithUV(var34, (double)(var3 + 0), var42, var67, var22); +- var6.addVertexWithUV(var36, (double)(var3 + 0), var42, var16, var22); +- var6.addVertexWithUV(var36, (double)(var3 + 1), var42, var16, var20); +- var6.addVertexWithUV(var36, (double)(var3 + 1), var42, var67, var20); +- var6.addVertexWithUV(var36, (double)(var3 + 0), var42, var67, var22); +- var6.addVertexWithUV(var34, (double)(var3 + 0), var42, var16, var22); +- var6.addVertexWithUV(var34, (double)(var3 + 1), var42, var16, var20); +- if(!var55 && !var54) { +- var6.addVertexWithUV(var36, (double)(var3 + 1), var52, var24, var28); +- var6.addVertexWithUV(var36, (double)(var3 + 0), var52, var24, var32); +- var6.addVertexWithUV(var36, (double)(var3 + 0), var50, var26, var32); +- var6.addVertexWithUV(var36, (double)(var3 + 1), var50, var26, var28); +- var6.addVertexWithUV(var36, (double)(var3 + 1), var50, var24, var28); +- var6.addVertexWithUV(var36, (double)(var3 + 0), var50, var24, var32); +- var6.addVertexWithUV(var36, (double)(var3 + 0), var52, var26, var32); +- var6.addVertexWithUV(var36, (double)(var3 + 1), var52, var26, var28); +- } +- +- if(var58 || var3 < var5 - 1 && this.blockAccess.isAirBlock(var2 - 1, var3 + 1, var4)) { +- var6.addVertexWithUV(var34, (double)(var3 + 1) + 0.01D, var52, var26, var30); +- var6.addVertexWithUV(var36, (double)(var3 + 1) + 0.01D, var52, var26, var32); +- var6.addVertexWithUV(var36, (double)(var3 + 1) + 0.01D, var50, var24, var32); +- var6.addVertexWithUV(var34, (double)(var3 + 1) + 0.01D, var50, var24, var30); +- var6.addVertexWithUV(var36, (double)(var3 + 1) + 0.01D, var52, var26, var30); +- var6.addVertexWithUV(var34, (double)(var3 + 1) + 0.01D, var52, var26, var32); +- var6.addVertexWithUV(var34, (double)(var3 + 1) + 0.01D, var50, var24, var32); +- var6.addVertexWithUV(var36, (double)(var3 + 1) + 0.01D, var50, var24, var30); +- } +- +- if(var59 || var3 > 1 && this.blockAccess.isAirBlock(var2 - 1, var3 - 1, var4)) { +- var6.addVertexWithUV(var34, (double)var3 - 0.01D, var52, var26, var30); +- var6.addVertexWithUV(var36, (double)var3 - 0.01D, var52, var26, var32); +- var6.addVertexWithUV(var36, (double)var3 - 0.01D, var50, var24, var32); +- var6.addVertexWithUV(var34, (double)var3 - 0.01D, var50, var24, var30); +- var6.addVertexWithUV(var36, (double)var3 - 0.01D, var52, var26, var30); +- var6.addVertexWithUV(var34, (double)var3 - 0.01D, var52, var26, var32); +- var6.addVertexWithUV(var34, (double)var3 - 0.01D, var50, var24, var32); +- var6.addVertexWithUV(var36, (double)var3 - 0.01D, var50, var24, var30); +- } +- } else if(!var56 && var57) { +- var6.addVertexWithUV(var36, (double)(var3 + 1), var42, var16, var20); +- var6.addVertexWithUV(var36, (double)(var3 + 0), var42, var16, var22); +- var6.addVertexWithUV(var38, (double)(var3 + 0), var42, var18, var22); +- var6.addVertexWithUV(var38, (double)(var3 + 1), var42, var18, var20); +- var6.addVertexWithUV(var38, (double)(var3 + 1), var42, var16, var20); +- var6.addVertexWithUV(var38, (double)(var3 + 0), var42, var16, var22); +- var6.addVertexWithUV(var36, (double)(var3 + 0), var42, var18, var22); +- var6.addVertexWithUV(var36, (double)(var3 + 1), var42, var18, var20); +- if(!var55 && !var54) { +- var6.addVertexWithUV(var36, (double)(var3 + 1), var50, var24, var28); +- var6.addVertexWithUV(var36, (double)(var3 + 0), var50, var24, var32); +- var6.addVertexWithUV(var36, (double)(var3 + 0), var52, var26, var32); +- var6.addVertexWithUV(var36, (double)(var3 + 1), var52, var26, var28); +- var6.addVertexWithUV(var36, (double)(var3 + 1), var52, var24, var28); +- var6.addVertexWithUV(var36, (double)(var3 + 0), var52, var24, var32); +- var6.addVertexWithUV(var36, (double)(var3 + 0), var50, var26, var32); +- var6.addVertexWithUV(var36, (double)(var3 + 1), var50, var26, var28); +- } +- +- if(var58 || var3 < var5 - 1 && this.blockAccess.isAirBlock(var2 + 1, var3 + 1, var4)) { +- var6.addVertexWithUV(var36, (double)(var3 + 1) + 0.01D, var52, var26, var28); +- var6.addVertexWithUV(var38, (double)(var3 + 1) + 0.01D, var52, var26, var30); +- var6.addVertexWithUV(var38, (double)(var3 + 1) + 0.01D, var50, var24, var30); +- var6.addVertexWithUV(var36, (double)(var3 + 1) + 0.01D, var50, var24, var28); +- var6.addVertexWithUV(var38, (double)(var3 + 1) + 0.01D, var52, var26, var28); +- var6.addVertexWithUV(var36, (double)(var3 + 1) + 0.01D, var52, var26, var30); +- var6.addVertexWithUV(var36, (double)(var3 + 1) + 0.01D, var50, var24, var30); +- var6.addVertexWithUV(var38, (double)(var3 + 1) + 0.01D, var50, var24, var28); +- } +- +- if(var59 || var3 > 1 && this.blockAccess.isAirBlock(var2 + 1, var3 - 1, var4)) { +- var6.addVertexWithUV(var36, (double)var3 - 0.01D, var52, var26, var28); +- var6.addVertexWithUV(var38, (double)var3 - 0.01D, var52, var26, var30); +- var6.addVertexWithUV(var38, (double)var3 - 0.01D, var50, var24, var30); +- var6.addVertexWithUV(var36, (double)var3 - 0.01D, var50, var24, var28); +- var6.addVertexWithUV(var38, (double)var3 - 0.01D, var52, var26, var28); +- var6.addVertexWithUV(var36, (double)var3 - 0.01D, var52, var26, var30); +- var6.addVertexWithUV(var36, (double)var3 - 0.01D, var50, var24, var30); +- var6.addVertexWithUV(var38, (double)var3 - 0.01D, var50, var24, var28); ++ ++ if ((!var56 || !var57) && (var56 || var57 || var54 || var55)) { ++ if (var56 && !var57) { ++ if (!GlassPaneRenderer.active) { ++ var6.addVertexWithUV(var34, (double)(par3 + 1), var42, var67, var20); ++ var6.addVertexWithUV(var34, (double)(par3 + 0), var42, var67, var22); ++ var6.addVertexWithUV(var36, (double)(par3 + 0), var42, var16, var22); ++ var6.addVertexWithUV(var36, (double)(par3 + 1), var42, var16, var20); ++ var6.addVertexWithUV(var36, (double)(par3 + 1), var42, var67, var20); ++ var6.addVertexWithUV(var36, (double)(par3 + 0), var42, var67, var22); ++ var6.addVertexWithUV(var34, (double)(par3 + 0), var42, var16, var22); ++ var6.addVertexWithUV(var34, (double)(par3 + 1), var42, var16, var20); ++ } ++ ++ if (!var55 && !var54) { ++ var6.addVertexWithUV(var36, (double)(par3 + 1), var52, var24, var28); ++ var6.addVertexWithUV(var36, (double)(par3 + 0), var52, var24, var32); ++ var6.addVertexWithUV(var36, (double)(par3 + 0), var50, var26, var32); ++ var6.addVertexWithUV(var36, (double)(par3 + 1), var50, var26, var28); ++ var6.addVertexWithUV(var36, (double)(par3 + 1), var50, var24, var28); ++ var6.addVertexWithUV(var36, (double)(par3 + 0), var50, var24, var32); ++ var6.addVertexWithUV(var36, (double)(par3 + 0), var52, var26, var32); ++ var6.addVertexWithUV(var36, (double)(par3 + 1), var52, var26, var28); ++ } ++ ++ if (var58 || par3 < var5 - 1 && this.blockAccess.isAirBlock(par2 - 1, par3 + 1, par4)) { ++ var6.addVertexWithUV(var34, (double)(par3 + 1) + 0.01D, var52, var26, var30); ++ var6.addVertexWithUV(var36, (double)(par3 + 1) + 0.01D, var52, var26, var32); ++ var6.addVertexWithUV(var36, (double)(par3 + 1) + 0.01D, var50, var24, var32); ++ var6.addVertexWithUV(var34, (double)(par3 + 1) + 0.01D, var50, var24, var30); ++ var6.addVertexWithUV(var36, (double)(par3 + 1) + 0.01D, var52, var26, var30); ++ var6.addVertexWithUV(var34, (double)(par3 + 1) + 0.01D, var52, var26, var32); ++ var6.addVertexWithUV(var34, (double)(par3 + 1) + 0.01D, var50, var24, var32); ++ var6.addVertexWithUV(var36, (double)(par3 + 1) + 0.01D, var50, var24, var30); ++ } ++ ++ if (var59 || par3 > 1 && this.blockAccess.isAirBlock(par2 - 1, par3 - 1, par4)) { ++ var6.addVertexWithUV(var34, (double)par3 - 0.01D, var52, var26, var30); ++ var6.addVertexWithUV(var36, (double)par3 - 0.01D, var52, var26, var32); ++ var6.addVertexWithUV(var36, (double)par3 - 0.01D, var50, var24, var32); ++ var6.addVertexWithUV(var34, (double)par3 - 0.01D, var50, var24, var30); ++ var6.addVertexWithUV(var36, (double)par3 - 0.01D, var52, var26, var30); ++ var6.addVertexWithUV(var34, (double)par3 - 0.01D, var52, var26, var32); ++ var6.addVertexWithUV(var34, (double)par3 - 0.01D, var50, var24, var32); ++ var6.addVertexWithUV(var36, (double)par3 - 0.01D, var50, var24, var30); ++ } ++ } else if (!var56 && var57) { ++ if (!GlassPaneRenderer.active) { ++ var6.addVertexWithUV(var36, (double)(par3 + 1), var42, var16, var20); ++ var6.addVertexWithUV(var36, (double)(par3 + 0), var42, var16, var22); ++ var6.addVertexWithUV(var38, (double)(par3 + 0), var42, var18, var22); ++ var6.addVertexWithUV(var38, (double)(par3 + 1), var42, var18, var20); ++ var6.addVertexWithUV(var38, (double)(par3 + 1), var42, var16, var20); ++ var6.addVertexWithUV(var38, (double)(par3 + 0), var42, var16, var22); ++ var6.addVertexWithUV(var36, (double)(par3 + 0), var42, var18, var22); ++ var6.addVertexWithUV(var36, (double)(par3 + 1), var42, var18, var20); ++ } ++ ++ if (!var55 && !var54) { ++ var6.addVertexWithUV(var36, (double)(par3 + 1), var50, var24, var28); ++ var6.addVertexWithUV(var36, (double)(par3 + 0), var50, var24, var32); ++ var6.addVertexWithUV(var36, (double)(par3 + 0), var52, var26, var32); ++ var6.addVertexWithUV(var36, (double)(par3 + 1), var52, var26, var28); ++ var6.addVertexWithUV(var36, (double)(par3 + 1), var52, var24, var28); ++ var6.addVertexWithUV(var36, (double)(par3 + 0), var52, var24, var32); ++ var6.addVertexWithUV(var36, (double)(par3 + 0), var50, var26, var32); ++ var6.addVertexWithUV(var36, (double)(par3 + 1), var50, var26, var28); ++ } ++ ++ if (var58 || par3 < var5 - 1 && this.blockAccess.isAirBlock(par2 + 1, par3 + 1, par4)) { ++ var6.addVertexWithUV(var36, (double)(par3 + 1) + 0.01D, var52, var26, var28); ++ var6.addVertexWithUV(var38, (double)(par3 + 1) + 0.01D, var52, var26, var30); ++ var6.addVertexWithUV(var38, (double)(par3 + 1) + 0.01D, var50, var24, var30); ++ var6.addVertexWithUV(var36, (double)(par3 + 1) + 0.01D, var50, var24, var28); ++ var6.addVertexWithUV(var38, (double)(par3 + 1) + 0.01D, var52, var26, var28); ++ var6.addVertexWithUV(var36, (double)(par3 + 1) + 0.01D, var52, var26, var30); ++ var6.addVertexWithUV(var36, (double)(par3 + 1) + 0.01D, var50, var24, var30); ++ var6.addVertexWithUV(var38, (double)(par3 + 1) + 0.01D, var50, var24, var28); ++ } ++ ++ if (var59 || par3 > 1 && this.blockAccess.isAirBlock(par2 + 1, par3 - 1, par4)) { ++ var6.addVertexWithUV(var36, (double)par3 - 0.01D, var52, var26, var28); ++ var6.addVertexWithUV(var38, (double)par3 - 0.01D, var52, var26, var30); ++ var6.addVertexWithUV(var38, (double)par3 - 0.01D, var50, var24, var30); ++ var6.addVertexWithUV(var36, (double)par3 - 0.01D, var50, var24, var28); ++ var6.addVertexWithUV(var38, (double)par3 - 0.01D, var52, var26, var28); ++ var6.addVertexWithUV(var36, (double)par3 - 0.01D, var52, var26, var30); ++ var6.addVertexWithUV(var36, (double)par3 - 0.01D, var50, var24, var30); ++ var6.addVertexWithUV(var38, (double)par3 - 0.01D, var50, var24, var28); + } + } + } else { +- var6.addVertexWithUV(var34, (double)(var3 + 1), var42, var67, var20); +- var6.addVertexWithUV(var34, (double)(var3 + 0), var42, var67, var22); +- var6.addVertexWithUV(var38, (double)(var3 + 0), var42, var18, var22); +- var6.addVertexWithUV(var38, (double)(var3 + 1), var42, var18, var20); +- var6.addVertexWithUV(var38, (double)(var3 + 1), var42, var67, var20); +- var6.addVertexWithUV(var38, (double)(var3 + 0), var42, var67, var22); +- var6.addVertexWithUV(var34, (double)(var3 + 0), var42, var18, var22); +- var6.addVertexWithUV(var34, (double)(var3 + 1), var42, var18, var20); +- if(var58) { +- var6.addVertexWithUV(var34, (double)(var3 + 1) + 0.01D, var52, var26, var32); +- var6.addVertexWithUV(var38, (double)(var3 + 1) + 0.01D, var52, var26, var28); +- var6.addVertexWithUV(var38, (double)(var3 + 1) + 0.01D, var50, var24, var28); +- var6.addVertexWithUV(var34, (double)(var3 + 1) + 0.01D, var50, var24, var32); +- var6.addVertexWithUV(var38, (double)(var3 + 1) + 0.01D, var52, var26, var32); +- var6.addVertexWithUV(var34, (double)(var3 + 1) + 0.01D, var52, var26, var28); +- var6.addVertexWithUV(var34, (double)(var3 + 1) + 0.01D, var50, var24, var28); +- var6.addVertexWithUV(var38, (double)(var3 + 1) + 0.01D, var50, var24, var32); +- } else { +- if(var3 < var5 - 1 && this.blockAccess.isAirBlock(var2 - 1, var3 + 1, var4)) { +- var6.addVertexWithUV(var34, (double)(var3 + 1) + 0.01D, var52, var26, var30); +- var6.addVertexWithUV(var36, (double)(var3 + 1) + 0.01D, var52, var26, var32); +- var6.addVertexWithUV(var36, (double)(var3 + 1) + 0.01D, var50, var24, var32); +- var6.addVertexWithUV(var34, (double)(var3 + 1) + 0.01D, var50, var24, var30); +- var6.addVertexWithUV(var36, (double)(var3 + 1) + 0.01D, var52, var26, var30); +- var6.addVertexWithUV(var34, (double)(var3 + 1) + 0.01D, var52, var26, var32); +- var6.addVertexWithUV(var34, (double)(var3 + 1) + 0.01D, var50, var24, var32); +- var6.addVertexWithUV(var36, (double)(var3 + 1) + 0.01D, var50, var24, var30); +- } +- +- if(var3 < var5 - 1 && this.blockAccess.isAirBlock(var2 + 1, var3 + 1, var4)) { +- var6.addVertexWithUV(var36, (double)(var3 + 1) + 0.01D, var52, var26, var28); +- var6.addVertexWithUV(var38, (double)(var3 + 1) + 0.01D, var52, var26, var30); +- var6.addVertexWithUV(var38, (double)(var3 + 1) + 0.01D, var50, var24, var30); +- var6.addVertexWithUV(var36, (double)(var3 + 1) + 0.01D, var50, var24, var28); +- var6.addVertexWithUV(var38, (double)(var3 + 1) + 0.01D, var52, var26, var28); +- var6.addVertexWithUV(var36, (double)(var3 + 1) + 0.01D, var52, var26, var30); +- var6.addVertexWithUV(var36, (double)(var3 + 1) + 0.01D, var50, var24, var30); +- var6.addVertexWithUV(var38, (double)(var3 + 1) + 0.01D, var50, var24, var28); +- } +- } +- +- if(var59) { +- var6.addVertexWithUV(var34, (double)var3 - 0.01D, var52, var26, var32); +- var6.addVertexWithUV(var38, (double)var3 - 0.01D, var52, var26, var28); +- var6.addVertexWithUV(var38, (double)var3 - 0.01D, var50, var24, var28); +- var6.addVertexWithUV(var34, (double)var3 - 0.01D, var50, var24, var32); +- var6.addVertexWithUV(var38, (double)var3 - 0.01D, var52, var26, var32); +- var6.addVertexWithUV(var34, (double)var3 - 0.01D, var52, var26, var28); +- var6.addVertexWithUV(var34, (double)var3 - 0.01D, var50, var24, var28); +- var6.addVertexWithUV(var38, (double)var3 - 0.01D, var50, var24, var32); +- } else { +- if(var3 > 1 && this.blockAccess.isAirBlock(var2 - 1, var3 - 1, var4)) { +- var6.addVertexWithUV(var34, (double)var3 - 0.01D, var52, var26, var30); +- var6.addVertexWithUV(var36, (double)var3 - 0.01D, var52, var26, var32); +- var6.addVertexWithUV(var36, (double)var3 - 0.01D, var50, var24, var32); +- var6.addVertexWithUV(var34, (double)var3 - 0.01D, var50, var24, var30); +- var6.addVertexWithUV(var36, (double)var3 - 0.01D, var52, var26, var30); +- var6.addVertexWithUV(var34, (double)var3 - 0.01D, var52, var26, var32); +- var6.addVertexWithUV(var34, (double)var3 - 0.01D, var50, var24, var32); +- var6.addVertexWithUV(var36, (double)var3 - 0.01D, var50, var24, var30); +- } +- +- if(var3 > 1 && this.blockAccess.isAirBlock(var2 + 1, var3 - 1, var4)) { +- var6.addVertexWithUV(var36, (double)var3 - 0.01D, var52, var26, var28); +- var6.addVertexWithUV(var38, (double)var3 - 0.01D, var52, var26, var30); +- var6.addVertexWithUV(var38, (double)var3 - 0.01D, var50, var24, var30); +- var6.addVertexWithUV(var36, (double)var3 - 0.01D, var50, var24, var28); +- var6.addVertexWithUV(var38, (double)var3 - 0.01D, var52, var26, var28); +- var6.addVertexWithUV(var36, (double)var3 - 0.01D, var52, var26, var30); +- var6.addVertexWithUV(var36, (double)var3 - 0.01D, var50, var24, var30); +- var6.addVertexWithUV(var38, (double)var3 - 0.01D, var50, var24, var28); ++ if (!GlassPaneRenderer.active) { ++ var6.addVertexWithUV(var34, (double)(par3 + 1), var42, var67, var20); ++ var6.addVertexWithUV(var34, (double)(par3 + 0), var42, var67, var22); ++ var6.addVertexWithUV(var38, (double)(par3 + 0), var42, var18, var22); ++ var6.addVertexWithUV(var38, (double)(par3 + 1), var42, var18, var20); ++ var6.addVertexWithUV(var38, (double)(par3 + 1), var42, var67, var20); ++ var6.addVertexWithUV(var38, (double)(par3 + 0), var42, var67, var22); ++ var6.addVertexWithUV(var34, (double)(par3 + 0), var42, var18, var22); ++ var6.addVertexWithUV(var34, (double)(par3 + 1), var42, var18, var20); ++ } ++ ++ if (var58) { ++ var6.addVertexWithUV(var34, (double)(par3 + 1) + 0.01D, var52, var26, var32); ++ var6.addVertexWithUV(var38, (double)(par3 + 1) + 0.01D, var52, var26, var28); ++ var6.addVertexWithUV(var38, (double)(par3 + 1) + 0.01D, var50, var24, var28); ++ var6.addVertexWithUV(var34, (double)(par3 + 1) + 0.01D, var50, var24, var32); ++ var6.addVertexWithUV(var38, (double)(par3 + 1) + 0.01D, var52, var26, var32); ++ var6.addVertexWithUV(var34, (double)(par3 + 1) + 0.01D, var52, var26, var28); ++ var6.addVertexWithUV(var34, (double)(par3 + 1) + 0.01D, var50, var24, var28); ++ var6.addVertexWithUV(var38, (double)(par3 + 1) + 0.01D, var50, var24, var32); ++ } else { ++ if (par3 < var5 - 1 && this.blockAccess.isAirBlock(par2 - 1, par3 + 1, par4)) { ++ var6.addVertexWithUV(var34, (double)(par3 + 1) + 0.01D, var52, var26, var30); ++ var6.addVertexWithUV(var36, (double)(par3 + 1) + 0.01D, var52, var26, var32); ++ var6.addVertexWithUV(var36, (double)(par3 + 1) + 0.01D, var50, var24, var32); ++ var6.addVertexWithUV(var34, (double)(par3 + 1) + 0.01D, var50, var24, var30); ++ var6.addVertexWithUV(var36, (double)(par3 + 1) + 0.01D, var52, var26, var30); ++ var6.addVertexWithUV(var34, (double)(par3 + 1) + 0.01D, var52, var26, var32); ++ var6.addVertexWithUV(var34, (double)(par3 + 1) + 0.01D, var50, var24, var32); ++ var6.addVertexWithUV(var36, (double)(par3 + 1) + 0.01D, var50, var24, var30); ++ } ++ ++ if (par3 < var5 - 1 && this.blockAccess.isAirBlock(par2 + 1, par3 + 1, par4)) { ++ var6.addVertexWithUV(var36, (double)(par3 + 1) + 0.01D, var52, var26, var28); ++ var6.addVertexWithUV(var38, (double)(par3 + 1) + 0.01D, var52, var26, var30); ++ var6.addVertexWithUV(var38, (double)(par3 + 1) + 0.01D, var50, var24, var30); ++ var6.addVertexWithUV(var36, (double)(par3 + 1) + 0.01D, var50, var24, var28); ++ var6.addVertexWithUV(var38, (double)(par3 + 1) + 0.01D, var52, var26, var28); ++ var6.addVertexWithUV(var36, (double)(par3 + 1) + 0.01D, var52, var26, var30); ++ var6.addVertexWithUV(var36, (double)(par3 + 1) + 0.01D, var50, var24, var30); ++ var6.addVertexWithUV(var38, (double)(par3 + 1) + 0.01D, var50, var24, var28); ++ } ++ } ++ ++ if (var59) { ++ var6.addVertexWithUV(var34, (double)par3 - 0.01D, var52, var26, var32); ++ var6.addVertexWithUV(var38, (double)par3 - 0.01D, var52, var26, var28); ++ var6.addVertexWithUV(var38, (double)par3 - 0.01D, var50, var24, var28); ++ var6.addVertexWithUV(var34, (double)par3 - 0.01D, var50, var24, var32); ++ var6.addVertexWithUV(var38, (double)par3 - 0.01D, var52, var26, var32); ++ var6.addVertexWithUV(var34, (double)par3 - 0.01D, var52, var26, var28); ++ var6.addVertexWithUV(var34, (double)par3 - 0.01D, var50, var24, var28); ++ var6.addVertexWithUV(var38, (double)par3 - 0.01D, var50, var24, var32); ++ } else { ++ if (par3 > 1 && this.blockAccess.isAirBlock(par2 - 1, par3 - 1, par4)) { ++ var6.addVertexWithUV(var34, (double)par3 - 0.01D, var52, var26, var30); ++ var6.addVertexWithUV(var36, (double)par3 - 0.01D, var52, var26, var32); ++ var6.addVertexWithUV(var36, (double)par3 - 0.01D, var50, var24, var32); ++ var6.addVertexWithUV(var34, (double)par3 - 0.01D, var50, var24, var30); ++ var6.addVertexWithUV(var36, (double)par3 - 0.01D, var52, var26, var30); ++ var6.addVertexWithUV(var34, (double)par3 - 0.01D, var52, var26, var32); ++ var6.addVertexWithUV(var34, (double)par3 - 0.01D, var50, var24, var32); ++ var6.addVertexWithUV(var36, (double)par3 - 0.01D, var50, var24, var30); ++ } ++ ++ if (par3 > 1 && this.blockAccess.isAirBlock(par2 + 1, par3 - 1, par4)) { ++ var6.addVertexWithUV(var36, (double)par3 - 0.01D, var52, var26, var28); ++ var6.addVertexWithUV(var38, (double)par3 - 0.01D, var52, var26, var30); ++ var6.addVertexWithUV(var38, (double)par3 - 0.01D, var50, var24, var30); ++ var6.addVertexWithUV(var36, (double)par3 - 0.01D, var50, var24, var28); ++ var6.addVertexWithUV(var38, (double)par3 - 0.01D, var52, var26, var28); ++ var6.addVertexWithUV(var36, (double)par3 - 0.01D, var52, var26, var30); ++ var6.addVertexWithUV(var36, (double)par3 - 0.01D, var50, var24, var30); ++ var6.addVertexWithUV(var38, (double)par3 - 0.01D, var50, var24, var28); + } + } + } + +- if((!var54 || !var55) && (var56 || var57 || var54 || var55)) { +- if(var54 && !var55) { +- var6.addVertexWithUV(var36, (double)(var3 + 1), var40, var67, var20); +- var6.addVertexWithUV(var36, (double)(var3 + 0), var40, var67, var22); +- var6.addVertexWithUV(var36, (double)(var3 + 0), var42, var16, var22); +- var6.addVertexWithUV(var36, (double)(var3 + 1), var42, var16, var20); +- var6.addVertexWithUV(var36, (double)(var3 + 1), var42, var67, var20); +- var6.addVertexWithUV(var36, (double)(var3 + 0), var42, var67, var22); +- var6.addVertexWithUV(var36, (double)(var3 + 0), var40, var16, var22); +- var6.addVertexWithUV(var36, (double)(var3 + 1), var40, var16, var20); +- if(!var57 && !var56) { +- var6.addVertexWithUV(var46, (double)(var3 + 1), var42, var24, var28); +- var6.addVertexWithUV(var46, (double)(var3 + 0), var42, var24, var32); +- var6.addVertexWithUV(var48, (double)(var3 + 0), var42, var26, var32); +- var6.addVertexWithUV(var48, (double)(var3 + 1), var42, var26, var28); +- var6.addVertexWithUV(var48, (double)(var3 + 1), var42, var24, var28); +- var6.addVertexWithUV(var48, (double)(var3 + 0), var42, var24, var32); +- var6.addVertexWithUV(var46, (double)(var3 + 0), var42, var26, var32); +- var6.addVertexWithUV(var46, (double)(var3 + 1), var42, var26, var28); +- } +- +- if(var58 || var3 < var5 - 1 && this.blockAccess.isAirBlock(var2, var3 + 1, var4 - 1)) { +- var6.addVertexWithUV(var46, (double)(var3 + 1) + 0.005D, var40, var26, var28); +- var6.addVertexWithUV(var46, (double)(var3 + 1) + 0.005D, var42, var26, var30); +- var6.addVertexWithUV(var48, (double)(var3 + 1) + 0.005D, var42, var24, var30); +- var6.addVertexWithUV(var48, (double)(var3 + 1) + 0.005D, var40, var24, var28); +- var6.addVertexWithUV(var46, (double)(var3 + 1) + 0.005D, var42, var26, var28); +- var6.addVertexWithUV(var46, (double)(var3 + 1) + 0.005D, var40, var26, var30); +- var6.addVertexWithUV(var48, (double)(var3 + 1) + 0.005D, var40, var24, var30); +- var6.addVertexWithUV(var48, (double)(var3 + 1) + 0.005D, var42, var24, var28); +- } +- +- if(var59 || var3 > 1 && this.blockAccess.isAirBlock(var2, var3 - 1, var4 - 1)) { +- var6.addVertexWithUV(var46, (double)var3 - 0.005D, var40, var26, var28); +- var6.addVertexWithUV(var46, (double)var3 - 0.005D, var42, var26, var30); +- var6.addVertexWithUV(var48, (double)var3 - 0.005D, var42, var24, var30); +- var6.addVertexWithUV(var48, (double)var3 - 0.005D, var40, var24, var28); +- var6.addVertexWithUV(var46, (double)var3 - 0.005D, var42, var26, var28); +- var6.addVertexWithUV(var46, (double)var3 - 0.005D, var40, var26, var30); +- var6.addVertexWithUV(var48, (double)var3 - 0.005D, var40, var24, var30); +- var6.addVertexWithUV(var48, (double)var3 - 0.005D, var42, var24, var28); +- } +- } else if(!var54 && var55) { +- var6.addVertexWithUV(var36, (double)(var3 + 1), var42, var16, var20); +- var6.addVertexWithUV(var36, (double)(var3 + 0), var42, var16, var22); +- var6.addVertexWithUV(var36, (double)(var3 + 0), var44, var18, var22); +- var6.addVertexWithUV(var36, (double)(var3 + 1), var44, var18, var20); +- var6.addVertexWithUV(var36, (double)(var3 + 1), var44, var16, var20); +- var6.addVertexWithUV(var36, (double)(var3 + 0), var44, var16, var22); +- var6.addVertexWithUV(var36, (double)(var3 + 0), var42, var18, var22); +- var6.addVertexWithUV(var36, (double)(var3 + 1), var42, var18, var20); +- if(!var57 && !var56) { +- var6.addVertexWithUV(var48, (double)(var3 + 1), var42, var24, var28); +- var6.addVertexWithUV(var48, (double)(var3 + 0), var42, var24, var32); +- var6.addVertexWithUV(var46, (double)(var3 + 0), var42, var26, var32); +- var6.addVertexWithUV(var46, (double)(var3 + 1), var42, var26, var28); +- var6.addVertexWithUV(var46, (double)(var3 + 1), var42, var24, var28); +- var6.addVertexWithUV(var46, (double)(var3 + 0), var42, var24, var32); +- var6.addVertexWithUV(var48, (double)(var3 + 0), var42, var26, var32); +- var6.addVertexWithUV(var48, (double)(var3 + 1), var42, var26, var28); +- } +- +- if(var58 || var3 < var5 - 1 && this.blockAccess.isAirBlock(var2, var3 + 1, var4 + 1)) { +- var6.addVertexWithUV(var46, (double)(var3 + 1) + 0.005D, var42, var24, var30); +- var6.addVertexWithUV(var46, (double)(var3 + 1) + 0.005D, var44, var24, var32); +- var6.addVertexWithUV(var48, (double)(var3 + 1) + 0.005D, var44, var26, var32); +- var6.addVertexWithUV(var48, (double)(var3 + 1) + 0.005D, var42, var26, var30); +- var6.addVertexWithUV(var46, (double)(var3 + 1) + 0.005D, var44, var24, var30); +- var6.addVertexWithUV(var46, (double)(var3 + 1) + 0.005D, var42, var24, var32); +- var6.addVertexWithUV(var48, (double)(var3 + 1) + 0.005D, var42, var26, var32); +- var6.addVertexWithUV(var48, (double)(var3 + 1) + 0.005D, var44, var26, var30); +- } +- +- if(var59 || var3 > 1 && this.blockAccess.isAirBlock(var2, var3 - 1, var4 + 1)) { +- var6.addVertexWithUV(var46, (double)var3 - 0.005D, var42, var24, var30); +- var6.addVertexWithUV(var46, (double)var3 - 0.005D, var44, var24, var32); +- var6.addVertexWithUV(var48, (double)var3 - 0.005D, var44, var26, var32); +- var6.addVertexWithUV(var48, (double)var3 - 0.005D, var42, var26, var30); +- var6.addVertexWithUV(var46, (double)var3 - 0.005D, var44, var24, var30); +- var6.addVertexWithUV(var46, (double)var3 - 0.005D, var42, var24, var32); +- var6.addVertexWithUV(var48, (double)var3 - 0.005D, var42, var26, var32); +- var6.addVertexWithUV(var48, (double)var3 - 0.005D, var44, var26, var30); ++ if ((!var54 || !var55) && (var56 || var57 || var54 || var55)) { ++ if (var54 && !var55) { ++ if (!GlassPaneRenderer.active) { ++ var6.addVertexWithUV(var36, (double)(par3 + 1), var40, var67, var20); ++ var6.addVertexWithUV(var36, (double)(par3 + 0), var40, var67, var22); ++ var6.addVertexWithUV(var36, (double)(par3 + 0), var42, var16, var22); ++ var6.addVertexWithUV(var36, (double)(par3 + 1), var42, var16, var20); ++ var6.addVertexWithUV(var36, (double)(par3 + 1), var42, var67, var20); ++ var6.addVertexWithUV(var36, (double)(par3 + 0), var42, var67, var22); ++ var6.addVertexWithUV(var36, (double)(par3 + 0), var40, var16, var22); ++ var6.addVertexWithUV(var36, (double)(par3 + 1), var40, var16, var20); ++ } ++ ++ if (!var57 && !var56) { ++ var6.addVertexWithUV(var46, (double)(par3 + 1), var42, var24, var28); ++ var6.addVertexWithUV(var46, (double)(par3 + 0), var42, var24, var32); ++ var6.addVertexWithUV(var48, (double)(par3 + 0), var42, var26, var32); ++ var6.addVertexWithUV(var48, (double)(par3 + 1), var42, var26, var28); ++ var6.addVertexWithUV(var48, (double)(par3 + 1), var42, var24, var28); ++ var6.addVertexWithUV(var48, (double)(par3 + 0), var42, var24, var32); ++ var6.addVertexWithUV(var46, (double)(par3 + 0), var42, var26, var32); ++ var6.addVertexWithUV(var46, (double)(par3 + 1), var42, var26, var28); ++ } ++ ++ if (var58 || par3 < var5 - 1 && this.blockAccess.isAirBlock(par2, par3 + 1, par4 - 1)) { ++ var6.addVertexWithUV(var46, (double)(par3 + 1) + 0.005D, var40, var26, var28); ++ var6.addVertexWithUV(var46, (double)(par3 + 1) + 0.005D, var42, var26, var30); ++ var6.addVertexWithUV(var48, (double)(par3 + 1) + 0.005D, var42, var24, var30); ++ var6.addVertexWithUV(var48, (double)(par3 + 1) + 0.005D, var40, var24, var28); ++ var6.addVertexWithUV(var46, (double)(par3 + 1) + 0.005D, var42, var26, var28); ++ var6.addVertexWithUV(var46, (double)(par3 + 1) + 0.005D, var40, var26, var30); ++ var6.addVertexWithUV(var48, (double)(par3 + 1) + 0.005D, var40, var24, var30); ++ var6.addVertexWithUV(var48, (double)(par3 + 1) + 0.005D, var42, var24, var28); ++ } ++ ++ if (var59 || par3 > 1 && this.blockAccess.isAirBlock(par2, par3 - 1, par4 - 1)) { ++ var6.addVertexWithUV(var46, (double)par3 - 0.005D, var40, var26, var28); ++ var6.addVertexWithUV(var46, (double)par3 - 0.005D, var42, var26, var30); ++ var6.addVertexWithUV(var48, (double)par3 - 0.005D, var42, var24, var30); ++ var6.addVertexWithUV(var48, (double)par3 - 0.005D, var40, var24, var28); ++ var6.addVertexWithUV(var46, (double)par3 - 0.005D, var42, var26, var28); ++ var6.addVertexWithUV(var46, (double)par3 - 0.005D, var40, var26, var30); ++ var6.addVertexWithUV(var48, (double)par3 - 0.005D, var40, var24, var30); ++ var6.addVertexWithUV(var48, (double)par3 - 0.005D, var42, var24, var28); ++ } ++ } else if (!var54 && var55) { ++ if (!GlassPaneRenderer.active) { ++ var6.addVertexWithUV(var36, (double)(par3 + 1), var42, var16, var20); ++ var6.addVertexWithUV(var36, (double)(par3 + 0), var42, var16, var22); ++ var6.addVertexWithUV(var36, (double)(par3 + 0), var44, var18, var22); ++ var6.addVertexWithUV(var36, (double)(par3 + 1), var44, var18, var20); ++ var6.addVertexWithUV(var36, (double)(par3 + 1), var44, var16, var20); ++ var6.addVertexWithUV(var36, (double)(par3 + 0), var44, var16, var22); ++ var6.addVertexWithUV(var36, (double)(par3 + 0), var42, var18, var22); ++ var6.addVertexWithUV(var36, (double)(par3 + 1), var42, var18, var20); ++ } ++ ++ if (!var57 && !var56) { ++ var6.addVertexWithUV(var48, (double)(par3 + 1), var42, var24, var28); ++ var6.addVertexWithUV(var48, (double)(par3 + 0), var42, var24, var32); ++ var6.addVertexWithUV(var46, (double)(par3 + 0), var42, var26, var32); ++ var6.addVertexWithUV(var46, (double)(par3 + 1), var42, var26, var28); ++ var6.addVertexWithUV(var46, (double)(par3 + 1), var42, var24, var28); ++ var6.addVertexWithUV(var46, (double)(par3 + 0), var42, var24, var32); ++ var6.addVertexWithUV(var48, (double)(par3 + 0), var42, var26, var32); ++ var6.addVertexWithUV(var48, (double)(par3 + 1), var42, var26, var28); ++ } ++ ++ if (var58 || par3 < var5 - 1 && this.blockAccess.isAirBlock(par2, par3 + 1, par4 + 1)) { ++ var6.addVertexWithUV(var46, (double)(par3 + 1) + 0.005D, var42, var24, var30); ++ var6.addVertexWithUV(var46, (double)(par3 + 1) + 0.005D, var44, var24, var32); ++ var6.addVertexWithUV(var48, (double)(par3 + 1) + 0.005D, var44, var26, var32); ++ var6.addVertexWithUV(var48, (double)(par3 + 1) + 0.005D, var42, var26, var30); ++ var6.addVertexWithUV(var46, (double)(par3 + 1) + 0.005D, var44, var24, var30); ++ var6.addVertexWithUV(var46, (double)(par3 + 1) + 0.005D, var42, var24, var32); ++ var6.addVertexWithUV(var48, (double)(par3 + 1) + 0.005D, var42, var26, var32); ++ var6.addVertexWithUV(var48, (double)(par3 + 1) + 0.005D, var44, var26, var30); ++ } ++ ++ if (var59 || par3 > 1 && this.blockAccess.isAirBlock(par2, par3 - 1, par4 + 1)) { ++ var6.addVertexWithUV(var46, (double)par3 - 0.005D, var42, var24, var30); ++ var6.addVertexWithUV(var46, (double)par3 - 0.005D, var44, var24, var32); ++ var6.addVertexWithUV(var48, (double)par3 - 0.005D, var44, var26, var32); ++ var6.addVertexWithUV(var48, (double)par3 - 0.005D, var42, var26, var30); ++ var6.addVertexWithUV(var46, (double)par3 - 0.005D, var44, var24, var30); ++ var6.addVertexWithUV(var46, (double)par3 - 0.005D, var42, var24, var32); ++ var6.addVertexWithUV(var48, (double)par3 - 0.005D, var42, var26, var32); ++ var6.addVertexWithUV(var48, (double)par3 - 0.005D, var44, var26, var30); + } + } + } else { +- var6.addVertexWithUV(var36, (double)(var3 + 1), var44, var67, var20); +- var6.addVertexWithUV(var36, (double)(var3 + 0), var44, var67, var22); +- var6.addVertexWithUV(var36, (double)(var3 + 0), var40, var18, var22); +- var6.addVertexWithUV(var36, (double)(var3 + 1), var40, var18, var20); +- var6.addVertexWithUV(var36, (double)(var3 + 1), var40, var67, var20); +- var6.addVertexWithUV(var36, (double)(var3 + 0), var40, var67, var22); +- var6.addVertexWithUV(var36, (double)(var3 + 0), var44, var18, var22); +- var6.addVertexWithUV(var36, (double)(var3 + 1), var44, var18, var20); +- if(var58) { +- var6.addVertexWithUV(var48, (double)(var3 + 1) + 0.005D, var44, var26, var32); +- var6.addVertexWithUV(var48, (double)(var3 + 1) + 0.005D, var40, var26, var28); +- var6.addVertexWithUV(var46, (double)(var3 + 1) + 0.005D, var40, var24, var28); +- var6.addVertexWithUV(var46, (double)(var3 + 1) + 0.005D, var44, var24, var32); +- var6.addVertexWithUV(var48, (double)(var3 + 1) + 0.005D, var40, var26, var32); +- var6.addVertexWithUV(var48, (double)(var3 + 1) + 0.005D, var44, var26, var28); +- var6.addVertexWithUV(var46, (double)(var3 + 1) + 0.005D, var44, var24, var28); +- var6.addVertexWithUV(var46, (double)(var3 + 1) + 0.005D, var40, var24, var32); +- } else { +- if(var3 < var5 - 1 && this.blockAccess.isAirBlock(var2, var3 + 1, var4 - 1)) { +- var6.addVertexWithUV(var46, (double)(var3 + 1) + 0.005D, var40, var26, var28); +- var6.addVertexWithUV(var46, (double)(var3 + 1) + 0.005D, var42, var26, var30); +- var6.addVertexWithUV(var48, (double)(var3 + 1) + 0.005D, var42, var24, var30); +- var6.addVertexWithUV(var48, (double)(var3 + 1) + 0.005D, var40, var24, var28); +- var6.addVertexWithUV(var46, (double)(var3 + 1) + 0.005D, var42, var26, var28); +- var6.addVertexWithUV(var46, (double)(var3 + 1) + 0.005D, var40, var26, var30); +- var6.addVertexWithUV(var48, (double)(var3 + 1) + 0.005D, var40, var24, var30); +- var6.addVertexWithUV(var48, (double)(var3 + 1) + 0.005D, var42, var24, var28); +- } +- +- if(var3 < var5 - 1 && this.blockAccess.isAirBlock(var2, var3 + 1, var4 + 1)) { +- var6.addVertexWithUV(var46, (double)(var3 + 1) + 0.005D, var42, var24, var30); +- var6.addVertexWithUV(var46, (double)(var3 + 1) + 0.005D, var44, var24, var32); +- var6.addVertexWithUV(var48, (double)(var3 + 1) + 0.005D, var44, var26, var32); +- var6.addVertexWithUV(var48, (double)(var3 + 1) + 0.005D, var42, var26, var30); +- var6.addVertexWithUV(var46, (double)(var3 + 1) + 0.005D, var44, var24, var30); +- var6.addVertexWithUV(var46, (double)(var3 + 1) + 0.005D, var42, var24, var32); +- var6.addVertexWithUV(var48, (double)(var3 + 1) + 0.005D, var42, var26, var32); +- var6.addVertexWithUV(var48, (double)(var3 + 1) + 0.005D, var44, var26, var30); +- } +- } +- +- if(var59) { +- var6.addVertexWithUV(var48, (double)var3 - 0.005D, var44, var26, var32); +- var6.addVertexWithUV(var48, (double)var3 - 0.005D, var40, var26, var28); +- var6.addVertexWithUV(var46, (double)var3 - 0.005D, var40, var24, var28); +- var6.addVertexWithUV(var46, (double)var3 - 0.005D, var44, var24, var32); +- var6.addVertexWithUV(var48, (double)var3 - 0.005D, var40, var26, var32); +- var6.addVertexWithUV(var48, (double)var3 - 0.005D, var44, var26, var28); +- var6.addVertexWithUV(var46, (double)var3 - 0.005D, var44, var24, var28); +- var6.addVertexWithUV(var46, (double)var3 - 0.005D, var40, var24, var32); +- } else { +- if(var3 > 1 && this.blockAccess.isAirBlock(var2, var3 - 1, var4 - 1)) { +- var6.addVertexWithUV(var46, (double)var3 - 0.005D, var40, var26, var28); +- var6.addVertexWithUV(var46, (double)var3 - 0.005D, var42, var26, var30); +- var6.addVertexWithUV(var48, (double)var3 - 0.005D, var42, var24, var30); +- var6.addVertexWithUV(var48, (double)var3 - 0.005D, var40, var24, var28); +- var6.addVertexWithUV(var46, (double)var3 - 0.005D, var42, var26, var28); +- var6.addVertexWithUV(var46, (double)var3 - 0.005D, var40, var26, var30); +- var6.addVertexWithUV(var48, (double)var3 - 0.005D, var40, var24, var30); +- var6.addVertexWithUV(var48, (double)var3 - 0.005D, var42, var24, var28); +- } +- +- if(var3 > 1 && this.blockAccess.isAirBlock(var2, var3 - 1, var4 + 1)) { +- var6.addVertexWithUV(var46, (double)var3 - 0.005D, var42, var24, var30); +- var6.addVertexWithUV(var46, (double)var3 - 0.005D, var44, var24, var32); +- var6.addVertexWithUV(var48, (double)var3 - 0.005D, var44, var26, var32); +- var6.addVertexWithUV(var48, (double)var3 - 0.005D, var42, var26, var30); +- var6.addVertexWithUV(var46, (double)var3 - 0.005D, var44, var24, var30); +- var6.addVertexWithUV(var46, (double)var3 - 0.005D, var42, var24, var32); +- var6.addVertexWithUV(var48, (double)var3 - 0.005D, var42, var26, var32); +- var6.addVertexWithUV(var48, (double)var3 - 0.005D, var44, var26, var30); ++ if (!GlassPaneRenderer.active) { ++ var6.addVertexWithUV(var36, (double)(par3 + 1), var44, var67, var20); ++ var6.addVertexWithUV(var36, (double)(par3 + 0), var44, var67, var22); ++ var6.addVertexWithUV(var36, (double)(par3 + 0), var40, var18, var22); ++ var6.addVertexWithUV(var36, (double)(par3 + 1), var40, var18, var20); ++ var6.addVertexWithUV(var36, (double)(par3 + 1), var40, var67, var20); ++ var6.addVertexWithUV(var36, (double)(par3 + 0), var40, var67, var22); ++ var6.addVertexWithUV(var36, (double)(par3 + 0), var44, var18, var22); ++ var6.addVertexWithUV(var36, (double)(par3 + 1), var44, var18, var20); ++ } ++ ++ if (var58) { ++ var6.addVertexWithUV(var48, (double)(par3 + 1) + 0.005D, var44, var26, var32); ++ var6.addVertexWithUV(var48, (double)(par3 + 1) + 0.005D, var40, var26, var28); ++ var6.addVertexWithUV(var46, (double)(par3 + 1) + 0.005D, var40, var24, var28); ++ var6.addVertexWithUV(var46, (double)(par3 + 1) + 0.005D, var44, var24, var32); ++ var6.addVertexWithUV(var48, (double)(par3 + 1) + 0.005D, var40, var26, var32); ++ var6.addVertexWithUV(var48, (double)(par3 + 1) + 0.005D, var44, var26, var28); ++ var6.addVertexWithUV(var46, (double)(par3 + 1) + 0.005D, var44, var24, var28); ++ var6.addVertexWithUV(var46, (double)(par3 + 1) + 0.005D, var40, var24, var32); ++ } else { ++ if (par3 < var5 - 1 && this.blockAccess.isAirBlock(par2, par3 + 1, par4 - 1)) { ++ var6.addVertexWithUV(var46, (double)(par3 + 1) + 0.005D, var40, var26, var28); ++ var6.addVertexWithUV(var46, (double)(par3 + 1) + 0.005D, var42, var26, var30); ++ var6.addVertexWithUV(var48, (double)(par3 + 1) + 0.005D, var42, var24, var30); ++ var6.addVertexWithUV(var48, (double)(par3 + 1) + 0.005D, var40, var24, var28); ++ var6.addVertexWithUV(var46, (double)(par3 + 1) + 0.005D, var42, var26, var28); ++ var6.addVertexWithUV(var46, (double)(par3 + 1) + 0.005D, var40, var26, var30); ++ var6.addVertexWithUV(var48, (double)(par3 + 1) + 0.005D, var40, var24, var30); ++ var6.addVertexWithUV(var48, (double)(par3 + 1) + 0.005D, var42, var24, var28); ++ } ++ ++ if (par3 < var5 - 1 && this.blockAccess.isAirBlock(par2, par3 + 1, par4 + 1)) { ++ var6.addVertexWithUV(var46, (double)(par3 + 1) + 0.005D, var42, var24, var30); ++ var6.addVertexWithUV(var46, (double)(par3 + 1) + 0.005D, var44, var24, var32); ++ var6.addVertexWithUV(var48, (double)(par3 + 1) + 0.005D, var44, var26, var32); ++ var6.addVertexWithUV(var48, (double)(par3 + 1) + 0.005D, var42, var26, var30); ++ var6.addVertexWithUV(var46, (double)(par3 + 1) + 0.005D, var44, var24, var30); ++ var6.addVertexWithUV(var46, (double)(par3 + 1) + 0.005D, var42, var24, var32); ++ var6.addVertexWithUV(var48, (double)(par3 + 1) + 0.005D, var42, var26, var32); ++ var6.addVertexWithUV(var48, (double)(par3 + 1) + 0.005D, var44, var26, var30); ++ } ++ } ++ ++ if (var59) { ++ var6.addVertexWithUV(var48, (double)par3 - 0.005D, var44, var26, var32); ++ var6.addVertexWithUV(var48, (double)par3 - 0.005D, var40, var26, var28); ++ var6.addVertexWithUV(var46, (double)par3 - 0.005D, var40, var24, var28); ++ var6.addVertexWithUV(var46, (double)par3 - 0.005D, var44, var24, var32); ++ var6.addVertexWithUV(var48, (double)par3 - 0.005D, var40, var26, var32); ++ var6.addVertexWithUV(var48, (double)par3 - 0.005D, var44, var26, var28); ++ var6.addVertexWithUV(var46, (double)par3 - 0.005D, var44, var24, var28); ++ var6.addVertexWithUV(var46, (double)par3 - 0.005D, var40, var24, var32); ++ } else { ++ if (par3 > 1 && this.blockAccess.isAirBlock(par2, par3 - 1, par4 - 1)) { ++ var6.addVertexWithUV(var46, (double)par3 - 0.005D, var40, var26, var28); ++ var6.addVertexWithUV(var46, (double)par3 - 0.005D, var42, var26, var30); ++ var6.addVertexWithUV(var48, (double)par3 - 0.005D, var42, var24, var30); ++ var6.addVertexWithUV(var48, (double)par3 - 0.005D, var40, var24, var28); ++ var6.addVertexWithUV(var46, (double)par3 - 0.005D, var42, var26, var28); ++ var6.addVertexWithUV(var46, (double)par3 - 0.005D, var40, var26, var30); ++ var6.addVertexWithUV(var48, (double)par3 - 0.005D, var40, var24, var30); ++ var6.addVertexWithUV(var48, (double)par3 - 0.005D, var42, var24, var28); ++ } ++ ++ if (par3 > 1 && this.blockAccess.isAirBlock(par2, par3 - 1, par4 + 1)) { ++ var6.addVertexWithUV(var46, (double)par3 - 0.005D, var42, var24, var30); ++ var6.addVertexWithUV(var46, (double)par3 - 0.005D, var44, var24, var32); ++ var6.addVertexWithUV(var48, (double)par3 - 0.005D, var44, var26, var32); ++ var6.addVertexWithUV(var48, (double)par3 - 0.005D, var42, var26, var30); ++ var6.addVertexWithUV(var46, (double)par3 - 0.005D, var44, var24, var30); ++ var6.addVertexWithUV(var46, (double)par3 - 0.005D, var42, var24, var32); ++ var6.addVertexWithUV(var48, (double)par3 - 0.005D, var42, var26, var32); ++ var6.addVertexWithUV(var48, (double)par3 - 0.005D, var44, var26, var30); + } + } + } + + return true; + } +- +- public boolean renderCrossedSquares(Block var1, int var2, int var3, int var4) { ++ /** ++ * Renders any block requiring croseed squares such as reeds, flowers, and mushrooms ++ */ ++ public boolean renderCrossedSquares(Block par1Block, int par2, int par3, int par4) { + Tessellator var5 = Tessellator.instance; +- var5.setBrightness(var1.getMixedBrightnessForBlock(this.blockAccess, var2, var3, var4)); ++ var5.setBrightness(par1Block.getMixedBrightnessForBlock(this.blockAccess, par2, par3, par4)); + float var6 = 1.0F; +- int var7 = var1.colorMultiplier(this.blockAccess, var2, var3, var4); ++ int var7 = par1Block.colorMultiplier(this.blockAccess, par2, par3, par4); + float var8 = (float)(var7 >> 16 & 255) / 255.0F; + float var9 = (float)(var7 >> 8 & 255) / 255.0F; + float var10 = (float)(var7 & 255) / 255.0F; +- if(EntityRenderer.anaglyphEnable) { ++ ++ if (EntityRenderer.anaglyphEnable) { + float var11 = (var8 * 30.0F + var9 * 59.0F + var10 * 11.0F) / 100.0F; + float var12 = (var8 * 30.0F + var9 * 70.0F) / 100.0F; + float var13 = (var8 * 30.0F + var10 * 70.0F) / 100.0F; +@@ -2670,31 +3206,36 @@ + } + + var5.setColorOpaque_F(var6 * var8, var6 * var9, var6 * var10); +- double var19 = (double)var2; +- double var20 = (double)var3; +- double var15 = (double)var4; +- if(var1 == Block.tallGrass) { +- long var17 = (long)(var2 * 3129871) ^ (long)var4 * 116129781L ^ (long)var3; ++ double var19 = (double)par2; ++ double var20 = (double)par3; ++ double var15 = (double)par4; ++ ++ if (par1Block == Block.tallGrass) { ++ long var17 = (long)(par2 * 3129871) ^ (long)par4 * 116129781L ^ (long)par3; + var17 = var17 * var17 * 42317861L + var17 * 11L; + var19 += ((double)((float)(var17 >> 16 & 15L) / 15.0F) - 0.5D) * 0.5D; + var20 += ((double)((float)(var17 >> 20 & 15L) / 15.0F) - 1.0D) * 0.2D; + var15 += ((double)((float)(var17 >> 24 & 15L) / 15.0F) - 0.5D) * 0.5D; + } + +- this.drawCrossedSquares(var1, this.blockAccess.getBlockMetadata(var2, var3, var4), var19, var20, var15, 1.0F); ++ this.drawCrossedSquares(par1Block, this.blockAccess.getBlockMetadata(par2, par3, par4), var19, var20, var15, 1.0F); + return true; + } + +- public boolean renderBlockStem(Block var1, int var2, int var3, int var4) { +- BlockStem var5 = (BlockStem)var1; ++ /** ++ * Render block stem ++ */ ++ public boolean renderBlockStem(Block par1Block, int par2, int par3, int par4) { ++ BlockStem var5 = (BlockStem)par1Block; + Tessellator var6 = Tessellator.instance; +- var6.setBrightness(var5.getMixedBrightnessForBlock(this.blockAccess, var2, var3, var4)); ++ var6.setBrightness(var5.getMixedBrightnessForBlock(this.blockAccess, par2, par3, par4)); + float var7 = 1.0F; +- int var8 = var5.colorMultiplier(this.blockAccess, var2, var3, var4); ++ int var8 = var5.colorMultiplier(this.blockAccess, par2, par3, par4); + float var9 = (float)(var8 >> 16 & 255) / 255.0F; + float var10 = (float)(var8 >> 8 & 255) / 255.0F; + float var11 = (float)(var8 & 255) / 255.0F; +- if(EntityRenderer.anaglyphEnable) { ++ ++ if (EntityRenderer.anaglyphEnable) { + float var12 = (var9 * 30.0F + var10 * 59.0F + var11 * 11.0F) / 100.0F; + float var13 = (var9 * 30.0F + var10 * 70.0F) / 100.0F; + float var14 = (var9 * 30.0F + var11 * 70.0F) / 100.0F; +@@ -2704,30 +3245,38 @@ + } + + var6.setColorOpaque_F(var7 * var9, var7 * var10, var7 * var11); +- var5.setBlockBoundsBasedOnState(this.blockAccess, var2, var3, var4); +- int var15 = var5.getState(this.blockAccess, var2, var3, var4); +- if(var15 < 0) { +- this.renderBlockStemSmall(var5, this.blockAccess.getBlockMetadata(var2, var3, var4), this.renderMaxY, (double)var2, (double)((float)var3 - 1.0F / 16.0F), (double)var4); ++ var5.setBlockBoundsBasedOnState(this.blockAccess, par2, par3, par4); ++ int var15 = var5.getState(this.blockAccess, par2, par3, par4); ++ ++ if (var15 < 0) { ++ this.renderBlockStemSmall(var5, this.blockAccess.getBlockMetadata(par2, par3, par4), this.renderMaxY, (double)par2, (double)((float)par3 - 0.0625F), (double)par4); + } else { +- this.renderBlockStemSmall(var5, this.blockAccess.getBlockMetadata(var2, var3, var4), 0.5D, (double)var2, (double)((float)var3 - 1.0F / 16.0F), (double)var4); +- this.renderBlockStemBig(var5, this.blockAccess.getBlockMetadata(var2, var3, var4), var15, this.renderMaxY, (double)var2, (double)((float)var3 - 1.0F / 16.0F), (double)var4); ++ this.renderBlockStemSmall(var5, this.blockAccess.getBlockMetadata(par2, par3, par4), 0.5D, (double)par2, (double)((float)par3 - 0.0625F), (double)par4); ++ this.renderBlockStemBig(var5, this.blockAccess.getBlockMetadata(par2, par3, par4), var15, this.renderMaxY, (double)par2, (double)((float)par3 - 0.0625F), (double)par4); + } + + return true; + } + +- public boolean renderBlockCrops(Block var1, int var2, int var3, int var4) { ++ /** ++ * Render block crops ++ */ ++ public boolean renderBlockCrops(Block par1Block, int par2, int par3, int par4) { + Tessellator var5 = Tessellator.instance; +- var5.setBrightness(var1.getMixedBrightnessForBlock(this.blockAccess, var2, var3, var4)); ++ var5.setBrightness(par1Block.getMixedBrightnessForBlock(this.blockAccess, par2, par3, par4)); + var5.setColorOpaque_F(1.0F, 1.0F, 1.0F); +- this.renderBlockCropsImpl(var1, this.blockAccess.getBlockMetadata(var2, var3, var4), (double)var2, (double)((float)var3 - 1.0F / 16.0F), (double)var4); ++ this.renderBlockCropsImpl(par1Block, this.blockAccess.getBlockMetadata(par2, par3, par4), (double)par2, (double)((float)par3 - 0.0625F), (double)par4); + return true; + } + +- public void renderTorchAtAngle(Block var1, double var2, double var4, double var6, double var8, double var10, int var12) { ++ /** ++ * Renders a torch at the given coordinates, with the base slanting at the given delta ++ */ ++ public void renderTorchAtAngle(Block par1Block, double par2, double par4, double par6, double par8, double par10, int par12) { + Tessellator var13 = Tessellator.instance; +- Icon var14 = this.getBlockIconFromSideAndMetadata(var1, 0, var12); +- if(this.hasOverrideBlockTexture()) { ++ Icon var14 = this.getBlockIconFromSideAndMetadata(par1Block, 0, par12); ++ ++ if (this.hasOverrideBlockTexture()) { + var14 = this.overrideBlockTexture; + } + +@@ -2743,144 +3292,186 @@ + double var33 = (double)var14.getInterpolatedV(13.0D); + double var35 = (double)var14.getInterpolatedU(9.0D); + double var37 = (double)var14.getInterpolatedV(15.0D); +- var2 += 0.5D; +- var6 += 0.5D; +- double var39 = var2 - 0.5D; +- double var41 = var2 + 0.5D; +- double var43 = var6 - 0.5D; +- double var45 = var6 + 0.5D; +- double var47 = 1.0D / 16.0D; ++ par2 += 0.5D; ++ par6 += 0.5D; ++ double var39 = par2 - 0.5D; ++ double var41 = par2 + 0.5D; ++ double var43 = par6 - 0.5D; ++ double var45 = par6 + 0.5D; ++ double var47 = 0.0625D; + double var49 = 0.625D; +- var13.addVertexWithUV(var2 + var8 * (1.0D - var49) - var47, var4 + var49, var6 + var10 * (1.0D - var49) - var47, var23, var25); +- var13.addVertexWithUV(var2 + var8 * (1.0D - var49) - var47, var4 + var49, var6 + var10 * (1.0D - var49) + var47, var23, var29); +- var13.addVertexWithUV(var2 + var8 * (1.0D - var49) + var47, var4 + var49, var6 + var10 * (1.0D - var49) + var47, var27, var29); +- var13.addVertexWithUV(var2 + var8 * (1.0D - var49) + var47, var4 + var49, var6 + var10 * (1.0D - var49) - var47, var27, var25); +- var13.addVertexWithUV(var2 + var47 + var8, var4, var6 - var47 + var10, var35, var33); +- var13.addVertexWithUV(var2 + var47 + var8, var4, var6 + var47 + var10, var35, var37); +- var13.addVertexWithUV(var2 - var47 + var8, var4, var6 + var47 + var10, var31, var37); +- var13.addVertexWithUV(var2 - var47 + var8, var4, var6 - var47 + var10, var31, var33); +- var13.addVertexWithUV(var2 - var47, var4 + 1.0D, var43, var15, var17); +- var13.addVertexWithUV(var2 - var47 + var8, var4 + 0.0D, var43 + var10, var15, var21); +- var13.addVertexWithUV(var2 - var47 + var8, var4 + 0.0D, var45 + var10, var19, var21); +- var13.addVertexWithUV(var2 - var47, var4 + 1.0D, var45, var19, var17); +- var13.addVertexWithUV(var2 + var47, var4 + 1.0D, var45, var15, var17); +- var13.addVertexWithUV(var2 + var8 + var47, var4 + 0.0D, var45 + var10, var15, var21); +- var13.addVertexWithUV(var2 + var8 + var47, var4 + 0.0D, var43 + var10, var19, var21); +- var13.addVertexWithUV(var2 + var47, var4 + 1.0D, var43, var19, var17); +- var13.addVertexWithUV(var39, var4 + 1.0D, var6 + var47, var15, var17); +- var13.addVertexWithUV(var39 + var8, var4 + 0.0D, var6 + var47 + var10, var15, var21); +- var13.addVertexWithUV(var41 + var8, var4 + 0.0D, var6 + var47 + var10, var19, var21); +- var13.addVertexWithUV(var41, var4 + 1.0D, var6 + var47, var19, var17); +- var13.addVertexWithUV(var41, var4 + 1.0D, var6 - var47, var15, var17); +- var13.addVertexWithUV(var41 + var8, var4 + 0.0D, var6 - var47 + var10, var15, var21); +- var13.addVertexWithUV(var39 + var8, var4 + 0.0D, var6 - var47 + var10, var19, var21); +- var13.addVertexWithUV(var39, var4 + 1.0D, var6 - var47, var19, var17); +- } +- +- public void drawCrossedSquares(Block var1, int var2, double var3, double var5, double var7, float var9) { ++ var13.addVertexWithUV(par2 + par8 * (1.0D - var49) - var47, par4 + var49, par6 + par10 * (1.0D - var49) - var47, var23, var25); ++ var13.addVertexWithUV(par2 + par8 * (1.0D - var49) - var47, par4 + var49, par6 + par10 * (1.0D - var49) + var47, var23, var29); ++ var13.addVertexWithUV(par2 + par8 * (1.0D - var49) + var47, par4 + var49, par6 + par10 * (1.0D - var49) + var47, var27, var29); ++ var13.addVertexWithUV(par2 + par8 * (1.0D - var49) + var47, par4 + var49, par6 + par10 * (1.0D - var49) - var47, var27, var25); ++ var13.addVertexWithUV(par2 + var47 + par8, par4, par6 - var47 + par10, var35, var33); ++ var13.addVertexWithUV(par2 + var47 + par8, par4, par6 + var47 + par10, var35, var37); ++ var13.addVertexWithUV(par2 - var47 + par8, par4, par6 + var47 + par10, var31, var37); ++ var13.addVertexWithUV(par2 - var47 + par8, par4, par6 - var47 + par10, var31, var33); ++ var13.addVertexWithUV(par2 - var47, par4 + 1.0D, var43, var15, var17); ++ var13.addVertexWithUV(par2 - var47 + par8, par4 + 0.0D, var43 + par10, var15, var21); ++ var13.addVertexWithUV(par2 - var47 + par8, par4 + 0.0D, var45 + par10, var19, var21); ++ var13.addVertexWithUV(par2 - var47, par4 + 1.0D, var45, var19, var17); ++ var13.addVertexWithUV(par2 + var47, par4 + 1.0D, var45, var15, var17); ++ var13.addVertexWithUV(par2 + par8 + var47, par4 + 0.0D, var45 + par10, var15, var21); ++ var13.addVertexWithUV(par2 + par8 + var47, par4 + 0.0D, var43 + par10, var19, var21); ++ var13.addVertexWithUV(par2 + var47, par4 + 1.0D, var43, var19, var17); ++ var13.addVertexWithUV(var39, par4 + 1.0D, par6 + var47, var15, var17); ++ var13.addVertexWithUV(var39 + par8, par4 + 0.0D, par6 + var47 + par10, var15, var21); ++ var13.addVertexWithUV(var41 + par8, par4 + 0.0D, par6 + var47 + par10, var19, var21); ++ var13.addVertexWithUV(var41, par4 + 1.0D, par6 + var47, var19, var17); ++ var13.addVertexWithUV(var41, par4 + 1.0D, par6 - var47, var15, var17); ++ var13.addVertexWithUV(var41 + par8, par4 + 0.0D, par6 - var47 + par10, var15, var21); ++ var13.addVertexWithUV(var39 + par8, par4 + 0.0D, par6 - var47 + par10, var19, var21); ++ var13.addVertexWithUV(var39, par4 + 1.0D, par6 - var47, var19, var17); ++ } ++ ++ /** ++ * Utility function to draw crossed swuares ++ */ ++ // Spout Start ++ public void drawCrossedSquares(Block par1Block, int par2, double par3, double par5, double par7, float par9) { ++ drawCrossedSquares(par1Block, par2, par3, par5, par7, par9, false); ++ } ++ ++ public void drawCrossedSquares(Block par1Block, int par2, double par3, double par5, double par7, float par9, boolean customUV) { ++ // Spout End + Tessellator var10 = Tessellator.instance; +- Icon var11 = this.getBlockIconFromSideAndMetadata(var1, 0, var2); +- if(this.hasOverrideBlockTexture()) { ++ Icon var11 = this.getBlockIconFromSideAndMetadata(par1Block, 0, par2); ++ ++ if (this.hasOverrideBlockTexture()) { + var11 = this.overrideBlockTexture; + } + +- double var12 = (double)var11.getMinU(); +- double var14 = (double)var11.getMinV(); +- double var16 = (double)var11.getMaxU(); +- double var18 = (double)var11.getMaxV(); +- double var20 = 0.45D * (double)var9; +- double var22 = var3 + 0.5D - var20; +- double var24 = var3 + 0.5D + var20; +- double var26 = var7 + 0.5D - var20; +- double var28 = var7 + 0.5D + var20; +- var10.addVertexWithUV(var22, var5 + (double)var9, var26, var12, var14); +- var10.addVertexWithUV(var22, var5 + 0.0D, var26, var12, var18); +- var10.addVertexWithUV(var24, var5 + 0.0D, var28, var16, var18); +- var10.addVertexWithUV(var24, var5 + (double)var9, var28, var16, var14); +- var10.addVertexWithUV(var24, var5 + (double)var9, var28, var12, var14); +- var10.addVertexWithUV(var24, var5 + 0.0D, var28, var12, var18); +- var10.addVertexWithUV(var22, var5 + 0.0D, var26, var16, var18); +- var10.addVertexWithUV(var22, var5 + (double)var9, var26, var16, var14); +- var10.addVertexWithUV(var22, var5 + (double)var9, var28, var12, var14); +- var10.addVertexWithUV(var22, var5 + 0.0D, var28, var12, var18); +- var10.addVertexWithUV(var24, var5 + 0.0D, var26, var16, var18); +- var10.addVertexWithUV(var24, var5 + (double)var9, var26, var16, var14); +- var10.addVertexWithUV(var24, var5 + (double)var9, var26, var12, var14); +- var10.addVertexWithUV(var24, var5 + 0.0D, var26, var12, var18); +- var10.addVertexWithUV(var22, var5 + 0.0D, var28, var16, var18); +- var10.addVertexWithUV(var22, var5 + (double)var9, var28, var16, var14); ++ var11 = CTMUtils.getTile(this, par1Block, (int)par3, (int)par5, (int)par7, var11, var10); ++ ++ if (var11 != null) { ++ var10 = TessellatorUtils.getTessellator(var10, var11); ++ double var12 = (double)var11.getMinU(); ++ double var14 = (double)var11.getMinV(); ++ double var16 = (double)var11.getMaxU(); ++ double var18 = (double)var11.getMaxV(); ++ double var20 = 0.45D * (double)par9; ++ double var22 = par3 + 0.5D - var20; ++ double var24 = par3 + 0.5D + var20; ++ double var26 = par7 + 0.5D - var20; ++ double var28 = par7 + 0.5D + var20; ++ // Spout Start ++ if (customUV) { ++ var12 = 1; ++ var14 = 0; ++ var16 = 1; ++ var18 = 0; ++ } ++ // Spout End ++ var10.addVertexWithUV(var22, par5 + (double)par9, var26, var12, var14); ++ var10.addVertexWithUV(var22, par5 + 0.0D, var26, var12, var18); ++ var10.addVertexWithUV(var24, par5 + 0.0D, var28, var16, var18); ++ var10.addVertexWithUV(var24, par5 + (double)par9, var28, var16, var14); ++ var10.addVertexWithUV(var24, par5 + (double)par9, var28, var12, var14); ++ var10.addVertexWithUV(var24, par5 + 0.0D, var28, var12, var18); ++ var10.addVertexWithUV(var22, par5 + 0.0D, var26, var16, var18); ++ var10.addVertexWithUV(var22, par5 + (double)par9, var26, var16, var14); ++ var10.addVertexWithUV(var22, par5 + (double)par9, var28, var12, var14); ++ var10.addVertexWithUV(var22, par5 + 0.0D, var28, var12, var18); ++ var10.addVertexWithUV(var24, par5 + 0.0D, var26, var16, var18); ++ var10.addVertexWithUV(var24, par5 + (double)par9, var26, var16, var14); ++ var10.addVertexWithUV(var24, par5 + (double)par9, var26, var12, var14); ++ var10.addVertexWithUV(var24, par5 + 0.0D, var26, var12, var18); ++ var10.addVertexWithUV(var22, par5 + 0.0D, var28, var16, var18); ++ var10.addVertexWithUV(var22, par5 + (double)par9, var28, var16, var14); ++ } + } + +- public void renderBlockStemSmall(Block var1, int var2, double var3, double var5, double var7, double var9) { ++ /** ++ * Render block stem small ++ */ ++ public void renderBlockStemSmall(Block par1Block, int par2, double par3, double par5, double par7, double par9) { + Tessellator var11 = Tessellator.instance; +- Icon var12 = this.getBlockIconFromSideAndMetadata(var1, 0, var2); +- if(this.hasOverrideBlockTexture()) { ++ Icon var12 = this.getBlockIconFromSideAndMetadata(par1Block, 0, par2); ++ ++ if (this.hasOverrideBlockTexture()) { + var12 = this.overrideBlockTexture; + } + + double var13 = (double)var12.getMinU(); + double var15 = (double)var12.getMinV(); + double var17 = (double)var12.getMaxU(); +- double var19 = (double)var12.getInterpolatedV(var3 * 16.0D); +- double var21 = var5 + 0.5D - (double)0.45F; +- double var23 = var5 + 0.5D + (double)0.45F; +- double var25 = var9 + 0.5D - (double)0.45F; +- double var27 = var9 + 0.5D + (double)0.45F; +- var11.addVertexWithUV(var21, var7 + var3, var25, var13, var15); +- var11.addVertexWithUV(var21, var7 + 0.0D, var25, var13, var19); +- var11.addVertexWithUV(var23, var7 + 0.0D, var27, var17, var19); +- var11.addVertexWithUV(var23, var7 + var3, var27, var17, var15); +- var11.addVertexWithUV(var23, var7 + var3, var27, var13, var15); +- var11.addVertexWithUV(var23, var7 + 0.0D, var27, var13, var19); +- var11.addVertexWithUV(var21, var7 + 0.0D, var25, var17, var19); +- var11.addVertexWithUV(var21, var7 + var3, var25, var17, var15); +- var11.addVertexWithUV(var21, var7 + var3, var27, var13, var15); +- var11.addVertexWithUV(var21, var7 + 0.0D, var27, var13, var19); +- var11.addVertexWithUV(var23, var7 + 0.0D, var25, var17, var19); +- var11.addVertexWithUV(var23, var7 + var3, var25, var17, var15); +- var11.addVertexWithUV(var23, var7 + var3, var25, var13, var15); +- var11.addVertexWithUV(var23, var7 + 0.0D, var25, var13, var19); +- var11.addVertexWithUV(var21, var7 + 0.0D, var27, var17, var19); +- var11.addVertexWithUV(var21, var7 + var3, var27, var17, var15); ++ double var19 = (double)var12.getInterpolatedV(par3 * 16.0D); ++ double var21 = par5 + 0.5D - 0.44999998807907104D; ++ double var23 = par5 + 0.5D + 0.44999998807907104D; ++ double var25 = par9 + 0.5D - 0.44999998807907104D; ++ double var27 = par9 + 0.5D + 0.44999998807907104D; ++ var11.addVertexWithUV(var21, par7 + par3, var25, var13, var15); ++ var11.addVertexWithUV(var21, par7 + 0.0D, var25, var13, var19); ++ var11.addVertexWithUV(var23, par7 + 0.0D, var27, var17, var19); ++ var11.addVertexWithUV(var23, par7 + par3, var27, var17, var15); ++ var11.addVertexWithUV(var23, par7 + par3, var27, var13, var15); ++ var11.addVertexWithUV(var23, par7 + 0.0D, var27, var13, var19); ++ var11.addVertexWithUV(var21, par7 + 0.0D, var25, var17, var19); ++ var11.addVertexWithUV(var21, par7 + par3, var25, var17, var15); ++ var11.addVertexWithUV(var21, par7 + par3, var27, var13, var15); ++ var11.addVertexWithUV(var21, par7 + 0.0D, var27, var13, var19); ++ var11.addVertexWithUV(var23, par7 + 0.0D, var25, var17, var19); ++ var11.addVertexWithUV(var23, par7 + par3, var25, var17, var15); ++ var11.addVertexWithUV(var23, par7 + par3, var25, var13, var15); ++ var11.addVertexWithUV(var23, par7 + 0.0D, var25, var13, var19); ++ var11.addVertexWithUV(var21, par7 + 0.0D, var27, var17, var19); ++ var11.addVertexWithUV(var21, par7 + par3, var27, var17, var15); + } + +- public boolean renderBlockLilyPad(Block var1, int var2, int var3, int var4) { ++ /** ++ * Render BlockLilyPad ++ */ ++ public boolean renderBlockLilyPad(Block par1Block, int par2, int par3, int par4) { + Tessellator var5 = Tessellator.instance; +- Icon var6 = this.getBlockIconFromSide(var1, 1); +- if(this.hasOverrideBlockTexture()) { ++ Icon var6 = this.getBlockIconFromSide(par1Block, 1); ++ ++ if (this.hasOverrideBlockTexture()) { + var6 = this.overrideBlockTexture; + } + + float var7 = 0.015625F; +- double var8 = (double)var6.getMinU(); +- double var10 = (double)var6.getMinV(); +- double var12 = (double)var6.getMaxU(); +- double var14 = (double)var6.getMaxV(); +- long var16 = (long)(var2 * 3129871) ^ (long)var4 * 116129781L ^ (long)var3; +- var16 = var16 * var16 * 42317861L + var16 * 11L; +- int var18 = (int)(var16 >> 16 & 3L); +- var5.setBrightness(var1.getMixedBrightnessForBlock(this.blockAccess, var2, var3, var4)); +- float var19 = (float)var2 + 0.5F; +- float var20 = (float)var4 + 0.5F; +- float var21 = (float)(var18 & 1) * 0.5F * (float)(1 - var18 / 2 % 2 * 2); +- float var22 = (float)(var18 + 1 & 1) * 0.5F * (float)(1 - (var18 + 1) / 2 % 2 * 2); +- var5.setColorOpaque_I(var1.getBlockColor()); +- var5.addVertexWithUV((double)(var19 + var21 - var22), (double)((float)var3 + var7), (double)(var20 + var21 + var22), var8, var10); +- var5.addVertexWithUV((double)(var19 + var21 + var22), (double)((float)var3 + var7), (double)(var20 - var21 + var22), var12, var10); +- var5.addVertexWithUV((double)(var19 - var21 + var22), (double)((float)var3 + var7), (double)(var20 - var21 - var22), var12, var14); +- var5.addVertexWithUV((double)(var19 - var21 - var22), (double)((float)var3 + var7), (double)(var20 + var21 - var22), var8, var14); +- var5.setColorOpaque_I((var1.getBlockColor() & 16711422) >> 1); +- var5.addVertexWithUV((double)(var19 - var21 - var22), (double)((float)var3 + var7), (double)(var20 + var21 - var22), var8, var14); +- var5.addVertexWithUV((double)(var19 - var21 + var22), (double)((float)var3 + var7), (double)(var20 - var21 - var22), var12, var14); +- var5.addVertexWithUV((double)(var19 + var21 + var22), (double)((float)var3 + var7), (double)(var20 - var21 + var22), var12, var10); +- var5.addVertexWithUV((double)(var19 + var21 - var22), (double)((float)var3 + var7), (double)(var20 + var21 + var22), var8, var10); +- return true; ++ var6 = CTMUtils.getTile(this, par1Block, par2, par3, par4, var6, var5); ++ ++ if (var6 == null) { ++ return false; ++ } else { ++ var5 = TessellatorUtils.getTessellator(var5, var6); ++ double var8 = (double)var6.getMinU(); ++ double var10 = (double)var6.getMinV(); ++ double var12 = (double)var6.getMaxU(); ++ double var14 = (double)var6.getMaxV(); ++ long var16 = (long)(par2 * 3129871) ^ (long)par4 * 116129781L ^ (long)par3; ++ var16 = var16 * var16 * 42317861L + var16 * 11L; ++ int var18 = (int)(var16 >> 16 & 3L); ++ var5.setBrightness(par1Block.getMixedBrightnessForBlock(this.blockAccess, par2, par3, par4)); ++ float var19 = (float)par2 + 0.5F; ++ float var20 = (float)par4 + 0.5F; ++ float var21 = (float)(var18 & 1) * 0.5F * (float)(1 - var18 / 2 % 2 * 2); ++ float var22 = (float)(var18 + 1 & 1) * 0.5F * (float)(1 - (var18 + 1) / 2 % 2 * 2); ++ var5.setColorOpaque_I(par1Block.getBlockColor()); ++ var5.addVertexWithUV((double)(var19 + var21 - var22), (double)((float)par3 + var7), (double)(var20 + var21 + var22), var8, var10); ++ var5.addVertexWithUV((double)(var19 + var21 + var22), (double)((float)par3 + var7), (double)(var20 - var21 + var22), var12, var10); ++ var5.addVertexWithUV((double)(var19 - var21 + var22), (double)((float)par3 + var7), (double)(var20 - var21 - var22), var12, var14); ++ var5.addVertexWithUV((double)(var19 - var21 - var22), (double)((float)par3 + var7), (double)(var20 + var21 - var22), var8, var14); ++ var5.setColorOpaque_I((par1Block.getBlockColor() & 16711422) >> 1); ++ var5.addVertexWithUV((double)(var19 - var21 - var22), (double)((float)par3 + var7), (double)(var20 + var21 - var22), var8, var14); ++ var5.addVertexWithUV((double)(var19 - var21 + var22), (double)((float)par3 + var7), (double)(var20 - var21 - var22), var12, var14); ++ var5.addVertexWithUV((double)(var19 + var21 + var22), (double)((float)par3 + var7), (double)(var20 - var21 + var22), var12, var10); ++ var5.addVertexWithUV((double)(var19 + var21 - var22), (double)((float)par3 + var7), (double)(var20 + var21 + var22), var8, var10); ++ return true; ++ } + } + +- public void renderBlockStemBig(BlockStem var1, int var2, int var3, double var4, double var6, double var8, double var10) { ++ /** ++ * Render block stem big ++ */ ++ public void renderBlockStemBig(BlockStem par1BlockStem, int par2, int par3, double par4, double par6, double par8, double par10) { + Tessellator var12 = Tessellator.instance; +- Icon var13 = var1.getStemIcon(); +- if(this.hasOverrideBlockTexture()) { ++ Icon var13 = par1BlockStem.getStemIcon(); ++ ++ if (this.hasOverrideBlockTexture()) { + var13 = this.overrideBlockTexture; + } + +@@ -2888,44 +3479,48 @@ + double var16 = (double)var13.getMinV(); + double var18 = (double)var13.getMaxU(); + double var20 = (double)var13.getMaxV(); +- double var22 = var6 + 0.5D - 0.5D; +- double var24 = var6 + 0.5D + 0.5D; +- double var26 = var10 + 0.5D - 0.5D; +- double var28 = var10 + 0.5D + 0.5D; +- double var30 = var6 + 0.5D; +- double var32 = var10 + 0.5D; +- if((var3 + 1) / 2 % 2 == 1) { ++ double var22 = par6 + 0.5D - 0.5D; ++ double var24 = par6 + 0.5D + 0.5D; ++ double var26 = par10 + 0.5D - 0.5D; ++ double var28 = par10 + 0.5D + 0.5D; ++ double var30 = par6 + 0.5D; ++ double var32 = par10 + 0.5D; ++ ++ if ((par3 + 1) / 2 % 2 == 1) { + double var34 = var18; + var18 = var14; + var14 = var34; + } + +- if(var3 < 2) { +- var12.addVertexWithUV(var22, var8 + var4, var32, var14, var16); +- var12.addVertexWithUV(var22, var8 + 0.0D, var32, var14, var20); +- var12.addVertexWithUV(var24, var8 + 0.0D, var32, var18, var20); +- var12.addVertexWithUV(var24, var8 + var4, var32, var18, var16); +- var12.addVertexWithUV(var24, var8 + var4, var32, var18, var16); +- var12.addVertexWithUV(var24, var8 + 0.0D, var32, var18, var20); +- var12.addVertexWithUV(var22, var8 + 0.0D, var32, var14, var20); +- var12.addVertexWithUV(var22, var8 + var4, var32, var14, var16); ++ if (par3 < 2) { ++ var12.addVertexWithUV(var22, par8 + par4, var32, var14, var16); ++ var12.addVertexWithUV(var22, par8 + 0.0D, var32, var14, var20); ++ var12.addVertexWithUV(var24, par8 + 0.0D, var32, var18, var20); ++ var12.addVertexWithUV(var24, par8 + par4, var32, var18, var16); ++ var12.addVertexWithUV(var24, par8 + par4, var32, var18, var16); ++ var12.addVertexWithUV(var24, par8 + 0.0D, var32, var18, var20); ++ var12.addVertexWithUV(var22, par8 + 0.0D, var32, var14, var20); ++ var12.addVertexWithUV(var22, par8 + par4, var32, var14, var16); + } else { +- var12.addVertexWithUV(var30, var8 + var4, var28, var14, var16); +- var12.addVertexWithUV(var30, var8 + 0.0D, var28, var14, var20); +- var12.addVertexWithUV(var30, var8 + 0.0D, var26, var18, var20); +- var12.addVertexWithUV(var30, var8 + var4, var26, var18, var16); +- var12.addVertexWithUV(var30, var8 + var4, var26, var18, var16); +- var12.addVertexWithUV(var30, var8 + 0.0D, var26, var18, var20); +- var12.addVertexWithUV(var30, var8 + 0.0D, var28, var14, var20); +- var12.addVertexWithUV(var30, var8 + var4, var28, var14, var16); ++ var12.addVertexWithUV(var30, par8 + par4, var28, var14, var16); ++ var12.addVertexWithUV(var30, par8 + 0.0D, var28, var14, var20); ++ var12.addVertexWithUV(var30, par8 + 0.0D, var26, var18, var20); ++ var12.addVertexWithUV(var30, par8 + par4, var26, var18, var16); ++ var12.addVertexWithUV(var30, par8 + par4, var26, var18, var16); ++ var12.addVertexWithUV(var30, par8 + 0.0D, var26, var18, var20); ++ var12.addVertexWithUV(var30, par8 + 0.0D, var28, var14, var20); ++ var12.addVertexWithUV(var30, par8 + par4, var28, var14, var16); + } +- + } + +- public void renderBlockCropsImpl(Block var1, int var2, double var3, double var5, double var7) { ++ /** ++ * Render block crops implementation ++ */ ++ public void renderBlockCropsImpl(Block par1Block, int par2, double par3, double par5, double par7) { + Tessellator var9 = Tessellator.instance; +- Icon var10 = this.getBlockIconFromSideAndMetadata(var1, 0, var2); +- if(this.hasOverrideBlockTexture()) { ++ Icon var10 = this.getBlockIconFromSideAndMetadata(par1Block, 0, par2); ++ ++ if (this.hasOverrideBlockTexture()) { + var10 = this.overrideBlockTexture; + } + +@@ -2933,58 +3528,62 @@ + double var13 = (double)var10.getMinV(); + double var15 = (double)var10.getMaxU(); + double var17 = (double)var10.getMaxV(); +- double var19 = var3 + 0.5D - 0.25D; +- double var21 = var3 + 0.5D + 0.25D; +- double var23 = var7 + 0.5D - 0.5D; +- double var25 = var7 + 0.5D + 0.5D; +- var9.addVertexWithUV(var19, var5 + 1.0D, var23, var11, var13); +- var9.addVertexWithUV(var19, var5 + 0.0D, var23, var11, var17); +- var9.addVertexWithUV(var19, var5 + 0.0D, var25, var15, var17); +- var9.addVertexWithUV(var19, var5 + 1.0D, var25, var15, var13); +- var9.addVertexWithUV(var19, var5 + 1.0D, var25, var11, var13); +- var9.addVertexWithUV(var19, var5 + 0.0D, var25, var11, var17); +- var9.addVertexWithUV(var19, var5 + 0.0D, var23, var15, var17); +- var9.addVertexWithUV(var19, var5 + 1.0D, var23, var15, var13); +- var9.addVertexWithUV(var21, var5 + 1.0D, var25, var11, var13); +- var9.addVertexWithUV(var21, var5 + 0.0D, var25, var11, var17); +- var9.addVertexWithUV(var21, var5 + 0.0D, var23, var15, var17); +- var9.addVertexWithUV(var21, var5 + 1.0D, var23, var15, var13); +- var9.addVertexWithUV(var21, var5 + 1.0D, var23, var11, var13); +- var9.addVertexWithUV(var21, var5 + 0.0D, var23, var11, var17); +- var9.addVertexWithUV(var21, var5 + 0.0D, var25, var15, var17); +- var9.addVertexWithUV(var21, var5 + 1.0D, var25, var15, var13); +- var19 = var3 + 0.5D - 0.5D; +- var21 = var3 + 0.5D + 0.5D; +- var23 = var7 + 0.5D - 0.25D; +- var25 = var7 + 0.5D + 0.25D; +- var9.addVertexWithUV(var19, var5 + 1.0D, var23, var11, var13); +- var9.addVertexWithUV(var19, var5 + 0.0D, var23, var11, var17); +- var9.addVertexWithUV(var21, var5 + 0.0D, var23, var15, var17); +- var9.addVertexWithUV(var21, var5 + 1.0D, var23, var15, var13); +- var9.addVertexWithUV(var21, var5 + 1.0D, var23, var11, var13); +- var9.addVertexWithUV(var21, var5 + 0.0D, var23, var11, var17); +- var9.addVertexWithUV(var19, var5 + 0.0D, var23, var15, var17); +- var9.addVertexWithUV(var19, var5 + 1.0D, var23, var15, var13); +- var9.addVertexWithUV(var21, var5 + 1.0D, var25, var11, var13); +- var9.addVertexWithUV(var21, var5 + 0.0D, var25, var11, var17); +- var9.addVertexWithUV(var19, var5 + 0.0D, var25, var15, var17); +- var9.addVertexWithUV(var19, var5 + 1.0D, var25, var15, var13); +- var9.addVertexWithUV(var19, var5 + 1.0D, var25, var11, var13); +- var9.addVertexWithUV(var19, var5 + 0.0D, var25, var11, var17); +- var9.addVertexWithUV(var21, var5 + 0.0D, var25, var15, var17); +- var9.addVertexWithUV(var21, var5 + 1.0D, var25, var15, var13); ++ double var19 = par3 + 0.5D - 0.25D; ++ double var21 = par3 + 0.5D + 0.25D; ++ double var23 = par7 + 0.5D - 0.5D; ++ double var25 = par7 + 0.5D + 0.5D; ++ var9.addVertexWithUV(var19, par5 + 1.0D, var23, var11, var13); ++ var9.addVertexWithUV(var19, par5 + 0.0D, var23, var11, var17); ++ var9.addVertexWithUV(var19, par5 + 0.0D, var25, var15, var17); ++ var9.addVertexWithUV(var19, par5 + 1.0D, var25, var15, var13); ++ var9.addVertexWithUV(var19, par5 + 1.0D, var25, var11, var13); ++ var9.addVertexWithUV(var19, par5 + 0.0D, var25, var11, var17); ++ var9.addVertexWithUV(var19, par5 + 0.0D, var23, var15, var17); ++ var9.addVertexWithUV(var19, par5 + 1.0D, var23, var15, var13); ++ var9.addVertexWithUV(var21, par5 + 1.0D, var25, var11, var13); ++ var9.addVertexWithUV(var21, par5 + 0.0D, var25, var11, var17); ++ var9.addVertexWithUV(var21, par5 + 0.0D, var23, var15, var17); ++ var9.addVertexWithUV(var21, par5 + 1.0D, var23, var15, var13); ++ var9.addVertexWithUV(var21, par5 + 1.0D, var23, var11, var13); ++ var9.addVertexWithUV(var21, par5 + 0.0D, var23, var11, var17); ++ var9.addVertexWithUV(var21, par5 + 0.0D, var25, var15, var17); ++ var9.addVertexWithUV(var21, par5 + 1.0D, var25, var15, var13); ++ var19 = par3 + 0.5D - 0.5D; ++ var21 = par3 + 0.5D + 0.5D; ++ var23 = par7 + 0.5D - 0.25D; ++ var25 = par7 + 0.5D + 0.25D; ++ var9.addVertexWithUV(var19, par5 + 1.0D, var23, var11, var13); ++ var9.addVertexWithUV(var19, par5 + 0.0D, var23, var11, var17); ++ var9.addVertexWithUV(var21, par5 + 0.0D, var23, var15, var17); ++ var9.addVertexWithUV(var21, par5 + 1.0D, var23, var15, var13); ++ var9.addVertexWithUV(var21, par5 + 1.0D, var23, var11, var13); ++ var9.addVertexWithUV(var21, par5 + 0.0D, var23, var11, var17); ++ var9.addVertexWithUV(var19, par5 + 0.0D, var23, var15, var17); ++ var9.addVertexWithUV(var19, par5 + 1.0D, var23, var15, var13); ++ var9.addVertexWithUV(var21, par5 + 1.0D, var25, var11, var13); ++ var9.addVertexWithUV(var21, par5 + 0.0D, var25, var11, var17); ++ var9.addVertexWithUV(var19, par5 + 0.0D, var25, var15, var17); ++ var9.addVertexWithUV(var19, par5 + 1.0D, var25, var15, var13); ++ var9.addVertexWithUV(var19, par5 + 1.0D, var25, var11, var13); ++ var9.addVertexWithUV(var19, par5 + 0.0D, var25, var11, var17); ++ var9.addVertexWithUV(var21, par5 + 0.0D, var25, var15, var17); ++ var9.addVertexWithUV(var21, par5 + 1.0D, var25, var15, var13); + } + +- public boolean renderBlockFluids(Block var1, int var2, int var3, int var4) { ++ /** ++ * Renders a block based on the BlockFluids class at the given coordinates ++ */ ++ public boolean renderBlockFluids(Block par1Block, int par2, int par3, int par4) { + Tessellator var5 = Tessellator.instance; +- int var6 = var1.colorMultiplier(this.blockAccess, var2, var3, var4); ++ int var6 = par1Block.colorMultiplier(this.blockAccess, par2, par3, par4); + float var7 = (float)(var6 >> 16 & 255) / 255.0F; + float var8 = (float)(var6 >> 8 & 255) / 255.0F; + float var9 = (float)(var6 & 255) / 255.0F; +- boolean var10 = var1.shouldSideBeRendered(this.blockAccess, var2, var3 + 1, var4, 1); +- boolean var11 = var1.shouldSideBeRendered(this.blockAccess, var2, var3 - 1, var4, 0); +- boolean[] var12 = new boolean[]{var1.shouldSideBeRendered(this.blockAccess, var2, var3, var4 - 1, 2), var1.shouldSideBeRendered(this.blockAccess, var2, var3, var4 + 1, 3), var1.shouldSideBeRendered(this.blockAccess, var2 - 1, var3, var4, 4), var1.shouldSideBeRendered(this.blockAccess, var2 + 1, var3, var4, 5)}; +- if(!var10 && !var11 && !var12[0] && !var12[1] && !var12[2] && !var12[3]) { ++ boolean var10 = RenderPass.shouldSideBeRendered(par1Block, this.blockAccess, par2, par3 + 1, par4, 1); ++ boolean var11 = RenderPass.shouldSideBeRendered(par1Block, this.blockAccess, par2, par3 - 1, par4, 0); ++ boolean[] var12 = new boolean[] {RenderPass.shouldSideBeRendered(par1Block, this.blockAccess, par2, par3, par4 - 1, 2), RenderPass.shouldSideBeRendered(par1Block, this.blockAccess, par2, par3, par4 + 1, 3), RenderPass.shouldSideBeRendered(par1Block, this.blockAccess, par2 - 1, par3, par4, 4), RenderPass.shouldSideBeRendered(par1Block, this.blockAccess, par2 + 1, par3, par4, 5)}; ++ ++ if (!var10 && !var11 && !var12[0] && !var12[1] && !var12[2] && !var12[3]) { + return false; + } else { + boolean var13 = false; +@@ -2994,37 +3593,40 @@ + float var17 = 0.6F; + double var18 = 0.0D; + double var20 = 1.0D; +- Material var22 = var1.blockMaterial; +- int var23 = this.blockAccess.getBlockMetadata(var2, var3, var4); +- double var24 = (double)this.getFluidHeight(var2, var3, var4, var22); +- double var26 = (double)this.getFluidHeight(var2, var3, var4 + 1, var22); +- double var28 = (double)this.getFluidHeight(var2 + 1, var3, var4 + 1, var22); +- double var30 = (double)this.getFluidHeight(var2 + 1, var3, var4, var22); +- double var32 = (double)0.001F; +- float var52; +- float var53; ++ Material var22 = par1Block.blockMaterial; ++ int var23 = this.blockAccess.getBlockMetadata(par2, par3, par4); ++ double var24 = (double)this.getFluidHeight(par2, par3, par4, var22); ++ double var26 = (double)this.getFluidHeight(par2, par3, par4 + 1, var22); ++ double var28 = (double)this.getFluidHeight(par2 + 1, par3, par4 + 1, var22); ++ double var30 = (double)this.getFluidHeight(par2 + 1, par3, par4, var22); ++ double var32 = 0.0010000000474974513D; + float var54; +- if(this.renderAllFaces || var10) { ++ float var53; ++ float var52; ++ ++ if (this.renderAllFaces || var10) { + var13 = true; +- Icon var34 = this.getBlockIconFromSideAndMetadata(var1, 1, var23); +- float var35 = (float)BlockFluid.getFlowDirection(this.blockAccess, var2, var3, var4, var22); +- if(var35 > -999.0F) { +- var34 = this.getBlockIconFromSideAndMetadata(var1, 2, var23); ++ Icon var34 = this.getBlockIconFromSideAndMetadata(par1Block, 1, var23); ++ float var35 = (float)BlockFluid.getFlowDirection(this.blockAccess, par2, par3, par4, var22); ++ ++ if (var35 > -999.0F) { ++ var34 = this.getBlockIconFromSideAndMetadata(par1Block, 2, var23); + } + + var24 -= var32; + var26 -= var32; + var28 -= var32; + var30 -= var32; +- double var36; + double var38; +- double var40; ++ double var36; + double var42; +- double var44; ++ double var40; + double var46; +- double var48; ++ double var44; + double var50; +- if(var35 < -999.0F) { ++ double var48; ++ ++ if (var35 < -999.0F) { + var36 = (double)var34.getInterpolatedU(0.0D); + var44 = (double)var34.getInterpolatedV(0.0D); + var38 = var36; +@@ -3047,78 +3649,81 @@ + var50 = (double)var34.getInterpolatedV((double)(8.0F + (-var53 - var52) * 16.0F)); + } + +- var5.setBrightness(var1.getMixedBrightnessForBlock(this.blockAccess, var2, var3, var4)); ++ var5.setBrightness(par1Block.getMixedBrightnessForBlock(this.blockAccess, par2, par3, par4)); + var52 = 1.0F; + var5.setColorOpaque_F(var15 * var52 * var7, var15 * var52 * var8, var15 * var52 * var9); +- var5.addVertexWithUV((double)(var2 + 0), (double)var3 + var24, (double)(var4 + 0), var36, var44); +- var5.addVertexWithUV((double)(var2 + 0), (double)var3 + var26, (double)(var4 + 1), var38, var46); +- var5.addVertexWithUV((double)(var2 + 1), (double)var3 + var28, (double)(var4 + 1), var40, var48); +- var5.addVertexWithUV((double)(var2 + 1), (double)var3 + var30, (double)(var4 + 0), var42, var50); ++ var5.addVertexWithUV((double)(par2 + 0), (double)par3 + var24, (double)(par4 + 0), var36, var44); ++ var5.addVertexWithUV((double)(par2 + 0), (double)par3 + var26, (double)(par4 + 1), var38, var46); ++ var5.addVertexWithUV((double)(par2 + 1), (double)par3 + var28, (double)(par4 + 1), var40, var48); ++ var5.addVertexWithUV((double)(par2 + 1), (double)par3 + var30, (double)(par4 + 0), var42, var50); + } + +- if(this.renderAllFaces || var11) { +- var5.setBrightness(var1.getMixedBrightnessForBlock(this.blockAccess, var2, var3 - 1, var4)); +- float var57 = 1.0F; +- var5.setColorOpaque_F(var14 * var57, var14 * var57, var14 * var57); +- this.renderFaceYNeg(var1, (double)var2, (double)var3 + var32, (double)var4, this.getBlockIconFromSide(var1, 0)); ++ if (this.renderAllFaces || var11) { ++ var5.setBrightness(par1Block.getMixedBrightnessForBlock(this.blockAccess, par2, par3 - 1, par4)); ++ float var58 = 1.0F; ++ var5.setColorOpaque_F(var14 * var58 * var7, var14 * var58 * var8, var14 * var58 * var9); ++ this.renderFaceYNeg(par1Block, (double)par2, (double)par3 + var32, (double)par4, this.getBlockIconFromSide(par1Block, 0)); + var13 = true; + } + +- for(int var59 = 0; var59 < 4; ++var59) { +- int var58 = var2; +- int var37 = var4; +- if(var59 == 0) { +- var37 = var4 - 1; ++ for (int var57 = 0; var57 < 4; ++var57) { ++ int var59 = par2; ++ int var37 = par4; ++ ++ if (var57 == 0) { ++ var37 = par4 - 1; + } + +- if(var59 == 1) { ++ if (var57 == 1) { + ++var37; + } + +- if(var59 == 2) { +- var58 = var2 - 1; +- } +- +- if(var59 == 3) { +- ++var58; +- } +- +- Icon var60 = this.getBlockIconFromSideAndMetadata(var1, var59 + 2, var23); +- if(this.renderAllFaces || var12[var59]) { ++ if (var57 == 2) { ++ var59 = par2 - 1; ++ } ++ ++ if (var57 == 3) { ++ ++var59; ++ } ++ ++ Icon var60 = this.getBlockIconFromSideAndMetadata(par1Block, var57 + 2, var23); ++ ++ if (this.renderAllFaces || var12[var57]) { + double var39; +- double var41; + double var43; +- double var45; ++ double var41; + double var47; ++ double var45; + double var49; +- if(var59 == 0) { ++ ++ if (var57 == 0) { + var39 = var24; + var41 = var30; +- var43 = (double)var2; +- var47 = (double)(var2 + 1); +- var45 = (double)var4 + var32; +- var49 = (double)var4 + var32; +- } else if(var59 == 1) { ++ var43 = (double)par2; ++ var47 = (double)(par2 + 1); ++ var45 = (double)par4 + var32; ++ var49 = (double)par4 + var32; ++ } else if (var57 == 1) { + var39 = var28; + var41 = var26; +- var43 = (double)(var2 + 1); +- var47 = (double)var2; +- var45 = (double)(var4 + 1) - var32; +- var49 = (double)(var4 + 1) - var32; +- } else if(var59 == 2) { ++ var43 = (double)(par2 + 1); ++ var47 = (double)par2; ++ var45 = (double)(par4 + 1) - var32; ++ var49 = (double)(par4 + 1) - var32; ++ } else if (var57 == 2) { + var39 = var26; + var41 = var24; +- var43 = (double)var2 + var32; +- var47 = (double)var2 + var32; +- var45 = (double)(var4 + 1); +- var49 = (double)var4; ++ var43 = (double)par2 + var32; ++ var47 = (double)par2 + var32; ++ var45 = (double)(par4 + 1); ++ var49 = (double)par4; + } else { + var39 = var30; + var41 = var28; +- var43 = (double)(var2 + 1) - var32; +- var47 = (double)(var2 + 1) - var32; +- var45 = (double)var4; +- var49 = (double)(var4 + 1); ++ var43 = (double)(par2 + 1) - var32; ++ var47 = (double)(par2 + 1) - var32; ++ var45 = (double)par4; ++ var49 = (double)(par4 + 1); + } + + var13 = true; +@@ -3127,19 +3732,20 @@ + var53 = var60.getInterpolatedV((1.0D - var39) * 16.0D * 0.5D); + var54 = var60.getInterpolatedV((1.0D - var41) * 16.0D * 0.5D); + float var55 = var60.getInterpolatedV(8.0D); +- var5.setBrightness(var1.getMixedBrightnessForBlock(this.blockAccess, var58, var3, var37)); ++ var5.setBrightness(par1Block.getMixedBrightnessForBlock(this.blockAccess, var59, par3, var37)); + float var56 = 1.0F; +- if(var59 < 2) { ++ ++ if (var57 < 2) { + var56 *= var16; + } else { + var56 *= var17; + } + + var5.setColorOpaque_F(var15 * var56 * var7, var15 * var56 * var8, var15 * var56 * var9); +- var5.addVertexWithUV(var43, (double)var3 + var39, var45, (double)var51, (double)var53); +- var5.addVertexWithUV(var47, (double)var3 + var41, var49, (double)var52, (double)var54); +- var5.addVertexWithUV(var47, (double)(var3 + 0), var49, (double)var52, (double)var55); +- var5.addVertexWithUV(var43, (double)(var3 + 0), var45, (double)var51, (double)var55); ++ var5.addVertexWithUV(var43, (double)par3 + var39, var45, (double)var51, (double)var53); ++ var5.addVertexWithUV(var47, (double)par3 + var41, var49, (double)var52, (double)var54); ++ var5.addVertexWithUV(var47, (double)(par3 + 0), var49, (double)var52, (double)var55); ++ var5.addVertexWithUV(var43, (double)(par3 + 0), var45, (double)var51, (double)var55); + } + } + +@@ -3149,98 +3755,116 @@ + } + } + +- private float getFluidHeight(int var1, int var2, int var3, Material var4) { ++ /** ++ * Get fluid height ++ */ ++ private float getFluidHeight(int par1, int par2, int par3, Material par4Material) { + int var5 = 0; + float var6 = 0.0F; + +- for(int var7 = 0; var7 < 4; ++var7) { +- int var8 = var1 - (var7 & 1); +- int var10 = var3 - (var7 >> 1 & 1); +- if(this.blockAccess.getBlockMaterial(var8, var2 + 1, var10) == var4) { ++ for (int var7 = 0; var7 < 4; ++var7) { ++ int var8 = par1 - (var7 & 1); ++ int var10 = par3 - (var7 >> 1 & 1); ++ ++ if (this.blockAccess.getBlockMaterial(var8, par2 + 1, var10) == par4Material) { + return 1.0F; + } + +- Material var11 = this.blockAccess.getBlockMaterial(var8, var2, var10); +- if(var11 != var4) { +- if(!var11.isSolid()) { +- ++var6; +- ++var5; +- } +- } else { +- int var12 = this.blockAccess.getBlockMetadata(var8, var2, var10); +- if(var12 >= 8 || var12 == 0) { ++ Material var11 = this.blockAccess.getBlockMaterial(var8, par2, var10); ++ ++ if (var11 == par4Material) { ++ int var12 = this.blockAccess.getBlockMetadata(var8, par2, var10); ++ ++ if (var12 >= 8 || var12 == 0) { + var6 += BlockFluid.getFluidHeightPercent(var12) * 10.0F; + var5 += 10; + } + + var6 += BlockFluid.getFluidHeightPercent(var12); + ++var5; ++ } else if (!var11.isSolid()) { ++ ++var6; ++ ++var5; + } + } + + return 1.0F - var6 / (float)var5; + } + +- public void renderBlockSandFalling(Block var1, World var2, int var3, int var4, int var5, int var6) { ++ /** ++ * Renders a falling sand block ++ */ ++ public void renderBlockSandFalling(Block par1Block, World par2World, int par3, int par4, int par5, int par6) { + float var7 = 0.5F; + float var8 = 1.0F; + float var9 = 0.8F; + float var10 = 0.6F; + Tessellator var11 = Tessellator.instance; + var11.startDrawingQuads(); +- var11.setBrightness(var1.getMixedBrightnessForBlock(var2, var3, var4, var5)); ++ var11.setBrightness(par1Block.getMixedBrightnessForBlock(par2World, par3, par4, par5)); + float var12 = 1.0F; + float var13 = 1.0F; +- if(var13 < var12) { +- var13 = var12; +- } +- +- var11.setColorOpaque_F(var7 * var13, var7 * var13, var7 * var13); +- this.renderFaceYNeg(var1, -0.5D, -0.5D, -0.5D, this.getBlockIconFromSideAndMetadata(var1, 0, var6)); +- var13 = 1.0F; +- if(var13 < var12) { +- var13 = var12; +- } +- +- var11.setColorOpaque_F(var8 * var13, var8 * var13, var8 * var13); +- this.renderFaceYPos(var1, -0.5D, -0.5D, -0.5D, this.getBlockIconFromSideAndMetadata(var1, 1, var6)); +- var13 = 1.0F; +- if(var13 < var12) { +- var13 = var12; +- } +- +- var11.setColorOpaque_F(var9 * var13, var9 * var13, var9 * var13); +- this.renderFaceZNeg(var1, -0.5D, -0.5D, -0.5D, this.getBlockIconFromSideAndMetadata(var1, 2, var6)); +- var13 = 1.0F; +- if(var13 < var12) { +- var13 = var12; +- } +- +- var11.setColorOpaque_F(var9 * var13, var9 * var13, var9 * var13); +- this.renderFaceZPos(var1, -0.5D, -0.5D, -0.5D, this.getBlockIconFromSideAndMetadata(var1, 3, var6)); +- var13 = 1.0F; +- if(var13 < var12) { +- var13 = var12; +- } +- +- var11.setColorOpaque_F(var10 * var13, var10 * var13, var10 * var13); +- this.renderFaceXNeg(var1, -0.5D, -0.5D, -0.5D, this.getBlockIconFromSideAndMetadata(var1, 4, var6)); +- var13 = 1.0F; +- if(var13 < var12) { +- var13 = var12; +- } +- +- var11.setColorOpaque_F(var10 * var13, var10 * var13, var10 * var13); +- this.renderFaceXPos(var1, -0.5D, -0.5D, -0.5D, this.getBlockIconFromSideAndMetadata(var1, 5, var6)); ++ ++ if (var13 < var12) { ++ var13 = var12; ++ } ++ ++ Colorizer.setColorF(ColorizeBlock.colorizeBlock(par1Block, par3, par4, par5, 0)); ++ var11.setColorOpaque_F(Colorizer.setColor[0] * var13, Colorizer.setColor[1] * var13, Colorizer.setColor[2] * var13); ++ this.renderFaceYNeg(par1Block, -0.5D, -0.5D, -0.5D, this.getBlockIconFromSideAndMetadata(par1Block, 0, par6)); ++ var13 = 1.0F; ++ ++ if (var13 < var12) { ++ var13 = var12; ++ } ++ ++ var11.setColorOpaque_F(Colorizer.setColor[0] * var13, Colorizer.setColor[1] * var13, Colorizer.setColor[2] * var13); ++ this.renderFaceYPos(par1Block, -0.5D, -0.5D, -0.5D, this.getBlockIconFromSideAndMetadata(par1Block, 1, par6)); ++ var13 = 1.0F; ++ ++ if (var13 < var12) { ++ var13 = var12; ++ } ++ ++ var11.setColorOpaque_F(Colorizer.setColor[0] * var13, Colorizer.setColor[1] * var13, Colorizer.setColor[2] * var13); ++ this.renderFaceZNeg(par1Block, -0.5D, -0.5D, -0.5D, this.getBlockIconFromSideAndMetadata(par1Block, 2, par6)); ++ var13 = 1.0F; ++ ++ if (var13 < var12) { ++ var13 = var12; ++ } ++ ++ var11.setColorOpaque_F(Colorizer.setColor[0] * var13, Colorizer.setColor[1] * var13, Colorizer.setColor[2] * var13); ++ this.renderFaceZPos(par1Block, -0.5D, -0.5D, -0.5D, this.getBlockIconFromSideAndMetadata(par1Block, 3, par6)); ++ var13 = 1.0F; ++ ++ if (var13 < var12) { ++ var13 = var12; ++ } ++ ++ var11.setColorOpaque_F(Colorizer.setColor[0] * var13, Colorizer.setColor[1] * var13, Colorizer.setColor[2] * var13); ++ this.renderFaceXNeg(par1Block, -0.5D, -0.5D, -0.5D, this.getBlockIconFromSideAndMetadata(par1Block, 4, par6)); ++ var13 = 1.0F; ++ ++ if (var13 < var12) { ++ var13 = var12; ++ } ++ ++ var11.setColorOpaque_F(Colorizer.setColor[0] * var13, Colorizer.setColor[1] * var13, Colorizer.setColor[2] * var13); ++ this.renderFaceXPos(par1Block, -0.5D, -0.5D, -0.5D, this.getBlockIconFromSideAndMetadata(par1Block, 5, par6)); + var11.draw(); + } + +- public boolean renderStandardBlock(Block var1, int var2, int var3, int var4) { +- int var5 = var1.colorMultiplier(this.blockAccess, var2, var3, var4); ++ /** ++ * Renders a standard cube block at the given coordinates ++ */ ++ public boolean renderStandardBlock(Block par1Block, int par2, int par3, int par4) { ++ int var5 = par1Block.colorMultiplier(this.blockAccess, par2, par3, par4); + float var6 = (float)(var5 >> 16 & 255) / 255.0F; + float var7 = (float)(var5 >> 8 & 255) / 255.0F; + float var8 = (float)(var5 & 255) / 255.0F; +- if(EntityRenderer.anaglyphEnable) { ++ ++ if (EntityRenderer.anaglyphEnable) { + float var9 = (var6 * 30.0F + var7 * 59.0F + var8 * 11.0F) / 100.0F; + float var10 = (var6 * 30.0F + var7 * 70.0F) / 100.0F; + float var11 = (var6 * 30.0F + var8 * 70.0F) / 100.0F; +@@ -3249,23 +3873,29 @@ + var8 = var11; + } + +- return Minecraft.isAmbientOcclusionEnabled() && Block.lightValue[var1.blockID] == 0 ? (this.partialRenderBounds ? this.renderStandardBlockWithAmbientOcclusionPartial(var1, var2, var3, var4, var6, var7, var8) : this.renderStandardBlockWithAmbientOcclusion(var1, var2, var3, var4, var6, var7, var8)) : this.renderStandardBlockWithColorMultiplier(var1, var2, var3, var4, var6, var7, var8); ++ // Spout Start ++ return Configuration.ambientOcclusion && Block.lightValue[par1Block.blockID] == 0 ? (this.partialRenderBounds ? this.renderStandardBlockWithAmbientOcclusionPartial(par1Block, par2, par3, par4, var6, var7, var8) : this.renderStandardBlockWithAmbientOcclusion(par1Block, par2, par3, par4, var6, var7, var8)) : this.renderStandardBlockWithColorMultiplier(par1Block, par2, par3, par4, var6, var7, var8); ++ // Spout End + } + +- public boolean renderBlockLog(Block var1, int var2, int var3, int var4) { +- int var5 = this.blockAccess.getBlockMetadata(var2, var3, var4); ++ /** ++ * Renders a log block at the given coordinates ++ */ ++ public boolean renderBlockLog(Block par1Block, int par2, int par3, int par4) { ++ int var5 = this.blockAccess.getBlockMetadata(par2, par3, par4); + int var6 = var5 & 12; +- if(var6 == 4) { ++ ++ if (var6 == 4) { + this.uvRotateEast = 1; + this.uvRotateWest = 1; + this.uvRotateTop = 1; + this.uvRotateBottom = 1; +- } else if(var6 == 8) { ++ } else if (var6 == 8) { + this.uvRotateSouth = 1; + this.uvRotateNorth = 1; + } + +- boolean var7 = this.renderStandardBlock(var1, var2, var3, var4); ++ boolean var7 = this.renderStandardBlock(par1Block, par2, par3, par4); + this.uvRotateSouth = 0; + this.uvRotateEast = 0; + this.uvRotateWest = 0; +@@ -3275,19 +3905,20 @@ + return var7; + } + +- public boolean renderBlockQuartz(Block var1, int var2, int var3, int var4) { +- int var5 = this.blockAccess.getBlockMetadata(var2, var3, var4); +- if(var5 == 3) { ++ public boolean renderBlockQuartz(Block par1Block, int par2, int par3, int par4) { ++ int var5 = this.blockAccess.getBlockMetadata(par2, par3, par4); ++ ++ if (var5 == 3) { + this.uvRotateEast = 1; + this.uvRotateWest = 1; + this.uvRotateTop = 1; + this.uvRotateBottom = 1; +- } else if(var5 == 4) { ++ } else if (var5 == 4) { + this.uvRotateSouth = 1; + this.uvRotateNorth = 1; + } + +- boolean var6 = this.renderStandardBlock(var1, var2, var3, var4); ++ boolean var6 = this.renderStandardBlock(par1Block, par2, par3, par4); + this.uvRotateSouth = 0; + this.uvRotateEast = 0; + this.uvRotateWest = 0; +@@ -3297,7 +3928,7 @@ + return var6; + } + +- public boolean renderStandardBlockWithAmbientOcclusion(Block var1, int var2, int var3, int var4, float var5, float var6, float var7) { ++ public boolean renderStandardBlockWithAmbientOcclusion(Block par1Block, int par2, int par3, int par4, float par5, float par6, float par7) { + this.enableAO = true; + boolean var8 = false; + float var9 = 0.0F; +@@ -3305,80 +3936,84 @@ + float var11 = 0.0F; + float var12 = 0.0F; + boolean var13 = true; +- int var14 = var1.getMixedBrightnessForBlock(this.blockAccess, var2, var3, var4); ++ int var14 = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2, par3, par4); + Tessellator var15 = Tessellator.instance; + var15.setBrightness(983055); +- if(this.getBlockIcon(var1).getIconName().equals("grass_top")) { ++ ++ if (this.getBlockIcon(par1Block).getIconName().equals("grass_top")) { + var13 = false; +- } else if(this.hasOverrideBlockTexture()) { ++ } else if (this.hasOverrideBlockTexture()) { + var13 = false; + } + +- boolean var16; + boolean var17; +- boolean var18; ++ boolean var16; + boolean var19; +- int var20; ++ boolean var18; + float var21; +- if(this.renderAllFaces || var1.shouldSideBeRendered(this.blockAccess, var2, var3 - 1, var4, 0)) { +- if(this.renderMinY <= 0.0D) { +- --var3; ++ int var20; ++ ++ if (this.renderAllFaces || RenderPass.shouldSideBeRendered(par1Block, this.blockAccess, par2, par3 - 1, par4, 0)) { ++ if (this.renderMinY <= 0.0D) { ++ --par3; + } + +- this.aoBrightnessXYNN = var1.getMixedBrightnessForBlock(this.blockAccess, var2 - 1, var3, var4); +- this.aoBrightnessYZNN = var1.getMixedBrightnessForBlock(this.blockAccess, var2, var3, var4 - 1); +- this.aoBrightnessYZNP = var1.getMixedBrightnessForBlock(this.blockAccess, var2, var3, var4 + 1); +- this.aoBrightnessXYPN = var1.getMixedBrightnessForBlock(this.blockAccess, var2 + 1, var3, var4); +- this.aoLightValueScratchXYNN = var1.getAmbientOcclusionLightValue(this.blockAccess, var2 - 1, var3, var4); +- this.aoLightValueScratchYZNN = var1.getAmbientOcclusionLightValue(this.blockAccess, var2, var3, var4 - 1); +- this.aoLightValueScratchYZNP = var1.getAmbientOcclusionLightValue(this.blockAccess, var2, var3, var4 + 1); +- this.aoLightValueScratchXYPN = var1.getAmbientOcclusionLightValue(this.blockAccess, var2 + 1, var3, var4); +- var16 = Block.canBlockGrass[this.blockAccess.getBlockId(var2 + 1, var3 - 1, var4)]; +- var17 = Block.canBlockGrass[this.blockAccess.getBlockId(var2 - 1, var3 - 1, var4)]; +- var18 = Block.canBlockGrass[this.blockAccess.getBlockId(var2, var3 - 1, var4 + 1)]; +- var19 = Block.canBlockGrass[this.blockAccess.getBlockId(var2, var3 - 1, var4 - 1)]; +- if(!var19 && !var17) { ++ this.aoBrightnessXYNN = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2 - 1, par3, par4); ++ this.aoBrightnessYZNN = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2, par3, par4 - 1); ++ this.aoBrightnessYZNP = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2, par3, par4 + 1); ++ this.aoBrightnessXYPN = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2 + 1, par3, par4); ++ this.aoLightValueScratchXYNN = par1Block.getAmbientOcclusionLightValue(this.blockAccess, par2 - 1, par3, par4); ++ this.aoLightValueScratchYZNN = par1Block.getAmbientOcclusionLightValue(this.blockAccess, par2, par3, par4 - 1); ++ this.aoLightValueScratchYZNP = par1Block.getAmbientOcclusionLightValue(this.blockAccess, par2, par3, par4 + 1); ++ this.aoLightValueScratchXYPN = par1Block.getAmbientOcclusionLightValue(this.blockAccess, par2 + 1, par3, par4); ++ var16 = Block.canBlockGrass[this.blockAccess.getBlockId(par2 + 1, par3 - 1, par4)]; ++ var17 = Block.canBlockGrass[this.blockAccess.getBlockId(par2 - 1, par3 - 1, par4)]; ++ var18 = Block.canBlockGrass[this.blockAccess.getBlockId(par2, par3 - 1, par4 + 1)]; ++ var19 = Block.canBlockGrass[this.blockAccess.getBlockId(par2, par3 - 1, par4 - 1)]; ++ ++ if (!var19 && !var17) { + this.aoLightValueScratchXYZNNN = this.aoLightValueScratchXYNN; + this.aoBrightnessXYZNNN = this.aoBrightnessXYNN; + } else { +- this.aoLightValueScratchXYZNNN = var1.getAmbientOcclusionLightValue(this.blockAccess, var2 - 1, var3, var4 - 1); +- this.aoBrightnessXYZNNN = var1.getMixedBrightnessForBlock(this.blockAccess, var2 - 1, var3, var4 - 1); ++ this.aoLightValueScratchXYZNNN = par1Block.getAmbientOcclusionLightValue(this.blockAccess, par2 - 1, par3, par4 - 1); ++ this.aoBrightnessXYZNNN = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2 - 1, par3, par4 - 1); + } + +- if(!var18 && !var17) { ++ if (!var18 && !var17) { + this.aoLightValueScratchXYZNNP = this.aoLightValueScratchXYNN; + this.aoBrightnessXYZNNP = this.aoBrightnessXYNN; + } else { +- this.aoLightValueScratchXYZNNP = var1.getAmbientOcclusionLightValue(this.blockAccess, var2 - 1, var3, var4 + 1); +- this.aoBrightnessXYZNNP = var1.getMixedBrightnessForBlock(this.blockAccess, var2 - 1, var3, var4 + 1); ++ this.aoLightValueScratchXYZNNP = par1Block.getAmbientOcclusionLightValue(this.blockAccess, par2 - 1, par3, par4 + 1); ++ this.aoBrightnessXYZNNP = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2 - 1, par3, par4 + 1); + } + +- if(!var19 && !var16) { ++ if (!var19 && !var16) { + this.aoLightValueScratchXYZPNN = this.aoLightValueScratchXYPN; + this.aoBrightnessXYZPNN = this.aoBrightnessXYPN; + } else { +- this.aoLightValueScratchXYZPNN = var1.getAmbientOcclusionLightValue(this.blockAccess, var2 + 1, var3, var4 - 1); +- this.aoBrightnessXYZPNN = var1.getMixedBrightnessForBlock(this.blockAccess, var2 + 1, var3, var4 - 1); ++ this.aoLightValueScratchXYZPNN = par1Block.getAmbientOcclusionLightValue(this.blockAccess, par2 + 1, par3, par4 - 1); ++ this.aoBrightnessXYZPNN = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2 + 1, par3, par4 - 1); + } + +- if(!var18 && !var16) { ++ if (!var18 && !var16) { + this.aoLightValueScratchXYZPNP = this.aoLightValueScratchXYPN; + this.aoBrightnessXYZPNP = this.aoBrightnessXYPN; + } else { +- this.aoLightValueScratchXYZPNP = var1.getAmbientOcclusionLightValue(this.blockAccess, var2 + 1, var3, var4 + 1); +- this.aoBrightnessXYZPNP = var1.getMixedBrightnessForBlock(this.blockAccess, var2 + 1, var3, var4 + 1); ++ this.aoLightValueScratchXYZPNP = par1Block.getAmbientOcclusionLightValue(this.blockAccess, par2 + 1, par3, par4 + 1); ++ this.aoBrightnessXYZPNP = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2 + 1, par3, par4 + 1); + } + +- if(this.renderMinY <= 0.0D) { +- ++var3; ++ if (this.renderMinY <= 0.0D) { ++ ++par3; + } + + var20 = var14; +- if(this.renderMinY <= 0.0D || !this.blockAccess.isBlockOpaqueCube(var2, var3 - 1, var4)) { +- var20 = var1.getMixedBrightnessForBlock(this.blockAccess, var2, var3 - 1, var4); ++ ++ if (this.renderMinY <= 0.0D || !this.blockAccess.isBlockOpaqueCube(par2, par3 - 1, par4)) { ++ var20 = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2, par3 - 1, par4); + } + +- var21 = var1.getAmbientOcclusionLightValue(this.blockAccess, var2, var3 - 1, var4); ++ var21 = par1Block.getAmbientOcclusionLightValue(this.blockAccess, par2, par3 - 1, par4); + var9 = (this.aoLightValueScratchXYZNNP + this.aoLightValueScratchXYNN + this.aoLightValueScratchYZNP + var21) / 4.0F; + var12 = (this.aoLightValueScratchYZNP + var21 + this.aoLightValueScratchXYZPNP + this.aoLightValueScratchXYPN) / 4.0F; + var11 = (var21 + this.aoLightValueScratchYZNN + this.aoLightValueScratchXYPN + this.aoLightValueScratchXYZPNN) / 4.0F; +@@ -3387,14 +4022,15 @@ + this.brightnessTopRight = this.getAoBrightness(this.aoBrightnessYZNP, this.aoBrightnessXYZPNP, this.aoBrightnessXYPN, var20); + this.brightnessBottomRight = this.getAoBrightness(this.aoBrightnessYZNN, this.aoBrightnessXYPN, this.aoBrightnessXYZPNN, var20); + this.brightnessBottomLeft = this.getAoBrightness(this.aoBrightnessXYNN, this.aoBrightnessXYZNNN, this.aoBrightnessYZNN, var20); +- if(var13) { +- this.colorRedTopLeft = this.colorRedBottomLeft = this.colorRedBottomRight = this.colorRedTopRight = var5 * 0.5F; +- this.colorGreenTopLeft = this.colorGreenBottomLeft = this.colorGreenBottomRight = this.colorGreenTopRight = var6 * 0.5F; +- this.colorBlueTopLeft = this.colorBlueBottomLeft = this.colorBlueBottomRight = this.colorBlueTopRight = var7 * 0.5F; ++ ++ if (var13) { ++ this.colorRedTopLeft = this.colorRedBottomLeft = this.colorRedBottomRight = this.colorRedTopRight = par5 * RenderPass.getAOBaseMultiplier(0.5F); ++ this.colorGreenTopLeft = this.colorGreenBottomLeft = this.colorGreenBottomRight = this.colorGreenTopRight = par6 * RenderPass.getAOBaseMultiplier(0.5F); ++ this.colorBlueTopLeft = this.colorBlueBottomLeft = this.colorBlueBottomRight = this.colorBlueTopRight = par7 * RenderPass.getAOBaseMultiplier(0.5F); + } else { +- this.colorRedTopLeft = this.colorRedBottomLeft = this.colorRedBottomRight = this.colorRedTopRight = 0.5F; +- this.colorGreenTopLeft = this.colorGreenBottomLeft = this.colorGreenBottomRight = this.colorGreenTopRight = 0.5F; +- this.colorBlueTopLeft = this.colorBlueBottomLeft = this.colorBlueBottomRight = this.colorBlueTopRight = 0.5F; ++ this.colorRedTopLeft = this.colorRedBottomLeft = this.colorRedBottomRight = this.colorRedTopRight = RenderPass.getAOBaseMultiplier(0.5F); ++ this.colorGreenTopLeft = this.colorGreenBottomLeft = this.colorGreenBottomRight = this.colorGreenTopRight = RenderPass.getAOBaseMultiplier(0.5F); ++ this.colorBlueTopLeft = this.colorBlueBottomLeft = this.colorBlueBottomRight = this.colorBlueTopRight = RenderPass.getAOBaseMultiplier(0.5F); + } + + this.colorRedTopLeft *= var9; +@@ -3409,69 +4045,71 @@ + this.colorRedTopRight *= var12; + this.colorGreenTopRight *= var12; + this.colorBlueTopRight *= var12; +- this.renderFaceYNeg(var1, (double)var2, (double)var3, (double)var4, this.getBlockIcon(var1, this.blockAccess, var2, var3, var4, 0)); ++ this.renderFaceYNeg(par1Block, (double)par2, (double)par3, (double)par4, this.getBlockIcon(par1Block, this.blockAccess, par2, par3, par4, 0)); + var8 = true; + } + +- if(this.renderAllFaces || var1.shouldSideBeRendered(this.blockAccess, var2, var3 + 1, var4, 1)) { +- if(this.renderMaxY >= 1.0D) { +- ++var3; ++ if (this.renderAllFaces || RenderPass.shouldSideBeRendered(par1Block, this.blockAccess, par2, par3 + 1, par4, 1)) { ++ if (this.renderMaxY >= 1.0D) { ++ ++par3; + } + +- this.aoBrightnessXYNP = var1.getMixedBrightnessForBlock(this.blockAccess, var2 - 1, var3, var4); +- this.aoBrightnessXYPP = var1.getMixedBrightnessForBlock(this.blockAccess, var2 + 1, var3, var4); +- this.aoBrightnessYZPN = var1.getMixedBrightnessForBlock(this.blockAccess, var2, var3, var4 - 1); +- this.aoBrightnessYZPP = var1.getMixedBrightnessForBlock(this.blockAccess, var2, var3, var4 + 1); +- this.aoLightValueScratchXYNP = var1.getAmbientOcclusionLightValue(this.blockAccess, var2 - 1, var3, var4); +- this.aoLightValueScratchXYPP = var1.getAmbientOcclusionLightValue(this.blockAccess, var2 + 1, var3, var4); +- this.aoLightValueScratchYZPN = var1.getAmbientOcclusionLightValue(this.blockAccess, var2, var3, var4 - 1); +- this.aoLightValueScratchYZPP = var1.getAmbientOcclusionLightValue(this.blockAccess, var2, var3, var4 + 1); +- var16 = Block.canBlockGrass[this.blockAccess.getBlockId(var2 + 1, var3 + 1, var4)]; +- var17 = Block.canBlockGrass[this.blockAccess.getBlockId(var2 - 1, var3 + 1, var4)]; +- var18 = Block.canBlockGrass[this.blockAccess.getBlockId(var2, var3 + 1, var4 + 1)]; +- var19 = Block.canBlockGrass[this.blockAccess.getBlockId(var2, var3 + 1, var4 - 1)]; +- if(!var19 && !var17) { ++ this.aoBrightnessXYNP = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2 - 1, par3, par4); ++ this.aoBrightnessXYPP = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2 + 1, par3, par4); ++ this.aoBrightnessYZPN = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2, par3, par4 - 1); ++ this.aoBrightnessYZPP = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2, par3, par4 + 1); ++ this.aoLightValueScratchXYNP = par1Block.getAmbientOcclusionLightValue(this.blockAccess, par2 - 1, par3, par4); ++ this.aoLightValueScratchXYPP = par1Block.getAmbientOcclusionLightValue(this.blockAccess, par2 + 1, par3, par4); ++ this.aoLightValueScratchYZPN = par1Block.getAmbientOcclusionLightValue(this.blockAccess, par2, par3, par4 - 1); ++ this.aoLightValueScratchYZPP = par1Block.getAmbientOcclusionLightValue(this.blockAccess, par2, par3, par4 + 1); ++ var16 = Block.canBlockGrass[this.blockAccess.getBlockId(par2 + 1, par3 + 1, par4)]; ++ var17 = Block.canBlockGrass[this.blockAccess.getBlockId(par2 - 1, par3 + 1, par4)]; ++ var18 = Block.canBlockGrass[this.blockAccess.getBlockId(par2, par3 + 1, par4 + 1)]; ++ var19 = Block.canBlockGrass[this.blockAccess.getBlockId(par2, par3 + 1, par4 - 1)]; ++ ++ if (!var19 && !var17) { + this.aoLightValueScratchXYZNPN = this.aoLightValueScratchXYNP; + this.aoBrightnessXYZNPN = this.aoBrightnessXYNP; + } else { +- this.aoLightValueScratchXYZNPN = var1.getAmbientOcclusionLightValue(this.blockAccess, var2 - 1, var3, var4 - 1); +- this.aoBrightnessXYZNPN = var1.getMixedBrightnessForBlock(this.blockAccess, var2 - 1, var3, var4 - 1); ++ this.aoLightValueScratchXYZNPN = par1Block.getAmbientOcclusionLightValue(this.blockAccess, par2 - 1, par3, par4 - 1); ++ this.aoBrightnessXYZNPN = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2 - 1, par3, par4 - 1); + } + +- if(!var19 && !var16) { ++ if (!var19 && !var16) { + this.aoLightValueScratchXYZPPN = this.aoLightValueScratchXYPP; + this.aoBrightnessXYZPPN = this.aoBrightnessXYPP; + } else { +- this.aoLightValueScratchXYZPPN = var1.getAmbientOcclusionLightValue(this.blockAccess, var2 + 1, var3, var4 - 1); +- this.aoBrightnessXYZPPN = var1.getMixedBrightnessForBlock(this.blockAccess, var2 + 1, var3, var4 - 1); ++ this.aoLightValueScratchXYZPPN = par1Block.getAmbientOcclusionLightValue(this.blockAccess, par2 + 1, par3, par4 - 1); ++ this.aoBrightnessXYZPPN = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2 + 1, par3, par4 - 1); + } + +- if(!var18 && !var17) { ++ if (!var18 && !var17) { + this.aoLightValueScratchXYZNPP = this.aoLightValueScratchXYNP; + this.aoBrightnessXYZNPP = this.aoBrightnessXYNP; + } else { +- this.aoLightValueScratchXYZNPP = var1.getAmbientOcclusionLightValue(this.blockAccess, var2 - 1, var3, var4 + 1); +- this.aoBrightnessXYZNPP = var1.getMixedBrightnessForBlock(this.blockAccess, var2 - 1, var3, var4 + 1); ++ this.aoLightValueScratchXYZNPP = par1Block.getAmbientOcclusionLightValue(this.blockAccess, par2 - 1, par3, par4 + 1); ++ this.aoBrightnessXYZNPP = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2 - 1, par3, par4 + 1); + } + +- if(!var18 && !var16) { ++ if (!var18 && !var16) { + this.aoLightValueScratchXYZPPP = this.aoLightValueScratchXYPP; + this.aoBrightnessXYZPPP = this.aoBrightnessXYPP; + } else { +- this.aoLightValueScratchXYZPPP = var1.getAmbientOcclusionLightValue(this.blockAccess, var2 + 1, var3, var4 + 1); +- this.aoBrightnessXYZPPP = var1.getMixedBrightnessForBlock(this.blockAccess, var2 + 1, var3, var4 + 1); ++ this.aoLightValueScratchXYZPPP = par1Block.getAmbientOcclusionLightValue(this.blockAccess, par2 + 1, par3, par4 + 1); ++ this.aoBrightnessXYZPPP = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2 + 1, par3, par4 + 1); + } + +- if(this.renderMaxY >= 1.0D) { +- --var3; ++ if (this.renderMaxY >= 1.0D) { ++ --par3; + } + + var20 = var14; +- if(this.renderMaxY >= 1.0D || !this.blockAccess.isBlockOpaqueCube(var2, var3 + 1, var4)) { +- var20 = var1.getMixedBrightnessForBlock(this.blockAccess, var2, var3 + 1, var4); ++ ++ if (this.renderMaxY >= 1.0D || !this.blockAccess.isBlockOpaqueCube(par2, par3 + 1, par4)) { ++ var20 = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2, par3 + 1, par4); + } + +- var21 = var1.getAmbientOcclusionLightValue(this.blockAccess, var2, var3 + 1, var4); ++ var21 = par1Block.getAmbientOcclusionLightValue(this.blockAccess, par2, par3 + 1, par4); + var12 = (this.aoLightValueScratchXYZNPP + this.aoLightValueScratchXYNP + this.aoLightValueScratchYZPP + var21) / 4.0F; + var9 = (this.aoLightValueScratchYZPP + var21 + this.aoLightValueScratchXYZPPP + this.aoLightValueScratchXYPP) / 4.0F; + var10 = (var21 + this.aoLightValueScratchYZPN + this.aoLightValueScratchXYPP + this.aoLightValueScratchXYZPPN) / 4.0F; +@@ -3480,9 +4118,9 @@ + this.brightnessTopLeft = this.getAoBrightness(this.aoBrightnessYZPP, this.aoBrightnessXYZPPP, this.aoBrightnessXYPP, var20); + this.brightnessBottomLeft = this.getAoBrightness(this.aoBrightnessYZPN, this.aoBrightnessXYPP, this.aoBrightnessXYZPPN, var20); + this.brightnessBottomRight = this.getAoBrightness(this.aoBrightnessXYNP, this.aoBrightnessXYZNPN, this.aoBrightnessYZPN, var20); +- this.colorRedTopLeft = this.colorRedBottomLeft = this.colorRedBottomRight = this.colorRedTopRight = var5; +- this.colorGreenTopLeft = this.colorGreenBottomLeft = this.colorGreenBottomRight = this.colorGreenTopRight = var6; +- this.colorBlueTopLeft = this.colorBlueBottomLeft = this.colorBlueBottomRight = this.colorBlueTopRight = var7; ++ this.colorRedTopLeft = this.colorRedBottomLeft = this.colorRedBottomRight = this.colorRedTopRight = par5; ++ this.colorGreenTopLeft = this.colorGreenBottomLeft = this.colorGreenBottomRight = this.colorGreenTopRight = par6; ++ this.colorBlueTopLeft = this.colorBlueBottomLeft = this.colorBlueBottomRight = this.colorBlueTopRight = par7; + this.colorRedTopLeft *= var9; + this.colorGreenTopLeft *= var9; + this.colorBlueTopLeft *= var9; +@@ -3495,70 +4133,73 @@ + this.colorRedTopRight *= var12; + this.colorGreenTopRight *= var12; + this.colorBlueTopRight *= var12; +- this.renderFaceYPos(var1, (double)var2, (double)var3, (double)var4, this.getBlockIcon(var1, this.blockAccess, var2, var3, var4, 1)); ++ this.renderFaceYPos(par1Block, (double)par2, (double)par3, (double)par4, this.getBlockIcon(par1Block, this.blockAccess, par2, par3, par4, 1)); + var8 = true; + } + + Icon var22; +- if(this.renderAllFaces || var1.shouldSideBeRendered(this.blockAccess, var2, var3, var4 - 1, 2)) { +- if(this.renderMinZ <= 0.0D) { +- --var4; ++ ++ if (this.renderAllFaces || RenderPass.shouldSideBeRendered(par1Block, this.blockAccess, par2, par3, par4 - 1, 2)) { ++ if (this.renderMinZ <= 0.0D) { ++ --par4; + } + +- this.aoLightValueScratchXZNN = var1.getAmbientOcclusionLightValue(this.blockAccess, var2 - 1, var3, var4); +- this.aoLightValueScratchYZNN = var1.getAmbientOcclusionLightValue(this.blockAccess, var2, var3 - 1, var4); +- this.aoLightValueScratchYZPN = var1.getAmbientOcclusionLightValue(this.blockAccess, var2, var3 + 1, var4); +- this.aoLightValueScratchXZPN = var1.getAmbientOcclusionLightValue(this.blockAccess, var2 + 1, var3, var4); +- this.aoBrightnessXZNN = var1.getMixedBrightnessForBlock(this.blockAccess, var2 - 1, var3, var4); +- this.aoBrightnessYZNN = var1.getMixedBrightnessForBlock(this.blockAccess, var2, var3 - 1, var4); +- this.aoBrightnessYZPN = var1.getMixedBrightnessForBlock(this.blockAccess, var2, var3 + 1, var4); +- this.aoBrightnessXZPN = var1.getMixedBrightnessForBlock(this.blockAccess, var2 + 1, var3, var4); +- var16 = Block.canBlockGrass[this.blockAccess.getBlockId(var2 + 1, var3, var4 - 1)]; +- var17 = Block.canBlockGrass[this.blockAccess.getBlockId(var2 - 1, var3, var4 - 1)]; +- var18 = Block.canBlockGrass[this.blockAccess.getBlockId(var2, var3 + 1, var4 - 1)]; +- var19 = Block.canBlockGrass[this.blockAccess.getBlockId(var2, var3 - 1, var4 - 1)]; +- if(!var17 && !var19) { ++ this.aoLightValueScratchXZNN = par1Block.getAmbientOcclusionLightValue(this.blockAccess, par2 - 1, par3, par4); ++ this.aoLightValueScratchYZNN = par1Block.getAmbientOcclusionLightValue(this.blockAccess, par2, par3 - 1, par4); ++ this.aoLightValueScratchYZPN = par1Block.getAmbientOcclusionLightValue(this.blockAccess, par2, par3 + 1, par4); ++ this.aoLightValueScratchXZPN = par1Block.getAmbientOcclusionLightValue(this.blockAccess, par2 + 1, par3, par4); ++ this.aoBrightnessXZNN = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2 - 1, par3, par4); ++ this.aoBrightnessYZNN = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2, par3 - 1, par4); ++ this.aoBrightnessYZPN = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2, par3 + 1, par4); ++ this.aoBrightnessXZPN = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2 + 1, par3, par4); ++ var16 = Block.canBlockGrass[this.blockAccess.getBlockId(par2 + 1, par3, par4 - 1)]; ++ var17 = Block.canBlockGrass[this.blockAccess.getBlockId(par2 - 1, par3, par4 - 1)]; ++ var18 = Block.canBlockGrass[this.blockAccess.getBlockId(par2, par3 + 1, par4 - 1)]; ++ var19 = Block.canBlockGrass[this.blockAccess.getBlockId(par2, par3 - 1, par4 - 1)]; ++ ++ if (!var17 && !var19) { + this.aoLightValueScratchXYZNNN = this.aoLightValueScratchXZNN; + this.aoBrightnessXYZNNN = this.aoBrightnessXZNN; + } else { +- this.aoLightValueScratchXYZNNN = var1.getAmbientOcclusionLightValue(this.blockAccess, var2 - 1, var3 - 1, var4); +- this.aoBrightnessXYZNNN = var1.getMixedBrightnessForBlock(this.blockAccess, var2 - 1, var3 - 1, var4); ++ this.aoLightValueScratchXYZNNN = par1Block.getAmbientOcclusionLightValue(this.blockAccess, par2 - 1, par3 - 1, par4); ++ this.aoBrightnessXYZNNN = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2 - 1, par3 - 1, par4); + } + +- if(!var17 && !var18) { ++ if (!var17 && !var18) { + this.aoLightValueScratchXYZNPN = this.aoLightValueScratchXZNN; + this.aoBrightnessXYZNPN = this.aoBrightnessXZNN; + } else { +- this.aoLightValueScratchXYZNPN = var1.getAmbientOcclusionLightValue(this.blockAccess, var2 - 1, var3 + 1, var4); +- this.aoBrightnessXYZNPN = var1.getMixedBrightnessForBlock(this.blockAccess, var2 - 1, var3 + 1, var4); ++ this.aoLightValueScratchXYZNPN = par1Block.getAmbientOcclusionLightValue(this.blockAccess, par2 - 1, par3 + 1, par4); ++ this.aoBrightnessXYZNPN = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2 - 1, par3 + 1, par4); + } + +- if(!var16 && !var19) { ++ if (!var16 && !var19) { + this.aoLightValueScratchXYZPNN = this.aoLightValueScratchXZPN; + this.aoBrightnessXYZPNN = this.aoBrightnessXZPN; + } else { +- this.aoLightValueScratchXYZPNN = var1.getAmbientOcclusionLightValue(this.blockAccess, var2 + 1, var3 - 1, var4); +- this.aoBrightnessXYZPNN = var1.getMixedBrightnessForBlock(this.blockAccess, var2 + 1, var3 - 1, var4); ++ this.aoLightValueScratchXYZPNN = par1Block.getAmbientOcclusionLightValue(this.blockAccess, par2 + 1, par3 - 1, par4); ++ this.aoBrightnessXYZPNN = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2 + 1, par3 - 1, par4); + } + +- if(!var16 && !var18) { ++ if (!var16 && !var18) { + this.aoLightValueScratchXYZPPN = this.aoLightValueScratchXZPN; + this.aoBrightnessXYZPPN = this.aoBrightnessXZPN; + } else { +- this.aoLightValueScratchXYZPPN = var1.getAmbientOcclusionLightValue(this.blockAccess, var2 + 1, var3 + 1, var4); +- this.aoBrightnessXYZPPN = var1.getMixedBrightnessForBlock(this.blockAccess, var2 + 1, var3 + 1, var4); ++ this.aoLightValueScratchXYZPPN = par1Block.getAmbientOcclusionLightValue(this.blockAccess, par2 + 1, par3 + 1, par4); ++ this.aoBrightnessXYZPPN = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2 + 1, par3 + 1, par4); + } + +- if(this.renderMinZ <= 0.0D) { +- ++var4; ++ if (this.renderMinZ <= 0.0D) { ++ ++par4; + } + + var20 = var14; +- if(this.renderMinZ <= 0.0D || !this.blockAccess.isBlockOpaqueCube(var2, var3, var4 - 1)) { +- var20 = var1.getMixedBrightnessForBlock(this.blockAccess, var2, var3, var4 - 1); ++ ++ if (this.renderMinZ <= 0.0D || !this.blockAccess.isBlockOpaqueCube(par2, par3, par4 - 1)) { ++ var20 = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2, par3, par4 - 1); + } + +- var21 = var1.getAmbientOcclusionLightValue(this.blockAccess, var2, var3, var4 - 1); ++ var21 = par1Block.getAmbientOcclusionLightValue(this.blockAccess, par2, par3, par4 - 1); + var9 = (this.aoLightValueScratchXZNN + this.aoLightValueScratchXYZNPN + var21 + this.aoLightValueScratchYZPN) / 4.0F; + var10 = (var21 + this.aoLightValueScratchYZPN + this.aoLightValueScratchXZPN + this.aoLightValueScratchXYZPPN) / 4.0F; + var11 = (this.aoLightValueScratchYZNN + var21 + this.aoLightValueScratchXYZPNN + this.aoLightValueScratchXZPN) / 4.0F; +@@ -3567,14 +4208,15 @@ + this.brightnessBottomLeft = this.getAoBrightness(this.aoBrightnessYZPN, this.aoBrightnessXZPN, this.aoBrightnessXYZPPN, var20); + this.brightnessBottomRight = this.getAoBrightness(this.aoBrightnessYZNN, this.aoBrightnessXYZPNN, this.aoBrightnessXZPN, var20); + this.brightnessTopRight = this.getAoBrightness(this.aoBrightnessXYZNNN, this.aoBrightnessXZNN, this.aoBrightnessYZNN, var20); +- if(var13) { +- this.colorRedTopLeft = this.colorRedBottomLeft = this.colorRedBottomRight = this.colorRedTopRight = var5 * 0.8F; +- this.colorGreenTopLeft = this.colorGreenBottomLeft = this.colorGreenBottomRight = this.colorGreenTopRight = var6 * 0.8F; +- this.colorBlueTopLeft = this.colorBlueBottomLeft = this.colorBlueBottomRight = this.colorBlueTopRight = var7 * 0.8F; ++ ++ if (!var13 ? (!fancyGrass ? CTMUtils.isBetterGrass(this.blockAccess, par1Block, par2, par3, par4, 2) : false) : true) { ++ this.colorRedTopLeft = this.colorRedBottomLeft = this.colorRedBottomRight = this.colorRedTopRight = par5 * RenderPass.getAOBaseMultiplier(0.8F); ++ this.colorGreenTopLeft = this.colorGreenBottomLeft = this.colorGreenBottomRight = this.colorGreenTopRight = par6 * RenderPass.getAOBaseMultiplier(0.8F); ++ this.colorBlueTopLeft = this.colorBlueBottomLeft = this.colorBlueBottomRight = this.colorBlueTopRight = par7 * RenderPass.getAOBaseMultiplier(0.8F); + } else { +- this.colorRedTopLeft = this.colorRedBottomLeft = this.colorRedBottomRight = this.colorRedTopRight = 0.8F; +- this.colorGreenTopLeft = this.colorGreenBottomLeft = this.colorGreenBottomRight = this.colorGreenTopRight = 0.8F; +- this.colorBlueTopLeft = this.colorBlueBottomLeft = this.colorBlueBottomRight = this.colorBlueTopRight = 0.8F; ++ this.colorRedTopLeft = this.colorRedBottomLeft = this.colorRedBottomRight = this.colorRedTopRight = RenderPass.getAOBaseMultiplier(0.8F); ++ this.colorGreenTopLeft = this.colorGreenBottomLeft = this.colorGreenBottomRight = this.colorGreenTopRight = RenderPass.getAOBaseMultiplier(0.8F); ++ this.colorBlueTopLeft = this.colorBlueBottomLeft = this.colorBlueBottomRight = this.colorBlueTopRight = RenderPass.getAOBaseMultiplier(0.8F); + } + + this.colorRedTopLeft *= var9; +@@ -3589,86 +4231,89 @@ + this.colorRedTopRight *= var12; + this.colorGreenTopRight *= var12; + this.colorBlueTopRight *= var12; +- var22 = this.getBlockIcon(var1, this.blockAccess, var2, var3, var4, 2); +- this.renderFaceZNeg(var1, (double)var2, (double)var3, (double)var4, var22); +- if(fancyGrass && var22.getIconName().equals("grass_side") && !this.hasOverrideBlockTexture()) { +- this.colorRedTopLeft *= var5; +- this.colorRedBottomLeft *= var5; +- this.colorRedBottomRight *= var5; +- this.colorRedTopRight *= var5; +- this.colorGreenTopLeft *= var6; +- this.colorGreenBottomLeft *= var6; +- this.colorGreenBottomRight *= var6; +- this.colorGreenTopRight *= var6; +- this.colorBlueTopLeft *= var7; +- this.colorBlueBottomLeft *= var7; +- this.colorBlueBottomRight *= var7; +- this.colorBlueTopRight *= var7; +- this.renderFaceZNeg(var1, (double)var2, (double)var3, (double)var4, BlockGrass.getIconSideOverlay()); ++ var22 = this.getBlockIcon(par1Block, this.blockAccess, par2, par3, par4, 2); ++ this.renderFaceZNeg(par1Block, (double)par2, (double)par3, (double)par4, var22); ++ ++ if (fancyGrass && var22.getIconName().equals("grass_side") && !this.hasOverrideBlockTexture()) { ++ this.colorRedTopLeft *= par5; ++ this.colorRedBottomLeft *= par5; ++ this.colorRedBottomRight *= par5; ++ this.colorRedTopRight *= par5; ++ this.colorGreenTopLeft *= par6; ++ this.colorGreenBottomLeft *= par6; ++ this.colorGreenBottomRight *= par6; ++ this.colorGreenTopRight *= par6; ++ this.colorBlueTopLeft *= par7; ++ this.colorBlueBottomLeft *= par7; ++ this.colorBlueBottomRight *= par7; ++ this.colorBlueTopRight *= par7; ++ this.renderFaceZNeg(par1Block, (double)par2, (double)par3, (double)par4, BlockGrass.getIconSideOverlay()); + } + + var8 = true; + } + +- if(this.renderAllFaces || var1.shouldSideBeRendered(this.blockAccess, var2, var3, var4 + 1, 3)) { +- if(this.renderMaxZ >= 1.0D) { +- ++var4; ++ if (this.renderAllFaces || RenderPass.shouldSideBeRendered(par1Block, this.blockAccess, par2, par3, par4 + 1, 3)) { ++ if (this.renderMaxZ >= 1.0D) { ++ ++par4; + } + +- this.aoLightValueScratchXZNP = var1.getAmbientOcclusionLightValue(this.blockAccess, var2 - 1, var3, var4); +- this.aoLightValueScratchXZPP = var1.getAmbientOcclusionLightValue(this.blockAccess, var2 + 1, var3, var4); +- this.aoLightValueScratchYZNP = var1.getAmbientOcclusionLightValue(this.blockAccess, var2, var3 - 1, var4); +- this.aoLightValueScratchYZPP = var1.getAmbientOcclusionLightValue(this.blockAccess, var2, var3 + 1, var4); +- this.aoBrightnessXZNP = var1.getMixedBrightnessForBlock(this.blockAccess, var2 - 1, var3, var4); +- this.aoBrightnessXZPP = var1.getMixedBrightnessForBlock(this.blockAccess, var2 + 1, var3, var4); +- this.aoBrightnessYZNP = var1.getMixedBrightnessForBlock(this.blockAccess, var2, var3 - 1, var4); +- this.aoBrightnessYZPP = var1.getMixedBrightnessForBlock(this.blockAccess, var2, var3 + 1, var4); +- var16 = Block.canBlockGrass[this.blockAccess.getBlockId(var2 + 1, var3, var4 + 1)]; +- var17 = Block.canBlockGrass[this.blockAccess.getBlockId(var2 - 1, var3, var4 + 1)]; +- var18 = Block.canBlockGrass[this.blockAccess.getBlockId(var2, var3 + 1, var4 + 1)]; +- var19 = Block.canBlockGrass[this.blockAccess.getBlockId(var2, var3 - 1, var4 + 1)]; +- if(!var17 && !var19) { ++ this.aoLightValueScratchXZNP = par1Block.getAmbientOcclusionLightValue(this.blockAccess, par2 - 1, par3, par4); ++ this.aoLightValueScratchXZPP = par1Block.getAmbientOcclusionLightValue(this.blockAccess, par2 + 1, par3, par4); ++ this.aoLightValueScratchYZNP = par1Block.getAmbientOcclusionLightValue(this.blockAccess, par2, par3 - 1, par4); ++ this.aoLightValueScratchYZPP = par1Block.getAmbientOcclusionLightValue(this.blockAccess, par2, par3 + 1, par4); ++ this.aoBrightnessXZNP = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2 - 1, par3, par4); ++ this.aoBrightnessXZPP = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2 + 1, par3, par4); ++ this.aoBrightnessYZNP = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2, par3 - 1, par4); ++ this.aoBrightnessYZPP = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2, par3 + 1, par4); ++ var16 = Block.canBlockGrass[this.blockAccess.getBlockId(par2 + 1, par3, par4 + 1)]; ++ var17 = Block.canBlockGrass[this.blockAccess.getBlockId(par2 - 1, par3, par4 + 1)]; ++ var18 = Block.canBlockGrass[this.blockAccess.getBlockId(par2, par3 + 1, par4 + 1)]; ++ var19 = Block.canBlockGrass[this.blockAccess.getBlockId(par2, par3 - 1, par4 + 1)]; ++ ++ if (!var17 && !var19) { + this.aoLightValueScratchXYZNNP = this.aoLightValueScratchXZNP; + this.aoBrightnessXYZNNP = this.aoBrightnessXZNP; + } else { +- this.aoLightValueScratchXYZNNP = var1.getAmbientOcclusionLightValue(this.blockAccess, var2 - 1, var3 - 1, var4); +- this.aoBrightnessXYZNNP = var1.getMixedBrightnessForBlock(this.blockAccess, var2 - 1, var3 - 1, var4); ++ this.aoLightValueScratchXYZNNP = par1Block.getAmbientOcclusionLightValue(this.blockAccess, par2 - 1, par3 - 1, par4); ++ this.aoBrightnessXYZNNP = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2 - 1, par3 - 1, par4); + } + +- if(!var17 && !var18) { ++ if (!var17 && !var18) { + this.aoLightValueScratchXYZNPP = this.aoLightValueScratchXZNP; + this.aoBrightnessXYZNPP = this.aoBrightnessXZNP; + } else { +- this.aoLightValueScratchXYZNPP = var1.getAmbientOcclusionLightValue(this.blockAccess, var2 - 1, var3 + 1, var4); +- this.aoBrightnessXYZNPP = var1.getMixedBrightnessForBlock(this.blockAccess, var2 - 1, var3 + 1, var4); ++ this.aoLightValueScratchXYZNPP = par1Block.getAmbientOcclusionLightValue(this.blockAccess, par2 - 1, par3 + 1, par4); ++ this.aoBrightnessXYZNPP = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2 - 1, par3 + 1, par4); + } + +- if(!var16 && !var19) { ++ if (!var16 && !var19) { + this.aoLightValueScratchXYZPNP = this.aoLightValueScratchXZPP; + this.aoBrightnessXYZPNP = this.aoBrightnessXZPP; + } else { +- this.aoLightValueScratchXYZPNP = var1.getAmbientOcclusionLightValue(this.blockAccess, var2 + 1, var3 - 1, var4); +- this.aoBrightnessXYZPNP = var1.getMixedBrightnessForBlock(this.blockAccess, var2 + 1, var3 - 1, var4); ++ this.aoLightValueScratchXYZPNP = par1Block.getAmbientOcclusionLightValue(this.blockAccess, par2 + 1, par3 - 1, par4); ++ this.aoBrightnessXYZPNP = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2 + 1, par3 - 1, par4); + } + +- if(!var16 && !var18) { ++ if (!var16 && !var18) { + this.aoLightValueScratchXYZPPP = this.aoLightValueScratchXZPP; + this.aoBrightnessXYZPPP = this.aoBrightnessXZPP; + } else { +- this.aoLightValueScratchXYZPPP = var1.getAmbientOcclusionLightValue(this.blockAccess, var2 + 1, var3 + 1, var4); +- this.aoBrightnessXYZPPP = var1.getMixedBrightnessForBlock(this.blockAccess, var2 + 1, var3 + 1, var4); ++ this.aoLightValueScratchXYZPPP = par1Block.getAmbientOcclusionLightValue(this.blockAccess, par2 + 1, par3 + 1, par4); ++ this.aoBrightnessXYZPPP = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2 + 1, par3 + 1, par4); + } + +- if(this.renderMaxZ >= 1.0D) { +- --var4; ++ if (this.renderMaxZ >= 1.0D) { ++ --par4; + } + + var20 = var14; +- if(this.renderMaxZ >= 1.0D || !this.blockAccess.isBlockOpaqueCube(var2, var3, var4 + 1)) { +- var20 = var1.getMixedBrightnessForBlock(this.blockAccess, var2, var3, var4 + 1); ++ ++ if (this.renderMaxZ >= 1.0D || !this.blockAccess.isBlockOpaqueCube(par2, par3, par4 + 1)) { ++ var20 = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2, par3, par4 + 1); + } + +- var21 = var1.getAmbientOcclusionLightValue(this.blockAccess, var2, var3, var4 + 1); ++ var21 = par1Block.getAmbientOcclusionLightValue(this.blockAccess, par2, par3, par4 + 1); + var9 = (this.aoLightValueScratchXZNP + this.aoLightValueScratchXYZNPP + var21 + this.aoLightValueScratchYZPP) / 4.0F; + var12 = (var21 + this.aoLightValueScratchYZPP + this.aoLightValueScratchXZPP + this.aoLightValueScratchXYZPPP) / 4.0F; + var11 = (this.aoLightValueScratchYZNP + var21 + this.aoLightValueScratchXYZPNP + this.aoLightValueScratchXZPP) / 4.0F; +@@ -3677,14 +4322,15 @@ + this.brightnessTopRight = this.getAoBrightness(this.aoBrightnessYZPP, this.aoBrightnessXZPP, this.aoBrightnessXYZPPP, var20); + this.brightnessBottomRight = this.getAoBrightness(this.aoBrightnessYZNP, this.aoBrightnessXYZPNP, this.aoBrightnessXZPP, var20); + this.brightnessBottomLeft = this.getAoBrightness(this.aoBrightnessXYZNNP, this.aoBrightnessXZNP, this.aoBrightnessYZNP, var20); +- if(var13) { +- this.colorRedTopLeft = this.colorRedBottomLeft = this.colorRedBottomRight = this.colorRedTopRight = var5 * 0.8F; +- this.colorGreenTopLeft = this.colorGreenBottomLeft = this.colorGreenBottomRight = this.colorGreenTopRight = var6 * 0.8F; +- this.colorBlueTopLeft = this.colorBlueBottomLeft = this.colorBlueBottomRight = this.colorBlueTopRight = var7 * 0.8F; ++ ++ if (!var13 ? (!fancyGrass ? CTMUtils.isBetterGrass(this.blockAccess, par1Block, par2, par3, par4, 3) : false) : true) { ++ this.colorRedTopLeft = this.colorRedBottomLeft = this.colorRedBottomRight = this.colorRedTopRight = par5 * RenderPass.getAOBaseMultiplier(0.8F); ++ this.colorGreenTopLeft = this.colorGreenBottomLeft = this.colorGreenBottomRight = this.colorGreenTopRight = par6 * RenderPass.getAOBaseMultiplier(0.8F); ++ this.colorBlueTopLeft = this.colorBlueBottomLeft = this.colorBlueBottomRight = this.colorBlueTopRight = par7 * RenderPass.getAOBaseMultiplier(0.8F); + } else { +- this.colorRedTopLeft = this.colorRedBottomLeft = this.colorRedBottomRight = this.colorRedTopRight = 0.8F; +- this.colorGreenTopLeft = this.colorGreenBottomLeft = this.colorGreenBottomRight = this.colorGreenTopRight = 0.8F; +- this.colorBlueTopLeft = this.colorBlueBottomLeft = this.colorBlueBottomRight = this.colorBlueTopRight = 0.8F; ++ this.colorRedTopLeft = this.colorRedBottomLeft = this.colorRedBottomRight = this.colorRedTopRight = RenderPass.getAOBaseMultiplier(0.8F); ++ this.colorGreenTopLeft = this.colorGreenBottomLeft = this.colorGreenBottomRight = this.colorGreenTopRight = RenderPass.getAOBaseMultiplier(0.8F); ++ this.colorBlueTopLeft = this.colorBlueBottomLeft = this.colorBlueBottomRight = this.colorBlueTopRight = RenderPass.getAOBaseMultiplier(0.8F); + } + + this.colorRedTopLeft *= var9; +@@ -3699,86 +4345,89 @@ + this.colorRedTopRight *= var12; + this.colorGreenTopRight *= var12; + this.colorBlueTopRight *= var12; +- var22 = this.getBlockIcon(var1, this.blockAccess, var2, var3, var4, 3); +- this.renderFaceZPos(var1, (double)var2, (double)var3, (double)var4, this.getBlockIcon(var1, this.blockAccess, var2, var3, var4, 3)); +- if(fancyGrass && var22.getIconName().equals("grass_side") && !this.hasOverrideBlockTexture()) { +- this.colorRedTopLeft *= var5; +- this.colorRedBottomLeft *= var5; +- this.colorRedBottomRight *= var5; +- this.colorRedTopRight *= var5; +- this.colorGreenTopLeft *= var6; +- this.colorGreenBottomLeft *= var6; +- this.colorGreenBottomRight *= var6; +- this.colorGreenTopRight *= var6; +- this.colorBlueTopLeft *= var7; +- this.colorBlueBottomLeft *= var7; +- this.colorBlueBottomRight *= var7; +- this.colorBlueTopRight *= var7; +- this.renderFaceZPos(var1, (double)var2, (double)var3, (double)var4, BlockGrass.getIconSideOverlay()); ++ var22 = this.getBlockIcon(par1Block, this.blockAccess, par2, par3, par4, 3); ++ this.renderFaceZPos(par1Block, (double)par2, (double)par3, (double)par4, this.getBlockIcon(par1Block, this.blockAccess, par2, par3, par4, 3)); ++ ++ if (fancyGrass && var22.getIconName().equals("grass_side") && !this.hasOverrideBlockTexture()) { ++ this.colorRedTopLeft *= par5; ++ this.colorRedBottomLeft *= par5; ++ this.colorRedBottomRight *= par5; ++ this.colorRedTopRight *= par5; ++ this.colorGreenTopLeft *= par6; ++ this.colorGreenBottomLeft *= par6; ++ this.colorGreenBottomRight *= par6; ++ this.colorGreenTopRight *= par6; ++ this.colorBlueTopLeft *= par7; ++ this.colorBlueBottomLeft *= par7; ++ this.colorBlueBottomRight *= par7; ++ this.colorBlueTopRight *= par7; ++ this.renderFaceZPos(par1Block, (double)par2, (double)par3, (double)par4, BlockGrass.getIconSideOverlay()); + } + + var8 = true; + } + +- if(this.renderAllFaces || var1.shouldSideBeRendered(this.blockAccess, var2 - 1, var3, var4, 4)) { +- if(this.renderMinX <= 0.0D) { +- --var2; ++ if (this.renderAllFaces || RenderPass.shouldSideBeRendered(par1Block, this.blockAccess, par2 - 1, par3, par4, 4)) { ++ if (this.renderMinX <= 0.0D) { ++ --par2; + } + +- this.aoLightValueScratchXYNN = var1.getAmbientOcclusionLightValue(this.blockAccess, var2, var3 - 1, var4); +- this.aoLightValueScratchXZNN = var1.getAmbientOcclusionLightValue(this.blockAccess, var2, var3, var4 - 1); +- this.aoLightValueScratchXZNP = var1.getAmbientOcclusionLightValue(this.blockAccess, var2, var3, var4 + 1); +- this.aoLightValueScratchXYNP = var1.getAmbientOcclusionLightValue(this.blockAccess, var2, var3 + 1, var4); +- this.aoBrightnessXYNN = var1.getMixedBrightnessForBlock(this.blockAccess, var2, var3 - 1, var4); +- this.aoBrightnessXZNN = var1.getMixedBrightnessForBlock(this.blockAccess, var2, var3, var4 - 1); +- this.aoBrightnessXZNP = var1.getMixedBrightnessForBlock(this.blockAccess, var2, var3, var4 + 1); +- this.aoBrightnessXYNP = var1.getMixedBrightnessForBlock(this.blockAccess, var2, var3 + 1, var4); +- var16 = Block.canBlockGrass[this.blockAccess.getBlockId(var2 - 1, var3 + 1, var4)]; +- var17 = Block.canBlockGrass[this.blockAccess.getBlockId(var2 - 1, var3 - 1, var4)]; +- var18 = Block.canBlockGrass[this.blockAccess.getBlockId(var2 - 1, var3, var4 - 1)]; +- var19 = Block.canBlockGrass[this.blockAccess.getBlockId(var2 - 1, var3, var4 + 1)]; +- if(!var18 && !var17) { ++ this.aoLightValueScratchXYNN = par1Block.getAmbientOcclusionLightValue(this.blockAccess, par2, par3 - 1, par4); ++ this.aoLightValueScratchXZNN = par1Block.getAmbientOcclusionLightValue(this.blockAccess, par2, par3, par4 - 1); ++ this.aoLightValueScratchXZNP = par1Block.getAmbientOcclusionLightValue(this.blockAccess, par2, par3, par4 + 1); ++ this.aoLightValueScratchXYNP = par1Block.getAmbientOcclusionLightValue(this.blockAccess, par2, par3 + 1, par4); ++ this.aoBrightnessXYNN = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2, par3 - 1, par4); ++ this.aoBrightnessXZNN = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2, par3, par4 - 1); ++ this.aoBrightnessXZNP = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2, par3, par4 + 1); ++ this.aoBrightnessXYNP = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2, par3 + 1, par4); ++ var16 = Block.canBlockGrass[this.blockAccess.getBlockId(par2 - 1, par3 + 1, par4)]; ++ var17 = Block.canBlockGrass[this.blockAccess.getBlockId(par2 - 1, par3 - 1, par4)]; ++ var18 = Block.canBlockGrass[this.blockAccess.getBlockId(par2 - 1, par3, par4 - 1)]; ++ var19 = Block.canBlockGrass[this.blockAccess.getBlockId(par2 - 1, par3, par4 + 1)]; ++ ++ if (!var18 && !var17) { + this.aoLightValueScratchXYZNNN = this.aoLightValueScratchXZNN; + this.aoBrightnessXYZNNN = this.aoBrightnessXZNN; + } else { +- this.aoLightValueScratchXYZNNN = var1.getAmbientOcclusionLightValue(this.blockAccess, var2, var3 - 1, var4 - 1); +- this.aoBrightnessXYZNNN = var1.getMixedBrightnessForBlock(this.blockAccess, var2, var3 - 1, var4 - 1); ++ this.aoLightValueScratchXYZNNN = par1Block.getAmbientOcclusionLightValue(this.blockAccess, par2, par3 - 1, par4 - 1); ++ this.aoBrightnessXYZNNN = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2, par3 - 1, par4 - 1); + } + +- if(!var19 && !var17) { ++ if (!var19 && !var17) { + this.aoLightValueScratchXYZNNP = this.aoLightValueScratchXZNP; + this.aoBrightnessXYZNNP = this.aoBrightnessXZNP; + } else { +- this.aoLightValueScratchXYZNNP = var1.getAmbientOcclusionLightValue(this.blockAccess, var2, var3 - 1, var4 + 1); +- this.aoBrightnessXYZNNP = var1.getMixedBrightnessForBlock(this.blockAccess, var2, var3 - 1, var4 + 1); ++ this.aoLightValueScratchXYZNNP = par1Block.getAmbientOcclusionLightValue(this.blockAccess, par2, par3 - 1, par4 + 1); ++ this.aoBrightnessXYZNNP = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2, par3 - 1, par4 + 1); + } + +- if(!var18 && !var16) { ++ if (!var18 && !var16) { + this.aoLightValueScratchXYZNPN = this.aoLightValueScratchXZNN; + this.aoBrightnessXYZNPN = this.aoBrightnessXZNN; + } else { +- this.aoLightValueScratchXYZNPN = var1.getAmbientOcclusionLightValue(this.blockAccess, var2, var3 + 1, var4 - 1); +- this.aoBrightnessXYZNPN = var1.getMixedBrightnessForBlock(this.blockAccess, var2, var3 + 1, var4 - 1); ++ this.aoLightValueScratchXYZNPN = par1Block.getAmbientOcclusionLightValue(this.blockAccess, par2, par3 + 1, par4 - 1); ++ this.aoBrightnessXYZNPN = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2, par3 + 1, par4 - 1); + } + +- if(!var19 && !var16) { ++ if (!var19 && !var16) { + this.aoLightValueScratchXYZNPP = this.aoLightValueScratchXZNP; + this.aoBrightnessXYZNPP = this.aoBrightnessXZNP; + } else { +- this.aoLightValueScratchXYZNPP = var1.getAmbientOcclusionLightValue(this.blockAccess, var2, var3 + 1, var4 + 1); +- this.aoBrightnessXYZNPP = var1.getMixedBrightnessForBlock(this.blockAccess, var2, var3 + 1, var4 + 1); ++ this.aoLightValueScratchXYZNPP = par1Block.getAmbientOcclusionLightValue(this.blockAccess, par2, par3 + 1, par4 + 1); ++ this.aoBrightnessXYZNPP = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2, par3 + 1, par4 + 1); + } + +- if(this.renderMinX <= 0.0D) { +- ++var2; ++ if (this.renderMinX <= 0.0D) { ++ ++par2; + } + + var20 = var14; +- if(this.renderMinX <= 0.0D || !this.blockAccess.isBlockOpaqueCube(var2 - 1, var3, var4)) { +- var20 = var1.getMixedBrightnessForBlock(this.blockAccess, var2 - 1, var3, var4); ++ ++ if (this.renderMinX <= 0.0D || !this.blockAccess.isBlockOpaqueCube(par2 - 1, par3, par4)) { ++ var20 = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2 - 1, par3, par4); + } + +- var21 = var1.getAmbientOcclusionLightValue(this.blockAccess, var2 - 1, var3, var4); ++ var21 = par1Block.getAmbientOcclusionLightValue(this.blockAccess, par2 - 1, par3, par4); + var12 = (this.aoLightValueScratchXYNN + this.aoLightValueScratchXYZNNP + var21 + this.aoLightValueScratchXZNP) / 4.0F; + var9 = (var21 + this.aoLightValueScratchXZNP + this.aoLightValueScratchXYNP + this.aoLightValueScratchXYZNPP) / 4.0F; + var10 = (this.aoLightValueScratchXZNN + var21 + this.aoLightValueScratchXYZNPN + this.aoLightValueScratchXYNP) / 4.0F; +@@ -3787,14 +4436,15 @@ + this.brightnessTopLeft = this.getAoBrightness(this.aoBrightnessXZNP, this.aoBrightnessXYNP, this.aoBrightnessXYZNPP, var20); + this.brightnessBottomLeft = this.getAoBrightness(this.aoBrightnessXZNN, this.aoBrightnessXYZNPN, this.aoBrightnessXYNP, var20); + this.brightnessBottomRight = this.getAoBrightness(this.aoBrightnessXYZNNN, this.aoBrightnessXYNN, this.aoBrightnessXZNN, var20); +- if(var13) { +- this.colorRedTopLeft = this.colorRedBottomLeft = this.colorRedBottomRight = this.colorRedTopRight = var5 * 0.6F; +- this.colorGreenTopLeft = this.colorGreenBottomLeft = this.colorGreenBottomRight = this.colorGreenTopRight = var6 * 0.6F; +- this.colorBlueTopLeft = this.colorBlueBottomLeft = this.colorBlueBottomRight = this.colorBlueTopRight = var7 * 0.6F; ++ ++ if (!var13 ? (!fancyGrass ? CTMUtils.isBetterGrass(this.blockAccess, par1Block, par2, par3, par4, 4) : false) : true) { ++ this.colorRedTopLeft = this.colorRedBottomLeft = this.colorRedBottomRight = this.colorRedTopRight = par5 * RenderPass.getAOBaseMultiplier(0.6F); ++ this.colorGreenTopLeft = this.colorGreenBottomLeft = this.colorGreenBottomRight = this.colorGreenTopRight = par6 * RenderPass.getAOBaseMultiplier(0.6F); ++ this.colorBlueTopLeft = this.colorBlueBottomLeft = this.colorBlueBottomRight = this.colorBlueTopRight = par7 * RenderPass.getAOBaseMultiplier(0.6F); + } else { +- this.colorRedTopLeft = this.colorRedBottomLeft = this.colorRedBottomRight = this.colorRedTopRight = 0.6F; +- this.colorGreenTopLeft = this.colorGreenBottomLeft = this.colorGreenBottomRight = this.colorGreenTopRight = 0.6F; +- this.colorBlueTopLeft = this.colorBlueBottomLeft = this.colorBlueBottomRight = this.colorBlueTopRight = 0.6F; ++ this.colorRedTopLeft = this.colorRedBottomLeft = this.colorRedBottomRight = this.colorRedTopRight = RenderPass.getAOBaseMultiplier(0.6F); ++ this.colorGreenTopLeft = this.colorGreenBottomLeft = this.colorGreenBottomRight = this.colorGreenTopRight = RenderPass.getAOBaseMultiplier(0.6F); ++ this.colorBlueTopLeft = this.colorBlueBottomLeft = this.colorBlueBottomRight = this.colorBlueTopRight = RenderPass.getAOBaseMultiplier(0.6F); + } + + this.colorRedTopLeft *= var9; +@@ -3809,86 +4459,89 @@ + this.colorRedTopRight *= var12; + this.colorGreenTopRight *= var12; + this.colorBlueTopRight *= var12; +- var22 = this.getBlockIcon(var1, this.blockAccess, var2, var3, var4, 4); +- this.renderFaceXNeg(var1, (double)var2, (double)var3, (double)var4, var22); +- if(fancyGrass && var22.getIconName().equals("grass_side") && !this.hasOverrideBlockTexture()) { +- this.colorRedTopLeft *= var5; +- this.colorRedBottomLeft *= var5; +- this.colorRedBottomRight *= var5; +- this.colorRedTopRight *= var5; +- this.colorGreenTopLeft *= var6; +- this.colorGreenBottomLeft *= var6; +- this.colorGreenBottomRight *= var6; +- this.colorGreenTopRight *= var6; +- this.colorBlueTopLeft *= var7; +- this.colorBlueBottomLeft *= var7; +- this.colorBlueBottomRight *= var7; +- this.colorBlueTopRight *= var7; +- this.renderFaceXNeg(var1, (double)var2, (double)var3, (double)var4, BlockGrass.getIconSideOverlay()); ++ var22 = this.getBlockIcon(par1Block, this.blockAccess, par2, par3, par4, 4); ++ this.renderFaceXNeg(par1Block, (double)par2, (double)par3, (double)par4, var22); ++ ++ if (fancyGrass && var22.getIconName().equals("grass_side") && !this.hasOverrideBlockTexture()) { ++ this.colorRedTopLeft *= par5; ++ this.colorRedBottomLeft *= par5; ++ this.colorRedBottomRight *= par5; ++ this.colorRedTopRight *= par5; ++ this.colorGreenTopLeft *= par6; ++ this.colorGreenBottomLeft *= par6; ++ this.colorGreenBottomRight *= par6; ++ this.colorGreenTopRight *= par6; ++ this.colorBlueTopLeft *= par7; ++ this.colorBlueBottomLeft *= par7; ++ this.colorBlueBottomRight *= par7; ++ this.colorBlueTopRight *= par7; ++ this.renderFaceXNeg(par1Block, (double)par2, (double)par3, (double)par4, BlockGrass.getIconSideOverlay()); + } + + var8 = true; + } + +- if(this.renderAllFaces || var1.shouldSideBeRendered(this.blockAccess, var2 + 1, var3, var4, 5)) { +- if(this.renderMaxX >= 1.0D) { +- ++var2; ++ if (this.renderAllFaces || RenderPass.shouldSideBeRendered(par1Block, this.blockAccess, par2 + 1, par3, par4, 5)) { ++ if (this.renderMaxX >= 1.0D) { ++ ++par2; + } + +- this.aoLightValueScratchXYPN = var1.getAmbientOcclusionLightValue(this.blockAccess, var2, var3 - 1, var4); +- this.aoLightValueScratchXZPN = var1.getAmbientOcclusionLightValue(this.blockAccess, var2, var3, var4 - 1); +- this.aoLightValueScratchXZPP = var1.getAmbientOcclusionLightValue(this.blockAccess, var2, var3, var4 + 1); +- this.aoLightValueScratchXYPP = var1.getAmbientOcclusionLightValue(this.blockAccess, var2, var3 + 1, var4); +- this.aoBrightnessXYPN = var1.getMixedBrightnessForBlock(this.blockAccess, var2, var3 - 1, var4); +- this.aoBrightnessXZPN = var1.getMixedBrightnessForBlock(this.blockAccess, var2, var3, var4 - 1); +- this.aoBrightnessXZPP = var1.getMixedBrightnessForBlock(this.blockAccess, var2, var3, var4 + 1); +- this.aoBrightnessXYPP = var1.getMixedBrightnessForBlock(this.blockAccess, var2, var3 + 1, var4); +- var16 = Block.canBlockGrass[this.blockAccess.getBlockId(var2 + 1, var3 + 1, var4)]; +- var17 = Block.canBlockGrass[this.blockAccess.getBlockId(var2 + 1, var3 - 1, var4)]; +- var18 = Block.canBlockGrass[this.blockAccess.getBlockId(var2 + 1, var3, var4 + 1)]; +- var19 = Block.canBlockGrass[this.blockAccess.getBlockId(var2 + 1, var3, var4 - 1)]; +- if(!var17 && !var19) { ++ this.aoLightValueScratchXYPN = par1Block.getAmbientOcclusionLightValue(this.blockAccess, par2, par3 - 1, par4); ++ this.aoLightValueScratchXZPN = par1Block.getAmbientOcclusionLightValue(this.blockAccess, par2, par3, par4 - 1); ++ this.aoLightValueScratchXZPP = par1Block.getAmbientOcclusionLightValue(this.blockAccess, par2, par3, par4 + 1); ++ this.aoLightValueScratchXYPP = par1Block.getAmbientOcclusionLightValue(this.blockAccess, par2, par3 + 1, par4); ++ this.aoBrightnessXYPN = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2, par3 - 1, par4); ++ this.aoBrightnessXZPN = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2, par3, par4 - 1); ++ this.aoBrightnessXZPP = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2, par3, par4 + 1); ++ this.aoBrightnessXYPP = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2, par3 + 1, par4); ++ var16 = Block.canBlockGrass[this.blockAccess.getBlockId(par2 + 1, par3 + 1, par4)]; ++ var17 = Block.canBlockGrass[this.blockAccess.getBlockId(par2 + 1, par3 - 1, par4)]; ++ var18 = Block.canBlockGrass[this.blockAccess.getBlockId(par2 + 1, par3, par4 + 1)]; ++ var19 = Block.canBlockGrass[this.blockAccess.getBlockId(par2 + 1, par3, par4 - 1)]; ++ ++ if (!var17 && !var19) { + this.aoLightValueScratchXYZPNN = this.aoLightValueScratchXZPN; + this.aoBrightnessXYZPNN = this.aoBrightnessXZPN; + } else { +- this.aoLightValueScratchXYZPNN = var1.getAmbientOcclusionLightValue(this.blockAccess, var2, var3 - 1, var4 - 1); +- this.aoBrightnessXYZPNN = var1.getMixedBrightnessForBlock(this.blockAccess, var2, var3 - 1, var4 - 1); ++ this.aoLightValueScratchXYZPNN = par1Block.getAmbientOcclusionLightValue(this.blockAccess, par2, par3 - 1, par4 - 1); ++ this.aoBrightnessXYZPNN = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2, par3 - 1, par4 - 1); + } + +- if(!var17 && !var18) { ++ if (!var17 && !var18) { + this.aoLightValueScratchXYZPNP = this.aoLightValueScratchXZPP; + this.aoBrightnessXYZPNP = this.aoBrightnessXZPP; + } else { +- this.aoLightValueScratchXYZPNP = var1.getAmbientOcclusionLightValue(this.blockAccess, var2, var3 - 1, var4 + 1); +- this.aoBrightnessXYZPNP = var1.getMixedBrightnessForBlock(this.blockAccess, var2, var3 - 1, var4 + 1); ++ this.aoLightValueScratchXYZPNP = par1Block.getAmbientOcclusionLightValue(this.blockAccess, par2, par3 - 1, par4 + 1); ++ this.aoBrightnessXYZPNP = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2, par3 - 1, par4 + 1); + } + +- if(!var16 && !var19) { ++ if (!var16 && !var19) { + this.aoLightValueScratchXYZPPN = this.aoLightValueScratchXZPN; + this.aoBrightnessXYZPPN = this.aoBrightnessXZPN; + } else { +- this.aoLightValueScratchXYZPPN = var1.getAmbientOcclusionLightValue(this.blockAccess, var2, var3 + 1, var4 - 1); +- this.aoBrightnessXYZPPN = var1.getMixedBrightnessForBlock(this.blockAccess, var2, var3 + 1, var4 - 1); ++ this.aoLightValueScratchXYZPPN = par1Block.getAmbientOcclusionLightValue(this.blockAccess, par2, par3 + 1, par4 - 1); ++ this.aoBrightnessXYZPPN = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2, par3 + 1, par4 - 1); + } + +- if(!var16 && !var18) { ++ if (!var16 && !var18) { + this.aoLightValueScratchXYZPPP = this.aoLightValueScratchXZPP; + this.aoBrightnessXYZPPP = this.aoBrightnessXZPP; + } else { +- this.aoLightValueScratchXYZPPP = var1.getAmbientOcclusionLightValue(this.blockAccess, var2, var3 + 1, var4 + 1); +- this.aoBrightnessXYZPPP = var1.getMixedBrightnessForBlock(this.blockAccess, var2, var3 + 1, var4 + 1); ++ this.aoLightValueScratchXYZPPP = par1Block.getAmbientOcclusionLightValue(this.blockAccess, par2, par3 + 1, par4 + 1); ++ this.aoBrightnessXYZPPP = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2, par3 + 1, par4 + 1); + } + +- if(this.renderMaxX >= 1.0D) { +- --var2; ++ if (this.renderMaxX >= 1.0D) { ++ --par2; + } + + var20 = var14; +- if(this.renderMaxX >= 1.0D || !this.blockAccess.isBlockOpaqueCube(var2 + 1, var3, var4)) { +- var20 = var1.getMixedBrightnessForBlock(this.blockAccess, var2 + 1, var3, var4); ++ ++ if (this.renderMaxX >= 1.0D || !this.blockAccess.isBlockOpaqueCube(par2 + 1, par3, par4)) { ++ var20 = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2 + 1, par3, par4); + } + +- var21 = var1.getAmbientOcclusionLightValue(this.blockAccess, var2 + 1, var3, var4); ++ var21 = par1Block.getAmbientOcclusionLightValue(this.blockAccess, par2 + 1, par3, par4); + var9 = (this.aoLightValueScratchXYPN + this.aoLightValueScratchXYZPNP + var21 + this.aoLightValueScratchXZPP) / 4.0F; + var10 = (this.aoLightValueScratchXYZPNN + this.aoLightValueScratchXYPN + this.aoLightValueScratchXZPN + var21) / 4.0F; + var11 = (this.aoLightValueScratchXZPN + var21 + this.aoLightValueScratchXYZPPN + this.aoLightValueScratchXYPP) / 4.0F; +@@ -3897,14 +4550,15 @@ + this.brightnessTopRight = this.getAoBrightness(this.aoBrightnessXZPP, this.aoBrightnessXYPP, this.aoBrightnessXYZPPP, var20); + this.brightnessBottomRight = this.getAoBrightness(this.aoBrightnessXZPN, this.aoBrightnessXYZPPN, this.aoBrightnessXYPP, var20); + this.brightnessBottomLeft = this.getAoBrightness(this.aoBrightnessXYZPNN, this.aoBrightnessXYPN, this.aoBrightnessXZPN, var20); +- if(var13) { +- this.colorRedTopLeft = this.colorRedBottomLeft = this.colorRedBottomRight = this.colorRedTopRight = var5 * 0.6F; +- this.colorGreenTopLeft = this.colorGreenBottomLeft = this.colorGreenBottomRight = this.colorGreenTopRight = var6 * 0.6F; +- this.colorBlueTopLeft = this.colorBlueBottomLeft = this.colorBlueBottomRight = this.colorBlueTopRight = var7 * 0.6F; ++ ++ if (!var13 ? (!fancyGrass ? CTMUtils.isBetterGrass(this.blockAccess, par1Block, par2, par3, par4, 5) : false) : true) { ++ this.colorRedTopLeft = this.colorRedBottomLeft = this.colorRedBottomRight = this.colorRedTopRight = par5 * RenderPass.getAOBaseMultiplier(0.6F); ++ this.colorGreenTopLeft = this.colorGreenBottomLeft = this.colorGreenBottomRight = this.colorGreenTopRight = par6 * RenderPass.getAOBaseMultiplier(0.6F); ++ this.colorBlueTopLeft = this.colorBlueBottomLeft = this.colorBlueBottomRight = this.colorBlueTopRight = par7 * RenderPass.getAOBaseMultiplier(0.6F); + } else { +- this.colorRedTopLeft = this.colorRedBottomLeft = this.colorRedBottomRight = this.colorRedTopRight = 0.6F; +- this.colorGreenTopLeft = this.colorGreenBottomLeft = this.colorGreenBottomRight = this.colorGreenTopRight = 0.6F; +- this.colorBlueTopLeft = this.colorBlueBottomLeft = this.colorBlueBottomRight = this.colorBlueTopRight = 0.6F; ++ this.colorRedTopLeft = this.colorRedBottomLeft = this.colorRedBottomRight = this.colorRedTopRight = RenderPass.getAOBaseMultiplier(0.6F); ++ this.colorGreenTopLeft = this.colorGreenBottomLeft = this.colorGreenBottomRight = this.colorGreenTopRight = RenderPass.getAOBaseMultiplier(0.6F); ++ this.colorBlueTopLeft = this.colorBlueBottomLeft = this.colorBlueBottomRight = this.colorBlueTopRight = RenderPass.getAOBaseMultiplier(0.6F); + } + + this.colorRedTopLeft *= var9; +@@ -3919,22 +4573,23 @@ + this.colorRedTopRight *= var12; + this.colorGreenTopRight *= var12; + this.colorBlueTopRight *= var12; +- var22 = this.getBlockIcon(var1, this.blockAccess, var2, var3, var4, 5); +- this.renderFaceXPos(var1, (double)var2, (double)var3, (double)var4, var22); +- if(fancyGrass && var22.getIconName().equals("grass_side") && !this.hasOverrideBlockTexture()) { +- this.colorRedTopLeft *= var5; +- this.colorRedBottomLeft *= var5; +- this.colorRedBottomRight *= var5; +- this.colorRedTopRight *= var5; +- this.colorGreenTopLeft *= var6; +- this.colorGreenBottomLeft *= var6; +- this.colorGreenBottomRight *= var6; +- this.colorGreenTopRight *= var6; +- this.colorBlueTopLeft *= var7; +- this.colorBlueBottomLeft *= var7; +- this.colorBlueBottomRight *= var7; +- this.colorBlueTopRight *= var7; +- this.renderFaceXPos(var1, (double)var2, (double)var3, (double)var4, BlockGrass.getIconSideOverlay()); ++ var22 = this.getBlockIcon(par1Block, this.blockAccess, par2, par3, par4, 5); ++ this.renderFaceXPos(par1Block, (double)par2, (double)par3, (double)par4, var22); ++ ++ if (fancyGrass && var22.getIconName().equals("grass_side") && !this.hasOverrideBlockTexture()) { ++ this.colorRedTopLeft *= par5; ++ this.colorRedBottomLeft *= par5; ++ this.colorRedBottomRight *= par5; ++ this.colorRedTopRight *= par5; ++ this.colorGreenTopLeft *= par6; ++ this.colorGreenBottomLeft *= par6; ++ this.colorGreenBottomRight *= par6; ++ this.colorGreenTopRight *= par6; ++ this.colorBlueTopLeft *= par7; ++ this.colorBlueBottomLeft *= par7; ++ this.colorBlueBottomRight *= par7; ++ this.colorBlueTopRight *= par7; ++ this.renderFaceXPos(par1Block, (double)par2, (double)par3, (double)par4, BlockGrass.getIconSideOverlay()); + } + + var8 = true; +@@ -3944,7 +4599,10 @@ + return var8; + } + +- public boolean renderStandardBlockWithAmbientOcclusionPartial(Block var1, int var2, int var3, int var4, float var5, float var6, float var7) { ++ /** ++ * Renders non-full-cube block with ambient occusion. Args: block, x, y, z, red, green, blue (lighting) ++ */ ++ public boolean renderStandardBlockWithAmbientOcclusionPartial(Block par1Block, int par2, int par3, int par4, float par5, float par6, float par7) { + this.enableAO = true; + boolean var8 = false; + float var9 = 0.0F; +@@ -3952,80 +4610,84 @@ + float var11 = 0.0F; + float var12 = 0.0F; + boolean var13 = true; +- int var14 = var1.getMixedBrightnessForBlock(this.blockAccess, var2, var3, var4); ++ int var14 = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2, par3, par4); + Tessellator var15 = Tessellator.instance; + var15.setBrightness(983055); +- if(this.getBlockIcon(var1).getIconName().equals("grass_top")) { ++ ++ if (this.getBlockIcon(par1Block).getIconName().equals("grass_top")) { + var13 = false; +- } else if(this.hasOverrideBlockTexture()) { ++ } else if (this.hasOverrideBlockTexture()) { + var13 = false; + } + +- boolean var16; + boolean var17; +- boolean var18; ++ boolean var16; + boolean var19; +- int var20; ++ boolean var18; + float var21; +- if(this.renderAllFaces || var1.shouldSideBeRendered(this.blockAccess, var2, var3 - 1, var4, 0)) { +- if(this.renderMinY <= 0.0D) { +- --var3; ++ int var20; ++ ++ if (this.renderAllFaces || RenderPass.shouldSideBeRendered(par1Block, this.blockAccess, par2, par3 - 1, par4, 0)) { ++ if (this.renderMinY <= 0.0D) { ++ --par3; + } + +- this.aoBrightnessXYNN = var1.getMixedBrightnessForBlock(this.blockAccess, var2 - 1, var3, var4); +- this.aoBrightnessYZNN = var1.getMixedBrightnessForBlock(this.blockAccess, var2, var3, var4 - 1); +- this.aoBrightnessYZNP = var1.getMixedBrightnessForBlock(this.blockAccess, var2, var3, var4 + 1); +- this.aoBrightnessXYPN = var1.getMixedBrightnessForBlock(this.blockAccess, var2 + 1, var3, var4); +- this.aoLightValueScratchXYNN = var1.getAmbientOcclusionLightValue(this.blockAccess, var2 - 1, var3, var4); +- this.aoLightValueScratchYZNN = var1.getAmbientOcclusionLightValue(this.blockAccess, var2, var3, var4 - 1); +- this.aoLightValueScratchYZNP = var1.getAmbientOcclusionLightValue(this.blockAccess, var2, var3, var4 + 1); +- this.aoLightValueScratchXYPN = var1.getAmbientOcclusionLightValue(this.blockAccess, var2 + 1, var3, var4); +- var16 = Block.canBlockGrass[this.blockAccess.getBlockId(var2 + 1, var3 - 1, var4)]; +- var17 = Block.canBlockGrass[this.blockAccess.getBlockId(var2 - 1, var3 - 1, var4)]; +- var18 = Block.canBlockGrass[this.blockAccess.getBlockId(var2, var3 - 1, var4 + 1)]; +- var19 = Block.canBlockGrass[this.blockAccess.getBlockId(var2, var3 - 1, var4 - 1)]; +- if(!var19 && !var17) { ++ this.aoBrightnessXYNN = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2 - 1, par3, par4); ++ this.aoBrightnessYZNN = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2, par3, par4 - 1); ++ this.aoBrightnessYZNP = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2, par3, par4 + 1); ++ this.aoBrightnessXYPN = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2 + 1, par3, par4); ++ this.aoLightValueScratchXYNN = par1Block.getAmbientOcclusionLightValue(this.blockAccess, par2 - 1, par3, par4); ++ this.aoLightValueScratchYZNN = par1Block.getAmbientOcclusionLightValue(this.blockAccess, par2, par3, par4 - 1); ++ this.aoLightValueScratchYZNP = par1Block.getAmbientOcclusionLightValue(this.blockAccess, par2, par3, par4 + 1); ++ this.aoLightValueScratchXYPN = par1Block.getAmbientOcclusionLightValue(this.blockAccess, par2 + 1, par3, par4); ++ var16 = Block.canBlockGrass[this.blockAccess.getBlockId(par2 + 1, par3 - 1, par4)]; ++ var17 = Block.canBlockGrass[this.blockAccess.getBlockId(par2 - 1, par3 - 1, par4)]; ++ var18 = Block.canBlockGrass[this.blockAccess.getBlockId(par2, par3 - 1, par4 + 1)]; ++ var19 = Block.canBlockGrass[this.blockAccess.getBlockId(par2, par3 - 1, par4 - 1)]; ++ ++ if (!var19 && !var17) { + this.aoLightValueScratchXYZNNN = this.aoLightValueScratchXYNN; + this.aoBrightnessXYZNNN = this.aoBrightnessXYNN; + } else { +- this.aoLightValueScratchXYZNNN = var1.getAmbientOcclusionLightValue(this.blockAccess, var2 - 1, var3, var4 - 1); +- this.aoBrightnessXYZNNN = var1.getMixedBrightnessForBlock(this.blockAccess, var2 - 1, var3, var4 - 1); ++ this.aoLightValueScratchXYZNNN = par1Block.getAmbientOcclusionLightValue(this.blockAccess, par2 - 1, par3, par4 - 1); ++ this.aoBrightnessXYZNNN = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2 - 1, par3, par4 - 1); + } + +- if(!var18 && !var17) { ++ if (!var18 && !var17) { + this.aoLightValueScratchXYZNNP = this.aoLightValueScratchXYNN; + this.aoBrightnessXYZNNP = this.aoBrightnessXYNN; + } else { +- this.aoLightValueScratchXYZNNP = var1.getAmbientOcclusionLightValue(this.blockAccess, var2 - 1, var3, var4 + 1); +- this.aoBrightnessXYZNNP = var1.getMixedBrightnessForBlock(this.blockAccess, var2 - 1, var3, var4 + 1); ++ this.aoLightValueScratchXYZNNP = par1Block.getAmbientOcclusionLightValue(this.blockAccess, par2 - 1, par3, par4 + 1); ++ this.aoBrightnessXYZNNP = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2 - 1, par3, par4 + 1); + } + +- if(!var19 && !var16) { ++ if (!var19 && !var16) { + this.aoLightValueScratchXYZPNN = this.aoLightValueScratchXYPN; + this.aoBrightnessXYZPNN = this.aoBrightnessXYPN; + } else { +- this.aoLightValueScratchXYZPNN = var1.getAmbientOcclusionLightValue(this.blockAccess, var2 + 1, var3, var4 - 1); +- this.aoBrightnessXYZPNN = var1.getMixedBrightnessForBlock(this.blockAccess, var2 + 1, var3, var4 - 1); ++ this.aoLightValueScratchXYZPNN = par1Block.getAmbientOcclusionLightValue(this.blockAccess, par2 + 1, par3, par4 - 1); ++ this.aoBrightnessXYZPNN = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2 + 1, par3, par4 - 1); + } + +- if(!var18 && !var16) { ++ if (!var18 && !var16) { + this.aoLightValueScratchXYZPNP = this.aoLightValueScratchXYPN; + this.aoBrightnessXYZPNP = this.aoBrightnessXYPN; + } else { +- this.aoLightValueScratchXYZPNP = var1.getAmbientOcclusionLightValue(this.blockAccess, var2 + 1, var3, var4 + 1); +- this.aoBrightnessXYZPNP = var1.getMixedBrightnessForBlock(this.blockAccess, var2 + 1, var3, var4 + 1); ++ this.aoLightValueScratchXYZPNP = par1Block.getAmbientOcclusionLightValue(this.blockAccess, par2 + 1, par3, par4 + 1); ++ this.aoBrightnessXYZPNP = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2 + 1, par3, par4 + 1); + } + +- if(this.renderMinY <= 0.0D) { +- ++var3; ++ if (this.renderMinY <= 0.0D) { ++ ++par3; + } + + var20 = var14; +- if(this.renderMinY <= 0.0D || !this.blockAccess.isBlockOpaqueCube(var2, var3 - 1, var4)) { +- var20 = var1.getMixedBrightnessForBlock(this.blockAccess, var2, var3 - 1, var4); ++ ++ if (this.renderMinY <= 0.0D || !this.blockAccess.isBlockOpaqueCube(par2, par3 - 1, par4)) { ++ var20 = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2, par3 - 1, par4); + } + +- var21 = var1.getAmbientOcclusionLightValue(this.blockAccess, var2, var3 - 1, var4); ++ var21 = par1Block.getAmbientOcclusionLightValue(this.blockAccess, par2, par3 - 1, par4); + var9 = (this.aoLightValueScratchXYZNNP + this.aoLightValueScratchXYNN + this.aoLightValueScratchYZNP + var21) / 4.0F; + var12 = (this.aoLightValueScratchYZNP + var21 + this.aoLightValueScratchXYZPNP + this.aoLightValueScratchXYPN) / 4.0F; + var11 = (var21 + this.aoLightValueScratchYZNN + this.aoLightValueScratchXYPN + this.aoLightValueScratchXYZPNN) / 4.0F; +@@ -4034,10 +4696,11 @@ + this.brightnessTopRight = this.getAoBrightness(this.aoBrightnessYZNP, this.aoBrightnessXYZPNP, this.aoBrightnessXYPN, var20); + this.brightnessBottomRight = this.getAoBrightness(this.aoBrightnessYZNN, this.aoBrightnessXYPN, this.aoBrightnessXYZPNN, var20); + this.brightnessBottomLeft = this.getAoBrightness(this.aoBrightnessXYNN, this.aoBrightnessXYZNNN, this.aoBrightnessYZNN, var20); +- if(var13) { +- this.colorRedTopLeft = this.colorRedBottomLeft = this.colorRedBottomRight = this.colorRedTopRight = var5 * 0.5F; +- this.colorGreenTopLeft = this.colorGreenBottomLeft = this.colorGreenBottomRight = this.colorGreenTopRight = var6 * 0.5F; +- this.colorBlueTopLeft = this.colorBlueBottomLeft = this.colorBlueBottomRight = this.colorBlueTopRight = var7 * 0.5F; ++ ++ if (var13) { ++ this.colorRedTopLeft = this.colorRedBottomLeft = this.colorRedBottomRight = this.colorRedTopRight = par5 * 0.5F; ++ this.colorGreenTopLeft = this.colorGreenBottomLeft = this.colorGreenBottomRight = this.colorGreenTopRight = par6 * 0.5F; ++ this.colorBlueTopLeft = this.colorBlueBottomLeft = this.colorBlueBottomRight = this.colorBlueTopRight = par7 * 0.5F; + } else { + this.colorRedTopLeft = this.colorRedBottomLeft = this.colorRedBottomRight = this.colorRedTopRight = 0.5F; + this.colorGreenTopLeft = this.colorGreenBottomLeft = this.colorGreenBottomRight = this.colorGreenTopRight = 0.5F; +@@ -4056,69 +4719,71 @@ + this.colorRedTopRight *= var12; + this.colorGreenTopRight *= var12; + this.colorBlueTopRight *= var12; +- this.renderFaceYNeg(var1, (double)var2, (double)var3, (double)var4, this.getBlockIcon(var1, this.blockAccess, var2, var3, var4, 0)); ++ this.renderFaceYNeg(par1Block, (double)par2, (double)par3, (double)par4, this.getBlockIcon(par1Block, this.blockAccess, par2, par3, par4, 0)); + var8 = true; + } + +- if(this.renderAllFaces || var1.shouldSideBeRendered(this.blockAccess, var2, var3 + 1, var4, 1)) { +- if(this.renderMaxY >= 1.0D) { +- ++var3; ++ if (this.renderAllFaces || RenderPass.shouldSideBeRendered(par1Block, this.blockAccess, par2, par3 + 1, par4, 1)) { ++ if (this.renderMaxY >= 1.0D) { ++ ++par3; + } + +- this.aoBrightnessXYNP = var1.getMixedBrightnessForBlock(this.blockAccess, var2 - 1, var3, var4); +- this.aoBrightnessXYPP = var1.getMixedBrightnessForBlock(this.blockAccess, var2 + 1, var3, var4); +- this.aoBrightnessYZPN = var1.getMixedBrightnessForBlock(this.blockAccess, var2, var3, var4 - 1); +- this.aoBrightnessYZPP = var1.getMixedBrightnessForBlock(this.blockAccess, var2, var3, var4 + 1); +- this.aoLightValueScratchXYNP = var1.getAmbientOcclusionLightValue(this.blockAccess, var2 - 1, var3, var4); +- this.aoLightValueScratchXYPP = var1.getAmbientOcclusionLightValue(this.blockAccess, var2 + 1, var3, var4); +- this.aoLightValueScratchYZPN = var1.getAmbientOcclusionLightValue(this.blockAccess, var2, var3, var4 - 1); +- this.aoLightValueScratchYZPP = var1.getAmbientOcclusionLightValue(this.blockAccess, var2, var3, var4 + 1); +- var16 = Block.canBlockGrass[this.blockAccess.getBlockId(var2 + 1, var3 + 1, var4)]; +- var17 = Block.canBlockGrass[this.blockAccess.getBlockId(var2 - 1, var3 + 1, var4)]; +- var18 = Block.canBlockGrass[this.blockAccess.getBlockId(var2, var3 + 1, var4 + 1)]; +- var19 = Block.canBlockGrass[this.blockAccess.getBlockId(var2, var3 + 1, var4 - 1)]; +- if(!var19 && !var17) { ++ this.aoBrightnessXYNP = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2 - 1, par3, par4); ++ this.aoBrightnessXYPP = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2 + 1, par3, par4); ++ this.aoBrightnessYZPN = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2, par3, par4 - 1); ++ this.aoBrightnessYZPP = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2, par3, par4 + 1); ++ this.aoLightValueScratchXYNP = par1Block.getAmbientOcclusionLightValue(this.blockAccess, par2 - 1, par3, par4); ++ this.aoLightValueScratchXYPP = par1Block.getAmbientOcclusionLightValue(this.blockAccess, par2 + 1, par3, par4); ++ this.aoLightValueScratchYZPN = par1Block.getAmbientOcclusionLightValue(this.blockAccess, par2, par3, par4 - 1); ++ this.aoLightValueScratchYZPP = par1Block.getAmbientOcclusionLightValue(this.blockAccess, par2, par3, par4 + 1); ++ var16 = Block.canBlockGrass[this.blockAccess.getBlockId(par2 + 1, par3 + 1, par4)]; ++ var17 = Block.canBlockGrass[this.blockAccess.getBlockId(par2 - 1, par3 + 1, par4)]; ++ var18 = Block.canBlockGrass[this.blockAccess.getBlockId(par2, par3 + 1, par4 + 1)]; ++ var19 = Block.canBlockGrass[this.blockAccess.getBlockId(par2, par3 + 1, par4 - 1)]; ++ ++ if (!var19 && !var17) { + this.aoLightValueScratchXYZNPN = this.aoLightValueScratchXYNP; + this.aoBrightnessXYZNPN = this.aoBrightnessXYNP; + } else { +- this.aoLightValueScratchXYZNPN = var1.getAmbientOcclusionLightValue(this.blockAccess, var2 - 1, var3, var4 - 1); +- this.aoBrightnessXYZNPN = var1.getMixedBrightnessForBlock(this.blockAccess, var2 - 1, var3, var4 - 1); ++ this.aoLightValueScratchXYZNPN = par1Block.getAmbientOcclusionLightValue(this.blockAccess, par2 - 1, par3, par4 - 1); ++ this.aoBrightnessXYZNPN = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2 - 1, par3, par4 - 1); + } + +- if(!var19 && !var16) { ++ if (!var19 && !var16) { + this.aoLightValueScratchXYZPPN = this.aoLightValueScratchXYPP; + this.aoBrightnessXYZPPN = this.aoBrightnessXYPP; + } else { +- this.aoLightValueScratchXYZPPN = var1.getAmbientOcclusionLightValue(this.blockAccess, var2 + 1, var3, var4 - 1); +- this.aoBrightnessXYZPPN = var1.getMixedBrightnessForBlock(this.blockAccess, var2 + 1, var3, var4 - 1); ++ this.aoLightValueScratchXYZPPN = par1Block.getAmbientOcclusionLightValue(this.blockAccess, par2 + 1, par3, par4 - 1); ++ this.aoBrightnessXYZPPN = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2 + 1, par3, par4 - 1); + } + +- if(!var18 && !var17) { ++ if (!var18 && !var17) { + this.aoLightValueScratchXYZNPP = this.aoLightValueScratchXYNP; + this.aoBrightnessXYZNPP = this.aoBrightnessXYNP; + } else { +- this.aoLightValueScratchXYZNPP = var1.getAmbientOcclusionLightValue(this.blockAccess, var2 - 1, var3, var4 + 1); +- this.aoBrightnessXYZNPP = var1.getMixedBrightnessForBlock(this.blockAccess, var2 - 1, var3, var4 + 1); ++ this.aoLightValueScratchXYZNPP = par1Block.getAmbientOcclusionLightValue(this.blockAccess, par2 - 1, par3, par4 + 1); ++ this.aoBrightnessXYZNPP = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2 - 1, par3, par4 + 1); + } + +- if(!var18 && !var16) { ++ if (!var18 && !var16) { + this.aoLightValueScratchXYZPPP = this.aoLightValueScratchXYPP; + this.aoBrightnessXYZPPP = this.aoBrightnessXYPP; + } else { +- this.aoLightValueScratchXYZPPP = var1.getAmbientOcclusionLightValue(this.blockAccess, var2 + 1, var3, var4 + 1); +- this.aoBrightnessXYZPPP = var1.getMixedBrightnessForBlock(this.blockAccess, var2 + 1, var3, var4 + 1); ++ this.aoLightValueScratchXYZPPP = par1Block.getAmbientOcclusionLightValue(this.blockAccess, par2 + 1, par3, par4 + 1); ++ this.aoBrightnessXYZPPP = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2 + 1, par3, par4 + 1); + } + +- if(this.renderMaxY >= 1.0D) { +- --var3; ++ if (this.renderMaxY >= 1.0D) { ++ --par3; + } + + var20 = var14; +- if(this.renderMaxY >= 1.0D || !this.blockAccess.isBlockOpaqueCube(var2, var3 + 1, var4)) { +- var20 = var1.getMixedBrightnessForBlock(this.blockAccess, var2, var3 + 1, var4); ++ ++ if (this.renderMaxY >= 1.0D || !this.blockAccess.isBlockOpaqueCube(par2, par3 + 1, par4)) { ++ var20 = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2, par3 + 1, par4); + } + +- var21 = var1.getAmbientOcclusionLightValue(this.blockAccess, var2, var3 + 1, var4); ++ var21 = par1Block.getAmbientOcclusionLightValue(this.blockAccess, par2, par3 + 1, par4); + var12 = (this.aoLightValueScratchXYZNPP + this.aoLightValueScratchXYNP + this.aoLightValueScratchYZPP + var21) / 4.0F; + var9 = (this.aoLightValueScratchYZPP + var21 + this.aoLightValueScratchXYZPPP + this.aoLightValueScratchXYPP) / 4.0F; + var10 = (var21 + this.aoLightValueScratchYZPN + this.aoLightValueScratchXYPP + this.aoLightValueScratchXYZPPN) / 4.0F; +@@ -4127,9 +4792,9 @@ + this.brightnessTopLeft = this.getAoBrightness(this.aoBrightnessYZPP, this.aoBrightnessXYZPPP, this.aoBrightnessXYPP, var20); + this.brightnessBottomLeft = this.getAoBrightness(this.aoBrightnessYZPN, this.aoBrightnessXYPP, this.aoBrightnessXYZPPN, var20); + this.brightnessBottomRight = this.getAoBrightness(this.aoBrightnessXYNP, this.aoBrightnessXYZNPN, this.aoBrightnessYZPN, var20); +- this.colorRedTopLeft = this.colorRedBottomLeft = this.colorRedBottomRight = this.colorRedTopRight = var5; +- this.colorGreenTopLeft = this.colorGreenBottomLeft = this.colorGreenBottomRight = this.colorGreenTopRight = var6; +- this.colorBlueTopLeft = this.colorBlueBottomLeft = this.colorBlueBottomRight = this.colorBlueTopRight = var7; ++ this.colorRedTopLeft = this.colorRedBottomLeft = this.colorRedBottomRight = this.colorRedTopRight = par5; ++ this.colorGreenTopLeft = this.colorGreenBottomLeft = this.colorGreenBottomRight = this.colorGreenTopRight = par6; ++ this.colorBlueTopLeft = this.colorBlueBottomLeft = this.colorBlueBottomRight = this.colorBlueTopRight = par7; + this.colorRedTopLeft *= var9; + this.colorGreenTopLeft *= var9; + this.colorBlueTopLeft *= var9; +@@ -4142,78 +4807,81 @@ + this.colorRedTopRight *= var12; + this.colorGreenTopRight *= var12; + this.colorBlueTopRight *= var12; +- this.renderFaceYPos(var1, (double)var2, (double)var3, (double)var4, this.getBlockIcon(var1, this.blockAccess, var2, var3, var4, 1)); ++ this.renderFaceYPos(par1Block, (double)par2, (double)par3, (double)par4, this.getBlockIcon(par1Block, this.blockAccess, par2, par3, par4, 1)); + var8 = true; + } + +- float var22; + float var23; +- float var24; ++ float var22; + float var25; +- int var26; ++ float var24; + int var27; +- int var28; ++ int var26; + int var29; ++ int var28; + Icon var30; +- if(this.renderAllFaces || var1.shouldSideBeRendered(this.blockAccess, var2, var3, var4 - 1, 2)) { +- if(this.renderMinZ <= 0.0D) { +- --var4; ++ ++ if (this.renderAllFaces || RenderPass.shouldSideBeRendered(par1Block, this.blockAccess, par2, par3, par4 - 1, 2)) { ++ if (this.renderMinZ <= 0.0D) { ++ --par4; + } + +- this.aoLightValueScratchXZNN = var1.getAmbientOcclusionLightValue(this.blockAccess, var2 - 1, var3, var4); +- this.aoLightValueScratchYZNN = var1.getAmbientOcclusionLightValue(this.blockAccess, var2, var3 - 1, var4); +- this.aoLightValueScratchYZPN = var1.getAmbientOcclusionLightValue(this.blockAccess, var2, var3 + 1, var4); +- this.aoLightValueScratchXZPN = var1.getAmbientOcclusionLightValue(this.blockAccess, var2 + 1, var3, var4); +- this.aoBrightnessXZNN = var1.getMixedBrightnessForBlock(this.blockAccess, var2 - 1, var3, var4); +- this.aoBrightnessYZNN = var1.getMixedBrightnessForBlock(this.blockAccess, var2, var3 - 1, var4); +- this.aoBrightnessYZPN = var1.getMixedBrightnessForBlock(this.blockAccess, var2, var3 + 1, var4); +- this.aoBrightnessXZPN = var1.getMixedBrightnessForBlock(this.blockAccess, var2 + 1, var3, var4); +- var16 = Block.canBlockGrass[this.blockAccess.getBlockId(var2 + 1, var3, var4 - 1)]; +- var17 = Block.canBlockGrass[this.blockAccess.getBlockId(var2 - 1, var3, var4 - 1)]; +- var18 = Block.canBlockGrass[this.blockAccess.getBlockId(var2, var3 + 1, var4 - 1)]; +- var19 = Block.canBlockGrass[this.blockAccess.getBlockId(var2, var3 - 1, var4 - 1)]; +- if(!var17 && !var19) { ++ this.aoLightValueScratchXZNN = par1Block.getAmbientOcclusionLightValue(this.blockAccess, par2 - 1, par3, par4); ++ this.aoLightValueScratchYZNN = par1Block.getAmbientOcclusionLightValue(this.blockAccess, par2, par3 - 1, par4); ++ this.aoLightValueScratchYZPN = par1Block.getAmbientOcclusionLightValue(this.blockAccess, par2, par3 + 1, par4); ++ this.aoLightValueScratchXZPN = par1Block.getAmbientOcclusionLightValue(this.blockAccess, par2 + 1, par3, par4); ++ this.aoBrightnessXZNN = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2 - 1, par3, par4); ++ this.aoBrightnessYZNN = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2, par3 - 1, par4); ++ this.aoBrightnessYZPN = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2, par3 + 1, par4); ++ this.aoBrightnessXZPN = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2 + 1, par3, par4); ++ var16 = Block.canBlockGrass[this.blockAccess.getBlockId(par2 + 1, par3, par4 - 1)]; ++ var17 = Block.canBlockGrass[this.blockAccess.getBlockId(par2 - 1, par3, par4 - 1)]; ++ var18 = Block.canBlockGrass[this.blockAccess.getBlockId(par2, par3 + 1, par4 - 1)]; ++ var19 = Block.canBlockGrass[this.blockAccess.getBlockId(par2, par3 - 1, par4 - 1)]; ++ ++ if (!var17 && !var19) { + this.aoLightValueScratchXYZNNN = this.aoLightValueScratchXZNN; + this.aoBrightnessXYZNNN = this.aoBrightnessXZNN; + } else { +- this.aoLightValueScratchXYZNNN = var1.getAmbientOcclusionLightValue(this.blockAccess, var2 - 1, var3 - 1, var4); +- this.aoBrightnessXYZNNN = var1.getMixedBrightnessForBlock(this.blockAccess, var2 - 1, var3 - 1, var4); ++ this.aoLightValueScratchXYZNNN = par1Block.getAmbientOcclusionLightValue(this.blockAccess, par2 - 1, par3 - 1, par4); ++ this.aoBrightnessXYZNNN = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2 - 1, par3 - 1, par4); + } + +- if(!var17 && !var18) { ++ if (!var17 && !var18) { + this.aoLightValueScratchXYZNPN = this.aoLightValueScratchXZNN; + this.aoBrightnessXYZNPN = this.aoBrightnessXZNN; + } else { +- this.aoLightValueScratchXYZNPN = var1.getAmbientOcclusionLightValue(this.blockAccess, var2 - 1, var3 + 1, var4); +- this.aoBrightnessXYZNPN = var1.getMixedBrightnessForBlock(this.blockAccess, var2 - 1, var3 + 1, var4); ++ this.aoLightValueScratchXYZNPN = par1Block.getAmbientOcclusionLightValue(this.blockAccess, par2 - 1, par3 + 1, par4); ++ this.aoBrightnessXYZNPN = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2 - 1, par3 + 1, par4); + } + +- if(!var16 && !var19) { ++ if (!var16 && !var19) { + this.aoLightValueScratchXYZPNN = this.aoLightValueScratchXZPN; + this.aoBrightnessXYZPNN = this.aoBrightnessXZPN; + } else { +- this.aoLightValueScratchXYZPNN = var1.getAmbientOcclusionLightValue(this.blockAccess, var2 + 1, var3 - 1, var4); +- this.aoBrightnessXYZPNN = var1.getMixedBrightnessForBlock(this.blockAccess, var2 + 1, var3 - 1, var4); ++ this.aoLightValueScratchXYZPNN = par1Block.getAmbientOcclusionLightValue(this.blockAccess, par2 + 1, par3 - 1, par4); ++ this.aoBrightnessXYZPNN = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2 + 1, par3 - 1, par4); + } + +- if(!var16 && !var18) { ++ if (!var16 && !var18) { + this.aoLightValueScratchXYZPPN = this.aoLightValueScratchXZPN; + this.aoBrightnessXYZPPN = this.aoBrightnessXZPN; + } else { +- this.aoLightValueScratchXYZPPN = var1.getAmbientOcclusionLightValue(this.blockAccess, var2 + 1, var3 + 1, var4); +- this.aoBrightnessXYZPPN = var1.getMixedBrightnessForBlock(this.blockAccess, var2 + 1, var3 + 1, var4); ++ this.aoLightValueScratchXYZPPN = par1Block.getAmbientOcclusionLightValue(this.blockAccess, par2 + 1, par3 + 1, par4); ++ this.aoBrightnessXYZPPN = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2 + 1, par3 + 1, par4); + } + +- if(this.renderMinZ <= 0.0D) { +- ++var4; ++ if (this.renderMinZ <= 0.0D) { ++ ++par4; + } + + var20 = var14; +- if(this.renderMinZ <= 0.0D || !this.blockAccess.isBlockOpaqueCube(var2, var3, var4 - 1)) { +- var20 = var1.getMixedBrightnessForBlock(this.blockAccess, var2, var3, var4 - 1); ++ ++ if (this.renderMinZ <= 0.0D || !this.blockAccess.isBlockOpaqueCube(par2, par3, par4 - 1)) { ++ var20 = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2, par3, par4 - 1); + } + +- var21 = var1.getAmbientOcclusionLightValue(this.blockAccess, var2, var3, var4 - 1); ++ var21 = par1Block.getAmbientOcclusionLightValue(this.blockAccess, par2, par3, par4 - 1); + var22 = (this.aoLightValueScratchXZNN + this.aoLightValueScratchXYZNPN + var21 + this.aoLightValueScratchYZPN) / 4.0F; + var23 = (var21 + this.aoLightValueScratchYZPN + this.aoLightValueScratchXZPN + this.aoLightValueScratchXYZPPN) / 4.0F; + var24 = (this.aoLightValueScratchYZNN + var21 + this.aoLightValueScratchXYZPNN + this.aoLightValueScratchXZPN) / 4.0F; +@@ -4230,10 +4898,11 @@ + this.brightnessBottomLeft = this.mixAoBrightness(var26, var27, var28, var29, this.renderMaxY * (1.0D - this.renderMaxX), this.renderMaxY * this.renderMaxX, (1.0D - this.renderMaxY) * this.renderMaxX, (1.0D - this.renderMaxY) * (1.0D - this.renderMaxX)); + this.brightnessBottomRight = this.mixAoBrightness(var26, var27, var28, var29, this.renderMinY * (1.0D - this.renderMaxX), this.renderMinY * this.renderMaxX, (1.0D - this.renderMinY) * this.renderMaxX, (1.0D - this.renderMinY) * (1.0D - this.renderMaxX)); + this.brightnessTopRight = this.mixAoBrightness(var26, var27, var28, var29, this.renderMinY * (1.0D - this.renderMinX), this.renderMinY * this.renderMinX, (1.0D - this.renderMinY) * this.renderMinX, (1.0D - this.renderMinY) * (1.0D - this.renderMinX)); +- if(var13) { +- this.colorRedTopLeft = this.colorRedBottomLeft = this.colorRedBottomRight = this.colorRedTopRight = var5 * 0.8F; +- this.colorGreenTopLeft = this.colorGreenBottomLeft = this.colorGreenBottomRight = this.colorGreenTopRight = var6 * 0.8F; +- this.colorBlueTopLeft = this.colorBlueBottomLeft = this.colorBlueBottomRight = this.colorBlueTopRight = var7 * 0.8F; ++ ++ if (var13) { ++ this.colorRedTopLeft = this.colorRedBottomLeft = this.colorRedBottomRight = this.colorRedTopRight = par5 * 0.8F; ++ this.colorGreenTopLeft = this.colorGreenBottomLeft = this.colorGreenBottomRight = this.colorGreenTopRight = par6 * 0.8F; ++ this.colorBlueTopLeft = this.colorBlueBottomLeft = this.colorBlueBottomRight = this.colorBlueTopRight = par7 * 0.8F; + } else { + this.colorRedTopLeft = this.colorRedBottomLeft = this.colorRedBottomRight = this.colorRedTopRight = 0.8F; + this.colorGreenTopLeft = this.colorGreenBottomLeft = this.colorGreenBottomRight = this.colorGreenTopRight = 0.8F; +@@ -4252,86 +4921,89 @@ + this.colorRedTopRight *= var12; + this.colorGreenTopRight *= var12; + this.colorBlueTopRight *= var12; +- var30 = this.getBlockIcon(var1, this.blockAccess, var2, var3, var4, 2); +- this.renderFaceZNeg(var1, (double)var2, (double)var3, (double)var4, var30); +- if(fancyGrass && var30.getIconName().equals("grass_side") && !this.hasOverrideBlockTexture()) { +- this.colorRedTopLeft *= var5; +- this.colorRedBottomLeft *= var5; +- this.colorRedBottomRight *= var5; +- this.colorRedTopRight *= var5; +- this.colorGreenTopLeft *= var6; +- this.colorGreenBottomLeft *= var6; +- this.colorGreenBottomRight *= var6; +- this.colorGreenTopRight *= var6; +- this.colorBlueTopLeft *= var7; +- this.colorBlueBottomLeft *= var7; +- this.colorBlueBottomRight *= var7; +- this.colorBlueTopRight *= var7; +- this.renderFaceZNeg(var1, (double)var2, (double)var3, (double)var4, BlockGrass.getIconSideOverlay()); ++ var30 = this.getBlockIcon(par1Block, this.blockAccess, par2, par3, par4, 2); ++ this.renderFaceZNeg(par1Block, (double)par2, (double)par3, (double)par4, var30); ++ ++ if (fancyGrass && var30.getIconName().equals("grass_side") && !this.hasOverrideBlockTexture()) { ++ this.colorRedTopLeft *= par5; ++ this.colorRedBottomLeft *= par5; ++ this.colorRedBottomRight *= par5; ++ this.colorRedTopRight *= par5; ++ this.colorGreenTopLeft *= par6; ++ this.colorGreenBottomLeft *= par6; ++ this.colorGreenBottomRight *= par6; ++ this.colorGreenTopRight *= par6; ++ this.colorBlueTopLeft *= par7; ++ this.colorBlueBottomLeft *= par7; ++ this.colorBlueBottomRight *= par7; ++ this.colorBlueTopRight *= par7; ++ this.renderFaceZNeg(par1Block, (double)par2, (double)par3, (double)par4, BlockGrass.getIconSideOverlay()); + } + + var8 = true; + } + +- if(this.renderAllFaces || var1.shouldSideBeRendered(this.blockAccess, var2, var3, var4 + 1, 3)) { +- if(this.renderMaxZ >= 1.0D) { +- ++var4; ++ if (this.renderAllFaces || RenderPass.shouldSideBeRendered(par1Block, this.blockAccess, par2, par3, par4 + 1, 3)) { ++ if (this.renderMaxZ >= 1.0D) { ++ ++par4; + } + +- this.aoLightValueScratchXZNP = var1.getAmbientOcclusionLightValue(this.blockAccess, var2 - 1, var3, var4); +- this.aoLightValueScratchXZPP = var1.getAmbientOcclusionLightValue(this.blockAccess, var2 + 1, var3, var4); +- this.aoLightValueScratchYZNP = var1.getAmbientOcclusionLightValue(this.blockAccess, var2, var3 - 1, var4); +- this.aoLightValueScratchYZPP = var1.getAmbientOcclusionLightValue(this.blockAccess, var2, var3 + 1, var4); +- this.aoBrightnessXZNP = var1.getMixedBrightnessForBlock(this.blockAccess, var2 - 1, var3, var4); +- this.aoBrightnessXZPP = var1.getMixedBrightnessForBlock(this.blockAccess, var2 + 1, var3, var4); +- this.aoBrightnessYZNP = var1.getMixedBrightnessForBlock(this.blockAccess, var2, var3 - 1, var4); +- this.aoBrightnessYZPP = var1.getMixedBrightnessForBlock(this.blockAccess, var2, var3 + 1, var4); +- var16 = Block.canBlockGrass[this.blockAccess.getBlockId(var2 + 1, var3, var4 + 1)]; +- var17 = Block.canBlockGrass[this.blockAccess.getBlockId(var2 - 1, var3, var4 + 1)]; +- var18 = Block.canBlockGrass[this.blockAccess.getBlockId(var2, var3 + 1, var4 + 1)]; +- var19 = Block.canBlockGrass[this.blockAccess.getBlockId(var2, var3 - 1, var4 + 1)]; +- if(!var17 && !var19) { ++ this.aoLightValueScratchXZNP = par1Block.getAmbientOcclusionLightValue(this.blockAccess, par2 - 1, par3, par4); ++ this.aoLightValueScratchXZPP = par1Block.getAmbientOcclusionLightValue(this.blockAccess, par2 + 1, par3, par4); ++ this.aoLightValueScratchYZNP = par1Block.getAmbientOcclusionLightValue(this.blockAccess, par2, par3 - 1, par4); ++ this.aoLightValueScratchYZPP = par1Block.getAmbientOcclusionLightValue(this.blockAccess, par2, par3 + 1, par4); ++ this.aoBrightnessXZNP = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2 - 1, par3, par4); ++ this.aoBrightnessXZPP = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2 + 1, par3, par4); ++ this.aoBrightnessYZNP = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2, par3 - 1, par4); ++ this.aoBrightnessYZPP = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2, par3 + 1, par4); ++ var16 = Block.canBlockGrass[this.blockAccess.getBlockId(par2 + 1, par3, par4 + 1)]; ++ var17 = Block.canBlockGrass[this.blockAccess.getBlockId(par2 - 1, par3, par4 + 1)]; ++ var18 = Block.canBlockGrass[this.blockAccess.getBlockId(par2, par3 + 1, par4 + 1)]; ++ var19 = Block.canBlockGrass[this.blockAccess.getBlockId(par2, par3 - 1, par4 + 1)]; ++ ++ if (!var17 && !var19) { + this.aoLightValueScratchXYZNNP = this.aoLightValueScratchXZNP; + this.aoBrightnessXYZNNP = this.aoBrightnessXZNP; + } else { +- this.aoLightValueScratchXYZNNP = var1.getAmbientOcclusionLightValue(this.blockAccess, var2 - 1, var3 - 1, var4); +- this.aoBrightnessXYZNNP = var1.getMixedBrightnessForBlock(this.blockAccess, var2 - 1, var3 - 1, var4); ++ this.aoLightValueScratchXYZNNP = par1Block.getAmbientOcclusionLightValue(this.blockAccess, par2 - 1, par3 - 1, par4); ++ this.aoBrightnessXYZNNP = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2 - 1, par3 - 1, par4); + } + +- if(!var17 && !var18) { ++ if (!var17 && !var18) { + this.aoLightValueScratchXYZNPP = this.aoLightValueScratchXZNP; + this.aoBrightnessXYZNPP = this.aoBrightnessXZNP; + } else { +- this.aoLightValueScratchXYZNPP = var1.getAmbientOcclusionLightValue(this.blockAccess, var2 - 1, var3 + 1, var4); +- this.aoBrightnessXYZNPP = var1.getMixedBrightnessForBlock(this.blockAccess, var2 - 1, var3 + 1, var4); ++ this.aoLightValueScratchXYZNPP = par1Block.getAmbientOcclusionLightValue(this.blockAccess, par2 - 1, par3 + 1, par4); ++ this.aoBrightnessXYZNPP = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2 - 1, par3 + 1, par4); + } + +- if(!var16 && !var19) { ++ if (!var16 && !var19) { + this.aoLightValueScratchXYZPNP = this.aoLightValueScratchXZPP; + this.aoBrightnessXYZPNP = this.aoBrightnessXZPP; + } else { +- this.aoLightValueScratchXYZPNP = var1.getAmbientOcclusionLightValue(this.blockAccess, var2 + 1, var3 - 1, var4); +- this.aoBrightnessXYZPNP = var1.getMixedBrightnessForBlock(this.blockAccess, var2 + 1, var3 - 1, var4); ++ this.aoLightValueScratchXYZPNP = par1Block.getAmbientOcclusionLightValue(this.blockAccess, par2 + 1, par3 - 1, par4); ++ this.aoBrightnessXYZPNP = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2 + 1, par3 - 1, par4); + } + +- if(!var16 && !var18) { ++ if (!var16 && !var18) { + this.aoLightValueScratchXYZPPP = this.aoLightValueScratchXZPP; + this.aoBrightnessXYZPPP = this.aoBrightnessXZPP; + } else { +- this.aoLightValueScratchXYZPPP = var1.getAmbientOcclusionLightValue(this.blockAccess, var2 + 1, var3 + 1, var4); +- this.aoBrightnessXYZPPP = var1.getMixedBrightnessForBlock(this.blockAccess, var2 + 1, var3 + 1, var4); ++ this.aoLightValueScratchXYZPPP = par1Block.getAmbientOcclusionLightValue(this.blockAccess, par2 + 1, par3 + 1, par4); ++ this.aoBrightnessXYZPPP = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2 + 1, par3 + 1, par4); + } + +- if(this.renderMaxZ >= 1.0D) { +- --var4; ++ if (this.renderMaxZ >= 1.0D) { ++ --par4; + } + + var20 = var14; +- if(this.renderMaxZ >= 1.0D || !this.blockAccess.isBlockOpaqueCube(var2, var3, var4 + 1)) { +- var20 = var1.getMixedBrightnessForBlock(this.blockAccess, var2, var3, var4 + 1); ++ ++ if (this.renderMaxZ >= 1.0D || !this.blockAccess.isBlockOpaqueCube(par2, par3, par4 + 1)) { ++ var20 = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2, par3, par4 + 1); + } + +- var21 = var1.getAmbientOcclusionLightValue(this.blockAccess, var2, var3, var4 + 1); ++ var21 = par1Block.getAmbientOcclusionLightValue(this.blockAccess, par2, par3, par4 + 1); + var22 = (this.aoLightValueScratchXZNP + this.aoLightValueScratchXYZNPP + var21 + this.aoLightValueScratchYZPP) / 4.0F; + var23 = (var21 + this.aoLightValueScratchYZPP + this.aoLightValueScratchXZPP + this.aoLightValueScratchXYZPPP) / 4.0F; + var24 = (this.aoLightValueScratchYZNP + var21 + this.aoLightValueScratchXYZPNP + this.aoLightValueScratchXZPP) / 4.0F; +@@ -4348,10 +5020,11 @@ + this.brightnessBottomLeft = this.mixAoBrightness(var26, var29, var28, var27, this.renderMinY * (1.0D - this.renderMinX), (1.0D - this.renderMinY) * (1.0D - this.renderMinX), (1.0D - this.renderMinY) * this.renderMinX, this.renderMinY * this.renderMinX); + this.brightnessBottomRight = this.mixAoBrightness(var26, var29, var28, var27, this.renderMinY * (1.0D - this.renderMaxX), (1.0D - this.renderMinY) * (1.0D - this.renderMaxX), (1.0D - this.renderMinY) * this.renderMaxX, this.renderMinY * this.renderMaxX); + this.brightnessTopRight = this.mixAoBrightness(var26, var29, var28, var27, this.renderMaxY * (1.0D - this.renderMaxX), (1.0D - this.renderMaxY) * (1.0D - this.renderMaxX), (1.0D - this.renderMaxY) * this.renderMaxX, this.renderMaxY * this.renderMaxX); +- if(var13) { +- this.colorRedTopLeft = this.colorRedBottomLeft = this.colorRedBottomRight = this.colorRedTopRight = var5 * 0.8F; +- this.colorGreenTopLeft = this.colorGreenBottomLeft = this.colorGreenBottomRight = this.colorGreenTopRight = var6 * 0.8F; +- this.colorBlueTopLeft = this.colorBlueBottomLeft = this.colorBlueBottomRight = this.colorBlueTopRight = var7 * 0.8F; ++ ++ if (var13) { ++ this.colorRedTopLeft = this.colorRedBottomLeft = this.colorRedBottomRight = this.colorRedTopRight = par5 * 0.8F; ++ this.colorGreenTopLeft = this.colorGreenBottomLeft = this.colorGreenBottomRight = this.colorGreenTopRight = par6 * 0.8F; ++ this.colorBlueTopLeft = this.colorBlueBottomLeft = this.colorBlueBottomRight = this.colorBlueTopRight = par7 * 0.8F; + } else { + this.colorRedTopLeft = this.colorRedBottomLeft = this.colorRedBottomRight = this.colorRedTopRight = 0.8F; + this.colorGreenTopLeft = this.colorGreenBottomLeft = this.colorGreenBottomRight = this.colorGreenTopRight = 0.8F; +@@ -4370,86 +5043,89 @@ + this.colorRedTopRight *= var12; + this.colorGreenTopRight *= var12; + this.colorBlueTopRight *= var12; +- var30 = this.getBlockIcon(var1, this.blockAccess, var2, var3, var4, 3); +- this.renderFaceZPos(var1, (double)var2, (double)var3, (double)var4, this.getBlockIcon(var1, this.blockAccess, var2, var3, var4, 3)); +- if(fancyGrass && var30.getIconName().equals("grass_side") && !this.hasOverrideBlockTexture()) { +- this.colorRedTopLeft *= var5; +- this.colorRedBottomLeft *= var5; +- this.colorRedBottomRight *= var5; +- this.colorRedTopRight *= var5; +- this.colorGreenTopLeft *= var6; +- this.colorGreenBottomLeft *= var6; +- this.colorGreenBottomRight *= var6; +- this.colorGreenTopRight *= var6; +- this.colorBlueTopLeft *= var7; +- this.colorBlueBottomLeft *= var7; +- this.colorBlueBottomRight *= var7; +- this.colorBlueTopRight *= var7; +- this.renderFaceZPos(var1, (double)var2, (double)var3, (double)var4, BlockGrass.getIconSideOverlay()); ++ var30 = this.getBlockIcon(par1Block, this.blockAccess, par2, par3, par4, 3); ++ this.renderFaceZPos(par1Block, (double)par2, (double)par3, (double)par4, this.getBlockIcon(par1Block, this.blockAccess, par2, par3, par4, 3)); ++ ++ if (fancyGrass && var30.getIconName().equals("grass_side") && !this.hasOverrideBlockTexture()) { ++ this.colorRedTopLeft *= par5; ++ this.colorRedBottomLeft *= par5; ++ this.colorRedBottomRight *= par5; ++ this.colorRedTopRight *= par5; ++ this.colorGreenTopLeft *= par6; ++ this.colorGreenBottomLeft *= par6; ++ this.colorGreenBottomRight *= par6; ++ this.colorGreenTopRight *= par6; ++ this.colorBlueTopLeft *= par7; ++ this.colorBlueBottomLeft *= par7; ++ this.colorBlueBottomRight *= par7; ++ this.colorBlueTopRight *= par7; ++ this.renderFaceZPos(par1Block, (double)par2, (double)par3, (double)par4, BlockGrass.getIconSideOverlay()); + } + + var8 = true; + } + +- if(this.renderAllFaces || var1.shouldSideBeRendered(this.blockAccess, var2 - 1, var3, var4, 4)) { +- if(this.renderMinX <= 0.0D) { +- --var2; ++ if (this.renderAllFaces || RenderPass.shouldSideBeRendered(par1Block, this.blockAccess, par2 - 1, par3, par4, 4)) { ++ if (this.renderMinX <= 0.0D) { ++ --par2; + } + +- this.aoLightValueScratchXYNN = var1.getAmbientOcclusionLightValue(this.blockAccess, var2, var3 - 1, var4); +- this.aoLightValueScratchXZNN = var1.getAmbientOcclusionLightValue(this.blockAccess, var2, var3, var4 - 1); +- this.aoLightValueScratchXZNP = var1.getAmbientOcclusionLightValue(this.blockAccess, var2, var3, var4 + 1); +- this.aoLightValueScratchXYNP = var1.getAmbientOcclusionLightValue(this.blockAccess, var2, var3 + 1, var4); +- this.aoBrightnessXYNN = var1.getMixedBrightnessForBlock(this.blockAccess, var2, var3 - 1, var4); +- this.aoBrightnessXZNN = var1.getMixedBrightnessForBlock(this.blockAccess, var2, var3, var4 - 1); +- this.aoBrightnessXZNP = var1.getMixedBrightnessForBlock(this.blockAccess, var2, var3, var4 + 1); +- this.aoBrightnessXYNP = var1.getMixedBrightnessForBlock(this.blockAccess, var2, var3 + 1, var4); +- var16 = Block.canBlockGrass[this.blockAccess.getBlockId(var2 - 1, var3 + 1, var4)]; +- var17 = Block.canBlockGrass[this.blockAccess.getBlockId(var2 - 1, var3 - 1, var4)]; +- var18 = Block.canBlockGrass[this.blockAccess.getBlockId(var2 - 1, var3, var4 - 1)]; +- var19 = Block.canBlockGrass[this.blockAccess.getBlockId(var2 - 1, var3, var4 + 1)]; +- if(!var18 && !var17) { ++ this.aoLightValueScratchXYNN = par1Block.getAmbientOcclusionLightValue(this.blockAccess, par2, par3 - 1, par4); ++ this.aoLightValueScratchXZNN = par1Block.getAmbientOcclusionLightValue(this.blockAccess, par2, par3, par4 - 1); ++ this.aoLightValueScratchXZNP = par1Block.getAmbientOcclusionLightValue(this.blockAccess, par2, par3, par4 + 1); ++ this.aoLightValueScratchXYNP = par1Block.getAmbientOcclusionLightValue(this.blockAccess, par2, par3 + 1, par4); ++ this.aoBrightnessXYNN = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2, par3 - 1, par4); ++ this.aoBrightnessXZNN = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2, par3, par4 - 1); ++ this.aoBrightnessXZNP = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2, par3, par4 + 1); ++ this.aoBrightnessXYNP = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2, par3 + 1, par4); ++ var16 = Block.canBlockGrass[this.blockAccess.getBlockId(par2 - 1, par3 + 1, par4)]; ++ var17 = Block.canBlockGrass[this.blockAccess.getBlockId(par2 - 1, par3 - 1, par4)]; ++ var18 = Block.canBlockGrass[this.blockAccess.getBlockId(par2 - 1, par3, par4 - 1)]; ++ var19 = Block.canBlockGrass[this.blockAccess.getBlockId(par2 - 1, par3, par4 + 1)]; ++ ++ if (!var18 && !var17) { + this.aoLightValueScratchXYZNNN = this.aoLightValueScratchXZNN; + this.aoBrightnessXYZNNN = this.aoBrightnessXZNN; + } else { +- this.aoLightValueScratchXYZNNN = var1.getAmbientOcclusionLightValue(this.blockAccess, var2, var3 - 1, var4 - 1); +- this.aoBrightnessXYZNNN = var1.getMixedBrightnessForBlock(this.blockAccess, var2, var3 - 1, var4 - 1); ++ this.aoLightValueScratchXYZNNN = par1Block.getAmbientOcclusionLightValue(this.blockAccess, par2, par3 - 1, par4 - 1); ++ this.aoBrightnessXYZNNN = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2, par3 - 1, par4 - 1); + } + +- if(!var19 && !var17) { ++ if (!var19 && !var17) { + this.aoLightValueScratchXYZNNP = this.aoLightValueScratchXZNP; + this.aoBrightnessXYZNNP = this.aoBrightnessXZNP; + } else { +- this.aoLightValueScratchXYZNNP = var1.getAmbientOcclusionLightValue(this.blockAccess, var2, var3 - 1, var4 + 1); +- this.aoBrightnessXYZNNP = var1.getMixedBrightnessForBlock(this.blockAccess, var2, var3 - 1, var4 + 1); ++ this.aoLightValueScratchXYZNNP = par1Block.getAmbientOcclusionLightValue(this.blockAccess, par2, par3 - 1, par4 + 1); ++ this.aoBrightnessXYZNNP = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2, par3 - 1, par4 + 1); + } + +- if(!var18 && !var16) { ++ if (!var18 && !var16) { + this.aoLightValueScratchXYZNPN = this.aoLightValueScratchXZNN; + this.aoBrightnessXYZNPN = this.aoBrightnessXZNN; + } else { +- this.aoLightValueScratchXYZNPN = var1.getAmbientOcclusionLightValue(this.blockAccess, var2, var3 + 1, var4 - 1); +- this.aoBrightnessXYZNPN = var1.getMixedBrightnessForBlock(this.blockAccess, var2, var3 + 1, var4 - 1); ++ this.aoLightValueScratchXYZNPN = par1Block.getAmbientOcclusionLightValue(this.blockAccess, par2, par3 + 1, par4 - 1); ++ this.aoBrightnessXYZNPN = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2, par3 + 1, par4 - 1); + } + +- if(!var19 && !var16) { ++ if (!var19 && !var16) { + this.aoLightValueScratchXYZNPP = this.aoLightValueScratchXZNP; + this.aoBrightnessXYZNPP = this.aoBrightnessXZNP; + } else { +- this.aoLightValueScratchXYZNPP = var1.getAmbientOcclusionLightValue(this.blockAccess, var2, var3 + 1, var4 + 1); +- this.aoBrightnessXYZNPP = var1.getMixedBrightnessForBlock(this.blockAccess, var2, var3 + 1, var4 + 1); ++ this.aoLightValueScratchXYZNPP = par1Block.getAmbientOcclusionLightValue(this.blockAccess, par2, par3 + 1, par4 + 1); ++ this.aoBrightnessXYZNPP = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2, par3 + 1, par4 + 1); + } + +- if(this.renderMinX <= 0.0D) { +- ++var2; ++ if (this.renderMinX <= 0.0D) { ++ ++par2; + } + + var20 = var14; +- if(this.renderMinX <= 0.0D || !this.blockAccess.isBlockOpaqueCube(var2 - 1, var3, var4)) { +- var20 = var1.getMixedBrightnessForBlock(this.blockAccess, var2 - 1, var3, var4); ++ ++ if (this.renderMinX <= 0.0D || !this.blockAccess.isBlockOpaqueCube(par2 - 1, par3, par4)) { ++ var20 = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2 - 1, par3, par4); + } + +- var21 = var1.getAmbientOcclusionLightValue(this.blockAccess, var2 - 1, var3, var4); ++ var21 = par1Block.getAmbientOcclusionLightValue(this.blockAccess, par2 - 1, par3, par4); + var22 = (this.aoLightValueScratchXYNN + this.aoLightValueScratchXYZNNP + var21 + this.aoLightValueScratchXZNP) / 4.0F; + var23 = (var21 + this.aoLightValueScratchXZNP + this.aoLightValueScratchXYNP + this.aoLightValueScratchXYZNPP) / 4.0F; + var24 = (this.aoLightValueScratchXZNN + var21 + this.aoLightValueScratchXYZNPN + this.aoLightValueScratchXYNP) / 4.0F; +@@ -4466,10 +5142,11 @@ + this.brightnessBottomLeft = this.mixAoBrightness(var27, var28, var29, var26, this.renderMaxY * this.renderMinZ, this.renderMaxY * (1.0D - this.renderMinZ), (1.0D - this.renderMaxY) * (1.0D - this.renderMinZ), (1.0D - this.renderMaxY) * this.renderMinZ); + this.brightnessBottomRight = this.mixAoBrightness(var27, var28, var29, var26, this.renderMinY * this.renderMinZ, this.renderMinY * (1.0D - this.renderMinZ), (1.0D - this.renderMinY) * (1.0D - this.renderMinZ), (1.0D - this.renderMinY) * this.renderMinZ); + this.brightnessTopRight = this.mixAoBrightness(var27, var28, var29, var26, this.renderMinY * this.renderMaxZ, this.renderMinY * (1.0D - this.renderMaxZ), (1.0D - this.renderMinY) * (1.0D - this.renderMaxZ), (1.0D - this.renderMinY) * this.renderMaxZ); +- if(var13) { +- this.colorRedTopLeft = this.colorRedBottomLeft = this.colorRedBottomRight = this.colorRedTopRight = var5 * 0.6F; +- this.colorGreenTopLeft = this.colorGreenBottomLeft = this.colorGreenBottomRight = this.colorGreenTopRight = var6 * 0.6F; +- this.colorBlueTopLeft = this.colorBlueBottomLeft = this.colorBlueBottomRight = this.colorBlueTopRight = var7 * 0.6F; ++ ++ if (var13) { ++ this.colorRedTopLeft = this.colorRedBottomLeft = this.colorRedBottomRight = this.colorRedTopRight = par5 * 0.6F; ++ this.colorGreenTopLeft = this.colorGreenBottomLeft = this.colorGreenBottomRight = this.colorGreenTopRight = par6 * 0.6F; ++ this.colorBlueTopLeft = this.colorBlueBottomLeft = this.colorBlueBottomRight = this.colorBlueTopRight = par7 * 0.6F; + } else { + this.colorRedTopLeft = this.colorRedBottomLeft = this.colorRedBottomRight = this.colorRedTopRight = 0.6F; + this.colorGreenTopLeft = this.colorGreenBottomLeft = this.colorGreenBottomRight = this.colorGreenTopRight = 0.6F; +@@ -4488,86 +5165,89 @@ + this.colorRedTopRight *= var12; + this.colorGreenTopRight *= var12; + this.colorBlueTopRight *= var12; +- var30 = this.getBlockIcon(var1, this.blockAccess, var2, var3, var4, 4); +- this.renderFaceXNeg(var1, (double)var2, (double)var3, (double)var4, var30); +- if(fancyGrass && var30.getIconName().equals("grass_side") && !this.hasOverrideBlockTexture()) { +- this.colorRedTopLeft *= var5; +- this.colorRedBottomLeft *= var5; +- this.colorRedBottomRight *= var5; +- this.colorRedTopRight *= var5; +- this.colorGreenTopLeft *= var6; +- this.colorGreenBottomLeft *= var6; +- this.colorGreenBottomRight *= var6; +- this.colorGreenTopRight *= var6; +- this.colorBlueTopLeft *= var7; +- this.colorBlueBottomLeft *= var7; +- this.colorBlueBottomRight *= var7; +- this.colorBlueTopRight *= var7; +- this.renderFaceXNeg(var1, (double)var2, (double)var3, (double)var4, BlockGrass.getIconSideOverlay()); ++ var30 = this.getBlockIcon(par1Block, this.blockAccess, par2, par3, par4, 4); ++ this.renderFaceXNeg(par1Block, (double)par2, (double)par3, (double)par4, var30); ++ ++ if (fancyGrass && var30.getIconName().equals("grass_side") && !this.hasOverrideBlockTexture()) { ++ this.colorRedTopLeft *= par5; ++ this.colorRedBottomLeft *= par5; ++ this.colorRedBottomRight *= par5; ++ this.colorRedTopRight *= par5; ++ this.colorGreenTopLeft *= par6; ++ this.colorGreenBottomLeft *= par6; ++ this.colorGreenBottomRight *= par6; ++ this.colorGreenTopRight *= par6; ++ this.colorBlueTopLeft *= par7; ++ this.colorBlueBottomLeft *= par7; ++ this.colorBlueBottomRight *= par7; ++ this.colorBlueTopRight *= par7; ++ this.renderFaceXNeg(par1Block, (double)par2, (double)par3, (double)par4, BlockGrass.getIconSideOverlay()); + } + + var8 = true; + } + +- if(this.renderAllFaces || var1.shouldSideBeRendered(this.blockAccess, var2 + 1, var3, var4, 5)) { +- if(this.renderMaxX >= 1.0D) { +- ++var2; ++ if (this.renderAllFaces || RenderPass.shouldSideBeRendered(par1Block, this.blockAccess, par2 + 1, par3, par4, 5)) { ++ if (this.renderMaxX >= 1.0D) { ++ ++par2; + } + +- this.aoLightValueScratchXYPN = var1.getAmbientOcclusionLightValue(this.blockAccess, var2, var3 - 1, var4); +- this.aoLightValueScratchXZPN = var1.getAmbientOcclusionLightValue(this.blockAccess, var2, var3, var4 - 1); +- this.aoLightValueScratchXZPP = var1.getAmbientOcclusionLightValue(this.blockAccess, var2, var3, var4 + 1); +- this.aoLightValueScratchXYPP = var1.getAmbientOcclusionLightValue(this.blockAccess, var2, var3 + 1, var4); +- this.aoBrightnessXYPN = var1.getMixedBrightnessForBlock(this.blockAccess, var2, var3 - 1, var4); +- this.aoBrightnessXZPN = var1.getMixedBrightnessForBlock(this.blockAccess, var2, var3, var4 - 1); +- this.aoBrightnessXZPP = var1.getMixedBrightnessForBlock(this.blockAccess, var2, var3, var4 + 1); +- this.aoBrightnessXYPP = var1.getMixedBrightnessForBlock(this.blockAccess, var2, var3 + 1, var4); +- var16 = Block.canBlockGrass[this.blockAccess.getBlockId(var2 + 1, var3 + 1, var4)]; +- var17 = Block.canBlockGrass[this.blockAccess.getBlockId(var2 + 1, var3 - 1, var4)]; +- var18 = Block.canBlockGrass[this.blockAccess.getBlockId(var2 + 1, var3, var4 + 1)]; +- var19 = Block.canBlockGrass[this.blockAccess.getBlockId(var2 + 1, var3, var4 - 1)]; +- if(!var17 && !var19) { ++ this.aoLightValueScratchXYPN = par1Block.getAmbientOcclusionLightValue(this.blockAccess, par2, par3 - 1, par4); ++ this.aoLightValueScratchXZPN = par1Block.getAmbientOcclusionLightValue(this.blockAccess, par2, par3, par4 - 1); ++ this.aoLightValueScratchXZPP = par1Block.getAmbientOcclusionLightValue(this.blockAccess, par2, par3, par4 + 1); ++ this.aoLightValueScratchXYPP = par1Block.getAmbientOcclusionLightValue(this.blockAccess, par2, par3 + 1, par4); ++ this.aoBrightnessXYPN = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2, par3 - 1, par4); ++ this.aoBrightnessXZPN = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2, par3, par4 - 1); ++ this.aoBrightnessXZPP = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2, par3, par4 + 1); ++ this.aoBrightnessXYPP = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2, par3 + 1, par4); ++ var16 = Block.canBlockGrass[this.blockAccess.getBlockId(par2 + 1, par3 + 1, par4)]; ++ var17 = Block.canBlockGrass[this.blockAccess.getBlockId(par2 + 1, par3 - 1, par4)]; ++ var18 = Block.canBlockGrass[this.blockAccess.getBlockId(par2 + 1, par3, par4 + 1)]; ++ var19 = Block.canBlockGrass[this.blockAccess.getBlockId(par2 + 1, par3, par4 - 1)]; ++ ++ if (!var17 && !var19) { + this.aoLightValueScratchXYZPNN = this.aoLightValueScratchXZPN; + this.aoBrightnessXYZPNN = this.aoBrightnessXZPN; + } else { +- this.aoLightValueScratchXYZPNN = var1.getAmbientOcclusionLightValue(this.blockAccess, var2, var3 - 1, var4 - 1); +- this.aoBrightnessXYZPNN = var1.getMixedBrightnessForBlock(this.blockAccess, var2, var3 - 1, var4 - 1); ++ this.aoLightValueScratchXYZPNN = par1Block.getAmbientOcclusionLightValue(this.blockAccess, par2, par3 - 1, par4 - 1); ++ this.aoBrightnessXYZPNN = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2, par3 - 1, par4 - 1); + } + +- if(!var17 && !var18) { ++ if (!var17 && !var18) { + this.aoLightValueScratchXYZPNP = this.aoLightValueScratchXZPP; + this.aoBrightnessXYZPNP = this.aoBrightnessXZPP; + } else { +- this.aoLightValueScratchXYZPNP = var1.getAmbientOcclusionLightValue(this.blockAccess, var2, var3 - 1, var4 + 1); +- this.aoBrightnessXYZPNP = var1.getMixedBrightnessForBlock(this.blockAccess, var2, var3 - 1, var4 + 1); ++ this.aoLightValueScratchXYZPNP = par1Block.getAmbientOcclusionLightValue(this.blockAccess, par2, par3 - 1, par4 + 1); ++ this.aoBrightnessXYZPNP = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2, par3 - 1, par4 + 1); + } + +- if(!var16 && !var19) { ++ if (!var16 && !var19) { + this.aoLightValueScratchXYZPPN = this.aoLightValueScratchXZPN; + this.aoBrightnessXYZPPN = this.aoBrightnessXZPN; + } else { +- this.aoLightValueScratchXYZPPN = var1.getAmbientOcclusionLightValue(this.blockAccess, var2, var3 + 1, var4 - 1); +- this.aoBrightnessXYZPPN = var1.getMixedBrightnessForBlock(this.blockAccess, var2, var3 + 1, var4 - 1); ++ this.aoLightValueScratchXYZPPN = par1Block.getAmbientOcclusionLightValue(this.blockAccess, par2, par3 + 1, par4 - 1); ++ this.aoBrightnessXYZPPN = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2, par3 + 1, par4 - 1); + } + +- if(!var16 && !var18) { ++ if (!var16 && !var18) { + this.aoLightValueScratchXYZPPP = this.aoLightValueScratchXZPP; + this.aoBrightnessXYZPPP = this.aoBrightnessXZPP; + } else { +- this.aoLightValueScratchXYZPPP = var1.getAmbientOcclusionLightValue(this.blockAccess, var2, var3 + 1, var4 + 1); +- this.aoBrightnessXYZPPP = var1.getMixedBrightnessForBlock(this.blockAccess, var2, var3 + 1, var4 + 1); ++ this.aoLightValueScratchXYZPPP = par1Block.getAmbientOcclusionLightValue(this.blockAccess, par2, par3 + 1, par4 + 1); ++ this.aoBrightnessXYZPPP = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2, par3 + 1, par4 + 1); + } + +- if(this.renderMaxX >= 1.0D) { +- --var2; ++ if (this.renderMaxX >= 1.0D) { ++ --par2; + } + + var20 = var14; +- if(this.renderMaxX >= 1.0D || !this.blockAccess.isBlockOpaqueCube(var2 + 1, var3, var4)) { +- var20 = var1.getMixedBrightnessForBlock(this.blockAccess, var2 + 1, var3, var4); ++ ++ if (this.renderMaxX >= 1.0D || !this.blockAccess.isBlockOpaqueCube(par2 + 1, par3, par4)) { ++ var20 = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2 + 1, par3, par4); + } + +- var21 = var1.getAmbientOcclusionLightValue(this.blockAccess, var2 + 1, var3, var4); ++ var21 = par1Block.getAmbientOcclusionLightValue(this.blockAccess, par2 + 1, par3, par4); + var22 = (this.aoLightValueScratchXYPN + this.aoLightValueScratchXYZPNP + var21 + this.aoLightValueScratchXZPP) / 4.0F; + var23 = (this.aoLightValueScratchXYZPNN + this.aoLightValueScratchXYPN + this.aoLightValueScratchXZPN + var21) / 4.0F; + var24 = (this.aoLightValueScratchXZPN + var21 + this.aoLightValueScratchXYZPPN + this.aoLightValueScratchXYPP) / 4.0F; +@@ -4584,10 +5264,11 @@ + this.brightnessBottomLeft = this.mixAoBrightness(var26, var29, var28, var27, (1.0D - this.renderMinY) * this.renderMinZ, (1.0D - this.renderMinY) * (1.0D - this.renderMinZ), this.renderMinY * (1.0D - this.renderMinZ), this.renderMinY * this.renderMinZ); + this.brightnessBottomRight = this.mixAoBrightness(var26, var29, var28, var27, (1.0D - this.renderMaxY) * this.renderMinZ, (1.0D - this.renderMaxY) * (1.0D - this.renderMinZ), this.renderMaxY * (1.0D - this.renderMinZ), this.renderMaxY * this.renderMinZ); + this.brightnessTopRight = this.mixAoBrightness(var26, var29, var28, var27, (1.0D - this.renderMaxY) * this.renderMaxZ, (1.0D - this.renderMaxY) * (1.0D - this.renderMaxZ), this.renderMaxY * (1.0D - this.renderMaxZ), this.renderMaxY * this.renderMaxZ); +- if(var13) { +- this.colorRedTopLeft = this.colorRedBottomLeft = this.colorRedBottomRight = this.colorRedTopRight = var5 * 0.6F; +- this.colorGreenTopLeft = this.colorGreenBottomLeft = this.colorGreenBottomRight = this.colorGreenTopRight = var6 * 0.6F; +- this.colorBlueTopLeft = this.colorBlueBottomLeft = this.colorBlueBottomRight = this.colorBlueTopRight = var7 * 0.6F; ++ ++ if (var13) { ++ this.colorRedTopLeft = this.colorRedBottomLeft = this.colorRedBottomRight = this.colorRedTopRight = par5 * 0.6F; ++ this.colorGreenTopLeft = this.colorGreenBottomLeft = this.colorGreenBottomRight = this.colorGreenTopRight = par6 * 0.6F; ++ this.colorBlueTopLeft = this.colorBlueBottomLeft = this.colorBlueBottomRight = this.colorBlueTopRight = par7 * 0.6F; + } else { + this.colorRedTopLeft = this.colorRedBottomLeft = this.colorRedBottomRight = this.colorRedTopRight = 0.6F; + this.colorGreenTopLeft = this.colorGreenBottomLeft = this.colorGreenBottomRight = this.colorGreenTopRight = 0.6F; +@@ -4606,22 +5287,23 @@ + this.colorRedTopRight *= var12; + this.colorGreenTopRight *= var12; + this.colorBlueTopRight *= var12; +- var30 = this.getBlockIcon(var1, this.blockAccess, var2, var3, var4, 5); +- this.renderFaceXPos(var1, (double)var2, (double)var3, (double)var4, var30); +- if(fancyGrass && var30.getIconName().equals("grass_side") && !this.hasOverrideBlockTexture()) { +- this.colorRedTopLeft *= var5; +- this.colorRedBottomLeft *= var5; +- this.colorRedBottomRight *= var5; +- this.colorRedTopRight *= var5; +- this.colorGreenTopLeft *= var6; +- this.colorGreenBottomLeft *= var6; +- this.colorGreenBottomRight *= var6; +- this.colorGreenTopRight *= var6; +- this.colorBlueTopLeft *= var7; +- this.colorBlueBottomLeft *= var7; +- this.colorBlueBottomRight *= var7; +- this.colorBlueTopRight *= var7; +- this.renderFaceXPos(var1, (double)var2, (double)var3, (double)var4, BlockGrass.getIconSideOverlay()); ++ var30 = this.getBlockIcon(par1Block, this.blockAccess, par2, par3, par4, 5); ++ this.renderFaceXPos(par1Block, (double)par2, (double)par3, (double)par4, var30); ++ ++ if (fancyGrass && var30.getIconName().equals("grass_side") && !this.hasOverrideBlockTexture()) { ++ this.colorRedTopLeft *= par5; ++ this.colorRedBottomLeft *= par5; ++ this.colorRedBottomRight *= par5; ++ this.colorRedTopRight *= par5; ++ this.colorGreenTopLeft *= par6; ++ this.colorGreenBottomLeft *= par6; ++ this.colorGreenBottomRight *= par6; ++ this.colorGreenTopRight *= par6; ++ this.colorBlueTopLeft *= par7; ++ this.colorBlueBottomLeft *= par7; ++ this.colorBlueBottomRight *= par7; ++ this.colorBlueTopRight *= par7; ++ this.renderFaceXPos(par1Block, (double)par2, (double)par3, (double)par4, BlockGrass.getIconSideOverlay()); + } + + var8 = true; +@@ -4631,29 +5313,35 @@ + return var8; + } + +- private int getAoBrightness(int var1, int var2, int var3, int var4) { +- if(var1 == 0) { +- var1 = var4; +- } +- +- if(var2 == 0) { +- var2 = var4; +- } +- +- if(var3 == 0) { +- var3 = var4; +- } +- +- return var1 + var2 + var3 + var4 >> 2 & 16711935; ++ /** ++ * Get ambient occlusion brightness ++ */ ++ private int getAoBrightness(int par1, int par2, int par3, int par4) { ++ if (par1 == 0) { ++ par1 = par4; ++ } ++ ++ if (par2 == 0) { ++ par2 = par4; ++ } ++ ++ if (par3 == 0) { ++ par3 = par4; ++ } ++ ++ return par1 + par2 + par3 + par4 >> 2 & 16711935; + } + +- private int mixAoBrightness(int var1, int var2, int var3, int var4, double var5, double var7, double var9, double var11) { +- int var13 = (int)((double)(var1 >> 16 & 255) * var5 + (double)(var2 >> 16 & 255) * var7 + (double)(var3 >> 16 & 255) * var9 + (double)(var4 >> 16 & 255) * var11) & 255; +- int var14 = (int)((double)(var1 & 255) * var5 + (double)(var2 & 255) * var7 + (double)(var3 & 255) * var9 + (double)(var4 & 255) * var11) & 255; ++ private int mixAoBrightness(int par1, int par2, int par3, int par4, double par5, double par7, double par9, double par11) { ++ int var13 = (int)((double)(par1 >> 16 & 255) * par5 + (double)(par2 >> 16 & 255) * par7 + (double)(par3 >> 16 & 255) * par9 + (double)(par4 >> 16 & 255) * par11) & 255; ++ int var14 = (int)((double)(par1 & 255) * par5 + (double)(par2 & 255) * par7 + (double)(par3 & 255) * par9 + (double)(par4 & 255) * par11) & 255; + return var13 << 16 | var14; + } + +- public boolean renderStandardBlockWithColorMultiplier(Block var1, int var2, int var3, int var4, float var5, float var6, float var7) { ++ /** ++ * Renders a standard cube block at the given coordinates, with a given color ratio. Args: block, x, y, z, r, g, b ++ */ ++ public boolean renderStandardBlockWithColorMultiplier(Block par1Block, int par2, int par3, int par4, float par5, float par6, float par7) { + this.enableAO = false; + Tessellator var8 = Tessellator.instance; + boolean var9 = false; +@@ -4661,9 +5349,9 @@ + float var11 = 1.0F; + float var12 = 0.8F; + float var13 = 0.6F; +- float var14 = var11 * var5; +- float var15 = var11 * var6; +- float var16 = var11 * var7; ++ float var14 = var11 * par5; ++ float var15 = var11 * par6; ++ float var16 = var11 * par7; + float var17 = var10; + float var18 = var12; + float var19 = var13; +@@ -4673,81 +5361,112 @@ + float var23 = var10; + float var24 = var12; + float var25 = var13; +- if(var1 != Block.grass) { +- var17 = var10 * var5; +- var18 = var12 * var5; +- var19 = var13 * var5; +- var20 = var10 * var6; +- var21 = var12 * var6; +- var22 = var13 * var6; +- var23 = var10 * var7; +- var24 = var12 * var7; +- var25 = var13 * var7; ++ ++ if (par1Block != Block.grass) { ++ var17 = var10 * par5; ++ var18 = var12 * par5; ++ var19 = var13 * par5; ++ var20 = var10 * par6; ++ var21 = var12 * par6; ++ var22 = var13 * par6; ++ var23 = var10 * par7; ++ var24 = var12 * par7; ++ var25 = var13 * par7; + } + +- int var26 = var1.getMixedBrightnessForBlock(this.blockAccess, var2, var3, var4); +- if(this.renderAllFaces || var1.shouldSideBeRendered(this.blockAccess, var2, var3 - 1, var4, 0)) { +- var8.setBrightness(this.renderMinY > 0.0D ? var26 : var1.getMixedBrightnessForBlock(this.blockAccess, var2, var3 - 1, var4)); ++ int var26 = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2, par3, par4); ++ ++ if (this.renderAllFaces || RenderPass.shouldSideBeRendered(par1Block, this.blockAccess, par2, par3 - 1, par4, 0)) { ++ var8.setBrightness(this.renderMinY > 0.0D ? var26 : par1Block.getMixedBrightnessForBlock(this.blockAccess, par2, par3 - 1, par4)); + var8.setColorOpaque_F(var17, var20, var23); +- this.renderFaceYNeg(var1, (double)var2, (double)var3, (double)var4, this.getBlockIcon(var1, this.blockAccess, var2, var3, var4, 0)); ++ this.renderFaceYNeg(par1Block, (double)par2, (double)par3, (double)par4, this.getBlockIcon(par1Block, this.blockAccess, par2, par3, par4, 0)); + var9 = true; + } + +- if(this.renderAllFaces || var1.shouldSideBeRendered(this.blockAccess, var2, var3 + 1, var4, 1)) { +- var8.setBrightness(this.renderMaxY < 1.0D ? var26 : var1.getMixedBrightnessForBlock(this.blockAccess, var2, var3 + 1, var4)); ++ if (this.renderAllFaces || RenderPass.shouldSideBeRendered(par1Block, this.blockAccess, par2, par3 + 1, par4, 1)) { ++ var8.setBrightness(this.renderMaxY < 1.0D ? var26 : par1Block.getMixedBrightnessForBlock(this.blockAccess, par2, par3 + 1, par4)); + var8.setColorOpaque_F(var14, var15, var16); +- this.renderFaceYPos(var1, (double)var2, (double)var3, (double)var4, this.getBlockIcon(var1, this.blockAccess, var2, var3, var4, 1)); ++ this.renderFaceYPos(par1Block, (double)par2, (double)par3, (double)par4, this.getBlockIcon(par1Block, this.blockAccess, par2, par3, par4, 1)); + var9 = true; + } + + Icon var28; +- if(this.renderAllFaces || var1.shouldSideBeRendered(this.blockAccess, var2, var3, var4 - 1, 2)) { +- var8.setBrightness(this.renderMinZ > 0.0D ? var26 : var1.getMixedBrightnessForBlock(this.blockAccess, var2, var3, var4 - 1)); +- var8.setColorOpaque_F(var18, var21, var24); +- var28 = this.getBlockIcon(var1, this.blockAccess, var2, var3, var4, 2); +- this.renderFaceZNeg(var1, (double)var2, (double)var3, (double)var4, var28); +- if(fancyGrass && var28.getIconName().equals("grass_side") && !this.hasOverrideBlockTexture()) { +- var8.setColorOpaque_F(var18 * var5, var21 * var6, var24 * var7); +- this.renderFaceZNeg(var1, (double)var2, (double)var3, (double)var4, BlockGrass.getIconSideOverlay()); +- } +- +- var9 = true; +- } +- +- if(this.renderAllFaces || var1.shouldSideBeRendered(this.blockAccess, var2, var3, var4 + 1, 3)) { +- var8.setBrightness(this.renderMaxZ < 1.0D ? var26 : var1.getMixedBrightnessForBlock(this.blockAccess, var2, var3, var4 + 1)); +- var8.setColorOpaque_F(var18, var21, var24); +- var28 = this.getBlockIcon(var1, this.blockAccess, var2, var3, var4, 3); +- this.renderFaceZPos(var1, (double)var2, (double)var3, (double)var4, var28); +- if(fancyGrass && var28.getIconName().equals("grass_side") && !this.hasOverrideBlockTexture()) { +- var8.setColorOpaque_F(var18 * var5, var21 * var6, var24 * var7); +- this.renderFaceZPos(var1, (double)var2, (double)var3, (double)var4, BlockGrass.getIconSideOverlay()); +- } +- +- var9 = true; +- } +- +- if(this.renderAllFaces || var1.shouldSideBeRendered(this.blockAccess, var2 - 1, var3, var4, 4)) { +- var8.setBrightness(this.renderMinX > 0.0D ? var26 : var1.getMixedBrightnessForBlock(this.blockAccess, var2 - 1, var3, var4)); +- var8.setColorOpaque_F(var19, var22, var25); +- var28 = this.getBlockIcon(var1, this.blockAccess, var2, var3, var4, 4); +- this.renderFaceXNeg(var1, (double)var2, (double)var3, (double)var4, var28); +- if(fancyGrass && var28.getIconName().equals("grass_side") && !this.hasOverrideBlockTexture()) { +- var8.setColorOpaque_F(var19 * var5, var22 * var6, var25 * var7); +- this.renderFaceXNeg(var1, (double)var2, (double)var3, (double)var4, BlockGrass.getIconSideOverlay()); +- } +- +- var9 = true; +- } +- +- if(this.renderAllFaces || var1.shouldSideBeRendered(this.blockAccess, var2 + 1, var3, var4, 5)) { +- var8.setBrightness(this.renderMaxX < 1.0D ? var26 : var1.getMixedBrightnessForBlock(this.blockAccess, var2 + 1, var3, var4)); +- var8.setColorOpaque_F(var19, var22, var25); +- var28 = this.getBlockIcon(var1, this.blockAccess, var2, var3, var4, 5); +- this.renderFaceXPos(var1, (double)var2, (double)var3, (double)var4, var28); +- if(fancyGrass && var28.getIconName().equals("grass_side") && !this.hasOverrideBlockTexture()) { +- var8.setColorOpaque_F(var19 * var5, var22 * var6, var25 * var7); +- this.renderFaceXPos(var1, (double)var2, (double)var3, (double)var4, BlockGrass.getIconSideOverlay()); ++ ++ if (this.renderAllFaces || RenderPass.shouldSideBeRendered(par1Block, this.blockAccess, par2, par3, par4 - 1, 2)) { ++ var8.setBrightness(this.renderMinZ > 0.0D ? var26 : par1Block.getMixedBrightnessForBlock(this.blockAccess, par2, par3, par4 - 1)); ++ ++ if (CTMUtils.isBetterGrass(this.blockAccess, par1Block, par2, par3, par4, 2)) { ++ var8.setColorOpaque_F(var18 * par5, var21 * par6, var24 * par7); ++ } else { ++ var8.setColorOpaque_F(var18, var21, var24); ++ } ++ ++ var28 = this.getBlockIcon(par1Block, this.blockAccess, par2, par3, par4, 2); ++ this.renderFaceZNeg(par1Block, (double)par2, (double)par3, (double)par4, var28); ++ ++ if (fancyGrass && var28.getIconName().equals("grass_side") && !this.hasOverrideBlockTexture()) { ++ var8.setColorOpaque_F(var18 * par5, var21 * par6, var24 * par7); ++ this.renderFaceZNeg(par1Block, (double)par2, (double)par3, (double)par4, BlockGrass.getIconSideOverlay()); ++ } ++ ++ var9 = true; ++ } ++ ++ if (this.renderAllFaces || RenderPass.shouldSideBeRendered(par1Block, this.blockAccess, par2, par3, par4 + 1, 3)) { ++ var8.setBrightness(this.renderMaxZ < 1.0D ? var26 : par1Block.getMixedBrightnessForBlock(this.blockAccess, par2, par3, par4 + 1)); ++ ++ if (CTMUtils.isBetterGrass(this.blockAccess, par1Block, par2, par3, par4, 3)) { ++ var8.setColorOpaque_F(var18 * par5, var21 * par6, var24 * par7); ++ } else { ++ var8.setColorOpaque_F(var18, var21, var24); ++ } ++ ++ var28 = this.getBlockIcon(par1Block, this.blockAccess, par2, par3, par4, 3); ++ this.renderFaceZPos(par1Block, (double)par2, (double)par3, (double)par4, var28); ++ ++ if (fancyGrass && var28.getIconName().equals("grass_side") && !this.hasOverrideBlockTexture()) { ++ var8.setColorOpaque_F(var18 * par5, var21 * par6, var24 * par7); ++ this.renderFaceZPos(par1Block, (double)par2, (double)par3, (double)par4, BlockGrass.getIconSideOverlay()); ++ } ++ ++ var9 = true; ++ } ++ ++ if (this.renderAllFaces || RenderPass.shouldSideBeRendered(par1Block, this.blockAccess, par2 - 1, par3, par4, 4)) { ++ var8.setBrightness(this.renderMinX > 0.0D ? var26 : par1Block.getMixedBrightnessForBlock(this.blockAccess, par2 - 1, par3, par4)); ++ ++ if (CTMUtils.isBetterGrass(this.blockAccess, par1Block, par2, par3, par4, 4)) { ++ var8.setColorOpaque_F(var19 * par5, var22 * par6, var25 * par7); ++ } else { ++ var8.setColorOpaque_F(var19, var22, var25); ++ } ++ ++ var28 = this.getBlockIcon(par1Block, this.blockAccess, par2, par3, par4, 4); ++ this.renderFaceXNeg(par1Block, (double)par2, (double)par3, (double)par4, var28); ++ ++ if (fancyGrass && var28.getIconName().equals("grass_side") && !this.hasOverrideBlockTexture()) { ++ var8.setColorOpaque_F(var19 * par5, var22 * par6, var25 * par7); ++ this.renderFaceXNeg(par1Block, (double)par2, (double)par3, (double)par4, BlockGrass.getIconSideOverlay()); ++ } ++ ++ var9 = true; ++ } ++ ++ if (this.renderAllFaces || RenderPass.shouldSideBeRendered(par1Block, this.blockAccess, par2 + 1, par3, par4, 5)) { ++ var8.setBrightness(this.renderMaxX < 1.0D ? var26 : par1Block.getMixedBrightnessForBlock(this.blockAccess, par2 + 1, par3, par4)); ++ ++ if (CTMUtils.isBetterGrass(this.blockAccess, par1Block, par2, par3, par4, 5)) { ++ var8.setColorOpaque_F(var19 * par5, var22 * par6, var25 * par7); ++ } else { ++ var8.setColorOpaque_F(var19, var22, var25); ++ } ++ ++ var28 = this.getBlockIcon(par1Block, this.blockAccess, par2, par3, par4, 5); ++ this.renderFaceXPos(par1Block, (double)par2, (double)par3, (double)par4, var28); ++ ++ if (fancyGrass && var28.getIconName().equals("grass_side") && !this.hasOverrideBlockTexture()) { ++ var8.setColorOpaque_F(var19 * par5, var22 * par6, var25 * par7); ++ this.renderFaceXPos(par1Block, (double)par2, (double)par3, (double)par4, BlockGrass.getIconSideOverlay()); + } + + var9 = true; +@@ -4756,14 +5475,17 @@ + return var9; + } + +- private boolean renderBlockCocoa(BlockCocoa var1, int var2, int var3, int var4) { ++ /** ++ * Renders a Cocoa block at the given coordinates ++ */ ++ private boolean renderBlockCocoa(BlockCocoa par1BlockCocoa, int par2, int par3, int par4) { + Tessellator var5 = Tessellator.instance; +- var5.setBrightness(var1.getMixedBrightnessForBlock(this.blockAccess, var2, var3, var4)); ++ var5.setBrightness(par1BlockCocoa.getMixedBrightnessForBlock(this.blockAccess, par2, par3, par4)); + var5.setColorOpaque_F(1.0F, 1.0F, 1.0F); +- int var6 = this.blockAccess.getBlockMetadata(var2, var3, var4); ++ int var6 = this.blockAccess.getBlockMetadata(par2, par3, par4); + int var7 = BlockDirectional.getDirection(var6); + int var8 = BlockCocoa.func_72219_c(var6); +- Icon var9 = var1.getCocoaIcon(var8); ++ Icon var9 = par1BlockCocoa.getCocoaIcon(var8); + int var10 = 4 + var8 * 2; + int var11 = 5 + var8 * 2; + double var12 = 15.0D - (double)var10; +@@ -4776,30 +5498,34 @@ + double var26 = (double)var9.getInterpolatedV(var18); + double var28 = 0.0D; + double var30 = 0.0D; +- switch(var7) { +- case 0: +- var28 = 8.0D - (double)(var10 / 2); +- var30 = 15.0D - (double)var10; +- break; +- case 1: +- var28 = 1.0D; +- var30 = 8.0D - (double)(var10 / 2); +- break; +- case 2: +- var28 = 8.0D - (double)(var10 / 2); +- var30 = 1.0D; +- break; +- case 3: +- var28 = 15.0D - (double)var10; +- var30 = 8.0D - (double)(var10 / 2); ++ ++ switch (var7) { ++ case 0: ++ var28 = 8.0D - (double)(var10 / 2); ++ var30 = 15.0D - (double)var10; ++ break; ++ ++ case 1: ++ var28 = 1.0D; ++ var30 = 8.0D - (double)(var10 / 2); ++ break; ++ ++ case 2: ++ var28 = 8.0D - (double)(var10 / 2); ++ var30 = 1.0D; ++ break; ++ ++ case 3: ++ var28 = 15.0D - (double)var10; ++ var30 = 8.0D - (double)(var10 / 2); + } + +- double var32 = (double)var2 + var28 / 16.0D; +- double var34 = (double)var2 + (var28 + (double)var10) / 16.0D; +- double var36 = (double)var3 + (12.0D - (double)var11) / 16.0D; +- double var38 = (double)var3 + 0.75D; +- double var40 = (double)var4 + var30 / 16.0D; +- double var42 = (double)var4 + (var30 + (double)var10) / 16.0D; ++ double var32 = (double)par2 + var28 / 16.0D; ++ double var34 = (double)par2 + (var28 + (double)var10) / 16.0D; ++ double var36 = (double)par3 + (12.0D - (double)var11) / 16.0D; ++ double var38 = (double)par3 + 0.75D; ++ double var40 = (double)par4 + var30 / 16.0D; ++ double var42 = (double)par4 + (var30 + (double)var10) / 16.0D; + var5.addVertexWithUV(var32, var36, var40, var20, var26); + var5.addVertexWithUV(var32, var36, var42, var22, var26); + var5.addVertexWithUV(var32, var38, var42, var22, var24); +@@ -4817,107 +5543,127 @@ + var5.addVertexWithUV(var34, var38, var42, var22, var24); + var5.addVertexWithUV(var32, var38, var42, var20, var24); + int var44 = var10; +- if(var8 >= 2) { ++ ++ if (var8 >= 2) { + var44 = var10 - 1; + } + +- var20 = (double)var9.getMinU(); +- var22 = (double)var9.getInterpolatedU((double)var44); +- var24 = (double)var9.getMinV(); +- var26 = (double)var9.getInterpolatedV((double)var44); +- var5.addVertexWithUV(var32, var38, var42, var20, var26); +- var5.addVertexWithUV(var34, var38, var42, var22, var26); +- var5.addVertexWithUV(var34, var38, var40, var22, var24); +- var5.addVertexWithUV(var32, var38, var40, var20, var24); +- var5.addVertexWithUV(var32, var36, var40, var20, var24); +- var5.addVertexWithUV(var34, var36, var40, var22, var24); +- var5.addVertexWithUV(var34, var36, var42, var22, var26); +- var5.addVertexWithUV(var32, var36, var42, var20, var26); +- var20 = (double)var9.getInterpolatedU(12.0D); +- var22 = (double)var9.getMaxU(); +- var24 = (double)var9.getMinV(); +- var26 = (double)var9.getInterpolatedV(4.0D); +- var28 = 8.0D; +- var30 = 0.0D; +- double var45; +- switch(var7) { +- case 0: +- var28 = 8.0D; +- var30 = 12.0D; +- var45 = var20; +- var20 = var22; +- var22 = var45; +- break; +- case 1: +- var28 = 0.0D; +- var30 = 8.0D; +- break; +- case 2: ++ var9 = CTMUtils.getTile(this, par1BlockCocoa, par2, par3, par4, var9, var5); ++ ++ if (var9 == null) { ++ return false; ++ } else { ++ var5 = TessellatorUtils.getTessellator(var5, var9); ++ var20 = (double)var9.getMinU(); ++ var22 = (double)var9.getInterpolatedU((double)var44); ++ var24 = (double)var9.getMinV(); ++ var26 = (double)var9.getInterpolatedV((double)var44); ++ var5.addVertexWithUV(var32, var38, var42, var20, var26); ++ var5.addVertexWithUV(var34, var38, var42, var22, var26); ++ var5.addVertexWithUV(var34, var38, var40, var22, var24); ++ var5.addVertexWithUV(var32, var38, var40, var20, var24); ++ var5.addVertexWithUV(var32, var36, var40, var20, var24); ++ var5.addVertexWithUV(var34, var36, var40, var22, var24); ++ var5.addVertexWithUV(var34, var36, var42, var22, var26); ++ var5.addVertexWithUV(var32, var36, var42, var20, var26); ++ var20 = (double)var9.getInterpolatedU(12.0D); ++ var22 = (double)var9.getMaxU(); ++ var24 = (double)var9.getMinV(); ++ var26 = (double)var9.getInterpolatedV(4.0D); + var28 = 8.0D; + var30 = 0.0D; +- break; +- case 3: +- var28 = 12.0D; +- var30 = 8.0D; +- var45 = var20; +- var20 = var22; +- var22 = var45; +- } +- +- var32 = (double)var2 + var28 / 16.0D; +- var34 = (double)var2 + (var28 + 4.0D) / 16.0D; +- var36 = (double)var3 + 0.75D; +- var38 = (double)var3 + 1.0D; +- var40 = (double)var4 + var30 / 16.0D; +- var42 = (double)var4 + (var30 + 4.0D) / 16.0D; +- if(var7 != 2 && var7 != 0) { +- if(var7 == 1 || var7 == 3) { +- var5.addVertexWithUV(var34, var36, var40, var20, var26); +- var5.addVertexWithUV(var32, var36, var40, var22, var26); +- var5.addVertexWithUV(var32, var38, var40, var22, var24); +- var5.addVertexWithUV(var34, var38, var40, var20, var24); +- var5.addVertexWithUV(var32, var36, var40, var22, var26); +- var5.addVertexWithUV(var34, var36, var40, var20, var26); +- var5.addVertexWithUV(var34, var38, var40, var20, var24); +- var5.addVertexWithUV(var32, var38, var40, var22, var24); +- } +- } else { +- var5.addVertexWithUV(var32, var36, var40, var22, var26); +- var5.addVertexWithUV(var32, var36, var42, var20, var26); +- var5.addVertexWithUV(var32, var38, var42, var20, var24); +- var5.addVertexWithUV(var32, var38, var40, var22, var24); +- var5.addVertexWithUV(var32, var36, var42, var20, var26); +- var5.addVertexWithUV(var32, var36, var40, var22, var26); +- var5.addVertexWithUV(var32, var38, var40, var22, var24); +- var5.addVertexWithUV(var32, var38, var42, var20, var24); +- } +- +- return true; ++ double var45; ++ ++ switch (var7) { ++ case 0: ++ var28 = 8.0D; ++ var30 = 12.0D; ++ var45 = var20; ++ var20 = var22; ++ var22 = var45; ++ break; ++ ++ case 1: ++ var28 = 0.0D; ++ var30 = 8.0D; ++ break; ++ ++ case 2: ++ var28 = 8.0D; ++ var30 = 0.0D; ++ break; ++ ++ case 3: ++ var28 = 12.0D; ++ var30 = 8.0D; ++ var45 = var20; ++ var20 = var22; ++ var22 = var45; ++ } ++ ++ var32 = (double)par2 + var28 / 16.0D; ++ var34 = (double)par2 + (var28 + 4.0D) / 16.0D; ++ var36 = (double)par3 + 0.75D; ++ var38 = (double)par3 + 1.0D; ++ var40 = (double)par4 + var30 / 16.0D; ++ var42 = (double)par4 + (var30 + 4.0D) / 16.0D; ++ ++ if (var7 != 2 && var7 != 0) { ++ if (var7 == 1 || var7 == 3) { ++ var5.addVertexWithUV(var34, var36, var40, var20, var26); ++ var5.addVertexWithUV(var32, var36, var40, var22, var26); ++ var5.addVertexWithUV(var32, var38, var40, var22, var24); ++ var5.addVertexWithUV(var34, var38, var40, var20, var24); ++ var5.addVertexWithUV(var32, var36, var40, var22, var26); ++ var5.addVertexWithUV(var34, var36, var40, var20, var26); ++ var5.addVertexWithUV(var34, var38, var40, var20, var24); ++ var5.addVertexWithUV(var32, var38, var40, var22, var24); ++ } ++ } else { ++ var5.addVertexWithUV(var32, var36, var40, var22, var26); ++ var5.addVertexWithUV(var32, var36, var42, var20, var26); ++ var5.addVertexWithUV(var32, var38, var42, var20, var24); ++ var5.addVertexWithUV(var32, var38, var40, var22, var24); ++ var5.addVertexWithUV(var32, var36, var42, var20, var26); ++ var5.addVertexWithUV(var32, var36, var40, var22, var26); ++ var5.addVertexWithUV(var32, var38, var40, var22, var24); ++ var5.addVertexWithUV(var32, var38, var42, var20, var24); ++ } ++ ++ return true; ++ } + } + +- private boolean renderBlockBeacon(BlockBeacon var1, int var2, int var3, int var4) { +- float var5 = 3.0F / 16.0F; ++ /** ++ * Renders beacon block ++ */ ++ private boolean renderBlockBeacon(BlockBeacon par1BlockBeacon, int par2, int par3, int par4) { ++ float var5 = 0.1875F; + this.setOverrideBlockTexture(this.getBlockIcon(Block.glass)); + this.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 1.0D); +- this.renderStandardBlock(var1, var2, var3, var4); ++ this.renderStandardBlock(par1BlockBeacon, par2, par3, par4); + this.renderAllFaces = true; + this.setOverrideBlockTexture(this.getBlockIcon(Block.obsidian)); +- this.setRenderBounds(0.125D, (double)0.00625F, 0.125D, 0.875D, (double)var5, 0.875D); +- this.renderStandardBlock(var1, var2, var3, var4); ++ this.setRenderBounds(0.125D, 0.0062500000931322575D, 0.125D, 0.875D, (double)var5, 0.875D); ++ this.renderStandardBlock(par1BlockBeacon, par2, par3, par4); + this.setOverrideBlockTexture(this.getBlockIcon(Block.beacon)); + this.setRenderBounds(0.1875D, (double)var5, 0.1875D, 0.8125D, 0.875D, 0.8125D); +- this.renderStandardBlock(var1, var2, var3, var4); ++ this.renderStandardBlock(par1BlockBeacon, par2, par3, par4); + this.renderAllFaces = false; + this.clearOverrideBlockTexture(); + return true; + } + +- public boolean renderBlockCactus(Block var1, int var2, int var3, int var4) { +- int var5 = var1.colorMultiplier(this.blockAccess, var2, var3, var4); ++ /** ++ * Renders a cactus block at the given coordinates ++ */ ++ public boolean renderBlockCactus(Block par1Block, int par2, int par3, int par4) { ++ int var5 = par1Block.colorMultiplier(this.blockAccess, par2, par3, par4); + float var6 = (float)(var5 >> 16 & 255) / 255.0F; + float var7 = (float)(var5 >> 8 & 255) / 255.0F; + float var8 = (float)(var5 & 255) / 255.0F; +- if(EntityRenderer.anaglyphEnable) { ++ ++ if (EntityRenderer.anaglyphEnable) { + float var9 = (var6 * 30.0F + var7 * 59.0F + var8 * 11.0F) / 100.0F; + float var10 = (var6 * 30.0F + var7 * 70.0F) / 100.0F; + float var11 = (var6 * 30.0F + var8 * 70.0F) / 100.0F; +@@ -4926,207 +5672,221 @@ + var8 = var11; + } + +- return this.renderBlockCactusImpl(var1, var2, var3, var4, var6, var7, var8); ++ return this.renderBlockCactusImpl(par1Block, par2, par3, par4, var6, var7, var8); + } + +- public boolean renderBlockCactusImpl(Block var1, int var2, int var3, int var4, float var5, float var6, float var7) { ++ /** ++ * Render block cactus implementation ++ */ ++ public boolean renderBlockCactusImpl(Block par1Block, int par2, int par3, int par4, float par5, float par6, float par7) { + Tessellator var8 = Tessellator.instance; + boolean var9 = false; + float var10 = 0.5F; + float var11 = 1.0F; + float var12 = 0.8F; + float var13 = 0.6F; +- float var14 = var10 * var5; +- float var15 = var11 * var5; +- float var16 = var12 * var5; +- float var17 = var13 * var5; +- float var18 = var10 * var6; +- float var19 = var11 * var6; +- float var20 = var12 * var6; +- float var21 = var13 * var6; +- float var22 = var10 * var7; +- float var23 = var11 * var7; +- float var24 = var12 * var7; +- float var25 = var13 * var7; +- float var26 = 1.0F / 16.0F; +- int var27 = var1.getMixedBrightnessForBlock(this.blockAccess, var2, var3, var4); +- if(this.renderAllFaces || var1.shouldSideBeRendered(this.blockAccess, var2, var3 - 1, var4, 0)) { +- var8.setBrightness(this.renderMinY > 0.0D ? var27 : var1.getMixedBrightnessForBlock(this.blockAccess, var2, var3 - 1, var4)); ++ float var14 = var10 * par5; ++ float var15 = var11 * par5; ++ float var16 = var12 * par5; ++ float var17 = var13 * par5; ++ float var18 = var10 * par6; ++ float var19 = var11 * par6; ++ float var20 = var12 * par6; ++ float var21 = var13 * par6; ++ float var22 = var10 * par7; ++ float var23 = var11 * par7; ++ float var24 = var12 * par7; ++ float var25 = var13 * par7; ++ float var26 = 0.0625F; ++ int var27 = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2, par3, par4); ++ ++ if (this.renderAllFaces || RenderPass.shouldSideBeRendered(par1Block, this.blockAccess, par2, par3 - 1, par4, 0)) { ++ var8.setBrightness(this.renderMinY > 0.0D ? var27 : par1Block.getMixedBrightnessForBlock(this.blockAccess, par2, par3 - 1, par4)); + var8.setColorOpaque_F(var14, var18, var22); +- this.renderFaceYNeg(var1, (double)var2, (double)var3, (double)var4, this.getBlockIcon(var1, this.blockAccess, var2, var3, var4, 0)); ++ this.renderFaceYNeg(par1Block, (double)par2, (double)par3, (double)par4, this.getBlockIcon(par1Block, this.blockAccess, par2, par3, par4, 0)); + } + +- if(this.renderAllFaces || var1.shouldSideBeRendered(this.blockAccess, var2, var3 + 1, var4, 1)) { +- var8.setBrightness(this.renderMaxY < 1.0D ? var27 : var1.getMixedBrightnessForBlock(this.blockAccess, var2, var3 + 1, var4)); ++ if (this.renderAllFaces || RenderPass.shouldSideBeRendered(par1Block, this.blockAccess, par2, par3 + 1, par4, 1)) { ++ var8.setBrightness(this.renderMaxY < 1.0D ? var27 : par1Block.getMixedBrightnessForBlock(this.blockAccess, par2, par3 + 1, par4)); + var8.setColorOpaque_F(var15, var19, var23); +- this.renderFaceYPos(var1, (double)var2, (double)var3, (double)var4, this.getBlockIcon(var1, this.blockAccess, var2, var3, var4, 1)); ++ this.renderFaceYPos(par1Block, (double)par2, (double)par3, (double)par4, this.getBlockIcon(par1Block, this.blockAccess, par2, par3, par4, 1)); + } + + var8.setBrightness(var27); + var8.setColorOpaque_F(var16, var20, var24); + var8.addTranslation(0.0F, 0.0F, var26); +- this.renderFaceZNeg(var1, (double)var2, (double)var3, (double)var4, this.getBlockIcon(var1, this.blockAccess, var2, var3, var4, 2)); +- var8.addTranslation(0.0F, 0.0F, -var26); +- var8.addTranslation(0.0F, 0.0F, -var26); +- this.renderFaceZPos(var1, (double)var2, (double)var3, (double)var4, this.getBlockIcon(var1, this.blockAccess, var2, var3, var4, 3)); ++ this.renderFaceZNeg(par1Block, (double)par2, (double)par3, (double)par4, this.getBlockIcon(par1Block, this.blockAccess, par2, par3, par4, 2)); ++ var8.addTranslation(0.0F, 0.0F, -var26); ++ var8.addTranslation(0.0F, 0.0F, -var26); ++ this.renderFaceZPos(par1Block, (double)par2, (double)par3, (double)par4, this.getBlockIcon(par1Block, this.blockAccess, par2, par3, par4, 3)); + var8.addTranslation(0.0F, 0.0F, var26); + var8.setColorOpaque_F(var17, var21, var25); + var8.addTranslation(var26, 0.0F, 0.0F); +- this.renderFaceXNeg(var1, (double)var2, (double)var3, (double)var4, this.getBlockIcon(var1, this.blockAccess, var2, var3, var4, 4)); +- var8.addTranslation(-var26, 0.0F, 0.0F); +- var8.addTranslation(-var26, 0.0F, 0.0F); +- this.renderFaceXPos(var1, (double)var2, (double)var3, (double)var4, this.getBlockIcon(var1, this.blockAccess, var2, var3, var4, 5)); ++ this.renderFaceXNeg(par1Block, (double)par2, (double)par3, (double)par4, this.getBlockIcon(par1Block, this.blockAccess, par2, par3, par4, 4)); ++ var8.addTranslation(-var26, 0.0F, 0.0F); ++ var8.addTranslation(-var26, 0.0F, 0.0F); ++ this.renderFaceXPos(par1Block, (double)par2, (double)par3, (double)par4, this.getBlockIcon(par1Block, this.blockAccess, par2, par3, par4, 5)); + var8.addTranslation(var26, 0.0F, 0.0F); + return true; + } + +- public boolean renderBlockFence(BlockFence var1, int var2, int var3, int var4) { ++ public boolean renderBlockFence(BlockFence par1BlockFence, int par2, int par3, int par4) { + boolean var5 = false; +- float var6 = 6.0F / 16.0F; +- float var7 = 10.0F / 16.0F; ++ float var6 = 0.375F; ++ float var7 = 0.625F; + this.setRenderBounds((double)var6, 0.0D, (double)var6, (double)var7, 1.0D, (double)var7); +- this.renderStandardBlock(var1, var2, var3, var4); ++ this.renderStandardBlock(par1BlockFence, par2, par3, par4); + var5 = true; + boolean var8 = false; + boolean var9 = false; +- if(var1.canConnectFenceTo(this.blockAccess, var2 - 1, var3, var4) || var1.canConnectFenceTo(this.blockAccess, var2 + 1, var3, var4)) { ++ ++ if (par1BlockFence.canConnectFenceTo(this.blockAccess, par2 - 1, par3, par4) || par1BlockFence.canConnectFenceTo(this.blockAccess, par2 + 1, par3, par4)) { + var8 = true; + } + +- if(var1.canConnectFenceTo(this.blockAccess, var2, var3, var4 - 1) || var1.canConnectFenceTo(this.blockAccess, var2, var3, var4 + 1)) { ++ if (par1BlockFence.canConnectFenceTo(this.blockAccess, par2, par3, par4 - 1) || par1BlockFence.canConnectFenceTo(this.blockAccess, par2, par3, par4 + 1)) { + var9 = true; + } + +- boolean var10 = var1.canConnectFenceTo(this.blockAccess, var2 - 1, var3, var4); +- boolean var11 = var1.canConnectFenceTo(this.blockAccess, var2 + 1, var3, var4); +- boolean var12 = var1.canConnectFenceTo(this.blockAccess, var2, var3, var4 - 1); +- boolean var13 = var1.canConnectFenceTo(this.blockAccess, var2, var3, var4 + 1); +- if(!var8 && !var9) { ++ boolean var10 = par1BlockFence.canConnectFenceTo(this.blockAccess, par2 - 1, par3, par4); ++ boolean var11 = par1BlockFence.canConnectFenceTo(this.blockAccess, par2 + 1, par3, par4); ++ boolean var12 = par1BlockFence.canConnectFenceTo(this.blockAccess, par2, par3, par4 - 1); ++ boolean var13 = par1BlockFence.canConnectFenceTo(this.blockAccess, par2, par3, par4 + 1); ++ ++ if (!var8 && !var9) { + var8 = true; + } + +- var6 = 7.0F / 16.0F; +- var7 = 9.0F / 16.0F; +- float var14 = 12.0F / 16.0F; +- float var15 = 15.0F / 16.0F; ++ var6 = 0.4375F; ++ var7 = 0.5625F; ++ float var14 = 0.75F; ++ float var15 = 0.9375F; + float var16 = var10 ? 0.0F : var6; + float var17 = var11 ? 1.0F : var7; + float var18 = var12 ? 0.0F : var6; + float var19 = var13 ? 1.0F : var7; +- if(var8) { +- this.setRenderBounds((double)var16, (double)var14, (double)var6, (double)var17, (double)var15, (double)var7); +- this.renderStandardBlock(var1, var2, var3, var4); +- var5 = true; +- } +- +- if(var9) { +- this.setRenderBounds((double)var6, (double)var14, (double)var18, (double)var7, (double)var15, (double)var19); +- this.renderStandardBlock(var1, var2, var3, var4); +- var5 = true; +- } +- +- var14 = 6.0F / 16.0F; +- var15 = 9.0F / 16.0F; +- if(var8) { +- this.setRenderBounds((double)var16, (double)var14, (double)var6, (double)var17, (double)var15, (double)var7); +- this.renderStandardBlock(var1, var2, var3, var4); +- var5 = true; +- } +- +- if(var9) { +- this.setRenderBounds((double)var6, (double)var14, (double)var18, (double)var7, (double)var15, (double)var19); +- this.renderStandardBlock(var1, var2, var3, var4); +- var5 = true; +- } +- +- var1.setBlockBoundsBasedOnState(this.blockAccess, var2, var3, var4); ++ ++ if (var8) { ++ this.setRenderBounds((double)var16, (double)var14, (double)var6, (double)var17, (double)var15, (double)var7); ++ this.renderStandardBlock(par1BlockFence, par2, par3, par4); ++ var5 = true; ++ } ++ ++ if (var9) { ++ this.setRenderBounds((double)var6, (double)var14, (double)var18, (double)var7, (double)var15, (double)var19); ++ this.renderStandardBlock(par1BlockFence, par2, par3, par4); ++ var5 = true; ++ } ++ ++ var14 = 0.375F; ++ var15 = 0.5625F; ++ ++ if (var8) { ++ this.setRenderBounds((double)var16, (double)var14, (double)var6, (double)var17, (double)var15, (double)var7); ++ this.renderStandardBlock(par1BlockFence, par2, par3, par4); ++ var5 = true; ++ } ++ ++ if (var9) { ++ this.setRenderBounds((double)var6, (double)var14, (double)var18, (double)var7, (double)var15, (double)var19); ++ this.renderStandardBlock(par1BlockFence, par2, par3, par4); ++ var5 = true; ++ } ++ ++ par1BlockFence.setBlockBoundsBasedOnState(this.blockAccess, par2, par3, par4); + return var5; + } + +- public boolean renderBlockWall(BlockWall var1, int var2, int var3, int var4) { +- boolean var5 = var1.canConnectWallTo(this.blockAccess, var2 - 1, var3, var4); +- boolean var6 = var1.canConnectWallTo(this.blockAccess, var2 + 1, var3, var4); +- boolean var7 = var1.canConnectWallTo(this.blockAccess, var2, var3, var4 - 1); +- boolean var8 = var1.canConnectWallTo(this.blockAccess, var2, var3, var4 + 1); ++ /** ++ * Renders wall block ++ */ ++ public boolean renderBlockWall(BlockWall par1BlockWall, int par2, int par3, int par4) { ++ boolean var5 = par1BlockWall.canConnectWallTo(this.blockAccess, par2 - 1, par3, par4); ++ boolean var6 = par1BlockWall.canConnectWallTo(this.blockAccess, par2 + 1, par3, par4); ++ boolean var7 = par1BlockWall.canConnectWallTo(this.blockAccess, par2, par3, par4 - 1); ++ boolean var8 = par1BlockWall.canConnectWallTo(this.blockAccess, par2, par3, par4 + 1); + boolean var9 = var7 && var8 && !var5 && !var6; + boolean var10 = !var7 && !var8 && var5 && var6; +- boolean var11 = this.blockAccess.isAirBlock(var2, var3 + 1, var4); +- if((var9 || var10) && var11) { +- if(var9) { ++ boolean var11 = this.blockAccess.isAirBlock(par2, par3 + 1, par4); ++ ++ if ((var9 || var10) && var11) { ++ if (var9) { + this.setRenderBounds(0.3125D, 0.0D, 0.0D, 0.6875D, 0.8125D, 1.0D); +- this.renderStandardBlock(var1, var2, var3, var4); ++ this.renderStandardBlock(par1BlockWall, par2, par3, par4); + } else { + this.setRenderBounds(0.0D, 0.0D, 0.3125D, 1.0D, 0.8125D, 0.6875D); +- this.renderStandardBlock(var1, var2, var3, var4); ++ this.renderStandardBlock(par1BlockWall, par2, par3, par4); + } + } else { + this.setRenderBounds(0.25D, 0.0D, 0.25D, 0.75D, 1.0D, 0.75D); +- this.renderStandardBlock(var1, var2, var3, var4); +- if(var5) { ++ this.renderStandardBlock(par1BlockWall, par2, par3, par4); ++ ++ if (var5) { + this.setRenderBounds(0.0D, 0.0D, 0.3125D, 0.25D, 0.8125D, 0.6875D); +- this.renderStandardBlock(var1, var2, var3, var4); ++ this.renderStandardBlock(par1BlockWall, par2, par3, par4); + } + +- if(var6) { ++ if (var6) { + this.setRenderBounds(0.75D, 0.0D, 0.3125D, 1.0D, 0.8125D, 0.6875D); +- this.renderStandardBlock(var1, var2, var3, var4); ++ this.renderStandardBlock(par1BlockWall, par2, par3, par4); + } + +- if(var7) { ++ if (var7) { + this.setRenderBounds(0.3125D, 0.0D, 0.0D, 0.6875D, 0.8125D, 0.25D); +- this.renderStandardBlock(var1, var2, var3, var4); ++ this.renderStandardBlock(par1BlockWall, par2, par3, par4); + } + +- if(var8) { ++ if (var8) { + this.setRenderBounds(0.3125D, 0.0D, 0.75D, 0.6875D, 0.8125D, 1.0D); +- this.renderStandardBlock(var1, var2, var3, var4); ++ this.renderStandardBlock(par1BlockWall, par2, par3, par4); + } + } + +- var1.setBlockBoundsBasedOnState(this.blockAccess, var2, var3, var4); ++ par1BlockWall.setBlockBoundsBasedOnState(this.blockAccess, par2, par3, par4); + return true; + } + +- public boolean renderBlockDragonEgg(BlockDragonEgg var1, int var2, int var3, int var4) { ++ public boolean renderBlockDragonEgg(BlockDragonEgg par1BlockDragonEgg, int par2, int par3, int par4) { + boolean var5 = false; + int var6 = 0; + +- for(int var7 = 0; var7 < 8; ++var7) { ++ for (int var7 = 0; var7 < 8; ++var7) { + byte var8 = 0; + byte var9 = 1; +- if(var7 == 0) { ++ ++ if (var7 == 0) { + var8 = 2; + } + +- if(var7 == 1) { ++ if (var7 == 1) { + var8 = 3; + } + +- if(var7 == 2) { ++ if (var7 == 2) { + var8 = 4; + } + +- if(var7 == 3) { ++ if (var7 == 3) { + var8 = 5; + var9 = 2; + } + +- if(var7 == 4) { ++ if (var7 == 4) { + var8 = 6; + var9 = 3; + } + +- if(var7 == 5) { ++ if (var7 == 5) { + var8 = 7; + var9 = 5; + } + +- if(var7 == 6) { ++ if (var7 == 6) { + var8 = 6; + var9 = 2; + } + +- if(var7 == 7) { ++ if (var7 == 7) { + var8 = 3; + } + +@@ -5135,7 +5895,7 @@ + float var12 = 1.0F - (float)(var6 + var9) / 16.0F; + var6 += var9; + this.setRenderBounds((double)(0.5F - var10), (double)var12, (double)(0.5F - var10), (double)(0.5F + var10), (double)var11, (double)(0.5F + var10)); +- this.renderStandardBlock(var1, var2, var3, var4); ++ this.renderStandardBlock(par1BlockDragonEgg, par2, par3, par4); + } + + var5 = true; +@@ -5143,193 +5903,199 @@ + return var5; + } + +- public boolean renderBlockFenceGate(BlockFenceGate var1, int var2, int var3, int var4) { ++ /** ++ * Render block fence gate ++ */ ++ public boolean renderBlockFenceGate(BlockFenceGate par1BlockFenceGate, int par2, int par3, int par4) { + boolean var5 = true; +- int var6 = this.blockAccess.getBlockMetadata(var2, var3, var4); ++ int var6 = this.blockAccess.getBlockMetadata(par2, par3, par4); + boolean var7 = BlockFenceGate.isFenceGateOpen(var6); + int var8 = BlockDirectional.getDirection(var6); +- float var9 = 6.0F / 16.0F; +- float var10 = 9.0F / 16.0F; +- float var11 = 12.0F / 16.0F; +- float var12 = 15.0F / 16.0F; +- float var13 = 5.0F / 16.0F; ++ float var9 = 0.375F; ++ float var10 = 0.5625F; ++ float var11 = 0.75F; ++ float var12 = 0.9375F; ++ float var13 = 0.3125F; + float var14 = 1.0F; +- if((var8 == 2 || var8 == 0) && this.blockAccess.getBlockId(var2 - 1, var3, var4) == Block.cobblestoneWall.blockID && this.blockAccess.getBlockId(var2 + 1, var3, var4) == Block.cobblestoneWall.blockID || (var8 == 3 || var8 == 1) && this.blockAccess.getBlockId(var2, var3, var4 - 1) == Block.cobblestoneWall.blockID && this.blockAccess.getBlockId(var2, var3, var4 + 1) == Block.cobblestoneWall.blockID) { +- var9 -= 3.0F / 16.0F; +- var10 -= 3.0F / 16.0F; +- var11 -= 3.0F / 16.0F; +- var12 -= 3.0F / 16.0F; +- var13 -= 3.0F / 16.0F; +- var14 -= 3.0F / 16.0F; ++ ++ if ((var8 == 2 || var8 == 0) && this.blockAccess.getBlockId(par2 - 1, par3, par4) == Block.cobblestoneWall.blockID && this.blockAccess.getBlockId(par2 + 1, par3, par4) == Block.cobblestoneWall.blockID || (var8 == 3 || var8 == 1) && this.blockAccess.getBlockId(par2, par3, par4 - 1) == Block.cobblestoneWall.blockID && this.blockAccess.getBlockId(par2, par3, par4 + 1) == Block.cobblestoneWall.blockID) { ++ var9 -= 0.1875F; ++ var10 -= 0.1875F; ++ var11 -= 0.1875F; ++ var12 -= 0.1875F; ++ var13 -= 0.1875F; ++ var14 -= 0.1875F; + } + + this.renderAllFaces = true; + float var15; +- float var16; + float var17; ++ float var16; + float var18; +- if(var8 != 3 && var8 != 1) { ++ ++ if (var8 != 3 && var8 != 1) { + var15 = 0.0F; +- var16 = 2.0F / 16.0F; +- var17 = 7.0F / 16.0F; +- var18 = 9.0F / 16.0F; ++ var16 = 0.125F; ++ var17 = 0.4375F; ++ var18 = 0.5625F; + this.setRenderBounds((double)var15, (double)var13, (double)var17, (double)var16, (double)var14, (double)var18); +- this.renderStandardBlock(var1, var2, var3, var4); +- var15 = 14.0F / 16.0F; ++ this.renderStandardBlock(par1BlockFenceGate, par2, par3, par4); ++ var15 = 0.875F; + var16 = 1.0F; + this.setRenderBounds((double)var15, (double)var13, (double)var17, (double)var16, (double)var14, (double)var18); +- this.renderStandardBlock(var1, var2, var3, var4); ++ this.renderStandardBlock(par1BlockFenceGate, par2, par3, par4); + } else { + this.uvRotateTop = 1; +- var15 = 7.0F / 16.0F; +- var16 = 9.0F / 16.0F; ++ var15 = 0.4375F; ++ var16 = 0.5625F; + var17 = 0.0F; +- var18 = 2.0F / 16.0F; ++ var18 = 0.125F; + this.setRenderBounds((double)var15, (double)var13, (double)var17, (double)var16, (double)var14, (double)var18); +- this.renderStandardBlock(var1, var2, var3, var4); +- var17 = 14.0F / 16.0F; ++ this.renderStandardBlock(par1BlockFenceGate, par2, par3, par4); ++ var17 = 0.875F; + var18 = 1.0F; + this.setRenderBounds((double)var15, (double)var13, (double)var17, (double)var16, (double)var14, (double)var18); +- this.renderStandardBlock(var1, var2, var3, var4); ++ this.renderStandardBlock(par1BlockFenceGate, par2, par3, par4); + this.uvRotateTop = 0; + } + +- if(var7) { +- if(var8 == 2 || var8 == 0) { ++ if (var7) { ++ if (var8 == 2 || var8 == 0) { + this.uvRotateTop = 1; + } +- ++ + float var19; +- float var20; + float var21; +- if(var8 == 3) { ++ float var20; ++ ++ if (var8 == 3) { + var15 = 0.0F; +- var16 = 2.0F / 16.0F; +- var17 = 14.0F / 16.0F; ++ var16 = 0.125F; ++ var17 = 0.875F; + var18 = 1.0F; +- var19 = 9.0F / 16.0F; +- var20 = 13.0F / 16.0F; +- var21 = 15.0F / 16.0F; ++ var19 = 0.5625F; ++ var20 = 0.8125F; ++ var21 = 0.9375F; + this.setRenderBounds(0.8125D, (double)var9, 0.0D, 0.9375D, (double)var12, 0.125D); +- this.renderStandardBlock(var1, var2, var3, var4); ++ this.renderStandardBlock(par1BlockFenceGate, par2, par3, par4); + this.setRenderBounds(0.8125D, (double)var9, 0.875D, 0.9375D, (double)var12, 1.0D); +- this.renderStandardBlock(var1, var2, var3, var4); ++ this.renderStandardBlock(par1BlockFenceGate, par2, par3, par4); + this.setRenderBounds(0.5625D, (double)var9, 0.0D, 0.8125D, (double)var10, 0.125D); +- this.renderStandardBlock(var1, var2, var3, var4); ++ this.renderStandardBlock(par1BlockFenceGate, par2, par3, par4); + this.setRenderBounds(0.5625D, (double)var9, 0.875D, 0.8125D, (double)var10, 1.0D); +- this.renderStandardBlock(var1, var2, var3, var4); ++ this.renderStandardBlock(par1BlockFenceGate, par2, par3, par4); + this.setRenderBounds(0.5625D, (double)var11, 0.0D, 0.8125D, (double)var12, 0.125D); +- this.renderStandardBlock(var1, var2, var3, var4); ++ this.renderStandardBlock(par1BlockFenceGate, par2, par3, par4); + this.setRenderBounds(0.5625D, (double)var11, 0.875D, 0.8125D, (double)var12, 1.0D); +- this.renderStandardBlock(var1, var2, var3, var4); +- } else if(var8 == 1) { ++ this.renderStandardBlock(par1BlockFenceGate, par2, par3, par4); ++ } else if (var8 == 1) { + var15 = 0.0F; +- var16 = 2.0F / 16.0F; +- var17 = 14.0F / 16.0F; ++ var16 = 0.125F; ++ var17 = 0.875F; + var18 = 1.0F; +- var19 = 1.0F / 16.0F; +- var20 = 3.0F / 16.0F; +- var21 = 7.0F / 16.0F; +- this.setRenderBounds(1.0D / 16.0D, (double)var9, 0.0D, 0.1875D, (double)var12, 0.125D); +- this.renderStandardBlock(var1, var2, var3, var4); +- this.setRenderBounds(1.0D / 16.0D, (double)var9, 0.875D, 0.1875D, (double)var12, 1.0D); +- this.renderStandardBlock(var1, var2, var3, var4); ++ var19 = 0.0625F; ++ var20 = 0.1875F; ++ var21 = 0.4375F; ++ this.setRenderBounds(0.0625D, (double)var9, 0.0D, 0.1875D, (double)var12, 0.125D); ++ this.renderStandardBlock(par1BlockFenceGate, par2, par3, par4); ++ this.setRenderBounds(0.0625D, (double)var9, 0.875D, 0.1875D, (double)var12, 1.0D); ++ this.renderStandardBlock(par1BlockFenceGate, par2, par3, par4); + this.setRenderBounds(0.1875D, (double)var9, 0.0D, 0.4375D, (double)var10, 0.125D); +- this.renderStandardBlock(var1, var2, var3, var4); ++ this.renderStandardBlock(par1BlockFenceGate, par2, par3, par4); + this.setRenderBounds(0.1875D, (double)var9, 0.875D, 0.4375D, (double)var10, 1.0D); +- this.renderStandardBlock(var1, var2, var3, var4); ++ this.renderStandardBlock(par1BlockFenceGate, par2, par3, par4); + this.setRenderBounds(0.1875D, (double)var11, 0.0D, 0.4375D, (double)var12, 0.125D); +- this.renderStandardBlock(var1, var2, var3, var4); ++ this.renderStandardBlock(par1BlockFenceGate, par2, par3, par4); + this.setRenderBounds(0.1875D, (double)var11, 0.875D, 0.4375D, (double)var12, 1.0D); +- this.renderStandardBlock(var1, var2, var3, var4); +- } else if(var8 == 0) { ++ this.renderStandardBlock(par1BlockFenceGate, par2, par3, par4); ++ } else if (var8 == 0) { + var15 = 0.0F; +- var16 = 2.0F / 16.0F; +- var17 = 14.0F / 16.0F; ++ var16 = 0.125F; ++ var17 = 0.875F; + var18 = 1.0F; +- var19 = 9.0F / 16.0F; +- var20 = 13.0F / 16.0F; +- var21 = 15.0F / 16.0F; ++ var19 = 0.5625F; ++ var20 = 0.8125F; ++ var21 = 0.9375F; + this.setRenderBounds(0.0D, (double)var9, 0.8125D, 0.125D, (double)var12, 0.9375D); +- this.renderStandardBlock(var1, var2, var3, var4); ++ this.renderStandardBlock(par1BlockFenceGate, par2, par3, par4); + this.setRenderBounds(0.875D, (double)var9, 0.8125D, 1.0D, (double)var12, 0.9375D); +- this.renderStandardBlock(var1, var2, var3, var4); ++ this.renderStandardBlock(par1BlockFenceGate, par2, par3, par4); + this.setRenderBounds(0.0D, (double)var9, 0.5625D, 0.125D, (double)var10, 0.8125D); +- this.renderStandardBlock(var1, var2, var3, var4); ++ this.renderStandardBlock(par1BlockFenceGate, par2, par3, par4); + this.setRenderBounds(0.875D, (double)var9, 0.5625D, 1.0D, (double)var10, 0.8125D); +- this.renderStandardBlock(var1, var2, var3, var4); ++ this.renderStandardBlock(par1BlockFenceGate, par2, par3, par4); + this.setRenderBounds(0.0D, (double)var11, 0.5625D, 0.125D, (double)var12, 0.8125D); +- this.renderStandardBlock(var1, var2, var3, var4); ++ this.renderStandardBlock(par1BlockFenceGate, par2, par3, par4); + this.setRenderBounds(0.875D, (double)var11, 0.5625D, 1.0D, (double)var12, 0.8125D); +- this.renderStandardBlock(var1, var2, var3, var4); +- } else if(var8 == 2) { ++ this.renderStandardBlock(par1BlockFenceGate, par2, par3, par4); ++ } else if (var8 == 2) { + var15 = 0.0F; +- var16 = 2.0F / 16.0F; +- var17 = 14.0F / 16.0F; ++ var16 = 0.125F; ++ var17 = 0.875F; + var18 = 1.0F; +- var19 = 1.0F / 16.0F; +- var20 = 3.0F / 16.0F; +- var21 = 7.0F / 16.0F; +- this.setRenderBounds(0.0D, (double)var9, 1.0D / 16.0D, 0.125D, (double)var12, 0.1875D); +- this.renderStandardBlock(var1, var2, var3, var4); +- this.setRenderBounds(0.875D, (double)var9, 1.0D / 16.0D, 1.0D, (double)var12, 0.1875D); +- this.renderStandardBlock(var1, var2, var3, var4); ++ var19 = 0.0625F; ++ var20 = 0.1875F; ++ var21 = 0.4375F; ++ this.setRenderBounds(0.0D, (double)var9, 0.0625D, 0.125D, (double)var12, 0.1875D); ++ this.renderStandardBlock(par1BlockFenceGate, par2, par3, par4); ++ this.setRenderBounds(0.875D, (double)var9, 0.0625D, 1.0D, (double)var12, 0.1875D); ++ this.renderStandardBlock(par1BlockFenceGate, par2, par3, par4); + this.setRenderBounds(0.0D, (double)var9, 0.1875D, 0.125D, (double)var10, 0.4375D); +- this.renderStandardBlock(var1, var2, var3, var4); ++ this.renderStandardBlock(par1BlockFenceGate, par2, par3, par4); + this.setRenderBounds(0.875D, (double)var9, 0.1875D, 1.0D, (double)var10, 0.4375D); +- this.renderStandardBlock(var1, var2, var3, var4); ++ this.renderStandardBlock(par1BlockFenceGate, par2, par3, par4); + this.setRenderBounds(0.0D, (double)var11, 0.1875D, 0.125D, (double)var12, 0.4375D); +- this.renderStandardBlock(var1, var2, var3, var4); ++ this.renderStandardBlock(par1BlockFenceGate, par2, par3, par4); + this.setRenderBounds(0.875D, (double)var11, 0.1875D, 1.0D, (double)var12, 0.4375D); +- this.renderStandardBlock(var1, var2, var3, var4); ++ this.renderStandardBlock(par1BlockFenceGate, par2, par3, par4); + } +- } else if(var8 != 3 && var8 != 1) { +- var15 = 6.0F / 16.0F; ++ } else if (var8 != 3 && var8 != 1) { ++ var15 = 0.375F; + var16 = 0.5F; +- var17 = 7.0F / 16.0F; +- var18 = 9.0F / 16.0F; ++ var17 = 0.4375F; ++ var18 = 0.5625F; + this.setRenderBounds((double)var15, (double)var9, (double)var17, (double)var16, (double)var12, (double)var18); +- this.renderStandardBlock(var1, var2, var3, var4); ++ this.renderStandardBlock(par1BlockFenceGate, par2, par3, par4); + var15 = 0.5F; +- var16 = 10.0F / 16.0F; ++ var16 = 0.625F; + this.setRenderBounds((double)var15, (double)var9, (double)var17, (double)var16, (double)var12, (double)var18); +- this.renderStandardBlock(var1, var2, var3, var4); +- var15 = 10.0F / 16.0F; +- var16 = 14.0F / 16.0F; +- this.setRenderBounds((double)var15, (double)var9, (double)var17, (double)var16, (double)var10, (double)var18); +- this.renderStandardBlock(var1, var2, var3, var4); +- this.setRenderBounds((double)var15, (double)var11, (double)var17, (double)var16, (double)var12, (double)var18); +- this.renderStandardBlock(var1, var2, var3, var4); +- var15 = 2.0F / 16.0F; +- var16 = 6.0F / 16.0F; +- this.setRenderBounds((double)var15, (double)var9, (double)var17, (double)var16, (double)var10, (double)var18); +- this.renderStandardBlock(var1, var2, var3, var4); +- this.setRenderBounds((double)var15, (double)var11, (double)var17, (double)var16, (double)var12, (double)var18); +- this.renderStandardBlock(var1, var2, var3, var4); ++ this.renderStandardBlock(par1BlockFenceGate, par2, par3, par4); ++ var15 = 0.625F; ++ var16 = 0.875F; ++ this.setRenderBounds((double)var15, (double)var9, (double)var17, (double)var16, (double)var10, (double)var18); ++ this.renderStandardBlock(par1BlockFenceGate, par2, par3, par4); ++ this.setRenderBounds((double)var15, (double)var11, (double)var17, (double)var16, (double)var12, (double)var18); ++ this.renderStandardBlock(par1BlockFenceGate, par2, par3, par4); ++ var15 = 0.125F; ++ var16 = 0.375F; ++ this.setRenderBounds((double)var15, (double)var9, (double)var17, (double)var16, (double)var10, (double)var18); ++ this.renderStandardBlock(par1BlockFenceGate, par2, par3, par4); ++ this.setRenderBounds((double)var15, (double)var11, (double)var17, (double)var16, (double)var12, (double)var18); ++ this.renderStandardBlock(par1BlockFenceGate, par2, par3, par4); + } else { + this.uvRotateTop = 1; +- var15 = 7.0F / 16.0F; +- var16 = 9.0F / 16.0F; +- var17 = 6.0F / 16.0F; ++ var15 = 0.4375F; ++ var16 = 0.5625F; ++ var17 = 0.375F; + var18 = 0.5F; + this.setRenderBounds((double)var15, (double)var9, (double)var17, (double)var16, (double)var12, (double)var18); +- this.renderStandardBlock(var1, var2, var3, var4); ++ this.renderStandardBlock(par1BlockFenceGate, par2, par3, par4); + var17 = 0.5F; +- var18 = 10.0F / 16.0F; ++ var18 = 0.625F; + this.setRenderBounds((double)var15, (double)var9, (double)var17, (double)var16, (double)var12, (double)var18); +- this.renderStandardBlock(var1, var2, var3, var4); +- var17 = 10.0F / 16.0F; +- var18 = 14.0F / 16.0F; +- this.setRenderBounds((double)var15, (double)var9, (double)var17, (double)var16, (double)var10, (double)var18); +- this.renderStandardBlock(var1, var2, var3, var4); +- this.setRenderBounds((double)var15, (double)var11, (double)var17, (double)var16, (double)var12, (double)var18); +- this.renderStandardBlock(var1, var2, var3, var4); +- var17 = 2.0F / 16.0F; +- var18 = 6.0F / 16.0F; +- this.setRenderBounds((double)var15, (double)var9, (double)var17, (double)var16, (double)var10, (double)var18); +- this.renderStandardBlock(var1, var2, var3, var4); +- this.setRenderBounds((double)var15, (double)var11, (double)var17, (double)var16, (double)var12, (double)var18); +- this.renderStandardBlock(var1, var2, var3, var4); ++ this.renderStandardBlock(par1BlockFenceGate, par2, par3, par4); ++ var17 = 0.625F; ++ var18 = 0.875F; ++ this.setRenderBounds((double)var15, (double)var9, (double)var17, (double)var16, (double)var10, (double)var18); ++ this.renderStandardBlock(par1BlockFenceGate, par2, par3, par4); ++ this.setRenderBounds((double)var15, (double)var11, (double)var17, (double)var16, (double)var12, (double)var18); ++ this.renderStandardBlock(par1BlockFenceGate, par2, par3, par4); ++ var17 = 0.125F; ++ var18 = 0.375F; ++ this.setRenderBounds((double)var15, (double)var9, (double)var17, (double)var16, (double)var10, (double)var18); ++ this.renderStandardBlock(par1BlockFenceGate, par2, par3, par4); ++ this.setRenderBounds((double)var15, (double)var11, (double)var17, (double)var16, (double)var12, (double)var18); ++ this.renderStandardBlock(par1BlockFenceGate, par2, par3, par4); + } + + this.renderAllFaces = false; +@@ -5338,15 +6104,16 @@ + return var5; + } + +- private boolean renderBlockHopper(BlockHopper var1, int var2, int var3, int var4) { ++ private boolean renderBlockHopper(BlockHopper par1BlockHopper, int par2, int par3, int par4) { + Tessellator var5 = Tessellator.instance; +- var5.setBrightness(var1.getMixedBrightnessForBlock(this.blockAccess, var2, var3, var4)); ++ var5.setBrightness(par1BlockHopper.getMixedBrightnessForBlock(this.blockAccess, par2, par3, par4)); + float var6 = 1.0F; +- int var7 = var1.colorMultiplier(this.blockAccess, var2, var3, var4); ++ int var7 = par1BlockHopper.colorMultiplier(this.blockAccess, par2, par3, par4); + float var8 = (float)(var7 >> 16 & 255) / 255.0F; + float var9 = (float)(var7 >> 8 & 255) / 255.0F; + float var10 = (float)(var7 & 255) / 255.0F; +- if(EntityRenderer.anaglyphEnable) { ++ ++ if (EntityRenderer.anaglyphEnable) { + float var11 = (var8 * 30.0F + var9 * 59.0F + var10 * 11.0F) / 100.0F; + float var12 = (var8 * 30.0F + var9 * 70.0F) / 100.0F; + float var13 = (var8 * 30.0F + var10 * 70.0F) / 100.0F; +@@ -5356,52 +6123,55 @@ + } + + var5.setColorOpaque_F(var6 * var8, var6 * var9, var6 * var10); +- return this.renderBlockHopperMetadata(var1, var2, var3, var4, this.blockAccess.getBlockMetadata(var2, var3, var4), false); ++ return this.renderBlockHopperMetadata(par1BlockHopper, par2, par3, par4, this.blockAccess.getBlockMetadata(par2, par3, par4), false); + } + +- private boolean renderBlockHopperMetadata(BlockHopper var1, int var2, int var3, int var4, int var5, boolean var6) { ++ private boolean renderBlockHopperMetadata(BlockHopper par1BlockHopper, int par2, int par3, int par4, int par5, boolean par6) { + Tessellator var7 = Tessellator.instance; +- int var8 = BlockHopper.getDirectionFromMetadata(var5); ++ int var8 = BlockHopper.getDirectionFromMetadata(par5); + double var9 = 0.625D; + this.setRenderBounds(0.0D, var9, 0.0D, 1.0D, 1.0D, 1.0D); +- if(var6) { ++ ++ if (par6) { + var7.startDrawingQuads(); + var7.setNormal(0.0F, -1.0F, 0.0F); +- this.renderFaceYNeg(var1, 0.0D, 0.0D, 0.0D, this.getBlockIconFromSideAndMetadata(var1, 0, var5)); ++ this.renderFaceYNeg(par1BlockHopper, 0.0D, 0.0D, 0.0D, this.getBlockIconFromSideAndMetadata(par1BlockHopper, 0, par5)); + var7.draw(); + var7.startDrawingQuads(); + var7.setNormal(0.0F, 1.0F, 0.0F); +- this.renderFaceYPos(var1, 0.0D, 0.0D, 0.0D, this.getBlockIconFromSideAndMetadata(var1, 1, var5)); ++ this.renderFaceYPos(par1BlockHopper, 0.0D, 0.0D, 0.0D, this.getBlockIconFromSideAndMetadata(par1BlockHopper, 1, par5)); + var7.draw(); + var7.startDrawingQuads(); + var7.setNormal(0.0F, 0.0F, -1.0F); +- this.renderFaceZNeg(var1, 0.0D, 0.0D, 0.0D, this.getBlockIconFromSideAndMetadata(var1, 2, var5)); ++ this.renderFaceZNeg(par1BlockHopper, 0.0D, 0.0D, 0.0D, this.getBlockIconFromSideAndMetadata(par1BlockHopper, 2, par5)); + var7.draw(); + var7.startDrawingQuads(); + var7.setNormal(0.0F, 0.0F, 1.0F); +- this.renderFaceZPos(var1, 0.0D, 0.0D, 0.0D, this.getBlockIconFromSideAndMetadata(var1, 3, var5)); ++ this.renderFaceZPos(par1BlockHopper, 0.0D, 0.0D, 0.0D, this.getBlockIconFromSideAndMetadata(par1BlockHopper, 3, par5)); + var7.draw(); + var7.startDrawingQuads(); + var7.setNormal(-1.0F, 0.0F, 0.0F); +- this.renderFaceXNeg(var1, 0.0D, 0.0D, 0.0D, this.getBlockIconFromSideAndMetadata(var1, 4, var5)); ++ this.renderFaceXNeg(par1BlockHopper, 0.0D, 0.0D, 0.0D, this.getBlockIconFromSideAndMetadata(par1BlockHopper, 4, par5)); + var7.draw(); + var7.startDrawingQuads(); + var7.setNormal(1.0F, 0.0F, 0.0F); +- this.renderFaceXPos(var1, 0.0D, 0.0D, 0.0D, this.getBlockIconFromSideAndMetadata(var1, 5, var5)); ++ this.renderFaceXPos(par1BlockHopper, 0.0D, 0.0D, 0.0D, this.getBlockIconFromSideAndMetadata(par1BlockHopper, 5, par5)); + var7.draw(); + } else { +- this.renderStandardBlock(var1, var2, var3, var4); ++ this.renderStandardBlock(par1BlockHopper, par2, par3, par4); + } + + float var13; +- if(!var6) { +- var7.setBrightness(var1.getMixedBrightnessForBlock(this.blockAccess, var2, var3, var4)); ++ ++ if (!par6) { ++ var7.setBrightness(par1BlockHopper.getMixedBrightnessForBlock(this.blockAccess, par2, par3, par4)); + float var11 = 1.0F; +- int var12 = var1.colorMultiplier(this.blockAccess, var2, var3, var4); ++ int var12 = par1BlockHopper.colorMultiplier(this.blockAccess, par2, par3, par4); + var13 = (float)(var12 >> 16 & 255) / 255.0F; + float var14 = (float)(var12 >> 8 & 255) / 255.0F; + float var15 = (float)(var12 & 255) / 255.0F; +- if(EntityRenderer.anaglyphEnable) { ++ ++ if (EntityRenderer.anaglyphEnable) { + float var16 = (var13 * 30.0F + var14 * 59.0F + var15 * 11.0F) / 100.0F; + float var17 = (var13 * 30.0F + var14 * 70.0F) / 100.0F; + float var18 = (var13 * 30.0F + var15 * 70.0F) / 100.0F; +@@ -5415,96 +6185,99 @@ + + Icon var24 = BlockHopper.getHopperIcon("hopper_outside"); + Icon var25 = BlockHopper.getHopperIcon("hopper_inside"); +- var13 = 2.0F / 16.0F; +- if(var6) { ++ var13 = 0.125F; ++ ++ if (par6) { + var7.startDrawingQuads(); + var7.setNormal(1.0F, 0.0F, 0.0F); +- this.renderFaceXPos(var1, (double)(-1.0F + var13), 0.0D, 0.0D, var24); ++ this.renderFaceXPos(par1BlockHopper, (double)(-1.0F + var13), 0.0D, 0.0D, var24); + var7.draw(); + var7.startDrawingQuads(); + var7.setNormal(-1.0F, 0.0F, 0.0F); +- this.renderFaceXNeg(var1, (double)(1.0F - var13), 0.0D, 0.0D, var24); ++ this.renderFaceXNeg(par1BlockHopper, (double)(1.0F - var13), 0.0D, 0.0D, var24); + var7.draw(); + var7.startDrawingQuads(); + var7.setNormal(0.0F, 0.0F, 1.0F); +- this.renderFaceZPos(var1, 0.0D, 0.0D, (double)(-1.0F + var13), var24); ++ this.renderFaceZPos(par1BlockHopper, 0.0D, 0.0D, (double)(-1.0F + var13), var24); + var7.draw(); + var7.startDrawingQuads(); + var7.setNormal(0.0F, 0.0F, -1.0F); +- this.renderFaceZNeg(var1, 0.0D, 0.0D, (double)(1.0F - var13), var24); ++ this.renderFaceZNeg(par1BlockHopper, 0.0D, 0.0D, (double)(1.0F - var13), var24); + var7.draw(); + var7.startDrawingQuads(); + var7.setNormal(0.0F, 1.0F, 0.0F); +- this.renderFaceYPos(var1, 0.0D, -1.0D + var9, 0.0D, var25); ++ this.renderFaceYPos(par1BlockHopper, 0.0D, -1.0D + var9, 0.0D, var25); + var7.draw(); + } else { +- this.renderFaceXPos(var1, (double)((float)var2 - 1.0F + var13), (double)var3, (double)var4, var24); +- this.renderFaceXNeg(var1, (double)((float)var2 + 1.0F - var13), (double)var3, (double)var4, var24); +- this.renderFaceZPos(var1, (double)var2, (double)var3, (double)((float)var4 - 1.0F + var13), var24); +- this.renderFaceZNeg(var1, (double)var2, (double)var3, (double)((float)var4 + 1.0F - var13), var24); +- this.renderFaceYPos(var1, (double)var2, (double)((float)var3 - 1.0F) + var9, (double)var4, var25); ++ this.renderFaceXPos(par1BlockHopper, (double)((float)par2 - 1.0F + var13), (double)par3, (double)par4, var24); ++ this.renderFaceXNeg(par1BlockHopper, (double)((float)par2 + 1.0F - var13), (double)par3, (double)par4, var24); ++ this.renderFaceZPos(par1BlockHopper, (double)par2, (double)par3, (double)((float)par4 - 1.0F + var13), var24); ++ this.renderFaceZNeg(par1BlockHopper, (double)par2, (double)par3, (double)((float)par4 + 1.0F - var13), var24); ++ this.renderFaceYPos(par1BlockHopper, (double)par2, (double)((float)par3 - 1.0F) + var9, (double)par4, var25); + } + + this.setOverrideBlockTexture(var24); + double var26 = 0.25D; + double var27 = 0.25D; + this.setRenderBounds(var26, var27, var26, 1.0D - var26, var9 - 0.002D, 1.0D - var26); +- if(var6) { ++ ++ if (par6) { + var7.startDrawingQuads(); + var7.setNormal(1.0F, 0.0F, 0.0F); +- this.renderFaceXPos(var1, 0.0D, 0.0D, 0.0D, var24); ++ this.renderFaceXPos(par1BlockHopper, 0.0D, 0.0D, 0.0D, var24); + var7.draw(); + var7.startDrawingQuads(); + var7.setNormal(-1.0F, 0.0F, 0.0F); +- this.renderFaceXNeg(var1, 0.0D, 0.0D, 0.0D, var24); ++ this.renderFaceXNeg(par1BlockHopper, 0.0D, 0.0D, 0.0D, var24); + var7.draw(); + var7.startDrawingQuads(); + var7.setNormal(0.0F, 0.0F, 1.0F); +- this.renderFaceZPos(var1, 0.0D, 0.0D, 0.0D, var24); ++ this.renderFaceZPos(par1BlockHopper, 0.0D, 0.0D, 0.0D, var24); + var7.draw(); + var7.startDrawingQuads(); + var7.setNormal(0.0F, 0.0F, -1.0F); +- this.renderFaceZNeg(var1, 0.0D, 0.0D, 0.0D, var24); ++ this.renderFaceZNeg(par1BlockHopper, 0.0D, 0.0D, 0.0D, var24); + var7.draw(); + var7.startDrawingQuads(); + var7.setNormal(0.0F, 1.0F, 0.0F); +- this.renderFaceYPos(var1, 0.0D, 0.0D, 0.0D, var24); ++ this.renderFaceYPos(par1BlockHopper, 0.0D, 0.0D, 0.0D, var24); + var7.draw(); + var7.startDrawingQuads(); + var7.setNormal(0.0F, -1.0F, 0.0F); +- this.renderFaceYNeg(var1, 0.0D, 0.0D, 0.0D, var24); ++ this.renderFaceYNeg(par1BlockHopper, 0.0D, 0.0D, 0.0D, var24); + var7.draw(); + } else { +- this.renderStandardBlock(var1, var2, var3, var4); ++ this.renderStandardBlock(par1BlockHopper, par2, par3, par4); + } + +- if(!var6) { ++ if (!par6) { + double var20 = 0.375D; + double var22 = 0.25D; + this.setOverrideBlockTexture(var24); +- if(var8 == 0) { ++ ++ if (var8 == 0) { + this.setRenderBounds(var20, 0.0D, var20, 1.0D - var20, 0.25D, 1.0D - var20); +- this.renderStandardBlock(var1, var2, var3, var4); ++ this.renderStandardBlock(par1BlockHopper, par2, par3, par4); + } + +- if(var8 == 2) { ++ if (var8 == 2) { + this.setRenderBounds(var20, var27, 0.0D, 1.0D - var20, var27 + var22, var26); +- this.renderStandardBlock(var1, var2, var3, var4); ++ this.renderStandardBlock(par1BlockHopper, par2, par3, par4); + } + +- if(var8 == 3) { ++ if (var8 == 3) { + this.setRenderBounds(var20, var27, 1.0D - var26, 1.0D - var20, var27 + var22, 1.0D); +- this.renderStandardBlock(var1, var2, var3, var4); ++ this.renderStandardBlock(par1BlockHopper, par2, par3, par4); + } + +- if(var8 == 4) { ++ if (var8 == 4) { + this.setRenderBounds(0.0D, var27, var20, var26, var27 + var22, 1.0D - var20); +- this.renderStandardBlock(var1, var2, var3, var4); ++ this.renderStandardBlock(par1BlockHopper, par2, par3, par4); + } + +- if(var8 == 5) { ++ if (var8 == 5) { + this.setRenderBounds(1.0D - var26, var27, var20, 1.0D, var27 + var22, 1.0D - var20); +- this.renderStandardBlock(var1, var2, var3, var4); ++ this.renderStandardBlock(par1BlockHopper, par2, par3, par4); + } + } + +@@ -5512,29 +6285,37 @@ + return true; + } + +- public boolean renderBlockStairs(BlockStairs var1, int var2, int var3, int var4) { +- var1.func_82541_d(this.blockAccess, var2, var3, var4); +- this.setRenderBoundsFromBlock(var1); +- this.renderStandardBlock(var1, var2, var3, var4); +- boolean var5 = var1.func_82542_g(this.blockAccess, var2, var3, var4); +- this.setRenderBoundsFromBlock(var1); +- this.renderStandardBlock(var1, var2, var3, var4); +- if(var5 && var1.func_82544_h(this.blockAccess, var2, var3, var4)) { +- this.setRenderBoundsFromBlock(var1); +- this.renderStandardBlock(var1, var2, var3, var4); ++ /** ++ * Renders a stair block at the given coordinates ++ */ ++ public boolean renderBlockStairs(BlockStairs par1BlockStairs, int par2, int par3, int par4) { ++ par1BlockStairs.func_82541_d(this.blockAccess, par2, par3, par4); ++ this.setRenderBoundsFromBlock(par1BlockStairs); ++ this.renderStandardBlock(par1BlockStairs, par2, par3, par4); ++ boolean var5 = par1BlockStairs.func_82542_g(this.blockAccess, par2, par3, par4); ++ this.setRenderBoundsFromBlock(par1BlockStairs); ++ this.renderStandardBlock(par1BlockStairs, par2, par3, par4); ++ ++ if (var5 && par1BlockStairs.func_82544_h(this.blockAccess, par2, par3, par4)) { ++ this.setRenderBoundsFromBlock(par1BlockStairs); ++ this.renderStandardBlock(par1BlockStairs, par2, par3, par4); + } + + return true; + } + +- public boolean renderBlockDoor(Block var1, int var2, int var3, int var4) { ++ /** ++ * Renders a door block at the given coordinates ++ */ ++ public boolean renderBlockDoor(Block par1Block, int par2, int par3, int par4) { + Tessellator var5 = Tessellator.instance; +- int var6 = this.blockAccess.getBlockMetadata(var2, var3, var4); +- if((var6 & 8) != 0) { +- if(this.blockAccess.getBlockId(var2, var3 - 1, var4) != var1.blockID) { ++ int var6 = this.blockAccess.getBlockMetadata(par2, par3, par4); ++ ++ if ((var6 & 8) != 0) { ++ if (this.blockAccess.getBlockId(par2, par3 - 1, par4) != par1Block.blockID) { + return false; + } +- } else if(this.blockAccess.getBlockId(var2, var3 + 1, var4) != var1.blockID) { ++ } else if (this.blockAccess.getBlockId(par2, par3 + 1, par4) != par1Block.blockID) { + return false; + } + +@@ -5543,747 +6324,833 @@ + float var9 = 1.0F; + float var10 = 0.8F; + float var11 = 0.6F; +- int var12 = var1.getMixedBrightnessForBlock(this.blockAccess, var2, var3, var4); +- var5.setBrightness(this.renderMinY > 0.0D ? var12 : var1.getMixedBrightnessForBlock(this.blockAccess, var2, var3 - 1, var4)); ++ int var12 = par1Block.getMixedBrightnessForBlock(this.blockAccess, par2, par3, par4); ++ var5.setBrightness(this.renderMinY > 0.0D ? var12 : par1Block.getMixedBrightnessForBlock(this.blockAccess, par2, par3 - 1, par4)); + var5.setColorOpaque_F(var8, var8, var8); +- this.renderFaceYNeg(var1, (double)var2, (double)var3, (double)var4, this.getBlockIcon(var1, this.blockAccess, var2, var3, var4, 0)); ++ this.renderFaceYNeg(par1Block, (double)par2, (double)par3, (double)par4, this.getBlockIcon(par1Block, this.blockAccess, par2, par3, par4, 0)); + var7 = true; +- var5.setBrightness(this.renderMaxY < 1.0D ? var12 : var1.getMixedBrightnessForBlock(this.blockAccess, var2, var3 + 1, var4)); ++ var5.setBrightness(this.renderMaxY < 1.0D ? var12 : par1Block.getMixedBrightnessForBlock(this.blockAccess, par2, par3 + 1, par4)); + var5.setColorOpaque_F(var9, var9, var9); +- this.renderFaceYPos(var1, (double)var2, (double)var3, (double)var4, this.getBlockIcon(var1, this.blockAccess, var2, var3, var4, 1)); +- var7 = true; +- var5.setBrightness(this.renderMinZ > 0.0D ? var12 : var1.getMixedBrightnessForBlock(this.blockAccess, var2, var3, var4 - 1)); +- var5.setColorOpaque_F(var10, var10, var10); +- Icon var14 = this.getBlockIcon(var1, this.blockAccess, var2, var3, var4, 2); +- this.renderFaceZNeg(var1, (double)var2, (double)var3, (double)var4, var14); +- var7 = true; +- this.flipTexture = false; +- var5.setBrightness(this.renderMaxZ < 1.0D ? var12 : var1.getMixedBrightnessForBlock(this.blockAccess, var2, var3, var4 + 1)); +- var5.setColorOpaque_F(var10, var10, var10); +- var14 = this.getBlockIcon(var1, this.blockAccess, var2, var3, var4, 3); +- this.renderFaceZPos(var1, (double)var2, (double)var3, (double)var4, var14); +- var7 = true; +- this.flipTexture = false; +- var5.setBrightness(this.renderMinX > 0.0D ? var12 : var1.getMixedBrightnessForBlock(this.blockAccess, var2 - 1, var3, var4)); +- var5.setColorOpaque_F(var11, var11, var11); +- var14 = this.getBlockIcon(var1, this.blockAccess, var2, var3, var4, 4); +- this.renderFaceXNeg(var1, (double)var2, (double)var3, (double)var4, var14); +- var7 = true; +- this.flipTexture = false; +- var5.setBrightness(this.renderMaxX < 1.0D ? var12 : var1.getMixedBrightnessForBlock(this.blockAccess, var2 + 1, var3, var4)); +- var5.setColorOpaque_F(var11, var11, var11); +- var14 = this.getBlockIcon(var1, this.blockAccess, var2, var3, var4, 5); +- this.renderFaceXPos(var1, (double)var2, (double)var3, (double)var4, var14); ++ this.renderFaceYPos(par1Block, (double)par2, (double)par3, (double)par4, this.getBlockIcon(par1Block, this.blockAccess, par2, par3, par4, 1)); ++ var7 = true; ++ var5.setBrightness(this.renderMinZ > 0.0D ? var12 : par1Block.getMixedBrightnessForBlock(this.blockAccess, par2, par3, par4 - 1)); ++ var5.setColorOpaque_F(var10, var10, var10); ++ Icon var14 = this.getBlockIcon(par1Block, this.blockAccess, par2, par3, par4, 2); ++ this.renderFaceZNeg(par1Block, (double)par2, (double)par3, (double)par4, var14); ++ var7 = true; ++ this.flipTexture = false; ++ var5.setBrightness(this.renderMaxZ < 1.0D ? var12 : par1Block.getMixedBrightnessForBlock(this.blockAccess, par2, par3, par4 + 1)); ++ var5.setColorOpaque_F(var10, var10, var10); ++ var14 = this.getBlockIcon(par1Block, this.blockAccess, par2, par3, par4, 3); ++ this.renderFaceZPos(par1Block, (double)par2, (double)par3, (double)par4, var14); ++ var7 = true; ++ this.flipTexture = false; ++ var5.setBrightness(this.renderMinX > 0.0D ? var12 : par1Block.getMixedBrightnessForBlock(this.blockAccess, par2 - 1, par3, par4)); ++ var5.setColorOpaque_F(var11, var11, var11); ++ var14 = this.getBlockIcon(par1Block, this.blockAccess, par2, par3, par4, 4); ++ this.renderFaceXNeg(par1Block, (double)par2, (double)par3, (double)par4, var14); ++ var7 = true; ++ this.flipTexture = false; ++ var5.setBrightness(this.renderMaxX < 1.0D ? var12 : par1Block.getMixedBrightnessForBlock(this.blockAccess, par2 + 1, par3, par4)); ++ var5.setColorOpaque_F(var11, var11, var11); ++ var14 = this.getBlockIcon(par1Block, this.blockAccess, par2, par3, par4, 5); ++ this.renderFaceXPos(par1Block, (double)par2, (double)par3, (double)par4, var14); + var7 = true; + this.flipTexture = false; + return var7; + } + +- public void renderFaceYNeg(Block var1, double var2, double var4, double var6, Icon var8) { +- Tessellator var9 = Tessellator.instance; +- if(this.hasOverrideBlockTexture()) { +- var8 = this.overrideBlockTexture; +- } +- +- double var10 = (double)var8.getInterpolatedU(this.renderMinX * 16.0D); +- double var12 = (double)var8.getInterpolatedU(this.renderMaxX * 16.0D); +- double var14 = (double)var8.getInterpolatedV(this.renderMinZ * 16.0D); +- double var16 = (double)var8.getInterpolatedV(this.renderMaxZ * 16.0D); +- if(this.renderMinX < 0.0D || this.renderMaxX > 1.0D) { +- var10 = (double)var8.getMinU(); +- var12 = (double)var8.getMaxU(); +- } +- +- if(this.renderMinZ < 0.0D || this.renderMaxZ > 1.0D) { +- var14 = (double)var8.getMinV(); +- var16 = (double)var8.getMaxV(); +- } +- +- double var18 = var12; +- double var20 = var10; +- double var22 = var14; +- double var24 = var16; +- if(this.uvRotateBottom == 2) { +- var10 = (double)var8.getInterpolatedU(this.renderMinZ * 16.0D); +- var14 = (double)var8.getInterpolatedV(16.0D - this.renderMaxX * 16.0D); +- var12 = (double)var8.getInterpolatedU(this.renderMaxZ * 16.0D); +- var16 = (double)var8.getInterpolatedV(16.0D - this.renderMinX * 16.0D); +- var22 = var14; +- var24 = var16; +- var18 = var10; +- var20 = var12; +- var14 = var16; +- var16 = var22; +- } else if(this.uvRotateBottom == 1) { +- var10 = (double)var8.getInterpolatedU(16.0D - this.renderMaxZ * 16.0D); +- var14 = (double)var8.getInterpolatedV(this.renderMinX * 16.0D); +- var12 = (double)var8.getInterpolatedU(16.0D - this.renderMinZ * 16.0D); +- var16 = (double)var8.getInterpolatedV(this.renderMaxX * 16.0D); +- var18 = var12; +- var20 = var10; +- var10 = var12; +- var12 = var20; +- var22 = var16; +- var24 = var14; +- } else if(this.uvRotateBottom == 3) { +- var10 = (double)var8.getInterpolatedU(16.0D - this.renderMinX * 16.0D); +- var12 = (double)var8.getInterpolatedU(16.0D - this.renderMaxX * 16.0D); +- var14 = (double)var8.getInterpolatedV(16.0D - this.renderMinZ * 16.0D); +- var16 = (double)var8.getInterpolatedV(16.0D - this.renderMaxZ * 16.0D); +- var18 = var12; +- var20 = var10; +- var22 = var14; +- var24 = var16; +- } +- +- double var26 = var2 + this.renderMinX; +- double var28 = var2 + this.renderMaxX; +- double var30 = var4 + this.renderMinY; +- double var32 = var6 + this.renderMinZ; +- double var34 = var6 + this.renderMaxZ; +- if(this.enableAO) { +- var9.setColorOpaque_F(this.colorRedTopLeft, this.colorGreenTopLeft, this.colorBlueTopLeft); +- var9.setBrightness(this.brightnessTopLeft); +- var9.addVertexWithUV(var26, var30, var34, var20, var24); +- var9.setColorOpaque_F(this.colorRedBottomLeft, this.colorGreenBottomLeft, this.colorBlueBottomLeft); +- var9.setBrightness(this.brightnessBottomLeft); +- var9.addVertexWithUV(var26, var30, var32, var10, var14); +- var9.setColorOpaque_F(this.colorRedBottomRight, this.colorGreenBottomRight, this.colorBlueBottomRight); +- var9.setBrightness(this.brightnessBottomRight); +- var9.addVertexWithUV(var28, var30, var32, var18, var22); +- var9.setColorOpaque_F(this.colorRedTopRight, this.colorGreenTopRight, this.colorBlueTopRight); +- var9.setBrightness(this.brightnessTopRight); +- var9.addVertexWithUV(var28, var30, var34, var12, var16); +- } else { +- var9.addVertexWithUV(var26, var30, var34, var20, var24); +- var9.addVertexWithUV(var26, var30, var32, var10, var14); +- var9.addVertexWithUV(var28, var30, var32, var18, var22); +- var9.addVertexWithUV(var28, var30, var34, var12, var16); +- } +- +- } +- +- public void renderFaceYPos(Block var1, double var2, double var4, double var6, Icon var8) { +- Tessellator var9 = Tessellator.instance; +- if(this.hasOverrideBlockTexture()) { +- var8 = this.overrideBlockTexture; +- } +- +- double var10 = (double)var8.getInterpolatedU(this.renderMinX * 16.0D); +- double var12 = (double)var8.getInterpolatedU(this.renderMaxX * 16.0D); +- double var14 = (double)var8.getInterpolatedV(this.renderMinZ * 16.0D); +- double var16 = (double)var8.getInterpolatedV(this.renderMaxZ * 16.0D); +- if(this.renderMinX < 0.0D || this.renderMaxX > 1.0D) { +- var10 = (double)var8.getMinU(); +- var12 = (double)var8.getMaxU(); +- } +- +- if(this.renderMinZ < 0.0D || this.renderMaxZ > 1.0D) { +- var14 = (double)var8.getMinV(); +- var16 = (double)var8.getMaxV(); +- } +- +- double var18 = var12; +- double var20 = var10; +- double var22 = var14; +- double var24 = var16; +- if(this.uvRotateTop == 1) { +- var10 = (double)var8.getInterpolatedU(this.renderMinZ * 16.0D); +- var14 = (double)var8.getInterpolatedV(16.0D - this.renderMaxX * 16.0D); +- var12 = (double)var8.getInterpolatedU(this.renderMaxZ * 16.0D); +- var16 = (double)var8.getInterpolatedV(16.0D - this.renderMinX * 16.0D); +- var22 = var14; +- var24 = var16; +- var18 = var10; +- var20 = var12; +- var14 = var16; +- var16 = var22; +- } else if(this.uvRotateTop == 2) { +- var10 = (double)var8.getInterpolatedU(16.0D - this.renderMaxZ * 16.0D); +- var14 = (double)var8.getInterpolatedV(this.renderMinX * 16.0D); +- var12 = (double)var8.getInterpolatedU(16.0D - this.renderMinZ * 16.0D); +- var16 = (double)var8.getInterpolatedV(this.renderMaxX * 16.0D); +- var18 = var12; +- var20 = var10; +- var10 = var12; +- var12 = var20; +- var22 = var16; +- var24 = var14; +- } else if(this.uvRotateTop == 3) { +- var10 = (double)var8.getInterpolatedU(16.0D - this.renderMinX * 16.0D); +- var12 = (double)var8.getInterpolatedU(16.0D - this.renderMaxX * 16.0D); +- var14 = (double)var8.getInterpolatedV(16.0D - this.renderMinZ * 16.0D); +- var16 = (double)var8.getInterpolatedV(16.0D - this.renderMaxZ * 16.0D); +- var18 = var12; +- var20 = var10; +- var22 = var14; +- var24 = var16; +- } +- +- double var26 = var2 + this.renderMinX; +- double var28 = var2 + this.renderMaxX; +- double var30 = var4 + this.renderMaxY; +- double var32 = var6 + this.renderMinZ; +- double var34 = var6 + this.renderMaxZ; +- if(this.enableAO) { +- var9.setColorOpaque_F(this.colorRedTopLeft, this.colorGreenTopLeft, this.colorBlueTopLeft); +- var9.setBrightness(this.brightnessTopLeft); +- var9.addVertexWithUV(var28, var30, var34, var12, var16); +- var9.setColorOpaque_F(this.colorRedBottomLeft, this.colorGreenBottomLeft, this.colorBlueBottomLeft); +- var9.setBrightness(this.brightnessBottomLeft); +- var9.addVertexWithUV(var28, var30, var32, var18, var22); +- var9.setColorOpaque_F(this.colorRedBottomRight, this.colorGreenBottomRight, this.colorBlueBottomRight); +- var9.setBrightness(this.brightnessBottomRight); +- var9.addVertexWithUV(var26, var30, var32, var10, var14); +- var9.setColorOpaque_F(this.colorRedTopRight, this.colorGreenTopRight, this.colorBlueTopRight); +- var9.setBrightness(this.brightnessTopRight); +- var9.addVertexWithUV(var26, var30, var34, var20, var24); +- } else { +- var9.addVertexWithUV(var28, var30, var34, var12, var16); +- var9.addVertexWithUV(var28, var30, var32, var18, var22); +- var9.addVertexWithUV(var26, var30, var32, var10, var14); +- var9.addVertexWithUV(var26, var30, var34, var20, var24); +- } +- +- } +- +- public void renderFaceZNeg(Block var1, double var2, double var4, double var6, Icon var8) { +- Tessellator var9 = Tessellator.instance; +- if(this.hasOverrideBlockTexture()) { +- var8 = this.overrideBlockTexture; +- } +- +- double var10 = (double)var8.getInterpolatedU(this.renderMinX * 16.0D); +- double var12 = (double)var8.getInterpolatedU(this.renderMaxX * 16.0D); +- double var14 = (double)var8.getInterpolatedV(16.0D - this.renderMaxY * 16.0D); +- double var16 = (double)var8.getInterpolatedV(16.0D - this.renderMinY * 16.0D); +- double var18; +- if(this.flipTexture) { +- var18 = var10; +- var10 = var12; +- var12 = var18; +- } +- +- if(this.renderMinX < 0.0D || this.renderMaxX > 1.0D) { +- var10 = (double)var8.getMinU(); +- var12 = (double)var8.getMaxU(); +- } +- +- if(this.renderMinY < 0.0D || this.renderMaxY > 1.0D) { +- var14 = (double)var8.getMinV(); +- var16 = (double)var8.getMaxV(); +- } +- +- var18 = var12; +- double var20 = var10; +- double var22 = var14; +- double var24 = var16; +- if(this.uvRotateEast == 2) { +- var10 = (double)var8.getInterpolatedU(this.renderMinY * 16.0D); +- var14 = (double)var8.getInterpolatedV(16.0D - this.renderMinX * 16.0D); +- var12 = (double)var8.getInterpolatedU(this.renderMaxY * 16.0D); +- var16 = (double)var8.getInterpolatedV(16.0D - this.renderMaxX * 16.0D); +- var22 = var14; +- var24 = var16; +- var18 = var10; +- var20 = var12; +- var14 = var16; +- var16 = var22; +- } else if(this.uvRotateEast == 1) { +- var10 = (double)var8.getInterpolatedU(16.0D - this.renderMaxY * 16.0D); +- var14 = (double)var8.getInterpolatedV(this.renderMaxX * 16.0D); +- var12 = (double)var8.getInterpolatedU(16.0D - this.renderMinY * 16.0D); +- var16 = (double)var8.getInterpolatedV(this.renderMinX * 16.0D); +- var18 = var12; +- var20 = var10; +- var10 = var12; +- var12 = var20; +- var22 = var16; +- var24 = var14; +- } else if(this.uvRotateEast == 3) { +- var10 = (double)var8.getInterpolatedU(16.0D - this.renderMinX * 16.0D); +- var12 = (double)var8.getInterpolatedU(16.0D - this.renderMaxX * 16.0D); +- var14 = (double)var8.getInterpolatedV(this.renderMaxY * 16.0D); +- var16 = (double)var8.getInterpolatedV(this.renderMinY * 16.0D); +- var18 = var12; +- var20 = var10; +- var22 = var14; +- var24 = var16; +- } +- +- double var26 = var2 + this.renderMinX; +- double var28 = var2 + this.renderMaxX; +- double var30 = var4 + this.renderMinY; +- double var32 = var4 + this.renderMaxY; +- double var34 = var6 + this.renderMinZ; +- if(this.enableAO) { +- var9.setColorOpaque_F(this.colorRedTopLeft, this.colorGreenTopLeft, this.colorBlueTopLeft); +- var9.setBrightness(this.brightnessTopLeft); +- var9.addVertexWithUV(var26, var32, var34, var18, var22); +- var9.setColorOpaque_F(this.colorRedBottomLeft, this.colorGreenBottomLeft, this.colorBlueBottomLeft); +- var9.setBrightness(this.brightnessBottomLeft); +- var9.addVertexWithUV(var28, var32, var34, var10, var14); +- var9.setColorOpaque_F(this.colorRedBottomRight, this.colorGreenBottomRight, this.colorBlueBottomRight); +- var9.setBrightness(this.brightnessBottomRight); +- var9.addVertexWithUV(var28, var30, var34, var20, var24); +- var9.setColorOpaque_F(this.colorRedTopRight, this.colorGreenTopRight, this.colorBlueTopRight); +- var9.setBrightness(this.brightnessTopRight); +- var9.addVertexWithUV(var26, var30, var34, var12, var16); +- } else { +- var9.addVertexWithUV(var26, var32, var34, var18, var22); +- var9.addVertexWithUV(var28, var32, var34, var10, var14); +- var9.addVertexWithUV(var28, var30, var34, var20, var24); +- var9.addVertexWithUV(var26, var30, var34, var12, var16); +- } +- +- } +- +- public void renderFaceZPos(Block var1, double var2, double var4, double var6, Icon var8) { +- Tessellator var9 = Tessellator.instance; +- if(this.hasOverrideBlockTexture()) { +- var8 = this.overrideBlockTexture; +- } +- +- double var10 = (double)var8.getInterpolatedU(this.renderMinX * 16.0D); +- double var12 = (double)var8.getInterpolatedU(this.renderMaxX * 16.0D); +- double var14 = (double)var8.getInterpolatedV(16.0D - this.renderMaxY * 16.0D); +- double var16 = (double)var8.getInterpolatedV(16.0D - this.renderMinY * 16.0D); +- double var18; +- if(this.flipTexture) { +- var18 = var10; +- var10 = var12; +- var12 = var18; +- } +- +- if(this.renderMinX < 0.0D || this.renderMaxX > 1.0D) { +- var10 = (double)var8.getMinU(); +- var12 = (double)var8.getMaxU(); +- } +- +- if(this.renderMinY < 0.0D || this.renderMaxY > 1.0D) { +- var14 = (double)var8.getMinV(); +- var16 = (double)var8.getMaxV(); +- } +- +- var18 = var12; +- double var20 = var10; +- double var22 = var14; +- double var24 = var16; +- if(this.uvRotateWest == 1) { +- var10 = (double)var8.getInterpolatedU(this.renderMinY * 16.0D); +- var16 = (double)var8.getInterpolatedV(16.0D - this.renderMinX * 16.0D); +- var12 = (double)var8.getInterpolatedU(this.renderMaxY * 16.0D); +- var14 = (double)var8.getInterpolatedV(16.0D - this.renderMaxX * 16.0D); +- var22 = var14; +- var24 = var16; +- var18 = var10; +- var20 = var12; +- var14 = var16; +- var16 = var22; +- } else if(this.uvRotateWest == 2) { +- var10 = (double)var8.getInterpolatedU(16.0D - this.renderMaxY * 16.0D); +- var14 = (double)var8.getInterpolatedV(this.renderMinX * 16.0D); +- var12 = (double)var8.getInterpolatedU(16.0D - this.renderMinY * 16.0D); +- var16 = (double)var8.getInterpolatedV(this.renderMaxX * 16.0D); +- var18 = var12; +- var20 = var10; +- var10 = var12; +- var12 = var20; +- var22 = var16; +- var24 = var14; +- } else if(this.uvRotateWest == 3) { +- var10 = (double)var8.getInterpolatedU(16.0D - this.renderMinX * 16.0D); +- var12 = (double)var8.getInterpolatedU(16.0D - this.renderMaxX * 16.0D); +- var14 = (double)var8.getInterpolatedV(this.renderMaxY * 16.0D); +- var16 = (double)var8.getInterpolatedV(this.renderMinY * 16.0D); +- var18 = var12; +- var20 = var10; +- var22 = var14; +- var24 = var16; +- } +- +- double var26 = var2 + this.renderMinX; +- double var28 = var2 + this.renderMaxX; +- double var30 = var4 + this.renderMinY; +- double var32 = var4 + this.renderMaxY; +- double var34 = var6 + this.renderMaxZ; +- if(this.enableAO) { +- var9.setColorOpaque_F(this.colorRedTopLeft, this.colorGreenTopLeft, this.colorBlueTopLeft); +- var9.setBrightness(this.brightnessTopLeft); +- var9.addVertexWithUV(var26, var32, var34, var10, var14); +- var9.setColorOpaque_F(this.colorRedBottomLeft, this.colorGreenBottomLeft, this.colorBlueBottomLeft); +- var9.setBrightness(this.brightnessBottomLeft); +- var9.addVertexWithUV(var26, var30, var34, var20, var24); +- var9.setColorOpaque_F(this.colorRedBottomRight, this.colorGreenBottomRight, this.colorBlueBottomRight); +- var9.setBrightness(this.brightnessBottomRight); +- var9.addVertexWithUV(var28, var30, var34, var12, var16); +- var9.setColorOpaque_F(this.colorRedTopRight, this.colorGreenTopRight, this.colorBlueTopRight); +- var9.setBrightness(this.brightnessTopRight); +- var9.addVertexWithUV(var28, var32, var34, var18, var22); +- } else { +- var9.addVertexWithUV(var26, var32, var34, var10, var14); +- var9.addVertexWithUV(var26, var30, var34, var20, var24); +- var9.addVertexWithUV(var28, var30, var34, var12, var16); +- var9.addVertexWithUV(var28, var32, var34, var18, var22); +- } +- +- } +- +- public void renderFaceXNeg(Block var1, double var2, double var4, double var6, Icon var8) { +- Tessellator var9 = Tessellator.instance; +- if(this.hasOverrideBlockTexture()) { +- var8 = this.overrideBlockTexture; +- } +- +- double var10 = (double)var8.getInterpolatedU(this.renderMinZ * 16.0D); +- double var12 = (double)var8.getInterpolatedU(this.renderMaxZ * 16.0D); +- double var14 = (double)var8.getInterpolatedV(16.0D - this.renderMaxY * 16.0D); +- double var16 = (double)var8.getInterpolatedV(16.0D - this.renderMinY * 16.0D); +- double var18; +- if(this.flipTexture) { +- var18 = var10; +- var10 = var12; +- var12 = var18; +- } +- +- if(this.renderMinZ < 0.0D || this.renderMaxZ > 1.0D) { +- var10 = (double)var8.getMinU(); +- var12 = (double)var8.getMaxU(); +- } +- +- if(this.renderMinY < 0.0D || this.renderMaxY > 1.0D) { +- var14 = (double)var8.getMinV(); +- var16 = (double)var8.getMaxV(); +- } +- +- var18 = var12; +- double var20 = var10; +- double var22 = var14; +- double var24 = var16; +- if(this.uvRotateNorth == 1) { +- var10 = (double)var8.getInterpolatedU(this.renderMinY * 16.0D); +- var14 = (double)var8.getInterpolatedV(16.0D - this.renderMaxZ * 16.0D); +- var12 = (double)var8.getInterpolatedU(this.renderMaxY * 16.0D); +- var16 = (double)var8.getInterpolatedV(16.0D - this.renderMinZ * 16.0D); +- var22 = var14; +- var24 = var16; +- var18 = var10; +- var20 = var12; +- var14 = var16; +- var16 = var22; +- } else if(this.uvRotateNorth == 2) { +- var10 = (double)var8.getInterpolatedU(16.0D - this.renderMaxY * 16.0D); +- var14 = (double)var8.getInterpolatedV(this.renderMinZ * 16.0D); +- var12 = (double)var8.getInterpolatedU(16.0D - this.renderMinY * 16.0D); +- var16 = (double)var8.getInterpolatedV(this.renderMaxZ * 16.0D); +- var18 = var12; +- var20 = var10; +- var10 = var12; +- var12 = var20; +- var22 = var16; +- var24 = var14; +- } else if(this.uvRotateNorth == 3) { +- var10 = (double)var8.getInterpolatedU(16.0D - this.renderMinZ * 16.0D); +- var12 = (double)var8.getInterpolatedU(16.0D - this.renderMaxZ * 16.0D); +- var14 = (double)var8.getInterpolatedV(this.renderMaxY * 16.0D); +- var16 = (double)var8.getInterpolatedV(this.renderMinY * 16.0D); +- var18 = var12; +- var20 = var10; +- var22 = var14; +- var24 = var16; +- } +- +- double var26 = var2 + this.renderMinX; +- double var28 = var4 + this.renderMinY; +- double var30 = var4 + this.renderMaxY; +- double var32 = var6 + this.renderMinZ; +- double var34 = var6 + this.renderMaxZ; +- if(this.enableAO) { +- var9.setColorOpaque_F(this.colorRedTopLeft, this.colorGreenTopLeft, this.colorBlueTopLeft); +- var9.setBrightness(this.brightnessTopLeft); +- var9.addVertexWithUV(var26, var30, var34, var18, var22); +- var9.setColorOpaque_F(this.colorRedBottomLeft, this.colorGreenBottomLeft, this.colorBlueBottomLeft); +- var9.setBrightness(this.brightnessBottomLeft); +- var9.addVertexWithUV(var26, var30, var32, var10, var14); +- var9.setColorOpaque_F(this.colorRedBottomRight, this.colorGreenBottomRight, this.colorBlueBottomRight); +- var9.setBrightness(this.brightnessBottomRight); +- var9.addVertexWithUV(var26, var28, var32, var20, var24); +- var9.setColorOpaque_F(this.colorRedTopRight, this.colorGreenTopRight, this.colorBlueTopRight); +- var9.setBrightness(this.brightnessTopRight); +- var9.addVertexWithUV(var26, var28, var34, var12, var16); +- } else { +- var9.addVertexWithUV(var26, var30, var34, var18, var22); +- var9.addVertexWithUV(var26, var30, var32, var10, var14); +- var9.addVertexWithUV(var26, var28, var32, var20, var24); +- var9.addVertexWithUV(var26, var28, var34, var12, var16); +- } +- +- } +- +- public void renderFaceXPos(Block var1, double var2, double var4, double var6, Icon var8) { +- Tessellator var9 = Tessellator.instance; +- if(this.hasOverrideBlockTexture()) { +- var8 = this.overrideBlockTexture; +- } +- +- double var10 = (double)var8.getInterpolatedU(this.renderMinZ * 16.0D); +- double var12 = (double)var8.getInterpolatedU(this.renderMaxZ * 16.0D); +- double var14 = (double)var8.getInterpolatedV(16.0D - this.renderMaxY * 16.0D); +- double var16 = (double)var8.getInterpolatedV(16.0D - this.renderMinY * 16.0D); +- double var18; +- if(this.flipTexture) { +- var18 = var10; +- var10 = var12; +- var12 = var18; +- } +- +- if(this.renderMinZ < 0.0D || this.renderMaxZ > 1.0D) { +- var10 = (double)var8.getMinU(); +- var12 = (double)var8.getMaxU(); +- } +- +- if(this.renderMinY < 0.0D || this.renderMaxY > 1.0D) { +- var14 = (double)var8.getMinV(); +- var16 = (double)var8.getMaxV(); +- } +- +- var18 = var12; +- double var20 = var10; +- double var22 = var14; +- double var24 = var16; +- if(this.uvRotateSouth == 2) { +- var10 = (double)var8.getInterpolatedU(this.renderMinY * 16.0D); +- var14 = (double)var8.getInterpolatedV(16.0D - this.renderMinZ * 16.0D); +- var12 = (double)var8.getInterpolatedU(this.renderMaxY * 16.0D); +- var16 = (double)var8.getInterpolatedV(16.0D - this.renderMaxZ * 16.0D); +- var22 = var14; +- var24 = var16; +- var18 = var10; +- var20 = var12; +- var14 = var16; +- var16 = var22; +- } else if(this.uvRotateSouth == 1) { +- var10 = (double)var8.getInterpolatedU(16.0D - this.renderMaxY * 16.0D); +- var14 = (double)var8.getInterpolatedV(this.renderMaxZ * 16.0D); +- var12 = (double)var8.getInterpolatedU(16.0D - this.renderMinY * 16.0D); +- var16 = (double)var8.getInterpolatedV(this.renderMinZ * 16.0D); +- var18 = var12; +- var20 = var10; +- var10 = var12; +- var12 = var20; +- var22 = var16; +- var24 = var14; +- } else if(this.uvRotateSouth == 3) { +- var10 = (double)var8.getInterpolatedU(16.0D - this.renderMinZ * 16.0D); +- var12 = (double)var8.getInterpolatedU(16.0D - this.renderMaxZ * 16.0D); +- var14 = (double)var8.getInterpolatedV(this.renderMaxY * 16.0D); +- var16 = (double)var8.getInterpolatedV(this.renderMinY * 16.0D); +- var18 = var12; +- var20 = var10; +- var22 = var14; +- var24 = var16; +- } +- +- double var26 = var2 + this.renderMaxX; +- double var28 = var4 + this.renderMinY; +- double var30 = var4 + this.renderMaxY; +- double var32 = var6 + this.renderMinZ; +- double var34 = var6 + this.renderMaxZ; +- if(this.enableAO) { +- var9.setColorOpaque_F(this.colorRedTopLeft, this.colorGreenTopLeft, this.colorBlueTopLeft); +- var9.setBrightness(this.brightnessTopLeft); +- var9.addVertexWithUV(var26, var28, var34, var20, var24); +- var9.setColorOpaque_F(this.colorRedBottomLeft, this.colorGreenBottomLeft, this.colorBlueBottomLeft); +- var9.setBrightness(this.brightnessBottomLeft); +- var9.addVertexWithUV(var26, var28, var32, var12, var16); +- var9.setColorOpaque_F(this.colorRedBottomRight, this.colorGreenBottomRight, this.colorBlueBottomRight); +- var9.setBrightness(this.brightnessBottomRight); +- var9.addVertexWithUV(var26, var30, var32, var18, var22); +- var9.setColorOpaque_F(this.colorRedTopRight, this.colorGreenTopRight, this.colorBlueTopRight); +- var9.setBrightness(this.brightnessTopRight); +- var9.addVertexWithUV(var26, var30, var34, var10, var14); +- } else { +- var9.addVertexWithUV(var26, var28, var34, var20, var24); +- var9.addVertexWithUV(var26, var28, var32, var12, var16); +- var9.addVertexWithUV(var26, var30, var32, var18, var22); +- var9.addVertexWithUV(var26, var30, var34, var10, var14); +- } +- +- } +- +- public void renderBlockAsItem(Block var1, int var2, float var3) { ++ /** ++ * Renders the given texture to the bottom face of the block. Args: block, x, y, z, texture ++ */ ++ public void renderFaceYNeg(Block par1Block, double par2, double par4, double par6, Icon par8Icon) { ++ Tessellator var9 = Tessellator.instance; ++ ++ if (this.hasOverrideBlockTexture()) { ++ par8Icon = this.overrideBlockTexture; ++ } ++ ++ par8Icon = CTMUtils.getTile(this, par1Block, (int)par2, (int)par4, (int)par6, 0, par8Icon, var9); ++ ++ if (par8Icon != null) { ++ var9 = TessellatorUtils.getTessellator(var9, par8Icon); ++ double var10 = (double)par8Icon.getInterpolatedU(this.renderMinX * 16.0D); ++ double var12 = (double)par8Icon.getInterpolatedU(this.renderMaxX * 16.0D); ++ double var14 = (double)par8Icon.getInterpolatedV(this.renderMinZ * 16.0D); ++ double var16 = (double)par8Icon.getInterpolatedV(this.renderMaxZ * 16.0D); ++ ++ if (this.renderMinX < 0.0D || this.renderMaxX > 1.0D) { ++ var10 = (double)par8Icon.getMinU(); ++ var12 = (double)par8Icon.getMaxU(); ++ } ++ ++ if (this.renderMinZ < 0.0D || this.renderMaxZ > 1.0D) { ++ var14 = (double)par8Icon.getMinV(); ++ var16 = (double)par8Icon.getMaxV(); ++ } ++ ++ double var18 = var12; ++ double var20 = var10; ++ double var22 = var14; ++ double var24 = var16; ++ ++ if (this.uvRotateBottom == 2) { ++ var10 = (double)par8Icon.getInterpolatedU(this.renderMinZ * 16.0D); ++ var14 = (double)par8Icon.getInterpolatedV(16.0D - this.renderMaxX * 16.0D); ++ var12 = (double)par8Icon.getInterpolatedU(this.renderMaxZ * 16.0D); ++ var16 = (double)par8Icon.getInterpolatedV(16.0D - this.renderMinX * 16.0D); ++ var22 = var14; ++ var24 = var16; ++ var18 = var10; ++ var20 = var12; ++ var14 = var16; ++ var16 = var22; ++ } else if (this.uvRotateBottom == 1) { ++ var10 = (double)par8Icon.getInterpolatedU(16.0D - this.renderMaxZ * 16.0D); ++ var14 = (double)par8Icon.getInterpolatedV(this.renderMinX * 16.0D); ++ var12 = (double)par8Icon.getInterpolatedU(16.0D - this.renderMinZ * 16.0D); ++ var16 = (double)par8Icon.getInterpolatedV(this.renderMaxX * 16.0D); ++ var18 = var12; ++ var20 = var10; ++ var10 = var12; ++ var12 = var20; ++ var22 = var16; ++ var24 = var14; ++ } else if (this.uvRotateBottom == 3) { ++ var10 = (double)par8Icon.getInterpolatedU(16.0D - this.renderMinX * 16.0D); ++ var12 = (double)par8Icon.getInterpolatedU(16.0D - this.renderMaxX * 16.0D); ++ var14 = (double)par8Icon.getInterpolatedV(16.0D - this.renderMinZ * 16.0D); ++ var16 = (double)par8Icon.getInterpolatedV(16.0D - this.renderMaxZ * 16.0D); ++ var18 = var12; ++ var20 = var10; ++ var22 = var14; ++ var24 = var16; ++ } ++ ++ double var26 = par2 + this.renderMinX; ++ double var28 = par2 + this.renderMaxX; ++ double var30 = par4 + this.renderMinY; ++ double var32 = par6 + this.renderMinZ; ++ double var34 = par6 + this.renderMaxZ; ++ ++ if (this.enableAO) { ++ var9.setColorOpaque_F(this.colorRedTopLeft, this.colorGreenTopLeft, this.colorBlueTopLeft); ++ var9.setBrightness(this.brightnessTopLeft); ++ var9.addVertexWithUV(var26, var30, var34, var20, var24); ++ var9.setColorOpaque_F(this.colorRedBottomLeft, this.colorGreenBottomLeft, this.colorBlueBottomLeft); ++ var9.setBrightness(this.brightnessBottomLeft); ++ var9.addVertexWithUV(var26, var30, var32, var10, var14); ++ var9.setColorOpaque_F(this.colorRedBottomRight, this.colorGreenBottomRight, this.colorBlueBottomRight); ++ var9.setBrightness(this.brightnessBottomRight); ++ var9.addVertexWithUV(var28, var30, var32, var18, var22); ++ var9.setColorOpaque_F(this.colorRedTopRight, this.colorGreenTopRight, this.colorBlueTopRight); ++ var9.setBrightness(this.brightnessTopRight); ++ var9.addVertexWithUV(var28, var30, var34, var12, var16); ++ } else { ++ var9.addVertexWithUV(var26, var30, var34, var20, var24); ++ var9.addVertexWithUV(var26, var30, var32, var10, var14); ++ var9.addVertexWithUV(var28, var30, var32, var18, var22); ++ var9.addVertexWithUV(var28, var30, var34, var12, var16); ++ } ++ } ++ } ++ ++ /** ++ * Renders the given texture to the top face of the block. Args: block, x, y, z, texture ++ */ ++ public void renderFaceYPos(Block par1Block, double par2, double par4, double par6, Icon par8Icon) { ++ Tessellator var9 = Tessellator.instance; ++ ++ if (this.hasOverrideBlockTexture()) { ++ par8Icon = this.overrideBlockTexture; ++ } ++ ++ par8Icon = CTMUtils.getTile(this, par1Block, (int)par2, (int)par4, (int)par6, 1, par8Icon, var9); ++ ++ if (par8Icon != null) { ++ var9 = TessellatorUtils.getTessellator(var9, par8Icon); ++ double var10 = (double)par8Icon.getInterpolatedU(this.renderMinX * 16.0D); ++ double var12 = (double)par8Icon.getInterpolatedU(this.renderMaxX * 16.0D); ++ double var14 = (double)par8Icon.getInterpolatedV(this.renderMinZ * 16.0D); ++ double var16 = (double)par8Icon.getInterpolatedV(this.renderMaxZ * 16.0D); ++ ++ if (this.renderMinX < 0.0D || this.renderMaxX > 1.0D) { ++ var10 = (double)par8Icon.getMinU(); ++ var12 = (double)par8Icon.getMaxU(); ++ } ++ ++ if (this.renderMinZ < 0.0D || this.renderMaxZ > 1.0D) { ++ var14 = (double)par8Icon.getMinV(); ++ var16 = (double)par8Icon.getMaxV(); ++ } ++ ++ double var18 = var12; ++ double var20 = var10; ++ double var22 = var14; ++ double var24 = var16; ++ ++ if (this.uvRotateTop == 1) { ++ var10 = (double)par8Icon.getInterpolatedU(this.renderMinZ * 16.0D); ++ var14 = (double)par8Icon.getInterpolatedV(16.0D - this.renderMaxX * 16.0D); ++ var12 = (double)par8Icon.getInterpolatedU(this.renderMaxZ * 16.0D); ++ var16 = (double)par8Icon.getInterpolatedV(16.0D - this.renderMinX * 16.0D); ++ var22 = var14; ++ var24 = var16; ++ var18 = var10; ++ var20 = var12; ++ var14 = var16; ++ var16 = var22; ++ } else if (this.uvRotateTop == 2) { ++ var10 = (double)par8Icon.getInterpolatedU(16.0D - this.renderMaxZ * 16.0D); ++ var14 = (double)par8Icon.getInterpolatedV(this.renderMinX * 16.0D); ++ var12 = (double)par8Icon.getInterpolatedU(16.0D - this.renderMinZ * 16.0D); ++ var16 = (double)par8Icon.getInterpolatedV(this.renderMaxX * 16.0D); ++ var18 = var12; ++ var20 = var10; ++ var10 = var12; ++ var12 = var20; ++ var22 = var16; ++ var24 = var14; ++ } else if (this.uvRotateTop == 3) { ++ var10 = (double)par8Icon.getInterpolatedU(16.0D - this.renderMinX * 16.0D); ++ var12 = (double)par8Icon.getInterpolatedU(16.0D - this.renderMaxX * 16.0D); ++ var14 = (double)par8Icon.getInterpolatedV(16.0D - this.renderMinZ * 16.0D); ++ var16 = (double)par8Icon.getInterpolatedV(16.0D - this.renderMaxZ * 16.0D); ++ var18 = var12; ++ var20 = var10; ++ var22 = var14; ++ var24 = var16; ++ } ++ ++ double var26 = par2 + this.renderMinX; ++ double var28 = par2 + this.renderMaxX; ++ double var30 = par4 + this.renderMaxY; ++ double var32 = par6 + this.renderMinZ; ++ double var34 = par6 + this.renderMaxZ; ++ ++ if (this.enableAO) { ++ var9.setColorOpaque_F(this.colorRedTopLeft, this.colorGreenTopLeft, this.colorBlueTopLeft); ++ var9.setBrightness(this.brightnessTopLeft); ++ var9.addVertexWithUV(var28, var30, var34, var12, var16); ++ var9.setColorOpaque_F(this.colorRedBottomLeft, this.colorGreenBottomLeft, this.colorBlueBottomLeft); ++ var9.setBrightness(this.brightnessBottomLeft); ++ var9.addVertexWithUV(var28, var30, var32, var18, var22); ++ var9.setColorOpaque_F(this.colorRedBottomRight, this.colorGreenBottomRight, this.colorBlueBottomRight); ++ var9.setBrightness(this.brightnessBottomRight); ++ var9.addVertexWithUV(var26, var30, var32, var10, var14); ++ var9.setColorOpaque_F(this.colorRedTopRight, this.colorGreenTopRight, this.colorBlueTopRight); ++ var9.setBrightness(this.brightnessTopRight); ++ var9.addVertexWithUV(var26, var30, var34, var20, var24); ++ } else { ++ var9.addVertexWithUV(var28, var30, var34, var12, var16); ++ var9.addVertexWithUV(var28, var30, var32, var18, var22); ++ var9.addVertexWithUV(var26, var30, var32, var10, var14); ++ var9.addVertexWithUV(var26, var30, var34, var20, var24); ++ } ++ } ++ } ++ ++ /** ++ * Renders the given texture to the north (z-negative) face of the block. Args: block, x, y, z, texture ++ */ ++ public void renderFaceZNeg(Block par1Block, double par2, double par4, double par6, Icon par8Icon) { ++ Tessellator var9 = Tessellator.instance; ++ ++ if (this.hasOverrideBlockTexture()) { ++ par8Icon = this.overrideBlockTexture; ++ } ++ ++ par8Icon = CTMUtils.getTile(this, par1Block, (int)par2, (int)par4, (int)par6, 2, par8Icon, var9); ++ ++ if (par8Icon != null) { ++ var9 = TessellatorUtils.getTessellator(var9, par8Icon); ++ double var10 = (double)par8Icon.getInterpolatedU(this.renderMinX * 16.0D); ++ double var12 = (double)par8Icon.getInterpolatedU(this.renderMaxX * 16.0D); ++ double var14 = (double)par8Icon.getInterpolatedV(16.0D - this.renderMaxY * 16.0D); ++ double var16 = (double)par8Icon.getInterpolatedV(16.0D - this.renderMinY * 16.0D); ++ double var18; ++ ++ if (this.flipTexture) { ++ var18 = var10; ++ var10 = var12; ++ var12 = var18; ++ } ++ ++ if (this.renderMinX < 0.0D || this.renderMaxX > 1.0D) { ++ var10 = (double)par8Icon.getMinU(); ++ var12 = (double)par8Icon.getMaxU(); ++ } ++ ++ if (this.renderMinY < 0.0D || this.renderMaxY > 1.0D) { ++ var14 = (double)par8Icon.getMinV(); ++ var16 = (double)par8Icon.getMaxV(); ++ } ++ ++ var18 = var12; ++ double var20 = var10; ++ double var22 = var14; ++ double var24 = var16; ++ ++ if (this.uvRotateEast == 2) { ++ var10 = (double)par8Icon.getInterpolatedU(this.renderMinY * 16.0D); ++ var14 = (double)par8Icon.getInterpolatedV(16.0D - this.renderMinX * 16.0D); ++ var12 = (double)par8Icon.getInterpolatedU(this.renderMaxY * 16.0D); ++ var16 = (double)par8Icon.getInterpolatedV(16.0D - this.renderMaxX * 16.0D); ++ var22 = var14; ++ var24 = var16; ++ var18 = var10; ++ var20 = var12; ++ var14 = var16; ++ var16 = var22; ++ } else if (this.uvRotateEast == 1) { ++ var10 = (double)par8Icon.getInterpolatedU(16.0D - this.renderMaxY * 16.0D); ++ var14 = (double)par8Icon.getInterpolatedV(this.renderMaxX * 16.0D); ++ var12 = (double)par8Icon.getInterpolatedU(16.0D - this.renderMinY * 16.0D); ++ var16 = (double)par8Icon.getInterpolatedV(this.renderMinX * 16.0D); ++ var18 = var12; ++ var20 = var10; ++ var10 = var12; ++ var12 = var20; ++ var22 = var16; ++ var24 = var14; ++ } else if (this.uvRotateEast == 3) { ++ var10 = (double)par8Icon.getInterpolatedU(16.0D - this.renderMinX * 16.0D); ++ var12 = (double)par8Icon.getInterpolatedU(16.0D - this.renderMaxX * 16.0D); ++ var14 = (double)par8Icon.getInterpolatedV(this.renderMaxY * 16.0D); ++ var16 = (double)par8Icon.getInterpolatedV(this.renderMinY * 16.0D); ++ var18 = var12; ++ var20 = var10; ++ var22 = var14; ++ var24 = var16; ++ } ++ ++ double var26 = par2 + this.renderMinX; ++ double var28 = par2 + this.renderMaxX; ++ double var30 = par4 + this.renderMinY; ++ double var32 = par4 + this.renderMaxY; ++ double var34 = par6 + this.renderMinZ; ++ ++ if (this.enableAO) { ++ var9.setColorOpaque_F(this.colorRedTopLeft, this.colorGreenTopLeft, this.colorBlueTopLeft); ++ var9.setBrightness(this.brightnessTopLeft); ++ var9.addVertexWithUV(var26, var32, var34, var18, var22); ++ var9.setColorOpaque_F(this.colorRedBottomLeft, this.colorGreenBottomLeft, this.colorBlueBottomLeft); ++ var9.setBrightness(this.brightnessBottomLeft); ++ var9.addVertexWithUV(var28, var32, var34, var10, var14); ++ var9.setColorOpaque_F(this.colorRedBottomRight, this.colorGreenBottomRight, this.colorBlueBottomRight); ++ var9.setBrightness(this.brightnessBottomRight); ++ var9.addVertexWithUV(var28, var30, var34, var20, var24); ++ var9.setColorOpaque_F(this.colorRedTopRight, this.colorGreenTopRight, this.colorBlueTopRight); ++ var9.setBrightness(this.brightnessTopRight); ++ var9.addVertexWithUV(var26, var30, var34, var12, var16); ++ } else { ++ var9.addVertexWithUV(var26, var32, var34, var18, var22); ++ var9.addVertexWithUV(var28, var32, var34, var10, var14); ++ var9.addVertexWithUV(var28, var30, var34, var20, var24); ++ var9.addVertexWithUV(var26, var30, var34, var12, var16); ++ } ++ } ++ } ++ ++ /** ++ * Renders the given texture to the south (z-positive) face of the block. Args: block, x, y, z, texture ++ */ ++ public void renderFaceZPos(Block par1Block, double par2, double par4, double par6, Icon par8Icon) { ++ Tessellator var9 = Tessellator.instance; ++ ++ if (this.hasOverrideBlockTexture()) { ++ par8Icon = this.overrideBlockTexture; ++ } ++ ++ par8Icon = CTMUtils.getTile(this, par1Block, (int)par2, (int)par4, (int)par6, 3, par8Icon, var9); ++ ++ if (par8Icon != null) { ++ var9 = TessellatorUtils.getTessellator(var9, par8Icon); ++ double var10 = (double)par8Icon.getInterpolatedU(this.renderMinX * 16.0D); ++ double var12 = (double)par8Icon.getInterpolatedU(this.renderMaxX * 16.0D); ++ double var14 = (double)par8Icon.getInterpolatedV(16.0D - this.renderMaxY * 16.0D); ++ double var16 = (double)par8Icon.getInterpolatedV(16.0D - this.renderMinY * 16.0D); ++ double var18; ++ ++ if (this.flipTexture) { ++ var18 = var10; ++ var10 = var12; ++ var12 = var18; ++ } ++ ++ if (this.renderMinX < 0.0D || this.renderMaxX > 1.0D) { ++ var10 = (double)par8Icon.getMinU(); ++ var12 = (double)par8Icon.getMaxU(); ++ } ++ ++ if (this.renderMinY < 0.0D || this.renderMaxY > 1.0D) { ++ var14 = (double)par8Icon.getMinV(); ++ var16 = (double)par8Icon.getMaxV(); ++ } ++ ++ var18 = var12; ++ double var20 = var10; ++ double var22 = var14; ++ double var24 = var16; ++ ++ if (this.uvRotateWest == 1) { ++ var10 = (double)par8Icon.getInterpolatedU(this.renderMinY * 16.0D); ++ var16 = (double)par8Icon.getInterpolatedV(16.0D - this.renderMinX * 16.0D); ++ var12 = (double)par8Icon.getInterpolatedU(this.renderMaxY * 16.0D); ++ var14 = (double)par8Icon.getInterpolatedV(16.0D - this.renderMaxX * 16.0D); ++ var22 = var14; ++ var24 = var16; ++ var18 = var10; ++ var20 = var12; ++ var14 = var16; ++ var16 = var22; ++ } else if (this.uvRotateWest == 2) { ++ var10 = (double)par8Icon.getInterpolatedU(16.0D - this.renderMaxY * 16.0D); ++ var14 = (double)par8Icon.getInterpolatedV(this.renderMinX * 16.0D); ++ var12 = (double)par8Icon.getInterpolatedU(16.0D - this.renderMinY * 16.0D); ++ var16 = (double)par8Icon.getInterpolatedV(this.renderMaxX * 16.0D); ++ var18 = var12; ++ var20 = var10; ++ var10 = var12; ++ var12 = var20; ++ var22 = var16; ++ var24 = var14; ++ } else if (this.uvRotateWest == 3) { ++ var10 = (double)par8Icon.getInterpolatedU(16.0D - this.renderMinX * 16.0D); ++ var12 = (double)par8Icon.getInterpolatedU(16.0D - this.renderMaxX * 16.0D); ++ var14 = (double)par8Icon.getInterpolatedV(this.renderMaxY * 16.0D); ++ var16 = (double)par8Icon.getInterpolatedV(this.renderMinY * 16.0D); ++ var18 = var12; ++ var20 = var10; ++ var22 = var14; ++ var24 = var16; ++ } ++ ++ double var26 = par2 + this.renderMinX; ++ double var28 = par2 + this.renderMaxX; ++ double var30 = par4 + this.renderMinY; ++ double var32 = par4 + this.renderMaxY; ++ double var34 = par6 + this.renderMaxZ; ++ ++ if (this.enableAO) { ++ var9.setColorOpaque_F(this.colorRedTopLeft, this.colorGreenTopLeft, this.colorBlueTopLeft); ++ var9.setBrightness(this.brightnessTopLeft); ++ var9.addVertexWithUV(var26, var32, var34, var10, var14); ++ var9.setColorOpaque_F(this.colorRedBottomLeft, this.colorGreenBottomLeft, this.colorBlueBottomLeft); ++ var9.setBrightness(this.brightnessBottomLeft); ++ var9.addVertexWithUV(var26, var30, var34, var20, var24); ++ var9.setColorOpaque_F(this.colorRedBottomRight, this.colorGreenBottomRight, this.colorBlueBottomRight); ++ var9.setBrightness(this.brightnessBottomRight); ++ var9.addVertexWithUV(var28, var30, var34, var12, var16); ++ var9.setColorOpaque_F(this.colorRedTopRight, this.colorGreenTopRight, this.colorBlueTopRight); ++ var9.setBrightness(this.brightnessTopRight); ++ var9.addVertexWithUV(var28, var32, var34, var18, var22); ++ } else { ++ var9.addVertexWithUV(var26, var32, var34, var10, var14); ++ var9.addVertexWithUV(var26, var30, var34, var20, var24); ++ var9.addVertexWithUV(var28, var30, var34, var12, var16); ++ var9.addVertexWithUV(var28, var32, var34, var18, var22); ++ } ++ } ++ } ++ ++ /** ++ * Renders the given texture to the west (x-negative) face of the block. Args: block, x, y, z, texture ++ */ ++ public void renderFaceXNeg(Block par1Block, double par2, double par4, double par6, Icon par8Icon) { ++ Tessellator var9 = Tessellator.instance; ++ ++ if (this.hasOverrideBlockTexture()) { ++ par8Icon = this.overrideBlockTexture; ++ } ++ ++ par8Icon = CTMUtils.getTile(this, par1Block, (int)par2, (int)par4, (int)par6, 4, par8Icon, var9); ++ ++ if (par8Icon != null) { ++ var9 = TessellatorUtils.getTessellator(var9, par8Icon); ++ double var10 = (double)par8Icon.getInterpolatedU(this.renderMinZ * 16.0D); ++ double var12 = (double)par8Icon.getInterpolatedU(this.renderMaxZ * 16.0D); ++ double var14 = (double)par8Icon.getInterpolatedV(16.0D - this.renderMaxY * 16.0D); ++ double var16 = (double)par8Icon.getInterpolatedV(16.0D - this.renderMinY * 16.0D); ++ double var18; ++ ++ if (this.flipTexture) { ++ var18 = var10; ++ var10 = var12; ++ var12 = var18; ++ } ++ ++ if (this.renderMinZ < 0.0D || this.renderMaxZ > 1.0D) { ++ var10 = (double)par8Icon.getMinU(); ++ var12 = (double)par8Icon.getMaxU(); ++ } ++ ++ if (this.renderMinY < 0.0D || this.renderMaxY > 1.0D) { ++ var14 = (double)par8Icon.getMinV(); ++ var16 = (double)par8Icon.getMaxV(); ++ } ++ ++ var18 = var12; ++ double var20 = var10; ++ double var22 = var14; ++ double var24 = var16; ++ ++ if (this.uvRotateNorth == 1) { ++ var10 = (double)par8Icon.getInterpolatedU(this.renderMinY * 16.0D); ++ var14 = (double)par8Icon.getInterpolatedV(16.0D - this.renderMaxZ * 16.0D); ++ var12 = (double)par8Icon.getInterpolatedU(this.renderMaxY * 16.0D); ++ var16 = (double)par8Icon.getInterpolatedV(16.0D - this.renderMinZ * 16.0D); ++ var22 = var14; ++ var24 = var16; ++ var18 = var10; ++ var20 = var12; ++ var14 = var16; ++ var16 = var22; ++ } else if (this.uvRotateNorth == 2) { ++ var10 = (double)par8Icon.getInterpolatedU(16.0D - this.renderMaxY * 16.0D); ++ var14 = (double)par8Icon.getInterpolatedV(this.renderMinZ * 16.0D); ++ var12 = (double)par8Icon.getInterpolatedU(16.0D - this.renderMinY * 16.0D); ++ var16 = (double)par8Icon.getInterpolatedV(this.renderMaxZ * 16.0D); ++ var18 = var12; ++ var20 = var10; ++ var10 = var12; ++ var12 = var20; ++ var22 = var16; ++ var24 = var14; ++ } else if (this.uvRotateNorth == 3) { ++ var10 = (double)par8Icon.getInterpolatedU(16.0D - this.renderMinZ * 16.0D); ++ var12 = (double)par8Icon.getInterpolatedU(16.0D - this.renderMaxZ * 16.0D); ++ var14 = (double)par8Icon.getInterpolatedV(this.renderMaxY * 16.0D); ++ var16 = (double)par8Icon.getInterpolatedV(this.renderMinY * 16.0D); ++ var18 = var12; ++ var20 = var10; ++ var22 = var14; ++ var24 = var16; ++ } ++ ++ double var26 = par2 + this.renderMinX; ++ double var28 = par4 + this.renderMinY; ++ double var30 = par4 + this.renderMaxY; ++ double var32 = par6 + this.renderMinZ; ++ double var34 = par6 + this.renderMaxZ; ++ ++ if (this.enableAO) { ++ var9.setColorOpaque_F(this.colorRedTopLeft, this.colorGreenTopLeft, this.colorBlueTopLeft); ++ var9.setBrightness(this.brightnessTopLeft); ++ var9.addVertexWithUV(var26, var30, var34, var18, var22); ++ var9.setColorOpaque_F(this.colorRedBottomLeft, this.colorGreenBottomLeft, this.colorBlueBottomLeft); ++ var9.setBrightness(this.brightnessBottomLeft); ++ var9.addVertexWithUV(var26, var30, var32, var10, var14); ++ var9.setColorOpaque_F(this.colorRedBottomRight, this.colorGreenBottomRight, this.colorBlueBottomRight); ++ var9.setBrightness(this.brightnessBottomRight); ++ var9.addVertexWithUV(var26, var28, var32, var20, var24); ++ var9.setColorOpaque_F(this.colorRedTopRight, this.colorGreenTopRight, this.colorBlueTopRight); ++ var9.setBrightness(this.brightnessTopRight); ++ var9.addVertexWithUV(var26, var28, var34, var12, var16); ++ } else { ++ var9.addVertexWithUV(var26, var30, var34, var18, var22); ++ var9.addVertexWithUV(var26, var30, var32, var10, var14); ++ var9.addVertexWithUV(var26, var28, var32, var20, var24); ++ var9.addVertexWithUV(var26, var28, var34, var12, var16); ++ } ++ } ++ } ++ ++ /** ++ * Renders the given texture to the east (x-positive) face of the block. Args: block, x, y, z, texture ++ */ ++ public void renderFaceXPos(Block par1Block, double par2, double par4, double par6, Icon par8Icon) { ++ Tessellator var9 = Tessellator.instance; ++ ++ if (this.hasOverrideBlockTexture()) { ++ par8Icon = this.overrideBlockTexture; ++ } ++ ++ par8Icon = CTMUtils.getTile(this, par1Block, (int)par2, (int)par4, (int)par6, 5, par8Icon, var9); ++ ++ if (par8Icon != null) { ++ var9 = TessellatorUtils.getTessellator(var9, par8Icon); ++ double var10 = (double)par8Icon.getInterpolatedU(this.renderMinZ * 16.0D); ++ double var12 = (double)par8Icon.getInterpolatedU(this.renderMaxZ * 16.0D); ++ double var14 = (double)par8Icon.getInterpolatedV(16.0D - this.renderMaxY * 16.0D); ++ double var16 = (double)par8Icon.getInterpolatedV(16.0D - this.renderMinY * 16.0D); ++ double var18; ++ ++ if (this.flipTexture) { ++ var18 = var10; ++ var10 = var12; ++ var12 = var18; ++ } ++ ++ if (this.renderMinZ < 0.0D || this.renderMaxZ > 1.0D) { ++ var10 = (double)par8Icon.getMinU(); ++ var12 = (double)par8Icon.getMaxU(); ++ } ++ ++ if (this.renderMinY < 0.0D || this.renderMaxY > 1.0D) { ++ var14 = (double)par8Icon.getMinV(); ++ var16 = (double)par8Icon.getMaxV(); ++ } ++ ++ var18 = var12; ++ double var20 = var10; ++ double var22 = var14; ++ double var24 = var16; ++ ++ if (this.uvRotateSouth == 2) { ++ var10 = (double)par8Icon.getInterpolatedU(this.renderMinY * 16.0D); ++ var14 = (double)par8Icon.getInterpolatedV(16.0D - this.renderMinZ * 16.0D); ++ var12 = (double)par8Icon.getInterpolatedU(this.renderMaxY * 16.0D); ++ var16 = (double)par8Icon.getInterpolatedV(16.0D - this.renderMaxZ * 16.0D); ++ var22 = var14; ++ var24 = var16; ++ var18 = var10; ++ var20 = var12; ++ var14 = var16; ++ var16 = var22; ++ } else if (this.uvRotateSouth == 1) { ++ var10 = (double)par8Icon.getInterpolatedU(16.0D - this.renderMaxY * 16.0D); ++ var14 = (double)par8Icon.getInterpolatedV(this.renderMaxZ * 16.0D); ++ var12 = (double)par8Icon.getInterpolatedU(16.0D - this.renderMinY * 16.0D); ++ var16 = (double)par8Icon.getInterpolatedV(this.renderMinZ * 16.0D); ++ var18 = var12; ++ var20 = var10; ++ var10 = var12; ++ var12 = var20; ++ var22 = var16; ++ var24 = var14; ++ } else if (this.uvRotateSouth == 3) { ++ var10 = (double)par8Icon.getInterpolatedU(16.0D - this.renderMinZ * 16.0D); ++ var12 = (double)par8Icon.getInterpolatedU(16.0D - this.renderMaxZ * 16.0D); ++ var14 = (double)par8Icon.getInterpolatedV(this.renderMaxY * 16.0D); ++ var16 = (double)par8Icon.getInterpolatedV(this.renderMinY * 16.0D); ++ var18 = var12; ++ var20 = var10; ++ var22 = var14; ++ var24 = var16; ++ } ++ ++ double var26 = par2 + this.renderMaxX; ++ double var28 = par4 + this.renderMinY; ++ double var30 = par4 + this.renderMaxY; ++ double var32 = par6 + this.renderMinZ; ++ double var34 = par6 + this.renderMaxZ; ++ ++ if (this.enableAO) { ++ var9.setColorOpaque_F(this.colorRedTopLeft, this.colorGreenTopLeft, this.colorBlueTopLeft); ++ var9.setBrightness(this.brightnessTopLeft); ++ var9.addVertexWithUV(var26, var28, var34, var20, var24); ++ var9.setColorOpaque_F(this.colorRedBottomLeft, this.colorGreenBottomLeft, this.colorBlueBottomLeft); ++ var9.setBrightness(this.brightnessBottomLeft); ++ var9.addVertexWithUV(var26, var28, var32, var12, var16); ++ var9.setColorOpaque_F(this.colorRedBottomRight, this.colorGreenBottomRight, this.colorBlueBottomRight); ++ var9.setBrightness(this.brightnessBottomRight); ++ var9.addVertexWithUV(var26, var30, var32, var18, var22); ++ var9.setColorOpaque_F(this.colorRedTopRight, this.colorGreenTopRight, this.colorBlueTopRight); ++ var9.setBrightness(this.brightnessTopRight); ++ var9.addVertexWithUV(var26, var30, var34, var10, var14); ++ } else { ++ var9.addVertexWithUV(var26, var28, var34, var20, var24); ++ var9.addVertexWithUV(var26, var28, var32, var12, var16); ++ var9.addVertexWithUV(var26, var30, var32, var18, var22); ++ var9.addVertexWithUV(var26, var30, var34, var10, var14); ++ } ++ } ++ } ++ ++ /** ++ * Is called to render the image of a block on an inventory, as a held item, or as a an item on the ground ++ */ ++ public void renderBlockAsItem(Block par1Block, int par2, float par3) { + Tessellator var4 = Tessellator.instance; +- boolean var5 = var1.blockID == Block.grass.blockID; +- if(var1 == Block.dispenser || var1 == Block.dropper || var1 == Block.furnaceIdle) { +- var2 = 3; ++ boolean var5 = par1Block.blockID == Block.grass.blockID; ++ ++ if (par1Block == Block.dispenser || par1Block == Block.dropper || par1Block == Block.furnaceIdle) { ++ par2 = 3; + } + + int var6; + float var7; + float var8; + float var9; +- if(this.useInventoryTint) { +- var6 = var1.getRenderColor(var2); +- if(var5) { ++ ++ if (this.useInventoryTint) { ++ var6 = par1Block.getRenderColor(par2); ++ ++ if (var5) { + var6 = 16777215; + } + + var7 = (float)(var6 >> 16 & 255) / 255.0F; + var8 = (float)(var6 >> 8 & 255) / 255.0F; + var9 = (float)(var6 & 255) / 255.0F; +- GL11.glColor4f(var7 * var3, var8 * var3, var9 * var3, 1.0F); ++ GL11.glColor4f(var7 * par3, var8 * par3, var9 * par3, 1.0F); + } + +- var6 = var1.getRenderType(); +- this.setRenderBoundsFromBlock(var1); ++ var6 = par1Block.getRenderType(); ++ this.setRenderBoundsFromBlock(par1Block); + int var14; +- if(var6 != 0 && var6 != 31 && var6 != 39 && var6 != 16 && var6 != 26) { +- if(var6 == 1) { +- var4.startDrawingQuads(); +- var4.setNormal(0.0F, -1.0F, 0.0F); +- this.drawCrossedSquares(var1, var2, -0.5D, -0.5D, -0.5D, 1.0F); +- var4.draw(); +- } else if(var6 == 19) { +- var4.startDrawingQuads(); +- var4.setNormal(0.0F, -1.0F, 0.0F); +- var1.setBlockBoundsForItemRender(); +- this.renderBlockStemSmall(var1, var2, this.renderMaxY, -0.5D, -0.5D, -0.5D); +- var4.draw(); +- } else if(var6 == 23) { +- var4.startDrawingQuads(); +- var4.setNormal(0.0F, -1.0F, 0.0F); +- var1.setBlockBoundsForItemRender(); +- var4.draw(); +- } else if(var6 == 13) { +- var1.setBlockBoundsForItemRender(); ++ ++ if (var6 != 0 && var6 != 31 && var6 != 39 && var6 != 16 && var6 != 26) { ++ if (var6 == 1) { ++ var4.startDrawingQuads(); ++ var4.setNormal(0.0F, -1.0F, 0.0F); ++ this.drawCrossedSquares(par1Block, par2, -0.5D, -0.5D, -0.5D, 1.0F); ++ var4.draw(); ++ } else if (var6 == 19) { ++ var4.startDrawingQuads(); ++ var4.setNormal(0.0F, -1.0F, 0.0F); ++ par1Block.setBlockBoundsForItemRender(); ++ this.renderBlockStemSmall(par1Block, par2, this.renderMaxY, -0.5D, -0.5D, -0.5D); ++ var4.draw(); ++ } else if (var6 == 23) { ++ var4.startDrawingQuads(); ++ var4.setNormal(0.0F, -1.0F, 0.0F); ++ par1Block.setBlockBoundsForItemRender(); ++ var4.draw(); ++ } else if (var6 == 13) { ++ par1Block.setBlockBoundsForItemRender(); + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); +- var7 = 1.0F / 16.0F; ++ var7 = 0.0625F; + var4.startDrawingQuads(); + var4.setNormal(0.0F, -1.0F, 0.0F); +- this.renderFaceYNeg(var1, 0.0D, 0.0D, 0.0D, this.getBlockIconFromSide(var1, 0)); ++ CTMUtils.start(); ++ this.renderFaceYNeg(par1Block, 0.0D, 0.0D, 0.0D, CTMUtils.getTile(this, par1Block, 0, var4)); + var4.draw(); + var4.startDrawingQuads(); + var4.setNormal(0.0F, 1.0F, 0.0F); +- this.renderFaceYPos(var1, 0.0D, 0.0D, 0.0D, this.getBlockIconFromSide(var1, 1)); ++ CTMUtils.start(); ++ this.renderFaceYPos(par1Block, 0.0D, 0.0D, 0.0D, CTMUtils.getTile(this, par1Block, 1, var4)); + var4.draw(); + var4.startDrawingQuads(); + var4.setNormal(0.0F, 0.0F, -1.0F); + var4.addTranslation(0.0F, 0.0F, var7); +- this.renderFaceZNeg(var1, 0.0D, 0.0D, 0.0D, this.getBlockIconFromSide(var1, 2)); ++ CTMUtils.start(); ++ this.renderFaceZNeg(par1Block, 0.0D, 0.0D, 0.0D, CTMUtils.getTile(this, par1Block, 2, var4)); + var4.addTranslation(0.0F, 0.0F, -var7); + var4.draw(); + var4.startDrawingQuads(); + var4.setNormal(0.0F, 0.0F, 1.0F); + var4.addTranslation(0.0F, 0.0F, -var7); +- this.renderFaceZPos(var1, 0.0D, 0.0D, 0.0D, this.getBlockIconFromSide(var1, 3)); ++ CTMUtils.start(); ++ this.renderFaceZPos(par1Block, 0.0D, 0.0D, 0.0D, CTMUtils.getTile(this, par1Block, 3, var4)); + var4.addTranslation(0.0F, 0.0F, var7); + var4.draw(); + var4.startDrawingQuads(); + var4.setNormal(-1.0F, 0.0F, 0.0F); + var4.addTranslation(var7, 0.0F, 0.0F); +- this.renderFaceXNeg(var1, 0.0D, 0.0D, 0.0D, this.getBlockIconFromSide(var1, 4)); ++ CTMUtils.start(); ++ this.renderFaceXNeg(par1Block, 0.0D, 0.0D, 0.0D, CTMUtils.getTile(this, par1Block, 4, var4)); + var4.addTranslation(-var7, 0.0F, 0.0F); + var4.draw(); + var4.startDrawingQuads(); + var4.setNormal(1.0F, 0.0F, 0.0F); + var4.addTranslation(-var7, 0.0F, 0.0F); +- this.renderFaceXPos(var1, 0.0D, 0.0D, 0.0D, this.getBlockIconFromSide(var1, 5)); ++ CTMUtils.start(); ++ this.renderFaceXPos(par1Block, 0.0D, 0.0D, 0.0D, CTMUtils.getTile(this, par1Block, 5, var4)); + var4.addTranslation(var7, 0.0F, 0.0F); + var4.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); +- } else if(var6 == 22) { ++ } else if (var6 == 22) { + GL11.glRotatef(90.0F, 0.0F, 1.0F, 0.0F); + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); +- ChestItemRenderHelper.instance.renderChest(var1, var2, var3); ++ ChestItemRenderHelper.instance.renderChest(par1Block, par2, par3); + GL11.glEnable(GL12.GL_RESCALE_NORMAL); +- } else if(var6 == 6) { +- var4.startDrawingQuads(); +- var4.setNormal(0.0F, -1.0F, 0.0F); +- this.renderBlockCropsImpl(var1, var2, -0.5D, -0.5D, -0.5D); +- var4.draw(); +- } else if(var6 == 2) { +- var4.startDrawingQuads(); +- var4.setNormal(0.0F, -1.0F, 0.0F); +- this.renderTorchAtAngle(var1, -0.5D, -0.5D, -0.5D, 0.0D, 0.0D, 0); +- var4.draw(); +- } else if(var6 == 10) { +- for(var14 = 0; var14 < 2; ++var14) { +- if(var14 == 0) { ++ } else if (var6 == 6) { ++ var4.startDrawingQuads(); ++ var4.setNormal(0.0F, -1.0F, 0.0F); ++ this.renderBlockCropsImpl(par1Block, par2, -0.5D, -0.5D, -0.5D); ++ var4.draw(); ++ } else if (var6 == 2) { ++ var4.startDrawingQuads(); ++ var4.setNormal(0.0F, -1.0F, 0.0F); ++ this.renderTorchAtAngle(par1Block, -0.5D, -0.5D, -0.5D, 0.0D, 0.0D, 0); ++ var4.draw(); ++ } else if (var6 == 10) { ++ for (var14 = 0; var14 < 2; ++var14) { ++ if (var14 == 0) { + this.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 0.5D); + } + +- if(var14 == 1) { ++ if (var14 == 1) { + this.setRenderBounds(0.0D, 0.0D, 0.5D, 1.0D, 0.5D, 1.0D); + } + + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + var4.startDrawingQuads(); + var4.setNormal(0.0F, -1.0F, 0.0F); +- this.renderFaceYNeg(var1, 0.0D, 0.0D, 0.0D, this.getBlockIconFromSide(var1, 0)); ++ CTMUtils.start(); ++ this.renderFaceYNeg(par1Block, 0.0D, 0.0D, 0.0D, CTMUtils.getTile(this, par1Block, 0, var4)); + var4.draw(); + var4.startDrawingQuads(); + var4.setNormal(0.0F, 1.0F, 0.0F); +- this.renderFaceYPos(var1, 0.0D, 0.0D, 0.0D, this.getBlockIconFromSide(var1, 1)); ++ CTMUtils.start(); ++ this.renderFaceYPos(par1Block, 0.0D, 0.0D, 0.0D, CTMUtils.getTile(this, par1Block, 1, var4)); + var4.draw(); + var4.startDrawingQuads(); + var4.setNormal(0.0F, 0.0F, -1.0F); +- this.renderFaceZNeg(var1, 0.0D, 0.0D, 0.0D, this.getBlockIconFromSide(var1, 2)); ++ CTMUtils.start(); ++ this.renderFaceZNeg(par1Block, 0.0D, 0.0D, 0.0D, CTMUtils.getTile(this, par1Block, 2, var4)); + var4.draw(); + var4.startDrawingQuads(); + var4.setNormal(0.0F, 0.0F, 1.0F); +- this.renderFaceZPos(var1, 0.0D, 0.0D, 0.0D, this.getBlockIconFromSide(var1, 3)); ++ CTMUtils.start(); ++ this.renderFaceZPos(par1Block, 0.0D, 0.0D, 0.0D, CTMUtils.getTile(this, par1Block, 3, var4)); + var4.draw(); + var4.startDrawingQuads(); + var4.setNormal(-1.0F, 0.0F, 0.0F); +- this.renderFaceXNeg(var1, 0.0D, 0.0D, 0.0D, this.getBlockIconFromSide(var1, 4)); ++ CTMUtils.start(); ++ this.renderFaceXNeg(par1Block, 0.0D, 0.0D, 0.0D, CTMUtils.getTile(this, par1Block, 4, var4)); + var4.draw(); + var4.startDrawingQuads(); + var4.setNormal(1.0F, 0.0F, 0.0F); +- this.renderFaceXPos(var1, 0.0D, 0.0D, 0.0D, this.getBlockIconFromSide(var1, 5)); ++ CTMUtils.start(); ++ this.renderFaceXPos(par1Block, 0.0D, 0.0D, 0.0D, CTMUtils.getTile(this, par1Block, 5, var4)); + var4.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + } +- } else if(var6 == 27) { ++ } else if (var6 == 27) { + var14 = 0; + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + var4.startDrawingQuads(); + +- for(int var15 = 0; var15 < 8; ++var15) { ++ for (int var15 = 0; var15 < 8; ++var15) { + byte var16 = 0; + byte var17 = 1; +- if(var15 == 0) { ++ ++ if (var15 == 0) { + var16 = 2; + } + +- if(var15 == 1) { ++ if (var15 == 1) { + var16 = 3; + } + +- if(var15 == 2) { ++ if (var15 == 2) { + var16 = 4; + } + +- if(var15 == 3) { ++ if (var15 == 3) { + var16 = 5; + var17 = 2; + } + +- if(var15 == 4) { ++ if (var15 == 4) { + var16 = 6; + var17 = 3; + } + +- if(var15 == 5) { ++ if (var15 == 5) { + var16 = 7; + var17 = 5; + } + +- if(var15 == 6) { ++ if (var15 == 6) { + var16 = 6; + var17 = 2; + } + +- if(var15 == 7) { ++ if (var15 == 7) { + var16 = 3; + } + +@@ -6293,166 +7160,194 @@ + var14 += var17; + this.setRenderBounds((double)(0.5F - var11), (double)var13, (double)(0.5F - var11), (double)(0.5F + var11), (double)var12, (double)(0.5F + var11)); + var4.setNormal(0.0F, -1.0F, 0.0F); +- this.renderFaceYNeg(var1, 0.0D, 0.0D, 0.0D, this.getBlockIconFromSide(var1, 0)); ++ CTMUtils.start(); ++ this.renderFaceYNeg(par1Block, 0.0D, 0.0D, 0.0D, CTMUtils.getTile(this, par1Block, 0, var4)); + var4.setNormal(0.0F, 1.0F, 0.0F); +- this.renderFaceYPos(var1, 0.0D, 0.0D, 0.0D, this.getBlockIconFromSide(var1, 1)); ++ CTMUtils.start(); ++ this.renderFaceYPos(par1Block, 0.0D, 0.0D, 0.0D, CTMUtils.getTile(this, par1Block, 1, var4)); + var4.setNormal(0.0F, 0.0F, -1.0F); +- this.renderFaceZNeg(var1, 0.0D, 0.0D, 0.0D, this.getBlockIconFromSide(var1, 2)); ++ CTMUtils.start(); ++ this.renderFaceZNeg(par1Block, 0.0D, 0.0D, 0.0D, CTMUtils.getTile(this, par1Block, 2, var4)); + var4.setNormal(0.0F, 0.0F, 1.0F); +- this.renderFaceZPos(var1, 0.0D, 0.0D, 0.0D, this.getBlockIconFromSide(var1, 3)); ++ CTMUtils.start(); ++ this.renderFaceZPos(par1Block, 0.0D, 0.0D, 0.0D, CTMUtils.getTile(this, par1Block, 3, var4)); + var4.setNormal(-1.0F, 0.0F, 0.0F); +- this.renderFaceXNeg(var1, 0.0D, 0.0D, 0.0D, this.getBlockIconFromSide(var1, 4)); ++ CTMUtils.start(); ++ this.renderFaceXNeg(par1Block, 0.0D, 0.0D, 0.0D, CTMUtils.getTile(this, par1Block, 4, var4)); + var4.setNormal(1.0F, 0.0F, 0.0F); +- this.renderFaceXPos(var1, 0.0D, 0.0D, 0.0D, this.getBlockIconFromSide(var1, 5)); ++ CTMUtils.start(); ++ this.renderFaceXPos(par1Block, 0.0D, 0.0D, 0.0D, CTMUtils.getTile(this, par1Block, 5, var4)); + } + + var4.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + this.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 1.0D); +- } else if(var6 == 11) { +- for(var14 = 0; var14 < 4; ++var14) { +- var8 = 2.0F / 16.0F; +- if(var14 == 0) { ++ } else if (var6 == 11) { ++ for (var14 = 0; var14 < 4; ++var14) { ++ var8 = 0.125F; ++ ++ if (var14 == 0) { + this.setRenderBounds((double)(0.5F - var8), 0.0D, 0.0D, (double)(0.5F + var8), 1.0D, (double)(var8 * 2.0F)); + } + +- if(var14 == 1) { ++ if (var14 == 1) { + this.setRenderBounds((double)(0.5F - var8), 0.0D, (double)(1.0F - var8 * 2.0F), (double)(0.5F + var8), 1.0D, 1.0D); + } + +- var8 = 1.0F / 16.0F; +- if(var14 == 2) { ++ var8 = 0.0625F; ++ ++ if (var14 == 2) { + this.setRenderBounds((double)(0.5F - var8), (double)(1.0F - var8 * 3.0F), (double)(-var8 * 2.0F), (double)(0.5F + var8), (double)(1.0F - var8), (double)(1.0F + var8 * 2.0F)); + } + +- if(var14 == 3) { ++ if (var14 == 3) { + this.setRenderBounds((double)(0.5F - var8), (double)(0.5F - var8 * 3.0F), (double)(-var8 * 2.0F), (double)(0.5F + var8), (double)(0.5F - var8), (double)(1.0F + var8 * 2.0F)); + } + + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + var4.startDrawingQuads(); + var4.setNormal(0.0F, -1.0F, 0.0F); +- this.renderFaceYNeg(var1, 0.0D, 0.0D, 0.0D, this.getBlockIconFromSide(var1, 0)); ++ CTMUtils.start(); ++ this.renderFaceYNeg(par1Block, 0.0D, 0.0D, 0.0D, CTMUtils.getTile(this, par1Block, 0, var4)); + var4.draw(); + var4.startDrawingQuads(); + var4.setNormal(0.0F, 1.0F, 0.0F); +- this.renderFaceYPos(var1, 0.0D, 0.0D, 0.0D, this.getBlockIconFromSide(var1, 1)); ++ CTMUtils.start(); ++ this.renderFaceYPos(par1Block, 0.0D, 0.0D, 0.0D, CTMUtils.getTile(this, par1Block, 1, var4)); + var4.draw(); + var4.startDrawingQuads(); + var4.setNormal(0.0F, 0.0F, -1.0F); +- this.renderFaceZNeg(var1, 0.0D, 0.0D, 0.0D, this.getBlockIconFromSide(var1, 2)); ++ CTMUtils.start(); ++ this.renderFaceZNeg(par1Block, 0.0D, 0.0D, 0.0D, CTMUtils.getTile(this, par1Block, 2, var4)); + var4.draw(); + var4.startDrawingQuads(); + var4.setNormal(0.0F, 0.0F, 1.0F); +- this.renderFaceZPos(var1, 0.0D, 0.0D, 0.0D, this.getBlockIconFromSide(var1, 3)); ++ CTMUtils.start(); ++ this.renderFaceZPos(par1Block, 0.0D, 0.0D, 0.0D, CTMUtils.getTile(this, par1Block, 3, var4)); + var4.draw(); + var4.startDrawingQuads(); + var4.setNormal(-1.0F, 0.0F, 0.0F); +- this.renderFaceXNeg(var1, 0.0D, 0.0D, 0.0D, this.getBlockIconFromSide(var1, 4)); ++ CTMUtils.start(); ++ this.renderFaceXNeg(par1Block, 0.0D, 0.0D, 0.0D, CTMUtils.getTile(this, par1Block, 4, var4)); + var4.draw(); + var4.startDrawingQuads(); + var4.setNormal(1.0F, 0.0F, 0.0F); +- this.renderFaceXPos(var1, 0.0D, 0.0D, 0.0D, this.getBlockIconFromSide(var1, 5)); ++ CTMUtils.start(); ++ this.renderFaceXPos(par1Block, 0.0D, 0.0D, 0.0D, CTMUtils.getTile(this, par1Block, 5, var4)); + var4.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + } + + this.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 1.0D); +- } else if(var6 == 21) { +- for(var14 = 0; var14 < 3; ++var14) { +- var8 = 1.0F / 16.0F; +- if(var14 == 0) { +- this.setRenderBounds((double)(0.5F - var8), (double)0.3F, 0.0D, (double)(0.5F + var8), 1.0D, (double)(var8 * 2.0F)); +- } +- +- if(var14 == 1) { +- this.setRenderBounds((double)(0.5F - var8), (double)0.3F, (double)(1.0F - var8 * 2.0F), (double)(0.5F + var8), 1.0D, 1.0D); +- } +- +- var8 = 1.0F / 16.0F; +- if(var14 == 2) { ++ } else if (var6 == 21) { ++ for (var14 = 0; var14 < 3; ++var14) { ++ var8 = 0.0625F; ++ ++ if (var14 == 0) { ++ this.setRenderBounds((double)(0.5F - var8), 0.30000001192092896D, 0.0D, (double)(0.5F + var8), 1.0D, (double)(var8 * 2.0F)); ++ } ++ ++ if (var14 == 1) { ++ this.setRenderBounds((double)(0.5F - var8), 0.30000001192092896D, (double)(1.0F - var8 * 2.0F), (double)(0.5F + var8), 1.0D, 1.0D); ++ } ++ ++ var8 = 0.0625F; ++ ++ if (var14 == 2) { + this.setRenderBounds((double)(0.5F - var8), 0.5D, 0.0D, (double)(0.5F + var8), (double)(1.0F - var8), 1.0D); + } + + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + var4.startDrawingQuads(); + var4.setNormal(0.0F, -1.0F, 0.0F); +- this.renderFaceYNeg(var1, 0.0D, 0.0D, 0.0D, this.getBlockIconFromSide(var1, 0)); ++ CTMUtils.start(); ++ this.renderFaceYNeg(par1Block, 0.0D, 0.0D, 0.0D, CTMUtils.getTile(this, par1Block, 0, var4)); + var4.draw(); + var4.startDrawingQuads(); + var4.setNormal(0.0F, 1.0F, 0.0F); +- this.renderFaceYPos(var1, 0.0D, 0.0D, 0.0D, this.getBlockIconFromSide(var1, 1)); ++ CTMUtils.start(); ++ this.renderFaceYPos(par1Block, 0.0D, 0.0D, 0.0D, CTMUtils.getTile(this, par1Block, 1, var4)); + var4.draw(); + var4.startDrawingQuads(); + var4.setNormal(0.0F, 0.0F, -1.0F); +- this.renderFaceZNeg(var1, 0.0D, 0.0D, 0.0D, this.getBlockIconFromSide(var1, 2)); ++ CTMUtils.start(); ++ this.renderFaceZNeg(par1Block, 0.0D, 0.0D, 0.0D, CTMUtils.getTile(this, par1Block, 2, var4)); + var4.draw(); + var4.startDrawingQuads(); + var4.setNormal(0.0F, 0.0F, 1.0F); +- this.renderFaceZPos(var1, 0.0D, 0.0D, 0.0D, this.getBlockIconFromSide(var1, 3)); ++ CTMUtils.start(); ++ this.renderFaceZPos(par1Block, 0.0D, 0.0D, 0.0D, CTMUtils.getTile(this, par1Block, 3, var4)); + var4.draw(); + var4.startDrawingQuads(); + var4.setNormal(-1.0F, 0.0F, 0.0F); +- this.renderFaceXNeg(var1, 0.0D, 0.0D, 0.0D, this.getBlockIconFromSide(var1, 4)); ++ CTMUtils.start(); ++ this.renderFaceXNeg(par1Block, 0.0D, 0.0D, 0.0D, CTMUtils.getTile(this, par1Block, 4, var4)); + var4.draw(); + var4.startDrawingQuads(); + var4.setNormal(1.0F, 0.0F, 0.0F); +- this.renderFaceXPos(var1, 0.0D, 0.0D, 0.0D, this.getBlockIconFromSide(var1, 5)); ++ CTMUtils.start(); ++ this.renderFaceXPos(par1Block, 0.0D, 0.0D, 0.0D, CTMUtils.getTile(this, par1Block, 5, var4)); + var4.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + } +- } else if(var6 == 32) { +- for(var14 = 0; var14 < 2; ++var14) { +- if(var14 == 0) { ++ } else if (var6 == 32) { ++ for (var14 = 0; var14 < 2; ++var14) { ++ if (var14 == 0) { + this.setRenderBounds(0.0D, 0.0D, 0.3125D, 1.0D, 0.8125D, 0.6875D); + } + +- if(var14 == 1) { ++ if (var14 == 1) { + this.setRenderBounds(0.25D, 0.0D, 0.25D, 0.75D, 1.0D, 0.75D); + } + + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + var4.startDrawingQuads(); + var4.setNormal(0.0F, -1.0F, 0.0F); +- this.renderFaceYNeg(var1, 0.0D, 0.0D, 0.0D, this.getBlockIconFromSideAndMetadata(var1, 0, var2)); ++ CTMUtils.start(); ++ this.renderFaceYNeg(par1Block, 0.0D, 0.0D, 0.0D, CTMUtils.getTile(this, par1Block, 0, par2, var4)); + var4.draw(); + var4.startDrawingQuads(); + var4.setNormal(0.0F, 1.0F, 0.0F); +- this.renderFaceYPos(var1, 0.0D, 0.0D, 0.0D, this.getBlockIconFromSideAndMetadata(var1, 1, var2)); ++ CTMUtils.start(); ++ this.renderFaceYPos(par1Block, 0.0D, 0.0D, 0.0D, CTMUtils.getTile(this, par1Block, 1, par2, var4)); + var4.draw(); + var4.startDrawingQuads(); + var4.setNormal(0.0F, 0.0F, -1.0F); +- this.renderFaceZNeg(var1, 0.0D, 0.0D, 0.0D, this.getBlockIconFromSideAndMetadata(var1, 2, var2)); ++ CTMUtils.start(); ++ this.renderFaceZNeg(par1Block, 0.0D, 0.0D, 0.0D, CTMUtils.getTile(this, par1Block, 2, par2, var4)); + var4.draw(); + var4.startDrawingQuads(); + var4.setNormal(0.0F, 0.0F, 1.0F); +- this.renderFaceZPos(var1, 0.0D, 0.0D, 0.0D, this.getBlockIconFromSideAndMetadata(var1, 3, var2)); ++ CTMUtils.start(); ++ this.renderFaceZPos(par1Block, 0.0D, 0.0D, 0.0D, CTMUtils.getTile(this, par1Block, 3, par2, var4)); + var4.draw(); + var4.startDrawingQuads(); + var4.setNormal(-1.0F, 0.0F, 0.0F); +- this.renderFaceXNeg(var1, 0.0D, 0.0D, 0.0D, this.getBlockIconFromSideAndMetadata(var1, 4, var2)); ++ CTMUtils.start(); ++ this.renderFaceXNeg(par1Block, 0.0D, 0.0D, 0.0D, CTMUtils.getTile(this, par1Block, 4, par2, var4)); + var4.draw(); + var4.startDrawingQuads(); + var4.setNormal(1.0F, 0.0F, 0.0F); +- this.renderFaceXPos(var1, 0.0D, 0.0D, 0.0D, this.getBlockIconFromSideAndMetadata(var1, 5, var2)); ++ CTMUtils.start(); ++ this.renderFaceXPos(par1Block, 0.0D, 0.0D, 0.0D, CTMUtils.getTile(this, par1Block, 5, par2, var4)); + var4.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + } + + this.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 1.0D); +- } else if(var6 == 35) { ++ } else if (var6 == 35) { + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); +- this.renderBlockAnvilOrient((BlockAnvil)var1, 0, 0, 0, var2 << 2, true); ++ this.renderBlockAnvilOrient((BlockAnvil)par1Block, 0, 0, 0, par2 << 2, true); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); +- } else if(var6 == 34) { +- for(var14 = 0; var14 < 3; ++var14) { +- if(var14 == 0) { ++ } else if (var6 == 34) { ++ for (var14 = 0; var14 < 3; ++var14) { ++ if (var14 == 0) { + this.setRenderBounds(0.125D, 0.0D, 0.125D, 0.875D, 0.1875D, 0.875D); + this.setOverrideBlockTexture(this.getBlockIcon(Block.obsidian)); +- } else if(var14 == 1) { ++ } else if (var14 == 1) { + this.setRenderBounds(0.1875D, 0.1875D, 0.1875D, 0.8125D, 0.875D, 0.8125D); + this.setOverrideBlockTexture(this.getBlockIcon(Block.beacon)); +- } else if(var14 == 2) { ++ } else if (var14 == 2) { + this.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 1.0D); + this.setOverrideBlockTexture(this.getBlockIcon(Block.glass)); + } +@@ -6460,113 +7355,131 @@ + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + var4.startDrawingQuads(); + var4.setNormal(0.0F, -1.0F, 0.0F); +- this.renderFaceYNeg(var1, 0.0D, 0.0D, 0.0D, this.getBlockIconFromSideAndMetadata(var1, 0, var2)); ++ CTMUtils.start(); ++ this.renderFaceYNeg(par1Block, 0.0D, 0.0D, 0.0D, CTMUtils.getTile(this, par1Block, 0, par2, var4)); + var4.draw(); + var4.startDrawingQuads(); + var4.setNormal(0.0F, 1.0F, 0.0F); +- this.renderFaceYPos(var1, 0.0D, 0.0D, 0.0D, this.getBlockIconFromSideAndMetadata(var1, 1, var2)); ++ CTMUtils.start(); ++ this.renderFaceYPos(par1Block, 0.0D, 0.0D, 0.0D, CTMUtils.getTile(this, par1Block, 1, par2, var4)); + var4.draw(); + var4.startDrawingQuads(); + var4.setNormal(0.0F, 0.0F, -1.0F); +- this.renderFaceZNeg(var1, 0.0D, 0.0D, 0.0D, this.getBlockIconFromSideAndMetadata(var1, 2, var2)); ++ CTMUtils.start(); ++ this.renderFaceZNeg(par1Block, 0.0D, 0.0D, 0.0D, CTMUtils.getTile(this, par1Block, 2, par2, var4)); + var4.draw(); + var4.startDrawingQuads(); + var4.setNormal(0.0F, 0.0F, 1.0F); +- this.renderFaceZPos(var1, 0.0D, 0.0D, 0.0D, this.getBlockIconFromSideAndMetadata(var1, 3, var2)); ++ CTMUtils.start(); ++ this.renderFaceZPos(par1Block, 0.0D, 0.0D, 0.0D, CTMUtils.getTile(this, par1Block, 3, par2, var4)); + var4.draw(); + var4.startDrawingQuads(); + var4.setNormal(-1.0F, 0.0F, 0.0F); +- this.renderFaceXNeg(var1, 0.0D, 0.0D, 0.0D, this.getBlockIconFromSideAndMetadata(var1, 4, var2)); ++ CTMUtils.start(); ++ this.renderFaceXNeg(par1Block, 0.0D, 0.0D, 0.0D, CTMUtils.getTile(this, par1Block, 4, par2, var4)); + var4.draw(); + var4.startDrawingQuads(); + var4.setNormal(1.0F, 0.0F, 0.0F); +- this.renderFaceXPos(var1, 0.0D, 0.0D, 0.0D, this.getBlockIconFromSideAndMetadata(var1, 5, var2)); ++ CTMUtils.start(); ++ this.renderFaceXPos(par1Block, 0.0D, 0.0D, 0.0D, CTMUtils.getTile(this, par1Block, 5, par2, var4)); + var4.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + } + + this.setRenderBounds(0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 1.0D); + this.clearOverrideBlockTexture(); +- } else if(var6 == 38) { ++ } else if (var6 == 38) { + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); +- this.renderBlockHopperMetadata((BlockHopper)var1, 0, 0, 0, 0, true); ++ this.renderBlockHopperMetadata((BlockHopper)par1Block, 0, 0, 0, 0, true); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + } + } else { +- if(var6 == 16) { +- var2 = 1; ++ if (var6 == 16) { ++ par2 = 1; + } + +- var1.setBlockBoundsForItemRender(); +- this.setRenderBoundsFromBlock(var1); ++ par1Block.setBlockBoundsForItemRender(); ++ this.setRenderBoundsFromBlock(par1Block); + GL11.glRotatef(90.0F, 0.0F, 1.0F, 0.0F); + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + var4.startDrawingQuads(); + var4.setNormal(0.0F, -1.0F, 0.0F); +- this.renderFaceYNeg(var1, 0.0D, 0.0D, 0.0D, this.getBlockIconFromSideAndMetadata(var1, 0, var2)); ++ CTMUtils.start(); ++ this.renderFaceYNeg(par1Block, 0.0D, 0.0D, 0.0D, CTMUtils.getTile(this, par1Block, 0, par2, var4)); + var4.draw(); +- if(var5 && this.useInventoryTint) { +- var14 = var1.getRenderColor(var2); ++ ++ if (var5 && this.useInventoryTint) { ++ var14 = par1Block.getRenderColor(par2); + var8 = (float)(var14 >> 16 & 255) / 255.0F; + var9 = (float)(var14 >> 8 & 255) / 255.0F; + float var10 = (float)(var14 & 255) / 255.0F; +- GL11.glColor4f(var8 * var3, var9 * var3, var10 * var3, 1.0F); ++ GL11.glColor4f(var8 * par3, var9 * par3, var10 * par3, 1.0F); + } + + var4.startDrawingQuads(); + var4.setNormal(0.0F, 1.0F, 0.0F); +- this.renderFaceYPos(var1, 0.0D, 0.0D, 0.0D, this.getBlockIconFromSideAndMetadata(var1, 1, var2)); ++ CTMUtils.start(); ++ this.renderFaceYPos(par1Block, 0.0D, 0.0D, 0.0D, CTMUtils.getTile(this, par1Block, 1, par2, var4)); + var4.draw(); +- if(var5 && this.useInventoryTint) { +- GL11.glColor4f(var3, var3, var3, 1.0F); ++ ++ if (var5 && this.useInventoryTint) { ++ GL11.glColor4f(par3, par3, par3, 1.0F); + } + + var4.startDrawingQuads(); + var4.setNormal(0.0F, 0.0F, -1.0F); +- this.renderFaceZNeg(var1, 0.0D, 0.0D, 0.0D, this.getBlockIconFromSideAndMetadata(var1, 2, var2)); ++ CTMUtils.start(); ++ this.renderFaceZNeg(par1Block, 0.0D, 0.0D, 0.0D, CTMUtils.getTile(this, par1Block, 2, par2, var4)); + var4.draw(); + var4.startDrawingQuads(); + var4.setNormal(0.0F, 0.0F, 1.0F); +- this.renderFaceZPos(var1, 0.0D, 0.0D, 0.0D, this.getBlockIconFromSideAndMetadata(var1, 3, var2)); ++ CTMUtils.start(); ++ this.renderFaceZPos(par1Block, 0.0D, 0.0D, 0.0D, CTMUtils.getTile(this, par1Block, 3, par2, var4)); + var4.draw(); + var4.startDrawingQuads(); + var4.setNormal(-1.0F, 0.0F, 0.0F); +- this.renderFaceXNeg(var1, 0.0D, 0.0D, 0.0D, this.getBlockIconFromSideAndMetadata(var1, 4, var2)); ++ CTMUtils.start(); ++ this.renderFaceXNeg(par1Block, 0.0D, 0.0D, 0.0D, CTMUtils.getTile(this, par1Block, 4, par2, var4)); + var4.draw(); + var4.startDrawingQuads(); + var4.setNormal(1.0F, 0.0F, 0.0F); +- this.renderFaceXPos(var1, 0.0D, 0.0D, 0.0D, this.getBlockIconFromSideAndMetadata(var1, 5, var2)); ++ CTMUtils.start(); ++ this.renderFaceXPos(par1Block, 0.0D, 0.0D, 0.0D, CTMUtils.getTile(this, par1Block, 5, par2, var4)); + var4.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + } + +- } +- +- public static boolean renderItemIn3d(int var0) { +- return var0 == 0 ? true : (var0 == 31 ? true : (var0 == 39 ? true : (var0 == 13 ? true : (var0 == 10 ? true : (var0 == 11 ? true : (var0 == 27 ? true : (var0 == 22 ? true : (var0 == 21 ? true : (var0 == 16 ? true : (var0 == 26 ? true : (var0 == 32 ? true : (var0 == 34 ? true : var0 == 35)))))))))))); +- } +- +- public Icon getBlockIcon(Block var1, IBlockAccess var2, int var3, int var4, int var5, int var6) { +- return this.getIconSafe(var1.getBlockTexture(var2, var3, var4, var5, var6)); +- } +- +- public Icon getBlockIconFromSideAndMetadata(Block var1, int var2, int var3) { +- return this.getIconSafe(var1.getIcon(var2, var3)); +- } +- +- public Icon getBlockIconFromSide(Block var1, int var2) { +- return this.getIconSafe(var1.getBlockTextureFromSide(var2)); +- } +- +- public Icon getBlockIcon(Block var1) { +- return this.getIconSafe(var1.getBlockTextureFromSide(1)); +- } +- +- public Icon getIconSafe(Icon var1) { +- if(var1 == null) { +- var1 = ((TextureMap)Minecraft.getMinecraft().getTextureManager().getTexture(TextureMap.locationBlocksTexture)).getAtlasSprite("missingno"); ++ CTMUtils.finish(); ++ } ++ ++ /** ++ * Checks to see if the item's render type indicates that it should be rendered as a regular block or not. ++ */ ++ public static boolean renderItemIn3d(int par0) { ++ return par0 == 0 ? true : (par0 == 31 ? true : (par0 == 39 ? true : (par0 == 13 ? true : (par0 == 10 ? true : (par0 == 11 ? true : (par0 == 27 ? true : (par0 == 22 ? true : (par0 == 21 ? true : (par0 == 16 ? true : (par0 == 26 ? true : (par0 == 32 ? true : (par0 == 34 ? true : par0 == 35)))))))))))); ++ } ++ ++ public Icon getBlockIcon(Block par1Block, IBlockAccess par2IBlockAccess, int par3, int par4, int par5, int par6) { ++ return this.getIconSafe(par1Block.getBlockTexture(par2IBlockAccess, par3, par4, par5, par6)); ++ } ++ ++ public Icon getBlockIconFromSideAndMetadata(Block par1Block, int par2, int par3) { ++ return this.getIconSafe(par1Block.getIcon(par2, par3)); ++ } ++ ++ public Icon getBlockIconFromSide(Block par1Block, int par2) { ++ return this.getIconSafe(par1Block.getBlockTextureFromSide(par2)); ++ } ++ ++ public Icon getBlockIcon(Block par1Block) { ++ return this.getIconSafe(par1Block.getBlockTextureFromSide(1)); ++ } ++ ++ public Icon getIconSafe(Icon par1Icon) { ++ if (par1Icon == null) { ++ par1Icon = ((TextureMap)Minecraft.getMinecraft().getTextureManager().getTexture(TextureMap.locationBlocksTexture)).getAtlasSprite("missingno"); + } + +- return (Icon)var1; ++ return (Icon)par1Icon; + } + } diff --git a/patches/net/minecraft/src/RenderBoat.java.patch b/patches/net/minecraft/src/RenderBoat.java.patch new file mode 100644 index 0000000..f549659 --- /dev/null +++ b/patches/net/minecraft/src/RenderBoat.java.patch @@ -0,0 +1,79 @@ +--- net/minecraft/src/RenderBoat.java ++++ net/minecraft/src/RenderBoat.java +@@ -4,6 +4,8 @@ + + public class RenderBoat extends Render { + private static final ResourceLocation boatTextures = new ResourceLocation("textures/entity/boat.png"); ++ ++ /** instance of ModelBoat for rendering */ + protected ModelBase modelBoat; + + public RenderBoat() { +@@ -11,38 +13,51 @@ + this.modelBoat = new ModelBoat(); + } + +- public void renderBoat(EntityBoat var1, double var2, double var4, double var6, float var8, float var9) { ++ /** ++ * The render method used in RenderBoat that renders the boat model. ++ */ ++ public void renderBoat(EntityBoat par1EntityBoat, double par2, double par4, double par6, float par8, float par9) { + GL11.glPushMatrix(); +- GL11.glTranslatef((float)var2, (float)var4, (float)var6); +- GL11.glRotatef(180.0F - var8, 0.0F, 1.0F, 0.0F); +- float var10 = (float)var1.getTimeSinceHit() - var9; +- float var11 = var1.getDamageTaken() - var9; +- if(var11 < 0.0F) { ++ GL11.glTranslatef((float)par2, (float)par4, (float)par6); ++ GL11.glRotatef(180.0F - par8, 0.0F, 1.0F, 0.0F); ++ float var10 = (float)par1EntityBoat.getTimeSinceHit() - par9; ++ float var11 = par1EntityBoat.getDamageTaken() - par9; ++ ++ if (var11 < 0.0F) { + var11 = 0.0F; + } + +- if(var10 > 0.0F) { +- GL11.glRotatef(MathHelper.sin(var10) * var10 * var11 / 10.0F * (float)var1.getForwardDirection(), 1.0F, 0.0F, 0.0F); ++ if (var10 > 0.0F) { ++ GL11.glRotatef(MathHelper.sin(var10) * var10 * var11 / 10.0F * (float)par1EntityBoat.getForwardDirection(), 1.0F, 0.0F, 0.0F); + } + +- float var12 = 12.0F / 16.0F; ++ float var12 = 0.75F; + GL11.glScalef(var12, var12, var12); + GL11.glScalef(1.0F / var12, 1.0F / var12, 1.0F / var12); +- this.bindEntityTexture(var1); ++ this.bindEntityTexture(par1EntityBoat); + GL11.glScalef(-1.0F, -1.0F, 1.0F); +- this.modelBoat.render(var1, 0.0F, 0.0F, -0.1F, 0.0F, 0.0F, 1.0F / 16.0F); ++ this.modelBoat.render(par1EntityBoat, 0.0F, 0.0F, -0.1F, 0.0F, 0.0F, 0.0625F); + GL11.glPopMatrix(); + } + +- protected ResourceLocation getBoatTextures(EntityBoat var1) { ++ protected ResourceLocation getBoatTextures(EntityBoat par1EntityBoat) { + return boatTextures; + } + +- protected ResourceLocation getEntityTexture(Entity var1) { +- return this.getBoatTextures((EntityBoat)var1); ++ /** ++ * Returns the location of an entity's texture. Doesn't seem to be called unless you call Render.bindEntityTexture. ++ */ ++ protected ResourceLocation getEntityTexture(Entity par1Entity) { ++ return this.getBoatTextures((EntityBoat)par1Entity); + } + +- public void doRender(Entity var1, double var2, double var4, double var6, float var8, float var9) { +- this.renderBoat((EntityBoat)var1, var2, var4, var6, var8, var9); ++ /** ++ * Actually renders the given argument. This is a synthetic bridge method, always casting down its argument and then ++ * handing it off to a worker function which does the actual work. In all probabilty, the class Render is generic ++ * (Render 1.0F) { ++ if (var3 > 1.0F) { + var3 = 1.0F; + } + +@@ -29,17 +35,22 @@ + GL11.glScalef(var5, var6, var5); + } + +- protected int updateCreeperColorMultiplier(EntityCreeper var1, float var2, float var3) { +- float var4 = var1.getCreeperFlashIntensity(var3); +- if((int)(var4 * 10.0F) % 2 == 0) { ++ /** ++ * Updates color multiplier based on creeper state called by getColorMultiplier ++ */ ++ protected int updateCreeperColorMultiplier(EntityCreeper par1EntityCreeper, float par2, float par3) { ++ float var4 = par1EntityCreeper.getCreeperFlashIntensity(par3); ++ ++ if ((int)(var4 * 10.0F) % 2 == 0) { + return 0; + } else { + int var5 = (int)(var4 * 0.2F * 255.0F); +- if(var5 < 0) { ++ ++ if (var5 < 0) { + var5 = 0; + } + +- if(var5 > 255) { ++ if (var5 > 255) { + var5 = 255; + } + +@@ -50,16 +61,19 @@ + } + } + +- protected int renderCreeperPassModel(EntityCreeper var1, int var2, float var3) { +- if(var1.getPowered()) { +- if(var1.isInvisible()) { ++ /** ++ * A method used to render a creeper's powered form as a pass model. ++ */ ++ protected int renderCreeperPassModel(EntityCreeper par1EntityCreeper, int par2, float par3) { ++ if (par1EntityCreeper.getPowered()) { ++ if (par1EntityCreeper.isInvisible()) { + GL11.glDepthMask(false); + } else { + GL11.glDepthMask(true); + } + +- if(var2 == 1) { +- float var4 = (float)var1.ticksExisted + var3; ++ if (par2 == 1) { ++ float var4 = (float)par1EntityCreeper.ticksExisted + par3; + this.bindTexture(armoredCreeperTextures); + GL11.glMatrixMode(GL11.GL_TEXTURE); + GL11.glLoadIdentity(); +@@ -76,7 +90,7 @@ + return 1; + } + +- if(var2 == 2) { ++ if (par2 == 2) { + GL11.glMatrixMode(GL11.GL_TEXTURE); + GL11.glLoadIdentity(); + GL11.glMatrixMode(GL11.GL_MODELVIEW); +@@ -88,31 +102,44 @@ + return -1; + } + +- protected int func_77061_b(EntityCreeper var1, int var2, float var3) { ++ protected int func_77061_b(EntityCreeper par1EntityCreeper, int par2, float par3) { + return -1; + } + +- protected ResourceLocation getCreeperTextures(EntityCreeper var1) { ++ protected ResourceLocation getCreeperTextures(EntityCreeper par1EntityCreeper) { + return creeperTextures; + } + +- protected void preRenderCallback(EntityLivingBase var1, float var2) { +- this.updateCreeperScale((EntityCreeper)var1, var2); +- } +- +- protected int getColorMultiplier(EntityLivingBase var1, float var2, float var3) { +- return this.updateCreeperColorMultiplier((EntityCreeper)var1, var2, var3); +- } +- +- protected int shouldRenderPass(EntityLivingBase var1, int var2, float var3) { +- return this.renderCreeperPassModel((EntityCreeper)var1, var2, var3); +- } +- +- protected int inheritRenderPass(EntityLivingBase var1, int var2, float var3) { +- return this.func_77061_b((EntityCreeper)var1, var2, var3); +- } +- +- protected ResourceLocation getEntityTexture(Entity var1) { +- return this.getCreeperTextures((EntityCreeper)var1); ++ /** ++ * Allows the render to do any OpenGL state modifications necessary before the model is rendered. Args: entityLiving, ++ * partialTickTime ++ */ ++ protected void preRenderCallback(EntityLivingBase par1EntityLivingBase, float par2) { ++ this.updateCreeperScale((EntityCreeper)par1EntityLivingBase, par2); ++ } ++ ++ /** ++ * Returns an ARGB int color back. Args: entityLiving, lightBrightness, partialTickTime ++ */ ++ protected int getColorMultiplier(EntityLivingBase par1EntityLivingBase, float par2, float par3) { ++ return this.updateCreeperColorMultiplier((EntityCreeper)par1EntityLivingBase, par2, par3); ++ } ++ ++ /** ++ * Queries whether should render the specified pass or not. ++ */ ++ protected int shouldRenderPass(EntityLivingBase par1EntityLivingBase, int par2, float par3) { ++ return this.renderCreeperPassModel((EntityCreeper)par1EntityLivingBase, par2, par3); ++ } ++ ++ protected int inheritRenderPass(EntityLivingBase par1EntityLivingBase, int par2, float par3) { ++ return this.func_77061_b((EntityCreeper)par1EntityLivingBase, par2, par3); ++ } ++ ++ /** ++ * Returns the location of an entity's texture. Doesn't seem to be called unless you call Render.bindEntityTexture. ++ */ ++ protected ResourceLocation getEntityTexture(Entity par1Entity) { ++ return this.getCreeperTextures((EntityCreeper)par1Entity); + } + } diff --git a/patches/net/minecraft/src/RenderDragon.java.patch b/patches/net/minecraft/src/RenderDragon.java.patch new file mode 100644 index 0000000..e9a49cc --- /dev/null +++ b/patches/net/minecraft/src/RenderDragon.java.patch @@ -0,0 +1,291 @@ +--- net/minecraft/src/RenderDragon.java ++++ net/minecraft/src/RenderDragon.java +@@ -8,73 +8,87 @@ + private static final ResourceLocation enderDragonCrystalBeamTextures = new ResourceLocation("textures/entity/endercrystal/endercrystal_beam.png"); + private static final ResourceLocation enderDragonEyesTextures = new ResourceLocation("textures/entity/enderdragon/dragon_eyes.png"); + private static final ResourceLocation enderDragonTextures = new ResourceLocation("textures/entity/enderdragon/dragon.png"); +- protected ModelDragon modelDragon = (ModelDragon)this.mainModel; ++ ++ /** An instance of the dragon model in RenderDragon */ ++ protected ModelDragon modelDragon; + + public RenderDragon() { + super(new ModelDragon(0.0F), 0.5F); ++ this.modelDragon = (ModelDragon)this.mainModel; + this.setRenderPassModel(this.mainModel); + } + +- protected void rotateDragonBody(EntityDragon var1, float var2, float var3, float var4) { +- float var5 = (float)var1.getMovementOffsets(7, var4)[0]; +- float var6 = (float)(var1.getMovementOffsets(5, var4)[1] - var1.getMovementOffsets(10, var4)[1]); ++ /** ++ * Used to rotate the dragon as a whole in RenderDragon. It's called in the rotateCorpse method. ++ */ ++ protected void rotateDragonBody(EntityDragon par1EntityDragon, float par2, float par3, float par4) { ++ float var5 = (float)par1EntityDragon.getMovementOffsets(7, par4)[0]; ++ float var6 = (float)(par1EntityDragon.getMovementOffsets(5, par4)[1] - par1EntityDragon.getMovementOffsets(10, par4)[1]); + GL11.glRotatef(-var5, 0.0F, 1.0F, 0.0F); + GL11.glRotatef(var6 * 10.0F, 1.0F, 0.0F, 0.0F); + GL11.glTranslatef(0.0F, 0.0F, 1.0F); +- if(var1.deathTime > 0) { +- float var7 = ((float)var1.deathTime + var4 - 1.0F) / 20.0F * 1.6F; ++ ++ if (par1EntityDragon.deathTime > 0) { ++ float var7 = ((float)par1EntityDragon.deathTime + par4 - 1.0F) / 20.0F * 1.6F; + var7 = MathHelper.sqrt_float(var7); +- if(var7 > 1.0F) { ++ ++ if (var7 > 1.0F) { + var7 = 1.0F; + } + +- GL11.glRotatef(var7 * this.getDeathMaxRotation(var1), 0.0F, 0.0F, 1.0F); ++ GL11.glRotatef(var7 * this.getDeathMaxRotation(par1EntityDragon), 0.0F, 0.0F, 1.0F); + } +- + } + +- protected void renderDragonModel(EntityDragon var1, float var2, float var3, float var4, float var5, float var6, float var7) { +- if(var1.deathTicks > 0) { +- float var8 = (float)var1.deathTicks / 200.0F; ++ /** ++ * Renders the dragon model. Called by renderModel. ++ */ ++ protected void renderDragonModel(EntityDragon par1EntityDragon, float par2, float par3, float par4, float par5, float par6, float par7) { ++ if (par1EntityDragon.deathTicks > 0) { ++ float var8 = (float)par1EntityDragon.deathTicks / 200.0F; + GL11.glDepthFunc(GL11.GL_LEQUAL); + GL11.glEnable(GL11.GL_ALPHA_TEST); + GL11.glAlphaFunc(GL11.GL_GREATER, var8); + this.bindTexture(enderDragonExplodingTextures); +- this.mainModel.render(var1, var2, var3, var4, var5, var6, var7); ++ this.mainModel.render(par1EntityDragon, par2, par3, par4, par5, par6, par7); + GL11.glAlphaFunc(GL11.GL_GREATER, 0.1F); + GL11.glDepthFunc(GL11.GL_EQUAL); + } + +- this.bindEntityTexture(var1); +- this.mainModel.render(var1, var2, var3, var4, var5, var6, var7); +- if(var1.hurtTime > 0) { ++ this.bindEntityTexture(par1EntityDragon); ++ this.mainModel.render(par1EntityDragon, par2, par3, par4, par5, par6, par7); ++ ++ if (par1EntityDragon.hurtTime > 0) { + GL11.glDepthFunc(GL11.GL_EQUAL); + GL11.glDisable(GL11.GL_TEXTURE_2D); + GL11.glEnable(GL11.GL_BLEND); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + GL11.glColor4f(1.0F, 0.0F, 0.0F, 0.5F); +- this.mainModel.render(var1, var2, var3, var4, var5, var6, var7); ++ this.mainModel.render(par1EntityDragon, par2, par3, par4, par5, par6, par7); + GL11.glEnable(GL11.GL_TEXTURE_2D); + GL11.glDisable(GL11.GL_BLEND); + GL11.glDepthFunc(GL11.GL_LEQUAL); + } +- + } + +- public void renderDragon(EntityDragon var1, double var2, double var4, double var6, float var8, float var9) { +- BossStatus.setBossStatus(var1, false); +- super.doRenderLiving(var1, var2, var4, var6, var8, var9); +- if(var1.healingEnderCrystal != null) { +- float var10 = (float)var1.healingEnderCrystal.innerRotation + var9; ++ /** ++ * Renders the dragon, along with its dying animation ++ */ ++ public void renderDragon(EntityDragon par1EntityDragon, double par2, double par4, double par6, float par8, float par9) { ++ BossStatus.setBossStatus(par1EntityDragon, false); ++ super.doRenderLiving(par1EntityDragon, par2, par4, par6, par8, par9); ++ ++ if (par1EntityDragon.healingEnderCrystal != null) { ++ float var10 = (float)par1EntityDragon.healingEnderCrystal.innerRotation + par9; + float var11 = MathHelper.sin(var10 * 0.2F) / 2.0F + 0.5F; + var11 = (var11 * var11 + var11) * 0.2F; +- float var12 = (float)(var1.healingEnderCrystal.posX - var1.posX - (var1.prevPosX - var1.posX) * (double)(1.0F - var9)); +- float var13 = (float)((double)var11 + var1.healingEnderCrystal.posY - 1.0D - var1.posY - (var1.prevPosY - var1.posY) * (double)(1.0F - var9)); +- float var14 = (float)(var1.healingEnderCrystal.posZ - var1.posZ - (var1.prevPosZ - var1.posZ) * (double)(1.0F - var9)); ++ float var12 = (float)(par1EntityDragon.healingEnderCrystal.posX - par1EntityDragon.posX - (par1EntityDragon.prevPosX - par1EntityDragon.posX) * (double)(1.0F - par9)); ++ float var13 = (float)((double)var11 + par1EntityDragon.healingEnderCrystal.posY - 1.0D - par1EntityDragon.posY - (par1EntityDragon.prevPosY - par1EntityDragon.posY) * (double)(1.0F - par9)); ++ float var14 = (float)(par1EntityDragon.healingEnderCrystal.posZ - par1EntityDragon.posZ - (par1EntityDragon.prevPosZ - par1EntityDragon.posZ) * (double)(1.0F - par9)); + float var15 = MathHelper.sqrt_float(var12 * var12 + var14 * var14); + float var16 = MathHelper.sqrt_float(var12 * var12 + var13 * var13 + var14 * var14); + GL11.glPushMatrix(); +- GL11.glTranslatef((float)var2, (float)var4 + 2.0F, (float)var6); ++ GL11.glTranslatef((float)par2, (float)par4 + 2.0F, (float)par6); + GL11.glRotatef((float)(-Math.atan2((double)var14, (double)var12)) * 180.0F / (float)Math.PI - 90.0F, 0.0F, 1.0F, 0.0F); + GL11.glRotatef((float)(-Math.atan2((double)var15, (double)var13)) * 180.0F / (float)Math.PI - 90.0F, 1.0F, 0.0F, 0.0F); + Tessellator var17 = Tessellator.instance; +@@ -82,14 +96,14 @@ + GL11.glDisable(GL11.GL_CULL_FACE); + this.bindTexture(enderDragonCrystalBeamTextures); + GL11.glShadeModel(GL11.GL_SMOOTH); +- float var18 = 0.0F - ((float)var1.ticksExisted + var9) * 0.01F; +- float var19 = MathHelper.sqrt_float(var12 * var12 + var13 * var13 + var14 * var14) / 32.0F - ((float)var1.ticksExisted + var9) * 0.01F; ++ float var18 = 0.0F - ((float)par1EntityDragon.ticksExisted + par9) * 0.01F; ++ float var19 = MathHelper.sqrt_float(var12 * var12 + var13 * var13 + var14 * var14) / 32.0F - ((float)par1EntityDragon.ticksExisted + par9) * 0.01F; + var17.startDrawing(5); + byte var20 = 8; + +- for(int var21 = 0; var21 <= var20; ++var21) { +- float var22 = MathHelper.sin((float)(var21 % var20) * (float)Math.PI * 2.0F / (float)var20) * (12.0F / 16.0F); +- float var23 = MathHelper.cos((float)(var21 % var20) * (float)Math.PI * 2.0F / (float)var20) * (12.0F / 16.0F); ++ for (int var21 = 0; var21 <= var20; ++var21) { ++ float var22 = MathHelper.sin((float)(var21 % var20) * (float)Math.PI * 2.0F / (float)var20) * 0.75F; ++ float var23 = MathHelper.cos((float)(var21 % var20) * (float)Math.PI * 2.0F / (float)var20) * 0.75F; + float var24 = (float)(var21 % var20) * 1.0F / (float)var20; + var17.setColorOpaque_I(0); + var17.addVertexWithUV((double)(var22 * 0.2F), (double)(var23 * 0.2F), 0.0D, (double)var24, (double)var19); +@@ -103,21 +117,25 @@ + RenderHelper.enableStandardItemLighting(); + GL11.glPopMatrix(); + } +- + } + +- protected ResourceLocation getEnderDragonTextures(EntityDragon var1) { ++ protected ResourceLocation getEnderDragonTextures(EntityDragon par1EntityDragon) { + return enderDragonTextures; + } + +- protected void renderDragonDying(EntityDragon var1, float var2) { +- super.renderEquippedItems(var1, var2); ++ /** ++ * Renders the animation for when an enderdragon dies ++ */ ++ protected void renderDragonDying(EntityDragon par1EntityDragon, float par2) { ++ super.renderEquippedItems(par1EntityDragon, par2); + Tessellator var3 = Tessellator.instance; +- if(var1.deathTicks > 0) { ++ ++ if (par1EntityDragon.deathTicks > 0) { + RenderHelper.disableStandardItemLighting(); +- float var4 = ((float)var1.deathTicks + var2) / 200.0F; ++ float var4 = ((float)par1EntityDragon.deathTicks + par2) / 200.0F; + float var5 = 0.0F; +- if(var4 > 0.8F) { ++ ++ if (var4 > 0.8F) { + var5 = (var4 - 0.8F) / 0.2F; + } + +@@ -132,7 +150,7 @@ + GL11.glPushMatrix(); + GL11.glTranslatef(0.0F, -1.0F, -2.0F); + +- for(int var7 = 0; (float)var7 < (var4 + var4 * var4) / 2.0F * 60.0F; ++var7) { ++ for (int var7 = 0; (float)var7 < (var4 + var4 * var4) / 2.0F * 60.0F; ++var7) { + GL11.glRotatef(var6.nextFloat() * 360.0F, 1.0F, 0.0F, 0.0F); + GL11.glRotatef(var6.nextFloat() * 360.0F, 0.0F, 1.0F, 0.0F); + GL11.glRotatef(var6.nextFloat() * 360.0F, 0.0F, 0.0F, 1.0F); +@@ -162,15 +180,17 @@ + GL11.glEnable(GL11.GL_ALPHA_TEST); + RenderHelper.enableStandardItemLighting(); + } +- + } + +- protected int renderGlow(EntityDragon var1, int var2, float var3) { +- if(var2 == 1) { ++ /** ++ * Renders the overlay for glowing eyes and the mouth. Called by shouldRenderPass. ++ */ ++ protected int renderGlow(EntityDragon par1EntityDragon, int par2, float par3) { ++ if (par2 == 1) { + GL11.glDepthFunc(GL11.GL_LEQUAL); + } + +- if(var2 != 0) { ++ if (par2 != 0) { + return -1; + } else { + this.bindTexture(enderDragonEyesTextures); +@@ -180,7 +200,7 @@ + GL11.glBlendFunc(GL11.GL_ONE, GL11.GL_ONE); + GL11.glDisable(GL11.GL_LIGHTING); + GL11.glDepthFunc(GL11.GL_EQUAL); +- char var5 = '\uf0f0'; ++ char var5 = 61680; + int var6 = var5 % 65536; + int var7 = var5 / 65536; + OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, (float)var6 / 1.0F, (float)var7 / 1.0F); +@@ -191,35 +211,50 @@ + } + } + +- public void doRenderLiving(EntityLiving var1, double var2, double var4, double var6, float var8, float var9) { +- this.renderDragon((EntityDragon)var1, var2, var4, var6, var8, var9); +- } +- +- protected int shouldRenderPass(EntityLivingBase var1, int var2, float var3) { +- return this.renderGlow((EntityDragon)var1, var2, var3); +- } +- +- protected void renderEquippedItems(EntityLivingBase var1, float var2) { +- this.renderDragonDying((EntityDragon)var1, var2); +- } +- +- protected void rotateCorpse(EntityLivingBase var1, float var2, float var3, float var4) { +- this.rotateDragonBody((EntityDragon)var1, var2, var3, var4); +- } +- +- protected void renderModel(EntityLivingBase var1, float var2, float var3, float var4, float var5, float var6, float var7) { +- this.renderDragonModel((EntityDragon)var1, var2, var3, var4, var5, var6, var7); +- } +- +- public void renderPlayer(EntityLivingBase var1, double var2, double var4, double var6, float var8, float var9) { +- this.renderDragon((EntityDragon)var1, var2, var4, var6, var8, var9); +- } +- +- protected ResourceLocation getEntityTexture(Entity var1) { +- return this.getEnderDragonTextures((EntityDragon)var1); +- } +- +- public void doRender(Entity var1, double var2, double var4, double var6, float var8, float var9) { +- this.renderDragon((EntityDragon)var1, var2, var4, var6, var8, var9); ++ public void doRenderLiving(EntityLiving par1EntityLiving, double par2, double par4, double par6, float par8, float par9) { ++ this.renderDragon((EntityDragon)par1EntityLiving, par2, par4, par6, par8, par9); ++ } ++ ++ /** ++ * Queries whether should render the specified pass or not. ++ */ ++ protected int shouldRenderPass(EntityLivingBase par1EntityLivingBase, int par2, float par3) { ++ return this.renderGlow((EntityDragon)par1EntityLivingBase, par2, par3); ++ } ++ ++ protected void renderEquippedItems(EntityLivingBase par1EntityLivingBase, float par2) { ++ this.renderDragonDying((EntityDragon)par1EntityLivingBase, par2); ++ } ++ ++ protected void rotateCorpse(EntityLivingBase par1EntityLivingBase, float par2, float par3, float par4) { ++ this.rotateDragonBody((EntityDragon)par1EntityLivingBase, par2, par3, par4); ++ } ++ ++ /** ++ * Renders the model in RenderLiving ++ */ ++ protected void renderModel(EntityLivingBase par1EntityLivingBase, float par2, float par3, float par4, float par5, float par6, float par7) { ++ this.renderDragonModel((EntityDragon)par1EntityLivingBase, par2, par3, par4, par5, par6, par7); ++ } ++ ++ public void renderPlayer(EntityLivingBase par1EntityLivingBase, double par2, double par4, double par6, float par8, float par9) { ++ this.renderDragon((EntityDragon)par1EntityLivingBase, par2, par4, par6, par8, par9); ++ } ++ ++ /** ++ * Returns the location of an entity's texture. Doesn't seem to be called unless you call Render.bindEntityTexture. ++ */ ++ protected ResourceLocation getEntityTexture(Entity par1Entity) { ++ return this.getEnderDragonTextures((EntityDragon)par1Entity); ++ } ++ ++ /** ++ * Actually renders the given argument. This is a synthetic bridge method, always casting down its argument and then ++ * handing it off to a worker function which does the actual work. In all probabilty, the class Render is generic ++ * (Render= (float)Math.PI; var10 -= (float)Math.PI * 2.0F) { +- } +- +- while(var10 < -((float)Math.PI)) { +- var10 += (float)Math.PI * 2.0F; +- } +- +- float var11 = var1.bookRotationPrev + var10 * var8; ++ ++ for (var10 = par1TileEntityEnchantmentTable.bookRotation2 - par1TileEntityEnchantmentTable.bookRotationPrev; var10 >= (float)Math.PI; var10 -= ((float)Math.PI * 2F)) { ++ ; ++ } ++ ++ while (var10 < -(float)Math.PI) { ++ var10 += ((float)Math.PI * 2F); ++ } ++ ++ float var11 = par1TileEntityEnchantmentTable.bookRotationPrev + var10 * par8; + GL11.glRotatef(-var11 * 180.0F / (float)Math.PI, 0.0F, 1.0F, 0.0F); + GL11.glRotatef(80.0F, 0.0F, 0.0F, 1.0F); + this.bindTexture(enchantingTableBookTextures); +- float var12 = var1.pageFlipPrev + (var1.pageFlip - var1.pageFlipPrev) * var8 + 0.25F; +- float var13 = var1.pageFlipPrev + (var1.pageFlip - var1.pageFlipPrev) * var8 + 12.0F / 16.0F; ++ float var12 = par1TileEntityEnchantmentTable.pageFlipPrev + (par1TileEntityEnchantmentTable.pageFlip - par1TileEntityEnchantmentTable.pageFlipPrev) * par8 + 0.25F; ++ float var13 = par1TileEntityEnchantmentTable.pageFlipPrev + (par1TileEntityEnchantmentTable.pageFlip - par1TileEntityEnchantmentTable.pageFlipPrev) * par8 + 0.75F; + var12 = (var12 - (float)MathHelper.truncateDoubleToInt((double)var12)) * 1.6F - 0.3F; + var13 = (var13 - (float)MathHelper.truncateDoubleToInt((double)var13)) * 1.6F - 0.3F; +- if(var12 < 0.0F) { ++ ++ if (var12 < 0.0F) { + var12 = 0.0F; + } + +- if(var13 < 0.0F) { ++ if (var13 < 0.0F) { + var13 = 0.0F; + } + +- if(var12 > 1.0F) { ++ if (var12 > 1.0F) { + var12 = 1.0F; + } + +- if(var13 > 1.0F) { ++ if (var13 > 1.0F) { + var13 = 1.0F; + } + +- float var14 = var1.bookSpreadPrev + (var1.bookSpread - var1.bookSpreadPrev) * var8; ++ float var14 = par1TileEntityEnchantmentTable.bookSpreadPrev + (par1TileEntityEnchantmentTable.bookSpread - par1TileEntityEnchantmentTable.bookSpreadPrev) * par8; + GL11.glEnable(GL11.GL_CULL_FACE); +- this.enchantmentBook.render((Entity)null, var9, var12, var13, var14, 0.0F, 1.0F / 16.0F); ++ this.enchantmentBook.render((Entity)null, var9, var12, var13, var14, 0.0F, 0.0625F); + GL11.glPopMatrix(); + } + +- public void renderTileEntityAt(TileEntity var1, double var2, double var4, double var6, float var8) { +- this.renderTileEntityEnchantmentTableAt((TileEntityEnchantmentTable)var1, var2, var4, var6, var8); ++ public void renderTileEntityAt(TileEntity par1TileEntity, double par2, double par4, double par6, float par8) { ++ this.renderTileEntityEnchantmentTableAt((TileEntityEnchantmentTable)par1TileEntity, par2, par4, par6, par8); + } + } diff --git a/patches/net/minecraft/src/RenderEndPortal.java.patch b/patches/net/minecraft/src/RenderEndPortal.java.patch new file mode 100644 index 0000000..10fae99 --- /dev/null +++ b/patches/net/minecraft/src/RenderEndPortal.java.patch @@ -0,0 +1,116 @@ +--- net/minecraft/src/RenderEndPortal.java ++++ net/minecraft/src/RenderEndPortal.java +@@ -7,43 +7,47 @@ + public class RenderEndPortal extends TileEntitySpecialRenderer { + private static final ResourceLocation enderPortalEndSkyTextures = new ResourceLocation("textures/environment/end_sky.png"); + private static final ResourceLocation endPortalTextures = new ResourceLocation("textures/entity/end_portal.png"); +- private static final Random e = new Random(31100L); +- FloatBuffer a = GLAllocation.createDirectFloatBuffer(16); ++ private static final Random field_110644_e = new Random(31100L); ++ FloatBuffer field_76908_a = GLAllocation.createDirectFloatBuffer(16); + +- public void renderEndPortalTileEntity(TileEntityEndPortal var1, double var2, double var4, double var6, float var8) { ++ /** ++ * Renders the End Portal. ++ */ ++ public void renderEndPortalTileEntity(TileEntityEndPortal par1TileEntityEndPortal, double par2, double par4, double par6, float par8) { + float var9 = (float)this.tileEntityRenderer.playerX; + float var10 = (float)this.tileEntityRenderer.playerY; + float var11 = (float)this.tileEntityRenderer.playerZ; + GL11.glDisable(GL11.GL_LIGHTING); +- e.setSeed(31100L); +- float var12 = 12.0F / 16.0F; ++ field_110644_e.setSeed(31100L); ++ float var12 = 0.75F; + +- for(int var13 = 0; var13 < 16; ++var13) { ++ for (int var13 = 0; var13 < 16; ++var13) { + GL11.glPushMatrix(); + float var14 = (float)(16 - var13); +- float var15 = 1.0F / 16.0F; ++ float var15 = 0.0625F; + float var16 = 1.0F / (var14 + 1.0F); +- if(var13 == 0) { ++ ++ if (var13 == 0) { + this.bindTexture(enderPortalEndSkyTextures); + var16 = 0.1F; + var14 = 65.0F; +- var15 = 2.0F / 16.0F; ++ var15 = 0.125F; + GL11.glEnable(GL11.GL_BLEND); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + } + +- if(var13 == 1) { ++ if (var13 == 1) { + this.bindTexture(endPortalTextures); + GL11.glEnable(GL11.GL_BLEND); + GL11.glBlendFunc(GL11.GL_ONE, GL11.GL_ONE); + var15 = 0.5F; + } + +- float var17 = (float)(-(var4 + (double)var12)); ++ float var17 = (float)(-(par4 + (double)var12)); + float var18 = var17 + ActiveRenderInfo.objectY; + float var19 = var17 + var14 + ActiveRenderInfo.objectY; + float var20 = var18 / var19; +- var20 += (float)(var4 + (double)var12); ++ var20 += (float)(par4 + (double)var12); + GL11.glTranslatef(var9, var20, var11); + GL11.glTexGeni(GL11.GL_S, GL11.GL_TEXTURE_GEN_MODE, GL11.GL_OBJECT_LINEAR); + GL11.glTexGeni(GL11.GL_T, GL11.GL_TEXTURE_GEN_MODE, GL11.GL_OBJECT_LINEAR); +@@ -71,20 +75,21 @@ + GL11.glTranslatef(ActiveRenderInfo.objectX * var14 / var18, ActiveRenderInfo.objectZ * var14 / var18, -var10); + Tessellator var23 = Tessellator.instance; + var23.startDrawingQuads(); +- var20 = e.nextFloat() * 0.5F + 0.1F; +- float var21 = e.nextFloat() * 0.5F + 0.4F; +- float var22 = e.nextFloat() * 0.5F + 0.5F; +- if(var13 == 0) { ++ var20 = field_110644_e.nextFloat() * 0.5F + 0.1F; ++ float var21 = field_110644_e.nextFloat() * 0.5F + 0.4F; ++ float var22 = field_110644_e.nextFloat() * 0.5F + 0.5F; ++ ++ if (var13 == 0) { + var22 = 1.0F; +- var21 = var22; +- var20 = var22; ++ var21 = 1.0F; ++ var20 = 1.0F; + } + + var23.setColorRGBA_F(var20 * var16, var21 * var16, var22 * var16, 1.0F); +- var23.addVertex(var2, var4 + (double)var12, var6); +- var23.addVertex(var2, var4 + (double)var12, var6 + 1.0D); +- var23.addVertex(var2 + 1.0D, var4 + (double)var12, var6 + 1.0D); +- var23.addVertex(var2 + 1.0D, var4 + (double)var12, var6); ++ var23.addVertex(par2, par4 + (double)var12, par6); ++ var23.addVertex(par2, par4 + (double)var12, par6 + 1.0D); ++ var23.addVertex(par2 + 1.0D, par4 + (double)var12, par6 + 1.0D); ++ var23.addVertex(par2 + 1.0D, par4 + (double)var12, par6); + var23.draw(); + GL11.glPopMatrix(); + GL11.glMatrixMode(GL11.GL_MODELVIEW); +@@ -98,14 +103,14 @@ + GL11.glEnable(GL11.GL_LIGHTING); + } + +- private FloatBuffer func_76907_a(float var1, float var2, float var3, float var4) { +- this.a.clear(); +- this.a.put(var1).put(var2).put(var3).put(var4); +- this.a.flip(); +- return this.a; ++ private FloatBuffer func_76907_a(float par1, float par2, float par3, float par4) { ++ this.field_76908_a.clear(); ++ this.field_76908_a.put(par1).put(par2).put(par3).put(par4); ++ this.field_76908_a.flip(); ++ return this.field_76908_a; + } + +- public void renderTileEntityAt(TileEntity var1, double var2, double var4, double var6, float var8) { +- this.renderEndPortalTileEntity((TileEntityEndPortal)var1, var2, var4, var6, var8); ++ public void renderTileEntityAt(TileEntity par1TileEntity, double par2, double par4, double par6, float par8) { ++ this.renderEndPortalTileEntity((TileEntityEndPortal)par1TileEntity, par2, par4, par6, par8); + } + } diff --git a/patches/net/minecraft/src/RenderEnderCrystal.java.patch b/patches/net/minecraft/src/RenderEnderCrystal.java.patch new file mode 100644 index 0000000..0874c8f --- /dev/null +++ b/patches/net/minecraft/src/RenderEnderCrystal.java.patch @@ -0,0 +1,50 @@ +--- net/minecraft/src/RenderEnderCrystal.java ++++ net/minecraft/src/RenderEnderCrystal.java +@@ -11,26 +11,38 @@ + this.field_76995_b = new ModelEnderCrystal(0.0F, true); + } + +- public void doRenderEnderCrystal(EntityEnderCrystal var1, double var2, double var4, double var6, float var8, float var9) { +- float var10 = (float)var1.innerRotation + var9; ++ /** ++ * Renders the Ender Crystal. ++ */ ++ public void doRenderEnderCrystal(EntityEnderCrystal par1EntityEnderCrystal, double par2, double par4, double par6, float par8, float par9) { ++ float var10 = (float)par1EntityEnderCrystal.innerRotation + par9; + GL11.glPushMatrix(); +- GL11.glTranslatef((float)var2, (float)var4, (float)var6); ++ GL11.glTranslatef((float)par2, (float)par4, (float)par6); + this.bindTexture(enderCrystalTextures); + float var11 = MathHelper.sin(var10 * 0.2F) / 2.0F + 0.5F; + var11 += var11 * var11; +- this.field_76995_b.render(var1, 0.0F, var10 * 3.0F, var11 * 0.2F, 0.0F, 0.0F, 1.0F / 16.0F); ++ this.field_76995_b.render(par1EntityEnderCrystal, 0.0F, var10 * 3.0F, var11 * 0.2F, 0.0F, 0.0F, 0.0625F); + GL11.glPopMatrix(); + } + +- protected ResourceLocation getEnderCrystalTextures(EntityEnderCrystal var1) { ++ protected ResourceLocation getEnderCrystalTextures(EntityEnderCrystal par1EntityEnderCrystal) { + return enderCrystalTextures; + } + +- protected ResourceLocation getEntityTexture(Entity var1) { +- return this.getEnderCrystalTextures((EntityEnderCrystal)var1); ++ /** ++ * Returns the location of an entity's texture. Doesn't seem to be called unless you call Render.bindEntityTexture. ++ */ ++ protected ResourceLocation getEntityTexture(Entity par1Entity) { ++ return this.getEnderCrystalTextures((EntityEnderCrystal)par1Entity); + } + +- public void doRender(Entity var1, double var2, double var4, double var6, float var8, float var9) { +- this.doRenderEnderCrystal((EntityEnderCrystal)var1, var2, var4, var6, var8, var9); ++ /** ++ * Actually renders the given argument. This is a synthetic bridge method, always casting down its argument and then ++ * handing it off to a worker function which does the actual work. In all probabilty, the class Render is generic ++ * (Render 0; +- this.endermanModel.isAttacking = var1.isScreaming(); +- if(var1.isScreaming()) { ++ /** ++ * Renders the enderman ++ */ ++ public void renderEnderman(EntityEnderman par1EntityEnderman, double par2, double par4, double par6, float par8, float par9) { ++ this.endermanModel.isCarrying = par1EntityEnderman.getCarried() > 0; ++ this.endermanModel.isAttacking = par1EntityEnderman.isScreaming(); ++ ++ if (par1EntityEnderman.isScreaming()) { + double var10 = 0.02D; +- var2 += this.h.nextGaussian() * var10; +- var6 += this.h.nextGaussian() * var10; ++ par2 += this.rnd.nextGaussian() * var10; ++ par6 += this.rnd.nextGaussian() * var10; + } + +- super.doRenderLiving(var1, var2, var4, var6, var8, var9); ++ super.doRenderLiving(par1EntityEnderman, par2, par4, par6, par8, par9); + } +- +- protected ResourceLocation getEndermanTextures(EntityEnderman var1) { ++ ++ protected ResourceLocation getEndermanTextures(EntityEnderman par1EntityEnderman) { + return endermanTextures; + } + +- protected void renderCarrying(EntityEnderman var1, float var2) { +- super.renderEquippedItems(var1, var2); +- if(var1.getCarried() > 0) { ++ /** ++ * Render the block an enderman is carrying ++ */ ++ protected void renderCarrying(EntityEnderman par1EntityEnderman, float par2) { ++ super.renderEquippedItems(par1EntityEnderman, par2); ++ ++ if (par1EntityEnderman.getCarried() > 0) { + GL11.glEnable(GL12.GL_RESCALE_NORMAL); + GL11.glPushMatrix(); + float var3 = 0.5F; +- GL11.glTranslatef(0.0F, 11.0F / 16.0F, -(12.0F / 16.0F)); ++ GL11.glTranslatef(0.0F, 0.6875F, -0.75F); + var3 *= 1.0F; + GL11.glRotatef(20.0F, 1.0F, 0.0F, 0.0F); + GL11.glRotatef(45.0F, 0.0F, 1.0F, 0.0F); + GL11.glScalef(-var3, -var3, var3); +- int var4 = var1.getBrightnessForRender(var2); ++ int var4 = par1EntityEnderman.getBrightnessForRender(par2); + int var5 = var4 % 65536; + int var6 = var4 / 65536; + OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, (float)var5 / 1.0F, (float)var6 / 1.0F); + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + this.bindTexture(TextureMap.locationBlocksTexture); +- this.renderBlocks.renderBlockAsItem(Block.blocksList[var1.getCarried()], var1.getCarryingData(), 1.0F); ++ this.renderBlocks.renderBlockAsItem(Block.blocksList[par1EntityEnderman.getCarried()], par1EntityEnderman.getCarryingData(), 1.0F); + GL11.glPopMatrix(); + GL11.glDisable(GL12.GL_RESCALE_NORMAL); + } +- + } + +- protected int renderEyes(EntityEnderman var1, int var2, float var3) { +- if(var2 != 0) { ++ /** ++ * Render the endermans eyes ++ */ ++ protected int renderEyes(EntityEnderman par1EntityEnderman, int par2, float par3) { ++ if (par2 != 0) { + return -1; + } else { +- this.bindTexture(endermanEyesTexture); ++ // Spout Start ++ if (Configuration.isRandomMobTextures()) { ++ this.bindTexture(MobRandomizer.randomTexture((EntityLivingBase)par1EntityEnderman, endermanEyesTexture)); ++ } else { ++ // ToDO: Fix this. ++ //loadTexture(par1EntityEnderman.getCustomTexture(org.spoutcraft.api.entity.EntitySkinType.ENDERMAN_EYES, "/mob/enderman_eyes.png")); ++ } ++ // Spout End + float var4 = 1.0F; + GL11.glEnable(GL11.GL_BLEND); + GL11.glDisable(GL11.GL_ALPHA_TEST); + GL11.glBlendFunc(GL11.GL_ONE, GL11.GL_ONE); + GL11.glDisable(GL11.GL_LIGHTING); +- if(var1.isInvisible()) { ++ ++ if (par1EntityEnderman.isInvisible()) { + GL11.glDepthMask(false); + } else { + GL11.glDepthMask(true); + } + +- char var5 = '\uf0f0'; ++ char var5 = 61680; + int var6 = var5 % 65536; + int var7 = var5 / 65536; + OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, (float)var6 / 1.0F, (float)var7 / 1.0F); +@@ -83,27 +108,39 @@ + } + } + +- public void doRenderLiving(EntityLiving var1, double var2, double var4, double var6, float var8, float var9) { +- this.renderEnderman((EntityEnderman)var1, var2, var4, var6, var8, var9); +- } +- +- protected int shouldRenderPass(EntityLivingBase var1, int var2, float var3) { +- return this.renderEyes((EntityEnderman)var1, var2, var3); +- } +- +- protected void renderEquippedItems(EntityLivingBase var1, float var2) { +- this.renderCarrying((EntityEnderman)var1, var2); +- } +- +- public void renderPlayer(EntityLivingBase var1, double var2, double var4, double var6, float var8, float var9) { +- this.renderEnderman((EntityEnderman)var1, var2, var4, var6, var8, var9); +- } +- +- protected ResourceLocation getEntityTexture(Entity var1) { +- return this.getEndermanTextures((EntityEnderman)var1); +- } +- +- public void doRender(Entity var1, double var2, double var4, double var6, float var8, float var9) { +- this.renderEnderman((EntityEnderman)var1, var2, var4, var6, var8, var9); ++ public void doRenderLiving(EntityLiving par1EntityLiving, double par2, double par4, double par6, float par8, float par9) { ++ this.renderEnderman((EntityEnderman)par1EntityLiving, par2, par4, par6, par8, par9); ++ } ++ ++ /** ++ * Queries whether should render the specified pass or not. ++ */ ++ protected int shouldRenderPass(EntityLivingBase par1EntityLivingBase, int par2, float par3) { ++ return this.renderEyes((EntityEnderman)par1EntityLivingBase, par2, par3); ++ } ++ ++ protected void renderEquippedItems(EntityLivingBase par1EntityLivingBase, float par2) { ++ this.renderCarrying((EntityEnderman)par1EntityLivingBase, par2); ++ } ++ ++ public void renderPlayer(EntityLivingBase par1EntityLivingBase, double par2, double par4, double par6, float par8, float par9) { ++ this.renderEnderman((EntityEnderman)par1EntityLivingBase, par2, par4, par6, par8, par9); ++ } ++ ++ /** ++ * Returns the location of an entity's texture. Doesn't seem to be called unless you call Render.bindEntityTexture. ++ */ ++ protected ResourceLocation getEntityTexture(Entity par1Entity) { ++ return this.getEndermanTextures((EntityEnderman)par1Entity); ++ } ++ ++ /** ++ * Actually renders the given argument. This is a synthetic bridge method, always casting down its argument and then ++ * handing it off to a worker function which does the actual work. In all probabilty, the class Render is generic ++ * (Render 0 || var1.angler != Minecraft.getMinecraft().thePlayer) { +- float var31 = (var1.angler.prevRenderYawOffset + (var1.angler.renderYawOffset - var1.angler.prevRenderYawOffset) * var9) * (float)Math.PI / 180.0F; ++ double var23 = par1EntityFishHook.angler.prevPosX + (par1EntityFishHook.angler.posX - par1EntityFishHook.angler.prevPosX) * (double)par9 + var22.xCoord; ++ double var25 = par1EntityFishHook.angler.prevPosY + (par1EntityFishHook.angler.posY - par1EntityFishHook.angler.prevPosY) * (double)par9 + var22.yCoord; ++ double var27 = par1EntityFishHook.angler.prevPosZ + (par1EntityFishHook.angler.posZ - par1EntityFishHook.angler.prevPosZ) * (double)par9 + var22.zCoord; ++ double var29 = par1EntityFishHook.angler == Minecraft.getMinecraft().thePlayer ? 0.0D : (double)par1EntityFishHook.angler.getEyeHeight(); ++ ++ if (this.renderManager.options.thirdPersonView > 0 || par1EntityFishHook.angler != Minecraft.getMinecraft().thePlayer) { ++ float var31 = (par1EntityFishHook.angler.prevRenderYawOffset + (par1EntityFishHook.angler.renderYawOffset - par1EntityFishHook.angler.prevRenderYawOffset) * par9) * (float)Math.PI / 180.0F; + double var32 = (double)MathHelper.sin(var31); + double var34 = (double)MathHelper.cos(var31); +- var23 = var1.angler.prevPosX + (var1.angler.posX - var1.angler.prevPosX) * (double)var9 - var34 * 0.35D - var32 * 0.85D; +- var25 = var1.angler.prevPosY + var29 + (var1.angler.posY - var1.angler.prevPosY) * (double)var9 - 0.45D; +- var27 = var1.angler.prevPosZ + (var1.angler.posZ - var1.angler.prevPosZ) * (double)var9 - var32 * 0.35D + var34 * 0.85D; ++ var23 = par1EntityFishHook.angler.prevPosX + (par1EntityFishHook.angler.posX - par1EntityFishHook.angler.prevPosX) * (double)par9 - var34 * 0.35D - var32 * 0.85D; ++ var25 = par1EntityFishHook.angler.prevPosY + var29 + (par1EntityFishHook.angler.posY - par1EntityFishHook.angler.prevPosY) * (double)par9 - 0.45D; ++ var27 = par1EntityFishHook.angler.prevPosZ + (par1EntityFishHook.angler.posZ - par1EntityFishHook.angler.prevPosZ) * (double)par9 - var32 * 0.35D + var34 * 0.85D; + } + +- double var46 = var1.prevPosX + (var1.posX - var1.prevPosX) * (double)var9; +- double var33 = var1.prevPosY + (var1.posY - var1.prevPosY) * (double)var9 + 0.25D; +- double var35 = var1.prevPosZ + (var1.posZ - var1.prevPosZ) * (double)var9; ++ double var46 = par1EntityFishHook.prevPosX + (par1EntityFishHook.posX - par1EntityFishHook.prevPosX) * (double)par9; ++ double var33 = par1EntityFishHook.prevPosY + (par1EntityFishHook.posY - par1EntityFishHook.prevPosY) * (double)par9 + 0.25D; ++ double var35 = par1EntityFishHook.prevPosZ + (par1EntityFishHook.posZ - par1EntityFishHook.prevPosZ) * (double)par9; + double var37 = (double)((float)(var23 - var46)); + double var39 = (double)((float)(var25 - var33)); + double var41 = (double)((float)(var27 - var35)); +@@ -66,27 +71,35 @@ + var10.setColorOpaque_I(0); + byte var43 = 16; + +- for(int var44 = 0; var44 <= var43; ++var44) { ++ for (int var44 = 0; var44 <= var43; ++var44) { + float var45 = (float)var44 / (float)var43; +- var10.addVertex(var2 + var37 * (double)var45, var4 + var39 * (double)(var45 * var45 + var45) * 0.5D + 0.25D, var6 + var41 * (double)var45); ++ var10.addVertex(par2 + var37 * (double)var45, par4 + var39 * (double)(var45 * var45 + var45) * 0.5D + 0.25D, par6 + var41 * (double)var45); + } + + var10.draw(); + GL11.glEnable(GL11.GL_LIGHTING); + GL11.glEnable(GL11.GL_TEXTURE_2D); + } +- + } + +- protected ResourceLocation func_110791_a(EntityFishHook var1) { ++ protected ResourceLocation func_110791_a(EntityFishHook par1EntityFishHook) { + return field_110792_a; + } + +- protected ResourceLocation getEntityTexture(Entity var1) { +- return this.func_110791_a((EntityFishHook)var1); ++ /** ++ * Returns the location of an entity's texture. Doesn't seem to be called unless you call Render.bindEntityTexture. ++ */ ++ protected ResourceLocation getEntityTexture(Entity par1Entity) { ++ return this.func_110791_a((EntityFishHook)par1Entity); + } + +- public void doRender(Entity var1, double var2, double var4, double var6, float var8, float var9) { +- this.doRenderFishHook((EntityFishHook)var1, var2, var4, var6, var8, var9); ++ /** ++ * Actually renders the given argument. This is a synthetic bridge method, always casting down its argument and then ++ * handing it off to a worker function which does the actual work. In all probabilty, the class Render is generic ++ * (Render